From: support Date: Fri, 27 Jan 2023 09:24:46 +0000 (+0000) Subject: Built motion from commit 0c5f406c.|2.6.29 X-Git-Url: http://repos.xcallymotion.com/?a=commitdiff_plain;h=17de01c943f97f999d24a90d69f1bcf1020f5dc8;p=motion2.git Built motion from commit 0c5f406c.|2.6.29 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index a3fd40a..1a809ca 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -17,7 +17,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2023-01-27T08:48:38.818Z", + "time": "2023-01-27T09:16:04.379Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index c30cbce..9b2557a 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2023-01-27T08:48:38.818Z", + "time": "2023-01-27T09:16:04.379Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js index 1d89c5f..a530cea 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 _0xe989=['browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','exports','VIRTUAL','getDataValue','action','STRING','contactManager','motionbar','jscripty','urlForward','bot','script','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'];(function(_0x54dc02,_0x3c8c62){var _0x13fb04=function(_0x5b6f8c){while(--_0x5b6f8c){_0x54dc02['push'](_0x54dc02['shift']());}};_0x13fb04(++_0x3c8c62);}(_0xe989,0x124));var _0x9e98=function(_0x21cb7f,_0x48cd16){_0x21cb7f=_0x21cb7f-0x0;var _0x5a079a=_0xe989[_0x21cb7f];return _0x5a079a;};'use strict';var Sequelize=require('sequelize');module[_0x9e98('0x0')]={'name':{'type':Sequelize[_0x9e98('0x1')],'get':function(_0x12549d){return this[_0x9e98('0x2')](_0x9e98('0x3'));}},'action':{'type':Sequelize[_0x9e98('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x9e98('0x5'),'integration',_0x9e98('0x6'),_0x9e98('0x7'),_0x9e98('0x8'),'browser',_0x9e98('0x9'),_0x9e98('0xa')]],'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':'jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'},'data2':{'type':Sequelize['STRING'](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize[_0x9e98('0x4')](0x1000),'comment':_0x9e98('0xb')},'data4':{'type':Sequelize[_0x9e98('0x4')](0x1000),'comments':_0x9e98('0xc')},'data5':{'type':Sequelize[_0x9e98('0x4')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize[_0x9e98('0x4')],'comments':_0x9e98('0xd')},'data7':{'type':Sequelize[_0x9e98('0xe')],'comments':_0x9e98('0xf')}}; \ No newline at end of file +var _0xac22=['Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','TEXT','urlForward[body]','exports','VIRTUAL','getDataValue','action','STRING','contactManager','motionbar','jscripty','urlForward','bot','script'];(function(_0x43316d,_0x5ebd8f){var _0x52d343=function(_0x231e52){while(--_0x231e52){_0x43316d['push'](_0x43316d['shift']());}};_0x52d343(++_0x5ebd8f);}(_0xac22,0x138));var _0x2ac2=function(_0x544d2b,_0x41df75){_0x544d2b=_0x544d2b-0x0;var _0x2baf99=_0xac22[_0x544d2b];return _0x2baf99;};'use strict';var Sequelize=require('sequelize');module[_0x2ac2('0x0')]={'name':{'type':Sequelize[_0x2ac2('0x1')],'get':function(_0x431066){return this[_0x2ac2('0x2')](_0x2ac2('0x3'));}},'action':{'type':Sequelize[_0x2ac2('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x2ac2('0x5'),'integration',_0x2ac2('0x6'),_0x2ac2('0x7'),_0x2ac2('0x8'),'browser',_0x2ac2('0x9'),_0x2ac2('0xa')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0x2ac2('0xb')},'data1':{'type':Sequelize[_0x2ac2('0x4')](0x1000),'comment':_0x2ac2('0xc')},'data2':{'type':Sequelize[_0x2ac2('0x4')](0x1000),'comment':_0x2ac2('0xd')},'data3':{'type':Sequelize[_0x2ac2('0x4')](0x1000),'comment':_0x2ac2('0xe')},'data4':{'type':Sequelize[_0x2ac2('0x4')](0x1000),'comments':_0x2ac2('0xf')},'data5':{'type':Sequelize[_0x2ac2('0x4')](0x1000),'comments':_0x2ac2('0x10')},'data6':{'type':Sequelize[_0x2ac2('0x4')],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize[_0x2ac2('0x11')],'comments':_0x2ac2('0x12')}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index 22b80c8..5e8db7e 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 _0x03e4=['zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','sendStatus','stack','name','update','body','Action','params','catch','destroy','find','eml-format','rimraf'];(function(_0x4eacfe,_0xbbffef){var _0x231fcc=function(_0xa789a3){while(--_0xa789a3){_0x4eacfe['push'](_0x4eacfe['shift']());}};_0x231fcc(++_0xbbffef);}(_0x03e4,0xe9));var _0x403e=function(_0x319784,_0x47e6d4){_0x319784=_0x319784-0x0;var _0x1917da=_0x03e4[_0x319784];return _0x1917da;};'use strict';var emlformat=require(_0x403e('0x0'));var rimraf=require(_0x403e('0x1'));var zipdir=require(_0x403e('0x2'));var jsonpatch=require(_0x403e('0x3'));var rp=require('request-promise');var moment=require(_0x403e('0x4'));var BPromise=require(_0x403e('0x5'));var Mustache=require(_0x403e('0x6'));var util=require(_0x403e('0x7'));var path=require(_0x403e('0x8'));var sox=require(_0x403e('0x9'));var csv=require(_0x403e('0xa'));var ejs=require(_0x403e('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x403e('0xc'));var crypto=require('crypto');var jsforce=require(_0x403e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x403e('0xa'));var querystring=require(_0x403e('0xe'));var Papa=require('papaparse');var Redis=require(_0x403e('0xf'));var authService=require(_0x403e('0x10'));var qs=require(_0x403e('0x11'));var as=require(_0x403e('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x403e('0x13'))(_0x403e('0x14'));var utils=require(_0x403e('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x403e('0x16'));var db=require(_0x403e('0x17'))['db'];function respondWithStatusCode(_0x47b410,_0x52c711){_0x52c711=_0x52c711||0xcc;return function(_0x20b79a){if(_0x20b79a){return _0x47b410['sendStatus'](_0x52c711);}return _0x47b410[_0x403e('0x18')](_0x52c711)[_0x403e('0x19')]();};}function respondWithResult(_0x3db309,_0x439cc3){_0x439cc3=_0x439cc3||0xc8;return function(_0x55b74c){if(_0x55b74c){return _0x3db309[_0x403e('0x18')](_0x439cc3)['json'](_0x55b74c);}};}function respondWithFilteredResult(_0x286b08,_0x365621){return function(_0x5a39b7){if(_0x5a39b7){var _0x5571c1=typeof _0x365621[_0x403e('0x1a')]===_0x403e('0x1b')&&typeof _0x365621[_0x403e('0x1c')]===_0x403e('0x1b');var _0x17c529=_0x5a39b7[_0x403e('0x1d')];var _0x2d56f4=_0x5571c1?0x0:_0x365621['offset'];var _0x4f2d5b=_0x5571c1?_0x5a39b7[_0x403e('0x1d')]:_0x365621[_0x403e('0x1a')]+_0x365621[_0x403e('0x1c')];var _0x4ca974;if(_0x4f2d5b>=_0x17c529){_0x4f2d5b=_0x17c529;_0x4ca974=0xc8;}else{_0x4ca974=0xce;}_0x286b08[_0x403e('0x18')](_0x4ca974);return _0x286b08[_0x403e('0x1e')](_0x403e('0x1f'),_0x2d56f4+'-'+_0x4f2d5b+'/'+_0x17c529)[_0x403e('0x20')](_0x5a39b7);}return null;};}function patchUpdates(_0x438d77){return function(_0x14e78a){try{jsonpatch[_0x403e('0x21')](_0x14e78a,_0x438d77,!![]);}catch(_0x38300d){return BPromise[_0x403e('0x22')](_0x38300d);}return _0x14e78a[_0x403e('0x23')]();};}function saveUpdates(_0x32e950,_0x1bda12){return function(_0x15a629){if(_0x15a629){return _0x15a629['update'](_0x32e950)['then'](function(_0x1ed582){return _0x1ed582;});}return null;};}function removeEntity(_0x1efd3a,_0x5a339d){return function(_0x49174b){if(_0x49174b){return _0x49174b['destroy']()[_0x403e('0x24')](function(){_0x1efd3a[_0x403e('0x18')](0xcc)[_0x403e('0x19')]();});}};}function handleEntityNotFound(_0x518a04,_0x153f2c){return function(_0x5d72a9){if(!_0x5d72a9){_0x518a04[_0x403e('0x25')](0x194);}return _0x5d72a9;};}function handleError(_0x1ba048,_0x3ced38){_0x3ced38=_0x3ced38||0x1f4;return function(_0x1454c0){logger['error'](_0x1454c0[_0x403e('0x26')]);if(_0x1454c0['name']){delete _0x1454c0[_0x403e('0x27')];}_0x1ba048[_0x403e('0x18')](_0x3ced38)['send'](_0x1454c0);};}exports[_0x403e('0x28')]=function(_0x2b1150,_0x25b922){if(_0x2b1150[_0x403e('0x29')]['id']){delete _0x2b1150[_0x403e('0x29')]['id'];}return db[_0x403e('0x2a')]['find']({'where':{'id':_0x2b1150[_0x403e('0x2b')]['id']}})[_0x403e('0x24')](handleEntityNotFound(_0x25b922,null))['then'](saveUpdates(_0x2b1150['body'],null))['then'](respondWithResult(_0x25b922,null))[_0x403e('0x2c')](handleError(_0x25b922,null));};exports[_0x403e('0x2d')]=function(_0x1e6a5e,_0x544d76){return db[_0x403e('0x2a')][_0x403e('0x2e')]({'where':{'id':_0x1e6a5e[_0x403e('0x2b')]['id']}})[_0x403e('0x24')](handleEntityNotFound(_0x544d76,null))[_0x403e('0x24')](removeEntity(_0x544d76,null))[_0x403e('0x2c')](handleError(_0x544d76,null));}; \ No newline at end of file +var _0xecc2=['reject','then','sendStatus','error','stack','name','send','update','body','Action','find','params','catch','rimraf','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','end','status','offset','undefined','limit','count','set','Content-Range','json'];(function(_0x12ec4a,_0x3c6862){var _0x2f81ee=function(_0x1e6a8b){while(--_0x1e6a8b){_0x12ec4a['push'](_0x12ec4a['shift']());}};_0x2f81ee(++_0x3c6862);}(_0xecc2,0x8e));var _0x2ecc=function(_0x1face5,_0x40e068){_0x1face5=_0x1face5-0x0;var _0x3fc0f9=_0xecc2[_0x1face5];return _0x3fc0f9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2ecc('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2ecc('0x1'));var BPromise=require(_0x2ecc('0x2'));var Mustache=require(_0x2ecc('0x3'));var util=require('util');var path=require(_0x2ecc('0x4'));var sox=require(_0x2ecc('0x5'));var csv=require(_0x2ecc('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2ecc('0x7'));var _=require(_0x2ecc('0x8'));var squel=require(_0x2ecc('0x9'));var crypto=require(_0x2ecc('0xa'));var jsforce=require(_0x2ecc('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x2ecc('0x6'));var querystring=require(_0x2ecc('0xc'));var Papa=require(_0x2ecc('0xd'));var Redis=require(_0x2ecc('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x2ecc('0xf'));var as=require(_0x2ecc('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2ecc('0x11'))(_0x2ecc('0x12'));var utils=require(_0x2ecc('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x2ecc('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4ffc79,_0x2fcb71){_0x2fcb71=_0x2fcb71||0xcc;return function(_0x784015){if(_0x784015){return _0x4ffc79['sendStatus'](_0x2fcb71);}return _0x4ffc79['status'](_0x2fcb71)[_0x2ecc('0x15')]();};}function respondWithResult(_0x40e10f,_0x44a7dc){_0x44a7dc=_0x44a7dc||0xc8;return function(_0x214ffa){if(_0x214ffa){return _0x40e10f[_0x2ecc('0x16')](_0x44a7dc)['json'](_0x214ffa);}};}function respondWithFilteredResult(_0x1819ae,_0x12e9de){return function(_0x1e4416){if(_0x1e4416){var _0x499c66=typeof _0x12e9de[_0x2ecc('0x17')]===_0x2ecc('0x18')&&typeof _0x12e9de[_0x2ecc('0x19')]===_0x2ecc('0x18');var _0x2b9951=_0x1e4416[_0x2ecc('0x1a')];var _0x282c70=_0x499c66?0x0:_0x12e9de[_0x2ecc('0x17')];var _0x521333=_0x499c66?_0x1e4416[_0x2ecc('0x1a')]:_0x12e9de[_0x2ecc('0x17')]+_0x12e9de[_0x2ecc('0x19')];var _0x1a17a5;if(_0x521333>=_0x2b9951){_0x521333=_0x2b9951;_0x1a17a5=0xc8;}else{_0x1a17a5=0xce;}_0x1819ae['status'](_0x1a17a5);return _0x1819ae[_0x2ecc('0x1b')](_0x2ecc('0x1c'),_0x282c70+'-'+_0x521333+'/'+_0x2b9951)[_0x2ecc('0x1d')](_0x1e4416);}return null;};}function patchUpdates(_0x1b2824){return function(_0x1f4bf5){try{jsonpatch['apply'](_0x1f4bf5,_0x1b2824,!![]);}catch(_0x4f5e14){return BPromise[_0x2ecc('0x1e')](_0x4f5e14);}return _0x1f4bf5['save']();};}function saveUpdates(_0x48719d,_0x403566){return function(_0x57fd34){if(_0x57fd34){return _0x57fd34['update'](_0x48719d)[_0x2ecc('0x1f')](function(_0x424231){return _0x424231;});}return null;};}function removeEntity(_0x31c238,_0x58c546){return function(_0x32da41){if(_0x32da41){return _0x32da41['destroy']()['then'](function(){_0x31c238[_0x2ecc('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1764be,_0x2e37db){return function(_0x1180a9){if(!_0x1180a9){_0x1764be[_0x2ecc('0x20')](0x194);}return _0x1180a9;};}function handleError(_0x37eca2,_0x15bb2d){_0x15bb2d=_0x15bb2d||0x1f4;return function(_0xdbc3af){logger[_0x2ecc('0x21')](_0xdbc3af[_0x2ecc('0x22')]);if(_0xdbc3af['name']){delete _0xdbc3af[_0x2ecc('0x23')];}_0x37eca2[_0x2ecc('0x16')](_0x15bb2d)[_0x2ecc('0x24')](_0xdbc3af);};}exports[_0x2ecc('0x25')]=function(_0x529679,_0x257717){if(_0x529679['body']['id']){delete _0x529679[_0x2ecc('0x26')]['id'];}return db[_0x2ecc('0x27')][_0x2ecc('0x28')]({'where':{'id':_0x529679[_0x2ecc('0x29')]['id']}})[_0x2ecc('0x1f')](handleEntityNotFound(_0x257717,null))['then'](saveUpdates(_0x529679[_0x2ecc('0x26')],null))[_0x2ecc('0x1f')](respondWithResult(_0x257717,null))[_0x2ecc('0x2a')](handleError(_0x257717,null));};exports['destroy']=function(_0x5ab2ca,_0x380c73){return db[_0x2ecc('0x27')][_0x2ecc('0x28')]({'where':{'id':_0x5ab2ca[_0x2ecc('0x29')]['id']}})[_0x2ecc('0x1f')](handleEntityNotFound(_0x380c73,null))['then'](removeEntity(_0x380c73,null))[_0x2ecc('0x2a')](handleError(_0x380c73,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index bf9a854..632766d 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 _0x1e77=['exports','define','Action','tools_actions','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x4fb13e,_0x264386){var _0x4e93e7=function(_0x5c2992){while(--_0x5c2992){_0x4fb13e['push'](_0x4fb13e['shift']());}};_0x4e93e7(++_0x264386);}(_0x1e77,0xca));var _0x71e7=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x1e77[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x71e7('0x0'));var util=require(_0x71e7('0x1'));var logger=require(_0x71e7('0x2'))('api');var moment=require(_0x71e7('0x3'));var BPromise=require(_0x71e7('0x4'));var rp=require(_0x71e7('0x5'));var fs=require('fs');var path=require(_0x71e7('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./action.attributes');module[_0x71e7('0x7')]=function(_0x1c7da3,_0x13bc6e){return _0x1c7da3[_0x71e7('0x8')](_0x71e7('0x9'),attributes,{'tableName':_0x71e7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa033=['define','Action','tools_actions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./action.attributes','exports'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0xa033,0x1ca));var _0x3a03=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa033[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3a03('0x0'));var util=require(_0x3a03('0x1'));var logger=require(_0x3a03('0x2'))(_0x3a03('0x3'));var moment=require(_0x3a03('0x4'));var BPromise=require(_0x3a03('0x5'));var rp=require(_0x3a03('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3a03('0x7'));var attributes=require(_0x3a03('0x8'));module[_0x3a03('0x9')]=function(_0x44d202,_0x4513fc){return _0x44d202[_0x3a03('0xa')](_0x3a03('0xb'),attributes,{'tableName':_0x3a03('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 a904ba9..3fa0e30 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 _0xe14b=['../../config/environment','jayson/promise','client','http','then','info','Action,\x20%s,\x20%s','Action,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils'];(function(_0x1c72b8,_0x467938){var _0x2d5236=function(_0x314255){while(--_0x314255){_0x1c72b8['push'](_0x1c72b8['shift']());}};_0x2d5236(++_0x467938);}(_0xe14b,0x93));var _0xbe14=function(_0x279550,_0x20fb48){_0x279550=_0x279550-0x0;var _0x1c6b1a=_0xe14b[_0x279550];return _0x1c6b1a;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbe14('0x2'));var fs=require('fs');var Redis=require(_0xbe14('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe14('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbe14('0x5'));var jayson=require(_0xbe14('0x6'));var client=jayson[_0xbe14('0x7')][_0xbe14('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d9ade,_0x39387e,_0x196fca){return new BPromise(function(_0x566ae7,_0x50f909){return client['request'](_0x1d9ade,_0x196fca)[_0xbe14('0x9')](function(_0x6fceff){logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,'request\x20sent');logger['debug'](_0xbe14('0xc'),_0x39387e,_0xbe14('0xd'),JSON['stringify'](_0x6fceff));if(_0x6fceff[_0xbe14('0xe')]){if(_0x6fceff[_0xbe14('0xe')][_0xbe14('0xf')]===0x1f4){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x50f909(_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);}logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x566ae7(_0x6fceff['error']['message']);}else{logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,_0xbe14('0xd'));_0x566ae7(_0x6fceff[_0xbe14('0x11')]['message']);}})[_0xbe14('0x12')](function(_0xe9c3ec){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0xe9c3ec);_0x50f909(_0xe9c3ec);});});} \ No newline at end of file +var _0x814b=['info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0x814b,0x1a2));var _0xb814=function(_0x446208,_0xb483fb){_0x446208=_0x446208-0x0;var _0xe49563=_0x814b[_0x446208];return _0xe49563;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var moment=require(_0xb814('0x2'));var BPromise=require(_0xb814('0x3'));var rs=require(_0xb814('0x4'));var fs=require('fs');var Redis=require(_0xb814('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb814('0x6'));var logger=require(_0xb814('0x7'))(_0xb814('0x8'));var config=require(_0xb814('0x9'));var jayson=require(_0xb814('0xa'));var client=jayson[_0xb814('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b0829,_0x2e6272,_0x5c8539){return new BPromise(function(_0x271af9,_0x2913a6){return client[_0xb814('0xc')](_0x3b0829,_0x5c8539)[_0xb814('0xd')](function(_0x1fea33){logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));logger[_0xb814('0x11')](_0xb814('0x12'),_0x2e6272,_0xb814('0x10'),JSON['stringify'](_0x1fea33));if(_0x1fea33[_0xb814('0x13')]){if(_0x1fea33['error'][_0xb814('0x14')]===0x1f4){logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x2913a6(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x271af9(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}else{logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));_0x271af9(_0x1fea33[_0xb814('0x16')][_0xb814('0x15')]);}})[_0xb814('0x17')](function(_0x21b73f){logger[_0xb814('0x13')]('Action,\x20%s,\x20%s',_0x2e6272,_0x21b73f);_0x2913a6(_0x21b73f);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index 5df58df..f4a97be 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 _0x450e=['multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','put','isAuthenticated','update','delete','/:id','exports'];(function(_0x31ced5,_0x5d5415){var _0x10d9e5=function(_0x2e51a5){while(--_0x2e51a5){_0x31ced5['push'](_0x31ced5['shift']());}};_0x10d9e5(++_0x5d5415);}(_0x450e,0x15f));var _0xe450=function(_0x5ee8d2,_0x9385a7){_0x5ee8d2=_0x5ee8d2-0x0;var _0x30b6e0=_0x450e[_0x5ee8d2];return _0x30b6e0;};'use strict';var multer=require(_0xe450('0x0'));var util=require('util');var path=require(_0xe450('0x1'));var timeout=require(_0xe450('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xe450('0x3'));var auth=require(_0xe450('0x4'));var interaction=require(_0xe450('0x5'));var config=require(_0xe450('0x6'));var controller=require('./action.controller');router[_0xe450('0x7')]('/:id',auth[_0xe450('0x8')](),controller[_0xe450('0x9')]);router[_0xe450('0xa')](_0xe450('0xb'),auth[_0xe450('0x8')](),controller['destroy']);module[_0xe450('0xc')]=router; \ No newline at end of file +var _0x4d63=['../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','/:id','isAuthenticated','update','multer','util','express','Router','fs-extra'];(function(_0xb5ac40,_0x21c87d){var _0xe9e53b=function(_0x5dcbf8){while(--_0x5dcbf8){_0xb5ac40['push'](_0xb5ac40['shift']());}};_0xe9e53b(++_0x21c87d);}(_0x4d63,0x193));var _0x34d6=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x4d63[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x34d6('0x0'));var util=require(_0x34d6('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x34d6('0x2'));var router=express[_0x34d6('0x3')]();var fs_extra=require(_0x34d6('0x4'));var auth=require(_0x34d6('0x5'));var interaction=require(_0x34d6('0x6'));var config=require(_0x34d6('0x7'));var controller=require(_0x34d6('0x8'));router['put'](_0x34d6('0x9'),auth[_0x34d6('0xa')](),controller[_0x34d6('0xb')]);router['delete'](_0x34d6('0x9'),auth[_0x34d6('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index 5d9dc48..9a23b6e 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 _0x1883=['exports','STRING','TEXT','sequelize'];(function(_0x5b8dce,_0x39bd3a){var _0x3452be=function(_0x5b5087){while(--_0x5b5087){_0x5b8dce['push'](_0x5b8dce['shift']());}};_0x3452be(++_0x39bd3a);}(_0x1883,0xab));var _0x3188=function(_0x55671b,_0x2237bd){_0x55671b=_0x55671b-0x0;var _0x1b604d=_0x1883[_0x55671b];return _0x1b604d;};'use strict';var Sequelize=require(_0x3188('0x0'));module[_0x3188('0x1')]={'name':{'type':Sequelize[_0x3188('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x3188('0x2')]},'parent':{'type':Sequelize[_0x3188('0x2')]},'table':{'type':Sequelize[_0x3188('0x2')]},'conditions':{'type':Sequelize[_0x3188('0x3')]},'joins':{'type':Sequelize[_0x3188('0x3')]}}; \ No newline at end of file +var _0x5496=['TEXT','sequelize','exports','STRING'];(function(_0x18fdc4,_0x41840b){var _0x2ebbfb=function(_0x5c2962){while(--_0x5c2962){_0x18fdc4['push'](_0x18fdc4['shift']());}};_0x2ebbfb(++_0x41840b);}(_0x5496,0x175));var _0x6549=function(_0x1ae8e7,_0x2ab5f9){_0x1ae8e7=_0x1ae8e7-0x0;var _0x515513=_0x5496[_0x1ae8e7];return _0x515513;};'use strict';var Sequelize=require(_0x6549('0x0'));module[_0x6549('0x1')]={'name':{'type':Sequelize[_0x6549('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x6549('0x2')]},'parent':{'type':Sequelize[_0x6549('0x2')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x6549('0x3')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index 40d1291..98ca17b 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 _0x9ab8=['save','update','then','get','UserProfileResource','end','error','stack','name','send','index','map','AnalyticCustomReport','type','model','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','merge','VIRTUAL','filter','include','findAll','show','params','keys','rawAttributes','includeAll','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Reports','UserProfileSection','userProfileId','autoAssociation','CustomReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','destroy','preview','join','left_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','getFields','Sequelize','ValidationErrorItem','AnalyticMetric','select','from','MetricId','metric','function','replace','format','groupBy','orderBy','alias','joins','parse','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','table','parentKey','conditions','clone','toString','QueryTypes','SELECT','right_join','COUNT(DISTINCT\x20%s)','SEC_TO_TIME(%s)','includes','IS\x20NOT\x20NULL','operator','value','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','DESC','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','info','Run\x20Query:','../../components/export/','COUNT(*)','sequelize','run','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','IS\x20NULL','debug','eml-format','rimraf','zip-dir','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','json','apply','reject'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0x9ab8,0x81));var _0x89ab=function(_0x188d39,_0x43f7b0){_0x188d39=_0x188d39-0x0;var _0x2a1948=_0x9ab8[_0x188d39];return _0x2a1948;};'use strict';var emlformat=require(_0x89ab('0x0'));var rimraf=require(_0x89ab('0x1'));var zipdir=require(_0x89ab('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x89ab('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x89ab('0x4'));var util=require(_0x89ab('0x5'));var path=require('path');var sox=require(_0x89ab('0x6'));var csv=require(_0x89ab('0x7'));var ejs=require(_0x89ab('0x8'));var fs=require('fs');var fs_extra=require(_0x89ab('0x9'));var _=require(_0x89ab('0xa'));var squel=require(_0x89ab('0xb'));var crypto=require(_0x89ab('0xc'));var jsforce=require(_0x89ab('0xd'));var deskjs=require(_0x89ab('0xe'));var toCsv=require(_0x89ab('0x7'));var querystring=require(_0x89ab('0xf'));var Papa=require(_0x89ab('0x10'));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(_0x89ab('0x11'))(_0x89ab('0x12'));var utils=require(_0x89ab('0x13'));var config=require(_0x89ab('0x14'));var licenseUtil=require(_0x89ab('0x15'));var db=require(_0x89ab('0x16'))['db'];var dbH=require(_0x89ab('0x16'))['dbH'];function respondWithStatusCode(_0x15e7bc,_0x1fe309){_0x1fe309=_0x1fe309||0xcc;return function(_0x39d4ad){if(_0x39d4ad){return _0x15e7bc[_0x89ab('0x17')](_0x1fe309);}return _0x15e7bc[_0x89ab('0x18')](_0x1fe309)['end']();};}function respondWithResult(_0x2bcab1,_0x241140){_0x241140=_0x241140||0xc8;return function(_0x4fcd4c){if(_0x4fcd4c){return _0x2bcab1['status'](_0x241140)['json'](_0x4fcd4c);}};}function respondWithFilteredResult(_0x57037f,_0x4fd002){return function(_0x49a104){if(_0x49a104){var _0x24d866=typeof _0x4fd002[_0x89ab('0x19')]===_0x89ab('0x1a')&&typeof _0x4fd002[_0x89ab('0x1b')]===_0x89ab('0x1a');var _0x141b86=_0x49a104[_0x89ab('0x1c')];var _0x2af38f=_0x24d866?0x0:_0x4fd002[_0x89ab('0x19')];var _0x5736f7=_0x24d866?_0x49a104[_0x89ab('0x1c')]:_0x4fd002[_0x89ab('0x19')]+_0x4fd002['limit'];var _0x515370;if(_0x5736f7>=_0x141b86){_0x5736f7=_0x141b86;_0x515370=0xc8;}else{_0x515370=0xce;}_0x57037f[_0x89ab('0x18')](_0x515370);return _0x57037f[_0x89ab('0x1d')]('Content-Range',_0x2af38f+'-'+_0x5736f7+'/'+_0x141b86)[_0x89ab('0x1e')](_0x49a104);}return null;};}function patchUpdates(_0xe34016){return function(_0x2a5b01){try{jsonpatch[_0x89ab('0x1f')](_0x2a5b01,_0xe34016,!![]);}catch(_0x286a66){return BPromise[_0x89ab('0x20')](_0x286a66);}return _0x2a5b01[_0x89ab('0x21')]();};}function saveUpdates(_0x251a70,_0x315605){return function(_0x41b113){if(_0x41b113){return _0x41b113[_0x89ab('0x22')](_0x251a70)[_0x89ab('0x23')](function(_0x257aec){return _0x257aec;});}return null;};}function removeEntity(_0x1b9e75,_0x3bbde1){return function(_0x11caf1){if(_0x11caf1){return _0x11caf1['destroy']()[_0x89ab('0x23')](function(){var _0x548430=_0x11caf1[_0x89ab('0x24')]({'plain':!![]});var _0x599422='CustomReports';return db[_0x89ab('0x25')]['destroy']({'where':{'type':_0x599422,'resourceId':_0x548430['id']}})['then'](function(){return _0x11caf1;});})[_0x89ab('0x23')](function(){_0x1b9e75[_0x89ab('0x18')](0xcc)[_0x89ab('0x26')]();});}};}function handleEntityNotFound(_0x2f88d1,_0x54b1a4){return function(_0x27e94b){if(!_0x27e94b){_0x2f88d1[_0x89ab('0x17')](0x194);}return _0x27e94b;};}function handleError(_0x1919ee,_0xf8a71){_0xf8a71=_0xf8a71||0x1f4;return function(_0x5246d7){logger[_0x89ab('0x27')](_0x5246d7[_0x89ab('0x28')]);if(_0x5246d7[_0x89ab('0x29')]){delete _0x5246d7[_0x89ab('0x29')];}_0x1919ee[_0x89ab('0x18')](_0xf8a71)[_0x89ab('0x2a')](_0x5246d7);};}exports[_0x89ab('0x2b')]=function(_0x34550c,_0x2103b7){var _0x13e9da={},_0x1cd3f1={},_0x2d352b={'count':0x0,'rows':[]};var _0x4f5e20=_[_0x89ab('0x2c')](db[_0x89ab('0x2d')]['rawAttributes'],function(_0x567f99){return{'name':_0x567f99['fieldName'],'type':_0x567f99[_0x89ab('0x2e')]['key']};});_0x1cd3f1[_0x89ab('0x2f')]=_[_0x89ab('0x2c')](_0x4f5e20,_0x89ab('0x29'));_0x1cd3f1[_0x89ab('0x30')]=_['keys'](_0x34550c[_0x89ab('0x30')]);_0x1cd3f1[_0x89ab('0x31')]=_['intersection'](_0x1cd3f1[_0x89ab('0x2f')],_0x1cd3f1[_0x89ab('0x30')]);_0x13e9da['attributes']=_[_0x89ab('0x32')](_0x1cd3f1[_0x89ab('0x2f')],qs[_0x89ab('0x33')](_0x34550c[_0x89ab('0x30')]['fields']));_0x13e9da['attributes']=_0x13e9da[_0x89ab('0x34')][_0x89ab('0x35')]?_0x13e9da[_0x89ab('0x34')]:_0x1cd3f1['model'];if(!_0x34550c[_0x89ab('0x30')]['hasOwnProperty'](_0x89ab('0x36'))){_0x13e9da[_0x89ab('0x1b')]=qs[_0x89ab('0x1b')](_0x34550c['query'][_0x89ab('0x1b')]);_0x13e9da[_0x89ab('0x19')]=qs[_0x89ab('0x19')](_0x34550c[_0x89ab('0x30')]['offset']);}_0x13e9da[_0x89ab('0x37')]=qs[_0x89ab('0x38')](_0x34550c[_0x89ab('0x30')]['sort']);_0x13e9da['where']=qs[_0x89ab('0x31')](_['pick'](_0x34550c[_0x89ab('0x30')],_0x1cd3f1[_0x89ab('0x31')]),_0x4f5e20);if(_0x34550c[_0x89ab('0x30')]['filter']){_0x13e9da[_0x89ab('0x39')]=_[_0x89ab('0x3a')](_0x13e9da['where'],{'$or':_[_0x89ab('0x2c')](_0x4f5e20,function(_0xadfb9f){if(_0xadfb9f[_0x89ab('0x2e')]!==_0x89ab('0x3b')){var _0xc5b453={};_0xc5b453[_0xadfb9f[_0x89ab('0x29')]]={'$like':'%'+_0x34550c[_0x89ab('0x30')][_0x89ab('0x3c')]+'%'};return _0xc5b453;}})});}_0x13e9da=_['merge']({},_0x13e9da,_0x34550c['options']);var _0x17c4d1={'where':_0x13e9da[_0x89ab('0x39')]};return db[_0x89ab('0x2d')][_0x89ab('0x1c')](_0x17c4d1)[_0x89ab('0x23')](function(_0x4cf224){_0x2d352b[_0x89ab('0x1c')]=_0x4cf224;if(_0x34550c[_0x89ab('0x30')]['includeAll']){_0x13e9da[_0x89ab('0x3d')]=[{'all':!![]}];}return db[_0x89ab('0x2d')][_0x89ab('0x3e')](_0x13e9da);})[_0x89ab('0x23')](function(_0x1ea611){_0x2d352b['rows']=_0x1ea611;return _0x2d352b;})[_0x89ab('0x23')](respondWithFilteredResult(_0x2103b7,_0x13e9da))['catch'](handleError(_0x2103b7,null));};exports[_0x89ab('0x3f')]=function(_0x43f0e6,_0x18b303){var _0x7bdf0b={'raw':![],'where':{'id':_0x43f0e6[_0x89ab('0x40')]['id']}},_0x93807c={};_0x93807c[_0x89ab('0x2f')]=_[_0x89ab('0x41')](db[_0x89ab('0x2d')][_0x89ab('0x42')]);_0x93807c[_0x89ab('0x30')]=_[_0x89ab('0x41')](_0x43f0e6[_0x89ab('0x30')]);_0x93807c[_0x89ab('0x31')]=_[_0x89ab('0x32')](_0x93807c[_0x89ab('0x2f')],_0x93807c[_0x89ab('0x30')]);_0x7bdf0b[_0x89ab('0x34')]=_[_0x89ab('0x32')](_0x93807c['model'],qs[_0x89ab('0x33')](_0x43f0e6[_0x89ab('0x30')][_0x89ab('0x33')]));_0x7bdf0b[_0x89ab('0x34')]=_0x7bdf0b[_0x89ab('0x34')][_0x89ab('0x35')]?_0x7bdf0b[_0x89ab('0x34')]:_0x93807c[_0x89ab('0x2f')];if(_0x43f0e6['query'][_0x89ab('0x43')]){_0x7bdf0b[_0x89ab('0x3d')]=[{'all':!![]}];}_0x7bdf0b=_['merge']({},_0x7bdf0b,_0x43f0e6[_0x89ab('0x44')]);return db[_0x89ab('0x2d')][_0x89ab('0x45')](_0x7bdf0b)[_0x89ab('0x23')](handleEntityNotFound(_0x18b303,null))['then'](respondWithResult(_0x18b303,null))['catch'](handleError(_0x18b303,null));};exports[_0x89ab('0x46')]=function(_0xc1419e,_0x412141){return db[_0x89ab('0x2d')]['create'](_0xc1419e[_0x89ab('0x47')],{})[_0x89ab('0x23')](function(_0x341145){var _0x41334e=_0xc1419e['user']['get']({'plain':!![]});if(!_0x41334e)throw new Error(_0x89ab('0x48'));if(_0x41334e[_0x89ab('0x49')]===_0x89ab('0x4a')){var _0xd57376=_0x341145[_0x89ab('0x24')]({'plain':!![]});var _0x4e7dbe=_0x89ab('0x4b');return db[_0x89ab('0x4c')]['find']({'where':{'name':_0x4e7dbe,'userProfileId':_0x41334e[_0x89ab('0x4d')]},'raw':!![]})[_0x89ab('0x23')](function(_0x2c11d0){if(_0x2c11d0&&_0x2c11d0[_0x89ab('0x4e')]===0x0){return db[_0x89ab('0x25')]['create']({'name':_0xd57376[_0x89ab('0x29')],'resourceId':_0xd57376['id'],'type':_0x89ab('0x4f'),'sectionId':_0x2c11d0['id']},{})[_0x89ab('0x23')](function(){return _0x341145;});}else{return _0x341145;}})['catch'](function(_0x428cda){logger['error'](_0x89ab('0x50'),_0x428cda);throw _0x428cda;});}return _0x341145;})[_0x89ab('0x23')](respondWithResult(_0x412141,0xc9))[_0x89ab('0x51')](handleError(_0x412141,null));};exports[_0x89ab('0x22')]=function(_0x10c563,_0x2c0c8f){if(_0x10c563['body']['id']){delete _0x10c563[_0x89ab('0x47')]['id'];}return db[_0x89ab('0x2d')]['find']({'where':{'id':_0x10c563[_0x89ab('0x40')]['id']}})['then'](handleEntityNotFound(_0x2c0c8f,null))[_0x89ab('0x23')](saveUpdates(_0x10c563[_0x89ab('0x47')],null))[_0x89ab('0x23')](respondWithResult(_0x2c0c8f,null))[_0x89ab('0x51')](handleError(_0x2c0c8f,null));};exports[_0x89ab('0x52')]=function(_0x36e0b,_0x36c46f){return db['AnalyticCustomReport']['find']({'where':{'id':_0x36e0b['params']['id']}})[_0x89ab('0x23')](handleEntityNotFound(_0x36c46f,null))['then'](removeEntity(_0x36c46f,null))[_0x89ab('0x51')](handleError(_0x36c46f,null));};exports[_0x89ab('0x53')]=function(_0x4b0e48,_0x52d6d0){var _0x143673=0xa;var _0x5ad0e6=[_0x89ab('0x54'),_0x89ab('0x55'),'right_join',_0x89ab('0x56')];var _0x95676a={'SUM':_0x89ab('0x57'),'COUNT':_0x89ab('0x58'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x89ab('0x59'),'MIN':_0x89ab('0x5a'),'AVG':_0x89ab('0x5b'),'GROUP_CONCAT':_0x89ab('0x5c'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x182128={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x89ab('0x5d'),'HOUR':_0x89ab('0x5e'),'ROUND':_0x89ab('0x5f'),'UNIX_TIMESTAMP':_0x89ab('0x60')};var _0x46d1a5=function(_0x225861){return!_['includes'](['IS\x20NULL','IS\x20NOT\x20NULL',_0x89ab('0x61'),_0x89ab('0x62')],_0x225861);};var _0x13d219=function(_0x43a058){if(!_0x43a058||!_0x43a058[_0x89ab('0x63')][_0x89ab('0x35')]){return'';}for(var _0x4c7719='(',_0x4697c3=0x0;_0x4697c3<_0x43a058[_0x89ab('0x63')][_0x89ab('0x35')];_0x4697c3+=0x1){_0x4697c3>0x0&&(_0x4c7719+='\x20'+_0x43a058['operator']+'\x20');_0x4c7719+=_0x43a058['rules'][_0x4697c3][_0x89ab('0x64')]?_0x13d219(_0x43a058[_0x89ab('0x63')][_0x4697c3][_0x89ab('0x64')]):_0x43a058[_0x89ab('0x63')][_0x4697c3][_0x89ab('0x65')]+'\x20'+_0x43a058[_0x89ab('0x63')][_0x4697c3][_0x89ab('0x66')]+(_0x46d1a5(_0x43a058[_0x89ab('0x63')][_0x4697c3][_0x89ab('0x66')])?'\x20'+_0x43a058[_0x89ab('0x63')][_0x4697c3]['value']:'');}return _0x4c7719+')';};var _0x270186={'where':{'id':_0x4b0e48[_0x89ab('0x40')]['id']}},_0x34ab7b,_0x9e4ac3,_0x4d7a04,_0x382151,_0x4ebd47;_0x270186=_[_0x89ab('0x3a')]({},_0x270186,_0x4b0e48[_0x89ab('0x44')]);return db['AnalyticCustomReport'][_0x89ab('0x45')](_0x270186)[_0x89ab('0x23')](function(_0x3283e5){if(_0x3283e5){_0x34ab7b=_0x3283e5;return _0x3283e5[_0x89ab('0x67')]();}return null;})[_0x89ab('0x23')](function(_0x13c1b1){if(_0x13c1b1){if(!_0x13c1b1[_0x89ab('0x35')]){throw new db[(_0x89ab('0x68'))][(_0x89ab('0x69'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x9e4ac3=_0x13c1b1;return db[_0x89ab('0x6a')]['findAll']({'raw':!![]});}return null;})[_0x89ab('0x23')](function(_0x2eaea6){if(_0x2eaea6){_0x4d7a04=_['keyBy'](_0x2eaea6,'id');var _0x277b57;var _0x37e6f3=squel[_0x89ab('0x6b')]();_0x37e6f3[_0x89ab('0x6c')](_0x34ab7b['table']);for(var _0x4df6d8=0x0;_0x4df6d8<_0x9e4ac3[_0x89ab('0x35')];_0x4df6d8+=0x1){_0x277b57=_0x9e4ac3[_0x4df6d8][_0x89ab('0x6d')]?_0x4d7a04[_0x9e4ac3[_0x4df6d8][_0x89ab('0x6d')]][_0x89ab('0x6e')]:_0x9e4ac3[_0x4df6d8]['field'];_0x277b57=_0x9e4ac3[_0x4df6d8][_0x89ab('0x6f')]?_[_0x89ab('0x70')](_0x95676a[_0x9e4ac3[_0x4df6d8]['function']],'%s',_0x277b57):_0x277b57;_0x277b57=_0x9e4ac3[_0x4df6d8][_0x89ab('0x71')]?_[_0x89ab('0x70')](_0x182128[_0x9e4ac3[_0x4df6d8]['format']],'%s',_0x277b57):_0x277b57;if(_0x9e4ac3[_0x4df6d8][_0x89ab('0x72')]){_0x37e6f3[_0x89ab('0x64')](_0x277b57);}_0x9e4ac3[_0x4df6d8][_0x89ab('0x73')]&&_0x37e6f3[_0x89ab('0x37')](_0x277b57,_0x9e4ac3[_0x4df6d8][_0x89ab('0x73')]==='DESC'?![]:!![]);_0x37e6f3[_0x89ab('0x65')](_0x277b57,_0x9e4ac3[_0x4df6d8][_0x89ab('0x74')]||_0x277b57);}if(_0x34ab7b[_0x89ab('0x75')]){_0x34ab7b['joins']=JSON[_0x89ab('0x76')](_0x34ab7b[_0x89ab('0x75')]);for(var _0x12f0d0=0x0;_0x12f0d0<_0x34ab7b[_0x89ab('0x75')][_0x89ab('0x35')];_0x12f0d0+=0x1){if(_0x34ab7b[_0x89ab('0x75')][_0x12f0d0][_0x89ab('0x2e')]&&_['includes'](_0x5ad0e6,_0x34ab7b[_0x89ab('0x75')][_0x12f0d0][_0x89ab('0x2e')])&&_0x34ab7b[_0x89ab('0x75')][_0x12f0d0]['parentKey']&&_0x34ab7b[_0x89ab('0x75')][_0x12f0d0]['foreignTable']&&_0x34ab7b[_0x89ab('0x75')][_0x12f0d0][_0x89ab('0x77')]){_0x37e6f3[_0x34ab7b[_0x89ab('0x75')][_0x12f0d0]['type']](_0x34ab7b['joins'][_0x12f0d0][_0x89ab('0x78')],null,util[_0x89ab('0x71')](_0x89ab('0x79'),_0x34ab7b[_0x89ab('0x7a')],_0x34ab7b[_0x89ab('0x75')][_0x12f0d0][_0x89ab('0x7b')],_0x34ab7b[_0x89ab('0x75')][_0x12f0d0]['foreignTable'],_0x34ab7b[_0x89ab('0x75')][_0x12f0d0][_0x89ab('0x77')]));}}}if(_0x34ab7b[_0x89ab('0x7c')]){_0x34ab7b[_0x89ab('0x7c')]=JSON[_0x89ab('0x76')](_0x34ab7b[_0x89ab('0x7c')]);_0x37e6f3['where'](_0x13d219(_0x34ab7b[_0x89ab('0x7c')][_0x89ab('0x64')]));}_0x4ebd47=_0x37e6f3[_0x89ab('0x7d')]();_0x37e6f3[_0x89ab('0x1b')](_0x143673);_0x37e6f3[_0x89ab('0x19')](0x0);logger['debug']('Limited\x20Query:',_0x37e6f3[_0x89ab('0x7e')]());return dbH['sequelize'][_0x89ab('0x30')](_0x37e6f3[_0x89ab('0x7e')](),{'type':dbH['sequelize'][_0x89ab('0x7f')][_0x89ab('0x80')]});}})[_0x89ab('0x23')](respondWithResult(_0x52d6d0,null))['catch'](handleError(_0x52d6d0,null));};function runReport(_0x2848e0,_0x2c4dee,_0x2594b0){var _0x3a8083=_0x2c4dee[_0x89ab('0x29')];var _0x46e1c9=0xa;var _0x6d4c18=[_0x89ab('0x54'),_0x89ab('0x55'),_0x89ab('0x81'),_0x89ab('0x56')];var _0xdba077={'SUM':_0x89ab('0x57'),'COUNT':_0x89ab('0x58'),'COUNT DISTINCT':_0x89ab('0x82'),'MAX':_0x89ab('0x59'),'MIN':'MIN(%s)','AVG':_0x89ab('0x5b'),'GROUP_CONCAT':_0x89ab('0x5c'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x467cda={'SEC_TO_TIME':_0x89ab('0x83'),'DATE':_0x89ab('0x5d'),'HOUR':_0x89ab('0x5e'),'ROUND':_0x89ab('0x5f'),'UNIX_TIMESTAMP':_0x89ab('0x60')};var _0x32dbee=function(_0x7e1fd0){return!_[_0x89ab('0x84')](['IS\x20NULL',_0x89ab('0x85'),_0x89ab('0x61'),_0x89ab('0x62')],_0x7e1fd0);};var _0x18781b=function(_0x1c506c){if(!_0x1c506c||!_0x1c506c['rules'][_0x89ab('0x35')]){return'';}for(var _0x2bfc36='(',_0x26a10a=0x0;_0x26a10a<_0x1c506c['rules'][_0x89ab('0x35')];_0x26a10a+=0x1){_0x26a10a>0x0&&(_0x2bfc36+='\x20'+_0x1c506c[_0x89ab('0x86')]+'\x20');_0x2bfc36+=_0x1c506c[_0x89ab('0x63')][_0x26a10a][_0x89ab('0x64')]?_0x18781b(_0x1c506c[_0x89ab('0x63')][_0x26a10a][_0x89ab('0x64')]):_0x1c506c[_0x89ab('0x63')][_0x26a10a]['field']+'\x20'+_0x1c506c[_0x89ab('0x63')][_0x26a10a][_0x89ab('0x66')]+(_0x32dbee(_0x1c506c[_0x89ab('0x63')][_0x26a10a][_0x89ab('0x66')])?'\x20'+_0x1c506c['rules'][_0x26a10a][_0x89ab('0x87')]:'');}return _0x2bfc36+')';};var _0x1ca62b={'where':{'id':_0x2848e0['id']}},_0x6693f7,_0x5a7bed,_0x28da85,_0x225bc0,_0x384f6b;_0x1ca62b=_[_0x89ab('0x3a')]({},_0x1ca62b,_0x2594b0);return db[_0x89ab('0x2d')][_0x89ab('0x45')](_0x1ca62b)[_0x89ab('0x23')](function(_0x2ab9e3){if(_0x2ab9e3){_0x6693f7=_0x2ab9e3;return _0x2ab9e3[_0x89ab('0x67')]();}return null;})[_0x89ab('0x23')](function(_0x4a7cd1){if(_0x4a7cd1){if(!_0x4a7cd1[_0x89ab('0x35')]){throw new db[(_0x89ab('0x68'))][(_0x89ab('0x69'))](_0x89ab('0x88'),0x193);}_0x5a7bed=_0x4a7cd1;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x89ab('0x23')](function(_0x314303){if(_0x314303){_0x28da85=_[_0x89ab('0x89')](_0x314303,'id');var _0x41e340;var _0x419502=squel[_0x89ab('0x6b')]();_0x419502[_0x89ab('0x6c')](_0x6693f7['table']);for(var _0x3022cf=0x0;_0x3022cf<_0x5a7bed[_0x89ab('0x35')];_0x3022cf+=0x1){_0x41e340=_0x5a7bed[_0x3022cf][_0x89ab('0x6d')]?_0x28da85[_0x5a7bed[_0x3022cf][_0x89ab('0x6d')]]['metric']:_0x5a7bed[_0x3022cf][_0x89ab('0x65')];_0x41e340=_0x5a7bed[_0x3022cf][_0x89ab('0x6f')]?_['replace'](_0xdba077[_0x5a7bed[_0x3022cf]['function']],'%s',_0x41e340):_0x41e340;_0x41e340=_0x5a7bed[_0x3022cf][_0x89ab('0x71')]?_['replace'](_0x467cda[_0x5a7bed[_0x3022cf][_0x89ab('0x71')]],'%s',_0x41e340):_0x41e340;if(_0x5a7bed[_0x3022cf]['groupBy']){_0x419502[_0x89ab('0x64')](_0x41e340);}_0x5a7bed[_0x3022cf]['orderBy']&&_0x419502[_0x89ab('0x37')](_0x41e340,_0x5a7bed[_0x3022cf][_0x89ab('0x73')]===_0x89ab('0x8a')?![]:!![]);_0x419502['field'](_0x41e340,_0x5a7bed[_0x3022cf]['alias']||_0x41e340);}if(_0x6693f7['joins']){_0x6693f7['joins']=JSON[_0x89ab('0x76')](_0x6693f7[_0x89ab('0x75')]);for(var _0xc396e9=0x0;_0xc396e9<_0x6693f7['joins']['length'];_0xc396e9+=0x1){if(_0x6693f7[_0x89ab('0x75')][_0xc396e9][_0x89ab('0x2e')]&&_['includes'](_0x6d4c18,_0x6693f7[_0x89ab('0x75')][_0xc396e9][_0x89ab('0x2e')])&&_0x6693f7[_0x89ab('0x75')][_0xc396e9][_0x89ab('0x7b')]&&_0x6693f7[_0x89ab('0x75')][_0xc396e9][_0x89ab('0x78')]&&_0x6693f7[_0x89ab('0x75')][_0xc396e9][_0x89ab('0x77')]){_0x419502[_0x6693f7['joins'][_0xc396e9][_0x89ab('0x2e')]](_0x6693f7['joins'][_0xc396e9][_0x89ab('0x78')],null,util['format'](_0x89ab('0x79'),_0x6693f7[_0x89ab('0x7a')],_0x6693f7['joins'][_0xc396e9][_0x89ab('0x7b')],_0x6693f7[_0x89ab('0x75')][_0xc396e9]['foreignTable'],_0x6693f7[_0x89ab('0x75')][_0xc396e9][_0x89ab('0x77')]));}}}if(_0x6693f7[_0x89ab('0x7c')]){_0x6693f7['conditions']=JSON[_0x89ab('0x76')](_0x6693f7['conditions']);_0x419502['where'](_0x18781b(_0x6693f7[_0x89ab('0x7c')]['group']));}_0x384f6b=_0x419502['clone']();_0x419502['limit'](_0x46e1c9);_0x419502['offset'](0x0);return;}})[_0x89ab('0x23')](function(){if(_0x2c4dee[_0x89ab('0x8b')]===_0x89ab('0x8c')){return null;}var _0x429143=_[_0x89ab('0x3a')](_0x2c4dee,{'name':_0x2c4dee[_0x89ab('0x8d')]||_0x2c4dee[_0x89ab('0x29')]||_0x6693f7[_0x89ab('0x29')],'basename':_0x3a8083,'savename':util['format'](_0x89ab('0x8e'),_0x2c4dee[_0x89ab('0x29')]||_0x6693f7[_0x89ab('0x29')],require(_0x89ab('0x8f'))[_0x89ab('0x90')](0x4),_0x2c4dee[_0x89ab('0x8b')]||_0x89ab('0x91')),'reportId':_0x6693f7['id'],'reportType':_0x89ab('0x92')});return db[_0x89ab('0x93')][_0x89ab('0x46')](_0x429143,{'raw':!![]});})['then'](function(_0x49a83a){if(_0x6693f7['table']==='cdr'){_0x384f6b['where'](_0x6693f7['table']+_0x89ab('0x94'),_0x2c4dee['startDate'],_0x2c4dee[_0x89ab('0x95')]);}else{_0x384f6b[_0x89ab('0x39')](_0x6693f7[_0x89ab('0x7a')]+_0x89ab('0x96'),_0x2c4dee[_0x89ab('0x97')],_0x2c4dee['endDate']);}if(_0x49a83a){logger[_0x89ab('0x98')](_0x89ab('0x99'),_0x384f6b['toString']());require('child_process')['fork'](path['join'](__dirname,_0x89ab('0x9a'),_0x49a83a[_0x89ab('0x8b')]),[_0x49a83a['id'],_0x384f6b[_0x89ab('0x7e')](),path[_0x89ab('0x54')](__dirname,'../../files/reports',_0x49a83a['savename']),_0x3a8083]);return _0x49a83a;}else{var _0x4cd136=squel['select']();_0x4cd136[_0x89ab('0x6c')]('('+_0x384f6b[_0x89ab('0x7e')]()+')','countTable');_0x4cd136[_0x89ab('0x65')](_0x89ab('0x9b'),_0x89ab('0x1c'));_0x384f6b[_0x89ab('0x1b')](_0x2c4dee[_0x89ab('0x1b')]||_0x46e1c9);_0x384f6b[_0x89ab('0x19')](_0x2c4dee[_0x89ab('0x19')]||0x0);return dbH[_0x89ab('0x9c')][_0x89ab('0x30')](_0x4cd136['toString'](),{'type':dbH[_0x89ab('0x9c')][_0x89ab('0x7f')]['SELECT']})['then'](function(_0x2642f0){if(!_0x2642f0[_0x89ab('0x35')]){_0x225bc0=0x0;}else{_0x225bc0=_0x2642f0[0x0][_0x89ab('0x1c')]||0x0;}return dbH['sequelize'][_0x89ab('0x30')](_0x384f6b[_0x89ab('0x7e')](),{'type':dbH[_0x89ab('0x9c')][_0x89ab('0x7f')][_0x89ab('0x80')]});})[_0x89ab('0x23')](function(_0x2af150){return{'rows':_0x2af150||[],'count':_0x225bc0};});}});}exports[_0x89ab('0x9d')]=function(_0x7c2da4,_0x442564){return runReport(_0x7c2da4[_0x89ab('0x40')],_0x7c2da4[_0x89ab('0x30')],_0x7c2da4[_0x89ab('0x44')])[_0x89ab('0x23')](respondWithResult(_0x442564,null))['catch'](handleError(_0x442564,null));};exports['runReport']=runReport;exports[_0x89ab('0x30')]=function(_0x40ed26,_0x59da70){var _0x3ac20b=0xa;var _0x4ee618=[_0x89ab('0x54'),_0x89ab('0x55'),'right_join',_0x89ab('0x56')];var _0x186f8f={'SUM':'SUM(%s)','COUNT':_0x89ab('0x58'),'COUNT DISTINCT':_0x89ab('0x82'),'MAX':'MAX(%s)','MIN':_0x89ab('0x5a'),'AVG':_0x89ab('0x5b'),'GROUP_CONCAT':_0x89ab('0x5c'),'GROUP_CONCAT ASC':_0x89ab('0x9e'),'GROUP_CONCAT DESC':_0x89ab('0x9f')};var _0x3c0501={'SEC_TO_TIME':_0x89ab('0x83'),'DATE':_0x89ab('0x5d'),'HOUR':_0x89ab('0x5e'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x89ab('0x60')};var _0x2d2193=function(_0x56cc27){return!_[_0x89ab('0x84')]([_0x89ab('0xa0'),_0x89ab('0x85'),_0x89ab('0x61'),_0x89ab('0x62')],_0x56cc27);};var _0x21b749=function(_0x4633e7){if(!_0x4633e7||!_0x4633e7[_0x89ab('0x63')]['length']){return'';}for(var _0xbb307d='(',_0x63d47f=0x0;_0x63d47f<_0x4633e7[_0x89ab('0x63')][_0x89ab('0x35')];_0x63d47f+=0x1){_0x63d47f>0x0&&(_0xbb307d+='\x20'+_0x4633e7[_0x89ab('0x86')]+'\x20');_0xbb307d+=_0x4633e7['rules'][_0x63d47f][_0x89ab('0x64')]?_0x21b749(_0x4633e7['rules'][_0x63d47f][_0x89ab('0x64')]):_0x4633e7[_0x89ab('0x63')][_0x63d47f][_0x89ab('0x65')]+'\x20'+_0x4633e7[_0x89ab('0x63')][_0x63d47f][_0x89ab('0x66')]+(_0x2d2193(_0x4633e7[_0x89ab('0x63')][_0x63d47f]['condition'])?'\x20'+_0x4633e7[_0x89ab('0x63')][_0x63d47f][_0x89ab('0x87')]:'');}return _0xbb307d+')';};var _0x30e1f8={'where':{'id':_0x40ed26[_0x89ab('0x40')]['id']}},_0x2bd302,_0x4d9b9b,_0x49862e,_0x3fbe18,_0xa306a9;_0x30e1f8=_[_0x89ab('0x3a')]({},_0x30e1f8,_0x40ed26['options']);return db[_0x89ab('0x2d')][_0x89ab('0x45')](_0x30e1f8)[_0x89ab('0x23')](function(_0x5adbe4){if(_0x5adbe4){_0x2bd302=_0x5adbe4;return _0x5adbe4['getFields']();}return null;})[_0x89ab('0x23')](function(_0x1733b5){if(_0x1733b5){if(!_0x1733b5[_0x89ab('0x35')]){throw new db['Sequelize']['ValidationErrorItem'](_0x89ab('0x88'),0x193);}_0x4d9b9b=_0x1733b5;return db['AnalyticMetric'][_0x89ab('0x3e')]({'raw':!![]});}return null;})[_0x89ab('0x23')](function(_0x1db9bb){if(_0x1db9bb){_0x49862e=_[_0x89ab('0x89')](_0x1db9bb,'id');var _0x21adc4;var _0x5bc383=squel[_0x89ab('0x6b')]();_0x5bc383['from'](_0x2bd302[_0x89ab('0x7a')]);for(var _0x5e9463=0x0;_0x5e9463<_0x4d9b9b['length'];_0x5e9463+=0x1){_0x21adc4=_0x4d9b9b[_0x5e9463][_0x89ab('0x6d')]?_0x49862e[_0x4d9b9b[_0x5e9463][_0x89ab('0x6d')]][_0x89ab('0x6e')]:_0x4d9b9b[_0x5e9463][_0x89ab('0x65')];_0x21adc4=_0x4d9b9b[_0x5e9463][_0x89ab('0x6f')]?_[_0x89ab('0x70')](_0x186f8f[_0x4d9b9b[_0x5e9463][_0x89ab('0x6f')]],'%s',_0x21adc4):_0x21adc4;_0x21adc4=_0x4d9b9b[_0x5e9463][_0x89ab('0x71')]?_['replace'](_0x3c0501[_0x4d9b9b[_0x5e9463]['format']],'%s',_0x21adc4):_0x21adc4;if(_0x4d9b9b[_0x5e9463][_0x89ab('0x72')]){_0x5bc383['group'](_0x21adc4);}_0x4d9b9b[_0x5e9463][_0x89ab('0x73')]&&_0x5bc383[_0x89ab('0x37')](_0x21adc4,_0x4d9b9b[_0x5e9463][_0x89ab('0x73')]==='DESC'?![]:!![]);_0x5bc383[_0x89ab('0x65')](_0x21adc4,_0x4d9b9b[_0x5e9463][_0x89ab('0x74')]||_0x21adc4);}if(_0x2bd302[_0x89ab('0x75')]){_0x2bd302[_0x89ab('0x75')]=JSON[_0x89ab('0x76')](_0x2bd302[_0x89ab('0x75')]);for(var _0x49be14=0x0;_0x49be14<_0x2bd302[_0x89ab('0x75')][_0x89ab('0x35')];_0x49be14+=0x1){if(_0x2bd302[_0x89ab('0x75')][_0x49be14]['type']&&_[_0x89ab('0x84')](_0x4ee618,_0x2bd302['joins'][_0x49be14][_0x89ab('0x2e')])&&_0x2bd302[_0x89ab('0x75')][_0x49be14][_0x89ab('0x7b')]&&_0x2bd302[_0x89ab('0x75')][_0x49be14][_0x89ab('0x78')]&&_0x2bd302[_0x89ab('0x75')][_0x49be14]['foreignKey']){_0x5bc383[_0x2bd302[_0x89ab('0x75')][_0x49be14][_0x89ab('0x2e')]](_0x2bd302[_0x89ab('0x75')][_0x49be14][_0x89ab('0x78')],null,util[_0x89ab('0x71')](_0x89ab('0x79'),_0x2bd302[_0x89ab('0x7a')],_0x2bd302['joins'][_0x49be14][_0x89ab('0x7b')],_0x2bd302[_0x89ab('0x75')][_0x49be14][_0x89ab('0x78')],_0x2bd302[_0x89ab('0x75')][_0x49be14][_0x89ab('0x77')]));}}}if(_0x2bd302[_0x89ab('0x7c')]){_0x2bd302[_0x89ab('0x7c')]=JSON[_0x89ab('0x76')](_0x2bd302['conditions']);_0x5bc383['where'](_0x21b749(_0x2bd302[_0x89ab('0x7c')][_0x89ab('0x64')]));}_0xa306a9=_0x5bc383[_0x89ab('0x7d')]();_0x5bc383[_0x89ab('0x1b')](_0x3ac20b);_0x5bc383[_0x89ab('0x19')](0x0);logger[_0x89ab('0xa1')]('Limited\x20Query:',_0x5bc383[_0x89ab('0x7e')]());return dbH['sequelize'][_0x89ab('0x30')](_0x5bc383[_0x89ab('0x7e')](),{'type':dbH[_0x89ab('0x9c')][_0x89ab('0x7f')]['SELECT']});}})[_0x89ab('0x23')](function(){return{'sql':_0xa306a9['toString']()};})['then'](respondWithResult(_0x59da70,null))[_0x89ab('0x51')](handleError(_0x59da70,null));}; \ No newline at end of file +var _0x5335=['fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','json','offset','undefined','limit','count','status','set','apply','reject','update','then','get','CustomReports','UserProfileResource','destroy','end','error','name','send','AnalyticCustomReport','key','model','map','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','show','params','intersection','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','catch','preview','join','left_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','length','operator','group','field','condition','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','MetricId','metric','function','replace','format','groupBy','orderBy','alias','joins','parentKey','foreignTable','foreignKey','table','conditions','parse','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','right_join','HOUR(%s)','select','from','%s.%s\x20=\x20%s.%s','web','fullPath','%s-%s.%s','randomstring','generate','output','csv','custom','AnalyticExtractedReport','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','COUNT(*)','run','runReport','IS\x20NOT\x20NULL','value','eml-format','rimraf','zip-dir'];(function(_0x27d958,_0x29ef87){var _0x53e63e=function(_0x4130ec){while(--_0x4130ec){_0x27d958['push'](_0x27d958['shift']());}};_0x53e63e(++_0x29ef87);}(_0x5335,0xa0));var _0x5533=function(_0x3131b5,_0x425415){_0x3131b5=_0x3131b5-0x0;var _0x274d11=_0x5335[_0x3131b5];return _0x274d11;};'use strict';var emlformat=require(_0x5533('0x0'));var rimraf=require(_0x5533('0x1'));var zipdir=require(_0x5533('0x2'));var jsonpatch=require(_0x5533('0x3'));var rp=require(_0x5533('0x4'));var moment=require(_0x5533('0x5'));var BPromise=require(_0x5533('0x6'));var Mustache=require(_0x5533('0x7'));var util=require('util');var path=require(_0x5533('0x8'));var sox=require(_0x5533('0x9'));var csv=require(_0x5533('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5533('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x5533('0xc'));var jsforce=require(_0x5533('0xd'));var deskjs=require(_0x5533('0xe'));var toCsv=require('to-csv');var querystring=require(_0x5533('0xf'));var Papa=require('papaparse');var Redis=require(_0x5533('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x5533('0x11'));var as=require(_0x5533('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5533('0x13'))(_0x5533('0x14'));var utils=require(_0x5533('0x15'));var config=require(_0x5533('0x16'));var licenseUtil=require(_0x5533('0x17'));var db=require(_0x5533('0x18'))['db'];var dbH=require(_0x5533('0x18'))[_0x5533('0x19')];function respondWithStatusCode(_0x1f8fbf,_0x22d637){_0x22d637=_0x22d637||0xcc;return function(_0x2b6ca8){if(_0x2b6ca8){return _0x1f8fbf[_0x5533('0x1a')](_0x22d637);}return _0x1f8fbf['status'](_0x22d637)['end']();};}function respondWithResult(_0x811621,_0x18e7ec){_0x18e7ec=_0x18e7ec||0xc8;return function(_0x2fc435){if(_0x2fc435){return _0x811621['status'](_0x18e7ec)[_0x5533('0x1b')](_0x2fc435);}};}function respondWithFilteredResult(_0x574eab,_0x5ce8c1){return function(_0x26eb35){if(_0x26eb35){var _0x464583=typeof _0x5ce8c1[_0x5533('0x1c')]===_0x5533('0x1d')&&typeof _0x5ce8c1[_0x5533('0x1e')]===_0x5533('0x1d');var _0xde7230=_0x26eb35[_0x5533('0x1f')];var _0x305463=_0x464583?0x0:_0x5ce8c1[_0x5533('0x1c')];var _0x3c3f0d=_0x464583?_0x26eb35[_0x5533('0x1f')]:_0x5ce8c1[_0x5533('0x1c')]+_0x5ce8c1[_0x5533('0x1e')];var _0x44ede0;if(_0x3c3f0d>=_0xde7230){_0x3c3f0d=_0xde7230;_0x44ede0=0xc8;}else{_0x44ede0=0xce;}_0x574eab[_0x5533('0x20')](_0x44ede0);return _0x574eab[_0x5533('0x21')]('Content-Range',_0x305463+'-'+_0x3c3f0d+'/'+_0xde7230)[_0x5533('0x1b')](_0x26eb35);}return null;};}function patchUpdates(_0x151326){return function(_0x479ce9){try{jsonpatch[_0x5533('0x22')](_0x479ce9,_0x151326,!![]);}catch(_0x5cc0bc){return BPromise[_0x5533('0x23')](_0x5cc0bc);}return _0x479ce9['save']();};}function saveUpdates(_0x1790df,_0x53b3cf){return function(_0x1e8d52){if(_0x1e8d52){return _0x1e8d52[_0x5533('0x24')](_0x1790df)[_0x5533('0x25')](function(_0x25ba5b){return _0x25ba5b;});}return null;};}function removeEntity(_0x57136c,_0x13f3c4){return function(_0x1a1436){if(_0x1a1436){return _0x1a1436['destroy']()[_0x5533('0x25')](function(){var _0x4c831d=_0x1a1436[_0x5533('0x26')]({'plain':!![]});var _0x10b369=_0x5533('0x27');return db[_0x5533('0x28')][_0x5533('0x29')]({'where':{'type':_0x10b369,'resourceId':_0x4c831d['id']}})[_0x5533('0x25')](function(){return _0x1a1436;});})[_0x5533('0x25')](function(){_0x57136c[_0x5533('0x20')](0xcc)[_0x5533('0x2a')]();});}};}function handleEntityNotFound(_0x5edfbd,_0x11a58b){return function(_0x3d57e1){if(!_0x3d57e1){_0x5edfbd[_0x5533('0x1a')](0x194);}return _0x3d57e1;};}function handleError(_0x2d5e62,_0x554d7e){_0x554d7e=_0x554d7e||0x1f4;return function(_0x2d434b){logger[_0x5533('0x2b')](_0x2d434b['stack']);if(_0x2d434b[_0x5533('0x2c')]){delete _0x2d434b[_0x5533('0x2c')];}_0x2d5e62[_0x5533('0x20')](_0x554d7e)[_0x5533('0x2d')](_0x2d434b);};}exports['index']=function(_0x87c0e6,_0x203aa4){var _0x84fe8b={},_0x9639e2={},_0x3de2a2={'count':0x0,'rows':[]};var _0x458dfe=_['map'](db[_0x5533('0x2e')]['rawAttributes'],function(_0x16715e){return{'name':_0x16715e['fieldName'],'type':_0x16715e['type'][_0x5533('0x2f')]};});_0x9639e2[_0x5533('0x30')]=_[_0x5533('0x31')](_0x458dfe,_0x5533('0x2c'));_0x9639e2[_0x5533('0x32')]=_[_0x5533('0x33')](_0x87c0e6[_0x5533('0x32')]);_0x9639e2[_0x5533('0x34')]=_['intersection'](_0x9639e2[_0x5533('0x30')],_0x9639e2[_0x5533('0x32')]);_0x84fe8b[_0x5533('0x35')]=_['intersection'](_0x9639e2['model'],qs[_0x5533('0x36')](_0x87c0e6['query'][_0x5533('0x36')]));_0x84fe8b['attributes']=_0x84fe8b['attributes']['length']?_0x84fe8b[_0x5533('0x35')]:_0x9639e2[_0x5533('0x30')];if(!_0x87c0e6[_0x5533('0x32')][_0x5533('0x37')](_0x5533('0x38'))){_0x84fe8b['limit']=qs[_0x5533('0x1e')](_0x87c0e6[_0x5533('0x32')]['limit']);_0x84fe8b[_0x5533('0x1c')]=qs['offset'](_0x87c0e6[_0x5533('0x32')][_0x5533('0x1c')]);}_0x84fe8b[_0x5533('0x39')]=qs['sort'](_0x87c0e6['query'][_0x5533('0x3a')]);_0x84fe8b[_0x5533('0x3b')]=qs[_0x5533('0x34')](_[_0x5533('0x3c')](_0x87c0e6[_0x5533('0x32')],_0x9639e2[_0x5533('0x34')]),_0x458dfe);if(_0x87c0e6[_0x5533('0x32')][_0x5533('0x3d')]){_0x84fe8b[_0x5533('0x3b')]=_[_0x5533('0x3e')](_0x84fe8b[_0x5533('0x3b')],{'$or':_[_0x5533('0x31')](_0x458dfe,function(_0x2a8ea0){if(_0x2a8ea0[_0x5533('0x3f')]!==_0x5533('0x40')){var _0x4a21bd={};_0x4a21bd[_0x2a8ea0[_0x5533('0x2c')]]={'$like':'%'+_0x87c0e6[_0x5533('0x32')]['filter']+'%'};return _0x4a21bd;}})});}_0x84fe8b=_[_0x5533('0x3e')]({},_0x84fe8b,_0x87c0e6[_0x5533('0x41')]);var _0x9fe1af={'where':_0x84fe8b[_0x5533('0x3b')]};return db['AnalyticCustomReport']['count'](_0x9fe1af)[_0x5533('0x25')](function(_0x1fa582){_0x3de2a2['count']=_0x1fa582;if(_0x87c0e6['query'][_0x5533('0x42')]){_0x84fe8b[_0x5533('0x43')]=[{'all':!![]}];}return db[_0x5533('0x2e')][_0x5533('0x44')](_0x84fe8b);})[_0x5533('0x25')](function(_0x1b4efe){_0x3de2a2['rows']=_0x1b4efe;return _0x3de2a2;})['then'](respondWithFilteredResult(_0x203aa4,_0x84fe8b))['catch'](handleError(_0x203aa4,null));};exports[_0x5533('0x45')]=function(_0x24ade3,_0x391371){var _0x158c8e={'raw':![],'where':{'id':_0x24ade3[_0x5533('0x46')]['id']}},_0x566545={};_0x566545[_0x5533('0x30')]=_[_0x5533('0x33')](db['AnalyticCustomReport']['rawAttributes']);_0x566545[_0x5533('0x32')]=_['keys'](_0x24ade3[_0x5533('0x32')]);_0x566545[_0x5533('0x34')]=_[_0x5533('0x47')](_0x566545[_0x5533('0x30')],_0x566545['query']);_0x158c8e['attributes']=_[_0x5533('0x47')](_0x566545[_0x5533('0x30')],qs[_0x5533('0x36')](_0x24ade3['query'][_0x5533('0x36')]));_0x158c8e[_0x5533('0x35')]=_0x158c8e[_0x5533('0x35')]['length']?_0x158c8e[_0x5533('0x35')]:_0x566545[_0x5533('0x30')];if(_0x24ade3[_0x5533('0x32')][_0x5533('0x42')]){_0x158c8e[_0x5533('0x43')]=[{'all':!![]}];}_0x158c8e=_['merge']({},_0x158c8e,_0x24ade3[_0x5533('0x41')]);return db['AnalyticCustomReport']['find'](_0x158c8e)[_0x5533('0x25')](handleEntityNotFound(_0x391371,null))[_0x5533('0x25')](respondWithResult(_0x391371,null))['catch'](handleError(_0x391371,null));};exports[_0x5533('0x48')]=function(_0x334251,_0x32badf){return db[_0x5533('0x2e')][_0x5533('0x48')](_0x334251[_0x5533('0x49')],{})[_0x5533('0x25')](function(_0x42a1bd){var _0x1c4e65=_0x334251['user'][_0x5533('0x26')]({'plain':!![]});if(!_0x1c4e65)throw new Error(_0x5533('0x4a'));if(_0x1c4e65[_0x5533('0x4b')]==='user'){var _0x3e81ad=_0x42a1bd['get']({'plain':!![]});var _0x5d0d95='Reports';return db['UserProfileSection'][_0x5533('0x4c')]({'where':{'name':_0x5d0d95,'userProfileId':_0x1c4e65['userProfileId']},'raw':!![]})['then'](function(_0x44de37){if(_0x44de37&&_0x44de37['autoAssociation']===0x0){return db[_0x5533('0x28')][_0x5533('0x48')]({'name':_0x3e81ad['name'],'resourceId':_0x3e81ad['id'],'type':_0x5533('0x27'),'sectionId':_0x44de37['id']},{})[_0x5533('0x25')](function(){return _0x42a1bd;});}else{return _0x42a1bd;}})[_0x5533('0x4d')](function(_0x10244b){logger[_0x5533('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x10244b);throw _0x10244b;});}return _0x42a1bd;})[_0x5533('0x25')](respondWithResult(_0x32badf,0xc9))[_0x5533('0x4d')](handleError(_0x32badf,null));};exports[_0x5533('0x24')]=function(_0x3ff2d6,_0xcf336c){if(_0x3ff2d6[_0x5533('0x49')]['id']){delete _0x3ff2d6[_0x5533('0x49')]['id'];}return db[_0x5533('0x2e')]['find']({'where':{'id':_0x3ff2d6[_0x5533('0x46')]['id']}})[_0x5533('0x25')](handleEntityNotFound(_0xcf336c,null))['then'](saveUpdates(_0x3ff2d6[_0x5533('0x49')],null))[_0x5533('0x25')](respondWithResult(_0xcf336c,null))[_0x5533('0x4d')](handleError(_0xcf336c,null));};exports[_0x5533('0x29')]=function(_0x47c1f8,_0x4605b9){return db[_0x5533('0x2e')]['find']({'where':{'id':_0x47c1f8[_0x5533('0x46')]['id']}})['then'](handleEntityNotFound(_0x4605b9,null))[_0x5533('0x25')](removeEntity(_0x4605b9,null))[_0x5533('0x4d')](handleError(_0x4605b9,null));};exports[_0x5533('0x4e')]=function(_0xb17ead,_0x13653d){var _0x5486ea=0xa;var _0x19de49=[_0x5533('0x4f'),_0x5533('0x50'),'right_join',_0x5533('0x51')];var _0x2806a0={'SUM':_0x5533('0x52'),'COUNT':_0x5533('0x53'),'COUNT DISTINCT':_0x5533('0x54'),'MAX':_0x5533('0x55'),'MIN':_0x5533('0x56'),'AVG':_0x5533('0x57'),'GROUP_CONCAT':_0x5533('0x58'),'GROUP_CONCAT ASC':_0x5533('0x59'),'GROUP_CONCAT DESC':_0x5533('0x5a')};var _0x289ee7={'SEC_TO_TIME':_0x5533('0x5b'),'DATE':_0x5533('0x5c'),'HOUR':'HOUR(%s)','ROUND':_0x5533('0x5d'),'UNIX_TIMESTAMP':_0x5533('0x5e')};var _0x10f1f9=function(_0x49ec5d){return!_[_0x5533('0x5f')]([_0x5533('0x60'),'IS\x20NOT\x20NULL',_0x5533('0x61'),_0x5533('0x62')],_0x49ec5d);};var _0x194761=function(_0xc125dd){if(!_0xc125dd||!_0xc125dd[_0x5533('0x63')][_0x5533('0x64')]){return'';}for(var _0x2ef08a='(',_0x1e0e80=0x0;_0x1e0e80<_0xc125dd[_0x5533('0x63')][_0x5533('0x64')];_0x1e0e80+=0x1){_0x1e0e80>0x0&&(_0x2ef08a+='\x20'+_0xc125dd[_0x5533('0x65')]+'\x20');_0x2ef08a+=_0xc125dd[_0x5533('0x63')][_0x1e0e80][_0x5533('0x66')]?_0x194761(_0xc125dd[_0x5533('0x63')][_0x1e0e80][_0x5533('0x66')]):_0xc125dd['rules'][_0x1e0e80][_0x5533('0x67')]+'\x20'+_0xc125dd[_0x5533('0x63')][_0x1e0e80][_0x5533('0x68')]+(_0x10f1f9(_0xc125dd['rules'][_0x1e0e80][_0x5533('0x68')])?'\x20'+_0xc125dd[_0x5533('0x63')][_0x1e0e80]['value']:'');}return _0x2ef08a+')';};var _0x1188f4={'where':{'id':_0xb17ead[_0x5533('0x46')]['id']}},_0x4be63b,_0x5f1621,_0x44b571,_0x20153a,_0x1b3e2e;_0x1188f4=_[_0x5533('0x3e')]({},_0x1188f4,_0xb17ead[_0x5533('0x41')]);return db[_0x5533('0x2e')][_0x5533('0x4c')](_0x1188f4)[_0x5533('0x25')](function(_0x3e279b){if(_0x3e279b){_0x4be63b=_0x3e279b;return _0x3e279b[_0x5533('0x69')]();}return null;})[_0x5533('0x25')](function(_0x14e79b){if(_0x14e79b){if(!_0x14e79b[_0x5533('0x64')]){throw new db[(_0x5533('0x6a'))][(_0x5533('0x6b'))](_0x5533('0x6c'),0x193);}_0x5f1621=_0x14e79b;return db[_0x5533('0x6d')][_0x5533('0x44')]({'raw':!![]});}return null;})[_0x5533('0x25')](function(_0x5c62a4){if(_0x5c62a4){_0x44b571=_[_0x5533('0x6e')](_0x5c62a4,'id');var _0x11fc39;var _0x3a499b=squel['select']();_0x3a499b['from'](_0x4be63b['table']);for(var _0x49a35a=0x0;_0x49a35a<_0x5f1621[_0x5533('0x64')];_0x49a35a+=0x1){_0x11fc39=_0x5f1621[_0x49a35a][_0x5533('0x6f')]?_0x44b571[_0x5f1621[_0x49a35a][_0x5533('0x6f')]][_0x5533('0x70')]:_0x5f1621[_0x49a35a]['field'];_0x11fc39=_0x5f1621[_0x49a35a][_0x5533('0x71')]?_['replace'](_0x2806a0[_0x5f1621[_0x49a35a][_0x5533('0x71')]],'%s',_0x11fc39):_0x11fc39;_0x11fc39=_0x5f1621[_0x49a35a]['format']?_[_0x5533('0x72')](_0x289ee7[_0x5f1621[_0x49a35a][_0x5533('0x73')]],'%s',_0x11fc39):_0x11fc39;if(_0x5f1621[_0x49a35a][_0x5533('0x74')]){_0x3a499b[_0x5533('0x66')](_0x11fc39);}_0x5f1621[_0x49a35a]['orderBy']&&_0x3a499b[_0x5533('0x39')](_0x11fc39,_0x5f1621[_0x49a35a][_0x5533('0x75')]==='DESC'?![]:!![]);_0x3a499b[_0x5533('0x67')](_0x11fc39,_0x5f1621[_0x49a35a][_0x5533('0x76')]||_0x11fc39);}if(_0x4be63b['joins']){_0x4be63b[_0x5533('0x77')]=JSON['parse'](_0x4be63b['joins']);for(var _0x516dd0=0x0;_0x516dd0<_0x4be63b[_0x5533('0x77')][_0x5533('0x64')];_0x516dd0+=0x1){if(_0x4be63b['joins'][_0x516dd0][_0x5533('0x3f')]&&_['includes'](_0x19de49,_0x4be63b[_0x5533('0x77')][_0x516dd0]['type'])&&_0x4be63b[_0x5533('0x77')][_0x516dd0][_0x5533('0x78')]&&_0x4be63b[_0x5533('0x77')][_0x516dd0][_0x5533('0x79')]&&_0x4be63b['joins'][_0x516dd0][_0x5533('0x7a')]){_0x3a499b[_0x4be63b[_0x5533('0x77')][_0x516dd0][_0x5533('0x3f')]](_0x4be63b[_0x5533('0x77')][_0x516dd0][_0x5533('0x79')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x4be63b[_0x5533('0x7b')],_0x4be63b[_0x5533('0x77')][_0x516dd0][_0x5533('0x78')],_0x4be63b[_0x5533('0x77')][_0x516dd0][_0x5533('0x79')],_0x4be63b[_0x5533('0x77')][_0x516dd0][_0x5533('0x7a')]));}}}if(_0x4be63b[_0x5533('0x7c')]){_0x4be63b[_0x5533('0x7c')]=JSON[_0x5533('0x7d')](_0x4be63b['conditions']);_0x3a499b[_0x5533('0x3b')](_0x194761(_0x4be63b[_0x5533('0x7c')][_0x5533('0x66')]));}_0x1b3e2e=_0x3a499b[_0x5533('0x7e')]();_0x3a499b['limit'](_0x5486ea);_0x3a499b[_0x5533('0x1c')](0x0);logger[_0x5533('0x7f')](_0x5533('0x80'),_0x3a499b[_0x5533('0x81')]());return dbH[_0x5533('0x82')][_0x5533('0x32')](_0x3a499b['toString'](),{'type':dbH[_0x5533('0x82')][_0x5533('0x83')][_0x5533('0x84')]});}})[_0x5533('0x25')](respondWithResult(_0x13653d,null))['catch'](handleError(_0x13653d,null));};function runReport(_0x215a59,_0x3fed35,_0x418de5){var _0x2ee6ca=_0x3fed35[_0x5533('0x2c')];var _0x9d1269=0xa;var _0x12a49e=[_0x5533('0x4f'),_0x5533('0x50'),_0x5533('0x85'),_0x5533('0x51')];var _0x1e0cb0={'SUM':_0x5533('0x52'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x5533('0x54'),'MAX':_0x5533('0x55'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x5533('0x58'),'GROUP_CONCAT ASC':_0x5533('0x59'),'GROUP_CONCAT DESC':_0x5533('0x5a')};var _0x49023a={'SEC_TO_TIME':_0x5533('0x5b'),'DATE':_0x5533('0x5c'),'HOUR':_0x5533('0x86'),'ROUND':_0x5533('0x5d'),'UNIX_TIMESTAMP':_0x5533('0x5e')};var _0x552ca3=function(_0x9a902c){return!_['includes']([_0x5533('0x60'),'IS\x20NOT\x20NULL',_0x5533('0x61'),_0x5533('0x62')],_0x9a902c);};var _0x1cdc0e=function(_0x1d8286){if(!_0x1d8286||!_0x1d8286['rules'][_0x5533('0x64')]){return'';}for(var _0x11981b='(',_0x2a4100=0x0;_0x2a4100<_0x1d8286[_0x5533('0x63')][_0x5533('0x64')];_0x2a4100+=0x1){_0x2a4100>0x0&&(_0x11981b+='\x20'+_0x1d8286[_0x5533('0x65')]+'\x20');_0x11981b+=_0x1d8286['rules'][_0x2a4100][_0x5533('0x66')]?_0x1cdc0e(_0x1d8286[_0x5533('0x63')][_0x2a4100][_0x5533('0x66')]):_0x1d8286[_0x5533('0x63')][_0x2a4100][_0x5533('0x67')]+'\x20'+_0x1d8286['rules'][_0x2a4100][_0x5533('0x68')]+(_0x552ca3(_0x1d8286[_0x5533('0x63')][_0x2a4100][_0x5533('0x68')])?'\x20'+_0x1d8286[_0x5533('0x63')][_0x2a4100]['value']:'');}return _0x11981b+')';};var _0x69ccc5={'where':{'id':_0x215a59['id']}},_0x3dff4b,_0x2e0553,_0x11d451,_0x2f2713,_0xc06370;_0x69ccc5=_[_0x5533('0x3e')]({},_0x69ccc5,_0x418de5);return db[_0x5533('0x2e')]['find'](_0x69ccc5)['then'](function(_0x339fa3){if(_0x339fa3){_0x3dff4b=_0x339fa3;return _0x339fa3[_0x5533('0x69')]();}return null;})['then'](function(_0xb23804){if(_0xb23804){if(!_0xb23804['length']){throw new db[(_0x5533('0x6a'))]['ValidationErrorItem'](_0x5533('0x6c'),0x193);}_0x2e0553=_0xb23804;return db[_0x5533('0x6d')][_0x5533('0x44')]({'raw':!![]});}return null;})[_0x5533('0x25')](function(_0x44ac2c){if(_0x44ac2c){_0x11d451=_['keyBy'](_0x44ac2c,'id');var _0x41017d;var _0x18ff80=squel[_0x5533('0x87')]();_0x18ff80[_0x5533('0x88')](_0x3dff4b[_0x5533('0x7b')]);for(var _0x1feb9f=0x0;_0x1feb9f<_0x2e0553['length'];_0x1feb9f+=0x1){_0x41017d=_0x2e0553[_0x1feb9f][_0x5533('0x6f')]?_0x11d451[_0x2e0553[_0x1feb9f][_0x5533('0x6f')]][_0x5533('0x70')]:_0x2e0553[_0x1feb9f]['field'];_0x41017d=_0x2e0553[_0x1feb9f][_0x5533('0x71')]?_['replace'](_0x1e0cb0[_0x2e0553[_0x1feb9f][_0x5533('0x71')]],'%s',_0x41017d):_0x41017d;_0x41017d=_0x2e0553[_0x1feb9f][_0x5533('0x73')]?_['replace'](_0x49023a[_0x2e0553[_0x1feb9f][_0x5533('0x73')]],'%s',_0x41017d):_0x41017d;if(_0x2e0553[_0x1feb9f][_0x5533('0x74')]){_0x18ff80['group'](_0x41017d);}_0x2e0553[_0x1feb9f][_0x5533('0x75')]&&_0x18ff80['order'](_0x41017d,_0x2e0553[_0x1feb9f][_0x5533('0x75')]==='DESC'?![]:!![]);_0x18ff80[_0x5533('0x67')](_0x41017d,_0x2e0553[_0x1feb9f][_0x5533('0x76')]||_0x41017d);}if(_0x3dff4b[_0x5533('0x77')]){_0x3dff4b[_0x5533('0x77')]=JSON[_0x5533('0x7d')](_0x3dff4b[_0x5533('0x77')]);for(var _0x560dd6=0x0;_0x560dd6<_0x3dff4b[_0x5533('0x77')]['length'];_0x560dd6+=0x1){if(_0x3dff4b[_0x5533('0x77')][_0x560dd6][_0x5533('0x3f')]&&_['includes'](_0x12a49e,_0x3dff4b['joins'][_0x560dd6]['type'])&&_0x3dff4b[_0x5533('0x77')][_0x560dd6][_0x5533('0x78')]&&_0x3dff4b[_0x5533('0x77')][_0x560dd6][_0x5533('0x79')]&&_0x3dff4b['joins'][_0x560dd6]['foreignKey']){_0x18ff80[_0x3dff4b[_0x5533('0x77')][_0x560dd6][_0x5533('0x3f')]](_0x3dff4b[_0x5533('0x77')][_0x560dd6][_0x5533('0x79')],null,util[_0x5533('0x73')](_0x5533('0x89'),_0x3dff4b[_0x5533('0x7b')],_0x3dff4b[_0x5533('0x77')][_0x560dd6]['parentKey'],_0x3dff4b[_0x5533('0x77')][_0x560dd6][_0x5533('0x79')],_0x3dff4b['joins'][_0x560dd6][_0x5533('0x7a')]));}}}if(_0x3dff4b[_0x5533('0x7c')]){_0x3dff4b[_0x5533('0x7c')]=JSON[_0x5533('0x7d')](_0x3dff4b['conditions']);_0x18ff80['where'](_0x1cdc0e(_0x3dff4b[_0x5533('0x7c')][_0x5533('0x66')]));}_0xc06370=_0x18ff80['clone']();_0x18ff80[_0x5533('0x1e')](_0x9d1269);_0x18ff80[_0x5533('0x1c')](0x0);return;}})[_0x5533('0x25')](function(){if(_0x3fed35['output']===_0x5533('0x8a')){return null;}var _0x4f033a=_[_0x5533('0x3e')](_0x3fed35,{'name':_0x3fed35[_0x5533('0x8b')]||_0x3fed35[_0x5533('0x2c')]||_0x3dff4b['name'],'basename':_0x2ee6ca,'savename':util[_0x5533('0x73')](_0x5533('0x8c'),_0x3fed35[_0x5533('0x2c')]||_0x3dff4b[_0x5533('0x2c')],require(_0x5533('0x8d'))[_0x5533('0x8e')](0x4),_0x3fed35[_0x5533('0x8f')]||_0x5533('0x90')),'reportId':_0x3dff4b['id'],'reportType':_0x5533('0x91')});return db[_0x5533('0x92')]['create'](_0x4f033a,{'raw':!![]});})[_0x5533('0x25')](function(_0x14083e){if(_0x3dff4b[_0x5533('0x7b')]===_0x5533('0x93')){_0xc06370[_0x5533('0x3b')](_0x3dff4b[_0x5533('0x7b')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x3fed35[_0x5533('0x94')],_0x3fed35[_0x5533('0x95')]);}else{_0xc06370[_0x5533('0x3b')](_0x3dff4b[_0x5533('0x7b')]+_0x5533('0x96'),_0x3fed35[_0x5533('0x94')],_0x3fed35['endDate']);}if(_0x14083e){logger[_0x5533('0x97')](_0x5533('0x98'),_0xc06370[_0x5533('0x81')]());require(_0x5533('0x99'))[_0x5533('0x9a')](path[_0x5533('0x4f')](__dirname,_0x5533('0x9b'),_0x14083e[_0x5533('0x8f')]),[_0x14083e['id'],_0xc06370['toString'](),path['join'](__dirname,_0x5533('0x9c'),_0x14083e[_0x5533('0x9d')]),_0x2ee6ca]);return _0x14083e;}else{var _0x18fd15=squel[_0x5533('0x87')]();_0x18fd15[_0x5533('0x88')]('('+_0xc06370[_0x5533('0x81')]()+')','countTable');_0x18fd15['field'](_0x5533('0x9e'),_0x5533('0x1f'));_0xc06370['limit'](_0x3fed35['limit']||_0x9d1269);_0xc06370[_0x5533('0x1c')](_0x3fed35[_0x5533('0x1c')]||0x0);return dbH[_0x5533('0x82')]['query'](_0x18fd15[_0x5533('0x81')](),{'type':dbH[_0x5533('0x82')][_0x5533('0x83')][_0x5533('0x84')]})[_0x5533('0x25')](function(_0x15a322){if(!_0x15a322['length']){_0x2f2713=0x0;}else{_0x2f2713=_0x15a322[0x0][_0x5533('0x1f')]||0x0;}return dbH[_0x5533('0x82')]['query'](_0xc06370['toString'](),{'type':dbH[_0x5533('0x82')][_0x5533('0x83')][_0x5533('0x84')]});})[_0x5533('0x25')](function(_0x3ca995){return{'rows':_0x3ca995||[],'count':_0x2f2713};});}});}exports[_0x5533('0x9f')]=function(_0x3decaa,_0x54efaf){return runReport(_0x3decaa['params'],_0x3decaa[_0x5533('0x32')],_0x3decaa[_0x5533('0x41')])[_0x5533('0x25')](respondWithResult(_0x54efaf,null))[_0x5533('0x4d')](handleError(_0x54efaf,null));};exports[_0x5533('0xa0')]=runReport;exports[_0x5533('0x32')]=function(_0x35b1ed,_0x41da61){var _0xafa46f=0xa;var _0xd2c287=[_0x5533('0x4f'),_0x5533('0x50'),_0x5533('0x85'),_0x5533('0x51')];var _0x82512a={'SUM':_0x5533('0x52'),'COUNT':_0x5533('0x53'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0x5533('0x56'),'AVG':_0x5533('0x57'),'GROUP_CONCAT':_0x5533('0x58'),'GROUP_CONCAT ASC':_0x5533('0x59'),'GROUP_CONCAT DESC':_0x5533('0x5a')};var _0x408021={'SEC_TO_TIME':_0x5533('0x5b'),'DATE':_0x5533('0x5c'),'HOUR':_0x5533('0x86'),'ROUND':_0x5533('0x5d'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x28366d=function(_0x40ae78){return!_['includes']([_0x5533('0x60'),_0x5533('0xa1'),_0x5533('0x61'),_0x5533('0x62')],_0x40ae78);};var _0x5957b2=function(_0x2e2013){if(!_0x2e2013||!_0x2e2013[_0x5533('0x63')][_0x5533('0x64')]){return'';}for(var _0x3b868d='(',_0x170c7c=0x0;_0x170c7c<_0x2e2013[_0x5533('0x63')][_0x5533('0x64')];_0x170c7c+=0x1){_0x170c7c>0x0&&(_0x3b868d+='\x20'+_0x2e2013[_0x5533('0x65')]+'\x20');_0x3b868d+=_0x2e2013[_0x5533('0x63')][_0x170c7c][_0x5533('0x66')]?_0x5957b2(_0x2e2013[_0x5533('0x63')][_0x170c7c][_0x5533('0x66')]):_0x2e2013[_0x5533('0x63')][_0x170c7c][_0x5533('0x67')]+'\x20'+_0x2e2013[_0x5533('0x63')][_0x170c7c][_0x5533('0x68')]+(_0x28366d(_0x2e2013['rules'][_0x170c7c]['condition'])?'\x20'+_0x2e2013[_0x5533('0x63')][_0x170c7c][_0x5533('0xa2')]:'');}return _0x3b868d+')';};var _0x41f342={'where':{'id':_0x35b1ed[_0x5533('0x46')]['id']}},_0x1a0d49,_0xa9e863,_0x1b0167,_0x355c6c,_0x20b068;_0x41f342=_['merge']({},_0x41f342,_0x35b1ed[_0x5533('0x41')]);return db[_0x5533('0x2e')][_0x5533('0x4c')](_0x41f342)[_0x5533('0x25')](function(_0x10d07a){if(_0x10d07a){_0x1a0d49=_0x10d07a;return _0x10d07a['getFields']();}return null;})['then'](function(_0x4e86d9){if(_0x4e86d9){if(!_0x4e86d9[_0x5533('0x64')]){throw new db[(_0x5533('0x6a'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0xa9e863=_0x4e86d9;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x5533('0x25')](function(_0x3db6cf){if(_0x3db6cf){_0x1b0167=_[_0x5533('0x6e')](_0x3db6cf,'id');var _0x4604b7;var _0x2a9127=squel[_0x5533('0x87')]();_0x2a9127[_0x5533('0x88')](_0x1a0d49[_0x5533('0x7b')]);for(var _0xfe0fff=0x0;_0xfe0fff<_0xa9e863['length'];_0xfe0fff+=0x1){_0x4604b7=_0xa9e863[_0xfe0fff][_0x5533('0x6f')]?_0x1b0167[_0xa9e863[_0xfe0fff][_0x5533('0x6f')]]['metric']:_0xa9e863[_0xfe0fff]['field'];_0x4604b7=_0xa9e863[_0xfe0fff][_0x5533('0x71')]?_[_0x5533('0x72')](_0x82512a[_0xa9e863[_0xfe0fff][_0x5533('0x71')]],'%s',_0x4604b7):_0x4604b7;_0x4604b7=_0xa9e863[_0xfe0fff]['format']?_[_0x5533('0x72')](_0x408021[_0xa9e863[_0xfe0fff][_0x5533('0x73')]],'%s',_0x4604b7):_0x4604b7;if(_0xa9e863[_0xfe0fff][_0x5533('0x74')]){_0x2a9127['group'](_0x4604b7);}_0xa9e863[_0xfe0fff][_0x5533('0x75')]&&_0x2a9127[_0x5533('0x39')](_0x4604b7,_0xa9e863[_0xfe0fff]['orderBy']==='DESC'?![]:!![]);_0x2a9127[_0x5533('0x67')](_0x4604b7,_0xa9e863[_0xfe0fff][_0x5533('0x76')]||_0x4604b7);}if(_0x1a0d49[_0x5533('0x77')]){_0x1a0d49['joins']=JSON[_0x5533('0x7d')](_0x1a0d49[_0x5533('0x77')]);for(var _0x3624a7=0x0;_0x3624a7<_0x1a0d49[_0x5533('0x77')][_0x5533('0x64')];_0x3624a7+=0x1){if(_0x1a0d49[_0x5533('0x77')][_0x3624a7]['type']&&_[_0x5533('0x5f')](_0xd2c287,_0x1a0d49[_0x5533('0x77')][_0x3624a7][_0x5533('0x3f')])&&_0x1a0d49[_0x5533('0x77')][_0x3624a7][_0x5533('0x78')]&&_0x1a0d49[_0x5533('0x77')][_0x3624a7][_0x5533('0x79')]&&_0x1a0d49['joins'][_0x3624a7]['foreignKey']){_0x2a9127[_0x1a0d49['joins'][_0x3624a7]['type']](_0x1a0d49[_0x5533('0x77')][_0x3624a7]['foreignTable'],null,util[_0x5533('0x73')]('%s.%s\x20=\x20%s.%s',_0x1a0d49['table'],_0x1a0d49[_0x5533('0x77')][_0x3624a7][_0x5533('0x78')],_0x1a0d49['joins'][_0x3624a7][_0x5533('0x79')],_0x1a0d49[_0x5533('0x77')][_0x3624a7][_0x5533('0x7a')]));}}}if(_0x1a0d49[_0x5533('0x7c')]){_0x1a0d49[_0x5533('0x7c')]=JSON[_0x5533('0x7d')](_0x1a0d49['conditions']);_0x2a9127['where'](_0x5957b2(_0x1a0d49[_0x5533('0x7c')][_0x5533('0x66')]));}_0x20b068=_0x2a9127['clone']();_0x2a9127[_0x5533('0x1e')](_0xafa46f);_0x2a9127[_0x5533('0x1c')](0x0);logger[_0x5533('0x7f')](_0x5533('0x80'),_0x2a9127[_0x5533('0x81')]());return dbH[_0x5533('0x82')][_0x5533('0x32')](_0x2a9127[_0x5533('0x81')](),{'type':dbH['sequelize'][_0x5533('0x83')][_0x5533('0x84')]});}})['then'](function(){return{'sql':_0x20b068[_0x5533('0x81')]()};})[_0x5533('0x25')](respondWithResult(_0x41da61,null))[_0x5533('0x4d')](handleError(_0x41da61,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index df4f271..07a74f8 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 _0xb0fb=['../../config/environment','exports','analytics_custom_reports','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x425003,_0x537e64){var _0x5b71fe=function(_0x14352a){while(--_0x14352a){_0x425003['push'](_0x425003['shift']());}};_0x5b71fe(++_0x537e64);}(_0xb0fb,0x1c6));var _0xbb0f=function(_0x176329,_0x568c84){_0x176329=_0x176329-0x0;var _0x31997c=_0xb0fb[_0x176329];return _0x31997c;};'use strict';var _=require('lodash');var util=require(_0xbb0f('0x0'));var logger=require(_0xbb0f('0x1'))(_0xbb0f('0x2'));var moment=require(_0xbb0f('0x3'));var BPromise=require(_0xbb0f('0x4'));var rp=require(_0xbb0f('0x5'));var fs=require('fs');var path=require(_0xbb0f('0x6'));var rimraf=require(_0xbb0f('0x7'));var config=require(_0xbb0f('0x8'));var attributes=require('./analyticCustomReport.attributes');module[_0xbb0f('0x9')]=function(_0x7d35e6,_0x5bb1af){return _0x7d35e6['define']('AnalyticCustomReport',attributes,{'tableName':_0xbb0f('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa131=['path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x3053b7,_0x5761ae){var _0x582a6c=function(_0x32e1eb){while(--_0x32e1eb){_0x3053b7['push'](_0x3053b7['shift']());}};_0x582a6c(++_0x5761ae);}(_0xa131,0x14c));var _0x1a13=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xa131[_0x92c450];return _0x2a9599;};'use strict';var _=require(_0x1a13('0x0'));var util=require(_0x1a13('0x1'));var logger=require(_0x1a13('0x2'))(_0x1a13('0x3'));var moment=require(_0x1a13('0x4'));var BPromise=require(_0x1a13('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1a13('0x6'));var rimraf=require(_0x1a13('0x7'));var config=require(_0x1a13('0x8'));var attributes=require(_0x1a13('0x9'));module[_0x1a13('0xa')]=function(_0x2c340f,_0x34ef9d){return _0x2c340f['define'](_0x1a13('0xb'),attributes,{'tableName':_0x1a13('0xc'),'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 df29426..e7c0aa3 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 _0x8321=['debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','lodash','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','request','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent'];(function(_0x421f21,_0x221096){var _0x342441=function(_0x173d8d){while(--_0x173d8d){_0x421f21['push'](_0x421f21['shift']());}};_0x342441(++_0x221096);}(_0x8321,0x196));var _0x1832=function(_0x243279,_0x29bb49){_0x243279=_0x243279-0x0;var _0x21e8e1=_0x8321[_0x243279];return _0x21e8e1;};'use strict';var _=require(_0x1832('0x0'));var util=require('util');var moment=require(_0x1832('0x1'));var BPromise=require(_0x1832('0x2'));var rs=require(_0x1832('0x3'));var fs=require('fs');var Redis=require(_0x1832('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1832('0x5'));var config=require(_0x1832('0x6'));var jayson=require(_0x1832('0x7'));var client=jayson[_0x1832('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xd5f19a,_0x2bb52c,_0x403617){return new BPromise(function(_0x259b57,_0x5a1ba7){return client[_0x1832('0x9')](_0xd5f19a,_0x403617)['then'](function(_0x355bb1){logger['info'](_0x1832('0xa'),_0x2bb52c,_0x1832('0xb'));logger[_0x1832('0xc')](_0x1832('0xd'),_0x2bb52c,'request\x20sent',JSON[_0x1832('0xe')](_0x355bb1));if(_0x355bb1[_0x1832('0xf')]){if(_0x355bb1[_0x1832('0xf')]['code']===0x1f4){logger[_0x1832('0xf')]('AnalyticCustomReport,\x20%s,\x20%s',_0x2bb52c,_0x355bb1[_0x1832('0xf')]['message']);return _0x5a1ba7(_0x355bb1['error'][_0x1832('0x10')]);}logger['error'](_0x1832('0xa'),_0x2bb52c,_0x355bb1[_0x1832('0xf')][_0x1832('0x10')]);return _0x259b57(_0x355bb1[_0x1832('0xf')]['message']);}else{logger[_0x1832('0x11')]('AnalyticCustomReport,\x20%s,\x20%s',_0x2bb52c,_0x1832('0xb'));_0x259b57(_0x355bb1['result']['message']);}})[_0x1832('0x12')](function(_0x185ee9){logger[_0x1832('0xf')](_0x1832('0xa'),_0x2bb52c,_0x185ee9);_0x5a1ba7(_0x185ee9);});});} \ No newline at end of file +var _0x2931=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','lodash','bluebird','randomstring'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2931,0xb1));var _0x1293=function(_0x84ef38,_0x580f5a){_0x84ef38=_0x84ef38-0x0;var _0x4c7599=_0x2931[_0x84ef38];return _0x4c7599;};'use strict';var _=require(_0x1293('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x1293('0x1'));var rs=require(_0x1293('0x2'));var fs=require('fs');var Redis=require(_0x1293('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1293('0x4'));var logger=require(_0x1293('0x5'))(_0x1293('0x6'));var config=require(_0x1293('0x7'));var jayson=require(_0x1293('0x8'));var client=jayson['client'][_0x1293('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3ffafd,_0x274a18,_0x1c614b){return new BPromise(function(_0x26602a,_0x253c01){return client[_0x1293('0xa')](_0x3ffafd,_0x1c614b)[_0x1293('0xb')](function(_0x28d2e6){logger[_0x1293('0xc')](_0x1293('0xd'),_0x274a18,_0x1293('0xe'));logger[_0x1293('0xf')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x274a18,'request\x20sent',JSON['stringify'](_0x28d2e6));if(_0x28d2e6['error']){if(_0x28d2e6[_0x1293('0x10')][_0x1293('0x11')]===0x1f4){logger[_0x1293('0x10')](_0x1293('0xd'),_0x274a18,_0x28d2e6[_0x1293('0x10')][_0x1293('0x12')]);return _0x253c01(_0x28d2e6[_0x1293('0x10')]['message']);}logger[_0x1293('0x10')](_0x1293('0xd'),_0x274a18,_0x28d2e6[_0x1293('0x10')][_0x1293('0x12')]);return _0x26602a(_0x28d2e6['error'][_0x1293('0x12')]);}else{logger[_0x1293('0xc')](_0x1293('0xd'),_0x274a18,_0x1293('0xe'));_0x26602a(_0x28d2e6['result'][_0x1293('0x12')]);}})[_0x1293('0x13')](function(_0x44f627){logger[_0x1293('0x10')]('AnalyticCustomReport,\x20%s,\x20%s',_0x274a18,_0x44f627);_0x253c01(_0x44f627);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index faf9d03..0620bad 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 _0x8e90=['/:id','/:id/preview','preview','/:id/run','run','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated'];(function(_0x42367b,_0x513f57){var _0x5ab5c0=function(_0x1e4c95){while(--_0x1e4c95){_0x42367b['push'](_0x42367b['shift']());}};_0x5ab5c0(++_0x513f57);}(_0x8e90,0x1d6));var _0x08e9=function(_0x575057,_0x14baf3){_0x575057=_0x575057-0x0;var _0x49dbc8=_0x8e90[_0x575057];return _0x49dbc8;};'use strict';var multer=require(_0x08e9('0x0'));var util=require(_0x08e9('0x1'));var path=require(_0x08e9('0x2'));var timeout=require(_0x08e9('0x3'));var express=require(_0x08e9('0x4'));var router=express[_0x08e9('0x5')]();var fs_extra=require(_0x08e9('0x6'));var auth=require(_0x08e9('0x7'));var interaction=require(_0x08e9('0x8'));var config=require(_0x08e9('0x9'));var controller=require(_0x08e9('0xa'));router[_0x08e9('0xb')]('/',auth[_0x08e9('0xc')](),controller['index']);router[_0x08e9('0xb')](_0x08e9('0xd'),auth[_0x08e9('0xc')](),controller['show']);router[_0x08e9('0xb')](_0x08e9('0xe'),auth[_0x08e9('0xc')](),controller[_0x08e9('0xf')]);router[_0x08e9('0xb')](_0x08e9('0x10'),auth[_0x08e9('0xc')](),controller[_0x08e9('0x11')]);router[_0x08e9('0xb')]('/:id/query',auth[_0x08e9('0xc')](),controller['query']);router['post']('/',auth[_0x08e9('0xc')](),controller[_0x08e9('0x12')]);router[_0x08e9('0x13')](_0x08e9('0xd'),auth[_0x08e9('0xc')](),controller[_0x08e9('0x14')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x08e9('0x15')]);module[_0x08e9('0x16')]=router; \ No newline at end of file +var _0xe59e=['fs-extra','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','index','/:id','isAuthenticated','show','preview','/:id/run','/:id/query','query','create','put','destroy','exports','multer','util','path','connect-timeout'];(function(_0x31df6f,_0x380e73){var _0x31e353=function(_0x3a434b){while(--_0x3a434b){_0x31df6f['push'](_0x31df6f['shift']());}};_0x31e353(++_0x380e73);}(_0xe59e,0x122));var _0xee59=function(_0xe9f47d,_0x44be4a){_0xe9f47d=_0xe9f47d-0x0;var _0xf105dc=_0xe59e[_0xe9f47d];return _0xf105dc;};'use strict';var multer=require(_0xee59('0x0'));var util=require(_0xee59('0x1'));var path=require(_0xee59('0x2'));var timeout=require(_0xee59('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xee59('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xee59('0x5'));var config=require(_0xee59('0x6'));var controller=require(_0xee59('0x7'));router[_0xee59('0x8')]('/',auth['isAuthenticated'](),controller[_0xee59('0x9')]);router['get'](_0xee59('0xa'),auth[_0xee59('0xb')](),controller[_0xee59('0xc')]);router['get']('/:id/preview',auth[_0xee59('0xb')](),controller[_0xee59('0xd')]);router[_0xee59('0x8')](_0xee59('0xe'),auth[_0xee59('0xb')](),controller['run']);router[_0xee59('0x8')](_0xee59('0xf'),auth[_0xee59('0xb')](),controller[_0xee59('0x10')]);router['post']('/',auth[_0xee59('0xb')](),controller[_0xee59('0x11')]);router[_0xee59('0x12')](_0xee59('0xa'),auth[_0xee59('0xb')](),controller['update']);router['delete'](_0xee59('0xa'),auth['isAuthenticated'](),controller[_0xee59('0x13')]);module[_0xee59('0x14')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index 864cf73..d714c03 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 _0x038b=['exports','STRING','TEXT'];(function(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0x038b,0x114));var _0xb038=function(_0x1a7b71,_0x42c3c7){_0x1a7b71=_0x1a7b71-0x0;var _0x2145a2=_0x038b[_0x1a7b71];return _0x2145a2;};'use strict';var Sequelize=require('sequelize');module[_0xb038('0x0')]={'name':{'type':Sequelize[_0xb038('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xb038('0x1')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0xb038('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xb038('0x2')]}}; \ No newline at end of file +var _0x7fbe=['STRING','TEXT'];(function(_0x44ff3a,_0x46f40d){var _0x333bc1=function(_0x1114aa){while(--_0x1114aa){_0x44ff3a['push'](_0x44ff3a['shift']());}};_0x333bc1(++_0x46f40d);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x5c52a3,_0x13c8d5){_0x5c52a3=_0x5c52a3-0x0;var _0x5537b9=_0x7fbe[_0x5c52a3];return _0x5537b9;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xe7fb('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0xe7fb('0x0')]},'parent':{'type':Sequelize[_0xe7fb('0x0')]},'table':{'type':Sequelize[_0xe7fb('0x0')]},'conditions':{'type':Sequelize[_0xe7fb('0x1')]},'joins':{'type':Sequelize[_0xe7fb('0x1')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index 82e0c16..5a2108a 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 _0x1261=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','dbH','sendStatus','status','offset','limit','undefined','set','json','apply','reject','save','then','destroy','get','DefaultReports','UserProfileResource','error','name','index','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','nolimit','sort','where','pick','filter','merge','map','VIRTUAL','count','include','findAll','rows','show','length','includeAll','options','find','catch','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','params','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)','HOUR(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parentKey','foreignTable','foreignKey','conditions','parse','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','left_join','AVG(%s)','DATE(%s)','value','keyBy','select','order','%s.%s\x20=\x20%s.%s','clone','web','fullPath','randomstring','generate','output','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','Run\x20Query:','../../components/export/','savename','COUNT(*)','run','runReport','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20NULL','Sequelize','debug'];(function(_0x3caf5a,_0x427fd1){var _0x336cd3=function(_0x13a058){while(--_0x13a058){_0x3caf5a['push'](_0x3caf5a['shift']());}};_0x336cd3(++_0x427fd1);}(_0x1261,0x144));var _0x1126=function(_0x923ab6,_0x200ec5){_0x923ab6=_0x923ab6-0x0;var _0x484752=_0x1261[_0x923ab6];return _0x484752;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1126('0x0'));var zipdir=require(_0x1126('0x1'));var jsonpatch=require(_0x1126('0x2'));var rp=require(_0x1126('0x3'));var moment=require(_0x1126('0x4'));var BPromise=require(_0x1126('0x5'));var Mustache=require(_0x1126('0x6'));var util=require(_0x1126('0x7'));var path=require(_0x1126('0x8'));var sox=require(_0x1126('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1126('0xa'));var _=require(_0x1126('0xb'));var squel=require('squel');var crypto=require(_0x1126('0xc'));var jsforce=require(_0x1126('0xd'));var deskjs=require(_0x1126('0xe'));var toCsv=require(_0x1126('0xf'));var querystring=require(_0x1126('0x10'));var Papa=require('papaparse');var Redis=require(_0x1126('0x11'));var authService=require(_0x1126('0x12'));var qs=require(_0x1126('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1126('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x1126('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x1126('0x16'));var db=require(_0x1126('0x17'))['db'];var dbH=require(_0x1126('0x17'))[_0x1126('0x18')];function respondWithStatusCode(_0xca0355,_0x3f10e9){_0x3f10e9=_0x3f10e9||0xcc;return function(_0xd8ca42){if(_0xd8ca42){return _0xca0355[_0x1126('0x19')](_0x3f10e9);}return _0xca0355[_0x1126('0x1a')](_0x3f10e9)['end']();};}function respondWithResult(_0x5de9a7,_0x1af673){_0x1af673=_0x1af673||0xc8;return function(_0x154e20){if(_0x154e20){return _0x5de9a7[_0x1126('0x1a')](_0x1af673)['json'](_0x154e20);}};}function respondWithFilteredResult(_0x45149c,_0x4794a7){return function(_0x35fe9f){if(_0x35fe9f){var _0x42f379=typeof _0x4794a7[_0x1126('0x1b')]==='undefined'&&typeof _0x4794a7[_0x1126('0x1c')]===_0x1126('0x1d');var _0x4a7b49=_0x35fe9f['count'];var _0x22ae0b=_0x42f379?0x0:_0x4794a7[_0x1126('0x1b')];var _0x58d11a=_0x42f379?_0x35fe9f['count']:_0x4794a7[_0x1126('0x1b')]+_0x4794a7['limit'];var _0x22ed37;if(_0x58d11a>=_0x4a7b49){_0x58d11a=_0x4a7b49;_0x22ed37=0xc8;}else{_0x22ed37=0xce;}_0x45149c[_0x1126('0x1a')](_0x22ed37);return _0x45149c[_0x1126('0x1e')]('Content-Range',_0x22ae0b+'-'+_0x58d11a+'/'+_0x4a7b49)[_0x1126('0x1f')](_0x35fe9f);}return null;};}function patchUpdates(_0x49d209){return function(_0x56efeb){try{jsonpatch[_0x1126('0x20')](_0x56efeb,_0x49d209,!![]);}catch(_0x3a9bed){return BPromise[_0x1126('0x21')](_0x3a9bed);}return _0x56efeb[_0x1126('0x22')]();};}function saveUpdates(_0x526ca1,_0x29ab60){return function(_0x477e6a){if(_0x477e6a){return _0x477e6a['update'](_0x526ca1)[_0x1126('0x23')](function(_0x59cd8e){return _0x59cd8e;});}return null;};}function removeEntity(_0x529dd9,_0x4b57ab){return function(_0x2199d9){if(_0x2199d9){return _0x2199d9[_0x1126('0x24')]()[_0x1126('0x23')](function(){var _0x34bcf1=_0x2199d9[_0x1126('0x25')]({'plain':!![]});var _0x1b07a7=_0x1126('0x26');return db[_0x1126('0x27')]['destroy']({'where':{'type':_0x1b07a7,'resourceId':_0x34bcf1['id']}})[_0x1126('0x23')](function(){return _0x2199d9;});})[_0x1126('0x23')](function(){_0x529dd9[_0x1126('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x541bc9,_0xeb7d89){return function(_0x39bf0e){if(!_0x39bf0e){_0x541bc9['sendStatus'](0x194);}return _0x39bf0e;};}function handleError(_0x2fb797,_0x23d2bc){_0x23d2bc=_0x23d2bc||0x1f4;return function(_0x4a334a){logger[_0x1126('0x28')](_0x4a334a['stack']);if(_0x4a334a[_0x1126('0x29')]){delete _0x4a334a['name'];}_0x2fb797[_0x1126('0x1a')](_0x23d2bc)['send'](_0x4a334a);};}exports[_0x1126('0x2a')]=function(_0x5f2611,_0x5252e0){var _0x4a53ab={},_0x17646e={},_0xa8906d={'count':0x0,'rows':[]};var _0x1cef48=_['map'](db[_0x1126('0x2b')][_0x1126('0x2c')],function(_0x56f7f8){return{'name':_0x56f7f8[_0x1126('0x2d')],'type':_0x56f7f8[_0x1126('0x2e')][_0x1126('0x2f')]};});_0x17646e[_0x1126('0x30')]=_['map'](_0x1cef48,'name');_0x17646e[_0x1126('0x31')]=_[_0x1126('0x32')](_0x5f2611[_0x1126('0x31')]);_0x17646e[_0x1126('0x33')]=_['intersection'](_0x17646e[_0x1126('0x30')],_0x17646e[_0x1126('0x31')]);_0x4a53ab[_0x1126('0x34')]=_[_0x1126('0x35')](_0x17646e[_0x1126('0x30')],qs['fields'](_0x5f2611[_0x1126('0x31')][_0x1126('0x36')]));_0x4a53ab[_0x1126('0x34')]=_0x4a53ab[_0x1126('0x34')]['length']?_0x4a53ab['attributes']:_0x17646e[_0x1126('0x30')];if(!_0x5f2611[_0x1126('0x31')]['hasOwnProperty'](_0x1126('0x37'))){_0x4a53ab[_0x1126('0x1c')]=qs[_0x1126('0x1c')](_0x5f2611['query']['limit']);_0x4a53ab[_0x1126('0x1b')]=qs[_0x1126('0x1b')](_0x5f2611[_0x1126('0x31')][_0x1126('0x1b')]);}_0x4a53ab['order']=qs[_0x1126('0x38')](_0x5f2611['query'][_0x1126('0x38')]);_0x4a53ab[_0x1126('0x39')]=qs[_0x1126('0x33')](_[_0x1126('0x3a')](_0x5f2611[_0x1126('0x31')],_0x17646e['filters']),_0x1cef48);if(_0x5f2611[_0x1126('0x31')][_0x1126('0x3b')]){_0x4a53ab[_0x1126('0x39')]=_[_0x1126('0x3c')](_0x4a53ab[_0x1126('0x39')],{'$or':_[_0x1126('0x3d')](_0x1cef48,function(_0x3052f9){if(_0x3052f9['type']!==_0x1126('0x3e')){var _0x154c28={};_0x154c28[_0x3052f9[_0x1126('0x29')]]={'$like':'%'+_0x5f2611[_0x1126('0x31')][_0x1126('0x3b')]+'%'};return _0x154c28;}})});}_0x4a53ab=_['merge']({},_0x4a53ab,_0x5f2611['options']);var _0x1c4f06={'where':_0x4a53ab[_0x1126('0x39')]};return db[_0x1126('0x2b')][_0x1126('0x3f')](_0x1c4f06)[_0x1126('0x23')](function(_0x276fd5){_0xa8906d['count']=_0x276fd5;if(_0x5f2611['query']['includeAll']){_0x4a53ab[_0x1126('0x40')]=[{'all':!![]}];}return db['AnalyticDefaultReport'][_0x1126('0x41')](_0x4a53ab);})[_0x1126('0x23')](function(_0x3584a3){_0xa8906d[_0x1126('0x42')]=_0x3584a3;return _0xa8906d;})['then'](respondWithFilteredResult(_0x5252e0,_0x4a53ab))['catch'](handleError(_0x5252e0,null));};exports[_0x1126('0x43')]=function(_0xa93167,_0x1d63b9){var _0x5f5d3a={'raw':!![],'where':{'id':_0xa93167['params']['id']}},_0x2f8551={};_0x2f8551[_0x1126('0x30')]=_['keys'](db[_0x1126('0x2b')][_0x1126('0x2c')]);_0x2f8551[_0x1126('0x31')]=_['keys'](_0xa93167[_0x1126('0x31')]);_0x2f8551[_0x1126('0x33')]=_[_0x1126('0x35')](_0x2f8551['model'],_0x2f8551['query']);_0x5f5d3a['attributes']=_[_0x1126('0x35')](_0x2f8551['model'],qs[_0x1126('0x36')](_0xa93167['query'][_0x1126('0x36')]));_0x5f5d3a[_0x1126('0x34')]=_0x5f5d3a[_0x1126('0x34')][_0x1126('0x44')]?_0x5f5d3a[_0x1126('0x34')]:_0x2f8551['model'];if(_0xa93167[_0x1126('0x31')][_0x1126('0x45')]){_0x5f5d3a['include']=[{'all':!![]}];}_0x5f5d3a=_[_0x1126('0x3c')]({},_0x5f5d3a,_0xa93167[_0x1126('0x46')]);return db['AnalyticDefaultReport'][_0x1126('0x47')](_0x5f5d3a)[_0x1126('0x23')](handleEntityNotFound(_0x1d63b9,null))['then'](respondWithResult(_0x1d63b9,null))[_0x1126('0x48')](handleError(_0x1d63b9,null));};exports[_0x1126('0x49')]=function(_0x213a76,_0x59656d){return db[_0x1126('0x2b')][_0x1126('0x49')](_0x213a76[_0x1126('0x4a')],{})[_0x1126('0x23')](function(_0x224456){var _0x2081f2=_0x213a76[_0x1126('0x4b')][_0x1126('0x25')]({'plain':!![]});if(!_0x2081f2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2081f2[_0x1126('0x4c')]==='user'){var _0x40168e=_0x224456[_0x1126('0x25')]({'plain':!![]});var _0x4a1831='Reports';return db[_0x1126('0x4d')][_0x1126('0x47')]({'where':{'name':_0x4a1831,'userProfileId':_0x2081f2[_0x1126('0x4e')]},'raw':!![]})['then'](function(_0x3cb44c){if(_0x3cb44c&&_0x3cb44c[_0x1126('0x4f')]===0x0){return db[_0x1126('0x27')][_0x1126('0x49')]({'name':_0x40168e['name'],'resourceId':_0x40168e['id'],'type':_0x1126('0x26'),'sectionId':_0x3cb44c['id']},{})[_0x1126('0x23')](function(){return _0x224456;});}else{return _0x224456;}})['catch'](function(_0x4bcc08){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4bcc08);throw _0x4bcc08;});}return _0x224456;})[_0x1126('0x23')](respondWithResult(_0x59656d,0xc9))[_0x1126('0x48')](handleError(_0x59656d,null));};exports['update']=function(_0x16552b,_0x1c7a2b){if(_0x16552b[_0x1126('0x4a')]['id']){delete _0x16552b[_0x1126('0x4a')]['id'];}return db[_0x1126('0x2b')]['find']({'where':{'id':_0x16552b[_0x1126('0x50')]['id']}})[_0x1126('0x23')](handleEntityNotFound(_0x1c7a2b,null))['then'](saveUpdates(_0x16552b[_0x1126('0x4a')],null))[_0x1126('0x23')](respondWithResult(_0x1c7a2b,null))[_0x1126('0x48')](handleError(_0x1c7a2b,null));};exports[_0x1126('0x24')]=function(_0xc8a0f,_0x59c3d0){return db[_0x1126('0x2b')]['find']({'where':{'id':_0xc8a0f[_0x1126('0x50')]['id']}})[_0x1126('0x23')](handleEntityNotFound(_0x59c3d0,null))[_0x1126('0x23')](removeEntity(_0x59c3d0,null))['catch'](handleError(_0x59c3d0,null));};exports[_0x1126('0x51')]=function(_0x2340f8,_0x5763b4){var _0x30812d=0xa;var _0x25038f=[_0x1126('0x52'),'left_join',_0x1126('0x53'),_0x1126('0x54')];var _0x22ab18={'SUM':_0x1126('0x55'),'COUNT':_0x1126('0x56'),'COUNT DISTINCT':_0x1126('0x57'),'MAX':_0x1126('0x58'),'MIN':_0x1126('0x59'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x1126('0x5a'),'GROUP_CONCAT ASC':_0x1126('0x5b'),'GROUP_CONCAT DESC':_0x1126('0x5c')};var _0x2a5422={'SEC_TO_TIME':_0x1126('0x5d'),'DATE':'DATE(%s)','HOUR':_0x1126('0x5e'),'ROUND':_0x1126('0x5f'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x3767e4=function(_0x5246aa){return!_[_0x1126('0x60')]([_0x1126('0x61'),'IS\x20NOT\x20NULL',_0x1126('0x62'),_0x1126('0x63')],_0x5246aa);};var _0x375b76=function(_0x592960){if(!_0x592960||!_0x592960[_0x1126('0x64')]['length']){return'';}for(var _0x558b6e='(',_0xbdc58=0x0;_0xbdc58<_0x592960[_0x1126('0x64')][_0x1126('0x44')];_0xbdc58+=0x1){_0xbdc58>0x0&&(_0x558b6e+='\x20'+_0x592960[_0x1126('0x65')]+'\x20');_0x558b6e+=_0x592960[_0x1126('0x64')][_0xbdc58][_0x1126('0x66')]?_0x375b76(_0x592960[_0x1126('0x64')][_0xbdc58]['group']):_0x592960[_0x1126('0x64')][_0xbdc58][_0x1126('0x67')]+'\x20'+_0x592960[_0x1126('0x64')][_0xbdc58][_0x1126('0x68')]+(_0x3767e4(_0x592960[_0x1126('0x64')][_0xbdc58][_0x1126('0x68')])?'\x20'+_0x592960['rules'][_0xbdc58]['value']:'');}return _0x558b6e+')';};var _0x16a343={'where':{'id':_0x2340f8[_0x1126('0x50')]['id']}},_0x3921c2,_0x4bf2b3,_0x5ee130,_0x5e9260,_0x51a28d;_0x16a343=_[_0x1126('0x3c')]({},_0x16a343,_0x2340f8[_0x1126('0x46')]);return db['AnalyticDefaultReport'][_0x1126('0x47')](_0x16a343)[_0x1126('0x23')](function(_0x170bf0){if(_0x170bf0){_0x3921c2=_0x170bf0;return _0x170bf0[_0x1126('0x69')]();}return null;})[_0x1126('0x23')](function(_0x3f007b){if(_0x3f007b){if(!_0x3f007b[_0x1126('0x44')]){throw new db['Sequelize'][(_0x1126('0x6a'))](_0x1126('0x6b'),0x193);}_0x4bf2b3=_0x3f007b;return db[_0x1126('0x6c')][_0x1126('0x41')]({'raw':!![]});}return null;})[_0x1126('0x23')](function(_0x56c003){if(_0x56c003){_0x5ee130=_['keyBy'](_0x56c003,'id');var _0x15cf3d;var _0x2643d7=squel['select']();_0x2643d7[_0x1126('0x6d')](_0x3921c2[_0x1126('0x6e')]);for(var _0x366675=0x0;_0x366675<_0x4bf2b3[_0x1126('0x44')];_0x366675+=0x1){_0x15cf3d=_0x4bf2b3[_0x366675][_0x1126('0x6f')]?_0x5ee130[_0x4bf2b3[_0x366675][_0x1126('0x6f')]][_0x1126('0x70')]:_0x4bf2b3[_0x366675][_0x1126('0x67')];_0x15cf3d=_0x4bf2b3[_0x366675][_0x1126('0x71')]?_[_0x1126('0x72')](_0x22ab18[_0x4bf2b3[_0x366675][_0x1126('0x71')]],'%s',_0x15cf3d):_0x15cf3d;_0x15cf3d=_0x4bf2b3[_0x366675][_0x1126('0x73')]?_[_0x1126('0x72')](_0x2a5422[_0x4bf2b3[_0x366675]['format']],'%s',_0x15cf3d):_0x15cf3d;if(_0x4bf2b3[_0x366675][_0x1126('0x74')]){_0x2643d7[_0x1126('0x66')](_0x15cf3d);}_0x4bf2b3[_0x366675][_0x1126('0x75')]&&_0x2643d7['order'](_0x15cf3d,_0x4bf2b3[_0x366675]['orderBy']===_0x1126('0x76')?![]:!![]);_0x2643d7[_0x1126('0x67')](_0x15cf3d,_0x4bf2b3[_0x366675][_0x1126('0x77')]||_0x15cf3d);}if(_0x3921c2[_0x1126('0x78')]){_0x3921c2['joins']=JSON['parse'](_0x3921c2['joins']);for(var _0x79afca=0x0;_0x79afca<_0x3921c2[_0x1126('0x78')][_0x1126('0x44')];_0x79afca+=0x1){if(_0x3921c2[_0x1126('0x78')][_0x79afca]['type']&&_[_0x1126('0x60')](_0x25038f,_0x3921c2['joins'][_0x79afca][_0x1126('0x2e')])&&_0x3921c2[_0x1126('0x78')][_0x79afca][_0x1126('0x79')]&&_0x3921c2[_0x1126('0x78')][_0x79afca][_0x1126('0x7a')]&&_0x3921c2[_0x1126('0x78')][_0x79afca][_0x1126('0x7b')]){_0x2643d7[_0x3921c2['joins'][_0x79afca][_0x1126('0x2e')]](_0x3921c2['joins'][_0x79afca][_0x1126('0x7a')],null,util[_0x1126('0x73')]('%s.%s\x20=\x20%s.%s',_0x3921c2[_0x1126('0x6e')],_0x3921c2[_0x1126('0x78')][_0x79afca]['parentKey'],_0x3921c2[_0x1126('0x78')][_0x79afca][_0x1126('0x7a')],_0x3921c2['joins'][_0x79afca]['foreignKey']));}}}if(_0x3921c2[_0x1126('0x7c')]){_0x3921c2[_0x1126('0x7c')]=JSON[_0x1126('0x7d')](_0x3921c2['conditions']);_0x2643d7['where'](_0x375b76(_0x3921c2['conditions'][_0x1126('0x66')]));}_0x51a28d=_0x2643d7['clone']();_0x2643d7['limit'](_0x30812d);_0x2643d7[_0x1126('0x1b')](0x0);logger['debug'](_0x1126('0x7e'),_0x2643d7[_0x1126('0x7f')]());return dbH['sequelize'][_0x1126('0x31')](_0x2643d7[_0x1126('0x7f')](),{'type':dbH[_0x1126('0x80')][_0x1126('0x81')][_0x1126('0x82')]});}})['then'](respondWithResult(_0x5763b4,null))[_0x1126('0x48')](handleError(_0x5763b4,null));};function runReport(_0x426faa,_0x5679ec,_0xd182b1){var _0x2d6fcf=_0x5679ec[_0x1126('0x29')];var _0x2af2d0=0xa;var _0x2598a7=[_0x1126('0x52'),_0x1126('0x83'),_0x1126('0x53'),_0x1126('0x54')];var _0x9a2af0={'SUM':_0x1126('0x55'),'COUNT':_0x1126('0x56'),'COUNT DISTINCT':_0x1126('0x57'),'MAX':_0x1126('0x58'),'MIN':_0x1126('0x59'),'AVG':_0x1126('0x84'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x1126('0x5b'),'GROUP_CONCAT DESC':_0x1126('0x5c')};var _0x33cccf={'SEC_TO_TIME':_0x1126('0x5d'),'DATE':_0x1126('0x85'),'HOUR':'HOUR(%s)','ROUND':_0x1126('0x5f'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5bdb30=function(_0xb1199b){return!_[_0x1126('0x60')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x1126('0x62'),_0x1126('0x63')],_0xb1199b);};var _0x228552=function(_0x1ee970){if(!_0x1ee970||!_0x1ee970[_0x1126('0x64')][_0x1126('0x44')]){return'';}for(var _0x2d7150='(',_0x35a9a4=0x0;_0x35a9a4<_0x1ee970[_0x1126('0x64')]['length'];_0x35a9a4+=0x1){_0x35a9a4>0x0&&(_0x2d7150+='\x20'+_0x1ee970[_0x1126('0x65')]+'\x20');_0x2d7150+=_0x1ee970[_0x1126('0x64')][_0x35a9a4][_0x1126('0x66')]?_0x228552(_0x1ee970[_0x1126('0x64')][_0x35a9a4][_0x1126('0x66')]):_0x1ee970[_0x1126('0x64')][_0x35a9a4]['field']+'\x20'+_0x1ee970[_0x1126('0x64')][_0x35a9a4][_0x1126('0x68')]+(_0x5bdb30(_0x1ee970[_0x1126('0x64')][_0x35a9a4][_0x1126('0x68')])?'\x20'+_0x1ee970[_0x1126('0x64')][_0x35a9a4][_0x1126('0x86')]:'');}return _0x2d7150+')';};var _0x2418ca={'where':{'id':_0x426faa['id']}},_0x2d2dfc,_0x38eac6,_0xc3503b,_0x5d6edb,_0x50238d;_0x2418ca=_[_0x1126('0x3c')]({},_0x2418ca,_0xd182b1);return db['AnalyticDefaultReport'][_0x1126('0x47')](_0x2418ca)['then'](function(_0x4461ae){if(_0x4461ae){_0x2d2dfc=_0x4461ae;return _0x4461ae['getFields']();}return null;})[_0x1126('0x23')](function(_0x4fbd44){if(_0x4fbd44){if(!_0x4fbd44['length']){throw new db['Sequelize'][(_0x1126('0x6a'))](_0x1126('0x6b'),0x193);}_0x38eac6=_0x4fbd44;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x1126('0x23')](function(_0xe2f82d){if(_0xe2f82d){_0xc3503b=_[_0x1126('0x87')](_0xe2f82d,'id');var _0x5dfb8f;var _0x48f914=squel[_0x1126('0x88')]();_0x48f914['from'](_0x2d2dfc[_0x1126('0x6e')]);for(var _0x39d9a0=0x0;_0x39d9a0<_0x38eac6[_0x1126('0x44')];_0x39d9a0+=0x1){_0x5dfb8f=_0x38eac6[_0x39d9a0][_0x1126('0x6f')]?_0xc3503b[_0x38eac6[_0x39d9a0][_0x1126('0x6f')]]['metric']:_0x38eac6[_0x39d9a0]['field'];_0x5dfb8f=_0x38eac6[_0x39d9a0][_0x1126('0x71')]?_[_0x1126('0x72')](_0x9a2af0[_0x38eac6[_0x39d9a0][_0x1126('0x71')]],'%s',_0x5dfb8f):_0x5dfb8f;_0x5dfb8f=_0x38eac6[_0x39d9a0][_0x1126('0x73')]?_[_0x1126('0x72')](_0x33cccf[_0x38eac6[_0x39d9a0][_0x1126('0x73')]],'%s',_0x5dfb8f):_0x5dfb8f;if(_0x38eac6[_0x39d9a0][_0x1126('0x74')]){_0x48f914[_0x1126('0x66')](_0x5dfb8f);}_0x38eac6[_0x39d9a0][_0x1126('0x75')]&&_0x48f914[_0x1126('0x89')](_0x5dfb8f,_0x38eac6[_0x39d9a0][_0x1126('0x75')]==='DESC'?![]:!![]);_0x48f914[_0x1126('0x67')](_0x5dfb8f,_0x38eac6[_0x39d9a0]['alias']||_0x5dfb8f);}if(_0x2d2dfc[_0x1126('0x78')]){_0x2d2dfc['joins']=JSON[_0x1126('0x7d')](_0x2d2dfc[_0x1126('0x78')]);for(var _0x215d4d=0x0;_0x215d4d<_0x2d2dfc[_0x1126('0x78')]['length'];_0x215d4d+=0x1){if(_0x2d2dfc[_0x1126('0x78')][_0x215d4d][_0x1126('0x2e')]&&_['includes'](_0x2598a7,_0x2d2dfc['joins'][_0x215d4d][_0x1126('0x2e')])&&_0x2d2dfc[_0x1126('0x78')][_0x215d4d][_0x1126('0x79')]&&_0x2d2dfc['joins'][_0x215d4d][_0x1126('0x7a')]&&_0x2d2dfc['joins'][_0x215d4d][_0x1126('0x7b')]){_0x48f914[_0x2d2dfc[_0x1126('0x78')][_0x215d4d]['type']](_0x2d2dfc[_0x1126('0x78')][_0x215d4d][_0x1126('0x7a')],null,util[_0x1126('0x73')](_0x1126('0x8a'),_0x2d2dfc[_0x1126('0x6e')],_0x2d2dfc['joins'][_0x215d4d][_0x1126('0x79')],_0x2d2dfc[_0x1126('0x78')][_0x215d4d][_0x1126('0x7a')],_0x2d2dfc['joins'][_0x215d4d]['foreignKey']));}}}if(_0x2d2dfc['conditions']){_0x2d2dfc[_0x1126('0x7c')]=JSON[_0x1126('0x7d')](_0x2d2dfc[_0x1126('0x7c')]);_0x48f914[_0x1126('0x39')](_0x228552(_0x2d2dfc['conditions'][_0x1126('0x66')]));}_0x50238d=_0x48f914[_0x1126('0x8b')]();_0x48f914[_0x1126('0x1c')](_0x2af2d0);_0x48f914[_0x1126('0x1b')](0x0);return;}})[_0x1126('0x23')](function(){if(_0x5679ec['output']===_0x1126('0x8c')){return null;}var _0x21c487=_['merge'](_0x5679ec,{'name':_0x5679ec[_0x1126('0x8d')]||_0x5679ec['name']||_0x2d2dfc['name'],'basename':_0x2d6fcf,'savename':util[_0x1126('0x73')]('%s-%s.%s',_0x5679ec[_0x1126('0x29')]||_0x2d2dfc[_0x1126('0x29')],require(_0x1126('0x8e'))[_0x1126('0x8f')](0x4),_0x5679ec[_0x1126('0x90')]||_0x1126('0x91')),'reportId':_0x2d2dfc['id'],'reportType':_0x1126('0x92')});return db[_0x1126('0x93')][_0x1126('0x49')](_0x21c487,{'raw':!![]});})['then'](function(_0x2577f5){if(_0x2d2dfc[_0x1126('0x6e')]===_0x1126('0x94')){_0x50238d[_0x1126('0x39')](_0x2d2dfc['table']+_0x1126('0x95'),_0x5679ec[_0x1126('0x96')],_0x5679ec[_0x1126('0x97')]);}else{_0x50238d[_0x1126('0x39')](_0x2d2dfc['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5679ec['startDate'],_0x5679ec[_0x1126('0x97')]);}if(_0x2577f5){logger['info'](_0x1126('0x98'),_0x50238d[_0x1126('0x7f')]());require('child_process')['fork'](path[_0x1126('0x52')](__dirname,_0x1126('0x99'),_0x2577f5['output']),[_0x2577f5['id'],_0x50238d[_0x1126('0x7f')](),path[_0x1126('0x52')](__dirname,'../../files/reports',_0x2577f5[_0x1126('0x9a')]),_0x2d6fcf]);return _0x2577f5;}else{var _0x4a9941=squel[_0x1126('0x88')]();_0x4a9941[_0x1126('0x6d')]('('+_0x50238d[_0x1126('0x7f')]()+')','countTable');_0x4a9941[_0x1126('0x67')](_0x1126('0x9b'),_0x1126('0x3f'));_0x50238d[_0x1126('0x1c')](_0x5679ec[_0x1126('0x1c')]||_0x2af2d0);_0x50238d[_0x1126('0x1b')](_0x5679ec[_0x1126('0x1b')]||0x0);return dbH[_0x1126('0x80')][_0x1126('0x31')](_0x4a9941[_0x1126('0x7f')](),{'type':dbH[_0x1126('0x80')][_0x1126('0x81')][_0x1126('0x82')]})[_0x1126('0x23')](function(_0x12ffa5){if(!_0x12ffa5[_0x1126('0x44')]){_0x5d6edb=0x0;}else{_0x5d6edb=_0x12ffa5[0x0][_0x1126('0x3f')]||0x0;}return dbH['sequelize'][_0x1126('0x31')](_0x50238d[_0x1126('0x7f')](),{'type':dbH['sequelize']['QueryTypes'][_0x1126('0x82')]});})[_0x1126('0x23')](function(_0x35065c){return{'rows':_0x35065c||[],'count':_0x5d6edb};});}});}exports[_0x1126('0x9c')]=function(_0x5c0215,_0x444f94){return runReport(_0x5c0215[_0x1126('0x50')],_0x5c0215['query'],_0x5c0215[_0x1126('0x46')])['then'](respondWithResult(_0x444f94,null))[_0x1126('0x48')](handleError(_0x444f94,null));};exports[_0x1126('0x9d')]=runReport;exports['query']=function(_0x4d43ad,_0xa02d9e){var _0x548f9e=0xa;var _0x5edb83=[_0x1126('0x52'),_0x1126('0x83'),_0x1126('0x53'),_0x1126('0x54')];var _0x4f29ce={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x1126('0x57'),'MAX':_0x1126('0x58'),'MIN':'MIN(%s)','AVG':_0x1126('0x84'),'GROUP_CONCAT':_0x1126('0x5a'),'GROUP_CONCAT ASC':_0x1126('0x5b'),'GROUP_CONCAT DESC':_0x1126('0x5c')};var _0x17b25d={'SEC_TO_TIME':_0x1126('0x5d'),'DATE':_0x1126('0x85'),'HOUR':_0x1126('0x5e'),'ROUND':_0x1126('0x5f'),'UNIX_TIMESTAMP':_0x1126('0x9e')};var _0x3a4a91=function(_0x55145f){return!_[_0x1126('0x60')](['IS\x20NULL',_0x1126('0x9f'),_0x1126('0x62'),_0x1126('0x63')],_0x55145f);};var _0x4c7dc7=function(_0x33a27b){if(!_0x33a27b||!_0x33a27b[_0x1126('0x64')][_0x1126('0x44')]){return'';}for(var _0x578c1b='(',_0x1562b2=0x0;_0x1562b2<_0x33a27b[_0x1126('0x64')][_0x1126('0x44')];_0x1562b2+=0x1){_0x1562b2>0x0&&(_0x578c1b+='\x20'+_0x33a27b[_0x1126('0x65')]+'\x20');_0x578c1b+=_0x33a27b[_0x1126('0x64')][_0x1562b2]['group']?_0x4c7dc7(_0x33a27b['rules'][_0x1562b2][_0x1126('0x66')]):_0x33a27b[_0x1126('0x64')][_0x1562b2][_0x1126('0x67')]+'\x20'+_0x33a27b[_0x1126('0x64')][_0x1562b2][_0x1126('0x68')]+(_0x3a4a91(_0x33a27b[_0x1126('0x64')][_0x1562b2][_0x1126('0x68')])?'\x20'+_0x33a27b[_0x1126('0x64')][_0x1562b2][_0x1126('0x86')]:'');}return _0x578c1b+')';};var _0x2fb228={'where':{'id':_0x4d43ad[_0x1126('0x50')]['id']}},_0x2c95b6,_0x4a4b43,_0x588f4f,_0x5ac4d6,_0x1168a5;_0x2fb228=_['merge']({},_0x2fb228,_0x4d43ad['options']);return db[_0x1126('0x2b')][_0x1126('0x47')](_0x2fb228)[_0x1126('0x23')](function(_0x48b088){if(_0x48b088){_0x2c95b6=_0x48b088;return _0x48b088[_0x1126('0x69')]();}return null;})[_0x1126('0x23')](function(_0x5a28f9){if(_0x5a28f9){if(!_0x5a28f9[_0x1126('0x44')]){throw new db[(_0x1126('0xa0'))][(_0x1126('0x6a'))](_0x1126('0x6b'),0x193);}_0x4a4b43=_0x5a28f9;return db[_0x1126('0x6c')]['findAll']({'raw':!![]});}return null;})[_0x1126('0x23')](function(_0x1140ec){if(_0x1140ec){_0x588f4f=_['keyBy'](_0x1140ec,'id');var _0x578f5c;var _0x559dae=squel[_0x1126('0x88')]();_0x559dae[_0x1126('0x6d')](_0x2c95b6[_0x1126('0x6e')]);for(var _0x9d7819=0x0;_0x9d7819<_0x4a4b43[_0x1126('0x44')];_0x9d7819+=0x1){_0x578f5c=_0x4a4b43[_0x9d7819]['MetricId']?_0x588f4f[_0x4a4b43[_0x9d7819][_0x1126('0x6f')]]['metric']:_0x4a4b43[_0x9d7819][_0x1126('0x67')];_0x578f5c=_0x4a4b43[_0x9d7819][_0x1126('0x71')]?_['replace'](_0x4f29ce[_0x4a4b43[_0x9d7819]['function']],'%s',_0x578f5c):_0x578f5c;_0x578f5c=_0x4a4b43[_0x9d7819][_0x1126('0x73')]?_[_0x1126('0x72')](_0x17b25d[_0x4a4b43[_0x9d7819]['format']],'%s',_0x578f5c):_0x578f5c;if(_0x4a4b43[_0x9d7819]['groupBy']){_0x559dae[_0x1126('0x66')](_0x578f5c);}_0x4a4b43[_0x9d7819][_0x1126('0x75')]&&_0x559dae[_0x1126('0x89')](_0x578f5c,_0x4a4b43[_0x9d7819][_0x1126('0x75')]===_0x1126('0x76')?![]:!![]);_0x559dae[_0x1126('0x67')](_0x578f5c,_0x4a4b43[_0x9d7819][_0x1126('0x77')]||_0x578f5c);}if(_0x2c95b6[_0x1126('0x78')]){_0x2c95b6[_0x1126('0x78')]=JSON[_0x1126('0x7d')](_0x2c95b6['joins']);for(var _0x4d6528=0x0;_0x4d6528<_0x2c95b6[_0x1126('0x78')][_0x1126('0x44')];_0x4d6528+=0x1){if(_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x2e')]&&_[_0x1126('0x60')](_0x5edb83,_0x2c95b6[_0x1126('0x78')][_0x4d6528]['type'])&&_0x2c95b6['joins'][_0x4d6528][_0x1126('0x79')]&&_0x2c95b6['joins'][_0x4d6528]['foreignTable']&&_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x7b')]){_0x559dae[_0x2c95b6['joins'][_0x4d6528][_0x1126('0x2e')]](_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x7a')],null,util[_0x1126('0x73')]('%s.%s\x20=\x20%s.%s',_0x2c95b6[_0x1126('0x6e')],_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x79')],_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x7a')],_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x7b')]));}}}if(_0x2c95b6['conditions']){_0x2c95b6[_0x1126('0x7c')]=JSON[_0x1126('0x7d')](_0x2c95b6[_0x1126('0x7c')]);_0x559dae[_0x1126('0x39')](_0x4c7dc7(_0x2c95b6['conditions'][_0x1126('0x66')]));}_0x1168a5=_0x559dae[_0x1126('0x8b')]();_0x559dae['limit'](_0x548f9e);_0x559dae[_0x1126('0x1b')](0x0);logger[_0x1126('0xa1')](_0x1126('0x7e'),_0x559dae['toString']());return dbH[_0x1126('0x80')][_0x1126('0x31')](_0x559dae[_0x1126('0x7f')](),{'type':dbH[_0x1126('0x80')][_0x1126('0x81')][_0x1126('0x82')]});}})['then'](function(){return{'sql':_0x1168a5[_0x1126('0x7f')]()};})[_0x1126('0x23')](respondWithResult(_0xa02d9e,null))['catch'](handleError(_0xa02d9e,null));}; \ No newline at end of file +var _0x524e=['AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','QueryTypes','SELECT','run','runReport','SUM(%s)','GROUP_CONCAT(%s)','debug','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','count','limit','set','Content-Range','json','apply','reject','save','then','destroy','get','DefaultReports','UserProfileResource','end','error','stack','name','send','index','AnalyticDefaultReport','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','show','rawAttributes','create','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','update','body','params','preview','left_join','right_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','Limited\x20Query:','sequelize','toString','join','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','getFields','from','clone','output','web','fullPath','generate','csv','default'];(function(_0x1fab97,_0x12706d){var _0x54529a=function(_0x395c75){while(--_0x395c75){_0x1fab97['push'](_0x1fab97['shift']());}};_0x54529a(++_0x12706d);}(_0x524e,0x15e));var _0xe524=function(_0x5be046,_0xf5bdc3){_0x5be046=_0x5be046-0x0;var _0x3d2dc3=_0x524e[_0x5be046];return _0x3d2dc3;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe524('0x0'));var jsonpatch=require(_0xe524('0x1'));var rp=require(_0xe524('0x2'));var moment=require(_0xe524('0x3'));var BPromise=require(_0xe524('0x4'));var Mustache=require(_0xe524('0x5'));var util=require(_0xe524('0x6'));var path=require(_0xe524('0x7'));var sox=require(_0xe524('0x8'));var csv=require(_0xe524('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe524('0xa'));var _=require(_0xe524('0xb'));var squel=require(_0xe524('0xc'));var crypto=require('crypto');var jsforce=require(_0xe524('0xd'));var deskjs=require(_0xe524('0xe'));var toCsv=require(_0xe524('0x9'));var querystring=require(_0xe524('0xf'));var Papa=require(_0xe524('0x10'));var Redis=require(_0xe524('0x11'));var authService=require(_0xe524('0x12'));var qs=require(_0xe524('0x13'));var as=require(_0xe524('0x14'));var hardwareService=require(_0xe524('0x15'));var logger=require(_0xe524('0x16'))(_0xe524('0x17'));var utils=require(_0xe524('0x18'));var config=require(_0xe524('0x19'));var licenseUtil=require(_0xe524('0x1a'));var db=require(_0xe524('0x1b'))['db'];var dbH=require('../../mysqldb')['dbH'];function respondWithStatusCode(_0xfdc2a5,_0x1541d8){_0x1541d8=_0x1541d8||0xcc;return function(_0x11adbc){if(_0x11adbc){return _0xfdc2a5[_0xe524('0x1c')](_0x1541d8);}return _0xfdc2a5[_0xe524('0x1d')](_0x1541d8)['end']();};}function respondWithResult(_0x12ff75,_0x51e9fe){_0x51e9fe=_0x51e9fe||0xc8;return function(_0x19f013){if(_0x19f013){return _0x12ff75[_0xe524('0x1d')](_0x51e9fe)['json'](_0x19f013);}};}function respondWithFilteredResult(_0x569660,_0x488fce){return function(_0x109795){if(_0x109795){var _0x538754=typeof _0x488fce[_0xe524('0x1e')]==='undefined'&&typeof _0x488fce['limit']==='undefined';var _0x3a4027=_0x109795['count'];var _0x11b2a1=_0x538754?0x0:_0x488fce[_0xe524('0x1e')];var _0x278de9=_0x538754?_0x109795[_0xe524('0x1f')]:_0x488fce['offset']+_0x488fce[_0xe524('0x20')];var _0x3ccb3f;if(_0x278de9>=_0x3a4027){_0x278de9=_0x3a4027;_0x3ccb3f=0xc8;}else{_0x3ccb3f=0xce;}_0x569660['status'](_0x3ccb3f);return _0x569660[_0xe524('0x21')](_0xe524('0x22'),_0x11b2a1+'-'+_0x278de9+'/'+_0x3a4027)[_0xe524('0x23')](_0x109795);}return null;};}function patchUpdates(_0x1dcc0f){return function(_0x1c4194){try{jsonpatch[_0xe524('0x24')](_0x1c4194,_0x1dcc0f,!![]);}catch(_0xbf059b){return BPromise[_0xe524('0x25')](_0xbf059b);}return _0x1c4194[_0xe524('0x26')]();};}function saveUpdates(_0x5c4d21,_0x7d1f92){return function(_0x5bb00b){if(_0x5bb00b){return _0x5bb00b['update'](_0x5c4d21)[_0xe524('0x27')](function(_0x23df5e){return _0x23df5e;});}return null;};}function removeEntity(_0x1ad106,_0x85fc51){return function(_0x599d5d){if(_0x599d5d){return _0x599d5d[_0xe524('0x28')]()['then'](function(){var _0x17e245=_0x599d5d[_0xe524('0x29')]({'plain':!![]});var _0xd62772=_0xe524('0x2a');return db[_0xe524('0x2b')][_0xe524('0x28')]({'where':{'type':_0xd62772,'resourceId':_0x17e245['id']}})[_0xe524('0x27')](function(){return _0x599d5d;});})['then'](function(){_0x1ad106['status'](0xcc)[_0xe524('0x2c')]();});}};}function handleEntityNotFound(_0x45abad,_0x476572){return function(_0x109a96){if(!_0x109a96){_0x45abad[_0xe524('0x1c')](0x194);}return _0x109a96;};}function handleError(_0x5405e4,_0x52f140){_0x52f140=_0x52f140||0x1f4;return function(_0x4b1ff){logger[_0xe524('0x2d')](_0x4b1ff[_0xe524('0x2e')]);if(_0x4b1ff[_0xe524('0x2f')]){delete _0x4b1ff[_0xe524('0x2f')];}_0x5405e4['status'](_0x52f140)[_0xe524('0x30')](_0x4b1ff);};}exports[_0xe524('0x31')]=function(_0x4a4e15,_0x5b7ded){var _0x20688e={},_0x376324={},_0x5b2fc3={'count':0x0,'rows':[]};var _0x31d4a7=_['map'](db[_0xe524('0x32')]['rawAttributes'],function(_0x315e56){return{'name':_0x315e56[_0xe524('0x33')],'type':_0x315e56[_0xe524('0x34')]['key']};});_0x376324[_0xe524('0x35')]=_['map'](_0x31d4a7,_0xe524('0x2f'));_0x376324[_0xe524('0x36')]=_[_0xe524('0x37')](_0x4a4e15['query']);_0x376324[_0xe524('0x38')]=_[_0xe524('0x39')](_0x376324['model'],_0x376324[_0xe524('0x36')]);_0x20688e[_0xe524('0x3a')]=_[_0xe524('0x39')](_0x376324[_0xe524('0x35')],qs['fields'](_0x4a4e15[_0xe524('0x36')][_0xe524('0x3b')]));_0x20688e[_0xe524('0x3a')]=_0x20688e[_0xe524('0x3a')][_0xe524('0x3c')]?_0x20688e[_0xe524('0x3a')]:_0x376324[_0xe524('0x35')];if(!_0x4a4e15[_0xe524('0x36')]['hasOwnProperty'](_0xe524('0x3d'))){_0x20688e['limit']=qs[_0xe524('0x20')](_0x4a4e15[_0xe524('0x36')]['limit']);_0x20688e[_0xe524('0x1e')]=qs['offset'](_0x4a4e15[_0xe524('0x36')][_0xe524('0x1e')]);}_0x20688e[_0xe524('0x3e')]=qs[_0xe524('0x3f')](_0x4a4e15[_0xe524('0x36')][_0xe524('0x3f')]);_0x20688e[_0xe524('0x40')]=qs[_0xe524('0x38')](_['pick'](_0x4a4e15[_0xe524('0x36')],_0x376324[_0xe524('0x38')]),_0x31d4a7);if(_0x4a4e15[_0xe524('0x36')][_0xe524('0x41')]){_0x20688e[_0xe524('0x40')]=_[_0xe524('0x42')](_0x20688e[_0xe524('0x40')],{'$or':_[_0xe524('0x43')](_0x31d4a7,function(_0x5d3ea1){if(_0x5d3ea1[_0xe524('0x34')]!==_0xe524('0x44')){var _0x2e4a13={};_0x2e4a13[_0x5d3ea1['name']]={'$like':'%'+_0x4a4e15[_0xe524('0x36')]['filter']+'%'};return _0x2e4a13;}})});}_0x20688e=_[_0xe524('0x42')]({},_0x20688e,_0x4a4e15[_0xe524('0x45')]);var _0x43c314={'where':_0x20688e[_0xe524('0x40')]};return db[_0xe524('0x32')][_0xe524('0x1f')](_0x43c314)[_0xe524('0x27')](function(_0x52cd0e){_0x5b2fc3[_0xe524('0x1f')]=_0x52cd0e;if(_0x4a4e15[_0xe524('0x36')][_0xe524('0x46')]){_0x20688e[_0xe524('0x47')]=[{'all':!![]}];}return db[_0xe524('0x32')][_0xe524('0x48')](_0x20688e);})['then'](function(_0xb694b9){_0x5b2fc3[_0xe524('0x49')]=_0xb694b9;return _0x5b2fc3;})[_0xe524('0x27')](respondWithFilteredResult(_0x5b7ded,_0x20688e))['catch'](handleError(_0x5b7ded,null));};exports[_0xe524('0x4a')]=function(_0x5209dc,_0x4e5d99){var _0x2b9b3b={'raw':!![],'where':{'id':_0x5209dc['params']['id']}},_0x33906d={};_0x33906d[_0xe524('0x35')]=_[_0xe524('0x37')](db[_0xe524('0x32')][_0xe524('0x4b')]);_0x33906d['query']=_['keys'](_0x5209dc[_0xe524('0x36')]);_0x33906d[_0xe524('0x38')]=_['intersection'](_0x33906d[_0xe524('0x35')],_0x33906d['query']);_0x2b9b3b[_0xe524('0x3a')]=_[_0xe524('0x39')](_0x33906d[_0xe524('0x35')],qs[_0xe524('0x3b')](_0x5209dc[_0xe524('0x36')][_0xe524('0x3b')]));_0x2b9b3b[_0xe524('0x3a')]=_0x2b9b3b[_0xe524('0x3a')][_0xe524('0x3c')]?_0x2b9b3b[_0xe524('0x3a')]:_0x33906d[_0xe524('0x35')];if(_0x5209dc[_0xe524('0x36')][_0xe524('0x46')]){_0x2b9b3b[_0xe524('0x47')]=[{'all':!![]}];}_0x2b9b3b=_[_0xe524('0x42')]({},_0x2b9b3b,_0x5209dc['options']);return db[_0xe524('0x32')]['find'](_0x2b9b3b)['then'](handleEntityNotFound(_0x4e5d99,null))[_0xe524('0x27')](respondWithResult(_0x4e5d99,null))['catch'](handleError(_0x4e5d99,null));};exports[_0xe524('0x4c')]=function(_0x15d7ee,_0x561107){return db[_0xe524('0x32')]['create'](_0x15d7ee['body'],{})[_0xe524('0x27')](function(_0x1e5687){var _0x203e71=_0x15d7ee['user']['get']({'plain':!![]});if(!_0x203e71)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x203e71['role']==='user'){var _0x5477ca=_0x1e5687[_0xe524('0x29')]({'plain':!![]});var _0x2ce5c0='Reports';return db[_0xe524('0x4d')][_0xe524('0x4e')]({'where':{'name':_0x2ce5c0,'userProfileId':_0x203e71[_0xe524('0x4f')]},'raw':!![]})[_0xe524('0x27')](function(_0x2fa143){if(_0x2fa143&&_0x2fa143['autoAssociation']===0x0){return db[_0xe524('0x2b')][_0xe524('0x4c')]({'name':_0x5477ca[_0xe524('0x2f')],'resourceId':_0x5477ca['id'],'type':'DefaultReports','sectionId':_0x2fa143['id']},{})[_0xe524('0x27')](function(){return _0x1e5687;});}else{return _0x1e5687;}})['catch'](function(_0x12e5d0){logger[_0xe524('0x2d')](_0xe524('0x50'),_0x12e5d0);throw _0x12e5d0;});}return _0x1e5687;})[_0xe524('0x27')](respondWithResult(_0x561107,0xc9))[_0xe524('0x51')](handleError(_0x561107,null));};exports[_0xe524('0x52')]=function(_0x1cec31,_0x374450){if(_0x1cec31[_0xe524('0x53')]['id']){delete _0x1cec31[_0xe524('0x53')]['id'];}return db[_0xe524('0x32')][_0xe524('0x4e')]({'where':{'id':_0x1cec31['params']['id']}})['then'](handleEntityNotFound(_0x374450,null))['then'](saveUpdates(_0x1cec31[_0xe524('0x53')],null))[_0xe524('0x27')](respondWithResult(_0x374450,null))[_0xe524('0x51')](handleError(_0x374450,null));};exports[_0xe524('0x28')]=function(_0x45fb0d,_0xef3d2f){return db[_0xe524('0x32')][_0xe524('0x4e')]({'where':{'id':_0x45fb0d[_0xe524('0x54')]['id']}})[_0xe524('0x27')](handleEntityNotFound(_0xef3d2f,null))[_0xe524('0x27')](removeEntity(_0xef3d2f,null))['catch'](handleError(_0xef3d2f,null));};exports[_0xe524('0x55')]=function(_0x1f0567,_0x4a5f4a){var _0x53da86=0xa;var _0x54adbd=['join',_0xe524('0x56'),_0xe524('0x57'),_0xe524('0x58')];var _0x8a2c00={'SUM':'SUM(%s)','COUNT':_0xe524('0x59'),'COUNT DISTINCT':_0xe524('0x5a'),'MAX':_0xe524('0x5b'),'MIN':_0xe524('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xe524('0x5d')};var _0x582fbb={'SEC_TO_TIME':_0xe524('0x5e'),'DATE':_0xe524('0x5f'),'HOUR':_0xe524('0x60'),'ROUND':_0xe524('0x61'),'UNIX_TIMESTAMP':_0xe524('0x62')};var _0x4f58ff=function(_0x5d0507){return!_[_0xe524('0x63')]([_0xe524('0x64'),_0xe524('0x65'),_0xe524('0x66'),_0xe524('0x67')],_0x5d0507);};var _0x474ed4=function(_0x5135f0){if(!_0x5135f0||!_0x5135f0[_0xe524('0x68')][_0xe524('0x3c')]){return'';}for(var _0xc3ccfd='(',_0x5d3b9c=0x0;_0x5d3b9c<_0x5135f0[_0xe524('0x68')][_0xe524('0x3c')];_0x5d3b9c+=0x1){_0x5d3b9c>0x0&&(_0xc3ccfd+='\x20'+_0x5135f0[_0xe524('0x69')]+'\x20');_0xc3ccfd+=_0x5135f0['rules'][_0x5d3b9c]['group']?_0x474ed4(_0x5135f0[_0xe524('0x68')][_0x5d3b9c][_0xe524('0x6a')]):_0x5135f0[_0xe524('0x68')][_0x5d3b9c][_0xe524('0x6b')]+'\x20'+_0x5135f0[_0xe524('0x68')][_0x5d3b9c]['condition']+(_0x4f58ff(_0x5135f0[_0xe524('0x68')][_0x5d3b9c][_0xe524('0x6c')])?'\x20'+_0x5135f0[_0xe524('0x68')][_0x5d3b9c][_0xe524('0x6d')]:'');}return _0xc3ccfd+')';};var _0x3ce098={'where':{'id':_0x1f0567[_0xe524('0x54')]['id']}},_0x22d06a,_0x35e6b2,_0x1e4b32,_0x27c55c,_0x7e5992;_0x3ce098=_['merge']({},_0x3ce098,_0x1f0567[_0xe524('0x45')]);return db[_0xe524('0x32')][_0xe524('0x4e')](_0x3ce098)[_0xe524('0x27')](function(_0xeec885){if(_0xeec885){_0x22d06a=_0xeec885;return _0xeec885['getFields']();}return null;})[_0xe524('0x27')](function(_0x2341cf){if(_0x2341cf){if(!_0x2341cf[_0xe524('0x3c')]){throw new db[(_0xe524('0x6e'))][(_0xe524('0x6f'))](_0xe524('0x70'),0x193);}_0x35e6b2=_0x2341cf;return db[_0xe524('0x71')]['findAll']({'raw':!![]});}return null;})[_0xe524('0x27')](function(_0x245501){if(_0x245501){_0x1e4b32=_[_0xe524('0x72')](_0x245501,'id');var _0xce15f5;var _0x5ec07c=squel[_0xe524('0x73')]();_0x5ec07c['from'](_0x22d06a[_0xe524('0x74')]);for(var _0x2a88e2=0x0;_0x2a88e2<_0x35e6b2[_0xe524('0x3c')];_0x2a88e2+=0x1){_0xce15f5=_0x35e6b2[_0x2a88e2]['MetricId']?_0x1e4b32[_0x35e6b2[_0x2a88e2][_0xe524('0x75')]][_0xe524('0x76')]:_0x35e6b2[_0x2a88e2][_0xe524('0x6b')];_0xce15f5=_0x35e6b2[_0x2a88e2][_0xe524('0x77')]?_[_0xe524('0x78')](_0x8a2c00[_0x35e6b2[_0x2a88e2]['function']],'%s',_0xce15f5):_0xce15f5;_0xce15f5=_0x35e6b2[_0x2a88e2][_0xe524('0x79')]?_[_0xe524('0x78')](_0x582fbb[_0x35e6b2[_0x2a88e2][_0xe524('0x79')]],'%s',_0xce15f5):_0xce15f5;if(_0x35e6b2[_0x2a88e2][_0xe524('0x7a')]){_0x5ec07c[_0xe524('0x6a')](_0xce15f5);}_0x35e6b2[_0x2a88e2]['orderBy']&&_0x5ec07c[_0xe524('0x3e')](_0xce15f5,_0x35e6b2[_0x2a88e2][_0xe524('0x7b')]===_0xe524('0x7c')?![]:!![]);_0x5ec07c[_0xe524('0x6b')](_0xce15f5,_0x35e6b2[_0x2a88e2][_0xe524('0x7d')]||_0xce15f5);}if(_0x22d06a[_0xe524('0x7e')]){_0x22d06a['joins']=JSON[_0xe524('0x7f')](_0x22d06a[_0xe524('0x7e')]);for(var _0x1beaa2=0x0;_0x1beaa2<_0x22d06a['joins'][_0xe524('0x3c')];_0x1beaa2+=0x1){if(_0x22d06a[_0xe524('0x7e')][_0x1beaa2]['type']&&_[_0xe524('0x63')](_0x54adbd,_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x34')])&&_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x80')]&&_0x22d06a[_0xe524('0x7e')][_0x1beaa2]['foreignTable']&&_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x81')]){_0x5ec07c[_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x34')]](_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x82')],null,util[_0xe524('0x79')](_0xe524('0x83'),_0x22d06a[_0xe524('0x74')],_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x80')],_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x82')],_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x81')]));}}}if(_0x22d06a['conditions']){_0x22d06a[_0xe524('0x84')]=JSON[_0xe524('0x7f')](_0x22d06a[_0xe524('0x84')]);_0x5ec07c['where'](_0x474ed4(_0x22d06a[_0xe524('0x84')][_0xe524('0x6a')]));}_0x7e5992=_0x5ec07c['clone']();_0x5ec07c['limit'](_0x53da86);_0x5ec07c[_0xe524('0x1e')](0x0);logger['debug'](_0xe524('0x85'),_0x5ec07c['toString']());return dbH[_0xe524('0x86')][_0xe524('0x36')](_0x5ec07c[_0xe524('0x87')](),{'type':dbH[_0xe524('0x86')]['QueryTypes']['SELECT']});}})[_0xe524('0x27')](respondWithResult(_0x4a5f4a,null))[_0xe524('0x51')](handleError(_0x4a5f4a,null));};function runReport(_0x50eb96,_0x45c287,_0x449842){var _0x1f3ed1=_0x45c287['name'];var _0x19b063=0xa;var _0x140a4e=[_0xe524('0x88'),_0xe524('0x56'),_0xe524('0x57'),_0xe524('0x58')];var _0x54385f={'SUM':'SUM(%s)','COUNT':_0xe524('0x59'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xe524('0x5b'),'MIN':_0xe524('0x5c'),'AVG':_0xe524('0x89'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xe524('0x8a'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x1681c5={'SEC_TO_TIME':_0xe524('0x5e'),'DATE':_0xe524('0x5f'),'HOUR':_0xe524('0x60'),'ROUND':_0xe524('0x61'),'UNIX_TIMESTAMP':_0xe524('0x62')};var _0x50f5e3=function(_0x11298c){return!_[_0xe524('0x63')]([_0xe524('0x64'),'IS\x20NOT\x20NULL',_0xe524('0x66'),_0xe524('0x67')],_0x11298c);};var _0x5603d0=function(_0x2712ac){if(!_0x2712ac||!_0x2712ac[_0xe524('0x68')][_0xe524('0x3c')]){return'';}for(var _0x32c9f6='(',_0x58d29e=0x0;_0x58d29e<_0x2712ac[_0xe524('0x68')][_0xe524('0x3c')];_0x58d29e+=0x1){_0x58d29e>0x0&&(_0x32c9f6+='\x20'+_0x2712ac[_0xe524('0x69')]+'\x20');_0x32c9f6+=_0x2712ac['rules'][_0x58d29e][_0xe524('0x6a')]?_0x5603d0(_0x2712ac['rules'][_0x58d29e][_0xe524('0x6a')]):_0x2712ac[_0xe524('0x68')][_0x58d29e][_0xe524('0x6b')]+'\x20'+_0x2712ac['rules'][_0x58d29e][_0xe524('0x6c')]+(_0x50f5e3(_0x2712ac[_0xe524('0x68')][_0x58d29e][_0xe524('0x6c')])?'\x20'+_0x2712ac['rules'][_0x58d29e]['value']:'');}return _0x32c9f6+')';};var _0x334164={'where':{'id':_0x50eb96['id']}},_0x512572,_0x903e24,_0x4964c3,_0x2dc3f5,_0x246c62;_0x334164=_['merge']({},_0x334164,_0x449842);return db[_0xe524('0x32')][_0xe524('0x4e')](_0x334164)['then'](function(_0x482b72){if(_0x482b72){_0x512572=_0x482b72;return _0x482b72[_0xe524('0x8b')]();}return null;})[_0xe524('0x27')](function(_0x1b3e03){if(_0x1b3e03){if(!_0x1b3e03['length']){throw new db[(_0xe524('0x6e'))][(_0xe524('0x6f'))](_0xe524('0x70'),0x193);}_0x903e24=_0x1b3e03;return db[_0xe524('0x71')][_0xe524('0x48')]({'raw':!![]});}return null;})[_0xe524('0x27')](function(_0x57501c){if(_0x57501c){_0x4964c3=_[_0xe524('0x72')](_0x57501c,'id');var _0x3a2834;var _0x4c7f45=squel['select']();_0x4c7f45[_0xe524('0x8c')](_0x512572[_0xe524('0x74')]);for(var _0x41f842=0x0;_0x41f842<_0x903e24[_0xe524('0x3c')];_0x41f842+=0x1){_0x3a2834=_0x903e24[_0x41f842]['MetricId']?_0x4964c3[_0x903e24[_0x41f842][_0xe524('0x75')]][_0xe524('0x76')]:_0x903e24[_0x41f842]['field'];_0x3a2834=_0x903e24[_0x41f842]['function']?_[_0xe524('0x78')](_0x54385f[_0x903e24[_0x41f842][_0xe524('0x77')]],'%s',_0x3a2834):_0x3a2834;_0x3a2834=_0x903e24[_0x41f842][_0xe524('0x79')]?_[_0xe524('0x78')](_0x1681c5[_0x903e24[_0x41f842][_0xe524('0x79')]],'%s',_0x3a2834):_0x3a2834;if(_0x903e24[_0x41f842][_0xe524('0x7a')]){_0x4c7f45['group'](_0x3a2834);}_0x903e24[_0x41f842]['orderBy']&&_0x4c7f45[_0xe524('0x3e')](_0x3a2834,_0x903e24[_0x41f842][_0xe524('0x7b')]==='DESC'?![]:!![]);_0x4c7f45['field'](_0x3a2834,_0x903e24[_0x41f842][_0xe524('0x7d')]||_0x3a2834);}if(_0x512572[_0xe524('0x7e')]){_0x512572[_0xe524('0x7e')]=JSON[_0xe524('0x7f')](_0x512572[_0xe524('0x7e')]);for(var _0xa820a1=0x0;_0xa820a1<_0x512572['joins']['length'];_0xa820a1+=0x1){if(_0x512572[_0xe524('0x7e')][_0xa820a1][_0xe524('0x34')]&&_[_0xe524('0x63')](_0x140a4e,_0x512572[_0xe524('0x7e')][_0xa820a1][_0xe524('0x34')])&&_0x512572[_0xe524('0x7e')][_0xa820a1][_0xe524('0x80')]&&_0x512572[_0xe524('0x7e')][_0xa820a1]['foreignTable']&&_0x512572[_0xe524('0x7e')][_0xa820a1][_0xe524('0x81')]){_0x4c7f45[_0x512572[_0xe524('0x7e')][_0xa820a1]['type']](_0x512572['joins'][_0xa820a1][_0xe524('0x82')],null,util[_0xe524('0x79')](_0xe524('0x83'),_0x512572[_0xe524('0x74')],_0x512572['joins'][_0xa820a1][_0xe524('0x80')],_0x512572[_0xe524('0x7e')][_0xa820a1][_0xe524('0x82')],_0x512572[_0xe524('0x7e')][_0xa820a1][_0xe524('0x81')]));}}}if(_0x512572['conditions']){_0x512572[_0xe524('0x84')]=JSON['parse'](_0x512572[_0xe524('0x84')]);_0x4c7f45[_0xe524('0x40')](_0x5603d0(_0x512572['conditions'][_0xe524('0x6a')]));}_0x246c62=_0x4c7f45[_0xe524('0x8d')]();_0x4c7f45['limit'](_0x19b063);_0x4c7f45[_0xe524('0x1e')](0x0);return;}})['then'](function(){if(_0x45c287[_0xe524('0x8e')]===_0xe524('0x8f')){return null;}var _0x1be681=_[_0xe524('0x42')](_0x45c287,{'name':_0x45c287[_0xe524('0x90')]||_0x45c287[_0xe524('0x2f')]||_0x512572[_0xe524('0x2f')],'basename':_0x1f3ed1,'savename':util[_0xe524('0x79')]('%s-%s.%s',_0x45c287[_0xe524('0x2f')]||_0x512572['name'],require('randomstring')[_0xe524('0x91')](0x4),_0x45c287['output']||_0xe524('0x92')),'reportId':_0x512572['id'],'reportType':_0xe524('0x93')});return db[_0xe524('0x94')][_0xe524('0x4c')](_0x1be681,{'raw':!![]});})[_0xe524('0x27')](function(_0x26c802){if(_0x512572['table']==='cdr'){_0x246c62[_0xe524('0x40')](_0x512572[_0xe524('0x74')]+_0xe524('0x95'),_0x45c287[_0xe524('0x96')],_0x45c287[_0xe524('0x97')]);}else{_0x246c62[_0xe524('0x40')](_0x512572[_0xe524('0x74')]+_0xe524('0x98'),_0x45c287[_0xe524('0x96')],_0x45c287[_0xe524('0x97')]);}if(_0x26c802){logger['info'](_0xe524('0x99'),_0x246c62[_0xe524('0x87')]());require(_0xe524('0x9a'))[_0xe524('0x9b')](path[_0xe524('0x88')](__dirname,_0xe524('0x9c'),_0x26c802['output']),[_0x26c802['id'],_0x246c62[_0xe524('0x87')](),path[_0xe524('0x88')](__dirname,_0xe524('0x9d'),_0x26c802[_0xe524('0x9e')]),_0x1f3ed1]);return _0x26c802;}else{var _0x84bbd7=squel[_0xe524('0x73')]();_0x84bbd7[_0xe524('0x8c')]('('+_0x246c62[_0xe524('0x87')]()+')','countTable');_0x84bbd7['field']('COUNT(*)',_0xe524('0x1f'));_0x246c62[_0xe524('0x20')](_0x45c287['limit']||_0x19b063);_0x246c62[_0xe524('0x1e')](_0x45c287[_0xe524('0x1e')]||0x0);return dbH['sequelize'][_0xe524('0x36')](_0x84bbd7[_0xe524('0x87')](),{'type':dbH['sequelize'][_0xe524('0x9f')][_0xe524('0xa0')]})[_0xe524('0x27')](function(_0x542182){if(!_0x542182[_0xe524('0x3c')]){_0x2dc3f5=0x0;}else{_0x2dc3f5=_0x542182[0x0][_0xe524('0x1f')]||0x0;}return dbH[_0xe524('0x86')]['query'](_0x246c62[_0xe524('0x87')](),{'type':dbH[_0xe524('0x86')][_0xe524('0x9f')][_0xe524('0xa0')]});})['then'](function(_0x5e6a3d){return{'rows':_0x5e6a3d||[],'count':_0x2dc3f5};});}});}exports[_0xe524('0xa1')]=function(_0x33d066,_0x3ea495){return runReport(_0x33d066[_0xe524('0x54')],_0x33d066[_0xe524('0x36')],_0x33d066[_0xe524('0x45')])[_0xe524('0x27')](respondWithResult(_0x3ea495,null))[_0xe524('0x51')](handleError(_0x3ea495,null));};exports[_0xe524('0xa2')]=runReport;exports[_0xe524('0x36')]=function(_0x4505de,_0x292f14){var _0x2d24c1=0xa;var _0x483307=[_0xe524('0x88'),_0xe524('0x56'),_0xe524('0x57'),_0xe524('0x58')];var _0x280022={'SUM':_0xe524('0xa3'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xe524('0x5b'),'MIN':'MIN(%s)','AVG':_0xe524('0x89'),'GROUP_CONCAT':_0xe524('0xa4'),'GROUP_CONCAT ASC':_0xe524('0x8a'),'GROUP_CONCAT DESC':_0xe524('0x5d')};var _0x46d6da={'SEC_TO_TIME':_0xe524('0x5e'),'DATE':_0xe524('0x5f'),'HOUR':'HOUR(%s)','ROUND':_0xe524('0x61'),'UNIX_TIMESTAMP':_0xe524('0x62')};var _0x39998a=function(_0x107de8){return!_['includes']([_0xe524('0x64'),_0xe524('0x65'),'IS\x20EMPTY',_0xe524('0x67')],_0x107de8);};var _0x458e14=function(_0x4e0886){if(!_0x4e0886||!_0x4e0886['rules'][_0xe524('0x3c')]){return'';}for(var _0x3639cf='(',_0x575c14=0x0;_0x575c14<_0x4e0886['rules'][_0xe524('0x3c')];_0x575c14+=0x1){_0x575c14>0x0&&(_0x3639cf+='\x20'+_0x4e0886['operator']+'\x20');_0x3639cf+=_0x4e0886['rules'][_0x575c14]['group']?_0x458e14(_0x4e0886[_0xe524('0x68')][_0x575c14][_0xe524('0x6a')]):_0x4e0886[_0xe524('0x68')][_0x575c14][_0xe524('0x6b')]+'\x20'+_0x4e0886['rules'][_0x575c14]['condition']+(_0x39998a(_0x4e0886['rules'][_0x575c14][_0xe524('0x6c')])?'\x20'+_0x4e0886[_0xe524('0x68')][_0x575c14][_0xe524('0x6d')]:'');}return _0x3639cf+')';};var _0x289720={'where':{'id':_0x4505de[_0xe524('0x54')]['id']}},_0x3fb45c,_0x3362fe,_0x119684,_0x19e4fd,_0x4b4349;_0x289720=_[_0xe524('0x42')]({},_0x289720,_0x4505de[_0xe524('0x45')]);return db[_0xe524('0x32')][_0xe524('0x4e')](_0x289720)[_0xe524('0x27')](function(_0x404a49){if(_0x404a49){_0x3fb45c=_0x404a49;return _0x404a49[_0xe524('0x8b')]();}return null;})[_0xe524('0x27')](function(_0x8e8087){if(_0x8e8087){if(!_0x8e8087['length']){throw new db[(_0xe524('0x6e'))][(_0xe524('0x6f'))](_0xe524('0x70'),0x193);}_0x3362fe=_0x8e8087;return db[_0xe524('0x71')][_0xe524('0x48')]({'raw':!![]});}return null;})[_0xe524('0x27')](function(_0x113a54){if(_0x113a54){_0x119684=_[_0xe524('0x72')](_0x113a54,'id');var _0x4ebca4;var _0x40043c=squel[_0xe524('0x73')]();_0x40043c[_0xe524('0x8c')](_0x3fb45c[_0xe524('0x74')]);for(var _0x19a773=0x0;_0x19a773<_0x3362fe[_0xe524('0x3c')];_0x19a773+=0x1){_0x4ebca4=_0x3362fe[_0x19a773][_0xe524('0x75')]?_0x119684[_0x3362fe[_0x19a773][_0xe524('0x75')]][_0xe524('0x76')]:_0x3362fe[_0x19a773][_0xe524('0x6b')];_0x4ebca4=_0x3362fe[_0x19a773][_0xe524('0x77')]?_[_0xe524('0x78')](_0x280022[_0x3362fe[_0x19a773]['function']],'%s',_0x4ebca4):_0x4ebca4;_0x4ebca4=_0x3362fe[_0x19a773][_0xe524('0x79')]?_[_0xe524('0x78')](_0x46d6da[_0x3362fe[_0x19a773][_0xe524('0x79')]],'%s',_0x4ebca4):_0x4ebca4;if(_0x3362fe[_0x19a773]['groupBy']){_0x40043c['group'](_0x4ebca4);}_0x3362fe[_0x19a773][_0xe524('0x7b')]&&_0x40043c[_0xe524('0x3e')](_0x4ebca4,_0x3362fe[_0x19a773][_0xe524('0x7b')]==='DESC'?![]:!![]);_0x40043c[_0xe524('0x6b')](_0x4ebca4,_0x3362fe[_0x19a773][_0xe524('0x7d')]||_0x4ebca4);}if(_0x3fb45c[_0xe524('0x7e')]){_0x3fb45c['joins']=JSON['parse'](_0x3fb45c[_0xe524('0x7e')]);for(var _0x2a85e5=0x0;_0x2a85e5<_0x3fb45c[_0xe524('0x7e')]['length'];_0x2a85e5+=0x1){if(_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x34')]&&_[_0xe524('0x63')](_0x483307,_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x34')])&&_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x80')]&&_0x3fb45c['joins'][_0x2a85e5][_0xe524('0x82')]&&_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x81')]){_0x40043c[_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x34')]](_0x3fb45c['joins'][_0x2a85e5][_0xe524('0x82')],null,util[_0xe524('0x79')]('%s.%s\x20=\x20%s.%s',_0x3fb45c[_0xe524('0x74')],_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x80')],_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x82')],_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x81')]));}}}if(_0x3fb45c[_0xe524('0x84')]){_0x3fb45c[_0xe524('0x84')]=JSON['parse'](_0x3fb45c['conditions']);_0x40043c[_0xe524('0x40')](_0x458e14(_0x3fb45c[_0xe524('0x84')][_0xe524('0x6a')]));}_0x4b4349=_0x40043c[_0xe524('0x8d')]();_0x40043c[_0xe524('0x20')](_0x2d24c1);_0x40043c[_0xe524('0x1e')](0x0);logger[_0xe524('0xa5')]('Limited\x20Query:',_0x40043c['toString']());return dbH[_0xe524('0x86')]['query'](_0x40043c['toString'](),{'type':dbH[_0xe524('0x86')][_0xe524('0x9f')][_0xe524('0xa0')]});}})[_0xe524('0x27')](function(){return{'sql':_0x4b4349[_0xe524('0x87')]()};})[_0xe524('0x27')](respondWithResult(_0x292f14,null))['catch'](handleError(_0x292f14,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 845c6df..ab10e81 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 _0x01b7=['./analyticDefaultReport.attributes','analytics_default_reports','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3810f6,_0x41f38f){var _0x442125=function(_0x394205){while(--_0x394205){_0x3810f6['push'](_0x3810f6['shift']());}};_0x442125(++_0x41f38f);}(_0x01b7,0x1a6));var _0x701b=function(_0x416cce,_0x448c29){_0x416cce=_0x416cce-0x0;var _0x2791c0=_0x01b7[_0x416cce];return _0x2791c0;};'use strict';var _=require(_0x701b('0x0'));var util=require(_0x701b('0x1'));var logger=require('../../config/logger')(_0x701b('0x2'));var moment=require('moment');var BPromise=require(_0x701b('0x3'));var rp=require(_0x701b('0x4'));var fs=require('fs');var path=require(_0x701b('0x5'));var rimraf=require(_0x701b('0x6'));var config=require(_0x701b('0x7'));var attributes=require(_0x701b('0x8'));module['exports']=function(_0x50b85b,_0x11999e){return _0x50b85b['define']('AnalyticDefaultReport',attributes,{'tableName':_0x701b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1ee3=['./analyticDefaultReport.attributes','define','analytics_default_reports','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0xa1de8d,_0x1399a8){var _0x478b44=function(_0x3c8db7){while(--_0x3c8db7){_0xa1de8d['push'](_0xa1de8d['shift']());}};_0x478b44(++_0x1399a8);}(_0x1ee3,0x7b));var _0x31ee=function(_0x182416,_0x5874bc){_0x182416=_0x182416-0x0;var _0x5b4e3d=_0x1ee3[_0x182416];return _0x5b4e3d;};'use strict';var _=require(_0x31ee('0x0'));var util=require(_0x31ee('0x1'));var logger=require(_0x31ee('0x2'))(_0x31ee('0x3'));var moment=require(_0x31ee('0x4'));var BPromise=require(_0x31ee('0x5'));var rp=require(_0x31ee('0x6'));var fs=require('fs');var path=require(_0x31ee('0x7'));var rimraf=require('rimraf');var config=require(_0x31ee('0x8'));var attributes=require(_0x31ee('0x9'));module['exports']=function(_0x593e71,_0x3cd80c){return _0x593e71[_0x31ee('0xa')]('AnalyticDefaultReport',attributes,{'tableName':_0x31ee('0xb'),'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 aa134e2..3edccbc 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 _0x3a0f=['error','code','message','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0x3a0f,0x97));var _0xf3a0=function(_0x6e4967,_0x23eca8){_0x6e4967=_0x6e4967-0x0;var _0x59f0c4=_0x3a0f[_0x6e4967];return _0x59f0c4;};'use strict';var _=require('lodash');var util=require(_0xf3a0('0x0'));var moment=require(_0xf3a0('0x1'));var BPromise=require('bluebird');var rs=require(_0xf3a0('0x2'));var fs=require('fs');var Redis=require(_0xf3a0('0x3'));var db=require(_0xf3a0('0x4'))['db'];var utils=require(_0xf3a0('0x5'));var logger=require(_0xf3a0('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf3a0('0x7'));var client=jayson[_0xf3a0('0x8')][_0xf3a0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5992fd,_0x997be3,_0x4753c6){return new BPromise(function(_0x5a479e,_0x489fe9){return client['request'](_0x5992fd,_0x4753c6)[_0xf3a0('0xa')](function(_0x3de122){logger[_0xf3a0('0xb')](_0xf3a0('0xc'),_0x997be3,_0xf3a0('0xd'));logger[_0xf3a0('0xe')](_0xf3a0('0xf'),_0x997be3,_0xf3a0('0xd'),JSON[_0xf3a0('0x10')](_0x3de122));if(_0x3de122[_0xf3a0('0x11')]){if(_0x3de122[_0xf3a0('0x11')][_0xf3a0('0x12')]===0x1f4){logger[_0xf3a0('0x11')](_0xf3a0('0xc'),_0x997be3,_0x3de122[_0xf3a0('0x11')][_0xf3a0('0x13')]);return _0x489fe9(_0x3de122[_0xf3a0('0x11')][_0xf3a0('0x13')]);}logger[_0xf3a0('0x11')](_0xf3a0('0xc'),_0x997be3,_0x3de122[_0xf3a0('0x11')][_0xf3a0('0x13')]);return _0x5a479e(_0x3de122[_0xf3a0('0x11')][_0xf3a0('0x13')]);}else{logger['info'](_0xf3a0('0xc'),_0x997be3,'request\x20sent');_0x5a479e(_0x3de122['result']['message']);}})[_0xf3a0('0x14')](function(_0x31ae5c){logger[_0xf3a0('0x11')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x997be3,_0x31ae5c);_0x489fe9(_0x31ae5c);});});} \ No newline at end of file +var _0x60dc=['stringify','code','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s'];(function(_0xeca67,_0x2f5be0){var _0x1c55a9=function(_0x56963d){while(--_0x56963d){_0xeca67['push'](_0xeca67['shift']());}};_0x1c55a9(++_0x2f5be0);}(_0x60dc,0x1d3));var _0xc60d=function(_0x3c7764,_0x31a70a){_0x3c7764=_0x3c7764-0x0;var _0x392aa9=_0x60dc[_0x3c7764];return _0x392aa9;};'use strict';var _=require(_0xc60d('0x0'));var util=require(_0xc60d('0x1'));var moment=require(_0xc60d('0x2'));var BPromise=require(_0xc60d('0x3'));var rs=require(_0xc60d('0x4'));var fs=require('fs');var Redis=require(_0xc60d('0x5'));var db=require(_0xc60d('0x6'))['db'];var utils=require(_0xc60d('0x7'));var logger=require('../../config/logger')(_0xc60d('0x8'));var config=require('../../config/environment');var jayson=require(_0xc60d('0x9'));var client=jayson[_0xc60d('0xa')][_0xc60d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5264a6,_0x4bca55,_0xe50876){return new BPromise(function(_0x535830,_0x3db2c6){return client[_0xc60d('0xc')](_0x5264a6,_0xe50876)['then'](function(_0x24abb3){logger['info'](_0xc60d('0xd'),_0x4bca55,_0xc60d('0xe'));logger['debug'](_0xc60d('0xf'),_0x4bca55,_0xc60d('0xe'),JSON[_0xc60d('0x10')](_0x24abb3));if(_0x24abb3['error']){if(_0x24abb3['error'][_0xc60d('0x11')]===0x1f4){logger[_0xc60d('0x12')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x4bca55,_0x24abb3[_0xc60d('0x12')][_0xc60d('0x13')]);return _0x3db2c6(_0x24abb3[_0xc60d('0x12')][_0xc60d('0x13')]);}logger[_0xc60d('0x12')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x4bca55,_0x24abb3['error'][_0xc60d('0x13')]);return _0x535830(_0x24abb3[_0xc60d('0x12')][_0xc60d('0x13')]);}else{logger[_0xc60d('0x14')](_0xc60d('0xd'),_0x4bca55,'request\x20sent');_0x535830(_0x24abb3[_0xc60d('0x15')][_0xc60d('0x13')]);}})[_0xc60d('0x16')](function(_0x1cbeae){logger['error'](_0xc60d('0xd'),_0x4bca55,_0x1cbeae);_0x3db2c6(_0x1cbeae);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index d8131f5..2461510 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 _0x6fcd=['/:id/run','run','get','/:id/query','query','post','create','put','update','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','isAuthenticated','/:id','show','/:id/preview','preview'];(function(_0x197da8,_0x2ae40d){var _0x2afecf=function(_0x42f7eb){while(--_0x42f7eb){_0x197da8['push'](_0x197da8['shift']());}};_0x2afecf(++_0x2ae40d);}(_0x6fcd,0x19b));var _0xd6fc=function(_0x4fbfd9,_0x3ab91a){_0x4fbfd9=_0x4fbfd9-0x0;var _0x31dc94=_0x6fcd[_0x4fbfd9];return _0x31dc94;};'use strict';var multer=require(_0xd6fc('0x0'));var util=require(_0xd6fc('0x1'));var path=require('path');var timeout=require(_0xd6fc('0x2'));var express=require(_0xd6fc('0x3'));var router=express[_0xd6fc('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd6fc('0x5'));var interaction=require(_0xd6fc('0x6'));var config=require(_0xd6fc('0x7'));var controller=require(_0xd6fc('0x8'));router['get']('/',auth[_0xd6fc('0x9')](),controller['index']);router['get'](_0xd6fc('0xa'),auth['isAuthenticated'](),controller[_0xd6fc('0xb')]);router['get'](_0xd6fc('0xc'),auth[_0xd6fc('0x9')](),controller[_0xd6fc('0xd')]);router['get'](_0xd6fc('0xe'),auth[_0xd6fc('0x9')](),controller[_0xd6fc('0xf')]);router[_0xd6fc('0x10')](_0xd6fc('0x11'),auth[_0xd6fc('0x9')](),controller[_0xd6fc('0x12')]);router[_0xd6fc('0x13')]('/',auth[_0xd6fc('0x9')](),controller[_0xd6fc('0x14')]);router[_0xd6fc('0x15')]('/:id',auth[_0xd6fc('0x9')](),controller[_0xd6fc('0x16')]);router['delete'](_0xd6fc('0xa'),auth[_0xd6fc('0x9')](),controller[_0xd6fc('0x17')]);module[_0xd6fc('0x18')]=router; \ No newline at end of file +var _0x663a=['run','query','post','create','put','/:id','update','destroy','exports','multer','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','preview'];(function(_0x598a9c,_0x3588b8){var _0x40271b=function(_0x440c4b){while(--_0x440c4b){_0x598a9c['push'](_0x598a9c['shift']());}};_0x40271b(++_0x3588b8);}(_0x663a,0xf3));var _0xa663=function(_0x15cfd2,_0x5eb849){_0x15cfd2=_0x15cfd2-0x0;var _0x415e4f=_0x663a[_0x15cfd2];return _0x415e4f;};'use strict';var multer=require(_0xa663('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xa663('0x1'));var auth=require('../../components/auth/service');var interaction=require(_0xa663('0x2'));var config=require(_0xa663('0x3'));var controller=require('./analyticDefaultReport.controller');router[_0xa663('0x4')]('/',auth[_0xa663('0x5')](),controller[_0xa663('0x6')]);router[_0xa663('0x4')]('/:id',auth['isAuthenticated'](),controller[_0xa663('0x7')]);router[_0xa663('0x4')]('/:id/preview',auth[_0xa663('0x5')](),controller[_0xa663('0x8')]);router[_0xa663('0x4')]('/:id/run',auth[_0xa663('0x5')](),controller[_0xa663('0x9')]);router[_0xa663('0x4')]('/:id/query',auth[_0xa663('0x5')](),controller[_0xa663('0xa')]);router[_0xa663('0xb')]('/',auth[_0xa663('0x5')](),controller[_0xa663('0xc')]);router[_0xa663('0xd')](_0xa663('0xe'),auth['isAuthenticated'](),controller[_0xa663('0xf')]);router['delete'](_0xa663('0xe'),auth[_0xa663('0x5')](),controller[_0xa663('0x10')]);module[_0xa663('0x11')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index abb9d60..0736382 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 _0xc00c=['STRING','ENUM','csv','pdf','DATE','Loading','manual','UNSIGNED','sequelize','moment','exports'];(function(_0x2c935f,_0x4b4b23){var _0x342a98=function(_0x22dead){while(--_0x22dead){_0x2c935f['push'](_0x2c935f['shift']());}};_0x342a98(++_0x4b4b23);}(_0xc00c,0x194));var _0xcc00=function(_0x16d10f,_0x2ba2d5){_0x16d10f=_0x16d10f-0x0;var _0x50c823=_0xc00c[_0x16d10f];return _0x50c823;};'use strict';var Sequelize=require(_0xcc00('0x0'));var moment=require(_0xcc00('0x1'));module[_0xcc00('0x2')]={'name':{'type':Sequelize[_0xcc00('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0xcc00('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0xcc00('0x4')](_0xcc00('0x5'),_0xcc00('0x6'),'xlsx'),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0xcc00('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0xcc00('0x7')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0xcc00('0x3')],'defaultValue':_0xcc00('0x8')},'type':{'type':Sequelize['ENUM']('manual','scheduled'),'allowNull':![],'defaultValue':_0xcc00('0x9')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0xcc00('0xa')]},'reportType':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xed8e=['Loading','manual','scheduled','INTEGER','UNSIGNED','sequelize','moment','exports','csv','pdf','xlsx','STRING','DATE'];(function(_0x36cca2,_0x2cc811){var _0x2553a8=function(_0x383d0d){while(--_0x383d0d){_0x36cca2['push'](_0x36cca2['shift']());}};_0x2553a8(++_0x2cc811);}(_0xed8e,0x130));var _0xeed8=function(_0x4d49a7,_0x12efa2){_0x4d49a7=_0x4d49a7-0x0;var _0x1aa9c7=_0xed8e[_0x4d49a7];return _0x1aa9c7;};'use strict';var Sequelize=require(_0xeed8('0x0'));var moment=require(_0xeed8('0x1'));module[_0xeed8('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0xeed8('0x3'),_0xeed8('0x4'),_0xeed8('0x5')),'allowNull':![],'defaultValue':_0xeed8('0x3')},'savename':{'type':Sequelize[_0xeed8('0x6')],'allowNull':![]},'startDate':{'type':Sequelize[_0xeed8('0x7')]},'endDate':{'type':Sequelize[_0xeed8('0x7')]},'status':{'type':Sequelize[_0xeed8('0x6')],'defaultValue':_0xeed8('0x8')},'type':{'type':Sequelize['ENUM'](_0xeed8('0x9'),_0xeed8('0xa')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0xeed8('0xb')](0xb)[_0xeed8('0xc')]},'reportType':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 19a7858..658dc65 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 _0xf2c9=['rows','catch','show','options','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','savename','output','existsSync','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','download','format','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','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','../../config/license/util','../../mysqldb','sendStatus','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','get','ExtractedReports','UserProfileResource','destroy','end','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','includeAll','include','findAll'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xf2c9,0x80));var _0x9f2c=function(_0x3937b6,_0xd53d2b){_0x3937b6=_0x3937b6-0x0;var _0x1ba356=_0xf2c9[_0x3937b6];return _0x1ba356;};'use strict';var emlformat=require(_0x9f2c('0x0'));var rimraf=require(_0x9f2c('0x1'));var zipdir=require(_0x9f2c('0x2'));var jsonpatch=require(_0x9f2c('0x3'));var rp=require(_0x9f2c('0x4'));var moment=require(_0x9f2c('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x9f2c('0x6'));var util=require('util');var path=require(_0x9f2c('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x9f2c('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9f2c('0x9'));var squel=require(_0x9f2c('0xa'));var crypto=require(_0x9f2c('0xb'));var jsforce=require(_0x9f2c('0xc'));var deskjs=require(_0x9f2c('0xd'));var toCsv=require('to-csv');var querystring=require(_0x9f2c('0xe'));var Papa=require(_0x9f2c('0xf'));var Redis=require(_0x9f2c('0x10'));var authService=require(_0x9f2c('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x9f2c('0x12'));var hardwareService=require(_0x9f2c('0x13'));var logger=require(_0x9f2c('0x14'))(_0x9f2c('0x15'));var utils=require(_0x9f2c('0x16'));var config=require(_0x9f2c('0x17'));var licenseUtil=require(_0x9f2c('0x18'));var db=require(_0x9f2c('0x19'))['db'];function respondWithStatusCode(_0x102024,_0x216976){_0x216976=_0x216976||0xcc;return function(_0x29a30d){if(_0x29a30d){return _0x102024[_0x9f2c('0x1a')](_0x216976);}return _0x102024['status'](_0x216976)['end']();};}function respondWithResult(_0x42c327,_0x1354ab){_0x1354ab=_0x1354ab||0xc8;return function(_0x58e411){if(_0x58e411){return _0x42c327[_0x9f2c('0x1b')](_0x1354ab)['json'](_0x58e411);}};}function respondWithFilteredResult(_0x596705,_0x36a120){return function(_0x449053){if(_0x449053){var _0xaad19a=typeof _0x36a120['offset']===_0x9f2c('0x1c')&&typeof _0x36a120[_0x9f2c('0x1d')]===_0x9f2c('0x1c');var _0x478c6c=_0x449053[_0x9f2c('0x1e')];var _0x6bac27=_0xaad19a?0x0:_0x36a120[_0x9f2c('0x1f')];var _0x6fa52a=_0xaad19a?_0x449053[_0x9f2c('0x1e')]:_0x36a120[_0x9f2c('0x1f')]+_0x36a120[_0x9f2c('0x1d')];var _0x3126e1;if(_0x6fa52a>=_0x478c6c){_0x6fa52a=_0x478c6c;_0x3126e1=0xc8;}else{_0x3126e1=0xce;}_0x596705[_0x9f2c('0x1b')](_0x3126e1);return _0x596705[_0x9f2c('0x20')](_0x9f2c('0x21'),_0x6bac27+'-'+_0x6fa52a+'/'+_0x478c6c)[_0x9f2c('0x22')](_0x449053);}return null;};}function patchUpdates(_0x4a2f8e){return function(_0x461030){try{jsonpatch[_0x9f2c('0x23')](_0x461030,_0x4a2f8e,!![]);}catch(_0x1fd0c4){return BPromise[_0x9f2c('0x24')](_0x1fd0c4);}return _0x461030[_0x9f2c('0x25')]();};}function saveUpdates(_0x346a91,_0x26add2){return function(_0x88719){if(_0x88719){return _0x88719[_0x9f2c('0x26')](_0x346a91)['then'](function(_0x454095){return _0x454095;});}return null;};}function removeEntity(_0x455aa7,_0x3b2ded){return function(_0x13c727){if(_0x13c727){return _0x13c727['destroy']()[_0x9f2c('0x27')](function(){var _0xc62b9d=_0x13c727[_0x9f2c('0x28')]({'plain':!![]});var _0x30b27f=_0x9f2c('0x29');return db[_0x9f2c('0x2a')][_0x9f2c('0x2b')]({'where':{'type':_0x30b27f,'resourceId':_0xc62b9d['id']}})['then'](function(){return _0x13c727;});})[_0x9f2c('0x27')](function(){_0x455aa7[_0x9f2c('0x1b')](0xcc)[_0x9f2c('0x2c')]();});}};}function handleEntityNotFound(_0x198e43,_0x49e6ba){return function(_0x34c05b){if(!_0x34c05b){_0x198e43[_0x9f2c('0x1a')](0x194);}return _0x34c05b;};}function handleError(_0x22ed7e,_0x188236){_0x188236=_0x188236||0x1f4;return function(_0x4821ce){logger['error'](_0x4821ce[_0x9f2c('0x2d')]);if(_0x4821ce[_0x9f2c('0x2e')]){delete _0x4821ce[_0x9f2c('0x2e')];}_0x22ed7e['status'](_0x188236)[_0x9f2c('0x2f')](_0x4821ce);};}exports[_0x9f2c('0x30')]=function(_0x40e44e,_0x115f2b){var _0x2bd42e={},_0x712edc={},_0x42f878={'count':0x0,'rows':[]};var _0x841010=_[_0x9f2c('0x31')](db[_0x9f2c('0x32')][_0x9f2c('0x33')],function(_0x3967f1){return{'name':_0x3967f1[_0x9f2c('0x34')],'type':_0x3967f1[_0x9f2c('0x35')][_0x9f2c('0x36')]};});_0x712edc[_0x9f2c('0x37')]=_['map'](_0x841010,'name');_0x712edc[_0x9f2c('0x38')]=_[_0x9f2c('0x39')](_0x40e44e[_0x9f2c('0x38')]);_0x712edc['filters']=_[_0x9f2c('0x3a')](_0x712edc['model'],_0x712edc[_0x9f2c('0x38')]);_0x2bd42e[_0x9f2c('0x3b')]=_['intersection'](_0x712edc[_0x9f2c('0x37')],qs['fields'](_0x40e44e[_0x9f2c('0x38')][_0x9f2c('0x3c')]));_0x2bd42e[_0x9f2c('0x3b')]=_0x2bd42e[_0x9f2c('0x3b')][_0x9f2c('0x3d')]?_0x2bd42e[_0x9f2c('0x3b')]:_0x712edc[_0x9f2c('0x37')];if(!_0x40e44e[_0x9f2c('0x38')][_0x9f2c('0x3e')]('nolimit')){_0x2bd42e[_0x9f2c('0x1d')]=qs['limit'](_0x40e44e[_0x9f2c('0x38')][_0x9f2c('0x1d')]);_0x2bd42e['offset']=qs['offset'](_0x40e44e[_0x9f2c('0x38')][_0x9f2c('0x1f')]);}_0x2bd42e[_0x9f2c('0x3f')]=qs[_0x9f2c('0x40')](_0x40e44e['query'][_0x9f2c('0x40')]);_0x2bd42e[_0x9f2c('0x41')]=qs['filters'](_[_0x9f2c('0x42')](_0x40e44e[_0x9f2c('0x38')],_0x712edc['filters']),_0x841010);if(_0x40e44e[_0x9f2c('0x38')]['filter']){_0x2bd42e[_0x9f2c('0x41')]=_[_0x9f2c('0x43')](_0x2bd42e[_0x9f2c('0x41')],{'$or':_[_0x9f2c('0x31')](_0x841010,function(_0x2d6c9c){if(_0x2d6c9c[_0x9f2c('0x35')]!==_0x9f2c('0x44')){var _0x25444f={};_0x25444f[_0x2d6c9c[_0x9f2c('0x2e')]]={'$like':'%'+_0x40e44e['query']['filter']+'%'};return _0x25444f;}})});}_0x2bd42e=_[_0x9f2c('0x43')]({},_0x2bd42e,_0x40e44e['options']);var _0x448b92={'where':_0x2bd42e['where']};return db['AnalyticExtractedReport']['count'](_0x448b92)[_0x9f2c('0x27')](function(_0xc5606){_0x42f878[_0x9f2c('0x1e')]=_0xc5606;if(_0x40e44e[_0x9f2c('0x38')][_0x9f2c('0x45')]){_0x2bd42e[_0x9f2c('0x46')]=[{'all':!![]}];}return db[_0x9f2c('0x32')][_0x9f2c('0x47')](_0x2bd42e);})[_0x9f2c('0x27')](function(_0x229541){_0x42f878[_0x9f2c('0x48')]=_0x229541;return _0x42f878;})[_0x9f2c('0x27')](respondWithFilteredResult(_0x115f2b,_0x2bd42e))[_0x9f2c('0x49')](handleError(_0x115f2b,null));};exports[_0x9f2c('0x4a')]=function(_0x393100,_0x5627be){var _0x27c4b6={'raw':!![],'where':{'id':_0x393100['params']['id']}},_0x4c574e={};_0x4c574e[_0x9f2c('0x37')]=_[_0x9f2c('0x39')](db[_0x9f2c('0x32')]['rawAttributes']);_0x4c574e['query']=_[_0x9f2c('0x39')](_0x393100[_0x9f2c('0x38')]);_0x4c574e['filters']=_[_0x9f2c('0x3a')](_0x4c574e[_0x9f2c('0x37')],_0x4c574e['query']);_0x27c4b6[_0x9f2c('0x3b')]=_['intersection'](_0x4c574e[_0x9f2c('0x37')],qs[_0x9f2c('0x3c')](_0x393100[_0x9f2c('0x38')]['fields']));_0x27c4b6[_0x9f2c('0x3b')]=_0x27c4b6[_0x9f2c('0x3b')]['length']?_0x27c4b6['attributes']:_0x4c574e[_0x9f2c('0x37')];if(_0x393100[_0x9f2c('0x38')]['includeAll']){_0x27c4b6[_0x9f2c('0x46')]=[{'all':!![]}];}_0x27c4b6=_[_0x9f2c('0x43')]({},_0x27c4b6,_0x393100[_0x9f2c('0x4b')]);return db[_0x9f2c('0x32')][_0x9f2c('0x4c')](_0x27c4b6)[_0x9f2c('0x27')](handleEntityNotFound(_0x5627be,null))[_0x9f2c('0x27')](respondWithResult(_0x5627be,null))['catch'](handleError(_0x5627be,null));};exports['create']=function(_0x3cbe00,_0x5c7c0e){return db['AnalyticExtractedReport'][_0x9f2c('0x4d')](_0x3cbe00[_0x9f2c('0x4e')],{})[_0x9f2c('0x27')](function(_0xd0a430){var _0x562d3a=_0x3cbe00[_0x9f2c('0x4f')][_0x9f2c('0x28')]({'plain':!![]});if(!_0x562d3a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x562d3a[_0x9f2c('0x50')]==='user'){var _0x41aeb4=_0xd0a430[_0x9f2c('0x28')]({'plain':!![]});var _0x314abc='ExtractedReports';return db[_0x9f2c('0x51')]['find']({'where':{'name':_0x314abc,'userProfileId':_0x562d3a[_0x9f2c('0x52')]},'raw':!![]})['then'](function(_0x3f8fbc){if(_0x3f8fbc&&_0x3f8fbc[_0x9f2c('0x53')]===0x0){return db['UserProfileResource']['create']({'name':_0x41aeb4['name'],'resourceId':_0x41aeb4['id'],'type':_0x3f8fbc[_0x9f2c('0x2e')],'sectionId':_0x3f8fbc['id']},{})['then'](function(){return _0xd0a430;});}else{return _0xd0a430;}})[_0x9f2c('0x49')](function(_0x56698f){logger['error'](_0x9f2c('0x54'),_0x56698f);throw _0x56698f;});}return _0xd0a430;})[_0x9f2c('0x27')](respondWithResult(_0x5c7c0e,0xc9))[_0x9f2c('0x49')](handleError(_0x5c7c0e,null));};exports['update']=function(_0xbf4844,_0x53544b){if(_0xbf4844[_0x9f2c('0x4e')]['id']){delete _0xbf4844['body']['id'];}return db['AnalyticExtractedReport']['find']({'where':{'id':_0xbf4844[_0x9f2c('0x55')]['id']}})['then'](handleEntityNotFound(_0x53544b,null))[_0x9f2c('0x27')](saveUpdates(_0xbf4844[_0x9f2c('0x4e')],null))[_0x9f2c('0x27')](respondWithResult(_0x53544b,null))[_0x9f2c('0x49')](handleError(_0x53544b,null));};exports[_0x9f2c('0x2b')]=function(_0x12d744,_0x9d3f7f){return db['AnalyticExtractedReport'][_0x9f2c('0x4c')]({'where':{'id':_0x12d744[_0x9f2c('0x55')]['id']}})[_0x9f2c('0x27')](handleEntityNotFound(_0x9d3f7f,null))[_0x9f2c('0x27')](removeEntity(_0x9d3f7f,null))[_0x9f2c('0x49')](handleError(_0x9d3f7f,null));};exports['download']=function(_0x5ba3cf,_0x246bcb,_0x2880b6){return db['AnalyticExtractedReport'][_0x9f2c('0x4c')]({'where':{'id':_0x5ba3cf['params']['id']},'attributes':[_0x9f2c('0x2e'),'basename',_0x9f2c('0x56'),_0x9f2c('0x57')],'raw':!![]})['then'](handleEntityNotFound(_0x246bcb,null))[_0x9f2c('0x27')](function(_0x3887d2){if(_0x3887d2){if(!fs[_0x9f2c('0x58')](path[_0x9f2c('0x59')](config[_0x9f2c('0x5a')],_0x9f2c('0x5b'),_0x3887d2[_0x9f2c('0x56')]))){throw new db[(_0x9f2c('0x5c'))][(_0x9f2c('0x5d'))](_0x9f2c('0x5e'));}if(_0x5ba3cf[_0x9f2c('0x38')][_0x9f2c('0x5f')]){return _0x246bcb[_0x9f2c('0x1a')](0xc8);}return _0x246bcb[_0x9f2c('0x60')](path[_0x9f2c('0x59')](config[_0x9f2c('0x5a')],_0x9f2c('0x5b'),_0x3887d2[_0x9f2c('0x56')]),util[_0x9f2c('0x61')](_0x9f2c('0x62'),_0x3887d2['basename']||_0x3887d2[_0x9f2c('0x2e')],_0x3887d2[_0x9f2c('0x57')][_0x9f2c('0x63')]()));}})[_0x9f2c('0x49')](handleError(_0x246bcb,null));}; \ No newline at end of file +var _0xd63b=['length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','findAll','show','params','include','find','catch','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','basename','savename','existsSync','join','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','sendStatus','download','root','format','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','get','ExtractedReports','UserProfileResource','error','stack','send','index','map','AnalyticExtractedReport','fieldName','type','key','model','name','query','keys','filters','intersection','fields','attributes'];(function(_0x2b4448,_0x5bcc69){var _0xb4b465=function(_0x5ac741){while(--_0x5ac741){_0x2b4448['push'](_0x2b4448['shift']());}};_0xb4b465(++_0x5bcc69);}(_0xd63b,0x1b9));var _0xbd63=function(_0x296e0e,_0x342fa4){_0x296e0e=_0x296e0e-0x0;var _0x101c03=_0xd63b[_0x296e0e];return _0x101c03;};'use strict';var emlformat=require(_0xbd63('0x0'));var rimraf=require(_0xbd63('0x1'));var zipdir=require(_0xbd63('0x2'));var jsonpatch=require(_0xbd63('0x3'));var rp=require(_0xbd63('0x4'));var moment=require(_0xbd63('0x5'));var BPromise=require(_0xbd63('0x6'));var Mustache=require(_0xbd63('0x7'));var util=require(_0xbd63('0x8'));var path=require(_0xbd63('0x9'));var sox=require('sox');var csv=require(_0xbd63('0xa'));var ejs=require(_0xbd63('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbd63('0xc'));var squel=require(_0xbd63('0xd'));var crypto=require('crypto');var jsforce=require(_0xbd63('0xe'));var deskjs=require(_0xbd63('0xf'));var toCsv=require(_0xbd63('0xa'));var querystring=require('querystring');var Papa=require(_0xbd63('0x10'));var Redis=require(_0xbd63('0x11'));var authService=require(_0xbd63('0x12'));var qs=require(_0xbd63('0x13'));var as=require(_0xbd63('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xbd63('0x15'));var config=require(_0xbd63('0x16'));var licenseUtil=require(_0xbd63('0x17'));var db=require(_0xbd63('0x18'))['db'];function respondWithStatusCode(_0x1b6a88,_0x6dde5e){_0x6dde5e=_0x6dde5e||0xcc;return function(_0x55c07b){if(_0x55c07b){return _0x1b6a88['sendStatus'](_0x6dde5e);}return _0x1b6a88[_0xbd63('0x19')](_0x6dde5e)[_0xbd63('0x1a')]();};}function respondWithResult(_0x134a84,_0x202b74){_0x202b74=_0x202b74||0xc8;return function(_0x20520e){if(_0x20520e){return _0x134a84['status'](_0x202b74)[_0xbd63('0x1b')](_0x20520e);}};}function respondWithFilteredResult(_0x10bfda,_0x1269fc){return function(_0x495dad){if(_0x495dad){var _0x316af9=typeof _0x1269fc['offset']===_0xbd63('0x1c')&&typeof _0x1269fc['limit']==='undefined';var _0x13b856=_0x495dad[_0xbd63('0x1d')];var _0x221afe=_0x316af9?0x0:_0x1269fc[_0xbd63('0x1e')];var _0x310551=_0x316af9?_0x495dad[_0xbd63('0x1d')]:_0x1269fc['offset']+_0x1269fc[_0xbd63('0x1f')];var _0x578e07;if(_0x310551>=_0x13b856){_0x310551=_0x13b856;_0x578e07=0xc8;}else{_0x578e07=0xce;}_0x10bfda[_0xbd63('0x19')](_0x578e07);return _0x10bfda[_0xbd63('0x20')](_0xbd63('0x21'),_0x221afe+'-'+_0x310551+'/'+_0x13b856)[_0xbd63('0x1b')](_0x495dad);}return null;};}function patchUpdates(_0x22be0c){return function(_0x3208dd){try{jsonpatch['apply'](_0x3208dd,_0x22be0c,!![]);}catch(_0x5ce066){return BPromise[_0xbd63('0x22')](_0x5ce066);}return _0x3208dd[_0xbd63('0x23')]();};}function saveUpdates(_0x2df81f,_0xa1c62){return function(_0x51cbd8){if(_0x51cbd8){return _0x51cbd8[_0xbd63('0x24')](_0x2df81f)[_0xbd63('0x25')](function(_0x47c0cf){return _0x47c0cf;});}return null;};}function removeEntity(_0x39024b,_0x373b37){return function(_0x1ee7f7){if(_0x1ee7f7){return _0x1ee7f7[_0xbd63('0x26')]()[_0xbd63('0x25')](function(){var _0x1d1c30=_0x1ee7f7[_0xbd63('0x27')]({'plain':!![]});var _0x42f4cd=_0xbd63('0x28');return db[_0xbd63('0x29')][_0xbd63('0x26')]({'where':{'type':_0x42f4cd,'resourceId':_0x1d1c30['id']}})['then'](function(){return _0x1ee7f7;});})[_0xbd63('0x25')](function(){_0x39024b[_0xbd63('0x19')](0xcc)[_0xbd63('0x1a')]();});}};}function handleEntityNotFound(_0x3f2443,_0x104a9e){return function(_0x7cc9d9){if(!_0x7cc9d9){_0x3f2443['sendStatus'](0x194);}return _0x7cc9d9;};}function handleError(_0x4cceed,_0x4a922d){_0x4a922d=_0x4a922d||0x1f4;return function(_0x1b3e7f){logger[_0xbd63('0x2a')](_0x1b3e7f[_0xbd63('0x2b')]);if(_0x1b3e7f['name']){delete _0x1b3e7f['name'];}_0x4cceed[_0xbd63('0x19')](_0x4a922d)[_0xbd63('0x2c')](_0x1b3e7f);};}exports[_0xbd63('0x2d')]=function(_0x296907,_0x174ea4){var _0x537623={},_0x1e0dc7={},_0x174789={'count':0x0,'rows':[]};var _0x2aea7b=_[_0xbd63('0x2e')](db[_0xbd63('0x2f')]['rawAttributes'],function(_0x557559){return{'name':_0x557559[_0xbd63('0x30')],'type':_0x557559[_0xbd63('0x31')][_0xbd63('0x32')]};});_0x1e0dc7[_0xbd63('0x33')]=_[_0xbd63('0x2e')](_0x2aea7b,_0xbd63('0x34'));_0x1e0dc7[_0xbd63('0x35')]=_[_0xbd63('0x36')](_0x296907[_0xbd63('0x35')]);_0x1e0dc7[_0xbd63('0x37')]=_['intersection'](_0x1e0dc7[_0xbd63('0x33')],_0x1e0dc7['query']);_0x537623['attributes']=_[_0xbd63('0x38')](_0x1e0dc7[_0xbd63('0x33')],qs[_0xbd63('0x39')](_0x296907[_0xbd63('0x35')]['fields']));_0x537623[_0xbd63('0x3a')]=_0x537623[_0xbd63('0x3a')][_0xbd63('0x3b')]?_0x537623[_0xbd63('0x3a')]:_0x1e0dc7[_0xbd63('0x33')];if(!_0x296907[_0xbd63('0x35')][_0xbd63('0x3c')](_0xbd63('0x3d'))){_0x537623[_0xbd63('0x1f')]=qs['limit'](_0x296907[_0xbd63('0x35')]['limit']);_0x537623[_0xbd63('0x1e')]=qs[_0xbd63('0x1e')](_0x296907['query'][_0xbd63('0x1e')]);}_0x537623[_0xbd63('0x3e')]=qs[_0xbd63('0x3f')](_0x296907[_0xbd63('0x35')][_0xbd63('0x3f')]);_0x537623[_0xbd63('0x40')]=qs[_0xbd63('0x37')](_[_0xbd63('0x41')](_0x296907[_0xbd63('0x35')],_0x1e0dc7[_0xbd63('0x37')]),_0x2aea7b);if(_0x296907['query'][_0xbd63('0x42')]){_0x537623[_0xbd63('0x40')]=_['merge'](_0x537623[_0xbd63('0x40')],{'$or':_[_0xbd63('0x2e')](_0x2aea7b,function(_0x5496c7){if(_0x5496c7[_0xbd63('0x31')]!==_0xbd63('0x43')){var _0x41faef={};_0x41faef[_0x5496c7['name']]={'$like':'%'+_0x296907[_0xbd63('0x35')][_0xbd63('0x42')]+'%'};return _0x41faef;}})});}_0x537623=_[_0xbd63('0x44')]({},_0x537623,_0x296907[_0xbd63('0x45')]);var _0x3dfcb9={'where':_0x537623[_0xbd63('0x40')]};return db[_0xbd63('0x2f')][_0xbd63('0x1d')](_0x3dfcb9)['then'](function(_0x4bac19){_0x174789[_0xbd63('0x1d')]=_0x4bac19;if(_0x296907['query'][_0xbd63('0x46')]){_0x537623['include']=[{'all':!![]}];}return db[_0xbd63('0x2f')][_0xbd63('0x47')](_0x537623);})[_0xbd63('0x25')](function(_0x13f3b5){_0x174789['rows']=_0x13f3b5;return _0x174789;})['then'](respondWithFilteredResult(_0x174ea4,_0x537623))['catch'](handleError(_0x174ea4,null));};exports[_0xbd63('0x48')]=function(_0x2d4391,_0x511ffc){var _0x109f91={'raw':!![],'where':{'id':_0x2d4391[_0xbd63('0x49')]['id']}},_0x4c93e4={};_0x4c93e4[_0xbd63('0x33')]=_[_0xbd63('0x36')](db['AnalyticExtractedReport']['rawAttributes']);_0x4c93e4['query']=_[_0xbd63('0x36')](_0x2d4391[_0xbd63('0x35')]);_0x4c93e4[_0xbd63('0x37')]=_[_0xbd63('0x38')](_0x4c93e4[_0xbd63('0x33')],_0x4c93e4['query']);_0x109f91[_0xbd63('0x3a')]=_[_0xbd63('0x38')](_0x4c93e4[_0xbd63('0x33')],qs[_0xbd63('0x39')](_0x2d4391[_0xbd63('0x35')]['fields']));_0x109f91[_0xbd63('0x3a')]=_0x109f91[_0xbd63('0x3a')][_0xbd63('0x3b')]?_0x109f91['attributes']:_0x4c93e4['model'];if(_0x2d4391[_0xbd63('0x35')][_0xbd63('0x46')]){_0x109f91[_0xbd63('0x4a')]=[{'all':!![]}];}_0x109f91=_[_0xbd63('0x44')]({},_0x109f91,_0x2d4391['options']);return db[_0xbd63('0x2f')][_0xbd63('0x4b')](_0x109f91)[_0xbd63('0x25')](handleEntityNotFound(_0x511ffc,null))['then'](respondWithResult(_0x511ffc,null))[_0xbd63('0x4c')](handleError(_0x511ffc,null));};exports[_0xbd63('0x4d')]=function(_0x60af5d,_0x16e685){return db[_0xbd63('0x2f')][_0xbd63('0x4d')](_0x60af5d[_0xbd63('0x4e')],{})[_0xbd63('0x25')](function(_0x5059b1){var _0x22e7db=_0x60af5d[_0xbd63('0x4f')][_0xbd63('0x27')]({'plain':!![]});if(!_0x22e7db)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x22e7db[_0xbd63('0x50')]===_0xbd63('0x4f')){var _0x4b9a98=_0x5059b1[_0xbd63('0x27')]({'plain':!![]});var _0x5a5822=_0xbd63('0x28');return db[_0xbd63('0x51')]['find']({'where':{'name':_0x5a5822,'userProfileId':_0x22e7db[_0xbd63('0x52')]},'raw':!![]})[_0xbd63('0x25')](function(_0xf0d90c){if(_0xf0d90c&&_0xf0d90c[_0xbd63('0x53')]===0x0){return db[_0xbd63('0x29')][_0xbd63('0x4d')]({'name':_0x4b9a98[_0xbd63('0x34')],'resourceId':_0x4b9a98['id'],'type':_0xf0d90c[_0xbd63('0x34')],'sectionId':_0xf0d90c['id']},{})[_0xbd63('0x25')](function(){return _0x5059b1;});}else{return _0x5059b1;}})[_0xbd63('0x4c')](function(_0x4df880){logger[_0xbd63('0x2a')](_0xbd63('0x54'),_0x4df880);throw _0x4df880;});}return _0x5059b1;})['then'](respondWithResult(_0x16e685,0xc9))[_0xbd63('0x4c')](handleError(_0x16e685,null));};exports[_0xbd63('0x24')]=function(_0x582130,_0x2a4e85){if(_0x582130['body']['id']){delete _0x582130['body']['id'];}return db[_0xbd63('0x2f')][_0xbd63('0x4b')]({'where':{'id':_0x582130['params']['id']}})[_0xbd63('0x25')](handleEntityNotFound(_0x2a4e85,null))[_0xbd63('0x25')](saveUpdates(_0x582130[_0xbd63('0x4e')],null))[_0xbd63('0x25')](respondWithResult(_0x2a4e85,null))['catch'](handleError(_0x2a4e85,null));};exports[_0xbd63('0x26')]=function(_0x3086e9,_0x199aee){return db[_0xbd63('0x2f')][_0xbd63('0x4b')]({'where':{'id':_0x3086e9[_0xbd63('0x49')]['id']}})['then'](handleEntityNotFound(_0x199aee,null))[_0xbd63('0x25')](removeEntity(_0x199aee,null))[_0xbd63('0x4c')](handleError(_0x199aee,null));};exports['download']=function(_0x33efe0,_0x45fd80,_0x3d6f2f){return db[_0xbd63('0x2f')][_0xbd63('0x4b')]({'where':{'id':_0x33efe0['params']['id']},'attributes':['name',_0xbd63('0x55'),_0xbd63('0x56'),'output'],'raw':!![]})[_0xbd63('0x25')](handleEntityNotFound(_0x45fd80,null))[_0xbd63('0x25')](function(_0x5d6baa){if(_0x5d6baa){if(!fs[_0xbd63('0x57')](path[_0xbd63('0x58')](config['root'],_0xbd63('0x59'),_0x5d6baa[_0xbd63('0x56')]))){throw new db[(_0xbd63('0x5a'))][(_0xbd63('0x5b'))](_0xbd63('0x5c'));}if(_0x33efe0[_0xbd63('0x35')][_0xbd63('0x5d')]){return _0x45fd80[_0xbd63('0x5e')](0xc8);}return _0x45fd80[_0xbd63('0x5f')](path[_0xbd63('0x58')](config[_0xbd63('0x60')],'server/files/reports',_0x5d6baa[_0xbd63('0x56')]),util[_0xbd63('0x61')](_0xbd63('0x62'),_0x5d6baa[_0xbd63('0x55')]||_0x5d6baa[_0xbd63('0x34')],_0x5d6baa['output'][_0xbd63('0x63')]()));}})[_0xbd63('0x4c')](handleError(_0x45fd80,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 67fdea9..0b0960f 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 _0x3ea5=['AnalyticExtractedReport','analytics_extracted_reports','lodash','util','api','moment','bluebird','request-promise','path','rimraf','./analyticExtractedReport.attributes','define'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x3ea5,0x6e));var _0x53ea=function(_0x13ee5d,_0x54d8d7){_0x13ee5d=_0x13ee5d-0x0;var _0x28ef5c=_0x3ea5[_0x13ee5d];return _0x28ef5c;};'use strict';var _=require(_0x53ea('0x0'));var util=require(_0x53ea('0x1'));var logger=require('../../config/logger')(_0x53ea('0x2'));var moment=require(_0x53ea('0x3'));var BPromise=require(_0x53ea('0x4'));var rp=require(_0x53ea('0x5'));var fs=require('fs');var path=require(_0x53ea('0x6'));var rimraf=require(_0x53ea('0x7'));var config=require('../../config/environment');var attributes=require(_0x53ea('0x8'));module['exports']=function(_0x3ab5f2,_0x3d04c6){return _0x3ab5f2[_0x53ea('0x9')](_0x53ea('0xa'),attributes,{'tableName':_0x53ea('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcf65=['../../config/environment','exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x11821c,_0x384984){var _0x33efeb=function(_0x1d7b7a){while(--_0x1d7b7a){_0x11821c['push'](_0x11821c['shift']());}};_0x33efeb(++_0x384984);}(_0xcf65,0x19c));var _0x5cf6=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xcf65[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0x5cf6('0x0'));var util=require(_0x5cf6('0x1'));var logger=require(_0x5cf6('0x2'))('api');var moment=require(_0x5cf6('0x3'));var BPromise=require(_0x5cf6('0x4'));var rp=require(_0x5cf6('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5cf6('0x6'));var attributes=require('./analyticExtractedReport.attributes');module[_0x5cf6('0x7')]=function(_0x221ae9,_0xb5e516){return _0x221ae9[_0x5cf6('0x8')](_0x5cf6('0x9'),attributes,{'tableName':_0x5cf6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js index 0bec4f4..bcb6f1b 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 _0xf41e=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','then','info','AnalyticExtractedReport,\x20%s,\x20%s','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent'];(function(_0x5a1cef,_0x4e048b){var _0x4cbc4b=function(_0x47c9ba){while(--_0x47c9ba){_0x5a1cef['push'](_0x5a1cef['shift']());}};_0x4cbc4b(++_0x4e048b);}(_0xf41e,0x167));var _0xef41=function(_0x445ab2,_0x4d61ce){_0x445ab2=_0x445ab2-0x0;var _0x393edb=_0xf41e[_0x445ab2];return _0x393edb;};'use strict';var _=require(_0xef41('0x0'));var util=require(_0xef41('0x1'));var moment=require(_0xef41('0x2'));var BPromise=require(_0xef41('0x3'));var rs=require(_0xef41('0x4'));var fs=require('fs');var Redis=require(_0xef41('0x5'));var db=require(_0xef41('0x6'))['db'];var utils=require(_0xef41('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xef41('0x8'));var jayson=require(_0xef41('0x9'));var client=jayson[_0xef41('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x49e182,_0x560076,_0x491567){return new BPromise(function(_0x2cb1a1,_0x3a4604){return client['request'](_0x49e182,_0x491567)[_0xef41('0xb')](function(_0x3009cd){logger[_0xef41('0xc')](_0xef41('0xd'),_0x560076,'request\x20sent');logger['debug'](_0xef41('0xe'),_0x560076,'request\x20sent',JSON['stringify'](_0x3009cd));if(_0x3009cd[_0xef41('0xf')]){if(_0x3009cd['error'][_0xef41('0x10')]===0x1f4){logger['error'](_0xef41('0xd'),_0x560076,_0x3009cd[_0xef41('0xf')][_0xef41('0x11')]);return _0x3a4604(_0x3009cd[_0xef41('0xf')][_0xef41('0x11')]);}logger[_0xef41('0xf')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x560076,_0x3009cd['error'][_0xef41('0x11')]);return _0x2cb1a1(_0x3009cd[_0xef41('0xf')]['message']);}else{logger[_0xef41('0xc')](_0xef41('0xd'),_0x560076,_0xef41('0x12'));_0x2cb1a1(_0x3009cd[_0xef41('0x13')][_0xef41('0x11')]);}})[_0xef41('0x14')](function(_0x2d6008){logger[_0xef41('0xf')](_0xef41('0xd'),_0x560076,_0x2d6008);_0x3a4604(_0x2d6008);});});} \ No newline at end of file +var _0xe435=['request\x20sent','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s'];(function(_0x3ed5ba,_0x3bb526){var _0x594959=function(_0x2148ca){while(--_0x2148ca){_0x3ed5ba['push'](_0x3ed5ba['shift']());}};_0x594959(++_0x3bb526);}(_0xe435,0xcf));var _0x5e43=function(_0x591a22,_0x5723fc){_0x591a22=_0x591a22-0x0;var _0xee6035=_0xe435[_0x591a22];return _0xee6035;};'use strict';var _=require(_0x5e43('0x0'));var util=require('util');var moment=require(_0x5e43('0x1'));var BPromise=require(_0x5e43('0x2'));var rs=require(_0x5e43('0x3'));var fs=require('fs');var Redis=require(_0x5e43('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5e43('0x5'));var logger=require(_0x5e43('0x6'))(_0x5e43('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5e43('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3e71a9,_0x28df50,_0x2b416b){return new BPromise(function(_0x373ef0,_0x2a9d32){return client[_0x5e43('0x9')](_0x3e71a9,_0x2b416b)[_0x5e43('0xa')](function(_0x4165cc){logger[_0x5e43('0xb')](_0x5e43('0xc'),_0x28df50,_0x5e43('0xd'));logger['debug'](_0x5e43('0xe'),_0x28df50,_0x5e43('0xd'),JSON[_0x5e43('0xf')](_0x4165cc));if(_0x4165cc['error']){if(_0x4165cc['error'][_0x5e43('0x10')]===0x1f4){logger[_0x5e43('0x11')](_0x5e43('0xc'),_0x28df50,_0x4165cc[_0x5e43('0x11')][_0x5e43('0x12')]);return _0x2a9d32(_0x4165cc['error'][_0x5e43('0x12')]);}logger[_0x5e43('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x28df50,_0x4165cc['error'][_0x5e43('0x12')]);return _0x373ef0(_0x4165cc['error'][_0x5e43('0x12')]);}else{logger[_0x5e43('0xb')](_0x5e43('0xc'),_0x28df50,_0x5e43('0xd'));_0x373ef0(_0x4165cc[_0x5e43('0x13')]['message']);}})['catch'](function(_0x163bbe){logger[_0x5e43('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x28df50,_0x163bbe);_0x2a9d32(_0x163bbe);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index 8d9e052..9a52ffb 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 _0x3ec8=['isAuthenticated','index','/:id','/:id/download','download','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./analyticExtractedReport.controller','get'];(function(_0x2d4e0b,_0x159d4a){var _0x42da93=function(_0x19d1d4){while(--_0x19d1d4){_0x2d4e0b['push'](_0x2d4e0b['shift']());}};_0x42da93(++_0x159d4a);}(_0x3ec8,0x1af));var _0x83ec=function(_0x253707,_0x3384e0){_0x253707=_0x253707-0x0;var _0x517923=_0x3ec8[_0x253707];return _0x517923;};'use strict';var multer=require(_0x83ec('0x0'));var util=require(_0x83ec('0x1'));var path=require(_0x83ec('0x2'));var timeout=require(_0x83ec('0x3'));var express=require(_0x83ec('0x4'));var router=express[_0x83ec('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x83ec('0x6'));var interaction=require(_0x83ec('0x7'));var config=require('../../config/environment');var controller=require(_0x83ec('0x8'));router[_0x83ec('0x9')]('/',auth[_0x83ec('0xa')](),controller[_0x83ec('0xb')]);router[_0x83ec('0x9')](_0x83ec('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x83ec('0x9')](_0x83ec('0xd'),auth[_0x83ec('0xa')](),controller[_0x83ec('0xe')]);router[_0x83ec('0xf')]('/',auth[_0x83ec('0xa')](),controller[_0x83ec('0x10')]);router[_0x83ec('0x11')](_0x83ec('0xc'),auth[_0x83ec('0xa')](),controller[_0x83ec('0x12')]);router[_0x83ec('0x13')](_0x83ec('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x83ec('0x14')]=router; \ No newline at end of file +var _0xe32a=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','index','/:id','isAuthenticated','/:id/download','download','post','create','delete','exports','util','path'];(function(_0x39d6a8,_0xc9c91a){var _0x93f3db=function(_0x953b09){while(--_0x953b09){_0x39d6a8['push'](_0x39d6a8['shift']());}};_0x93f3db(++_0xc9c91a);}(_0xe32a,0x11b));var _0xae32=function(_0x1b5aea,_0x1afe6f){_0x1b5aea=_0x1b5aea-0x0;var _0x51cae9=_0xe32a[_0x1b5aea];return _0x51cae9;};'use strict';var multer=require('multer');var util=require(_0xae32('0x0'));var path=require(_0xae32('0x1'));var timeout=require('connect-timeout');var express=require(_0xae32('0x2'));var router=express[_0xae32('0x3')]();var fs_extra=require(_0xae32('0x4'));var auth=require(_0xae32('0x5'));var interaction=require(_0xae32('0x6'));var config=require(_0xae32('0x7'));var controller=require(_0xae32('0x8'));router[_0xae32('0x9')]('/',auth['isAuthenticated'](),controller[_0xae32('0xa')]);router[_0xae32('0x9')](_0xae32('0xb'),auth[_0xae32('0xc')](),controller['show']);router[_0xae32('0x9')](_0xae32('0xd'),auth[_0xae32('0xc')](),controller[_0xae32('0xe')]);router[_0xae32('0xf')]('/',auth[_0xae32('0xc')](),controller[_0xae32('0x10')]);router['put'](_0xae32('0xb'),auth[_0xae32('0xc')](),controller['update']);router[_0xae32('0x11')](_0xae32('0xb'),auth[_0xae32('0xc')](),controller['destroy']);module[_0xae32('0x12')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index 2f48b43..c6d2ba4 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 _0xd5f8=['BOOLEAN','sequelize','exports','STRING'];(function(_0x36c408,_0x490b30){var _0x48c83a=function(_0x4a739e){while(--_0x4a739e){_0x36c408['push'](_0x36c408['shift']());}};_0x48c83a(++_0x490b30);}(_0xd5f8,0x14d));var _0x8d5f=function(_0x125672,_0x24a339){_0x125672=_0x125672-0x0;var _0x395d9d=_0xd5f8[_0x125672];return _0x395d9d;};'use strict';var Sequelize=require(_0x8d5f('0x0'));module[_0x8d5f('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0x8d5f('0x2')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x8d5f('0x2')]},'custom':{'type':Sequelize[_0x8d5f('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x6f92=['STRING','BOOLEAN','TEXT'];(function(_0x42039c,_0x3b9912){var _0xeccf5f=function(_0x2a63ab){while(--_0x2a63ab){_0x42039c['push'](_0x42039c['shift']());}};_0xeccf5f(++_0x3b9912);}(_0x6f92,0xf8));var _0x26f9=function(_0x58de45,_0x524cf3){_0x58de45=_0x58de45-0x0;var _0x3dc89c=_0x6f92[_0x58de45];return _0x3dc89c;};'use strict';var Sequelize=require('sequelize');module['exports']={'field':{'type':Sequelize[_0x26f9('0x0')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x26f9('0x1')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x26f9('0x1')]},'custom':{'type':Sequelize[_0x26f9('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index 341a280..4e52bea 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 _0x7f1b=['then','destroy','end','error','name','send','map','AnalyticFieldReport','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','rawAttributes','find','create','bulkCreate','body','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','params','sequelize','transaction','CustomReportId','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','undefined','count','offset','limit','set','Content-Range','json','apply','save','update'];(function(_0x1b2422,_0x1e98d4){var _0x376573=function(_0x5db41b){while(--_0x5db41b){_0x1b2422['push'](_0x1b2422['shift']());}};_0x376573(++_0x1e98d4);}(_0x7f1b,0x17a));var _0xb7f1=function(_0xc68b88,_0x2d1879){_0xc68b88=_0xc68b88-0x0;var _0x5c7cc9=_0x7f1b[_0xc68b88];return _0x5c7cc9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb7f1('0x0'));var zipdir=require(_0xb7f1('0x1'));var jsonpatch=require(_0xb7f1('0x2'));var rp=require(_0xb7f1('0x3'));var moment=require(_0xb7f1('0x4'));var BPromise=require(_0xb7f1('0x5'));var Mustache=require(_0xb7f1('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb7f1('0x7'));var fs=require('fs');var fs_extra=require(_0xb7f1('0x8'));var _=require(_0xb7f1('0x9'));var squel=require(_0xb7f1('0xa'));var crypto=require(_0xb7f1('0xb'));var jsforce=require(_0xb7f1('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb7f1('0xd'));var Papa=require(_0xb7f1('0xe'));var Redis=require(_0xb7f1('0xf'));var authService=require(_0xb7f1('0x10'));var qs=require(_0xb7f1('0x11'));var as=require(_0xb7f1('0x12'));var hardwareService=require(_0xb7f1('0x13'));var logger=require(_0xb7f1('0x14'))(_0xb7f1('0x15'));var utils=require(_0xb7f1('0x16'));var config=require(_0xb7f1('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xb7f1('0x18'))['db'];function respondWithStatusCode(_0x5c4731,_0x36b5f5){_0x36b5f5=_0x36b5f5||0xcc;return function(_0x15907d){if(_0x15907d){return _0x5c4731[_0xb7f1('0x19')](_0x36b5f5);}return _0x5c4731['status'](_0x36b5f5)['end']();};}function respondWithResult(_0x413304,_0x1be50d){_0x1be50d=_0x1be50d||0xc8;return function(_0x4c698d){if(_0x4c698d){return _0x413304[_0xb7f1('0x1a')](_0x1be50d)['json'](_0x4c698d);}};}function respondWithFilteredResult(_0x26d283,_0x160ea2){return function(_0x2b06e9){if(_0x2b06e9){var _0x253695=typeof _0x160ea2['offset']===_0xb7f1('0x1b')&&typeof _0x160ea2['limit']===_0xb7f1('0x1b');var _0x5f03d3=_0x2b06e9[_0xb7f1('0x1c')];var _0x46acfb=_0x253695?0x0:_0x160ea2['offset'];var _0x524dda=_0x253695?_0x2b06e9['count']:_0x160ea2[_0xb7f1('0x1d')]+_0x160ea2[_0xb7f1('0x1e')];var _0x3aad2a;if(_0x524dda>=_0x5f03d3){_0x524dda=_0x5f03d3;_0x3aad2a=0xc8;}else{_0x3aad2a=0xce;}_0x26d283[_0xb7f1('0x1a')](_0x3aad2a);return _0x26d283[_0xb7f1('0x1f')](_0xb7f1('0x20'),_0x46acfb+'-'+_0x524dda+'/'+_0x5f03d3)[_0xb7f1('0x21')](_0x2b06e9);}return null;};}function patchUpdates(_0x3e697d){return function(_0x3f6fe0){try{jsonpatch[_0xb7f1('0x22')](_0x3f6fe0,_0x3e697d,!![]);}catch(_0x40de54){return BPromise['reject'](_0x40de54);}return _0x3f6fe0[_0xb7f1('0x23')]();};}function saveUpdates(_0x5708a3,_0x1699f3){return function(_0x30dbbc){if(_0x30dbbc){return _0x30dbbc[_0xb7f1('0x24')](_0x5708a3)[_0xb7f1('0x25')](function(_0x187e73){return _0x187e73;});}return null;};}function removeEntity(_0x1f8f4b,_0x4f22f4){return function(_0x955ee5){if(_0x955ee5){return _0x955ee5[_0xb7f1('0x26')]()[_0xb7f1('0x25')](function(){_0x1f8f4b[_0xb7f1('0x1a')](0xcc)[_0xb7f1('0x27')]();});}};}function handleEntityNotFound(_0x424747,_0x498950){return function(_0x81e73a){if(!_0x81e73a){_0x424747[_0xb7f1('0x19')](0x194);}return _0x81e73a;};}function handleError(_0x256ff6,_0x83fa4){_0x83fa4=_0x83fa4||0x1f4;return function(_0x10be17){logger[_0xb7f1('0x28')](_0x10be17['stack']);if(_0x10be17[_0xb7f1('0x29')]){delete _0x10be17[_0xb7f1('0x29')];}_0x256ff6[_0xb7f1('0x1a')](_0x83fa4)[_0xb7f1('0x2a')](_0x10be17);};}exports['index']=function(_0x49eb02,_0x23f2cd){var _0x4bf6ed={},_0x6b6fa0={},_0xf391c8={'count':0x0,'rows':[]};var _0x7e115f=_[_0xb7f1('0x2b')](db[_0xb7f1('0x2c')]['rawAttributes'],function(_0x3ea50a){return{'name':_0x3ea50a['fieldName'],'type':_0x3ea50a[_0xb7f1('0x2d')][_0xb7f1('0x2e')]};});_0x6b6fa0['model']=_[_0xb7f1('0x2b')](_0x7e115f,'name');_0x6b6fa0[_0xb7f1('0x2f')]=_[_0xb7f1('0x30')](_0x49eb02[_0xb7f1('0x2f')]);_0x6b6fa0[_0xb7f1('0x31')]=_[_0xb7f1('0x32')](_0x6b6fa0[_0xb7f1('0x33')],_0x6b6fa0[_0xb7f1('0x2f')]);_0x4bf6ed['attributes']=_[_0xb7f1('0x32')](_0x6b6fa0['model'],qs[_0xb7f1('0x34')](_0x49eb02[_0xb7f1('0x2f')][_0xb7f1('0x34')]));_0x4bf6ed[_0xb7f1('0x35')]=_0x4bf6ed['attributes'][_0xb7f1('0x36')]?_0x4bf6ed[_0xb7f1('0x35')]:_0x6b6fa0[_0xb7f1('0x33')];if(!_0x49eb02[_0xb7f1('0x2f')][_0xb7f1('0x37')]('nolimit')){_0x4bf6ed['limit']=qs[_0xb7f1('0x1e')](_0x49eb02['query'][_0xb7f1('0x1e')]);_0x4bf6ed[_0xb7f1('0x1d')]=qs[_0xb7f1('0x1d')](_0x49eb02[_0xb7f1('0x2f')][_0xb7f1('0x1d')]);}_0x4bf6ed[_0xb7f1('0x38')]=qs[_0xb7f1('0x39')](_0x49eb02['query']['sort']);_0x4bf6ed[_0xb7f1('0x3a')]=qs[_0xb7f1('0x31')](_[_0xb7f1('0x3b')](_0x49eb02['query'],_0x6b6fa0['filters']),_0x7e115f);if(_0x49eb02[_0xb7f1('0x2f')]['filter']){_0x4bf6ed[_0xb7f1('0x3a')]=_['merge'](_0x4bf6ed[_0xb7f1('0x3a')],{'$or':_[_0xb7f1('0x2b')](_0x7e115f,function(_0x3cbcab){if(_0x3cbcab['type']!==_0xb7f1('0x3c')){var _0x5b779d={};_0x5b779d[_0x3cbcab[_0xb7f1('0x29')]]={'$like':'%'+_0x49eb02[_0xb7f1('0x2f')][_0xb7f1('0x3d')]+'%'};return _0x5b779d;}})});}_0x4bf6ed=_[_0xb7f1('0x3e')]({},_0x4bf6ed,_0x49eb02[_0xb7f1('0x3f')]);var _0x1180e3={'where':_0x4bf6ed['where']};return db[_0xb7f1('0x2c')][_0xb7f1('0x1c')](_0x1180e3)['then'](function(_0x4b4e24){_0xf391c8[_0xb7f1('0x1c')]=_0x4b4e24;if(_0x49eb02[_0xb7f1('0x2f')][_0xb7f1('0x40')]){_0x4bf6ed[_0xb7f1('0x41')]=[{'all':!![]}];}return db[_0xb7f1('0x2c')][_0xb7f1('0x42')](_0x4bf6ed);})[_0xb7f1('0x25')](function(_0x51a7d5){_0xf391c8[_0xb7f1('0x43')]=_0x51a7d5;return _0xf391c8;})[_0xb7f1('0x25')](respondWithFilteredResult(_0x23f2cd,_0x4bf6ed))[_0xb7f1('0x44')](handleError(_0x23f2cd,null));};exports['show']=function(_0x2f040b,_0x3f9ad2){var _0x355d4d={'raw':![],'where':{'id':_0x2f040b['params']['id']}},_0x2144f4={};_0x2144f4[_0xb7f1('0x33')]=_[_0xb7f1('0x30')](db['AnalyticFieldReport'][_0xb7f1('0x45')]);_0x2144f4[_0xb7f1('0x2f')]=_[_0xb7f1('0x30')](_0x2f040b[_0xb7f1('0x2f')]);_0x2144f4[_0xb7f1('0x31')]=_[_0xb7f1('0x32')](_0x2144f4['model'],_0x2144f4[_0xb7f1('0x2f')]);_0x355d4d['attributes']=_[_0xb7f1('0x32')](_0x2144f4[_0xb7f1('0x33')],qs[_0xb7f1('0x34')](_0x2f040b[_0xb7f1('0x2f')]['fields']));_0x355d4d[_0xb7f1('0x35')]=_0x355d4d['attributes'][_0xb7f1('0x36')]?_0x355d4d[_0xb7f1('0x35')]:_0x2144f4['model'];if(_0x2f040b['query'][_0xb7f1('0x40')]){_0x355d4d[_0xb7f1('0x41')]=[{'all':!![]}];}_0x355d4d=_[_0xb7f1('0x3e')]({},_0x355d4d,_0x2f040b[_0xb7f1('0x3f')]);return db[_0xb7f1('0x2c')][_0xb7f1('0x46')](_0x355d4d)['then'](handleEntityNotFound(_0x3f9ad2,null))['then'](respondWithResult(_0x3f9ad2,null))['catch'](handleError(_0x3f9ad2,null));};exports['create']=function(_0x3adfac,_0x121b3b){return db[_0xb7f1('0x2c')][_0xb7f1('0x47')](_0x3adfac['body'],{})[_0xb7f1('0x25')](respondWithResult(_0x121b3b,0xc9))[_0xb7f1('0x44')](handleError(_0x121b3b,null));};exports[_0xb7f1('0x48')]=function(_0x588196,_0x174730){return db['AnalyticFieldReport'][_0xb7f1('0x48')](_0x588196[_0xb7f1('0x49')],{'raw':![],'individualHooks':!![]})[_0xb7f1('0x25')](respondWithResult(_0x174730,0xc9))[_0xb7f1('0x44')](handleError(_0x174730,null));};exports['update']=function(_0x195a47,_0x4b584b){if(_0x195a47[_0xb7f1('0x49')]['id']){delete _0x195a47[_0xb7f1('0x49')]['id'];}return db[_0xb7f1('0x2c')]['find']({'where':{'id':_0x195a47['params']['id']}})[_0xb7f1('0x25')](handleEntityNotFound(_0x4b584b,null))[_0xb7f1('0x25')](saveUpdates(_0x195a47[_0xb7f1('0x49')],null))[_0xb7f1('0x25')](respondWithResult(_0x4b584b,null))['catch'](handleError(_0x4b584b,null));};exports[_0xb7f1('0x26')]=function(_0x38157a,_0x566519){return db['AnalyticFieldReport'][_0xb7f1('0x46')]({'where':{'id':_0x38157a['params']['id']}})[_0xb7f1('0x25')](handleEntityNotFound(_0x566519,null))[_0xb7f1('0x25')](removeEntity(_0x566519,null))[_0xb7f1('0x44')](handleError(_0x566519,null));};exports[_0xb7f1('0x4a')]=function(_0x44d6ac,_0x5ea989){return db[_0xb7f1('0x2c')][_0xb7f1('0x26')]({'where':{'id':_0x44d6ac[_0xb7f1('0x2f')][_0xb7f1('0x4b')]||[]},'raw':![],'individualHooks':!![]})[_0xb7f1('0x25')](respondWithResult(_0x5ea989,0xcc))[_0xb7f1('0x44')](handleError(_0x5ea989,null));};exports[_0xb7f1('0x4c')]=function(_0xdde963,_0x3a0366,_0x419db8){return db[_0xb7f1('0x4d')][_0xb7f1('0x4e')]({'where':{'id':_0xdde963[_0xb7f1('0x4f')]['id']}})[_0xb7f1('0x25')](handleEntityNotFound(_0x3a0366,null))[_0xb7f1('0x25')](function(_0x4b00a3){if(_0x4b00a3){return db[_0xb7f1('0x50')][_0xb7f1('0x51')](function(_0x5d10dc){return db['AnalyticFieldReport'][_0xb7f1('0x26')]({'where':{'CustomReportId':_0xdde963[_0xb7f1('0x4f')]['id']},'transaction':_0x5d10dc})['then'](function(_0x139de8){var _0x1663ed=_['map'](_0xdde963[_0xb7f1('0x49')],function(_0x448cae){delete _0x448cae['id'];_0x448cae[_0xb7f1('0x52')]=_0xdde963[_0xb7f1('0x4f')]['id'];return _0x448cae;});return db[_0xb7f1('0x2c')][_0xb7f1('0x48')](_0x1663ed,{'transaction':_0x5d10dc});});})[_0xb7f1('0x25')](function(){return db['AnalyticFieldReport'][_0xb7f1('0x42')]({'where':{'CustomReportId':_0xdde963[_0xb7f1('0x4f')]['id']}});});}})[_0xb7f1('0x25')](respondWithResult(_0x3a0366,null))['catch'](handleError(_0x3a0366,null));}; \ No newline at end of file +var _0x102a=['ids','addFields','AnalyticCustomReport','findOne','transaction','CustomReportId','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','then','destroy','error','stack','name','send','index','map','AnalyticFieldReport','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','rawAttributes','find','create','body','bulkCreate','catch','params','bulkDestroy'];(function(_0x1a72f3,_0x217011){var _0x57ef47=function(_0x20123d){while(--_0x20123d){_0x1a72f3['push'](_0x1a72f3['shift']());}};_0x57ef47(++_0x217011);}(_0x102a,0xae));var _0xa102=function(_0x109d74,_0x525c5f){_0x109d74=_0x109d74-0x0;var _0x1c47a0=_0x102a[_0x109d74];return _0x1c47a0;};'use strict';var emlformat=require(_0xa102('0x0'));var rimraf=require(_0xa102('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa102('0x2'));var rp=require('request-promise');var moment=require(_0xa102('0x3'));var BPromise=require(_0xa102('0x4'));var Mustache=require(_0xa102('0x5'));var util=require(_0xa102('0x6'));var path=require(_0xa102('0x7'));var sox=require(_0xa102('0x8'));var csv=require(_0xa102('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa102('0xa'));var _=require(_0xa102('0xb'));var squel=require(_0xa102('0xc'));var crypto=require(_0xa102('0xd'));var jsforce=require(_0xa102('0xe'));var deskjs=require(_0xa102('0xf'));var toCsv=require('to-csv');var querystring=require(_0xa102('0x10'));var Papa=require(_0xa102('0x11'));var Redis=require('ioredis');var authService=require(_0xa102('0x12'));var qs=require(_0xa102('0x13'));var as=require(_0xa102('0x14'));var hardwareService=require(_0xa102('0x15'));var logger=require(_0xa102('0x16'))(_0xa102('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1f3454,_0x3cd1c2){_0x3cd1c2=_0x3cd1c2||0xcc;return function(_0x49608e){if(_0x49608e){return _0x1f3454[_0xa102('0x18')](_0x3cd1c2);}return _0x1f3454[_0xa102('0x19')](_0x3cd1c2)[_0xa102('0x1a')]();};}function respondWithResult(_0x4fb6ba,_0x5ef633){_0x5ef633=_0x5ef633||0xc8;return function(_0x57a2b7){if(_0x57a2b7){return _0x4fb6ba[_0xa102('0x19')](_0x5ef633)['json'](_0x57a2b7);}};}function respondWithFilteredResult(_0x124caf,_0x5c610b){return function(_0x526e12){if(_0x526e12){var _0x2f544c=typeof _0x5c610b[_0xa102('0x1b')]===_0xa102('0x1c')&&typeof _0x5c610b[_0xa102('0x1d')]===_0xa102('0x1c');var _0x2c6081=_0x526e12['count'];var _0x378424=_0x2f544c?0x0:_0x5c610b[_0xa102('0x1b')];var _0x31be11=_0x2f544c?_0x526e12[_0xa102('0x1e')]:_0x5c610b[_0xa102('0x1b')]+_0x5c610b['limit'];var _0x502e76;if(_0x31be11>=_0x2c6081){_0x31be11=_0x2c6081;_0x502e76=0xc8;}else{_0x502e76=0xce;}_0x124caf[_0xa102('0x19')](_0x502e76);return _0x124caf[_0xa102('0x1f')](_0xa102('0x20'),_0x378424+'-'+_0x31be11+'/'+_0x2c6081)[_0xa102('0x21')](_0x526e12);}return null;};}function patchUpdates(_0x683347){return function(_0x3b4127){try{jsonpatch[_0xa102('0x22')](_0x3b4127,_0x683347,!![]);}catch(_0x2fa04c){return BPromise['reject'](_0x2fa04c);}return _0x3b4127[_0xa102('0x23')]();};}function saveUpdates(_0x5afbf7,_0x3eddc1){return function(_0xf27ead){if(_0xf27ead){return _0xf27ead['update'](_0x5afbf7)[_0xa102('0x24')](function(_0x45f171){return _0x45f171;});}return null;};}function removeEntity(_0x459994,_0x5447d0){return function(_0x273597){if(_0x273597){return _0x273597[_0xa102('0x25')]()[_0xa102('0x24')](function(){_0x459994[_0xa102('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x26788e,_0x41646f){return function(_0xe58071){if(!_0xe58071){_0x26788e[_0xa102('0x18')](0x194);}return _0xe58071;};}function handleError(_0x5b6ca9,_0x4658b5){_0x4658b5=_0x4658b5||0x1f4;return function(_0xd10bee){logger[_0xa102('0x26')](_0xd10bee[_0xa102('0x27')]);if(_0xd10bee[_0xa102('0x28')]){delete _0xd10bee[_0xa102('0x28')];}_0x5b6ca9[_0xa102('0x19')](_0x4658b5)[_0xa102('0x29')](_0xd10bee);};}exports[_0xa102('0x2a')]=function(_0x555fc8,_0x27bf6e){var _0xb36112={},_0x4d2642={},_0x1eecad={'count':0x0,'rows':[]};var _0x38dbce=_[_0xa102('0x2b')](db[_0xa102('0x2c')]['rawAttributes'],function(_0x2328c2){return{'name':_0x2328c2[_0xa102('0x2d')],'type':_0x2328c2[_0xa102('0x2e')][_0xa102('0x2f')]};});_0x4d2642[_0xa102('0x30')]=_[_0xa102('0x2b')](_0x38dbce,'name');_0x4d2642[_0xa102('0x31')]=_[_0xa102('0x32')](_0x555fc8[_0xa102('0x31')]);_0x4d2642[_0xa102('0x33')]=_['intersection'](_0x4d2642[_0xa102('0x30')],_0x4d2642[_0xa102('0x31')]);_0xb36112[_0xa102('0x34')]=_[_0xa102('0x35')](_0x4d2642[_0xa102('0x30')],qs[_0xa102('0x36')](_0x555fc8[_0xa102('0x31')]['fields']));_0xb36112[_0xa102('0x34')]=_0xb36112[_0xa102('0x34')][_0xa102('0x37')]?_0xb36112[_0xa102('0x34')]:_0x4d2642[_0xa102('0x30')];if(!_0x555fc8[_0xa102('0x31')]['hasOwnProperty'](_0xa102('0x38'))){_0xb36112[_0xa102('0x1d')]=qs['limit'](_0x555fc8[_0xa102('0x31')][_0xa102('0x1d')]);_0xb36112[_0xa102('0x1b')]=qs[_0xa102('0x1b')](_0x555fc8['query'][_0xa102('0x1b')]);}_0xb36112[_0xa102('0x39')]=qs[_0xa102('0x3a')](_0x555fc8[_0xa102('0x31')]['sort']);_0xb36112['where']=qs[_0xa102('0x33')](_[_0xa102('0x3b')](_0x555fc8['query'],_0x4d2642['filters']),_0x38dbce);if(_0x555fc8[_0xa102('0x31')]['filter']){_0xb36112[_0xa102('0x3c')]=_[_0xa102('0x3d')](_0xb36112[_0xa102('0x3c')],{'$or':_['map'](_0x38dbce,function(_0x1309d3){if(_0x1309d3[_0xa102('0x2e')]!==_0xa102('0x3e')){var _0x4340c9={};_0x4340c9[_0x1309d3[_0xa102('0x28')]]={'$like':'%'+_0x555fc8['query'][_0xa102('0x3f')]+'%'};return _0x4340c9;}})});}_0xb36112=_[_0xa102('0x3d')]({},_0xb36112,_0x555fc8[_0xa102('0x40')]);var _0x2f7457={'where':_0xb36112[_0xa102('0x3c')]};return db[_0xa102('0x2c')][_0xa102('0x1e')](_0x2f7457)[_0xa102('0x24')](function(_0x2aa9b9){_0x1eecad[_0xa102('0x1e')]=_0x2aa9b9;if(_0x555fc8[_0xa102('0x31')][_0xa102('0x41')]){_0xb36112[_0xa102('0x42')]=[{'all':!![]}];}return db[_0xa102('0x2c')][_0xa102('0x43')](_0xb36112);})['then'](function(_0x48510a){_0x1eecad[_0xa102('0x44')]=_0x48510a;return _0x1eecad;})[_0xa102('0x24')](respondWithFilteredResult(_0x27bf6e,_0xb36112))['catch'](handleError(_0x27bf6e,null));};exports[_0xa102('0x45')]=function(_0x5ceee0,_0x267087){var _0x2856a2={'raw':![],'where':{'id':_0x5ceee0['params']['id']}},_0x3aa505={};_0x3aa505[_0xa102('0x30')]=_[_0xa102('0x32')](db[_0xa102('0x2c')][_0xa102('0x46')]);_0x3aa505[_0xa102('0x31')]=_[_0xa102('0x32')](_0x5ceee0['query']);_0x3aa505[_0xa102('0x33')]=_[_0xa102('0x35')](_0x3aa505[_0xa102('0x30')],_0x3aa505[_0xa102('0x31')]);_0x2856a2['attributes']=_[_0xa102('0x35')](_0x3aa505[_0xa102('0x30')],qs['fields'](_0x5ceee0[_0xa102('0x31')]['fields']));_0x2856a2[_0xa102('0x34')]=_0x2856a2['attributes'][_0xa102('0x37')]?_0x2856a2[_0xa102('0x34')]:_0x3aa505[_0xa102('0x30')];if(_0x5ceee0[_0xa102('0x31')]['includeAll']){_0x2856a2[_0xa102('0x42')]=[{'all':!![]}];}_0x2856a2=_[_0xa102('0x3d')]({},_0x2856a2,_0x5ceee0['options']);return db[_0xa102('0x2c')][_0xa102('0x47')](_0x2856a2)['then'](handleEntityNotFound(_0x267087,null))[_0xa102('0x24')](respondWithResult(_0x267087,null))['catch'](handleError(_0x267087,null));};exports[_0xa102('0x48')]=function(_0x17dafd,_0x329ea0){return db[_0xa102('0x2c')]['create'](_0x17dafd[_0xa102('0x49')],{})[_0xa102('0x24')](respondWithResult(_0x329ea0,0xc9))['catch'](handleError(_0x329ea0,null));};exports[_0xa102('0x4a')]=function(_0x59e20f,_0x4f86c4){return db[_0xa102('0x2c')][_0xa102('0x4a')](_0x59e20f['body'],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x4f86c4,0xc9))[_0xa102('0x4b')](handleError(_0x4f86c4,null));};exports['update']=function(_0x45881f,_0x34a57a){if(_0x45881f[_0xa102('0x49')]['id']){delete _0x45881f['body']['id'];}return db[_0xa102('0x2c')][_0xa102('0x47')]({'where':{'id':_0x45881f['params']['id']}})[_0xa102('0x24')](handleEntityNotFound(_0x34a57a,null))[_0xa102('0x24')](saveUpdates(_0x45881f[_0xa102('0x49')],null))[_0xa102('0x24')](respondWithResult(_0x34a57a,null))[_0xa102('0x4b')](handleError(_0x34a57a,null));};exports[_0xa102('0x25')]=function(_0x290764,_0x4cdae0){return db[_0xa102('0x2c')][_0xa102('0x47')]({'where':{'id':_0x290764[_0xa102('0x4c')]['id']}})[_0xa102('0x24')](handleEntityNotFound(_0x4cdae0,null))[_0xa102('0x24')](removeEntity(_0x4cdae0,null))[_0xa102('0x4b')](handleError(_0x4cdae0,null));};exports[_0xa102('0x4d')]=function(_0x67a017,_0x34c43c){return db['AnalyticFieldReport'][_0xa102('0x25')]({'where':{'id':_0x67a017[_0xa102('0x31')][_0xa102('0x4e')]||[]},'raw':![],'individualHooks':!![]})[_0xa102('0x24')](respondWithResult(_0x34c43c,0xcc))[_0xa102('0x4b')](handleError(_0x34c43c,null));};exports[_0xa102('0x4f')]=function(_0x567949,_0x46c69c,_0xf037e9){return db[_0xa102('0x50')][_0xa102('0x51')]({'where':{'id':_0x567949[_0xa102('0x4c')]['id']}})[_0xa102('0x24')](handleEntityNotFound(_0x46c69c,null))[_0xa102('0x24')](function(_0x29a02c){if(_0x29a02c){return db['sequelize'][_0xa102('0x52')](function(_0x53e695){return db['AnalyticFieldReport']['destroy']({'where':{'CustomReportId':_0x567949[_0xa102('0x4c')]['id']},'transaction':_0x53e695})[_0xa102('0x24')](function(_0x522363){var _0x3cf53d=_[_0xa102('0x2b')](_0x567949[_0xa102('0x49')],function(_0x578c77){delete _0x578c77['id'];_0x578c77[_0xa102('0x53')]=_0x567949[_0xa102('0x4c')]['id'];return _0x578c77;});return db[_0xa102('0x2c')][_0xa102('0x4a')](_0x3cf53d,{'transaction':_0x53e695});});})[_0xa102('0x24')](function(){return db['AnalyticFieldReport'][_0xa102('0x43')]({'where':{'CustomReportId':_0x567949[_0xa102('0x4c')]['id']}});});}})[_0xa102('0x24')](respondWithResult(_0x46c69c,null))[_0xa102('0x4b')](handleError(_0x46c69c,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index d45dfdf..5260a6d 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 _0x9c96=['request-promise','path','rimraf','../../config/environment','define','analytics_report_fields','lodash','util','../../config/logger','api','moment'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x9c96,0xf8));var _0x69c9=function(_0x4b546c,_0x4458bc){_0x4b546c=_0x4b546c-0x0;var _0x576cf4=_0x9c96[_0x4b546c];return _0x576cf4;};'use strict';var _=require(_0x69c9('0x0'));var util=require(_0x69c9('0x1'));var logger=require(_0x69c9('0x2'))(_0x69c9('0x3'));var moment=require(_0x69c9('0x4'));var BPromise=require('bluebird');var rp=require(_0x69c9('0x5'));var fs=require('fs');var path=require(_0x69c9('0x6'));var rimraf=require(_0x69c9('0x7'));var config=require(_0x69c9('0x8'));var attributes=require('./analyticFieldReport.attributes');module['exports']=function(_0x2890a0,_0x5e9209){return _0x2890a0[_0x69c9('0x9')]('AnalyticFieldReport',attributes,{'tableName':_0x69c9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4bff=['analytics_report_fields','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports'];(function(_0x364797,_0x2e97de){var _0x4ebd83=function(_0x8d5dea){while(--_0x8d5dea){_0x364797['push'](_0x364797['shift']());}};_0x4ebd83(++_0x2e97de);}(_0x4bff,0xfe));var _0xf4bf=function(_0xaa6a4,_0x64b067){_0xaa6a4=_0xaa6a4-0x0;var _0xdc31a4=_0x4bff[_0xaa6a4];return _0xdc31a4;};'use strict';var _=require('lodash');var util=require(_0xf4bf('0x0'));var logger=require(_0xf4bf('0x1'))('api');var moment=require(_0xf4bf('0x2'));var BPromise=require(_0xf4bf('0x3'));var rp=require(_0xf4bf('0x4'));var fs=require('fs');var path=require(_0xf4bf('0x5'));var rimraf=require(_0xf4bf('0x6'));var config=require(_0xf4bf('0x7'));var attributes=require(_0xf4bf('0x8'));module[_0xf4bf('0x9')]=function(_0x2c746e,_0x295fb7){return _0x2c746e['define']('AnalyticFieldReport',attributes,{'tableName':_0xf4bf('0xa'),'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 7cda303..50fcb88 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 _0xa258=['rpc','jayson/promise','http','request','then','info','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','AnalyticFieldReport,\x20%s,\x20%s','message','result','catch','moment','bluebird','randomstring','../../mysqldb'];(function(_0x2f5920,_0x596320){var _0x143cbb=function(_0x577c7a){while(--_0x577c7a){_0x2f5920['push'](_0x2f5920['shift']());}};_0x143cbb(++_0x596320);}(_0xa258,0xb0));var _0x8a25=function(_0x22d2ff,_0x56a793){_0x22d2ff=_0x22d2ff-0x0;var _0x4a50b6=_0xa258[_0x22d2ff];return _0x4a50b6;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8a25('0x0'));var BPromise=require(_0x8a25('0x1'));var rs=require(_0x8a25('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8a25('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8a25('0x4'));var config=require('../../config/environment');var jayson=require(_0x8a25('0x5'));var client=jayson['client'][_0x8a25('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x4a6af9,_0x5cce58,_0x427d67){return new BPromise(function(_0x44d7fe,_0x44e47d){return client[_0x8a25('0x7')](_0x4a6af9,_0x427d67)[_0x8a25('0x8')](function(_0x39645c){logger[_0x8a25('0x9')]('AnalyticFieldReport,\x20%s,\x20%s',_0x5cce58,'request\x20sent');logger[_0x8a25('0xa')](_0x8a25('0xb'),_0x5cce58,_0x8a25('0xc'),JSON[_0x8a25('0xd')](_0x39645c));if(_0x39645c[_0x8a25('0xe')]){if(_0x39645c['error'][_0x8a25('0xf')]===0x1f4){logger['error'](_0x8a25('0x10'),_0x5cce58,_0x39645c[_0x8a25('0xe')][_0x8a25('0x11')]);return _0x44e47d(_0x39645c[_0x8a25('0xe')][_0x8a25('0x11')]);}logger[_0x8a25('0xe')]('AnalyticFieldReport,\x20%s,\x20%s',_0x5cce58,_0x39645c['error']['message']);return _0x44d7fe(_0x39645c[_0x8a25('0xe')][_0x8a25('0x11')]);}else{logger[_0x8a25('0x9')]('AnalyticFieldReport,\x20%s,\x20%s',_0x5cce58,_0x8a25('0xc'));_0x44d7fe(_0x39645c[_0x8a25('0x12')][_0x8a25('0x11')]);}})[_0x8a25('0x13')](function(_0x44d792){logger[_0x8a25('0xe')](_0x8a25('0x10'),_0x5cce58,_0x44d792);_0x44e47d(_0x44d792);});});} \ No newline at end of file +var _0x041b=['debug','request\x20sent','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticFieldReport,\x20%s,\x20%s'];(function(_0x283271,_0x41b3c3){var _0x1f835e=function(_0x2908b0){while(--_0x2908b0){_0x283271['push'](_0x283271['shift']());}};_0x1f835e(++_0x41b3c3);}(_0x041b,0xb7));var _0xb041=function(_0x5b4b88,_0x57012e){_0x5b4b88=_0x5b4b88-0x0;var _0x51d596=_0x041b[_0x5b4b88];return _0x51d596;};'use strict';var _=require(_0xb041('0x0'));var util=require(_0xb041('0x1'));var moment=require(_0xb041('0x2'));var BPromise=require(_0xb041('0x3'));var rs=require(_0xb041('0x4'));var fs=require('fs');var Redis=require(_0xb041('0x5'));var db=require(_0xb041('0x6'))['db'];var utils=require(_0xb041('0x7'));var logger=require(_0xb041('0x8'))(_0xb041('0x9'));var config=require(_0xb041('0xa'));var jayson=require(_0xb041('0xb'));var client=jayson[_0xb041('0xc')][_0xb041('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x185b40,_0x3fceeb,_0x4a2b2f){return new BPromise(function(_0x49063f,_0x4e950a){return client[_0xb041('0xe')](_0x185b40,_0x4a2b2f)[_0xb041('0xf')](function(_0x4849eb){logger['info'](_0xb041('0x10'),_0x3fceeb,'request\x20sent');logger[_0xb041('0x11')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x3fceeb,_0xb041('0x12'),JSON['stringify'](_0x4849eb));if(_0x4849eb['error']){if(_0x4849eb[_0xb041('0x13')][_0xb041('0x14')]===0x1f4){logger['error'](_0xb041('0x10'),_0x3fceeb,_0x4849eb['error'][_0xb041('0x15')]);return _0x4e950a(_0x4849eb[_0xb041('0x13')][_0xb041('0x15')]);}logger[_0xb041('0x13')](_0xb041('0x10'),_0x3fceeb,_0x4849eb['error'][_0xb041('0x15')]);return _0x49063f(_0x4849eb[_0xb041('0x13')][_0xb041('0x15')]);}else{logger[_0xb041('0x16')]('AnalyticFieldReport,\x20%s,\x20%s',_0x3fceeb,'request\x20sent');_0x49063f(_0x4849eb[_0xb041('0x17')][_0xb041('0x15')]);}})[_0xb041('0x18')](function(_0x52d40d){logger['error'](_0xb041('0x10'),_0x3fceeb,_0x52d40d);_0x4e950a(_0x52d40d);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index 980e748..4100c23 100644 --- a/server/api/analyticFieldReport/index.js +++ b/server/api/analyticFieldReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['delete','/destroy_many','bulkDestroy','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticFieldReport.controller','get','index','/:id','post','/create_many','isAuthenticated','bulkCreate','/:id/create_many','update'];(function(_0x2c986d,_0x589f9f){var _0x7d81ee=function(_0x12a121){while(--_0x12a121){_0x2c986d['push'](_0x2c986d['shift']());}};_0x7d81ee(++_0x589f9f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xa9e0[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0a9e('0xb')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xb')](_0x0a9e('0xf'),auth['isAuthenticated'](),controller['addFields']);router['put']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);module[_0x0a9e('0x15')]=router; \ No newline at end of file +var _0xa9e0=['delete','/destroy_many','bulkDestroy','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticFieldReport.controller','get','index','/:id','post','/create_many','isAuthenticated','bulkCreate','/:id/create_many','update'];(function(_0x511dcb,_0x4b9959){var _0x4bb762=function(_0x351a3c){while(--_0x351a3c){_0x511dcb['push'](_0x511dcb['shift']());}};_0x4bb762(++_0x4b9959);}(_0xa9e0,0x123));var _0x0a9e=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xa9e0[_0x298ed3];return _0x5aad28;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0a9e('0xb')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xb')](_0x0a9e('0xf'),auth['isAuthenticated'](),controller['addFields']);router['put']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);module[_0x0a9e('0x15')]=router; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.attributes.js b/server/api/analyticMetric/analyticMetric.attributes.js index 2e93512..15aecc2 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 _0x6c9f=['STRING','TEXT','sequelize'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0x6c9f,0x16a));var _0xf6c9=function(_0x10fea0,_0x407925){_0x10fea0=_0x10fea0-0x0;var _0x4b057c=_0x6c9f[_0x10fea0];return _0x4b057c;};'use strict';var Sequelize=require(_0xf6c9('0x0'));module['exports']={'name':{'type':Sequelize[_0xf6c9('0x1')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0xf6c9('0x1')]},'metric':{'type':Sequelize[_0xf6c9('0x2')]},'description':{'type':Sequelize[_0xf6c9('0x1')]}}; \ No newline at end of file +var _0xd820=['exports','name','STRING','sequelize'];(function(_0x4bb34c,_0x10b710){var _0x2e7e30=function(_0xe6b477){while(--_0xe6b477){_0x4bb34c['push'](_0x4bb34c['shift']());}};_0x2e7e30(++_0x10b710);}(_0xd820,0x16f));var _0x0d82=function(_0x1db51d,_0x12b986){_0x1db51d=_0x1db51d-0x0;var _0xcf9d61=_0xd820[_0x1db51d];return _0xcf9d61;};'use strict';var Sequelize=require(_0x0d82('0x0'));module[_0x0d82('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x0d82('0x2')},'table':{'type':Sequelize[_0x0d82('0x3')]},'metric':{'type':Sequelize['TEXT']},'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 8bec70c..71e452f 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 _0x9a19=['AnalyticMetric','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','options','find','body','user','UserProfileSection','autoAssociation','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','save','then','destroy','get','Metrics','stack','name','send','index','map'];(function(_0x17a1ed,_0x4372ae){var _0x5d396b=function(_0x4e05dd){while(--_0x4e05dd){_0x17a1ed['push'](_0x17a1ed['shift']());}};_0x5d396b(++_0x4372ae);}(_0x9a19,0x114));var _0x99a1=function(_0x10dc64,_0x11bb29){_0x10dc64=_0x10dc64-0x0;var _0x9cf98d=_0x9a19[_0x10dc64];return _0x9cf98d;};'use strict';var emlformat=require(_0x99a1('0x0'));var rimraf=require(_0x99a1('0x1'));var zipdir=require(_0x99a1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x99a1('0x3'));var moment=require(_0x99a1('0x4'));var BPromise=require(_0x99a1('0x5'));var Mustache=require(_0x99a1('0x6'));var util=require(_0x99a1('0x7'));var path=require(_0x99a1('0x8'));var sox=require(_0x99a1('0x9'));var csv=require(_0x99a1('0xa'));var ejs=require(_0x99a1('0xb'));var fs=require('fs');var fs_extra=require(_0x99a1('0xc'));var _=require(_0x99a1('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x99a1('0xe'));var toCsv=require(_0x99a1('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x99a1('0xf'));var authService=require(_0x99a1('0x10'));var qs=require(_0x99a1('0x11'));var as=require(_0x99a1('0x12'));var hardwareService=require(_0x99a1('0x13'));var logger=require('../../config/logger')(_0x99a1('0x14'));var utils=require(_0x99a1('0x15'));var config=require(_0x99a1('0x16'));var licenseUtil=require(_0x99a1('0x17'));var db=require(_0x99a1('0x18'))['db'];function respondWithStatusCode(_0x1bc7aa,_0x2ff655){_0x2ff655=_0x2ff655||0xcc;return function(_0x532f56){if(_0x532f56){return _0x1bc7aa[_0x99a1('0x19')](_0x2ff655);}return _0x1bc7aa[_0x99a1('0x1a')](_0x2ff655)[_0x99a1('0x1b')]();};}function respondWithResult(_0x47815e,_0xe1a1f){_0xe1a1f=_0xe1a1f||0xc8;return function(_0x3c9ef4){if(_0x3c9ef4){return _0x47815e[_0x99a1('0x1a')](_0xe1a1f)['json'](_0x3c9ef4);}};}function respondWithFilteredResult(_0x2d81ed,_0x3e45d4){return function(_0x1bb464){if(_0x1bb464){var _0x3d40cc=typeof _0x3e45d4[_0x99a1('0x1c')]===_0x99a1('0x1d')&&typeof _0x3e45d4[_0x99a1('0x1e')]==='undefined';var _0x4f049c=_0x1bb464[_0x99a1('0x1f')];var _0xbf62f1=_0x3d40cc?0x0:_0x3e45d4[_0x99a1('0x1c')];var _0x1fcd00=_0x3d40cc?_0x1bb464[_0x99a1('0x1f')]:_0x3e45d4[_0x99a1('0x1c')]+_0x3e45d4[_0x99a1('0x1e')];var _0x3cd62c;if(_0x1fcd00>=_0x4f049c){_0x1fcd00=_0x4f049c;_0x3cd62c=0xc8;}else{_0x3cd62c=0xce;}_0x2d81ed[_0x99a1('0x1a')](_0x3cd62c);return _0x2d81ed[_0x99a1('0x20')](_0x99a1('0x21'),_0xbf62f1+'-'+_0x1fcd00+'/'+_0x4f049c)['json'](_0x1bb464);}return null;};}function patchUpdates(_0x3023a1){return function(_0x20007e){try{jsonpatch['apply'](_0x20007e,_0x3023a1,!![]);}catch(_0x38435b){return BPromise['reject'](_0x38435b);}return _0x20007e[_0x99a1('0x22')]();};}function saveUpdates(_0x2927b0,_0x2d6f20){return function(_0x2d3b82){if(_0x2d3b82){return _0x2d3b82['update'](_0x2927b0)[_0x99a1('0x23')](function(_0x1268a7){return _0x1268a7;});}return null;};}function removeEntity(_0x483c17,_0x44df2d){return function(_0x5b5dfa){if(_0x5b5dfa){return _0x5b5dfa[_0x99a1('0x24')]()[_0x99a1('0x23')](function(){var _0x179597=_0x5b5dfa[_0x99a1('0x25')]({'plain':!![]});var _0x3c813=_0x99a1('0x26');return db['UserProfileResource'][_0x99a1('0x24')]({'where':{'type':_0x3c813,'resourceId':_0x179597['id']}})['then'](function(){return _0x5b5dfa;});})['then'](function(){_0x483c17[_0x99a1('0x1a')](0xcc)[_0x99a1('0x1b')]();});}};}function handleEntityNotFound(_0xa6799b,_0x15a0b6){return function(_0x25d560){if(!_0x25d560){_0xa6799b[_0x99a1('0x19')](0x194);}return _0x25d560;};}function handleError(_0x183037,_0x549645){_0x549645=_0x549645||0x1f4;return function(_0xf41b0d){logger['error'](_0xf41b0d[_0x99a1('0x27')]);if(_0xf41b0d[_0x99a1('0x28')]){delete _0xf41b0d[_0x99a1('0x28')];}_0x183037['status'](_0x549645)[_0x99a1('0x29')](_0xf41b0d);};}exports[_0x99a1('0x2a')]=function(_0x5718b9,_0x37514e){var _0x1434a0={},_0x36aa34={},_0x303d1e={'count':0x0,'rows':[]};var _0x2a5b8c=_[_0x99a1('0x2b')](db[_0x99a1('0x2c')][_0x99a1('0x2d')],function(_0x52da8d){return{'name':_0x52da8d['fieldName'],'type':_0x52da8d[_0x99a1('0x2e')]['key']};});_0x36aa34[_0x99a1('0x2f')]=_[_0x99a1('0x2b')](_0x2a5b8c,'name');_0x36aa34[_0x99a1('0x30')]=_[_0x99a1('0x31')](_0x5718b9[_0x99a1('0x30')]);_0x36aa34[_0x99a1('0x32')]=_[_0x99a1('0x33')](_0x36aa34[_0x99a1('0x2f')],_0x36aa34[_0x99a1('0x30')]);_0x1434a0[_0x99a1('0x34')]=_[_0x99a1('0x33')](_0x36aa34[_0x99a1('0x2f')],qs[_0x99a1('0x35')](_0x5718b9[_0x99a1('0x30')][_0x99a1('0x35')]));_0x1434a0[_0x99a1('0x34')]=_0x1434a0['attributes']['length']?_0x1434a0[_0x99a1('0x34')]:_0x36aa34[_0x99a1('0x2f')];if(!_0x5718b9[_0x99a1('0x30')][_0x99a1('0x36')](_0x99a1('0x37'))){_0x1434a0[_0x99a1('0x1e')]=qs[_0x99a1('0x1e')](_0x5718b9['query'][_0x99a1('0x1e')]);_0x1434a0[_0x99a1('0x1c')]=qs['offset'](_0x5718b9[_0x99a1('0x30')][_0x99a1('0x1c')]);}_0x1434a0[_0x99a1('0x38')]=qs[_0x99a1('0x39')](_0x5718b9[_0x99a1('0x30')][_0x99a1('0x39')]);_0x1434a0[_0x99a1('0x3a')]=qs[_0x99a1('0x32')](_[_0x99a1('0x3b')](_0x5718b9[_0x99a1('0x30')],_0x36aa34[_0x99a1('0x32')]),_0x2a5b8c);if(_0x5718b9[_0x99a1('0x30')][_0x99a1('0x3c')]){_0x1434a0['where']=_['merge'](_0x1434a0['where'],{'$or':_[_0x99a1('0x2b')](_0x2a5b8c,function(_0x169df7){if(_0x169df7[_0x99a1('0x2e')]!==_0x99a1('0x3d')){var _0x40613a={};_0x40613a[_0x169df7['name']]={'$like':'%'+_0x5718b9[_0x99a1('0x30')][_0x99a1('0x3c')]+'%'};return _0x40613a;}})});}_0x1434a0=_[_0x99a1('0x3e')]({},_0x1434a0,_0x5718b9['options']);var _0x49be37={'where':_0x1434a0[_0x99a1('0x3a')]};return db[_0x99a1('0x2c')][_0x99a1('0x1f')](_0x49be37)['then'](function(_0x6c4cb){_0x303d1e[_0x99a1('0x1f')]=_0x6c4cb;if(_0x5718b9[_0x99a1('0x30')][_0x99a1('0x3f')]){_0x1434a0[_0x99a1('0x40')]=[{'all':!![]}];}return db[_0x99a1('0x2c')][_0x99a1('0x41')](_0x1434a0);})[_0x99a1('0x23')](function(_0x1c4ce4){_0x303d1e[_0x99a1('0x42')]=_0x1c4ce4;return _0x303d1e;})['then'](respondWithFilteredResult(_0x37514e,_0x1434a0))[_0x99a1('0x43')](handleError(_0x37514e,null));};exports[_0x99a1('0x44')]=function(_0x3d5373,_0x50d38b){var _0x1beed2={'raw':!![],'where':{'id':_0x3d5373[_0x99a1('0x45')]['id']}},_0x51536d={};_0x51536d[_0x99a1('0x2f')]=_[_0x99a1('0x31')](db[_0x99a1('0x2c')][_0x99a1('0x2d')]);_0x51536d[_0x99a1('0x30')]=_['keys'](_0x3d5373[_0x99a1('0x30')]);_0x51536d['filters']=_[_0x99a1('0x33')](_0x51536d[_0x99a1('0x2f')],_0x51536d[_0x99a1('0x30')]);_0x1beed2[_0x99a1('0x34')]=_[_0x99a1('0x33')](_0x51536d[_0x99a1('0x2f')],qs[_0x99a1('0x35')](_0x3d5373[_0x99a1('0x30')][_0x99a1('0x35')]));_0x1beed2[_0x99a1('0x34')]=_0x1beed2[_0x99a1('0x34')]['length']?_0x1beed2[_0x99a1('0x34')]:_0x51536d[_0x99a1('0x2f')];if(_0x3d5373['query'][_0x99a1('0x3f')]){_0x1beed2[_0x99a1('0x40')]=[{'all':!![]}];}_0x1beed2=_[_0x99a1('0x3e')]({},_0x1beed2,_0x3d5373[_0x99a1('0x46')]);return db[_0x99a1('0x2c')][_0x99a1('0x47')](_0x1beed2)[_0x99a1('0x23')](handleEntityNotFound(_0x50d38b,null))['then'](respondWithResult(_0x50d38b,null))[_0x99a1('0x43')](handleError(_0x50d38b,null));};exports['create']=function(_0x1d4d3f,_0x269798){return db['AnalyticMetric']['create'](_0x1d4d3f[_0x99a1('0x48')],{})[_0x99a1('0x23')](function(_0x462c15){var _0x4519fb=_0x1d4d3f[_0x99a1('0x49')]['get']({'plain':!![]});if(!_0x4519fb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4519fb['role']===_0x99a1('0x49')){var _0x4ae90e=_0x462c15[_0x99a1('0x25')]({'plain':!![]});var _0x30fdfb=_0x99a1('0x26');return db[_0x99a1('0x4a')][_0x99a1('0x47')]({'where':{'name':_0x30fdfb,'userProfileId':_0x4519fb['userProfileId']},'raw':!![]})[_0x99a1('0x23')](function(_0x22bfd8){if(_0x22bfd8&&_0x22bfd8[_0x99a1('0x4b')]===0x0){return db['UserProfileResource'][_0x99a1('0x4c')]({'name':_0x4ae90e['name'],'resourceId':_0x4ae90e['id'],'type':_0x22bfd8['name'],'sectionId':_0x22bfd8['id']},{})[_0x99a1('0x23')](function(){return _0x462c15;});}else{return _0x462c15;}})[_0x99a1('0x43')](function(_0x1dd17b){logger[_0x99a1('0x4d')](_0x99a1('0x4e'),_0x1dd17b);throw _0x1dd17b;});}return _0x462c15;})[_0x99a1('0x23')](respondWithResult(_0x269798,0xc9))[_0x99a1('0x43')](handleError(_0x269798,null));};exports[_0x99a1('0x4f')]=function(_0x16641e,_0x53e9eb){if(_0x16641e[_0x99a1('0x48')]['id']){delete _0x16641e['body']['id'];}return db[_0x99a1('0x2c')][_0x99a1('0x47')]({'where':{'id':_0x16641e['params']['id']}})[_0x99a1('0x23')](handleEntityNotFound(_0x53e9eb,null))[_0x99a1('0x23')](saveUpdates(_0x16641e[_0x99a1('0x48')],null))[_0x99a1('0x23')](respondWithResult(_0x53e9eb,null))[_0x99a1('0x43')](handleError(_0x53e9eb,null));};exports[_0x99a1('0x24')]=function(_0x157c49,_0x1a5658){return db[_0x99a1('0x2c')][_0x99a1('0x47')]({'where':{'id':_0x157c49[_0x99a1('0x45')]['id']}})[_0x99a1('0x23')](handleEntityNotFound(_0x1a5658,null))['then'](removeEntity(_0x1a5658,null))['catch'](handleError(_0x1a5658,null));}; \ No newline at end of file +var _0xdc97=['mustache','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','update','then','get','destroy','sendStatus','error','stack','name','send','AnalyticMetric','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','length','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','includeAll','findAll','rows','catch','params','keys','fields','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Metrics','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','eml-format','rimraf','zip-dir','request-promise','bluebird'];(function(_0x40188c,_0x11495b){var _0x5b65c5=function(_0x437e51){while(--_0x437e51){_0x40188c['push'](_0x40188c['shift']());}};_0x5b65c5(++_0x11495b);}(_0xdc97,0x13b));var _0x7dc9=function(_0x55c4cf,_0x3653c7){_0x55c4cf=_0x55c4cf-0x0;var _0x33dab6=_0xdc97[_0x55c4cf];return _0x33dab6;};'use strict';var emlformat=require(_0x7dc9('0x0'));var rimraf=require(_0x7dc9('0x1'));var zipdir=require(_0x7dc9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7dc9('0x3'));var moment=require('moment');var BPromise=require(_0x7dc9('0x4'));var Mustache=require(_0x7dc9('0x5'));var util=require('util');var path=require(_0x7dc9('0x6'));var sox=require(_0x7dc9('0x7'));var csv=require(_0x7dc9('0x8'));var ejs=require(_0x7dc9('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7dc9('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7dc9('0xb'));var deskjs=require(_0x7dc9('0xc'));var toCsv=require(_0x7dc9('0x8'));var querystring=require(_0x7dc9('0xd'));var Papa=require(_0x7dc9('0xe'));var Redis=require('ioredis');var authService=require(_0x7dc9('0xf'));var qs=require(_0x7dc9('0x10'));var as=require(_0x7dc9('0x11'));var hardwareService=require(_0x7dc9('0x12'));var logger=require(_0x7dc9('0x13'))(_0x7dc9('0x14'));var utils=require(_0x7dc9('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x599ef1,_0x94c75a){_0x94c75a=_0x94c75a||0xcc;return function(_0x14e5db){if(_0x14e5db){return _0x599ef1['sendStatus'](_0x94c75a);}return _0x599ef1[_0x7dc9('0x16')](_0x94c75a)[_0x7dc9('0x17')]();};}function respondWithResult(_0xaadf2,_0xf37bc7){_0xf37bc7=_0xf37bc7||0xc8;return function(_0x31d43d){if(_0x31d43d){return _0xaadf2[_0x7dc9('0x16')](_0xf37bc7)['json'](_0x31d43d);}};}function respondWithFilteredResult(_0x3a54f2,_0x278191){return function(_0x1b0aa1){if(_0x1b0aa1){var _0x442819=typeof _0x278191[_0x7dc9('0x18')]===_0x7dc9('0x19')&&typeof _0x278191[_0x7dc9('0x1a')]===_0x7dc9('0x19');var _0x4778d5=_0x1b0aa1['count'];var _0x22577e=_0x442819?0x0:_0x278191['offset'];var _0x1f5906=_0x442819?_0x1b0aa1[_0x7dc9('0x1b')]:_0x278191['offset']+_0x278191[_0x7dc9('0x1a')];var _0x3b738a;if(_0x1f5906>=_0x4778d5){_0x1f5906=_0x4778d5;_0x3b738a=0xc8;}else{_0x3b738a=0xce;}_0x3a54f2[_0x7dc9('0x16')](_0x3b738a);return _0x3a54f2[_0x7dc9('0x1c')](_0x7dc9('0x1d'),_0x22577e+'-'+_0x1f5906+'/'+_0x4778d5)[_0x7dc9('0x1e')](_0x1b0aa1);}return null;};}function patchUpdates(_0x2dad65){return function(_0x2895f5){try{jsonpatch[_0x7dc9('0x1f')](_0x2895f5,_0x2dad65,!![]);}catch(_0x2b38d6){return BPromise['reject'](_0x2b38d6);}return _0x2895f5['save']();};}function saveUpdates(_0x12954f,_0x5981e2){return function(_0x596e0f){if(_0x596e0f){return _0x596e0f[_0x7dc9('0x20')](_0x12954f)[_0x7dc9('0x21')](function(_0x5e9525){return _0x5e9525;});}return null;};}function removeEntity(_0xffc080,_0x43d31f){return function(_0x41110a){if(_0x41110a){return _0x41110a['destroy']()[_0x7dc9('0x21')](function(){var _0x1e3a8d=_0x41110a[_0x7dc9('0x22')]({'plain':!![]});var _0x55a482='Metrics';return db['UserProfileResource'][_0x7dc9('0x23')]({'where':{'type':_0x55a482,'resourceId':_0x1e3a8d['id']}})[_0x7dc9('0x21')](function(){return _0x41110a;});})['then'](function(){_0xffc080['status'](0xcc)[_0x7dc9('0x17')]();});}};}function handleEntityNotFound(_0x5afb7d,_0x2d22eb){return function(_0x1c690b){if(!_0x1c690b){_0x5afb7d[_0x7dc9('0x24')](0x194);}return _0x1c690b;};}function handleError(_0x3e4102,_0xa2aaa9){_0xa2aaa9=_0xa2aaa9||0x1f4;return function(_0x450124){logger[_0x7dc9('0x25')](_0x450124[_0x7dc9('0x26')]);if(_0x450124[_0x7dc9('0x27')]){delete _0x450124[_0x7dc9('0x27')];}_0x3e4102[_0x7dc9('0x16')](_0xa2aaa9)[_0x7dc9('0x28')](_0x450124);};}exports['index']=function(_0x4e929c,_0x513dd6){var _0x49a4a5={},_0x4a68f0={},_0x553a03={'count':0x0,'rows':[]};var _0x58c4e8=_['map'](db[_0x7dc9('0x29')][_0x7dc9('0x2a')],function(_0x29dcef){return{'name':_0x29dcef[_0x7dc9('0x2b')],'type':_0x29dcef[_0x7dc9('0x2c')][_0x7dc9('0x2d')]};});_0x4a68f0['model']=_['map'](_0x58c4e8,'name');_0x4a68f0[_0x7dc9('0x2e')]=_['keys'](_0x4e929c[_0x7dc9('0x2e')]);_0x4a68f0[_0x7dc9('0x2f')]=_[_0x7dc9('0x30')](_0x4a68f0[_0x7dc9('0x31')],_0x4a68f0[_0x7dc9('0x2e')]);_0x49a4a5[_0x7dc9('0x32')]=_[_0x7dc9('0x30')](_0x4a68f0[_0x7dc9('0x31')],qs['fields'](_0x4e929c[_0x7dc9('0x2e')]['fields']));_0x49a4a5[_0x7dc9('0x32')]=_0x49a4a5[_0x7dc9('0x32')][_0x7dc9('0x33')]?_0x49a4a5[_0x7dc9('0x32')]:_0x4a68f0['model'];if(!_0x4e929c[_0x7dc9('0x2e')]['hasOwnProperty'](_0x7dc9('0x34'))){_0x49a4a5['limit']=qs['limit'](_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x1a')]);_0x49a4a5[_0x7dc9('0x18')]=qs[_0x7dc9('0x18')](_0x4e929c['query'][_0x7dc9('0x18')]);}_0x49a4a5[_0x7dc9('0x35')]=qs[_0x7dc9('0x36')](_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x36')]);_0x49a4a5[_0x7dc9('0x37')]=qs[_0x7dc9('0x2f')](_[_0x7dc9('0x38')](_0x4e929c[_0x7dc9('0x2e')],_0x4a68f0[_0x7dc9('0x2f')]),_0x58c4e8);if(_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x39')]){_0x49a4a5['where']=_[_0x7dc9('0x3a')](_0x49a4a5[_0x7dc9('0x37')],{'$or':_[_0x7dc9('0x3b')](_0x58c4e8,function(_0xfd2612){if(_0xfd2612['type']!==_0x7dc9('0x3c')){var _0x89db0e={};_0x89db0e[_0xfd2612[_0x7dc9('0x27')]]={'$like':'%'+_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x39')]+'%'};return _0x89db0e;}})});}_0x49a4a5=_[_0x7dc9('0x3a')]({},_0x49a4a5,_0x4e929c['options']);var _0x553230={'where':_0x49a4a5[_0x7dc9('0x37')]};return db[_0x7dc9('0x29')]['count'](_0x553230)[_0x7dc9('0x21')](function(_0x4a37ec){_0x553a03[_0x7dc9('0x1b')]=_0x4a37ec;if(_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x3d')]){_0x49a4a5['include']=[{'all':!![]}];}return db[_0x7dc9('0x29')][_0x7dc9('0x3e')](_0x49a4a5);})[_0x7dc9('0x21')](function(_0x95513c){_0x553a03[_0x7dc9('0x3f')]=_0x95513c;return _0x553a03;})[_0x7dc9('0x21')](respondWithFilteredResult(_0x513dd6,_0x49a4a5))[_0x7dc9('0x40')](handleError(_0x513dd6,null));};exports['show']=function(_0x187aa6,_0x4f29b2){var _0x52d883={'raw':!![],'where':{'id':_0x187aa6[_0x7dc9('0x41')]['id']}},_0xcced6c={};_0xcced6c[_0x7dc9('0x31')]=_[_0x7dc9('0x42')](db[_0x7dc9('0x29')][_0x7dc9('0x2a')]);_0xcced6c[_0x7dc9('0x2e')]=_[_0x7dc9('0x42')](_0x187aa6[_0x7dc9('0x2e')]);_0xcced6c['filters']=_[_0x7dc9('0x30')](_0xcced6c[_0x7dc9('0x31')],_0xcced6c[_0x7dc9('0x2e')]);_0x52d883[_0x7dc9('0x32')]=_[_0x7dc9('0x30')](_0xcced6c[_0x7dc9('0x31')],qs['fields'](_0x187aa6[_0x7dc9('0x2e')][_0x7dc9('0x43')]));_0x52d883['attributes']=_0x52d883[_0x7dc9('0x32')][_0x7dc9('0x33')]?_0x52d883[_0x7dc9('0x32')]:_0xcced6c['model'];if(_0x187aa6[_0x7dc9('0x2e')]['includeAll']){_0x52d883['include']=[{'all':!![]}];}_0x52d883=_[_0x7dc9('0x3a')]({},_0x52d883,_0x187aa6[_0x7dc9('0x44')]);return db[_0x7dc9('0x29')]['find'](_0x52d883)['then'](handleEntityNotFound(_0x4f29b2,null))[_0x7dc9('0x21')](respondWithResult(_0x4f29b2,null))['catch'](handleError(_0x4f29b2,null));};exports[_0x7dc9('0x45')]=function(_0x4ab558,_0x5e2d59){return db[_0x7dc9('0x29')][_0x7dc9('0x45')](_0x4ab558[_0x7dc9('0x46')],{})[_0x7dc9('0x21')](function(_0x414bf4){var _0x113087=_0x4ab558[_0x7dc9('0x47')][_0x7dc9('0x22')]({'plain':!![]});if(!_0x113087)throw new Error(_0x7dc9('0x48'));if(_0x113087[_0x7dc9('0x49')]===_0x7dc9('0x47')){var _0x13580b=_0x414bf4[_0x7dc9('0x22')]({'plain':!![]});var _0x59be9b=_0x7dc9('0x4a');return db['UserProfileSection']['find']({'where':{'name':_0x59be9b,'userProfileId':_0x113087[_0x7dc9('0x4b')]},'raw':!![]})[_0x7dc9('0x21')](function(_0x40e382){if(_0x40e382&&_0x40e382[_0x7dc9('0x4c')]===0x0){return db[_0x7dc9('0x4d')]['create']({'name':_0x13580b[_0x7dc9('0x27')],'resourceId':_0x13580b['id'],'type':_0x40e382[_0x7dc9('0x27')],'sectionId':_0x40e382['id']},{})[_0x7dc9('0x21')](function(){return _0x414bf4;});}else{return _0x414bf4;}})['catch'](function(_0x341909){logger[_0x7dc9('0x25')](_0x7dc9('0x4e'),_0x341909);throw _0x341909;});}return _0x414bf4;})[_0x7dc9('0x21')](respondWithResult(_0x5e2d59,0xc9))[_0x7dc9('0x40')](handleError(_0x5e2d59,null));};exports[_0x7dc9('0x20')]=function(_0x593132,_0x366b8b){if(_0x593132[_0x7dc9('0x46')]['id']){delete _0x593132[_0x7dc9('0x46')]['id'];}return db[_0x7dc9('0x29')][_0x7dc9('0x4f')]({'where':{'id':_0x593132[_0x7dc9('0x41')]['id']}})[_0x7dc9('0x21')](handleEntityNotFound(_0x366b8b,null))[_0x7dc9('0x21')](saveUpdates(_0x593132[_0x7dc9('0x46')],null))[_0x7dc9('0x21')](respondWithResult(_0x366b8b,null))[_0x7dc9('0x40')](handleError(_0x366b8b,null));};exports[_0x7dc9('0x23')]=function(_0x4fec6e,_0x1767b6){return db[_0x7dc9('0x29')][_0x7dc9('0x4f')]({'where':{'id':_0x4fec6e[_0x7dc9('0x41')]['id']}})[_0x7dc9('0x21')](handleEntityNotFound(_0x1767b6,null))['then'](removeEntity(_0x1767b6,null))[_0x7dc9('0x40')](handleError(_0x1767b6,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 7337671..b9e488c 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 _0xaee6=['analytics_metrics','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','define','AnalyticMetric'];(function(_0x28d4bb,_0x5af4ab){var _0x37063a=function(_0x19616b){while(--_0x19616b){_0x28d4bb['push'](_0x28d4bb['shift']());}};_0x37063a(++_0x5af4ab);}(_0xaee6,0x187));var _0x6aee=function(_0x505257,_0x53a897){_0x505257=_0x505257-0x0;var _0x1a225c=_0xaee6[_0x505257];return _0x1a225c;};'use strict';var _=require(_0x6aee('0x0'));var util=require(_0x6aee('0x1'));var logger=require(_0x6aee('0x2'))(_0x6aee('0x3'));var moment=require(_0x6aee('0x4'));var BPromise=require(_0x6aee('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6aee('0x6'));var rimraf=require(_0x6aee('0x7'));var config=require(_0x6aee('0x8'));var attributes=require('./analyticMetric.attributes');module[_0x6aee('0x9')]=function(_0x377d0b,_0x2eec1b){return _0x377d0b[_0x6aee('0xa')](_0x6aee('0xb'),attributes,{'tableName':_0x6aee('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa49e=['AnalyticMetric','analytics_metrics','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./analyticMetric.attributes','exports','define'];(function(_0xceb07e,_0x477b78){var _0x13a311=function(_0x351a89){while(--_0x351a89){_0xceb07e['push'](_0xceb07e['shift']());}};_0x13a311(++_0x477b78);}(_0xa49e,0x1de));var _0xea49=function(_0x2a99f1,_0x198fd7){_0x2a99f1=_0x2a99f1-0x0;var _0x6948e5=_0xa49e[_0x2a99f1];return _0x6948e5;};'use strict';var _=require(_0xea49('0x0'));var util=require(_0xea49('0x1'));var logger=require(_0xea49('0x2'))(_0xea49('0x3'));var moment=require(_0xea49('0x4'));var BPromise=require(_0xea49('0x5'));var rp=require(_0xea49('0x6'));var fs=require('fs');var path=require(_0xea49('0x7'));var rimraf=require('rimraf');var config=require(_0xea49('0x8'));var attributes=require(_0xea49('0x9'));module[_0xea49('0xa')]=function(_0x56a45a,_0x1b831c){return _0x56a45a[_0xea49('0xb')](_0xea49('0xc'),attributes,{'tableName':_0xea49('0xd'),'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 095c8d3..665670f 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 _0xed66=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','AnalyticMetric,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird'];(function(_0x3a508a,_0x358c16){var _0x5a8c34=function(_0x162832){while(--_0x162832){_0x3a508a['push'](_0x3a508a['shift']());}};_0x5a8c34(++_0x358c16);}(_0xed66,0x82));var _0x6ed6=function(_0x23d0a1,_0x5011a){_0x23d0a1=_0x23d0a1-0x0;var _0x1ef866=_0xed66[_0x23d0a1];return _0x1ef866;};'use strict';var _=require('lodash');var util=require(_0x6ed6('0x0'));var moment=require(_0x6ed6('0x1'));var BPromise=require(_0x6ed6('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6ed6('0x3'));var db=require(_0x6ed6('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x6ed6('0x5'))(_0x6ed6('0x6'));var config=require(_0x6ed6('0x7'));var jayson=require(_0x6ed6('0x8'));var client=jayson[_0x6ed6('0x9')][_0x6ed6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x19385a,_0x5a6dad,_0x243047){return new BPromise(function(_0x38b1a5,_0x481094){return client['request'](_0x19385a,_0x243047)['then'](function(_0x29d3c4){logger[_0x6ed6('0xb')](_0x6ed6('0xc'),_0x5a6dad,_0x6ed6('0xd'));logger['debug'](_0x6ed6('0xe'),_0x5a6dad,_0x6ed6('0xd'),JSON['stringify'](_0x29d3c4));if(_0x29d3c4['error']){if(_0x29d3c4[_0x6ed6('0xf')][_0x6ed6('0x10')]===0x1f4){logger[_0x6ed6('0xf')](_0x6ed6('0xc'),_0x5a6dad,_0x29d3c4['error'][_0x6ed6('0x11')]);return _0x481094(_0x29d3c4[_0x6ed6('0xf')][_0x6ed6('0x11')]);}logger[_0x6ed6('0xf')]('AnalyticMetric,\x20%s,\x20%s',_0x5a6dad,_0x29d3c4[_0x6ed6('0xf')][_0x6ed6('0x11')]);return _0x38b1a5(_0x29d3c4[_0x6ed6('0xf')]['message']);}else{logger[_0x6ed6('0xb')](_0x6ed6('0xc'),_0x5a6dad,_0x6ed6('0xd'));_0x38b1a5(_0x29d3c4['result']['message']);}})[_0x6ed6('0x12')](function(_0x4487bc){logger[_0x6ed6('0xf')](_0x6ed6('0xc'),_0x5a6dad,_0x4487bc);_0x481094(_0x4487bc);});});} \ No newline at end of file +var _0x89fc=['error','info','catch','util','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','request','request\x20sent','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','AnalyticMetric,\x20%s,\x20%s','message'];(function(_0x4c55d0,_0x54fa46){var _0x190fcf=function(_0x4081f1){while(--_0x4081f1){_0x4c55d0['push'](_0x4c55d0['shift']());}};_0x190fcf(++_0x54fa46);}(_0x89fc,0xb7));var _0xc89f=function(_0x19d9f7,_0x51e52c){_0x19d9f7=_0x19d9f7-0x0;var _0xa75e46=_0x89fc[_0x19d9f7];return _0xa75e46;};'use strict';var _=require('lodash');var util=require(_0xc89f('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc89f('0x1'));var db=require(_0xc89f('0x2'))['db'];var utils=require(_0xc89f('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0xc89f('0x4'));var jayson=require('jayson/promise');var client=jayson[_0xc89f('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x341cd4,_0x2c0fc0,_0x566f7b){return new BPromise(function(_0x26a390,_0x250d3a){return client[_0xc89f('0x6')](_0x341cd4,_0x566f7b)['then'](function(_0x23a8c3){logger['info']('AnalyticMetric,\x20%s,\x20%s',_0x2c0fc0,_0xc89f('0x7'));logger['debug'](_0xc89f('0x8'),_0x2c0fc0,_0xc89f('0x7'),JSON[_0xc89f('0x9')](_0x23a8c3));if(_0x23a8c3['error']){if(_0x23a8c3['error']['code']===0x1f4){logger['error'](_0xc89f('0xa'),_0x2c0fc0,_0x23a8c3['error'][_0xc89f('0xb')]);return _0x250d3a(_0x23a8c3[_0xc89f('0xc')][_0xc89f('0xb')]);}logger[_0xc89f('0xc')](_0xc89f('0xa'),_0x2c0fc0,_0x23a8c3[_0xc89f('0xc')]['message']);return _0x26a390(_0x23a8c3[_0xc89f('0xc')][_0xc89f('0xb')]);}else{logger[_0xc89f('0xd')]('AnalyticMetric,\x20%s,\x20%s',_0x2c0fc0,_0xc89f('0x7'));_0x26a390(_0x23a8c3['result']['message']);}})[_0xc89f('0xe')](function(_0x39a6a0){logger[_0xc89f('0xc')](_0xc89f('0xa'),_0x2c0fc0,_0x39a6a0);_0x250d3a(_0x39a6a0);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 3ef575a..c9935ac 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 _0xe647=['isAuthenticated','/:id','show','post','create','put','destroy','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get'];(function(_0x560c68,_0x2f15af){var _0x3f7e1f=function(_0x1b2b60){while(--_0x1b2b60){_0x560c68['push'](_0x560c68['shift']());}};_0x3f7e1f(++_0x2f15af);}(_0xe647,0x16d));var _0x7e64=function(_0x10460f,_0x457193){_0x10460f=_0x10460f-0x0;var _0x61a56f=_0xe647[_0x10460f];return _0x61a56f;};'use strict';var multer=require(_0x7e64('0x0'));var util=require(_0x7e64('0x1'));var path=require('path');var timeout=require(_0x7e64('0x2'));var express=require(_0x7e64('0x3'));var router=express[_0x7e64('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x7e64('0x5'));var config=require(_0x7e64('0x6'));var controller=require(_0x7e64('0x7'));router[_0x7e64('0x8')]('/',auth[_0x7e64('0x9')](),controller['index']);router[_0x7e64('0x8')](_0x7e64('0xa'),auth[_0x7e64('0x9')](),controller[_0x7e64('0xb')]);router[_0x7e64('0xc')]('/',auth[_0x7e64('0x9')](),controller[_0x7e64('0xd')]);router[_0x7e64('0xe')](_0x7e64('0xa'),auth[_0x7e64('0x9')](),controller['update']);router['delete']('/:id',auth[_0x7e64('0x9')](),controller[_0x7e64('0xf')]);module[_0x7e64('0x10')]=router; \ No newline at end of file +var _0x3248=['Router','fs-extra','../../config/environment','./analyticMetric.controller','isAuthenticated','index','get','/:id','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x527783,_0x1c904c){var _0x1f9965=function(_0x584601){while(--_0x584601){_0x527783['push'](_0x527783['shift']());}};_0x1f9965(++_0x1c904c);}(_0x3248,0x1b0));var _0x8324=function(_0x239315,_0x493e51){_0x239315=_0x239315-0x0;var _0x5a11ca=_0x3248[_0x239315];return _0x5a11ca;};'use strict';var multer=require(_0x8324('0x0'));var util=require(_0x8324('0x1'));var path=require(_0x8324('0x2'));var timeout=require(_0x8324('0x3'));var express=require(_0x8324('0x4'));var router=express[_0x8324('0x5')]();var fs_extra=require(_0x8324('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8324('0x7'));var controller=require(_0x8324('0x8'));router['get']('/',auth[_0x8324('0x9')](),controller[_0x8324('0xa')]);router[_0x8324('0xb')](_0x8324('0xc'),auth[_0x8324('0x9')](),controller['show']);router[_0x8324('0xd')]('/',auth[_0x8324('0x9')](),controller[_0x8324('0xe')]);router['put']('/:id',auth[_0x8324('0x9')](),controller[_0x8324('0xf')]);router[_0x8324('0x10')]('/:id',auth[_0x8324('0x9')](),controller[_0x8324('0x11')]);module[_0x8324('0x12')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index 49df490..9e64afb 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 _0xa8cf=['TEXT','sequelize'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa8cf,0x1cb));var _0xfa8c=function(_0x2880d8,_0x284ded){_0x2880d8=_0x2880d8-0x0;var _0x51f5a9=_0xa8cf[_0x2880d8];return _0x51f5a9;};'use strict';var Sequelize=require(_0xfa8c('0x0'));module['exports']={'tree':{'type':Sequelize[_0xfa8c('0x1')],'allowNull':![]}}; \ No newline at end of file +'use strict';var Sequelize=require('sequelize');module['exports']={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index b33bad0..7fe3b01 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 _0xb272=['util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','update','then','destroy','error','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','attributes','intersection','fields','length','model','order','sort','where','pick','filter','merge','VIRTUAL','options','AnalyticTreeReport','includeAll','include','findAll','show','find','catch','create','body','params','request-promise','bluebird','mustache'];(function(_0x4e7d25,_0x58285f){var _0x526fe6=function(_0x4f0aec){while(--_0x4f0aec){_0x4e7d25['push'](_0x4e7d25['shift']());}};_0x526fe6(++_0x58285f);}(_0xb272,0xd2));var _0x2b27=function(_0x2f7e42,_0x4aa0cf){_0x2f7e42=_0x2f7e42-0x0;var _0x1ac0d3=_0xb272[_0x2f7e42];return _0x1ac0d3;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x2b27('0x0'));var moment=require('moment');var BPromise=require(_0x2b27('0x1'));var Mustache=require(_0x2b27('0x2'));var util=require(_0x2b27('0x3'));var path=require(_0x2b27('0x4'));var sox=require(_0x2b27('0x5'));var csv=require(_0x2b27('0x6'));var ejs=require(_0x2b27('0x7'));var fs=require('fs');var fs_extra=require(_0x2b27('0x8'));var _=require(_0x2b27('0x9'));var squel=require(_0x2b27('0xa'));var crypto=require(_0x2b27('0xb'));var jsforce=require(_0x2b27('0xc'));var deskjs=require(_0x2b27('0xd'));var toCsv=require(_0x2b27('0x6'));var querystring=require(_0x2b27('0xe'));var Papa=require(_0x2b27('0xf'));var Redis=require(_0x2b27('0x10'));var authService=require(_0x2b27('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x2b27('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2b27('0x13'));var utils=require(_0x2b27('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x2b27('0x15'));var db=require(_0x2b27('0x16'))['db'];function respondWithStatusCode(_0x2817a4,_0x4cc4e3){_0x4cc4e3=_0x4cc4e3||0xcc;return function(_0x42c7e2){if(_0x42c7e2){return _0x2817a4[_0x2b27('0x17')](_0x4cc4e3);}return _0x2817a4[_0x2b27('0x18')](_0x4cc4e3)[_0x2b27('0x19')]();};}function respondWithResult(_0x309d74,_0x555898){_0x555898=_0x555898||0xc8;return function(_0x269321){if(_0x269321){return _0x309d74[_0x2b27('0x18')](_0x555898)[_0x2b27('0x1a')](_0x269321);}};}function respondWithFilteredResult(_0x261905,_0x374bb0){return function(_0x317ea5){if(_0x317ea5){var _0x2d37e9=typeof _0x374bb0[_0x2b27('0x1b')]===_0x2b27('0x1c')&&typeof _0x374bb0[_0x2b27('0x1d')]===_0x2b27('0x1c');var _0x52190e=_0x317ea5[_0x2b27('0x1e')];var _0x5991b1=_0x2d37e9?0x0:_0x374bb0[_0x2b27('0x1b')];var _0x3e8e4e=_0x2d37e9?_0x317ea5[_0x2b27('0x1e')]:_0x374bb0[_0x2b27('0x1b')]+_0x374bb0[_0x2b27('0x1d')];var _0x23465e;if(_0x3e8e4e>=_0x52190e){_0x3e8e4e=_0x52190e;_0x23465e=0xc8;}else{_0x23465e=0xce;}_0x261905['status'](_0x23465e);return _0x261905['set']('Content-Range',_0x5991b1+'-'+_0x3e8e4e+'/'+_0x52190e)['json'](_0x317ea5);}return null;};}function patchUpdates(_0x14474e){return function(_0x54fdcd){try{jsonpatch[_0x2b27('0x1f')](_0x54fdcd,_0x14474e,!![]);}catch(_0x4bd6b9){return BPromise[_0x2b27('0x20')](_0x4bd6b9);}return _0x54fdcd['save']();};}function saveUpdates(_0x43a13f,_0x405d61){return function(_0x76906){if(_0x76906){return _0x76906[_0x2b27('0x21')](_0x43a13f)[_0x2b27('0x22')](function(_0x333b64){return _0x333b64;});}return null;};}function removeEntity(_0x1bb08d,_0x2cf485){return function(_0x338e10){if(_0x338e10){return _0x338e10[_0x2b27('0x23')]()[_0x2b27('0x22')](function(){_0x1bb08d[_0x2b27('0x18')](0xcc)[_0x2b27('0x19')]();});}};}function handleEntityNotFound(_0x199f67,_0x319d35){return function(_0x2e56db){if(!_0x2e56db){_0x199f67[_0x2b27('0x17')](0x194);}return _0x2e56db;};}function handleError(_0x15dd55,_0xe911b6){_0xe911b6=_0xe911b6||0x1f4;return function(_0x5e30f5){logger[_0x2b27('0x24')](_0x5e30f5['stack']);if(_0x5e30f5[_0x2b27('0x25')]){delete _0x5e30f5[_0x2b27('0x25')];}_0x15dd55['status'](_0xe911b6)[_0x2b27('0x26')](_0x5e30f5);};}exports[_0x2b27('0x27')]=function(_0x1a37df,_0x4f4d56){var _0x29b92a={},_0x3ea58a={},_0x41a23a={'count':0x0,'rows':[]};var _0xd2b8c3=_[_0x2b27('0x28')](db['AnalyticTreeReport'][_0x2b27('0x29')],function(_0x4cb18f){return{'name':_0x4cb18f[_0x2b27('0x2a')],'type':_0x4cb18f[_0x2b27('0x2b')][_0x2b27('0x2c')]};});_0x3ea58a['model']=_[_0x2b27('0x28')](_0xd2b8c3,_0x2b27('0x25'));_0x3ea58a[_0x2b27('0x2d')]=_[_0x2b27('0x2e')](_0x1a37df[_0x2b27('0x2d')]);_0x3ea58a[_0x2b27('0x2f')]=_['intersection'](_0x3ea58a['model'],_0x3ea58a['query']);_0x29b92a[_0x2b27('0x30')]=_[_0x2b27('0x31')](_0x3ea58a['model'],qs['fields'](_0x1a37df['query'][_0x2b27('0x32')]));_0x29b92a[_0x2b27('0x30')]=_0x29b92a['attributes'][_0x2b27('0x33')]?_0x29b92a[_0x2b27('0x30')]:_0x3ea58a[_0x2b27('0x34')];if(!_0x1a37df[_0x2b27('0x2d')]['hasOwnProperty']('nolimit')){_0x29b92a[_0x2b27('0x1d')]=qs[_0x2b27('0x1d')](_0x1a37df[_0x2b27('0x2d')][_0x2b27('0x1d')]);_0x29b92a['offset']=qs[_0x2b27('0x1b')](_0x1a37df[_0x2b27('0x2d')][_0x2b27('0x1b')]);}_0x29b92a[_0x2b27('0x35')]=qs[_0x2b27('0x36')](_0x1a37df[_0x2b27('0x2d')][_0x2b27('0x36')]);_0x29b92a[_0x2b27('0x37')]=qs[_0x2b27('0x2f')](_[_0x2b27('0x38')](_0x1a37df[_0x2b27('0x2d')],_0x3ea58a[_0x2b27('0x2f')]),_0xd2b8c3);if(_0x1a37df[_0x2b27('0x2d')][_0x2b27('0x39')]){_0x29b92a[_0x2b27('0x37')]=_[_0x2b27('0x3a')](_0x29b92a[_0x2b27('0x37')],{'$or':_[_0x2b27('0x28')](_0xd2b8c3,function(_0x16ddec){if(_0x16ddec[_0x2b27('0x2b')]!==_0x2b27('0x3b')){var _0x5d0b41={};_0x5d0b41[_0x16ddec[_0x2b27('0x25')]]={'$like':'%'+_0x1a37df[_0x2b27('0x2d')][_0x2b27('0x39')]+'%'};return _0x5d0b41;}})});}_0x29b92a=_[_0x2b27('0x3a')]({},_0x29b92a,_0x1a37df[_0x2b27('0x3c')]);var _0x3902bc={'where':_0x29b92a[_0x2b27('0x37')]};return db[_0x2b27('0x3d')][_0x2b27('0x1e')](_0x3902bc)[_0x2b27('0x22')](function(_0x220d97){_0x41a23a['count']=_0x220d97;if(_0x1a37df[_0x2b27('0x2d')][_0x2b27('0x3e')]){_0x29b92a[_0x2b27('0x3f')]=[{'all':!![]}];}return db[_0x2b27('0x3d')][_0x2b27('0x40')](_0x29b92a);})[_0x2b27('0x22')](function(_0x4aa7a6){_0x41a23a['rows']=_0x4aa7a6;return _0x41a23a;})[_0x2b27('0x22')](respondWithFilteredResult(_0x4f4d56,_0x29b92a))['catch'](handleError(_0x4f4d56,null));};exports[_0x2b27('0x41')]=function(_0x2ce885,_0xa7f339){var _0x36f532={'raw':!![],'where':{'id':_0x2ce885['params']['id']}},_0x2bd47b={};_0x2bd47b[_0x2b27('0x34')]=_[_0x2b27('0x2e')](db[_0x2b27('0x3d')][_0x2b27('0x29')]);_0x2bd47b[_0x2b27('0x2d')]=_[_0x2b27('0x2e')](_0x2ce885[_0x2b27('0x2d')]);_0x2bd47b[_0x2b27('0x2f')]=_[_0x2b27('0x31')](_0x2bd47b[_0x2b27('0x34')],_0x2bd47b[_0x2b27('0x2d')]);_0x36f532[_0x2b27('0x30')]=_[_0x2b27('0x31')](_0x2bd47b[_0x2b27('0x34')],qs[_0x2b27('0x32')](_0x2ce885[_0x2b27('0x2d')][_0x2b27('0x32')]));_0x36f532['attributes']=_0x36f532[_0x2b27('0x30')]['length']?_0x36f532[_0x2b27('0x30')]:_0x2bd47b[_0x2b27('0x34')];if(_0x2ce885[_0x2b27('0x2d')]['includeAll']){_0x36f532[_0x2b27('0x3f')]=[{'all':!![]}];}_0x36f532=_[_0x2b27('0x3a')]({},_0x36f532,_0x2ce885[_0x2b27('0x3c')]);return db[_0x2b27('0x3d')][_0x2b27('0x42')](_0x36f532)[_0x2b27('0x22')](handleEntityNotFound(_0xa7f339,null))[_0x2b27('0x22')](respondWithResult(_0xa7f339,null))[_0x2b27('0x43')](handleError(_0xa7f339,null));};exports[_0x2b27('0x44')]=function(_0x4070cf,_0x444a5c){return db[_0x2b27('0x3d')][_0x2b27('0x44')](_0x4070cf['body'],{})[_0x2b27('0x22')](respondWithResult(_0x444a5c,0xc9))[_0x2b27('0x43')](handleError(_0x444a5c,null));};exports[_0x2b27('0x21')]=function(_0x9275b5,_0x2dcfb7){if(_0x9275b5[_0x2b27('0x45')]['id']){delete _0x9275b5[_0x2b27('0x45')]['id'];}return db['AnalyticTreeReport']['find']({'where':{'id':_0x9275b5['params']['id']}})[_0x2b27('0x22')](handleEntityNotFound(_0x2dcfb7,null))['then'](saveUpdates(_0x9275b5[_0x2b27('0x45')],null))[_0x2b27('0x22')](respondWithResult(_0x2dcfb7,null))[_0x2b27('0x43')](handleError(_0x2dcfb7,null));};exports[_0x2b27('0x23')]=function(_0x170de2,_0x16f6fd){return db[_0x2b27('0x3d')][_0x2b27('0x42')]({'where':{'id':_0x170de2[_0x2b27('0x46')]['id']}})['then'](handleEntityNotFound(_0x16f6fd,null))['then'](removeEntity(_0x16f6fd,null))['catch'](handleError(_0x16f6fd,null));}; \ No newline at end of file +var _0x9b75=['Content-Range','apply','reject','save','then','destroy','sendStatus','stack','name','AnalyticTreeReport','rawAttributes','fieldName','type','key','map','keys','query','filters','model','attributes','fields','length','nolimit','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','catch','params','intersection','includeAll','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set'];(function(_0x4ce46c,_0x3002e5){var _0x132542=function(_0x3e8d5f){while(--_0x3e8d5f){_0x4ce46c['push'](_0x4ce46c['shift']());}};_0x132542(++_0x3002e5);}(_0x9b75,0xb7));var _0x59b7=function(_0x57896d,_0x24f168){_0x57896d=_0x57896d-0x0;var _0x3cba77=_0x9b75[_0x57896d];return _0x3cba77;};'use strict';var emlformat=require(_0x59b7('0x0'));var rimraf=require(_0x59b7('0x1'));var zipdir=require(_0x59b7('0x2'));var jsonpatch=require(_0x59b7('0x3'));var rp=require(_0x59b7('0x4'));var moment=require(_0x59b7('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x59b7('0x6'));var path=require(_0x59b7('0x7'));var sox=require(_0x59b7('0x8'));var csv=require(_0x59b7('0x9'));var ejs=require(_0x59b7('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x59b7('0xb'));var jsforce=require(_0x59b7('0xc'));var deskjs=require(_0x59b7('0xd'));var toCsv=require(_0x59b7('0x9'));var querystring=require(_0x59b7('0xe'));var Papa=require(_0x59b7('0xf'));var Redis=require(_0x59b7('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x59b7('0x11'));var as=require(_0x59b7('0x12'));var hardwareService=require(_0x59b7('0x13'));var logger=require(_0x59b7('0x14'))(_0x59b7('0x15'));var utils=require('../../config/utils');var config=require(_0x59b7('0x16'));var licenseUtil=require(_0x59b7('0x17'));var db=require(_0x59b7('0x18'))['db'];function respondWithStatusCode(_0x1d1943,_0x15a73b){_0x15a73b=_0x15a73b||0xcc;return function(_0x38550a){if(_0x38550a){return _0x1d1943['sendStatus'](_0x15a73b);}return _0x1d1943[_0x59b7('0x19')](_0x15a73b)[_0x59b7('0x1a')]();};}function respondWithResult(_0x5df6cb,_0x111b36){_0x111b36=_0x111b36||0xc8;return function(_0x506a71){if(_0x506a71){return _0x5df6cb[_0x59b7('0x19')](_0x111b36)[_0x59b7('0x1b')](_0x506a71);}};}function respondWithFilteredResult(_0x3ea721,_0x3d26c5){return function(_0x5250b2){if(_0x5250b2){var _0x239e16=typeof _0x3d26c5[_0x59b7('0x1c')]==='undefined'&&typeof _0x3d26c5[_0x59b7('0x1d')]===_0x59b7('0x1e');var _0x49908d=_0x5250b2['count'];var _0x37fe86=_0x239e16?0x0:_0x3d26c5[_0x59b7('0x1c')];var _0x5e2d74=_0x239e16?_0x5250b2[_0x59b7('0x1f')]:_0x3d26c5['offset']+_0x3d26c5['limit'];var _0x3e5930;if(_0x5e2d74>=_0x49908d){_0x5e2d74=_0x49908d;_0x3e5930=0xc8;}else{_0x3e5930=0xce;}_0x3ea721[_0x59b7('0x19')](_0x3e5930);return _0x3ea721[_0x59b7('0x20')](_0x59b7('0x21'),_0x37fe86+'-'+_0x5e2d74+'/'+_0x49908d)[_0x59b7('0x1b')](_0x5250b2);}return null;};}function patchUpdates(_0xa41d6e){return function(_0xa1ca72){try{jsonpatch[_0x59b7('0x22')](_0xa1ca72,_0xa41d6e,!![]);}catch(_0x53b37e){return BPromise[_0x59b7('0x23')](_0x53b37e);}return _0xa1ca72[_0x59b7('0x24')]();};}function saveUpdates(_0x20dd7b,_0x5abb00){return function(_0x510353){if(_0x510353){return _0x510353['update'](_0x20dd7b)[_0x59b7('0x25')](function(_0x11273a){return _0x11273a;});}return null;};}function removeEntity(_0x1d5932,_0x1a2b5e){return function(_0x7487a){if(_0x7487a){return _0x7487a[_0x59b7('0x26')]()[_0x59b7('0x25')](function(){_0x1d5932['status'](0xcc)[_0x59b7('0x1a')]();});}};}function handleEntityNotFound(_0x58ec60,_0x1b8cee){return function(_0xe67379){if(!_0xe67379){_0x58ec60[_0x59b7('0x27')](0x194);}return _0xe67379;};}function handleError(_0x116c53,_0x39f4ca){_0x39f4ca=_0x39f4ca||0x1f4;return function(_0x280223){logger['error'](_0x280223[_0x59b7('0x28')]);if(_0x280223[_0x59b7('0x29')]){delete _0x280223[_0x59b7('0x29')];}_0x116c53[_0x59b7('0x19')](_0x39f4ca)['send'](_0x280223);};}exports['index']=function(_0x34b8e3,_0xbfe23d){var _0x4d0398={},_0x39f600={},_0x298f1d={'count':0x0,'rows':[]};var _0x1e0b30=_['map'](db[_0x59b7('0x2a')][_0x59b7('0x2b')],function(_0x2193cb){return{'name':_0x2193cb[_0x59b7('0x2c')],'type':_0x2193cb[_0x59b7('0x2d')][_0x59b7('0x2e')]};});_0x39f600['model']=_[_0x59b7('0x2f')](_0x1e0b30,_0x59b7('0x29'));_0x39f600['query']=_[_0x59b7('0x30')](_0x34b8e3[_0x59b7('0x31')]);_0x39f600[_0x59b7('0x32')]=_['intersection'](_0x39f600[_0x59b7('0x33')],_0x39f600[_0x59b7('0x31')]);_0x4d0398[_0x59b7('0x34')]=_['intersection'](_0x39f600[_0x59b7('0x33')],qs[_0x59b7('0x35')](_0x34b8e3[_0x59b7('0x31')][_0x59b7('0x35')]));_0x4d0398[_0x59b7('0x34')]=_0x4d0398[_0x59b7('0x34')][_0x59b7('0x36')]?_0x4d0398['attributes']:_0x39f600[_0x59b7('0x33')];if(!_0x34b8e3[_0x59b7('0x31')]['hasOwnProperty'](_0x59b7('0x37'))){_0x4d0398[_0x59b7('0x1d')]=qs[_0x59b7('0x1d')](_0x34b8e3[_0x59b7('0x31')][_0x59b7('0x1d')]);_0x4d0398[_0x59b7('0x1c')]=qs[_0x59b7('0x1c')](_0x34b8e3[_0x59b7('0x31')][_0x59b7('0x1c')]);}_0x4d0398['order']=qs[_0x59b7('0x38')](_0x34b8e3[_0x59b7('0x31')][_0x59b7('0x38')]);_0x4d0398[_0x59b7('0x39')]=qs[_0x59b7('0x32')](_['pick'](_0x34b8e3['query'],_0x39f600[_0x59b7('0x32')]),_0x1e0b30);if(_0x34b8e3[_0x59b7('0x31')][_0x59b7('0x3a')]){_0x4d0398[_0x59b7('0x39')]=_[_0x59b7('0x3b')](_0x4d0398[_0x59b7('0x39')],{'$or':_[_0x59b7('0x2f')](_0x1e0b30,function(_0x376f64){if(_0x376f64[_0x59b7('0x2d')]!==_0x59b7('0x3c')){var _0x3e5783={};_0x3e5783[_0x376f64[_0x59b7('0x29')]]={'$like':'%'+_0x34b8e3[_0x59b7('0x31')][_0x59b7('0x3a')]+'%'};return _0x3e5783;}})});}_0x4d0398=_[_0x59b7('0x3b')]({},_0x4d0398,_0x34b8e3[_0x59b7('0x3d')]);var _0x1d0e59={'where':_0x4d0398[_0x59b7('0x39')]};return db[_0x59b7('0x2a')][_0x59b7('0x1f')](_0x1d0e59)[_0x59b7('0x25')](function(_0x353159){_0x298f1d[_0x59b7('0x1f')]=_0x353159;if(_0x34b8e3[_0x59b7('0x31')]['includeAll']){_0x4d0398[_0x59b7('0x3e')]=[{'all':!![]}];}return db[_0x59b7('0x2a')][_0x59b7('0x3f')](_0x4d0398);})[_0x59b7('0x25')](function(_0x2b546d){_0x298f1d[_0x59b7('0x40')]=_0x2b546d;return _0x298f1d;})[_0x59b7('0x25')](respondWithFilteredResult(_0xbfe23d,_0x4d0398))[_0x59b7('0x41')](handleError(_0xbfe23d,null));};exports['show']=function(_0x46f3fa,_0x37b04a){var _0x55be82={'raw':!![],'where':{'id':_0x46f3fa[_0x59b7('0x42')]['id']}},_0x52cfa0={};_0x52cfa0[_0x59b7('0x33')]=_[_0x59b7('0x30')](db[_0x59b7('0x2a')][_0x59b7('0x2b')]);_0x52cfa0[_0x59b7('0x31')]=_[_0x59b7('0x30')](_0x46f3fa[_0x59b7('0x31')]);_0x52cfa0[_0x59b7('0x32')]=_[_0x59b7('0x43')](_0x52cfa0['model'],_0x52cfa0[_0x59b7('0x31')]);_0x55be82[_0x59b7('0x34')]=_[_0x59b7('0x43')](_0x52cfa0[_0x59b7('0x33')],qs[_0x59b7('0x35')](_0x46f3fa[_0x59b7('0x31')]['fields']));_0x55be82['attributes']=_0x55be82[_0x59b7('0x34')]['length']?_0x55be82[_0x59b7('0x34')]:_0x52cfa0[_0x59b7('0x33')];if(_0x46f3fa[_0x59b7('0x31')][_0x59b7('0x44')]){_0x55be82[_0x59b7('0x3e')]=[{'all':!![]}];}_0x55be82=_[_0x59b7('0x3b')]({},_0x55be82,_0x46f3fa[_0x59b7('0x3d')]);return db[_0x59b7('0x2a')][_0x59b7('0x45')](_0x55be82)[_0x59b7('0x25')](handleEntityNotFound(_0x37b04a,null))[_0x59b7('0x25')](respondWithResult(_0x37b04a,null))[_0x59b7('0x41')](handleError(_0x37b04a,null));};exports[_0x59b7('0x46')]=function(_0x5894f1,_0x508a59){return db[_0x59b7('0x2a')][_0x59b7('0x46')](_0x5894f1[_0x59b7('0x47')],{})[_0x59b7('0x25')](respondWithResult(_0x508a59,0xc9))[_0x59b7('0x41')](handleError(_0x508a59,null));};exports['update']=function(_0x19e82a,_0x587f15){if(_0x19e82a[_0x59b7('0x47')]['id']){delete _0x19e82a['body']['id'];}return db[_0x59b7('0x2a')][_0x59b7('0x45')]({'where':{'id':_0x19e82a[_0x59b7('0x42')]['id']}})[_0x59b7('0x25')](handleEntityNotFound(_0x587f15,null))[_0x59b7('0x25')](saveUpdates(_0x19e82a[_0x59b7('0x47')],null))[_0x59b7('0x25')](respondWithResult(_0x587f15,null))[_0x59b7('0x41')](handleError(_0x587f15,null));};exports[_0x59b7('0x26')]=function(_0x17d0c7,_0x55cb35){return db[_0x59b7('0x2a')][_0x59b7('0x45')]({'where':{'id':_0x17d0c7[_0x59b7('0x42')]['id']}})[_0x59b7('0x25')](handleEntityNotFound(_0x55cb35,null))[_0x59b7('0x25')](removeEntity(_0x55cb35,null))[_0x59b7('0x41')](handleError(_0x55cb35,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 01c3ecb..4196279 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 _0xcc5e=['../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees','util','../../config/logger','api','bluebird','request-promise','rimraf'];(function(_0x36571b,_0x2e0e2a){var _0x47fe91=function(_0x30721){while(--_0x30721){_0x36571b['push'](_0x36571b['shift']());}};_0x47fe91(++_0x2e0e2a);}(_0xcc5e,0x8a));var _0xecc5=function(_0x4fa916,_0x3ec36a){_0x4fa916=_0x4fa916-0x0;var _0x576439=_0xcc5e[_0x4fa916];return _0x576439;};'use strict';var _=require('lodash');var util=require(_0xecc5('0x0'));var logger=require(_0xecc5('0x1'))(_0xecc5('0x2'));var moment=require('moment');var BPromise=require(_0xecc5('0x3'));var rp=require(_0xecc5('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xecc5('0x5'));var config=require(_0xecc5('0x6'));var attributes=require(_0xecc5('0x7'));module[_0xecc5('0x8')]=function(_0x1861f5,_0x34d72e){return _0x1861f5[_0xecc5('0x9')](_0xecc5('0xa'),attributes,{'tableName':_0xecc5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdde5=['bluebird','rimraf','./analyticTreeReport.attributes','AnalyticTreeReport','../../config/logger'];(function(_0x3cf852,_0x10a67e){var _0xde0a8=function(_0x5979d5){while(--_0x5979d5){_0x3cf852['push'](_0x3cf852['shift']());}};_0xde0a8(++_0x10a67e);}(_0xdde5,0x1bc));var _0x5dde=function(_0x339eaa,_0xbc2f72){_0x339eaa=_0x339eaa-0x0;var _0x4985b6=_0xdde5[_0x339eaa];return _0x4985b6;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5dde('0x0'))('api');var moment=require('moment');var BPromise=require(_0x5dde('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5dde('0x2'));var config=require('../../config/environment');var attributes=require(_0x5dde('0x3'));module['exports']=function(_0x2032a2,_0x31c22c){return _0x2032a2['define'](_0x5dde('0x4'),attributes,{'tableName':'analytics_report_trees','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 54f2da1..3822ec6 100644 --- a/server/api/analyticTreeReport/analyticTreeReport.rpc.js +++ b/server/api/analyticTreeReport/analyticTreeReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f66=['../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','stringify','code','message','error','info','catch','util','bluebird','randomstring','ioredis'];(function(_0x4d0ecb,_0x23e2d6){var _0xb0ce3c=function(_0x9d0b7){while(--_0x9d0b7){_0x4d0ecb['push'](_0x4d0ecb['shift']());}};_0xb0ce3c(++_0x23e2d6);}(_0x5f66,0x1a0));var _0x65f6=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x5f66[_0x432682];return _0x463d05;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var moment=require('moment');var BPromise=require(_0x65f6('0x1'));var rs=require(_0x65f6('0x2'));var fs=require('fs');var Redis=require(_0x65f6('0x3'));var db=require(_0x65f6('0x4'))['db'];var utils=require(_0x65f6('0x5'));var logger=require('../../config/logger')(_0x65f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x65f6('0x7'));var client=jayson[_0x65f6('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ed98f,_0x1c0e12,_0x2c6571){return new BPromise(function(_0x112079,_0x8f6451){return client[_0x65f6('0x9')](_0x4ed98f,_0x2c6571)[_0x65f6('0xa')](function(_0x48d85c){logger['info'](_0x65f6('0xb'),_0x1c0e12,_0x65f6('0xc'));logger[_0x65f6('0xd')](_0x65f6('0xe'),_0x1c0e12,'request\x20sent',JSON[_0x65f6('0xf')](_0x48d85c));if(_0x48d85c['error']){if(_0x48d85c['error'][_0x65f6('0x10')]===0x1f4){logger['error'](_0x65f6('0xb'),_0x1c0e12,_0x48d85c['error'][_0x65f6('0x11')]);return _0x8f6451(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);return _0x112079(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}else{logger[_0x65f6('0x13')]('AnalyticTreeReport,\x20%s,\x20%s',_0x1c0e12,_0x65f6('0xc'));_0x112079(_0x48d85c['result']['message']);}})[_0x65f6('0x14')](function(_0x5c69f8){logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x5c69f8);_0x8f6451(_0x5c69f8);});});} \ No newline at end of file +var _0x7a54=['info','AnalyticTreeReport,\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(_0x240ff8,_0x347592){_0x240ff8=_0x240ff8-0x0;var _0x5a6e5f=_0x7a54[_0x240ff8];return _0x5a6e5f;};'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')]('AnalyticTreeReport,\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/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index e180d80..2b7cb32 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 _0xb9a3=['delete','/:id','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','show'];(function(_0x5ebd9d,_0x4eec29){var _0x75ced3=function(_0x817717){while(--_0x817717){_0x5ebd9d['push'](_0x5ebd9d['shift']());}};_0x75ced3(++_0x4eec29);}(_0xb9a3,0x136));var _0x3b9a=function(_0x155877,_0x75715){_0x155877=_0x155877-0x0;var _0x18dc59=_0xb9a3[_0x155877];return _0x18dc59;};'use strict';var multer=require(_0x3b9a('0x0'));var util=require(_0x3b9a('0x1'));var path=require(_0x3b9a('0x2'));var timeout=require('connect-timeout');var express=require(_0x3b9a('0x3'));var router=express[_0x3b9a('0x4')]();var fs_extra=require(_0x3b9a('0x5'));var auth=require(_0x3b9a('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x3b9a('0x7'));var controller=require(_0x3b9a('0x8'));router[_0x3b9a('0x9')]('/',auth[_0x3b9a('0xa')](),controller[_0x3b9a('0xb')]);router[_0x3b9a('0x9')]('/:id',auth[_0x3b9a('0xa')](),controller[_0x3b9a('0xc')]);router['post']('/',auth[_0x3b9a('0xa')](),controller['create']);router['put']('/:id',auth[_0x3b9a('0xa')](),controller['update']);router[_0x3b9a('0xd')](_0x3b9a('0xe'),auth[_0x3b9a('0xa')](),controller[_0x3b9a('0xf')]);module[_0x3b9a('0x10')]=router; \ No newline at end of file +var _0x8184=['update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','post','create','put','/:id'];(function(_0x320da1,_0x31e289){var _0x1a9db5=function(_0xe83b30){while(--_0xe83b30){_0x320da1['push'](_0x320da1['shift']());}};_0x1a9db5(++_0x31e289);}(_0x8184,0x16b));var _0x4818=function(_0xbc88bc,_0x10ea66){_0xbc88bc=_0xbc88bc-0x0;var _0x548858=_0x8184[_0xbc88bc];return _0x548858;};'use strict';var multer=require(_0x4818('0x0'));var util=require(_0x4818('0x1'));var path=require(_0x4818('0x2'));var timeout=require(_0x4818('0x3'));var express=require(_0x4818('0x4'));var router=express[_0x4818('0x5')]();var fs_extra=require(_0x4818('0x6'));var auth=require(_0x4818('0x7'));var interaction=require(_0x4818('0x8'));var config=require(_0x4818('0x9'));var controller=require('./analyticTreeReport.controller');router[_0x4818('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x4818('0xa')]('/:id',auth[_0x4818('0xb')](),controller[_0x4818('0xc')]);router[_0x4818('0xd')]('/',auth[_0x4818('0xb')](),controller[_0x4818('0xe')]);router[_0x4818('0xf')](_0x4818('0x10'),auth[_0x4818('0xb')](),controller[_0x4818('0x11')]);router['delete'](_0x4818('0x10'),auth[_0x4818('0xb')](),controller[_0x4818('0x12')]);module[_0x4818('0x13')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index 53a1ff5..2107f8a 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 _0x0eec=['sequelize','STRING'];(function(_0x4f7d1,_0x50fa31){var _0x5ce698=function(_0x779af9){while(--_0x779af9){_0x4f7d1['push'](_0x4f7d1['shift']());}};_0x5ce698(++_0x50fa31);}(_0x0eec,0xac));var _0xc0ee=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0eec[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xc0ee('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0xc0ee('0x1')]},'type':{'type':Sequelize[_0xc0ee('0x1')]}}; \ No newline at end of file +var _0xe8f7=['STRING','sequelize'];(function(_0x10af41,_0x4df19f){var _0x33794c=function(_0x23996){while(--_0x23996){_0x10af41['push'](_0x10af41['shift']());}};_0x33794c(++_0x4df19f);}(_0xe8f7,0x137));var _0x7e8f=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xe8f7[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0x7e8f('0x0'));module['exports']={'name':{'type':Sequelize[_0x7e8f('0x1')]},'basename':{'type':Sequelize[_0x7e8f('0x1')]},'type':{'type':Sequelize[_0x7e8f('0x1')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index bd4ac47..cfe5f20 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 _0xce88=['fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','name','count','include','catch','show','params','includeAll','options','find','clone','omit','createdAt','body','create','file','filename','mimetype','download','findOne','ChatOfflineMessageId','join','server/files/attachments/','offline-chat/','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','Content-Range','reject','save','update','then','destroy','error','index','Attachment','rawAttributes','fieldName','type','key','map','query','keys','filters','model','attributes','intersection'];(function(_0x104a84,_0x285970){var _0x4973ff=function(_0x5064e7){while(--_0x5064e7){_0x104a84['push'](_0x104a84['shift']());}};_0x4973ff(++_0x285970);}(_0xce88,0x168));var _0x8ce8=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xce88[_0x397e5f];return _0x5302b8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8ce8('0x0'));var zipdir=require(_0x8ce8('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8ce8('0x2'));var moment=require(_0x8ce8('0x3'));var BPromise=require(_0x8ce8('0x4'));var Mustache=require(_0x8ce8('0x5'));var util=require(_0x8ce8('0x6'));var path=require(_0x8ce8('0x7'));var sox=require(_0x8ce8('0x8'));var csv=require('to-csv');var ejs=require(_0x8ce8('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8ce8('0xa'));var squel=require('squel');var crypto=require(_0x8ce8('0xb'));var jsforce=require(_0x8ce8('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x8ce8('0xd'));var querystring=require('querystring');var Papa=require(_0x8ce8('0xe'));var Redis=require(_0x8ce8('0xf'));var authService=require(_0x8ce8('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x8ce8('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8ce8('0x12'))(_0x8ce8('0x13'));var utils=require(_0x8ce8('0x14'));var config=require(_0x8ce8('0x15'));var licenseUtil=require(_0x8ce8('0x16'));var db=require(_0x8ce8('0x17'))['db'];function respondWithStatusCode(_0xf8704,_0x3563d1){_0x3563d1=_0x3563d1||0xcc;return function(_0x53707a){if(_0x53707a){return _0xf8704[_0x8ce8('0x18')](_0x3563d1);}return _0xf8704[_0x8ce8('0x19')](_0x3563d1)[_0x8ce8('0x1a')]();};}function respondWithResult(_0x2fc2d5,_0x1171a6){_0x1171a6=_0x1171a6||0xc8;return function(_0xa19f95){if(_0xa19f95){return _0x2fc2d5[_0x8ce8('0x19')](_0x1171a6)[_0x8ce8('0x1b')](_0xa19f95);}};}function respondWithFilteredResult(_0x5ad7ca,_0x41fbc5){return function(_0x38ea09){if(_0x38ea09){var _0x5457f4=typeof _0x41fbc5['offset']==='undefined'&&typeof _0x41fbc5['limit']==='undefined';var _0x361144=_0x38ea09['count'];var _0x4b76c6=_0x5457f4?0x0:_0x41fbc5[_0x8ce8('0x1c')];var _0x141462=_0x5457f4?_0x38ea09['count']:_0x41fbc5[_0x8ce8('0x1c')]+_0x41fbc5[_0x8ce8('0x1d')];var _0x3ae56a;if(_0x141462>=_0x361144){_0x141462=_0x361144;_0x3ae56a=0xc8;}else{_0x3ae56a=0xce;}_0x5ad7ca[_0x8ce8('0x19')](_0x3ae56a);return _0x5ad7ca['set'](_0x8ce8('0x1e'),_0x4b76c6+'-'+_0x141462+'/'+_0x361144)[_0x8ce8('0x1b')](_0x38ea09);}return null;};}function patchUpdates(_0x3ed729){return function(_0x8fdcb6){try{jsonpatch['apply'](_0x8fdcb6,_0x3ed729,!![]);}catch(_0x8564af){return BPromise[_0x8ce8('0x1f')](_0x8564af);}return _0x8fdcb6[_0x8ce8('0x20')]();};}function saveUpdates(_0x3de6d8,_0x16afb9){return function(_0x2a8ec6){if(_0x2a8ec6){return _0x2a8ec6[_0x8ce8('0x21')](_0x3de6d8)[_0x8ce8('0x22')](function(_0x10e29c){return _0x10e29c;});}return null;};}function removeEntity(_0x1f3cbb,_0x528bd7){return function(_0x3fefb4){if(_0x3fefb4){return _0x3fefb4[_0x8ce8('0x23')]()[_0x8ce8('0x22')](function(){_0x1f3cbb[_0x8ce8('0x19')](0xcc)[_0x8ce8('0x1a')]();});}};}function handleEntityNotFound(_0x99ce1d,_0x4efce6){return function(_0x16f469){if(!_0x16f469){_0x99ce1d[_0x8ce8('0x18')](0x194);}return _0x16f469;};}function handleError(_0x13a921,_0x37b0c7){_0x37b0c7=_0x37b0c7||0x1f4;return function(_0x3856a1){logger[_0x8ce8('0x24')](_0x3856a1['stack']);if(_0x3856a1['name']){delete _0x3856a1['name'];}_0x13a921['status'](_0x37b0c7)['send'](_0x3856a1);};}exports[_0x8ce8('0x25')]=function(_0x5249da,_0xe9f72a){var _0x40add6={},_0x2773b3={},_0x28fca9={'count':0x0,'rows':[]};var _0x2f1e66=_['map'](db[_0x8ce8('0x26')][_0x8ce8('0x27')],function(_0xce8de2){return{'name':_0xce8de2[_0x8ce8('0x28')],'type':_0xce8de2[_0x8ce8('0x29')][_0x8ce8('0x2a')]};});_0x2773b3['model']=_[_0x8ce8('0x2b')](_0x2f1e66,'name');_0x2773b3[_0x8ce8('0x2c')]=_[_0x8ce8('0x2d')](_0x5249da[_0x8ce8('0x2c')]);_0x2773b3[_0x8ce8('0x2e')]=_['intersection'](_0x2773b3[_0x8ce8('0x2f')],_0x2773b3[_0x8ce8('0x2c')]);_0x40add6[_0x8ce8('0x30')]=_[_0x8ce8('0x31')](_0x2773b3[_0x8ce8('0x2f')],qs[_0x8ce8('0x32')](_0x5249da['query'][_0x8ce8('0x32')]));_0x40add6[_0x8ce8('0x30')]=_0x40add6[_0x8ce8('0x30')][_0x8ce8('0x33')]?_0x40add6[_0x8ce8('0x30')]:_0x2773b3[_0x8ce8('0x2f')];if(!_0x5249da['query'][_0x8ce8('0x34')]('nolimit')){_0x40add6[_0x8ce8('0x1d')]=qs['limit'](_0x5249da[_0x8ce8('0x2c')]['limit']);_0x40add6[_0x8ce8('0x1c')]=qs[_0x8ce8('0x1c')](_0x5249da[_0x8ce8('0x2c')]['offset']);}_0x40add6[_0x8ce8('0x35')]=qs[_0x8ce8('0x36')](_0x5249da[_0x8ce8('0x2c')]['sort']);_0x40add6[_0x8ce8('0x37')]=qs[_0x8ce8('0x2e')](_[_0x8ce8('0x38')](_0x5249da['query'],_0x2773b3['filters']),_0x2f1e66);if(_0x5249da['query']['filter']){_0x40add6['where']=_[_0x8ce8('0x39')](_0x40add6[_0x8ce8('0x37')],{'$or':_[_0x8ce8('0x2b')](_0x2f1e66,function(_0x5e074a){if(_0x5e074a[_0x8ce8('0x29')]!==_0x8ce8('0x3a')){var _0x13de41={};_0x13de41[_0x5e074a[_0x8ce8('0x3b')]]={'$like':'%'+_0x5249da['query']['filter']+'%'};return _0x13de41;}})});}_0x40add6=_[_0x8ce8('0x39')]({},_0x40add6,_0x5249da['options']);var _0x445fe2={'where':_0x40add6[_0x8ce8('0x37')]};return db[_0x8ce8('0x26')][_0x8ce8('0x3c')](_0x445fe2)[_0x8ce8('0x22')](function(_0x3dbe56){_0x28fca9[_0x8ce8('0x3c')]=_0x3dbe56;if(_0x5249da[_0x8ce8('0x2c')]['includeAll']){_0x40add6[_0x8ce8('0x3d')]=[{'all':!![]}];}return db[_0x8ce8('0x26')]['findAll'](_0x40add6);})[_0x8ce8('0x22')](function(_0x5e9bbb){_0x28fca9['rows']=_0x5e9bbb;return _0x28fca9;})[_0x8ce8('0x22')](respondWithFilteredResult(_0xe9f72a,_0x40add6))[_0x8ce8('0x3e')](handleError(_0xe9f72a,null));};exports[_0x8ce8('0x3f')]=function(_0x2ddfb1,_0x4bf7af){var _0xc6b481={'raw':!![],'where':{'id':_0x2ddfb1[_0x8ce8('0x40')]['id']}},_0x4dfaa6={};_0x4dfaa6[_0x8ce8('0x2f')]=_['keys'](db['Attachment'][_0x8ce8('0x27')]);_0x4dfaa6[_0x8ce8('0x2c')]=_['keys'](_0x2ddfb1[_0x8ce8('0x2c')]);_0x4dfaa6[_0x8ce8('0x2e')]=_['intersection'](_0x4dfaa6[_0x8ce8('0x2f')],_0x4dfaa6['query']);_0xc6b481[_0x8ce8('0x30')]=_[_0x8ce8('0x31')](_0x4dfaa6[_0x8ce8('0x2f')],qs[_0x8ce8('0x32')](_0x2ddfb1[_0x8ce8('0x2c')]['fields']));_0xc6b481['attributes']=_0xc6b481[_0x8ce8('0x30')][_0x8ce8('0x33')]?_0xc6b481[_0x8ce8('0x30')]:_0x4dfaa6[_0x8ce8('0x2f')];if(_0x2ddfb1['query'][_0x8ce8('0x41')]){_0xc6b481[_0x8ce8('0x3d')]=[{'all':!![]}];}_0xc6b481=_['merge']({},_0xc6b481,_0x2ddfb1[_0x8ce8('0x42')]);return db[_0x8ce8('0x26')][_0x8ce8('0x43')](_0xc6b481)[_0x8ce8('0x22')](handleEntityNotFound(_0x4bf7af,null))['then'](respondWithResult(_0x4bf7af,null))[_0x8ce8('0x3e')](handleError(_0x4bf7af,null));};exports[_0x8ce8('0x44')]=function(_0x58349f,_0x4e8901){var _0x2fd03b={'where':{'id':_0x58349f[_0x8ce8('0x40')]['id']}},_0x1617ef={};_0x1617ef['model']=_[_0x8ce8('0x2d')](db[_0x8ce8('0x26')][_0x8ce8('0x27')]);_0x2fd03b[_0x8ce8('0x30')]=_[_0x8ce8('0x31')](_0x1617ef['model'],qs[_0x8ce8('0x32')](_0x58349f['query']['fields']));_0x2fd03b[_0x8ce8('0x30')]=_0x2fd03b[_0x8ce8('0x30')][_0x8ce8('0x33')]?_0x2fd03b[_0x8ce8('0x30')]:_0x1617ef['model'];if(_0x58349f[_0x8ce8('0x2c')][_0x8ce8('0x41')]){_0x2fd03b[_0x8ce8('0x3d')]=[{'all':!![]}];}_0x2fd03b=_['merge']({},_0x2fd03b,_0x58349f['options']);return db[_0x8ce8('0x26')]['find'](_0x2fd03b)[_0x8ce8('0x22')](handleEntityNotFound(_0x4e8901,null))[_0x8ce8('0x22')](function(_0x8a994c){if(_0x8a994c){var _0x56e37c=_0x8a994c['get']({'plain':!![]});_0x56e37c=qs[_0x8ce8('0x45')](_0x56e37c,['id',_0x8ce8('0x46'),'updatedAt']);_0x58349f[_0x8ce8('0x47')]=_[_0x8ce8('0x45')](_0x58349f['body'],['id','createdAt','updatedAt']);return db[_0x8ce8('0x26')]['create'](_[_0x8ce8('0x39')](_0x56e37c,_0x58349f['body']),{'include':_0x58349f[_0x8ce8('0x2c')][_0x8ce8('0x41')]?[{'all':!![]}]:undefined});}})[_0x8ce8('0x22')](respondWithResult(_0x4e8901,0xc9))[_0x8ce8('0x3e')](handleError(_0x4e8901,null));};exports[_0x8ce8('0x21')]=function(_0x391d61,_0x32e52a){if(_0x391d61[_0x8ce8('0x47')]['id']){delete _0x391d61[_0x8ce8('0x47')]['id'];}return db[_0x8ce8('0x26')][_0x8ce8('0x43')]({'where':{'id':_0x391d61['params']['id']}})[_0x8ce8('0x22')](handleEntityNotFound(_0x32e52a,null))[_0x8ce8('0x22')](saveUpdates(_0x391d61['body'],null))['then'](respondWithResult(_0x32e52a,null))[_0x8ce8('0x3e')](handleError(_0x32e52a,null));};exports[_0x8ce8('0x23')]=function(_0x335b75,_0xbbf5a){return db[_0x8ce8('0x26')][_0x8ce8('0x43')]({'where':{'id':_0x335b75[_0x8ce8('0x40')]['id']}})[_0x8ce8('0x22')](handleEntityNotFound(_0xbbf5a,null))[_0x8ce8('0x22')](removeEntity(_0xbbf5a,null))[_0x8ce8('0x3e')](handleError(_0xbbf5a,null));};exports[_0x8ce8('0x48')]=function(_0x21f6bb,_0x12ec0b,_0x2d7430){_0x21f6bb[_0x8ce8('0x47')][_0x8ce8('0x3b')]=_0x21f6bb[_0x8ce8('0x49')]['originalname'];_0x21f6bb[_0x8ce8('0x47')]['basename']=_0x21f6bb['file'][_0x8ce8('0x4a')];_0x21f6bb[_0x8ce8('0x47')]['type']=_0x21f6bb[_0x8ce8('0x49')][_0x8ce8('0x4b')];return db['Attachment'][_0x8ce8('0x48')](_0x21f6bb[_0x8ce8('0x47')])[_0x8ce8('0x22')](respondWithResult(_0x12ec0b,0xc9))[_0x8ce8('0x3e')](handleError(_0x12ec0b,null));};exports[_0x8ce8('0x4c')]=function(_0x35c8c0,_0x1b44be,_0x592f07){return db[_0x8ce8('0x26')][_0x8ce8('0x4d')]({'where':{'id':_0x35c8c0[_0x8ce8('0x40')]['id']},'raw':!![]})[_0x8ce8('0x22')](handleEntityNotFound(_0x1b44be,null))['then'](function(_0x4dd604){if(_0x4dd604){var _0x5a4d6c=_0x4dd604[_0x8ce8('0x4e')]!==null;var _0x3f7ce4=path[_0x8ce8('0x4f')](config['root'],_0x8ce8('0x50'));if(_0x5a4d6c){_0x3f7ce4=path[_0x8ce8('0x4f')](_0x3f7ce4,_0x8ce8('0x51'));}var _0x336666=path[_0x8ce8('0x4f')](_0x3f7ce4,_0x4dd604['basename']);return _0x1b44be[_0x8ce8('0x4c')](_0x336666);}})[_0x8ce8('0x3e')](handleError(_0x1b44be,null));}; \ No newline at end of file +var _0x2593=['undefined','limit','count','Content-Range','json','apply','update','destroy','then','error','stack','name','send','index','map','Attachment','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','findAll','rows','catch','show','params','length','includeAll','include','find','rawAttributes','omit','createdAt','updatedAt','body','create','file','basename','filename','mimetype','findOne','ChatOfflineMessageId','join','offline-chat/','download','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset'];(function(_0x29b2d0,_0x73bf4b){var _0x4af937=function(_0x1b19c9){while(--_0x1b19c9){_0x29b2d0['push'](_0x29b2d0['shift']());}};_0x4af937(++_0x73bf4b);}(_0x2593,0x1f3));var _0x3259=function(_0x4fa438,_0x1f15a7){_0x4fa438=_0x4fa438-0x0;var _0x4e3958=_0x2593[_0x4fa438];return _0x4e3958;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3259('0x0'));var zipdir=require(_0x3259('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3259('0x2'));var moment=require('moment');var BPromise=require(_0x3259('0x3'));var Mustache=require(_0x3259('0x4'));var util=require(_0x3259('0x5'));var path=require(_0x3259('0x6'));var sox=require(_0x3259('0x7'));var csv=require(_0x3259('0x8'));var ejs=require(_0x3259('0x9'));var fs=require('fs');var fs_extra=require(_0x3259('0xa'));var _=require(_0x3259('0xb'));var squel=require(_0x3259('0xc'));var crypto=require('crypto');var jsforce=require(_0x3259('0xd'));var deskjs=require(_0x3259('0xe'));var toCsv=require(_0x3259('0x8'));var querystring=require(_0x3259('0xf'));var Papa=require(_0x3259('0x10'));var Redis=require(_0x3259('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x3259('0x12'));var as=require(_0x3259('0x13'));var hardwareService=require(_0x3259('0x14'));var logger=require(_0x3259('0x15'))(_0x3259('0x16'));var utils=require(_0x3259('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x3259('0x18'));var db=require(_0x3259('0x19'))['db'];function respondWithStatusCode(_0x1ed080,_0x1e3c55){_0x1e3c55=_0x1e3c55||0xcc;return function(_0x5b284d){if(_0x5b284d){return _0x1ed080[_0x3259('0x1a')](_0x1e3c55);}return _0x1ed080[_0x3259('0x1b')](_0x1e3c55)['end']();};}function respondWithResult(_0x1dfeb4,_0x456ee3){_0x456ee3=_0x456ee3||0xc8;return function(_0x23caf8){if(_0x23caf8){return _0x1dfeb4[_0x3259('0x1b')](_0x456ee3)['json'](_0x23caf8);}};}function respondWithFilteredResult(_0x202ca8,_0x4720dd){return function(_0x1db651){if(_0x1db651){var _0x57d2df=typeof _0x4720dd[_0x3259('0x1c')]===_0x3259('0x1d')&&typeof _0x4720dd[_0x3259('0x1e')]===_0x3259('0x1d');var _0x5a152a=_0x1db651[_0x3259('0x1f')];var _0x3508d2=_0x57d2df?0x0:_0x4720dd['offset'];var _0x5e17bf=_0x57d2df?_0x1db651[_0x3259('0x1f')]:_0x4720dd['offset']+_0x4720dd[_0x3259('0x1e')];var _0x32f0cf;if(_0x5e17bf>=_0x5a152a){_0x5e17bf=_0x5a152a;_0x32f0cf=0xc8;}else{_0x32f0cf=0xce;}_0x202ca8['status'](_0x32f0cf);return _0x202ca8['set'](_0x3259('0x20'),_0x3508d2+'-'+_0x5e17bf+'/'+_0x5a152a)[_0x3259('0x21')](_0x1db651);}return null;};}function patchUpdates(_0x5c0df6){return function(_0x5527cd){try{jsonpatch[_0x3259('0x22')](_0x5527cd,_0x5c0df6,!![]);}catch(_0x41a8ba){return BPromise['reject'](_0x41a8ba);}return _0x5527cd['save']();};}function saveUpdates(_0x3617ea,_0x473955){return function(_0x23e893){if(_0x23e893){return _0x23e893[_0x3259('0x23')](_0x3617ea)['then'](function(_0x43cf82){return _0x43cf82;});}return null;};}function removeEntity(_0x2f0e93,_0x41c914){return function(_0x189327){if(_0x189327){return _0x189327[_0x3259('0x24')]()[_0x3259('0x25')](function(){_0x2f0e93[_0x3259('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0xac869,_0x3f50d7){return function(_0x54bcc3){if(!_0x54bcc3){_0xac869[_0x3259('0x1a')](0x194);}return _0x54bcc3;};}function handleError(_0x5340bd,_0x31bd03){_0x31bd03=_0x31bd03||0x1f4;return function(_0x38230f){logger[_0x3259('0x26')](_0x38230f[_0x3259('0x27')]);if(_0x38230f[_0x3259('0x28')]){delete _0x38230f[_0x3259('0x28')];}_0x5340bd[_0x3259('0x1b')](_0x31bd03)[_0x3259('0x29')](_0x38230f);};}exports[_0x3259('0x2a')]=function(_0x159a35,_0xb5500){var _0x139094={},_0x20abc6={},_0x4c0b4f={'count':0x0,'rows':[]};var _0x2cbfee=_[_0x3259('0x2b')](db[_0x3259('0x2c')]['rawAttributes'],function(_0x341f7d){return{'name':_0x341f7d[_0x3259('0x2d')],'type':_0x341f7d[_0x3259('0x2e')][_0x3259('0x2f')]};});_0x20abc6[_0x3259('0x30')]=_['map'](_0x2cbfee,_0x3259('0x28'));_0x20abc6['query']=_[_0x3259('0x31')](_0x159a35['query']);_0x20abc6[_0x3259('0x32')]=_[_0x3259('0x33')](_0x20abc6['model'],_0x20abc6[_0x3259('0x34')]);_0x139094[_0x3259('0x35')]=_[_0x3259('0x33')](_0x20abc6[_0x3259('0x30')],qs[_0x3259('0x36')](_0x159a35[_0x3259('0x34')][_0x3259('0x36')]));_0x139094[_0x3259('0x35')]=_0x139094[_0x3259('0x35')]['length']?_0x139094[_0x3259('0x35')]:_0x20abc6[_0x3259('0x30')];if(!_0x159a35[_0x3259('0x34')][_0x3259('0x37')]('nolimit')){_0x139094['limit']=qs[_0x3259('0x1e')](_0x159a35[_0x3259('0x34')][_0x3259('0x1e')]);_0x139094[_0x3259('0x1c')]=qs[_0x3259('0x1c')](_0x159a35[_0x3259('0x34')][_0x3259('0x1c')]);}_0x139094[_0x3259('0x38')]=qs[_0x3259('0x39')](_0x159a35[_0x3259('0x34')][_0x3259('0x39')]);_0x139094[_0x3259('0x3a')]=qs[_0x3259('0x32')](_[_0x3259('0x3b')](_0x159a35[_0x3259('0x34')],_0x20abc6[_0x3259('0x32')]),_0x2cbfee);if(_0x159a35['query'][_0x3259('0x3c')]){_0x139094[_0x3259('0x3a')]=_['merge'](_0x139094[_0x3259('0x3a')],{'$or':_[_0x3259('0x2b')](_0x2cbfee,function(_0x978035){if(_0x978035['type']!==_0x3259('0x3d')){var _0x55dff1={};_0x55dff1[_0x978035[_0x3259('0x28')]]={'$like':'%'+_0x159a35[_0x3259('0x34')][_0x3259('0x3c')]+'%'};return _0x55dff1;}})});}_0x139094=_[_0x3259('0x3e')]({},_0x139094,_0x159a35[_0x3259('0x3f')]);var _0x2abe72={'where':_0x139094['where']};return db[_0x3259('0x2c')][_0x3259('0x1f')](_0x2abe72)[_0x3259('0x25')](function(_0x26ef76){_0x4c0b4f['count']=_0x26ef76;if(_0x159a35['query']['includeAll']){_0x139094['include']=[{'all':!![]}];}return db[_0x3259('0x2c')][_0x3259('0x40')](_0x139094);})[_0x3259('0x25')](function(_0xeb8865){_0x4c0b4f[_0x3259('0x41')]=_0xeb8865;return _0x4c0b4f;})['then'](respondWithFilteredResult(_0xb5500,_0x139094))[_0x3259('0x42')](handleError(_0xb5500,null));};exports[_0x3259('0x43')]=function(_0x3c044f,_0x47e131){var _0x16c7ce={'raw':!![],'where':{'id':_0x3c044f[_0x3259('0x44')]['id']}},_0x438be8={};_0x438be8[_0x3259('0x30')]=_['keys'](db[_0x3259('0x2c')]['rawAttributes']);_0x438be8[_0x3259('0x34')]=_[_0x3259('0x31')](_0x3c044f[_0x3259('0x34')]);_0x438be8['filters']=_[_0x3259('0x33')](_0x438be8['model'],_0x438be8['query']);_0x16c7ce['attributes']=_[_0x3259('0x33')](_0x438be8['model'],qs[_0x3259('0x36')](_0x3c044f[_0x3259('0x34')][_0x3259('0x36')]));_0x16c7ce['attributes']=_0x16c7ce['attributes'][_0x3259('0x45')]?_0x16c7ce[_0x3259('0x35')]:_0x438be8['model'];if(_0x3c044f[_0x3259('0x34')][_0x3259('0x46')]){_0x16c7ce[_0x3259('0x47')]=[{'all':!![]}];}_0x16c7ce=_[_0x3259('0x3e')]({},_0x16c7ce,_0x3c044f[_0x3259('0x3f')]);return db[_0x3259('0x2c')][_0x3259('0x48')](_0x16c7ce)[_0x3259('0x25')](handleEntityNotFound(_0x47e131,null))[_0x3259('0x25')](respondWithResult(_0x47e131,null))[_0x3259('0x42')](handleError(_0x47e131,null));};exports['clone']=function(_0x52c785,_0x58667f){var _0x16d210={'where':{'id':_0x52c785['params']['id']}},_0x507121={};_0x507121[_0x3259('0x30')]=_[_0x3259('0x31')](db[_0x3259('0x2c')][_0x3259('0x49')]);_0x16d210['attributes']=_[_0x3259('0x33')](_0x507121[_0x3259('0x30')],qs[_0x3259('0x36')](_0x52c785[_0x3259('0x34')][_0x3259('0x36')]));_0x16d210[_0x3259('0x35')]=_0x16d210[_0x3259('0x35')][_0x3259('0x45')]?_0x16d210[_0x3259('0x35')]:_0x507121[_0x3259('0x30')];if(_0x52c785['query'][_0x3259('0x46')]){_0x16d210[_0x3259('0x47')]=[{'all':!![]}];}_0x16d210=_[_0x3259('0x3e')]({},_0x16d210,_0x52c785[_0x3259('0x3f')]);return db[_0x3259('0x2c')]['find'](_0x16d210)[_0x3259('0x25')](handleEntityNotFound(_0x58667f,null))['then'](function(_0x4f86a2){if(_0x4f86a2){var _0x3f0316=_0x4f86a2['get']({'plain':!![]});_0x3f0316=qs[_0x3259('0x4a')](_0x3f0316,['id',_0x3259('0x4b'),_0x3259('0x4c')]);_0x52c785[_0x3259('0x4d')]=_['omit'](_0x52c785['body'],['id',_0x3259('0x4b'),'updatedAt']);return db[_0x3259('0x2c')][_0x3259('0x4e')](_['merge'](_0x3f0316,_0x52c785['body']),{'include':_0x52c785[_0x3259('0x34')]['includeAll']?[{'all':!![]}]:undefined});}})[_0x3259('0x25')](respondWithResult(_0x58667f,0xc9))[_0x3259('0x42')](handleError(_0x58667f,null));};exports[_0x3259('0x23')]=function(_0x5787fe,_0x563f27){if(_0x5787fe[_0x3259('0x4d')]['id']){delete _0x5787fe[_0x3259('0x4d')]['id'];}return db['Attachment'][_0x3259('0x48')]({'where':{'id':_0x5787fe[_0x3259('0x44')]['id']}})['then'](handleEntityNotFound(_0x563f27,null))['then'](saveUpdates(_0x5787fe[_0x3259('0x4d')],null))['then'](respondWithResult(_0x563f27,null))[_0x3259('0x42')](handleError(_0x563f27,null));};exports['destroy']=function(_0xccc18a,_0x517de1){return db[_0x3259('0x2c')][_0x3259('0x48')]({'where':{'id':_0xccc18a['params']['id']}})[_0x3259('0x25')](handleEntityNotFound(_0x517de1,null))[_0x3259('0x25')](removeEntity(_0x517de1,null))['catch'](handleError(_0x517de1,null));};exports[_0x3259('0x4e')]=function(_0x41c695,_0x4d643b,_0x548d50){_0x41c695[_0x3259('0x4d')][_0x3259('0x28')]=_0x41c695[_0x3259('0x4f')]['originalname'];_0x41c695[_0x3259('0x4d')][_0x3259('0x50')]=_0x41c695['file'][_0x3259('0x51')];_0x41c695['body'][_0x3259('0x2e')]=_0x41c695['file'][_0x3259('0x52')];return db[_0x3259('0x2c')][_0x3259('0x4e')](_0x41c695['body'])[_0x3259('0x25')](respondWithResult(_0x4d643b,0xc9))['catch'](handleError(_0x4d643b,null));};exports['download']=function(_0x12154a,_0x21c67e,_0xd90681){return db['Attachment'][_0x3259('0x53')]({'where':{'id':_0x12154a[_0x3259('0x44')]['id']},'raw':!![]})[_0x3259('0x25')](handleEntityNotFound(_0x21c67e,null))[_0x3259('0x25')](function(_0x24add4){if(_0x24add4){var _0x3ed40c=_0x24add4[_0x3259('0x54')]!==null;var _0x4c285f=path['join'](config['root'],'server/files/attachments/');if(_0x3ed40c){_0x4c285f=path[_0x3259('0x55')](_0x4c285f,_0x3259('0x56'));}var _0x4d10ab=path['join'](_0x4c285f,_0x24add4['basename']);return _0x21c67e[_0x3259('0x57')](_0x4d10ab);}})[_0x3259('0x42')](handleError(_0x21c67e,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 326d0c6..019cd35 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 _0xd32b=['rimraf','../../config/environment','./attachment.attributes','exports','Attachment','attachments','lodash','api','moment','bluebird','request-promise','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd32b,0x8a));var _0xbd32=function(_0x5aea51,_0x26cdfd){_0x5aea51=_0x5aea51-0x0;var _0x53d3ed=_0xd32b[_0x5aea51];return _0x53d3ed;};'use strict';var _=require(_0xbd32('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xbd32('0x1'));var moment=require(_0xbd32('0x2'));var BPromise=require(_0xbd32('0x3'));var rp=require(_0xbd32('0x4'));var fs=require('fs');var path=require(_0xbd32('0x5'));var rimraf=require(_0xbd32('0x6'));var config=require(_0xbd32('0x7'));var attributes=require(_0xbd32('0x8'));module[_0xbd32('0x9')]=function(_0x2bbb0c,_0x29a548){return _0x2bbb0c['define'](_0xbd32('0xa'),attributes,{'tableName':_0xbd32('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd033=['attachments','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./attachment.attributes','exports','Attachment'];(function(_0x314079,_0x2b98a0){var _0x423351=function(_0x501dcc){while(--_0x501dcc){_0x314079['push'](_0x314079['shift']());}};_0x423351(++_0x2b98a0);}(_0xd033,0xb5));var _0x3d03=function(_0x4c2623,_0x4838bb){_0x4c2623=_0x4c2623-0x0;var _0x2be431=_0xd033[_0x4c2623];return _0x2be431;};'use strict';var _=require(_0x3d03('0x0'));var util=require(_0x3d03('0x1'));var logger=require(_0x3d03('0x2'))(_0x3d03('0x3'));var moment=require('moment');var BPromise=require(_0x3d03('0x4'));var rp=require(_0x3d03('0x5'));var fs=require('fs');var path=require(_0x3d03('0x6'));var rimraf=require('rimraf');var config=require(_0x3d03('0x7'));var attributes=require(_0x3d03('0x8'));module[_0x3d03('0x9')]=function(_0x3738df,_0x4b672f){return _0x3738df['define'](_0x3d03('0xa'),attributes,{'tableName':_0x3d03('0xb'),'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 c8c2a7c..dead461 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 _0xecd5=['options','raw','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','CreateAttachment','Attachment','create'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xecd5,0x110));var _0x5ecd=function(_0x39fcf1,_0x527759){_0x39fcf1=_0x39fcf1-0x0;var _0xa43c71=_0xecd5[_0x39fcf1];return _0xa43c71;};'use strict';var _=require('lodash');var util=require(_0x5ecd('0x0'));var moment=require(_0x5ecd('0x1'));var BPromise=require(_0x5ecd('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5ecd('0x3'));var db=require(_0x5ecd('0x4'))['db'];var utils=require(_0x5ecd('0x5'));var logger=require(_0x5ecd('0x6'))('rpc');var config=require(_0x5ecd('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5ecd('0x8')][_0x5ecd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4a1870,_0x42c752,_0x26d951){return new BPromise(function(_0x2cb71b,_0x946412){return client[_0x5ecd('0xa')](_0x4a1870,_0x26d951)[_0x5ecd('0xb')](function(_0x305f1b){logger[_0x5ecd('0xc')](_0x5ecd('0xd'),_0x42c752,_0x5ecd('0xe'));logger[_0x5ecd('0xf')](_0x5ecd('0x10'),_0x42c752,'request\x20sent',JSON[_0x5ecd('0x11')](_0x305f1b));if(_0x305f1b['error']){if(_0x305f1b['error'][_0x5ecd('0x12')]===0x1f4){logger[_0x5ecd('0x13')]('Attachment,\x20%s,\x20%s',_0x42c752,_0x305f1b['error'][_0x5ecd('0x14')]);return _0x946412(_0x305f1b[_0x5ecd('0x13')][_0x5ecd('0x14')]);}logger[_0x5ecd('0x13')]('Attachment,\x20%s,\x20%s',_0x42c752,_0x305f1b[_0x5ecd('0x13')][_0x5ecd('0x14')]);return _0x2cb71b(_0x305f1b['error'][_0x5ecd('0x14')]);}else{logger[_0x5ecd('0xc')]('Attachment,\x20%s,\x20%s',_0x42c752,_0x5ecd('0xe'));_0x2cb71b(_0x305f1b['result'][_0x5ecd('0x14')]);}})[_0x5ecd('0x15')](function(_0x1e8e64){logger[_0x5ecd('0x13')](_0x5ecd('0xd'),_0x42c752,_0x1e8e64);_0x946412(_0x1e8e64);});});}exports[_0x5ecd('0x16')]=function(_0x231da2){var _0x189c3b=this;return new Promise(function(_0x3078ea,_0x1f7309){return db[_0x5ecd('0x17')][_0x5ecd('0x18')](_0x231da2['body'],{'raw':_0x231da2[_0x5ecd('0x19')]?_0x231da2[_0x5ecd('0x19')][_0x5ecd('0x1a')]===undefined?!![]:![]:!![]})[_0x5ecd('0xb')](function(_0xea18b7){logger['info'](_0x5ecd('0x16'),_0x231da2);logger['debug'](_0x5ecd('0x16'),_0x231da2,JSON[_0x5ecd('0x11')](_0xea18b7));_0x3078ea(_0xea18b7);})[_0x5ecd('0x15')](function(_0x3c8e2b){logger[_0x5ecd('0x13')]('CreateAttachment',_0x3c8e2b[_0x5ecd('0x14')],_0x231da2);_0x1f7309(_0x189c3b[_0x5ecd('0x13')](0x1f4,_0x3c8e2b[_0x5ecd('0x14')]));});});}; \ No newline at end of file +var _0x4c6d=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','Attachment,\x20%s,\x20%s','debug','Attachment,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','CreateAttachment','Attachment','create','body','options','raw','then'];(function(_0x36f807,_0x13d5dc){var _0x1ba824=function(_0x571eb7){while(--_0x571eb7){_0x36f807['push'](_0x36f807['shift']());}};_0x1ba824(++_0x13d5dc);}(_0x4c6d,0x1d0));var _0xd4c6=function(_0x104d7a,_0x5d9d6b){_0x104d7a=_0x104d7a-0x0;var _0x14e6de=_0x4c6d[_0x104d7a];return _0x14e6de;};'use strict';var _=require(_0xd4c6('0x0'));var util=require(_0xd4c6('0x1'));var moment=require(_0xd4c6('0x2'));var BPromise=require(_0xd4c6('0x3'));var rs=require(_0xd4c6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd4c6('0x5'))['db'];var utils=require(_0xd4c6('0x6'));var logger=require(_0xd4c6('0x7'))('rpc');var config=require(_0xd4c6('0x8'));var jayson=require(_0xd4c6('0x9'));var client=jayson['client'][_0xd4c6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x316314,_0x4329e3,_0x5d4fce){return new BPromise(function(_0x440ee3,_0x19ce1c){return client[_0xd4c6('0xb')](_0x316314,_0x5d4fce)['then'](function(_0xe2f90b){logger[_0xd4c6('0xc')](_0xd4c6('0xd'),_0x4329e3,'request\x20sent');logger[_0xd4c6('0xe')](_0xd4c6('0xf'),_0x4329e3,_0xd4c6('0x10'),JSON[_0xd4c6('0x11')](_0xe2f90b));if(_0xe2f90b[_0xd4c6('0x12')]){if(_0xe2f90b[_0xd4c6('0x12')]['code']===0x1f4){logger['error'](_0xd4c6('0xd'),_0x4329e3,_0xe2f90b['error'][_0xd4c6('0x13')]);return _0x19ce1c(_0xe2f90b[_0xd4c6('0x12')][_0xd4c6('0x13')]);}logger[_0xd4c6('0x12')](_0xd4c6('0xd'),_0x4329e3,_0xe2f90b[_0xd4c6('0x12')][_0xd4c6('0x13')]);return _0x440ee3(_0xe2f90b['error']['message']);}else{logger[_0xd4c6('0xc')](_0xd4c6('0xd'),_0x4329e3,_0xd4c6('0x10'));_0x440ee3(_0xe2f90b[_0xd4c6('0x14')][_0xd4c6('0x13')]);}})[_0xd4c6('0x15')](function(_0xe52075){logger['error'](_0xd4c6('0xd'),_0x4329e3,_0xe52075);_0x19ce1c(_0xe52075);});});}exports[_0xd4c6('0x16')]=function(_0x23a16f){var _0x2c97b=this;return new Promise(function(_0x31f328,_0x54e0a5){return db[_0xd4c6('0x17')][_0xd4c6('0x18')](_0x23a16f[_0xd4c6('0x19')],{'raw':_0x23a16f['options']?_0x23a16f[_0xd4c6('0x1a')][_0xd4c6('0x1b')]===undefined?!![]:![]:!![]})[_0xd4c6('0x1c')](function(_0x3b1658){logger['info'](_0xd4c6('0x16'),_0x23a16f);logger['debug'](_0xd4c6('0x16'),_0x23a16f,JSON[_0xd4c6('0x11')](_0x3b1658));_0x31f328(_0x3b1658);})[_0xd4c6('0x15')](function(_0x222813){logger[_0xd4c6('0x12')](_0xd4c6('0x16'),_0x222813[_0xd4c6('0x13')],_0x23a16f);_0x54e0a5(_0x2c97b[_0xd4c6('0x12')](0x1f4,_0x222813[_0xd4c6('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index 8dfdf58..8d438a7 100644 --- a/server/api/attachment/index.js +++ b/server/api/attachment/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['show','/:id/download','download','post','/:id/clone','clone','root','server/files/attachments/','format','now','originalname','replace','single','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./attachment.controller','get','isAuthenticated','index','/:id'];(function(_0x268f91,_0x59a826){var _0x3926d8=function(_0x1f5e17){while(--_0x1f5e17){_0x268f91['push'](_0x268f91['shift']());}};_0x3926d8(++_0x59a826);}(_0x5f2f,0x73));var _0xf5f2=function(_0x11cbbb,_0x3de5a1){_0x11cbbb=_0x11cbbb-0x0;var _0x5a9473=_0x5f2f[_0x11cbbb];return _0x5a9473;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x10')](_0xf5f2('0x11'),auth['isAuthenticated'](),controller[_0xf5f2('0x12')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x53fb33,_0xa7e1a6,_0x151aba){_0x151aba(null,path['join'](config[_0xf5f2('0x13')],_0xf5f2('0x14')));},'filename':function(_0x331482,_0x3f2997,_0x59bb6c){_0x59bb6c(null,util[_0xf5f2('0x15')]('%s-%s',Date[_0xf5f2('0x16')](),_0x3f2997[_0xf5f2('0x17')][_0xf5f2('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf5f2('0x10')]('/',upload[_0xf5f2('0x19')]('file'),controller[_0xf5f2('0x1a')]);router[_0xf5f2('0x1b')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1c')]);router[_0xf5f2('0x1d')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1e')]);module[_0xf5f2('0x1f')]=router; \ No newline at end of file +var _0x0b0e=['/:id/clone','clone','diskStorage','join','server/files/attachments/','format','now','originalname','replace','single','create','/:id','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','isAuthenticated','index','show','/:id/download','post'];(function(_0x3c2a69,_0x4c8b41){var _0x596bc8=function(_0x1b4b7c){while(--_0x1b4b7c){_0x3c2a69['push'](_0x3c2a69['shift']());}};_0x596bc8(++_0x4c8b41);}(_0x0b0e,0x187));var _0xe0b0=function(_0x2fd69d,_0xeb1037){_0x2fd69d=_0x2fd69d-0x0;var _0x5d5ef3=_0x0b0e[_0x2fd69d];return _0x5d5ef3;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['download']);router[_0xe0b0('0xe')](_0xe0b0('0xf'),auth['isAuthenticated'](),controller[_0xe0b0('0x10')]);var upload=multer({'storage':multer[_0xe0b0('0x11')]({'destination':function(_0x574d96,_0x399320,_0x2cdad2){_0x2cdad2(null,path[_0xe0b0('0x12')](config['root'],_0xe0b0('0x13')));},'filename':function(_0x1c358a,_0x3cc19a,_0x45f914){_0x45f914(null,util[_0xe0b0('0x14')]('%s-%s',Date[_0xe0b0('0x15')](),_0x3cc19a[_0xe0b0('0x16')][_0xe0b0('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xe0b0('0xe')]('/',upload[_0xe0b0('0x18')]('file'),controller[_0xe0b0('0x19')]);router['put'](_0xe0b0('0x1a'),auth[_0xe0b0('0xa')](),controller['update']);router[_0xe0b0('0x1b')]('/:id',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x1c')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js index 5390813..4c939f0 100644 --- a/server/api/authActiveDirectory/authActiveDirectory.controller.js +++ b/server/api/authActiveDirectory/authActiveDirectory.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8420=['blockDuration','then','name','password','online','user','agent','domain','blockedAt','minutes','clearBlockUser','getLicense','status','send','message','login','ad-login','role','json','use','User','passport','passport-local','Strategy','activedirectory2','bluebird','../../mysqldb','../../components/auth/service','../../config/logger','activedirectory','undefined','baseDN','authenticate','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','adSsoEnabled'];(function(_0x2d7a7b,_0x3f026a){var _0x154863=function(_0x137b84){while(--_0x137b84){_0x2d7a7b['push'](_0x2d7a7b['shift']());}};_0x154863(++_0x3f026a);}(_0x8420,0x15d));var _0x0842=function(_0x760435,_0x1fe15a){_0x760435=_0x760435-0x0;var _0x3cce65=_0x8420[_0x760435];return _0x3cce65;};'use strict';var passport=require(_0x0842('0x0'));var LocalStrategy=require(_0x0842('0x1'))[_0x0842('0x2')];var moment=require('moment');var ActiveDirectory=require(_0x0842('0x3'));var BPromise=require(_0x0842('0x4'));var util=require('util');var db=require(_0x0842('0x5'))['db'];var authService=require(_0x0842('0x6'));var utils=require('../../config/utils');var config=require('../../config/environment');var logger=require(_0x0842('0x7'))('api');function isActiveDirectoryConfigured(_0x44b8d6){var _0x12a77b=![];if(typeof _0x44b8d6[_0x0842('0x8')]!==_0x0842('0x9')){_0x12a77b=_0x44b8d6[_0x0842('0x8')][_0x0842('0xa')]&&_0x44b8d6[_0x0842('0x8')]['url']&&_0x44b8d6[_0x0842('0x8')]['domain'];}return _0x12a77b;}function adAuthenticate(_0x1aba90,_0x2f8d00,_0x2197fe){return new BPromise(function(_0x2ccd5f,_0x79bb41){try{var _0x16d29f=new ActiveDirectory(_0x1aba90);_0x16d29f[_0x0842('0xb')](_0x2f8d00,_0x2197fe,function(_0xdca385,_0x1f7cbe){if(_0xdca385){logger[_0x0842('0xc')](_0x0842('0xd'),_0x2f8d00,util[_0x0842('0xe')](_0xdca385,{'showHidden':![],'depth':null}));_0x79bb41(_0x0842('0xf'));}else if(!_0x1f7cbe){logger['error'](_0x0842('0x10'),_0x2f8d00);_0x79bb41('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x2ccd5f(_0x1f7cbe);}});}catch(_0x6de164){_0x79bb41(_0x6de164);}});}function ActiveDirectoryAuthenticate(_0x365c57,_0x58e8f2,_0x4fbcd1,_0x3b83fd){var _0x5a9d46,_0x219428;if(!isActiveDirectoryConfigured(config)){logger[_0x0842('0xc')](_0x0842('0x11'),_0x58e8f2);return _0x3b83fd(null,![],{'message':_0x0842('0xf')});}return db[_0x0842('0x12')]['findOne']({'where':{'id':0x1},'attributes':[_0x0842('0x13'),_0x0842('0x14')],'raw':!![]})[_0x0842('0x15')](function(_0x3dfb61){_0x5a9d46=_0x3dfb61;if(!_0x5a9d46['adSsoEnabled']){logger[_0x0842('0xc')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled',_0x58e8f2);throw new Error(_0x0842('0xf'));}return _0x365c57['findOne']({'attributes':['id',_0x0842('0x16'),_0x0842('0x17'),'salt','role','disabled','blocked','blockedAt',_0x0842('0x18')],'where':{'name':_0x58e8f2,'role':{'$or':['admin',_0x0842('0x19'),_0x0842('0x1a')]},'adSsoEnabled':!![]}});})[_0x0842('0x15')](function(_0x13c0f3){if(!_0x13c0f3||_0x13c0f3&&_0x13c0f3[_0x0842('0x16')]!==_0x58e8f2){throw new Error(_0x0842('0xf'));}_0x219428=_0x13c0f3;var _0x48f21d=_0x219428[_0x0842('0x16')]+'@'+config[_0x0842('0x8')][_0x0842('0x1b')];return adAuthenticate(config['activedirectory'],_0x48f21d,_0x4fbcd1);})[_0x0842('0x15')](function(_0x5ed5da){if(_0x219428['disabled']){throw new Error(_0x0842('0xf'));}if(_0x5a9d46['blockDuration']>0x0){if(_0x219428['blocked']){if(moment(_0x219428[_0x0842('0x1c')])['add'](_0x5a9d46[_0x0842('0x14')],_0x0842('0x1d'))>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils[_0x0842('0x1e')](_0x219428,0x0,![],null)[_0x0842('0x15')](function(){return utils[_0x0842('0x1f')](_0x219428);})[_0x0842('0x15')](function(){return _0x3b83fd(null,_0x219428);});}else{return utils[_0x0842('0x1f')](_0x219428)[_0x0842('0x15')](function(){return _0x3b83fd(null,_0x219428);});}}else{return utils[_0x0842('0x1f')](_0x219428)['then'](function(){return _0x3b83fd(null,_0x219428);});}})['catch'](function(_0x273c67){return _0x3b83fd(null,![],_0x273c67);});}function handleError(_0x3edaa9,_0x14738b,_0x2ad8c5){return _0x3edaa9[_0x0842('0x20')](_0x14738b||0x1f4)[_0x0842('0x21')]({'message':_0x2ad8c5?_0x2ad8c5[_0x0842('0x22')]||_0x2ad8c5:''});}exports[_0x0842('0x23')]=function(_0x2f7330,_0x5b5055,_0x63013c){passport[_0x0842('0xb')](_0x0842('0x24'),function(_0x2c0d59,_0x8132,_0x4e6067){var _0x40009f=_0x2c0d59||_0x4e6067;if(_0x40009f){return handleError(_0x5b5055,0x191,_0x40009f);}if(!_0x8132){return handleError(_0x5b5055,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0xa41056={'payload':{'id':_0x8132['id'],'role':_0x8132[_0x0842('0x25')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0xa41056)[_0x0842('0x15')](function(_0x28d591){_0x5b5055[_0x0842('0x26')]({'id':_0x8132['id'],'token':_0x28d591,'statusCall':'','isAlreadyLogged':_0x8132[_0x0842('0x18')]});});}})(_0x2f7330,_0x5b5055,_0x63013c);};passport[_0x0842('0x27')]('ad-login',new LocalStrategy({'usernameField':_0x0842('0x16'),'passwordField':_0x0842('0x17')},function(_0x38c6fc,_0x53ba80,_0x8ffb3b){return ActiveDirectoryAuthenticate(db[_0x0842('0x28')],_0x38c6fc,_0x53ba80,_0x8ffb3b);})); \ No newline at end of file +var _0x2865=['getLicense','catch','status','message','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','online','use','User','Strategy','moment','bluebird','util','../../config/utils','../../config/environment','../../config/logger','api','undefined','baseDN','domain','authenticate','Error\x20authenticate\x20%s:\x20%s','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','error','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','findOne','blockDuration','then','adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','role','disabled','blocked','blockedAt','admin','agent','activedirectory','add','minutes','clearBlockUser'];(function(_0x81b5b2,_0x425bbd){var _0x9abf13=function(_0x1b9fc5){while(--_0x1b9fc5){_0x81b5b2['push'](_0x81b5b2['shift']());}};_0x9abf13(++_0x425bbd);}(_0x2865,0xbe));var _0x5286=function(_0x4f6105,_0x22cf95){_0x4f6105=_0x4f6105-0x0;var _0x4b1e2a=_0x2865[_0x4f6105];return _0x4b1e2a;};'use strict';var passport=require('passport');var LocalStrategy=require('passport-local')[_0x5286('0x0')];var moment=require(_0x5286('0x1'));var ActiveDirectory=require('activedirectory2');var BPromise=require(_0x5286('0x2'));var util=require(_0x5286('0x3'));var db=require('../../mysqldb')['db'];var authService=require('../../components/auth/service');var utils=require(_0x5286('0x4'));var config=require(_0x5286('0x5'));var logger=require(_0x5286('0x6'))(_0x5286('0x7'));function isActiveDirectoryConfigured(_0xe36903){var _0x11e710=![];if(typeof _0xe36903['activedirectory']!==_0x5286('0x8')){_0x11e710=_0xe36903['activedirectory'][_0x5286('0x9')]&&_0xe36903['activedirectory']['url']&&_0xe36903['activedirectory'][_0x5286('0xa')];}return _0x11e710;}function adAuthenticate(_0x2ea76c,_0x1c63ad,_0x5d2de2){return new BPromise(function(_0x28da6c,_0x1e88ed){try{var _0x663bae=new ActiveDirectory(_0x2ea76c);_0x663bae[_0x5286('0xb')](_0x1c63ad,_0x5d2de2,function(_0x16bee6,_0x530a16){if(_0x16bee6){logger['error'](_0x5286('0xc'),_0x1c63ad,util['inspect'](_0x16bee6,{'showHidden':![],'depth':null}));_0x1e88ed('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x530a16){logger['error'](_0x5286('0xd'),_0x1c63ad);_0x1e88ed(_0x5286('0xe'));}else{_0x28da6c(_0x530a16);}});}catch(_0x21c879){_0x1e88ed(_0x21c879);}});}function ActiveDirectoryAuthenticate(_0x5c6720,_0x132671,_0x1f68ca,_0x5d3a16){var _0x2f4710,_0x4a3c35;if(!isActiveDirectoryConfigured(config)){logger[_0x5286('0xf')](_0x5286('0x10'),_0x132671);return _0x5d3a16(null,![],{'message':_0x5286('0xe')});}return db['Setting'][_0x5286('0x11')]({'where':{'id':0x1},'attributes':['adSsoEnabled',_0x5286('0x12')],'raw':!![]})[_0x5286('0x13')](function(_0x18f982){_0x2f4710=_0x18f982;if(!_0x2f4710[_0x5286('0x14')]){logger[_0x5286('0xf')](_0x5286('0x15'),_0x132671);throw new Error(_0x5286('0xe'));}return _0x5c6720['findOne']({'attributes':['id',_0x5286('0x16'),_0x5286('0x17'),_0x5286('0x18'),_0x5286('0x19'),_0x5286('0x1a'),_0x5286('0x1b'),_0x5286('0x1c'),'online'],'where':{'name':_0x132671,'role':{'$or':[_0x5286('0x1d'),'user',_0x5286('0x1e')]},'adSsoEnabled':!![]}});})['then'](function(_0x3b443b){if(!_0x3b443b||_0x3b443b&&_0x3b443b['name']!==_0x132671){throw new Error(_0x5286('0xe'));}_0x4a3c35=_0x3b443b;var _0x2132de=_0x4a3c35[_0x5286('0x16')]+'@'+config[_0x5286('0x1f')][_0x5286('0xa')];return adAuthenticate(config['activedirectory'],_0x2132de,_0x1f68ca);})[_0x5286('0x13')](function(_0x2cdd1f){if(_0x4a3c35[_0x5286('0x1a')]){throw new Error(_0x5286('0xe'));}if(_0x2f4710['blockDuration']>0x0){if(_0x4a3c35[_0x5286('0x1b')]){if(moment(_0x4a3c35[_0x5286('0x1c')])[_0x5286('0x20')](_0x2f4710['blockDuration'],_0x5286('0x21'))>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils[_0x5286('0x22')](_0x4a3c35,0x0,![],null)['then'](function(){return utils['getLicense'](_0x4a3c35);})[_0x5286('0x13')](function(){return _0x5d3a16(null,_0x4a3c35);});}else{return utils[_0x5286('0x23')](_0x4a3c35)['then'](function(){return _0x5d3a16(null,_0x4a3c35);});}}else{return utils['getLicense'](_0x4a3c35)[_0x5286('0x13')](function(){return _0x5d3a16(null,_0x4a3c35);});}})[_0x5286('0x24')](function(_0x2558e6){return _0x5d3a16(null,![],_0x2558e6);});}function handleError(_0xfd4f85,_0x1a6d2a,_0x312ca0){return _0xfd4f85[_0x5286('0x25')](_0x1a6d2a||0x1f4)['send']({'message':_0x312ca0?_0x312ca0[_0x5286('0x26')]||_0x312ca0:''});}exports['login']=function(_0x3fa253,_0x36ad27,_0x4396fc){passport[_0x5286('0xb')](_0x5286('0x27'),function(_0x29c4ce,_0x2bc61a,_0x4c5d5d){var _0x15db9d=_0x29c4ce||_0x4c5d5d;if(_0x15db9d){return handleError(_0x36ad27,0x191,_0x15db9d);}if(!_0x2bc61a){return handleError(_0x36ad27,0x194,{'message':_0x5286('0x28')});}else{var _0x16330b={'payload':{'id':_0x2bc61a['id'],'role':_0x2bc61a[_0x5286('0x19')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x16330b)[_0x5286('0x13')](function(_0x2af629){_0x36ad27[_0x5286('0x29')]({'id':_0x2bc61a['id'],'token':_0x2af629,'statusCall':'','isAlreadyLogged':_0x2bc61a[_0x5286('0x2a')]});});}})(_0x3fa253,_0x36ad27,_0x4396fc);};passport[_0x5286('0x2b')](_0x5286('0x27'),new LocalStrategy({'usernameField':'name','passwordField':_0x5286('0x17')},function(_0x9738d4,_0x45b221,_0x3fd0f6){return ActiveDirectoryAuthenticate(db[_0x5286('0x2c')],_0x9738d4,_0x45b221,_0x3fd0f6);})); \ No newline at end of file diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js index 2e822c8..985b30b 100644 --- a/server/api/authActiveDirectory/index.js +++ b/server/api/authActiveDirectory/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1a0a=['Router','./authActiveDirectory.controller','exports'];(function(_0x5c5cdf,_0x16c385){var _0x3beba0=function(_0x520adc){while(--_0x520adc){_0x5c5cdf['push'](_0x5c5cdf['shift']());}};_0x3beba0(++_0x16c385);}(_0x1a0a,0x9c));var _0xa1a0=function(_0x3725ee,_0x543bd9){_0x3725ee=_0x3725ee-0x0;var _0x399c71=_0x1a0a[_0x3725ee];return _0x399c71;};'use strict';var express=require('express');var router=express[_0xa1a0('0x0')]();var controller=require(_0xa1a0('0x1'));router['post']('/',controller['login']);module[_0xa1a0('0x2')]=router; \ No newline at end of file +var _0x445d=['Router','./authActiveDirectory.controller','post','exports'];(function(_0xf5ba21,_0x59d12d){var _0x2df778=function(_0x555bb1){while(--_0x555bb1){_0xf5ba21['push'](_0xf5ba21['shift']());}};_0x2df778(++_0x59d12d);}(_0x445d,0x94));var _0xd445=function(_0x2ab7e0,_0x4604bf){_0x2ab7e0=_0x2ab7e0-0x0;var _0x5db18f=_0x445d[_0x2ab7e0];return _0x5db18f;};'use strict';var express=require('express');var router=express[_0xd445('0x0')]();var controller=require(_0xd445('0x1'));router[_0xd445('0x2')]('/',controller['login']);module[_0xd445('0x3')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index c0cb70b..2b759e0 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 _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x11ccd3,_0x8e487a){var _0xec3d42=function(_0x195dcc){while(--_0x195dcc){_0x11ccd3['push'](_0x11ccd3['shift']());}};_0xec3d42(++_0x8e487a);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});})); \ No newline at end of file +var _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0xcd46bc,_0x3f6dfc){var _0x32ed4a=function(_0x23cfde){while(--_0x23cfde){_0xcd46bc['push'](_0xcd46bc['shift']());}};_0x32ed4a(++_0x3f6dfc);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index 6cc14ab..13fc786 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 _0x06e4=['../user/user.controller.js','get','login','/callback','callback','isMiddleware','exports','passport'];(function(_0xdb024,_0xf824fc){var _0x15ff49=function(_0xd942e6){while(--_0xd942e6){_0xdb024['push'](_0xdb024['shift']());}};_0x15ff49(++_0xf824fc);}(_0x06e4,0x1ef));var _0x406e=function(_0x2cb870,_0x178ba3){_0x2cb870=_0x2cb870-0x0;var _0x559f67=_0x06e4[_0x2cb870];return _0x559f67;};'use strict';var express=require('express');var passport=require(_0x406e('0x0'));var router=express['Router']();var controller=require('./authGoogle.controller');var userController=require(_0x406e('0x1'));var authService=require('../../components/auth/service');router[_0x406e('0x2')]('/',controller[_0x406e('0x3')]);router['get'](_0x406e('0x4'),controller[_0x406e('0x5')],authService[_0x406e('0x6')],userController[_0x406e('0x3')],authService['setTokenCookie']);module[_0x406e('0x7')]=router; \ No newline at end of file +var _0x785d=['../../components/auth/service','login','get','callback','isMiddleware','exports','express','passport','Router','./authGoogle.controller','../user/user.controller.js'];(function(_0x224b56,_0x2415f0){var _0xe0a2d3=function(_0x24c6af){while(--_0x24c6af){_0x224b56['push'](_0x224b56['shift']());}};_0xe0a2d3(++_0x2415f0);}(_0x785d,0x1b3));var _0xd785=function(_0x26b841,_0x36a2bd){_0x26b841=_0x26b841-0x0;var _0x100c93=_0x785d[_0x26b841];return _0x100c93;};'use strict';var express=require(_0xd785('0x0'));var passport=require(_0xd785('0x1'));var router=express[_0xd785('0x2')]();var controller=require(_0xd785('0x3'));var userController=require(_0xd785('0x4'));var authService=require(_0xd785('0x5'));router['get']('/',controller[_0xd785('0x6')]);router[_0xd785('0x7')]('/callback',controller[_0xd785('0x8')],authService[_0xd785('0x9')],userController['login'],authService['setTokenCookie']);module[_0xd785('0xa')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index 4ccd8cc..649f995 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 _0xd0a7=['blocked','blockedAt','user','agent','then','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','loginAttempts','allowedLoginAttempts','add','minutes','clearBlockUser','getLicense','catch','MailAccount','find','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','\x22%s\x22\x20<%s>','email','SendMail','format','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','error','message','stringify','status','send','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','online','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','host','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','User','params','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','enforcePasswordHistory','securePassword','previousPasswords','validatePasswordHistory','Password\x20reset!','use','util','passport','passport-local','jayson/promise','lodash','randomstring','moment','../../components/auth/service','http','Setting','findOne','blockDuration','name','password','salt','role','disabled'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xd0a7,0x133));var _0x7d0a=function(_0x3de1a6,_0x441577){_0x3de1a6=_0x3de1a6-0x0;var _0x27bf2e=_0xd0a7[_0x3de1a6];return _0x27bf2e;};'use strict';var util=require(_0x7d0a('0x0'));var passport=require(_0x7d0a('0x1'));var LocalStrategy=require(_0x7d0a('0x2'))['Strategy'];var jayson=require(_0x7d0a('0x3'));var _=require(_0x7d0a('0x4'));var rs=require(_0x7d0a('0x5'));var moment=require(_0x7d0a('0x6'));var db=require('../../mysqldb')['db'];var authService=require(_0x7d0a('0x7'));var utils=require('../../config/utils');var client=jayson['client'][_0x7d0a('0x8')]({'port':0x232b});function localAuthenticate(_0x14d13e,_0x1f24dd,_0x4d9bcc,_0xd45891){var _0x48f3bc,_0x667607;return db[_0x7d0a('0x9')][_0x7d0a('0xa')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x7d0a('0xb')],'raw':!![]})['then'](function(_0x1ca5bb){_0x48f3bc=_0x1ca5bb;return _0x14d13e['findOne']({'attributes':['id',_0x7d0a('0xc'),_0x7d0a('0xd'),_0x7d0a('0xe'),_0x7d0a('0xf'),_0x7d0a('0x10'),_0x7d0a('0x11'),_0x7d0a('0x12'),'loginAttempts'],'where':{'name':_0x1f24dd,'role':{'$or':['admin',_0x7d0a('0x13'),_0x7d0a('0x14')]}}});})[_0x7d0a('0x15')](function(_0x3467cf){if(!_0x3467cf||_0x3467cf&&_0x3467cf['name']!==_0x1f24dd){throw new Error(_0x7d0a('0x16'));}else{_0x667607=_0x3467cf;return _0x667607;}})[_0x7d0a('0x15')](function(){_0x667607[_0x7d0a('0x17')](_0x4d9bcc,function(_0x574875,_0x1dc2ef){var _0x40c7f9=_0x667607[_0x7d0a('0x18')]+0x1;if(_0x574875){return _0xd45891(_0x574875);}else if(!_0x1dc2ef){if(_0x667607['disabled']){return _0xd45891(null,![],{'message':_0x7d0a('0x16')});}else if(_0x48f3bc[_0x7d0a('0x19')]>0x0){if(_0x667607['blocked']){if(_0x48f3bc[_0x7d0a('0xb')]>0x0){if(moment(_0x667607[_0x7d0a('0x12')])[_0x7d0a('0x1a')](_0x48f3bc[_0x7d0a('0xb')],_0x7d0a('0x1b'))>moment()){return _0xd45891(null,![],{'message':_0x7d0a('0x16')});}else{return utils[_0x7d0a('0x1c')](_0x667607,_0x40c7f9,![],null)['then'](function(){return _0xd45891(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0xd45891(null,![],{'message':_0x7d0a('0x16')});}}else{if(_0x40c7f9>=_0x48f3bc[_0x7d0a('0x19')]){return utils[_0x7d0a('0x1c')](_0x667607,0x0,!![],moment())['then'](function(){return _0xd45891(null,![],{'message':_0x7d0a('0x16')});});}else{return utils[_0x7d0a('0x1c')](_0x667607,_0x40c7f9,![],null)['then'](function(){return _0xd45891(null,![],{'message':_0x7d0a('0x16')});});}}}else{return _0xd45891(null,![],{'message':_0x7d0a('0x16')});}}else{if(_0x667607[_0x7d0a('0x10')]){return _0xd45891(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x48f3bc['allowedLoginAttempts']>0x0){if(_0x667607[_0x7d0a('0x11')]){if(_0x48f3bc[_0x7d0a('0xb')]>0x0){if(moment(_0x667607[_0x7d0a('0x12')])[_0x7d0a('0x1a')](_0x48f3bc['blockDuration'],_0x7d0a('0x1b'))>moment()){return _0xd45891(null,![],{'message':_0x7d0a('0x16')});}else{return utils[_0x7d0a('0x1c')](_0x667607,0x0,![],null)[_0x7d0a('0x15')](function(){return utils[_0x7d0a('0x1d')](_0x667607);})[_0x7d0a('0x15')](function(){return _0xd45891(null,_0x667607);});}}else{return _0xd45891(null,![],{'message':_0x7d0a('0x16')});}}else{return utils['clearBlockUser'](_0x667607,0x0,![],null)[_0x7d0a('0x15')](function(){return utils[_0x7d0a('0x1d')](_0x667607);})[_0x7d0a('0x15')](function(){return _0xd45891(null,_0x667607);})[_0x7d0a('0x1e')](function(_0x21056a){return _0xd45891(null,![],_0x21056a);});}}else{if(_0x667607[_0x7d0a('0x11')]){return _0xd45891(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['getLicense'](_0x667607)['then'](function(){return _0xd45891(null,_0x667607);});}}}});})[_0x7d0a('0x1e')](function(_0x524a5b){return _0xd45891(null,![],_0x524a5b);});}function sendServiceMail(_0x181e5a){return db[_0x7d0a('0x1f')][_0x7d0a('0x20')]({'where':{'service':!![]},'attributes':['id','name','email'],'include':[{'model':db[_0x7d0a('0x21')],'as':_0x7d0a('0x22'),'include':[{'model':db[_0x7d0a('0x23')],'as':_0x7d0a('0x23')}]}]})[_0x7d0a('0x15')](function(_0x1a43dd){if(!_0x1a43dd){throw new Error(_0x7d0a('0x24'));}var _0x475a83=_0x1a43dd[_0x7d0a('0x25')]();var _0x369052={'account':_0x475a83,'message':_[_0x7d0a('0x26')]({'from':util['format'](_0x7d0a('0x27'),_0x1a43dd[_0x7d0a('0xc')],_0x1a43dd[_0x7d0a('0x28')]||_0x1a43dd[_0x7d0a('0x22')]['user'])},_0x181e5a)};return client['request'](_0x7d0a('0x29'),_0x369052);})[_0x7d0a('0x15')](function(_0x5b25d4){if(_0x5b25d4['error']){throw new Error(util[_0x7d0a('0x2a')](_0x7d0a('0x2b'),_0x5b25d4[_0x7d0a('0x2c')][_0x7d0a('0x2d')]||JSON[_0x7d0a('0x2e')](_0x5b25d4[_0x7d0a('0x2c')])));}return!![];});}function handleError(_0x2181c4,_0x15ebe0,_0x114f63){return _0x2181c4[_0x7d0a('0x2f')](_0x15ebe0||0x1f4)[_0x7d0a('0x30')]({'message':_0x114f63?_0x114f63[_0x7d0a('0x2d')]||_0x114f63:''});}exports[_0x7d0a('0x31')]=function(_0x2f7786,_0x7e81bb,_0x2bb41e){passport[_0x7d0a('0x17')](_0x7d0a('0x32'),function(_0x40ec62,_0x14a556,_0xc1458f){var _0x464a65=_0x40ec62||_0xc1458f;if(_0x464a65){return handleError(_0x7e81bb,0x191,_0x464a65);}if(!_0x14a556){return handleError(_0x7e81bb,0x194,{'message':_0x7d0a('0x33')});}else{var _0x46e783={'payload':{'id':_0x14a556['id'],'role':_0x14a556['role']},'options':{'expiresIn':0x15180}};return authService[_0x7d0a('0x34')](_0x46e783)[_0x7d0a('0x15')](function(_0x502c30){_0x7e81bb['json']({'id':_0x14a556['id'],'token':_0x502c30,'statusCall':'','isAlreadyLogged':_0x14a556[_0x7d0a('0x35')]});});}})(_0x2f7786,_0x7e81bb,_0x2bb41e);};exports['forgot']=function(_0x2eebcf,_0x428136){if(!_0x2eebcf[_0x7d0a('0x36')][_0x7d0a('0x28')]){return handleError(_0x428136,0x1f4,{'message':_0x7d0a('0x37')});}var _0x5c82a2=rs[_0x7d0a('0x38')]();_0x2eebcf[_0x7d0a('0x36')][_0x7d0a('0x28')]=_0x2eebcf['body'][_0x7d0a('0x28')][_0x7d0a('0x39')]()[_0x7d0a('0x3a')]();var _0x403cde;return db[_0x7d0a('0x9')]['findOne']({'where':{'id':0x1},'attributes':[_0x7d0a('0x19'),_0x7d0a('0xb')],'raw':!![]})[_0x7d0a('0x15')](function(_0x4d8037){_0x403cde=_0x4d8037;return db['User'][_0x7d0a('0x20')]({'where':{'email':_0x2eebcf[_0x7d0a('0x36')]['email']}});})['then'](function(_0x3475e2){if(!_0x3475e2){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x3475e2['disabled']){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x3475e2[_0x7d0a('0x11')]){if(moment(_0x3475e2[_0x7d0a('0x12')])[_0x7d0a('0x1a')](_0x403cde['blockDuration'],_0x7d0a('0x1b'))>moment()){throw new Error(_0x7d0a('0x3b'));}else{_0x3475e2[_0x7d0a('0x11')]=![];_0x3475e2[_0x7d0a('0x12')]=null;}}_0x3475e2[_0x7d0a('0x3c')]=_0x5c82a2;_0x3475e2[_0x7d0a('0x3d')]=Date[_0x7d0a('0x3e')]()+0x36ee80;return _0x3475e2[_0x7d0a('0x3f')]();})[_0x7d0a('0x15')](function(){return sendServiceMail({'to':_0x2eebcf[_0x7d0a('0x36')][_0x7d0a('0x28')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0x7d0a('0x40')+_0x7d0a('0x41')+_0x7d0a('0x42')+_0x2eebcf[_0x7d0a('0x43')][_0x7d0a('0x44')]+'/reset/'+_0x5c82a2+'\x0a\x0a'+_0x7d0a('0x45')});})[_0x7d0a('0x15')](function(){_0x428136[_0x7d0a('0x2f')](0xc8)[_0x7d0a('0x30')]({'message':_0x7d0a('0x46')});})[_0x7d0a('0x1e')](function(_0x112f63){return handleError(_0x428136,0x1f4,_0x112f63);});};exports[_0x7d0a('0x47')]=function(_0x1f246c,_0x21580e){return db[_0x7d0a('0x48')][_0x7d0a('0x20')]({'where':{'resetPasswordToken':_0x1f246c[_0x7d0a('0x49')]['token'],'resetPasswordExpires':{'$gt':Date[_0x7d0a('0x3e')]()}}})[_0x7d0a('0x15')](function(_0x1723db){if(!_0x1723db){throw new Error(_0x7d0a('0x4a'));}return db[_0x7d0a('0x9')][_0x7d0a('0xa')]({'attributes':['id','securePassword',_0x7d0a('0x4b'),'passwordHistoryLimit']})[_0x7d0a('0x15')](function(_0xb20245){if(_0xb20245[_0x7d0a('0x4c')])authService['validatePasswordPattern'](_0x1f246c[_0x7d0a('0x36')][_0x7d0a('0xd')]);if(!_0xb20245[_0x7d0a('0x4b')]||!_0x1723db[_0x7d0a('0x4d')])return _0x1723db;authService[_0x7d0a('0x4e')](_0x1f246c[_0x7d0a('0x36')][_0x7d0a('0xd')],_0x1723db[_0x7d0a('0x4d')],_0xb20245['passwordHistoryLimit']);return _0x1723db;})[_0x7d0a('0x15')](function(){_0x1723db[_0x7d0a('0xd')]=_0x1f246c[_0x7d0a('0x36')][_0x7d0a('0xd')];_0x1723db['resetPasswordToken']=null;_0x1723db[_0x7d0a('0x3d')]=null;return _0x1723db[_0x7d0a('0x3f')]();});})[_0x7d0a('0x15')](function(){_0x21580e['status'](0xc8)[_0x7d0a('0x30')]({'message':_0x7d0a('0x4f')});})[_0x7d0a('0x1e')](function(_0x1835ce){return handleError(_0x21580e,0x1f4,_0x1835ce);});};passport[_0x7d0a('0x50')](_0x7d0a('0x32'),new LocalStrategy({'usernameField':_0x7d0a('0xc'),'passwordField':_0x7d0a('0xd')},function(_0x192f90,_0x26e61e,_0x238601){return localAuthenticate(db['User'],_0x192f90,_0x26e61e,_0x238601);})); \ No newline at end of file +var _0xac33=['body','Email\x20parameter\x20is\x20missing','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','passwordHistoryLimit','previousPasswords','password','Password\x20reset!','use','passport','passport-local','jayson/promise','randomstring','moment','../../mysqldb','../../components/auth/service','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','name','salt','blocked','blockedAt','user','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','loginAttempts','disabled','add','clearBlockUser','minutes','then','getLicense','catch','MailAccount','find','MailServerOut','Smtp','CloudProvider','getSmtpOptions','\x22%s\x22\x20<%s>','email','request','format','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','error','message','stringify','status','send','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken','online','forgot'];(function(_0x18e267,_0x3cdde1){var _0x2946f1=function(_0x141894){while(--_0x141894){_0x18e267['push'](_0x18e267['shift']());}};_0x2946f1(++_0x3cdde1);}(_0xac33,0x1e1));var _0x3ac3=function(_0x327d6e,_0x5923bd){_0x327d6e=_0x327d6e-0x0;var _0x4dc5d3=_0xac33[_0x327d6e];return _0x4dc5d3;};'use strict';var util=require('util');var passport=require(_0x3ac3('0x0'));var LocalStrategy=require(_0x3ac3('0x1'))['Strategy'];var jayson=require(_0x3ac3('0x2'));var _=require('lodash');var rs=require(_0x3ac3('0x3'));var moment=require(_0x3ac3('0x4'));var db=require(_0x3ac3('0x5'))['db'];var authService=require(_0x3ac3('0x6'));var utils=require('../../config/utils');var client=jayson[_0x3ac3('0x7')][_0x3ac3('0x8')]({'port':0x232b});function localAuthenticate(_0x3f5b28,_0x1d7a18,_0x86da5f,_0x466674){var _0x4d69c9,_0x1b771a;return db[_0x3ac3('0x9')][_0x3ac3('0xa')]({'where':{'id':0x1},'attributes':[_0x3ac3('0xb'),_0x3ac3('0xc')],'raw':!![]})['then'](function(_0x21bbb0){_0x4d69c9=_0x21bbb0;return _0x3f5b28['findOne']({'attributes':['id',_0x3ac3('0xd'),'password',_0x3ac3('0xe'),'role','disabled',_0x3ac3('0xf'),_0x3ac3('0x10'),'loginAttempts'],'where':{'name':_0x1d7a18,'role':{'$or':['admin',_0x3ac3('0x11'),'agent']}}});})['then'](function(_0x519301){if(!_0x519301||_0x519301&&_0x519301[_0x3ac3('0xd')]!==_0x1d7a18){throw new Error(_0x3ac3('0x12'));}else{_0x1b771a=_0x519301;return _0x1b771a;}})['then'](function(){_0x1b771a[_0x3ac3('0x13')](_0x86da5f,function(_0x1a6df8,_0x179e4d){var _0x5b18ff=_0x1b771a[_0x3ac3('0x14')]+0x1;if(_0x1a6df8){return _0x466674(_0x1a6df8);}else if(!_0x179e4d){if(_0x1b771a[_0x3ac3('0x15')]){return _0x466674(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x4d69c9[_0x3ac3('0xb')]>0x0){if(_0x1b771a['blocked']){if(_0x4d69c9[_0x3ac3('0xc')]>0x0){if(moment(_0x1b771a[_0x3ac3('0x10')])[_0x3ac3('0x16')](_0x4d69c9[_0x3ac3('0xc')],'minutes')>moment()){return _0x466674(null,![],{'message':_0x3ac3('0x12')});}else{return utils[_0x3ac3('0x17')](_0x1b771a,_0x5b18ff,![],null)['then'](function(){return _0x466674(null,![],{'message':_0x3ac3('0x12')});});}}else{return _0x466674(null,![],{'message':_0x3ac3('0x12')});}}else{if(_0x5b18ff>=_0x4d69c9[_0x3ac3('0xb')]){return utils['clearBlockUser'](_0x1b771a,0x0,!![],moment())['then'](function(){return _0x466674(null,![],{'message':_0x3ac3('0x12')});});}else{return utils['clearBlockUser'](_0x1b771a,_0x5b18ff,![],null)['then'](function(){return _0x466674(null,![],{'message':_0x3ac3('0x12')});});}}}else{return _0x466674(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x1b771a[_0x3ac3('0x15')]){return _0x466674(null,![],{'message':_0x3ac3('0x12')});}else if(_0x4d69c9[_0x3ac3('0xb')]>0x0){if(_0x1b771a[_0x3ac3('0xf')]){if(_0x4d69c9[_0x3ac3('0xc')]>0x0){if(moment(_0x1b771a[_0x3ac3('0x10')])['add'](_0x4d69c9[_0x3ac3('0xc')],_0x3ac3('0x18'))>moment()){return _0x466674(null,![],{'message':_0x3ac3('0x12')});}else{return utils[_0x3ac3('0x17')](_0x1b771a,0x0,![],null)[_0x3ac3('0x19')](function(){return utils['getLicense'](_0x1b771a);})[_0x3ac3('0x19')](function(){return _0x466674(null,_0x1b771a);});}}else{return _0x466674(null,![],{'message':_0x3ac3('0x12')});}}else{return utils[_0x3ac3('0x17')](_0x1b771a,0x0,![],null)['then'](function(){return utils[_0x3ac3('0x1a')](_0x1b771a);})[_0x3ac3('0x19')](function(){return _0x466674(null,_0x1b771a);})[_0x3ac3('0x1b')](function(_0xb78c41){return _0x466674(null,![],_0xb78c41);});}}else{if(_0x1b771a[_0x3ac3('0xf')]){return _0x466674(null,![],{'message':_0x3ac3('0x12')});}else{return utils['getLicense'](_0x1b771a)[_0x3ac3('0x19')](function(){return _0x466674(null,_0x1b771a);});}}}});})[_0x3ac3('0x1b')](function(_0x4dd545){return _0x466674(null,![],_0x4dd545);});}function sendServiceMail(_0x78a965){return db[_0x3ac3('0x1c')][_0x3ac3('0x1d')]({'where':{'service':!![]},'attributes':['id','name','email'],'include':[{'model':db[_0x3ac3('0x1e')],'as':_0x3ac3('0x1f'),'include':[{'model':db[_0x3ac3('0x20')],'as':_0x3ac3('0x20')}]}]})[_0x3ac3('0x19')](function(_0x267552){if(!_0x267552){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x5a1e0a=_0x267552[_0x3ac3('0x21')]();var _0x4e57fe={'account':_0x5a1e0a,'message':_['merge']({'from':util['format'](_0x3ac3('0x22'),_0x267552[_0x3ac3('0xd')],_0x267552[_0x3ac3('0x23')]||_0x267552[_0x3ac3('0x1f')][_0x3ac3('0x11')])},_0x78a965)};return client[_0x3ac3('0x24')]('SendMail',_0x4e57fe);})['then'](function(_0x3cb634){if(_0x3cb634['error']){throw new Error(util[_0x3ac3('0x25')](_0x3ac3('0x26'),_0x3cb634[_0x3ac3('0x27')][_0x3ac3('0x28')]||JSON[_0x3ac3('0x29')](_0x3cb634['error'])));}return!![];});}function handleError(_0x240afb,_0x5992f1,_0x495bc3){return _0x240afb[_0x3ac3('0x2a')](_0x5992f1||0x1f4)[_0x3ac3('0x2b')]({'message':_0x495bc3?_0x495bc3['message']||_0x495bc3:''});}exports[_0x3ac3('0x2c')]=function(_0x34a17e,_0x3f0332,_0x124791){passport[_0x3ac3('0x13')](_0x3ac3('0x2d'),function(_0x278000,_0x5cfd82,_0x276c66){var _0x1daf39=_0x278000||_0x276c66;if(_0x1daf39){return handleError(_0x3f0332,0x191,_0x1daf39);}if(!_0x5cfd82){return handleError(_0x3f0332,0x194,{'message':_0x3ac3('0x2e')});}else{var _0x13aec5={'payload':{'id':_0x5cfd82['id'],'role':_0x5cfd82[_0x3ac3('0x2f')]},'options':{'expiresIn':0x15180}};return authService[_0x3ac3('0x30')](_0x13aec5)['then'](function(_0x381020){_0x3f0332['json']({'id':_0x5cfd82['id'],'token':_0x381020,'statusCall':'','isAlreadyLogged':_0x5cfd82[_0x3ac3('0x31')]});});}})(_0x34a17e,_0x3f0332,_0x124791);};exports[_0x3ac3('0x32')]=function(_0x3e0231,_0x37a124){if(!_0x3e0231[_0x3ac3('0x33')][_0x3ac3('0x23')]){return handleError(_0x37a124,0x1f4,{'message':_0x3ac3('0x34')});}var _0x165558=rs['generate']();_0x3e0231['body']['email']=_0x3e0231[_0x3ac3('0x33')][_0x3ac3('0x23')][_0x3ac3('0x35')]()[_0x3ac3('0x36')]();var _0x564acf;return db[_0x3ac3('0x9')][_0x3ac3('0xa')]({'where':{'id':0x1},'attributes':[_0x3ac3('0xb'),_0x3ac3('0xc')],'raw':!![]})[_0x3ac3('0x19')](function(_0x3e8aa3){_0x564acf=_0x3e8aa3;return db[_0x3ac3('0x37')][_0x3ac3('0x1d')]({'where':{'email':_0x3e0231[_0x3ac3('0x33')][_0x3ac3('0x23')]}});})[_0x3ac3('0x19')](function(_0x1a76c6){if(!_0x1a76c6){throw new Error(_0x3ac3('0x38'));}if(_0x1a76c6['disabled']){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x1a76c6['blocked']){if(moment(_0x1a76c6[_0x3ac3('0x10')])[_0x3ac3('0x16')](_0x564acf[_0x3ac3('0xc')],_0x3ac3('0x18'))>moment()){throw new Error(_0x3ac3('0x39'));}else{_0x1a76c6[_0x3ac3('0xf')]=![];_0x1a76c6[_0x3ac3('0x10')]=null;}}_0x1a76c6[_0x3ac3('0x3a')]=_0x165558;_0x1a76c6[_0x3ac3('0x3b')]=Date[_0x3ac3('0x3c')]()+0x36ee80;return _0x1a76c6[_0x3ac3('0x3d')]();})[_0x3ac3('0x19')](function(){return sendServiceMail({'to':_0x3e0231[_0x3ac3('0x33')]['email'],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0x3ac3('0x3e')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+'https://'+_0x3e0231[_0x3ac3('0x3f')]['host']+_0x3ac3('0x40')+_0x165558+'\x0a\x0a'+_0x3ac3('0x41')});})[_0x3ac3('0x19')](function(){_0x37a124[_0x3ac3('0x2a')](0xc8)[_0x3ac3('0x2b')]({'message':_0x3ac3('0x42')});})[_0x3ac3('0x1b')](function(_0x3aea56){return handleError(_0x37a124,0x1f4,_0x3aea56);});};exports[_0x3ac3('0x43')]=function(_0x4f1118,_0x1172b8){return db['User'][_0x3ac3('0x1d')]({'where':{'resetPasswordToken':_0x4f1118['params'][_0x3ac3('0x44')],'resetPasswordExpires':{'$gt':Date[_0x3ac3('0x3c')]()}}})[_0x3ac3('0x19')](function(_0x4f3c4b){if(!_0x4f3c4b){throw new Error(_0x3ac3('0x45'));}return db[_0x3ac3('0x9')][_0x3ac3('0xa')]({'attributes':['id',_0x3ac3('0x46'),'enforcePasswordHistory',_0x3ac3('0x47')]})[_0x3ac3('0x19')](function(_0x2a3aef){if(_0x2a3aef['securePassword'])authService['validatePasswordPattern'](_0x4f1118[_0x3ac3('0x33')]['password']);if(!_0x2a3aef['enforcePasswordHistory']||!_0x4f3c4b[_0x3ac3('0x48')])return _0x4f3c4b;authService['validatePasswordHistory'](_0x4f1118[_0x3ac3('0x33')][_0x3ac3('0x49')],_0x4f3c4b['previousPasswords'],_0x2a3aef[_0x3ac3('0x47')]);return _0x4f3c4b;})[_0x3ac3('0x19')](function(){_0x4f3c4b[_0x3ac3('0x49')]=_0x4f1118[_0x3ac3('0x33')][_0x3ac3('0x49')];_0x4f3c4b['resetPasswordToken']=null;_0x4f3c4b['resetPasswordExpires']=null;return _0x4f3c4b[_0x3ac3('0x3d')]();});})[_0x3ac3('0x19')](function(){_0x1172b8[_0x3ac3('0x2a')](0xc8)[_0x3ac3('0x2b')]({'message':_0x3ac3('0x4a')});})[_0x3ac3('0x1b')](function(_0x3a1743){return handleError(_0x1172b8,0x1f4,_0x3a1743);});};passport[_0x3ac3('0x4b')]('local-login',new LocalStrategy({'usernameField':_0x3ac3('0xd'),'passwordField':_0x3ac3('0x49')},function(_0x3eb488,_0xe15e4f,_0x45cb4d){return localAuthenticate(db[_0x3ac3('0x37')],_0x3eb488,_0xe15e4f,_0x45cb4d);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 6aa21b7..80142af 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 _0x072b=['post','login','/forgot','forgot','/reset/:token','reset','exports','express','Router','./authLocal.controller'];(function(_0x304fec,_0x11dd30){var _0x4b591b=function(_0x48b84e){while(--_0x48b84e){_0x304fec['push'](_0x304fec['shift']());}};_0x4b591b(++_0x11dd30);}(_0x072b,0x1b5));var _0xb072=function(_0x24f31b,_0x44b8f3){_0x24f31b=_0x24f31b-0x0;var _0x488401=_0x072b[_0x24f31b];return _0x488401;};'use strict';var express=require(_0xb072('0x0'));var router=express[_0xb072('0x1')]();var controller=require(_0xb072('0x2'));router[_0xb072('0x3')]('/',controller[_0xb072('0x4')]);router[_0xb072('0x3')](_0xb072('0x5'),controller[_0xb072('0x6')]);router[_0xb072('0x3')](_0xb072('0x7'),controller[_0xb072('0x8')]);module[_0xb072('0x9')]=router; \ No newline at end of file +var _0x8be0=['exports','Router','./authLocal.controller','login','post','/forgot','forgot','/reset/:token','reset'];(function(_0x3ba52b,_0x4c5c6a){var _0x494dcf=function(_0x1cfea0){while(--_0x1cfea0){_0x3ba52b['push'](_0x3ba52b['shift']());}};_0x494dcf(++_0x4c5c6a);}(_0x8be0,0x157));var _0x08be=function(_0x3ec9fc,_0xc83dc3){_0x3ec9fc=_0x3ec9fc-0x0;var _0x272e7c=_0x8be0[_0x3ec9fc];return _0x272e7c;};'use strict';var express=require('express');var router=express[_0x08be('0x0')]();var controller=require(_0x08be('0x1'));router['post']('/',controller[_0x08be('0x2')]);router[_0x08be('0x3')](_0x08be('0x4'),controller[_0x08be('0x5')]);router[_0x08be('0x3')](_0x08be('0x6'),controller[_0x08be('0x7')]);module[_0x08be('0x8')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index 9136872..f702db1 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 _0xb218=['BOOLEAN','sequelize','exports','STRING'];(function(_0x340432,_0x435ab3){var _0x134de6=function(_0x4b18d7){while(--_0x4b18d7){_0x340432['push'](_0x340432['shift']());}};_0x134de6(++_0x435ab3);}(_0xb218,0x75));var _0x8b21=function(_0x1b9c0b,_0x3e93cc){_0x1b9c0b=_0x1b9c0b-0x0;var _0x5021a9=_0xb218[_0x1b9c0b];return _0x5021a9;};'use strict';var Sequelize=require(_0x8b21('0x0'));module[_0x8b21('0x1')]={'name':{'type':Sequelize[_0x8b21('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x8b21('0x2')]},'description':{'type':Sequelize[_0x8b21('0x2')]},'status':{'type':Sequelize[_0x8b21('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}}; \ No newline at end of file +var _0xf8af=['STRING','INTEGER','sequelize','exports'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0xf8af,0x72));var _0xff8a=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0xf8af[_0x13d07a];return _0x5ee0ee;};'use strict';var Sequelize=require(_0xff8a('0x0'));module[_0xff8a('0x1')]={'name':{'type':Sequelize[_0xff8a('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0xff8a('0x2')]},'description':{'type':Sequelize[_0xff8a('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0xff8a('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 f5e4be3..93f3960 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 _0xa50f=['bluebird','mustache','util','ejs','fs-extra','lodash','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','Automation','rawAttributes','fieldName','type','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','filters','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','show','include','options','find','create','body','params','addConditions','Condition','ids','omit','findOne','pick','getConditions','nolimit','addActions','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0xa50f,0xa2));var _0xfa50=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0xa50f[_0x27af45];return _0x18df21;};'use strict';var emlformat=require(_0xfa50('0x0'));var rimraf=require(_0xfa50('0x1'));var zipdir=require(_0xfa50('0x2'));var jsonpatch=require(_0xfa50('0x3'));var rp=require(_0xfa50('0x4'));var moment=require(_0xfa50('0x5'));var BPromise=require(_0xfa50('0x6'));var Mustache=require(_0xfa50('0x7'));var util=require(_0xfa50('0x8'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xfa50('0x9'));var fs=require('fs');var fs_extra=require(_0xfa50('0xa'));var _=require(_0xfa50('0xb'));var squel=require(_0xfa50('0xc'));var crypto=require(_0xfa50('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xfa50('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xfa50('0xf'));var authService=require(_0xfa50('0x10'));var qs=require(_0xfa50('0x11'));var as=require(_0xfa50('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xfa50('0x13'));var utils=require(_0xfa50('0x14'));var config=require(_0xfa50('0x15'));var licenseUtil=require(_0xfa50('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x405024,_0x82da93){_0x82da93=_0x82da93||0xcc;return function(_0x14f1c6){if(_0x14f1c6){return _0x405024['sendStatus'](_0x82da93);}return _0x405024[_0xfa50('0x17')](_0x82da93)[_0xfa50('0x18')]();};}function respondWithResult(_0x4dc0b8,_0x48407b){_0x48407b=_0x48407b||0xc8;return function(_0x362040){if(_0x362040){return _0x4dc0b8[_0xfa50('0x17')](_0x48407b)[_0xfa50('0x19')](_0x362040);}};}function respondWithFilteredResult(_0x5bef8a,_0x2611fc){return function(_0x4a0f13){if(_0x4a0f13){var _0x1382c7=typeof _0x2611fc[_0xfa50('0x1a')]==='undefined'&&typeof _0x2611fc[_0xfa50('0x1b')]===_0xfa50('0x1c');var _0x2a83b0=_0x4a0f13[_0xfa50('0x1d')];var _0x582162=_0x1382c7?0x0:_0x2611fc[_0xfa50('0x1a')];var _0x4e767d=_0x1382c7?_0x4a0f13[_0xfa50('0x1d')]:_0x2611fc[_0xfa50('0x1a')]+_0x2611fc[_0xfa50('0x1b')];var _0x527333;if(_0x4e767d>=_0x2a83b0){_0x4e767d=_0x2a83b0;_0x527333=0xc8;}else{_0x527333=0xce;}_0x5bef8a[_0xfa50('0x17')](_0x527333);return _0x5bef8a[_0xfa50('0x1e')](_0xfa50('0x1f'),_0x582162+'-'+_0x4e767d+'/'+_0x2a83b0)[_0xfa50('0x19')](_0x4a0f13);}return null;};}function patchUpdates(_0x181aed){return function(_0x5cb72f){try{jsonpatch[_0xfa50('0x20')](_0x5cb72f,_0x181aed,!![]);}catch(_0xcfb015){return BPromise[_0xfa50('0x21')](_0xcfb015);}return _0x5cb72f[_0xfa50('0x22')]();};}function saveUpdates(_0x1b688c,_0x49d077){return function(_0x21df9c){if(_0x21df9c){return _0x21df9c[_0xfa50('0x23')](_0x1b688c)[_0xfa50('0x24')](function(_0x11cd86){return _0x11cd86;});}return null;};}function removeEntity(_0x1876f1,_0x238c94){return function(_0x223f14){if(_0x223f14){return _0x223f14[_0xfa50('0x25')]()[_0xfa50('0x24')](function(){_0x1876f1[_0xfa50('0x17')](0xcc)[_0xfa50('0x18')]();});}};}function handleEntityNotFound(_0xbca18e,_0x5ea13c){return function(_0x2ee76f){if(!_0x2ee76f){_0xbca18e['sendStatus'](0x194);}return _0x2ee76f;};}function handleError(_0x27b148,_0x46af6c){_0x46af6c=_0x46af6c||0x1f4;return function(_0xe2d2ed){logger['error'](_0xe2d2ed[_0xfa50('0x26')]);if(_0xe2d2ed[_0xfa50('0x27')]){delete _0xe2d2ed[_0xfa50('0x27')];}_0x27b148[_0xfa50('0x17')](_0x46af6c)[_0xfa50('0x28')](_0xe2d2ed);};}exports[_0xfa50('0x29')]=function(_0x332215,_0x24416e){var _0x4959aa={},_0x1f403b={},_0x3247e={'count':0x0,'rows':[]};var _0x11e120=_[_0xfa50('0x2a')](db[_0xfa50('0x2b')][_0xfa50('0x2c')],function(_0x4bf7c5){return{'name':_0x4bf7c5[_0xfa50('0x2d')],'type':_0x4bf7c5[_0xfa50('0x2e')]['key']};});_0x1f403b['model']=_[_0xfa50('0x2a')](_0x11e120,'name');_0x1f403b[_0xfa50('0x2f')]=_[_0xfa50('0x30')](_0x332215['query']);_0x1f403b['filters']=_[_0xfa50('0x31')](_0x1f403b[_0xfa50('0x32')],_0x1f403b['query']);_0x4959aa[_0xfa50('0x33')]=_['intersection'](_0x1f403b[_0xfa50('0x32')],qs['fields'](_0x332215[_0xfa50('0x2f')][_0xfa50('0x34')]));_0x4959aa[_0xfa50('0x33')]=_0x4959aa[_0xfa50('0x33')][_0xfa50('0x35')]?_0x4959aa[_0xfa50('0x33')]:_0x1f403b[_0xfa50('0x32')];if(!_0x332215[_0xfa50('0x2f')][_0xfa50('0x36')]('nolimit')){_0x4959aa[_0xfa50('0x1b')]=qs['limit'](_0x332215[_0xfa50('0x2f')]['limit']);_0x4959aa[_0xfa50('0x1a')]=qs['offset'](_0x332215[_0xfa50('0x2f')][_0xfa50('0x1a')]);}_0x4959aa[_0xfa50('0x37')]=qs[_0xfa50('0x38')](_0x332215[_0xfa50('0x2f')][_0xfa50('0x38')]);_0x4959aa[_0xfa50('0x39')]=qs[_0xfa50('0x3a')](_['pick'](_0x332215[_0xfa50('0x2f')],_0x1f403b[_0xfa50('0x3a')]),_0x11e120);if(_0x332215[_0xfa50('0x2f')][_0xfa50('0x3b')]){_0x4959aa[_0xfa50('0x39')]=_[_0xfa50('0x3c')](_0x4959aa['where'],{'$or':_['map'](_0x11e120,function(_0x175385){if(_0x175385[_0xfa50('0x2e')]!==_0xfa50('0x3d')){var _0x5389f7={};_0x5389f7[_0x175385[_0xfa50('0x27')]]={'$like':'%'+_0x332215[_0xfa50('0x2f')][_0xfa50('0x3b')]+'%'};return _0x5389f7;}})});}_0x4959aa=_['merge']({},_0x4959aa,_0x332215['options']);var _0x20918c={'where':_0x4959aa[_0xfa50('0x39')]};return db[_0xfa50('0x2b')][_0xfa50('0x1d')](_0x20918c)['then'](function(_0x8696ca){_0x3247e['count']=_0x8696ca;if(_0x332215[_0xfa50('0x2f')][_0xfa50('0x3e')]){_0x4959aa['include']=[{'all':!![]}];}return db['Automation'][_0xfa50('0x3f')](_0x4959aa);})[_0xfa50('0x24')](function(_0x3b9e8a){_0x3247e[_0xfa50('0x40')]=_0x3b9e8a;return _0x3247e;})['then'](respondWithFilteredResult(_0x24416e,_0x4959aa))[_0xfa50('0x41')](handleError(_0x24416e,null));};exports[_0xfa50('0x42')]=function(_0x1fd521,_0x3727a3){var _0x26a176={'raw':![],'where':{'id':_0x1fd521['params']['id']}},_0x37efc7={};_0x37efc7[_0xfa50('0x32')]=_[_0xfa50('0x30')](db['Automation'][_0xfa50('0x2c')]);_0x37efc7[_0xfa50('0x2f')]=_[_0xfa50('0x30')](_0x1fd521[_0xfa50('0x2f')]);_0x37efc7[_0xfa50('0x3a')]=_[_0xfa50('0x31')](_0x37efc7[_0xfa50('0x32')],_0x37efc7[_0xfa50('0x2f')]);_0x26a176['attributes']=_[_0xfa50('0x31')](_0x37efc7['model'],qs[_0xfa50('0x34')](_0x1fd521[_0xfa50('0x2f')]['fields']));_0x26a176[_0xfa50('0x33')]=_0x26a176[_0xfa50('0x33')][_0xfa50('0x35')]?_0x26a176[_0xfa50('0x33')]:_0x37efc7[_0xfa50('0x32')];if(_0x1fd521[_0xfa50('0x2f')][_0xfa50('0x3e')]){_0x26a176[_0xfa50('0x43')]=[{'all':!![]}];}_0x26a176=_[_0xfa50('0x3c')]({},_0x26a176,_0x1fd521[_0xfa50('0x44')]);return db[_0xfa50('0x2b')][_0xfa50('0x45')](_0x26a176)[_0xfa50('0x24')](handleEntityNotFound(_0x3727a3,null))['then'](respondWithResult(_0x3727a3,null))[_0xfa50('0x41')](handleError(_0x3727a3,null));};exports['create']=function(_0x45b8e8,_0x3cb8db){return db[_0xfa50('0x2b')][_0xfa50('0x46')](_0x45b8e8[_0xfa50('0x47')],{})[_0xfa50('0x24')](respondWithResult(_0x3cb8db,0xc9))[_0xfa50('0x41')](handleError(_0x3cb8db,null));};exports[_0xfa50('0x23')]=function(_0x322d16,_0x5e2f1a){if(_0x322d16[_0xfa50('0x47')]['id']){delete _0x322d16[_0xfa50('0x47')]['id'];}return db[_0xfa50('0x2b')]['find']({'where':{'id':_0x322d16[_0xfa50('0x48')]['id']}})['then'](handleEntityNotFound(_0x5e2f1a,null))[_0xfa50('0x24')](saveUpdates(_0x322d16['body'],null))[_0xfa50('0x24')](respondWithResult(_0x5e2f1a,null))[_0xfa50('0x41')](handleError(_0x5e2f1a,null));};exports[_0xfa50('0x25')]=function(_0x437132,_0x4027a9){return db[_0xfa50('0x2b')][_0xfa50('0x45')]({'where':{'id':_0x437132[_0xfa50('0x48')]['id']}})[_0xfa50('0x24')](handleEntityNotFound(_0x4027a9,null))[_0xfa50('0x24')](removeEntity(_0x4027a9,null))[_0xfa50('0x41')](handleError(_0x4027a9,null));};exports[_0xfa50('0x49')]=function(_0x5e1eae,_0x387419,_0x442f3a){return db[_0xfa50('0x4a')][_0xfa50('0x45')]({'where':{'id':_0x5e1eae[_0xfa50('0x48')]['id']}})[_0xfa50('0x24')](handleEntityNotFound(_0x387419,null))[_0xfa50('0x24')](function(_0x38c229){if(_0x38c229){return _0x38c229['addConditions'](_0x5e1eae['body'][_0xfa50('0x4b')],_[_0xfa50('0x4c')](_0x5e1eae[_0xfa50('0x47')],[_0xfa50('0x4b'),'id'])||{});}})['then'](respondWithResult(_0x387419,null))['catch'](handleError(_0x387419,null));};exports['getConditions']=function(_0x8beb4e,_0x57557d,_0x3156cb){var _0x5582d2={};var _0x2dcab4={};var _0x246983;var _0x3960e2;return db[_0xfa50('0x2b')][_0xfa50('0x4d')]({'where':{'id':_0x8beb4e[_0xfa50('0x48')]['id']}})[_0xfa50('0x24')](handleEntityNotFound(_0x57557d,null))['then'](function(_0x59680e){if(_0x59680e){_0x246983=_0x59680e;_0x2dcab4[_0xfa50('0x32')]=_[_0xfa50('0x30')](db[_0xfa50('0x4a')][_0xfa50('0x2c')]);_0x2dcab4[_0xfa50('0x2f')]=_[_0xfa50('0x30')](_0x8beb4e[_0xfa50('0x2f')]);_0x2dcab4['filters']=_[_0xfa50('0x31')](_0x2dcab4[_0xfa50('0x32')],_0x2dcab4[_0xfa50('0x2f')]);_0x5582d2[_0xfa50('0x33')]=_[_0xfa50('0x31')](_0x2dcab4['model'],qs[_0xfa50('0x34')](_0x8beb4e['query'][_0xfa50('0x34')]));_0x5582d2['attributes']=_0x5582d2[_0xfa50('0x33')]['length']?_0x5582d2['attributes']:_0x2dcab4[_0xfa50('0x32')];_0x5582d2['order']=qs[_0xfa50('0x38')](_0x8beb4e[_0xfa50('0x2f')][_0xfa50('0x38')]);_0x5582d2['where']=qs[_0xfa50('0x3a')](_[_0xfa50('0x4e')](_0x8beb4e[_0xfa50('0x2f')],_0x2dcab4[_0xfa50('0x3a')]));if(_0x8beb4e[_0xfa50('0x2f')][_0xfa50('0x3b')]){_0x5582d2['where']=_[_0xfa50('0x3c')](_0x5582d2[_0xfa50('0x39')],{'$or':_[_0xfa50('0x2a')](_0x5582d2['attributes'],function(_0x48473d){var _0x290236={};_0x290236[_0x48473d]={'$like':'%'+_0x8beb4e[_0xfa50('0x2f')]['filter']+'%'};return _0x290236;})});}_0x5582d2=_[_0xfa50('0x3c')]({},_0x5582d2,_0x8beb4e['options']);return _0x246983[_0xfa50('0x4f')](_0x5582d2);}})[_0xfa50('0x24')](function(_0x89dd4f){if(_0x89dd4f){_0x3960e2=_0x89dd4f[_0xfa50('0x35')];if(!_0x8beb4e[_0xfa50('0x2f')][_0xfa50('0x36')](_0xfa50('0x50'))){_0x5582d2[_0xfa50('0x1b')]=qs['limit'](_0x8beb4e['query'][_0xfa50('0x1b')]);_0x5582d2[_0xfa50('0x1a')]=qs['offset'](_0x8beb4e['query'][_0xfa50('0x1a')]);}return _0x246983[_0xfa50('0x4f')](_0x5582d2);}})['then'](function(_0x4ca001){if(_0x4ca001){return _0x4ca001?{'count':_0x3960e2,'rows':_0x4ca001}:null;}})[_0xfa50('0x24')](respondWithResult(_0x57557d,null))[_0xfa50('0x41')](handleError(_0x57557d,null));};exports[_0xfa50('0x51')]=function(_0xd11f82,_0x343752,_0x32ec03){return db[_0xfa50('0x52')][_0xfa50('0x45')]({'where':{'id':_0xd11f82[_0xfa50('0x48')]['id']}})['then'](handleEntityNotFound(_0x343752,null))[_0xfa50('0x24')](function(_0xd42cf5){if(_0xd42cf5){return _0xd42cf5[_0xfa50('0x51')](_0xd11f82[_0xfa50('0x47')][_0xfa50('0x4b')],_[_0xfa50('0x4c')](_0xd11f82[_0xfa50('0x47')],[_0xfa50('0x4b'),'id'])||{});}})['then'](respondWithResult(_0x343752,null))[_0xfa50('0x41')](handleError(_0x343752,null));};exports[_0xfa50('0x53')]=function(_0x29ad54,_0x3e2ec9,_0x32481c){var _0x1e2ac8={};var _0x1b939e={};var _0x2a846f;var _0x2830a4;return db['Automation'][_0xfa50('0x4d')]({'where':{'id':_0x29ad54[_0xfa50('0x48')]['id']}})['then'](handleEntityNotFound(_0x3e2ec9,null))['then'](function(_0x31ccbf){if(_0x31ccbf){_0x2a846f=_0x31ccbf;_0x1b939e[_0xfa50('0x32')]=_[_0xfa50('0x30')](db[_0xfa50('0x52')][_0xfa50('0x2c')]);_0x1b939e[_0xfa50('0x2f')]=_['keys'](_0x29ad54[_0xfa50('0x2f')]);_0x1b939e[_0xfa50('0x3a')]=_['intersection'](_0x1b939e[_0xfa50('0x32')],_0x1b939e[_0xfa50('0x2f')]);_0x1e2ac8[_0xfa50('0x33')]=_[_0xfa50('0x31')](_0x1b939e['model'],qs[_0xfa50('0x34')](_0x29ad54['query'][_0xfa50('0x34')]));_0x1e2ac8['attributes']=_0x1e2ac8[_0xfa50('0x33')][_0xfa50('0x35')]?_0x1e2ac8[_0xfa50('0x33')]:_0x1b939e[_0xfa50('0x32')];_0x1e2ac8[_0xfa50('0x37')]=qs[_0xfa50('0x38')](_0x29ad54['query'][_0xfa50('0x38')]);_0x1e2ac8[_0xfa50('0x39')]=qs[_0xfa50('0x3a')](_[_0xfa50('0x4e')](_0x29ad54[_0xfa50('0x2f')],_0x1b939e[_0xfa50('0x3a')]));if(_0x29ad54[_0xfa50('0x2f')][_0xfa50('0x3b')]){_0x1e2ac8[_0xfa50('0x39')]=_[_0xfa50('0x3c')](_0x1e2ac8[_0xfa50('0x39')],{'$or':_[_0xfa50('0x2a')](_0x1e2ac8[_0xfa50('0x33')],function(_0x2d12f5){var _0x2ed3d0={};_0x2ed3d0[_0x2d12f5]={'$like':'%'+_0x29ad54[_0xfa50('0x2f')][_0xfa50('0x3b')]+'%'};return _0x2ed3d0;})});}_0x1e2ac8=_['merge']({},_0x1e2ac8,_0x29ad54[_0xfa50('0x44')]);return _0x2a846f[_0xfa50('0x53')](_0x1e2ac8);}})[_0xfa50('0x24')](function(_0x191ea0){if(_0x191ea0){_0x2830a4=_0x191ea0[_0xfa50('0x35')];if(!_0x29ad54['query']['hasOwnProperty'](_0xfa50('0x50'))){_0x1e2ac8['limit']=qs['limit'](_0x29ad54[_0xfa50('0x2f')][_0xfa50('0x1b')]);_0x1e2ac8[_0xfa50('0x1a')]=qs[_0xfa50('0x1a')](_0x29ad54[_0xfa50('0x2f')][_0xfa50('0x1a')]);}return _0x2a846f[_0xfa50('0x53')](_0x1e2ac8);}})[_0xfa50('0x24')](function(_0x1e8627){if(_0x1e8627){return _0x1e8627?{'count':_0x2830a4,'rows':_0x1e8627}:null;}})[_0xfa50('0x24')](respondWithResult(_0x3e2ec9,null))[_0xfa50('0x41')](handleError(_0x3e2ec9,null));}; \ No newline at end of file +var _0xafe3=['update','then','destroy','sendStatus','error','stack','name','send','index','map','Automation','rawAttributes','fieldName','type','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','params','keys','options','find','catch','create','body','addConditions','Condition','ids','getConditions','findOne','addActions','Action','omit','getActions','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save'];(function(_0x2c5096,_0x1e319c){var _0x342c6e=function(_0x4c1880){while(--_0x4c1880){_0x2c5096['push'](_0x2c5096['shift']());}};_0x342c6e(++_0x1e319c);}(_0xafe3,0x1ef));var _0x3afe=function(_0x4dc037,_0x1c9ab3){_0x4dc037=_0x4dc037-0x0;var _0x588c3e=_0xafe3[_0x4dc037];return _0x588c3e;};'use strict';var emlformat=require(_0x3afe('0x0'));var rimraf=require(_0x3afe('0x1'));var zipdir=require(_0x3afe('0x2'));var jsonpatch=require(_0x3afe('0x3'));var rp=require(_0x3afe('0x4'));var moment=require(_0x3afe('0x5'));var BPromise=require(_0x3afe('0x6'));var Mustache=require(_0x3afe('0x7'));var util=require(_0x3afe('0x8'));var path=require(_0x3afe('0x9'));var sox=require('sox');var csv=require(_0x3afe('0xa'));var ejs=require(_0x3afe('0xb'));var fs=require('fs');var fs_extra=require(_0x3afe('0xc'));var _=require(_0x3afe('0xd'));var squel=require(_0x3afe('0xe'));var crypto=require('crypto');var jsforce=require(_0x3afe('0xf'));var deskjs=require(_0x3afe('0x10'));var toCsv=require(_0x3afe('0xa'));var querystring=require(_0x3afe('0x11'));var Papa=require(_0x3afe('0x12'));var Redis=require(_0x3afe('0x13'));var authService=require(_0x3afe('0x14'));var qs=require(_0x3afe('0x15'));var as=require(_0x3afe('0x16'));var hardwareService=require(_0x3afe('0x17'));var logger=require(_0x3afe('0x18'))('api');var utils=require(_0x3afe('0x19'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x3afe('0x1a'))['db'];function respondWithStatusCode(_0xe46d8b,_0x434d60){_0x434d60=_0x434d60||0xcc;return function(_0x61766){if(_0x61766){return _0xe46d8b['sendStatus'](_0x434d60);}return _0xe46d8b[_0x3afe('0x1b')](_0x434d60)[_0x3afe('0x1c')]();};}function respondWithResult(_0x47ce9a,_0x3881d6){_0x3881d6=_0x3881d6||0xc8;return function(_0x3ff52d){if(_0x3ff52d){return _0x47ce9a[_0x3afe('0x1b')](_0x3881d6)[_0x3afe('0x1d')](_0x3ff52d);}};}function respondWithFilteredResult(_0x53e19b,_0x1224e3){return function(_0x151598){if(_0x151598){var _0x1c3b05=typeof _0x1224e3[_0x3afe('0x1e')]===_0x3afe('0x1f')&&typeof _0x1224e3[_0x3afe('0x20')]===_0x3afe('0x1f');var _0x26a6b4=_0x151598[_0x3afe('0x21')];var _0x2bb2a0=_0x1c3b05?0x0:_0x1224e3[_0x3afe('0x1e')];var _0x352cb3=_0x1c3b05?_0x151598['count']:_0x1224e3[_0x3afe('0x1e')]+_0x1224e3[_0x3afe('0x20')];var _0x512ffc;if(_0x352cb3>=_0x26a6b4){_0x352cb3=_0x26a6b4;_0x512ffc=0xc8;}else{_0x512ffc=0xce;}_0x53e19b[_0x3afe('0x1b')](_0x512ffc);return _0x53e19b[_0x3afe('0x22')](_0x3afe('0x23'),_0x2bb2a0+'-'+_0x352cb3+'/'+_0x26a6b4)['json'](_0x151598);}return null;};}function patchUpdates(_0x1b62f0){return function(_0x58ae91){try{jsonpatch[_0x3afe('0x24')](_0x58ae91,_0x1b62f0,!![]);}catch(_0x4e7527){return BPromise[_0x3afe('0x25')](_0x4e7527);}return _0x58ae91[_0x3afe('0x26')]();};}function saveUpdates(_0x11146a,_0x47256f){return function(_0x44882f){if(_0x44882f){return _0x44882f[_0x3afe('0x27')](_0x11146a)[_0x3afe('0x28')](function(_0x20e829){return _0x20e829;});}return null;};}function removeEntity(_0x4fe101,_0x1b1e5b){return function(_0x3b0539){if(_0x3b0539){return _0x3b0539[_0x3afe('0x29')]()[_0x3afe('0x28')](function(){_0x4fe101[_0x3afe('0x1b')](0xcc)[_0x3afe('0x1c')]();});}};}function handleEntityNotFound(_0x3de905,_0x5d6212){return function(_0x53529c){if(!_0x53529c){_0x3de905[_0x3afe('0x2a')](0x194);}return _0x53529c;};}function handleError(_0x38a155,_0x59907f){_0x59907f=_0x59907f||0x1f4;return function(_0x21270a){logger[_0x3afe('0x2b')](_0x21270a[_0x3afe('0x2c')]);if(_0x21270a['name']){delete _0x21270a[_0x3afe('0x2d')];}_0x38a155[_0x3afe('0x1b')](_0x59907f)[_0x3afe('0x2e')](_0x21270a);};}exports[_0x3afe('0x2f')]=function(_0x2da7dd,_0x2e78e7){var _0x55064e={},_0x171043={},_0x50b144={'count':0x0,'rows':[]};var _0x1937b8=_[_0x3afe('0x30')](db[_0x3afe('0x31')][_0x3afe('0x32')],function(_0x40c838){return{'name':_0x40c838[_0x3afe('0x33')],'type':_0x40c838[_0x3afe('0x34')]['key']};});_0x171043[_0x3afe('0x35')]=_[_0x3afe('0x30')](_0x1937b8,_0x3afe('0x2d'));_0x171043[_0x3afe('0x36')]=_['keys'](_0x2da7dd[_0x3afe('0x36')]);_0x171043[_0x3afe('0x37')]=_['intersection'](_0x171043[_0x3afe('0x35')],_0x171043[_0x3afe('0x36')]);_0x55064e[_0x3afe('0x38')]=_[_0x3afe('0x39')](_0x171043['model'],qs[_0x3afe('0x3a')](_0x2da7dd[_0x3afe('0x36')][_0x3afe('0x3a')]));_0x55064e[_0x3afe('0x38')]=_0x55064e[_0x3afe('0x38')][_0x3afe('0x3b')]?_0x55064e[_0x3afe('0x38')]:_0x171043[_0x3afe('0x35')];if(!_0x2da7dd['query'][_0x3afe('0x3c')]('nolimit')){_0x55064e[_0x3afe('0x20')]=qs[_0x3afe('0x20')](_0x2da7dd[_0x3afe('0x36')][_0x3afe('0x20')]);_0x55064e[_0x3afe('0x1e')]=qs['offset'](_0x2da7dd[_0x3afe('0x36')][_0x3afe('0x1e')]);}_0x55064e[_0x3afe('0x3d')]=qs[_0x3afe('0x3e')](_0x2da7dd[_0x3afe('0x36')][_0x3afe('0x3e')]);_0x55064e[_0x3afe('0x3f')]=qs['filters'](_[_0x3afe('0x40')](_0x2da7dd[_0x3afe('0x36')],_0x171043[_0x3afe('0x37')]),_0x1937b8);if(_0x2da7dd[_0x3afe('0x36')][_0x3afe('0x41')]){_0x55064e['where']=_[_0x3afe('0x42')](_0x55064e[_0x3afe('0x3f')],{'$or':_[_0x3afe('0x30')](_0x1937b8,function(_0xe1ea8e){if(_0xe1ea8e[_0x3afe('0x34')]!==_0x3afe('0x43')){var _0x3da73a={};_0x3da73a[_0xe1ea8e[_0x3afe('0x2d')]]={'$like':'%'+_0x2da7dd[_0x3afe('0x36')]['filter']+'%'};return _0x3da73a;}})});}_0x55064e=_[_0x3afe('0x42')]({},_0x55064e,_0x2da7dd['options']);var _0x5cfa00={'where':_0x55064e[_0x3afe('0x3f')]};return db['Automation'][_0x3afe('0x21')](_0x5cfa00)['then'](function(_0x597377){_0x50b144[_0x3afe('0x21')]=_0x597377;if(_0x2da7dd[_0x3afe('0x36')][_0x3afe('0x44')]){_0x55064e[_0x3afe('0x45')]=[{'all':!![]}];}return db[_0x3afe('0x31')][_0x3afe('0x46')](_0x55064e);})['then'](function(_0x3f8b08){_0x50b144[_0x3afe('0x47')]=_0x3f8b08;return _0x50b144;})['then'](respondWithFilteredResult(_0x2e78e7,_0x55064e))['catch'](handleError(_0x2e78e7,null));};exports['show']=function(_0x153345,_0x569590){var _0x32a521={'raw':![],'where':{'id':_0x153345[_0x3afe('0x48')]['id']}},_0x5b4e64={};_0x5b4e64[_0x3afe('0x35')]=_[_0x3afe('0x49')](db[_0x3afe('0x31')][_0x3afe('0x32')]);_0x5b4e64[_0x3afe('0x36')]=_[_0x3afe('0x49')](_0x153345[_0x3afe('0x36')]);_0x5b4e64[_0x3afe('0x37')]=_[_0x3afe('0x39')](_0x5b4e64[_0x3afe('0x35')],_0x5b4e64[_0x3afe('0x36')]);_0x32a521[_0x3afe('0x38')]=_[_0x3afe('0x39')](_0x5b4e64[_0x3afe('0x35')],qs[_0x3afe('0x3a')](_0x153345[_0x3afe('0x36')]['fields']));_0x32a521['attributes']=_0x32a521[_0x3afe('0x38')][_0x3afe('0x3b')]?_0x32a521[_0x3afe('0x38')]:_0x5b4e64[_0x3afe('0x35')];if(_0x153345['query'][_0x3afe('0x44')]){_0x32a521[_0x3afe('0x45')]=[{'all':!![]}];}_0x32a521=_[_0x3afe('0x42')]({},_0x32a521,_0x153345[_0x3afe('0x4a')]);return db[_0x3afe('0x31')][_0x3afe('0x4b')](_0x32a521)[_0x3afe('0x28')](handleEntityNotFound(_0x569590,null))[_0x3afe('0x28')](respondWithResult(_0x569590,null))[_0x3afe('0x4c')](handleError(_0x569590,null));};exports[_0x3afe('0x4d')]=function(_0x221706,_0xe36287){return db[_0x3afe('0x31')][_0x3afe('0x4d')](_0x221706['body'],{})['then'](respondWithResult(_0xe36287,0xc9))[_0x3afe('0x4c')](handleError(_0xe36287,null));};exports['update']=function(_0x1bb4a9,_0x2d2d0d){if(_0x1bb4a9['body']['id']){delete _0x1bb4a9[_0x3afe('0x4e')]['id'];}return db[_0x3afe('0x31')][_0x3afe('0x4b')]({'where':{'id':_0x1bb4a9[_0x3afe('0x48')]['id']}})[_0x3afe('0x28')](handleEntityNotFound(_0x2d2d0d,null))[_0x3afe('0x28')](saveUpdates(_0x1bb4a9[_0x3afe('0x4e')],null))['then'](respondWithResult(_0x2d2d0d,null))[_0x3afe('0x4c')](handleError(_0x2d2d0d,null));};exports[_0x3afe('0x29')]=function(_0x28ad21,_0x332a78){return db[_0x3afe('0x31')][_0x3afe('0x4b')]({'where':{'id':_0x28ad21[_0x3afe('0x48')]['id']}})[_0x3afe('0x28')](handleEntityNotFound(_0x332a78,null))[_0x3afe('0x28')](removeEntity(_0x332a78,null))['catch'](handleError(_0x332a78,null));};exports[_0x3afe('0x4f')]=function(_0x149e64,_0xa1ddd0,_0x51ed9f){return db[_0x3afe('0x50')][_0x3afe('0x4b')]({'where':{'id':_0x149e64[_0x3afe('0x48')]['id']}})['then'](handleEntityNotFound(_0xa1ddd0,null))['then'](function(_0x5e4d6d){if(_0x5e4d6d){return _0x5e4d6d[_0x3afe('0x4f')](_0x149e64[_0x3afe('0x4e')]['ids'],_['omit'](_0x149e64[_0x3afe('0x4e')],[_0x3afe('0x51'),'id'])||{});}})[_0x3afe('0x28')](respondWithResult(_0xa1ddd0,null))[_0x3afe('0x4c')](handleError(_0xa1ddd0,null));};exports[_0x3afe('0x52')]=function(_0x5e54dc,_0x3ac47f,_0x1e06d9){var _0x37f49d={};var _0x450d1e={};var _0x99ca15;var _0xe8a117;return db['Automation'][_0x3afe('0x53')]({'where':{'id':_0x5e54dc[_0x3afe('0x48')]['id']}})[_0x3afe('0x28')](handleEntityNotFound(_0x3ac47f,null))[_0x3afe('0x28')](function(_0x2cb5c1){if(_0x2cb5c1){_0x99ca15=_0x2cb5c1;_0x450d1e[_0x3afe('0x35')]=_['keys'](db[_0x3afe('0x50')][_0x3afe('0x32')]);_0x450d1e[_0x3afe('0x36')]=_['keys'](_0x5e54dc['query']);_0x450d1e[_0x3afe('0x37')]=_['intersection'](_0x450d1e[_0x3afe('0x35')],_0x450d1e[_0x3afe('0x36')]);_0x37f49d[_0x3afe('0x38')]=_[_0x3afe('0x39')](_0x450d1e[_0x3afe('0x35')],qs[_0x3afe('0x3a')](_0x5e54dc['query']['fields']));_0x37f49d[_0x3afe('0x38')]=_0x37f49d[_0x3afe('0x38')][_0x3afe('0x3b')]?_0x37f49d[_0x3afe('0x38')]:_0x450d1e[_0x3afe('0x35')];_0x37f49d[_0x3afe('0x3d')]=qs[_0x3afe('0x3e')](_0x5e54dc['query']['sort']);_0x37f49d[_0x3afe('0x3f')]=qs[_0x3afe('0x37')](_['pick'](_0x5e54dc[_0x3afe('0x36')],_0x450d1e[_0x3afe('0x37')]));if(_0x5e54dc[_0x3afe('0x36')][_0x3afe('0x41')]){_0x37f49d[_0x3afe('0x3f')]=_['merge'](_0x37f49d[_0x3afe('0x3f')],{'$or':_['map'](_0x37f49d[_0x3afe('0x38')],function(_0x519f53){var _0x18c0e6={};_0x18c0e6[_0x519f53]={'$like':'%'+_0x5e54dc[_0x3afe('0x36')][_0x3afe('0x41')]+'%'};return _0x18c0e6;})});}_0x37f49d=_[_0x3afe('0x42')]({},_0x37f49d,_0x5e54dc[_0x3afe('0x4a')]);return _0x99ca15[_0x3afe('0x52')](_0x37f49d);}})[_0x3afe('0x28')](function(_0x50de8b){if(_0x50de8b){_0xe8a117=_0x50de8b['length'];if(!_0x5e54dc[_0x3afe('0x36')][_0x3afe('0x3c')]('nolimit')){_0x37f49d[_0x3afe('0x20')]=qs[_0x3afe('0x20')](_0x5e54dc[_0x3afe('0x36')][_0x3afe('0x20')]);_0x37f49d[_0x3afe('0x1e')]=qs[_0x3afe('0x1e')](_0x5e54dc[_0x3afe('0x36')][_0x3afe('0x1e')]);}return _0x99ca15[_0x3afe('0x52')](_0x37f49d);}})[_0x3afe('0x28')](function(_0x2032b6){if(_0x2032b6){return _0x2032b6?{'count':_0xe8a117,'rows':_0x2032b6}:null;}})[_0x3afe('0x28')](respondWithResult(_0x3ac47f,null))['catch'](handleError(_0x3ac47f,null));};exports[_0x3afe('0x54')]=function(_0x56ff99,_0x1f2c30,_0xf59255){return db[_0x3afe('0x55')][_0x3afe('0x4b')]({'where':{'id':_0x56ff99[_0x3afe('0x48')]['id']}})['then'](handleEntityNotFound(_0x1f2c30,null))['then'](function(_0x1dd229){if(_0x1dd229){return _0x1dd229[_0x3afe('0x54')](_0x56ff99[_0x3afe('0x4e')]['ids'],_[_0x3afe('0x56')](_0x56ff99['body'],[_0x3afe('0x51'),'id'])||{});}})[_0x3afe('0x28')](respondWithResult(_0x1f2c30,null))[_0x3afe('0x4c')](handleError(_0x1f2c30,null));};exports[_0x3afe('0x57')]=function(_0x15327e,_0x23a4e6,_0x12b4db){var _0x1f1ab4={};var _0x2cc2c1={};var _0x535b27;var _0x25ca1e;return db[_0x3afe('0x31')][_0x3afe('0x53')]({'where':{'id':_0x15327e['params']['id']}})[_0x3afe('0x28')](handleEntityNotFound(_0x23a4e6,null))[_0x3afe('0x28')](function(_0x3be2bf){if(_0x3be2bf){_0x535b27=_0x3be2bf;_0x2cc2c1[_0x3afe('0x35')]=_[_0x3afe('0x49')](db[_0x3afe('0x55')][_0x3afe('0x32')]);_0x2cc2c1[_0x3afe('0x36')]=_[_0x3afe('0x49')](_0x15327e[_0x3afe('0x36')]);_0x2cc2c1[_0x3afe('0x37')]=_['intersection'](_0x2cc2c1['model'],_0x2cc2c1['query']);_0x1f1ab4[_0x3afe('0x38')]=_[_0x3afe('0x39')](_0x2cc2c1[_0x3afe('0x35')],qs['fields'](_0x15327e[_0x3afe('0x36')][_0x3afe('0x3a')]));_0x1f1ab4[_0x3afe('0x38')]=_0x1f1ab4['attributes'][_0x3afe('0x3b')]?_0x1f1ab4[_0x3afe('0x38')]:_0x2cc2c1[_0x3afe('0x35')];_0x1f1ab4[_0x3afe('0x3d')]=qs[_0x3afe('0x3e')](_0x15327e[_0x3afe('0x36')]['sort']);_0x1f1ab4['where']=qs['filters'](_[_0x3afe('0x40')](_0x15327e['query'],_0x2cc2c1[_0x3afe('0x37')]));if(_0x15327e[_0x3afe('0x36')][_0x3afe('0x41')]){_0x1f1ab4[_0x3afe('0x3f')]=_['merge'](_0x1f1ab4[_0x3afe('0x3f')],{'$or':_[_0x3afe('0x30')](_0x1f1ab4[_0x3afe('0x38')],function(_0x3b887e){var _0x3c1c6f={};_0x3c1c6f[_0x3b887e]={'$like':'%'+_0x15327e['query'][_0x3afe('0x41')]+'%'};return _0x3c1c6f;})});}_0x1f1ab4=_['merge']({},_0x1f1ab4,_0x15327e['options']);return _0x535b27[_0x3afe('0x57')](_0x1f1ab4);}})['then'](function(_0x21fbb0){if(_0x21fbb0){_0x25ca1e=_0x21fbb0['length'];if(!_0x15327e['query'][_0x3afe('0x3c')](_0x3afe('0x58'))){_0x1f1ab4[_0x3afe('0x20')]=qs['limit'](_0x15327e[_0x3afe('0x36')]['limit']);_0x1f1ab4[_0x3afe('0x1e')]=qs['offset'](_0x15327e[_0x3afe('0x36')][_0x3afe('0x1e')]);}return _0x535b27[_0x3afe('0x57')](_0x1f1ab4);}})[_0x3afe('0x28')](function(_0x3f5e5e){if(_0x3f5e5e){return _0x3f5e5e?{'count':_0x25ca1e,'rows':_0x3f5e5e}:null;}})['then'](respondWithResult(_0x23a4e6,null))[_0x3afe('0x4c')](handleError(_0x23a4e6,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index 046147d..3cc747a 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 _0x0e4b=['./automation.attributes','define','Automation','tools_automations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x61e178,_0x21ea87){var _0x164c9f=function(_0x2f8415){while(--_0x2f8415){_0x61e178['push'](_0x61e178['shift']());}};_0x164c9f(++_0x21ea87);}(_0x0e4b,0x66));var _0xb0e4=function(_0x445df1,_0x348a49){_0x445df1=_0x445df1-0x0;var _0x3babc4=_0x0e4b[_0x445df1];return _0x3babc4;};'use strict';var _=require(_0xb0e4('0x0'));var util=require(_0xb0e4('0x1'));var logger=require(_0xb0e4('0x2'))(_0xb0e4('0x3'));var moment=require(_0xb0e4('0x4'));var BPromise=require(_0xb0e4('0x5'));var rp=require(_0xb0e4('0x6'));var fs=require('fs');var path=require(_0xb0e4('0x7'));var rimraf=require(_0xb0e4('0x8'));var config=require(_0xb0e4('0x9'));var attributes=require(_0xb0e4('0xa'));module['exports']=function(_0x548930,_0x57bff1){return _0x548930[_0xb0e4('0xb')](_0xb0e4('0xc'),attributes,{'tableName':_0xb0e4('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf36e=['path','rimraf','../../config/environment','./automation.attributes','define','Automation','tools_automations','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x23d2a6,_0x4a2dd5){var _0x4d7dac=function(_0x185c45){while(--_0x185c45){_0x23d2a6['push'](_0x23d2a6['shift']());}};_0x4d7dac(++_0x4a2dd5);}(_0xf36e,0x85));var _0xef36=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf36e[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xef36('0x0'));var util=require(_0xef36('0x1'));var logger=require(_0xef36('0x2'))(_0xef36('0x3'));var moment=require(_0xef36('0x4'));var BPromise=require(_0xef36('0x5'));var rp=require(_0xef36('0x6'));var fs=require('fs');var path=require(_0xef36('0x7'));var rimraf=require(_0xef36('0x8'));var config=require(_0xef36('0x9'));var attributes=require(_0xef36('0xa'));module['exports']=function(_0x148990,_0x2b9ac3){return _0x148990[_0xef36('0xb')](_0xef36('0xc'),attributes,{'tableName':_0xef36('0xd'),'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 98ddc49..32ce599 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 _0xe2ab=['Automation,\x20%s,\x20%s,\x20%s','stringify','error','Automation,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','info','request\x20sent','debug'];(function(_0x4d121d,_0x3fe733){var _0xffa031=function(_0x1fec1b){while(--_0x1fec1b){_0x4d121d['push'](_0x4d121d['shift']());}};_0xffa031(++_0x3fe733);}(_0xe2ab,0xc4));var _0xbe2a=function(_0x14f2dc,_0x55f185){_0x14f2dc=_0x14f2dc-0x0;var _0x31e975=_0xe2ab[_0x14f2dc];return _0x31e975;};'use strict';var _=require(_0xbe2a('0x0'));var util=require(_0xbe2a('0x1'));var moment=require(_0xbe2a('0x2'));var BPromise=require(_0xbe2a('0x3'));var rs=require(_0xbe2a('0x4'));var fs=require('fs');var Redis=require(_0xbe2a('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe2a('0x6'));var logger=require(_0xbe2a('0x7'))(_0xbe2a('0x8'));var config=require(_0xbe2a('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xbe2a('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2f504b,_0x58b8f1,_0x5a8a5d){return new BPromise(function(_0xfccbff,_0x232194){return client['request'](_0x2f504b,_0x5a8a5d)['then'](function(_0x83d775){logger[_0xbe2a('0xb')]('Automation,\x20%s,\x20%s',_0x58b8f1,_0xbe2a('0xc'));logger[_0xbe2a('0xd')](_0xbe2a('0xe'),_0x58b8f1,_0xbe2a('0xc'),JSON[_0xbe2a('0xf')](_0x83d775));if(_0x83d775['error']){if(_0x83d775['error']['code']===0x1f4){logger[_0xbe2a('0x10')](_0xbe2a('0x11'),_0x58b8f1,_0x83d775[_0xbe2a('0x10')][_0xbe2a('0x12')]);return _0x232194(_0x83d775[_0xbe2a('0x10')]['message']);}logger[_0xbe2a('0x10')](_0xbe2a('0x11'),_0x58b8f1,_0x83d775[_0xbe2a('0x10')]['message']);return _0xfccbff(_0x83d775[_0xbe2a('0x10')][_0xbe2a('0x12')]);}else{logger[_0xbe2a('0xb')](_0xbe2a('0x11'),_0x58b8f1,_0xbe2a('0xc'));_0xfccbff(_0x83d775[_0xbe2a('0x13')][_0xbe2a('0x12')]);}})[_0xbe2a('0x14')](function(_0x4395fe){logger['error'](_0xbe2a('0x11'),_0x58b8f1,_0x4395fe);_0x232194(_0x4395fe);});});} \ No newline at end of file +var _0x8cda=['../../config/environment','client','http','request','Automation,\x20%s,\x20%s','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','message','info','request\x20sent','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x5817e6,_0x44a2d0){var _0x51916a=function(_0x1a56e3){while(--_0x1a56e3){_0x5817e6['push'](_0x5817e6['shift']());}};_0x51916a(++_0x44a2d0);}(_0x8cda,0x1db));var _0xa8cd=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x8cda[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0xa8cd('0x0'));var moment=require(_0xa8cd('0x1'));var BPromise=require(_0xa8cd('0x2'));var rs=require(_0xa8cd('0x3'));var fs=require('fs');var Redis=require(_0xa8cd('0x4'));var db=require(_0xa8cd('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa8cd('0x6'))(_0xa8cd('0x7'));var config=require(_0xa8cd('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa8cd('0x9')][_0xa8cd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1362c3,_0x273d2f,_0x2b9b51){return new BPromise(function(_0x2481ba,_0x13f394){return client[_0xa8cd('0xb')](_0x1362c3,_0x2b9b51)['then'](function(_0x50b8ee){logger['info'](_0xa8cd('0xc'),_0x273d2f,'request\x20sent');logger[_0xa8cd('0xd')](_0xa8cd('0xe'),_0x273d2f,'request\x20sent',JSON[_0xa8cd('0xf')](_0x50b8ee));if(_0x50b8ee[_0xa8cd('0x10')]){if(_0x50b8ee['error']['code']===0x1f4){logger[_0xa8cd('0x10')](_0xa8cd('0xc'),_0x273d2f,_0x50b8ee[_0xa8cd('0x10')][_0xa8cd('0x11')]);return _0x13f394(_0x50b8ee[_0xa8cd('0x10')]['message']);}logger[_0xa8cd('0x10')]('Automation,\x20%s,\x20%s',_0x273d2f,_0x50b8ee[_0xa8cd('0x10')]['message']);return _0x2481ba(_0x50b8ee[_0xa8cd('0x10')]['message']);}else{logger[_0xa8cd('0x12')](_0xa8cd('0xc'),_0x273d2f,_0xa8cd('0x13'));_0x2481ba(_0x50b8ee['result']['message']);}})[_0xa8cd('0x14')](function(_0x6d5f40){logger[_0xa8cd('0x10')](_0xa8cd('0xc'),_0x273d2f,_0x6d5f40);_0x13f394(_0x6d5f40);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index 109bfde..bb0b9c7 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 _0x975f=['/:id','show','/:id/conditions','getConditions','getActions','post','create','addConditions','addActions','put','update','delete','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','isAuthenticated','index','get'];(function(_0x46cdd1,_0x5deeff){var _0x26f8fc=function(_0x3b2980){while(--_0x3b2980){_0x46cdd1['push'](_0x46cdd1['shift']());}};_0x26f8fc(++_0x5deeff);}(_0x975f,0x109));var _0xf975=function(_0x2a0183,_0x3fc93c){_0x2a0183=_0x2a0183-0x0;var _0x158c3a=_0x975f[_0x2a0183];return _0x158c3a;};'use strict';var multer=require(_0xf975('0x0'));var util=require(_0xf975('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xf975('0x2'));var router=express[_0xf975('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xf975('0x4'));var interaction=require(_0xf975('0x5'));var config=require(_0xf975('0x6'));var controller=require(_0xf975('0x7'));router['get']('/',auth[_0xf975('0x8')](),controller[_0xf975('0x9')]);router[_0xf975('0xa')](_0xf975('0xb'),auth['isAuthenticated'](),controller[_0xf975('0xc')]);router[_0xf975('0xa')](_0xf975('0xd'),auth['isAuthenticated'](),controller[_0xf975('0xe')]);router[_0xf975('0xa')]('/:id/actions',auth[_0xf975('0x8')](),controller[_0xf975('0xf')]);router[_0xf975('0x10')]('/',auth[_0xf975('0x8')](),controller[_0xf975('0x11')]);router[_0xf975('0x10')](_0xf975('0xd'),auth['isAuthenticated'](),controller[_0xf975('0x12')]);router[_0xf975('0x10')]('/:id/actions',auth[_0xf975('0x8')](),controller[_0xf975('0x13')]);router[_0xf975('0x14')](_0xf975('0xb'),auth[_0xf975('0x8')](),controller[_0xf975('0x15')]);router[_0xf975('0x16')]('/:id',auth[_0xf975('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x4a80=['post','addConditions','addActions','put','update','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','index','show','/:id/conditions','getConditions','/:id/actions','getActions','create'];(function(_0x10dbf6,_0x3ff964){var _0x452147=function(_0x7476e0){while(--_0x7476e0){_0x10dbf6['push'](_0x10dbf6['shift']());}};_0x452147(++_0x3ff964);}(_0x4a80,0xbe));var _0x04a8=function(_0x43cc1c,_0x2b38b8){_0x43cc1c=_0x43cc1c-0x0;var _0x5a0ae8=_0x4a80[_0x43cc1c];return _0x5a0ae8;};'use strict';var multer=require(_0x04a8('0x0'));var util=require('util');var path=require(_0x04a8('0x1'));var timeout=require(_0x04a8('0x2'));var express=require('express');var router=express[_0x04a8('0x3')]();var fs_extra=require(_0x04a8('0x4'));var auth=require(_0x04a8('0x5'));var interaction=require(_0x04a8('0x6'));var config=require(_0x04a8('0x7'));var controller=require(_0x04a8('0x8'));router[_0x04a8('0x9')]('/',auth[_0x04a8('0xa')](),controller[_0x04a8('0xb')]);router[_0x04a8('0x9')]('/:id',auth[_0x04a8('0xa')](),controller[_0x04a8('0xc')]);router[_0x04a8('0x9')](_0x04a8('0xd'),auth[_0x04a8('0xa')](),controller[_0x04a8('0xe')]);router[_0x04a8('0x9')](_0x04a8('0xf'),auth[_0x04a8('0xa')](),controller[_0x04a8('0x10')]);router['post']('/',auth[_0x04a8('0xa')](),controller[_0x04a8('0x11')]);router[_0x04a8('0x12')]('/:id/conditions',auth[_0x04a8('0xa')](),controller[_0x04a8('0x13')]);router[_0x04a8('0x12')](_0x04a8('0xf'),auth[_0x04a8('0xa')](),controller[_0x04a8('0x14')]);router[_0x04a8('0x15')]('/:id',auth[_0x04a8('0xa')](),controller[_0x04a8('0x16')]);router[_0x04a8('0x17')]('/:id',auth['isAuthenticated'](),controller[_0x04a8('0x18')]);module[_0x04a8('0x19')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index 5cefb5a..e6c1d16 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 _0xee42=['Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','exports','ENUM','STRING','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','always','never','BOOLEAN','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)'];(function(_0x1c7889,_0x24cd26){var _0x2f14e5=function(_0x9ae1b1){while(--_0x9ae1b1){_0x1c7889['push'](_0x1c7889['shift']());}};_0x2f14e5(++_0x24cd26);}(_0xee42,0xe2));var _0x2ee4=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0xee42[_0x1a36a5];return _0x746243;};'use strict';var Sequelize=require('sequelize');module[_0x2ee4('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x2ee4('0x1')]('ivr'),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0x2ee4('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x2ee4('0x3')},'limitCalls':{'type':Sequelize[_0x2ee4('0x4')](0x4)[_0x2ee4('0x5')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x2ee4('0x6')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x2ee4('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x2ee4('0x4')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2ee4('0x7')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x2ee4('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2ee4('0x8')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x2ee4('0x4')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2ee4('0x9')},'dialBusyMaxRetry':{'type':Sequelize[_0x2ee4('0x4')](0x3)[_0x2ee4('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2ee4('0xa')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x2ee4('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2ee4('0xb')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x2ee4('0x4')](0x3)[_0x2ee4('0x5')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x2ee4('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2ee4('0xc')},'dialGlobalMaxRetry':{'type':Sequelize[_0x2ee4('0x4')](0x3)[_0x2ee4('0x5')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x2ee4('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x2ee4('0x2')],'defaultValue':_0x2ee4('0xd')},'dialCheckDuplicateType':{'type':Sequelize[_0x2ee4('0x1')](_0x2ee4('0xe'),_0x2ee4('0xf'),'onlyIfOpen'),'defaultValue':_0x2ee4('0xe')},'dialAMDActive':{'type':Sequelize[_0x2ee4('0x10')],'defaultValue':0x0,'comment':_0x2ee4('0x11')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x2ee4('0x5')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x2ee4('0x12')},'dialAMDGreeting':{'type':Sequelize[_0x2ee4('0x4')](0x9)[_0x2ee4('0x5')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x2ee4('0x4')](0x9)[_0x2ee4('0x5')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x2ee4('0x13')},'dialAMDMinWordLength':{'type':Sequelize[_0x2ee4('0x4')](0x9)[_0x2ee4('0x5')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x2ee4('0x14')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x2ee4('0x4')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x2ee4('0x4')](0x9)[_0x2ee4('0x5')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x2ee4('0x5')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x2ee4('0x15')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x2ee4('0x4')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x2ee4('0x16')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x2ee4('0x17'),_0x2ee4('0x18')),'defaultValue':_0x2ee4('0x17')},'dialPrefix':{'type':Sequelize[_0x2ee4('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x2ee4('0x4')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x2ee4('0x19')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x2ee4('0x1a')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x2ee4('0x4')](0x3)[_0x2ee4('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2ee4('0x1b')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x2ee4('0x4')](0x5)[_0x2ee4('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2ee4('0x1c')},'dialDropMaxRetry':{'type':Sequelize[_0x2ee4('0x4')](0x3)[_0x2ee4('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2ee4('0x1d')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x2ee4('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2ee4('0x1e')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x2ee4('0x4')](0x3)[_0x2ee4('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x2ee4('0x4')](0x5)[_0x2ee4('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2ee4('0x1f')},'dialMachineMaxRetry':{'type':Sequelize[_0x2ee4('0x4')](0x3)[_0x2ee4('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2ee4('0x20')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2ee4('0x21')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x2ee4('0x4')](0x3)[_0x2ee4('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2ee4('0x22')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x2ee4('0x4')](0x5)[_0x2ee4('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2ee4('0x23')}}; \ No newline at end of file +var _0xb89a=['STRING','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','#Congestion\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','DESC','ASC','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','ENUM'];(function(_0xbc256d,_0x2a5cc6){var _0x3d74c9=function(_0x127c02){while(--_0x127c02){_0xbc256d['push'](_0xbc256d['shift']());}};_0x3d74c9(++_0x2a5cc6);}(_0xb89a,0xde));var _0xab89=function(_0x5c660a,_0x4b5262){_0x5c660a=_0x5c660a-0x0;var _0x3a77a4=_0xb89a[_0x5c660a];return _0x3a77a4;};'use strict';var Sequelize=require(_0xab89('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xab89('0x1')]('ivr'),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0xab89('0x2')]},'active':{'type':Sequelize[_0xab89('0x3')],'defaultValue':0x0,'comment':_0xab89('0x4')},'limitCalls':{'type':Sequelize[_0xab89('0x5')](0x4)[_0xab89('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xab89('0x7')},'dialOriginateCallerIdName':{'type':Sequelize[_0xab89('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xab89('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0xab89('0x5')](0x3)[_0xab89('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0xab89('0x5')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xab89('0x8')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xab89('0x5')](0x5)[_0xab89('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0xab89('0x5')](0x3)[_0xab89('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0xab89('0x5')](0x5)[_0xab89('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xab89('0x9')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xab89('0x6')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xab89('0x5')](0x5)[_0xab89('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0xab89('0x5')](0x3)[_0xab89('0x6')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xab89('0xa')},'dialTimezone':{'type':Sequelize[_0xab89('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xab89('0x2')],'defaultValue':_0xab89('0xb')},'dialCheckDuplicateType':{'type':Sequelize[_0xab89('0x1')](_0xab89('0xc'),_0xab89('0xd'),'onlyIfOpen'),'defaultValue':_0xab89('0xc')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xab89('0xe')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0xab89('0x6')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xab89('0xf')},'dialAMDGreeting':{'type':Sequelize[_0xab89('0x5')](0x9)[_0xab89('0x6')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xab89('0x10')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xab89('0x5')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xab89('0x11')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xab89('0x5')](0x9)[_0xab89('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0xab89('0x6')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xab89('0x5')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xab89('0x12')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xab89('0x13')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xab89('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0xab89('0x14'),_0xab89('0x15')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xab89('0x5')](0x3)[_0xab89('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0xab89('0x5')](0x3)[_0xab89('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xab89('0x5')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xab89('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xab89('0x16')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xab89('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xab89('0x17')},'dialDropRetryFrequency':{'type':Sequelize[_0xab89('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0xab89('0x5')](0x3)[_0xab89('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xab89('0x5')](0x5)[_0xab89('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xab89('0x18')},'dialMachineMaxRetry':{'type':Sequelize[_0xab89('0x5')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xab89('0x19')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xab89('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xab89('0x5')](0x3)[_0xab89('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xab89('0x1a')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xab89('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xab89('0x1b')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 206e773..0a6f900 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 _0x1db3=['getLists','CmList','format','addLists','ids','dialCheckDuplicateType','insert','into','cm_hopper','phone','scheduledAt','ContactId','ListId','select','field','CmListId','toString','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','from','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','NOW()','cm_contacts','fromQuery','ListId\x20=\x20?','cm_hopper_additional_phones','h.id','ci.item','OrderBy','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','spread','cm_hopper_black','removeBlackLists','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','apply','reject','save','update','then','IvrCampaigns','end','error','name','index','map','fieldName','type','query','keys','model','attributes','fields','length','hasOwnProperty','order','where','filters','pick','filter','merge','VIRTUAL','options','Campaign','includeAll','include','findAll','catch','params','intersection','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rawAttributes','omit','updatedAt','createdAt','destroy','getHoppers','findOne','CmHopper','nolimit','sort','rows','getHopperHistories','CmHopperHistory','CmHopperFinal','CampaignId','getHopperBlacks','CmHopperBlack'];(function(_0x1c7af8,_0x2aaf94){var _0x35f639=function(_0x4a9424){while(--_0x4a9424){_0x1c7af8['push'](_0x1c7af8['shift']());}};_0x35f639(++_0x2aaf94);}(_0x1db3,0x1e5));var _0x31db=function(_0x3f7b4e,_0x358893){_0x3f7b4e=_0x3f7b4e-0x0;var _0x51008a=_0x1db3[_0x3f7b4e];return _0x51008a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x31db('0x0'));var zipdir=require(_0x31db('0x1'));var jsonpatch=require(_0x31db('0x2'));var rp=require(_0x31db('0x3'));var moment=require(_0x31db('0x4'));var BPromise=require(_0x31db('0x5'));var Mustache=require(_0x31db('0x6'));var util=require(_0x31db('0x7'));var path=require(_0x31db('0x8'));var sox=require(_0x31db('0x9'));var csv=require(_0x31db('0xa'));var ejs=require(_0x31db('0xb'));var fs=require('fs');var fs_extra=require(_0x31db('0xc'));var _=require(_0x31db('0xd'));var squel=require(_0x31db('0xe'));var crypto=require(_0x31db('0xf'));var jsforce=require(_0x31db('0x10'));var deskjs=require(_0x31db('0x11'));var toCsv=require(_0x31db('0xa'));var querystring=require('querystring');var Papa=require(_0x31db('0x12'));var Redis=require(_0x31db('0x13'));var authService=require(_0x31db('0x14'));var qs=require(_0x31db('0x15'));var as=require(_0x31db('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x31db('0x17'))(_0x31db('0x18'));var utils=require(_0x31db('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x31db('0x1a'));var db=require(_0x31db('0x1b'))['db'];function respondWithStatusCode(_0x1fad0a,_0x1ca88f){_0x1ca88f=_0x1ca88f||0xcc;return function(_0x298707){if(_0x298707){return _0x1fad0a[_0x31db('0x1c')](_0x1ca88f);}return _0x1fad0a['status'](_0x1ca88f)['end']();};}function respondWithResult(_0xc899ba,_0x5706dc){_0x5706dc=_0x5706dc||0xc8;return function(_0x1ccc17){if(_0x1ccc17){return _0xc899ba[_0x31db('0x1d')](_0x5706dc)[_0x31db('0x1e')](_0x1ccc17);}};}function respondWithFilteredResult(_0x2009c7,_0x29f691){return function(_0x4ccb3d){if(_0x4ccb3d){var _0x557907=typeof _0x29f691['offset']===_0x31db('0x1f')&&typeof _0x29f691[_0x31db('0x20')]===_0x31db('0x1f');var _0x4dbc05=_0x4ccb3d[_0x31db('0x21')];var _0x1d3218=_0x557907?0x0:_0x29f691[_0x31db('0x22')];var _0x3df86e=_0x557907?_0x4ccb3d[_0x31db('0x21')]:_0x29f691[_0x31db('0x22')]+_0x29f691[_0x31db('0x20')];var _0x53ca16;if(_0x3df86e>=_0x4dbc05){_0x3df86e=_0x4dbc05;_0x53ca16=0xc8;}else{_0x53ca16=0xce;}_0x2009c7[_0x31db('0x1d')](_0x53ca16);return _0x2009c7['set']('Content-Range',_0x1d3218+'-'+_0x3df86e+'/'+_0x4dbc05)[_0x31db('0x1e')](_0x4ccb3d);}return null;};}function patchUpdates(_0x1915ec){return function(_0x168002){try{jsonpatch[_0x31db('0x23')](_0x168002,_0x1915ec,!![]);}catch(_0x211e59){return BPromise[_0x31db('0x24')](_0x211e59);}return _0x168002[_0x31db('0x25')]();};}function saveUpdates(_0x98ce70,_0x204781){return function(_0x1f00f7){if(_0x1f00f7){return _0x1f00f7[_0x31db('0x26')](_0x98ce70)[_0x31db('0x27')](function(_0x5574e5){return _0x5574e5;});}return null;};}function removeEntity(_0x358d1d,_0x335cc9){return function(_0x303cf4){if(_0x303cf4){return _0x303cf4['destroy']()[_0x31db('0x27')](function(){var _0x54d623=_0x303cf4['get']({'plain':!![]});var _0x2ea3a6=_0x31db('0x28');return db['UserProfileResource']['destroy']({'where':{'type':_0x2ea3a6,'resourceId':_0x54d623['id']}})['then'](function(){return _0x303cf4;});})[_0x31db('0x27')](function(){_0x358d1d['status'](0xcc)[_0x31db('0x29')]();});}};}function handleEntityNotFound(_0xe10c6a,_0x1f3355){return function(_0x3effc4){if(!_0x3effc4){_0xe10c6a[_0x31db('0x1c')](0x194);}return _0x3effc4;};}function handleError(_0xb969fe,_0x2e1c2d){_0x2e1c2d=_0x2e1c2d||0x1f4;return function(_0x19d079){logger[_0x31db('0x2a')](_0x19d079['stack']);if(_0x19d079[_0x31db('0x2b')]){delete _0x19d079[_0x31db('0x2b')];}_0xb969fe['status'](_0x2e1c2d)['send'](_0x19d079);};}exports[_0x31db('0x2c')]=function(_0x5f256c,_0x5e29e4){var _0x5a6368={},_0x260d00={},_0x2d5e49={'count':0x0,'rows':[]};var _0x5e3867=_[_0x31db('0x2d')](db['Campaign']['rawAttributes'],function(_0x2a41c9){return{'name':_0x2a41c9[_0x31db('0x2e')],'type':_0x2a41c9[_0x31db('0x2f')]['key']};});_0x260d00['model']=_[_0x31db('0x2d')](_0x5e3867,_0x31db('0x2b'));_0x260d00[_0x31db('0x30')]=_[_0x31db('0x31')](_0x5f256c[_0x31db('0x30')]);_0x260d00['filters']=_['intersection'](_0x260d00[_0x31db('0x32')],_0x260d00['query']);_0x5a6368[_0x31db('0x33')]=_['intersection'](_0x260d00[_0x31db('0x32')],qs[_0x31db('0x34')](_0x5f256c[_0x31db('0x30')][_0x31db('0x34')]));_0x5a6368['attributes']=_0x5a6368[_0x31db('0x33')][_0x31db('0x35')]?_0x5a6368['attributes']:_0x260d00['model'];if(!_0x5f256c[_0x31db('0x30')][_0x31db('0x36')]('nolimit')){_0x5a6368['limit']=qs[_0x31db('0x20')](_0x5f256c[_0x31db('0x30')][_0x31db('0x20')]);_0x5a6368[_0x31db('0x22')]=qs['offset'](_0x5f256c[_0x31db('0x30')][_0x31db('0x22')]);}_0x5a6368[_0x31db('0x37')]=qs['sort'](_0x5f256c[_0x31db('0x30')]['sort']);_0x5a6368[_0x31db('0x38')]=qs[_0x31db('0x39')](_[_0x31db('0x3a')](_0x5f256c[_0x31db('0x30')],_0x260d00['filters']),_0x5e3867);if(_0x5f256c[_0x31db('0x30')][_0x31db('0x3b')]){_0x5a6368[_0x31db('0x38')]=_[_0x31db('0x3c')](_0x5a6368['where'],{'$or':_[_0x31db('0x2d')](_0x5e3867,function(_0x26f071){if(_0x26f071[_0x31db('0x2f')]!==_0x31db('0x3d')){var _0x55714d={};_0x55714d[_0x26f071[_0x31db('0x2b')]]={'$like':'%'+_0x5f256c[_0x31db('0x30')][_0x31db('0x3b')]+'%'};return _0x55714d;}})});}_0x5a6368=_[_0x31db('0x3c')]({},_0x5a6368,_0x5f256c[_0x31db('0x3e')]);var _0x97e7f7={'where':_0x5a6368[_0x31db('0x38')]};return db[_0x31db('0x3f')][_0x31db('0x21')](_0x97e7f7)[_0x31db('0x27')](function(_0x21e693){_0x2d5e49['count']=_0x21e693;if(_0x5f256c[_0x31db('0x30')][_0x31db('0x40')]){_0x5a6368[_0x31db('0x41')]=[{'all':!![]}];}return db[_0x31db('0x3f')][_0x31db('0x42')](_0x5a6368);})[_0x31db('0x27')](function(_0x17d9b8){_0x2d5e49['rows']=_0x17d9b8;return _0x2d5e49;})[_0x31db('0x27')](respondWithFilteredResult(_0x5e29e4,_0x5a6368))[_0x31db('0x43')](handleError(_0x5e29e4,null));};exports['show']=function(_0xe9d1fa,_0x5aa2b2){var _0x15a21c={'raw':![],'where':{'id':_0xe9d1fa[_0x31db('0x44')]['id']}},_0x242304={};_0x242304['model']=_[_0x31db('0x31')](db[_0x31db('0x3f')]['rawAttributes']);_0x242304[_0x31db('0x30')]=_[_0x31db('0x31')](_0xe9d1fa[_0x31db('0x30')]);_0x242304[_0x31db('0x39')]=_[_0x31db('0x45')](_0x242304[_0x31db('0x32')],_0x242304[_0x31db('0x30')]);_0x15a21c[_0x31db('0x33')]=_['intersection'](_0x242304[_0x31db('0x32')],qs[_0x31db('0x34')](_0xe9d1fa[_0x31db('0x30')][_0x31db('0x34')]));_0x15a21c[_0x31db('0x33')]=_0x15a21c['attributes']['length']?_0x15a21c[_0x31db('0x33')]:_0x242304[_0x31db('0x32')];if(_0xe9d1fa[_0x31db('0x30')][_0x31db('0x40')]){_0x15a21c[_0x31db('0x41')]=[{'all':!![]}];}_0x15a21c=_[_0x31db('0x3c')]({},_0x15a21c,_0xe9d1fa[_0x31db('0x3e')]);return db[_0x31db('0x3f')][_0x31db('0x46')](_0x15a21c)[_0x31db('0x27')](handleEntityNotFound(_0x5aa2b2,null))['then'](respondWithResult(_0x5aa2b2,null))[_0x31db('0x43')](handleError(_0x5aa2b2,null));};exports[_0x31db('0x47')]=function(_0xd9b947,_0x180021){return db[_0x31db('0x3f')][_0x31db('0x47')](_0xd9b947[_0x31db('0x48')],{})[_0x31db('0x27')](function(_0x496d40){var _0x21998d=_0xd9b947['user'][_0x31db('0x49')]({'plain':!![]});if(!_0x21998d)throw new Error(_0x31db('0x4a'));if(_0x21998d[_0x31db('0x4b')]===_0x31db('0x4c')){var _0x4f861b=_0x496d40['get']({'plain':!![]});var _0x55db42=_0x31db('0x28');return db[_0x31db('0x4d')][_0x31db('0x46')]({'where':{'name':_0x55db42,'userProfileId':_0x21998d[_0x31db('0x4e')]},'raw':!![]})['then'](function(_0x31b324){if(_0x31b324&&_0x31b324[_0x31db('0x4f')]===0x0){return db[_0x31db('0x50')]['create']({'name':_0x4f861b[_0x31db('0x2b')],'resourceId':_0x4f861b['id'],'type':_0x31b324['name'],'sectionId':_0x31b324['id']},{})[_0x31db('0x27')](function(){return _0x496d40;});}else{return _0x496d40;}})[_0x31db('0x43')](function(_0x51fe21){logger[_0x31db('0x2a')](_0x31db('0x51'),_0x51fe21);throw _0x51fe21;});}return _0x496d40;})['then'](respondWithResult(_0x180021,0xc9))[_0x31db('0x43')](handleError(_0x180021,null));};exports['clone']=function(_0x919425,_0x31a1a8){var _0x5d0ff1={'where':{'id':_0x919425['params']['id']}},_0x3e6733={};_0x3e6733[_0x31db('0x32')]=_[_0x31db('0x31')](db[_0x31db('0x3f')][_0x31db('0x52')]);_0x5d0ff1[_0x31db('0x33')]=_[_0x31db('0x45')](_0x3e6733[_0x31db('0x32')],qs[_0x31db('0x34')](_0x919425['query'][_0x31db('0x34')]));_0x5d0ff1[_0x31db('0x33')]=_0x5d0ff1[_0x31db('0x33')][_0x31db('0x35')]?_0x5d0ff1[_0x31db('0x33')]:_0x3e6733[_0x31db('0x32')];if(_0x919425[_0x31db('0x30')][_0x31db('0x40')]){_0x5d0ff1['include']=[{'all':!![]}];}_0x5d0ff1=_[_0x31db('0x3c')]({},_0x5d0ff1,_0x919425['options']);return db[_0x31db('0x3f')][_0x31db('0x46')](_0x5d0ff1)[_0x31db('0x27')](handleEntityNotFound(_0x31a1a8,null))[_0x31db('0x27')](function(_0x23e416){if(_0x23e416){var _0x3479b6=_0x23e416[_0x31db('0x49')]({'plain':!![]});_0x3479b6=qs[_0x31db('0x53')](_0x3479b6,['id','createdAt',_0x31db('0x54')]);_0x919425['body']=_[_0x31db('0x53')](_0x919425[_0x31db('0x48')],['id',_0x31db('0x55'),_0x31db('0x54')]);return db[_0x31db('0x3f')][_0x31db('0x47')](_[_0x31db('0x3c')](_0x3479b6,_0x919425[_0x31db('0x48')]),{'include':_0x919425[_0x31db('0x30')][_0x31db('0x40')]?[{'all':!![]}]:undefined})[_0x31db('0x27')](function(_0x4ced2f){var _0x1e8777=_0x919425['user'][_0x31db('0x49')]({'plain':!![]});if(!_0x1e8777)throw new Error(_0x31db('0x4a'));if(_0x1e8777[_0x31db('0x4b')]===_0x31db('0x4c')){var _0x10045a=_0x4ced2f[_0x31db('0x49')]({'plain':!![]});var _0x25f94c=_0x31db('0x28');return db['UserProfileSection'][_0x31db('0x46')]({'where':{'name':_0x25f94c,'userProfileId':_0x1e8777['userProfileId']},'raw':!![]})[_0x31db('0x27')](function(_0x5d448b){if(_0x5d448b&&_0x5d448b[_0x31db('0x4f')]===0x0){return db[_0x31db('0x50')]['create']({'name':_0x10045a[_0x31db('0x2b')],'resourceId':_0x10045a['id'],'type':_0x5d448b[_0x31db('0x2b')],'sectionId':_0x5d448b['id']},{})[_0x31db('0x27')](function(){return _0x4ced2f;});}else{return _0x4ced2f;}})[_0x31db('0x43')](function(_0x166d49){logger[_0x31db('0x2a')](_0x31db('0x51'),_0x166d49);throw _0x166d49;});}return _0x4ced2f;});}})[_0x31db('0x27')](respondWithResult(_0x31a1a8,0xc9))[_0x31db('0x43')](handleError(_0x31a1a8,null));};exports[_0x31db('0x26')]=function(_0x1526af,_0x54d3a0){if(_0x1526af[_0x31db('0x48')]['id']){delete _0x1526af[_0x31db('0x48')]['id'];}return db['Campaign'][_0x31db('0x46')]({'where':{'id':_0x1526af[_0x31db('0x44')]['id']}})['then'](handleEntityNotFound(_0x54d3a0,null))[_0x31db('0x27')](saveUpdates(_0x1526af['body'],null))[_0x31db('0x27')](respondWithResult(_0x54d3a0,null))[_0x31db('0x43')](handleError(_0x54d3a0,null));};exports[_0x31db('0x56')]=function(_0x41179a,_0x2aafcd){return db[_0x31db('0x3f')][_0x31db('0x46')]({'where':{'id':_0x41179a['params']['id']}})['then'](handleEntityNotFound(_0x2aafcd,null))['then'](removeEntity(_0x2aafcd,null))['catch'](handleError(_0x2aafcd,null));};exports[_0x31db('0x57')]=function(_0x225144,_0x1ab4c0,_0x374bd4){var _0x46c678={'raw':!![],'where':{}};var _0x21e3cf={};var _0x38cc83={'count':0x0,'rows':[]};return db['Campaign'][_0x31db('0x58')]({'where':{'id':_0x225144[_0x31db('0x44')]['id']}})[_0x31db('0x27')](handleEntityNotFound(_0x1ab4c0,null))[_0x31db('0x27')](function(_0x3ccf4c){if(_0x3ccf4c){_0x21e3cf['model']=_['keys'](db[_0x31db('0x59')][_0x31db('0x52')]);_0x21e3cf[_0x31db('0x30')]=_[_0x31db('0x31')](_0x225144[_0x31db('0x30')]);_0x21e3cf[_0x31db('0x39')]=_['intersection'](_0x21e3cf['model'],_0x21e3cf[_0x31db('0x30')]);_0x46c678[_0x31db('0x33')]=_[_0x31db('0x45')](_0x21e3cf['model'],qs[_0x31db('0x34')](_0x225144[_0x31db('0x30')][_0x31db('0x34')]));_0x46c678[_0x31db('0x33')]=_0x46c678[_0x31db('0x33')][_0x31db('0x35')]?_0x46c678['attributes']:_0x21e3cf['model'];if(!_0x225144[_0x31db('0x30')][_0x31db('0x36')](_0x31db('0x5a'))){_0x46c678['limit']=qs[_0x31db('0x20')](_0x225144[_0x31db('0x30')][_0x31db('0x20')]);_0x46c678[_0x31db('0x22')]=qs[_0x31db('0x22')](_0x225144[_0x31db('0x30')]['offset']);}_0x46c678[_0x31db('0x37')]=qs[_0x31db('0x5b')](_0x225144[_0x31db('0x30')][_0x31db('0x5b')]);_0x46c678[_0x31db('0x38')]=qs[_0x31db('0x39')](_[_0x31db('0x3a')](_0x225144[_0x31db('0x30')],_0x21e3cf[_0x31db('0x39')]));_0x46c678[_0x31db('0x38')]['CampaignId']=_0x3ccf4c['id'];if(_0x225144[_0x31db('0x30')][_0x31db('0x3b')]){_0x46c678['where']=_[_0x31db('0x3c')](_0x46c678[_0x31db('0x38')],{'$or':_[_0x31db('0x2d')](_0x46c678[_0x31db('0x33')],function(_0x4aaa1f){var _0x189595={};_0x189595[_0x4aaa1f]={'$like':'%'+_0x225144['query'][_0x31db('0x3b')]+'%'};return _0x189595;})});}_0x46c678=_['merge']({},_0x46c678,_0x225144['options']);return db[_0x31db('0x59')][_0x31db('0x21')]({'where':_0x46c678['where']})[_0x31db('0x27')](function(_0x409b2d){_0x38cc83[_0x31db('0x21')]=_0x409b2d;if(_0x225144[_0x31db('0x30')][_0x31db('0x40')]){_0x46c678[_0x31db('0x41')]=[{'all':!![]}];}return db[_0x31db('0x59')][_0x31db('0x42')](_0x46c678);})[_0x31db('0x27')](function(_0x1e756d){_0x38cc83[_0x31db('0x5c')]=_0x1e756d;return _0x38cc83;});}})['then'](respondWithFilteredResult(_0x1ab4c0,_0x46c678))[_0x31db('0x43')](handleError(_0x1ab4c0,null));};exports[_0x31db('0x5d')]=function(_0x14a76c,_0x19b391,_0x6a0b03){var _0x1a443a={'raw':!![],'where':{}};var _0x58e645={};var _0x392886={'count':0x0,'rows':[]};return db[_0x31db('0x3f')][_0x31db('0x58')]({'where':{'id':_0x14a76c[_0x31db('0x44')]['id']}})[_0x31db('0x27')](handleEntityNotFound(_0x19b391,null))[_0x31db('0x27')](function(_0xa86607){if(_0xa86607){_0x58e645[_0x31db('0x32')]=_[_0x31db('0x31')](db[_0x31db('0x5e')][_0x31db('0x52')]);_0x58e645[_0x31db('0x30')]=_[_0x31db('0x31')](_0x14a76c[_0x31db('0x30')]);_0x58e645[_0x31db('0x39')]=_[_0x31db('0x45')](_0x58e645[_0x31db('0x32')],_0x58e645[_0x31db('0x30')]);_0x1a443a[_0x31db('0x33')]=_[_0x31db('0x45')](_0x58e645[_0x31db('0x32')],qs[_0x31db('0x34')](_0x14a76c[_0x31db('0x30')][_0x31db('0x34')]));_0x1a443a[_0x31db('0x33')]=_0x1a443a[_0x31db('0x33')]['length']?_0x1a443a[_0x31db('0x33')]:_0x58e645['model'];if(!_0x14a76c['query'][_0x31db('0x36')](_0x31db('0x5a'))){_0x1a443a[_0x31db('0x20')]=qs['limit'](_0x14a76c[_0x31db('0x30')][_0x31db('0x20')]);_0x1a443a['offset']=qs['offset'](_0x14a76c['query'][_0x31db('0x22')]);}_0x1a443a[_0x31db('0x37')]=qs[_0x31db('0x5b')](_0x14a76c[_0x31db('0x30')][_0x31db('0x5b')]);_0x1a443a[_0x31db('0x38')]=qs[_0x31db('0x39')](_[_0x31db('0x3a')](_0x14a76c['query'],_0x58e645['filters']));_0x1a443a['where']['CampaignId']=_0xa86607['id'];if(_0x14a76c[_0x31db('0x30')]['filter']){_0x1a443a[_0x31db('0x38')]=_['merge'](_0x1a443a['where'],{'$or':_[_0x31db('0x2d')](_0x1a443a['attributes'],function(_0x2b69eb){var _0xe520e8={};_0xe520e8[_0x2b69eb]={'$like':'%'+_0x14a76c[_0x31db('0x30')]['filter']+'%'};return _0xe520e8;})});}_0x1a443a=_['merge']({},_0x1a443a,_0x14a76c['options']);return db[_0x31db('0x5e')][_0x31db('0x21')]({'where':_0x1a443a[_0x31db('0x38')]})[_0x31db('0x27')](function(_0xe9f99d){_0x392886['count']=_0xe9f99d;if(_0x14a76c[_0x31db('0x30')][_0x31db('0x40')]){_0x1a443a[_0x31db('0x41')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x31db('0x42')](_0x1a443a);})[_0x31db('0x27')](function(_0xb1be21){_0x392886[_0x31db('0x5c')]=_0xb1be21;return _0x392886;});}})[_0x31db('0x27')](respondWithFilteredResult(_0x19b391,_0x1a443a))[_0x31db('0x43')](handleError(_0x19b391,null));};exports['getHopperFinals']=function(_0x148410,_0x3a6dd2,_0x4d8f7e){var _0x5e12a7={'raw':!![],'where':{}};var _0x5364c3={};var _0x4f05b0={'count':0x0,'rows':[]};return db[_0x31db('0x3f')][_0x31db('0x58')]({'where':{'id':_0x148410[_0x31db('0x44')]['id']}})[_0x31db('0x27')](handleEntityNotFound(_0x3a6dd2,null))[_0x31db('0x27')](function(_0x2fc070){if(_0x2fc070){_0x5364c3[_0x31db('0x32')]=_[_0x31db('0x31')](db[_0x31db('0x5f')][_0x31db('0x52')]);_0x5364c3[_0x31db('0x30')]=_[_0x31db('0x31')](_0x148410[_0x31db('0x30')]);_0x5364c3[_0x31db('0x39')]=_[_0x31db('0x45')](_0x5364c3['model'],_0x5364c3[_0x31db('0x30')]);_0x5e12a7[_0x31db('0x33')]=_['intersection'](_0x5364c3[_0x31db('0x32')],qs[_0x31db('0x34')](_0x148410[_0x31db('0x30')][_0x31db('0x34')]));_0x5e12a7[_0x31db('0x33')]=_0x5e12a7[_0x31db('0x33')]['length']?_0x5e12a7[_0x31db('0x33')]:_0x5364c3[_0x31db('0x32')];if(!_0x148410['query'][_0x31db('0x36')](_0x31db('0x5a'))){_0x5e12a7[_0x31db('0x20')]=qs[_0x31db('0x20')](_0x148410['query'][_0x31db('0x20')]);_0x5e12a7['offset']=qs['offset'](_0x148410[_0x31db('0x30')]['offset']);}_0x5e12a7[_0x31db('0x37')]=qs['sort'](_0x148410[_0x31db('0x30')][_0x31db('0x5b')]);_0x5e12a7[_0x31db('0x38')]=qs['filters'](_[_0x31db('0x3a')](_0x148410[_0x31db('0x30')],_0x5364c3[_0x31db('0x39')]));_0x5e12a7[_0x31db('0x38')][_0x31db('0x60')]=_0x2fc070['id'];if(_0x148410[_0x31db('0x30')][_0x31db('0x3b')]){_0x5e12a7[_0x31db('0x38')]=_[_0x31db('0x3c')](_0x5e12a7[_0x31db('0x38')],{'$or':_['map'](_0x5e12a7[_0x31db('0x33')],function(_0x22c5ec){var _0x4262e2={};_0x4262e2[_0x22c5ec]={'$like':'%'+_0x148410[_0x31db('0x30')][_0x31db('0x3b')]+'%'};return _0x4262e2;})});}_0x5e12a7=_[_0x31db('0x3c')]({},_0x5e12a7,_0x148410['options']);return db[_0x31db('0x5f')][_0x31db('0x21')]({'where':_0x5e12a7['where']})[_0x31db('0x27')](function(_0x25fce6){_0x4f05b0[_0x31db('0x21')]=_0x25fce6;if(_0x148410[_0x31db('0x30')]['includeAll']){_0x5e12a7[_0x31db('0x41')]=[{'all':!![]}];}return db[_0x31db('0x5f')]['findAll'](_0x5e12a7);})['then'](function(_0x355654){_0x4f05b0[_0x31db('0x5c')]=_0x355654;return _0x4f05b0;});}})['then'](respondWithFilteredResult(_0x3a6dd2,_0x5e12a7))[_0x31db('0x43')](handleError(_0x3a6dd2,null));};exports[_0x31db('0x61')]=function(_0x45adac,_0x423767,_0xeb01e3){var _0x269328={'raw':!![],'where':{}};var _0x347532={};var _0x180c15={'count':0x0,'rows':[]};return db[_0x31db('0x3f')][_0x31db('0x58')]({'where':{'id':_0x45adac[_0x31db('0x44')]['id']}})['then'](handleEntityNotFound(_0x423767,null))[_0x31db('0x27')](function(_0x481a5c){if(_0x481a5c){_0x347532['model']=_[_0x31db('0x31')](db[_0x31db('0x62')][_0x31db('0x52')]);_0x347532[_0x31db('0x30')]=_[_0x31db('0x31')](_0x45adac['query']);_0x347532[_0x31db('0x39')]=_[_0x31db('0x45')](_0x347532[_0x31db('0x32')],_0x347532[_0x31db('0x30')]);_0x269328['attributes']=_[_0x31db('0x45')](_0x347532[_0x31db('0x32')],qs[_0x31db('0x34')](_0x45adac['query'][_0x31db('0x34')]));_0x269328[_0x31db('0x33')]=_0x269328[_0x31db('0x33')][_0x31db('0x35')]?_0x269328[_0x31db('0x33')]:_0x347532['model'];if(!_0x45adac[_0x31db('0x30')][_0x31db('0x36')](_0x31db('0x5a'))){_0x269328[_0x31db('0x20')]=qs[_0x31db('0x20')](_0x45adac[_0x31db('0x30')][_0x31db('0x20')]);_0x269328[_0x31db('0x22')]=qs[_0x31db('0x22')](_0x45adac[_0x31db('0x30')][_0x31db('0x22')]);}_0x269328['order']=qs[_0x31db('0x5b')](_0x45adac['query'][_0x31db('0x5b')]);_0x269328[_0x31db('0x38')]=qs['filters'](_['pick'](_0x45adac[_0x31db('0x30')],_0x347532[_0x31db('0x39')]));_0x269328[_0x31db('0x38')]['CampaignId']=_0x481a5c['id'];if(_0x45adac[_0x31db('0x30')][_0x31db('0x3b')]){_0x269328[_0x31db('0x38')]=_[_0x31db('0x3c')](_0x269328['where'],{'$or':_[_0x31db('0x2d')](_0x269328[_0x31db('0x33')],function(_0xaf54dc){var _0x114943={};_0x114943[_0xaf54dc]={'$like':'%'+_0x45adac[_0x31db('0x30')]['filter']+'%'};return _0x114943;})});}_0x269328=_[_0x31db('0x3c')]({},_0x269328,_0x45adac[_0x31db('0x3e')]);return db[_0x31db('0x62')][_0x31db('0x21')]({'where':_0x269328['where']})[_0x31db('0x27')](function(_0x1f7b90){_0x180c15[_0x31db('0x21')]=_0x1f7b90;if(_0x45adac[_0x31db('0x30')][_0x31db('0x40')]){_0x269328[_0x31db('0x41')]=[{'all':!![]}];}return db[_0x31db('0x62')][_0x31db('0x42')](_0x269328);})[_0x31db('0x27')](function(_0x3cfe19){_0x180c15[_0x31db('0x5c')]=_0x3cfe19;return _0x180c15;});}})['then'](respondWithFilteredResult(_0x423767,_0x269328))[_0x31db('0x43')](handleError(_0x423767,null));};exports[_0x31db('0x63')]=function(_0xcee621,_0x4430e9,_0x3f15e6){var _0x2bb353={};var _0x4ebd4f={};var _0x1324ee;var _0x5ef744;return db[_0x31db('0x3f')]['findOne']({'where':{'id':_0xcee621[_0x31db('0x44')]['id']}})[_0x31db('0x27')](handleEntityNotFound(_0x4430e9,null))[_0x31db('0x27')](function(_0x1de2d0){if(_0x1de2d0){_0x1324ee=_0x1de2d0;_0x4ebd4f['model']=_[_0x31db('0x31')](db[_0x31db('0x64')][_0x31db('0x52')]);_0x4ebd4f[_0x31db('0x30')]=_[_0x31db('0x31')](_0xcee621[_0x31db('0x30')]);_0x4ebd4f[_0x31db('0x39')]=_[_0x31db('0x45')](_0x4ebd4f[_0x31db('0x32')],_0x4ebd4f[_0x31db('0x30')]);_0x2bb353['attributes']=_[_0x31db('0x45')](_0x4ebd4f[_0x31db('0x32')],qs[_0x31db('0x34')](_0xcee621[_0x31db('0x30')][_0x31db('0x34')]));_0x2bb353[_0x31db('0x33')]=_0x2bb353[_0x31db('0x33')][_0x31db('0x35')]?_0x2bb353[_0x31db('0x33')]:_0x4ebd4f['model'];_0x2bb353[_0x31db('0x37')]=qs[_0x31db('0x5b')](_0xcee621[_0x31db('0x30')][_0x31db('0x5b')]);_0x2bb353[_0x31db('0x38')]=qs[_0x31db('0x39')](_[_0x31db('0x3a')](_0xcee621[_0x31db('0x30')],_0x4ebd4f[_0x31db('0x39')]));if(_0xcee621[_0x31db('0x30')]['filter']){_0x2bb353[_0x31db('0x38')]=_[_0x31db('0x3c')](_0x2bb353['where'],{'$or':_['map'](_0x2bb353[_0x31db('0x33')],function(_0x1043d5){var _0x15cde6={};_0x15cde6[_0x1043d5]={'$like':'%'+_0xcee621[_0x31db('0x30')]['filter']+'%'};return _0x15cde6;})});}_0x2bb353=_['merge']({},_0x2bb353,_0xcee621['options']);return _0x1324ee[_0x31db('0x63')](_0x2bb353);}})[_0x31db('0x27')](function(_0x377ac1){if(_0x377ac1){_0x5ef744=_0x377ac1[_0x31db('0x35')];if(!_0xcee621[_0x31db('0x30')]['hasOwnProperty'](_0x31db('0x5a'))){_0x2bb353[_0x31db('0x20')]=qs[_0x31db('0x20')](_0xcee621[_0x31db('0x30')][_0x31db('0x20')]);_0x2bb353[_0x31db('0x22')]=qs['offset'](_0xcee621[_0x31db('0x30')][_0x31db('0x22')]);}return _0x1324ee[_0x31db('0x63')](_0x2bb353);}})[_0x31db('0x27')](function(_0x160775){if(_0x160775){return _0x160775?{'count':_0x5ef744,'rows':_0x160775}:null;}})[_0x31db('0x27')](respondWithResult(_0x4430e9,null))[_0x31db('0x43')](handleError(_0x4430e9,null));};exports['addLists']=function(_0x21dfa2,_0x55354e,_0x2f7746){var _0x27ab95,_0xd418fe;var _0x1376dd=[];var _0x1fdb48=moment()[_0x31db('0x65')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x31db('0x3f')]['find']({'where':{'id':_0x21dfa2['params']['id']}})[_0x31db('0x27')](handleEntityNotFound(_0x55354e,null))[_0x31db('0x27')](function(_0x17def){if(_0x17def){_0xd418fe=_0x17def;return _0x17def[_0x31db('0x66')](_0x21dfa2['body'][_0x31db('0x67')],_[_0x31db('0x53')](_0x21dfa2['body'],[_0x31db('0x67'),'id'])||{});}return null;})['spread'](function(_0x186f56){var _0x24dc7f;var _0x30ad4c;_0x27ab95=_0x186f56||[];var _0x3ebfe3=[];if(_0x186f56){for(var _0x41849c=0x0;_0x41849c<_0x186f56[_0x31db('0x35')];_0x41849c+=0x1){var _0x3d90db=_0x186f56[_0x41849c]['get']({'plain':!![]});_0xd418fe[_0x31db('0x68')]=_0x21dfa2[_0x31db('0x48')][_0x31db('0x68')]?_0x21dfa2[_0x31db('0x48')][_0x31db('0x68')]:_0xd418fe[_0x31db('0x68')];switch(_0xd418fe['dialCheckDuplicateType']){case'always':_0x24dc7f=squel[_0x31db('0x69')]()[_0x31db('0x6a')](_0x31db('0x6b'))['fromQuery']([_0x31db('0x6c'),_0x31db('0x6d'),_0x31db('0x6e'),_0x31db('0x6f'),_0x31db('0x60'),'createdAt','updatedAt'],squel[_0x31db('0x70')]()[_0x31db('0x71')](_0x31db('0x6c'),_0x31db('0x6c'))[_0x31db('0x71')]('NOW()',_0x31db('0x6d'))[_0x31db('0x71')]('id',_0x31db('0x6e'))[_0x31db('0x71')](_0x3d90db[_0x31db('0x72')][_0x31db('0x73')](),_0x31db('0x6f'))[_0x31db('0x71')](_0x21dfa2[_0x31db('0x44')]['id'][_0x31db('0x73')](),_0x31db('0x60'))[_0x31db('0x71')]('\x27'+_0x1fdb48+'\x27',_0x31db('0x55'))['field']('\x27'+_0x1fdb48+'\x27',_0x31db('0x54'))['from']('cm_contacts')[_0x31db('0x38')](_0x31db('0x74'))[_0x31db('0x38')]('ListId\x20=\x20?',_0x3d90db[_0x31db('0x72')][_0x31db('0x73')]())[_0x31db('0x38')](_0x31db('0x75'))[_0x31db('0x38')](_0x31db('0x76'),squel[_0x31db('0x70')]()['field']('COALESCE(calleridnum,\x27\x27)')[_0x31db('0x77')](_0x31db('0x78'))[_0x31db('0x38')](_0x31db('0x79'),_0x21dfa2[_0x31db('0x44')]['id'][_0x31db('0x73')]()))[_0x31db('0x38')](_0x31db('0x76'),squel[_0x31db('0x70')]()[_0x31db('0x71')](_0x31db('0x7a'))[_0x31db('0x77')]('cm_hopper')[_0x31db('0x38')](_0x31db('0x79'),_0x21dfa2[_0x31db('0x44')]['id'][_0x31db('0x73')]())))['toString']();break;case'onlyIfOpen':_0x24dc7f=squel[_0x31db('0x69')]()[_0x31db('0x6a')](_0x31db('0x6b'))['fromQuery'](['phone',_0x31db('0x6d'),_0x31db('0x6e'),_0x31db('0x6f'),_0x31db('0x60'),'createdAt',_0x31db('0x54')],squel[_0x31db('0x70')]()[_0x31db('0x71')](_0x31db('0x6c'),_0x31db('0x6c'))[_0x31db('0x71')](_0x31db('0x7b'),'scheduledAt')[_0x31db('0x71')]('id',_0x31db('0x6e'))[_0x31db('0x71')](_0x3d90db[_0x31db('0x72')][_0x31db('0x73')](),_0x31db('0x6f'))['field'](_0x21dfa2[_0x31db('0x44')]['id']['toString'](),_0x31db('0x60'))[_0x31db('0x71')]('\x27'+_0x1fdb48+'\x27','createdAt')[_0x31db('0x71')]('\x27'+_0x1fdb48+'\x27','updatedAt')['from'](_0x31db('0x7c'))[_0x31db('0x38')](_0x31db('0x74'))[_0x31db('0x38')]('ListId\x20=\x20?',_0x3d90db[_0x31db('0x72')]['toString']())[_0x31db('0x38')](_0x31db('0x75'))[_0x31db('0x38')](_0x31db('0x76'),squel[_0x31db('0x70')]()[_0x31db('0x71')](_0x31db('0x7a'))[_0x31db('0x77')]('cm_hopper')['where'](_0x31db('0x79'),_0x21dfa2[_0x31db('0x44')]['id'][_0x31db('0x73')]())))['toString']();break;default:_0x24dc7f=squel['insert']()[_0x31db('0x6a')]('cm_hopper')[_0x31db('0x7d')](['phone',_0x31db('0x6d'),_0x31db('0x6e'),_0x31db('0x6f'),_0x31db('0x60'),_0x31db('0x55'),_0x31db('0x54')],squel[_0x31db('0x70')]()[_0x31db('0x71')]('phone',_0x31db('0x6c'))[_0x31db('0x71')]('NOW()',_0x31db('0x6d'))[_0x31db('0x71')]('id',_0x31db('0x6e'))[_0x31db('0x71')](_0x3d90db['CmListId'][_0x31db('0x73')](),'ListId')['field'](_0x21dfa2[_0x31db('0x44')]['id'][_0x31db('0x73')](),_0x31db('0x60'))[_0x31db('0x71')]('\x27'+_0x1fdb48+'\x27','createdAt')['field']('\x27'+_0x1fdb48+'\x27',_0x31db('0x54'))[_0x31db('0x77')](_0x31db('0x7c'))[_0x31db('0x38')](_0x31db('0x74'))['where'](_0x31db('0x7e'),_0x3d90db[_0x31db('0x72')][_0x31db('0x73')]())[_0x31db('0x38')](_0x31db('0x75')))[_0x31db('0x73')]();}_0x30ad4c=squel['insert']()[_0x31db('0x6a')](_0x31db('0x7f'))[_0x31db('0x7d')](['cmHopperId',_0x31db('0x6d'),_0x31db('0x6c'),'OrderBy','createdAt',_0x31db('0x54')],squel[_0x31db('0x70')]()[_0x31db('0x71')](_0x31db('0x80'),'id')[_0x31db('0x71')]('NOW()','scheduledAt')[_0x31db('0x71')](_0x31db('0x81'),_0x31db('0x6c'))[_0x31db('0x71')]('ci.OrderBY',_0x31db('0x82'))['field']('\x27'+_0x1fdb48+'\x27',_0x31db('0x55'))[_0x31db('0x71')]('\x27'+_0x1fdb48+'\x27',_0x31db('0x54'))[_0x31db('0x77')](_0x31db('0x83'),'ci')[_0x31db('0x84')](_0x31db('0x6b'),'h',_0x31db('0x85'))[_0x31db('0x38')](_0x31db('0x86'),_0x3d90db[_0x31db('0x72')][_0x31db('0x73')]())[_0x31db('0x38')](_0x31db('0x87'),_0x21dfa2[_0x31db('0x44')]['id'][_0x31db('0x73')]())[_0x31db('0x38')](_0x31db('0x88'),_0x1fdb48))[_0x31db('0x73')]();_0x3ebfe3[_0x31db('0x89')](db[_0x31db('0x8a')][_0x31db('0x30')](_0x24dc7f));_0x1376dd[_0x31db('0x89')](db[_0x31db('0x8a')][_0x31db('0x30')](_0x30ad4c));}return BPromise[_0x31db('0x8b')](_0x3ebfe3);}})[_0x31db('0x27')](function(){return BPromise[_0x31db('0x8b')](_0x1376dd);})[_0x31db('0x27')](function(){return _0x27ab95;})[_0x31db('0x27')](respondWithResult(_0x55354e,null))['catch'](handleError(_0x55354e,null));};exports[_0x31db('0x8c')]=function(_0x5965e1,_0x5ba364,_0x1222b8){return db[_0x31db('0x3f')]['find']({'where':{'id':_0x5965e1['params']['id']}})[_0x31db('0x27')](handleEntityNotFound(_0x5ba364,null))[_0x31db('0x27')](function(_0x4e534e){if(_0x4e534e){return _0x4e534e[_0x31db('0x8c')](_0x5965e1['query'][_0x31db('0x67')]);}})[_0x31db('0x27')](function(_0x901a92){if(_0x901a92){return db['CmHopper'][_0x31db('0x56')]({'where':{'ListId':_0x5965e1[_0x31db('0x30')][_0x31db('0x67')],'CampaignId':_0x5965e1[_0x31db('0x44')]['id']}})[_0x31db('0x27')](function(){return _0x901a92;});}})[_0x31db('0x27')](respondWithStatusCode(_0x5ba364,null))['catch'](handleError(_0x5ba364,null));};exports['getBlackLists']=function(_0x289317,_0x1311cb,_0x45f527){var _0x13c2c0={};var _0x3481b1={};var _0x8df891;var _0x1e7170;return db[_0x31db('0x3f')][_0x31db('0x58')]({'where':{'id':_0x289317[_0x31db('0x44')]['id']}})[_0x31db('0x27')](handleEntityNotFound(_0x1311cb,null))[_0x31db('0x27')](function(_0x58a966){if(_0x58a966){_0x8df891=_0x58a966;_0x3481b1[_0x31db('0x32')]=_[_0x31db('0x31')](db['CmList'][_0x31db('0x52')]);_0x3481b1[_0x31db('0x30')]=_[_0x31db('0x31')](_0x289317['query']);_0x3481b1[_0x31db('0x39')]=_[_0x31db('0x45')](_0x3481b1['model'],_0x3481b1[_0x31db('0x30')]);_0x13c2c0[_0x31db('0x33')]=_[_0x31db('0x45')](_0x3481b1['model'],qs[_0x31db('0x34')](_0x289317[_0x31db('0x30')][_0x31db('0x34')]));_0x13c2c0['attributes']=_0x13c2c0[_0x31db('0x33')]['length']?_0x13c2c0[_0x31db('0x33')]:_0x3481b1['model'];_0x13c2c0[_0x31db('0x37')]=qs[_0x31db('0x5b')](_0x289317[_0x31db('0x30')]['sort']);_0x13c2c0['where']=qs[_0x31db('0x39')](_['pick'](_0x289317[_0x31db('0x30')],_0x3481b1[_0x31db('0x39')]));if(_0x289317[_0x31db('0x30')]['filter']){_0x13c2c0[_0x31db('0x38')]=_[_0x31db('0x3c')](_0x13c2c0[_0x31db('0x38')],{'$or':_[_0x31db('0x2d')](_0x13c2c0[_0x31db('0x33')],function(_0x1db46f){var _0x54786f={};_0x54786f[_0x1db46f]={'$like':'%'+_0x289317['query']['filter']+'%'};return _0x54786f;})});}_0x13c2c0=_['merge']({},_0x13c2c0,_0x289317[_0x31db('0x3e')]);return _0x8df891[_0x31db('0x8d')](_0x13c2c0);}})[_0x31db('0x27')](function(_0x1fab25){if(_0x1fab25){_0x1e7170=_0x1fab25[_0x31db('0x35')];if(!_0x289317['query'][_0x31db('0x36')](_0x31db('0x5a'))){_0x13c2c0[_0x31db('0x20')]=qs['limit'](_0x289317['query'][_0x31db('0x20')]);_0x13c2c0[_0x31db('0x22')]=qs[_0x31db('0x22')](_0x289317[_0x31db('0x30')][_0x31db('0x22')]);}return _0x8df891['getBlackLists'](_0x13c2c0);}})[_0x31db('0x27')](function(_0x35e245){if(_0x35e245){return _0x35e245?{'count':_0x1e7170,'rows':_0x35e245}:null;}})[_0x31db('0x27')](respondWithResult(_0x1311cb,null))[_0x31db('0x43')](handleError(_0x1311cb,null));};exports[_0x31db('0x8e')]=function(_0x4962ea,_0x372e0c,_0x4ddd13){var _0x3e3cf2,_0xcf6abf;var _0x3299c3=[];var _0xcd46dd=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');return db[_0x31db('0x3f')][_0x31db('0x46')]({'where':{'id':_0x4962ea[_0x31db('0x44')]['id']}})[_0x31db('0x27')](handleEntityNotFound(_0x372e0c,null))[_0x31db('0x27')](function(_0x771fd7){if(_0x771fd7){_0xcf6abf=_0x771fd7;return _0x771fd7[_0x31db('0x8e')](_0x4962ea[_0x31db('0x48')][_0x31db('0x67')],_[_0x31db('0x53')](_0x4962ea[_0x31db('0x48')],[_0x31db('0x67'),'id'])||{});}return null;})[_0x31db('0x8f')](function(_0x2f19bd){var _0x44f158;var _0x400a14;_0x3e3cf2=_0x2f19bd||[];var _0x317990=[];if(_0x2f19bd){for(var _0x33c0b6=0x0;_0x33c0b6<_0x2f19bd[_0x31db('0x35')];_0x33c0b6+=0x1){var _0x131942=_0x2f19bd[_0x33c0b6][_0x31db('0x49')]({'plain':!![]});_0x44f158=squel[_0x31db('0x69')]()[_0x31db('0x6a')](_0x31db('0x90'))[_0x31db('0x7d')]([_0x31db('0x6c'),_0x31db('0x6e'),_0x31db('0x6f'),_0x31db('0x60'),_0x31db('0x55'),'updatedAt'],squel[_0x31db('0x70')]()[_0x31db('0x71')]('phone',_0x31db('0x6c'))[_0x31db('0x71')]('id',_0x31db('0x6e'))[_0x31db('0x71')](_0x131942['CmListId'][_0x31db('0x73')](),_0x31db('0x6f'))[_0x31db('0x71')](_0x4962ea['params']['id'][_0x31db('0x73')](),_0x31db('0x60'))[_0x31db('0x71')](_0x31db('0x7b'),'createdAt')[_0x31db('0x71')](_0x31db('0x7b'),'updatedAt')['from'](_0x31db('0x7c'))[_0x31db('0x38')](_0x31db('0x74'))[_0x31db('0x38')](_0x31db('0x7e'),_0x131942[_0x31db('0x72')][_0x31db('0x73')]())[_0x31db('0x38')](_0x31db('0x75')))[_0x31db('0x73')]();_0x317990[_0x31db('0x89')](db['sequelize'][_0x31db('0x30')](_0x44f158));}return BPromise[_0x31db('0x8b')](_0x317990);}})[_0x31db('0x27')](function(){return _0x3e3cf2;})[_0x31db('0x27')](respondWithResult(_0x372e0c,null))[_0x31db('0x43')](handleError(_0x372e0c,null));};exports[_0x31db('0x91')]=function(_0x3839be,_0xb2967d,_0x378b96){return db[_0x31db('0x3f')][_0x31db('0x46')]({'where':{'id':_0x3839be[_0x31db('0x44')]['id']}})['then'](handleEntityNotFound(_0xb2967d,null))[_0x31db('0x27')](function(_0x459193){if(_0x459193){return _0x459193['removeBlackLists'](_0x3839be['query'][_0x31db('0x67')]);}})[_0x31db('0x27')](function(_0x26c21d){if(_0x26c21d){return db[_0x31db('0x62')][_0x31db('0x56')]({'where':{'ListId':_0x3839be[_0x31db('0x30')][_0x31db('0x67')],'CampaignId':_0x3839be[_0x31db('0x44')]['id']}})[_0x31db('0x27')](function(){return _0x26c21d;});}})[_0x31db('0x27')](respondWithStatusCode(_0xb2967d,null))['catch'](handleError(_0xb2967d,null));}; \ No newline at end of file +var _0xc15c=['field','phone','ContactId','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','phone\x20NOT\x20IN\x20(?)','cm_hopper','CampaignId\x20=\x20?','onlyIfOpen','NOW()','phone\x20IS\x20NOT\x20NULL','COALESCE(phone,\x27\x27)','cm_hopper_additional_phones','h.id','ci.item','ci.OrderBY','OrderBy','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','push','sequelize','all','removeLists','getBlackLists','addBlackLists','removeBlackLists','zip-dir','fast-json-patch','request-promise','bluebird','path','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','IvrCampaigns','UserProfileResource','destroy','error','stack','name','index','map','Campaign','rawAttributes','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','keys','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','userProfileId','find','getHoppers','findOne','nolimit','pick','CmHopper','rows','CmHopperHistory','CampaignId','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','always','insert','into','fromQuery','scheduledAt','ListId','select'];(function(_0x2d554f,_0x284acd){var _0x579473=function(_0x4f155c){while(--_0x4f155c){_0x2d554f['push'](_0x2d554f['shift']());}};_0x579473(++_0x284acd);}(_0xc15c,0xae));var _0xcc15=function(_0x1148a1,_0x6c920e){_0x1148a1=_0x1148a1-0x0;var _0x101a8c=_0xc15c[_0x1148a1];return _0x101a8c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xcc15('0x0'));var jsonpatch=require(_0xcc15('0x1'));var rp=require(_0xcc15('0x2'));var moment=require('moment');var BPromise=require(_0xcc15('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0xcc15('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xcc15('0x5'));var fs=require('fs');var fs_extra=require(_0xcc15('0x6'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xcc15('0x7'));var jsforce=require(_0xcc15('0x8'));var deskjs=require(_0xcc15('0x9'));var toCsv=require(_0xcc15('0xa'));var querystring=require(_0xcc15('0xb'));var Papa=require('papaparse');var Redis=require(_0xcc15('0xc'));var authService=require(_0xcc15('0xd'));var qs=require(_0xcc15('0xe'));var as=require(_0xcc15('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcc15('0x10'))(_0xcc15('0x11'));var utils=require(_0xcc15('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xcc15('0x13'))['db'];function respondWithStatusCode(_0x49344c,_0x45667d){_0x45667d=_0x45667d||0xcc;return function(_0x5bddf5){if(_0x5bddf5){return _0x49344c[_0xcc15('0x14')](_0x45667d);}return _0x49344c['status'](_0x45667d)[_0xcc15('0x15')]();};}function respondWithResult(_0x5e59fa,_0x812431){_0x812431=_0x812431||0xc8;return function(_0x1ffa48){if(_0x1ffa48){return _0x5e59fa[_0xcc15('0x16')](_0x812431)[_0xcc15('0x17')](_0x1ffa48);}};}function respondWithFilteredResult(_0x5ecb66,_0x52a7bf){return function(_0x55421d){if(_0x55421d){var _0x591c2f=typeof _0x52a7bf[_0xcc15('0x18')]===_0xcc15('0x19')&&typeof _0x52a7bf[_0xcc15('0x1a')]==='undefined';var _0x587186=_0x55421d[_0xcc15('0x1b')];var _0x5ca31a=_0x591c2f?0x0:_0x52a7bf[_0xcc15('0x18')];var _0x293f7c=_0x591c2f?_0x55421d[_0xcc15('0x1b')]:_0x52a7bf['offset']+_0x52a7bf['limit'];var _0x327797;if(_0x293f7c>=_0x587186){_0x293f7c=_0x587186;_0x327797=0xc8;}else{_0x327797=0xce;}_0x5ecb66[_0xcc15('0x16')](_0x327797);return _0x5ecb66['set'](_0xcc15('0x1c'),_0x5ca31a+'-'+_0x293f7c+'/'+_0x587186)[_0xcc15('0x17')](_0x55421d);}return null;};}function patchUpdates(_0x3f574c){return function(_0x4cf37e){try{jsonpatch[_0xcc15('0x1d')](_0x4cf37e,_0x3f574c,!![]);}catch(_0x4e9f99){return BPromise[_0xcc15('0x1e')](_0x4e9f99);}return _0x4cf37e['save']();};}function saveUpdates(_0x2f2910,_0xc49a73){return function(_0x610317){if(_0x610317){return _0x610317[_0xcc15('0x1f')](_0x2f2910)['then'](function(_0x1778c1){return _0x1778c1;});}return null;};}function removeEntity(_0x25c171,_0x40b917){return function(_0x168ee9){if(_0x168ee9){return _0x168ee9['destroy']()[_0xcc15('0x20')](function(){var _0x1a4f95=_0x168ee9['get']({'plain':!![]});var _0x5a8598=_0xcc15('0x21');return db[_0xcc15('0x22')][_0xcc15('0x23')]({'where':{'type':_0x5a8598,'resourceId':_0x1a4f95['id']}})[_0xcc15('0x20')](function(){return _0x168ee9;});})['then'](function(){_0x25c171[_0xcc15('0x16')](0xcc)[_0xcc15('0x15')]();});}};}function handleEntityNotFound(_0x4f4af8,_0x10e94a){return function(_0x5eff3b){if(!_0x5eff3b){_0x4f4af8['sendStatus'](0x194);}return _0x5eff3b;};}function handleError(_0xb92104,_0x4ced34){_0x4ced34=_0x4ced34||0x1f4;return function(_0x481c4e){logger[_0xcc15('0x24')](_0x481c4e[_0xcc15('0x25')]);if(_0x481c4e[_0xcc15('0x26')]){delete _0x481c4e[_0xcc15('0x26')];}_0xb92104[_0xcc15('0x16')](_0x4ced34)['send'](_0x481c4e);};}exports[_0xcc15('0x27')]=function(_0x37c14b,_0x840c99){var _0x22631b={},_0x3c6102={},_0x42a740={'count':0x0,'rows':[]};var _0xa44d17=_[_0xcc15('0x28')](db[_0xcc15('0x29')][_0xcc15('0x2a')],function(_0x491c12){return{'name':_0x491c12['fieldName'],'type':_0x491c12[_0xcc15('0x2b')][_0xcc15('0x2c')]};});_0x3c6102[_0xcc15('0x2d')]=_[_0xcc15('0x28')](_0xa44d17,_0xcc15('0x26'));_0x3c6102[_0xcc15('0x2e')]=_['keys'](_0x37c14b[_0xcc15('0x2e')]);_0x3c6102['filters']=_[_0xcc15('0x2f')](_0x3c6102[_0xcc15('0x2d')],_0x3c6102[_0xcc15('0x2e')]);_0x22631b[_0xcc15('0x30')]=_[_0xcc15('0x2f')](_0x3c6102[_0xcc15('0x2d')],qs[_0xcc15('0x31')](_0x37c14b[_0xcc15('0x2e')][_0xcc15('0x31')]));_0x22631b[_0xcc15('0x30')]=_0x22631b['attributes'][_0xcc15('0x32')]?_0x22631b[_0xcc15('0x30')]:_0x3c6102[_0xcc15('0x2d')];if(!_0x37c14b[_0xcc15('0x2e')][_0xcc15('0x33')]('nolimit')){_0x22631b[_0xcc15('0x1a')]=qs[_0xcc15('0x1a')](_0x37c14b[_0xcc15('0x2e')]['limit']);_0x22631b['offset']=qs[_0xcc15('0x18')](_0x37c14b[_0xcc15('0x2e')]['offset']);}_0x22631b[_0xcc15('0x34')]=qs['sort'](_0x37c14b[_0xcc15('0x2e')][_0xcc15('0x35')]);_0x22631b[_0xcc15('0x36')]=qs[_0xcc15('0x37')](_['pick'](_0x37c14b[_0xcc15('0x2e')],_0x3c6102[_0xcc15('0x37')]),_0xa44d17);if(_0x37c14b[_0xcc15('0x2e')][_0xcc15('0x38')]){_0x22631b[_0xcc15('0x36')]=_[_0xcc15('0x39')](_0x22631b[_0xcc15('0x36')],{'$or':_[_0xcc15('0x28')](_0xa44d17,function(_0x3cbab2){if(_0x3cbab2[_0xcc15('0x2b')]!==_0xcc15('0x3a')){var _0x20f5c2={};_0x20f5c2[_0x3cbab2[_0xcc15('0x26')]]={'$like':'%'+_0x37c14b[_0xcc15('0x2e')][_0xcc15('0x38')]+'%'};return _0x20f5c2;}})});}_0x22631b=_['merge']({},_0x22631b,_0x37c14b[_0xcc15('0x3b')]);var _0x44e479={'where':_0x22631b['where']};return db[_0xcc15('0x29')][_0xcc15('0x1b')](_0x44e479)[_0xcc15('0x20')](function(_0x32bfcc){_0x42a740[_0xcc15('0x1b')]=_0x32bfcc;if(_0x37c14b[_0xcc15('0x2e')][_0xcc15('0x3c')]){_0x22631b[_0xcc15('0x3d')]=[{'all':!![]}];}return db[_0xcc15('0x29')][_0xcc15('0x3e')](_0x22631b);})[_0xcc15('0x20')](function(_0x3178af){_0x42a740['rows']=_0x3178af;return _0x42a740;})['then'](respondWithFilteredResult(_0x840c99,_0x22631b))[_0xcc15('0x3f')](handleError(_0x840c99,null));};exports[_0xcc15('0x40')]=function(_0x1be276,_0x24be80){var _0x56dc90={'raw':![],'where':{'id':_0x1be276[_0xcc15('0x41')]['id']}},_0x408108={};_0x408108['model']=_['keys'](db[_0xcc15('0x29')][_0xcc15('0x2a')]);_0x408108[_0xcc15('0x2e')]=_[_0xcc15('0x42')](_0x1be276[_0xcc15('0x2e')]);_0x408108[_0xcc15('0x37')]=_['intersection'](_0x408108[_0xcc15('0x2d')],_0x408108[_0xcc15('0x2e')]);_0x56dc90['attributes']=_[_0xcc15('0x2f')](_0x408108['model'],qs['fields'](_0x1be276[_0xcc15('0x2e')]['fields']));_0x56dc90[_0xcc15('0x30')]=_0x56dc90['attributes'][_0xcc15('0x32')]?_0x56dc90[_0xcc15('0x30')]:_0x408108[_0xcc15('0x2d')];if(_0x1be276[_0xcc15('0x2e')][_0xcc15('0x3c')]){_0x56dc90[_0xcc15('0x3d')]=[{'all':!![]}];}_0x56dc90=_['merge']({},_0x56dc90,_0x1be276[_0xcc15('0x3b')]);return db[_0xcc15('0x29')]['find'](_0x56dc90)[_0xcc15('0x20')](handleEntityNotFound(_0x24be80,null))[_0xcc15('0x20')](respondWithResult(_0x24be80,null))[_0xcc15('0x3f')](handleError(_0x24be80,null));};exports[_0xcc15('0x43')]=function(_0x5f08bb,_0x31460b){return db[_0xcc15('0x29')][_0xcc15('0x43')](_0x5f08bb[_0xcc15('0x44')],{})[_0xcc15('0x20')](function(_0x2014b3){var _0x1611dc=_0x5f08bb[_0xcc15('0x45')][_0xcc15('0x46')]({'plain':!![]});if(!_0x1611dc)throw new Error(_0xcc15('0x47'));if(_0x1611dc[_0xcc15('0x48')]===_0xcc15('0x45')){var _0x34c6b1=_0x2014b3[_0xcc15('0x46')]({'plain':!![]});var _0x8bd575=_0xcc15('0x21');return db['UserProfileSection']['find']({'where':{'name':_0x8bd575,'userProfileId':_0x1611dc['userProfileId']},'raw':!![]})['then'](function(_0x649487){if(_0x649487&&_0x649487[_0xcc15('0x49')]===0x0){return db[_0xcc15('0x22')][_0xcc15('0x43')]({'name':_0x34c6b1['name'],'resourceId':_0x34c6b1['id'],'type':_0x649487[_0xcc15('0x26')],'sectionId':_0x649487['id']},{})[_0xcc15('0x20')](function(){return _0x2014b3;});}else{return _0x2014b3;}})[_0xcc15('0x3f')](function(_0x12b9e9){logger[_0xcc15('0x24')](_0xcc15('0x4a'),_0x12b9e9);throw _0x12b9e9;});}return _0x2014b3;})[_0xcc15('0x20')](respondWithResult(_0x31460b,0xc9))['catch'](handleError(_0x31460b,null));};exports[_0xcc15('0x4b')]=function(_0x2efc1d,_0x3db19a){var _0x1d59a9={'where':{'id':_0x2efc1d['params']['id']}},_0x131966={};_0x131966[_0xcc15('0x2d')]=_[_0xcc15('0x42')](db['Campaign'][_0xcc15('0x2a')]);_0x1d59a9['attributes']=_[_0xcc15('0x2f')](_0x131966[_0xcc15('0x2d')],qs[_0xcc15('0x31')](_0x2efc1d[_0xcc15('0x2e')][_0xcc15('0x31')]));_0x1d59a9[_0xcc15('0x30')]=_0x1d59a9[_0xcc15('0x30')][_0xcc15('0x32')]?_0x1d59a9[_0xcc15('0x30')]:_0x131966[_0xcc15('0x2d')];if(_0x2efc1d[_0xcc15('0x2e')][_0xcc15('0x3c')]){_0x1d59a9[_0xcc15('0x3d')]=[{'all':!![]}];}_0x1d59a9=_['merge']({},_0x1d59a9,_0x2efc1d[_0xcc15('0x3b')]);return db[_0xcc15('0x29')]['find'](_0x1d59a9)['then'](handleEntityNotFound(_0x3db19a,null))['then'](function(_0x411063){if(_0x411063){var _0x1cae9c=_0x411063[_0xcc15('0x46')]({'plain':!![]});_0x1cae9c=qs[_0xcc15('0x4c')](_0x1cae9c,['id',_0xcc15('0x4d'),_0xcc15('0x4e')]);_0x2efc1d[_0xcc15('0x44')]=_['omit'](_0x2efc1d[_0xcc15('0x44')],['id',_0xcc15('0x4d'),_0xcc15('0x4e')]);return db[_0xcc15('0x29')][_0xcc15('0x43')](_[_0xcc15('0x39')](_0x1cae9c,_0x2efc1d['body']),{'include':_0x2efc1d[_0xcc15('0x2e')][_0xcc15('0x3c')]?[{'all':!![]}]:undefined})[_0xcc15('0x20')](function(_0x35057a){var _0x121317=_0x2efc1d[_0xcc15('0x45')][_0xcc15('0x46')]({'plain':!![]});if(!_0x121317)throw new Error(_0xcc15('0x47'));if(_0x121317[_0xcc15('0x48')]==='user'){var _0xe660f6=_0x35057a[_0xcc15('0x46')]({'plain':!![]});var _0x3d5770='IvrCampaigns';return db['UserProfileSection']['find']({'where':{'name':_0x3d5770,'userProfileId':_0x121317[_0xcc15('0x4f')]},'raw':!![]})[_0xcc15('0x20')](function(_0x446243){if(_0x446243&&_0x446243[_0xcc15('0x49')]===0x0){return db[_0xcc15('0x22')]['create']({'name':_0xe660f6[_0xcc15('0x26')],'resourceId':_0xe660f6['id'],'type':_0x446243[_0xcc15('0x26')],'sectionId':_0x446243['id']},{})[_0xcc15('0x20')](function(){return _0x35057a;});}else{return _0x35057a;}})[_0xcc15('0x3f')](function(_0x2c8eca){logger['error'](_0xcc15('0x4a'),_0x2c8eca);throw _0x2c8eca;});}return _0x35057a;});}})[_0xcc15('0x20')](respondWithResult(_0x3db19a,0xc9))[_0xcc15('0x3f')](handleError(_0x3db19a,null));};exports['update']=function(_0x4e8840,_0x26da42){if(_0x4e8840[_0xcc15('0x44')]['id']){delete _0x4e8840[_0xcc15('0x44')]['id'];}return db[_0xcc15('0x29')][_0xcc15('0x50')]({'where':{'id':_0x4e8840[_0xcc15('0x41')]['id']}})['then'](handleEntityNotFound(_0x26da42,null))[_0xcc15('0x20')](saveUpdates(_0x4e8840[_0xcc15('0x44')],null))[_0xcc15('0x20')](respondWithResult(_0x26da42,null))[_0xcc15('0x3f')](handleError(_0x26da42,null));};exports['destroy']=function(_0x1a0dd9,_0x4d1e84){return db[_0xcc15('0x29')][_0xcc15('0x50')]({'where':{'id':_0x1a0dd9['params']['id']}})[_0xcc15('0x20')](handleEntityNotFound(_0x4d1e84,null))['then'](removeEntity(_0x4d1e84,null))[_0xcc15('0x3f')](handleError(_0x4d1e84,null));};exports[_0xcc15('0x51')]=function(_0x174451,_0x2d443b,_0x3693b7){var _0x2f00bc={'raw':!![],'where':{}};var _0x481385={};var _0x534557={'count':0x0,'rows':[]};return db[_0xcc15('0x29')][_0xcc15('0x52')]({'where':{'id':_0x174451['params']['id']}})[_0xcc15('0x20')](handleEntityNotFound(_0x2d443b,null))[_0xcc15('0x20')](function(_0x44a60c){if(_0x44a60c){_0x481385['model']=_[_0xcc15('0x42')](db['CmHopper'][_0xcc15('0x2a')]);_0x481385[_0xcc15('0x2e')]=_[_0xcc15('0x42')](_0x174451[_0xcc15('0x2e')]);_0x481385[_0xcc15('0x37')]=_[_0xcc15('0x2f')](_0x481385['model'],_0x481385[_0xcc15('0x2e')]);_0x2f00bc[_0xcc15('0x30')]=_[_0xcc15('0x2f')](_0x481385[_0xcc15('0x2d')],qs['fields'](_0x174451['query'][_0xcc15('0x31')]));_0x2f00bc[_0xcc15('0x30')]=_0x2f00bc[_0xcc15('0x30')][_0xcc15('0x32')]?_0x2f00bc[_0xcc15('0x30')]:_0x481385[_0xcc15('0x2d')];if(!_0x174451[_0xcc15('0x2e')][_0xcc15('0x33')](_0xcc15('0x53'))){_0x2f00bc[_0xcc15('0x1a')]=qs[_0xcc15('0x1a')](_0x174451[_0xcc15('0x2e')][_0xcc15('0x1a')]);_0x2f00bc[_0xcc15('0x18')]=qs[_0xcc15('0x18')](_0x174451['query'][_0xcc15('0x18')]);}_0x2f00bc[_0xcc15('0x34')]=qs[_0xcc15('0x35')](_0x174451[_0xcc15('0x2e')]['sort']);_0x2f00bc['where']=qs['filters'](_[_0xcc15('0x54')](_0x174451['query'],_0x481385[_0xcc15('0x37')]));_0x2f00bc[_0xcc15('0x36')]['CampaignId']=_0x44a60c['id'];if(_0x174451[_0xcc15('0x2e')][_0xcc15('0x38')]){_0x2f00bc[_0xcc15('0x36')]=_['merge'](_0x2f00bc['where'],{'$or':_[_0xcc15('0x28')](_0x2f00bc[_0xcc15('0x30')],function(_0x4ae079){var _0x497f6b={};_0x497f6b[_0x4ae079]={'$like':'%'+_0x174451[_0xcc15('0x2e')][_0xcc15('0x38')]+'%'};return _0x497f6b;})});}_0x2f00bc=_[_0xcc15('0x39')]({},_0x2f00bc,_0x174451[_0xcc15('0x3b')]);return db['CmHopper'][_0xcc15('0x1b')]({'where':_0x2f00bc[_0xcc15('0x36')]})[_0xcc15('0x20')](function(_0x2f02b9){_0x534557[_0xcc15('0x1b')]=_0x2f02b9;if(_0x174451[_0xcc15('0x2e')][_0xcc15('0x3c')]){_0x2f00bc[_0xcc15('0x3d')]=[{'all':!![]}];}return db[_0xcc15('0x55')][_0xcc15('0x3e')](_0x2f00bc);})[_0xcc15('0x20')](function(_0x4f0211){_0x534557[_0xcc15('0x56')]=_0x4f0211;return _0x534557;});}})[_0xcc15('0x20')](respondWithFilteredResult(_0x2d443b,_0x2f00bc))[_0xcc15('0x3f')](handleError(_0x2d443b,null));};exports['getHopperHistories']=function(_0x5b81b9,_0x49f873,_0x14dda7){var _0x5bb6c5={'raw':!![],'where':{}};var _0x467cd6={};var _0x9777cb={'count':0x0,'rows':[]};return db['Campaign'][_0xcc15('0x52')]({'where':{'id':_0x5b81b9['params']['id']}})['then'](handleEntityNotFound(_0x49f873,null))[_0xcc15('0x20')](function(_0x58520a){if(_0x58520a){_0x467cd6[_0xcc15('0x2d')]=_['keys'](db[_0xcc15('0x57')][_0xcc15('0x2a')]);_0x467cd6['query']=_['keys'](_0x5b81b9[_0xcc15('0x2e')]);_0x467cd6[_0xcc15('0x37')]=_[_0xcc15('0x2f')](_0x467cd6[_0xcc15('0x2d')],_0x467cd6[_0xcc15('0x2e')]);_0x5bb6c5[_0xcc15('0x30')]=_['intersection'](_0x467cd6[_0xcc15('0x2d')],qs[_0xcc15('0x31')](_0x5b81b9[_0xcc15('0x2e')][_0xcc15('0x31')]));_0x5bb6c5['attributes']=_0x5bb6c5['attributes'][_0xcc15('0x32')]?_0x5bb6c5[_0xcc15('0x30')]:_0x467cd6['model'];if(!_0x5b81b9[_0xcc15('0x2e')][_0xcc15('0x33')](_0xcc15('0x53'))){_0x5bb6c5[_0xcc15('0x1a')]=qs['limit'](_0x5b81b9['query']['limit']);_0x5bb6c5[_0xcc15('0x18')]=qs[_0xcc15('0x18')](_0x5b81b9['query'][_0xcc15('0x18')]);}_0x5bb6c5[_0xcc15('0x34')]=qs[_0xcc15('0x35')](_0x5b81b9[_0xcc15('0x2e')][_0xcc15('0x35')]);_0x5bb6c5[_0xcc15('0x36')]=qs['filters'](_[_0xcc15('0x54')](_0x5b81b9['query'],_0x467cd6[_0xcc15('0x37')]));_0x5bb6c5[_0xcc15('0x36')][_0xcc15('0x58')]=_0x58520a['id'];if(_0x5b81b9[_0xcc15('0x2e')][_0xcc15('0x38')]){_0x5bb6c5[_0xcc15('0x36')]=_['merge'](_0x5bb6c5[_0xcc15('0x36')],{'$or':_[_0xcc15('0x28')](_0x5bb6c5['attributes'],function(_0x212c94){var _0x2140e6={};_0x2140e6[_0x212c94]={'$like':'%'+_0x5b81b9[_0xcc15('0x2e')]['filter']+'%'};return _0x2140e6;})});}_0x5bb6c5=_['merge']({},_0x5bb6c5,_0x5b81b9[_0xcc15('0x3b')]);return db[_0xcc15('0x57')][_0xcc15('0x1b')]({'where':_0x5bb6c5[_0xcc15('0x36')]})['then'](function(_0x2486cf){_0x9777cb[_0xcc15('0x1b')]=_0x2486cf;if(_0x5b81b9[_0xcc15('0x2e')]['includeAll']){_0x5bb6c5['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0xcc15('0x3e')](_0x5bb6c5);})['then'](function(_0x2c8bc3){_0x9777cb[_0xcc15('0x56')]=_0x2c8bc3;return _0x9777cb;});}})['then'](respondWithFilteredResult(_0x49f873,_0x5bb6c5))[_0xcc15('0x3f')](handleError(_0x49f873,null));};exports[_0xcc15('0x59')]=function(_0x12f962,_0x332cf6,_0x4dd017){var _0x175c18={'raw':!![],'where':{}};var _0x41f748={};var _0x148266={'count':0x0,'rows':[]};return db[_0xcc15('0x29')]['findOne']({'where':{'id':_0x12f962['params']['id']}})[_0xcc15('0x20')](handleEntityNotFound(_0x332cf6,null))[_0xcc15('0x20')](function(_0x4ab2b1){if(_0x4ab2b1){_0x41f748[_0xcc15('0x2d')]=_['keys'](db[_0xcc15('0x5a')][_0xcc15('0x2a')]);_0x41f748['query']=_['keys'](_0x12f962[_0xcc15('0x2e')]);_0x41f748[_0xcc15('0x37')]=_[_0xcc15('0x2f')](_0x41f748['model'],_0x41f748[_0xcc15('0x2e')]);_0x175c18[_0xcc15('0x30')]=_[_0xcc15('0x2f')](_0x41f748['model'],qs[_0xcc15('0x31')](_0x12f962[_0xcc15('0x2e')][_0xcc15('0x31')]));_0x175c18[_0xcc15('0x30')]=_0x175c18['attributes'][_0xcc15('0x32')]?_0x175c18['attributes']:_0x41f748[_0xcc15('0x2d')];if(!_0x12f962[_0xcc15('0x2e')]['hasOwnProperty'](_0xcc15('0x53'))){_0x175c18[_0xcc15('0x1a')]=qs[_0xcc15('0x1a')](_0x12f962[_0xcc15('0x2e')][_0xcc15('0x1a')]);_0x175c18[_0xcc15('0x18')]=qs['offset'](_0x12f962[_0xcc15('0x2e')][_0xcc15('0x18')]);}_0x175c18[_0xcc15('0x34')]=qs[_0xcc15('0x35')](_0x12f962[_0xcc15('0x2e')][_0xcc15('0x35')]);_0x175c18['where']=qs[_0xcc15('0x37')](_[_0xcc15('0x54')](_0x12f962['query'],_0x41f748['filters']));_0x175c18[_0xcc15('0x36')]['CampaignId']=_0x4ab2b1['id'];if(_0x12f962[_0xcc15('0x2e')]['filter']){_0x175c18[_0xcc15('0x36')]=_[_0xcc15('0x39')](_0x175c18[_0xcc15('0x36')],{'$or':_[_0xcc15('0x28')](_0x175c18['attributes'],function(_0x5c12f4){var _0x35faca={};_0x35faca[_0x5c12f4]={'$like':'%'+_0x12f962[_0xcc15('0x2e')][_0xcc15('0x38')]+'%'};return _0x35faca;})});}_0x175c18=_[_0xcc15('0x39')]({},_0x175c18,_0x12f962[_0xcc15('0x3b')]);return db[_0xcc15('0x5a')][_0xcc15('0x1b')]({'where':_0x175c18[_0xcc15('0x36')]})[_0xcc15('0x20')](function(_0x3f15ba){_0x148266['count']=_0x3f15ba;if(_0x12f962[_0xcc15('0x2e')][_0xcc15('0x3c')]){_0x175c18[_0xcc15('0x3d')]=[{'all':!![]}];}return db['CmHopperFinal'][_0xcc15('0x3e')](_0x175c18);})[_0xcc15('0x20')](function(_0x307b3b){_0x148266[_0xcc15('0x56')]=_0x307b3b;return _0x148266;});}})[_0xcc15('0x20')](respondWithFilteredResult(_0x332cf6,_0x175c18))['catch'](handleError(_0x332cf6,null));};exports[_0xcc15('0x5b')]=function(_0x3cbeb4,_0x484a12,_0x4d9c49){var _0x5e0368={'raw':!![],'where':{}};var _0x3f1e11={};var _0x262c13={'count':0x0,'rows':[]};return db[_0xcc15('0x29')][_0xcc15('0x52')]({'where':{'id':_0x3cbeb4[_0xcc15('0x41')]['id']}})[_0xcc15('0x20')](handleEntityNotFound(_0x484a12,null))['then'](function(_0x512646){if(_0x512646){_0x3f1e11[_0xcc15('0x2d')]=_[_0xcc15('0x42')](db['CmHopperBlack'][_0xcc15('0x2a')]);_0x3f1e11[_0xcc15('0x2e')]=_['keys'](_0x3cbeb4['query']);_0x3f1e11[_0xcc15('0x37')]=_['intersection'](_0x3f1e11['model'],_0x3f1e11[_0xcc15('0x2e')]);_0x5e0368[_0xcc15('0x30')]=_['intersection'](_0x3f1e11[_0xcc15('0x2d')],qs['fields'](_0x3cbeb4[_0xcc15('0x2e')]['fields']));_0x5e0368[_0xcc15('0x30')]=_0x5e0368['attributes'][_0xcc15('0x32')]?_0x5e0368['attributes']:_0x3f1e11[_0xcc15('0x2d')];if(!_0x3cbeb4[_0xcc15('0x2e')][_0xcc15('0x33')](_0xcc15('0x53'))){_0x5e0368[_0xcc15('0x1a')]=qs[_0xcc15('0x1a')](_0x3cbeb4[_0xcc15('0x2e')][_0xcc15('0x1a')]);_0x5e0368[_0xcc15('0x18')]=qs[_0xcc15('0x18')](_0x3cbeb4[_0xcc15('0x2e')]['offset']);}_0x5e0368[_0xcc15('0x34')]=qs[_0xcc15('0x35')](_0x3cbeb4[_0xcc15('0x2e')][_0xcc15('0x35')]);_0x5e0368[_0xcc15('0x36')]=qs[_0xcc15('0x37')](_[_0xcc15('0x54')](_0x3cbeb4[_0xcc15('0x2e')],_0x3f1e11[_0xcc15('0x37')]));_0x5e0368['where'][_0xcc15('0x58')]=_0x512646['id'];if(_0x3cbeb4[_0xcc15('0x2e')]['filter']){_0x5e0368[_0xcc15('0x36')]=_['merge'](_0x5e0368['where'],{'$or':_[_0xcc15('0x28')](_0x5e0368['attributes'],function(_0x5a2342){var _0x57ec7e={};_0x57ec7e[_0x5a2342]={'$like':'%'+_0x3cbeb4[_0xcc15('0x2e')][_0xcc15('0x38')]+'%'};return _0x57ec7e;})});}_0x5e0368=_[_0xcc15('0x39')]({},_0x5e0368,_0x3cbeb4[_0xcc15('0x3b')]);return db[_0xcc15('0x5c')][_0xcc15('0x1b')]({'where':_0x5e0368[_0xcc15('0x36')]})[_0xcc15('0x20')](function(_0x33a576){_0x262c13[_0xcc15('0x1b')]=_0x33a576;if(_0x3cbeb4['query'][_0xcc15('0x3c')]){_0x5e0368['include']=[{'all':!![]}];}return db[_0xcc15('0x5c')]['findAll'](_0x5e0368);})[_0xcc15('0x20')](function(_0x5096de){_0x262c13[_0xcc15('0x56')]=_0x5096de;return _0x262c13;});}})['then'](respondWithFilteredResult(_0x484a12,_0x5e0368))['catch'](handleError(_0x484a12,null));};exports[_0xcc15('0x5d')]=function(_0x460a59,_0x2d9261,_0x51a38b){var _0x31f886={};var _0x173437={};var _0x15e535;var _0x5456a2;return db[_0xcc15('0x29')][_0xcc15('0x52')]({'where':{'id':_0x460a59[_0xcc15('0x41')]['id']}})[_0xcc15('0x20')](handleEntityNotFound(_0x2d9261,null))['then'](function(_0x5f181d){if(_0x5f181d){_0x15e535=_0x5f181d;_0x173437[_0xcc15('0x2d')]=_['keys'](db[_0xcc15('0x5e')][_0xcc15('0x2a')]);_0x173437['query']=_['keys'](_0x460a59[_0xcc15('0x2e')]);_0x173437[_0xcc15('0x37')]=_[_0xcc15('0x2f')](_0x173437[_0xcc15('0x2d')],_0x173437['query']);_0x31f886[_0xcc15('0x30')]=_[_0xcc15('0x2f')](_0x173437['model'],qs[_0xcc15('0x31')](_0x460a59[_0xcc15('0x2e')][_0xcc15('0x31')]));_0x31f886['attributes']=_0x31f886['attributes']['length']?_0x31f886['attributes']:_0x173437[_0xcc15('0x2d')];_0x31f886['order']=qs['sort'](_0x460a59[_0xcc15('0x2e')]['sort']);_0x31f886[_0xcc15('0x36')]=qs['filters'](_[_0xcc15('0x54')](_0x460a59[_0xcc15('0x2e')],_0x173437[_0xcc15('0x37')]));if(_0x460a59[_0xcc15('0x2e')][_0xcc15('0x38')]){_0x31f886[_0xcc15('0x36')]=_[_0xcc15('0x39')](_0x31f886[_0xcc15('0x36')],{'$or':_[_0xcc15('0x28')](_0x31f886[_0xcc15('0x30')],function(_0x427167){var _0x165328={};_0x165328[_0x427167]={'$like':'%'+_0x460a59[_0xcc15('0x2e')][_0xcc15('0x38')]+'%'};return _0x165328;})});}_0x31f886=_[_0xcc15('0x39')]({},_0x31f886,_0x460a59[_0xcc15('0x3b')]);return _0x15e535[_0xcc15('0x5d')](_0x31f886);}})[_0xcc15('0x20')](function(_0x55bf14){if(_0x55bf14){_0x5456a2=_0x55bf14[_0xcc15('0x32')];if(!_0x460a59[_0xcc15('0x2e')][_0xcc15('0x33')](_0xcc15('0x53'))){_0x31f886[_0xcc15('0x1a')]=qs[_0xcc15('0x1a')](_0x460a59[_0xcc15('0x2e')]['limit']);_0x31f886[_0xcc15('0x18')]=qs[_0xcc15('0x18')](_0x460a59[_0xcc15('0x2e')][_0xcc15('0x18')]);}return _0x15e535[_0xcc15('0x5d')](_0x31f886);}})[_0xcc15('0x20')](function(_0x84689b){if(_0x84689b){return _0x84689b?{'count':_0x5456a2,'rows':_0x84689b}:null;}})['then'](respondWithResult(_0x2d9261,null))[_0xcc15('0x3f')](handleError(_0x2d9261,null));};exports[_0xcc15('0x5f')]=function(_0x5c7d9d,_0x30108b,_0x20f18f){var _0x26474e,_0x26959b;var _0x5ed9ec=[];var _0x3a5c37=moment()[_0xcc15('0x60')](_0xcc15('0x61'));return db[_0xcc15('0x29')][_0xcc15('0x50')]({'where':{'id':_0x5c7d9d[_0xcc15('0x41')]['id']}})['then'](handleEntityNotFound(_0x30108b,null))[_0xcc15('0x20')](function(_0x1c60fc){if(_0x1c60fc){_0x26959b=_0x1c60fc;return _0x1c60fc[_0xcc15('0x5f')](_0x5c7d9d[_0xcc15('0x44')][_0xcc15('0x62')],_[_0xcc15('0x4c')](_0x5c7d9d[_0xcc15('0x44')],['ids','id'])||{});}return null;})[_0xcc15('0x63')](function(_0x36ee8b){var _0x3d021c;var _0x4b3cd6;_0x26474e=_0x36ee8b||[];var _0x80f136=[];if(_0x36ee8b){for(var _0x122fa0=0x0;_0x122fa0<_0x36ee8b[_0xcc15('0x32')];_0x122fa0+=0x1){var _0x140902=_0x36ee8b[_0x122fa0][_0xcc15('0x46')]({'plain':!![]});_0x26959b[_0xcc15('0x64')]=_0x5c7d9d[_0xcc15('0x44')][_0xcc15('0x64')]?_0x5c7d9d[_0xcc15('0x44')][_0xcc15('0x64')]:_0x26959b['dialCheckDuplicateType'];switch(_0x26959b['dialCheckDuplicateType']){case _0xcc15('0x65'):_0x3d021c=squel[_0xcc15('0x66')]()[_0xcc15('0x67')]('cm_hopper')[_0xcc15('0x68')](['phone',_0xcc15('0x69'),'ContactId',_0xcc15('0x6a'),_0xcc15('0x58'),_0xcc15('0x4d'),_0xcc15('0x4e')],squel[_0xcc15('0x6b')]()[_0xcc15('0x6c')](_0xcc15('0x6d'),_0xcc15('0x6d'))[_0xcc15('0x6c')]('NOW()',_0xcc15('0x69'))[_0xcc15('0x6c')]('id',_0xcc15('0x6e'))[_0xcc15('0x6c')](_0x140902[_0xcc15('0x6f')][_0xcc15('0x70')](),_0xcc15('0x6a'))[_0xcc15('0x6c')](_0x5c7d9d['params']['id'][_0xcc15('0x70')](),_0xcc15('0x58'))[_0xcc15('0x6c')]('\x27'+_0x3a5c37+'\x27',_0xcc15('0x4d'))['field']('\x27'+_0x3a5c37+'\x27',_0xcc15('0x4e'))[_0xcc15('0x71')](_0xcc15('0x72'))['where'](_0xcc15('0x73'))[_0xcc15('0x36')](_0xcc15('0x74'),_0x140902[_0xcc15('0x6f')][_0xcc15('0x70')]())[_0xcc15('0x36')]('phone\x20IS\x20NOT\x20NULL')['where']('phone\x20NOT\x20IN\x20(?)',squel[_0xcc15('0x6b')]()[_0xcc15('0x6c')](_0xcc15('0x75'))['from'](_0xcc15('0x76'))['where']('CampaignId\x20=\x20?',_0x5c7d9d[_0xcc15('0x41')]['id']['toString']()))[_0xcc15('0x36')](_0xcc15('0x77'),squel['select']()[_0xcc15('0x6c')]('COALESCE(phone,\x27\x27)')[_0xcc15('0x71')](_0xcc15('0x78'))[_0xcc15('0x36')](_0xcc15('0x79'),_0x5c7d9d[_0xcc15('0x41')]['id'][_0xcc15('0x70')]())))[_0xcc15('0x70')]();break;case _0xcc15('0x7a'):_0x3d021c=squel[_0xcc15('0x66')]()[_0xcc15('0x67')](_0xcc15('0x78'))['fromQuery']([_0xcc15('0x6d'),'scheduledAt',_0xcc15('0x6e'),_0xcc15('0x6a'),_0xcc15('0x58'),_0xcc15('0x4d'),_0xcc15('0x4e')],squel[_0xcc15('0x6b')]()[_0xcc15('0x6c')](_0xcc15('0x6d'),'phone')[_0xcc15('0x6c')](_0xcc15('0x7b'),_0xcc15('0x69'))[_0xcc15('0x6c')]('id',_0xcc15('0x6e'))['field'](_0x140902[_0xcc15('0x6f')]['toString'](),_0xcc15('0x6a'))[_0xcc15('0x6c')](_0x5c7d9d[_0xcc15('0x41')]['id']['toString'](),_0xcc15('0x58'))[_0xcc15('0x6c')]('\x27'+_0x3a5c37+'\x27',_0xcc15('0x4d'))[_0xcc15('0x6c')]('\x27'+_0x3a5c37+'\x27',_0xcc15('0x4e'))[_0xcc15('0x71')]('cm_contacts')[_0xcc15('0x36')](_0xcc15('0x73'))[_0xcc15('0x36')](_0xcc15('0x74'),_0x140902[_0xcc15('0x6f')][_0xcc15('0x70')]())[_0xcc15('0x36')](_0xcc15('0x7c'))['where'](_0xcc15('0x77'),squel[_0xcc15('0x6b')]()[_0xcc15('0x6c')](_0xcc15('0x7d'))[_0xcc15('0x71')]('cm_hopper')[_0xcc15('0x36')](_0xcc15('0x79'),_0x5c7d9d[_0xcc15('0x41')]['id'][_0xcc15('0x70')]())))[_0xcc15('0x70')]();break;default:_0x3d021c=squel[_0xcc15('0x66')]()[_0xcc15('0x67')](_0xcc15('0x78'))['fromQuery']([_0xcc15('0x6d'),_0xcc15('0x69'),'ContactId',_0xcc15('0x6a'),'CampaignId','createdAt','updatedAt'],squel['select']()[_0xcc15('0x6c')](_0xcc15('0x6d'),'phone')[_0xcc15('0x6c')](_0xcc15('0x7b'),_0xcc15('0x69'))[_0xcc15('0x6c')]('id',_0xcc15('0x6e'))[_0xcc15('0x6c')](_0x140902[_0xcc15('0x6f')][_0xcc15('0x70')](),_0xcc15('0x6a'))[_0xcc15('0x6c')](_0x5c7d9d[_0xcc15('0x41')]['id'][_0xcc15('0x70')](),'CampaignId')[_0xcc15('0x6c')]('\x27'+_0x3a5c37+'\x27',_0xcc15('0x4d'))['field']('\x27'+_0x3a5c37+'\x27',_0xcc15('0x4e'))['from'](_0xcc15('0x72'))['where'](_0xcc15('0x73'))[_0xcc15('0x36')]('ListId\x20=\x20?',_0x140902[_0xcc15('0x6f')][_0xcc15('0x70')]())[_0xcc15('0x36')](_0xcc15('0x7c')))[_0xcc15('0x70')]();}_0x4b3cd6=squel[_0xcc15('0x66')]()[_0xcc15('0x67')](_0xcc15('0x7e'))['fromQuery'](['cmHopperId',_0xcc15('0x69'),_0xcc15('0x6d'),'OrderBy',_0xcc15('0x4d'),_0xcc15('0x4e')],squel['select']()['field'](_0xcc15('0x7f'),'id')[_0xcc15('0x6c')](_0xcc15('0x7b'),_0xcc15('0x69'))[_0xcc15('0x6c')](_0xcc15('0x80'),_0xcc15('0x6d'))[_0xcc15('0x6c')](_0xcc15('0x81'),_0xcc15('0x82'))[_0xcc15('0x6c')]('\x27'+_0x3a5c37+'\x27',_0xcc15('0x4d'))[_0xcc15('0x6c')]('\x27'+_0x3a5c37+'\x27',_0xcc15('0x4e'))[_0xcc15('0x71')](_0xcc15('0x83'),'ci')[_0xcc15('0x84')](_0xcc15('0x78'),'h',_0xcc15('0x85'))['where']('h.ListId\x20=\x20?',_0x140902[_0xcc15('0x6f')]['toString']())[_0xcc15('0x36')]('h.CampaignId=?',_0x5c7d9d[_0xcc15('0x41')]['id']['toString']())['where']('h.createdAt\x20=\x20?',_0x3a5c37))['toString']();_0x80f136[_0xcc15('0x86')](db[_0xcc15('0x87')][_0xcc15('0x2e')](_0x3d021c));_0x5ed9ec['push'](db[_0xcc15('0x87')][_0xcc15('0x2e')](_0x4b3cd6));}return BPromise['all'](_0x80f136);}})[_0xcc15('0x20')](function(){return BPromise[_0xcc15('0x88')](_0x5ed9ec);})['then'](function(){return _0x26474e;})[_0xcc15('0x20')](respondWithResult(_0x30108b,null))[_0xcc15('0x3f')](handleError(_0x30108b,null));};exports[_0xcc15('0x89')]=function(_0x493ca5,_0x19c6f0,_0x45485b){return db[_0xcc15('0x29')][_0xcc15('0x50')]({'where':{'id':_0x493ca5[_0xcc15('0x41')]['id']}})[_0xcc15('0x20')](handleEntityNotFound(_0x19c6f0,null))['then'](function(_0x46bacb){if(_0x46bacb){return _0x46bacb[_0xcc15('0x89')](_0x493ca5[_0xcc15('0x2e')][_0xcc15('0x62')]);}})[_0xcc15('0x20')](function(_0x568edf){if(_0x568edf){return db['CmHopper']['destroy']({'where':{'ListId':_0x493ca5[_0xcc15('0x2e')][_0xcc15('0x62')],'CampaignId':_0x493ca5[_0xcc15('0x41')]['id']}})['then'](function(){return _0x568edf;});}})['then'](respondWithStatusCode(_0x19c6f0,null))[_0xcc15('0x3f')](handleError(_0x19c6f0,null));};exports[_0xcc15('0x8a')]=function(_0x26c6bc,_0x5e5722,_0x30124e){var _0x37f655={};var _0x1e76d9={};var _0x4f63b9;var _0x49ae00;return db[_0xcc15('0x29')]['findOne']({'where':{'id':_0x26c6bc[_0xcc15('0x41')]['id']}})[_0xcc15('0x20')](handleEntityNotFound(_0x5e5722,null))[_0xcc15('0x20')](function(_0x4a3ae4){if(_0x4a3ae4){_0x4f63b9=_0x4a3ae4;_0x1e76d9[_0xcc15('0x2d')]=_['keys'](db[_0xcc15('0x5e')][_0xcc15('0x2a')]);_0x1e76d9[_0xcc15('0x2e')]=_[_0xcc15('0x42')](_0x26c6bc['query']);_0x1e76d9['filters']=_[_0xcc15('0x2f')](_0x1e76d9[_0xcc15('0x2d')],_0x1e76d9[_0xcc15('0x2e')]);_0x37f655[_0xcc15('0x30')]=_[_0xcc15('0x2f')](_0x1e76d9['model'],qs[_0xcc15('0x31')](_0x26c6bc[_0xcc15('0x2e')][_0xcc15('0x31')]));_0x37f655[_0xcc15('0x30')]=_0x37f655[_0xcc15('0x30')][_0xcc15('0x32')]?_0x37f655[_0xcc15('0x30')]:_0x1e76d9[_0xcc15('0x2d')];_0x37f655['order']=qs['sort'](_0x26c6bc[_0xcc15('0x2e')][_0xcc15('0x35')]);_0x37f655[_0xcc15('0x36')]=qs[_0xcc15('0x37')](_[_0xcc15('0x54')](_0x26c6bc['query'],_0x1e76d9[_0xcc15('0x37')]));if(_0x26c6bc[_0xcc15('0x2e')][_0xcc15('0x38')]){_0x37f655[_0xcc15('0x36')]=_['merge'](_0x37f655[_0xcc15('0x36')],{'$or':_[_0xcc15('0x28')](_0x37f655[_0xcc15('0x30')],function(_0x1ea5aa){var _0x1e553f={};_0x1e553f[_0x1ea5aa]={'$like':'%'+_0x26c6bc[_0xcc15('0x2e')][_0xcc15('0x38')]+'%'};return _0x1e553f;})});}_0x37f655=_[_0xcc15('0x39')]({},_0x37f655,_0x26c6bc[_0xcc15('0x3b')]);return _0x4f63b9[_0xcc15('0x8a')](_0x37f655);}})[_0xcc15('0x20')](function(_0x3506e3){if(_0x3506e3){_0x49ae00=_0x3506e3[_0xcc15('0x32')];if(!_0x26c6bc[_0xcc15('0x2e')]['hasOwnProperty'](_0xcc15('0x53'))){_0x37f655['limit']=qs['limit'](_0x26c6bc[_0xcc15('0x2e')][_0xcc15('0x1a')]);_0x37f655['offset']=qs['offset'](_0x26c6bc[_0xcc15('0x2e')][_0xcc15('0x18')]);}return _0x4f63b9[_0xcc15('0x8a')](_0x37f655);}})[_0xcc15('0x20')](function(_0x264633){if(_0x264633){return _0x264633?{'count':_0x49ae00,'rows':_0x264633}:null;}})['then'](respondWithResult(_0x5e5722,null))[_0xcc15('0x3f')](handleError(_0x5e5722,null));};exports['addBlackLists']=function(_0x4fb508,_0x22e435,_0x1e599c){var _0x2cfea9,_0x3adcdf;var _0x435e01=[];var _0x4523ad=moment()[_0xcc15('0x60')](_0xcc15('0x61'));return db[_0xcc15('0x29')][_0xcc15('0x50')]({'where':{'id':_0x4fb508['params']['id']}})[_0xcc15('0x20')](handleEntityNotFound(_0x22e435,null))[_0xcc15('0x20')](function(_0x5a7f6b){if(_0x5a7f6b){_0x3adcdf=_0x5a7f6b;return _0x5a7f6b[_0xcc15('0x8b')](_0x4fb508['body'][_0xcc15('0x62')],_['omit'](_0x4fb508[_0xcc15('0x44')],[_0xcc15('0x62'),'id'])||{});}return null;})[_0xcc15('0x63')](function(_0x741320){var _0x4ef5df;var _0x318fd;_0x2cfea9=_0x741320||[];var _0x652363=[];if(_0x741320){for(var _0x7241f3=0x0;_0x7241f3<_0x741320[_0xcc15('0x32')];_0x7241f3+=0x1){var _0x264034=_0x741320[_0x7241f3][_0xcc15('0x46')]({'plain':!![]});_0x4ef5df=squel[_0xcc15('0x66')]()[_0xcc15('0x67')]('cm_hopper_black')['fromQuery']([_0xcc15('0x6d'),_0xcc15('0x6e'),_0xcc15('0x6a'),_0xcc15('0x58'),'createdAt',_0xcc15('0x4e')],squel[_0xcc15('0x6b')]()[_0xcc15('0x6c')](_0xcc15('0x6d'),'phone')[_0xcc15('0x6c')]('id',_0xcc15('0x6e'))[_0xcc15('0x6c')](_0x264034['CmListId'][_0xcc15('0x70')](),'ListId')['field'](_0x4fb508[_0xcc15('0x41')]['id'][_0xcc15('0x70')](),_0xcc15('0x58'))[_0xcc15('0x6c')](_0xcc15('0x7b'),_0xcc15('0x4d'))[_0xcc15('0x6c')](_0xcc15('0x7b'),_0xcc15('0x4e'))[_0xcc15('0x71')](_0xcc15('0x72'))[_0xcc15('0x36')](_0xcc15('0x73'))[_0xcc15('0x36')]('ListId\x20=\x20?',_0x264034['CmListId'][_0xcc15('0x70')]())[_0xcc15('0x36')]('phone\x20IS\x20NOT\x20NULL'))['toString']();_0x652363[_0xcc15('0x86')](db['sequelize'][_0xcc15('0x2e')](_0x4ef5df));}return BPromise[_0xcc15('0x88')](_0x652363);}})[_0xcc15('0x20')](function(){return _0x2cfea9;})['then'](respondWithResult(_0x22e435,null))['catch'](handleError(_0x22e435,null));};exports[_0xcc15('0x8c')]=function(_0x563b06,_0x556823,_0x4bd0c4){return db[_0xcc15('0x29')]['find']({'where':{'id':_0x563b06[_0xcc15('0x41')]['id']}})[_0xcc15('0x20')](handleEntityNotFound(_0x556823,null))[_0xcc15('0x20')](function(_0x14c76a){if(_0x14c76a){return _0x14c76a[_0xcc15('0x8c')](_0x563b06[_0xcc15('0x2e')][_0xcc15('0x62')]);}})[_0xcc15('0x20')](function(_0x24f16a){if(_0x24f16a){return db[_0xcc15('0x5c')][_0xcc15('0x23')]({'where':{'ListId':_0x563b06['query']['ids'],'CampaignId':_0x563b06['params']['id']}})[_0xcc15('0x20')](function(){return _0x24f16a;});}})['then'](respondWithStatusCode(_0x556823,null))[_0xcc15('0x3f')](handleError(_0x556823,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 2b23040..53c2255 100644 --- a/server/api/campaign/campaign.model.js +++ b/server/api/campaign/campaign.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0xf2931a,_0x2d490b){var _0x45c15d=function(_0x1ef510){while(--_0x1ef510){_0xf2931a['push'](_0xf2931a['shift']());}};_0x45c15d(++_0x2d490b);}(_0x7a54,0x106));var _0x47a5=function(_0x3d41e3,_0x22741d){_0x3d41e3=_0x3d41e3-0x0;var _0x5b47bc=_0x7a54[_0x3d41e3];return _0x5b47bc;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x9dfc10,_0x19c2d5){var _0x4f938a=function(_0x12b1e5){while(--_0x12b1e5){_0x9dfc10['push'](_0x9dfc10['shift']());}};_0x4f938a(++_0x19c2d5);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','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 1fe7d21..49ab44f 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 _0xab3a=['request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','GetCampaign','Campaign','findAll','options','where','include','map','model','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xab3a,0x1d3));var _0xaab3=function(_0x1b87a6,_0x4b11a0){_0x1b87a6=_0x1b87a6-0x0;var _0x3f2b76=_0xab3a[_0x1b87a6];return _0x3f2b76;};'use strict';var _=require(_0xaab3('0x0'));var util=require(_0xaab3('0x1'));var moment=require(_0xaab3('0x2'));var BPromise=require(_0xaab3('0x3'));var rs=require(_0xaab3('0x4'));var fs=require('fs');var Redis=require(_0xaab3('0x5'));var db=require(_0xaab3('0x6'))['db'];var utils=require(_0xaab3('0x7'));var logger=require(_0xaab3('0x8'))(_0xaab3('0x9'));var config=require(_0xaab3('0xa'));var jayson=require(_0xaab3('0xb'));var client=jayson[_0xaab3('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5760e8,_0x501657,_0x1fd19f){return new BPromise(function(_0x146453,_0x21527a){return client[_0xaab3('0xd')](_0x5760e8,_0x1fd19f)[_0xaab3('0xe')](function(_0x15841e){logger[_0xaab3('0xf')](_0xaab3('0x10'),_0x501657,_0xaab3('0x11'));logger[_0xaab3('0x12')]('Campaign,\x20%s,\x20%s,\x20%s',_0x501657,'request\x20sent',JSON[_0xaab3('0x13')](_0x15841e));if(_0x15841e[_0xaab3('0x14')]){if(_0x15841e[_0xaab3('0x14')][_0xaab3('0x15')]===0x1f4){logger['error'](_0xaab3('0x10'),_0x501657,_0x15841e['error'][_0xaab3('0x16')]);return _0x21527a(_0x15841e['error'][_0xaab3('0x16')]);}logger[_0xaab3('0x14')](_0xaab3('0x10'),_0x501657,_0x15841e['error'][_0xaab3('0x16')]);return _0x146453(_0x15841e[_0xaab3('0x14')]['message']);}else{logger[_0xaab3('0xf')](_0xaab3('0x10'),_0x501657,_0xaab3('0x11'));_0x146453(_0x15841e['result']['message']);}})['catch'](function(_0x484dc5){logger[_0xaab3('0x14')](_0xaab3('0x10'),_0x501657,_0x484dc5);_0x21527a(_0x484dc5);});});}exports[_0xaab3('0x17')]=function(_0x5a3ecc){var _0x3052a5=this;return new Promise(function(_0x46aefc,_0x3a06f2){return db[_0xaab3('0x18')][_0xaab3('0x19')]({'raw':_0x5a3ecc[_0xaab3('0x1a')]?_0x5a3ecc[_0xaab3('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x5a3ecc[_0xaab3('0x1a')]?_0x5a3ecc[_0xaab3('0x1a')][_0xaab3('0x1b')]||null:null,'attributes':_0x5a3ecc[_0xaab3('0x1a')]?_0x5a3ecc[_0xaab3('0x1a')]['attributes']||null:null,'limit':_0x5a3ecc['options']?_0x5a3ecc['options']['limit']||null:null,'include':_0x5a3ecc['options']?_0x5a3ecc[_0xaab3('0x1a')][_0xaab3('0x1c')]?_[_0xaab3('0x1d')](_0x5a3ecc[_0xaab3('0x1a')][_0xaab3('0x1c')],function(_0x1816ab){return{'model':db[_0x1816ab[_0xaab3('0x1e')]],'as':_0x1816ab['as'],'attributes':_0x1816ab[_0xaab3('0x1f')],'include':_0x1816ab[_0xaab3('0x1c')]?_[_0xaab3('0x1d')](_0x1816ab[_0xaab3('0x1c')],function(_0x3097ec){return{'model':db[_0x3097ec[_0xaab3('0x1e')]],'as':_0x3097ec['as'],'attributes':_0x3097ec['attributes'],'include':_0x3097ec[_0xaab3('0x1c')]?_['map'](_0x3097ec[_0xaab3('0x1c')],function(_0x2904f8){return{'model':db[_0x2904f8['model']],'as':_0x2904f8['as'],'attributes':_0x2904f8[_0xaab3('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xaab3('0xe')](function(_0x263362){logger['info']('GetCampaign',_0x5a3ecc);logger[_0xaab3('0x12')](_0xaab3('0x17'),_0x5a3ecc,JSON[_0xaab3('0x13')](_0x263362));_0x46aefc(_0x263362);})['catch'](function(_0x168eb0){logger[_0xaab3('0x14')](_0xaab3('0x17'),_0x168eb0[_0xaab3('0x16')],_0x5a3ecc);_0x3a06f2(_0x3052a5[_0xaab3('0x14')](0x1f4,_0x168eb0[_0xaab3('0x16')]));});});}; \ No newline at end of file +var _0x76a3=['Campaign','options','raw','where','attributes','include','model','map','debug','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','Campaign,\x20%s,\x20%s','result','catch','GetCampaign'];(function(_0x25f4bb,_0x5e7fb4){var _0x7344e3=function(_0x49a220){while(--_0x49a220){_0x25f4bb['push'](_0x25f4bb['shift']());}};_0x7344e3(++_0x5e7fb4);}(_0x76a3,0xf8));var _0x376a=function(_0x386525,_0xefae6){_0x386525=_0x386525-0x0;var _0x14d015=_0x76a3[_0x386525];return _0x14d015;};'use strict';var _=require(_0x376a('0x0'));var util=require(_0x376a('0x1'));var moment=require(_0x376a('0x2'));var BPromise=require(_0x376a('0x3'));var rs=require(_0x376a('0x4'));var fs=require('fs');var Redis=require(_0x376a('0x5'));var db=require(_0x376a('0x6'))['db'];var utils=require(_0x376a('0x7'));var logger=require(_0x376a('0x8'))(_0x376a('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x376a('0xa')][_0x376a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x139dbc,_0x3cb57e,_0x548516){return new BPromise(function(_0x3e2261,_0x409960){return client[_0x376a('0xc')](_0x139dbc,_0x548516)[_0x376a('0xd')](function(_0x347b32){logger[_0x376a('0xe')]('Campaign,\x20%s,\x20%s',_0x3cb57e,'request\x20sent');logger['debug'](_0x376a('0xf'),_0x3cb57e,_0x376a('0x10'),JSON['stringify'](_0x347b32));if(_0x347b32[_0x376a('0x11')]){if(_0x347b32['error'][_0x376a('0x12')]===0x1f4){logger[_0x376a('0x11')]('Campaign,\x20%s,\x20%s',_0x3cb57e,_0x347b32[_0x376a('0x11')][_0x376a('0x13')]);return _0x409960(_0x347b32[_0x376a('0x11')]['message']);}logger[_0x376a('0x11')]('Campaign,\x20%s,\x20%s',_0x3cb57e,_0x347b32[_0x376a('0x11')][_0x376a('0x13')]);return _0x3e2261(_0x347b32[_0x376a('0x11')][_0x376a('0x13')]);}else{logger[_0x376a('0xe')](_0x376a('0x14'),_0x3cb57e,_0x376a('0x10'));_0x3e2261(_0x347b32[_0x376a('0x15')]['message']);}})[_0x376a('0x16')](function(_0xe3c5fc){logger['error'](_0x376a('0x14'),_0x3cb57e,_0xe3c5fc);_0x409960(_0xe3c5fc);});});}exports[_0x376a('0x17')]=function(_0x2dff31){var _0xa29966=this;return new Promise(function(_0x2519d4,_0x52bfea){return db[_0x376a('0x18')]['findAll']({'raw':_0x2dff31[_0x376a('0x19')]?_0x2dff31['options'][_0x376a('0x1a')]===undefined?!![]:![]:!![],'where':_0x2dff31[_0x376a('0x19')]?_0x2dff31[_0x376a('0x19')][_0x376a('0x1b')]||null:null,'attributes':_0x2dff31[_0x376a('0x19')]?_0x2dff31['options'][_0x376a('0x1c')]||null:null,'limit':_0x2dff31[_0x376a('0x19')]?_0x2dff31[_0x376a('0x19')]['limit']||null:null,'include':_0x2dff31['options']?_0x2dff31[_0x376a('0x19')][_0x376a('0x1d')]?_['map'](_0x2dff31[_0x376a('0x19')][_0x376a('0x1d')],function(_0x44b960){return{'model':db[_0x44b960[_0x376a('0x1e')]],'as':_0x44b960['as'],'attributes':_0x44b960['attributes'],'include':_0x44b960[_0x376a('0x1d')]?_[_0x376a('0x1f')](_0x44b960['include'],function(_0x1dd8ac){return{'model':db[_0x1dd8ac[_0x376a('0x1e')]],'as':_0x1dd8ac['as'],'attributes':_0x1dd8ac[_0x376a('0x1c')],'include':_0x1dd8ac[_0x376a('0x1d')]?_[_0x376a('0x1f')](_0x1dd8ac[_0x376a('0x1d')],function(_0x581c2b){return{'model':db[_0x581c2b['model']],'as':_0x581c2b['as'],'attributes':_0x581c2b['attributes']};}):[]};}):[]};}):[]:[]})[_0x376a('0xd')](function(_0x2adf9f){logger[_0x376a('0xe')](_0x376a('0x17'),_0x2dff31);logger[_0x376a('0x20')]('GetCampaign',_0x2dff31,JSON[_0x376a('0x21')](_0x2adf9f));_0x2519d4(_0x2adf9f);})[_0x376a('0x16')](function(_0x56d0b9){logger['error'](_0x376a('0x17'),_0x56d0b9[_0x376a('0x13')],_0x2dff31);_0x52bfea(_0xa29966['error'](0x1f4,_0x56d0b9[_0x376a('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index 6a65fc4..b254c66 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 _0x0bba=['../../config/environment','./campaign.controller','get','index','/:id','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','getHopperFinals','getHopperBlacks','/:id/lists','/:id/blacklists','getBlackLists','post','create','/:id/clone','addBlackLists','put','update','delete','destroy','removeLists','removeBlackLists','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x562593,_0x53e7e9){var _0x2a4117=function(_0x31d938){while(--_0x31d938){_0x562593['push'](_0x562593['shift']());}};_0x2a4117(++_0x53e7e9);}(_0x0bba,0x143));var _0xa0bb=function(_0x11d885,_0x3ba88a){_0x11d885=_0x11d885-0x0;var _0x104c6b=_0x0bba[_0x11d885];return _0x104c6b;};'use strict';var multer=require('multer');var util=require(_0xa0bb('0x0'));var path=require(_0xa0bb('0x1'));var timeout=require(_0xa0bb('0x2'));var express=require(_0xa0bb('0x3'));var router=express['Router']();var fs_extra=require(_0xa0bb('0x4'));var auth=require(_0xa0bb('0x5'));var interaction=require(_0xa0bb('0x6'));var config=require(_0xa0bb('0x7'));var controller=require(_0xa0bb('0x8'));router[_0xa0bb('0x9')]('/',auth['isAuthenticated'](),controller[_0xa0bb('0xa')]);router[_0xa0bb('0x9')](_0xa0bb('0xb'),auth[_0xa0bb('0xc')](),controller[_0xa0bb('0xd')]);router[_0xa0bb('0x9')](_0xa0bb('0xe'),auth[_0xa0bb('0xc')](),controller[_0xa0bb('0xf')]);router[_0xa0bb('0x9')](_0xa0bb('0x10'),auth[_0xa0bb('0xc')](),controller[_0xa0bb('0x11')]);router[_0xa0bb('0x9')]('/:id/hopper_finals',auth['isAuthenticated'](),controller[_0xa0bb('0x12')]);router[_0xa0bb('0x9')]('/:id/hopper_black',auth[_0xa0bb('0xc')](),controller[_0xa0bb('0x13')]);router[_0xa0bb('0x9')](_0xa0bb('0x14'),auth[_0xa0bb('0xc')](),controller['getLists']);router[_0xa0bb('0x9')](_0xa0bb('0x15'),auth['isAuthenticated'](),controller[_0xa0bb('0x16')]);router[_0xa0bb('0x17')]('/',auth[_0xa0bb('0xc')](),controller[_0xa0bb('0x18')]);router['post'](_0xa0bb('0x19'),auth[_0xa0bb('0xc')](),controller['clone']);router['post'](_0xa0bb('0x14'),auth['isAuthenticated'](),controller['addLists']);router[_0xa0bb('0x17')](_0xa0bb('0x15'),auth[_0xa0bb('0xc')](),controller[_0xa0bb('0x1a')]);router[_0xa0bb('0x1b')](_0xa0bb('0xb'),auth[_0xa0bb('0xc')](),controller[_0xa0bb('0x1c')]);router[_0xa0bb('0x1d')](_0xa0bb('0xb'),auth[_0xa0bb('0xc')](),controller[_0xa0bb('0x1e')]);router['delete'](_0xa0bb('0x14'),auth[_0xa0bb('0xc')](),controller[_0xa0bb('0x1f')]);router['delete']('/:id/blacklists',auth[_0xa0bb('0xc')](),controller[_0xa0bb('0x20')]);module['exports']=router; \ No newline at end of file +var _0xfe57=['/:id/blacklists','addBlackLists','put','update','delete','destroy','removeLists','removeBlackLists','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id','getHoppers','getHopperHistories','/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','/:id/lists','getBlackLists','post','/:id/clone','clone','addLists'];(function(_0x47568e,_0x5ccdaf){var _0x33815b=function(_0x56b026){while(--_0x56b026){_0x47568e['push'](_0x47568e['shift']());}};_0x33815b(++_0x5ccdaf);}(_0xfe57,0x195));var _0x7fe5=function(_0x3fd3a3,_0x36c863){_0x3fd3a3=_0x3fd3a3-0x0;var _0xa3e4d5=_0xfe57[_0x3fd3a3];return _0xa3e4d5;};'use strict';var multer=require(_0x7fe5('0x0'));var util=require(_0x7fe5('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x7fe5('0x2'));var router=express[_0x7fe5('0x3')]();var fs_extra=require(_0x7fe5('0x4'));var auth=require(_0x7fe5('0x5'));var interaction=require(_0x7fe5('0x6'));var config=require(_0x7fe5('0x7'));var controller=require(_0x7fe5('0x8'));router[_0x7fe5('0x9')]('/',auth[_0x7fe5('0xa')](),controller[_0x7fe5('0xb')]);router[_0x7fe5('0x9')](_0x7fe5('0xc'),auth[_0x7fe5('0xa')](),controller['show']);router[_0x7fe5('0x9')]('/:id/hoppers',auth[_0x7fe5('0xa')](),controller[_0x7fe5('0xd')]);router['get']('/:id/hopper_histories',auth[_0x7fe5('0xa')](),controller[_0x7fe5('0xe')]);router['get'](_0x7fe5('0xf'),auth['isAuthenticated'](),controller['getHopperFinals']);router[_0x7fe5('0x9')](_0x7fe5('0x10'),auth[_0x7fe5('0xa')](),controller[_0x7fe5('0x11')]);router['get'](_0x7fe5('0x12'),auth[_0x7fe5('0xa')](),controller['getLists']);router[_0x7fe5('0x9')]('/:id/blacklists',auth[_0x7fe5('0xa')](),controller[_0x7fe5('0x13')]);router['post']('/',auth[_0x7fe5('0xa')](),controller['create']);router[_0x7fe5('0x14')](_0x7fe5('0x15'),auth[_0x7fe5('0xa')](),controller[_0x7fe5('0x16')]);router[_0x7fe5('0x14')](_0x7fe5('0x12'),auth['isAuthenticated'](),controller[_0x7fe5('0x17')]);router[_0x7fe5('0x14')](_0x7fe5('0x18'),auth[_0x7fe5('0xa')](),controller[_0x7fe5('0x19')]);router[_0x7fe5('0x1a')](_0x7fe5('0xc'),auth[_0x7fe5('0xa')](),controller[_0x7fe5('0x1b')]);router[_0x7fe5('0x1c')]('/:id',auth['isAuthenticated'](),controller[_0x7fe5('0x1d')]);router[_0x7fe5('0x1c')](_0x7fe5('0x12'),auth[_0x7fe5('0xa')](),controller[_0x7fe5('0x1e')]);router[_0x7fe5('0x1c')](_0x7fe5('0x18'),auth[_0x7fe5('0xa')](),controller[_0x7fe5('0x1f')]);module[_0x7fe5('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 ebfc280..39a3c2a 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 _0x8fed=['sequelize','exports','STRING','getDataValue','key'];(function(_0x458cff,_0x28841d){var _0x4c1a33=function(_0x5e0bd3){while(--_0x5e0bd3){_0x458cff['push'](_0x458cff['shift']());}};_0x4c1a33(++_0x28841d);}(_0x8fed,0x1cc));var _0xd8fe=function(_0x2f78bd,_0x1f3651){_0x2f78bd=_0x2f78bd-0x0;var _0x284afa=_0x8fed[_0x2f78bd];return _0x284afa;};'use strict';var Sequelize=require(_0xd8fe('0x0'));module[_0xd8fe('0x1')]={'key':{'type':Sequelize[_0xd8fe('0x2')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'length':'medium','allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xd8fe('0x3')](_0xd8fe('0x4'));}}}; \ No newline at end of file +var _0x7c3b=['STRING','TEXT','medium','VIRTUAL','getDataValue','key','sequelize','exports'];(function(_0x23b662,_0x49b9fc){var _0x41486f=function(_0x347bc4){while(--_0x347bc4){_0x23b662['push'](_0x23b662['shift']());}};_0x41486f(++_0x49b9fc);}(_0x7c3b,0x156));var _0xb7c3=function(_0x3890c1,_0x41dda5){_0x3890c1=_0x3890c1-0x0;var _0x127d85=_0x7c3b[_0x3890c1];return _0x127d85;};'use strict';var Sequelize=require(_0xb7c3('0x0'));module[_0xb7c3('0x1')]={'key':{'type':Sequelize[_0xb7c3('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0xb7c3('0x3')],'length':_0xb7c3('0x4'),'allowNull':![]},'description':{'type':Sequelize[_0xb7c3('0x2')]},'name':{'type':Sequelize[_0xb7c3('0x5')],'get':function(){return this[_0xb7c3('0x6')](_0xb7c3('0x7'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index bf83b08..9be02bf 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 _0x3478=['create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','The\x20inserted\x20key\x20already\x20exists.','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','CannedAnswers','userProfileId','autoAssociation','error','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','UserProfileResource','sendStatus','stack','name','send','index','map','CannedAnswer','key','model','keys','filters','intersection','query','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','includeAll','rows','show','rawAttributes','fields','include','options','find','catch','body','params'];(function(_0x318b0e,_0x205661){var _0x1dd447=function(_0x44ae28){while(--_0x44ae28){_0x318b0e['push'](_0x318b0e['shift']());}};_0x1dd447(++_0x205661);}(_0x3478,0x170));var _0x8347=function(_0xbfa681,_0x206602){_0xbfa681=_0xbfa681-0x0;var _0x5504ce=_0x3478[_0xbfa681];return _0x5504ce;};'use strict';var emlformat=require(_0x8347('0x0'));var rimraf=require(_0x8347('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8347('0x2'));var rp=require(_0x8347('0x3'));var moment=require('moment');var BPromise=require(_0x8347('0x4'));var Mustache=require('mustache');var util=require(_0x8347('0x5'));var path=require(_0x8347('0x6'));var sox=require(_0x8347('0x7'));var csv=require('to-csv');var ejs=require(_0x8347('0x8'));var fs=require('fs');var fs_extra=require(_0x8347('0x9'));var _=require(_0x8347('0xa'));var squel=require(_0x8347('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x8347('0xc'));var toCsv=require('to-csv');var querystring=require(_0x8347('0xd'));var Papa=require(_0x8347('0xe'));var Redis=require(_0x8347('0xf'));var authService=require(_0x8347('0x10'));var qs=require(_0x8347('0x11'));var as=require(_0x8347('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8347('0x13'))(_0x8347('0x14'));var utils=require(_0x8347('0x15'));var config=require(_0x8347('0x16'));var licenseUtil=require(_0x8347('0x17'));var db=require(_0x8347('0x18'))['db'];function respondWithStatusCode(_0x1eef53,_0x4fb6d1){_0x4fb6d1=_0x4fb6d1||0xcc;return function(_0x22bccb){if(_0x22bccb){return _0x1eef53['sendStatus'](_0x4fb6d1);}return _0x1eef53[_0x8347('0x19')](_0x4fb6d1)['end']();};}function respondWithResult(_0x33b091,_0x42ed8f){_0x42ed8f=_0x42ed8f||0xc8;return function(_0xa9b5e3){if(_0xa9b5e3){return _0x33b091['status'](_0x42ed8f)[_0x8347('0x1a')](_0xa9b5e3);}};}function respondWithFilteredResult(_0x477d3f,_0x36938d){return function(_0x5a649e){if(_0x5a649e){var _0x401592=typeof _0x36938d[_0x8347('0x1b')]===_0x8347('0x1c')&&typeof _0x36938d[_0x8347('0x1d')]==='undefined';var _0x4ead22=_0x5a649e[_0x8347('0x1e')];var _0x4f9445=_0x401592?0x0:_0x36938d[_0x8347('0x1b')];var _0x381116=_0x401592?_0x5a649e['count']:_0x36938d[_0x8347('0x1b')]+_0x36938d[_0x8347('0x1d')];var _0x4ae117;if(_0x381116>=_0x4ead22){_0x381116=_0x4ead22;_0x4ae117=0xc8;}else{_0x4ae117=0xce;}_0x477d3f[_0x8347('0x19')](_0x4ae117);return _0x477d3f['set'](_0x8347('0x1f'),_0x4f9445+'-'+_0x381116+'/'+_0x4ead22)[_0x8347('0x1a')](_0x5a649e);}return null;};}function patchUpdates(_0x5e5140){return function(_0x2e45f3){try{jsonpatch[_0x8347('0x20')](_0x2e45f3,_0x5e5140,!![]);}catch(_0x51e07c){return BPromise[_0x8347('0x21')](_0x51e07c);}return _0x2e45f3[_0x8347('0x22')]();};}function saveUpdates(_0x2bc976,_0x5688aa){return function(_0x57e1df){if(_0x57e1df){return _0x57e1df[_0x8347('0x23')](_0x2bc976)[_0x8347('0x24')](function(_0x591e5f){return _0x591e5f;});}return null;};}function removeEntity(_0x4ca817,_0x2ac9d1){return function(_0x1eb750){if(_0x1eb750){return _0x1eb750[_0x8347('0x25')]()[_0x8347('0x24')](function(){var _0x39f249=_0x1eb750['get']({'plain':!![]});var _0x260e9d='CannedAnswers';return db[_0x8347('0x26')]['destroy']({'where':{'type':_0x260e9d,'resourceId':_0x39f249['id']}})[_0x8347('0x24')](function(){return _0x1eb750;});})[_0x8347('0x24')](function(){_0x4ca817[_0x8347('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0xd96a05,_0x3c4993){return function(_0x3c2300){if(!_0x3c2300){_0xd96a05[_0x8347('0x27')](0x194);}return _0x3c2300;};}function handleError(_0x4b08ff,_0x4714f3){_0x4714f3=_0x4714f3||0x1f4;return function(_0x58fde4){logger['error'](_0x58fde4[_0x8347('0x28')]);if(_0x58fde4[_0x8347('0x29')]){delete _0x58fde4['name'];}_0x4b08ff['status'](_0x4714f3)[_0x8347('0x2a')](_0x58fde4);};}exports[_0x8347('0x2b')]=function(_0x31a1d0,_0x1a4c21){var _0x4e19cf={},_0x2010ab={},_0x5e32dc={'count':0x0,'rows':[]};var _0x45623c=_[_0x8347('0x2c')](db[_0x8347('0x2d')]['rawAttributes'],function(_0xd552a4){return{'name':_0xd552a4['fieldName'],'type':_0xd552a4['type'][_0x8347('0x2e')]};});_0x2010ab[_0x8347('0x2f')]=_['map'](_0x45623c,_0x8347('0x29'));_0x2010ab['query']=_[_0x8347('0x30')](_0x31a1d0['query']);_0x2010ab[_0x8347('0x31')]=_[_0x8347('0x32')](_0x2010ab['model'],_0x2010ab[_0x8347('0x33')]);_0x4e19cf[_0x8347('0x34')]=_[_0x8347('0x32')](_0x2010ab[_0x8347('0x2f')],qs['fields'](_0x31a1d0[_0x8347('0x33')]['fields']));_0x4e19cf[_0x8347('0x34')]=_0x4e19cf['attributes'][_0x8347('0x35')]?_0x4e19cf['attributes']:_0x2010ab[_0x8347('0x2f')];if(!_0x31a1d0[_0x8347('0x33')][_0x8347('0x36')](_0x8347('0x37'))){_0x4e19cf[_0x8347('0x1d')]=qs[_0x8347('0x1d')](_0x31a1d0['query'][_0x8347('0x1d')]);_0x4e19cf[_0x8347('0x1b')]=qs[_0x8347('0x1b')](_0x31a1d0[_0x8347('0x33')][_0x8347('0x1b')]);}_0x4e19cf[_0x8347('0x38')]=qs[_0x8347('0x39')](_0x31a1d0['query'][_0x8347('0x39')]);_0x4e19cf[_0x8347('0x3a')]=qs[_0x8347('0x31')](_['pick'](_0x31a1d0[_0x8347('0x33')],_0x2010ab['filters']),_0x45623c);if(_0x31a1d0['query'][_0x8347('0x3b')]){_0x4e19cf[_0x8347('0x3a')]=_[_0x8347('0x3c')](_0x4e19cf[_0x8347('0x3a')],{'$or':[{'key':{'$like':'%'+_0x31a1d0['query'][_0x8347('0x3b')]+'%'}},{'value':{'$like':'%'+_0x31a1d0[_0x8347('0x33')][_0x8347('0x3b')]+'%'}}]});}_0x4e19cf=_['merge']({},_0x4e19cf,_0x31a1d0['options']);var _0xc28a3b={'where':_0x4e19cf[_0x8347('0x3a')]};return db['CannedAnswer'][_0x8347('0x1e')](_0xc28a3b)['then'](function(_0x27d4b5){_0x5e32dc[_0x8347('0x1e')]=_0x27d4b5;if(_0x31a1d0['query'][_0x8347('0x3d')]){_0x4e19cf['include']=[{'all':!![]}];}return db[_0x8347('0x2d')]['findAll'](_0x4e19cf);})[_0x8347('0x24')](function(_0x5dcf0c){_0x5e32dc[_0x8347('0x3e')]=_0x5dcf0c;return _0x5e32dc;})[_0x8347('0x24')](respondWithFilteredResult(_0x1a4c21,_0x4e19cf))['catch'](handleError(_0x1a4c21,null));};exports[_0x8347('0x3f')]=function(_0x1c8a98,_0xbf62b5){var _0xc11b0b={'raw':!![],'where':{'id':_0x1c8a98['params']['id']}},_0xcb9a69={};_0xcb9a69[_0x8347('0x2f')]=_['keys'](db[_0x8347('0x2d')][_0x8347('0x40')]);_0xcb9a69[_0x8347('0x33')]=_[_0x8347('0x30')](_0x1c8a98['query']);_0xcb9a69[_0x8347('0x31')]=_[_0x8347('0x32')](_0xcb9a69[_0x8347('0x2f')],_0xcb9a69[_0x8347('0x33')]);_0xc11b0b['attributes']=_[_0x8347('0x32')](_0xcb9a69[_0x8347('0x2f')],qs['fields'](_0x1c8a98[_0x8347('0x33')][_0x8347('0x41')]));_0xc11b0b['attributes']=_0xc11b0b['attributes'][_0x8347('0x35')]?_0xc11b0b[_0x8347('0x34')]:_0xcb9a69[_0x8347('0x2f')];if(_0x1c8a98['query'][_0x8347('0x3d')]){_0xc11b0b[_0x8347('0x42')]=[{'all':!![]}];}_0xc11b0b=_[_0x8347('0x3c')]({},_0xc11b0b,_0x1c8a98[_0x8347('0x43')]);return db[_0x8347('0x2d')][_0x8347('0x44')](_0xc11b0b)[_0x8347('0x24')](handleEntityNotFound(_0xbf62b5,null))['then'](respondWithResult(_0xbf62b5,null))[_0x8347('0x45')](handleError(_0xbf62b5,null));};exports['update']=function(_0x5d946f,_0x1f6ae6){if(_0x5d946f[_0x8347('0x46')]['id']){delete _0x5d946f[_0x8347('0x46')]['id'];}return db['CannedAnswer'][_0x8347('0x44')]({'where':{'id':_0x5d946f[_0x8347('0x47')]['id']}})['then'](handleEntityNotFound(_0x1f6ae6,null))[_0x8347('0x24')](saveUpdates(_0x5d946f[_0x8347('0x46')],null))['then'](respondWithResult(_0x1f6ae6,null))[_0x8347('0x45')](handleError(_0x1f6ae6,null));};exports['destroy']=function(_0x37a53d,_0x474672){return db['CannedAnswer']['find']({'where':{'id':_0x37a53d[_0x8347('0x47')]['id']}})['then'](handleEntityNotFound(_0x474672,null))[_0x8347('0x24')](removeEntity(_0x474672,null))[_0x8347('0x45')](handleError(_0x474672,null));};exports[_0x8347('0x48')]=function(_0x516811,_0x4e0e41){var _0x142d19={'key':_0x516811['body'][_0x8347('0x2e')]};if(_0x516811['body'][_0x8347('0x49')]){_0x142d19['MailAccountId']=_0x516811[_0x8347('0x46')][_0x8347('0x49')];}else if(_0x516811[_0x8347('0x46')][_0x8347('0x4a')]){_0x142d19[_0x8347('0x4a')]=_0x516811['body'][_0x8347('0x4a')];}else if(_0x516811['body']['OpenchannelAccountId']){_0x142d19[_0x8347('0x4b')]=_0x516811[_0x8347('0x46')][_0x8347('0x4b')];}else if(_0x516811['body'][_0x8347('0x4c')]){_0x142d19[_0x8347('0x4c')]=_0x516811[_0x8347('0x46')][_0x8347('0x4c')];}return db[_0x8347('0x2d')]['find']({'where':_0x142d19})[_0x8347('0x24')](function(_0x517351){if(_0x517351){throw new db[(_0x8347('0x4d'))]['ValidationError'](_0x8347('0x4e'));}return db[_0x8347('0x2d')][_0x8347('0x48')](_0x516811[_0x8347('0x46')]);})[_0x8347('0x24')](function(_0x5776e0){var _0x18c712=_0x516811[_0x8347('0x4f')][_0x8347('0x50')]({'plain':!![]});if(!_0x18c712)throw new Error(_0x8347('0x51'));if(_0x18c712[_0x8347('0x52')]===_0x8347('0x4f')){var _0x1bb4d4=_0x5776e0['get']({'plain':!![]});return db[_0x8347('0x53')][_0x8347('0x44')]({'where':{'name':_0x8347('0x54'),'userProfileId':_0x18c712[_0x8347('0x55')]},'raw':!![]})[_0x8347('0x24')](function(_0x5ce8f5){if(_0x5ce8f5&&_0x5ce8f5[_0x8347('0x56')]===0x0){return db['UserProfileResource'][_0x8347('0x48')]({'name':_0x1bb4d4[_0x8347('0x29')],'resourceId':_0x1bb4d4['id'],'type':_0x5ce8f5[_0x8347('0x29')],'sectionId':_0x5ce8f5['id']},{})['then'](function(){return _0x5776e0;});}else{return _0x5776e0;}})[_0x8347('0x45')](function(_0x212e2e){logger[_0x8347('0x57')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x212e2e);throw _0x212e2e;});}return _0x5776e0;})[_0x8347('0x24')](respondWithResult(_0x4e0e41,0xc9))[_0x8347('0x45')](handleError(_0x4e0e41,null));}; \ No newline at end of file +var _0x020e=['filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','CannedAnswer','includeAll','include','findAll','catch','show','params','rawAttributes','body','find','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','CannedAnswers','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','end','status','offset','limit','undefined','count','set','Content-Range','json','reject','save','update','then','destroy','get','UserProfileResource','sendStatus','error','stack','name','send','map','fieldName','type','key','query','keys'];(function(_0x512e26,_0x50cf31){var _0x74d652=function(_0x175233){while(--_0x175233){_0x512e26['push'](_0x512e26['shift']());}};_0x74d652(++_0x50cf31);}(_0x020e,0x137));var _0xe020=function(_0x374d62,_0x5056f3){_0x374d62=_0x374d62-0x0;var _0x110c60=_0x020e[_0x374d62];return _0x110c60;};'use strict';var emlformat=require(_0xe020('0x0'));var rimraf=require(_0xe020('0x1'));var zipdir=require(_0xe020('0x2'));var jsonpatch=require(_0xe020('0x3'));var rp=require('request-promise');var moment=require(_0xe020('0x4'));var BPromise=require(_0xe020('0x5'));var Mustache=require('mustache');var util=require(_0xe020('0x6'));var path=require(_0xe020('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xe020('0x8'));var fs=require('fs');var fs_extra=require(_0xe020('0x9'));var _=require(_0xe020('0xa'));var squel=require(_0xe020('0xb'));var crypto=require(_0xe020('0xc'));var jsforce=require(_0xe020('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xe020('0xe'));var querystring=require(_0xe020('0xf'));var Papa=require(_0xe020('0x10'));var Redis=require(_0xe020('0x11'));var authService=require(_0xe020('0x12'));var qs=require(_0xe020('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe020('0x14'));var logger=require(_0xe020('0x15'))(_0xe020('0x16'));var utils=require('../../config/utils');var config=require(_0xe020('0x17'));var licenseUtil=require(_0xe020('0x18'));var db=require(_0xe020('0x19'))['db'];function respondWithStatusCode(_0x15f031,_0x3a6f91){_0x3a6f91=_0x3a6f91||0xcc;return function(_0x353a3d){if(_0x353a3d){return _0x15f031['sendStatus'](_0x3a6f91);}return _0x15f031['status'](_0x3a6f91)[_0xe020('0x1a')]();};}function respondWithResult(_0x42634d,_0x1b1d8a){_0x1b1d8a=_0x1b1d8a||0xc8;return function(_0xeed51d){if(_0xeed51d){return _0x42634d[_0xe020('0x1b')](_0x1b1d8a)['json'](_0xeed51d);}};}function respondWithFilteredResult(_0x4b6ce9,_0x34453c){return function(_0x18e3d5){if(_0x18e3d5){var _0x3755c4=typeof _0x34453c[_0xe020('0x1c')]==='undefined'&&typeof _0x34453c[_0xe020('0x1d')]===_0xe020('0x1e');var _0x3cc6f1=_0x18e3d5[_0xe020('0x1f')];var _0x3d293b=_0x3755c4?0x0:_0x34453c[_0xe020('0x1c')];var _0x38e597=_0x3755c4?_0x18e3d5[_0xe020('0x1f')]:_0x34453c[_0xe020('0x1c')]+_0x34453c[_0xe020('0x1d')];var _0x1c1f42;if(_0x38e597>=_0x3cc6f1){_0x38e597=_0x3cc6f1;_0x1c1f42=0xc8;}else{_0x1c1f42=0xce;}_0x4b6ce9[_0xe020('0x1b')](_0x1c1f42);return _0x4b6ce9[_0xe020('0x20')](_0xe020('0x21'),_0x3d293b+'-'+_0x38e597+'/'+_0x3cc6f1)[_0xe020('0x22')](_0x18e3d5);}return null;};}function patchUpdates(_0x3f8e60){return function(_0x5ad90e){try{jsonpatch['apply'](_0x5ad90e,_0x3f8e60,!![]);}catch(_0x3df419){return BPromise[_0xe020('0x23')](_0x3df419);}return _0x5ad90e[_0xe020('0x24')]();};}function saveUpdates(_0x5c6e46,_0x1bcebe){return function(_0x22446a){if(_0x22446a){return _0x22446a[_0xe020('0x25')](_0x5c6e46)[_0xe020('0x26')](function(_0x2bb883){return _0x2bb883;});}return null;};}function removeEntity(_0x1690b0,_0x1197de){return function(_0xbf1e48){if(_0xbf1e48){return _0xbf1e48[_0xe020('0x27')]()[_0xe020('0x26')](function(){var _0x5a3229=_0xbf1e48[_0xe020('0x28')]({'plain':!![]});var _0x1d7763='CannedAnswers';return db[_0xe020('0x29')]['destroy']({'where':{'type':_0x1d7763,'resourceId':_0x5a3229['id']}})['then'](function(){return _0xbf1e48;});})['then'](function(){_0x1690b0['status'](0xcc)[_0xe020('0x1a')]();});}};}function handleEntityNotFound(_0x5d87bd,_0x36c92f){return function(_0x5b6222){if(!_0x5b6222){_0x5d87bd[_0xe020('0x2a')](0x194);}return _0x5b6222;};}function handleError(_0x560475,_0x25d2e7){_0x25d2e7=_0x25d2e7||0x1f4;return function(_0x56284c){logger[_0xe020('0x2b')](_0x56284c[_0xe020('0x2c')]);if(_0x56284c['name']){delete _0x56284c[_0xe020('0x2d')];}_0x560475[_0xe020('0x1b')](_0x25d2e7)[_0xe020('0x2e')](_0x56284c);};}exports['index']=function(_0x2ec0f2,_0x2eeeae){var _0x1a1599={},_0xee6a4a={},_0x252172={'count':0x0,'rows':[]};var _0x4d3d56=_[_0xe020('0x2f')](db['CannedAnswer']['rawAttributes'],function(_0x335c41){return{'name':_0x335c41[_0xe020('0x30')],'type':_0x335c41[_0xe020('0x31')][_0xe020('0x32')]};});_0xee6a4a['model']=_['map'](_0x4d3d56,'name');_0xee6a4a[_0xe020('0x33')]=_[_0xe020('0x34')](_0x2ec0f2[_0xe020('0x33')]);_0xee6a4a[_0xe020('0x35')]=_[_0xe020('0x36')](_0xee6a4a[_0xe020('0x37')],_0xee6a4a[_0xe020('0x33')]);_0x1a1599[_0xe020('0x38')]=_[_0xe020('0x36')](_0xee6a4a[_0xe020('0x37')],qs[_0xe020('0x39')](_0x2ec0f2['query'][_0xe020('0x39')]));_0x1a1599[_0xe020('0x38')]=_0x1a1599[_0xe020('0x38')][_0xe020('0x3a')]?_0x1a1599[_0xe020('0x38')]:_0xee6a4a[_0xe020('0x37')];if(!_0x2ec0f2[_0xe020('0x33')]['hasOwnProperty'](_0xe020('0x3b'))){_0x1a1599[_0xe020('0x1d')]=qs[_0xe020('0x1d')](_0x2ec0f2[_0xe020('0x33')][_0xe020('0x1d')]);_0x1a1599[_0xe020('0x1c')]=qs['offset'](_0x2ec0f2['query'][_0xe020('0x1c')]);}_0x1a1599[_0xe020('0x3c')]=qs[_0xe020('0x3d')](_0x2ec0f2[_0xe020('0x33')][_0xe020('0x3d')]);_0x1a1599[_0xe020('0x3e')]=qs[_0xe020('0x35')](_[_0xe020('0x3f')](_0x2ec0f2[_0xe020('0x33')],_0xee6a4a[_0xe020('0x35')]),_0x4d3d56);if(_0x2ec0f2[_0xe020('0x33')][_0xe020('0x40')]){_0x1a1599[_0xe020('0x3e')]=_['merge'](_0x1a1599[_0xe020('0x3e')],{'$or':[{'key':{'$like':'%'+_0x2ec0f2[_0xe020('0x33')][_0xe020('0x40')]+'%'}},{'value':{'$like':'%'+_0x2ec0f2['query'][_0xe020('0x40')]+'%'}}]});}_0x1a1599=_[_0xe020('0x41')]({},_0x1a1599,_0x2ec0f2[_0xe020('0x42')]);var _0x587c2f={'where':_0x1a1599[_0xe020('0x3e')]};return db[_0xe020('0x43')][_0xe020('0x1f')](_0x587c2f)[_0xe020('0x26')](function(_0x523883){_0x252172[_0xe020('0x1f')]=_0x523883;if(_0x2ec0f2[_0xe020('0x33')][_0xe020('0x44')]){_0x1a1599[_0xe020('0x45')]=[{'all':!![]}];}return db[_0xe020('0x43')][_0xe020('0x46')](_0x1a1599);})[_0xe020('0x26')](function(_0x363d1e){_0x252172['rows']=_0x363d1e;return _0x252172;})[_0xe020('0x26')](respondWithFilteredResult(_0x2eeeae,_0x1a1599))[_0xe020('0x47')](handleError(_0x2eeeae,null));};exports[_0xe020('0x48')]=function(_0x153ca3,_0x261e57){var _0x101d47={'raw':!![],'where':{'id':_0x153ca3[_0xe020('0x49')]['id']}},_0x59e33c={};_0x59e33c[_0xe020('0x37')]=_['keys'](db[_0xe020('0x43')][_0xe020('0x4a')]);_0x59e33c[_0xe020('0x33')]=_[_0xe020('0x34')](_0x153ca3[_0xe020('0x33')]);_0x59e33c[_0xe020('0x35')]=_[_0xe020('0x36')](_0x59e33c['model'],_0x59e33c['query']);_0x101d47[_0xe020('0x38')]=_[_0xe020('0x36')](_0x59e33c['model'],qs[_0xe020('0x39')](_0x153ca3[_0xe020('0x33')][_0xe020('0x39')]));_0x101d47['attributes']=_0x101d47[_0xe020('0x38')][_0xe020('0x3a')]?_0x101d47[_0xe020('0x38')]:_0x59e33c['model'];if(_0x153ca3[_0xe020('0x33')][_0xe020('0x44')]){_0x101d47[_0xe020('0x45')]=[{'all':!![]}];}_0x101d47=_[_0xe020('0x41')]({},_0x101d47,_0x153ca3['options']);return db['CannedAnswer']['find'](_0x101d47)['then'](handleEntityNotFound(_0x261e57,null))[_0xe020('0x26')](respondWithResult(_0x261e57,null))[_0xe020('0x47')](handleError(_0x261e57,null));};exports[_0xe020('0x25')]=function(_0x1c4d48,_0x292e95){if(_0x1c4d48[_0xe020('0x4b')]['id']){delete _0x1c4d48['body']['id'];}return db[_0xe020('0x43')][_0xe020('0x4c')]({'where':{'id':_0x1c4d48[_0xe020('0x49')]['id']}})[_0xe020('0x26')](handleEntityNotFound(_0x292e95,null))[_0xe020('0x26')](saveUpdates(_0x1c4d48[_0xe020('0x4b')],null))[_0xe020('0x26')](respondWithResult(_0x292e95,null))[_0xe020('0x47')](handleError(_0x292e95,null));};exports[_0xe020('0x27')]=function(_0x32d209,_0x2effd7){return db[_0xe020('0x43')]['find']({'where':{'id':_0x32d209[_0xe020('0x49')]['id']}})[_0xe020('0x26')](handleEntityNotFound(_0x2effd7,null))[_0xe020('0x26')](removeEntity(_0x2effd7,null))[_0xe020('0x47')](handleError(_0x2effd7,null));};exports[_0xe020('0x4d')]=function(_0x352971,_0x5b6e0e){var _0x301add={'key':_0x352971[_0xe020('0x4b')][_0xe020('0x32')]};if(_0x352971['body'][_0xe020('0x4e')]){_0x301add[_0xe020('0x4e')]=_0x352971[_0xe020('0x4b')][_0xe020('0x4e')];}else if(_0x352971[_0xe020('0x4b')][_0xe020('0x4f')]){_0x301add[_0xe020('0x4f')]=_0x352971[_0xe020('0x4b')][_0xe020('0x4f')];}else if(_0x352971['body'][_0xe020('0x50')]){_0x301add[_0xe020('0x50')]=_0x352971[_0xe020('0x4b')][_0xe020('0x50')];}else if(_0x352971[_0xe020('0x4b')][_0xe020('0x51')]){_0x301add[_0xe020('0x51')]=_0x352971['body']['ChatWebsiteId'];}return db['CannedAnswer'][_0xe020('0x4c')]({'where':_0x301add})[_0xe020('0x26')](function(_0x48baf3){if(_0x48baf3){throw new db[(_0xe020('0x52'))]['ValidationError'](_0xe020('0x53'));}return db['CannedAnswer'][_0xe020('0x4d')](_0x352971[_0xe020('0x4b')]);})[_0xe020('0x26')](function(_0x19a52e){var _0x14990d=_0x352971[_0xe020('0x54')][_0xe020('0x28')]({'plain':!![]});if(!_0x14990d)throw new Error(_0xe020('0x55'));if(_0x14990d[_0xe020('0x56')]===_0xe020('0x54')){var _0xe3b6e9=_0x19a52e[_0xe020('0x28')]({'plain':!![]});return db[_0xe020('0x57')][_0xe020('0x4c')]({'where':{'name':_0xe020('0x58'),'userProfileId':_0x14990d['userProfileId']},'raw':!![]})['then'](function(_0x5fc108){if(_0x5fc108&&_0x5fc108[_0xe020('0x59')]===0x0){return db['UserProfileResource']['create']({'name':_0xe3b6e9[_0xe020('0x2d')],'resourceId':_0xe3b6e9['id'],'type':_0x5fc108['name'],'sectionId':_0x5fc108['id']},{})[_0xe020('0x26')](function(){return _0x19a52e;});}else{return _0x19a52e;}})[_0xe020('0x47')](function(_0x31ca6f){logger[_0xe020('0x2b')](_0xe020('0x5a'),_0x31ca6f);throw _0x31ca6f;});}return _0x19a52e;})[_0xe020('0x26')](respondWithResult(_0x5b6e0e,0xc9))[_0xe020('0x47')](handleError(_0x5b6e0e,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 717fd73..3f27aff 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 _0x9656=['api','bluebird','../../config/environment','exports','CannedAnswer','tools_canned_answers','lodash','../../config/logger'];(function(_0x5ecadc,_0x1cf9f1){var _0x565037=function(_0x22908b){while(--_0x22908b){_0x5ecadc['push'](_0x5ecadc['shift']());}};_0x565037(++_0x1cf9f1);}(_0x9656,0x15e));var _0x6965=function(_0x59086a,_0x7db88f){_0x59086a=_0x59086a-0x0;var _0x166f2b=_0x9656[_0x59086a];return _0x166f2b;};'use strict';var _=require(_0x6965('0x0'));var util=require('util');var logger=require(_0x6965('0x1'))(_0x6965('0x2'));var moment=require('moment');var BPromise=require(_0x6965('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6965('0x4'));var attributes=require('./cannedAnswer.attributes');module[_0x6965('0x5')]=function(_0x563cc2,_0xc5e807){return _0x563cc2['define'](_0x6965('0x6'),attributes,{'tableName':_0x6965('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xc961=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','../../config/environment','exports','define','CannedAnswer','tools_canned_answers','utf8mb4'];(function(_0x354ddf,_0x4f46e7){var _0x488586=function(_0x3cf597){while(--_0x3cf597){_0x354ddf['push'](_0x354ddf['shift']());}};_0x488586(++_0x4f46e7);}(_0xc961,0x17a));var _0x1c96=function(_0x1cffe2,_0x5383e8){_0x1cffe2=_0x1cffe2-0x0;var _0x57030e=_0xc961[_0x1cffe2];return _0x57030e;};'use strict';var _=require(_0x1c96('0x0'));var util=require(_0x1c96('0x1'));var logger=require(_0x1c96('0x2'))(_0x1c96('0x3'));var moment=require(_0x1c96('0x4'));var BPromise=require(_0x1c96('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1c96('0x6'));var attributes=require('./cannedAnswer.attributes');module[_0x1c96('0x7')]=function(_0x5594ee,_0x19d78b){return _0x5594ee[_0x1c96('0x8')](_0x1c96('0x9'),attributes,{'tableName':_0x1c96('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1c96('0xb'),'collate':_0x1c96('0xc')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index 749a35d..bbe0c41 100644 --- a/server/api/cannedAnswer/cannedAnswer.rpc.js +++ b/server/api/cannedAnswer/cannedAnswer.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['http','info','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x10e6ae,_0x4ef3e5){var _0x4233e4=function(_0xcf9679){while(--_0xcf9679){_0x10e6ae['push'](_0x10e6ae['shift']());}};_0x4233e4(++_0x4ef3e5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa9e0[_0x5b561d];return _0x431060;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file +var _0xa9e0=['http','info','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x5852b0,_0x2016a0){var _0x325f43=function(_0x2c3ab2){while(--_0x2c3ab2){_0x5852b0['push'](_0x5852b0['shift']());}};_0x325f43(++_0x2016a0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xa9e0[_0x38a7ac];return _0x53061a;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js index ccefd61..8c5b576 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 _0xb3b1=['/:id','delete','destroy','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','show','post','create','put'];(function(_0x342700,_0x569f75){var _0x53406f=function(_0x3b3c32){while(--_0x3b3c32){_0x342700['push'](_0x342700['shift']());}};_0x53406f(++_0x569f75);}(_0xb3b1,0x1d8));var _0x1b3b=function(_0x4f0589,_0x52073b){_0x4f0589=_0x4f0589-0x0;var _0x3c9d6e=_0xb3b1[_0x4f0589];return _0x3c9d6e;};'use strict';var multer=require(_0x1b3b('0x0'));var util=require('util');var path=require(_0x1b3b('0x1'));var timeout=require(_0x1b3b('0x2'));var express=require('express');var router=express[_0x1b3b('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1b3b('0x4'));var interaction=require(_0x1b3b('0x5'));var config=require(_0x1b3b('0x6'));var controller=require('./cannedAnswer.controller');router[_0x1b3b('0x7')]('/',auth['isAuthenticated'](),controller[_0x1b3b('0x8')]);router[_0x1b3b('0x7')]('/:id',auth[_0x1b3b('0x9')](),controller[_0x1b3b('0xa')]);router[_0x1b3b('0xb')]('/',auth[_0x1b3b('0x9')](),controller[_0x1b3b('0xc')]);router[_0x1b3b('0xd')](_0x1b3b('0xe'),auth['isAuthenticated'](),controller['update']);router[_0x1b3b('0xf')](_0x1b3b('0xe'),auth[_0x1b3b('0x9')](),controller[_0x1b3b('0x10')]);module[_0x1b3b('0x11')]=router; \ No newline at end of file +var _0x3993=['path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','/:id','show','post','create','put','exports','multer'];(function(_0x28ad97,_0x488ddd){var _0x209ff6=function(_0x1cb0b6){while(--_0x1cb0b6){_0x28ad97['push'](_0x28ad97['shift']());}};_0x209ff6(++_0x488ddd);}(_0x3993,0x6f));var _0x3399=function(_0x5876aa,_0x4b790d){_0x5876aa=_0x5876aa-0x0;var _0x3017f3=_0x3993[_0x5876aa];return _0x3017f3;};'use strict';var multer=require(_0x3399('0x0'));var util=require('util');var path=require(_0x3399('0x1'));var timeout=require(_0x3399('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x3399('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x3399('0x4'));var config=require(_0x3399('0x5'));var controller=require(_0x3399('0x6'));router[_0x3399('0x7')]('/',auth[_0x3399('0x8')](),controller[_0x3399('0x9')]);router[_0x3399('0x7')](_0x3399('0xa'),auth[_0x3399('0x8')](),controller[_0x3399('0xb')]);router[_0x3399('0xc')]('/',auth[_0x3399('0x8')](),controller[_0x3399('0xd')]);router[_0x3399('0xe')](_0x3399('0xa'),auth[_0x3399('0x8')](),controller['update']);router['delete'](_0x3399('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x3399('0xf')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index a97a2c0..19d048a 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 _0x2d58=['sequelize','exports','DATE','STRING','INTEGER'];(function(_0x3fbeb7,_0x316335){var _0x4dcb89=function(_0xff351f){while(--_0xff351f){_0x3fbeb7['push'](_0x3fbeb7['shift']());}};_0x4dcb89(++_0x316335);}(_0x2d58,0x186));var _0x82d5=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x2d58[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x82d5('0x0'));module[_0x82d5('0x1')]={'calldate':{'type':Sequelize[_0x82d5('0x2')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0x82d5('0x3')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0x82d5('0x3')]},'dcontext':{'type':Sequelize[_0x82d5('0x3')]},'channel':{'type':Sequelize[_0x82d5('0x3')]},'dstchannel':{'type':Sequelize[_0x82d5('0x3')]},'lastapp':{'type':Sequelize[_0x82d5('0x3')]},'lastdata':{'type':Sequelize[_0x82d5('0x3')]},'duration':{'type':Sequelize[_0x82d5('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x82d5('0x3')]},'amaflags':{'type':Sequelize[_0x82d5('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x82d5('0x3')]},'userfield':{'type':Sequelize[_0x82d5('0x3')]},'uniqueid':{'type':Sequelize[_0x82d5('0x3')]},'linkedid':{'type':Sequelize[_0x82d5('0x3')]},'sequence':{'type':Sequelize[_0x82d5('0x3')]},'peeraccount':{'type':Sequelize[_0x82d5('0x3')]},'type':{'type':Sequelize[_0x82d5('0x3')]},'tag':{'type':Sequelize[_0x82d5('0x3')]}}; \ No newline at end of file +var _0xa902=['1970-01-01\x2000:00:01','STRING','INTEGER','sequelize','exports','DATE'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa902,0x8d));var _0x2a90=function(_0xd576a0,_0x36cc02){_0xd576a0=_0xd576a0-0x0;var _0x3ff77c=_0xa902[_0xd576a0];return _0x3ff77c;};'use strict';var Sequelize=require(_0x2a90('0x0'));module[_0x2a90('0x1')]={'calldate':{'type':Sequelize[_0x2a90('0x2')],'allowNull':![],'defaultValue':_0x2a90('0x3')},'clid':{'type':Sequelize[_0x2a90('0x4')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0x2a90('0x4')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0x2a90('0x4')]},'lastapp':{'type':Sequelize[_0x2a90('0x4')]},'lastdata':{'type':Sequelize[_0x2a90('0x4')]},'duration':{'type':Sequelize[_0x2a90('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x2a90('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x2a90('0x4')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x2a90('0x4')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x2a90('0x4')]},'sequence':{'type':Sequelize[_0x2a90('0x4')]},'peeraccount':{'type':Sequelize[_0x2a90('0x4')]},'type':{'type':Sequelize[_0x2a90('0x4')]},'tag':{'type':Sequelize[_0x2a90('0x4')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index ed75840..caab562 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 _0x5ad3=['destroy','error','stack','name','index','map','rawAttributes','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','type','VIRTUAL','merge','options','Cdr','includeAll','include','findAll','rows','show','params','keys','catch','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','status','end','offset','undefined','count','limit','set','Content-Range','reject','save','update','then'];(function(_0x53d38e,_0x5731b6){var _0x3d304f=function(_0x2bfaeb){while(--_0x2bfaeb){_0x53d38e['push'](_0x53d38e['shift']());}};_0x3d304f(++_0x5731b6);}(_0x5ad3,0x1e2));var _0x35ad=function(_0x59162a,_0x10e547){_0x59162a=_0x59162a-0x0;var _0x35e50d=_0x5ad3[_0x59162a];return _0x35e50d;};'use strict';var emlformat=require(_0x35ad('0x0'));var rimraf=require(_0x35ad('0x1'));var zipdir=require(_0x35ad('0x2'));var jsonpatch=require(_0x35ad('0x3'));var rp=require('request-promise');var moment=require(_0x35ad('0x4'));var BPromise=require(_0x35ad('0x5'));var Mustache=require(_0x35ad('0x6'));var util=require(_0x35ad('0x7'));var path=require(_0x35ad('0x8'));var sox=require(_0x35ad('0x9'));var csv=require(_0x35ad('0xa'));var ejs=require(_0x35ad('0xb'));var fs=require('fs');var fs_extra=require(_0x35ad('0xc'));var _=require(_0x35ad('0xd'));var squel=require('squel');var crypto=require(_0x35ad('0xe'));var jsforce=require(_0x35ad('0xf'));var deskjs=require(_0x35ad('0x10'));var toCsv=require('to-csv');var querystring=require(_0x35ad('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x35ad('0x12'));var qs=require(_0x35ad('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x35ad('0x14'));var logger=require(_0x35ad('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x35ad('0x16'));var licenseUtil=require(_0x35ad('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3c4dd5,_0x33e2ec){_0x33e2ec=_0x33e2ec||0xcc;return function(_0x595fe8){if(_0x595fe8){return _0x3c4dd5['sendStatus'](_0x33e2ec);}return _0x3c4dd5[_0x35ad('0x18')](_0x33e2ec)[_0x35ad('0x19')]();};}function respondWithResult(_0x3cda5e,_0x4b7ad9){_0x4b7ad9=_0x4b7ad9||0xc8;return function(_0x3e2676){if(_0x3e2676){return _0x3cda5e[_0x35ad('0x18')](_0x4b7ad9)['json'](_0x3e2676);}};}function respondWithFilteredResult(_0x1494be,_0x4d5185){return function(_0x4e3cd8){if(_0x4e3cd8){var _0x3a981a=typeof _0x4d5185[_0x35ad('0x1a')]===_0x35ad('0x1b')&&typeof _0x4d5185['limit']===_0x35ad('0x1b');var _0x2f3f27=_0x4e3cd8[_0x35ad('0x1c')];var _0x3158a1=_0x3a981a?0x0:_0x4d5185[_0x35ad('0x1a')];var _0x418416=_0x3a981a?_0x4e3cd8['count']:_0x4d5185[_0x35ad('0x1a')]+_0x4d5185[_0x35ad('0x1d')];var _0x574557;if(_0x418416>=_0x2f3f27){_0x418416=_0x2f3f27;_0x574557=0xc8;}else{_0x574557=0xce;}_0x1494be['status'](_0x574557);return _0x1494be[_0x35ad('0x1e')](_0x35ad('0x1f'),_0x3158a1+'-'+_0x418416+'/'+_0x2f3f27)['json'](_0x4e3cd8);}return null;};}function patchUpdates(_0x21f611){return function(_0x32735e){try{jsonpatch['apply'](_0x32735e,_0x21f611,!![]);}catch(_0x37c03d){return BPromise[_0x35ad('0x20')](_0x37c03d);}return _0x32735e[_0x35ad('0x21')]();};}function saveUpdates(_0x30542c,_0x1be6d2){return function(_0x43a6a8){if(_0x43a6a8){return _0x43a6a8[_0x35ad('0x22')](_0x30542c)[_0x35ad('0x23')](function(_0x2fb296){return _0x2fb296;});}return null;};}function removeEntity(_0xebc6c5,_0x4c5740){return function(_0x1cb9da){if(_0x1cb9da){return _0x1cb9da[_0x35ad('0x24')]()['then'](function(){_0xebc6c5[_0x35ad('0x18')](0xcc)[_0x35ad('0x19')]();});}};}function handleEntityNotFound(_0xa3cb9f,_0xfc80ac){return function(_0x368468){if(!_0x368468){_0xa3cb9f['sendStatus'](0x194);}return _0x368468;};}function handleError(_0x37e9bd,_0x226167){_0x226167=_0x226167||0x1f4;return function(_0x3dc3c4){logger[_0x35ad('0x25')](_0x3dc3c4[_0x35ad('0x26')]);if(_0x3dc3c4[_0x35ad('0x27')]){delete _0x3dc3c4[_0x35ad('0x27')];}_0x37e9bd[_0x35ad('0x18')](_0x226167)['send'](_0x3dc3c4);};}exports[_0x35ad('0x28')]=function(_0x11da54,_0x2f8b3){var _0x34b8b9={},_0x2c82f1={},_0x481803={'count':0x0,'rows':[]};var _0x571ad6=_[_0x35ad('0x29')](db['Cdr'][_0x35ad('0x2a')],function(_0x4ccaea){return{'name':_0x4ccaea['fieldName'],'type':_0x4ccaea['type']['key']};});_0x2c82f1[_0x35ad('0x2b')]=_['map'](_0x571ad6,'name');_0x2c82f1[_0x35ad('0x2c')]=_['keys'](_0x11da54[_0x35ad('0x2c')]);_0x2c82f1['filters']=_[_0x35ad('0x2d')](_0x2c82f1['model'],_0x2c82f1[_0x35ad('0x2c')]);_0x34b8b9['attributes']=_[_0x35ad('0x2d')](_0x2c82f1[_0x35ad('0x2b')],qs[_0x35ad('0x2e')](_0x11da54['query'][_0x35ad('0x2e')]));_0x34b8b9[_0x35ad('0x2f')]=_0x34b8b9[_0x35ad('0x2f')][_0x35ad('0x30')]?_0x34b8b9[_0x35ad('0x2f')]:_0x2c82f1['model'];if(!_0x11da54['query'][_0x35ad('0x31')](_0x35ad('0x32'))){_0x34b8b9[_0x35ad('0x1d')]=qs[_0x35ad('0x1d')](_0x11da54['query'][_0x35ad('0x1d')]);_0x34b8b9[_0x35ad('0x1a')]=qs[_0x35ad('0x1a')](_0x11da54[_0x35ad('0x2c')][_0x35ad('0x1a')]);}_0x34b8b9[_0x35ad('0x33')]=qs['sort'](_0x11da54['query'][_0x35ad('0x34')]);_0x34b8b9[_0x35ad('0x35')]=qs[_0x35ad('0x36')](_[_0x35ad('0x37')](_0x11da54[_0x35ad('0x2c')],_0x2c82f1[_0x35ad('0x36')]),_0x571ad6);if(_0x11da54[_0x35ad('0x2c')][_0x35ad('0x38')]){_0x34b8b9[_0x35ad('0x35')]=_['merge'](_0x34b8b9[_0x35ad('0x35')],{'$or':_['map'](_0x571ad6,function(_0x25e63e){if(_0x25e63e[_0x35ad('0x39')]!==_0x35ad('0x3a')){var _0x38d1c9={};_0x38d1c9[_0x25e63e[_0x35ad('0x27')]]={'$like':'%'+_0x11da54[_0x35ad('0x2c')][_0x35ad('0x38')]+'%'};return _0x38d1c9;}})});}_0x34b8b9=_[_0x35ad('0x3b')]({},_0x34b8b9,_0x11da54[_0x35ad('0x3c')]);var _0x5dd327={'where':_0x34b8b9[_0x35ad('0x35')]};return db[_0x35ad('0x3d')][_0x35ad('0x1c')](_0x5dd327)['then'](function(_0x19d82d){_0x481803[_0x35ad('0x1c')]=_0x19d82d;if(_0x11da54[_0x35ad('0x2c')][_0x35ad('0x3e')]){_0x34b8b9[_0x35ad('0x3f')]=[{'all':!![]}];}return db[_0x35ad('0x3d')][_0x35ad('0x40')](_0x34b8b9);})[_0x35ad('0x23')](function(_0x11de09){_0x481803[_0x35ad('0x41')]=_0x11de09;return _0x481803;})[_0x35ad('0x23')](respondWithFilteredResult(_0x2f8b3,_0x34b8b9))['catch'](handleError(_0x2f8b3,null));};exports[_0x35ad('0x42')]=function(_0x4edc2b,_0x3de722){var _0x3b80c0={'raw':!![],'where':{'id':_0x4edc2b[_0x35ad('0x43')]['id']}},_0x3df623={};_0x3df623[_0x35ad('0x2b')]=_[_0x35ad('0x44')](db[_0x35ad('0x3d')][_0x35ad('0x2a')]);_0x3df623[_0x35ad('0x2c')]=_['keys'](_0x4edc2b[_0x35ad('0x2c')]);_0x3df623[_0x35ad('0x36')]=_[_0x35ad('0x2d')](_0x3df623[_0x35ad('0x2b')],_0x3df623[_0x35ad('0x2c')]);_0x3b80c0['attributes']=_[_0x35ad('0x2d')](_0x3df623[_0x35ad('0x2b')],qs['fields'](_0x4edc2b['query'][_0x35ad('0x2e')]));_0x3b80c0[_0x35ad('0x2f')]=_0x3b80c0[_0x35ad('0x2f')][_0x35ad('0x30')]?_0x3b80c0['attributes']:_0x3df623[_0x35ad('0x2b')];if(_0x4edc2b[_0x35ad('0x2c')][_0x35ad('0x3e')]){_0x3b80c0[_0x35ad('0x3f')]=[{'all':!![]}];}_0x3b80c0=_[_0x35ad('0x3b')]({},_0x3b80c0,_0x4edc2b[_0x35ad('0x3c')]);return db[_0x35ad('0x3d')]['find'](_0x3b80c0)[_0x35ad('0x23')](handleEntityNotFound(_0x3de722,null))[_0x35ad('0x23')](respondWithResult(_0x3de722,null))[_0x35ad('0x45')](handleError(_0x3de722,null));};exports['create']=function(_0x5e3f96,_0x5644c4){return db[_0x35ad('0x3d')][_0x35ad('0x46')](_0x5e3f96[_0x35ad('0x47')],{})[_0x35ad('0x23')](respondWithResult(_0x5644c4,0xc9))['catch'](handleError(_0x5644c4,null));};exports[_0x35ad('0x22')]=function(_0x46c462,_0x3583ca){if(_0x46c462[_0x35ad('0x47')]['id']){delete _0x46c462[_0x35ad('0x47')]['id'];}return db[_0x35ad('0x3d')]['find']({'where':{'id':_0x46c462['params']['id']}})[_0x35ad('0x23')](handleEntityNotFound(_0x3583ca,null))[_0x35ad('0x23')](saveUpdates(_0x46c462['body'],null))['then'](respondWithResult(_0x3583ca,null))[_0x35ad('0x45')](handleError(_0x3583ca,null));};exports[_0x35ad('0x24')]=function(_0x196ebd,_0x5c7dbd){return db['Cdr'][_0x35ad('0x48')]({'where':{'id':_0x196ebd[_0x35ad('0x43')]['id']}})[_0x35ad('0x23')](handleEntityNotFound(_0x5c7dbd,null))['then'](removeEntity(_0x5c7dbd,null))[_0x35ad('0x45')](handleError(_0x5c7dbd,null));};exports[_0x35ad('0x49')]=function(_0x34061c,_0x467887){return db[_0x35ad('0x3d')][_0x35ad('0x49')]()['then'](respondWithResult(_0x467887,null))[_0x35ad('0x45')](handleError(_0x467887,null));}; \ No newline at end of file +var _0x7c09=['map','Cdr','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','merge','find','create','body','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index'];(function(_0xd4d1f5,_0x497669){var _0x20f28b=function(_0x30f79f){while(--_0x30f79f){_0xd4d1f5['push'](_0xd4d1f5['shift']());}};_0x20f28b(++_0x497669);}(_0x7c09,0x102));var _0x97c0=function(_0x4823b8,_0x1e51d3){_0x4823b8=_0x4823b8-0x0;var _0x632efd=_0x7c09[_0x4823b8];return _0x632efd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x97c0('0x0'));var zipdir=require(_0x97c0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x97c0('0x2'));var moment=require(_0x97c0('0x3'));var BPromise=require(_0x97c0('0x4'));var Mustache=require(_0x97c0('0x5'));var util=require(_0x97c0('0x6'));var path=require(_0x97c0('0x7'));var sox=require(_0x97c0('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x97c0('0x9'));var squel=require(_0x97c0('0xa'));var crypto=require(_0x97c0('0xb'));var jsforce=require(_0x97c0('0xc'));var deskjs=require(_0x97c0('0xd'));var toCsv=require('to-csv');var querystring=require(_0x97c0('0xe'));var Papa=require('papaparse');var Redis=require(_0x97c0('0xf'));var authService=require(_0x97c0('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x97c0('0x11'));var logger=require(_0x97c0('0x12'))(_0x97c0('0x13'));var utils=require(_0x97c0('0x14'));var config=require(_0x97c0('0x15'));var licenseUtil=require(_0x97c0('0x16'));var db=require(_0x97c0('0x17'))['db'];function respondWithStatusCode(_0x39a3b4,_0x9ca3c1){_0x9ca3c1=_0x9ca3c1||0xcc;return function(_0x2ecf34){if(_0x2ecf34){return _0x39a3b4[_0x97c0('0x18')](_0x9ca3c1);}return _0x39a3b4[_0x97c0('0x19')](_0x9ca3c1)[_0x97c0('0x1a')]();};}function respondWithResult(_0x514782,_0x3f2fc2){_0x3f2fc2=_0x3f2fc2||0xc8;return function(_0x15b336){if(_0x15b336){return _0x514782[_0x97c0('0x19')](_0x3f2fc2)['json'](_0x15b336);}};}function respondWithFilteredResult(_0x42027d,_0x9ca6a8){return function(_0x379951){if(_0x379951){var _0x21e5f7=typeof _0x9ca6a8[_0x97c0('0x1b')]===_0x97c0('0x1c')&&typeof _0x9ca6a8['limit']===_0x97c0('0x1c');var _0x3ae7c4=_0x379951['count'];var _0x560ac0=_0x21e5f7?0x0:_0x9ca6a8[_0x97c0('0x1b')];var _0x179d43=_0x21e5f7?_0x379951[_0x97c0('0x1d')]:_0x9ca6a8[_0x97c0('0x1b')]+_0x9ca6a8[_0x97c0('0x1e')];var _0x4fed42;if(_0x179d43>=_0x3ae7c4){_0x179d43=_0x3ae7c4;_0x4fed42=0xc8;}else{_0x4fed42=0xce;}_0x42027d[_0x97c0('0x19')](_0x4fed42);return _0x42027d[_0x97c0('0x1f')](_0x97c0('0x20'),_0x560ac0+'-'+_0x179d43+'/'+_0x3ae7c4)['json'](_0x379951);}return null;};}function patchUpdates(_0x554122){return function(_0x2b74a2){try{jsonpatch[_0x97c0('0x21')](_0x2b74a2,_0x554122,!![]);}catch(_0x169f19){return BPromise['reject'](_0x169f19);}return _0x2b74a2[_0x97c0('0x22')]();};}function saveUpdates(_0x20bc4c,_0x31ffb7){return function(_0x272314){if(_0x272314){return _0x272314[_0x97c0('0x23')](_0x20bc4c)[_0x97c0('0x24')](function(_0x9dff60){return _0x9dff60;});}return null;};}function removeEntity(_0x5ac457,_0x60ab00){return function(_0x29b3aa){if(_0x29b3aa){return _0x29b3aa[_0x97c0('0x25')]()[_0x97c0('0x24')](function(){_0x5ac457['status'](0xcc)[_0x97c0('0x1a')]();});}};}function handleEntityNotFound(_0x14cada,_0x52a429){return function(_0x2ec9d6){if(!_0x2ec9d6){_0x14cada[_0x97c0('0x18')](0x194);}return _0x2ec9d6;};}function handleError(_0x447316,_0x4af5a5){_0x4af5a5=_0x4af5a5||0x1f4;return function(_0x4f11ba){logger['error'](_0x4f11ba[_0x97c0('0x26')]);if(_0x4f11ba[_0x97c0('0x27')]){delete _0x4f11ba[_0x97c0('0x27')];}_0x447316[_0x97c0('0x19')](_0x4af5a5)[_0x97c0('0x28')](_0x4f11ba);};}exports[_0x97c0('0x29')]=function(_0x4a3645,_0x10e47e){var _0x1c183f={},_0x325090={},_0x4ad645={'count':0x0,'rows':[]};var _0x14617c=_[_0x97c0('0x2a')](db[_0x97c0('0x2b')][_0x97c0('0x2c')],function(_0x2a7b2b){return{'name':_0x2a7b2b['fieldName'],'type':_0x2a7b2b['type'][_0x97c0('0x2d')]};});_0x325090[_0x97c0('0x2e')]=_[_0x97c0('0x2a')](_0x14617c,'name');_0x325090[_0x97c0('0x2f')]=_[_0x97c0('0x30')](_0x4a3645['query']);_0x325090[_0x97c0('0x31')]=_[_0x97c0('0x32')](_0x325090[_0x97c0('0x2e')],_0x325090[_0x97c0('0x2f')]);_0x1c183f[_0x97c0('0x33')]=_[_0x97c0('0x32')](_0x325090[_0x97c0('0x2e')],qs[_0x97c0('0x34')](_0x4a3645[_0x97c0('0x2f')][_0x97c0('0x34')]));_0x1c183f[_0x97c0('0x33')]=_0x1c183f[_0x97c0('0x33')][_0x97c0('0x35')]?_0x1c183f[_0x97c0('0x33')]:_0x325090[_0x97c0('0x2e')];if(!_0x4a3645['query'][_0x97c0('0x36')](_0x97c0('0x37'))){_0x1c183f[_0x97c0('0x1e')]=qs[_0x97c0('0x1e')](_0x4a3645[_0x97c0('0x2f')][_0x97c0('0x1e')]);_0x1c183f[_0x97c0('0x1b')]=qs[_0x97c0('0x1b')](_0x4a3645['query'][_0x97c0('0x1b')]);}_0x1c183f['order']=qs[_0x97c0('0x38')](_0x4a3645[_0x97c0('0x2f')][_0x97c0('0x38')]);_0x1c183f[_0x97c0('0x39')]=qs[_0x97c0('0x31')](_[_0x97c0('0x3a')](_0x4a3645[_0x97c0('0x2f')],_0x325090[_0x97c0('0x31')]),_0x14617c);if(_0x4a3645[_0x97c0('0x2f')][_0x97c0('0x3b')]){_0x1c183f[_0x97c0('0x39')]=_['merge'](_0x1c183f[_0x97c0('0x39')],{'$or':_[_0x97c0('0x2a')](_0x14617c,function(_0x4d47b1){if(_0x4d47b1[_0x97c0('0x3c')]!==_0x97c0('0x3d')){var _0x2aeffc={};_0x2aeffc[_0x4d47b1[_0x97c0('0x27')]]={'$like':'%'+_0x4a3645['query'][_0x97c0('0x3b')]+'%'};return _0x2aeffc;}})});}_0x1c183f=_['merge']({},_0x1c183f,_0x4a3645[_0x97c0('0x3e')]);var _0x64cfcd={'where':_0x1c183f['where']};return db[_0x97c0('0x2b')][_0x97c0('0x1d')](_0x64cfcd)[_0x97c0('0x24')](function(_0xb13649){_0x4ad645[_0x97c0('0x1d')]=_0xb13649;if(_0x4a3645[_0x97c0('0x2f')][_0x97c0('0x3f')]){_0x1c183f[_0x97c0('0x40')]=[{'all':!![]}];}return db[_0x97c0('0x2b')][_0x97c0('0x41')](_0x1c183f);})[_0x97c0('0x24')](function(_0x2cca4c){_0x4ad645[_0x97c0('0x42')]=_0x2cca4c;return _0x4ad645;})['then'](respondWithFilteredResult(_0x10e47e,_0x1c183f))[_0x97c0('0x43')](handleError(_0x10e47e,null));};exports[_0x97c0('0x44')]=function(_0x1dc6ff,_0x142421){var _0x312fce={'raw':!![],'where':{'id':_0x1dc6ff[_0x97c0('0x45')]['id']}},_0x375ebc={};_0x375ebc['model']=_['keys'](db[_0x97c0('0x2b')][_0x97c0('0x2c')]);_0x375ebc[_0x97c0('0x2f')]=_[_0x97c0('0x30')](_0x1dc6ff[_0x97c0('0x2f')]);_0x375ebc['filters']=_['intersection'](_0x375ebc['model'],_0x375ebc[_0x97c0('0x2f')]);_0x312fce['attributes']=_['intersection'](_0x375ebc[_0x97c0('0x2e')],qs[_0x97c0('0x34')](_0x1dc6ff[_0x97c0('0x2f')][_0x97c0('0x34')]));_0x312fce[_0x97c0('0x33')]=_0x312fce['attributes'][_0x97c0('0x35')]?_0x312fce[_0x97c0('0x33')]:_0x375ebc[_0x97c0('0x2e')];if(_0x1dc6ff[_0x97c0('0x2f')][_0x97c0('0x3f')]){_0x312fce[_0x97c0('0x40')]=[{'all':!![]}];}_0x312fce=_[_0x97c0('0x46')]({},_0x312fce,_0x1dc6ff[_0x97c0('0x3e')]);return db[_0x97c0('0x2b')][_0x97c0('0x47')](_0x312fce)['then'](handleEntityNotFound(_0x142421,null))[_0x97c0('0x24')](respondWithResult(_0x142421,null))[_0x97c0('0x43')](handleError(_0x142421,null));};exports[_0x97c0('0x48')]=function(_0x276c98,_0x4ff0a5){return db['Cdr'][_0x97c0('0x48')](_0x276c98[_0x97c0('0x49')],{})[_0x97c0('0x24')](respondWithResult(_0x4ff0a5,0xc9))['catch'](handleError(_0x4ff0a5,null));};exports[_0x97c0('0x23')]=function(_0xac56ac,_0x240f68){if(_0xac56ac[_0x97c0('0x49')]['id']){delete _0xac56ac[_0x97c0('0x49')]['id'];}return db['Cdr'][_0x97c0('0x47')]({'where':{'id':_0xac56ac[_0x97c0('0x45')]['id']}})[_0x97c0('0x24')](handleEntityNotFound(_0x240f68,null))['then'](saveUpdates(_0xac56ac['body'],null))[_0x97c0('0x24')](respondWithResult(_0x240f68,null))['catch'](handleError(_0x240f68,null));};exports['destroy']=function(_0x473b63,_0x20e2a5){return db[_0x97c0('0x2b')]['find']({'where':{'id':_0x473b63['params']['id']}})['then'](handleEntityNotFound(_0x20e2a5,null))[_0x97c0('0x24')](removeEntity(_0x20e2a5,null))[_0x97c0('0x43')](handleError(_0x20e2a5,null));};exports[_0x97c0('0x4a')]=function(_0xdb2767,_0x397065){return db[_0x97c0('0x2b')][_0x97c0('0x4a')]()['then'](respondWithResult(_0x397065,null))[_0x97c0('0x43')](handleError(_0x397065,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index ffe73ea..82ac2e8 100644 --- a/server/api/cdr/cdr.model.js +++ b/server/api/cdr/cdr.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x225271,_0x23700c){var _0x5b4b43=function(_0xa3f494){while(--_0xa3f494){_0x225271['push'](_0x225271['shift']());}};_0x5b4b43(++_0x23700c);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});}; \ No newline at end of file +var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0xc1a87b,_0x38551a){var _0x1c61e8=function(_0x103467){while(--_0x103467){_0xc1a87b['push'](_0xc1a87b['shift']());}};_0x1c61e8(++_0x38551a);}(_0x7a54,0x106));var _0x47a5=function(_0x2c60c1,_0x4cac53){_0x2c60c1=_0x2c60c1-0x0;var _0x2fc088=_0x7a54[_0x2c60c1];return _0x2fc088;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index ef4deea..633aa9c 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 _0x8c7b=['ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','info','Cdr,\x20%s,\x20%s','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring'];(function(_0x5cc3d4,_0xbcbf9b){var _0x17ca31=function(_0x5dbd6d){while(--_0x5dbd6d){_0x5cc3d4['push'](_0x5cc3d4['shift']());}};_0x17ca31(++_0xbcbf9b);}(_0x8c7b,0x7a));var _0xb8c7=function(_0x393670,_0x759e56){_0x393670=_0x393670-0x0;var _0x391839=_0x8c7b[_0x393670];return _0x391839;};'use strict';var _=require(_0xb8c7('0x0'));var util=require(_0xb8c7('0x1'));var moment=require('moment');var BPromise=require(_0xb8c7('0x2'));var rs=require(_0xb8c7('0x3'));var fs=require('fs');var Redis=require(_0xb8c7('0x4'));var db=require(_0xb8c7('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb8c7('0x6'))('rpc');var config=require(_0xb8c7('0x7'));var jayson=require(_0xb8c7('0x8'));var client=jayson[_0xb8c7('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x457cab,_0x3c1f55,_0x207f2e){return new BPromise(function(_0x222535,_0x35b435){return client[_0xb8c7('0xa')](_0x457cab,_0x207f2e)['then'](function(_0x16c562){logger[_0xb8c7('0xb')](_0xb8c7('0xc'),_0x3c1f55,_0xb8c7('0xd'));logger['debug'](_0xb8c7('0xe'),_0x3c1f55,_0xb8c7('0xd'),JSON[_0xb8c7('0xf')](_0x16c562));if(_0x16c562[_0xb8c7('0x10')]){if(_0x16c562[_0xb8c7('0x10')][_0xb8c7('0x11')]===0x1f4){logger['error'](_0xb8c7('0xc'),_0x3c1f55,_0x16c562[_0xb8c7('0x10')][_0xb8c7('0x12')]);return _0x35b435(_0x16c562[_0xb8c7('0x10')][_0xb8c7('0x12')]);}logger[_0xb8c7('0x10')](_0xb8c7('0xc'),_0x3c1f55,_0x16c562[_0xb8c7('0x10')][_0xb8c7('0x12')]);return _0x222535(_0x16c562[_0xb8c7('0x10')][_0xb8c7('0x12')]);}else{logger[_0xb8c7('0xb')](_0xb8c7('0xc'),_0x3c1f55,_0xb8c7('0xd'));_0x222535(_0x16c562[_0xb8c7('0x13')][_0xb8c7('0x12')]);}})[_0xb8c7('0x14')](function(_0x16604e){logger[_0xb8c7('0x10')](_0xb8c7('0xc'),_0x3c1f55,_0x16604e);_0x35b435(_0x16604e);});});} \ No newline at end of file +var _0xac26=['bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','Cdr,\x20%s,\x20%s','Cdr,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','lodash','util','moment'];(function(_0x4ff1a8,_0xbb3134){var _0x5b5582=function(_0x5a760f){while(--_0x5a760f){_0x4ff1a8['push'](_0x4ff1a8['shift']());}};_0x5b5582(++_0xbb3134);}(_0xac26,0x1b5));var _0x6ac2=function(_0x30d207,_0x49543a){_0x30d207=_0x30d207-0x0;var _0x17ca1d=_0xac26[_0x30d207];return _0x17ca1d;};'use strict';var _=require(_0x6ac2('0x0'));var util=require(_0x6ac2('0x1'));var moment=require(_0x6ac2('0x2'));var BPromise=require(_0x6ac2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6ac2('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6ac2('0x5'));var logger=require(_0x6ac2('0x6'))(_0x6ac2('0x7'));var config=require(_0x6ac2('0x8'));var jayson=require(_0x6ac2('0x9'));var client=jayson[_0x6ac2('0xa')][_0x6ac2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1c4944,_0x58bf8b,_0x1e47d8){return new BPromise(function(_0x3a604f,_0x3aa781){return client['request'](_0x1c4944,_0x1e47d8)[_0x6ac2('0xc')](function(_0x531ebe){logger[_0x6ac2('0xd')](_0x6ac2('0xe'),_0x58bf8b,'request\x20sent');logger['debug'](_0x6ac2('0xf'),_0x58bf8b,_0x6ac2('0x10'),JSON['stringify'](_0x531ebe));if(_0x531ebe[_0x6ac2('0x11')]){if(_0x531ebe[_0x6ac2('0x11')][_0x6ac2('0x12')]===0x1f4){logger[_0x6ac2('0x11')](_0x6ac2('0xe'),_0x58bf8b,_0x531ebe['error']['message']);return _0x3aa781(_0x531ebe[_0x6ac2('0x11')][_0x6ac2('0x13')]);}logger[_0x6ac2('0x11')](_0x6ac2('0xe'),_0x58bf8b,_0x531ebe[_0x6ac2('0x11')][_0x6ac2('0x13')]);return _0x3a604f(_0x531ebe['error'][_0x6ac2('0x13')]);}else{logger[_0x6ac2('0xd')](_0x6ac2('0xe'),_0x58bf8b,_0x6ac2('0x10'));_0x3a604f(_0x531ebe['result'][_0x6ac2('0x13')]);}})['catch'](function(_0x1cba50){logger[_0x6ac2('0x11')](_0x6ac2('0xe'),_0x58bf8b,_0x1cba50);_0x3aa781(_0x1cba50);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index e079fba..14cc31c 100644 --- a/server/api/cdr/index.js +++ b/server/api/cdr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x34c1ea,_0x5e3a54){var _0x3dcca5=function(_0x375eb3){while(--_0x375eb3){_0x34c1ea['push'](_0x34c1ea['shift']());}};_0x3dcca5(++_0x5e3a54);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file +var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x48b8ad,_0xe28403){var _0x4d1bae=function(_0x5d13b2){while(--_0x5d13b2){_0x48b8ad['push'](_0x48b8ad['shift']());}};_0x4d1bae(++_0xe28403);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index 081492e..392b9f5 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 _0x4137=['*,*,*,*','sequelize','INTEGER','noop','TEXT','STRING'];(function(_0x113885,_0x5c6a88){var _0x84a0ae=function(_0x8b23e0){while(--_0x8b23e0){_0x113885['push'](_0x113885['shift']());}};_0x84a0ae(++_0x5c6a88);}(_0x4137,0xdf));var _0x7413=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x4137[_0x57b54c];return _0x59cc19;};'use strict';var Sequelize=require(_0x7413('0x0'));module['exports']={'priority':{'type':Sequelize[_0x7413('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x7413('0x2')},'appdata':{'type':Sequelize[_0x7413('0x3')]()},'description':{'type':Sequelize[_0x7413('0x4')]},'interval':{'type':Sequelize[_0x7413('0x4')],'defaultValue':_0x7413('0x5')}}; \ No newline at end of file +var _0x9388=['INTEGER','noop','TEXT','STRING','sequelize','exports'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0x9388,0x1f0));var _0x8938=function(_0xb4c438,_0x5d987d){_0xb4c438=_0xb4c438-0x0;var _0xf453fb=_0x9388[_0xb4c438];return _0xf453fb;};'use strict';var Sequelize=require(_0x8938('0x0'));module[_0x8938('0x1')]={'priority':{'type':Sequelize[_0x8938('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x8938('0x3')},'appdata':{'type':Sequelize[_0x8938('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x8938('0x5')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index c817ff0..8b54b52 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 _0x7d98=['mustache','util','sox','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','Content-Range','json','reject','save','update','then','destroy','error','name','send','params','model','query','keys','filters','attributes','intersection','fields','length','includeAll','include','merge','options','ChatApplication','find','catch','body','eml-format','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x4f356c,_0x33dd22){var _0x5b6d07=function(_0x2e0582){while(--_0x2e0582){_0x4f356c['push'](_0x4f356c['shift']());}};_0x5b6d07(++_0x33dd22);}(_0x7d98,0xe7));var _0x87d9=function(_0x3f4cd0,_0x303070){_0x3f4cd0=_0x3f4cd0-0x0;var _0x3f9f01=_0x7d98[_0x3f4cd0];return _0x3f9f01;};'use strict';var emlformat=require(_0x87d9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x87d9('0x1'));var jsonpatch=require(_0x87d9('0x2'));var rp=require(_0x87d9('0x3'));var moment=require(_0x87d9('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x87d9('0x5'));var util=require(_0x87d9('0x6'));var path=require('path');var sox=require(_0x87d9('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x87d9('0x8'));var squel=require(_0x87d9('0x9'));var crypto=require(_0x87d9('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x87d9('0xb'));var toCsv=require(_0x87d9('0xc'));var querystring=require(_0x87d9('0xd'));var Papa=require('papaparse');var Redis=require(_0x87d9('0xe'));var authService=require(_0x87d9('0xf'));var qs=require(_0x87d9('0x10'));var as=require(_0x87d9('0x11'));var hardwareService=require(_0x87d9('0x12'));var logger=require(_0x87d9('0x13'))(_0x87d9('0x14'));var utils=require(_0x87d9('0x15'));var config=require(_0x87d9('0x16'));var licenseUtil=require(_0x87d9('0x17'));var db=require(_0x87d9('0x18'))['db'];function respondWithStatusCode(_0x22f32d,_0x38f33e){_0x38f33e=_0x38f33e||0xcc;return function(_0x22758){if(_0x22758){return _0x22f32d[_0x87d9('0x19')](_0x38f33e);}return _0x22f32d[_0x87d9('0x1a')](_0x38f33e)[_0x87d9('0x1b')]();};}function respondWithResult(_0x185401,_0x380836){_0x380836=_0x380836||0xc8;return function(_0x27d61d){if(_0x27d61d){return _0x185401['status'](_0x380836)['json'](_0x27d61d);}};}function respondWithFilteredResult(_0x9e9e53,_0xaa910c){return function(_0x3231e7){if(_0x3231e7){var _0x501d32=typeof _0xaa910c['offset']===_0x87d9('0x1c')&&typeof _0xaa910c[_0x87d9('0x1d')]===_0x87d9('0x1c');var _0x23ae47=_0x3231e7[_0x87d9('0x1e')];var _0xebc1eb=_0x501d32?0x0:_0xaa910c[_0x87d9('0x1f')];var _0x1f33a3=_0x501d32?_0x3231e7[_0x87d9('0x1e')]:_0xaa910c[_0x87d9('0x1f')]+_0xaa910c[_0x87d9('0x1d')];var _0x5d6da1;if(_0x1f33a3>=_0x23ae47){_0x1f33a3=_0x23ae47;_0x5d6da1=0xc8;}else{_0x5d6da1=0xce;}_0x9e9e53[_0x87d9('0x1a')](_0x5d6da1);return _0x9e9e53['set'](_0x87d9('0x20'),_0xebc1eb+'-'+_0x1f33a3+'/'+_0x23ae47)[_0x87d9('0x21')](_0x3231e7);}return null;};}function patchUpdates(_0x334d31){return function(_0x57bef6){try{jsonpatch['apply'](_0x57bef6,_0x334d31,!![]);}catch(_0x545241){return BPromise[_0x87d9('0x22')](_0x545241);}return _0x57bef6[_0x87d9('0x23')]();};}function saveUpdates(_0x28aaaa,_0x6ab839){return function(_0xc82b02){if(_0xc82b02){return _0xc82b02[_0x87d9('0x24')](_0x28aaaa)[_0x87d9('0x25')](function(_0x3b24e7){return _0x3b24e7;});}return null;};}function removeEntity(_0x1c550c,_0x4c0f7a){return function(_0x31e1b2){if(_0x31e1b2){return _0x31e1b2[_0x87d9('0x26')]()[_0x87d9('0x25')](function(){_0x1c550c[_0x87d9('0x1a')](0xcc)[_0x87d9('0x1b')]();});}};}function handleEntityNotFound(_0x340462,_0x3641c8){return function(_0x32b83f){if(!_0x32b83f){_0x340462['sendStatus'](0x194);}return _0x32b83f;};}function handleError(_0x8b1ab7,_0x600404){_0x600404=_0x600404||0x1f4;return function(_0x2f63fa){logger[_0x87d9('0x27')](_0x2f63fa['stack']);if(_0x2f63fa[_0x87d9('0x28')]){delete _0x2f63fa[_0x87d9('0x28')];}_0x8b1ab7[_0x87d9('0x1a')](_0x600404)[_0x87d9('0x29')](_0x2f63fa);};}exports['show']=function(_0x21916a,_0x3c0283){var _0x501c5={'raw':!![],'where':{'id':_0x21916a[_0x87d9('0x2a')]['id']}},_0x5e1b55={};_0x5e1b55[_0x87d9('0x2b')]=_['keys'](db['ChatApplication']['rawAttributes']);_0x5e1b55[_0x87d9('0x2c')]=_[_0x87d9('0x2d')](_0x21916a['query']);_0x5e1b55[_0x87d9('0x2e')]=_['intersection'](_0x5e1b55[_0x87d9('0x2b')],_0x5e1b55['query']);_0x501c5[_0x87d9('0x2f')]=_[_0x87d9('0x30')](_0x5e1b55['model'],qs[_0x87d9('0x31')](_0x21916a['query'][_0x87d9('0x31')]));_0x501c5[_0x87d9('0x2f')]=_0x501c5[_0x87d9('0x2f')][_0x87d9('0x32')]?_0x501c5[_0x87d9('0x2f')]:_0x5e1b55[_0x87d9('0x2b')];if(_0x21916a['query'][_0x87d9('0x33')]){_0x501c5[_0x87d9('0x34')]=[{'all':!![]}];}_0x501c5=_[_0x87d9('0x35')]({},_0x501c5,_0x21916a[_0x87d9('0x36')]);return db[_0x87d9('0x37')][_0x87d9('0x38')](_0x501c5)[_0x87d9('0x25')](handleEntityNotFound(_0x3c0283,null))[_0x87d9('0x25')](respondWithResult(_0x3c0283,null))[_0x87d9('0x39')](handleError(_0x3c0283,null));};exports['update']=function(_0xf1007,_0x24d0e6){if(_0xf1007[_0x87d9('0x3a')]['id']){delete _0xf1007[_0x87d9('0x3a')]['id'];}return db[_0x87d9('0x37')]['find']({'where':{'id':_0xf1007[_0x87d9('0x2a')]['id']}})[_0x87d9('0x25')](handleEntityNotFound(_0x24d0e6,null))[_0x87d9('0x25')](saveUpdates(_0xf1007['body'],null))[_0x87d9('0x25')](respondWithResult(_0x24d0e6,null))['catch'](handleError(_0x24d0e6,null));};exports[_0x87d9('0x26')]=function(_0x2a18cf,_0x157fa1){return db[_0x87d9('0x37')]['find']({'where':{'id':_0x2a18cf[_0x87d9('0x2a')]['id']}})['then'](handleEntityNotFound(_0x157fa1,null))[_0x87d9('0x25')](removeEntity(_0x157fa1,null))[_0x87d9('0x39')](handleError(_0x157fa1,null));}; \ No newline at end of file +var _0x6c50=['squel','crypto','jsforce','querystring','papaparse','ioredis','../../config/license/hardware','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','show','params','keys','ChatApplication','rawAttributes','filters','model','attributes','fields','length','query','includeAll','include','merge','catch','update','body','find','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x6c50,0xa4));var _0x06c5=function(_0xc97077,_0x24905c){_0xc97077=_0xc97077-0x0;var _0x3ca6ac=_0x6c50[_0xc97077];return _0x3ca6ac;};'use strict';var emlformat=require(_0x06c5('0x0'));var rimraf=require(_0x06c5('0x1'));var zipdir=require(_0x06c5('0x2'));var jsonpatch=require(_0x06c5('0x3'));var rp=require('request-promise');var moment=require(_0x06c5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x06c5('0x5'));var util=require(_0x06c5('0x6'));var path=require(_0x06c5('0x7'));var sox=require(_0x06c5('0x8'));var csv=require(_0x06c5('0x9'));var ejs=require(_0x06c5('0xa'));var fs=require('fs');var fs_extra=require(_0x06c5('0xb'));var _=require(_0x06c5('0xc'));var squel=require(_0x06c5('0xd'));var crypto=require(_0x06c5('0xe'));var jsforce=require(_0x06c5('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x06c5('0x9'));var querystring=require(_0x06c5('0x10'));var Papa=require(_0x06c5('0x11'));var Redis=require(_0x06c5('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x06c5('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x06c5('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x06c5('0x15'))['db'];function respondWithStatusCode(_0x2d7502,_0x68194e){_0x68194e=_0x68194e||0xcc;return function(_0x4ce581){if(_0x4ce581){return _0x2d7502[_0x06c5('0x16')](_0x68194e);}return _0x2d7502[_0x06c5('0x17')](_0x68194e)[_0x06c5('0x18')]();};}function respondWithResult(_0x39e176,_0x5d456e){_0x5d456e=_0x5d456e||0xc8;return function(_0x4e8669){if(_0x4e8669){return _0x39e176[_0x06c5('0x17')](_0x5d456e)[_0x06c5('0x19')](_0x4e8669);}};}function respondWithFilteredResult(_0x13a8d4,_0x4eeeca){return function(_0x16c36e){if(_0x16c36e){var _0x117371=typeof _0x4eeeca['offset']===_0x06c5('0x1a')&&typeof _0x4eeeca[_0x06c5('0x1b')]===_0x06c5('0x1a');var _0xb48b48=_0x16c36e[_0x06c5('0x1c')];var _0x36b9e9=_0x117371?0x0:_0x4eeeca[_0x06c5('0x1d')];var _0x18a070=_0x117371?_0x16c36e[_0x06c5('0x1c')]:_0x4eeeca[_0x06c5('0x1d')]+_0x4eeeca[_0x06c5('0x1b')];var _0x46471b;if(_0x18a070>=_0xb48b48){_0x18a070=_0xb48b48;_0x46471b=0xc8;}else{_0x46471b=0xce;}_0x13a8d4[_0x06c5('0x17')](_0x46471b);return _0x13a8d4[_0x06c5('0x1e')](_0x06c5('0x1f'),_0x36b9e9+'-'+_0x18a070+'/'+_0xb48b48)[_0x06c5('0x19')](_0x16c36e);}return null;};}function patchUpdates(_0x26a653){return function(_0x4ba7e9){try{jsonpatch[_0x06c5('0x20')](_0x4ba7e9,_0x26a653,!![]);}catch(_0x3c2d52){return BPromise[_0x06c5('0x21')](_0x3c2d52);}return _0x4ba7e9[_0x06c5('0x22')]();};}function saveUpdates(_0xa3659b,_0x3c9e49){return function(_0x29db18){if(_0x29db18){return _0x29db18['update'](_0xa3659b)[_0x06c5('0x23')](function(_0x1b0cc7){return _0x1b0cc7;});}return null;};}function removeEntity(_0x414dda,_0x20ba9e){return function(_0x368e2f){if(_0x368e2f){return _0x368e2f[_0x06c5('0x24')]()[_0x06c5('0x23')](function(){_0x414dda['status'](0xcc)[_0x06c5('0x18')]();});}};}function handleEntityNotFound(_0x5aeb6c,_0x564f96){return function(_0x512dbc){if(!_0x512dbc){_0x5aeb6c['sendStatus'](0x194);}return _0x512dbc;};}function handleError(_0xa33539,_0x2f6a65){_0x2f6a65=_0x2f6a65||0x1f4;return function(_0x1067e1){logger[_0x06c5('0x25')](_0x1067e1[_0x06c5('0x26')]);if(_0x1067e1['name']){delete _0x1067e1[_0x06c5('0x27')];}_0xa33539[_0x06c5('0x17')](_0x2f6a65)[_0x06c5('0x28')](_0x1067e1);};}exports[_0x06c5('0x29')]=function(_0x2f8ac9,_0x4d4d04){var _0x38f6a7={'raw':!![],'where':{'id':_0x2f8ac9[_0x06c5('0x2a')]['id']}},_0x432de5={};_0x432de5['model']=_[_0x06c5('0x2b')](db[_0x06c5('0x2c')][_0x06c5('0x2d')]);_0x432de5['query']=_['keys'](_0x2f8ac9['query']);_0x432de5[_0x06c5('0x2e')]=_['intersection'](_0x432de5[_0x06c5('0x2f')],_0x432de5['query']);_0x38f6a7[_0x06c5('0x30')]=_['intersection'](_0x432de5[_0x06c5('0x2f')],qs['fields'](_0x2f8ac9['query'][_0x06c5('0x31')]));_0x38f6a7['attributes']=_0x38f6a7['attributes'][_0x06c5('0x32')]?_0x38f6a7[_0x06c5('0x30')]:_0x432de5[_0x06c5('0x2f')];if(_0x2f8ac9[_0x06c5('0x33')][_0x06c5('0x34')]){_0x38f6a7[_0x06c5('0x35')]=[{'all':!![]}];}_0x38f6a7=_[_0x06c5('0x36')]({},_0x38f6a7,_0x2f8ac9['options']);return db[_0x06c5('0x2c')]['find'](_0x38f6a7)['then'](handleEntityNotFound(_0x4d4d04,null))[_0x06c5('0x23')](respondWithResult(_0x4d4d04,null))[_0x06c5('0x37')](handleError(_0x4d4d04,null));};exports[_0x06c5('0x38')]=function(_0x31bd7f,_0x1e9d9f){if(_0x31bd7f[_0x06c5('0x39')]['id']){delete _0x31bd7f[_0x06c5('0x39')]['id'];}return db['ChatApplication']['find']({'where':{'id':_0x31bd7f[_0x06c5('0x2a')]['id']}})[_0x06c5('0x23')](handleEntityNotFound(_0x1e9d9f,null))['then'](saveUpdates(_0x31bd7f['body'],null))[_0x06c5('0x23')](respondWithResult(_0x1e9d9f,null))[_0x06c5('0x37')](handleError(_0x1e9d9f,null));};exports[_0x06c5('0x24')]=function(_0x503d3f,_0x44b651){return db[_0x06c5('0x2c')][_0x06c5('0x3a')]({'where':{'id':_0x503d3f['params']['id']}})[_0x06c5('0x23')](handleEntityNotFound(_0x44b651,null))[_0x06c5('0x23')](removeEntity(_0x44b651,null))['catch'](handleError(_0x44b651,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index aeaa27a..06a3bf6 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 _0x51d7=['utf8mb4','lodash','util','moment','bluebird','request-promise','rimraf','./chatApplication.attributes','exports','define'];(function(_0x3e9f07,_0x4ca00b){var _0x4dc041=function(_0x22f406){while(--_0x22f406){_0x3e9f07['push'](_0x3e9f07['shift']());}};_0x4dc041(++_0x4ca00b);}(_0x51d7,0x1e1));var _0x751d=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x51d7[_0x46e363];return _0x3fb059;};'use strict';var _=require(_0x751d('0x0'));var util=require(_0x751d('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x751d('0x2'));var BPromise=require(_0x751d('0x3'));var rp=require(_0x751d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x751d('0x5'));var config=require('../../config/environment');var attributes=require(_0x751d('0x6'));module[_0x751d('0x7')]=function(_0x39836e,_0x39a0e8){return _0x39836e[_0x751d('0x8')]('ChatApplication',attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x751d('0x9'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xe2f2=['moment','bluebird','request-promise','path','./chatApplication.attributes','exports','define','ChatApplication','chat_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x2cfb58,_0x3d9412){var _0xd99951=function(_0x329afa){while(--_0x329afa){_0x2cfb58['push'](_0x2cfb58['shift']());}};_0xd99951(++_0x3d9412);}(_0xe2f2,0x6c));var _0x2e2f=function(_0x443d9f,_0xa7008f){_0x443d9f=_0x443d9f-0x0;var _0x741631=_0xe2f2[_0x443d9f];return _0x741631;};'use strict';var _=require(_0x2e2f('0x0'));var util=require(_0x2e2f('0x1'));var logger=require(_0x2e2f('0x2'))(_0x2e2f('0x3'));var moment=require(_0x2e2f('0x4'));var BPromise=require(_0x2e2f('0x5'));var rp=require(_0x2e2f('0x6'));var fs=require('fs');var path=require(_0x2e2f('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2e2f('0x8'));module[_0x2e2f('0x9')]=function(_0x2346f5,_0x3f868e){return _0x2346f5[_0x2e2f('0xa')](_0x2e2f('0xb'),attributes,{'tableName':_0x2e2f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x2e2f('0xd')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index a5afaaf..d8dca46 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 _0x68d8=['request','then','ChatApplication,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http'];(function(_0x5a2d30,_0x4257c9){var _0x4d5d6c=function(_0x1bdff5){while(--_0x1bdff5){_0x5a2d30['push'](_0x5a2d30['shift']());}};_0x4d5d6c(++_0x4257c9);}(_0x68d8,0x137));var _0x868d=function(_0x192b8c,_0x53002a){_0x192b8c=_0x192b8c-0x0;var _0x5eeb16=_0x68d8[_0x192b8c];return _0x5eeb16;};'use strict';var _=require('lodash');var util=require(_0x868d('0x0'));var moment=require('moment');var BPromise=require(_0x868d('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x868d('0x2'));var db=require(_0x868d('0x3'))['db'];var utils=require(_0x868d('0x4'));var logger=require(_0x868d('0x5'))(_0x868d('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x868d('0x7')][_0x868d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x33c5ec,_0x4e2b7a,_0x42f82a){return new BPromise(function(_0x4cb593,_0x35b633){return client[_0x868d('0x9')](_0x33c5ec,_0x42f82a)[_0x868d('0xa')](function(_0x361528){logger['info'](_0x868d('0xb'),_0x4e2b7a,_0x868d('0xc'));logger['debug']('ChatApplication,\x20%s,\x20%s,\x20%s',_0x4e2b7a,_0x868d('0xc'),JSON[_0x868d('0xd')](_0x361528));if(_0x361528[_0x868d('0xe')]){if(_0x361528[_0x868d('0xe')][_0x868d('0xf')]===0x1f4){logger['error'](_0x868d('0xb'),_0x4e2b7a,_0x361528[_0x868d('0xe')][_0x868d('0x10')]);return _0x35b633(_0x361528[_0x868d('0xe')][_0x868d('0x10')]);}logger[_0x868d('0xe')](_0x868d('0xb'),_0x4e2b7a,_0x361528[_0x868d('0xe')]['message']);return _0x4cb593(_0x361528['error'][_0x868d('0x10')]);}else{logger[_0x868d('0x11')](_0x868d('0xb'),_0x4e2b7a,'request\x20sent');_0x4cb593(_0x361528[_0x868d('0x12')][_0x868d('0x10')]);}})[_0x868d('0x13')](function(_0x4eede2){logger['error']('ChatApplication,\x20%s,\x20%s',_0x4e2b7a,_0x4eede2);_0x35b633(_0x4eede2);});});} \ No newline at end of file +var _0xf076=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','bluebird'];(function(_0xa0a25e,_0x7b1e39){var _0x6024c9=function(_0x129514){while(--_0x129514){_0xa0a25e['push'](_0xa0a25e['shift']());}};_0x6024c9(++_0x7b1e39);}(_0xf076,0x123));var _0x6f07=function(_0x4d42a5,_0x36c76e){_0x4d42a5=_0x4d42a5-0x0;var _0x417c43=_0xf076[_0x4d42a5];return _0x417c43;};'use strict';var _=require(_0x6f07('0x0'));var util=require(_0x6f07('0x1'));var moment=require('moment');var BPromise=require(_0x6f07('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6f07('0x3'));var db=require(_0x6f07('0x4'))['db'];var utils=require(_0x6f07('0x5'));var logger=require('../../config/logger')(_0x6f07('0x6'));var config=require(_0x6f07('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x6f07('0x8')][_0x6f07('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4ee2b2,_0x490181,_0x4e29f5){return new BPromise(function(_0x478f17,_0x18537e){return client[_0x6f07('0xa')](_0x4ee2b2,_0x4e29f5)[_0x6f07('0xb')](function(_0xcdc7ba){logger[_0x6f07('0xc')](_0x6f07('0xd'),_0x490181,_0x6f07('0xe'));logger[_0x6f07('0xf')](_0x6f07('0x10'),_0x490181,_0x6f07('0xe'),JSON['stringify'](_0xcdc7ba));if(_0xcdc7ba[_0x6f07('0x11')]){if(_0xcdc7ba[_0x6f07('0x11')][_0x6f07('0x12')]===0x1f4){logger['error'](_0x6f07('0xd'),_0x490181,_0xcdc7ba[_0x6f07('0x11')]['message']);return _0x18537e(_0xcdc7ba[_0x6f07('0x11')]['message']);}logger[_0x6f07('0x11')](_0x6f07('0xd'),_0x490181,_0xcdc7ba[_0x6f07('0x11')][_0x6f07('0x13')]);return _0x478f17(_0xcdc7ba[_0x6f07('0x11')][_0x6f07('0x13')]);}else{logger[_0x6f07('0xc')](_0x6f07('0xd'),_0x490181,_0x6f07('0xe'));_0x478f17(_0xcdc7ba['result'][_0x6f07('0x13')]);}})[_0x6f07('0x14')](function(_0x5252a7){logger[_0x6f07('0x11')](_0x6f07('0xd'),_0x490181,_0x5252a7);_0x18537e(_0x5252a7);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index c537299..6926b46 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 _0x1d55=['isAuthenticated','show','put','destroy','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id'];(function(_0x195048,_0x3f647b){var _0x322de7=function(_0x135e53){while(--_0x135e53){_0x195048['push'](_0x195048['shift']());}};_0x322de7(++_0x3f647b);}(_0x1d55,0x16c));var _0x51d5=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0x1d55[_0x4e1d03];return _0x362d4b;};'use strict';var multer=require(_0x51d5('0x0'));var util=require(_0x51d5('0x1'));var path=require(_0x51d5('0x2'));var timeout=require(_0x51d5('0x3'));var express=require(_0x51d5('0x4'));var router=express[_0x51d5('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x51d5('0x6'));var config=require(_0x51d5('0x7'));var controller=require(_0x51d5('0x8'));router[_0x51d5('0x9')](_0x51d5('0xa'),auth[_0x51d5('0xb')](),controller[_0x51d5('0xc')]);router[_0x51d5('0xd')](_0x51d5('0xa'),auth[_0x51d5('0xb')](),controller['update']);router['delete'](_0x51d5('0xa'),auth[_0x51d5('0xb')](),controller[_0x51d5('0xe')]);module['exports']=router; \ No newline at end of file +var _0xd091=['exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','isAuthenticated','show','/:id','update','delete'];(function(_0x53624a,_0x258f4b){var _0x1851b1=function(_0x1e889f){while(--_0x1e889f){_0x53624a['push'](_0x53624a['shift']());}};_0x1851b1(++_0x258f4b);}(_0xd091,0x1f1));var _0x1d09=function(_0x4e4e5a,_0x237d70){_0x4e4e5a=_0x4e4e5a-0x0;var _0xe64290=_0xd091[_0x4e4e5a];return _0xe64290;};'use strict';var multer=require(_0x1d09('0x0'));var util=require(_0x1d09('0x1'));var path=require(_0x1d09('0x2'));var timeout=require('connect-timeout');var express=require(_0x1d09('0x3'));var router=express[_0x1d09('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x1d09('0x5'));var interaction=require(_0x1d09('0x6'));var config=require(_0x1d09('0x7'));var controller=require(_0x1d09('0x8'));router[_0x1d09('0x9')]('/:id',auth[_0x1d09('0xa')](),controller[_0x1d09('0xb')]);router['put'](_0x1d09('0xc'),auth[_0x1d09('0xa')](),controller[_0x1d09('0xd')]);router[_0x1d09('0xe')](_0x1d09('0xc'),auth[_0x1d09('0xa')](),controller['destroy']);module[_0x1d09('0xf')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index 84d12bf..5fa6136 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 _0xeab8=['STRING','sequelize'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0xeab8,0x147));var _0x8eab=function(_0x193377,_0x35d187){_0x193377=_0x193377-0x0;var _0x4a4ae5=_0xeab8[_0x193377];return _0x4a4ae5;};'use strict';var Sequelize=require(_0x8eab('0x0'));module['exports']={'name':{'type':Sequelize[_0x8eab('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x8eab('0x1')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0xc1dc=['sequelize','exports','STRING','BOOLEAN'];(function(_0xb60ae4,_0x48b458){var _0x53d530=function(_0x5c0743){while(--_0x5c0743){_0xb60ae4['push'](_0xb60ae4['shift']());}};_0x53d530(++_0x48b458);}(_0xc1dc,0x84));var _0xcc1d=function(_0xb373eb,_0x364b6e){_0xb373eb=_0xb373eb-0x0;var _0x51059c=_0xc1dc[_0xb373eb];return _0x51059c;};'use strict';var Sequelize=require(_0xcc1d('0x0'));module[_0xcc1d('0x1')]={'name':{'type':Sequelize[_0xcc1d('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0xcc1d('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 cdf9303..4c5fec3 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 _0x2f85=['removeMembers','ChatGroupId','$gte','format','YYYY-MM-DD\x20HH:mm:ss','getMessages','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','error','name','index','map','ChatGroup','rawAttributes','fieldName','type','key','query','filters','attributes','intersection','model','fields','hasOwnProperty','nolimit','order','where','merge','VIRTUAL','filter','include','findAll','rows','catch','show','keys','length','includeAll','find','create','body','params','destroy','describe','getUnread','ChatInternalMessage','user','addMembers','ids','findOne','User','sort','pick','options','getMembers'];(function(_0x118d99,_0x2988df){var _0x26038a=function(_0x41b265){while(--_0x41b265){_0x118d99['push'](_0x118d99['shift']());}};_0x26038a(++_0x2988df);}(_0x2f85,0x67));var _0x52f8=function(_0xd15d83,_0x5f33c3){_0xd15d83=_0xd15d83-0x0;var _0x2dadad=_0x2f85[_0xd15d83];return _0x2dadad;};'use strict';var emlformat=require(_0x52f8('0x0'));var rimraf=require(_0x52f8('0x1'));var zipdir=require(_0x52f8('0x2'));var jsonpatch=require(_0x52f8('0x3'));var rp=require(_0x52f8('0x4'));var moment=require(_0x52f8('0x5'));var BPromise=require(_0x52f8('0x6'));var Mustache=require(_0x52f8('0x7'));var util=require(_0x52f8('0x8'));var path=require(_0x52f8('0x9'));var sox=require(_0x52f8('0xa'));var csv=require(_0x52f8('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x52f8('0xc'));var _=require('lodash');var squel=require(_0x52f8('0xd'));var crypto=require('crypto');var jsforce=require(_0x52f8('0xe'));var deskjs=require(_0x52f8('0xf'));var toCsv=require(_0x52f8('0xb'));var querystring=require(_0x52f8('0x10'));var Papa=require(_0x52f8('0x11'));var Redis=require('ioredis');var authService=require(_0x52f8('0x12'));var qs=require(_0x52f8('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x52f8('0x14'));var logger=require('../../config/logger')(_0x52f8('0x15'));var utils=require(_0x52f8('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x52f8('0x17'));var db=require(_0x52f8('0x18'))['db'];config['redis']=_[_0x52f8('0x19')](config['redis'],{'host':_0x52f8('0x1a'),'port':0x18eb});var socket=require(_0x52f8('0x1b'))(new Redis(config['redis']));require(_0x52f8('0x1c'))[_0x52f8('0x1d')](socket);function respondWithStatusCode(_0x5b89fb,_0x1008e2){_0x1008e2=_0x1008e2||0xcc;return function(_0x5cb999){if(_0x5cb999){return _0x5b89fb['sendStatus'](_0x1008e2);}return _0x5b89fb['status'](_0x1008e2)[_0x52f8('0x1e')]();};}function respondWithResult(_0xd3dea,_0x2565d7){_0x2565d7=_0x2565d7||0xc8;return function(_0x42070e){if(_0x42070e){return _0xd3dea[_0x52f8('0x1f')](_0x2565d7)[_0x52f8('0x20')](_0x42070e);}};}function respondWithFilteredResult(_0x577c8d,_0x44a96e){return function(_0x50a4a3){if(_0x50a4a3){var _0x369ffd=typeof _0x44a96e['offset']===_0x52f8('0x21')&&typeof _0x44a96e[_0x52f8('0x22')]===_0x52f8('0x21');var _0x257592=_0x50a4a3['count'];var _0x3ee06f=_0x369ffd?0x0:_0x44a96e['offset'];var _0x49e784=_0x369ffd?_0x50a4a3[_0x52f8('0x23')]:_0x44a96e[_0x52f8('0x24')]+_0x44a96e[_0x52f8('0x22')];var _0x3484bd;if(_0x49e784>=_0x257592){_0x49e784=_0x257592;_0x3484bd=0xc8;}else{_0x3484bd=0xce;}_0x577c8d[_0x52f8('0x1f')](_0x3484bd);return _0x577c8d[_0x52f8('0x25')](_0x52f8('0x26'),_0x3ee06f+'-'+_0x49e784+'/'+_0x257592)[_0x52f8('0x20')](_0x50a4a3);}return null;};}function patchUpdates(_0x5d52b5){return function(_0x246884){try{jsonpatch[_0x52f8('0x27')](_0x246884,_0x5d52b5,!![]);}catch(_0x4b16eb){return BPromise[_0x52f8('0x28')](_0x4b16eb);}return _0x246884[_0x52f8('0x29')]();};}function saveUpdates(_0x32dfe6,_0x2afc32){return function(_0x22ca57){if(_0x22ca57){return _0x22ca57[_0x52f8('0x2a')](_0x32dfe6)[_0x52f8('0x2b')](function(_0x304736){return _0x304736;});}return null;};}function removeEntity(_0x58f213,_0x272c6c){return function(_0x12b743){if(_0x12b743){return _0x12b743['destroy']()[_0x52f8('0x2b')](function(){_0x58f213[_0x52f8('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ef5a4,_0x18e681){return function(_0x296cd5){if(!_0x296cd5){_0x2ef5a4['sendStatus'](0x194);}return _0x296cd5;};}function handleError(_0x2b54b6,_0xe8de2f){_0xe8de2f=_0xe8de2f||0x1f4;return function(_0x3d5f95){logger[_0x52f8('0x2c')](_0x3d5f95['stack']);if(_0x3d5f95[_0x52f8('0x2d')]){delete _0x3d5f95[_0x52f8('0x2d')];}_0x2b54b6[_0x52f8('0x1f')](_0xe8de2f)['send'](_0x3d5f95);};}exports[_0x52f8('0x2e')]=function(_0x19202a,_0x565cae){var _0xa430c6={},_0xd27fca={},_0x3daf43={'count':0x0,'rows':[]};var _0x557f3a=_[_0x52f8('0x2f')](db[_0x52f8('0x30')][_0x52f8('0x31')],function(_0x3a79d3){return{'name':_0x3a79d3[_0x52f8('0x32')],'type':_0x3a79d3[_0x52f8('0x33')][_0x52f8('0x34')]};});_0xd27fca['model']=_[_0x52f8('0x2f')](_0x557f3a,'name');_0xd27fca[_0x52f8('0x35')]=_['keys'](_0x19202a[_0x52f8('0x35')]);_0xd27fca[_0x52f8('0x36')]=_['intersection'](_0xd27fca['model'],_0xd27fca['query']);_0xa430c6[_0x52f8('0x37')]=_[_0x52f8('0x38')](_0xd27fca[_0x52f8('0x39')],qs[_0x52f8('0x3a')](_0x19202a['query'][_0x52f8('0x3a')]));_0xa430c6[_0x52f8('0x37')]=_0xa430c6[_0x52f8('0x37')]['length']?_0xa430c6[_0x52f8('0x37')]:_0xd27fca[_0x52f8('0x39')];if(!_0x19202a[_0x52f8('0x35')][_0x52f8('0x3b')](_0x52f8('0x3c'))){_0xa430c6[_0x52f8('0x22')]=qs[_0x52f8('0x22')](_0x19202a['query'][_0x52f8('0x22')]);_0xa430c6[_0x52f8('0x24')]=qs[_0x52f8('0x24')](_0x19202a[_0x52f8('0x35')]['offset']);}_0xa430c6[_0x52f8('0x3d')]=qs['sort'](_0x19202a['query']['sort']);_0xa430c6[_0x52f8('0x3e')]=qs[_0x52f8('0x36')](_['pick'](_0x19202a[_0x52f8('0x35')],_0xd27fca[_0x52f8('0x36')]),_0x557f3a);if(_0x19202a['query']['filter']){_0xa430c6[_0x52f8('0x3e')]=_[_0x52f8('0x3f')](_0xa430c6[_0x52f8('0x3e')],{'$or':_['map'](_0x557f3a,function(_0x53e503){if(_0x53e503[_0x52f8('0x33')]!==_0x52f8('0x40')){var _0x3738d7={};_0x3738d7[_0x53e503['name']]={'$like':'%'+_0x19202a['query'][_0x52f8('0x41')]+'%'};return _0x3738d7;}})});}_0xa430c6=_[_0x52f8('0x3f')]({},_0xa430c6,_0x19202a['options']);var _0x366b67={'where':_0xa430c6[_0x52f8('0x3e')]};return db['ChatGroup'][_0x52f8('0x23')](_0x366b67)[_0x52f8('0x2b')](function(_0x36e389){_0x3daf43['count']=_0x36e389;if(_0x19202a[_0x52f8('0x35')]['includeAll']){_0xa430c6[_0x52f8('0x42')]=[{'all':!![]}];}return db[_0x52f8('0x30')][_0x52f8('0x43')](_0xa430c6);})[_0x52f8('0x2b')](function(_0x5b7c37){_0x3daf43[_0x52f8('0x44')]=_0x5b7c37;return _0x3daf43;})[_0x52f8('0x2b')](respondWithFilteredResult(_0x565cae,_0xa430c6))[_0x52f8('0x45')](handleError(_0x565cae,null));};exports[_0x52f8('0x46')]=function(_0x1e8323,_0x225a3d){var _0x42390a={'raw':!![],'where':{'id':_0x1e8323['params']['id']}},_0x485691={};_0x485691[_0x52f8('0x39')]=_[_0x52f8('0x47')](db['ChatGroup'][_0x52f8('0x31')]);_0x485691['query']=_[_0x52f8('0x47')](_0x1e8323[_0x52f8('0x35')]);_0x485691['filters']=_[_0x52f8('0x38')](_0x485691[_0x52f8('0x39')],_0x485691[_0x52f8('0x35')]);_0x42390a['attributes']=_[_0x52f8('0x38')](_0x485691['model'],qs[_0x52f8('0x3a')](_0x1e8323[_0x52f8('0x35')][_0x52f8('0x3a')]));_0x42390a[_0x52f8('0x37')]=_0x42390a[_0x52f8('0x37')][_0x52f8('0x48')]?_0x42390a[_0x52f8('0x37')]:_0x485691[_0x52f8('0x39')];if(_0x1e8323[_0x52f8('0x35')][_0x52f8('0x49')]){_0x42390a[_0x52f8('0x42')]=[{'all':!![]}];}_0x42390a=_['merge']({},_0x42390a,_0x1e8323['options']);return db['ChatGroup'][_0x52f8('0x4a')](_0x42390a)['then'](handleEntityNotFound(_0x225a3d,null))[_0x52f8('0x2b')](respondWithResult(_0x225a3d,null))[_0x52f8('0x45')](handleError(_0x225a3d,null));};exports['create']=function(_0x32f584,_0x4ea9bf){return db[_0x52f8('0x30')][_0x52f8('0x4b')](_0x32f584[_0x52f8('0x4c')],{})[_0x52f8('0x2b')](respondWithResult(_0x4ea9bf,0xc9))['catch'](handleError(_0x4ea9bf,null));};exports['update']=function(_0x17c979,_0x381563){if(_0x17c979[_0x52f8('0x4c')]['id']){delete _0x17c979[_0x52f8('0x4c')]['id'];}return db[_0x52f8('0x30')]['find']({'where':{'id':_0x17c979[_0x52f8('0x4d')]['id']}})[_0x52f8('0x2b')](handleEntityNotFound(_0x381563,null))[_0x52f8('0x2b')](saveUpdates(_0x17c979[_0x52f8('0x4c')],null))['then'](respondWithResult(_0x381563,null))[_0x52f8('0x45')](handleError(_0x381563,null));};exports[_0x52f8('0x4e')]=function(_0xc27366,_0x1937e7){return db[_0x52f8('0x30')]['find']({'where':{'id':_0xc27366['params']['id']}})[_0x52f8('0x2b')](handleEntityNotFound(_0x1937e7,null))[_0x52f8('0x2b')](removeEntity(_0x1937e7,null))[_0x52f8('0x45')](handleError(_0x1937e7,null));};exports[_0x52f8('0x4f')]=function(_0x385c5b,_0x54592e){return db['ChatGroup'][_0x52f8('0x4f')]()[_0x52f8('0x2b')](respondWithResult(_0x54592e,null))[_0x52f8('0x45')](handleError(_0x54592e,null));};exports[_0x52f8('0x50')]=function(_0x3b1e98,_0x570220,_0x13e6bc){return db[_0x52f8('0x51')]['count']({'where':{'ChatGroupId':_0x3b1e98[_0x52f8('0x4d')]['id'],'ToId':_0x3b1e98[_0x52f8('0x52')]['id'],'read':![]}})[_0x52f8('0x2b')](function(_0x8eda11){return{'id':_['toInteger'](_0x3b1e98['params']['id']),'count':_0x8eda11};})[_0x52f8('0x2b')](respondWithResult(_0x570220,null))[_0x52f8('0x45')](handleError(_0x570220,null));};exports[_0x52f8('0x53')]=function(_0x53b642,_0x5449f2,_0x5c98a7){return db['ChatGroup'][_0x52f8('0x4a')]({'where':{'id':_0x53b642['params']['id']}})[_0x52f8('0x2b')](handleEntityNotFound(_0x5449f2,null))[_0x52f8('0x2b')](function(_0x462992){if(_0x462992){return _0x462992[_0x52f8('0x53')](_0x53b642[_0x52f8('0x4c')][_0x52f8('0x54')],_['omit'](_0x53b642['body'],[_0x52f8('0x54'),'id'])||{});}})[_0x52f8('0x2b')](respondWithResult(_0x5449f2,null))[_0x52f8('0x45')](handleError(_0x5449f2,null));};exports['getMembers']=function(_0x43cd31,_0x12bbea,_0x4f9e51){var _0x2b8fac={};var _0x41cdb3={};var _0xa99a32;var _0x5da904;return db[_0x52f8('0x30')][_0x52f8('0x55')]({'where':{'id':_0x43cd31[_0x52f8('0x4d')]['id']}})[_0x52f8('0x2b')](handleEntityNotFound(_0x12bbea,null))['then'](function(_0x22d563){if(_0x22d563){_0xa99a32=_0x22d563;_0x41cdb3[_0x52f8('0x39')]=_[_0x52f8('0x47')](db[_0x52f8('0x56')][_0x52f8('0x31')]);_0x41cdb3['query']=_[_0x52f8('0x47')](_0x43cd31[_0x52f8('0x35')]);_0x41cdb3[_0x52f8('0x36')]=_[_0x52f8('0x38')](_0x41cdb3[_0x52f8('0x39')],_0x41cdb3[_0x52f8('0x35')]);_0x2b8fac['attributes']=_['intersection'](_0x41cdb3[_0x52f8('0x39')],qs[_0x52f8('0x3a')](_0x43cd31[_0x52f8('0x35')][_0x52f8('0x3a')]));_0x2b8fac[_0x52f8('0x37')]=_0x2b8fac[_0x52f8('0x37')][_0x52f8('0x48')]?_0x2b8fac['attributes']:_0x41cdb3['model'];_0x2b8fac[_0x52f8('0x3d')]=qs[_0x52f8('0x57')](_0x43cd31['query'][_0x52f8('0x57')]);_0x2b8fac[_0x52f8('0x3e')]=qs['filters'](_[_0x52f8('0x58')](_0x43cd31[_0x52f8('0x35')],_0x41cdb3[_0x52f8('0x36')]));if(_0x43cd31['query'][_0x52f8('0x41')]){_0x2b8fac[_0x52f8('0x3e')]=_[_0x52f8('0x3f')](_0x2b8fac[_0x52f8('0x3e')],{'$or':_[_0x52f8('0x2f')](_0x2b8fac[_0x52f8('0x37')],function(_0x8fbbba){var _0x4f4afc={};_0x4f4afc[_0x8fbbba]={'$like':'%'+_0x43cd31[_0x52f8('0x35')][_0x52f8('0x41')]+'%'};return _0x4f4afc;})});}_0x2b8fac=_['merge']({},_0x2b8fac,_0x43cd31[_0x52f8('0x59')]);return _0xa99a32[_0x52f8('0x5a')](_0x2b8fac);}})[_0x52f8('0x2b')](function(_0x1846dd){if(_0x1846dd){_0x5da904=_0x1846dd[_0x52f8('0x48')];if(!_0x43cd31[_0x52f8('0x35')][_0x52f8('0x3b')]('nolimit')){_0x2b8fac[_0x52f8('0x22')]=qs['limit'](_0x43cd31[_0x52f8('0x35')]['limit']);_0x2b8fac['offset']=qs[_0x52f8('0x24')](_0x43cd31[_0x52f8('0x35')]['offset']);}return _0xa99a32['getMembers'](_0x2b8fac);}})[_0x52f8('0x2b')](function(_0x30324f){if(_0x30324f){return _0x30324f?{'count':_0x5da904,'rows':_0x30324f}:null;}})[_0x52f8('0x2b')](respondWithResult(_0x12bbea,null))['catch'](handleError(_0x12bbea,null));};exports[_0x52f8('0x5b')]=function(_0x4367ca,_0x2c91e6,_0x19db5b){return db[_0x52f8('0x30')][_0x52f8('0x4a')]({'where':{'id':_0x4367ca[_0x52f8('0x4d')]['id']}})['then'](handleEntityNotFound(_0x2c91e6,null))[_0x52f8('0x2b')](function(_0x44304e){if(_0x44304e){return _0x44304e[_0x52f8('0x5b')](_0x4367ca[_0x52f8('0x35')][_0x52f8('0x54')]);}})[_0x52f8('0x2b')](respondWithStatusCode(_0x2c91e6,null))[_0x52f8('0x45')](handleError(_0x2c91e6,null));};exports['addMessage']=function(_0x49f58d,_0x1a2367,_0x426a23){if(_0x49f58d[_0x52f8('0x4c')]['id']){delete _0x49f58d[_0x52f8('0x4c')]['id'];}return db[_0x52f8('0x30')][_0x52f8('0x4a')]({'where':{'id':_0x49f58d[_0x52f8('0x4d')]['id']}})['then'](handleEntityNotFound(_0x1a2367,null))[_0x52f8('0x2b')](function(_0x1a6901){if(_0x1a6901){_0x49f58d['body'][_0x52f8('0x5c')]=_0x1a6901['id'];return db[_0x52f8('0x51')][_0x52f8('0x4b')](_0x49f58d[_0x52f8('0x4c')]);}})['then'](respondWithResult(_0x1a2367,null))[_0x52f8('0x45')](handleError(_0x1a2367,null));};exports['getMessages']=function(_0x2f595b,_0x30e5dd,_0x342973){var _0x45b494={};var _0x408607={};var _0x1b533f;var _0x422870;return db[_0x52f8('0x30')][_0x52f8('0x55')]({'where':{'id':_0x2f595b[_0x52f8('0x4d')]['id']}})['then'](handleEntityNotFound(_0x30e5dd,null))[_0x52f8('0x2b')](function(_0x16f401){if(_0x16f401){_0x1b533f=_0x16f401;_0x408607[_0x52f8('0x39')]=_[_0x52f8('0x47')](db[_0x52f8('0x51')][_0x52f8('0x31')]);_0x408607[_0x52f8('0x35')]=_[_0x52f8('0x47')](_0x2f595b[_0x52f8('0x35')]);_0x408607[_0x52f8('0x36')]=_[_0x52f8('0x38')](_0x408607[_0x52f8('0x39')],_0x408607['query']);_0x45b494['attributes']=_[_0x52f8('0x38')](_0x408607[_0x52f8('0x39')],qs[_0x52f8('0x3a')](_0x2f595b[_0x52f8('0x35')][_0x52f8('0x3a')]));_0x45b494[_0x52f8('0x37')]=_0x45b494[_0x52f8('0x37')][_0x52f8('0x48')]?_0x45b494['attributes']:_0x408607['model'];_0x45b494[_0x52f8('0x3d')]=qs[_0x52f8('0x57')](_0x2f595b[_0x52f8('0x35')]['sort']);_0x45b494['where']=qs[_0x52f8('0x36')](_[_0x52f8('0x58')](_0x2f595b[_0x52f8('0x35')],_0x408607['filters']));if(_0x2f595b[_0x52f8('0x35')][_0x52f8('0x41')]){_0x45b494[_0x52f8('0x3e')]=_['merge'](_0x45b494[_0x52f8('0x3e')],{'$or':_['map'](_0x45b494[_0x52f8('0x37')],function(_0x32fd38){var _0x20309a={};_0x20309a[_0x32fd38]={'$like':'%'+_0x2f595b[_0x52f8('0x35')][_0x52f8('0x41')]+'%'};return _0x20309a;})});}if(_0x2f595b[_0x52f8('0x35')][_0x52f8('0x5d')]){var _0xa8effd=_0x2f595b['query'][_0x52f8('0x5d')]['split'](',');var _0x128c25={};_0x128c25[_0xa8effd[0x0]]={'$gte':moment(_0xa8effd[0x1])[_0x52f8('0x5e')](_0x52f8('0x5f'))};_0x45b494['where']=_[_0x52f8('0x3f')](_0x45b494[_0x52f8('0x3e')],_0x128c25);}_0x45b494=_['merge']({},_0x45b494,_0x2f595b['options']);return _0x1b533f[_0x52f8('0x60')](_0x45b494);}})[_0x52f8('0x2b')](function(_0x503ac5){if(_0x503ac5){_0x422870=_0x503ac5[_0x52f8('0x48')];if(!_0x2f595b[_0x52f8('0x35')][_0x52f8('0x3b')](_0x52f8('0x3c'))){_0x45b494[_0x52f8('0x22')]=qs[_0x52f8('0x22')](_0x2f595b[_0x52f8('0x35')][_0x52f8('0x22')]);_0x45b494[_0x52f8('0x24')]=qs['offset'](_0x2f595b['query'][_0x52f8('0x24')]);}return _0x1b533f[_0x52f8('0x60')](_0x45b494);}})[_0x52f8('0x2b')](function(_0x7ca38){if(_0x7ca38){return _0x7ca38?{'count':_0x422870,'rows':_0x7ca38}:null;}})[_0x52f8('0x2b')](respondWithResult(_0x30e5dd,null))[_0x52f8('0x45')](handleError(_0x30e5dd,null));}; \ No newline at end of file +var _0x540b=['fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','redis','./chatGroup.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','reject','save','then','destroy','error','name','index','map','ChatGroup','rawAttributes','fieldName','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filter','merge','type','VIRTUAL','options','include','findAll','rows','show','params','includeAll','catch','create','body','find','describe','ChatInternalMessage','user','toInteger','addMembers','ids','User','getMembers','nolimit','removeMembers','addMessage','ChatGroupId','getMessages','findOne','$gte','format','YYYY-MM-DD\x20HH:mm:ss','rimraf','zip-dir'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0x540b,0x10c));var _0xb540=function(_0x53bcd1,_0x588d65){_0x53bcd1=_0x53bcd1-0x0;var _0x1a743a=_0x540b[_0x53bcd1];return _0x1a743a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb540('0x0'));var zipdir=require(_0xb540('0x1'));var jsonpatch=require(_0xb540('0x2'));var rp=require(_0xb540('0x3'));var moment=require(_0xb540('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb540('0x5'));var util=require(_0xb540('0x6'));var path=require('path');var sox=require(_0xb540('0x7'));var csv=require(_0xb540('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb540('0x9'));var _=require('lodash');var squel=require(_0xb540('0xa'));var crypto=require(_0xb540('0xb'));var jsforce=require(_0xb540('0xc'));var deskjs=require(_0xb540('0xd'));var toCsv=require(_0xb540('0x8'));var querystring=require(_0xb540('0xe'));var Papa=require(_0xb540('0xf'));var Redis=require(_0xb540('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xb540('0x11'));var as=require(_0xb540('0x12'));var hardwareService=require(_0xb540('0x13'));var logger=require(_0xb540('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xb540('0x15'));var licenseUtil=require(_0xb540('0x16'));var db=require('../../mysqldb')['db'];config[_0xb540('0x17')]=_['defaults'](config[_0xb540('0x17')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb540('0x17')]));require(_0xb540('0x18'))[_0xb540('0x19')](socket);function respondWithStatusCode(_0x1c2d6d,_0x12f55c){_0x12f55c=_0x12f55c||0xcc;return function(_0x303c64){if(_0x303c64){return _0x1c2d6d[_0xb540('0x1a')](_0x12f55c);}return _0x1c2d6d[_0xb540('0x1b')](_0x12f55c)[_0xb540('0x1c')]();};}function respondWithResult(_0x475ede,_0xe400c2){_0xe400c2=_0xe400c2||0xc8;return function(_0x5db0a7){if(_0x5db0a7){return _0x475ede[_0xb540('0x1b')](_0xe400c2)[_0xb540('0x1d')](_0x5db0a7);}};}function respondWithFilteredResult(_0x2bdfa4,_0x6d21a1){return function(_0x388c21){if(_0x388c21){var _0x480ddc=typeof _0x6d21a1[_0xb540('0x1e')]===_0xb540('0x1f')&&typeof _0x6d21a1['limit']===_0xb540('0x1f');var _0x5aa655=_0x388c21[_0xb540('0x20')];var _0x5cb0a1=_0x480ddc?0x0:_0x6d21a1[_0xb540('0x1e')];var _0x43a076=_0x480ddc?_0x388c21[_0xb540('0x20')]:_0x6d21a1[_0xb540('0x1e')]+_0x6d21a1[_0xb540('0x21')];var _0x35c984;if(_0x43a076>=_0x5aa655){_0x43a076=_0x5aa655;_0x35c984=0xc8;}else{_0x35c984=0xce;}_0x2bdfa4[_0xb540('0x1b')](_0x35c984);return _0x2bdfa4['set']('Content-Range',_0x5cb0a1+'-'+_0x43a076+'/'+_0x5aa655)[_0xb540('0x1d')](_0x388c21);}return null;};}function patchUpdates(_0x2d58d9){return function(_0x110f53){try{jsonpatch['apply'](_0x110f53,_0x2d58d9,!![]);}catch(_0x1e1e9e){return BPromise[_0xb540('0x22')](_0x1e1e9e);}return _0x110f53[_0xb540('0x23')]();};}function saveUpdates(_0x7383a5,_0x5bb074){return function(_0x1b0ce3){if(_0x1b0ce3){return _0x1b0ce3['update'](_0x7383a5)[_0xb540('0x24')](function(_0x277a4b){return _0x277a4b;});}return null;};}function removeEntity(_0x4a1cad,_0x2fae0d){return function(_0x31a304){if(_0x31a304){return _0x31a304[_0xb540('0x25')]()[_0xb540('0x24')](function(){_0x4a1cad[_0xb540('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x48c33c,_0x36e50b){return function(_0x22bcc7){if(!_0x22bcc7){_0x48c33c[_0xb540('0x1a')](0x194);}return _0x22bcc7;};}function handleError(_0x3e74c8,_0x538270){_0x538270=_0x538270||0x1f4;return function(_0x33ae04){logger[_0xb540('0x26')](_0x33ae04['stack']);if(_0x33ae04[_0xb540('0x27')]){delete _0x33ae04[_0xb540('0x27')];}_0x3e74c8[_0xb540('0x1b')](_0x538270)['send'](_0x33ae04);};}exports[_0xb540('0x28')]=function(_0x4f44be,_0xa291a5){var _0x420c47={},_0x18ada0={},_0x324bae={'count':0x0,'rows':[]};var _0x1b3e59=_[_0xb540('0x29')](db[_0xb540('0x2a')][_0xb540('0x2b')],function(_0x34bdbd){return{'name':_0x34bdbd[_0xb540('0x2c')],'type':_0x34bdbd['type'][_0xb540('0x2d')]};});_0x18ada0[_0xb540('0x2e')]=_['map'](_0x1b3e59,'name');_0x18ada0['query']=_[_0xb540('0x2f')](_0x4f44be[_0xb540('0x30')]);_0x18ada0[_0xb540('0x31')]=_[_0xb540('0x32')](_0x18ada0['model'],_0x18ada0['query']);_0x420c47['attributes']=_['intersection'](_0x18ada0[_0xb540('0x2e')],qs[_0xb540('0x33')](_0x4f44be[_0xb540('0x30')]['fields']));_0x420c47[_0xb540('0x34')]=_0x420c47[_0xb540('0x34')][_0xb540('0x35')]?_0x420c47[_0xb540('0x34')]:_0x18ada0['model'];if(!_0x4f44be['query'][_0xb540('0x36')]('nolimit')){_0x420c47[_0xb540('0x21')]=qs[_0xb540('0x21')](_0x4f44be[_0xb540('0x30')]['limit']);_0x420c47[_0xb540('0x1e')]=qs[_0xb540('0x1e')](_0x4f44be['query'][_0xb540('0x1e')]);}_0x420c47[_0xb540('0x37')]=qs[_0xb540('0x38')](_0x4f44be[_0xb540('0x30')][_0xb540('0x38')]);_0x420c47[_0xb540('0x39')]=qs[_0xb540('0x31')](_['pick'](_0x4f44be['query'],_0x18ada0['filters']),_0x1b3e59);if(_0x4f44be['query'][_0xb540('0x3a')]){_0x420c47[_0xb540('0x39')]=_[_0xb540('0x3b')](_0x420c47[_0xb540('0x39')],{'$or':_['map'](_0x1b3e59,function(_0x187c28){if(_0x187c28[_0xb540('0x3c')]!==_0xb540('0x3d')){var _0x67deed={};_0x67deed[_0x187c28[_0xb540('0x27')]]={'$like':'%'+_0x4f44be['query']['filter']+'%'};return _0x67deed;}})});}_0x420c47=_[_0xb540('0x3b')]({},_0x420c47,_0x4f44be[_0xb540('0x3e')]);var _0xaf8462={'where':_0x420c47['where']};return db['ChatGroup'][_0xb540('0x20')](_0xaf8462)['then'](function(_0x326639){_0x324bae['count']=_0x326639;if(_0x4f44be[_0xb540('0x30')]['includeAll']){_0x420c47[_0xb540('0x3f')]=[{'all':!![]}];}return db['ChatGroup'][_0xb540('0x40')](_0x420c47);})[_0xb540('0x24')](function(_0x3e75a4){_0x324bae[_0xb540('0x41')]=_0x3e75a4;return _0x324bae;})[_0xb540('0x24')](respondWithFilteredResult(_0xa291a5,_0x420c47))['catch'](handleError(_0xa291a5,null));};exports[_0xb540('0x42')]=function(_0x235b12,_0x5a6ce1){var _0x371480={'raw':!![],'where':{'id':_0x235b12[_0xb540('0x43')]['id']}},_0x6f1d51={};_0x6f1d51[_0xb540('0x2e')]=_[_0xb540('0x2f')](db['ChatGroup'][_0xb540('0x2b')]);_0x6f1d51[_0xb540('0x30')]=_[_0xb540('0x2f')](_0x235b12[_0xb540('0x30')]);_0x6f1d51[_0xb540('0x31')]=_[_0xb540('0x32')](_0x6f1d51[_0xb540('0x2e')],_0x6f1d51[_0xb540('0x30')]);_0x371480[_0xb540('0x34')]=_['intersection'](_0x6f1d51['model'],qs[_0xb540('0x33')](_0x235b12['query']['fields']));_0x371480[_0xb540('0x34')]=_0x371480[_0xb540('0x34')]['length']?_0x371480[_0xb540('0x34')]:_0x6f1d51[_0xb540('0x2e')];if(_0x235b12[_0xb540('0x30')][_0xb540('0x44')]){_0x371480['include']=[{'all':!![]}];}_0x371480=_[_0xb540('0x3b')]({},_0x371480,_0x235b12[_0xb540('0x3e')]);return db[_0xb540('0x2a')]['find'](_0x371480)[_0xb540('0x24')](handleEntityNotFound(_0x5a6ce1,null))[_0xb540('0x24')](respondWithResult(_0x5a6ce1,null))[_0xb540('0x45')](handleError(_0x5a6ce1,null));};exports[_0xb540('0x46')]=function(_0x517430,_0x17518a){return db['ChatGroup'][_0xb540('0x46')](_0x517430[_0xb540('0x47')],{})['then'](respondWithResult(_0x17518a,0xc9))[_0xb540('0x45')](handleError(_0x17518a,null));};exports['update']=function(_0x14ffc1,_0x271d74){if(_0x14ffc1['body']['id']){delete _0x14ffc1['body']['id'];}return db[_0xb540('0x2a')][_0xb540('0x48')]({'where':{'id':_0x14ffc1[_0xb540('0x43')]['id']}})[_0xb540('0x24')](handleEntityNotFound(_0x271d74,null))[_0xb540('0x24')](saveUpdates(_0x14ffc1[_0xb540('0x47')],null))['then'](respondWithResult(_0x271d74,null))[_0xb540('0x45')](handleError(_0x271d74,null));};exports[_0xb540('0x25')]=function(_0x189eee,_0x34dea8){return db['ChatGroup'][_0xb540('0x48')]({'where':{'id':_0x189eee[_0xb540('0x43')]['id']}})[_0xb540('0x24')](handleEntityNotFound(_0x34dea8,null))['then'](removeEntity(_0x34dea8,null))[_0xb540('0x45')](handleError(_0x34dea8,null));};exports['describe']=function(_0x2d4a52,_0x520b3a){return db[_0xb540('0x2a')][_0xb540('0x49')]()[_0xb540('0x24')](respondWithResult(_0x520b3a,null))[_0xb540('0x45')](handleError(_0x520b3a,null));};exports['getUnread']=function(_0x10916b,_0x2153b3,_0xdef0aa){return db[_0xb540('0x4a')]['count']({'where':{'ChatGroupId':_0x10916b['params']['id'],'ToId':_0x10916b[_0xb540('0x4b')]['id'],'read':![]}})[_0xb540('0x24')](function(_0x251f96){return{'id':_[_0xb540('0x4c')](_0x10916b[_0xb540('0x43')]['id']),'count':_0x251f96};})[_0xb540('0x24')](respondWithResult(_0x2153b3,null))[_0xb540('0x45')](handleError(_0x2153b3,null));};exports[_0xb540('0x4d')]=function(_0x1df838,_0xb3f315,_0x498a21){return db[_0xb540('0x2a')][_0xb540('0x48')]({'where':{'id':_0x1df838[_0xb540('0x43')]['id']}})[_0xb540('0x24')](handleEntityNotFound(_0xb3f315,null))[_0xb540('0x24')](function(_0x47c240){if(_0x47c240){return _0x47c240['addMembers'](_0x1df838[_0xb540('0x47')][_0xb540('0x4e')],_['omit'](_0x1df838[_0xb540('0x47')],[_0xb540('0x4e'),'id'])||{});}})[_0xb540('0x24')](respondWithResult(_0xb3f315,null))[_0xb540('0x45')](handleError(_0xb3f315,null));};exports['getMembers']=function(_0x5af398,_0x22d5db,_0x5ac231){var _0x251a18={};var _0xd5d10a={};var _0x2d7814;var _0x384725;return db[_0xb540('0x2a')]['findOne']({'where':{'id':_0x5af398[_0xb540('0x43')]['id']}})['then'](handleEntityNotFound(_0x22d5db,null))[_0xb540('0x24')](function(_0x4ff27a){if(_0x4ff27a){_0x2d7814=_0x4ff27a;_0xd5d10a[_0xb540('0x2e')]=_['keys'](db[_0xb540('0x4f')][_0xb540('0x2b')]);_0xd5d10a[_0xb540('0x30')]=_[_0xb540('0x2f')](_0x5af398[_0xb540('0x30')]);_0xd5d10a[_0xb540('0x31')]=_[_0xb540('0x32')](_0xd5d10a[_0xb540('0x2e')],_0xd5d10a['query']);_0x251a18[_0xb540('0x34')]=_[_0xb540('0x32')](_0xd5d10a[_0xb540('0x2e')],qs[_0xb540('0x33')](_0x5af398[_0xb540('0x30')][_0xb540('0x33')]));_0x251a18['attributes']=_0x251a18[_0xb540('0x34')]['length']?_0x251a18[_0xb540('0x34')]:_0xd5d10a[_0xb540('0x2e')];_0x251a18[_0xb540('0x37')]=qs['sort'](_0x5af398[_0xb540('0x30')][_0xb540('0x38')]);_0x251a18[_0xb540('0x39')]=qs[_0xb540('0x31')](_['pick'](_0x5af398['query'],_0xd5d10a[_0xb540('0x31')]));if(_0x5af398[_0xb540('0x30')][_0xb540('0x3a')]){_0x251a18['where']=_[_0xb540('0x3b')](_0x251a18[_0xb540('0x39')],{'$or':_[_0xb540('0x29')](_0x251a18[_0xb540('0x34')],function(_0xddfd8f){var _0x407292={};_0x407292[_0xddfd8f]={'$like':'%'+_0x5af398['query'][_0xb540('0x3a')]+'%'};return _0x407292;})});}_0x251a18=_['merge']({},_0x251a18,_0x5af398[_0xb540('0x3e')]);return _0x2d7814[_0xb540('0x50')](_0x251a18);}})['then'](function(_0x4f4db9){if(_0x4f4db9){_0x384725=_0x4f4db9[_0xb540('0x35')];if(!_0x5af398[_0xb540('0x30')][_0xb540('0x36')](_0xb540('0x51'))){_0x251a18[_0xb540('0x21')]=qs[_0xb540('0x21')](_0x5af398[_0xb540('0x30')][_0xb540('0x21')]);_0x251a18[_0xb540('0x1e')]=qs[_0xb540('0x1e')](_0x5af398['query'][_0xb540('0x1e')]);}return _0x2d7814['getMembers'](_0x251a18);}})[_0xb540('0x24')](function(_0x240f20){if(_0x240f20){return _0x240f20?{'count':_0x384725,'rows':_0x240f20}:null;}})[_0xb540('0x24')](respondWithResult(_0x22d5db,null))[_0xb540('0x45')](handleError(_0x22d5db,null));};exports[_0xb540('0x52')]=function(_0x457f9f,_0x28d070,_0xf341b5){return db[_0xb540('0x2a')][_0xb540('0x48')]({'where':{'id':_0x457f9f[_0xb540('0x43')]['id']}})[_0xb540('0x24')](handleEntityNotFound(_0x28d070,null))['then'](function(_0x4c55ff){if(_0x4c55ff){return _0x4c55ff[_0xb540('0x52')](_0x457f9f[_0xb540('0x30')]['ids']);}})['then'](respondWithStatusCode(_0x28d070,null))['catch'](handleError(_0x28d070,null));};exports[_0xb540('0x53')]=function(_0x2e3735,_0x1a0636,_0x1d425b){if(_0x2e3735[_0xb540('0x47')]['id']){delete _0x2e3735['body']['id'];}return db[_0xb540('0x2a')][_0xb540('0x48')]({'where':{'id':_0x2e3735[_0xb540('0x43')]['id']}})[_0xb540('0x24')](handleEntityNotFound(_0x1a0636,null))[_0xb540('0x24')](function(_0xab0a5){if(_0xab0a5){_0x2e3735['body'][_0xb540('0x54')]=_0xab0a5['id'];return db[_0xb540('0x4a')]['create'](_0x2e3735[_0xb540('0x47')]);}})[_0xb540('0x24')](respondWithResult(_0x1a0636,null))[_0xb540('0x45')](handleError(_0x1a0636,null));};exports[_0xb540('0x55')]=function(_0x435781,_0x136e95,_0x3b6c80){var _0x4cd811={};var _0x125e46={};var _0x4f9936;var _0x3f536a;return db[_0xb540('0x2a')][_0xb540('0x56')]({'where':{'id':_0x435781['params']['id']}})['then'](handleEntityNotFound(_0x136e95,null))[_0xb540('0x24')](function(_0x59e7b1){if(_0x59e7b1){_0x4f9936=_0x59e7b1;_0x125e46[_0xb540('0x2e')]=_[_0xb540('0x2f')](db['ChatInternalMessage']['rawAttributes']);_0x125e46[_0xb540('0x30')]=_[_0xb540('0x2f')](_0x435781[_0xb540('0x30')]);_0x125e46[_0xb540('0x31')]=_[_0xb540('0x32')](_0x125e46[_0xb540('0x2e')],_0x125e46['query']);_0x4cd811[_0xb540('0x34')]=_[_0xb540('0x32')](_0x125e46[_0xb540('0x2e')],qs[_0xb540('0x33')](_0x435781[_0xb540('0x30')]['fields']));_0x4cd811[_0xb540('0x34')]=_0x4cd811[_0xb540('0x34')]['length']?_0x4cd811[_0xb540('0x34')]:_0x125e46[_0xb540('0x2e')];_0x4cd811[_0xb540('0x37')]=qs[_0xb540('0x38')](_0x435781[_0xb540('0x30')][_0xb540('0x38')]);_0x4cd811['where']=qs[_0xb540('0x31')](_['pick'](_0x435781[_0xb540('0x30')],_0x125e46[_0xb540('0x31')]));if(_0x435781[_0xb540('0x30')][_0xb540('0x3a')]){_0x4cd811[_0xb540('0x39')]=_['merge'](_0x4cd811[_0xb540('0x39')],{'$or':_[_0xb540('0x29')](_0x4cd811[_0xb540('0x34')],function(_0x3d42b9){var _0x534f2c={};_0x534f2c[_0x3d42b9]={'$like':'%'+_0x435781['query'][_0xb540('0x3a')]+'%'};return _0x534f2c;})});}if(_0x435781[_0xb540('0x30')][_0xb540('0x57')]){var _0x3e9766=_0x435781[_0xb540('0x30')][_0xb540('0x57')]['split'](',');var _0x2074b4={};_0x2074b4[_0x3e9766[0x0]]={'$gte':moment(_0x3e9766[0x1])[_0xb540('0x58')](_0xb540('0x59'))};_0x4cd811[_0xb540('0x39')]=_[_0xb540('0x3b')](_0x4cd811[_0xb540('0x39')],_0x2074b4);}_0x4cd811=_[_0xb540('0x3b')]({},_0x4cd811,_0x435781[_0xb540('0x3e')]);return _0x4f9936['getMessages'](_0x4cd811);}})[_0xb540('0x24')](function(_0x22a773){if(_0x22a773){_0x3f536a=_0x22a773[_0xb540('0x35')];if(!_0x435781[_0xb540('0x30')][_0xb540('0x36')](_0xb540('0x51'))){_0x4cd811[_0xb540('0x21')]=qs[_0xb540('0x21')](_0x435781[_0xb540('0x30')][_0xb540('0x21')]);_0x4cd811[_0xb540('0x1e')]=qs['offset'](_0x435781['query'][_0xb540('0x1e')]);}return _0x4f9936[_0xb540('0x55')](_0x4cd811);}})['then'](function(_0x291411){if(_0x291411){return _0x291411?{'count':_0x3f536a,'rows':_0x291411}:null;}})[_0xb540('0x24')](respondWithResult(_0x136e95,null))[_0xb540('0x45')](handleError(_0x136e95,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 71b08ea..f281e34 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 _0xa7c5=['emit','hasOwnProperty','hook','events','save','update','remove'];(function(_0x1b5aea,_0x1afe6f){var _0x51cae9=function(_0x1494a6){while(--_0x1494a6){_0x1b5aea['push'](_0x1b5aea['shift']());}};_0x51cae9(++_0x1afe6f);}(_0xa7c5,0x1e6));var _0x5a7c=function(_0x16923f,_0xe9d316){_0x16923f=_0x16923f-0x0;var _0x1cf14a=_0xa7c5[_0x16923f];return _0x1cf14a;};'use strict';var EventEmitter=require(_0x5a7c('0x0'));var ChatGroup=require('../../mysqldb')['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5a7c('0x1'),'afterUpdate':_0x5a7c('0x2'),'afterDestroy':_0x5a7c('0x3')};function emitEvent(_0x2a0cc5){return function(_0x1bb1f4,_0x2944cf,_0x65a0cc){ChatGroupEvents[_0x5a7c('0x4')](_0x2a0cc5+':'+_0x1bb1f4['id'],_0x1bb1f4);ChatGroupEvents['emit'](_0x2a0cc5,_0x1bb1f4);_0x65a0cc(null);};}for(var e in events){if(events[_0x5a7c('0x5')](e)){var event=events[e];ChatGroup[_0x5a7c('0x6')](e,emitEvent(event));}}module['exports']=ChatGroupEvents; \ No newline at end of file +var _0x41d0=['remove','emit','hasOwnProperty','exports','events','../../mysqldb','ChatGroup','setMaxListeners','update'];(function(_0x39d037,_0x51afaf){var _0x1cd1e1=function(_0x59a3f7){while(--_0x59a3f7){_0x39d037['push'](_0x39d037['shift']());}};_0x1cd1e1(++_0x51afaf);}(_0x41d0,0x1c6));var _0x041d=function(_0x548d7d,_0x2d41fc){_0x548d7d=_0x548d7d-0x0;var _0xb1c878=_0x41d0[_0x548d7d];return _0xb1c878;};'use strict';var EventEmitter=require(_0x041d('0x0'));var ChatGroup=require(_0x041d('0x1'))['db'][_0x041d('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x041d('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x041d('0x4'),'afterDestroy':_0x041d('0x5')};function emitEvent(_0x12e55d){return function(_0x397dad,_0x41e587,_0x3a22a4){ChatGroupEvents[_0x041d('0x6')](_0x12e55d+':'+_0x397dad['id'],_0x397dad);ChatGroupEvents[_0x041d('0x6')](_0x12e55d,_0x397dad);_0x3a22a4(null);};}for(var e in events){if(events[_0x041d('0x7')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0x041d('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 095e0e9..3f0e4b6 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 _0xefac=['chat_groups','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','ChatGroup'];(function(_0x58a028,_0x1d51a1){var _0x1390cc=function(_0x3a4fe1){while(--_0x3a4fe1){_0x58a028['push'](_0x58a028['shift']());}};_0x1390cc(++_0x1d51a1);}(_0xefac,0x169));var _0xcefa=function(_0x5310c9,_0x5a848f){_0x5310c9=_0x5310c9-0x0;var _0x1ea28b=_0xefac[_0x5310c9];return _0x1ea28b;};'use strict';var _=require(_0xcefa('0x0'));var util=require(_0xcefa('0x1'));var logger=require(_0xcefa('0x2'))(_0xcefa('0x3'));var moment=require(_0xcefa('0x4'));var BPromise=require(_0xcefa('0x5'));var rp=require(_0xcefa('0x6'));var fs=require('fs');var path=require(_0xcefa('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./chatGroup.attributes');module['exports']=function(_0x3ca910,_0x419d5f){return _0x3ca910['define'](_0xcefa('0x8'),attributes,{'tableName':_0xcefa('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7ff0=['lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatGroup.attributes','exports','chat_groups'];(function(_0x16ad42,_0x4291b0){var _0x223bcc=function(_0xc679e6){while(--_0xc679e6){_0x16ad42['push'](_0x16ad42['shift']());}};_0x223bcc(++_0x4291b0);}(_0x7ff0,0x1b8));var _0x07ff=function(_0x136619,_0x31c9b2){_0x136619=_0x136619-0x0;var _0x38c4a5=_0x7ff0[_0x136619];return _0x38c4a5;};'use strict';var _=require(_0x07ff('0x0'));var util=require('util');var logger=require(_0x07ff('0x1'))(_0x07ff('0x2'));var moment=require('moment');var BPromise=require(_0x07ff('0x3'));var rp=require(_0x07ff('0x4'));var fs=require('fs');var path=require(_0x07ff('0x5'));var rimraf=require(_0x07ff('0x6'));var config=require(_0x07ff('0x7'));var attributes=require(_0x07ff('0x8'));module[_0x07ff('0x9')]=function(_0x3a6469,_0x454b17){return _0x3a6469['define']('ChatGroup',attributes,{'tableName':_0x07ff('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js index 2a2e73a..39348fe 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 _0x57cf=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','socket.io-emitter','request','then','ChatGroup,\x20%s,\x20%s','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','message','info','request\x20sent','result','catch','lodash','util','moment'];(function(_0xbb091,_0x3fe7ee){var _0x467a04=function(_0x3a978d){while(--_0x3a978d){_0xbb091['push'](_0xbb091['shift']());}};_0x467a04(++_0x3fe7ee);}(_0x57cf,0x11b));var _0xf57c=function(_0x58b44a,_0x1a7aa6){_0x58b44a=_0x58b44a-0x0;var _0xd6779d=_0x57cf[_0x58b44a];return _0xd6779d;};'use strict';var _=require(_0xf57c('0x0'));var util=require(_0xf57c('0x1'));var moment=require(_0xf57c('0x2'));var BPromise=require(_0xf57c('0x3'));var rs=require(_0xf57c('0x4'));var fs=require('fs');var Redis=require(_0xf57c('0x5'));var db=require(_0xf57c('0x6'))['db'];var utils=require(_0xf57c('0x7'));var logger=require(_0xf57c('0x8'))(_0xf57c('0x9'));var config=require('../../config/environment');var jayson=require(_0xf57c('0xa'));var client=jayson['client'][_0xf57c('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0xf57c('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xf57c('0xd'))(new Redis(config[_0xf57c('0xc')]));require('./chatGroup.socket')['register'](socket);function respondWithRpcPromise(_0x1accbd,_0x3256d4,_0x259a60){return new BPromise(function(_0x2a19ef,_0x5f20f2){return client[_0xf57c('0xe')](_0x1accbd,_0x259a60)[_0xf57c('0xf')](function(_0x224d82){logger['info'](_0xf57c('0x10'),_0x3256d4,'request\x20sent');logger[_0xf57c('0x11')](_0xf57c('0x12'),_0x3256d4,'request\x20sent',JSON[_0xf57c('0x13')](_0x224d82));if(_0x224d82['error']){if(_0x224d82[_0xf57c('0x14')]['code']===0x1f4){logger[_0xf57c('0x14')](_0xf57c('0x10'),_0x3256d4,_0x224d82[_0xf57c('0x14')][_0xf57c('0x15')]);return _0x5f20f2(_0x224d82[_0xf57c('0x14')][_0xf57c('0x15')]);}logger[_0xf57c('0x14')](_0xf57c('0x10'),_0x3256d4,_0x224d82['error'][_0xf57c('0x15')]);return _0x2a19ef(_0x224d82['error'][_0xf57c('0x15')]);}else{logger[_0xf57c('0x16')]('ChatGroup,\x20%s,\x20%s',_0x3256d4,_0xf57c('0x17'));_0x2a19ef(_0x224d82[_0xf57c('0x18')][_0xf57c('0x15')]);}})[_0xf57c('0x19')](function(_0x9c27f0){logger['error'](_0xf57c('0x10'),_0x3256d4,_0x9c27f0);_0x5f20f2(_0x9c27f0);});});} \ No newline at end of file +var _0x3f2b=['localhost','socket.io-emitter','./chatGroup.socket','register','request','then','info','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','error','code','ChatGroup,\x20%s,\x20%s','message','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis'];(function(_0x39bc94,_0x4f8c05){var _0x311313=function(_0x13ba64){while(--_0x13ba64){_0x39bc94['push'](_0x39bc94['shift']());}};_0x311313(++_0x4f8c05);}(_0x3f2b,0x72));var _0xb3f2=function(_0x1410f9,_0x2e7fa3){_0x1410f9=_0x1410f9-0x0;var _0x2faf56=_0x3f2b[_0x1410f9];return _0x2faf56;};'use strict';var _=require(_0xb3f2('0x0'));var util=require('util');var moment=require(_0xb3f2('0x1'));var BPromise=require(_0xb3f2('0x2'));var rs=require(_0xb3f2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb3f2('0x4'))['db'];var utils=require(_0xb3f2('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xb3f2('0x6'));var jayson=require(_0xb3f2('0x7'));var client=jayson[_0xb3f2('0x8')][_0xb3f2('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0xb3f2('0xa')],{'host':_0xb3f2('0xb'),'port':0x18eb});var socket=require(_0xb3f2('0xc'))(new Redis(config[_0xb3f2('0xa')]));require(_0xb3f2('0xd'))[_0xb3f2('0xe')](socket);function respondWithRpcPromise(_0x415fd9,_0x314877,_0x94fada){return new BPromise(function(_0xf9b4be,_0x185c58){return client[_0xb3f2('0xf')](_0x415fd9,_0x94fada)[_0xb3f2('0x10')](function(_0xaf3b86){logger[_0xb3f2('0x11')]('ChatGroup,\x20%s,\x20%s',_0x314877,_0xb3f2('0x12'));logger['debug'](_0xb3f2('0x13'),_0x314877,_0xb3f2('0x12'),JSON['stringify'](_0xaf3b86));if(_0xaf3b86[_0xb3f2('0x14')]){if(_0xaf3b86[_0xb3f2('0x14')][_0xb3f2('0x15')]===0x1f4){logger['error'](_0xb3f2('0x16'),_0x314877,_0xaf3b86[_0xb3f2('0x14')][_0xb3f2('0x17')]);return _0x185c58(_0xaf3b86[_0xb3f2('0x14')][_0xb3f2('0x17')]);}logger[_0xb3f2('0x14')](_0xb3f2('0x16'),_0x314877,_0xaf3b86['error'][_0xb3f2('0x17')]);return _0xf9b4be(_0xaf3b86[_0xb3f2('0x14')][_0xb3f2('0x17')]);}else{logger[_0xb3f2('0x11')](_0xb3f2('0x16'),_0x314877,_0xb3f2('0x12'));_0xf9b4be(_0xaf3b86['result']['message']);}})[_0xb3f2('0x18')](function(_0x3a861a){logger[_0xb3f2('0x14')]('ChatGroup,\x20%s,\x20%s',_0x314877,_0x3a861a);_0x185c58(_0x3a861a);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index 780148d..b2df35b 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 _0x5a77=['./chatGroup.events','save','update','register','length','chatGroup:'];(function(_0x5b2a7c,_0xa75601){var _0x4d7661=function(_0x10be25){while(--_0x10be25){_0x5b2a7c['push'](_0x5b2a7c['shift']());}};_0x4d7661(++_0xa75601);}(_0x5a77,0x15c));var _0x75a7=function(_0x467666,_0x701dd4){_0x467666=_0x467666-0x0;var _0x24f9f0=_0x5a77[_0x467666];return _0x24f9f0;};'use strict';var ChatGroupEvents=require(_0x75a7('0x0'));var events=[_0x75a7('0x1'),'remove',_0x75a7('0x2')];function createListener(_0x283800,_0x556b10){return function(_0x626fc7){_0x556b10['emit'](_0x283800,_0x626fc7);};}function removeListener(_0x6ad2aa,_0xb7c295){return function(){ChatGroupEvents['removeListener'](_0x6ad2aa,_0xb7c295);};}exports[_0x75a7('0x3')]=function(_0x3f4cb7){for(var _0x1d6cfc=0x0,_0x37734d=events[_0x75a7('0x4')];_0x1d6cfc<_0x37734d;_0x1d6cfc++){var _0x15e764=events[_0x1d6cfc];var _0x10bed0=createListener(_0x75a7('0x5')+_0x15e764,_0x3f4cb7);ChatGroupEvents['on'](_0x15e764,_0x10bed0);}}; \ No newline at end of file +var _0xca63=['length','chatGroup:','./chatGroup.events','save','remove','emit','removeListener','register'];(function(_0x268dcd,_0x397c2d){var _0x4d6e1f=function(_0x550112){while(--_0x550112){_0x268dcd['push'](_0x268dcd['shift']());}};_0x4d6e1f(++_0x397c2d);}(_0xca63,0x1ba));var _0x3ca6=function(_0x20e105,_0x257f1a){_0x20e105=_0x20e105-0x0;var _0x35899a=_0xca63[_0x20e105];return _0x35899a;};'use strict';var ChatGroupEvents=require(_0x3ca6('0x0'));var events=[_0x3ca6('0x1'),_0x3ca6('0x2'),'update'];function createListener(_0xd1b1cb,_0xeadf1f){return function(_0x3b1ebc){_0xeadf1f[_0x3ca6('0x3')](_0xd1b1cb,_0x3b1ebc);};}function removeListener(_0x3d2e7e,_0x31a6a9){return function(){ChatGroupEvents[_0x3ca6('0x4')](_0x3d2e7e,_0x31a6a9);};}exports[_0x3ca6('0x5')]=function(_0x5baff6){for(var _0x371515=0x0,_0x5568ee=events[_0x3ca6('0x6')];_0x371515<_0x5568ee;_0x371515++){var _0x2fc735=events[_0x371515];var _0x487202=createListener(_0x3ca6('0x7')+_0x2fc735,_0x5baff6);ChatGroupEvents['on'](_0x2fc735,_0x487202);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 4baf63e..9db756d 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 _0xa039=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/unread','getMembers','/:id/messages','post','create','/:id/members','addMembers','put','update','delete','destroy','exports','multer','fs-extra','../../components/auth/service'];(function(_0x11fc2c,_0x8dfa82){var _0x3df667=function(_0x1b46a3){while(--_0x1b46a3){_0x11fc2c['push'](_0x11fc2c['shift']());}};_0x3df667(++_0x8dfa82);}(_0xa039,0x147));var _0x9a03=function(_0xbeebc1,_0x5ec6cb){_0xbeebc1=_0xbeebc1-0x0;var _0x417439=_0xa039[_0xbeebc1];return _0x417439;};'use strict';var multer=require(_0x9a03('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x9a03('0x1'));var auth=require(_0x9a03('0x2'));var interaction=require(_0x9a03('0x3'));var config=require(_0x9a03('0x4'));var controller=require('./chatGroup.controller');router[_0x9a03('0x5')]('/',auth[_0x9a03('0x6')](),controller[_0x9a03('0x7')]);router[_0x9a03('0x5')]('/describe',auth[_0x9a03('0x6')](),controller['describe']);router[_0x9a03('0x5')](_0x9a03('0x8'),auth['isAuthenticated'](),controller[_0x9a03('0x9')]);router[_0x9a03('0x5')](_0x9a03('0xa'),auth[_0x9a03('0x6')](),controller['getUnread']);router['get']('/:id/members',auth['isAuthenticated'](),controller[_0x9a03('0xb')]);router[_0x9a03('0x5')](_0x9a03('0xc'),auth['isAuthenticated'](),controller['getMessages']);router[_0x9a03('0xd')]('/',auth[_0x9a03('0x6')](),controller[_0x9a03('0xe')]);router[_0x9a03('0xd')](_0x9a03('0xf'),auth[_0x9a03('0x6')](),controller[_0x9a03('0x10')]);router['post']('/:id/messages',auth[_0x9a03('0x6')](),controller['addMessage']);router[_0x9a03('0x11')](_0x9a03('0x8'),auth[_0x9a03('0x6')](),controller[_0x9a03('0x12')]);router[_0x9a03('0x13')](_0x9a03('0x8'),auth[_0x9a03('0x6')](),controller[_0x9a03('0x14')]);router['delete'](_0x9a03('0xf'),auth[_0x9a03('0x6')](),controller['removeMembers']);module[_0x9a03('0x15')]=router; \ No newline at end of file +var _0x5e85=['index','get','/describe','describe','/:id','show','/:id/unread','getUnread','/:id/members','/:id/messages','post','create','addMembers','put','delete','destroy','removeMembers','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','isAuthenticated'];(function(_0x43eb68,_0xa313a6){var _0xca41ce=function(_0xf384a7){while(--_0xf384a7){_0x43eb68['push'](_0x43eb68['shift']());}};_0xca41ce(++_0xa313a6);}(_0x5e85,0x171));var _0x55e8=function(_0xbee0d5,_0x34dd17){_0xbee0d5=_0xbee0d5-0x0;var _0x565ca0=_0x5e85[_0xbee0d5];return _0x565ca0;};'use strict';var multer=require(_0x55e8('0x0'));var util=require(_0x55e8('0x1'));var path=require(_0x55e8('0x2'));var timeout=require(_0x55e8('0x3'));var express=require(_0x55e8('0x4'));var router=express[_0x55e8('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x55e8('0x6'));var interaction=require(_0x55e8('0x7'));var config=require('../../config/environment');var controller=require('./chatGroup.controller');router['get']('/',auth[_0x55e8('0x8')](),controller[_0x55e8('0x9')]);router[_0x55e8('0xa')](_0x55e8('0xb'),auth[_0x55e8('0x8')](),controller[_0x55e8('0xc')]);router[_0x55e8('0xa')](_0x55e8('0xd'),auth[_0x55e8('0x8')](),controller[_0x55e8('0xe')]);router[_0x55e8('0xa')](_0x55e8('0xf'),auth[_0x55e8('0x8')](),controller[_0x55e8('0x10')]);router[_0x55e8('0xa')](_0x55e8('0x11'),auth['isAuthenticated'](),controller['getMembers']);router[_0x55e8('0xa')](_0x55e8('0x12'),auth[_0x55e8('0x8')](),controller['getMessages']);router[_0x55e8('0x13')]('/',auth[_0x55e8('0x8')](),controller[_0x55e8('0x14')]);router['post'](_0x55e8('0x11'),auth[_0x55e8('0x8')](),controller[_0x55e8('0x15')]);router[_0x55e8('0x13')]('/:id/messages',auth[_0x55e8('0x8')](),controller['addMessage']);router[_0x55e8('0x16')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x55e8('0x17')](_0x55e8('0xd'),auth[_0x55e8('0x8')](),controller[_0x55e8('0x18')]);router['delete'](_0x55e8('0x11'),auth[_0x55e8('0x8')](),controller[_0x55e8('0x19')]);module[_0x55e8('0x1a')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index 76d5877..01d4333 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 _0x423d=['STRING','DATE','long','INTEGER','exports','BOOLEAN','ENUM','thumb','star','TEXT'];(function(_0x19cc59,_0x23dc8e){var _0x251ef5=function(_0x207a3d){while(--_0x207a3d){_0x19cc59['push'](_0x19cc59['shift']());}};_0x251ef5(++_0x23dc8e);}(_0x423d,0xea));var _0xd423=function(_0x324fd7,_0x21115e){_0x324fd7=_0x324fd7-0x0;var _0x437acc=_0x423d[_0x324fd7];return _0x437acc;};'use strict';var Sequelize=require('sequelize');module[_0xd423('0x0')]={'closed':{'type':Sequelize[_0xd423('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0xd423('0x2')]('star',_0xd423('0x3')),'defaultValue':_0xd423('0x4')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0xd423('0x5')]},'mailTranscript':{'type':Sequelize[_0xd423('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xd423('0x7')]},'disposition':{'type':Sequelize[_0xd423('0x6')]},'secondDisposition':{'type':Sequelize[_0xd423('0x6')]},'thirdDisposition':{'type':Sequelize[_0xd423('0x6')]},'note':{'type':Sequelize[_0xd423('0x6')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0xd423('0x6')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0xd423('0x6')]},'deviceVendor':{'type':Sequelize[_0xd423('0x6')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0xd423('0x5')]},'customerIp':{'type':Sequelize[_0xd423('0x6')]},'formData':{'type':Sequelize['TEXT'](_0xd423('0x8'))},'read1stAt':{'type':Sequelize[_0xd423('0x7')]},'lastMsgAt':{'type':Sequelize[_0xd423('0x7')]},'lastMsgDirection':{'type':Sequelize[_0xd423('0x2')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xd423('0x6')]},'customerPort':{'type':Sequelize[_0xd423('0x6')]},'vidaooSessionId':{'type':Sequelize[_0xd423('0x5')]},'autoreplyExecuted':{'type':Sequelize[_0xd423('0x1')],'defaultValue':![]},'queueId':{'type':Sequelize[_0xd423('0x9')]}}; \ No newline at end of file +var _0xa802=['INTEGER','star','TEXT','STRING','DATE','ENUM','out','sequelize','BOOLEAN'];(function(_0x2e167e,_0x5a1f7a){var _0x106386=function(_0x1c0291){while(--_0x1c0291){_0x2e167e['push'](_0x2e167e['shift']());}};_0x106386(++_0x5a1f7a);}(_0xa802,0xf1));var _0x2a80=function(_0x15f689,_0x1038ab){_0x15f689=_0x15f689-0x0;var _0xce5f43=_0xa802[_0x15f689];return _0xce5f43;};'use strict';var Sequelize=require(_0x2a80('0x0'));module['exports']={'closed':{'type':Sequelize[_0x2a80('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x2a80('0x2')]},'ratingType':{'type':Sequelize['ENUM'](_0x2a80('0x3'),'thumb'),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0x2a80('0x4')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x2a80('0x5')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x2a80('0x5')]},'secondDisposition':{'type':Sequelize[_0x2a80('0x5')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0x2a80('0x5')]},'browserVersion':{'type':Sequelize[_0x2a80('0x5')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0x2a80('0x5')]},'deviceModel':{'type':Sequelize[_0x2a80('0x5')]},'deviceVendor':{'type':Sequelize[_0x2a80('0x5')]},'deviceType':{'type':Sequelize[_0x2a80('0x5')]},'referer':{'type':Sequelize[_0x2a80('0x4')]},'customerIp':{'type':Sequelize[_0x2a80('0x5')]},'formData':{'type':Sequelize[_0x2a80('0x4')]('long')},'read1stAt':{'type':Sequelize[_0x2a80('0x6')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x2a80('0x7')]('in',_0x2a80('0x8')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x2a80('0x5')]},'customerPort':{'type':Sequelize[_0x2a80('0x5')]},'vidaooSessionId':{'type':Sequelize[_0x2a80('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0x2a80('0x1')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x2a80('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index 713c2cd..5dde5a1 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 _0x2d9a=['vidaooMetadata','vidaooApiKey','fullname','email','contact','POST','https://api-vidaoo.xcally.com/api/v1/meetings','follow','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Sequelize','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','updateAttributes','CmContact','Contact','abandonInteraction,\x20%s,\x20%s,\x20%s','abandon','entity\x20not\x20found','UserId','closed','disposition','AbandonInteraction','originalname','basename','file','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','mailTranscript','format','transcript-%s.txt','now','pathTranscript','User','ChatWebsiteId','Messages','%s%d','agentAlias','System','customer','ContactId','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailServerOut','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','omit','ids','getMessages','hasOwnProperty','nolimit','order','sort','where','ChatInteractionId','filter','$gte','YYYY-MM-DD\x20HH:mm:ss','rows','getMyMessages','pick','includeAgent','push','addTags','setTags','spread','Tag','color','emit','chatInteractionTags:save','removeTags','unix','toString','server','files','tmp','attachments','transcript-%d-%s.zip','firstName','lastName','read','Account','Owner','get','mkdirSync','Chat','N.A.','closedAt','browserName','osName','customerIp','customerPort','tail','existsSync','createReadStream','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../mysqldb','redis','defaults','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','request','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','status','offset','undefined','limit','count','set','Content-Range','json','update','then','destroy','sendStatus','stack','name','render','merge','body','agent','interaction','account','index','map','rawAttributes','fieldName','type','key','getOptions','findAll','chat','user','params','model','keys','ChatInteraction','query','filters','intersection','attributes','fields','length','includeAll','include','options','find','create','describe','findOne','ChatWebsite','vidaooEscalation','vidaooTopic','vidaooNote'];(function(_0x41bd5b,_0x1ceafe){var _0x425794=function(_0x43a933){while(--_0x43a933){_0x41bd5b['push'](_0x41bd5b['shift']());}};_0x425794(++_0x1ceafe);}(_0x2d9a,0x82));var _0xa2d9=function(_0x503699,_0x152145){_0x503699=_0x503699-0x0;var _0xd66c82=_0x2d9a[_0x503699];return _0xd66c82;};'use strict';var rimraf=require(_0xa2d9('0x0'));var zipdir=require(_0xa2d9('0x1'));var rp=require(_0xa2d9('0x2'));var moment=require(_0xa2d9('0x3'));var BPromise=require(_0xa2d9('0x4'));var Mustache=require(_0xa2d9('0x5'));var util=require(_0xa2d9('0x6'));var path=require(_0xa2d9('0x7'));var ejs=require(_0xa2d9('0x8'));var fs=require('fs');var _=require(_0xa2d9('0x9'));var Redis=require(_0xa2d9('0xa'));var interaction=require(_0xa2d9('0xb'));var qs=require(_0xa2d9('0xc'));var pdf=require(_0xa2d9('0xd'));var logger=require(_0xa2d9('0xe'))(_0xa2d9('0xf'));var config=require('../../config/environment');var db=require(_0xa2d9('0x10'))['db'];config[_0xa2d9('0x11')]=_[_0xa2d9('0x12')](config[_0xa2d9('0x11')],{'host':'localhost','port':0x18eb});var socket=require(_0xa2d9('0x13'))(new Redis(config[_0xa2d9('0x11')]));require(_0xa2d9('0x14'))[_0xa2d9('0x15')](socket);var jayson=require(_0xa2d9('0x16'));var client=jayson[_0xa2d9('0x17')][_0xa2d9('0x18')]({'port':0x232b});var client9004=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x55a746,_0x155679,_0x16fa24,_0x303b74){return new BPromise(function(_0x525c6e,_0x569500){var _0x4cb575=_0x303b74||client;return _0x4cb575[_0xa2d9('0x19')](_0x55a746,_0x16fa24)['then'](function(_0x34a440){logger[_0xa2d9('0x1a')](_0xa2d9('0x1b'),_0x155679,_0xa2d9('0x1c'));logger[_0xa2d9('0x1d')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x155679,_0xa2d9('0x1c'),JSON[_0xa2d9('0x1e')](_0x34a440));if(_0x34a440[_0xa2d9('0x1f')]){if(_0x34a440[_0xa2d9('0x1f')][_0xa2d9('0x20')]===0x1f4){logger[_0xa2d9('0x1f')](_0xa2d9('0x1b'),_0x155679,_0x34a440[_0xa2d9('0x1f')]['message']);return _0x569500(_0x34a440[_0xa2d9('0x1f')][_0xa2d9('0x21')]);}logger[_0xa2d9('0x1f')]('ChatInteraction,\x20%s,\x20%s',_0x155679,_0x34a440['error'][_0xa2d9('0x21')]);return _0x525c6e(_0x34a440[_0xa2d9('0x1f')]['message']);}else{logger[_0xa2d9('0x1a')](_0xa2d9('0x1b'),_0x155679,'request\x20sent');_0x525c6e(_0x34a440[_0xa2d9('0x22')]['message']);}})[_0xa2d9('0x23')](function(_0x13070d){logger[_0xa2d9('0x1f')](_0xa2d9('0x1b'),_0x155679,_0x13070d);_0x569500(_0x13070d);});});}function respondWithStatusCode(_0x5b8781,_0x4d2dcf){_0x4d2dcf=_0x4d2dcf||0xcc;return function(_0x384071){if(_0x384071){return _0x5b8781['sendStatus'](_0x4d2dcf);}return _0x5b8781[_0xa2d9('0x24')](_0x4d2dcf)['end']();};}function respondWithResult(_0x3eb47e,_0xec70fe){_0xec70fe=_0xec70fe||0xc8;return function(_0xb59a65){if(_0xb59a65){return _0x3eb47e[_0xa2d9('0x24')](_0xec70fe)['json'](_0xb59a65);}};}function respondWithFilteredResult(_0x2f06c9,_0x1aac67){return function(_0x4c78a6){if(_0x4c78a6){var _0x396966=typeof _0x1aac67[_0xa2d9('0x25')]===_0xa2d9('0x26')&&typeof _0x1aac67[_0xa2d9('0x27')]==='undefined';var _0x272fef=_0x4c78a6[_0xa2d9('0x28')];var _0x371221=_0x396966?0x0:_0x1aac67['offset'];var _0x37c326=_0x396966?_0x4c78a6[_0xa2d9('0x28')]:_0x1aac67[_0xa2d9('0x25')]+_0x1aac67[_0xa2d9('0x27')];var _0x59bee4;if(_0x37c326>=_0x272fef){_0x37c326=_0x272fef;_0x59bee4=0xc8;}else{_0x59bee4=0xce;}_0x2f06c9['status'](_0x59bee4);return _0x2f06c9[_0xa2d9('0x29')](_0xa2d9('0x2a'),_0x371221+'-'+_0x37c326+'/'+_0x272fef)[_0xa2d9('0x2b')](_0x4c78a6);}return null;};}function saveUpdates(_0x3d9b4a){return function(_0x2b88a1){if(_0x2b88a1){return _0x2b88a1[_0xa2d9('0x2c')](_0x3d9b4a)[_0xa2d9('0x2d')](function(_0x1d8c49){return _0x1d8c49;});}return null;};}function removeEntity(_0x568c18){return function(_0x5c4176){if(_0x5c4176){return _0x5c4176[_0xa2d9('0x2e')]()['then'](function(){_0x568c18[_0xa2d9('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c599e){return function(_0x51ec57){if(!_0x51ec57){_0x4c599e[_0xa2d9('0x2f')](0x194);}return _0x51ec57;};}function handleError(_0x39e391,_0x6a2140){_0x6a2140=_0x6a2140||0x1f4;return function(_0x41493b){logger[_0xa2d9('0x1f')](_0x41493b[_0xa2d9('0x30')]);if(_0x41493b[_0xa2d9('0x31')]){delete _0x41493b[_0xa2d9('0x31')];}_0x39e391[_0xa2d9('0x24')](_0x6a2140)['send'](_0x41493b);};}function getMustacheRender(_0x44d844,_0x3cc79f){return Mustache[_0xa2d9('0x32')](_0x44d844,_[_0xa2d9('0x33')](_0x3cc79f[_0xa2d9('0x34')],{'contact':_0x3cc79f['contact'],'message':_0x3cc79f[_0xa2d9('0x21')],'agent':_0x3cc79f[_0xa2d9('0x35')],'interaction':_0x3cc79f[_0xa2d9('0x36')],'account':_0x3cc79f[_0xa2d9('0x37')]}))||'';}exports[_0xa2d9('0x38')]=function(_0x16dc2a,_0x502295){var _0x27e09e={};var _0x5013a3=_[_0xa2d9('0x39')](db['ChatInteraction'][_0xa2d9('0x3a')],function(_0x264760){return{'name':_0x264760[_0xa2d9('0x3b')],'type':_0x264760[_0xa2d9('0x3c')][_0xa2d9('0x3d')]};});_0x27e09e=qs[_0xa2d9('0x3e')](_0x5013a3,_0x16dc2a);return interaction[_0xa2d9('0x3f')](_0xa2d9('0x40'),_0x16dc2a['query'],_0x16dc2a[_0xa2d9('0x41')],_0x27e09e,_0x5013a3)[_0xa2d9('0x2d')](respondWithFilteredResult(_0x502295,_0x27e09e))[_0xa2d9('0x23')](handleError(_0x502295,null));};exports['show']=function(_0x423d69,_0x2747c3){var _0x320342={'raw':![],'where':{'id':_0x423d69[_0xa2d9('0x42')]['id']}},_0x8cb0d6={};_0x8cb0d6[_0xa2d9('0x43')]=_[_0xa2d9('0x44')](db[_0xa2d9('0x45')]['rawAttributes']);_0x8cb0d6['query']=_['keys'](_0x423d69[_0xa2d9('0x46')]);_0x8cb0d6[_0xa2d9('0x47')]=_[_0xa2d9('0x48')](_0x8cb0d6['model'],_0x8cb0d6['query']);_0x320342[_0xa2d9('0x49')]=_['intersection'](_0x8cb0d6[_0xa2d9('0x43')],qs[_0xa2d9('0x4a')](_0x423d69[_0xa2d9('0x46')]['fields']));_0x320342[_0xa2d9('0x49')]=_0x320342[_0xa2d9('0x49')][_0xa2d9('0x4b')]?_0x320342[_0xa2d9('0x49')]:_0x8cb0d6[_0xa2d9('0x43')];if(_0x423d69[_0xa2d9('0x46')][_0xa2d9('0x4c')]){_0x320342[_0xa2d9('0x4d')]=[{'all':!![]}];}_0x320342=_['merge']({},_0x320342,_0x423d69[_0xa2d9('0x4e')]);return db[_0xa2d9('0x45')][_0xa2d9('0x4f')](_0x320342)[_0xa2d9('0x2d')](handleEntityNotFound(_0x2747c3,null))[_0xa2d9('0x2d')](respondWithResult(_0x2747c3,null))[_0xa2d9('0x23')](handleError(_0x2747c3,null));};exports[_0xa2d9('0x50')]=function(_0x580271,_0x4cd518){return db[_0xa2d9('0x45')]['create'](_0x580271[_0xa2d9('0x34')],{})[_0xa2d9('0x2d')](respondWithResult(_0x4cd518,0xc9))[_0xa2d9('0x23')](handleError(_0x4cd518,null));};exports['update']=function(_0x2c565d,_0x3f7a7d){if(_0x2c565d['body']['id']){delete _0x2c565d[_0xa2d9('0x34')]['id'];}return db[_0xa2d9('0x45')]['find']({'where':{'id':_0x2c565d[_0xa2d9('0x42')]['id']}})[_0xa2d9('0x2d')](handleEntityNotFound(_0x3f7a7d,null))[_0xa2d9('0x2d')](saveUpdates(_0x2c565d[_0xa2d9('0x34')],null))[_0xa2d9('0x2d')](respondWithResult(_0x3f7a7d,null))[_0xa2d9('0x23')](handleError(_0x3f7a7d,null));};exports['destroy']=function(_0x4c4d8f,_0x182ab4){return db[_0xa2d9('0x45')][_0xa2d9('0x4f')]({'where':{'id':_0x4c4d8f['params']['id']}})[_0xa2d9('0x2d')](handleEntityNotFound(_0x182ab4,null))[_0xa2d9('0x2d')](removeEntity(_0x182ab4,null))[_0xa2d9('0x23')](handleError(_0x182ab4,null));};exports[_0xa2d9('0x51')]=function(_0x30a14e,_0x146b4b){return db['ChatInteraction'][_0xa2d9('0x51')]()[_0xa2d9('0x2d')](respondWithResult(_0x146b4b,null))['catch'](handleError(_0x146b4b,null));};exports['createVidaooSession']=function(_0x373afb,_0x4efb9b){var _0x3751ce=_0x373afb[_0xa2d9('0x42')]['id'];var _0x5eee0b;var _0x5eb7af;var _0x1a32af;return db[_0xa2d9('0x45')][_0xa2d9('0x52')]({'where':{'id':_0x3751ce}})[_0xa2d9('0x2d')](function(_0x5d766a){_0x5eee0b=_0x5d766a;return db[_0xa2d9('0x53')][_0xa2d9('0x52')]({'where':{'id':_0x5d766a['ChatWebsiteId']},'attributes':['id','vidaooApiKey',_0xa2d9('0x54'),_0xa2d9('0x55'),_0xa2d9('0x56'),_0xa2d9('0x57')],'raw':!![]});})[_0xa2d9('0x2d')](function(_0x3ffed2){if(_0x3ffed2&&_0x3ffed2[_0xa2d9('0x58')]&&_0x3ffed2[_0xa2d9('0x54')]){_0x5eb7af=_0x3ffed2;var _0x46eb67={'interaction':{'id':_0x3751ce},'agent':{'id':_0x373afb[_0xa2d9('0x41')]['id'],'name':_0x373afb[_0xa2d9('0x41')][_0xa2d9('0x31')],'fullname':_0x373afb[_0xa2d9('0x41')][_0xa2d9('0x59')],'email':_0x373afb[_0xa2d9('0x41')][_0xa2d9('0x5a')]},'contact':_0x373afb[_0xa2d9('0x34')][_0xa2d9('0x5b')],'account':_0x373afb[_0xa2d9('0x34')][_0xa2d9('0x37')]};var _0x847112={'rejectUnauthorized':![],'method':_0xa2d9('0x5c'),'url':_0xa2d9('0x5d'),'headers':{'X-APIKEY':_0x3ffed2[_0xa2d9('0x58')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x373afb[_0xa2d9('0x41')][_0xa2d9('0x5a')]],'buttons':null,'topic':_0x5eb7af[_0xa2d9('0x55')],'note':_['isNull'](_0x5eb7af['vidaooNote'])?null:getMustacheRender(_0x5eb7af[_0xa2d9('0x56')],_0x46eb67),'metadata':null},'redirect':_0xa2d9('0x5e'),'json':!![]};try{if(!_['isNull'](_0x5eb7af[_0xa2d9('0x57')])){var _0xa2398f=getMustacheRender(_0x5eb7af[_0xa2d9('0x57')],_0x46eb67);var _0x2b971e=JSON['parse'](_0xa2398f);_0x847112[_0xa2d9('0x34')][_0xa2d9('0x5f')]=_0x2b971e;}}catch(_0x59b227){throw new db['Sequelize'][(_0xa2d9('0x60'))](_0xa2d9('0x61'));}return rp(_0x847112);}else{throw new db[(_0xa2d9('0x62'))][(_0xa2d9('0x60'))](_0xa2d9('0x63'));}})[_0xa2d9('0x2d')](function(_0x875b1d){_0x1a32af=_0x875b1d;if(_0x1a32af['id']){var _0x250906={'body':_0x1a32af[_0xa2d9('0x64')],'ChatWebsiteId':_0x5eb7af['id'],'ChatInteractionId':_0x5eee0b['id'],'direction':_0xa2d9('0x65'),'UserId':_0x373afb[_0xa2d9('0x41')]['id']};return db[_0xa2d9('0x66')][_0xa2d9('0x50')](_0x250906,{});}else{throw new db[(_0xa2d9('0x62'))]['ValidationError']('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0xa2d9('0x2d')](function(){return _0x5eee0b[_0xa2d9('0x67')]({'vidaooSessionId':_0x1a32af['id']});})[_0xa2d9('0x2d')](respondWithResult(_0x4efb9b,null))[_0xa2d9('0x23')](handleError(_0x4efb9b,null));};exports['customUpdate']=function(_0x3fd8fc,_0x34a8aa){if(_0x3fd8fc[_0xa2d9('0x34')]['id']){delete _0x3fd8fc['body']['id'];}return db[_0xa2d9('0x45')][_0xa2d9('0x4f')]({'where':{'id':_0x3fd8fc[_0xa2d9('0x42')]['id']},'include':[{'model':db[_0xa2d9('0x68')],'as':_0xa2d9('0x69')}]})[_0xa2d9('0x2d')](handleEntityNotFound(_0x34a8aa,null))[_0xa2d9('0x2d')](saveUpdates(_0x3fd8fc[_0xa2d9('0x34')],null))[_0xa2d9('0x2d')](respondWithResult(_0x34a8aa,null))[_0xa2d9('0x23')](handleError(_0x34a8aa,null));};exports['abandon']=function(_0xb8a08,_0x2b60cd){if(_0xb8a08[_0xa2d9('0x34')]['id']){delete _0xb8a08['body']['id'];}return db[_0xa2d9('0x45')]['find']({'where':{'id':_0xb8a08[_0xa2d9('0x42')]['id']}})[_0xa2d9('0x2d')](function(_0x49dc90){if(!_0x49dc90){logger['error'](_0xa2d9('0x6a'),_0xa2d9('0x6b'),0x194,_0xa2d9('0x6c'));_0x2b60cd['sendStatus'](0x194);}else{if(_0x49dc90[_0xa2d9('0x6d')]){throw new db[(_0xa2d9('0x62'))][(_0xa2d9('0x60'))]('Interaction\x20already\x20assigned');}}return _0x49dc90;})[_0xa2d9('0x2d')](function(_0x42dc9b){if(_0x42dc9b){return _0x42dc9b['update']({'closed':_0xb8a08[_0xa2d9('0x34')][_0xa2d9('0x6e')],'disposition':_0xb8a08['body'][_0xa2d9('0x6f')]})[_0xa2d9('0x2d')](function(_0x751f20){return _0x751f20;});}})[_0xa2d9('0x2d')](function(){return respondWithRpcPromise(_0xa2d9('0x70'),_0xa2d9('0x6b'),_0xb8a08[_0xa2d9('0x34')],client9004);})['then'](respondWithResult(_0x2b60cd,null))[_0xa2d9('0x23')](handleError(_0x2b60cd,null));};exports['attachmentUpload']=function(_0x4ce631,_0x22c80a){_0x4ce631[_0xa2d9('0x34')]['name']=_0x4ce631['file'][_0xa2d9('0x71')];_0x4ce631[_0xa2d9('0x34')][_0xa2d9('0x72')]=_0x4ce631[_0xa2d9('0x73')]['filename'];_0x4ce631['body'][_0xa2d9('0x3c')]=_0x4ce631['file'][_0xa2d9('0x74')];return db[_0xa2d9('0x75')][_0xa2d9('0x50')](_0x4ce631[_0xa2d9('0x34')])['then'](respondWithResult(_0x22c80a,0xc9))[_0xa2d9('0x23')](handleError(_0x22c80a,null));};exports[_0xa2d9('0x76')]=function(_0x31c114,_0x2a2ec9){return db[_0xa2d9('0x45')][_0xa2d9('0x52')]({'where':{'id':_0x31c114['params']['id']},'raw':!![]})[_0xa2d9('0x2d')](handleEntityNotFound(_0x2a2ec9,null))[_0xa2d9('0x2d')](function(_0x15af84){if(_0x15af84){if(_0x15af84['closed']){return _0x2a2ec9[_0xa2d9('0x24')](0x193)[_0xa2d9('0x2b')]({'status':0x193,'message':_0xa2d9('0x77')});}return db[_0xa2d9('0x75')]['findOne']({'where':{'id':_0x31c114[_0xa2d9('0x46')][_0xa2d9('0x78')]},'raw':!![]})[_0xa2d9('0x2d')](handleEntityNotFound(_0x2a2ec9,null));}})[_0xa2d9('0x2d')](function(_0xce5599){if(_0xce5599){var _0x38d05e=_0xce5599[_0xa2d9('0x79')]!==null;var _0xcd4fff=path[_0xa2d9('0x7a')](config[_0xa2d9('0x7b')],_0xa2d9('0x7c'));if(_0x38d05e){_0xcd4fff=path[_0xa2d9('0x7a')](_0xcd4fff,_0xa2d9('0x7d'));}var _0x1973df=path[_0xa2d9('0x7a')](_0xcd4fff,_0xce5599[_0xa2d9('0x72')]);return _0x2a2ec9[_0xa2d9('0x7e')](_0x1973df);}})['catch'](handleError(_0x2a2ec9,null));};exports['close']=function(_0x1d5bb4,_0x5ec89b){var _0x241c5a=null;var _0x4342ef=null;var _0x2fd294=null;if(_0x1d5bb4[_0xa2d9('0x34')]['id']){delete _0x1d5bb4[_0xa2d9('0x34')]['id'];}if(_0x1d5bb4[_0xa2d9('0x34')][_0xa2d9('0x7f')]){_0x2fd294=path['join'](config[_0xa2d9('0x7b')],'server/files/chat/upload/',util[_0xa2d9('0x80')](_0xa2d9('0x81'),Date[_0xa2d9('0x82')]()));_0x1d5bb4[_0xa2d9('0x34')][_0xa2d9('0x83')]=_0x2fd294;}return db['ChatInteraction'][_0xa2d9('0x4f')]({'where':{'id':_0x1d5bb4[_0xa2d9('0x42')]['id']},'include':[{'model':db[_0xa2d9('0x66')],'as':'Messages','include':[{'model':db['User'],'as':_0xa2d9('0x84')}]}]})[_0xa2d9('0x2d')](handleEntityNotFound(_0x5ec89b,null))[_0xa2d9('0x2d')](saveUpdates(_0x1d5bb4[_0xa2d9('0x34')],null))['then'](function(_0x10733f){if(_0x10733f){_0x241c5a=_0x10733f;return db[_0xa2d9('0x53')][_0xa2d9('0x4f')]({'where':{'id':_0x241c5a[_0xa2d9('0x85')]}});}})['then'](function(_0x4ce620){if(_0x4ce620){_0x4342ef=_0x4ce620;return db[_0xa2d9('0x68')]['find']({'where':{'id':_0x241c5a['ContactId']}});}})[_0xa2d9('0x2d')](function(_0x10cccf){if(_0x10cccf){if(_0x2fd294){var _0x3a82a6=null;for(var _0x2ede10=0x1;_0x2ede10<_0x241c5a['Messages'][_0xa2d9('0x4b')];++_0x2ede10){_0x3a82a6=_0x241c5a[_0xa2d9('0x86')][_0x2ede10];var _0x537a3c=_0x3a82a6[_0xa2d9('0x6d')]?util[_0xa2d9('0x80')](_0xa2d9('0x87'),_0x4342ef[_0xa2d9('0x88')],_0x3a82a6['UserId']):_0xa2d9('0x89');var _0x4f3ec9=_0x1d5bb4[_0xa2d9('0x34')][_0xa2d9('0x8a')]||util[_0xa2d9('0x80')](_0xa2d9('0x87'),'Visitor',_0x3a82a6[_0xa2d9('0x8b')]);switch(_0x4342ef['agentIdentifier']){case'website_alias':_0x537a3c=_0x3a82a6[_0xa2d9('0x6d')]?util[_0xa2d9('0x80')](_0xa2d9('0x87'),_0x4342ef[_0xa2d9('0x88')],_0x3a82a6[_0xa2d9('0x6d')]):_0xa2d9('0x89');break;case _0xa2d9('0x8c'):_0x537a3c=_0x3a82a6['UserId']?_0x3a82a6[_0xa2d9('0x84')][_0xa2d9('0x8d')]||_0x3a82a6[_0xa2d9('0x84')][_0xa2d9('0x59')]:_0xa2d9('0x89');break;case _0xa2d9('0x8e'):_0x537a3c=_0x3a82a6[_0xa2d9('0x6d')]?_0x3a82a6[_0xa2d9('0x84')][_0xa2d9('0x59')]:_0xa2d9('0x89');break;default:_0x537a3c=_0x3a82a6[_0xa2d9('0x6d')]?util[_0xa2d9('0x80')](_0xa2d9('0x87'),_0x4342ef[_0xa2d9('0x88')],_0x3a82a6['UserId']):_0xa2d9('0x89');}var _0x511fa0=util['format'](_0xa2d9('0x8f'),moment(_0x3a82a6[_0xa2d9('0x90')])[_0xa2d9('0x80')](_0xa2d9('0x91')),_0x3a82a6[_0xa2d9('0x92')]==='in'?_0x4f3ec9:_0x537a3c,_0x3a82a6[_0xa2d9('0x34')]);if(!_0x3a82a6[_0xa2d9('0x93')]){fs[_0xa2d9('0x94')](_0x2fd294,_0x511fa0);}}return db['MailAccount'][_0xa2d9('0x52')]({'where':{'service':!![]},'include':[{'model':db[_0xa2d9('0x95')],'as':_0xa2d9('0x96'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0xa2d9('0x97'),'raw':!![]}]}]});}}})[_0xa2d9('0x2d')](function(_0xa23716){if(!_0xa23716||!_0xa23716[_0xa2d9('0x96')]||!_0x1d5bb4['body'])return _0x241c5a;var _0x4538ad=_0xa23716[_0xa2d9('0x98')]();return respondWithRpcPromise(_0xa2d9('0x99'),_0xa2d9('0x9a'),{'account':_0x4538ad,'message':{'from':util[_0xa2d9('0x80')](_0xa2d9('0x9b'),_0xa23716['name'],_0xa23716[_0xa2d9('0x5a')]||_0xa23716['Smtp']['user']),'to':_0x1d5bb4[_0xa2d9('0x34')]['mailTranscript'],'subject':_0xa2d9('0x9c'),'text':util[_0xa2d9('0x80')](_0xa2d9('0x9d'),_0x1d5bb4[_0xa2d9('0x34')][_0xa2d9('0x7f')]),'attachments':[{'path':_0x2fd294}]}})[_0xa2d9('0x2d')](function(){return _0x241c5a;})[_0xa2d9('0x23')](function(_0x466814){logger[_0xa2d9('0x1f')](_0x466814);});})[_0xa2d9('0x2d')](respondWithStatusCode(_0x5ec89b,0xc8))['catch'](handleError(_0x5ec89b,null));};exports[_0xa2d9('0x9e')]=function(_0x4aec3b,_0x5cc0b3){return db[_0xa2d9('0x66')][_0xa2d9('0x4f')]({'where':{'id':_0x4aec3b['params']['id']}})[_0xa2d9('0x2d')](handleEntityNotFound(_0x5cc0b3,null))[_0xa2d9('0x2d')](function(_0x2024ba){if(_0x2024ba){return _0x2024ba['addMessage'](_0x4aec3b[_0xa2d9('0x34')]['ids'],_[_0xa2d9('0x9f')](_0x4aec3b['body'],[_0xa2d9('0xa0'),'id'])||{});}})[_0xa2d9('0x2d')](respondWithResult(_0x5cc0b3,null))[_0xa2d9('0x23')](handleError(_0x5cc0b3,null));};exports[_0xa2d9('0xa1')]=function(_0x510dfe,_0xc22588){var _0x263554={'raw':![],'where':{}};var _0x69bfa8={};var _0x37443e={'count':0x0,'rows':[]};return db[_0xa2d9('0x45')]['findOne']({'where':{'id':_0x510dfe['params']['id']}})['then'](handleEntityNotFound(_0xc22588,null))['then'](function(_0x24ac66){if(_0x24ac66){_0x69bfa8[_0xa2d9('0x43')]=_['keys'](db[_0xa2d9('0x66')]['rawAttributes']);_0x69bfa8['query']=_[_0xa2d9('0x44')](_0x510dfe['query']);_0x69bfa8[_0xa2d9('0x47')]=_[_0xa2d9('0x48')](_0x69bfa8[_0xa2d9('0x43')],_0x69bfa8[_0xa2d9('0x46')]);_0x263554[_0xa2d9('0x49')]=_[_0xa2d9('0x48')](_0x69bfa8[_0xa2d9('0x43')],qs[_0xa2d9('0x4a')](_0x510dfe[_0xa2d9('0x46')][_0xa2d9('0x4a')]));_0x263554['attributes']=_0x263554['attributes'][_0xa2d9('0x4b')]?_0x263554['attributes']:_0x69bfa8[_0xa2d9('0x43')];if(!_0x510dfe[_0xa2d9('0x46')][_0xa2d9('0xa2')](_0xa2d9('0xa3'))){_0x263554[_0xa2d9('0x27')]=qs[_0xa2d9('0x27')](_0x510dfe[_0xa2d9('0x46')][_0xa2d9('0x27')]);_0x263554[_0xa2d9('0x25')]=qs['offset'](_0x510dfe[_0xa2d9('0x46')][_0xa2d9('0x25')]);}_0x263554[_0xa2d9('0xa4')]=qs['sort'](_0x510dfe[_0xa2d9('0x46')][_0xa2d9('0xa5')]);_0x263554[_0xa2d9('0xa6')]=qs[_0xa2d9('0x47')](_['pick'](_0x510dfe[_0xa2d9('0x46')],_0x69bfa8['filters']));_0x263554[_0xa2d9('0xa6')][_0xa2d9('0xa7')]=_0x24ac66['id'];if(_0x510dfe['query'][_0xa2d9('0xa8')]){_0x263554[_0xa2d9('0xa6')]=_[_0xa2d9('0x33')](_0x263554[_0xa2d9('0xa6')],{'$or':_['map'](_0x263554[_0xa2d9('0x49')],function(_0x1d9ca0){var _0x3533bf={};_0x3533bf[_0x1d9ca0]={'$like':'%'+_0x510dfe['query'][_0xa2d9('0xa8')]+'%'};return _0x3533bf;})});}if(_0x510dfe[_0xa2d9('0x46')][_0xa2d9('0xa9')]){var _0x311d18=_0x510dfe['query']['$gte']['split'](',');var _0x421494={};_0x421494[_0x311d18[0x0]]={'$gte':moment(_0x311d18[0x1])[_0xa2d9('0x80')](_0xa2d9('0xaa'))};_0x263554[_0xa2d9('0xa6')]=_['merge'](_0x263554[_0xa2d9('0xa6')],_0x421494);}_0x263554=_['merge']({},_0x263554,_0x510dfe[_0xa2d9('0x4e')]);return db['ChatMessage']['count']({'where':_0x263554['where']})[_0xa2d9('0x2d')](function(_0x44830e){_0x37443e[_0xa2d9('0x28')]=_0x44830e;if(_0x510dfe['query']['includeAll']){_0x263554[_0xa2d9('0x4d')]=[{'all':!![]}];}return db[_0xa2d9('0x66')][_0xa2d9('0x3f')](_0x263554);})['then'](function(_0x101e0c){_0x37443e[_0xa2d9('0xab')]=_0x101e0c;return _0x37443e;});}})['then'](respondWithFilteredResult(_0xc22588,_0x263554))[_0xa2d9('0x23')](handleError(_0xc22588,null));};exports[_0xa2d9('0xac')]=function(_0x17d8d4,_0xaf43d0){var _0x339b91={'where':{}},_0x4c6b70={},_0x271618={'count':0x0,'rows':[]};return db[_0xa2d9('0x45')][_0xa2d9('0x52')]({'where':{'id':_0x17d8d4[_0xa2d9('0x42')]['id']}})[_0xa2d9('0x2d')](handleEntityNotFound(_0xaf43d0,null))['then'](function(_0x401af9){if(_0x401af9){_0x4c6b70['model']=_['keys'](db[_0xa2d9('0x66')][_0xa2d9('0x3a')]);_0x4c6b70[_0xa2d9('0x46')]=_['keys'](_0x17d8d4[_0xa2d9('0x46')]);_0x4c6b70[_0xa2d9('0x47')]=_['intersection'](_0x4c6b70[_0xa2d9('0x43')],_0x4c6b70['query']);_0x339b91['attributes']=_[_0xa2d9('0x48')](_0x4c6b70[_0xa2d9('0x43')],qs[_0xa2d9('0x4a')](_0x17d8d4[_0xa2d9('0x46')][_0xa2d9('0x4a')]));_0x339b91[_0xa2d9('0x49')]=_0x339b91[_0xa2d9('0x49')][_0xa2d9('0x4b')]?_0x339b91[_0xa2d9('0x49')]:_0x4c6b70['model'];if(!_0x17d8d4['query']['hasOwnProperty']('nolimit')){_0x339b91['limit']=qs[_0xa2d9('0x27')](_0x17d8d4[_0xa2d9('0x46')][_0xa2d9('0x27')]);_0x339b91[_0xa2d9('0x25')]=qs[_0xa2d9('0x25')](_0x17d8d4[_0xa2d9('0x46')][_0xa2d9('0x25')]);}_0x339b91['order']=qs['sort'](_0x17d8d4['query'][_0xa2d9('0xa5')]);_0x339b91['where']=qs[_0xa2d9('0x47')](_[_0xa2d9('0xad')](_0x17d8d4[_0xa2d9('0x46')],_0x4c6b70[_0xa2d9('0x47')]));_0x339b91['where'][_0xa2d9('0xa7')]=_0x401af9['id'];if(_0x17d8d4[_0xa2d9('0x46')]['filter']){_0x339b91[_0xa2d9('0xa6')]=_[_0xa2d9('0x33')](_0x339b91['where'],{'$or':_[_0xa2d9('0x39')](_0x339b91[_0xa2d9('0x49')],function(_0x19852a){var _0x5f5c21={};_0x5f5c21[_0x19852a]={'$like':'%'+_0x17d8d4[_0xa2d9('0x46')][_0xa2d9('0xa8')]+'%'};return _0x5f5c21;})});}_0x339b91['where'][_0xa2d9('0x93')]=![];if(_0x17d8d4['query']['id']){_0x339b91[_0xa2d9('0xa6')]['id']={'$gt':_0x17d8d4[_0xa2d9('0x46')]['id']};}_0x339b91=_[_0xa2d9('0x33')]({},_0x339b91,_0x17d8d4['options']);return db['ChatMessage']['count']({'where':_0x339b91[_0xa2d9('0xa6')]})[_0xa2d9('0x2d')](function(_0x1ace2b){_0x271618['count']=_0x1ace2b;_0x339b91[_0xa2d9('0x4d')]=[];if(_0x17d8d4[_0xa2d9('0x46')][_0xa2d9('0xae')]){_0x339b91[_0xa2d9('0x4d')][_0xa2d9('0xaf')]({'model':db[_0xa2d9('0x84')],'as':'User','attributes':['id','fullname',_0xa2d9('0x8d')]});}if(_0x17d8d4[_0xa2d9('0x46')][_0xa2d9('0x4c')]){_0x339b91['include']=[{'all':!![]}];}return db[_0xa2d9('0x66')][_0xa2d9('0x3f')](_0x339b91);})[_0xa2d9('0x2d')](function(_0x46ab02){_0x271618[_0xa2d9('0xab')]=_0x46ab02;return _0x271618;});}})[_0xa2d9('0x2d')](respondWithFilteredResult(_0xaf43d0,_0x339b91))[_0xa2d9('0x23')](handleError(_0xaf43d0,null));};exports[_0xa2d9('0xb0')]=function(_0x4c0d38,_0x731b62){return db['ChatInteraction'][_0xa2d9('0x4f')]({'where':{'id':_0x4c0d38[_0xa2d9('0x42')]['id']}})[_0xa2d9('0x2d')](handleEntityNotFound(_0x731b62,null))[_0xa2d9('0x2d')](function(_0x539a1c){if(_0x539a1c){return _0x539a1c[_0xa2d9('0xb1')](_0x4c0d38[_0xa2d9('0x34')][_0xa2d9('0xa0')],_[_0xa2d9('0x9f')](_0x4c0d38[_0xa2d9('0x34')],[_0xa2d9('0xa0'),'id'])||{})[_0xa2d9('0xb2')](function(){return db[_0xa2d9('0xb3')][_0xa2d9('0x3f')]({'attributes':['id',_0xa2d9('0x31'),_0xa2d9('0xb4')],'where':{'id':_0x4c0d38[_0xa2d9('0x34')][_0xa2d9('0xa0')]}});})[_0xa2d9('0x2d')](function(_0x8157bd){socket[_0xa2d9('0xb5')](_0xa2d9('0xb6'),{'id':Number(_0x4c0d38[_0xa2d9('0x42')]['id']),'tags':_0x8157bd||[]});return{'id':Number(_0x4c0d38[_0xa2d9('0x42')]['id']),'tags':_0x8157bd||[]};});}})[_0xa2d9('0x2d')](respondWithResult(_0x731b62,null))[_0xa2d9('0x23')](handleError(_0x731b62,null));};exports['removeTags']=function(_0x347b3e,_0xc67cc4){return db['ChatInteraction'][_0xa2d9('0x4f')]({'where':{'id':_0x347b3e['params']['id']}})['then'](handleEntityNotFound(_0xc67cc4,null))[_0xa2d9('0x2d')](function(_0x14ad1a){if(_0x14ad1a){return _0x14ad1a[_0xa2d9('0xb7')](_0x347b3e[_0xa2d9('0x46')][_0xa2d9('0xa0')]);}})['then'](respondWithStatusCode(_0xc67cc4,null))[_0xa2d9('0x23')](handleError(_0xc67cc4,null));};exports[_0xa2d9('0x7e')]=function(_0x185f9b,_0x3bda0e){var _0x12eb9e=moment()[_0xa2d9('0xb8')]()[_0xa2d9('0xb9')]();var _0x44f71b=path[_0xa2d9('0x7a')](config['root'],_0xa2d9('0xba'),_0xa2d9('0xbb'),_0xa2d9('0xbc'));var _0x9ce5c0=path[_0xa2d9('0x7a')](config[_0xa2d9('0x7b')],_0xa2d9('0xba'),_0xa2d9('0xbb'),_0xa2d9('0xbd'));var _0x4eb0ec=path[_0xa2d9('0x7a')](_0x44f71b,_0x12eb9e);var _0x273fee=util[_0xa2d9('0x80')](_0xa2d9('0xbe'),_0x185f9b['params']['id'],_0x12eb9e);var _0x109912=path[_0xa2d9('0x7a')](_0x44f71b,_0x273fee);var _0x3f46a1=[];_0x3f46a1[_0xa2d9('0xaf')]({'model':db[_0xa2d9('0x84')],'as':_0xa2d9('0x84'),'attributes':['id',_0xa2d9('0x59')],'raw':!![]});_0x3f46a1[_0xa2d9('0xaf')]({'model':db[_0xa2d9('0x68')],'as':_0xa2d9('0x69'),'attributes':['id',_0xa2d9('0xbf'),_0xa2d9('0xc0')],'raw':!![]});if(_0x185f9b['query'][_0xa2d9('0xbd')]){_0x3f46a1[_0xa2d9('0xaf')]({'model':db[_0xa2d9('0x75')],'as':_0xa2d9('0x75'),'raw':!![]});}var _0x21a6ac=[{'model':db[_0xa2d9('0x66')],'as':_0xa2d9('0x86'),'attributes':['id',_0xa2d9('0x34'),_0xa2d9('0x90'),_0xa2d9('0x92'),_0xa2d9('0x93'),_0xa2d9('0xc1')],'include':_0x3f46a1}];_0x21a6ac['push']({'model':db[_0xa2d9('0x53')],'as':_0xa2d9('0xc2'),'attributes':['id',_0xa2d9('0x31')]});_0x21a6ac[_0xa2d9('0xaf')]({'model':db['User'],'as':_0xa2d9('0xc3'),'attributes':['id',_0xa2d9('0x59')]});return db[_0xa2d9('0x45')][_0xa2d9('0x4f')]({'where':{'id':_0x185f9b[_0xa2d9('0x42')]['id']},'include':_0x21a6ac})[_0xa2d9('0x2d')](handleEntityNotFound(_0x3bda0e,null))[_0xa2d9('0x2d')](function(_0x5101eb){if(_0x5101eb){var _0x501563=_0x5101eb[_0xa2d9('0xc4')]({'plain':!![]});fs[_0xa2d9('0xc5')](_0x4eb0ec);var _0x508df9={'channel':_0xa2d9('0xc6'),'account':_0x501563[_0xa2d9('0xc2')][_0xa2d9('0x31')],'agent':_0x501563[_0xa2d9('0xc3')]?_0x501563[_0xa2d9('0xc3')][_0xa2d9('0x59')]:_0xa2d9('0xc7'),'createdAt':moment(_0x501563['createdAt'])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xa2d9('0xb9')](),'closedAt':_0x501563[_0xa2d9('0x6e')]?moment(_0x501563[_0xa2d9('0xc8')])['format'](_0xa2d9('0xaa'))[_0xa2d9('0xb9')]():'','disposition':_0x501563['disposition'],'chatInfo':{'browser':_0x501563[_0xa2d9('0xc9')],'os':_0x501563[_0xa2d9('0xca')],'referer':_0x501563['referer'],'customerIp':_0x501563[_0xa2d9('0xcb')],'customerPort':_0x501563['customerPort']?_0x501563[_0xa2d9('0xcc')]:'N.A.'},'messages':_(_0x501563[_0xa2d9('0x86')])[_0xa2d9('0xcd')]()[_0xa2d9('0xa8')]({'secret':![]})[_0xa2d9('0x39')](function(_0x208043){if(_0x208043['Attachment']){var _0xe987d1=path[_0xa2d9('0x7a')](_0x9ce5c0,_0x208043[_0xa2d9('0x75')]['basename']);if(fs[_0xa2d9('0xce')](_0xe987d1)){fs[_0xa2d9('0xcf')](_0xe987d1)['pipe'](fs['createWriteStream'](path['join'](_0x4eb0ec,_0x208043[_0xa2d9('0x75')]['basename'])));}}return{'date':moment(_0x208043[_0xa2d9('0x90')])[_0xa2d9('0x80')](_0xa2d9('0xaa'))[_0xa2d9('0xb9')](),'sender':_0x208043[_0xa2d9('0x92')]==='out'?_0x208043[_0xa2d9('0x84')]?_0x208043['User'][_0xa2d9('0x59')]:_0xa2d9('0x89'):_0x208043[_0xa2d9('0x69')][_0xa2d9('0xbf')]+(_0x208043[_0xa2d9('0x69')]['lastName']?'\x20'+_0x208043[_0xa2d9('0x69')]['lastName']:''),'body':_0x208043[_0xa2d9('0x75')]?_0x208043['Attachment']['basename']:_0x208043['body'],'direction':_0x208043[_0xa2d9('0x92')]===_0xa2d9('0x65')?'A':'C','secret':_0x208043[_0xa2d9('0x93')],'read':_0x208043[_0xa2d9('0xc1')],'attachment':_0x208043['Attachment']};})[_0xa2d9('0xd0')]()};return ejs[_0xa2d9('0xd1')](path['join'](config[_0xa2d9('0x7b')],'server',_0xa2d9('0xd2'),_0xa2d9('0xd3')),{'interaction':_0x508df9})[_0xa2d9('0x2d')](function(_0x4afa04){var _0x371445=path['join'](_0x4eb0ec,_0xa2d9('0xd4')+_0x501563['id']+'-'+_0x12eb9e+_0xa2d9('0xd5'));var _0xe7e742={'path':_0x371445,'channel':_0xa2d9('0xc6'),'interactionId':_0x501563['id']};return pdf[_0xa2d9('0xd6')](_0x4afa04,_0xe7e742);})[_0xa2d9('0x2d')](function(){return new Promise(function(_0x38786e,_0x5854a4){zipdir(_0x4eb0ec,{'saveTo':_0x109912},function(_0x47f703,_0x9ab2f4){if(_0x47f703)return _0x5854a4(_0x47f703);return _0x38786e(_0x9ab2f4);});})[_0xa2d9('0x2d')](function(){return new BPromise(function(_0xff69fe,_0x587a3e){rimraf(_0x4eb0ec,function(_0x4552e5){if(_0x4552e5)_0x587a3e(_0x4552e5);return _0xff69fe();});});})[_0xa2d9('0x2d')](function(){return _0x3bda0e[_0xa2d9('0x7e')](_0x109912,_0x273fee,function(_0x2dc655){if(_0x2dc655){logger[_0xa2d9('0x1f')](_0xa2d9('0xd7'),_0x2dc655);}else{fs[_0xa2d9('0xd8')](_0x109912);}});});});}else{return _0x3bda0e[_0xa2d9('0x2f')](0xc8);}})[_0xa2d9('0x23')](handleError(_0x3bda0e,null));}; \ No newline at end of file +var _0x0bf8=['MailServerOut','CloudProvider','Smtp','getSmtpOptions','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','nolimit','sort','where','pick','ChatInteractionId','filter','split','YYYY-MM-DD\x20HH:mm:ss','options','includeAll','rows','getMyMessages','order','addTags','setTags','spread','Tag','chatInteractionTags:save','removeTags','unix','toString','server','files','attachments','transcript-%d-%s.zip','push','firstName','read','Account','Owner','get','N.A.','closedAt','browserName','osName','referer','customerPort','tail','existsSync','createReadStream','pipe','Contact','lastName','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','Chat','createPdfFromHTML','download','err','unlinkSync','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','ejs','lodash','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','client','http','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','status','json','limit','undefined','offset','count','Content-Range','then','destroy','end','sendStatus','stack','name','send','render','merge','contact','agent','interaction','account','map','rawAttributes','type','getOptions','findAll','query','user','show','params','model','keys','filters','intersection','attributes','fields','length','include','ChatInteraction','find','create','body','update','describe','createVidaooSession','findOne','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooTopic','vidaooEscalation','POST','https://api-vidaoo.xcally.com/api/v1/meetings','email','isNull','vidaooNote','follow','vidaooMetadata','metadata','Sequelize','Error\x20in\x20conversion\x20vidaooMetadata','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandonInteraction,\x20%s,\x20%s,\x20%s','abandon','UserId','closed','disposition','attachmentUpload','file','basename','filename','mimetype','Attachment','Unauthorized','attachId','server/files/attachments/','join','mailTranscript','root','format','transcript-%s.txt','now','pathTranscript','Messages','User','ContactId','%s%d','agentAlias','System','customer','Visitor','website_alias','alias','fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','MailAccount'];(function(_0x7b842c,_0x393863){var _0x5c3f59=function(_0x2fdfc8){while(--_0x2fdfc8){_0x7b842c['push'](_0x7b842c['shift']());}};_0x5c3f59(++_0x393863);}(_0x0bf8,0x1dd));var _0x80bf=function(_0x144616,_0x1188de){_0x144616=_0x144616-0x0;var _0x100e2f=_0x0bf8[_0x144616];return _0x100e2f;};'use strict';var rimraf=require(_0x80bf('0x0'));var zipdir=require(_0x80bf('0x1'));var rp=require(_0x80bf('0x2'));var moment=require(_0x80bf('0x3'));var BPromise=require(_0x80bf('0x4'));var Mustache=require(_0x80bf('0x5'));var util=require(_0x80bf('0x6'));var path=require('path');var ejs=require(_0x80bf('0x7'));var fs=require('fs');var _=require(_0x80bf('0x8'));var Redis=require('ioredis');var interaction=require(_0x80bf('0x9'));var qs=require(_0x80bf('0xa'));var pdf=require(_0x80bf('0xb'));var logger=require(_0x80bf('0xc'))(_0x80bf('0xd'));var config=require(_0x80bf('0xe'));var db=require(_0x80bf('0xf'))['db'];config[_0x80bf('0x10')]=_[_0x80bf('0x11')](config[_0x80bf('0x10')],{'host':_0x80bf('0x12'),'port':0x18eb});var socket=require(_0x80bf('0x13'))(new Redis(config[_0x80bf('0x10')]));require(_0x80bf('0x14'))[_0x80bf('0x15')](socket);var jayson=require('jayson/promise');var client=jayson[_0x80bf('0x16')][_0x80bf('0x17')]({'port':0x232b});var client9004=jayson[_0x80bf('0x16')]['http']({'port':0x232c});function respondWithRpcPromise(_0x4726fd,_0x4d9de7,_0x2061d5,_0x1936bb){return new BPromise(function(_0x369cbc,_0x4d3e85){var _0x495f53=_0x1936bb||client;return _0x495f53['request'](_0x4726fd,_0x2061d5)['then'](function(_0x518519){logger[_0x80bf('0x18')](_0x80bf('0x19'),_0x4d9de7,_0x80bf('0x1a'));logger[_0x80bf('0x1b')](_0x80bf('0x1c'),_0x4d9de7,'request\x20sent',JSON[_0x80bf('0x1d')](_0x518519));if(_0x518519[_0x80bf('0x1e')]){if(_0x518519[_0x80bf('0x1e')]['code']===0x1f4){logger[_0x80bf('0x1e')]('ChatInteraction,\x20%s,\x20%s',_0x4d9de7,_0x518519[_0x80bf('0x1e')][_0x80bf('0x1f')]);return _0x4d3e85(_0x518519[_0x80bf('0x1e')][_0x80bf('0x1f')]);}logger[_0x80bf('0x1e')](_0x80bf('0x19'),_0x4d9de7,_0x518519[_0x80bf('0x1e')][_0x80bf('0x1f')]);return _0x369cbc(_0x518519['error']['message']);}else{logger['info'](_0x80bf('0x19'),_0x4d9de7,'request\x20sent');_0x369cbc(_0x518519[_0x80bf('0x20')][_0x80bf('0x1f')]);}})[_0x80bf('0x21')](function(_0x715c12){logger['error'](_0x80bf('0x19'),_0x4d9de7,_0x715c12);_0x4d3e85(_0x715c12);});});}function respondWithStatusCode(_0xd260eb,_0x3f34e4){_0x3f34e4=_0x3f34e4||0xcc;return function(_0x5f4183){if(_0x5f4183){return _0xd260eb['sendStatus'](_0x3f34e4);}return _0xd260eb['status'](_0x3f34e4)['end']();};}function respondWithResult(_0x895a94,_0x1a46d9){_0x1a46d9=_0x1a46d9||0xc8;return function(_0x1c8450){if(_0x1c8450){return _0x895a94[_0x80bf('0x22')](_0x1a46d9)[_0x80bf('0x23')](_0x1c8450);}};}function respondWithFilteredResult(_0x416d44,_0x181a9e){return function(_0x226e11){if(_0x226e11){var _0x27afdf=typeof _0x181a9e['offset']==='undefined'&&typeof _0x181a9e[_0x80bf('0x24')]===_0x80bf('0x25');var _0x78492a=_0x226e11['count'];var _0x5db8d6=_0x27afdf?0x0:_0x181a9e[_0x80bf('0x26')];var _0x3d4643=_0x27afdf?_0x226e11[_0x80bf('0x27')]:_0x181a9e[_0x80bf('0x26')]+_0x181a9e[_0x80bf('0x24')];var _0x29a4ba;if(_0x3d4643>=_0x78492a){_0x3d4643=_0x78492a;_0x29a4ba=0xc8;}else{_0x29a4ba=0xce;}_0x416d44['status'](_0x29a4ba);return _0x416d44['set'](_0x80bf('0x28'),_0x5db8d6+'-'+_0x3d4643+'/'+_0x78492a)[_0x80bf('0x23')](_0x226e11);}return null;};}function saveUpdates(_0x16d747){return function(_0x57876c){if(_0x57876c){return _0x57876c['update'](_0x16d747)[_0x80bf('0x29')](function(_0x55d8b5){return _0x55d8b5;});}return null;};}function removeEntity(_0x5e9208){return function(_0x2a12a0){if(_0x2a12a0){return _0x2a12a0[_0x80bf('0x2a')]()['then'](function(){_0x5e9208['status'](0xcc)[_0x80bf('0x2b')]();});}};}function handleEntityNotFound(_0x84b60c){return function(_0xf48ca2){if(!_0xf48ca2){_0x84b60c[_0x80bf('0x2c')](0x194);}return _0xf48ca2;};}function handleError(_0x152e6f,_0x5b1130){_0x5b1130=_0x5b1130||0x1f4;return function(_0x54fa50){logger[_0x80bf('0x1e')](_0x54fa50[_0x80bf('0x2d')]);if(_0x54fa50['name']){delete _0x54fa50[_0x80bf('0x2e')];}_0x152e6f[_0x80bf('0x22')](_0x5b1130)[_0x80bf('0x2f')](_0x54fa50);};}function getMustacheRender(_0x5e241d,_0x5c88be){return Mustache[_0x80bf('0x30')](_0x5e241d,_[_0x80bf('0x31')](_0x5c88be['body'],{'contact':_0x5c88be[_0x80bf('0x32')],'message':_0x5c88be[_0x80bf('0x1f')],'agent':_0x5c88be[_0x80bf('0x33')],'interaction':_0x5c88be[_0x80bf('0x34')],'account':_0x5c88be[_0x80bf('0x35')]}))||'';}exports['index']=function(_0x1fe860,_0x5ed9ac){var _0x46b0ab={};var _0x19dd68=_[_0x80bf('0x36')](db['ChatInteraction'][_0x80bf('0x37')],function(_0x12a56f){return{'name':_0x12a56f['fieldName'],'type':_0x12a56f[_0x80bf('0x38')]['key']};});_0x46b0ab=qs[_0x80bf('0x39')](_0x19dd68,_0x1fe860);return interaction[_0x80bf('0x3a')]('chat',_0x1fe860[_0x80bf('0x3b')],_0x1fe860[_0x80bf('0x3c')],_0x46b0ab,_0x19dd68)[_0x80bf('0x29')](respondWithFilteredResult(_0x5ed9ac,_0x46b0ab))[_0x80bf('0x21')](handleError(_0x5ed9ac,null));};exports[_0x80bf('0x3d')]=function(_0x323c2b,_0x44ba28){var _0x35a413={'raw':![],'where':{'id':_0x323c2b[_0x80bf('0x3e')]['id']}},_0x1bf88e={};_0x1bf88e[_0x80bf('0x3f')]=_['keys'](db['ChatInteraction']['rawAttributes']);_0x1bf88e[_0x80bf('0x3b')]=_[_0x80bf('0x40')](_0x323c2b[_0x80bf('0x3b')]);_0x1bf88e[_0x80bf('0x41')]=_[_0x80bf('0x42')](_0x1bf88e[_0x80bf('0x3f')],_0x1bf88e[_0x80bf('0x3b')]);_0x35a413[_0x80bf('0x43')]=_[_0x80bf('0x42')](_0x1bf88e[_0x80bf('0x3f')],qs['fields'](_0x323c2b[_0x80bf('0x3b')][_0x80bf('0x44')]));_0x35a413[_0x80bf('0x43')]=_0x35a413['attributes'][_0x80bf('0x45')]?_0x35a413['attributes']:_0x1bf88e[_0x80bf('0x3f')];if(_0x323c2b['query']['includeAll']){_0x35a413[_0x80bf('0x46')]=[{'all':!![]}];}_0x35a413=_[_0x80bf('0x31')]({},_0x35a413,_0x323c2b['options']);return db[_0x80bf('0x47')][_0x80bf('0x48')](_0x35a413)[_0x80bf('0x29')](handleEntityNotFound(_0x44ba28,null))['then'](respondWithResult(_0x44ba28,null))[_0x80bf('0x21')](handleError(_0x44ba28,null));};exports[_0x80bf('0x49')]=function(_0x1db7d7,_0xedfe8e){return db[_0x80bf('0x47')]['create'](_0x1db7d7[_0x80bf('0x4a')],{})[_0x80bf('0x29')](respondWithResult(_0xedfe8e,0xc9))['catch'](handleError(_0xedfe8e,null));};exports[_0x80bf('0x4b')]=function(_0x3e81a1,_0x3673f0){if(_0x3e81a1[_0x80bf('0x4a')]['id']){delete _0x3e81a1['body']['id'];}return db['ChatInteraction'][_0x80bf('0x48')]({'where':{'id':_0x3e81a1[_0x80bf('0x3e')]['id']}})[_0x80bf('0x29')](handleEntityNotFound(_0x3673f0,null))[_0x80bf('0x29')](saveUpdates(_0x3e81a1[_0x80bf('0x4a')],null))[_0x80bf('0x29')](respondWithResult(_0x3673f0,null))[_0x80bf('0x21')](handleError(_0x3673f0,null));};exports[_0x80bf('0x2a')]=function(_0x195343,_0x558528){return db[_0x80bf('0x47')][_0x80bf('0x48')]({'where':{'id':_0x195343[_0x80bf('0x3e')]['id']}})['then'](handleEntityNotFound(_0x558528,null))[_0x80bf('0x29')](removeEntity(_0x558528,null))['catch'](handleError(_0x558528,null));};exports[_0x80bf('0x4c')]=function(_0x23db3d,_0x401952){return db[_0x80bf('0x47')][_0x80bf('0x4c')]()[_0x80bf('0x29')](respondWithResult(_0x401952,null))[_0x80bf('0x21')](handleError(_0x401952,null));};exports[_0x80bf('0x4d')]=function(_0x4b1fd6,_0xa94fb7){var _0x51bbc9=_0x4b1fd6['params']['id'];var _0x1a2240;var _0x4f9252;var _0x270338;return db[_0x80bf('0x47')][_0x80bf('0x4e')]({'where':{'id':_0x51bbc9}})[_0x80bf('0x29')](function(_0x486285){_0x1a2240=_0x486285;return db[_0x80bf('0x4f')]['findOne']({'where':{'id':_0x486285[_0x80bf('0x50')]},'attributes':['id',_0x80bf('0x51'),'vidaooEscalation',_0x80bf('0x52'),'vidaooNote','vidaooMetadata'],'raw':!![]});})[_0x80bf('0x29')](function(_0x2985ec){if(_0x2985ec&&_0x2985ec[_0x80bf('0x51')]&&_0x2985ec[_0x80bf('0x53')]){_0x4f9252=_0x2985ec;var _0x59d548={'interaction':{'id':_0x51bbc9},'agent':{'id':_0x4b1fd6[_0x80bf('0x3c')]['id'],'name':_0x4b1fd6[_0x80bf('0x3c')][_0x80bf('0x2e')],'fullname':_0x4b1fd6[_0x80bf('0x3c')]['fullname'],'email':_0x4b1fd6[_0x80bf('0x3c')]['email']},'contact':_0x4b1fd6[_0x80bf('0x4a')][_0x80bf('0x32')],'account':_0x4b1fd6[_0x80bf('0x4a')][_0x80bf('0x35')]};var _0x52ba59={'rejectUnauthorized':![],'method':_0x80bf('0x54'),'url':_0x80bf('0x55'),'headers':{'X-APIKEY':_0x2985ec['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x4b1fd6[_0x80bf('0x3c')][_0x80bf('0x56')]],'buttons':null,'topic':_0x4f9252[_0x80bf('0x52')],'note':_[_0x80bf('0x57')](_0x4f9252[_0x80bf('0x58')])?null:getMustacheRender(_0x4f9252['vidaooNote'],_0x59d548),'metadata':null},'redirect':_0x80bf('0x59'),'json':!![]};try{if(!_['isNull'](_0x4f9252['vidaooMetadata'])){var _0x8718cd=getMustacheRender(_0x4f9252[_0x80bf('0x5a')],_0x59d548);var _0xae0408=JSON['parse'](_0x8718cd);_0x52ba59[_0x80bf('0x4a')][_0x80bf('0x5b')]=_0xae0408;}}catch(_0x4acd59){throw new db[(_0x80bf('0x5c'))]['ValidationError'](_0x80bf('0x5d'));}return rp(_0x52ba59);}else{throw new db[(_0x80bf('0x5c'))][(_0x80bf('0x5e'))](_0x80bf('0x5f'));}})['then'](function(_0x51660f){_0x270338=_0x51660f;if(_0x270338['id']){var _0x1cb594={'body':_0x270338[_0x80bf('0x60')],'ChatWebsiteId':_0x4f9252['id'],'ChatInteractionId':_0x1a2240['id'],'direction':_0x80bf('0x61'),'UserId':_0x4b1fd6['user']['id']};return db[_0x80bf('0x62')][_0x80bf('0x49')](_0x1cb594,{});}else{throw new db[(_0x80bf('0x5c'))][(_0x80bf('0x5e'))](_0x80bf('0x63'));}})[_0x80bf('0x29')](function(){return _0x1a2240[_0x80bf('0x64')]({'vidaooSessionId':_0x270338['id']});})[_0x80bf('0x29')](respondWithResult(_0xa94fb7,null))[_0x80bf('0x21')](handleError(_0xa94fb7,null));};exports[_0x80bf('0x65')]=function(_0x5c806e,_0x4f66dd){if(_0x5c806e[_0x80bf('0x4a')]['id']){delete _0x5c806e[_0x80bf('0x4a')]['id'];}return db[_0x80bf('0x47')][_0x80bf('0x48')]({'where':{'id':_0x5c806e[_0x80bf('0x3e')]['id']},'include':[{'model':db[_0x80bf('0x66')],'as':'Contact'}]})[_0x80bf('0x29')](handleEntityNotFound(_0x4f66dd,null))[_0x80bf('0x29')](saveUpdates(_0x5c806e['body'],null))[_0x80bf('0x29')](respondWithResult(_0x4f66dd,null))['catch'](handleError(_0x4f66dd,null));};exports['abandon']=function(_0x4c3098,_0x465f04){if(_0x4c3098[_0x80bf('0x4a')]['id']){delete _0x4c3098[_0x80bf('0x4a')]['id'];}return db[_0x80bf('0x47')][_0x80bf('0x48')]({'where':{'id':_0x4c3098[_0x80bf('0x3e')]['id']}})['then'](function(_0x55d9b1){if(!_0x55d9b1){logger['error'](_0x80bf('0x67'),_0x80bf('0x68'),0x194,'entity\x20not\x20found');_0x465f04[_0x80bf('0x2c')](0x194);}else{if(_0x55d9b1[_0x80bf('0x69')]){throw new db[(_0x80bf('0x5c'))]['ValidationError']('Interaction\x20already\x20assigned');}}return _0x55d9b1;})[_0x80bf('0x29')](function(_0x788d64){if(_0x788d64){return _0x788d64['update']({'closed':_0x4c3098[_0x80bf('0x4a')][_0x80bf('0x6a')],'disposition':_0x4c3098[_0x80bf('0x4a')][_0x80bf('0x6b')]})[_0x80bf('0x29')](function(_0x2f3337){return _0x2f3337;});}})['then'](function(){return respondWithRpcPromise('AbandonInteraction',_0x80bf('0x68'),_0x4c3098[_0x80bf('0x4a')],client9004);})[_0x80bf('0x29')](respondWithResult(_0x465f04,null))[_0x80bf('0x21')](handleError(_0x465f04,null));};exports[_0x80bf('0x6c')]=function(_0x4828a4,_0x5d16f8){_0x4828a4[_0x80bf('0x4a')][_0x80bf('0x2e')]=_0x4828a4[_0x80bf('0x6d')]['originalname'];_0x4828a4[_0x80bf('0x4a')][_0x80bf('0x6e')]=_0x4828a4['file'][_0x80bf('0x6f')];_0x4828a4[_0x80bf('0x4a')][_0x80bf('0x38')]=_0x4828a4[_0x80bf('0x6d')][_0x80bf('0x70')];return db[_0x80bf('0x71')][_0x80bf('0x49')](_0x4828a4['body'])[_0x80bf('0x29')](respondWithResult(_0x5d16f8,0xc9))[_0x80bf('0x21')](handleError(_0x5d16f8,null));};exports['attachmentDownload']=function(_0x173faf,_0x67bd3){return db[_0x80bf('0x47')][_0x80bf('0x4e')]({'where':{'id':_0x173faf[_0x80bf('0x3e')]['id']},'raw':!![]})[_0x80bf('0x29')](handleEntityNotFound(_0x67bd3,null))[_0x80bf('0x29')](function(_0xd8635a){if(_0xd8635a){if(_0xd8635a['closed']){return _0x67bd3[_0x80bf('0x22')](0x193)['json']({'status':0x193,'message':_0x80bf('0x72')});}return db[_0x80bf('0x71')][_0x80bf('0x4e')]({'where':{'id':_0x173faf['query'][_0x80bf('0x73')]},'raw':!![]})[_0x80bf('0x29')](handleEntityNotFound(_0x67bd3,null));}})['then'](function(_0x208594){if(_0x208594){var _0x7a0d55=_0x208594['ChatOfflineMessageId']!==null;var _0xb59baf=path['join'](config['root'],_0x80bf('0x74'));if(_0x7a0d55){_0xb59baf=path[_0x80bf('0x75')](_0xb59baf,'offline-chat/');}var _0x4f4bf6=path['join'](_0xb59baf,_0x208594['basename']);return _0x67bd3['download'](_0x4f4bf6);}})[_0x80bf('0x21')](handleError(_0x67bd3,null));};exports['close']=function(_0x252f41,_0xab147a){var _0x6663ea=null;var _0x184558=null;var _0x2a9f2c=null;if(_0x252f41[_0x80bf('0x4a')]['id']){delete _0x252f41[_0x80bf('0x4a')]['id'];}if(_0x252f41[_0x80bf('0x4a')][_0x80bf('0x76')]){_0x2a9f2c=path['join'](config[_0x80bf('0x77')],'server/files/chat/upload/',util[_0x80bf('0x78')](_0x80bf('0x79'),Date[_0x80bf('0x7a')]()));_0x252f41[_0x80bf('0x4a')][_0x80bf('0x7b')]=_0x2a9f2c;}return db[_0x80bf('0x47')][_0x80bf('0x48')]({'where':{'id':_0x252f41[_0x80bf('0x3e')]['id']},'include':[{'model':db[_0x80bf('0x62')],'as':_0x80bf('0x7c'),'include':[{'model':db[_0x80bf('0x7d')],'as':'User'}]}]})[_0x80bf('0x29')](handleEntityNotFound(_0xab147a,null))[_0x80bf('0x29')](saveUpdates(_0x252f41[_0x80bf('0x4a')],null))[_0x80bf('0x29')](function(_0x1a29b4){if(_0x1a29b4){_0x6663ea=_0x1a29b4;return db[_0x80bf('0x4f')][_0x80bf('0x48')]({'where':{'id':_0x6663ea[_0x80bf('0x50')]}});}})['then'](function(_0x5756fa){if(_0x5756fa){_0x184558=_0x5756fa;return db[_0x80bf('0x66')][_0x80bf('0x48')]({'where':{'id':_0x6663ea[_0x80bf('0x7e')]}});}})[_0x80bf('0x29')](function(_0x4810ec){if(_0x4810ec){if(_0x2a9f2c){var _0x54cc4d=null;for(var _0xe1ddf1=0x1;_0xe1ddf1<_0x6663ea[_0x80bf('0x7c')]['length'];++_0xe1ddf1){_0x54cc4d=_0x6663ea[_0x80bf('0x7c')][_0xe1ddf1];var _0x1b19d4=_0x54cc4d[_0x80bf('0x69')]?util[_0x80bf('0x78')](_0x80bf('0x7f'),_0x184558[_0x80bf('0x80')],_0x54cc4d[_0x80bf('0x69')]):_0x80bf('0x81');var _0x33205f=_0x252f41['body'][_0x80bf('0x82')]||util['format'](_0x80bf('0x7f'),_0x80bf('0x83'),_0x54cc4d[_0x80bf('0x7e')]);switch(_0x184558['agentIdentifier']){case _0x80bf('0x84'):_0x1b19d4=_0x54cc4d[_0x80bf('0x69')]?util[_0x80bf('0x78')](_0x80bf('0x7f'),_0x184558[_0x80bf('0x80')],_0x54cc4d[_0x80bf('0x69')]):_0x80bf('0x81');break;case'agent_alias':_0x1b19d4=_0x54cc4d[_0x80bf('0x69')]?_0x54cc4d['User'][_0x80bf('0x85')]||_0x54cc4d[_0x80bf('0x7d')][_0x80bf('0x86')]:_0x80bf('0x81');break;case'agent_fullname':_0x1b19d4=_0x54cc4d[_0x80bf('0x69')]?_0x54cc4d[_0x80bf('0x7d')]['fullname']:'System';break;default:_0x1b19d4=_0x54cc4d['UserId']?util[_0x80bf('0x78')](_0x80bf('0x7f'),_0x184558['agentAlias'],_0x54cc4d[_0x80bf('0x69')]):_0x80bf('0x81');}var _0x2612c9=util[_0x80bf('0x78')](_0x80bf('0x87'),moment(_0x54cc4d[_0x80bf('0x88')])[_0x80bf('0x78')](_0x80bf('0x89')),_0x54cc4d[_0x80bf('0x8a')]==='in'?_0x33205f:_0x1b19d4,_0x54cc4d['body']);if(!_0x54cc4d[_0x80bf('0x8b')]){fs['appendFileSync'](_0x2a9f2c,_0x2612c9);}}return db[_0x80bf('0x8c')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x80bf('0x8d')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x80bf('0x8e')],'as':_0x80bf('0x8e'),'raw':!![]}]}]});}}})['then'](function(_0x400c64){if(!_0x400c64||!_0x400c64[_0x80bf('0x8f')]||!_0x252f41['body'])return _0x6663ea;var _0x10cf8d=_0x400c64[_0x80bf('0x90')]();return respondWithRpcPromise('SendMail','sendMail',{'account':_0x10cf8d,'message':{'from':util[_0x80bf('0x78')](_0x80bf('0x91'),_0x400c64[_0x80bf('0x2e')],_0x400c64[_0x80bf('0x56')]||_0x400c64[_0x80bf('0x8f')][_0x80bf('0x3c')]),'to':_0x252f41[_0x80bf('0x4a')][_0x80bf('0x76')],'subject':_0x80bf('0x92'),'text':util[_0x80bf('0x78')](_0x80bf('0x93'),_0x252f41['body'][_0x80bf('0x76')]),'attachments':[{'path':_0x2a9f2c}]}})[_0x80bf('0x29')](function(){return _0x6663ea;})['catch'](function(_0x25315b){logger[_0x80bf('0x1e')](_0x25315b);});})[_0x80bf('0x29')](respondWithStatusCode(_0xab147a,0xc8))[_0x80bf('0x21')](handleError(_0xab147a,null));};exports[_0x80bf('0x94')]=function(_0x73236f,_0x5abf86){return db[_0x80bf('0x62')][_0x80bf('0x48')]({'where':{'id':_0x73236f[_0x80bf('0x3e')]['id']}})[_0x80bf('0x29')](handleEntityNotFound(_0x5abf86,null))['then'](function(_0x5c531d){if(_0x5c531d){return _0x5c531d['addMessage'](_0x73236f['body'][_0x80bf('0x95')],_[_0x80bf('0x96')](_0x73236f[_0x80bf('0x4a')],[_0x80bf('0x95'),'id'])||{});}})[_0x80bf('0x29')](respondWithResult(_0x5abf86,null))['catch'](handleError(_0x5abf86,null));};exports[_0x80bf('0x97')]=function(_0x178130,_0x1f2d5c){var _0x1ffb69={'raw':![],'where':{}};var _0x3e4053={};var _0x2b0914={'count':0x0,'rows':[]};return db[_0x80bf('0x47')][_0x80bf('0x4e')]({'where':{'id':_0x178130[_0x80bf('0x3e')]['id']}})['then'](handleEntityNotFound(_0x1f2d5c,null))['then'](function(_0x52ef63){if(_0x52ef63){_0x3e4053[_0x80bf('0x3f')]=_[_0x80bf('0x40')](db[_0x80bf('0x62')][_0x80bf('0x37')]);_0x3e4053[_0x80bf('0x3b')]=_[_0x80bf('0x40')](_0x178130[_0x80bf('0x3b')]);_0x3e4053[_0x80bf('0x41')]=_[_0x80bf('0x42')](_0x3e4053['model'],_0x3e4053[_0x80bf('0x3b')]);_0x1ffb69[_0x80bf('0x43')]=_[_0x80bf('0x42')](_0x3e4053[_0x80bf('0x3f')],qs['fields'](_0x178130['query'][_0x80bf('0x44')]));_0x1ffb69[_0x80bf('0x43')]=_0x1ffb69[_0x80bf('0x43')][_0x80bf('0x45')]?_0x1ffb69[_0x80bf('0x43')]:_0x3e4053[_0x80bf('0x3f')];if(!_0x178130[_0x80bf('0x3b')]['hasOwnProperty'](_0x80bf('0x98'))){_0x1ffb69['limit']=qs[_0x80bf('0x24')](_0x178130[_0x80bf('0x3b')]['limit']);_0x1ffb69[_0x80bf('0x26')]=qs[_0x80bf('0x26')](_0x178130[_0x80bf('0x3b')]['offset']);}_0x1ffb69['order']=qs[_0x80bf('0x99')](_0x178130[_0x80bf('0x3b')][_0x80bf('0x99')]);_0x1ffb69[_0x80bf('0x9a')]=qs[_0x80bf('0x41')](_[_0x80bf('0x9b')](_0x178130[_0x80bf('0x3b')],_0x3e4053[_0x80bf('0x41')]));_0x1ffb69[_0x80bf('0x9a')][_0x80bf('0x9c')]=_0x52ef63['id'];if(_0x178130[_0x80bf('0x3b')][_0x80bf('0x9d')]){_0x1ffb69[_0x80bf('0x9a')]=_[_0x80bf('0x31')](_0x1ffb69[_0x80bf('0x9a')],{'$or':_['map'](_0x1ffb69[_0x80bf('0x43')],function(_0x2729f2){var _0x29ed72={};_0x29ed72[_0x2729f2]={'$like':'%'+_0x178130['query']['filter']+'%'};return _0x29ed72;})});}if(_0x178130[_0x80bf('0x3b')]['$gte']){var _0x390b36=_0x178130[_0x80bf('0x3b')]['$gte'][_0x80bf('0x9e')](',');var _0x3d573b={};_0x3d573b[_0x390b36[0x0]]={'$gte':moment(_0x390b36[0x1])['format'](_0x80bf('0x9f'))};_0x1ffb69[_0x80bf('0x9a')]=_[_0x80bf('0x31')](_0x1ffb69[_0x80bf('0x9a')],_0x3d573b);}_0x1ffb69=_[_0x80bf('0x31')]({},_0x1ffb69,_0x178130[_0x80bf('0xa0')]);return db[_0x80bf('0x62')][_0x80bf('0x27')]({'where':_0x1ffb69['where']})[_0x80bf('0x29')](function(_0x4e7c7b){_0x2b0914[_0x80bf('0x27')]=_0x4e7c7b;if(_0x178130[_0x80bf('0x3b')][_0x80bf('0xa1')]){_0x1ffb69[_0x80bf('0x46')]=[{'all':!![]}];}return db[_0x80bf('0x62')][_0x80bf('0x3a')](_0x1ffb69);})[_0x80bf('0x29')](function(_0x4a3153){_0x2b0914[_0x80bf('0xa2')]=_0x4a3153;return _0x2b0914;});}})[_0x80bf('0x29')](respondWithFilteredResult(_0x1f2d5c,_0x1ffb69))['catch'](handleError(_0x1f2d5c,null));};exports[_0x80bf('0xa3')]=function(_0x2c99dd,_0x49494b){var _0x1ebcc5={'where':{}},_0x5beae4={},_0x11544d={'count':0x0,'rows':[]};return db[_0x80bf('0x47')]['findOne']({'where':{'id':_0x2c99dd[_0x80bf('0x3e')]['id']}})['then'](handleEntityNotFound(_0x49494b,null))[_0x80bf('0x29')](function(_0x426664){if(_0x426664){_0x5beae4[_0x80bf('0x3f')]=_[_0x80bf('0x40')](db[_0x80bf('0x62')]['rawAttributes']);_0x5beae4[_0x80bf('0x3b')]=_['keys'](_0x2c99dd[_0x80bf('0x3b')]);_0x5beae4[_0x80bf('0x41')]=_[_0x80bf('0x42')](_0x5beae4[_0x80bf('0x3f')],_0x5beae4[_0x80bf('0x3b')]);_0x1ebcc5[_0x80bf('0x43')]=_[_0x80bf('0x42')](_0x5beae4[_0x80bf('0x3f')],qs[_0x80bf('0x44')](_0x2c99dd['query'][_0x80bf('0x44')]));_0x1ebcc5['attributes']=_0x1ebcc5[_0x80bf('0x43')][_0x80bf('0x45')]?_0x1ebcc5['attributes']:_0x5beae4['model'];if(!_0x2c99dd[_0x80bf('0x3b')]['hasOwnProperty']('nolimit')){_0x1ebcc5[_0x80bf('0x24')]=qs['limit'](_0x2c99dd[_0x80bf('0x3b')][_0x80bf('0x24')]);_0x1ebcc5[_0x80bf('0x26')]=qs[_0x80bf('0x26')](_0x2c99dd['query'][_0x80bf('0x26')]);}_0x1ebcc5[_0x80bf('0xa4')]=qs[_0x80bf('0x99')](_0x2c99dd[_0x80bf('0x3b')][_0x80bf('0x99')]);_0x1ebcc5[_0x80bf('0x9a')]=qs['filters'](_[_0x80bf('0x9b')](_0x2c99dd[_0x80bf('0x3b')],_0x5beae4[_0x80bf('0x41')]));_0x1ebcc5['where'][_0x80bf('0x9c')]=_0x426664['id'];if(_0x2c99dd[_0x80bf('0x3b')]['filter']){_0x1ebcc5[_0x80bf('0x9a')]=_[_0x80bf('0x31')](_0x1ebcc5[_0x80bf('0x9a')],{'$or':_['map'](_0x1ebcc5['attributes'],function(_0x2ecec8){var _0x390579={};_0x390579[_0x2ecec8]={'$like':'%'+_0x2c99dd[_0x80bf('0x3b')][_0x80bf('0x9d')]+'%'};return _0x390579;})});}_0x1ebcc5['where'][_0x80bf('0x8b')]=![];if(_0x2c99dd[_0x80bf('0x3b')]['id']){_0x1ebcc5[_0x80bf('0x9a')]['id']={'$gt':_0x2c99dd[_0x80bf('0x3b')]['id']};}_0x1ebcc5=_[_0x80bf('0x31')]({},_0x1ebcc5,_0x2c99dd[_0x80bf('0xa0')]);return db[_0x80bf('0x62')][_0x80bf('0x27')]({'where':_0x1ebcc5['where']})['then'](function(_0x2a536e){_0x11544d[_0x80bf('0x27')]=_0x2a536e;_0x1ebcc5['include']=[];if(_0x2c99dd[_0x80bf('0x3b')]['includeAgent']){_0x1ebcc5['include']['push']({'model':db[_0x80bf('0x7d')],'as':_0x80bf('0x7d'),'attributes':['id','fullname',_0x80bf('0x85')]});}if(_0x2c99dd['query']['includeAll']){_0x1ebcc5[_0x80bf('0x46')]=[{'all':!![]}];}return db['ChatMessage'][_0x80bf('0x3a')](_0x1ebcc5);})[_0x80bf('0x29')](function(_0x16a966){_0x11544d[_0x80bf('0xa2')]=_0x16a966;return _0x11544d;});}})['then'](respondWithFilteredResult(_0x49494b,_0x1ebcc5))[_0x80bf('0x21')](handleError(_0x49494b,null));};exports[_0x80bf('0xa5')]=function(_0x4fe387,_0x47596b){return db[_0x80bf('0x47')][_0x80bf('0x48')]({'where':{'id':_0x4fe387[_0x80bf('0x3e')]['id']}})[_0x80bf('0x29')](handleEntityNotFound(_0x47596b,null))[_0x80bf('0x29')](function(_0x20bdbc){if(_0x20bdbc){return _0x20bdbc[_0x80bf('0xa6')](_0x4fe387[_0x80bf('0x4a')]['ids'],_[_0x80bf('0x96')](_0x4fe387[_0x80bf('0x4a')],[_0x80bf('0x95'),'id'])||{})[_0x80bf('0xa7')](function(){return db[_0x80bf('0xa8')][_0x80bf('0x3a')]({'attributes':['id',_0x80bf('0x2e'),'color'],'where':{'id':_0x4fe387[_0x80bf('0x4a')][_0x80bf('0x95')]}});})['then'](function(_0xbfda8){socket['emit'](_0x80bf('0xa9'),{'id':Number(_0x4fe387[_0x80bf('0x3e')]['id']),'tags':_0xbfda8||[]});return{'id':Number(_0x4fe387[_0x80bf('0x3e')]['id']),'tags':_0xbfda8||[]};});}})['then'](respondWithResult(_0x47596b,null))[_0x80bf('0x21')](handleError(_0x47596b,null));};exports['removeTags']=function(_0x741922,_0x1769da){return db[_0x80bf('0x47')][_0x80bf('0x48')]({'where':{'id':_0x741922[_0x80bf('0x3e')]['id']}})[_0x80bf('0x29')](handleEntityNotFound(_0x1769da,null))[_0x80bf('0x29')](function(_0x4211d5){if(_0x4211d5){return _0x4211d5[_0x80bf('0xaa')](_0x741922[_0x80bf('0x3b')][_0x80bf('0x95')]);}})[_0x80bf('0x29')](respondWithStatusCode(_0x1769da,null))[_0x80bf('0x21')](handleError(_0x1769da,null));};exports['download']=function(_0x35e31d,_0x1a67d2){var _0x44279a=moment()[_0x80bf('0xab')]()[_0x80bf('0xac')]();var _0x1d3f55=path[_0x80bf('0x75')](config[_0x80bf('0x77')],_0x80bf('0xad'),_0x80bf('0xae'),'tmp');var _0x50c668=path[_0x80bf('0x75')](config[_0x80bf('0x77')],'server',_0x80bf('0xae'),_0x80bf('0xaf'));var _0x342a5f=path[_0x80bf('0x75')](_0x1d3f55,_0x44279a);var _0x1d240e=util['format'](_0x80bf('0xb0'),_0x35e31d[_0x80bf('0x3e')]['id'],_0x44279a);var _0xf78aef=path[_0x80bf('0x75')](_0x1d3f55,_0x1d240e);var _0x484964=[];_0x484964[_0x80bf('0xb1')]({'model':db[_0x80bf('0x7d')],'as':_0x80bf('0x7d'),'attributes':['id','fullname'],'raw':!![]});_0x484964[_0x80bf('0xb1')]({'model':db[_0x80bf('0x66')],'as':'Contact','attributes':['id',_0x80bf('0xb2'),'lastName'],'raw':!![]});if(_0x35e31d[_0x80bf('0x3b')]['attachments']){_0x484964[_0x80bf('0xb1')]({'model':db[_0x80bf('0x71')],'as':_0x80bf('0x71'),'raw':!![]});}var _0x252adf=[{'model':db[_0x80bf('0x62')],'as':_0x80bf('0x7c'),'attributes':['id',_0x80bf('0x4a'),_0x80bf('0x88'),_0x80bf('0x8a'),'secret',_0x80bf('0xb3')],'include':_0x484964}];_0x252adf['push']({'model':db['ChatWebsite'],'as':_0x80bf('0xb4'),'attributes':['id',_0x80bf('0x2e')]});_0x252adf[_0x80bf('0xb1')]({'model':db[_0x80bf('0x7d')],'as':_0x80bf('0xb5'),'attributes':['id','fullname']});return db[_0x80bf('0x47')]['find']({'where':{'id':_0x35e31d[_0x80bf('0x3e')]['id']},'include':_0x252adf})[_0x80bf('0x29')](handleEntityNotFound(_0x1a67d2,null))[_0x80bf('0x29')](function(_0xdf2203){if(_0xdf2203){var _0x4a92a4=_0xdf2203[_0x80bf('0xb6')]({'plain':!![]});fs['mkdirSync'](_0x342a5f);var _0x37217d={'channel':'Chat','account':_0x4a92a4[_0x80bf('0xb4')]['name'],'agent':_0x4a92a4[_0x80bf('0xb5')]?_0x4a92a4[_0x80bf('0xb5')][_0x80bf('0x86')]:_0x80bf('0xb7'),'createdAt':moment(_0x4a92a4['createdAt'])[_0x80bf('0x78')](_0x80bf('0x9f'))[_0x80bf('0xac')](),'closedAt':_0x4a92a4[_0x80bf('0x6a')]?moment(_0x4a92a4[_0x80bf('0xb8')])[_0x80bf('0x78')](_0x80bf('0x9f'))[_0x80bf('0xac')]():'','disposition':_0x4a92a4[_0x80bf('0x6b')],'chatInfo':{'browser':_0x4a92a4[_0x80bf('0xb9')],'os':_0x4a92a4[_0x80bf('0xba')],'referer':_0x4a92a4[_0x80bf('0xbb')],'customerIp':_0x4a92a4['customerIp'],'customerPort':_0x4a92a4[_0x80bf('0xbc')]?_0x4a92a4[_0x80bf('0xbc')]:_0x80bf('0xb7')},'messages':_(_0x4a92a4['Messages'])[_0x80bf('0xbd')]()[_0x80bf('0x9d')]({'secret':![]})[_0x80bf('0x36')](function(_0x512c08){if(_0x512c08[_0x80bf('0x71')]){var _0x4307d7=path['join'](_0x50c668,_0x512c08[_0x80bf('0x71')][_0x80bf('0x6e')]);if(fs[_0x80bf('0xbe')](_0x4307d7)){fs[_0x80bf('0xbf')](_0x4307d7)[_0x80bf('0xc0')](fs['createWriteStream'](path['join'](_0x342a5f,_0x512c08[_0x80bf('0x71')][_0x80bf('0x6e')])));}}return{'date':moment(_0x512c08[_0x80bf('0x88')])[_0x80bf('0x78')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0x512c08['direction']===_0x80bf('0x61')?_0x512c08['User']?_0x512c08[_0x80bf('0x7d')][_0x80bf('0x86')]:_0x80bf('0x81'):_0x512c08['Contact'][_0x80bf('0xb2')]+(_0x512c08[_0x80bf('0xc1')][_0x80bf('0xc2')]?'\x20'+_0x512c08[_0x80bf('0xc1')][_0x80bf('0xc2')]:''),'body':_0x512c08[_0x80bf('0x71')]?_0x512c08[_0x80bf('0x71')][_0x80bf('0x6e')]:_0x512c08[_0x80bf('0x4a')],'direction':_0x512c08['direction']===_0x80bf('0x61')?'A':'C','secret':_0x512c08[_0x80bf('0x8b')],'read':_0x512c08[_0x80bf('0xb3')],'attachment':_0x512c08[_0x80bf('0x71')]};})[_0x80bf('0xc3')]()};return ejs[_0x80bf('0xc4')](path['join'](config[_0x80bf('0x77')],_0x80bf('0xad'),_0x80bf('0xc5'),_0x80bf('0xc6')),{'interaction':_0x37217d})[_0x80bf('0x29')](function(_0x30b1e2){var _0x2d99a6=path[_0x80bf('0x75')](_0x342a5f,_0x80bf('0xc7')+_0x4a92a4['id']+'-'+_0x44279a+_0x80bf('0xc8'));var _0x4d5bdc={'path':_0x2d99a6,'channel':_0x80bf('0xc9'),'interactionId':_0x4a92a4['id']};return pdf[_0x80bf('0xca')](_0x30b1e2,_0x4d5bdc);})[_0x80bf('0x29')](function(){return new Promise(function(_0x2df7f8,_0x9bead5){zipdir(_0x342a5f,{'saveTo':_0xf78aef},function(_0x1034d1,_0x2a802f){if(_0x1034d1)return _0x9bead5(_0x1034d1);return _0x2df7f8(_0x2a802f);});})[_0x80bf('0x29')](function(){return new BPromise(function(_0x18d413,_0xdb399e){rimraf(_0x342a5f,function(_0x5ae38e){if(_0x5ae38e)_0xdb399e(_0x5ae38e);return _0x18d413();});});})[_0x80bf('0x29')](function(){return _0x1a67d2[_0x80bf('0xcb')](_0xf78aef,_0x1d240e,function(_0xe80bdb){if(_0xe80bdb){logger['error'](_0x80bf('0xcc'),_0xe80bdb);}else{fs[_0x80bf('0xcd')](_0xf78aef);}});});});}else{return _0x1a67d2[_0x80bf('0x2c')](0xc8);}})[_0x80bf('0x21')](handleError(_0x1a67d2,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 18b2bf0..9a765b9 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 _0xb087=['unreadMessages','length','emit','hasOwnProperty','hook','exports','ChatInteraction','../../mysqldb','ChatMessage','setMaxListeners','save','remove','getUsers','then','setDataValue','Users','map','findAll'];(function(_0x461ee0,_0xce9a89){var _0x3e3817=function(_0x5cb49a){while(--_0x5cb49a){_0x461ee0['push'](_0x461ee0['shift']());}};_0x3e3817(++_0xce9a89);}(_0xb087,0x84));var _0x7b08=function(_0x2d53c9,_0x1d2112){_0x2d53c9=_0x2d53c9-0x0;var _0x30ccf3=_0xb087[_0x2d53c9];return _0x30ccf3;};'use strict';var EventEmitter=require('events');var ChatInteraction=require('../../mysqldb')['db'][_0x7b08('0x0')];var ChatMessage=require(_0x7b08('0x1'))['db'][_0x7b08('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x7b08('0x3')](0x0);var events={'afterCreate':_0x7b08('0x4'),'afterUpdate':'update','afterDestroy':_0x7b08('0x5')};function emitEvent(_0x32c7ac){return function(_0x4350b8,_0x1ccdff,_0x185448){_0x4350b8[_0x7b08('0x6')]({'attributes':['id'],'raw':!![]})[_0x7b08('0x7')](function(_0x560680){_0x4350b8[_0x7b08('0x8')](_0x7b08('0x9'),_0x560680[_0x7b08('0xa')](function(_0x20d6a5){return{'id':_0x20d6a5['id']};}));return ChatMessage[_0x7b08('0xb')]({'where':{'ChatInteractionId':_0x4350b8['id'],'direction':'in','read':![]},'raw':!![]});})[_0x7b08('0x7')](function(_0x2b031a){_0x4350b8[_0x7b08('0x8')](_0x7b08('0xc'),_0x2b031a[_0x7b08('0xd')]);ChatInteractionEvents['emit'](_0x32c7ac+':'+_0x4350b8['id'],_0x4350b8);ChatInteractionEvents[_0x7b08('0xe')](_0x32c7ac,_0x4350b8);_0x185448(null);})['catch'](_0x185448(null));};}for(var e in events){if(events[_0x7b08('0xf')](e)){var event=events[e];ChatInteraction[_0x7b08('0x10')](e,emitEvent(event));}}module[_0x7b08('0x11')]=ChatInteractionEvents; \ No newline at end of file +var _0xd565=['setMaxListeners','update','remove','getUsers','then','setDataValue','Users','unreadMessages','length','emit','catch','hook','events','../../mysqldb','ChatMessage'];(function(_0x3a3a0f,_0x5e593b){var _0x187329=function(_0x1ae169){while(--_0x1ae169){_0x3a3a0f['push'](_0x3a3a0f['shift']());}};_0x187329(++_0x5e593b);}(_0xd565,0xde));var _0x5d56=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xd565[_0x42cae2];return _0x5f256f;};'use strict';var EventEmitter=require(_0x5d56('0x0'));var ChatInteraction=require('../../mysqldb')['db']['ChatInteraction'];var ChatMessage=require(_0x5d56('0x1'))['db'][_0x5d56('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x5d56('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x5d56('0x4'),'afterDestroy':_0x5d56('0x5')};function emitEvent(_0x3ce883){return function(_0x2cd9fc,_0x42f7ec,_0x1176e1){_0x2cd9fc[_0x5d56('0x6')]({'attributes':['id'],'raw':!![]})[_0x5d56('0x7')](function(_0x5de4e0){_0x2cd9fc[_0x5d56('0x8')](_0x5d56('0x9'),_0x5de4e0['map'](function(_0xcdcdc9){return{'id':_0xcdcdc9['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x2cd9fc['id'],'direction':'in','read':![]},'raw':!![]});})[_0x5d56('0x7')](function(_0xe87493){_0x2cd9fc[_0x5d56('0x8')](_0x5d56('0xa'),_0xe87493[_0x5d56('0xb')]);ChatInteractionEvents['emit'](_0x3ce883+':'+_0x2cd9fc['id'],_0x2cd9fc);ChatInteractionEvents[_0x5d56('0xc')](_0x3ce883,_0x2cd9fc);_0x1176e1(null);})[_0x5d56('0xd')](_0x1176e1(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0x5d56('0xe')](e,emitEvent(event));}}module['exports']=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index 2f7100f..5f46650 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 _0x38a0=['lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','ChatInteraction','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci'];(function(_0x53cdfd,_0x5acab4){var _0x4f1078=function(_0x591dd0){while(--_0x591dd0){_0x53cdfd['push'](_0x53cdfd['shift']());}};_0x4f1078(++_0x5acab4);}(_0x38a0,0xdd));var _0x038a=function(_0x4b33bf,_0x2654f9){_0x4b33bf=_0x4b33bf-0x0;var _0x46fa97=_0x38a0[_0x4b33bf];return _0x46fa97;};'use strict';var _=require(_0x038a('0x0'));var util=require(_0x038a('0x1'));var logger=require(_0x038a('0x2'))('api');var moment=require('moment');var BPromise=require(_0x038a('0x3'));var rp=require(_0x038a('0x4'));var fs=require('fs');var path=require(_0x038a('0x5'));var rimraf=require(_0x038a('0x6'));var config=require(_0x038a('0x7'));var attributes=require(_0x038a('0x8'));module[_0x038a('0x9')]=function(_0x3d21ed,_0x498184){return _0x3d21ed['define'](_0x038a('0xa'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4fa058,_0x4d1a3f,_0x3e31d3){if(_0x4fa058[_0x038a('0xb')](_0x038a('0xc'))){_0x4fa058[_0x038a('0xd')]=moment()['format'](_0x038a('0xe'));}_0x3e31d3(null,_0x4fa058);}},'charset':_0x038a('0xf'),'collate':_0x038a('0x10')});}; \ No newline at end of file +var _0x2191=['exports','define','ChatInteraction','chat_interactions','changed','closed','closedAt','format','lodash','../../config/logger','api','moment','../../config/environment','./chatInteraction.attributes'];(function(_0x1bb184,_0xed6071){var _0x4ea894=function(_0x2a9f85){while(--_0x2a9f85){_0x1bb184['push'](_0x1bb184['shift']());}};_0x4ea894(++_0xed6071);}(_0x2191,0x78));var _0x1219=function(_0x2adf0a,_0x40e60c){_0x2adf0a=_0x2adf0a-0x0;var _0x1effd4=_0x2191[_0x2adf0a];return _0x1effd4;};'use strict';var _=require(_0x1219('0x0'));var util=require('util');var logger=require(_0x1219('0x1'))(_0x1219('0x2'));var moment=require(_0x1219('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1219('0x4'));var attributes=require(_0x1219('0x5'));module[_0x1219('0x6')]=function(_0x59c185,_0x2f2aca){return _0x59c185[_0x1219('0x7')](_0x1219('0x8'),attributes,{'tableName':_0x1219('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1a0c90,_0x4a7c25,_0x150aab){if(_0x1a0c90[_0x1219('0xa')](_0x1219('0xb'))){_0x1a0c90[_0x1219('0xc')]=moment()[_0x1219('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}_0x150aab(null,_0x1a0c90);}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index 9f42183..422b345 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 _0x9c98=['addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','request','then','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','ChatInteraction,\x20%s,\x20%s','message','result','catch','UpdateChatInteraction','ChatInteraction','update','body','options','raw','where','attributes','limit','AddTagsToChatInteraction','find'];(function(_0x2a9c77,_0x56bc91){var _0x42fd82=function(_0x32c1df){while(--_0x32c1df){_0x2a9c77['push'](_0x2a9c77['shift']());}};_0x42fd82(++_0x56bc91);}(_0x9c98,0x1db));var _0x89c9=function(_0x16791d,_0x168bab){_0x16791d=_0x16791d-0x0;var _0x356c21=_0x9c98[_0x16791d];return _0x356c21;};'use strict';var _=require(_0x89c9('0x0'));var util=require(_0x89c9('0x1'));var moment=require(_0x89c9('0x2'));var BPromise=require(_0x89c9('0x3'));var rs=require(_0x89c9('0x4'));var fs=require('fs');var Redis=require(_0x89c9('0x5'));var db=require(_0x89c9('0x6'))['db'];var utils=require(_0x89c9('0x7'));var logger=require(_0x89c9('0x8'))(_0x89c9('0x9'));var config=require(_0x89c9('0xa'));var jayson=require(_0x89c9('0xb'));var client=jayson[_0x89c9('0xc')]['http']({'port':0x232a});config[_0x89c9('0xd')]=_[_0x89c9('0xe')](config[_0x89c9('0xd')],{'host':_0x89c9('0xf'),'port':0x18eb});var socket=require(_0x89c9('0x10'))(new Redis(config['redis']));require(_0x89c9('0x11'))[_0x89c9('0x12')](socket);function respondWithRpcPromise(_0x4d065e,_0x19ad46,_0x10dcac){return new BPromise(function(_0x26dcbe,_0x4a6e6f){return client[_0x89c9('0x13')](_0x4d065e,_0x10dcac)[_0x89c9('0x14')](function(_0xeb7a3b){logger[_0x89c9('0x15')]('ChatInteraction,\x20%s,\x20%s',_0x19ad46,_0x89c9('0x16'));logger[_0x89c9('0x17')](_0x89c9('0x18'),_0x19ad46,_0x89c9('0x16'),JSON[_0x89c9('0x19')](_0xeb7a3b));if(_0xeb7a3b[_0x89c9('0x1a')]){if(_0xeb7a3b[_0x89c9('0x1a')]['code']===0x1f4){logger['error'](_0x89c9('0x1b'),_0x19ad46,_0xeb7a3b[_0x89c9('0x1a')][_0x89c9('0x1c')]);return _0x4a6e6f(_0xeb7a3b['error'][_0x89c9('0x1c')]);}logger[_0x89c9('0x1a')](_0x89c9('0x1b'),_0x19ad46,_0xeb7a3b['error']['message']);return _0x26dcbe(_0xeb7a3b[_0x89c9('0x1a')][_0x89c9('0x1c')]);}else{logger['info'](_0x89c9('0x1b'),_0x19ad46,_0x89c9('0x16'));_0x26dcbe(_0xeb7a3b[_0x89c9('0x1d')]['message']);}})[_0x89c9('0x1e')](function(_0x395ed4){logger['error'](_0x89c9('0x1b'),_0x19ad46,_0x395ed4);_0x4a6e6f(_0x395ed4);});});}exports[_0x89c9('0x1f')]=function(_0x52d201){var _0x547a80=this;return new Promise(function(_0x57868b,_0xbe7b7){return db[_0x89c9('0x20')][_0x89c9('0x21')](_0x52d201[_0x89c9('0x22')],{'raw':_0x52d201[_0x89c9('0x23')]?_0x52d201['options'][_0x89c9('0x24')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x52d201['options']?_0x52d201[_0x89c9('0x23')][_0x89c9('0x25')]||null:null,'attributes':_0x52d201[_0x89c9('0x23')]?_0x52d201[_0x89c9('0x23')][_0x89c9('0x26')]||null:null,'limit':_0x52d201[_0x89c9('0x23')]?_0x52d201[_0x89c9('0x23')][_0x89c9('0x27')]||null:null})[_0x89c9('0x14')](function(_0x22f82a){logger[_0x89c9('0x15')]('UpdateChatInteraction',_0x52d201);logger[_0x89c9('0x17')]('UpdateChatInteraction',_0x52d201,JSON['stringify'](_0x22f82a));_0x57868b(_0x22f82a);})[_0x89c9('0x1e')](function(_0x56de15){logger[_0x89c9('0x1a')](_0x89c9('0x1f'),_0x56de15[_0x89c9('0x1c')],_0x52d201);_0xbe7b7(_0x547a80['error'](0x1f4,_0x56de15[_0x89c9('0x1c')]));});});};exports[_0x89c9('0x28')]=function(_0x3f71b9){return new Promise(function(_0x228194,_0x4a9a6b){return db[_0x89c9('0x20')][_0x89c9('0x29')]({'where':_0x3f71b9[_0x89c9('0x23')]?_0x3f71b9[_0x89c9('0x23')][_0x89c9('0x25')]||null:null})[_0x89c9('0x14')](function(_0x241537){if(_0x241537){return _0x241537[_0x89c9('0x2a')](_0x3f71b9[_0x89c9('0x22')][_0x89c9('0x2b')],_[_0x89c9('0x2c')](_0x3f71b9[_0x89c9('0x22')],[_0x89c9('0x2b'),'id'])||{});}})[_0x89c9('0x2d')](function(_0x4896bc){logger['info'](_0x89c9('0x2e'),_0x3f71b9);logger['debug'](_0x89c9('0x2e'),_0x3f71b9,JSON[_0x89c9('0x19')](_0x4896bc));_0x228194(_0x4896bc);})[_0x89c9('0x1e')](function(_0x10152c){logger[_0x89c9('0x1a')](_0x89c9('0x2e'),_0x10152c[_0x89c9('0x1c')],_0x3f71b9);_0x4a9a6b(_this[_0x89c9('0x1a')](0x1f4,_0x10152c['message']));});});}; \ No newline at end of file +var _0x8a51=['redis','localhost','socket.io-emitter','./chatInteraction.socket','register','info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','UpdateChatInteraction','update','options','raw','where','attributes','limit','then','AddTagsToChatInteraction','ChatInteraction','addTags','body','ids','omit','AddTags','stringify','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults'];(function(_0x11a7e4,_0x365992){var _0x1085b6=function(_0x458109){while(--_0x458109){_0x11a7e4['push'](_0x11a7e4['shift']());}};_0x1085b6(++_0x365992);}(_0x8a51,0xcf));var _0x18a5=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x8a51[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0x18a5('0x0'));var util=require('util');var moment=require(_0x18a5('0x1'));var BPromise=require(_0x18a5('0x2'));var rs=require(_0x18a5('0x3'));var fs=require('fs');var Redis=require(_0x18a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x18a5('0x5'));var logger=require(_0x18a5('0x6'))(_0x18a5('0x7'));var config=require(_0x18a5('0x8'));var jayson=require(_0x18a5('0x9'));var client=jayson[_0x18a5('0xa')][_0x18a5('0xb')]({'port':0x232a});config['redis']=_[_0x18a5('0xc')](config[_0x18a5('0xd')],{'host':_0x18a5('0xe'),'port':0x18eb});var socket=require(_0x18a5('0xf'))(new Redis(config[_0x18a5('0xd')]));require(_0x18a5('0x10'))[_0x18a5('0x11')](socket);function respondWithRpcPromise(_0xaabfa7,_0xbc2b29,_0x2c05ec){return new BPromise(function(_0x1152af,_0x28aabb){return client['request'](_0xaabfa7,_0x2c05ec)['then'](function(_0x3be47c){logger[_0x18a5('0x12')](_0x18a5('0x13'),_0xbc2b29,'request\x20sent');logger[_0x18a5('0x14')](_0x18a5('0x15'),_0xbc2b29,'request\x20sent',JSON['stringify'](_0x3be47c));if(_0x3be47c[_0x18a5('0x16')]){if(_0x3be47c['error'][_0x18a5('0x17')]===0x1f4){logger[_0x18a5('0x16')]('ChatInteraction,\x20%s,\x20%s',_0xbc2b29,_0x3be47c[_0x18a5('0x16')]['message']);return _0x28aabb(_0x3be47c[_0x18a5('0x16')]['message']);}logger[_0x18a5('0x16')](_0x18a5('0x13'),_0xbc2b29,_0x3be47c[_0x18a5('0x16')][_0x18a5('0x18')]);return _0x1152af(_0x3be47c['error']['message']);}else{logger[_0x18a5('0x12')](_0x18a5('0x13'),_0xbc2b29,_0x18a5('0x19'));_0x1152af(_0x3be47c[_0x18a5('0x1a')][_0x18a5('0x18')]);}})[_0x18a5('0x1b')](function(_0x52f6a6){logger[_0x18a5('0x16')](_0x18a5('0x13'),_0xbc2b29,_0x52f6a6);_0x28aabb(_0x52f6a6);});});}exports[_0x18a5('0x1c')]=function(_0x209760){var _0x2f5f94=this;return new Promise(function(_0x4e01e5,_0x171d38){return db['ChatInteraction'][_0x18a5('0x1d')](_0x209760['body'],{'raw':_0x209760[_0x18a5('0x1e')]?_0x209760[_0x18a5('0x1e')][_0x18a5('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x209760['options']?_0x209760[_0x18a5('0x1e')][_0x18a5('0x20')]||null:null,'attributes':_0x209760[_0x18a5('0x1e')]?_0x209760['options'][_0x18a5('0x21')]||null:null,'limit':_0x209760[_0x18a5('0x1e')]?_0x209760[_0x18a5('0x1e')][_0x18a5('0x22')]||null:null})[_0x18a5('0x23')](function(_0x4342eb){logger[_0x18a5('0x12')](_0x18a5('0x1c'),_0x209760);logger[_0x18a5('0x14')](_0x18a5('0x1c'),_0x209760,JSON['stringify'](_0x4342eb));_0x4e01e5(_0x4342eb);})[_0x18a5('0x1b')](function(_0x3692ce){logger[_0x18a5('0x16')](_0x18a5('0x1c'),_0x3692ce[_0x18a5('0x18')],_0x209760);_0x171d38(_0x2f5f94['error'](0x1f4,_0x3692ce[_0x18a5('0x18')]));});});};exports[_0x18a5('0x24')]=function(_0x345bd4){return new Promise(function(_0x488a97,_0x52400a){return db[_0x18a5('0x25')]['find']({'where':_0x345bd4['options']?_0x345bd4[_0x18a5('0x1e')][_0x18a5('0x20')]||null:null})[_0x18a5('0x23')](function(_0x5380fa){if(_0x5380fa){return _0x5380fa[_0x18a5('0x26')](_0x345bd4[_0x18a5('0x27')][_0x18a5('0x28')],_[_0x18a5('0x29')](_0x345bd4['body'],[_0x18a5('0x28'),'id'])||{});}})['spread'](function(_0xee15d2){logger[_0x18a5('0x12')](_0x18a5('0x2a'),_0x345bd4);logger[_0x18a5('0x14')](_0x18a5('0x2a'),_0x345bd4,JSON[_0x18a5('0x2b')](_0xee15d2));_0x488a97(_0xee15d2);})[_0x18a5('0x1b')](function(_0x3a6f15){logger[_0x18a5('0x16')](_0x18a5('0x2a'),_0x3a6f15[_0x18a5('0x18')],_0x345bd4);_0x52400a(_this['error'](0x1f4,_0x3a6f15[_0x18a5('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index abace7e..50b99f8 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 _0x2fbc=['update','removeListener','./chatInteraction.events','save','remove'];(function(_0x1d61b3,_0x29cd4a){var _0x137266=function(_0x200181){while(--_0x200181){_0x1d61b3['push'](_0x1d61b3['shift']());}};_0x137266(++_0x29cd4a);}(_0x2fbc,0x106));var _0xc2fb=function(_0x54ef1e,_0x218d4a){_0x54ef1e=_0x54ef1e-0x0;var _0x19c745=_0x2fbc[_0x54ef1e];return _0x19c745;};'use strict';var ChatInteractionEvents=require(_0xc2fb('0x0'));var events=[_0xc2fb('0x1'),_0xc2fb('0x2'),_0xc2fb('0x3')];function createListener(_0x8ccfac,_0x118b84){return function(_0x200345){_0x118b84['emit'](_0x8ccfac,_0x200345);};}function removeListener(_0x5be756,_0x2cf307){return function(){ChatInteractionEvents[_0xc2fb('0x4')](_0x5be756,_0x2cf307);};}exports['register']=function(_0x42131d){for(var _0xe92640=0x0,_0x5162a4=events['length'];_0xe92640<_0x5162a4;_0xe92640++){var _0x3e79e9=events[_0xe92640];var _0x35cc7c=createListener('chatInteraction:'+_0x3e79e9,_0x42131d);ChatInteractionEvents['on'](_0x3e79e9,_0x35cc7c);}}; \ No newline at end of file +var _0x58d9=['save','update','removeListener','length','chatInteraction:','./chatInteraction.events'];(function(_0x585dfa,_0x5e4b66){var _0x1c00c7=function(_0x281073){while(--_0x281073){_0x585dfa['push'](_0x585dfa['shift']());}};_0x1c00c7(++_0x5e4b66);}(_0x58d9,0xcb));var _0x958d=function(_0x48d9b0,_0x3e0802){_0x48d9b0=_0x48d9b0-0x0;var _0x3b97ad=_0x58d9[_0x48d9b0];return _0x3b97ad;};'use strict';var ChatInteractionEvents=require(_0x958d('0x0'));var events=[_0x958d('0x1'),'remove',_0x958d('0x2')];function createListener(_0x2a7f63,_0x15679f){return function(_0x15a913){_0x15679f['emit'](_0x2a7f63,_0x15a913);};}function removeListener(_0x436293,_0x4c0daa){return function(){ChatInteractionEvents[_0x958d('0x3')](_0x436293,_0x4c0daa);};}exports['register']=function(_0x10c0d5){for(var _0x148513=0x0,_0x51a183=events[_0x958d('0x4')];_0x148513<_0x51a183;_0x148513++){var _0xc35279=events[_0x148513];var _0x58e0aa=createListener(_0x958d('0x5')+_0xc35279,_0x10c0d5);ChatInteractionEvents['on'](_0xc35279,_0x58e0aa);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index f7fd372..c9329fc 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 _0xc5bb=['file','attachmentUpload','/:id/messages','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','customUpdate','/:id/abandon','abandon','/:id/close','close','delete','destroy','removeTags','exports','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','isAuthenticated','describe','/:id','isChatInteractionAuthorized','show','attachmentDownload','/:id/my_messages','getMyMessages','download','post','/:id/vidaoo','createVidaooSession','diskStorage','root','server/files/attachments/','format','%s-%s','now','originalname','replace','/:id/attachment_upload','single'];(function(_0x32b391,_0x33528f){var _0x2b0bd6=function(_0x512d88){while(--_0x512d88){_0x32b391['push'](_0x32b391['shift']());}};_0x2b0bd6(++_0x33528f);}(_0xc5bb,0x1cb));var _0xbc5b=function(_0x1069d8,_0x2bb691){_0x1069d8=_0x1069d8-0x0;var _0x293c6c=_0xc5bb[_0x1069d8];return _0x293c6c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xbc5b('0x0'));var timeout=require(_0xbc5b('0x1'));var express=require(_0xbc5b('0x2'));var router=express['Router']();var fs_extra=require(_0xbc5b('0x3'));var auth=require(_0xbc5b('0x4'));var interaction=require(_0xbc5b('0x5'));var config=require(_0xbc5b('0x6'));var controller=require('./chatInteraction.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xbc5b('0x7')]);router[_0xbc5b('0x8')]('/describe',auth[_0xbc5b('0x9')](),controller[_0xbc5b('0xa')]);router[_0xbc5b('0x8')](_0xbc5b('0xb'),auth[_0xbc5b('0xc')](),controller[_0xbc5b('0xd')]);router[_0xbc5b('0x8')]('/:id/attachment_download',auth[_0xbc5b('0xc')](),controller[_0xbc5b('0xe')]);router[_0xbc5b('0x8')]('/:id/messages',auth['isAuthenticated'](),controller['getMessages']);router[_0xbc5b('0x8')](_0xbc5b('0xf'),auth['isChatInteractionAuthorized'](),controller[_0xbc5b('0x10')]);router[_0xbc5b('0x8')]('/:id/download',auth[_0xbc5b('0x9')](),controller[_0xbc5b('0x11')]);router[_0xbc5b('0x12')]('/',auth[_0xbc5b('0x9')](),controller['create']);router[_0xbc5b('0x12')](_0xbc5b('0x13'),auth[_0xbc5b('0x9')](),controller[_0xbc5b('0x14')]);var upload=multer({'storage':multer[_0xbc5b('0x15')]({'destination':function(_0xfba337,_0x30937b,_0x21b825){_0x21b825(null,path['join'](config[_0xbc5b('0x16')],_0xbc5b('0x17')));},'filename':function(_0x45fc0c,_0x343992,_0x4fc6b4){_0x4fc6b4(null,util[_0xbc5b('0x18')](_0xbc5b('0x19'),Date[_0xbc5b('0x1a')](),_0x343992[_0xbc5b('0x1b')][_0xbc5b('0x1c')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xbc5b('0x12')](_0xbc5b('0x1d'),upload[_0xbc5b('0x1e')](_0xbc5b('0x1f')),controller[_0xbc5b('0x20')]);router[_0xbc5b('0x12')](_0xbc5b('0x21'),auth['isChatInteractionAuthorized'](),controller['addMessage']);router['post'](_0xbc5b('0x22'),auth[_0xbc5b('0x9')](),interaction[_0xbc5b('0x23')](_0xbc5b('0x24'),_0xbc5b('0x25')),controller[_0xbc5b('0x26')]);router[_0xbc5b('0x27')](_0xbc5b('0xb'),auth['isAuthenticated'](),interaction[_0xbc5b('0x23')](_0xbc5b('0x24'),'chatinteraction:update'),controller['update']);router['put']('/:id/custom_update',controller[_0xbc5b('0x28')]);router[_0xbc5b('0x27')](_0xbc5b('0x29'),auth[_0xbc5b('0xc')](),controller[_0xbc5b('0x2a')]);router[_0xbc5b('0x27')](_0xbc5b('0x2b'),controller[_0xbc5b('0x2c')]);router[_0xbc5b('0x2d')](_0xbc5b('0xb'),auth[_0xbc5b('0x9')](),interaction[_0xbc5b('0x23')](_0xbc5b('0x24'),'chatinteraction:destroy'),controller[_0xbc5b('0x2e')]);router[_0xbc5b('0x2d')](_0xbc5b('0x22'),auth['isAuthenticated'](),controller[_0xbc5b('0x2f')]);module[_0xbc5b('0x30')]=router; \ No newline at end of file +var _0xc491=['./chatInteraction.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/attachment_download','isChatInteractionAuthorized','attachmentDownload','getMessages','/:id/download','post','create','join','root','format','%s-%s','now','originalname','/:id/attachment_upload','single','file','attachmentUpload','/:id/messages','addMessage','tracked','chatinteraction:addtags','put','chat','update','/:id/custom_update','customUpdate','abandon','/:id/close','close','chatinteraction:destroy','destroy','delete','removeTags','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x56cc3b,_0x2c2d17){var _0x1eafb5=function(_0x25c275){while(--_0x25c275){_0x56cc3b['push'](_0x56cc3b['shift']());}};_0x1eafb5(++_0x2c2d17);}(_0xc491,0xbf));var _0x1c49=function(_0x5b013d,_0xc7691c){_0x5b013d=_0x5b013d-0x0;var _0x2b6eef=_0xc491[_0x5b013d];return _0x2b6eef;};'use strict';var multer=require(_0x1c49('0x0'));var util=require('util');var path=require(_0x1c49('0x1'));var timeout=require(_0x1c49('0x2'));var express=require(_0x1c49('0x3'));var router=express[_0x1c49('0x4')]();var fs_extra=require(_0x1c49('0x5'));var auth=require(_0x1c49('0x6'));var interaction=require(_0x1c49('0x7'));var config=require(_0x1c49('0x8'));var controller=require(_0x1c49('0x9'));router['get']('/',auth[_0x1c49('0xa')](),controller[_0x1c49('0xb')]);router[_0x1c49('0xc')](_0x1c49('0xd'),auth[_0x1c49('0xa')](),controller[_0x1c49('0xe')]);router['get'](_0x1c49('0xf'),auth['isChatInteractionAuthorized'](),controller[_0x1c49('0x10')]);router['get'](_0x1c49('0x11'),auth[_0x1c49('0x12')](),controller[_0x1c49('0x13')]);router[_0x1c49('0xc')]('/:id/messages',auth[_0x1c49('0xa')](),controller[_0x1c49('0x14')]);router['get']('/:id/my_messages',auth[_0x1c49('0x12')](),controller['getMyMessages']);router[_0x1c49('0xc')](_0x1c49('0x15'),auth[_0x1c49('0xa')](),controller['download']);router[_0x1c49('0x16')]('/',auth[_0x1c49('0xa')](),controller[_0x1c49('0x17')]);router[_0x1c49('0x16')]('/:id/vidaoo',auth[_0x1c49('0xa')](),controller['createVidaooSession']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x48600b,_0xcdfb0d,_0x58eaa6){_0x58eaa6(null,path[_0x1c49('0x18')](config[_0x1c49('0x19')],'server/files/attachments/'));},'filename':function(_0x3856d5,_0x26d033,_0x2cb5ce){_0x2cb5ce(null,util[_0x1c49('0x1a')](_0x1c49('0x1b'),Date[_0x1c49('0x1c')](),_0x26d033[_0x1c49('0x1d')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0x1c49('0x1e'),upload[_0x1c49('0x1f')](_0x1c49('0x20')),controller[_0x1c49('0x21')]);router[_0x1c49('0x16')](_0x1c49('0x22'),auth[_0x1c49('0x12')](),controller[_0x1c49('0x23')]);router[_0x1c49('0x16')]('/:id/tags',auth[_0x1c49('0xa')](),interaction[_0x1c49('0x24')]('chat',_0x1c49('0x25')),controller['addTags']);router[_0x1c49('0x26')](_0x1c49('0xf'),auth['isAuthenticated'](),interaction[_0x1c49('0x24')](_0x1c49('0x27'),'chatinteraction:update'),controller[_0x1c49('0x28')]);router[_0x1c49('0x26')](_0x1c49('0x29'),controller[_0x1c49('0x2a')]);router[_0x1c49('0x26')]('/:id/abandon',auth[_0x1c49('0x12')](),controller[_0x1c49('0x2b')]);router[_0x1c49('0x26')](_0x1c49('0x2c'),controller[_0x1c49('0x2d')]);router['delete'](_0x1c49('0xf'),auth[_0x1c49('0xa')](),interaction[_0x1c49('0x24')](_0x1c49('0x27'),_0x1c49('0x2e')),controller[_0x1c49('0x2f')]);router[_0x1c49('0x30')]('/:id/tags',auth['isAuthenticated'](),controller[_0x1c49('0x31')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index 7444fea..023653a 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 _0xa9d9=['BOOLEAN','INTEGER','sequelize','exports','medium'];(function(_0x53f707,_0x51a2f7){var _0x10a9f5=function(_0x14b513){while(--_0x14b513){_0x53f707['push'](_0x53f707['shift']());}};_0x10a9f5(++_0x51a2f7);}(_0xa9d9,0x124));var _0x9a9d=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xa9d9[_0x1ac595];return _0x455fff;};'use strict';var Sequelize=require(_0x9a9d('0x0'));module[_0x9a9d('0x1')]={'body':{'type':Sequelize['TEXT'](_0x9a9d('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x9a9d('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x9a9d('0x4')]}}; \ No newline at end of file +var _0x413b=['exports','BOOLEAN','INTEGER','sequelize'];(function(_0x38ced4,_0x24263f){var _0x547c07=function(_0x279fc4){while(--_0x279fc4){_0x38ced4['push'](_0x38ced4['shift']());}};_0x547c07(++_0x24263f);}(_0x413b,0x143));var _0xb413=function(_0x420746,_0x26dd66){_0x420746=_0x420746-0x0;var _0x1c6de2=_0x413b[_0x420746];return _0x1c6de2;};'use strict';var Sequelize=require(_0xb413('0x0'));module[_0xb413('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xb413('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xb413('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index d84c4f0..11f5aac 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 _0xc654=['moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','error','name','send','map','ChatInternalMessage','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','rows','catch','show','params','find','create','body','describe','messages','lastMessageAt','createdAt','format','getUsers','findAll','admin','fullname','role','userpic','internal','allowmessenger','showWebBar','-online','VoiceQueue','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','length','resourceId','agent','push','FromId','read','-createdAt','all','eml-format','fast-json-patch','request-promise'];(function(_0x4450b1,_0x214ace){var _0x399b0b=function(_0x2197df){while(--_0x2197df){_0x4450b1['push'](_0x4450b1['shift']());}};_0x399b0b(++_0x214ace);}(_0xc654,0x1b5));var _0x4c65=function(_0x6d0c3e,_0xbc2aed){_0x6d0c3e=_0x6d0c3e-0x0;var _0x2895ce=_0xc654[_0x6d0c3e];return _0x2895ce;};'use strict';var emlformat=require(_0x4c65('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x4c65('0x1'));var rp=require(_0x4c65('0x2'));var moment=require(_0x4c65('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x4c65('0x4'));var util=require(_0x4c65('0x5'));var path=require(_0x4c65('0x6'));var sox=require(_0x4c65('0x7'));var csv=require(_0x4c65('0x8'));var ejs=require(_0x4c65('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4c65('0xa'));var squel=require('squel');var crypto=require(_0x4c65('0xb'));var jsforce=require(_0x4c65('0xc'));var deskjs=require(_0x4c65('0xd'));var toCsv=require('to-csv');var querystring=require(_0x4c65('0xe'));var Papa=require(_0x4c65('0xf'));var Redis=require('ioredis');var authService=require(_0x4c65('0x10'));var qs=require(_0x4c65('0x11'));var as=require(_0x4c65('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4c65('0x13'))(_0x4c65('0x14'));var utils=require(_0x4c65('0x15'));var config=require(_0x4c65('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x4c65('0x17'))['db'];config['redis']=_[_0x4c65('0x18')](config[_0x4c65('0x19')],{'host':_0x4c65('0x1a'),'port':0x18eb});var socket=require(_0x4c65('0x1b'))(new Redis(config[_0x4c65('0x19')]));require('./chatInternalMessage.socket')[_0x4c65('0x1c')](socket);function respondWithStatusCode(_0x4aab6f,_0x5880a4){_0x5880a4=_0x5880a4||0xcc;return function(_0x36327b){if(_0x36327b){return _0x4aab6f[_0x4c65('0x1d')](_0x5880a4);}return _0x4aab6f[_0x4c65('0x1e')](_0x5880a4)[_0x4c65('0x1f')]();};}function respondWithResult(_0x20956f,_0x78f335){_0x78f335=_0x78f335||0xc8;return function(_0x6fab05){if(_0x6fab05){return _0x20956f[_0x4c65('0x1e')](_0x78f335)[_0x4c65('0x20')](_0x6fab05);}};}function respondWithFilteredResult(_0x3bf069,_0xc351fa){return function(_0x516a00){if(_0x516a00){var _0x1eb93d=typeof _0xc351fa['offset']===_0x4c65('0x21')&&typeof _0xc351fa['limit']===_0x4c65('0x21');var _0x5eb920=_0x516a00[_0x4c65('0x22')];var _0x223f63=_0x1eb93d?0x0:_0xc351fa['offset'];var _0x450423=_0x1eb93d?_0x516a00['count']:_0xc351fa[_0x4c65('0x23')]+_0xc351fa[_0x4c65('0x24')];var _0x3286dc;if(_0x450423>=_0x5eb920){_0x450423=_0x5eb920;_0x3286dc=0xc8;}else{_0x3286dc=0xce;}_0x3bf069[_0x4c65('0x1e')](_0x3286dc);return _0x3bf069[_0x4c65('0x25')](_0x4c65('0x26'),_0x223f63+'-'+_0x450423+'/'+_0x5eb920)[_0x4c65('0x20')](_0x516a00);}return null;};}function patchUpdates(_0x1b7abb){return function(_0x591810){try{jsonpatch['apply'](_0x591810,_0x1b7abb,!![]);}catch(_0x1de16a){return BPromise[_0x4c65('0x27')](_0x1de16a);}return _0x591810[_0x4c65('0x28')]();};}function saveUpdates(_0x4d3507,_0x33b1b7){return function(_0xe9891b){if(_0xe9891b){return _0xe9891b[_0x4c65('0x29')](_0x4d3507)[_0x4c65('0x2a')](function(_0x23a453){return _0x23a453;});}return null;};}function removeEntity(_0x3f39c9,_0x5a6554){return function(_0x47d96e){if(_0x47d96e){return _0x47d96e[_0x4c65('0x2b')]()[_0x4c65('0x2a')](function(){_0x3f39c9[_0x4c65('0x1e')](0xcc)[_0x4c65('0x1f')]();});}};}function handleEntityNotFound(_0x537f24,_0x2feaa0){return function(_0x146c77){if(!_0x146c77){_0x537f24[_0x4c65('0x1d')](0x194);}return _0x146c77;};}function handleError(_0xc5bcd1,_0x24b75d){_0x24b75d=_0x24b75d||0x1f4;return function(_0x299301){logger[_0x4c65('0x2c')](_0x299301['stack']);if(_0x299301[_0x4c65('0x2d')]){delete _0x299301[_0x4c65('0x2d')];}_0xc5bcd1[_0x4c65('0x1e')](_0x24b75d)[_0x4c65('0x2e')](_0x299301);};}exports['index']=function(_0x3c904e,_0xe50f78){var _0x5a9527={},_0x826241={},_0x4e7967={'count':0x0,'rows':[]};var _0x24a354=_[_0x4c65('0x2f')](db[_0x4c65('0x30')][_0x4c65('0x31')],function(_0x1f55d1){return{'name':_0x1f55d1[_0x4c65('0x32')],'type':_0x1f55d1['type'][_0x4c65('0x33')]};});_0x826241[_0x4c65('0x34')]=_[_0x4c65('0x2f')](_0x24a354,_0x4c65('0x2d'));_0x826241[_0x4c65('0x35')]=_[_0x4c65('0x36')](_0x3c904e[_0x4c65('0x35')]);_0x826241[_0x4c65('0x37')]=_[_0x4c65('0x38')](_0x826241[_0x4c65('0x34')],_0x826241[_0x4c65('0x35')]);_0x5a9527[_0x4c65('0x39')]=_[_0x4c65('0x38')](_0x826241[_0x4c65('0x34')],qs[_0x4c65('0x3a')](_0x3c904e[_0x4c65('0x35')][_0x4c65('0x3a')]));_0x5a9527['attributes']=_0x5a9527[_0x4c65('0x39')]['length']?_0x5a9527[_0x4c65('0x39')]:_0x826241[_0x4c65('0x34')];if(!_0x3c904e[_0x4c65('0x35')][_0x4c65('0x3b')](_0x4c65('0x3c'))){_0x5a9527[_0x4c65('0x24')]=qs[_0x4c65('0x24')](_0x3c904e[_0x4c65('0x35')][_0x4c65('0x24')]);_0x5a9527['offset']=qs[_0x4c65('0x23')](_0x3c904e[_0x4c65('0x35')][_0x4c65('0x23')]);}_0x5a9527[_0x4c65('0x3d')]=qs['sort'](_0x3c904e[_0x4c65('0x35')][_0x4c65('0x3e')]);_0x5a9527[_0x4c65('0x3f')]=qs['filters'](_[_0x4c65('0x40')](_0x3c904e[_0x4c65('0x35')],_0x826241[_0x4c65('0x37')]),_0x24a354);if(_0x3c904e[_0x4c65('0x35')][_0x4c65('0x41')]){_0x5a9527[_0x4c65('0x3f')]=_[_0x4c65('0x42')](_0x5a9527[_0x4c65('0x3f')],{'$or':_[_0x4c65('0x2f')](_0x24a354,function(_0xdaa57f){if(_0xdaa57f[_0x4c65('0x43')]!==_0x4c65('0x44')){var _0x248ad8={};_0x248ad8[_0xdaa57f[_0x4c65('0x2d')]]={'$like':'%'+_0x3c904e[_0x4c65('0x35')][_0x4c65('0x41')]+'%'};return _0x248ad8;}})});}_0x5a9527=_['merge']({},_0x5a9527,_0x3c904e['options']);var _0xa19d78={'where':_0x5a9527['where']};return db['ChatInternalMessage']['count'](_0xa19d78)[_0x4c65('0x2a')](function(_0x3bb73e){_0x4e7967['count']=_0x3bb73e;if(_0x3c904e[_0x4c65('0x35')][_0x4c65('0x45')]){_0x5a9527[_0x4c65('0x46')]=[{'all':!![]}];}return db[_0x4c65('0x30')]['findAll'](_0x5a9527);})[_0x4c65('0x2a')](function(_0x17134a){_0x4e7967[_0x4c65('0x47')]=_0x17134a;return _0x4e7967;})[_0x4c65('0x2a')](respondWithFilteredResult(_0xe50f78,_0x5a9527))[_0x4c65('0x48')](handleError(_0xe50f78,null));};exports[_0x4c65('0x49')]=function(_0x4c449f,_0x27c47b){var _0x47bac0={'raw':!![],'where':{'id':_0x4c449f[_0x4c65('0x4a')]['id']}},_0x506898={};_0x506898['model']=_[_0x4c65('0x36')](db[_0x4c65('0x30')]['rawAttributes']);_0x506898['query']=_[_0x4c65('0x36')](_0x4c449f[_0x4c65('0x35')]);_0x506898[_0x4c65('0x37')]=_['intersection'](_0x506898[_0x4c65('0x34')],_0x506898[_0x4c65('0x35')]);_0x47bac0['attributes']=_[_0x4c65('0x38')](_0x506898['model'],qs[_0x4c65('0x3a')](_0x4c449f[_0x4c65('0x35')][_0x4c65('0x3a')]));_0x47bac0[_0x4c65('0x39')]=_0x47bac0[_0x4c65('0x39')]['length']?_0x47bac0[_0x4c65('0x39')]:_0x506898[_0x4c65('0x34')];if(_0x4c449f[_0x4c65('0x35')][_0x4c65('0x45')]){_0x47bac0[_0x4c65('0x46')]=[{'all':!![]}];}_0x47bac0=_[_0x4c65('0x42')]({},_0x47bac0,_0x4c449f['options']);return db[_0x4c65('0x30')][_0x4c65('0x4b')](_0x47bac0)[_0x4c65('0x2a')](handleEntityNotFound(_0x27c47b,null))[_0x4c65('0x2a')](respondWithResult(_0x27c47b,null))['catch'](handleError(_0x27c47b,null));};exports[_0x4c65('0x4c')]=function(_0x48a1e2,_0x376833){return db[_0x4c65('0x30')]['create'](_0x48a1e2[_0x4c65('0x4d')],{})[_0x4c65('0x2a')](respondWithResult(_0x376833,0xc9))[_0x4c65('0x48')](handleError(_0x376833,null));};exports['update']=function(_0x4ab844,_0x46f1aa){if(_0x4ab844[_0x4c65('0x4d')]['id']){delete _0x4ab844[_0x4c65('0x4d')]['id'];}return db[_0x4c65('0x30')][_0x4c65('0x4b')]({'where':{'id':_0x4ab844[_0x4c65('0x4a')]['id']}})['then'](handleEntityNotFound(_0x46f1aa,null))[_0x4c65('0x2a')](saveUpdates(_0x4ab844[_0x4c65('0x4d')],null))['then'](respondWithResult(_0x46f1aa,null))[_0x4c65('0x48')](handleError(_0x46f1aa,null));};exports['destroy']=function(_0x7ff989,_0x513397){return db[_0x4c65('0x30')][_0x4c65('0x4b')]({'where':{'id':_0x7ff989[_0x4c65('0x4a')]['id']}})[_0x4c65('0x2a')](handleEntityNotFound(_0x513397,null))['then'](removeEntity(_0x513397,null))[_0x4c65('0x48')](handleError(_0x513397,null));};exports[_0x4c65('0x4e')]=function(_0x210fcf,_0x3788e8){return db[_0x4c65('0x30')][_0x4c65('0x4e')]()['then'](respondWithResult(_0x3788e8,null))[_0x4c65('0x48')](handleError(_0x3788e8,null));};function wrapUser(_0xf29828){return function(_0x4012bc){var _0x122be4=_0xf29828['get']({'plain':!![]});_0x122be4[_0x4c65('0x4f')]=[];if(_0x4012bc){_0x122be4[_0x4c65('0x50')]=_0x4012bc[_0x4c65('0x51')];_0x122be4['lastMessage']=_0x4012bc;}else{_0x122be4[_0x4c65('0x50')]=moment(0x0)[_0x4c65('0x52')]('YYYY-MM-DD\x20HH:mm:ss');_0x122be4['lastMessage']={};}return _0x122be4;};}exports[_0x4c65('0x53')]=function(_0x9824d7,_0x3d1683,_0x1bc6be){var _0x390222=[];return db['User'][_0x4c65('0x54')]({'where':{'role':['agent',_0x4c65('0x55'),'user']},'attributes':['id',_0x4c65('0x56'),_0x4c65('0x2d'),_0x4c65('0x57'),_0x4c65('0x58'),_0x4c65('0x59'),'online','lastLoginAt',_0x4c65('0x5a'),_0x4c65('0x5b')],'order':qs['sort'](_0x4c65('0x5c')),'include':[{'model':db[_0x4c65('0x5d')],'as':'VoiceQueues','attributes':['id',_0x4c65('0x2d'),_0x4c65('0x43')],'through':{'attributes':[]}}]})[_0x4c65('0x2a')](function(_0x266b4e){if(_0x266b4e){var _0x25863f=_0x9824d7['user'][_0x4c65('0x5e')]({'plain':!![]});if(!_0x25863f)throw new Error(_0x4c65('0x5f'));if(_0x25863f[_0x4c65('0x57')]===_0x4c65('0x60')){return db[_0x4c65('0x61')][_0x4c65('0x4b')]({'where':{'name':_0x4c65('0x62'),'userProfileId':_0x25863f[_0x4c65('0x63')]},'raw':!![]})[_0x4c65('0x2a')](function(_0x139cd8){if(_0x139cd8){if(_0x139cd8[_0x4c65('0x64')]===0x0){return db[_0x4c65('0x65')][_0x4c65('0x54')]({'where':{'sectionId':_0x139cd8['id']},'raw':!![]})[_0x4c65('0x2a')](function(_0x2d5943){var _0x385e6b=[];if(_['isEmpty'](_0x2d5943)){_0x385e6b=_[_0x4c65('0x41')](_0x266b4e,function(_0x23396e){if(_0x23396e[_0x4c65('0x57')]!=='agent'){return _0x23396e;}});return _0x385e6b;}else{for(var _0x1a2785=0x0;_0x1a2785<_0x266b4e[_0x4c65('0x66')];_0x1a2785++){var _0x109038=_0x266b4e[_0x1a2785];if(_0x109038[_0x4c65('0x57')]==='agent'){var _0x441808=_[_0x4c65('0x4b')](_0x2d5943,function(_0x50c68e){return _0x50c68e[_0x4c65('0x67')]===_0x109038['id'];});if(_0x441808)_0x385e6b['push'](_0x109038);}else{_0x385e6b['push'](_0x109038);}}return _0x385e6b;}});}else{return _0x266b4e;}}else{var _0x2a1d98=_[_0x4c65('0x41')](_0x266b4e,function(_0x164423){if(_0x164423['role']!==_0x4c65('0x68')){return _0x164423;}});return _0x2a1d98;}});}else{return _0x266b4e;}}})[_0x4c65('0x2a')](function(_0x2fa37e){var _0x13f13e=[];if(_0x2fa37e){_0x390222=_0x2fa37e;for(var _0x3c9d51=0x0;_0x3c9d51<_0x2fa37e[_0x4c65('0x66')];_0x3c9d51+=0x1){_0x390222[_0x3c9d51][_0x4c65('0x4f')]=[];_0x13f13e[_0x4c65('0x69')](db[_0x4c65('0x30')][_0x4c65('0x4b')]({'where':{'FromId':[_0x9824d7['user']['id'],_0x2fa37e[_0x3c9d51]['id']],'ToId':[_0x9824d7[_0x4c65('0x60')]['id'],_0x2fa37e[_0x3c9d51]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0x4c65('0x6a'),'ToId',_0x4c65('0x6b'),_0x4c65('0x4d')],'order':qs[_0x4c65('0x3e')](_0x4c65('0x6c')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x2fa37e[_0x3c9d51])));}return BPromise[_0x4c65('0x6d')](_0x13f13e);}return[];})[_0x4c65('0x2a')](function(_0x332c0f){return{'rows':_0x332c0f,'count':_0x332c0f[_0x4c65('0x66')]};})[_0x4c65('0x2a')](respondWithResult(_0x3d1683,null))[_0x4c65('0x48')](handleError(_0x3d1683,null));}; \ No newline at end of file +var _0xeeea=['rows','catch','show','params','fields','create','body','find','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','findAll','admin','user','fullname','role','userpic','internal','online','lastLoginAt','showWebBar','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','Agents','autoAssociation','UserProfileResource','isEmpty','agent','resourceId','push','FromId','ToId','read','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','localhost','socket.io-emitter','register','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','send','index','ChatInternalMessage','rawAttributes','fieldName','key','model','name','query','keys','filters','intersection','attributes','length','nolimit','order','sort','where','pick','filter','merge','map','type','VIRTUAL','options','includeAll','include'];(function(_0x16e569,_0x33f836){var _0x22470a=function(_0x4b7c33){while(--_0x4b7c33){_0x16e569['push'](_0x16e569['shift']());}};_0x22470a(++_0x33f836);}(_0xeeea,0x187));var _0xaeee=function(_0x5486c9,_0xd84d26){_0x5486c9=_0x5486c9-0x0;var _0x595b5=_0xeeea[_0x5486c9];return _0x595b5;};'use strict';var emlformat=require(_0xaeee('0x0'));var rimraf=require(_0xaeee('0x1'));var zipdir=require(_0xaeee('0x2'));var jsonpatch=require(_0xaeee('0x3'));var rp=require('request-promise');var moment=require(_0xaeee('0x4'));var BPromise=require(_0xaeee('0x5'));var Mustache=require(_0xaeee('0x6'));var util=require(_0xaeee('0x7'));var path=require(_0xaeee('0x8'));var sox=require(_0xaeee('0x9'));var csv=require(_0xaeee('0xa'));var ejs=require(_0xaeee('0xb'));var fs=require('fs');var fs_extra=require(_0xaeee('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xaeee('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xaeee('0xe'));var toCsv=require(_0xaeee('0xa'));var querystring=require('querystring');var Papa=require(_0xaeee('0xf'));var Redis=require(_0xaeee('0x10'));var authService=require(_0xaeee('0x11'));var qs=require(_0xaeee('0x12'));var as=require(_0xaeee('0x13'));var hardwareService=require(_0xaeee('0x14'));var logger=require(_0xaeee('0x15'))(_0xaeee('0x16'));var utils=require(_0xaeee('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xaeee('0x18'));var db=require('../../mysqldb')['db'];config[_0xaeee('0x19')]=_['defaults'](config[_0xaeee('0x19')],{'host':_0xaeee('0x1a'),'port':0x18eb});var socket=require(_0xaeee('0x1b'))(new Redis(config['redis']));require('./chatInternalMessage.socket')[_0xaeee('0x1c')](socket);function respondWithStatusCode(_0x2d7761,_0x1f3aa9){_0x1f3aa9=_0x1f3aa9||0xcc;return function(_0x1d4cf3){if(_0x1d4cf3){return _0x2d7761[_0xaeee('0x1d')](_0x1f3aa9);}return _0x2d7761[_0xaeee('0x1e')](_0x1f3aa9)[_0xaeee('0x1f')]();};}function respondWithResult(_0x71f4e1,_0x3acfef){_0x3acfef=_0x3acfef||0xc8;return function(_0x57a89f){if(_0x57a89f){return _0x71f4e1[_0xaeee('0x1e')](_0x3acfef)['json'](_0x57a89f);}};}function respondWithFilteredResult(_0x3b8045,_0x14a8b5){return function(_0x2cf294){if(_0x2cf294){var _0x37ba96=typeof _0x14a8b5['offset']===_0xaeee('0x20')&&typeof _0x14a8b5['limit']===_0xaeee('0x20');var _0x301398=_0x2cf294[_0xaeee('0x21')];var _0xdb17ea=_0x37ba96?0x0:_0x14a8b5[_0xaeee('0x22')];var _0x4c39c0=_0x37ba96?_0x2cf294[_0xaeee('0x21')]:_0x14a8b5[_0xaeee('0x22')]+_0x14a8b5[_0xaeee('0x23')];var _0x378554;if(_0x4c39c0>=_0x301398){_0x4c39c0=_0x301398;_0x378554=0xc8;}else{_0x378554=0xce;}_0x3b8045[_0xaeee('0x1e')](_0x378554);return _0x3b8045[_0xaeee('0x24')](_0xaeee('0x25'),_0xdb17ea+'-'+_0x4c39c0+'/'+_0x301398)['json'](_0x2cf294);}return null;};}function patchUpdates(_0x4be996){return function(_0x114243){try{jsonpatch[_0xaeee('0x26')](_0x114243,_0x4be996,!![]);}catch(_0x35f290){return BPromise[_0xaeee('0x27')](_0x35f290);}return _0x114243[_0xaeee('0x28')]();};}function saveUpdates(_0x1cd3ed,_0xa74fe6){return function(_0x538f1f){if(_0x538f1f){return _0x538f1f[_0xaeee('0x29')](_0x1cd3ed)[_0xaeee('0x2a')](function(_0x80bb81){return _0x80bb81;});}return null;};}function removeEntity(_0x70b900,_0x5578ed){return function(_0x4d1777){if(_0x4d1777){return _0x4d1777[_0xaeee('0x2b')]()[_0xaeee('0x2a')](function(){_0x70b900[_0xaeee('0x1e')](0xcc)[_0xaeee('0x1f')]();});}};}function handleEntityNotFound(_0x52a480,_0x385e77){return function(_0x33f753){if(!_0x33f753){_0x52a480[_0xaeee('0x1d')](0x194);}return _0x33f753;};}function handleError(_0x2f085f,_0x5893fa){_0x5893fa=_0x5893fa||0x1f4;return function(_0x1b9b6c){logger[_0xaeee('0x2c')](_0x1b9b6c[_0xaeee('0x2d')]);if(_0x1b9b6c['name']){delete _0x1b9b6c['name'];}_0x2f085f[_0xaeee('0x1e')](_0x5893fa)[_0xaeee('0x2e')](_0x1b9b6c);};}exports[_0xaeee('0x2f')]=function(_0x123d65,_0x11ccae){var _0x3271ff={},_0x2b298e={},_0x4bcc80={'count':0x0,'rows':[]};var _0x5ea2cb=_['map'](db[_0xaeee('0x30')][_0xaeee('0x31')],function(_0x25d6f5){return{'name':_0x25d6f5[_0xaeee('0x32')],'type':_0x25d6f5['type'][_0xaeee('0x33')]};});_0x2b298e[_0xaeee('0x34')]=_['map'](_0x5ea2cb,_0xaeee('0x35'));_0x2b298e[_0xaeee('0x36')]=_[_0xaeee('0x37')](_0x123d65[_0xaeee('0x36')]);_0x2b298e[_0xaeee('0x38')]=_[_0xaeee('0x39')](_0x2b298e[_0xaeee('0x34')],_0x2b298e[_0xaeee('0x36')]);_0x3271ff[_0xaeee('0x3a')]=_[_0xaeee('0x39')](_0x2b298e[_0xaeee('0x34')],qs['fields'](_0x123d65[_0xaeee('0x36')]['fields']));_0x3271ff[_0xaeee('0x3a')]=_0x3271ff[_0xaeee('0x3a')][_0xaeee('0x3b')]?_0x3271ff['attributes']:_0x2b298e[_0xaeee('0x34')];if(!_0x123d65['query']['hasOwnProperty'](_0xaeee('0x3c'))){_0x3271ff[_0xaeee('0x23')]=qs[_0xaeee('0x23')](_0x123d65[_0xaeee('0x36')]['limit']);_0x3271ff[_0xaeee('0x22')]=qs['offset'](_0x123d65[_0xaeee('0x36')][_0xaeee('0x22')]);}_0x3271ff[_0xaeee('0x3d')]=qs[_0xaeee('0x3e')](_0x123d65[_0xaeee('0x36')][_0xaeee('0x3e')]);_0x3271ff[_0xaeee('0x3f')]=qs[_0xaeee('0x38')](_[_0xaeee('0x40')](_0x123d65[_0xaeee('0x36')],_0x2b298e[_0xaeee('0x38')]),_0x5ea2cb);if(_0x123d65[_0xaeee('0x36')][_0xaeee('0x41')]){_0x3271ff[_0xaeee('0x3f')]=_[_0xaeee('0x42')](_0x3271ff['where'],{'$or':_[_0xaeee('0x43')](_0x5ea2cb,function(_0x235ef6){if(_0x235ef6[_0xaeee('0x44')]!==_0xaeee('0x45')){var _0x2f0046={};_0x2f0046[_0x235ef6['name']]={'$like':'%'+_0x123d65[_0xaeee('0x36')]['filter']+'%'};return _0x2f0046;}})});}_0x3271ff=_[_0xaeee('0x42')]({},_0x3271ff,_0x123d65[_0xaeee('0x46')]);var _0x4b1d02={'where':_0x3271ff[_0xaeee('0x3f')]};return db[_0xaeee('0x30')]['count'](_0x4b1d02)[_0xaeee('0x2a')](function(_0x451ca4){_0x4bcc80[_0xaeee('0x21')]=_0x451ca4;if(_0x123d65[_0xaeee('0x36')][_0xaeee('0x47')]){_0x3271ff[_0xaeee('0x48')]=[{'all':!![]}];}return db[_0xaeee('0x30')]['findAll'](_0x3271ff);})[_0xaeee('0x2a')](function(_0x1bef4d){_0x4bcc80[_0xaeee('0x49')]=_0x1bef4d;return _0x4bcc80;})[_0xaeee('0x2a')](respondWithFilteredResult(_0x11ccae,_0x3271ff))[_0xaeee('0x4a')](handleError(_0x11ccae,null));};exports[_0xaeee('0x4b')]=function(_0x13ed6f,_0x2df325){var _0x3933a3={'raw':!![],'where':{'id':_0x13ed6f[_0xaeee('0x4c')]['id']}},_0x36931d={};_0x36931d[_0xaeee('0x34')]=_[_0xaeee('0x37')](db[_0xaeee('0x30')][_0xaeee('0x31')]);_0x36931d[_0xaeee('0x36')]=_[_0xaeee('0x37')](_0x13ed6f['query']);_0x36931d[_0xaeee('0x38')]=_[_0xaeee('0x39')](_0x36931d['model'],_0x36931d[_0xaeee('0x36')]);_0x3933a3['attributes']=_[_0xaeee('0x39')](_0x36931d['model'],qs['fields'](_0x13ed6f[_0xaeee('0x36')][_0xaeee('0x4d')]));_0x3933a3[_0xaeee('0x3a')]=_0x3933a3[_0xaeee('0x3a')][_0xaeee('0x3b')]?_0x3933a3[_0xaeee('0x3a')]:_0x36931d[_0xaeee('0x34')];if(_0x13ed6f[_0xaeee('0x36')]['includeAll']){_0x3933a3[_0xaeee('0x48')]=[{'all':!![]}];}_0x3933a3=_[_0xaeee('0x42')]({},_0x3933a3,_0x13ed6f[_0xaeee('0x46')]);return db[_0xaeee('0x30')]['find'](_0x3933a3)[_0xaeee('0x2a')](handleEntityNotFound(_0x2df325,null))[_0xaeee('0x2a')](respondWithResult(_0x2df325,null))['catch'](handleError(_0x2df325,null));};exports['create']=function(_0x562054,_0x41ac17){return db['ChatInternalMessage'][_0xaeee('0x4e')](_0x562054[_0xaeee('0x4f')],{})[_0xaeee('0x2a')](respondWithResult(_0x41ac17,0xc9))[_0xaeee('0x4a')](handleError(_0x41ac17,null));};exports['update']=function(_0x9d0be5,_0x2863fe){if(_0x9d0be5[_0xaeee('0x4f')]['id']){delete _0x9d0be5[_0xaeee('0x4f')]['id'];}return db[_0xaeee('0x30')][_0xaeee('0x50')]({'where':{'id':_0x9d0be5[_0xaeee('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2863fe,null))[_0xaeee('0x2a')](saveUpdates(_0x9d0be5[_0xaeee('0x4f')],null))[_0xaeee('0x2a')](respondWithResult(_0x2863fe,null))[_0xaeee('0x4a')](handleError(_0x2863fe,null));};exports[_0xaeee('0x2b')]=function(_0x2d9ed8,_0x7c77d3){return db[_0xaeee('0x30')][_0xaeee('0x50')]({'where':{'id':_0x2d9ed8[_0xaeee('0x4c')]['id']}})[_0xaeee('0x2a')](handleEntityNotFound(_0x7c77d3,null))[_0xaeee('0x2a')](removeEntity(_0x7c77d3,null))[_0xaeee('0x4a')](handleError(_0x7c77d3,null));};exports[_0xaeee('0x51')]=function(_0x4c5ac4,_0x4b5a32){return db[_0xaeee('0x30')][_0xaeee('0x51')]()[_0xaeee('0x2a')](respondWithResult(_0x4b5a32,null))[_0xaeee('0x4a')](handleError(_0x4b5a32,null));};function wrapUser(_0x37b16b){return function(_0xa2cfe3){var _0x180c7a=_0x37b16b[_0xaeee('0x52')]({'plain':!![]});_0x180c7a[_0xaeee('0x53')]=[];if(_0xa2cfe3){_0x180c7a[_0xaeee('0x54')]=_0xa2cfe3[_0xaeee('0x55')];_0x180c7a[_0xaeee('0x56')]=_0xa2cfe3;}else{_0x180c7a['lastMessageAt']=moment(0x0)[_0xaeee('0x57')](_0xaeee('0x58'));_0x180c7a[_0xaeee('0x56')]={};}return _0x180c7a;};}exports[_0xaeee('0x59')]=function(_0x4f0236,_0xb4f3b8,_0x443b15){var _0x38a0b4=[];return db[_0xaeee('0x5a')][_0xaeee('0x5b')]({'where':{'role':['agent',_0xaeee('0x5c'),_0xaeee('0x5d')]},'attributes':['id',_0xaeee('0x5e'),_0xaeee('0x35'),_0xaeee('0x5f'),_0xaeee('0x60'),_0xaeee('0x61'),_0xaeee('0x62'),_0xaeee('0x63'),'allowmessenger',_0xaeee('0x64')],'order':qs['sort']('-online'),'include':[{'model':db[_0xaeee('0x65')],'as':_0xaeee('0x66'),'attributes':['id','name',_0xaeee('0x44')],'through':{'attributes':[]}}]})[_0xaeee('0x2a')](function(_0x240144){if(_0x240144){var _0x2bc19e=_0x4f0236[_0xaeee('0x5d')][_0xaeee('0x52')]({'plain':!![]});if(!_0x2bc19e)throw new Error(_0xaeee('0x67'));if(_0x2bc19e[_0xaeee('0x5f')]===_0xaeee('0x5d')){return db['UserProfileSection'][_0xaeee('0x50')]({'where':{'name':_0xaeee('0x68'),'userProfileId':_0x2bc19e['userProfileId']},'raw':!![]})[_0xaeee('0x2a')](function(_0x51d8c9){if(_0x51d8c9){if(_0x51d8c9[_0xaeee('0x69')]===0x0){return db[_0xaeee('0x6a')][_0xaeee('0x5b')]({'where':{'sectionId':_0x51d8c9['id']},'raw':!![]})[_0xaeee('0x2a')](function(_0x1f8529){var _0x48d250=[];if(_[_0xaeee('0x6b')](_0x1f8529)){_0x48d250=_[_0xaeee('0x41')](_0x240144,function(_0x3133b9){if(_0x3133b9[_0xaeee('0x5f')]!=='agent'){return _0x3133b9;}});return _0x48d250;}else{for(var _0x186cda=0x0;_0x186cda<_0x240144[_0xaeee('0x3b')];_0x186cda++){var _0x5397fb=_0x240144[_0x186cda];if(_0x5397fb[_0xaeee('0x5f')]===_0xaeee('0x6c')){var _0x3599bc=_['find'](_0x1f8529,function(_0x2c41e9){return _0x2c41e9[_0xaeee('0x6d')]===_0x5397fb['id'];});if(_0x3599bc)_0x48d250[_0xaeee('0x6e')](_0x5397fb);}else{_0x48d250[_0xaeee('0x6e')](_0x5397fb);}}return _0x48d250;}});}else{return _0x240144;}}else{var _0x17b2b0=_[_0xaeee('0x41')](_0x240144,function(_0x2ce5a6){if(_0x2ce5a6[_0xaeee('0x5f')]!==_0xaeee('0x6c')){return _0x2ce5a6;}});return _0x17b2b0;}});}else{return _0x240144;}}})['then'](function(_0x590cf4){var _0x46cc1a=[];if(_0x590cf4){_0x38a0b4=_0x590cf4;for(var _0x49614a=0x0;_0x49614a<_0x590cf4[_0xaeee('0x3b')];_0x49614a+=0x1){_0x38a0b4[_0x49614a][_0xaeee('0x53')]=[];_0x46cc1a['push'](db[_0xaeee('0x30')][_0xaeee('0x50')]({'where':{'FromId':[_0x4f0236[_0xaeee('0x5d')]['id'],_0x590cf4[_0x49614a]['id']],'ToId':[_0x4f0236[_0xaeee('0x5d')]['id'],_0x590cf4[_0x49614a]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0xaeee('0x6f'),_0xaeee('0x70'),_0xaeee('0x71'),_0xaeee('0x4f')],'order':qs[_0xaeee('0x3e')](_0xaeee('0x72')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xaeee('0x2a')](wrapUser(_0x590cf4[_0x49614a])));}return BPromise[_0xaeee('0x73')](_0x46cc1a);}return[];})[_0xaeee('0x2a')](function(_0x4f19cd){return{'rows':_0x4f19cd,'count':_0x4f19cd[_0xaeee('0x3b')]};})[_0xaeee('0x2a')](respondWithResult(_0xb4f3b8,null))[_0xaeee('0x4a')](handleError(_0xb4f3b8,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index 445b248..5a9f3ac 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 _0x337f=['update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','ChatInternalMessage','save'];(function(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0x337f,0x11c));var _0xf337=function(_0x1776bf,_0x59ae32){_0x1776bf=_0x1776bf-0x0;var _0x5bae2f=_0x337f[_0x1776bf];return _0x5bae2f;};'use strict';var EventEmitter=require(_0xf337('0x0'));var ChatInternalMessage=require(_0xf337('0x1'))['db'][_0xf337('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf337('0x3'),'afterUpdate':_0xf337('0x4'),'afterDestroy':_0xf337('0x5')};function emitEvent(_0x57b986){return function(_0x3942f8,_0x4485af,_0x566399){ChatInternalMessageEvents[_0xf337('0x6')](_0x57b986+':'+_0x3942f8['id'],_0x3942f8);ChatInternalMessageEvents['emit'](_0x57b986,_0x3942f8);_0x566399(null);};}for(var e in events){if(events[_0xf337('0x7')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0xf337('0x8')]=ChatInternalMessageEvents; \ No newline at end of file +var _0xff8a=['../../mysqldb','ChatInternalMessage','setMaxListeners','save','update','remove','hasOwnProperty','events'];(function(_0x242c49,_0xc1b484){var _0x36b9e9=function(_0x574071){while(--_0x574071){_0x242c49['push'](_0x242c49['shift']());}};_0x36b9e9(++_0xc1b484);}(_0xff8a,0x167));var _0xaff8=function(_0x23b828,_0x89efee){_0x23b828=_0x23b828-0x0;var _0x225474=_0xff8a[_0x23b828];return _0x225474;};'use strict';var EventEmitter=require(_0xaff8('0x0'));var ChatInternalMessage=require(_0xaff8('0x1'))['db'][_0xaff8('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xaff8('0x3')](0x0);var events={'afterCreate':_0xaff8('0x4'),'afterUpdate':_0xaff8('0x5'),'afterDestroy':_0xaff8('0x6')};function emitEvent(_0x371d16){return function(_0x34f719,_0x3d0645,_0x979950){ChatInternalMessageEvents['emit'](_0x371d16+':'+_0x34f719['id'],_0x34f719);ChatInternalMessageEvents['emit'](_0x371d16,_0x34f719);_0x979950(null);};}for(var e in events){if(events[_0xaff8('0x7')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index 7ded715..9d8d5da 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 _0x010a=['../../config/environment','exports','define','ChatInternalMessage','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x2b0f81,_0x3917f0){var _0x5ce74c=function(_0x12dc0d){while(--_0x12dc0d){_0x2b0f81['push'](_0x2b0f81['shift']());}};_0x5ce74c(++_0x3917f0);}(_0x010a,0x13a));var _0xa010=function(_0x59bdc4,_0x3e6e51){_0x59bdc4=_0x59bdc4-0x0;var _0x46d546=_0x010a[_0x59bdc4];return _0x46d546;};'use strict';var _=require(_0xa010('0x0'));var util=require(_0xa010('0x1'));var logger=require(_0xa010('0x2'))(_0xa010('0x3'));var moment=require(_0xa010('0x4'));var BPromise=require(_0xa010('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa010('0x6'));var rimraf=require(_0xa010('0x7'));var config=require(_0xa010('0x8'));var attributes=require('./chatInternalMessage.attributes');module[_0xa010('0x9')]=function(_0x7ce002,_0x5a042e){return _0x7ce002[_0xa010('0xa')](_0xa010('0xb'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa010('0xc'),'collate':_0xa010('0xd')});}; \ No newline at end of file +var _0x9f3f=['path','rimraf','../../config/environment','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','request-promise'];(function(_0x47403a,_0x2bf0a3){var _0x5a5dee=function(_0x23bca6){while(--_0x23bca6){_0x47403a['push'](_0x47403a['shift']());}};_0x5a5dee(++_0x2bf0a3);}(_0x9f3f,0x1bb));var _0xf9f3=function(_0x3403d5,_0x3d99fc){_0x3403d5=_0x3403d5-0x0;var _0xf9df4f=_0x9f3f[_0x3403d5];return _0xf9df4f;};'use strict';var _=require(_0xf9f3('0x0'));var util=require(_0xf9f3('0x1'));var logger=require(_0xf9f3('0x2'))(_0xf9f3('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf9f3('0x4'));var fs=require('fs');var path=require(_0xf9f3('0x5'));var rimraf=require(_0xf9f3('0x6'));var config=require(_0xf9f3('0x7'));var attributes=require('./chatInternalMessage.attributes');module[_0xf9f3('0x8')]=function(_0x35a681,_0x55e9d9){return _0x35a681[_0xf9f3('0x9')](_0xf9f3('0xa'),attributes,{'tableName':_0xf9f3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf9f3('0xc'),'collate':_0xf9f3('0xd')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index 96c4217..fb15d90 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 _0xe53e=['../../config/logger','rpc','../../config/environment','redis','socket.io-emitter','./chatInternalMessage.socket','register','request','info','ChatInternalMessage,\x20%s,\x20%s','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb'];(function(_0x946bb2,_0xbdde84){var _0x40d752=function(_0x895db2){while(--_0x895db2){_0x946bb2['push'](_0x946bb2['shift']());}};_0x40d752(++_0xbdde84);}(_0xe53e,0x11b));var _0xee53=function(_0x28243e,_0x41ab63){_0x28243e=_0x28243e-0x0;var _0x26dd92=_0xe53e[_0x28243e];return _0x26dd92;};'use strict';var _=require(_0xee53('0x0'));var util=require('util');var moment=require(_0xee53('0x1'));var BPromise=require(_0xee53('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xee53('0x3'));var db=require(_0xee53('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xee53('0x5'))(_0xee53('0x6'));var config=require(_0xee53('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0xee53('0x8')]=_['defaults'](config[_0xee53('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0xee53('0x9'))(new Redis(config[_0xee53('0x8')]));require(_0xee53('0xa'))[_0xee53('0xb')](socket);function respondWithRpcPromise(_0x1f978a,_0xbd3f90,_0x169a99){return new BPromise(function(_0x5caa0e,_0x1b2fad){return client[_0xee53('0xc')](_0x1f978a,_0x169a99)['then'](function(_0xd74cdc){logger[_0xee53('0xd')](_0xee53('0xe'),_0xbd3f90,'request\x20sent');logger[_0xee53('0xf')](_0xee53('0x10'),_0xbd3f90,_0xee53('0x11'),JSON[_0xee53('0x12')](_0xd74cdc));if(_0xd74cdc['error']){if(_0xd74cdc[_0xee53('0x13')][_0xee53('0x14')]===0x1f4){logger['error'](_0xee53('0xe'),_0xbd3f90,_0xd74cdc[_0xee53('0x13')]['message']);return _0x1b2fad(_0xd74cdc['error'][_0xee53('0x15')]);}logger[_0xee53('0x13')](_0xee53('0xe'),_0xbd3f90,_0xd74cdc[_0xee53('0x13')][_0xee53('0x15')]);return _0x5caa0e(_0xd74cdc['error'][_0xee53('0x15')]);}else{logger[_0xee53('0xd')](_0xee53('0xe'),_0xbd3f90,_0xee53('0x11'));_0x5caa0e(_0xd74cdc[_0xee53('0x16')][_0xee53('0x15')]);}})[_0xee53('0x17')](function(_0x51a8c7){logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0xbd3f90,_0x51a8c7);_0x1b2fad(_0x51a8c7);});});} \ No newline at end of file +var _0x9548=['stringify','error','message','result','catch','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','info','ChatInternalMessage,\x20%s,\x20%s','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x2089ca,_0x46c3ef){var _0x2c414f=function(_0x3e05d0){while(--_0x3e05d0){_0x2089ca['push'](_0x2089ca['shift']());}};_0x2c414f(++_0x46c3ef);}(_0x9548,0x1d9));var _0x8954=function(_0x5d7b47,_0x1a56b0){_0x5d7b47=_0x5d7b47-0x0;var _0x1a38f2=_0x9548[_0x5d7b47];return _0x1a38f2;};'use strict';var _=require('lodash');var util=require(_0x8954('0x0'));var moment=require(_0x8954('0x1'));var BPromise=require(_0x8954('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8954('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x8954('0x4'));var logger=require('../../config/logger')(_0x8954('0x5'));var config=require(_0x8954('0x6'));var jayson=require(_0x8954('0x7'));var client=jayson[_0x8954('0x8')][_0x8954('0x9')]({'port':0x232a});config[_0x8954('0xa')]=_[_0x8954('0xb')](config[_0x8954('0xa')],{'host':_0x8954('0xc'),'port':0x18eb});var socket=require(_0x8954('0xd'))(new Redis(config['redis']));require(_0x8954('0xe'))[_0x8954('0xf')](socket);function respondWithRpcPromise(_0x534d78,_0x110489,_0x39d3b2){return new BPromise(function(_0x42cb8b,_0x5ae191){return client[_0x8954('0x10')](_0x534d78,_0x39d3b2)['then'](function(_0x3cb429){logger[_0x8954('0x11')](_0x8954('0x12'),_0x110489,'request\x20sent');logger['debug'](_0x8954('0x13'),_0x110489,_0x8954('0x14'),JSON[_0x8954('0x15')](_0x3cb429));if(_0x3cb429[_0x8954('0x16')]){if(_0x3cb429[_0x8954('0x16')]['code']===0x1f4){logger[_0x8954('0x16')]('ChatInternalMessage,\x20%s,\x20%s',_0x110489,_0x3cb429[_0x8954('0x16')]['message']);return _0x5ae191(_0x3cb429[_0x8954('0x16')][_0x8954('0x17')]);}logger['error'](_0x8954('0x12'),_0x110489,_0x3cb429[_0x8954('0x16')][_0x8954('0x17')]);return _0x42cb8b(_0x3cb429[_0x8954('0x16')][_0x8954('0x17')]);}else{logger[_0x8954('0x11')](_0x8954('0x12'),_0x110489,_0x8954('0x14'));_0x42cb8b(_0x3cb429[_0x8954('0x18')][_0x8954('0x17')]);}})[_0x8954('0x19')](function(_0x25bd04){logger[_0x8954('0x16')](_0x8954('0x12'),_0x110489,_0x25bd04);_0x5ae191(_0x25bd04);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 936b119..59e62f6 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 _0xfa65=['remove','emit','register','length','chatInternalMessage:','save'];(function(_0x531d15,_0x599af5){var _0x271a18=function(_0x31284d){while(--_0x31284d){_0x531d15['push'](_0x531d15['shift']());}};_0x271a18(++_0x599af5);}(_0xfa65,0x6b));var _0x5fa6=function(_0x485e5c,_0x111b0e){_0x485e5c=_0x485e5c-0x0;var _0x2f6771=_0xfa65[_0x485e5c];return _0x2f6771;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0x5fa6('0x0'),_0x5fa6('0x1'),'update'];function createListener(_0x17a0fb,_0x54470b){return function(_0x5b9d07){_0x54470b[_0x5fa6('0x2')](_0x17a0fb,_0x5b9d07);};}function removeListener(_0x5df1b4,_0x1268be){return function(){ChatInternalMessageEvents['removeListener'](_0x5df1b4,_0x1268be);};}exports[_0x5fa6('0x3')]=function(_0x4ec7d1){for(var _0x3af107=0x0,_0x3083aa=events[_0x5fa6('0x4')];_0x3af107<_0x3083aa;_0x3af107++){var _0x21ca12=events[_0x3af107];var _0x49eb61=createListener(_0x5fa6('0x5')+_0x21ca12,_0x4ec7d1);ChatInternalMessageEvents['on'](_0x21ca12,_0x49eb61);}}; \ No newline at end of file +var _0x1084=['save','remove','emit','removeListener','length','./chatInternalMessage.events'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x1084,0x173));var _0x4108=function(_0x3ea3ce,_0x51ad25){_0x3ea3ce=_0x3ea3ce-0x0;var _0x3f1873=_0x1084[_0x3ea3ce];return _0x3f1873;};'use strict';var ChatInternalMessageEvents=require(_0x4108('0x0'));var events=[_0x4108('0x1'),_0x4108('0x2'),'update'];function createListener(_0x39142f,_0x228b01){return function(_0x5666d5){_0x228b01[_0x4108('0x3')](_0x39142f,_0x5666d5);};}function removeListener(_0xd1961b,_0x2c8cee){return function(){ChatInternalMessageEvents[_0x4108('0x4')](_0xd1961b,_0x2c8cee);};}exports['register']=function(_0x436416){for(var _0x58ba3d=0x0,_0x1c39fc=events[_0x4108('0x5')];_0x58ba3d<_0x1c39fc;_0x58ba3d++){var _0x6706fa=events[_0x58ba3d];var _0x5a78bb=createListener('chatInternalMessage:'+_0x6706fa,_0x436416);ChatInternalMessageEvents['on'](_0x6706fa,_0x5a78bb);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index 1f80ee8..bdab3a1 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 _0x33f3=['./chatInternalMessage.controller','isAuthenticated','index','get','/describe','describe','/users','getUsers','/:id','show','create','put','update','delete','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x5b27da,_0x4a6532){var _0x3254f4=function(_0x4194c6){while(--_0x4194c6){_0x5b27da['push'](_0x5b27da['shift']());}};_0x3254f4(++_0x4a6532);}(_0x33f3,0x189));var _0x333f=function(_0x66c899,_0x1875f9){_0x66c899=_0x66c899-0x0;var _0x3efd33=_0x33f3[_0x66c899];return _0x3efd33;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x333f('0x0'));var timeout=require(_0x333f('0x1'));var express=require(_0x333f('0x2'));var router=express[_0x333f('0x3')]();var fs_extra=require(_0x333f('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x333f('0x5'));var config=require('../../config/environment');var controller=require(_0x333f('0x6'));router['get']('/',auth[_0x333f('0x7')](),controller[_0x333f('0x8')]);router[_0x333f('0x9')](_0x333f('0xa'),auth['isAuthenticated'](),controller[_0x333f('0xb')]);router[_0x333f('0x9')](_0x333f('0xc'),auth[_0x333f('0x7')](),controller[_0x333f('0xd')]);router[_0x333f('0x9')](_0x333f('0xe'),auth['isAuthenticated'](),controller[_0x333f('0xf')]);router['post']('/',auth[_0x333f('0x7')](),controller[_0x333f('0x10')]);router[_0x333f('0x11')](_0x333f('0xe'),controller[_0x333f('0x12')]);router[_0x333f('0x13')](_0x333f('0xe'),auth[_0x333f('0x7')](),controller['destroy']);module[_0x333f('0x14')]=router; \ No newline at end of file +var _0xa23b=['../../components/auth/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','/users','getUsers','/:id','show','post','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa23b,0x1f3));var _0xba23=function(_0xc823e1,_0x3020e5){_0xc823e1=_0xc823e1-0x0;var _0xf5a749=_0xa23b[_0xc823e1];return _0xf5a749;};'use strict';var multer=require(_0xba23('0x0'));var util=require(_0xba23('0x1'));var path=require(_0xba23('0x2'));var timeout=require(_0xba23('0x3'));var express=require(_0xba23('0x4'));var router=express[_0xba23('0x5')]();var fs_extra=require(_0xba23('0x6'));var auth=require(_0xba23('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xba23('0x8'));var controller=require(_0xba23('0x9'));router[_0xba23('0xa')]('/',auth[_0xba23('0xb')](),controller[_0xba23('0xc')]);router[_0xba23('0xa')](_0xba23('0xd'),auth[_0xba23('0xb')](),controller['describe']);router[_0xba23('0xa')](_0xba23('0xe'),auth['isAuthenticated'](),controller[_0xba23('0xf')]);router[_0xba23('0xa')](_0xba23('0x10'),auth[_0xba23('0xb')](),controller[_0xba23('0x11')]);router[_0xba23('0x12')]('/',auth[_0xba23('0xb')](),controller['create']);router[_0xba23('0x13')](_0xba23('0x10'),controller[_0xba23('0x14')]);router[_0xba23('0x15')]('/:id',auth[_0xba23('0xb')](),controller[_0xba23('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index 60c1995..2a7ea57 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 _0x75dc=['DATE','STRING','sequelize','exports','BOOLEAN','ENUM','out'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0x75dc,0x1d7));var _0xc75d=function(_0x444f91,_0x2a61f2){_0x444f91=_0x444f91-0x0;var _0x3248ab=_0x75dc[_0x444f91];return _0x3248ab;};'use strict';var Sequelize=require(_0xc75d('0x0'));module[_0xc75d('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0xc75d('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xc75d('0x3')]('in',_0xc75d('0x4')),'defaultValue':_0xc75d('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0xc75d('0x5')]},'providerName':{'type':Sequelize[_0xc75d('0x6')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x3014=['exports','medium','BOOLEAN','out','DATE','STRING','TEXT','sequelize'];(function(_0x3a8b7c,_0x3e5db2){var _0x40eb80=function(_0x8db6a3){while(--_0x8db6a3){_0x3a8b7c['push'](_0x3a8b7c['shift']());}};_0x40eb80(++_0x3e5db2);}(_0x3014,0x1d7));var _0x4301=function(_0x1648ae,_0x475f9b){_0x1648ae=_0x1648ae-0x0;var _0x163b3c=_0x3014[_0x1648ae];return _0x163b3c;};'use strict';var Sequelize=require(_0x4301('0x0'));module[_0x4301('0x1')]={'body':{'type':Sequelize['TEXT'](_0x4301('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x4301('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x4301('0x4')),'defaultValue':_0x4301('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0x4301('0x5')]},'providerName':{'type':Sequelize[_0x4301('0x6')]},'providerResponse':{'type':Sequelize[_0x4301('0x7')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 749d61a..6a353d0 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 _0x123f=['end','json','offset','undefined','count','Content-Range','apply','reject','save','update','destroy','sendStatus','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','limit','order','sort','where','filters','pick','filter','VIRTUAL','options','ChatMessage','includeAll','include','findAll','show','find','create','body','params','../../config/logger','chat-interactions','accept','read','format','UserId','user','agent','get','ChatInteractionId','read1stAt','interaction','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','email','interface','SIP/%s','channel','motionChannel','event','EventManager','parse','formData','chat','ChatInteraction','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','fullname','internal','rejectmessage','rimraf','zip-dir','request-promise','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','status'];(function(_0x54d56f,_0x166755){var _0x283361=function(_0x5db449){while(--_0x5db449){_0x54d56f['push'](_0x54d56f['shift']());}};_0x283361(++_0x166755);}(_0x123f,0xd8));var _0xf123=function(_0x35387d,_0x1ba72f){_0x35387d=_0x35387d-0x0;var _0x3aba56=_0x123f[_0x35387d];return _0x3aba56;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf123('0x0'));var zipdir=require(_0xf123('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf123('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf123('0x3'));var util=require('util');var path=require(_0xf123('0x4'));var sox=require(_0xf123('0x5'));var csv=require('to-csv');var ejs=require(_0xf123('0x6'));var fs=require('fs');var fs_extra=require(_0xf123('0x7'));var _=require(_0xf123('0x8'));var squel=require(_0xf123('0x9'));var crypto=require(_0xf123('0xa'));var jsforce=require(_0xf123('0xb'));var deskjs=require(_0xf123('0xc'));var toCsv=require(_0xf123('0xd'));var querystring=require(_0xf123('0xe'));var Papa=require('papaparse');var Redis=require(_0xf123('0xf'));var authService=require(_0xf123('0x10'));var qs=require(_0xf123('0x11'));var as=require(_0xf123('0x12'));var hardwareService=require(_0xf123('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xf123('0x14'));var config=require(_0xf123('0x15'));var licenseUtil=require(_0xf123('0x16'));var db=require('../../mysqldb')['db'];config[_0xf123('0x17')]=_[_0xf123('0x18')](config[_0xf123('0x17')],{'host':_0xf123('0x19'),'port':0x18eb});var socket=require(_0xf123('0x1a'))(new Redis(config[_0xf123('0x17')]));require(_0xf123('0x1b'))[_0xf123('0x1c')](socket);var jayson=require(_0xf123('0x1d'));var client=jayson[_0xf123('0x1e')]['http']({'port':0x232c});var client9002=jayson[_0xf123('0x1e')][_0xf123('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x1a916a,_0x580b75,_0x4ad752,_0x31a7d0){return new BPromise(function(_0x11bd18,_0x5a139e){var _0x418d69=_0x31a7d0||client;return _0x418d69['request'](_0x1a916a,_0x4ad752)[_0xf123('0x20')](function(_0xd5676b){logger[_0xf123('0x21')](_0xf123('0x22'),_0x580b75,'request\x20sent');logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0x580b75,_0xf123('0x23'),JSON[_0xf123('0x24')](_0xd5676b));if(_0xd5676b['error']){if(_0xd5676b[_0xf123('0x25')]['code']===0x1f4){logger[_0xf123('0x25')](_0xf123('0x22'),_0x580b75,_0xd5676b['error'][_0xf123('0x26')]);return _0x5a139e(_0xd5676b['error'][_0xf123('0x26')]);}logger['error'](_0xf123('0x22'),_0x580b75,_0xd5676b['error']['message']);return _0x11bd18(_0xd5676b[_0xf123('0x25')][_0xf123('0x26')]);}else{logger['info'](_0xf123('0x22'),_0x580b75,_0xf123('0x23'));_0x11bd18(_0xd5676b[_0xf123('0x27')][_0xf123('0x26')]);}})[_0xf123('0x28')](function(_0x37a573){logger[_0xf123('0x25')]('ChatMessage,\x20%s,\x20%s',_0x580b75,_0x37a573);_0x5a139e(_0x37a573);});});}function respondWithStatusCode(_0x20e795,_0x238dfe){_0x238dfe=_0x238dfe||0xcc;return function(_0x8291d9){if(_0x8291d9){return _0x20e795['sendStatus'](_0x238dfe);}return _0x20e795[_0xf123('0x29')](_0x238dfe)[_0xf123('0x2a')]();};}function respondWithResult(_0x4a43d1,_0x4e3a93){_0x4e3a93=_0x4e3a93||0xc8;return function(_0x46da21){if(_0x46da21){return _0x4a43d1['status'](_0x4e3a93)[_0xf123('0x2b')](_0x46da21);}};}function respondWithFilteredResult(_0x33cdeb,_0x4037b4){return function(_0x24c231){if(_0x24c231){var _0x2122c3=typeof _0x4037b4[_0xf123('0x2c')]===_0xf123('0x2d')&&typeof _0x4037b4['limit']===_0xf123('0x2d');var _0x30b9b0=_0x24c231[_0xf123('0x2e')];var _0x4186ea=_0x2122c3?0x0:_0x4037b4[_0xf123('0x2c')];var _0x23f9da=_0x2122c3?_0x24c231[_0xf123('0x2e')]:_0x4037b4['offset']+_0x4037b4['limit'];var _0x28b95c;if(_0x23f9da>=_0x30b9b0){_0x23f9da=_0x30b9b0;_0x28b95c=0xc8;}else{_0x28b95c=0xce;}_0x33cdeb[_0xf123('0x29')](_0x28b95c);return _0x33cdeb['set'](_0xf123('0x2f'),_0x4186ea+'-'+_0x23f9da+'/'+_0x30b9b0)['json'](_0x24c231);}return null;};}function patchUpdates(_0x4902ef){return function(_0x4603eb){try{jsonpatch[_0xf123('0x30')](_0x4603eb,_0x4902ef,!![]);}catch(_0x4786e6){return BPromise[_0xf123('0x31')](_0x4786e6);}return _0x4603eb[_0xf123('0x32')]();};}function saveUpdates(_0x227248,_0x584f14){return function(_0x9749d2){if(_0x9749d2){return _0x9749d2[_0xf123('0x33')](_0x227248)['then'](function(_0x379d7e){return _0x379d7e;});}return null;};}function removeEntity(_0x3bd7ba,_0x28db97){return function(_0x344f11){if(_0x344f11){return _0x344f11[_0xf123('0x34')]()['then'](function(){_0x3bd7ba[_0xf123('0x29')](0xcc)[_0xf123('0x2a')]();});}};}function handleEntityNotFound(_0x243956,_0x41eb91){return function(_0x2f5a0b){if(!_0x2f5a0b){_0x243956[_0xf123('0x35')](0x194);}return _0x2f5a0b;};}function handleError(_0x3265a4,_0x3978e9){_0x3978e9=_0x3978e9||0x1f4;return function(_0x28d256){logger[_0xf123('0x25')](_0x28d256['stack']);if(_0x28d256[_0xf123('0x36')]){delete _0x28d256[_0xf123('0x36')];}_0x3265a4[_0xf123('0x29')](_0x3978e9)[_0xf123('0x37')](_0x28d256);};}exports[_0xf123('0x38')]=function(_0x3e1b61,_0x152c8b){var _0x1c57ed={},_0x34ec27={},_0x421b1b={'count':0x0,'rows':[]};var _0x289f52=_[_0xf123('0x39')](db['ChatMessage'][_0xf123('0x3a')],function(_0x37c797){return{'name':_0x37c797[_0xf123('0x3b')],'type':_0x37c797[_0xf123('0x3c')][_0xf123('0x3d')]};});_0x34ec27[_0xf123('0x3e')]=_[_0xf123('0x39')](_0x289f52,_0xf123('0x36'));_0x34ec27[_0xf123('0x3f')]=_[_0xf123('0x40')](_0x3e1b61[_0xf123('0x3f')]);_0x34ec27['filters']=_[_0xf123('0x41')](_0x34ec27[_0xf123('0x3e')],_0x34ec27[_0xf123('0x3f')]);_0x1c57ed[_0xf123('0x42')]=_['intersection'](_0x34ec27['model'],qs[_0xf123('0x43')](_0x3e1b61[_0xf123('0x3f')][_0xf123('0x43')]));_0x1c57ed['attributes']=_0x1c57ed[_0xf123('0x42')][_0xf123('0x44')]?_0x1c57ed[_0xf123('0x42')]:_0x34ec27['model'];if(!_0x3e1b61[_0xf123('0x3f')]['hasOwnProperty'](_0xf123('0x45'))){_0x1c57ed[_0xf123('0x46')]=qs[_0xf123('0x46')](_0x3e1b61['query']['limit']);_0x1c57ed[_0xf123('0x2c')]=qs['offset'](_0x3e1b61[_0xf123('0x3f')][_0xf123('0x2c')]);}_0x1c57ed[_0xf123('0x47')]=qs[_0xf123('0x48')](_0x3e1b61[_0xf123('0x3f')][_0xf123('0x48')]);_0x1c57ed[_0xf123('0x49')]=qs[_0xf123('0x4a')](_[_0xf123('0x4b')](_0x3e1b61[_0xf123('0x3f')],_0x34ec27[_0xf123('0x4a')]),_0x289f52);if(_0x3e1b61[_0xf123('0x3f')][_0xf123('0x4c')]){_0x1c57ed[_0xf123('0x49')]=_['merge'](_0x1c57ed[_0xf123('0x49')],{'$or':_[_0xf123('0x39')](_0x289f52,function(_0x6f6a43){if(_0x6f6a43[_0xf123('0x3c')]!==_0xf123('0x4d')){var _0x5d0eed={};_0x5d0eed[_0x6f6a43['name']]={'$like':'%'+_0x3e1b61['query'][_0xf123('0x4c')]+'%'};return _0x5d0eed;}})});}_0x1c57ed=_['merge']({},_0x1c57ed,_0x3e1b61[_0xf123('0x4e')]);var _0x51a56e={'where':_0x1c57ed[_0xf123('0x49')]};return db[_0xf123('0x4f')][_0xf123('0x2e')](_0x51a56e)[_0xf123('0x20')](function(_0x9a2aa7){_0x421b1b[_0xf123('0x2e')]=_0x9a2aa7;if(_0x3e1b61[_0xf123('0x3f')][_0xf123('0x50')]){_0x1c57ed[_0xf123('0x51')]=[{'all':!![]}];}return db['ChatMessage'][_0xf123('0x52')](_0x1c57ed);})['then'](function(_0x363ef4){_0x421b1b['rows']=_0x363ef4;return _0x421b1b;})['then'](respondWithFilteredResult(_0x152c8b,_0x1c57ed))[_0xf123('0x28')](handleError(_0x152c8b,null));};exports[_0xf123('0x53')]=function(_0x48c513,_0xc0a2c4){var _0x2c1f15={'raw':!![],'where':{'id':_0x48c513['params']['id']}},_0x43d3cf={};_0x43d3cf[_0xf123('0x3e')]=_[_0xf123('0x40')](db['ChatMessage']['rawAttributes']);_0x43d3cf[_0xf123('0x3f')]=_[_0xf123('0x40')](_0x48c513['query']);_0x43d3cf['filters']=_['intersection'](_0x43d3cf[_0xf123('0x3e')],_0x43d3cf[_0xf123('0x3f')]);_0x2c1f15[_0xf123('0x42')]=_[_0xf123('0x41')](_0x43d3cf[_0xf123('0x3e')],qs[_0xf123('0x43')](_0x48c513[_0xf123('0x3f')][_0xf123('0x43')]));_0x2c1f15[_0xf123('0x42')]=_0x2c1f15[_0xf123('0x42')][_0xf123('0x44')]?_0x2c1f15['attributes']:_0x43d3cf['model'];if(_0x48c513[_0xf123('0x3f')][_0xf123('0x50')]){_0x2c1f15['include']=[{'all':!![]}];}_0x2c1f15=_['merge']({},_0x2c1f15,_0x48c513[_0xf123('0x4e')]);return db['ChatMessage'][_0xf123('0x54')](_0x2c1f15)[_0xf123('0x20')](handleEntityNotFound(_0xc0a2c4,null))[_0xf123('0x20')](respondWithResult(_0xc0a2c4,null))[_0xf123('0x28')](handleError(_0xc0a2c4,null));};exports[_0xf123('0x55')]=function(_0x2ce4b4,_0x139335){return db['ChatMessage'][_0xf123('0x55')](_0x2ce4b4[_0xf123('0x56')],{})[_0xf123('0x20')](respondWithResult(_0x139335,0xc9))[_0xf123('0x28')](handleError(_0x139335,null));};exports[_0xf123('0x33')]=function(_0x5506be,_0x46dd3f){if(_0x5506be['body']['id']){delete _0x5506be[_0xf123('0x56')]['id'];}return db[_0xf123('0x4f')][_0xf123('0x54')]({'where':{'id':_0x5506be[_0xf123('0x57')]['id']}})[_0xf123('0x20')](handleEntityNotFound(_0x46dd3f,null))[_0xf123('0x20')](saveUpdates(_0x5506be[_0xf123('0x56')],null))[_0xf123('0x20')](respondWithResult(_0x46dd3f,null))[_0xf123('0x28')](handleError(_0x46dd3f,null));};exports[_0xf123('0x34')]=function(_0x429822,_0x29ae29){return db[_0xf123('0x4f')]['find']({'where':{'id':_0x429822[_0xf123('0x57')]['id']}})[_0xf123('0x20')](handleEntityNotFound(_0x29ae29,null))[_0xf123('0x20')](removeEntity(_0x29ae29,null))[_0xf123('0x28')](handleError(_0x29ae29,null));};exports['describe']=function(_0x3d092f,_0x72e6ff){return db[_0xf123('0x4f')]['describe']()[_0xf123('0x20')](respondWithResult(_0x72e6ff,null))[_0xf123('0x28')](handleError(_0x72e6ff,null));};var interaction_log=require(_0xf123('0x58'))(_0xf123('0x59'));exports[_0xf123('0x5a')]=function(_0x490a82,_0x45bd83,_0x4be24f){var _0x4690a1={'agent':{},'channel':'chat'};if(_0x490a82[_0xf123('0x56')]['id']){delete _0x490a82['body']['id'];}_0x490a82['body'][_0xf123('0x5b')]=!![];_0x490a82[_0xf123('0x56')]['readAt']=moment()[_0xf123('0x5c')]('YYYY-MM-DD\x20HH:mm:ss');_0x490a82[_0xf123('0x56')][_0xf123('0x5d')]=_0x490a82[_0xf123('0x56')][_0xf123('0x5d')]||_0x490a82[_0xf123('0x5e')]['id'];_0x4690a1[_0xf123('0x5f')]['id']=_0x490a82[_0xf123('0x56')][_0xf123('0x5d')];return db['ChatMessage'][_0xf123('0x54')]({'where':{'id':_0x490a82[_0xf123('0x57')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x45bd83,null))[_0xf123('0x20')](saveUpdates(_0x490a82['body'],null))[_0xf123('0x20')](function(_0x3b119d){if(_0x3b119d){_0x4690a1['message']=_0x3b119d[_0xf123('0x60')]({'plain':!![]});return db['ChatInteraction']['find']({'where':{'id':_0x3b119d[_0xf123('0x61')]}});}return null;})['then'](handleEntityNotFound(_0x45bd83,null))[_0xf123('0x20')](function(_0xa98d9a){if(_0xa98d9a){return _0xa98d9a[_0xf123('0x33')]({'UserId':_0x490a82['body'][_0xf123('0x5d')],'read1stAt':_['isNil'](_0xa98d9a[_0xf123('0x62')])?moment()[_0xf123('0x5c')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x14464a){if(_0x14464a){_0x4690a1[_0xf123('0x63')]=_0x14464a['get']({'plain':!![]});interaction_log[_0xf123('0x21')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x490a82[_0xf123('0x5e')]['id'],_0x490a82[_0xf123('0x5e')][_0xf123('0x36')],_0x490a82[_0xf123('0x5e')][_0xf123('0x64')],_0x4690a1['interaction']['id'],_0x490a82[_0xf123('0x56')]?JSON[_0xf123('0x24')](_0x490a82[_0xf123('0x56')]):_0xf123('0x65'));return respondWithRpcPromise(_0xf123('0x66'),_0xf123('0x67'),_0x4690a1);}return null;})[_0xf123('0x20')](function(_0x4db598){var _0x1e3b61=_0xf123('0x68')+_0x4db598[_0xf123('0x26')][_0xf123('0x69')];return db[_0xf123('0x6a')][_0xf123('0x3f')](_0x1e3b61,{'type':db[_0xf123('0x6b')][_0xf123('0x6c')][_0xf123('0x6d')],'raw':!![]})[_0xf123('0x20')](function(_0x343ad6){return _0x343ad6;});})[_0xf123('0x20')](function(_0x20cd25){if(_0x20cd25){_0x4690a1[_0xf123('0x26')][_0xf123('0x6e')]=_0x20cd25[0x0];if(!_0x490a82[_0xf123('0x56')][_0xf123('0x5d')])return;return db[_0xf123('0x6f')][_0xf123('0x54')]({'where':{'id':_0x490a82[_0xf123('0x56')][_0xf123('0x5d')],'role':_0xf123('0x5f')},'attributes':['id',_0xf123('0x36'),'fullname',_0xf123('0x70'),'internal'],'raw':!![]});}return null;})['then'](function(_0xe5a925){if(!_0xe5a925)return null;_0x4690a1[_0xf123('0x26')][_0xf123('0x5f')]=_0xe5a925;return _0x4690a1;})[_0xf123('0x20')](function(_0x251632){if(_0x251632){if(_0x490a82[_0xf123('0x56')]['manual']){_0x4690a1[_0xf123('0x26')][_0xf123('0x71')]=util[_0xf123('0x5c')](_0xf123('0x72'),_0x490a82[_0xf123('0x5e')][_0xf123('0x36')]);_0x4690a1[_0xf123('0x26')][_0xf123('0x73')]=_0x4690a1['channel'];_0x4690a1['message'][_0xf123('0x74')]=_0x4690a1['channel'];_0x4690a1[_0xf123('0x26')][_0xf123('0x75')]='accept';return respondWithRpcPromise(_0xf123('0x76'),_0xf123('0x76'),{'event':'acceptmessage','message':_['merge'](_0x4690a1['message'],JSON[_0xf123('0x77')](_0x4690a1[_0xf123('0x63')][_0xf123('0x78')]))},client9002)['then'](function(){return _0x4690a1;});}return _0x4690a1;}return null;})['then'](respondWithResult(_0x45bd83,null))[_0xf123('0x28')](handleError(_0x45bd83,null));};var interaction_log=require(_0xf123('0x58'))(_0xf123('0x59'));exports[_0xf123('0x31')]=function(_0xa1e0f8,_0x53aa8e,_0x374fdd){var _0x415f10={'agent':{},'channel':_0xf123('0x79')};if(_0xa1e0f8[_0xf123('0x56')]['id']){delete _0xa1e0f8[_0xf123('0x56')]['id'];}_0xa1e0f8[_0xf123('0x56')][_0xf123('0x5d')]=_0xa1e0f8[_0xf123('0x56')][_0xf123('0x5d')]||_0xa1e0f8[_0xf123('0x5e')]['id'];_0x415f10['agent']['id']=_0xa1e0f8[_0xf123('0x56')]['UserId'];return db['ChatMessage'][_0xf123('0x54')]({'where':{'id':_0xa1e0f8[_0xf123('0x57')]['id'],'UserId':null}})[_0xf123('0x20')](handleEntityNotFound(_0x53aa8e,null))[_0xf123('0x20')](function(_0x56ea0d){if(_0x56ea0d){_0x415f10[_0xf123('0x26')]=_0x56ea0d['get']({'plain':!![]});return db[_0xf123('0x7a')][_0xf123('0x54')]({'where':{'id':_0x56ea0d['ChatInteractionId']}});}return null;})[_0xf123('0x20')](handleEntityNotFound(_0x53aa8e,null))[_0xf123('0x20')](function(_0x4146b7){if(_0x4146b7){_0x415f10[_0xf123('0x63')]=_0x4146b7[_0xf123('0x60')]({'plain':!![]});interaction_log[_0xf123('0x21')](_0xf123('0x7b'),_0xa1e0f8[_0xf123('0x5e')]['id'],_0xa1e0f8[_0xf123('0x5e')][_0xf123('0x36')],_0xa1e0f8[_0xf123('0x5e')][_0xf123('0x64')],_0x415f10['interaction']['id'],_0xa1e0f8[_0xf123('0x56')]?JSON['stringify'](_0xa1e0f8[_0xf123('0x56')]):_0xf123('0x65'));return respondWithRpcPromise(_0xf123('0x7c'),_0xf123('0x7d'),_0x415f10);}return null;})['then'](function(_0x2e69ee){var _0x27e0b1=_0xf123('0x68')+_0x2e69ee['message'][_0xf123('0x69')];return db[_0xf123('0x6a')][_0xf123('0x3f')](_0x27e0b1,{'type':db['Sequelize'][_0xf123('0x6c')][_0xf123('0x6d')],'raw':!![]})['then'](function(_0x4927c8){return _0x4927c8;});})[_0xf123('0x20')](function(_0x1a9026){if(_0x1a9026){_0x415f10[_0xf123('0x26')][_0xf123('0x6e')]=_0x1a9026[0x0];if(!_0xa1e0f8[_0xf123('0x56')][_0xf123('0x5d')])return;return db['User'][_0xf123('0x54')]({'where':{'id':_0xa1e0f8['body'][_0xf123('0x5d')],'role':'agent'},'attributes':['id','name',_0xf123('0x7e'),_0xf123('0x70'),_0xf123('0x7f')],'raw':!![]});}return null;})[_0xf123('0x20')](function(_0x125431){if(!_0x125431)return null;_0x415f10[_0xf123('0x26')]['agent']=_0x125431;return _0x415f10;})[_0xf123('0x20')](function(_0xde8d66){if(_0xde8d66){_0xde8d66[_0xf123('0x26')]['interface']=util[_0xf123('0x5c')]('SIP/%s',_0xa1e0f8[_0xf123('0x5e')]['name']);_0xde8d66[_0xf123('0x26')]['channel']=_0x415f10['channel'];_0xde8d66[_0xf123('0x26')]['motionChannel']=_0x415f10['channel'];_0xde8d66[_0xf123('0x26')][_0xf123('0x75')]='reject';respondWithRpcPromise(_0xf123('0x76'),'EventManager',{'event':_0xf123('0x80'),'message':_['merge'](_0x415f10[_0xf123('0x26')],JSON['parse'](_0x415f10[_0xf123('0x63')][_0xf123('0x78')]))},client9002);return _0x415f10;}return null;})[_0xf123('0x20')](respondWithResult(_0x53aa8e,null))[_0xf123('0x28')](handleError(_0x53aa8e,null));}; \ No newline at end of file +var _0xb3f4=['includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','chat-interactions','accept','read','readAt','format','UserId','agent','get','ChatInteraction','ChatInteractionId','isNil','YYYY-MM-DD\x20HH:mm:ss','user','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','email','internal','manual','interface','channel','event','EventManager','acceptmessage','parse','reject','chat','interaction','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','User','fullname','rejectmessage','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','sendStatus','status','end','offset','limit','undefined','count','set','apply','save','update','destroy','stack','name','send','index','ChatMessage','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','merge','where','VIRTUAL','options'];(function(_0x41a5ed,_0x42436f){var _0x113af4=function(_0x1780bf){while(--_0x1780bf){_0x41a5ed['push'](_0x41a5ed['shift']());}};_0x113af4(++_0x42436f);}(_0xb3f4,0x143));var _0x4b3f=function(_0xc14b5e,_0x14c4fb){_0xc14b5e=_0xc14b5e-0x0;var _0x2a0724=_0xb3f4[_0xc14b5e];return _0x2a0724;};'use strict';var emlformat=require(_0x4b3f('0x0'));var rimraf=require(_0x4b3f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4b3f('0x2'));var rp=require(_0x4b3f('0x3'));var moment=require(_0x4b3f('0x4'));var BPromise=require(_0x4b3f('0x5'));var Mustache=require('mustache');var util=require(_0x4b3f('0x6'));var path=require(_0x4b3f('0x7'));var sox=require('sox');var csv=require(_0x4b3f('0x8'));var ejs=require(_0x4b3f('0x9'));var fs=require('fs');var fs_extra=require(_0x4b3f('0xa'));var _=require(_0x4b3f('0xb'));var squel=require(_0x4b3f('0xc'));var crypto=require(_0x4b3f('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x4b3f('0xe'));var toCsv=require(_0x4b3f('0x8'));var querystring=require(_0x4b3f('0xf'));var Papa=require('papaparse');var Redis=require(_0x4b3f('0x10'));var authService=require(_0x4b3f('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x4b3f('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4b3f('0x13'))(_0x4b3f('0x14'));var utils=require(_0x4b3f('0x15'));var config=require(_0x4b3f('0x16'));var licenseUtil=require(_0x4b3f('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x4b3f('0x18')](config[_0x4b3f('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x4b3f('0x1a'))(new Redis(config['redis']));require(_0x4b3f('0x1b'))[_0x4b3f('0x1c')](socket);var jayson=require(_0x4b3f('0x1d'));var client=jayson[_0x4b3f('0x1e')][_0x4b3f('0x1f')]({'port':0x232c});var client9002=jayson[_0x4b3f('0x1e')][_0x4b3f('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x7d8e5d,_0x37dfd1,_0xabea98,_0x3e4016){return new BPromise(function(_0x48834d,_0x8758ce){var _0x11deb6=_0x3e4016||client;return _0x11deb6[_0x4b3f('0x20')](_0x7d8e5d,_0xabea98)[_0x4b3f('0x21')](function(_0x51e541){logger[_0x4b3f('0x22')](_0x4b3f('0x23'),_0x37dfd1,_0x4b3f('0x24'));logger['debug'](_0x4b3f('0x25'),_0x37dfd1,_0x4b3f('0x24'),JSON[_0x4b3f('0x26')](_0x51e541));if(_0x51e541[_0x4b3f('0x27')]){if(_0x51e541['error']['code']===0x1f4){logger[_0x4b3f('0x27')](_0x4b3f('0x23'),_0x37dfd1,_0x51e541[_0x4b3f('0x27')][_0x4b3f('0x28')]);return _0x8758ce(_0x51e541[_0x4b3f('0x27')]['message']);}logger[_0x4b3f('0x27')](_0x4b3f('0x23'),_0x37dfd1,_0x51e541[_0x4b3f('0x27')][_0x4b3f('0x28')]);return _0x48834d(_0x51e541[_0x4b3f('0x27')][_0x4b3f('0x28')]);}else{logger[_0x4b3f('0x22')]('ChatMessage,\x20%s,\x20%s',_0x37dfd1,'request\x20sent');_0x48834d(_0x51e541[_0x4b3f('0x29')][_0x4b3f('0x28')]);}})['catch'](function(_0x4ddae9){logger['error']('ChatMessage,\x20%s,\x20%s',_0x37dfd1,_0x4ddae9);_0x8758ce(_0x4ddae9);});});}function respondWithStatusCode(_0x102545,_0x11c328){_0x11c328=_0x11c328||0xcc;return function(_0x8c1b7b){if(_0x8c1b7b){return _0x102545[_0x4b3f('0x2a')](_0x11c328);}return _0x102545[_0x4b3f('0x2b')](_0x11c328)[_0x4b3f('0x2c')]();};}function respondWithResult(_0x27154a,_0x422838){_0x422838=_0x422838||0xc8;return function(_0x1b18fb){if(_0x1b18fb){return _0x27154a[_0x4b3f('0x2b')](_0x422838)['json'](_0x1b18fb);}};}function respondWithFilteredResult(_0x48a9df,_0x52e650){return function(_0x292931){if(_0x292931){var _0x4897d9=typeof _0x52e650[_0x4b3f('0x2d')]==='undefined'&&typeof _0x52e650[_0x4b3f('0x2e')]===_0x4b3f('0x2f');var _0x332703=_0x292931[_0x4b3f('0x30')];var _0x1dbdca=_0x4897d9?0x0:_0x52e650['offset'];var _0x4753b8=_0x4897d9?_0x292931[_0x4b3f('0x30')]:_0x52e650[_0x4b3f('0x2d')]+_0x52e650['limit'];var _0x25a2c1;if(_0x4753b8>=_0x332703){_0x4753b8=_0x332703;_0x25a2c1=0xc8;}else{_0x25a2c1=0xce;}_0x48a9df[_0x4b3f('0x2b')](_0x25a2c1);return _0x48a9df[_0x4b3f('0x31')]('Content-Range',_0x1dbdca+'-'+_0x4753b8+'/'+_0x332703)['json'](_0x292931);}return null;};}function patchUpdates(_0x97b131){return function(_0x317b8d){try{jsonpatch[_0x4b3f('0x32')](_0x317b8d,_0x97b131,!![]);}catch(_0x457f41){return BPromise['reject'](_0x457f41);}return _0x317b8d[_0x4b3f('0x33')]();};}function saveUpdates(_0x63b69b,_0x126e8d){return function(_0x3da0a6){if(_0x3da0a6){return _0x3da0a6[_0x4b3f('0x34')](_0x63b69b)[_0x4b3f('0x21')](function(_0x5174c6){return _0x5174c6;});}return null;};}function removeEntity(_0x171b46,_0x5194d6){return function(_0x2d8938){if(_0x2d8938){return _0x2d8938[_0x4b3f('0x35')]()[_0x4b3f('0x21')](function(){_0x171b46[_0x4b3f('0x2b')](0xcc)[_0x4b3f('0x2c')]();});}};}function handleEntityNotFound(_0xe2101b,_0x53cd1d){return function(_0xf7dc4e){if(!_0xf7dc4e){_0xe2101b[_0x4b3f('0x2a')](0x194);}return _0xf7dc4e;};}function handleError(_0x2bd258,_0x23812c){_0x23812c=_0x23812c||0x1f4;return function(_0x38f130){logger['error'](_0x38f130[_0x4b3f('0x36')]);if(_0x38f130[_0x4b3f('0x37')]){delete _0x38f130['name'];}_0x2bd258[_0x4b3f('0x2b')](_0x23812c)[_0x4b3f('0x38')](_0x38f130);};}exports[_0x4b3f('0x39')]=function(_0x14c4bf,_0x47021e){var _0x47a195={},_0x388bdc={},_0x436615={'count':0x0,'rows':[]};var _0x4d6d12=_['map'](db[_0x4b3f('0x3a')][_0x4b3f('0x3b')],function(_0x593324){return{'name':_0x593324[_0x4b3f('0x3c')],'type':_0x593324[_0x4b3f('0x3d')][_0x4b3f('0x3e')]};});_0x388bdc[_0x4b3f('0x3f')]=_[_0x4b3f('0x40')](_0x4d6d12,'name');_0x388bdc[_0x4b3f('0x41')]=_[_0x4b3f('0x42')](_0x14c4bf[_0x4b3f('0x41')]);_0x388bdc['filters']=_['intersection'](_0x388bdc[_0x4b3f('0x3f')],_0x388bdc[_0x4b3f('0x41')]);_0x47a195['attributes']=_[_0x4b3f('0x43')](_0x388bdc['model'],qs[_0x4b3f('0x44')](_0x14c4bf[_0x4b3f('0x41')][_0x4b3f('0x44')]));_0x47a195[_0x4b3f('0x45')]=_0x47a195[_0x4b3f('0x45')][_0x4b3f('0x46')]?_0x47a195[_0x4b3f('0x45')]:_0x388bdc['model'];if(!_0x14c4bf['query'][_0x4b3f('0x47')](_0x4b3f('0x48'))){_0x47a195[_0x4b3f('0x2e')]=qs[_0x4b3f('0x2e')](_0x14c4bf[_0x4b3f('0x41')][_0x4b3f('0x2e')]);_0x47a195[_0x4b3f('0x2d')]=qs[_0x4b3f('0x2d')](_0x14c4bf[_0x4b3f('0x41')]['offset']);}_0x47a195[_0x4b3f('0x49')]=qs[_0x4b3f('0x4a')](_0x14c4bf[_0x4b3f('0x41')][_0x4b3f('0x4a')]);_0x47a195['where']=qs[_0x4b3f('0x4b')](_[_0x4b3f('0x4c')](_0x14c4bf[_0x4b3f('0x41')],_0x388bdc[_0x4b3f('0x4b')]),_0x4d6d12);if(_0x14c4bf[_0x4b3f('0x41')][_0x4b3f('0x4d')]){_0x47a195['where']=_[_0x4b3f('0x4e')](_0x47a195[_0x4b3f('0x4f')],{'$or':_['map'](_0x4d6d12,function(_0x4e2256){if(_0x4e2256[_0x4b3f('0x3d')]!==_0x4b3f('0x50')){var _0x46982e={};_0x46982e[_0x4e2256[_0x4b3f('0x37')]]={'$like':'%'+_0x14c4bf[_0x4b3f('0x41')][_0x4b3f('0x4d')]+'%'};return _0x46982e;}})});}_0x47a195=_[_0x4b3f('0x4e')]({},_0x47a195,_0x14c4bf[_0x4b3f('0x51')]);var _0x2d7f74={'where':_0x47a195[_0x4b3f('0x4f')]};return db[_0x4b3f('0x3a')]['count'](_0x2d7f74)[_0x4b3f('0x21')](function(_0x57a620){_0x436615[_0x4b3f('0x30')]=_0x57a620;if(_0x14c4bf[_0x4b3f('0x41')][_0x4b3f('0x52')]){_0x47a195[_0x4b3f('0x53')]=[{'all':!![]}];}return db[_0x4b3f('0x3a')][_0x4b3f('0x54')](_0x47a195);})[_0x4b3f('0x21')](function(_0x598242){_0x436615[_0x4b3f('0x55')]=_0x598242;return _0x436615;})[_0x4b3f('0x21')](respondWithFilteredResult(_0x47021e,_0x47a195))[_0x4b3f('0x56')](handleError(_0x47021e,null));};exports[_0x4b3f('0x57')]=function(_0x4ce40f,_0x595bb4){var _0x5c4819={'raw':!![],'where':{'id':_0x4ce40f[_0x4b3f('0x58')]['id']}},_0x59773b={};_0x59773b['model']=_[_0x4b3f('0x42')](db['ChatMessage'][_0x4b3f('0x3b')]);_0x59773b[_0x4b3f('0x41')]=_['keys'](_0x4ce40f[_0x4b3f('0x41')]);_0x59773b[_0x4b3f('0x4b')]=_['intersection'](_0x59773b[_0x4b3f('0x3f')],_0x59773b[_0x4b3f('0x41')]);_0x5c4819['attributes']=_[_0x4b3f('0x43')](_0x59773b[_0x4b3f('0x3f')],qs[_0x4b3f('0x44')](_0x4ce40f[_0x4b3f('0x41')][_0x4b3f('0x44')]));_0x5c4819[_0x4b3f('0x45')]=_0x5c4819['attributes'][_0x4b3f('0x46')]?_0x5c4819[_0x4b3f('0x45')]:_0x59773b[_0x4b3f('0x3f')];if(_0x4ce40f['query']['includeAll']){_0x5c4819[_0x4b3f('0x53')]=[{'all':!![]}];}_0x5c4819=_[_0x4b3f('0x4e')]({},_0x5c4819,_0x4ce40f[_0x4b3f('0x51')]);return db[_0x4b3f('0x3a')][_0x4b3f('0x59')](_0x5c4819)[_0x4b3f('0x21')](handleEntityNotFound(_0x595bb4,null))['then'](respondWithResult(_0x595bb4,null))[_0x4b3f('0x56')](handleError(_0x595bb4,null));};exports['create']=function(_0x3109d0,_0xd8dbb9){return db['ChatMessage'][_0x4b3f('0x5a')](_0x3109d0[_0x4b3f('0x5b')],{})[_0x4b3f('0x21')](respondWithResult(_0xd8dbb9,0xc9))[_0x4b3f('0x56')](handleError(_0xd8dbb9,null));};exports[_0x4b3f('0x34')]=function(_0x3e0e7a,_0x52fd3a){if(_0x3e0e7a['body']['id']){delete _0x3e0e7a[_0x4b3f('0x5b')]['id'];}return db[_0x4b3f('0x3a')][_0x4b3f('0x59')]({'where':{'id':_0x3e0e7a[_0x4b3f('0x58')]['id']}})[_0x4b3f('0x21')](handleEntityNotFound(_0x52fd3a,null))[_0x4b3f('0x21')](saveUpdates(_0x3e0e7a[_0x4b3f('0x5b')],null))['then'](respondWithResult(_0x52fd3a,null))['catch'](handleError(_0x52fd3a,null));};exports[_0x4b3f('0x35')]=function(_0x415399,_0x109576){return db['ChatMessage'][_0x4b3f('0x59')]({'where':{'id':_0x415399[_0x4b3f('0x58')]['id']}})['then'](handleEntityNotFound(_0x109576,null))['then'](removeEntity(_0x109576,null))[_0x4b3f('0x56')](handleError(_0x109576,null));};exports[_0x4b3f('0x5c')]=function(_0x1d65ff,_0x4d27d9){return db[_0x4b3f('0x3a')]['describe']()[_0x4b3f('0x21')](respondWithResult(_0x4d27d9,null))['catch'](handleError(_0x4d27d9,null));};var interaction_log=require(_0x4b3f('0x13'))(_0x4b3f('0x5d'));exports[_0x4b3f('0x5e')]=function(_0x233b29,_0x5a3a86,_0x5e7831){var _0x4310e7={'agent':{},'channel':'chat'};if(_0x233b29[_0x4b3f('0x5b')]['id']){delete _0x233b29[_0x4b3f('0x5b')]['id'];}_0x233b29['body'][_0x4b3f('0x5f')]=!![];_0x233b29[_0x4b3f('0x5b')][_0x4b3f('0x60')]=moment()[_0x4b3f('0x61')]('YYYY-MM-DD\x20HH:mm:ss');_0x233b29[_0x4b3f('0x5b')]['UserId']=_0x233b29[_0x4b3f('0x5b')][_0x4b3f('0x62')]||_0x233b29['user']['id'];_0x4310e7[_0x4b3f('0x63')]['id']=_0x233b29[_0x4b3f('0x5b')][_0x4b3f('0x62')];return db[_0x4b3f('0x3a')][_0x4b3f('0x59')]({'where':{'id':_0x233b29['params']['id'],'UserId':null}})[_0x4b3f('0x21')](handleEntityNotFound(_0x5a3a86,null))[_0x4b3f('0x21')](saveUpdates(_0x233b29[_0x4b3f('0x5b')],null))['then'](function(_0x15e3d3){if(_0x15e3d3){_0x4310e7['message']=_0x15e3d3[_0x4b3f('0x64')]({'plain':!![]});return db[_0x4b3f('0x65')][_0x4b3f('0x59')]({'where':{'id':_0x15e3d3[_0x4b3f('0x66')]}});}return null;})[_0x4b3f('0x21')](handleEntityNotFound(_0x5a3a86,null))[_0x4b3f('0x21')](function(_0x52135c){if(_0x52135c){return _0x52135c[_0x4b3f('0x34')]({'UserId':_0x233b29[_0x4b3f('0x5b')][_0x4b3f('0x62')],'read1stAt':_[_0x4b3f('0x67')](_0x52135c['read1stAt'])?moment()[_0x4b3f('0x61')](_0x4b3f('0x68')):undefined});}return null;})[_0x4b3f('0x21')](function(_0x411214){if(_0x411214){_0x4310e7['interaction']=_0x411214[_0x4b3f('0x64')]({'plain':!![]});interaction_log[_0x4b3f('0x22')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x233b29[_0x4b3f('0x69')]['id'],_0x233b29[_0x4b3f('0x69')]['name'],_0x233b29[_0x4b3f('0x69')][_0x4b3f('0x6a')],_0x4310e7['interaction']['id'],_0x233b29[_0x4b3f('0x5b')]?JSON[_0x4b3f('0x26')](_0x233b29[_0x4b3f('0x5b')]):_0x4b3f('0x6b'));return respondWithRpcPromise(_0x4b3f('0x6c'),_0x4b3f('0x6d'),_0x4310e7);}return null;})[_0x4b3f('0x21')](function(_0x2e28e5){var _0xec2a=_0x4b3f('0x6e')+_0x2e28e5[_0x4b3f('0x28')][_0x4b3f('0x6f')];return db[_0x4b3f('0x70')]['query'](_0xec2a,{'type':db[_0x4b3f('0x71')][_0x4b3f('0x72')][_0x4b3f('0x73')],'raw':!![]})[_0x4b3f('0x21')](function(_0x4535fa){return _0x4535fa;});})[_0x4b3f('0x21')](function(_0x3ede41){if(_0x3ede41){_0x4310e7[_0x4b3f('0x28')][_0x4b3f('0x74')]=_0x3ede41[0x0];if(!_0x233b29[_0x4b3f('0x5b')]['UserId'])return;return db['User'][_0x4b3f('0x59')]({'where':{'id':_0x233b29['body'][_0x4b3f('0x62')],'role':'agent'},'attributes':['id',_0x4b3f('0x37'),'fullname',_0x4b3f('0x75'),_0x4b3f('0x76')],'raw':!![]});}return null;})[_0x4b3f('0x21')](function(_0x233768){if(!_0x233768)return null;_0x4310e7['message'][_0x4b3f('0x63')]=_0x233768;return _0x4310e7;})[_0x4b3f('0x21')](function(_0xa3668c){if(_0xa3668c){if(_0x233b29['body'][_0x4b3f('0x77')]){_0x4310e7['message'][_0x4b3f('0x78')]=util['format']('SIP/%s',_0x233b29[_0x4b3f('0x69')][_0x4b3f('0x37')]);_0x4310e7[_0x4b3f('0x28')][_0x4b3f('0x79')]=_0x4310e7[_0x4b3f('0x79')];_0x4310e7['message']['motionChannel']=_0x4310e7[_0x4b3f('0x79')];_0x4310e7[_0x4b3f('0x28')][_0x4b3f('0x7a')]=_0x4b3f('0x5e');return respondWithRpcPromise(_0x4b3f('0x7b'),_0x4b3f('0x7b'),{'event':_0x4b3f('0x7c'),'message':_[_0x4b3f('0x4e')](_0x4310e7[_0x4b3f('0x28')],JSON[_0x4b3f('0x7d')](_0x4310e7['interaction']['formData']))},client9002)[_0x4b3f('0x21')](function(){return _0x4310e7;});}return _0x4310e7;}return null;})['then'](respondWithResult(_0x5a3a86,null))[_0x4b3f('0x56')](handleError(_0x5a3a86,null));};var interaction_log=require(_0x4b3f('0x13'))(_0x4b3f('0x5d'));exports[_0x4b3f('0x7e')]=function(_0x2a9677,_0x1693b1,_0x80cd22){var _0x46c2d1={'agent':{},'channel':_0x4b3f('0x7f')};if(_0x2a9677[_0x4b3f('0x5b')]['id']){delete _0x2a9677[_0x4b3f('0x5b')]['id'];}_0x2a9677[_0x4b3f('0x5b')][_0x4b3f('0x62')]=_0x2a9677['body'][_0x4b3f('0x62')]||_0x2a9677[_0x4b3f('0x69')]['id'];_0x46c2d1[_0x4b3f('0x63')]['id']=_0x2a9677['body'][_0x4b3f('0x62')];return db['ChatMessage'][_0x4b3f('0x59')]({'where':{'id':_0x2a9677[_0x4b3f('0x58')]['id'],'UserId':null}})[_0x4b3f('0x21')](handleEntityNotFound(_0x1693b1,null))[_0x4b3f('0x21')](function(_0x35d372){if(_0x35d372){_0x46c2d1[_0x4b3f('0x28')]=_0x35d372['get']({'plain':!![]});return db[_0x4b3f('0x65')][_0x4b3f('0x59')]({'where':{'id':_0x35d372[_0x4b3f('0x66')]}});}return null;})[_0x4b3f('0x21')](handleEntityNotFound(_0x1693b1,null))['then'](function(_0x26eb87){if(_0x26eb87){_0x46c2d1[_0x4b3f('0x80')]=_0x26eb87[_0x4b3f('0x64')]({'plain':!![]});interaction_log['info'](_0x4b3f('0x81'),_0x2a9677[_0x4b3f('0x69')]['id'],_0x2a9677['user'][_0x4b3f('0x37')],_0x2a9677[_0x4b3f('0x69')][_0x4b3f('0x6a')],_0x46c2d1['interaction']['id'],_0x2a9677['body']?JSON[_0x4b3f('0x26')](_0x2a9677['body']):_0x4b3f('0x6b'));return respondWithRpcPromise(_0x4b3f('0x82'),_0x4b3f('0x83'),_0x46c2d1);}return null;})['then'](function(_0x171b5b){var _0xca9f45=_0x4b3f('0x6e')+_0x171b5b[_0x4b3f('0x28')][_0x4b3f('0x6f')];return db[_0x4b3f('0x70')][_0x4b3f('0x41')](_0xca9f45,{'type':db['Sequelize'][_0x4b3f('0x72')][_0x4b3f('0x73')],'raw':!![]})[_0x4b3f('0x21')](function(_0x16fe77){return _0x16fe77;});})[_0x4b3f('0x21')](function(_0x319195){if(_0x319195){_0x46c2d1[_0x4b3f('0x28')][_0x4b3f('0x74')]=_0x319195[0x0];if(!_0x2a9677[_0x4b3f('0x5b')][_0x4b3f('0x62')])return;return db[_0x4b3f('0x84')][_0x4b3f('0x59')]({'where':{'id':_0x2a9677['body']['UserId'],'role':_0x4b3f('0x63')},'attributes':['id','name',_0x4b3f('0x85'),_0x4b3f('0x75'),_0x4b3f('0x76')],'raw':!![]});}return null;})[_0x4b3f('0x21')](function(_0x459cd4){if(!_0x459cd4)return null;_0x46c2d1['message'][_0x4b3f('0x63')]=_0x459cd4;return _0x46c2d1;})[_0x4b3f('0x21')](function(_0x18ccc2){if(_0x18ccc2){_0x18ccc2['message'][_0x4b3f('0x78')]=util[_0x4b3f('0x61')]('SIP/%s',_0x2a9677[_0x4b3f('0x69')][_0x4b3f('0x37')]);_0x18ccc2[_0x4b3f('0x28')][_0x4b3f('0x79')]=_0x46c2d1[_0x4b3f('0x79')];_0x18ccc2['message']['motionChannel']=_0x46c2d1[_0x4b3f('0x79')];_0x18ccc2['message'][_0x4b3f('0x7a')]=_0x4b3f('0x7e');respondWithRpcPromise(_0x4b3f('0x7b'),_0x4b3f('0x7b'),{'event':_0x4b3f('0x86'),'message':_[_0x4b3f('0x4e')](_0x46c2d1[_0x4b3f('0x28')],JSON[_0x4b3f('0x7d')](_0x46c2d1['interaction']['formData']))},client9002);return _0x46c2d1;}return null;})[_0x4b3f('0x21')](respondWithResult(_0x1693b1,null))[_0x4b3f('0x56')](handleError(_0x1693b1,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 81753ac..504fedf 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 _0x173a=['events','../../mysqldb','setMaxListeners','remove','emit','hook','exports'];(function(_0xccf836,_0x479543){var _0x1b24b2=function(_0x385cd0){while(--_0x385cd0){_0xccf836['push'](_0xccf836['shift']());}};_0x1b24b2(++_0x479543);}(_0x173a,0xf5));var _0xa173=function(_0x518d2a,_0x15aa56){_0x518d2a=_0x518d2a-0x0;var _0x10333c=_0x173a[_0x518d2a];return _0x10333c;};'use strict';var EventEmitter=require(_0xa173('0x0'));var ChatMessage=require(_0xa173('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xa173('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xa173('0x3')};function emitEvent(_0x4103a7){return function(_0x2f00a8,_0x44356b,_0x261f84){ChatMessageEvents[_0xa173('0x4')](_0x4103a7+':'+_0x2f00a8['id'],_0x2f00a8);ChatMessageEvents[_0xa173('0x4')](_0x4103a7,_0x2f00a8);_0x261f84(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0xa173('0x5')](e,emitEvent(event));}}module[_0xa173('0x6')]=ChatMessageEvents; \ No newline at end of file +var _0x8d96=['events','../../mysqldb','setMaxListeners','update','remove','emit','hasOwnProperty','exports'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x8d96,0x1b0));var _0x68d9=function(_0x40df90,_0x5e0e67){_0x40df90=_0x40df90-0x0;var _0x964ccd=_0x8d96[_0x40df90];return _0x964ccd;};'use strict';var EventEmitter=require(_0x68d9('0x0'));var ChatMessage=require(_0x68d9('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x68d9('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x68d9('0x3'),'afterDestroy':_0x68d9('0x4')};function emitEvent(_0x2c9bce){return function(_0x2d1dc6,_0x4d433b,_0x483886){ChatMessageEvents['emit'](_0x2c9bce+':'+_0x2d1dc6['id'],_0x2d1dc6);ChatMessageEvents[_0x68d9('0x5')](_0x2c9bce,_0x2d1dc6);_0x483886(null);};}for(var e in events){if(events[_0x68d9('0x6')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0x68d9('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 fc5b417..1f0c788 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 _0x331e=['api','moment','bluebird','path','rimraf','./chatMessage.attributes','exports','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','models','get','toLowerCase','out','secret','isNil','UserId','findOne','then','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x331e,0x193));var _0xe331=function(_0x11447e,_0x33dab2){_0x11447e=_0x11447e-0x0;var _0x45a214=_0x331e[_0x11447e];return _0x45a214;};'use strict';var _=require(_0xe331('0x0'));var util=require(_0xe331('0x1'));var logger=require(_0xe331('0x2'))(_0xe331('0x3'));var moment=require(_0xe331('0x4'));var BPromise=require(_0xe331('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe331('0x6'));var rimraf=require(_0xe331('0x7'));var config=require('../../config/environment');var attributes=require(_0xe331('0x8'));module[_0xe331('0x9')]=function(_0x598cbb,_0x1955b3){return _0x598cbb['define'](_0xe331('0xa'),attributes,{'tableName':_0xe331('0xb'),'paranoid':![],'indexes':[{'name':_0xe331('0xc'),'fields':[_0xe331('0xd')],'type':_0xe331('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1e1ab1,_0x3e9fbc,_0x38d193){var _0x13e88f=_0x598cbb[_0xe331('0xf')];var _0x3115e4=_0x1e1ab1[_0xe331('0x10')]({'plain':!![]});if(_0x3115e4['direction'][_0xe331('0x11')]()==='in'||_0x3115e4['direction']['toLowerCase']()===_0xe331('0x12')&&!_0x3115e4[_0xe331('0x13')]&&!_[_0xe331('0x14')](_0x3115e4[_0xe331('0x15')])){_0x13e88f['ChatInteraction'][_0xe331('0x16')]({'where':{'id':_0x3115e4['ChatInteractionId']}})[_0xe331('0x17')](function(_0x38926a){if(_0x38926a){_0x38926a['update']({'lastMsgAt':_0x3115e4[_0xe331('0x18')],'lastMsgDirection':_0x3115e4['direction']['toLowerCase']()});}})[_0xe331('0x19')](function(_0x580ebe){console[_0xe331('0x1a')](_0x580ebe);});}_0x38d193();}},'charset':_0xe331('0x1b'),'collate':_0xe331('0x1c')});}; \ No newline at end of file +var _0x2706=['error','utf8mb4_unicode_ci','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','UserId','ChatInteraction','findOne','then','update','createdAt','catch'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0x2706,0x1b4));var _0x6270=function(_0x4eaee5,_0x43f4e9){_0x4eaee5=_0x4eaee5-0x0;var _0x4e5c52=_0x2706[_0x4eaee5];return _0x4e5c52;};'use strict';var _=require(_0x6270('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x6270('0x1'));var moment=require(_0x6270('0x2'));var BPromise=require(_0x6270('0x3'));var rp=require(_0x6270('0x4'));var fs=require('fs');var path=require(_0x6270('0x5'));var rimraf=require(_0x6270('0x6'));var config=require(_0x6270('0x7'));var attributes=require(_0x6270('0x8'));module[_0x6270('0x9')]=function(_0x315886,_0x28691e){return _0x315886[_0x6270('0xa')](_0x6270('0xb'),attributes,{'tableName':_0x6270('0xc'),'paranoid':![],'indexes':[{'name':_0x6270('0xd'),'fields':[_0x6270('0xe')],'type':_0x6270('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4d2379,_0x41f103,_0x5f427a){var _0x2e38be=_0x315886[_0x6270('0x10')];var _0x203687=_0x4d2379[_0x6270('0x11')]({'plain':!![]});if(_0x203687[_0x6270('0x12')][_0x6270('0x13')]()==='in'||_0x203687[_0x6270('0x12')][_0x6270('0x13')]()===_0x6270('0x14')&&!_0x203687[_0x6270('0x15')]&&!_['isNil'](_0x203687[_0x6270('0x16')])){_0x2e38be[_0x6270('0x17')][_0x6270('0x18')]({'where':{'id':_0x203687['ChatInteractionId']}})[_0x6270('0x19')](function(_0xefcc53){if(_0xefcc53){_0xefcc53[_0x6270('0x1a')]({'lastMsgAt':_0x203687[_0x6270('0x1b')],'lastMsgDirection':_0x203687[_0x6270('0x12')][_0x6270('0x13')]()});}})[_0x6270('0x1c')](function(_0x1a9dd3){console[_0x6270('0x1d')](_0x1a9dd3);});}_0x5f427a();}},'charset':'utf8mb4','collate':_0x6270('0x1e')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index 0bc736e..7b29283 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 _0x76a9=['catch','CreateChatMessage','ChatMessage','create','raw','then','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','request','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x1c546c,_0x5c57cb){var _0x2cc384=function(_0x4dee11){while(--_0x4dee11){_0x1c546c['push'](_0x1c546c['shift']());}};_0x2cc384(++_0x5c57cb);}(_0x76a9,0x69));var _0x976a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x76a9[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x976a('0x0'));var util=require(_0x976a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x976a('0x2'));var fs=require('fs');var Redis=require(_0x976a('0x3'));var db=require(_0x976a('0x4'))['db'];var utils=require(_0x976a('0x5'));var logger=require(_0x976a('0x6'))(_0x976a('0x7'));var config=require(_0x976a('0x8'));var jayson=require(_0x976a('0x9'));var client=jayson['client'][_0x976a('0xa')]({'port':0x232a});config[_0x976a('0xb')]=_[_0x976a('0xc')](config[_0x976a('0xb')],{'host':_0x976a('0xd'),'port':0x18eb});var socket=require(_0x976a('0xe'))(new Redis(config['redis']));require('./chatMessage.socket')[_0x976a('0xf')](socket);function respondWithRpcPromise(_0xa3c251,_0x1bc120,_0x26c6ae){return new BPromise(function(_0x3cb6ca,_0x167c60){return client[_0x976a('0x10')](_0xa3c251,_0x26c6ae)['then'](function(_0xc43e4d){logger[_0x976a('0x11')](_0x976a('0x12'),_0x1bc120,_0x976a('0x13'));logger[_0x976a('0x14')](_0x976a('0x15'),_0x1bc120,_0x976a('0x13'),JSON[_0x976a('0x16')](_0xc43e4d));if(_0xc43e4d['error']){if(_0xc43e4d[_0x976a('0x17')][_0x976a('0x18')]===0x1f4){logger['error'](_0x976a('0x12'),_0x1bc120,_0xc43e4d['error'][_0x976a('0x19')]);return _0x167c60(_0xc43e4d[_0x976a('0x17')][_0x976a('0x19')]);}logger[_0x976a('0x17')]('ChatMessage,\x20%s,\x20%s',_0x1bc120,_0xc43e4d['error']['message']);return _0x3cb6ca(_0xc43e4d[_0x976a('0x17')][_0x976a('0x19')]);}else{logger['info'](_0x976a('0x12'),_0x1bc120,_0x976a('0x13'));_0x3cb6ca(_0xc43e4d[_0x976a('0x1a')][_0x976a('0x19')]);}})[_0x976a('0x1b')](function(_0x329eb0){logger[_0x976a('0x17')](_0x976a('0x12'),_0x1bc120,_0x329eb0);_0x167c60(_0x329eb0);});});}exports[_0x976a('0x1c')]=function(_0x4a32e4){var _0x67549c=this;return new Promise(function(_0x40db83,_0x113daa){return db[_0x976a('0x1d')][_0x976a('0x1e')](_0x4a32e4['body'],{'raw':_0x4a32e4['options']?_0x4a32e4['options'][_0x976a('0x1f')]===undefined?!![]:![]:!![]})[_0x976a('0x20')](function(_0x3bd04a){logger[_0x976a('0x11')]('CreateChatMessage',_0x4a32e4);logger[_0x976a('0x14')](_0x976a('0x1c'),_0x4a32e4,JSON[_0x976a('0x16')](_0x3bd04a));_0x40db83(_0x3bd04a);})['catch'](function(_0x49776a){logger[_0x976a('0x17')](_0x976a('0x1c'),_0x49776a['message'],_0x4a32e4);_0x113daa(_0x67549c[_0x976a('0x17')](0x1f4,_0x49776a[_0x976a('0x19')]));});});}; \ No newline at end of file +var _0x7493=['body','options','raw','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','register','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','CreateChatMessage','ChatMessage','create'];(function(_0x442801,_0x406ee2){var _0x51cb59=function(_0x1d468d){while(--_0x1d468d){_0x442801['push'](_0x442801['shift']());}};_0x51cb59(++_0x406ee2);}(_0x7493,0x144));var _0x3749=function(_0x1f1366,_0x8232b9){_0x1f1366=_0x1f1366-0x0;var _0x155396=_0x7493[_0x1f1366];return _0x155396;};'use strict';var _=require(_0x3749('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3749('0x1'));var rs=require(_0x3749('0x2'));var fs=require('fs');var Redis=require(_0x3749('0x3'));var db=require(_0x3749('0x4'))['db'];var utils=require(_0x3749('0x5'));var logger=require(_0x3749('0x6'))(_0x3749('0x7'));var config=require(_0x3749('0x8'));var jayson=require(_0x3749('0x9'));var client=jayson['client'][_0x3749('0xa')]({'port':0x232a});config[_0x3749('0xb')]=_[_0x3749('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3749('0xb')]));require('./chatMessage.socket')[_0x3749('0xd')](socket);function respondWithRpcPromise(_0x5496b0,_0x315426,_0x4dad88){return new BPromise(function(_0xa0cd37,_0x129f74){return client[_0x3749('0xe')](_0x5496b0,_0x4dad88)[_0x3749('0xf')](function(_0x1e1e18){logger['info'](_0x3749('0x10'),_0x315426,_0x3749('0x11'));logger[_0x3749('0x12')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x315426,'request\x20sent',JSON[_0x3749('0x13')](_0x1e1e18));if(_0x1e1e18[_0x3749('0x14')]){if(_0x1e1e18[_0x3749('0x14')][_0x3749('0x15')]===0x1f4){logger[_0x3749('0x14')]('ChatMessage,\x20%s,\x20%s',_0x315426,_0x1e1e18[_0x3749('0x14')][_0x3749('0x16')]);return _0x129f74(_0x1e1e18['error'][_0x3749('0x16')]);}logger[_0x3749('0x14')]('ChatMessage,\x20%s,\x20%s',_0x315426,_0x1e1e18[_0x3749('0x14')][_0x3749('0x16')]);return _0xa0cd37(_0x1e1e18[_0x3749('0x14')][_0x3749('0x16')]);}else{logger[_0x3749('0x17')](_0x3749('0x10'),_0x315426,'request\x20sent');_0xa0cd37(_0x1e1e18[_0x3749('0x18')][_0x3749('0x16')]);}})['catch'](function(_0x593e90){logger[_0x3749('0x14')](_0x3749('0x10'),_0x315426,_0x593e90);_0x129f74(_0x593e90);});});}exports[_0x3749('0x19')]=function(_0xcb8edf){var _0x1b52da=this;return new Promise(function(_0x1281cf,_0x40cc72){return db[_0x3749('0x1a')][_0x3749('0x1b')](_0xcb8edf[_0x3749('0x1c')],{'raw':_0xcb8edf[_0x3749('0x1d')]?_0xcb8edf[_0x3749('0x1d')][_0x3749('0x1e')]===undefined?!![]:![]:!![]})[_0x3749('0xf')](function(_0x39e14a){logger[_0x3749('0x17')]('CreateChatMessage',_0xcb8edf);logger[_0x3749('0x12')](_0x3749('0x19'),_0xcb8edf,JSON[_0x3749('0x13')](_0x39e14a));_0x1281cf(_0x39e14a);})[_0x3749('0x1f')](function(_0x29e8af){logger[_0x3749('0x14')](_0x3749('0x19'),_0x29e8af['message'],_0xcb8edf);_0x40cc72(_0x1b52da[_0x3749('0x14')](0x1f4,_0x29e8af[_0x3749('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index af866af..d2b11f6 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 _0x294b=['./chatMessage.events','remove','update','emit','removeListener','register'];(function(_0x3f7d81,_0x1b9ae6){var _0x279425=function(_0x53865e){while(--_0x53865e){_0x3f7d81['push'](_0x3f7d81['shift']());}};_0x279425(++_0x1b9ae6);}(_0x294b,0xea));var _0xb294=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x294b[_0x3dd15e];return _0x231fd0;};'use strict';var ChatMessageEvents=require(_0xb294('0x0'));var events=['save',_0xb294('0x1'),_0xb294('0x2')];function createListener(_0x3fb36e,_0x411640){return function(_0x1cd458){_0x411640[_0xb294('0x3')](_0x3fb36e,_0x1cd458);};}function removeListener(_0x58fe24,_0x5c0237){return function(){ChatMessageEvents[_0xb294('0x4')](_0x58fe24,_0x5c0237);};}exports[_0xb294('0x5')]=function(_0xaa6a67){for(var _0x181f5e=0x0,_0xcc7910=events['length'];_0x181f5e<_0xcc7910;_0x181f5e++){var _0x39dfbf=events[_0x181f5e];var _0x5110aa=createListener('chatMessage:'+_0x39dfbf,_0xaa6a67);ChatMessageEvents['on'](_0x39dfbf,_0x5110aa);}}; \ No newline at end of file +var _0x8ce1=['./chatMessage.events','save','remove','update','emit','removeListener','register','length','chatMessage:'];(function(_0x12769c,_0x1a275b){var _0x4c4376=function(_0x5d9861){while(--_0x5d9861){_0x12769c['push'](_0x12769c['shift']());}};_0x4c4376(++_0x1a275b);}(_0x8ce1,0x183));var _0x18ce=function(_0x1e6134,_0x59f648){_0x1e6134=_0x1e6134-0x0;var _0x4f228b=_0x8ce1[_0x1e6134];return _0x4f228b;};'use strict';var ChatMessageEvents=require(_0x18ce('0x0'));var events=[_0x18ce('0x1'),_0x18ce('0x2'),_0x18ce('0x3')];function createListener(_0x202f93,_0x22b196){return function(_0x211dc4){_0x22b196[_0x18ce('0x4')](_0x202f93,_0x211dc4);};}function removeListener(_0x1d842c,_0x15f55e){return function(){ChatMessageEvents[_0x18ce('0x5')](_0x1d842c,_0x15f55e);};}exports[_0x18ce('0x6')]=function(_0x13ff9d){for(var _0x36f8db=0x0,_0x682d4b=events[_0x18ce('0x7')];_0x36f8db<_0x682d4b;_0x36f8db++){var _0x4ebf82=events[_0x36f8db];var _0x1a60c5=createListener(_0x18ce('0x8')+_0x4ebf82,_0x13ff9d);ChatMessageEvents['on'](_0x4ebf82,_0x1a60c5);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index ca6cbd2..5e329b4 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 _0x2300=['chatmessage:create','create','put','update','accept','delete','destroy','exports','multer','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','describe','/:id','post','chat'];(function(_0x387603,_0x5a2d1){var _0x55ea9e=function(_0x46c5be){while(--_0x46c5be){_0x387603['push'](_0x387603['shift']());}};_0x55ea9e(++_0x5a2d1);}(_0x2300,0x9b));var _0x0230=function(_0x341cd2,_0x30238d){_0x341cd2=_0x341cd2-0x0;var _0x53ca8a=_0x2300[_0x341cd2];return _0x53ca8a;};'use strict';var multer=require(_0x0230('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x0230('0x1'));var express=require(_0x0230('0x2'));var router=express['Router']();var fs_extra=require(_0x0230('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x0230('0x4'));var config=require(_0x0230('0x5'));var controller=require('./chatMessage.controller');router[_0x0230('0x6')]('/',auth['isAuthenticated'](),controller[_0x0230('0x7')]);router[_0x0230('0x6')]('/describe',auth[_0x0230('0x8')](),controller[_0x0230('0x9')]);router[_0x0230('0x6')](_0x0230('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0230('0xb')]('/',auth[_0x0230('0x8')](),interaction['tracked'](_0x0230('0xc'),_0x0230('0xd')),controller[_0x0230('0xe')]);router[_0x0230('0xf')]('/:id',controller[_0x0230('0x10')]);router['put']('/:id/accept',auth['isAuthenticated'](),controller[_0x0230('0x11')]);router[_0x0230('0xf')]('/:id/reject',auth['isAuthenticated'](),controller['reject']);router[_0x0230('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x0230('0x13')]);module[_0x0230('0x14')]=router; \ No newline at end of file +var _0xff61=['/:id','show','post','tracked','chat','chatmessage:create','put','update','accept','/:id/reject','reject','delete','destroy','multer','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','/describe','describe'];(function(_0x1477ef,_0x54a5d6){var _0x164acd=function(_0x139149){while(--_0x139149){_0x1477ef['push'](_0x1477ef['shift']());}};_0x164acd(++_0x54a5d6);}(_0xff61,0x71));var _0x1ff6=function(_0x545cc2,_0x212dea){_0x545cc2=_0x545cc2-0x0;var _0x164b24=_0xff61[_0x545cc2];return _0x164b24;};'use strict';var multer=require(_0x1ff6('0x0'));var util=require(_0x1ff6('0x1'));var path=require('path');var timeout=require(_0x1ff6('0x2'));var express=require('express');var router=express[_0x1ff6('0x3')]();var fs_extra=require(_0x1ff6('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x1ff6('0x5'));var config=require(_0x1ff6('0x6'));var controller=require(_0x1ff6('0x7'));router[_0x1ff6('0x8')]('/',auth[_0x1ff6('0x9')](),controller['index']);router[_0x1ff6('0x8')](_0x1ff6('0xa'),auth[_0x1ff6('0x9')](),controller[_0x1ff6('0xb')]);router[_0x1ff6('0x8')](_0x1ff6('0xc'),auth['isAuthenticated'](),controller[_0x1ff6('0xd')]);router[_0x1ff6('0xe')]('/',auth[_0x1ff6('0x9')](),interaction[_0x1ff6('0xf')](_0x1ff6('0x10'),_0x1ff6('0x11')),controller['create']);router[_0x1ff6('0x12')](_0x1ff6('0xc'),controller[_0x1ff6('0x13')]);router['put']('/:id/accept',auth[_0x1ff6('0x9')](),controller[_0x1ff6('0x14')]);router[_0x1ff6('0x12')](_0x1ff6('0x15'),auth[_0x1ff6('0x9')](),controller[_0x1ff6('0x16')]);router[_0x1ff6('0x17')](_0x1ff6('0xc'),auth['isAuthenticated'](),controller[_0x1ff6('0x18')]);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 37cc0b2..f3858a1 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 _0xdb28=['TEXT','medium','sequelize','exports'];(function(_0x1ee5b5,_0x257c5a){var _0x2fa903=function(_0x4b44d2){while(--_0x4b44d2){_0x1ee5b5['push'](_0x1ee5b5['shift']());}};_0x2fa903(++_0x257c5a);}(_0xdb28,0x106));var _0x8db2=function(_0x4ca1ef,_0x557536){_0x4ca1ef=_0x4ca1ef-0x0;var _0x10af00=_0xdb28[_0x4ca1ef];return _0x10af00;};'use strict';var Sequelize=require(_0x8db2('0x0'));module[_0x8db2('0x1')]={'body':{'type':Sequelize[_0x8db2('0x2')](_0x8db2('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x8db2('0x3')),'allowNull':![]}}; \ No newline at end of file +var _0xb10b=['medium','sequelize','TEXT'];(function(_0x46ca1d,_0x3a263a){var _0x3f4ffc=function(_0x371d3c){while(--_0x371d3c){_0x46ca1d['push'](_0x46ca1d['shift']());}};_0x3f4ffc(++_0x3a263a);}(_0xb10b,0x12a));var _0xbb10=function(_0x4c7935,_0x4a53fb){_0x4c7935=_0x4c7935-0x0;var _0x30651d=_0xb10b[_0x4c7935];return _0x30651d;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'body':{'type':Sequelize[_0xbb10('0x1')](_0xbb10('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xbb10('0x1')]('medium'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index ec05ae9..57976c5 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x2a190e,_0x21fa33){var _0x1be642=function(_0x2711b9){while(--_0x2711b9){_0x2a190e['push'](_0x2a190e['shift']());}};_0x1be642(++_0x21fa33);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));}; \ No newline at end of file +var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x41637e,_0x427d2a){var _0x2e36ee=function(_0x85450a){while(--_0x85450a){_0x41637e['push'](_0x41637e['shift']());}};_0x2e36ee(++_0x427d2a);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js index 647152b..90e1a0b 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.events.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c0a=['ChatOfflineMessage','setMaxListeners','update','remove','emit','hook','exports','../../mysqldb'];(function(_0x2161da,_0x5c6f44){var _0x147c54=function(_0x24da07){while(--_0x24da07){_0x2161da['push'](_0x2161da['shift']());}};_0x147c54(++_0x5c6f44);}(_0x9c0a,0x117));var _0xa9c0=function(_0x2d0acb,_0xab8d74){_0x2d0acb=_0x2d0acb-0x0;var _0x69e388=_0x9c0a[_0x2d0acb];return _0x69e388;};'use strict';var EventEmitter=require('events');var ChatOfflineMessage=require(_0xa9c0('0x0'))['db'][_0xa9c0('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0xa9c0('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xa9c0('0x3'),'afterDestroy':_0xa9c0('0x4')};function emitEvent(_0xc540bd){return function(_0x43e525,_0x5d4830,_0x23beb3){ChatOfflineMessageEvents[_0xa9c0('0x5')](_0xc540bd+':'+_0x43e525['id'],_0x43e525);ChatOfflineMessageEvents[_0xa9c0('0x5')](_0xc540bd,_0x43e525);_0x23beb3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage[_0xa9c0('0x6')](e,emitEvent(event));}}module[_0xa9c0('0x7')]=ChatOfflineMessageEvents; \ No newline at end of file +var _0x4d1e=['hasOwnProperty','hook','exports','events','../../mysqldb','ChatOfflineMessage','setMaxListeners','save','update','remove','emit'];(function(_0x1da1e2,_0x1ae454){var _0xe0dd11=function(_0xb49657){while(--_0xb49657){_0x1da1e2['push'](_0x1da1e2['shift']());}};_0xe0dd11(++_0x1ae454);}(_0x4d1e,0xf5));var _0xe4d1=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0x4d1e[_0x2dadb9];return _0x2f0097;};'use strict';var EventEmitter=require(_0xe4d1('0x0'));var ChatOfflineMessage=require(_0xe4d1('0x1'))['db'][_0xe4d1('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0xe4d1('0x3')](0x0);var events={'afterCreate':_0xe4d1('0x4'),'afterUpdate':_0xe4d1('0x5'),'afterDestroy':_0xe4d1('0x6')};function emitEvent(_0x43ccef){return function(_0x446475,_0x3f3192,_0x174c56){ChatOfflineMessageEvents[_0xe4d1('0x7')](_0x43ccef+':'+_0x446475['id'],_0x446475);ChatOfflineMessageEvents[_0xe4d1('0x7')](_0x43ccef,_0x446475);_0x174c56(null);};}for(var e in events){if(events[_0xe4d1('0x8')](e)){var event=events[e];ChatOfflineMessage[_0xe4d1('0x9')](e,emitEvent(event));}}module[_0xe4d1('0xa')]=ChatOfflineMessageEvents; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index f7f3d2d..61151ad 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 _0xdbba=['define','ChatOfflineMessage','utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','exports'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0xdbba,0xd0));var _0xadbb=function(_0xe7a99e,_0x4902a1){_0xe7a99e=_0xe7a99e-0x0;var _0x3bef5c=_0xdbba[_0xe7a99e];return _0x3bef5c;};'use strict';var attributes=require(_0xadbb('0x0'));module[_0xadbb('0x1')]=function(_0x42f78a){return _0x42f78a[_0xadbb('0x2')](_0xadbb('0x3'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xadbb('0x4'),'collate':_0xadbb('0x5')});}; \ No newline at end of file +var _0xd4cf=['exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes'];(function(_0x12e07a,_0x3afe69){var _0x484b63=function(_0x166d9d){while(--_0x166d9d){_0x12e07a['push'](_0x12e07a['shift']());}};_0x484b63(++_0x3afe69);}(_0xd4cf,0x6f));var _0xfd4c=function(_0x38ce4c,_0xfdbe8c){_0x38ce4c=_0x38ce4c-0x0;var _0x5d4544=_0xd4cf[_0x38ce4c];return _0x5d4544;};'use strict';var attributes=require(_0xfd4c('0x0'));module[_0xfd4c('0x1')]=function(_0x434d79){return _0x434d79[_0xfd4c('0x2')](_0xfd4c('0x3'),attributes,{'tableName':_0xfd4c('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xfd4c('0x5'),'collate':_0xfd4c('0x6')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index 68c1763..46c56a2 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 _0x1c17=['../../config/environment','jayson/promise','client','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x16caf1,_0x3ecedc){var _0xdf9992=function(_0x40df79){while(--_0x40df79){_0x16caf1['push'](_0x16caf1['shift']());}};_0xdf9992(++_0x3ecedc);}(_0x1c17,0x158));var _0x71c1=function(_0xeae7c2,_0x1c8caf){_0xeae7c2=_0xeae7c2-0x0;var _0x2de18d=_0x1c17[_0xeae7c2];return _0x2de18d;};'use strict';var _=require(_0x71c1('0x0'));var util=require(_0x71c1('0x1'));var moment=require(_0x71c1('0x2'));var BPromise=require(_0x71c1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x71c1('0x4'));var db=require(_0x71c1('0x5'))['db'];var utils=require(_0x71c1('0x6'));var logger=require('../../config/logger')(_0x71c1('0x7'));var config=require(_0x71c1('0x8'));var jayson=require(_0x71c1('0x9'));var client=jayson[_0x71c1('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2ffe81,_0x4becd4,_0x53d3ee){return new BPromise(function(_0x267981,_0x374562){return client[_0x71c1('0xb')](_0x2ffe81,_0x53d3ee)[_0x71c1('0xc')](function(_0x407c48){logger[_0x71c1('0xd')](_0x71c1('0xe'),_0x4becd4,_0x71c1('0xf'));logger[_0x71c1('0x10')](_0x71c1('0x11'),_0x4becd4,'request\x20sent',JSON['stringify'](_0x407c48));if(_0x407c48['error']){if(_0x407c48[_0x71c1('0x12')][_0x71c1('0x13')]===0x1f4){logger[_0x71c1('0x12')](_0x71c1('0xe'),_0x4becd4,_0x407c48[_0x71c1('0x12')][_0x71c1('0x14')]);return _0x374562(_0x407c48['error'][_0x71c1('0x14')]);}logger[_0x71c1('0x12')]('ChatOfflineMessage,\x20%s,\x20%s',_0x4becd4,_0x407c48[_0x71c1('0x12')]['message']);return _0x267981(_0x407c48['error']['message']);}else{logger[_0x71c1('0xd')](_0x71c1('0xe'),_0x4becd4,'request\x20sent');_0x267981(_0x407c48[_0x71c1('0x15')][_0x71c1('0x14')]);}})['catch'](function(_0x341881){logger['error'](_0x71c1('0xe'),_0x4becd4,_0x341881);_0x374562(_0x341881);});});} \ No newline at end of file +var _0x2619=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x2a5e3a,_0x436c2a){var _0x513fa3=function(_0x2ece1b){while(--_0x2ece1b){_0x2a5e3a['push'](_0x2a5e3a['shift']());}};_0x513fa3(++_0x436c2a);}(_0x2619,0x119));var _0x9261=function(_0x152c37,_0xaf380d){_0x152c37=_0x152c37-0x0;var _0x1c4840=_0x2619[_0x152c37];return _0x1c4840;};'use strict';var _=require(_0x9261('0x0'));var util=require(_0x9261('0x1'));var moment=require(_0x9261('0x2'));var BPromise=require('bluebird');var rs=require(_0x9261('0x3'));var fs=require('fs');var Redis=require(_0x9261('0x4'));var db=require(_0x9261('0x5'))['db'];var utils=require(_0x9261('0x6'));var logger=require(_0x9261('0x7'))(_0x9261('0x8'));var config=require(_0x9261('0x9'));var jayson=require(_0x9261('0xa'));var client=jayson[_0x9261('0xb')][_0x9261('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x33f388,_0x2bc28f,_0x5efba3){return new BPromise(function(_0x4d6e29,_0x152b12){return client[_0x9261('0xd')](_0x33f388,_0x5efba3)[_0x9261('0xe')](function(_0x4d5c9f){logger[_0x9261('0xf')](_0x9261('0x10'),_0x2bc28f,_0x9261('0x11'));logger['debug']('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x2bc28f,_0x9261('0x11'),JSON[_0x9261('0x12')](_0x4d5c9f));if(_0x4d5c9f[_0x9261('0x13')]){if(_0x4d5c9f[_0x9261('0x13')][_0x9261('0x14')]===0x1f4){logger['error'](_0x9261('0x10'),_0x2bc28f,_0x4d5c9f['error'][_0x9261('0x15')]);return _0x152b12(_0x4d5c9f[_0x9261('0x13')][_0x9261('0x15')]);}logger[_0x9261('0x13')](_0x9261('0x10'),_0x2bc28f,_0x4d5c9f[_0x9261('0x13')][_0x9261('0x15')]);return _0x4d6e29(_0x4d5c9f[_0x9261('0x13')]['message']);}else{logger[_0x9261('0xf')]('ChatOfflineMessage,\x20%s,\x20%s',_0x2bc28f,_0x9261('0x11'));_0x4d6e29(_0x4d5c9f[_0x9261('0x16')][_0x9261('0x15')]);}})[_0x9261('0x17')](function(_0x451ea4){logger[_0x9261('0x13')](_0x9261('0x10'),_0x2bc28f,_0x451ea4);_0x152b12(_0x451ea4);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index eea6ab1..3f2facf 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 _0x6479=['../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','index','get','/describe','describe','/:id','isAuthenticated','show','create','put','update','delete','destroy','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x788a54,_0x12450b){var _0x8b73a4=function(_0x3b6271){while(--_0x3b6271){_0x788a54['push'](_0x788a54['shift']());}};_0x8b73a4(++_0x12450b);}(_0x6479,0xa2));var _0x9647=function(_0x11f4b5,_0x279f0d){_0x11f4b5=_0x11f4b5-0x0;var _0x59d5e0=_0x6479[_0x11f4b5];return _0x59d5e0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9647('0x0'));var timeout=require(_0x9647('0x1'));var express=require(_0x9647('0x2'));var router=express[_0x9647('0x3')]();var fs_extra=require(_0x9647('0x4'));var auth=require(_0x9647('0x5'));var interaction=require(_0x9647('0x6'));var config=require(_0x9647('0x7'));var controller=require(_0x9647('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x9647('0x9')]);router[_0x9647('0xa')](_0x9647('0xb'),auth['isAuthenticated'](),controller[_0x9647('0xc')]);router[_0x9647('0xa')](_0x9647('0xd'),auth[_0x9647('0xe')](),controller[_0x9647('0xf')]);router['post']('/',auth[_0x9647('0xe')](),controller[_0x9647('0x10')]);router[_0x9647('0x11')](_0x9647('0xd'),auth[_0x9647('0xe')](),controller[_0x9647('0x12')]);router[_0x9647('0x13')]('/:id',auth[_0x9647('0xe')](),controller[_0x9647('0x14')]);module['exports']=router; \ No newline at end of file +var _0xc1d6=['../../components/auth/service','../../config/environment','index','get','/describe','isAuthenticated','describe','/:id','show','post','put','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x51c25f,_0x4017a8){var _0xf8e1ac=function(_0x3f70d9){while(--_0x3f70d9){_0x51c25f['push'](_0x51c25f['shift']());}};_0xf8e1ac(++_0x4017a8);}(_0xc1d6,0x19b));var _0x6c1d=function(_0x339d57,_0x5d865a){_0x339d57=_0x339d57-0x0;var _0x43842e=_0xc1d6[_0x339d57];return _0x43842e;};'use strict';var multer=require(_0x6c1d('0x0'));var util=require(_0x6c1d('0x1'));var path=require(_0x6c1d('0x2'));var timeout=require(_0x6c1d('0x3'));var express=require(_0x6c1d('0x4'));var router=express[_0x6c1d('0x5')]();var fs_extra=require(_0x6c1d('0x6'));var auth=require(_0x6c1d('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x6c1d('0x8'));var controller=require('./chatOfflineMessage.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x6c1d('0x9')]);router[_0x6c1d('0xa')](_0x6c1d('0xb'),auth[_0x6c1d('0xc')](),controller[_0x6c1d('0xd')]);router[_0x6c1d('0xa')](_0x6c1d('0xe'),auth[_0x6c1d('0xc')](),controller[_0x6c1d('0xf')]);router[_0x6c1d('0x10')]('/',auth[_0x6c1d('0xc')](),controller['create']);router[_0x6c1d('0x11')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x6c1d('0xe'),auth[_0x6c1d('0xc')](),controller['destroy']);module[_0x6c1d('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index 00ff1ca..5e0b8a3 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 _0x5fe6=['exports','STRING','ENUM','mouseOver','INTEGER','sequelize'];(function(_0x4a7629,_0x55411e){var _0x220c10=function(_0x1cab72){while(--_0x1cab72){_0x4a7629['push'](_0x4a7629['shift']());}};_0x220c10(++_0x55411e);}(_0x5fe6,0x9b));var _0x65fe=function(_0x2ce5bc,_0x5b675a){_0x2ce5bc=_0x2ce5bc-0x0;var _0x37c71d=_0x5fe6[_0x2ce5bc];return _0x37c71d;};'use strict';var Sequelize=require(_0x65fe('0x0'));module[_0x65fe('0x1')]={'name':{'type':Sequelize[_0x65fe('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x65fe('0x3')](_0x65fe('0x4'),'timeout'),'defaultValue':_0x65fe('0x4')},'selector':{'type':Sequelize[_0x65fe('0x2')]},'timeout':{'type':Sequelize[_0x65fe('0x5')]}}; \ No newline at end of file +var _0xd569=['exports','ENUM','mouseOver','timeout','STRING','INTEGER','sequelize'];(function(_0x153889,_0x1f2796){var _0xcde38e=function(_0x2fe681){while(--_0x2fe681){_0x153889['push'](_0x153889['shift']());}};_0xcde38e(++_0x1f2796);}(_0xd569,0x1db));var _0x9d56=function(_0x5216e0,_0x4f8cb9){_0x5216e0=_0x5216e0-0x0;var _0x5b3f40=_0xd569[_0x5216e0];return _0x5b3f40;};'use strict';var Sequelize=require(_0x9d56('0x0'));module[_0x9d56('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x9d56('0x2')](_0x9d56('0x3'),_0x9d56('0x4')),'defaultValue':_0x9d56('0x3')},'selector':{'type':Sequelize[_0x9d56('0x5')]},'timeout':{'type':Sequelize[_0x9d56('0x6')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index ba645ee..1ecb6c8 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 _0x0e17=['undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','show','params','ChatProactiveAction','rawAttributes','query','intersection','model','attributes','fields','includeAll','merge','options','find','create','catch','update','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset'];(function(_0x5bc2ad,_0x29d25a){var _0xa7b393=function(_0x2c1979){while(--_0x2c1979){_0x5bc2ad['push'](_0x5bc2ad['shift']());}};_0xa7b393(++_0x29d25a);}(_0x0e17,0xd6));var _0x70e1=function(_0x3c2ac9,_0x1b844d){_0x3c2ac9=_0x3c2ac9-0x0;var _0xfde207=_0x0e17[_0x3c2ac9];return _0xfde207;};'use strict';var emlformat=require(_0x70e1('0x0'));var rimraf=require(_0x70e1('0x1'));var zipdir=require(_0x70e1('0x2'));var jsonpatch=require(_0x70e1('0x3'));var rp=require(_0x70e1('0x4'));var moment=require(_0x70e1('0x5'));var BPromise=require(_0x70e1('0x6'));var Mustache=require(_0x70e1('0x7'));var util=require(_0x70e1('0x8'));var path=require(_0x70e1('0x9'));var sox=require(_0x70e1('0xa'));var csv=require(_0x70e1('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x70e1('0xc'));var _=require(_0x70e1('0xd'));var squel=require(_0x70e1('0xe'));var crypto=require(_0x70e1('0xf'));var jsforce=require(_0x70e1('0x10'));var deskjs=require(_0x70e1('0x11'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x70e1('0x12'));var Redis=require('ioredis');var authService=require(_0x70e1('0x13'));var qs=require(_0x70e1('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x70e1('0x15'));var logger=require(_0x70e1('0x16'))('api');var utils=require(_0x70e1('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x70e1('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xcf9668,_0xcf2748){_0xcf2748=_0xcf2748||0xcc;return function(_0x15e180){if(_0x15e180){return _0xcf9668[_0x70e1('0x19')](_0xcf2748);}return _0xcf9668[_0x70e1('0x1a')](_0xcf2748)[_0x70e1('0x1b')]();};}function respondWithResult(_0xec5aea,_0x46e174){_0x46e174=_0x46e174||0xc8;return function(_0xf824e){if(_0xf824e){return _0xec5aea[_0x70e1('0x1a')](_0x46e174)[_0x70e1('0x1c')](_0xf824e);}};}function respondWithFilteredResult(_0x491c9c,_0x1f50aa){return function(_0x3c645c){if(_0x3c645c){var _0x39be1b=typeof _0x1f50aa[_0x70e1('0x1d')]===_0x70e1('0x1e')&&typeof _0x1f50aa[_0x70e1('0x1f')]===_0x70e1('0x1e');var _0x178441=_0x3c645c[_0x70e1('0x20')];var _0xa98e90=_0x39be1b?0x0:_0x1f50aa[_0x70e1('0x1d')];var _0x593db8=_0x39be1b?_0x3c645c['count']:_0x1f50aa[_0x70e1('0x1d')]+_0x1f50aa[_0x70e1('0x1f')];var _0x2963a7;if(_0x593db8>=_0x178441){_0x593db8=_0x178441;_0x2963a7=0xc8;}else{_0x2963a7=0xce;}_0x491c9c[_0x70e1('0x1a')](_0x2963a7);return _0x491c9c[_0x70e1('0x21')](_0x70e1('0x22'),_0xa98e90+'-'+_0x593db8+'/'+_0x178441)[_0x70e1('0x1c')](_0x3c645c);}return null;};}function patchUpdates(_0x17442e){return function(_0xdb1503){try{jsonpatch[_0x70e1('0x23')](_0xdb1503,_0x17442e,!![]);}catch(_0x3a9994){return BPromise[_0x70e1('0x24')](_0x3a9994);}return _0xdb1503[_0x70e1('0x25')]();};}function saveUpdates(_0x17631b,_0x3afc9b){return function(_0x1bd254){if(_0x1bd254){return _0x1bd254['update'](_0x17631b)[_0x70e1('0x26')](function(_0x5a59ff){return _0x5a59ff;});}return null;};}function removeEntity(_0x583613,_0x1b4043){return function(_0x21488e){if(_0x21488e){return _0x21488e[_0x70e1('0x27')]()[_0x70e1('0x26')](function(){_0x583613[_0x70e1('0x1a')](0xcc)[_0x70e1('0x1b')]();});}};}function handleEntityNotFound(_0x5201f1,_0x23e9df){return function(_0x2f418b){if(!_0x2f418b){_0x5201f1[_0x70e1('0x19')](0x194);}return _0x2f418b;};}function handleError(_0x223474,_0x5b4ed0){_0x5b4ed0=_0x5b4ed0||0x1f4;return function(_0x181abc){logger[_0x70e1('0x28')](_0x181abc[_0x70e1('0x29')]);if(_0x181abc['name']){delete _0x181abc[_0x70e1('0x2a')];}_0x223474[_0x70e1('0x1a')](_0x5b4ed0)[_0x70e1('0x2b')](_0x181abc);};}exports[_0x70e1('0x2c')]=function(_0x40c316,_0x33aab0){var _0x49a5a9={'raw':!![],'where':{'id':_0x40c316[_0x70e1('0x2d')]['id']}},_0x47c97c={};_0x47c97c['model']=_['keys'](db[_0x70e1('0x2e')][_0x70e1('0x2f')]);_0x47c97c[_0x70e1('0x30')]=_['keys'](_0x40c316['query']);_0x47c97c['filters']=_[_0x70e1('0x31')](_0x47c97c[_0x70e1('0x32')],_0x47c97c[_0x70e1('0x30')]);_0x49a5a9[_0x70e1('0x33')]=_[_0x70e1('0x31')](_0x47c97c[_0x70e1('0x32')],qs[_0x70e1('0x34')](_0x40c316[_0x70e1('0x30')]['fields']));_0x49a5a9[_0x70e1('0x33')]=_0x49a5a9[_0x70e1('0x33')]['length']?_0x49a5a9[_0x70e1('0x33')]:_0x47c97c[_0x70e1('0x32')];if(_0x40c316[_0x70e1('0x30')][_0x70e1('0x35')]){_0x49a5a9['include']=[{'all':!![]}];}_0x49a5a9=_[_0x70e1('0x36')]({},_0x49a5a9,_0x40c316[_0x70e1('0x37')]);return db[_0x70e1('0x2e')][_0x70e1('0x38')](_0x49a5a9)[_0x70e1('0x26')](handleEntityNotFound(_0x33aab0,null))[_0x70e1('0x26')](respondWithResult(_0x33aab0,null))['catch'](handleError(_0x33aab0,null));};exports['create']=function(_0x499574,_0x196d85){return db[_0x70e1('0x2e')][_0x70e1('0x39')](_0x499574['body'],{})['then'](respondWithResult(_0x196d85,0xc9))[_0x70e1('0x3a')](handleError(_0x196d85,null));};exports[_0x70e1('0x3b')]=function(_0x5223f1,_0x328a49){if(_0x5223f1[_0x70e1('0x3c')]['id']){delete _0x5223f1[_0x70e1('0x3c')]['id'];}return db[_0x70e1('0x2e')][_0x70e1('0x38')]({'where':{'id':_0x5223f1[_0x70e1('0x2d')]['id']}})[_0x70e1('0x26')](handleEntityNotFound(_0x328a49,null))[_0x70e1('0x26')](saveUpdates(_0x5223f1['body'],null))[_0x70e1('0x26')](respondWithResult(_0x328a49,null))[_0x70e1('0x3a')](handleError(_0x328a49,null));};exports['destroy']=function(_0x57e789,_0x4b275e){return db['ChatProactiveAction'][_0x70e1('0x38')]({'where':{'id':_0x57e789[_0x70e1('0x2d')]['id']}})[_0x70e1('0x26')](handleEntityNotFound(_0x4b275e,null))[_0x70e1('0x26')](removeEntity(_0x4b275e,null))[_0x70e1('0x3a')](handleError(_0x4b275e,null));}; \ No newline at end of file +var _0x6bb4=['limit','count','offset','set','Content-Range','apply','update','then','end','sendStatus','error','stack','name','show','params','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','attributes','fields','include','merge','options','find','catch','create','body','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','undefined'];(function(_0x24f2aa,_0x5a12c1){var _0x43d7e4=function(_0x77a8c7){while(--_0x77a8c7){_0x24f2aa['push'](_0x24f2aa['shift']());}};_0x43d7e4(++_0x5a12c1);}(_0x6bb4,0x1a7));var _0x46bb=function(_0x101a17,_0x5d047a){_0x101a17=_0x101a17-0x0;var _0x3b76ee=_0x6bb4[_0x101a17];return _0x3b76ee;};'use strict';var emlformat=require(_0x46bb('0x0'));var rimraf=require(_0x46bb('0x1'));var zipdir=require(_0x46bb('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x46bb('0x3'));var moment=require(_0x46bb('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x46bb('0x5'));var util=require(_0x46bb('0x6'));var path=require(_0x46bb('0x7'));var sox=require(_0x46bb('0x8'));var csv=require(_0x46bb('0x9'));var ejs=require(_0x46bb('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x46bb('0xb'));var crypto=require(_0x46bb('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x46bb('0xd'));var Papa=require(_0x46bb('0xe'));var Redis=require('ioredis');var authService=require(_0x46bb('0xf'));var qs=require(_0x46bb('0x10'));var as=require(_0x46bb('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x46bb('0x12'))(_0x46bb('0x13'));var utils=require('../../config/utils');var config=require(_0x46bb('0x14'));var licenseUtil=require(_0x46bb('0x15'));var db=require(_0x46bb('0x16'))['db'];function respondWithStatusCode(_0x54cbac,_0x18e28a){_0x18e28a=_0x18e28a||0xcc;return function(_0x481623){if(_0x481623){return _0x54cbac['sendStatus'](_0x18e28a);}return _0x54cbac[_0x46bb('0x17')](_0x18e28a)['end']();};}function respondWithResult(_0x30b3cd,_0x1c8850){_0x1c8850=_0x1c8850||0xc8;return function(_0x50f198){if(_0x50f198){return _0x30b3cd[_0x46bb('0x17')](_0x1c8850)['json'](_0x50f198);}};}function respondWithFilteredResult(_0x6b4781,_0x4d1095){return function(_0x210745){if(_0x210745){var _0x547aff=typeof _0x4d1095['offset']===_0x46bb('0x18')&&typeof _0x4d1095[_0x46bb('0x19')]==='undefined';var _0x3f0817=_0x210745[_0x46bb('0x1a')];var _0x5eb0e1=_0x547aff?0x0:_0x4d1095['offset'];var _0x3f0f4a=_0x547aff?_0x210745[_0x46bb('0x1a')]:_0x4d1095[_0x46bb('0x1b')]+_0x4d1095[_0x46bb('0x19')];var _0x20e011;if(_0x3f0f4a>=_0x3f0817){_0x3f0f4a=_0x3f0817;_0x20e011=0xc8;}else{_0x20e011=0xce;}_0x6b4781[_0x46bb('0x17')](_0x20e011);return _0x6b4781[_0x46bb('0x1c')](_0x46bb('0x1d'),_0x5eb0e1+'-'+_0x3f0f4a+'/'+_0x3f0817)['json'](_0x210745);}return null;};}function patchUpdates(_0x5ce203){return function(_0x10296c){try{jsonpatch[_0x46bb('0x1e')](_0x10296c,_0x5ce203,!![]);}catch(_0x2ff232){return BPromise['reject'](_0x2ff232);}return _0x10296c['save']();};}function saveUpdates(_0x4ccd36,_0x299fc0){return function(_0x2b3443){if(_0x2b3443){return _0x2b3443[_0x46bb('0x1f')](_0x4ccd36)[_0x46bb('0x20')](function(_0x5b8e04){return _0x5b8e04;});}return null;};}function removeEntity(_0x55893d,_0x59c525){return function(_0x5c2885){if(_0x5c2885){return _0x5c2885['destroy']()[_0x46bb('0x20')](function(){_0x55893d['status'](0xcc)[_0x46bb('0x21')]();});}};}function handleEntityNotFound(_0x3c0031,_0x16413b){return function(_0x1ee93a){if(!_0x1ee93a){_0x3c0031[_0x46bb('0x22')](0x194);}return _0x1ee93a;};}function handleError(_0x345425,_0x46c470){_0x46c470=_0x46c470||0x1f4;return function(_0x2d1a2f){logger[_0x46bb('0x23')](_0x2d1a2f[_0x46bb('0x24')]);if(_0x2d1a2f['name']){delete _0x2d1a2f[_0x46bb('0x25')];}_0x345425[_0x46bb('0x17')](_0x46c470)['send'](_0x2d1a2f);};}exports[_0x46bb('0x26')]=function(_0x3a9927,_0x2eb75f){var _0x329d0a={'raw':!![],'where':{'id':_0x3a9927[_0x46bb('0x27')]['id']}},_0x1977af={};_0x1977af[_0x46bb('0x28')]=_[_0x46bb('0x29')](db[_0x46bb('0x2a')][_0x46bb('0x2b')]);_0x1977af[_0x46bb('0x2c')]=_[_0x46bb('0x29')](_0x3a9927[_0x46bb('0x2c')]);_0x1977af[_0x46bb('0x2d')]=_[_0x46bb('0x2e')](_0x1977af[_0x46bb('0x28')],_0x1977af[_0x46bb('0x2c')]);_0x329d0a[_0x46bb('0x2f')]=_[_0x46bb('0x2e')](_0x1977af[_0x46bb('0x28')],qs[_0x46bb('0x30')](_0x3a9927['query'][_0x46bb('0x30')]));_0x329d0a['attributes']=_0x329d0a[_0x46bb('0x2f')]['length']?_0x329d0a[_0x46bb('0x2f')]:_0x1977af[_0x46bb('0x28')];if(_0x3a9927[_0x46bb('0x2c')]['includeAll']){_0x329d0a[_0x46bb('0x31')]=[{'all':!![]}];}_0x329d0a=_[_0x46bb('0x32')]({},_0x329d0a,_0x3a9927[_0x46bb('0x33')]);return db[_0x46bb('0x2a')][_0x46bb('0x34')](_0x329d0a)['then'](handleEntityNotFound(_0x2eb75f,null))[_0x46bb('0x20')](respondWithResult(_0x2eb75f,null))[_0x46bb('0x35')](handleError(_0x2eb75f,null));};exports[_0x46bb('0x36')]=function(_0x37db3c,_0x32e101){return db[_0x46bb('0x2a')][_0x46bb('0x36')](_0x37db3c[_0x46bb('0x37')],{})[_0x46bb('0x20')](respondWithResult(_0x32e101,0xc9))[_0x46bb('0x35')](handleError(_0x32e101,null));};exports[_0x46bb('0x1f')]=function(_0x461735,_0x7e9c51){if(_0x461735[_0x46bb('0x37')]['id']){delete _0x461735[_0x46bb('0x37')]['id'];}return db[_0x46bb('0x2a')][_0x46bb('0x34')]({'where':{'id':_0x461735[_0x46bb('0x27')]['id']}})[_0x46bb('0x20')](handleEntityNotFound(_0x7e9c51,null))[_0x46bb('0x20')](saveUpdates(_0x461735[_0x46bb('0x37')],null))[_0x46bb('0x20')](respondWithResult(_0x7e9c51,null))[_0x46bb('0x35')](handleError(_0x7e9c51,null));};exports['destroy']=function(_0x3148d9,_0x4b0500){return db['ChatProactiveAction']['find']({'where':{'id':_0x3148d9[_0x46bb('0x27')]['id']}})['then'](handleEntityNotFound(_0x4b0500,null))[_0x46bb('0x20')](removeEntity(_0x4b0500,null))['catch'](handleError(_0x4b0500,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index 69266e3..e0e4bdc 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 _0x23ad=['ChatProactiveAction','lodash','util','api','request-promise','path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define'];(function(_0x503641,_0x33a3cf){var _0x17757d=function(_0xc2ba4e){while(--_0xc2ba4e){_0x503641['push'](_0x503641['shift']());}};_0x17757d(++_0x33a3cf);}(_0x23ad,0x177));var _0xd23a=function(_0x2a09b7,_0x25faf1){_0x2a09b7=_0x2a09b7-0x0;var _0x4f2cca=_0x23ad[_0x2a09b7];return _0x4f2cca;};'use strict';var _=require(_0xd23a('0x0'));var util=require(_0xd23a('0x1'));var logger=require('../../config/logger')(_0xd23a('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd23a('0x3'));var fs=require('fs');var path=require(_0xd23a('0x4'));var rimraf=require(_0xd23a('0x5'));var config=require(_0xd23a('0x6'));var attributes=require(_0xd23a('0x7'));module[_0xd23a('0x8')]=function(_0x327ea7,_0x30f17d){return _0x327ea7[_0xd23a('0x9')](_0xd23a('0xa'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7330=['define','ChatProactiveAction','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x7330,0x1bc));var _0x0733=function(_0x318ab4,_0x3f2ae9){_0x318ab4=_0x318ab4-0x0;var _0x28c29d=_0x7330[_0x318ab4];return _0x28c29d;};'use strict';var _=require(_0x0733('0x0'));var util=require(_0x0733('0x1'));var logger=require(_0x0733('0x2'))(_0x0733('0x3'));var moment=require(_0x0733('0x4'));var BPromise=require(_0x0733('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0733('0x6'));var rimraf=require(_0x0733('0x7'));var config=require(_0x0733('0x8'));var attributes=require(_0x0733('0x9'));module[_0x0733('0xa')]=function(_0x336655,_0x2751b3){return _0x336655[_0x0733('0xb')](_0x0733('0xc'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js index e2312f7..ff6cb05 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 _0xcfe4=['util','moment','bluebird','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','stringify','error','message','ChatProactiveAction,\x20%s,\x20%s','catch'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xcfe4,0x132));var _0x4cfe=function(_0x393687,_0xf9b99c){_0x393687=_0x393687-0x0;var _0x1a9df0=_0xcfe4[_0x393687];return _0x1a9df0;};'use strict';var _=require('lodash');var util=require(_0x4cfe('0x0'));var moment=require(_0x4cfe('0x1'));var BPromise=require(_0x4cfe('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4cfe('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4cfe('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x4cfe('0x5'));var jayson=require(_0x4cfe('0x6'));var client=jayson[_0x4cfe('0x7')][_0x4cfe('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1ee6d1,_0x1fe41d,_0x3e15c7){return new BPromise(function(_0x156ab8,_0x5bd38d){return client[_0x4cfe('0x9')](_0x1ee6d1,_0x3e15c7)['then'](function(_0x7608bd){logger[_0x4cfe('0xa')]('ChatProactiveAction,\x20%s,\x20%s',_0x1fe41d,_0x4cfe('0xb'));logger[_0x4cfe('0xc')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x1fe41d,_0x4cfe('0xb'),JSON[_0x4cfe('0xd')](_0x7608bd));if(_0x7608bd['error']){if(_0x7608bd[_0x4cfe('0xe')]['code']===0x1f4){logger[_0x4cfe('0xe')]('ChatProactiveAction,\x20%s,\x20%s',_0x1fe41d,_0x7608bd[_0x4cfe('0xe')][_0x4cfe('0xf')]);return _0x5bd38d(_0x7608bd[_0x4cfe('0xe')][_0x4cfe('0xf')]);}logger['error'](_0x4cfe('0x10'),_0x1fe41d,_0x7608bd[_0x4cfe('0xe')][_0x4cfe('0xf')]);return _0x156ab8(_0x7608bd['error']['message']);}else{logger[_0x4cfe('0xa')](_0x4cfe('0x10'),_0x1fe41d,_0x4cfe('0xb'));_0x156ab8(_0x7608bd['result'][_0x4cfe('0xf')]);}})[_0x4cfe('0x11')](function(_0x487298){logger[_0x4cfe('0xe')](_0x4cfe('0x10'),_0x1fe41d,_0x487298);_0x5bd38d(_0x487298);});});} \ No newline at end of file +var _0x66ef=['info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message'];(function(_0xad319a,_0x27ff86){var _0x444ea1=function(_0x1e074b){while(--_0x1e074b){_0xad319a['push'](_0xad319a['shift']());}};_0x444ea1(++_0x27ff86);}(_0x66ef,0x145));var _0xf66e=function(_0x3f4757,_0x5d5b59){_0x3f4757=_0x3f4757-0x0;var _0x3ec216=_0x66ef[_0x3f4757];return _0x3ec216;};'use strict';var _=require(_0xf66e('0x0'));var util=require(_0xf66e('0x1'));var moment=require(_0xf66e('0x2'));var BPromise=require(_0xf66e('0x3'));var rs=require(_0xf66e('0x4'));var fs=require('fs');var Redis=require(_0xf66e('0x5'));var db=require(_0xf66e('0x6'))['db'];var utils=require(_0xf66e('0x7'));var logger=require(_0xf66e('0x8'))('rpc');var config=require(_0xf66e('0x9'));var jayson=require(_0xf66e('0xa'));var client=jayson[_0xf66e('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x18b573,_0x4d1eb3,_0xe3be99){return new BPromise(function(_0x37ebf6,_0x5ba682){return client[_0xf66e('0xc')](_0x18b573,_0xe3be99)[_0xf66e('0xd')](function(_0x365e98){logger['info'](_0xf66e('0xe'),_0x4d1eb3,_0xf66e('0xf'));logger[_0xf66e('0x10')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x4d1eb3,_0xf66e('0xf'),JSON[_0xf66e('0x11')](_0x365e98));if(_0x365e98['error']){if(_0x365e98[_0xf66e('0x12')]['code']===0x1f4){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x4d1eb3,_0x365e98[_0xf66e('0x12')][_0xf66e('0x13')]);return _0x5ba682(_0x365e98[_0xf66e('0x12')][_0xf66e('0x13')]);}logger[_0xf66e('0x12')](_0xf66e('0xe'),_0x4d1eb3,_0x365e98[_0xf66e('0x12')][_0xf66e('0x13')]);return _0x37ebf6(_0x365e98['error']['message']);}else{logger[_0xf66e('0x14')](_0xf66e('0xe'),_0x4d1eb3,_0xf66e('0xf'));_0x37ebf6(_0x365e98[_0xf66e('0x15')][_0xf66e('0x13')]);}})[_0xf66e('0x16')](function(_0x3ebfb9){logger[_0xf66e('0x12')](_0xf66e('0xe'),_0x4d1eb3,_0x3ebfb9);_0x5ba682(_0x3ebfb9);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index 7604df9..4a31cd5 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 _0xdc97=['get','/:id','show','create','put','isAuthenticated','update','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../config/environment','./chatProactiveAction.controller'];(function(_0x3969ae,_0x5b5d44){var _0x54e433=function(_0xda5b45){while(--_0xda5b45){_0x3969ae['push'](_0x3969ae['shift']());}};_0x54e433(++_0x5b5d44);}(_0xdc97,0x13b));var _0x7dc9=function(_0x3ad3ad,_0x2a21ef){_0x3ad3ad=_0x3ad3ad-0x0;var _0x5b130f=_0xdc97[_0x3ad3ad];return _0x5b130f;};'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 fs_extra=require(_0x7dc9('0x4'));var auth=require(_0x7dc9('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7dc9('0x6'));var controller=require(_0x7dc9('0x7'));router[_0x7dc9('0x8')](_0x7dc9('0x9'),auth['isAuthenticated'](),controller[_0x7dc9('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0x7dc9('0xb')]);router[_0x7dc9('0xc')](_0x7dc9('0x9'),auth[_0x7dc9('0xd')](),controller[_0x7dc9('0xe')]);router['delete'](_0x7dc9('0x9'),auth[_0x7dc9('0xd')](),controller[_0x7dc9('0xf')]);module[_0x7dc9('0x10')]=router; \ No newline at end of file +var _0x2675=['../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','post','create','put','delete','exports','multer','express','Router'];(function(_0x4f7f14,_0x36b3e1){var _0x79c31e=function(_0x23c1be){while(--_0x23c1be){_0x4f7f14['push'](_0x4f7f14['shift']());}};_0x79c31e(++_0x36b3e1);}(_0x2675,0x75));var _0x5267=function(_0x4f0620,_0xc90d0){_0x4f0620=_0x4f0620-0x0;var _0x15bfb9=_0x2675[_0x4f0620];return _0x15bfb9;};'use strict';var multer=require(_0x5267('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5267('0x1'));var router=express[_0x5267('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x5267('0x3'));var interaction=require(_0x5267('0x4'));var config=require('../../config/environment');var controller=require(_0x5267('0x5'));router[_0x5267('0x6')](_0x5267('0x7'),auth[_0x5267('0x8')](),controller[_0x5267('0x9')]);router[_0x5267('0xa')]('/',auth['isAuthenticated'](),controller[_0x5267('0xb')]);router[_0x5267('0xc')]('/:id',auth[_0x5267('0x8')](),controller['update']);router[_0x5267('0xd')](_0x5267('0x7'),auth[_0x5267('0x8')](),controller['destroy']);module[_0x5267('0xe')]=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index 133a519..a05f534 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 _0x5b20=['roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory','beepall'];(function(_0x31a85e,_0x4ebd76){var _0x4f99b3=function(_0x59cdcf){while(--_0x59cdcf){_0x31a85e['push'](_0x31a85e['shift']());}};_0x4f99b3(++_0x4ebd76);}(_0x5b20,0xeb));var _0x05b2=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x5b20[_0x178e48];return _0x440d7e;};'use strict';var Sequelize=require(_0x05b2('0x0'));module[_0x05b2('0x1')]={'name':{'type':Sequelize[_0x05b2('0x2')],'unique':_0x05b2('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x05b2('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x05b2('0x5')](_0x05b2('0x6'),_0x05b2('0x7'),_0x05b2('0x8'))}}; \ No newline at end of file +var _0xb040=['roundrobin','sequelize','STRING','INTEGER','ENUM','rrmemory','beepall'];(function(_0x5c2c7c,_0xa7d3b1){var _0xea7ffe=function(_0x471f17){while(--_0x471f17){_0x5c2c7c['push'](_0x5c2c7c['shift']());}};_0xea7ffe(++_0xa7d3b1);}(_0xb040,0xef));var _0x0b04=function(_0x291861,_0x828bca){_0x291861=_0x291861-0x0;var _0xa4113c=_0xb040[_0x291861];return _0xa4113c;};'use strict';var Sequelize=require(_0x0b04('0x0'));module['exports']={'name':{'type':Sequelize[_0x0b04('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x0b04('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x0b04('0x3')](_0x0b04('0x4'),_0x0b04('0x5'),_0x0b04('0x6'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 02c3c75..1a85121 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 _0x5616=['where','include','findAll','catch','show','params','keys','query','filters','intersection','model','attributes','fields','length','includeAll','merge','find','create','body','user','role','ChatQueues','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','findOne','UserChatQueue','hasOwnProperty','order','sort','pick','ChatQueueId','filter','options','User','map','agent','chatPause','updatedAt','rows','format','%s/%s','SIP','createdAt','getTeams','nolimit','addTeams','Team','Agents','online','voicePause','interface','sequelize','transaction','each','emit','ids','select','field','tq.TeamId','join','user_has_teams','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','SELECT','every','includes','all','union','compact','removeTeams','isEmpty','removeAgents','forEach','userChatQueue:remove','addAgents','omit','spread','userChatQueue:save','isArray','getAgents','bluebird','util','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','register','sendStatus','status','end','json','offset','count','limit','set','Content-Range','then','destroy','get','UserProfileResource','name','send','index','ChatQueue','rawAttributes','key'];(function(_0x2f87e8,_0x2c36cf){var _0x3dcd1f=function(_0x2b9764){while(--_0x2b9764){_0x2f87e8['push'](_0x2f87e8['shift']());}};_0x3dcd1f(++_0x2c36cf);}(_0x5616,0x1bf));var _0x6561=function(_0xb2eb8,_0xeebbdf){_0xb2eb8=_0xb2eb8-0x0;var _0xd94a48=_0x5616[_0xb2eb8];return _0xd94a48;};'use strict';var BPromise=require(_0x6561('0x0'));var util=require(_0x6561('0x1'));var _=require(_0x6561('0x2'));var squel=require(_0x6561('0x3'));var Redis=require(_0x6561('0x4'));var qs=require(_0x6561('0x5'));var logger=require(_0x6561('0x6'))(_0x6561('0x7'));var config=require(_0x6561('0x8'));var db=require(_0x6561('0x9'))['db'];config[_0x6561('0xa')]=_[_0x6561('0xb')](config[_0x6561('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x6561('0xc'))(new Redis(config[_0x6561('0xa')]));require('./chatQueue.socket')[_0x6561('0xd')](socket);function respondWithStatusCode(_0x1474f7,_0x39acb8){_0x39acb8=_0x39acb8||0xcc;return function(_0x3ee4d3){if(_0x3ee4d3){return _0x1474f7[_0x6561('0xe')](_0x39acb8);}return _0x1474f7[_0x6561('0xf')](_0x39acb8)[_0x6561('0x10')]();};}function respondWithResult(_0x17a21c,_0x50a563){_0x50a563=_0x50a563||0xc8;return function(_0x440ec3){if(_0x440ec3){return _0x17a21c[_0x6561('0xf')](_0x50a563)[_0x6561('0x11')](_0x440ec3);}};}function respondWithFilteredResult(_0x34223e,_0x4f2820){return function(_0x1fcebe){if(_0x1fcebe){var _0x2da81c=typeof _0x4f2820[_0x6561('0x12')]==='undefined'&&typeof _0x4f2820['limit']==='undefined';var _0x4d0d78=_0x1fcebe[_0x6561('0x13')];var _0x26e21f=_0x2da81c?0x0:_0x4f2820['offset'];var _0x222cf9=_0x2da81c?_0x1fcebe[_0x6561('0x13')]:_0x4f2820['offset']+_0x4f2820[_0x6561('0x14')];var _0x1b118f;if(_0x222cf9>=_0x4d0d78){_0x222cf9=_0x4d0d78;_0x1b118f=0xc8;}else{_0x1b118f=0xce;}_0x34223e[_0x6561('0xf')](_0x1b118f);return _0x34223e[_0x6561('0x15')](_0x6561('0x16'),_0x26e21f+'-'+_0x222cf9+'/'+_0x4d0d78)[_0x6561('0x11')](_0x1fcebe);}return null;};}function saveUpdates(_0xa393e9){return function(_0x339fe4){if(_0x339fe4){return _0x339fe4['update'](_0xa393e9)[_0x6561('0x17')](function(_0x260fce){return _0x260fce;});}return null;};}function removeEntity(_0x387f84){return function(_0x3b79c2){if(_0x3b79c2){return _0x3b79c2[_0x6561('0x18')]()[_0x6561('0x17')](function(){var _0x298fcc=_0x3b79c2[_0x6561('0x19')]({'plain':!![]});var _0x233ebf='ChatQueues';return db[_0x6561('0x1a')][_0x6561('0x18')]({'where':{'type':_0x233ebf,'resourceId':_0x298fcc['id']}})[_0x6561('0x17')](function(){return _0x3b79c2;});})[_0x6561('0x17')](function(){_0x387f84[_0x6561('0xf')](0xcc)[_0x6561('0x10')]();});}};}function handleEntityNotFound(_0x334a25){return function(_0x481ad0){if(!_0x481ad0){_0x334a25[_0x6561('0xe')](0x194);}return _0x481ad0;};}function handleError(_0x8c0fba,_0x29546c){_0x29546c=_0x29546c||0x1f4;return function(_0x456e5c){logger['error'](_0x456e5c['stack']);if(_0x456e5c['name']){delete _0x456e5c[_0x6561('0x1b')];}_0x8c0fba[_0x6561('0xf')](_0x29546c)[_0x6561('0x1c')](_0x456e5c);};}exports[_0x6561('0x1d')]=function(_0x2f2c81,_0x24c23a){var _0x38b4cc={};var _0x4e24e1={'count':0x0,'rows':[]};var _0x4826f8=_['map'](db[_0x6561('0x1e')][_0x6561('0x1f')],function(_0x2ad6b6){return{'name':_0x2ad6b6['fieldName'],'type':_0x2ad6b6['type'][_0x6561('0x20')]};});_0x38b4cc=qs['getOptions'](_0x4826f8,_0x2f2c81);var _0x3e2e98={'where':_0x38b4cc[_0x6561('0x21')]};return db['ChatQueue'][_0x6561('0x13')](_0x3e2e98)[_0x6561('0x17')](function(_0xf11ba){_0x4e24e1['count']=_0xf11ba;_0x38b4cc[_0x6561('0x22')]=qs[_0x6561('0x22')](_0x2f2c81['query']);return db['ChatQueue'][_0x6561('0x23')](_0x38b4cc);})[_0x6561('0x17')](function(_0x59d07c){_0x4e24e1['rows']=_0x59d07c;return _0x4e24e1;})[_0x6561('0x17')](respondWithFilteredResult(_0x24c23a,_0x38b4cc))[_0x6561('0x24')](handleError(_0x24c23a,null));};exports[_0x6561('0x25')]=function(_0x366299,_0x560867){var _0x2a5f9b={'raw':!![],'where':{'id':_0x366299[_0x6561('0x26')]['id']}},_0x3a0398={};_0x3a0398['model']=_[_0x6561('0x27')](db['ChatQueue'][_0x6561('0x1f')]);_0x3a0398['query']=_[_0x6561('0x27')](_0x366299[_0x6561('0x28')]);_0x3a0398[_0x6561('0x29')]=_[_0x6561('0x2a')](_0x3a0398[_0x6561('0x2b')],_0x3a0398[_0x6561('0x28')]);_0x2a5f9b[_0x6561('0x2c')]=_[_0x6561('0x2a')](_0x3a0398[_0x6561('0x2b')],qs[_0x6561('0x2d')](_0x366299['query'][_0x6561('0x2d')]));_0x2a5f9b[_0x6561('0x2c')]=_0x2a5f9b[_0x6561('0x2c')][_0x6561('0x2e')]?_0x2a5f9b[_0x6561('0x2c')]:_0x3a0398[_0x6561('0x2b')];if(_0x366299[_0x6561('0x28')][_0x6561('0x2f')]){_0x2a5f9b[_0x6561('0x22')]=[{'all':!![]}];}_0x2a5f9b=_[_0x6561('0x30')]({},_0x2a5f9b,_0x366299['options']);return db[_0x6561('0x1e')][_0x6561('0x31')](_0x2a5f9b)['then'](handleEntityNotFound(_0x560867,null))[_0x6561('0x17')](respondWithResult(_0x560867,null))['catch'](handleError(_0x560867,null));};exports[_0x6561('0x32')]=function(_0x495bfa,_0x26bbbb){return db[_0x6561('0x1e')][_0x6561('0x32')](_0x495bfa[_0x6561('0x33')],{})['then'](function(_0x50c27f){var _0x5c6c76=_0x495bfa[_0x6561('0x34')][_0x6561('0x19')]({'plain':!![]});if(!_0x5c6c76)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5c6c76[_0x6561('0x35')]===_0x6561('0x34')){var _0x19469f=_0x50c27f[_0x6561('0x19')]({'plain':!![]});var _0x485704=_0x6561('0x36');return db['UserProfileSection'][_0x6561('0x31')]({'where':{'name':_0x485704,'userProfileId':_0x5c6c76['userProfileId']},'raw':!![]})['then'](function(_0x506110){if(_0x506110&&_0x506110[_0x6561('0x37')]===0x0){return db[_0x6561('0x1a')][_0x6561('0x32')]({'name':_0x19469f[_0x6561('0x1b')],'resourceId':_0x19469f['id'],'type':_0x506110[_0x6561('0x1b')],'sectionId':_0x506110['id']},{})[_0x6561('0x17')](function(){return _0x50c27f;});}else{return _0x50c27f;}})[_0x6561('0x24')](function(_0x474205){logger[_0x6561('0x38')](_0x6561('0x39'),_0x474205);throw _0x474205;});}return _0x50c27f;})[_0x6561('0x17')](respondWithResult(_0x26bbbb,0xc9))[_0x6561('0x24')](handleError(_0x26bbbb,null));};exports[_0x6561('0x3a')]=function(_0x341414,_0x1a9ed2){if(_0x341414[_0x6561('0x33')]['id']){delete _0x341414['body']['id'];}return db['ChatQueue'][_0x6561('0x31')]({'where':{'id':_0x341414['params']['id']}})['then'](handleEntityNotFound(_0x1a9ed2,null))['then'](saveUpdates(_0x341414[_0x6561('0x33')],null))[_0x6561('0x17')](respondWithResult(_0x1a9ed2,null))[_0x6561('0x24')](handleError(_0x1a9ed2,null));};exports[_0x6561('0x18')]=function(_0xb4dc13,_0x145fca){return db[_0x6561('0x1e')][_0x6561('0x31')]({'where':{'id':_0xb4dc13[_0x6561('0x26')]['id']}})[_0x6561('0x17')](handleEntityNotFound(_0x145fca,null))[_0x6561('0x17')](removeEntity(_0x145fca,null))['catch'](handleError(_0x145fca,null));};exports['describe']=function(_0x238266,_0xd27261){return db['ChatQueue'][_0x6561('0x3b')]()[_0x6561('0x17')](respondWithResult(_0xd27261,null))[_0x6561('0x24')](handleError(_0xd27261,null));};exports[_0x6561('0x3c')]=function(_0x6f64c4,_0x4012f4){var _0x316638={'raw':!![],'where':{}},_0x59ed95={},_0x25d033;return db['ChatQueue'][_0x6561('0x3d')]({'where':{'id':_0x6f64c4[_0x6561('0x26')]['id']}})[_0x6561('0x17')](handleEntityNotFound(_0x4012f4,null))[_0x6561('0x17')](function(_0x39e077){if(_0x39e077){_0x25d033=_0x39e077[_0x6561('0x19')]({'plain':!![]});_0x59ed95[_0x6561('0x2b')]=_[_0x6561('0x27')](db[_0x6561('0x3e')][_0x6561('0x1f')]);_0x59ed95[_0x6561('0x28')]=_[_0x6561('0x27')](_0x6f64c4['query']);_0x59ed95['filters']=_['intersection'](_0x59ed95[_0x6561('0x2b')],_0x59ed95[_0x6561('0x28')]);_0x316638['attributes']=_[_0x6561('0x2a')](_0x59ed95[_0x6561('0x2b')],qs[_0x6561('0x2d')](_0x6f64c4[_0x6561('0x28')][_0x6561('0x2d')]));_0x316638[_0x6561('0x2c')]=_0x316638[_0x6561('0x2c')][_0x6561('0x2e')]?_0x316638[_0x6561('0x2c')]:_0x59ed95[_0x6561('0x2b')];if(!_0x6f64c4['query'][_0x6561('0x3f')]('nolimit')){_0x316638['limit']=qs[_0x6561('0x14')](_0x6f64c4[_0x6561('0x28')][_0x6561('0x14')]);_0x316638[_0x6561('0x12')]=qs['offset'](_0x6f64c4[_0x6561('0x28')]['offset']);}_0x316638[_0x6561('0x40')]=qs[_0x6561('0x41')](_0x6f64c4[_0x6561('0x28')][_0x6561('0x41')]);_0x316638[_0x6561('0x21')]=qs[_0x6561('0x29')](_[_0x6561('0x42')](_0x6f64c4['query'],_0x59ed95[_0x6561('0x29')]));_0x316638[_0x6561('0x21')][_0x6561('0x43')]=_0x39e077['id'];if(_0x6f64c4[_0x6561('0x28')][_0x6561('0x44')]){_0x316638[_0x6561('0x21')]=_[_0x6561('0x30')](_0x316638[_0x6561('0x21')],{'$or':_['map'](_0x316638[_0x6561('0x2c')],function(_0x373460){var _0xef5709={};_0xef5709[_0x373460]={'$like':'%'+_0x6f64c4['query'][_0x6561('0x44')]+'%'};return _0xef5709;})});}_0x316638=_[_0x6561('0x30')]({},_0x316638,_0x6f64c4[_0x6561('0x45')]);return db[_0x6561('0x3e')][_0x6561('0x23')](_0x316638);}})[_0x6561('0x17')](function(_0x4f8e56){if(_0x4f8e56){return db[_0x6561('0x46')]['findAndCountAll']({'where':{'id':_[_0x6561('0x47')](_0x4f8e56,'UserId'),'role':_0x6561('0x48')},'attributes':['id',_0x6561('0x1b'),_0x6561('0x49'),_0x6561('0x4a'),'createdAt']});}})['then'](function(_0xaa63fd){if(_0xaa63fd){return{'count':_0xaa63fd[_0x6561('0x13')],'rows':_[_0x6561('0x47')](_0xaa63fd[_0x6561('0x4b')],function(_0x23f2c6){return{'membername':_0x23f2c6[_0x6561('0x1b')],'UserId':_0x23f2c6['id'],'queue_name':_0x25d033['name'],'ChatQueueId':_0x25d033['id'],'interface':util[_0x6561('0x4c')](_0x6561('0x4d'),_0x6561('0x4e'),_0x23f2c6['name']),'penalty':0x0,'paused':_0x23f2c6[_0x6561('0x49')],'createdAt':_0x23f2c6[_0x6561('0x4f')],'updatedAt':_0x23f2c6[_0x6561('0x4a')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x6561('0x17')](respondWithFilteredResult(_0x4012f4,_0x316638))[_0x6561('0x24')](handleError(_0x4012f4,null));};exports[_0x6561('0x50')]=function(_0x5478ac,_0x551fec){var _0x34a8e3={};var _0x40f53b={};var _0x423a7d;var _0x5f1466;return db[_0x6561('0x1e')]['findOne']({'where':{'id':_0x5478ac[_0x6561('0x26')]['id']}})[_0x6561('0x17')](handleEntityNotFound(_0x551fec,null))['then'](function(_0x4f3b86){if(_0x4f3b86){_0x423a7d=_0x4f3b86;_0x40f53b[_0x6561('0x2b')]=_[_0x6561('0x27')](db['Team']['rawAttributes']);_0x40f53b[_0x6561('0x28')]=_[_0x6561('0x27')](_0x5478ac[_0x6561('0x28')]);_0x40f53b[_0x6561('0x29')]=_[_0x6561('0x2a')](_0x40f53b[_0x6561('0x2b')],_0x40f53b[_0x6561('0x28')]);_0x34a8e3[_0x6561('0x2c')]=_[_0x6561('0x2a')](_0x40f53b['model'],qs[_0x6561('0x2d')](_0x5478ac['query']['fields']));_0x34a8e3[_0x6561('0x2c')]=_0x34a8e3['attributes'][_0x6561('0x2e')]?_0x34a8e3[_0x6561('0x2c')]:_0x40f53b[_0x6561('0x2b')];_0x34a8e3[_0x6561('0x40')]=qs[_0x6561('0x41')](_0x5478ac[_0x6561('0x28')][_0x6561('0x41')]);_0x34a8e3['where']=qs[_0x6561('0x29')](_['pick'](_0x5478ac[_0x6561('0x28')],_0x40f53b['filters']));if(_0x5478ac[_0x6561('0x28')]['filter']){_0x34a8e3[_0x6561('0x21')]=_[_0x6561('0x30')](_0x34a8e3[_0x6561('0x21')],{'$or':_[_0x6561('0x47')](_0x34a8e3[_0x6561('0x2c')],function(_0x4a544b){var _0x359fc4={};_0x359fc4[_0x4a544b]={'$like':'%'+_0x5478ac[_0x6561('0x28')][_0x6561('0x44')]+'%'};return _0x359fc4;})});}_0x34a8e3=_['merge']({},_0x34a8e3,_0x5478ac[_0x6561('0x45')]);return _0x423a7d[_0x6561('0x50')](_0x34a8e3);}})[_0x6561('0x17')](function(_0x2fa271){if(_0x2fa271){_0x5f1466=_0x2fa271[_0x6561('0x2e')];if(!_0x5478ac[_0x6561('0x28')][_0x6561('0x3f')](_0x6561('0x51'))){_0x34a8e3[_0x6561('0x14')]=qs[_0x6561('0x14')](_0x5478ac[_0x6561('0x28')][_0x6561('0x14')]);_0x34a8e3[_0x6561('0x12')]=qs[_0x6561('0x12')](_0x5478ac[_0x6561('0x28')][_0x6561('0x12')]);}return _0x423a7d[_0x6561('0x50')](_0x34a8e3);}})[_0x6561('0x17')](function(_0x284e44){if(_0x284e44){return _0x284e44?{'count':_0x5f1466,'rows':_0x284e44}:null;}})[_0x6561('0x17')](respondWithResult(_0x551fec,null))[_0x6561('0x24')](handleError(_0x551fec,null));};exports[_0x6561('0x52')]=function(_0x36d284,_0x45a464){var _0x4bc1bc=_0x36d284[_0x6561('0x33')]['ids'];return db[_0x6561('0x53')][_0x6561('0x23')]({'where':{'id':_0x4bc1bc},'attributes':['id'],'include':[{'model':db[_0x6561('0x46')],'as':_0x6561('0x54'),'attributes':['id',_0x6561('0x1b'),_0x6561('0x55'),_0x6561('0x56'),_0x6561('0x57')],'raw':!![]}]})[_0x6561('0x17')](function(_0x4e43c6){if(_0x4e43c6){var _0x5682d6=_['flatMap'](_0x4e43c6,function(_0xcf6eee){var _0x57c4f=_0xcf6eee[_0x6561('0x19')]({'plain':!![]});return _0x57c4f[_0x6561('0x54')];});return db['ChatQueue']['find']({'where':{'id':_0x36d284['params']['id']}})[_0x6561('0x17')](function(_0x1d243d){return db[_0x6561('0x58')][_0x6561('0x59')](function(_0x414f65){return _0x1d243d['addTeams'](_0x4bc1bc,{'transaction':_0x414f65})[_0x6561('0x17')](function(){return BPromise[_0x6561('0x5a')](_0x5682d6,function(_0x33f14c){return db[_0x6561('0x3e')]['findOrCreate']({'where':{'UserId':_0x33f14c['id'],'ChatQueueId':_0x36d284[_0x6561('0x26')]['id']},'transaction':_0x414f65});});})['then'](function(){_0x5682d6['forEach'](function(_0x4c415d){socket[_0x6561('0x5b')]('userChatQueue:save',{'UserId':_0x4c415d['id'],'ChatQueueId':_0x1d243d['id']});});});});});}})['then'](respondWithStatusCode(_0x45a464,null))[_0x6561('0x24')](handleError(_0x45a464,null));};exports['removeTeams']=function(_0x5ae70e,_0x58b6b8){return db[_0x6561('0x53')][_0x6561('0x23')]({'where':{'id':_0x5ae70e['query'][_0x6561('0x5c')]},'attributes':['id'],'include':[{'model':db[_0x6561('0x46')],'as':_0x6561('0x54'),'attributes':['id'],'raw':!![]}]})[_0x6561('0x17')](handleEntityNotFound(_0x58b6b8,null))['then'](function(_0x2ce82f){var _0x408793=_[_0x6561('0x47')](_0x2ce82f,'id');var _0x2e9a6a=[];var _0x2bfa47=[];var _0x3a2463=squel[_0x6561('0x5d')]();_0x3a2463[_0x6561('0x5e')](_0x6561('0x5f'))['from']('team_has_chat_queues','tq')[_0x6561('0x60')](_0x6561('0x61'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x6561('0x62'),_0x5ae70e[_0x6561('0x26')]['id']);for(var _0x45e4b5=0x0;_0x45e4b5<_0x2ce82f[_0x6561('0x2e')];_0x45e4b5+=0x1){let _0x1d62ef=_0x2ce82f[_0x45e4b5];for(var _0x56f6fd=0x0;_0x56f6fd<_0x1d62ef[_0x6561('0x54')][_0x6561('0x2e')];_0x56f6fd+=0x1){let _0x39237f=_0x1d62ef['Agents'][_0x56f6fd];var _0xf9b63c=_0x3a2463[_0x6561('0x63')]();_0xf9b63c[_0x6561('0x21')](_0x6561('0x64'),_0x39237f['id']);_0x2bfa47[_0x6561('0x65')](db[_0x6561('0x58')][_0x6561('0x28')](_0xf9b63c[_0x6561('0x66')](),{'type':db[_0x6561('0x58')]['QueryTypes'][_0x6561('0x67')]})['then'](function(_0x596e24){if(_0x596e24[_0x6561('0x2e')]===0x1){return _0x39237f['id'];}else{var _0x2552ec=_[_0x6561('0x68')](_[_0x6561('0x47')](_0x596e24,'TeamId'),function(_0x3cd1fc){return _[_0x6561('0x69')](_0x408793,_0x3cd1fc);});if(_0x2552ec){return _0x39237f['id'];}}}));}}return BPromise[_0x6561('0x6a')](_0x2bfa47)[_0x6561('0x17')](function(_0x116023){_0x2e9a6a=_(_0x2e9a6a)[_0x6561('0x6b')](_0x116023)[_0x6561('0x6c')]()['value']();return db[_0x6561('0x1e')][_0x6561('0x31')]({'where':{'id':_0x5ae70e[_0x6561('0x26')]['id']}})[_0x6561('0x17')](function(_0x5cf3e9){return db[_0x6561('0x58')][_0x6561('0x59')](function(_0x50c92f){return _0x5cf3e9[_0x6561('0x6d')](_0x5ae70e[_0x6561('0x28')][_0x6561('0x5c')],{'transaction':_0x50c92f})[_0x6561('0x17')](function(){if(!_[_0x6561('0x6e')](_0x2e9a6a)){return _0x5cf3e9[_0x6561('0x6f')](_0x2e9a6a,{'transaction':_0x50c92f});}})['then'](function(){_0x2e9a6a[_0x6561('0x70')](function(_0x3851f2){socket['emit'](_0x6561('0x71'),{'UserId':_0x3851f2,'ChatQueueId':_0x5cf3e9['id']});});});});});});})[_0x6561('0x17')](respondWithStatusCode(_0x58b6b8,null))[_0x6561('0x24')](handleError(_0x58b6b8,null));};exports[_0x6561('0x72')]=function(_0xac2079,_0x51d904){return db[_0x6561('0x1e')][_0x6561('0x31')]({'where':{'id':_0xac2079['params']['id']}})[_0x6561('0x17')](handleEntityNotFound(_0x51d904,null))[_0x6561('0x17')](function(_0x46abd3){if(_0x46abd3){return _0x46abd3[_0x6561('0x72')](_0xac2079[_0x6561('0x33')][_0x6561('0x5c')],_[_0x6561('0x73')](_0xac2079['body'],['ids','id'])||{})[_0x6561('0x74')](function(_0x39b041){for(var _0x36826a=0x0;_0x36826a<_0xac2079['body'][_0x6561('0x5c')][_0x6561('0x2e')];_0x36826a+=0x1){socket[_0x6561('0x5b')](_0x6561('0x75'),{'UserId':Number(_0xac2079[_0x6561('0x33')]['ids'][_0x36826a]),'ChatQueueId':Number(_0xac2079[_0x6561('0x26')]['id'])});}return _0x39b041;});}})[_0x6561('0x17')](respondWithResult(_0x51d904,null))['catch'](handleError(_0x51d904,null));};exports['removeAgents']=function(_0x23ce92,_0x308513){return db['ChatQueue'][_0x6561('0x31')]({'where':{'id':_0x23ce92[_0x6561('0x26')]['id']}})[_0x6561('0x17')](handleEntityNotFound(_0x308513,null))[_0x6561('0x17')](function(_0x151a7b){if(_0x151a7b){return _0x151a7b['removeAgents'](_0x23ce92['query'][_0x6561('0x5c')])[_0x6561('0x17')](function(){if(_[_0x6561('0x76')](_0x23ce92[_0x6561('0x28')][_0x6561('0x5c')])){for(var _0x14822c=0x0;_0x14822c<_0x23ce92[_0x6561('0x28')]['ids']['length'];_0x14822c+=0x1){socket[_0x6561('0x5b')](_0x6561('0x71'),{'UserId':Number(_0x23ce92['query'][_0x6561('0x5c')][_0x14822c]),'ChatQueueId':Number(_0x23ce92['params']['id'])});}}else{socket[_0x6561('0x5b')](_0x6561('0x71'),{'UserId':Number(_0x23ce92[_0x6561('0x28')]['ids']),'ChatQueueId':Number(_0x23ce92['params']['id'])});}});}})[_0x6561('0x17')](respondWithStatusCode(_0x308513,null))['catch'](handleError(_0x308513,null));};exports[_0x6561('0x77')]=function(_0x3f58c9,_0x53b65e){var _0x1b2ef3={};var _0x5cae67={};var _0x374117;var _0x2b3216;return db[_0x6561('0x1e')][_0x6561('0x3d')]({'where':{'id':_0x3f58c9['params']['id']}})['then'](handleEntityNotFound(_0x53b65e,null))['then'](function(_0x3aee35){if(_0x3aee35){_0x374117=_0x3aee35;_0x5cae67[_0x6561('0x2b')]=_[_0x6561('0x27')](db[_0x6561('0x46')]['rawAttributes']);_0x5cae67[_0x6561('0x28')]=_[_0x6561('0x27')](_0x3f58c9[_0x6561('0x28')]);_0x5cae67[_0x6561('0x29')]=_['intersection'](_0x5cae67[_0x6561('0x2b')],_0x5cae67[_0x6561('0x28')]);_0x1b2ef3[_0x6561('0x2c')]=_[_0x6561('0x2a')](_0x5cae67[_0x6561('0x2b')],qs[_0x6561('0x2d')](_0x3f58c9[_0x6561('0x28')][_0x6561('0x2d')]));_0x1b2ef3[_0x6561('0x2c')]=_0x1b2ef3[_0x6561('0x2c')][_0x6561('0x2e')]?_0x1b2ef3['attributes']:_0x5cae67[_0x6561('0x2b')];_0x1b2ef3['order']=qs['sort'](_0x3f58c9[_0x6561('0x28')][_0x6561('0x41')]);_0x1b2ef3[_0x6561('0x21')]=qs['filters'](_['pick'](_0x3f58c9[_0x6561('0x28')],_0x5cae67[_0x6561('0x29')]));if(_0x3f58c9[_0x6561('0x28')]['filter']){_0x1b2ef3['where']=_[_0x6561('0x30')](_0x1b2ef3['where'],{'$or':_['map'](_0x1b2ef3[_0x6561('0x2c')],function(_0x84ee5a){var _0x2ce9dc={};_0x2ce9dc[_0x84ee5a]={'$like':'%'+_0x3f58c9[_0x6561('0x28')]['filter']+'%'};return _0x2ce9dc;})});}_0x1b2ef3=_[_0x6561('0x30')]({},_0x1b2ef3,_0x3f58c9['options']);return _0x374117[_0x6561('0x77')](_0x1b2ef3);}})[_0x6561('0x17')](function(_0x5dd69f){if(_0x5dd69f){_0x2b3216=_0x5dd69f['length'];if(!_0x3f58c9[_0x6561('0x28')][_0x6561('0x3f')](_0x6561('0x51'))){_0x1b2ef3[_0x6561('0x14')]=qs[_0x6561('0x14')](_0x3f58c9[_0x6561('0x28')]['limit']);_0x1b2ef3[_0x6561('0x12')]=qs[_0x6561('0x12')](_0x3f58c9[_0x6561('0x28')][_0x6561('0x12')]);}return _0x374117['getAgents'](_0x1b2ef3);}})['then'](function(_0x46f2b7){if(_0x46f2b7){return _0x46f2b7?{'count':_0x2b3216,'rows':_0x46f2b7}:null;}})[_0x6561('0x17')](respondWithResult(_0x53b65e,null))['catch'](handleError(_0x53b65e,null));}; \ No newline at end of file +var _0x1977=['Content-Range','update','then','ChatQueues','destroy','error','stack','name','send','index','ChatQueue','rawAttributes','fieldName','type','key','include','query','findAll','catch','show','model','keys','filters','intersection','attributes','fields','length','includeAll','merge','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','hasOwnProperty','nolimit','order','sort','where','pick','filter','UserChatQueue','User','UserId','chatPause','createdAt','map','rows','format','%s/%s','SIP','updatedAt','getTeams','findOne','Team','addTeams','ids','Agents','online','flatMap','sequelize','transaction','findOrCreate','forEach','userChatQueue:save','select','field','tq.TeamId','from','team_has_chat_queues','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','every','TeamId','includes','union','compact','value','isEmpty','removeAgents','emit','userChatQueue:remove','addAgents','spread','isArray','getAgents','bluebird','util','lodash','squel','ioredis','../../components/parsers/qs','defaults','redis','socket.io-emitter','./chatQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set'];(function(_0x43f917,_0x264801){var _0x15490c=function(_0x4eb1b2){while(--_0x4eb1b2){_0x43f917['push'](_0x43f917['shift']());}};_0x15490c(++_0x264801);}(_0x1977,0x14e));var _0x7197=function(_0x4eb609,_0x264f15){_0x4eb609=_0x4eb609-0x0;var _0xcf82b7=_0x1977[_0x4eb609];return _0xcf82b7;};'use strict';var BPromise=require(_0x7197('0x0'));var util=require(_0x7197('0x1'));var _=require(_0x7197('0x2'));var squel=require(_0x7197('0x3'));var Redis=require(_0x7197('0x4'));var qs=require(_0x7197('0x5'));var logger=require('../../config/logger')('api');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config['redis']=_[_0x7197('0x6')](config[_0x7197('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0x7197('0x8'))(new Redis(config[_0x7197('0x7')]));require(_0x7197('0x9'))[_0x7197('0xa')](socket);function respondWithStatusCode(_0x6f7cc5,_0x161cea){_0x161cea=_0x161cea||0xcc;return function(_0x555f2c){if(_0x555f2c){return _0x6f7cc5[_0x7197('0xb')](_0x161cea);}return _0x6f7cc5[_0x7197('0xc')](_0x161cea)[_0x7197('0xd')]();};}function respondWithResult(_0x39bdd5,_0x2e0cfe){_0x2e0cfe=_0x2e0cfe||0xc8;return function(_0x167f07){if(_0x167f07){return _0x39bdd5[_0x7197('0xc')](_0x2e0cfe)[_0x7197('0xe')](_0x167f07);}};}function respondWithFilteredResult(_0x3f790c,_0x311556){return function(_0x29a9f4){if(_0x29a9f4){var _0x1ddbb8=typeof _0x311556[_0x7197('0xf')]===_0x7197('0x10')&&typeof _0x311556[_0x7197('0x11')]===_0x7197('0x10');var _0xd3f9e=_0x29a9f4[_0x7197('0x12')];var _0x3d450a=_0x1ddbb8?0x0:_0x311556[_0x7197('0xf')];var _0x5cd9cd=_0x1ddbb8?_0x29a9f4[_0x7197('0x12')]:_0x311556[_0x7197('0xf')]+_0x311556['limit'];var _0x5a5b60;if(_0x5cd9cd>=_0xd3f9e){_0x5cd9cd=_0xd3f9e;_0x5a5b60=0xc8;}else{_0x5a5b60=0xce;}_0x3f790c[_0x7197('0xc')](_0x5a5b60);return _0x3f790c[_0x7197('0x13')](_0x7197('0x14'),_0x3d450a+'-'+_0x5cd9cd+'/'+_0xd3f9e)[_0x7197('0xe')](_0x29a9f4);}return null;};}function saveUpdates(_0x50aa87){return function(_0x38eaa5){if(_0x38eaa5){return _0x38eaa5[_0x7197('0x15')](_0x50aa87)[_0x7197('0x16')](function(_0x204797){return _0x204797;});}return null;};}function removeEntity(_0x240b33){return function(_0x181f17){if(_0x181f17){return _0x181f17['destroy']()[_0x7197('0x16')](function(){var _0xf42fda=_0x181f17['get']({'plain':!![]});var _0x59e2d2=_0x7197('0x17');return db['UserProfileResource'][_0x7197('0x18')]({'where':{'type':_0x59e2d2,'resourceId':_0xf42fda['id']}})[_0x7197('0x16')](function(){return _0x181f17;});})['then'](function(){_0x240b33[_0x7197('0xc')](0xcc)['end']();});}};}function handleEntityNotFound(_0x45a08f){return function(_0x57b26d){if(!_0x57b26d){_0x45a08f[_0x7197('0xb')](0x194);}return _0x57b26d;};}function handleError(_0x4f840e,_0x449d3b){_0x449d3b=_0x449d3b||0x1f4;return function(_0x3136c1){logger[_0x7197('0x19')](_0x3136c1[_0x7197('0x1a')]);if(_0x3136c1[_0x7197('0x1b')]){delete _0x3136c1[_0x7197('0x1b')];}_0x4f840e['status'](_0x449d3b)[_0x7197('0x1c')](_0x3136c1);};}exports[_0x7197('0x1d')]=function(_0x1c16a7,_0x2a840c){var _0x1995fc={};var _0x26e169={'count':0x0,'rows':[]};var _0x497ecd=_['map'](db[_0x7197('0x1e')][_0x7197('0x1f')],function(_0x5c8060){return{'name':_0x5c8060[_0x7197('0x20')],'type':_0x5c8060[_0x7197('0x21')][_0x7197('0x22')]};});_0x1995fc=qs['getOptions'](_0x497ecd,_0x1c16a7);var _0x15f865={'where':_0x1995fc['where']};return db[_0x7197('0x1e')][_0x7197('0x12')](_0x15f865)[_0x7197('0x16')](function(_0x7020ac){_0x26e169[_0x7197('0x12')]=_0x7020ac;_0x1995fc['include']=qs[_0x7197('0x23')](_0x1c16a7[_0x7197('0x24')]);return db['ChatQueue'][_0x7197('0x25')](_0x1995fc);})[_0x7197('0x16')](function(_0x1b05a3){_0x26e169['rows']=_0x1b05a3;return _0x26e169;})[_0x7197('0x16')](respondWithFilteredResult(_0x2a840c,_0x1995fc))[_0x7197('0x26')](handleError(_0x2a840c,null));};exports[_0x7197('0x27')]=function(_0x465f69,_0x153886){var _0x3e8cce={'raw':!![],'where':{'id':_0x465f69['params']['id']}},_0x3202b3={};_0x3202b3[_0x7197('0x28')]=_['keys'](db[_0x7197('0x1e')]['rawAttributes']);_0x3202b3[_0x7197('0x24')]=_[_0x7197('0x29')](_0x465f69['query']);_0x3202b3[_0x7197('0x2a')]=_[_0x7197('0x2b')](_0x3202b3[_0x7197('0x28')],_0x3202b3[_0x7197('0x24')]);_0x3e8cce[_0x7197('0x2c')]=_[_0x7197('0x2b')](_0x3202b3[_0x7197('0x28')],qs['fields'](_0x465f69[_0x7197('0x24')][_0x7197('0x2d')]));_0x3e8cce['attributes']=_0x3e8cce['attributes'][_0x7197('0x2e')]?_0x3e8cce[_0x7197('0x2c')]:_0x3202b3[_0x7197('0x28')];if(_0x465f69['query'][_0x7197('0x2f')]){_0x3e8cce[_0x7197('0x23')]=[{'all':!![]}];}_0x3e8cce=_[_0x7197('0x30')]({},_0x3e8cce,_0x465f69[_0x7197('0x31')]);return db[_0x7197('0x1e')][_0x7197('0x32')](_0x3e8cce)['then'](handleEntityNotFound(_0x153886,null))[_0x7197('0x16')](respondWithResult(_0x153886,null))[_0x7197('0x26')](handleError(_0x153886,null));};exports['create']=function(_0x2517c9,_0x3d51d6){return db[_0x7197('0x1e')][_0x7197('0x33')](_0x2517c9[_0x7197('0x34')],{})[_0x7197('0x16')](function(_0x557b3b){var _0x1a7c45=_0x2517c9[_0x7197('0x35')][_0x7197('0x36')]({'plain':!![]});if(!_0x1a7c45)throw new Error(_0x7197('0x37'));if(_0x1a7c45[_0x7197('0x38')]===_0x7197('0x35')){var _0x227145=_0x557b3b[_0x7197('0x36')]({'plain':!![]});var _0x107ae6=_0x7197('0x17');return db[_0x7197('0x39')][_0x7197('0x32')]({'where':{'name':_0x107ae6,'userProfileId':_0x1a7c45['userProfileId']},'raw':!![]})[_0x7197('0x16')](function(_0x185c1d){if(_0x185c1d&&_0x185c1d[_0x7197('0x3a')]===0x0){return db[_0x7197('0x3b')][_0x7197('0x33')]({'name':_0x227145[_0x7197('0x1b')],'resourceId':_0x227145['id'],'type':_0x185c1d[_0x7197('0x1b')],'sectionId':_0x185c1d['id']},{})['then'](function(){return _0x557b3b;});}else{return _0x557b3b;}})[_0x7197('0x26')](function(_0x1feda8){logger[_0x7197('0x19')](_0x7197('0x3c'),_0x1feda8);throw _0x1feda8;});}return _0x557b3b;})['then'](respondWithResult(_0x3d51d6,0xc9))[_0x7197('0x26')](handleError(_0x3d51d6,null));};exports['update']=function(_0x14c1f1,_0x350500){if(_0x14c1f1[_0x7197('0x34')]['id']){delete _0x14c1f1[_0x7197('0x34')]['id'];}return db[_0x7197('0x1e')]['find']({'where':{'id':_0x14c1f1[_0x7197('0x3d')]['id']}})[_0x7197('0x16')](handleEntityNotFound(_0x350500,null))[_0x7197('0x16')](saveUpdates(_0x14c1f1[_0x7197('0x34')],null))['then'](respondWithResult(_0x350500,null))[_0x7197('0x26')](handleError(_0x350500,null));};exports[_0x7197('0x18')]=function(_0x2a7c97,_0x52b50e){return db['ChatQueue'][_0x7197('0x32')]({'where':{'id':_0x2a7c97[_0x7197('0x3d')]['id']}})[_0x7197('0x16')](handleEntityNotFound(_0x52b50e,null))[_0x7197('0x16')](removeEntity(_0x52b50e,null))[_0x7197('0x26')](handleError(_0x52b50e,null));};exports[_0x7197('0x3e')]=function(_0x45adf9,_0x1011bd){return db['ChatQueue'][_0x7197('0x3e')]()['then'](respondWithResult(_0x1011bd,null))['catch'](handleError(_0x1011bd,null));};exports['getMembers']=function(_0x2ea464,_0x4347b7){var _0x59772a={'raw':!![],'where':{}},_0x36d9d2={},_0x5001e2;return db[_0x7197('0x1e')]['findOne']({'where':{'id':_0x2ea464[_0x7197('0x3d')]['id']}})[_0x7197('0x16')](handleEntityNotFound(_0x4347b7,null))[_0x7197('0x16')](function(_0x412e0b){if(_0x412e0b){_0x5001e2=_0x412e0b['get']({'plain':!![]});_0x36d9d2[_0x7197('0x28')]=_[_0x7197('0x29')](db['UserChatQueue'][_0x7197('0x1f')]);_0x36d9d2[_0x7197('0x24')]=_[_0x7197('0x29')](_0x2ea464[_0x7197('0x24')]);_0x36d9d2[_0x7197('0x2a')]=_[_0x7197('0x2b')](_0x36d9d2[_0x7197('0x28')],_0x36d9d2[_0x7197('0x24')]);_0x59772a[_0x7197('0x2c')]=_[_0x7197('0x2b')](_0x36d9d2[_0x7197('0x28')],qs[_0x7197('0x2d')](_0x2ea464[_0x7197('0x24')][_0x7197('0x2d')]));_0x59772a[_0x7197('0x2c')]=_0x59772a[_0x7197('0x2c')]['length']?_0x59772a[_0x7197('0x2c')]:_0x36d9d2[_0x7197('0x28')];if(!_0x2ea464[_0x7197('0x24')][_0x7197('0x3f')](_0x7197('0x40'))){_0x59772a[_0x7197('0x11')]=qs[_0x7197('0x11')](_0x2ea464[_0x7197('0x24')]['limit']);_0x59772a[_0x7197('0xf')]=qs[_0x7197('0xf')](_0x2ea464[_0x7197('0x24')][_0x7197('0xf')]);}_0x59772a[_0x7197('0x41')]=qs['sort'](_0x2ea464[_0x7197('0x24')][_0x7197('0x42')]);_0x59772a[_0x7197('0x43')]=qs[_0x7197('0x2a')](_[_0x7197('0x44')](_0x2ea464[_0x7197('0x24')],_0x36d9d2[_0x7197('0x2a')]));_0x59772a[_0x7197('0x43')]['ChatQueueId']=_0x412e0b['id'];if(_0x2ea464['query'][_0x7197('0x45')]){_0x59772a[_0x7197('0x43')]=_[_0x7197('0x30')](_0x59772a[_0x7197('0x43')],{'$or':_['map'](_0x59772a[_0x7197('0x2c')],function(_0x3e0c35){var _0x371097={};_0x371097[_0x3e0c35]={'$like':'%'+_0x2ea464[_0x7197('0x24')]['filter']+'%'};return _0x371097;})});}_0x59772a=_[_0x7197('0x30')]({},_0x59772a,_0x2ea464[_0x7197('0x31')]);return db[_0x7197('0x46')][_0x7197('0x25')](_0x59772a);}})[_0x7197('0x16')](function(_0x433bf9){if(_0x433bf9){return db[_0x7197('0x47')]['findAndCountAll']({'where':{'id':_['map'](_0x433bf9,_0x7197('0x48')),'role':'agent'},'attributes':['id',_0x7197('0x1b'),_0x7197('0x49'),'updatedAt',_0x7197('0x4a')]});}})[_0x7197('0x16')](function(_0x3e6272){if(_0x3e6272){return{'count':_0x3e6272['count'],'rows':_[_0x7197('0x4b')](_0x3e6272[_0x7197('0x4c')],function(_0x2a2b66){return{'membername':_0x2a2b66['name'],'UserId':_0x2a2b66['id'],'queue_name':_0x5001e2[_0x7197('0x1b')],'ChatQueueId':_0x5001e2['id'],'interface':util[_0x7197('0x4d')](_0x7197('0x4e'),_0x7197('0x4f'),_0x2a2b66['name']),'penalty':0x0,'paused':_0x2a2b66[_0x7197('0x49')],'createdAt':_0x2a2b66[_0x7197('0x4a')],'updatedAt':_0x2a2b66[_0x7197('0x50')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x7197('0x16')](respondWithFilteredResult(_0x4347b7,_0x59772a))[_0x7197('0x26')](handleError(_0x4347b7,null));};exports[_0x7197('0x51')]=function(_0x873f18,_0x5eca18){var _0x49fdfb={};var _0x3822ce={};var _0x572e26;var _0x27adaf;return db[_0x7197('0x1e')][_0x7197('0x52')]({'where':{'id':_0x873f18[_0x7197('0x3d')]['id']}})[_0x7197('0x16')](handleEntityNotFound(_0x5eca18,null))[_0x7197('0x16')](function(_0x20fcd6){if(_0x20fcd6){_0x572e26=_0x20fcd6;_0x3822ce[_0x7197('0x28')]=_[_0x7197('0x29')](db[_0x7197('0x53')][_0x7197('0x1f')]);_0x3822ce[_0x7197('0x24')]=_[_0x7197('0x29')](_0x873f18[_0x7197('0x24')]);_0x3822ce[_0x7197('0x2a')]=_['intersection'](_0x3822ce[_0x7197('0x28')],_0x3822ce[_0x7197('0x24')]);_0x49fdfb['attributes']=_[_0x7197('0x2b')](_0x3822ce['model'],qs[_0x7197('0x2d')](_0x873f18['query'][_0x7197('0x2d')]));_0x49fdfb['attributes']=_0x49fdfb['attributes'][_0x7197('0x2e')]?_0x49fdfb['attributes']:_0x3822ce['model'];_0x49fdfb[_0x7197('0x41')]=qs[_0x7197('0x42')](_0x873f18[_0x7197('0x24')][_0x7197('0x42')]);_0x49fdfb['where']=qs[_0x7197('0x2a')](_['pick'](_0x873f18[_0x7197('0x24')],_0x3822ce[_0x7197('0x2a')]));if(_0x873f18[_0x7197('0x24')]['filter']){_0x49fdfb[_0x7197('0x43')]=_[_0x7197('0x30')](_0x49fdfb[_0x7197('0x43')],{'$or':_[_0x7197('0x4b')](_0x49fdfb[_0x7197('0x2c')],function(_0x1c1f60){var _0x113903={};_0x113903[_0x1c1f60]={'$like':'%'+_0x873f18[_0x7197('0x24')][_0x7197('0x45')]+'%'};return _0x113903;})});}_0x49fdfb=_[_0x7197('0x30')]({},_0x49fdfb,_0x873f18['options']);return _0x572e26['getTeams'](_0x49fdfb);}})['then'](function(_0x27187d){if(_0x27187d){_0x27adaf=_0x27187d[_0x7197('0x2e')];if(!_0x873f18[_0x7197('0x24')][_0x7197('0x3f')](_0x7197('0x40'))){_0x49fdfb['limit']=qs['limit'](_0x873f18[_0x7197('0x24')][_0x7197('0x11')]);_0x49fdfb[_0x7197('0xf')]=qs[_0x7197('0xf')](_0x873f18['query'][_0x7197('0xf')]);}return _0x572e26[_0x7197('0x51')](_0x49fdfb);}})['then'](function(_0x36c1e3){if(_0x36c1e3){return _0x36c1e3?{'count':_0x27adaf,'rows':_0x36c1e3}:null;}})[_0x7197('0x16')](respondWithResult(_0x5eca18,null))[_0x7197('0x26')](handleError(_0x5eca18,null));};exports[_0x7197('0x54')]=function(_0x29f295,_0x5dd5de){var _0x269d7a=_0x29f295[_0x7197('0x34')][_0x7197('0x55')];return db[_0x7197('0x53')][_0x7197('0x25')]({'where':{'id':_0x269d7a},'attributes':['id'],'include':[{'model':db[_0x7197('0x47')],'as':_0x7197('0x56'),'attributes':['id',_0x7197('0x1b'),_0x7197('0x57'),'voicePause','interface'],'raw':!![]}]})[_0x7197('0x16')](function(_0x193e99){if(_0x193e99){var _0x3b2cf2=_[_0x7197('0x58')](_0x193e99,function(_0x5c1d80){var _0x12e773=_0x5c1d80[_0x7197('0x36')]({'plain':!![]});return _0x12e773['Agents'];});return db[_0x7197('0x1e')][_0x7197('0x32')]({'where':{'id':_0x29f295[_0x7197('0x3d')]['id']}})[_0x7197('0x16')](function(_0x180a0d){return db[_0x7197('0x59')][_0x7197('0x5a')](function(_0x58a8e1){return _0x180a0d['addTeams'](_0x269d7a,{'transaction':_0x58a8e1})['then'](function(){return BPromise['each'](_0x3b2cf2,function(_0x27d29d){return db[_0x7197('0x46')][_0x7197('0x5b')]({'where':{'UserId':_0x27d29d['id'],'ChatQueueId':_0x29f295['params']['id']},'transaction':_0x58a8e1});});})[_0x7197('0x16')](function(){_0x3b2cf2[_0x7197('0x5c')](function(_0x5c5f7f){socket['emit'](_0x7197('0x5d'),{'UserId':_0x5c5f7f['id'],'ChatQueueId':_0x180a0d['id']});});});});});}})['then'](respondWithStatusCode(_0x5dd5de,null))['catch'](handleError(_0x5dd5de,null));};exports['removeTeams']=function(_0x1b7251,_0x4217f7){return db[_0x7197('0x53')][_0x7197('0x25')]({'where':{'id':_0x1b7251[_0x7197('0x24')][_0x7197('0x55')]},'attributes':['id'],'include':[{'model':db[_0x7197('0x47')],'as':_0x7197('0x56'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x4217f7,null))['then'](function(_0xa32b9c){var _0x746f4e=_[_0x7197('0x4b')](_0xa32b9c,'id');var _0x4173a0=[];var _0x4e65e0=[];var _0x195880=squel[_0x7197('0x5e')]();_0x195880[_0x7197('0x5f')](_0x7197('0x60'))[_0x7197('0x61')](_0x7197('0x62'),'tq')['join']('user_has_teams','ut',_0x7197('0x63'))[_0x7197('0x43')]('ChatQueueId\x20=\x20?',_0x1b7251[_0x7197('0x3d')]['id']);for(var _0x560787=0x0;_0x560787<_0xa32b9c[_0x7197('0x2e')];_0x560787+=0x1){let _0x3e16b4=_0xa32b9c[_0x560787];for(var _0x6d08f2=0x0;_0x6d08f2<_0x3e16b4[_0x7197('0x56')][_0x7197('0x2e')];_0x6d08f2+=0x1){let _0x5753ba=_0x3e16b4[_0x7197('0x56')][_0x6d08f2];var _0x402558=_0x195880[_0x7197('0x64')]();_0x402558[_0x7197('0x43')](_0x7197('0x65'),_0x5753ba['id']);_0x4e65e0[_0x7197('0x66')](db[_0x7197('0x59')][_0x7197('0x24')](_0x402558[_0x7197('0x67')](),{'type':db[_0x7197('0x59')]['QueryTypes']['SELECT']})[_0x7197('0x16')](function(_0x3b847c){if(_0x3b847c[_0x7197('0x2e')]===0x1){return _0x5753ba['id'];}else{var _0x6cb37=_[_0x7197('0x68')](_[_0x7197('0x4b')](_0x3b847c,_0x7197('0x69')),function(_0x28943a){return _[_0x7197('0x6a')](_0x746f4e,_0x28943a);});if(_0x6cb37){return _0x5753ba['id'];}}}));}}return BPromise['all'](_0x4e65e0)[_0x7197('0x16')](function(_0x18d374){_0x4173a0=_(_0x4173a0)[_0x7197('0x6b')](_0x18d374)[_0x7197('0x6c')]()[_0x7197('0x6d')]();return db[_0x7197('0x1e')][_0x7197('0x32')]({'where':{'id':_0x1b7251[_0x7197('0x3d')]['id']}})[_0x7197('0x16')](function(_0xfefd01){return db['sequelize'][_0x7197('0x5a')](function(_0xf3eb1b){return _0xfefd01['removeTeams'](_0x1b7251[_0x7197('0x24')][_0x7197('0x55')],{'transaction':_0xf3eb1b})[_0x7197('0x16')](function(){if(!_[_0x7197('0x6e')](_0x4173a0)){return _0xfefd01[_0x7197('0x6f')](_0x4173a0,{'transaction':_0xf3eb1b});}})[_0x7197('0x16')](function(){_0x4173a0[_0x7197('0x5c')](function(_0x4772c4){socket[_0x7197('0x70')](_0x7197('0x71'),{'UserId':_0x4772c4,'ChatQueueId':_0xfefd01['id']});});});});});});})[_0x7197('0x16')](respondWithStatusCode(_0x4217f7,null))['catch'](handleError(_0x4217f7,null));};exports[_0x7197('0x72')]=function(_0x20cf44,_0xaa5e28){return db[_0x7197('0x1e')]['find']({'where':{'id':_0x20cf44[_0x7197('0x3d')]['id']}})[_0x7197('0x16')](handleEntityNotFound(_0xaa5e28,null))[_0x7197('0x16')](function(_0x108455){if(_0x108455){return _0x108455[_0x7197('0x72')](_0x20cf44[_0x7197('0x34')][_0x7197('0x55')],_['omit'](_0x20cf44['body'],[_0x7197('0x55'),'id'])||{})[_0x7197('0x73')](function(_0xb62662){for(var _0x1f9b5c=0x0;_0x1f9b5c<_0x20cf44[_0x7197('0x34')][_0x7197('0x55')][_0x7197('0x2e')];_0x1f9b5c+=0x1){socket[_0x7197('0x70')](_0x7197('0x5d'),{'UserId':Number(_0x20cf44[_0x7197('0x34')]['ids'][_0x1f9b5c]),'ChatQueueId':Number(_0x20cf44[_0x7197('0x3d')]['id'])});}return _0xb62662;});}})[_0x7197('0x16')](respondWithResult(_0xaa5e28,null))[_0x7197('0x26')](handleError(_0xaa5e28,null));};exports[_0x7197('0x6f')]=function(_0x1c6b55,_0x4e6c47){return db[_0x7197('0x1e')]['find']({'where':{'id':_0x1c6b55[_0x7197('0x3d')]['id']}})[_0x7197('0x16')](handleEntityNotFound(_0x4e6c47,null))[_0x7197('0x16')](function(_0x46049e){if(_0x46049e){return _0x46049e[_0x7197('0x6f')](_0x1c6b55[_0x7197('0x24')][_0x7197('0x55')])[_0x7197('0x16')](function(){if(_[_0x7197('0x74')](_0x1c6b55['query'][_0x7197('0x55')])){for(var _0x5961be=0x0;_0x5961be<_0x1c6b55[_0x7197('0x24')]['ids'][_0x7197('0x2e')];_0x5961be+=0x1){socket['emit'](_0x7197('0x71'),{'UserId':Number(_0x1c6b55[_0x7197('0x24')][_0x7197('0x55')][_0x5961be]),'ChatQueueId':Number(_0x1c6b55[_0x7197('0x3d')]['id'])});}}else{socket[_0x7197('0x70')](_0x7197('0x71'),{'UserId':Number(_0x1c6b55[_0x7197('0x24')][_0x7197('0x55')]),'ChatQueueId':Number(_0x1c6b55[_0x7197('0x3d')]['id'])});}});}})[_0x7197('0x16')](respondWithStatusCode(_0x4e6c47,null))[_0x7197('0x26')](handleError(_0x4e6c47,null));};exports[_0x7197('0x75')]=function(_0x273105,_0x3f302a){var _0x599b70={};var _0x21b19b={};var _0x308b1a;var _0x5d64b2;return db[_0x7197('0x1e')][_0x7197('0x52')]({'where':{'id':_0x273105[_0x7197('0x3d')]['id']}})[_0x7197('0x16')](handleEntityNotFound(_0x3f302a,null))[_0x7197('0x16')](function(_0x18e9f7){if(_0x18e9f7){_0x308b1a=_0x18e9f7;_0x21b19b[_0x7197('0x28')]=_['keys'](db[_0x7197('0x47')][_0x7197('0x1f')]);_0x21b19b[_0x7197('0x24')]=_[_0x7197('0x29')](_0x273105[_0x7197('0x24')]);_0x21b19b[_0x7197('0x2a')]=_[_0x7197('0x2b')](_0x21b19b[_0x7197('0x28')],_0x21b19b[_0x7197('0x24')]);_0x599b70[_0x7197('0x2c')]=_[_0x7197('0x2b')](_0x21b19b[_0x7197('0x28')],qs[_0x7197('0x2d')](_0x273105[_0x7197('0x24')]['fields']));_0x599b70[_0x7197('0x2c')]=_0x599b70[_0x7197('0x2c')][_0x7197('0x2e')]?_0x599b70[_0x7197('0x2c')]:_0x21b19b[_0x7197('0x28')];_0x599b70['order']=qs[_0x7197('0x42')](_0x273105[_0x7197('0x24')][_0x7197('0x42')]);_0x599b70[_0x7197('0x43')]=qs[_0x7197('0x2a')](_[_0x7197('0x44')](_0x273105['query'],_0x21b19b[_0x7197('0x2a')]));if(_0x273105['query'][_0x7197('0x45')]){_0x599b70['where']=_[_0x7197('0x30')](_0x599b70[_0x7197('0x43')],{'$or':_[_0x7197('0x4b')](_0x599b70[_0x7197('0x2c')],function(_0x4fdf54){var _0x19b4e5={};_0x19b4e5[_0x4fdf54]={'$like':'%'+_0x273105[_0x7197('0x24')]['filter']+'%'};return _0x19b4e5;})});}_0x599b70=_['merge']({},_0x599b70,_0x273105[_0x7197('0x31')]);return _0x308b1a[_0x7197('0x75')](_0x599b70);}})[_0x7197('0x16')](function(_0x9797f1){if(_0x9797f1){_0x5d64b2=_0x9797f1[_0x7197('0x2e')];if(!_0x273105['query'][_0x7197('0x3f')](_0x7197('0x40'))){_0x599b70[_0x7197('0x11')]=qs[_0x7197('0x11')](_0x273105[_0x7197('0x24')][_0x7197('0x11')]);_0x599b70[_0x7197('0xf')]=qs[_0x7197('0xf')](_0x273105[_0x7197('0x24')][_0x7197('0xf')]);}return _0x308b1a[_0x7197('0x75')](_0x599b70);}})['then'](function(_0x2d2a49){if(_0x2d2a49){return _0x2d2a49?{'count':_0x5d64b2,'rows':_0x2d2a49}:null;}})[_0x7197('0x16')](respondWithResult(_0x3f302a,null))[_0x7197('0x26')](handleError(_0x3f302a,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 8725a20..75df772 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 _0xff44=['hook','exports','events','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0xfc9374,_0x594a14){var _0x49e215=function(_0x3c7c61){while(--_0x3c7c61){_0xfc9374['push'](_0xfc9374['shift']());}};_0x49e215(++_0x594a14);}(_0xff44,0xe3));var _0x4ff4=function(_0x4782eb,_0x1dafc9){_0x4782eb=_0x4782eb-0x0;var _0x9f1353=_0xff44[_0x4782eb];return _0x9f1353;};'use strict';var EventEmitter=require(_0x4ff4('0x0'));var ChatQueue=require('../../mysqldb')['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x4ff4('0x1')](0x0);var events={'afterCreate':_0x4ff4('0x2'),'afterUpdate':_0x4ff4('0x3'),'afterDestroy':_0x4ff4('0x4')};function emitEvent(_0x213927){return function(_0x3e4357,_0x574714,_0x3d9a38){ChatQueueEvents['emit'](_0x213927+':'+_0x3e4357['id'],_0x3e4357);ChatQueueEvents[_0x4ff4('0x5')](_0x213927,_0x3e4357);_0x3d9a38(null);};}for(var e in events){if(events[_0x4ff4('0x6')](e)){var event=events[e];ChatQueue[_0x4ff4('0x7')](e,emitEvent(event));}}module[_0x4ff4('0x8')]=ChatQueueEvents; \ No newline at end of file +var _0x3087=['ChatQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x55c71b,_0x399f51){var _0x14910c=function(_0x51479b){while(--_0x51479b){_0x55c71b['push'](_0x55c71b['shift']());}};_0x14910c(++_0x399f51);}(_0x3087,0xe5));var _0x7308=function(_0x3d2365,_0x2e0be9){_0x3d2365=_0x3d2365-0x0;var _0x17bef5=_0x3087[_0x3d2365];return _0x17bef5;};'use strict';var EventEmitter=require(_0x7308('0x0'));var ChatQueue=require(_0x7308('0x1'))['db'][_0x7308('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x7308('0x3')](0x0);var events={'afterCreate':_0x7308('0x4'),'afterUpdate':_0x7308('0x5'),'afterDestroy':_0x7308('0x6')};function emitEvent(_0x42aaf5){return function(_0x167877,_0xf53f5d,_0x45e8d0){ChatQueueEvents[_0x7308('0x7')](_0x42aaf5+':'+_0x167877['id'],_0x167877);ChatQueueEvents[_0x7308('0x7')](_0x42aaf5,_0x167877);_0x45e8d0(null);};}for(var e in events){if(events[_0x7308('0x8')](e)){var event=events[e];ChatQueue[_0x7308('0x9')](e,emitEvent(event));}}module[_0x7308('0xa')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index cc57b73..cb78a15 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 _0x9749=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','lodash'];(function(_0xfa634c,_0x414e0e){var _0x73e478=function(_0xac2a51){while(--_0xac2a51){_0xfa634c['push'](_0xfa634c['shift']());}};_0x73e478(++_0x414e0e);}(_0x9749,0x187));var _0x9974=function(_0xd343a4,_0x347ab0){_0xd343a4=_0xd343a4-0x0;var _0xbf9e98=_0x9749[_0xd343a4];return _0xbf9e98;};'use strict';var _=require(_0x9974('0x0'));var util=require(_0x9974('0x1'));var logger=require('../../config/logger')(_0x9974('0x2'));var moment=require(_0x9974('0x3'));var BPromise=require(_0x9974('0x4'));var rp=require(_0x9974('0x5'));var fs=require('fs');var path=require(_0x9974('0x6'));var rimraf=require(_0x9974('0x7'));var config=require(_0x9974('0x8'));var attributes=require(_0x9974('0x9'));module[_0x9974('0xa')]=function(_0x28c4f3,_0x5cad19){return _0x28c4f3[_0x9974('0xb')](_0x9974('0xc'),attributes,{'tableName':_0x9974('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfb03=['ChatQueue','chat_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path','./chatQueue.attributes','exports','define'];(function(_0x3635ce,_0x33a6f9){var _0x97ecd0=function(_0x123d98){while(--_0x123d98){_0x3635ce['push'](_0x3635ce['shift']());}};_0x97ecd0(++_0x33a6f9);}(_0xfb03,0x86));var _0x3fb0=function(_0x18208b,_0x980624){_0x18208b=_0x18208b-0x0;var _0x55fc18=_0xfb03[_0x18208b];return _0x55fc18;};'use strict';var _=require(_0x3fb0('0x0'));var util=require(_0x3fb0('0x1'));var logger=require(_0x3fb0('0x2'))(_0x3fb0('0x3'));var moment=require('moment');var BPromise=require(_0x3fb0('0x4'));var rp=require(_0x3fb0('0x5'));var fs=require('fs');var path=require(_0x3fb0('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3fb0('0x7'));module[_0x3fb0('0x8')]=function(_0xdc4775,_0x51f972){return _0xdc4775[_0x3fb0('0x9')](_0x3fb0('0xa'),attributes,{'tableName':_0x3fb0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js index 8b27e87..9d92e35 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 _0xb36b=['options','where','attributes','limit','include','map','model','then','catch','find','raw','ShowChatQueue','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./chatQueue.socket','request','info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetChatQueue','ChatQueue'];(function(_0x4f431d,_0xd51a3b){var _0x4f31e1=function(_0x1c688d){while(--_0x1c688d){_0x4f431d['push'](_0x4f431d['shift']());}};_0x4f31e1(++_0xd51a3b);}(_0xb36b,0xac));var _0xbb36=function(_0x15ad5b,_0x598112){_0x15ad5b=_0x15ad5b-0x0;var _0x57dbdf=_0xb36b[_0x15ad5b];return _0x57dbdf;};'use strict';var _=require(_0xbb36('0x0'));var util=require('util');var moment=require(_0xbb36('0x1'));var BPromise=require(_0xbb36('0x2'));var rs=require(_0xbb36('0x3'));var fs=require('fs');var Redis=require(_0xbb36('0x4'));var db=require(_0xbb36('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xbb36('0x6'))(_0xbb36('0x7'));var config=require(_0xbb36('0x8'));var jayson=require(_0xbb36('0x9'));var client=jayson[_0xbb36('0xa')][_0xbb36('0xb')]({'port':0x232a});config[_0xbb36('0xc')]=_[_0xbb36('0xd')](config[_0xbb36('0xc')],{'host':_0xbb36('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xbb36('0xf'))['register'](socket);function respondWithRpcPromise(_0x4c898e,_0x1018eb,_0xb631ee){return new BPromise(function(_0x3ca4b2,_0x3e28d1){return client[_0xbb36('0x10')](_0x4c898e,_0xb631ee)['then'](function(_0x210f11){logger[_0xbb36('0x11')](_0xbb36('0x12'),_0x1018eb,_0xbb36('0x13'));logger['debug'](_0xbb36('0x14'),_0x1018eb,_0xbb36('0x13'),JSON[_0xbb36('0x15')](_0x210f11));if(_0x210f11[_0xbb36('0x16')]){if(_0x210f11[_0xbb36('0x16')][_0xbb36('0x17')]===0x1f4){logger[_0xbb36('0x16')](_0xbb36('0x12'),_0x1018eb,_0x210f11[_0xbb36('0x16')][_0xbb36('0x18')]);return _0x3e28d1(_0x210f11[_0xbb36('0x16')]['message']);}logger[_0xbb36('0x16')](_0xbb36('0x12'),_0x1018eb,_0x210f11[_0xbb36('0x16')][_0xbb36('0x18')]);return _0x3ca4b2(_0x210f11[_0xbb36('0x16')][_0xbb36('0x18')]);}else{logger[_0xbb36('0x11')](_0xbb36('0x12'),_0x1018eb,_0xbb36('0x13'));_0x3ca4b2(_0x210f11[_0xbb36('0x19')]['message']);}})['catch'](function(_0x416b26){logger[_0xbb36('0x16')](_0xbb36('0x12'),_0x1018eb,_0x416b26);_0x3e28d1(_0x416b26);});});}exports[_0xbb36('0x1a')]=function(_0x3bc201){var _0x17a97b=this;return new Promise(function(_0x217b4d,_0x22d35e){return db[_0xbb36('0x1b')]['findAll']({'raw':_0x3bc201[_0xbb36('0x1c')]?_0x3bc201[_0xbb36('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x3bc201[_0xbb36('0x1c')]?_0x3bc201[_0xbb36('0x1c')][_0xbb36('0x1d')]||null:null,'attributes':_0x3bc201[_0xbb36('0x1c')]?_0x3bc201[_0xbb36('0x1c')][_0xbb36('0x1e')]||null:null,'limit':_0x3bc201['options']?_0x3bc201['options'][_0xbb36('0x1f')]||null:null,'include':_0x3bc201['options']?_0x3bc201[_0xbb36('0x1c')][_0xbb36('0x20')]?_[_0xbb36('0x21')](_0x3bc201[_0xbb36('0x1c')][_0xbb36('0x20')],function(_0x537b24){return{'model':db[_0x537b24[_0xbb36('0x22')]],'as':_0x537b24['as'],'attributes':_0x537b24[_0xbb36('0x1e')],'include':_0x537b24['include']?_[_0xbb36('0x21')](_0x537b24['include'],function(_0x3c9ade){return{'model':db[_0x3c9ade[_0xbb36('0x22')]],'as':_0x3c9ade['as'],'attributes':_0x3c9ade['attributes'],'include':_0x3c9ade[_0xbb36('0x20')]?_['map'](_0x3c9ade[_0xbb36('0x20')],function(_0x7c9948){return{'model':db[_0x7c9948['model']],'as':_0x7c9948['as'],'attributes':_0x7c9948['attributes']};}):[]};}):[]};}):[]:[]})[_0xbb36('0x23')](function(_0x4e417a){logger[_0xbb36('0x11')]('GetChatQueue',_0x3bc201);logger['debug'](_0xbb36('0x1a'),_0x3bc201,JSON[_0xbb36('0x15')](_0x4e417a));_0x217b4d(_0x4e417a);})[_0xbb36('0x24')](function(_0x282f1c){logger[_0xbb36('0x16')]('GetChatQueue',_0x282f1c[_0xbb36('0x18')],_0x3bc201);_0x22d35e(_0x17a97b['error'](0x1f4,_0x282f1c[_0xbb36('0x18')]));});});};exports['ShowChatQueue']=function(_0x1c3ba2){var _0x47d0cd=this;return new Promise(function(_0x2dda9d,_0x117f89){return db[_0xbb36('0x1b')][_0xbb36('0x25')]({'raw':_0x1c3ba2[_0xbb36('0x1c')]?_0x1c3ba2[_0xbb36('0x1c')][_0xbb36('0x26')]===undefined?!![]:![]:!![],'where':_0x1c3ba2['options']?_0x1c3ba2[_0xbb36('0x1c')]['where']||null:null,'attributes':_0x1c3ba2[_0xbb36('0x1c')]?_0x1c3ba2[_0xbb36('0x1c')]['attributes']||null:null,'include':_0x1c3ba2['options']?_0x1c3ba2[_0xbb36('0x1c')][_0xbb36('0x20')]?_[_0xbb36('0x21')](_0x1c3ba2[_0xbb36('0x1c')][_0xbb36('0x20')],function(_0x596f42){return{'model':db[_0x596f42[_0xbb36('0x22')]],'as':_0x596f42['as'],'attributes':_0x596f42[_0xbb36('0x1e')],'include':_0x596f42[_0xbb36('0x20')]?_[_0xbb36('0x21')](_0x596f42['include'],function(_0x3c6808){return{'model':db[_0x3c6808[_0xbb36('0x22')]],'as':_0x3c6808['as'],'attributes':_0x3c6808[_0xbb36('0x1e')],'include':_0x3c6808['include']?_[_0xbb36('0x21')](_0x3c6808[_0xbb36('0x20')],function(_0x53ca18){return{'model':db[_0x53ca18['model']],'as':_0x53ca18['as'],'attributes':_0x53ca18[_0xbb36('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xbb36('0x23')](function(_0x4a5ff8){logger['info']('ShowChatQueue',_0x1c3ba2);logger['debug'](_0xbb36('0x27'),_0x1c3ba2,JSON[_0xbb36('0x15')](_0x4a5ff8));_0x2dda9d(_0x4a5ff8);})['catch'](function(_0x585e28){logger[_0xbb36('0x16')]('ShowChatQueue',_0x585e28[_0xbb36('0x18')],_0x1c3ba2);_0x117f89(_0x47d0cd['error'](0x1f4,_0x585e28[_0xbb36('0x18')]));});});}; \ No newline at end of file +var _0x3495=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','defaults','localhost','redis','./chatQueue.socket','register','request','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetChatQueue','options','raw','where','attributes','limit','map','include','model','then','catch','ShowChatQueue','find','lodash','util'];(function(_0x5b2fcd,_0x39d8dc){var _0x2253bb=function(_0x4cf822){while(--_0x4cf822){_0x5b2fcd['push'](_0x5b2fcd['shift']());}};_0x2253bb(++_0x39d8dc);}(_0x3495,0x1de));var _0x5349=function(_0x42e6de,_0x3fb746){_0x42e6de=_0x42e6de-0x0;var _0x3e9354=_0x3495[_0x42e6de];return _0x3e9354;};'use strict';var _=require(_0x5349('0x0'));var util=require(_0x5349('0x1'));var moment=require(_0x5349('0x2'));var BPromise=require(_0x5349('0x3'));var rs=require(_0x5349('0x4'));var fs=require('fs');var Redis=require(_0x5349('0x5'));var db=require(_0x5349('0x6'))['db'];var utils=require(_0x5349('0x7'));var logger=require(_0x5349('0x8'))('rpc');var config=require(_0x5349('0x9'));var jayson=require(_0x5349('0xa'));var client=jayson['client'][_0x5349('0xb')]({'port':0x232a});config['redis']=_[_0x5349('0xc')](config['redis'],{'host':_0x5349('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5349('0xe')]));require(_0x5349('0xf'))[_0x5349('0x10')](socket);function respondWithRpcPromise(_0x23a1c7,_0x21bf91,_0x3a416e){return new BPromise(function(_0x35d425,_0x4bf160){return client[_0x5349('0x11')](_0x23a1c7,_0x3a416e)['then'](function(_0x2cbd83){logger[_0x5349('0x12')](_0x5349('0x13'),_0x21bf91,_0x5349('0x14'));logger[_0x5349('0x15')](_0x5349('0x16'),_0x21bf91,_0x5349('0x14'),JSON[_0x5349('0x17')](_0x2cbd83));if(_0x2cbd83[_0x5349('0x18')]){if(_0x2cbd83[_0x5349('0x18')]['code']===0x1f4){logger[_0x5349('0x18')](_0x5349('0x13'),_0x21bf91,_0x2cbd83['error'][_0x5349('0x19')]);return _0x4bf160(_0x2cbd83[_0x5349('0x18')][_0x5349('0x19')]);}logger['error']('ChatQueue,\x20%s,\x20%s',_0x21bf91,_0x2cbd83['error'][_0x5349('0x19')]);return _0x35d425(_0x2cbd83['error'][_0x5349('0x19')]);}else{logger['info'](_0x5349('0x13'),_0x21bf91,_0x5349('0x14'));_0x35d425(_0x2cbd83[_0x5349('0x1a')][_0x5349('0x19')]);}})['catch'](function(_0x22d1ca){logger[_0x5349('0x18')](_0x5349('0x13'),_0x21bf91,_0x22d1ca);_0x4bf160(_0x22d1ca);});});}exports[_0x5349('0x1b')]=function(_0x4be827){var _0xeaab5a=this;return new Promise(function(_0x3594a4,_0x4f2cb6){return db['ChatQueue']['findAll']({'raw':_0x4be827[_0x5349('0x1c')]?_0x4be827['options'][_0x5349('0x1d')]===undefined?!![]:![]:!![],'where':_0x4be827[_0x5349('0x1c')]?_0x4be827[_0x5349('0x1c')][_0x5349('0x1e')]||null:null,'attributes':_0x4be827[_0x5349('0x1c')]?_0x4be827[_0x5349('0x1c')][_0x5349('0x1f')]||null:null,'limit':_0x4be827[_0x5349('0x1c')]?_0x4be827[_0x5349('0x1c')][_0x5349('0x20')]||null:null,'include':_0x4be827[_0x5349('0x1c')]?_0x4be827[_0x5349('0x1c')]['include']?_[_0x5349('0x21')](_0x4be827[_0x5349('0x1c')][_0x5349('0x22')],function(_0x49435a){return{'model':db[_0x49435a[_0x5349('0x23')]],'as':_0x49435a['as'],'attributes':_0x49435a['attributes'],'include':_0x49435a[_0x5349('0x22')]?_[_0x5349('0x21')](_0x49435a[_0x5349('0x22')],function(_0x49153e){return{'model':db[_0x49153e[_0x5349('0x23')]],'as':_0x49153e['as'],'attributes':_0x49153e[_0x5349('0x1f')],'include':_0x49153e[_0x5349('0x22')]?_[_0x5349('0x21')](_0x49153e[_0x5349('0x22')],function(_0x16edcb){return{'model':db[_0x16edcb[_0x5349('0x23')]],'as':_0x16edcb['as'],'attributes':_0x16edcb[_0x5349('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x5349('0x24')](function(_0x5b5d6c){logger[_0x5349('0x12')](_0x5349('0x1b'),_0x4be827);logger['debug'](_0x5349('0x1b'),_0x4be827,JSON['stringify'](_0x5b5d6c));_0x3594a4(_0x5b5d6c);})[_0x5349('0x25')](function(_0x262f62){logger[_0x5349('0x18')](_0x5349('0x1b'),_0x262f62[_0x5349('0x19')],_0x4be827);_0x4f2cb6(_0xeaab5a[_0x5349('0x18')](0x1f4,_0x262f62['message']));});});};exports[_0x5349('0x26')]=function(_0x3162c8){var _0xb0bc68=this;return new Promise(function(_0x2c24f4,_0x538814){return db['ChatQueue'][_0x5349('0x27')]({'raw':_0x3162c8[_0x5349('0x1c')]?_0x3162c8[_0x5349('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x3162c8[_0x5349('0x1c')]?_0x3162c8['options'][_0x5349('0x1e')]||null:null,'attributes':_0x3162c8[_0x5349('0x1c')]?_0x3162c8[_0x5349('0x1c')][_0x5349('0x1f')]||null:null,'include':_0x3162c8[_0x5349('0x1c')]?_0x3162c8[_0x5349('0x1c')]['include']?_['map'](_0x3162c8[_0x5349('0x1c')][_0x5349('0x22')],function(_0x1be201){return{'model':db[_0x1be201[_0x5349('0x23')]],'as':_0x1be201['as'],'attributes':_0x1be201[_0x5349('0x1f')],'include':_0x1be201[_0x5349('0x22')]?_[_0x5349('0x21')](_0x1be201['include'],function(_0x544557){return{'model':db[_0x544557[_0x5349('0x23')]],'as':_0x544557['as'],'attributes':_0x544557['attributes'],'include':_0x544557['include']?_[_0x5349('0x21')](_0x544557['include'],function(_0x18f881){return{'model':db[_0x18f881[_0x5349('0x23')]],'as':_0x18f881['as'],'attributes':_0x18f881[_0x5349('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xd2376d){logger['info'](_0x5349('0x26'),_0x3162c8);logger[_0x5349('0x15')](_0x5349('0x26'),_0x3162c8,JSON['stringify'](_0xd2376d));_0x2c24f4(_0xd2376d);})['catch'](function(_0x5e5799){logger[_0x5349('0x18')](_0x5349('0x26'),_0x5e5799[_0x5349('0x19')],_0x3162c8);_0x538814(_0xb0bc68[_0x5349('0x18')](0x1f4,_0x5e5799[_0x5349('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 7dc930b..d508bc5 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 _0x668b=['./chatQueue.events','save','update','removeListener','length'];(function(_0x5c36a2,_0x1f8d49){var _0x1236a1=function(_0x6269d9){while(--_0x6269d9){_0x5c36a2['push'](_0x5c36a2['shift']());}};_0x1236a1(++_0x1f8d49);}(_0x668b,0x140));var _0xb668=function(_0x23ec06,_0x561142){_0x23ec06=_0x23ec06-0x0;var _0x2831d4=_0x668b[_0x23ec06];return _0x2831d4;};'use strict';var ChatQueueEvents=require(_0xb668('0x0'));var events=[_0xb668('0x1'),'remove',_0xb668('0x2')];function createListener(_0x2c30c1,_0x49a53b){return function(_0x336ba4){_0x49a53b['emit'](_0x2c30c1,_0x336ba4);};}function removeListener(_0x2fab11,_0x4092a6){return function(){ChatQueueEvents[_0xb668('0x3')](_0x2fab11,_0x4092a6);};}exports['register']=function(_0x9b99a8){for(var _0x296fa9=0x0,_0x3be92e=events[_0xb668('0x4')];_0x296fa9<_0x3be92e;_0x296fa9++){var _0x20b749=events[_0x296fa9];var _0x3f01bc=createListener('chatQueue:'+_0x20b749,_0x9b99a8);ChatQueueEvents['on'](_0x20b749,_0x3f01bc);}}; \ No newline at end of file +var _0xc3b5=['length','remove','update','emit','register'];(function(_0x2d80fc,_0x3c47fa){var _0x264bd6=function(_0x54b0f1){while(--_0x54b0f1){_0x2d80fc['push'](_0x2d80fc['shift']());}};_0x264bd6(++_0x3c47fa);}(_0xc3b5,0x6f));var _0x5c3b=function(_0x4b75a0,_0x374f34){_0x4b75a0=_0x4b75a0-0x0;var _0x1adc32=_0xc3b5[_0x4b75a0];return _0x1adc32;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=['save',_0x5c3b('0x0'),_0x5c3b('0x1')];function createListener(_0xbe95d4,_0x3acf12){return function(_0x2f9a72){_0x3acf12[_0x5c3b('0x2')](_0xbe95d4,_0x2f9a72);};}function removeListener(_0x237a61,_0x48f8a1){return function(){ChatQueueEvents['removeListener'](_0x237a61,_0x48f8a1);};}exports[_0x5c3b('0x3')]=function(_0x6b8a1e){for(var _0x56345e=0x0,_0x568a28=events[_0x5c3b('0x4')];_0x56345e<_0x568a28;_0x56345e++){var _0x420839=events[_0x56345e];var _0x3892ad=createListener('chatQueue:'+_0x420839,_0x6b8a1e);ChatQueueEvents['on'](_0x420839,_0x3892ad);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index 8c4363a..b504ba5 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 _0xe14b=['/describe','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','removeAgents','exports','multer','util','express','Router','../../components/auth/service','./chatQueue.controller','get','isAuthenticated','index'];(function(_0x39336c,_0x5ef836){var _0x36aba1=function(_0x5a0209){while(--_0x5a0209){_0x39336c['push'](_0x39336c['shift']());}};_0x36aba1(++_0x5ef836);}(_0xe14b,0x93));var _0xbe14=function(_0x36cf89,_0x28233d){_0x36cf89=_0x36cf89-0x0;var _0x195a3b=_0xe14b[_0x36cf89];return _0x195a3b;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['describe']);router['get']('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0x6')](_0xbe14('0xb'),auth['isAuthenticated'](),controller['getMembers']);router[_0xbe14('0x6')](_0xbe14('0xc'),auth['isAuthenticated'](),controller[_0xbe14('0xd')]);router[_0xbe14('0x6')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xf')]);router[_0xbe14('0x10')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x11')]);router[_0xbe14('0x10')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x12')]);router[_0xbe14('0x10')]('/:id/users',auth['isAuthenticated'](),controller[_0xbe14('0x13')]);router[_0xbe14('0x14')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller['update']);router[_0xbe14('0x16')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x17')]);router[_0xbe14('0x16')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller['removeTeams']);router[_0xbe14('0x16')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x18')]);module[_0xbe14('0x19')]=router; \ No newline at end of file +var _0xe14b=['/describe','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','removeAgents','exports','multer','util','express','Router','../../components/auth/service','./chatQueue.controller','get','isAuthenticated','index'];(function(_0x17dd0e,_0x20ebb1){var _0x38c0cf=function(_0x4178ee){while(--_0x4178ee){_0x17dd0e['push'](_0x17dd0e['shift']());}};_0x38c0cf(++_0x20ebb1);}(_0xe14b,0x93));var _0xbe14=function(_0x45ce4e,_0x3a367c){_0x45ce4e=_0x45ce4e-0x0;var _0x4a105a=_0xe14b[_0x45ce4e];return _0x4a105a;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['describe']);router['get']('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0x6')](_0xbe14('0xb'),auth['isAuthenticated'](),controller['getMembers']);router[_0xbe14('0x6')](_0xbe14('0xc'),auth['isAuthenticated'](),controller[_0xbe14('0xd')]);router[_0xbe14('0x6')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xf')]);router[_0xbe14('0x10')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x11')]);router[_0xbe14('0x10')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x12')]);router[_0xbe14('0x10')]('/:id/users',auth['isAuthenticated'](),controller[_0xbe14('0x13')]);router[_0xbe14('0x14')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller['update']);router[_0xbe14('0x16')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x17')]);router[_0xbe14('0x16')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller['removeTeams']);router[_0xbe14('0x16')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x18')]);module[_0xbe14('0x19')]=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index eae8268..0199c73 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 _0x9f5d=['moment','sequelize','exports','STRING','DATE'];(function(_0x169534,_0x175692){var _0x12ac08=function(_0x57aa62){while(--_0x57aa62){_0x169534['push'](_0x169534['shift']());}};_0x12ac08(++_0x175692);}(_0x9f5d,0x1ef));var _0xd9f5=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x9f5d[_0x311c35];return _0x5cc50c;};'use strict';var moment=require(_0xd9f5('0x0'));var Sequelize=require(_0xd9f5('0x1'));module[_0xd9f5('0x2')]={'uniqueid':{'type':Sequelize[_0xd9f5('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xd9f5('0x3')]},'joinAt':{'type':Sequelize[_0xd9f5('0x4')]},'leaveAt':{'type':Sequelize[_0xd9f5('0x4')]},'acceptAt':{'type':Sequelize[_0xd9f5('0x4')]},'exitAt':{'type':Sequelize[_0xd9f5('0x4')]},'reason':{'type':Sequelize[_0xd9f5('0x3')]}}; \ No newline at end of file +var _0xa6db=['moment','sequelize','exports','STRING','DATE'];(function(_0x4704ac,_0x21aaf8){var _0x2d4361=function(_0x1933f4){while(--_0x1933f4){_0x4704ac['push'](_0x4704ac['shift']());}};_0x2d4361(++_0x21aaf8);}(_0xa6db,0x104));var _0xba6d=function(_0x1cc4e1,_0x1629d4){_0x1cc4e1=_0x1cc4e1-0x0;var _0x192d47=_0xa6db[_0x1cc4e1];return _0x192d47;};'use strict';var moment=require(_0xba6d('0x0'));var Sequelize=require(_0xba6d('0x1'));module[_0xba6d('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xba6d('0x3')]},'joinAt':{'type':Sequelize[_0xba6d('0x4')]},'leaveAt':{'type':Sequelize[_0xba6d('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xba6d('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index e003a58..5bbc19f 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 _0x55c1=['limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','index','map','rawAttributes','fieldName','keys','query','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','options','ChatQueueReport','include','findAll','rows','catch','show','params','length','includeAll','create','body','find','describe','eml-format','rimraf','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset'];(function(_0x2d70ba,_0xc5bf90){var _0x1439db=function(_0x221c50){while(--_0x221c50){_0x2d70ba['push'](_0x2d70ba['shift']());}};_0x1439db(++_0xc5bf90);}(_0x55c1,0x1e5));var _0x155c=function(_0x3ba566,_0x5e009d){_0x3ba566=_0x3ba566-0x0;var _0x480317=_0x55c1[_0x3ba566];return _0x480317;};'use strict';var emlformat=require(_0x155c('0x0'));var rimraf=require(_0x155c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x155c('0x2'));var BPromise=require(_0x155c('0x3'));var Mustache=require(_0x155c('0x4'));var util=require(_0x155c('0x5'));var path=require(_0x155c('0x6'));var sox=require('sox');var csv=require(_0x155c('0x7'));var ejs=require(_0x155c('0x8'));var fs=require('fs');var fs_extra=require(_0x155c('0x9'));var _=require('lodash');var squel=require(_0x155c('0xa'));var crypto=require(_0x155c('0xb'));var jsforce=require(_0x155c('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x155c('0xd'));var Redis=require(_0x155c('0xe'));var authService=require(_0x155c('0xf'));var qs=require(_0x155c('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x155c('0x11'));var logger=require(_0x155c('0x12'))('api');var utils=require(_0x155c('0x13'));var config=require(_0x155c('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x155c('0x15'))['db'];function respondWithStatusCode(_0x278370,_0x5b6173){_0x5b6173=_0x5b6173||0xcc;return function(_0x1f1866){if(_0x1f1866){return _0x278370[_0x155c('0x16')](_0x5b6173);}return _0x278370[_0x155c('0x17')](_0x5b6173)['end']();};}function respondWithResult(_0x372ec3,_0x37903b){_0x37903b=_0x37903b||0xc8;return function(_0xfe906a){if(_0xfe906a){return _0x372ec3[_0x155c('0x17')](_0x37903b)[_0x155c('0x18')](_0xfe906a);}};}function respondWithFilteredResult(_0x4899a3,_0x2997af){return function(_0x49f59f){if(_0x49f59f){var _0x48fe51=typeof _0x2997af[_0x155c('0x19')]==='undefined'&&typeof _0x2997af[_0x155c('0x1a')]===_0x155c('0x1b');var _0x9e024e=_0x49f59f['count'];var _0xe800de=_0x48fe51?0x0:_0x2997af[_0x155c('0x19')];var _0x224a3d=_0x48fe51?_0x49f59f[_0x155c('0x1c')]:_0x2997af[_0x155c('0x19')]+_0x2997af[_0x155c('0x1a')];var _0xa4c0c;if(_0x224a3d>=_0x9e024e){_0x224a3d=_0x9e024e;_0xa4c0c=0xc8;}else{_0xa4c0c=0xce;}_0x4899a3[_0x155c('0x17')](_0xa4c0c);return _0x4899a3[_0x155c('0x1d')](_0x155c('0x1e'),_0xe800de+'-'+_0x224a3d+'/'+_0x9e024e)[_0x155c('0x18')](_0x49f59f);}return null;};}function patchUpdates(_0xe422f6){return function(_0x250399){try{jsonpatch[_0x155c('0x1f')](_0x250399,_0xe422f6,!![]);}catch(_0x43b032){return BPromise[_0x155c('0x20')](_0x43b032);}return _0x250399[_0x155c('0x21')]();};}function saveUpdates(_0x5935af,_0x1564bf){return function(_0x3cc458){if(_0x3cc458){return _0x3cc458[_0x155c('0x22')](_0x5935af)[_0x155c('0x23')](function(_0x1006b8){return _0x1006b8;});}return null;};}function removeEntity(_0x254557,_0x4b6d0d){return function(_0x4f242c){if(_0x4f242c){return _0x4f242c[_0x155c('0x24')]()[_0x155c('0x23')](function(){_0x254557[_0x155c('0x17')](0xcc)[_0x155c('0x25')]();});}};}function handleEntityNotFound(_0x41e24d,_0x930c00){return function(_0x452175){if(!_0x452175){_0x41e24d[_0x155c('0x16')](0x194);}return _0x452175;};}function handleError(_0x241b38,_0x155028){_0x155028=_0x155028||0x1f4;return function(_0x36be3d){logger[_0x155c('0x26')](_0x36be3d[_0x155c('0x27')]);if(_0x36be3d[_0x155c('0x28')]){delete _0x36be3d[_0x155c('0x28')];}_0x241b38[_0x155c('0x17')](_0x155028)['send'](_0x36be3d);};}exports[_0x155c('0x29')]=function(_0x5a2004,_0x4d9a38){var _0x5bb056={},_0x47c89d={},_0x43608a={'count':0x0,'rows':[]};var _0x3593a0=_[_0x155c('0x2a')](db['ChatQueueReport'][_0x155c('0x2b')],function(_0x18dd71){return{'name':_0x18dd71[_0x155c('0x2c')],'type':_0x18dd71['type']['key']};});_0x47c89d['model']=_[_0x155c('0x2a')](_0x3593a0,_0x155c('0x28'));_0x47c89d['query']=_[_0x155c('0x2d')](_0x5a2004[_0x155c('0x2e')]);_0x47c89d[_0x155c('0x2f')]=_['intersection'](_0x47c89d[_0x155c('0x30')],_0x47c89d['query']);_0x5bb056[_0x155c('0x31')]=_[_0x155c('0x32')](_0x47c89d['model'],qs[_0x155c('0x33')](_0x5a2004[_0x155c('0x2e')]['fields']));_0x5bb056[_0x155c('0x31')]=_0x5bb056[_0x155c('0x31')]['length']?_0x5bb056[_0x155c('0x31')]:_0x47c89d[_0x155c('0x30')];if(!_0x5a2004[_0x155c('0x2e')][_0x155c('0x34')](_0x155c('0x35'))){_0x5bb056[_0x155c('0x1a')]=qs[_0x155c('0x1a')](_0x5a2004[_0x155c('0x2e')][_0x155c('0x1a')]);_0x5bb056[_0x155c('0x19')]=qs[_0x155c('0x19')](_0x5a2004['query'][_0x155c('0x19')]);}_0x5bb056[_0x155c('0x36')]=qs[_0x155c('0x37')](_0x5a2004['query'][_0x155c('0x37')]);_0x5bb056[_0x155c('0x38')]=qs['filters'](_['pick'](_0x5a2004[_0x155c('0x2e')],_0x47c89d[_0x155c('0x2f')]),_0x3593a0);if(_0x5a2004[_0x155c('0x2e')]['filter']){_0x5bb056[_0x155c('0x38')]=_[_0x155c('0x39')](_0x5bb056[_0x155c('0x38')],{'$or':_['map'](_0x3593a0,function(_0x394973){if(_0x394973['type']!==_0x155c('0x3a')){var _0x45457f={};_0x45457f[_0x394973[_0x155c('0x28')]]={'$like':'%'+_0x5a2004['query']['filter']+'%'};return _0x45457f;}})});}_0x5bb056=_[_0x155c('0x39')]({},_0x5bb056,_0x5a2004[_0x155c('0x3b')]);var _0x22fe10={'where':_0x5bb056['where']};return db[_0x155c('0x3c')][_0x155c('0x1c')](_0x22fe10)[_0x155c('0x23')](function(_0x40ade9){_0x43608a[_0x155c('0x1c')]=_0x40ade9;if(_0x5a2004['query']['includeAll']){_0x5bb056[_0x155c('0x3d')]=[{'all':!![]}];}return db['ChatQueueReport'][_0x155c('0x3e')](_0x5bb056);})['then'](function(_0x59af92){_0x43608a[_0x155c('0x3f')]=_0x59af92;return _0x43608a;})[_0x155c('0x23')](respondWithFilteredResult(_0x4d9a38,_0x5bb056))[_0x155c('0x40')](handleError(_0x4d9a38,null));};exports[_0x155c('0x41')]=function(_0x12337d,_0x5418de){var _0x350147={'raw':!![],'where':{'id':_0x12337d[_0x155c('0x42')]['id']}},_0x34b588={};_0x34b588[_0x155c('0x30')]=_[_0x155c('0x2d')](db[_0x155c('0x3c')][_0x155c('0x2b')]);_0x34b588[_0x155c('0x2e')]=_[_0x155c('0x2d')](_0x12337d[_0x155c('0x2e')]);_0x34b588[_0x155c('0x2f')]=_['intersection'](_0x34b588[_0x155c('0x30')],_0x34b588[_0x155c('0x2e')]);_0x350147['attributes']=_[_0x155c('0x32')](_0x34b588[_0x155c('0x30')],qs[_0x155c('0x33')](_0x12337d[_0x155c('0x2e')][_0x155c('0x33')]));_0x350147[_0x155c('0x31')]=_0x350147[_0x155c('0x31')][_0x155c('0x43')]?_0x350147[_0x155c('0x31')]:_0x34b588[_0x155c('0x30')];if(_0x12337d[_0x155c('0x2e')][_0x155c('0x44')]){_0x350147[_0x155c('0x3d')]=[{'all':!![]}];}_0x350147=_[_0x155c('0x39')]({},_0x350147,_0x12337d['options']);return db['ChatQueueReport']['find'](_0x350147)['then'](handleEntityNotFound(_0x5418de,null))['then'](respondWithResult(_0x5418de,null))[_0x155c('0x40')](handleError(_0x5418de,null));};exports[_0x155c('0x45')]=function(_0x9e5f88,_0x49656e){return db['ChatQueueReport'][_0x155c('0x45')](_0x9e5f88[_0x155c('0x46')],{})['then'](respondWithResult(_0x49656e,0xc9))['catch'](handleError(_0x49656e,null));};exports[_0x155c('0x22')]=function(_0x5a93ec,_0x14e43a){if(_0x5a93ec['body']['id']){delete _0x5a93ec[_0x155c('0x46')]['id'];}return db['ChatQueueReport']['find']({'where':{'id':_0x5a93ec[_0x155c('0x42')]['id']}})[_0x155c('0x23')](handleEntityNotFound(_0x14e43a,null))[_0x155c('0x23')](saveUpdates(_0x5a93ec['body'],null))[_0x155c('0x23')](respondWithResult(_0x14e43a,null))[_0x155c('0x40')](handleError(_0x14e43a,null));};exports[_0x155c('0x24')]=function(_0x3022f7,_0x3dfba3){return db[_0x155c('0x3c')][_0x155c('0x47')]({'where':{'id':_0x3022f7[_0x155c('0x42')]['id']}})[_0x155c('0x23')](handleEntityNotFound(_0x3dfba3,null))['then'](removeEntity(_0x3dfba3,null))[_0x155c('0x40')](handleError(_0x3dfba3,null));};exports[_0x155c('0x48')]=function(_0x263a1a,_0xf8d24e){return db[_0x155c('0x3c')]['describe']()[_0x155c('0x23')](respondWithResult(_0xf8d24e,null))[_0x155c('0x40')](handleError(_0xf8d24e,null));}; \ No newline at end of file +var _0x014c=['order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','describe','rimraf','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','destroy','then','sendStatus','error','name','send','map','ChatQueueReport','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit'];(function(_0x1917d2,_0x46da33){var _0x298dfe=function(_0xfa5127){while(--_0xfa5127){_0x1917d2['push'](_0x1917d2['shift']());}};_0x298dfe(++_0x46da33);}(_0x014c,0x17b));var _0xc014=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0x014c[_0x1cfa0d];return _0xe33279;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc014('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc014('0x1'));var rp=require(_0xc014('0x2'));var moment=require(_0xc014('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc014('0x4'));var path=require(_0xc014('0x5'));var sox=require(_0xc014('0x6'));var csv=require(_0xc014('0x7'));var ejs=require(_0xc014('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc014('0x9'));var squel=require(_0xc014('0xa'));var crypto=require('crypto');var jsforce=require(_0xc014('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xc014('0x7'));var querystring=require(_0xc014('0xc'));var Papa=require(_0xc014('0xd'));var Redis=require('ioredis');var authService=require(_0xc014('0xe'));var qs=require(_0xc014('0xf'));var as=require(_0xc014('0x10'));var hardwareService=require(_0xc014('0x11'));var logger=require('../../config/logger')(_0xc014('0x12'));var utils=require('../../config/utils');var config=require(_0xc014('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xc014('0x14'))['db'];function respondWithStatusCode(_0xcde2d3,_0x2f8ac9){_0x2f8ac9=_0x2f8ac9||0xcc;return function(_0x1686f1){if(_0x1686f1){return _0xcde2d3['sendStatus'](_0x2f8ac9);}return _0xcde2d3[_0xc014('0x15')](_0x2f8ac9)[_0xc014('0x16')]();};}function respondWithResult(_0xe86dd,_0x5ced7d){_0x5ced7d=_0x5ced7d||0xc8;return function(_0x36b26e){if(_0x36b26e){return _0xe86dd['status'](_0x5ced7d)[_0xc014('0x17')](_0x36b26e);}};}function respondWithFilteredResult(_0x1c4d3b,_0x25fdf6){return function(_0x26f264){if(_0x26f264){var _0x9f6a26=typeof _0x25fdf6[_0xc014('0x18')]==='undefined'&&typeof _0x25fdf6[_0xc014('0x19')]===_0xc014('0x1a');var _0x263ad0=_0x26f264[_0xc014('0x1b')];var _0x5a2be0=_0x9f6a26?0x0:_0x25fdf6['offset'];var _0x42f93d=_0x9f6a26?_0x26f264['count']:_0x25fdf6['offset']+_0x25fdf6[_0xc014('0x19')];var _0x4287fe;if(_0x42f93d>=_0x263ad0){_0x42f93d=_0x263ad0;_0x4287fe=0xc8;}else{_0x4287fe=0xce;}_0x1c4d3b['status'](_0x4287fe);return _0x1c4d3b[_0xc014('0x1c')](_0xc014('0x1d'),_0x5a2be0+'-'+_0x42f93d+'/'+_0x263ad0)[_0xc014('0x17')](_0x26f264);}return null;};}function patchUpdates(_0x2dac66){return function(_0x1078c4){try{jsonpatch['apply'](_0x1078c4,_0x2dac66,!![]);}catch(_0xc8b0fb){return BPromise[_0xc014('0x1e')](_0xc8b0fb);}return _0x1078c4[_0xc014('0x1f')]();};}function saveUpdates(_0x3c58cc,_0x450b22){return function(_0x3f28b6){if(_0x3f28b6){return _0x3f28b6[_0xc014('0x20')](_0x3c58cc)['then'](function(_0x1089c6){return _0x1089c6;});}return null;};}function removeEntity(_0x1b905d,_0x16d8f9){return function(_0x174b46){if(_0x174b46){return _0x174b46[_0xc014('0x21')]()[_0xc014('0x22')](function(){_0x1b905d[_0xc014('0x15')](0xcc)[_0xc014('0x16')]();});}};}function handleEntityNotFound(_0xe4c68,_0x2e5c30){return function(_0x4850bb){if(!_0x4850bb){_0xe4c68[_0xc014('0x23')](0x194);}return _0x4850bb;};}function handleError(_0x17b6b4,_0x36b663){_0x36b663=_0x36b663||0x1f4;return function(_0x7f47ef){logger[_0xc014('0x24')](_0x7f47ef['stack']);if(_0x7f47ef[_0xc014('0x25')]){delete _0x7f47ef[_0xc014('0x25')];}_0x17b6b4[_0xc014('0x15')](_0x36b663)[_0xc014('0x26')](_0x7f47ef);};}exports['index']=function(_0x43af57,_0x40cf7c){var _0x151705={},_0x30e97a={},_0x21cd81={'count':0x0,'rows':[]};var _0x289f92=_[_0xc014('0x27')](db[_0xc014('0x28')][_0xc014('0x29')],function(_0x330869){return{'name':_0x330869[_0xc014('0x2a')],'type':_0x330869['type'][_0xc014('0x2b')]};});_0x30e97a['model']=_['map'](_0x289f92,'name');_0x30e97a[_0xc014('0x2c')]=_[_0xc014('0x2d')](_0x43af57['query']);_0x30e97a[_0xc014('0x2e')]=_[_0xc014('0x2f')](_0x30e97a[_0xc014('0x30')],_0x30e97a[_0xc014('0x2c')]);_0x151705[_0xc014('0x31')]=_[_0xc014('0x2f')](_0x30e97a[_0xc014('0x30')],qs[_0xc014('0x32')](_0x43af57[_0xc014('0x2c')][_0xc014('0x32')]));_0x151705[_0xc014('0x31')]=_0x151705[_0xc014('0x31')]['length']?_0x151705[_0xc014('0x31')]:_0x30e97a['model'];if(!_0x43af57[_0xc014('0x2c')][_0xc014('0x33')](_0xc014('0x34'))){_0x151705[_0xc014('0x19')]=qs[_0xc014('0x19')](_0x43af57[_0xc014('0x2c')][_0xc014('0x19')]);_0x151705['offset']=qs[_0xc014('0x18')](_0x43af57['query'][_0xc014('0x18')]);}_0x151705[_0xc014('0x35')]=qs[_0xc014('0x36')](_0x43af57[_0xc014('0x2c')][_0xc014('0x36')]);_0x151705[_0xc014('0x37')]=qs[_0xc014('0x2e')](_['pick'](_0x43af57[_0xc014('0x2c')],_0x30e97a[_0xc014('0x2e')]),_0x289f92);if(_0x43af57[_0xc014('0x2c')]['filter']){_0x151705[_0xc014('0x37')]=_[_0xc014('0x38')](_0x151705[_0xc014('0x37')],{'$or':_['map'](_0x289f92,function(_0x473754){if(_0x473754['type']!==_0xc014('0x39')){var _0x19d374={};_0x19d374[_0x473754[_0xc014('0x25')]]={'$like':'%'+_0x43af57[_0xc014('0x2c')][_0xc014('0x3a')]+'%'};return _0x19d374;}})});}_0x151705=_[_0xc014('0x38')]({},_0x151705,_0x43af57[_0xc014('0x3b')]);var _0xb0149e={'where':_0x151705[_0xc014('0x37')]};return db[_0xc014('0x28')][_0xc014('0x1b')](_0xb0149e)[_0xc014('0x22')](function(_0x565433){_0x21cd81[_0xc014('0x1b')]=_0x565433;if(_0x43af57[_0xc014('0x2c')][_0xc014('0x3c')]){_0x151705[_0xc014('0x3d')]=[{'all':!![]}];}return db['ChatQueueReport'][_0xc014('0x3e')](_0x151705);})['then'](function(_0x3a7f90){_0x21cd81[_0xc014('0x3f')]=_0x3a7f90;return _0x21cd81;})[_0xc014('0x22')](respondWithFilteredResult(_0x40cf7c,_0x151705))[_0xc014('0x40')](handleError(_0x40cf7c,null));};exports[_0xc014('0x41')]=function(_0x46ea1c,_0x1f7dfb){var _0x2a0265={'raw':!![],'where':{'id':_0x46ea1c[_0xc014('0x42')]['id']}},_0x84720d={};_0x84720d[_0xc014('0x30')]=_['keys'](db[_0xc014('0x28')]['rawAttributes']);_0x84720d['query']=_[_0xc014('0x2d')](_0x46ea1c[_0xc014('0x2c')]);_0x84720d[_0xc014('0x2e')]=_[_0xc014('0x2f')](_0x84720d[_0xc014('0x30')],_0x84720d['query']);_0x2a0265[_0xc014('0x31')]=_[_0xc014('0x2f')](_0x84720d['model'],qs[_0xc014('0x32')](_0x46ea1c[_0xc014('0x2c')][_0xc014('0x32')]));_0x2a0265[_0xc014('0x31')]=_0x2a0265[_0xc014('0x31')][_0xc014('0x43')]?_0x2a0265[_0xc014('0x31')]:_0x84720d[_0xc014('0x30')];if(_0x46ea1c[_0xc014('0x2c')]['includeAll']){_0x2a0265[_0xc014('0x3d')]=[{'all':!![]}];}_0x2a0265=_[_0xc014('0x38')]({},_0x2a0265,_0x46ea1c[_0xc014('0x3b')]);return db[_0xc014('0x28')][_0xc014('0x44')](_0x2a0265)[_0xc014('0x22')](handleEntityNotFound(_0x1f7dfb,null))[_0xc014('0x22')](respondWithResult(_0x1f7dfb,null))[_0xc014('0x40')](handleError(_0x1f7dfb,null));};exports[_0xc014('0x45')]=function(_0x541ad6,_0x2ce299){return db['ChatQueueReport']['create'](_0x541ad6[_0xc014('0x46')],{})['then'](respondWithResult(_0x2ce299,0xc9))[_0xc014('0x40')](handleError(_0x2ce299,null));};exports[_0xc014('0x20')]=function(_0x56595e,_0x359c24){if(_0x56595e[_0xc014('0x46')]['id']){delete _0x56595e[_0xc014('0x46')]['id'];}return db[_0xc014('0x28')][_0xc014('0x44')]({'where':{'id':_0x56595e[_0xc014('0x42')]['id']}})['then'](handleEntityNotFound(_0x359c24,null))[_0xc014('0x22')](saveUpdates(_0x56595e[_0xc014('0x46')],null))[_0xc014('0x22')](respondWithResult(_0x359c24,null))[_0xc014('0x40')](handleError(_0x359c24,null));};exports[_0xc014('0x21')]=function(_0x464d3e,_0x255a3b){return db[_0xc014('0x28')][_0xc014('0x44')]({'where':{'id':_0x464d3e[_0xc014('0x42')]['id']}})['then'](handleEntityNotFound(_0x255a3b,null))[_0xc014('0x22')](removeEntity(_0x255a3b,null))[_0xc014('0x40')](handleError(_0x255a3b,null));};exports[_0xc014('0x47')]=function(_0x1d37be,_0x53676a){return db[_0xc014('0x28')][_0xc014('0x47')]()[_0xc014('0x22')](respondWithResult(_0x53676a,null))[_0xc014('0x40')](handleError(_0x53676a,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 0b8e17e..159f3d0 100644 --- a/server/api/chatQueueReport/chatQueueReport.model.js +++ b/server/api/chatQueueReport/chatQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid'];(function(_0x50a004,_0x193d84){var _0x5e9992=function(_0x3c8c37){while(--_0x3c8c37){_0x50a004['push'](_0x50a004['shift']());}};_0x5e9992(++_0x193d84);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[{'name':_0x3071('0xc'),'fields':[_0x3071('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd8b0=['define','report_chat_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x5cd13a,_0x3bec2e){var _0x369346=function(_0x28ff74){while(--_0x28ff74){_0x5cd13a['push'](_0x5cd13a['shift']());}};_0x369346(++_0x3bec2e);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./chatQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('ChatQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index 060388e..5f9a18c 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 _0x7837=['catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','update','attributes','limit','UpdateChatQueueReport','lodash','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','client','then','info','request\x20sent','debug','stringify','error','code','ChatQueueReport,\x20%s,\x20%s','message'];(function(_0x275b7e,_0x2b9d42){var _0xae97c2=function(_0xfb66c7){while(--_0xfb66c7){_0x275b7e['push'](_0x275b7e['shift']());}};_0xae97c2(++_0x2b9d42);}(_0x7837,0x13f));var _0x7783=function(_0x4bb99f,_0x16fb2a){_0x4bb99f=_0x4bb99f-0x0;var _0x1f23ad=_0x7837[_0x4bb99f];return _0x1f23ad;};'use strict';var _=require(_0x7783('0x0'));var util=require('util');var moment=require(_0x7783('0x1'));var BPromise=require(_0x7783('0x2'));var rs=require(_0x7783('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7783('0x4'));var logger=require('../../config/logger')(_0x7783('0x5'));var config=require(_0x7783('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x7783('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x824458,_0x573fd6,_0x39c237){return new BPromise(function(_0x4fda3a,_0x31d37d){return client['request'](_0x824458,_0x39c237)[_0x7783('0x8')](function(_0x47bc68){logger[_0x7783('0x9')]('ChatQueueReport,\x20%s,\x20%s',_0x573fd6,_0x7783('0xa'));logger[_0x7783('0xb')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x573fd6,_0x7783('0xa'),JSON[_0x7783('0xc')](_0x47bc68));if(_0x47bc68['error']){if(_0x47bc68[_0x7783('0xd')][_0x7783('0xe')]===0x1f4){logger['error'](_0x7783('0xf'),_0x573fd6,_0x47bc68[_0x7783('0xd')]['message']);return _0x31d37d(_0x47bc68[_0x7783('0xd')]['message']);}logger[_0x7783('0xd')](_0x7783('0xf'),_0x573fd6,_0x47bc68[_0x7783('0xd')][_0x7783('0x10')]);return _0x4fda3a(_0x47bc68[_0x7783('0xd')][_0x7783('0x10')]);}else{logger[_0x7783('0x9')](_0x7783('0xf'),_0x573fd6,_0x7783('0xa'));_0x4fda3a(_0x47bc68['result'][_0x7783('0x10')]);}})[_0x7783('0x11')](function(_0x142abf){logger[_0x7783('0xd')]('ChatQueueReport,\x20%s,\x20%s',_0x573fd6,_0x142abf);_0x31d37d(_0x142abf);});});}exports[_0x7783('0x12')]=function(_0xffa328){var _0x3b4eb4=this;return new Promise(function(_0x1802fa,_0x585b28){return db[_0x7783('0x13')][_0x7783('0x14')](_0xffa328[_0x7783('0x15')],{'raw':_0xffa328[_0x7783('0x16')]?_0xffa328[_0x7783('0x16')][_0x7783('0x17')]===undefined?!![]:![]:!![]})[_0x7783('0x8')](function(_0x469fa6){logger[_0x7783('0x9')](_0x7783('0x12'),_0xffa328);logger[_0x7783('0xb')](_0x7783('0x12'),_0xffa328,JSON[_0x7783('0xc')](_0x469fa6));_0x1802fa(_0x469fa6);})[_0x7783('0x11')](function(_0x22e8d9){logger[_0x7783('0xd')](_0x7783('0x12'),_0x22e8d9[_0x7783('0x10')],_0xffa328);_0x585b28(_0x3b4eb4['error'](0x1f4,_0x22e8d9[_0x7783('0x10')]));});});};exports['UpdateChatQueueReport']=function(_0x43f429){var _0x38f408=this;return new Promise(function(_0x4e37a5,_0x25049c){return db[_0x7783('0x13')][_0x7783('0x18')](_0x43f429[_0x7783('0x15')],{'raw':_0x43f429['options']?_0x43f429[_0x7783('0x16')][_0x7783('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x43f429[_0x7783('0x16')]?_0x43f429['options']['where']||null:null,'attributes':_0x43f429['options']?_0x43f429['options'][_0x7783('0x19')]||null:null,'limit':_0x43f429['options']?_0x43f429[_0x7783('0x16')][_0x7783('0x1a')]||null:null})['then'](function(_0x2b09d9){logger['info'](_0x7783('0x1b'),_0x43f429);logger['debug'](_0x7783('0x1b'),_0x43f429,JSON[_0x7783('0xc')](_0x2b09d9));_0x4e37a5(_0x2b09d9);})[_0x7783('0x11')](function(_0x3ccb98){logger[_0x7783('0xd')]('UpdateChatQueueReport',_0x3ccb98[_0x7783('0x10')],_0x43f429);_0x25049c(_0x38f408[_0x7783('0xd')](0x1f4,_0x3ccb98[_0x7783('0x10')]));});});}; \ No newline at end of file +var _0x6625=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','info','ChatQueueReport,\x20%s,\x20%s','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','UpdateChatQueueReport','update','raw','where','limit','lodash','util','moment','randomstring','ioredis'];(function(_0x19a7cb,_0x1384f7){var _0x455ed2=function(_0x4b6306){while(--_0x4b6306){_0x19a7cb['push'](_0x19a7cb['shift']());}};_0x455ed2(++_0x1384f7);}(_0x6625,0x11b));var _0x5662=function(_0x1f048d,_0x446939){_0x1f048d=_0x1f048d-0x0;var _0x98fcaf=_0x6625[_0x1f048d];return _0x98fcaf;};'use strict';var _=require(_0x5662('0x0'));var util=require(_0x5662('0x1'));var moment=require(_0x5662('0x2'));var BPromise=require('bluebird');var rs=require(_0x5662('0x3'));var fs=require('fs');var Redis=require(_0x5662('0x4'));var db=require(_0x5662('0x5'))['db'];var utils=require(_0x5662('0x6'));var logger=require(_0x5662('0x7'))(_0x5662('0x8'));var config=require(_0x5662('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x5662('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4f72a6,_0x1e517e,_0x5f2de2){return new BPromise(function(_0x1272bc,_0x576290){return client['request'](_0x4f72a6,_0x5f2de2)[_0x5662('0xb')](function(_0x4a3ece){logger[_0x5662('0xc')](_0x5662('0xd'),_0x1e517e,'request\x20sent');logger[_0x5662('0xe')](_0x5662('0xf'),_0x1e517e,_0x5662('0x10'),JSON[_0x5662('0x11')](_0x4a3ece));if(_0x4a3ece[_0x5662('0x12')]){if(_0x4a3ece[_0x5662('0x12')]['code']===0x1f4){logger[_0x5662('0x12')](_0x5662('0xd'),_0x1e517e,_0x4a3ece[_0x5662('0x12')][_0x5662('0x13')]);return _0x576290(_0x4a3ece[_0x5662('0x12')][_0x5662('0x13')]);}logger['error'](_0x5662('0xd'),_0x1e517e,_0x4a3ece[_0x5662('0x12')][_0x5662('0x13')]);return _0x1272bc(_0x4a3ece[_0x5662('0x12')][_0x5662('0x13')]);}else{logger[_0x5662('0xc')](_0x5662('0xd'),_0x1e517e,_0x5662('0x10'));_0x1272bc(_0x4a3ece[_0x5662('0x14')][_0x5662('0x13')]);}})[_0x5662('0x15')](function(_0x4a6ee8){logger['error'](_0x5662('0xd'),_0x1e517e,_0x4a6ee8);_0x576290(_0x4a6ee8);});});}exports[_0x5662('0x16')]=function(_0x47f3cd){var _0x12c746=this;return new Promise(function(_0x22ec14,_0x16a64f){return db[_0x5662('0x17')][_0x5662('0x18')](_0x47f3cd[_0x5662('0x19')],{'raw':_0x47f3cd[_0x5662('0x1a')]?_0x47f3cd[_0x5662('0x1a')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x1e56ee){logger[_0x5662('0xc')](_0x5662('0x16'),_0x47f3cd);logger[_0x5662('0xe')](_0x5662('0x16'),_0x47f3cd,JSON[_0x5662('0x11')](_0x1e56ee));_0x22ec14(_0x1e56ee);})['catch'](function(_0x5c5c6c){logger[_0x5662('0x12')](_0x5662('0x16'),_0x5c5c6c[_0x5662('0x13')],_0x47f3cd);_0x16a64f(_0x12c746[_0x5662('0x12')](0x1f4,_0x5c5c6c[_0x5662('0x13')]));});});};exports[_0x5662('0x1b')]=function(_0x37192b){var _0x13f4fc=this;return new Promise(function(_0x2ecb36,_0x400ff8){return db[_0x5662('0x17')][_0x5662('0x1c')](_0x37192b['body'],{'raw':_0x37192b[_0x5662('0x1a')]?_0x37192b[_0x5662('0x1a')][_0x5662('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x37192b[_0x5662('0x1a')]?_0x37192b[_0x5662('0x1a')][_0x5662('0x1e')]||null:null,'attributes':_0x37192b[_0x5662('0x1a')]?_0x37192b[_0x5662('0x1a')]['attributes']||null:null,'limit':_0x37192b[_0x5662('0x1a')]?_0x37192b[_0x5662('0x1a')][_0x5662('0x1f')]||null:null})[_0x5662('0xb')](function(_0x4d8d84){logger[_0x5662('0xc')](_0x5662('0x1b'),_0x37192b);logger['debug']('UpdateChatQueueReport',_0x37192b,JSON[_0x5662('0x11')](_0x4d8d84));_0x2ecb36(_0x4d8d84);})[_0x5662('0x15')](function(_0x4f3cfd){logger[_0x5662('0x12')](_0x5662('0x1b'),_0x4f3cfd[_0x5662('0x13')],_0x37192b);_0x400ff8(_0x13f4fc[_0x5662('0x12')](0x1f4,_0x4f3cfd[_0x5662('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 5b8fce9..523f662 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 _0xb594=['Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/:id','post','create','put','delete','exports','multer','util','connect-timeout','express'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb594,0x19a));var _0x4b59=function(_0x595080,_0x4ba3ce){_0x595080=_0x595080-0x0;var _0x5dae24=_0xb594[_0x595080];return _0x5dae24;};'use strict';var multer=require(_0x4b59('0x0'));var util=require(_0x4b59('0x1'));var path=require('path');var timeout=require(_0x4b59('0x2'));var express=require(_0x4b59('0x3'));var router=express[_0x4b59('0x4')]();var fs_extra=require(_0x4b59('0x5'));var auth=require(_0x4b59('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4b59('0x7'));var controller=require(_0x4b59('0x8'));router[_0x4b59('0x9')]('/',auth[_0x4b59('0xa')](),controller[_0x4b59('0xb')]);router[_0x4b59('0x9')]('/describe',auth[_0x4b59('0xa')](),controller['describe']);router[_0x4b59('0x9')](_0x4b59('0xc'),auth[_0x4b59('0xa')](),controller['show']);router[_0x4b59('0xd')]('/',auth[_0x4b59('0xa')](),controller[_0x4b59('0xe')]);router[_0x4b59('0xf')](_0x4b59('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x4b59('0x10')]('/:id',auth[_0x4b59('0xa')](),controller['destroy']);module[_0x4b59('0x11')]=router; \ No newline at end of file +var _0x330c=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','update','delete','destroy','util','path','connect-timeout','express','Router'];(function(_0x1d0057,_0x46e513){var _0x149fca=function(_0x4188e2){while(--_0x4188e2){_0x1d0057['push'](_0x1d0057['shift']());}};_0x149fca(++_0x46e513);}(_0x330c,0x1df));var _0xc330=function(_0x3b4ab7,_0x1571e9){_0x3b4ab7=_0x3b4ab7-0x0;var _0x38f87c=_0x330c[_0x3b4ab7];return _0x38f87c;};'use strict';var multer=require('multer');var util=require(_0xc330('0x0'));var path=require(_0xc330('0x1'));var timeout=require(_0xc330('0x2'));var express=require(_0xc330('0x3'));var router=express[_0xc330('0x4')]();var fs_extra=require(_0xc330('0x5'));var auth=require(_0xc330('0x6'));var interaction=require(_0xc330('0x7'));var config=require(_0xc330('0x8'));var controller=require(_0xc330('0x9'));router[_0xc330('0xa')]('/',auth[_0xc330('0xb')](),controller[_0xc330('0xc')]);router[_0xc330('0xa')](_0xc330('0xd'),auth[_0xc330('0xb')](),controller[_0xc330('0xe')]);router[_0xc330('0xa')](_0xc330('0xf'),auth[_0xc330('0xb')](),controller[_0xc330('0x10')]);router['post']('/',auth[_0xc330('0xb')](),controller[_0xc330('0x11')]);router[_0xc330('0x12')](_0xc330('0xf'),auth['isAuthenticated'](),controller[_0xc330('0x13')]);router[_0xc330('0x14')](_0xc330('0xf'),auth[_0xc330('0xb')](),controller[_0xc330('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index 0f9a229..02a0bf4 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 _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x5160bf,_0x511947){var _0x1d33a9=function(_0x3b630c){while(--_0x3b630c){_0x5160bf['push'](_0x5160bf['shift']());}};_0x1d33a9(++_0x511947);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0xa9e0[_0x34bf97];return _0x292719;};'use strict';var moment=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'agent',_0x0a9e('0x4')),'allowNull':![],'defaultValue':_0x0a9e('0x4')},'transferredAt':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x0a9e('0x6')]}}; \ No newline at end of file +var _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x47ad6a,_0x243e39){var _0x3ec19c=function(_0x1562c3){while(--_0x1562c3){_0x47ad6a['push'](_0x47ad6a['shift']());}};_0x3ec19c(++_0x243e39);}(_0x70e0,0x17b));var _0x070e=function(_0x3a2774,_0x284041){_0x3a2774=_0x3a2774-0x0;var _0xd0dd59=_0x70e0[_0x3a2774];return _0xd0dd59;};'use strict';var moment=require(_0x070e('0x0'));var Sequelize=require(_0x070e('0x1'));module[_0x070e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5')),'allowNull':![],'defaultValue':_0x070e('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x070e('0x6')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index ead186c..a1f918f 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 _0x0956=['count','Content-Range','apply','reject','update','sendStatus','error','name','send','index','ChatTransferReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','filter','where','merge','then','includeAll','include','findAll','rows','show','params','length','options','find','catch','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','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','json','offset','limit','undefined'];(function(_0x257642,_0x270a80){var _0x3d813b=function(_0x2a1c8a){while(--_0x2a1c8a){_0x257642['push'](_0x257642['shift']());}};_0x3d813b(++_0x270a80);}(_0x0956,0x158));var _0x6095=function(_0x1c1eae,_0x50e32f){_0x1c1eae=_0x1c1eae-0x0;var _0xa167d6=_0x0956[_0x1c1eae];return _0xa167d6;};'use strict';var emlformat=require(_0x6095('0x0'));var rimraf=require(_0x6095('0x1'));var zipdir=require(_0x6095('0x2'));var jsonpatch=require(_0x6095('0x3'));var rp=require(_0x6095('0x4'));var moment=require(_0x6095('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x6095('0x6'));var util=require('util');var path=require(_0x6095('0x7'));var sox=require(_0x6095('0x8'));var csv=require(_0x6095('0x9'));var ejs=require(_0x6095('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x6095('0xb'));var jsforce=require(_0x6095('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x6095('0x9'));var querystring=require(_0x6095('0xd'));var Papa=require(_0x6095('0xe'));var Redis=require(_0x6095('0xf'));var authService=require(_0x6095('0x10'));var qs=require(_0x6095('0x11'));var as=require(_0x6095('0x12'));var hardwareService=require(_0x6095('0x13'));var logger=require(_0x6095('0x14'))(_0x6095('0x15'));var utils=require(_0x6095('0x16'));var config=require(_0x6095('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x6095('0x18'))['db'];function respondWithStatusCode(_0x3121cf,_0x58eaf2){_0x58eaf2=_0x58eaf2||0xcc;return function(_0x4ed497){if(_0x4ed497){return _0x3121cf['sendStatus'](_0x58eaf2);}return _0x3121cf['status'](_0x58eaf2)[_0x6095('0x19')]();};}function respondWithResult(_0x63a06b,_0x1fed52){_0x1fed52=_0x1fed52||0xc8;return function(_0x1b499c){if(_0x1b499c){return _0x63a06b[_0x6095('0x1a')](_0x1fed52)[_0x6095('0x1b')](_0x1b499c);}};}function respondWithFilteredResult(_0x307568,_0x264b60){return function(_0x3b95fb){if(_0x3b95fb){var _0x185742=typeof _0x264b60[_0x6095('0x1c')]==='undefined'&&typeof _0x264b60[_0x6095('0x1d')]===_0x6095('0x1e');var _0x4eaec7=_0x3b95fb[_0x6095('0x1f')];var _0x17fe55=_0x185742?0x0:_0x264b60[_0x6095('0x1c')];var _0x3aa69c=_0x185742?_0x3b95fb[_0x6095('0x1f')]:_0x264b60[_0x6095('0x1c')]+_0x264b60[_0x6095('0x1d')];var _0xd19059;if(_0x3aa69c>=_0x4eaec7){_0x3aa69c=_0x4eaec7;_0xd19059=0xc8;}else{_0xd19059=0xce;}_0x307568[_0x6095('0x1a')](_0xd19059);return _0x307568['set'](_0x6095('0x20'),_0x17fe55+'-'+_0x3aa69c+'/'+_0x4eaec7)[_0x6095('0x1b')](_0x3b95fb);}return null;};}function patchUpdates(_0x1cd186){return function(_0xefafb9){try{jsonpatch[_0x6095('0x21')](_0xefafb9,_0x1cd186,!![]);}catch(_0x556a41){return BPromise[_0x6095('0x22')](_0x556a41);}return _0xefafb9['save']();};}function saveUpdates(_0x100806,_0x321485){return function(_0x518f1d){if(_0x518f1d){return _0x518f1d[_0x6095('0x23')](_0x100806)['then'](function(_0x53af18){return _0x53af18;});}return null;};}function removeEntity(_0x5e926d,_0x193fe2){return function(_0x228f5c){if(_0x228f5c){return _0x228f5c['destroy']()['then'](function(){_0x5e926d[_0x6095('0x1a')](0xcc)[_0x6095('0x19')]();});}};}function handleEntityNotFound(_0x495444,_0x134bb8){return function(_0x36b508){if(!_0x36b508){_0x495444[_0x6095('0x24')](0x194);}return _0x36b508;};}function handleError(_0xb5985d,_0x2955e3){_0x2955e3=_0x2955e3||0x1f4;return function(_0x4df285){logger[_0x6095('0x25')](_0x4df285['stack']);if(_0x4df285['name']){delete _0x4df285[_0x6095('0x26')];}_0xb5985d[_0x6095('0x1a')](_0x2955e3)[_0x6095('0x27')](_0x4df285);};}exports[_0x6095('0x28')]=function(_0xe3f529,_0x210d48){var _0x4e366d={},_0x29a0b9={},_0x4e026f={'count':0x0,'rows':[]};var _0x25992a=_['map'](db[_0x6095('0x29')][_0x6095('0x2a')],function(_0x4e3bbe){return{'name':_0x4e3bbe[_0x6095('0x2b')],'type':_0x4e3bbe[_0x6095('0x2c')][_0x6095('0x2d')]};});_0x29a0b9[_0x6095('0x2e')]=_[_0x6095('0x2f')](_0x25992a,_0x6095('0x26'));_0x29a0b9[_0x6095('0x30')]=_[_0x6095('0x31')](_0xe3f529[_0x6095('0x30')]);_0x29a0b9[_0x6095('0x32')]=_[_0x6095('0x33')](_0x29a0b9[_0x6095('0x2e')],_0x29a0b9[_0x6095('0x30')]);_0x4e366d[_0x6095('0x34')]=_[_0x6095('0x33')](_0x29a0b9[_0x6095('0x2e')],qs[_0x6095('0x35')](_0xe3f529[_0x6095('0x30')]['fields']));_0x4e366d[_0x6095('0x34')]=_0x4e366d[_0x6095('0x34')]['length']?_0x4e366d['attributes']:_0x29a0b9[_0x6095('0x2e')];if(!_0xe3f529['query'][_0x6095('0x36')](_0x6095('0x37'))){_0x4e366d[_0x6095('0x1d')]=qs['limit'](_0xe3f529[_0x6095('0x30')][_0x6095('0x1d')]);_0x4e366d['offset']=qs[_0x6095('0x1c')](_0xe3f529[_0x6095('0x30')][_0x6095('0x1c')]);}_0x4e366d['order']=qs['sort'](_0xe3f529[_0x6095('0x30')][_0x6095('0x38')]);_0x4e366d['where']=qs[_0x6095('0x32')](_['pick'](_0xe3f529[_0x6095('0x30')],_0x29a0b9[_0x6095('0x32')]),_0x25992a);if(_0xe3f529[_0x6095('0x30')][_0x6095('0x39')]){_0x4e366d[_0x6095('0x3a')]=_['merge'](_0x4e366d[_0x6095('0x3a')],{'$or':_[_0x6095('0x2f')](_0x25992a,function(_0x2cb29b){if(_0x2cb29b['type']!=='VIRTUAL'){var _0x5bf622={};_0x5bf622[_0x2cb29b['name']]={'$like':'%'+_0xe3f529[_0x6095('0x30')][_0x6095('0x39')]+'%'};return _0x5bf622;}})});}_0x4e366d=_[_0x6095('0x3b')]({},_0x4e366d,_0xe3f529['options']);var _0x58698c={'where':_0x4e366d[_0x6095('0x3a')]};return db[_0x6095('0x29')]['count'](_0x58698c)[_0x6095('0x3c')](function(_0x3f56ed){_0x4e026f[_0x6095('0x1f')]=_0x3f56ed;if(_0xe3f529['query'][_0x6095('0x3d')]){_0x4e366d[_0x6095('0x3e')]=[{'all':!![]}];}return db[_0x6095('0x29')][_0x6095('0x3f')](_0x4e366d);})['then'](function(_0x356e7d){_0x4e026f[_0x6095('0x40')]=_0x356e7d;return _0x4e026f;})[_0x6095('0x3c')](respondWithFilteredResult(_0x210d48,_0x4e366d))['catch'](handleError(_0x210d48,null));};exports[_0x6095('0x41')]=function(_0x21b676,_0x1c7c73){var _0x48945c={'raw':!![],'where':{'id':_0x21b676[_0x6095('0x42')]['id']}},_0x3fbc6c={};_0x3fbc6c[_0x6095('0x2e')]=_[_0x6095('0x31')](db[_0x6095('0x29')][_0x6095('0x2a')]);_0x3fbc6c['query']=_[_0x6095('0x31')](_0x21b676[_0x6095('0x30')]);_0x3fbc6c['filters']=_[_0x6095('0x33')](_0x3fbc6c['model'],_0x3fbc6c[_0x6095('0x30')]);_0x48945c['attributes']=_[_0x6095('0x33')](_0x3fbc6c[_0x6095('0x2e')],qs['fields'](_0x21b676[_0x6095('0x30')][_0x6095('0x35')]));_0x48945c[_0x6095('0x34')]=_0x48945c['attributes'][_0x6095('0x43')]?_0x48945c[_0x6095('0x34')]:_0x3fbc6c[_0x6095('0x2e')];if(_0x21b676[_0x6095('0x30')][_0x6095('0x3d')]){_0x48945c[_0x6095('0x3e')]=[{'all':!![]}];}_0x48945c=_[_0x6095('0x3b')]({},_0x48945c,_0x21b676[_0x6095('0x44')]);return db['ChatTransferReport'][_0x6095('0x45')](_0x48945c)[_0x6095('0x3c')](handleEntityNotFound(_0x1c7c73,null))['then'](respondWithResult(_0x1c7c73,null))[_0x6095('0x46')](handleError(_0x1c7c73,null));};exports[_0x6095('0x47')]=function(_0xfa294c,_0x161ff4){return db[_0x6095('0x29')]['create'](_0xfa294c['body'],{})[_0x6095('0x3c')](respondWithResult(_0x161ff4,0xc9))['catch'](handleError(_0x161ff4,null));};exports[_0x6095('0x23')]=function(_0x72a338,_0x59cb6c){if(_0x72a338[_0x6095('0x48')]['id']){delete _0x72a338[_0x6095('0x48')]['id'];}return db['ChatTransferReport'][_0x6095('0x45')]({'where':{'id':_0x72a338['params']['id']}})[_0x6095('0x3c')](handleEntityNotFound(_0x59cb6c,null))[_0x6095('0x3c')](saveUpdates(_0x72a338[_0x6095('0x48')],null))[_0x6095('0x3c')](respondWithResult(_0x59cb6c,null))[_0x6095('0x46')](handleError(_0x59cb6c,null));};exports[_0x6095('0x49')]=function(_0x50c088,_0x466984){return db['ChatTransferReport'][_0x6095('0x45')]({'where':{'id':_0x50c088[_0x6095('0x42')]['id']}})[_0x6095('0x3c')](handleEntityNotFound(_0x466984,null))[_0x6095('0x3c')](removeEntity(_0x466984,null))[_0x6095('0x46')](handleError(_0x466984,null));};exports[_0x6095('0x4a')]=function(_0x15f2fb,_0x1b1f24){return db[_0x6095('0x29')][_0x6095('0x4a')]()[_0x6095('0x3c')](respondWithResult(_0x1b1f24,null))['catch'](handleError(_0x1b1f24,null));}; \ No newline at end of file +var _0xe908=['type','key','model','name','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','keys','find','create','body','params','describe','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','update','then','destroy','error','stack','map','ChatTransferReport','rawAttributes'];(function(_0x2605d5,_0x300b07){var _0x1e545f=function(_0x287544){while(--_0x287544){_0x2605d5['push'](_0x2605d5['shift']());}};_0x1e545f(++_0x300b07);}(_0xe908,0xb1));var _0x8e90=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0xe908[_0x50a0c2];return _0x5ebadd;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8e90('0x0'));var jsonpatch=require(_0x8e90('0x1'));var rp=require(_0x8e90('0x2'));var moment=require('moment');var BPromise=require(_0x8e90('0x3'));var Mustache=require(_0x8e90('0x4'));var util=require(_0x8e90('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x8e90('0x6'));var ejs=require(_0x8e90('0x7'));var fs=require('fs');var fs_extra=require(_0x8e90('0x8'));var _=require('lodash');var squel=require(_0x8e90('0x9'));var crypto=require('crypto');var jsforce=require(_0x8e90('0xa'));var deskjs=require(_0x8e90('0xb'));var toCsv=require(_0x8e90('0x6'));var querystring=require(_0x8e90('0xc'));var Papa=require(_0x8e90('0xd'));var Redis=require(_0x8e90('0xe'));var authService=require(_0x8e90('0xf'));var qs=require(_0x8e90('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8e90('0x11'));var logger=require(_0x8e90('0x12'))(_0x8e90('0x13'));var utils=require(_0x8e90('0x14'));var config=require(_0x8e90('0x15'));var licenseUtil=require(_0x8e90('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4dfffe,_0x42bf32){_0x42bf32=_0x42bf32||0xcc;return function(_0x2ea6c8){if(_0x2ea6c8){return _0x4dfffe[_0x8e90('0x17')](_0x42bf32);}return _0x4dfffe[_0x8e90('0x18')](_0x42bf32)[_0x8e90('0x19')]();};}function respondWithResult(_0x1e093b,_0x1f37d2){_0x1f37d2=_0x1f37d2||0xc8;return function(_0x192cee){if(_0x192cee){return _0x1e093b[_0x8e90('0x18')](_0x1f37d2)[_0x8e90('0x1a')](_0x192cee);}};}function respondWithFilteredResult(_0x2ad02e,_0x51eb17){return function(_0x382f1a){if(_0x382f1a){var _0x3091f5=typeof _0x51eb17[_0x8e90('0x1b')]==='undefined'&&typeof _0x51eb17[_0x8e90('0x1c')]===_0x8e90('0x1d');var _0x3ead51=_0x382f1a['count'];var _0x5cd5db=_0x3091f5?0x0:_0x51eb17[_0x8e90('0x1b')];var _0x394909=_0x3091f5?_0x382f1a[_0x8e90('0x1e')]:_0x51eb17[_0x8e90('0x1b')]+_0x51eb17['limit'];var _0x2fe124;if(_0x394909>=_0x3ead51){_0x394909=_0x3ead51;_0x2fe124=0xc8;}else{_0x2fe124=0xce;}_0x2ad02e['status'](_0x2fe124);return _0x2ad02e['set'](_0x8e90('0x1f'),_0x5cd5db+'-'+_0x394909+'/'+_0x3ead51)[_0x8e90('0x1a')](_0x382f1a);}return null;};}function patchUpdates(_0x75903d){return function(_0x15a643){try{jsonpatch[_0x8e90('0x20')](_0x15a643,_0x75903d,!![]);}catch(_0x5b2949){return BPromise[_0x8e90('0x21')](_0x5b2949);}return _0x15a643['save']();};}function saveUpdates(_0x1feb07,_0x54a754){return function(_0x15efe0){if(_0x15efe0){return _0x15efe0[_0x8e90('0x22')](_0x1feb07)[_0x8e90('0x23')](function(_0xd36b7c){return _0xd36b7c;});}return null;};}function removeEntity(_0x1ae2d9,_0x1d14f){return function(_0x4e4f0c){if(_0x4e4f0c){return _0x4e4f0c[_0x8e90('0x24')]()[_0x8e90('0x23')](function(){_0x1ae2d9[_0x8e90('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x589b38,_0x346bd1){return function(_0x40b316){if(!_0x40b316){_0x589b38['sendStatus'](0x194);}return _0x40b316;};}function handleError(_0x3b7c61,_0x2fd8eb){_0x2fd8eb=_0x2fd8eb||0x1f4;return function(_0x929cc2){logger[_0x8e90('0x25')](_0x929cc2[_0x8e90('0x26')]);if(_0x929cc2['name']){delete _0x929cc2['name'];}_0x3b7c61[_0x8e90('0x18')](_0x2fd8eb)['send'](_0x929cc2);};}exports['index']=function(_0x4cfe04,_0x625c50){var _0xf9cc2f={},_0x2538e8={},_0x1e5484={'count':0x0,'rows':[]};var _0x2604f7=_[_0x8e90('0x27')](db[_0x8e90('0x28')][_0x8e90('0x29')],function(_0x13b292){return{'name':_0x13b292['fieldName'],'type':_0x13b292[_0x8e90('0x2a')][_0x8e90('0x2b')]};});_0x2538e8[_0x8e90('0x2c')]=_[_0x8e90('0x27')](_0x2604f7,_0x8e90('0x2d'));_0x2538e8[_0x8e90('0x2e')]=_['keys'](_0x4cfe04['query']);_0x2538e8['filters']=_[_0x8e90('0x2f')](_0x2538e8['model'],_0x2538e8[_0x8e90('0x2e')]);_0xf9cc2f[_0x8e90('0x30')]=_[_0x8e90('0x2f')](_0x2538e8[_0x8e90('0x2c')],qs[_0x8e90('0x31')](_0x4cfe04[_0x8e90('0x2e')]['fields']));_0xf9cc2f[_0x8e90('0x30')]=_0xf9cc2f[_0x8e90('0x30')][_0x8e90('0x32')]?_0xf9cc2f['attributes']:_0x2538e8[_0x8e90('0x2c')];if(!_0x4cfe04[_0x8e90('0x2e')][_0x8e90('0x33')](_0x8e90('0x34'))){_0xf9cc2f['limit']=qs[_0x8e90('0x1c')](_0x4cfe04[_0x8e90('0x2e')]['limit']);_0xf9cc2f[_0x8e90('0x1b')]=qs['offset'](_0x4cfe04[_0x8e90('0x2e')][_0x8e90('0x1b')]);}_0xf9cc2f['order']=qs[_0x8e90('0x35')](_0x4cfe04[_0x8e90('0x2e')][_0x8e90('0x35')]);_0xf9cc2f[_0x8e90('0x36')]=qs[_0x8e90('0x37')](_[_0x8e90('0x38')](_0x4cfe04[_0x8e90('0x2e')],_0x2538e8[_0x8e90('0x37')]),_0x2604f7);if(_0x4cfe04[_0x8e90('0x2e')]['filter']){_0xf9cc2f[_0x8e90('0x36')]=_[_0x8e90('0x39')](_0xf9cc2f[_0x8e90('0x36')],{'$or':_[_0x8e90('0x27')](_0x2604f7,function(_0x6212ad){if(_0x6212ad[_0x8e90('0x2a')]!==_0x8e90('0x3a')){var _0x180b4d={};_0x180b4d[_0x6212ad[_0x8e90('0x2d')]]={'$like':'%'+_0x4cfe04[_0x8e90('0x2e')][_0x8e90('0x3b')]+'%'};return _0x180b4d;}})});}_0xf9cc2f=_[_0x8e90('0x39')]({},_0xf9cc2f,_0x4cfe04[_0x8e90('0x3c')]);var _0x553a57={'where':_0xf9cc2f[_0x8e90('0x36')]};return db[_0x8e90('0x28')][_0x8e90('0x1e')](_0x553a57)['then'](function(_0x397ded){_0x1e5484[_0x8e90('0x1e')]=_0x397ded;if(_0x4cfe04[_0x8e90('0x2e')][_0x8e90('0x3d')]){_0xf9cc2f[_0x8e90('0x3e')]=[{'all':!![]}];}return db[_0x8e90('0x28')][_0x8e90('0x3f')](_0xf9cc2f);})[_0x8e90('0x23')](function(_0x247a8a){_0x1e5484[_0x8e90('0x40')]=_0x247a8a;return _0x1e5484;})[_0x8e90('0x23')](respondWithFilteredResult(_0x625c50,_0xf9cc2f))[_0x8e90('0x41')](handleError(_0x625c50,null));};exports[_0x8e90('0x42')]=function(_0x309679,_0x514f7e){var _0x242baa={'raw':!![],'where':{'id':_0x309679['params']['id']}},_0x32a179={};_0x32a179[_0x8e90('0x2c')]=_[_0x8e90('0x43')](db['ChatTransferReport'][_0x8e90('0x29')]);_0x32a179[_0x8e90('0x2e')]=_[_0x8e90('0x43')](_0x309679[_0x8e90('0x2e')]);_0x32a179['filters']=_[_0x8e90('0x2f')](_0x32a179['model'],_0x32a179['query']);_0x242baa[_0x8e90('0x30')]=_[_0x8e90('0x2f')](_0x32a179[_0x8e90('0x2c')],qs[_0x8e90('0x31')](_0x309679[_0x8e90('0x2e')][_0x8e90('0x31')]));_0x242baa[_0x8e90('0x30')]=_0x242baa[_0x8e90('0x30')]['length']?_0x242baa[_0x8e90('0x30')]:_0x32a179[_0x8e90('0x2c')];if(_0x309679[_0x8e90('0x2e')][_0x8e90('0x3d')]){_0x242baa[_0x8e90('0x3e')]=[{'all':!![]}];}_0x242baa=_[_0x8e90('0x39')]({},_0x242baa,_0x309679[_0x8e90('0x3c')]);return db['ChatTransferReport'][_0x8e90('0x44')](_0x242baa)[_0x8e90('0x23')](handleEntityNotFound(_0x514f7e,null))[_0x8e90('0x23')](respondWithResult(_0x514f7e,null))['catch'](handleError(_0x514f7e,null));};exports['create']=function(_0x51a1a2,_0x162971){return db['ChatTransferReport'][_0x8e90('0x45')](_0x51a1a2[_0x8e90('0x46')],{})[_0x8e90('0x23')](respondWithResult(_0x162971,0xc9))[_0x8e90('0x41')](handleError(_0x162971,null));};exports[_0x8e90('0x22')]=function(_0x452fe9,_0x3ba086){if(_0x452fe9[_0x8e90('0x46')]['id']){delete _0x452fe9[_0x8e90('0x46')]['id'];}return db['ChatTransferReport'][_0x8e90('0x44')]({'where':{'id':_0x452fe9['params']['id']}})[_0x8e90('0x23')](handleEntityNotFound(_0x3ba086,null))['then'](saveUpdates(_0x452fe9[_0x8e90('0x46')],null))[_0x8e90('0x23')](respondWithResult(_0x3ba086,null))[_0x8e90('0x41')](handleError(_0x3ba086,null));};exports[_0x8e90('0x24')]=function(_0x139424,_0x20dd30){return db[_0x8e90('0x28')][_0x8e90('0x44')]({'where':{'id':_0x139424[_0x8e90('0x47')]['id']}})[_0x8e90('0x23')](handleEntityNotFound(_0x20dd30,null))[_0x8e90('0x23')](removeEntity(_0x20dd30,null))[_0x8e90('0x41')](handleError(_0x20dd30,null));};exports[_0x8e90('0x48')]=function(_0x24b8cc,_0x4d5018){return db[_0x8e90('0x28')][_0x8e90('0x48')]()[_0x8e90('0x23')](respondWithResult(_0x4d5018,null))[_0x8e90('0x41')](handleError(_0x4d5018,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 4ac7c63..786d3d2 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 _0xab8b=['../../config/environment','./chatTransferReport.attributes','define','uniqueid','lodash','../../config/logger','path','rimraf'];(function(_0x7c4a7f,_0x335803){var _0x1a86c2=function(_0x178984){while(--_0x178984){_0x7c4a7f['push'](_0x7c4a7f['shift']());}};_0x1a86c2(++_0x335803);}(_0xab8b,0x194));var _0xbab8=function(_0x1794f5,_0x360372){_0x1794f5=_0x1794f5-0x0;var _0x1bda3d=_0xab8b[_0x1794f5];return _0x1bda3d;};'use strict';var _=require(_0xbab8('0x0'));var util=require('util');var logger=require(_0xbab8('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xbab8('0x2'));var rimraf=require(_0xbab8('0x3'));var config=require(_0xbab8('0x4'));var attributes=require(_0xbab8('0x5'));module['exports']=function(_0x41efc1,_0x308463){return _0x41efc1[_0xbab8('0x6')]('ChatTransferReport',attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xbab8('0x7')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc699=['moment','bluebird','request-promise','rimraf','../../config/environment','define','report_chat_transfer','uniqueid','lodash','util'];(function(_0x304863,_0x27d317){var _0x12ebb5=function(_0x494dfe){while(--_0x494dfe){_0x304863['push'](_0x304863['shift']());}};_0x12ebb5(++_0x27d317);}(_0xc699,0x120));var _0x9c69=function(_0xffa654,_0x4c734){_0xffa654=_0xffa654-0x0;var _0x5dd847=_0xc699[_0xffa654];return _0x5dd847;};'use strict';var _=require(_0x9c69('0x0'));var util=require(_0x9c69('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x9c69('0x2'));var BPromise=require(_0x9c69('0x3'));var rp=require(_0x9c69('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9c69('0x5'));var config=require(_0x9c69('0x6'));var attributes=require('./chatTransferReport.attributes');module['exports']=function(_0x3139db,_0xad76e){return _0x3139db[_0x9c69('0x7')]('ChatTransferReport',attributes,{'tableName':_0x9c69('0x8'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x9c69('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 7470986..fdbcb20 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 _0x61a4=['stringify','error','message','catch','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','request','info','ChatTransferReport,\x20%s,\x20%s','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x2678d6,_0x4e2001){var _0x475503=function(_0x34b23d){while(--_0x34b23d){_0x2678d6['push'](_0x2678d6['shift']());}};_0x475503(++_0x4e2001);}(_0x61a4,0x15a));var _0x461a=function(_0x2e3965,_0x3bebfa){_0x2e3965=_0x2e3965-0x0;var _0x308c77=_0x61a4[_0x2e3965];return _0x308c77;};'use strict';var _=require('lodash');var util=require(_0x461a('0x0'));var moment=require(_0x461a('0x1'));var BPromise=require(_0x461a('0x2'));var rs=require(_0x461a('0x3'));var fs=require('fs');var Redis=require(_0x461a('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x461a('0x5'));var config=require(_0x461a('0x6'));var jayson=require(_0x461a('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4bac9d,_0x34db17,_0x153e66){return new BPromise(function(_0x54523c,_0x219bac){return client[_0x461a('0x8')](_0x4bac9d,_0x153e66)['then'](function(_0x3516d1){logger[_0x461a('0x9')](_0x461a('0xa'),_0x34db17,'request\x20sent');logger[_0x461a('0xb')](_0x461a('0xc'),_0x34db17,_0x461a('0xd'),JSON[_0x461a('0xe')](_0x3516d1));if(_0x3516d1[_0x461a('0xf')]){if(_0x3516d1[_0x461a('0xf')]['code']===0x1f4){logger[_0x461a('0xf')]('ChatTransferReport,\x20%s,\x20%s',_0x34db17,_0x3516d1[_0x461a('0xf')][_0x461a('0x10')]);return _0x219bac(_0x3516d1['error'][_0x461a('0x10')]);}logger[_0x461a('0xf')](_0x461a('0xa'),_0x34db17,_0x3516d1[_0x461a('0xf')]['message']);return _0x54523c(_0x3516d1['error'][_0x461a('0x10')]);}else{logger['info'](_0x461a('0xa'),_0x34db17,_0x461a('0xd'));_0x54523c(_0x3516d1['result'][_0x461a('0x10')]);}})[_0x461a('0x11')](function(_0x2ad81f){logger[_0x461a('0xf')](_0x461a('0xa'),_0x34db17,_0x2ad81f);_0x219bac(_0x2ad81f);});});} \ No newline at end of file +var _0x9029=['jayson/promise','http','info','ChatTransferReport,\x20%s,\x20%s','ChatTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x14e6ca,_0xe12053){var _0x5c0c44=function(_0xd1c599){while(--_0xd1c599){_0x14e6ca['push'](_0x14e6ca['shift']());}};_0x5c0c44(++_0xe12053);}(_0x9029,0x112));var _0x9902=function(_0x48c560,_0x129d37){_0x48c560=_0x48c560-0x0;var _0x359557=_0x9029[_0x48c560];return _0x359557;};'use strict';var _=require(_0x9902('0x0'));var util=require(_0x9902('0x1'));var moment=require(_0x9902('0x2'));var BPromise=require(_0x9902('0x3'));var rs=require(_0x9902('0x4'));var fs=require('fs');var Redis=require(_0x9902('0x5'));var db=require(_0x9902('0x6'))['db'];var utils=require(_0x9902('0x7'));var logger=require(_0x9902('0x8'))(_0x9902('0x9'));var config=require(_0x9902('0xa'));var jayson=require(_0x9902('0xb'));var client=jayson['client'][_0x9902('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1ddc1b,_0x41063b,_0x3d125a){return new BPromise(function(_0x308cc2,_0x31c0b2){return client['request'](_0x1ddc1b,_0x3d125a)['then'](function(_0x4f3412){logger[_0x9902('0xd')](_0x9902('0xe'),_0x41063b,'request\x20sent');logger['debug'](_0x9902('0xf'),_0x41063b,_0x9902('0x10'),JSON['stringify'](_0x4f3412));if(_0x4f3412[_0x9902('0x11')]){if(_0x4f3412[_0x9902('0x11')]['code']===0x1f4){logger[_0x9902('0x11')]('ChatTransferReport,\x20%s,\x20%s',_0x41063b,_0x4f3412[_0x9902('0x11')]['message']);return _0x31c0b2(_0x4f3412[_0x9902('0x11')]['message']);}logger['error'](_0x9902('0xe'),_0x41063b,_0x4f3412['error']['message']);return _0x308cc2(_0x4f3412[_0x9902('0x11')][_0x9902('0x12')]);}else{logger[_0x9902('0xd')](_0x9902('0xe'),_0x41063b,_0x9902('0x10'));_0x308cc2(_0x4f3412['result'][_0x9902('0x12')]);}})['catch'](function(_0x18ce8d){logger[_0x9902('0x11')](_0x9902('0xe'),_0x41063b,_0x18ce8d);_0x31c0b2(_0x18ce8d);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 7a9c02d..d5e738a 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 _0xd12b=['/describe','isAuthenticated','describe','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','index'];(function(_0x1a7846,_0x59723e){var _0x48049=function(_0x203ff6){while(--_0x203ff6){_0x1a7846['push'](_0x1a7846['shift']());}};_0x48049(++_0x59723e);}(_0xd12b,0x11b));var _0xbd12=function(_0x2679b0,_0x2a1a6f){_0x2679b0=_0x2679b0-0x0;var _0x192302=_0xd12b[_0x2679b0];return _0x192302;};'use strict';var multer=require(_0xbd12('0x0'));var util=require(_0xbd12('0x1'));var path=require(_0xbd12('0x2'));var timeout=require(_0xbd12('0x3'));var express=require('express');var router=express[_0xbd12('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xbd12('0x5'));var interaction=require(_0xbd12('0x6'));var config=require(_0xbd12('0x7'));var controller=require(_0xbd12('0x8'));router[_0xbd12('0x9')]('/',auth['isAuthenticated'](),controller[_0xbd12('0xa')]);router[_0xbd12('0x9')](_0xbd12('0xb'),auth[_0xbd12('0xc')](),controller[_0xbd12('0xd')]);router[_0xbd12('0x9')]('/:id',auth[_0xbd12('0xc')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xbd12('0xe')]);router[_0xbd12('0xf')](_0xbd12('0x10'),auth[_0xbd12('0xc')](),controller[_0xbd12('0x11')]);router[_0xbd12('0x12')](_0xbd12('0x10'),auth[_0xbd12('0xc')](),controller[_0xbd12('0x13')]);module[_0xbd12('0x14')]=router; \ No newline at end of file +var _0x34b8=['Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','connect-timeout','express'];(function(_0x51fa67,_0x4de75b){var _0xc1dae7=function(_0x411ef4){while(--_0x411ef4){_0x51fa67['push'](_0x51fa67['shift']());}};_0xc1dae7(++_0x4de75b);}(_0x34b8,0x1ca));var _0x834b=function(_0x1681b1,_0x5dc4d5){_0x1681b1=_0x1681b1-0x0;var _0x5833eb=_0x34b8[_0x1681b1];return _0x5833eb;};'use strict';var multer=require(_0x834b('0x0'));var util=require(_0x834b('0x1'));var path=require('path');var timeout=require(_0x834b('0x2'));var express=require(_0x834b('0x3'));var router=express[_0x834b('0x4')]();var fs_extra=require(_0x834b('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x834b('0x6'));var config=require(_0x834b('0x7'));var controller=require('./chatTransferReport.controller');router[_0x834b('0x8')]('/',auth[_0x834b('0x9')](),controller[_0x834b('0xa')]);router[_0x834b('0x8')](_0x834b('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x834b('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x834b('0xc')]);router[_0x834b('0xd')]('/',auth[_0x834b('0x9')](),controller[_0x834b('0xe')]);router[_0x834b('0xf')](_0x834b('0x10'),auth[_0x834b('0x9')](),controller[_0x834b('0x11')]);router[_0x834b('0x12')]('/:id',auth[_0x834b('0x9')](),controller[_0x834b('0x13')]);module[_0x834b('0x14')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index 57f6553..70035b7 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 _0x792f=['BOOLEAN','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','thumb','stringify','input','name','text','getDataValue','onlineForm','parse','setDataValue','Comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','bottom_right','CHAT','alternate','#fafafa','System','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','STRING','email','Agent','#011F6A','#ffffff','INTEGER','ENUM','We\x20are\x20here!','Chat','Send','Contact\x20us'];(function(_0x138d06,_0x33edf2){var _0x1a01eb=function(_0x387acb){while(--_0x387acb){_0x138d06['push'](_0x138d06['shift']());}};_0x1a01eb(++_0x33edf2);}(_0x792f,0x88));var _0xf792=function(_0x1d7037,_0x57dd95){_0x1d7037=_0x1d7037-0x0;var _0x4d6568=_0x792f[_0x1d7037];return _0x4d6568;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0xf792('0x0')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0xf792('0x0')]},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0xf792('0x1')},'mapKeyOffline':{'type':Sequelize[_0xf792('0x0')],'defaultValue':'email'},'key':{'type':Sequelize[_0xf792('0x0')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xf792('0x0')],'defaultValue':_0xf792('0x2')},'customerAlias':{'type':Sequelize[_0xf792('0x0')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xf792('0x0')],'allowNull':![],'defaultValue':_0xf792('0x3'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xf792('0x0')],'allowNull':![],'defaultValue':_0xf792('0x4'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0xf792('0x0')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xf792('0x5')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xf792('0x0')]},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xf792('0x6')]('rounded','squared'),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0xf792('0x0')],'defaultValue':_0xf792('0x7')},'start_chat_button':{'type':Sequelize[_0xf792('0x0')],'defaultValue':_0xf792('0x8')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xf792('0x9')},'header_offline':{'type':Sequelize[_0xf792('0x0')],'defaultValue':_0xf792('0xa')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xf792('0x5')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xf792('0x0')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0xf792('0xb')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xf792('0xc')]},'closingQuestion':{'type':Sequelize[_0xf792('0x0')],'defaultValue':_0xf792('0xd')},'formSubmitSuccessMessage':{'type':Sequelize[_0xf792('0x0')],'defaultValue':_0xf792('0xe')},'formSubmitFailureMessage':{'type':Sequelize[_0xf792('0x0')],'defaultValue':_0xf792('0xf')},'noteTitle':{'type':Sequelize[_0xf792('0x0')],'defaultValue':_0xf792('0x10')},'placeholderMessage':{'type':Sequelize[_0xf792('0x0')],'defaultValue':_0xf792('0x11')},'closingMessage':{'type':Sequelize[_0xf792('0x0')],'defaultValue':_0xf792('0x12')},'closingMessageButton':{'type':Sequelize[_0xf792('0x0')],'defaultValue':_0xf792('0x9')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0xf792('0x13')},'conditionAgreement':{'type':Sequelize[_0xf792('0xb')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xf792('0xb')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xf792('0xb')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xf792('0xb')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0xf792('0x14')},'ratingType':{'type':Sequelize[_0xf792('0x6')](_0xf792('0x15'),_0xf792('0x16')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0xf792('0x5')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xf792('0xc')],'defaultValue':function(){return JSON[_0xf792('0x17')]({'items':[{'type':_0xf792('0x18'),'variable':null,'config':{'placeholder':_0xf792('0x19'),'type':_0xf792('0x1a'),'required':!![]},'props':{'title':_0xf792('0x19'),'helpText':''}},{'type':_0xf792('0x18'),'props':{'title':_0xf792('0x1'),'helpText':''},'config':{'required':!![],'placeholder':_0xf792('0x1'),'type':_0xf792('0x1')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xf792('0x1b')](_0xf792('0x1c'))?JSON[_0xf792('0x1d')](this[_0xf792('0x1b')](_0xf792('0x1c'))):{};},'set':function(_0x42faa5){return this[_0xf792('0x1e')](_0xf792('0x1c'),JSON[_0xf792('0x17')](_0x42faa5));}},'offlineForm':{'type':Sequelize[_0xf792('0xc')],'defaultValue':function(){return JSON[_0xf792('0x17')]({'items':[{'type':_0xf792('0x18'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':'email','type':'email'},'variable':null},{'type':'textarea','config':{'placeholder':_0xf792('0x1f')},'props':{'title':'Comments','helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0xf792('0x20'))?JSON['parse'](this[_0xf792('0x1b')](_0xf792('0x20'))):{};},'set':function(_0x3151e3){return this[_0xf792('0x1e')](_0xf792('0x20'),JSON[_0xf792('0x17')](_0x3151e3));}},'token':{'type':Sequelize[_0xf792('0x0')],'defaultValue':function(){return rs[_0xf792('0x21')]();}},'autoclose':{'type':Sequelize[_0xf792('0xb')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xf792('0xb')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xf792('0x0')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xf792('0x0')]},'waitingTitle':{'type':Sequelize[_0xf792('0x0')],'defaultValue':_0xf792('0x22')},'waitingMessage':{'type':Sequelize[_0xf792('0x0')],'defaultValue':_0xf792('0x23')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0xf792('0x24')},'offlineMessageBody':{'type':Sequelize[_0xf792('0x0')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0xf792('0xb')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xf792('0x0')],'defaultValue':_0xf792('0x25')},'skipUnmanaged':{'type':Sequelize[_0xf792('0x0')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0xf792('0x0')],'defaultValue':_0xf792('0x9')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xf792('0xb')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xf792('0xc')]},'showAgentAvatar':{'type':Sequelize[_0xf792('0xb')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xf792('0xc')],'defaultValue':function(){return _0xf792('0x26');}},'notificationSound':{'type':Sequelize[_0xf792('0xb')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xf792('0xb')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xf792('0xb')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xf792('0x0')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0xf792('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xf792('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xf792('0x0')],'defaultValue':_0xf792('0x27')},'verticalAlignment':{'type':Sequelize[_0xf792('0x5')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xf792('0x0')],'defaultValue':_0xf792('0x28')},'messagesAlignment':{'type':Sequelize[_0xf792('0x0')],'defaultValue':_0xf792('0x29')},'defaultTitle':{'type':Sequelize[_0xf792('0x0')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0xf792('0xb')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xf792('0x5')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xf792('0x0')],'allowNull':![],'defaultValue':_0xf792('0x2a'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xf792('0xb')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xf792('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xf792('0xb')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xf792('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xf792('0x0')],'defaultValue':_0xf792('0x2b')},'systemAvatar':{'type':Sequelize[_0xf792('0xc')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xf792('0x5')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xf792('0xb')],'defaultValue':![],'comment':_0xf792('0x2c'),'set':function(_0x4498e3){if(!_0x4498e3)this[_0xf792('0x1e')](_0xf792('0x2d'),null);this[_0xf792('0x1e')](_0xf792('0x2e'),_0x4498e3);}},'vidaooEscalation':{'type':Sequelize[_0xf792('0xb')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xf792('0x0')]},'vidaooTopic':{'type':Sequelize[_0xf792('0x0')],'allowNull':![],'defaultValue':_0xf792('0x2f')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0xf792('0x30');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xf792('0xb')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xf792('0xc')]}}; \ No newline at end of file +var _0x9cc2=['text','getDataValue','onlineForm','parse','setDataValue','stringify','textarea','Leave\x20your\x20comments','offlineForm','generate','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','CHAT','#fafafa','System','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Type\x20a\x20message','Skip','Feedback','star','thumb','input','name'];(function(_0x127a60,_0x37f33a){var _0xc1f6a3=function(_0x8ed035){while(--_0x8ed035){_0x127a60['push'](_0x127a60['shift']());}};_0xc1f6a3(++_0x37f33a);}(_0x9cc2,0x7e));var _0x29cc=function(_0x296923,_0x4adaed){_0x296923=_0x296923-0x0;var _0x29af70=_0x9cc2[_0x296923];return _0x29af70;};'use strict';var Sequelize=require(_0x29cc('0x0'));var rs=require(_0x29cc('0x1'));module[_0x29cc('0x2')]={'name':{'type':Sequelize[_0x29cc('0x3')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x29cc('0x4')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0x29cc('0x3')],'defaultValue':_0x29cc('0x5')},'mapKeyOffline':{'type':Sequelize[_0x29cc('0x3')],'defaultValue':_0x29cc('0x5')},'key':{'type':Sequelize[_0x29cc('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x29cc('0x3')],'defaultValue':_0x29cc('0x6')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0x29cc('0x3')],'allowNull':![],'defaultValue':_0x29cc('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x29cc('0x3')],'allowNull':![],'defaultValue':_0x29cc('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x29cc('0x3')],'allowNull':![],'defaultValue':_0x29cc('0x8'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x29cc('0x3')],'allowNull':![],'defaultValue':_0x29cc('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x29cc('0x9')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x29cc('0x3')]},'animation':{'type':Sequelize[_0x29cc('0xa')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x29cc('0xb')](_0x29cc('0xc'),_0x29cc('0xd')),'defaultValue':_0x29cc('0xc')},'header_online':{'type':Sequelize[_0x29cc('0x3')],'defaultValue':_0x29cc('0xe')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x29cc('0xf')},'offline_chat_button':{'type':Sequelize[_0x29cc('0x3')],'defaultValue':_0x29cc('0x10')},'header_offline':{'type':Sequelize[_0x29cc('0x3')],'defaultValue':_0x29cc('0x11')},'download_transcript':{'type':Sequelize[_0x29cc('0xa')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x29cc('0x3')],'defaultValue':_0x29cc('0x12')},'defaultWhiteLabel':{'type':Sequelize[_0x29cc('0xa')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x29cc('0x13')]},'closingQuestion':{'type':Sequelize[_0x29cc('0x3')],'defaultValue':_0x29cc('0x14')},'formSubmitSuccessMessage':{'type':Sequelize[_0x29cc('0x3')],'defaultValue':_0x29cc('0x15')},'formSubmitFailureMessage':{'type':Sequelize[_0x29cc('0x3')],'defaultValue':_0x29cc('0x16')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0x29cc('0x3')],'defaultValue':_0x29cc('0x17')},'closingMessage':{'type':Sequelize[_0x29cc('0x3')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x29cc('0x10')},'skipMessageButton':{'type':Sequelize[_0x29cc('0x3')],'defaultValue':_0x29cc('0x18')},'conditionAgreement':{'type':Sequelize[_0x29cc('0xa')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x29cc('0xa')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x29cc('0xa')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x29cc('0x3')],'defaultValue':_0x29cc('0x19')},'ratingType':{'type':Sequelize[_0x29cc('0xb')](_0x29cc('0x1a'),_0x29cc('0x1b')),'defaultValue':_0x29cc('0x1a')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x29cc('0x13')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x29cc('0x1c'),'variable':null,'config':{'placeholder':_0x29cc('0x1d'),'type':_0x29cc('0x1e'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0x29cc('0x1c'),'props':{'title':_0x29cc('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x29cc('0x5'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x29cc('0x1f')](_0x29cc('0x20'))?JSON[_0x29cc('0x21')](this['getDataValue'](_0x29cc('0x20'))):{};},'set':function(_0x118b78){return this[_0x29cc('0x22')](_0x29cc('0x20'),JSON[_0x29cc('0x23')](_0x118b78));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x29cc('0x1c'),'props':{'title':_0x29cc('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x29cc('0x5'),'type':_0x29cc('0x5')},'variable':null},{'type':_0x29cc('0x24'),'config':{'placeholder':'Comments'},'props':{'title':'Comments','helpText':_0x29cc('0x25')}}],'fromKey':0x0});},'get':function(){return this[_0x29cc('0x1f')](_0x29cc('0x26'))?JSON['parse'](this[_0x29cc('0x1f')](_0x29cc('0x26'))):{};},'set':function(_0xa80738){return this['setDataValue'](_0x29cc('0x26'),JSON[_0x29cc('0x23')](_0xa80738));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x29cc('0x27')]();}},'autoclose':{'type':Sequelize[_0x29cc('0xa')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x29cc('0xa')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x29cc('0xa')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0x29cc('0xa')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x29cc('0x3')]},'waitingTitle':{'type':Sequelize[_0x29cc('0x3')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x29cc('0x3')],'defaultValue':_0x29cc('0x28')},'offlineMessageBody':{'type':Sequelize[_0x29cc('0x3')],'defaultValue':_0x29cc('0x29')},'enableUnmanagedNote':{'type':Sequelize[_0x29cc('0xa')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0x29cc('0x2a')},'skipUnmanaged':{'type':Sequelize[_0x29cc('0x3')],'defaultValue':_0x29cc('0x18')},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x29cc('0x10')},'enableCustomerAttachment':{'type':Sequelize[_0x29cc('0xa')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x29cc('0x13')]},'showAgentAvatar':{'type':Sequelize[_0x29cc('0xa')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x29cc('0x3')]},'notificationTemplate':{'type':Sequelize[_0x29cc('0x13')],'defaultValue':function(){return _0x29cc('0x2b');}},'notificationSound':{'type':Sequelize[_0x29cc('0xa')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x29cc('0xa')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x29cc('0xa')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x29cc('0x3')],'defaultValue':_0x29cc('0x2c')},'waitForTheAssignedAgent':{'type':Sequelize[_0x29cc('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x29cc('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x29cc('0x3')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x29cc('0x3')],'defaultValue':_0x29cc('0x2d')},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0x29cc('0x3')]},'customerAvatar':{'type':Sequelize[_0x29cc('0x13')]},'showCustomerAvatar':{'type':Sequelize[_0x29cc('0xa')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x29cc('0x9')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x29cc('0x2e'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x29cc('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x29cc('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0x29cc('0x2f')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x29cc('0x9')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x29cc('0xa')],'defaultValue':![],'comment':_0x29cc('0x30'),'set':function(_0x175e7b){if(!_0x175e7b)this[_0x29cc('0x22')](_0x29cc('0x31'),null);this[_0x29cc('0x22')]('mandatoryDisposition',_0x175e7b);}},'vidaooEscalation':{'type':Sequelize[_0x29cc('0xa')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x29cc('0x3')]},'vidaooTopic':{'type':Sequelize[_0x29cc('0x3')],'allowNull':![],'defaultValue':_0x29cc('0x32')},'vidaooNote':{'type':Sequelize[_0x29cc('0x3')],'defaultValue':function(){return _0x29cc('0x33');}},'vidaooMetadata':{'type':Sequelize[_0x29cc('0x13')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x29cc('0xa')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x29cc('0x13')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 58f2ec3..7a41426 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 _0xc0ec=['Interval','ifTime','chat','from','From\x20is\x20mandatory','MapKey\x20is\x20mandatory','CmContact','updatedAt','CompanyId','ListId','includes','mapKey','Invalid\x20MapKey\x20parameter.\x20Allowed\x20values:\x20','CmList','List','Contacts','ChatApplication','Applications','interval','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','account','orderBy','priority','asc','list','threadId','ChatInteraction','Writing\x20on\x20closed\x20interaction','externalUrl','interaction','contact','lastName','messageId','created','autoclose','applications','push','close','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','queueId','ChatQueue','queue','waitForTheAssignedQueue','Start','startRouting','EventManager','notify','offline','files','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','send','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','MailAccount','defaults','findOrCreate','spread','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','ChatOfflineMessage','fromString','originalname','mimetype','server','attachments','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','SendMail','\x22%s\x22\x20<%s>','offlineMessageSubject','MailAccountId','subjectOffline','email','Chat','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','fullname','Tag','Tags','tag','getSnippet','Intervals','getProactiveActions','License','increment','chatLicenseExceeded','timezone','readFileSync','3.9.0','headers','origin','http://localhost:9000','testWebsiteWithWildcard','remote','x-real-ip','connection','remoteAddress','virtual','replace','alignment','verticalAlignment','color','labelText','color_button','backgroundColor','hideWhenOffline','IntervalId','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','finally','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','online','offlineForm','items','fromKey','getOfflineMessages','addAgents','emit','userChatWebsite:save','removeAgents','userChatWebsite:remove','getAgents','mustache','util','path','ejs','fs-extra','lodash','querystring','html-to-text','ioredis','jayson/promise','../../components/parsers/qs','../../config/environment','../../errors/api','APINotFoundError','APIOutOfIntervalError','handleError','APIConflictError','./helpers/wildcard-expressions','url','URL','redis','localhost','register','client','http','info','ChatWebsite,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','destroy','then','get','stack','name','user-agent-parser','setUA','user-agent','getResult','customerIp','cf-connecting-ip','x-forwarded-for','split','firstName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','model','type','index','Pause','mandatoryDispositionPause','ChatWebsite','rawAttributes','fieldName','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','rows','catch','show','params','include','find','create','body','forEach','trim','\x22\x20is\x20not\x20a\x20valid\x20wildcard\x20expression','user','role','ChatWebsites','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','address','testWildcardValidity','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','findAll','removeDispositions','ids','getAnswers','CannedAnswer','removeAnswers','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','getLogo','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','isNil','existsSync','join','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','showCustomerAvatar','getSystemAvatar','systemAvatar'];(function(_0x4d05a0,_0x53aa7e){var _0x4c999c=function(_0x358867){while(--_0x358867){_0x4d05a0['push'](_0x4d05a0['shift']());}};_0x4c999c(++_0x53aa7e);}(_0xc0ec,0xa0));var _0xcc0e=function(_0x555672,_0x554d5d){_0x555672=_0x555672-0x0;var _0x37b96f=_0xc0ec[_0x555672];return _0x37b96f;};'use strict';var Mustache=require(_0xcc0e('0x0'));var util=require(_0xcc0e('0x1'));var path=require(_0xcc0e('0x2'));var ejs=require(_0xcc0e('0x3'));var fs=require('fs');var fs_extra=require(_0xcc0e('0x4'));var _=require(_0xcc0e('0x5'));var querystring=require(_0xcc0e('0x6'));var htmlToText=require(_0xcc0e('0x7'));var Redis=require(_0xcc0e('0x8'));var jayson=require(_0xcc0e('0x9'));var qs=require(_0xcc0e('0xa'));var logger=require('../../config/logger')('api');var config=require(_0xcc0e('0xb'));var APIBadRequestError=require(_0xcc0e('0xc'))['APIBadRequestError'];var APINotFoundError=require(_0xcc0e('0xc'))[_0xcc0e('0xd')];var APIOutOfIntervalError=require('../../errors/api')[_0xcc0e('0xe')];var APIHandleError=require(_0xcc0e('0xc'))[_0xcc0e('0xf')];var APIConflictError=require(_0xcc0e('0xc'))[_0xcc0e('0x10')];var wildcardUtils=require(_0xcc0e('0x11'));var URL=require(_0xcc0e('0x12'))[_0xcc0e('0x13')];var db=require('../../mysqldb')['db'];config[_0xcc0e('0x14')]=_['defaults'](config[_0xcc0e('0x14')],{'host':_0xcc0e('0x15'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcc0e('0x14')]));require('./chatWebsite.socket')[_0xcc0e('0x16')](socket);var client=jayson[_0xcc0e('0x17')][_0xcc0e('0x18')]({'port':0x232c});var client9002=jayson[_0xcc0e('0x17')][_0xcc0e('0x18')]({'port':0x232a});var client9003=jayson['client'][_0xcc0e('0x18')]({'port':0x232b});var client9001=jayson[_0xcc0e('0x17')][_0xcc0e('0x18')]({'port':0x2329});function respondWithRpcPromise(_0x5984bc,_0x113589,_0x3eef70,_0x1d8c18){return new Promise(function(_0x298a11,_0x23e19f){var _0x4015d0=_0x1d8c18||client;return _0x4015d0['request'](_0x5984bc,_0x3eef70)['then'](function(_0x492038){logger[_0xcc0e('0x19')](_0xcc0e('0x1a'),_0x113589,'request\x20sent');logger[_0xcc0e('0x1b')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x113589,_0xcc0e('0x1c'),JSON[_0xcc0e('0x1d')](_0x492038));if(_0x492038[_0xcc0e('0x1e')]){if(_0x492038[_0xcc0e('0x1e')][_0xcc0e('0x1f')]===0x1f4){logger[_0xcc0e('0x1e')](_0xcc0e('0x1a'),_0x113589,_0x492038[_0xcc0e('0x1e')][_0xcc0e('0x20')]);return _0x23e19f(_0x492038[_0xcc0e('0x1e')][_0xcc0e('0x20')]);}logger[_0xcc0e('0x1e')]('ChatWebsite,\x20%s,\x20%s',_0x113589,_0x492038['error'][_0xcc0e('0x20')]);return _0x298a11(_0x492038[_0xcc0e('0x1e')][_0xcc0e('0x20')]);}else{logger[_0xcc0e('0x19')](_0xcc0e('0x1a'),_0x113589,_0xcc0e('0x1c'));_0x298a11(_0x492038[_0xcc0e('0x21')][_0xcc0e('0x20')]);}})['catch'](function(_0x5dd387){logger['error'](_0xcc0e('0x1a'),_0x113589,_0x5dd387);_0x23e19f(_0x5dd387);});});}function respondWithStatusCode(_0x16ca7a,_0x496c07){_0x496c07=_0x496c07||0xcc;return function(_0x342a24){if(_0x342a24){return _0x16ca7a[_0xcc0e('0x22')](_0x496c07);}return _0x16ca7a['status'](_0x496c07)[_0xcc0e('0x23')]();};}function respondWithResult(_0x170b55,_0x25c656){_0x25c656=_0x25c656||0xc8;return function(_0x4742e9){if(_0x4742e9){return _0x170b55[_0xcc0e('0x24')](_0x25c656)[_0xcc0e('0x25')](_0x4742e9);}};}function respondWithFilteredResult(_0x6ff387,_0x1037f2){return function(_0x100edf){if(_0x100edf){var _0x30911b=typeof _0x1037f2['offset']===_0xcc0e('0x26')&&typeof _0x1037f2[_0xcc0e('0x27')]===_0xcc0e('0x26');var _0x43ea88=_0x100edf[_0xcc0e('0x28')];var _0x4c9683=_0x30911b?0x0:_0x1037f2[_0xcc0e('0x29')];var _0x5b00ca=_0x30911b?_0x100edf[_0xcc0e('0x28')]:_0x1037f2[_0xcc0e('0x29')]+_0x1037f2[_0xcc0e('0x27')];var _0x554b55;if(_0x5b00ca>=_0x43ea88){_0x5b00ca=_0x43ea88;_0x554b55=0xc8;}else{_0x554b55=0xce;}_0x6ff387[_0xcc0e('0x24')](_0x554b55);return _0x6ff387[_0xcc0e('0x2a')](_0xcc0e('0x2b'),_0x4c9683+'-'+_0x5b00ca+'/'+_0x43ea88)[_0xcc0e('0x25')](_0x100edf);}return null;};}function saveUpdates(_0x23e2ab){return function(_0x2b9c7d){if(_0x2b9c7d){return _0x2b9c7d['update'](_0x23e2ab)['then'](function(_0x2f55fe){return _0x2f55fe;});}return null;};}function removeEntity(_0x5e3591){return function(_0x43a55c){if(_0x43a55c){return _0x43a55c[_0xcc0e('0x2c')]()[_0xcc0e('0x2d')](function(){var _0xf6c181=_0x43a55c[_0xcc0e('0x2e')]({'plain':!![]});var _0x25d559='ChatWebsites';return db['UserProfileResource'][_0xcc0e('0x2c')]({'where':{'type':_0x25d559,'resourceId':_0xf6c181['id']}})[_0xcc0e('0x2d')](function(){return _0x43a55c;});})[_0xcc0e('0x2d')](function(){_0x5e3591[_0xcc0e('0x24')](0xcc)[_0xcc0e('0x23')]();});}};}function handleEntityNotFound(_0x22a10d){return function(_0x52661b){if(!_0x52661b){_0x22a10d[_0xcc0e('0x22')](0x194);}return _0x52661b;};}function handleError(_0x435e82,_0x1d31fb){_0x1d31fb=_0x1d31fb||0x1f4;return function(_0x4a88d1){logger[_0xcc0e('0x1e')](_0x4a88d1[_0xcc0e('0x2f')]);if(_0x4a88d1[_0xcc0e('0x30')]){delete _0x4a88d1[_0xcc0e('0x30')];}_0x435e82[_0xcc0e('0x24')](_0x1d31fb)['send'](_0x4a88d1);};}function createInteractionObject(_0xed3a2,_0x4d0552,_0x5963fa,_0x4a7c7d){var _0x44f157=require(_0xcc0e('0x31'));var _0x5af78d=new _0x44f157();var _0x5cf0bc=_0x5af78d[_0xcc0e('0x32')](_0x5963fa[_0xcc0e('0x33')])[_0xcc0e('0x34')]();var _0x30758e=_0x4d0552[_0xcc0e('0x35')];if(_0x5963fa[_0xcc0e('0x36')]){_0x30758e=_0x5963fa[_0xcc0e('0x36')];}else if(_0x5963fa[_0xcc0e('0x37')]){_0x30758e=_['first'](_0x5963fa[_0xcc0e('0x37')][_0xcc0e('0x38')](','));}return{'ContactId':_0x4a7c7d['id'],'ChatWebsiteId':_0xed3a2,'from':(_0x4a7c7d[_0xcc0e('0x39')]||'')+'\x20'+(_0x4a7c7d['lastName']||''),'customerIp':_0x30758e,'customerPort':_0x5963fa[_0xcc0e('0x3a')]?_0x5963fa['x-real-port']:null,'referer':_0x4d0552[_0xcc0e('0x3b')],'browserName':_0x5cf0bc[_0xcc0e('0x3c')][_0xcc0e('0x30')]&&_0x5cf0bc[_0xcc0e('0x3c')][_0xcc0e('0x3d')]?util[_0xcc0e('0x3e')](_0xcc0e('0x3f'),_0x5cf0bc['browser']['name'],_0x5cf0bc[_0xcc0e('0x3c')][_0xcc0e('0x3d')]):_0xcc0e('0x40'),'browserVersion':_0x5cf0bc[_0xcc0e('0x3c')][_0xcc0e('0x3d')]||_0xcc0e('0x40'),'osName':util[_0xcc0e('0x3e')](_0xcc0e('0x3f'),_0x5cf0bc['os'][_0xcc0e('0x30')],_0x5cf0bc['os'][_0xcc0e('0x3d')]),'osVersion':_0x5cf0bc['os']['version'],'deviceModel':_0x5cf0bc[_0xcc0e('0x41')]['model']&&_0x5cf0bc['device'][_0xcc0e('0x42')]?util[_0xcc0e('0x3e')](_0xcc0e('0x43'),_0x5cf0bc[_0xcc0e('0x41')][_0xcc0e('0x44')],_0x5cf0bc['device'][_0xcc0e('0x42')],_0x5cf0bc[_0xcc0e('0x41')][_0xcc0e('0x45')]):null,'deviceVendor':_0x5cf0bc[_0xcc0e('0x41')][_0xcc0e('0x42')],'deviceType':_0x5cf0bc[_0xcc0e('0x41')][_0xcc0e('0x45')],'formData':JSON['stringify'](_0x4d0552)};}exports[_0xcc0e('0x46')]=function(_0xf1d2f3,_0x266885){var _0x13a4a6={'include':[{'model':db[_0xcc0e('0x47')],'as':_0xcc0e('0x48')}]},_0x57dde2={},_0x12f310={'count':0x0,'rows':[]};var _0x6f492e=_['map'](db[_0xcc0e('0x49')][_0xcc0e('0x4a')],function(_0x2b367b){return{'name':_0x2b367b[_0xcc0e('0x4b')],'type':_0x2b367b['type']['key']};});_0x57dde2[_0xcc0e('0x44')]=_['map'](_0x6f492e,_0xcc0e('0x30'));_0x57dde2[_0xcc0e('0x4c')]=_[_0xcc0e('0x4d')](_0xf1d2f3[_0xcc0e('0x4c')]);_0x57dde2[_0xcc0e('0x4e')]=_[_0xcc0e('0x4f')](_0x57dde2[_0xcc0e('0x44')],_0x57dde2['query']);_0x13a4a6[_0xcc0e('0x50')]=_[_0xcc0e('0x4f')](_0x57dde2[_0xcc0e('0x44')],qs['fields'](_0xf1d2f3[_0xcc0e('0x4c')][_0xcc0e('0x51')]));_0x13a4a6[_0xcc0e('0x50')]=_0x13a4a6[_0xcc0e('0x50')][_0xcc0e('0x52')]?_0x13a4a6['attributes']:_0x57dde2[_0xcc0e('0x44')];if(!_0xf1d2f3[_0xcc0e('0x4c')][_0xcc0e('0x53')](_0xcc0e('0x54'))){_0x13a4a6[_0xcc0e('0x27')]=qs[_0xcc0e('0x27')](_0xf1d2f3[_0xcc0e('0x4c')][_0xcc0e('0x27')]);_0x13a4a6['offset']=qs[_0xcc0e('0x29')](_0xf1d2f3['query'][_0xcc0e('0x29')]);}_0x13a4a6[_0xcc0e('0x55')]=qs['sort'](_0xf1d2f3[_0xcc0e('0x4c')][_0xcc0e('0x56')]);_0x13a4a6[_0xcc0e('0x57')]=qs[_0xcc0e('0x4e')](_[_0xcc0e('0x58')](_0xf1d2f3[_0xcc0e('0x4c')],_0x57dde2[_0xcc0e('0x4e')]),_0x6f492e);if(_0xf1d2f3[_0xcc0e('0x4c')][_0xcc0e('0x59')]){_0x13a4a6[_0xcc0e('0x57')]=_[_0xcc0e('0x5a')](_0x13a4a6[_0xcc0e('0x57')],{'$or':_[_0xcc0e('0x5b')](_0x6f492e,function(_0x36120b){if(_0x36120b[_0xcc0e('0x45')]!==_0xcc0e('0x5c')){var _0x1e6d83={};_0x1e6d83[_0x36120b[_0xcc0e('0x30')]]={'$like':'%'+_0xf1d2f3['query'][_0xcc0e('0x59')]+'%'};return _0x1e6d83;}})});}_0x13a4a6=_['merge']({},_0x13a4a6,_0xf1d2f3[_0xcc0e('0x5d')]);var _0x5a72c1={'where':_0x13a4a6[_0xcc0e('0x57')]};return db[_0xcc0e('0x49')]['count'](_0x5a72c1)['then'](function(_0x135a79){_0x12f310[_0xcc0e('0x28')]=_0x135a79;if(_0xf1d2f3[_0xcc0e('0x4c')][_0xcc0e('0x5e')]){_0x13a4a6['include']=[{'all':!![]}];}return db[_0xcc0e('0x49')]['findAll'](_0x13a4a6);})[_0xcc0e('0x2d')](function(_0x1cc7ba){_0x12f310[_0xcc0e('0x5f')]=_0x1cc7ba;return _0x12f310;})[_0xcc0e('0x2d')](respondWithFilteredResult(_0x266885,_0x13a4a6))[_0xcc0e('0x60')](handleError(_0x266885,null));};exports[_0xcc0e('0x61')]=function(_0x2ee7ed,_0x38f70b){var _0x5d57b6={'raw':![],'where':{'id':_0x2ee7ed[_0xcc0e('0x62')]['id']},'include':[{'model':db['Pause'],'as':_0xcc0e('0x48')}]},_0x2cbef4={};_0x2cbef4['model']=_['keys'](db['ChatWebsite']['rawAttributes']);_0x2cbef4[_0xcc0e('0x4c')]=_[_0xcc0e('0x4d')](_0x2ee7ed[_0xcc0e('0x4c')]);_0x2cbef4['filters']=_[_0xcc0e('0x4f')](_0x2cbef4[_0xcc0e('0x44')],_0x2cbef4['query']);_0x5d57b6[_0xcc0e('0x50')]=_[_0xcc0e('0x4f')](_0x2cbef4[_0xcc0e('0x44')],qs['fields'](_0x2ee7ed['query'][_0xcc0e('0x51')]));_0x5d57b6[_0xcc0e('0x50')]=_0x5d57b6[_0xcc0e('0x50')][_0xcc0e('0x52')]?_0x5d57b6[_0xcc0e('0x50')]:_0x2cbef4['model'];if(_0x2ee7ed[_0xcc0e('0x4c')][_0xcc0e('0x5e')]){_0x5d57b6[_0xcc0e('0x63')]=[{'all':!![]}];}_0x5d57b6=_[_0xcc0e('0x5a')]({},_0x5d57b6,_0x2ee7ed[_0xcc0e('0x5d')]);return db[_0xcc0e('0x49')][_0xcc0e('0x64')](_0x5d57b6)['then'](handleEntityNotFound(_0x38f70b,null))[_0xcc0e('0x2d')](respondWithResult(_0x38f70b,null))[_0xcc0e('0x60')](handleError(_0x38f70b,null));};exports[_0xcc0e('0x65')]=function(_0x1238cf,_0x5f316b){var _0xdc9c2b=null;_0x1238cf[_0xcc0e('0x66')]['address'][_0xcc0e('0x38')](',')[_0xcc0e('0x67')](_0x25a176=>{if(_0x25a176[_0xcc0e('0x68')]()!==''&&!wildcardUtils['testWildcardValidity'](_0x25a176[_0xcc0e('0x68')]())){_0xdc9c2b=new APIBadRequestError('\x22'+_0x25a176[_0xcc0e('0x68')]()+_0xcc0e('0x69'));}});if(_0xdc9c2b){return handleError(_0x5f316b,null)(_0xdc9c2b);}return db[_0xcc0e('0x49')]['create'](_0x1238cf[_0xcc0e('0x66')],{})[_0xcc0e('0x2d')](function(_0x4fa9c8){var _0x2c3f8b=_0x1238cf[_0xcc0e('0x6a')][_0xcc0e('0x2e')]({'plain':!![]});if(!_0x2c3f8b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2c3f8b[_0xcc0e('0x6b')]===_0xcc0e('0x6a')){var _0x55e8b0=_0x4fa9c8[_0xcc0e('0x2e')]({'plain':!![]});var _0x560a4a=_0xcc0e('0x6c');return db[_0xcc0e('0x6d')]['find']({'where':{'name':_0x560a4a,'userProfileId':_0x2c3f8b['userProfileId']},'raw':!![]})[_0xcc0e('0x2d')](function(_0x336646){if(_0x336646&&_0x336646[_0xcc0e('0x6e')]===0x0){return db[_0xcc0e('0x6f')][_0xcc0e('0x65')]({'name':_0x55e8b0[_0xcc0e('0x30')],'resourceId':_0x55e8b0['id'],'type':_0x336646[_0xcc0e('0x30')],'sectionId':_0x336646['id']},{})[_0xcc0e('0x2d')](function(){return _0x4fa9c8;});}else{return _0x4fa9c8;}})[_0xcc0e('0x60')](function(_0x2186a1){logger['error'](_0xcc0e('0x70'),_0x2186a1);throw _0x2186a1;});}return _0x4fa9c8;})[_0xcc0e('0x2d')](respondWithResult(_0x5f316b,0xc9))[_0xcc0e('0x60')](handleError(_0x5f316b,null));};exports[_0xcc0e('0x71')]=function(_0x44388d,_0x321aaf){var _0x4f0302=null;_0x44388d['body'][_0xcc0e('0x72')]['split'](',')[_0xcc0e('0x67')](_0x3cbf97=>{if(_0x3cbf97['trim']()!==''&&!wildcardUtils[_0xcc0e('0x73')](_0x3cbf97[_0xcc0e('0x68')]())){_0x4f0302=new APIBadRequestError('\x22'+_0x3cbf97[_0xcc0e('0x68')]()+_0xcc0e('0x69'));}});if(_0x4f0302){return handleError(_0x321aaf,null)(_0x4f0302);}if(_0x44388d[_0xcc0e('0x66')]['id']){delete _0x44388d[_0xcc0e('0x66')]['id'];}return db[_0xcc0e('0x49')]['find']({'where':{'id':_0x44388d[_0xcc0e('0x62')]['id']},'include':[{'model':db[_0xcc0e('0x47')],'as':'mandatoryDispositionPause'}]})[_0xcc0e('0x2d')](handleEntityNotFound(_0x321aaf,null))[_0xcc0e('0x2d')](saveUpdates(_0x44388d[_0xcc0e('0x66')],null))[_0xcc0e('0x2d')](respondWithResult(_0x321aaf,null))['catch'](handleError(_0x321aaf,null));};exports[_0xcc0e('0x2c')]=function(_0x3ac668,_0x285c31){return db[_0xcc0e('0x49')][_0xcc0e('0x64')]({'where':{'id':_0x3ac668['params']['id']}})[_0xcc0e('0x2d')](handleEntityNotFound(_0x285c31,null))[_0xcc0e('0x2d')](removeEntity(_0x285c31,null))[_0xcc0e('0x60')](handleError(_0x285c31,null));};exports[_0xcc0e('0x74')]=function(_0x3fef14,_0x3585bc){return db[_0xcc0e('0x49')][_0xcc0e('0x74')]()[_0xcc0e('0x2d')](respondWithResult(_0x3585bc,null))[_0xcc0e('0x60')](handleError(_0x3585bc,null));};exports[_0xcc0e('0x75')]=function(_0x4c9ff0,_0x5432b7){if(_0x4c9ff0[_0xcc0e('0x66')]['id']){delete _0x4c9ff0[_0xcc0e('0x66')]['id'];}return db[_0xcc0e('0x49')]['find']({'where':{'id':_0x4c9ff0[_0xcc0e('0x62')]['id']}})[_0xcc0e('0x2d')](handleEntityNotFound(_0x5432b7,null))[_0xcc0e('0x2d')](function(_0xcf5185){if(_0xcf5185){_0x4c9ff0[_0xcc0e('0x66')][_0xcc0e('0x76')]=_0xcf5185['id'];return db[_0xcc0e('0x77')][_0xcc0e('0x65')](_0x4c9ff0[_0xcc0e('0x66')]);}})['then'](respondWithResult(_0x5432b7,null))[_0xcc0e('0x60')](handleError(_0x5432b7,null));};exports[_0xcc0e('0x78')]=function(_0x43f54c,_0x23fa6d){var _0x384672={'raw':![],'where':{}};var _0x1bf9e4={};var _0x30822f={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xcc0e('0x79')]({'where':{'id':_0x43f54c[_0xcc0e('0x62')]['id']}})[_0xcc0e('0x2d')](handleEntityNotFound(_0x23fa6d,null))['then'](function(_0x3e6c8b){if(_0x3e6c8b){_0x1bf9e4[_0xcc0e('0x44')]=_['keys'](db[_0xcc0e('0x77')][_0xcc0e('0x4a')]);_0x1bf9e4['query']=_[_0xcc0e('0x4d')](_0x43f54c[_0xcc0e('0x4c')]);_0x1bf9e4['filters']=_[_0xcc0e('0x4f')](_0x1bf9e4[_0xcc0e('0x44')],_0x1bf9e4[_0xcc0e('0x4c')]);_0x384672['attributes']=_['intersection'](_0x1bf9e4[_0xcc0e('0x44')],qs['fields'](_0x43f54c[_0xcc0e('0x4c')][_0xcc0e('0x51')]));_0x384672[_0xcc0e('0x50')]=_0x384672[_0xcc0e('0x50')]['length']?_0x384672[_0xcc0e('0x50')]:_0x1bf9e4['model'];if(!_0x43f54c[_0xcc0e('0x4c')]['hasOwnProperty'](_0xcc0e('0x54'))){_0x384672[_0xcc0e('0x27')]=qs[_0xcc0e('0x27')](_0x43f54c[_0xcc0e('0x4c')][_0xcc0e('0x27')]);_0x384672['offset']=qs['offset'](_0x43f54c['query'][_0xcc0e('0x29')]);}_0x384672[_0xcc0e('0x55')]=qs[_0xcc0e('0x56')](_0x43f54c[_0xcc0e('0x4c')]['sort']);_0x384672[_0xcc0e('0x57')]=qs[_0xcc0e('0x4e')](_[_0xcc0e('0x58')](_0x43f54c[_0xcc0e('0x4c')],_0x1bf9e4[_0xcc0e('0x4e')]));_0x384672[_0xcc0e('0x57')][_0xcc0e('0x76')]=_0x3e6c8b['id'];if(_0x43f54c[_0xcc0e('0x4c')][_0xcc0e('0x59')]){_0x384672['where']=_[_0xcc0e('0x5a')](_0x384672[_0xcc0e('0x57')],{'$or':_[_0xcc0e('0x5b')](_0x384672['attributes'],function(_0x1a0d60){var _0x52da99={};_0x52da99[_0x1a0d60]={'$like':'%'+_0x43f54c['query'][_0xcc0e('0x59')]+'%'};return _0x52da99;})});}_0x384672=_[_0xcc0e('0x5a')]({},_0x384672,_0x43f54c['options']);return db[_0xcc0e('0x77')][_0xcc0e('0x28')]({'where':_0x384672[_0xcc0e('0x57')]})[_0xcc0e('0x2d')](function(_0x48224f){_0x30822f[_0xcc0e('0x28')]=_0x48224f;if(_0x43f54c[_0xcc0e('0x4c')]['includeAll']){_0x384672[_0xcc0e('0x63')]=[{'all':!![]}];}return db['Disposition'][_0xcc0e('0x7a')](_0x384672);})[_0xcc0e('0x2d')](function(_0x216c3f){_0x30822f[_0xcc0e('0x5f')]=_0x216c3f;return _0x30822f;});}})['then'](respondWithFilteredResult(_0x23fa6d,_0x384672))[_0xcc0e('0x60')](handleError(_0x23fa6d,null));};exports['removeDispositions']=function(_0x606bf5,_0x287f50){return db[_0xcc0e('0x49')][_0xcc0e('0x64')]({'where':{'id':_0x606bf5['params']['id']}})[_0xcc0e('0x2d')](handleEntityNotFound(_0x287f50,null))[_0xcc0e('0x2d')](function(_0x3fdcba){if(_0x3fdcba){return _0x3fdcba[_0xcc0e('0x7b')](_0x606bf5[_0xcc0e('0x4c')][_0xcc0e('0x7c')]);}})[_0xcc0e('0x2d')](respondWithStatusCode(_0x287f50,null))[_0xcc0e('0x60')](handleError(_0x287f50,null));};exports['addAnswer']=function(_0x5bc8ab,_0x5099a7){if(_0x5bc8ab[_0xcc0e('0x66')]['id']){delete _0x5bc8ab[_0xcc0e('0x66')]['id'];}return db['ChatWebsite'][_0xcc0e('0x64')]({'where':{'id':_0x5bc8ab['params']['id']}})['then'](handleEntityNotFound(_0x5099a7,null))[_0xcc0e('0x2d')](function(_0x4331b1){if(_0x4331b1){_0x5bc8ab[_0xcc0e('0x66')][_0xcc0e('0x76')]=_0x4331b1['id'];return db['CannedAnswer'][_0xcc0e('0x65')](_0x5bc8ab[_0xcc0e('0x66')]);}})[_0xcc0e('0x2d')](respondWithResult(_0x5099a7,null))['catch'](handleError(_0x5099a7,null));};exports[_0xcc0e('0x7d')]=function(_0x4b716a,_0x14b403){var _0x4a7441={'raw':![],'where':{}};var _0x146be8={};var _0x2b1b91={'count':0x0,'rows':[]};return db[_0xcc0e('0x49')][_0xcc0e('0x79')]({'where':{'id':_0x4b716a['params']['id']}})['then'](handleEntityNotFound(_0x14b403,null))[_0xcc0e('0x2d')](function(_0x50aa67){if(_0x50aa67){_0x146be8[_0xcc0e('0x44')]=_['keys'](db[_0xcc0e('0x7e')][_0xcc0e('0x4a')]);_0x146be8[_0xcc0e('0x4c')]=_[_0xcc0e('0x4d')](_0x4b716a[_0xcc0e('0x4c')]);_0x146be8[_0xcc0e('0x4e')]=_[_0xcc0e('0x4f')](_0x146be8[_0xcc0e('0x44')],_0x146be8[_0xcc0e('0x4c')]);_0x4a7441[_0xcc0e('0x50')]=_['intersection'](_0x146be8[_0xcc0e('0x44')],qs[_0xcc0e('0x51')](_0x4b716a['query'][_0xcc0e('0x51')]));_0x4a7441['attributes']=_0x4a7441[_0xcc0e('0x50')][_0xcc0e('0x52')]?_0x4a7441[_0xcc0e('0x50')]:_0x146be8[_0xcc0e('0x44')];if(!_0x4b716a[_0xcc0e('0x4c')]['hasOwnProperty'](_0xcc0e('0x54'))){_0x4a7441['limit']=qs[_0xcc0e('0x27')](_0x4b716a[_0xcc0e('0x4c')][_0xcc0e('0x27')]);_0x4a7441[_0xcc0e('0x29')]=qs[_0xcc0e('0x29')](_0x4b716a[_0xcc0e('0x4c')][_0xcc0e('0x29')]);}_0x4a7441[_0xcc0e('0x55')]=qs['sort'](_0x4b716a[_0xcc0e('0x4c')][_0xcc0e('0x56')]);_0x4a7441['where']=qs[_0xcc0e('0x4e')](_[_0xcc0e('0x58')](_0x4b716a[_0xcc0e('0x4c')],_0x146be8['filters']));_0x4a7441[_0xcc0e('0x57')][_0xcc0e('0x76')]=_0x50aa67['id'];if(_0x4b716a['query'][_0xcc0e('0x59')]){_0x4a7441['where']=_[_0xcc0e('0x5a')](_0x4a7441[_0xcc0e('0x57')],{'$or':_['map'](_0x4a7441[_0xcc0e('0x50')],function(_0x47de4f){var _0x13af4e={};_0x13af4e[_0x47de4f]={'$like':'%'+_0x4b716a[_0xcc0e('0x4c')][_0xcc0e('0x59')]+'%'};return _0x13af4e;})});}_0x4a7441=_[_0xcc0e('0x5a')]({},_0x4a7441,_0x4b716a['options']);return db['CannedAnswer'][_0xcc0e('0x28')]({'where':_0x4a7441['where']})[_0xcc0e('0x2d')](function(_0x4bb3aa){_0x2b1b91[_0xcc0e('0x28')]=_0x4bb3aa;if(_0x4b716a[_0xcc0e('0x4c')][_0xcc0e('0x5e')]){_0x4a7441[_0xcc0e('0x63')]=[{'all':!![]}];}return db[_0xcc0e('0x7e')][_0xcc0e('0x7a')](_0x4a7441);})[_0xcc0e('0x2d')](function(_0x38d333){_0x2b1b91[_0xcc0e('0x5f')]=_0x38d333;return _0x2b1b91;});}})[_0xcc0e('0x2d')](respondWithFilteredResult(_0x14b403,_0x4a7441))[_0xcc0e('0x60')](handleError(_0x14b403,null));};exports[_0xcc0e('0x7f')]=function(_0x458b29,_0x1c92a8){return db[_0xcc0e('0x49')][_0xcc0e('0x64')]({'where':{'id':_0x458b29[_0xcc0e('0x62')]['id']}})[_0xcc0e('0x2d')](handleEntityNotFound(_0x1c92a8,null))[_0xcc0e('0x2d')](function(_0x18e27a){if(_0x18e27a){return _0x18e27a[_0xcc0e('0x7f')](_0x458b29[_0xcc0e('0x4c')]['ids']);}})[_0xcc0e('0x2d')](respondWithStatusCode(_0x1c92a8,null))[_0xcc0e('0x60')](handleError(_0x1c92a8,null));};exports['addLogo']=function(_0xbc0dbe,_0x1fd458){_0xbc0dbe[_0xcc0e('0x66')][_0xcc0e('0x80')]=_0xbc0dbe[_0xcc0e('0x81')][_0xcc0e('0x82')];return db[_0xcc0e('0x49')]['find']({'where':{'id':_0xbc0dbe[_0xcc0e('0x62')]['id']}})[_0xcc0e('0x2d')](handleEntityNotFound(_0x1fd458,null))['then'](saveUpdates(_0xbc0dbe[_0xcc0e('0x66')],null))['then'](respondWithResult(_0x1fd458,null))[_0xcc0e('0x60')](handleError(_0x1fd458,null));};exports[_0xcc0e('0x83')]=function(_0x201c75,_0x331dfe){_0x201c75[_0xcc0e('0x66')][_0xcc0e('0x84')]=_0x201c75[_0xcc0e('0x81')][_0xcc0e('0x82')];return db[_0xcc0e('0x49')][_0xcc0e('0x64')]({'where':{'id':_0x201c75[_0xcc0e('0x62')]['id']}})['then'](handleEntityNotFound(_0x331dfe,null))[_0xcc0e('0x2d')](saveUpdates(_0x201c75[_0xcc0e('0x66')],null))[_0xcc0e('0x2d')](respondWithResult(_0x331dfe,null))[_0xcc0e('0x60')](handleError(_0x331dfe,null));};exports[_0xcc0e('0x85')]=function(_0x1c32e6,_0x3f2a8f){_0x1c32e6[_0xcc0e('0x66')][_0xcc0e('0x86')]=_0x1c32e6[_0xcc0e('0x81')][_0xcc0e('0x82')];return db['ChatWebsite'][_0xcc0e('0x64')]({'where':{'id':_0x1c32e6[_0xcc0e('0x62')]['id']}})[_0xcc0e('0x2d')](handleEntityNotFound(_0x3f2a8f,null))['then'](saveUpdates(_0x1c32e6[_0xcc0e('0x66')],null))['then'](respondWithResult(_0x3f2a8f,null))[_0xcc0e('0x60')](handleError(_0x3f2a8f,null));};exports[_0xcc0e('0x87')]=function(_0x36d06e,_0x2d8ac9){_0x36d06e[_0xcc0e('0x66')]['systemAvatar']=_0x36d06e[_0xcc0e('0x81')][_0xcc0e('0x82')];return db[_0xcc0e('0x49')][_0xcc0e('0x64')]({'where':{'id':_0x36d06e[_0xcc0e('0x62')]['id']}})[_0xcc0e('0x2d')](handleEntityNotFound(_0x2d8ac9,null))[_0xcc0e('0x2d')](saveUpdates(_0x36d06e[_0xcc0e('0x66')],null))[_0xcc0e('0x2d')](respondWithResult(_0x2d8ac9,null))[_0xcc0e('0x60')](handleError(_0x2d8ac9,null));};exports[_0xcc0e('0x88')]=function(_0x439d8a,_0x532d7a){var _0xacd21d=path['join'](config[_0xcc0e('0x89')],_0xcc0e('0x8a'));var _0x4d347b={'where':{'id':_0x439d8a['params']['id']},'attributes':['id',_0xcc0e('0x80')],'raw':!![]};var _0x427389=![];return require(_0xcc0e('0x8b'))[_0xcc0e('0x8c')]()[_0xcc0e('0x2d')](function(_0x287600){if(_0x287600){_0x427389=_0x287600[_0xcc0e('0x8d')];}})[_0xcc0e('0x2d')](function(){return db[_0xcc0e('0x49')][_0xcc0e('0x64')](_0x4d347b);})['then'](handleEntityNotFound(_0x532d7a,null))[_0xcc0e('0x2d')](function(_0x38800e){if(_0x38800e){if(!_[_0xcc0e('0x8e')](_0x38800e[_0xcc0e('0x80')])){if(fs[_0xcc0e('0x8f')](path[_0xcc0e('0x90')](config[_0xcc0e('0x89')],_0xcc0e('0x91'),_0x38800e['sitepic']))&&_0x427389){_0xacd21d=path['join'](config[_0xcc0e('0x89')],_0xcc0e('0x91'),_0x38800e[_0xcc0e('0x80')]);}}return _0x532d7a[_0xcc0e('0x92')](_0xacd21d);}})[_0xcc0e('0x60')](handleError(_0x532d7a,null));};exports[_0xcc0e('0x93')]=function(_0x4a955c,_0x3705cc){var _0x4e6669=path['join'](config[_0xcc0e('0x89')],_0xcc0e('0x94'));var _0x543628={'where':{'id':_0x4a955c[_0xcc0e('0x62')]['id']},'attributes':['id',_0xcc0e('0x84')],'raw':!![]};return db['ChatWebsite'][_0xcc0e('0x64')](_0x543628)['then'](handleEntityNotFound(_0x3705cc,null))[_0xcc0e('0x2d')](function(_0x441a10){if(_0x441a10){if(!_[_0xcc0e('0x8e')](_0x441a10[_0xcc0e('0x84')])){if(fs[_0xcc0e('0x8f')](path['join'](config[_0xcc0e('0x89')],_0xcc0e('0x95'),_0x441a10['agentAvatar']))){_0x4e6669=path[_0xcc0e('0x90')](config[_0xcc0e('0x89')],_0xcc0e('0x95'),_0x441a10[_0xcc0e('0x84')]);}}return _0x3705cc['download'](_0x4e6669);}})[_0xcc0e('0x60')](handleError(_0x3705cc,null));};exports[_0xcc0e('0x96')]=function(_0x284e7d,_0x2f4097){var _0x755e0c=path[_0xcc0e('0x90')](config[_0xcc0e('0x89')],'server/files/images/avatars/customer_avatar.png');var _0x367cdf={'where':{'id':_0x284e7d[_0xcc0e('0x62')]['id']},'attributes':['id',_0xcc0e('0x86'),_0xcc0e('0x97')],'raw':!![]};return db[_0xcc0e('0x49')][_0xcc0e('0x64')](_0x367cdf)[_0xcc0e('0x2d')](handleEntityNotFound(_0x2f4097,null))[_0xcc0e('0x2d')](function(_0x3db7f9){if(_0x3db7f9){if(!_['isNil'](_0x3db7f9[_0xcc0e('0x86')])){if(fs[_0xcc0e('0x8f')](path[_0xcc0e('0x90')](config[_0xcc0e('0x89')],_0xcc0e('0x95'),_0x3db7f9['customerAvatar']))&&_0x3db7f9[_0xcc0e('0x97')]){_0x755e0c=path[_0xcc0e('0x90')](config['root'],_0xcc0e('0x95'),_0x3db7f9[_0xcc0e('0x86')]);}}return _0x2f4097[_0xcc0e('0x92')](_0x755e0c);}})['catch'](handleError(_0x2f4097,null));};exports[_0xcc0e('0x98')]=function(_0x573486,_0x41c7a1){var _0x30dc21=path[_0xcc0e('0x90')](config[_0xcc0e('0x89')],'server/files/images/avatars/system_avatar.png');var _0x49f2de={'where':{'id':_0x573486['params']['id']},'attributes':['id',_0xcc0e('0x99')],'raw':!![]};return db['ChatWebsite'][_0xcc0e('0x64')](_0x49f2de)['then'](handleEntityNotFound(_0x41c7a1,null))[_0xcc0e('0x2d')](function(_0x5c15f1){if(_0x5c15f1){if(!_[_0xcc0e('0x8e')](_0x5c15f1[_0xcc0e('0x99')])){if(fs[_0xcc0e('0x8f')](path[_0xcc0e('0x90')](config['root'],_0xcc0e('0x95'),_0x5c15f1['systemAvatar']))){_0x30dc21=path[_0xcc0e('0x90')](config[_0xcc0e('0x89')],_0xcc0e('0x95'),_0x5c15f1['systemAvatar']);}}return _0x41c7a1[_0xcc0e('0x92')](_0x30dc21);}})[_0xcc0e('0x60')](handleError(_0x41c7a1,null));};function checkWebsiteInterval(_0x28b508){var _0x3f1904=_0x28b508[_0xcc0e('0x9a')];if(!_0x3f1904){return Promise['resolve'](_0x28b508);}var _0x3c12de=_0x28b508['timezone']||undefined;return _0x3f1904[_0xcc0e('0x9b')](_0x3c12de)[_0xcc0e('0x2d')](function(_0x152516){if(!_0x152516){throw new APIOutOfIntervalError();}return _0x28b508;});}exports['notify']=function(_0x2a9990,_0x1ec522){var _0x283638={'body':_0x2a9990[_0xcc0e('0x66')],'channel':_0xcc0e('0x9c')};var _0x475e38=[];var _0x2ae5af=[];var _0x12240b={};var _0x4bcb63=![];if(_0x2a9990['body']['id']){delete _0x2a9990[_0xcc0e('0x66')]['id'];}if(_[_0xcc0e('0x8e')](_0x2a9990[_0xcc0e('0x66')][_0xcc0e('0x9d')])){throw new APIBadRequestError(_0xcc0e('0x9e'));}if(_[_0xcc0e('0x8e')](_0x2a9990[_0xcc0e('0x66')]['mapKey'])){throw new APIBadRequestError(_0xcc0e('0x9f'));}if(_['isEmpty'](_0x2a9990[_0xcc0e('0x66')][_0xcc0e('0x66')])){throw new APIBadRequestError('Body\x20is\x20mandatory');}var _0x21b24e=_0x2a9990['body']['customerIp']&&_0x2a9990[_0xcc0e('0x66')]['referer'];return db[_0xcc0e('0xa0')][_0xcc0e('0x74')]()[_0xcc0e('0x2d')](function(_0x52bc6c){if(!_0x52bc6c){throw new Error('No\x20available\x20attributes');}_0x475e38=Object[_0xcc0e('0x4d')](_0x52bc6c)[_0xcc0e('0x59')](function(_0x41dcf7){return!['createdAt',_0xcc0e('0xa1')]['includes'](_0x41dcf7);});_0x2ae5af=Object['keys'](_0x52bc6c)['filter'](function(_0x582816){return!['createdAt',_0xcc0e('0xa1'),_0xcc0e('0xa2'),_0xcc0e('0xa3')]['includes'](_0x582816);});if(!_[_0xcc0e('0xa4')](_0x2ae5af,_0x2a9990['body'][_0xcc0e('0xa5')])){throw new APIBadRequestError(_0xcc0e('0xa6')+_0x2ae5af[_0xcc0e('0x90')](',\x20'));}_0x12240b[_0x2a9990['body']['mapKey']]=_0x2a9990[_0xcc0e('0x66')]['from'];})[_0xcc0e('0x2d')](function(){return db['ChatWebsite'][_0xcc0e('0x64')]({'where':{'id':_0x2a9990[_0xcc0e('0x62')]['id']},'include':[{'model':db[_0xcc0e('0xa7')],'as':_0xcc0e('0xa8'),'include':[{'model':db['CmContact'],'as':_0xcc0e('0xa9'),'where':_0x12240b,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0xcc0e('0xaa')],'as':_0xcc0e('0xab')},{'model':db['Interval'],'as':_0xcc0e('0x9a'),'include':[{'model':db[_0xcc0e('0x9a')],'as':'Intervals','attributes':['id',_0xcc0e('0xac')],'raw':!![]}]}]});})[_0xcc0e('0x2d')](function(_0x45d843){if(!_0x45d843){throw new APINotFoundError(util['format'](_0xcc0e('0xad'),_0x2a9990[_0xcc0e('0x62')]['id']));}if(_0x21b24e){return checkWebsiteInterval(_0x45d843);}return _0x45d843;})['then'](function(_0x2ef8bb){_0x283638[_0xcc0e('0xae')]=_0x2ef8bb;_0x283638['applications']=_[_0xcc0e('0xaf')](_0x2ef8bb[_0xcc0e('0xab')],[_0xcc0e('0xb0')],[_0xcc0e('0xb1')]);if(_0x283638[_0xcc0e('0xae')][_0xcc0e('0xab')]){delete _0x283638[_0xcc0e('0xae')][_0xcc0e('0xab')];}_0x283638[_0xcc0e('0xb2')]=_0x2ef8bb[_0xcc0e('0xa8')]||{'id':_0x2ef8bb[_0xcc0e('0xa3')]};if(_0x283638[_0xcc0e('0xb2')]&&_0x283638[_0xcc0e('0xb2')][_0xcc0e('0xa9')]['length']){return _0x283638['list'][_0xcc0e('0xa9')][0x0];}var _0x2c8446=_['defaults'](_0x2a9990[_0xcc0e('0x66')],{'firstName':_0x2a9990[_0xcc0e('0x66')][_0xcc0e('0x9d')],'ListId':_0x2ef8bb[_0xcc0e('0xa3')]});_0x2c8446[_0x2a9990[_0xcc0e('0x66')][_0xcc0e('0xa5')]]=_0x2a9990[_0xcc0e('0x66')]['from'];return db['CmContact'][_0xcc0e('0x65')](_0x2c8446,{'fields':_0x475e38,'raw':!![]});})['then'](function(_0x1e3931){_0x283638['contact']=_0x1e3931;var _0x310535=createInteractionObject(_0x2a9990['params']['id'],_0x2a9990['body'],_0x2a9990['headers'],_0x1e3931);var _0x33fede={'ChatWebsiteId':_0x2a9990['params']['id']};if(_0x2a9990[_0xcc0e('0x66')][_0xcc0e('0xb3')]){_0x33fede[_0xcc0e('0xb3')]=_0x2a9990[_0xcc0e('0x66')][_0xcc0e('0xb3')];_0x33fede['closed']=![];return db[_0xcc0e('0xb4')][_0xcc0e('0x64')]({'where':_0x33fede})[_0xcc0e('0x2d')](function(_0x251369){var _0x11f83c=_0x2a9990[_0xcc0e('0x66')][_0xcc0e('0x35')]&&_0x2a9990[_0xcc0e('0x66')][_0xcc0e('0x3b')];if(_0x251369){_0x4bcb63=!![];return _0x251369;}else if(!_0x11f83c&&_0x251369&&_0x251369['closed']){throw new APIConflictError(_0xcc0e('0xb5'));}_0x310535[_0xcc0e('0xb3')]=_0x2a9990[_0xcc0e('0x66')][_0xcc0e('0xb3')];_0x310535[_0xcc0e('0xb6')]=_0x2a9990[_0xcc0e('0x66')][_0xcc0e('0xb6')];return db['ChatInteraction'][_0xcc0e('0x65')](_0x310535);});}_0x33fede['ContactId']=_0x1e3931['id'];if(_0x2a9990[_0xcc0e('0x66')][_0xcc0e('0xb7')]&&_0x2a9990[_0xcc0e('0x66')][_0xcc0e('0xb7')]['id']){_0x33fede['id']=_0x2a9990[_0xcc0e('0x66')][_0xcc0e('0xb7')]['id'];return db['ChatInteraction'][_0xcc0e('0x64')]({'where':_0x33fede})[_0xcc0e('0x2d')](function(_0x3e0545){var _0x2f7b09=_0x2a9990['body']['customerIp']&&_0x2a9990[_0xcc0e('0x66')][_0xcc0e('0x3b')];if(!_0x2f7b09&&_0x3e0545&&_0x3e0545['closed']){throw new APIConflictError(_0xcc0e('0xb5'));}else if(_0x3e0545){_0x4bcb63=!![];return _0x3e0545;}else{return db[_0xcc0e('0xb4')]['create'](_0x310535);}});}return db[_0xcc0e('0xb4')]['create'](_0x310535);})[_0xcc0e('0x2d')](function(_0x155eee){if(!_0x4bcb63){return _0x155eee;}var _0x357de0={'from':(_0x283638['contact'][_0xcc0e('0x39')]||'')+'\x20'+(_0x283638[_0xcc0e('0xb8')][_0xcc0e('0xb9')]||'')};if(_0x2a9990[_0xcc0e('0x66')][_0xcc0e('0xb3')]&&_0x2a9990[_0xcc0e('0x66')][_0xcc0e('0xba')]&&_0x2a9990['body'][_0xcc0e('0xb3')]!=_0x2a9990[_0xcc0e('0x66')][_0xcc0e('0xba')]){_0x357de0[_0xcc0e('0xb3')]=_0x2a9990[_0xcc0e('0x66')][_0xcc0e('0xba')];}return _0x155eee[_0xcc0e('0x71')](_0x357de0);})[_0xcc0e('0x2d')](function(_0x4c6905){_0x283638[_0xcc0e('0xb7')]=_0x4c6905[_0xcc0e('0x2e')]({'plain':!![]});_0x283638[_0xcc0e('0xb7')]['created']=!_0x4bcb63;if(_0x283638[_0xcc0e('0xb7')][_0xcc0e('0xbb')]){if(_0x283638['account'][_0xcc0e('0xbc')]){_0x283638[_0xcc0e('0xbd')][_0xcc0e('0xbe')]({'id':0x0,'priority':_0x283638[_0xcc0e('0xbd')][_0xcc0e('0x52')]+0x1,'app':_0xcc0e('0xbf'),'appdata':'unmanaged','interval':_0xcc0e('0xc0')});}}return db[_0xcc0e('0xc1')][_0xcc0e('0x65')]({'body':_0x2a9990[_0xcc0e('0x66')]['body'],'ChatWebsiteId':_0x2a9990[_0xcc0e('0x62')]['id'],'ChatInteractionId':_0x4c6905['id'],'direction':'in','ContactId':_0x283638[_0xcc0e('0xb8')]['id'],'AttachmentId':_0x2a9990[_0xcc0e('0x66')][_0xcc0e('0xc2')]});})[_0xcc0e('0x2d')](function(_0x587d7d){_0x283638['message']=_0x587d7d;if(!_0x283638[_0xcc0e('0xb7')][_0xcc0e('0xc3')]){return;}return db[_0xcc0e('0xc4')]['find']({'attributes':['id','name'],'where':{'id':_0x283638[_0xcc0e('0xb7')][_0xcc0e('0xc3')]}});})[_0xcc0e('0x2d')](function(_0x5f1a91){if(_0x5f1a91){_0x283638[_0xcc0e('0xbd')][_0xcc0e('0xc5')]({'id':0x0,'priority':0x0,'app':_0xcc0e('0xc6'),'appdata':_0x5f1a91[_0xcc0e('0x30')]+','+(_0x283638[_0xcc0e('0xae')][_0xcc0e('0xc7')]||0xa),'interval':_0xcc0e('0xc0')});_0x283638[_0xcc0e('0xc8')]=!![];}if(!_0x283638[_0xcc0e('0xb7')][_0xcc0e('0xc9')]){return;}return db[_0xcc0e('0xca')]['find']({'attributes':['id',_0xcc0e('0x30')],'where':{'id':_0x283638[_0xcc0e('0xb7')][_0xcc0e('0xc9')]}});})[_0xcc0e('0x2d')](function(_0x111412){if(_0x111412){_0x283638['applications'][_0xcc0e('0xc5')]({'id':0x0,'priority':0x1,'app':_0xcc0e('0xcb'),'appdata':_0x111412[_0xcc0e('0x30')]+','+(_0x283638[_0xcc0e('0xae')][_0xcc0e('0xcc')]||0x12c),'interval':_0xcc0e('0xc0')});}return respondWithRpcPromise(_0xcc0e('0xcd'),_0xcc0e('0xce'),_0x283638);})['then'](function(_0x35f350){respondWithRpcPromise(_0xcc0e('0xcf'),_0xcc0e('0xcf'),{'event':_0xcc0e('0xd0'),'message':_0x35f350},client9002);return _0x35f350;})[_0xcc0e('0x2d')](respondWithResult(_0x1ec522,null))[_0xcc0e('0x60')](APIHandleError(_0x1ec522));};exports[_0xcc0e('0xd1')]=function(_0x3a66c8,_0x58edcd){var _0x10e42b,_0x419faa,_0x2fa982;var _0x4eb760=[];var _0x8ee590={};var _0x1bbd1d=_0x3a66c8[_0xcc0e('0xd2')]||[];var _0x434f93=[];var _0x580d70;return db[_0xcc0e('0xa0')]['describe']()[_0xcc0e('0x2d')](function(_0x2d1582){if(!_0x2d1582){throw new db[(_0xcc0e('0xd3'))][(_0xcc0e('0xd4'))](_0xcc0e('0xd5'));}_0x4eb760=_['difference'](_['keys'](_0x2d1582),[_0xcc0e('0xd6'),_0xcc0e('0xa1'),_0xcc0e('0xa2'),_0xcc0e('0xa3')]);if(_0x3a66c8[_0xcc0e('0x66')]['id']){delete _0x3a66c8[_0xcc0e('0x66')]['id'];}if(_[_0xcc0e('0x8e')](_0x3a66c8[_0xcc0e('0x66')]['from'])){throw _0x58edcd[_0xcc0e('0x24')](0x1f4)[_0xcc0e('0xd7')](new db[(_0xcc0e('0xd3'))][(_0xcc0e('0xd4'))]('from\x20is\x20mandatory'));}if(_[_0xcc0e('0x8e')](_0x3a66c8[_0xcc0e('0x66')]['body'])||_0x3a66c8[_0xcc0e('0x66')][_0xcc0e('0x66')]===''){throw _0x58edcd[_0xcc0e('0x24')](0x1f4)['send'](new db[(_0xcc0e('0xd3'))][(_0xcc0e('0xd4'))](_0xcc0e('0xd8')));}if(_[_0xcc0e('0x8e')](_0x3a66c8[_0xcc0e('0x66')]['mapKeyOffline'])){throw _0x58edcd['status'](0x1f4)[_0xcc0e('0xd7')](new db[(_0xcc0e('0xd3'))][(_0xcc0e('0xd4'))](_0xcc0e('0xd9')+_0x4eb760));}if(!_[_0xcc0e('0xa4')](_0x4eb760,_0x3a66c8[_0xcc0e('0x66')][_0xcc0e('0xda')])){throw _0x58edcd[_0xcc0e('0x24')](0x1f4)['send'](new db[(_0xcc0e('0xd3'))][(_0xcc0e('0xd4'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4eb760));}_0x8ee590[_0x3a66c8[_0xcc0e('0x66')]['mapKeyOffline']]=_0x3a66c8[_0xcc0e('0x66')][_0xcc0e('0x9d')];})['then'](function(){return db[_0xcc0e('0x49')]['find']({'where':{'id':_0x3a66c8[_0xcc0e('0x62')]['id']},'include':[{'model':db[_0xcc0e('0xa7')],'as':_0xcc0e('0xa8')},{'model':db[_0xcc0e('0xdb')],'as':'MailAccount'}]});})[_0xcc0e('0x2d')](handleEntityNotFound(_0x58edcd,null))[_0xcc0e('0x2d')](function(_0x12e0d3){if(_0x12e0d3&&_0x12e0d3[_0xcc0e('0xa8')]){_0x419faa=_0x12e0d3;var _0x54a7d4=_[_0xcc0e('0xdc')](_0x3a66c8[_0xcc0e('0x66')],{'firstName':_0x3a66c8['body'][_0xcc0e('0x9d')],'phone':_0x3a66c8[_0xcc0e('0x66')]['from'],'ListId':_0x12e0d3[_0xcc0e('0xa3')]});_0x54a7d4[_0x3a66c8[_0xcc0e('0x66')][_0xcc0e('0xda')]]=_0x3a66c8[_0xcc0e('0x66')]['from'];return db[_0xcc0e('0xa0')][_0xcc0e('0xdd')]({'where':_0x8ee590,'defaults':_0x54a7d4});}})[_0xcc0e('0xde')](function(_0x3a7013){if(_0x3a7013){_0x2fa982=_0x3a7013;var _0x34e1f7=fs['readFileSync'](path[_0xcc0e('0x90')](config[_0xcc0e('0x89')],_0xcc0e('0xdf')),_0xcc0e('0xe0'));var _0x43e5e=ejs[_0xcc0e('0xe1')](_0x34e1f7,{'body':_[_0xcc0e('0xe2')](_0x3a66c8['body'][_0xcc0e('0x66')]),'bodyTitle':_0x419faa['offlineMessageBody']});return db[_0xcc0e('0xe3')][_0xcc0e('0x65')]({'body':_0x43e5e,'plainBody':htmlToText[_0xcc0e('0xe4')](_0x43e5e),'ContactId':_0x3a7013['id'],'ChatWebsiteId':_0x419faa['id']});}})[_0xcc0e('0x2d')](function(_0x3a72d9){_0x580d70=_0x3a72d9;if(_0x1bbd1d[_0xcc0e('0x52')]){var _0x2f8e85=_0x1bbd1d['map'](function(_0x254024){return{'name':_0x254024[_0xcc0e('0xe5')],'basename':_0x254024['filename'],'type':_0x254024[_0xcc0e('0xe6')],'ChatOfflineMessageId':_0x3a72d9['id']};});_0x434f93=_0x2f8e85[_0xcc0e('0x5b')](_0x58c9b4=>{var _0x18c9e1={'filename':_0x58c9b4[_0xcc0e('0x30')],'path':path[_0xcc0e('0x90')](config['root'],_0xcc0e('0xe7'),'files',_0xcc0e('0xe8'),_0xcc0e('0xe9'),_0x58c9b4[_0xcc0e('0xea')])};return _0x18c9e1;});if(!_0x419faa[_0xcc0e('0xeb')]){return db[_0xcc0e('0xec')][_0xcc0e('0xed')](function(_0x1bd1fd){return db[_0xcc0e('0xee')]['bulkCreate'](_0x2f8e85,{'transaction':_0x1bd1fd});});}}})[_0xcc0e('0x2d')](function(){if(_0x580d70){_0x10e42b=_0x580d70;return db[_0xcc0e('0xdb')][_0xcc0e('0x79')]({'where':{'service':!![]},'include':[{'model':db[_0xcc0e('0xef')],'as':_0xcc0e('0xf0'),'raw':!![],'include':[{'model':db[_0xcc0e('0xf1')],'as':_0xcc0e('0xf1'),'raw':!![]}]}]});}})[_0xcc0e('0x2d')](function(_0x3e809d){if(_0x3e809d&&_0x3e809d['Smtp']&&_0x419faa[_0xcc0e('0xf2')]&&_0x419faa[_0xcc0e('0xf3')]){var _0x400b39=_0x3e809d[_0xcc0e('0xf4')]();return respondWithRpcPromise(_0xcc0e('0xf5'),'sendMail',{'account':_0x400b39,'message':{'from':util[_0xcc0e('0x3e')](_0xcc0e('0xf6'),_0x3e809d[_0xcc0e('0x30')],_0x3e809d['email']||_0x3e809d[_0xcc0e('0xf0')][_0xcc0e('0x6a')]),'to':_0x419faa[_0xcc0e('0xf3')],'subject':_0x419faa[_0xcc0e('0xf7')],'html':_0x10e42b[_0xcc0e('0x66')],'attachments':_0x434f93}},client9003)[_0xcc0e('0x2d')](function(){return _0x10e42b;})['catch'](function(_0x1d7444){logger[_0xcc0e('0x1e')](_0x1d7444);});}})[_0xcc0e('0x2d')](function(){if(_0x419faa&&_0x419faa[_0xcc0e('0xeb')]&&_0x419faa[_0xcc0e('0xf8')]){var _0x31fb04=[];if(_0x1bbd1d[_0xcc0e('0x52')]){_0x31fb04=_0x1bbd1d[_0xcc0e('0x5b')](function(_0x1f0f96){return{'name':_0x1f0f96[_0xcc0e('0xe5')],'basename':_0x1f0f96['filename'],'type':_0x1f0f96[_0xcc0e('0xe6')],'ChatOfflineMessageId':_0x580d70['id']};});}var _0x1c05f5;if(!_['isNil'](_0x419faa['subjectOffline'])){var _0x4e106b=_[_0xcc0e('0x5b')](_0x3a66c8[_0xcc0e('0x66')],function(_0x481bd9){return _0x481bd9;});var _0x4f0402=_['toPairsIn'](_0x4e106b)[0x0];var _0x5834b3=_['mapValues'](_0x4f0402,function(_0x1e1302){return _0x1e1302;});_0x1c05f5=_0x5834b3[0x1][_0x419faa[_0xcc0e('0xf9')]];}var _0x16e52f={'from':_0x2fa982[_0xcc0e('0xfa')],'firstName':_0x2fa982[_0xcc0e('0x39')],'lastName':_0x2fa982[_0xcc0e('0xb9')],'mapKey':_0xcc0e('0xfa'),'message':{'from':_0x2fa982[_0xcc0e('0xfa')],'to':_0x419faa['MailAccount']['email'],'cc':'','subject':_['isNil'](_0x1c05f5)?_0x419faa[_0xcc0e('0xf7')]:_0x1c05f5,'messageId':'','sentAt':new Date(),'attach':_0x31fb04['length'],'attachments':_0x31fb04,'originChannel':_0xcc0e('0xfb'),'ChatWebsiteId':_0x419faa['id'],'ChatOfflineMessageId':_0x10e42b['id'],'originTo':_0x419faa[_0xcc0e('0xdb')]['email']},'body':_0x10e42b[_0xcc0e('0x66')]};var _0x2cc7f2={'account':{'id':_0x419faa['MailAccountId']},'body':_0x16e52f,'log':_0xcc0e('0xfc')};return respondWithRpcPromise(_0xcc0e('0xfc'),_0xcc0e('0xfd'),_0x2cc7f2,client9001)[_0xcc0e('0x2d')](function(){return _0x10e42b;})[_0xcc0e('0x60')](function(_0x2c98a0){logger[_0xcc0e('0x1e')](_0x2c98a0);});}return;})[_0xcc0e('0x2d')](function(){if(_0x10e42b){return _0x10e42b;}})[_0xcc0e('0x2d')](respondWithResult(_0x58edcd,null))['catch'](function(){for(var _0xff32fd of _0x1bbd1d){var _0x270b42=path['join'](config[_0xcc0e('0x89')],_0xcc0e('0xe7'),_0xcc0e('0xd2'),_0xcc0e('0xe8'),_0xcc0e('0xe9'),_0xff32fd['filename']);fs_extra[_0xcc0e('0xfe')](_0x270b42)[_0xcc0e('0x60')](function(_0x254dd7){logger['error'](_0xcc0e('0xff'),_0x270b42,_0x254dd7);});}});};exports[_0xcc0e('0x100')]=function(_0x24d050,_0x25ef91){return db[_0xcc0e('0xb4')][_0xcc0e('0x64')]({'where':{'id':_0x24d050[_0xcc0e('0x62')]['id']}})[_0xcc0e('0x2d')](handleEntityNotFound(_0x25ef91,null))[_0xcc0e('0x2d')](function(_0x12e6a9){if(_0x12e6a9){return _0x12e6a9[_0xcc0e('0x100')](_0x24d050[_0xcc0e('0x66')][_0xcc0e('0x7c')],_[_0xcc0e('0x101')](_0x24d050[_0xcc0e('0x66')],[_0xcc0e('0x7c'),'id'])||{});}})['then'](respondWithResult(_0x25ef91,null))['catch'](handleError(_0x25ef91,null));};exports[_0xcc0e('0x102')]=function(_0x4a1b45,_0x2adc33){var _0x52371a={'raw':![],'where':{}};var _0x1fe811={};var _0x2a731c={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xcc0e('0x79')]({'where':{'id':_0x4a1b45['params']['id']}})[_0xcc0e('0x2d')](handleEntityNotFound(_0x2adc33,null))[_0xcc0e('0x2d')](function(_0x4e75cc){if(_0x4e75cc){_0x1fe811[_0xcc0e('0x44')]=_[_0xcc0e('0x4d')](db[_0xcc0e('0xb4')]['rawAttributes']);_0x1fe811['query']=_['keys'](_0x4a1b45[_0xcc0e('0x4c')]);_0x1fe811['filters']=_[_0xcc0e('0x4f')](_0x1fe811[_0xcc0e('0x44')],_0x1fe811['query']);_0x52371a[_0xcc0e('0x50')]=_['intersection'](_0x1fe811[_0xcc0e('0x44')],qs['fields'](_0x4a1b45[_0xcc0e('0x4c')][_0xcc0e('0x51')]));_0x52371a[_0xcc0e('0x50')]=_0x52371a[_0xcc0e('0x50')]['length']?_0x52371a[_0xcc0e('0x50')]:_0x1fe811[_0xcc0e('0x44')];if(!_0x4a1b45['query'][_0xcc0e('0x53')](_0xcc0e('0x54'))){_0x52371a[_0xcc0e('0x27')]=qs[_0xcc0e('0x27')](_0x4a1b45[_0xcc0e('0x4c')][_0xcc0e('0x27')]);_0x52371a['offset']=qs[_0xcc0e('0x29')](_0x4a1b45[_0xcc0e('0x4c')][_0xcc0e('0x29')]);}_0x52371a[_0xcc0e('0x55')]=qs[_0xcc0e('0x56')](_0x4a1b45[_0xcc0e('0x4c')][_0xcc0e('0x56')]);_0x52371a[_0xcc0e('0x57')]=qs[_0xcc0e('0x4e')](_[_0xcc0e('0x58')](_0x4a1b45[_0xcc0e('0x4c')],_0x1fe811[_0xcc0e('0x4e')]));_0x52371a['where'][_0xcc0e('0x76')]=_0x4e75cc['id'];if(_0x4a1b45[_0xcc0e('0x4c')][_0xcc0e('0x59')]){_0x52371a[_0xcc0e('0x57')]=_[_0xcc0e('0x5a')](_0x52371a['where'],{'$or':_[_0xcc0e('0x5b')](_0x52371a[_0xcc0e('0x50')],function(_0x438633){var _0x3562ec={};_0x3562ec[_0x438633]={'$like':'%'+_0x4a1b45[_0xcc0e('0x4c')]['filter']+'%'};return _0x3562ec;})});}_0x52371a=_['merge']({},_0x52371a,_0x4a1b45['options']);return db[_0xcc0e('0xb4')]['count']({'where':_0x52371a['where']})[_0xcc0e('0x2d')](function(_0x26a172){_0x2a731c['count']=_0x26a172;if(_0x4a1b45['query'][_0xcc0e('0x5e')]){_0x52371a[_0xcc0e('0x63')]=[{'model':db[_0xcc0e('0xa0')],'as':_0xcc0e('0x103'),'required':![]},{'model':db[_0xcc0e('0xc4')],'as':_0xcc0e('0x104'),'attributes':['name',_0xcc0e('0x105'),'internal'],'required':![]},{'model':db[_0xcc0e('0x106')],'as':_0xcc0e('0x107'),'attributes':['id',_0xcc0e('0x30'),'color'],'where':_0x4a1b45['query']['tag']?{'id':_0x4a1b45[_0xcc0e('0x4c')]['tag']}:undefined,'required':_0x4a1b45[_0xcc0e('0x4c')][_0xcc0e('0x108')]?!![]:![]}];}return db['ChatInteraction']['findAll'](_0x52371a);})['then'](function(_0x25441b){_0x2a731c[_0xcc0e('0x5f')]=_0x25441b;return _0x2a731c;});}})[_0xcc0e('0x2d')](respondWithFilteredResult(_0x2adc33,_0x52371a))[_0xcc0e('0x60')](handleError(_0x2adc33,null));};exports[_0xcc0e('0x109')]=function(_0x42046d,_0x8073d5){var _0x199ab2=0x0;var _0x401831=0x0;var _0x179110=![];var _0x472eb2;var _0x4a239f;return db['ChatWebsite'][_0xcc0e('0x64')]({'where':{'id':_0x42046d[_0xcc0e('0x62')]['id']},'include':[{'model':db[_0xcc0e('0x9a')],'as':_0xcc0e('0x9a'),'include':[{'model':db['Interval'],'as':_0xcc0e('0x10a'),'attributes':['id',_0xcc0e('0xac')]}]}]})['then'](handleEntityNotFound(_0x8073d5,null))['then'](function(_0x35091b){if(_0x35091b){_0x472eb2=_0x35091b;return _0x35091b[_0xcc0e('0x10b')]({'raw':!![]});}})['then'](function(_0x4224b8){if(_0x472eb2){if(_0x4224b8){_0x4a239f=_0x4224b8;}}return require(_0xcc0e('0x8b'))[_0xcc0e('0x8c')]();})[_0xcc0e('0x2d')](function(_0x18096f){if(_0x18096f){_0x401831=_0x18096f['virtual'];_0x179110=_0x18096f[_0xcc0e('0x8d')];}})[_0xcc0e('0x2d')](function(){return db[_0xcc0e('0xb4')][_0xcc0e('0x28')]({'where':{'closed':![]}});})[_0xcc0e('0x2d')](function(_0x3d567c){_0x199ab2=_0x3d567c;if(_0x401831&&_0x3d567c>_0x401831){return db[_0xcc0e('0x10c')][_0xcc0e('0x79')]({'where':{'id':0x1}})['then'](function(_0x3b52d0){if(_0x3b52d0){_0x3b52d0[_0xcc0e('0x10d')](_0xcc0e('0x10e'));}});}})[_0xcc0e('0x2d')](function(){var _0x300ff0=_0x472eb2['Interval'];var _0xa02485=_0x472eb2[_0xcc0e('0x10f')]||undefined;return _0x300ff0?_0x300ff0[_0xcc0e('0x9b')](_0xa02485):!![];})[_0xcc0e('0x2d')](function(_0x200dec){var _0x1bdb49=fs[_0xcc0e('0x110')](path[_0xcc0e('0x90')](config['root'],'server/files/chat/iframe.ejs'),_0xcc0e('0xe0'));var _0x42d1a7=_0xcc0e('0x111');var _0x17ed0f=![];var _0x3d7024,_0x1fb135;if(_0x42046d[_0xcc0e('0x112')][_0xcc0e('0x3b')]){_0x3d7024=new URL(_0x42046d[_0xcc0e('0x112')]['referer'])[_0xcc0e('0x113')];}else if(_0x42046d[_0xcc0e('0x112')]['origin']){_0x3d7024=new URL(_0x42046d[_0xcc0e('0x112')][_0xcc0e('0x113')])['origin'];}else{_0x3d7024=_0xcc0e('0x114');}_0x1fb135=typeof _0x472eb2['address'][_0xcc0e('0x38')](',')['find'](function(_0x21ba76){return wildcardUtils[_0xcc0e('0x115')](_0x21ba76,_0x3d7024);})!==_0xcc0e('0x26');var _0x3e526a={'chatVersion':_0x42d1a7,'chatWebsiteAddressOrigin':_0x1fb135?_0x3d7024:_0x472eb2['address'],'remote':_0x472eb2[_0xcc0e('0x116')],'query':querystring[_0xcc0e('0x1d')](_['merge'](_0x472eb2[_0xcc0e('0x2e')]({'plain':!![]}),{'customerIp':_0x42046d['headers']['x-forwarded-for']||_0x42046d[_0xcc0e('0x112')][_0xcc0e('0x117')]||_0x42046d[_0xcc0e('0x118')][_0xcc0e('0x119')]||_0x42046d['ip'],'referer':_0x42046d[_0xcc0e('0x112')][_0xcc0e('0x3b')],'openedInteractions':_0x199ab2,'maxInteractions':_0x401831,'virtual':_0x179110[_0xcc0e('0x11a')],'online':_0x200dec,'custom':_0x179110,'address':_0x1fb135?_0x3d7024:null}))[_0xcc0e('0x11b')](/'/g,'\x5c\x27')};_0x8073d5[_0xcc0e('0xd7')](ejs[_0xcc0e('0xe1')](Mustache[_0xcc0e('0xe1')](_0x1bdb49,_0x3e526a),{'proactiveActions':_0x4a239f,'alignment':_0x472eb2[_0xcc0e('0x11c')],'verticalAlignment':_0x472eb2[_0xcc0e('0x11d')],'div_color':_0x472eb2[_0xcc0e('0x11e')],'labelText':_0x472eb2[_0xcc0e('0x11f')],'text_color':_0x472eb2['textColor'],'text_button_color':_0x472eb2['textButtonColor'],'button_color':_0x472eb2[_0xcc0e('0x120')],'background_color':_0x472eb2[_0xcc0e('0x121')],'hideWhenOffline':_0x472eb2[_0xcc0e('0x122')],'intervalId':_0x472eb2[_0xcc0e('0x123')],'isDevelopment':_0x17ed0f,'chatVersion':_0x42d1a7}));})['catch'](handleError(_0x8073d5,null));};exports['addApplications']=function(_0x450da4,_0x4d4671){var _0x229850=_0x450da4['params']['id'];var _0x55b076=_0x450da4[_0xcc0e('0x66')];var _0x5df728=0xc8;var _0x4f0f59=null;return db['sequelize'][_0xcc0e('0xed')]({'isolationLevel':db[_0xcc0e('0xec')][_0xcc0e('0x124')][_0xcc0e('0x125')][_0xcc0e('0x126')]},function(_0x4efd57){return db[_0xcc0e('0x49')]['findOne']({'where':{'id':_0x229850},'transaction':_0x4efd57})[_0xcc0e('0x2d')](function(_0x5a8357){if(_0x5a8357){return db['ChatApplication']['destroy']({'where':{'ChatWebsiteId':_0x229850},'transaction':_0x4efd57})['then'](function(){var _0x280958=_[_0xcc0e('0x5b')](_0x55b076,function(_0x1d2e86){_0x1d2e86[_0xcc0e('0x76')]=_0x229850;return _0x1d2e86;});return db['ChatApplication'][_0xcc0e('0x127')](_0x280958,{'transaction':_0x4efd57});});}else{_0x5df728=0x194;_0x4f0f59=[];}});})['then'](function(){if(_0x5df728!==0x194){return db[_0xcc0e('0xaa')][_0xcc0e('0x128')]({'where':{'ChatWebsiteId':_0x229850},'order':_0xcc0e('0xb0')})[_0xcc0e('0x2d')](function(_0x4f0e5e){_0x4f0f59=_0x4f0e5e;});}})['catch'](function(_0x53a2e8){_0x5df728=0x1f4;logger[_0xcc0e('0x1e')](_0x53a2e8['stack']);if(_0x53a2e8['name']){delete _0x53a2e8[_0xcc0e('0x30')];}_0x4f0f59=_0x53a2e8;})[_0xcc0e('0x129')](function(){if(_0x4f0f59===null){_0x4d4671[_0xcc0e('0x22')](_0x5df728);}else{if(_0x5df728===0x1f4){_0x4d4671['status'](_0x5df728)[_0xcc0e('0xd7')](_0x4f0f59);}else{_0x4d4671[_0xcc0e('0x24')](_0x5df728)[_0xcc0e('0x25')](_0x4f0f59);}}});};exports['getApplications']=function(_0x241121,_0x224fc3){var _0x5563d7={};var _0x59dc84={};var _0x44e912;var _0x345b02;return db[_0xcc0e('0x49')][_0xcc0e('0x79')]({'where':{'id':_0x241121[_0xcc0e('0x62')]['id']}})[_0xcc0e('0x2d')](handleEntityNotFound(_0x224fc3,null))[_0xcc0e('0x2d')](function(_0x2525d3){if(_0x2525d3){_0x44e912=_0x2525d3;_0x59dc84[_0xcc0e('0x44')]=_[_0xcc0e('0x4d')](db['ChatApplication']['rawAttributes']);_0x59dc84[_0xcc0e('0x4c')]=_['keys'](_0x241121[_0xcc0e('0x4c')]);_0x59dc84['filters']=_[_0xcc0e('0x4f')](_0x59dc84[_0xcc0e('0x44')],_0x59dc84[_0xcc0e('0x4c')]);_0x5563d7[_0xcc0e('0x50')]=_['intersection'](_0x59dc84['model'],qs[_0xcc0e('0x51')](_0x241121[_0xcc0e('0x4c')][_0xcc0e('0x51')]));_0x5563d7[_0xcc0e('0x50')]=_0x5563d7[_0xcc0e('0x50')][_0xcc0e('0x52')]?_0x5563d7[_0xcc0e('0x50')]:_0x59dc84[_0xcc0e('0x44')];_0x5563d7[_0xcc0e('0x55')]=qs[_0xcc0e('0x56')](_0x241121[_0xcc0e('0x4c')]['sort']);_0x5563d7[_0xcc0e('0x57')]=qs[_0xcc0e('0x4e')](_[_0xcc0e('0x58')](_0x241121['query'],_0x59dc84[_0xcc0e('0x4e')]));if(_0x241121['query'][_0xcc0e('0x59')]){_0x5563d7[_0xcc0e('0x57')]=_[_0xcc0e('0x5a')](_0x5563d7[_0xcc0e('0x57')],{'$or':_[_0xcc0e('0x5b')](_0x5563d7[_0xcc0e('0x50')],function(_0x39549f){var _0x28aca9={};_0x28aca9[_0x39549f]={'$like':'%'+_0x241121['query'][_0xcc0e('0x59')]+'%'};return _0x28aca9;})});}_0x5563d7=_[_0xcc0e('0x5a')]({},_0x5563d7,_0x241121[_0xcc0e('0x5d')]);return _0x44e912[_0xcc0e('0x12a')](_0x5563d7);}})[_0xcc0e('0x2d')](function(_0x41e837){if(_0x41e837){_0x345b02=_0x41e837[_0xcc0e('0x52')];if(!_0x241121[_0xcc0e('0x4c')]['hasOwnProperty'](_0xcc0e('0x54'))){_0x5563d7[_0xcc0e('0x27')]=qs['limit'](_0x241121[_0xcc0e('0x4c')][_0xcc0e('0x27')]);_0x5563d7['offset']=qs[_0xcc0e('0x29')](_0x241121[_0xcc0e('0x4c')][_0xcc0e('0x29')]);}return _0x44e912[_0xcc0e('0x12a')](_0x5563d7);}})[_0xcc0e('0x2d')](function(_0x16b856){if(_0x16b856){return _0x16b856?{'count':_0x345b02,'rows':_0x16b856}:null;}})[_0xcc0e('0x2d')](respondWithResult(_0x224fc3,null))[_0xcc0e('0x60')](handleError(_0x224fc3,null));};exports[_0xcc0e('0x12b')]=function(_0xfb1d79,_0x5e237e){return db[_0xcc0e('0x12c')][_0xcc0e('0x64')]({'where':{'id':_0xfb1d79[_0xcc0e('0x62')]['id']}})[_0xcc0e('0x2d')](handleEntityNotFound(_0x5e237e,null))[_0xcc0e('0x2d')](function(_0x17039d){if(_0x17039d){return _0x17039d[_0xcc0e('0x12b')](_0xfb1d79[_0xcc0e('0x66')][_0xcc0e('0x7c')],_[_0xcc0e('0x101')](_0xfb1d79[_0xcc0e('0x66')],['ids','id'])||{});}})[_0xcc0e('0x2d')](respondWithResult(_0x5e237e,null))[_0xcc0e('0x60')](handleError(_0x5e237e,null));};exports[_0xcc0e('0x10b')]=function(_0x19c527,_0x244cc3){var _0x5c0bf6={};var _0x225cf2={};var _0x1b9e08;var _0x32829b;return db[_0xcc0e('0x49')][_0xcc0e('0x79')]({'where':{'id':_0x19c527[_0xcc0e('0x62')]['id']}})[_0xcc0e('0x2d')](handleEntityNotFound(_0x244cc3,null))[_0xcc0e('0x2d')](function(_0x4796a8){if(_0x4796a8){_0x1b9e08=_0x4796a8;_0x225cf2[_0xcc0e('0x44')]=_[_0xcc0e('0x4d')](db[_0xcc0e('0x12d')]['rawAttributes']);_0x225cf2[_0xcc0e('0x4c')]=_['keys'](_0x19c527[_0xcc0e('0x4c')]);_0x225cf2[_0xcc0e('0x4e')]=_[_0xcc0e('0x4f')](_0x225cf2[_0xcc0e('0x44')],_0x225cf2[_0xcc0e('0x4c')]);_0x5c0bf6['attributes']=_[_0xcc0e('0x4f')](_0x225cf2[_0xcc0e('0x44')],qs[_0xcc0e('0x51')](_0x19c527['query']['fields']));_0x5c0bf6['attributes']=_0x5c0bf6[_0xcc0e('0x50')][_0xcc0e('0x52')]?_0x5c0bf6[_0xcc0e('0x50')]:_0x225cf2[_0xcc0e('0x44')];_0x5c0bf6[_0xcc0e('0x55')]=qs['sort'](_0x19c527[_0xcc0e('0x4c')][_0xcc0e('0x56')]);_0x5c0bf6['where']=qs[_0xcc0e('0x4e')](_[_0xcc0e('0x58')](_0x19c527[_0xcc0e('0x4c')],_0x225cf2[_0xcc0e('0x4e')]));if(_0x19c527['query'][_0xcc0e('0x59')]){_0x5c0bf6[_0xcc0e('0x57')]=_[_0xcc0e('0x5a')](_0x5c0bf6[_0xcc0e('0x57')],{'$or':_['map'](_0x5c0bf6[_0xcc0e('0x50')],function(_0x81290d){var _0x2e4a31={};_0x2e4a31[_0x81290d]={'$like':'%'+_0x19c527['query'][_0xcc0e('0x59')]+'%'};return _0x2e4a31;})});}_0x5c0bf6=_['merge']({},_0x5c0bf6,_0x19c527[_0xcc0e('0x5d')]);return _0x1b9e08[_0xcc0e('0x10b')](_0x5c0bf6);}})[_0xcc0e('0x2d')](function(_0x5d823b){if(_0x5d823b){_0x32829b=_0x5d823b['length'];if(!_0x19c527['query']['hasOwnProperty'](_0xcc0e('0x54'))){_0x5c0bf6[_0xcc0e('0x27')]=qs[_0xcc0e('0x27')](_0x19c527[_0xcc0e('0x4c')][_0xcc0e('0x27')]);_0x5c0bf6[_0xcc0e('0x29')]=qs[_0xcc0e('0x29')](_0x19c527[_0xcc0e('0x4c')][_0xcc0e('0x29')]);}return _0x1b9e08['getProactiveActions'](_0x5c0bf6);}})[_0xcc0e('0x2d')](function(_0x1b8ac3){if(_0x1b8ac3){return _0x1b8ac3?{'count':_0x32829b,'rows':_0x1b8ac3}:null;}})['then'](respondWithResult(_0x244cc3,null))[_0xcc0e('0x60')](handleError(_0x244cc3,null));};exports[_0xcc0e('0x12e')]=function(_0x20a27e,_0xf2264f){var _0x19273b=_0x20a27e[_0xcc0e('0x4c')][_0xcc0e('0x12f')]==='false'?_0xcc0e('0x130'):'onlineForm';return db['ChatWebsite'][_0xcc0e('0x64')]({'attributes':['id',_0x19273b],'where':{'id':_0x20a27e[_0xcc0e('0x62')]['id']}})[_0xcc0e('0x2d')](handleEntityNotFound(_0xf2264f,null))['then'](function(_0x3072ee){if(_0x3072ee){var _0x4f1287=_0x3072ee[_0x19273b];var _0x28d769=_0x4f1287&&_0x4f1287[_0xcc0e('0x131')]?_0x4f1287[_0xcc0e('0x131')]:[];_0xf2264f[_0xcc0e('0xd7')]({'fromKey':_[_0xcc0e('0x8e')](_0x4f1287[_0xcc0e('0x132')])?undefined:_0x4f1287[_0xcc0e('0x132')],'count':_0x28d769['length'],'rows':_0x28d769});}})[_0xcc0e('0x60')](handleError(_0xf2264f,null));};exports[_0xcc0e('0x133')]=function(_0x2d21f9,_0x45c4f4){var _0x135d74={'raw':![],'where':{}};var _0x3d5a71={};var _0x1871b4={'count':0x0,'rows':[]};return db[_0xcc0e('0x49')][_0xcc0e('0x79')]({'where':{'id':_0x2d21f9[_0xcc0e('0x62')]['id']}})[_0xcc0e('0x2d')](handleEntityNotFound(_0x45c4f4,null))[_0xcc0e('0x2d')](function(_0x5d8662){if(_0x5d8662){_0x3d5a71[_0xcc0e('0x44')]=_[_0xcc0e('0x4d')](db[_0xcc0e('0xe3')]['rawAttributes']);_0x3d5a71['query']=_[_0xcc0e('0x4d')](_0x2d21f9[_0xcc0e('0x4c')]);_0x3d5a71[_0xcc0e('0x4e')]=_[_0xcc0e('0x4f')](_0x3d5a71[_0xcc0e('0x44')],_0x3d5a71['query']);_0x135d74['attributes']=_[_0xcc0e('0x4f')](_0x3d5a71['model'],qs[_0xcc0e('0x51')](_0x2d21f9[_0xcc0e('0x4c')]['fields']));_0x135d74[_0xcc0e('0x50')]=_0x135d74['attributes'][_0xcc0e('0x52')]?_0x135d74[_0xcc0e('0x50')]:_0x3d5a71[_0xcc0e('0x44')];if(!_0x2d21f9[_0xcc0e('0x4c')]['hasOwnProperty'](_0xcc0e('0x54'))){_0x135d74[_0xcc0e('0x27')]=qs[_0xcc0e('0x27')](_0x2d21f9[_0xcc0e('0x4c')][_0xcc0e('0x27')]);_0x135d74[_0xcc0e('0x29')]=qs[_0xcc0e('0x29')](_0x2d21f9[_0xcc0e('0x4c')][_0xcc0e('0x29')]);}_0x135d74[_0xcc0e('0x55')]=qs[_0xcc0e('0x56')](_0x2d21f9[_0xcc0e('0x4c')][_0xcc0e('0x56')]);_0x135d74[_0xcc0e('0x57')]=qs['filters'](_[_0xcc0e('0x58')](_0x2d21f9[_0xcc0e('0x4c')],_0x3d5a71[_0xcc0e('0x4e')]));_0x135d74[_0xcc0e('0x57')][_0xcc0e('0x76')]=_0x5d8662['id'];if(_0x2d21f9[_0xcc0e('0x4c')][_0xcc0e('0x59')]){_0x135d74['where']=_[_0xcc0e('0x5a')](_0x135d74[_0xcc0e('0x57')],{'$or':_['map'](_0x135d74[_0xcc0e('0x50')],function(_0x235c55){var _0x5d383a={};_0x5d383a[_0x235c55]={'$like':'%'+_0x2d21f9[_0xcc0e('0x4c')][_0xcc0e('0x59')]+'%'};return _0x5d383a;})});}_0x135d74=_[_0xcc0e('0x5a')]({},_0x135d74,_0x2d21f9[_0xcc0e('0x5d')]);return db['ChatOfflineMessage'][_0xcc0e('0x28')]({'where':_0x135d74[_0xcc0e('0x57')]})[_0xcc0e('0x2d')](function(_0x9207e3){_0x1871b4[_0xcc0e('0x28')]=_0x9207e3;if(_0x2d21f9[_0xcc0e('0x4c')][_0xcc0e('0x5e')]){_0x135d74[_0xcc0e('0x63')]=[{'all':!![]}];}else{_0x135d74[_0xcc0e('0x63')]=[{'model':db['CmContact'],'as':_0xcc0e('0x103'),'required':![]},{'model':db[_0xcc0e('0xee')],'as':'Attachments','required':![]}];}return db[_0xcc0e('0xe3')][_0xcc0e('0x7a')](_0x135d74);})['then'](function(_0x2df72b){_0x1871b4[_0xcc0e('0x5f')]=_0x2df72b;return _0x1871b4;});}})[_0xcc0e('0x2d')](respondWithFilteredResult(_0x45c4f4,_0x135d74))['catch'](handleError(_0x45c4f4,null));};exports[_0xcc0e('0x134')]=function(_0x147b93,_0x26f1ff){return db[_0xcc0e('0x49')][_0xcc0e('0x64')]({'where':{'id':_0x147b93[_0xcc0e('0x62')]['id']}})[_0xcc0e('0x2d')](handleEntityNotFound(_0x26f1ff,null))[_0xcc0e('0x2d')](function(_0x3a3e7b){if(_0x3a3e7b){return _0x3a3e7b[_0xcc0e('0x134')](_0x147b93['body'][_0xcc0e('0x7c')],_['omit'](_0x147b93['body'],[_0xcc0e('0x7c'),'id'])||{})['spread'](function(_0x5bc9c7){for(var _0x2948fb=0x0;_0x2948fb<_0x147b93[_0xcc0e('0x66')]['ids'][_0xcc0e('0x52')];_0x2948fb+=0x1){socket[_0xcc0e('0x135')](_0xcc0e('0x136'),{'UserId':Number(_0x147b93['body']['ids'][_0x2948fb]),'ChatWebsiteId':Number(_0x147b93[_0xcc0e('0x62')]['id'])});}return _0x5bc9c7;});}})['then'](respondWithResult(_0x26f1ff,null))[_0xcc0e('0x60')](handleError(_0x26f1ff,null));};exports[_0xcc0e('0x137')]=function(_0x300a97,_0xdcc5a2){return db['ChatWebsite'][_0xcc0e('0x64')]({'where':{'id':_0x300a97[_0xcc0e('0x62')]['id']}})['then'](handleEntityNotFound(_0xdcc5a2,null))['then'](function(_0x3f42f9){if(_0x3f42f9){return _0x3f42f9[_0xcc0e('0x137')](_0x300a97[_0xcc0e('0x4c')][_0xcc0e('0x7c')])[_0xcc0e('0x2d')](function(){if(_['isArray'](_0x300a97['query'][_0xcc0e('0x7c')])){for(var _0x652596=0x0;_0x652596<_0x300a97['query'][_0xcc0e('0x7c')][_0xcc0e('0x52')];_0x652596+=0x1){socket['emit'](_0xcc0e('0x138'),{'UserId':Number(_0x300a97[_0xcc0e('0x4c')][_0xcc0e('0x7c')][_0x652596]),'ChatWebsiteId':Number(_0x300a97[_0xcc0e('0x62')]['id'])});}}else{socket[_0xcc0e('0x135')](_0xcc0e('0x138'),{'UserId':Number(_0x300a97[_0xcc0e('0x4c')][_0xcc0e('0x7c')]),'ChatWebsiteId':Number(_0x300a97[_0xcc0e('0x62')]['id'])});}});}})[_0xcc0e('0x2d')](respondWithStatusCode(_0xdcc5a2,null))['catch'](handleError(_0xdcc5a2,null));};exports[_0xcc0e('0x139')]=function(_0x2c6c63,_0x1c5f51){var _0x5ee657={};var _0xc08ae9={};var _0x48425c;var _0x43b376;return db[_0xcc0e('0x49')][_0xcc0e('0x79')]({'where':{'id':_0x2c6c63[_0xcc0e('0x62')]['id']}})[_0xcc0e('0x2d')](handleEntityNotFound(_0x1c5f51,null))[_0xcc0e('0x2d')](function(_0x55acd8){if(_0x55acd8){_0x48425c=_0x55acd8;_0xc08ae9[_0xcc0e('0x44')]=_[_0xcc0e('0x4d')](db['User'][_0xcc0e('0x4a')]);_0xc08ae9[_0xcc0e('0x4c')]=_['keys'](_0x2c6c63['query']);_0xc08ae9[_0xcc0e('0x4e')]=_[_0xcc0e('0x4f')](_0xc08ae9['model'],_0xc08ae9[_0xcc0e('0x4c')]);_0x5ee657[_0xcc0e('0x50')]=_[_0xcc0e('0x4f')](_0xc08ae9[_0xcc0e('0x44')],qs[_0xcc0e('0x51')](_0x2c6c63[_0xcc0e('0x4c')][_0xcc0e('0x51')]));_0x5ee657['attributes']=_0x5ee657['attributes'][_0xcc0e('0x52')]?_0x5ee657[_0xcc0e('0x50')]:_0xc08ae9['model'];_0x5ee657[_0xcc0e('0x55')]=qs[_0xcc0e('0x56')](_0x2c6c63[_0xcc0e('0x4c')]['sort']);_0x5ee657['where']=qs[_0xcc0e('0x4e')](_['pick'](_0x2c6c63[_0xcc0e('0x4c')],_0xc08ae9[_0xcc0e('0x4e')]));if(_0x2c6c63[_0xcc0e('0x4c')]['filter']){_0x5ee657['where']=_['merge'](_0x5ee657[_0xcc0e('0x57')],{'$or':_[_0xcc0e('0x5b')](_0x5ee657['attributes'],function(_0x5d7688){var _0x5f00ad={};_0x5f00ad[_0x5d7688]={'$like':'%'+_0x2c6c63[_0xcc0e('0x4c')][_0xcc0e('0x59')]+'%'};return _0x5f00ad;})});}_0x5ee657=_[_0xcc0e('0x5a')]({},_0x5ee657,_0x2c6c63[_0xcc0e('0x5d')]);return _0x48425c[_0xcc0e('0x139')](_0x5ee657);}})[_0xcc0e('0x2d')](function(_0x4666db){if(_0x4666db){_0x43b376=_0x4666db[_0xcc0e('0x52')];if(!_0x2c6c63['query'][_0xcc0e('0x53')](_0xcc0e('0x54'))){_0x5ee657[_0xcc0e('0x27')]=qs['limit'](_0x2c6c63[_0xcc0e('0x4c')][_0xcc0e('0x27')]);_0x5ee657['offset']=qs['offset'](_0x2c6c63[_0xcc0e('0x4c')]['offset']);}return _0x48425c['getAgents'](_0x5ee657);}})['then'](function(_0x4391a){if(_0x4391a){return _0x4391a?{'count':_0x43b376,'rows':_0x4391a}:null;}})[_0xcc0e('0x2d')](respondWithResult(_0x1c5f51,null))[_0xcc0e('0x60')](handleError(_0x1c5f51,null));}; \ No newline at end of file +var _0x1bac=['fromString','originalname','mimetype','server','offline-chat','basename','openNewInteraction','sequelize','transaction','bulkCreate','Smtp','CloudProvider','forwardOfflineAddress','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','subjectOffline','toPairsIn','mapValues','Chat','notifyMail','remove','addInteraction','omit','getInteractions','Owner','fullname','internal','Tag','Tags','color','tag','getSnippet','interval','getProactiveActions','virtual','License','increment','server/files/chat/iframe.ejs','utf8','3.9.0','origin','http://localhost:9000','testWebsiteWithWildcard','remote','x-real-ip','connection','remoteAddress','replace','alignment','verticalAlignment','labelText','textButtonColor','backgroundColor','hideWhenOffline','IntervalId','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','finally','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','false','offlineForm','onlineForm','items','getOfflineMessages','Contact','Attachment','Attachments','addAgents','emit','removeAgents','userChatWebsite:remove','getAgents','util','path','ejs','fs-extra','lodash','querystring','html-to-text','ioredis','jayson/promise','../../config/logger','api','../../errors/api','APIOutOfIntervalError','handleError','APIConflictError','URL','../../mysqldb','redis','socket.io-emitter','./chatWebsite.socket','register','client','http','request','then','debug','request\x20sent','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','info','status','end','json','limit','undefined','count','offset','set','Content-Range','destroy','ChatWebsites','UserProfileResource','sendStatus','stack','name','user-agent-parser','setUA','getResult','customerIp','cf-connecting-ip','x-forwarded-for','first','firstName','lastName','x-real-port','referer','browser','format','%s\x20%s','version','unknown','device','model','vendor','%s\x20%s\x20%s','type','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','key','keys','filters','intersection','query','attributes','length','hasOwnProperty','nolimit','sort','where','VIRTUAL','filter','merge','options','includeAll','findAll','catch','show','params','Pause','fields','body','address','split','forEach','testWildcardValidity','trim','\x22\x20is\x20not\x20a\x20valid\x20wildcard\x20expression','create','role','user','get','UserProfileSection','find','autoAssociation','update','describe','addDisposition','Disposition','getDispositions','findOne','order','pick','ChatWebsiteId','include','rows','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','addLogo','sitepic','addAvatar','agentAvatar','filename','addCustomerAvatar','customerAvatar','file','addSystemAvatar','systemAvatar','getLogo','root','server/files/images/logos/default_logo.svg','getLicense','custom','isNil','join','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','existsSync','server/files/images/avatars/','getCustomerAvatar','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','Interval','timezone','ifTime','notify','chat','from','From\x20is\x20mandatory','mapKey','MapKey\x20is\x20mandatory','isEmpty','Body\x20is\x20mandatory','CmContact','createdAt','updatedAt','includes','CompanyId','Invalid\x20MapKey\x20parameter.\x20Allowed\x20values:\x20','CmList','List','Contacts','DESC','ChatApplication','Applications','Intervals','account','applications','orderBy','priority','asc','list','ListId','defaults','headers','threadId','closed','ChatInteraction','Writing\x20on\x20closed\x20interaction','externalUrl','interaction','contact','messageId','created','autoclose','push','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','waitForTheAssignedAgent','ChatQueue','queue','waitForTheAssignedQueue','Start','startRouting','EventManager','Sequelize','difference','ValidationError','from\x20is\x20mandatory','send','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','spread','readFileSync','server/files/templates/chatOfflineMessage.ejs','render','toPairs','offlineMessageBody','ChatOfflineMessage'];(function(_0xc14e9b,_0x5c3047){var _0x48f298=function(_0x3ddc68){while(--_0x3ddc68){_0xc14e9b['push'](_0xc14e9b['shift']());}};_0x48f298(++_0x5c3047);}(_0x1bac,0x18a));var _0xc1ba=function(_0x4be5d5,_0x4614d1){_0x4be5d5=_0x4be5d5-0x0;var _0x402694=_0x1bac[_0x4be5d5];return _0x402694;};'use strict';var Mustache=require('mustache');var util=require(_0xc1ba('0x0'));var path=require(_0xc1ba('0x1'));var ejs=require(_0xc1ba('0x2'));var fs=require('fs');var fs_extra=require(_0xc1ba('0x3'));var _=require(_0xc1ba('0x4'));var querystring=require(_0xc1ba('0x5'));var htmlToText=require(_0xc1ba('0x6'));var Redis=require(_0xc1ba('0x7'));var jayson=require(_0xc1ba('0x8'));var qs=require('../../components/parsers/qs');var logger=require(_0xc1ba('0x9'))(_0xc1ba('0xa'));var config=require('../../config/environment');var APIBadRequestError=require(_0xc1ba('0xb'))['APIBadRequestError'];var APINotFoundError=require('../../errors/api')['APINotFoundError'];var APIOutOfIntervalError=require(_0xc1ba('0xb'))[_0xc1ba('0xc')];var APIHandleError=require(_0xc1ba('0xb'))[_0xc1ba('0xd')];var APIConflictError=require('../../errors/api')[_0xc1ba('0xe')];var wildcardUtils=require('./helpers/wildcard-expressions');var URL=require('url')[_0xc1ba('0xf')];var db=require(_0xc1ba('0x10'))['db'];config[_0xc1ba('0x11')]=_['defaults'](config[_0xc1ba('0x11')],{'host':'localhost','port':0x18eb});var socket=require(_0xc1ba('0x12'))(new Redis(config[_0xc1ba('0x11')]));require(_0xc1ba('0x13'))[_0xc1ba('0x14')](socket);var client=jayson[_0xc1ba('0x15')][_0xc1ba('0x16')]({'port':0x232c});var client9002=jayson[_0xc1ba('0x15')]['http']({'port':0x232a});var client9003=jayson[_0xc1ba('0x15')][_0xc1ba('0x16')]({'port':0x232b});var client9001=jayson[_0xc1ba('0x15')][_0xc1ba('0x16')]({'port':0x2329});function respondWithRpcPromise(_0x2510f7,_0x57b4a1,_0x1ffa97,_0x5563fa){return new Promise(function(_0x3bc21e,_0x33ecb1){var _0x273267=_0x5563fa||client;return _0x273267[_0xc1ba('0x17')](_0x2510f7,_0x1ffa97)[_0xc1ba('0x18')](function(_0x54826f){logger['info']('ChatWebsite,\x20%s,\x20%s',_0x57b4a1,'request\x20sent');logger[_0xc1ba('0x19')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x57b4a1,_0xc1ba('0x1a'),JSON[_0xc1ba('0x1b')](_0x54826f));if(_0x54826f[_0xc1ba('0x1c')]){if(_0x54826f[_0xc1ba('0x1c')][_0xc1ba('0x1d')]===0x1f4){logger[_0xc1ba('0x1c')](_0xc1ba('0x1e'),_0x57b4a1,_0x54826f[_0xc1ba('0x1c')]['message']);return _0x33ecb1(_0x54826f[_0xc1ba('0x1c')][_0xc1ba('0x1f')]);}logger[_0xc1ba('0x1c')]('ChatWebsite,\x20%s,\x20%s',_0x57b4a1,_0x54826f[_0xc1ba('0x1c')]['message']);return _0x3bc21e(_0x54826f['error'][_0xc1ba('0x1f')]);}else{logger[_0xc1ba('0x20')](_0xc1ba('0x1e'),_0x57b4a1,_0xc1ba('0x1a'));_0x3bc21e(_0x54826f['result'][_0xc1ba('0x1f')]);}})['catch'](function(_0x19bb54){logger['error'](_0xc1ba('0x1e'),_0x57b4a1,_0x19bb54);_0x33ecb1(_0x19bb54);});});}function respondWithStatusCode(_0x83970f,_0x2a642f){_0x2a642f=_0x2a642f||0xcc;return function(_0x268c43){if(_0x268c43){return _0x83970f['sendStatus'](_0x2a642f);}return _0x83970f[_0xc1ba('0x21')](_0x2a642f)[_0xc1ba('0x22')]();};}function respondWithResult(_0x28aa07,_0x1272ff){_0x1272ff=_0x1272ff||0xc8;return function(_0x5c7e8e){if(_0x5c7e8e){return _0x28aa07['status'](_0x1272ff)[_0xc1ba('0x23')](_0x5c7e8e);}};}function respondWithFilteredResult(_0x2cef8a,_0x3db85f){return function(_0x2211ed){if(_0x2211ed){var _0x50c159=typeof _0x3db85f['offset']==='undefined'&&typeof _0x3db85f[_0xc1ba('0x24')]===_0xc1ba('0x25');var _0x1d7a7e=_0x2211ed[_0xc1ba('0x26')];var _0x1341a4=_0x50c159?0x0:_0x3db85f['offset'];var _0x46fd03=_0x50c159?_0x2211ed[_0xc1ba('0x26')]:_0x3db85f[_0xc1ba('0x27')]+_0x3db85f[_0xc1ba('0x24')];var _0x2bdfca;if(_0x46fd03>=_0x1d7a7e){_0x46fd03=_0x1d7a7e;_0x2bdfca=0xc8;}else{_0x2bdfca=0xce;}_0x2cef8a[_0xc1ba('0x21')](_0x2bdfca);return _0x2cef8a[_0xc1ba('0x28')](_0xc1ba('0x29'),_0x1341a4+'-'+_0x46fd03+'/'+_0x1d7a7e)[_0xc1ba('0x23')](_0x2211ed);}return null;};}function saveUpdates(_0x197b07){return function(_0x16ec13){if(_0x16ec13){return _0x16ec13['update'](_0x197b07)[_0xc1ba('0x18')](function(_0x2d94fe){return _0x2d94fe;});}return null;};}function removeEntity(_0x17d10b){return function(_0x3dfa33){if(_0x3dfa33){return _0x3dfa33[_0xc1ba('0x2a')]()[_0xc1ba('0x18')](function(){var _0x472a82=_0x3dfa33['get']({'plain':!![]});var _0x5d1fbc=_0xc1ba('0x2b');return db[_0xc1ba('0x2c')]['destroy']({'where':{'type':_0x5d1fbc,'resourceId':_0x472a82['id']}})[_0xc1ba('0x18')](function(){return _0x3dfa33;});})[_0xc1ba('0x18')](function(){_0x17d10b[_0xc1ba('0x21')](0xcc)[_0xc1ba('0x22')]();});}};}function handleEntityNotFound(_0x5b3176){return function(_0x15e7c2){if(!_0x15e7c2){_0x5b3176[_0xc1ba('0x2d')](0x194);}return _0x15e7c2;};}function handleError(_0x23b31a,_0x5aae9c){_0x5aae9c=_0x5aae9c||0x1f4;return function(_0x2b5719){logger[_0xc1ba('0x1c')](_0x2b5719[_0xc1ba('0x2e')]);if(_0x2b5719[_0xc1ba('0x2f')]){delete _0x2b5719['name'];}_0x23b31a[_0xc1ba('0x21')](_0x5aae9c)['send'](_0x2b5719);};}function createInteractionObject(_0x3d725d,_0x344457,_0x3d4626,_0x1d63b0){var _0x53f669=require(_0xc1ba('0x30'));var _0x16eca5=new _0x53f669();var _0x52af87=_0x16eca5[_0xc1ba('0x31')](_0x3d4626['user-agent'])[_0xc1ba('0x32')]();var _0x199f00=_0x344457[_0xc1ba('0x33')];if(_0x3d4626[_0xc1ba('0x34')]){_0x199f00=_0x3d4626[_0xc1ba('0x34')];}else if(_0x3d4626[_0xc1ba('0x35')]){_0x199f00=_[_0xc1ba('0x36')](_0x3d4626[_0xc1ba('0x35')]['split'](','));}return{'ContactId':_0x1d63b0['id'],'ChatWebsiteId':_0x3d725d,'from':(_0x1d63b0[_0xc1ba('0x37')]||'')+'\x20'+(_0x1d63b0[_0xc1ba('0x38')]||''),'customerIp':_0x199f00,'customerPort':_0x3d4626[_0xc1ba('0x39')]?_0x3d4626[_0xc1ba('0x39')]:null,'referer':_0x344457[_0xc1ba('0x3a')],'browserName':_0x52af87['browser']['name']&&_0x52af87[_0xc1ba('0x3b')]['version']?util[_0xc1ba('0x3c')](_0xc1ba('0x3d'),_0x52af87['browser']['name'],_0x52af87[_0xc1ba('0x3b')][_0xc1ba('0x3e')]):_0xc1ba('0x3f'),'browserVersion':_0x52af87[_0xc1ba('0x3b')][_0xc1ba('0x3e')]||'unknown','osName':util[_0xc1ba('0x3c')](_0xc1ba('0x3d'),_0x52af87['os'][_0xc1ba('0x2f')],_0x52af87['os'][_0xc1ba('0x3e')]),'osVersion':_0x52af87['os']['version'],'deviceModel':_0x52af87[_0xc1ba('0x40')][_0xc1ba('0x41')]&&_0x52af87[_0xc1ba('0x40')][_0xc1ba('0x42')]?util[_0xc1ba('0x3c')](_0xc1ba('0x43'),_0x52af87[_0xc1ba('0x40')][_0xc1ba('0x41')],_0x52af87['device'][_0xc1ba('0x42')],_0x52af87[_0xc1ba('0x40')][_0xc1ba('0x44')]):null,'deviceVendor':_0x52af87[_0xc1ba('0x40')][_0xc1ba('0x42')],'deviceType':_0x52af87['device'][_0xc1ba('0x44')],'formData':JSON[_0xc1ba('0x1b')](_0x344457)};}exports['index']=function(_0x10ad9a,_0x222ec0){var _0x2d0779={'include':[{'model':db['Pause'],'as':_0xc1ba('0x45')}]},_0x37c8fd={},_0x17038c={'count':0x0,'rows':[]};var _0x576485=_[_0xc1ba('0x46')](db[_0xc1ba('0x47')][_0xc1ba('0x48')],function(_0x59a53a){return{'name':_0x59a53a[_0xc1ba('0x49')],'type':_0x59a53a['type'][_0xc1ba('0x4a')]};});_0x37c8fd[_0xc1ba('0x41')]=_['map'](_0x576485,_0xc1ba('0x2f'));_0x37c8fd['query']=_[_0xc1ba('0x4b')](_0x10ad9a['query']);_0x37c8fd[_0xc1ba('0x4c')]=_[_0xc1ba('0x4d')](_0x37c8fd[_0xc1ba('0x41')],_0x37c8fd[_0xc1ba('0x4e')]);_0x2d0779[_0xc1ba('0x4f')]=_['intersection'](_0x37c8fd['model'],qs['fields'](_0x10ad9a[_0xc1ba('0x4e')]['fields']));_0x2d0779[_0xc1ba('0x4f')]=_0x2d0779[_0xc1ba('0x4f')][_0xc1ba('0x50')]?_0x2d0779['attributes']:_0x37c8fd[_0xc1ba('0x41')];if(!_0x10ad9a[_0xc1ba('0x4e')][_0xc1ba('0x51')](_0xc1ba('0x52'))){_0x2d0779[_0xc1ba('0x24')]=qs[_0xc1ba('0x24')](_0x10ad9a[_0xc1ba('0x4e')][_0xc1ba('0x24')]);_0x2d0779[_0xc1ba('0x27')]=qs[_0xc1ba('0x27')](_0x10ad9a[_0xc1ba('0x4e')]['offset']);}_0x2d0779['order']=qs[_0xc1ba('0x53')](_0x10ad9a[_0xc1ba('0x4e')][_0xc1ba('0x53')]);_0x2d0779[_0xc1ba('0x54')]=qs['filters'](_['pick'](_0x10ad9a['query'],_0x37c8fd[_0xc1ba('0x4c')]),_0x576485);if(_0x10ad9a[_0xc1ba('0x4e')]['filter']){_0x2d0779['where']=_['merge'](_0x2d0779['where'],{'$or':_[_0xc1ba('0x46')](_0x576485,function(_0x5d3ac5){if(_0x5d3ac5[_0xc1ba('0x44')]!==_0xc1ba('0x55')){var _0x678fda={};_0x678fda[_0x5d3ac5[_0xc1ba('0x2f')]]={'$like':'%'+_0x10ad9a['query'][_0xc1ba('0x56')]+'%'};return _0x678fda;}})});}_0x2d0779=_[_0xc1ba('0x57')]({},_0x2d0779,_0x10ad9a[_0xc1ba('0x58')]);var _0x52f12b={'where':_0x2d0779[_0xc1ba('0x54')]};return db[_0xc1ba('0x47')][_0xc1ba('0x26')](_0x52f12b)[_0xc1ba('0x18')](function(_0x301ee9){_0x17038c['count']=_0x301ee9;if(_0x10ad9a['query'][_0xc1ba('0x59')]){_0x2d0779['include']=[{'all':!![]}];}return db[_0xc1ba('0x47')][_0xc1ba('0x5a')](_0x2d0779);})['then'](function(_0x227511){_0x17038c['rows']=_0x227511;return _0x17038c;})['then'](respondWithFilteredResult(_0x222ec0,_0x2d0779))[_0xc1ba('0x5b')](handleError(_0x222ec0,null));};exports[_0xc1ba('0x5c')]=function(_0x5d610b,_0x5aadab){var _0x58a976={'raw':![],'where':{'id':_0x5d610b[_0xc1ba('0x5d')]['id']},'include':[{'model':db[_0xc1ba('0x5e')],'as':'mandatoryDispositionPause'}]},_0x330190={};_0x330190[_0xc1ba('0x41')]=_[_0xc1ba('0x4b')](db[_0xc1ba('0x47')][_0xc1ba('0x48')]);_0x330190[_0xc1ba('0x4e')]=_[_0xc1ba('0x4b')](_0x5d610b[_0xc1ba('0x4e')]);_0x330190[_0xc1ba('0x4c')]=_['intersection'](_0x330190['model'],_0x330190[_0xc1ba('0x4e')]);_0x58a976['attributes']=_[_0xc1ba('0x4d')](_0x330190['model'],qs[_0xc1ba('0x5f')](_0x5d610b['query']['fields']));_0x58a976[_0xc1ba('0x4f')]=_0x58a976['attributes'][_0xc1ba('0x50')]?_0x58a976[_0xc1ba('0x4f')]:_0x330190['model'];if(_0x5d610b['query'][_0xc1ba('0x59')]){_0x58a976['include']=[{'all':!![]}];}_0x58a976=_['merge']({},_0x58a976,_0x5d610b[_0xc1ba('0x58')]);return db[_0xc1ba('0x47')]['find'](_0x58a976)[_0xc1ba('0x18')](handleEntityNotFound(_0x5aadab,null))[_0xc1ba('0x18')](respondWithResult(_0x5aadab,null))[_0xc1ba('0x5b')](handleError(_0x5aadab,null));};exports['create']=function(_0x473d96,_0x23b866){var _0x530236=null;_0x473d96[_0xc1ba('0x60')][_0xc1ba('0x61')][_0xc1ba('0x62')](',')[_0xc1ba('0x63')](_0x5a2f41=>{if(_0x5a2f41['trim']()!==''&&!wildcardUtils[_0xc1ba('0x64')](_0x5a2f41['trim']())){_0x530236=new APIBadRequestError('\x22'+_0x5a2f41[_0xc1ba('0x65')]()+_0xc1ba('0x66'));}});if(_0x530236){return handleError(_0x23b866,null)(_0x530236);}return db[_0xc1ba('0x47')][_0xc1ba('0x67')](_0x473d96[_0xc1ba('0x60')],{})['then'](function(_0x523eab){var _0x435b4f=_0x473d96['user']['get']({'plain':!![]});if(!_0x435b4f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x435b4f[_0xc1ba('0x68')]===_0xc1ba('0x69')){var _0x3087d1=_0x523eab[_0xc1ba('0x6a')]({'plain':!![]});var _0x2819e9=_0xc1ba('0x2b');return db[_0xc1ba('0x6b')][_0xc1ba('0x6c')]({'where':{'name':_0x2819e9,'userProfileId':_0x435b4f['userProfileId']},'raw':!![]})[_0xc1ba('0x18')](function(_0x348b84){if(_0x348b84&&_0x348b84[_0xc1ba('0x6d')]===0x0){return db[_0xc1ba('0x2c')]['create']({'name':_0x3087d1[_0xc1ba('0x2f')],'resourceId':_0x3087d1['id'],'type':_0x348b84[_0xc1ba('0x2f')],'sectionId':_0x348b84['id']},{})[_0xc1ba('0x18')](function(){return _0x523eab;});}else{return _0x523eab;}})['catch'](function(_0x471570){logger[_0xc1ba('0x1c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x471570);throw _0x471570;});}return _0x523eab;})[_0xc1ba('0x18')](respondWithResult(_0x23b866,0xc9))['catch'](handleError(_0x23b866,null));};exports[_0xc1ba('0x6e')]=function(_0x5ce86c,_0xd322a){var _0x1a8c07=null;_0x5ce86c[_0xc1ba('0x60')]['address'][_0xc1ba('0x62')](',')['forEach'](_0x1fe441=>{if(_0x1fe441[_0xc1ba('0x65')]()!==''&&!wildcardUtils[_0xc1ba('0x64')](_0x1fe441[_0xc1ba('0x65')]())){_0x1a8c07=new APIBadRequestError('\x22'+_0x1fe441[_0xc1ba('0x65')]()+_0xc1ba('0x66'));}});if(_0x1a8c07){return handleError(_0xd322a,null)(_0x1a8c07);}if(_0x5ce86c[_0xc1ba('0x60')]['id']){delete _0x5ce86c['body']['id'];}return db[_0xc1ba('0x47')]['find']({'where':{'id':_0x5ce86c['params']['id']},'include':[{'model':db[_0xc1ba('0x5e')],'as':_0xc1ba('0x45')}]})[_0xc1ba('0x18')](handleEntityNotFound(_0xd322a,null))[_0xc1ba('0x18')](saveUpdates(_0x5ce86c[_0xc1ba('0x60')],null))['then'](respondWithResult(_0xd322a,null))[_0xc1ba('0x5b')](handleError(_0xd322a,null));};exports['destroy']=function(_0x1c3d9d,_0x3956f1){return db[_0xc1ba('0x47')]['find']({'where':{'id':_0x1c3d9d[_0xc1ba('0x5d')]['id']}})[_0xc1ba('0x18')](handleEntityNotFound(_0x3956f1,null))[_0xc1ba('0x18')](removeEntity(_0x3956f1,null))['catch'](handleError(_0x3956f1,null));};exports[_0xc1ba('0x6f')]=function(_0x520a6c,_0x4659fb){return db[_0xc1ba('0x47')][_0xc1ba('0x6f')]()[_0xc1ba('0x18')](respondWithResult(_0x4659fb,null))[_0xc1ba('0x5b')](handleError(_0x4659fb,null));};exports[_0xc1ba('0x70')]=function(_0x31c08c,_0x2702fa){if(_0x31c08c[_0xc1ba('0x60')]['id']){delete _0x31c08c['body']['id'];}return db[_0xc1ba('0x47')][_0xc1ba('0x6c')]({'where':{'id':_0x31c08c[_0xc1ba('0x5d')]['id']}})['then'](handleEntityNotFound(_0x2702fa,null))[_0xc1ba('0x18')](function(_0x471b58){if(_0x471b58){_0x31c08c['body']['ChatWebsiteId']=_0x471b58['id'];return db[_0xc1ba('0x71')][_0xc1ba('0x67')](_0x31c08c[_0xc1ba('0x60')]);}})[_0xc1ba('0x18')](respondWithResult(_0x2702fa,null))[_0xc1ba('0x5b')](handleError(_0x2702fa,null));};exports[_0xc1ba('0x72')]=function(_0x3020c5,_0x16e866){var _0x44c5d7={'raw':![],'where':{}};var _0x5709f2={};var _0x23bc20={'count':0x0,'rows':[]};return db[_0xc1ba('0x47')][_0xc1ba('0x73')]({'where':{'id':_0x3020c5[_0xc1ba('0x5d')]['id']}})[_0xc1ba('0x18')](handleEntityNotFound(_0x16e866,null))[_0xc1ba('0x18')](function(_0x3dd10c){if(_0x3dd10c){_0x5709f2[_0xc1ba('0x41')]=_['keys'](db[_0xc1ba('0x71')][_0xc1ba('0x48')]);_0x5709f2['query']=_[_0xc1ba('0x4b')](_0x3020c5[_0xc1ba('0x4e')]);_0x5709f2[_0xc1ba('0x4c')]=_[_0xc1ba('0x4d')](_0x5709f2['model'],_0x5709f2['query']);_0x44c5d7[_0xc1ba('0x4f')]=_[_0xc1ba('0x4d')](_0x5709f2[_0xc1ba('0x41')],qs[_0xc1ba('0x5f')](_0x3020c5[_0xc1ba('0x4e')][_0xc1ba('0x5f')]));_0x44c5d7[_0xc1ba('0x4f')]=_0x44c5d7[_0xc1ba('0x4f')][_0xc1ba('0x50')]?_0x44c5d7[_0xc1ba('0x4f')]:_0x5709f2['model'];if(!_0x3020c5[_0xc1ba('0x4e')][_0xc1ba('0x51')]('nolimit')){_0x44c5d7[_0xc1ba('0x24')]=qs[_0xc1ba('0x24')](_0x3020c5[_0xc1ba('0x4e')][_0xc1ba('0x24')]);_0x44c5d7[_0xc1ba('0x27')]=qs[_0xc1ba('0x27')](_0x3020c5[_0xc1ba('0x4e')][_0xc1ba('0x27')]);}_0x44c5d7[_0xc1ba('0x74')]=qs['sort'](_0x3020c5[_0xc1ba('0x4e')]['sort']);_0x44c5d7[_0xc1ba('0x54')]=qs[_0xc1ba('0x4c')](_[_0xc1ba('0x75')](_0x3020c5[_0xc1ba('0x4e')],_0x5709f2[_0xc1ba('0x4c')]));_0x44c5d7['where'][_0xc1ba('0x76')]=_0x3dd10c['id'];if(_0x3020c5[_0xc1ba('0x4e')][_0xc1ba('0x56')]){_0x44c5d7[_0xc1ba('0x54')]=_[_0xc1ba('0x57')](_0x44c5d7[_0xc1ba('0x54')],{'$or':_[_0xc1ba('0x46')](_0x44c5d7['attributes'],function(_0x1a0072){var _0x20401c={};_0x20401c[_0x1a0072]={'$like':'%'+_0x3020c5['query'][_0xc1ba('0x56')]+'%'};return _0x20401c;})});}_0x44c5d7=_[_0xc1ba('0x57')]({},_0x44c5d7,_0x3020c5[_0xc1ba('0x58')]);return db[_0xc1ba('0x71')][_0xc1ba('0x26')]({'where':_0x44c5d7[_0xc1ba('0x54')]})[_0xc1ba('0x18')](function(_0x10d7d6){_0x23bc20[_0xc1ba('0x26')]=_0x10d7d6;if(_0x3020c5[_0xc1ba('0x4e')]['includeAll']){_0x44c5d7[_0xc1ba('0x77')]=[{'all':!![]}];}return db[_0xc1ba('0x71')][_0xc1ba('0x5a')](_0x44c5d7);})[_0xc1ba('0x18')](function(_0x59fd6b){_0x23bc20[_0xc1ba('0x78')]=_0x59fd6b;return _0x23bc20;});}})[_0xc1ba('0x18')](respondWithFilteredResult(_0x16e866,_0x44c5d7))['catch'](handleError(_0x16e866,null));};exports['removeDispositions']=function(_0x375086,_0x14b63f){return db['ChatWebsite']['find']({'where':{'id':_0x375086[_0xc1ba('0x5d')]['id']}})[_0xc1ba('0x18')](handleEntityNotFound(_0x14b63f,null))[_0xc1ba('0x18')](function(_0x1e5df0){if(_0x1e5df0){return _0x1e5df0[_0xc1ba('0x79')](_0x375086[_0xc1ba('0x4e')][_0xc1ba('0x7a')]);}})[_0xc1ba('0x18')](respondWithStatusCode(_0x14b63f,null))[_0xc1ba('0x5b')](handleError(_0x14b63f,null));};exports[_0xc1ba('0x7b')]=function(_0x131f34,_0x4dfa1c){if(_0x131f34[_0xc1ba('0x60')]['id']){delete _0x131f34[_0xc1ba('0x60')]['id'];}return db[_0xc1ba('0x47')][_0xc1ba('0x6c')]({'where':{'id':_0x131f34[_0xc1ba('0x5d')]['id']}})[_0xc1ba('0x18')](handleEntityNotFound(_0x4dfa1c,null))[_0xc1ba('0x18')](function(_0x48e80d){if(_0x48e80d){_0x131f34[_0xc1ba('0x60')][_0xc1ba('0x76')]=_0x48e80d['id'];return db['CannedAnswer'][_0xc1ba('0x67')](_0x131f34[_0xc1ba('0x60')]);}})[_0xc1ba('0x18')](respondWithResult(_0x4dfa1c,null))[_0xc1ba('0x5b')](handleError(_0x4dfa1c,null));};exports['getAnswers']=function(_0x2e6004,_0x525e95){var _0x5dcc88={'raw':![],'where':{}};var _0x290dee={};var _0x3a2075={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xc1ba('0x73')]({'where':{'id':_0x2e6004[_0xc1ba('0x5d')]['id']}})[_0xc1ba('0x18')](handleEntityNotFound(_0x525e95,null))[_0xc1ba('0x18')](function(_0x39cc16){if(_0x39cc16){_0x290dee[_0xc1ba('0x41')]=_[_0xc1ba('0x4b')](db[_0xc1ba('0x7c')][_0xc1ba('0x48')]);_0x290dee[_0xc1ba('0x4e')]=_[_0xc1ba('0x4b')](_0x2e6004[_0xc1ba('0x4e')]);_0x290dee['filters']=_[_0xc1ba('0x4d')](_0x290dee[_0xc1ba('0x41')],_0x290dee[_0xc1ba('0x4e')]);_0x5dcc88['attributes']=_[_0xc1ba('0x4d')](_0x290dee['model'],qs['fields'](_0x2e6004['query'][_0xc1ba('0x5f')]));_0x5dcc88['attributes']=_0x5dcc88['attributes']['length']?_0x5dcc88[_0xc1ba('0x4f')]:_0x290dee[_0xc1ba('0x41')];if(!_0x2e6004[_0xc1ba('0x4e')][_0xc1ba('0x51')]('nolimit')){_0x5dcc88[_0xc1ba('0x24')]=qs[_0xc1ba('0x24')](_0x2e6004[_0xc1ba('0x4e')][_0xc1ba('0x24')]);_0x5dcc88[_0xc1ba('0x27')]=qs[_0xc1ba('0x27')](_0x2e6004[_0xc1ba('0x4e')][_0xc1ba('0x27')]);}_0x5dcc88[_0xc1ba('0x74')]=qs[_0xc1ba('0x53')](_0x2e6004[_0xc1ba('0x4e')]['sort']);_0x5dcc88[_0xc1ba('0x54')]=qs['filters'](_['pick'](_0x2e6004[_0xc1ba('0x4e')],_0x290dee['filters']));_0x5dcc88['where'][_0xc1ba('0x76')]=_0x39cc16['id'];if(_0x2e6004[_0xc1ba('0x4e')][_0xc1ba('0x56')]){_0x5dcc88['where']=_[_0xc1ba('0x57')](_0x5dcc88[_0xc1ba('0x54')],{'$or':_[_0xc1ba('0x46')](_0x5dcc88[_0xc1ba('0x4f')],function(_0x3092b3){var _0x3d07a4={};_0x3d07a4[_0x3092b3]={'$like':'%'+_0x2e6004['query'][_0xc1ba('0x56')]+'%'};return _0x3d07a4;})});}_0x5dcc88=_[_0xc1ba('0x57')]({},_0x5dcc88,_0x2e6004[_0xc1ba('0x58')]);return db[_0xc1ba('0x7c')][_0xc1ba('0x26')]({'where':_0x5dcc88[_0xc1ba('0x54')]})[_0xc1ba('0x18')](function(_0x405c04){_0x3a2075['count']=_0x405c04;if(_0x2e6004['query']['includeAll']){_0x5dcc88['include']=[{'all':!![]}];}return db['CannedAnswer'][_0xc1ba('0x5a')](_0x5dcc88);})[_0xc1ba('0x18')](function(_0x4735d4){_0x3a2075[_0xc1ba('0x78')]=_0x4735d4;return _0x3a2075;});}})[_0xc1ba('0x18')](respondWithFilteredResult(_0x525e95,_0x5dcc88))[_0xc1ba('0x5b')](handleError(_0x525e95,null));};exports['removeAnswers']=function(_0x169d1a,_0x19cbb){return db[_0xc1ba('0x47')][_0xc1ba('0x6c')]({'where':{'id':_0x169d1a[_0xc1ba('0x5d')]['id']}})[_0xc1ba('0x18')](handleEntityNotFound(_0x19cbb,null))[_0xc1ba('0x18')](function(_0x370193){if(_0x370193){return _0x370193[_0xc1ba('0x7d')](_0x169d1a['query'][_0xc1ba('0x7a')]);}})[_0xc1ba('0x18')](respondWithStatusCode(_0x19cbb,null))[_0xc1ba('0x5b')](handleError(_0x19cbb,null));};exports[_0xc1ba('0x7e')]=function(_0x498594,_0x3f33bd){_0x498594[_0xc1ba('0x60')][_0xc1ba('0x7f')]=_0x498594['file']['filename'];return db[_0xc1ba('0x47')][_0xc1ba('0x6c')]({'where':{'id':_0x498594[_0xc1ba('0x5d')]['id']}})[_0xc1ba('0x18')](handleEntityNotFound(_0x3f33bd,null))['then'](saveUpdates(_0x498594[_0xc1ba('0x60')],null))[_0xc1ba('0x18')](respondWithResult(_0x3f33bd,null))['catch'](handleError(_0x3f33bd,null));};exports[_0xc1ba('0x80')]=function(_0x3dbb37,_0xf9d188){_0x3dbb37[_0xc1ba('0x60')][_0xc1ba('0x81')]=_0x3dbb37['file'][_0xc1ba('0x82')];return db[_0xc1ba('0x47')][_0xc1ba('0x6c')]({'where':{'id':_0x3dbb37['params']['id']}})['then'](handleEntityNotFound(_0xf9d188,null))['then'](saveUpdates(_0x3dbb37[_0xc1ba('0x60')],null))[_0xc1ba('0x18')](respondWithResult(_0xf9d188,null))[_0xc1ba('0x5b')](handleError(_0xf9d188,null));};exports[_0xc1ba('0x83')]=function(_0x59311a,_0x163c91){_0x59311a[_0xc1ba('0x60')][_0xc1ba('0x84')]=_0x59311a[_0xc1ba('0x85')][_0xc1ba('0x82')];return db[_0xc1ba('0x47')][_0xc1ba('0x6c')]({'where':{'id':_0x59311a[_0xc1ba('0x5d')]['id']}})[_0xc1ba('0x18')](handleEntityNotFound(_0x163c91,null))[_0xc1ba('0x18')](saveUpdates(_0x59311a['body'],null))[_0xc1ba('0x18')](respondWithResult(_0x163c91,null))[_0xc1ba('0x5b')](handleError(_0x163c91,null));};exports[_0xc1ba('0x86')]=function(_0x4b4e93,_0x3c04dd){_0x4b4e93['body'][_0xc1ba('0x87')]=_0x4b4e93[_0xc1ba('0x85')][_0xc1ba('0x82')];return db[_0xc1ba('0x47')][_0xc1ba('0x6c')]({'where':{'id':_0x4b4e93[_0xc1ba('0x5d')]['id']}})[_0xc1ba('0x18')](handleEntityNotFound(_0x3c04dd,null))[_0xc1ba('0x18')](saveUpdates(_0x4b4e93[_0xc1ba('0x60')],null))[_0xc1ba('0x18')](respondWithResult(_0x3c04dd,null))[_0xc1ba('0x5b')](handleError(_0x3c04dd,null));};exports[_0xc1ba('0x88')]=function(_0x5c56d0,_0x428b2b){var _0x47cc9a=path['join'](config[_0xc1ba('0x89')],_0xc1ba('0x8a'));var _0x4b9190={'where':{'id':_0x5c56d0['params']['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x2fe201=![];return require('../../config/license/util')[_0xc1ba('0x8b')]()[_0xc1ba('0x18')](function(_0x2e7c10){if(_0x2e7c10){_0x2fe201=_0x2e7c10[_0xc1ba('0x8c')];}})[_0xc1ba('0x18')](function(){return db['ChatWebsite'][_0xc1ba('0x6c')](_0x4b9190);})[_0xc1ba('0x18')](handleEntityNotFound(_0x428b2b,null))[_0xc1ba('0x18')](function(_0x554f42){if(_0x554f42){if(!_[_0xc1ba('0x8d')](_0x554f42['sitepic'])){if(fs['existsSync'](path[_0xc1ba('0x8e')](config[_0xc1ba('0x89')],_0xc1ba('0x8f'),_0x554f42[_0xc1ba('0x7f')]))&&_0x2fe201){_0x47cc9a=path[_0xc1ba('0x8e')](config[_0xc1ba('0x89')],_0xc1ba('0x8f'),_0x554f42[_0xc1ba('0x7f')]);}}return _0x428b2b[_0xc1ba('0x90')](_0x47cc9a);}})[_0xc1ba('0x5b')](handleError(_0x428b2b,null));};exports[_0xc1ba('0x91')]=function(_0x12731c,_0x1b2f8e){var _0x42dae2=path[_0xc1ba('0x8e')](config[_0xc1ba('0x89')],_0xc1ba('0x92'));var _0x3317b6={'where':{'id':_0x12731c[_0xc1ba('0x5d')]['id']},'attributes':['id',_0xc1ba('0x81')],'raw':!![]};return db[_0xc1ba('0x47')][_0xc1ba('0x6c')](_0x3317b6)[_0xc1ba('0x18')](handleEntityNotFound(_0x1b2f8e,null))[_0xc1ba('0x18')](function(_0x1336a5){if(_0x1336a5){if(!_[_0xc1ba('0x8d')](_0x1336a5[_0xc1ba('0x81')])){if(fs[_0xc1ba('0x93')](path['join'](config[_0xc1ba('0x89')],_0xc1ba('0x94'),_0x1336a5[_0xc1ba('0x81')]))){_0x42dae2=path[_0xc1ba('0x8e')](config[_0xc1ba('0x89')],_0xc1ba('0x94'),_0x1336a5[_0xc1ba('0x81')]);}}return _0x1b2f8e['download'](_0x42dae2);}})[_0xc1ba('0x5b')](handleError(_0x1b2f8e,null));};exports[_0xc1ba('0x95')]=function(_0x19b5d2,_0x1c561b){var _0x178e5e=path[_0xc1ba('0x8e')](config[_0xc1ba('0x89')],'server/files/images/avatars/customer_avatar.png');var _0x345137={'where':{'id':_0x19b5d2[_0xc1ba('0x5d')]['id']},'attributes':['id',_0xc1ba('0x84'),_0xc1ba('0x96')],'raw':!![]};return db[_0xc1ba('0x47')][_0xc1ba('0x6c')](_0x345137)['then'](handleEntityNotFound(_0x1c561b,null))[_0xc1ba('0x18')](function(_0xb50ca){if(_0xb50ca){if(!_[_0xc1ba('0x8d')](_0xb50ca[_0xc1ba('0x84')])){if(fs[_0xc1ba('0x93')](path['join'](config['root'],_0xc1ba('0x94'),_0xb50ca['customerAvatar']))&&_0xb50ca[_0xc1ba('0x96')]){_0x178e5e=path[_0xc1ba('0x8e')](config[_0xc1ba('0x89')],_0xc1ba('0x94'),_0xb50ca[_0xc1ba('0x84')]);}}return _0x1c561b['download'](_0x178e5e);}})[_0xc1ba('0x5b')](handleError(_0x1c561b,null));};exports[_0xc1ba('0x97')]=function(_0x32a6d1,_0x3c4161){var _0x1c39e9=path[_0xc1ba('0x8e')](config['root'],_0xc1ba('0x98'));var _0x356ae2={'where':{'id':_0x32a6d1[_0xc1ba('0x5d')]['id']},'attributes':['id',_0xc1ba('0x87')],'raw':!![]};return db[_0xc1ba('0x47')][_0xc1ba('0x6c')](_0x356ae2)['then'](handleEntityNotFound(_0x3c4161,null))[_0xc1ba('0x18')](function(_0x32f46b){if(_0x32f46b){if(!_[_0xc1ba('0x8d')](_0x32f46b[_0xc1ba('0x87')])){if(fs['existsSync'](path[_0xc1ba('0x8e')](config[_0xc1ba('0x89')],'server/files/images/avatars/',_0x32f46b[_0xc1ba('0x87')]))){_0x1c39e9=path[_0xc1ba('0x8e')](config['root'],'server/files/images/avatars/',_0x32f46b[_0xc1ba('0x87')]);}}return _0x3c4161[_0xc1ba('0x90')](_0x1c39e9);}})[_0xc1ba('0x5b')](handleError(_0x3c4161,null));};function checkWebsiteInterval(_0xc30ddf){var _0x1ca036=_0xc30ddf[_0xc1ba('0x99')];if(!_0x1ca036){return Promise['resolve'](_0xc30ddf);}var _0x3a33e3=_0xc30ddf[_0xc1ba('0x9a')]||undefined;return _0x1ca036[_0xc1ba('0x9b')](_0x3a33e3)[_0xc1ba('0x18')](function(_0x3a83d8){if(!_0x3a83d8){throw new APIOutOfIntervalError();}return _0xc30ddf;});}exports[_0xc1ba('0x9c')]=function(_0x599db3,_0x800175){var _0x37e473={'body':_0x599db3[_0xc1ba('0x60')],'channel':_0xc1ba('0x9d')};var _0x302742=[];var _0x51a088=[];var _0x23d133={};var _0x20df72=![];if(_0x599db3[_0xc1ba('0x60')]['id']){delete _0x599db3[_0xc1ba('0x60')]['id'];}if(_['isNil'](_0x599db3[_0xc1ba('0x60')][_0xc1ba('0x9e')])){throw new APIBadRequestError(_0xc1ba('0x9f'));}if(_[_0xc1ba('0x8d')](_0x599db3['body'][_0xc1ba('0xa0')])){throw new APIBadRequestError(_0xc1ba('0xa1'));}if(_[_0xc1ba('0xa2')](_0x599db3[_0xc1ba('0x60')][_0xc1ba('0x60')])){throw new APIBadRequestError(_0xc1ba('0xa3'));}var _0x31584c=_0x599db3[_0xc1ba('0x60')][_0xc1ba('0x33')]&&_0x599db3[_0xc1ba('0x60')][_0xc1ba('0x3a')];return db[_0xc1ba('0xa4')][_0xc1ba('0x6f')]()[_0xc1ba('0x18')](function(_0x5a6be6){if(!_0x5a6be6){throw new Error('No\x20available\x20attributes');}_0x302742=Object[_0xc1ba('0x4b')](_0x5a6be6)[_0xc1ba('0x56')](function(_0xc47c2){return![_0xc1ba('0xa5'),_0xc1ba('0xa6')][_0xc1ba('0xa7')](_0xc47c2);});_0x51a088=Object[_0xc1ba('0x4b')](_0x5a6be6)[_0xc1ba('0x56')](function(_0x36b053){return![_0xc1ba('0xa5'),_0xc1ba('0xa6'),_0xc1ba('0xa8'),'ListId'][_0xc1ba('0xa7')](_0x36b053);});if(!_[_0xc1ba('0xa7')](_0x51a088,_0x599db3[_0xc1ba('0x60')][_0xc1ba('0xa0')])){throw new APIBadRequestError(_0xc1ba('0xa9')+_0x51a088[_0xc1ba('0x8e')](',\x20'));}_0x23d133[_0x599db3[_0xc1ba('0x60')][_0xc1ba('0xa0')]]=_0x599db3[_0xc1ba('0x60')][_0xc1ba('0x9e')];})['then'](function(){return db[_0xc1ba('0x47')][_0xc1ba('0x6c')]({'where':{'id':_0x599db3['params']['id']},'include':[{'model':db[_0xc1ba('0xaa')],'as':_0xc1ba('0xab'),'include':[{'model':db['CmContact'],'as':_0xc1ba('0xac'),'where':_0x23d133,'limit':0x1,'order':[[_0xc1ba('0xa6'),_0xc1ba('0xad')]]}]},{'model':db[_0xc1ba('0xae')],'as':_0xc1ba('0xaf')},{'model':db[_0xc1ba('0x99')],'as':_0xc1ba('0x99'),'include':[{'model':db['Interval'],'as':_0xc1ba('0xb0'),'attributes':['id','interval'],'raw':!![]}]}]});})['then'](function(_0x2d45dd){if(!_0x2d45dd){throw new APINotFoundError(util[_0xc1ba('0x3c')]('Chat\x20Website\x20with\x20id\x20%s\x20not\x20found',_0x599db3[_0xc1ba('0x5d')]['id']));}if(_0x31584c){return checkWebsiteInterval(_0x2d45dd);}return _0x2d45dd;})['then'](function(_0x1eefd5){_0x37e473[_0xc1ba('0xb1')]=_0x1eefd5;_0x37e473[_0xc1ba('0xb2')]=_[_0xc1ba('0xb3')](_0x1eefd5[_0xc1ba('0xaf')],[_0xc1ba('0xb4')],[_0xc1ba('0xb5')]);if(_0x37e473[_0xc1ba('0xb1')]['Applications']){delete _0x37e473[_0xc1ba('0xb1')][_0xc1ba('0xaf')];}_0x37e473[_0xc1ba('0xb6')]=_0x1eefd5[_0xc1ba('0xab')]||{'id':_0x1eefd5[_0xc1ba('0xb7')]};if(_0x37e473[_0xc1ba('0xb6')]&&_0x37e473['list'][_0xc1ba('0xac')][_0xc1ba('0x50')]){return _0x37e473[_0xc1ba('0xb6')][_0xc1ba('0xac')][0x0];}var _0x136edf=_[_0xc1ba('0xb8')](_0x599db3['body'],{'firstName':_0x599db3[_0xc1ba('0x60')][_0xc1ba('0x9e')],'ListId':_0x1eefd5[_0xc1ba('0xb7')]});_0x136edf[_0x599db3['body']['mapKey']]=_0x599db3[_0xc1ba('0x60')]['from'];return db[_0xc1ba('0xa4')]['create'](_0x136edf,{'fields':_0x302742,'raw':!![]});})[_0xc1ba('0x18')](function(_0x35ce38){_0x37e473['contact']=_0x35ce38;var _0x6040cc=createInteractionObject(_0x599db3[_0xc1ba('0x5d')]['id'],_0x599db3[_0xc1ba('0x60')],_0x599db3[_0xc1ba('0xb9')],_0x35ce38);var _0x385fcc={'ChatWebsiteId':_0x599db3['params']['id']};if(_0x599db3[_0xc1ba('0x60')][_0xc1ba('0xba')]){_0x385fcc['threadId']=_0x599db3[_0xc1ba('0x60')][_0xc1ba('0xba')];_0x385fcc[_0xc1ba('0xbb')]=![];return db[_0xc1ba('0xbc')][_0xc1ba('0x6c')]({'where':_0x385fcc})[_0xc1ba('0x18')](function(_0x54fda8){var _0x11e02e=_0x599db3[_0xc1ba('0x60')]['customerIp']&&_0x599db3[_0xc1ba('0x60')][_0xc1ba('0x3a')];if(_0x54fda8){_0x20df72=!![];return _0x54fda8;}else if(!_0x11e02e&&_0x54fda8&&_0x54fda8[_0xc1ba('0xbb')]){throw new APIConflictError(_0xc1ba('0xbd'));}_0x6040cc[_0xc1ba('0xba')]=_0x599db3[_0xc1ba('0x60')][_0xc1ba('0xba')];_0x6040cc[_0xc1ba('0xbe')]=_0x599db3[_0xc1ba('0x60')][_0xc1ba('0xbe')];return db[_0xc1ba('0xbc')][_0xc1ba('0x67')](_0x6040cc);});}_0x385fcc['ContactId']=_0x35ce38['id'];if(_0x599db3[_0xc1ba('0x60')][_0xc1ba('0xbf')]&&_0x599db3['body'][_0xc1ba('0xbf')]['id']){_0x385fcc['id']=_0x599db3[_0xc1ba('0x60')][_0xc1ba('0xbf')]['id'];return db[_0xc1ba('0xbc')][_0xc1ba('0x6c')]({'where':_0x385fcc})[_0xc1ba('0x18')](function(_0x35e660){var _0x32b355=_0x599db3[_0xc1ba('0x60')][_0xc1ba('0x33')]&&_0x599db3['body'][_0xc1ba('0x3a')];if(!_0x32b355&&_0x35e660&&_0x35e660[_0xc1ba('0xbb')]){throw new APIConflictError(_0xc1ba('0xbd'));}else if(_0x35e660){_0x20df72=!![];return _0x35e660;}else{return db['ChatInteraction'][_0xc1ba('0x67')](_0x6040cc);}});}return db['ChatInteraction'][_0xc1ba('0x67')](_0x6040cc);})[_0xc1ba('0x18')](function(_0x58b1b9){if(!_0x20df72){return _0x58b1b9;}var _0x1b15f6={'from':(_0x37e473[_0xc1ba('0xc0')][_0xc1ba('0x37')]||'')+'\x20'+(_0x37e473[_0xc1ba('0xc0')][_0xc1ba('0x38')]||'')};if(_0x599db3['body'][_0xc1ba('0xba')]&&_0x599db3[_0xc1ba('0x60')][_0xc1ba('0xc1')]&&_0x599db3['body'][_0xc1ba('0xba')]!=_0x599db3[_0xc1ba('0x60')][_0xc1ba('0xc1')]){_0x1b15f6[_0xc1ba('0xba')]=_0x599db3[_0xc1ba('0x60')][_0xc1ba('0xc1')];}return _0x58b1b9['update'](_0x1b15f6);})['then'](function(_0x3753c9){_0x37e473[_0xc1ba('0xbf')]=_0x3753c9['get']({'plain':!![]});_0x37e473['interaction'][_0xc1ba('0xc2')]=!_0x20df72;if(_0x37e473['interaction'][_0xc1ba('0xc2')]){if(_0x37e473[_0xc1ba('0xb1')][_0xc1ba('0xc3')]){_0x37e473[_0xc1ba('0xb2')][_0xc1ba('0xc4')]({'id':0x0,'priority':_0x37e473['applications'][_0xc1ba('0x50')]+0x1,'app':'close','appdata':_0xc1ba('0xc5'),'interval':_0xc1ba('0xc6')});}}return db[_0xc1ba('0xc7')][_0xc1ba('0x67')]({'body':_0x599db3[_0xc1ba('0x60')]['body'],'ChatWebsiteId':_0x599db3['params']['id'],'ChatInteractionId':_0x3753c9['id'],'direction':'in','ContactId':_0x37e473[_0xc1ba('0xc0')]['id'],'AttachmentId':_0x599db3[_0xc1ba('0x60')][_0xc1ba('0xc8')]});})[_0xc1ba('0x18')](function(_0x3e9229){_0x37e473[_0xc1ba('0x1f')]=_0x3e9229;if(!_0x37e473[_0xc1ba('0xbf')][_0xc1ba('0xc9')]){return;}return db[_0xc1ba('0xca')][_0xc1ba('0x6c')]({'attributes':['id',_0xc1ba('0x2f')],'where':{'id':_0x37e473['interaction']['UserId']}});})[_0xc1ba('0x18')](function(_0x104b31){if(_0x104b31){_0x37e473['applications'][_0xc1ba('0xcb')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x104b31[_0xc1ba('0x2f')]+','+(_0x37e473[_0xc1ba('0xb1')][_0xc1ba('0xcc')]||0xa),'interval':'*,*,*,*'});_0x37e473['forcedOwnership']=!![];}if(!_0x37e473['interaction']['queueId']){return;}return db[_0xc1ba('0xcd')][_0xc1ba('0x6c')]({'attributes':['id','name'],'where':{'id':_0x37e473[_0xc1ba('0xbf')]['queueId']}});})[_0xc1ba('0x18')](function(_0x3d28e9){if(_0x3d28e9){_0x37e473[_0xc1ba('0xb2')][_0xc1ba('0xcb')]({'id':0x0,'priority':0x1,'app':_0xc1ba('0xce'),'appdata':_0x3d28e9['name']+','+(_0x37e473[_0xc1ba('0xb1')][_0xc1ba('0xcf')]||0x12c),'interval':_0xc1ba('0xc6')});}return respondWithRpcPromise(_0xc1ba('0xd0'),_0xc1ba('0xd1'),_0x37e473);})[_0xc1ba('0x18')](function(_0x3802d1){respondWithRpcPromise('EventManager',_0xc1ba('0xd2'),{'event':_0xc1ba('0x9c'),'message':_0x3802d1},client9002);return _0x3802d1;})[_0xc1ba('0x18')](respondWithResult(_0x800175,null))[_0xc1ba('0x5b')](APIHandleError(_0x800175));};exports['offline']=function(_0x5c76ea,_0x9aa0dc){var _0x53c63d,_0x54159b,_0x136563;var _0x366b1c=[];var _0x21c0f7={};var _0x557fba=_0x5c76ea['files']||[];var _0x3c87a9=[];var _0x7c8b11;return db[_0xc1ba('0xa4')][_0xc1ba('0x6f')]()['then'](function(_0x5ac0bc){if(!_0x5ac0bc){throw new db[(_0xc1ba('0xd3'))]['ValidationError']('no\x20available\x20attributes');}_0x366b1c=_[_0xc1ba('0xd4')](_[_0xc1ba('0x4b')](_0x5ac0bc),[_0xc1ba('0xa5'),_0xc1ba('0xa6'),_0xc1ba('0xa8'),_0xc1ba('0xb7')]);if(_0x5c76ea[_0xc1ba('0x60')]['id']){delete _0x5c76ea[_0xc1ba('0x60')]['id'];}if(_[_0xc1ba('0x8d')](_0x5c76ea[_0xc1ba('0x60')][_0xc1ba('0x9e')])){throw _0x9aa0dc[_0xc1ba('0x21')](0x1f4)['send'](new db['Sequelize'][(_0xc1ba('0xd5'))](_0xc1ba('0xd6')));}if(_['isNil'](_0x5c76ea[_0xc1ba('0x60')]['body'])||_0x5c76ea[_0xc1ba('0x60')][_0xc1ba('0x60')]===''){throw _0x9aa0dc['status'](0x1f4)[_0xc1ba('0xd7')](new db['Sequelize']['ValidationError'](_0xc1ba('0xd8')));}if(_['isNil'](_0x5c76ea[_0xc1ba('0x60')][_0xc1ba('0xd9')])){throw _0x9aa0dc['status'](0x1f4)[_0xc1ba('0xd7')](new db[(_0xc1ba('0xd3'))][(_0xc1ba('0xd5'))](_0xc1ba('0xda')+_0x366b1c));}if(!_[_0xc1ba('0xa7')](_0x366b1c,_0x5c76ea[_0xc1ba('0x60')][_0xc1ba('0xd9')])){throw _0x9aa0dc[_0xc1ba('0x21')](0x1f4)['send'](new db[(_0xc1ba('0xd3'))]['ValidationError'](_0xc1ba('0xdb')+_0x366b1c));}_0x21c0f7[_0x5c76ea['body'][_0xc1ba('0xd9')]]=_0x5c76ea[_0xc1ba('0x60')][_0xc1ba('0x9e')];})[_0xc1ba('0x18')](function(){return db[_0xc1ba('0x47')][_0xc1ba('0x6c')]({'where':{'id':_0x5c76ea[_0xc1ba('0x5d')]['id']},'include':[{'model':db[_0xc1ba('0xaa')],'as':_0xc1ba('0xab')},{'model':db[_0xc1ba('0xdc')],'as':_0xc1ba('0xdc')}]});})[_0xc1ba('0x18')](handleEntityNotFound(_0x9aa0dc,null))['then'](function(_0x20acd5){if(_0x20acd5&&_0x20acd5[_0xc1ba('0xab')]){_0x54159b=_0x20acd5;var _0x45c38b=_[_0xc1ba('0xb8')](_0x5c76ea[_0xc1ba('0x60')],{'firstName':_0x5c76ea[_0xc1ba('0x60')]['from'],'phone':_0x5c76ea['body'][_0xc1ba('0x9e')],'ListId':_0x20acd5[_0xc1ba('0xb7')]});_0x45c38b[_0x5c76ea[_0xc1ba('0x60')]['mapKeyOffline']]=_0x5c76ea[_0xc1ba('0x60')]['from'];return db['CmContact']['findOrCreate']({'where':_0x21c0f7,'defaults':_0x45c38b});}})[_0xc1ba('0xdd')](function(_0x4e7e31){if(_0x4e7e31){_0x136563=_0x4e7e31;var _0x38ccd5=fs[_0xc1ba('0xde')](path[_0xc1ba('0x8e')](config[_0xc1ba('0x89')],_0xc1ba('0xdf')),'utf8');var _0x1c0f77=ejs[_0xc1ba('0xe0')](_0x38ccd5,{'body':_[_0xc1ba('0xe1')](_0x5c76ea['body'][_0xc1ba('0x60')]),'bodyTitle':_0x54159b[_0xc1ba('0xe2')]});return db[_0xc1ba('0xe3')][_0xc1ba('0x67')]({'body':_0x1c0f77,'plainBody':htmlToText[_0xc1ba('0xe4')](_0x1c0f77),'ContactId':_0x4e7e31['id'],'ChatWebsiteId':_0x54159b['id']});}})[_0xc1ba('0x18')](function(_0x487100){_0x7c8b11=_0x487100;if(_0x557fba['length']){var _0x4cc4dc=_0x557fba[_0xc1ba('0x46')](function(_0x14311f){return{'name':_0x14311f[_0xc1ba('0xe5')],'basename':_0x14311f[_0xc1ba('0x82')],'type':_0x14311f[_0xc1ba('0xe6')],'ChatOfflineMessageId':_0x487100['id']};});_0x3c87a9=_0x4cc4dc['map'](_0x14a75a=>{var _0x18eb92={'filename':_0x14a75a[_0xc1ba('0x2f')],'path':path[_0xc1ba('0x8e')](config['root'],_0xc1ba('0xe7'),'files','attachments',_0xc1ba('0xe8'),_0x14a75a[_0xc1ba('0xe9')])};return _0x18eb92;});if(!_0x54159b[_0xc1ba('0xea')]){return db[_0xc1ba('0xeb')][_0xc1ba('0xec')](function(_0x4ed101){return db['Attachment'][_0xc1ba('0xed')](_0x4cc4dc,{'transaction':_0x4ed101});});}}})[_0xc1ba('0x18')](function(){if(_0x7c8b11){_0x53c63d=_0x7c8b11;return db[_0xc1ba('0xdc')][_0xc1ba('0x73')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0xc1ba('0xee'),'raw':!![],'include':[{'model':db[_0xc1ba('0xef')],'as':_0xc1ba('0xef'),'raw':!![]}]}]});}})[_0xc1ba('0x18')](function(_0x48f18f){if(_0x48f18f&&_0x48f18f['Smtp']&&_0x54159b['forwardOffline']&&_0x54159b[_0xc1ba('0xf0')]){var _0x3d76a9=_0x48f18f[_0xc1ba('0xf1')]();return respondWithRpcPromise(_0xc1ba('0xf2'),_0xc1ba('0xf3'),{'account':_0x3d76a9,'message':{'from':util[_0xc1ba('0x3c')](_0xc1ba('0xf4'),_0x48f18f[_0xc1ba('0x2f')],_0x48f18f[_0xc1ba('0xf5')]||_0x48f18f['Smtp'][_0xc1ba('0x69')]),'to':_0x54159b['forwardOfflineAddress'],'subject':_0x54159b[_0xc1ba('0xf6')],'html':_0x53c63d[_0xc1ba('0x60')],'attachments':_0x3c87a9}},client9003)[_0xc1ba('0x18')](function(){return _0x53c63d;})['catch'](function(_0x27dae7){logger['error'](_0x27dae7);});}})[_0xc1ba('0x18')](function(){if(_0x54159b&&_0x54159b[_0xc1ba('0xea')]&&_0x54159b[_0xc1ba('0xf7')]){var _0x45b8d1=[];if(_0x557fba['length']){_0x45b8d1=_0x557fba['map'](function(_0x1234a4){return{'name':_0x1234a4[_0xc1ba('0xe5')],'basename':_0x1234a4[_0xc1ba('0x82')],'type':_0x1234a4[_0xc1ba('0xe6')],'ChatOfflineMessageId':_0x7c8b11['id']};});}var _0x178b52;if(!_[_0xc1ba('0x8d')](_0x54159b[_0xc1ba('0xf8')])){var _0x5d24c5=_[_0xc1ba('0x46')](_0x5c76ea[_0xc1ba('0x60')],function(_0x242cb1){return _0x242cb1;});var _0x2b834e=_[_0xc1ba('0xf9')](_0x5d24c5)[0x0];var _0x87ebd9=_[_0xc1ba('0xfa')](_0x2b834e,function(_0x30e160){return _0x30e160;});_0x178b52=_0x87ebd9[0x1][_0x54159b[_0xc1ba('0xf8')]];}var _0x312e52={'from':_0x136563[_0xc1ba('0xf5')],'firstName':_0x136563[_0xc1ba('0x37')],'lastName':_0x136563[_0xc1ba('0x38')],'mapKey':'email','message':{'from':_0x136563[_0xc1ba('0xf5')],'to':_0x54159b[_0xc1ba('0xdc')]['email'],'cc':'','subject':_['isNil'](_0x178b52)?_0x54159b[_0xc1ba('0xf6')]:_0x178b52,'messageId':'','sentAt':new Date(),'attach':_0x45b8d1[_0xc1ba('0x50')],'attachments':_0x45b8d1,'originChannel':_0xc1ba('0xfb'),'ChatWebsiteId':_0x54159b['id'],'ChatOfflineMessageId':_0x53c63d['id'],'originTo':_0x54159b[_0xc1ba('0xdc')][_0xc1ba('0xf5')]},'body':_0x53c63d['body']};var _0x40bc67={'account':{'id':_0x54159b[_0xc1ba('0xf7')]},'body':_0x312e52,'log':'NotifyMailAccount'};return respondWithRpcPromise('NotifyMailAccount',_0xc1ba('0xfc'),_0x40bc67,client9001)[_0xc1ba('0x18')](function(){return _0x53c63d;})[_0xc1ba('0x5b')](function(_0x28e307){logger['error'](_0x28e307);});}return;})[_0xc1ba('0x18')](function(){if(_0x53c63d){return _0x53c63d;}})[_0xc1ba('0x18')](respondWithResult(_0x9aa0dc,null))[_0xc1ba('0x5b')](function(){for(var _0x1146c9 of _0x557fba){var _0x3174a3=path['join'](config[_0xc1ba('0x89')],'server','files','attachments',_0xc1ba('0xe8'),_0x1146c9['filename']);fs_extra[_0xc1ba('0xfd')](_0x3174a3)['catch'](function(_0x409af4){logger['error']('Could\x20not\x20remove\x20attachment\x20file',_0x3174a3,_0x409af4);});}});};exports[_0xc1ba('0xfe')]=function(_0x4f2ac6,_0x5174d8){return db[_0xc1ba('0xbc')][_0xc1ba('0x6c')]({'where':{'id':_0x4f2ac6['params']['id']}})['then'](handleEntityNotFound(_0x5174d8,null))['then'](function(_0x476ec6){if(_0x476ec6){return _0x476ec6[_0xc1ba('0xfe')](_0x4f2ac6[_0xc1ba('0x60')][_0xc1ba('0x7a')],_[_0xc1ba('0xff')](_0x4f2ac6[_0xc1ba('0x60')],['ids','id'])||{});}})[_0xc1ba('0x18')](respondWithResult(_0x5174d8,null))['catch'](handleError(_0x5174d8,null));};exports[_0xc1ba('0x100')]=function(_0x3606ca,_0x3587d2){var _0x572f42={'raw':![],'where':{}};var _0x55790f={};var _0x25695f={'count':0x0,'rows':[]};return db[_0xc1ba('0x47')][_0xc1ba('0x73')]({'where':{'id':_0x3606ca[_0xc1ba('0x5d')]['id']}})[_0xc1ba('0x18')](handleEntityNotFound(_0x3587d2,null))[_0xc1ba('0x18')](function(_0x2d558a){if(_0x2d558a){_0x55790f[_0xc1ba('0x41')]=_['keys'](db[_0xc1ba('0xbc')]['rawAttributes']);_0x55790f[_0xc1ba('0x4e')]=_[_0xc1ba('0x4b')](_0x3606ca[_0xc1ba('0x4e')]);_0x55790f[_0xc1ba('0x4c')]=_['intersection'](_0x55790f['model'],_0x55790f[_0xc1ba('0x4e')]);_0x572f42[_0xc1ba('0x4f')]=_['intersection'](_0x55790f[_0xc1ba('0x41')],qs[_0xc1ba('0x5f')](_0x3606ca[_0xc1ba('0x4e')][_0xc1ba('0x5f')]));_0x572f42['attributes']=_0x572f42[_0xc1ba('0x4f')][_0xc1ba('0x50')]?_0x572f42[_0xc1ba('0x4f')]:_0x55790f['model'];if(!_0x3606ca[_0xc1ba('0x4e')][_0xc1ba('0x51')]('nolimit')){_0x572f42[_0xc1ba('0x24')]=qs['limit'](_0x3606ca[_0xc1ba('0x4e')][_0xc1ba('0x24')]);_0x572f42['offset']=qs['offset'](_0x3606ca[_0xc1ba('0x4e')]['offset']);}_0x572f42[_0xc1ba('0x74')]=qs[_0xc1ba('0x53')](_0x3606ca[_0xc1ba('0x4e')]['sort']);_0x572f42[_0xc1ba('0x54')]=qs[_0xc1ba('0x4c')](_['pick'](_0x3606ca[_0xc1ba('0x4e')],_0x55790f['filters']));_0x572f42[_0xc1ba('0x54')][_0xc1ba('0x76')]=_0x2d558a['id'];if(_0x3606ca[_0xc1ba('0x4e')][_0xc1ba('0x56')]){_0x572f42[_0xc1ba('0x54')]=_['merge'](_0x572f42['where'],{'$or':_[_0xc1ba('0x46')](_0x572f42['attributes'],function(_0xf16407){var _0x1c56e1={};_0x1c56e1[_0xf16407]={'$like':'%'+_0x3606ca[_0xc1ba('0x4e')][_0xc1ba('0x56')]+'%'};return _0x1c56e1;})});}_0x572f42=_[_0xc1ba('0x57')]({},_0x572f42,_0x3606ca[_0xc1ba('0x58')]);return db[_0xc1ba('0xbc')][_0xc1ba('0x26')]({'where':_0x572f42['where']})[_0xc1ba('0x18')](function(_0x37ed73){_0x25695f['count']=_0x37ed73;if(_0x3606ca['query'][_0xc1ba('0x59')]){_0x572f42['include']=[{'model':db[_0xc1ba('0xa4')],'as':'Contact','required':![]},{'model':db[_0xc1ba('0xca')],'as':_0xc1ba('0x101'),'attributes':['name',_0xc1ba('0x102'),_0xc1ba('0x103')],'required':![]},{'model':db[_0xc1ba('0x104')],'as':_0xc1ba('0x105'),'attributes':['id','name',_0xc1ba('0x106')],'where':_0x3606ca[_0xc1ba('0x4e')]['tag']?{'id':_0x3606ca[_0xc1ba('0x4e')][_0xc1ba('0x107')]}:undefined,'required':_0x3606ca[_0xc1ba('0x4e')][_0xc1ba('0x107')]?!![]:![]}];}return db[_0xc1ba('0xbc')][_0xc1ba('0x5a')](_0x572f42);})[_0xc1ba('0x18')](function(_0x1b34f8){_0x25695f['rows']=_0x1b34f8;return _0x25695f;});}})[_0xc1ba('0x18')](respondWithFilteredResult(_0x3587d2,_0x572f42))[_0xc1ba('0x5b')](handleError(_0x3587d2,null));};exports[_0xc1ba('0x108')]=function(_0x4ce112,_0x8d81c6){var _0x31ecaf=0x0;var _0x223b8e=0x0;var _0x9cc0c3=![];var _0x54a086;var _0x2b3250;return db[_0xc1ba('0x47')][_0xc1ba('0x6c')]({'where':{'id':_0x4ce112[_0xc1ba('0x5d')]['id']},'include':[{'model':db[_0xc1ba('0x99')],'as':_0xc1ba('0x99'),'include':[{'model':db[_0xc1ba('0x99')],'as':_0xc1ba('0xb0'),'attributes':['id',_0xc1ba('0x109')]}]}]})[_0xc1ba('0x18')](handleEntityNotFound(_0x8d81c6,null))['then'](function(_0x2cc74d){if(_0x2cc74d){_0x54a086=_0x2cc74d;return _0x2cc74d[_0xc1ba('0x10a')]({'raw':!![]});}})['then'](function(_0x32646e){if(_0x54a086){if(_0x32646e){_0x2b3250=_0x32646e;}}return require('../../config/license/util')[_0xc1ba('0x8b')]();})['then'](function(_0x29f5c4){if(_0x29f5c4){_0x223b8e=_0x29f5c4[_0xc1ba('0x10b')];_0x9cc0c3=_0x29f5c4[_0xc1ba('0x8c')];}})[_0xc1ba('0x18')](function(){return db['ChatInteraction'][_0xc1ba('0x26')]({'where':{'closed':![]}});})[_0xc1ba('0x18')](function(_0xaddac8){_0x31ecaf=_0xaddac8;if(_0x223b8e&&_0xaddac8>_0x223b8e){return db[_0xc1ba('0x10c')][_0xc1ba('0x73')]({'where':{'id':0x1}})[_0xc1ba('0x18')](function(_0x226083){if(_0x226083){_0x226083[_0xc1ba('0x10d')]('chatLicenseExceeded');}});}})[_0xc1ba('0x18')](function(){var _0x3e5867=_0x54a086[_0xc1ba('0x99')];var _0x5575a4=_0x54a086['timezone']||undefined;return _0x3e5867?_0x3e5867[_0xc1ba('0x9b')](_0x5575a4):!![];})[_0xc1ba('0x18')](function(_0x32d67c){var _0x4972d6=fs['readFileSync'](path[_0xc1ba('0x8e')](config[_0xc1ba('0x89')],_0xc1ba('0x10e')),_0xc1ba('0x10f'));var _0x6e3d39=_0xc1ba('0x110');var _0x22ed63=![];var _0x573060,_0x528f1f;if(_0x4ce112[_0xc1ba('0xb9')][_0xc1ba('0x3a')]){_0x573060=new URL(_0x4ce112[_0xc1ba('0xb9')][_0xc1ba('0x3a')])[_0xc1ba('0x111')];}else if(_0x4ce112[_0xc1ba('0xb9')][_0xc1ba('0x111')]){_0x573060=new URL(_0x4ce112[_0xc1ba('0xb9')][_0xc1ba('0x111')])['origin'];}else{_0x573060=_0xc1ba('0x112');}_0x528f1f=typeof _0x54a086[_0xc1ba('0x61')][_0xc1ba('0x62')](',')[_0xc1ba('0x6c')](function(_0x3da800){return wildcardUtils[_0xc1ba('0x113')](_0x3da800,_0x573060);})!==_0xc1ba('0x25');var _0x5734de={'chatVersion':_0x6e3d39,'chatWebsiteAddressOrigin':_0x528f1f?_0x573060:_0x54a086[_0xc1ba('0x61')],'remote':_0x54a086[_0xc1ba('0x114')],'query':querystring[_0xc1ba('0x1b')](_[_0xc1ba('0x57')](_0x54a086[_0xc1ba('0x6a')]({'plain':!![]}),{'customerIp':_0x4ce112[_0xc1ba('0xb9')][_0xc1ba('0x35')]||_0x4ce112['headers'][_0xc1ba('0x115')]||_0x4ce112[_0xc1ba('0x116')][_0xc1ba('0x117')]||_0x4ce112['ip'],'referer':_0x4ce112[_0xc1ba('0xb9')][_0xc1ba('0x3a')],'openedInteractions':_0x31ecaf,'maxInteractions':_0x223b8e,'virtual':_0x9cc0c3[_0xc1ba('0x10b')],'online':_0x32d67c,'custom':_0x9cc0c3,'address':_0x528f1f?_0x573060:null}))[_0xc1ba('0x118')](/'/g,'\x5c\x27')};_0x8d81c6[_0xc1ba('0xd7')](ejs['render'](Mustache[_0xc1ba('0xe0')](_0x4972d6,_0x5734de),{'proactiveActions':_0x2b3250,'alignment':_0x54a086[_0xc1ba('0x119')],'verticalAlignment':_0x54a086[_0xc1ba('0x11a')],'div_color':_0x54a086['color'],'labelText':_0x54a086[_0xc1ba('0x11b')],'text_color':_0x54a086['textColor'],'text_button_color':_0x54a086[_0xc1ba('0x11c')],'button_color':_0x54a086['color_button'],'background_color':_0x54a086[_0xc1ba('0x11d')],'hideWhenOffline':_0x54a086[_0xc1ba('0x11e')],'intervalId':_0x54a086[_0xc1ba('0x11f')],'isDevelopment':_0x22ed63,'chatVersion':_0x6e3d39}));})[_0xc1ba('0x5b')](handleError(_0x8d81c6,null));};exports[_0xc1ba('0x120')]=function(_0x26343d,_0x3e27b4){var _0x54f94b=_0x26343d[_0xc1ba('0x5d')]['id'];var _0x21673e=_0x26343d['body'];var _0x3c9f04=0xc8;var _0x5dc1df=null;return db[_0xc1ba('0xeb')][_0xc1ba('0xec')]({'isolationLevel':db[_0xc1ba('0xeb')][_0xc1ba('0x121')][_0xc1ba('0x122')][_0xc1ba('0x123')]},function(_0x99f87){return db[_0xc1ba('0x47')][_0xc1ba('0x73')]({'where':{'id':_0x54f94b},'transaction':_0x99f87})[_0xc1ba('0x18')](function(_0x36b6ee){if(_0x36b6ee){return db[_0xc1ba('0xae')]['destroy']({'where':{'ChatWebsiteId':_0x54f94b},'transaction':_0x99f87})['then'](function(){var _0x230796=_[_0xc1ba('0x46')](_0x21673e,function(_0x1be48c){_0x1be48c['ChatWebsiteId']=_0x54f94b;return _0x1be48c;});return db[_0xc1ba('0xae')]['bulkCreate'](_0x230796,{'transaction':_0x99f87});});}else{_0x3c9f04=0x194;_0x5dc1df=[];}});})[_0xc1ba('0x18')](function(){if(_0x3c9f04!==0x194){return db['ChatApplication']['findAndCountAll']({'where':{'ChatWebsiteId':_0x54f94b},'order':_0xc1ba('0xb4')})[_0xc1ba('0x18')](function(_0x59d09f){_0x5dc1df=_0x59d09f;});}})[_0xc1ba('0x5b')](function(_0x477b8f){_0x3c9f04=0x1f4;logger[_0xc1ba('0x1c')](_0x477b8f[_0xc1ba('0x2e')]);if(_0x477b8f[_0xc1ba('0x2f')]){delete _0x477b8f[_0xc1ba('0x2f')];}_0x5dc1df=_0x477b8f;})[_0xc1ba('0x124')](function(){if(_0x5dc1df===null){_0x3e27b4['sendStatus'](_0x3c9f04);}else{if(_0x3c9f04===0x1f4){_0x3e27b4[_0xc1ba('0x21')](_0x3c9f04)['send'](_0x5dc1df);}else{_0x3e27b4[_0xc1ba('0x21')](_0x3c9f04)[_0xc1ba('0x23')](_0x5dc1df);}}});};exports[_0xc1ba('0x125')]=function(_0x58e1e0,_0x330783){var _0x6c3f28={};var _0xef66ce={};var _0x362db8;var _0x271c32;return db['ChatWebsite']['findOne']({'where':{'id':_0x58e1e0[_0xc1ba('0x5d')]['id']}})['then'](handleEntityNotFound(_0x330783,null))[_0xc1ba('0x18')](function(_0x5376ee){if(_0x5376ee){_0x362db8=_0x5376ee;_0xef66ce[_0xc1ba('0x41')]=_['keys'](db[_0xc1ba('0xae')]['rawAttributes']);_0xef66ce[_0xc1ba('0x4e')]=_[_0xc1ba('0x4b')](_0x58e1e0['query']);_0xef66ce[_0xc1ba('0x4c')]=_[_0xc1ba('0x4d')](_0xef66ce['model'],_0xef66ce['query']);_0x6c3f28[_0xc1ba('0x4f')]=_[_0xc1ba('0x4d')](_0xef66ce[_0xc1ba('0x41')],qs[_0xc1ba('0x5f')](_0x58e1e0[_0xc1ba('0x4e')][_0xc1ba('0x5f')]));_0x6c3f28['attributes']=_0x6c3f28['attributes'][_0xc1ba('0x50')]?_0x6c3f28[_0xc1ba('0x4f')]:_0xef66ce[_0xc1ba('0x41')];_0x6c3f28[_0xc1ba('0x74')]=qs['sort'](_0x58e1e0[_0xc1ba('0x4e')][_0xc1ba('0x53')]);_0x6c3f28[_0xc1ba('0x54')]=qs[_0xc1ba('0x4c')](_[_0xc1ba('0x75')](_0x58e1e0[_0xc1ba('0x4e')],_0xef66ce['filters']));if(_0x58e1e0[_0xc1ba('0x4e')][_0xc1ba('0x56')]){_0x6c3f28['where']=_['merge'](_0x6c3f28[_0xc1ba('0x54')],{'$or':_[_0xc1ba('0x46')](_0x6c3f28[_0xc1ba('0x4f')],function(_0xf87c8b){var _0x11119c={};_0x11119c[_0xf87c8b]={'$like':'%'+_0x58e1e0[_0xc1ba('0x4e')]['filter']+'%'};return _0x11119c;})});}_0x6c3f28=_['merge']({},_0x6c3f28,_0x58e1e0['options']);return _0x362db8[_0xc1ba('0x125')](_0x6c3f28);}})[_0xc1ba('0x18')](function(_0x416f01){if(_0x416f01){_0x271c32=_0x416f01[_0xc1ba('0x50')];if(!_0x58e1e0[_0xc1ba('0x4e')][_0xc1ba('0x51')](_0xc1ba('0x52'))){_0x6c3f28[_0xc1ba('0x24')]=qs[_0xc1ba('0x24')](_0x58e1e0[_0xc1ba('0x4e')][_0xc1ba('0x24')]);_0x6c3f28[_0xc1ba('0x27')]=qs[_0xc1ba('0x27')](_0x58e1e0['query'][_0xc1ba('0x27')]);}return _0x362db8['getApplications'](_0x6c3f28);}})[_0xc1ba('0x18')](function(_0x3d1de0){if(_0x3d1de0){return _0x3d1de0?{'count':_0x271c32,'rows':_0x3d1de0}:null;}})[_0xc1ba('0x18')](respondWithResult(_0x330783,null))[_0xc1ba('0x5b')](handleError(_0x330783,null));};exports[_0xc1ba('0x126')]=function(_0x12821f,_0x33e929){return db[_0xc1ba('0x127')]['find']({'where':{'id':_0x12821f[_0xc1ba('0x5d')]['id']}})[_0xc1ba('0x18')](handleEntityNotFound(_0x33e929,null))[_0xc1ba('0x18')](function(_0x487392){if(_0x487392){return _0x487392[_0xc1ba('0x126')](_0x12821f[_0xc1ba('0x60')]['ids'],_[_0xc1ba('0xff')](_0x12821f[_0xc1ba('0x60')],['ids','id'])||{});}})[_0xc1ba('0x18')](respondWithResult(_0x33e929,null))['catch'](handleError(_0x33e929,null));};exports['getProactiveActions']=function(_0x741fb7,_0x2080bc){var _0x293aa9={};var _0x538319={};var _0x2824d5;var _0x581523;return db['ChatWebsite'][_0xc1ba('0x73')]({'where':{'id':_0x741fb7[_0xc1ba('0x5d')]['id']}})[_0xc1ba('0x18')](handleEntityNotFound(_0x2080bc,null))[_0xc1ba('0x18')](function(_0xdd5ae6){if(_0xdd5ae6){_0x2824d5=_0xdd5ae6;_0x538319[_0xc1ba('0x41')]=_[_0xc1ba('0x4b')](db[_0xc1ba('0x128')][_0xc1ba('0x48')]);_0x538319[_0xc1ba('0x4e')]=_[_0xc1ba('0x4b')](_0x741fb7[_0xc1ba('0x4e')]);_0x538319[_0xc1ba('0x4c')]=_[_0xc1ba('0x4d')](_0x538319[_0xc1ba('0x41')],_0x538319[_0xc1ba('0x4e')]);_0x293aa9['attributes']=_[_0xc1ba('0x4d')](_0x538319[_0xc1ba('0x41')],qs['fields'](_0x741fb7[_0xc1ba('0x4e')][_0xc1ba('0x5f')]));_0x293aa9[_0xc1ba('0x4f')]=_0x293aa9[_0xc1ba('0x4f')][_0xc1ba('0x50')]?_0x293aa9[_0xc1ba('0x4f')]:_0x538319[_0xc1ba('0x41')];_0x293aa9[_0xc1ba('0x74')]=qs[_0xc1ba('0x53')](_0x741fb7[_0xc1ba('0x4e')][_0xc1ba('0x53')]);_0x293aa9[_0xc1ba('0x54')]=qs[_0xc1ba('0x4c')](_[_0xc1ba('0x75')](_0x741fb7[_0xc1ba('0x4e')],_0x538319[_0xc1ba('0x4c')]));if(_0x741fb7[_0xc1ba('0x4e')][_0xc1ba('0x56')]){_0x293aa9[_0xc1ba('0x54')]=_[_0xc1ba('0x57')](_0x293aa9[_0xc1ba('0x54')],{'$or':_[_0xc1ba('0x46')](_0x293aa9[_0xc1ba('0x4f')],function(_0x44ea99){var _0x8772fb={};_0x8772fb[_0x44ea99]={'$like':'%'+_0x741fb7[_0xc1ba('0x4e')]['filter']+'%'};return _0x8772fb;})});}_0x293aa9=_['merge']({},_0x293aa9,_0x741fb7[_0xc1ba('0x58')]);return _0x2824d5[_0xc1ba('0x10a')](_0x293aa9);}})['then'](function(_0x5c55b0){if(_0x5c55b0){_0x581523=_0x5c55b0[_0xc1ba('0x50')];if(!_0x741fb7[_0xc1ba('0x4e')][_0xc1ba('0x51')](_0xc1ba('0x52'))){_0x293aa9[_0xc1ba('0x24')]=qs['limit'](_0x741fb7[_0xc1ba('0x4e')]['limit']);_0x293aa9[_0xc1ba('0x27')]=qs[_0xc1ba('0x27')](_0x741fb7[_0xc1ba('0x4e')][_0xc1ba('0x27')]);}return _0x2824d5[_0xc1ba('0x10a')](_0x293aa9);}})[_0xc1ba('0x18')](function(_0x35fcd1){if(_0x35fcd1){return _0x35fcd1?{'count':_0x581523,'rows':_0x35fcd1}:null;}})[_0xc1ba('0x18')](respondWithResult(_0x2080bc,null))['catch'](handleError(_0x2080bc,null));};exports[_0xc1ba('0x129')]=function(_0x388ae5,_0x378156){var _0x4543fc=_0x388ae5['query']['online']===_0xc1ba('0x12a')?_0xc1ba('0x12b'):_0xc1ba('0x12c');return db['ChatWebsite'][_0xc1ba('0x6c')]({'attributes':['id',_0x4543fc],'where':{'id':_0x388ae5['params']['id']}})[_0xc1ba('0x18')](handleEntityNotFound(_0x378156,null))[_0xc1ba('0x18')](function(_0x5ce398){if(_0x5ce398){var _0x5b3a4d=_0x5ce398[_0x4543fc];var _0x232f0b=_0x5b3a4d&&_0x5b3a4d[_0xc1ba('0x12d')]?_0x5b3a4d[_0xc1ba('0x12d')]:[];_0x378156['send']({'fromKey':_[_0xc1ba('0x8d')](_0x5b3a4d['fromKey'])?undefined:_0x5b3a4d['fromKey'],'count':_0x232f0b['length'],'rows':_0x232f0b});}})['catch'](handleError(_0x378156,null));};exports[_0xc1ba('0x12e')]=function(_0x5a06b1,_0x204a93){var _0x58339f={'raw':![],'where':{}};var _0x2f5e63={};var _0x11b2b4={'count':0x0,'rows':[]};return db[_0xc1ba('0x47')][_0xc1ba('0x73')]({'where':{'id':_0x5a06b1[_0xc1ba('0x5d')]['id']}})[_0xc1ba('0x18')](handleEntityNotFound(_0x204a93,null))['then'](function(_0x3289b0){if(_0x3289b0){_0x2f5e63['model']=_[_0xc1ba('0x4b')](db[_0xc1ba('0xe3')][_0xc1ba('0x48')]);_0x2f5e63['query']=_[_0xc1ba('0x4b')](_0x5a06b1[_0xc1ba('0x4e')]);_0x2f5e63['filters']=_[_0xc1ba('0x4d')](_0x2f5e63[_0xc1ba('0x41')],_0x2f5e63[_0xc1ba('0x4e')]);_0x58339f['attributes']=_[_0xc1ba('0x4d')](_0x2f5e63['model'],qs[_0xc1ba('0x5f')](_0x5a06b1[_0xc1ba('0x4e')][_0xc1ba('0x5f')]));_0x58339f[_0xc1ba('0x4f')]=_0x58339f[_0xc1ba('0x4f')][_0xc1ba('0x50')]?_0x58339f[_0xc1ba('0x4f')]:_0x2f5e63[_0xc1ba('0x41')];if(!_0x5a06b1[_0xc1ba('0x4e')]['hasOwnProperty']('nolimit')){_0x58339f[_0xc1ba('0x24')]=qs[_0xc1ba('0x24')](_0x5a06b1['query'][_0xc1ba('0x24')]);_0x58339f[_0xc1ba('0x27')]=qs[_0xc1ba('0x27')](_0x5a06b1[_0xc1ba('0x4e')][_0xc1ba('0x27')]);}_0x58339f[_0xc1ba('0x74')]=qs[_0xc1ba('0x53')](_0x5a06b1[_0xc1ba('0x4e')]['sort']);_0x58339f[_0xc1ba('0x54')]=qs[_0xc1ba('0x4c')](_[_0xc1ba('0x75')](_0x5a06b1[_0xc1ba('0x4e')],_0x2f5e63[_0xc1ba('0x4c')]));_0x58339f[_0xc1ba('0x54')]['ChatWebsiteId']=_0x3289b0['id'];if(_0x5a06b1[_0xc1ba('0x4e')][_0xc1ba('0x56')]){_0x58339f[_0xc1ba('0x54')]=_[_0xc1ba('0x57')](_0x58339f['where'],{'$or':_[_0xc1ba('0x46')](_0x58339f[_0xc1ba('0x4f')],function(_0x2014c7){var _0x384864={};_0x384864[_0x2014c7]={'$like':'%'+_0x5a06b1[_0xc1ba('0x4e')][_0xc1ba('0x56')]+'%'};return _0x384864;})});}_0x58339f=_['merge']({},_0x58339f,_0x5a06b1['options']);return db[_0xc1ba('0xe3')][_0xc1ba('0x26')]({'where':_0x58339f[_0xc1ba('0x54')]})[_0xc1ba('0x18')](function(_0x401525){_0x11b2b4[_0xc1ba('0x26')]=_0x401525;if(_0x5a06b1['query']['includeAll']){_0x58339f[_0xc1ba('0x77')]=[{'all':!![]}];}else{_0x58339f[_0xc1ba('0x77')]=[{'model':db[_0xc1ba('0xa4')],'as':_0xc1ba('0x12f'),'required':![]},{'model':db[_0xc1ba('0x130')],'as':_0xc1ba('0x131'),'required':![]}];}return db['ChatOfflineMessage'][_0xc1ba('0x5a')](_0x58339f);})['then'](function(_0x1dadd2){_0x11b2b4[_0xc1ba('0x78')]=_0x1dadd2;return _0x11b2b4;});}})[_0xc1ba('0x18')](respondWithFilteredResult(_0x204a93,_0x58339f))[_0xc1ba('0x5b')](handleError(_0x204a93,null));};exports[_0xc1ba('0x132')]=function(_0x56b76b,_0x55295a){return db[_0xc1ba('0x47')][_0xc1ba('0x6c')]({'where':{'id':_0x56b76b[_0xc1ba('0x5d')]['id']}})['then'](handleEntityNotFound(_0x55295a,null))[_0xc1ba('0x18')](function(_0x1a04f8){if(_0x1a04f8){return _0x1a04f8[_0xc1ba('0x132')](_0x56b76b[_0xc1ba('0x60')][_0xc1ba('0x7a')],_[_0xc1ba('0xff')](_0x56b76b[_0xc1ba('0x60')],[_0xc1ba('0x7a'),'id'])||{})[_0xc1ba('0xdd')](function(_0x237a91){for(var _0x7d14f1=0x0;_0x7d14f1<_0x56b76b['body'][_0xc1ba('0x7a')][_0xc1ba('0x50')];_0x7d14f1+=0x1){socket[_0xc1ba('0x133')]('userChatWebsite:save',{'UserId':Number(_0x56b76b[_0xc1ba('0x60')]['ids'][_0x7d14f1]),'ChatWebsiteId':Number(_0x56b76b[_0xc1ba('0x5d')]['id'])});}return _0x237a91;});}})[_0xc1ba('0x18')](respondWithResult(_0x55295a,null))[_0xc1ba('0x5b')](handleError(_0x55295a,null));};exports[_0xc1ba('0x134')]=function(_0x48e5fd,_0x741ce0){return db[_0xc1ba('0x47')][_0xc1ba('0x6c')]({'where':{'id':_0x48e5fd[_0xc1ba('0x5d')]['id']}})['then'](handleEntityNotFound(_0x741ce0,null))[_0xc1ba('0x18')](function(_0x297026){if(_0x297026){return _0x297026[_0xc1ba('0x134')](_0x48e5fd[_0xc1ba('0x4e')][_0xc1ba('0x7a')])[_0xc1ba('0x18')](function(){if(_['isArray'](_0x48e5fd['query'][_0xc1ba('0x7a')])){for(var _0xd1983d=0x0;_0xd1983d<_0x48e5fd[_0xc1ba('0x4e')][_0xc1ba('0x7a')][_0xc1ba('0x50')];_0xd1983d+=0x1){socket[_0xc1ba('0x133')](_0xc1ba('0x135'),{'UserId':Number(_0x48e5fd[_0xc1ba('0x4e')][_0xc1ba('0x7a')][_0xd1983d]),'ChatWebsiteId':Number(_0x48e5fd[_0xc1ba('0x5d')]['id'])});}}else{socket[_0xc1ba('0x133')](_0xc1ba('0x135'),{'UserId':Number(_0x48e5fd[_0xc1ba('0x4e')][_0xc1ba('0x7a')]),'ChatWebsiteId':Number(_0x48e5fd[_0xc1ba('0x5d')]['id'])});}});}})[_0xc1ba('0x18')](respondWithStatusCode(_0x741ce0,null))[_0xc1ba('0x5b')](handleError(_0x741ce0,null));};exports['getAgents']=function(_0x11a338,_0x2eae28){var _0x256d9c={};var _0x4988b0={};var _0x2b8fa0;var _0x3446f9;return db[_0xc1ba('0x47')][_0xc1ba('0x73')]({'where':{'id':_0x11a338[_0xc1ba('0x5d')]['id']}})['then'](handleEntityNotFound(_0x2eae28,null))[_0xc1ba('0x18')](function(_0x56c8ba){if(_0x56c8ba){_0x2b8fa0=_0x56c8ba;_0x4988b0[_0xc1ba('0x41')]=_['keys'](db[_0xc1ba('0xca')][_0xc1ba('0x48')]);_0x4988b0['query']=_[_0xc1ba('0x4b')](_0x11a338[_0xc1ba('0x4e')]);_0x4988b0[_0xc1ba('0x4c')]=_[_0xc1ba('0x4d')](_0x4988b0[_0xc1ba('0x41')],_0x4988b0[_0xc1ba('0x4e')]);_0x256d9c[_0xc1ba('0x4f')]=_[_0xc1ba('0x4d')](_0x4988b0[_0xc1ba('0x41')],qs['fields'](_0x11a338[_0xc1ba('0x4e')][_0xc1ba('0x5f')]));_0x256d9c[_0xc1ba('0x4f')]=_0x256d9c[_0xc1ba('0x4f')][_0xc1ba('0x50')]?_0x256d9c[_0xc1ba('0x4f')]:_0x4988b0[_0xc1ba('0x41')];_0x256d9c['order']=qs[_0xc1ba('0x53')](_0x11a338[_0xc1ba('0x4e')][_0xc1ba('0x53')]);_0x256d9c[_0xc1ba('0x54')]=qs[_0xc1ba('0x4c')](_[_0xc1ba('0x75')](_0x11a338[_0xc1ba('0x4e')],_0x4988b0[_0xc1ba('0x4c')]));if(_0x11a338[_0xc1ba('0x4e')][_0xc1ba('0x56')]){_0x256d9c[_0xc1ba('0x54')]=_[_0xc1ba('0x57')](_0x256d9c[_0xc1ba('0x54')],{'$or':_[_0xc1ba('0x46')](_0x256d9c[_0xc1ba('0x4f')],function(_0x58b21e){var _0x3420e2={};_0x3420e2[_0x58b21e]={'$like':'%'+_0x11a338[_0xc1ba('0x4e')]['filter']+'%'};return _0x3420e2;})});}_0x256d9c=_[_0xc1ba('0x57')]({},_0x256d9c,_0x11a338[_0xc1ba('0x58')]);return _0x2b8fa0[_0xc1ba('0x136')](_0x256d9c);}})['then'](function(_0x277bc6){if(_0x277bc6){_0x3446f9=_0x277bc6[_0xc1ba('0x50')];if(!_0x11a338['query'][_0xc1ba('0x51')](_0xc1ba('0x52'))){_0x256d9c[_0xc1ba('0x24')]=qs[_0xc1ba('0x24')](_0x11a338[_0xc1ba('0x4e')][_0xc1ba('0x24')]);_0x256d9c[_0xc1ba('0x27')]=qs[_0xc1ba('0x27')](_0x11a338['query']['offset']);}return _0x2b8fa0[_0xc1ba('0x136')](_0x256d9c);}})[_0xc1ba('0x18')](function(_0x41aa0d){if(_0x41aa0d){return _0x41aa0d?{'count':_0x3446f9,'rows':_0x41aa0d}:null;}})[_0xc1ba('0x18')](respondWithResult(_0x2eae28,null))[_0xc1ba('0x5b')](handleError(_0x2eae28,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 749aa8f..2aeb761 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 _0x1793=['ChatWebsite','setMaxListeners','update','remove','emit','hasOwnProperty','events','../../mysqldb'];(function(_0x656c05,_0x1d4b18){var _0x28475a=function(_0x21ef6a){while(--_0x21ef6a){_0x656c05['push'](_0x656c05['shift']());}};_0x28475a(++_0x1d4b18);}(_0x1793,0x1ce));var _0x3179=function(_0x124d74,_0x18eda2){_0x124d74=_0x124d74-0x0;var _0x46418e=_0x1793[_0x124d74];return _0x46418e;};'use strict';var EventEmitter=require(_0x3179('0x0'));var ChatWebsite=require(_0x3179('0x1'))['db'][_0x3179('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x3179('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x3179('0x4'),'afterDestroy':_0x3179('0x5')};function emitEvent(_0xadb4b9){return function(_0x1e67c2,_0x24b4db,_0x58bd3d){ChatWebsiteEvents['emit'](_0xadb4b9+':'+_0x1e67c2['id'],_0x1e67c2);ChatWebsiteEvents[_0x3179('0x6')](_0xadb4b9,_0x1e67c2);_0x58bd3d(null);};}for(var e in events){if(events[_0x3179('0x7')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents; \ No newline at end of file +var _0xb7c8=['exports','../../mysqldb','ChatWebsite','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xb7c8,0x119));var _0x8b7c=function(_0x51ef3f,_0xc037d6){_0x51ef3f=_0x51ef3f-0x0;var _0x14956c=_0xb7c8[_0x51ef3f];return _0x14956c;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0x8b7c('0x0'))['db'][_0x8b7c('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x8b7c('0x2')](0x0);var events={'afterCreate':_0x8b7c('0x3'),'afterUpdate':_0x8b7c('0x4'),'afterDestroy':_0x8b7c('0x5')};function emitEvent(_0x396b64){return function(_0x50113e,_0x38672b,_0x412f93){ChatWebsiteEvents[_0x8b7c('0x6')](_0x396b64+':'+_0x50113e['id'],_0x50113e);ChatWebsiteEvents[_0x8b7c('0x6')](_0x396b64,_0x50113e);_0x412f93(null);};}for(var e in events){if(events[_0x8b7c('0x7')](e)){var event=events[e];ChatWebsite[_0x8b7c('0x8')](e,emitEvent(event));}}module[_0x8b7c('0x9')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index 1461f17..fec586d 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 _0xb521=['define','ChatWebsite','chat_websites','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0xbede53,_0x449891){var _0x189791=function(_0x21bf45){while(--_0x21bf45){_0xbede53['push'](_0xbede53['shift']());}};_0x189791(++_0x449891);}(_0xb521,0x147));var _0x1b52=function(_0x996bc8,_0x291e01){_0x996bc8=_0x996bc8-0x0;var _0x20b0ea=_0xb521[_0x996bc8];return _0x20b0ea;};'use strict';var _=require(_0x1b52('0x0'));var util=require('util');var logger=require(_0x1b52('0x1'))(_0x1b52('0x2'));var moment=require('moment');var BPromise=require(_0x1b52('0x3'));var rp=require(_0x1b52('0x4'));var fs=require('fs');var path=require(_0x1b52('0x5'));var rimraf=require(_0x1b52('0x6'));var config=require(_0x1b52('0x7'));var attributes=require('./chatWebsite.attributes');module[_0x1b52('0x8')]=function(_0x2e9c68,_0x45c27d){return _0x2e9c68[_0x1b52('0x9')](_0x1b52('0xa'),attributes,{'tableName':_0x1b52('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8d84=['define','chat_websites','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./chatWebsite.attributes'];(function(_0x262c93,_0x1ea044){var _0x2c5ffb=function(_0x5ac2fa){while(--_0x5ac2fa){_0x262c93['push'](_0x262c93['shift']());}};_0x2c5ffb(++_0x1ea044);}(_0x8d84,0x1e6));var _0x48d8=function(_0x5bbfd9,_0x382604){_0x5bbfd9=_0x5bbfd9-0x0;var _0x3e8e4a=_0x8d84[_0x5bbfd9];return _0x3e8e4a;};'use strict';var _=require(_0x48d8('0x0'));var util=require(_0x48d8('0x1'));var logger=require(_0x48d8('0x2'))(_0x48d8('0x3'));var moment=require(_0x48d8('0x4'));var BPromise=require('bluebird');var rp=require(_0x48d8('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x48d8('0x6'));var config=require(_0x48d8('0x7'));var attributes=require(_0x48d8('0x8'));module['exports']=function(_0x3ecaa7,_0x4fb484){return _0x3ecaa7[_0x48d8('0x9')]('ChatWebsite',attributes,{'tableName':_0x48d8('0xa'),'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 9773c99..d7da9bc 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 _0xa999=['rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','util','moment','ioredis','../../mysqldb','../../config/utils'];(function(_0x1875e,_0x4cc666){var _0x1b0231=function(_0x2f159a){while(--_0x2f159a){_0x1875e['push'](_0x1875e['shift']());}};_0x1b0231(++_0x4cc666);}(_0xa999,0x1f3));var _0x9a99=function(_0x3aeaf4,_0x3f1405){_0x3aeaf4=_0x3aeaf4-0x0;var _0x45975e=_0xa999[_0x3aeaf4];return _0x45975e;};'use strict';var _=require('lodash');var util=require(_0x9a99('0x0'));var moment=require(_0x9a99('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9a99('0x2'));var db=require(_0x9a99('0x3'))['db'];var utils=require(_0x9a99('0x4'));var logger=require('../../config/logger')(_0x9a99('0x5'));var config=require(_0x9a99('0x6'));var jayson=require(_0x9a99('0x7'));var client=jayson[_0x9a99('0x8')][_0x9a99('0x9')]({'port':0x232a});config[_0x9a99('0xa')]=_['defaults'](config[_0x9a99('0xa')],{'host':_0x9a99('0xb'),'port':0x18eb});var socket=require(_0x9a99('0xc'))(new Redis(config[_0x9a99('0xa')]));require('./chatWebsite.socket')[_0x9a99('0xd')](socket);function respondWithRpcPromise(_0x56a164,_0x126484,_0x4e7235){return new BPromise(function(_0x5385ec,_0x58ec10){return client['request'](_0x56a164,_0x4e7235)[_0x9a99('0xe')](function(_0x3fef30){logger['info'](_0x9a99('0xf'),_0x126484,_0x9a99('0x10'));logger[_0x9a99('0x11')](_0x9a99('0x12'),_0x126484,_0x9a99('0x10'),JSON[_0x9a99('0x13')](_0x3fef30));if(_0x3fef30[_0x9a99('0x14')]){if(_0x3fef30[_0x9a99('0x14')]['code']===0x1f4){logger['error'](_0x9a99('0xf'),_0x126484,_0x3fef30['error']['message']);return _0x58ec10(_0x3fef30[_0x9a99('0x14')]['message']);}logger[_0x9a99('0x14')](_0x9a99('0xf'),_0x126484,_0x3fef30[_0x9a99('0x14')][_0x9a99('0x15')]);return _0x5385ec(_0x3fef30['error']['message']);}else{logger[_0x9a99('0x16')](_0x9a99('0xf'),_0x126484,_0x9a99('0x10'));_0x5385ec(_0x3fef30['result'][_0x9a99('0x15')]);}})[_0x9a99('0x17')](function(_0xa57d0d){logger[_0x9a99('0x14')](_0x9a99('0xf'),_0x126484,_0xa57d0d);_0x58ec10(_0xa57d0d);});});} \ No newline at end of file +var _0xa02a=['defaults','localhost','socket.io-emitter','redis','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x462162,_0x3d8348){var _0x22881c=function(_0xafa602){while(--_0xafa602){_0x462162['push'](_0x462162['shift']());}};_0x22881c(++_0x3d8348);}(_0xa02a,0xc6));var _0xaa02=function(_0x55e461,_0x4ca0a0){_0x55e461=_0x55e461-0x0;var _0x181c13=_0xa02a[_0x55e461];return _0x181c13;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xaa02('0x0'));var BPromise=require(_0xaa02('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaa02('0x2'))['db'];var utils=require(_0xaa02('0x3'));var logger=require(_0xaa02('0x4'))(_0xaa02('0x5'));var config=require(_0xaa02('0x6'));var jayson=require(_0xaa02('0x7'));var client=jayson[_0xaa02('0x8')][_0xaa02('0x9')]({'port':0x232a});config['redis']=_[_0xaa02('0xa')](config['redis'],{'host':_0xaa02('0xb'),'port':0x18eb});var socket=require(_0xaa02('0xc'))(new Redis(config[_0xaa02('0xd')]));require('./chatWebsite.socket')['register'](socket);function respondWithRpcPromise(_0x5ba7fa,_0x35711c,_0x5e9f71){return new BPromise(function(_0x5b13c2,_0x11ba9f){return client[_0xaa02('0xe')](_0x5ba7fa,_0x5e9f71)[_0xaa02('0xf')](function(_0x2fe111){logger[_0xaa02('0x10')](_0xaa02('0x11'),_0x35711c,_0xaa02('0x12'));logger[_0xaa02('0x13')](_0xaa02('0x14'),_0x35711c,'request\x20sent',JSON[_0xaa02('0x15')](_0x2fe111));if(_0x2fe111['error']){if(_0x2fe111[_0xaa02('0x16')][_0xaa02('0x17')]===0x1f4){logger[_0xaa02('0x16')](_0xaa02('0x11'),_0x35711c,_0x2fe111['error']['message']);return _0x11ba9f(_0x2fe111['error']['message']);}logger[_0xaa02('0x16')](_0xaa02('0x11'),_0x35711c,_0x2fe111[_0xaa02('0x16')][_0xaa02('0x18')]);return _0x5b13c2(_0x2fe111[_0xaa02('0x16')][_0xaa02('0x18')]);}else{logger[_0xaa02('0x10')](_0xaa02('0x11'),_0x35711c,_0xaa02('0x12'));_0x5b13c2(_0x2fe111['result']['message']);}})[_0xaa02('0x19')](function(_0x49c6e5){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x35711c,_0x49c6e5);_0x11ba9f(_0x49c6e5);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index e653a7f..fa92e28 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 _0xd7a8=['update','emit','register','length','./chatWebsite.events','save'];(function(_0x214e5e,_0x38ee27){var _0x49467a=function(_0x3660db){while(--_0x3660db){_0x214e5e['push'](_0x214e5e['shift']());}};_0x49467a(++_0x38ee27);}(_0xd7a8,0x11e));var _0x8d7a=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0xd7a8[_0x13d07a];return _0x5ee0ee;};'use strict';var ChatWebsiteEvents=require(_0x8d7a('0x0'));var events=[_0x8d7a('0x1'),'remove',_0x8d7a('0x2')];function createListener(_0x25c549,_0x524009){return function(_0x5a3531){_0x524009[_0x8d7a('0x3')](_0x25c549,_0x5a3531);};}function removeListener(_0x44ba5f,_0x72d5e1){return function(){ChatWebsiteEvents['removeListener'](_0x44ba5f,_0x72d5e1);};}exports[_0x8d7a('0x4')]=function(_0x1d909b){for(var _0x5831f3=0x0,_0x4edf9e=events[_0x8d7a('0x5')];_0x5831f3<_0x4edf9e;_0x5831f3++){var _0x726a17=events[_0x5831f3];var _0x4ba2e3=createListener('chatWebsite:'+_0x726a17,_0x1d909b);ChatWebsiteEvents['on'](_0x726a17,_0x4ba2e3);}}; \ No newline at end of file +var _0x65f5=['remove','update','emit','register','length','./chatWebsite.events','save'];(function(_0x45b6e9,_0xe76bc9){var _0x7c4bc=function(_0x500d18){while(--_0x500d18){_0x45b6e9['push'](_0x45b6e9['shift']());}};_0x7c4bc(++_0xe76bc9);}(_0x65f5,0xad));var _0x565f=function(_0x45e538,_0x16df28){_0x45e538=_0x45e538-0x0;var _0x4ca925=_0x65f5[_0x45e538];return _0x4ca925;};'use strict';var ChatWebsiteEvents=require(_0x565f('0x0'));var events=[_0x565f('0x1'),_0x565f('0x2'),_0x565f('0x3')];function createListener(_0x9eeda2,_0x41f346){return function(_0x5341f8){_0x41f346[_0x565f('0x4')](_0x9eeda2,_0x5341f8);};}function removeListener(_0x26fd34,_0x3d4f88){return function(){ChatWebsiteEvents['removeListener'](_0x26fd34,_0x3d4f88);};}exports[_0x565f('0x5')]=function(_0x461826){for(var _0xdc3a2c=0x0,_0x5d9cf6=events[_0x565f('0x6')];_0xdc3a2c<_0x5d9cf6;_0xdc3a2c++){var _0x2436bf=events[_0xdc3a2c];var _0x3077b2=createListener('chatWebsite:'+_0x2436bf,_0x461826);ChatWebsiteEvents['on'](_0x2436bf,_0x3077b2);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/helpers/wildcard-expressions.js b/server/api/chatWebsite/helpers/wildcard-expressions.js index c666036..f485728 100644 --- a/server/api/chatWebsite/helpers/wildcard-expressions.js +++ b/server/api/chatWebsite/helpers/wildcard-expressions.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xce68=['test','([\x5cw]+)','localhost','exports','../../../utils/misc','url','URL','replace'];(function(_0xf4a162,_0x470e29){var _0x218cf0=function(_0x47d5e2){while(--_0x47d5e2){_0xf4a162['push'](_0xf4a162['shift']());}};_0x218cf0(++_0x470e29);}(_0xce68,0x10c));var _0x8ce6=function(_0x2b32a4,_0x2ee2dd){_0x2b32a4=_0x2b32a4-0x0;var _0x11380c=_0xce68[_0x2b32a4];return _0x11380c;};var escapeRegExp=require(_0x8ce6('0x0'))['escapeRegExp'];var URL=require(_0x8ce6('0x1'))[_0x8ce6('0x2')];function testWildcardValidity(_0x5d7bec){var _0x2d4658=!![];try{new URL(_0x5d7bec[_0x8ce6('0x3')]('*','localhost'));}catch(_0x439270){_0x2d4658=![];}return _0x2d4658&&new RegExp(/(http(s)?):\/\/(\*|(((\*\.)+)?([a-zA-Z0-9\-_]+\.){0,}([a-zA-Z0-9\-_]+)))(:[\d]+)?\/?$/)[_0x8ce6('0x4')](_0x5d7bec);}function testWebsiteWithWildcard(_0x39301d,_0x5cd417){var _0x116e0a;var _0x10b3ca=escapeRegExp(_0x39301d['trim']()['replace'](/\/$/,''))[_0x8ce6('0x3')]('\x5c*',_0x8ce6('0x5'));try{new URL(_0x39301d[_0x8ce6('0x3')]('\x5c*',_0x8ce6('0x6')));_0x116e0a=new RegExp(_0x10b3ca)['test'](_0x5cd417);}catch(_0x417bcf){_0x116e0a=![];}return _0x116e0a;}module[_0x8ce6('0x7')]={'testWebsiteWithWildcard':testWebsiteWithWildcard,'testWildcardValidity':testWildcardValidity}; \ No newline at end of file +var _0x7880=['URL','replace','test','localhost','exports','../../../utils/misc','url'];(function(_0xe9f7f2,_0x303bd8){var _0x2c462b=function(_0x4f0997){while(--_0x4f0997){_0xe9f7f2['push'](_0xe9f7f2['shift']());}};_0x2c462b(++_0x303bd8);}(_0x7880,0x10f));var _0x0788=function(_0x513f27,_0x1cbc87){_0x513f27=_0x513f27-0x0;var _0xa316b7=_0x7880[_0x513f27];return _0xa316b7;};var escapeRegExp=require(_0x0788('0x0'))['escapeRegExp'];var URL=require(_0x0788('0x1'))[_0x0788('0x2')];function testWildcardValidity(_0x25c8ca){var _0x184ae4=!![];try{new URL(_0x25c8ca[_0x0788('0x3')]('*','localhost'));}catch(_0x563529){_0x184ae4=![];}return _0x184ae4&&new RegExp(/(http(s)?):\/\/(\*|(((\*\.)+)?([a-zA-Z0-9\-_]+\.){0,}([a-zA-Z0-9\-_]+)))(:[\d]+)?\/?$/)[_0x0788('0x4')](_0x25c8ca);}function testWebsiteWithWildcard(_0x487b5b,_0x74c6b2){var _0x2deca2;var _0x34f9f1=escapeRegExp(_0x487b5b['trim']()[_0x0788('0x3')](/\/$/,''))[_0x0788('0x3')]('\x5c*','([\x5cw]+)');try{new URL(_0x487b5b[_0x0788('0x3')]('\x5c*',_0x0788('0x5')));_0x2deca2=new RegExp(_0x34f9f1)[_0x0788('0x4')](_0x74c6b2);}catch(_0x95ebe3){_0x2deca2=![];}return _0x2deca2;}module[_0x0788('0x6')]={'testWebsiteWithWildcard':testWebsiteWithWildcard,'testWildcardValidity':testWildcardValidity}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index ab84fa7..2214336 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 _0x4d2c=['addAnswer','join','server/files/images/logos/','format','now','single','file','addLogo','root','%s-%s','addAvatar','originalname','addCustomerAvatar','diskStorage','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir','replace','extname','/:id/offline','addInteraction','addApplications','addProactiveActions','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','/describe','/:id','getDispositions','/:id/canned_answers','/:id/logo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','getOfflineMessages','/:id/users','getAgents','post','create','/:id/dispositions'];(function(_0x1e0c18,_0x31a14d){var _0x19ccc9=function(_0x27ffaa){while(--_0x27ffaa){_0x1e0c18['push'](_0x1e0c18['shift']());}};_0x19ccc9(++_0x31a14d);}(_0x4d2c,0x1cd));var _0xc4d2=function(_0x42a0cc,_0x486ee7){_0x42a0cc=_0x42a0cc-0x0;var _0x1f1614=_0x4d2c[_0x42a0cc];return _0x1f1614;};'use strict';var multer=require(_0xc4d2('0x0'));var util=require(_0xc4d2('0x1'));var path=require(_0xc4d2('0x2'));var timeout=require(_0xc4d2('0x3'));var express=require(_0xc4d2('0x4'));var router=express[_0xc4d2('0x5')]();var fs_extra=require(_0xc4d2('0x6'));var auth=require(_0xc4d2('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xc4d2('0x8'));var controller=require(_0xc4d2('0x9'));router[_0xc4d2('0xa')]('/',auth[_0xc4d2('0xb')](),controller['index']);router[_0xc4d2('0xa')](_0xc4d2('0xc'),auth[_0xc4d2('0xb')](),controller['describe']);router[_0xc4d2('0xa')](_0xc4d2('0xd'),auth['isAuthenticated'](),controller['show']);router[_0xc4d2('0xa')]('/:id/dispositions',auth[_0xc4d2('0xb')](),controller[_0xc4d2('0xe')]);router[_0xc4d2('0xa')](_0xc4d2('0xf'),auth['isAuthenticated'](),controller['getAnswers']);router[_0xc4d2('0xa')](_0xc4d2('0x10'),controller['getLogo']);router[_0xc4d2('0xa')](_0xc4d2('0x11'),controller[_0xc4d2('0x12')]);router[_0xc4d2('0xa')](_0xc4d2('0x13'),controller[_0xc4d2('0x14')]);router[_0xc4d2('0xa')](_0xc4d2('0x15'),controller['getSystemAvatar']);router[_0xc4d2('0xa')](_0xc4d2('0x16'),auth[_0xc4d2('0xb')](),controller[_0xc4d2('0x17')]);router[_0xc4d2('0xa')](_0xc4d2('0x18'),controller[_0xc4d2('0x19')]);router[_0xc4d2('0xa')]('/:id/applications',auth[_0xc4d2('0xb')](),controller['getApplications']);router[_0xc4d2('0xa')](_0xc4d2('0x1a'),auth[_0xc4d2('0xb')](),controller[_0xc4d2('0x1b')]);router[_0xc4d2('0xa')](_0xc4d2('0x1c'),controller[_0xc4d2('0x1d')]);router[_0xc4d2('0xa')]('/:id/offline_messages',auth[_0xc4d2('0xb')](),controller[_0xc4d2('0x1e')]);router[_0xc4d2('0xa')](_0xc4d2('0x1f'),auth[_0xc4d2('0xb')](),controller[_0xc4d2('0x20')]);router[_0xc4d2('0x21')]('/',auth[_0xc4d2('0xb')](),controller[_0xc4d2('0x22')]);router[_0xc4d2('0x21')](_0xc4d2('0x23'),auth[_0xc4d2('0xb')](),controller['addDisposition']);router[_0xc4d2('0x21')](_0xc4d2('0xf'),auth[_0xc4d2('0xb')](),controller[_0xc4d2('0x24')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x38744d,_0x40b538,_0x3fc8b7){_0x3fc8b7(null,path[_0xc4d2('0x25')](config['root'],_0xc4d2('0x26')));},'filename':function(_0x2d5208,_0x584c28,_0x5e4ea2){_0x5e4ea2(null,util[_0xc4d2('0x27')]('%s-%s',Date[_0xc4d2('0x28')](),_0x584c28['originalname']));}})});router[_0xc4d2('0x21')](_0xc4d2('0x10'),upload[_0xc4d2('0x29')](_0xc4d2('0x2a')),controller[_0xc4d2('0x2b')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x35f7e8,_0x25d986,_0x1c9924){_0x1c9924(null,path[_0xc4d2('0x25')](config[_0xc4d2('0x2c')],'server/files/images/avatars/'));},'filename':function(_0x51e9fd,_0x4e2b34,_0x23476d){_0x23476d(null,util[_0xc4d2('0x27')](_0xc4d2('0x2d'),Date[_0xc4d2('0x28')](),_0x4e2b34['originalname']));}})});router['post'](_0xc4d2('0x11'),upload[_0xc4d2('0x29')](_0xc4d2('0x2a')),controller[_0xc4d2('0x2e')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4bb4f5,_0xf4932e,_0x316349){_0x316349(null,path[_0xc4d2('0x25')](config[_0xc4d2('0x2c')],'server/files/images/avatars/'));},'filename':function(_0x18ae98,_0x456fa4,_0x42f65a){_0x42f65a(null,util[_0xc4d2('0x27')](_0xc4d2('0x2d'),Date[_0xc4d2('0x28')](),_0x456fa4[_0xc4d2('0x2f')]));}})});router[_0xc4d2('0x21')]('/:id/customer_avatar',upload['single']('file'),controller[_0xc4d2('0x30')]);var upload=multer({'storage':multer[_0xc4d2('0x31')]({'destination':function(_0x17b9e5,_0x352fe7,_0x291c8d){_0x291c8d(null,path[_0xc4d2('0x25')](config['root'],'server/files/images/avatars/'));},'filename':function(_0x244bb4,_0x2ab390,_0x3d429e){_0x3d429e(null,util[_0xc4d2('0x27')](_0xc4d2('0x2d'),Date[_0xc4d2('0x28')](),_0x2ab390[_0xc4d2('0x2f')]));}})});router['post']('/:id/system_avatar',upload['single'](_0xc4d2('0x2a')),controller[_0xc4d2('0x32')]);router[_0xc4d2('0x21')](_0xc4d2('0x33'),controller[_0xc4d2('0x34')]);const offlineUploadMulter=multer({'storage':multer[_0xc4d2('0x31')]({'destination':function(_0x341ac6,_0x19091b,_0x3758b4){const _0x2f4d2e=path[_0xc4d2('0x25')](config[_0xc4d2('0x2c')],_0xc4d2('0x35'),_0xc4d2('0x36'),_0xc4d2('0x37'));fs_extra[_0xc4d2('0x38')](_0x2f4d2e,function(){_0x3758b4(null,_0x2f4d2e);});},'filename':function(_0xf09a57,_0x56204f,_0x396ed3){const _0x39434f=_0x56204f[_0xc4d2('0x2f')][_0xc4d2('0x39')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x2bd05d=path[_0xc4d2('0x3a')](_0x39434f);const _0x31ea59=Date['now']()+'-'+_0x39434f[_0xc4d2('0x39')](_0x2bd05d,'')+_0x2bd05d;_0x396ed3(null,_0x31ea59);}})});router[_0xc4d2('0x21')](_0xc4d2('0x3b'),offlineUploadMulter['any'](),controller['offline']);router[_0xc4d2('0x21')]('/:id/interactions',auth[_0xc4d2('0xb')](),controller[_0xc4d2('0x3c')]);router['post']('/:id/applications',auth[_0xc4d2('0xb')](),controller[_0xc4d2('0x3d')]);router[_0xc4d2('0x21')](_0xc4d2('0x1a'),auth[_0xc4d2('0xb')](),controller[_0xc4d2('0x3e')]);router[_0xc4d2('0x21')](_0xc4d2('0x1f'),auth[_0xc4d2('0xb')](),controller[_0xc4d2('0x3f')]);router[_0xc4d2('0x40')](_0xc4d2('0xd'),auth[_0xc4d2('0xb')](),controller[_0xc4d2('0x41')]);router[_0xc4d2('0x42')](_0xc4d2('0xd'),auth[_0xc4d2('0xb')](),controller[_0xc4d2('0x43')]);router[_0xc4d2('0x42')](_0xc4d2('0x23'),auth['isAuthenticated'](),controller[_0xc4d2('0x44')]);router[_0xc4d2('0x42')](_0xc4d2('0xf'),auth[_0xc4d2('0xb')](),controller[_0xc4d2('0x45')]);router[_0xc4d2('0x42')](_0xc4d2('0x1f'),auth[_0xc4d2('0xb')](),controller[_0xc4d2('0x46')]);module['exports']=router; \ No newline at end of file +var _0x30f3=['getSystemAvatar','/:id/interactions','getInteractions','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','getAgents','post','create','addDisposition','/:id/canned_answers','addAnswer','diskStorage','join','root','server/files/images/logos/','%s-%s','single','file','format','now','originalname','addAvatar','server/files/images/avatars/','/:id/system_avatar','addSystemAvatar','notify','server/files','ensureDir','extname','replace','/:id/offline','any','offline','addInteraction','/:id/users','addAgents','put','/:id','update','destroy','delete','removeAnswers','removeAgents','exports','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','getAnswers','/:id/logo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar'];(function(_0x29caa2,_0x24addd){var _0x581a8c=function(_0x47c678){while(--_0x47c678){_0x29caa2['push'](_0x29caa2['shift']());}};_0x581a8c(++_0x24addd);}(_0x30f3,0x10a));var _0x330f=function(_0x510b08,_0x16cd04){_0x510b08=_0x510b08-0x0;var _0xbf9488=_0x30f3[_0x510b08];return _0xbf9488;};'use strict';var multer=require(_0x330f('0x0'));var util=require(_0x330f('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x330f('0x2'));var router=express[_0x330f('0x3')]();var fs_extra=require(_0x330f('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x330f('0x5'));var config=require(_0x330f('0x6'));var controller=require(_0x330f('0x7'));router[_0x330f('0x8')]('/',auth[_0x330f('0x9')](),controller[_0x330f('0xa')]);router[_0x330f('0x8')](_0x330f('0xb'),auth[_0x330f('0x9')](),controller[_0x330f('0xc')]);router[_0x330f('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x330f('0xd')]);router[_0x330f('0x8')](_0x330f('0xe'),auth[_0x330f('0x9')](),controller[_0x330f('0xf')]);router['get']('/:id/canned_answers',auth[_0x330f('0x9')](),controller[_0x330f('0x10')]);router[_0x330f('0x8')](_0x330f('0x11'),controller['getLogo']);router[_0x330f('0x8')](_0x330f('0x12'),controller[_0x330f('0x13')]);router[_0x330f('0x8')](_0x330f('0x14'),controller[_0x330f('0x15')]);router['get']('/:id/system_avatar',controller[_0x330f('0x16')]);router[_0x330f('0x8')](_0x330f('0x17'),auth[_0x330f('0x9')](),controller[_0x330f('0x18')]);router[_0x330f('0x8')]('/:id/snippet',controller[_0x330f('0x19')]);router[_0x330f('0x8')](_0x330f('0x1a'),auth[_0x330f('0x9')](),controller[_0x330f('0x1b')]);router[_0x330f('0x8')](_0x330f('0x1c'),auth[_0x330f('0x9')](),controller['getProactiveActions']);router[_0x330f('0x8')](_0x330f('0x1d'),controller[_0x330f('0x1e')]);router['get'](_0x330f('0x1f'),auth[_0x330f('0x9')](),controller[_0x330f('0x20')]);router[_0x330f('0x8')]('/:id/users',auth[_0x330f('0x9')](),controller[_0x330f('0x21')]);router[_0x330f('0x22')]('/',auth[_0x330f('0x9')](),controller[_0x330f('0x23')]);router[_0x330f('0x22')]('/:id/dispositions',auth[_0x330f('0x9')](),controller[_0x330f('0x24')]);router[_0x330f('0x22')](_0x330f('0x25'),auth[_0x330f('0x9')](),controller[_0x330f('0x26')]);var upload=multer({'storage':multer[_0x330f('0x27')]({'destination':function(_0x1f7261,_0x1c4c87,_0x456ebf){_0x456ebf(null,path[_0x330f('0x28')](config[_0x330f('0x29')],_0x330f('0x2a')));},'filename':function(_0x241b16,_0x4a626b,_0x470c2d){_0x470c2d(null,util['format'](_0x330f('0x2b'),Date['now'](),_0x4a626b['originalname']));}})});router[_0x330f('0x22')](_0x330f('0x11'),upload[_0x330f('0x2c')](_0x330f('0x2d')),controller['addLogo']);var upload=multer({'storage':multer[_0x330f('0x27')]({'destination':function(_0xa046fd,_0x49a5a3,_0x2eabde){_0x2eabde(null,path[_0x330f('0x28')](config['root'],'server/files/images/avatars/'));},'filename':function(_0x37617c,_0x503c06,_0x44055f){_0x44055f(null,util[_0x330f('0x2e')](_0x330f('0x2b'),Date[_0x330f('0x2f')](),_0x503c06[_0x330f('0x30')]));}})});router['post'](_0x330f('0x12'),upload[_0x330f('0x2c')]('file'),controller[_0x330f('0x31')]);var upload=multer({'storage':multer[_0x330f('0x27')]({'destination':function(_0x1341c1,_0x418413,_0x5577e2){_0x5577e2(null,path[_0x330f('0x28')](config[_0x330f('0x29')],_0x330f('0x32')));},'filename':function(_0x1c11b4,_0x19d6bd,_0x4da751){_0x4da751(null,util[_0x330f('0x2e')](_0x330f('0x2b'),Date[_0x330f('0x2f')](),_0x19d6bd[_0x330f('0x30')]));}})});router[_0x330f('0x22')](_0x330f('0x14'),upload['single'](_0x330f('0x2d')),controller['addCustomerAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2fcf5c,_0x397f0d,_0x2cea76){_0x2cea76(null,path[_0x330f('0x28')](config[_0x330f('0x29')],_0x330f('0x32')));},'filename':function(_0x126ea3,_0x34b2fb,_0x372f2e){_0x372f2e(null,util[_0x330f('0x2e')]('%s-%s',Date[_0x330f('0x2f')](),_0x34b2fb['originalname']));}})});router[_0x330f('0x22')](_0x330f('0x33'),upload['single'](_0x330f('0x2d')),controller[_0x330f('0x34')]);router[_0x330f('0x22')]('/:id/notify',controller[_0x330f('0x35')]);const offlineUploadMulter=multer({'storage':multer[_0x330f('0x27')]({'destination':function(_0xb20ee7,_0x36989f,_0x25b428){const _0x317c77=path[_0x330f('0x28')](config[_0x330f('0x29')],_0x330f('0x36'),'attachments','offline-chat');fs_extra[_0x330f('0x37')](_0x317c77,function(){_0x25b428(null,_0x317c77);});},'filename':function(_0x598d9d,_0x41ec21,_0x32bc9c){const _0x3c4aed=_0x41ec21[_0x330f('0x30')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x3dffa7=path[_0x330f('0x38')](_0x3c4aed);const _0x4d13ec=Date[_0x330f('0x2f')]()+'-'+_0x3c4aed[_0x330f('0x39')](_0x3dffa7,'')+_0x3dffa7;_0x32bc9c(null,_0x4d13ec);}})});router[_0x330f('0x22')](_0x330f('0x3a'),offlineUploadMulter[_0x330f('0x3b')](),controller[_0x330f('0x3c')]);router[_0x330f('0x22')]('/:id/interactions',auth[_0x330f('0x9')](),controller[_0x330f('0x3d')]);router[_0x330f('0x22')]('/:id/applications',auth[_0x330f('0x9')](),controller['addApplications']);router[_0x330f('0x22')](_0x330f('0x1c'),auth[_0x330f('0x9')](),controller['addProactiveActions']);router['post'](_0x330f('0x3e'),auth[_0x330f('0x9')](),controller[_0x330f('0x3f')]);router[_0x330f('0x40')](_0x330f('0x41'),auth[_0x330f('0x9')](),controller[_0x330f('0x42')]);router['delete']('/:id',auth[_0x330f('0x9')](),controller[_0x330f('0x43')]);router['delete'](_0x330f('0xe'),auth[_0x330f('0x9')](),controller['removeDispositions']);router[_0x330f('0x44')](_0x330f('0x25'),auth[_0x330f('0x9')](),controller[_0x330f('0x45')]);router[_0x330f('0x44')]('/:id/users',auth[_0x330f('0x9')](),controller[_0x330f('0x46')]);module[_0x330f('0x47')]=router; \ No newline at end of file diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js index 7ff7224..e253a62 100644 --- a/server/api/client-side-logs.js +++ b/server/api/client-side-logs.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb758=['production','app','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','use','isAuthenticated','express','../components/auth/service','../config/environment','env'];(function(_0x34dba9,_0x4db90f){var _0x9873d6=function(_0xa300ac){while(--_0xa300ac){_0x34dba9['push'](_0x34dba9['shift']());}};_0x9873d6(++_0x4db90f);}(_0xb758,0xac));var _0x8b75=function(_0x5f1cf8,_0x5e0923){_0x5f1cf8=_0x5f1cf8-0x0;var _0x27d0fa=_0xb758[_0x5f1cf8];return _0x27d0fa;};var beaverLogger=require('beaver-logger/server');var express=require(_0x8b75('0x0'));var auth=require(_0x8b75('0x1'));var config=require(_0x8b75('0x2'));var router=express['Router']();var isProduction=config[_0x8b75('0x3')]===_0x8b75('0x4')||![];function clientSideLogs(_0x3c6bc1,_0x5531e6,_0x38031d){var _0x55bcd5=_0x3c6bc1[_0x8b75('0x5')]['get'](_0x8b75('0x6'));if(!_0x55bcd5){throw new Error(_0x8b75('0x7'));}return beaverLogger[_0x8b75('0x8')]({'uri':'/client-logs','logger':_0x55bcd5,'enableCors':!isProduction})(_0x3c6bc1,_0x5531e6,_0x38031d);}router[_0x8b75('0x9')](auth[_0x8b75('0xa')](),clientSideLogs);module['exports']=router; \ No newline at end of file +var _0x8d8e=['../config/environment','Router','env','production','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','isAuthenticated','beaver-logger/server','../components/auth/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8d8e,0x15a));var _0xe8d8=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x8d8e[_0xa1e3e3];return _0xc980e9;};var beaverLogger=require(_0xe8d8('0x0'));var express=require('express');var auth=require(_0xe8d8('0x1'));var config=require(_0xe8d8('0x2'));var router=express[_0xe8d8('0x3')]();var isProduction=config[_0xe8d8('0x4')]===_0xe8d8('0x5')||![];function clientSideLogs(_0x14b2f6,_0x368a0f,_0x16883b){var _0x270f8f=_0x14b2f6['app'][_0xe8d8('0x6')](_0xe8d8('0x7'));if(!_0x270f8f){throw new Error(_0xe8d8('0x8'));}return beaverLogger[_0xe8d8('0x9')]({'uri':_0xe8d8('0xa'),'logger':_0x270f8f,'enableCors':!isProduction})(_0x14b2f6,_0x368a0f,_0x16883b);}router['use'](auth[_0xe8d8('0xb')](),clientSideLogs);module['exports']=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index 4bbad92..6790dba 100644 --- a/server/api/cloudProvider/cloudProvider.attributes.js +++ b/server/api/cloudProvider/cloudProvider.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9152=['MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','sequelize','exports','STRING','AmazonAWS','MicrosoftAzure','ENUM','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret'];(function(_0x7ae6c9,_0x3f2a16){var _0x2fb9b1=function(_0x45a538){while(--_0x45a538){_0x7ae6c9['push'](_0x7ae6c9['shift']());}};_0x2fb9b1(++_0x3f2a16);}(_0x9152,0x11b));var _0x2915=function(_0x14e478,_0x13a770){_0x14e478=_0x14e478-0x0;var _0x37f75f=_0x9152[_0x14e478];return _0x37f75f;};'use strict';var Sequelize=require(_0x2915('0x0'));module[_0x2915('0x1')]={'name':{'type':Sequelize[_0x2915('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM'](_0x2915('0x3'),'Google',_0x2915('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x2915('0x5')](_0x2915('0x6'),_0x2915('0x7'))},'data1':{'type':Sequelize[_0x2915('0x2')],'comment':_0x2915('0x8')},'data2':{'type':Sequelize[_0x2915('0x2')],'comment':_0x2915('0x9')},'data3':{'type':Sequelize[_0x2915('0x2')],'comment':_0x2915('0xa')},'data4':{'type':Sequelize[_0x2915('0x2')],'comment':_0x2915('0xb')},'data5':{'type':Sequelize[_0x2915('0xc')],'comment':_0x2915('0xd')},'data6':{'type':Sequelize[_0x2915('0xc')],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize[_0x2915('0xc')],'comment':'MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'}}; \ No newline at end of file +var _0x1944=['ENUM','Dynamics365','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','MicrosoftAzure\x20=>\x20access_token','TEXT','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','exports','STRING'];(function(_0x1ff7f9,_0x7f4e5d){var _0x42f261=function(_0xa4451a){while(--_0xa4451a){_0x1ff7f9['push'](_0x1ff7f9['shift']());}};_0x42f261(++_0x7f4e5d);}(_0x1944,0x1b6));var _0x4194=function(_0x3b1c08,_0x43b62c){_0x3b1c08=_0x3b1c08-0x0;var _0x9bfda7=_0x1944[_0x3b1c08];return _0x9bfda7;};'use strict';var Sequelize=require('sequelize');module[_0x4194('0x0')]={'name':{'type':Sequelize[_0x4194('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x4194('0x2')]('AmazonAWS','Google','MicrosoftAzure'),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x4194('0x2')]('Outlook365',_0x4194('0x3'))},'data1':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize[_0x4194('0x1')],'comment':_0x4194('0x4')},'data3':{'type':Sequelize['STRING'],'comment':_0x4194('0x5')},'data4':{'type':Sequelize[_0x4194('0x1')],'comment':_0x4194('0x6')},'data5':{'type':Sequelize['TEXT'],'comment':_0x4194('0x7')},'data6':{'type':Sequelize[_0x4194('0x8')],'comment':_0x4194('0x9')},'data7':{'type':Sequelize[_0x4194('0x8')],'comment':_0x4194('0xa')}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index 740dfb5..cfb38b6 100644 --- a/server/api/cloudProvider/cloudProvider.controller.js +++ b/server/api/cloudProvider/cloudProvider.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb775=['find','service','MicrosoftAzure','create','body','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','catch','params','encryptString','oauth2MicrosoftAuthorize','user','oauth2MicrosoftCallback','state','Invalid\x20state\x20parameter','from','base64','ascii','parse','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','code','data5','data6','refresh_token','startRefreshInterval','emit','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/encryptor','../../config/environment','../../config/logger','api','./cloudProvider.oauth','redis','defaults','socket.io-emitter','sendStatus','status','end','json','undefined','limit','count','offset','set','update','error','send','padEnd','slice','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','name','CloudProvider','then','includeAll','include','rows','decryptString','data3','show','rawAttributes','options'];(function(_0x12b5a8,_0x110ded){var _0xb1bff1=function(_0x4d2517){while(--_0x4d2517){_0x12b5a8['push'](_0x12b5a8['shift']());}};_0xb1bff1(++_0x110ded);}(_0xb775,0xd5));var _0x5b77=function(_0x4d21b1,_0x7d4de3){_0x4d21b1=_0x4d21b1-0x0;var _0x1be7a3=_0xb775[_0x4d21b1];return _0x1be7a3;};'use strict';var _=require(_0x5b77('0x0'));var Redis=require(_0x5b77('0x1'));var qs=require('../../components/parsers/qs');var encryptor=require(_0x5b77('0x2'));var config=require(_0x5b77('0x3'));var logger=require(_0x5b77('0x4'))(_0x5b77('0x5'));var db=require('../../mysqldb')['db'];var oauth=require(_0x5b77('0x6'));config[_0x5b77('0x7')]=_[_0x5b77('0x8')](config[_0x5b77('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0x5b77('0x9'))(new Redis(config[_0x5b77('0x7')]));var redis=new Redis(config['redis']);function respondWithStatusCode(_0xb6a50a,_0x56cadd){_0x56cadd=_0x56cadd||0xcc;return function(_0x11d51d){if(_0x11d51d){return _0xb6a50a[_0x5b77('0xa')](_0x56cadd);}return _0xb6a50a[_0x5b77('0xb')](_0x56cadd)[_0x5b77('0xc')]();};}function respondWithResult(_0x526774,_0x378d1e){_0x378d1e=_0x378d1e||0xc8;return function(_0x467fa6){if(_0x467fa6){return _0x526774[_0x5b77('0xb')](_0x378d1e)[_0x5b77('0xd')](_0x467fa6);}};}function respondWithFilteredResult(_0x137e9b,_0x540c09){return function(_0x527896){if(_0x527896){var _0x1b0b26=typeof _0x540c09['offset']===_0x5b77('0xe')&&typeof _0x540c09[_0x5b77('0xf')]==='undefined';var _0x560d7e=_0x527896[_0x5b77('0x10')];var _0x3f3b4e=_0x1b0b26?0x0:_0x540c09[_0x5b77('0x11')];var _0x233bbf=_0x1b0b26?_0x527896[_0x5b77('0x10')]:_0x540c09[_0x5b77('0x11')]+_0x540c09[_0x5b77('0xf')];var _0xcbc314;if(_0x233bbf>=_0x560d7e){_0x233bbf=_0x560d7e;_0xcbc314=0xc8;}else{_0xcbc314=0xce;}_0x137e9b[_0x5b77('0xb')](_0xcbc314);return _0x137e9b[_0x5b77('0x12')]('Content-Range',_0x3f3b4e+'-'+_0x233bbf+'/'+_0x560d7e)[_0x5b77('0xd')](_0x527896);}return null;};}function saveUpdates(_0x259d23){return function(_0x5fb508){if(_0x5fb508){return _0x5fb508[_0x5b77('0x13')](_0x259d23)['then'](function(_0x55f755){return _0x55f755;});}return null;};}function removeEntity(_0x569825){return function(_0xd05f8a){if(_0xd05f8a){return _0xd05f8a['destroy']()['then'](function(){_0x569825[_0x5b77('0xb')](0xcc)[_0x5b77('0xc')]();});}};}function handleEntityNotFound(_0x7d7bc3){return function(_0xb8806d){if(!_0xb8806d){_0x7d7bc3[_0x5b77('0xa')](0x194);}return _0xb8806d;};}function handleError(_0x16bc27,_0x3294a3){_0x3294a3=_0x3294a3||0x1f4;return function(_0x1ad490){logger[_0x5b77('0x14')](_0x1ad490['stack']);if(_0x1ad490['name']){delete _0x1ad490['name'];}_0x16bc27[_0x5b77('0xb')](_0x3294a3)[_0x5b77('0x15')](_0x1ad490);};}function maskClientSecret(_0x12b414){return _[_0x5b77('0x16')](_0x12b414[_0x5b77('0x17')](0x0,0x3),0x14,'*');}exports['index']=function(_0x2771f0,_0x105a3a){var _0x541622={},_0x515a01={},_0x14bf25={'count':0x0,'rows':[]};var _0xa6776=_['map'](db['CloudProvider']['rawAttributes'],function(_0x34d3d1){return{'name':_0x34d3d1['fieldName'],'type':_0x34d3d1[_0x5b77('0x18')]['key']};});_0x515a01[_0x5b77('0x19')]=_['map'](_0xa6776,'name');_0x515a01[_0x5b77('0x1a')]=_[_0x5b77('0x1b')](_0x2771f0[_0x5b77('0x1a')]);_0x515a01[_0x5b77('0x1c')]=_['intersection'](_0x515a01[_0x5b77('0x19')],_0x515a01[_0x5b77('0x1a')]);_0x541622[_0x5b77('0x1d')]=_[_0x5b77('0x1e')](_0x515a01['model'],qs[_0x5b77('0x1f')](_0x2771f0[_0x5b77('0x1a')][_0x5b77('0x1f')]));_0x541622['attributes']=_0x541622[_0x5b77('0x1d')][_0x5b77('0x20')]?_0x541622['attributes']:_0x515a01['model'];if(!_0x2771f0[_0x5b77('0x1a')][_0x5b77('0x21')](_0x5b77('0x22'))){_0x541622[_0x5b77('0xf')]=qs[_0x5b77('0xf')](_0x2771f0[_0x5b77('0x1a')][_0x5b77('0xf')]);_0x541622[_0x5b77('0x11')]=qs[_0x5b77('0x11')](_0x2771f0[_0x5b77('0x1a')]['offset']);}_0x541622[_0x5b77('0x23')]=qs[_0x5b77('0x24')](_0x2771f0[_0x5b77('0x1a')]['sort']);_0x541622[_0x5b77('0x25')]=qs[_0x5b77('0x1c')](_[_0x5b77('0x26')](_0x2771f0[_0x5b77('0x1a')],_0x515a01['filters']),_0xa6776);if(_0x2771f0[_0x5b77('0x1a')][_0x5b77('0x27')]){_0x541622['where']=_[_0x5b77('0x28')](_0x541622[_0x5b77('0x25')],{'$or':_[_0x5b77('0x29')](_0xa6776,function(_0x204086){if(_0x204086[_0x5b77('0x18')]!==_0x5b77('0x2a')){var _0xe407e2={};_0xe407e2[_0x204086[_0x5b77('0x2b')]]={'$like':'%'+_0x2771f0[_0x5b77('0x1a')][_0x5b77('0x27')]+'%'};return _0xe407e2;}})});}_0x541622=_[_0x5b77('0x28')]({},_0x541622,_0x2771f0['options']);var _0x5bd7c0={'where':_0x541622[_0x5b77('0x25')]};return db[_0x5b77('0x2c')]['count'](_0x5bd7c0)[_0x5b77('0x2d')](function(_0x595fe1){_0x14bf25[_0x5b77('0x10')]=_0x595fe1;if(_0x2771f0[_0x5b77('0x1a')][_0x5b77('0x2e')]){_0x541622[_0x5b77('0x2f')]=[{'all':!![]}];}return db[_0x5b77('0x2c')]['findAll'](_0x541622);})[_0x5b77('0x2d')](function(_0x109b30){_0x14bf25[_0x5b77('0x30')]=_[_0x5b77('0x29')](_0x109b30,function(_0x2ef04a){if(_0x2ef04a['service']==='MicrosoftAzure'){var _0x7ca81d=encryptor[_0x5b77('0x31')](_0x2ef04a[_0x5b77('0x32')]);_0x2ef04a[_0x5b77('0x32')]=maskClientSecret(_0x7ca81d);}return _0x2ef04a;});return _0x14bf25;})['then'](respondWithFilteredResult(_0x105a3a,_0x541622))['catch'](handleError(_0x105a3a,null));};exports[_0x5b77('0x33')]=function(_0x520d98,_0x326fb2){var _0x50e087={'raw':!![],'where':{'id':_0x520d98['params']['id']}},_0x550169={};_0x550169[_0x5b77('0x19')]=_[_0x5b77('0x1b')](db[_0x5b77('0x2c')][_0x5b77('0x34')]);_0x550169[_0x5b77('0x1a')]=_['keys'](_0x520d98['query']);_0x550169[_0x5b77('0x1c')]=_[_0x5b77('0x1e')](_0x550169[_0x5b77('0x19')],_0x550169[_0x5b77('0x1a')]);_0x50e087['attributes']=_['intersection'](_0x550169[_0x5b77('0x19')],qs[_0x5b77('0x1f')](_0x520d98[_0x5b77('0x1a')][_0x5b77('0x1f')]));_0x50e087[_0x5b77('0x1d')]=_0x50e087[_0x5b77('0x1d')][_0x5b77('0x20')]?_0x50e087[_0x5b77('0x1d')]:_0x550169[_0x5b77('0x19')];if(_0x520d98[_0x5b77('0x1a')]['includeAll']){_0x50e087[_0x5b77('0x2f')]=[{'all':!![]}];}_0x50e087=_[_0x5b77('0x28')]({},_0x50e087,_0x520d98[_0x5b77('0x35')]);return db[_0x5b77('0x2c')][_0x5b77('0x36')](_0x50e087)['then'](handleEntityNotFound(_0x326fb2,null))['then'](function(_0x5091cc){if(_0x5091cc[_0x5b77('0x37')]===_0x5b77('0x38')){var _0x225fbf=encryptor['decryptString'](_0x5091cc[_0x5b77('0x32')]);_0x5091cc[_0x5b77('0x32')]=maskClientSecret(_0x225fbf);}return _0x5091cc;})[_0x5b77('0x2d')](respondWithResult(_0x326fb2,null))['catch'](handleError(_0x326fb2,null));};exports[_0x5b77('0x39')]=function(_0x24737d,_0x5e269a){if(!_0x24737d[_0x5b77('0x3a')]['name'])throw new Error('Name\x20parameter\x20not\x20specified');if(!_0x24737d['body'][_0x5b77('0x37')])throw new Error(_0x5b77('0x3b'));var _0x15f9ef=db['CloudProvider'][_0x5b77('0x34')][_0x5b77('0x37')][_0x5b77('0x3c')];if(!_0x15f9ef[_0x5b77('0x3d')](_0x24737d[_0x5b77('0x3a')][_0x5b77('0x37')]))throw new Error(_0x5b77('0x3e')+_0x15f9ef[_0x5b77('0x3f')](',\x20'));if(_0x24737d[_0x5b77('0x3a')][_0x5b77('0x37')]===_0x5b77('0x38')&&_0x24737d[_0x5b77('0x3a')][_0x5b77('0x32')]){_0x24737d['body'][_0x5b77('0x32')]=encryptor['encryptString'](_0x24737d[_0x5b77('0x3a')][_0x5b77('0x32')]);}return db[_0x5b77('0x2c')][_0x5b77('0x39')](_0x24737d[_0x5b77('0x3a')],{})['then'](respondWithResult(_0x5e269a,0xc9))[_0x5b77('0x40')](handleError(_0x5e269a,null));};exports[_0x5b77('0x13')]=function(_0x50b857,_0x8912bb){if(_0x50b857['body']['id']){delete _0x50b857['body']['id'];}return db['CloudProvider'][_0x5b77('0x36')]({'where':{'id':_0x50b857[_0x5b77('0x41')]['id']}})[_0x5b77('0x2d')](handleEntityNotFound(_0x8912bb,null))['then'](function(_0x5d8281){if(_0x5d8281[_0x5b77('0x37')]===_0x5b77('0x38')&&_0x50b857[_0x5b77('0x3a')][_0x5b77('0x32')]){_0x50b857['body'][_0x5b77('0x32')]=encryptor[_0x5b77('0x42')](_0x50b857['body']['data3']);}return _0x5d8281;})[_0x5b77('0x2d')](saveUpdates(_0x50b857['body'],null))[_0x5b77('0x2d')](respondWithResult(_0x8912bb,null))[_0x5b77('0x40')](handleError(_0x8912bb,null));};exports['destroy']=function(_0x3c1078,_0x170445){return db[_0x5b77('0x2c')][_0x5b77('0x36')]({'where':{'id':_0x3c1078[_0x5b77('0x41')]['id']}})[_0x5b77('0x2d')](handleEntityNotFound(_0x170445,null))[_0x5b77('0x2d')](removeEntity(_0x170445,null))[_0x5b77('0x40')](handleError(_0x170445,null));};exports[_0x5b77('0x43')]=function(_0x3e137c,_0x6f0b90){return db['CloudProvider']['findOne']({'where':{'id':_0x3e137c[_0x5b77('0x41')]['id']},'raw':!![]})[_0x5b77('0x2d')](function(_0x5e2f07){if(!_0x5e2f07)return _0x6f0b90['sendStatus'](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0x5e2f07,_0x3e137c[_0x5b77('0x44')]['id'])};})['then'](respondWithResult(_0x6f0b90,null))[_0x5b77('0x40')](handleError(_0x6f0b90,null));};exports[_0x5b77('0x45')]=function(_0x12b129,_0x5b181a){var _0x4c4115=_0x12b129[_0x5b77('0x3a')];var _0x54b0b1;var _0x414d44;if(_0x4c4115[_0x5b77('0x14')])throw _0x4c4115;redis['get'](_0x4c4115[_0x5b77('0x46')])[_0x5b77('0x2d')](function(_0x56b5ec){if(!_0x56b5ec)throw new Error(_0x5b77('0x47'));_0x54b0b1=JSON['parse'](_0x56b5ec);var _0x33ec61=Buffer[_0x5b77('0x48')](_0x4c4115[_0x5b77('0x46')],_0x5b77('0x49'))['toString'](_0x5b77('0x4a'));_0x414d44=JSON[_0x5b77('0x4b')](_0x33ec61);if(!oauth[_0x5b77('0x4c')](_0x4c4115[_0x5b77('0x4d')],_0x54b0b1[_0x5b77('0x4e')]))throw new Error(_0x5b77('0x4f'));redis['del'](_0x4c4115[_0x5b77('0x46')]);return oauth['getOauth2MicrosoftAccessToken'](_0x4c4115[_0x5b77('0x50')],_0x54b0b1);})[_0x5b77('0x2d')](function(_0x2785e1){_0x54b0b1[_0x5b77('0x51')]=_0x2785e1['access_token'];_0x54b0b1[_0x5b77('0x52')]=_0x2785e1[_0x5b77('0x53')];return db['CloudProvider'][_0x5b77('0x13')]({'data5':_0x54b0b1['data5'],'data6':_0x54b0b1[_0x5b77('0x52')]},{'where':{'id':_0x54b0b1['id']}});})[_0x5b77('0x2d')](function(){oauth[_0x5b77('0x54')](_0x54b0b1);socket[_0x5b77('0x55')]('microsoftAuthorization:success',{'id':_0x414d44['id']});return;})[_0x5b77('0x2d')](respondWithStatusCode(_0x5b181a,null))['catch'](function(_0x2a0f77){if(_0x414d44){socket['emit']('microsoftAuthorization:error',{'id':_0x414d44['id']});}if(!_0x54b0b1){logger[_0x5b77('0x14')]('Invalid\x20authentication\x20state\x20parameter',_0x2a0f77);return _0x5b181a[_0x5b77('0xb')](0x1f4)['send'](_0x2a0f77[_0x5b77('0x56')]);}logger['error'](_0x5b77('0x57'),_0x54b0b1['id'],JSON[_0x5b77('0x58')](_0x2a0f77));});}; \ No newline at end of file +var _0x6ce2=['data3','catch','show','params','length','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','create','find','destroy','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','Invalid\x20state\x20parameter','parse','from','state','toString','isValidIdToken','id_token','oauth2Claims','del','getOauth2MicrosoftAccessToken','code','data5','access_token','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../mysqldb','./cloudProvider.oauth','redis','defaults','localhost','socket.io-emitter','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','sendStatus','error','name','send','padEnd','slice','index','map','CloudProvider','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','fields','attributes','nolimit','order','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','service','MicrosoftAzure','decryptString'];(function(_0x8c8fd4,_0x828dd3){var _0xf2e595=function(_0x2e9f32){while(--_0x2e9f32){_0x8c8fd4['push'](_0x8c8fd4['shift']());}};_0xf2e595(++_0x828dd3);}(_0x6ce2,0x151));var _0x26ce=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0x6ce2[_0x1e7b16];return _0x37fadc;};'use strict';var _=require(_0x26ce('0x0'));var Redis=require(_0x26ce('0x1'));var qs=require(_0x26ce('0x2'));var encryptor=require(_0x26ce('0x3'));var config=require(_0x26ce('0x4'));var logger=require('../../config/logger')('api');var db=require(_0x26ce('0x5'))['db'];var oauth=require(_0x26ce('0x6'));config[_0x26ce('0x7')]=_[_0x26ce('0x8')](config[_0x26ce('0x7')],{'host':_0x26ce('0x9'),'port':0x18eb});var socket=require(_0x26ce('0xa'))(new Redis(config['redis']));var redis=new Redis(config[_0x26ce('0x7')]);function respondWithStatusCode(_0x4290ad,_0x15d0ba){_0x15d0ba=_0x15d0ba||0xcc;return function(_0x173aaa){if(_0x173aaa){return _0x4290ad['sendStatus'](_0x15d0ba);}return _0x4290ad[_0x26ce('0xb')](_0x15d0ba)[_0x26ce('0xc')]();};}function respondWithResult(_0x19f750,_0x36aaac){_0x36aaac=_0x36aaac||0xc8;return function(_0x20f379){if(_0x20f379){return _0x19f750[_0x26ce('0xb')](_0x36aaac)[_0x26ce('0xd')](_0x20f379);}};}function respondWithFilteredResult(_0x282410,_0x506fab){return function(_0x1b53f2){if(_0x1b53f2){var _0x556ba0=typeof _0x506fab[_0x26ce('0xe')]===_0x26ce('0xf')&&typeof _0x506fab[_0x26ce('0x10')]===_0x26ce('0xf');var _0x1f20d3=_0x1b53f2[_0x26ce('0x11')];var _0x31faf2=_0x556ba0?0x0:_0x506fab[_0x26ce('0xe')];var _0x1853a0=_0x556ba0?_0x1b53f2[_0x26ce('0x11')]:_0x506fab[_0x26ce('0xe')]+_0x506fab[_0x26ce('0x10')];var _0x3d9439;if(_0x1853a0>=_0x1f20d3){_0x1853a0=_0x1f20d3;_0x3d9439=0xc8;}else{_0x3d9439=0xce;}_0x282410[_0x26ce('0xb')](_0x3d9439);return _0x282410[_0x26ce('0x12')](_0x26ce('0x13'),_0x31faf2+'-'+_0x1853a0+'/'+_0x1f20d3)[_0x26ce('0xd')](_0x1b53f2);}return null;};}function saveUpdates(_0x5f5d95){return function(_0x42ccbd){if(_0x42ccbd){return _0x42ccbd[_0x26ce('0x14')](_0x5f5d95)[_0x26ce('0x15')](function(_0x6b4cbb){return _0x6b4cbb;});}return null;};}function removeEntity(_0x5062db){return function(_0x579ed4){if(_0x579ed4){return _0x579ed4['destroy']()[_0x26ce('0x15')](function(){_0x5062db['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x47074f){return function(_0x309528){if(!_0x309528){_0x47074f[_0x26ce('0x16')](0x194);}return _0x309528;};}function handleError(_0x34a3e4,_0x1d501a){_0x1d501a=_0x1d501a||0x1f4;return function(_0x3b8079){logger[_0x26ce('0x17')](_0x3b8079['stack']);if(_0x3b8079['name']){delete _0x3b8079[_0x26ce('0x18')];}_0x34a3e4['status'](_0x1d501a)[_0x26ce('0x19')](_0x3b8079);};}function maskClientSecret(_0x54ffba){return _[_0x26ce('0x1a')](_0x54ffba[_0x26ce('0x1b')](0x0,0x3),0x14,'*');}exports[_0x26ce('0x1c')]=function(_0x2c93b4,_0x4c76c6){var _0x534e6c={},_0x6bc30e={},_0x1d62b7={'count':0x0,'rows':[]};var _0x431c27=_[_0x26ce('0x1d')](db[_0x26ce('0x1e')][_0x26ce('0x1f')],function(_0x2e5bbc){return{'name':_0x2e5bbc[_0x26ce('0x20')],'type':_0x2e5bbc[_0x26ce('0x21')][_0x26ce('0x22')]};});_0x6bc30e[_0x26ce('0x23')]=_['map'](_0x431c27,'name');_0x6bc30e['query']=_[_0x26ce('0x24')](_0x2c93b4['query']);_0x6bc30e[_0x26ce('0x25')]=_[_0x26ce('0x26')](_0x6bc30e[_0x26ce('0x23')],_0x6bc30e[_0x26ce('0x27')]);_0x534e6c['attributes']=_[_0x26ce('0x26')](_0x6bc30e[_0x26ce('0x23')],qs['fields'](_0x2c93b4[_0x26ce('0x27')][_0x26ce('0x28')]));_0x534e6c[_0x26ce('0x29')]=_0x534e6c[_0x26ce('0x29')]['length']?_0x534e6c[_0x26ce('0x29')]:_0x6bc30e[_0x26ce('0x23')];if(!_0x2c93b4[_0x26ce('0x27')]['hasOwnProperty'](_0x26ce('0x2a'))){_0x534e6c[_0x26ce('0x10')]=qs[_0x26ce('0x10')](_0x2c93b4[_0x26ce('0x27')]['limit']);_0x534e6c[_0x26ce('0xe')]=qs[_0x26ce('0xe')](_0x2c93b4[_0x26ce('0x27')][_0x26ce('0xe')]);}_0x534e6c[_0x26ce('0x2b')]=qs['sort'](_0x2c93b4[_0x26ce('0x27')]['sort']);_0x534e6c[_0x26ce('0x2c')]=qs[_0x26ce('0x25')](_['pick'](_0x2c93b4[_0x26ce('0x27')],_0x6bc30e[_0x26ce('0x25')]),_0x431c27);if(_0x2c93b4['query'][_0x26ce('0x2d')]){_0x534e6c[_0x26ce('0x2c')]=_[_0x26ce('0x2e')](_0x534e6c['where'],{'$or':_[_0x26ce('0x1d')](_0x431c27,function(_0x5ef881){if(_0x5ef881[_0x26ce('0x21')]!==_0x26ce('0x2f')){var _0x3f7132={};_0x3f7132[_0x5ef881[_0x26ce('0x18')]]={'$like':'%'+_0x2c93b4['query'][_0x26ce('0x2d')]+'%'};return _0x3f7132;}})});}_0x534e6c=_['merge']({},_0x534e6c,_0x2c93b4[_0x26ce('0x30')]);var _0x5cddf2={'where':_0x534e6c['where']};return db[_0x26ce('0x1e')]['count'](_0x5cddf2)[_0x26ce('0x15')](function(_0x4a8df3){_0x1d62b7[_0x26ce('0x11')]=_0x4a8df3;if(_0x2c93b4['query'][_0x26ce('0x31')]){_0x534e6c[_0x26ce('0x32')]=[{'all':!![]}];}return db[_0x26ce('0x1e')][_0x26ce('0x33')](_0x534e6c);})['then'](function(_0x30f4e0){_0x1d62b7['rows']=_[_0x26ce('0x1d')](_0x30f4e0,function(_0x30b3ab){if(_0x30b3ab[_0x26ce('0x34')]===_0x26ce('0x35')){var _0x245a79=encryptor[_0x26ce('0x36')](_0x30b3ab[_0x26ce('0x37')]);_0x30b3ab[_0x26ce('0x37')]=maskClientSecret(_0x245a79);}return _0x30b3ab;});return _0x1d62b7;})[_0x26ce('0x15')](respondWithFilteredResult(_0x4c76c6,_0x534e6c))[_0x26ce('0x38')](handleError(_0x4c76c6,null));};exports[_0x26ce('0x39')]=function(_0xceca6c,_0xe9f948){var _0x144f82={'raw':!![],'where':{'id':_0xceca6c[_0x26ce('0x3a')]['id']}},_0x5d360b={};_0x5d360b[_0x26ce('0x23')]=_[_0x26ce('0x24')](db['CloudProvider'][_0x26ce('0x1f')]);_0x5d360b[_0x26ce('0x27')]=_[_0x26ce('0x24')](_0xceca6c[_0x26ce('0x27')]);_0x5d360b[_0x26ce('0x25')]=_[_0x26ce('0x26')](_0x5d360b[_0x26ce('0x23')],_0x5d360b[_0x26ce('0x27')]);_0x144f82[_0x26ce('0x29')]=_[_0x26ce('0x26')](_0x5d360b[_0x26ce('0x23')],qs[_0x26ce('0x28')](_0xceca6c[_0x26ce('0x27')][_0x26ce('0x28')]));_0x144f82[_0x26ce('0x29')]=_0x144f82['attributes'][_0x26ce('0x3b')]?_0x144f82[_0x26ce('0x29')]:_0x5d360b[_0x26ce('0x23')];if(_0xceca6c[_0x26ce('0x27')][_0x26ce('0x31')]){_0x144f82[_0x26ce('0x32')]=[{'all':!![]}];}_0x144f82=_[_0x26ce('0x2e')]({},_0x144f82,_0xceca6c[_0x26ce('0x30')]);return db[_0x26ce('0x1e')]['find'](_0x144f82)[_0x26ce('0x15')](handleEntityNotFound(_0xe9f948,null))['then'](function(_0x53a829){if(_0x53a829[_0x26ce('0x34')]===_0x26ce('0x35')){var _0x1f49d5=encryptor[_0x26ce('0x36')](_0x53a829[_0x26ce('0x37')]);_0x53a829[_0x26ce('0x37')]=maskClientSecret(_0x1f49d5);}return _0x53a829;})['then'](respondWithResult(_0xe9f948,null))[_0x26ce('0x38')](handleError(_0xe9f948,null));};exports['create']=function(_0x45f96c,_0x24c85d){if(!_0x45f96c[_0x26ce('0x3c')][_0x26ce('0x18')])throw new Error(_0x26ce('0x3d'));if(!_0x45f96c[_0x26ce('0x3c')][_0x26ce('0x34')])throw new Error(_0x26ce('0x3e'));var _0x402c75=db[_0x26ce('0x1e')]['rawAttributes'][_0x26ce('0x34')][_0x26ce('0x3f')];if(!_0x402c75[_0x26ce('0x40')](_0x45f96c[_0x26ce('0x3c')][_0x26ce('0x34')]))throw new Error(_0x26ce('0x41')+_0x402c75[_0x26ce('0x42')](',\x20'));if(_0x45f96c[_0x26ce('0x3c')][_0x26ce('0x34')]===_0x26ce('0x35')&&_0x45f96c[_0x26ce('0x3c')][_0x26ce('0x37')]){_0x45f96c[_0x26ce('0x3c')][_0x26ce('0x37')]=encryptor[_0x26ce('0x43')](_0x45f96c[_0x26ce('0x3c')]['data3']);}return db[_0x26ce('0x1e')][_0x26ce('0x44')](_0x45f96c[_0x26ce('0x3c')],{})[_0x26ce('0x15')](respondWithResult(_0x24c85d,0xc9))[_0x26ce('0x38')](handleError(_0x24c85d,null));};exports[_0x26ce('0x14')]=function(_0x9cd4f3,_0x52175c){if(_0x9cd4f3[_0x26ce('0x3c')]['id']){delete _0x9cd4f3[_0x26ce('0x3c')]['id'];}return db['CloudProvider'][_0x26ce('0x45')]({'where':{'id':_0x9cd4f3[_0x26ce('0x3a')]['id']}})['then'](handleEntityNotFound(_0x52175c,null))['then'](function(_0x1c1af0){if(_0x1c1af0[_0x26ce('0x34')]===_0x26ce('0x35')&&_0x9cd4f3[_0x26ce('0x3c')][_0x26ce('0x37')]){_0x9cd4f3[_0x26ce('0x3c')]['data3']=encryptor['encryptString'](_0x9cd4f3[_0x26ce('0x3c')]['data3']);}return _0x1c1af0;})['then'](saveUpdates(_0x9cd4f3[_0x26ce('0x3c')],null))['then'](respondWithResult(_0x52175c,null))[_0x26ce('0x38')](handleError(_0x52175c,null));};exports[_0x26ce('0x46')]=function(_0x11aeb6,_0x469c41){return db[_0x26ce('0x1e')][_0x26ce('0x45')]({'where':{'id':_0x11aeb6['params']['id']}})[_0x26ce('0x15')](handleEntityNotFound(_0x469c41,null))[_0x26ce('0x15')](removeEntity(_0x469c41,null))[_0x26ce('0x38')](handleError(_0x469c41,null));};exports[_0x26ce('0x47')]=function(_0x470e30,_0x251b64){return db[_0x26ce('0x1e')][_0x26ce('0x48')]({'where':{'id':_0x470e30[_0x26ce('0x3a')]['id']},'raw':!![]})[_0x26ce('0x15')](function(_0x10bb42){if(!_0x10bb42)return _0x251b64['sendStatus'](0x194);return{'url':oauth[_0x26ce('0x49')](_0x10bb42,_0x470e30[_0x26ce('0x4a')]['id'])};})[_0x26ce('0x15')](respondWithResult(_0x251b64,null))[_0x26ce('0x38')](handleError(_0x251b64,null));};exports[_0x26ce('0x4b')]=function(_0x19b35a,_0x13dd1e){var _0x3e52de=_0x19b35a[_0x26ce('0x3c')];var _0x124dd2;var _0x136000;if(_0x3e52de['error'])throw _0x3e52de;redis['get'](_0x3e52de['state'])['then'](function(_0x37f2a1){if(!_0x37f2a1)throw new Error(_0x26ce('0x4c'));_0x124dd2=JSON[_0x26ce('0x4d')](_0x37f2a1);var _0x31eb2c=Buffer[_0x26ce('0x4e')](_0x3e52de[_0x26ce('0x4f')],'base64')[_0x26ce('0x50')]('ascii');_0x136000=JSON[_0x26ce('0x4d')](_0x31eb2c);if(!oauth[_0x26ce('0x51')](_0x3e52de[_0x26ce('0x52')],_0x124dd2[_0x26ce('0x53')]))throw new Error('Unable\x20to\x20validate\x20id_token');redis[_0x26ce('0x54')](_0x3e52de[_0x26ce('0x4f')]);return oauth[_0x26ce('0x55')](_0x3e52de[_0x26ce('0x56')],_0x124dd2);})[_0x26ce('0x15')](function(_0x504818){_0x124dd2[_0x26ce('0x57')]=_0x504818[_0x26ce('0x58')];_0x124dd2[_0x26ce('0x59')]=_0x504818[_0x26ce('0x5a')];return db[_0x26ce('0x1e')][_0x26ce('0x14')]({'data5':_0x124dd2[_0x26ce('0x57')],'data6':_0x124dd2[_0x26ce('0x59')]},{'where':{'id':_0x124dd2['id']}});})[_0x26ce('0x15')](function(){oauth[_0x26ce('0x5b')](_0x124dd2);socket[_0x26ce('0x5c')](_0x26ce('0x5d'),{'id':_0x136000['id']});return;})[_0x26ce('0x15')](respondWithStatusCode(_0x13dd1e,null))['catch'](function(_0x3b464c){if(_0x136000){socket[_0x26ce('0x5c')](_0x26ce('0x5e'),{'id':_0x136000['id']});}if(!_0x124dd2){logger[_0x26ce('0x17')](_0x26ce('0x5f'),_0x3b464c);return _0x13dd1e[_0x26ce('0xb')](0x1f4)[_0x26ce('0x19')](_0x3b464c['message']);}logger[_0x26ce('0x17')](_0x26ce('0x60'),_0x124dd2['id'],JSON[_0x26ce('0x61')](_0x3b464c));});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index 294a871..d470443 100644 --- a/server/api/cloudProvider/cloudProvider.model.js +++ b/server/api/cloudProvider/cloudProvider.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdfd0=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','define','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdfd0,0x1cd));var _0x0dfd=function(_0x12eb5c,_0xd6d70d){_0x12eb5c=_0x12eb5c-0x0;var _0x38926a=_0xdfd0[_0x12eb5c];return _0x38926a;};'use strict';var _=require(_0x0dfd('0x0'));var util=require(_0x0dfd('0x1'));var logger=require(_0x0dfd('0x2'))(_0x0dfd('0x3'));var moment=require('moment');var BPromise=require(_0x0dfd('0x4'));var rp=require(_0x0dfd('0x5'));var fs=require('fs');var path=require(_0x0dfd('0x6'));var rimraf=require(_0x0dfd('0x7'));var config=require(_0x0dfd('0x8'));var attributes=require(_0x0dfd('0x9'));module['exports']=function(_0x3cff14,_0x6c7f72){return _0x3cff14[_0x0dfd('0xa')]('CloudProvider',attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa9f9=['cloud_providers','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','CloudProvider'];(function(_0x3cf7ce,_0x41bf3c){var _0x36f7fd=function(_0xc7f604){while(--_0xc7f604){_0x3cf7ce['push'](_0x3cf7ce['shift']());}};_0x36f7fd(++_0x41bf3c);}(_0xa9f9,0x1da));var _0x9a9f=function(_0x2cff6d,_0x4a1611){_0x2cff6d=_0x2cff6d-0x0;var _0x20e5bc=_0xa9f9[_0x2cff6d];return _0x20e5bc;};'use strict';var _=require(_0x9a9f('0x0'));var util=require('util');var logger=require(_0x9a9f('0x1'))(_0x9a9f('0x2'));var moment=require('moment');var BPromise=require(_0x9a9f('0x3'));var rp=require(_0x9a9f('0x4'));var fs=require('fs');var path=require(_0x9a9f('0x5'));var rimraf=require(_0x9a9f('0x6'));var config=require(_0x9a9f('0x7'));var attributes=require(_0x9a9f('0x8'));module['exports']=function(_0xb72abb,_0x200267){return _0xb72abb['define'](_0x9a9f('0x9'),attributes,{'tableName':_0x9a9f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js index 6239dd7..81c8e52 100644 --- a/server/api/cloudProvider/cloudProvider.oauth.js +++ b/server/api/cloudProvider/cloudProvider.oauth.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaa76=['error','authorization_code','decryptString','intervals','bind','findAll','all','catch','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','crypto','jsonwebtoken','moment','request-promise','../../config/environment','../../config/logger','api','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','openid','/authorize','/token','map','push','/.default','join','type','Outlook365','data7','replace','{TENANT_ID}','data2','code','from','stringify','toString','base64','hex','client_id','data1','redirect_uri','data4','response_mode','form_post','state','login','key','oauth2Claims','oauth2/','decode','payload','iss','issuer','aud','audience','nonce','isAfter','unix','exp','then','CloudProvider','findOne','refresh_token','data6','data3','POST','data5','access_token','update'];(function(_0x50863f,_0x2e48fb){var _0x1e6423=function(_0x388740){while(--_0x388740){_0x50863f['push'](_0x50863f['shift']());}};_0x1e6423(++_0x2e48fb);}(_0xaa76,0x191));var _0x6aa7=function(_0x4011b1,_0x4b88b5){_0x4011b1=_0x4011b1-0x0;var _0x61abca=_0xaa76[_0x4011b1];return _0x61abca;};'use strict';var _=require('lodash');var crypto=require(_0x6aa7('0x0'));var jwt=require(_0x6aa7('0x1'));var moment=require(_0x6aa7('0x2'));var Redis=require('ioredis');var rp=require(_0x6aa7('0x3'));var util=require('util');var encryptor=require('../../components/encryptor');var config=require(_0x6aa7('0x4'));var logger=require(_0x6aa7('0x5'))(_0x6aa7('0x6'));var schedule=require('../../config/schedule/cloud-provider');var db=require(_0x6aa7('0x7'))['db'];config[_0x6aa7('0x8')]=_[_0x6aa7('0x9')](config[_0x6aa7('0x8')],{'host':_0x6aa7('0xa'),'port':0x18eb});var redis=new Redis(config[_0x6aa7('0x8')]);var MICROSOFT_AUTH_URL=_0x6aa7('0xb');var AZURE_AUTH_SCOPES={'Outlook365':['openid','profile',_0x6aa7('0xc'),_0x6aa7('0xd'),_0x6aa7('0xe'),_0x6aa7('0xf'),_0x6aa7('0x10')],'Dynamics365':[_0x6aa7('0x11'),_0x6aa7('0xd')]};var MICROSOFT_AUTH_ENDPOINT=_0x6aa7('0x12');var MICROSOFT_TOKEN_ENDPOINT=_0x6aa7('0x13');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x1d8328){var _0x547133=_[_0x6aa7('0x14')](AZURE_AUTH_SCOPES[_0x1d8328['type']]);if(_0x1d8328['type']==='Dynamics365')_0x547133[_0x6aa7('0x15')](_0x1d8328['data7']+_0x6aa7('0x16'));return _0x547133[_0x6aa7('0x17')]('\x20');}function getAccessTokenScope(_0x5beb19){if(_0x5beb19[_0x6aa7('0x18')]===_0x6aa7('0x19'))return _0x6aa7('0xe');if(_0x5beb19[_0x6aa7('0x18')]==='Dynamics365')return _0x5beb19[_0x6aa7('0x1a')]+'/.default';}function generateMicrosoftAuthorizationUrl(_0x257cce,_0x2de462){var _0x18fe67=MICROSOFT_AUTH_URL[_0x6aa7('0x1b')](_0x6aa7('0x1c'),_0x257cce[_0x6aa7('0x1d')]);var _0x596294=[_0x6aa7('0x1e'),'id_token'];var _0x15f683=Buffer[_0x6aa7('0x1f')](JSON[_0x6aa7('0x20')]({'id':_0x2de462}))[_0x6aa7('0x21')](_0x6aa7('0x22'));var _0x5ef0b1=crypto['randomBytes'](0x10)[_0x6aa7('0x21')](_0x6aa7('0x23'));var _0x57a373=getAuthorizationScopes(_0x257cce);var _0x23d684=[{'key':_0x6aa7('0x24'),'value':_0x257cce[_0x6aa7('0x25')]},{'key':'response_type','value':encodeURIComponent(_0x596294[_0x6aa7('0x17')]('\x20'))},{'key':_0x6aa7('0x26'),'value':_0x257cce[_0x6aa7('0x27')]},{'key':_0x6aa7('0x28'),'value':_0x6aa7('0x29')},{'key':'scope','value':encodeURIComponent(_0x57a373)},{'key':_0x6aa7('0x2a'),'value':_0x15f683},{'key':'nonce','value':_0x5ef0b1},{'key':'prompt','value':_0x6aa7('0x2b')}];var _0x186386=_0x18fe67+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x23d684,function(_0x3f5b2b){return _0x3f5b2b[_0x6aa7('0x2c')]+'='+_0x3f5b2b['value'];})[_0x6aa7('0x17')]('&');_0x257cce[_0x6aa7('0x2d')]={'issuer':_0x18fe67[_0x6aa7('0x1b')](_0x6aa7('0x2e'),''),'audience':_0x257cce[_0x6aa7('0x25')],'state':_0x15f683,'nonce':_0x5ef0b1};redis['set'](_0x15f683,JSON[_0x6aa7('0x20')](_0x257cce));return _0x186386;}function isValidIdToken(_0x4f26df,_0x25e698){try{var _0x4ab670=jwt[_0x6aa7('0x2f')](_0x4f26df,{'complete':!![]});var _0x42df0a=_0x4ab670[_0x6aa7('0x30')];if(_0x42df0a[_0x6aa7('0x31')]!==_0x25e698[_0x6aa7('0x32')])return![];if(_0x42df0a[_0x6aa7('0x33')]!==_0x25e698[_0x6aa7('0x34')])return![];if(_0x42df0a['nonce']!==_0x25e698[_0x6aa7('0x35')])return![];if(moment()[_0x6aa7('0x36')](moment[_0x6aa7('0x37')](_0x42df0a[_0x6aa7('0x38')])))return![];return!![];}catch(_0x913e93){throw _0x913e93;}}function refreshOauth2MicrosoftAccessToken(_0x383666){return Promise['resolve']()[_0x6aa7('0x39')](function(){if(_0x383666['data3'])return _0x383666;return db[_0x6aa7('0x3a')][_0x6aa7('0x3b')]({'where':{'id':_0x383666['id']},'raw':!![]});})[_0x6aa7('0x39')](function(_0x22b03e){var _0xd74884={'grant_type':_0x6aa7('0x3c'),'refresh_token':_0x22b03e[_0x6aa7('0x3d')],'scope':getAccessTokenScope(_0x22b03e),'redirect_uri':_0x22b03e[_0x6aa7('0x27')],'client_id':_0x22b03e[_0x6aa7('0x25')],'client_secret':encryptor['decryptString'](_0x22b03e[_0x6aa7('0x3e')])};var _0x5586fc={'method':_0x6aa7('0x3f'),'uri':MICROSOFT_AUTH_URL[_0x6aa7('0x1b')](_0x6aa7('0x1c'),_0x22b03e[_0x6aa7('0x1d')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0xd74884,'json':!![]};return rp(_0x5586fc);})[_0x6aa7('0x39')](function(_0x2aa4f6){_0x383666[_0x6aa7('0x40')]=_0x2aa4f6[_0x6aa7('0x41')];_0x383666[_0x6aa7('0x3d')]=_0x2aa4f6['refresh_token'];return db['CloudProvider'][_0x6aa7('0x42')]({'data5':_0x383666[_0x6aa7('0x40')],'data6':_0x383666[_0x6aa7('0x3d')]},{'where':{'id':_0x383666['id']}});})[_0x6aa7('0x39')](function(){return _0x383666;})['catch'](function(_0x222eb0){logger[_0x6aa7('0x43')]('Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s',_0x383666['id'],_0x222eb0);});}function getOauth2MicrosoftAccessToken(_0x3bf565,_0x463744){var _0x7cb72f={'grant_type':_0x6aa7('0x44'),'code':_0x3bf565,'scope':getAccessTokenScope(_0x463744),'redirect_uri':_0x463744[_0x6aa7('0x27')],'client_id':_0x463744['data1'],'client_secret':encryptor[_0x6aa7('0x45')](_0x463744[_0x6aa7('0x3e')])};var _0x39abbc={'method':_0x6aa7('0x3f'),'uri':MICROSOFT_AUTH_URL[_0x6aa7('0x1b')](_0x6aa7('0x1c'),_0x463744[_0x6aa7('0x1d')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x7cb72f,'json':!![]};return rp(_0x39abbc);}function startRefreshInterval(_0x582fb4){var _0x9312d2=schedule[_0x6aa7('0x46')];if(_0x9312d2[_0x582fb4['id']])clearInterval(_0x9312d2[_0x582fb4['id']]);_0x9312d2[_0x582fb4['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x6aa7('0x47')](this,{'id':_0x582fb4['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x9312d2;}function startAllRefreshIntervals(){return db[_0x6aa7('0x3a')][_0x6aa7('0x48')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x6aa7('0x39')](function(_0x50bdd7){var _0x399891=_0x50bdd7[_0x6aa7('0x14')](function(_0x5a8f74){return refreshOauth2MicrosoftAccessToken(_0x5a8f74)[_0x6aa7('0x39')](function(_0x416685){startRefreshInterval(_0x416685);});});return Promise[_0x6aa7('0x49')](_0x399891);})[_0x6aa7('0x4a')](function(_0x1ebb82){var _0x53250c=_0x1ebb82?util[_0x6aa7('0x4b')](_0x1ebb82,{'showHidden':![],'depth':null}):'';logger[_0x6aa7('0x43')](_0x6aa7('0x4c'),_0x53250c);});}module[_0x6aa7('0x4d')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file +var _0x18ec=['error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','POST','replace','intervals','findAll','catch','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','crypto','jsonwebtoken','moment','ioredis','util','../../components/encryptor','../../config/environment','api','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','openid','/authorize','/token','map','type','Dynamics365','data7','/.default','Outlook365','{TENANT_ID}','data2','code','id_token','toString','base64','randomBytes','hex','data1','join','redirect_uri','data4','response_mode','scope','state','nonce','prompt','login','key','oauth2/','set','stringify','decode','payload','issuer','aud','audience','unix','exp','resolve','then','data3','findOne','refresh_token','data6','decryptString','data5','access_token','CloudProvider'];(function(_0x1830a4,_0x1f1525){var _0x599910=function(_0xcec6b4){while(--_0xcec6b4){_0x1830a4['push'](_0x1830a4['shift']());}};_0x599910(++_0x1f1525);}(_0x18ec,0xa3));var _0xc18e=function(_0x4d7776,_0x179dd7){_0x4d7776=_0x4d7776-0x0;var _0x1929ac=_0x18ec[_0x4d7776];return _0x1929ac;};'use strict';var _=require(_0xc18e('0x0'));var crypto=require(_0xc18e('0x1'));var jwt=require(_0xc18e('0x2'));var moment=require(_0xc18e('0x3'));var Redis=require(_0xc18e('0x4'));var rp=require('request-promise');var util=require(_0xc18e('0x5'));var encryptor=require(_0xc18e('0x6'));var config=require(_0xc18e('0x7'));var logger=require('../../config/logger')(_0xc18e('0x8'));var schedule=require('../../config/schedule/cloud-provider');var db=require('../../mysqldb')['db'];config[_0xc18e('0x9')]=_[_0xc18e('0xa')](config[_0xc18e('0x9')],{'host':_0xc18e('0xb'),'port':0x18eb});var redis=new Redis(config[_0xc18e('0x9')]);var MICROSOFT_AUTH_URL=_0xc18e('0xc');var AZURE_AUTH_SCOPES={'Outlook365':['openid',_0xc18e('0xd'),_0xc18e('0xe'),_0xc18e('0xf'),_0xc18e('0x10'),'https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send'],'Dynamics365':[_0xc18e('0x11'),_0xc18e('0xf')]};var MICROSOFT_AUTH_ENDPOINT=_0xc18e('0x12');var MICROSOFT_TOKEN_ENDPOINT=_0xc18e('0x13');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0xd7df04){var _0x2a04ea=_[_0xc18e('0x14')](AZURE_AUTH_SCOPES[_0xd7df04[_0xc18e('0x15')]]);if(_0xd7df04['type']===_0xc18e('0x16'))_0x2a04ea['push'](_0xd7df04[_0xc18e('0x17')]+_0xc18e('0x18'));return _0x2a04ea['join']('\x20');}function getAccessTokenScope(_0x98355a){if(_0x98355a[_0xc18e('0x15')]===_0xc18e('0x19'))return _0xc18e('0x10');if(_0x98355a[_0xc18e('0x15')]===_0xc18e('0x16'))return _0x98355a[_0xc18e('0x17')]+_0xc18e('0x18');}function generateMicrosoftAuthorizationUrl(_0x4ccb74,_0x20e312){var _0x5e3a89=MICROSOFT_AUTH_URL['replace'](_0xc18e('0x1a'),_0x4ccb74[_0xc18e('0x1b')]);var _0x596a91=[_0xc18e('0x1c'),_0xc18e('0x1d')];var _0x233c18=Buffer['from'](JSON['stringify']({'id':_0x20e312}))[_0xc18e('0x1e')](_0xc18e('0x1f'));var _0x13c72a=crypto[_0xc18e('0x20')](0x10)[_0xc18e('0x1e')](_0xc18e('0x21'));var _0x1c3316=getAuthorizationScopes(_0x4ccb74);var _0x36cffb=[{'key':'client_id','value':_0x4ccb74[_0xc18e('0x22')]},{'key':'response_type','value':encodeURIComponent(_0x596a91[_0xc18e('0x23')]('\x20'))},{'key':_0xc18e('0x24'),'value':_0x4ccb74[_0xc18e('0x25')]},{'key':_0xc18e('0x26'),'value':'form_post'},{'key':_0xc18e('0x27'),'value':encodeURIComponent(_0x1c3316)},{'key':_0xc18e('0x28'),'value':_0x233c18},{'key':_0xc18e('0x29'),'value':_0x13c72a},{'key':_0xc18e('0x2a'),'value':_0xc18e('0x2b')}];var _0x258b21=_0x5e3a89+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xc18e('0x14')](_0x36cffb,function(_0x393c51){return _0x393c51[_0xc18e('0x2c')]+'='+_0x393c51['value'];})[_0xc18e('0x23')]('&');_0x4ccb74['oauth2Claims']={'issuer':_0x5e3a89['replace'](_0xc18e('0x2d'),''),'audience':_0x4ccb74[_0xc18e('0x22')],'state':_0x233c18,'nonce':_0x13c72a};redis[_0xc18e('0x2e')](_0x233c18,JSON[_0xc18e('0x2f')](_0x4ccb74));return _0x258b21;}function isValidIdToken(_0x24aa87,_0x5abe04){try{var _0xdb01ce=jwt[_0xc18e('0x30')](_0x24aa87,{'complete':!![]});var _0x5d5684=_0xdb01ce[_0xc18e('0x31')];if(_0x5d5684['iss']!==_0x5abe04[_0xc18e('0x32')])return![];if(_0x5d5684[_0xc18e('0x33')]!==_0x5abe04[_0xc18e('0x34')])return![];if(_0x5d5684[_0xc18e('0x29')]!==_0x5abe04['nonce'])return![];if(moment()['isAfter'](moment[_0xc18e('0x35')](_0x5d5684[_0xc18e('0x36')])))return![];return!![];}catch(_0x303653){throw _0x303653;}}function refreshOauth2MicrosoftAccessToken(_0x50cf64){return Promise[_0xc18e('0x37')]()[_0xc18e('0x38')](function(){if(_0x50cf64[_0xc18e('0x39')])return _0x50cf64;return db['CloudProvider'][_0xc18e('0x3a')]({'where':{'id':_0x50cf64['id']},'raw':!![]});})[_0xc18e('0x38')](function(_0x1e3587){var _0x33db1b={'grant_type':_0xc18e('0x3b'),'refresh_token':_0x1e3587[_0xc18e('0x3c')],'scope':getAccessTokenScope(_0x1e3587),'redirect_uri':_0x1e3587[_0xc18e('0x25')],'client_id':_0x1e3587[_0xc18e('0x22')],'client_secret':encryptor[_0xc18e('0x3d')](_0x1e3587[_0xc18e('0x39')])};var _0x21505b={'method':'POST','uri':MICROSOFT_AUTH_URL['replace'](_0xc18e('0x1a'),_0x1e3587['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x33db1b,'json':!![]};return rp(_0x21505b);})[_0xc18e('0x38')](function(_0x15c45f){_0x50cf64[_0xc18e('0x3e')]=_0x15c45f[_0xc18e('0x3f')];_0x50cf64[_0xc18e('0x3c')]=_0x15c45f[_0xc18e('0x3b')];return db[_0xc18e('0x40')]['update']({'data5':_0x50cf64[_0xc18e('0x3e')],'data6':_0x50cf64['data6']},{'where':{'id':_0x50cf64['id']}});})[_0xc18e('0x38')](function(){return _0x50cf64;})['catch'](function(_0x6d53c8){logger[_0xc18e('0x41')](_0xc18e('0x42'),_0x50cf64['id'],_0x6d53c8);});}function getOauth2MicrosoftAccessToken(_0x2bd935,_0x4e9d03){var _0x8e0d26={'grant_type':_0xc18e('0x43'),'code':_0x2bd935,'scope':getAccessTokenScope(_0x4e9d03),'redirect_uri':_0x4e9d03['data4'],'client_id':_0x4e9d03[_0xc18e('0x22')],'client_secret':encryptor['decryptString'](_0x4e9d03[_0xc18e('0x39')])};var _0x21aab0={'method':_0xc18e('0x44'),'uri':MICROSOFT_AUTH_URL[_0xc18e('0x45')]('{TENANT_ID}',_0x4e9d03[_0xc18e('0x1b')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x8e0d26,'json':!![]};return rp(_0x21aab0);}function startRefreshInterval(_0x1fd4a4){var _0x21ce3e=schedule[_0xc18e('0x46')];if(_0x21ce3e[_0x1fd4a4['id']])clearInterval(_0x21ce3e[_0x1fd4a4['id']]);_0x21ce3e[_0x1fd4a4['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0x1fd4a4['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x21ce3e;}function startAllRefreshIntervals(){return db[_0xc18e('0x40')][_0xc18e('0x47')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xc18e('0x38')](function(_0x500a0a){var _0x9f789c=_0x500a0a['map'](function(_0x135752){return refreshOauth2MicrosoftAccessToken(_0x135752)['then'](function(_0x46f034){startRefreshInterval(_0x46f034);});});return Promise['all'](_0x9f789c);})[_0xc18e('0x48')](function(_0x11b13d){var _0x2ff96c=_0x11b13d?util[_0xc18e('0x49')](_0x11b13d,{'showHidden':![],'depth':null}):'';logger[_0xc18e('0x41')](_0xc18e('0x4a'),_0x2ff96c);});}module[_0xc18e('0x4b')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js index 43f7883..d2847d4 100644 --- a/server/api/cloudProvider/cloudProvider.rpc.js +++ b/server/api/cloudProvider/cloudProvider.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x20df=['debug','CloudProvider,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','then','info','CloudProvider,\x20%s,\x20%s'];(function(_0x3d0d77,_0xf83fb4){var _0x5492f0=function(_0x5a7243){while(--_0x5a7243){_0x3d0d77['push'](_0x3d0d77['shift']());}};_0x5492f0(++_0xf83fb4);}(_0x20df,0x7c));var _0xf20d=function(_0xe73080,_0x24c56d){_0xe73080=_0xe73080-0x0;var _0x12cbc4=_0x20df[_0xe73080];return _0x12cbc4;};'use strict';var _=require(_0xf20d('0x0'));var util=require(_0xf20d('0x1'));var moment=require(_0xf20d('0x2'));var BPromise=require(_0xf20d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf20d('0x4'));var db=require(_0xf20d('0x5'))['db'];var utils=require(_0xf20d('0x6'));var logger=require(_0xf20d('0x7'))(_0xf20d('0x8'));var config=require('../../config/environment');var jayson=require(_0xf20d('0x9'));var client=jayson['client'][_0xf20d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x41d0da,_0x53a7b5,_0x184c8d){return new BPromise(function(_0x5f0353,_0x4f36d1){return client['request'](_0x41d0da,_0x184c8d)[_0xf20d('0xb')](function(_0x22b427){logger[_0xf20d('0xc')](_0xf20d('0xd'),_0x53a7b5,'request\x20sent');logger[_0xf20d('0xe')](_0xf20d('0xf'),_0x53a7b5,_0xf20d('0x10'),JSON[_0xf20d('0x11')](_0x22b427));if(_0x22b427[_0xf20d('0x12')]){if(_0x22b427[_0xf20d('0x12')][_0xf20d('0x13')]===0x1f4){logger[_0xf20d('0x12')]('CloudProvider,\x20%s,\x20%s',_0x53a7b5,_0x22b427[_0xf20d('0x12')]['message']);return _0x4f36d1(_0x22b427[_0xf20d('0x12')][_0xf20d('0x14')]);}logger['error'](_0xf20d('0xd'),_0x53a7b5,_0x22b427[_0xf20d('0x12')][_0xf20d('0x14')]);return _0x5f0353(_0x22b427[_0xf20d('0x12')][_0xf20d('0x14')]);}else{logger['info']('CloudProvider,\x20%s,\x20%s',_0x53a7b5,_0xf20d('0x10'));_0x5f0353(_0x22b427[_0xf20d('0x15')][_0xf20d('0x14')]);}})[_0xf20d('0x16')](function(_0x53c164){logger[_0xf20d('0x12')]('CloudProvider,\x20%s,\x20%s',_0x53a7b5,_0x53c164);_0x4f36d1(_0x53c164);});});} \ No newline at end of file +var _0x2015=['client','http','then','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x21b524,_0x535d0b){var _0x44e487=function(_0x2f299e){while(--_0x2f299e){_0x21b524['push'](_0x21b524['shift']());}};_0x44e487(++_0x535d0b);}(_0x2015,0x193));var _0x5201=function(_0x6aae21,_0x52e32e){_0x6aae21=_0x6aae21-0x0;var _0x3dfa13=_0x2015[_0x6aae21];return _0x3dfa13;};'use strict';var _=require(_0x5201('0x0'));var util=require(_0x5201('0x1'));var moment=require(_0x5201('0x2'));var BPromise=require(_0x5201('0x3'));var rs=require(_0x5201('0x4'));var fs=require('fs');var Redis=require(_0x5201('0x5'));var db=require(_0x5201('0x6'))['db'];var utils=require(_0x5201('0x7'));var logger=require('../../config/logger')(_0x5201('0x8'));var config=require(_0x5201('0x9'));var jayson=require(_0x5201('0xa'));var client=jayson[_0x5201('0xb')][_0x5201('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x11ce7b,_0x334b42,_0x374d23){return new BPromise(function(_0x15367c,_0x6fc2c3){return client['request'](_0x11ce7b,_0x374d23)[_0x5201('0xd')](function(_0x17d8f3){logger['info'](_0x5201('0xe'),_0x334b42,_0x5201('0xf'));logger[_0x5201('0x10')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x334b42,_0x5201('0xf'),JSON[_0x5201('0x11')](_0x17d8f3));if(_0x17d8f3[_0x5201('0x12')]){if(_0x17d8f3[_0x5201('0x12')][_0x5201('0x13')]===0x1f4){logger[_0x5201('0x12')](_0x5201('0xe'),_0x334b42,_0x17d8f3[_0x5201('0x12')][_0x5201('0x14')]);return _0x6fc2c3(_0x17d8f3[_0x5201('0x12')][_0x5201('0x14')]);}logger[_0x5201('0x12')]('CloudProvider,\x20%s,\x20%s',_0x334b42,_0x17d8f3[_0x5201('0x12')][_0x5201('0x14')]);return _0x15367c(_0x17d8f3['error']['message']);}else{logger[_0x5201('0x15')](_0x5201('0xe'),_0x334b42,_0x5201('0xf'));_0x15367c(_0x17d8f3['result']['message']);}})[_0x5201('0x16')](function(_0x582210){logger[_0x5201('0x12')]('CloudProvider,\x20%s,\x20%s',_0x334b42,_0x582210);_0x6fc2c3(_0x582210);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index 87d4e9b..482ff08 100644 --- a/server/api/cloudProvider/index.js +++ b/server/api/cloudProvider/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ef3=['Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','/:id','show','post','put','update','delete','destroy','/:id/oauth2/microsoft/authorize/','/oauth2/microsoft/callback','oauth2MicrosoftCallback','exports','express'];(function(_0x29e306,_0x9ff344){var _0x4f4cb4=function(_0x9074e){while(--_0x9074e){_0x29e306['push'](_0x29e306['shift']());}};_0x4f4cb4(++_0x9ff344);}(_0x2ef3,0xba));var _0x32ef=function(_0x7ebc71,_0x52cff0){_0x7ebc71=_0x7ebc71-0x0;var _0x31e7aa=_0x2ef3[_0x7ebc71];return _0x31e7aa;};'use strict';var express=require(_0x32ef('0x0'));var router=express[_0x32ef('0x1')]();var auth=require(_0x32ef('0x2'));var controller=require(_0x32ef('0x3'));router[_0x32ef('0x4')]('/',auth[_0x32ef('0x5')](),controller['index']);router[_0x32ef('0x4')](_0x32ef('0x6'),auth['isAuthenticated'](),controller[_0x32ef('0x7')]);router[_0x32ef('0x8')]('/',auth['isAuthenticated'](),controller['create']);router[_0x32ef('0x9')](_0x32ef('0x6'),auth[_0x32ef('0x5')](),controller[_0x32ef('0xa')]);router[_0x32ef('0xb')](_0x32ef('0x6'),auth[_0x32ef('0x5')](),controller[_0x32ef('0xc')]);router[_0x32ef('0x4')](_0x32ef('0xd'),auth['isAuthenticated'](),controller['oauth2MicrosoftAuthorize']);router[_0x32ef('0x8')](_0x32ef('0xe'),controller[_0x32ef('0xf')]);module[_0x32ef('0x10')]=router; \ No newline at end of file +var _0xc4aa=['put','/:id','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','/oauth2/microsoft/callback','exports','express','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','show','post','create'];(function(_0x222199,_0x586a25){var _0x1a1c74=function(_0x258b6c){while(--_0x258b6c){_0x222199['push'](_0x222199['shift']());}};_0x1a1c74(++_0x586a25);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0xc4aa[_0x4b055c];return _0x4b62bb;};'use strict';var express=require(_0xac4a('0x0'));var router=express[_0xac4a('0x1')]();var auth=require(_0xac4a('0x2'));var controller=require(_0xac4a('0x3'));router[_0xac4a('0x4')]('/',auth[_0xac4a('0x5')](),controller['index']);router['get']('/:id',auth[_0xac4a('0x5')](),controller[_0xac4a('0x6')]);router[_0xac4a('0x7')]('/',auth[_0xac4a('0x5')](),controller[_0xac4a('0x8')]);router[_0xac4a('0x9')](_0xac4a('0xa'),auth[_0xac4a('0x5')](),controller['update']);router['delete'](_0xac4a('0xa'),auth[_0xac4a('0x5')](),controller[_0xac4a('0xb')]);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x5')](),controller[_0xac4a('0xd')]);router['post'](_0xac4a('0xe'),controller['oauth2MicrosoftCallback']);module[_0xac4a('0xf')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index e9c8f1b..a2dfb4e 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 _0xc71a=['exports','STRING','name','sequelize'];(function(_0x99b9e9,_0xad810e){var _0x13c88d=function(_0x35108c){while(--_0x35108c){_0x99b9e9['push'](_0x99b9e9['shift']());}};_0x13c88d(++_0xad810e);}(_0xc71a,0x137));var _0xac71=function(_0x53131d,_0x41195e){_0x53131d=_0x53131d-0x0;var _0x2a38b3=_0xc71a[_0x53131d];return _0x2a38b3;};'use strict';var Sequelize=require(_0xac71('0x0'));module[_0xac71('0x1')]={'name':{'type':Sequelize[_0xac71('0x2')],'unique':_0xac71('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xac71('0x2')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xac71('0x2')]},'fax':{'type':Sequelize[_0xac71('0x2')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0xac71('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xac71('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0xac71('0x2')]},'sCountry':{'type':Sequelize[_0xac71('0x2')]},'description':{'type':Sequelize[_0xac71('0x2')]}}; \ No newline at end of file +var _0x74c7=['name','sequelize','STRING'];(function(_0x37b1d8,_0x614312){var _0x3739e7=function(_0x15a5bb){while(--_0x15a5bb){_0x37b1d8['push'](_0x37b1d8['shift']());}};_0x3739e7(++_0x614312);}(_0x74c7,0x8e));var _0x774c=function(_0x2b5dc1,_0x4ac2d5){_0x2b5dc1=_0x2b5dc1-0x0;var _0x42074a=_0x74c7[_0x2b5dc1];return _0x42074a;};'use strict';var Sequelize=require(_0x774c('0x0'));module['exports']={'name':{'type':Sequelize[_0x774c('0x1')],'unique':_0x774c('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x774c('0x1')]},'companyId':{'type':Sequelize[_0x774c('0x1')]},'website':{'type':Sequelize[_0x774c('0x1')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x774c('0x1')]},'type':{'type':Sequelize[_0x774c('0x1')]},'street':{'type':Sequelize[_0x774c('0x1')]},'postalCode':{'type':Sequelize[_0x774c('0x1')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x774c('0x1')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x774c('0x1')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0x774c('0x1')]},'sCity':{'type':Sequelize[_0x774c('0x1')]},'sCountry':{'type':Sequelize[_0x774c('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index 6958995..13f9062 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 _0xca4d=['UserProfileSection','userProfileId','autoAssociation','params','addContacts','CmContact','ids','omit','getContacts','findOne','rawAttributes','options','nolimit','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','Companies','UserProfileResource','sendStatus','error','name','index','CmCompany','describe','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','map','findAll','catch','show','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role'];(function(_0x2bad29,_0x250594){var _0x7969b3=function(_0x4858b7){while(--_0x4858b7){_0x2bad29['push'](_0x2bad29['shift']());}};_0x7969b3(++_0x250594);}(_0xca4d,0x165));var _0xdca4=function(_0x53dfb7,_0x55e07a){_0x53dfb7=_0x53dfb7-0x0;var _0x5e0225=_0xca4d[_0x53dfb7];return _0x5e0225;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdca4('0x0'));var zipdir=require(_0xdca4('0x1'));var jsonpatch=require(_0xdca4('0x2'));var rp=require(_0xdca4('0x3'));var moment=require('moment');var BPromise=require(_0xdca4('0x4'));var Mustache=require(_0xdca4('0x5'));var util=require(_0xdca4('0x6'));var path=require(_0xdca4('0x7'));var sox=require(_0xdca4('0x8'));var csv=require('to-csv');var ejs=require(_0xdca4('0x9'));var fs=require('fs');var fs_extra=require(_0xdca4('0xa'));var _=require(_0xdca4('0xb'));var squel=require(_0xdca4('0xc'));var crypto=require(_0xdca4('0xd'));var jsforce=require(_0xdca4('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xdca4('0xf'));var Papa=require(_0xdca4('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xdca4('0x11'));var as=require(_0xdca4('0x12'));var hardwareService=require(_0xdca4('0x13'));var logger=require(_0xdca4('0x14'))(_0xdca4('0x15'));var utils=require(_0xdca4('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xdca4('0x17'))['db'];function respondWithStatusCode(_0x59c8e5,_0x45ac9c){_0x45ac9c=_0x45ac9c||0xcc;return function(_0x20f681){if(_0x20f681){return _0x59c8e5['sendStatus'](_0x45ac9c);}return _0x59c8e5[_0xdca4('0x18')](_0x45ac9c)['end']();};}function respondWithResult(_0xd745ac,_0x4e0ed6){_0x4e0ed6=_0x4e0ed6||0xc8;return function(_0x498708){if(_0x498708){return _0xd745ac[_0xdca4('0x18')](_0x4e0ed6)[_0xdca4('0x19')](_0x498708);}};}function respondWithFilteredResult(_0x5eb837,_0x5b0327){return function(_0x380631){if(_0x380631){var _0x7b8674=typeof _0x5b0327['offset']===_0xdca4('0x1a')&&typeof _0x5b0327[_0xdca4('0x1b')]===_0xdca4('0x1a');var _0x2192e7=_0x380631[_0xdca4('0x1c')];var _0x39205c=_0x7b8674?0x0:_0x5b0327[_0xdca4('0x1d')];var _0x5c5edb=_0x7b8674?_0x380631['count']:_0x5b0327[_0xdca4('0x1d')]+_0x5b0327[_0xdca4('0x1b')];var _0x29219c;if(_0x5c5edb>=_0x2192e7){_0x5c5edb=_0x2192e7;_0x29219c=0xc8;}else{_0x29219c=0xce;}_0x5eb837[_0xdca4('0x18')](_0x29219c);return _0x5eb837[_0xdca4('0x1e')](_0xdca4('0x1f'),_0x39205c+'-'+_0x5c5edb+'/'+_0x2192e7)[_0xdca4('0x19')](_0x380631);}return null;};}function patchUpdates(_0x3486ea){return function(_0x27d13b){try{jsonpatch[_0xdca4('0x20')](_0x27d13b,_0x3486ea,!![]);}catch(_0x484bde){return BPromise[_0xdca4('0x21')](_0x484bde);}return _0x27d13b[_0xdca4('0x22')]();};}function saveUpdates(_0x1fdc72,_0x4c8aa9){return function(_0xdd513d){if(_0xdd513d){return _0xdd513d[_0xdca4('0x23')](_0x1fdc72)[_0xdca4('0x24')](function(_0x43be8b){return _0x43be8b;});}return null;};}function removeEntity(_0x43fa50,_0x5dbdc7){return function(_0x5e39b){if(_0x5e39b){return _0x5e39b[_0xdca4('0x25')]()['then'](function(){var _0x1ed329=_0x5e39b[_0xdca4('0x26')]({'plain':!![]});var _0x33b219=_0xdca4('0x27');return db[_0xdca4('0x28')]['destroy']({'where':{'type':_0x33b219,'resourceId':_0x1ed329['id']}})[_0xdca4('0x24')](function(){return _0x5e39b;});})[_0xdca4('0x24')](function(){_0x43fa50[_0xdca4('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5bee4f,_0x1f5ad8){return function(_0x302af8){if(!_0x302af8){_0x5bee4f[_0xdca4('0x29')](0x194);}return _0x302af8;};}function handleError(_0x4ea041,_0x3f1e09){_0x3f1e09=_0x3f1e09||0x1f4;return function(_0x8cf9af){logger[_0xdca4('0x2a')](_0x8cf9af['stack']);if(_0x8cf9af[_0xdca4('0x2b')]){delete _0x8cf9af[_0xdca4('0x2b')];}_0x4ea041[_0xdca4('0x18')](_0x3f1e09)['send'](_0x8cf9af);};}exports[_0xdca4('0x2c')]=function(_0x4b1280,_0x26ee9a){var _0x316a2e={},_0x2b50ac={},_0x1f7db8={'count':0x0,'rows':[]};return db[_0xdca4('0x2d')][_0xdca4('0x2e')]()['then'](function(_0x2697db){_0x2b50ac[_0xdca4('0x2f')]=_[_0xdca4('0x30')](_0x2697db);_0x2b50ac['query']=_[_0xdca4('0x30')](_0x4b1280['query']);_0x2b50ac[_0xdca4('0x31')]=_[_0xdca4('0x32')](_0x2b50ac['model'],_0x2b50ac[_0xdca4('0x33')]);_0x316a2e[_0xdca4('0x34')]=_[_0xdca4('0x32')](_0x2b50ac[_0xdca4('0x2f')],qs[_0xdca4('0x35')](_0x4b1280['query'][_0xdca4('0x35')]));_0x316a2e[_0xdca4('0x34')]=_0x316a2e[_0xdca4('0x34')][_0xdca4('0x36')]?_0x316a2e[_0xdca4('0x34')]:_0x2b50ac[_0xdca4('0x2f')];if(!_0x4b1280[_0xdca4('0x33')][_0xdca4('0x37')]('nolimit')){_0x316a2e[_0xdca4('0x1b')]=qs[_0xdca4('0x1b')](_0x4b1280[_0xdca4('0x33')]['limit']);_0x316a2e['offset']=qs[_0xdca4('0x1d')](_0x4b1280[_0xdca4('0x33')][_0xdca4('0x1d')]);}_0x316a2e[_0xdca4('0x38')]=qs['sort'](_0x4b1280['query'][_0xdca4('0x39')]);_0x316a2e[_0xdca4('0x3a')]=qs[_0xdca4('0x31')](_[_0xdca4('0x3b')](_0x4b1280[_0xdca4('0x33')],_0x2b50ac[_0xdca4('0x31')]),_0x2697db);if(_0x4b1280[_0xdca4('0x33')][_0xdca4('0x3c')]){_0x316a2e[_0xdca4('0x3a')]=_[_0xdca4('0x3d')](_0x316a2e[_0xdca4('0x3a')],{'$or':_[_0xdca4('0x3e')](_0x316a2e[_0xdca4('0x34')],function(_0x34c7bb){var _0x365251={};_0x365251[_0x34c7bb]={'$like':'%'+_0x4b1280[_0xdca4('0x33')][_0xdca4('0x3c')]+'%'};return _0x365251;})});}_0x316a2e=_[_0xdca4('0x3d')]({},_0x316a2e,_0x4b1280['options']);var _0x35df66={'where':_0x316a2e['where']};return db['CmCompany'][_0xdca4('0x1c')](_0x35df66)[_0xdca4('0x24')](function(_0x1bce91){_0x1f7db8[_0xdca4('0x1c')]=_0x1bce91;if(_0x4b1280[_0xdca4('0x33')]['includeAll']){_0x316a2e['include']=[{'all':!![]}];}return db['CmCompany'][_0xdca4('0x3f')](_0x316a2e);})[_0xdca4('0x24')](function(_0x37b969){_0x1f7db8['rows']=_0x37b969;return _0x1f7db8;})[_0xdca4('0x24')](respondWithFilteredResult(_0x26ee9a,_0x316a2e))[_0xdca4('0x40')](handleError(_0x26ee9a,null));})['catch'](handleError(_0x26ee9a,null));};exports[_0xdca4('0x41')]=function(_0x4aba1b,_0xce97c8){var _0x30259a={'raw':![],'where':{'id':_0x4aba1b['params']['id']}},_0x2b352f={};_0x2b352f[_0xdca4('0x2f')]=_[_0xdca4('0x30')](db['CmCompany']['rawAttributes']);_0x2b352f['query']=_['keys'](_0x4aba1b[_0xdca4('0x33')]);_0x2b352f[_0xdca4('0x31')]=_[_0xdca4('0x32')](_0x2b352f['model'],_0x2b352f[_0xdca4('0x33')]);_0x30259a[_0xdca4('0x34')]=_[_0xdca4('0x32')](_0x2b352f[_0xdca4('0x2f')],qs[_0xdca4('0x35')](_0x4aba1b[_0xdca4('0x33')][_0xdca4('0x35')]));_0x30259a[_0xdca4('0x34')]=_0x30259a['attributes'][_0xdca4('0x36')]?_0x30259a[_0xdca4('0x34')]:_0x2b352f[_0xdca4('0x2f')];if(_0x4aba1b[_0xdca4('0x33')][_0xdca4('0x42')]){_0x30259a['include']=[{'all':!![]}];}_0x30259a=_[_0xdca4('0x3d')]({},_0x30259a,_0x4aba1b['options']);return db['CmCompany'][_0xdca4('0x43')](_0x30259a)[_0xdca4('0x24')](handleEntityNotFound(_0xce97c8,null))['then'](respondWithResult(_0xce97c8,null))[_0xdca4('0x40')](handleError(_0xce97c8,null));};exports['create']=function(_0x236d54,_0x39ccb3){return db[_0xdca4('0x2d')][_0xdca4('0x44')](_0x236d54[_0xdca4('0x45')],{})['then'](function(_0x357123){var _0x670011=_0x236d54[_0xdca4('0x46')][_0xdca4('0x26')]({'plain':!![]});if(!_0x670011)throw new Error(_0xdca4('0x47'));if(_0x670011[_0xdca4('0x48')]===_0xdca4('0x46')){var _0xc19123=_0x357123['get']({'plain':!![]});var _0x10c180=_0xdca4('0x27');return db[_0xdca4('0x49')][_0xdca4('0x43')]({'where':{'name':_0x10c180,'userProfileId':_0x670011[_0xdca4('0x4a')]},'raw':!![]})[_0xdca4('0x24')](function(_0x27bdfe){if(_0x27bdfe&&_0x27bdfe[_0xdca4('0x4b')]===0x0){return db[_0xdca4('0x28')]['create']({'name':_0xc19123['name'],'resourceId':_0xc19123['id'],'type':_0x27bdfe[_0xdca4('0x2b')],'sectionId':_0x27bdfe['id']},{})[_0xdca4('0x24')](function(){return _0x357123;});}else{return _0x357123;}})['catch'](function(_0x2fa98a){logger[_0xdca4('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2fa98a);throw _0x2fa98a;});}return _0x357123;})[_0xdca4('0x24')](respondWithResult(_0x39ccb3,0xc9))['catch'](handleError(_0x39ccb3,null));};exports[_0xdca4('0x23')]=function(_0x403b46,_0x366b92){if(_0x403b46['body']['id']){delete _0x403b46['body']['id'];}return db[_0xdca4('0x2d')][_0xdca4('0x43')]({'where':{'id':_0x403b46[_0xdca4('0x4c')]['id']}})['then'](handleEntityNotFound(_0x366b92,null))[_0xdca4('0x24')](saveUpdates(_0x403b46[_0xdca4('0x45')],null))[_0xdca4('0x24')](respondWithResult(_0x366b92,null))['catch'](handleError(_0x366b92,null));};exports[_0xdca4('0x25')]=function(_0x1cde80,_0x2e3024){return db['CmCompany'][_0xdca4('0x43')]({'where':{'id':_0x1cde80[_0xdca4('0x4c')]['id']}})[_0xdca4('0x24')](handleEntityNotFound(_0x2e3024,null))[_0xdca4('0x24')](removeEntity(_0x2e3024,null))[_0xdca4('0x40')](handleError(_0x2e3024,null));};exports[_0xdca4('0x2e')]=function(_0x23a310,_0x562fde){return db['CmCompany'][_0xdca4('0x2e')]()[_0xdca4('0x24')](respondWithResult(_0x562fde,null))['catch'](handleError(_0x562fde,null));};exports[_0xdca4('0x4d')]=function(_0x55727c,_0xf3ab89,_0x562e26){return db[_0xdca4('0x4e')][_0xdca4('0x43')]({'where':{'id':_0x55727c['params']['id']}})[_0xdca4('0x24')](handleEntityNotFound(_0xf3ab89,null))[_0xdca4('0x24')](function(_0x594e30){if(_0x594e30){return _0x594e30[_0xdca4('0x4d')](_0x55727c[_0xdca4('0x45')][_0xdca4('0x4f')],_[_0xdca4('0x50')](_0x55727c[_0xdca4('0x45')],[_0xdca4('0x4f'),'id'])||{});}})[_0xdca4('0x24')](respondWithResult(_0xf3ab89,null))[_0xdca4('0x40')](handleError(_0xf3ab89,null));};exports[_0xdca4('0x51')]=function(_0x420721,_0x55eb82,_0x15c2cc){var _0x377ebf={};var _0xb21758={};var _0x297954;var _0x422a5e;return db[_0xdca4('0x2d')][_0xdca4('0x52')]({'where':{'id':_0x420721['params']['id']}})['then'](handleEntityNotFound(_0x55eb82,null))[_0xdca4('0x24')](function(_0x384f69){if(_0x384f69){_0x297954=_0x384f69;_0xb21758[_0xdca4('0x2f')]=_[_0xdca4('0x30')](db[_0xdca4('0x4e')][_0xdca4('0x53')]);_0xb21758['query']=_[_0xdca4('0x30')](_0x420721[_0xdca4('0x33')]);_0xb21758[_0xdca4('0x31')]=_['intersection'](_0xb21758['model'],_0xb21758['query']);_0x377ebf[_0xdca4('0x34')]=_[_0xdca4('0x32')](_0xb21758['model'],qs['fields'](_0x420721[_0xdca4('0x33')][_0xdca4('0x35')]));_0x377ebf[_0xdca4('0x34')]=_0x377ebf[_0xdca4('0x34')][_0xdca4('0x36')]?_0x377ebf[_0xdca4('0x34')]:_0xb21758[_0xdca4('0x2f')];_0x377ebf['order']=qs[_0xdca4('0x39')](_0x420721[_0xdca4('0x33')][_0xdca4('0x39')]);_0x377ebf[_0xdca4('0x3a')]=qs[_0xdca4('0x31')](_[_0xdca4('0x3b')](_0x420721['query'],_0xb21758[_0xdca4('0x31')]));if(_0x420721[_0xdca4('0x33')][_0xdca4('0x3c')]){_0x377ebf[_0xdca4('0x3a')]=_[_0xdca4('0x3d')](_0x377ebf[_0xdca4('0x3a')],{'$or':_[_0xdca4('0x3e')](_0x377ebf['attributes'],function(_0x4b324b){var _0x39a10b={};_0x39a10b[_0x4b324b]={'$like':'%'+_0x420721[_0xdca4('0x33')][_0xdca4('0x3c')]+'%'};return _0x39a10b;})});}_0x377ebf=_[_0xdca4('0x3d')]({},_0x377ebf,_0x420721[_0xdca4('0x54')]);return _0x297954[_0xdca4('0x51')](_0x377ebf);}})[_0xdca4('0x24')](function(_0x5f0647){if(_0x5f0647){_0x422a5e=_0x5f0647['length'];if(!_0x420721[_0xdca4('0x33')][_0xdca4('0x37')](_0xdca4('0x55'))){_0x377ebf[_0xdca4('0x1b')]=qs[_0xdca4('0x1b')](_0x420721['query'][_0xdca4('0x1b')]);_0x377ebf['offset']=qs[_0xdca4('0x1d')](_0x420721[_0xdca4('0x33')]['offset']);}return _0x297954['getContacts'](_0x377ebf);}})['then'](function(_0x303f87){if(_0x303f87){return _0x303f87?{'count':_0x422a5e,'rows':_0x303f87}:null;}})[_0xdca4('0x24')](respondWithResult(_0x55eb82,null))[_0xdca4('0x40')](handleError(_0x55eb82,null));}; \ No newline at end of file +var _0x08a0=['map','include','catch','show','params','rawAttributes','includeAll','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','CmContact','ids','omit','getContacts','findOne','pick','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','get','Companies','UserProfileResource','error','stack','name','send','index','CmCompany','describe','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge'];(function(_0x3116b0,_0x340875){var _0x2e389b=function(_0x4bdf9b){while(--_0x4bdf9b){_0x3116b0['push'](_0x3116b0['shift']());}};_0x2e389b(++_0x340875);}(_0x08a0,0x174));var _0x008a=function(_0xcb19e1,_0x465489){_0xcb19e1=_0xcb19e1-0x0;var _0x121872=_0x08a0[_0xcb19e1];return _0x121872;};'use strict';var emlformat=require(_0x008a('0x0'));var rimraf=require(_0x008a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x008a('0x2'));var moment=require(_0x008a('0x3'));var BPromise=require(_0x008a('0x4'));var Mustache=require(_0x008a('0x5'));var util=require(_0x008a('0x6'));var path=require('path');var sox=require(_0x008a('0x7'));var csv=require(_0x008a('0x8'));var ejs=require(_0x008a('0x9'));var fs=require('fs');var fs_extra=require(_0x008a('0xa'));var _=require(_0x008a('0xb'));var squel=require(_0x008a('0xc'));var crypto=require(_0x008a('0xd'));var jsforce=require(_0x008a('0xe'));var deskjs=require(_0x008a('0xf'));var toCsv=require(_0x008a('0x8'));var querystring=require('querystring');var Papa=require(_0x008a('0x10'));var Redis=require(_0x008a('0x11'));var authService=require(_0x008a('0x12'));var qs=require(_0x008a('0x13'));var as=require(_0x008a('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x008a('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x008a('0x16'));var db=require(_0x008a('0x17'))['db'];function respondWithStatusCode(_0x523c1a,_0x12dd44){_0x12dd44=_0x12dd44||0xcc;return function(_0x375d9b){if(_0x375d9b){return _0x523c1a[_0x008a('0x18')](_0x12dd44);}return _0x523c1a[_0x008a('0x19')](_0x12dd44)[_0x008a('0x1a')]();};}function respondWithResult(_0x40d286,_0x446087){_0x446087=_0x446087||0xc8;return function(_0x38ab6b){if(_0x38ab6b){return _0x40d286[_0x008a('0x19')](_0x446087)[_0x008a('0x1b')](_0x38ab6b);}};}function respondWithFilteredResult(_0x40e2ac,_0x18ac69){return function(_0x2edd50){if(_0x2edd50){var _0x1abc9f=typeof _0x18ac69[_0x008a('0x1c')]===_0x008a('0x1d')&&typeof _0x18ac69[_0x008a('0x1e')]===_0x008a('0x1d');var _0x2b6b74=_0x2edd50[_0x008a('0x1f')];var _0xf626bb=_0x1abc9f?0x0:_0x18ac69[_0x008a('0x1c')];var _0x25ad1a=_0x1abc9f?_0x2edd50[_0x008a('0x1f')]:_0x18ac69['offset']+_0x18ac69[_0x008a('0x1e')];var _0x1be4ef;if(_0x25ad1a>=_0x2b6b74){_0x25ad1a=_0x2b6b74;_0x1be4ef=0xc8;}else{_0x1be4ef=0xce;}_0x40e2ac[_0x008a('0x19')](_0x1be4ef);return _0x40e2ac['set']('Content-Range',_0xf626bb+'-'+_0x25ad1a+'/'+_0x2b6b74)[_0x008a('0x1b')](_0x2edd50);}return null;};}function patchUpdates(_0x19e7af){return function(_0x40f1b4){try{jsonpatch[_0x008a('0x20')](_0x40f1b4,_0x19e7af,!![]);}catch(_0x2126b2){return BPromise[_0x008a('0x21')](_0x2126b2);}return _0x40f1b4[_0x008a('0x22')]();};}function saveUpdates(_0x1d64a0,_0x46ad7b){return function(_0x121e02){if(_0x121e02){return _0x121e02[_0x008a('0x23')](_0x1d64a0)[_0x008a('0x24')](function(_0x4c7452){return _0x4c7452;});}return null;};}function removeEntity(_0x4750ce,_0x1631cc){return function(_0x57ae6a){if(_0x57ae6a){return _0x57ae6a[_0x008a('0x25')]()['then'](function(){var _0x476933=_0x57ae6a[_0x008a('0x26')]({'plain':!![]});var _0x12e5e8=_0x008a('0x27');return db[_0x008a('0x28')][_0x008a('0x25')]({'where':{'type':_0x12e5e8,'resourceId':_0x476933['id']}})[_0x008a('0x24')](function(){return _0x57ae6a;});})['then'](function(){_0x4750ce[_0x008a('0x19')](0xcc)[_0x008a('0x1a')]();});}};}function handleEntityNotFound(_0x20d0c4,_0x1f526b){return function(_0x21a617){if(!_0x21a617){_0x20d0c4[_0x008a('0x18')](0x194);}return _0x21a617;};}function handleError(_0x26b4a8,_0x2fe9c6){_0x2fe9c6=_0x2fe9c6||0x1f4;return function(_0xbf3f55){logger[_0x008a('0x29')](_0xbf3f55[_0x008a('0x2a')]);if(_0xbf3f55[_0x008a('0x2b')]){delete _0xbf3f55[_0x008a('0x2b')];}_0x26b4a8['status'](_0x2fe9c6)[_0x008a('0x2c')](_0xbf3f55);};}exports[_0x008a('0x2d')]=function(_0x4df584,_0x1b1dac){var _0x48432d={},_0x458e8e={},_0x5c3c36={'count':0x0,'rows':[]};return db[_0x008a('0x2e')][_0x008a('0x2f')]()[_0x008a('0x24')](function(_0x860f60){_0x458e8e[_0x008a('0x30')]=_[_0x008a('0x31')](_0x860f60);_0x458e8e[_0x008a('0x32')]=_[_0x008a('0x31')](_0x4df584['query']);_0x458e8e[_0x008a('0x33')]=_[_0x008a('0x34')](_0x458e8e[_0x008a('0x30')],_0x458e8e[_0x008a('0x32')]);_0x48432d[_0x008a('0x35')]=_['intersection'](_0x458e8e[_0x008a('0x30')],qs[_0x008a('0x36')](_0x4df584[_0x008a('0x32')][_0x008a('0x36')]));_0x48432d[_0x008a('0x35')]=_0x48432d['attributes'][_0x008a('0x37')]?_0x48432d[_0x008a('0x35')]:_0x458e8e[_0x008a('0x30')];if(!_0x4df584['query'][_0x008a('0x38')](_0x008a('0x39'))){_0x48432d[_0x008a('0x1e')]=qs[_0x008a('0x1e')](_0x4df584[_0x008a('0x32')][_0x008a('0x1e')]);_0x48432d[_0x008a('0x1c')]=qs[_0x008a('0x1c')](_0x4df584['query'][_0x008a('0x1c')]);}_0x48432d[_0x008a('0x3a')]=qs['sort'](_0x4df584[_0x008a('0x32')][_0x008a('0x3b')]);_0x48432d[_0x008a('0x3c')]=qs[_0x008a('0x33')](_['pick'](_0x4df584[_0x008a('0x32')],_0x458e8e['filters']),_0x860f60);if(_0x4df584['query'][_0x008a('0x3d')]){_0x48432d[_0x008a('0x3c')]=_[_0x008a('0x3e')](_0x48432d[_0x008a('0x3c')],{'$or':_[_0x008a('0x3f')](_0x48432d[_0x008a('0x35')],function(_0x191548){var _0x2ea10b={};_0x2ea10b[_0x191548]={'$like':'%'+_0x4df584[_0x008a('0x32')][_0x008a('0x3d')]+'%'};return _0x2ea10b;})});}_0x48432d=_[_0x008a('0x3e')]({},_0x48432d,_0x4df584['options']);var _0xb33e2c={'where':_0x48432d[_0x008a('0x3c')]};return db[_0x008a('0x2e')][_0x008a('0x1f')](_0xb33e2c)[_0x008a('0x24')](function(_0x3376bc){_0x5c3c36[_0x008a('0x1f')]=_0x3376bc;if(_0x4df584['query']['includeAll']){_0x48432d[_0x008a('0x40')]=[{'all':!![]}];}return db[_0x008a('0x2e')]['findAll'](_0x48432d);})[_0x008a('0x24')](function(_0x594757){_0x5c3c36['rows']=_0x594757;return _0x5c3c36;})[_0x008a('0x24')](respondWithFilteredResult(_0x1b1dac,_0x48432d))[_0x008a('0x41')](handleError(_0x1b1dac,null));})[_0x008a('0x41')](handleError(_0x1b1dac,null));};exports[_0x008a('0x42')]=function(_0x3d1ad8,_0x8dcfd7){var _0x30c459={'raw':![],'where':{'id':_0x3d1ad8[_0x008a('0x43')]['id']}},_0x242d47={};_0x242d47[_0x008a('0x30')]=_['keys'](db['CmCompany'][_0x008a('0x44')]);_0x242d47[_0x008a('0x32')]=_[_0x008a('0x31')](_0x3d1ad8[_0x008a('0x32')]);_0x242d47[_0x008a('0x33')]=_[_0x008a('0x34')](_0x242d47[_0x008a('0x30')],_0x242d47[_0x008a('0x32')]);_0x30c459[_0x008a('0x35')]=_[_0x008a('0x34')](_0x242d47[_0x008a('0x30')],qs[_0x008a('0x36')](_0x3d1ad8[_0x008a('0x32')][_0x008a('0x36')]));_0x30c459[_0x008a('0x35')]=_0x30c459[_0x008a('0x35')][_0x008a('0x37')]?_0x30c459[_0x008a('0x35')]:_0x242d47[_0x008a('0x30')];if(_0x3d1ad8['query'][_0x008a('0x45')]){_0x30c459[_0x008a('0x40')]=[{'all':!![]}];}_0x30c459=_['merge']({},_0x30c459,_0x3d1ad8[_0x008a('0x46')]);return db[_0x008a('0x2e')][_0x008a('0x47')](_0x30c459)[_0x008a('0x24')](handleEntityNotFound(_0x8dcfd7,null))[_0x008a('0x24')](respondWithResult(_0x8dcfd7,null))[_0x008a('0x41')](handleError(_0x8dcfd7,null));};exports['create']=function(_0x45e6e1,_0x3855af){return db['CmCompany'][_0x008a('0x48')](_0x45e6e1[_0x008a('0x49')],{})[_0x008a('0x24')](function(_0x490363){var _0x1e215c=_0x45e6e1[_0x008a('0x4a')][_0x008a('0x26')]({'plain':!![]});if(!_0x1e215c)throw new Error(_0x008a('0x4b'));if(_0x1e215c[_0x008a('0x4c')]===_0x008a('0x4a')){var _0x8e6a0e=_0x490363[_0x008a('0x26')]({'plain':!![]});var _0x2dd3aa=_0x008a('0x27');return db[_0x008a('0x4d')][_0x008a('0x47')]({'where':{'name':_0x2dd3aa,'userProfileId':_0x1e215c[_0x008a('0x4e')]},'raw':!![]})[_0x008a('0x24')](function(_0x3a631c){if(_0x3a631c&&_0x3a631c['autoAssociation']===0x0){return db[_0x008a('0x28')]['create']({'name':_0x8e6a0e[_0x008a('0x2b')],'resourceId':_0x8e6a0e['id'],'type':_0x3a631c[_0x008a('0x2b')],'sectionId':_0x3a631c['id']},{})[_0x008a('0x24')](function(){return _0x490363;});}else{return _0x490363;}})[_0x008a('0x41')](function(_0x38a042){logger[_0x008a('0x29')](_0x008a('0x4f'),_0x38a042);throw _0x38a042;});}return _0x490363;})['then'](respondWithResult(_0x3855af,0xc9))['catch'](handleError(_0x3855af,null));};exports['update']=function(_0x5024cd,_0x7ce75a){if(_0x5024cd['body']['id']){delete _0x5024cd[_0x008a('0x49')]['id'];}return db['CmCompany'][_0x008a('0x47')]({'where':{'id':_0x5024cd['params']['id']}})[_0x008a('0x24')](handleEntityNotFound(_0x7ce75a,null))[_0x008a('0x24')](saveUpdates(_0x5024cd[_0x008a('0x49')],null))[_0x008a('0x24')](respondWithResult(_0x7ce75a,null))[_0x008a('0x41')](handleError(_0x7ce75a,null));};exports[_0x008a('0x25')]=function(_0x21d58e,_0x53592b){return db[_0x008a('0x2e')][_0x008a('0x47')]({'where':{'id':_0x21d58e[_0x008a('0x43')]['id']}})[_0x008a('0x24')](handleEntityNotFound(_0x53592b,null))[_0x008a('0x24')](removeEntity(_0x53592b,null))['catch'](handleError(_0x53592b,null));};exports[_0x008a('0x2f')]=function(_0x60e7b4,_0x1a5f42){return db[_0x008a('0x2e')][_0x008a('0x2f')]()['then'](respondWithResult(_0x1a5f42,null))[_0x008a('0x41')](handleError(_0x1a5f42,null));};exports[_0x008a('0x50')]=function(_0x1b4049,_0x4c18aa,_0x3007ad){return db[_0x008a('0x51')][_0x008a('0x47')]({'where':{'id':_0x1b4049[_0x008a('0x43')]['id']}})[_0x008a('0x24')](handleEntityNotFound(_0x4c18aa,null))[_0x008a('0x24')](function(_0x16d479){if(_0x16d479){return _0x16d479[_0x008a('0x50')](_0x1b4049[_0x008a('0x49')][_0x008a('0x52')],_[_0x008a('0x53')](_0x1b4049[_0x008a('0x49')],[_0x008a('0x52'),'id'])||{});}})[_0x008a('0x24')](respondWithResult(_0x4c18aa,null))['catch'](handleError(_0x4c18aa,null));};exports[_0x008a('0x54')]=function(_0x3bac3a,_0x232f14,_0x48f2f5){var _0x37756b={};var _0x3a687e={};var _0x5d5bd3;var _0x566adb;return db['CmCompany'][_0x008a('0x55')]({'where':{'id':_0x3bac3a[_0x008a('0x43')]['id']}})['then'](handleEntityNotFound(_0x232f14,null))[_0x008a('0x24')](function(_0x32ab62){if(_0x32ab62){_0x5d5bd3=_0x32ab62;_0x3a687e[_0x008a('0x30')]=_[_0x008a('0x31')](db[_0x008a('0x51')][_0x008a('0x44')]);_0x3a687e['query']=_[_0x008a('0x31')](_0x3bac3a[_0x008a('0x32')]);_0x3a687e[_0x008a('0x33')]=_[_0x008a('0x34')](_0x3a687e[_0x008a('0x30')],_0x3a687e[_0x008a('0x32')]);_0x37756b[_0x008a('0x35')]=_[_0x008a('0x34')](_0x3a687e['model'],qs[_0x008a('0x36')](_0x3bac3a[_0x008a('0x32')][_0x008a('0x36')]));_0x37756b['attributes']=_0x37756b[_0x008a('0x35')]['length']?_0x37756b[_0x008a('0x35')]:_0x3a687e['model'];_0x37756b[_0x008a('0x3a')]=qs[_0x008a('0x3b')](_0x3bac3a[_0x008a('0x32')]['sort']);_0x37756b[_0x008a('0x3c')]=qs[_0x008a('0x33')](_[_0x008a('0x56')](_0x3bac3a['query'],_0x3a687e[_0x008a('0x33')]));if(_0x3bac3a[_0x008a('0x32')][_0x008a('0x3d')]){_0x37756b[_0x008a('0x3c')]=_[_0x008a('0x3e')](_0x37756b[_0x008a('0x3c')],{'$or':_[_0x008a('0x3f')](_0x37756b[_0x008a('0x35')],function(_0xaf983e){var _0x260542={};_0x260542[_0xaf983e]={'$like':'%'+_0x3bac3a[_0x008a('0x32')][_0x008a('0x3d')]+'%'};return _0x260542;})});}_0x37756b=_['merge']({},_0x37756b,_0x3bac3a[_0x008a('0x46')]);return _0x5d5bd3[_0x008a('0x54')](_0x37756b);}})[_0x008a('0x24')](function(_0xdb5667){if(_0xdb5667){_0x566adb=_0xdb5667[_0x008a('0x37')];if(!_0x3bac3a['query'][_0x008a('0x38')](_0x008a('0x39'))){_0x37756b['limit']=qs['limit'](_0x3bac3a['query'][_0x008a('0x1e')]);_0x37756b[_0x008a('0x1c')]=qs[_0x008a('0x1c')](_0x3bac3a[_0x008a('0x32')][_0x008a('0x1c')]);}return _0x5d5bd3[_0x008a('0x54')](_0x37756b);}})['then'](function(_0x12c1a8){if(_0x12c1a8){return _0x12c1a8?{'count':_0x566adb,'rows':_0x12c1a8}:null;}})['then'](respondWithResult(_0x232f14,null))[_0x008a('0x41')](handleError(_0x232f14,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 18bdf72..47eded1 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 _0xa45e=['exports','CmCompany','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./cmCompany.attributes'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa45e,0x7a));var _0xea45=function(_0x494e3d,_0x11bc4f){_0x494e3d=_0x494e3d-0x0;var _0x3e3743=_0xa45e[_0x494e3d];return _0x3e3743;};'use strict';var _=require(_0xea45('0x0'));var util=require(_0xea45('0x1'));var logger=require(_0xea45('0x2'))(_0xea45('0x3'));var moment=require(_0xea45('0x4'));var BPromise=require(_0xea45('0x5'));var rp=require(_0xea45('0x6'));var fs=require('fs');var path=require(_0xea45('0x7'));var rimraf=require(_0xea45('0x8'));var config=require('../../config/environment');var attributes=require(_0xea45('0x9'));module[_0xea45('0xa')]=function(_0x2b8bac,_0x2a323c){return _0x2b8bac['define'](_0xea45('0xb'),attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6c1c=['cm_companies','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./cmCompany.attributes','exports','define'];(function(_0x130271,_0x4657a8){var _0x128bfb=function(_0x2c3608){while(--_0x2c3608){_0x130271['push'](_0x130271['shift']());}};_0x128bfb(++_0x4657a8);}(_0x6c1c,0x145));var _0xc6c1=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x6c1c[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0xc6c1('0x0'));var util=require(_0xc6c1('0x1'));var logger=require(_0xc6c1('0x2'))('api');var moment=require(_0xc6c1('0x3'));var BPromise=require(_0xc6c1('0x4'));var rp=require(_0xc6c1('0x5'));var fs=require('fs');var path=require(_0xc6c1('0x6'));var rimraf=require('rimraf');var config=require(_0xc6c1('0x7'));var attributes=require(_0xc6c1('0x8'));module[_0xc6c1('0x9')]=function(_0x269a59,_0x24ff7e){return _0x269a59[_0xc6c1('0xa')]('CmCompany',attributes,{'tableName':_0xc6c1('0xb'),'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 73d3926..cda51d9 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 _0x9008=['code','message','result','catch','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0xd0cd0b,_0x490956){var _0x59cced=function(_0x567251){while(--_0x567251){_0xd0cd0b['push'](_0xd0cd0b['shift']());}};_0x59cced(++_0x490956);}(_0x9008,0x72));var _0x8900=function(_0x529cbb,_0xc51b82){_0x529cbb=_0x529cbb-0x0;var _0x54fa27=_0x9008[_0x529cbb];return _0x54fa27;};'use strict';var _=require('lodash');var util=require(_0x8900('0x0'));var moment=require('moment');var BPromise=require(_0x8900('0x1'));var rs=require(_0x8900('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8900('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x8900('0x4'))(_0x8900('0x5'));var config=require(_0x8900('0x6'));var jayson=require(_0x8900('0x7'));var client=jayson[_0x8900('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1ec228,_0x15366e,_0x4d7e78){return new BPromise(function(_0x5cb837,_0x6b4984){return client[_0x8900('0x9')](_0x1ec228,_0x4d7e78)[_0x8900('0xa')](function(_0x2d5744){logger[_0x8900('0xb')](_0x8900('0xc'),_0x15366e,_0x8900('0xd'));logger[_0x8900('0xe')](_0x8900('0xf'),_0x15366e,_0x8900('0xd'),JSON[_0x8900('0x10')](_0x2d5744));if(_0x2d5744[_0x8900('0x11')]){if(_0x2d5744['error'][_0x8900('0x12')]===0x1f4){logger[_0x8900('0x11')](_0x8900('0xc'),_0x15366e,_0x2d5744[_0x8900('0x11')][_0x8900('0x13')]);return _0x6b4984(_0x2d5744[_0x8900('0x11')]['message']);}logger['error'](_0x8900('0xc'),_0x15366e,_0x2d5744['error']['message']);return _0x5cb837(_0x2d5744[_0x8900('0x11')][_0x8900('0x13')]);}else{logger['info'](_0x8900('0xc'),_0x15366e,'request\x20sent');_0x5cb837(_0x2d5744[_0x8900('0x14')]['message']);}})[_0x8900('0x15')](function(_0x2d3c4d){logger[_0x8900('0x11')](_0x8900('0xc'),_0x15366e,_0x2d3c4d);_0x6b4984(_0x2d3c4d);});});} \ No newline at end of file +var _0x5c96=['jayson/promise','request','then','info','request\x20sent','error','CmCompany,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x2d6f1b,_0x7a30ee){var _0x1ea829=function(_0x329b71){while(--_0x329b71){_0x2d6f1b['push'](_0x2d6f1b['shift']());}};_0x1ea829(++_0x7a30ee);}(_0x5c96,0x68));var _0x65c9=function(_0xa37b61,_0x3290d9){_0xa37b61=_0xa37b61-0x0;var _0x52692e=_0x5c96[_0xa37b61];return _0x52692e;};'use strict';var _=require(_0x65c9('0x0'));var util=require(_0x65c9('0x1'));var moment=require(_0x65c9('0x2'));var BPromise=require(_0x65c9('0x3'));var rs=require(_0x65c9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x65c9('0x5'))['db'];var utils=require(_0x65c9('0x6'));var logger=require(_0x65c9('0x7'))(_0x65c9('0x8'));var config=require(_0x65c9('0x9'));var jayson=require(_0x65c9('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3244ec,_0x3cf7f5,_0x40c252){return new BPromise(function(_0x384c6b,_0x1767a9){return client[_0x65c9('0xb')](_0x3244ec,_0x40c252)[_0x65c9('0xc')](function(_0x2cc2bc){logger[_0x65c9('0xd')]('CmCompany,\x20%s,\x20%s',_0x3cf7f5,_0x65c9('0xe'));logger['debug']('CmCompany,\x20%s,\x20%s,\x20%s',_0x3cf7f5,_0x65c9('0xe'),JSON['stringify'](_0x2cc2bc));if(_0x2cc2bc[_0x65c9('0xf')]){if(_0x2cc2bc[_0x65c9('0xf')]['code']===0x1f4){logger[_0x65c9('0xf')](_0x65c9('0x10'),_0x3cf7f5,_0x2cc2bc[_0x65c9('0xf')][_0x65c9('0x11')]);return _0x1767a9(_0x2cc2bc[_0x65c9('0xf')][_0x65c9('0x11')]);}logger[_0x65c9('0xf')](_0x65c9('0x10'),_0x3cf7f5,_0x2cc2bc[_0x65c9('0xf')][_0x65c9('0x11')]);return _0x384c6b(_0x2cc2bc[_0x65c9('0xf')][_0x65c9('0x11')]);}else{logger[_0x65c9('0xd')](_0x65c9('0x10'),_0x3cf7f5,_0x65c9('0xe'));_0x384c6b(_0x2cc2bc['result'][_0x65c9('0x11')]);}})[_0x65c9('0x12')](function(_0x545a41){logger['error'](_0x65c9('0x10'),_0x3cf7f5,_0x545a41);_0x1767a9(_0x545a41);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index f85b860..b0d2534 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 _0xf30e=['../../config/environment','./cmCompany.controller','get','isAuthenticated','show','/:id/contacts','create','post','addContacts','put','/:id','delete','exports','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2c8b78,_0x11d4ac){var _0x5db4af=function(_0x4ea5ea){while(--_0x4ea5ea){_0x2c8b78['push'](_0x2c8b78['shift']());}};_0x5db4af(++_0x11d4ac);}(_0xf30e,0x7f));var _0xef30=function(_0x128bef,_0xc7a0af){_0x128bef=_0x128bef-0x0;var _0x1ba862=_0xf30e[_0x128bef];return _0x1ba862;};'use strict';var multer=require(_0xef30('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xef30('0x1'));var express=require(_0xef30('0x2'));var router=express['Router']();var fs_extra=require(_0xef30('0x3'));var auth=require(_0xef30('0x4'));var interaction=require(_0xef30('0x5'));var config=require(_0xef30('0x6'));var controller=require(_0xef30('0x7'));router[_0xef30('0x8')]('/',auth[_0xef30('0x9')](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xef30('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xef30('0xa')]);router['get'](_0xef30('0xb'),auth[_0xef30('0x9')](),controller['getContacts']);router['post']('/',auth[_0xef30('0x9')](),controller[_0xef30('0xc')]);router[_0xef30('0xd')](_0xef30('0xb'),auth[_0xef30('0x9')](),controller[_0xef30('0xe')]);router[_0xef30('0xf')](_0xef30('0x10'),auth[_0xef30('0x9')](),controller['update']);router[_0xef30('0x11')](_0xef30('0x10'),auth[_0xef30('0x9')](),controller['destroy']);module[_0xef30('0x12')]=router; \ No newline at end of file +var _0xce0d=['delete','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','show','getContacts','post','create','/:id/contacts','addContacts','put'];(function(_0x1ff58e,_0x5f0149){var _0x25de2f=function(_0x18bf68){while(--_0x18bf68){_0x1ff58e['push'](_0x1ff58e['shift']());}};_0x25de2f(++_0x5f0149);}(_0xce0d,0x1e6));var _0xdce0=function(_0x53417c,_0x126dee){_0x53417c=_0x53417c-0x0;var _0x49407d=_0xce0d[_0x53417c];return _0x49407d;};'use strict';var multer=require(_0xdce0('0x0'));var util=require(_0xdce0('0x1'));var path=require(_0xdce0('0x2'));var timeout=require('connect-timeout');var express=require(_0xdce0('0x3'));var router=express[_0xdce0('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xdce0('0x5'));var config=require(_0xdce0('0x6'));var controller=require('./cmCompany.controller');router['get']('/',auth[_0xdce0('0x7')](),controller[_0xdce0('0x8')]);router[_0xdce0('0x9')](_0xdce0('0xa'),auth['isAuthenticated'](),controller[_0xdce0('0xb')]);router['get'](_0xdce0('0xc'),auth['isAuthenticated'](),controller[_0xdce0('0xd')]);router[_0xdce0('0x9')]('/:id/contacts',auth[_0xdce0('0x7')](),controller[_0xdce0('0xe')]);router[_0xdce0('0xf')]('/',auth[_0xdce0('0x7')](),controller[_0xdce0('0x10')]);router['post'](_0xdce0('0x11'),auth[_0xdce0('0x7')](),controller[_0xdce0('0x12')]);router[_0xdce0('0x13')](_0xdce0('0xc'),auth[_0xdce0('0x7')](),controller['update']);router[_0xdce0('0x14')]('/:id',auth[_0xdce0('0x7')](),controller[_0xdce0('0x15')]);module[_0xdce0('0x16')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index a8584bb..79d67f6 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 _0xd495=['STRING','TEXT','INTEGER','DATE','NOW','sequelize','exports'];(function(_0x8cc46c,_0x1eda26){var _0x18b59f=function(_0x40a880){while(--_0x40a880){_0x8cc46c['push'](_0x8cc46c['shift']());}};_0x18b59f(++_0x1eda26);}(_0xd495,0x6e));var _0x5d49=function(_0x546aaf,_0x1ed138){_0x546aaf=_0x546aaf-0x0;var _0x1cbf6d=_0xd495[_0x546aaf];return _0x1cbf6d;};'use strict';var _=require('lodash');var Sequelize=require(_0x5d49('0x0'));module[_0x5d49('0x1')]={'firstName':{'type':Sequelize[_0x5d49('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x5d49('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x5d49('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x5d49('0x2')]},'dateOfBirth':{'type':Sequelize[_0x5d49('0x2')]},'description':{'type':Sequelize[_0x5d49('0x3')]},'phone':{'type':Sequelize[_0x5d49('0x2')]},'mobile':{'type':Sequelize[_0x5d49('0x2')]},'fax':{'type':Sequelize[_0x5d49('0x2')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0x5d49('0x2')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0x5d49('0x2')]},'twitter':{'type':Sequelize[_0x5d49('0x2')]},'skype':{'type':Sequelize[_0x5d49('0x2')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0x5d49('0x2')]},'wechat':{'type':Sequelize[_0x5d49('0x2')]},'telegram':{'type':Sequelize[_0x5d49('0x2')]},'UserId':{'type':Sequelize[_0x5d49('0x4')]},'AdditionalPhones':{'type':Sequelize[_0x5d49('0x2')]},'priority':{'type':Sequelize[_0x5d49('0x4')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x5d49('0x5')],'defaultValue':Sequelize[_0x5d49('0x6')]},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize[_0x5d49('0x4')]}}; \ No newline at end of file +var _0x5e4c=['STRING','TEXT','INTEGER','UNSIGNED','DATE','NOW','lodash','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5e4c,0x189));var _0xc5e4=function(_0xe6fea6,_0x5f2eb4){_0xe6fea6=_0xe6fea6-0x0;var _0x2ed252=_0x5e4c[_0xe6fea6];return _0x2ed252;};'use strict';var _=require(_0xc5e4('0x0'));var Sequelize=require(_0xc5e4('0x1'));module[_0xc5e4('0x2')]={'firstName':{'type':Sequelize[_0xc5e4('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0xc5e4('0x3')]},'street':{'type':Sequelize[_0xc5e4('0x3')]},'postalCode':{'type':Sequelize[_0xc5e4('0x3')]},'city':{'type':Sequelize[_0xc5e4('0x3')]},'country':{'type':Sequelize[_0xc5e4('0x3')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xc5e4('0x4')]},'phone':{'type':Sequelize[_0xc5e4('0x3')]},'mobile':{'type':Sequelize[_0xc5e4('0x3')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xc5e4('0x3')]},'url':{'type':Sequelize[_0xc5e4('0x3')]},'facebook':{'type':Sequelize[_0xc5e4('0x3')]},'fb_data':{'type':Sequelize[_0xc5e4('0x3')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0xc5e4('0x3')]},'teams':{'type':Sequelize[_0xc5e4('0x3')]},'viber':{'type':Sequelize[_0xc5e4('0x3')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0xc5e4('0x3')]},'telegram':{'type':Sequelize[_0xc5e4('0x3')]},'UserId':{'type':Sequelize['INTEGER']},'AdditionalPhones':{'type':Sequelize[_0xc5e4('0x3')]},'priority':{'type':Sequelize[_0xc5e4('0x5')](0x2)[_0xc5e4('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xc5e4('0x7')],'defaultValue':Sequelize[_0xc5e4('0x8')]},'dialTimezone':{'type':Sequelize[_0xc5e4('0x3')]},'utcOffset':{'type':Sequelize[_0xc5e4('0x5')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index e13f190..8a7926f 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 _0x4c88=['CmCustomField','columnName','alias','custom','type','hasOwnProperty','merge','body','from','get','isArray','tags','join','info','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','create','ChatInteraction','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsMessage','FaxInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','isNil','utcOffset','timezones','additionalPhones','bulkCreate','each','duplicates','$or','push','where','ListId','spread','all','show','Tags','color','tag','Phones','ItemType','sequelize','literal','$and','omit','map','format','dialTimezone','pickBy','cf_%d','isEmpty','cm_contacts','id\x20=\x20?','toParam','phone','getTags','findOne','Tag','rawAttributes','filters','attributes','intersection','fields','model','order','sort','pick','filter','options','nolimit','setTags','ids','setAdditionalPhones','item_types','ItemTypeId','items','description','OrderBy','PHONE','item','ContactItemType','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','CmHopperAdditionalPhone','getAdditionalPhones','duplicateAdditionalPhones','CmContactId','toContactId','rescheduleAdditionalPhones','hopperId','ContactId','includeAll','include','rows','getHopperFinals','getJscriptySessions','uploadCsv','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','filename','chmodSync','child_process','fork','../../components/import/cm/csv','CompanyId','File\x20uploaded\x20correctly!','pid','file','meta','import','User','agent','No\x20ListId\x20specified','binding','stringify','message','exit','importUpdates','../../components/import/cm/csvUpdates','start\x20child\x20process\x20correctly!','error\x20child\x20process','getJourney','mail','chat','sms','openchannel','whatsapp','resolve','toLowerCase','Invalid\x20channel','range','parse','isValid','voice','uniqueid','callerid','starttime','duration','note','userDisposition','userSecondDisposition','UserId','fullname','createdAt','DESC','startCase','Website','Account','closed','closedAt','disposition','secondDisposition','key','Owner','browserName','customerIp','customerPort','deviceModel','osName','ratingMessage','ratingValue','referer','subject','substatus','externalUrl','threadId','findAndCountAll','flatten','reverse','value','moment','util','path','lodash','ioredis','../../components/parsers/qs','../../config/environment','../../config/environment/shared','defaults','redis','./cmContact.socket','register','status','json','offset','undefined','limit','count','Content-Range','update','then','destroy','end','error','stack','name','send','index','describe','getOptions','findAll','query','user','catch','CmContact','find','params','keys','length','startsWith','cf_','displayName','analytics'];(function(_0x58fe25,_0x3dc4c5){var _0x17a100=function(_0x52c7dd){while(--_0x52c7dd){_0x58fe25['push'](_0x58fe25['shift']());}};_0x17a100(++_0x3dc4c5);}(_0x4c88,0x1b3));var _0x84c8=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x4c88[_0x21a9d9];return _0x46adce;};'use strict';var moment=require(_0x84c8('0x0'));var BPromise=require('bluebird');var util=require(_0x84c8('0x1'));var path=require(_0x84c8('0x2'));var fs=require('fs');var _=require(_0x84c8('0x3'));var squel=require('squel');var Papa=require('papaparse');var Redis=require(_0x84c8('0x4'));var contacts=require('../../components/contacts');var qs=require(_0x84c8('0x5'));var logger=require('../../config/logger')('api');var config=require(_0x84c8('0x6'));var shared=require(_0x84c8('0x7'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x84c8('0x8')](config[_0x84c8('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x84c8('0xa'))[_0x84c8('0xb')](socket);function respondWithResult(_0xb08d33,_0x18d2dc){_0x18d2dc=_0x18d2dc||0xc8;return function(_0x4b349a){if(_0x4b349a){return _0xb08d33[_0x84c8('0xc')](_0x18d2dc)[_0x84c8('0xd')](_0x4b349a);}};}function respondWithFilteredResult(_0x41ceee,_0x41c040){return function(_0x50b58e){if(_0x50b58e){var _0x36e968=typeof _0x41c040[_0x84c8('0xe')]===_0x84c8('0xf')&&typeof _0x41c040[_0x84c8('0x10')]===_0x84c8('0xf');var _0x5517a7=_0x50b58e[_0x84c8('0x11')];var _0x25ecb2=_0x36e968?0x0:_0x41c040[_0x84c8('0xe')];var _0x3fbd4e=_0x36e968?_0x50b58e['count']:_0x41c040[_0x84c8('0xe')]+_0x41c040[_0x84c8('0x10')];var _0x48db7a;if(_0x3fbd4e>=_0x5517a7){_0x3fbd4e=_0x5517a7;_0x48db7a=0xc8;}else{_0x48db7a=0xce;}_0x41ceee[_0x84c8('0xc')](_0x48db7a);return _0x41ceee['set'](_0x84c8('0x12'),_0x25ecb2+'-'+_0x3fbd4e+'/'+_0x5517a7)[_0x84c8('0xd')](_0x50b58e);}return null;};}function saveUpdates(_0x20d1a1){return function(_0x2bfa73){if(_0x2bfa73){return _0x2bfa73[_0x84c8('0x13')](_0x20d1a1)[_0x84c8('0x14')](function(_0x3c13af){return _0x3c13af;});}return null;};}function removeEntity(_0x42f3da){return function(_0x3874c8){if(_0x3874c8){return _0x3874c8[_0x84c8('0x15')]()[_0x84c8('0x14')](function(){_0x42f3da[_0x84c8('0xc')](0xcc)[_0x84c8('0x16')]();});}};}function handleEntityNotFound(_0x38b3df){return function(_0x5eee03){if(!_0x5eee03){_0x38b3df['sendStatus'](0x194);}return _0x5eee03;};}function handleError(_0x584030,_0x1fdb75){_0x1fdb75=_0x1fdb75||0x1f4;return function(_0x128805){logger[_0x84c8('0x17')](_0x128805[_0x84c8('0x18')]);if(_0x128805[_0x84c8('0x19')]){delete _0x128805['name'];}_0x584030[_0x84c8('0xc')](_0x1fdb75)[_0x84c8('0x1a')](_0x128805);};}exports[_0x84c8('0x1b')]=function(_0x25e4f7,_0x10c7d2){var _0x356e46={};return contacts[_0x84c8('0x1c')]()[_0x84c8('0x14')](function(_0x12d4a5){_0x356e46=qs[_0x84c8('0x1d')](_0x12d4a5,_0x25e4f7);return contacts[_0x84c8('0x1e')](_0x25e4f7[_0x84c8('0x1f')],_0x25e4f7[_0x84c8('0x20')],_0x356e46,_0x12d4a5);})[_0x84c8('0x14')](respondWithFilteredResult(_0x10c7d2,_0x356e46))[_0x84c8('0x21')](handleError(_0x10c7d2,null));};exports['destroy']=function(_0x498640,_0x3c6ca0){return db[_0x84c8('0x22')][_0x84c8('0x23')]({'where':{'id':_0x498640[_0x84c8('0x24')]['id']}})[_0x84c8('0x14')](handleEntityNotFound(_0x3c6ca0,null))['then'](removeEntity(_0x3c6ca0,null))[_0x84c8('0x21')](handleError(_0x3c6ca0,null));};exports['describe']=function(_0x539ca1,_0x40ab93){return db[_0x84c8('0x22')][_0x84c8('0x1c')]()[_0x84c8('0x14')](function(_0x4cd2ae){delete _0x4cd2ae['tags'];for(var _0x14eb81=0x0;_0x14eb810x0){return new Promise(function(_0x5bdd91){var _0x460985=[];for(var _0x2e0ee2=0x0;_0x2e0ee2<_0x251a93['length'];_0x2e0ee2++){_0x460985['push'](insertAdditionalPhones(_0x251a93[_0x2e0ee2]['contact'],_0x251a93[_0x2e0ee2][_0x84c8('0x52')]));}Promise[_0x84c8('0x5b')](_0x460985)[_0x84c8('0x14')](function(){_0x5bdd91(0x1);});})[_0x84c8('0x14')](function(){return{'success':_0x5e28dd,'failure':_0x4ff1e0,'duplicates':_0x366502};});}else{return{'success':_0x5e28dd,'failure':_0x4ff1e0,'duplicates':_0x366502};}}})[_0x84c8('0x14')](respondWithResult(_0x1103cd,0xc9))[_0x84c8('0x21')](handleError(_0x1103cd,null));};exports[_0x84c8('0x5c')]=function(_0x2c667b,_0x225825){var _0xc927f8;return db[_0x84c8('0x22')][_0x84c8('0x1c')]()['then'](function(_0x437c85){return db[_0x84c8('0x22')]['find']({'where':{'id':_0x2c667b[_0x84c8('0x24')]['id']},'include':[{'model':db['Tag'],'as':_0x84c8('0x5d'),'attributes':['id',_0x84c8('0x19'),_0x84c8('0x5e')],'required':_0x2c667b['query'][_0x84c8('0x5f')]?!![]:![]},{'model':db[_0x84c8('0x45')],'as':_0x84c8('0x60'),'where':{'CmContactId':_0x2c667b[_0x84c8('0x24')]['id']},'required':![],'include':[{'model':db['ContactItemType'],'as':_0x84c8('0x61')}]}],'order':[db[_0x84c8('0x62')][_0x84c8('0x63')]('Phones.OrderBy')],'attributes':_['keys'](_0x437c85)});})[_0x84c8('0x14')](function(_0x22aba7){if(!_['isNil'](_0x22aba7)){_0xc927f8=_0x22aba7[_0x84c8('0x34')]({'plain':!![]});var _0x543ac7={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x22aba7&&_0x22aba7[_0x84c8('0x59')]){if(_0x22aba7[_0x84c8('0x59')]){_0x543ac7['where'][_0x84c8('0x64')][_0x84c8('0x57')]({'ListId':{'$ne':_0x22aba7[_0x84c8('0x59')]}});}}return db['CmCustomField'][_0x84c8('0x1e')](_0x543ac7);}})[_0x84c8('0x14')](function(_0x2cebb5){if(!_[_0x84c8('0x4f')](_0x2cebb5)){return _[_0x84c8('0x65')](_0xc927f8,_[_0x84c8('0x66')](_0x2cebb5,function(_0x545bb3){return util[_0x84c8('0x67')]('cf_%d',_0x545bb3['id']);}));}})['then'](handleEntityNotFound(_0x225825,null))[_0x84c8('0x14')](respondWithResult(_0x225825,null))[_0x84c8('0x21')](handleError(_0x225825,null));};exports[_0x84c8('0x13')]=function(_0xdb6e4d,_0x4a9cef){var _0x57dc83;if(_0xdb6e4d[_0x84c8('0x32')]['id']){delete _0xdb6e4d[_0x84c8('0x32')]['id'];}if(!_['isNil'](_0xdb6e4d[_0x84c8('0x32')]['dialTimezone'])){var _0x3b690e=_0xdb6e4d[_0x84c8('0x32')][_0x84c8('0x68')];if(!_[_0x84c8('0x4f')](shared['timezones'][_0x3b690e]))_0xdb6e4d['body'][_0x84c8('0x50')]=shared[_0x84c8('0x51')][_0x3b690e][_0x84c8('0x50')];}return db['CmContact'][_0x84c8('0x23')]({'where':{'id':_0xdb6e4d[_0x84c8('0x24')]['id']}})[_0x84c8('0x14')](handleEntityNotFound(_0x4a9cef,null))[_0x84c8('0x14')](saveUpdates(_0xdb6e4d[_0x84c8('0x32')],null))[_0x84c8('0x14')](function(_0x503f1e){_0x57dc83=_0x503f1e;var _0x2fe46c={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x503f1e&&_0x503f1e[_0x84c8('0x59')]){if(_0x503f1e[_0x84c8('0x59')]){_0x2fe46c[_0x84c8('0x58')]['$and'][_0x84c8('0x57')]({'ListId':{'$ne':_0x503f1e[_0x84c8('0x59')]}});}}return db[_0x84c8('0x2b')]['findAll'](_0x2fe46c);})['then'](function(_0x46f929){if(_0x46f929){return _[_0x84c8('0x65')](_[_0x84c8('0x69')](_0xdb6e4d[_0x84c8('0x32')],function(_0x1b99aa,_0x174cb4){return _[_0x84c8('0x27')](_0x174cb4,'cf_');}),_[_0x84c8('0x66')](_0x46f929,function(_0x203eb2){return util[_0x84c8('0x67')](_0x84c8('0x6a'),_0x203eb2['id']);}));}})[_0x84c8('0x14')](function(_0x120454){if(_0x120454&&!_[_0x84c8('0x6b')](_0x120454)){var _0x598b60=squel[_0x84c8('0x13')]()['table'](_0x84c8('0x6c'))['setFields'](_0x120454)['where'](_0x84c8('0x6d'),_0xdb6e4d[_0x84c8('0x24')]['id'])[_0x84c8('0x6e')]();return db[_0x84c8('0x62')][_0x84c8('0x1f')](_0x598b60['text'],{'replacements':_0x598b60['values']});}})[_0x84c8('0x14')](function(){if(_0xdb6e4d[_0x84c8('0x32')][_0x84c8('0x6f')]&&_0x57dc83){return db[_0x84c8('0x39')][_0x84c8('0x13')]({'phone':_0xdb6e4d[_0x84c8('0x32')]['phone'],'OrderBy':0x0},{'where':{'ContactId':_0x57dc83['id']}});}})['then'](function(){return _0x57dc83;})[_0x84c8('0x14')](respondWithResult(_0x4a9cef,null))[_0x84c8('0x21')](handleError(_0x4a9cef,null));};exports[_0x84c8('0x70')]=function(_0x319693,_0x767dd0){var _0x3de7eb={};var _0x32eb76={};var _0x412f6e;var _0x5b09a6;return db['CmContact'][_0x84c8('0x71')]({'where':{'id':_0x319693[_0x84c8('0x24')]['id']}})[_0x84c8('0x14')](handleEntityNotFound(_0x767dd0,null))[_0x84c8('0x14')](function(_0x3eb135){if(_0x3eb135){_0x412f6e=_0x3eb135;_0x32eb76['model']=_['keys'](db[_0x84c8('0x72')][_0x84c8('0x73')]);_0x32eb76[_0x84c8('0x1f')]=_[_0x84c8('0x25')](_0x319693['query']);_0x32eb76[_0x84c8('0x74')]=_['intersection'](_0x32eb76['model'],_0x32eb76[_0x84c8('0x1f')]);_0x3de7eb[_0x84c8('0x75')]=_[_0x84c8('0x76')](_0x32eb76['model'],qs[_0x84c8('0x77')](_0x319693[_0x84c8('0x1f')][_0x84c8('0x77')]));_0x3de7eb[_0x84c8('0x75')]=_0x3de7eb[_0x84c8('0x75')]['length']?_0x3de7eb[_0x84c8('0x75')]:_0x32eb76[_0x84c8('0x78')];_0x3de7eb[_0x84c8('0x79')]=qs[_0x84c8('0x7a')](_0x319693['query'][_0x84c8('0x7a')]);_0x3de7eb[_0x84c8('0x58')]=qs[_0x84c8('0x74')](_[_0x84c8('0x7b')](_0x319693['query'],_0x32eb76[_0x84c8('0x74')]));if(_0x319693[_0x84c8('0x1f')]['filter']){_0x3de7eb[_0x84c8('0x58')]=_['merge'](_0x3de7eb[_0x84c8('0x58')],{'$or':_[_0x84c8('0x66')](_0x3de7eb[_0x84c8('0x75')],function(_0x58fb28){var _0x2a6aee={};_0x2a6aee[_0x58fb28]={'$like':'%'+_0x319693[_0x84c8('0x1f')][_0x84c8('0x7c')]+'%'};return _0x2a6aee;})});}_0x3de7eb=_[_0x84c8('0x31')]({},_0x3de7eb,_0x319693[_0x84c8('0x7d')]);return _0x412f6e[_0x84c8('0x70')](_0x3de7eb);}})[_0x84c8('0x14')](function(_0x1fe010){if(_0x1fe010){_0x5b09a6=_0x1fe010[_0x84c8('0x26')];if(!_0x319693[_0x84c8('0x1f')][_0x84c8('0x30')](_0x84c8('0x7e'))){_0x3de7eb['limit']=qs[_0x84c8('0x10')](_0x319693[_0x84c8('0x1f')][_0x84c8('0x10')]);_0x3de7eb['offset']=qs[_0x84c8('0xe')](_0x319693['query']['offset']);}return _0x412f6e[_0x84c8('0x70')](_0x3de7eb);}})['then'](function(_0x3f420f){if(_0x3f420f){return _0x3f420f?{'count':_0x5b09a6,'rows':_0x3f420f}:null;}})[_0x84c8('0x14')](respondWithResult(_0x767dd0,null))[_0x84c8('0x21')](handleError(_0x767dd0,null));};exports[_0x84c8('0x7f')]=function(_0x4338b4,_0x3efcdb){if(_0x4338b4[_0x84c8('0x32')]['id']){delete _0x4338b4[_0x84c8('0x32')]['id'];}return db[_0x84c8('0x22')]['findOne']({'where':{'id':_0x4338b4['params']['id']}})[_0x84c8('0x14')](handleEntityNotFound(_0x3efcdb,null))[_0x84c8('0x14')](function(_0x476837){if(_0x476837){return _0x476837[_0x84c8('0x7f')](_0x4338b4[_0x84c8('0x32')][_0x84c8('0x80')]||[]);}return null;})[_0x84c8('0x14')](respondWithResult(_0x3efcdb,null))[_0x84c8('0x21')](handleError(_0x3efcdb,null));};exports[_0x84c8('0x81')]=function(_0x35837e,_0x499bfe){var _0x393e07=[];_0x393e07[_0x84c8('0x57')](addAdditionalPhones(_0x35837e[_0x84c8('0x32')]));Promise[_0x84c8('0x5b')](_0x393e07)[_0x84c8('0x14')](function(){_0x393e07=[];_0x393e07[_0x84c8('0x57')](deleteCmHopperPhones(_0x35837e[_0x84c8('0x32')]['id']));_0x393e07[_0x84c8('0x57')](addCmHopperPhones(_0x35837e[_0x84c8('0x32')]['id']));Promise[_0x84c8('0x5b')](_0x393e07)[_0x84c8('0x14')](function(){return[0x1];})[_0x84c8('0x14')](respondWithResult(_0x499bfe,null));});};function addAdditionalPhones(_0x2e81b3){var _0x32dc27;return new Promise(function(_0x34b49c){return db['CmContactHasItem'][_0x84c8('0x15')]({'where':{'CmContactId':_0x2e81b3['id']}})['then'](function(){db['ContactItemType'][_0x84c8('0x1e')]({'raw':!![],'attributes':['id','OrderBy']})[_0x84c8('0x14')](function(_0x61f64a){var _0x31cd77=[];for(var _0x2c4193=0x0;_0x2c4193<_0x2e81b3['items']['length'];_0x2c4193++){var _0x2bb4c1=_0x2e81b3[_0x84c8('0x82')]?_['isNil'](_0x2e81b3['item_types'][_0x2c4193])?'':_0x2e81b3[_0x84c8('0x82')][_0x2c4193]:_0x2e81b3['items'][_0x2c4193][_0x84c8('0x83')]?_0x2e81b3[_0x84c8('0x84')][_0x2c4193]['ItemTypeId']:'';var _0x342a2b=_[_0x84c8('0x4f')](_0x2e81b3[_0x84c8('0x84')][_0x2c4193]['description'])?'':_0x2e81b3[_0x84c8('0x84')][_0x2c4193][_0x84c8('0x85')];var _0x4d416a=_0x2bb4c1+':'+_0x2e81b3['items'][_0x2c4193]['phone']+'§'+_0x342a2b;if(_[_0x84c8('0x4f')](_0x32dc27))_0x32dc27=_0x4d416a;else _0x32dc27+=';'+_0x4d416a;var _0x85cb4=null;var _0x229958=null;if(_0x2e81b3[_0x84c8('0x82')]){if(!_[_0x84c8('0x4f')](_0x2e81b3[_0x84c8('0x82')][_0x2c4193])){_0x229958=_[_0x84c8('0x23')](_0x61f64a,function(_0xcda843){return _0xcda843['id']===_0x2e81b3[_0x84c8('0x82')][_0x2c4193];});if(!_[_0x84c8('0x4f')](_0x229958)){_0x85cb4=_0x229958[_0x84c8('0x86')];}}}else{if(!_['isNil'](_0x2e81b3[_0x84c8('0x84')][_0x2c4193])){_0x229958=_[_0x84c8('0x23')](_0x61f64a,function(_0x373b4b){return _0x373b4b['id']===_0x2e81b3[_0x84c8('0x84')][_0x2c4193]['ItemTypeId'];});if(!_['isNil'](_0x229958)){_0x85cb4=_0x2c4193;}}}if(_[_0x84c8('0x4f')](_0x85cb4)){_0x85cb4=0x64;}_0x31cd77[_0x84c8('0x57')](addAdditionalPhone(_0x2e81b3['id'],_0x2e81b3[_0x84c8('0x84')][_0x2c4193][_0x84c8('0x6f')],_0x2e81b3[_0x84c8('0x82')]?_[_0x84c8('0x4f')](_0x2e81b3[_0x84c8('0x82')][_0x2c4193])?null:_0x2e81b3['item_types'][_0x2c4193]:_0x2e81b3[_0x84c8('0x84')][_0x2c4193][_0x84c8('0x83')]?_0x2e81b3[_0x84c8('0x84')][_0x2c4193][_0x84c8('0x83')]:null,_0x85cb4,_0x342a2b));}Promise['all'](_0x31cd77)['then'](function(){db[_0x84c8('0x22')][_0x84c8('0x13')]({'AdditionalPhones':_0x32dc27},{'where':{'id':_0x2e81b3['id']}})[_0x84c8('0x14')](function(){_0x34b49c(0x1);});});});});});}function addAdditionalPhone(_0x3b81df,_0x39e9a0,_0x5b4f74,_0x4baf1f,_0x2a6e26){return db['CmContactHasItem']['find']({'where':{'CmContactId':_0x3b81df,'item':_0x39e9a0}})[_0x84c8('0x14')](function(_0x4e088d){if(_0x4e088d)logger['info']('contact\x20phone\x20exists',_0x4e088d);else{db[_0x84c8('0x45')][_0x84c8('0x3c')]({'CmContactId':_0x3b81df,'item':_0x39e9a0,'ItemTypeId':_0x5b4f74,'OrderBy':_0x4baf1f,'ItemClass':_0x84c8('0x87'),'description':_0x2a6e26});}});}function deleteCmHopperPhones(_0x274c11){return new Promise(function(_0x54cf9a){return db[_0x84c8('0x39')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x274c11}})[_0x84c8('0x14')](function(_0x47e099){db['CmHopperAdditionalPhone'][_0x84c8('0x15')]({'where':{'CmHopperId':{'$in':_[_0x84c8('0x66')](_0x47e099,'id')}}});})[_0x84c8('0x14')](function(){_0x54cf9a(0x1);});});}function addCmHopperPhones(_0x24c9fb){return new Promise(function(_0x4c887b){return db[_0x84c8('0x39')][_0x84c8('0x1e')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x24c9fb}})['then'](function(_0x303212){var _0xbe6f15=[];_['map'](_0x303212,function(_0x523d21){_0xbe6f15[_0x84c8('0x57')](createCmHopperPhone(_0x24c9fb,_0x523d21['id']));});Promise[_0x84c8('0x5b')](_0xbe6f15)[_0x84c8('0x14')](function(){_0x4c887b(0x1);});});});}function createCmHopperPhone(_0x5810f6,_0x161f4c){return new Promise(function(_0x4ba93e){db[_0x84c8('0x45')][_0x84c8('0x1e')]({'raw':!![],'attributes':[_0x84c8('0x88'),_0x84c8('0x86')],'where':{'CmContactId':_0x5810f6,'ItemClass':'PHONE'},'include':[{'model':db[_0x84c8('0x89')],'attributes':[_0x84c8('0x86')],'as':_0x84c8('0x61')}],'order':['OrderBy',db[_0x84c8('0x62')][_0x84c8('0x63')](_0x84c8('0x8a'))]})[_0x84c8('0x14')](function(_0x1d2e0f){var _0x52b020=0x1;var _0x3d62b4=_['map'](_0x1d2e0f,function(_0x2ec2bf){_0x2ec2bf[_0x84c8('0x8b')]=_0x161f4c;_0x2ec2bf[_0x84c8('0x6f')]=_0x2ec2bf['item'];_0x2ec2bf[_0x84c8('0x86')]=_0x52b020;delete _0x2ec2bf[_0x84c8('0x8c')];_0x52b020=_0x52b020+0x1;return _0x2ec2bf;});return db[_0x84c8('0x8d')][_0x84c8('0x53')](_0x3d62b4,{});})['then'](function(){_0x4ba93e(0x1);});});}function insertAdditionalPhones(_0x1648cc,_0x12dc09){return new Promise(function(_0x494065){var _0x1049b3=[];for(var _0x11d1b2=0x0;_0x11d1b2<_0x12dc09[_0x84c8('0x26')];_0x11d1b2++){var _0x570cef=_0x12dc09[_0x11d1b2];_0x1049b3['push'](parseContactItemType(_0x570cef));}Promise[_0x84c8('0x5b')](_0x1049b3)[_0x84c8('0x14')](function(){var _0xce20c5={'id':_0x1648cc['id'],'items':_0x12dc09};return addAdditionalPhones(_0xce20c5)[_0x84c8('0x14')](function(){return addCmHopperPhones(_0x1648cc['id']);});})['then'](function(){_0x494065(_0x1648cc);});});}function parseContactItemType(_0x428b7e){return new Promise(function(_0x99eae8){if(_0x428b7e[_0x84c8('0x30')](_0x84c8('0x83'))){_0x99eae8(_0x428b7e);}else{return db[_0x84c8('0x89')][_0x84c8('0x23')]({'where':{'name':_0x428b7e[_0x84c8('0x61')]}})[_0x84c8('0x14')](function(_0x77eeb6){if(_['isNil'](_0x77eeb6))_0x428b7e['ItemTypeId']=null;else _0x428b7e[_0x84c8('0x83')]=_0x77eeb6['id'];_0x99eae8(_0x428b7e);});}});}exports[_0x84c8('0x8e')]=function(_0xca73f3,_0x5e0ee0){return db['CmContactHasItem'][_0x84c8('0x1e')]({'raw':!![],'where':{'CmContactId':_0xca73f3[_0x84c8('0x24')]['id'],'ItemClass':_0x84c8('0x87')},'include':[{'model':db[_0x84c8('0x89')],'as':'ItemType'}],'order':[[_0x84c8('0x86')],[db[_0x84c8('0x62')][_0x84c8('0x63')](_0x84c8('0x8a'))]]})['then'](function(_0x3eb3c7){return _0x3eb3c7;})[_0x84c8('0x14')](respondWithResult(_0x5e0ee0,null))[_0x84c8('0x21')](handleError(_0x5e0ee0,null));};exports[_0x84c8('0x8f')]=function(_0x485702,_0x40c560){return db[_0x84c8('0x45')][_0x84c8('0x1e')]({'raw':!![],'where':{'CmContactId':_0x485702['body']['fromContactId']}})[_0x84c8('0x14')](function(_0x5dca7d){var _0x19eab1=_[_0x84c8('0x66')](_0x5dca7d,function(_0x18fa9c){_0x18fa9c[_0x84c8('0x90')]=_0x485702[_0x84c8('0x32')]['toContactId'];return _0x18fa9c;});return db['CmContactHasItem'][_0x84c8('0x53')](_0x19eab1,{});})[_0x84c8('0x14')](function(){return addCmHopperPhones(_0x485702['body'][_0x84c8('0x91')]);})[_0x84c8('0x14')](function(){return['ok'];})[_0x84c8('0x14')](respondWithResult(_0x40c560,null))[_0x84c8('0x21')](handleError(_0x40c560,null));};exports[_0x84c8('0x92')]=function(_0x35811d,_0x151361){var _0x29bc57=[];_0x29bc57[_0x84c8('0x57')](createCmHopperPhone(_0x35811d['body']['id'],_0x35811d[_0x84c8('0x32')][_0x84c8('0x93')]));Promise['all'](_0x29bc57)[_0x84c8('0x14')](function(){return[0x1];})[_0x84c8('0x14')](respondWithResult(_0x151361,null));};exports['getHoppers']=function(_0xc42dff,_0x43af82){var _0x12eccf={'raw':![],'where':{}};var _0x5963dd={};var _0xe6c06b={'count':0x0,'rows':[]};return db[_0x84c8('0x22')]['findOne']({'where':{'id':_0xc42dff[_0x84c8('0x24')]['id']}})[_0x84c8('0x14')](handleEntityNotFound(_0x43af82,null))[_0x84c8('0x14')](function(_0x1c474f){if(_0x1c474f){_0x5963dd[_0x84c8('0x78')]=_[_0x84c8('0x25')](db[_0x84c8('0x39')][_0x84c8('0x73')]);_0x5963dd[_0x84c8('0x1f')]=_[_0x84c8('0x25')](_0xc42dff[_0x84c8('0x1f')]);_0x5963dd[_0x84c8('0x74')]=_[_0x84c8('0x76')](_0x5963dd['model'],_0x5963dd['query']);_0x12eccf['attributes']=_[_0x84c8('0x76')](_0x5963dd[_0x84c8('0x78')],qs[_0x84c8('0x77')](_0xc42dff[_0x84c8('0x1f')][_0x84c8('0x77')]));_0x12eccf[_0x84c8('0x75')]=_0x12eccf[_0x84c8('0x75')][_0x84c8('0x26')]?_0x12eccf[_0x84c8('0x75')]:_0x5963dd[_0x84c8('0x78')];if(!_0xc42dff['query'][_0x84c8('0x30')](_0x84c8('0x7e'))){_0x12eccf[_0x84c8('0x10')]=qs['limit'](_0xc42dff[_0x84c8('0x1f')][_0x84c8('0x10')]);_0x12eccf[_0x84c8('0xe')]=qs[_0x84c8('0xe')](_0xc42dff['query'][_0x84c8('0xe')]);}_0x12eccf[_0x84c8('0x79')]=qs['sort'](_0xc42dff['query'][_0x84c8('0x7a')]);_0x12eccf[_0x84c8('0x58')]=qs['filters'](_['pick'](_0xc42dff[_0x84c8('0x1f')],_0x5963dd[_0x84c8('0x74')]));_0x12eccf['where'][_0x84c8('0x94')]=_0x1c474f['id'];if(_0xc42dff[_0x84c8('0x1f')][_0x84c8('0x7c')]){_0x12eccf[_0x84c8('0x58')]=_['merge'](_0x12eccf[_0x84c8('0x58')],{'$or':_[_0x84c8('0x66')](_0x12eccf[_0x84c8('0x75')],function(_0x14a0f5){var _0x47fb06={};_0x47fb06[_0x14a0f5]={'$like':'%'+_0xc42dff[_0x84c8('0x1f')][_0x84c8('0x7c')]+'%'};return _0x47fb06;})});}_0x12eccf=_[_0x84c8('0x31')]({},_0x12eccf,_0xc42dff[_0x84c8('0x7d')]);return db[_0x84c8('0x39')][_0x84c8('0x11')]({'where':_0x12eccf[_0x84c8('0x58')]})[_0x84c8('0x14')](function(_0x42865e){_0xe6c06b[_0x84c8('0x11')]=_0x42865e;if(_0xc42dff['query'][_0x84c8('0x95')]){_0x12eccf[_0x84c8('0x96')]=[{'all':!![]}];}return db[_0x84c8('0x39')][_0x84c8('0x1e')](_0x12eccf);})[_0x84c8('0x14')](function(_0x436ded){_0xe6c06b['rows']=_0x436ded;return _0xe6c06b;});}})[_0x84c8('0x14')](respondWithFilteredResult(_0x43af82,_0x12eccf))[_0x84c8('0x21')](handleError(_0x43af82,null));};exports['getHopperHistories']=function(_0x50e236,_0x235204){var _0xa0fb51={'raw':!![],'where':{}};var _0x55f597={};var _0x6193a8={'count':0x0,'rows':[]};return db[_0x84c8('0x22')][_0x84c8('0x71')]({'where':{'id':_0x50e236['params']['id']}})[_0x84c8('0x14')](handleEntityNotFound(_0x235204,null))['then'](function(_0x256e35){if(_0x256e35){_0x55f597[_0x84c8('0x78')]=_[_0x84c8('0x25')](db['CmHopperHistory']['rawAttributes']);_0x55f597[_0x84c8('0x1f')]=_['keys'](_0x50e236[_0x84c8('0x1f')]);_0x55f597[_0x84c8('0x74')]=_[_0x84c8('0x76')](_0x55f597[_0x84c8('0x78')],_0x55f597['query']);_0xa0fb51[_0x84c8('0x75')]=_[_0x84c8('0x76')](_0x55f597[_0x84c8('0x78')],qs[_0x84c8('0x77')](_0x50e236['query']['fields']));_0xa0fb51['attributes']=_0xa0fb51['attributes']['length']?_0xa0fb51[_0x84c8('0x75')]:_0x55f597[_0x84c8('0x78')];if(!_0x50e236[_0x84c8('0x1f')]['hasOwnProperty'](_0x84c8('0x7e'))){_0xa0fb51[_0x84c8('0x10')]=qs[_0x84c8('0x10')](_0x50e236[_0x84c8('0x1f')][_0x84c8('0x10')]);_0xa0fb51[_0x84c8('0xe')]=qs[_0x84c8('0xe')](_0x50e236[_0x84c8('0x1f')][_0x84c8('0xe')]);}_0xa0fb51[_0x84c8('0x79')]=qs[_0x84c8('0x7a')](_0x50e236[_0x84c8('0x1f')]['sort']);_0xa0fb51[_0x84c8('0x58')]=qs[_0x84c8('0x74')](_['pick'](_0x50e236[_0x84c8('0x1f')],_0x55f597[_0x84c8('0x74')]));_0xa0fb51[_0x84c8('0x58')][_0x84c8('0x94')]=_0x256e35['id'];if(_0x50e236[_0x84c8('0x1f')][_0x84c8('0x7c')]){_0xa0fb51['where']=_[_0x84c8('0x31')](_0xa0fb51[_0x84c8('0x58')],{'$or':_[_0x84c8('0x66')](_0xa0fb51[_0x84c8('0x75')],function(_0x1d0c10){var _0x1d91f8={};_0x1d91f8[_0x1d0c10]={'$like':'%'+_0x50e236[_0x84c8('0x1f')][_0x84c8('0x7c')]+'%'};return _0x1d91f8;})});}_0xa0fb51=_['merge']({},_0xa0fb51,_0x50e236[_0x84c8('0x7d')]);return db[_0x84c8('0x47')]['count']({'where':_0xa0fb51['where']})[_0x84c8('0x14')](function(_0x5bad9a){_0x6193a8[_0x84c8('0x11')]=_0x5bad9a;if(_0x50e236[_0x84c8('0x1f')]['includeAll']){_0xa0fb51[_0x84c8('0x96')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x84c8('0x1e')](_0xa0fb51);})[_0x84c8('0x14')](function(_0x34d9e8){_0x6193a8[_0x84c8('0x97')]=_0x34d9e8;return _0x6193a8;});}})[_0x84c8('0x14')](respondWithFilteredResult(_0x235204,_0xa0fb51))[_0x84c8('0x21')](handleError(_0x235204,null));};exports[_0x84c8('0x98')]=function(_0x25ea34,_0x5eb95d){var _0x4c8aae={'raw':!![],'where':{}};var _0x1cb911={};var _0x3447c1={'count':0x0,'rows':[]};return db[_0x84c8('0x22')]['findOne']({'where':{'id':_0x25ea34[_0x84c8('0x24')]['id']}})[_0x84c8('0x14')](handleEntityNotFound(_0x5eb95d,null))['then'](function(_0xba2747){if(_0xba2747){_0x1cb911[_0x84c8('0x78')]=_[_0x84c8('0x25')](db['CmHopperFinal']['rawAttributes']);_0x1cb911[_0x84c8('0x1f')]=_[_0x84c8('0x25')](_0x25ea34[_0x84c8('0x1f')]);_0x1cb911[_0x84c8('0x74')]=_[_0x84c8('0x76')](_0x1cb911[_0x84c8('0x78')],_0x1cb911[_0x84c8('0x1f')]);_0x4c8aae[_0x84c8('0x75')]=_[_0x84c8('0x76')](_0x1cb911['model'],qs[_0x84c8('0x77')](_0x25ea34[_0x84c8('0x1f')][_0x84c8('0x77')]));_0x4c8aae[_0x84c8('0x75')]=_0x4c8aae['attributes'][_0x84c8('0x26')]?_0x4c8aae['attributes']:_0x1cb911[_0x84c8('0x78')];if(!_0x25ea34[_0x84c8('0x1f')][_0x84c8('0x30')](_0x84c8('0x7e'))){_0x4c8aae[_0x84c8('0x10')]=qs[_0x84c8('0x10')](_0x25ea34[_0x84c8('0x1f')][_0x84c8('0x10')]);_0x4c8aae[_0x84c8('0xe')]=qs[_0x84c8('0xe')](_0x25ea34[_0x84c8('0x1f')]['offset']);}_0x4c8aae[_0x84c8('0x79')]=qs[_0x84c8('0x7a')](_0x25ea34[_0x84c8('0x1f')]['sort']);_0x4c8aae[_0x84c8('0x58')]=qs[_0x84c8('0x74')](_[_0x84c8('0x7b')](_0x25ea34[_0x84c8('0x1f')],_0x1cb911['filters']));_0x4c8aae[_0x84c8('0x58')][_0x84c8('0x94')]=_0xba2747['id'];if(_0x25ea34['query'][_0x84c8('0x7c')]){_0x4c8aae['where']=_[_0x84c8('0x31')](_0x4c8aae[_0x84c8('0x58')],{'$or':_[_0x84c8('0x66')](_0x4c8aae[_0x84c8('0x75')],function(_0x1c843f){var _0x2ad499={};_0x2ad499[_0x1c843f]={'$like':'%'+_0x25ea34[_0x84c8('0x1f')]['filter']+'%'};return _0x2ad499;})});}_0x4c8aae=_[_0x84c8('0x31')]({},_0x4c8aae,_0x25ea34['options']);return db[_0x84c8('0x46')]['count']({'where':_0x4c8aae[_0x84c8('0x58')]})[_0x84c8('0x14')](function(_0x450c9d){_0x3447c1[_0x84c8('0x11')]=_0x450c9d;if(_0x25ea34[_0x84c8('0x1f')][_0x84c8('0x95')]){_0x4c8aae[_0x84c8('0x96')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x84c8('0x1e')](_0x4c8aae);})[_0x84c8('0x14')](function(_0x4a477e){_0x3447c1[_0x84c8('0x97')]=_0x4a477e;return _0x3447c1;});}})[_0x84c8('0x14')](respondWithFilteredResult(_0x5eb95d,_0x4c8aae))[_0x84c8('0x21')](handleError(_0x5eb95d,null));};exports[_0x84c8('0x99')]=function(_0x2e39ab,_0x24ba57){var _0x245d76={'raw':!![],'where':{}};var _0x31921c={};var _0x350ee7={'count':0x0,'rows':[]};return db[_0x84c8('0x22')][_0x84c8('0x71')]({'where':{'id':_0x2e39ab[_0x84c8('0x24')]['id']}})[_0x84c8('0x14')](handleEntityNotFound(_0x24ba57,null))['then'](function(_0x58407f){if(_0x58407f){_0x31921c[_0x84c8('0x78')]=_[_0x84c8('0x25')](db['JscriptySessionReport'][_0x84c8('0x73')]);_0x31921c[_0x84c8('0x1f')]=_[_0x84c8('0x25')](_0x2e39ab[_0x84c8('0x1f')]);_0x31921c[_0x84c8('0x74')]=_[_0x84c8('0x76')](_0x31921c[_0x84c8('0x78')],_0x31921c[_0x84c8('0x1f')]);_0x245d76[_0x84c8('0x75')]=_['intersection'](_0x31921c[_0x84c8('0x78')],qs[_0x84c8('0x77')](_0x2e39ab[_0x84c8('0x1f')][_0x84c8('0x77')]));_0x245d76[_0x84c8('0x75')]=_0x245d76['attributes'][_0x84c8('0x26')]?_0x245d76[_0x84c8('0x75')]:_0x31921c[_0x84c8('0x78')];if(!_0x2e39ab[_0x84c8('0x1f')][_0x84c8('0x30')](_0x84c8('0x7e'))){_0x245d76[_0x84c8('0x10')]=qs[_0x84c8('0x10')](_0x2e39ab[_0x84c8('0x1f')][_0x84c8('0x10')]);_0x245d76[_0x84c8('0xe')]=qs['offset'](_0x2e39ab[_0x84c8('0x1f')][_0x84c8('0xe')]);}_0x245d76[_0x84c8('0x79')]=qs['sort'](_0x2e39ab['query'][_0x84c8('0x7a')]);_0x245d76['where']=qs[_0x84c8('0x74')](_[_0x84c8('0x7b')](_0x2e39ab[_0x84c8('0x1f')],_0x31921c[_0x84c8('0x74')]));_0x245d76[_0x84c8('0x58')][_0x84c8('0x94')]=_0x58407f['id'];if(_0x2e39ab[_0x84c8('0x1f')][_0x84c8('0x7c')]){_0x245d76['where']=_[_0x84c8('0x31')](_0x245d76[_0x84c8('0x58')],{'$or':_[_0x84c8('0x66')](_0x245d76['attributes'],function(_0x2ffdfc){var _0x222ec6={};_0x222ec6[_0x2ffdfc]={'$like':'%'+_0x2e39ab[_0x84c8('0x1f')][_0x84c8('0x7c')]+'%'};return _0x222ec6;})});}_0x245d76=_['merge']({},_0x245d76,_0x2e39ab[_0x84c8('0x7d')]);return db[_0x84c8('0x4d')][_0x84c8('0x11')]({'where':_0x245d76[_0x84c8('0x58')]})[_0x84c8('0x14')](function(_0x4463b2){_0x350ee7[_0x84c8('0x11')]=_0x4463b2;if(_0x2e39ab[_0x84c8('0x1f')][_0x84c8('0x95')]){_0x245d76[_0x84c8('0x96')]=[{'all':!![]}];}return db[_0x84c8('0x4d')][_0x84c8('0x1e')](_0x245d76);})[_0x84c8('0x14')](function(_0x2984ef){_0x350ee7['rows']=_0x2984ef;return _0x350ee7;});}})['then'](respondWithFilteredResult(_0x24ba57,_0x245d76))[_0x84c8('0x21')](handleError(_0x24ba57,null));};exports[_0x84c8('0x9a')]=function(_0x3f05c9,_0xb95b23){try{if(!_0x3f05c9['body'][_0x84c8('0x59')]){throw new Error('No\x20ListId\x20specified');}if(!_0x3f05c9[_0x84c8('0x32')][_0x84c8('0x9b')]){throw new Error(_0x84c8('0x9c'));}if(!_0x3f05c9[_0x84c8('0x32')][_0x84c8('0x9d')]){throw new Error(_0x84c8('0x9e'));}if(!_0x3f05c9[_0x84c8('0x32')][_0x84c8('0x9f')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x323af4=_0x3f05c9['body'][_0x84c8('0x9b')][_0x84c8('0xa0')](',');var _0x3cf613=_0x3f05c9[_0x84c8('0x32')][_0x84c8('0x9d')]['split'](',');if(!_0x323af4[_0x84c8('0x26')]||!_0x3cf613[_0x84c8('0x26')]||_0x323af4[_0x84c8('0x26')]!==_0x3cf613['length']){throw new Error(_0x84c8('0xa1'));}_0x3f05c9[_0x84c8('0x32')]['fields']=_[_0x84c8('0xa2')](_0x323af4,_0x3cf613);if(!_0x3f05c9[_0x84c8('0x32')][_0x84c8('0x77')]['phone']){throw new Error(_0x84c8('0xa3'));}if(!_0x3f05c9[_0x84c8('0x32')][_0x84c8('0x77')][_0x84c8('0xa4')]){throw new Error(_0x84c8('0xa5'));}var _0x2907a1=path['join'](config[_0x84c8('0xa6')],_0x84c8('0xa7'),_0x3f05c9['file'][_0x84c8('0xa8')]);fs[_0x84c8('0xa9')](_0x2907a1,parseInt('0777',0x8));var _0xa916bd=require(_0x84c8('0xaa'))[_0x84c8('0xab')](path[_0x84c8('0x37')](__dirname,_0x84c8('0xac')),[_0x2907a1,_0x3f05c9['body'][_0x84c8('0x9b')],_0x3f05c9[_0x84c8('0x32')][_0x84c8('0x9d')],_0x3f05c9[_0x84c8('0x32')][_0x84c8('0x59')],_0x3f05c9['body'][_0x84c8('0xad')],_0x3f05c9[_0x84c8('0x32')][_0x84c8('0x55')],_0x3f05c9[_0x84c8('0x32')][_0x84c8('0x9f')]]);return _0xb95b23['status'](0xc8)[_0x84c8('0xd')]({'message':_0x84c8('0xae'),'pid':_0xa916bd[_0x84c8('0xaf')]});}catch(_0x4b705e){return _0xb95b23[_0x84c8('0xc')](0x1f4)[_0x84c8('0x1a')](_0x4b705e);}};exports['upload']=function(_0x12e2da,_0x7dac46){var _0x6ccead=fs['createReadStream'](_0x12e2da['file'][_0x84c8('0x2')]);Papa['parse'](_0x6ccead,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x3faf79){return _0x7dac46[_0x84c8('0xc')](0xc8)['json']({'file':_0x12e2da[_0x84c8('0xb0')],'fields':_0x3faf79[_0x84c8('0xb1')][_0x84c8('0x77')]});}});};exports[_0x84c8('0xb2')]=function(_0x49534e,_0x44b1c7){return db[_0x84c8('0xb3')][_0x84c8('0x1e')]({'raw':!![],'attributes':['id'],'where':{'role':_0x84c8('0xb4')}})[_0x84c8('0x14')](function(_0x55c149){var _0x4f10ac=![];if(!_0x49534e[_0x84c8('0x32')][_0x84c8('0x59')]){throw new Error(_0x84c8('0xb5'));}if(!_0x49534e[_0x84c8('0x32')][_0x84c8('0xb6')]['phone']){throw new Error(_0x84c8('0xa3'));}if(!_0x49534e[_0x84c8('0x32')]['binding'][_0x84c8('0xa4')]){throw new Error(_0x84c8('0xa5'));}if(!_0x49534e['body'][_0x84c8('0x9f')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x3ad383=require(_0x84c8('0xaa'))['fork'](path[_0x84c8('0x37')](__dirname,'../../components/import/cm/csv2'),[_0x49534e['params']['id'],JSON[_0x84c8('0xb7')](_0x49534e[_0x84c8('0x32')]),JSON[_0x84c8('0xb7')](_0x55c149)]);_0x3ad383['on'](_0x84c8('0xb8'),function(){_0x4f10ac=!![];return _0x44b1c7[_0x84c8('0xc')](0xc8)[_0x84c8('0xd')]({'message':'start\x20child\x20process\x20correctly!','pid':_0x3ad383[_0x84c8('0xaf')]});});_0x3ad383['on'](_0x84c8('0xb9'),function(_0x291918){if(_0x291918&&!_0x4f10ac){return _0x44b1c7['status'](0x1f4)[_0x84c8('0xd')]({'message':'error\x20child\x20process','pid':_0x3ad383[_0x84c8('0xaf')]});}});})[_0x84c8('0x21')](handleError(_0x44b1c7,null));};exports[_0x84c8('0xba')]=function(_0x5e5f52,_0xa2dea){return db[_0x84c8('0xb3')]['findAll']({'raw':!![],'attributes':['id'],'where':{'role':_0x84c8('0xb4')}})[_0x84c8('0x14')](function(_0x4259ce){var _0x15e650=![];if(!_0x5e5f52[_0x84c8('0x32')]['ListId']){throw new Error(_0x84c8('0xb5'));}if(!_0x5e5f52['body'][_0x84c8('0xb6')][_0x84c8('0x6f')]){throw new Error(_0x84c8('0xa3'));}if(!_0x5e5f52[_0x84c8('0x32')][_0x84c8('0xb6')]['firstName']){throw new Error(_0x84c8('0xa5'));}if(!_0x5e5f52[_0x84c8('0x32')][_0x84c8('0x9f')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0xd0b1b6=require('child_process')[_0x84c8('0xab')](path['join'](__dirname,_0x84c8('0xbb')),[_0x5e5f52['params']['id'],JSON[_0x84c8('0xb7')](_0x5e5f52[_0x84c8('0x32')]),JSON[_0x84c8('0xb7')](_0x4259ce)]);_0xd0b1b6['on']('message',function(){_0x15e650=!![];return _0xa2dea[_0x84c8('0xc')](0xc8)['json']({'message':_0x84c8('0xbc'),'pid':_0xd0b1b6[_0x84c8('0xaf')]});});_0xd0b1b6['on'](_0x84c8('0xb9'),function(_0x5540e0){if(_0x5540e0&&!_0x15e650){return _0xa2dea[_0x84c8('0xc')](0x1f4)[_0x84c8('0xd')]({'message':_0x84c8('0xbd'),'pid':_0xd0b1b6[_0x84c8('0xaf')]});}});})['catch'](handleError(_0xa2dea,null));};exports[_0x84c8('0xbe')]=function(_0x51da60,_0x1768d0){var _0xd140c=[_0x84c8('0xbf'),_0x84c8('0xc0'),_0x84c8('0xc1'),_0x84c8('0xc2'),'fax',_0x84c8('0xc3'),'voice'];var _0xd3691e={'offset':0x0,'order':qs[_0x84c8('0x7a')]('-createdAt')},_0x3968aa={'count':0x0,'rows':[]};Promise[_0x84c8('0xc4')]()['then'](function(){if(_0x51da60[_0x84c8('0x1f')]['channel']){if(!_['includes'](_0xd140c,_0x51da60[_0x84c8('0x1f')]['channel'][_0x84c8('0xc5')]())){throw new Error(_0x84c8('0xc6'));}_0xd140c=[_0x51da60['query']['channel'][_0x84c8('0xc5')]()];}if(_0x51da60[_0x84c8('0x1f')][_0x84c8('0xc7')]){try{var _0x4c4644=JSON[_0x84c8('0xc8')](_0x51da60['query']['range']);if(!moment(_0x4c4644['from'])['isValid']()){throw new Error('Invalid\x20date\x20for\x20range\x20from\x20filter');}if(!moment(_0x4c4644['to'])[_0x84c8('0xc9')]()){throw new Error('Invalid\x20date\x20for\x20range\x20to\x20filter');}}catch(_0x59c5b2){throw new Error('Invalid\x20createdAt\x20filter');}}if(!_0x51da60[_0x84c8('0x1f')][_0x84c8('0x30')](_0x84c8('0x7e'))){_0xd3691e['limit']=qs['limit'](_0x51da60[_0x84c8('0x1f')][_0x84c8('0x10')]||0xa);_0xd3691e[_0x84c8('0xe')]=qs[_0x84c8('0xe')](_0x51da60[_0x84c8('0x1f')]['offset']);}var _0x11f203=_0xd140c[_0x84c8('0x66')](function(_0x1da5c8){if(_0x1da5c8===_0x84c8('0xca')){var _0x1f2ae4={'attributes':['id',_0x84c8('0xcb'),'type','source','destination',_0x84c8('0xcc'),_0x84c8('0xcd'),'endtime',_0x84c8('0xce'),_0x84c8('0xcf'),'createdAt',_0x84c8('0xd0'),_0x84c8('0xd1'),'userThirdDisposition',_0x84c8('0xd2')],'where':{'ContactId':_0x51da60[_0x84c8('0x24')]['id']},'include':[{'model':db['User'],'as':_0x84c8('0xb3'),'attributes':['id','name',_0x84c8('0xd3'),_0x84c8('0x2d')]}],'order':[[_0x84c8('0xd4'),_0x84c8('0xd5')]]};if(_0x51da60[_0x84c8('0x1f')]['range']){_0x1f2ae4[_0x84c8('0x58')][_0x84c8('0xd4')]={'$gte':_0x4c4644[_0x84c8('0x33')],'$lte':_0x4c4644['to']};}return db[_0x84c8('0x49')]['findAndCountAll'](_0x1f2ae4)[_0x84c8('0x14')](function(_0x379bd7){_0x3968aa[_0x84c8('0x11')]+=_0x379bd7[_0x84c8('0x11')];return _[_0x84c8('0x66')](_0x379bd7['rows'],function(_0x571baa){var _0x56c75f=_0x571baa[_0x84c8('0x34')]({'plain':!![]});_0x56c75f['channel']=_0x1da5c8;if(_0x56c75f['User']){_0x56c75f['User']={'id':_0x56c75f[_0x84c8('0xb3')]['id'],'name':_0x56c75f[_0x84c8('0xb3')]['name'],'fullname':_0x56c75f[_0x84c8('0xb3')][_0x84c8('0xd3')],'alias':_0x56c75f[_0x84c8('0xb3')][_0x84c8('0x2d')]};}return _0x56c75f;});});}else{var _0x3b571d=_[_0x84c8('0xd6')](_0x1da5c8)+(_0x1da5c8===_0x84c8('0xc0')?_0x84c8('0xd7'):_0x84c8('0xd8'));var _0xf12076={'attributes':['id',_0x84c8('0xd9'),_0x84c8('0xda'),_0x84c8('0xd4'),'note',_0x84c8('0xdb'),_0x84c8('0xdc'),'thirdDisposition',_0x84c8('0xd2'),_0x3b571d+'Id'],'where':{'ContactId':_0x51da60[_0x84c8('0x24')]['id']},'include':[{'model':db[_0x3b571d],'as':_0x84c8('0xd8'),'attributes':['id',_0x84c8('0x19'),_0x84c8('0xdd')]},{'model':db[_0x84c8('0xb3')],'as':_0x84c8('0xde'),'attributes':['id',_0x84c8('0x19'),'fullname']},{'model':db['Tag'],'as':_0x84c8('0x5d'),'attributes':['id',_0x84c8('0x19'),_0x84c8('0x5e')],'through':{'attributes':[]}}],'order':[['createdAt',_0x84c8('0xd5')]]};if(_0x51da60[_0x84c8('0x1f')][_0x84c8('0xc7')]){_0xf12076[_0x84c8('0x58')][_0x84c8('0xd4')]={'$gte':_0x4c4644[_0x84c8('0x33')],'$lte':_0x4c4644['to']};}switch(_0x1da5c8){case _0x84c8('0xc0'):_0xf12076[_0x84c8('0x75')][_0x84c8('0x57')](_0x84c8('0xdf'),_0x84c8('0xe0'),_0x84c8('0xe1'),_0x84c8('0xe2'),_0x84c8('0xe3'),_0x84c8('0xe4'),'ratingType',_0x84c8('0xe5'),_0x84c8('0xe6'));break;case _0x84c8('0xbf'):_0xf12076['attributes'][_0x84c8('0x57')](_0x84c8('0xe7'),_0x84c8('0xe8'));break;case _0x84c8('0xc2'):_0xf12076[_0x84c8('0x75')][_0x84c8('0x57')](_0x84c8('0xe9'),_0x84c8('0xea'));break;}return db[_[_0x84c8('0xd6')](_0x1da5c8)+'Interaction'][_0x84c8('0xeb')](_0xf12076)[_0x84c8('0x14')](function(_0x2ebcb7){_0x3968aa['count']+=_0x2ebcb7[_0x84c8('0x11')];return _[_0x84c8('0x66')](_0x2ebcb7['rows'],function(_0x555cb9){var _0x32058e=_0x555cb9[_0x84c8('0x34')]({'plain':!![]});_0x32058e['channel']=_0x1da5c8;if(_0x32058e[_0x84c8('0xde')]){_0x32058e[_0x84c8('0xde')]={'id':_0x32058e[_0x84c8('0xde')]['id'],'name':_0x32058e['Owner'][_0x84c8('0x19')],'fullname':_0x32058e[_0x84c8('0xde')][_0x84c8('0xd3')]};}return _0x32058e;});});}});return Promise[_0x84c8('0x5b')](_0x11f203);})[_0x84c8('0x14')](function(_0x5a6c14){return _(_0x5a6c14)[_0x84c8('0xec')]()['sortBy'](_0x84c8('0xd4'))[_0x84c8('0xed')]()[_0x84c8('0xee')]();})[_0x84c8('0x14')](function(_0x473a62){_0x3968aa[_0x84c8('0x97')]=_0xd3691e[_0x84c8('0x10')]?_0x473a62['slice'](_0xd3691e[_0x84c8('0xe')],_0xd3691e['offset']+_0xd3691e[_0x84c8('0x10')]):_0x473a62;return _0x3968aa;})[_0x84c8('0x14')](respondWithFilteredResult(_0x1768d0,_0xd3691e))['catch'](handleError(_0x1768d0,null));}; \ No newline at end of file +var _0xafa1=['findOrCreate','spread','contact','all','Tag','Tags','query','tag','ContactItemType','ItemType','literal','Phones.OrderBy','$and','CmCustomField','omit','map','cf_%d','pickBy','format','isEmpty','table','cm_contacts','setFields','id\x20=\x20?','toParam','text','phone','CmHopper','getTags','findOne','model','rawAttributes','filters','intersection','fields','attributes','order','sort','filter','nolimit','setTags','ids','setAdditionalPhones','OrderBy','items','item_types','ItemTypeId','contact\x20phone\x20exists','PHONE','item','sequelize','`ItemType`.OrderBy','ItemType.OrderBy','getAdditionalPhones','fromContactId','CmContactId','toContactId','hopperId','getHoppers','pick','ContactId','includeAll','include','rows','getHopperHistories','CmHopperHistory','options','getHopperFinals','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','binding_keys','binding_values','socket_timestamp','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','No\x20firstName\x20column\x20specified','root','server/files/tmp','filename','child_process','fork','CompanyId','File\x20uploaded\x20correctly!','upload','createReadStream','file','meta','import','User','agent','binding','firstName','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','../../components/import/cm/csv2','stringify','start\x20child\x20process\x20correctly!','pid','error\x20child\x20process','importUpdates','../../components/import/cm/csvUpdates','message','exit','getJourney','mail','sms','openchannel','fax','whatsapp','voice','-createdAt','resolve','channel','toLowerCase','range','parse','Invalid\x20date\x20for\x20range\x20from\x20filter','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','uniqueid','source','destination','callerid','starttime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','DESC','findAndCountAll','startCase','chat','Website','closed','closedAt','secondDisposition','thirdDisposition','Account','key','Owner','color','browserName','customerPort','deviceModel','ratingMessage','ratingType','ratingValue','referer','subject','externalUrl','Interaction','flatten','sortBy','reverse','value','slice','moment','bluebird','util','lodash','squel','papaparse','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./cmContact.socket','register','status','json','offset','undefined','limit','count','Content-Range','update','then','end','sendStatus','error','stack','name','send','index','describe','getOptions','user','catch','destroy','find','params','tags','keys','length','startsWith','columnName','analytics','findAll','cf_','displayName','alias','custom','values','info','forEach','hasOwnProperty','merge','body','CmContact','from','get','mergeWith','isArray','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','[CmContact][merge][destroy][CmHopper],\x20%s','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','isNil','dialTimezone','utcOffset','timezones','additionalPhones','bulkCreate','each','duplicates','$or','push','where','ListId'];(function(_0x4efb91,_0x18c51f){var _0x5a5515=function(_0x58e8ba){while(--_0x58e8ba){_0x4efb91['push'](_0x4efb91['shift']());}};_0x5a5515(++_0x18c51f);}(_0xafa1,0xa2));var _0x1afa=function(_0x526a46,_0x119cc9){_0x526a46=_0x526a46-0x0;var _0x299cab=_0xafa1[_0x526a46];return _0x299cab;};'use strict';var moment=require(_0x1afa('0x0'));var BPromise=require(_0x1afa('0x1'));var util=require(_0x1afa('0x2'));var path=require('path');var fs=require('fs');var _=require(_0x1afa('0x3'));var squel=require(_0x1afa('0x4'));var Papa=require(_0x1afa('0x5'));var Redis=require('ioredis');var contacts=require(_0x1afa('0x6'));var qs=require(_0x1afa('0x7'));var logger=require(_0x1afa('0x8'))(_0x1afa('0x9'));var config=require(_0x1afa('0xa'));var shared=require('../../config/environment/shared');var db=require('../../mysqldb')['db'];config[_0x1afa('0xb')]=_[_0x1afa('0xc')](config[_0x1afa('0xb')],{'host':_0x1afa('0xd'),'port':0x18eb});var socket=require(_0x1afa('0xe'))(new Redis(config[_0x1afa('0xb')]));require(_0x1afa('0xf'))[_0x1afa('0x10')](socket);function respondWithResult(_0x4d1cd4,_0x10ecdc){_0x10ecdc=_0x10ecdc||0xc8;return function(_0x5333af){if(_0x5333af){return _0x4d1cd4[_0x1afa('0x11')](_0x10ecdc)[_0x1afa('0x12')](_0x5333af);}};}function respondWithFilteredResult(_0x4107fd,_0x51ac74){return function(_0xb50add){if(_0xb50add){var _0x1cdfe2=typeof _0x51ac74[_0x1afa('0x13')]===_0x1afa('0x14')&&typeof _0x51ac74[_0x1afa('0x15')]==='undefined';var _0x43aaf4=_0xb50add[_0x1afa('0x16')];var _0x17c190=_0x1cdfe2?0x0:_0x51ac74['offset'];var _0x85492b=_0x1cdfe2?_0xb50add[_0x1afa('0x16')]:_0x51ac74['offset']+_0x51ac74[_0x1afa('0x15')];var _0x3a991e;if(_0x85492b>=_0x43aaf4){_0x85492b=_0x43aaf4;_0x3a991e=0xc8;}else{_0x3a991e=0xce;}_0x4107fd[_0x1afa('0x11')](_0x3a991e);return _0x4107fd['set'](_0x1afa('0x17'),_0x17c190+'-'+_0x85492b+'/'+_0x43aaf4)[_0x1afa('0x12')](_0xb50add);}return null;};}function saveUpdates(_0x104c9f){return function(_0x1d18c0){if(_0x1d18c0){return _0x1d18c0[_0x1afa('0x18')](_0x104c9f)[_0x1afa('0x19')](function(_0x4bdcfe){return _0x4bdcfe;});}return null;};}function removeEntity(_0x1714fb){return function(_0x421714){if(_0x421714){return _0x421714['destroy']()[_0x1afa('0x19')](function(){_0x1714fb[_0x1afa('0x11')](0xcc)[_0x1afa('0x1a')]();});}};}function handleEntityNotFound(_0xc0a52a){return function(_0xc4e97f){if(!_0xc4e97f){_0xc0a52a[_0x1afa('0x1b')](0x194);}return _0xc4e97f;};}function handleError(_0x2e667a,_0x18e61c){_0x18e61c=_0x18e61c||0x1f4;return function(_0x28a481){logger[_0x1afa('0x1c')](_0x28a481[_0x1afa('0x1d')]);if(_0x28a481[_0x1afa('0x1e')]){delete _0x28a481[_0x1afa('0x1e')];}_0x2e667a[_0x1afa('0x11')](_0x18e61c)[_0x1afa('0x1f')](_0x28a481);};}exports[_0x1afa('0x20')]=function(_0x2007d7,_0x46c2f6){var _0x41ab82={};return contacts[_0x1afa('0x21')]()[_0x1afa('0x19')](function(_0x4bfe2b){_0x41ab82=qs[_0x1afa('0x22')](_0x4bfe2b,_0x2007d7);return contacts['findAll'](_0x2007d7['query'],_0x2007d7[_0x1afa('0x23')],_0x41ab82,_0x4bfe2b);})[_0x1afa('0x19')](respondWithFilteredResult(_0x46c2f6,_0x41ab82))[_0x1afa('0x24')](handleError(_0x46c2f6,null));};exports[_0x1afa('0x25')]=function(_0x15fdf4,_0x5f3ffc){return db['CmContact'][_0x1afa('0x26')]({'where':{'id':_0x15fdf4[_0x1afa('0x27')]['id']}})[_0x1afa('0x19')](handleEntityNotFound(_0x5f3ffc,null))[_0x1afa('0x19')](removeEntity(_0x5f3ffc,null))[_0x1afa('0x24')](handleError(_0x5f3ffc,null));};exports[_0x1afa('0x21')]=function(_0x115d21,_0x4e9993){return db['CmContact'][_0x1afa('0x21')]()[_0x1afa('0x19')](function(_0x43c464){delete _0x43c464[_0x1afa('0x28')];for(var _0x43328c=0x0;_0x43328c0x0){return new Promise(function(_0xac947f){var _0x440aa9=[];for(var _0x4fd0c3=0x0;_0x4fd0c3<_0x39c4fa['length'];_0x4fd0c3++){_0x440aa9[_0x1afa('0x61')](insertAdditionalPhones(_0x39c4fa[_0x4fd0c3][_0x1afa('0x66')],_0x39c4fa[_0x4fd0c3][_0x1afa('0x5c')]));}Promise[_0x1afa('0x67')](_0x440aa9)[_0x1afa('0x19')](function(){_0xac947f(0x1);});})[_0x1afa('0x19')](function(){return{'success':_0x153f31,'failure':_0x3b93c0,'duplicates':_0x40480c};});}else{return{'success':_0x153f31,'failure':_0x3b93c0,'duplicates':_0x40480c};}}})['then'](respondWithResult(_0x518aa5,0xc9))[_0x1afa('0x24')](handleError(_0x518aa5,null));};exports['show']=function(_0x49c301,_0x9dd264){var _0x2cab58;return db[_0x1afa('0x39')][_0x1afa('0x21')]()[_0x1afa('0x19')](function(_0x502462){return db['CmContact'][_0x1afa('0x26')]({'where':{'id':_0x49c301[_0x1afa('0x27')]['id']},'include':[{'model':db[_0x1afa('0x68')],'as':_0x1afa('0x69'),'attributes':['id',_0x1afa('0x1e'),'color'],'required':_0x49c301[_0x1afa('0x6a')][_0x1afa('0x6b')]?!![]:![]},{'model':db[_0x1afa('0x4b')],'as':'Phones','where':{'CmContactId':_0x49c301['params']['id']},'required':![],'include':[{'model':db[_0x1afa('0x6c')],'as':_0x1afa('0x6d')}]}],'order':[db['sequelize'][_0x1afa('0x6e')](_0x1afa('0x6f'))],'attributes':_[_0x1afa('0x29')](_0x502462)});})[_0x1afa('0x19')](function(_0x481aa4){if(!_[_0x1afa('0x58')](_0x481aa4)){_0x2cab58=_0x481aa4[_0x1afa('0x3b')]({'plain':!![]});var _0x1620ef={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x481aa4&&_0x481aa4[_0x1afa('0x63')]){if(_0x481aa4[_0x1afa('0x63')]){_0x1620ef[_0x1afa('0x62')][_0x1afa('0x70')][_0x1afa('0x61')]({'ListId':{'$ne':_0x481aa4[_0x1afa('0x63')]}});}}return db[_0x1afa('0x71')]['findAll'](_0x1620ef);}})[_0x1afa('0x19')](function(_0x18ade3){if(!_[_0x1afa('0x58')](_0x18ade3)){return _[_0x1afa('0x72')](_0x2cab58,_[_0x1afa('0x73')](_0x18ade3,function(_0x55dde7){return util['format'](_0x1afa('0x74'),_0x55dde7['id']);}));}})[_0x1afa('0x19')](handleEntityNotFound(_0x9dd264,null))[_0x1afa('0x19')](respondWithResult(_0x9dd264,null))[_0x1afa('0x24')](handleError(_0x9dd264,null));};exports[_0x1afa('0x18')]=function(_0x2e46d7,_0x5c39b5){var _0x40b96b;if(_0x2e46d7[_0x1afa('0x38')]['id']){delete _0x2e46d7[_0x1afa('0x38')]['id'];}if(!_[_0x1afa('0x58')](_0x2e46d7[_0x1afa('0x38')][_0x1afa('0x59')])){var _0x434974=_0x2e46d7[_0x1afa('0x38')][_0x1afa('0x59')];if(!_[_0x1afa('0x58')](shared[_0x1afa('0x5b')][_0x434974]))_0x2e46d7[_0x1afa('0x38')][_0x1afa('0x5a')]=shared['timezones'][_0x434974][_0x1afa('0x5a')];}return db[_0x1afa('0x39')][_0x1afa('0x26')]({'where':{'id':_0x2e46d7[_0x1afa('0x27')]['id']}})['then'](handleEntityNotFound(_0x5c39b5,null))['then'](saveUpdates(_0x2e46d7['body'],null))[_0x1afa('0x19')](function(_0x8b798f){_0x40b96b=_0x8b798f;var _0x5c7ceb={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x8b798f&&_0x8b798f[_0x1afa('0x63')]){if(_0x8b798f[_0x1afa('0x63')]){_0x5c7ceb['where'][_0x1afa('0x70')][_0x1afa('0x61')]({'ListId':{'$ne':_0x8b798f[_0x1afa('0x63')]}});}}return db[_0x1afa('0x71')][_0x1afa('0x2e')](_0x5c7ceb);})[_0x1afa('0x19')](function(_0x3688e3){if(_0x3688e3){return _[_0x1afa('0x72')](_[_0x1afa('0x75')](_0x2e46d7[_0x1afa('0x38')],function(_0x5a2bea,_0x4df3be){return _['startsWith'](_0x4df3be,_0x1afa('0x2f'));}),_[_0x1afa('0x73')](_0x3688e3,function(_0x3bcb5a){return util[_0x1afa('0x76')](_0x1afa('0x74'),_0x3bcb5a['id']);}));}})['then'](function(_0x5b9f80){if(_0x5b9f80&&!_[_0x1afa('0x77')](_0x5b9f80)){var _0xe35506=squel['update']()[_0x1afa('0x78')](_0x1afa('0x79'))[_0x1afa('0x7a')](_0x5b9f80)[_0x1afa('0x62')](_0x1afa('0x7b'),_0x2e46d7[_0x1afa('0x27')]['id'])[_0x1afa('0x7c')]();return db['sequelize'][_0x1afa('0x6a')](_0xe35506[_0x1afa('0x7d')],{'replacements':_0xe35506[_0x1afa('0x33')]});}})['then'](function(){if(_0x2e46d7[_0x1afa('0x38')][_0x1afa('0x7e')]&&_0x40b96b){return db[_0x1afa('0x7f')][_0x1afa('0x18')]({'phone':_0x2e46d7['body'][_0x1afa('0x7e')],'OrderBy':0x0},{'where':{'ContactId':_0x40b96b['id']}});}})[_0x1afa('0x19')](function(){return _0x40b96b;})[_0x1afa('0x19')](respondWithResult(_0x5c39b5,null))[_0x1afa('0x24')](handleError(_0x5c39b5,null));};exports[_0x1afa('0x80')]=function(_0x180423,_0x9155bd){var _0x50b65d={};var _0x2bafc2={};var _0x4d8bee;var _0x32ceab;return db['CmContact'][_0x1afa('0x81')]({'where':{'id':_0x180423['params']['id']}})['then'](handleEntityNotFound(_0x9155bd,null))[_0x1afa('0x19')](function(_0x49b77f){if(_0x49b77f){_0x4d8bee=_0x49b77f;_0x2bafc2[_0x1afa('0x82')]=_[_0x1afa('0x29')](db[_0x1afa('0x68')][_0x1afa('0x83')]);_0x2bafc2[_0x1afa('0x6a')]=_[_0x1afa('0x29')](_0x180423[_0x1afa('0x6a')]);_0x2bafc2[_0x1afa('0x84')]=_[_0x1afa('0x85')](_0x2bafc2[_0x1afa('0x82')],_0x2bafc2['query']);_0x50b65d['attributes']=_[_0x1afa('0x85')](_0x2bafc2[_0x1afa('0x82')],qs[_0x1afa('0x86')](_0x180423[_0x1afa('0x6a')][_0x1afa('0x86')]));_0x50b65d[_0x1afa('0x87')]=_0x50b65d['attributes'][_0x1afa('0x2a')]?_0x50b65d['attributes']:_0x2bafc2[_0x1afa('0x82')];_0x50b65d[_0x1afa('0x88')]=qs['sort'](_0x180423[_0x1afa('0x6a')][_0x1afa('0x89')]);_0x50b65d[_0x1afa('0x62')]=qs[_0x1afa('0x84')](_['pick'](_0x180423[_0x1afa('0x6a')],_0x2bafc2[_0x1afa('0x84')]));if(_0x180423['query'][_0x1afa('0x8a')]){_0x50b65d[_0x1afa('0x62')]=_[_0x1afa('0x37')](_0x50b65d[_0x1afa('0x62')],{'$or':_['map'](_0x50b65d[_0x1afa('0x87')],function(_0x56eb7c){var _0x3dd75b={};_0x3dd75b[_0x56eb7c]={'$like':'%'+_0x180423[_0x1afa('0x6a')][_0x1afa('0x8a')]+'%'};return _0x3dd75b;})});}_0x50b65d=_[_0x1afa('0x37')]({},_0x50b65d,_0x180423['options']);return _0x4d8bee[_0x1afa('0x80')](_0x50b65d);}})[_0x1afa('0x19')](function(_0x308bfd){if(_0x308bfd){_0x32ceab=_0x308bfd[_0x1afa('0x2a')];if(!_0x180423[_0x1afa('0x6a')][_0x1afa('0x36')](_0x1afa('0x8b'))){_0x50b65d[_0x1afa('0x15')]=qs[_0x1afa('0x15')](_0x180423[_0x1afa('0x6a')][_0x1afa('0x15')]);_0x50b65d[_0x1afa('0x13')]=qs[_0x1afa('0x13')](_0x180423['query'][_0x1afa('0x13')]);}return _0x4d8bee[_0x1afa('0x80')](_0x50b65d);}})[_0x1afa('0x19')](function(_0x3dcff2){if(_0x3dcff2){return _0x3dcff2?{'count':_0x32ceab,'rows':_0x3dcff2}:null;}})[_0x1afa('0x19')](respondWithResult(_0x9155bd,null))[_0x1afa('0x24')](handleError(_0x9155bd,null));};exports[_0x1afa('0x8c')]=function(_0x4aabf9,_0x4f6afa){if(_0x4aabf9[_0x1afa('0x38')]['id']){delete _0x4aabf9[_0x1afa('0x38')]['id'];}return db[_0x1afa('0x39')]['findOne']({'where':{'id':_0x4aabf9['params']['id']}})[_0x1afa('0x19')](handleEntityNotFound(_0x4f6afa,null))[_0x1afa('0x19')](function(_0x3dd9c0){if(_0x3dd9c0){return _0x3dd9c0['setTags'](_0x4aabf9['body'][_0x1afa('0x8d')]||[]);}return null;})['then'](respondWithResult(_0x4f6afa,null))['catch'](handleError(_0x4f6afa,null));};exports[_0x1afa('0x8e')]=function(_0x9c0312,_0x11f0fb){var _0x3ad56f=[];_0x3ad56f[_0x1afa('0x61')](addAdditionalPhones(_0x9c0312[_0x1afa('0x38')]));Promise[_0x1afa('0x67')](_0x3ad56f)[_0x1afa('0x19')](function(){_0x3ad56f=[];_0x3ad56f[_0x1afa('0x61')](deleteCmHopperPhones(_0x9c0312['body']['id']));_0x3ad56f[_0x1afa('0x61')](addCmHopperPhones(_0x9c0312['body']['id']));Promise[_0x1afa('0x67')](_0x3ad56f)['then'](function(){return[0x1];})[_0x1afa('0x19')](respondWithResult(_0x11f0fb,null));});};function addAdditionalPhones(_0xe133e3){var _0x56dd27;return new Promise(function(_0x1cfd3d){return db[_0x1afa('0x4b')][_0x1afa('0x25')]({'where':{'CmContactId':_0xe133e3['id']}})[_0x1afa('0x19')](function(){db[_0x1afa('0x6c')][_0x1afa('0x2e')]({'raw':!![],'attributes':['id',_0x1afa('0x8f')]})[_0x1afa('0x19')](function(_0x2595f3){var _0x3eac4c=[];for(var _0x2a62e7=0x0;_0x2a62e7<_0xe133e3[_0x1afa('0x90')][_0x1afa('0x2a')];_0x2a62e7++){var _0x40c3f1=_0xe133e3[_0x1afa('0x91')]?_[_0x1afa('0x58')](_0xe133e3[_0x1afa('0x91')][_0x2a62e7])?'':_0xe133e3['item_types'][_0x2a62e7]:_0xe133e3[_0x1afa('0x90')][_0x2a62e7]['ItemTypeId']?_0xe133e3['items'][_0x2a62e7][_0x1afa('0x92')]:'';var _0x2509c8=_[_0x1afa('0x58')](_0xe133e3[_0x1afa('0x90')][_0x2a62e7]['description'])?'':_0xe133e3[_0x1afa('0x90')][_0x2a62e7]['description'];var _0x396f9e=_0x40c3f1+':'+_0xe133e3[_0x1afa('0x90')][_0x2a62e7][_0x1afa('0x7e')]+'§'+_0x2509c8;if(_[_0x1afa('0x58')](_0x56dd27))_0x56dd27=_0x396f9e;else _0x56dd27+=';'+_0x396f9e;var _0x51770a=null;var _0x3649dc=null;if(_0xe133e3[_0x1afa('0x91')]){if(!_['isNil'](_0xe133e3[_0x1afa('0x91')][_0x2a62e7])){_0x3649dc=_[_0x1afa('0x26')](_0x2595f3,function(_0x37e86b){return _0x37e86b['id']===_0xe133e3[_0x1afa('0x91')][_0x2a62e7];});if(!_['isNil'](_0x3649dc)){_0x51770a=_0x3649dc[_0x1afa('0x8f')];}}}else{if(!_[_0x1afa('0x58')](_0xe133e3[_0x1afa('0x90')][_0x2a62e7])){_0x3649dc=_['find'](_0x2595f3,function(_0x56c0ba){return _0x56c0ba['id']===_0xe133e3[_0x1afa('0x90')][_0x2a62e7][_0x1afa('0x92')];});if(!_['isNil'](_0x3649dc)){_0x51770a=_0x2a62e7;}}}if(_['isNil'](_0x51770a)){_0x51770a=0x64;}_0x3eac4c['push'](addAdditionalPhone(_0xe133e3['id'],_0xe133e3[_0x1afa('0x90')][_0x2a62e7][_0x1afa('0x7e')],_0xe133e3[_0x1afa('0x91')]?_[_0x1afa('0x58')](_0xe133e3[_0x1afa('0x91')][_0x2a62e7])?null:_0xe133e3['item_types'][_0x2a62e7]:_0xe133e3[_0x1afa('0x90')][_0x2a62e7]['ItemTypeId']?_0xe133e3[_0x1afa('0x90')][_0x2a62e7][_0x1afa('0x92')]:null,_0x51770a,_0x2509c8));}Promise[_0x1afa('0x67')](_0x3eac4c)[_0x1afa('0x19')](function(){db['CmContact']['update']({'AdditionalPhones':_0x56dd27},{'where':{'id':_0xe133e3['id']}})[_0x1afa('0x19')](function(){_0x1cfd3d(0x1);});});});});});}function addAdditionalPhone(_0x71ff3d,_0x5b7334,_0x1e1a21,_0x1ae6c0,_0x37a098){return db[_0x1afa('0x4b')][_0x1afa('0x26')]({'where':{'CmContactId':_0x71ff3d,'item':_0x5b7334}})[_0x1afa('0x19')](function(_0x595717){if(_0x595717)logger[_0x1afa('0x34')](_0x1afa('0x93'),_0x595717);else{db[_0x1afa('0x4b')][_0x1afa('0x42')]({'CmContactId':_0x71ff3d,'item':_0x5b7334,'ItemTypeId':_0x1e1a21,'OrderBy':_0x1ae6c0,'ItemClass':_0x1afa('0x94'),'description':_0x37a098});}});}function deleteCmHopperPhones(_0x5235fd){return new Promise(function(_0x2488ee){return db[_0x1afa('0x7f')][_0x1afa('0x2e')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x5235fd}})['then'](function(_0x5a2dc0){db['CmHopperAdditionalPhone'][_0x1afa('0x25')]({'where':{'CmHopperId':{'$in':_['map'](_0x5a2dc0,'id')}}});})[_0x1afa('0x19')](function(){_0x2488ee(0x1);});});}function addCmHopperPhones(_0xd6e459){return new Promise(function(_0x10a508){return db[_0x1afa('0x7f')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0xd6e459}})[_0x1afa('0x19')](function(_0x279ecf){var _0x1a3a7a=[];_[_0x1afa('0x73')](_0x279ecf,function(_0x2284e3){_0x1a3a7a['push'](createCmHopperPhone(_0xd6e459,_0x2284e3['id']));});Promise[_0x1afa('0x67')](_0x1a3a7a)[_0x1afa('0x19')](function(){_0x10a508(0x1);});});});}function createCmHopperPhone(_0x1bc3e5,_0x2a3f51){return new Promise(function(_0x2d1285){db[_0x1afa('0x4b')]['findAll']({'raw':!![],'attributes':[_0x1afa('0x95'),_0x1afa('0x8f')],'where':{'CmContactId':_0x1bc3e5,'ItemClass':_0x1afa('0x94')},'include':[{'model':db[_0x1afa('0x6c')],'attributes':[_0x1afa('0x8f')],'as':_0x1afa('0x6d')}],'order':[_0x1afa('0x8f'),db[_0x1afa('0x96')][_0x1afa('0x6e')](_0x1afa('0x97'))]})[_0x1afa('0x19')](function(_0x37def7){var _0x941adf=0x1;var _0x5d93dc=_[_0x1afa('0x73')](_0x37def7,function(_0x2badb0){_0x2badb0['CmHopperId']=_0x2a3f51;_0x2badb0[_0x1afa('0x7e')]=_0x2badb0[_0x1afa('0x95')];_0x2badb0[_0x1afa('0x8f')]=_0x941adf;delete _0x2badb0[_0x1afa('0x98')];_0x941adf=_0x941adf+0x1;return _0x2badb0;});return db['CmHopperAdditionalPhone'][_0x1afa('0x5d')](_0x5d93dc,{});})[_0x1afa('0x19')](function(){_0x2d1285(0x1);});});}function insertAdditionalPhones(_0x442883,_0x113fa1){return new Promise(function(_0x510e37){var _0x4260ad=[];for(var _0x52e3d8=0x0;_0x52e3d8<_0x113fa1[_0x1afa('0x2a')];_0x52e3d8++){var _0x176489=_0x113fa1[_0x52e3d8];_0x4260ad[_0x1afa('0x61')](parseContactItemType(_0x176489));}Promise['all'](_0x4260ad)[_0x1afa('0x19')](function(){var _0x4f9bc7={'id':_0x442883['id'],'items':_0x113fa1};return addAdditionalPhones(_0x4f9bc7)['then'](function(){return addCmHopperPhones(_0x442883['id']);});})[_0x1afa('0x19')](function(){_0x510e37(_0x442883);});});}function parseContactItemType(_0x30ab01){return new Promise(function(_0x1dfe8b){if(_0x30ab01[_0x1afa('0x36')](_0x1afa('0x92'))){_0x1dfe8b(_0x30ab01);}else{return db[_0x1afa('0x6c')][_0x1afa('0x26')]({'where':{'name':_0x30ab01['ItemType']}})[_0x1afa('0x19')](function(_0x300949){if(_[_0x1afa('0x58')](_0x300949))_0x30ab01['ItemTypeId']=null;else _0x30ab01['ItemTypeId']=_0x300949['id'];_0x1dfe8b(_0x30ab01);});}});}exports[_0x1afa('0x99')]=function(_0x4c5755,_0x58ca42){return db[_0x1afa('0x4b')][_0x1afa('0x2e')]({'raw':!![],'where':{'CmContactId':_0x4c5755[_0x1afa('0x27')]['id'],'ItemClass':_0x1afa('0x94')},'include':[{'model':db['ContactItemType'],'as':'ItemType'}],'order':[['OrderBy'],[db['sequelize']['literal'](_0x1afa('0x97'))]]})[_0x1afa('0x19')](function(_0x2ed809){return _0x2ed809;})[_0x1afa('0x19')](respondWithResult(_0x58ca42,null))[_0x1afa('0x24')](handleError(_0x58ca42,null));};exports['duplicateAdditionalPhones']=function(_0x4adcbe,_0x4602a0){return db[_0x1afa('0x4b')][_0x1afa('0x2e')]({'raw':!![],'where':{'CmContactId':_0x4adcbe[_0x1afa('0x38')][_0x1afa('0x9a')]}})[_0x1afa('0x19')](function(_0x1ae59a){var _0xc373c4=_[_0x1afa('0x73')](_0x1ae59a,function(_0x306f59){_0x306f59[_0x1afa('0x9b')]=_0x4adcbe[_0x1afa('0x38')][_0x1afa('0x9c')];return _0x306f59;});return db[_0x1afa('0x4b')]['bulkCreate'](_0xc373c4,{});})[_0x1afa('0x19')](function(){return addCmHopperPhones(_0x4adcbe[_0x1afa('0x38')]['toContactId']);})['then'](function(){return['ok'];})[_0x1afa('0x19')](respondWithResult(_0x4602a0,null))[_0x1afa('0x24')](handleError(_0x4602a0,null));};exports['rescheduleAdditionalPhones']=function(_0x4c048f,_0x2b33a6){var _0x5cdac7=[];_0x5cdac7[_0x1afa('0x61')](createCmHopperPhone(_0x4c048f[_0x1afa('0x38')]['id'],_0x4c048f['body'][_0x1afa('0x9d')]));Promise['all'](_0x5cdac7)['then'](function(){return[0x1];})[_0x1afa('0x19')](respondWithResult(_0x2b33a6,null));};exports[_0x1afa('0x9e')]=function(_0x5c73e6,_0x26191b){var _0x40b356={'raw':![],'where':{}};var _0x330fc9={};var _0x2ff20a={'count':0x0,'rows':[]};return db[_0x1afa('0x39')]['findOne']({'where':{'id':_0x5c73e6[_0x1afa('0x27')]['id']}})['then'](handleEntityNotFound(_0x26191b,null))[_0x1afa('0x19')](function(_0x1dd2f5){if(_0x1dd2f5){_0x330fc9['model']=_[_0x1afa('0x29')](db['CmHopper'][_0x1afa('0x83')]);_0x330fc9['query']=_[_0x1afa('0x29')](_0x5c73e6[_0x1afa('0x6a')]);_0x330fc9[_0x1afa('0x84')]=_['intersection'](_0x330fc9[_0x1afa('0x82')],_0x330fc9[_0x1afa('0x6a')]);_0x40b356[_0x1afa('0x87')]=_[_0x1afa('0x85')](_0x330fc9[_0x1afa('0x82')],qs['fields'](_0x5c73e6[_0x1afa('0x6a')][_0x1afa('0x86')]));_0x40b356[_0x1afa('0x87')]=_0x40b356[_0x1afa('0x87')][_0x1afa('0x2a')]?_0x40b356[_0x1afa('0x87')]:_0x330fc9[_0x1afa('0x82')];if(!_0x5c73e6[_0x1afa('0x6a')][_0x1afa('0x36')](_0x1afa('0x8b'))){_0x40b356[_0x1afa('0x15')]=qs['limit'](_0x5c73e6[_0x1afa('0x6a')]['limit']);_0x40b356[_0x1afa('0x13')]=qs['offset'](_0x5c73e6['query'][_0x1afa('0x13')]);}_0x40b356[_0x1afa('0x88')]=qs[_0x1afa('0x89')](_0x5c73e6[_0x1afa('0x6a')][_0x1afa('0x89')]);_0x40b356[_0x1afa('0x62')]=qs['filters'](_[_0x1afa('0x9f')](_0x5c73e6[_0x1afa('0x6a')],_0x330fc9[_0x1afa('0x84')]));_0x40b356['where'][_0x1afa('0xa0')]=_0x1dd2f5['id'];if(_0x5c73e6['query'][_0x1afa('0x8a')]){_0x40b356[_0x1afa('0x62')]=_[_0x1afa('0x37')](_0x40b356[_0x1afa('0x62')],{'$or':_['map'](_0x40b356[_0x1afa('0x87')],function(_0x3b75f5){var _0x57b75a={};_0x57b75a[_0x3b75f5]={'$like':'%'+_0x5c73e6['query'][_0x1afa('0x8a')]+'%'};return _0x57b75a;})});}_0x40b356=_[_0x1afa('0x37')]({},_0x40b356,_0x5c73e6['options']);return db[_0x1afa('0x7f')][_0x1afa('0x16')]({'where':_0x40b356[_0x1afa('0x62')]})['then'](function(_0x2824a9){_0x2ff20a[_0x1afa('0x16')]=_0x2824a9;if(_0x5c73e6[_0x1afa('0x6a')][_0x1afa('0xa1')]){_0x40b356[_0x1afa('0xa2')]=[{'all':!![]}];}return db['CmHopper'][_0x1afa('0x2e')](_0x40b356);})['then'](function(_0xe74715){_0x2ff20a[_0x1afa('0xa3')]=_0xe74715;return _0x2ff20a;});}})['then'](respondWithFilteredResult(_0x26191b,_0x40b356))[_0x1afa('0x24')](handleError(_0x26191b,null));};exports[_0x1afa('0xa4')]=function(_0x33eff7,_0x1c4cbb){var _0x45ae1e={'raw':!![],'where':{}};var _0x1121bc={};var _0x367214={'count':0x0,'rows':[]};return db['CmContact']['findOne']({'where':{'id':_0x33eff7[_0x1afa('0x27')]['id']}})[_0x1afa('0x19')](handleEntityNotFound(_0x1c4cbb,null))[_0x1afa('0x19')](function(_0x3e3255){if(_0x3e3255){_0x1121bc[_0x1afa('0x82')]=_[_0x1afa('0x29')](db[_0x1afa('0xa5')][_0x1afa('0x83')]);_0x1121bc[_0x1afa('0x6a')]=_[_0x1afa('0x29')](_0x33eff7[_0x1afa('0x6a')]);_0x1121bc[_0x1afa('0x84')]=_['intersection'](_0x1121bc[_0x1afa('0x82')],_0x1121bc[_0x1afa('0x6a')]);_0x45ae1e[_0x1afa('0x87')]=_['intersection'](_0x1121bc['model'],qs['fields'](_0x33eff7[_0x1afa('0x6a')][_0x1afa('0x86')]));_0x45ae1e[_0x1afa('0x87')]=_0x45ae1e[_0x1afa('0x87')][_0x1afa('0x2a')]?_0x45ae1e[_0x1afa('0x87')]:_0x1121bc[_0x1afa('0x82')];if(!_0x33eff7[_0x1afa('0x6a')][_0x1afa('0x36')](_0x1afa('0x8b'))){_0x45ae1e[_0x1afa('0x15')]=qs['limit'](_0x33eff7['query'][_0x1afa('0x15')]);_0x45ae1e[_0x1afa('0x13')]=qs[_0x1afa('0x13')](_0x33eff7[_0x1afa('0x6a')][_0x1afa('0x13')]);}_0x45ae1e[_0x1afa('0x88')]=qs[_0x1afa('0x89')](_0x33eff7['query'][_0x1afa('0x89')]);_0x45ae1e[_0x1afa('0x62')]=qs['filters'](_[_0x1afa('0x9f')](_0x33eff7[_0x1afa('0x6a')],_0x1121bc[_0x1afa('0x84')]));_0x45ae1e['where'][_0x1afa('0xa0')]=_0x3e3255['id'];if(_0x33eff7[_0x1afa('0x6a')][_0x1afa('0x8a')]){_0x45ae1e['where']=_[_0x1afa('0x37')](_0x45ae1e['where'],{'$or':_['map'](_0x45ae1e[_0x1afa('0x87')],function(_0xbb50eb){var _0x41e180={};_0x41e180[_0xbb50eb]={'$like':'%'+_0x33eff7['query'][_0x1afa('0x8a')]+'%'};return _0x41e180;})});}_0x45ae1e=_[_0x1afa('0x37')]({},_0x45ae1e,_0x33eff7[_0x1afa('0xa6')]);return db[_0x1afa('0xa5')][_0x1afa('0x16')]({'where':_0x45ae1e[_0x1afa('0x62')]})[_0x1afa('0x19')](function(_0x996968){_0x367214[_0x1afa('0x16')]=_0x996968;if(_0x33eff7['query'][_0x1afa('0xa1')]){_0x45ae1e[_0x1afa('0xa2')]=[{'all':!![]}];}return db[_0x1afa('0xa5')][_0x1afa('0x2e')](_0x45ae1e);})[_0x1afa('0x19')](function(_0x589d3c){_0x367214[_0x1afa('0xa3')]=_0x589d3c;return _0x367214;});}})['then'](respondWithFilteredResult(_0x1c4cbb,_0x45ae1e))[_0x1afa('0x24')](handleError(_0x1c4cbb,null));};exports[_0x1afa('0xa7')]=function(_0x1c3feb,_0xafba7e){var _0x536c88={'raw':!![],'where':{}};var _0x3ee1bd={};var _0x2a1c7f={'count':0x0,'rows':[]};return db[_0x1afa('0x39')][_0x1afa('0x81')]({'where':{'id':_0x1c3feb[_0x1afa('0x27')]['id']}})[_0x1afa('0x19')](handleEntityNotFound(_0xafba7e,null))[_0x1afa('0x19')](function(_0x2e0aa6){if(_0x2e0aa6){_0x3ee1bd[_0x1afa('0x82')]=_[_0x1afa('0x29')](db[_0x1afa('0x4c')]['rawAttributes']);_0x3ee1bd[_0x1afa('0x6a')]=_['keys'](_0x1c3feb[_0x1afa('0x6a')]);_0x3ee1bd[_0x1afa('0x84')]=_[_0x1afa('0x85')](_0x3ee1bd[_0x1afa('0x82')],_0x3ee1bd[_0x1afa('0x6a')]);_0x536c88[_0x1afa('0x87')]=_['intersection'](_0x3ee1bd[_0x1afa('0x82')],qs['fields'](_0x1c3feb[_0x1afa('0x6a')][_0x1afa('0x86')]));_0x536c88['attributes']=_0x536c88[_0x1afa('0x87')][_0x1afa('0x2a')]?_0x536c88['attributes']:_0x3ee1bd['model'];if(!_0x1c3feb['query']['hasOwnProperty'](_0x1afa('0x8b'))){_0x536c88[_0x1afa('0x15')]=qs[_0x1afa('0x15')](_0x1c3feb[_0x1afa('0x6a')]['limit']);_0x536c88[_0x1afa('0x13')]=qs[_0x1afa('0x13')](_0x1c3feb[_0x1afa('0x6a')][_0x1afa('0x13')]);}_0x536c88[_0x1afa('0x88')]=qs[_0x1afa('0x89')](_0x1c3feb['query'][_0x1afa('0x89')]);_0x536c88[_0x1afa('0x62')]=qs[_0x1afa('0x84')](_[_0x1afa('0x9f')](_0x1c3feb[_0x1afa('0x6a')],_0x3ee1bd[_0x1afa('0x84')]));_0x536c88[_0x1afa('0x62')][_0x1afa('0xa0')]=_0x2e0aa6['id'];if(_0x1c3feb[_0x1afa('0x6a')][_0x1afa('0x8a')]){_0x536c88[_0x1afa('0x62')]=_['merge'](_0x536c88[_0x1afa('0x62')],{'$or':_[_0x1afa('0x73')](_0x536c88[_0x1afa('0x87')],function(_0xb26adf){var _0x1f5419={};_0x1f5419[_0xb26adf]={'$like':'%'+_0x1c3feb[_0x1afa('0x6a')][_0x1afa('0x8a')]+'%'};return _0x1f5419;})});}_0x536c88=_[_0x1afa('0x37')]({},_0x536c88,_0x1c3feb[_0x1afa('0xa6')]);return db[_0x1afa('0x4c')]['count']({'where':_0x536c88[_0x1afa('0x62')]})[_0x1afa('0x19')](function(_0x1a7369){_0x2a1c7f[_0x1afa('0x16')]=_0x1a7369;if(_0x1c3feb[_0x1afa('0x6a')][_0x1afa('0xa1')]){_0x536c88[_0x1afa('0xa2')]=[{'all':!![]}];}return db[_0x1afa('0x4c')]['findAll'](_0x536c88);})[_0x1afa('0x19')](function(_0x195dee){_0x2a1c7f[_0x1afa('0xa3')]=_0x195dee;return _0x2a1c7f;});}})[_0x1afa('0x19')](respondWithFilteredResult(_0xafba7e,_0x536c88))[_0x1afa('0x24')](handleError(_0xafba7e,null));};exports[_0x1afa('0xa8')]=function(_0xc94192,_0x43a83e){var _0x427ab6={'raw':!![],'where':{}};var _0x30b309={};var _0x4121f1={'count':0x0,'rows':[]};return db[_0x1afa('0x39')][_0x1afa('0x81')]({'where':{'id':_0xc94192[_0x1afa('0x27')]['id']}})['then'](handleEntityNotFound(_0x43a83e,null))[_0x1afa('0x19')](function(_0x6b75f){if(_0x6b75f){_0x30b309[_0x1afa('0x82')]=_['keys'](db['JscriptySessionReport'][_0x1afa('0x83')]);_0x30b309[_0x1afa('0x6a')]=_[_0x1afa('0x29')](_0xc94192[_0x1afa('0x6a')]);_0x30b309[_0x1afa('0x84')]=_[_0x1afa('0x85')](_0x30b309[_0x1afa('0x82')],_0x30b309[_0x1afa('0x6a')]);_0x427ab6['attributes']=_[_0x1afa('0x85')](_0x30b309[_0x1afa('0x82')],qs[_0x1afa('0x86')](_0xc94192[_0x1afa('0x6a')][_0x1afa('0x86')]));_0x427ab6[_0x1afa('0x87')]=_0x427ab6[_0x1afa('0x87')][_0x1afa('0x2a')]?_0x427ab6['attributes']:_0x30b309[_0x1afa('0x82')];if(!_0xc94192[_0x1afa('0x6a')][_0x1afa('0x36')](_0x1afa('0x8b'))){_0x427ab6[_0x1afa('0x15')]=qs['limit'](_0xc94192['query'][_0x1afa('0x15')]);_0x427ab6[_0x1afa('0x13')]=qs[_0x1afa('0x13')](_0xc94192[_0x1afa('0x6a')]['offset']);}_0x427ab6['order']=qs[_0x1afa('0x89')](_0xc94192[_0x1afa('0x6a')]['sort']);_0x427ab6['where']=qs[_0x1afa('0x84')](_[_0x1afa('0x9f')](_0xc94192[_0x1afa('0x6a')],_0x30b309[_0x1afa('0x84')]));_0x427ab6['where'][_0x1afa('0xa0')]=_0x6b75f['id'];if(_0xc94192[_0x1afa('0x6a')][_0x1afa('0x8a')]){_0x427ab6[_0x1afa('0x62')]=_[_0x1afa('0x37')](_0x427ab6['where'],{'$or':_[_0x1afa('0x73')](_0x427ab6[_0x1afa('0x87')],function(_0x4fda35){var _0x2d23bf={};_0x2d23bf[_0x4fda35]={'$like':'%'+_0xc94192['query'][_0x1afa('0x8a')]+'%'};return _0x2d23bf;})});}_0x427ab6=_[_0x1afa('0x37')]({},_0x427ab6,_0xc94192[_0x1afa('0xa6')]);return db[_0x1afa('0x54')][_0x1afa('0x16')]({'where':_0x427ab6[_0x1afa('0x62')]})[_0x1afa('0x19')](function(_0x9a24fe){_0x4121f1[_0x1afa('0x16')]=_0x9a24fe;if(_0xc94192['query'][_0x1afa('0xa1')]){_0x427ab6[_0x1afa('0xa2')]=[{'all':!![]}];}return db[_0x1afa('0x54')][_0x1afa('0x2e')](_0x427ab6);})[_0x1afa('0x19')](function(_0x4614bb){_0x4121f1[_0x1afa('0xa3')]=_0x4614bb;return _0x4121f1;});}})[_0x1afa('0x19')](respondWithFilteredResult(_0x43a83e,_0x427ab6))[_0x1afa('0x24')](handleError(_0x43a83e,null));};exports[_0x1afa('0xa9')]=function(_0x1c57d5,_0xeb718a){try{if(!_0x1c57d5[_0x1afa('0x38')]['ListId']){throw new Error(_0x1afa('0xaa'));}if(!_0x1c57d5[_0x1afa('0x38')][_0x1afa('0xab')]){throw new Error('No\x20association\x20keys\x20specified!');}if(!_0x1c57d5['body'][_0x1afa('0xac')]){throw new Error('No\x20association\x20values\x20specified!');}if(!_0x1c57d5['body'][_0x1afa('0xad')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x154a6e=_0x1c57d5['body'][_0x1afa('0xab')][_0x1afa('0xae')](',');var _0x42a084=_0x1c57d5[_0x1afa('0x38')]['binding_values'][_0x1afa('0xae')](',');if(!_0x154a6e[_0x1afa('0x2a')]||!_0x42a084[_0x1afa('0x2a')]||_0x154a6e[_0x1afa('0x2a')]!==_0x42a084[_0x1afa('0x2a')]){throw new Error(_0x1afa('0xaf'));}_0x1c57d5['body'][_0x1afa('0x86')]=_[_0x1afa('0xb0')](_0x154a6e,_0x42a084);if(!_0x1c57d5[_0x1afa('0x38')][_0x1afa('0x86')]['phone']){throw new Error(_0x1afa('0xb1'));}if(!_0x1c57d5['body'][_0x1afa('0x86')]['firstName']){throw new Error(_0x1afa('0xb2'));}var _0x439cfc=path['join'](config[_0x1afa('0xb3')],_0x1afa('0xb4'),_0x1c57d5['file'][_0x1afa('0xb5')]);fs['chmodSync'](_0x439cfc,parseInt('0777',0x8));var _0x1c0ee7=require(_0x1afa('0xb6'))[_0x1afa('0xb7')](path[_0x1afa('0x3e')](__dirname,'../../components/import/cm/csv'),[_0x439cfc,_0x1c57d5[_0x1afa('0x38')][_0x1afa('0xab')],_0x1c57d5[_0x1afa('0x38')][_0x1afa('0xac')],_0x1c57d5[_0x1afa('0x38')]['ListId'],_0x1c57d5['body'][_0x1afa('0xb8')],_0x1c57d5[_0x1afa('0x38')]['duplicates'],_0x1c57d5[_0x1afa('0x38')][_0x1afa('0xad')]]);return _0xeb718a[_0x1afa('0x11')](0xc8)['json']({'message':_0x1afa('0xb9'),'pid':_0x1c0ee7['pid']});}catch(_0x339da0){return _0xeb718a[_0x1afa('0x11')](0x1f4)['send'](_0x339da0);}};exports[_0x1afa('0xba')]=function(_0x5d8805,_0x2bc778){var _0x5ba2ea=fs[_0x1afa('0xbb')](_0x5d8805[_0x1afa('0xbc')]['path']);Papa['parse'](_0x5ba2ea,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x45bfc7){return _0x2bc778[_0x1afa('0x11')](0xc8)['json']({'file':_0x5d8805[_0x1afa('0xbc')],'fields':_0x45bfc7[_0x1afa('0xbd')][_0x1afa('0x86')]});}});};exports[_0x1afa('0xbe')]=function(_0x4ed04f,_0xae091){return db[_0x1afa('0xbf')][_0x1afa('0x2e')]({'raw':!![],'attributes':['id'],'where':{'role':_0x1afa('0xc0')}})[_0x1afa('0x19')](function(_0x4894dc){var _0x268d17=![];if(!_0x4ed04f[_0x1afa('0x38')]['ListId']){throw new Error(_0x1afa('0xaa'));}if(!_0x4ed04f[_0x1afa('0x38')][_0x1afa('0xc1')][_0x1afa('0x7e')]){throw new Error(_0x1afa('0xb1'));}if(!_0x4ed04f[_0x1afa('0x38')][_0x1afa('0xc1')][_0x1afa('0xc2')]){throw new Error(_0x1afa('0xb2'));}if(!_0x4ed04f['body'][_0x1afa('0xad')]){throw new Error(_0x1afa('0xc3'));}var _0x337129=require('child_process')[_0x1afa('0xb7')](path[_0x1afa('0x3e')](__dirname,_0x1afa('0xc4')),[_0x4ed04f[_0x1afa('0x27')]['id'],JSON[_0x1afa('0xc5')](_0x4ed04f[_0x1afa('0x38')]),JSON[_0x1afa('0xc5')](_0x4894dc)]);_0x337129['on']('message',function(){_0x268d17=!![];return _0xae091['status'](0xc8)[_0x1afa('0x12')]({'message':_0x1afa('0xc6'),'pid':_0x337129[_0x1afa('0xc7')]});});_0x337129['on']('exit',function(_0x2d05f0){if(_0x2d05f0&&!_0x268d17){return _0xae091[_0x1afa('0x11')](0x1f4)['json']({'message':_0x1afa('0xc8'),'pid':_0x337129['pid']});}});})[_0x1afa('0x24')](handleError(_0xae091,null));};exports[_0x1afa('0xc9')]=function(_0x228fe8,_0x19d07e){return db[_0x1afa('0xbf')]['findAll']({'raw':!![],'attributes':['id'],'where':{'role':_0x1afa('0xc0')}})[_0x1afa('0x19')](function(_0x5aa681){var _0x20182e=![];if(!_0x228fe8['body'][_0x1afa('0x63')]){throw new Error(_0x1afa('0xaa'));}if(!_0x228fe8[_0x1afa('0x38')][_0x1afa('0xc1')]['phone']){throw new Error(_0x1afa('0xb1'));}if(!_0x228fe8[_0x1afa('0x38')]['binding'][_0x1afa('0xc2')]){throw new Error(_0x1afa('0xb2'));}if(!_0x228fe8[_0x1afa('0x38')][_0x1afa('0xad')]){throw new Error(_0x1afa('0xc3'));}var _0x42ce94=require(_0x1afa('0xb6'))['fork'](path[_0x1afa('0x3e')](__dirname,_0x1afa('0xca')),[_0x228fe8[_0x1afa('0x27')]['id'],JSON[_0x1afa('0xc5')](_0x228fe8[_0x1afa('0x38')]),JSON[_0x1afa('0xc5')](_0x5aa681)]);_0x42ce94['on'](_0x1afa('0xcb'),function(){_0x20182e=!![];return _0x19d07e[_0x1afa('0x11')](0xc8)['json']({'message':_0x1afa('0xc6'),'pid':_0x42ce94['pid']});});_0x42ce94['on'](_0x1afa('0xcc'),function(_0x5cf31c){if(_0x5cf31c&&!_0x20182e){return _0x19d07e[_0x1afa('0x11')](0x1f4)['json']({'message':'error\x20child\x20process','pid':_0x42ce94['pid']});}});})[_0x1afa('0x24')](handleError(_0x19d07e,null));};exports[_0x1afa('0xcd')]=function(_0x224a14,_0x2bd2ab){var _0x287d4c=[_0x1afa('0xce'),'chat',_0x1afa('0xcf'),_0x1afa('0xd0'),_0x1afa('0xd1'),_0x1afa('0xd2'),_0x1afa('0xd3')];var _0x217732={'offset':0x0,'order':qs['sort'](_0x1afa('0xd4'))},_0x4ce0d3={'count':0x0,'rows':[]};Promise[_0x1afa('0xd5')]()[_0x1afa('0x19')](function(){if(_0x224a14[_0x1afa('0x6a')][_0x1afa('0xd6')]){if(!_['includes'](_0x287d4c,_0x224a14['query'][_0x1afa('0xd6')][_0x1afa('0xd7')]())){throw new Error('Invalid\x20channel');}_0x287d4c=[_0x224a14['query'][_0x1afa('0xd6')][_0x1afa('0xd7')]()];}if(_0x224a14[_0x1afa('0x6a')][_0x1afa('0xd8')]){try{var _0x2cb428=JSON[_0x1afa('0xd9')](_0x224a14[_0x1afa('0x6a')]['range']);if(!moment(_0x2cb428['from'])['isValid']()){throw new Error(_0x1afa('0xda'));}if(!moment(_0x2cb428['to'])[_0x1afa('0xdb')]()){throw new Error(_0x1afa('0xdc'));}}catch(_0x4cd985){throw new Error('Invalid\x20createdAt\x20filter');}}if(!_0x224a14[_0x1afa('0x6a')][_0x1afa('0x36')]('nolimit')){_0x217732[_0x1afa('0x15')]=qs[_0x1afa('0x15')](_0x224a14['query'][_0x1afa('0x15')]||0xa);_0x217732[_0x1afa('0x13')]=qs['offset'](_0x224a14['query'][_0x1afa('0x13')]);}var _0x49466c=_0x287d4c[_0x1afa('0x73')](function(_0xdcfeed){if(_0xdcfeed===_0x1afa('0xd3')){var _0x46ae77={'attributes':['id',_0x1afa('0xdd'),'type',_0x1afa('0xde'),_0x1afa('0xdf'),_0x1afa('0xe0'),_0x1afa('0xe1'),'endtime',_0x1afa('0xe2'),_0x1afa('0xe3'),_0x1afa('0xe4'),_0x1afa('0xe5'),_0x1afa('0xe6'),_0x1afa('0xe7'),_0x1afa('0xe8')],'where':{'ContactId':_0x224a14[_0x1afa('0x27')]['id']},'include':[{'model':db[_0x1afa('0xbf')],'as':_0x1afa('0xbf'),'attributes':['id',_0x1afa('0x1e'),_0x1afa('0xe9'),'alias']}],'order':[[_0x1afa('0xe4'),_0x1afa('0xea')]]};if(_0x224a14[_0x1afa('0x6a')][_0x1afa('0xd8')]){_0x46ae77[_0x1afa('0x62')]['createdAt']={'$gte':_0x2cb428[_0x1afa('0x3a')],'$lte':_0x2cb428['to']};}return db[_0x1afa('0x4e')][_0x1afa('0xeb')](_0x46ae77)[_0x1afa('0x19')](function(_0x4f96ce){_0x4ce0d3[_0x1afa('0x16')]+=_0x4f96ce['count'];return _[_0x1afa('0x73')](_0x4f96ce[_0x1afa('0xa3')],function(_0x45f340){var _0x20f149=_0x45f340[_0x1afa('0x3b')]({'plain':!![]});_0x20f149[_0x1afa('0xd6')]=_0xdcfeed;if(_0x20f149['User']){_0x20f149[_0x1afa('0xbf')]={'id':_0x20f149[_0x1afa('0xbf')]['id'],'name':_0x20f149[_0x1afa('0xbf')][_0x1afa('0x1e')],'fullname':_0x20f149[_0x1afa('0xbf')][_0x1afa('0xe9')],'alias':_0x20f149[_0x1afa('0xbf')]['alias']};}return _0x20f149;});});}else{var _0x207494=_[_0x1afa('0xec')](_0xdcfeed)+(_0xdcfeed===_0x1afa('0xed')?_0x1afa('0xee'):'Account');var _0x4c0a7c={'attributes':['id',_0x1afa('0xef'),_0x1afa('0xf0'),'createdAt',_0x1afa('0xe3'),'disposition',_0x1afa('0xf1'),_0x1afa('0xf2'),_0x1afa('0xe8'),_0x207494+'Id'],'where':{'ContactId':_0x224a14[_0x1afa('0x27')]['id']},'include':[{'model':db[_0x207494],'as':_0x1afa('0xf3'),'attributes':['id',_0x1afa('0x1e'),_0x1afa('0xf4')]},{'model':db[_0x1afa('0xbf')],'as':_0x1afa('0xf5'),'attributes':['id',_0x1afa('0x1e'),'fullname']},{'model':db[_0x1afa('0x68')],'as':'Tags','attributes':['id',_0x1afa('0x1e'),_0x1afa('0xf6')],'through':{'attributes':[]}}],'order':[[_0x1afa('0xe4'),_0x1afa('0xea')]]};if(_0x224a14[_0x1afa('0x6a')][_0x1afa('0xd8')]){_0x4c0a7c[_0x1afa('0x62')][_0x1afa('0xe4')]={'$gte':_0x2cb428[_0x1afa('0x3a')],'$lte':_0x2cb428['to']};}switch(_0xdcfeed){case _0x1afa('0xed'):_0x4c0a7c['attributes'][_0x1afa('0x61')](_0x1afa('0xf7'),'customerIp',_0x1afa('0xf8'),_0x1afa('0xf9'),'osName',_0x1afa('0xfa'),_0x1afa('0xfb'),_0x1afa('0xfc'),_0x1afa('0xfd'));break;case _0x1afa('0xce'):_0x4c0a7c[_0x1afa('0x87')][_0x1afa('0x61')](_0x1afa('0xfe'),'substatus');break;case _0x1afa('0xd0'):_0x4c0a7c['attributes'][_0x1afa('0x61')](_0x1afa('0xff'),'threadId');break;}return db[_[_0x1afa('0xec')](_0xdcfeed)+_0x1afa('0x100')][_0x1afa('0xeb')](_0x4c0a7c)[_0x1afa('0x19')](function(_0xe51132){_0x4ce0d3[_0x1afa('0x16')]+=_0xe51132[_0x1afa('0x16')];return _[_0x1afa('0x73')](_0xe51132[_0x1afa('0xa3')],function(_0x3ced8b){var _0x53dfb4=_0x3ced8b['get']({'plain':!![]});_0x53dfb4[_0x1afa('0xd6')]=_0xdcfeed;if(_0x53dfb4[_0x1afa('0xf5')]){_0x53dfb4['Owner']={'id':_0x53dfb4['Owner']['id'],'name':_0x53dfb4['Owner'][_0x1afa('0x1e')],'fullname':_0x53dfb4[_0x1afa('0xf5')]['fullname']};}return _0x53dfb4;});});}});return Promise['all'](_0x49466c);})[_0x1afa('0x19')](function(_0x317528){return _(_0x317528)[_0x1afa('0x101')]()[_0x1afa('0x102')](_0x1afa('0xe4'))[_0x1afa('0x103')]()[_0x1afa('0x104')]();})[_0x1afa('0x19')](function(_0x2208ae){_0x4ce0d3['rows']=_0x217732[_0x1afa('0x15')]?_0x2208ae[_0x1afa('0x105')](_0x217732[_0x1afa('0x13')],_0x217732[_0x1afa('0x13')]+_0x217732[_0x1afa('0x15')]):_0x2208ae;return _0x4ce0d3;})['then'](respondWithFilteredResult(_0x2bd2ab,_0x217732))[_0x1afa('0x24')](handleError(_0x2bd2ab,null));}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.events.js b/server/api/cmContact/cmContact.events.js index 8a71868..41cf91d 100644 --- a/server/api/cmContact/cmContact.events.js +++ b/server/api/cmContact/cmContact.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe983=['../../mysqldb','CmContact','save','update','remove','emit','hasOwnProperty','exports'];(function(_0x3ccba2,_0x5b8677){var _0x9f021d=function(_0x360a1b){while(--_0x360a1b){_0x3ccba2['push'](_0x3ccba2['shift']());}};_0x9f021d(++_0x5b8677);}(_0xe983,0x108));var _0x3e98=function(_0x3757a9,_0x55b749){_0x3757a9=_0x3757a9-0x0;var _0x5bbe7c=_0xe983[_0x3757a9];return _0x5bbe7c;};'use strict';var EventEmitter=require('events');var CmContact=require(_0x3e98('0x0'))['db'][_0x3e98('0x1')];var CmContactEvents=new EventEmitter();CmContactEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3e98('0x2'),'afterUpdate':_0x3e98('0x3'),'afterDestroy':_0x3e98('0x4')};function emitEvent(_0x4ed7a0){return function(_0x36c70c,_0x49626,_0x1f789b){CmContactEvents[_0x3e98('0x5')](_0x4ed7a0+':'+_0x36c70c['id'],_0x36c70c);CmContactEvents['emit'](_0x4ed7a0,_0x36c70c);_0x1f789b(null);};}for(var e in events){if(events[_0x3e98('0x6')](e)){var event=events[e];CmContact['hook'](e,emitEvent(event));}}module[_0x3e98('0x7')]=CmContactEvents; \ No newline at end of file +var _0xf749=['update','emit','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','save'];(function(_0x4ddf3e,_0x15b3b8){var _0x290694=function(_0x4ae492){while(--_0x4ae492){_0x4ddf3e['push'](_0x4ddf3e['shift']());}};_0x290694(++_0x15b3b8);}(_0xf749,0x154));var _0x9f74=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0xf749[_0x46e363];return _0x3fb059;};'use strict';var EventEmitter=require(_0x9f74('0x0'));var CmContact=require(_0x9f74('0x1'))['db']['CmContact'];var CmContactEvents=new EventEmitter();CmContactEvents[_0x9f74('0x2')](0x0);var events={'afterCreate':_0x9f74('0x3'),'afterUpdate':_0x9f74('0x4'),'afterDestroy':'remove'};function emitEvent(_0x37b8ca){return function(_0x31219f,_0x36e9a8,_0x550ec2){CmContactEvents['emit'](_0x37b8ca+':'+_0x31219f['id'],_0x31219f);CmContactEvents[_0x9f74('0x5')](_0x37b8ca,_0x31219f);_0x550ec2(null);};}for(var e in events){if(events[_0x9f74('0x6')](e)){var event=events[e];CmContact[_0x9f74('0x7')](e,emitEvent(event));}}module['exports']=CmContactEvents; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.model.js b/server/api/cmContact/cmContact.model.js index 02ffc80..74eb9e0 100644 --- a/server/api/cmContact/cmContact.model.js +++ b/server/api/cmContact/cmContact.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe61c=['create','[OnlyIfOpen]\x20Hopper\x20already\x20exists\x20for\x20contact\x20with\x20phone\x20','always','onlyIfOpen','findAll','outbound','dialCheckDuplicateType','CmList','map','all','Campaign','Lists','BlackLists','CmHopperBlack','exports','define','CmContact','cm_contacts','lastName','fax','email','FULLTEXT','utf8mb4','utf8mb4_unicode_ci','models','get','error','[cmContact][afterCreate]\x20List\x20not\x20found\x20for\x20contact\x20with\x20id\x20','catch','[cmContact][afterCreate]','message','isEmpty','length','ContactId','info','[CmContact][afterDestroy][Succesfull]','inspect','util','api','../../config/environment/shared','./cmContact.attributes','VoiceQueue','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','isNil','dialTimezone','findOne','then','resolve','timezones','utcOffset','add','phone','ListId','priority','callbackUniqueid','assign','CmHopper','[Always]\x20Hopper\x20already\x20exists\x20for\x20contact\x20with\x20phone\x20','\x20in\x20Campaign\x20with\x20id\x20','CmHopperFinal','[Always]\x20Hopper\x20Final\x20already\x20exists\x20for\x20contact\x20with\x20phone\x20','CampaignId','VoiceQueueId'];(function(_0x469665,_0x394876){var _0x291ab5=function(_0x55c1c7){while(--_0x55c1c7){_0x469665['push'](_0x469665['shift']());}};_0x291ab5(++_0x394876);}(_0xe61c,0x16a));var _0xce61=function(_0x1b5aea,_0x1afe6f){_0x1b5aea=_0x1b5aea-0x0;var _0x51cae9=_0xe61c[_0x1b5aea];return _0x51cae9;};'use strict';var _=require('lodash');var util=require(_0xce61('0x0'));var logger=require('../../config/logger')(_0xce61('0x1'));var moment=require('moment');var shared=require(_0xce61('0x2'));var attributes=require(_0xce61('0x3'));function getTimezoneCallbackAt(_0x57a15b,_0x167489,_0x43c80f,_0x1bf338){var _0x284975=_0x1bf338?'Campaign':_0xce61('0x4');var _0x468be8=_0x43c80f[_0xce61('0x5')]?_0x43c80f[_0xce61('0x5')]:moment()[_0xce61('0x6')](_0xce61('0x7'));if(_[_0xce61('0x8')](_0x43c80f[_0xce61('0x9')])){return Promise['resolve'](_0x468be8);}return _0x57a15b[_0x284975][_0xce61('0xa')]({'where':{'id':_0x167489}})[_0xce61('0xb')](function(_0x1abc1a){if(_['isNil'](_0x1abc1a)||_[_0xce61('0x8')](_0x1abc1a[_0xce61('0x9')])){return Promise[_0xce61('0xc')](_0x468be8);}var _0x3b5bd7=shared[_0xce61('0xd')];var _0x4a7775=_0x3b5bd7[_0x1abc1a['dialTimezone']];var _0x48eb42=_0x3b5bd7[_0x43c80f[_0xce61('0x9')]];if(_[_0xce61('0x8')](_0x4a7775)&&_['isNil'](_0x48eb42)){return Promise[_0xce61('0xc')](_0x468be8);}var _0x72a29d=_0x4a7775[_0xce61('0xe')]-_0x48eb42['utcOffset'];var _0x503cb3=_0x43c80f[_0xce61('0x5')]?_0x43c80f[_0xce61('0x5')]:moment();_0x468be8=moment(_0x503cb3)[_0xce61('0xf')](_0x72a29d,'minutes')[_0xce61('0x6')](_0xce61('0x7'));return Promise[_0xce61('0xc')](_0x468be8);});}function getNewHopperPayload(_0x5874da){return{'phone':_0x5874da[_0xce61('0x10')],'ContactId':_0x5874da['id'],'ListId':_0x5874da[_0xce61('0x11')],'scheduledat':_0x5874da['scheduledat']?_0x5874da[_0xce61('0x5')]:moment()[_0xce61('0x6')]('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0x5874da[_0xce61('0x12')]?_0x5874da[_0xce61('0x12')]:0x2,'callback':_0x5874da[_0xce61('0x13')]?!![]:![],'callbackuniqueid':_0x5874da['callbackUniqueid']?_0x5874da['callbackUniqueid']:undefined,'callbackat':_0x5874da['callbackUniqueid']?moment()[_0xce61('0x6')](_0xce61('0x7')):undefined};}function handleAlwaysCheckDuplicate(_0x35d538,_0x3767e2,_0x43b561,_0x347cab){var _0x590b0e={'phone':_0x43b561[_0xce61('0x10')]};var _0x4e85a8={'calleridnum':_0x43b561[_0xce61('0x10')]};if(_0x347cab){Object[_0xce61('0x14')](_0x590b0e,{'CampaignId':_0x3767e2['id']});Object[_0xce61('0x14')](_0x4e85a8,{'CampaignId':_0x3767e2['id']});}else{Object['assign'](_0x590b0e,{'VoiceQueueId':_0x3767e2['id']});Object[_0xce61('0x14')](_0x4e85a8,{'VoiceQueueId':_0x3767e2['id']});}return _0x35d538[_0xce61('0x15')][_0xce61('0xa')]({'where':_0x590b0e})[_0xce61('0xb')](function(_0x265f6b){if(_0x265f6b){throw new Error(_0xce61('0x16')+_0x43b561[_0xce61('0x10')]+_0xce61('0x17')+_0x3767e2['id']);}return _0x35d538[_0xce61('0x18')][_0xce61('0xa')]({'where':_0x4e85a8});})[_0xce61('0xb')](function(_0x4f378c){if(_0x4f378c){throw new Error(_0xce61('0x19')+_0x43b561[_0xce61('0x10')]+'\x20in\x20Campaign\x20with\x20id\x20'+_0x3767e2['id']);}var _0x37fd22=getNewHopperPayload(_0x43b561);if(_0x347cab){_0x37fd22[_0xce61('0x1a')]=_0x3767e2['id'];}else{_0x37fd22[_0xce61('0x1b')]=_0x3767e2['id'];}return _0x35d538[_0xce61('0x15')][_0xce61('0x1c')](_0x37fd22);});}function handleOnlyIfOpenCheckDuplicate(_0x11e3e1,_0x5786ec,_0x185bf9,_0x4b5253){var _0x1ac750={'phone':_0x185bf9[_0xce61('0x10')]};if(_0x4b5253){Object['assign'](_0x1ac750,{'CampaignId':_0x5786ec['id']});}else{Object[_0xce61('0x14')](_0x1ac750,{'VoiceQueueId':_0x5786ec['id']});}return _0x11e3e1[_0xce61('0x15')][_0xce61('0xa')]({'where':_0x1ac750})['then'](function(_0x4be557){if(_0x4be557){throw new Error(_0xce61('0x1d')+_0x185bf9[_0xce61('0x10')]+_0xce61('0x17')+_0x5786ec['id']);}var _0xf5fd5d=getNewHopperPayload(_0x185bf9);if(_0x4b5253){_0xf5fd5d['CampaignId']=_0x5786ec['id'];}else{_0xf5fd5d[_0xce61('0x1b')]=_0x5786ec['id'];}return _0x11e3e1[_0xce61('0x15')]['create'](_0xf5fd5d);});}function handleNeverCheckDuplicate(_0x5b6667,_0x1eae6b,_0x39a0bb){var _0x5a59b7=getNewHopperPayload(_0x39a0bb);_0x5a59b7[_0xce61('0x1b')]=_0x1eae6b['id'];return _0x5b6667['CmHopper'][_0xce61('0x1c')](_0x5a59b7);}function handleCheckDuplicate(_0x5b8f73,_0x3408f3,_0x1d2244,_0x54ad16){return getTimezoneCallbackAt(_0x5b8f73,_0x3408f3,_0x1d2244,_0x54ad16)[_0xce61('0xb')](function(_0x90cae3){_0x1d2244[_0xce61('0x5')]=_0x90cae3;switch(_0x3408f3['dialCheckDuplicateType']){case _0xce61('0x1e'):return handleAlwaysCheckDuplicate(_0x5b8f73,_0x3408f3,_0x1d2244,_0x54ad16);case _0xce61('0x1f'):return handleOnlyIfOpenCheckDuplicate(_0x5b8f73,_0x3408f3,_0x1d2244,_0x54ad16);default:return handleNeverCheckDuplicate(_0x5b8f73,_0x3408f3,_0x1d2244);}});}function createHopperForVoiceQueues(_0x58c10e,_0x84df7){return _0x58c10e[_0xce61('0x4')][_0xce61('0x20')]({'where':{'type':_0xce61('0x21')},'attributes':['id',_0xce61('0x22'),_0xce61('0x9')],'include':[{'model':_0x58c10e[_0xce61('0x23')],'as':'Lists','where':{'id':_0x84df7['ListId']}}],'raw':!![]})[_0xce61('0xb')](function(_0x1b2527){var _0x176a88=_0x1b2527[_0xce61('0x24')](function(_0x4defc0){return handleCheckDuplicate(_0x58c10e,_0x4defc0,_0x84df7,![]);});return Promise[_0xce61('0x25')](_0x176a88);});}function createHopperForCampaigns(_0x471767,_0xb2ac4a){return _0x471767[_0xce61('0x26')]['findAll']({'attributes':['id',_0xce61('0x22'),'dialTimezone'],'include':[{'model':_0x471767['CmList'],'as':_0xce61('0x27'),'where':{'id':_0xb2ac4a['ListId']}}],'raw':!![]})[_0xce61('0xb')](function(_0x2fa059){var _0x572a05=_0x2fa059['map'](function(_0x5575f8){return handleCheckDuplicate(_0x471767,_0x5575f8,_0xb2ac4a,!![]);});return Promise['all'](_0x572a05);});}function createHopperBlackForVoiceQueues(_0x239042,_0x2bc8ff){return _0x239042[_0xce61('0x4')]['findAll']({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':_0x239042['CmList'],'as':_0xce61('0x28'),'where':{'id':_0x2bc8ff[_0xce61('0x11')]}}],'raw':!![]})[_0xce61('0xb')](function(_0x4d6765){var _0xbfe9a3=_0x4d6765[_0xce61('0x24')](function(_0x25c76c){return _0x239042[_0xce61('0x29')][_0xce61('0x1c')]({'phone':_0x2bc8ff['phone'],'ContactId':_0x2bc8ff['id'],'ListId':_0x2bc8ff[_0xce61('0x11')],'VoiceQueueId':_0x25c76c['id']});});return Promise[_0xce61('0x25')](_0xbfe9a3);});}function createHopperBlackForCampaigns(_0x1892fa,_0x1b7af){return _0x1892fa[_0xce61('0x26')]['findAll']({'attributes':['id'],'include':[{'model':_0x1892fa['CmList'],'as':_0xce61('0x28'),'where':{'id':_0x1b7af['ListId']}}],'raw':!![]})[_0xce61('0xb')](function(_0x1365a5){var _0x36d5dd=_0x1365a5['map'](function(_0xb340c8){return _0x1892fa[_0xce61('0x29')]['create']({'phone':_0x1b7af['phone'],'ContactId':_0x1b7af['id'],'ListId':_0x1b7af[_0xce61('0x11')],'CampaignId':_0xb340c8['id']});});return Promise['all'](_0x36d5dd);});}module[_0xce61('0x2a')]=function(_0x292e0e){return _0x292e0e[_0xce61('0x2b')](_0xce61('0x2c'),attributes,{'tableName':_0xce61('0x2d'),'paranoid':!![],'indexes':[{'name':_0xce61('0x10'),'fields':['phone']},{'name':'fti_cm_contacts','fields':['firstName',_0xce61('0x2e'),_0xce61('0x10'),'mobile',_0xce61('0x2f'),_0xce61('0x30')],'type':_0xce61('0x31')}],'timestamps':!![],'charset':_0xce61('0x32'),'collate':_0xce61('0x33'),'hooks':{'afterCreate':function(_0x3ee99e,_0x31b41b,_0x57ebf0){var _0x48ef8e=_0x292e0e[_0xce61('0x34')];var _0xf65d=_0x3ee99e[_0xce61('0x35')]({'plain':!![]});if(!_0xf65d[_0xce61('0x11')]){logger[_0xce61('0x36')](_0xce61('0x37')+_0xf65d['id']);return _0x57ebf0();}if(!_0xf65d['phone']){return _0x57ebf0();}return createHopperForVoiceQueues(_0x48ef8e,_0xf65d)[_0xce61('0xb')](function(){return createHopperBlackForVoiceQueues(_0x48ef8e,_0xf65d);})[_0xce61('0xb')](function(){return createHopperForCampaigns(_0x48ef8e,_0xf65d);})[_0xce61('0xb')](function(){return createHopperBlackForCampaigns(_0x48ef8e,_0xf65d);})[_0xce61('0xb')](function(){return _0x57ebf0();})[_0xce61('0x38')](function(_0x14f804){logger[_0xce61('0x36')](_0xce61('0x39'),_0x14f804[_0xce61('0x3a')]);_0x57ebf0();});},'afterDestroy':function(_0x4008e9,_0xf31331,_0x267723){var _0x50d93a=_0x292e0e['models'];var _0x5ae683=_0x4008e9['get']({'plain':!![]});return _0x50d93a[_0xce61('0x15')][_0xce61('0x20')]({'raw':!![],'where':{'ListId':_0x5ae683[_0xce61('0x11')],'ContactId':_0x5ae683['id']}})[_0xce61('0xb')](function(_0x3d7b78){if(!_[_0xce61('0x3b')](_0x3d7b78)){var _0x3a1504=[];for(var _0x199d94=0x0;_0x199d94<_0x3d7b78[_0xce61('0x3c')];_0x199d94+=0x1){var _0x15be1b=_0x50d93a['CmHopper']['destroy']({'where':{'ListId':_0x3d7b78[_0x199d94][_0xce61('0x11')],'ContactId':_0x3d7b78[_0x199d94][_0xce61('0x3d')],'VoiceQueueId':_0x3d7b78[_0x199d94]['VoiceQueueId'],'CampaignId':_0x3d7b78[_0x199d94][_0xce61('0x1a')]}});_0x3a1504['push'](_0x15be1b);}return Promise[_0xce61('0x25')](_0x3a1504);}})[_0xce61('0xb')](function(_0x244f97){logger[_0xce61('0x3e')](_0xce61('0x3f'),util[_0xce61('0x40')](_0x244f97,{'showHidden':![],'depth':null}));_0x267723();})[_0xce61('0x38')](function(_0x311501){logger[_0xce61('0x36')]('[CmContact][afterDestroy][Error]',util[_0xce61('0x40')](_0x311501,{'showHidden':![],'depth':null}));_0x267723(_0x311501);});}}});}; \ No newline at end of file +var _0x345c=['add','minutes','format','phone','ListId','priority','callbackUniqueid','assign','CmHopper','findOne','\x20in\x20Campaign\x20with\x20id\x20','CmHopperFinal','[Always]\x20Hopper\x20Final\x20already\x20exists\x20for\x20contact\x20with\x20phone\x20','CampaignId','VoiceQueueId','create','[OnlyIfOpen]\x20Hopper\x20already\x20exists\x20for\x20contact\x20with\x20phone\x20','dialCheckDuplicateType','always','onlyIfOpen','findAll','outbound','Lists','all','Campaign','CmList','map','BlackLists','CmHopperBlack','exports','cm_contacts','firstName','mobile','fax','email','FULLTEXT','utf8mb4','utf8mb4_unicode_ci','models','get','error','catch','[cmContact][afterCreate]','message','isEmpty','length','destroy','ContactId','push','info','inspect','[CmContact][afterDestroy][Error]','lodash','util','api','moment','../../config/environment/shared','VoiceQueue','scheduledat','YYYY-MM-DD\x20HH:mm:ss','isNil','dialTimezone','resolve','then','timezones','utcOffset'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x345c,0x17e));var _0xc345=function(_0x306cd0,_0xf33417){_0x306cd0=_0x306cd0-0x0;var _0x52946b=_0x345c[_0x306cd0];return _0x52946b;};'use strict';var _=require(_0xc345('0x0'));var util=require(_0xc345('0x1'));var logger=require('../../config/logger')(_0xc345('0x2'));var moment=require(_0xc345('0x3'));var shared=require(_0xc345('0x4'));var attributes=require('./cmContact.attributes');function getTimezoneCallbackAt(_0x5bd8ff,_0x537bb8,_0x432656,_0x503c6c){var _0x50e0bd=_0x503c6c?'Campaign':_0xc345('0x5');var _0x217170=_0x432656['scheduledat']?_0x432656[_0xc345('0x6')]:moment()['format'](_0xc345('0x7'));if(_[_0xc345('0x8')](_0x432656[_0xc345('0x9')])){return Promise[_0xc345('0xa')](_0x217170);}return _0x5bd8ff[_0x50e0bd]['findOne']({'where':{'id':_0x537bb8}})[_0xc345('0xb')](function(_0x52ac00){if(_[_0xc345('0x8')](_0x52ac00)||_[_0xc345('0x8')](_0x52ac00[_0xc345('0x9')])){return Promise[_0xc345('0xa')](_0x217170);}var _0x5679fc=shared[_0xc345('0xc')];var _0x9dab21=_0x5679fc[_0x52ac00[_0xc345('0x9')]];var _0x19ae4d=_0x5679fc[_0x432656[_0xc345('0x9')]];if(_['isNil'](_0x9dab21)&&_[_0xc345('0x8')](_0x19ae4d)){return Promise[_0xc345('0xa')](_0x217170);}var _0x48e68c=_0x9dab21[_0xc345('0xd')]-_0x19ae4d[_0xc345('0xd')];var _0x3f45d2=_0x432656[_0xc345('0x6')]?_0x432656[_0xc345('0x6')]:moment();_0x217170=moment(_0x3f45d2)[_0xc345('0xe')](_0x48e68c,_0xc345('0xf'))[_0xc345('0x10')]('YYYY-MM-DD\x20HH:mm:ss');return Promise[_0xc345('0xa')](_0x217170);});}function getNewHopperPayload(_0x2a260c){return{'phone':_0x2a260c[_0xc345('0x11')],'ContactId':_0x2a260c['id'],'ListId':_0x2a260c[_0xc345('0x12')],'scheduledat':_0x2a260c[_0xc345('0x6')]?_0x2a260c[_0xc345('0x6')]:moment()[_0xc345('0x10')](_0xc345('0x7')),'priority':_0x2a260c['priority']?_0x2a260c[_0xc345('0x13')]:0x2,'callback':_0x2a260c[_0xc345('0x14')]?!![]:![],'callbackuniqueid':_0x2a260c[_0xc345('0x14')]?_0x2a260c[_0xc345('0x14')]:undefined,'callbackat':_0x2a260c[_0xc345('0x14')]?moment()['format'](_0xc345('0x7')):undefined};}function handleAlwaysCheckDuplicate(_0x168d1e,_0x49b2b4,_0x3cc058,_0x1c73d5){var _0x42ac07={'phone':_0x3cc058[_0xc345('0x11')]};var _0x3f6c2c={'calleridnum':_0x3cc058[_0xc345('0x11')]};if(_0x1c73d5){Object[_0xc345('0x15')](_0x42ac07,{'CampaignId':_0x49b2b4['id']});Object[_0xc345('0x15')](_0x3f6c2c,{'CampaignId':_0x49b2b4['id']});}else{Object[_0xc345('0x15')](_0x42ac07,{'VoiceQueueId':_0x49b2b4['id']});Object[_0xc345('0x15')](_0x3f6c2c,{'VoiceQueueId':_0x49b2b4['id']});}return _0x168d1e[_0xc345('0x16')][_0xc345('0x17')]({'where':_0x42ac07})[_0xc345('0xb')](function(_0x4ff619){if(_0x4ff619){throw new Error('[Always]\x20Hopper\x20already\x20exists\x20for\x20contact\x20with\x20phone\x20'+_0x3cc058[_0xc345('0x11')]+_0xc345('0x18')+_0x49b2b4['id']);}return _0x168d1e[_0xc345('0x19')][_0xc345('0x17')]({'where':_0x3f6c2c});})[_0xc345('0xb')](function(_0x15e9d7){if(_0x15e9d7){throw new Error(_0xc345('0x1a')+_0x3cc058[_0xc345('0x11')]+_0xc345('0x18')+_0x49b2b4['id']);}var _0x140648=getNewHopperPayload(_0x3cc058);if(_0x1c73d5){_0x140648[_0xc345('0x1b')]=_0x49b2b4['id'];}else{_0x140648[_0xc345('0x1c')]=_0x49b2b4['id'];}return _0x168d1e[_0xc345('0x16')][_0xc345('0x1d')](_0x140648);});}function handleOnlyIfOpenCheckDuplicate(_0x36d10a,_0xd91b38,_0x368b1a,_0x5b0606){var _0x2d0013={'phone':_0x368b1a['phone']};if(_0x5b0606){Object[_0xc345('0x15')](_0x2d0013,{'CampaignId':_0xd91b38['id']});}else{Object[_0xc345('0x15')](_0x2d0013,{'VoiceQueueId':_0xd91b38['id']});}return _0x36d10a[_0xc345('0x16')]['findOne']({'where':_0x2d0013})['then'](function(_0x27760b){if(_0x27760b){throw new Error(_0xc345('0x1e')+_0x368b1a[_0xc345('0x11')]+_0xc345('0x18')+_0xd91b38['id']);}var _0x200a96=getNewHopperPayload(_0x368b1a);if(_0x5b0606){_0x200a96[_0xc345('0x1b')]=_0xd91b38['id'];}else{_0x200a96[_0xc345('0x1c')]=_0xd91b38['id'];}return _0x36d10a[_0xc345('0x16')][_0xc345('0x1d')](_0x200a96);});}function handleNeverCheckDuplicate(_0x43184e,_0x5cad14,_0x58565d){var _0xb0ad88=getNewHopperPayload(_0x58565d);_0xb0ad88[_0xc345('0x1c')]=_0x5cad14['id'];return _0x43184e['CmHopper']['create'](_0xb0ad88);}function handleCheckDuplicate(_0x2fa846,_0x190bad,_0xce71f9,_0x5299e0){return getTimezoneCallbackAt(_0x2fa846,_0x190bad,_0xce71f9,_0x5299e0)[_0xc345('0xb')](function(_0x16698a){_0xce71f9[_0xc345('0x6')]=_0x16698a;switch(_0x190bad[_0xc345('0x1f')]){case _0xc345('0x20'):return handleAlwaysCheckDuplicate(_0x2fa846,_0x190bad,_0xce71f9,_0x5299e0);case _0xc345('0x21'):return handleOnlyIfOpenCheckDuplicate(_0x2fa846,_0x190bad,_0xce71f9,_0x5299e0);default:return handleNeverCheckDuplicate(_0x2fa846,_0x190bad,_0xce71f9);}});}function createHopperForVoiceQueues(_0x3640ea,_0x473f3f){return _0x3640ea['VoiceQueue'][_0xc345('0x22')]({'where':{'type':_0xc345('0x23')},'attributes':['id',_0xc345('0x1f'),_0xc345('0x9')],'include':[{'model':_0x3640ea['CmList'],'as':_0xc345('0x24'),'where':{'id':_0x473f3f[_0xc345('0x12')]}}],'raw':!![]})[_0xc345('0xb')](function(_0x2d6cd3){var _0xf6ae42=_0x2d6cd3['map'](function(_0x2c76ab){return handleCheckDuplicate(_0x3640ea,_0x2c76ab,_0x473f3f,![]);});return Promise[_0xc345('0x25')](_0xf6ae42);});}function createHopperForCampaigns(_0x5d280f,_0x2bf554){return _0x5d280f[_0xc345('0x26')][_0xc345('0x22')]({'attributes':['id',_0xc345('0x1f'),'dialTimezone'],'include':[{'model':_0x5d280f[_0xc345('0x27')],'as':_0xc345('0x24'),'where':{'id':_0x2bf554[_0xc345('0x12')]}}],'raw':!![]})[_0xc345('0xb')](function(_0x4463f0){var _0xd270bf=_0x4463f0[_0xc345('0x28')](function(_0x21a01b){return handleCheckDuplicate(_0x5d280f,_0x21a01b,_0x2bf554,!![]);});return Promise['all'](_0xd270bf);});}function createHopperBlackForVoiceQueues(_0x51d4d4,_0x1c434b){return _0x51d4d4[_0xc345('0x5')][_0xc345('0x22')]({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':_0x51d4d4[_0xc345('0x27')],'as':_0xc345('0x29'),'where':{'id':_0x1c434b[_0xc345('0x12')]}}],'raw':!![]})['then'](function(_0x5a5999){var _0x48cd53=_0x5a5999['map'](function(_0x3fa0d1){return _0x51d4d4['CmHopperBlack'][_0xc345('0x1d')]({'phone':_0x1c434b[_0xc345('0x11')],'ContactId':_0x1c434b['id'],'ListId':_0x1c434b[_0xc345('0x12')],'VoiceQueueId':_0x3fa0d1['id']});});return Promise['all'](_0x48cd53);});}function createHopperBlackForCampaigns(_0x2a2c54,_0x1807b1){return _0x2a2c54[_0xc345('0x26')][_0xc345('0x22')]({'attributes':['id'],'include':[{'model':_0x2a2c54[_0xc345('0x27')],'as':_0xc345('0x29'),'where':{'id':_0x1807b1[_0xc345('0x12')]}}],'raw':!![]})[_0xc345('0xb')](function(_0x3b5e38){var _0x53639d=_0x3b5e38[_0xc345('0x28')](function(_0x6f0122){return _0x2a2c54[_0xc345('0x2a')][_0xc345('0x1d')]({'phone':_0x1807b1[_0xc345('0x11')],'ContactId':_0x1807b1['id'],'ListId':_0x1807b1[_0xc345('0x12')],'CampaignId':_0x6f0122['id']});});return Promise[_0xc345('0x25')](_0x53639d);});}module[_0xc345('0x2b')]=function(_0x5eb75f){return _0x5eb75f['define']('CmContact',attributes,{'tableName':_0xc345('0x2c'),'paranoid':!![],'indexes':[{'name':_0xc345('0x11'),'fields':[_0xc345('0x11')]},{'name':'fti_cm_contacts','fields':[_0xc345('0x2d'),'lastName',_0xc345('0x11'),_0xc345('0x2e'),_0xc345('0x2f'),_0xc345('0x30')],'type':_0xc345('0x31')}],'timestamps':!![],'charset':_0xc345('0x32'),'collate':_0xc345('0x33'),'hooks':{'afterCreate':function(_0x4a49e7,_0x34e471,_0x262365){var _0x3db2c2=_0x5eb75f[_0xc345('0x34')];var _0x26501d=_0x4a49e7[_0xc345('0x35')]({'plain':!![]});if(!_0x26501d[_0xc345('0x12')]){logger[_0xc345('0x36')]('[cmContact][afterCreate]\x20List\x20not\x20found\x20for\x20contact\x20with\x20id\x20'+_0x26501d['id']);return _0x262365();}if(!_0x26501d[_0xc345('0x11')]){return _0x262365();}return createHopperForVoiceQueues(_0x3db2c2,_0x26501d)[_0xc345('0xb')](function(){return createHopperBlackForVoiceQueues(_0x3db2c2,_0x26501d);})[_0xc345('0xb')](function(){return createHopperForCampaigns(_0x3db2c2,_0x26501d);})['then'](function(){return createHopperBlackForCampaigns(_0x3db2c2,_0x26501d);})['then'](function(){return _0x262365();})[_0xc345('0x37')](function(_0x5936b2){logger['error'](_0xc345('0x38'),_0x5936b2[_0xc345('0x39')]);_0x262365();});},'afterDestroy':function(_0x2ac892,_0x199686,_0xa16c3c){var _0x25e1bc=_0x5eb75f[_0xc345('0x34')];var _0xd56492=_0x2ac892[_0xc345('0x35')]({'plain':!![]});return _0x25e1bc[_0xc345('0x16')][_0xc345('0x22')]({'raw':!![],'where':{'ListId':_0xd56492['ListId'],'ContactId':_0xd56492['id']}})['then'](function(_0x27d95d){if(!_[_0xc345('0x3a')](_0x27d95d)){var _0x443763=[];for(var _0x425dc9=0x0;_0x425dc9<_0x27d95d[_0xc345('0x3b')];_0x425dc9+=0x1){var _0x113e95=_0x25e1bc[_0xc345('0x16')][_0xc345('0x3c')]({'where':{'ListId':_0x27d95d[_0x425dc9][_0xc345('0x12')],'ContactId':_0x27d95d[_0x425dc9][_0xc345('0x3d')],'VoiceQueueId':_0x27d95d[_0x425dc9][_0xc345('0x1c')],'CampaignId':_0x27d95d[_0x425dc9][_0xc345('0x1b')]}});_0x443763[_0xc345('0x3e')](_0x113e95);}return Promise[_0xc345('0x25')](_0x443763);}})[_0xc345('0xb')](function(_0x452583){logger[_0xc345('0x3f')]('[CmContact][afterDestroy][Succesfull]',util[_0xc345('0x40')](_0x452583,{'showHidden':![],'depth':null}));_0xa16c3c();})[_0xc345('0x37')](function(_0x2b7eed){logger['error'](_0xc345('0x41'),util[_0xc345('0x40')](_0x2b7eed,{'showHidden':![],'depth':null}));_0xa16c3c(_0x2b7eed);});}}});}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.rpc.js b/server/api/cmContact/cmContact.rpc.js index 2d33015..820ea73 100644 --- a/server/api/cmContact/cmContact.rpc.js +++ b/server/api/cmContact/cmContact.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['phone','ListId','Contact','CmContactId','create','body','keys','length','startsWith','update','table','cm_contacts','id\x20=\x20?','sequelize','query','CreateCmContact','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','./cmContact.socket','register','info','CmContact,\x20%s,\x20%s','request\x20sent','debug','CmContact,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetCmContact','CmContact','findAll','options','where','limit','include','map','model','attributes','then','stringify','CmContactHasItem','find'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0xa9e0[_0x1b828b];return _0x98da1a;};'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 squel=require('squel');var db=require(_0x0a9e('0x4'))['db'];var utils=require(_0x0a9e('0x5'));var logger=require(_0x0a9e('0x6'))(_0x0a9e('0x7'));var config=require(_0x0a9e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0a9e('0x9')][_0x0a9e('0xa')]({'port':0x232a});config[_0x0a9e('0xb')]=_['defaults'](config['redis'],{'host':_0x0a9e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0a9e('0xd'))[_0x0a9e('0xe')](socket);function respondWithRpcPromise(_0x307b3e,_0x3ab53f,_0xfeb75b){return new BPromise(function(_0xbd1168,_0x4a4c56){return client['request'](_0x307b3e,_0xfeb75b)['then'](function(_0x4cfe67){logger[_0x0a9e('0xf')](_0x0a9e('0x10'),_0x3ab53f,_0x0a9e('0x11'));logger[_0x0a9e('0x12')](_0x0a9e('0x13'),_0x3ab53f,_0x0a9e('0x11'),JSON['stringify'](_0x4cfe67));if(_0x4cfe67[_0x0a9e('0x14')]){if(_0x4cfe67[_0x0a9e('0x14')][_0x0a9e('0x15')]===0x1f4){logger[_0x0a9e('0x14')](_0x0a9e('0x10'),_0x3ab53f,_0x4cfe67[_0x0a9e('0x14')]['message']);return _0x4a4c56(_0x4cfe67[_0x0a9e('0x14')]['message']);}logger[_0x0a9e('0x14')]('CmContact,\x20%s,\x20%s',_0x3ab53f,_0x4cfe67[_0x0a9e('0x14')][_0x0a9e('0x16')]);return _0xbd1168(_0x4cfe67['error'][_0x0a9e('0x16')]);}else{logger['info'](_0x0a9e('0x10'),_0x3ab53f,_0x0a9e('0x11'));_0xbd1168(_0x4cfe67[_0x0a9e('0x17')][_0x0a9e('0x16')]);}})[_0x0a9e('0x18')](function(_0x2eb11f){logger[_0x0a9e('0x14')](_0x0a9e('0x10'),_0x3ab53f,_0x2eb11f);_0x4a4c56(_0x2eb11f);});});}exports[_0x0a9e('0x19')]=function(_0x112016){var _0x1c696a=this;return new Promise(function(_0x105080,_0x4bb1e3){return db[_0x0a9e('0x1a')][_0x0a9e('0x1b')]({'raw':_0x112016['options']?_0x112016[_0x0a9e('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x112016['options']?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1d')]||null:null,'attributes':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')]['attributes']||null:null,'limit':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1e')]||null:null,'include':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1f')]?_[_0x0a9e('0x20')](_0x112016['options']['include'],function(_0x197ec0){return{'model':db[_0x197ec0[_0x0a9e('0x21')]],'as':_0x197ec0['as'],'attributes':_0x197ec0[_0x0a9e('0x22')],'include':_0x197ec0[_0x0a9e('0x1f')]?_['map'](_0x197ec0[_0x0a9e('0x1f')],function(_0x479bc4){return{'model':db[_0x479bc4[_0x0a9e('0x21')]],'as':_0x479bc4['as'],'attributes':_0x479bc4['attributes'],'include':_0x479bc4[_0x0a9e('0x1f')]?_[_0x0a9e('0x20')](_0x479bc4[_0x0a9e('0x1f')],function(_0x14433c){return{'model':db[_0x14433c[_0x0a9e('0x21')]],'as':_0x14433c['as'],'attributes':_0x14433c[_0x0a9e('0x22')]};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x23')](function(_0x14de77){logger['info'](_0x0a9e('0x19'),_0x112016);logger[_0x0a9e('0x12')](_0x0a9e('0x19'),_0x112016,JSON[_0x0a9e('0x24')](_0x14de77));if(_0x14de77['length']==0x0){return db[_0x0a9e('0x25')][_0x0a9e('0x26')]({'raw':!![],'where':{'item':_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x27')]},'include':[{'model':db[_0x0a9e('0x1a')],'where':{'ListId':_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1d')][_0x0a9e('0x28')],'deletedAt':{'$eq':null}},'as':_0x0a9e('0x29')}]})['then'](function(_0x426950){if(_['isNil'](_0x426950)){_0x105080(_0x14de77);}else{var _0x2407f9=_0x426950[_0x0a9e('0x2a')];return db[_0x0a9e('0x1a')][_0x0a9e('0x1b')]({'raw':!![],'where':{'id':_0x2407f9},'attributes':_0x112016[_0x0a9e('0x1c')]?_0x112016['options'][_0x0a9e('0x22')]||null:null})[_0x0a9e('0x23')](function(_0x40cb85){_0x105080(_0x40cb85);});}});}else{_0x105080(_0x14de77);}})[_0x0a9e('0x18')](function(_0x2b45ea){logger[_0x0a9e('0x14')](_0x0a9e('0x19'),_0x2b45ea[_0x0a9e('0x16')],_0x112016);_0x4bb1e3(_0x1c696a['error'](0x1f4,_0x2b45ea[_0x0a9e('0x16')]));});});};exports['CreateCmContact']=function(_0x2cc7a0){var _0x14b13f=this;return new Promise(function(_0x2b7e7f,_0x3f3d41){return db['CmContact'][_0x0a9e('0x2b')](_0x2cc7a0[_0x0a9e('0x2c')],{'raw':_0x2cc7a0[_0x0a9e('0x1c')]?_0x2cc7a0[_0x0a9e('0x1c')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x1e8694){var _0x5640eb;for(var _0x24936a=0x0;_0x24936a{}\s\\|]/g,'-');_0x59181e(null,util[_0x0a9e('0x26')]('%s-%s%s',path[_0x0a9e('0x27')](_0x5ea472['originalname'],path[_0x0a9e('0x28')](_0x5ea472['originalname'])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x5ea472[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')](_0x0a9e('0x2a'),upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3652a7,_0x468813,_0x2b1f27){_0x2b1f27(null,path[_0x0a9e('0x21')](config['root'],_0x0a9e('0x23')));},'filename':function(_0x40e7a3,_0x1843b2,_0x824a4f){_0x1843b2[_0x0a9e('0x24')]=_0x1843b2[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x824a4f(null,util[_0x0a9e('0x26')](_0x0a9e('0x2e'),path['basename'](_0x1843b2[_0x0a9e('0x24')],path['extname'](_0x1843b2[_0x0a9e('0x24')])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x1843b2[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')]('/upload',upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2f')]);router[_0x0a9e('0x18')](_0x0a9e('0x30'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x31')]);router[_0x0a9e('0x18')]('/uploadUpdates/:id',auth[_0x0a9e('0xd')](),controller['importUpdates']);router[_0x0a9e('0x32')](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x34')]);router['delete'](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x35')]);module[_0x0a9e('0x36')]=router; \ No newline at end of file +var _0xa9e0=['basename','extname','now','/csv','single','file','uploadCsv','%s-%s%s','upload','/upload/:id','import','put','/:id','update','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContact.controller','get','index','/describe','show','/:id/tags','isAuthenticated','getTags','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','/:id/journey','getJourney','post','create','/create_many','bulkCreate','setTags','setAdditionalPhones','/:id/duplicateAdditionalPhones','/:id/rescheduleAdditionalPhones','rescheduleAdditionalPhones','join','root','server/files/tmp','originalname','replace','format'];(function(_0xecd224,_0x10b2cb){var _0x1d4a63=function(_0x53f3e3){while(--_0x53f3e3){_0xecd224['push'](_0xecd224['shift']());}};_0x1d4a63(++_0x10b2cb);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xa9e0[_0xbe200f];return _0x192597;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/phones',auth['isAuthenticated'](),controller['getAdditionalPhones']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getHopperHistories']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x18')]('/merge',auth[_0x0a9e('0xd')](),controller['merge']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/phones',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x1e'),auth['isAuthenticated'](),controller['duplicateAdditionalPhones']);router[_0x0a9e('0x18')](_0x0a9e('0x1f'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xfb6e48,_0x2fb0e4,_0x3b45bc){_0x3b45bc(null,path[_0x0a9e('0x21')](config[_0x0a9e('0x22')],_0x0a9e('0x23')));},'filename':function(_0x16b1ca,_0x5ea472,_0x59181e){_0x5ea472[_0x0a9e('0x24')]=_0x5ea472[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x59181e(null,util[_0x0a9e('0x26')]('%s-%s%s',path[_0x0a9e('0x27')](_0x5ea472['originalname'],path[_0x0a9e('0x28')](_0x5ea472['originalname'])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x5ea472[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')](_0x0a9e('0x2a'),upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3652a7,_0x468813,_0x2b1f27){_0x2b1f27(null,path[_0x0a9e('0x21')](config['root'],_0x0a9e('0x23')));},'filename':function(_0x40e7a3,_0x1843b2,_0x824a4f){_0x1843b2[_0x0a9e('0x24')]=_0x1843b2[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x824a4f(null,util[_0x0a9e('0x26')](_0x0a9e('0x2e'),path['basename'](_0x1843b2[_0x0a9e('0x24')],path['extname'](_0x1843b2[_0x0a9e('0x24')])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x1843b2[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')]('/upload',upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2f')]);router[_0x0a9e('0x18')](_0x0a9e('0x30'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x31')]);router[_0x0a9e('0x18')]('/uploadUpdates/:id',auth[_0x0a9e('0xd')](),controller['importUpdates']);router[_0x0a9e('0x32')](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x34')]);router['delete'](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x35')]);module[_0x0a9e('0x36')]=router; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.attributes.js b/server/api/cmContactHasItem/cmContactHasItem.attributes.js index 40d047c..3794d29 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.attributes.js +++ b/server/api/cmContactHasItem/cmContactHasItem.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe58a=['sequelize','exports','INTEGER'];(function(_0x524507,_0x2eee9d){var _0x20a7d2=function(_0xf60a7b){while(--_0xf60a7b){_0x524507['push'](_0x524507['shift']());}};_0x20a7d2(++_0x2eee9d);}(_0xe58a,0x9f));var _0xae58=function(_0x4f9c2c,_0x52e65d){_0x4f9c2c=_0x4f9c2c-0x0;var _0x3a55be=_0xe58a[_0x4f9c2c];return _0x3a55be;};'use strict';var Sequelize=require(_0xae58('0x0'));module[_0xae58('0x1')]={'CmContactId':{'type':Sequelize[_0xae58('0x2')],'primaryKey':!![]},'item':{'type':Sequelize['STRING'],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0xae58('0x2')],'defaultValue':null},'ItemClass':{'type':Sequelize['STRING'],'defaultValue':'PHONE'},'OrderBy':{'type':Sequelize[_0xae58('0x2')],'defaultValue':null},'description':{'type':Sequelize['STRING'],'defaultValue':null}}; \ No newline at end of file +var _0x8e0d=['INTEGER','PHONE','sequelize','STRING'];(function(_0xd63313,_0x2cbb99){var _0xa2d17e=function(_0x481d5d){while(--_0x481d5d){_0xd63313['push'](_0xd63313['shift']());}};_0xa2d17e(++_0x2cbb99);}(_0x8e0d,0x82));var _0xd8e0=function(_0x54b283,_0x5eb8a6){_0x54b283=_0x54b283-0x0;var _0x2462b3=_0x8e0d[_0x54b283];return _0x2462b3;};'use strict';var Sequelize=require(_0xd8e0('0x0'));module['exports']={'CmContactId':{'type':Sequelize['INTEGER'],'primaryKey':!![]},'item':{'type':Sequelize[_0xd8e0('0x1')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0xd8e0('0x2')],'defaultValue':null},'ItemClass':{'type':Sequelize['STRING'],'defaultValue':_0xd8e0('0x3')},'OrderBy':{'type':Sequelize[_0xd8e0('0x2')],'defaultValue':null},'description':{'type':Sequelize[_0xd8e0('0x1')],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.controller.js b/server/api/cmContactHasItem/cmContactHasItem.controller.js index 30f759e..4a24b1a 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.controller.js +++ b/server/api/cmContactHasItem/cmContactHasItem.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc630=['params','keys','find','user','get','role','CmContactHasItems','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','request-promise','moment','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','UserProfileResource','sendStatus','error','name','rawAttributes','fieldName','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','CmContactHasItem','findAll','rows','catch'];(function(_0x6de297,_0x4163ed){var _0x9cde6d=function(_0x4928da){while(--_0x4928da){_0x6de297['push'](_0x6de297['shift']());}};_0x9cde6d(++_0x4163ed);}(_0xc630,0x1f0));var _0x0c63=function(_0x5c6067,_0x4e0ce3){_0x5c6067=_0x5c6067-0x0;var _0x3d31d3=_0xc630[_0x5c6067];return _0x3d31d3;};'use strict';var emlformat=require(_0x0c63('0x0'));var rimraf=require(_0x0c63('0x1'));var zipdir=require(_0x0c63('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0c63('0x3'));var moment=require(_0x0c63('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x0c63('0x5'));var sox=require(_0x0c63('0x6'));var csv=require(_0x0c63('0x7'));var ejs=require(_0x0c63('0x8'));var fs=require('fs');var fs_extra=require(_0x0c63('0x9'));var _=require('lodash');var squel=require(_0x0c63('0xa'));var crypto=require(_0x0c63('0xb'));var jsforce=require(_0x0c63('0xc'));var deskjs=require(_0x0c63('0xd'));var toCsv=require(_0x0c63('0x7'));var querystring=require(_0x0c63('0xe'));var Papa=require(_0x0c63('0xf'));var Redis=require(_0x0c63('0x10'));var authService=require(_0x0c63('0x11'));var qs=require(_0x0c63('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0c63('0x13'));var logger=require(_0x0c63('0x14'))(_0x0c63('0x15'));var utils=require(_0x0c63('0x16'));var config=require(_0x0c63('0x17'));var licenseUtil=require(_0x0c63('0x18'));var db=require(_0x0c63('0x19'))['db'];function respondWithStatusCode(_0x54be2e,_0x307a51){_0x307a51=_0x307a51||0xcc;return function(_0x1fac45){if(_0x1fac45){return _0x54be2e['sendStatus'](_0x307a51);}return _0x54be2e[_0x0c63('0x1a')](_0x307a51)['end']();};}function respondWithResult(_0x224a41,_0x4c83ff){_0x4c83ff=_0x4c83ff||0xc8;return function(_0x2583b5){if(_0x2583b5){return _0x224a41[_0x0c63('0x1a')](_0x4c83ff)[_0x0c63('0x1b')](_0x2583b5);}};}function respondWithFilteredResult(_0x1c166c,_0x3d04ba){return function(_0x5acc99){if(_0x5acc99){var _0x3a3f5a=typeof _0x3d04ba[_0x0c63('0x1c')]===_0x0c63('0x1d')&&typeof _0x3d04ba['limit']===_0x0c63('0x1d');var _0x55815d=_0x5acc99[_0x0c63('0x1e')];var _0x35abe8=_0x3a3f5a?0x0:_0x3d04ba['offset'];var _0xb44a09=_0x3a3f5a?_0x5acc99['count']:_0x3d04ba[_0x0c63('0x1c')]+_0x3d04ba[_0x0c63('0x1f')];var _0x1ba378;if(_0xb44a09>=_0x55815d){_0xb44a09=_0x55815d;_0x1ba378=0xc8;}else{_0x1ba378=0xce;}_0x1c166c['status'](_0x1ba378);return _0x1c166c[_0x0c63('0x20')](_0x0c63('0x21'),_0x35abe8+'-'+_0xb44a09+'/'+_0x55815d)['json'](_0x5acc99);}return null;};}function patchUpdates(_0x3baf95){return function(_0x52f342){try{jsonpatch[_0x0c63('0x22')](_0x52f342,_0x3baf95,!![]);}catch(_0x3eb599){return BPromise[_0x0c63('0x23')](_0x3eb599);}return _0x52f342['save']();};}function saveUpdates(_0x1af4b4,_0x42ebe8){return function(_0x281cb8){if(_0x281cb8){return _0x281cb8[_0x0c63('0x24')](_0x1af4b4)[_0x0c63('0x25')](function(_0x26d916){return _0x26d916;});}return null;};}function removeEntity(_0x2e12cc,_0x38df23){return function(_0xa97ee6){if(_0xa97ee6){return _0xa97ee6[_0x0c63('0x26')]()[_0x0c63('0x25')](function(){var _0x4bd2b7=_0xa97ee6['get']({'plain':!![]});var _0x382c45='CmContactHasItems';return db[_0x0c63('0x27')][_0x0c63('0x26')]({'where':{'type':_0x382c45,'resourceId':_0x4bd2b7['id']}})[_0x0c63('0x25')](function(){return _0xa97ee6;});})[_0x0c63('0x25')](function(){_0x2e12cc[_0x0c63('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x408810,_0x4847bd){return function(_0x34b669){if(!_0x34b669){_0x408810[_0x0c63('0x28')](0x194);}return _0x34b669;};}function handleError(_0xb95100,_0x2de83c){_0x2de83c=_0x2de83c||0x1f4;return function(_0x3055f8){logger[_0x0c63('0x29')](_0x3055f8['stack']);if(_0x3055f8[_0x0c63('0x2a')]){delete _0x3055f8[_0x0c63('0x2a')];}_0xb95100['status'](_0x2de83c)['send'](_0x3055f8);};}exports['index']=function(_0x5b8a0d,_0x1678f6){var _0x4eb3c9={},_0x4e63e0={},_0x2fd20f={'count':0x0,'rows':[]};var _0x40fc9b=_['map'](db['CmContactHasItem'][_0x0c63('0x2b')],function(_0x40bbd5){return{'name':_0x40bbd5[_0x0c63('0x2c')],'type':_0x40bbd5['type'][_0x0c63('0x2d')]};});_0x4e63e0[_0x0c63('0x2e')]=_[_0x0c63('0x2f')](_0x40fc9b,_0x0c63('0x2a'));_0x4e63e0[_0x0c63('0x30')]=_['keys'](_0x5b8a0d[_0x0c63('0x30')]);_0x4e63e0[_0x0c63('0x31')]=_[_0x0c63('0x32')](_0x4e63e0['model'],_0x4e63e0[_0x0c63('0x30')]);_0x4eb3c9[_0x0c63('0x33')]=_[_0x0c63('0x32')](_0x4e63e0[_0x0c63('0x2e')],qs[_0x0c63('0x34')](_0x5b8a0d[_0x0c63('0x30')][_0x0c63('0x34')]));_0x4eb3c9[_0x0c63('0x33')]=_0x4eb3c9[_0x0c63('0x33')][_0x0c63('0x35')]?_0x4eb3c9[_0x0c63('0x33')]:_0x4e63e0[_0x0c63('0x2e')];if(!_0x5b8a0d[_0x0c63('0x30')][_0x0c63('0x36')](_0x0c63('0x37'))){_0x4eb3c9[_0x0c63('0x1f')]=qs[_0x0c63('0x1f')](_0x5b8a0d[_0x0c63('0x30')][_0x0c63('0x1f')]);_0x4eb3c9['offset']=qs[_0x0c63('0x1c')](_0x5b8a0d[_0x0c63('0x30')][_0x0c63('0x1c')]);}_0x4eb3c9[_0x0c63('0x38')]=qs[_0x0c63('0x39')](_0x5b8a0d[_0x0c63('0x30')][_0x0c63('0x39')]);_0x4eb3c9[_0x0c63('0x3a')]=qs[_0x0c63('0x31')](_[_0x0c63('0x3b')](_0x5b8a0d[_0x0c63('0x30')],_0x4e63e0[_0x0c63('0x31')]),_0x40fc9b);if(_0x5b8a0d[_0x0c63('0x30')][_0x0c63('0x3c')]){_0x4eb3c9['where']=_[_0x0c63('0x3d')](_0x4eb3c9[_0x0c63('0x3a')],{'$or':_['map'](_0x40fc9b,function(_0x5d2f23){if(_0x5d2f23[_0x0c63('0x3e')]!==_0x0c63('0x3f')){var _0xfc1942={};_0xfc1942[_0x5d2f23[_0x0c63('0x2a')]]={'$like':'%'+_0x5b8a0d['query']['filter']+'%'};return _0xfc1942;}})});}_0x4eb3c9=_[_0x0c63('0x3d')]({},_0x4eb3c9,_0x5b8a0d[_0x0c63('0x40')]);var _0x4228c4={'where':_0x4eb3c9[_0x0c63('0x3a')]};return db['CmContactHasItem']['count'](_0x4228c4)[_0x0c63('0x25')](function(_0x10697b){_0x2fd20f[_0x0c63('0x1e')]=_0x10697b;if(_0x5b8a0d[_0x0c63('0x30')][_0x0c63('0x41')]){_0x4eb3c9[_0x0c63('0x42')]=[{'all':!![]}];}return db[_0x0c63('0x43')][_0x0c63('0x44')](_0x4eb3c9);})['then'](function(_0x5dcc5a){_0x2fd20f[_0x0c63('0x45')]=_0x5dcc5a;return _0x2fd20f;})[_0x0c63('0x25')](respondWithFilteredResult(_0x1678f6,_0x4eb3c9))[_0x0c63('0x46')](handleError(_0x1678f6,null));};exports['show']=function(_0x3d1c5a,_0x47c1cb){var _0x1b0047={'raw':!![],'where':{'id':_0x3d1c5a[_0x0c63('0x47')]['id']}},_0x8aa1b7={};_0x8aa1b7[_0x0c63('0x2e')]=_[_0x0c63('0x48')](db[_0x0c63('0x43')]['rawAttributes']);_0x8aa1b7['query']=_[_0x0c63('0x48')](_0x3d1c5a['query']);_0x8aa1b7[_0x0c63('0x31')]=_[_0x0c63('0x32')](_0x8aa1b7[_0x0c63('0x2e')],_0x8aa1b7[_0x0c63('0x30')]);_0x1b0047[_0x0c63('0x33')]=_[_0x0c63('0x32')](_0x8aa1b7[_0x0c63('0x2e')],qs['fields'](_0x3d1c5a[_0x0c63('0x30')]['fields']));_0x1b0047[_0x0c63('0x33')]=_0x1b0047[_0x0c63('0x33')][_0x0c63('0x35')]?_0x1b0047['attributes']:_0x8aa1b7[_0x0c63('0x2e')];if(_0x3d1c5a['query'][_0x0c63('0x41')]){_0x1b0047['include']=[{'all':!![]}];}_0x1b0047=_['merge']({},_0x1b0047,_0x3d1c5a[_0x0c63('0x40')]);return db[_0x0c63('0x43')][_0x0c63('0x49')](_0x1b0047)[_0x0c63('0x25')](handleEntityNotFound(_0x47c1cb,null))[_0x0c63('0x25')](respondWithResult(_0x47c1cb,null))[_0x0c63('0x46')](handleError(_0x47c1cb,null));};exports['create']=function(_0x7f4978,_0x2710ba){return db[_0x0c63('0x43')]['create'](_0x7f4978['body'],{})[_0x0c63('0x25')](function(_0x4c7ac4){var _0x3ee854=_0x7f4978[_0x0c63('0x4a')][_0x0c63('0x4b')]({'plain':!![]});if(!_0x3ee854)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3ee854[_0x0c63('0x4c')]===_0x0c63('0x4a')){var _0x5cd762=_0x4c7ac4[_0x0c63('0x4b')]({'plain':!![]});var _0x29ffa8=_0x0c63('0x4d');return db['UserProfileSection'][_0x0c63('0x49')]({'where':{'name':_0x29ffa8,'userProfileId':_0x3ee854['userProfileId']},'raw':!![]})['then'](function(_0x4183a9){if(_0x4183a9&&_0x4183a9[_0x0c63('0x4e')]===0x0){return db[_0x0c63('0x27')]['create']({'name':_0x5cd762[_0x0c63('0x2a')],'resourceId':_0x5cd762['id'],'type':_0x4183a9['name'],'sectionId':_0x4183a9['id']},{})[_0x0c63('0x25')](function(){return _0x4c7ac4;});}else{return _0x4c7ac4;}})[_0x0c63('0x46')](function(_0x6bcbdd){logger[_0x0c63('0x29')](_0x0c63('0x4f'),_0x6bcbdd);throw _0x6bcbdd;});}return _0x4c7ac4;})[_0x0c63('0x25')](respondWithResult(_0x2710ba,0xc9))[_0x0c63('0x46')](handleError(_0x2710ba,null));};exports[_0x0c63('0x24')]=function(_0x5e8d4c,_0x3da8aa){if(_0x5e8d4c[_0x0c63('0x50')]['id']){delete _0x5e8d4c[_0x0c63('0x50')]['id'];}return db[_0x0c63('0x43')][_0x0c63('0x49')]({'where':{'id':_0x5e8d4c[_0x0c63('0x47')]['id']}})[_0x0c63('0x25')](handleEntityNotFound(_0x3da8aa,null))['then'](saveUpdates(_0x5e8d4c[_0x0c63('0x50')],null))[_0x0c63('0x25')](respondWithResult(_0x3da8aa,null))[_0x0c63('0x46')](handleError(_0x3da8aa,null));};exports['destroy']=function(_0x2638f2,_0x48178d){return db[_0x0c63('0x43')][_0x0c63('0x49')]({'where':{'id':_0x2638f2[_0x0c63('0x47')]['id']}})['then'](handleEntityNotFound(_0x48178d,null))['then'](removeEntity(_0x48178d,null))[_0x0c63('0x46')](handleError(_0x48178d,null));}; \ No newline at end of file +var _0xbf01=['map','name','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','sort','where','filter','merge','options','includeAll','include','findAll','params','keys','rawAttributes','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','fast-json-patch','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','status','end','offset','undefined','count','reject','save','update','destroy','get','CmContactHasItems','UserProfileResource','then','sendStatus','error','stack','send','CmContactHasItem','fieldName','type','key','model'];(function(_0x4aa2c5,_0x40ec93){var _0x1d5c57=function(_0x13a9b4){while(--_0x13a9b4){_0x4aa2c5['push'](_0x4aa2c5['shift']());}};_0x1d5c57(++_0x40ec93);}(_0xbf01,0x6a));var _0x1bf0=function(_0x204ad4,_0x502841){_0x204ad4=_0x204ad4-0x0;var _0x50675f=_0xbf01[_0x204ad4];return _0x50675f;};'use strict';var emlformat=require(_0x1bf0('0x0'));var rimraf=require(_0x1bf0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1bf0('0x2'));var rp=require('request-promise');var moment=require(_0x1bf0('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x1bf0('0x4'));var util=require('util');var path=require(_0x1bf0('0x5'));var sox=require(_0x1bf0('0x6'));var csv=require(_0x1bf0('0x7'));var ejs=require(_0x1bf0('0x8'));var fs=require('fs');var fs_extra=require(_0x1bf0('0x9'));var _=require(_0x1bf0('0xa'));var squel=require(_0x1bf0('0xb'));var crypto=require(_0x1bf0('0xc'));var jsforce=require(_0x1bf0('0xd'));var deskjs=require(_0x1bf0('0xe'));var toCsv=require(_0x1bf0('0x7'));var querystring=require(_0x1bf0('0xf'));var Papa=require(_0x1bf0('0x10'));var Redis=require(_0x1bf0('0x11'));var authService=require(_0x1bf0('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x1bf0('0x13'));var hardwareService=require(_0x1bf0('0x14'));var logger=require('../../config/logger')(_0x1bf0('0x15'));var utils=require(_0x1bf0('0x16'));var config=require(_0x1bf0('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4d7912,_0x484e83){_0x484e83=_0x484e83||0xcc;return function(_0x295062){if(_0x295062){return _0x4d7912['sendStatus'](_0x484e83);}return _0x4d7912[_0x1bf0('0x18')](_0x484e83)[_0x1bf0('0x19')]();};}function respondWithResult(_0x4c63fd,_0x20d3cd){_0x20d3cd=_0x20d3cd||0xc8;return function(_0xfd8d66){if(_0xfd8d66){return _0x4c63fd[_0x1bf0('0x18')](_0x20d3cd)['json'](_0xfd8d66);}};}function respondWithFilteredResult(_0x1b0ad2,_0x160e2f){return function(_0xa50ec9){if(_0xa50ec9){var _0x5e11dd=typeof _0x160e2f[_0x1bf0('0x1a')]===_0x1bf0('0x1b')&&typeof _0x160e2f['limit']===_0x1bf0('0x1b');var _0x3b23ae=_0xa50ec9[_0x1bf0('0x1c')];var _0xb38efd=_0x5e11dd?0x0:_0x160e2f[_0x1bf0('0x1a')];var _0x3d282b=_0x5e11dd?_0xa50ec9['count']:_0x160e2f[_0x1bf0('0x1a')]+_0x160e2f['limit'];var _0x900673;if(_0x3d282b>=_0x3b23ae){_0x3d282b=_0x3b23ae;_0x900673=0xc8;}else{_0x900673=0xce;}_0x1b0ad2['status'](_0x900673);return _0x1b0ad2['set']('Content-Range',_0xb38efd+'-'+_0x3d282b+'/'+_0x3b23ae)['json'](_0xa50ec9);}return null;};}function patchUpdates(_0x53021d){return function(_0x168cbd){try{jsonpatch['apply'](_0x168cbd,_0x53021d,!![]);}catch(_0x28896b){return BPromise[_0x1bf0('0x1d')](_0x28896b);}return _0x168cbd[_0x1bf0('0x1e')]();};}function saveUpdates(_0x320cbb,_0x26eecd){return function(_0x5c06cf){if(_0x5c06cf){return _0x5c06cf[_0x1bf0('0x1f')](_0x320cbb)['then'](function(_0x5d644d){return _0x5d644d;});}return null;};}function removeEntity(_0x5a3d64,_0x20f10f){return function(_0x302899){if(_0x302899){return _0x302899[_0x1bf0('0x20')]()['then'](function(){var _0x2330af=_0x302899[_0x1bf0('0x21')]({'plain':!![]});var _0x3b21c1=_0x1bf0('0x22');return db[_0x1bf0('0x23')]['destroy']({'where':{'type':_0x3b21c1,'resourceId':_0x2330af['id']}})[_0x1bf0('0x24')](function(){return _0x302899;});})['then'](function(){_0x5a3d64[_0x1bf0('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x43a7ac,_0xee8606){return function(_0x1ea746){if(!_0x1ea746){_0x43a7ac[_0x1bf0('0x25')](0x194);}return _0x1ea746;};}function handleError(_0x41acd8,_0x38b3f7){_0x38b3f7=_0x38b3f7||0x1f4;return function(_0x28e8dd){logger[_0x1bf0('0x26')](_0x28e8dd[_0x1bf0('0x27')]);if(_0x28e8dd['name']){delete _0x28e8dd['name'];}_0x41acd8[_0x1bf0('0x18')](_0x38b3f7)[_0x1bf0('0x28')](_0x28e8dd);};}exports['index']=function(_0x117d1b,_0x572da6){var _0x4a93a3={},_0x4c3b5d={},_0x48caf2={'count':0x0,'rows':[]};var _0x57946e=_['map'](db[_0x1bf0('0x29')]['rawAttributes'],function(_0x16560e){return{'name':_0x16560e[_0x1bf0('0x2a')],'type':_0x16560e[_0x1bf0('0x2b')][_0x1bf0('0x2c')]};});_0x4c3b5d[_0x1bf0('0x2d')]=_[_0x1bf0('0x2e')](_0x57946e,_0x1bf0('0x2f'));_0x4c3b5d[_0x1bf0('0x30')]=_['keys'](_0x117d1b[_0x1bf0('0x30')]);_0x4c3b5d[_0x1bf0('0x31')]=_[_0x1bf0('0x32')](_0x4c3b5d[_0x1bf0('0x2d')],_0x4c3b5d[_0x1bf0('0x30')]);_0x4a93a3[_0x1bf0('0x33')]=_['intersection'](_0x4c3b5d[_0x1bf0('0x2d')],qs['fields'](_0x117d1b[_0x1bf0('0x30')][_0x1bf0('0x34')]));_0x4a93a3[_0x1bf0('0x33')]=_0x4a93a3[_0x1bf0('0x33')]['length']?_0x4a93a3[_0x1bf0('0x33')]:_0x4c3b5d[_0x1bf0('0x2d')];if(!_0x117d1b['query'][_0x1bf0('0x35')](_0x1bf0('0x36'))){_0x4a93a3['limit']=qs[_0x1bf0('0x37')](_0x117d1b['query']['limit']);_0x4a93a3['offset']=qs['offset'](_0x117d1b['query']['offset']);}_0x4a93a3['order']=qs[_0x1bf0('0x38')](_0x117d1b['query'][_0x1bf0('0x38')]);_0x4a93a3[_0x1bf0('0x39')]=qs['filters'](_['pick'](_0x117d1b[_0x1bf0('0x30')],_0x4c3b5d[_0x1bf0('0x31')]),_0x57946e);if(_0x117d1b[_0x1bf0('0x30')][_0x1bf0('0x3a')]){_0x4a93a3['where']=_['merge'](_0x4a93a3[_0x1bf0('0x39')],{'$or':_[_0x1bf0('0x2e')](_0x57946e,function(_0x551ef2){if(_0x551ef2[_0x1bf0('0x2b')]!=='VIRTUAL'){var _0x2169c1={};_0x2169c1[_0x551ef2[_0x1bf0('0x2f')]]={'$like':'%'+_0x117d1b[_0x1bf0('0x30')][_0x1bf0('0x3a')]+'%'};return _0x2169c1;}})});}_0x4a93a3=_[_0x1bf0('0x3b')]({},_0x4a93a3,_0x117d1b[_0x1bf0('0x3c')]);var _0x36c24f={'where':_0x4a93a3[_0x1bf0('0x39')]};return db[_0x1bf0('0x29')][_0x1bf0('0x1c')](_0x36c24f)[_0x1bf0('0x24')](function(_0x392761){_0x48caf2['count']=_0x392761;if(_0x117d1b[_0x1bf0('0x30')][_0x1bf0('0x3d')]){_0x4a93a3[_0x1bf0('0x3e')]=[{'all':!![]}];}return db[_0x1bf0('0x29')][_0x1bf0('0x3f')](_0x4a93a3);})[_0x1bf0('0x24')](function(_0xa312bb){_0x48caf2['rows']=_0xa312bb;return _0x48caf2;})[_0x1bf0('0x24')](respondWithFilteredResult(_0x572da6,_0x4a93a3))['catch'](handleError(_0x572da6,null));};exports['show']=function(_0x2c277b,_0x4909ac){var _0x2a1567={'raw':!![],'where':{'id':_0x2c277b[_0x1bf0('0x40')]['id']}},_0x8c2115={};_0x8c2115['model']=_[_0x1bf0('0x41')](db[_0x1bf0('0x29')][_0x1bf0('0x42')]);_0x8c2115[_0x1bf0('0x30')]=_['keys'](_0x2c277b[_0x1bf0('0x30')]);_0x8c2115[_0x1bf0('0x31')]=_['intersection'](_0x8c2115[_0x1bf0('0x2d')],_0x8c2115[_0x1bf0('0x30')]);_0x2a1567[_0x1bf0('0x33')]=_[_0x1bf0('0x32')](_0x8c2115['model'],qs[_0x1bf0('0x34')](_0x2c277b[_0x1bf0('0x30')][_0x1bf0('0x34')]));_0x2a1567['attributes']=_0x2a1567[_0x1bf0('0x33')]['length']?_0x2a1567[_0x1bf0('0x33')]:_0x8c2115[_0x1bf0('0x2d')];if(_0x2c277b[_0x1bf0('0x30')][_0x1bf0('0x3d')]){_0x2a1567[_0x1bf0('0x3e')]=[{'all':!![]}];}_0x2a1567=_[_0x1bf0('0x3b')]({},_0x2a1567,_0x2c277b['options']);return db[_0x1bf0('0x29')][_0x1bf0('0x43')](_0x2a1567)[_0x1bf0('0x24')](handleEntityNotFound(_0x4909ac,null))[_0x1bf0('0x24')](respondWithResult(_0x4909ac,null))[_0x1bf0('0x44')](handleError(_0x4909ac,null));};exports[_0x1bf0('0x45')]=function(_0x14e3e5,_0x10c0c4){return db[_0x1bf0('0x29')]['create'](_0x14e3e5['body'],{})['then'](function(_0x866eb1){var _0x5f4fb3=_0x14e3e5[_0x1bf0('0x46')][_0x1bf0('0x21')]({'plain':!![]});if(!_0x5f4fb3)throw new Error(_0x1bf0('0x47'));if(_0x5f4fb3[_0x1bf0('0x48')]==='user'){var _0xddc932=_0x866eb1[_0x1bf0('0x21')]({'plain':!![]});var _0x236f0e=_0x1bf0('0x22');return db['UserProfileSection'][_0x1bf0('0x43')]({'where':{'name':_0x236f0e,'userProfileId':_0x5f4fb3['userProfileId']},'raw':!![]})['then'](function(_0x3e2b08){if(_0x3e2b08&&_0x3e2b08[_0x1bf0('0x49')]===0x0){return db[_0x1bf0('0x23')]['create']({'name':_0xddc932[_0x1bf0('0x2f')],'resourceId':_0xddc932['id'],'type':_0x3e2b08[_0x1bf0('0x2f')],'sectionId':_0x3e2b08['id']},{})[_0x1bf0('0x24')](function(){return _0x866eb1;});}else{return _0x866eb1;}})[_0x1bf0('0x44')](function(_0x47951c){logger[_0x1bf0('0x26')](_0x1bf0('0x4a'),_0x47951c);throw _0x47951c;});}return _0x866eb1;})[_0x1bf0('0x24')](respondWithResult(_0x10c0c4,0xc9))[_0x1bf0('0x44')](handleError(_0x10c0c4,null));};exports[_0x1bf0('0x1f')]=function(_0x8c7067,_0x483d2d){if(_0x8c7067[_0x1bf0('0x4b')]['id']){delete _0x8c7067[_0x1bf0('0x4b')]['id'];}return db['CmContactHasItem'][_0x1bf0('0x43')]({'where':{'id':_0x8c7067[_0x1bf0('0x40')]['id']}})[_0x1bf0('0x24')](handleEntityNotFound(_0x483d2d,null))[_0x1bf0('0x24')](saveUpdates(_0x8c7067['body'],null))[_0x1bf0('0x24')](respondWithResult(_0x483d2d,null))[_0x1bf0('0x44')](handleError(_0x483d2d,null));};exports[_0x1bf0('0x20')]=function(_0x2be9d6,_0x543d9d){return db[_0x1bf0('0x29')][_0x1bf0('0x43')]({'where':{'id':_0x2be9d6['params']['id']}})[_0x1bf0('0x24')](handleEntityNotFound(_0x543d9d,null))[_0x1bf0('0x24')](removeEntity(_0x543d9d,null))[_0x1bf0('0x44')](handleError(_0x543d9d,null));}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.model.js b/server/api/cmContactHasItem/cmContactHasItem.model.js index 3b0c4ba..a818c40 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.model.js +++ b/server/api/cmContactHasItem/cmContactHasItem.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5c5a=['cm_contact_has_items','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cmContactHasItem.attributes','exports','define'];(function(_0x1d606e,_0x438c6a){var _0x528543=function(_0x5c0cf7){while(--_0x5c0cf7){_0x1d606e['push'](_0x1d606e['shift']());}};_0x528543(++_0x438c6a);}(_0x5c5a,0x198));var _0xa5c5=function(_0x2b5811,_0x10d614){_0x2b5811=_0x2b5811-0x0;var _0x297ea1=_0x5c5a[_0x2b5811];return _0x297ea1;};'use strict';var _=require('lodash');var util=require(_0xa5c5('0x0'));var logger=require(_0xa5c5('0x1'))(_0xa5c5('0x2'));var moment=require('moment');var BPromise=require(_0xa5c5('0x3'));var rp=require(_0xa5c5('0x4'));var fs=require('fs');var path=require(_0xa5c5('0x5'));var rimraf=require(_0xa5c5('0x6'));var config=require('../../config/environment');var attributes=require(_0xa5c5('0x7'));module[_0xa5c5('0x8')]=function(_0x10c5fe,_0x5ee39f){return _0x10c5fe[_0xa5c5('0x9')]('CmContactHasItem',attributes,{'tableName':_0xa5c5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x678a=['request-promise','path','rimraf','../../config/environment','./cmContactHasItem.attributes','define','CmContactHasItem','cm_contact_has_items','util','api','moment','bluebird'];(function(_0x255ac0,_0x3f6645){var _0x437bf1=function(_0x5baff0){while(--_0x5baff0){_0x255ac0['push'](_0x255ac0['shift']());}};_0x437bf1(++_0x3f6645);}(_0x678a,0x98));var _0xa678=function(_0x3351f0,_0x7b3fbe){_0x3351f0=_0x3351f0-0x0;var _0x56228b=_0x678a[_0x3351f0];return _0x56228b;};'use strict';var _=require('lodash');var util=require(_0xa678('0x0'));var logger=require('../../config/logger')(_0xa678('0x1'));var moment=require(_0xa678('0x2'));var BPromise=require(_0xa678('0x3'));var rp=require(_0xa678('0x4'));var fs=require('fs');var path=require(_0xa678('0x5'));var rimraf=require(_0xa678('0x6'));var config=require(_0xa678('0x7'));var attributes=require(_0xa678('0x8'));module['exports']=function(_0x4ea6a9,_0x1d08ae){return _0x4ea6a9[_0xa678('0x9')](_0xa678('0xa'),attributes,{'tableName':_0xa678('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.rpc.js b/server/api/cmContactHasItem/cmContactHasItem.rpc.js index 1726baf..240cf2e 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.rpc.js +++ b/server/api/cmContactHasItem/cmContactHasItem.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd267=['CmContactHasItem,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','CmContactHasItem,\x20%s,\x20%s','message','catch','lodash','util','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','debug'];(function(_0x62b6,_0x36d284){var _0x363b38=function(_0x9ea8bb){while(--_0x9ea8bb){_0x62b6['push'](_0x62b6['shift']());}};_0x363b38(++_0x36d284);}(_0xd267,0x9b));var _0x7d26=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd267[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7d26('0x0'));var util=require(_0x7d26('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7d26('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x7d26('0x3'));var logger=require(_0x7d26('0x4'))('rpc');var config=require(_0x7d26('0x5'));var jayson=require(_0x7d26('0x6'));var client=jayson[_0x7d26('0x7')][_0x7d26('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3205ae,_0x52f8af,_0xf843db){return new BPromise(function(_0x5dc5f4,_0x38ad66){return client[_0x7d26('0x9')](_0x3205ae,_0xf843db)[_0x7d26('0xa')](function(_0x1ec42e){logger[_0x7d26('0xb')]('CmContactHasItem,\x20%s,\x20%s',_0x52f8af,'request\x20sent');logger[_0x7d26('0xc')](_0x7d26('0xd'),_0x52f8af,_0x7d26('0xe'),JSON[_0x7d26('0xf')](_0x1ec42e));if(_0x1ec42e[_0x7d26('0x10')]){if(_0x1ec42e[_0x7d26('0x10')][_0x7d26('0x11')]===0x1f4){logger[_0x7d26('0x10')](_0x7d26('0x12'),_0x52f8af,_0x1ec42e[_0x7d26('0x10')][_0x7d26('0x13')]);return _0x38ad66(_0x1ec42e[_0x7d26('0x10')][_0x7d26('0x13')]);}logger[_0x7d26('0x10')]('CmContactHasItem,\x20%s,\x20%s',_0x52f8af,_0x1ec42e['error'][_0x7d26('0x13')]);return _0x5dc5f4(_0x1ec42e[_0x7d26('0x10')]['message']);}else{logger[_0x7d26('0xb')]('CmContactHasItem,\x20%s,\x20%s',_0x52f8af,_0x7d26('0xe'));_0x5dc5f4(_0x1ec42e['result']['message']);}})[_0x7d26('0x14')](function(_0x139105){logger['error'](_0x7d26('0x12'),_0x52f8af,_0x139105);_0x38ad66(_0x139105);});});} \ No newline at end of file +var _0xf267=['request\x20sent','stringify','error','code','message','CmContactHasItem,\x20%s,\x20%s','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','http','request','then','info'];(function(_0x1203f,_0x554bbc){var _0x365f0a=function(_0x3531d0){while(--_0x3531d0){_0x1203f['push'](_0x1203f['shift']());}};_0x365f0a(++_0x554bbc);}(_0xf267,0x1da));var _0x7f26=function(_0x599d4a,_0x31fb20){_0x599d4a=_0x599d4a-0x0;var _0x576bc3=_0xf267[_0x599d4a];return _0x576bc3;};'use strict';var _=require(_0x7f26('0x0'));var util=require(_0x7f26('0x1'));var moment=require(_0x7f26('0x2'));var BPromise=require(_0x7f26('0x3'));var rs=require(_0x7f26('0x4'));var fs=require('fs');var Redis=require(_0x7f26('0x5'));var db=require(_0x7f26('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x7f26('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x7f26('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x14066e,_0x10a088,_0x3a203f){return new BPromise(function(_0x5ee0fe,_0x4238fc){return client[_0x7f26('0x9')](_0x14066e,_0x3a203f)[_0x7f26('0xa')](function(_0x219512){logger[_0x7f26('0xb')]('CmContactHasItem,\x20%s,\x20%s',_0x10a088,'request\x20sent');logger['debug']('CmContactHasItem,\x20%s,\x20%s,\x20%s',_0x10a088,_0x7f26('0xc'),JSON[_0x7f26('0xd')](_0x219512));if(_0x219512[_0x7f26('0xe')]){if(_0x219512[_0x7f26('0xe')][_0x7f26('0xf')]===0x1f4){logger[_0x7f26('0xe')]('CmContactHasItem,\x20%s,\x20%s',_0x10a088,_0x219512[_0x7f26('0xe')]['message']);return _0x4238fc(_0x219512[_0x7f26('0xe')][_0x7f26('0x10')]);}logger[_0x7f26('0xe')](_0x7f26('0x11'),_0x10a088,_0x219512[_0x7f26('0xe')][_0x7f26('0x10')]);return _0x5ee0fe(_0x219512[_0x7f26('0xe')][_0x7f26('0x10')]);}else{logger[_0x7f26('0xb')]('CmContactHasItem,\x20%s,\x20%s',_0x10a088,_0x7f26('0xc'));_0x5ee0fe(_0x219512['result'][_0x7f26('0x10')]);}})['catch'](function(_0x41b588){logger[_0x7f26('0xe')](_0x7f26('0x11'),_0x10a088,_0x41b588);_0x4238fc(_0x41b588);});});} \ No newline at end of file diff --git a/server/api/cmContactHasItem/index.js b/server/api/cmContactHasItem/index.js index d58d024..5ef6e7f 100644 --- a/server/api/cmContactHasItem/index.js +++ b/server/api/cmContactHasItem/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaf2c=['/:id','show','isAuthenticated','create','put','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','index'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xaf2c,0xaa));var _0xcaf2=function(_0x12b982,_0xd70986){_0x12b982=_0x12b982-0x0;var _0x146a94=_0xaf2c[_0x12b982];return _0x146a94;};'use strict';var multer=require(_0xcaf2('0x0'));var util=require('util');var path=require(_0xcaf2('0x1'));var timeout=require(_0xcaf2('0x2'));var express=require(_0xcaf2('0x3'));var router=express[_0xcaf2('0x4')]();var fs_extra=require(_0xcaf2('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xcaf2('0x6'));var config=require(_0xcaf2('0x7'));var controller=require('./cmContactHasItem.controller');router[_0xcaf2('0x8')]('/',auth['isAuthenticated'](),controller[_0xcaf2('0x9')]);router[_0xcaf2('0x8')](_0xcaf2('0xa'),auth['isAuthenticated'](),controller[_0xcaf2('0xb')]);router['post']('/',auth[_0xcaf2('0xc')](),controller[_0xcaf2('0xd')]);router[_0xcaf2('0xe')](_0xcaf2('0xa'),auth[_0xcaf2('0xc')](),controller['update']);router[_0xcaf2('0xf')](_0xcaf2('0xa'),auth['isAuthenticated'](),controller[_0xcaf2('0x10')]);module[_0xcaf2('0x11')]=router; \ No newline at end of file +var _0xb2b7=['post','create','put','update','delete','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./cmContactHasItem.controller','get','isAuthenticated','/:id'];(function(_0x4d504f,_0x34477c){var _0x2a56c7=function(_0x301980){while(--_0x301980){_0x4d504f['push'](_0x4d504f['shift']());}};_0x2a56c7(++_0x34477c);}(_0xb2b7,0x1ae));var _0x7b2b=function(_0xf3cd6e,_0x447313){_0xf3cd6e=_0xf3cd6e-0x0;var _0x2ef3dd=_0xb2b7[_0xf3cd6e];return _0x2ef3dd;};'use strict';var multer=require(_0x7b2b('0x0'));var util=require(_0x7b2b('0x1'));var path=require(_0x7b2b('0x2'));var timeout=require(_0x7b2b('0x3'));var express=require(_0x7b2b('0x4'));var router=express[_0x7b2b('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x7b2b('0x6'));var config=require(_0x7b2b('0x7'));var controller=require(_0x7b2b('0x8'));router[_0x7b2b('0x9')]('/',auth[_0x7b2b('0xa')](),controller['index']);router[_0x7b2b('0x9')](_0x7b2b('0xb'),auth[_0x7b2b('0xa')](),controller['show']);router[_0x7b2b('0xc')]('/',auth[_0x7b2b('0xa')](),controller[_0x7b2b('0xd')]);router[_0x7b2b('0xe')](_0x7b2b('0xb'),auth['isAuthenticated'](),controller[_0x7b2b('0xf')]);router[_0x7b2b('0x10')](_0x7b2b('0xb'),auth[_0x7b2b('0xa')](),controller['destroy']);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 3c2e8ef..93e6709 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 _0xb7a2=['sequelize','lodash','exports','getDataValue','STRING','name','long','parse','isArray','setDataValue','values','stringify','BOOLEAN','ENUM','voice'];(function(_0x16fa02,_0x3eaff5){var _0x58fa70=function(_0x18bfc5){while(--_0x18bfc5){_0x16fa02['push'](_0x16fa02['shift']());}};_0x58fa70(++_0x3eaff5);}(_0xb7a2,0x1c2));var _0x2b7a=function(_0x47cf6f,_0x86cc5d){_0x47cf6f=_0x47cf6f-0x0;var _0x210c6d=_0xb7a2[_0x47cf6f];return _0x210c6d;};'use strict';var Sequelize=require(_0x2b7a('0x0'));var _=require(_0x2b7a('0x1'));module[_0x2b7a('0x2')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x4e24fa){return this[_0x2b7a('0x3')]('alias');}},'alias':{'type':Sequelize[_0x2b7a('0x4')],'allowNull':![],'set':function(_0x112fff){this['setDataValue']('alias',_0x112fff?_0x112fff:this[_0x2b7a('0x3')](_0x2b7a('0x5')));}},'type':{'type':Sequelize[_0x2b7a('0x4')],'allowNull':![]},'values':{'type':Sequelize['TEXT'](_0x2b7a('0x6')),'get':function(){if(this[_0x2b7a('0x3')]('type')==='select'){return JSON[_0x2b7a('0x7')](this['getDataValue']('values'));}else{return this['getDataValue']('values');}},'set':function(_0x4e9c5a){if(Array[_0x2b7a('0x8')](_0x4e9c5a)){this[_0x2b7a('0x9')](_0x2b7a('0xa'),JSON[_0x2b7a('0xb')](_0x4e9c5a));}else{this['setDataValue'](_0x2b7a('0xa'),_0x4e9c5a);}}},'required':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x2b7a('0xc')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x2b7a('0xd')](_0x2b7a('0xe'))}}; \ No newline at end of file +var _0xad48=['VIRTUAL','getDataValue','alias','setDataValue','name','type','parse','values','BOOLEAN','ENUM','voice','sequelize','lodash','exports'];(function(_0x25340f,_0xd2071e){var _0x16b6d7=function(_0x443cc1){while(--_0x443cc1){_0x25340f['push'](_0x25340f['shift']());}};_0x16b6d7(++_0xd2071e);}(_0xad48,0x1d9));var _0x8ad4=function(_0x3cc5a2,_0x1565fd){_0x3cc5a2=_0x3cc5a2-0x0;var _0x570747=_0xad48[_0x3cc5a2];return _0x570747;};'use strict';var Sequelize=require(_0x8ad4('0x0'));var _=require(_0x8ad4('0x1'));module[_0x8ad4('0x2')]={'name':{'type':Sequelize[_0x8ad4('0x3')],'get':function(_0x783612){return this[_0x8ad4('0x4')](_0x8ad4('0x5'));}},'alias':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x11a72b){this[_0x8ad4('0x6')](_0x8ad4('0x5'),_0x11a72b?_0x11a72b:this[_0x8ad4('0x4')](_0x8ad4('0x7')));}},'type':{'type':Sequelize['STRING'],'allowNull':![]},'values':{'type':Sequelize['TEXT']('long'),'get':function(){if(this['getDataValue'](_0x8ad4('0x8'))==='select'){return JSON[_0x8ad4('0x9')](this[_0x8ad4('0x4')](_0x8ad4('0xa')));}else{return this[_0x8ad4('0x4')]('values');}},'set':function(_0x4a197c){if(Array['isArray'](_0x4a197c)){this[_0x8ad4('0x6')](_0x8ad4('0xa'),JSON['stringify'](_0x4a197c));}else{this[_0x8ad4('0x6')](_0x8ad4('0xa'),_0x4a197c);}}},'required':{'type':Sequelize[_0x8ad4('0xb')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x8ad4('0xb')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x8ad4('0xc')](_0x8ad4('0xd'))}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 91f2cee..9f236c3 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 _0x55e3=['params','find','body','create','transaction','Sequelize','TEXT','text','number','INTEGER','switch','BOOLEAN','defaultValue','sequelize','queryInterface','addColumn','format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','send','CmCustomField','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show'];(function(_0x46e410,_0x1e9eb9){var _0x138b26=function(_0x169911){while(--_0x169911){_0x46e410['push'](_0x46e410['shift']());}};_0x138b26(++_0x1e9eb9);}(_0x55e3,0xc1));var _0x355e=function(_0x2f8606,_0x5137de){_0x2f8606=_0x2f8606-0x0;var _0x2f7238=_0x55e3[_0x2f8606];return _0x2f7238;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x355e('0x0'));var zipdir=require(_0x355e('0x1'));var jsonpatch=require(_0x355e('0x2'));var rp=require('request-promise');var moment=require(_0x355e('0x3'));var BPromise=require(_0x355e('0x4'));var Mustache=require('mustache');var util=require(_0x355e('0x5'));var path=require(_0x355e('0x6'));var sox=require(_0x355e('0x7'));var csv=require(_0x355e('0x8'));var ejs=require(_0x355e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x355e('0xa'));var squel=require(_0x355e('0xb'));var crypto=require('crypto');var jsforce=require(_0x355e('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x355e('0x8'));var querystring=require(_0x355e('0xd'));var Papa=require(_0x355e('0xe'));var Redis=require('ioredis');var authService=require(_0x355e('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x355e('0x10'));var hardwareService=require(_0x355e('0x11'));var logger=require('../../config/logger')(_0x355e('0x12'));var utils=require(_0x355e('0x13'));var config=require(_0x355e('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x355e('0x15'))['db'];function respondWithStatusCode(_0x30fa47,_0x3a5e43){_0x3a5e43=_0x3a5e43||0xcc;return function(_0x5b70c4){if(_0x5b70c4){return _0x30fa47[_0x355e('0x16')](_0x3a5e43);}return _0x30fa47[_0x355e('0x17')](_0x3a5e43)['end']();};}function respondWithResult(_0x23450c,_0x115ab1){_0x115ab1=_0x115ab1||0xc8;return function(_0xc23580){if(_0xc23580){return _0x23450c[_0x355e('0x17')](_0x115ab1)[_0x355e('0x18')](_0xc23580);}};}function respondWithFilteredResult(_0x2822e7,_0xa3a20b){return function(_0x46094a){if(_0x46094a){var _0x9113cb=typeof _0xa3a20b['offset']===_0x355e('0x19')&&typeof _0xa3a20b[_0x355e('0x1a')]==='undefined';var _0x446a96=_0x46094a[_0x355e('0x1b')];var _0x5b7c3a=_0x9113cb?0x0:_0xa3a20b['offset'];var _0x5b4c91=_0x9113cb?_0x46094a[_0x355e('0x1b')]:_0xa3a20b[_0x355e('0x1c')]+_0xa3a20b[_0x355e('0x1a')];var _0x2cb40d;if(_0x5b4c91>=_0x446a96){_0x5b4c91=_0x446a96;_0x2cb40d=0xc8;}else{_0x2cb40d=0xce;}_0x2822e7[_0x355e('0x17')](_0x2cb40d);return _0x2822e7[_0x355e('0x1d')](_0x355e('0x1e'),_0x5b7c3a+'-'+_0x5b4c91+'/'+_0x446a96)['json'](_0x46094a);}return null;};}function patchUpdates(_0x457898){return function(_0xffae2e){try{jsonpatch[_0x355e('0x1f')](_0xffae2e,_0x457898,!![]);}catch(_0x4135f3){return BPromise[_0x355e('0x20')](_0x4135f3);}return _0xffae2e[_0x355e('0x21')]();};}function saveUpdates(_0x4faf53,_0x4db520){return function(_0x2a4dbe){if(_0x2a4dbe){return _0x2a4dbe[_0x355e('0x22')](_0x4faf53)[_0x355e('0x23')](function(_0x60cab1){return _0x60cab1;});}return null;};}function removeEntity(_0xb41419,_0x205e13){return function(_0x57e132){if(_0x57e132){return _0x57e132[_0x355e('0x24')]()['then'](function(){_0xb41419[_0x355e('0x17')](0xcc)[_0x355e('0x25')]();});}};}function handleEntityNotFound(_0x142e0a,_0x24b354){return function(_0x49647b){if(!_0x49647b){_0x142e0a[_0x355e('0x16')](0x194);}return _0x49647b;};}function handleError(_0xd5132a,_0x3a17a3){_0x3a17a3=_0x3a17a3||0x1f4;return function(_0x73c432){logger['error'](_0x73c432[_0x355e('0x26')]);if(_0x73c432[_0x355e('0x27')]){delete _0x73c432[_0x355e('0x27')];}_0xd5132a[_0x355e('0x17')](_0x3a17a3)[_0x355e('0x28')](_0x73c432);};}exports['index']=function(_0x7c4dda,_0x2605c1){var _0x5d725b={},_0x16f649={},_0x3eab50={'count':0x0,'rows':[]};var _0x3bb8a1=_['map'](db[_0x355e('0x29')][_0x355e('0x2a')],function(_0x5bf1b0){return{'name':_0x5bf1b0[_0x355e('0x2b')],'type':_0x5bf1b0[_0x355e('0x2c')][_0x355e('0x2d')]};});_0x16f649[_0x355e('0x2e')]=_['differenceBy'](_[_0x355e('0x2f')](_0x3bb8a1,'name'),[_0x355e('0x27')]);_0x16f649[_0x355e('0x30')]=_[_0x355e('0x31')](_0x7c4dda['query']);_0x16f649[_0x355e('0x32')]=_[_0x355e('0x33')](_0x16f649[_0x355e('0x2e')],_0x16f649[_0x355e('0x30')]);_0x5d725b[_0x355e('0x34')]=_[_0x355e('0x33')](_0x16f649['model'],qs[_0x355e('0x35')](_0x7c4dda['query']['fields']));_0x5d725b[_0x355e('0x34')]=_0x5d725b['attributes'][_0x355e('0x36')]?_0x5d725b[_0x355e('0x34')]:_0x16f649[_0x355e('0x2e')];if(!_0x7c4dda[_0x355e('0x30')][_0x355e('0x37')](_0x355e('0x38'))){_0x5d725b['limit']=qs[_0x355e('0x1a')](_0x7c4dda['query'][_0x355e('0x1a')]);_0x5d725b[_0x355e('0x1c')]=qs[_0x355e('0x1c')](_0x7c4dda[_0x355e('0x30')]['offset']);}_0x5d725b[_0x355e('0x39')]=qs[_0x355e('0x3a')](_0x7c4dda[_0x355e('0x30')]['sort']);_0x5d725b[_0x355e('0x3b')]=qs['filters'](_[_0x355e('0x3c')](_0x7c4dda['query'],_0x16f649[_0x355e('0x32')]),_0x3bb8a1);if(_0x7c4dda[_0x355e('0x30')][_0x355e('0x3d')]){_0x5d725b[_0x355e('0x3b')]=_[_0x355e('0x3e')](_0x5d725b[_0x355e('0x3b')],{'$or':_['map'](_0x3bb8a1,function(_0x27ed27){if(_0x27ed27[_0x355e('0x2c')]!==_0x355e('0x3f')){var _0x58168d={};_0x58168d[_0x27ed27[_0x355e('0x27')]]={'$like':'%'+_0x7c4dda[_0x355e('0x30')]['filter']+'%'};return _0x58168d;}})});}_0x5d725b=_[_0x355e('0x3e')]({},_0x5d725b,_0x7c4dda[_0x355e('0x40')]);var _0x2ce872={'where':_0x5d725b[_0x355e('0x3b')]};return db[_0x355e('0x29')][_0x355e('0x1b')](_0x2ce872)[_0x355e('0x23')](function(_0x251f26){_0x3eab50[_0x355e('0x1b')]=_0x251f26;if(_0x7c4dda[_0x355e('0x30')][_0x355e('0x41')]){_0x5d725b[_0x355e('0x42')]=[{'all':!![]}];}return db[_0x355e('0x29')][_0x355e('0x43')](_0x5d725b);})[_0x355e('0x23')](function(_0xf3d1a9){_0x3eab50[_0x355e('0x44')]=_0xf3d1a9;return _0x3eab50;})['then'](respondWithFilteredResult(_0x2605c1,_0x5d725b))[_0x355e('0x45')](handleError(_0x2605c1,null));};exports[_0x355e('0x46')]=function(_0x8948e7,_0x6c5030){var _0x3dd79b={'raw':!![],'where':{'id':_0x8948e7[_0x355e('0x47')]['id']}},_0x4ea8f8={};_0x4ea8f8['model']=_[_0x355e('0x31')](db[_0x355e('0x29')][_0x355e('0x2a')]);_0x4ea8f8[_0x355e('0x30')]=_[_0x355e('0x31')](_0x8948e7[_0x355e('0x30')]);_0x4ea8f8[_0x355e('0x32')]=_[_0x355e('0x33')](_0x4ea8f8['model'],_0x4ea8f8[_0x355e('0x30')]);_0x3dd79b[_0x355e('0x34')]=_['intersection'](_0x4ea8f8[_0x355e('0x2e')],qs['fields'](_0x8948e7['query']['fields']));_0x3dd79b['attributes']=_0x3dd79b['attributes'][_0x355e('0x36')]?_0x3dd79b[_0x355e('0x34')]:_0x4ea8f8[_0x355e('0x2e')];if(_0x8948e7[_0x355e('0x30')][_0x355e('0x41')]){_0x3dd79b[_0x355e('0x42')]=[{'all':!![]}];}_0x3dd79b=_[_0x355e('0x3e')]({},_0x3dd79b,_0x8948e7['options']);return db[_0x355e('0x29')][_0x355e('0x48')](_0x3dd79b)[_0x355e('0x23')](handleEntityNotFound(_0x6c5030,null))['then'](respondWithResult(_0x6c5030,null))[_0x355e('0x45')](handleError(_0x6c5030,null));};exports[_0x355e('0x22')]=function(_0x2802f8,_0x3cc463){if(_0x2802f8['body']['id']){delete _0x2802f8[_0x355e('0x49')]['id'];}return db[_0x355e('0x29')][_0x355e('0x48')]({'where':{'id':_0x2802f8['params']['id']}})[_0x355e('0x23')](handleEntityNotFound(_0x3cc463,null))[_0x355e('0x23')](saveUpdates(_0x2802f8[_0x355e('0x49')],null))['then'](respondWithResult(_0x3cc463,null))['catch'](handleError(_0x3cc463,null));};exports[_0x355e('0x24')]=function(_0x310a58,_0x78bf12){return db[_0x355e('0x29')][_0x355e('0x48')]({'where':{'id':_0x310a58[_0x355e('0x47')]['id']}})[_0x355e('0x23')](handleEntityNotFound(_0x78bf12,null))[_0x355e('0x23')](removeEntity(_0x78bf12,null))['catch'](handleError(_0x78bf12,null));};exports[_0x355e('0x4a')]=function(_0xd4ce65,_0x486fc1){var _0x597621;return db['sequelize'][_0x355e('0x4b')](function(_0x582e4d){return db[_0x355e('0x29')][_0x355e('0x4a')](_0xd4ce65[_0x355e('0x49')],{'transaction':_0x582e4d})[_0x355e('0x23')](function(_0x4ebd51){_0x597621=_0x4ebd51;var _0x226c60={'type':db[_0x355e('0x4c')][_0x355e('0x4d')],'transaction':_0x582e4d};switch(_0xd4ce65[_0x355e('0x49')][_0x355e('0x2c')]){case _0x355e('0x4e'):_0x226c60[_0x355e('0x2c')]=db[_0x355e('0x4c')][_0x355e('0x4d')];break;case _0x355e('0x4f'):_0x226c60[_0x355e('0x2c')]=db[_0x355e('0x4c')][_0x355e('0x50')];break;case _0x355e('0x51'):_0x226c60['type']=db[_0x355e('0x4c')][_0x355e('0x52')];_0x226c60[_0x355e('0x53')]=![];break;default:}return db[_0x355e('0x54')][_0x355e('0x55')][_0x355e('0x56')]('cm_contacts',util[_0x355e('0x57')]('cf_%d',_0x597621['id']),_0x226c60);})['then'](function(){return _0x597621;});})[_0x355e('0x23')](respondWithResult(_0x486fc1,0xc9))[_0x355e('0x45')](handleError(_0x486fc1,null));}; \ No newline at end of file +var _0x7cf5=['model','differenceBy','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','params','keys','filters','options','find','catch','update','body','sequelize','create','Sequelize','TEXT','text','number','defaultValue','queryInterface','addColumn','cm_contacts','cf_%d','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','save','then','destroy','error','stack','name','map','CmCustomField','fieldName','key'];(function(_0x5021d1,_0x5c4791){var _0x371a4a=function(_0xddd0d6){while(--_0xddd0d6){_0x5021d1['push'](_0x5021d1['shift']());}};_0x371a4a(++_0x5c4791);}(_0x7cf5,0x12a));var _0x57cf=function(_0x435363,_0x406930){_0x435363=_0x435363-0x0;var _0x484f8e=_0x7cf5[_0x435363];return _0x484f8e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x57cf('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x57cf('0x1'));var rp=require(_0x57cf('0x2'));var moment=require(_0x57cf('0x3'));var BPromise=require(_0x57cf('0x4'));var Mustache=require(_0x57cf('0x5'));var util=require('util');var path=require('path');var sox=require(_0x57cf('0x6'));var csv=require(_0x57cf('0x7'));var ejs=require(_0x57cf('0x8'));var fs=require('fs');var fs_extra=require(_0x57cf('0x9'));var _=require(_0x57cf('0xa'));var squel=require(_0x57cf('0xb'));var crypto=require(_0x57cf('0xc'));var jsforce=require(_0x57cf('0xd'));var deskjs=require(_0x57cf('0xe'));var toCsv=require(_0x57cf('0x7'));var querystring=require(_0x57cf('0xf'));var Papa=require(_0x57cf('0x10'));var Redis=require(_0x57cf('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x57cf('0x12'));var as=require(_0x57cf('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x57cf('0x14'))(_0x57cf('0x15'));var utils=require(_0x57cf('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x57cf('0x17'));var db=require(_0x57cf('0x18'))['db'];function respondWithStatusCode(_0x36e674,_0x419b35){_0x419b35=_0x419b35||0xcc;return function(_0x192227){if(_0x192227){return _0x36e674[_0x57cf('0x19')](_0x419b35);}return _0x36e674[_0x57cf('0x1a')](_0x419b35)[_0x57cf('0x1b')]();};}function respondWithResult(_0x5510fe,_0xfbf199){_0xfbf199=_0xfbf199||0xc8;return function(_0x520251){if(_0x520251){return _0x5510fe[_0x57cf('0x1a')](_0xfbf199)[_0x57cf('0x1c')](_0x520251);}};}function respondWithFilteredResult(_0x56f4e8,_0x59f65f){return function(_0x3989a0){if(_0x3989a0){var _0x4aef98=typeof _0x59f65f[_0x57cf('0x1d')]===_0x57cf('0x1e')&&typeof _0x59f65f['limit']===_0x57cf('0x1e');var _0x5373c5=_0x3989a0[_0x57cf('0x1f')];var _0x2d12bb=_0x4aef98?0x0:_0x59f65f[_0x57cf('0x1d')];var _0x5087e1=_0x4aef98?_0x3989a0['count']:_0x59f65f[_0x57cf('0x1d')]+_0x59f65f[_0x57cf('0x20')];var _0x4c98e4;if(_0x5087e1>=_0x5373c5){_0x5087e1=_0x5373c5;_0x4c98e4=0xc8;}else{_0x4c98e4=0xce;}_0x56f4e8[_0x57cf('0x1a')](_0x4c98e4);return _0x56f4e8[_0x57cf('0x21')]('Content-Range',_0x2d12bb+'-'+_0x5087e1+'/'+_0x5373c5)['json'](_0x3989a0);}return null;};}function patchUpdates(_0x4ddd97){return function(_0xd42a78){try{jsonpatch[_0x57cf('0x22')](_0xd42a78,_0x4ddd97,!![]);}catch(_0x52815e){return BPromise[_0x57cf('0x23')](_0x52815e);}return _0xd42a78[_0x57cf('0x24')]();};}function saveUpdates(_0x526024,_0x224e6b){return function(_0x3f9cc9){if(_0x3f9cc9){return _0x3f9cc9['update'](_0x526024)[_0x57cf('0x25')](function(_0x34cc80){return _0x34cc80;});}return null;};}function removeEntity(_0x3a3d51,_0x3581f0){return function(_0x1f78e0){if(_0x1f78e0){return _0x1f78e0[_0x57cf('0x26')]()[_0x57cf('0x25')](function(){_0x3a3d51[_0x57cf('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x31e940,_0x471c95){return function(_0x1135f7){if(!_0x1135f7){_0x31e940[_0x57cf('0x19')](0x194);}return _0x1135f7;};}function handleError(_0x4dc8a4,_0x25d8a9){_0x25d8a9=_0x25d8a9||0x1f4;return function(_0x2ffc55){logger[_0x57cf('0x27')](_0x2ffc55[_0x57cf('0x28')]);if(_0x2ffc55[_0x57cf('0x29')]){delete _0x2ffc55[_0x57cf('0x29')];}_0x4dc8a4[_0x57cf('0x1a')](_0x25d8a9)['send'](_0x2ffc55);};}exports['index']=function(_0x468244,_0x48e2d5){var _0x1830f7={},_0x3860b9={},_0x40af2d={'count':0x0,'rows':[]};var _0x1d2473=_[_0x57cf('0x2a')](db[_0x57cf('0x2b')]['rawAttributes'],function(_0xa720df){return{'name':_0xa720df[_0x57cf('0x2c')],'type':_0xa720df['type'][_0x57cf('0x2d')]};});_0x3860b9[_0x57cf('0x2e')]=_[_0x57cf('0x2f')](_['map'](_0x1d2473,_0x57cf('0x29')),[_0x57cf('0x29')]);_0x3860b9[_0x57cf('0x30')]=_['keys'](_0x468244[_0x57cf('0x30')]);_0x3860b9['filters']=_[_0x57cf('0x31')](_0x3860b9[_0x57cf('0x2e')],_0x3860b9[_0x57cf('0x30')]);_0x1830f7[_0x57cf('0x32')]=_[_0x57cf('0x31')](_0x3860b9[_0x57cf('0x2e')],qs[_0x57cf('0x33')](_0x468244[_0x57cf('0x30')][_0x57cf('0x33')]));_0x1830f7[_0x57cf('0x32')]=_0x1830f7[_0x57cf('0x32')][_0x57cf('0x34')]?_0x1830f7[_0x57cf('0x32')]:_0x3860b9['model'];if(!_0x468244[_0x57cf('0x30')][_0x57cf('0x35')](_0x57cf('0x36'))){_0x1830f7['limit']=qs['limit'](_0x468244[_0x57cf('0x30')][_0x57cf('0x20')]);_0x1830f7[_0x57cf('0x1d')]=qs['offset'](_0x468244['query'][_0x57cf('0x1d')]);}_0x1830f7[_0x57cf('0x37')]=qs[_0x57cf('0x38')](_0x468244[_0x57cf('0x30')][_0x57cf('0x38')]);_0x1830f7[_0x57cf('0x39')]=qs['filters'](_[_0x57cf('0x3a')](_0x468244[_0x57cf('0x30')],_0x3860b9['filters']),_0x1d2473);if(_0x468244[_0x57cf('0x30')][_0x57cf('0x3b')]){_0x1830f7[_0x57cf('0x39')]=_[_0x57cf('0x3c')](_0x1830f7['where'],{'$or':_[_0x57cf('0x2a')](_0x1d2473,function(_0x1446de){if(_0x1446de[_0x57cf('0x3d')]!==_0x57cf('0x3e')){var _0x40306d={};_0x40306d[_0x1446de['name']]={'$like':'%'+_0x468244[_0x57cf('0x30')][_0x57cf('0x3b')]+'%'};return _0x40306d;}})});}_0x1830f7=_[_0x57cf('0x3c')]({},_0x1830f7,_0x468244['options']);var _0x150702={'where':_0x1830f7[_0x57cf('0x39')]};return db[_0x57cf('0x2b')][_0x57cf('0x1f')](_0x150702)[_0x57cf('0x25')](function(_0x563365){_0x40af2d[_0x57cf('0x1f')]=_0x563365;if(_0x468244[_0x57cf('0x30')][_0x57cf('0x3f')]){_0x1830f7[_0x57cf('0x40')]=[{'all':!![]}];}return db[_0x57cf('0x2b')][_0x57cf('0x41')](_0x1830f7);})[_0x57cf('0x25')](function(_0x49dcd3){_0x40af2d[_0x57cf('0x42')]=_0x49dcd3;return _0x40af2d;})[_0x57cf('0x25')](respondWithFilteredResult(_0x48e2d5,_0x1830f7))['catch'](handleError(_0x48e2d5,null));};exports['show']=function(_0x290cff,_0xfb97ab){var _0x37fc62={'raw':!![],'where':{'id':_0x290cff[_0x57cf('0x43')]['id']}},_0x3e8c6c={};_0x3e8c6c['model']=_[_0x57cf('0x44')](db['CmCustomField']['rawAttributes']);_0x3e8c6c[_0x57cf('0x30')]=_[_0x57cf('0x44')](_0x290cff[_0x57cf('0x30')]);_0x3e8c6c[_0x57cf('0x45')]=_[_0x57cf('0x31')](_0x3e8c6c[_0x57cf('0x2e')],_0x3e8c6c[_0x57cf('0x30')]);_0x37fc62[_0x57cf('0x32')]=_[_0x57cf('0x31')](_0x3e8c6c[_0x57cf('0x2e')],qs[_0x57cf('0x33')](_0x290cff[_0x57cf('0x30')][_0x57cf('0x33')]));_0x37fc62['attributes']=_0x37fc62[_0x57cf('0x32')][_0x57cf('0x34')]?_0x37fc62[_0x57cf('0x32')]:_0x3e8c6c[_0x57cf('0x2e')];if(_0x290cff[_0x57cf('0x30')][_0x57cf('0x3f')]){_0x37fc62['include']=[{'all':!![]}];}_0x37fc62=_[_0x57cf('0x3c')]({},_0x37fc62,_0x290cff[_0x57cf('0x46')]);return db[_0x57cf('0x2b')][_0x57cf('0x47')](_0x37fc62)[_0x57cf('0x25')](handleEntityNotFound(_0xfb97ab,null))['then'](respondWithResult(_0xfb97ab,null))[_0x57cf('0x48')](handleError(_0xfb97ab,null));};exports[_0x57cf('0x49')]=function(_0x36f881,_0x265fa9){if(_0x36f881[_0x57cf('0x4a')]['id']){delete _0x36f881[_0x57cf('0x4a')]['id'];}return db[_0x57cf('0x2b')][_0x57cf('0x47')]({'where':{'id':_0x36f881[_0x57cf('0x43')]['id']}})['then'](handleEntityNotFound(_0x265fa9,null))[_0x57cf('0x25')](saveUpdates(_0x36f881[_0x57cf('0x4a')],null))[_0x57cf('0x25')](respondWithResult(_0x265fa9,null))['catch'](handleError(_0x265fa9,null));};exports[_0x57cf('0x26')]=function(_0x4c75b9,_0x34197e){return db[_0x57cf('0x2b')][_0x57cf('0x47')]({'where':{'id':_0x4c75b9[_0x57cf('0x43')]['id']}})[_0x57cf('0x25')](handleEntityNotFound(_0x34197e,null))[_0x57cf('0x25')](removeEntity(_0x34197e,null))['catch'](handleError(_0x34197e,null));};exports['create']=function(_0x4e5a41,_0x457da6){var _0x1b93b9;return db[_0x57cf('0x4b')]['transaction'](function(_0x3d4514){return db['CmCustomField'][_0x57cf('0x4c')](_0x4e5a41[_0x57cf('0x4a')],{'transaction':_0x3d4514})['then'](function(_0x6d2956){_0x1b93b9=_0x6d2956;var _0x39be44={'type':db[_0x57cf('0x4d')][_0x57cf('0x4e')],'transaction':_0x3d4514};switch(_0x4e5a41[_0x57cf('0x4a')]['type']){case _0x57cf('0x4f'):_0x39be44[_0x57cf('0x3d')]=db[_0x57cf('0x4d')][_0x57cf('0x4e')];break;case _0x57cf('0x50'):_0x39be44[_0x57cf('0x3d')]=db[_0x57cf('0x4d')]['INTEGER'];break;case'switch':_0x39be44[_0x57cf('0x3d')]=db[_0x57cf('0x4d')]['BOOLEAN'];_0x39be44[_0x57cf('0x51')]=![];break;default:}return db[_0x57cf('0x4b')][_0x57cf('0x52')][_0x57cf('0x53')](_0x57cf('0x54'),util['format'](_0x57cf('0x55'),_0x1b93b9['id']),_0x39be44);})[_0x57cf('0x25')](function(){return _0x1b93b9;});})['then'](respondWithResult(_0x457da6,0xc9))[_0x57cf('0x48')](handleError(_0x457da6,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index dd52bdd..27c618c 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 _0x1cff=['bluebird','rimraf','../../config/environment','./cmCustomField.attributes','exports','define','CmCustomField','cm_custom_fields','util','../../config/logger','api','moment'];(function(_0x8cc28d,_0x515c9f){var _0x1acdb5=function(_0x214208){while(--_0x214208){_0x8cc28d['push'](_0x8cc28d['shift']());}};_0x1acdb5(++_0x515c9f);}(_0x1cff,0xe0));var _0xf1cf=function(_0x2fffe3,_0x5e2f10){_0x2fffe3=_0x2fffe3-0x0;var _0x5e73fa=_0x1cff[_0x2fffe3];return _0x5e73fa;};'use strict';var _=require('lodash');var util=require(_0xf1cf('0x0'));var logger=require(_0xf1cf('0x1'))(_0xf1cf('0x2'));var moment=require(_0xf1cf('0x3'));var BPromise=require(_0xf1cf('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xf1cf('0x5'));var config=require(_0xf1cf('0x6'));var attributes=require(_0xf1cf('0x7'));module[_0xf1cf('0x8')]=function(_0x4f1c86,_0x2f6a6b){return _0x4f1c86[_0xf1cf('0x9')](_0xf1cf('0xa'),attributes,{'tableName':_0xf1cf('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfa2a=['exports','define','CmCustomField','cm_custom_fields','lodash','util','../../config/logger','moment','request-promise','rimraf','../../config/environment','./cmCustomField.attributes'];(function(_0x169201,_0x397fb4){var _0x17c908=function(_0xfc76d0){while(--_0xfc76d0){_0x169201['push'](_0x169201['shift']());}};_0x17c908(++_0x397fb4);}(_0xfa2a,0x1a8));var _0xafa2=function(_0x74d1c8,_0x1c5391){_0x74d1c8=_0x74d1c8-0x0;var _0x39f3e8=_0xfa2a[_0x74d1c8];return _0x39f3e8;};'use strict';var _=require(_0xafa2('0x0'));var util=require(_0xafa2('0x1'));var logger=require(_0xafa2('0x2'))('api');var moment=require(_0xafa2('0x3'));var BPromise=require('bluebird');var rp=require(_0xafa2('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xafa2('0x5'));var config=require(_0xafa2('0x6'));var attributes=require(_0xafa2('0x7'));module[_0xafa2('0x8')]=function(_0x3d5885,_0xab6237){return _0x3d5885[_0xafa2('0x9')](_0xafa2('0xa'),attributes,{'tableName':_0xafa2('0xb'),'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 aeadaa2..7d6270d 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 _0xdf19=['stringify','error','message','result','catch','lodash','util','moment','bluebird','ioredis','rpc','jayson/promise','http','request','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xdf19,0xa5));var _0x9df1=function(_0x19a490,_0x4627d9){_0x19a490=_0x19a490-0x0;var _0x52081c=_0xdf19[_0x19a490];return _0x52081c;};'use strict';var _=require(_0x9df1('0x0'));var util=require(_0x9df1('0x1'));var moment=require(_0x9df1('0x2'));var BPromise=require(_0x9df1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9df1('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9df1('0x5'));var config=require('../../config/environment');var jayson=require(_0x9df1('0x6'));var client=jayson['client'][_0x9df1('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x26e5bb,_0x4c27c7,_0x448a28){return new BPromise(function(_0x55caf7,_0x2ad28c){return client[_0x9df1('0x8')](_0x26e5bb,_0x448a28)[_0x9df1('0x9')](function(_0x1af1a3){logger[_0x9df1('0xa')](_0x9df1('0xb'),_0x4c27c7,_0x9df1('0xc'));logger[_0x9df1('0xd')](_0x9df1('0xe'),_0x4c27c7,_0x9df1('0xc'),JSON[_0x9df1('0xf')](_0x1af1a3));if(_0x1af1a3[_0x9df1('0x10')]){if(_0x1af1a3[_0x9df1('0x10')]['code']===0x1f4){logger['error'](_0x9df1('0xb'),_0x4c27c7,_0x1af1a3[_0x9df1('0x10')]['message']);return _0x2ad28c(_0x1af1a3[_0x9df1('0x10')][_0x9df1('0x11')]);}logger[_0x9df1('0x10')](_0x9df1('0xb'),_0x4c27c7,_0x1af1a3[_0x9df1('0x10')][_0x9df1('0x11')]);return _0x55caf7(_0x1af1a3[_0x9df1('0x10')]['message']);}else{logger['info'](_0x9df1('0xb'),_0x4c27c7,_0x9df1('0xc'));_0x55caf7(_0x1af1a3[_0x9df1('0x12')][_0x9df1('0x11')]);}})[_0x9df1('0x13')](function(_0x4c53ba){logger[_0x9df1('0x10')]('CmCustomField,\x20%s,\x20%s',_0x4c27c7,_0x4c53ba);_0x2ad28c(_0x4c53ba);});});} \ No newline at end of file +var _0xa7c1=['info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x394322,_0x51090f){var _0x1502a6=function(_0x302d2f){while(--_0x302d2f){_0x394322['push'](_0x394322['shift']());}};_0x1502a6(++_0x51090f);}(_0xa7c1,0x1ac));var _0x1a7c=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0xa7c1[_0x5d2803];return _0xdcad2c;};'use strict';var _=require(_0x1a7c('0x0'));var util=require('util');var moment=require(_0x1a7c('0x1'));var BPromise=require(_0x1a7c('0x2'));var rs=require(_0x1a7c('0x3'));var fs=require('fs');var Redis=require(_0x1a7c('0x4'));var db=require(_0x1a7c('0x5'))['db'];var utils=require(_0x1a7c('0x6'));var logger=require(_0x1a7c('0x7'))(_0x1a7c('0x8'));var config=require(_0x1a7c('0x9'));var jayson=require(_0x1a7c('0xa'));var client=jayson[_0x1a7c('0xb')][_0x1a7c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xa0d9f4,_0x6edcc1,_0x473c93){return new BPromise(function(_0x518a7d,_0x51da31){return client[_0x1a7c('0xd')](_0xa0d9f4,_0x473c93)[_0x1a7c('0xe')](function(_0x392388){logger['info'](_0x1a7c('0xf'),_0x6edcc1,_0x1a7c('0x10'));logger[_0x1a7c('0x11')](_0x1a7c('0x12'),_0x6edcc1,_0x1a7c('0x10'),JSON[_0x1a7c('0x13')](_0x392388));if(_0x392388['error']){if(_0x392388[_0x1a7c('0x14')]['code']===0x1f4){logger['error'](_0x1a7c('0xf'),_0x6edcc1,_0x392388[_0x1a7c('0x14')][_0x1a7c('0x15')]);return _0x51da31(_0x392388[_0x1a7c('0x14')]['message']);}logger[_0x1a7c('0x14')](_0x1a7c('0xf'),_0x6edcc1,_0x392388[_0x1a7c('0x14')][_0x1a7c('0x15')]);return _0x518a7d(_0x392388[_0x1a7c('0x14')][_0x1a7c('0x15')]);}else{logger[_0x1a7c('0x16')]('CmCustomField,\x20%s,\x20%s',_0x6edcc1,'request\x20sent');_0x518a7d(_0x392388[_0x1a7c('0x17')]['message']);}})[_0x1a7c('0x18')](function(_0x5decd7){logger[_0x1a7c('0x14')](_0x1a7c('0xf'),_0x6edcc1,_0x5decd7);_0x51da31(_0x5decd7);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index f46be38..129cee0 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 _0xcddb=['post','put','delete','destroy','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','isAuthenticated','get','/:id','show'];(function(_0x234714,_0x544c9e){var _0x58b374=function(_0xe594cc){while(--_0xe594cc){_0x234714['push'](_0x234714['shift']());}};_0x58b374(++_0x544c9e);}(_0xcddb,0x1c4));var _0xbcdd=function(_0x1840e5,_0x21b76d){_0x1840e5=_0x1840e5-0x0;var _0x5b1422=_0xcddb[_0x1840e5];return _0x5b1422;};'use strict';var multer=require(_0xbcdd('0x0'));var util=require(_0xbcdd('0x1'));var path=require(_0xbcdd('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xbcdd('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbcdd('0x4'));var interaction=require(_0xbcdd('0x5'));var config=require(_0xbcdd('0x6'));var controller=require(_0xbcdd('0x7'));router['get']('/',auth[_0xbcdd('0x8')](),controller['index']);router[_0xbcdd('0x9')](_0xbcdd('0xa'),auth['isAuthenticated'](),controller[_0xbcdd('0xb')]);router[_0xbcdd('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0xbcdd('0xd')](_0xbcdd('0xa'),auth[_0xbcdd('0x8')](),controller['update']);router[_0xbcdd('0xe')](_0xbcdd('0xa'),auth[_0xbcdd('0x8')](),controller[_0xbcdd('0xf')]);module['exports']=router; \ No newline at end of file +var _0x12e9=['../../components/auth/service','../../components/interaction/service','./cmCustomField.controller','get','isAuthenticated','index','/:id','show','post','update','delete','exports','path','express','Router'];(function(_0xb66208,_0x533afa){var _0x374422=function(_0x406a8c){while(--_0x406a8c){_0xb66208['push'](_0xb66208['shift']());}};_0x374422(++_0x533afa);}(_0x12e9,0x66));var _0x912e=function(_0x2c0813,_0x10adb4){_0x2c0813=_0x2c0813-0x0;var _0x2d96eb=_0x12e9[_0x2c0813];return _0x2d96eb;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x912e('0x0'));var timeout=require('connect-timeout');var express=require(_0x912e('0x1'));var router=express[_0x912e('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x912e('0x3'));var interaction=require(_0x912e('0x4'));var config=require('../../config/environment');var controller=require(_0x912e('0x5'));router[_0x912e('0x6')]('/',auth[_0x912e('0x7')](),controller[_0x912e('0x8')]);router['get'](_0x912e('0x9'),auth[_0x912e('0x7')](),controller[_0x912e('0xa')]);router[_0x912e('0xb')]('/',auth[_0x912e('0x7')](),controller['create']);router['put']('/:id',auth[_0x912e('0x7')](),controller[_0x912e('0xc')]);router[_0x912e('0xd')](_0x912e('0x9'),auth[_0x912e('0x7')](),controller['destroy']);module[_0x912e('0xe')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index b82c18d..f1887a9 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 _0xce09=['contactListQueue','moment','sequelize','STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','BOOLEAN','UNSIGNED'];(function(_0x42fcbf,_0x408d98){var _0xcbd754=function(_0x2d8066){while(--_0x2d8066){_0x42fcbf['push'](_0x42fcbf['shift']());}};_0xcbd754(++_0x408d98);}(_0xce09,0x187));var _0x9ce0=function(_0x5cf6b3,_0x3ea1b7){_0x5cf6b3=_0x5cf6b3-0x0;var _0x92e06b=_0xce09[_0x5cf6b3];return _0x92e06b;};'use strict';var moment=require(_0x9ce0('0x0'));var Sequelize=require(_0x9ce0('0x1'));module['exports']={'phone':{'type':Sequelize[_0x9ce0('0x2')],'allowNull':![]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x9ce0('0x3')],'defaultValue':moment()[_0x9ce0('0x4')](_0x9ce0('0x5'))},'countbusyretry':{'type':Sequelize[_0x9ce0('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x9ce0('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize[_0x9ce0('0x7')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'priority':{'type':Sequelize[_0x9ce0('0x6')](0x2)[_0x9ce0('0x8')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x9ce0('0x7')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x9ce0('0x6')],'unique':_0x9ce0('0x9')},'ListId':{'type':Sequelize[_0x9ce0('0x6')],'unique':_0x9ce0('0x9')},'UserId':{'type':Sequelize[_0x9ce0('0x6')]},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0x9ce0('0x9')},'CampaignId':{'type':Sequelize[_0x9ce0('0x6')]},'countnosuchnumberretry':{'type':Sequelize[_0x9ce0('0x6')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x9ce0('0x6')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x9ce0('0x6')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0x9ce0('0x6')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x9ce0('0x2')]},'recallmeNotifiedDate':{'type':Sequelize[_0x9ce0('0x3')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file +var _0x459a=['YYYY-MM-DD\x20HH:mm:ss','INTEGER','STRING','BOOLEAN','contactListQueue','exports','DATE','format'];(function(_0x492dd7,_0x566cd0){var _0x28430a=function(_0x4259fa){while(--_0x4259fa){_0x492dd7['push'](_0x492dd7['shift']());}};_0x28430a(++_0x566cd0);}(_0x459a,0x1d5));var _0xa459=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x459a[_0x126558];return _0x1f6d14;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0xa459('0x0')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xa459('0x1')],'defaultValue':moment()[_0xa459('0x2')](_0xa459('0x3'))},'countbusyretry':{'type':Sequelize[_0xa459('0x4')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xa459('0x4')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xa459('0x5')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'priority':{'type':Sequelize[_0xa459('0x4')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xa459('0x6')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xa459('0x4')],'unique':_0xa459('0x7')},'ListId':{'type':Sequelize[_0xa459('0x4')],'unique':_0xa459('0x7')},'UserId':{'type':Sequelize['INTEGER']},'VoiceQueueId':{'type':Sequelize[_0xa459('0x4')],'unique':_0xa459('0x7')},'CampaignId':{'type':Sequelize[_0xa459('0x4')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xa459('0x4')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xa459('0x4')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xa459('0x4')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0xa459('0x4')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xa459('0x5')]},'recallmeNotifiedDate':{'type':Sequelize[_0xa459('0x1')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index 0899d85..f2ce6fe 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 _0xb66c=['$iLike','$notILike','$overlap','$contains','$contained','$any','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','create','body','describe','destroy','VoiceQueueId','CampaignId','VoiceQueue','find','omit','dataValues','createdAt','updatedAt','state','statedesc','deleted','campaign','user','UserId','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','ivr','CmContact','ContactId','lastName','isNil','firstName','calleridname','CmHopperFinal','CmHopperAdditionalPhone','end','keys','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','dialPreviewAutoRecallMe','sequelize','transaction','value','direction','prev','isEmpty','hopperIds','priority','ASC','scheduledAt','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','recallme','LOCK','UPDATE','Contact','CmCompany','Company','CmList','List','Queue','dialActive','getPreviewRecall','error','CmHopper,\x20%s,\x20%s,\x20%s','getOpenContacts','sendStatus','getTimezones','timezones','push','utcOffset','getTimezone','moment','../../components/parsers/qs','api','../../config/environment','../../mysqldb','status','json','offset','undefined','limit','count','Content-Range','update','then','name','send','map','CmHopper','rawAttributes','model','query','filters','intersection','concat','$and','$gte','$lt','$lte','$eq','$not','$between','$notBetween','$notIn','$like','$notLike'];(function(_0x1f9d16,_0x5f1fd2){var _0x17f913=function(_0x1e90a7){while(--_0x1e90a7){_0x1f9d16['push'](_0x1f9d16['shift']());}};_0x17f913(++_0x5f1fd2);}(_0xb66c,0x175));var _0xcb66=function(_0x264e2e,_0x2fec7b){_0x264e2e=_0x264e2e-0x0;var _0x2c43a5=_0xb66c[_0x264e2e];return _0x2c43a5;};'use strict';var moment=require(_0xcb66('0x0'));var _=require('lodash');var qs=require(_0xcb66('0x1'));var logger=require('../../config/logger')(_0xcb66('0x2'));var shared=require(_0xcb66('0x3'));var db=require(_0xcb66('0x4'))['db'];function respondWithResult(_0x5f487c,_0x35d439){_0x35d439=_0x35d439||0xc8;return function(_0x386241){if(_0x386241){return _0x5f487c[_0xcb66('0x5')](_0x35d439)[_0xcb66('0x6')](_0x386241);}};}function respondWithFilteredResult(_0x5d766d,_0x518163){return function(_0x19adf5){if(_0x19adf5){var _0x1b6852=typeof _0x518163[_0xcb66('0x7')]===_0xcb66('0x8')&&typeof _0x518163[_0xcb66('0x9')]==='undefined';var _0x2c62ad=_0x19adf5[_0xcb66('0xa')];var _0x174969=_0x1b6852?0x0:_0x518163[_0xcb66('0x7')];var _0x3c4ce1=_0x1b6852?_0x19adf5['count']:_0x518163[_0xcb66('0x7')]+_0x518163[_0xcb66('0x9')];var _0xf12828;if(_0x3c4ce1>=_0x2c62ad){_0x3c4ce1=_0x2c62ad;_0xf12828=0xc8;}else{_0xf12828=0xce;}_0x5d766d[_0xcb66('0x5')](_0xf12828);return _0x5d766d['set'](_0xcb66('0xb'),_0x174969+'-'+_0x3c4ce1+'/'+_0x2c62ad)[_0xcb66('0x6')](_0x19adf5);}return null;};}function saveUpdates(_0x4105d2,_0x2339bb){return function(_0x582523){if(_0x582523){return _0x582523[_0xcb66('0xc')](_0x4105d2)[_0xcb66('0xd')](function(_0x36c846){return _0x36c846;});}return null;};}function handleEntityNotFound(_0x401bc9,_0x58fb9e){return function(_0x19072b){if(!_0x19072b){_0x401bc9['sendStatus'](0x194);}return _0x19072b;};}function handleError(_0x6af5b5,_0x52b058){_0x52b058=_0x52b058||0x1f4;return function(_0x27442d){logger['error'](_0x27442d['stack']);if(_0x27442d[_0xcb66('0xe')]){delete _0x27442d[_0xcb66('0xe')];}_0x6af5b5[_0xcb66('0x5')](_0x52b058)[_0xcb66('0xf')](_0x27442d);};}exports['index']=function(_0x3a6e26,_0x42ad03){var _0x8a0f3f={},_0x58bca0={},_0x2e4126={'count':0x0,'rows':[]};var _0x496d12=_[_0xcb66('0x10')](db[_0xcb66('0x11')][_0xcb66('0x12')],function(_0x1ccb71){return{'name':_0x1ccb71['fieldName'],'type':_0x1ccb71['type']['key']};});_0x58bca0[_0xcb66('0x13')]=_['map'](_0x496d12,'name');_0x58bca0[_0xcb66('0x14')]=_['keys'](_0x3a6e26[_0xcb66('0x14')]);_0x58bca0[_0xcb66('0x15')]=_[_0xcb66('0x16')](_0x58bca0[_0xcb66('0x13')],_0x58bca0[_0xcb66('0x14')]);_0x58bca0[_0xcb66('0x15')]=_[_0xcb66('0x17')](_0x58bca0['filters'],[_0xcb66('0x18'),'$or','$gt',_0xcb66('0x19'),_0xcb66('0x1a'),_0xcb66('0x1b'),'$ne',_0xcb66('0x1c'),_0xcb66('0x1d'),_0xcb66('0x1e'),_0xcb66('0x1f'),'$in',_0xcb66('0x20'),_0xcb66('0x21'),_0xcb66('0x22'),_0xcb66('0x23'),_0xcb66('0x24'),_0xcb66('0x21'),_0xcb66('0x25'),_0xcb66('0x26'),_0xcb66('0x27'),_0xcb66('0x28')]);_0x8a0f3f['attributes']=_[_0xcb66('0x16')](_0x58bca0['model'],qs['fields'](_0x3a6e26['query'][_0xcb66('0x29')]));_0x8a0f3f['attributes']=_0x8a0f3f[_0xcb66('0x2a')][_0xcb66('0x2b')]?_0x8a0f3f[_0xcb66('0x2a')]:_0x58bca0['model'];if(!_0x3a6e26[_0xcb66('0x14')][_0xcb66('0x2c')](_0xcb66('0x2d'))){_0x8a0f3f[_0xcb66('0x9')]=qs[_0xcb66('0x9')](_0x3a6e26[_0xcb66('0x14')][_0xcb66('0x9')]);_0x8a0f3f[_0xcb66('0x7')]=qs[_0xcb66('0x7')](_0x3a6e26[_0xcb66('0x14')]['offset']);}_0x8a0f3f[_0xcb66('0x2e')]=qs[_0xcb66('0x2f')](_0x3a6e26[_0xcb66('0x14')][_0xcb66('0x2f')]);_0x8a0f3f[_0xcb66('0x30')]=qs[_0xcb66('0x15')](_[_0xcb66('0x31')](_0x3a6e26['query'],_0x58bca0[_0xcb66('0x15')]),_0x496d12);if(_0x3a6e26[_0xcb66('0x14')][_0xcb66('0x32')]){_0x8a0f3f[_0xcb66('0x30')]=_['merge'](_0x8a0f3f[_0xcb66('0x30')],{'$or':_[_0xcb66('0x10')](_0x496d12,function(_0x907fff){if(_0x907fff[_0xcb66('0x33')]!==_0xcb66('0x34')){var _0x1d9957={};_0x1d9957[_0x907fff[_0xcb66('0xe')]]={'$like':'%'+_0x3a6e26[_0xcb66('0x14')][_0xcb66('0x32')]+'%'};return _0x1d9957;}})});}_0x8a0f3f=_[_0xcb66('0x35')]({},_0x8a0f3f,_0x3a6e26[_0xcb66('0x36')]);var _0x17b087={'where':_0x8a0f3f['where']};return db['CmHopper']['count'](_0x17b087)[_0xcb66('0xd')](function(_0x4182f9){_0x2e4126[_0xcb66('0xa')]=_0x4182f9;if(_0x3a6e26[_0xcb66('0x14')][_0xcb66('0x37')]){_0x8a0f3f[_0xcb66('0x38')]=[{'all':!![]}];}return db['CmHopper'][_0xcb66('0x39')](_0x8a0f3f);})['then'](function(_0x4b25f0){_0x2e4126['rows']=_0x4b25f0;return _0x2e4126;})[_0xcb66('0xd')](respondWithFilteredResult(_0x42ad03,_0x8a0f3f))[_0xcb66('0x3a')](handleError(_0x42ad03,null));};exports[_0xcb66('0x3b')]=function(_0x9db922,_0x11d2ac){var _0x3e71a7={'raw':!![],'where':{'id':_0x9db922[_0xcb66('0x3c')]['id']}},_0x3422b6={};_0x3422b6[_0xcb66('0x13')]=_['keys'](db[_0xcb66('0x11')][_0xcb66('0x12')]);_0x3422b6[_0xcb66('0x14')]=_['keys'](_0x9db922[_0xcb66('0x14')]);_0x3422b6[_0xcb66('0x15')]=_['intersection'](_0x3422b6['model'],_0x3422b6[_0xcb66('0x14')]);_0x3e71a7['attributes']=_['intersection'](_0x3422b6[_0xcb66('0x13')],qs[_0xcb66('0x29')](_0x9db922[_0xcb66('0x14')][_0xcb66('0x29')]));_0x3e71a7[_0xcb66('0x2a')]=_0x3e71a7[_0xcb66('0x2a')][_0xcb66('0x2b')]?_0x3e71a7[_0xcb66('0x2a')]:_0x3422b6[_0xcb66('0x13')];if(_0x9db922['query']['includeAll']){_0x3e71a7['include']=[{'all':!![]}];}_0x3e71a7=_[_0xcb66('0x35')]({},_0x3e71a7,_0x9db922['options']);return db[_0xcb66('0x11')]['find'](_0x3e71a7)[_0xcb66('0xd')](handleEntityNotFound(_0x11d2ac,null))[_0xcb66('0xd')](respondWithResult(_0x11d2ac,null))[_0xcb66('0x3a')](handleError(_0x11d2ac,null));};exports[_0xcb66('0x3d')]=function(_0x3115e2,_0xbc92e){return db['CmHopper']['create'](_0x3115e2[_0xcb66('0x3e')],{})[_0xcb66('0xd')](respondWithResult(_0xbc92e,0xc9))[_0xcb66('0x3a')](handleError(_0xbc92e,null));};exports[_0xcb66('0xc')]=function(_0xf2c532,_0x1c149b){if(_0xf2c532[_0xcb66('0x3e')]['id']){delete _0xf2c532[_0xcb66('0x3e')]['id'];}return db[_0xcb66('0x11')]['find']({'where':{'id':_0xf2c532[_0xcb66('0x3c')]['id']}})[_0xcb66('0xd')](handleEntityNotFound(_0x1c149b,null))[_0xcb66('0xd')](saveUpdates(_0xf2c532[_0xcb66('0x3e')],null))['then'](respondWithResult(_0x1c149b,null))[_0xcb66('0x3a')](handleError(_0x1c149b,null));};exports[_0xcb66('0x3f')]=function(_0x1aab4e,_0x5a1083){return db[_0xcb66('0x11')][_0xcb66('0x3f')]()[_0xcb66('0xd')](respondWithResult(_0x5a1083,null))[_0xcb66('0x3a')](handleError(_0x5a1083,null));};exports['destroy']=function(_0x43e0e0,_0xb0854f){var _0x3b839b;var _0x4b1d46=_0x43e0e0['params']['id'];return db[_0xcb66('0x11')]['find']({'where':{'id':_0x43e0e0[_0xcb66('0x3c')]['id']}})['then'](handleEntityNotFound(_0xb0854f,null))[_0xcb66('0xd')](function(_0x416448){if(_0x416448){return _0x416448[_0xcb66('0x40')]()['then'](function(_0x2071d5){return _0x2071d5;});}})['then'](function(_0x228504){_0x3b839b=_0x228504;if(_0x228504){if(_0x228504[_0xcb66('0x41')]||_0x228504[_0xcb66('0x42')]){return db[_0x228504[_0xcb66('0x41')]?_0xcb66('0x43'):'Campaign'][_0xcb66('0x44')]({'where':{'id':_0x228504['VoiceQueueId']?_0x228504[_0xcb66('0x41')]:_0x228504[_0xcb66('0x42')]},'attributes':['id',_0xcb66('0xe')],'raw':!![]});}}})['then'](function(_0x48d7a3){var _0x52ff91={};if(_0x48d7a3){_[_0xcb66('0x35')](_0x52ff91,_[_0xcb66('0x45')](_0x3b839b[_0xcb66('0x46')],[_0xcb66('0x47'),_0xcb66('0x48'),'id']));_0x52ff91[_0xcb66('0x49')]=0x15;_0x52ff91[_0xcb66('0x4a')]=_0xcb66('0x4b');_0x52ff91[_0xcb66('0x4c')]=_0x48d7a3[_0xcb66('0xe')];_0x52ff91['membername']=_0x43e0e0[_0xcb66('0x4d')][_0xcb66('0xe')];_0x52ff91[_0xcb66('0x4e')]=_0x43e0e0[_0xcb66('0x4d')]['id'];_0x52ff91['deleted']=!![];_0x52ff91['deletedat']=moment()[_0xcb66('0x4f')](_0xcb66('0x50'));_0x52ff91[_0xcb66('0x51')]=_0x3b839b[_0xcb66('0x52')];_0x52ff91[_0xcb66('0x53')]=_0x3b839b[_0xcb66('0x41')]?'queue':_0xcb66('0x54');return db[_0xcb66('0x55')][_0xcb66('0x44')]({'where':{'id':_0x52ff91[_0xcb66('0x56')]},'attributes':['firstName',_0xcb66('0x57')]})['then'](function(_0xd37bbd){if(!_['isNil'](_0xb0854f)&&!_[_0xcb66('0x58')](_0xd37bbd[_0xcb66('0x59')])){_0x52ff91[_0xcb66('0x5a')]=_0xd37bbd['firstName'];if(!_['isNil'](_0xd37bbd[_0xcb66('0x57')])){_0x52ff91[_0xcb66('0x5a')]+='\x20'+_0xd37bbd['lastName'];}}})['finally'](function(){return db[_0xcb66('0x5b')]['create'](_0x52ff91);});}})[_0xcb66('0xd')](function(_0x56e524){return db[_0xcb66('0x5c')][_0xcb66('0x40')]({'where':{'CmHopperId':_0x4b1d46}});})[_0xcb66('0xd')](function(){return _0xb0854f['status'](0xcc)[_0xcb66('0x5d')]();})[_0xcb66('0x3a')](handleError(_0xb0854f,null));};exports['getPreview']=function(_0x244003,_0x27e83c){var _0x417c7e=[];return db[_0xcb66('0x55')][_0xcb66('0x3f')]()[_0xcb66('0xd')](function(_0x5352aa){_0x417c7e=_[_0xcb66('0x5e')](_0x5352aa);return _0x244003[_0xcb66('0x4d')][_0xcb66('0x5f')]({'where':{'type':_0xcb66('0x60'),'dialActive':!![],'dialMethod':_0xcb66('0x61')},'attributes':['id',_0xcb66('0x62'),_0xcb66('0x63')],'raw':!![]});})[_0xcb66('0xd')](function(_0x1e2287){if(_0x1e2287&&_0x1e2287['length']){return db[_0xcb66('0x64')][_0xcb66('0x65')](function(_0x25e648){var _0x3ab8b3={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xcb66('0x4f')](_0xcb66('0x50'))},'VoiceQueueId':{'$in':_['map'](_0x1e2287,'id')},'$or':[{'UserId':null},{'UserId':_0x244003[_0xcb66('0x4d')]['id']}]};var _0x40d4f3={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x1e2287)['filter']([_0xcb66('0x63'),0x0])[_0xcb66('0x10')]('id')[_0xcb66('0x66')]()},'$or':[{'UserId':null},{'UserId':_0x244003[_0xcb66('0x4d')]['id']}]};var _0x5b6e1f={'$or':[_0x3ab8b3,_0x40d4f3]};var _0x3dbc42=[];if(_0x244003[_0xcb66('0x3e')][_0xcb66('0x67')]&&_0x244003[_0xcb66('0x3e')][_0xcb66('0x67')]===_0xcb66('0x68')){if(!_[_0xcb66('0x69')](_0x244003[_0xcb66('0x3e')][_0xcb66('0x6a')])){_0x5b6e1f['id']={'$in':_0x244003[_0xcb66('0x3e')]['hopperIds']};}_0x3dbc42=[[_0xcb66('0x6b'),_0xcb66('0x6c')],[_0xcb66('0x6d'),_0x1e2287[0x0][_0xcb66('0x62')]==='ASC'?_0xcb66('0x6e'):_0xcb66('0x6c')],db[_0xcb66('0x64')][_0xcb66('0x6f')](_0xcb66('0x70')),['id',_0xcb66('0x6e')]];}else{if(!_[_0xcb66('0x69')](_0x244003['body']['hopperIds'])){_0x5b6e1f['id']={'$notIn':_0x244003[_0xcb66('0x3e')][_0xcb66('0x6a')]};}_0x3dbc42=[[_0xcb66('0x6b'),_0xcb66('0x6e')],[_0xcb66('0x6d'),_0x1e2287[0x0][_0xcb66('0x62')]],db['sequelize'][_0xcb66('0x6f')](_0xcb66('0x71')),['id',_0xcb66('0x6c')]];}return db[_0xcb66('0x11')][_0xcb66('0x72')]({'attributes':['id',_0xcb66('0x73'),'phone',_0xcb66('0x74')],'where':_0x5b6e1f,'order':_0x3dbc42,'transaction':_0x25e648,'lock':_0x25e648[_0xcb66('0x75')][_0xcb66('0x76')],'include':[{'model':db[_0xcb66('0x55')],'as':_0xcb66('0x77'),'attributes':_0x417c7e,'include':[{'model':db[_0xcb66('0x78')],'as':_0xcb66('0x79'),'attributes':['id',_0xcb66('0xe')]}]},{'model':db[_0xcb66('0x7a')],'as':_0xcb66('0x7b'),'attributes':['id',_0xcb66('0xe')]},{'model':db[_0xcb66('0x43')],'as':_0xcb66('0x7c'),'attributes':['id',_0xcb66('0xe'),_0xcb66('0x7d')]}]})[_0xcb66('0xd')](function(_0x3b0f10){if(_0x3b0f10){return _0x3b0f10[_0xcb66('0xc')]({'UserId':_0x244003[_0xcb66('0x4d')]['id']},{'transaction':_0x25e648});}});});}})['then'](handleEntityNotFound(_0x27e83c,null))[_0xcb66('0xd')](respondWithResult(_0x27e83c,null))['catch'](handleError(_0x27e83c,null));};exports[_0xcb66('0x7e')]=function(_0x51311b,_0x279264,_0x2912c9){var _0x42a71a=[];var _0x1a4cdb=_0x51311b[_0xcb66('0x3c')]['id'];var _0x283600=_0x51311b[_0xcb66('0x4d')]['id'];return db[_0xcb66('0x55')][_0xcb66('0x3f')]()[_0xcb66('0xd')](function(_0xf7c710){_0x42a71a=_[_0xcb66('0x5e')](_0xf7c710);return db[_0xcb66('0x64')]['transaction'](function(_0x91725a){const _0x45b25e={'id':_0x1a4cdb};return db[_0xcb66('0x11')]['findOne']({'attributes':['id',_0xcb66('0x73'),_0xcb66('0x74')],'where':_0x45b25e,'transaction':_0x91725a,'lock':_0x91725a[_0xcb66('0x75')]['UPDATE'],'include':[{'model':db[_0xcb66('0x55')],'as':_0xcb66('0x77'),'attributes':_0x42a71a,'include':[{'model':db[_0xcb66('0x78')],'as':_0xcb66('0x79'),'attributes':['id',_0xcb66('0xe')]}]},{'model':db[_0xcb66('0x7a')],'as':'List','attributes':['id',_0xcb66('0xe')]},{'model':db['VoiceQueue'],'as':_0xcb66('0x7c'),'attributes':['id','name',_0xcb66('0x7d')]}]})['then'](function(_0x3b4c30){if(_0x3b4c30){return _0x3b4c30[_0xcb66('0xc')]({'UserId':_0x283600},{'transaction':_0x91725a});}});});})[_0xcb66('0xd')](handleEntityNotFound(_0x279264,null))['then'](respondWithResult(_0x279264,null))[_0xcb66('0x3a')](handleError(_0x279264,null));};exports['getOpenContacts']=function(_0x112f25,_0x21d871){return _0x112f25[_0xcb66('0x4d')][_0xcb66('0x5f')]({'where':{'type':_0xcb66('0x60'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id'],'raw':!![]})[_0xcb66('0xd')](function(_0xfa72ee){if(_0xfa72ee&&_0xfa72ee[_0xcb66('0x2b')]){return db[_0xcb66('0x11')]['count']({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xcb66('0x4f')](_0xcb66('0x50'))},'VoiceQueueId':{'$in':_['map'](_0xfa72ee,'id')},'$or':[{'UserId':null},{'UserId':_0x112f25[_0xcb66('0x4d')]['id']}]}});}return 0x0;})[_0xcb66('0xd')](function(_0x16f9a3){if(!_[_0xcb66('0x58')](_0x16f9a3)&&_['isNumber'](_0x16f9a3)){return _0x21d871[_0xcb66('0x5')](0xc8)[_0xcb66('0x6')]({'contacts':_0x16f9a3});}else{logger[_0xcb66('0x7f')](_0xcb66('0x80'),_0xcb66('0x81'),0x194,'entity\x20not\x20found');_0x21d871[_0xcb66('0x82')](0x194);}})[_0xcb66('0x3a')](handleError(_0x21d871,null));};exports[_0xcb66('0x83')]=function(_0x1105d5,_0xb3a1e){var _0xf7b62b=shared[_0xcb66('0x84')];var _0x5b0db8=[];_['map'](_0xf7b62b,function(_0x56b8d5){_0x5b0db8[_0xcb66('0x85')]({'id':_0x56b8d5[_0xcb66('0xe')],'name':_0x56b8d5['name'],'utcOffset':_0x56b8d5[_0xcb66('0x86')]});});return _0xb3a1e['status'](0xc8)[_0xcb66('0x6')]({'tz':_0x5b0db8});};exports[_0xcb66('0x87')]=function(_0x220fea,_0x28987a){var _0x4d45b2=shared[_0xcb66('0x84')];var _0x2c08fc={};if(!_[_0xcb66('0x58')](_0x4d45b2[_0x220fea[_0xcb66('0x3e')]['id']]))_0x2c08fc=_0x4d45b2[_0x220fea[_0xcb66('0x3e')]['id']];return _0x28987a['status'](0xc8)['json'](_0x2c08fc);}; \ No newline at end of file +var _0xf0ba=['filter','merge','VIRTUAL','includeAll','findAll','catch','show','params','keys','include','options','find','create','body','update','describe','destroy','VoiceQueueId','CampaignId','VoiceQueue','Campaign','omit','dataValues','createdAt','updatedAt','statedesc','deleted','campaign','membername','user','UserId','deletedat','YYYY-MM-DD\x20HH:mm:ss','calleridnum','queue','CmContact','ContactId','firstName','lastName','isNil','calleridname','finally','CmHopperFinal','CmHopperAdditionalPhone','status','getPreview','getVoiceQueues','sequelize','transaction','format','value','direction','hopperIds','ASC','DESC','COALESCE(CmHopper.UserId,\x200)\x20ASC','isEmpty','priority','scheduledAt','dialOrderByScheduledAt','literal','findOne','scheduledat','phone','recallme','LOCK','Contact','CmCompany','Company','CmList','List','dialActive','getPreviewRecall','UPDATE','Queue','getOpenContacts','outbound','preview','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','getTimezones','timezones','push','utcOffset','moment','lodash','../../components/parsers/qs','../../config/logger','api','../../mysqldb','json','offset','undefined','limit','count','set','Content-Range','then','sendStatus','error','stack','name','send','map','CmHopper','rawAttributes','type','key','model','query','filters','intersection','$and','$or','$gt','$gte','$lt','$lte','$ne','$not','$between','$notBetween','$notIn','$like','$overlap','$contains','$any','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick'];(function(_0x7279d0,_0x5bbab9){var _0x44554f=function(_0x2e2b11){while(--_0x2e2b11){_0x7279d0['push'](_0x7279d0['shift']());}};_0x44554f(++_0x5bbab9);}(_0xf0ba,0x1ed));var _0xaf0b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf0ba[_0x20a584];return _0x4b41a8;};'use strict';var moment=require(_0xaf0b('0x0'));var _=require(_0xaf0b('0x1'));var qs=require(_0xaf0b('0x2'));var logger=require(_0xaf0b('0x3'))(_0xaf0b('0x4'));var shared=require('../../config/environment');var db=require(_0xaf0b('0x5'))['db'];function respondWithResult(_0xce0364,_0x4cffa5){_0x4cffa5=_0x4cffa5||0xc8;return function(_0xcd565f){if(_0xcd565f){return _0xce0364['status'](_0x4cffa5)[_0xaf0b('0x6')](_0xcd565f);}};}function respondWithFilteredResult(_0x4b3b85,_0x4d1479){return function(_0x53b32d){if(_0x53b32d){var _0x1d260e=typeof _0x4d1479[_0xaf0b('0x7')]===_0xaf0b('0x8')&&typeof _0x4d1479[_0xaf0b('0x9')]==='undefined';var _0x2fac18=_0x53b32d[_0xaf0b('0xa')];var _0x26bb21=_0x1d260e?0x0:_0x4d1479['offset'];var _0x392802=_0x1d260e?_0x53b32d['count']:_0x4d1479[_0xaf0b('0x7')]+_0x4d1479[_0xaf0b('0x9')];var _0x3606c3;if(_0x392802>=_0x2fac18){_0x392802=_0x2fac18;_0x3606c3=0xc8;}else{_0x3606c3=0xce;}_0x4b3b85['status'](_0x3606c3);return _0x4b3b85[_0xaf0b('0xb')](_0xaf0b('0xc'),_0x26bb21+'-'+_0x392802+'/'+_0x2fac18)[_0xaf0b('0x6')](_0x53b32d);}return null;};}function saveUpdates(_0x1ada96,_0x283de8){return function(_0x31ced1){if(_0x31ced1){return _0x31ced1['update'](_0x1ada96)[_0xaf0b('0xd')](function(_0xdbd3d6){return _0xdbd3d6;});}return null;};}function handleEntityNotFound(_0xc72b7d,_0x27732e){return function(_0x4f0c02){if(!_0x4f0c02){_0xc72b7d[_0xaf0b('0xe')](0x194);}return _0x4f0c02;};}function handleError(_0x46db7f,_0x45c1b2){_0x45c1b2=_0x45c1b2||0x1f4;return function(_0x2cb9a2){logger[_0xaf0b('0xf')](_0x2cb9a2[_0xaf0b('0x10')]);if(_0x2cb9a2[_0xaf0b('0x11')]){delete _0x2cb9a2[_0xaf0b('0x11')];}_0x46db7f['status'](_0x45c1b2)[_0xaf0b('0x12')](_0x2cb9a2);};}exports['index']=function(_0x152f69,_0x1dd132){var _0x36b059={},_0xbe0d1e={},_0x3201ed={'count':0x0,'rows':[]};var _0x3fcbd7=_[_0xaf0b('0x13')](db[_0xaf0b('0x14')][_0xaf0b('0x15')],function(_0x2f563a){return{'name':_0x2f563a['fieldName'],'type':_0x2f563a[_0xaf0b('0x16')][_0xaf0b('0x17')]};});_0xbe0d1e[_0xaf0b('0x18')]=_['map'](_0x3fcbd7,_0xaf0b('0x11'));_0xbe0d1e[_0xaf0b('0x19')]=_['keys'](_0x152f69[_0xaf0b('0x19')]);_0xbe0d1e[_0xaf0b('0x1a')]=_[_0xaf0b('0x1b')](_0xbe0d1e[_0xaf0b('0x18')],_0xbe0d1e[_0xaf0b('0x19')]);_0xbe0d1e['filters']=_['concat'](_0xbe0d1e[_0xaf0b('0x1a')],[_0xaf0b('0x1c'),_0xaf0b('0x1d'),_0xaf0b('0x1e'),_0xaf0b('0x1f'),_0xaf0b('0x20'),_0xaf0b('0x21'),_0xaf0b('0x22'),'$eq',_0xaf0b('0x23'),_0xaf0b('0x24'),_0xaf0b('0x25'),'$in',_0xaf0b('0x26'),_0xaf0b('0x27'),'$notLike','$iLike','$notILike',_0xaf0b('0x27'),_0xaf0b('0x28'),_0xaf0b('0x29'),'$contained',_0xaf0b('0x2a')]);_0x36b059[_0xaf0b('0x2b')]=_[_0xaf0b('0x1b')](_0xbe0d1e[_0xaf0b('0x18')],qs[_0xaf0b('0x2c')](_0x152f69[_0xaf0b('0x19')][_0xaf0b('0x2c')]));_0x36b059['attributes']=_0x36b059[_0xaf0b('0x2b')][_0xaf0b('0x2d')]?_0x36b059['attributes']:_0xbe0d1e[_0xaf0b('0x18')];if(!_0x152f69[_0xaf0b('0x19')][_0xaf0b('0x2e')](_0xaf0b('0x2f'))){_0x36b059[_0xaf0b('0x9')]=qs[_0xaf0b('0x9')](_0x152f69[_0xaf0b('0x19')][_0xaf0b('0x9')]);_0x36b059[_0xaf0b('0x7')]=qs['offset'](_0x152f69[_0xaf0b('0x19')]['offset']);}_0x36b059['order']=qs['sort'](_0x152f69[_0xaf0b('0x19')][_0xaf0b('0x30')]);_0x36b059[_0xaf0b('0x31')]=qs[_0xaf0b('0x1a')](_[_0xaf0b('0x32')](_0x152f69[_0xaf0b('0x19')],_0xbe0d1e['filters']),_0x3fcbd7);if(_0x152f69[_0xaf0b('0x19')][_0xaf0b('0x33')]){_0x36b059[_0xaf0b('0x31')]=_[_0xaf0b('0x34')](_0x36b059[_0xaf0b('0x31')],{'$or':_[_0xaf0b('0x13')](_0x3fcbd7,function(_0x613b5c){if(_0x613b5c[_0xaf0b('0x16')]!==_0xaf0b('0x35')){var _0x39604e={};_0x39604e[_0x613b5c['name']]={'$like':'%'+_0x152f69[_0xaf0b('0x19')]['filter']+'%'};return _0x39604e;}})});}_0x36b059=_[_0xaf0b('0x34')]({},_0x36b059,_0x152f69['options']);var _0x1f429d={'where':_0x36b059['where']};return db[_0xaf0b('0x14')][_0xaf0b('0xa')](_0x1f429d)[_0xaf0b('0xd')](function(_0x24fcde){_0x3201ed[_0xaf0b('0xa')]=_0x24fcde;if(_0x152f69[_0xaf0b('0x19')][_0xaf0b('0x36')]){_0x36b059['include']=[{'all':!![]}];}return db[_0xaf0b('0x14')][_0xaf0b('0x37')](_0x36b059);})[_0xaf0b('0xd')](function(_0x17fe16){_0x3201ed['rows']=_0x17fe16;return _0x3201ed;})[_0xaf0b('0xd')](respondWithFilteredResult(_0x1dd132,_0x36b059))[_0xaf0b('0x38')](handleError(_0x1dd132,null));};exports[_0xaf0b('0x39')]=function(_0x42bda1,_0x2d7e01){var _0x5df6d2={'raw':!![],'where':{'id':_0x42bda1[_0xaf0b('0x3a')]['id']}},_0x21ef80={};_0x21ef80[_0xaf0b('0x18')]=_[_0xaf0b('0x3b')](db[_0xaf0b('0x14')][_0xaf0b('0x15')]);_0x21ef80[_0xaf0b('0x19')]=_['keys'](_0x42bda1[_0xaf0b('0x19')]);_0x21ef80['filters']=_[_0xaf0b('0x1b')](_0x21ef80[_0xaf0b('0x18')],_0x21ef80[_0xaf0b('0x19')]);_0x5df6d2[_0xaf0b('0x2b')]=_[_0xaf0b('0x1b')](_0x21ef80[_0xaf0b('0x18')],qs[_0xaf0b('0x2c')](_0x42bda1[_0xaf0b('0x19')][_0xaf0b('0x2c')]));_0x5df6d2['attributes']=_0x5df6d2[_0xaf0b('0x2b')][_0xaf0b('0x2d')]?_0x5df6d2[_0xaf0b('0x2b')]:_0x21ef80[_0xaf0b('0x18')];if(_0x42bda1[_0xaf0b('0x19')]['includeAll']){_0x5df6d2[_0xaf0b('0x3c')]=[{'all':!![]}];}_0x5df6d2=_['merge']({},_0x5df6d2,_0x42bda1[_0xaf0b('0x3d')]);return db[_0xaf0b('0x14')][_0xaf0b('0x3e')](_0x5df6d2)[_0xaf0b('0xd')](handleEntityNotFound(_0x2d7e01,null))[_0xaf0b('0xd')](respondWithResult(_0x2d7e01,null))[_0xaf0b('0x38')](handleError(_0x2d7e01,null));};exports[_0xaf0b('0x3f')]=function(_0x1acc55,_0x1dfd2c){return db['CmHopper'][_0xaf0b('0x3f')](_0x1acc55[_0xaf0b('0x40')],{})['then'](respondWithResult(_0x1dfd2c,0xc9))[_0xaf0b('0x38')](handleError(_0x1dfd2c,null));};exports[_0xaf0b('0x41')]=function(_0xd5e1be,_0x2d4297){if(_0xd5e1be[_0xaf0b('0x40')]['id']){delete _0xd5e1be[_0xaf0b('0x40')]['id'];}return db[_0xaf0b('0x14')][_0xaf0b('0x3e')]({'where':{'id':_0xd5e1be[_0xaf0b('0x3a')]['id']}})[_0xaf0b('0xd')](handleEntityNotFound(_0x2d4297,null))[_0xaf0b('0xd')](saveUpdates(_0xd5e1be['body'],null))[_0xaf0b('0xd')](respondWithResult(_0x2d4297,null))[_0xaf0b('0x38')](handleError(_0x2d4297,null));};exports[_0xaf0b('0x42')]=function(_0x146820,_0x474863){return db[_0xaf0b('0x14')][_0xaf0b('0x42')]()[_0xaf0b('0xd')](respondWithResult(_0x474863,null))[_0xaf0b('0x38')](handleError(_0x474863,null));};exports['destroy']=function(_0x12cfaf,_0x598904){var _0x162edf;var _0x3f8e17=_0x12cfaf[_0xaf0b('0x3a')]['id'];return db[_0xaf0b('0x14')][_0xaf0b('0x3e')]({'where':{'id':_0x12cfaf[_0xaf0b('0x3a')]['id']}})['then'](handleEntityNotFound(_0x598904,null))[_0xaf0b('0xd')](function(_0x321181){if(_0x321181){return _0x321181[_0xaf0b('0x43')]()[_0xaf0b('0xd')](function(_0x1992a7){return _0x1992a7;});}})[_0xaf0b('0xd')](function(_0x50c07d){_0x162edf=_0x50c07d;if(_0x50c07d){if(_0x50c07d[_0xaf0b('0x44')]||_0x50c07d[_0xaf0b('0x45')]){return db[_0x50c07d[_0xaf0b('0x44')]?_0xaf0b('0x46'):_0xaf0b('0x47')][_0xaf0b('0x3e')]({'where':{'id':_0x50c07d[_0xaf0b('0x44')]?_0x50c07d['VoiceQueueId']:_0x50c07d[_0xaf0b('0x45')]},'attributes':['id',_0xaf0b('0x11')],'raw':!![]});}}})[_0xaf0b('0xd')](function(_0x492808){var _0xa67c61={};if(_0x492808){_['merge'](_0xa67c61,_[_0xaf0b('0x48')](_0x162edf[_0xaf0b('0x49')],[_0xaf0b('0x4a'),_0xaf0b('0x4b'),'id']));_0xa67c61['state']=0x15;_0xa67c61[_0xaf0b('0x4c')]=_0xaf0b('0x4d');_0xa67c61[_0xaf0b('0x4e')]=_0x492808[_0xaf0b('0x11')];_0xa67c61[_0xaf0b('0x4f')]=_0x12cfaf[_0xaf0b('0x50')][_0xaf0b('0x11')];_0xa67c61[_0xaf0b('0x51')]=_0x12cfaf[_0xaf0b('0x50')]['id'];_0xa67c61['deleted']=!![];_0xa67c61[_0xaf0b('0x52')]=moment()['format'](_0xaf0b('0x53'));_0xa67c61[_0xaf0b('0x54')]=_0x162edf['phone'];_0xa67c61['campaigntype']=_0x162edf[_0xaf0b('0x44')]?_0xaf0b('0x55'):'ivr';return db[_0xaf0b('0x56')]['find']({'where':{'id':_0xa67c61[_0xaf0b('0x57')]},'attributes':[_0xaf0b('0x58'),_0xaf0b('0x59')]})['then'](function(_0x1ef793){if(!_[_0xaf0b('0x5a')](_0x598904)&&!_[_0xaf0b('0x5a')](_0x1ef793[_0xaf0b('0x58')])){_0xa67c61[_0xaf0b('0x5b')]=_0x1ef793['firstName'];if(!_[_0xaf0b('0x5a')](_0x1ef793[_0xaf0b('0x59')])){_0xa67c61['calleridname']+='\x20'+_0x1ef793[_0xaf0b('0x59')];}}})[_0xaf0b('0x5c')](function(){return db[_0xaf0b('0x5d')][_0xaf0b('0x3f')](_0xa67c61);});}})[_0xaf0b('0xd')](function(_0x303498){return db[_0xaf0b('0x5e')][_0xaf0b('0x43')]({'where':{'CmHopperId':_0x3f8e17}});})[_0xaf0b('0xd')](function(){return _0x598904[_0xaf0b('0x5f')](0xcc)['end']();})[_0xaf0b('0x38')](handleError(_0x598904,null));};exports[_0xaf0b('0x60')]=function(_0x126a5d,_0x42a4b4){var _0x5ed57d=[];return db[_0xaf0b('0x56')][_0xaf0b('0x42')]()['then'](function(_0x5ebcbb){_0x5ed57d=_[_0xaf0b('0x3b')](_0x5ebcbb);return _0x126a5d[_0xaf0b('0x50')][_0xaf0b('0x61')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':'preview'},'attributes':['id','dialOrderByScheduledAt','dialPreviewAutoRecallMe'],'raw':!![]});})['then'](function(_0xf6d249){if(_0xf6d249&&_0xf6d249[_0xaf0b('0x2d')]){return db[_0xaf0b('0x62')][_0xaf0b('0x63')](function(_0x2db367){var _0x4ef2d8={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xaf0b('0x64')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0xaf0b('0x13')](_0xf6d249,'id')},'$or':[{'UserId':null},{'UserId':_0x126a5d[_0xaf0b('0x50')]['id']}]};var _0x4472b0={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0xf6d249)[_0xaf0b('0x33')](['dialPreviewAutoRecallMe',0x0])['map']('id')[_0xaf0b('0x65')]()},'$or':[{'UserId':null},{'UserId':_0x126a5d['user']['id']}]};var _0xff3a3f={'$or':[_0x4ef2d8,_0x4472b0]};var _0x45c22f=[];if(_0x126a5d['body'][_0xaf0b('0x66')]&&_0x126a5d[_0xaf0b('0x40')]['direction']==='prev'){if(!_['isEmpty'](_0x126a5d[_0xaf0b('0x40')][_0xaf0b('0x67')])){_0xff3a3f['id']={'$in':_0x126a5d['body']['hopperIds']};}_0x45c22f=[['priority',_0xaf0b('0x68')],['scheduledAt',_0xf6d249[0x0]['dialOrderByScheduledAt']===_0xaf0b('0x68')?_0xaf0b('0x69'):_0xaf0b('0x68')],db[_0xaf0b('0x62')]['literal'](_0xaf0b('0x6a')),['id',_0xaf0b('0x69')]];}else{if(!_[_0xaf0b('0x6b')](_0x126a5d[_0xaf0b('0x40')][_0xaf0b('0x67')])){_0xff3a3f['id']={'$notIn':_0x126a5d[_0xaf0b('0x40')][_0xaf0b('0x67')]};}_0x45c22f=[[_0xaf0b('0x6c'),_0xaf0b('0x69')],[_0xaf0b('0x6d'),_0xf6d249[0x0][_0xaf0b('0x6e')]],db[_0xaf0b('0x62')][_0xaf0b('0x6f')]('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id',_0xaf0b('0x68')]];}return db['CmHopper'][_0xaf0b('0x70')]({'attributes':['id',_0xaf0b('0x71'),_0xaf0b('0x72'),_0xaf0b('0x73')],'where':_0xff3a3f,'order':_0x45c22f,'transaction':_0x2db367,'lock':_0x2db367[_0xaf0b('0x74')]['UPDATE'],'include':[{'model':db['CmContact'],'as':_0xaf0b('0x75'),'attributes':_0x5ed57d,'include':[{'model':db[_0xaf0b('0x76')],'as':_0xaf0b('0x77'),'attributes':['id','name']}]},{'model':db[_0xaf0b('0x78')],'as':_0xaf0b('0x79'),'attributes':['id',_0xaf0b('0x11')]},{'model':db[_0xaf0b('0x46')],'as':'Queue','attributes':['id',_0xaf0b('0x11'),_0xaf0b('0x7a')]}]})['then'](function(_0x11a48b){if(_0x11a48b){return _0x11a48b[_0xaf0b('0x41')]({'UserId':_0x126a5d['user']['id']},{'transaction':_0x2db367});}});});}})[_0xaf0b('0xd')](handleEntityNotFound(_0x42a4b4,null))[_0xaf0b('0xd')](respondWithResult(_0x42a4b4,null))['catch'](handleError(_0x42a4b4,null));};exports[_0xaf0b('0x7b')]=function(_0x18fc7d,_0x1226ea,_0x4caa18){var _0x59d425=[];var _0x19ff45=_0x18fc7d['params']['id'];var _0x458545=_0x18fc7d['user']['id'];return db[_0xaf0b('0x56')]['describe']()[_0xaf0b('0xd')](function(_0x2d0059){_0x59d425=_['keys'](_0x2d0059);return db[_0xaf0b('0x62')][_0xaf0b('0x63')](function(_0x596ca3){const _0x2f8d36={'id':_0x19ff45};return db[_0xaf0b('0x14')][_0xaf0b('0x70')]({'attributes':['id',_0xaf0b('0x71'),'recallme'],'where':_0x2f8d36,'transaction':_0x596ca3,'lock':_0x596ca3[_0xaf0b('0x74')][_0xaf0b('0x7c')],'include':[{'model':db[_0xaf0b('0x56')],'as':'Contact','attributes':_0x59d425,'include':[{'model':db[_0xaf0b('0x76')],'as':_0xaf0b('0x77'),'attributes':['id',_0xaf0b('0x11')]}]},{'model':db[_0xaf0b('0x78')],'as':_0xaf0b('0x79'),'attributes':['id','name']},{'model':db['VoiceQueue'],'as':_0xaf0b('0x7d'),'attributes':['id','name',_0xaf0b('0x7a')]}]})['then'](function(_0x3a6b0f){if(_0x3a6b0f){return _0x3a6b0f[_0xaf0b('0x41')]({'UserId':_0x458545},{'transaction':_0x596ca3});}});});})[_0xaf0b('0xd')](handleEntityNotFound(_0x1226ea,null))[_0xaf0b('0xd')](respondWithResult(_0x1226ea,null))[_0xaf0b('0x38')](handleError(_0x1226ea,null));};exports[_0xaf0b('0x7e')]=function(_0x26222b,_0x388748){return _0x26222b['user'][_0xaf0b('0x61')]({'where':{'type':_0xaf0b('0x7f'),'dialActive':!![],'dialMethod':_0xaf0b('0x80')},'attributes':['id'],'raw':!![]})[_0xaf0b('0xd')](function(_0x3f7f1c){if(_0x3f7f1c&&_0x3f7f1c[_0xaf0b('0x2d')]){return db['CmHopper'][_0xaf0b('0xa')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0xaf0b('0x13')](_0x3f7f1c,'id')},'$or':[{'UserId':null},{'UserId':_0x26222b[_0xaf0b('0x50')]['id']}]}});}return 0x0;})['then'](function(_0x4918dc){if(!_[_0xaf0b('0x5a')](_0x4918dc)&&_[_0xaf0b('0x81')](_0x4918dc)){return _0x388748[_0xaf0b('0x5f')](0xc8)[_0xaf0b('0x6')]({'contacts':_0x4918dc});}else{logger[_0xaf0b('0xf')](_0xaf0b('0x82'),'getOpenContacts',0x194,_0xaf0b('0x83'));_0x388748['sendStatus'](0x194);}})[_0xaf0b('0x38')](handleError(_0x388748,null));};exports[_0xaf0b('0x84')]=function(_0x183cad,_0x3a591d){var _0x3334f8=shared[_0xaf0b('0x85')];var _0x5d22ae=[];_['map'](_0x3334f8,function(_0x1f899b){_0x5d22ae[_0xaf0b('0x86')]({'id':_0x1f899b[_0xaf0b('0x11')],'name':_0x1f899b['name'],'utcOffset':_0x1f899b[_0xaf0b('0x87')]});});return _0x3a591d['status'](0xc8)[_0xaf0b('0x6')]({'tz':_0x5d22ae});};exports['getTimezone']=function(_0x165761,_0x52ad66){var _0x475268=shared[_0xaf0b('0x85')];var _0x1adac7={};if(!_[_0xaf0b('0x5a')](_0x475268[_0x165761[_0xaf0b('0x40')]['id']]))_0x1adac7=_0x475268[_0x165761['body']['id']];return _0x52ad66['status'](0xc8)[_0xaf0b('0x6')](_0x1adac7);}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index 7647946..4e9b88f 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 _0xdbf5=['define','CmHopper','cm_hopper','scheduledat','phone','priority','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopper.attributes','exports'];(function(_0x55a363,_0x452ede){var _0x37c4d3=function(_0x133b9c){while(--_0x133b9c){_0x55a363['push'](_0x55a363['shift']());}};_0x37c4d3(++_0x452ede);}(_0xdbf5,0x18c));var _0x5dbf=function(_0xd3c2,_0x292a06){_0xd3c2=_0xd3c2-0x0;var _0x51549d=_0xdbf5[_0xd3c2];return _0x51549d;};'use strict';var _=require('lodash');var util=require(_0x5dbf('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x5dbf('0x1'));var BPromise=require(_0x5dbf('0x2'));var rp=require(_0x5dbf('0x3'));var fs=require('fs');var path=require(_0x5dbf('0x4'));var rimraf=require(_0x5dbf('0x5'));var config=require(_0x5dbf('0x6'));var attributes=require(_0x5dbf('0x7'));module[_0x5dbf('0x8')]=function(_0x3f8628,_0x3f8222){return _0x3f8628[_0x5dbf('0x9')](_0x5dbf('0xa'),attributes,{'tableName':_0x5dbf('0xb'),'paranoid':![],'indexes':[{'name':'scheduledat','fields':[_0x5dbf('0xc')]},{'name':'phone','fields':[_0x5dbf('0xd')]},{'name':_0x5dbf('0xe'),'fields':[_0x5dbf('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0295=['define','scheduledat','phone','priority','lodash','api','request-promise','path','rimraf','../../config/environment','./cmHopper.attributes','exports'];(function(_0x550d12,_0x5384bd){var _0x12103d=function(_0x2a9834){while(--_0x2a9834){_0x550d12['push'](_0x550d12['shift']());}};_0x12103d(++_0x5384bd);}(_0x0295,0x1f0));var _0x5029=function(_0x2ef608,_0x53a7b1){_0x2ef608=_0x2ef608-0x0;var _0x56aa07=_0x0295[_0x2ef608];return _0x56aa07;};'use strict';var _=require(_0x5029('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5029('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5029('0x2'));var fs=require('fs');var path=require(_0x5029('0x3'));var rimraf=require(_0x5029('0x4'));var config=require(_0x5029('0x5'));var attributes=require(_0x5029('0x6'));module[_0x5029('0x7')]=function(_0x200217,_0x215955){return _0x200217[_0x5029('0x8')]('CmHopper',attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':'scheduledat','fields':[_0x5029('0x9')]},{'name':'phone','fields':[_0x5029('0xa')]},{'name':'priority','fields':[_0x5029('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index 06bf20a..8085493 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 _0xfa2c=['attributes','limit','map','model','include','then','info','GetCmHopper','debug','catch','error','message','ShowCmHopper','find','stringify','CreateCmHopper','body','update','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','UpdateCmHopper','destroy','DestroyCmHopper','CmContact','describe','sequelize','order','UPDATE','Contact','User','name','voicePause','length','push','includes','all','GetContactDialer','dataValues','ContactId','transaction','CmHopperFinal','create','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','MoveContactManagedDialer','COUNT','literal','`scheduledat`\x20>=\x20','\x22%s\x22','format','contactsRescheduled','CountReScheduled','UserId','LOCK','GetContactRecallMe','GetContactByPhone','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueIds','interval','NOW()\x20+\x20INTERVAL\x20','NOW()','Agent','CmList','List','lodash','util','moment','../../mysqldb','../../config/logger','CmHopper','findAll','options','raw','where'];(function(_0x78beb9,_0x10da99){var _0x44b0f2=function(_0x31edc7){while(--_0x31edc7){_0x78beb9['push'](_0x78beb9['shift']());}};_0x44b0f2(++_0x10da99);}(_0xfa2c,0xda));var _0xcfa2=function(_0x545cad,_0x3c6be9){_0x545cad=_0x545cad-0x0;var _0x22200c=_0xfa2c[_0x545cad];return _0x22200c;};'use strict';var _=require(_0xcfa2('0x0'));var util=require(_0xcfa2('0x1'));var moment=require(_0xcfa2('0x2'));var BPromise=require('bluebird');var db=require(_0xcfa2('0x3'))['db'];var logger=require(_0xcfa2('0x4'))('rpc');exports['GetCmHopper']=function(_0x31de88){var _0xf074fb=this;return new Promise(function(_0x39d02e,_0x2e29d4){return db[_0xcfa2('0x5')][_0xcfa2('0x6')]({'raw':_0x31de88[_0xcfa2('0x7')]?_0x31de88[_0xcfa2('0x7')][_0xcfa2('0x8')]===undefined?!![]:![]:!![],'where':_0x31de88[_0xcfa2('0x7')]?_0x31de88[_0xcfa2('0x7')][_0xcfa2('0x9')]||null:null,'attributes':_0x31de88[_0xcfa2('0x7')]?_0x31de88[_0xcfa2('0x7')][_0xcfa2('0xa')]||null:null,'limit':_0x31de88['options']?_0x31de88[_0xcfa2('0x7')][_0xcfa2('0xb')]||null:null,'include':_0x31de88[_0xcfa2('0x7')]?_0x31de88[_0xcfa2('0x7')]['include']?_[_0xcfa2('0xc')](_0x31de88[_0xcfa2('0x7')]['include'],function(_0x64f448){return{'model':db[_0x64f448[_0xcfa2('0xd')]],'as':_0x64f448['as'],'attributes':_0x64f448['attributes'],'include':_0x64f448['include']?_['map'](_0x64f448['include'],function(_0x15ccd0){return{'model':db[_0x15ccd0[_0xcfa2('0xd')]],'as':_0x15ccd0['as'],'attributes':_0x15ccd0[_0xcfa2('0xa')],'include':_0x15ccd0[_0xcfa2('0xe')]?_[_0xcfa2('0xc')](_0x15ccd0[_0xcfa2('0xe')],function(_0x4a9591){return{'model':db[_0x4a9591[_0xcfa2('0xd')]],'as':_0x4a9591['as'],'attributes':_0x4a9591[_0xcfa2('0xa')]};}):[]};}):[]};}):[]:[]})[_0xcfa2('0xf')](function(_0x582af7){logger[_0xcfa2('0x10')](_0xcfa2('0x11'),_0x31de88);logger[_0xcfa2('0x12')](_0xcfa2('0x11'),_0x31de88,JSON['stringify'](_0x582af7));_0x39d02e(_0x582af7);})[_0xcfa2('0x13')](function(_0x55081e){logger[_0xcfa2('0x14')](_0xcfa2('0x11'),_0x55081e[_0xcfa2('0x15')],_0x31de88);_0x2e29d4(_0xf074fb[_0xcfa2('0x14')](0x1f4,_0x55081e[_0xcfa2('0x15')]));});});};exports[_0xcfa2('0x16')]=function(_0x3a9c67){var _0x4c5734=this;return new Promise(function(_0x2de805,_0x48ca3e){return db['CmHopper'][_0xcfa2('0x17')]({'raw':_0x3a9c67[_0xcfa2('0x7')]?_0x3a9c67[_0xcfa2('0x7')][_0xcfa2('0x8')]===undefined?!![]:![]:!![],'where':_0x3a9c67[_0xcfa2('0x7')]?_0x3a9c67[_0xcfa2('0x7')][_0xcfa2('0x9')]||null:null,'attributes':_0x3a9c67['options']?_0x3a9c67[_0xcfa2('0x7')]['attributes']||null:null,'include':_0x3a9c67[_0xcfa2('0x7')]?_0x3a9c67[_0xcfa2('0x7')][_0xcfa2('0xe')]?_['map'](_0x3a9c67[_0xcfa2('0x7')]['include'],function(_0x14acb8){return{'model':db[_0x14acb8[_0xcfa2('0xd')]],'as':_0x14acb8['as'],'attributes':_0x14acb8[_0xcfa2('0xa')],'include':_0x14acb8[_0xcfa2('0xe')]?_[_0xcfa2('0xc')](_0x14acb8[_0xcfa2('0xe')],function(_0x511c4d){return{'model':db[_0x511c4d[_0xcfa2('0xd')]],'as':_0x511c4d['as'],'attributes':_0x511c4d[_0xcfa2('0xa')],'include':_0x511c4d[_0xcfa2('0xe')]?_[_0xcfa2('0xc')](_0x511c4d[_0xcfa2('0xe')],function(_0x48736c){return{'model':db[_0x48736c[_0xcfa2('0xd')]],'as':_0x48736c['as'],'attributes':_0x48736c['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2cdf83){logger['info'](_0xcfa2('0x16'),_0x3a9c67);logger['debug']('ShowCmHopper',_0x3a9c67,JSON[_0xcfa2('0x18')](_0x2cdf83));_0x2de805(_0x2cdf83);})[_0xcfa2('0x13')](function(_0x390713){logger[_0xcfa2('0x14')]('ShowCmHopper',_0x390713[_0xcfa2('0x15')],_0x3a9c67);_0x48ca3e(_0x4c5734[_0xcfa2('0x14')](0x1f4,_0x390713['message']));});});};exports[_0xcfa2('0x19')]=function(_0x4a049a){var _0x3f5b08=this;return new Promise(function(_0x20fc4f,_0x53a764){return db['CmHopper']['create'](_0x4a049a[_0xcfa2('0x1a')],{'raw':_0x4a049a['options']?_0x4a049a[_0xcfa2('0x7')][_0xcfa2('0x8')]===undefined?!![]:![]:!![]})['then'](function(_0x362cf6){logger[_0xcfa2('0x10')](_0xcfa2('0x19'),_0x4a049a);logger[_0xcfa2('0x12')](_0xcfa2('0x19'),_0x4a049a,JSON[_0xcfa2('0x18')](_0x362cf6));_0x20fc4f(_0x362cf6);})[_0xcfa2('0x13')](function(_0xab2d73){logger[_0xcfa2('0x14')](_0xcfa2('0x19'),_0xab2d73[_0xcfa2('0x15')],_0x4a049a);_0x53a764(_0x3f5b08[_0xcfa2('0x14')](0x1f4,_0xab2d73['message']));});});};exports['UpdateCmHopper']=function(_0x4ddc9e){var _0x5f4371=this;return new Promise(function(_0x5e897e,_0x564b83){return db[_0xcfa2('0x5')][_0xcfa2('0x1b')](_0x4ddc9e[_0xcfa2('0x1a')],{'raw':_0x4ddc9e['options']?_0x4ddc9e[_0xcfa2('0x7')][_0xcfa2('0x8')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4ddc9e[_0xcfa2('0x7')]?_0x4ddc9e[_0xcfa2('0x7')][_0xcfa2('0x9')]||null:null,'attributes':_0x4ddc9e[_0xcfa2('0x7')]?_0x4ddc9e[_0xcfa2('0x7')][_0xcfa2('0xa')]||null:null,'limit':_0x4ddc9e[_0xcfa2('0x7')]?_0x4ddc9e[_0xcfa2('0x7')][_0xcfa2('0xb')]||null:null})[_0xcfa2('0xf')](function(_0x4b287c){logger[_0xcfa2('0x10')]('UpdateCmHopper',_0x4ddc9e);logger[_0xcfa2('0x10')](_0xcfa2('0x1c'),JSON['stringify'](_0x4ddc9e['options'][_0xcfa2('0x9')]),_0x4ddc9e['body'][_0xcfa2('0x1d')]);logger[_0xcfa2('0x12')](_0xcfa2('0x1e'),_0x4ddc9e,JSON[_0xcfa2('0x18')](_0x4b287c));_0x5e897e(_0x4b287c);})[_0xcfa2('0x13')](function(_0x3d0160){logger[_0xcfa2('0x14')](_0xcfa2('0x1e'),_0x3d0160['message'],_0x4ddc9e);_0x564b83(_0x5f4371[_0xcfa2('0x14')](0x1f4,_0x3d0160[_0xcfa2('0x15')]));});});};exports['DestroyCmHopper']=function(_0x5742ba){var _0x1e8448=this;return new Promise(function(_0x3a4b8,_0x30e559){return db[_0xcfa2('0x5')][_0xcfa2('0x1f')]({'where':_0x5742ba['options']?_0x5742ba['options']['where']||null:null})[_0xcfa2('0xf')](function(_0x207326){logger[_0xcfa2('0x10')](_0xcfa2('0x20'),_0x5742ba);logger[_0xcfa2('0x12')]('DestroyCmHopper',_0x5742ba,JSON[_0xcfa2('0x18')](_0x207326));_0x3a4b8(_0x207326);})[_0xcfa2('0x13')](function(_0x10d233){logger[_0xcfa2('0x14')](_0xcfa2('0x20'),_0x10d233[_0xcfa2('0x15')],_0x5742ba);_0x30e559(_0x1e8448[_0xcfa2('0x14')](0x1f4,_0x10d233[_0xcfa2('0x15')]));});});};exports['GetContactDialer']=function(_0x57a15b){var _0x1fe1ee=this;return new Promise(function(_0x21018c,_0x814175){return db[_0xcfa2('0x21')][_0xcfa2('0x22')]()[_0xcfa2('0xf')](function(_0x153065){return db[_0xcfa2('0x23')]['transaction'](function(_0x2407f1){return db['CmHopper'][_0xcfa2('0x6')]({'where':_0x57a15b[_0xcfa2('0x7')]?_0x57a15b[_0xcfa2('0x7')][_0xcfa2('0x9')]||null:null,'attributes':_0x57a15b[_0xcfa2('0x7')]?_0x57a15b['options']['attributes']||null:null,'limit':_0x57a15b[_0xcfa2('0x7')]?_0x57a15b[_0xcfa2('0x7')][_0xcfa2('0xb')]||null:null,'order':_0x57a15b['options']?_0x57a15b[_0xcfa2('0x7')][_0xcfa2('0x24')]||null:null,'transaction':_0x2407f1,'lock':_0x2407f1['LOCK'][_0xcfa2('0x25')],'include':[{'model':db[_0xcfa2('0x21')],'as':_0xcfa2('0x26'),'attributes':_['keys'](_0x153065)},{'model':db[_0xcfa2('0x27')],'as':'Agent','attributes':['id',_0xcfa2('0x28'),_0xcfa2('0x29')]}]})[_0xcfa2('0xf')](function(_0x53eac3){var _0x15557b=[];var _0xf3a93=[];for(var _0x452b5c=0x0;_0x452b5c<_0x53eac3[_0xcfa2('0x2a')];_0x452b5c+=0x1){var _0x52cb0e=_0x53eac3[_0x452b5c]['UserId'];if(_0x52cb0e===null){_0x15557b[_0xcfa2('0x2b')](_0x53eac3[_0x452b5c]['update'](_0x57a15b[_0xcfa2('0x1a')],{'transaction':_0x2407f1}));}else if(!_0xf3a93[_0xcfa2('0x2c')](_0x52cb0e)){_0xf3a93[_0xcfa2('0x2b')](_0x52cb0e);_0x15557b[_0xcfa2('0x2b')](_0x53eac3[_0x452b5c][_0xcfa2('0x1b')](_0x57a15b[_0xcfa2('0x1a')],{'transaction':_0x2407f1}));}}return BPromise[_0xcfa2('0x2d')](_0x15557b);});})[_0xcfa2('0xf')](function(_0x23728a){logger['info'](_0xcfa2('0x2e'),_0x57a15b);if(_0x23728a['length']>0x0){logger[_0xcfa2('0x10')]('GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]',_0x23728a[0x0][_0xcfa2('0x2f')]['id'],_0x23728a[0x0][_0xcfa2('0x2f')][_0xcfa2('0x30')],_0x23728a[0x0][_0xcfa2('0x2f')][_0xcfa2('0x1d')]);}logger[_0xcfa2('0x12')]('GetContactDialer',_0x57a15b,JSON[_0xcfa2('0x18')](_0x23728a));_0x21018c(_0x23728a);})[_0xcfa2('0x13')](function(_0x4b6603){logger[_0xcfa2('0x14')](_0xcfa2('0x2e'),_0x4b6603[_0xcfa2('0x15')],_0x57a15b);_0x814175(_0x1fe1ee['error'](0x1f4,_0x4b6603['message']));});});});};exports['MoveContactManagedDialer']=function(_0x4d05c6){var _0x8fda52=this;return new Promise(function(_0x4bd843,_0x78c798){return db[_0xcfa2('0x23')][_0xcfa2('0x31')](function(_0x4d0bc0){return db[_0xcfa2('0x32')][_0xcfa2('0x33')](_0x4d05c6['body'],{'raw':_0x4d05c6[_0xcfa2('0x7')]?_0x4d05c6[_0xcfa2('0x7')][_0xcfa2('0x8')]===undefined?!![]:![]:!![],'transaction':_0x4d0bc0})[_0xcfa2('0xf')](function(){logger[_0xcfa2('0x10')](_0xcfa2('0x34'),JSON[_0xcfa2('0x18')](_0x4d05c6[_0xcfa2('0x7')][_0xcfa2('0x9')]),_0x4d05c6[_0xcfa2('0x7')][_0xcfa2('0x9')][_0xcfa2('0x1d')]);return db[_0xcfa2('0x5')][_0xcfa2('0x1f')]({'where':_0x4d05c6['options']?_0x4d05c6[_0xcfa2('0x7')][_0xcfa2('0x9')]||null:null,'transaction':_0x4d0bc0});});})['then'](function(_0x40f3d8){logger[_0xcfa2('0x10')](_0xcfa2('0x35'),_0x4d05c6);logger[_0xcfa2('0x12')]('MoveContactManagedDialer',_0x4d05c6,JSON[_0xcfa2('0x18')](_0x40f3d8));_0x4bd843(_0x40f3d8);})['catch'](function(_0x2b3ba9){logger['error']('MoveContactManagedDialer',_0x2b3ba9[_0xcfa2('0x15')],_0x4d05c6);_0x78c798(_0x8fda52['error'](0x1f4,_0x2b3ba9['message']));});});};exports['CountReScheduled']=function(_0x4b1586){var _0x218a10=this;return new Promise(function(_0x36de96,_0x355b25){return db[_0xcfa2('0x5')][_0xcfa2('0x6')]({'raw':_0x4b1586['options']?_0x4b1586[_0xcfa2('0x7')][_0xcfa2('0x8')]===undefined?!![]:![]:!![],'where':_0x4b1586[_0xcfa2('0x7')]?_0x4b1586[_0xcfa2('0x7')][_0xcfa2('0x9')]||null:null,'attributes':[[db[_0xcfa2('0x23')]['fn'](_0xcfa2('0x36'),db['sequelize']['fn']('IF',db['sequelize'][_0xcfa2('0x37')](_0xcfa2('0x38')+util['format'](_0xcfa2('0x39'),moment()[_0xcfa2('0x3a')]('YYYY-MM-DD\x20HH:mm:ss'))+'\x20,\x201,\x20null'))),_0xcfa2('0x3b')]]})['then'](function(_0x59ee11){logger[_0xcfa2('0x10')](_0xcfa2('0x3c'),_0x4b1586);logger[_0xcfa2('0x12')](_0xcfa2('0x3c'),_0x4b1586,JSON['stringify'](_0x59ee11));_0x36de96(_0x59ee11);})['catch'](function(_0x29ea22){logger[_0xcfa2('0x14')](_0xcfa2('0x3c'),_0x29ea22['message'],_0x4b1586);_0x355b25(_0x218a10[_0xcfa2('0x14')](0x1f4,_0x29ea22[_0xcfa2('0x15')]));});});};exports['GetContactRecallMe']=function(_0x5e5ba6){var _0x552ad3=this;return new Promise(function(_0x5b69d5,_0x3a7481){return db[_0xcfa2('0x21')]['describe']()[_0xcfa2('0xf')](function(){return db[_0xcfa2('0x23')]['transaction'](function(_0x10695f){return db[_0xcfa2('0x5')][_0xcfa2('0x6')]({'where':_0x5e5ba6[_0xcfa2('0x7')]?_0x5e5ba6[_0xcfa2('0x7')]['where']||null:null,'attributes':_0x5e5ba6['options']?_0x5e5ba6[_0xcfa2('0x7')][_0xcfa2('0xa')]||null:null,'limit':0x1,'order':_0x5e5ba6['options']?_0x5e5ba6['options'][_0xcfa2('0x24')]||null:null,'group':db[_0xcfa2('0x5')][_0xcfa2('0x3d')],'transaction':_0x10695f,'lock':_0x10695f[_0xcfa2('0x3e')][_0xcfa2('0x25')],'include':_0x5e5ba6['options']?_0x5e5ba6['options']['include']?_[_0xcfa2('0xc')](_0x5e5ba6[_0xcfa2('0x7')][_0xcfa2('0xe')],function(_0x33a8d4){return{'model':db[_0x33a8d4['model']],'as':_0x33a8d4['as'],'attributes':_0x33a8d4['attributes'],'include':_0x33a8d4['include']?_[_0xcfa2('0xc')](_0x33a8d4[_0xcfa2('0xe')],function(_0x3b9e9e){return{'model':db[_0x3b9e9e[_0xcfa2('0xd')]],'as':_0x3b9e9e['as'],'attributes':_0x3b9e9e[_0xcfa2('0xa')],'include':_0x3b9e9e[_0xcfa2('0xe')]?_[_0xcfa2('0xc')](_0x3b9e9e[_0xcfa2('0xe')],function(_0x124abc){return{'model':db[_0x124abc[_0xcfa2('0xd')]],'as':_0x124abc['as'],'attributes':_0x124abc[_0xcfa2('0xa')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x17a976){var _0x4a14a2=[];for(var _0x1b6065=0x0;_0x1b6065<_0x17a976[_0xcfa2('0x2a')];_0x1b6065+=0x1){_0x4a14a2[_0xcfa2('0x2b')](_0x17a976[_0x1b6065][_0xcfa2('0x1b')](_0x5e5ba6['body'],{'transaction':_0x10695f}));}return BPromise[_0xcfa2('0x2d')](_0x4a14a2);});})[_0xcfa2('0xf')](function(_0x56f720){logger[_0xcfa2('0x10')](_0xcfa2('0x3f'),_0x5e5ba6);logger[_0xcfa2('0x12')](_0xcfa2('0x3f'),_0x5e5ba6,JSON['stringify'](_0x56f720));_0x5b69d5(_0x56f720);})['catch'](function(_0x2f064e){logger[_0xcfa2('0x14')](_0xcfa2('0x3f'),_0x2f064e['message'],_0x5e5ba6);_0x3a7481(_0x552ad3[_0xcfa2('0x14')](0x1f4,_0x2f064e[_0xcfa2('0x15')]));});});});};exports['GetCmHopperPreview']=function(_0x35748f){var _0x970c8d=this;return new Promise(function(_0x33b51c,_0x8a3ca8){db['CmContact']['describe']()['then'](function(_0x476435){return db[_0xcfa2('0x5')][_0xcfa2('0x6')]({'raw':_0x35748f[_0xcfa2('0x7')]?_0x35748f[_0xcfa2('0x7')][_0xcfa2('0x8')]===undefined?!![]:![]:!![],'where':_0x35748f['options']?_0x35748f[_0xcfa2('0x7')][_0xcfa2('0x9')]||null:null,'attributes':_0x35748f[_0xcfa2('0x7')]?_0x35748f[_0xcfa2('0x7')][_0xcfa2('0xa')]||null:null,'limit':_0x35748f[_0xcfa2('0x7')]?_0x35748f['options'][_0xcfa2('0xb')]||null:null,'include':_0x35748f[_0xcfa2('0x7')]?_0x35748f[_0xcfa2('0x7')]['include']?_[_0xcfa2('0xc')](_0x35748f['options'][_0xcfa2('0xe')],function(_0xc696e0){return{'model':db[_0xc696e0['model']],'as':_0xc696e0['as'],'attributes':_0xc696e0['as']==='Contact'?_['keys'](_0x476435):_0xc696e0['attributes'],'include':_0xc696e0[_0xcfa2('0xe')]?_[_0xcfa2('0xc')](_0xc696e0[_0xcfa2('0xe')],function(_0x5cc937){return{'model':db[_0x5cc937[_0xcfa2('0xd')]],'as':_0x5cc937['as'],'attributes':_0x5cc937['attributes'],'include':_0x5cc937['include']?_['map'](_0x5cc937[_0xcfa2('0xe')],function(_0x5f18cd){return{'model':db[_0x5f18cd['model']],'as':_0x5f18cd['as'],'attributes':_0x5f18cd[_0xcfa2('0xa')]};}):[]};}):[]};}):[]:[]})[_0xcfa2('0xf')](function(_0x292e1f){logger['info']('GetCmHopper',_0x35748f);logger[_0xcfa2('0x12')](_0xcfa2('0x11'),_0x35748f,JSON['stringify'](_0x292e1f));_0x33b51c(_0x292e1f);})[_0xcfa2('0x13')](function(_0x5ec831){logger[_0xcfa2('0x14')](_0xcfa2('0x11'),_0x5ec831[_0xcfa2('0x15')],_0x35748f);_0x8a3ca8(_0x970c8d['error'](0x1f4,_0x5ec831[_0xcfa2('0x15')]));});});});};exports[_0xcfa2('0x40')]=function(_0x16a369){var _0x4d0da8=this;return new Promise(function(_0x37d7e1,_0x4a9c4d){return db[_0xcfa2('0x21')]['findOne']({'raw':!![],'where':{'phone':_0x16a369[_0xcfa2('0x7')][_0xcfa2('0x9')]['phone']},'attributes':['id','dialTimezone'],'order':[['id',_0xcfa2('0x41')]]})[_0xcfa2('0xf')](function(_0x4b51bc){logger[_0xcfa2('0x10')](_0xcfa2('0x42'),_0x16a369);logger['debug']('getContactByPhone',_0x16a369,JSON[_0xcfa2('0x18')](_0x4b51bc));_0x37d7e1(_0x4b51bc);})['catch'](function(_0x2dc3de){logger[_0xcfa2('0x14')]('getContactByPhone',_0x2dc3de['message'],_0x16a369);_0x4a9c4d(_0x4d0da8[_0xcfa2('0x14')](0x1f4,_0x2dc3de[_0xcfa2('0x15')]));});});};exports[_0xcfa2('0x43')]=function(_0x388413){var _0x5bed2f=this;return new Promise(function(_0x8e6de6,_0x440321){return db[_0xcfa2('0x23')][_0xcfa2('0x31')](function(_0x13e2fb){var _0x26205a=_0x388413[_0xcfa2('0x7')]&&_0x388413[_0xcfa2('0x7')][_0xcfa2('0x9')]?_0x388413[_0xcfa2('0x7')]['where']:{};return db[_0xcfa2('0x5')][_0xcfa2('0x1b')](_0x388413[_0xcfa2('0x1a')],{'where':_0x26205a,'transaction':_0x13e2fb})[_0xcfa2('0xf')](function(_0x315c96){logger[_0xcfa2('0x10')](_0xcfa2('0x43'),_0x388413);logger[_0xcfa2('0x12')](_0xcfa2('0x43'),_0x388413,JSON[_0xcfa2('0x18')](_0x315c96));_0x8e6de6(_0x315c96);})[_0xcfa2('0x13')](function(_0x10c922){logger[_0xcfa2('0x14')](_0xcfa2('0x43'),_0x10c922[_0xcfa2('0x15')],_0x388413);_0x440321(_0x5bed2f['error'](0x1f4,_0x10c922[_0xcfa2('0x15')]));});});});};exports[_0xcfa2('0x44')]=function(_0x5c1f84){var _0x39db9d=this;var _0x5ea54a=_0x5c1f84['body'][_0xcfa2('0x9')][_0xcfa2('0x45')];var _0xdaad09=_0x5c1f84[_0xcfa2('0x1a')][_0xcfa2('0x9')][_0xcfa2('0x46')];var _0x1f2110=_0x5c1f84[_0xcfa2('0x1a')][_0xcfa2('0x9')]['availableAgentsIds'];return new Promise(function(_0x383d70,_0x2add43){return db[_0xcfa2('0x5')][_0xcfa2('0x6')]({'where':{'voiceQueueId':{'$in':_0x5ea54a},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0xcfa2('0x23')]['literal'](_0xcfa2('0x47')+_0xdaad09+'\x20MINUTE'),'$gt':db['sequelize'][_0xcfa2('0x37')](_0xcfa2('0x48'))}},'UserId':{'$in':_0x1f2110}},'include':[{'model':db[_0xcfa2('0x21')],'as':_0xcfa2('0x26')},{'model':db[_0xcfa2('0x27')],'as':_0xcfa2('0x49'),'attributes':['id',_0xcfa2('0x28'),'voicePause']},{'model':db[_0xcfa2('0x4a')],'as':_0xcfa2('0x4b')}]})['then'](function(_0x2a8dbc){if(_0x2a8dbc[_0xcfa2('0x2a')]>0x0){return db[_0xcfa2('0x23')][_0xcfa2('0x31')](function(_0xbd3031){return db['CmHopper']['update']({'recallmeNotifiedDate':db[_0xcfa2('0x23')]['literal'](_0xcfa2('0x48'))},{'where':{'id':{'$in':_[_0xcfa2('0xc')](_0x2a8dbc,'id')}},'transaction':_0xbd3031})['then'](function(){_0x383d70(_0x2a8dbc);})['catch'](function(_0x17b825){logger[_0xcfa2('0x14')](_0xcfa2('0x44'),_0x17b825['message'],_0x5c1f84);_0x2add43(_0x39db9d[_0xcfa2('0x14')](0x1f4,_0x17b825[_0xcfa2('0x15')]));});})[_0xcfa2('0x13')](function(_0x5821fe){logger[_0xcfa2('0x14')](_0xcfa2('0x44'),_0x5821fe[_0xcfa2('0x15')],_0x5c1f84);_0x2add43(_0x39db9d['error'](0x1f4,_0x5821fe[_0xcfa2('0x15')]));});}else{_0x383d70(_0x2a8dbc);}});});}; \ No newline at end of file +var _0xc749=['ShowCmHopper','find','create','body','CreateCmHopper','UpdateCmHopper','update','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','DestroyCmHopper','GetContactDialer','CmContact','describe','sequelize','transaction','order','Agent','voicePause','length','UserId','includes','push','all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','destroy','MoveContactManagedDialer','CountReScheduled','findAll','COUNT','literal','`scheduledat`\x20>=\x20','format','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','LOCK','UPDATE','GetContactRecallMe','GetCmHopperPreview','Contact','keys','GetContactByPhone','findOne','phone','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueIds','availableAgentsIds','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','NOW()','User','name','CmList','List','lodash','util','moment','bluebird','../../mysqldb','rpc','GetCmHopper','CmHopper','options','raw','where','attributes','limit','map','include','model','then','info','debug','stringify','catch','error','message'];(function(_0x221b8c,_0x2c7afc){var _0x3fab9f=function(_0x28bab0){while(--_0x28bab0){_0x221b8c['push'](_0x221b8c['shift']());}};_0x3fab9f(++_0x2c7afc);}(_0xc749,0x188));var _0x9c74=function(_0x47ada7,_0x27c4e4){_0x47ada7=_0x47ada7-0x0;var _0x1d3edd=_0xc749[_0x47ada7];return _0x1d3edd;};'use strict';var _=require(_0x9c74('0x0'));var util=require(_0x9c74('0x1'));var moment=require(_0x9c74('0x2'));var BPromise=require(_0x9c74('0x3'));var db=require(_0x9c74('0x4'))['db'];var logger=require('../../config/logger')(_0x9c74('0x5'));exports[_0x9c74('0x6')]=function(_0x280e66){var _0x4f4e20=this;return new Promise(function(_0x1ad318,_0x2d3573){return db[_0x9c74('0x7')]['findAll']({'raw':_0x280e66[_0x9c74('0x8')]?_0x280e66[_0x9c74('0x8')][_0x9c74('0x9')]===undefined?!![]:![]:!![],'where':_0x280e66[_0x9c74('0x8')]?_0x280e66[_0x9c74('0x8')][_0x9c74('0xa')]||null:null,'attributes':_0x280e66[_0x9c74('0x8')]?_0x280e66[_0x9c74('0x8')][_0x9c74('0xb')]||null:null,'limit':_0x280e66[_0x9c74('0x8')]?_0x280e66['options'][_0x9c74('0xc')]||null:null,'include':_0x280e66[_0x9c74('0x8')]?_0x280e66['options']['include']?_[_0x9c74('0xd')](_0x280e66[_0x9c74('0x8')][_0x9c74('0xe')],function(_0x449e52){return{'model':db[_0x449e52['model']],'as':_0x449e52['as'],'attributes':_0x449e52[_0x9c74('0xb')],'include':_0x449e52['include']?_[_0x9c74('0xd')](_0x449e52[_0x9c74('0xe')],function(_0x15e075){return{'model':db[_0x15e075['model']],'as':_0x15e075['as'],'attributes':_0x15e075['attributes'],'include':_0x15e075[_0x9c74('0xe')]?_['map'](_0x15e075[_0x9c74('0xe')],function(_0x2f8414){return{'model':db[_0x2f8414[_0x9c74('0xf')]],'as':_0x2f8414['as'],'attributes':_0x2f8414[_0x9c74('0xb')]};}):[]};}):[]};}):[]:[]})[_0x9c74('0x10')](function(_0x31fc94){logger[_0x9c74('0x11')](_0x9c74('0x6'),_0x280e66);logger[_0x9c74('0x12')](_0x9c74('0x6'),_0x280e66,JSON[_0x9c74('0x13')](_0x31fc94));_0x1ad318(_0x31fc94);})[_0x9c74('0x14')](function(_0x4b8299){logger[_0x9c74('0x15')](_0x9c74('0x6'),_0x4b8299[_0x9c74('0x16')],_0x280e66);_0x2d3573(_0x4f4e20[_0x9c74('0x15')](0x1f4,_0x4b8299[_0x9c74('0x16')]));});});};exports[_0x9c74('0x17')]=function(_0x36a134){var _0x1920be=this;return new Promise(function(_0x46a338,_0x54cd1f){return db[_0x9c74('0x7')][_0x9c74('0x18')]({'raw':_0x36a134['options']?_0x36a134['options'][_0x9c74('0x9')]===undefined?!![]:![]:!![],'where':_0x36a134[_0x9c74('0x8')]?_0x36a134[_0x9c74('0x8')][_0x9c74('0xa')]||null:null,'attributes':_0x36a134[_0x9c74('0x8')]?_0x36a134[_0x9c74('0x8')][_0x9c74('0xb')]||null:null,'include':_0x36a134[_0x9c74('0x8')]?_0x36a134[_0x9c74('0x8')]['include']?_[_0x9c74('0xd')](_0x36a134[_0x9c74('0x8')][_0x9c74('0xe')],function(_0x5e3322){return{'model':db[_0x5e3322[_0x9c74('0xf')]],'as':_0x5e3322['as'],'attributes':_0x5e3322[_0x9c74('0xb')],'include':_0x5e3322['include']?_[_0x9c74('0xd')](_0x5e3322[_0x9c74('0xe')],function(_0x2f2426){return{'model':db[_0x2f2426[_0x9c74('0xf')]],'as':_0x2f2426['as'],'attributes':_0x2f2426[_0x9c74('0xb')],'include':_0x2f2426[_0x9c74('0xe')]?_[_0x9c74('0xd')](_0x2f2426[_0x9c74('0xe')],function(_0x57d4c4){return{'model':db[_0x57d4c4[_0x9c74('0xf')]],'as':_0x57d4c4['as'],'attributes':_0x57d4c4[_0x9c74('0xb')]};}):[]};}):[]};}):[]:[]})[_0x9c74('0x10')](function(_0x1fb0f9){logger[_0x9c74('0x11')](_0x9c74('0x17'),_0x36a134);logger[_0x9c74('0x12')](_0x9c74('0x17'),_0x36a134,JSON[_0x9c74('0x13')](_0x1fb0f9));_0x46a338(_0x1fb0f9);})[_0x9c74('0x14')](function(_0x232104){logger[_0x9c74('0x15')]('ShowCmHopper',_0x232104[_0x9c74('0x16')],_0x36a134);_0x54cd1f(_0x1920be[_0x9c74('0x15')](0x1f4,_0x232104['message']));});});};exports['CreateCmHopper']=function(_0x26e07b){var _0x4555c3=this;return new Promise(function(_0x2df0f4,_0x413341){return db[_0x9c74('0x7')][_0x9c74('0x19')](_0x26e07b[_0x9c74('0x1a')],{'raw':_0x26e07b[_0x9c74('0x8')]?_0x26e07b[_0x9c74('0x8')]['raw']===undefined?!![]:![]:!![]})[_0x9c74('0x10')](function(_0x801c5d){logger[_0x9c74('0x11')](_0x9c74('0x1b'),_0x26e07b);logger['debug']('CreateCmHopper',_0x26e07b,JSON['stringify'](_0x801c5d));_0x2df0f4(_0x801c5d);})[_0x9c74('0x14')](function(_0x392323){logger[_0x9c74('0x15')](_0x9c74('0x1b'),_0x392323[_0x9c74('0x16')],_0x26e07b);_0x413341(_0x4555c3[_0x9c74('0x15')](0x1f4,_0x392323['message']));});});};exports[_0x9c74('0x1c')]=function(_0x3e797b){var _0x14278b=this;return new Promise(function(_0xb4d049,_0x55dd50){return db[_0x9c74('0x7')][_0x9c74('0x1d')](_0x3e797b[_0x9c74('0x1a')],{'raw':_0x3e797b['options']?_0x3e797b[_0x9c74('0x8')][_0x9c74('0x9')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3e797b[_0x9c74('0x8')]?_0x3e797b[_0x9c74('0x8')][_0x9c74('0xa')]||null:null,'attributes':_0x3e797b[_0x9c74('0x8')]?_0x3e797b[_0x9c74('0x8')][_0x9c74('0xb')]||null:null,'limit':_0x3e797b['options']?_0x3e797b[_0x9c74('0x8')][_0x9c74('0xc')]||null:null})[_0x9c74('0x10')](function(_0x1ab35c){logger['info'](_0x9c74('0x1c'),_0x3e797b);logger[_0x9c74('0x11')](_0x9c74('0x1e'),JSON[_0x9c74('0x13')](_0x3e797b[_0x9c74('0x8')][_0x9c74('0xa')]),_0x3e797b['body'][_0x9c74('0x1f')]);logger[_0x9c74('0x12')](_0x9c74('0x1c'),_0x3e797b,JSON['stringify'](_0x1ab35c));_0xb4d049(_0x1ab35c);})[_0x9c74('0x14')](function(_0x1e7cdb){logger['error'](_0x9c74('0x1c'),_0x1e7cdb[_0x9c74('0x16')],_0x3e797b);_0x55dd50(_0x14278b[_0x9c74('0x15')](0x1f4,_0x1e7cdb[_0x9c74('0x16')]));});});};exports[_0x9c74('0x20')]=function(_0x4d33fe){var _0x73cf6d=this;return new Promise(function(_0x11e7bc,_0x563e57){return db['CmHopper']['destroy']({'where':_0x4d33fe[_0x9c74('0x8')]?_0x4d33fe[_0x9c74('0x8')][_0x9c74('0xa')]||null:null})[_0x9c74('0x10')](function(_0x527aa7){logger['info'](_0x9c74('0x20'),_0x4d33fe);logger[_0x9c74('0x12')](_0x9c74('0x20'),_0x4d33fe,JSON[_0x9c74('0x13')](_0x527aa7));_0x11e7bc(_0x527aa7);})[_0x9c74('0x14')](function(_0x1ef58d){logger['error'](_0x9c74('0x20'),_0x1ef58d[_0x9c74('0x16')],_0x4d33fe);_0x563e57(_0x73cf6d[_0x9c74('0x15')](0x1f4,_0x1ef58d[_0x9c74('0x16')]));});});};exports[_0x9c74('0x21')]=function(_0x4144d4){var _0x53d4c2=this;return new Promise(function(_0x48d5a0,_0x155f08){return db[_0x9c74('0x22')][_0x9c74('0x23')]()[_0x9c74('0x10')](function(_0x43f85d){return db[_0x9c74('0x24')][_0x9c74('0x25')](function(_0xbbbe3f){return db[_0x9c74('0x7')]['findAll']({'where':_0x4144d4[_0x9c74('0x8')]?_0x4144d4[_0x9c74('0x8')][_0x9c74('0xa')]||null:null,'attributes':_0x4144d4[_0x9c74('0x8')]?_0x4144d4['options'][_0x9c74('0xb')]||null:null,'limit':_0x4144d4[_0x9c74('0x8')]?_0x4144d4[_0x9c74('0x8')][_0x9c74('0xc')]||null:null,'order':_0x4144d4[_0x9c74('0x8')]?_0x4144d4['options'][_0x9c74('0x26')]||null:null,'transaction':_0xbbbe3f,'lock':_0xbbbe3f['LOCK']['UPDATE'],'include':[{'model':db['CmContact'],'as':'Contact','attributes':_['keys'](_0x43f85d)},{'model':db['User'],'as':_0x9c74('0x27'),'attributes':['id','name',_0x9c74('0x28')]}]})['then'](function(_0x37b43d){var _0x3a3a0e=[];var _0x2a9fed=[];for(var _0x2d4698=0x0;_0x2d4698<_0x37b43d[_0x9c74('0x29')];_0x2d4698+=0x1){var _0x92ab72=_0x37b43d[_0x2d4698][_0x9c74('0x2a')];if(_0x92ab72===null){_0x3a3a0e['push'](_0x37b43d[_0x2d4698]['update'](_0x4144d4[_0x9c74('0x1a')],{'transaction':_0xbbbe3f}));}else if(!_0x2a9fed[_0x9c74('0x2b')](_0x92ab72)){_0x2a9fed['push'](_0x92ab72);_0x3a3a0e[_0x9c74('0x2c')](_0x37b43d[_0x2d4698][_0x9c74('0x1d')](_0x4144d4[_0x9c74('0x1a')],{'transaction':_0xbbbe3f}));}}return BPromise[_0x9c74('0x2d')](_0x3a3a0e);});})[_0x9c74('0x10')](function(_0x58149f){logger[_0x9c74('0x11')](_0x9c74('0x21'),_0x4144d4);if(_0x58149f[_0x9c74('0x29')]>0x0){logger[_0x9c74('0x11')](_0x9c74('0x2e'),_0x58149f[0x0][_0x9c74('0x2f')]['id'],_0x58149f[0x0][_0x9c74('0x2f')]['ContactId'],_0x58149f[0x0]['dataValues']['active']);}logger['debug']('GetContactDialer',_0x4144d4,JSON[_0x9c74('0x13')](_0x58149f));_0x48d5a0(_0x58149f);})[_0x9c74('0x14')](function(_0x7e505c){logger['error'](_0x9c74('0x21'),_0x7e505c[_0x9c74('0x16')],_0x4144d4);_0x155f08(_0x53d4c2[_0x9c74('0x15')](0x1f4,_0x7e505c[_0x9c74('0x16')]));});});});};exports['MoveContactManagedDialer']=function(_0x2986df){var _0x5e3b4f=this;return new Promise(function(_0x5a8504,_0x3ba358){return db[_0x9c74('0x24')][_0x9c74('0x25')](function(_0x281689){return db['CmHopperFinal']['create'](_0x2986df[_0x9c74('0x1a')],{'raw':_0x2986df['options']?_0x2986df[_0x9c74('0x8')]['raw']===undefined?!![]:![]:!![],'transaction':_0x281689})[_0x9c74('0x10')](function(){logger[_0x9c74('0x11')](_0x9c74('0x30'),JSON[_0x9c74('0x13')](_0x2986df[_0x9c74('0x8')][_0x9c74('0xa')]),_0x2986df[_0x9c74('0x8')][_0x9c74('0xa')][_0x9c74('0x1f')]);return db['CmHopper'][_0x9c74('0x31')]({'where':_0x2986df[_0x9c74('0x8')]?_0x2986df[_0x9c74('0x8')][_0x9c74('0xa')]||null:null,'transaction':_0x281689});});})[_0x9c74('0x10')](function(_0x2dd5fd){logger['info'](_0x9c74('0x32'),_0x2986df);logger[_0x9c74('0x12')](_0x9c74('0x32'),_0x2986df,JSON[_0x9c74('0x13')](_0x2dd5fd));_0x5a8504(_0x2dd5fd);})[_0x9c74('0x14')](function(_0x3ae4dc){logger[_0x9c74('0x15')](_0x9c74('0x32'),_0x3ae4dc[_0x9c74('0x16')],_0x2986df);_0x3ba358(_0x5e3b4f[_0x9c74('0x15')](0x1f4,_0x3ae4dc[_0x9c74('0x16')]));});});};exports[_0x9c74('0x33')]=function(_0x438675){var _0x139770=this;return new Promise(function(_0x11488a,_0x21cebd){return db[_0x9c74('0x7')][_0x9c74('0x34')]({'raw':_0x438675[_0x9c74('0x8')]?_0x438675[_0x9c74('0x8')][_0x9c74('0x9')]===undefined?!![]:![]:!![],'where':_0x438675[_0x9c74('0x8')]?_0x438675[_0x9c74('0x8')]['where']||null:null,'attributes':[[db[_0x9c74('0x24')]['fn'](_0x9c74('0x35'),db['sequelize']['fn']('IF',db[_0x9c74('0x24')][_0x9c74('0x36')](_0x9c74('0x37')+util[_0x9c74('0x38')]('\x22%s\x22',moment()['format'](_0x9c74('0x39')))+_0x9c74('0x3a')))),_0x9c74('0x3b')]]})[_0x9c74('0x10')](function(_0x295cdc){logger['info'](_0x9c74('0x33'),_0x438675);logger[_0x9c74('0x12')](_0x9c74('0x33'),_0x438675,JSON[_0x9c74('0x13')](_0x295cdc));_0x11488a(_0x295cdc);})[_0x9c74('0x14')](function(_0x4910b5){logger[_0x9c74('0x15')]('CountReScheduled',_0x4910b5[_0x9c74('0x16')],_0x438675);_0x21cebd(_0x139770[_0x9c74('0x15')](0x1f4,_0x4910b5[_0x9c74('0x16')]));});});};exports['GetContactRecallMe']=function(_0x1eba8d){var _0x4e24ac=this;return new Promise(function(_0x2e07ab,_0x479736){return db[_0x9c74('0x22')][_0x9c74('0x23')]()[_0x9c74('0x10')](function(){return db['sequelize'][_0x9c74('0x25')](function(_0x3b6c5){return db[_0x9c74('0x7')][_0x9c74('0x34')]({'where':_0x1eba8d[_0x9c74('0x8')]?_0x1eba8d['options'][_0x9c74('0xa')]||null:null,'attributes':_0x1eba8d['options']?_0x1eba8d[_0x9c74('0x8')][_0x9c74('0xb')]||null:null,'limit':0x1,'order':_0x1eba8d[_0x9c74('0x8')]?_0x1eba8d[_0x9c74('0x8')][_0x9c74('0x26')]||null:null,'group':db[_0x9c74('0x7')]['UserId'],'transaction':_0x3b6c5,'lock':_0x3b6c5[_0x9c74('0x3c')][_0x9c74('0x3d')],'include':_0x1eba8d[_0x9c74('0x8')]?_0x1eba8d[_0x9c74('0x8')][_0x9c74('0xe')]?_['map'](_0x1eba8d[_0x9c74('0x8')][_0x9c74('0xe')],function(_0x1023d5){return{'model':db[_0x1023d5[_0x9c74('0xf')]],'as':_0x1023d5['as'],'attributes':_0x1023d5[_0x9c74('0xb')],'include':_0x1023d5['include']?_[_0x9c74('0xd')](_0x1023d5[_0x9c74('0xe')],function(_0x572bc4){return{'model':db[_0x572bc4['model']],'as':_0x572bc4['as'],'attributes':_0x572bc4[_0x9c74('0xb')],'include':_0x572bc4[_0x9c74('0xe')]?_[_0x9c74('0xd')](_0x572bc4[_0x9c74('0xe')],function(_0x145359){return{'model':db[_0x145359['model']],'as':_0x145359['as'],'attributes':_0x145359[_0x9c74('0xb')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x21c0b3){var _0x5e06f6=[];for(var _0x1be48f=0x0;_0x1be48f<_0x21c0b3[_0x9c74('0x29')];_0x1be48f+=0x1){_0x5e06f6['push'](_0x21c0b3[_0x1be48f][_0x9c74('0x1d')](_0x1eba8d[_0x9c74('0x1a')],{'transaction':_0x3b6c5}));}return BPromise[_0x9c74('0x2d')](_0x5e06f6);});})[_0x9c74('0x10')](function(_0x3bfdb0){logger[_0x9c74('0x11')](_0x9c74('0x3e'),_0x1eba8d);logger[_0x9c74('0x12')](_0x9c74('0x3e'),_0x1eba8d,JSON[_0x9c74('0x13')](_0x3bfdb0));_0x2e07ab(_0x3bfdb0);})[_0x9c74('0x14')](function(_0x4d0ce3){logger[_0x9c74('0x15')]('GetContactRecallMe',_0x4d0ce3[_0x9c74('0x16')],_0x1eba8d);_0x479736(_0x4e24ac[_0x9c74('0x15')](0x1f4,_0x4d0ce3[_0x9c74('0x16')]));});});});};exports[_0x9c74('0x3f')]=function(_0x1a8e28){var _0x544e44=this;return new Promise(function(_0x564121,_0x1e8424){db[_0x9c74('0x22')][_0x9c74('0x23')]()[_0x9c74('0x10')](function(_0x673be8){return db[_0x9c74('0x7')][_0x9c74('0x34')]({'raw':_0x1a8e28[_0x9c74('0x8')]?_0x1a8e28['options']['raw']===undefined?!![]:![]:!![],'where':_0x1a8e28[_0x9c74('0x8')]?_0x1a8e28[_0x9c74('0x8')][_0x9c74('0xa')]||null:null,'attributes':_0x1a8e28[_0x9c74('0x8')]?_0x1a8e28[_0x9c74('0x8')][_0x9c74('0xb')]||null:null,'limit':_0x1a8e28[_0x9c74('0x8')]?_0x1a8e28[_0x9c74('0x8')][_0x9c74('0xc')]||null:null,'include':_0x1a8e28['options']?_0x1a8e28[_0x9c74('0x8')][_0x9c74('0xe')]?_[_0x9c74('0xd')](_0x1a8e28[_0x9c74('0x8')]['include'],function(_0x3cabf3){return{'model':db[_0x3cabf3[_0x9c74('0xf')]],'as':_0x3cabf3['as'],'attributes':_0x3cabf3['as']===_0x9c74('0x40')?_[_0x9c74('0x41')](_0x673be8):_0x3cabf3[_0x9c74('0xb')],'include':_0x3cabf3[_0x9c74('0xe')]?_[_0x9c74('0xd')](_0x3cabf3[_0x9c74('0xe')],function(_0x22072f){return{'model':db[_0x22072f[_0x9c74('0xf')]],'as':_0x22072f['as'],'attributes':_0x22072f[_0x9c74('0xb')],'include':_0x22072f['include']?_[_0x9c74('0xd')](_0x22072f[_0x9c74('0xe')],function(_0x1ce8d0){return{'model':db[_0x1ce8d0[_0x9c74('0xf')]],'as':_0x1ce8d0['as'],'attributes':_0x1ce8d0[_0x9c74('0xb')]};}):[]};}):[]};}):[]:[]})[_0x9c74('0x10')](function(_0x4cfb6e){logger[_0x9c74('0x11')]('GetCmHopper',_0x1a8e28);logger[_0x9c74('0x12')](_0x9c74('0x6'),_0x1a8e28,JSON[_0x9c74('0x13')](_0x4cfb6e));_0x564121(_0x4cfb6e);})['catch'](function(_0x1568d4){logger['error']('GetCmHopper',_0x1568d4[_0x9c74('0x16')],_0x1a8e28);_0x1e8424(_0x544e44[_0x9c74('0x15')](0x1f4,_0x1568d4[_0x9c74('0x16')]));});});});};exports[_0x9c74('0x42')]=function(_0x26fc51){var _0x3bc16b=this;return new Promise(function(_0x532224,_0x2830b3){return db['CmContact'][_0x9c74('0x43')]({'raw':!![],'where':{'phone':_0x26fc51['options'][_0x9c74('0xa')][_0x9c74('0x44')]},'attributes':['id',_0x9c74('0x45')],'order':[['id',_0x9c74('0x46')]]})[_0x9c74('0x10')](function(_0x50db00){logger[_0x9c74('0x11')]('getContactByPhone',_0x26fc51);logger[_0x9c74('0x12')](_0x9c74('0x47'),_0x26fc51,JSON[_0x9c74('0x13')](_0x50db00));_0x532224(_0x50db00);})[_0x9c74('0x14')](function(_0x262372){logger[_0x9c74('0x15')]('getContactByPhone',_0x262372[_0x9c74('0x16')],_0x26fc51);_0x2830b3(_0x3bc16b[_0x9c74('0x15')](0x1f4,_0x262372[_0x9c74('0x16')]));});});};exports[_0x9c74('0x48')]=function(_0x1d0f11){var _0x4a231c=this;return new Promise(function(_0x523ee6,_0xaf7182){return db['sequelize'][_0x9c74('0x25')](function(_0x2f8f3a){var _0x40c100=_0x1d0f11[_0x9c74('0x8')]&&_0x1d0f11[_0x9c74('0x8')]['where']?_0x1d0f11['options'][_0x9c74('0xa')]:{};return db['CmHopper'][_0x9c74('0x1d')](_0x1d0f11['body'],{'where':_0x40c100,'transaction':_0x2f8f3a})['then'](function(_0x5f3148){logger[_0x9c74('0x11')](_0x9c74('0x48'),_0x1d0f11);logger[_0x9c74('0x12')](_0x9c74('0x48'),_0x1d0f11,JSON[_0x9c74('0x13')](_0x5f3148));_0x523ee6(_0x5f3148);})[_0x9c74('0x14')](function(_0x3e741d){logger[_0x9c74('0x15')](_0x9c74('0x48'),_0x3e741d[_0x9c74('0x16')],_0x1d0f11);_0xaf7182(_0x4a231c[_0x9c74('0x15')](0x1f4,_0x3e741d[_0x9c74('0x16')]));});});});};exports[_0x9c74('0x49')]=function(_0x2c27de){var _0x19a704=this;var _0x5bcc9c=_0x2c27de[_0x9c74('0x1a')][_0x9c74('0xa')][_0x9c74('0x4a')];var _0x39d377=_0x2c27de[_0x9c74('0x1a')]['where']['interval'];var _0x385018=_0x2c27de[_0x9c74('0x1a')][_0x9c74('0xa')][_0x9c74('0x4b')];return new Promise(function(_0x5b6932,_0x26056b){return db[_0x9c74('0x7')][_0x9c74('0x34')]({'where':{'voiceQueueId':{'$in':_0x5bcc9c},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0x9c74('0x24')][_0x9c74('0x36')](_0x9c74('0x4c')+_0x39d377+_0x9c74('0x4d')),'$gt':db[_0x9c74('0x24')][_0x9c74('0x36')](_0x9c74('0x4e'))}},'UserId':{'$in':_0x385018}},'include':[{'model':db[_0x9c74('0x22')],'as':_0x9c74('0x40')},{'model':db[_0x9c74('0x4f')],'as':_0x9c74('0x27'),'attributes':['id',_0x9c74('0x50'),_0x9c74('0x28')]},{'model':db[_0x9c74('0x51')],'as':_0x9c74('0x52')}]})[_0x9c74('0x10')](function(_0x5bf3a2){if(_0x5bf3a2[_0x9c74('0x29')]>0x0){return db[_0x9c74('0x24')]['transaction'](function(_0x1a5bd0){return db[_0x9c74('0x7')]['update']({'recallmeNotifiedDate':db['sequelize'][_0x9c74('0x36')](_0x9c74('0x4e'))},{'where':{'id':{'$in':_[_0x9c74('0xd')](_0x5bf3a2,'id')}},'transaction':_0x1a5bd0})[_0x9c74('0x10')](function(){_0x5b6932(_0x5bf3a2);})['catch'](function(_0x2d63b9){logger['error']('CmHopperHandlePreviewRecallNotifications',_0x2d63b9['message'],_0x2c27de);_0x26056b(_0x19a704[_0x9c74('0x15')](0x1f4,_0x2d63b9['message']));});})['catch'](function(_0xee260){logger[_0x9c74('0x15')](_0x9c74('0x49'),_0xee260[_0x9c74('0x16')],_0x2c27de);_0x26056b(_0x19a704[_0x9c74('0x15')](0x1f4,_0xee260[_0x9c74('0x16')]));});}else{_0x5b6932(_0x5bf3a2);}});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 6559ac2..efb90d0 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 _0x8968=['/timezones','getTimezones','/:id','show','/:id/previewrecall','getPreviewRecall','create','post','/preview','getPreview','/timezone','getTimezone','put','delete','destroy','exports','express','Router','../../components/auth/service','isAuthenticated','index','describe','get','getOpenContacts'];(function(_0xb527d7,_0x36ffe9){var _0x493405=function(_0x4643bd){while(--_0x4643bd){_0xb527d7['push'](_0xb527d7['shift']());}};_0x493405(++_0x36ffe9);}(_0x8968,0x1f0));var _0x8896=function(_0xc80bfc,_0x175b63){_0xc80bfc=_0xc80bfc-0x0;var _0x136fe0=_0x8968[_0xc80bfc];return _0x136fe0;};'use strict';var express=require(_0x8896('0x0'));var router=express[_0x8896('0x1')]();var auth=require(_0x8896('0x2'));var controller=require('./cmHopper.controller');router['get']('/',auth[_0x8896('0x3')](),controller[_0x8896('0x4')]);router['get']('/describe',auth[_0x8896('0x3')](),controller[_0x8896('0x5')]);router[_0x8896('0x6')]('/opencontacts',auth['isAuthenticated'](),controller[_0x8896('0x7')]);router[_0x8896('0x6')](_0x8896('0x8'),auth[_0x8896('0x3')](),controller[_0x8896('0x9')]);router['get'](_0x8896('0xa'),auth[_0x8896('0x3')](),controller[_0x8896('0xb')]);router[_0x8896('0x6')](_0x8896('0xc'),auth[_0x8896('0x3')](),controller[_0x8896('0xd')]);router['post']('/',auth[_0x8896('0x3')](),controller[_0x8896('0xe')]);router[_0x8896('0xf')](_0x8896('0x10'),auth['isAuthenticated'](),controller[_0x8896('0x11')]);router[_0x8896('0xf')](_0x8896('0x12'),auth['isAuthenticated'](),controller[_0x8896('0x13')]);router[_0x8896('0x14')](_0x8896('0xa'),auth[_0x8896('0x3')](),controller['update']);router[_0x8896('0x15')](_0x8896('0xa'),auth[_0x8896('0x3')](),controller[_0x8896('0x16')]);module[_0x8896('0x17')]=router; \ No newline at end of file +var _0x038d=['getOpenContacts','/timezones','getTimezones','/:id/previewrecall','getPreviewRecall','post','create','/preview','getPreview','getTimezone','put','update','delete','/:id','destroy','exports','express','Router','../../components/auth/service','./cmHopper.controller','get','isAuthenticated','/describe','describe','/opencontacts'];(function(_0x14fbba,_0x2c4ea1){var _0x36e594=function(_0x2616d8){while(--_0x2616d8){_0x14fbba['push'](_0x14fbba['shift']());}};_0x36e594(++_0x2c4ea1);}(_0x038d,0x1eb));var _0xd038=function(_0x420b89,_0xb4c01e){_0x420b89=_0x420b89-0x0;var _0x13e2a3=_0x038d[_0x420b89];return _0x13e2a3;};'use strict';var express=require(_0xd038('0x0'));var router=express[_0xd038('0x1')]();var auth=require(_0xd038('0x2'));var controller=require(_0xd038('0x3'));router[_0xd038('0x4')]('/',auth[_0xd038('0x5')](),controller['index']);router[_0xd038('0x4')](_0xd038('0x6'),auth[_0xd038('0x5')](),controller[_0xd038('0x7')]);router[_0xd038('0x4')](_0xd038('0x8'),auth['isAuthenticated'](),controller[_0xd038('0x9')]);router[_0xd038('0x4')](_0xd038('0xa'),auth['isAuthenticated'](),controller[_0xd038('0xb')]);router[_0xd038('0x4')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xd038('0x4')](_0xd038('0xc'),auth[_0xd038('0x5')](),controller[_0xd038('0xd')]);router[_0xd038('0xe')]('/',auth[_0xd038('0x5')](),controller[_0xd038('0xf')]);router['post'](_0xd038('0x10'),auth[_0xd038('0x5')](),controller[_0xd038('0x11')]);router[_0xd038('0xe')]('/timezone',auth[_0xd038('0x5')](),controller[_0xd038('0x12')]);router[_0xd038('0x13')]('/:id',auth[_0xd038('0x5')](),controller[_0xd038('0x14')]);router[_0xd038('0x15')](_0xd038('0x16'),auth[_0xd038('0x5')](),controller[_0xd038('0x17')]);module[_0xd038('0x18')]=router; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js index efd545d..e8ff31a 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x37ca=['INTEGER','DATE','format','moment','exports','STRING'];(function(_0x20b4db,_0x40257b){var _0x4fca58=function(_0x521e56){while(--_0x521e56){_0x20b4db['push'](_0x20b4db['shift']());}};_0x4fca58(++_0x40257b);}(_0x37ca,0x1c5));var _0xa37c=function(_0x311419,_0x37f8ea){_0x311419=_0x311419-0x0;var _0x16ddc7=_0x37ca[_0x311419];return _0x16ddc7;};'use strict';var moment=require(_0xa37c('0x0'));var Sequelize=require('sequelize');module[_0xa37c('0x1')]={'CmHopperId':{'type':Sequelize['INTEGER']},'phone':{'type':Sequelize[_0xa37c('0x2')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0xa37c('0x3')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0xa37c('0x4')],'defaultValue':moment()[_0xa37c('0x5')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xa37c('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0xa37c('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xa37c('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xa37c('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0xe14d=['YYYY-MM-DD\x20HH:mm:ss','moment','sequelize','exports','INTEGER','format'];(function(_0x2aae3f,_0x214ac8){var _0x1b6741=function(_0x405c02){while(--_0x405c02){_0x2aae3f['push'](_0x2aae3f['shift']());}};_0x1b6741(++_0x214ac8);}(_0xe14d,0xb5));var _0xde14=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0xe14d[_0x6cf19c];return _0xce14f3;};'use strict';var moment=require(_0xde14('0x0'));var Sequelize=require(_0xde14('0x1'));module[_0xde14('0x2')]={'CmHopperId':{'type':Sequelize['INTEGER']},'phone':{'type':Sequelize['STRING'],'allowNull':![]},'OrderBy':{'type':Sequelize[_0xde14('0x3')],'defaultValue':0x0},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0xde14('0x4')](_0xde14('0x5'))},'countbusyretry':{'type':Sequelize[_0xde14('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xde14('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xde14('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xde14('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js index 85addaf..1640653 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2420=['querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','Content-Range','apply','reject','save','update','then','get','UserProfileResource','error','stack','name','index','map','CmHopperAdditionalPhone','rawAttributes','key','model','query','filters','attributes','intersection','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','catch','show','params','keys','fields','includeAll','find','create','user','role','autoAssociation','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','ejs','lodash','crypto','jsforce','to-csv'];(function(_0x20ef64,_0x4a8fe9){var _0x3707d8=function(_0x5b9a88){while(--_0x5b9a88){_0x20ef64['push'](_0x20ef64['shift']());}};_0x3707d8(++_0x4a8fe9);}(_0x2420,0x1c0));var _0x0242=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x2420[_0x2d7f0e];return _0x110b07;};'use strict';var emlformat=require(_0x0242('0x0'));var rimraf=require(_0x0242('0x1'));var zipdir=require(_0x0242('0x2'));var jsonpatch=require(_0x0242('0x3'));var rp=require('request-promise');var moment=require(_0x0242('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x0242('0x5'));var util=require(_0x0242('0x6'));var path=require(_0x0242('0x7'));var sox=require(_0x0242('0x8'));var csv=require('to-csv');var ejs=require(_0x0242('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0242('0xa'));var squel=require('squel');var crypto=require(_0x0242('0xb'));var jsforce=require(_0x0242('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x0242('0xd'));var querystring=require(_0x0242('0xe'));var Papa=require('papaparse');var Redis=require(_0x0242('0xf'));var authService=require(_0x0242('0x10'));var qs=require(_0x0242('0x11'));var as=require(_0x0242('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x0242('0x13'));var utils=require(_0x0242('0x14'));var config=require(_0x0242('0x15'));var licenseUtil=require(_0x0242('0x16'));var db=require(_0x0242('0x17'))['db'];function respondWithStatusCode(_0x50bf61,_0x6d5cd6){_0x6d5cd6=_0x6d5cd6||0xcc;return function(_0x1383de){if(_0x1383de){return _0x50bf61[_0x0242('0x18')](_0x6d5cd6);}return _0x50bf61[_0x0242('0x19')](_0x6d5cd6)[_0x0242('0x1a')]();};}function respondWithResult(_0x443c02,_0x499039){_0x499039=_0x499039||0xc8;return function(_0x322f29){if(_0x322f29){return _0x443c02['status'](_0x499039)[_0x0242('0x1b')](_0x322f29);}};}function respondWithFilteredResult(_0x30e1bb,_0x243fce){return function(_0x14d529){if(_0x14d529){var _0x1cc0fc=typeof _0x243fce['offset']===_0x0242('0x1c')&&typeof _0x243fce[_0x0242('0x1d')]==='undefined';var _0x328895=_0x14d529['count'];var _0x333e01=_0x1cc0fc?0x0:_0x243fce[_0x0242('0x1e')];var _0x41fa8a=_0x1cc0fc?_0x14d529[_0x0242('0x1f')]:_0x243fce[_0x0242('0x1e')]+_0x243fce['limit'];var _0x1d35ac;if(_0x41fa8a>=_0x328895){_0x41fa8a=_0x328895;_0x1d35ac=0xc8;}else{_0x1d35ac=0xce;}_0x30e1bb[_0x0242('0x19')](_0x1d35ac);return _0x30e1bb['set'](_0x0242('0x20'),_0x333e01+'-'+_0x41fa8a+'/'+_0x328895)[_0x0242('0x1b')](_0x14d529);}return null;};}function patchUpdates(_0x4f76fb){return function(_0x894ea9){try{jsonpatch[_0x0242('0x21')](_0x894ea9,_0x4f76fb,!![]);}catch(_0x2fa9f1){return BPromise[_0x0242('0x22')](_0x2fa9f1);}return _0x894ea9[_0x0242('0x23')]();};}function saveUpdates(_0x282cbd,_0x1dfcf3){return function(_0x43ec3d){if(_0x43ec3d){return _0x43ec3d[_0x0242('0x24')](_0x282cbd)[_0x0242('0x25')](function(_0xa54b55){return _0xa54b55;});}return null;};}function removeEntity(_0xf03628,_0xba417d){return function(_0x26849e){if(_0x26849e){return _0x26849e['destroy']()[_0x0242('0x25')](function(){var _0x4e72b8=_0x26849e[_0x0242('0x26')]({'plain':!![]});var _0x4d17ab='CmHopperAdditionalPhones';return db[_0x0242('0x27')]['destroy']({'where':{'type':_0x4d17ab,'resourceId':_0x4e72b8['id']}})['then'](function(){return _0x26849e;});})['then'](function(){_0xf03628[_0x0242('0x19')](0xcc)[_0x0242('0x1a')]();});}};}function handleEntityNotFound(_0x1530be,_0xabab52){return function(_0x4eeb0f){if(!_0x4eeb0f){_0x1530be[_0x0242('0x18')](0x194);}return _0x4eeb0f;};}function handleError(_0xcdcc88,_0x44ec9b){_0x44ec9b=_0x44ec9b||0x1f4;return function(_0xd7b0c5){logger[_0x0242('0x28')](_0xd7b0c5[_0x0242('0x29')]);if(_0xd7b0c5[_0x0242('0x2a')]){delete _0xd7b0c5[_0x0242('0x2a')];}_0xcdcc88[_0x0242('0x19')](_0x44ec9b)['send'](_0xd7b0c5);};}exports[_0x0242('0x2b')]=function(_0x323d3a,_0x3602ab){var _0xa2f925={},_0x94e81f={},_0x153a2d={'count':0x0,'rows':[]};var _0x4de8b6=_[_0x0242('0x2c')](db[_0x0242('0x2d')][_0x0242('0x2e')],function(_0x544dad){return{'name':_0x544dad['fieldName'],'type':_0x544dad['type'][_0x0242('0x2f')]};});_0x94e81f[_0x0242('0x30')]=_[_0x0242('0x2c')](_0x4de8b6,_0x0242('0x2a'));_0x94e81f['query']=_['keys'](_0x323d3a[_0x0242('0x31')]);_0x94e81f[_0x0242('0x32')]=_['intersection'](_0x94e81f[_0x0242('0x30')],_0x94e81f[_0x0242('0x31')]);_0xa2f925[_0x0242('0x33')]=_[_0x0242('0x34')](_0x94e81f['model'],qs['fields'](_0x323d3a['query']['fields']));_0xa2f925[_0x0242('0x33')]=_0xa2f925[_0x0242('0x33')][_0x0242('0x35')]?_0xa2f925['attributes']:_0x94e81f[_0x0242('0x30')];if(!_0x323d3a['query'][_0x0242('0x36')]('nolimit')){_0xa2f925[_0x0242('0x1d')]=qs['limit'](_0x323d3a['query'][_0x0242('0x1d')]);_0xa2f925[_0x0242('0x1e')]=qs[_0x0242('0x1e')](_0x323d3a['query'][_0x0242('0x1e')]);}_0xa2f925[_0x0242('0x37')]=qs[_0x0242('0x38')](_0x323d3a['query']['sort']);_0xa2f925[_0x0242('0x39')]=qs['filters'](_['pick'](_0x323d3a[_0x0242('0x31')],_0x94e81f[_0x0242('0x32')]),_0x4de8b6);if(_0x323d3a[_0x0242('0x31')][_0x0242('0x3a')]){_0xa2f925['where']=_[_0x0242('0x3b')](_0xa2f925[_0x0242('0x39')],{'$or':_['map'](_0x4de8b6,function(_0x55ad67){if(_0x55ad67['type']!==_0x0242('0x3c')){var _0x2ca31d={};_0x2ca31d[_0x55ad67[_0x0242('0x2a')]]={'$like':'%'+_0x323d3a[_0x0242('0x31')][_0x0242('0x3a')]+'%'};return _0x2ca31d;}})});}_0xa2f925=_[_0x0242('0x3b')]({},_0xa2f925,_0x323d3a[_0x0242('0x3d')]);var _0x3d6972={'where':_0xa2f925['where']};return db[_0x0242('0x2d')][_0x0242('0x1f')](_0x3d6972)[_0x0242('0x25')](function(_0x49ac49){_0x153a2d[_0x0242('0x1f')]=_0x49ac49;if(_0x323d3a[_0x0242('0x31')]['includeAll']){_0xa2f925[_0x0242('0x3e')]=[{'all':!![]}];}return db[_0x0242('0x2d')][_0x0242('0x3f')](_0xa2f925);})[_0x0242('0x25')](function(_0x9591eb){_0x153a2d['rows']=_0x9591eb;return _0x153a2d;})['then'](respondWithFilteredResult(_0x3602ab,_0xa2f925))[_0x0242('0x40')](handleError(_0x3602ab,null));};exports[_0x0242('0x41')]=function(_0x2fb384,_0x11ad29){var _0x902771={'raw':!![],'where':{'id':_0x2fb384[_0x0242('0x42')]['id']}},_0xc04c0b={};_0xc04c0b['model']=_[_0x0242('0x43')](db[_0x0242('0x2d')][_0x0242('0x2e')]);_0xc04c0b['query']=_['keys'](_0x2fb384['query']);_0xc04c0b[_0x0242('0x32')]=_['intersection'](_0xc04c0b['model'],_0xc04c0b[_0x0242('0x31')]);_0x902771[_0x0242('0x33')]=_[_0x0242('0x34')](_0xc04c0b['model'],qs[_0x0242('0x44')](_0x2fb384[_0x0242('0x31')][_0x0242('0x44')]));_0x902771[_0x0242('0x33')]=_0x902771[_0x0242('0x33')][_0x0242('0x35')]?_0x902771[_0x0242('0x33')]:_0xc04c0b['model'];if(_0x2fb384[_0x0242('0x31')][_0x0242('0x45')]){_0x902771[_0x0242('0x3e')]=[{'all':!![]}];}_0x902771=_['merge']({},_0x902771,_0x2fb384[_0x0242('0x3d')]);return db[_0x0242('0x2d')][_0x0242('0x46')](_0x902771)['then'](handleEntityNotFound(_0x11ad29,null))[_0x0242('0x25')](respondWithResult(_0x11ad29,null))[_0x0242('0x40')](handleError(_0x11ad29,null));};exports[_0x0242('0x47')]=function(_0x5086be,_0x451925){return db[_0x0242('0x2d')][_0x0242('0x47')](_0x5086be['body'],{})['then'](function(_0x37e6f8){var _0x23c33b=_0x5086be[_0x0242('0x48')][_0x0242('0x26')]({'plain':!![]});if(!_0x23c33b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x23c33b[_0x0242('0x49')]===_0x0242('0x48')){var _0x470180=_0x37e6f8[_0x0242('0x26')]({'plain':!![]});var _0x573ebc='CmHopperAdditionalPhones';return db['UserProfileSection'][_0x0242('0x46')]({'where':{'name':_0x573ebc,'userProfileId':_0x23c33b['userProfileId']},'raw':!![]})['then'](function(_0x34b862){if(_0x34b862&&_0x34b862[_0x0242('0x4a')]===0x0){return db[_0x0242('0x27')][_0x0242('0x47')]({'name':_0x470180[_0x0242('0x2a')],'resourceId':_0x470180['id'],'type':_0x34b862[_0x0242('0x2a')],'sectionId':_0x34b862['id']},{})[_0x0242('0x25')](function(){return _0x37e6f8;});}else{return _0x37e6f8;}})[_0x0242('0x40')](function(_0x472578){logger[_0x0242('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x472578);throw _0x472578;});}return _0x37e6f8;})[_0x0242('0x25')](respondWithResult(_0x451925,0xc9))[_0x0242('0x40')](handleError(_0x451925,null));};exports[_0x0242('0x24')]=function(_0x29f3de,_0x43e2f3){if(_0x29f3de[_0x0242('0x4b')]['id']){delete _0x29f3de[_0x0242('0x4b')]['id'];}return db[_0x0242('0x2d')][_0x0242('0x46')]({'where':{'id':_0x29f3de[_0x0242('0x42')]['id']}})['then'](handleEntityNotFound(_0x43e2f3,null))[_0x0242('0x25')](saveUpdates(_0x29f3de[_0x0242('0x4b')],null))['then'](respondWithResult(_0x43e2f3,null))['catch'](handleError(_0x43e2f3,null));};exports[_0x0242('0x4c')]=function(_0x59ba74,_0x690728){return db[_0x0242('0x2d')][_0x0242('0x46')]({'where':{'id':_0x59ba74[_0x0242('0x42')]['id']}})['then'](handleEntityNotFound(_0x690728,null))['then'](removeEntity(_0x690728,null))[_0x0242('0x40')](handleError(_0x690728,null));}; \ No newline at end of file +var _0x1fbb=['CmHopperAdditionalPhones','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','set','Content-Range','reject','save','update','then','destroy','get','UserProfileResource','end','stack','send','index','map','rawAttributes','fieldName','key','model','name','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','CmHopperAdditionalPhone','count','includeAll','include','findAll','catch','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role'];(function(_0x58dc25,_0x49b9d5){var _0x21b0a7=function(_0x38a186){while(--_0x38a186){_0x58dc25['push'](_0x58dc25['shift']());}};_0x21b0a7(++_0x49b9d5);}(_0x1fbb,0x10c));var _0xb1fb=function(_0x590e3c,_0x596a9a){_0x590e3c=_0x590e3c-0x0;var _0x183f26=_0x1fbb[_0x590e3c];return _0x183f26;};'use strict';var emlformat=require(_0xb1fb('0x0'));var rimraf=require(_0xb1fb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb1fb('0x2'));var rp=require(_0xb1fb('0x3'));var moment=require(_0xb1fb('0x4'));var BPromise=require(_0xb1fb('0x5'));var Mustache=require('mustache');var util=require(_0xb1fb('0x6'));var path=require('path');var sox=require(_0xb1fb('0x7'));var csv=require(_0xb1fb('0x8'));var ejs=require(_0xb1fb('0x9'));var fs=require('fs');var fs_extra=require(_0xb1fb('0xa'));var _=require(_0xb1fb('0xb'));var squel=require(_0xb1fb('0xc'));var crypto=require(_0xb1fb('0xd'));var jsforce=require(_0xb1fb('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xb1fb('0x8'));var querystring=require(_0xb1fb('0xf'));var Papa=require(_0xb1fb('0x10'));var Redis=require(_0xb1fb('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xb1fb('0x12'));var hardwareService=require(_0xb1fb('0x13'));var logger=require(_0xb1fb('0x14'))(_0xb1fb('0x15'));var utils=require(_0xb1fb('0x16'));var config=require(_0xb1fb('0x17'));var licenseUtil=require(_0xb1fb('0x18'));var db=require(_0xb1fb('0x19'))['db'];function respondWithStatusCode(_0x56ccdb,_0x389cc7){_0x389cc7=_0x389cc7||0xcc;return function(_0x7bf660){if(_0x7bf660){return _0x56ccdb[_0xb1fb('0x1a')](_0x389cc7);}return _0x56ccdb[_0xb1fb('0x1b')](_0x389cc7)['end']();};}function respondWithResult(_0x5e4a3d,_0x135fda){_0x135fda=_0x135fda||0xc8;return function(_0x520f27){if(_0x520f27){return _0x5e4a3d[_0xb1fb('0x1b')](_0x135fda)[_0xb1fb('0x1c')](_0x520f27);}};}function respondWithFilteredResult(_0x249685,_0xe2cf40){return function(_0x57905a){if(_0x57905a){var _0xa429b5=typeof _0xe2cf40[_0xb1fb('0x1d')]===_0xb1fb('0x1e')&&typeof _0xe2cf40[_0xb1fb('0x1f')]===_0xb1fb('0x1e');var _0xcc15d5=_0x57905a['count'];var _0x1ea07b=_0xa429b5?0x0:_0xe2cf40[_0xb1fb('0x1d')];var _0x17fcc1=_0xa429b5?_0x57905a['count']:_0xe2cf40['offset']+_0xe2cf40[_0xb1fb('0x1f')];var _0x4ce1b8;if(_0x17fcc1>=_0xcc15d5){_0x17fcc1=_0xcc15d5;_0x4ce1b8=0xc8;}else{_0x4ce1b8=0xce;}_0x249685[_0xb1fb('0x1b')](_0x4ce1b8);return _0x249685[_0xb1fb('0x20')](_0xb1fb('0x21'),_0x1ea07b+'-'+_0x17fcc1+'/'+_0xcc15d5)['json'](_0x57905a);}return null;};}function patchUpdates(_0x37c53c){return function(_0x3c4b14){try{jsonpatch['apply'](_0x3c4b14,_0x37c53c,!![]);}catch(_0x622e32){return BPromise[_0xb1fb('0x22')](_0x622e32);}return _0x3c4b14[_0xb1fb('0x23')]();};}function saveUpdates(_0x1d02b2,_0x17225e){return function(_0x253319){if(_0x253319){return _0x253319[_0xb1fb('0x24')](_0x1d02b2)[_0xb1fb('0x25')](function(_0x435330){return _0x435330;});}return null;};}function removeEntity(_0x199ac3,_0x2fdf2b){return function(_0xc205e3){if(_0xc205e3){return _0xc205e3[_0xb1fb('0x26')]()[_0xb1fb('0x25')](function(){var _0x574e96=_0xc205e3[_0xb1fb('0x27')]({'plain':!![]});var _0x2e4e77='CmHopperAdditionalPhones';return db[_0xb1fb('0x28')][_0xb1fb('0x26')]({'where':{'type':_0x2e4e77,'resourceId':_0x574e96['id']}})['then'](function(){return _0xc205e3;});})[_0xb1fb('0x25')](function(){_0x199ac3[_0xb1fb('0x1b')](0xcc)[_0xb1fb('0x29')]();});}};}function handleEntityNotFound(_0x32c6b5,_0x522b58){return function(_0x13507){if(!_0x13507){_0x32c6b5[_0xb1fb('0x1a')](0x194);}return _0x13507;};}function handleError(_0x1f159f,_0x1bb28d){_0x1bb28d=_0x1bb28d||0x1f4;return function(_0x1e5523){logger['error'](_0x1e5523[_0xb1fb('0x2a')]);if(_0x1e5523['name']){delete _0x1e5523['name'];}_0x1f159f[_0xb1fb('0x1b')](_0x1bb28d)[_0xb1fb('0x2b')](_0x1e5523);};}exports[_0xb1fb('0x2c')]=function(_0x23197c,_0x2be21f){var _0x43de82={},_0x31441e={},_0x113047={'count':0x0,'rows':[]};var _0xc23b6d=_[_0xb1fb('0x2d')](db['CmHopperAdditionalPhone'][_0xb1fb('0x2e')],function(_0x37cae9){return{'name':_0x37cae9[_0xb1fb('0x2f')],'type':_0x37cae9['type'][_0xb1fb('0x30')]};});_0x31441e[_0xb1fb('0x31')]=_[_0xb1fb('0x2d')](_0xc23b6d,_0xb1fb('0x32'));_0x31441e[_0xb1fb('0x33')]=_[_0xb1fb('0x34')](_0x23197c[_0xb1fb('0x33')]);_0x31441e[_0xb1fb('0x35')]=_[_0xb1fb('0x36')](_0x31441e[_0xb1fb('0x31')],_0x31441e[_0xb1fb('0x33')]);_0x43de82[_0xb1fb('0x37')]=_['intersection'](_0x31441e[_0xb1fb('0x31')],qs[_0xb1fb('0x38')](_0x23197c[_0xb1fb('0x33')][_0xb1fb('0x38')]));_0x43de82[_0xb1fb('0x37')]=_0x43de82[_0xb1fb('0x37')][_0xb1fb('0x39')]?_0x43de82['attributes']:_0x31441e['model'];if(!_0x23197c[_0xb1fb('0x33')]['hasOwnProperty'](_0xb1fb('0x3a'))){_0x43de82[_0xb1fb('0x1f')]=qs['limit'](_0x23197c[_0xb1fb('0x33')][_0xb1fb('0x1f')]);_0x43de82[_0xb1fb('0x1d')]=qs[_0xb1fb('0x1d')](_0x23197c[_0xb1fb('0x33')][_0xb1fb('0x1d')]);}_0x43de82[_0xb1fb('0x3b')]=qs[_0xb1fb('0x3c')](_0x23197c[_0xb1fb('0x33')][_0xb1fb('0x3c')]);_0x43de82[_0xb1fb('0x3d')]=qs['filters'](_[_0xb1fb('0x3e')](_0x23197c[_0xb1fb('0x33')],_0x31441e[_0xb1fb('0x35')]),_0xc23b6d);if(_0x23197c[_0xb1fb('0x33')][_0xb1fb('0x3f')]){_0x43de82[_0xb1fb('0x3d')]=_['merge'](_0x43de82[_0xb1fb('0x3d')],{'$or':_[_0xb1fb('0x2d')](_0xc23b6d,function(_0x483fa1){if(_0x483fa1['type']!==_0xb1fb('0x40')){var _0x4fb2bf={};_0x4fb2bf[_0x483fa1['name']]={'$like':'%'+_0x23197c[_0xb1fb('0x33')][_0xb1fb('0x3f')]+'%'};return _0x4fb2bf;}})});}_0x43de82=_[_0xb1fb('0x41')]({},_0x43de82,_0x23197c[_0xb1fb('0x42')]);var _0x4d7b78={'where':_0x43de82[_0xb1fb('0x3d')]};return db[_0xb1fb('0x43')][_0xb1fb('0x44')](_0x4d7b78)[_0xb1fb('0x25')](function(_0x21f615){_0x113047[_0xb1fb('0x44')]=_0x21f615;if(_0x23197c[_0xb1fb('0x33')][_0xb1fb('0x45')]){_0x43de82[_0xb1fb('0x46')]=[{'all':!![]}];}return db[_0xb1fb('0x43')][_0xb1fb('0x47')](_0x43de82);})[_0xb1fb('0x25')](function(_0x37f26c){_0x113047['rows']=_0x37f26c;return _0x113047;})['then'](respondWithFilteredResult(_0x2be21f,_0x43de82))[_0xb1fb('0x48')](handleError(_0x2be21f,null));};exports[_0xb1fb('0x49')]=function(_0x4e87ef,_0x1da2af){var _0x2278d5={'raw':!![],'where':{'id':_0x4e87ef[_0xb1fb('0x4a')]['id']}},_0xacc5e9={};_0xacc5e9[_0xb1fb('0x31')]=_[_0xb1fb('0x34')](db[_0xb1fb('0x43')]['rawAttributes']);_0xacc5e9[_0xb1fb('0x33')]=_['keys'](_0x4e87ef[_0xb1fb('0x33')]);_0xacc5e9['filters']=_[_0xb1fb('0x36')](_0xacc5e9[_0xb1fb('0x31')],_0xacc5e9[_0xb1fb('0x33')]);_0x2278d5[_0xb1fb('0x37')]=_[_0xb1fb('0x36')](_0xacc5e9['model'],qs['fields'](_0x4e87ef[_0xb1fb('0x33')][_0xb1fb('0x38')]));_0x2278d5['attributes']=_0x2278d5[_0xb1fb('0x37')]['length']?_0x2278d5[_0xb1fb('0x37')]:_0xacc5e9[_0xb1fb('0x31')];if(_0x4e87ef['query'][_0xb1fb('0x45')]){_0x2278d5[_0xb1fb('0x46')]=[{'all':!![]}];}_0x2278d5=_['merge']({},_0x2278d5,_0x4e87ef['options']);return db['CmHopperAdditionalPhone'][_0xb1fb('0x4b')](_0x2278d5)['then'](handleEntityNotFound(_0x1da2af,null))[_0xb1fb('0x25')](respondWithResult(_0x1da2af,null))['catch'](handleError(_0x1da2af,null));};exports['create']=function(_0x508ce2,_0x56b972){return db[_0xb1fb('0x43')][_0xb1fb('0x4c')](_0x508ce2['body'],{})[_0xb1fb('0x25')](function(_0x40ab6f){var _0x3cc984=_0x508ce2[_0xb1fb('0x4d')]['get']({'plain':!![]});if(!_0x3cc984)throw new Error(_0xb1fb('0x4e'));if(_0x3cc984[_0xb1fb('0x4f')]==='user'){var _0x5b2178=_0x40ab6f[_0xb1fb('0x27')]({'plain':!![]});var _0x3f8ad1=_0xb1fb('0x50');return db[_0xb1fb('0x51')][_0xb1fb('0x4b')]({'where':{'name':_0x3f8ad1,'userProfileId':_0x3cc984[_0xb1fb('0x52')]},'raw':!![]})[_0xb1fb('0x25')](function(_0x4eb75e){if(_0x4eb75e&&_0x4eb75e[_0xb1fb('0x53')]===0x0){return db[_0xb1fb('0x28')][_0xb1fb('0x4c')]({'name':_0x5b2178[_0xb1fb('0x32')],'resourceId':_0x5b2178['id'],'type':_0x4eb75e[_0xb1fb('0x32')],'sectionId':_0x4eb75e['id']},{})[_0xb1fb('0x25')](function(){return _0x40ab6f;});}else{return _0x40ab6f;}})[_0xb1fb('0x48')](function(_0x3ea4e2){logger[_0xb1fb('0x54')](_0xb1fb('0x55'),_0x3ea4e2);throw _0x3ea4e2;});}return _0x40ab6f;})[_0xb1fb('0x25')](respondWithResult(_0x56b972,0xc9))['catch'](handleError(_0x56b972,null));};exports[_0xb1fb('0x24')]=function(_0x1d81ad,_0x182f2c){if(_0x1d81ad['body']['id']){delete _0x1d81ad['body']['id'];}return db[_0xb1fb('0x43')][_0xb1fb('0x4b')]({'where':{'id':_0x1d81ad['params']['id']}})[_0xb1fb('0x25')](handleEntityNotFound(_0x182f2c,null))['then'](saveUpdates(_0x1d81ad[_0xb1fb('0x56')],null))[_0xb1fb('0x25')](respondWithResult(_0x182f2c,null))['catch'](handleError(_0x182f2c,null));};exports[_0xb1fb('0x26')]=function(_0x313b7e,_0x4ae6a4){return db[_0xb1fb('0x43')][_0xb1fb('0x4b')]({'where':{'id':_0x313b7e['params']['id']}})[_0xb1fb('0x25')](handleEntityNotFound(_0x4ae6a4,null))[_0xb1fb('0x25')](removeEntity(_0x4ae6a4,null))[_0xb1fb('0x48')](handleError(_0x4ae6a4,null));}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js index a740143..1af32e7 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xec8d=['./cmHopperAdditionalPhone.attributes','exports','define','CmHopperAdditionalPhone','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x21aec3,_0x5c97e9){var _0x288bbc=function(_0x2283fe){while(--_0x2283fe){_0x21aec3['push'](_0x21aec3['shift']());}};_0x288bbc(++_0x5c97e9);}(_0xec8d,0xba));var _0xdec8=function(_0x9fb081,_0x48f480){_0x9fb081=_0x9fb081-0x0;var _0x43f8b0=_0xec8d[_0x9fb081];return _0x43f8b0;};'use strict';var _=require(_0xdec8('0x0'));var util=require(_0xdec8('0x1'));var logger=require(_0xdec8('0x2'))(_0xdec8('0x3'));var moment=require(_0xdec8('0x4'));var BPromise=require(_0xdec8('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdec8('0x6'));var rimraf=require(_0xdec8('0x7'));var config=require(_0xdec8('0x8'));var attributes=require(_0xdec8('0x9'));module[_0xdec8('0xa')]=function(_0x269189,_0x158a2a){return _0x269189[_0xdec8('0xb')](_0xdec8('0xc'),attributes,{'tableName':'cm_hopper_additional_phones','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1c8d=['api','moment','bluebird','request-promise','path','../../config/environment','exports','define','CmHopperAdditionalPhone','cm_hopper_additional_phones','util','../../config/logger'];(function(_0x68efcb,_0x2bc079){var _0x1ab270=function(_0x3b3a4a){while(--_0x3b3a4a){_0x68efcb['push'](_0x68efcb['shift']());}};_0x1ab270(++_0x2bc079);}(_0x1c8d,0x196));var _0xd1c8=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x1c8d[_0x5ddb1c];return _0x354adc;};'use strict';var _=require('lodash');var util=require(_0xd1c8('0x0'));var logger=require(_0xd1c8('0x1'))(_0xd1c8('0x2'));var moment=require(_0xd1c8('0x3'));var BPromise=require(_0xd1c8('0x4'));var rp=require(_0xd1c8('0x5'));var fs=require('fs');var path=require(_0xd1c8('0x6'));var rimraf=require('rimraf');var config=require(_0xd1c8('0x7'));var attributes=require('./cmHopperAdditionalPhone.attributes');module[_0xd1c8('0x8')]=function(_0x51eccf,_0x20ddd2){return _0x51eccf[_0xd1c8('0x9')](_0xd1c8('0xa'),attributes,{'tableName':_0xd1c8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js index aae4d4a..1a80fcf 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xca07=['info','request\x20sent','debug','stringify','error','code','CmHopperAdditionalPhone,\x20%s,\x20%s','message','catch','CmHopper','findOne','body','ContactId','VoiceQueueId','CampaignId','CmHopperAdditionalPhone','OrderBy','countnoanswerretry','countnosuchnumberretry','countdropretry','countagentrejectretry','entity','dialGlobalMaxRetry','ASC','countbusyretry','countcongestionretry','countabandonedretry','countmachineretry','VerifyAdditionalPhones','ListId','duration','waitTime','isNil','scheduledat','add','minutes','updatedAt','phone','createdAt','sequelize','update','activateAdditionalPhone','IncrementPreviewCounters','field','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x198a17,_0x53e4f2){var _0x2383ba=function(_0x371b3c){while(--_0x371b3c){_0x198a17['push'](_0x198a17['shift']());}};_0x2383ba(++_0x53e4f2);}(_0xca07,0x17c));var _0x7ca0=function(_0x585829,_0x81f0f0){_0x585829=_0x585829-0x0;var _0x3c1c02=_0xca07[_0x585829];return _0x3c1c02;};'use strict';var _=require('lodash');var util=require(_0x7ca0('0x0'));var moment=require(_0x7ca0('0x1'));var BPromise=require(_0x7ca0('0x2'));var rs=require(_0x7ca0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7ca0('0x4'));var logger=require(_0x7ca0('0x5'))('rpc');var config=require(_0x7ca0('0x6'));var jayson=require(_0x7ca0('0x7'));var client=jayson[_0x7ca0('0x8')][_0x7ca0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x10a642,_0x880b1a,_0x537117){return new BPromise(function(_0x548d0f,_0x5448bf){return client[_0x7ca0('0xa')](_0x10a642,_0x537117)[_0x7ca0('0xb')](function(_0x16bded){logger[_0x7ca0('0xc')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x880b1a,_0x7ca0('0xd'));logger[_0x7ca0('0xe')]('CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s',_0x880b1a,_0x7ca0('0xd'),JSON[_0x7ca0('0xf')](_0x16bded));if(_0x16bded[_0x7ca0('0x10')]){if(_0x16bded['error'][_0x7ca0('0x11')]===0x1f4){logger[_0x7ca0('0x10')](_0x7ca0('0x12'),_0x880b1a,_0x16bded[_0x7ca0('0x10')][_0x7ca0('0x13')]);return _0x5448bf(_0x16bded['error'][_0x7ca0('0x13')]);}logger[_0x7ca0('0x10')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x880b1a,_0x16bded[_0x7ca0('0x10')]['message']);return _0x548d0f(_0x16bded[_0x7ca0('0x10')][_0x7ca0('0x13')]);}else{logger['info'](_0x7ca0('0x12'),_0x880b1a,_0x7ca0('0xd'));_0x548d0f(_0x16bded['result']['message']);}})[_0x7ca0('0x14')](function(_0x4b978f){logger[_0x7ca0('0x10')](_0x7ca0('0x12'),_0x880b1a,_0x4b978f);_0x5448bf(_0x4b978f);});});}exports['VerifyAdditionalPhones']=function(_0x37399b){var _0x1b58f1=this;return new Promise(function(_0x59428b,_0x41dcba){return db[_0x7ca0('0x15')][_0x7ca0('0x16')]({'raw':!![],'where':{'ContactId':_0x37399b[_0x7ca0('0x17')][_0x7ca0('0x18')],'ListId':_0x37399b['body']['ListId'],'VoiceQueueId':_0x37399b[_0x7ca0('0x17')][_0x7ca0('0x19')]===undefined?null:_0x37399b['body'][_0x7ca0('0x19')],'CampaignId':_0x37399b[_0x7ca0('0x17')][_0x7ca0('0x1a')]===undefined?null:_0x37399b[_0x7ca0('0x17')][_0x7ca0('0x1a')]}})[_0x7ca0('0xb')](function(_0x1f68df){if(_0x1f68df!=null){return db[_0x7ca0('0x1b')][_0x7ca0('0x16')]({'raw':!![],'where':{'CmHopperId':_0x1f68df['id'],'OrderBy':{'$gt':_0x1f68df['OrderBy']}},'order':[[_0x7ca0('0x1c'),'ASC']]})[_0x7ca0('0xb')](function(_0x4727b1){var _0x34e853=0x0;if(_0x4727b1){if(_0x4727b1['countbusyretry']+_0x4727b1['countcongestionretry']+_0x4727b1[_0x7ca0('0x1d')]+_0x4727b1[_0x7ca0('0x1e')]+_0x4727b1[_0x7ca0('0x1f')]+_0x4727b1['countabandonedretry']+_0x4727b1['countmachineretry']+_0x4727b1[_0x7ca0('0x20')]<_0x37399b[_0x7ca0('0x21')][_0x7ca0('0x22')])_0x34e853=0x1;_0x59428b({'additional':_0x34e853});}else{return db['CmHopperAdditionalPhone'][_0x7ca0('0x16')]({'raw':!![],'where':{'CmHopperId':_0x1f68df['id']},'order':[['OrderBy',_0x7ca0('0x23')]]})[_0x7ca0('0xb')](function(_0x4d6b39){var _0x3e7761=0x0;if(_0x4d6b39){if(_0x4d6b39[_0x7ca0('0x24')]+_0x4d6b39[_0x7ca0('0x25')]+_0x4d6b39[_0x7ca0('0x1d')]+_0x4d6b39[_0x7ca0('0x1e')]+_0x4d6b39[_0x7ca0('0x1f')]+_0x4d6b39[_0x7ca0('0x26')]+_0x4d6b39[_0x7ca0('0x27')]+_0x4d6b39[_0x7ca0('0x20')]<_0x37399b[_0x7ca0('0x21')][_0x7ca0('0x22')])_0x3e7761=0x1;_0x59428b({'additional':_0x3e7761});}else{_0x59428b({'additional':0x0});}})[_0x7ca0('0x14')](function(_0x1bdca5){logger[_0x7ca0('0x10')](_0x7ca0('0x28'),_0x1bdca5[_0x7ca0('0x13')]);_0x41dcba(_0x1b58f1[_0x7ca0('0x10')](0x1f4,_0x1bdca5['message']));});}})[_0x7ca0('0x14')](function(_0x44b797){logger['error'](_0x7ca0('0x28'),_0x44b797[_0x7ca0('0x13')]);_0x41dcba(_0x1b58f1['error'](0x1f4,_0x44b797[_0x7ca0('0x13')]));});}else _0x59428b({'additional':0x0});});});};exports['SwapAdditionalPhones']=function(_0x376044){var _0x516460=this;return new Promise(function(_0x42b350,_0x249763){return db['CmHopper'][_0x7ca0('0x16')]({'raw':!![],'where':{'ContactId':_0x376044[_0x7ca0('0x17')][_0x7ca0('0x18')],'ListId':_0x376044[_0x7ca0('0x17')][_0x7ca0('0x29')],'VoiceQueueId':_0x376044[_0x7ca0('0x17')]['VoiceQueueId']===undefined?null:_0x376044[_0x7ca0('0x17')][_0x7ca0('0x19')],'CampaignId':_0x376044[_0x7ca0('0x17')][_0x7ca0('0x1a')]===undefined?null:_0x376044[_0x7ca0('0x17')]['CampaignId']}})[_0x7ca0('0xb')](function(_0x14a339){if(_0x14a339!=null){return db['CmHopperAdditionalPhone'][_0x7ca0('0x16')]({'raw':!![],'where':{'CmHopperId':_0x14a339['id'],'OrderBy':{'$gte':_0x14a339[_0x7ca0('0x1c')]}},'order':[[_0x7ca0('0x1c'),'ASC']]})[_0x7ca0('0xb')](function(_0x3db31d){if(_0x3db31d)return activateAdditionalPhone(_0x14a339,_0x376044['body'],_0x3db31d,_0x376044[_0x7ca0('0x2a')],_0x376044[_0x7ca0('0x2b')])[_0x7ca0('0xb')](function(_0x4cfa0c){_0x42b350(_0x4cfa0c);});else{return db[_0x7ca0('0x1b')][_0x7ca0('0x16')]({'raw':!![],'where':{'CmHopperId':_0x14a339['id']},'order':[[_0x7ca0('0x1c'),_0x7ca0('0x23')]]})['then'](function(_0x5e3904){if(_0x5e3904)return activateAdditionalPhone(_0x14a339,_0x376044[_0x7ca0('0x17')],_0x5e3904,_0x376044[_0x7ca0('0x2a')],_0x376044['waitTime'])[_0x7ca0('0xb')](function(_0x4ad489){_0x42b350(_0x4ad489);});else{_0x42b350({'id':_0x14a339['id'],'phone':''});}})[_0x7ca0('0x14')](function(_0xf1eb19){logger[_0x7ca0('0x10')](_0x7ca0('0x28'),_0xf1eb19['message']);_0x249763(_0x516460[_0x7ca0('0x10')](0x1f4,_0xf1eb19[_0x7ca0('0x13')]));});}})[_0x7ca0('0x14')](function(_0x57c8a8){logger[_0x7ca0('0x10')]('VerifyAdditionalPhones',_0x57c8a8[_0x7ca0('0x13')]);_0x249763(_0x516460[_0x7ca0('0x10')](0x1f4,_0x57c8a8['message']));});}else _0x42b350(0x1);});});};function activateAdditionalPhone(_0x376c49,_0x5ea2b1,_0x34f229,_0x1b1dd6,_0x494f32){return new Promise(function(_0x27e9d4,_0x5e7e74){var _0x8aa037;if(_[_0x7ca0('0x2c')](_0x34f229[_0x7ca0('0x2d')])){_0x34f229['scheduledat']=moment();}if(moment()>moment(_0x34f229[_0x7ca0('0x2d')])){_0x8aa037=moment()[_0x7ca0('0x2e')](_0x494f32||0x3,'minutes');}else{if(_0x34f229[_0x7ca0('0x1c')]==0x0){_0x8aa037=moment(_0x34f229['scheduledat']);}else{_0x8aa037=moment()[_0x7ca0('0x2e')](_0x494f32||0x3,_0x7ca0('0x2f'));}}if(_[_0x7ca0('0x2c')](_0x8aa037)){_0x8aa037=moment()[_0x7ca0('0x2e')](_0x494f32||0x3,'minutes');}var _0x1aa58c={'phone':_0x376c49['phone'],'active':0x0,'OrderBy':_[_0x7ca0('0x2c')](_0x376c49[_0x7ca0('0x1c')])?0x0:_0x376c49[_0x7ca0('0x1c')],'scheduledat':moment()['add'](_0x1b1dd6||0x1,_0x7ca0('0x2f')),'countbusyretry':_0x5ea2b1[_0x7ca0('0x24')],'countcongestionretry':_0x5ea2b1[_0x7ca0('0x25')],'countnoanswerretry':_0x5ea2b1[_0x7ca0('0x1d')],'countnosuchnumberretry':_0x5ea2b1[_0x7ca0('0x1e')],'countdropretry':_0x5ea2b1[_0x7ca0('0x1f')],'countabandonedretry':_0x5ea2b1[_0x7ca0('0x26')],'countmachineretry':_0x5ea2b1['countmachineretry'],'countagentrejectretry':_0x5ea2b1['countagentrejectretry'],'createdAt':_0x5ea2b1['createdAt'],'updatedAt':_0x5ea2b1[_0x7ca0('0x30')]};var _0x2f2313={'CmHopperId':_0x376c49['id'],'phone':_0x34f229[_0x7ca0('0x31')],'active':0x0,'OrderBy':_[_0x7ca0('0x2c')](_0x34f229[_0x7ca0('0x1c')])?0x0:_0x34f229[_0x7ca0('0x1c')],'scheduledat':_0x8aa037,'countbusyretry':_0x34f229[_0x7ca0('0x24')],'countcongestionretry':_0x34f229[_0x7ca0('0x25')],'countnoanswerretry':_0x34f229['countnoanswerretry'],'countnosuchnumberretry':_0x34f229[_0x7ca0('0x1e')],'countdropretry':_0x34f229[_0x7ca0('0x1f')],'countabandonedretry':_0x34f229[_0x7ca0('0x26')],'countmachineretry':_0x34f229[_0x7ca0('0x27')],'countagentrejectretry':_0x34f229[_0x7ca0('0x20')],'createdAt':_0x34f229[_0x7ca0('0x32')],'updatedAt':_0x34f229[_0x7ca0('0x30')]};return db[_0x7ca0('0x33')]['transaction'](function(_0x13e6fb){return db[_0x7ca0('0x1b')][_0x7ca0('0x34')](_0x1aa58c,{'where':{'id':_0x34f229['id']}},{'transaction':_0x13e6fb})[_0x7ca0('0xb')](function(){return db[_0x7ca0('0x15')][_0x7ca0('0x34')](_0x2f2313,{'where':{'id':_0x376c49['id']}},{'transaction':_0x13e6fb});});})[_0x7ca0('0xb')](function(_0x20cb60){_0x27e9d4({'id':_0x376c49['id'],'phone':_0x34f229[_0x7ca0('0x31')]});})[_0x7ca0('0x14')](function(_0x33b61e){logger['error'](_0x7ca0('0x35'),_0x33b61e[_0x7ca0('0x13')]);_0x5e7e74({'error':_0x33b61e[_0x7ca0('0x13')]});});});}exports[_0x7ca0('0x36')]=function(_0x518a02){var _0x50092c=this;return new Promise(function(_0x11ce03,_0x79764b){return db[_0x7ca0('0x15')][_0x7ca0('0x34')](_0x518a02[_0x7ca0('0x17')][_0x7ca0('0x37')],{'where':{'id':_0x518a02[_0x7ca0('0x17')]['id']}})['then'](function(_0x202d21){_0x11ce03(_0x202d21);})['catch'](function(_0x38caab){logger['error'](_0x7ca0('0x36'),_0x38caab[_0x7ca0('0x13')]);_0x79764b(_0x50092c[_0x7ca0('0x10')](0x1f4,_0x38caab[_0x7ca0('0x13')]));});});}; \ No newline at end of file +var _0xc799=['IncrementPreviewCounters','field','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CmHopper','body','ContactId','ListId','VoiceQueueId','CampaignId','CmHopperAdditionalPhone','findOne','OrderBy','ASC','countcongestionretry','countnoanswerretry','countmachineretry','countagentrejectretry','entity','countnosuchnumberretry','dialGlobalMaxRetry','VerifyAdditionalPhones','SwapAdditionalPhones','duration','waitTime','isNil','scheduledat','minutes','add','phone','countbusyretry','countabandonedretry','createdAt','updatedAt','countdropretry','transaction','update'];(function(_0x5d4a99,_0x54e841){var _0x1ae21d=function(_0xc91b52){while(--_0xc91b52){_0x5d4a99['push'](_0x5d4a99['shift']());}};_0x1ae21d(++_0x54e841);}(_0xc799,0x1a6));var _0x9c79=function(_0xafb5e3,_0x3e25c4){_0xafb5e3=_0xafb5e3-0x0;var _0x62315f=_0xc799[_0xafb5e3];return _0x62315f;};'use strict';var _=require(_0x9c79('0x0'));var util=require(_0x9c79('0x1'));var moment=require(_0x9c79('0x2'));var BPromise=require(_0x9c79('0x3'));var rs=require(_0x9c79('0x4'));var fs=require('fs');var Redis=require(_0x9c79('0x5'));var db=require(_0x9c79('0x6'))['db'];var utils=require(_0x9c79('0x7'));var logger=require(_0x9c79('0x8'))('rpc');var config=require(_0x9c79('0x9'));var jayson=require(_0x9c79('0xa'));var client=jayson[_0x9c79('0xb')][_0x9c79('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x244a19,_0xe3be36,_0x64c7c4){return new BPromise(function(_0x23f5a4,_0x3e9e71){return client[_0x9c79('0xd')](_0x244a19,_0x64c7c4)[_0x9c79('0xe')](function(_0x1eae3c){logger[_0x9c79('0xf')](_0x9c79('0x10'),_0xe3be36,_0x9c79('0x11'));logger[_0x9c79('0x12')](_0x9c79('0x13'),_0xe3be36,_0x9c79('0x11'),JSON[_0x9c79('0x14')](_0x1eae3c));if(_0x1eae3c[_0x9c79('0x15')]){if(_0x1eae3c[_0x9c79('0x15')][_0x9c79('0x16')]===0x1f4){logger[_0x9c79('0x15')](_0x9c79('0x10'),_0xe3be36,_0x1eae3c[_0x9c79('0x15')][_0x9c79('0x17')]);return _0x3e9e71(_0x1eae3c[_0x9c79('0x15')][_0x9c79('0x17')]);}logger[_0x9c79('0x15')](_0x9c79('0x10'),_0xe3be36,_0x1eae3c[_0x9c79('0x15')][_0x9c79('0x17')]);return _0x23f5a4(_0x1eae3c[_0x9c79('0x15')][_0x9c79('0x17')]);}else{logger[_0x9c79('0xf')](_0x9c79('0x10'),_0xe3be36,_0x9c79('0x11'));_0x23f5a4(_0x1eae3c['result'][_0x9c79('0x17')]);}})[_0x9c79('0x18')](function(_0x3e5baa){logger[_0x9c79('0x15')](_0x9c79('0x10'),_0xe3be36,_0x3e5baa);_0x3e9e71(_0x3e5baa);});});}exports['VerifyAdditionalPhones']=function(_0x409183){var _0x38de1f=this;return new Promise(function(_0x329582,_0x2a1692){return db[_0x9c79('0x19')]['findOne']({'raw':!![],'where':{'ContactId':_0x409183[_0x9c79('0x1a')][_0x9c79('0x1b')],'ListId':_0x409183[_0x9c79('0x1a')][_0x9c79('0x1c')],'VoiceQueueId':_0x409183['body'][_0x9c79('0x1d')]===undefined?null:_0x409183[_0x9c79('0x1a')]['VoiceQueueId'],'CampaignId':_0x409183['body'][_0x9c79('0x1e')]===undefined?null:_0x409183['body']['CampaignId']}})['then'](function(_0x223117){if(_0x223117!=null){return db[_0x9c79('0x1f')][_0x9c79('0x20')]({'raw':!![],'where':{'CmHopperId':_0x223117['id'],'OrderBy':{'$gt':_0x223117['OrderBy']}},'order':[[_0x9c79('0x21'),_0x9c79('0x22')]]})[_0x9c79('0xe')](function(_0x16bcde){var _0x1eff7c=0x0;if(_0x16bcde){if(_0x16bcde['countbusyretry']+_0x16bcde[_0x9c79('0x23')]+_0x16bcde[_0x9c79('0x24')]+_0x16bcde['countnosuchnumberretry']+_0x16bcde['countdropretry']+_0x16bcde['countabandonedretry']+_0x16bcde[_0x9c79('0x25')]+_0x16bcde[_0x9c79('0x26')]<_0x409183[_0x9c79('0x27')]['dialGlobalMaxRetry'])_0x1eff7c=0x1;_0x329582({'additional':_0x1eff7c});}else{return db[_0x9c79('0x1f')][_0x9c79('0x20')]({'raw':!![],'where':{'CmHopperId':_0x223117['id']},'order':[[_0x9c79('0x21'),'ASC']]})[_0x9c79('0xe')](function(_0x2ac32){var _0x40b0ef=0x0;if(_0x2ac32){if(_0x2ac32['countbusyretry']+_0x2ac32['countcongestionretry']+_0x2ac32[_0x9c79('0x24')]+_0x2ac32[_0x9c79('0x28')]+_0x2ac32['countdropretry']+_0x2ac32['countabandonedretry']+_0x2ac32[_0x9c79('0x25')]+_0x2ac32[_0x9c79('0x26')]<_0x409183[_0x9c79('0x27')][_0x9c79('0x29')])_0x40b0ef=0x1;_0x329582({'additional':_0x40b0ef});}else{_0x329582({'additional':0x0});}})['catch'](function(_0x2b0f6e){logger[_0x9c79('0x15')](_0x9c79('0x2a'),_0x2b0f6e[_0x9c79('0x17')]);_0x2a1692(_0x38de1f[_0x9c79('0x15')](0x1f4,_0x2b0f6e[_0x9c79('0x17')]));});}})[_0x9c79('0x18')](function(_0x54c08f){logger[_0x9c79('0x15')](_0x9c79('0x2a'),_0x54c08f['message']);_0x2a1692(_0x38de1f[_0x9c79('0x15')](0x1f4,_0x54c08f[_0x9c79('0x17')]));});}else _0x329582({'additional':0x0});});});};exports[_0x9c79('0x2b')]=function(_0x4d6cd3){var _0x59c3d9=this;return new Promise(function(_0x329343,_0x48e85b){return db[_0x9c79('0x19')][_0x9c79('0x20')]({'raw':!![],'where':{'ContactId':_0x4d6cd3['body'][_0x9c79('0x1b')],'ListId':_0x4d6cd3[_0x9c79('0x1a')][_0x9c79('0x1c')],'VoiceQueueId':_0x4d6cd3[_0x9c79('0x1a')][_0x9c79('0x1d')]===undefined?null:_0x4d6cd3[_0x9c79('0x1a')][_0x9c79('0x1d')],'CampaignId':_0x4d6cd3[_0x9c79('0x1a')][_0x9c79('0x1e')]===undefined?null:_0x4d6cd3[_0x9c79('0x1a')]['CampaignId']}})[_0x9c79('0xe')](function(_0x124690){if(_0x124690!=null){return db[_0x9c79('0x1f')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x124690['id'],'OrderBy':{'$gte':_0x124690['OrderBy']}},'order':[[_0x9c79('0x21'),_0x9c79('0x22')]]})['then'](function(_0x149233){if(_0x149233)return activateAdditionalPhone(_0x124690,_0x4d6cd3[_0x9c79('0x1a')],_0x149233,_0x4d6cd3[_0x9c79('0x2c')],_0x4d6cd3[_0x9c79('0x2d')])[_0x9c79('0xe')](function(_0x3c9e4c){_0x329343(_0x3c9e4c);});else{return db[_0x9c79('0x1f')][_0x9c79('0x20')]({'raw':!![],'where':{'CmHopperId':_0x124690['id']},'order':[['OrderBy',_0x9c79('0x22')]]})[_0x9c79('0xe')](function(_0x2cb83d){if(_0x2cb83d)return activateAdditionalPhone(_0x124690,_0x4d6cd3[_0x9c79('0x1a')],_0x2cb83d,_0x4d6cd3[_0x9c79('0x2c')],_0x4d6cd3['waitTime'])[_0x9c79('0xe')](function(_0x531bb5){_0x329343(_0x531bb5);});else{_0x329343({'id':_0x124690['id'],'phone':''});}})[_0x9c79('0x18')](function(_0xc5997d){logger[_0x9c79('0x15')]('VerifyAdditionalPhones',_0xc5997d[_0x9c79('0x17')]);_0x48e85b(_0x59c3d9[_0x9c79('0x15')](0x1f4,_0xc5997d[_0x9c79('0x17')]));});}})[_0x9c79('0x18')](function(_0x42a215){logger[_0x9c79('0x15')](_0x9c79('0x2a'),_0x42a215[_0x9c79('0x17')]);_0x48e85b(_0x59c3d9[_0x9c79('0x15')](0x1f4,_0x42a215['message']));});}else _0x329343(0x1);});});};function activateAdditionalPhone(_0x32f438,_0x20cd6b,_0x56bf45,_0x124184,_0xa454ab){return new Promise(function(_0x5909df,_0x193888){var _0x352391;if(_[_0x9c79('0x2e')](_0x56bf45[_0x9c79('0x2f')])){_0x56bf45['scheduledat']=moment();}if(moment()>moment(_0x56bf45[_0x9c79('0x2f')])){_0x352391=moment()['add'](_0xa454ab||0x3,_0x9c79('0x30'));}else{if(_0x56bf45[_0x9c79('0x21')]==0x0){_0x352391=moment(_0x56bf45['scheduledat']);}else{_0x352391=moment()[_0x9c79('0x31')](_0xa454ab||0x3,'minutes');}}if(_[_0x9c79('0x2e')](_0x352391)){_0x352391=moment()[_0x9c79('0x31')](_0xa454ab||0x3,_0x9c79('0x30'));}var _0x1321f9={'phone':_0x32f438[_0x9c79('0x32')],'active':0x0,'OrderBy':_['isNil'](_0x32f438[_0x9c79('0x21')])?0x0:_0x32f438[_0x9c79('0x21')],'scheduledat':moment()['add'](_0x124184||0x1,_0x9c79('0x30')),'countbusyretry':_0x20cd6b[_0x9c79('0x33')],'countcongestionretry':_0x20cd6b['countcongestionretry'],'countnoanswerretry':_0x20cd6b[_0x9c79('0x24')],'countnosuchnumberretry':_0x20cd6b[_0x9c79('0x28')],'countdropretry':_0x20cd6b['countdropretry'],'countabandonedretry':_0x20cd6b[_0x9c79('0x34')],'countmachineretry':_0x20cd6b[_0x9c79('0x25')],'countagentrejectretry':_0x20cd6b['countagentrejectretry'],'createdAt':_0x20cd6b[_0x9c79('0x35')],'updatedAt':_0x20cd6b[_0x9c79('0x36')]};var _0x270f9f={'CmHopperId':_0x32f438['id'],'phone':_0x56bf45[_0x9c79('0x32')],'active':0x0,'OrderBy':_[_0x9c79('0x2e')](_0x56bf45[_0x9c79('0x21')])?0x0:_0x56bf45[_0x9c79('0x21')],'scheduledat':_0x352391,'countbusyretry':_0x56bf45[_0x9c79('0x33')],'countcongestionretry':_0x56bf45[_0x9c79('0x23')],'countnoanswerretry':_0x56bf45[_0x9c79('0x24')],'countnosuchnumberretry':_0x56bf45[_0x9c79('0x28')],'countdropretry':_0x56bf45[_0x9c79('0x37')],'countabandonedretry':_0x56bf45[_0x9c79('0x34')],'countmachineretry':_0x56bf45[_0x9c79('0x25')],'countagentrejectretry':_0x56bf45['countagentrejectretry'],'createdAt':_0x56bf45['createdAt'],'updatedAt':_0x56bf45['updatedAt']};return db['sequelize'][_0x9c79('0x38')](function(_0x4f00f2){return db[_0x9c79('0x1f')]['update'](_0x1321f9,{'where':{'id':_0x56bf45['id']}},{'transaction':_0x4f00f2})[_0x9c79('0xe')](function(){return db['CmHopper'][_0x9c79('0x39')](_0x270f9f,{'where':{'id':_0x32f438['id']}},{'transaction':_0x4f00f2});});})[_0x9c79('0xe')](function(_0xce4321){_0x5909df({'id':_0x32f438['id'],'phone':_0x56bf45[_0x9c79('0x32')]});})[_0x9c79('0x18')](function(_0x5ec700){logger[_0x9c79('0x15')]('activateAdditionalPhone',_0x5ec700[_0x9c79('0x17')]);_0x193888({'error':_0x5ec700[_0x9c79('0x17')]});});});}exports[_0x9c79('0x3a')]=function(_0x19171a){var _0x511f87=this;return new Promise(function(_0x1e2f13,_0x2a5bfa){return db[_0x9c79('0x19')][_0x9c79('0x39')](_0x19171a['body'][_0x9c79('0x3b')],{'where':{'id':_0x19171a['body']['id']}})[_0x9c79('0xe')](function(_0x275cfa){_0x1e2f13(_0x275cfa);})[_0x9c79('0x18')](function(_0x21e3d){logger[_0x9c79('0x15')]('IncrementPreviewCounters',_0x21e3d[_0x9c79('0x17')]);_0x2a5bfa(_0x511f87[_0x9c79('0x15')](0x1f4,_0x21e3d[_0x9c79('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/index.js b/server/api/cmHopperAdditionalPhone/index.js index 24e318e..b77744f 100644 --- a/server/api/cmHopperAdditionalPhone/index.js +++ b/server/api/cmHopperAdditionalPhone/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbf30=['path','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','delete','exports','util'];(function(_0xa2c2e2,_0x535d90){var _0x3d7867=function(_0x48be46){while(--_0x48be46){_0xa2c2e2['push'](_0xa2c2e2['shift']());}};_0x3d7867(++_0x535d90);}(_0xbf30,0x133));var _0x0bf3=function(_0x287f04,_0x4c4f6f){_0x287f04=_0x287f04-0x0;var _0x3da40a=_0xbf30[_0x287f04];return _0x3da40a;};'use strict';var multer=require('multer');var util=require(_0x0bf3('0x0'));var path=require(_0x0bf3('0x1'));var timeout=require('connect-timeout');var express=require(_0x0bf3('0x2'));var router=express[_0x0bf3('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0bf3('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x0bf3('0x5'));var controller=require('./cmHopperAdditionalPhone.controller');router[_0x0bf3('0x6')]('/',auth[_0x0bf3('0x7')](),controller[_0x0bf3('0x8')]);router[_0x0bf3('0x6')](_0x0bf3('0x9'),auth['isAuthenticated'](),controller[_0x0bf3('0xa')]);router[_0x0bf3('0xb')]('/',auth[_0x0bf3('0x7')](),controller['create']);router['put'](_0x0bf3('0x9'),auth[_0x0bf3('0x7')](),controller['update']);router[_0x0bf3('0xc')](_0x0bf3('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x0bf3('0xd')]=router; \ No newline at end of file +var _0x7f78=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperAdditionalPhone.controller','get','/:id','show','put','update','delete','isAuthenticated','exports','util','path','connect-timeout'];(function(_0x230628,_0x4b01f9){var _0xd221b1=function(_0x3a5610){while(--_0x3a5610){_0x230628['push'](_0x230628['shift']());}};_0xd221b1(++_0x4b01f9);}(_0x7f78,0x140));var _0x87f7=function(_0x4ffd32,_0x168edb){_0x4ffd32=_0x4ffd32-0x0;var _0x1ea59b=_0x7f78[_0x4ffd32];return _0x1ea59b;};'use strict';var multer=require('multer');var util=require(_0x87f7('0x0'));var path=require(_0x87f7('0x1'));var timeout=require(_0x87f7('0x2'));var express=require(_0x87f7('0x3'));var router=express[_0x87f7('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x87f7('0x5'));var interaction=require(_0x87f7('0x6'));var config=require(_0x87f7('0x7'));var controller=require(_0x87f7('0x8'));router[_0x87f7('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x87f7('0x9')](_0x87f7('0xa'),auth['isAuthenticated'](),controller[_0x87f7('0xb')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x87f7('0xc')](_0x87f7('0xa'),auth['isAuthenticated'](),controller[_0x87f7('0xd')]);router[_0x87f7('0xe')](_0x87f7('0xa'),auth[_0x87f7('0xf')](),controller['destroy']);module[_0x87f7('0x10')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index 9e22ad4..604bb0e 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 _0x5d58=['INTEGER','contactListQueue'];(function(_0x3f25ea,_0xebc52){var _0x24c818=function(_0x2e93d9){while(--_0x2e93d9){_0x3f25ea['push'](_0x3f25ea['shift']());}};_0x24c818(++_0xebc52);}(_0x5d58,0x187));var _0x85d5=function(_0x4082b0,_0x5e68dc){_0x4082b0=_0x4082b0-0x0;var _0x336940=_0x5d58[_0x4082b0];return _0x336940;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module['exports']={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0x85d5('0x0')},'ListId':{'type':Sequelize[_0x85d5('0x1')],'unique':'contactListQueue'},'VoiceQueueId':{'type':Sequelize[_0x85d5('0x1')],'unique':_0x85d5('0x0')}}; \ No newline at end of file +var _0x433a=['INTEGER','contactListQueue','moment','sequelize','exports'];(function(_0x35ea99,_0xa39d05){var _0x4f2774=function(_0x9a42b7){while(--_0x9a42b7){_0x35ea99['push'](_0x35ea99['shift']());}};_0x4f2774(++_0xa39d05);}(_0x433a,0x14c));var _0xa433=function(_0x39fe3e,_0x22a8b6){_0x39fe3e=_0x39fe3e-0x0;var _0x1afabc=_0x433a[_0x39fe3e];return _0x1afabc;};'use strict';var moment=require(_0xa433('0x0'));var Sequelize=require(_0xa433('0x1'));module[_0xa433('0x2')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize[_0xa433('0x3')],'unique':_0xa433('0x4')},'ListId':{'type':Sequelize[_0xa433('0x3')],'unique':_0xa433('0x4')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0xa433('0x4')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index 03ca5a4..14d4148 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 _0xea21=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','sendStatus','name','send','index','map','CmHopperBlack','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','then','includeAll','include','findAll','catch','show','params','options','find','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x13b4a1,_0x3949c0){var _0x1bdfec=function(_0xafb07c){while(--_0xafb07c){_0x13b4a1['push'](_0x13b4a1['shift']());}};_0x1bdfec(++_0x3949c0);}(_0xea21,0x80));var _0x1ea2=function(_0x258666,_0x12f391){_0x258666=_0x258666-0x0;var _0x2dfcbe=_0xea21[_0x258666];return _0x2dfcbe;};'use strict';var emlformat=require(_0x1ea2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1ea2('0x1'));var jsonpatch=require(_0x1ea2('0x2'));var rp=require(_0x1ea2('0x3'));var moment=require('moment');var BPromise=require(_0x1ea2('0x4'));var Mustache=require('mustache');var util=require(_0x1ea2('0x5'));var path=require(_0x1ea2('0x6'));var sox=require(_0x1ea2('0x7'));var csv=require(_0x1ea2('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1ea2('0x9'));var _=require(_0x1ea2('0xa'));var squel=require(_0x1ea2('0xb'));var crypto=require(_0x1ea2('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x1ea2('0xd'));var toCsv=require(_0x1ea2('0x8'));var querystring=require('querystring');var Papa=require(_0x1ea2('0xe'));var Redis=require(_0x1ea2('0xf'));var authService=require(_0x1ea2('0x10'));var qs=require(_0x1ea2('0x11'));var as=require(_0x1ea2('0x12'));var hardwareService=require(_0x1ea2('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x1ea2('0x14'));var config=require(_0x1ea2('0x15'));var licenseUtil=require(_0x1ea2('0x16'));var db=require(_0x1ea2('0x17'))['db'];function respondWithStatusCode(_0x303b44,_0x13717f){_0x13717f=_0x13717f||0xcc;return function(_0xf0cf76){if(_0xf0cf76){return _0x303b44['sendStatus'](_0x13717f);}return _0x303b44[_0x1ea2('0x18')](_0x13717f)[_0x1ea2('0x19')]();};}function respondWithResult(_0x328cb8,_0x500e8e){_0x500e8e=_0x500e8e||0xc8;return function(_0x15f9a6){if(_0x15f9a6){return _0x328cb8[_0x1ea2('0x18')](_0x500e8e)[_0x1ea2('0x1a')](_0x15f9a6);}};}function respondWithFilteredResult(_0x390ad1,_0x4d562f){return function(_0x3f2565){if(_0x3f2565){var _0x372dc5=typeof _0x4d562f[_0x1ea2('0x1b')]===_0x1ea2('0x1c')&&typeof _0x4d562f[_0x1ea2('0x1d')]==='undefined';var _0x1d006b=_0x3f2565[_0x1ea2('0x1e')];var _0x1819b2=_0x372dc5?0x0:_0x4d562f['offset'];var _0x2c43cf=_0x372dc5?_0x3f2565[_0x1ea2('0x1e')]:_0x4d562f[_0x1ea2('0x1b')]+_0x4d562f['limit'];var _0x39142c;if(_0x2c43cf>=_0x1d006b){_0x2c43cf=_0x1d006b;_0x39142c=0xc8;}else{_0x39142c=0xce;}_0x390ad1[_0x1ea2('0x18')](_0x39142c);return _0x390ad1[_0x1ea2('0x1f')](_0x1ea2('0x20'),_0x1819b2+'-'+_0x2c43cf+'/'+_0x1d006b)[_0x1ea2('0x1a')](_0x3f2565);}return null;};}function patchUpdates(_0x5c1329){return function(_0x3da475){try{jsonpatch[_0x1ea2('0x21')](_0x3da475,_0x5c1329,!![]);}catch(_0x176680){return BPromise[_0x1ea2('0x22')](_0x176680);}return _0x3da475[_0x1ea2('0x23')]();};}function saveUpdates(_0x35a87f,_0x1b1420){return function(_0x3c4c95){if(_0x3c4c95){return _0x3c4c95[_0x1ea2('0x24')](_0x35a87f)['then'](function(_0x70fda3){return _0x70fda3;});}return null;};}function removeEntity(_0xb53107,_0x44eb8f){return function(_0x2c6d78){if(_0x2c6d78){return _0x2c6d78['destroy']()['then'](function(){_0xb53107[_0x1ea2('0x18')](0xcc)[_0x1ea2('0x19')]();});}};}function handleEntityNotFound(_0x5a539b,_0xe1a042){return function(_0xb9cfec){if(!_0xb9cfec){_0x5a539b[_0x1ea2('0x25')](0x194);}return _0xb9cfec;};}function handleError(_0x232d0e,_0x31b7a7){_0x31b7a7=_0x31b7a7||0x1f4;return function(_0xfd52b2){logger['error'](_0xfd52b2['stack']);if(_0xfd52b2[_0x1ea2('0x26')]){delete _0xfd52b2[_0x1ea2('0x26')];}_0x232d0e[_0x1ea2('0x18')](_0x31b7a7)[_0x1ea2('0x27')](_0xfd52b2);};}exports[_0x1ea2('0x28')]=function(_0x288b26,_0x53e48c){var _0x127d65={},_0x492466={},_0x3beeb3={'count':0x0,'rows':[]};var _0x1f3c4d=_[_0x1ea2('0x29')](db[_0x1ea2('0x2a')][_0x1ea2('0x2b')],function(_0x2b17ce){return{'name':_0x2b17ce[_0x1ea2('0x2c')],'type':_0x2b17ce[_0x1ea2('0x2d')]['key']};});_0x492466['model']=_['map'](_0x1f3c4d,_0x1ea2('0x26'));_0x492466[_0x1ea2('0x2e')]=_[_0x1ea2('0x2f')](_0x288b26['query']);_0x492466[_0x1ea2('0x30')]=_[_0x1ea2('0x31')](_0x492466[_0x1ea2('0x32')],_0x492466[_0x1ea2('0x2e')]);_0x127d65[_0x1ea2('0x33')]=_[_0x1ea2('0x31')](_0x492466[_0x1ea2('0x32')],qs['fields'](_0x288b26[_0x1ea2('0x2e')][_0x1ea2('0x34')]));_0x127d65['attributes']=_0x127d65[_0x1ea2('0x33')][_0x1ea2('0x35')]?_0x127d65[_0x1ea2('0x33')]:_0x492466[_0x1ea2('0x32')];if(!_0x288b26[_0x1ea2('0x2e')]['hasOwnProperty'](_0x1ea2('0x36'))){_0x127d65['limit']=qs[_0x1ea2('0x1d')](_0x288b26[_0x1ea2('0x2e')][_0x1ea2('0x1d')]);_0x127d65[_0x1ea2('0x1b')]=qs[_0x1ea2('0x1b')](_0x288b26[_0x1ea2('0x2e')][_0x1ea2('0x1b')]);}_0x127d65[_0x1ea2('0x37')]=qs[_0x1ea2('0x38')](_0x288b26[_0x1ea2('0x2e')][_0x1ea2('0x38')]);_0x127d65[_0x1ea2('0x39')]=qs[_0x1ea2('0x30')](_[_0x1ea2('0x3a')](_0x288b26[_0x1ea2('0x2e')],_0x492466['filters']),_0x1f3c4d);if(_0x288b26['query'][_0x1ea2('0x3b')]){_0x127d65[_0x1ea2('0x39')]=_[_0x1ea2('0x3c')](_0x127d65[_0x1ea2('0x39')],{'$or':_['map'](_0x1f3c4d,function(_0x13f12f){if(_0x13f12f[_0x1ea2('0x2d')]!==_0x1ea2('0x3d')){var _0x4cf0c8={};_0x4cf0c8[_0x13f12f[_0x1ea2('0x26')]]={'$like':'%'+_0x288b26[_0x1ea2('0x2e')][_0x1ea2('0x3b')]+'%'};return _0x4cf0c8;}})});}_0x127d65=_[_0x1ea2('0x3c')]({},_0x127d65,_0x288b26['options']);var _0x49b95b={'where':_0x127d65['where']};return db[_0x1ea2('0x2a')][_0x1ea2('0x1e')](_0x49b95b)[_0x1ea2('0x3e')](function(_0x24294b){_0x3beeb3[_0x1ea2('0x1e')]=_0x24294b;if(_0x288b26[_0x1ea2('0x2e')][_0x1ea2('0x3f')]){_0x127d65[_0x1ea2('0x40')]=[{'all':!![]}];}return db[_0x1ea2('0x2a')][_0x1ea2('0x41')](_0x127d65);})['then'](function(_0x1d3d17){_0x3beeb3['rows']=_0x1d3d17;return _0x3beeb3;})[_0x1ea2('0x3e')](respondWithFilteredResult(_0x53e48c,_0x127d65))[_0x1ea2('0x42')](handleError(_0x53e48c,null));};exports[_0x1ea2('0x43')]=function(_0x1e85b6,_0x4029d5){var _0x2fe32a={'raw':!![],'where':{'id':_0x1e85b6[_0x1ea2('0x44')]['id']}},_0x4c3ae7={};_0x4c3ae7['model']=_[_0x1ea2('0x2f')](db[_0x1ea2('0x2a')][_0x1ea2('0x2b')]);_0x4c3ae7['query']=_['keys'](_0x1e85b6[_0x1ea2('0x2e')]);_0x4c3ae7[_0x1ea2('0x30')]=_[_0x1ea2('0x31')](_0x4c3ae7[_0x1ea2('0x32')],_0x4c3ae7['query']);_0x2fe32a['attributes']=_['intersection'](_0x4c3ae7[_0x1ea2('0x32')],qs['fields'](_0x1e85b6[_0x1ea2('0x2e')][_0x1ea2('0x34')]));_0x2fe32a[_0x1ea2('0x33')]=_0x2fe32a['attributes']['length']?_0x2fe32a[_0x1ea2('0x33')]:_0x4c3ae7['model'];if(_0x1e85b6['query'][_0x1ea2('0x3f')]){_0x2fe32a[_0x1ea2('0x40')]=[{'all':!![]}];}_0x2fe32a=_[_0x1ea2('0x3c')]({},_0x2fe32a,_0x1e85b6[_0x1ea2('0x45')]);return db[_0x1ea2('0x2a')][_0x1ea2('0x46')](_0x2fe32a)['then'](handleEntityNotFound(_0x4029d5,null))['then'](respondWithResult(_0x4029d5,null))['catch'](handleError(_0x4029d5,null));};exports['update']=function(_0x518eab,_0x458e47){if(_0x518eab['body']['id']){delete _0x518eab[_0x1ea2('0x47')]['id'];}return db[_0x1ea2('0x2a')][_0x1ea2('0x46')]({'where':{'id':_0x518eab[_0x1ea2('0x44')]['id']}})[_0x1ea2('0x3e')](handleEntityNotFound(_0x458e47,null))[_0x1ea2('0x3e')](saveUpdates(_0x518eab['body'],null))[_0x1ea2('0x3e')](respondWithResult(_0x458e47,null))[_0x1ea2('0x42')](handleError(_0x458e47,null));};exports['destroy']=function(_0x2876cb,_0x18dc66){return db[_0x1ea2('0x2a')][_0x1ea2('0x46')]({'where':{'id':_0x2876cb[_0x1ea2('0x44')]['id']}})['then'](handleEntityNotFound(_0x18dc66,null))['then'](removeEntity(_0x18dc66,null))[_0x1ea2('0x42')](handleError(_0x18dc66,null));};exports[_0x1ea2('0x48')]=function(_0x15dff1,_0x438c66){return db['CmHopperBlack']['describe']()['then'](respondWithResult(_0x438c66,null))[_0x1ea2('0x42')](handleError(_0x438c66,null));}; \ No newline at end of file +var _0xc762=['bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','destroy','then','stack','name','send','map','CmHopperBlack','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','includeAll','include','rows','show','keys','length','options','find','catch','update','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x2d0e93,_0x37e9cd){var _0x4f8920=function(_0x3fd6cb){while(--_0x3fd6cb){_0x2d0e93['push'](_0x2d0e93['shift']());}};_0x4f8920(++_0x37e9cd);}(_0xc762,0x92));var _0x2c76=function(_0x3ae8f4,_0x2920f4){_0x3ae8f4=_0x3ae8f4-0x0;var _0x367312=_0xc762[_0x3ae8f4];return _0x367312;};'use strict';var emlformat=require(_0x2c76('0x0'));var rimraf=require(_0x2c76('0x1'));var zipdir=require(_0x2c76('0x2'));var jsonpatch=require(_0x2c76('0x3'));var rp=require(_0x2c76('0x4'));var moment=require(_0x2c76('0x5'));var BPromise=require(_0x2c76('0x6'));var Mustache=require(_0x2c76('0x7'));var util=require(_0x2c76('0x8'));var path=require(_0x2c76('0x9'));var sox=require(_0x2c76('0xa'));var csv=require(_0x2c76('0xb'));var ejs=require(_0x2c76('0xc'));var fs=require('fs');var fs_extra=require(_0x2c76('0xd'));var _=require(_0x2c76('0xe'));var squel=require(_0x2c76('0xf'));var crypto=require('crypto');var jsforce=require(_0x2c76('0x10'));var deskjs=require(_0x2c76('0x11'));var toCsv=require(_0x2c76('0xb'));var querystring=require('querystring');var Papa=require(_0x2c76('0x12'));var Redis=require(_0x2c76('0x13'));var authService=require(_0x2c76('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2c76('0x15'));var logger=require('../../config/logger')(_0x2c76('0x16'));var utils=require(_0x2c76('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x2c76('0x18'))['db'];function respondWithStatusCode(_0x4e49e8,_0x23428d){_0x23428d=_0x23428d||0xcc;return function(_0x5b97b1){if(_0x5b97b1){return _0x4e49e8[_0x2c76('0x19')](_0x23428d);}return _0x4e49e8['status'](_0x23428d)[_0x2c76('0x1a')]();};}function respondWithResult(_0x3664aa,_0x7e730d){_0x7e730d=_0x7e730d||0xc8;return function(_0x1093d4){if(_0x1093d4){return _0x3664aa[_0x2c76('0x1b')](_0x7e730d)[_0x2c76('0x1c')](_0x1093d4);}};}function respondWithFilteredResult(_0x54ec6b,_0x57c8f4){return function(_0x10c65b){if(_0x10c65b){var _0x10078e=typeof _0x57c8f4['offset']===_0x2c76('0x1d')&&typeof _0x57c8f4[_0x2c76('0x1e')]===_0x2c76('0x1d');var _0x37162f=_0x10c65b[_0x2c76('0x1f')];var _0x57461c=_0x10078e?0x0:_0x57c8f4[_0x2c76('0x20')];var _0x176b45=_0x10078e?_0x10c65b['count']:_0x57c8f4['offset']+_0x57c8f4[_0x2c76('0x1e')];var _0x20bf15;if(_0x176b45>=_0x37162f){_0x176b45=_0x37162f;_0x20bf15=0xc8;}else{_0x20bf15=0xce;}_0x54ec6b[_0x2c76('0x1b')](_0x20bf15);return _0x54ec6b[_0x2c76('0x21')](_0x2c76('0x22'),_0x57461c+'-'+_0x176b45+'/'+_0x37162f)[_0x2c76('0x1c')](_0x10c65b);}return null;};}function patchUpdates(_0x45c5f5){return function(_0x1638d3){try{jsonpatch[_0x2c76('0x23')](_0x1638d3,_0x45c5f5,!![]);}catch(_0x26f6ae){return BPromise[_0x2c76('0x24')](_0x26f6ae);}return _0x1638d3[_0x2c76('0x25')]();};}function saveUpdates(_0x46b324,_0x5f24bc){return function(_0x2d2a71){if(_0x2d2a71){return _0x2d2a71['update'](_0x46b324)['then'](function(_0x497cc6){return _0x497cc6;});}return null;};}function removeEntity(_0xed1e6c,_0x22abba){return function(_0x5c794f){if(_0x5c794f){return _0x5c794f[_0x2c76('0x26')]()[_0x2c76('0x27')](function(){_0xed1e6c[_0x2c76('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x21f73b,_0x701b34){return function(_0x23b9ee){if(!_0x23b9ee){_0x21f73b[_0x2c76('0x19')](0x194);}return _0x23b9ee;};}function handleError(_0x446bf9,_0x3ef034){_0x3ef034=_0x3ef034||0x1f4;return function(_0x3cd841){logger['error'](_0x3cd841[_0x2c76('0x28')]);if(_0x3cd841[_0x2c76('0x29')]){delete _0x3cd841[_0x2c76('0x29')];}_0x446bf9[_0x2c76('0x1b')](_0x3ef034)[_0x2c76('0x2a')](_0x3cd841);};}exports['index']=function(_0x38f967,_0x92dee0){var _0x28402f={},_0x48a03={},_0x2e6999={'count':0x0,'rows':[]};var _0x5a1c91=_[_0x2c76('0x2b')](db[_0x2c76('0x2c')][_0x2c76('0x2d')],function(_0x480c62){return{'name':_0x480c62[_0x2c76('0x2e')],'type':_0x480c62[_0x2c76('0x2f')][_0x2c76('0x30')]};});_0x48a03[_0x2c76('0x31')]=_[_0x2c76('0x2b')](_0x5a1c91,_0x2c76('0x29'));_0x48a03['query']=_['keys'](_0x38f967[_0x2c76('0x32')]);_0x48a03[_0x2c76('0x33')]=_[_0x2c76('0x34')](_0x48a03[_0x2c76('0x31')],_0x48a03[_0x2c76('0x32')]);_0x28402f[_0x2c76('0x35')]=_['intersection'](_0x48a03[_0x2c76('0x31')],qs[_0x2c76('0x36')](_0x38f967[_0x2c76('0x32')][_0x2c76('0x36')]));_0x28402f['attributes']=_0x28402f['attributes']['length']?_0x28402f[_0x2c76('0x35')]:_0x48a03['model'];if(!_0x38f967[_0x2c76('0x32')][_0x2c76('0x37')](_0x2c76('0x38'))){_0x28402f[_0x2c76('0x1e')]=qs[_0x2c76('0x1e')](_0x38f967[_0x2c76('0x32')]['limit']);_0x28402f[_0x2c76('0x20')]=qs[_0x2c76('0x20')](_0x38f967[_0x2c76('0x32')][_0x2c76('0x20')]);}_0x28402f[_0x2c76('0x39')]=qs[_0x2c76('0x3a')](_0x38f967[_0x2c76('0x32')][_0x2c76('0x3a')]);_0x28402f['where']=qs[_0x2c76('0x33')](_[_0x2c76('0x3b')](_0x38f967['query'],_0x48a03[_0x2c76('0x33')]),_0x5a1c91);if(_0x38f967[_0x2c76('0x32')][_0x2c76('0x3c')]){_0x28402f['where']=_['merge'](_0x28402f[_0x2c76('0x3d')],{'$or':_[_0x2c76('0x2b')](_0x5a1c91,function(_0x4cc7bc){if(_0x4cc7bc[_0x2c76('0x2f')]!=='VIRTUAL'){var _0x57ce22={};_0x57ce22[_0x4cc7bc[_0x2c76('0x29')]]={'$like':'%'+_0x38f967[_0x2c76('0x32')][_0x2c76('0x3c')]+'%'};return _0x57ce22;}})});}_0x28402f=_[_0x2c76('0x3e')]({},_0x28402f,_0x38f967['options']);var _0x5d4e70={'where':_0x28402f[_0x2c76('0x3d')]};return db[_0x2c76('0x2c')][_0x2c76('0x1f')](_0x5d4e70)[_0x2c76('0x27')](function(_0x490027){_0x2e6999[_0x2c76('0x1f')]=_0x490027;if(_0x38f967[_0x2c76('0x32')][_0x2c76('0x3f')]){_0x28402f[_0x2c76('0x40')]=[{'all':!![]}];}return db[_0x2c76('0x2c')]['findAll'](_0x28402f);})['then'](function(_0x5c105c){_0x2e6999[_0x2c76('0x41')]=_0x5c105c;return _0x2e6999;})[_0x2c76('0x27')](respondWithFilteredResult(_0x92dee0,_0x28402f))['catch'](handleError(_0x92dee0,null));};exports[_0x2c76('0x42')]=function(_0x558d04,_0x57714f){var _0x170843={'raw':!![],'where':{'id':_0x558d04['params']['id']}},_0x1eb94b={};_0x1eb94b[_0x2c76('0x31')]=_[_0x2c76('0x43')](db[_0x2c76('0x2c')][_0x2c76('0x2d')]);_0x1eb94b[_0x2c76('0x32')]=_['keys'](_0x558d04['query']);_0x1eb94b[_0x2c76('0x33')]=_[_0x2c76('0x34')](_0x1eb94b['model'],_0x1eb94b[_0x2c76('0x32')]);_0x170843[_0x2c76('0x35')]=_[_0x2c76('0x34')](_0x1eb94b[_0x2c76('0x31')],qs['fields'](_0x558d04[_0x2c76('0x32')][_0x2c76('0x36')]));_0x170843['attributes']=_0x170843['attributes'][_0x2c76('0x44')]?_0x170843[_0x2c76('0x35')]:_0x1eb94b['model'];if(_0x558d04[_0x2c76('0x32')]['includeAll']){_0x170843['include']=[{'all':!![]}];}_0x170843=_[_0x2c76('0x3e')]({},_0x170843,_0x558d04[_0x2c76('0x45')]);return db['CmHopperBlack'][_0x2c76('0x46')](_0x170843)['then'](handleEntityNotFound(_0x57714f,null))['then'](respondWithResult(_0x57714f,null))[_0x2c76('0x47')](handleError(_0x57714f,null));};exports[_0x2c76('0x48')]=function(_0x54549a,_0x527804){if(_0x54549a[_0x2c76('0x49')]['id']){delete _0x54549a[_0x2c76('0x49')]['id'];}return db[_0x2c76('0x2c')][_0x2c76('0x46')]({'where':{'id':_0x54549a[_0x2c76('0x4a')]['id']}})[_0x2c76('0x27')](handleEntityNotFound(_0x527804,null))[_0x2c76('0x27')](saveUpdates(_0x54549a[_0x2c76('0x49')],null))[_0x2c76('0x27')](respondWithResult(_0x527804,null))[_0x2c76('0x47')](handleError(_0x527804,null));};exports[_0x2c76('0x26')]=function(_0x43a21b,_0x2c9d30){return db['CmHopperBlack'][_0x2c76('0x46')]({'where':{'id':_0x43a21b[_0x2c76('0x4a')]['id']}})[_0x2c76('0x27')](handleEntityNotFound(_0x2c9d30,null))['then'](removeEntity(_0x2c9d30,null))[_0x2c76('0x47')](handleError(_0x2c9d30,null));};exports[_0x2c76('0x4b')]=function(_0x3f763c,_0x2bcbad){return db[_0x2c76('0x2c')][_0x2c76('0x4b')]()[_0x2c76('0x27')](respondWithResult(_0x2bcbad,null))['catch'](handleError(_0x2bcbad,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 5b37bf9..479575c 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 _0xbbf3=['define','util','../../config/logger','api','bluebird','request-promise','rimraf','./cmHopperBlack.attributes','exports'];(function(_0xa0bcf6,_0x432653){var _0x4a997a=function(_0x1d469f){while(--_0x1d469f){_0xa0bcf6['push'](_0xa0bcf6['shift']());}};_0x4a997a(++_0x432653);}(_0xbbf3,0xf4));var _0x3bbf=function(_0x36a20a,_0x3897a5){_0x36a20a=_0x36a20a-0x0;var _0x1284ba=_0xbbf3[_0x36a20a];return _0x1284ba;};'use strict';var _=require('lodash');var util=require(_0x3bbf('0x0'));var logger=require(_0x3bbf('0x1'))(_0x3bbf('0x2'));var moment=require('moment');var BPromise=require(_0x3bbf('0x3'));var rp=require(_0x3bbf('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3bbf('0x5'));var config=require('../../config/environment');var attributes=require(_0x3bbf('0x6'));module[_0x3bbf('0x7')]=function(_0x14be17,_0x4bebb5){return _0x14be17[_0x3bbf('0x8')]('CmHopperBlack',attributes,{'tableName':'cm_hopper_black','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0ad5=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./cmHopperBlack.attributes','define','CmHopperBlack','lodash'];(function(_0x4ce16c,_0x157280){var _0x49e5dd=function(_0x18018c){while(--_0x18018c){_0x4ce16c['push'](_0x4ce16c['shift']());}};_0x49e5dd(++_0x157280);}(_0x0ad5,0x11f));var _0x50ad=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x0ad5[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0x50ad('0x0'));var util=require(_0x50ad('0x1'));var logger=require(_0x50ad('0x2'))(_0x50ad('0x3'));var moment=require(_0x50ad('0x4'));var BPromise=require(_0x50ad('0x5'));var rp=require(_0x50ad('0x6'));var fs=require('fs');var path=require(_0x50ad('0x7'));var rimraf=require(_0x50ad('0x8'));var config=require('../../config/environment');var attributes=require(_0x50ad('0x9'));module['exports']=function(_0x206cc8,_0x1aacb5){return _0x206cc8[_0x50ad('0xa')](_0x50ad('0xb'),attributes,{'tableName':'cm_hopper_black','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.rpc.js b/server/api/cmHopperBlack/cmHopperBlack.rpc.js index cce2c01..2ea6ad3 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 _0x71ad=['update','body','destroy','DestroyCmHopperBlack','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','where','attributes','limit','include','map','model','debug','UpdateCmHopperBlack'];(function(_0x38ba44,_0x363148){var _0x4cb7b9=function(_0x42d123){while(--_0x42d123){_0x38ba44['push'](_0x38ba44['shift']());}};_0x4cb7b9(++_0x363148);}(_0x71ad,0x1f2));var _0xd71a=function(_0x28d1b6,_0x57e881){_0x28d1b6=_0x28d1b6-0x0;var _0x3f6f01=_0x71ad[_0x28d1b6];return _0x3f6f01;};'use strict';var _=require(_0xd71a('0x0'));var util=require(_0xd71a('0x1'));var moment=require('moment');var BPromise=require(_0xd71a('0x2'));var rs=require(_0xd71a('0x3'));var fs=require('fs');var Redis=require(_0xd71a('0x4'));var db=require(_0xd71a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd71a('0x6'))(_0xd71a('0x7'));var config=require(_0xd71a('0x8'));var jayson=require(_0xd71a('0x9'));var client=jayson[_0xd71a('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3d9432,_0x4922f3,_0x3b9361){return new BPromise(function(_0x54fe1f,_0x42affc){return client[_0xd71a('0xb')](_0x3d9432,_0x3b9361)[_0xd71a('0xc')](function(_0x5af51b){logger[_0xd71a('0xd')](_0xd71a('0xe'),_0x4922f3,_0xd71a('0xf'));logger['debug']('CmHopperBlack,\x20%s,\x20%s,\x20%s',_0x4922f3,_0xd71a('0xf'),JSON[_0xd71a('0x10')](_0x5af51b));if(_0x5af51b[_0xd71a('0x11')]){if(_0x5af51b[_0xd71a('0x11')][_0xd71a('0x12')]===0x1f4){logger[_0xd71a('0x11')](_0xd71a('0xe'),_0x4922f3,_0x5af51b[_0xd71a('0x11')][_0xd71a('0x13')]);return _0x42affc(_0x5af51b[_0xd71a('0x11')][_0xd71a('0x13')]);}logger[_0xd71a('0x11')](_0xd71a('0xe'),_0x4922f3,_0x5af51b[_0xd71a('0x11')][_0xd71a('0x13')]);return _0x54fe1f(_0x5af51b[_0xd71a('0x11')][_0xd71a('0x13')]);}else{logger['info'](_0xd71a('0xe'),_0x4922f3,_0xd71a('0xf'));_0x54fe1f(_0x5af51b['result'][_0xd71a('0x13')]);}})[_0xd71a('0x14')](function(_0x203a01){logger[_0xd71a('0x11')]('CmHopperBlack,\x20%s,\x20%s',_0x4922f3,_0x203a01);_0x42affc(_0x203a01);});});}exports[_0xd71a('0x15')]=function(_0x487551){var _0x1fcc78=this;return new Promise(function(_0x1d6084,_0x103929){return db[_0xd71a('0x16')][_0xd71a('0x17')]({'raw':_0x487551['options']?_0x487551[_0xd71a('0x18')][_0xd71a('0x19')]===undefined?!![]:![]:!![],'where':_0x487551['options']?_0x487551[_0xd71a('0x18')][_0xd71a('0x1a')]||null:null,'attributes':_0x487551['options']?_0x487551[_0xd71a('0x18')][_0xd71a('0x1b')]||null:null,'limit':_0x487551[_0xd71a('0x18')]?_0x487551[_0xd71a('0x18')][_0xd71a('0x1c')]||null:null,'include':_0x487551[_0xd71a('0x18')]?_0x487551[_0xd71a('0x18')][_0xd71a('0x1d')]?_[_0xd71a('0x1e')](_0x487551[_0xd71a('0x18')][_0xd71a('0x1d')],function(_0x4c9ee7){return{'model':db[_0x4c9ee7[_0xd71a('0x1f')]],'as':_0x4c9ee7['as'],'attributes':_0x4c9ee7[_0xd71a('0x1b')],'include':_0x4c9ee7[_0xd71a('0x1d')]?_[_0xd71a('0x1e')](_0x4c9ee7['include'],function(_0x2b9ae3){return{'model':db[_0x2b9ae3[_0xd71a('0x1f')]],'as':_0x2b9ae3['as'],'attributes':_0x2b9ae3[_0xd71a('0x1b')],'include':_0x2b9ae3[_0xd71a('0x1d')]?_['map'](_0x2b9ae3[_0xd71a('0x1d')],function(_0x306334){return{'model':db[_0x306334[_0xd71a('0x1f')]],'as':_0x306334['as'],'attributes':_0x306334['attributes']};}):[]};}):[]};}):[]:[]})[_0xd71a('0xc')](function(_0x1caa9d){logger['info'](_0xd71a('0x15'),_0x487551);logger[_0xd71a('0x20')](_0xd71a('0x15'),_0x487551,JSON['stringify'](_0x1caa9d));_0x1d6084(_0x1caa9d);})[_0xd71a('0x14')](function(_0x33e1c9){logger[_0xd71a('0x11')](_0xd71a('0x15'),_0x33e1c9[_0xd71a('0x13')],_0x487551);_0x103929(_0x1fcc78['error'](0x1f4,_0x33e1c9[_0xd71a('0x13')]));});});};exports[_0xd71a('0x21')]=function(_0x520ee2){var _0x26e726=this;return new Promise(function(_0x29b226,_0x2c41b8){return db[_0xd71a('0x16')][_0xd71a('0x22')](_0x520ee2[_0xd71a('0x23')],{'raw':_0x520ee2[_0xd71a('0x18')]?_0x520ee2[_0xd71a('0x18')][_0xd71a('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x520ee2[_0xd71a('0x18')]?_0x520ee2[_0xd71a('0x18')][_0xd71a('0x1a')]||null:null,'attributes':_0x520ee2['options']?_0x520ee2[_0xd71a('0x18')][_0xd71a('0x1b')]||null:null,'limit':_0x520ee2[_0xd71a('0x18')]?_0x520ee2[_0xd71a('0x18')][_0xd71a('0x1c')]||null:null})[_0xd71a('0xc')](function(_0x12f348){logger[_0xd71a('0xd')](_0xd71a('0x21'),_0x520ee2);logger[_0xd71a('0x20')](_0xd71a('0x21'),_0x520ee2,JSON[_0xd71a('0x10')](_0x12f348));_0x29b226(_0x12f348);})['catch'](function(_0x181e77){logger[_0xd71a('0x11')](_0xd71a('0x21'),_0x181e77[_0xd71a('0x13')],_0x520ee2);_0x2c41b8(_0x26e726[_0xd71a('0x11')](0x1f4,_0x181e77['message']));});});};exports['DestroyCmHopperBlack']=function(_0x2cb04b){var _0x14cb9c=this;return new Promise(function(_0x3e749d,_0x3e29dc){return db[_0xd71a('0x16')][_0xd71a('0x24')]({'where':_0x2cb04b[_0xd71a('0x18')]?_0x2cb04b['options']['where']||null:null})[_0xd71a('0xc')](function(_0xa8c5cf){logger['info']('DestroyCmHopperBlack',_0x2cb04b);logger['debug'](_0xd71a('0x25'),_0x2cb04b,JSON[_0xd71a('0x10')](_0xa8c5cf));_0x3e749d(_0xa8c5cf);})[_0xd71a('0x14')](function(_0x157093){logger['error'](_0xd71a('0x25'),_0x157093[_0xd71a('0x13')],_0x2cb04b);_0x3e29dc(_0x14cb9c[_0xd71a('0x11')](0x1f4,_0x157093[_0xd71a('0x13')]));});});}; \ No newline at end of file +var _0x3cde=['where','attributes','limit','include','map','model','UpdateCmHopperBlack','update','body','DestroyCmHopperBlack','CmHopperBlack','lodash','util','bluebird','ioredis','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','CmHopperBlack,\x20%s,\x20%s','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','GetCmHopperBlack','findAll','options','raw'];(function(_0x485f35,_0x45a0fc){var _0x2ad118=function(_0x296650){while(--_0x296650){_0x485f35['push'](_0x485f35['shift']());}};_0x2ad118(++_0x45a0fc);}(_0x3cde,0x9b));var _0xe3cd=function(_0x12476d,_0x461753){_0x12476d=_0x12476d-0x0;var _0x2651a0=_0x3cde[_0x12476d];return _0x2651a0;};'use strict';var _=require(_0xe3cd('0x0'));var util=require(_0xe3cd('0x1'));var moment=require('moment');var BPromise=require(_0xe3cd('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe3cd('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe3cd('0x4'))('rpc');var config=require(_0xe3cd('0x5'));var jayson=require(_0xe3cd('0x6'));var client=jayson[_0xe3cd('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2281a3,_0x2778b8,_0x5ed730){return new BPromise(function(_0x3edba1,_0x2a6224){return client[_0xe3cd('0x8')](_0x2281a3,_0x5ed730)[_0xe3cd('0x9')](function(_0x4579d7){logger[_0xe3cd('0xa')](_0xe3cd('0xb'),_0x2778b8,'request\x20sent');logger[_0xe3cd('0xc')](_0xe3cd('0xd'),_0x2778b8,'request\x20sent',JSON[_0xe3cd('0xe')](_0x4579d7));if(_0x4579d7[_0xe3cd('0xf')]){if(_0x4579d7['error'][_0xe3cd('0x10')]===0x1f4){logger[_0xe3cd('0xf')](_0xe3cd('0xb'),_0x2778b8,_0x4579d7[_0xe3cd('0xf')][_0xe3cd('0x11')]);return _0x2a6224(_0x4579d7[_0xe3cd('0xf')][_0xe3cd('0x11')]);}logger[_0xe3cd('0xf')](_0xe3cd('0xb'),_0x2778b8,_0x4579d7[_0xe3cd('0xf')][_0xe3cd('0x11')]);return _0x3edba1(_0x4579d7[_0xe3cd('0xf')]['message']);}else{logger[_0xe3cd('0xa')](_0xe3cd('0xb'),_0x2778b8,_0xe3cd('0x12'));_0x3edba1(_0x4579d7[_0xe3cd('0x13')][_0xe3cd('0x11')]);}})[_0xe3cd('0x14')](function(_0x150213){logger[_0xe3cd('0xf')](_0xe3cd('0xb'),_0x2778b8,_0x150213);_0x2a6224(_0x150213);});});}exports[_0xe3cd('0x15')]=function(_0x17611d){var _0x4bc899=this;return new Promise(function(_0x34a50d,_0x520e93){return db['CmHopperBlack'][_0xe3cd('0x16')]({'raw':_0x17611d[_0xe3cd('0x17')]?_0x17611d['options'][_0xe3cd('0x18')]===undefined?!![]:![]:!![],'where':_0x17611d['options']?_0x17611d[_0xe3cd('0x17')][_0xe3cd('0x19')]||null:null,'attributes':_0x17611d[_0xe3cd('0x17')]?_0x17611d[_0xe3cd('0x17')][_0xe3cd('0x1a')]||null:null,'limit':_0x17611d[_0xe3cd('0x17')]?_0x17611d[_0xe3cd('0x17')][_0xe3cd('0x1b')]||null:null,'include':_0x17611d[_0xe3cd('0x17')]?_0x17611d[_0xe3cd('0x17')][_0xe3cd('0x1c')]?_[_0xe3cd('0x1d')](_0x17611d[_0xe3cd('0x17')][_0xe3cd('0x1c')],function(_0xc32692){return{'model':db[_0xc32692[_0xe3cd('0x1e')]],'as':_0xc32692['as'],'attributes':_0xc32692['attributes'],'include':_0xc32692['include']?_[_0xe3cd('0x1d')](_0xc32692['include'],function(_0x38cf4f){return{'model':db[_0x38cf4f[_0xe3cd('0x1e')]],'as':_0x38cf4f['as'],'attributes':_0x38cf4f[_0xe3cd('0x1a')],'include':_0x38cf4f[_0xe3cd('0x1c')]?_[_0xe3cd('0x1d')](_0x38cf4f[_0xe3cd('0x1c')],function(_0x474102){return{'model':db[_0x474102[_0xe3cd('0x1e')]],'as':_0x474102['as'],'attributes':_0x474102[_0xe3cd('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4f7587){logger[_0xe3cd('0xa')](_0xe3cd('0x15'),_0x17611d);logger[_0xe3cd('0xc')](_0xe3cd('0x15'),_0x17611d,JSON[_0xe3cd('0xe')](_0x4f7587));_0x34a50d(_0x4f7587);})[_0xe3cd('0x14')](function(_0x40a33b){logger[_0xe3cd('0xf')]('GetCmHopperBlack',_0x40a33b['message'],_0x17611d);_0x520e93(_0x4bc899['error'](0x1f4,_0x40a33b['message']));});});};exports[_0xe3cd('0x1f')]=function(_0x3ab346){var _0x50b669=this;return new Promise(function(_0x9aeeb1,_0x426740){return db['CmHopperBlack'][_0xe3cd('0x20')](_0x3ab346[_0xe3cd('0x21')],{'raw':_0x3ab346[_0xe3cd('0x17')]?_0x3ab346[_0xe3cd('0x17')][_0xe3cd('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3ab346['options']?_0x3ab346[_0xe3cd('0x17')][_0xe3cd('0x19')]||null:null,'attributes':_0x3ab346[_0xe3cd('0x17')]?_0x3ab346['options'][_0xe3cd('0x1a')]||null:null,'limit':_0x3ab346['options']?_0x3ab346['options'][_0xe3cd('0x1b')]||null:null})[_0xe3cd('0x9')](function(_0x311c04){logger[_0xe3cd('0xa')](_0xe3cd('0x1f'),_0x3ab346);logger[_0xe3cd('0xc')]('UpdateCmHopperBlack',_0x3ab346,JSON[_0xe3cd('0xe')](_0x311c04));_0x9aeeb1(_0x311c04);})[_0xe3cd('0x14')](function(_0x496932){logger[_0xe3cd('0xf')](_0xe3cd('0x1f'),_0x496932[_0xe3cd('0x11')],_0x3ab346);_0x426740(_0x50b669['error'](0x1f4,_0x496932[_0xe3cd('0x11')]));});});};exports[_0xe3cd('0x22')]=function(_0x1c2ad6){var _0x1348c0=this;return new Promise(function(_0x578208,_0x33c855){return db[_0xe3cd('0x23')]['destroy']({'where':_0x1c2ad6[_0xe3cd('0x17')]?_0x1c2ad6[_0xe3cd('0x17')][_0xe3cd('0x19')]||null:null})[_0xe3cd('0x9')](function(_0x3b9e69){logger[_0xe3cd('0xa')](_0xe3cd('0x22'),_0x1c2ad6);logger['debug'](_0xe3cd('0x22'),_0x1c2ad6,JSON[_0xe3cd('0xe')](_0x3b9e69));_0x578208(_0x3b9e69);})[_0xe3cd('0x14')](function(_0x2a2e78){logger[_0xe3cd('0xf')](_0xe3cd('0x22'),_0x2a2e78[_0xe3cd('0x11')],_0x1c2ad6);_0x33c855(_0x1348c0[_0xe3cd('0xf')](0x1f4,_0x2a2e78[_0xe3cd('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index fd8e1b5..179edc0 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 _0xba34=['./cmHopperBlack.controller','get','isAuthenticated','index','describe','/:id','show','put','update','delete','destroy','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment'];(function(_0x1cd367,_0x31bcef){var _0x47fb13=function(_0x4f0e29){while(--_0x4f0e29){_0x1cd367['push'](_0x1cd367['shift']());}};_0x47fb13(++_0x31bcef);}(_0xba34,0x119));var _0x4ba3=function(_0x4b8855,_0x4701c0){_0x4b8855=_0x4b8855-0x0;var _0x1921d4=_0xba34[_0x4b8855];return _0x1921d4;};'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 fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x4ba3('0x5'));var config=require(_0x4ba3('0x6'));var controller=require(_0x4ba3('0x7'));router[_0x4ba3('0x8')]('/',auth[_0x4ba3('0x9')](),controller[_0x4ba3('0xa')]);router[_0x4ba3('0x8')]('/describe',auth[_0x4ba3('0x9')](),controller[_0x4ba3('0xb')]);router[_0x4ba3('0x8')](_0x4ba3('0xc'),auth[_0x4ba3('0x9')](),controller[_0x4ba3('0xd')]);router[_0x4ba3('0xe')](_0x4ba3('0xc'),auth[_0x4ba3('0x9')](),controller[_0x4ba3('0xf')]);router[_0x4ba3('0x10')]('/:id',auth[_0x4ba3('0x9')](),controller[_0x4ba3('0x11')]);module['exports']=router; \ No newline at end of file +var _0xfcf0=['index','/describe','describe','/:id','show','put','update','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','isAuthenticated'];(function(_0x548cce,_0x1a9270){var _0x590a98=function(_0x281938){while(--_0x281938){_0x548cce['push'](_0x548cce['shift']());}};_0x590a98(++_0x1a9270);}(_0xfcf0,0x138));var _0x0fcf=function(_0x576170,_0x1712ae){_0x576170=_0x576170-0x0;var _0x397c70=_0xfcf0[_0x576170];return _0x397c70;};'use strict';var multer=require(_0x0fcf('0x0'));var util=require(_0x0fcf('0x1'));var path=require('path');var timeout=require(_0x0fcf('0x2'));var express=require(_0x0fcf('0x3'));var router=express[_0x0fcf('0x4')]();var fs_extra=require(_0x0fcf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0fcf('0x6'));var config=require(_0x0fcf('0x7'));var controller=require(_0x0fcf('0x8'));router[_0x0fcf('0x9')]('/',auth[_0x0fcf('0xa')](),controller[_0x0fcf('0xb')]);router[_0x0fcf('0x9')](_0x0fcf('0xc'),auth['isAuthenticated'](),controller[_0x0fcf('0xd')]);router[_0x0fcf('0x9')](_0x0fcf('0xe'),auth['isAuthenticated'](),controller[_0x0fcf('0xf')]);router[_0x0fcf('0x10')](_0x0fcf('0xe'),auth['isAuthenticated'](),controller[_0x0fcf('0x11')]);router['delete'](_0x0fcf('0xe'),auth[_0x0fcf('0xa')](),controller[_0x0fcf('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index 24ad61a..9508bff 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 _0xddc0=['getDataValue','setDataValue','diff','seconds','BOOLEAN','sequelize','moment','INTEGER','STRING','DATE'];(function(_0x15b960,_0xa6b49a){var _0x59f72a=function(_0x33af16){while(--_0x33af16){_0x15b960['push'](_0x15b960['shift']());}};_0x59f72a(++_0xa6b49a);}(_0xddc0,0x195));var _0x0ddc=function(_0x74895e,_0x298c35){_0x74895e=_0x74895e-0x0;var _0x40bc2a=_0xddc0[_0x74895e];return _0x40bc2a;};'use strict';var Sequelize=require(_0x0ddc('0x0'));var moment=require(_0x0ddc('0x1'));module['exports']={'state':{'type':Sequelize[_0x0ddc('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x0ddc('0x3')]},'scheduledat':{'type':Sequelize[_0x0ddc('0x4')]},'countbusyretry':{'type':Sequelize[_0x0ddc('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x0ddc('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x0ddc('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x0ddc('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0x0ddc('0x3')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x0ddc('0x3')]},'starttime':{'type':Sequelize[_0x0ddc('0x4')]},'responsetime':{'type':Sequelize[_0x0ddc('0x4')]},'answertime':{'type':Sequelize[_0x0ddc('0x4')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x0ddc('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x0ddc('0x3')]},'campaigntype':{'type':Sequelize[_0x0ddc('0x3')]},'membername':{'type':Sequelize[_0x0ddc('0x3')]},'reason':{'type':Sequelize[_0x0ddc('0x3')]},'disposition':{'type':Sequelize[_0x0ddc('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x0ddc('0x3')]},'dispositionat':{'type':Sequelize[_0x0ddc('0x4')],'set':function(_0x6c2057){var _0x512390=this[_0x0ddc('0x5')]('endtime');if(_0x512390&&_0x6c2057){this[_0x0ddc('0x6')]('followuptime',moment(_0x6c2057)[_0x0ddc('0x7')](moment(_0x512390),_0x0ddc('0x8')));}}},'amd':{'type':Sequelize[_0x0ddc('0x9')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x0ddc('0x9')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x0ddc('0x9')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x0ddc('0x4')]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x0ddc('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x0ddc('0x4')]},'deleted':{'type':Sequelize[_0x0ddc('0x3')],'defaultValue':null},'deletedat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']},'countnosuchnumberretry':{'type':Sequelize[_0x0ddc('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x0ddc('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x0ddc('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x0ddc('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x0ddc('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xffc2=['exports','INTEGER','STRING','DATE','getDataValue','endtime','setDataValue','followuptime','diff','BOOLEAN'];(function(_0x1261d3,_0x439c15){var _0x1d0e6d=function(_0x108f97){while(--_0x108f97){_0x1261d3['push'](_0x1261d3['shift']());}};_0x1d0e6d(++_0x439c15);}(_0xffc2,0x154));var _0x2ffc=function(_0x195223,_0x121404){_0x195223=_0x195223-0x0;var _0x3a62dd=_0xffc2[_0x195223];return _0x3a62dd;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x2ffc('0x0')]={'state':{'type':Sequelize[_0x2ffc('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x2ffc('0x2')]},'scheduledat':{'type':Sequelize[_0x2ffc('0x3')]},'countbusyretry':{'type':Sequelize[_0x2ffc('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x2ffc('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x2ffc('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x2ffc('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x2ffc('0x2')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x2ffc('0x2')]},'starttime':{'type':Sequelize[_0x2ffc('0x3')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0x2ffc('0x3')]},'endtime':{'type':Sequelize[_0x2ffc('0x3')]},'ringtime':{'type':Sequelize[_0x2ffc('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x2ffc('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x2ffc('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x2ffc('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x2ffc('0x2')]},'campaign':{'type':Sequelize[_0x2ffc('0x2')]},'campaigntype':{'type':Sequelize[_0x2ffc('0x2')]},'membername':{'type':Sequelize[_0x2ffc('0x2')]},'reason':{'type':Sequelize[_0x2ffc('0x2')]},'disposition':{'type':Sequelize[_0x2ffc('0x2')]},'secondDisposition':{'type':Sequelize[_0x2ffc('0x2')]},'thirdDisposition':{'type':Sequelize[_0x2ffc('0x2')]},'dispositionat':{'type':Sequelize[_0x2ffc('0x3')],'set':function(_0x48d260){var _0x2b6b20=this[_0x2ffc('0x4')](_0x2ffc('0x5'));if(_0x2b6b20&&_0x48d260){this[_0x2ffc('0x6')](_0x2ffc('0x7'),moment(_0x48d260)[_0x2ffc('0x8')](moment(_0x2b6b20),'seconds'));}}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x2ffc('0x9')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x2ffc('0x9')],'defaultValue':![]},'rescheduledat':{'type':Sequelize['DATE']},'callback':{'type':Sequelize[_0x2ffc('0x9')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x2ffc('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x2ffc('0x3')]},'deleted':{'type':Sequelize[_0x2ffc('0x2')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x2ffc('0x3')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x2ffc('0x3')]},'countnosuchnumberretry':{'type':Sequelize[_0x2ffc('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x2ffc('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x2ffc('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x2ffc('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index 244a3ee..7cb7d18 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 _0x7096=['group','moveContactsIvrCampaignHopperFinal','Campaign','CampaignId','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','state\x20=\x20?','findOne','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','name','send','map','rawAttributes','fieldName','type','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','limit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','params','CmHopperFinal','find','catch','describe','body','uniqueid','countContactsQueueCampaignHopperFinal','findAll','sequelize','COUNT','`state`\x20=\x200,\x201,\x20null','literal','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','`state`\x20=\x2019,\x201,\x20null','countContactsIvrCampaignHopperFinal','noSuchContacts','`state`\x20=\x2011\x20,\x201,\x20null','reCallContacts','moveContactsQueueCampaignHopperFinal','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','VoiceQueueId','updatedAt','select','field','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','createdAt','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum','state\x20=\x204'];(function(_0x4e322c,_0x4c95b3){var _0x358af7=function(_0x3de861){while(--_0x3de861){_0x4e322c['push'](_0x4e322c['shift']());}};_0x358af7(++_0x4c95b3);}(_0x7096,0x10c));var _0x6709=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0x7096[_0x2b7764];return _0x848dcb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6709('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6709('0x1'));var rp=require('request-promise');var moment=require(_0x6709('0x2'));var BPromise=require(_0x6709('0x3'));var Mustache=require(_0x6709('0x4'));var util=require(_0x6709('0x5'));var path=require(_0x6709('0x6'));var sox=require(_0x6709('0x7'));var csv=require(_0x6709('0x8'));var ejs=require(_0x6709('0x9'));var fs=require('fs');var fs_extra=require(_0x6709('0xa'));var _=require(_0x6709('0xb'));var squel=require(_0x6709('0xc'));var crypto=require(_0x6709('0xd'));var jsforce=require(_0x6709('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6709('0xf'));var Papa=require(_0x6709('0x10'));var Redis=require(_0x6709('0x11'));var authService=require(_0x6709('0x12'));var qs=require(_0x6709('0x13'));var as=require(_0x6709('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6709('0x15'));var utils=require(_0x6709('0x16'));var config=require(_0x6709('0x17'));var licenseUtil=require(_0x6709('0x18'));var db=require(_0x6709('0x19'))['db'];function respondWithStatusCode(_0x288f51,_0x1d56a5){_0x1d56a5=_0x1d56a5||0xcc;return function(_0x1ac547){if(_0x1ac547){return _0x288f51['sendStatus'](_0x1d56a5);}return _0x288f51[_0x6709('0x1a')](_0x1d56a5)[_0x6709('0x1b')]();};}function respondWithResult(_0x4d5255,_0x3706e1){_0x3706e1=_0x3706e1||0xc8;return function(_0x4e4587){if(_0x4e4587){return _0x4d5255[_0x6709('0x1a')](_0x3706e1)['json'](_0x4e4587);}};}function respondWithFilteredResult(_0x41af1f,_0x4bc059){return function(_0x149233){if(_0x149233){var _0x28866a=typeof _0x4bc059[_0x6709('0x1c')]===_0x6709('0x1d')&&typeof _0x4bc059['limit']==='undefined';var _0x5c4f94=_0x149233[_0x6709('0x1e')];var _0x235a54=_0x28866a?0x0:_0x4bc059['offset'];var _0x9c1fd8=_0x28866a?_0x149233[_0x6709('0x1e')]:_0x4bc059[_0x6709('0x1c')]+_0x4bc059['limit'];var _0x13cf04;if(_0x9c1fd8>=_0x5c4f94){_0x9c1fd8=_0x5c4f94;_0x13cf04=0xc8;}else{_0x13cf04=0xce;}_0x41af1f[_0x6709('0x1a')](_0x13cf04);return _0x41af1f[_0x6709('0x1f')](_0x6709('0x20'),_0x235a54+'-'+_0x9c1fd8+'/'+_0x5c4f94)['json'](_0x149233);}return null;};}function patchUpdates(_0x3c4971){return function(_0x1edac3){try{jsonpatch[_0x6709('0x21')](_0x1edac3,_0x3c4971,!![]);}catch(_0x3cf882){return BPromise[_0x6709('0x22')](_0x3cf882);}return _0x1edac3[_0x6709('0x23')]();};}function saveUpdates(_0x45921e,_0x17763d){return function(_0x386224){if(_0x386224){return _0x386224[_0x6709('0x24')](_0x45921e)[_0x6709('0x25')](function(_0xa36371){return _0xa36371;});}return null;};}function removeEntity(_0x5cf48b,_0x29f25f){return function(_0x81138e){if(_0x81138e){return _0x81138e[_0x6709('0x26')]()['then'](function(){_0x5cf48b[_0x6709('0x1a')](0xcc)[_0x6709('0x1b')]();});}};}function handleEntityNotFound(_0x20a347,_0x44b465){return function(_0x588e00){if(!_0x588e00){_0x20a347[_0x6709('0x27')](0x194);}return _0x588e00;};}function handleError(_0x3076fe,_0x50f7d6){_0x50f7d6=_0x50f7d6||0x1f4;return function(_0x585073){logger[_0x6709('0x28')](_0x585073['stack']);if(_0x585073[_0x6709('0x29')]){delete _0x585073[_0x6709('0x29')];}_0x3076fe['status'](_0x50f7d6)[_0x6709('0x2a')](_0x585073);};}exports['index']=function(_0x46a325,_0x3cd555){var _0x5b6906={},_0x137137={},_0x4e6989={'count':0x0,'rows':[]};var _0xe066d8=_[_0x6709('0x2b')](db['CmHopperFinal'][_0x6709('0x2c')],function(_0x5deff5){return{'name':_0x5deff5[_0x6709('0x2d')],'type':_0x5deff5[_0x6709('0x2e')]['key']};});_0x137137['model']=_[_0x6709('0x2b')](_0xe066d8,_0x6709('0x29'));_0x137137[_0x6709('0x2f')]=_[_0x6709('0x30')](_0x46a325[_0x6709('0x2f')]);_0x137137[_0x6709('0x31')]=_[_0x6709('0x32')](_0x137137[_0x6709('0x33')],_0x137137[_0x6709('0x2f')]);_0x5b6906['attributes']=_[_0x6709('0x32')](_0x137137[_0x6709('0x33')],qs[_0x6709('0x34')](_0x46a325[_0x6709('0x2f')]['fields']));_0x5b6906[_0x6709('0x35')]=_0x5b6906[_0x6709('0x35')][_0x6709('0x36')]?_0x5b6906[_0x6709('0x35')]:_0x137137['model'];if(!_0x46a325[_0x6709('0x2f')][_0x6709('0x37')]('nolimit')){_0x5b6906[_0x6709('0x38')]=qs[_0x6709('0x38')](_0x46a325['query'][_0x6709('0x38')]);_0x5b6906[_0x6709('0x1c')]=qs[_0x6709('0x1c')](_0x46a325[_0x6709('0x2f')][_0x6709('0x1c')]);}_0x5b6906[_0x6709('0x39')]=qs[_0x6709('0x3a')](_0x46a325['query'][_0x6709('0x3a')]);_0x5b6906[_0x6709('0x3b')]=qs['filters'](_[_0x6709('0x3c')](_0x46a325[_0x6709('0x2f')],_0x137137[_0x6709('0x31')]),_0xe066d8);if(_0x46a325[_0x6709('0x2f')][_0x6709('0x3d')]){_0x5b6906[_0x6709('0x3b')]=_['merge'](_0x5b6906[_0x6709('0x3b')],{'$or':_['map'](_0xe066d8,function(_0x31e05a){if(_0x31e05a[_0x6709('0x2e')]!==_0x6709('0x3e')){var _0x48492f={};_0x48492f[_0x31e05a[_0x6709('0x29')]]={'$like':'%'+_0x46a325[_0x6709('0x2f')][_0x6709('0x3d')]+'%'};return _0x48492f;}})});}_0x5b6906=_[_0x6709('0x3f')]({},_0x5b6906,_0x46a325[_0x6709('0x40')]);var _0x1030ee={'where':_0x5b6906[_0x6709('0x3b')]};return db['CmHopperFinal'][_0x6709('0x1e')](_0x1030ee)[_0x6709('0x25')](function(_0x50fbcd){_0x4e6989[_0x6709('0x1e')]=_0x50fbcd;if(_0x46a325[_0x6709('0x2f')][_0x6709('0x41')]){_0x5b6906[_0x6709('0x42')]=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x5b6906);})[_0x6709('0x25')](function(_0x3f0da1){_0x4e6989[_0x6709('0x43')]=_0x3f0da1;return _0x4e6989;})[_0x6709('0x25')](respondWithFilteredResult(_0x3cd555,_0x5b6906))['catch'](handleError(_0x3cd555,null));};exports['show']=function(_0x5af1fb,_0x3d4237){var _0x293577={'raw':!![],'where':{'id':_0x5af1fb[_0x6709('0x44')]['id']}},_0x54f74e={};_0x54f74e[_0x6709('0x33')]=_['keys'](db['CmHopperFinal'][_0x6709('0x2c')]);_0x54f74e[_0x6709('0x2f')]=_[_0x6709('0x30')](_0x5af1fb[_0x6709('0x2f')]);_0x54f74e[_0x6709('0x31')]=_['intersection'](_0x54f74e[_0x6709('0x33')],_0x54f74e['query']);_0x293577[_0x6709('0x35')]=_[_0x6709('0x32')](_0x54f74e[_0x6709('0x33')],qs['fields'](_0x5af1fb[_0x6709('0x2f')]['fields']));_0x293577['attributes']=_0x293577[_0x6709('0x35')][_0x6709('0x36')]?_0x293577[_0x6709('0x35')]:_0x54f74e[_0x6709('0x33')];if(_0x5af1fb[_0x6709('0x2f')][_0x6709('0x41')]){_0x293577[_0x6709('0x42')]=[{'all':!![]}];}_0x293577=_[_0x6709('0x3f')]({},_0x293577,_0x5af1fb[_0x6709('0x40')]);return db[_0x6709('0x45')][_0x6709('0x46')](_0x293577)[_0x6709('0x25')](handleEntityNotFound(_0x3d4237,null))[_0x6709('0x25')](respondWithResult(_0x3d4237,null))[_0x6709('0x47')](handleError(_0x3d4237,null));};exports[_0x6709('0x48')]=function(_0x4f82a0,_0xfbb810){return db['CmHopperFinal']['describe']()[_0x6709('0x25')](respondWithResult(_0xfbb810,null))[_0x6709('0x47')](handleError(_0xfbb810,null));};exports[_0x6709('0x24')]=function(_0xe8dd1,_0x22363b){if(_0xe8dd1[_0x6709('0x49')][_0x6709('0x4a')]){delete _0xe8dd1[_0x6709('0x49')]['uniqueid'];}return db[_0x6709('0x45')][_0x6709('0x46')]({'where':{'uniqueid':_0xe8dd1[_0x6709('0x44')]['id']}})[_0x6709('0x25')](handleEntityNotFound(_0x22363b,null))['then'](saveUpdates(_0xe8dd1[_0x6709('0x49')],null))['then'](respondWithResult(_0x22363b,null))[_0x6709('0x47')](handleError(_0x22363b,null));};exports[_0x6709('0x4b')]=function(_0x2a563b,_0xb257b5,_0x35c9cd){return db['CmHopperFinal'][_0x6709('0x4c')]({'raw':![],'where':{'VoiceQueueId':_0x2a563b[_0x6709('0x44')]['id']},'attributes':[[db[_0x6709('0x4d')]['fn'](_0x6709('0x4e'),db[_0x6709('0x4d')]['fn']('IF',db['sequelize']['literal'](_0x6709('0x4f')))),'noSuchContacts'],[db['sequelize']['fn'](_0x6709('0x4e'),db[_0x6709('0x4d')]['fn']('IF',db[_0x6709('0x4d')][_0x6709('0x50')](_0x6709('0x51')))),_0x6709('0x52')],[db[_0x6709('0x4d')]['fn'](_0x6709('0x4e'),db[_0x6709('0x4d')]['fn']('IF',db[_0x6709('0x4d')][_0x6709('0x50')]('`state`\x20=\x205,\x201,\x20null'))),_0x6709('0x53')],[db[_0x6709('0x4d')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x6709('0x4d')][_0x6709('0x50')](_0x6709('0x54')))),_0x6709('0x55')],[db['sequelize']['fn'](_0x6709('0x4e'),db['sequelize']['fn']('IF',db[_0x6709('0x4d')][_0x6709('0x50')](_0x6709('0x56')))),_0x6709('0x57')],[db[_0x6709('0x4d')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x6709('0x4d')][_0x6709('0x50')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x6709('0x58')],[db[_0x6709('0x4d')]['fn']('COUNT',db[_0x6709('0x4d')]['fn']('IF',db[_0x6709('0x4d')][_0x6709('0x50')](_0x6709('0x59')))),'reCallContacts'],[db['sequelize']['fn'](_0x6709('0x4e'),db['sequelize']['fn']('IF',db[_0x6709('0x4d')][_0x6709('0x50')](_0x6709('0x5a')))),'answeringMachine']]})[_0x6709('0x25')](handleEntityNotFound(_0xb257b5,null))['then'](respondWithResult(_0xb257b5,null))['catch'](handleError(_0xb257b5,null));};exports[_0x6709('0x5b')]=function(_0x511bae,_0x124199,_0x5cf7c0){return db[_0x6709('0x45')][_0x6709('0x4c')]({'raw':![],'where':{'CampaignId':_0x511bae[_0x6709('0x44')]['id']},'attributes':[[db[_0x6709('0x4d')]['fn']('COUNT',db[_0x6709('0x4d')]['fn']('IF',db[_0x6709('0x4d')][_0x6709('0x50')](_0x6709('0x4f')))),_0x6709('0x5c')],[db[_0x6709('0x4d')]['fn'](_0x6709('0x4e'),db['sequelize']['fn']('IF',db[_0x6709('0x4d')][_0x6709('0x50')](_0x6709('0x51')))),_0x6709('0x52')],[db[_0x6709('0x4d')]['fn'](_0x6709('0x4e'),db[_0x6709('0x4d')]['fn']('IF',db[_0x6709('0x4d')][_0x6709('0x50')]('`state`\x20=\x205,\x201,\x20null'))),_0x6709('0x53')],[db[_0x6709('0x4d')]['fn']('COUNT',db[_0x6709('0x4d')]['fn']('IF',db[_0x6709('0x4d')][_0x6709('0x50')](_0x6709('0x54')))),_0x6709('0x55')],[db[_0x6709('0x4d')]['fn'](_0x6709('0x4e'),db[_0x6709('0x4d')]['fn']('IF',db[_0x6709('0x4d')]['literal'](_0x6709('0x56')))),_0x6709('0x57')],[db[_0x6709('0x4d')]['fn'](_0x6709('0x4e'),db[_0x6709('0x4d')]['fn']('IF',db[_0x6709('0x4d')][_0x6709('0x50')](_0x6709('0x5d')))),_0x6709('0x58')],[db[_0x6709('0x4d')]['fn'](_0x6709('0x4e'),db['sequelize']['fn']('IF',db[_0x6709('0x4d')]['literal']('`state`\x20=\x2022,\x201,\x20null'))),_0x6709('0x5e')],[db[_0x6709('0x4d')]['fn'](_0x6709('0x4e'),db[_0x6709('0x4d')]['fn']('IF',db[_0x6709('0x4d')][_0x6709('0x50')](_0x6709('0x5a')))),'answeringMachine']]})['then'](handleEntityNotFound(_0x124199,null))[_0x6709('0x25')](respondWithResult(_0x124199,null))['catch'](handleError(_0x124199,null));};exports[_0x6709('0x5f')]=function(_0x47b7d9,_0x123183,_0x2f1faf){return db['VoiceQueue']['find']({'where':{'id':_0x47b7d9['params']['id']}})[_0x6709('0x25')](handleEntityNotFound(_0x123183,null))[_0x6709('0x25')](function(_0x24c584){var _0xbbfc50;if(_0x24c584){_0xbbfc50=squel[_0x6709('0x60')]()[_0x6709('0x61')](_0x6709('0x62'))[_0x6709('0x63')]([_0x6709('0x64'),_0x6709('0x65'),_0x6709('0x66'),_0x6709('0x67'),_0x6709('0x68'),'createdAt',_0x6709('0x69')],squel[_0x6709('0x6a')]()[_0x6709('0x6b')](_0x6709('0x6c'),'phone')['field'](_0x6709('0x6d'),'scheduledAt')['field'](_0x6709('0x6e'),_0x6709('0x66'))['field'](_0x6709('0x6f'),_0x6709('0x67'))[_0x6709('0x6b')](_0x6709('0x70'),_0x6709('0x68'))['field']('NOW()',_0x6709('0x71'))[_0x6709('0x6b')]('NOW()',_0x6709('0x69'))[_0x6709('0x72')](_0x6709('0x73'))['where'](_0x6709('0x74'),_0x47b7d9[_0x6709('0x44')]['id'][_0x6709('0x75')]())[_0x6709('0x3b')]('state\x20=\x20?',_0x47b7d9['body'][_0x6709('0x76')][_0x6709('0x75')]())[_0x6709('0x3b')](_0x6709('0x77'))[_0x6709('0x3b')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x6709('0x6a')]()[_0x6709('0x6b')]('phone')[_0x6709('0x72')](_0x6709('0x62'))[_0x6709('0x3b')](_0x6709('0x74'),_0x47b7d9[_0x6709('0x44')]['id']['toString']()))[_0x6709('0x3b')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x6709('0x6a')]()['field'](_0x6709('0x78'))[_0x6709('0x72')](_0x6709('0x73'))[_0x6709('0x3b')]('VoiceQueueId\x20=\x20?',_0x47b7d9[_0x6709('0x44')]['id'][_0x6709('0x75')]())[_0x6709('0x3b')](_0x6709('0x79')))[_0x6709('0x7a')](_0x6709('0x66')))['toString']();return db[_0x6709('0x4d')][_0x6709('0x2f')](_0xbbfc50);}return[];})[_0x6709('0x25')](respondWithResult(_0x123183,null))['catch'](handleError(_0x123183,null));};exports[_0x6709('0x7b')]=function(_0x124270,_0x57f14e,_0x4388a1){return db[_0x6709('0x7c')][_0x6709('0x46')]({'where':{'id':_0x124270['params']['id']}})[_0x6709('0x25')](handleEntityNotFound(_0x57f14e,null))[_0x6709('0x25')](function(_0x409723){var _0x5c8564;if(_0x409723){_0x5c8564=squel[_0x6709('0x60')]()[_0x6709('0x61')](_0x6709('0x62'))[_0x6709('0x63')]([_0x6709('0x64'),_0x6709('0x65'),'ContactId',_0x6709('0x67'),_0x6709('0x7d'),'createdAt',_0x6709('0x69')],squel[_0x6709('0x6a')]()[_0x6709('0x6b')]('ANY_VALUE(calleridnum)',_0x6709('0x64'))[_0x6709('0x6b')](_0x6709('0x6d'),_0x6709('0x65'))[_0x6709('0x6b')](_0x6709('0x6e'),_0x6709('0x66'))['field'](_0x6709('0x6f'),_0x6709('0x67'))[_0x6709('0x6b')](_0x6709('0x7e'),_0x6709('0x7d'))[_0x6709('0x6b')](_0x6709('0x6d'),'createdAt')[_0x6709('0x6b')]('NOW()',_0x6709('0x69'))[_0x6709('0x72')](_0x6709('0x73'))[_0x6709('0x3b')](_0x6709('0x7f'),_0x124270[_0x6709('0x44')]['id'][_0x6709('0x75')]())[_0x6709('0x3b')](_0x6709('0x80'),_0x124270[_0x6709('0x49')][_0x6709('0x76')][_0x6709('0x75')]())[_0x6709('0x3b')](_0x6709('0x77'))['where']('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x6709('0x6a')]()[_0x6709('0x6b')]('phone')[_0x6709('0x72')](_0x6709('0x62'))[_0x6709('0x3b')](_0x6709('0x7f'),_0x124270[_0x6709('0x44')]['id'][_0x6709('0x75')]()))[_0x6709('0x3b')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x6709('0x6a')]()[_0x6709('0x6b')](_0x6709('0x78'))[_0x6709('0x72')]('cm_hopper_final')['where'](_0x6709('0x7f'),_0x124270[_0x6709('0x44')]['id'][_0x6709('0x75')]())[_0x6709('0x3b')](_0x6709('0x79')))[_0x6709('0x7a')](_0x6709('0x66')))[_0x6709('0x75')]();return db[_0x6709('0x4d')][_0x6709('0x2f')](_0x5c8564);}return[];})[_0x6709('0x25')](respondWithResult(_0x57f14e,null))[_0x6709('0x47')](handleError(_0x57f14e,null));};exports['checkContactHopper']=function(_0x4767b7,_0x5f7adc,_0x393934){return db['CmHopper'][_0x6709('0x81')]({'where':{'VoiceQueueId':_0x4767b7[_0x6709('0x49')]['VoiceQueueId'],'CampaignId':_0x4767b7[_0x6709('0x49')]['CampaignId'],'ContactId':_0x4767b7[_0x6709('0x49')][_0x6709('0x66')]}})[_0x6709('0x25')](handleEntityNotFound(_0x5f7adc,null))[_0x6709('0x25')](function(_0x45cd4e){if(_0x45cd4e){return _0x45cd4e;}return null;})[_0x6709('0x25')](respondWithResult(_0x5f7adc,null))[_0x6709('0x47')](handleError(_0x5f7adc,null));}; \ No newline at end of file +var _0x2675=['lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','destroy','then','error','name','send','index','map','CmHopperFinal','fieldName','type','key','query','keys','intersection','model','attributes','fields','hasOwnProperty','sort','where','filters','pick','merge','VIRTUAL','filter','includeAll','include','rows','catch','show','rawAttributes','length','options','find','describe','body','uniqueid','params','findAll','sequelize','COUNT','`state`\x20=\x200,\x201,\x20null','literal','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','noSuchContacts','busyContacts','abandonedContacts','moveContactsQueueCampaignHopperFinal','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','VoiceQueueId','createdAt','field','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ListId','ANY_VALUE(VoiceQueueId)','updatedAt','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','select','phone','from','calleridnum','cm_hopper_final','state\x20=\x204','moveContactsIvrCampaignHopperFinal','CampaignId','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','calleridnum\x20NOT\x20IN\x20(?)','group','eml-format','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra'];(function(_0x29f0e8,_0x2f7d39){var _0x2e243e=function(_0x3281aa){while(--_0x3281aa){_0x29f0e8['push'](_0x29f0e8['shift']());}};_0x2e243e(++_0x2f7d39);}(_0x2675,0x75));var _0x5267=function(_0x304c1c,_0x5a110d){_0x304c1c=_0x304c1c-0x0;var _0x5f222c=_0x2675[_0x304c1c];return _0x5f222c;};'use strict';var emlformat=require(_0x5267('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5267('0x1'));var moment=require(_0x5267('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x5267('0x3'));var util=require(_0x5267('0x4'));var path=require('path');var sox=require(_0x5267('0x5'));var csv=require(_0x5267('0x6'));var ejs=require(_0x5267('0x7'));var fs=require('fs');var fs_extra=require(_0x5267('0x8'));var _=require(_0x5267('0x9'));var squel=require(_0x5267('0xa'));var crypto=require('crypto');var jsforce=require(_0x5267('0xb'));var deskjs=require(_0x5267('0xc'));var toCsv=require('to-csv');var querystring=require(_0x5267('0xd'));var Papa=require('papaparse');var Redis=require(_0x5267('0xe'));var authService=require(_0x5267('0xf'));var qs=require(_0x5267('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5267('0x11'));var logger=require('../../config/logger')(_0x5267('0x12'));var utils=require('../../config/utils');var config=require(_0x5267('0x13'));var licenseUtil=require(_0x5267('0x14'));var db=require(_0x5267('0x15'))['db'];function respondWithStatusCode(_0x1f9be3,_0x1d7090){_0x1d7090=_0x1d7090||0xcc;return function(_0x1171b9){if(_0x1171b9){return _0x1f9be3[_0x5267('0x16')](_0x1d7090);}return _0x1f9be3[_0x5267('0x17')](_0x1d7090)[_0x5267('0x18')]();};}function respondWithResult(_0x1e2d3b,_0x16e5a7){_0x16e5a7=_0x16e5a7||0xc8;return function(_0x29349a){if(_0x29349a){return _0x1e2d3b[_0x5267('0x17')](_0x16e5a7)['json'](_0x29349a);}};}function respondWithFilteredResult(_0x52e24e,_0xa593fb){return function(_0x40d897){if(_0x40d897){var _0x38a147=typeof _0xa593fb[_0x5267('0x19')]===_0x5267('0x1a')&&typeof _0xa593fb[_0x5267('0x1b')]===_0x5267('0x1a');var _0x6831e0=_0x40d897[_0x5267('0x1c')];var _0xb1c97a=_0x38a147?0x0:_0xa593fb[_0x5267('0x19')];var _0x1ab03=_0x38a147?_0x40d897['count']:_0xa593fb[_0x5267('0x19')]+_0xa593fb[_0x5267('0x1b')];var _0x5069e8;if(_0x1ab03>=_0x6831e0){_0x1ab03=_0x6831e0;_0x5069e8=0xc8;}else{_0x5069e8=0xce;}_0x52e24e[_0x5267('0x17')](_0x5069e8);return _0x52e24e['set'](_0x5267('0x1d'),_0xb1c97a+'-'+_0x1ab03+'/'+_0x6831e0)[_0x5267('0x1e')](_0x40d897);}return null;};}function patchUpdates(_0x39c0c3){return function(_0x2a9f99){try{jsonpatch[_0x5267('0x1f')](_0x2a9f99,_0x39c0c3,!![]);}catch(_0x4dd637){return BPromise[_0x5267('0x20')](_0x4dd637);}return _0x2a9f99['save']();};}function saveUpdates(_0xa32663,_0x420fb8){return function(_0x3b53ac){if(_0x3b53ac){return _0x3b53ac['update'](_0xa32663)['then'](function(_0x5546e2){return _0x5546e2;});}return null;};}function removeEntity(_0x4a17c7,_0x5ea6a6){return function(_0x26c7f8){if(_0x26c7f8){return _0x26c7f8[_0x5267('0x21')]()[_0x5267('0x22')](function(){_0x4a17c7[_0x5267('0x17')](0xcc)[_0x5267('0x18')]();});}};}function handleEntityNotFound(_0x40d1be,_0x126a97){return function(_0x220e03){if(!_0x220e03){_0x40d1be[_0x5267('0x16')](0x194);}return _0x220e03;};}function handleError(_0x59f112,_0x5cb64f){_0x5cb64f=_0x5cb64f||0x1f4;return function(_0x354111){logger[_0x5267('0x23')](_0x354111['stack']);if(_0x354111[_0x5267('0x24')]){delete _0x354111['name'];}_0x59f112['status'](_0x5cb64f)[_0x5267('0x25')](_0x354111);};}exports[_0x5267('0x26')]=function(_0x1f33b7,_0x2d2ace){var _0x33c431={},_0x4f3d4d={},_0x5e87eb={'count':0x0,'rows':[]};var _0x18020c=_[_0x5267('0x27')](db[_0x5267('0x28')]['rawAttributes'],function(_0x58d685){return{'name':_0x58d685[_0x5267('0x29')],'type':_0x58d685[_0x5267('0x2a')][_0x5267('0x2b')]};});_0x4f3d4d['model']=_['map'](_0x18020c,_0x5267('0x24'));_0x4f3d4d[_0x5267('0x2c')]=_[_0x5267('0x2d')](_0x1f33b7[_0x5267('0x2c')]);_0x4f3d4d['filters']=_[_0x5267('0x2e')](_0x4f3d4d[_0x5267('0x2f')],_0x4f3d4d[_0x5267('0x2c')]);_0x33c431[_0x5267('0x30')]=_[_0x5267('0x2e')](_0x4f3d4d[_0x5267('0x2f')],qs[_0x5267('0x31')](_0x1f33b7[_0x5267('0x2c')]['fields']));_0x33c431['attributes']=_0x33c431[_0x5267('0x30')]['length']?_0x33c431[_0x5267('0x30')]:_0x4f3d4d[_0x5267('0x2f')];if(!_0x1f33b7[_0x5267('0x2c')][_0x5267('0x32')]('nolimit')){_0x33c431[_0x5267('0x1b')]=qs[_0x5267('0x1b')](_0x1f33b7[_0x5267('0x2c')][_0x5267('0x1b')]);_0x33c431[_0x5267('0x19')]=qs[_0x5267('0x19')](_0x1f33b7[_0x5267('0x2c')][_0x5267('0x19')]);}_0x33c431['order']=qs[_0x5267('0x33')](_0x1f33b7['query'][_0x5267('0x33')]);_0x33c431[_0x5267('0x34')]=qs[_0x5267('0x35')](_[_0x5267('0x36')](_0x1f33b7[_0x5267('0x2c')],_0x4f3d4d[_0x5267('0x35')]),_0x18020c);if(_0x1f33b7[_0x5267('0x2c')]['filter']){_0x33c431[_0x5267('0x34')]=_[_0x5267('0x37')](_0x33c431[_0x5267('0x34')],{'$or':_[_0x5267('0x27')](_0x18020c,function(_0x82cea7){if(_0x82cea7[_0x5267('0x2a')]!==_0x5267('0x38')){var _0x487dfc={};_0x487dfc[_0x82cea7[_0x5267('0x24')]]={'$like':'%'+_0x1f33b7['query'][_0x5267('0x39')]+'%'};return _0x487dfc;}})});}_0x33c431=_['merge']({},_0x33c431,_0x1f33b7['options']);var _0x51bddd={'where':_0x33c431[_0x5267('0x34')]};return db['CmHopperFinal'][_0x5267('0x1c')](_0x51bddd)[_0x5267('0x22')](function(_0x3d4b19){_0x5e87eb[_0x5267('0x1c')]=_0x3d4b19;if(_0x1f33b7['query'][_0x5267('0x3a')]){_0x33c431[_0x5267('0x3b')]=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x33c431);})[_0x5267('0x22')](function(_0x560cdf){_0x5e87eb[_0x5267('0x3c')]=_0x560cdf;return _0x5e87eb;})[_0x5267('0x22')](respondWithFilteredResult(_0x2d2ace,_0x33c431))[_0x5267('0x3d')](handleError(_0x2d2ace,null));};exports[_0x5267('0x3e')]=function(_0x36d0f1,_0x3012cb){var _0x27add5={'raw':!![],'where':{'id':_0x36d0f1['params']['id']}},_0x5697b3={};_0x5697b3[_0x5267('0x2f')]=_['keys'](db[_0x5267('0x28')][_0x5267('0x3f')]);_0x5697b3['query']=_[_0x5267('0x2d')](_0x36d0f1[_0x5267('0x2c')]);_0x5697b3[_0x5267('0x35')]=_[_0x5267('0x2e')](_0x5697b3[_0x5267('0x2f')],_0x5697b3[_0x5267('0x2c')]);_0x27add5[_0x5267('0x30')]=_[_0x5267('0x2e')](_0x5697b3[_0x5267('0x2f')],qs['fields'](_0x36d0f1[_0x5267('0x2c')][_0x5267('0x31')]));_0x27add5[_0x5267('0x30')]=_0x27add5[_0x5267('0x30')][_0x5267('0x40')]?_0x27add5['attributes']:_0x5697b3[_0x5267('0x2f')];if(_0x36d0f1['query'][_0x5267('0x3a')]){_0x27add5['include']=[{'all':!![]}];}_0x27add5=_['merge']({},_0x27add5,_0x36d0f1[_0x5267('0x41')]);return db['CmHopperFinal'][_0x5267('0x42')](_0x27add5)[_0x5267('0x22')](handleEntityNotFound(_0x3012cb,null))[_0x5267('0x22')](respondWithResult(_0x3012cb,null))[_0x5267('0x3d')](handleError(_0x3012cb,null));};exports['describe']=function(_0x12d6a8,_0x4ee826){return db['CmHopperFinal'][_0x5267('0x43')]()[_0x5267('0x22')](respondWithResult(_0x4ee826,null))['catch'](handleError(_0x4ee826,null));};exports['update']=function(_0x383ebe,_0xe0439e){if(_0x383ebe[_0x5267('0x44')][_0x5267('0x45')]){delete _0x383ebe[_0x5267('0x44')][_0x5267('0x45')];}return db[_0x5267('0x28')][_0x5267('0x42')]({'where':{'uniqueid':_0x383ebe[_0x5267('0x46')]['id']}})[_0x5267('0x22')](handleEntityNotFound(_0xe0439e,null))[_0x5267('0x22')](saveUpdates(_0x383ebe[_0x5267('0x44')],null))[_0x5267('0x22')](respondWithResult(_0xe0439e,null))[_0x5267('0x3d')](handleError(_0xe0439e,null));};exports['countContactsQueueCampaignHopperFinal']=function(_0x8636d0,_0x466d46,_0x371486){return db['CmHopperFinal'][_0x5267('0x47')]({'raw':![],'where':{'VoiceQueueId':_0x8636d0[_0x5267('0x46')]['id']},'attributes':[[db[_0x5267('0x48')]['fn'](_0x5267('0x49'),db[_0x5267('0x48')]['fn']('IF',db[_0x5267('0x48')]['literal'](_0x5267('0x4a')))),'noSuchContacts'],[db[_0x5267('0x48')]['fn'](_0x5267('0x49'),db[_0x5267('0x48')]['fn']('IF',db[_0x5267('0x48')][_0x5267('0x4b')](_0x5267('0x4c')))),_0x5267('0x4d')],[db['sequelize']['fn']('COUNT',db[_0x5267('0x48')]['fn']('IF',db[_0x5267('0x48')]['literal'](_0x5267('0x4e')))),'busyContacts'],[db['sequelize']['fn'](_0x5267('0x49'),db[_0x5267('0x48')]['fn']('IF',db[_0x5267('0x48')][_0x5267('0x4b')](_0x5267('0x4f')))),_0x5267('0x50')],[db[_0x5267('0x48')]['fn'](_0x5267('0x49'),db[_0x5267('0x48')]['fn']('IF',db[_0x5267('0x48')]['literal'](_0x5267('0x51')))),_0x5267('0x52')],[db[_0x5267('0x48')]['fn'](_0x5267('0x49'),db[_0x5267('0x48')]['fn']('IF',db[_0x5267('0x48')]['literal'](_0x5267('0x53')))),'abandonedContacts'],[db[_0x5267('0x48')]['fn'](_0x5267('0x49'),db[_0x5267('0x48')]['fn']('IF',db['sequelize'][_0x5267('0x4b')](_0x5267('0x54')))),_0x5267('0x55')],[db[_0x5267('0x48')]['fn'](_0x5267('0x49'),db[_0x5267('0x48')]['fn']('IF',db['sequelize'][_0x5267('0x4b')](_0x5267('0x56')))),_0x5267('0x57')]]})[_0x5267('0x22')](handleEntityNotFound(_0x466d46,null))['then'](respondWithResult(_0x466d46,null))['catch'](handleError(_0x466d46,null));};exports[_0x5267('0x58')]=function(_0x5393e9,_0x3f5cda,_0x47059c){return db['CmHopperFinal']['findAll']({'raw':![],'where':{'CampaignId':_0x5393e9[_0x5267('0x46')]['id']},'attributes':[[db[_0x5267('0x48')]['fn'](_0x5267('0x49'),db['sequelize']['fn']('IF',db[_0x5267('0x48')][_0x5267('0x4b')](_0x5267('0x4a')))),_0x5267('0x59')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x5267('0x48')][_0x5267('0x4b')](_0x5267('0x4c')))),_0x5267('0x4d')],[db[_0x5267('0x48')]['fn'](_0x5267('0x49'),db[_0x5267('0x48')]['fn']('IF',db[_0x5267('0x48')]['literal'](_0x5267('0x4e')))),_0x5267('0x5a')],[db['sequelize']['fn'](_0x5267('0x49'),db[_0x5267('0x48')]['fn']('IF',db[_0x5267('0x48')][_0x5267('0x4b')](_0x5267('0x4f')))),_0x5267('0x50')],[db['sequelize']['fn'](_0x5267('0x49'),db[_0x5267('0x48')]['fn']('IF',db[_0x5267('0x48')][_0x5267('0x4b')](_0x5267('0x51')))),_0x5267('0x52')],[db['sequelize']['fn'](_0x5267('0x49'),db[_0x5267('0x48')]['fn']('IF',db[_0x5267('0x48')][_0x5267('0x4b')](_0x5267('0x53')))),_0x5267('0x5b')],[db['sequelize']['fn'](_0x5267('0x49'),db[_0x5267('0x48')]['fn']('IF',db[_0x5267('0x48')][_0x5267('0x4b')]('`state`\x20=\x2022,\x201,\x20null'))),'reCallContacts'],[db['sequelize']['fn'](_0x5267('0x49'),db['sequelize']['fn']('IF',db[_0x5267('0x48')]['literal'](_0x5267('0x56')))),_0x5267('0x57')]]})[_0x5267('0x22')](handleEntityNotFound(_0x3f5cda,null))[_0x5267('0x22')](respondWithResult(_0x3f5cda,null))[_0x5267('0x3d')](handleError(_0x3f5cda,null));};exports[_0x5267('0x5c')]=function(_0x21338f,_0x1103c5,_0x489b9a){return db['VoiceQueue']['find']({'where':{'id':_0x21338f[_0x5267('0x46')]['id']}})[_0x5267('0x22')](handleEntityNotFound(_0x1103c5,null))[_0x5267('0x22')](function(_0x457d84){var _0x4974d1;if(_0x457d84){_0x4974d1=squel[_0x5267('0x5d')]()[_0x5267('0x5e')](_0x5267('0x5f'))[_0x5267('0x60')](['phone',_0x5267('0x61'),_0x5267('0x62'),'ListId',_0x5267('0x63'),_0x5267('0x64'),'updatedAt'],squel['select']()[_0x5267('0x65')](_0x5267('0x66'),'phone')['field'](_0x5267('0x67'),_0x5267('0x61'))[_0x5267('0x65')](_0x5267('0x68'),_0x5267('0x62'))['field'](_0x5267('0x69'),_0x5267('0x6a'))['field'](_0x5267('0x6b'),_0x5267('0x63'))[_0x5267('0x65')](_0x5267('0x67'),_0x5267('0x64'))[_0x5267('0x65')](_0x5267('0x67'),_0x5267('0x6c'))['from']('cm_hopper_final')[_0x5267('0x34')](_0x5267('0x6d'),_0x21338f[_0x5267('0x46')]['id'][_0x5267('0x6e')]())['where'](_0x5267('0x6f'),_0x21338f['body'][_0x5267('0x70')][_0x5267('0x6e')]())[_0x5267('0x34')](_0x5267('0x71'))['where']('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x5267('0x72')]()[_0x5267('0x65')](_0x5267('0x73'))[_0x5267('0x74')](_0x5267('0x5f'))[_0x5267('0x34')]('VoiceQueueId\x20=\x20?',_0x21338f[_0x5267('0x46')]['id']['toString']()))[_0x5267('0x34')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x5267('0x72')]()[_0x5267('0x65')](_0x5267('0x75'))[_0x5267('0x74')](_0x5267('0x76'))[_0x5267('0x34')](_0x5267('0x6d'),_0x21338f[_0x5267('0x46')]['id'][_0x5267('0x6e')]())[_0x5267('0x34')](_0x5267('0x77')))['group'](_0x5267('0x62')))[_0x5267('0x6e')]();return db['sequelize'][_0x5267('0x2c')](_0x4974d1);}return[];})[_0x5267('0x22')](respondWithResult(_0x1103c5,null))[_0x5267('0x3d')](handleError(_0x1103c5,null));};exports[_0x5267('0x78')]=function(_0xd18795,_0x37b007,_0x358543){return db['Campaign'][_0x5267('0x42')]({'where':{'id':_0xd18795[_0x5267('0x46')]['id']}})[_0x5267('0x22')](handleEntityNotFound(_0x37b007,null))[_0x5267('0x22')](function(_0x1cdf9f){var _0x4dbaa2;if(_0x1cdf9f){_0x4dbaa2=squel['insert']()[_0x5267('0x5e')](_0x5267('0x5f'))[_0x5267('0x60')]([_0x5267('0x73'),'scheduledAt',_0x5267('0x62'),_0x5267('0x6a'),_0x5267('0x79'),_0x5267('0x64'),_0x5267('0x6c')],squel[_0x5267('0x72')]()[_0x5267('0x65')](_0x5267('0x66'),_0x5267('0x73'))[_0x5267('0x65')](_0x5267('0x67'),_0x5267('0x61'))[_0x5267('0x65')]('ANY_VALUE(ContactId)',_0x5267('0x62'))[_0x5267('0x65')](_0x5267('0x69'),_0x5267('0x6a'))[_0x5267('0x65')](_0x5267('0x7a'),_0x5267('0x79'))[_0x5267('0x65')](_0x5267('0x67'),_0x5267('0x64'))[_0x5267('0x65')](_0x5267('0x67'),_0x5267('0x6c'))[_0x5267('0x74')](_0x5267('0x76'))[_0x5267('0x34')](_0x5267('0x7b'),_0xd18795[_0x5267('0x46')]['id'][_0x5267('0x6e')]())[_0x5267('0x34')](_0x5267('0x6f'),_0xd18795[_0x5267('0x44')][_0x5267('0x70')]['toString']())[_0x5267('0x34')](_0x5267('0x71'))[_0x5267('0x34')](_0x5267('0x7c'),squel[_0x5267('0x72')]()['field'](_0x5267('0x73'))[_0x5267('0x74')]('cm_hopper')['where']('CampaignId\x20=\x20?',_0xd18795[_0x5267('0x46')]['id']['toString']()))[_0x5267('0x34')]('calleridnum\x20NOT\x20IN\x20(?)',squel['select']()[_0x5267('0x65')](_0x5267('0x75'))[_0x5267('0x74')](_0x5267('0x76'))[_0x5267('0x34')]('CampaignId\x20=\x20?',_0xd18795['params']['id'][_0x5267('0x6e')]())[_0x5267('0x34')](_0x5267('0x77')))[_0x5267('0x7d')](_0x5267('0x62')))['toString']();return db[_0x5267('0x48')]['query'](_0x4dbaa2);}return[];})['then'](respondWithResult(_0x37b007,null))[_0x5267('0x3d')](handleError(_0x37b007,null));};exports['checkContactHopper']=function(_0x5da8d6,_0x3ebe63,_0x321322){return db['CmHopper']['findOne']({'where':{'VoiceQueueId':_0x5da8d6['body'][_0x5267('0x63')],'CampaignId':_0x5da8d6['body'][_0x5267('0x79')],'ContactId':_0x5da8d6['body'][_0x5267('0x62')]}})[_0x5267('0x22')](handleEntityNotFound(_0x3ebe63,null))['then'](function(_0x1ae9fe){if(_0x1ae9fe){return _0x1ae9fe;}return null;})[_0x5267('0x22')](respondWithResult(_0x3ebe63,null))[_0x5267('0x3d')](handleError(_0x3ebe63,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index c505da8..2dd2556 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 _0x9447=['request-promise','path','rimraf','../../config/environment','exports','CmHopperFinal','calleridnum','uniqueid','lodash','../../config/logger','moment','bluebird'];(function(_0x4257b7,_0x26b995){var _0x581af2=function(_0x843905){while(--_0x843905){_0x4257b7['push'](_0x4257b7['shift']());}};_0x581af2(++_0x26b995);}(_0x9447,0xe0));var _0x7944=function(_0x3c01d6,_0x42065d){_0x3c01d6=_0x3c01d6-0x0;var _0x119b97=_0x9447[_0x3c01d6];return _0x119b97;};'use strict';var _=require(_0x7944('0x0'));var util=require('util');var logger=require(_0x7944('0x1'))('api');var moment=require(_0x7944('0x2'));var BPromise=require(_0x7944('0x3'));var rp=require(_0x7944('0x4'));var fs=require('fs');var path=require(_0x7944('0x5'));var rimraf=require(_0x7944('0x6'));var config=require(_0x7944('0x7'));var attributes=require('./cmHopperFinal.attributes');module[_0x7944('0x8')]=function(_0x328f5c,_0x2abede){return _0x328f5c['define'](_0x7944('0x9'),attributes,{'tableName':'cm_hopper_final','paranoid':![],'indexes':[{'name':_0x7944('0xa'),'fields':[_0x7944('0xa')]},{'name':_0x7944('0xb'),'fields':[_0x7944('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x88cd=['path','rimraf','../../config/environment','./cmHopperFinal.attributes','exports','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','util','../../config/logger','bluebird','request-promise'];(function(_0x140d94,_0x25e2a5){var _0x50ecb7=function(_0x4d8ff0){while(--_0x4d8ff0){_0x140d94['push'](_0x140d94['shift']());}};_0x50ecb7(++_0x25e2a5);}(_0x88cd,0x87));var _0xd88c=function(_0x54e0f8,_0x29b2d2){_0x54e0f8=_0x54e0f8-0x0;var _0x1d6d8a=_0x88cd[_0x54e0f8];return _0x1d6d8a;};'use strict';var _=require(_0xd88c('0x0'));var util=require(_0xd88c('0x1'));var logger=require(_0xd88c('0x2'))('api');var moment=require('moment');var BPromise=require(_0xd88c('0x3'));var rp=require(_0xd88c('0x4'));var fs=require('fs');var path=require(_0xd88c('0x5'));var rimraf=require(_0xd88c('0x6'));var config=require(_0xd88c('0x7'));var attributes=require(_0xd88c('0x8'));module[_0xd88c('0x9')]=function(_0xba34eb,_0x3bd1f0){return _0xba34eb['define'](_0xd88c('0xa'),attributes,{'tableName':_0xd88c('0xb'),'paranoid':![],'indexes':[{'name':_0xd88c('0xc'),'fields':['calleridnum']},{'name':'uniqueid','fields':[_0xd88c('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index 99a0e7d..3760523 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.rpc.js +++ b/server/api/cmHopperFinal/cmHopperFinal.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0x4e216e,_0x4ee051){var _0x9f8efe=function(_0x54dc70){while(--_0x54dc70){_0x4e216e['push'](_0x4e216e['shift']());}};_0x9f8efe(++_0x4ee051);}(_0xb10b,0x12a));var _0xbb10=function(_0x241811,_0x35ca5f){_0x241811=_0x241811-0x0;var _0x1d1e76=_0xb10b[_0x241811];return _0x1d1e76;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0x3df4d6,_0x2e40cb){var _0x100b8a=function(_0x40eef4){while(--_0x40eef4){_0x3df4d6['push'](_0x3df4d6['shift']());}};_0x100b8a(++_0x2e40cb);}(_0xb10b,0x12a));var _0xbb10=function(_0x15f9c6,_0x4a344e){_0x15f9c6=_0x15f9c6-0x0;var _0xe1874e=_0xb10b[_0x15f9c6];return _0xe1874e;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index dc76d9e..e80e0d1 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 _0x05ed=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','/describe','/:id','isAuthenticated','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','put','update','multer','path','connect-timeout','Router','fs-extra'];(function(_0x429499,_0x56ee4a){var _0x1f7e30=function(_0x3ef11e){while(--_0x3ef11e){_0x429499['push'](_0x429499['shift']());}};_0x1f7e30(++_0x56ee4a);}(_0x05ed,0x14b));var _0xd05e=function(_0x5293c8,_0xab0c3c){_0x5293c8=_0x5293c8-0x0;var _0x3623fb=_0x05ed[_0x5293c8];return _0x3623fb;};'use strict';var multer=require(_0xd05e('0x0'));var util=require('util');var path=require(_0xd05e('0x1'));var timeout=require(_0xd05e('0x2'));var express=require('express');var router=express[_0xd05e('0x3')]();var fs_extra=require(_0xd05e('0x4'));var auth=require(_0xd05e('0x5'));var interaction=require(_0xd05e('0x6'));var config=require(_0xd05e('0x7'));var controller=require('./cmHopperFinal.controller');router[_0xd05e('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xd05e('0x8')](_0xd05e('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0xd05e('0x8')](_0xd05e('0xa'),auth[_0xd05e('0xb')](),controller['show']);router[_0xd05e('0x8')](_0xd05e('0xc'),auth['isAuthenticated'](),controller[_0xd05e('0xd')]);router[_0xd05e('0x8')](_0xd05e('0xe'),auth['isAuthenticated'](),controller[_0xd05e('0xf')]);router[_0xd05e('0x10')](_0xd05e('0x11'),auth[_0xd05e('0xb')](),controller[_0xd05e('0x12')]);router[_0xd05e('0x10')]('/voice/campaign/moveContacts/:id',auth[_0xd05e('0xb')](),controller['moveContactsIvrCampaignHopperFinal']);router[_0xd05e('0x10')]('/checkContactHopper',auth['isAuthenticated'](),controller['checkContactHopper']);router[_0xd05e('0x13')](_0xd05e('0xa'),auth[_0xd05e('0xb')](),controller[_0xd05e('0x14')]);module['exports']=router; \ No newline at end of file +var _0xd058=['post','moveContactsQueueCampaignHopperFinal','checkContactHopper','put','update','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id'];(function(_0x701566,_0x7de6cb){var _0x64b6c9=function(_0x7481f7){while(--_0x7481f7){_0x701566['push'](_0x701566['shift']());}};_0x64b6c9(++_0x7de6cb);}(_0xd058,0xe7));var _0x8d05=function(_0x4c2f30,_0xa91340){_0x4c2f30=_0x4c2f30-0x0;var _0xb8854d=_0xd058[_0x4c2f30];return _0xb8854d;};'use strict';var multer=require('multer');var util=require(_0x8d05('0x0'));var path=require(_0x8d05('0x1'));var timeout=require(_0x8d05('0x2'));var express=require(_0x8d05('0x3'));var router=express[_0x8d05('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8d05('0x5'));var interaction=require(_0x8d05('0x6'));var config=require(_0x8d05('0x7'));var controller=require(_0x8d05('0x8'));router[_0x8d05('0x9')]('/',auth[_0x8d05('0xa')](),controller[_0x8d05('0xb')]);router['get'](_0x8d05('0xc'),auth[_0x8d05('0xa')](),controller[_0x8d05('0xd')]);router[_0x8d05('0x9')](_0x8d05('0xe'),auth[_0x8d05('0xa')](),controller[_0x8d05('0xf')]);router[_0x8d05('0x9')](_0x8d05('0x10'),auth[_0x8d05('0xa')](),controller[_0x8d05('0x11')]);router['get'](_0x8d05('0x12'),auth[_0x8d05('0xa')](),controller['countContactsIvrCampaignHopperFinal']);router[_0x8d05('0x13')]('/voice/queue/moveContacts/:id',auth[_0x8d05('0xa')](),controller[_0x8d05('0x14')]);router[_0x8d05('0x13')]('/voice/campaign/moveContacts/:id',auth[_0x8d05('0xa')](),controller['moveContactsIvrCampaignHopperFinal']);router['post']('/checkContactHopper',auth[_0x8d05('0xa')](),controller[_0x8d05('0x15')]);router[_0x8d05('0x16')](_0x8d05('0xe'),auth[_0x8d05('0xa')](),controller[_0x8d05('0x17')]);module[_0x8d05('0x18')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index edf5e87..d9a49a9 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 _0x32bb=['exports','INTEGER','STRING','DATE','BOOLEAN'];(function(_0x1de111,_0x313f2e){var _0x5f339=function(_0x389e5d){while(--_0x389e5d){_0x1de111['push'](_0x1de111['shift']());}};_0x5f339(++_0x313f2e);}(_0x32bb,0x87));var _0xb32b=function(_0x265aa2,_0x220072){_0x265aa2=_0x265aa2-0x0;var _0x447a3a=_0x32bb[_0x265aa2];return _0x447a3a;};'use strict';var Sequelize=require('sequelize');module[_0xb32b('0x0')]={'state':{'type':Sequelize[_0xb32b('0x1')](0x2)},'statedesc':{'type':Sequelize[_0xb32b('0x2')]},'scheduledat':{'type':Sequelize[_0xb32b('0x3')]},'countbusyretry':{'type':Sequelize[_0xb32b('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xb32b('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xb32b('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xb32b('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xb32b('0x2')]},'originatecalleridnum':{'type':Sequelize[_0xb32b('0x2')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xb32b('0x2')]},'calleridname':{'type':Sequelize[_0xb32b('0x2')]},'starttime':{'type':Sequelize[_0xb32b('0x3')]},'responsetime':{'type':Sequelize[_0xb32b('0x3')]},'answertime':{'type':Sequelize[_0xb32b('0x3')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0xb32b('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xb32b('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xb32b('0x2')]},'campaign':{'type':Sequelize[_0xb32b('0x2')]},'campaigntype':{'type':Sequelize[_0xb32b('0x2')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0xb32b('0x2')]},'amd':{'type':Sequelize[_0xb32b('0x4')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize[_0xb32b('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xb32b('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0xb32b('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize['DATE']},'edited':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xb32b('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xb32b('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xb32b('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xb32b('0x1')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xfffd=['sequelize','exports','INTEGER','STRING','DATE','BOOLEAN'];(function(_0x310e95,_0x2a8533){var _0x5f287a=function(_0x410f5d){while(--_0x410f5d){_0x310e95['push'](_0x310e95['shift']());}};_0x5f287a(++_0x2a8533);}(_0xfffd,0xea));var _0xdfff=function(_0x5879e9,_0xe58d9e){_0x5879e9=_0x5879e9-0x0;var _0x4eb3f6=_0xfffd[_0x5879e9];return _0x4eb3f6;};'use strict';var Sequelize=require(_0xdfff('0x0'));module[_0xdfff('0x1')]={'state':{'type':Sequelize[_0xdfff('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xdfff('0x3')]},'scheduledat':{'type':Sequelize[_0xdfff('0x4')]},'countbusyretry':{'type':Sequelize[_0xdfff('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xdfff('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xdfff('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xdfff('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xdfff('0x3')]},'originatecalleridnum':{'type':Sequelize[_0xdfff('0x3')]},'originatecalleridname':{'type':Sequelize[_0xdfff('0x3')]},'calleridnum':{'type':Sequelize[_0xdfff('0x3')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xdfff('0x4')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xdfff('0x4')]},'droptime':{'type':Sequelize[_0xdfff('0x4')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xdfff('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xdfff('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xdfff('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xdfff('0x3')]},'campaign':{'type':Sequelize[_0xdfff('0x3')]},'campaigntype':{'type':Sequelize[_0xdfff('0x3')]},'membername':{'type':Sequelize[_0xdfff('0x3')]},'reason':{'type':Sequelize[_0xdfff('0x3')]},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0xdfff('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0xdfff('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xdfff('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xdfff('0x4')]},'recallme':{'type':Sequelize[_0xdfff('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize['DATE']},'edited':{'type':Sequelize[_0xdfff('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xdfff('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xdfff('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xdfff('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xdfff('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xdfff('0x2')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xdfff('0x3')]}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index 18a8518..00f1f59 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 _0xc081=['../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','sendStatus','error','stack','name','send','index','CmHopperHistory','rawAttributes','fieldName','type','key','map','keys','filters','model','attributes','intersection','fields','query','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','findAll','catch','show','params','length','include','find','create','body','describe','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x30f9f7,_0x41cfc8){var _0x291c93=function(_0x185d40){while(--_0x185d40){_0x30f9f7['push'](_0x30f9f7['shift']());}};_0x291c93(++_0x41cfc8);}(_0xc081,0x1b1));var _0x1c08=function(_0x575057,_0x14baf3){_0x575057=_0x575057-0x0;var _0x49dbc8=_0xc081[_0x575057];return _0x49dbc8;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x1c08('0x0'));var rp=require(_0x1c08('0x1'));var moment=require(_0x1c08('0x2'));var BPromise=require(_0x1c08('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x1c08('0x4'));var sox=require(_0x1c08('0x5'));var csv=require(_0x1c08('0x6'));var ejs=require(_0x1c08('0x7'));var fs=require('fs');var fs_extra=require(_0x1c08('0x8'));var _=require(_0x1c08('0x9'));var squel=require('squel');var crypto=require(_0x1c08('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x1c08('0xb'));var toCsv=require('to-csv');var querystring=require(_0x1c08('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1c08('0xd'));var qs=require(_0x1c08('0xe'));var as=require(_0x1c08('0xf'));var hardwareService=require(_0x1c08('0x10'));var logger=require(_0x1c08('0x11'))(_0x1c08('0x12'));var utils=require('../../config/utils');var config=require(_0x1c08('0x13'));var licenseUtil=require(_0x1c08('0x14'));var db=require(_0x1c08('0x15'))['db'];function respondWithStatusCode(_0x137949,_0x50a45e){_0x50a45e=_0x50a45e||0xcc;return function(_0x563f30){if(_0x563f30){return _0x137949['sendStatus'](_0x50a45e);}return _0x137949['status'](_0x50a45e)[_0x1c08('0x16')]();};}function respondWithResult(_0x4ae55a,_0x5d997b){_0x5d997b=_0x5d997b||0xc8;return function(_0x17bf5d){if(_0x17bf5d){return _0x4ae55a[_0x1c08('0x17')](_0x5d997b)[_0x1c08('0x18')](_0x17bf5d);}};}function respondWithFilteredResult(_0x23bd58,_0x26bc00){return function(_0x79029f){if(_0x79029f){var _0x55f1dd=typeof _0x26bc00[_0x1c08('0x19')]===_0x1c08('0x1a')&&typeof _0x26bc00[_0x1c08('0x1b')]==='undefined';var _0x4eb4bc=_0x79029f['count'];var _0x3a3970=_0x55f1dd?0x0:_0x26bc00[_0x1c08('0x19')];var _0x468297=_0x55f1dd?_0x79029f[_0x1c08('0x1c')]:_0x26bc00[_0x1c08('0x19')]+_0x26bc00['limit'];var _0x42ec82;if(_0x468297>=_0x4eb4bc){_0x468297=_0x4eb4bc;_0x42ec82=0xc8;}else{_0x42ec82=0xce;}_0x23bd58[_0x1c08('0x17')](_0x42ec82);return _0x23bd58[_0x1c08('0x1d')](_0x1c08('0x1e'),_0x3a3970+'-'+_0x468297+'/'+_0x4eb4bc)[_0x1c08('0x18')](_0x79029f);}return null;};}function patchUpdates(_0x283cb7){return function(_0x1d96fd){try{jsonpatch['apply'](_0x1d96fd,_0x283cb7,!![]);}catch(_0x2663cf){return BPromise[_0x1c08('0x1f')](_0x2663cf);}return _0x1d96fd[_0x1c08('0x20')]();};}function saveUpdates(_0x1fb522,_0x23910a){return function(_0x34a622){if(_0x34a622){return _0x34a622[_0x1c08('0x21')](_0x1fb522)[_0x1c08('0x22')](function(_0x22d6e2){return _0x22d6e2;});}return null;};}function removeEntity(_0x23ab4f,_0x2bbe5f){return function(_0x36be5d){if(_0x36be5d){return _0x36be5d['destroy']()[_0x1c08('0x22')](function(){_0x23ab4f[_0x1c08('0x17')](0xcc)[_0x1c08('0x16')]();});}};}function handleEntityNotFound(_0x320661,_0x842721){return function(_0x367904){if(!_0x367904){_0x320661[_0x1c08('0x23')](0x194);}return _0x367904;};}function handleError(_0x477abe,_0x2fe4af){_0x2fe4af=_0x2fe4af||0x1f4;return function(_0x3cf10b){logger[_0x1c08('0x24')](_0x3cf10b[_0x1c08('0x25')]);if(_0x3cf10b['name']){delete _0x3cf10b[_0x1c08('0x26')];}_0x477abe[_0x1c08('0x17')](_0x2fe4af)[_0x1c08('0x27')](_0x3cf10b);};}exports[_0x1c08('0x28')]=function(_0xe77e5,_0x2f9e90){var _0x539fbd={},_0x4fafe6={},_0x9e74bf={'count':0x0,'rows':[]};var _0x52980d=_['map'](db[_0x1c08('0x29')][_0x1c08('0x2a')],function(_0x56e42e){return{'name':_0x56e42e[_0x1c08('0x2b')],'type':_0x56e42e[_0x1c08('0x2c')][_0x1c08('0x2d')]};});_0x4fafe6['model']=_[_0x1c08('0x2e')](_0x52980d,_0x1c08('0x26'));_0x4fafe6['query']=_[_0x1c08('0x2f')](_0xe77e5['query']);_0x4fafe6[_0x1c08('0x30')]=_['intersection'](_0x4fafe6[_0x1c08('0x31')],_0x4fafe6['query']);_0x539fbd[_0x1c08('0x32')]=_[_0x1c08('0x33')](_0x4fafe6[_0x1c08('0x31')],qs[_0x1c08('0x34')](_0xe77e5[_0x1c08('0x35')][_0x1c08('0x34')]));_0x539fbd[_0x1c08('0x32')]=_0x539fbd[_0x1c08('0x32')]['length']?_0x539fbd[_0x1c08('0x32')]:_0x4fafe6[_0x1c08('0x31')];if(!_0xe77e5[_0x1c08('0x35')][_0x1c08('0x36')](_0x1c08('0x37'))){_0x539fbd[_0x1c08('0x1b')]=qs[_0x1c08('0x1b')](_0xe77e5[_0x1c08('0x35')][_0x1c08('0x1b')]);_0x539fbd[_0x1c08('0x19')]=qs[_0x1c08('0x19')](_0xe77e5[_0x1c08('0x35')][_0x1c08('0x19')]);}_0x539fbd[_0x1c08('0x38')]=qs[_0x1c08('0x39')](_0xe77e5[_0x1c08('0x35')][_0x1c08('0x39')]);_0x539fbd['where']=qs[_0x1c08('0x30')](_[_0x1c08('0x3a')](_0xe77e5[_0x1c08('0x35')],_0x4fafe6[_0x1c08('0x30')]),_0x52980d);if(_0xe77e5[_0x1c08('0x35')]['filter']){_0x539fbd[_0x1c08('0x3b')]=_[_0x1c08('0x3c')](_0x539fbd[_0x1c08('0x3b')],{'$or':_[_0x1c08('0x2e')](_0x52980d,function(_0xcd0b6b){if(_0xcd0b6b['type']!==_0x1c08('0x3d')){var _0x13a792={};_0x13a792[_0xcd0b6b[_0x1c08('0x26')]]={'$like':'%'+_0xe77e5[_0x1c08('0x35')][_0x1c08('0x3e')]+'%'};return _0x13a792;}})});}_0x539fbd=_['merge']({},_0x539fbd,_0xe77e5[_0x1c08('0x3f')]);var _0x2bbf44={'where':_0x539fbd[_0x1c08('0x3b')]};return db[_0x1c08('0x29')][_0x1c08('0x1c')](_0x2bbf44)[_0x1c08('0x22')](function(_0x2f47a7){_0x9e74bf['count']=_0x2f47a7;if(_0xe77e5[_0x1c08('0x35')][_0x1c08('0x40')]){_0x539fbd['include']=[{'all':!![]}];}return db[_0x1c08('0x29')][_0x1c08('0x41')](_0x539fbd);})[_0x1c08('0x22')](function(_0x1c4527){_0x9e74bf['rows']=_0x1c4527;return _0x9e74bf;})[_0x1c08('0x22')](respondWithFilteredResult(_0x2f9e90,_0x539fbd))[_0x1c08('0x42')](handleError(_0x2f9e90,null));};exports[_0x1c08('0x43')]=function(_0x442f0b,_0x6c7aa7){var _0x329f98={'raw':!![],'where':{'id':_0x442f0b[_0x1c08('0x44')]['id']}},_0x28a1d9={};_0x28a1d9[_0x1c08('0x31')]=_[_0x1c08('0x2f')](db[_0x1c08('0x29')][_0x1c08('0x2a')]);_0x28a1d9[_0x1c08('0x35')]=_[_0x1c08('0x2f')](_0x442f0b['query']);_0x28a1d9['filters']=_[_0x1c08('0x33')](_0x28a1d9[_0x1c08('0x31')],_0x28a1d9[_0x1c08('0x35')]);_0x329f98[_0x1c08('0x32')]=_[_0x1c08('0x33')](_0x28a1d9[_0x1c08('0x31')],qs['fields'](_0x442f0b[_0x1c08('0x35')]['fields']));_0x329f98['attributes']=_0x329f98[_0x1c08('0x32')][_0x1c08('0x45')]?_0x329f98[_0x1c08('0x32')]:_0x28a1d9[_0x1c08('0x31')];if(_0x442f0b[_0x1c08('0x35')][_0x1c08('0x40')]){_0x329f98[_0x1c08('0x46')]=[{'all':!![]}];}_0x329f98=_[_0x1c08('0x3c')]({},_0x329f98,_0x442f0b[_0x1c08('0x3f')]);return db['CmHopperHistory'][_0x1c08('0x47')](_0x329f98)[_0x1c08('0x22')](handleEntityNotFound(_0x6c7aa7,null))['then'](respondWithResult(_0x6c7aa7,null))[_0x1c08('0x42')](handleError(_0x6c7aa7,null));};exports['create']=function(_0x24da05,_0x51eec0){return db[_0x1c08('0x29')][_0x1c08('0x48')](_0x24da05[_0x1c08('0x49')],{})[_0x1c08('0x22')](respondWithResult(_0x51eec0,0xc9))['catch'](handleError(_0x51eec0,null));};exports['describe']=function(_0x2f4b9c,_0x52d7d1){return db[_0x1c08('0x29')][_0x1c08('0x4a')]()[_0x1c08('0x22')](respondWithResult(_0x52d7d1,null))['catch'](handleError(_0x52d7d1,null));};exports[_0x1c08('0x21')]=function(_0x2f5313,_0x5b492f){if(_0x2f5313[_0x1c08('0x49')]['uniqueid']){delete _0x2f5313[_0x1c08('0x49')]['uniqueid'];}return db['CmHopperHistory'][_0x1c08('0x47')]({'where':{'uniqueid':_0x2f5313[_0x1c08('0x44')]['id']}})[_0x1c08('0x22')](handleEntityNotFound(_0x5b492f,null))[_0x1c08('0x22')](saveUpdates(_0x2f5313[_0x1c08('0x49')],null))[_0x1c08('0x22')](respondWithResult(_0x5b492f,null))[_0x1c08('0x42')](handleError(_0x5b492f,null));}; \ No newline at end of file +var _0x1cf1=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','CmHopperHistory','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','count','includeAll','findAll','rows','catch','params','include','create','body','describe','uniqueid','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x38004c,_0x3b43ef){var _0x4e3d85=function(_0xf0c04c){while(--_0xf0c04c){_0x38004c['push'](_0x38004c['shift']());}};_0x4e3d85(++_0x3b43ef);}(_0x1cf1,0x183));var _0x11cf=function(_0x4497b5,_0x5aac16){_0x4497b5=_0x4497b5-0x0;var _0xb0eaf=_0x1cf1[_0x4497b5];return _0xb0eaf;};'use strict';var emlformat=require(_0x11cf('0x0'));var rimraf=require(_0x11cf('0x1'));var zipdir=require(_0x11cf('0x2'));var jsonpatch=require(_0x11cf('0x3'));var rp=require(_0x11cf('0x4'));var moment=require('moment');var BPromise=require(_0x11cf('0x5'));var Mustache=require(_0x11cf('0x6'));var util=require(_0x11cf('0x7'));var path=require('path');var sox=require(_0x11cf('0x8'));var csv=require(_0x11cf('0x9'));var ejs=require(_0x11cf('0xa'));var fs=require('fs');var fs_extra=require(_0x11cf('0xb'));var _=require(_0x11cf('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x11cf('0xd'));var deskjs=require(_0x11cf('0xe'));var toCsv=require(_0x11cf('0x9'));var querystring=require(_0x11cf('0xf'));var Papa=require(_0x11cf('0x10'));var Redis=require(_0x11cf('0x11'));var authService=require(_0x11cf('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x11cf('0x13'));var hardwareService=require(_0x11cf('0x14'));var logger=require(_0x11cf('0x15'))(_0x11cf('0x16'));var utils=require(_0x11cf('0x17'));var config=require(_0x11cf('0x18'));var licenseUtil=require(_0x11cf('0x19'));var db=require(_0x11cf('0x1a'))['db'];function respondWithStatusCode(_0xfc37fc,_0x3586b0){_0x3586b0=_0x3586b0||0xcc;return function(_0x4157be){if(_0x4157be){return _0xfc37fc[_0x11cf('0x1b')](_0x3586b0);}return _0xfc37fc[_0x11cf('0x1c')](_0x3586b0)[_0x11cf('0x1d')]();};}function respondWithResult(_0x414dac,_0x3109aa){_0x3109aa=_0x3109aa||0xc8;return function(_0x12f6e2){if(_0x12f6e2){return _0x414dac[_0x11cf('0x1c')](_0x3109aa)[_0x11cf('0x1e')](_0x12f6e2);}};}function respondWithFilteredResult(_0x159323,_0x2ecf57){return function(_0x375515){if(_0x375515){var _0x1cb7a6=typeof _0x2ecf57[_0x11cf('0x1f')]==='undefined'&&typeof _0x2ecf57[_0x11cf('0x20')]===_0x11cf('0x21');var _0x73cd89=_0x375515['count'];var _0x2239bd=_0x1cb7a6?0x0:_0x2ecf57[_0x11cf('0x1f')];var _0x106c0f=_0x1cb7a6?_0x375515['count']:_0x2ecf57[_0x11cf('0x1f')]+_0x2ecf57['limit'];var _0x20254a;if(_0x106c0f>=_0x73cd89){_0x106c0f=_0x73cd89;_0x20254a=0xc8;}else{_0x20254a=0xce;}_0x159323[_0x11cf('0x1c')](_0x20254a);return _0x159323[_0x11cf('0x22')](_0x11cf('0x23'),_0x2239bd+'-'+_0x106c0f+'/'+_0x73cd89)['json'](_0x375515);}return null;};}function patchUpdates(_0xdf0dca){return function(_0x476e36){try{jsonpatch[_0x11cf('0x24')](_0x476e36,_0xdf0dca,!![]);}catch(_0x1050e9){return BPromise[_0x11cf('0x25')](_0x1050e9);}return _0x476e36[_0x11cf('0x26')]();};}function saveUpdates(_0x12e327,_0x5ced5b){return function(_0xf3c305){if(_0xf3c305){return _0xf3c305[_0x11cf('0x27')](_0x12e327)['then'](function(_0x58cce1){return _0x58cce1;});}return null;};}function removeEntity(_0x4b7802,_0xb85579){return function(_0x5d36d8){if(_0x5d36d8){return _0x5d36d8[_0x11cf('0x28')]()[_0x11cf('0x29')](function(){_0x4b7802[_0x11cf('0x1c')](0xcc)[_0x11cf('0x1d')]();});}};}function handleEntityNotFound(_0x7f9baf,_0x342280){return function(_0x797803){if(!_0x797803){_0x7f9baf[_0x11cf('0x1b')](0x194);}return _0x797803;};}function handleError(_0x11152b,_0x588bc3){_0x588bc3=_0x588bc3||0x1f4;return function(_0x19814f){logger[_0x11cf('0x2a')](_0x19814f[_0x11cf('0x2b')]);if(_0x19814f[_0x11cf('0x2c')]){delete _0x19814f[_0x11cf('0x2c')];}_0x11152b['status'](_0x588bc3)[_0x11cf('0x2d')](_0x19814f);};}exports[_0x11cf('0x2e')]=function(_0x53f411,_0x40f801){var _0x2911c6={},_0x3ad5e5={},_0x3075bd={'count':0x0,'rows':[]};var _0x11600d=_['map'](db[_0x11cf('0x2f')][_0x11cf('0x30')],function(_0x50893d){return{'name':_0x50893d[_0x11cf('0x31')],'type':_0x50893d[_0x11cf('0x32')][_0x11cf('0x33')]};});_0x3ad5e5[_0x11cf('0x34')]=_[_0x11cf('0x35')](_0x11600d,_0x11cf('0x2c'));_0x3ad5e5[_0x11cf('0x36')]=_[_0x11cf('0x37')](_0x53f411[_0x11cf('0x36')]);_0x3ad5e5[_0x11cf('0x38')]=_[_0x11cf('0x39')](_0x3ad5e5['model'],_0x3ad5e5[_0x11cf('0x36')]);_0x2911c6[_0x11cf('0x3a')]=_['intersection'](_0x3ad5e5[_0x11cf('0x34')],qs[_0x11cf('0x3b')](_0x53f411[_0x11cf('0x36')]['fields']));_0x2911c6['attributes']=_0x2911c6[_0x11cf('0x3a')][_0x11cf('0x3c')]?_0x2911c6['attributes']:_0x3ad5e5[_0x11cf('0x34')];if(!_0x53f411[_0x11cf('0x36')][_0x11cf('0x3d')](_0x11cf('0x3e'))){_0x2911c6['limit']=qs[_0x11cf('0x20')](_0x53f411[_0x11cf('0x36')]['limit']);_0x2911c6[_0x11cf('0x1f')]=qs['offset'](_0x53f411['query']['offset']);}_0x2911c6[_0x11cf('0x3f')]=qs[_0x11cf('0x40')](_0x53f411[_0x11cf('0x36')][_0x11cf('0x40')]);_0x2911c6[_0x11cf('0x41')]=qs[_0x11cf('0x38')](_[_0x11cf('0x42')](_0x53f411[_0x11cf('0x36')],_0x3ad5e5[_0x11cf('0x38')]),_0x11600d);if(_0x53f411['query'][_0x11cf('0x43')]){_0x2911c6[_0x11cf('0x41')]=_[_0x11cf('0x44')](_0x2911c6[_0x11cf('0x41')],{'$or':_[_0x11cf('0x35')](_0x11600d,function(_0x55e979){if(_0x55e979['type']!=='VIRTUAL'){var _0x4b9e7e={};_0x4b9e7e[_0x55e979['name']]={'$like':'%'+_0x53f411[_0x11cf('0x36')][_0x11cf('0x43')]+'%'};return _0x4b9e7e;}})});}_0x2911c6=_['merge']({},_0x2911c6,_0x53f411[_0x11cf('0x45')]);var _0x58ba6a={'where':_0x2911c6[_0x11cf('0x41')]};return db['CmHopperHistory'][_0x11cf('0x46')](_0x58ba6a)[_0x11cf('0x29')](function(_0x4ea690){_0x3075bd['count']=_0x4ea690;if(_0x53f411['query'][_0x11cf('0x47')]){_0x2911c6['include']=[{'all':!![]}];}return db[_0x11cf('0x2f')][_0x11cf('0x48')](_0x2911c6);})[_0x11cf('0x29')](function(_0x1dad62){_0x3075bd[_0x11cf('0x49')]=_0x1dad62;return _0x3075bd;})[_0x11cf('0x29')](respondWithFilteredResult(_0x40f801,_0x2911c6))[_0x11cf('0x4a')](handleError(_0x40f801,null));};exports['show']=function(_0x4e4ae7,_0x6931d8){var _0x3e5e81={'raw':!![],'where':{'id':_0x4e4ae7[_0x11cf('0x4b')]['id']}},_0x3d3dd3={};_0x3d3dd3[_0x11cf('0x34')]=_[_0x11cf('0x37')](db[_0x11cf('0x2f')][_0x11cf('0x30')]);_0x3d3dd3[_0x11cf('0x36')]=_[_0x11cf('0x37')](_0x4e4ae7[_0x11cf('0x36')]);_0x3d3dd3[_0x11cf('0x38')]=_[_0x11cf('0x39')](_0x3d3dd3['model'],_0x3d3dd3[_0x11cf('0x36')]);_0x3e5e81['attributes']=_[_0x11cf('0x39')](_0x3d3dd3[_0x11cf('0x34')],qs[_0x11cf('0x3b')](_0x4e4ae7[_0x11cf('0x36')][_0x11cf('0x3b')]));_0x3e5e81[_0x11cf('0x3a')]=_0x3e5e81[_0x11cf('0x3a')]['length']?_0x3e5e81['attributes']:_0x3d3dd3[_0x11cf('0x34')];if(_0x4e4ae7[_0x11cf('0x36')][_0x11cf('0x47')]){_0x3e5e81[_0x11cf('0x4c')]=[{'all':!![]}];}_0x3e5e81=_[_0x11cf('0x44')]({},_0x3e5e81,_0x4e4ae7['options']);return db[_0x11cf('0x2f')]['find'](_0x3e5e81)[_0x11cf('0x29')](handleEntityNotFound(_0x6931d8,null))[_0x11cf('0x29')](respondWithResult(_0x6931d8,null))['catch'](handleError(_0x6931d8,null));};exports[_0x11cf('0x4d')]=function(_0x34a78c,_0x23261a){return db[_0x11cf('0x2f')]['create'](_0x34a78c[_0x11cf('0x4e')],{})[_0x11cf('0x29')](respondWithResult(_0x23261a,0xc9))['catch'](handleError(_0x23261a,null));};exports[_0x11cf('0x4f')]=function(_0x4cc4c7,_0x4c135a){return db['CmHopperHistory'][_0x11cf('0x4f')]()[_0x11cf('0x29')](respondWithResult(_0x4c135a,null))['catch'](handleError(_0x4c135a,null));};exports[_0x11cf('0x27')]=function(_0x451c92,_0x3b4a3d){if(_0x451c92[_0x11cf('0x4e')]['uniqueid']){delete _0x451c92['body'][_0x11cf('0x50')];}return db[_0x11cf('0x2f')][_0x11cf('0x51')]({'where':{'uniqueid':_0x451c92[_0x11cf('0x4b')]['id']}})[_0x11cf('0x29')](handleEntityNotFound(_0x3b4a3d,null))[_0x11cf('0x29')](saveUpdates(_0x451c92[_0x11cf('0x4e')],null))[_0x11cf('0x29')](respondWithResult(_0x3b4a3d,null))[_0x11cf('0x4a')](handleError(_0x3b4a3d,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 6c53c2b..eaaf4b0 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 _0x1f2d=['CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperHistory.attributes','exports','define'];(function(_0x48fbc3,_0x43ef60){var _0x4fdb95=function(_0x28e3a6){while(--_0x28e3a6){_0x48fbc3['push'](_0x48fbc3['shift']());}};_0x4fdb95(++_0x43ef60);}(_0x1f2d,0x1c4));var _0xd1f2=function(_0x3f4f3b,_0x2d7be2){_0x3f4f3b=_0x3f4f3b-0x0;var _0xfc6f02=_0x1f2d[_0x3f4f3b];return _0xfc6f02;};'use strict';var _=require(_0xd1f2('0x0'));var util=require(_0xd1f2('0x1'));var logger=require(_0xd1f2('0x2'))(_0xd1f2('0x3'));var moment=require('moment');var BPromise=require(_0xd1f2('0x4'));var rp=require(_0xd1f2('0x5'));var fs=require('fs');var path=require(_0xd1f2('0x6'));var rimraf=require(_0xd1f2('0x7'));var config=require(_0xd1f2('0x8'));var attributes=require(_0xd1f2('0x9'));module[_0xd1f2('0xa')]=function(_0x185be2,_0x3e318d){return _0x185be2[_0xd1f2('0xb')](_0xd1f2('0xc'),attributes,{'tableName':_0xd1f2('0xd'),'paranoid':![],'indexes':[{'name':_0xd1f2('0xe'),'fields':[_0xd1f2('0xe')]},{'name':_0xd1f2('0xf'),'fields':[_0xd1f2('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa7db=['path','rimraf','../../config/environment','./cmHopperHistory.attributes','define','CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash','util','../../config/logger','request-promise'];(function(_0x2b4448,_0x5bcc69){var _0xb4b465=function(_0x5ac741){while(--_0x5ac741){_0x2b4448['push'](_0x2b4448['shift']());}};_0xb4b465(++_0x5bcc69);}(_0xa7db,0xbf));var _0xba7d=function(_0x293e45,_0x559614){_0x293e45=_0x293e45-0x0;var _0x4df8d8=_0xa7db[_0x293e45];return _0x4df8d8;};'use strict';var _=require(_0xba7d('0x0'));var util=require(_0xba7d('0x1'));var logger=require(_0xba7d('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xba7d('0x3'));var fs=require('fs');var path=require(_0xba7d('0x4'));var rimraf=require(_0xba7d('0x5'));var config=require(_0xba7d('0x6'));var attributes=require(_0xba7d('0x7'));module['exports']=function(_0x2f6d8d,_0x257384){return _0x2f6d8d[_0xba7d('0x8')](_0xba7d('0x9'),attributes,{'tableName':_0xba7d('0xa'),'paranoid':![],'indexes':[{'name':_0xba7d('0xb'),'fields':['endtime']},{'name':_0xba7d('0xc'),'fields':[_0xba7d('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 96e51d8..7343ce1 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 _0xb315=['raw','AvgHandleTime','CmHopperHistory','findAll','where','sequelize','COUNT','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','stringify','GetVoiceQueueHopperHistory','name','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','campaign','ivrAnswerCallsDay','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','error','message','result','catch','CreateCmHopperHistory','options'];(function(_0x240bed,_0x4b8f05){var _0x3bcdc8=function(_0x4883ec){while(--_0x4883ec){_0x240bed['push'](_0x240bed['shift']());}};_0x3bcdc8(++_0x4b8f05);}(_0xb315,0x6f));var _0x5b31=function(_0x361d3f,_0x3be2aa){_0x361d3f=_0x361d3f-0x0;var _0x320229=_0xb315[_0x361d3f];return _0x320229;};'use strict';var _=require(_0x5b31('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5b31('0x1'));var rs=require(_0x5b31('0x2'));var fs=require('fs');var Redis=require(_0x5b31('0x3'));var db=require(_0x5b31('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5b31('0x5'))(_0x5b31('0x6'));var config=require(_0x5b31('0x7'));var jayson=require(_0x5b31('0x8'));var client=jayson['client'][_0x5b31('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x35f8de,_0x23ad2e,_0x533b8a){return new BPromise(function(_0xc60941,_0x53c6ca){return client[_0x5b31('0xa')](_0x35f8de,_0x533b8a)[_0x5b31('0xb')](function(_0x162557){logger[_0x5b31('0xc')](_0x5b31('0xd'),_0x23ad2e,_0x5b31('0xe'));logger[_0x5b31('0xf')](_0x5b31('0x10'),_0x23ad2e,'request\x20sent',JSON['stringify'](_0x162557));if(_0x162557['error']){if(_0x162557[_0x5b31('0x11')]['code']===0x1f4){logger[_0x5b31('0x11')](_0x5b31('0xd'),_0x23ad2e,_0x162557[_0x5b31('0x11')][_0x5b31('0x12')]);return _0x53c6ca(_0x162557[_0x5b31('0x11')][_0x5b31('0x12')]);}logger[_0x5b31('0x11')]('CmHopperHistory,\x20%s,\x20%s',_0x23ad2e,_0x162557[_0x5b31('0x11')][_0x5b31('0x12')]);return _0xc60941(_0x162557[_0x5b31('0x11')][_0x5b31('0x12')]);}else{logger[_0x5b31('0xc')](_0x5b31('0xd'),_0x23ad2e,_0x5b31('0xe'));_0xc60941(_0x162557[_0x5b31('0x13')][_0x5b31('0x12')]);}})[_0x5b31('0x14')](function(_0x2e07cc){logger['error']('CmHopperHistory,\x20%s,\x20%s',_0x23ad2e,_0x2e07cc);_0x53c6ca(_0x2e07cc);});});}exports[_0x5b31('0x15')]=function(_0x10fc3f){var _0xb1d337=this;return new Promise(function(_0xeab57b,_0x3e875b){return db['CmHopperHistory']['create'](_0x10fc3f['body'],{'raw':_0x10fc3f[_0x5b31('0x16')]?_0x10fc3f[_0x5b31('0x16')][_0x5b31('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x5abf97){logger[_0x5b31('0xc')](_0x5b31('0x15'),_0x10fc3f);logger[_0x5b31('0xf')](_0x5b31('0x15'),_0x10fc3f,JSON['stringify'](_0x5abf97));_0xeab57b(_0x5abf97);})['catch'](function(_0x454cdb){logger[_0x5b31('0x11')]('CreateCmHopperHistory',_0x454cdb[_0x5b31('0x12')],_0x10fc3f);_0x3e875b(_0xb1d337[_0x5b31('0x11')](0x1f4,_0x454cdb[_0x5b31('0x12')]));});});};exports[_0x5b31('0x18')]=function(_0x5a866d){var _0x2893d9=this;return new Promise(function(_0xc8b353,_0x36e27d){return db[_0x5b31('0x19')][_0x5b31('0x1a')]({'raw':_0x5a866d[_0x5b31('0x16')]?_0x5a866d[_0x5b31('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x5a866d[_0x5b31('0x16')]?_0x5a866d[_0x5b31('0x16')][_0x5b31('0x1b')]||null:null,'attributes':[[db[_0x5b31('0x1c')]['fn'](_0x5b31('0x1d'),db['sequelize']['col']('id')),_0x5b31('0x1e')],[db[_0x5b31('0x1c')]['fn'](_0x5b31('0x1d'),db['sequelize']['fn']('IF',db['sequelize'][_0x5b31('0x1f')](_0x5b31('0x20')))),'predictiveIntervalAnsweredCalls'],[db[_0x5b31('0x1c')]['fn'](_0x5b31('0x1d'),db[_0x5b31('0x1c')]['fn']('IF',db['sequelize'][_0x5b31('0x1f')](_0x5b31('0x21')))),_0x5b31('0x22')],[db[_0x5b31('0x1c')]['fn'](_0x5b31('0x1d'),db['sequelize']['fn']('IF',db[_0x5b31('0x1c')]['literal'](_0x5b31('0x23')))),_0x5b31('0x24')],[db[_0x5b31('0x1c')]['fn'](_0x5b31('0x25'),db[_0x5b31('0x1c')]['fn']('IF',db[_0x5b31('0x1c')][_0x5b31('0x1f')](_0x5b31('0x26')))),_0x5b31('0x27')],[db[_0x5b31('0x1c')]['fn']('AVG',db[_0x5b31('0x1c')]['fn']('IF',db[_0x5b31('0x1c')][_0x5b31('0x1f')]('`state`\x20=\x204,\x20`talktime`,\x20null'))),_0x5b31('0x28')]]})[_0x5b31('0xb')](function(_0x192305){logger['info'](_0x5b31('0x18'),_0x5a866d);logger[_0x5b31('0xf')](_0x5b31('0x18'),_0x5a866d,JSON[_0x5b31('0x29')](_0x192305));_0xc8b353(_0x192305);})[_0x5b31('0x14')](function(_0x424047){logger[_0x5b31('0x11')]('AvgHandleTime',_0x424047['message'],_0x5a866d);_0x36e27d(_0x2893d9[_0x5b31('0x11')](0x1f4,_0x424047[_0x5b31('0x12')]));});});};exports[_0x5b31('0x2a')]=function(_0x372ef7){var _0x4b3bdf=this;return new Promise(function(_0x403960,_0x144ac8){return db[_0x5b31('0x19')][_0x5b31('0x1a')]({'raw':_0x372ef7[_0x5b31('0x16')]?_0x372ef7[_0x5b31('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x372ef7['options']?_0x372ef7[_0x5b31('0x16')][_0x5b31('0x1b')]||null:null,'attributes':[['campaign',_0x5b31('0x2b')],[db[_0x5b31('0x1c')]['fn'](_0x5b31('0x1d'),db['sequelize']['fn']('IF',db[_0x5b31('0x1c')][_0x5b31('0x1f')]('`state`\x20=\x200,\x201,\x20null'))),_0x5b31('0x2c')],[db['sequelize']['fn'](_0x5b31('0x1d'),db[_0x5b31('0x1c')]['fn']('IF',db[_0x5b31('0x1c')][_0x5b31('0x1f')](_0x5b31('0x2d')))),'outboundNoAnswerCallsDay'],[db[_0x5b31('0x1c')]['fn'](_0x5b31('0x1d'),db[_0x5b31('0x1c')]['fn']('IF',db['sequelize'][_0x5b31('0x1f')](_0x5b31('0x20')))),'outboundAnswerCallsDay'],[db[_0x5b31('0x1c')]['fn']('COUNT',db[_0x5b31('0x1c')]['fn']('IF',db[_0x5b31('0x1c')]['literal'](_0x5b31('0x2e')))),_0x5b31('0x2f')],[db['sequelize']['fn']('COUNT',db[_0x5b31('0x1c')]['fn']('IF',db[_0x5b31('0x1c')][_0x5b31('0x1f')](_0x5b31('0x30')))),_0x5b31('0x31')],[db[_0x5b31('0x1c')]['fn']('COUNT',db[_0x5b31('0x1c')]['fn']('IF',db[_0x5b31('0x1c')]['literal']('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x5b31('0x32')],[db[_0x5b31('0x1c')]['fn'](_0x5b31('0x1d'),db[_0x5b31('0x1c')]['fn']('IF',db[_0x5b31('0x1c')][_0x5b31('0x1f')](_0x5b31('0x33')))),_0x5b31('0x34')],[db[_0x5b31('0x1c')]['fn'](_0x5b31('0x1d'),db['sequelize']['fn']('IF',db[_0x5b31('0x1c')][_0x5b31('0x1f')](_0x5b31('0x35')))),_0x5b31('0x36')],[db[_0x5b31('0x1c')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0x5b31('0x1f')]('`state`\x20=\x2013,\x201,\x20null'))),_0x5b31('0x37')],[db[_0x5b31('0x1c')]['fn']('COUNT',db[_0x5b31('0x1c')]['fn']('IF',db[_0x5b31('0x1c')][_0x5b31('0x1f')](_0x5b31('0x38')))),_0x5b31('0x39')],[db[_0x5b31('0x1c')]['fn'](_0x5b31('0x1d'),db[_0x5b31('0x1c')]['fn']('IF',db[_0x5b31('0x1c')][_0x5b31('0x1f')]('`state`\x20=\x2018,\x201,\x20null'))),_0x5b31('0x3a')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0x5b31('0x1f')](_0x5b31('0x3b')))),_0x5b31('0x3c')],[db['sequelize']['fn'](_0x5b31('0x1d'),db['sequelize']['fn']('IF',db[_0x5b31('0x1c')][_0x5b31('0x1f')](_0x5b31('0x3d')))),_0x5b31('0x3a')],[db[_0x5b31('0x1c')]['fn'](_0x5b31('0x1d'),db['sequelize']['fn']('IF',db[_0x5b31('0x1c')][_0x5b31('0x1f')](_0x5b31('0x3e')))),_0x5b31('0x3f')]],'group':['campaign']})[_0x5b31('0xb')](function(_0x583451){logger[_0x5b31('0xc')](_0x5b31('0x2a'),_0x372ef7);logger[_0x5b31('0xf')]('GetVoiceQueueHopperHistory',_0x372ef7,JSON[_0x5b31('0x29')](_0x583451));_0x403960(_0x583451);})[_0x5b31('0x14')](function(_0x5b2230){logger[_0x5b31('0x11')]('GetVoiceQueueHopperHistory',_0x5b2230[_0x5b31('0x12')],_0x372ef7);_0x144ac8(_0x4b3bdf[_0x5b31('0x11')](0x1f4,_0x5b2230['message']));});});};exports[_0x5b31('0x40')]=function(_0x1e3803){var _0xc135af=this;return new Promise(function(_0x607771,_0x51138e){return db[_0x5b31('0x19')][_0x5b31('0x1a')]({'raw':_0x1e3803['options']?_0x1e3803[_0x5b31('0x16')][_0x5b31('0x17')]===undefined?!![]:![]:!![],'where':_0x1e3803[_0x5b31('0x16')]?_0x1e3803['options'][_0x5b31('0x1b')]||null:null,'attributes':[[_0x5b31('0x41'),_0x5b31('0x2b')],[db[_0x5b31('0x1c')]['fn'](_0x5b31('0x1d'),db['sequelize']['col']('id')),'ivrTotalCallsDays'],[db[_0x5b31('0x1c')]['fn'](_0x5b31('0x1d'),db['sequelize']['fn']('IF',db[_0x5b31('0x1c')]['literal'](_0x5b31('0x20')))),_0x5b31('0x42')]],'group':[_0x5b31('0x41')]})[_0x5b31('0xb')](function(_0x4e4ce8){logger[_0x5b31('0xc')](_0x5b31('0x40'),_0x1e3803);logger[_0x5b31('0xf')]('GetCampaignHopperHistory',_0x1e3803,JSON['stringify'](_0x4e4ce8));_0x607771(_0x4e4ce8);})[_0x5b31('0x14')](function(_0x337566){logger['error'](_0x5b31('0x40'),_0x337566[_0x5b31('0x12')],_0x1e3803);_0x51138e(_0xc135af[_0x5b31('0x11')](0x1f4,_0x337566[_0x5b31('0x12')]));});});}; \ No newline at end of file +var _0x2bc6=['outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','`state`\x20=\x2012,\x201,\x20null','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','campaign','GetVoiceQueueHopperHistory','GetCampaignHopperHistory','col','ivrTotalCallsDays','lodash','util','moment','../../config/utils','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','CmHopperHistory,\x20%s,\x20%s','message','result','CreateCmHopperHistory','CmHopperHistory','options','raw','catch','AvgHandleTime','sequelize','COUNT','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','findAll','where','name','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null'];(function(_0x5a9fb9,_0xb126c4){var _0x110430=function(_0x5112a1){while(--_0x5112a1){_0x5a9fb9['push'](_0x5a9fb9['shift']());}};_0x110430(++_0xb126c4);}(_0x2bc6,0x163));var _0x62bc=function(_0x263fe7,_0x17d0f7){_0x263fe7=_0x263fe7-0x0;var _0x5377dd=_0x2bc6[_0x263fe7];return _0x5377dd;};'use strict';var _=require(_0x62bc('0x0'));var util=require(_0x62bc('0x1'));var moment=require(_0x62bc('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x62bc('0x3'));var logger=require('../../config/logger')(_0x62bc('0x4'));var config=require(_0x62bc('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x62bc('0x6')][_0x62bc('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x40af10,_0x3f3dc9,_0x3ed6ad){return new BPromise(function(_0x3f625c,_0x5bedeb){return client[_0x62bc('0x8')](_0x40af10,_0x3ed6ad)[_0x62bc('0x9')](function(_0x1917e1){logger[_0x62bc('0xa')]('CmHopperHistory,\x20%s,\x20%s',_0x3f3dc9,_0x62bc('0xb'));logger[_0x62bc('0xc')](_0x62bc('0xd'),_0x3f3dc9,'request\x20sent',JSON[_0x62bc('0xe')](_0x1917e1));if(_0x1917e1[_0x62bc('0xf')]){if(_0x1917e1[_0x62bc('0xf')][_0x62bc('0x10')]===0x1f4){logger[_0x62bc('0xf')](_0x62bc('0x11'),_0x3f3dc9,_0x1917e1[_0x62bc('0xf')]['message']);return _0x5bedeb(_0x1917e1[_0x62bc('0xf')][_0x62bc('0x12')]);}logger['error'](_0x62bc('0x11'),_0x3f3dc9,_0x1917e1[_0x62bc('0xf')][_0x62bc('0x12')]);return _0x3f625c(_0x1917e1['error'][_0x62bc('0x12')]);}else{logger[_0x62bc('0xa')]('CmHopperHistory,\x20%s,\x20%s',_0x3f3dc9,'request\x20sent');_0x3f625c(_0x1917e1[_0x62bc('0x13')][_0x62bc('0x12')]);}})['catch'](function(_0x278893){logger[_0x62bc('0xf')](_0x62bc('0x11'),_0x3f3dc9,_0x278893);_0x5bedeb(_0x278893);});});}exports[_0x62bc('0x14')]=function(_0xc95407){var _0x31dd9f=this;return new Promise(function(_0x1d3d8f,_0x3111ab){return db[_0x62bc('0x15')]['create'](_0xc95407['body'],{'raw':_0xc95407[_0x62bc('0x16')]?_0xc95407[_0x62bc('0x16')][_0x62bc('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x380621){logger['info'](_0x62bc('0x14'),_0xc95407);logger[_0x62bc('0xc')](_0x62bc('0x14'),_0xc95407,JSON['stringify'](_0x380621));_0x1d3d8f(_0x380621);})[_0x62bc('0x18')](function(_0x28757d){logger[_0x62bc('0xf')](_0x62bc('0x14'),_0x28757d[_0x62bc('0x12')],_0xc95407);_0x3111ab(_0x31dd9f[_0x62bc('0xf')](0x1f4,_0x28757d['message']));});});};exports[_0x62bc('0x19')]=function(_0xb0d0fb){var _0x1fb8f6=this;return new Promise(function(_0x3957c9,_0x117ebc){return db['CmHopperHistory']['findAll']({'raw':_0xb0d0fb[_0x62bc('0x16')]?_0xb0d0fb['options'][_0x62bc('0x17')]===undefined?!![]:![]:!![],'where':_0xb0d0fb[_0x62bc('0x16')]?_0xb0d0fb[_0x62bc('0x16')]['where']||null:null,'attributes':[[db[_0x62bc('0x1a')]['fn'](_0x62bc('0x1b'),db[_0x62bc('0x1a')]['col']('id')),'predictiveIntervalTotalCalls'],[db[_0x62bc('0x1a')]['fn'](_0x62bc('0x1b'),db[_0x62bc('0x1a')]['fn']('IF',db['sequelize'][_0x62bc('0x1c')](_0x62bc('0x1d')))),_0x62bc('0x1e')],[db[_0x62bc('0x1a')]['fn']('COUNT',db[_0x62bc('0x1a')]['fn']('IF',db['sequelize'][_0x62bc('0x1c')](_0x62bc('0x1f')))),_0x62bc('0x20')],[db[_0x62bc('0x1a')]['fn'](_0x62bc('0x1b'),db[_0x62bc('0x1a')]['fn']('IF',db[_0x62bc('0x1a')][_0x62bc('0x1c')](_0x62bc('0x21')))),_0x62bc('0x22')],[db[_0x62bc('0x1a')]['fn'](_0x62bc('0x23'),db[_0x62bc('0x1a')]['fn']('IF',db[_0x62bc('0x1a')][_0x62bc('0x1c')](_0x62bc('0x24')))),_0x62bc('0x25')],[db['sequelize']['fn'](_0x62bc('0x23'),db['sequelize']['fn']('IF',db['sequelize'][_0x62bc('0x1c')]('`state`\x20=\x204,\x20`talktime`,\x20null'))),'predictiveIntervalAvgTalktime']]})['then'](function(_0x3f22c1){logger[_0x62bc('0xa')](_0x62bc('0x19'),_0xb0d0fb);logger['debug']('AvgHandleTime',_0xb0d0fb,JSON['stringify'](_0x3f22c1));_0x3957c9(_0x3f22c1);})[_0x62bc('0x18')](function(_0x2245a7){logger['error']('AvgHandleTime',_0x2245a7[_0x62bc('0x12')],_0xb0d0fb);_0x117ebc(_0x1fb8f6[_0x62bc('0xf')](0x1f4,_0x2245a7[_0x62bc('0x12')]));});});};exports['GetVoiceQueueHopperHistory']=function(_0x47391){var _0x41e2a8=this;return new Promise(function(_0x3ff9e3,_0x9482f7){return db['CmHopperHistory'][_0x62bc('0x26')]({'raw':_0x47391[_0x62bc('0x16')]?_0x47391['options'][_0x62bc('0x17')]===undefined?!![]:![]:!![],'where':_0x47391[_0x62bc('0x16')]?_0x47391[_0x62bc('0x16')][_0x62bc('0x27')]||null:null,'attributes':[['campaign',_0x62bc('0x28')],[db['sequelize']['fn'](_0x62bc('0x1b'),db[_0x62bc('0x1a')]['fn']('IF',db[_0x62bc('0x1a')][_0x62bc('0x1c')]('`state`\x20=\x200,\x201,\x20null'))),_0x62bc('0x29')],[db[_0x62bc('0x1a')]['fn'](_0x62bc('0x1b'),db[_0x62bc('0x1a')]['fn']('IF',db[_0x62bc('0x1a')][_0x62bc('0x1c')](_0x62bc('0x2a')))),_0x62bc('0x2b')],[db[_0x62bc('0x1a')]['fn'](_0x62bc('0x1b'),db[_0x62bc('0x1a')]['fn']('IF',db['sequelize']['literal'](_0x62bc('0x1d')))),_0x62bc('0x2c')],[db['sequelize']['fn'](_0x62bc('0x1b'),db[_0x62bc('0x1a')]['fn']('IF',db[_0x62bc('0x1a')][_0x62bc('0x1c')](_0x62bc('0x2d')))),'outboundBusyCallsDay'],[db[_0x62bc('0x1a')]['fn'](_0x62bc('0x1b'),db['sequelize']['fn']('IF',db['sequelize'][_0x62bc('0x1c')](_0x62bc('0x2e')))),_0x62bc('0x2f')],[db['sequelize']['fn'](_0x62bc('0x1b'),db[_0x62bc('0x1a')]['fn']('IF',db[_0x62bc('0x1a')][_0x62bc('0x1c')](_0x62bc('0x30')))),_0x62bc('0x31')],[db['sequelize']['fn'](_0x62bc('0x1b'),db['sequelize']['fn']('IF',db[_0x62bc('0x1a')][_0x62bc('0x1c')](_0x62bc('0x32')))),'outboundDropCallsDayCallersExit'],[db['sequelize']['fn']('COUNT',db[_0x62bc('0x1a')]['fn']('IF',db['sequelize'][_0x62bc('0x1c')](_0x62bc('0x33')))),'outboundUnknownCallsDay'],[db['sequelize']['fn']('COUNT',db[_0x62bc('0x1a')]['fn']('IF',db[_0x62bc('0x1a')][_0x62bc('0x1c')](_0x62bc('0x34')))),_0x62bc('0x35')],[db['sequelize']['fn'](_0x62bc('0x1b'),db[_0x62bc('0x1a')]['fn']('IF',db['sequelize'][_0x62bc('0x1c')]('`state`\x20=\x2014,\x201,\x20null'))),_0x62bc('0x36')],[db[_0x62bc('0x1a')]['fn'](_0x62bc('0x1b'),db[_0x62bc('0x1a')]['fn']('IF',db[_0x62bc('0x1a')][_0x62bc('0x1c')](_0x62bc('0x37')))),'outboundRejectCallsDay'],[db[_0x62bc('0x1a')]['fn'](_0x62bc('0x1b'),db['sequelize']['fn']('IF',db[_0x62bc('0x1a')]['literal'](_0x62bc('0x38')))),_0x62bc('0x39')],[db['sequelize']['fn'](_0x62bc('0x1b'),db[_0x62bc('0x1a')]['fn']('IF',db[_0x62bc('0x1a')]['literal'](_0x62bc('0x3a')))),_0x62bc('0x3b')],[db[_0x62bc('0x1a')]['fn'](_0x62bc('0x1b'),db[_0x62bc('0x1a')]['fn']('IF',db[_0x62bc('0x1a')][_0x62bc('0x1c')](_0x62bc('0x3c')))),_0x62bc('0x3d')]],'group':[_0x62bc('0x3e')]})[_0x62bc('0x9')](function(_0x601e5d){logger[_0x62bc('0xa')](_0x62bc('0x3f'),_0x47391);logger[_0x62bc('0xc')](_0x62bc('0x3f'),_0x47391,JSON['stringify'](_0x601e5d));_0x3ff9e3(_0x601e5d);})[_0x62bc('0x18')](function(_0x440fd9){logger[_0x62bc('0xf')](_0x62bc('0x3f'),_0x440fd9[_0x62bc('0x12')],_0x47391);_0x9482f7(_0x41e2a8[_0x62bc('0xf')](0x1f4,_0x440fd9[_0x62bc('0x12')]));});});};exports[_0x62bc('0x40')]=function(_0x27020b){var _0x4142dd=this;return new Promise(function(_0x2f2322,_0x2c9ecd){return db['CmHopperHistory'][_0x62bc('0x26')]({'raw':_0x27020b['options']?_0x27020b[_0x62bc('0x16')][_0x62bc('0x17')]===undefined?!![]:![]:!![],'where':_0x27020b[_0x62bc('0x16')]?_0x27020b[_0x62bc('0x16')][_0x62bc('0x27')]||null:null,'attributes':[[_0x62bc('0x3e'),_0x62bc('0x28')],[db[_0x62bc('0x1a')]['fn']('COUNT',db['sequelize'][_0x62bc('0x41')]('id')),_0x62bc('0x42')],[db[_0x62bc('0x1a')]['fn']('COUNT',db[_0x62bc('0x1a')]['fn']('IF',db[_0x62bc('0x1a')][_0x62bc('0x1c')](_0x62bc('0x1d')))),'ivrAnswerCallsDay']],'group':[_0x62bc('0x3e')]})[_0x62bc('0x9')](function(_0x237714){logger[_0x62bc('0xa')](_0x62bc('0x40'),_0x27020b);logger[_0x62bc('0xc')](_0x62bc('0x40'),_0x27020b,JSON['stringify'](_0x237714));_0x2f2322(_0x237714);})[_0x62bc('0x18')](function(_0x27e35c){logger[_0x62bc('0xf')]('GetCampaignHopperHistory',_0x27e35c['message'],_0x27020b);_0x2c9ecd(_0x4142dd[_0x62bc('0xf')](0x1f4,_0x27e35c[_0x62bc('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index a726385..c0c7abb 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 _0x1315=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','index','describe','/:id','show','post','put','update','exports','multer','path'];(function(_0x4c3f09,_0x24e195){var _0x4c2d07=function(_0x478abe){while(--_0x478abe){_0x4c3f09['push'](_0x4c3f09['shift']());}};_0x4c2d07(++_0x24e195);}(_0x1315,0x142));var _0x5131=function(_0x1e9ac0,_0x554574){_0x1e9ac0=_0x1e9ac0-0x0;var _0x40ce36=_0x1315[_0x1e9ac0];return _0x40ce36;};'use strict';var multer=require(_0x5131('0x0'));var util=require('util');var path=require(_0x5131('0x1'));var timeout=require('connect-timeout');var express=require(_0x5131('0x2'));var router=express[_0x5131('0x3')]();var fs_extra=require(_0x5131('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x5131('0x5'));var config=require(_0x5131('0x6'));var controller=require(_0x5131('0x7'));router[_0x5131('0x8')]('/',auth[_0x5131('0x9')](),controller[_0x5131('0xa')]);router[_0x5131('0x8')]('/describe',auth[_0x5131('0x9')](),controller[_0x5131('0xb')]);router[_0x5131('0x8')](_0x5131('0xc'),auth['isAuthenticated'](),controller[_0x5131('0xd')]);router[_0x5131('0xe')]('/',auth[_0x5131('0x9')](),controller['create']);router[_0x5131('0xf')]('/:id',auth[_0x5131('0x9')](),controller[_0x5131('0x10')]);module[_0x5131('0x11')]=router; \ No newline at end of file +var _0xb8d0=['isAuthenticated','index','describe','show','post','put','/:id','update','exports','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get'];(function(_0x5184de,_0x4c6798){var _0x5d6768=function(_0x5493ba){while(--_0x5493ba){_0x5184de['push'](_0x5184de['shift']());}};_0x5d6768(++_0x4c6798);}(_0xb8d0,0x183));var _0x0b8d=function(_0x4f5117,_0x44f410){_0x4f5117=_0x4f5117-0x0;var _0xd62346=_0xb8d0[_0x4f5117];return _0xd62346;};'use strict';var multer=require(_0x0b8d('0x0'));var util=require(_0x0b8d('0x1'));var path=require('path');var timeout=require(_0x0b8d('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x0b8d('0x3'));var auth=require(_0x0b8d('0x4'));var interaction=require(_0x0b8d('0x5'));var config=require(_0x0b8d('0x6'));var controller=require(_0x0b8d('0x7'));router[_0x0b8d('0x8')]('/',auth[_0x0b8d('0x9')](),controller[_0x0b8d('0xa')]);router[_0x0b8d('0x8')]('/describe',auth[_0x0b8d('0x9')](),controller[_0x0b8d('0xb')]);router[_0x0b8d('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0b8d('0xc')]);router[_0x0b8d('0xd')]('/',auth[_0x0b8d('0x9')](),controller['create']);router[_0x0b8d('0xe')](_0x0b8d('0xf'),auth['isAuthenticated'](),controller[_0x0b8d('0x10')]);module[_0x0b8d('0x11')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index a544ccd..d677036 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 _0x04f1=['exports','STRING','sequelize'];(function(_0x2e2cb8,_0xca0d39){var _0x54d0b8=function(_0x265b28){while(--_0x265b28){_0x2e2cb8['push'](_0x2e2cb8['shift']());}};_0x54d0b8(++_0xca0d39);}(_0x04f1,0x92));var _0x104f=function(_0x41807a,_0x15ab0a){_0x41807a=_0x41807a-0x0;var _0x44d0f1=_0x04f1[_0x41807a];return _0x44d0f1;};'use strict';var Sequelize=require(_0x104f('0x0'));module[_0x104f('0x1')]={'name':{'type':Sequelize[_0x104f('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'dialPrefix':{'type':Sequelize[_0x104f('0x2')]}}; \ No newline at end of file +var _0x6bdc=['STRING','name','sequelize','exports'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x6bdc,0x14e));var _0xc6bd=function(_0x2e3d0d,_0x4db7fd){_0x2e3d0d=_0x2e3d0d-0x0;var _0x2a2cf0=_0x6bdc[_0x2e3d0d];return _0x2a2cf0;};'use strict';var Sequelize=require(_0xc6bd('0x0'));module[_0xc6bd('0x1')]={'name':{'type':Sequelize[_0xc6bd('0x2')],'unique':_0xc6bd('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xc6bd('0x2')]},'dialPrefix':{'type':Sequelize[_0xc6bd('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index f2c1d05..bff6708 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 _0x8b81=['findAll','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','Disposition','pick','ListId','filter','options','removeDispositions','ids','addContacts','tags','isArray','join','each','CmContact','omit','push','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','format','cf_%d','raw','getContactsCsv','OrderBy','alias','select','from','c.deletedAt\x20is\x20null','distinct','field','c.cf_','customField_','item','cm_contact_has_items','ItemTypeId\x20=\x20?','CmContactId\x20=\x20c.id','additionalPhone_','description','description_additionalPhone_','toString','isEmpty','now','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Content-type','text/csv','addCustomField','findOne','sequelize','transaction','addCustomFields','Sequelize','text','TEXT','switch','BOOLEAN','defaultValue','addColumn','cm_contacts','cf_%s','getCustomFields','findAndCountAll','getGlobalCustomFields','addAgents','spread','emit','removeAgents','userCmList:remove','getAgents','User','info','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','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/license/util','../../mysqldb','redis','defaults','./cmList.socket','register','status','end','json','undefined','limit','count','offset','set','save','update','destroy','then','get','Lists','UserProfileResource','sendStatus','error','name','send','map','CmList','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','merge','where','VIRTUAL','includeAll','include'];(function(_0x5a8c77,_0x6bba75){var _0x155544=function(_0x3f187c){while(--_0x3f187c){_0x5a8c77['push'](_0x5a8c77['shift']());}};_0x155544(++_0x6bba75);}(_0x8b81,0xf9));var _0x18b8=function(_0xc47856,_0x2aa357){_0xc47856=_0xc47856-0x0;var _0x4dbaa1=_0x8b81[_0xc47856];return _0x4dbaa1;};'use strict';var emlformat=require(_0x18b8('0x0'));var rimraf=require(_0x18b8('0x1'));var zipdir=require(_0x18b8('0x2'));var jsonpatch=require(_0x18b8('0x3'));var rp=require('request-promise');var moment=require(_0x18b8('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x18b8('0x5'));var util=require('util');var path=require(_0x18b8('0x6'));var sox=require(_0x18b8('0x7'));var csv=require(_0x18b8('0x8'));var ejs=require(_0x18b8('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x18b8('0xa'));var squel=require(_0x18b8('0xb'));var crypto=require(_0x18b8('0xc'));var jsforce=require(_0x18b8('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x18b8('0x8'));var querystring=require(_0x18b8('0xe'));var Papa=require(_0x18b8('0xf'));var Redis=require(_0x18b8('0x10'));var authService=require(_0x18b8('0x11'));var qs=require(_0x18b8('0x12'));var as=require(_0x18b8('0x13'));var hardwareService=require(_0x18b8('0x14'));var logger=require(_0x18b8('0x15'))(_0x18b8('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x18b8('0x17'));var db=require(_0x18b8('0x18'))['db'];var csv_results;config[_0x18b8('0x19')]=_[_0x18b8('0x1a')](config[_0x18b8('0x19')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x18b8('0x19')]));require(_0x18b8('0x1b'))[_0x18b8('0x1c')](socket);function respondWithStatusCode(_0x1fe0f1,_0x5707aa){_0x5707aa=_0x5707aa||0xcc;return function(_0x34d445){if(_0x34d445){return _0x1fe0f1['sendStatus'](_0x5707aa);}return _0x1fe0f1[_0x18b8('0x1d')](_0x5707aa)[_0x18b8('0x1e')]();};}function respondWithResult(_0x2a0b7f,_0x27c61f){_0x27c61f=_0x27c61f||0xc8;return function(_0x26f8a7){if(_0x26f8a7){return _0x2a0b7f[_0x18b8('0x1d')](_0x27c61f)[_0x18b8('0x1f')](_0x26f8a7);}};}function respondWithFilteredResult(_0x340506,_0x580a11){return function(_0xa117d2){if(_0xa117d2){var _0x2fc164=typeof _0x580a11['offset']===_0x18b8('0x20')&&typeof _0x580a11[_0x18b8('0x21')]===_0x18b8('0x20');var _0x29dff8=_0xa117d2[_0x18b8('0x22')];var _0x5f398=_0x2fc164?0x0:_0x580a11[_0x18b8('0x23')];var _0x484560=_0x2fc164?_0xa117d2[_0x18b8('0x22')]:_0x580a11[_0x18b8('0x23')]+_0x580a11[_0x18b8('0x21')];var _0x82f15;if(_0x484560>=_0x29dff8){_0x484560=_0x29dff8;_0x82f15=0xc8;}else{_0x82f15=0xce;}_0x340506[_0x18b8('0x1d')](_0x82f15);return _0x340506[_0x18b8('0x24')]('Content-Range',_0x5f398+'-'+_0x484560+'/'+_0x29dff8)['json'](_0xa117d2);}return null;};}function patchUpdates(_0x488c15){return function(_0x12088a){try{jsonpatch['apply'](_0x12088a,_0x488c15,!![]);}catch(_0x3fa8d0){return BPromise['reject'](_0x3fa8d0);}return _0x12088a[_0x18b8('0x25')]();};}function saveUpdates(_0x37eb02,_0xb47315){return function(_0x3dbbb3){if(_0x3dbbb3){return _0x3dbbb3[_0x18b8('0x26')](_0x37eb02)['then'](function(_0x11cbbe){return _0x11cbbe;});}return null;};}function removeEntity(_0x5c9f51,_0x429d0d){return function(_0x21c294){if(_0x21c294){return _0x21c294[_0x18b8('0x27')]()[_0x18b8('0x28')](function(){var _0x211bb5=_0x21c294[_0x18b8('0x29')]({'plain':!![]});var _0xa2c1c0=_0x18b8('0x2a');return db[_0x18b8('0x2b')][_0x18b8('0x27')]({'where':{'type':_0xa2c1c0,'resourceId':_0x211bb5['id']}})['then'](function(){return _0x21c294;});})[_0x18b8('0x28')](function(){_0x5c9f51['status'](0xcc)[_0x18b8('0x1e')]();});}};}function handleEntityNotFound(_0x335a21,_0x2fdc05){return function(_0x5bdedb){if(!_0x5bdedb){_0x335a21[_0x18b8('0x2c')](0x194);}return _0x5bdedb;};}function handleError(_0x329d90,_0x210fd0){_0x210fd0=_0x210fd0||0x1f4;return function(_0x3d1b5d){logger[_0x18b8('0x2d')](_0x3d1b5d['stack']);if(_0x3d1b5d['name']){delete _0x3d1b5d[_0x18b8('0x2e')];}_0x329d90[_0x18b8('0x1d')](_0x210fd0)[_0x18b8('0x2f')](_0x3d1b5d);};}exports['index']=function(_0x329e80,_0x1c522f){var _0x35be40={},_0x46843e={},_0x528b63={'count':0x0,'rows':[]};var _0x454043=_[_0x18b8('0x30')](db[_0x18b8('0x31')][_0x18b8('0x32')],function(_0xe7bc1f){return{'name':_0xe7bc1f[_0x18b8('0x33')],'type':_0xe7bc1f[_0x18b8('0x34')][_0x18b8('0x35')]};});_0x46843e['model']=_['map'](_0x454043,'name');_0x46843e[_0x18b8('0x36')]=_[_0x18b8('0x37')](_0x329e80['query']);_0x46843e[_0x18b8('0x38')]=_['intersection'](_0x46843e[_0x18b8('0x39')],_0x46843e[_0x18b8('0x36')]);_0x35be40[_0x18b8('0x3a')]=_[_0x18b8('0x3b')](_0x46843e[_0x18b8('0x39')],qs['fields'](_0x329e80[_0x18b8('0x36')][_0x18b8('0x3c')]));_0x35be40['attributes']=_0x35be40[_0x18b8('0x3a')][_0x18b8('0x3d')]?_0x35be40[_0x18b8('0x3a')]:_0x46843e[_0x18b8('0x39')];if(!_0x329e80[_0x18b8('0x36')][_0x18b8('0x3e')](_0x18b8('0x3f'))){_0x35be40[_0x18b8('0x21')]=qs[_0x18b8('0x21')](_0x329e80[_0x18b8('0x36')][_0x18b8('0x21')]);_0x35be40[_0x18b8('0x23')]=qs[_0x18b8('0x23')](_0x329e80[_0x18b8('0x36')]['offset']);}_0x35be40[_0x18b8('0x40')]=qs[_0x18b8('0x41')](_0x329e80[_0x18b8('0x36')]['sort']);_0x35be40['where']=qs[_0x18b8('0x38')](_['pick'](_0x329e80[_0x18b8('0x36')],_0x46843e[_0x18b8('0x38')]),_0x454043);if(_0x329e80[_0x18b8('0x36')]['filter']){_0x35be40['where']=_[_0x18b8('0x42')](_0x35be40[_0x18b8('0x43')],{'$or':_[_0x18b8('0x30')](_0x454043,function(_0x4ad14b){if(_0x4ad14b[_0x18b8('0x34')]!==_0x18b8('0x44')){var _0x4a6892={};_0x4a6892[_0x4ad14b['name']]={'$like':'%'+_0x329e80[_0x18b8('0x36')]['filter']+'%'};return _0x4a6892;}})});}_0x35be40=_[_0x18b8('0x42')]({},_0x35be40,_0x329e80['options']);var _0x2c3193={'where':_0x35be40[_0x18b8('0x43')]};return db[_0x18b8('0x31')][_0x18b8('0x22')](_0x2c3193)['then'](function(_0x13afe8){_0x528b63[_0x18b8('0x22')]=_0x13afe8;if(_0x329e80[_0x18b8('0x36')][_0x18b8('0x45')]){_0x35be40[_0x18b8('0x46')]=[{'all':!![]}];}return db['CmList'][_0x18b8('0x47')](_0x35be40);})[_0x18b8('0x28')](function(_0x5f1427){_0x528b63['rows']=_0x5f1427;return _0x528b63;})[_0x18b8('0x28')](respondWithFilteredResult(_0x1c522f,_0x35be40))[_0x18b8('0x48')](handleError(_0x1c522f,null));};exports[_0x18b8('0x49')]=function(_0x2cd521,_0x427796){var _0x1b2ecc={'raw':![],'where':{'id':_0x2cd521[_0x18b8('0x4a')]['id']}},_0x2bdc75={};_0x2bdc75[_0x18b8('0x39')]=_['keys'](db['CmList'][_0x18b8('0x32')]);_0x2bdc75[_0x18b8('0x36')]=_[_0x18b8('0x37')](_0x2cd521['query']);_0x2bdc75[_0x18b8('0x38')]=_['intersection'](_0x2bdc75['model'],_0x2bdc75[_0x18b8('0x36')]);_0x1b2ecc[_0x18b8('0x3a')]=_[_0x18b8('0x3b')](_0x2bdc75[_0x18b8('0x39')],qs[_0x18b8('0x3c')](_0x2cd521[_0x18b8('0x36')][_0x18b8('0x3c')]));_0x1b2ecc[_0x18b8('0x3a')]=_0x1b2ecc[_0x18b8('0x3a')][_0x18b8('0x3d')]?_0x1b2ecc[_0x18b8('0x3a')]:_0x2bdc75[_0x18b8('0x39')];if(_0x2cd521[_0x18b8('0x36')][_0x18b8('0x45')]){_0x1b2ecc[_0x18b8('0x46')]=[{'all':!![]}];}_0x1b2ecc=_[_0x18b8('0x42')]({},_0x1b2ecc,_0x2cd521['options']);return db[_0x18b8('0x31')][_0x18b8('0x4b')](_0x1b2ecc)['then'](handleEntityNotFound(_0x427796,null))['then'](respondWithResult(_0x427796,null))['catch'](handleError(_0x427796,null));};exports[_0x18b8('0x4c')]=function(_0x5885fe,_0x18af6f){return db['CmList'][_0x18b8('0x4c')](_0x5885fe[_0x18b8('0x4d')],{})['then'](function(_0x37d724){var _0x351b56=_0x5885fe[_0x18b8('0x4e')]['get']({'plain':!![]});if(!_0x351b56)throw new Error(_0x18b8('0x4f'));if(_0x351b56[_0x18b8('0x50')]==='user'){var _0x1b4675=_0x37d724[_0x18b8('0x29')]({'plain':!![]});var _0x2af442=_0x18b8('0x2a');return db[_0x18b8('0x51')][_0x18b8('0x4b')]({'where':{'name':_0x2af442,'userProfileId':_0x351b56[_0x18b8('0x52')]},'raw':!![]})['then'](function(_0x44330b){if(_0x44330b&&_0x44330b['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x1b4675[_0x18b8('0x2e')],'resourceId':_0x1b4675['id'],'type':_0x44330b[_0x18b8('0x2e')],'sectionId':_0x44330b['id']},{})[_0x18b8('0x28')](function(){return _0x37d724;});}else{return _0x37d724;}})[_0x18b8('0x48')](function(_0x7bf597){logger['error'](_0x18b8('0x53'),_0x7bf597);throw _0x7bf597;});}return _0x37d724;})[_0x18b8('0x28')](respondWithResult(_0x18af6f,0xc9))[_0x18b8('0x48')](handleError(_0x18af6f,null));};exports[_0x18b8('0x26')]=function(_0x49e11f,_0x10a44c){if(_0x49e11f['body']['id']){delete _0x49e11f[_0x18b8('0x4d')]['id'];}return db[_0x18b8('0x31')][_0x18b8('0x4b')]({'where':{'id':_0x49e11f[_0x18b8('0x4a')]['id']}})[_0x18b8('0x28')](handleEntityNotFound(_0x10a44c,null))[_0x18b8('0x28')](saveUpdates(_0x49e11f['body'],null))[_0x18b8('0x28')](respondWithResult(_0x10a44c,null))[_0x18b8('0x48')](handleError(_0x10a44c,null));};exports[_0x18b8('0x27')]=function(_0x4074a1,_0x224585){return db[_0x18b8('0x31')]['find']({'where':{'id':_0x4074a1[_0x18b8('0x4a')]['id']}})['then'](handleEntityNotFound(_0x224585,null))['then'](removeEntity(_0x224585,null))['catch'](handleError(_0x224585,null));};exports[_0x18b8('0x54')]=function(_0x1ad667,_0x2e326f){return db['CmList'][_0x18b8('0x54')]()[_0x18b8('0x28')](respondWithResult(_0x2e326f,null))[_0x18b8('0x48')](handleError(_0x2e326f,null));};exports[_0x18b8('0x55')]=function(_0xfe9308,_0x10bb0e,_0x2832ab){if(_0xfe9308['body']['id']){delete _0xfe9308[_0x18b8('0x4d')]['id'];}return db[_0x18b8('0x31')][_0x18b8('0x4b')]({'where':{'id':_0xfe9308[_0x18b8('0x4a')]['id']}})['then'](handleEntityNotFound(_0x10bb0e,null))[_0x18b8('0x28')](function(_0x466165){if(_0x466165){_0xfe9308[_0x18b8('0x4d')]['ListId']=_0x466165['id'];return db[_0x18b8('0x56')][_0x18b8('0x4c')](_0xfe9308[_0x18b8('0x4d')]);}})[_0x18b8('0x28')](respondWithResult(_0x10bb0e,null))[_0x18b8('0x48')](handleError(_0x10bb0e,null));};exports['getDispositions']=function(_0x149a8c,_0x4d0c8f,_0x913275){var _0x2cd9b6={'raw':![],'where':{}};var _0x39ac52={};var _0x537c23={'count':0x0,'rows':[]};return db[_0x18b8('0x31')]['findOne']({'where':{'id':_0x149a8c[_0x18b8('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4d0c8f,null))['then'](function(_0x30fd29){if(_0x30fd29){_0x39ac52[_0x18b8('0x39')]=_[_0x18b8('0x37')](db[_0x18b8('0x56')][_0x18b8('0x32')]);_0x39ac52[_0x18b8('0x36')]=_[_0x18b8('0x37')](_0x149a8c[_0x18b8('0x36')]);_0x39ac52[_0x18b8('0x38')]=_[_0x18b8('0x3b')](_0x39ac52[_0x18b8('0x39')],_0x39ac52['query']);_0x2cd9b6[_0x18b8('0x3a')]=_[_0x18b8('0x3b')](_0x39ac52['model'],qs[_0x18b8('0x3c')](_0x149a8c['query']['fields']));_0x2cd9b6['attributes']=_0x2cd9b6['attributes'][_0x18b8('0x3d')]?_0x2cd9b6[_0x18b8('0x3a')]:_0x39ac52[_0x18b8('0x39')];if(!_0x149a8c[_0x18b8('0x36')]['hasOwnProperty'](_0x18b8('0x3f'))){_0x2cd9b6[_0x18b8('0x21')]=qs[_0x18b8('0x21')](_0x149a8c[_0x18b8('0x36')][_0x18b8('0x21')]);_0x2cd9b6[_0x18b8('0x23')]=qs[_0x18b8('0x23')](_0x149a8c[_0x18b8('0x36')]['offset']);}_0x2cd9b6[_0x18b8('0x40')]=qs[_0x18b8('0x41')](_0x149a8c[_0x18b8('0x36')]['sort']);_0x2cd9b6[_0x18b8('0x43')]=qs[_0x18b8('0x38')](_[_0x18b8('0x57')](_0x149a8c[_0x18b8('0x36')],_0x39ac52[_0x18b8('0x38')]));_0x2cd9b6['where'][_0x18b8('0x58')]=_0x30fd29['id'];if(_0x149a8c[_0x18b8('0x36')][_0x18b8('0x59')]){_0x2cd9b6['where']=_[_0x18b8('0x42')](_0x2cd9b6[_0x18b8('0x43')],{'$or':_['map'](_0x2cd9b6[_0x18b8('0x3a')],function(_0x492e9d){var _0x4ed139={};_0x4ed139[_0x492e9d]={'$like':'%'+_0x149a8c[_0x18b8('0x36')]['filter']+'%'};return _0x4ed139;})});}_0x2cd9b6=_[_0x18b8('0x42')]({},_0x2cd9b6,_0x149a8c[_0x18b8('0x5a')]);return db[_0x18b8('0x56')]['count']({'where':_0x2cd9b6[_0x18b8('0x43')]})['then'](function(_0x257fdb){_0x537c23[_0x18b8('0x22')]=_0x257fdb;if(_0x149a8c[_0x18b8('0x36')][_0x18b8('0x45')]){_0x2cd9b6[_0x18b8('0x46')]=[{'all':!![]}];}return db[_0x18b8('0x56')]['findAll'](_0x2cd9b6);})[_0x18b8('0x28')](function(_0xba7373){_0x537c23['rows']=_0xba7373;return _0x537c23;});}})[_0x18b8('0x28')](respondWithFilteredResult(_0x4d0c8f,_0x2cd9b6))[_0x18b8('0x48')](handleError(_0x4d0c8f,null));};exports[_0x18b8('0x5b')]=function(_0x56d0ae,_0x1dc7ea,_0x34f46a){return db['CmList'][_0x18b8('0x4b')]({'where':{'id':_0x56d0ae['params']['id']}})['then'](handleEntityNotFound(_0x1dc7ea,null))[_0x18b8('0x28')](function(_0x156503){if(_0x156503){return _0x156503['removeDispositions'](_0x56d0ae[_0x18b8('0x36')][_0x18b8('0x5c')]);}})[_0x18b8('0x28')](respondWithStatusCode(_0x1dc7ea,null))['catch'](handleError(_0x1dc7ea,null));};exports[_0x18b8('0x5d')]=function(_0x308602,_0x511572,_0x2d966e){return db[_0x18b8('0x31')][_0x18b8('0x4b')]({'where':{'id':_0x308602['params']['id']}})['then'](handleEntityNotFound(_0x511572,null))['then'](function(_0x50e6b1){if(_0x50e6b1){var _0x5d45a9=[];var _0xafddc1={'success':[],'errors':[]};return db['CmContact'][_0x18b8('0x54')]()[_0x18b8('0x28')](function(_0x160178){if(_0x308602[_0x18b8('0x4d')][_0x18b8('0x5e')]&&_[_0x18b8('0x5f')](_0x308602['body']['tags'])){if(_0x308602[_0x18b8('0x4d')]['tags'][_0x18b8('0x3d')]){_0x308602[_0x18b8('0x4d')]['tags']=_0x308602[_0x18b8('0x4d')][_0x18b8('0x5e')][_0x18b8('0x60')](';')+';';}else{_0x308602[_0x18b8('0x4d')][_0x18b8('0x5e')]=null;}}else{_0x308602['body'][_0x18b8('0x5e')]=null;}if(_0x308602['body']&&_[_0x18b8('0x5f')](_0x308602['body'])){for(var _0xd93e4d=0x0;_0xd93e4d<_0x308602['body'][_0x18b8('0x3d')];_0xd93e4d+=0x1){_0x308602[_0x18b8('0x4d')][_0xd93e4d][_0x18b8('0x58')]=_0x308602[_0x18b8('0x4a')]['id'];_0x5d45a9['push'](_0x308602[_0x18b8('0x4d')][_0xd93e4d]);}return BPromise[_0x18b8('0x61')](_0x5d45a9,function(_0x5e1b81){return db[_0x18b8('0x62')][_0x18b8('0x4c')](_[_0x18b8('0x63')](_0x5e1b81,[_0x18b8('0x5c'),'id'])||{},{'fields':_['keys'](_0x160178),'raw':!![]})['then'](function(_0x380555){_0xafddc1['success']['push'](_0x380555['dataValues']);})[_0x18b8('0x48')](function(_0x100f3c){_0xafddc1['errors'][_0x18b8('0x64')]({'data':_0x5e1b81,'error':_0x100f3c[_0x18b8('0x65')]});});})[_0x18b8('0x28')](function(_0x4190e7){return _0xafddc1;})[_0x18b8('0x48')](function(_0x2e12df){return _0x2e12df;});}else{_0x511572['status'](0x190)[_0x18b8('0x1f')]({'message':_0x18b8('0x66')});}});}})[_0x18b8('0x28')](respondWithResult(_0x511572,null))[_0x18b8('0x48')](handleError(_0x511572,null));};exports[_0x18b8('0x67')]=function(_0x51bc7d,_0x183484,_0x4d7071){var _0x2559ee;return db[_0x18b8('0x31')][_0x18b8('0x4b')]({'where':{'id':_0x51bc7d[_0x18b8('0x4a')]['id']},'include':[{'model':db[_0x18b8('0x68')],'as':_0x18b8('0x69')}]})[_0x18b8('0x28')](handleEntityNotFound(_0x183484,null))[_0x18b8('0x28')](function(_0x36579b){if(_0x36579b){_0x2559ee=_0x36579b;return db['CmContact'][_0x18b8('0x32')];}})[_0x18b8('0x28')](function(_0x2e911b){if(_0x2e911b){var _0x230bf8={};var _0x32152d={};_0x32152d[_0x18b8('0x39')]=_['concat'](_['keys'](_0x2e911b),_[_0x18b8('0x30')](_0x2559ee[_0x18b8('0x69')],function(_0x56a876){return util[_0x18b8('0x6a')](_0x18b8('0x6b'),_0x56a876['id']);}));_0x32152d[_0x18b8('0x36')]=_[_0x18b8('0x37')](_0x51bc7d['query']);_0x32152d[_0x18b8('0x38')]=_[_0x18b8('0x3b')](_0x32152d['model'],_0x32152d[_0x18b8('0x36')]);_0x230bf8[_0x18b8('0x3a')]=_['intersection'](_0x32152d[_0x18b8('0x39')],qs[_0x18b8('0x3c')](_0x51bc7d['query'][_0x18b8('0x3c')]));_0x230bf8['attributes']=_0x230bf8[_0x18b8('0x3a')][_0x18b8('0x3d')]?_0x230bf8[_0x18b8('0x3a')]:_0x32152d['model'];if(!_0x51bc7d[_0x18b8('0x36')][_0x18b8('0x3e')](_0x18b8('0x3f'))){_0x230bf8[_0x18b8('0x21')]=qs[_0x18b8('0x21')](_0x51bc7d['query'][_0x18b8('0x21')]);_0x230bf8[_0x18b8('0x23')]=qs[_0x18b8('0x23')](_0x51bc7d[_0x18b8('0x36')]['offset']);}_0x230bf8[_0x18b8('0x40')]=qs[_0x18b8('0x41')](_0x51bc7d[_0x18b8('0x36')]['sort']);_0x230bf8[_0x18b8('0x43')]=qs[_0x18b8('0x38')](_[_0x18b8('0x57')](_0x51bc7d['query'],_0x32152d[_0x18b8('0x38')]));_0x230bf8[_0x18b8('0x6c')]=!![];if(_0x51bc7d[_0x18b8('0x36')][_0x18b8('0x59')]){_0x230bf8[_0x18b8('0x43')]=_[_0x18b8('0x42')](_0x230bf8['where'],{'$or':_[_0x18b8('0x30')](_0x230bf8[_0x18b8('0x3a')],function(_0x17913e){var _0x5be4e1={};_0x5be4e1[_0x17913e]={'$like':'%'+_0x51bc7d[_0x18b8('0x36')][_0x18b8('0x59')]+'%'};return _0x5be4e1;})});}_0x230bf8=_[_0x18b8('0x42')]({},_0x230bf8,_0x51bc7d[_0x18b8('0x5a')]);return _0x2559ee[_0x18b8('0x67')](_0x230bf8);}})[_0x18b8('0x28')](respondWithResult(_0x183484,null))['catch'](handleError(_0x183484,null));};exports[_0x18b8('0x6d')]=function(_0x219485,_0x567952,_0x4789b9){var _0xf83962;var _0x597ccb;var _0x1eeb49;var _0x476a04=_0x219485['params']['id'];csv_results=[];return db['ContactItemType'][_0x18b8('0x47')]({'attributes':['id',_0x18b8('0x2e')],'raw':!![],'order':[_0x18b8('0x6e')]})[_0x18b8('0x28')](function(_0x481e85){_0xf83962=_0x481e85;var _0xb6a30b=_[_0x18b8('0x37')](db[_0x18b8('0x62')][_0x18b8('0x32')]);return db[_0x18b8('0x68')][_0x18b8('0x47')]({'raw':!![],'attributes':['id',_0x18b8('0x6f')]})['then'](function(_0xcabd4d){_0x597ccb=_0xcabd4d;var _0x449956=squel[_0x18b8('0x70')]()['fields'](_0xb6a30b)[_0x18b8('0x71')]('cm_contacts','c')[_0x18b8('0x43')]('c.ListId\x20=\x20?',_0x476a04)[_0x18b8('0x43')](_0x18b8('0x72'))[_0x18b8('0x73')]();for(var _0x4f8cdc=0x0;_0x4f8cdc<_0x597ccb['length'];_0x4f8cdc++){_0x449956[_0x18b8('0x74')](_0x18b8('0x75')+_0x597ccb[_0x4f8cdc]['id'],_0x18b8('0x76')+_0x597ccb[_0x4f8cdc][_0x18b8('0x6f')]);}for(var _0x4f8cdc=0x0;_0x4f8cdc<_0xf83962[_0x18b8('0x3d')];_0x4f8cdc++){_0x449956[_0x18b8('0x74')](squel[_0x18b8('0x70')]()[_0x18b8('0x74')](_0x18b8('0x77'))[_0x18b8('0x71')](_0x18b8('0x78'))[_0x18b8('0x43')](_0x18b8('0x79'),_0xf83962[_0x4f8cdc]['id'])[_0x18b8('0x43')](_0x18b8('0x7a')),_0x18b8('0x7b')+_0xf83962[_0x4f8cdc][_0x18b8('0x2e')]);_0x449956['field'](squel[_0x18b8('0x70')]()[_0x18b8('0x74')](_0x18b8('0x7c'))[_0x18b8('0x71')](_0x18b8('0x78'))[_0x18b8('0x43')](_0x18b8('0x79'),_0xf83962[_0x4f8cdc]['id'])['where']('CmContactId\x20=\x20c.id'),_0x18b8('0x7d')+_0xf83962[_0x4f8cdc]['name']);}var _0x1198dc=[];_0x1198dc['push'](_0x449956[_0x18b8('0x7e')]());BPromise[_0x18b8('0x61')](_0x1198dc,handleQuery)[_0x18b8('0x28')](function(_0x2e94d6){handleQuery(_0x449956[_0x18b8('0x7e')]());var _0x404b05=csv_results[0x0];if(!_[_0x18b8('0x7f')](_0x404b05)){var _0x20e53e=toCsv(_0x404b05);var _0x19fd0e=Date[_0x18b8('0x80')]();fs['writeFileSync'](util[_0x18b8('0x6a')](_0x18b8('0x81'),_0x476a04,_0x19fd0e),_0x20e53e);_0x567952[_0x18b8('0x82')](_0x18b8('0x83'),_0x18b8('0x84')+util[_0x18b8('0x6a')]('list_%d_%s.csv',_0x476a04,_0x19fd0e));_0x567952[_0x18b8('0x82')](_0x18b8('0x85'),_0x18b8('0x86'));return _0x567952['download'](util['format'](_0x18b8('0x81'),_0x476a04,_0x19fd0e));}else{return _0x567952[_0x18b8('0x2c')](0xcc);}});});});};exports[_0x18b8('0x87')]=function(_0x3e51c3,_0x317c1a,_0x531db1){var _0x5c9340;delete _0x3e51c3[_0x18b8('0x4d')]['id'];return db[_0x18b8('0x31')][_0x18b8('0x88')]({'where':{'id':_0x3e51c3[_0x18b8('0x4a')]['id']}})['then'](handleEntityNotFound(_0x317c1a,null))[_0x18b8('0x28')](function(_0xec35e6){if(_0xec35e6){return db[_0x18b8('0x89')][_0x18b8('0x8a')](function(_0x48e711){return db[_0x18b8('0x68')][_0x18b8('0x4c')](_0x3e51c3[_0x18b8('0x4d')],{'transaction':_0x48e711})[_0x18b8('0x28')](function(_0x4f22be){_0x5c9340=_0x4f22be;return _0xec35e6[_0x18b8('0x8b')](_0x4f22be,{'transaction':_0x48e711});})[_0x18b8('0x28')](function(){var _0x3e1e3a={'type':db[_0x18b8('0x8c')]['TEXT'],'transaction':_0x48e711};switch(_0x3e51c3['body'][_0x18b8('0x34')]){case _0x18b8('0x8d'):_0x3e1e3a[_0x18b8('0x34')]=db['Sequelize'][_0x18b8('0x8e')];break;case'number':_0x3e1e3a[_0x18b8('0x34')]=db[_0x18b8('0x8c')]['INTEGER'];break;case _0x18b8('0x8f'):_0x3e1e3a[_0x18b8('0x34')]=db['Sequelize'][_0x18b8('0x90')];_0x3e1e3a[_0x18b8('0x91')]=![];break;default:}return db['sequelize']['queryInterface'][_0x18b8('0x92')](_0x18b8('0x93'),util['format'](_0x18b8('0x94'),_0x5c9340['id']),_0x3e1e3a);})[_0x18b8('0x28')](function(){return _0x5c9340;});});}})[_0x18b8('0x28')](respondWithResult(_0x317c1a,null))[_0x18b8('0x48')](handleError(_0x317c1a,null));};exports[_0x18b8('0x95')]=function(_0x50a922,_0x51a82f,_0xa24dad){var _0x57596c={};var _0x2dbd48={};var _0x1ff7e1;var _0x445ef4;return db[_0x18b8('0x31')][_0x18b8('0x88')]({'where':{'id':_0x50a922[_0x18b8('0x4a')]['id']}})[_0x18b8('0x28')](handleEntityNotFound(_0x51a82f,null))[_0x18b8('0x28')](function(_0x1eac63){if(_0x1eac63){_0x1ff7e1=_0x1eac63;_0x2dbd48['model']=_['keys'](db['CmCustomField'][_0x18b8('0x32')]);_0x2dbd48[_0x18b8('0x36')]=_[_0x18b8('0x37')](_0x50a922[_0x18b8('0x36')]);_0x2dbd48[_0x18b8('0x38')]=_[_0x18b8('0x3b')](_0x2dbd48[_0x18b8('0x39')],_0x2dbd48[_0x18b8('0x36')]);_0x57596c['attributes']=_['intersection'](_0x2dbd48[_0x18b8('0x39')],qs[_0x18b8('0x3c')](_0x50a922['query'][_0x18b8('0x3c')]));_0x57596c[_0x18b8('0x3a')]=_0x57596c['attributes']['length']?_0x57596c['attributes']:_0x2dbd48[_0x18b8('0x39')];_0x57596c[_0x18b8('0x40')]=qs['sort'](_0x50a922[_0x18b8('0x36')][_0x18b8('0x41')]);_0x57596c[_0x18b8('0x43')]=qs[_0x18b8('0x38')](_[_0x18b8('0x57')](_0x50a922[_0x18b8('0x36')],_0x2dbd48[_0x18b8('0x38')]));_0x57596c[_0x18b8('0x43')]=_['merge'](_0x57596c['where'],{'$or':[{'ListId':_0x1eac63['id']},{'ListId':null}]});if(_0x50a922[_0x18b8('0x36')]['filter']){_0x57596c['where']=_[_0x18b8('0x42')](_0x57596c['where'],{'$or':_[_0x18b8('0x30')](_0x57596c[_0x18b8('0x3a')],function(_0xd47486){var _0xf6ec2f={};_0xf6ec2f[_0xd47486]={'$like':'%'+_0x50a922[_0x18b8('0x36')][_0x18b8('0x59')]+'%'};return _0xf6ec2f;})});}_0x57596c=_[_0x18b8('0x42')]({},_0x57596c,_0x50a922[_0x18b8('0x5a')]);return db['CmCustomField'][_0x18b8('0x96')](_0x57596c);}})[_0x18b8('0x28')](respondWithResult(_0x51a82f,null))[_0x18b8('0x48')](handleError(_0x51a82f,null));};exports[_0x18b8('0x97')]=function(_0x66bcaa,_0x4738ff){return db[_0x18b8('0x68')][_0x18b8('0x96')]({'where':{'ListId':null}})['then'](handleEntityNotFound(_0x4738ff,null))[_0x18b8('0x28')](function(_0x1443d0){return _0x1443d0;})[_0x18b8('0x28')](respondWithResult(_0x4738ff,null))['catch'](handleError(_0x4738ff,null));};exports[_0x18b8('0x98')]=function(_0x35ea23,_0x33f190,_0xc614bd){return db[_0x18b8('0x31')]['find']({'where':{'id':_0x35ea23[_0x18b8('0x4a')]['id']}})[_0x18b8('0x28')](handleEntityNotFound(_0x33f190,null))[_0x18b8('0x28')](function(_0x42269c){if(_0x42269c){return _0x42269c['addAgents'](_0x35ea23[_0x18b8('0x4d')]['ids'],_[_0x18b8('0x63')](_0x35ea23[_0x18b8('0x4d')],['ids','id'])||{})[_0x18b8('0x99')](function(_0x81dc0a){for(var _0x3bfddd=0x0;_0x3bfddd<_0x35ea23[_0x18b8('0x4d')][_0x18b8('0x5c')][_0x18b8('0x3d')];_0x3bfddd+=0x1){socket[_0x18b8('0x9a')]('userCmList:save',{'UserId':Number(_0x35ea23[_0x18b8('0x4d')][_0x18b8('0x5c')][_0x3bfddd]),'CmListId':Number(_0x35ea23['params']['id'])});}return _0x81dc0a;});}})[_0x18b8('0x28')](respondWithResult(_0x33f190,null))[_0x18b8('0x48')](handleError(_0x33f190,null));};exports['removeAgents']=function(_0x10bd5f,_0x485eb2,_0xb52513){return db[_0x18b8('0x31')]['find']({'where':{'id':_0x10bd5f[_0x18b8('0x4a')]['id']}})[_0x18b8('0x28')](handleEntityNotFound(_0x485eb2,null))[_0x18b8('0x28')](function(_0x9f3eb8){if(_0x9f3eb8){return _0x9f3eb8[_0x18b8('0x9b')](_0x10bd5f[_0x18b8('0x36')]['ids'])[_0x18b8('0x28')](function(){if(_[_0x18b8('0x5f')](_0x10bd5f[_0x18b8('0x36')][_0x18b8('0x5c')])){for(var _0x11de5d=0x0;_0x11de5d<_0x10bd5f[_0x18b8('0x36')][_0x18b8('0x5c')]['length'];_0x11de5d+=0x1){socket[_0x18b8('0x9a')](_0x18b8('0x9c'),{'UserId':Number(_0x10bd5f['query']['ids'][_0x11de5d]),'CmListId':Number(_0x10bd5f[_0x18b8('0x4a')]['id'])});}}else{socket[_0x18b8('0x9a')]('userCmList:remove',{'UserId':Number(_0x10bd5f[_0x18b8('0x36')][_0x18b8('0x5c')]),'CmListId':Number(_0x10bd5f[_0x18b8('0x4a')]['id'])});}});}})['then'](respondWithStatusCode(_0x485eb2,null))[_0x18b8('0x48')](handleError(_0x485eb2,null));};exports[_0x18b8('0x9d')]=function(_0x1037e6,_0xcfd02b,_0x2057c9){var _0x8e7b00={};var _0x3ef685={};var _0x3971e9;var _0xd54a5e;return db[_0x18b8('0x31')][_0x18b8('0x88')]({'where':{'id':_0x1037e6[_0x18b8('0x4a')]['id']}})[_0x18b8('0x28')](handleEntityNotFound(_0xcfd02b,null))[_0x18b8('0x28')](function(_0x3a3c43){if(_0x3a3c43){_0x3971e9=_0x3a3c43;_0x3ef685[_0x18b8('0x39')]=_[_0x18b8('0x37')](db[_0x18b8('0x9e')][_0x18b8('0x32')]);_0x3ef685[_0x18b8('0x36')]=_[_0x18b8('0x37')](_0x1037e6['query']);_0x3ef685[_0x18b8('0x38')]=_['intersection'](_0x3ef685[_0x18b8('0x39')],_0x3ef685['query']);_0x8e7b00['attributes']=_[_0x18b8('0x3b')](_0x3ef685[_0x18b8('0x39')],qs[_0x18b8('0x3c')](_0x1037e6[_0x18b8('0x36')][_0x18b8('0x3c')]));_0x8e7b00[_0x18b8('0x3a')]=_0x8e7b00['attributes'][_0x18b8('0x3d')]?_0x8e7b00[_0x18b8('0x3a')]:_0x3ef685[_0x18b8('0x39')];_0x8e7b00[_0x18b8('0x40')]=qs[_0x18b8('0x41')](_0x1037e6[_0x18b8('0x36')][_0x18b8('0x41')]);_0x8e7b00[_0x18b8('0x43')]=qs[_0x18b8('0x38')](_[_0x18b8('0x57')](_0x1037e6[_0x18b8('0x36')],_0x3ef685[_0x18b8('0x38')]));if(_0x1037e6[_0x18b8('0x36')][_0x18b8('0x59')]){_0x8e7b00[_0x18b8('0x43')]=_[_0x18b8('0x42')](_0x8e7b00[_0x18b8('0x43')],{'$or':_[_0x18b8('0x30')](_0x8e7b00['attributes'],function(_0xd64ba4){var _0x28c9d6={};_0x28c9d6[_0xd64ba4]={'$like':'%'+_0x1037e6[_0x18b8('0x36')]['filter']+'%'};return _0x28c9d6;})});}_0x8e7b00=_[_0x18b8('0x42')]({},_0x8e7b00,_0x1037e6[_0x18b8('0x5a')]);return _0x3971e9[_0x18b8('0x9d')](_0x8e7b00);}})[_0x18b8('0x28')](function(_0x445b44){if(_0x445b44){_0xd54a5e=_0x445b44['length'];if(!_0x1037e6[_0x18b8('0x36')][_0x18b8('0x3e')](_0x18b8('0x3f'))){_0x8e7b00[_0x18b8('0x21')]=qs[_0x18b8('0x21')](_0x1037e6[_0x18b8('0x36')][_0x18b8('0x21')]);_0x8e7b00['offset']=qs[_0x18b8('0x23')](_0x1037e6[_0x18b8('0x36')]['offset']);}return _0x3971e9[_0x18b8('0x9d')](_0x8e7b00);}})[_0x18b8('0x28')](function(_0x2cc1b7){if(_0x2cc1b7){return _0x2cc1b7?{'count':_0xd54a5e,'rows':_0x2cc1b7}:null;}})[_0x18b8('0x28')](respondWithResult(_0xcfd02b,null))[_0x18b8('0x48')](handleError(_0xcfd02b,null));};function handleQuery(_0x451510){logger[_0x18b8('0x9f')](_0x451510);return db[_0x18b8('0x89')][_0x18b8('0x36')](_0x451510)[_0x18b8('0x99')](function(_0x553746){csv_results[_0x18b8('0x64')](_0x553746);})[_0x18b8('0x48')](function(_0x58858e){logger[_0x18b8('0x2d')](_0x58858e[_0x18b8('0x65')]);});} \ No newline at end of file +var _0xb56d=['index','CmList','rawAttributes','fieldName','type','key','model','map','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','ListId','Disposition','getDispositions','removeDispositions','ids','addContacts','CmContact','isArray','tags','push','each','omit','success','dataValues','errors','message','Malformed\x20request\x20syntax','getContacts','CustomFields','concat','format','raw','getContactsCsv','ContactItemType','OrderBy','CmCustomField','from','cm_contacts','c.ListId\x20=\x20?','distinct','field','c.cf_','alias','select','item','cm_contact_has_items','ItemTypeId\x20=\x20?','additionalPhone_','description','CmContactId\x20=\x20c.id','toString','now','writeFileSync','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','download','addCustomField','findOne','sequelize','Sequelize','text','number','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','getCustomFields','order','getGlobalCustomFields','addAgents','spread','emit','removeAgents','userCmList:remove','getAgents','User','info','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','save','destroy','then','Lists','UserProfileResource','end','stack','name','send'];(function(_0x24930c,_0xf01ff1){var _0x3ff362=function(_0x36f83b){while(--_0x36f83b){_0x24930c['push'](_0x24930c['shift']());}};_0x3ff362(++_0xf01ff1);}(_0xb56d,0x77));var _0xdb56=function(_0x1c4a91,_0x57b9cc){_0x1c4a91=_0x1c4a91-0x0;var _0x4498ec=_0xb56d[_0x1c4a91];return _0x4498ec;};'use strict';var emlformat=require(_0xdb56('0x0'));var rimraf=require(_0xdb56('0x1'));var zipdir=require(_0xdb56('0x2'));var jsonpatch=require(_0xdb56('0x3'));var rp=require(_0xdb56('0x4'));var moment=require(_0xdb56('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xdb56('0x6'));var util=require(_0xdb56('0x7'));var path=require(_0xdb56('0x8'));var sox=require(_0xdb56('0x9'));var csv=require(_0xdb56('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdb56('0xb'));var _=require(_0xdb56('0xc'));var squel=require(_0xdb56('0xd'));var crypto=require(_0xdb56('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xdb56('0xf'));var toCsv=require('to-csv');var querystring=require(_0xdb56('0x10'));var Papa=require(_0xdb56('0x11'));var Redis=require('ioredis');var authService=require(_0xdb56('0x12'));var qs=require(_0xdb56('0x13'));var as=require(_0xdb56('0x14'));var hardwareService=require(_0xdb56('0x15'));var logger=require(_0xdb56('0x16'))(_0xdb56('0x17'));var utils=require('../../config/utils');var config=require(_0xdb56('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xdb56('0x19'))['db'];var csv_results;config[_0xdb56('0x1a')]=_[_0xdb56('0x1b')](config[_0xdb56('0x1a')],{'host':_0xdb56('0x1c'),'port':0x18eb});var socket=require(_0xdb56('0x1d'))(new Redis(config['redis']));require(_0xdb56('0x1e'))[_0xdb56('0x1f')](socket);function respondWithStatusCode(_0x11cb5c,_0x4dacd2){_0x4dacd2=_0x4dacd2||0xcc;return function(_0x5affd7){if(_0x5affd7){return _0x11cb5c[_0xdb56('0x20')](_0x4dacd2);}return _0x11cb5c[_0xdb56('0x21')](_0x4dacd2)['end']();};}function respondWithResult(_0x44e419,_0x5dd804){_0x5dd804=_0x5dd804||0xc8;return function(_0x49abcc){if(_0x49abcc){return _0x44e419[_0xdb56('0x21')](_0x5dd804)[_0xdb56('0x22')](_0x49abcc);}};}function respondWithFilteredResult(_0x3afe6c,_0x83a00c){return function(_0x2471f1){if(_0x2471f1){var _0x3659d0=typeof _0x83a00c[_0xdb56('0x23')]===_0xdb56('0x24')&&typeof _0x83a00c['limit']===_0xdb56('0x24');var _0x497a0e=_0x2471f1[_0xdb56('0x25')];var _0x3b6b12=_0x3659d0?0x0:_0x83a00c[_0xdb56('0x23')];var _0x1edeea=_0x3659d0?_0x2471f1[_0xdb56('0x25')]:_0x83a00c['offset']+_0x83a00c['limit'];var _0x44276c;if(_0x1edeea>=_0x497a0e){_0x1edeea=_0x497a0e;_0x44276c=0xc8;}else{_0x44276c=0xce;}_0x3afe6c[_0xdb56('0x21')](_0x44276c);return _0x3afe6c[_0xdb56('0x26')](_0xdb56('0x27'),_0x3b6b12+'-'+_0x1edeea+'/'+_0x497a0e)[_0xdb56('0x22')](_0x2471f1);}return null;};}function patchUpdates(_0xf8fd7b){return function(_0x58e128){try{jsonpatch[_0xdb56('0x28')](_0x58e128,_0xf8fd7b,!![]);}catch(_0x374511){return BPromise['reject'](_0x374511);}return _0x58e128[_0xdb56('0x29')]();};}function saveUpdates(_0x412d89,_0x1f38fd){return function(_0x4dd0cd){if(_0x4dd0cd){return _0x4dd0cd['update'](_0x412d89)['then'](function(_0x4a6de9){return _0x4a6de9;});}return null;};}function removeEntity(_0x31693e,_0x23a371){return function(_0x21d330){if(_0x21d330){return _0x21d330[_0xdb56('0x2a')]()[_0xdb56('0x2b')](function(){var _0x1ab55e=_0x21d330['get']({'plain':!![]});var _0xa02bf3=_0xdb56('0x2c');return db[_0xdb56('0x2d')][_0xdb56('0x2a')]({'where':{'type':_0xa02bf3,'resourceId':_0x1ab55e['id']}})[_0xdb56('0x2b')](function(){return _0x21d330;});})[_0xdb56('0x2b')](function(){_0x31693e[_0xdb56('0x21')](0xcc)[_0xdb56('0x2e')]();});}};}function handleEntityNotFound(_0x9801cf,_0x1bdac1){return function(_0x260330){if(!_0x260330){_0x9801cf[_0xdb56('0x20')](0x194);}return _0x260330;};}function handleError(_0x2b04ed,_0x1d031c){_0x1d031c=_0x1d031c||0x1f4;return function(_0x54dc7e){logger['error'](_0x54dc7e[_0xdb56('0x2f')]);if(_0x54dc7e[_0xdb56('0x30')]){delete _0x54dc7e[_0xdb56('0x30')];}_0x2b04ed['status'](_0x1d031c)[_0xdb56('0x31')](_0x54dc7e);};}exports[_0xdb56('0x32')]=function(_0x4c6212,_0xea4791){var _0x266f26={},_0x3ee3d0={},_0x1895c5={'count':0x0,'rows':[]};var _0x3205d8=_['map'](db[_0xdb56('0x33')][_0xdb56('0x34')],function(_0x3571e6){return{'name':_0x3571e6[_0xdb56('0x35')],'type':_0x3571e6[_0xdb56('0x36')][_0xdb56('0x37')]};});_0x3ee3d0[_0xdb56('0x38')]=_[_0xdb56('0x39')](_0x3205d8,_0xdb56('0x30'));_0x3ee3d0[_0xdb56('0x3a')]=_['keys'](_0x4c6212['query']);_0x3ee3d0[_0xdb56('0x3b')]=_['intersection'](_0x3ee3d0[_0xdb56('0x38')],_0x3ee3d0[_0xdb56('0x3a')]);_0x266f26[_0xdb56('0x3c')]=_[_0xdb56('0x3d')](_0x3ee3d0[_0xdb56('0x38')],qs[_0xdb56('0x3e')](_0x4c6212[_0xdb56('0x3a')][_0xdb56('0x3e')]));_0x266f26['attributes']=_0x266f26['attributes'][_0xdb56('0x3f')]?_0x266f26['attributes']:_0x3ee3d0[_0xdb56('0x38')];if(!_0x4c6212[_0xdb56('0x3a')][_0xdb56('0x40')](_0xdb56('0x41'))){_0x266f26['limit']=qs['limit'](_0x4c6212[_0xdb56('0x3a')][_0xdb56('0x42')]);_0x266f26['offset']=qs[_0xdb56('0x23')](_0x4c6212['query'][_0xdb56('0x23')]);}_0x266f26['order']=qs[_0xdb56('0x43')](_0x4c6212['query'][_0xdb56('0x43')]);_0x266f26[_0xdb56('0x44')]=qs['filters'](_[_0xdb56('0x45')](_0x4c6212[_0xdb56('0x3a')],_0x3ee3d0[_0xdb56('0x3b')]),_0x3205d8);if(_0x4c6212[_0xdb56('0x3a')][_0xdb56('0x46')]){_0x266f26[_0xdb56('0x44')]=_[_0xdb56('0x47')](_0x266f26[_0xdb56('0x44')],{'$or':_[_0xdb56('0x39')](_0x3205d8,function(_0x406c34){if(_0x406c34[_0xdb56('0x36')]!==_0xdb56('0x48')){var _0x4ec36b={};_0x4ec36b[_0x406c34[_0xdb56('0x30')]]={'$like':'%'+_0x4c6212[_0xdb56('0x3a')][_0xdb56('0x46')]+'%'};return _0x4ec36b;}})});}_0x266f26=_[_0xdb56('0x47')]({},_0x266f26,_0x4c6212[_0xdb56('0x49')]);var _0x435ac9={'where':_0x266f26[_0xdb56('0x44')]};return db[_0xdb56('0x33')][_0xdb56('0x25')](_0x435ac9)[_0xdb56('0x2b')](function(_0x2fd8af){_0x1895c5[_0xdb56('0x25')]=_0x2fd8af;if(_0x4c6212['query'][_0xdb56('0x4a')]){_0x266f26[_0xdb56('0x4b')]=[{'all':!![]}];}return db[_0xdb56('0x33')][_0xdb56('0x4c')](_0x266f26);})[_0xdb56('0x2b')](function(_0x37542c){_0x1895c5[_0xdb56('0x4d')]=_0x37542c;return _0x1895c5;})[_0xdb56('0x2b')](respondWithFilteredResult(_0xea4791,_0x266f26))[_0xdb56('0x4e')](handleError(_0xea4791,null));};exports['show']=function(_0x55bbf8,_0x374e7c){var _0x4c330c={'raw':![],'where':{'id':_0x55bbf8[_0xdb56('0x4f')]['id']}},_0x1061fa={};_0x1061fa[_0xdb56('0x38')]=_[_0xdb56('0x50')](db[_0xdb56('0x33')][_0xdb56('0x34')]);_0x1061fa[_0xdb56('0x3a')]=_[_0xdb56('0x50')](_0x55bbf8[_0xdb56('0x3a')]);_0x1061fa[_0xdb56('0x3b')]=_[_0xdb56('0x3d')](_0x1061fa[_0xdb56('0x38')],_0x1061fa[_0xdb56('0x3a')]);_0x4c330c[_0xdb56('0x3c')]=_[_0xdb56('0x3d')](_0x1061fa[_0xdb56('0x38')],qs[_0xdb56('0x3e')](_0x55bbf8[_0xdb56('0x3a')]['fields']));_0x4c330c[_0xdb56('0x3c')]=_0x4c330c[_0xdb56('0x3c')]['length']?_0x4c330c[_0xdb56('0x3c')]:_0x1061fa['model'];if(_0x55bbf8['query']['includeAll']){_0x4c330c[_0xdb56('0x4b')]=[{'all':!![]}];}_0x4c330c=_['merge']({},_0x4c330c,_0x55bbf8[_0xdb56('0x49')]);return db[_0xdb56('0x33')][_0xdb56('0x51')](_0x4c330c)[_0xdb56('0x2b')](handleEntityNotFound(_0x374e7c,null))[_0xdb56('0x2b')](respondWithResult(_0x374e7c,null))['catch'](handleError(_0x374e7c,null));};exports[_0xdb56('0x52')]=function(_0x2f59ba,_0x2ca9bc){return db[_0xdb56('0x33')]['create'](_0x2f59ba[_0xdb56('0x53')],{})[_0xdb56('0x2b')](function(_0x5d7308){var _0x146062=_0x2f59ba[_0xdb56('0x54')][_0xdb56('0x55')]({'plain':!![]});if(!_0x146062)throw new Error(_0xdb56('0x56'));if(_0x146062[_0xdb56('0x57')]===_0xdb56('0x54')){var _0x54e401=_0x5d7308[_0xdb56('0x55')]({'plain':!![]});var _0x1bb890=_0xdb56('0x2c');return db[_0xdb56('0x58')][_0xdb56('0x51')]({'where':{'name':_0x1bb890,'userProfileId':_0x146062[_0xdb56('0x59')]},'raw':!![]})['then'](function(_0x165eda){if(_0x165eda&&_0x165eda[_0xdb56('0x5a')]===0x0){return db[_0xdb56('0x2d')][_0xdb56('0x52')]({'name':_0x54e401[_0xdb56('0x30')],'resourceId':_0x54e401['id'],'type':_0x165eda['name'],'sectionId':_0x165eda['id']},{})[_0xdb56('0x2b')](function(){return _0x5d7308;});}else{return _0x5d7308;}})[_0xdb56('0x4e')](function(_0x190ec4){logger[_0xdb56('0x5b')](_0xdb56('0x5c'),_0x190ec4);throw _0x190ec4;});}return _0x5d7308;})[_0xdb56('0x2b')](respondWithResult(_0x2ca9bc,0xc9))[_0xdb56('0x4e')](handleError(_0x2ca9bc,null));};exports[_0xdb56('0x5d')]=function(_0x4b7f87,_0x20083a){if(_0x4b7f87[_0xdb56('0x53')]['id']){delete _0x4b7f87[_0xdb56('0x53')]['id'];}return db[_0xdb56('0x33')][_0xdb56('0x51')]({'where':{'id':_0x4b7f87['params']['id']}})[_0xdb56('0x2b')](handleEntityNotFound(_0x20083a,null))['then'](saveUpdates(_0x4b7f87[_0xdb56('0x53')],null))[_0xdb56('0x2b')](respondWithResult(_0x20083a,null))['catch'](handleError(_0x20083a,null));};exports[_0xdb56('0x2a')]=function(_0x49625f,_0x16e8b4){return db[_0xdb56('0x33')]['find']({'where':{'id':_0x49625f[_0xdb56('0x4f')]['id']}})[_0xdb56('0x2b')](handleEntityNotFound(_0x16e8b4,null))['then'](removeEntity(_0x16e8b4,null))[_0xdb56('0x4e')](handleError(_0x16e8b4,null));};exports['describe']=function(_0x1493e0,_0x602ea1){return db[_0xdb56('0x33')][_0xdb56('0x5e')]()['then'](respondWithResult(_0x602ea1,null))['catch'](handleError(_0x602ea1,null));};exports['addDisposition']=function(_0x4c564d,_0x133f70,_0x3d9f9e){if(_0x4c564d['body']['id']){delete _0x4c564d[_0xdb56('0x53')]['id'];}return db[_0xdb56('0x33')][_0xdb56('0x51')]({'where':{'id':_0x4c564d[_0xdb56('0x4f')]['id']}})[_0xdb56('0x2b')](handleEntityNotFound(_0x133f70,null))['then'](function(_0x558dd6){if(_0x558dd6){_0x4c564d[_0xdb56('0x53')][_0xdb56('0x5f')]=_0x558dd6['id'];return db[_0xdb56('0x60')][_0xdb56('0x52')](_0x4c564d[_0xdb56('0x53')]);}})['then'](respondWithResult(_0x133f70,null))[_0xdb56('0x4e')](handleError(_0x133f70,null));};exports[_0xdb56('0x61')]=function(_0x26a529,_0x488c81,_0x3a5b8c){var _0x325b11={'raw':![],'where':{}};var _0x2b909d={};var _0x1a07f4={'count':0x0,'rows':[]};return db['CmList']['findOne']({'where':{'id':_0x26a529[_0xdb56('0x4f')]['id']}})['then'](handleEntityNotFound(_0x488c81,null))[_0xdb56('0x2b')](function(_0x1757dc){if(_0x1757dc){_0x2b909d['model']=_[_0xdb56('0x50')](db[_0xdb56('0x60')][_0xdb56('0x34')]);_0x2b909d['query']=_[_0xdb56('0x50')](_0x26a529[_0xdb56('0x3a')]);_0x2b909d[_0xdb56('0x3b')]=_[_0xdb56('0x3d')](_0x2b909d[_0xdb56('0x38')],_0x2b909d[_0xdb56('0x3a')]);_0x325b11['attributes']=_[_0xdb56('0x3d')](_0x2b909d[_0xdb56('0x38')],qs[_0xdb56('0x3e')](_0x26a529[_0xdb56('0x3a')][_0xdb56('0x3e')]));_0x325b11['attributes']=_0x325b11[_0xdb56('0x3c')][_0xdb56('0x3f')]?_0x325b11[_0xdb56('0x3c')]:_0x2b909d[_0xdb56('0x38')];if(!_0x26a529[_0xdb56('0x3a')][_0xdb56('0x40')](_0xdb56('0x41'))){_0x325b11[_0xdb56('0x42')]=qs['limit'](_0x26a529[_0xdb56('0x3a')][_0xdb56('0x42')]);_0x325b11[_0xdb56('0x23')]=qs[_0xdb56('0x23')](_0x26a529[_0xdb56('0x3a')][_0xdb56('0x23')]);}_0x325b11['order']=qs[_0xdb56('0x43')](_0x26a529[_0xdb56('0x3a')][_0xdb56('0x43')]);_0x325b11[_0xdb56('0x44')]=qs['filters'](_[_0xdb56('0x45')](_0x26a529['query'],_0x2b909d[_0xdb56('0x3b')]));_0x325b11[_0xdb56('0x44')][_0xdb56('0x5f')]=_0x1757dc['id'];if(_0x26a529[_0xdb56('0x3a')]['filter']){_0x325b11['where']=_[_0xdb56('0x47')](_0x325b11[_0xdb56('0x44')],{'$or':_[_0xdb56('0x39')](_0x325b11[_0xdb56('0x3c')],function(_0x5a3eea){var _0x20f3df={};_0x20f3df[_0x5a3eea]={'$like':'%'+_0x26a529[_0xdb56('0x3a')]['filter']+'%'};return _0x20f3df;})});}_0x325b11=_[_0xdb56('0x47')]({},_0x325b11,_0x26a529[_0xdb56('0x49')]);return db[_0xdb56('0x60')][_0xdb56('0x25')]({'where':_0x325b11[_0xdb56('0x44')]})[_0xdb56('0x2b')](function(_0x4351b1){_0x1a07f4[_0xdb56('0x25')]=_0x4351b1;if(_0x26a529[_0xdb56('0x3a')]['includeAll']){_0x325b11['include']=[{'all':!![]}];}return db[_0xdb56('0x60')]['findAll'](_0x325b11);})['then'](function(_0x431b78){_0x1a07f4[_0xdb56('0x4d')]=_0x431b78;return _0x1a07f4;});}})[_0xdb56('0x2b')](respondWithFilteredResult(_0x488c81,_0x325b11))[_0xdb56('0x4e')](handleError(_0x488c81,null));};exports[_0xdb56('0x62')]=function(_0x24cf49,_0x2b15e1,_0x200be8){return db['CmList'][_0xdb56('0x51')]({'where':{'id':_0x24cf49[_0xdb56('0x4f')]['id']}})[_0xdb56('0x2b')](handleEntityNotFound(_0x2b15e1,null))[_0xdb56('0x2b')](function(_0x362f1d){if(_0x362f1d){return _0x362f1d[_0xdb56('0x62')](_0x24cf49[_0xdb56('0x3a')][_0xdb56('0x63')]);}})[_0xdb56('0x2b')](respondWithStatusCode(_0x2b15e1,null))[_0xdb56('0x4e')](handleError(_0x2b15e1,null));};exports[_0xdb56('0x64')]=function(_0x508f2a,_0xeb840a,_0x2231be){return db['CmList'][_0xdb56('0x51')]({'where':{'id':_0x508f2a[_0xdb56('0x4f')]['id']}})[_0xdb56('0x2b')](handleEntityNotFound(_0xeb840a,null))[_0xdb56('0x2b')](function(_0x5df34e){if(_0x5df34e){var _0x2fa5e4=[];var _0x68bdd={'success':[],'errors':[]};return db[_0xdb56('0x65')][_0xdb56('0x5e')]()[_0xdb56('0x2b')](function(_0x500e51){if(_0x508f2a[_0xdb56('0x53')]['tags']&&_[_0xdb56('0x66')](_0x508f2a['body'][_0xdb56('0x67')])){if(_0x508f2a[_0xdb56('0x53')][_0xdb56('0x67')][_0xdb56('0x3f')]){_0x508f2a[_0xdb56('0x53')]['tags']=_0x508f2a[_0xdb56('0x53')][_0xdb56('0x67')]['join'](';')+';';}else{_0x508f2a['body'][_0xdb56('0x67')]=null;}}else{_0x508f2a[_0xdb56('0x53')][_0xdb56('0x67')]=null;}if(_0x508f2a[_0xdb56('0x53')]&&_[_0xdb56('0x66')](_0x508f2a[_0xdb56('0x53')])){for(var _0x761770=0x0;_0x761770<_0x508f2a[_0xdb56('0x53')]['length'];_0x761770+=0x1){_0x508f2a[_0xdb56('0x53')][_0x761770][_0xdb56('0x5f')]=_0x508f2a[_0xdb56('0x4f')]['id'];_0x2fa5e4[_0xdb56('0x68')](_0x508f2a[_0xdb56('0x53')][_0x761770]);}return BPromise[_0xdb56('0x69')](_0x2fa5e4,function(_0x15ef65){return db[_0xdb56('0x65')][_0xdb56('0x52')](_[_0xdb56('0x6a')](_0x15ef65,['ids','id'])||{},{'fields':_[_0xdb56('0x50')](_0x500e51),'raw':!![]})['then'](function(_0x3900e8){_0x68bdd[_0xdb56('0x6b')][_0xdb56('0x68')](_0x3900e8[_0xdb56('0x6c')]);})[_0xdb56('0x4e')](function(_0x537bb8){_0x68bdd[_0xdb56('0x6d')]['push']({'data':_0x15ef65,'error':_0x537bb8[_0xdb56('0x6e')]});});})[_0xdb56('0x2b')](function(_0x57ef01){return _0x68bdd;})[_0xdb56('0x4e')](function(_0x30278d){return _0x30278d;});}else{_0xeb840a['status'](0x190)[_0xdb56('0x22')]({'message':_0xdb56('0x6f')});}});}})['then'](respondWithResult(_0xeb840a,null))['catch'](handleError(_0xeb840a,null));};exports[_0xdb56('0x70')]=function(_0x767eb2,_0x13704d,_0x2c5f87){var _0x15f948;return db[_0xdb56('0x33')][_0xdb56('0x51')]({'where':{'id':_0x767eb2[_0xdb56('0x4f')]['id']},'include':[{'model':db['CmCustomField'],'as':_0xdb56('0x71')}]})[_0xdb56('0x2b')](handleEntityNotFound(_0x13704d,null))[_0xdb56('0x2b')](function(_0x5b1b2d){if(_0x5b1b2d){_0x15f948=_0x5b1b2d;return db[_0xdb56('0x65')]['rawAttributes'];}})[_0xdb56('0x2b')](function(_0x5793ab){if(_0x5793ab){var _0x47204f={};var _0xd3d53e={};_0xd3d53e[_0xdb56('0x38')]=_[_0xdb56('0x72')](_['keys'](_0x5793ab),_[_0xdb56('0x39')](_0x15f948[_0xdb56('0x71')],function(_0x1db5fc){return util[_0xdb56('0x73')]('cf_%d',_0x1db5fc['id']);}));_0xd3d53e[_0xdb56('0x3a')]=_[_0xdb56('0x50')](_0x767eb2['query']);_0xd3d53e['filters']=_[_0xdb56('0x3d')](_0xd3d53e[_0xdb56('0x38')],_0xd3d53e[_0xdb56('0x3a')]);_0x47204f['attributes']=_['intersection'](_0xd3d53e['model'],qs[_0xdb56('0x3e')](_0x767eb2[_0xdb56('0x3a')][_0xdb56('0x3e')]));_0x47204f[_0xdb56('0x3c')]=_0x47204f['attributes'][_0xdb56('0x3f')]?_0x47204f[_0xdb56('0x3c')]:_0xd3d53e['model'];if(!_0x767eb2[_0xdb56('0x3a')][_0xdb56('0x40')](_0xdb56('0x41'))){_0x47204f['limit']=qs[_0xdb56('0x42')](_0x767eb2[_0xdb56('0x3a')][_0xdb56('0x42')]);_0x47204f['offset']=qs['offset'](_0x767eb2['query'][_0xdb56('0x23')]);}_0x47204f['order']=qs[_0xdb56('0x43')](_0x767eb2[_0xdb56('0x3a')][_0xdb56('0x43')]);_0x47204f[_0xdb56('0x44')]=qs[_0xdb56('0x3b')](_[_0xdb56('0x45')](_0x767eb2[_0xdb56('0x3a')],_0xd3d53e['filters']));_0x47204f[_0xdb56('0x74')]=!![];if(_0x767eb2[_0xdb56('0x3a')]['filter']){_0x47204f[_0xdb56('0x44')]=_[_0xdb56('0x47')](_0x47204f[_0xdb56('0x44')],{'$or':_[_0xdb56('0x39')](_0x47204f[_0xdb56('0x3c')],function(_0x4b0620){var _0x1ff89c={};_0x1ff89c[_0x4b0620]={'$like':'%'+_0x767eb2[_0xdb56('0x3a')][_0xdb56('0x46')]+'%'};return _0x1ff89c;})});}_0x47204f=_['merge']({},_0x47204f,_0x767eb2[_0xdb56('0x49')]);return _0x15f948['getContacts'](_0x47204f);}})[_0xdb56('0x2b')](respondWithResult(_0x13704d,null))[_0xdb56('0x4e')](handleError(_0x13704d,null));};exports[_0xdb56('0x75')]=function(_0x314b29,_0x4621df,_0x4e95b4){var _0x5b1674;var _0x4b1f24;var _0x4222b1;var _0x5a7c21=_0x314b29[_0xdb56('0x4f')]['id'];csv_results=[];return db[_0xdb56('0x76')][_0xdb56('0x4c')]({'attributes':['id',_0xdb56('0x30')],'raw':!![],'order':[_0xdb56('0x77')]})[_0xdb56('0x2b')](function(_0x2082d5){_0x5b1674=_0x2082d5;var _0x442a8d=_[_0xdb56('0x50')](db[_0xdb56('0x65')][_0xdb56('0x34')]);return db[_0xdb56('0x78')][_0xdb56('0x4c')]({'raw':!![],'attributes':['id','alias']})[_0xdb56('0x2b')](function(_0x210ce1){_0x4b1f24=_0x210ce1;var _0x54b3e9=squel['select']()[_0xdb56('0x3e')](_0x442a8d)[_0xdb56('0x79')](_0xdb56('0x7a'),'c')[_0xdb56('0x44')](_0xdb56('0x7b'),_0x5a7c21)[_0xdb56('0x44')]('c.deletedAt\x20is\x20null')[_0xdb56('0x7c')]();for(var _0xea1745=0x0;_0xea1745<_0x4b1f24[_0xdb56('0x3f')];_0xea1745++){_0x54b3e9[_0xdb56('0x7d')](_0xdb56('0x7e')+_0x4b1f24[_0xea1745]['id'],'customField_'+_0x4b1f24[_0xea1745][_0xdb56('0x7f')]);}for(var _0xea1745=0x0;_0xea1745<_0x5b1674[_0xdb56('0x3f')];_0xea1745++){_0x54b3e9[_0xdb56('0x7d')](squel[_0xdb56('0x80')]()[_0xdb56('0x7d')](_0xdb56('0x81'))[_0xdb56('0x79')](_0xdb56('0x82'))[_0xdb56('0x44')](_0xdb56('0x83'),_0x5b1674[_0xea1745]['id'])[_0xdb56('0x44')]('CmContactId\x20=\x20c.id'),_0xdb56('0x84')+_0x5b1674[_0xea1745][_0xdb56('0x30')]);_0x54b3e9[_0xdb56('0x7d')](squel[_0xdb56('0x80')]()[_0xdb56('0x7d')](_0xdb56('0x85'))[_0xdb56('0x79')]('cm_contact_has_items')['where']('ItemTypeId\x20=\x20?',_0x5b1674[_0xea1745]['id'])[_0xdb56('0x44')](_0xdb56('0x86')),'description_additionalPhone_'+_0x5b1674[_0xea1745]['name']);}var _0x21e5d5=[];_0x21e5d5['push'](_0x54b3e9[_0xdb56('0x87')]());BPromise[_0xdb56('0x69')](_0x21e5d5,handleQuery)[_0xdb56('0x2b')](function(_0x4e8e85){handleQuery(_0x54b3e9['toString']());var _0x35ea6e=csv_results[0x0];if(!_['isEmpty'](_0x35ea6e)){var _0x43d14c=toCsv(_0x35ea6e);var _0x570429=Date[_0xdb56('0x88')]();fs[_0xdb56('0x89')](util[_0xdb56('0x73')](_0xdb56('0x8a'),_0x5a7c21,_0x570429),_0x43d14c);_0x4621df[_0xdb56('0x8b')](_0xdb56('0x8c'),_0xdb56('0x8d')+util[_0xdb56('0x73')](_0xdb56('0x8e'),_0x5a7c21,_0x570429));_0x4621df[_0xdb56('0x8b')](_0xdb56('0x8f'),_0xdb56('0x90'));return _0x4621df[_0xdb56('0x91')](util['format'](_0xdb56('0x8a'),_0x5a7c21,_0x570429));}else{return _0x4621df[_0xdb56('0x20')](0xcc);}});});});};exports[_0xdb56('0x92')]=function(_0xd5b952,_0x386ed0,_0x96e78a){var _0x2e9b30;delete _0xd5b952[_0xdb56('0x53')]['id'];return db['CmList'][_0xdb56('0x93')]({'where':{'id':_0xd5b952['params']['id']}})['then'](handleEntityNotFound(_0x386ed0,null))[_0xdb56('0x2b')](function(_0x558d97){if(_0x558d97){return db[_0xdb56('0x94')]['transaction'](function(_0x590b70){return db[_0xdb56('0x78')][_0xdb56('0x52')](_0xd5b952[_0xdb56('0x53')],{'transaction':_0x590b70})[_0xdb56('0x2b')](function(_0x598bb0){_0x2e9b30=_0x598bb0;return _0x558d97['addCustomFields'](_0x598bb0,{'transaction':_0x590b70});})[_0xdb56('0x2b')](function(){var _0x50a407={'type':db[_0xdb56('0x95')]['TEXT'],'transaction':_0x590b70};switch(_0xd5b952[_0xdb56('0x53')]['type']){case _0xdb56('0x96'):_0x50a407['type']=db['Sequelize']['TEXT'];break;case _0xdb56('0x97'):_0x50a407[_0xdb56('0x36')]=db[_0xdb56('0x95')][_0xdb56('0x98')];break;case _0xdb56('0x99'):_0x50a407[_0xdb56('0x36')]=db[_0xdb56('0x95')][_0xdb56('0x9a')];_0x50a407[_0xdb56('0x9b')]=![];break;default:}return db[_0xdb56('0x94')][_0xdb56('0x9c')][_0xdb56('0x9d')]('cm_contacts',util[_0xdb56('0x73')]('cf_%s',_0x2e9b30['id']),_0x50a407);})[_0xdb56('0x2b')](function(){return _0x2e9b30;});});}})['then'](respondWithResult(_0x386ed0,null))['catch'](handleError(_0x386ed0,null));};exports[_0xdb56('0x9e')]=function(_0x5a62c6,_0x429a05,_0x2770a4){var _0x2f78c1={};var _0x41a4d0={};var _0x3f6d9d;var _0x3ba494;return db[_0xdb56('0x33')][_0xdb56('0x93')]({'where':{'id':_0x5a62c6[_0xdb56('0x4f')]['id']}})[_0xdb56('0x2b')](handleEntityNotFound(_0x429a05,null))[_0xdb56('0x2b')](function(_0x5dfcf0){if(_0x5dfcf0){_0x3f6d9d=_0x5dfcf0;_0x41a4d0[_0xdb56('0x38')]=_[_0xdb56('0x50')](db[_0xdb56('0x78')][_0xdb56('0x34')]);_0x41a4d0[_0xdb56('0x3a')]=_['keys'](_0x5a62c6[_0xdb56('0x3a')]);_0x41a4d0[_0xdb56('0x3b')]=_[_0xdb56('0x3d')](_0x41a4d0[_0xdb56('0x38')],_0x41a4d0[_0xdb56('0x3a')]);_0x2f78c1[_0xdb56('0x3c')]=_[_0xdb56('0x3d')](_0x41a4d0['model'],qs[_0xdb56('0x3e')](_0x5a62c6[_0xdb56('0x3a')]['fields']));_0x2f78c1['attributes']=_0x2f78c1[_0xdb56('0x3c')]['length']?_0x2f78c1[_0xdb56('0x3c')]:_0x41a4d0[_0xdb56('0x38')];_0x2f78c1[_0xdb56('0x9f')]=qs[_0xdb56('0x43')](_0x5a62c6[_0xdb56('0x3a')]['sort']);_0x2f78c1[_0xdb56('0x44')]=qs[_0xdb56('0x3b')](_['pick'](_0x5a62c6['query'],_0x41a4d0[_0xdb56('0x3b')]));_0x2f78c1[_0xdb56('0x44')]=_['merge'](_0x2f78c1['where'],{'$or':[{'ListId':_0x5dfcf0['id']},{'ListId':null}]});if(_0x5a62c6[_0xdb56('0x3a')][_0xdb56('0x46')]){_0x2f78c1['where']=_[_0xdb56('0x47')](_0x2f78c1['where'],{'$or':_[_0xdb56('0x39')](_0x2f78c1[_0xdb56('0x3c')],function(_0x3976d2){var _0x16e3e0={};_0x16e3e0[_0x3976d2]={'$like':'%'+_0x5a62c6[_0xdb56('0x3a')]['filter']+'%'};return _0x16e3e0;})});}_0x2f78c1=_[_0xdb56('0x47')]({},_0x2f78c1,_0x5a62c6[_0xdb56('0x49')]);return db[_0xdb56('0x78')]['findAndCountAll'](_0x2f78c1);}})[_0xdb56('0x2b')](respondWithResult(_0x429a05,null))[_0xdb56('0x4e')](handleError(_0x429a05,null));};exports[_0xdb56('0xa0')]=function(_0x16cc57,_0x4e6fad){return db[_0xdb56('0x78')]['findAndCountAll']({'where':{'ListId':null}})[_0xdb56('0x2b')](handleEntityNotFound(_0x4e6fad,null))['then'](function(_0x4a067d){return _0x4a067d;})[_0xdb56('0x2b')](respondWithResult(_0x4e6fad,null))[_0xdb56('0x4e')](handleError(_0x4e6fad,null));};exports['addAgents']=function(_0x2c3beb,_0x37deee,_0x285b17){return db[_0xdb56('0x33')][_0xdb56('0x51')]({'where':{'id':_0x2c3beb[_0xdb56('0x4f')]['id']}})[_0xdb56('0x2b')](handleEntityNotFound(_0x37deee,null))[_0xdb56('0x2b')](function(_0x39ea8c){if(_0x39ea8c){return _0x39ea8c[_0xdb56('0xa1')](_0x2c3beb['body'][_0xdb56('0x63')],_[_0xdb56('0x6a')](_0x2c3beb['body'],[_0xdb56('0x63'),'id'])||{})[_0xdb56('0xa2')](function(_0x2ece4b){for(var _0x5a7b26=0x0;_0x5a7b26<_0x2c3beb[_0xdb56('0x53')]['ids'][_0xdb56('0x3f')];_0x5a7b26+=0x1){socket[_0xdb56('0xa3')]('userCmList:save',{'UserId':Number(_0x2c3beb[_0xdb56('0x53')][_0xdb56('0x63')][_0x5a7b26]),'CmListId':Number(_0x2c3beb[_0xdb56('0x4f')]['id'])});}return _0x2ece4b;});}})['then'](respondWithResult(_0x37deee,null))[_0xdb56('0x4e')](handleError(_0x37deee,null));};exports[_0xdb56('0xa4')]=function(_0x13401f,_0x52e4fb,_0x4e72e5){return db[_0xdb56('0x33')]['find']({'where':{'id':_0x13401f['params']['id']}})[_0xdb56('0x2b')](handleEntityNotFound(_0x52e4fb,null))[_0xdb56('0x2b')](function(_0x2bf3c0){if(_0x2bf3c0){return _0x2bf3c0[_0xdb56('0xa4')](_0x13401f['query'][_0xdb56('0x63')])['then'](function(){if(_[_0xdb56('0x66')](_0x13401f['query'][_0xdb56('0x63')])){for(var _0x2f5fe8=0x0;_0x2f5fe8<_0x13401f[_0xdb56('0x3a')][_0xdb56('0x63')][_0xdb56('0x3f')];_0x2f5fe8+=0x1){socket[_0xdb56('0xa3')](_0xdb56('0xa5'),{'UserId':Number(_0x13401f[_0xdb56('0x3a')][_0xdb56('0x63')][_0x2f5fe8]),'CmListId':Number(_0x13401f[_0xdb56('0x4f')]['id'])});}}else{socket[_0xdb56('0xa3')](_0xdb56('0xa5'),{'UserId':Number(_0x13401f[_0xdb56('0x3a')][_0xdb56('0x63')]),'CmListId':Number(_0x13401f['params']['id'])});}});}})[_0xdb56('0x2b')](respondWithStatusCode(_0x52e4fb,null))[_0xdb56('0x4e')](handleError(_0x52e4fb,null));};exports[_0xdb56('0xa6')]=function(_0x2daf05,_0x434d4b,_0x5311b1){var _0x2531a7={};var _0x3d4bb9={};var _0xbe217b;var _0x30c410;return db[_0xdb56('0x33')][_0xdb56('0x93')]({'where':{'id':_0x2daf05[_0xdb56('0x4f')]['id']}})['then'](handleEntityNotFound(_0x434d4b,null))[_0xdb56('0x2b')](function(_0x540e20){if(_0x540e20){_0xbe217b=_0x540e20;_0x3d4bb9[_0xdb56('0x38')]=_[_0xdb56('0x50')](db[_0xdb56('0xa7')][_0xdb56('0x34')]);_0x3d4bb9[_0xdb56('0x3a')]=_['keys'](_0x2daf05[_0xdb56('0x3a')]);_0x3d4bb9['filters']=_['intersection'](_0x3d4bb9[_0xdb56('0x38')],_0x3d4bb9[_0xdb56('0x3a')]);_0x2531a7[_0xdb56('0x3c')]=_[_0xdb56('0x3d')](_0x3d4bb9[_0xdb56('0x38')],qs[_0xdb56('0x3e')](_0x2daf05[_0xdb56('0x3a')][_0xdb56('0x3e')]));_0x2531a7[_0xdb56('0x3c')]=_0x2531a7['attributes'][_0xdb56('0x3f')]?_0x2531a7[_0xdb56('0x3c')]:_0x3d4bb9[_0xdb56('0x38')];_0x2531a7['order']=qs[_0xdb56('0x43')](_0x2daf05[_0xdb56('0x3a')][_0xdb56('0x43')]);_0x2531a7['where']=qs[_0xdb56('0x3b')](_[_0xdb56('0x45')](_0x2daf05[_0xdb56('0x3a')],_0x3d4bb9[_0xdb56('0x3b')]));if(_0x2daf05[_0xdb56('0x3a')][_0xdb56('0x46')]){_0x2531a7[_0xdb56('0x44')]=_[_0xdb56('0x47')](_0x2531a7[_0xdb56('0x44')],{'$or':_[_0xdb56('0x39')](_0x2531a7[_0xdb56('0x3c')],function(_0xa0e35b){var _0x5191c0={};_0x5191c0[_0xa0e35b]={'$like':'%'+_0x2daf05[_0xdb56('0x3a')][_0xdb56('0x46')]+'%'};return _0x5191c0;})});}_0x2531a7=_[_0xdb56('0x47')]({},_0x2531a7,_0x2daf05['options']);return _0xbe217b['getAgents'](_0x2531a7);}})[_0xdb56('0x2b')](function(_0x594e4f){if(_0x594e4f){_0x30c410=_0x594e4f['length'];if(!_0x2daf05[_0xdb56('0x3a')][_0xdb56('0x40')](_0xdb56('0x41'))){_0x2531a7[_0xdb56('0x42')]=qs['limit'](_0x2daf05[_0xdb56('0x3a')]['limit']);_0x2531a7[_0xdb56('0x23')]=qs[_0xdb56('0x23')](_0x2daf05[_0xdb56('0x3a')]['offset']);}return _0xbe217b[_0xdb56('0xa6')](_0x2531a7);}})[_0xdb56('0x2b')](function(_0x41c9b7){if(_0x41c9b7){return _0x41c9b7?{'count':_0x30c410,'rows':_0x41c9b7}:null;}})[_0xdb56('0x2b')](respondWithResult(_0x434d4b,null))[_0xdb56('0x4e')](handleError(_0x434d4b,null));};function handleQuery(_0x233a1c){logger[_0xdb56('0xa8')](_0x233a1c);return db['sequelize'][_0xdb56('0x3a')](_0x233a1c)[_0xdb56('0xa2')](function(_0xf0a52a){csv_results['push'](_0xf0a52a);})[_0xdb56('0x4e')](function(_0x57d1bc){logger[_0xdb56('0x5b')](_0x57d1bc[_0xdb56('0x6e')]);});} \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 6515aae..c723cc4 100644 --- a/server/api/cmList/cmList.events.js +++ b/server/api/cmList/cmList.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5fc3=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hook'];(function(_0x83af7f,_0x49c6fd){var _0x32d85c=function(_0xf0e8bc){while(--_0xf0e8bc){_0x83af7f['push'](_0x83af7f['shift']());}};_0x32d85c(++_0x49c6fd);}(_0x5fc3,0xa8));var _0x35fc=function(_0x1196bd,_0xba4aea){_0x1196bd=_0x1196bd-0x0;var _0x26014f=_0x5fc3[_0x1196bd];return _0x26014f;};'use strict';var EventEmitter=require(_0x35fc('0x0'));var CmList=require(_0x35fc('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents[_0x35fc('0x2')](0x0);var events={'afterCreate':_0x35fc('0x3'),'afterUpdate':_0x35fc('0x4'),'afterDestroy':_0x35fc('0x5')};function emitEvent(_0xb4f9ce){return function(_0x5e75e6,_0x2d1404,_0x1d5fec){CmListEvents[_0x35fc('0x6')](_0xb4f9ce+':'+_0x5e75e6['id'],_0x5e75e6);CmListEvents['emit'](_0xb4f9ce,_0x5e75e6);_0x1d5fec(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0x35fc('0x7')](e,emitEvent(event));}}module['exports']=CmListEvents; \ No newline at end of file +var _0x55ca=['events','../../mysqldb','update','remove','emit','hasOwnProperty','hook'];(function(_0x2892da,_0x191a40){var _0x28cff2=function(_0x57023d){while(--_0x57023d){_0x2892da['push'](_0x2892da['shift']());}};_0x28cff2(++_0x191a40);}(_0x55ca,0x126));var _0xa55c=function(_0x5842c3,_0x56bd74){_0x5842c3=_0x5842c3-0x0;var _0x44bf8c=_0x55ca[_0x5842c3];return _0x44bf8c;};'use strict';var EventEmitter=require(_0xa55c('0x0'));var CmList=require(_0xa55c('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xa55c('0x2'),'afterDestroy':_0xa55c('0x3')};function emitEvent(_0x5dc716){return function(_0x3b478a,_0x2db02a,_0xcb02e3){CmListEvents[_0xa55c('0x4')](_0x5dc716+':'+_0x3b478a['id'],_0x3b478a);CmListEvents[_0xa55c('0x4')](_0x5dc716,_0x3b478a);_0xcb02e3(null);};}for(var e in events){if(events[_0xa55c('0x5')](e)){var event=events[e];CmList[_0xa55c('0x6')](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 4be69dc..0aa76ca 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 _0x5ff3=['cm_lists','util','api','bluebird','request-promise','path','rimraf','./cmList.attributes','exports','define'];(function(_0x6134a3,_0x422f4a){var _0x396cbe=function(_0x203307){while(--_0x203307){_0x6134a3['push'](_0x6134a3['shift']());}};_0x396cbe(++_0x422f4a);}(_0x5ff3,0x17d));var _0x35ff=function(_0x44a810,_0x3edf85){_0x44a810=_0x44a810-0x0;var _0x456247=_0x5ff3[_0x44a810];return _0x456247;};'use strict';var _=require('lodash');var util=require(_0x35ff('0x0'));var logger=require('../../config/logger')(_0x35ff('0x1'));var moment=require('moment');var BPromise=require(_0x35ff('0x2'));var rp=require(_0x35ff('0x3'));var fs=require('fs');var path=require(_0x35ff('0x4'));var rimraf=require(_0x35ff('0x5'));var config=require('../../config/environment');var attributes=require(_0x35ff('0x6'));module[_0x35ff('0x7')]=function(_0x2e9873,_0x11e738){return _0x2e9873[_0x35ff('0x8')]('CmList',attributes,{'tableName':_0x35ff('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa75b=['request-promise','path','rimraf','../../config/environment','./cmList.attributes','exports','define','CmList','lodash','api','moment','bluebird'];(function(_0x2b8077,_0x453634){var _0x308091=function(_0x426df7){while(--_0x426df7){_0x2b8077['push'](_0x2b8077['shift']());}};_0x308091(++_0x453634);}(_0xa75b,0x170));var _0xba75=function(_0x5423fe,_0x92f405){_0x5423fe=_0x5423fe-0x0;var _0x5339cb=_0xa75b[_0x5423fe];return _0x5339cb;};'use strict';var _=require(_0xba75('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xba75('0x1'));var moment=require(_0xba75('0x2'));var BPromise=require(_0xba75('0x3'));var rp=require(_0xba75('0x4'));var fs=require('fs');var path=require(_0xba75('0x5'));var rimraf=require(_0xba75('0x6'));var config=require(_0xba75('0x7'));var attributes=require(_0xba75('0x8'));module[_0xba75('0x9')]=function(_0x41afc9,_0x2baa28){return _0x41afc9[_0xba75('0xa')](_0xba75('0xb'),attributes,{'tableName':'cm_lists','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmList/cmList.rpc.js b/server/api/cmList/cmList.rpc.js index 54fdd84..b747471 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 _0x46cd=['../../config/logger','jayson/promise','client','http','redis','defaults','socket.io-emitter','./cmList.socket','request','info','CmList,\x20%s,\x20%s','debug','CmList,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x46cd,0x1af));var _0xd46c=function(_0x25d386,_0x108d0d){_0x25d386=_0x25d386-0x0;var _0x857f4a=_0x46cd[_0x25d386];return _0x857f4a;};'use strict';var _=require('lodash');var util=require(_0xd46c('0x0'));var moment=require('moment');var BPromise=require(_0xd46c('0x1'));var rs=require(_0xd46c('0x2'));var fs=require('fs');var Redis=require(_0xd46c('0x3'));var db=require(_0xd46c('0x4'))['db'];var utils=require(_0xd46c('0x5'));var logger=require(_0xd46c('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xd46c('0x7'));var client=jayson[_0xd46c('0x8')][_0xd46c('0x9')]({'port':0x232a});config[_0xd46c('0xa')]=_[_0xd46c('0xb')](config[_0xd46c('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xd46c('0xc'))(new Redis(config['redis']));require(_0xd46c('0xd'))['register'](socket);function respondWithRpcPromise(_0x392d41,_0x412463,_0x3bf109){return new BPromise(function(_0x4c0b92,_0x1ec18d){return client[_0xd46c('0xe')](_0x392d41,_0x3bf109)['then'](function(_0x17894c){logger[_0xd46c('0xf')](_0xd46c('0x10'),_0x412463,'request\x20sent');logger[_0xd46c('0x11')](_0xd46c('0x12'),_0x412463,_0xd46c('0x13'),JSON['stringify'](_0x17894c));if(_0x17894c[_0xd46c('0x14')]){if(_0x17894c['error'][_0xd46c('0x15')]===0x1f4){logger[_0xd46c('0x14')](_0xd46c('0x10'),_0x412463,_0x17894c[_0xd46c('0x14')]['message']);return _0x1ec18d(_0x17894c[_0xd46c('0x14')][_0xd46c('0x16')]);}logger[_0xd46c('0x14')](_0xd46c('0x10'),_0x412463,_0x17894c['error']['message']);return _0x4c0b92(_0x17894c[_0xd46c('0x14')][_0xd46c('0x16')]);}else{logger[_0xd46c('0xf')]('CmList,\x20%s,\x20%s',_0x412463,_0xd46c('0x13'));_0x4c0b92(_0x17894c['result'][_0xd46c('0x16')]);}})['catch'](function(_0x1931bc){logger['error']('CmList,\x20%s,\x20%s',_0x412463,_0x1931bc);_0x1ec18d(_0x1931bc);});});} \ No newline at end of file +var _0x111e=['jayson/promise','client','http','redis','localhost','socket.io-emitter','./cmList.socket','register','request','then','info','request\x20sent','debug','error','code','message','CmList,\x20%s,\x20%s','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x12e13a,_0x3f8461){var _0xf4cf3c=function(_0x54012f){while(--_0x54012f){_0x12e13a['push'](_0x12e13a['shift']());}};_0xf4cf3c(++_0x3f8461);}(_0x111e,0x17e));var _0xe111=function(_0xcde75b,_0x1dfbbd){_0xcde75b=_0xcde75b-0x0;var _0x2dd868=_0x111e[_0xcde75b];return _0x2dd868;};'use strict';var _=require(_0xe111('0x0'));var util=require(_0xe111('0x1'));var moment=require(_0xe111('0x2'));var BPromise=require(_0xe111('0x3'));var rs=require(_0xe111('0x4'));var fs=require('fs');var Redis=require(_0xe111('0x5'));var db=require(_0xe111('0x6'))['db'];var utils=require(_0xe111('0x7'));var logger=require('../../config/logger')(_0xe111('0x8'));var config=require(_0xe111('0x9'));var jayson=require(_0xe111('0xa'));var client=jayson[_0xe111('0xb')][_0xe111('0xc')]({'port':0x232a});config['redis']=_['defaults'](config[_0xe111('0xd')],{'host':_0xe111('0xe'),'port':0x18eb});var socket=require(_0xe111('0xf'))(new Redis(config['redis']));require(_0xe111('0x10'))[_0xe111('0x11')](socket);function respondWithRpcPromise(_0x306451,_0xa585ce,_0x20585c){return new BPromise(function(_0x422211,_0x49978b){return client[_0xe111('0x12')](_0x306451,_0x20585c)[_0xe111('0x13')](function(_0x25f429){logger[_0xe111('0x14')]('CmList,\x20%s,\x20%s',_0xa585ce,_0xe111('0x15'));logger[_0xe111('0x16')]('CmList,\x20%s,\x20%s,\x20%s',_0xa585ce,_0xe111('0x15'),JSON['stringify'](_0x25f429));if(_0x25f429[_0xe111('0x17')]){if(_0x25f429['error'][_0xe111('0x18')]===0x1f4){logger[_0xe111('0x17')]('CmList,\x20%s,\x20%s',_0xa585ce,_0x25f429[_0xe111('0x17')][_0xe111('0x19')]);return _0x49978b(_0x25f429[_0xe111('0x17')][_0xe111('0x19')]);}logger[_0xe111('0x17')](_0xe111('0x1a'),_0xa585ce,_0x25f429[_0xe111('0x17')][_0xe111('0x19')]);return _0x422211(_0x25f429[_0xe111('0x17')][_0xe111('0x19')]);}else{logger[_0xe111('0x14')](_0xe111('0x1a'),_0xa585ce,_0xe111('0x15'));_0x422211(_0x25f429[_0xe111('0x1b')][_0xe111('0x19')]);}})['catch'](function(_0x3e9011){logger[_0xe111('0x17')](_0xe111('0x1a'),_0xa585ce,_0x3e9011);_0x49978b(_0x3e9011);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index d857d49..304bdb0 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 _0xab1d=['./cmList.events','save','remove','update','removeListener','register','length','cmList:'];(function(_0x53810d,_0x21b802){var _0x2ee03d=function(_0x174df5){while(--_0x174df5){_0x53810d['push'](_0x53810d['shift']());}};_0x2ee03d(++_0x21b802);}(_0xab1d,0x130));var _0xdab1=function(_0x105dfb,_0x29ede9){_0x105dfb=_0x105dfb-0x0;var _0x48cdfc=_0xab1d[_0x105dfb];return _0x48cdfc;};'use strict';var CmListEvents=require(_0xdab1('0x0'));var events=[_0xdab1('0x1'),_0xdab1('0x2'),_0xdab1('0x3')];function createListener(_0x5a21f5,_0x2d3f85){return function(_0x2bc5cd){_0x2d3f85['emit'](_0x5a21f5,_0x2bc5cd);};}function removeListener(_0x32c365,_0x5411c4){return function(){CmListEvents[_0xdab1('0x4')](_0x32c365,_0x5411c4);};}exports[_0xdab1('0x5')]=function(_0x220554){for(var _0xd0382a=0x0,_0x11c95d=events[_0xdab1('0x6')];_0xd0382a<_0x11c95d;_0xd0382a++){var _0x5bfada=events[_0xd0382a];var _0x54b7dd=createListener(_0xdab1('0x7')+_0x5bfada,_0x220554);CmListEvents['on'](_0x5bfada,_0x54b7dd);}}; \ No newline at end of file +var _0x756b=['save','remove','update','length','cmList:','./cmList.events'];(function(_0x373dee,_0x1a8c45){var _0x46798f=function(_0xc389f0){while(--_0xc389f0){_0x373dee['push'](_0x373dee['shift']());}};_0x46798f(++_0x1a8c45);}(_0x756b,0x137));var _0xb756=function(_0x43cd3f,_0x5b1d58){_0x43cd3f=_0x43cd3f-0x0;var _0x2be696=_0x756b[_0x43cd3f];return _0x2be696;};'use strict';var CmListEvents=require(_0xb756('0x0'));var events=[_0xb756('0x1'),_0xb756('0x2'),_0xb756('0x3')];function createListener(_0x284835,_0x494ec0){return function(_0x374293){_0x494ec0['emit'](_0x284835,_0x374293);};}function removeListener(_0x20c2ec,_0x1d00db){return function(){CmListEvents['removeListener'](_0x20c2ec,_0x1d00db);};}exports['register']=function(_0xdf2c21){for(var _0x4038c6=0x0,_0x318c1b=events[_0xb756('0x4')];_0x4038c6<_0x318c1b;_0x4038c6++){var _0x595489=events[_0x4038c6];var _0x401975=createListener(_0xb756('0x5')+_0x595489,_0xdf2c21);CmListEvents['on'](_0x595489,_0x401975);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 8b25f0e..5058395 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 _0xcfee=['addDisposition','addContacts','addCustomField','/:id/users','addAgents','put','delete','destroy','removeAgents','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','isAuthenticated','index','/describe','describe','get','/global_fields','/:id','/:id/dispositions','/:id/contacts','getContacts','/:id/fields','getCustomFields','getAgents','post'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xcfee,0x175));var _0xecfe=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0xcfee[_0x4ae6ef];return _0x3cbb4e;};'use strict';var multer=require('multer');var util=require(_0xecfe('0x0'));var path=require(_0xecfe('0x1'));var timeout=require(_0xecfe('0x2'));var express=require(_0xecfe('0x3'));var router=express['Router']();var fs_extra=require(_0xecfe('0x4'));var auth=require(_0xecfe('0x5'));var interaction=require(_0xecfe('0x6'));var config=require(_0xecfe('0x7'));var controller=require(_0xecfe('0x8'));router['get']('/',auth[_0xecfe('0x9')](),controller[_0xecfe('0xa')]);router['get'](_0xecfe('0xb'),auth[_0xecfe('0x9')](),controller[_0xecfe('0xc')]);router[_0xecfe('0xd')](_0xecfe('0xe'),auth[_0xecfe('0x9')](),controller['getGlobalCustomFields']);router['get'](_0xecfe('0xf'),auth[_0xecfe('0x9')](),controller['show']);router[_0xecfe('0xd')](_0xecfe('0x10'),auth[_0xecfe('0x9')](),controller['getDispositions']);router[_0xecfe('0xd')](_0xecfe('0x11'),auth[_0xecfe('0x9')](),controller[_0xecfe('0x12')]);router[_0xecfe('0xd')]('/:id/contacts/csv',auth[_0xecfe('0x9')](),controller['getContactsCsv']);router['get'](_0xecfe('0x13'),auth[_0xecfe('0x9')](),controller[_0xecfe('0x14')]);router[_0xecfe('0xd')]('/:id/users',auth[_0xecfe('0x9')](),controller[_0xecfe('0x15')]);router[_0xecfe('0x16')]('/',auth[_0xecfe('0x9')](),controller['create']);router[_0xecfe('0x16')](_0xecfe('0x10'),auth[_0xecfe('0x9')](),controller[_0xecfe('0x17')]);router[_0xecfe('0x16')](_0xecfe('0x11'),auth[_0xecfe('0x9')](),controller[_0xecfe('0x18')]);router[_0xecfe('0x16')](_0xecfe('0x13'),auth[_0xecfe('0x9')](),controller[_0xecfe('0x19')]);router[_0xecfe('0x16')](_0xecfe('0x1a'),auth[_0xecfe('0x9')](),controller[_0xecfe('0x1b')]);router[_0xecfe('0x1c')](_0xecfe('0xf'),auth[_0xecfe('0x9')](),controller['update']);router[_0xecfe('0x1d')](_0xecfe('0xf'),auth[_0xecfe('0x9')](),controller[_0xecfe('0x1e')]);router[_0xecfe('0x1d')](_0xecfe('0x10'),auth[_0xecfe('0x9')](),controller['removeDispositions']);router[_0xecfe('0x1d')](_0xecfe('0x1a'),auth[_0xecfe('0x9')](),controller[_0xecfe('0x1f')]);module[_0xecfe('0x20')]=router; \ No newline at end of file +var _0xed95=['/:id/contacts','/:id/fields','getCustomFields','getAgents','create','post','addDisposition','addContacts','addCustomField','/:id/users','addAgents','put','delete','removeDispositions','removeAgents','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./cmList.controller','get','index','isAuthenticated','describe','/global_fields','getGlobalCustomFields','/:id','/:id/dispositions'];(function(_0x50aac6,_0x4a5be0){var _0x420596=function(_0x483459){while(--_0x483459){_0x50aac6['push'](_0x50aac6['shift']());}};_0x420596(++_0x4a5be0);}(_0xed95,0x1d0));var _0x5ed9=function(_0x4b1e9d,_0x1ce1cd){_0x4b1e9d=_0x4b1e9d-0x0;var _0x14ebbf=_0xed95[_0x4b1e9d];return _0x14ebbf;};'use strict';var multer=require(_0x5ed9('0x0'));var util=require(_0x5ed9('0x1'));var path=require(_0x5ed9('0x2'));var timeout=require(_0x5ed9('0x3'));var express=require('express');var router=express[_0x5ed9('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x5ed9('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x5ed9('0x6'));var controller=require(_0x5ed9('0x7'));router[_0x5ed9('0x8')]('/',auth['isAuthenticated'](),controller[_0x5ed9('0x9')]);router[_0x5ed9('0x8')]('/describe',auth[_0x5ed9('0xa')](),controller[_0x5ed9('0xb')]);router[_0x5ed9('0x8')](_0x5ed9('0xc'),auth[_0x5ed9('0xa')](),controller[_0x5ed9('0xd')]);router['get'](_0x5ed9('0xe'),auth[_0x5ed9('0xa')](),controller['show']);router[_0x5ed9('0x8')](_0x5ed9('0xf'),auth[_0x5ed9('0xa')](),controller['getDispositions']);router['get'](_0x5ed9('0x10'),auth[_0x5ed9('0xa')](),controller['getContacts']);router[_0x5ed9('0x8')]('/:id/contacts/csv',auth['isAuthenticated'](),controller['getContactsCsv']);router[_0x5ed9('0x8')](_0x5ed9('0x11'),auth[_0x5ed9('0xa')](),controller[_0x5ed9('0x12')]);router[_0x5ed9('0x8')]('/:id/users',auth[_0x5ed9('0xa')](),controller[_0x5ed9('0x13')]);router['post']('/',auth[_0x5ed9('0xa')](),controller[_0x5ed9('0x14')]);router[_0x5ed9('0x15')](_0x5ed9('0xf'),auth[_0x5ed9('0xa')](),controller[_0x5ed9('0x16')]);router[_0x5ed9('0x15')]('/:id/contacts',auth[_0x5ed9('0xa')](),controller[_0x5ed9('0x17')]);router[_0x5ed9('0x15')](_0x5ed9('0x11'),auth[_0x5ed9('0xa')](),controller[_0x5ed9('0x18')]);router['post'](_0x5ed9('0x19'),auth[_0x5ed9('0xa')](),controller[_0x5ed9('0x1a')]);router[_0x5ed9('0x1b')](_0x5ed9('0xe'),auth['isAuthenticated'](),controller['update']);router[_0x5ed9('0x1c')](_0x5ed9('0xe'),auth['isAuthenticated'](),controller['destroy']);router[_0x5ed9('0x1c')](_0x5ed9('0xf'),auth[_0x5ed9('0xa')](),controller[_0x5ed9('0x1d')]);router[_0x5ed9('0x1c')](_0x5ed9('0x19'),auth[_0x5ed9('0xa')](),controller[_0x5ed9('0x1e')]);module[_0x5ed9('0x1f')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index 4fa125e..ec3af0d 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 _0x8b42=['field','STRING','sequelize','exports','getDataValue'];(function(_0x589d25,_0x59d515){var _0x2ba375=function(_0x1fe32d){while(--_0x1fe32d){_0x589d25['push'](_0x589d25['shift']());}};_0x2ba375(++_0x59d515);}(_0x8b42,0x101));var _0x28b4=function(_0x1d4348,_0x2bef8b){_0x1d4348=_0x1d4348-0x0;var _0x3a226a=_0x8b42[_0x1d4348];return _0x3a226a;};'use strict';var Sequelize=require(_0x28b4('0x0'));module[_0x28b4('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x461047){return this[_0x28b4('0x2')](_0x28b4('0x3'));}},'field':{'type':Sequelize[_0x28b4('0x4')],'allowNull':![]},'operator':{'type':Sequelize[_0x28b4('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0x28b4('0x4')],'allowNull':![]}}; \ No newline at end of file +var _0xa4ca=['STRING','sequelize','exports','field'];(function(_0x456be1,_0x248c6e){var _0x43fa66=function(_0x8c0df9){while(--_0x8c0df9){_0x456be1['push'](_0x456be1['shift']());}};_0x43fa66(++_0x248c6e);}(_0xa4ca,0x125));var _0xaa4c=function(_0x203f80,_0x3c390b){_0x203f80=_0x203f80-0x0;var _0x134c89=_0xa4ca[_0x203f80];return _0x134c89;};'use strict';var Sequelize=require(_0xaa4c('0x0'));module[_0xaa4c('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x2b0b97){return this['getDataValue'](_0xaa4c('0x2'));}},'field':{'type':Sequelize[_0xaa4c('0x3')],'allowNull':![]},'operator':{'type':Sequelize[_0xaa4c('0x3')],'allowNull':![]},'value':{'type':Sequelize[_0xaa4c('0x3')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index ebdab3d..19defcc 100644 --- a/server/api/condition/condition.controller.js +++ b/server/api/condition/condition.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','body','Condition','find','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x49b41a,_0x2ecf6c){var _0x312185=function(_0x433096){while(--_0x433096){_0x49b41a['push'](_0x49b41a['shift']());}};_0x312185(++_0x2ecf6c);}(_0x7a54,0x106));var _0x47a5=function(_0x303066,_0x3d7af6){_0x303066=_0x303066-0x0;var _0x5af882=_0x7a54[_0x303066];return _0x5af882;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));}; \ No newline at end of file +var _0x9957=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','update','body','Condition','find','catch','params'];(function(_0x2baae9,_0x316d5f){var _0x4be17e=function(_0x3f78cf){while(--_0x3f78cf){_0x2baae9['push'](_0x2baae9['shift']());}};_0x4be17e(++_0x316d5f);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index f903e28..03444c6 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 _0x23a5=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./condition.attributes','exports','define','Condition','tools_conditions','lodash','util'];(function(_0x2152f3,_0x502ac8){var _0x3c8499=function(_0x154b5d){while(--_0x154b5d){_0x2152f3['push'](_0x2152f3['shift']());}};_0x3c8499(++_0x502ac8);}(_0x23a5,0x1a2));var _0x523a=function(_0x405911,_0xcd61ab){_0x405911=_0x405911-0x0;var _0x33b1ff=_0x23a5[_0x405911];return _0x33b1ff;};'use strict';var _=require(_0x523a('0x0'));var util=require(_0x523a('0x1'));var logger=require(_0x523a('0x2'))(_0x523a('0x3'));var moment=require(_0x523a('0x4'));var BPromise=require(_0x523a('0x5'));var rp=require(_0x523a('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x523a('0x7'));var config=require(_0x523a('0x8'));var attributes=require(_0x523a('0x9'));module[_0x523a('0xa')]=function(_0x2a02c5,_0x3459ac){return _0x2a02c5[_0x523a('0xb')](_0x523a('0xc'),attributes,{'tableName':_0x523a('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2bcf=['rimraf','../../config/environment','./condition.attributes','exports','define','Condition','tools_conditions','lodash','util','../../config/logger','api','moment','path'];(function(_0x35a83e,_0x694cb1){var _0x718c68=function(_0x21edfa){while(--_0x21edfa){_0x35a83e['push'](_0x35a83e['shift']());}};_0x718c68(++_0x694cb1);}(_0x2bcf,0x13f));var _0xf2bc=function(_0x45138b,_0xec2bd6){_0x45138b=_0x45138b-0x0;var _0x398884=_0x2bcf[_0x45138b];return _0x398884;};'use strict';var _=require(_0xf2bc('0x0'));var util=require(_0xf2bc('0x1'));var logger=require(_0xf2bc('0x2'))(_0xf2bc('0x3'));var moment=require(_0xf2bc('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf2bc('0x5'));var rimraf=require(_0xf2bc('0x6'));var config=require(_0xf2bc('0x7'));var attributes=require(_0xf2bc('0x8'));module[_0xf2bc('0x9')]=function(_0x2867f8,_0x79d7b3){return _0x2867f8[_0xf2bc('0xa')](_0xf2bc('0xb'),attributes,{'tableName':_0xf2bc('0xc'),'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 9984f0e..9131da4 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 _0x59ac=['../../config/utils','rpc','../../config/environment','client','http','then','info','Condition,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x172a96,_0xa28df1){var _0x4320b0=function(_0x2b6cec){while(--_0x2b6cec){_0x172a96['push'](_0x172a96['shift']());}};_0x4320b0(++_0xa28df1);}(_0x59ac,0x6c));var _0xc59a=function(_0x4a9c8b,_0xa4474f){_0x4a9c8b=_0x4a9c8b-0x0;var _0x1e2075=_0x59ac[_0x4a9c8b];return _0x1e2075;};'use strict';var _=require(_0xc59a('0x0'));var util=require(_0xc59a('0x1'));var moment=require(_0xc59a('0x2'));var BPromise=require(_0xc59a('0x3'));var rs=require(_0xc59a('0x4'));var fs=require('fs');var Redis=require(_0xc59a('0x5'));var db=require(_0xc59a('0x6'))['db'];var utils=require(_0xc59a('0x7'));var logger=require('../../config/logger')(_0xc59a('0x8'));var config=require(_0xc59a('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xc59a('0xa')][_0xc59a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x125d2b,_0x18cbfb,_0x54ea5d){return new BPromise(function(_0x5f0785,_0x39f256){return client['request'](_0x125d2b,_0x54ea5d)[_0xc59a('0xc')](function(_0xb4222c){logger[_0xc59a('0xd')](_0xc59a('0xe'),_0x18cbfb,_0xc59a('0xf'));logger[_0xc59a('0x10')]('Condition,\x20%s,\x20%s,\x20%s',_0x18cbfb,_0xc59a('0xf'),JSON[_0xc59a('0x11')](_0xb4222c));if(_0xb4222c['error']){if(_0xb4222c[_0xc59a('0x12')][_0xc59a('0x13')]===0x1f4){logger['error'](_0xc59a('0xe'),_0x18cbfb,_0xb4222c[_0xc59a('0x12')]['message']);return _0x39f256(_0xb4222c[_0xc59a('0x12')][_0xc59a('0x14')]);}logger[_0xc59a('0x12')](_0xc59a('0xe'),_0x18cbfb,_0xb4222c[_0xc59a('0x12')][_0xc59a('0x14')]);return _0x5f0785(_0xb4222c[_0xc59a('0x12')][_0xc59a('0x14')]);}else{logger[_0xc59a('0xd')](_0xc59a('0xe'),_0x18cbfb,'request\x20sent');_0x5f0785(_0xb4222c[_0xc59a('0x15')][_0xc59a('0x14')]);}})[_0xc59a('0x16')](function(_0x3a18be){logger[_0xc59a('0x12')]('Condition,\x20%s,\x20%s',_0x18cbfb,_0x3a18be);_0x39f256(_0x3a18be);});});} \ No newline at end of file +var _0xa71f=['message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','debug','Condition,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','Condition,\x20%s,\x20%s'];(function(_0x14304e,_0x509ce1){var _0x308abd=function(_0x2ba84a){while(--_0x2ba84a){_0x14304e['push'](_0x14304e['shift']());}};_0x308abd(++_0x509ce1);}(_0xa71f,0x1b8));var _0xfa71=function(_0x1da808,_0x3e244e){_0x1da808=_0x1da808-0x0;var _0x16335d=_0xa71f[_0x1da808];return _0x16335d;};'use strict';var _=require(_0xfa71('0x0'));var util=require('util');var moment=require(_0xfa71('0x1'));var BPromise=require(_0xfa71('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfa71('0x3'));var db=require(_0xfa71('0x4'))['db'];var utils=require(_0xfa71('0x5'));var logger=require(_0xfa71('0x6'))(_0xfa71('0x7'));var config=require(_0xfa71('0x8'));var jayson=require(_0xfa71('0x9'));var client=jayson[_0xfa71('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x551630,_0x5dc4fa,_0x24f7ed){return new BPromise(function(_0x2bdf99,_0x2b58f3){return client[_0xfa71('0xb')](_0x551630,_0x24f7ed)[_0xfa71('0xc')](function(_0x3e941){logger[_0xfa71('0xd')]('Condition,\x20%s,\x20%s',_0x5dc4fa,'request\x20sent');logger[_0xfa71('0xe')](_0xfa71('0xf'),_0x5dc4fa,_0xfa71('0x10'),JSON[_0xfa71('0x11')](_0x3e941));if(_0x3e941[_0xfa71('0x12')]){if(_0x3e941[_0xfa71('0x12')]['code']===0x1f4){logger[_0xfa71('0x12')](_0xfa71('0x13'),_0x5dc4fa,_0x3e941[_0xfa71('0x12')][_0xfa71('0x14')]);return _0x2b58f3(_0x3e941[_0xfa71('0x12')]['message']);}logger[_0xfa71('0x12')](_0xfa71('0x13'),_0x5dc4fa,_0x3e941[_0xfa71('0x12')][_0xfa71('0x14')]);return _0x2bdf99(_0x3e941[_0xfa71('0x12')][_0xfa71('0x14')]);}else{logger[_0xfa71('0xd')](_0xfa71('0x13'),_0x5dc4fa,_0xfa71('0x10'));_0x2bdf99(_0x3e941[_0xfa71('0x15')][_0xfa71('0x14')]);}})[_0xfa71('0x16')](function(_0x130bd7){logger['error'](_0xfa71('0x13'),_0x5dc4fa,_0x130bd7);_0x2b58f3(_0x130bd7);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 3aa6e9b..4285b81 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 _0x2a41=['delete','destroy','exports','util','path','connect-timeout','Router','../../config/environment','./condition.controller','put','/:id','isAuthenticated','update'];(function(_0x17c6d7,_0x5b1045){var _0x1e7f0e=function(_0x488fa2){while(--_0x488fa2){_0x17c6d7['push'](_0x17c6d7['shift']());}};_0x1e7f0e(++_0x5b1045);}(_0x2a41,0x189));var _0x12a4=function(_0x3994af,_0xce88ab){_0x3994af=_0x3994af-0x0;var _0x17f151=_0x2a41[_0x3994af];return _0x17f151;};'use strict';var multer=require('multer');var util=require(_0x12a4('0x0'));var path=require(_0x12a4('0x1'));var timeout=require(_0x12a4('0x2'));var express=require('express');var router=express[_0x12a4('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x12a4('0x4'));var controller=require(_0x12a4('0x5'));router[_0x12a4('0x6')](_0x12a4('0x7'),auth[_0x12a4('0x8')](),controller[_0x12a4('0x9')]);router[_0x12a4('0xa')](_0x12a4('0x7'),auth[_0x12a4('0x8')](),controller[_0x12a4('0xb')]);module[_0x12a4('0xc')]=router; \ No newline at end of file +var _0x7a96=['Router','fs-extra','../../components/auth/service','./condition.controller','put','/:id','isAuthenticated','update','delete','destroy','exports','util','connect-timeout','express'];(function(_0x36794c,_0xbdcf10){var _0x55ee17=function(_0x4b3a0d){while(--_0x4b3a0d){_0x36794c['push'](_0x36794c['shift']());}};_0x55ee17(++_0xbdcf10);}(_0x7a96,0xb3));var _0x67a9=function(_0x4452a1,_0x1d50fa){_0x4452a1=_0x4452a1-0x0;var _0x2e5604=_0x7a96[_0x4452a1];return _0x2e5604;};'use strict';var multer=require('multer');var util=require(_0x67a9('0x0'));var path=require('path');var timeout=require(_0x67a9('0x1'));var express=require(_0x67a9('0x2'));var router=express[_0x67a9('0x3')]();var fs_extra=require(_0x67a9('0x4'));var auth=require(_0x67a9('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x67a9('0x6'));router[_0x67a9('0x7')](_0x67a9('0x8'),auth[_0x67a9('0x9')](),controller[_0x67a9('0xa')]);router[_0x67a9('0xb')]('/:id',auth[_0x67a9('0x9')](),controller[_0x67a9('0xc')]);module[_0x67a9('0xd')]=router; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.attributes.js b/server/api/contactItemType/contactItemType.attributes.js index 2ffa10e..076bebe 100644 --- a/server/api/contactItemType/contactItemType.attributes.js +++ b/server/api/contactItemType/contactItemType.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8745=['name','INTEGER','sequelize','exports','STRING'];(function(_0x2fe646,_0x499357){var _0x1c1421=function(_0x48c071){while(--_0x48c071){_0x2fe646['push'](_0x2fe646['shift']());}};_0x1c1421(++_0x499357);}(_0x8745,0x124));var _0x5874=function(_0x5d53a9,_0x2fac5d){_0x5d53a9=_0x5d53a9-0x0;var _0x2d528f=_0x8745[_0x5d53a9];return _0x2d528f;};'use strict';var Sequelize=require(_0x5874('0x0'));module[_0x5874('0x1')]={'name':{'type':Sequelize[_0x5874('0x2')],'allowNull':![],'unique':_0x5874('0x3')},'OrderBy':{'type':Sequelize[_0x5874('0x4')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0x5874('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0xf637=['name','INTEGER','sequelize','exports','STRING'];(function(_0x4635d7,_0x22c150){var _0x12e7a3=function(_0x48c708){while(--_0x48c708){_0x4635d7['push'](_0x4635d7['shift']());}};_0x12e7a3(++_0x22c150);}(_0xf637,0x179));var _0x7f63=function(_0x2438b6,_0x842fd7){_0x2438b6=_0x2438b6-0x0;var _0x30bc8d=_0xf637[_0x2438b6];return _0x30bc8d;};'use strict';var Sequelize=require(_0x7f63('0x0'));module[_0x7f63('0x1')]={'name':{'type':Sequelize[_0x7f63('0x2')],'allowNull':![],'unique':_0x7f63('0x3')},'OrderBy':{'type':Sequelize[_0x7f63('0x4')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.controller.js b/server/api/contactItemType/contactItemType.controller.js index 2b94717..10e12a2 100644 --- a/server/api/contactItemType/contactItemType.controller.js +++ b/server/api/contactItemType/contactItemType.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe820=['name','index','map','rawAttributes','fieldName','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','merge','type','VIRTUAL','filter','options','ContactItemType','includeAll','include','findAll','params','catch','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','CmContactHasItem','eml-format','zip-dir','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','offset','limit','undefined','count','status','set','Content-Range','json','reject','save','update','then','destroy','get','ContactItemTypes','stack'];(function(_0x251fa4,_0x3d5860){var _0x453047=function(_0x337a6f){while(--_0x337a6f){_0x251fa4['push'](_0x251fa4['shift']());}};_0x453047(++_0x3d5860);}(_0xe820,0xd2));var _0x0e82=function(_0x318a89,_0x249651){_0x318a89=_0x318a89-0x0;var _0x9a6e76=_0xe820[_0x318a89];return _0x9a6e76;};'use strict';var emlformat=require(_0x0e82('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0e82('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0e82('0x2'));var BPromise=require(_0x0e82('0x3'));var Mustache=require(_0x0e82('0x4'));var util=require('util');var path=require(_0x0e82('0x5'));var sox=require('sox');var csv=require(_0x0e82('0x6'));var ejs=require(_0x0e82('0x7'));var fs=require('fs');var fs_extra=require(_0x0e82('0x8'));var _=require(_0x0e82('0x9'));var squel=require(_0x0e82('0xa'));var crypto=require('crypto');var jsforce=require(_0x0e82('0xb'));var deskjs=require(_0x0e82('0xc'));var toCsv=require(_0x0e82('0x6'));var querystring=require(_0x0e82('0xd'));var Papa=require(_0x0e82('0xe'));var Redis=require('ioredis');var authService=require(_0x0e82('0xf'));var qs=require(_0x0e82('0x10'));var as=require(_0x0e82('0x11'));var hardwareService=require(_0x0e82('0x12'));var logger=require(_0x0e82('0x13'))(_0x0e82('0x14'));var utils=require(_0x0e82('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x0e82('0x16'));var db=require(_0x0e82('0x17'))['db'];function respondWithStatusCode(_0x21c40b,_0x1da28a){_0x1da28a=_0x1da28a||0xcc;return function(_0x166dc2){if(_0x166dc2){return _0x21c40b[_0x0e82('0x18')](_0x1da28a);}return _0x21c40b['status'](_0x1da28a)[_0x0e82('0x19')]();};}function respondWithResult(_0x5c161c,_0x48d99b){_0x48d99b=_0x48d99b||0xc8;return function(_0x1e4ddb){if(_0x1e4ddb){return _0x5c161c['status'](_0x48d99b)['json'](_0x1e4ddb);}};}function respondWithFilteredResult(_0x5a2d28,_0x3298c7){return function(_0x4d1aa0){if(_0x4d1aa0){var _0x585b9b=typeof _0x3298c7[_0x0e82('0x1a')]==='undefined'&&typeof _0x3298c7[_0x0e82('0x1b')]===_0x0e82('0x1c');var _0x233c6d=_0x4d1aa0[_0x0e82('0x1d')];var _0x53622b=_0x585b9b?0x0:_0x3298c7[_0x0e82('0x1a')];var _0x310aac=_0x585b9b?_0x4d1aa0[_0x0e82('0x1d')]:_0x3298c7[_0x0e82('0x1a')]+_0x3298c7[_0x0e82('0x1b')];var _0x1230e6;if(_0x310aac>=_0x233c6d){_0x310aac=_0x233c6d;_0x1230e6=0xc8;}else{_0x1230e6=0xce;}_0x5a2d28[_0x0e82('0x1e')](_0x1230e6);return _0x5a2d28[_0x0e82('0x1f')](_0x0e82('0x20'),_0x53622b+'-'+_0x310aac+'/'+_0x233c6d)[_0x0e82('0x21')](_0x4d1aa0);}return null;};}function patchUpdates(_0x5903c){return function(_0x493280){try{jsonpatch['apply'](_0x493280,_0x5903c,!![]);}catch(_0x294696){return BPromise[_0x0e82('0x22')](_0x294696);}return _0x493280[_0x0e82('0x23')]();};}function saveUpdates(_0xb0a31,_0xd48046){return function(_0x1bdad4){if(_0x1bdad4){return _0x1bdad4[_0x0e82('0x24')](_0xb0a31)[_0x0e82('0x25')](function(_0x56b3ad){return _0x56b3ad;});}return null;};}function removeEntity(_0x1b71b4,_0x13f023){return function(_0x3d6c28){if(_0x3d6c28){return _0x3d6c28[_0x0e82('0x26')]()['then'](function(){var _0xee85dd=_0x3d6c28[_0x0e82('0x27')]({'plain':!![]});var _0x7a9399=_0x0e82('0x28');return db['UserProfileResource'][_0x0e82('0x26')]({'where':{'type':_0x7a9399,'resourceId':_0xee85dd['id']}})['then'](function(){return _0x3d6c28;});})['then'](function(){_0x1b71b4[_0x0e82('0x1e')](0xcc)[_0x0e82('0x19')]();});}};}function handleEntityNotFound(_0x4c5fc1,_0x19b96d){return function(_0xe3c530){if(!_0xe3c530){_0x4c5fc1[_0x0e82('0x18')](0x194);}return _0xe3c530;};}function handleError(_0x5ca9e3,_0x93d2f1){_0x93d2f1=_0x93d2f1||0x1f4;return function(_0x25fa4e){logger['error'](_0x25fa4e[_0x0e82('0x29')]);if(_0x25fa4e['name']){delete _0x25fa4e[_0x0e82('0x2a')];}_0x5ca9e3[_0x0e82('0x1e')](_0x93d2f1)['send'](_0x25fa4e);};}exports[_0x0e82('0x2b')]=function(_0x268af5,_0x661718){var _0x4d74d0={},_0x50adb7={},_0x2dc021={'count':0x0,'rows':[]};var _0x4a8c43=_[_0x0e82('0x2c')](db['ContactItemType'][_0x0e82('0x2d')],function(_0x264022){return{'name':_0x264022[_0x0e82('0x2e')],'type':_0x264022['type'][_0x0e82('0x2f')]};});_0x50adb7['model']=_[_0x0e82('0x2c')](_0x4a8c43,_0x0e82('0x2a'));_0x50adb7[_0x0e82('0x30')]=_[_0x0e82('0x31')](_0x268af5[_0x0e82('0x30')]);_0x50adb7[_0x0e82('0x32')]=_['intersection'](_0x50adb7[_0x0e82('0x33')],_0x50adb7[_0x0e82('0x30')]);_0x4d74d0[_0x0e82('0x34')]=_[_0x0e82('0x35')](_0x50adb7[_0x0e82('0x33')],qs[_0x0e82('0x36')](_0x268af5[_0x0e82('0x30')][_0x0e82('0x36')]));_0x4d74d0[_0x0e82('0x34')]=_0x4d74d0[_0x0e82('0x34')][_0x0e82('0x37')]?_0x4d74d0[_0x0e82('0x34')]:_0x50adb7[_0x0e82('0x33')];if(!_0x268af5[_0x0e82('0x30')][_0x0e82('0x38')]('nolimit')){_0x4d74d0[_0x0e82('0x1b')]=qs[_0x0e82('0x1b')](_0x268af5[_0x0e82('0x30')][_0x0e82('0x1b')]);_0x4d74d0['offset']=qs[_0x0e82('0x1a')](_0x268af5[_0x0e82('0x30')]['offset']);}_0x4d74d0[_0x0e82('0x39')]=qs['sort'](_0x268af5['query'][_0x0e82('0x3a')]);_0x4d74d0[_0x0e82('0x3b')]=qs[_0x0e82('0x32')](_[_0x0e82('0x3c')](_0x268af5[_0x0e82('0x30')],_0x50adb7[_0x0e82('0x32')]),_0x4a8c43);if(_0x268af5[_0x0e82('0x30')]['filter']){_0x4d74d0['where']=_[_0x0e82('0x3d')](_0x4d74d0[_0x0e82('0x3b')],{'$or':_[_0x0e82('0x2c')](_0x4a8c43,function(_0x135c1b){if(_0x135c1b[_0x0e82('0x3e')]!==_0x0e82('0x3f')){var _0x2abed6={};_0x2abed6[_0x135c1b[_0x0e82('0x2a')]]={'$like':'%'+_0x268af5['query'][_0x0e82('0x40')]+'%'};return _0x2abed6;}})});}_0x4d74d0=_[_0x0e82('0x3d')]({},_0x4d74d0,_0x268af5[_0x0e82('0x41')]);var _0x417389={'where':_0x4d74d0[_0x0e82('0x3b')]};return db[_0x0e82('0x42')][_0x0e82('0x1d')](_0x417389)['then'](function(_0x311cb8){_0x2dc021[_0x0e82('0x1d')]=_0x311cb8;if(_0x268af5[_0x0e82('0x30')][_0x0e82('0x43')]){_0x4d74d0[_0x0e82('0x44')]=[{'all':!![]}];}return db[_0x0e82('0x42')][_0x0e82('0x45')](_0x4d74d0);})['then'](function(_0x581764){_0x2dc021['rows']=_0x581764;return _0x2dc021;})['then'](respondWithFilteredResult(_0x661718,_0x4d74d0))['catch'](handleError(_0x661718,null));};exports['show']=function(_0x651c76,_0x182333){var _0x3d37e8={'raw':!![],'where':{'id':_0x651c76[_0x0e82('0x46')]['id']}},_0x199495={};_0x199495[_0x0e82('0x33')]=_[_0x0e82('0x31')](db[_0x0e82('0x42')]['rawAttributes']);_0x199495['query']=_[_0x0e82('0x31')](_0x651c76[_0x0e82('0x30')]);_0x199495[_0x0e82('0x32')]=_[_0x0e82('0x35')](_0x199495[_0x0e82('0x33')],_0x199495[_0x0e82('0x30')]);_0x3d37e8[_0x0e82('0x34')]=_[_0x0e82('0x35')](_0x199495['model'],qs[_0x0e82('0x36')](_0x651c76['query'][_0x0e82('0x36')]));_0x3d37e8['attributes']=_0x3d37e8[_0x0e82('0x34')]['length']?_0x3d37e8[_0x0e82('0x34')]:_0x199495[_0x0e82('0x33')];if(_0x651c76[_0x0e82('0x30')]['includeAll']){_0x3d37e8['include']=[{'all':!![]}];}_0x3d37e8=_[_0x0e82('0x3d')]({},_0x3d37e8,_0x651c76[_0x0e82('0x41')]);return db[_0x0e82('0x42')]['find'](_0x3d37e8)[_0x0e82('0x25')](handleEntityNotFound(_0x182333,null))['then'](respondWithResult(_0x182333,null))[_0x0e82('0x47')](handleError(_0x182333,null));};exports[_0x0e82('0x48')]=function(_0x162890,_0x64406e){return db[_0x0e82('0x42')][_0x0e82('0x48')](_0x162890[_0x0e82('0x49')],{})[_0x0e82('0x25')](function(_0x1bd904){var _0x287abc=_0x162890[_0x0e82('0x4a')][_0x0e82('0x27')]({'plain':!![]});if(!_0x287abc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x287abc[_0x0e82('0x4b')]===_0x0e82('0x4a')){var _0x576726=_0x1bd904[_0x0e82('0x27')]({'plain':!![]});var _0x5f4fbc='ContactItemTypes';return db[_0x0e82('0x4c')]['find']({'where':{'name':_0x5f4fbc,'userProfileId':_0x287abc[_0x0e82('0x4d')]},'raw':!![]})[_0x0e82('0x25')](function(_0x1ed324){if(_0x1ed324&&_0x1ed324[_0x0e82('0x4e')]===0x0){return db[_0x0e82('0x4f')]['create']({'name':_0x576726[_0x0e82('0x2a')],'resourceId':_0x576726['id'],'type':_0x1ed324['name'],'sectionId':_0x1ed324['id']},{})[_0x0e82('0x25')](function(){return _0x1bd904;});}else{return _0x1bd904;}})[_0x0e82('0x47')](function(_0x42c4a7){logger[_0x0e82('0x50')](_0x0e82('0x51'),_0x42c4a7);throw _0x42c4a7;});}return _0x1bd904;})['then'](respondWithResult(_0x64406e,0xc9))[_0x0e82('0x47')](handleError(_0x64406e,null));};exports[_0x0e82('0x24')]=function(_0x183808,_0x4546bd){if(_0x183808[_0x0e82('0x49')]['id']){delete _0x183808['body']['id'];}return db[_0x0e82('0x42')][_0x0e82('0x52')]({'where':{'id':_0x183808[_0x0e82('0x46')]['id']}})[_0x0e82('0x25')](handleEntityNotFound(_0x4546bd,null))[_0x0e82('0x25')](saveUpdates(_0x183808[_0x0e82('0x49')],null))[_0x0e82('0x25')](respondWithResult(_0x4546bd,null))[_0x0e82('0x47')](handleError(_0x4546bd,null));};exports[_0x0e82('0x26')]=function(_0x2852d4,_0x4cc3fd){return db['ContactItemType']['find']({'where':{'id':_0x2852d4[_0x0e82('0x46')]['id']}})['then'](handleEntityNotFound(_0x4cc3fd,null))[_0x0e82('0x25')](db[_0x0e82('0x53')]['update']({'ItemTypeId':null},{'where':{'ItemTypeId':_0x2852d4['params']['id']}}))[_0x0e82('0x25')](removeEntity(_0x4cc3fd,null))[_0x0e82('0x47')](handleError(_0x4cc3fd,null));}; \ No newline at end of file +var _0xf4f4=['json','apply','reject','save','update','then','get','ContactItemTypes','UserProfileResource','destroy','end','sendStatus','name','send','index','map','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','ContactItemType','includeAll','show','include','find','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','limit','count','set','Content-Range'];(function(_0x4cccdc,_0xe16b38){var _0x50364d=function(_0x1be7ac){while(--_0x1be7ac){_0x4cccdc['push'](_0x4cccdc['shift']());}};_0x50364d(++_0xe16b38);}(_0xf4f4,0xe3));var _0x4f4f=function(_0x4f75e7,_0x2651cb){_0x4f75e7=_0x4f75e7-0x0;var _0x546307=_0xf4f4[_0x4f75e7];return _0x546307;};'use strict';var emlformat=require(_0x4f4f('0x0'));var rimraf=require(_0x4f4f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4f4f('0x2'));var rp=require(_0x4f4f('0x3'));var moment=require(_0x4f4f('0x4'));var BPromise=require(_0x4f4f('0x5'));var Mustache=require(_0x4f4f('0x6'));var util=require('util');var path=require(_0x4f4f('0x7'));var sox=require('sox');var csv=require(_0x4f4f('0x8'));var ejs=require(_0x4f4f('0x9'));var fs=require('fs');var fs_extra=require(_0x4f4f('0xa'));var _=require(_0x4f4f('0xb'));var squel=require(_0x4f4f('0xc'));var crypto=require(_0x4f4f('0xd'));var jsforce=require(_0x4f4f('0xe'));var deskjs=require(_0x4f4f('0xf'));var toCsv=require('to-csv');var querystring=require(_0x4f4f('0x10'));var Papa=require(_0x4f4f('0x11'));var Redis=require(_0x4f4f('0x12'));var authService=require(_0x4f4f('0x13'));var qs=require(_0x4f4f('0x14'));var as=require(_0x4f4f('0x15'));var hardwareService=require(_0x4f4f('0x16'));var logger=require(_0x4f4f('0x17'))('api');var utils=require('../../config/utils');var config=require(_0x4f4f('0x18'));var licenseUtil=require(_0x4f4f('0x19'));var db=require(_0x4f4f('0x1a'))['db'];function respondWithStatusCode(_0x1b54b0,_0x282031){_0x282031=_0x282031||0xcc;return function(_0x1d7575){if(_0x1d7575){return _0x1b54b0['sendStatus'](_0x282031);}return _0x1b54b0[_0x4f4f('0x1b')](_0x282031)['end']();};}function respondWithResult(_0x216ba8,_0xe7c2d5){_0xe7c2d5=_0xe7c2d5||0xc8;return function(_0x3e16e9){if(_0x3e16e9){return _0x216ba8[_0x4f4f('0x1b')](_0xe7c2d5)['json'](_0x3e16e9);}};}function respondWithFilteredResult(_0x19f2fd,_0x4c68f4){return function(_0x47ab66){if(_0x47ab66){var _0x58de77=typeof _0x4c68f4[_0x4f4f('0x1c')]===_0x4f4f('0x1d')&&typeof _0x4c68f4[_0x4f4f('0x1e')]===_0x4f4f('0x1d');var _0x2d5e5d=_0x47ab66[_0x4f4f('0x1f')];var _0x1245c4=_0x58de77?0x0:_0x4c68f4[_0x4f4f('0x1c')];var _0x929a0b=_0x58de77?_0x47ab66[_0x4f4f('0x1f')]:_0x4c68f4[_0x4f4f('0x1c')]+_0x4c68f4[_0x4f4f('0x1e')];var _0x499277;if(_0x929a0b>=_0x2d5e5d){_0x929a0b=_0x2d5e5d;_0x499277=0xc8;}else{_0x499277=0xce;}_0x19f2fd[_0x4f4f('0x1b')](_0x499277);return _0x19f2fd[_0x4f4f('0x20')](_0x4f4f('0x21'),_0x1245c4+'-'+_0x929a0b+'/'+_0x2d5e5d)[_0x4f4f('0x22')](_0x47ab66);}return null;};}function patchUpdates(_0x302a79){return function(_0x460b4d){try{jsonpatch[_0x4f4f('0x23')](_0x460b4d,_0x302a79,!![]);}catch(_0x3e33d5){return BPromise[_0x4f4f('0x24')](_0x3e33d5);}return _0x460b4d[_0x4f4f('0x25')]();};}function saveUpdates(_0x469a1d,_0x17832f){return function(_0x17984d){if(_0x17984d){return _0x17984d[_0x4f4f('0x26')](_0x469a1d)['then'](function(_0x4f7261){return _0x4f7261;});}return null;};}function removeEntity(_0x525529,_0x272125){return function(_0x43e661){if(_0x43e661){return _0x43e661['destroy']()[_0x4f4f('0x27')](function(){var _0x15859c=_0x43e661[_0x4f4f('0x28')]({'plain':!![]});var _0x2ec92a=_0x4f4f('0x29');return db[_0x4f4f('0x2a')][_0x4f4f('0x2b')]({'where':{'type':_0x2ec92a,'resourceId':_0x15859c['id']}})['then'](function(){return _0x43e661;});})[_0x4f4f('0x27')](function(){_0x525529[_0x4f4f('0x1b')](0xcc)[_0x4f4f('0x2c')]();});}};}function handleEntityNotFound(_0x15c79c,_0x18e864){return function(_0x4ad33d){if(!_0x4ad33d){_0x15c79c[_0x4f4f('0x2d')](0x194);}return _0x4ad33d;};}function handleError(_0xaf3de1,_0x7180f8){_0x7180f8=_0x7180f8||0x1f4;return function(_0x5deda9){logger['error'](_0x5deda9['stack']);if(_0x5deda9[_0x4f4f('0x2e')]){delete _0x5deda9['name'];}_0xaf3de1[_0x4f4f('0x1b')](_0x7180f8)[_0x4f4f('0x2f')](_0x5deda9);};}exports[_0x4f4f('0x30')]=function(_0x5eb7c9,_0x460546){var _0x1b6f53={},_0x5dd5a3={},_0x413b71={'count':0x0,'rows':[]};var _0x1a551a=_[_0x4f4f('0x31')](db['ContactItemType'][_0x4f4f('0x32')],function(_0x343c75){return{'name':_0x343c75['fieldName'],'type':_0x343c75['type'][_0x4f4f('0x33')]};});_0x5dd5a3[_0x4f4f('0x34')]=_[_0x4f4f('0x31')](_0x1a551a,_0x4f4f('0x2e'));_0x5dd5a3[_0x4f4f('0x35')]=_[_0x4f4f('0x36')](_0x5eb7c9[_0x4f4f('0x35')]);_0x5dd5a3[_0x4f4f('0x37')]=_[_0x4f4f('0x38')](_0x5dd5a3[_0x4f4f('0x34')],_0x5dd5a3['query']);_0x1b6f53['attributes']=_[_0x4f4f('0x38')](_0x5dd5a3['model'],qs[_0x4f4f('0x39')](_0x5eb7c9[_0x4f4f('0x35')][_0x4f4f('0x39')]));_0x1b6f53[_0x4f4f('0x3a')]=_0x1b6f53[_0x4f4f('0x3a')][_0x4f4f('0x3b')]?_0x1b6f53[_0x4f4f('0x3a')]:_0x5dd5a3[_0x4f4f('0x34')];if(!_0x5eb7c9[_0x4f4f('0x35')][_0x4f4f('0x3c')](_0x4f4f('0x3d'))){_0x1b6f53[_0x4f4f('0x1e')]=qs['limit'](_0x5eb7c9[_0x4f4f('0x35')][_0x4f4f('0x1e')]);_0x1b6f53[_0x4f4f('0x1c')]=qs[_0x4f4f('0x1c')](_0x5eb7c9[_0x4f4f('0x35')][_0x4f4f('0x1c')]);}_0x1b6f53[_0x4f4f('0x3e')]=qs[_0x4f4f('0x3f')](_0x5eb7c9[_0x4f4f('0x35')]['sort']);_0x1b6f53[_0x4f4f('0x40')]=qs[_0x4f4f('0x37')](_[_0x4f4f('0x41')](_0x5eb7c9['query'],_0x5dd5a3['filters']),_0x1a551a);if(_0x5eb7c9[_0x4f4f('0x35')][_0x4f4f('0x42')]){_0x1b6f53[_0x4f4f('0x40')]=_[_0x4f4f('0x43')](_0x1b6f53[_0x4f4f('0x40')],{'$or':_[_0x4f4f('0x31')](_0x1a551a,function(_0x1c012d){if(_0x1c012d[_0x4f4f('0x44')]!==_0x4f4f('0x45')){var _0x455aa0={};_0x455aa0[_0x1c012d[_0x4f4f('0x2e')]]={'$like':'%'+_0x5eb7c9[_0x4f4f('0x35')]['filter']+'%'};return _0x455aa0;}})});}_0x1b6f53=_[_0x4f4f('0x43')]({},_0x1b6f53,_0x5eb7c9[_0x4f4f('0x46')]);var _0x306ee7={'where':_0x1b6f53[_0x4f4f('0x40')]};return db[_0x4f4f('0x47')]['count'](_0x306ee7)['then'](function(_0x134710){_0x413b71[_0x4f4f('0x1f')]=_0x134710;if(_0x5eb7c9[_0x4f4f('0x35')][_0x4f4f('0x48')]){_0x1b6f53['include']=[{'all':!![]}];}return db[_0x4f4f('0x47')]['findAll'](_0x1b6f53);})[_0x4f4f('0x27')](function(_0x5a7c94){_0x413b71['rows']=_0x5a7c94;return _0x413b71;})[_0x4f4f('0x27')](respondWithFilteredResult(_0x460546,_0x1b6f53))['catch'](handleError(_0x460546,null));};exports[_0x4f4f('0x49')]=function(_0x2af7a7,_0x5e1c20){var _0x220df1={'raw':!![],'where':{'id':_0x2af7a7['params']['id']}},_0x2d8ff6={};_0x2d8ff6[_0x4f4f('0x34')]=_[_0x4f4f('0x36')](db[_0x4f4f('0x47')][_0x4f4f('0x32')]);_0x2d8ff6[_0x4f4f('0x35')]=_[_0x4f4f('0x36')](_0x2af7a7[_0x4f4f('0x35')]);_0x2d8ff6[_0x4f4f('0x37')]=_[_0x4f4f('0x38')](_0x2d8ff6[_0x4f4f('0x34')],_0x2d8ff6[_0x4f4f('0x35')]);_0x220df1[_0x4f4f('0x3a')]=_[_0x4f4f('0x38')](_0x2d8ff6[_0x4f4f('0x34')],qs[_0x4f4f('0x39')](_0x2af7a7['query'][_0x4f4f('0x39')]));_0x220df1['attributes']=_0x220df1['attributes'][_0x4f4f('0x3b')]?_0x220df1[_0x4f4f('0x3a')]:_0x2d8ff6['model'];if(_0x2af7a7[_0x4f4f('0x35')][_0x4f4f('0x48')]){_0x220df1[_0x4f4f('0x4a')]=[{'all':!![]}];}_0x220df1=_[_0x4f4f('0x43')]({},_0x220df1,_0x2af7a7[_0x4f4f('0x46')]);return db['ContactItemType'][_0x4f4f('0x4b')](_0x220df1)[_0x4f4f('0x27')](handleEntityNotFound(_0x5e1c20,null))[_0x4f4f('0x27')](respondWithResult(_0x5e1c20,null))[_0x4f4f('0x4c')](handleError(_0x5e1c20,null));};exports[_0x4f4f('0x4d')]=function(_0x433787,_0x29314b){return db[_0x4f4f('0x47')][_0x4f4f('0x4d')](_0x433787['body'],{})[_0x4f4f('0x27')](function(_0xd3b763){var _0x4b33a5=_0x433787['user']['get']({'plain':!![]});if(!_0x4b33a5)throw new Error(_0x4f4f('0x4e'));if(_0x4b33a5[_0x4f4f('0x4f')]===_0x4f4f('0x50')){var _0x5c5077=_0xd3b763[_0x4f4f('0x28')]({'plain':!![]});var _0x5db92e=_0x4f4f('0x29');return db[_0x4f4f('0x51')][_0x4f4f('0x4b')]({'where':{'name':_0x5db92e,'userProfileId':_0x4b33a5[_0x4f4f('0x52')]},'raw':!![]})[_0x4f4f('0x27')](function(_0x1d0867){if(_0x1d0867&&_0x1d0867[_0x4f4f('0x53')]===0x0){return db[_0x4f4f('0x2a')][_0x4f4f('0x4d')]({'name':_0x5c5077['name'],'resourceId':_0x5c5077['id'],'type':_0x1d0867['name'],'sectionId':_0x1d0867['id']},{})[_0x4f4f('0x27')](function(){return _0xd3b763;});}else{return _0xd3b763;}})[_0x4f4f('0x4c')](function(_0x4c04eb){logger['error'](_0x4f4f('0x54'),_0x4c04eb);throw _0x4c04eb;});}return _0xd3b763;})[_0x4f4f('0x27')](respondWithResult(_0x29314b,0xc9))[_0x4f4f('0x4c')](handleError(_0x29314b,null));};exports['update']=function(_0x4a7622,_0x27c7fc){if(_0x4a7622[_0x4f4f('0x55')]['id']){delete _0x4a7622[_0x4f4f('0x55')]['id'];}return db[_0x4f4f('0x47')][_0x4f4f('0x4b')]({'where':{'id':_0x4a7622[_0x4f4f('0x56')]['id']}})[_0x4f4f('0x27')](handleEntityNotFound(_0x27c7fc,null))[_0x4f4f('0x27')](saveUpdates(_0x4a7622[_0x4f4f('0x55')],null))[_0x4f4f('0x27')](respondWithResult(_0x27c7fc,null))[_0x4f4f('0x4c')](handleError(_0x27c7fc,null));};exports['destroy']=function(_0x585c06,_0x376aea){return db[_0x4f4f('0x47')][_0x4f4f('0x4b')]({'where':{'id':_0x585c06[_0x4f4f('0x56')]['id']}})['then'](handleEntityNotFound(_0x376aea,null))[_0x4f4f('0x27')](db['CmContactHasItem'][_0x4f4f('0x26')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x585c06[_0x4f4f('0x56')]['id']}}))[_0x4f4f('0x27')](removeEntity(_0x376aea,null))['catch'](handleError(_0x376aea,null));}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.model.js b/server/api/contactItemType/contactItemType.model.js index a3a7729..aa0fd93 100644 --- a/server/api/contactItemType/contactItemType.model.js +++ b/server/api/contactItemType/contactItemType.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbedf=['moment','bluebird','request-promise','path','rimraf','./contactItemType.attributes','define','ContactItemType','lodash','util','../../config/logger'];(function(_0x2283dc,_0x2fcfc5){var _0x16db90=function(_0x376c35){while(--_0x376c35){_0x2283dc['push'](_0x2283dc['shift']());}};_0x16db90(++_0x2fcfc5);}(_0xbedf,0x105));var _0xfbed=function(_0x3db2e8,_0x49c09b){_0x3db2e8=_0x3db2e8-0x0;var _0xf05958=_0xbedf[_0x3db2e8];return _0xf05958;};'use strict';var _=require(_0xfbed('0x0'));var util=require(_0xfbed('0x1'));var logger=require(_0xfbed('0x2'))('api');var moment=require(_0xfbed('0x3'));var BPromise=require(_0xfbed('0x4'));var rp=require(_0xfbed('0x5'));var fs=require('fs');var path=require(_0xfbed('0x6'));var rimraf=require(_0xfbed('0x7'));var config=require('../../config/environment');var attributes=require(_0xfbed('0x8'));module['exports']=function(_0x148955,_0x4f13f6){return _0x148955[_0xfbed('0x9')](_0xfbed('0xa'),attributes,{'tableName':'tools_contact_item_types','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x550e=['moment','bluebird','path','rimraf','define','ContactItemType','tools_contact_item_types','lodash','util','../../config/logger','api'];(function(_0x56ebbf,_0xf0e613){var _0x43926e=function(_0x41356a){while(--_0x41356a){_0x56ebbf['push'](_0x56ebbf['shift']());}};_0x43926e(++_0xf0e613);}(_0x550e,0xd8));var _0xe550=function(_0x393685,_0x506ace){_0x393685=_0x393685-0x0;var _0x49f8e5=_0x550e[_0x393685];return _0x49f8e5;};'use strict';var _=require(_0xe550('0x0'));var util=require(_0xe550('0x1'));var logger=require(_0xe550('0x2'))(_0xe550('0x3'));var moment=require(_0xe550('0x4'));var BPromise=require(_0xe550('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe550('0x6'));var rimraf=require(_0xe550('0x7'));var config=require('../../config/environment');var attributes=require('./contactItemType.attributes');module['exports']=function(_0x1ac443,_0x3f463f){return _0x1ac443[_0xe550('0x8')](_0xe550('0x9'),attributes,{'tableName':_0xe550('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.rpc.js b/server/api/contactItemType/contactItemType.rpc.js index 1eb7549..daa176c 100644 --- a/server/api/contactItemType/contactItemType.rpc.js +++ b/server/api/contactItemType/contactItemType.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc196=['../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','request\x20sent','error','code','ContactItemType,\x20%s,\x20%s','message','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x5d255f,_0x4fdd9c){var _0xabc214=function(_0x217b87){while(--_0x217b87){_0x5d255f['push'](_0x5d255f['shift']());}};_0xabc214(++_0x4fdd9c);}(_0xc196,0x1bc));var _0x6c19=function(_0x419235,_0x674b0){_0x419235=_0x419235-0x0;var _0x4e1bde=_0xc196[_0x419235];return _0x4e1bde;};'use strict';var _=require(_0x6c19('0x0'));var util=require(_0x6c19('0x1'));var moment=require(_0x6c19('0x2'));var BPromise=require(_0x6c19('0x3'));var rs=require(_0x6c19('0x4'));var fs=require('fs');var Redis=require(_0x6c19('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6c19('0x6'))(_0x6c19('0x7'));var config=require(_0x6c19('0x8'));var jayson=require(_0x6c19('0x9'));var client=jayson[_0x6c19('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xf42f64,_0x11f505,_0x34fdff){return new BPromise(function(_0x584397,_0xd11196){return client[_0x6c19('0xb')](_0xf42f64,_0x34fdff)['then'](function(_0x1b884a){logger[_0x6c19('0xc')]('ContactItemType,\x20%s,\x20%s',_0x11f505,_0x6c19('0xd'));logger['debug']('ContactItemType,\x20%s,\x20%s,\x20%s',_0x11f505,'request\x20sent',JSON['stringify'](_0x1b884a));if(_0x1b884a['error']){if(_0x1b884a[_0x6c19('0xe')][_0x6c19('0xf')]===0x1f4){logger[_0x6c19('0xe')](_0x6c19('0x10'),_0x11f505,_0x1b884a[_0x6c19('0xe')][_0x6c19('0x11')]);return _0xd11196(_0x1b884a[_0x6c19('0xe')][_0x6c19('0x11')]);}logger[_0x6c19('0xe')](_0x6c19('0x10'),_0x11f505,_0x1b884a[_0x6c19('0xe')][_0x6c19('0x11')]);return _0x584397(_0x1b884a[_0x6c19('0xe')]['message']);}else{logger['info'](_0x6c19('0x10'),_0x11f505,_0x6c19('0xd'));_0x584397(_0x1b884a['result'][_0x6c19('0x11')]);}})['catch'](function(_0x43f436){logger['error'](_0x6c19('0x10'),_0x11f505,_0x43f436);_0xd11196(_0x43f436);});});} \ No newline at end of file +var _0x0219=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','info','ContactItemType,\x20%s,\x20%s','ContactItemType,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x43c5ca,_0x508eb4){var _0x4356b2=function(_0x16aa4a){while(--_0x16aa4a){_0x43c5ca['push'](_0x43c5ca['shift']());}};_0x4356b2(++_0x508eb4);}(_0x0219,0x15a));var _0x9021=function(_0x45e3c7,_0xdaafdb){_0x45e3c7=_0x45e3c7-0x0;var _0x21a2ce=_0x0219[_0x45e3c7];return _0x21a2ce;};'use strict';var _=require(_0x9021('0x0'));var util=require(_0x9021('0x1'));var moment=require(_0x9021('0x2'));var BPromise=require(_0x9021('0x3'));var rs=require(_0x9021('0x4'));var fs=require('fs');var Redis=require(_0x9021('0x5'));var db=require(_0x9021('0x6'))['db'];var utils=require(_0x9021('0x7'));var logger=require('../../config/logger')(_0x9021('0x8'));var config=require('../../config/environment');var jayson=require(_0x9021('0x9'));var client=jayson[_0x9021('0xa')][_0x9021('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x16e5c0,_0x10b904,_0x3d8a0f){return new BPromise(function(_0x1d17fc,_0x20d8a6){return client[_0x9021('0xc')](_0x16e5c0,_0x3d8a0f)['then'](function(_0xe58432){logger[_0x9021('0xd')](_0x9021('0xe'),_0x10b904,'request\x20sent');logger['debug'](_0x9021('0xf'),_0x10b904,_0x9021('0x10'),JSON[_0x9021('0x11')](_0xe58432));if(_0xe58432[_0x9021('0x12')]){if(_0xe58432[_0x9021('0x12')][_0x9021('0x13')]===0x1f4){logger[_0x9021('0x12')]('ContactItemType,\x20%s,\x20%s',_0x10b904,_0xe58432[_0x9021('0x12')]['message']);return _0x20d8a6(_0xe58432[_0x9021('0x12')][_0x9021('0x14')]);}logger[_0x9021('0x12')](_0x9021('0xe'),_0x10b904,_0xe58432[_0x9021('0x12')]['message']);return _0x1d17fc(_0xe58432['error'][_0x9021('0x14')]);}else{logger[_0x9021('0xd')](_0x9021('0xe'),_0x10b904,_0x9021('0x10'));_0x1d17fc(_0xe58432[_0x9021('0x15')][_0x9021('0x14')]);}})[_0x9021('0x16')](function(_0x2eae88){logger['error'](_0x9021('0xe'),_0x10b904,_0x2eae88);_0x20d8a6(_0x2eae88);});});} \ No newline at end of file diff --git a/server/api/contactItemType/index.js b/server/api/contactItemType/index.js index 72d9053..324e45d 100644 --- a/server/api/contactItemType/index.js +++ b/server/api/contactItemType/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4098=['util','path','express','Router','fs-extra','../../components/auth/service','./contactItemType.controller','get','index','isAuthenticated','show','post','create','/:id','update','exports'];(function(_0x473b96,_0x3d4e52){var _0x1651dc=function(_0xb4d6a8){while(--_0xb4d6a8){_0x473b96['push'](_0x473b96['shift']());}};_0x1651dc(++_0x3d4e52);}(_0x4098,0x120));var _0x8409=function(_0x32999b,_0x502a73){_0x32999b=_0x32999b-0x0;var _0x17d3c9=_0x4098[_0x32999b];return _0x17d3c9;};'use strict';var multer=require('multer');var util=require(_0x8409('0x0'));var path=require(_0x8409('0x1'));var timeout=require('connect-timeout');var express=require(_0x8409('0x2'));var router=express[_0x8409('0x3')]();var fs_extra=require(_0x8409('0x4'));var auth=require(_0x8409('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x8409('0x6'));router[_0x8409('0x7')]('/',auth['isAuthenticated'](),controller[_0x8409('0x8')]);router[_0x8409('0x7')]('/:id',auth[_0x8409('0x9')](),controller[_0x8409('0xa')]);router[_0x8409('0xb')]('/',auth[_0x8409('0x9')](),controller[_0x8409('0xc')]);router['put'](_0x8409('0xd'),auth[_0x8409('0x9')](),controller[_0x8409('0xe')]);router['delete'](_0x8409('0xd'),auth[_0x8409('0x9')](),controller['destroy']);module[_0x8409('0xf')]=router; \ No newline at end of file +var _0x5526=['fs-extra','../../components/interaction/service','get','isAuthenticated','/:id','show','post','create','put','update','destroy','exports','util','path','connect-timeout','express'];(function(_0x1691ae,_0x17bdc1){var _0x4d8511=function(_0x35b521){while(--_0x35b521){_0x1691ae['push'](_0x1691ae['shift']());}};_0x4d8511(++_0x17bdc1);}(_0x5526,0x17c));var _0x6552=function(_0x435348,_0x617493){_0x435348=_0x435348-0x0;var _0x35d479=_0x5526[_0x435348];return _0x35d479;};'use strict';var multer=require('multer');var util=require(_0x6552('0x0'));var path=require(_0x6552('0x1'));var timeout=require(_0x6552('0x2'));var express=require(_0x6552('0x3'));var router=express['Router']();var fs_extra=require(_0x6552('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x6552('0x5'));var config=require('../../config/environment');var controller=require('./contactItemType.controller');router[_0x6552('0x6')]('/',auth[_0x6552('0x7')](),controller['index']);router[_0x6552('0x6')](_0x6552('0x8'),auth[_0x6552('0x7')](),controller[_0x6552('0x9')]);router[_0x6552('0xa')]('/',auth['isAuthenticated'](),controller[_0x6552('0xb')]);router[_0x6552('0xc')]('/:id',auth[_0x6552('0x7')](),controller[_0x6552('0xd')]);router['delete'](_0x6552('0x8'),auth['isAuthenticated'](),controller[_0x6552('0xe')]);module[_0x6552('0xf')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 9a776aa..89ed99e 100644 --- a/server/api/dashboard/dashboard.attributes.js +++ b/server/api/dashboard/dashboard.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['exports','sequelize'];(function(_0x1a316d,_0x472695){var _0x255c71=function(_0x3da6e8){while(--_0x3da6e8){_0x1a316d['push'](_0x1a316d['shift']());}};_0x255c71(++_0x472695);}(_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')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x2032=['name','exports','STRING'];(function(_0x13db9d,_0x5aff8c){var _0x418575=function(_0x457704){while(--_0x457704){_0x13db9d['push'](_0x13db9d['shift']());}};_0x418575(++_0x5aff8c);}(_0x2032,0xd9));var _0x2203=function(_0x4f3d9c,_0x231309){_0x4f3d9c=_0x4f3d9c-0x0;var _0x5d88ff=_0x2032[_0x4f3d9c];return _0x5d88ff;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'name':{'type':Sequelize[_0x2203('0x1')],'allowNull':![],'unique':_0x2203('0x2')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 52c0684..ce9dc9b 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 _0x38be=['create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','UserProfileSection','UserProfileResource','params','iframe','attrs','value','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','attrMetric','total','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','attrSerie1','attrSerie2','attrSerie3','attrVoiceQueues','web-report','attrReport','attrRefresh','DashboardId','getItems','findOne','DashboardItem','hasOwnProperty','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','save','update','get','CustomDashboards','destroy','then','stack','name','index','Dashboard','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','nolimit','order','sort','where','pick','filter','merge','map','options','includeAll','include','findAll','show','intersection','length','find','catch'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0x38be,0x12d));var _0xe38b=function(_0x14e75e,_0x43a34d){_0x14e75e=_0x14e75e-0x0;var _0x5fc83b=_0x38be[_0x14e75e];return _0x5fc83b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe38b('0x0'));var jsonpatch=require(_0xe38b('0x1'));var rp=require(_0xe38b('0x2'));var moment=require(_0xe38b('0x3'));var BPromise=require(_0xe38b('0x4'));var Mustache=require(_0xe38b('0x5'));var util=require(_0xe38b('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xe38b('0x7'));var ejs=require(_0xe38b('0x8'));var fs=require('fs');var fs_extra=require(_0xe38b('0x9'));var _=require(_0xe38b('0xa'));var squel=require('squel');var crypto=require(_0xe38b('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xe38b('0xc'));var toCsv=require(_0xe38b('0x7'));var querystring=require(_0xe38b('0xd'));var Papa=require(_0xe38b('0xe'));var Redis=require('ioredis');var authService=require(_0xe38b('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xe38b('0x10'));var hardwareService=require(_0xe38b('0x11'));var logger=require(_0xe38b('0x12'))(_0xe38b('0x13'));var utils=require(_0xe38b('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xe38b('0x15'));var db=require(_0xe38b('0x16'))['db'];config[_0xe38b('0x17')]=_[_0xe38b('0x18')](config[_0xe38b('0x17')],{'host':_0xe38b('0x19'),'port':0x18eb});var socket=require(_0xe38b('0x1a'))(new Redis(config[_0xe38b('0x17')]));require(_0xe38b('0x1b'))[_0xe38b('0x1c')](socket);function respondWithStatusCode(_0x2610d0,_0x36e051){_0x36e051=_0x36e051||0xcc;return function(_0x49ba79){if(_0x49ba79){return _0x2610d0[_0xe38b('0x1d')](_0x36e051);}return _0x2610d0['status'](_0x36e051)[_0xe38b('0x1e')]();};}function respondWithResult(_0x236add,_0x4ad18e){_0x4ad18e=_0x4ad18e||0xc8;return function(_0x190f79){if(_0x190f79){return _0x236add[_0xe38b('0x1f')](_0x4ad18e)[_0xe38b('0x20')](_0x190f79);}};}function respondWithFilteredResult(_0x1dd808,_0x275ae2){return function(_0x3ee002){if(_0x3ee002){var _0x29061c=typeof _0x275ae2[_0xe38b('0x21')]===_0xe38b('0x22')&&typeof _0x275ae2[_0xe38b('0x23')]===_0xe38b('0x22');var _0x35f675=_0x3ee002[_0xe38b('0x24')];var _0x6fa4c2=_0x29061c?0x0:_0x275ae2[_0xe38b('0x21')];var _0x319eb6=_0x29061c?_0x3ee002[_0xe38b('0x24')]:_0x275ae2[_0xe38b('0x21')]+_0x275ae2[_0xe38b('0x23')];var _0x48c21b;if(_0x319eb6>=_0x35f675){_0x319eb6=_0x35f675;_0x48c21b=0xc8;}else{_0x48c21b=0xce;}_0x1dd808[_0xe38b('0x1f')](_0x48c21b);return _0x1dd808[_0xe38b('0x25')]('Content-Range',_0x6fa4c2+'-'+_0x319eb6+'/'+_0x35f675)[_0xe38b('0x20')](_0x3ee002);}return null;};}function patchUpdates(_0x37b7fe){return function(_0x17a936){try{jsonpatch[_0xe38b('0x26')](_0x17a936,_0x37b7fe,!![]);}catch(_0x5def70){return BPromise[_0xe38b('0x27')](_0x5def70);}return _0x17a936[_0xe38b('0x28')]();};}function saveUpdates(_0x17e044,_0x4f7252){return function(_0xb17049){if(_0xb17049){return _0xb17049[_0xe38b('0x29')](_0x17e044)['then'](function(_0x5de6b8){return _0x5de6b8;});}return null;};}function removeEntity(_0x4a5bd5,_0x2fd361){return function(_0x373230){if(_0x373230){return _0x373230['destroy']()['then'](function(){var _0x324874=_0x373230[_0xe38b('0x2a')]({'plain':!![]});var _0x3001ed=_0xe38b('0x2b');return db['UserProfileResource'][_0xe38b('0x2c')]({'where':{'type':_0x3001ed,'resourceId':_0x324874['id']}})[_0xe38b('0x2d')](function(){return _0x373230;});})[_0xe38b('0x2d')](function(){_0x4a5bd5['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5aaf09,_0x2c67d3){return function(_0x3d8164){if(!_0x3d8164){_0x5aaf09[_0xe38b('0x1d')](0x194);}return _0x3d8164;};}function handleError(_0x194246,_0x9889f1){_0x9889f1=_0x9889f1||0x1f4;return function(_0x7ca1b3){logger['error'](_0x7ca1b3[_0xe38b('0x2e')]);if(_0x7ca1b3[_0xe38b('0x2f')]){delete _0x7ca1b3[_0xe38b('0x2f')];}_0x194246['status'](_0x9889f1)['send'](_0x7ca1b3);};}exports[_0xe38b('0x30')]=function(_0x3f3772,_0x4f86be){var _0x378483={},_0xa0ded9={},_0x216b4b={'count':0x0,'rows':[]};var _0x470e7c=_['map'](db[_0xe38b('0x31')][_0xe38b('0x32')],function(_0x58a579){return{'name':_0x58a579[_0xe38b('0x33')],'type':_0x58a579[_0xe38b('0x34')][_0xe38b('0x35')]};});_0xa0ded9[_0xe38b('0x36')]=_['map'](_0x470e7c,_0xe38b('0x2f'));_0xa0ded9[_0xe38b('0x37')]=_[_0xe38b('0x38')](_0x3f3772['query']);_0xa0ded9[_0xe38b('0x39')]=_['intersection'](_0xa0ded9['model'],_0xa0ded9['query']);_0x378483[_0xe38b('0x3a')]=_['intersection'](_0xa0ded9[_0xe38b('0x36')],qs['fields'](_0x3f3772['query'][_0xe38b('0x3b')]));_0x378483[_0xe38b('0x3a')]=_0x378483[_0xe38b('0x3a')]['length']?_0x378483[_0xe38b('0x3a')]:_0xa0ded9[_0xe38b('0x36')];if(!_0x3f3772[_0xe38b('0x37')]['hasOwnProperty'](_0xe38b('0x3c'))){_0x378483[_0xe38b('0x23')]=qs['limit'](_0x3f3772[_0xe38b('0x37')][_0xe38b('0x23')]);_0x378483['offset']=qs[_0xe38b('0x21')](_0x3f3772[_0xe38b('0x37')][_0xe38b('0x21')]);}_0x378483[_0xe38b('0x3d')]=qs[_0xe38b('0x3e')](_0x3f3772[_0xe38b('0x37')][_0xe38b('0x3e')]);_0x378483[_0xe38b('0x3f')]=qs[_0xe38b('0x39')](_[_0xe38b('0x40')](_0x3f3772[_0xe38b('0x37')],_0xa0ded9[_0xe38b('0x39')]),_0x470e7c);if(_0x3f3772[_0xe38b('0x37')][_0xe38b('0x41')]){_0x378483[_0xe38b('0x3f')]=_[_0xe38b('0x42')](_0x378483[_0xe38b('0x3f')],{'$or':_[_0xe38b('0x43')](_0x470e7c,function(_0x169dd6){if(_0x169dd6[_0xe38b('0x34')]!=='VIRTUAL'){var _0x32780b={};_0x32780b[_0x169dd6[_0xe38b('0x2f')]]={'$like':'%'+_0x3f3772[_0xe38b('0x37')][_0xe38b('0x41')]+'%'};return _0x32780b;}})});}_0x378483=_[_0xe38b('0x42')]({},_0x378483,_0x3f3772[_0xe38b('0x44')]);var _0x5790f0={'where':_0x378483[_0xe38b('0x3f')]};return db[_0xe38b('0x31')][_0xe38b('0x24')](_0x5790f0)[_0xe38b('0x2d')](function(_0x4e8be2){_0x216b4b['count']=_0x4e8be2;if(_0x3f3772[_0xe38b('0x37')][_0xe38b('0x45')]){_0x378483[_0xe38b('0x46')]=[{'all':!![]}];}return db[_0xe38b('0x31')][_0xe38b('0x47')](_0x378483);})[_0xe38b('0x2d')](function(_0x4a3ca3){_0x216b4b['rows']=_0x4a3ca3;return _0x216b4b;})[_0xe38b('0x2d')](respondWithFilteredResult(_0x4f86be,_0x378483))['catch'](handleError(_0x4f86be,null));};exports[_0xe38b('0x48')]=function(_0x5ebbb9,_0x48a97c){var _0x2a9b25={'raw':![],'where':{'id':_0x5ebbb9['params']['id']}},_0x5323b2={};_0x5323b2[_0xe38b('0x36')]=_[_0xe38b('0x38')](db['Dashboard'][_0xe38b('0x32')]);_0x5323b2[_0xe38b('0x37')]=_[_0xe38b('0x38')](_0x5ebbb9[_0xe38b('0x37')]);_0x5323b2[_0xe38b('0x39')]=_[_0xe38b('0x49')](_0x5323b2[_0xe38b('0x36')],_0x5323b2[_0xe38b('0x37')]);_0x2a9b25[_0xe38b('0x3a')]=_[_0xe38b('0x49')](_0x5323b2[_0xe38b('0x36')],qs['fields'](_0x5ebbb9['query'][_0xe38b('0x3b')]));_0x2a9b25[_0xe38b('0x3a')]=_0x2a9b25[_0xe38b('0x3a')][_0xe38b('0x4a')]?_0x2a9b25[_0xe38b('0x3a')]:_0x5323b2[_0xe38b('0x36')];if(_0x5ebbb9['query'][_0xe38b('0x45')]){_0x2a9b25[_0xe38b('0x46')]=[{'all':!![]}];}_0x2a9b25=_[_0xe38b('0x42')]({},_0x2a9b25,_0x5ebbb9[_0xe38b('0x44')]);return db['Dashboard'][_0xe38b('0x4b')](_0x2a9b25)[_0xe38b('0x2d')](handleEntityNotFound(_0x48a97c,null))['then'](respondWithResult(_0x48a97c,null))[_0xe38b('0x4c')](handleError(_0x48a97c,null));};exports[_0xe38b('0x4d')]=function(_0x168ec0,_0x928525){return db[_0xe38b('0x31')][_0xe38b('0x4d')](_0x168ec0[_0xe38b('0x4e')],{})['then'](function(_0x47c367){var _0x24502a=_0x168ec0[_0xe38b('0x4f')][_0xe38b('0x2a')]({'plain':!![]});if(!_0x24502a)throw new Error(_0xe38b('0x50'));if(_0x24502a[_0xe38b('0x51')]==='user'){var _0x28febf=_0x47c367[_0xe38b('0x2a')]({'plain':!![]});var _0x1868d2=_0xe38b('0x2b');return db['UserProfileSection']['find']({'where':{'name':_0x1868d2,'userProfileId':_0x24502a[_0xe38b('0x52')]},'raw':!![]})[_0xe38b('0x2d')](function(_0x81c4c1){if(_0x81c4c1&&_0x81c4c1[_0xe38b('0x53')]===0x0){return db['UserProfileResource'][_0xe38b('0x4d')]({'name':_0x28febf[_0xe38b('0x2f')],'resourceId':_0x28febf['id'],'type':_0x81c4c1[_0xe38b('0x2f')],'sectionId':_0x81c4c1['id']},{})[_0xe38b('0x2d')](function(){return _0x47c367;});}else{return _0x47c367;}})['catch'](function(_0x16191a){logger[_0xe38b('0x54')](_0xe38b('0x55'),_0x16191a);throw _0x16191a;});}return _0x47c367;})['then'](respondWithResult(_0x928525,0xc9))[_0xe38b('0x4c')](handleError(_0x928525,null));};exports[_0xe38b('0x56')]=function(_0x52c181,_0x3b2284){var _0x30034d={'where':{'id':_0x52c181['params']['id']}},_0x493f34={};_0x493f34[_0xe38b('0x36')]=_['keys'](db[_0xe38b('0x31')]['rawAttributes']);_0x30034d['attributes']=_[_0xe38b('0x49')](_0x493f34[_0xe38b('0x36')],qs[_0xe38b('0x3b')](_0x52c181['query']['fields']));_0x30034d[_0xe38b('0x3a')]=_0x30034d[_0xe38b('0x3a')][_0xe38b('0x4a')]?_0x30034d[_0xe38b('0x3a')]:_0x493f34[_0xe38b('0x36')];if(_0x52c181[_0xe38b('0x37')]['includeAll']){_0x30034d[_0xe38b('0x46')]=[{'all':!![]}];}_0x30034d=_[_0xe38b('0x42')]({},_0x30034d,_0x52c181['options']);return db[_0xe38b('0x31')][_0xe38b('0x4b')](_0x30034d)[_0xe38b('0x2d')](handleEntityNotFound(_0x3b2284,null))[_0xe38b('0x2d')](function(_0x5fe430){if(_0x5fe430){var _0x406a8e=_0x5fe430[_0xe38b('0x2a')]({'plain':!![]});_0x406a8e=qs[_0xe38b('0x57')](_0x406a8e,['id',_0xe38b('0x58'),_0xe38b('0x59')]);_0x52c181[_0xe38b('0x4e')]=_[_0xe38b('0x57')](_0x52c181[_0xe38b('0x4e')],['id',_0xe38b('0x58'),_0xe38b('0x59')]);return db[_0xe38b('0x31')][_0xe38b('0x4d')](_[_0xe38b('0x42')](_0x406a8e,_0x52c181[_0xe38b('0x4e')]),{'include':_0x52c181['query']['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x1c64ee){var _0x2cf323=_0x52c181[_0xe38b('0x4f')]['get']({'plain':!![]});if(!_0x2cf323)throw new Error(_0xe38b('0x50'));if(_0x2cf323['role']===_0xe38b('0x4f')){var _0x48d5dd=_0x1c64ee[_0xe38b('0x2a')]({'plain':!![]});var _0x546ab1=_0xe38b('0x2b');return db[_0xe38b('0x5a')][_0xe38b('0x4b')]({'where':{'name':_0x546ab1,'userProfileId':_0x2cf323[_0xe38b('0x52')]},'raw':!![]})['then'](function(_0x5165dd){if(_0x5165dd&&_0x5165dd[_0xe38b('0x53')]===0x0){return db[_0xe38b('0x5b')][_0xe38b('0x4d')]({'name':_0x48d5dd[_0xe38b('0x2f')],'resourceId':_0x48d5dd['id'],'type':_0x5165dd[_0xe38b('0x2f')],'sectionId':_0x5165dd['id']},{})[_0xe38b('0x2d')](function(){return _0x1c64ee;});}else{return _0x1c64ee;}})[_0xe38b('0x4c')](function(_0x2a6ef5){logger[_0xe38b('0x54')](_0xe38b('0x55'),_0x2a6ef5);throw _0x2a6ef5;});}return _0x1c64ee;});}})[_0xe38b('0x2d')](respondWithResult(_0x3b2284,0xc9))[_0xe38b('0x4c')](handleError(_0x3b2284,null));};exports[_0xe38b('0x29')]=function(_0x4bf691,_0x28a41c){if(_0x4bf691[_0xe38b('0x4e')]['id']){delete _0x4bf691[_0xe38b('0x4e')]['id'];}return db['Dashboard']['find']({'where':{'id':_0x4bf691[_0xe38b('0x5c')]['id']}})[_0xe38b('0x2d')](handleEntityNotFound(_0x28a41c,null))[_0xe38b('0x2d')](saveUpdates(_0x4bf691[_0xe38b('0x4e')],null))['then'](respondWithResult(_0x28a41c,null))[_0xe38b('0x4c')](handleError(_0x28a41c,null));};exports[_0xe38b('0x2c')]=function(_0x25dadc,_0x1f016b){return db[_0xe38b('0x31')][_0xe38b('0x4b')]({'where':{'id':_0x25dadc['params']['id']}})[_0xe38b('0x2d')](handleEntityNotFound(_0x1f016b,null))['then'](removeEntity(_0x1f016b,null))[_0xe38b('0x4c')](handleError(_0x1f016b,null));};function widgetAttributes(_0x46af85){try{switch(_0x46af85['type']){case _0xe38b('0x5d'):return[{'name':'attrUrl','value':_0x46af85['attrUrl']||(_0x46af85[_0xe38b('0x5e')]&&_0x46af85['attrs'][0x0]?_0x46af85[_0xe38b('0x5e')][0x0][_0xe38b('0x5f')]:undefined)||'https://'}];case _0xe38b('0x60'):return[{'name':'attrPath','value':_0x46af85[_0xe38b('0x61')]||(_0x46af85[_0xe38b('0x5e')]&&_0x46af85['attrs'][0x0]?_0x46af85[_0xe38b('0x5e')][0x0][_0xe38b('0x5f')]:undefined)||''}];case _0xe38b('0x62'):return[{'name':_0xe38b('0x63'),'value':_0x46af85[_0xe38b('0x63')]||(_0x46af85[_0xe38b('0x5e')]&&_0x46af85['attrs'][0x0]?_0x46af85[_0xe38b('0x5e')][0x0][_0xe38b('0x5f')]:undefined)||_0xe38b('0x64')},{'name':_0xe38b('0x65'),'value':_0x46af85[_0xe38b('0x65')]||(_0x46af85[_0xe38b('0x5e')]&&_0x46af85[_0xe38b('0x5e')][0x1]?_0x46af85[_0xe38b('0x5e')][0x1][_0xe38b('0x5f')]:undefined)||_0xe38b('0x66')},{'name':_0xe38b('0x67'),'value':_0x46af85[_0xe38b('0x67')]||(_0x46af85[_0xe38b('0x5e')]&&_0x46af85[_0xe38b('0x5e')][0x2]?_0x46af85[_0xe38b('0x5e')][0x2][_0xe38b('0x5f')]:undefined)||0xc}];case'counter':return[{'name':'attrMetric','value':_0x46af85[_0xe38b('0x68')]||(_0x46af85[_0xe38b('0x5e')]&&_0x46af85[_0xe38b('0x5e')][0x0]?_0x46af85[_0xe38b('0x5e')][0x0][_0xe38b('0x5f')]:undefined)||_0xe38b('0x69')},{'name':'attrVoiceQueues','value':_0x46af85['attrVoiceQueues']||(_0x46af85[_0xe38b('0x5e')]&&_0x46af85['attrs'][0x1]?_0x46af85[_0xe38b('0x5e')][0x1][_0xe38b('0x5f')]:undefined)||[]},{'name':_0xe38b('0x67'),'value':_0x46af85[_0xe38b('0x67')]||(_0x46af85['attrs']&&_0x46af85[_0xe38b('0x5e')][0x2]?_0x46af85['attrs'][0x2][_0xe38b('0x5f')]:undefined)||0x14},{'name':'attrChannel','value':_0x46af85[_0xe38b('0x6a')]||(_0x46af85[_0xe38b('0x5e')]&&_0x46af85[_0xe38b('0x5e')][0x3]?_0x46af85[_0xe38b('0x5e')][0x3][_0xe38b('0x5f')]:undefined)||_0xe38b('0x6b')},{'name':_0xe38b('0x6c'),'value':_0x46af85['attrEmailAccounts']||(_0x46af85[_0xe38b('0x5e')]&&_0x46af85[_0xe38b('0x5e')][0x4]?_0x46af85[_0xe38b('0x5e')][0x4][_0xe38b('0x5f')]:undefined)||''},{'name':_0xe38b('0x6d'),'value':_0x46af85[_0xe38b('0x6d')]||(_0x46af85[_0xe38b('0x5e')]&&_0x46af85[_0xe38b('0x5e')][0x5]?_0x46af85['attrs'][0x5][_0xe38b('0x5f')]:undefined)||''},{'name':_0xe38b('0x6e'),'value':_0x46af85[_0xe38b('0x6e')]||(_0x46af85[_0xe38b('0x5e')]&&_0x46af85[_0xe38b('0x5e')][0x6]?_0x46af85[_0xe38b('0x5e')][0x6][_0xe38b('0x5f')]:undefined)||''},{'name':_0xe38b('0x6f'),'value':_0x46af85[_0xe38b('0x6f')]||(_0x46af85[_0xe38b('0x5e')]&&_0x46af85[_0xe38b('0x5e')][0x7]?_0x46af85[_0xe38b('0x5e')][0x7][_0xe38b('0x5f')]:undefined)||''},{'name':_0xe38b('0x70'),'value':_0x46af85[_0xe38b('0x70')]||(_0x46af85[_0xe38b('0x5e')]&&_0x46af85['attrs'][0x8]?_0x46af85[_0xe38b('0x5e')][0x8]['value']:undefined)||''},{'name':_0xe38b('0x71'),'value':_0x46af85[_0xe38b('0x71')]||(_0x46af85[_0xe38b('0x5e')]&&_0x46af85[_0xe38b('0x5e')][0x9]?_0x46af85[_0xe38b('0x5e')][0x9][_0xe38b('0x5f')]:undefined)||''}];case'multibar-chart':case'pie-chart':return[{'name':_0xe38b('0x72'),'value':_0x46af85[_0xe38b('0x72')]||(_0x46af85[_0xe38b('0x5e')]&&_0x46af85[_0xe38b('0x5e')][0x0]?_0x46af85['attrs'][0x0][_0xe38b('0x5f')]:undefined)||_0xe38b('0x69')},{'name':_0xe38b('0x73'),'value':_0x46af85[_0xe38b('0x73')]||(_0x46af85[_0xe38b('0x5e')]&&_0x46af85[_0xe38b('0x5e')][0x1]?_0x46af85[_0xe38b('0x5e')][0x1][_0xe38b('0x5f')]:undefined)||null},{'name':_0xe38b('0x74'),'value':_0x46af85[_0xe38b('0x74')]||(_0x46af85[_0xe38b('0x5e')]&&_0x46af85[_0xe38b('0x5e')][0x2]?_0x46af85[_0xe38b('0x5e')][0x2]['value']:undefined)||null},{'name':_0xe38b('0x75'),'value':_0x46af85[_0xe38b('0x75')]||(_0x46af85[_0xe38b('0x5e')]&&_0x46af85[_0xe38b('0x5e')][0x3]?_0x46af85[_0xe38b('0x5e')][0x3][_0xe38b('0x5f')]:undefined)||[]},{'name':_0xe38b('0x6a'),'value':_0x46af85['attrChannel']||(_0x46af85[_0xe38b('0x5e')]&&_0x46af85[_0xe38b('0x5e')][0x4]?_0x46af85['attrs'][0x4][_0xe38b('0x5f')]:undefined)||'voice'},{'name':_0xe38b('0x6c'),'value':_0x46af85['attrEmailAccounts']||(_0x46af85['attrs']&&_0x46af85[_0xe38b('0x5e')][0x5]?_0x46af85[_0xe38b('0x5e')][0x5]['value']:undefined)||''},{'name':_0xe38b('0x6d'),'value':_0x46af85['attrFaxAccounts']||(_0x46af85[_0xe38b('0x5e')]&&_0x46af85[_0xe38b('0x5e')][0x6]?_0x46af85['attrs'][0x6]['value']:undefined)||''},{'name':_0xe38b('0x6e'),'value':_0x46af85[_0xe38b('0x6e')]||(_0x46af85[_0xe38b('0x5e')]&&_0x46af85[_0xe38b('0x5e')][0x7]?_0x46af85['attrs'][0x7][_0xe38b('0x5f')]:undefined)||''},{'name':_0xe38b('0x6f'),'value':_0x46af85['attrOpenchannelAccounts']||(_0x46af85[_0xe38b('0x5e')]&&_0x46af85[_0xe38b('0x5e')][0x8]?_0x46af85[_0xe38b('0x5e')][0x8][_0xe38b('0x5f')]:undefined)||''},{'name':_0xe38b('0x70'),'value':_0x46af85[_0xe38b('0x70')]||(_0x46af85[_0xe38b('0x5e')]&&_0x46af85[_0xe38b('0x5e')][0x9]?_0x46af85[_0xe38b('0x5e')][0x9][_0xe38b('0x5f')]:undefined)||''},{'name':'attrChatWebsites','value':_0x46af85[_0xe38b('0x71')]||(_0x46af85['attrs']&&_0x46af85[_0xe38b('0x5e')][0xa]?_0x46af85[_0xe38b('0x5e')][0xa][_0xe38b('0x5f')]:undefined)||''}];case _0xe38b('0x76'):return[{'name':_0xe38b('0x77'),'type':_0x46af85['reportType']||(_0x46af85['attrs']&&_0x46af85['attrs'][0x0]?_0x46af85['attrs'][0x0][_0xe38b('0x34')]:undefined)||null,'value':_0x46af85[_0xe38b('0x77')]||(_0x46af85[_0xe38b('0x5e')]&&_0x46af85[_0xe38b('0x5e')][0x0]?_0x46af85[_0xe38b('0x5e')][0x0]['value']:undefined)||null},{'name':_0xe38b('0x78'),'value':_0x46af85['attrRefresh']||(_0x46af85[_0xe38b('0x5e')]&&_0x46af85['attrs'][0x1]?_0x46af85[_0xe38b('0x5e')][0x1][_0xe38b('0x5f')]:undefined)||0x0}];default:return[];}}catch(_0x43f9a){logger[_0xe38b('0x54')]('widgetAttributes:\x20%s',JSON['stringify'](_0x43f9a));return[];}}exports['addItem']=function(_0x2de31e,_0x57325e,_0x1dee94){if(_0x2de31e[_0xe38b('0x4e')]['id']){delete _0x2de31e[_0xe38b('0x4e')]['id'];}return db[_0xe38b('0x31')][_0xe38b('0x4b')]({'where':{'id':_0x2de31e[_0xe38b('0x5c')]['id']}})[_0xe38b('0x2d')](handleEntityNotFound(_0x57325e,null))[_0xe38b('0x2d')](function(_0xd0cc0b){if(_0xd0cc0b){_0x2de31e[_0xe38b('0x4e')][_0xe38b('0x79')]=_0xd0cc0b['id'];_0x2de31e[_0xe38b('0x4e')][_0xe38b('0x5e')]=widgetAttributes(_0x2de31e[_0xe38b('0x4e')]);return db['DashboardItem'][_0xe38b('0x4d')](_0x2de31e[_0xe38b('0x4e')]);}})[_0xe38b('0x2d')](respondWithResult(_0x57325e,null))[_0xe38b('0x4c')](handleError(_0x57325e,null));};exports[_0xe38b('0x7a')]=function(_0xd9d11c,_0x5dbc29,_0x50ee59){var _0x5da68c={};var _0x53d73d={};var _0x188075;var _0x1ed20c;return db['Dashboard'][_0xe38b('0x7b')]({'where':{'id':_0xd9d11c[_0xe38b('0x5c')]['id']}})[_0xe38b('0x2d')](handleEntityNotFound(_0x5dbc29,null))[_0xe38b('0x2d')](function(_0x58171b){if(_0x58171b){_0x188075=_0x58171b;_0x53d73d[_0xe38b('0x36')]=_[_0xe38b('0x38')](db[_0xe38b('0x7c')]['rawAttributes']);_0x53d73d[_0xe38b('0x37')]=_[_0xe38b('0x38')](_0xd9d11c[_0xe38b('0x37')]);_0x53d73d['filters']=_[_0xe38b('0x49')](_0x53d73d[_0xe38b('0x36')],_0x53d73d[_0xe38b('0x37')]);_0x5da68c[_0xe38b('0x3a')]=_[_0xe38b('0x49')](_0x53d73d[_0xe38b('0x36')],qs[_0xe38b('0x3b')](_0xd9d11c[_0xe38b('0x37')][_0xe38b('0x3b')]));_0x5da68c[_0xe38b('0x3a')]=_0x5da68c[_0xe38b('0x3a')][_0xe38b('0x4a')]?_0x5da68c['attributes']:_0x53d73d[_0xe38b('0x36')];_0x5da68c['order']=qs['sort'](_0xd9d11c[_0xe38b('0x37')][_0xe38b('0x3e')]);_0x5da68c['where']=qs['filters'](_[_0xe38b('0x40')](_0xd9d11c[_0xe38b('0x37')],_0x53d73d['filters']));if(_0xd9d11c['query'][_0xe38b('0x41')]){_0x5da68c[_0xe38b('0x3f')]=_[_0xe38b('0x42')](_0x5da68c[_0xe38b('0x3f')],{'$or':_[_0xe38b('0x43')](_0x5da68c[_0xe38b('0x3a')],function(_0x3e5583){var _0x2602e4={};_0x2602e4[_0x3e5583]={'$like':'%'+_0xd9d11c['query'][_0xe38b('0x41')]+'%'};return _0x2602e4;})});}_0x5da68c=_[_0xe38b('0x42')]({},_0x5da68c,_0xd9d11c['options']);return _0x188075[_0xe38b('0x7a')](_0x5da68c);}})[_0xe38b('0x2d')](function(_0x264aef){if(_0x264aef){_0x1ed20c=_0x264aef[_0xe38b('0x4a')];if(!_0xd9d11c[_0xe38b('0x37')][_0xe38b('0x7d')]('nolimit')){_0x5da68c[_0xe38b('0x23')]=qs[_0xe38b('0x23')](_0xd9d11c[_0xe38b('0x37')][_0xe38b('0x23')]);_0x5da68c[_0xe38b('0x21')]=qs['offset'](_0xd9d11c[_0xe38b('0x37')][_0xe38b('0x21')]);}return _0x188075[_0xe38b('0x7a')](_0x5da68c);}})['then'](function(_0x1651f2){if(_0x1651f2){return _0x1651f2?{'count':_0x1ed20c,'rows':_0x1651f2}:null;}})[_0xe38b('0x2d')](respondWithResult(_0x5dbc29,null))[_0xe38b('0x4c')](handleError(_0x5dbc29,null));}; \ No newline at end of file +var _0x6e06=['../../config/license/util','defaults','redis','localhost','register','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','CustomDashboards','error','stack','name','send','index','map','Dashboard','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','rows','catch','rawAttributes','keys','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','options','createdAt','updatedAt','omit','user','autoAssociation','params','iframe','attrUrl','attrs','custom','attrPath','clock','attrHourFormat','value','HH:mm:ss','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','attrSerie1','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','getItems','DashboardItem','rimraf','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x50e59d,_0x1e83be){var _0x1adddc=function(_0xfceb19){while(--_0xfceb19){_0x50e59d['push'](_0x50e59d['shift']());}};_0x1adddc(++_0x1e83be);}(_0x6e06,0x15d));var _0x66e0=function(_0x50b985,_0x1d0004){_0x50b985=_0x50b985-0x0;var _0x5a5902=_0x6e06[_0x50b985];return _0x5a5902;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x66e0('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x66e0('0x1'));var rp=require('request-promise');var moment=require(_0x66e0('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x66e0('0x3'));var util=require(_0x66e0('0x4'));var path=require(_0x66e0('0x5'));var sox=require(_0x66e0('0x6'));var csv=require(_0x66e0('0x7'));var ejs=require(_0x66e0('0x8'));var fs=require('fs');var fs_extra=require(_0x66e0('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x66e0('0xa'));var jsforce=require(_0x66e0('0xb'));var deskjs=require(_0x66e0('0xc'));var toCsv=require(_0x66e0('0x7'));var querystring=require(_0x66e0('0xd'));var Papa=require(_0x66e0('0xe'));var Redis=require(_0x66e0('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x66e0('0x10'));var as=require(_0x66e0('0x11'));var hardwareService=require(_0x66e0('0x12'));var logger=require(_0x66e0('0x13'))(_0x66e0('0x14'));var utils=require(_0x66e0('0x15'));var config=require(_0x66e0('0x16'));var licenseUtil=require(_0x66e0('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x66e0('0x18')](config[_0x66e0('0x19')],{'host':_0x66e0('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./dashboard.socket')[_0x66e0('0x1b')](socket);function respondWithStatusCode(_0x5dcf12,_0x5b668d){_0x5b668d=_0x5b668d||0xcc;return function(_0x211c18){if(_0x211c18){return _0x5dcf12[_0x66e0('0x1c')](_0x5b668d);}return _0x5dcf12[_0x66e0('0x1d')](_0x5b668d)['end']();};}function respondWithResult(_0x44d3f5,_0x2674e6){_0x2674e6=_0x2674e6||0xc8;return function(_0x42849b){if(_0x42849b){return _0x44d3f5[_0x66e0('0x1d')](_0x2674e6)[_0x66e0('0x1e')](_0x42849b);}};}function respondWithFilteredResult(_0x4fdbdb,_0xb1fba9){return function(_0x2d5f7f){if(_0x2d5f7f){var _0x4e6520=typeof _0xb1fba9['offset']===_0x66e0('0x1f')&&typeof _0xb1fba9[_0x66e0('0x20')]===_0x66e0('0x1f');var _0x1c9cee=_0x2d5f7f[_0x66e0('0x21')];var _0x2cdc5f=_0x4e6520?0x0:_0xb1fba9['offset'];var _0x44618c=_0x4e6520?_0x2d5f7f[_0x66e0('0x21')]:_0xb1fba9[_0x66e0('0x22')]+_0xb1fba9[_0x66e0('0x20')];var _0x244972;if(_0x44618c>=_0x1c9cee){_0x44618c=_0x1c9cee;_0x244972=0xc8;}else{_0x244972=0xce;}_0x4fdbdb['status'](_0x244972);return _0x4fdbdb[_0x66e0('0x23')](_0x66e0('0x24'),_0x2cdc5f+'-'+_0x44618c+'/'+_0x1c9cee)[_0x66e0('0x1e')](_0x2d5f7f);}return null;};}function patchUpdates(_0x4fb388){return function(_0x2978b7){try{jsonpatch[_0x66e0('0x25')](_0x2978b7,_0x4fb388,!![]);}catch(_0x1b6baf){return BPromise['reject'](_0x1b6baf);}return _0x2978b7[_0x66e0('0x26')]();};}function saveUpdates(_0x31e92c,_0x1d90ae){return function(_0x28c34){if(_0x28c34){return _0x28c34[_0x66e0('0x27')](_0x31e92c)[_0x66e0('0x28')](function(_0x55ff26){return _0x55ff26;});}return null;};}function removeEntity(_0x3b2af9,_0x222384){return function(_0x322c61){if(_0x322c61){return _0x322c61[_0x66e0('0x29')]()[_0x66e0('0x28')](function(){var _0x5adc67=_0x322c61['get']({'plain':!![]});var _0x34c691=_0x66e0('0x2a');return db['UserProfileResource']['destroy']({'where':{'type':_0x34c691,'resourceId':_0x5adc67['id']}})[_0x66e0('0x28')](function(){return _0x322c61;});})[_0x66e0('0x28')](function(){_0x3b2af9[_0x66e0('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x10568a,_0x21fb6a){return function(_0x114003){if(!_0x114003){_0x10568a[_0x66e0('0x1c')](0x194);}return _0x114003;};}function handleError(_0x2c345e,_0x3973d5){_0x3973d5=_0x3973d5||0x1f4;return function(_0x4d5a05){logger[_0x66e0('0x2b')](_0x4d5a05[_0x66e0('0x2c')]);if(_0x4d5a05[_0x66e0('0x2d')]){delete _0x4d5a05['name'];}_0x2c345e[_0x66e0('0x1d')](_0x3973d5)[_0x66e0('0x2e')](_0x4d5a05);};}exports[_0x66e0('0x2f')]=function(_0x3d44a2,_0x215383){var _0x8bb537={},_0x24c2ae={},_0x2db84c={'count':0x0,'rows':[]};var _0xfe8137=_[_0x66e0('0x30')](db[_0x66e0('0x31')]['rawAttributes'],function(_0x5e9dbe){return{'name':_0x5e9dbe[_0x66e0('0x32')],'type':_0x5e9dbe[_0x66e0('0x33')][_0x66e0('0x34')]};});_0x24c2ae[_0x66e0('0x35')]=_['map'](_0xfe8137,_0x66e0('0x2d'));_0x24c2ae[_0x66e0('0x36')]=_['keys'](_0x3d44a2[_0x66e0('0x36')]);_0x24c2ae[_0x66e0('0x37')]=_[_0x66e0('0x38')](_0x24c2ae[_0x66e0('0x35')],_0x24c2ae[_0x66e0('0x36')]);_0x8bb537[_0x66e0('0x39')]=_[_0x66e0('0x38')](_0x24c2ae[_0x66e0('0x35')],qs[_0x66e0('0x3a')](_0x3d44a2['query'][_0x66e0('0x3a')]));_0x8bb537[_0x66e0('0x39')]=_0x8bb537['attributes'][_0x66e0('0x3b')]?_0x8bb537[_0x66e0('0x39')]:_0x24c2ae[_0x66e0('0x35')];if(!_0x3d44a2[_0x66e0('0x36')][_0x66e0('0x3c')](_0x66e0('0x3d'))){_0x8bb537['limit']=qs[_0x66e0('0x20')](_0x3d44a2[_0x66e0('0x36')][_0x66e0('0x20')]);_0x8bb537[_0x66e0('0x22')]=qs[_0x66e0('0x22')](_0x3d44a2[_0x66e0('0x36')][_0x66e0('0x22')]);}_0x8bb537[_0x66e0('0x3e')]=qs[_0x66e0('0x3f')](_0x3d44a2['query'][_0x66e0('0x3f')]);_0x8bb537['where']=qs[_0x66e0('0x37')](_[_0x66e0('0x40')](_0x3d44a2[_0x66e0('0x36')],_0x24c2ae[_0x66e0('0x37')]),_0xfe8137);if(_0x3d44a2[_0x66e0('0x36')][_0x66e0('0x41')]){_0x8bb537[_0x66e0('0x42')]=_[_0x66e0('0x43')](_0x8bb537['where'],{'$or':_['map'](_0xfe8137,function(_0x34b955){if(_0x34b955[_0x66e0('0x33')]!==_0x66e0('0x44')){var _0x2bbf76={};_0x2bbf76[_0x34b955['name']]={'$like':'%'+_0x3d44a2[_0x66e0('0x36')][_0x66e0('0x41')]+'%'};return _0x2bbf76;}})});}_0x8bb537=_[_0x66e0('0x43')]({},_0x8bb537,_0x3d44a2['options']);var _0x2e0b93={'where':_0x8bb537[_0x66e0('0x42')]};return db['Dashboard'][_0x66e0('0x21')](_0x2e0b93)['then'](function(_0x5727f0){_0x2db84c[_0x66e0('0x21')]=_0x5727f0;if(_0x3d44a2[_0x66e0('0x36')][_0x66e0('0x45')]){_0x8bb537[_0x66e0('0x46')]=[{'all':!![]}];}return db[_0x66e0('0x31')]['findAll'](_0x8bb537);})[_0x66e0('0x28')](function(_0x45924c){_0x2db84c[_0x66e0('0x47')]=_0x45924c;return _0x2db84c;})[_0x66e0('0x28')](respondWithFilteredResult(_0x215383,_0x8bb537))[_0x66e0('0x48')](handleError(_0x215383,null));};exports['show']=function(_0x12d921,_0x2c345a){var _0xe4d50a={'raw':![],'where':{'id':_0x12d921['params']['id']}},_0x5ddeff={};_0x5ddeff[_0x66e0('0x35')]=_['keys'](db[_0x66e0('0x31')][_0x66e0('0x49')]);_0x5ddeff[_0x66e0('0x36')]=_[_0x66e0('0x4a')](_0x12d921[_0x66e0('0x36')]);_0x5ddeff['filters']=_['intersection'](_0x5ddeff[_0x66e0('0x35')],_0x5ddeff[_0x66e0('0x36')]);_0xe4d50a[_0x66e0('0x39')]=_['intersection'](_0x5ddeff[_0x66e0('0x35')],qs[_0x66e0('0x3a')](_0x12d921['query'][_0x66e0('0x3a')]));_0xe4d50a['attributes']=_0xe4d50a[_0x66e0('0x39')][_0x66e0('0x3b')]?_0xe4d50a[_0x66e0('0x39')]:_0x5ddeff[_0x66e0('0x35')];if(_0x12d921[_0x66e0('0x36')][_0x66e0('0x45')]){_0xe4d50a[_0x66e0('0x46')]=[{'all':!![]}];}_0xe4d50a=_[_0x66e0('0x43')]({},_0xe4d50a,_0x12d921['options']);return db[_0x66e0('0x31')][_0x66e0('0x4b')](_0xe4d50a)[_0x66e0('0x28')](handleEntityNotFound(_0x2c345a,null))[_0x66e0('0x28')](respondWithResult(_0x2c345a,null))[_0x66e0('0x48')](handleError(_0x2c345a,null));};exports[_0x66e0('0x4c')]=function(_0xa2b3be,_0x478d36){return db[_0x66e0('0x31')][_0x66e0('0x4c')](_0xa2b3be[_0x66e0('0x4d')],{})[_0x66e0('0x28')](function(_0x146423){var _0x2fbffb=_0xa2b3be['user'][_0x66e0('0x4e')]({'plain':!![]});if(!_0x2fbffb)throw new Error(_0x66e0('0x4f'));if(_0x2fbffb[_0x66e0('0x50')]==='user'){var _0x306bee=_0x146423[_0x66e0('0x4e')]({'plain':!![]});var _0x871e96=_0x66e0('0x2a');return db[_0x66e0('0x51')][_0x66e0('0x4b')]({'where':{'name':_0x871e96,'userProfileId':_0x2fbffb['userProfileId']},'raw':!![]})['then'](function(_0x4fd665){if(_0x4fd665&&_0x4fd665['autoAssociation']===0x0){return db[_0x66e0('0x52')][_0x66e0('0x4c')]({'name':_0x306bee[_0x66e0('0x2d')],'resourceId':_0x306bee['id'],'type':_0x4fd665[_0x66e0('0x2d')],'sectionId':_0x4fd665['id']},{})[_0x66e0('0x28')](function(){return _0x146423;});}else{return _0x146423;}})['catch'](function(_0x11c619){logger[_0x66e0('0x2b')](_0x66e0('0x53'),_0x11c619);throw _0x11c619;});}return _0x146423;})['then'](respondWithResult(_0x478d36,0xc9))[_0x66e0('0x48')](handleError(_0x478d36,null));};exports[_0x66e0('0x54')]=function(_0x2b17cd,_0x40425a){var _0x3ab520={'where':{'id':_0x2b17cd['params']['id']}},_0x3c8c71={};_0x3c8c71[_0x66e0('0x35')]=_['keys'](db[_0x66e0('0x31')][_0x66e0('0x49')]);_0x3ab520['attributes']=_[_0x66e0('0x38')](_0x3c8c71[_0x66e0('0x35')],qs['fields'](_0x2b17cd[_0x66e0('0x36')]['fields']));_0x3ab520['attributes']=_0x3ab520['attributes'][_0x66e0('0x3b')]?_0x3ab520[_0x66e0('0x39')]:_0x3c8c71[_0x66e0('0x35')];if(_0x2b17cd['query'][_0x66e0('0x45')]){_0x3ab520[_0x66e0('0x46')]=[{'all':!![]}];}_0x3ab520=_[_0x66e0('0x43')]({},_0x3ab520,_0x2b17cd[_0x66e0('0x55')]);return db[_0x66e0('0x31')]['find'](_0x3ab520)['then'](handleEntityNotFound(_0x40425a,null))[_0x66e0('0x28')](function(_0x4df93c){if(_0x4df93c){var _0x2e9781=_0x4df93c[_0x66e0('0x4e')]({'plain':!![]});_0x2e9781=qs['omit'](_0x2e9781,['id',_0x66e0('0x56'),_0x66e0('0x57')]);_0x2b17cd[_0x66e0('0x4d')]=_[_0x66e0('0x58')](_0x2b17cd[_0x66e0('0x4d')],['id',_0x66e0('0x56'),'updatedAt']);return db[_0x66e0('0x31')][_0x66e0('0x4c')](_[_0x66e0('0x43')](_0x2e9781,_0x2b17cd[_0x66e0('0x4d')]),{'include':_0x2b17cd[_0x66e0('0x36')][_0x66e0('0x45')]?[{'all':!![]}]:undefined})[_0x66e0('0x28')](function(_0x226d0c){var _0x161964=_0x2b17cd['user'][_0x66e0('0x4e')]({'plain':!![]});if(!_0x161964)throw new Error(_0x66e0('0x4f'));if(_0x161964['role']===_0x66e0('0x59')){var _0x525471=_0x226d0c[_0x66e0('0x4e')]({'plain':!![]});var _0x20794e=_0x66e0('0x2a');return db[_0x66e0('0x51')][_0x66e0('0x4b')]({'where':{'name':_0x20794e,'userProfileId':_0x161964['userProfileId']},'raw':!![]})[_0x66e0('0x28')](function(_0x54ad0b){if(_0x54ad0b&&_0x54ad0b[_0x66e0('0x5a')]===0x0){return db[_0x66e0('0x52')][_0x66e0('0x4c')]({'name':_0x525471[_0x66e0('0x2d')],'resourceId':_0x525471['id'],'type':_0x54ad0b['name'],'sectionId':_0x54ad0b['id']},{})[_0x66e0('0x28')](function(){return _0x226d0c;});}else{return _0x226d0c;}})[_0x66e0('0x48')](function(_0x1e416f){logger[_0x66e0('0x2b')](_0x66e0('0x53'),_0x1e416f);throw _0x1e416f;});}return _0x226d0c;});}})[_0x66e0('0x28')](respondWithResult(_0x40425a,0xc9))[_0x66e0('0x48')](handleError(_0x40425a,null));};exports[_0x66e0('0x27')]=function(_0xba9b2,_0x5549e8){if(_0xba9b2['body']['id']){delete _0xba9b2['body']['id'];}return db['Dashboard'][_0x66e0('0x4b')]({'where':{'id':_0xba9b2[_0x66e0('0x5b')]['id']}})[_0x66e0('0x28')](handleEntityNotFound(_0x5549e8,null))['then'](saveUpdates(_0xba9b2[_0x66e0('0x4d')],null))['then'](respondWithResult(_0x5549e8,null))[_0x66e0('0x48')](handleError(_0x5549e8,null));};exports[_0x66e0('0x29')]=function(_0x12927c,_0x5223aa){return db['Dashboard'][_0x66e0('0x4b')]({'where':{'id':_0x12927c['params']['id']}})[_0x66e0('0x28')](handleEntityNotFound(_0x5223aa,null))[_0x66e0('0x28')](removeEntity(_0x5223aa,null))[_0x66e0('0x48')](handleError(_0x5223aa,null));};function widgetAttributes(_0x7751d0){try{switch(_0x7751d0[_0x66e0('0x33')]){case _0x66e0('0x5c'):return[{'name':_0x66e0('0x5d'),'value':_0x7751d0[_0x66e0('0x5d')]||(_0x7751d0[_0x66e0('0x5e')]&&_0x7751d0[_0x66e0('0x5e')][0x0]?_0x7751d0[_0x66e0('0x5e')][0x0]['value']:undefined)||'https://'}];case _0x66e0('0x5f'):return[{'name':_0x66e0('0x60'),'value':_0x7751d0['attrPath']||(_0x7751d0[_0x66e0('0x5e')]&&_0x7751d0[_0x66e0('0x5e')][0x0]?_0x7751d0[_0x66e0('0x5e')][0x0]['value']:undefined)||''}];case _0x66e0('0x61'):return[{'name':_0x66e0('0x62'),'value':_0x7751d0[_0x66e0('0x62')]||(_0x7751d0[_0x66e0('0x5e')]&&_0x7751d0[_0x66e0('0x5e')][0x0]?_0x7751d0['attrs'][0x0][_0x66e0('0x63')]:undefined)||_0x66e0('0x64')},{'name':'attrTimezone','value':_0x7751d0['attrTimezone']||(_0x7751d0['attrs']&&_0x7751d0[_0x66e0('0x5e')][0x1]?_0x7751d0['attrs'][0x1][_0x66e0('0x63')]:undefined)||'0.00'},{'name':_0x66e0('0x65'),'value':_0x7751d0['attrFontSize']||(_0x7751d0[_0x66e0('0x5e')]&&_0x7751d0['attrs'][0x2]?_0x7751d0[_0x66e0('0x5e')][0x2]['value']:undefined)||0xc}];case _0x66e0('0x66'):return[{'name':_0x66e0('0x67'),'value':_0x7751d0[_0x66e0('0x67')]||(_0x7751d0['attrs']&&_0x7751d0[_0x66e0('0x5e')][0x0]?_0x7751d0[_0x66e0('0x5e')][0x0][_0x66e0('0x63')]:undefined)||_0x66e0('0x68')},{'name':_0x66e0('0x69'),'value':_0x7751d0['attrVoiceQueues']||(_0x7751d0['attrs']&&_0x7751d0[_0x66e0('0x5e')][0x1]?_0x7751d0[_0x66e0('0x5e')][0x1][_0x66e0('0x63')]:undefined)||[]},{'name':_0x66e0('0x65'),'value':_0x7751d0[_0x66e0('0x65')]||(_0x7751d0[_0x66e0('0x5e')]&&_0x7751d0[_0x66e0('0x5e')][0x2]?_0x7751d0[_0x66e0('0x5e')][0x2]['value']:undefined)||0x14},{'name':_0x66e0('0x6a'),'value':_0x7751d0[_0x66e0('0x6a')]||(_0x7751d0[_0x66e0('0x5e')]&&_0x7751d0[_0x66e0('0x5e')][0x3]?_0x7751d0[_0x66e0('0x5e')][0x3][_0x66e0('0x63')]:undefined)||_0x66e0('0x6b')},{'name':_0x66e0('0x6c'),'value':_0x7751d0[_0x66e0('0x6c')]||(_0x7751d0[_0x66e0('0x5e')]&&_0x7751d0[_0x66e0('0x5e')][0x4]?_0x7751d0[_0x66e0('0x5e')][0x4][_0x66e0('0x63')]:undefined)||''},{'name':_0x66e0('0x6d'),'value':_0x7751d0[_0x66e0('0x6d')]||(_0x7751d0[_0x66e0('0x5e')]&&_0x7751d0[_0x66e0('0x5e')][0x5]?_0x7751d0[_0x66e0('0x5e')][0x5][_0x66e0('0x63')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x7751d0[_0x66e0('0x6e')]||(_0x7751d0[_0x66e0('0x5e')]&&_0x7751d0[_0x66e0('0x5e')][0x6]?_0x7751d0[_0x66e0('0x5e')][0x6]['value']:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x7751d0[_0x66e0('0x6f')]||(_0x7751d0[_0x66e0('0x5e')]&&_0x7751d0[_0x66e0('0x5e')][0x7]?_0x7751d0[_0x66e0('0x5e')][0x7][_0x66e0('0x63')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x7751d0[_0x66e0('0x70')]||(_0x7751d0['attrs']&&_0x7751d0[_0x66e0('0x5e')][0x8]?_0x7751d0[_0x66e0('0x5e')][0x8][_0x66e0('0x63')]:undefined)||''},{'name':'attrChatWebsites','value':_0x7751d0[_0x66e0('0x71')]||(_0x7751d0['attrs']&&_0x7751d0[_0x66e0('0x5e')][0x9]?_0x7751d0[_0x66e0('0x5e')][0x9]['value']:undefined)||''}];case _0x66e0('0x72'):case'pie-chart':return[{'name':_0x66e0('0x73'),'value':_0x7751d0[_0x66e0('0x73')]||(_0x7751d0[_0x66e0('0x5e')]&&_0x7751d0['attrs'][0x0]?_0x7751d0[_0x66e0('0x5e')][0x0][_0x66e0('0x63')]:undefined)||_0x66e0('0x68')},{'name':'attrSerie2','value':_0x7751d0['attrSerie2']||(_0x7751d0['attrs']&&_0x7751d0['attrs'][0x1]?_0x7751d0['attrs'][0x1]['value']:undefined)||null},{'name':_0x66e0('0x74'),'value':_0x7751d0[_0x66e0('0x74')]||(_0x7751d0['attrs']&&_0x7751d0['attrs'][0x2]?_0x7751d0['attrs'][0x2][_0x66e0('0x63')]:undefined)||null},{'name':_0x66e0('0x69'),'value':_0x7751d0['attrVoiceQueues']||(_0x7751d0[_0x66e0('0x5e')]&&_0x7751d0[_0x66e0('0x5e')][0x3]?_0x7751d0[_0x66e0('0x5e')][0x3][_0x66e0('0x63')]:undefined)||[]},{'name':_0x66e0('0x6a'),'value':_0x7751d0[_0x66e0('0x6a')]||(_0x7751d0[_0x66e0('0x5e')]&&_0x7751d0['attrs'][0x4]?_0x7751d0[_0x66e0('0x5e')][0x4][_0x66e0('0x63')]:undefined)||_0x66e0('0x6b')},{'name':_0x66e0('0x6c'),'value':_0x7751d0[_0x66e0('0x6c')]||(_0x7751d0['attrs']&&_0x7751d0[_0x66e0('0x5e')][0x5]?_0x7751d0[_0x66e0('0x5e')][0x5][_0x66e0('0x63')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x7751d0[_0x66e0('0x6d')]||(_0x7751d0[_0x66e0('0x5e')]&&_0x7751d0[_0x66e0('0x5e')][0x6]?_0x7751d0[_0x66e0('0x5e')][0x6][_0x66e0('0x63')]:undefined)||''},{'name':_0x66e0('0x6e'),'value':_0x7751d0[_0x66e0('0x6e')]||(_0x7751d0[_0x66e0('0x5e')]&&_0x7751d0['attrs'][0x7]?_0x7751d0[_0x66e0('0x5e')][0x7][_0x66e0('0x63')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x7751d0['attrOpenchannelAccounts']||(_0x7751d0['attrs']&&_0x7751d0[_0x66e0('0x5e')][0x8]?_0x7751d0[_0x66e0('0x5e')][0x8][_0x66e0('0x63')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x7751d0['attrWhatsappAccounts']||(_0x7751d0['attrs']&&_0x7751d0[_0x66e0('0x5e')][0x9]?_0x7751d0['attrs'][0x9]['value']:undefined)||''},{'name':_0x66e0('0x71'),'value':_0x7751d0[_0x66e0('0x71')]||(_0x7751d0[_0x66e0('0x5e')]&&_0x7751d0[_0x66e0('0x5e')][0xa]?_0x7751d0['attrs'][0xa][_0x66e0('0x63')]:undefined)||''}];case _0x66e0('0x75'):return[{'name':_0x66e0('0x76'),'type':_0x7751d0[_0x66e0('0x77')]||(_0x7751d0[_0x66e0('0x5e')]&&_0x7751d0[_0x66e0('0x5e')][0x0]?_0x7751d0['attrs'][0x0][_0x66e0('0x33')]:undefined)||null,'value':_0x7751d0[_0x66e0('0x76')]||(_0x7751d0[_0x66e0('0x5e')]&&_0x7751d0[_0x66e0('0x5e')][0x0]?_0x7751d0[_0x66e0('0x5e')][0x0][_0x66e0('0x63')]:undefined)||null},{'name':_0x66e0('0x78'),'value':_0x7751d0[_0x66e0('0x78')]||(_0x7751d0[_0x66e0('0x5e')]&&_0x7751d0[_0x66e0('0x5e')][0x1]?_0x7751d0[_0x66e0('0x5e')][0x1][_0x66e0('0x63')]:undefined)||0x0}];default:return[];}}catch(_0x468c4f){logger[_0x66e0('0x2b')](_0x66e0('0x79'),JSON['stringify'](_0x468c4f));return[];}}exports['addItem']=function(_0x186217,_0x7fbfec,_0x42dbdb){if(_0x186217[_0x66e0('0x4d')]['id']){delete _0x186217['body']['id'];}return db[_0x66e0('0x31')][_0x66e0('0x4b')]({'where':{'id':_0x186217['params']['id']}})[_0x66e0('0x28')](handleEntityNotFound(_0x7fbfec,null))[_0x66e0('0x28')](function(_0x553c7a){if(_0x553c7a){_0x186217[_0x66e0('0x4d')]['DashboardId']=_0x553c7a['id'];_0x186217['body'][_0x66e0('0x5e')]=widgetAttributes(_0x186217[_0x66e0('0x4d')]);return db['DashboardItem'][_0x66e0('0x4c')](_0x186217['body']);}})['then'](respondWithResult(_0x7fbfec,null))[_0x66e0('0x48')](handleError(_0x7fbfec,null));};exports[_0x66e0('0x7a')]=function(_0xc6adcf,_0x1dbf82,_0x54dd1e){var _0xfd4cdc={};var _0x263fde={};var _0x4f7858;var _0x32a60d;return db[_0x66e0('0x31')]['findOne']({'where':{'id':_0xc6adcf[_0x66e0('0x5b')]['id']}})[_0x66e0('0x28')](handleEntityNotFound(_0x1dbf82,null))[_0x66e0('0x28')](function(_0x5e3d2c){if(_0x5e3d2c){_0x4f7858=_0x5e3d2c;_0x263fde[_0x66e0('0x35')]=_[_0x66e0('0x4a')](db[_0x66e0('0x7b')]['rawAttributes']);_0x263fde['query']=_[_0x66e0('0x4a')](_0xc6adcf['query']);_0x263fde['filters']=_['intersection'](_0x263fde[_0x66e0('0x35')],_0x263fde['query']);_0xfd4cdc['attributes']=_[_0x66e0('0x38')](_0x263fde[_0x66e0('0x35')],qs[_0x66e0('0x3a')](_0xc6adcf[_0x66e0('0x36')][_0x66e0('0x3a')]));_0xfd4cdc[_0x66e0('0x39')]=_0xfd4cdc[_0x66e0('0x39')]['length']?_0xfd4cdc[_0x66e0('0x39')]:_0x263fde['model'];_0xfd4cdc[_0x66e0('0x3e')]=qs[_0x66e0('0x3f')](_0xc6adcf[_0x66e0('0x36')][_0x66e0('0x3f')]);_0xfd4cdc[_0x66e0('0x42')]=qs[_0x66e0('0x37')](_['pick'](_0xc6adcf[_0x66e0('0x36')],_0x263fde[_0x66e0('0x37')]));if(_0xc6adcf['query'][_0x66e0('0x41')]){_0xfd4cdc[_0x66e0('0x42')]=_[_0x66e0('0x43')](_0xfd4cdc['where'],{'$or':_[_0x66e0('0x30')](_0xfd4cdc[_0x66e0('0x39')],function(_0x2ed432){var _0x312890={};_0x312890[_0x2ed432]={'$like':'%'+_0xc6adcf[_0x66e0('0x36')][_0x66e0('0x41')]+'%'};return _0x312890;})});}_0xfd4cdc=_['merge']({},_0xfd4cdc,_0xc6adcf[_0x66e0('0x55')]);return _0x4f7858[_0x66e0('0x7a')](_0xfd4cdc);}})[_0x66e0('0x28')](function(_0x342594){if(_0x342594){_0x32a60d=_0x342594[_0x66e0('0x3b')];if(!_0xc6adcf['query']['hasOwnProperty']('nolimit')){_0xfd4cdc[_0x66e0('0x20')]=qs[_0x66e0('0x20')](_0xc6adcf[_0x66e0('0x36')][_0x66e0('0x20')]);_0xfd4cdc[_0x66e0('0x22')]=qs[_0x66e0('0x22')](_0xc6adcf[_0x66e0('0x36')][_0x66e0('0x22')]);}return _0x4f7858['getItems'](_0xfd4cdc);}})[_0x66e0('0x28')](function(_0x4f64b9){if(_0x4f64b9){return _0x4f64b9?{'count':_0x32a60d,'rows':_0x4f64b9}:null;}})[_0x66e0('0x28')](respondWithResult(_0x1dbf82,null))[_0x66e0('0x48')](handleError(_0x1dbf82,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 9a38c79..cc4abfc 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 _0x80cf=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','Dashboard','remove'];(function(_0x55d223,_0x5beb55){var _0x3f25fd=function(_0x3f76ab){while(--_0x3f76ab){_0x55d223['push'](_0x55d223['shift']());}};_0x3f25fd(++_0x5beb55);}(_0x80cf,0xfc));var _0xf80c=function(_0x5e3a81,_0x503b60){_0x5e3a81=_0x5e3a81-0x0;var _0x427153=_0x80cf[_0x5e3a81];return _0x427153;};'use strict';var EventEmitter=require(_0xf80c('0x0'));var Dashboard=require(_0xf80c('0x1'))['db'][_0xf80c('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xf80c('0x3')};function emitEvent(_0x1f88c8){return function(_0x2af261,_0x444c16,_0x18be93){DashboardEvents[_0xf80c('0x4')](_0x1f88c8+':'+_0x2af261['id'],_0x2af261);DashboardEvents[_0xf80c('0x4')](_0x1f88c8,_0x2af261);_0x18be93(null);};}for(var e in events){if(events[_0xf80c('0x5')](e)){var event=events[e];Dashboard[_0xf80c('0x6')](e,emitEvent(event));}}module[_0xf80c('0x7')]=DashboardEvents; \ No newline at end of file +var _0xdde0=['exports','events','../../mysqldb','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xdde0,0xbe));var _0x0dde=function(_0xf64595,_0x3bcfe7){_0xf64595=_0xf64595-0x0;var _0x54e02b=_0xdde0[_0xf64595];return _0x54e02b;};'use strict';var EventEmitter=require(_0x0dde('0x0'));var Dashboard=require(_0x0dde('0x1'))['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0dde('0x2'),'afterUpdate':_0x0dde('0x3'),'afterDestroy':_0x0dde('0x4')};function emitEvent(_0x22ea0d){return function(_0x3d0b4b,_0x4fbd83,_0x25ede3){DashboardEvents[_0x0dde('0x5')](_0x22ea0d+':'+_0x3d0b4b['id'],_0x3d0b4b);DashboardEvents['emit'](_0x22ea0d,_0x3d0b4b);_0x25ede3(null);};}for(var e in events){if(events[_0x0dde('0x6')](e)){var event=events[e];Dashboard[_0x0dde('0x7')](e,emitEvent(event));}}module[_0x0dde('0x8')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index c9e0114..8ca69d7 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 _0xf08f=['util','../../config/logger','moment','bluebird','path','define','Dashboard','dashboards','lodash'];(function(_0x241235,_0x127344){var _0x17c631=function(_0x2e0773){while(--_0x2e0773){_0x241235['push'](_0x241235['shift']());}};_0x17c631(++_0x127344);}(_0xf08f,0x7d));var _0xff08=function(_0x263a2f,_0x1e81e3){_0x263a2f=_0x263a2f-0x0;var _0x8020e8=_0xf08f[_0x263a2f];return _0x8020e8;};'use strict';var _=require(_0xff08('0x0'));var util=require(_0xff08('0x1'));var logger=require(_0xff08('0x2'))('api');var moment=require(_0xff08('0x3'));var BPromise=require(_0xff08('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xff08('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./dashboard.attributes');module['exports']=function(_0x55401e,_0x55d113){return _0x55401e[_0xff08('0x6')](_0xff08('0x7'),attributes,{'tableName':_0xff08('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbe5b=['exports','define','Dashboard','dashboards','lodash','util','api','rimraf','../../config/environment'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xbe5b,0x199));var _0xbbe5=function(_0x22f50f,_0x197663){_0x22f50f=_0x22f50f-0x0;var _0x1ea403=_0xbe5b[_0x22f50f];return _0x1ea403;};'use strict';var _=require(_0xbbe5('0x0'));var util=require(_0xbbe5('0x1'));var logger=require('../../config/logger')(_0xbbe5('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xbbe5('0x3'));var config=require(_0xbbe5('0x4'));var attributes=require('./dashboard.attributes');module[_0xbbe5('0x5')]=function(_0x189288,_0x476d5b){return _0x189288[_0xbbe5('0x6')](_0xbbe5('0x7'),attributes,{'tableName':_0xbbe5('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.rpc.js b/server/api/dashboard/dashboard.rpc.js index 4c4be46..ad8b888 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 _0x8ac0=['error','code','message','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','socket.io-emitter','./dashboard.socket','register','request','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x8ac0,0xbb));var _0x08ac=function(_0xa0600b,_0x7e0886){_0xa0600b=_0xa0600b-0x0;var _0xb59ffa=_0x8ac0[_0xa0600b];return _0xb59ffa;};'use strict';var _=require(_0x08ac('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x08ac('0x1'));var rs=require(_0x08ac('0x2'));var fs=require('fs');var Redis=require(_0x08ac('0x3'));var db=require(_0x08ac('0x4'))['db'];var utils=require(_0x08ac('0x5'));var logger=require(_0x08ac('0x6'))(_0x08ac('0x7'));var config=require(_0x08ac('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x08ac('0x9')][_0x08ac('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x08ac('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x08ac('0xc'))(new Redis(config[_0x08ac('0xb')]));require(_0x08ac('0xd'))[_0x08ac('0xe')](socket);function respondWithRpcPromise(_0x1e08e4,_0x11fbb0,_0x22a778){return new BPromise(function(_0x1571cc,_0x2197ef){return client[_0x08ac('0xf')](_0x1e08e4,_0x22a778)['then'](function(_0x403a47){logger[_0x08ac('0x10')](_0x08ac('0x11'),_0x11fbb0,_0x08ac('0x12'));logger[_0x08ac('0x13')]('Dashboard,\x20%s,\x20%s,\x20%s',_0x11fbb0,_0x08ac('0x12'),JSON['stringify'](_0x403a47));if(_0x403a47[_0x08ac('0x14')]){if(_0x403a47[_0x08ac('0x14')][_0x08ac('0x15')]===0x1f4){logger['error'](_0x08ac('0x11'),_0x11fbb0,_0x403a47[_0x08ac('0x14')]['message']);return _0x2197ef(_0x403a47[_0x08ac('0x14')][_0x08ac('0x16')]);}logger[_0x08ac('0x14')](_0x08ac('0x11'),_0x11fbb0,_0x403a47['error'][_0x08ac('0x16')]);return _0x1571cc(_0x403a47[_0x08ac('0x14')]['message']);}else{logger[_0x08ac('0x10')](_0x08ac('0x11'),_0x11fbb0,'request\x20sent');_0x1571cc(_0x403a47['result']['message']);}})['catch'](function(_0x1fe797){logger['error'](_0x08ac('0x11'),_0x11fbb0,_0x1fe797);_0x2197ef(_0x1fe797);});});} \ No newline at end of file +var _0x7bed=['message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','request','then','info','request\x20sent','debug','stringify','error','Dashboard,\x20%s,\x20%s'];(function(_0x170f9d,_0xba5fad){var _0x44d5f5=function(_0x1a165f){while(--_0x1a165f){_0x170f9d['push'](_0x170f9d['shift']());}};_0x44d5f5(++_0xba5fad);}(_0x7bed,0x1e8));var _0xd7be=function(_0x3c498f,_0x1a9eef){_0x3c498f=_0x3c498f-0x0;var _0x2104b8=_0x7bed[_0x3c498f];return _0x2104b8;};'use strict';var _=require(_0xd7be('0x0'));var util=require(_0xd7be('0x1'));var moment=require(_0xd7be('0x2'));var BPromise=require(_0xd7be('0x3'));var rs=require(_0xd7be('0x4'));var fs=require('fs');var Redis=require(_0xd7be('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xd7be('0x6'));var logger=require('../../config/logger')(_0xd7be('0x7'));var config=require(_0xd7be('0x8'));var jayson=require(_0xd7be('0x9'));var client=jayson[_0xd7be('0xa')]['http']({'port':0x232a});config[_0xd7be('0xb')]=_[_0xd7be('0xc')](config[_0xd7be('0xb')],{'host':_0xd7be('0xd'),'port':0x18eb});var socket=require(_0xd7be('0xe'))(new Redis(config[_0xd7be('0xb')]));require(_0xd7be('0xf'))[_0xd7be('0x10')](socket);function respondWithRpcPromise(_0x5f3721,_0x14ed2e,_0x47ef98){return new BPromise(function(_0x4d7af0,_0x55f8ab){return client[_0xd7be('0x11')](_0x5f3721,_0x47ef98)[_0xd7be('0x12')](function(_0x486eec){logger[_0xd7be('0x13')]('Dashboard,\x20%s,\x20%s',_0x14ed2e,_0xd7be('0x14'));logger[_0xd7be('0x15')]('Dashboard,\x20%s,\x20%s,\x20%s',_0x14ed2e,_0xd7be('0x14'),JSON[_0xd7be('0x16')](_0x486eec));if(_0x486eec[_0xd7be('0x17')]){if(_0x486eec[_0xd7be('0x17')]['code']===0x1f4){logger['error'](_0xd7be('0x18'),_0x14ed2e,_0x486eec[_0xd7be('0x17')]['message']);return _0x55f8ab(_0x486eec[_0xd7be('0x17')][_0xd7be('0x19')]);}logger[_0xd7be('0x17')](_0xd7be('0x18'),_0x14ed2e,_0x486eec[_0xd7be('0x17')]['message']);return _0x4d7af0(_0x486eec[_0xd7be('0x17')]['message']);}else{logger[_0xd7be('0x13')]('Dashboard,\x20%s,\x20%s',_0x14ed2e,_0xd7be('0x14'));_0x4d7af0(_0x486eec['result'][_0xd7be('0x19')]);}})[_0xd7be('0x1a')](function(_0x46cfbd){logger[_0xd7be('0x17')](_0xd7be('0x18'),_0x14ed2e,_0x46cfbd);_0x55f8ab(_0x46cfbd);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 4e8f274..c0d036d 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 _0x849e=['update','register','length','save','remove'];(function(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0x849e,0xc1));var _0xe849=function(_0x22818b,_0x3c8c44){_0x22818b=_0x22818b-0x0;var _0x5e9a47=_0x849e[_0x22818b];return _0x5e9a47;};'use strict';var DashboardEvents=require('./dashboard.events');var events=[_0xe849('0x0'),_0xe849('0x1'),_0xe849('0x2')];function createListener(_0x4cc959,_0x28c59c){return function(_0x4068df){_0x28c59c['emit'](_0x4cc959,_0x4068df);};}function removeListener(_0x2a4314,_0x582309){return function(){DashboardEvents['removeListener'](_0x2a4314,_0x582309);};}exports[_0xe849('0x3')]=function(_0x3a81d6){for(var _0x18ef05=0x0,_0x3f6a50=events[_0xe849('0x4')];_0x18ef05<_0x3f6a50;_0x18ef05++){var _0x3328a5=events[_0x18ef05];var _0x1b6269=createListener('dashboard:'+_0x3328a5,_0x3a81d6);DashboardEvents['on'](_0x3328a5,_0x1b6269);}}; \ No newline at end of file +var _0xee41=['./dashboard.events','save','remove','update','emit','removeListener','register','length','dashboard:'];(function(_0x1a9a57,_0x446618){var _0xa67b6=function(_0x3cfc43){while(--_0x3cfc43){_0x1a9a57['push'](_0x1a9a57['shift']());}};_0xa67b6(++_0x446618);}(_0xee41,0x14d));var _0x1ee4=function(_0x20713e,_0x44f710){_0x20713e=_0x20713e-0x0;var _0x7d998b=_0xee41[_0x20713e];return _0x7d998b;};'use strict';var DashboardEvents=require(_0x1ee4('0x0'));var events=[_0x1ee4('0x1'),_0x1ee4('0x2'),_0x1ee4('0x3')];function createListener(_0x314a16,_0x38b3d7){return function(_0x28a044){_0x38b3d7[_0x1ee4('0x4')](_0x314a16,_0x28a044);};}function removeListener(_0x3e08e6,_0x30930d){return function(){DashboardEvents[_0x1ee4('0x5')](_0x3e08e6,_0x30930d);};}exports[_0x1ee4('0x6')]=function(_0x30e2a3){for(var _0x585083=0x0,_0x144fa2=events[_0x1ee4('0x7')];_0x585083<_0x144fa2;_0x585083++){var _0x1380a2=events[_0x585083];var _0x12884f=createListener(_0x1ee4('0x8')+_0x1380a2,_0x30e2a3);DashboardEvents['on'](_0x1380a2,_0x12884f);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index cc868cb..c54d5d8 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 _0x03e0=['/:id/items','getItems','post','/:id/clone','clone','put','update','delete','destroy','exports','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./dashboard.controller','isAuthenticated','index','get','/:id','show'];(function(_0x34074e,_0x257d8c){var _0x58549c=function(_0x15f22a){while(--_0x15f22a){_0x34074e['push'](_0x34074e['shift']());}};_0x58549c(++_0x257d8c);}(_0x03e0,0x19a));var _0x003e=function(_0x39ea30,_0x1bfe81){_0x39ea30=_0x39ea30-0x0;var _0x18cd72=_0x03e0[_0x39ea30];return _0x18cd72;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x003e('0x0'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x003e('0x1'));var auth=require('../../components/auth/service');var interaction=require(_0x003e('0x2'));var config=require(_0x003e('0x3'));var controller=require(_0x003e('0x4'));router['get']('/',auth[_0x003e('0x5')](),controller[_0x003e('0x6')]);router[_0x003e('0x7')](_0x003e('0x8'),auth['isAuthenticated'](),controller[_0x003e('0x9')]);router[_0x003e('0x7')](_0x003e('0xa'),auth[_0x003e('0x5')](),controller[_0x003e('0xb')]);router[_0x003e('0xc')]('/',auth[_0x003e('0x5')](),controller['create']);router['post'](_0x003e('0xd'),auth['isAuthenticated'](),controller[_0x003e('0xe')]);router[_0x003e('0xc')](_0x003e('0xa'),auth[_0x003e('0x5')](),controller['addItem']);router[_0x003e('0xf')]('/:id',auth[_0x003e('0x5')](),controller[_0x003e('0x10')]);router[_0x003e('0x11')]('/:id',auth[_0x003e('0x5')](),controller[_0x003e('0x12')]);module[_0x003e('0x13')]=router; \ No newline at end of file +var _0x3a27=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id/items','getItems','post','create','clone','addItem','put','/:id','update','destroy','exports','multer','path'];(function(_0x2acbd3,_0x4ce7c2){var _0x1b989c=function(_0x40f587){while(--_0x40f587){_0x2acbd3['push'](_0x2acbd3['shift']());}};_0x1b989c(++_0x4ce7c2);}(_0x3a27,0xbb));var _0x73a2=function(_0x14dde7,_0x42d323){_0x14dde7=_0x14dde7-0x0;var _0x38d45c=_0x3a27[_0x14dde7];return _0x38d45c;};'use strict';var multer=require(_0x73a2('0x0'));var util=require('util');var path=require(_0x73a2('0x1'));var timeout=require(_0x73a2('0x2'));var express=require(_0x73a2('0x3'));var router=express[_0x73a2('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x73a2('0x5'));var interaction=require(_0x73a2('0x6'));var config=require(_0x73a2('0x7'));var controller=require('./dashboard.controller');router[_0x73a2('0x8')]('/',auth[_0x73a2('0x9')](),controller['index']);router[_0x73a2('0x8')]('/:id',auth[_0x73a2('0x9')](),controller['show']);router['get'](_0x73a2('0xa'),auth[_0x73a2('0x9')](),controller[_0x73a2('0xb')]);router[_0x73a2('0xc')]('/',auth[_0x73a2('0x9')](),controller[_0x73a2('0xd')]);router[_0x73a2('0xc')]('/:id/clone',auth[_0x73a2('0x9')](),controller[_0x73a2('0xe')]);router['post'](_0x73a2('0xa'),auth[_0x73a2('0x9')](),controller[_0x73a2('0xf')]);router[_0x73a2('0x10')](_0x73a2('0x11'),auth[_0x73a2('0x9')](),controller[_0x73a2('0x12')]);router['delete'](_0x73a2('0x11'),auth[_0x73a2('0x9')](),controller[_0x73a2('0x13')]);module[_0x73a2('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 2cfbdc8..d53bedc 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 _0x326f=['#2196f3','sequelize','exports','STRING','TEXT','long','parse','getDataValue','attrs','stringify','setDataValue','INTEGER','#ffffff'];(function(_0x3fbf66,_0x3245d3){var _0x1ac43c=function(_0x3e8db9){while(--_0x3e8db9){_0x3fbf66['push'](_0x3fbf66['shift']());}};_0x1ac43c(++_0x3245d3);}(_0x326f,0xd1));var _0xf326=function(_0x12d72d,_0x5ac895){_0x12d72d=_0x12d72d-0x0;var _0x22133d=_0x326f[_0x12d72d];return _0x22133d;};'use strict';var Sequelize=require(_0xf326('0x0'));var squel=require('squel');var _=require('lodash');module[_0xf326('0x1')]={'title':{'type':Sequelize[_0xf326('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xf326('0x2')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0xf326('0x3')](_0xf326('0x4')),'get':function(){try{return JSON[_0xf326('0x5')](this[_0xf326('0x6')](_0xf326('0x7')));}catch(_0x1b5a56){return[];}},'set':function(_0x3ace29){try{this['setDataValue'](_0xf326('0x7'),JSON[_0xf326('0x8')](_0x3ace29));}catch(_0x165f95){this[_0xf326('0x9')]('attrs',JSON['stringify']([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xf326('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xf326('0xa')]},'col':{'type':Sequelize[_0xf326('0xa')]},'background':{'type':Sequelize[_0xf326('0x2')],'allowNull':![],'defaultValue':_0xf326('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xf326('0xc'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize['STRING']},'titleFontSize':{'type':Sequelize[_0xf326('0xa')],'defaultValue':0xc}}; \ No newline at end of file +var _0xda19=['TEXT','parse','getDataValue','attrs','setDataValue','stringify','INTEGER','#ffffff','#2196f3','squel','lodash','STRING'];(function(_0xc77819,_0x139fdc){var _0x1c9434=function(_0x11d15d){while(--_0x11d15d){_0xc77819['push'](_0xc77819['shift']());}};_0x1c9434(++_0x139fdc);}(_0xda19,0xd5));var _0x9da1=function(_0x191b42,_0x3a45a0){_0x191b42=_0x191b42-0x0;var _0x1f0ba4=_0xda19[_0x191b42];return _0x1f0ba4;};'use strict';var Sequelize=require('sequelize');var squel=require(_0x9da1('0x0'));var _=require(_0x9da1('0x1'));module['exports']={'title':{'type':Sequelize[_0x9da1('0x2')],'allowNull':![]},'type':{'type':Sequelize['STRING'](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x9da1('0x3')]('long'),'get':function(){try{return JSON[_0x9da1('0x4')](this[_0x9da1('0x5')](_0x9da1('0x6')));}catch(_0x470043){return[];}},'set':function(_0x156faf){try{this[_0x9da1('0x7')](_0x9da1('0x6'),JSON[_0x9da1('0x8')](_0x156faf));}catch(_0x1c24e6){this[_0x9da1('0x7')]('attrs',JSON['stringify']([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x9da1('0x9')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize[_0x9da1('0x9')]},'background':{'type':Sequelize[_0x9da1('0x2')],'allowNull':![],'defaultValue':_0x9da1('0xa'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x9da1('0x2')],'allowNull':![],'defaultValue':_0x9da1('0xb'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x9da1('0x2')]},'titleFontSize':{'type':Sequelize[_0x9da1('0x9')],'defaultValue':0xc}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index bce99cc..b908a1a 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 _0x6eed=['Content-Range','json','apply','reject','update','then','name','send','show','model','keys','DashboardItem','query','filters','intersection','attributes','fields','includeAll','include','merge','options','find','catch','destroy','params','attrUrl','attrs','value','https://','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','counter','attrMetric','total','attrVoiceQueues','attrFontSize','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','type','attrRefresh','error','widgetAttributes:\x20%s','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','sendStatus','end','status','offset','limit','count','set'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x6eed,0xff));var _0xd6ee=function(_0x5c110f,_0x3c4bd8){_0x5c110f=_0x5c110f-0x0;var _0x5ebfc5=_0x6eed[_0x5c110f];return _0x5ebfc5;};'use strict';var emlformat=require(_0xd6ee('0x0'));var rimraf=require(_0xd6ee('0x1'));var zipdir=require(_0xd6ee('0x2'));var jsonpatch=require(_0xd6ee('0x3'));var rp=require(_0xd6ee('0x4'));var moment=require('moment');var BPromise=require(_0xd6ee('0x5'));var Mustache=require(_0xd6ee('0x6'));var util=require('util');var path=require('path');var sox=require(_0xd6ee('0x7'));var csv=require(_0xd6ee('0x8'));var ejs=require(_0xd6ee('0x9'));var fs=require('fs');var fs_extra=require(_0xd6ee('0xa'));var _=require(_0xd6ee('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd6ee('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd6ee('0xd'));var Redis=require(_0xd6ee('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xd6ee('0xf'));var as=require(_0xd6ee('0x10'));var hardwareService=require(_0xd6ee('0x11'));var logger=require(_0xd6ee('0x12'))('api');var utils=require(_0xd6ee('0x13'));var config=require(_0xd6ee('0x14'));var licenseUtil=require(_0xd6ee('0x15'));var db=require(_0xd6ee('0x16'))['db'];config[_0xd6ee('0x17')]=_[_0xd6ee('0x18')](config['redis'],{'host':_0xd6ee('0x19'),'port':0x18eb});var socket=require(_0xd6ee('0x1a'))(new Redis(config['redis']));require(_0xd6ee('0x1b'))[_0xd6ee('0x1c')](socket);function respondWithStatusCode(_0x2bf3b2,_0x372d1d){_0x372d1d=_0x372d1d||0xcc;return function(_0x219ba6){if(_0x219ba6){return _0x2bf3b2[_0xd6ee('0x1d')](_0x372d1d);}return _0x2bf3b2['status'](_0x372d1d)[_0xd6ee('0x1e')]();};}function respondWithResult(_0xb99b70,_0xd4222){_0xd4222=_0xd4222||0xc8;return function(_0x4dfab2){if(_0x4dfab2){return _0xb99b70[_0xd6ee('0x1f')](_0xd4222)['json'](_0x4dfab2);}};}function respondWithFilteredResult(_0x3a82bf,_0x2b0495){return function(_0x81d533){if(_0x81d533){var _0x572d04=typeof _0x2b0495[_0xd6ee('0x20')]==='undefined'&&typeof _0x2b0495[_0xd6ee('0x21')]==='undefined';var _0x31ae0f=_0x81d533[_0xd6ee('0x22')];var _0x23ff1f=_0x572d04?0x0:_0x2b0495[_0xd6ee('0x20')];var _0x134c65=_0x572d04?_0x81d533['count']:_0x2b0495[_0xd6ee('0x20')]+_0x2b0495['limit'];var _0x17e011;if(_0x134c65>=_0x31ae0f){_0x134c65=_0x31ae0f;_0x17e011=0xc8;}else{_0x17e011=0xce;}_0x3a82bf[_0xd6ee('0x1f')](_0x17e011);return _0x3a82bf[_0xd6ee('0x23')](_0xd6ee('0x24'),_0x23ff1f+'-'+_0x134c65+'/'+_0x31ae0f)[_0xd6ee('0x25')](_0x81d533);}return null;};}function patchUpdates(_0x48e6ad){return function(_0x4f5fc0){try{jsonpatch[_0xd6ee('0x26')](_0x4f5fc0,_0x48e6ad,!![]);}catch(_0x511c18){return BPromise[_0xd6ee('0x27')](_0x511c18);}return _0x4f5fc0['save']();};}function saveUpdates(_0x391844,_0x80a25a){return function(_0x152cd0){if(_0x152cd0){return _0x152cd0[_0xd6ee('0x28')](_0x391844)[_0xd6ee('0x29')](function(_0x5476f2){return _0x5476f2;});}return null;};}function removeEntity(_0x4b1926,_0x2f438c){return function(_0x18586f){if(_0x18586f){return _0x18586f['destroy']()[_0xd6ee('0x29')](function(){_0x4b1926[_0xd6ee('0x1f')](0xcc)[_0xd6ee('0x1e')]();});}};}function handleEntityNotFound(_0x373308,_0x3766df){return function(_0x1769a2){if(!_0x1769a2){_0x373308[_0xd6ee('0x1d')](0x194);}return _0x1769a2;};}function handleError(_0x5f33d5,_0x202e11){_0x202e11=_0x202e11||0x1f4;return function(_0x124ab7){logger['error'](_0x124ab7['stack']);if(_0x124ab7[_0xd6ee('0x2a')]){delete _0x124ab7[_0xd6ee('0x2a')];}_0x5f33d5[_0xd6ee('0x1f')](_0x202e11)[_0xd6ee('0x2b')](_0x124ab7);};}exports[_0xd6ee('0x2c')]=function(_0x5e06c6,_0x414015){var _0x2f981e={'raw':![],'where':{'id':_0x5e06c6['params']['id']}},_0x21ce09={};_0x21ce09[_0xd6ee('0x2d')]=_[_0xd6ee('0x2e')](db[_0xd6ee('0x2f')]['rawAttributes']);_0x21ce09[_0xd6ee('0x30')]=_[_0xd6ee('0x2e')](_0x5e06c6[_0xd6ee('0x30')]);_0x21ce09[_0xd6ee('0x31')]=_[_0xd6ee('0x32')](_0x21ce09[_0xd6ee('0x2d')],_0x21ce09['query']);_0x2f981e[_0xd6ee('0x33')]=_[_0xd6ee('0x32')](_0x21ce09[_0xd6ee('0x2d')],qs[_0xd6ee('0x34')](_0x5e06c6['query'][_0xd6ee('0x34')]));_0x2f981e[_0xd6ee('0x33')]=_0x2f981e[_0xd6ee('0x33')]['length']?_0x2f981e['attributes']:_0x21ce09[_0xd6ee('0x2d')];if(_0x5e06c6[_0xd6ee('0x30')][_0xd6ee('0x35')]){_0x2f981e[_0xd6ee('0x36')]=[{'all':!![]}];}_0x2f981e=_[_0xd6ee('0x37')]({},_0x2f981e,_0x5e06c6[_0xd6ee('0x38')]);return db[_0xd6ee('0x2f')][_0xd6ee('0x39')](_0x2f981e)[_0xd6ee('0x29')](handleEntityNotFound(_0x414015,null))[_0xd6ee('0x29')](respondWithResult(_0x414015,null))[_0xd6ee('0x3a')](handleError(_0x414015,null));};exports[_0xd6ee('0x3b')]=function(_0x228f3d,_0x15b752){return db[_0xd6ee('0x2f')]['find']({'where':{'id':_0x228f3d[_0xd6ee('0x3c')]['id']}})[_0xd6ee('0x29')](handleEntityNotFound(_0x15b752,null))[_0xd6ee('0x29')](removeEntity(_0x15b752,null))['catch'](handleError(_0x15b752,null));};function widgetAttributes(_0x564adc){try{switch(_0x564adc['type']){case'iframe':return[{'name':_0xd6ee('0x3d'),'value':_0x564adc[_0xd6ee('0x3d')]||(_0x564adc[_0xd6ee('0x3e')]&&_0x564adc[_0xd6ee('0x3e')][0x0]?_0x564adc[_0xd6ee('0x3e')][0x0][_0xd6ee('0x3f')]:undefined)||_0xd6ee('0x40')}];case'custom':return[{'name':_0xd6ee('0x41'),'value':_0x564adc[_0xd6ee('0x41')]||(_0x564adc[_0xd6ee('0x3e')]&&_0x564adc[_0xd6ee('0x3e')][0x0]?_0x564adc[_0xd6ee('0x3e')][0x0][_0xd6ee('0x3f')]:undefined)||''}];case _0xd6ee('0x42'):return[{'name':_0xd6ee('0x43'),'value':_0x564adc[_0xd6ee('0x43')]||(_0x564adc[_0xd6ee('0x3e')]&&_0x564adc['attrs'][0x0]?_0x564adc['attrs'][0x0]['value']:undefined)||_0xd6ee('0x44')},{'name':'attrTimezone','value':_0x564adc[_0xd6ee('0x45')]||(_0x564adc[_0xd6ee('0x3e')]&&_0x564adc[_0xd6ee('0x3e')][0x1]?_0x564adc[_0xd6ee('0x3e')][0x1][_0xd6ee('0x3f')]:undefined)||'0.00'},{'name':'attrFontSize','value':_0x564adc['attrFontSize']||(_0x564adc['attrs']&&_0x564adc[_0xd6ee('0x3e')][0x2]?_0x564adc[_0xd6ee('0x3e')][0x2][_0xd6ee('0x3f')]:undefined)||0xc}];case _0xd6ee('0x46'):return[{'name':_0xd6ee('0x47'),'value':_0x564adc[_0xd6ee('0x47')]||(_0x564adc[_0xd6ee('0x3e')]&&_0x564adc[_0xd6ee('0x3e')][0x0]?_0x564adc[_0xd6ee('0x3e')][0x0]['value']:undefined)||_0xd6ee('0x48')},{'name':_0xd6ee('0x49'),'value':_0x564adc['attrVoiceQueues']||(_0x564adc[_0xd6ee('0x3e')]&&_0x564adc['attrs'][0x1]?_0x564adc['attrs'][0x1][_0xd6ee('0x3f')]:undefined)||[]},{'name':_0xd6ee('0x4a'),'value':_0x564adc[_0xd6ee('0x4a')]||(_0x564adc[_0xd6ee('0x3e')]&&_0x564adc[_0xd6ee('0x3e')][0x2]?_0x564adc[_0xd6ee('0x3e')][0x2]['value']:undefined)||0x14},{'name':'attrChannel','value':_0x564adc[_0xd6ee('0x4b')]||(_0x564adc[_0xd6ee('0x3e')]&&_0x564adc['attrs'][0x3]?_0x564adc[_0xd6ee('0x3e')][0x3]['value']:undefined)||_0xd6ee('0x4c')},{'name':_0xd6ee('0x4d'),'value':_0x564adc[_0xd6ee('0x4d')]||(_0x564adc[_0xd6ee('0x3e')]&&_0x564adc[_0xd6ee('0x3e')][0x4]?_0x564adc[_0xd6ee('0x3e')][0x4][_0xd6ee('0x3f')]:undefined)||''},{'name':_0xd6ee('0x4e'),'value':_0x564adc[_0xd6ee('0x4e')]||(_0x564adc[_0xd6ee('0x3e')]&&_0x564adc[_0xd6ee('0x3e')][0x5]?_0x564adc['attrs'][0x5][_0xd6ee('0x3f')]:undefined)||''},{'name':_0xd6ee('0x4f'),'value':_0x564adc[_0xd6ee('0x4f')]||(_0x564adc[_0xd6ee('0x3e')]&&_0x564adc[_0xd6ee('0x3e')][0x6]?_0x564adc[_0xd6ee('0x3e')][0x6][_0xd6ee('0x3f')]:undefined)||''},{'name':_0xd6ee('0x50'),'value':_0x564adc[_0xd6ee('0x50')]||(_0x564adc[_0xd6ee('0x3e')]&&_0x564adc[_0xd6ee('0x3e')][0x7]?_0x564adc[_0xd6ee('0x3e')][0x7]['value']:undefined)||''},{'name':_0xd6ee('0x51'),'value':_0x564adc[_0xd6ee('0x51')]||(_0x564adc[_0xd6ee('0x3e')]&&_0x564adc['attrs'][0x8]?_0x564adc[_0xd6ee('0x3e')][0x8]['value']:undefined)||''},{'name':_0xd6ee('0x52'),'value':_0x564adc['attrChatWebsites']||(_0x564adc[_0xd6ee('0x3e')]&&_0x564adc[_0xd6ee('0x3e')][0x9]?_0x564adc['attrs'][0x9][_0xd6ee('0x3f')]:undefined)||''}];case _0xd6ee('0x53'):case _0xd6ee('0x54'):return[{'name':'attrSerie1','value':_0x564adc[_0xd6ee('0x55')]||(_0x564adc[_0xd6ee('0x3e')]&&_0x564adc['attrs'][0x0]?_0x564adc[_0xd6ee('0x3e')][0x0]['value']:undefined)||_0xd6ee('0x48')},{'name':_0xd6ee('0x56'),'value':_0x564adc[_0xd6ee('0x56')]||(_0x564adc[_0xd6ee('0x3e')]&&_0x564adc['attrs'][0x1]?_0x564adc[_0xd6ee('0x3e')][0x1]['value']:undefined)||null},{'name':_0xd6ee('0x57'),'value':_0x564adc[_0xd6ee('0x57')]||(_0x564adc['attrs']&&_0x564adc[_0xd6ee('0x3e')][0x2]?_0x564adc[_0xd6ee('0x3e')][0x2][_0xd6ee('0x3f')]:undefined)||null},{'name':_0xd6ee('0x49'),'value':_0x564adc[_0xd6ee('0x49')]||(_0x564adc[_0xd6ee('0x3e')]&&_0x564adc[_0xd6ee('0x3e')][0x3]?_0x564adc[_0xd6ee('0x3e')][0x3]['value']:undefined)||[]},{'name':_0xd6ee('0x4b'),'value':_0x564adc['attrChannel']||(_0x564adc[_0xd6ee('0x3e')]&&_0x564adc[_0xd6ee('0x3e')][0x4]?_0x564adc[_0xd6ee('0x3e')][0x4][_0xd6ee('0x3f')]:undefined)||'voice'},{'name':_0xd6ee('0x4d'),'value':_0x564adc['attrEmailAccounts']||(_0x564adc[_0xd6ee('0x3e')]&&_0x564adc['attrs'][0x5]?_0x564adc[_0xd6ee('0x3e')][0x5]['value']:undefined)||''},{'name':_0xd6ee('0x4e'),'value':_0x564adc[_0xd6ee('0x4e')]||(_0x564adc[_0xd6ee('0x3e')]&&_0x564adc[_0xd6ee('0x3e')][0x6]?_0x564adc[_0xd6ee('0x3e')][0x6][_0xd6ee('0x3f')]:undefined)||''},{'name':_0xd6ee('0x4f'),'value':_0x564adc[_0xd6ee('0x4f')]||(_0x564adc[_0xd6ee('0x3e')]&&_0x564adc['attrs'][0x7]?_0x564adc[_0xd6ee('0x3e')][0x7]['value']:undefined)||''},{'name':_0xd6ee('0x50'),'value':_0x564adc[_0xd6ee('0x50')]||(_0x564adc['attrs']&&_0x564adc['attrs'][0x8]?_0x564adc[_0xd6ee('0x3e')][0x8][_0xd6ee('0x3f')]:undefined)||''},{'name':_0xd6ee('0x51'),'value':_0x564adc[_0xd6ee('0x51')]||(_0x564adc[_0xd6ee('0x3e')]&&_0x564adc[_0xd6ee('0x3e')][0x9]?_0x564adc[_0xd6ee('0x3e')][0x9][_0xd6ee('0x3f')]:undefined)||''},{'name':'attrChatWebsites','value':_0x564adc[_0xd6ee('0x52')]||(_0x564adc[_0xd6ee('0x3e')]&&_0x564adc['attrs'][0xa]?_0x564adc[_0xd6ee('0x3e')][0xa][_0xd6ee('0x3f')]:undefined)||''}];case _0xd6ee('0x58'):return[{'name':_0xd6ee('0x59'),'type':_0x564adc[_0xd6ee('0x5a')]||(_0x564adc[_0xd6ee('0x3e')]&&_0x564adc[_0xd6ee('0x3e')][0x0]?_0x564adc[_0xd6ee('0x3e')][0x0][_0xd6ee('0x5b')]:undefined)||null,'value':_0x564adc[_0xd6ee('0x59')]||(_0x564adc[_0xd6ee('0x3e')]&&_0x564adc['attrs'][0x0]?_0x564adc[_0xd6ee('0x3e')][0x0][_0xd6ee('0x3f')]:undefined)||null},{'name':'attrRefresh','value':_0x564adc[_0xd6ee('0x5c')]||(_0x564adc[_0xd6ee('0x3e')]&&_0x564adc['attrs'][0x1]?_0x564adc[_0xd6ee('0x3e')][0x1][_0xd6ee('0x3f')]:undefined)||0x0}];default:return[];}}catch(_0x5ce23d){logger[_0xd6ee('0x5d')](_0xd6ee('0x5e'),JSON['stringify'](_0x5ce23d));return[];}}exports[_0xd6ee('0x5f')]=function(_0x362db7,_0x5971c6){if(_0x362db7['body']){_0x362db7['body']['attrs']=widgetAttributes(_0x362db7[_0xd6ee('0x60')]);}return db[_0xd6ee('0x2f')][_0xd6ee('0x5f')](_0x362db7[_0xd6ee('0x60')],{})[_0xd6ee('0x29')](respondWithResult(_0x5971c6,0xc9))[_0xd6ee('0x3a')](handleError(_0x5971c6,null));};exports[_0xd6ee('0x28')]=function(_0x402962,_0x2e8c1f){if(_0x402962[_0xd6ee('0x60')]['id']){delete _0x402962[_0xd6ee('0x60')]['id'];}_0x402962[_0xd6ee('0x60')][_0xd6ee('0x3e')]=widgetAttributes(_0x402962['body']);return db[_0xd6ee('0x2f')][_0xd6ee('0x39')]({'where':{'id':_0x402962['params']['id']}})['then'](handleEntityNotFound(_0x2e8c1f,null))[_0xd6ee('0x29')](saveUpdates(_0x402962['body'],null))[_0xd6ee('0x29')](respondWithResult(_0x2e8c1f,null))[_0xd6ee('0x3a')](handleError(_0x2e8c1f,null));}; \ No newline at end of file +var _0x39e6=['name','send','show','keys','DashboardItem','rawAttributes','filters','intersection','model','attributes','fields','query','length','includeAll','include','merge','options','catch','find','type','iframe','attrUrl','attrs','https://','attrPath','value','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','attrRefresh','error','stringify','body','create','params','eml-format','zip-dir','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./dashboardItem.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','then','destroy'];(function(_0xbdb0ac,_0x19e5cc){var _0x5833b7=function(_0x219700){while(--_0x219700){_0xbdb0ac['push'](_0xbdb0ac['shift']());}};_0x5833b7(++_0x19e5cc);}(_0x39e6,0x9e));var _0x639e=function(_0x1de999,_0x48ccf3){_0x1de999=_0x1de999-0x0;var _0xb96468=_0x39e6[_0x1de999];return _0xb96468;};'use strict';var emlformat=require(_0x639e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x639e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x639e('0x2'));var BPromise=require(_0x639e('0x3'));var Mustache=require('mustache');var util=require(_0x639e('0x4'));var path=require(_0x639e('0x5'));var sox=require(_0x639e('0x6'));var csv=require(_0x639e('0x7'));var ejs=require(_0x639e('0x8'));var fs=require('fs');var fs_extra=require(_0x639e('0x9'));var _=require(_0x639e('0xa'));var squel=require(_0x639e('0xb'));var crypto=require(_0x639e('0xc'));var jsforce=require(_0x639e('0xd'));var deskjs=require(_0x639e('0xe'));var toCsv=require(_0x639e('0x7'));var querystring=require(_0x639e('0xf'));var Papa=require(_0x639e('0x10'));var Redis=require(_0x639e('0x11'));var authService=require(_0x639e('0x12'));var qs=require(_0x639e('0x13'));var as=require(_0x639e('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x639e('0x15'));var utils=require(_0x639e('0x16'));var config=require(_0x639e('0x17'));var licenseUtil=require(_0x639e('0x18'));var db=require(_0x639e('0x19'))['db'];config[_0x639e('0x1a')]=_[_0x639e('0x1b')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x639e('0x1c'))(new Redis(config[_0x639e('0x1a')]));require(_0x639e('0x1d'))[_0x639e('0x1e')](socket);function respondWithStatusCode(_0x37b8e2,_0x1c9feb){_0x1c9feb=_0x1c9feb||0xcc;return function(_0x55728e){if(_0x55728e){return _0x37b8e2[_0x639e('0x1f')](_0x1c9feb);}return _0x37b8e2[_0x639e('0x20')](_0x1c9feb)[_0x639e('0x21')]();};}function respondWithResult(_0x4077c5,_0x4fa3fa){_0x4fa3fa=_0x4fa3fa||0xc8;return function(_0x6dd912){if(_0x6dd912){return _0x4077c5['status'](_0x4fa3fa)[_0x639e('0x22')](_0x6dd912);}};}function respondWithFilteredResult(_0x3932a8,_0x391957){return function(_0x20b76f){if(_0x20b76f){var _0x36b75a=typeof _0x391957[_0x639e('0x23')]==='undefined'&&typeof _0x391957[_0x639e('0x24')]===_0x639e('0x25');var _0x36f71d=_0x20b76f[_0x639e('0x26')];var _0x59f772=_0x36b75a?0x0:_0x391957[_0x639e('0x23')];var _0xdf47a5=_0x36b75a?_0x20b76f[_0x639e('0x26')]:_0x391957[_0x639e('0x23')]+_0x391957[_0x639e('0x24')];var _0x50de77;if(_0xdf47a5>=_0x36f71d){_0xdf47a5=_0x36f71d;_0x50de77=0xc8;}else{_0x50de77=0xce;}_0x3932a8[_0x639e('0x20')](_0x50de77);return _0x3932a8[_0x639e('0x27')]('Content-Range',_0x59f772+'-'+_0xdf47a5+'/'+_0x36f71d)[_0x639e('0x22')](_0x20b76f);}return null;};}function patchUpdates(_0x48dce7){return function(_0x574fd8){try{jsonpatch[_0x639e('0x28')](_0x574fd8,_0x48dce7,!![]);}catch(_0x3813f6){return BPromise[_0x639e('0x29')](_0x3813f6);}return _0x574fd8[_0x639e('0x2a')]();};}function saveUpdates(_0x211fcb,_0x5da797){return function(_0x2b699c){if(_0x2b699c){return _0x2b699c[_0x639e('0x2b')](_0x211fcb)[_0x639e('0x2c')](function(_0x2da264){return _0x2da264;});}return null;};}function removeEntity(_0x2df4d1,_0x5f27f6){return function(_0x381554){if(_0x381554){return _0x381554[_0x639e('0x2d')]()[_0x639e('0x2c')](function(){_0x2df4d1[_0x639e('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ae3b7,_0x282d87){return function(_0x13ef2b){if(!_0x13ef2b){_0x2ae3b7['sendStatus'](0x194);}return _0x13ef2b;};}function handleError(_0xefbf1c,_0x56145c){_0x56145c=_0x56145c||0x1f4;return function(_0x38ce3a){logger['error'](_0x38ce3a['stack']);if(_0x38ce3a[_0x639e('0x2e')]){delete _0x38ce3a[_0x639e('0x2e')];}_0xefbf1c[_0x639e('0x20')](_0x56145c)[_0x639e('0x2f')](_0x38ce3a);};}exports[_0x639e('0x30')]=function(_0xefc97b,_0x5797da){var _0x213b7e={'raw':![],'where':{'id':_0xefc97b['params']['id']}},_0x2bfb5e={};_0x2bfb5e['model']=_[_0x639e('0x31')](db[_0x639e('0x32')][_0x639e('0x33')]);_0x2bfb5e['query']=_[_0x639e('0x31')](_0xefc97b['query']);_0x2bfb5e[_0x639e('0x34')]=_[_0x639e('0x35')](_0x2bfb5e[_0x639e('0x36')],_0x2bfb5e['query']);_0x213b7e[_0x639e('0x37')]=_['intersection'](_0x2bfb5e[_0x639e('0x36')],qs[_0x639e('0x38')](_0xefc97b[_0x639e('0x39')]['fields']));_0x213b7e[_0x639e('0x37')]=_0x213b7e[_0x639e('0x37')][_0x639e('0x3a')]?_0x213b7e['attributes']:_0x2bfb5e[_0x639e('0x36')];if(_0xefc97b['query'][_0x639e('0x3b')]){_0x213b7e[_0x639e('0x3c')]=[{'all':!![]}];}_0x213b7e=_[_0x639e('0x3d')]({},_0x213b7e,_0xefc97b[_0x639e('0x3e')]);return db[_0x639e('0x32')]['find'](_0x213b7e)[_0x639e('0x2c')](handleEntityNotFound(_0x5797da,null))[_0x639e('0x2c')](respondWithResult(_0x5797da,null))[_0x639e('0x3f')](handleError(_0x5797da,null));};exports[_0x639e('0x2d')]=function(_0x4b8a3e,_0x2a30aa){return db[_0x639e('0x32')][_0x639e('0x40')]({'where':{'id':_0x4b8a3e['params']['id']}})[_0x639e('0x2c')](handleEntityNotFound(_0x2a30aa,null))['then'](removeEntity(_0x2a30aa,null))[_0x639e('0x3f')](handleError(_0x2a30aa,null));};function widgetAttributes(_0x22c393){try{switch(_0x22c393[_0x639e('0x41')]){case _0x639e('0x42'):return[{'name':_0x639e('0x43'),'value':_0x22c393[_0x639e('0x43')]||(_0x22c393['attrs']&&_0x22c393[_0x639e('0x44')][0x0]?_0x22c393[_0x639e('0x44')][0x0]['value']:undefined)||_0x639e('0x45')}];case'custom':return[{'name':_0x639e('0x46'),'value':_0x22c393[_0x639e('0x46')]||(_0x22c393[_0x639e('0x44')]&&_0x22c393[_0x639e('0x44')][0x0]?_0x22c393[_0x639e('0x44')][0x0][_0x639e('0x47')]:undefined)||''}];case _0x639e('0x48'):return[{'name':_0x639e('0x49'),'value':_0x22c393['attrHourFormat']||(_0x22c393['attrs']&&_0x22c393['attrs'][0x0]?_0x22c393['attrs'][0x0][_0x639e('0x47')]:undefined)||_0x639e('0x4a')},{'name':'attrTimezone','value':_0x22c393[_0x639e('0x4b')]||(_0x22c393[_0x639e('0x44')]&&_0x22c393[_0x639e('0x44')][0x1]?_0x22c393['attrs'][0x1][_0x639e('0x47')]:undefined)||_0x639e('0x4c')},{'name':_0x639e('0x4d'),'value':_0x22c393[_0x639e('0x4d')]||(_0x22c393[_0x639e('0x44')]&&_0x22c393[_0x639e('0x44')][0x2]?_0x22c393[_0x639e('0x44')][0x2][_0x639e('0x47')]:undefined)||0xc}];case _0x639e('0x4e'):return[{'name':'attrMetric','value':_0x22c393[_0x639e('0x4f')]||(_0x22c393[_0x639e('0x44')]&&_0x22c393[_0x639e('0x44')][0x0]?_0x22c393[_0x639e('0x44')][0x0][_0x639e('0x47')]:undefined)||_0x639e('0x50')},{'name':'attrVoiceQueues','value':_0x22c393[_0x639e('0x51')]||(_0x22c393[_0x639e('0x44')]&&_0x22c393[_0x639e('0x44')][0x1]?_0x22c393[_0x639e('0x44')][0x1][_0x639e('0x47')]:undefined)||[]},{'name':_0x639e('0x4d'),'value':_0x22c393[_0x639e('0x4d')]||(_0x22c393[_0x639e('0x44')]&&_0x22c393[_0x639e('0x44')][0x2]?_0x22c393[_0x639e('0x44')][0x2][_0x639e('0x47')]:undefined)||0x14},{'name':_0x639e('0x52'),'value':_0x22c393['attrChannel']||(_0x22c393[_0x639e('0x44')]&&_0x22c393['attrs'][0x3]?_0x22c393['attrs'][0x3][_0x639e('0x47')]:undefined)||_0x639e('0x53')},{'name':_0x639e('0x54'),'value':_0x22c393[_0x639e('0x54')]||(_0x22c393[_0x639e('0x44')]&&_0x22c393['attrs'][0x4]?_0x22c393[_0x639e('0x44')][0x4][_0x639e('0x47')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x22c393[_0x639e('0x55')]||(_0x22c393[_0x639e('0x44')]&&_0x22c393[_0x639e('0x44')][0x5]?_0x22c393['attrs'][0x5][_0x639e('0x47')]:undefined)||''},{'name':_0x639e('0x56'),'value':_0x22c393[_0x639e('0x56')]||(_0x22c393[_0x639e('0x44')]&&_0x22c393['attrs'][0x6]?_0x22c393[_0x639e('0x44')][0x6]['value']:undefined)||''},{'name':_0x639e('0x57'),'value':_0x22c393['attrOpenchannelAccounts']||(_0x22c393[_0x639e('0x44')]&&_0x22c393[_0x639e('0x44')][0x7]?_0x22c393[_0x639e('0x44')][0x7][_0x639e('0x47')]:undefined)||''},{'name':_0x639e('0x58'),'value':_0x22c393['attrWhatsappAccounts']||(_0x22c393[_0x639e('0x44')]&&_0x22c393[_0x639e('0x44')][0x8]?_0x22c393[_0x639e('0x44')][0x8]['value']:undefined)||''},{'name':_0x639e('0x59'),'value':_0x22c393[_0x639e('0x59')]||(_0x22c393[_0x639e('0x44')]&&_0x22c393[_0x639e('0x44')][0x9]?_0x22c393['attrs'][0x9][_0x639e('0x47')]:undefined)||''}];case'multibar-chart':case _0x639e('0x5a'):return[{'name':_0x639e('0x5b'),'value':_0x22c393[_0x639e('0x5b')]||(_0x22c393[_0x639e('0x44')]&&_0x22c393['attrs'][0x0]?_0x22c393[_0x639e('0x44')][0x0]['value']:undefined)||'total'},{'name':_0x639e('0x5c'),'value':_0x22c393[_0x639e('0x5c')]||(_0x22c393[_0x639e('0x44')]&&_0x22c393[_0x639e('0x44')][0x1]?_0x22c393['attrs'][0x1][_0x639e('0x47')]:undefined)||null},{'name':_0x639e('0x5d'),'value':_0x22c393[_0x639e('0x5d')]||(_0x22c393['attrs']&&_0x22c393[_0x639e('0x44')][0x2]?_0x22c393[_0x639e('0x44')][0x2][_0x639e('0x47')]:undefined)||null},{'name':_0x639e('0x51'),'value':_0x22c393[_0x639e('0x51')]||(_0x22c393[_0x639e('0x44')]&&_0x22c393[_0x639e('0x44')][0x3]?_0x22c393['attrs'][0x3][_0x639e('0x47')]:undefined)||[]},{'name':_0x639e('0x52'),'value':_0x22c393[_0x639e('0x52')]||(_0x22c393[_0x639e('0x44')]&&_0x22c393['attrs'][0x4]?_0x22c393[_0x639e('0x44')][0x4][_0x639e('0x47')]:undefined)||_0x639e('0x53')},{'name':'attrEmailAccounts','value':_0x22c393['attrEmailAccounts']||(_0x22c393['attrs']&&_0x22c393[_0x639e('0x44')][0x5]?_0x22c393[_0x639e('0x44')][0x5]['value']:undefined)||''},{'name':_0x639e('0x55'),'value':_0x22c393[_0x639e('0x55')]||(_0x22c393[_0x639e('0x44')]&&_0x22c393[_0x639e('0x44')][0x6]?_0x22c393[_0x639e('0x44')][0x6][_0x639e('0x47')]:undefined)||''},{'name':_0x639e('0x56'),'value':_0x22c393[_0x639e('0x56')]||(_0x22c393['attrs']&&_0x22c393[_0x639e('0x44')][0x7]?_0x22c393[_0x639e('0x44')][0x7]['value']:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x22c393[_0x639e('0x57')]||(_0x22c393['attrs']&&_0x22c393[_0x639e('0x44')][0x8]?_0x22c393[_0x639e('0x44')][0x8][_0x639e('0x47')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x22c393[_0x639e('0x58')]||(_0x22c393[_0x639e('0x44')]&&_0x22c393[_0x639e('0x44')][0x9]?_0x22c393[_0x639e('0x44')][0x9]['value']:undefined)||''},{'name':_0x639e('0x59'),'value':_0x22c393[_0x639e('0x59')]||(_0x22c393['attrs']&&_0x22c393[_0x639e('0x44')][0xa]?_0x22c393[_0x639e('0x44')][0xa][_0x639e('0x47')]:undefined)||''}];case _0x639e('0x5e'):return[{'name':_0x639e('0x5f'),'type':_0x22c393['reportType']||(_0x22c393[_0x639e('0x44')]&&_0x22c393[_0x639e('0x44')][0x0]?_0x22c393[_0x639e('0x44')][0x0][_0x639e('0x41')]:undefined)||null,'value':_0x22c393[_0x639e('0x5f')]||(_0x22c393[_0x639e('0x44')]&&_0x22c393[_0x639e('0x44')][0x0]?_0x22c393[_0x639e('0x44')][0x0][_0x639e('0x47')]:undefined)||null},{'name':_0x639e('0x60'),'value':_0x22c393['attrRefresh']||(_0x22c393['attrs']&&_0x22c393[_0x639e('0x44')][0x1]?_0x22c393[_0x639e('0x44')][0x1][_0x639e('0x47')]:undefined)||0x0}];default:return[];}}catch(_0x3ef322){logger[_0x639e('0x61')]('widgetAttributes:\x20%s',JSON[_0x639e('0x62')](_0x3ef322));return[];}}exports['create']=function(_0x6106a1,_0x174758){if(_0x6106a1[_0x639e('0x63')]){_0x6106a1['body']['attrs']=widgetAttributes(_0x6106a1[_0x639e('0x63')]);}return db[_0x639e('0x32')][_0x639e('0x64')](_0x6106a1['body'],{})['then'](respondWithResult(_0x174758,0xc9))[_0x639e('0x3f')](handleError(_0x174758,null));};exports[_0x639e('0x2b')]=function(_0x5e29fb,_0x5b6313){if(_0x5e29fb[_0x639e('0x63')]['id']){delete _0x5e29fb[_0x639e('0x63')]['id'];}_0x5e29fb[_0x639e('0x63')]['attrs']=widgetAttributes(_0x5e29fb[_0x639e('0x63')]);return db[_0x639e('0x32')][_0x639e('0x40')]({'where':{'id':_0x5e29fb[_0x639e('0x65')]['id']}})['then'](handleEntityNotFound(_0x5b6313,null))[_0x639e('0x2c')](saveUpdates(_0x5e29fb[_0x639e('0x63')],null))[_0x639e('0x2c')](respondWithResult(_0x5b6313,null))[_0x639e('0x3f')](handleError(_0x5b6313,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index f3dbd04..f6cd57d 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 _0x83e7=['exports','../../mysqldb','DashboardItem','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x4e200a,_0x52bab5){var _0x1a8f9e=function(_0x1b3bb5){while(--_0x1b3bb5){_0x4e200a['push'](_0x4e200a['shift']());}};_0x1a8f9e(++_0x52bab5);}(_0x83e7,0x187));var _0x783e=function(_0x571edb,_0x5a648d){_0x571edb=_0x571edb-0x0;var _0x2a682e=_0x83e7[_0x571edb];return _0x2a682e;};'use strict';var EventEmitter=require('events');var DashboardItem=require(_0x783e('0x0'))['db'][_0x783e('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x783e('0x2')](0x0);var events={'afterCreate':_0x783e('0x3'),'afterUpdate':_0x783e('0x4'),'afterDestroy':_0x783e('0x5')};function emitEvent(_0x76ccad){return function(_0x49799b,_0x501f7a,_0x40514a){DashboardItemEvents[_0x783e('0x6')](_0x76ccad+':'+_0x49799b['id'],_0x49799b);DashboardItemEvents['emit'](_0x76ccad,_0x49799b);_0x40514a(null);};}for(var e in events){if(events[_0x783e('0x7')](e)){var event=events[e];DashboardItem[_0x783e('0x8')](e,emitEvent(event));}}module[_0x783e('0x9')]=DashboardItemEvents; \ No newline at end of file +var _0xe2bc=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','DashboardItem'];(function(_0x5e98ad,_0x38ac34){var _0x51535b=function(_0x49e571){while(--_0x49e571){_0x5e98ad['push'](_0x5e98ad['shift']());}};_0x51535b(++_0x38ac34);}(_0xe2bc,0x15d));var _0xce2b=function(_0x368fb9,_0x1a9895){_0x368fb9=_0x368fb9-0x0;var _0x4892fb=_0xe2bc[_0x368fb9];return _0x4892fb;};'use strict';var EventEmitter=require(_0xce2b('0x0'));var DashboardItem=require(_0xce2b('0x1'))['db'][_0xce2b('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xce2b('0x3')](0x0);var events={'afterCreate':_0xce2b('0x4'),'afterUpdate':_0xce2b('0x5'),'afterDestroy':_0xce2b('0x6')};function emitEvent(_0x568c12){return function(_0x25fe89,_0x5a06a1,_0x36ae46){DashboardItemEvents[_0xce2b('0x7')](_0x568c12+':'+_0x25fe89['id'],_0x25fe89);DashboardItemEvents[_0xce2b('0x7')](_0x568c12,_0x25fe89);_0x36ae46(null);};}for(var e in events){if(events[_0xce2b('0x8')](e)){var event=events[e];DashboardItem[_0xce2b('0x9')](e,emitEvent(event));}}module[_0xce2b('0xa')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index 6fa6c57..ec22658 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 _0xd320=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','define','DashboardItem','dashboard_items'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd320,0x155));var _0x0d32=function(_0x351b46,_0x26b265){_0x351b46=_0x351b46-0x0;var _0x1515df=_0xd320[_0x351b46];return _0x1515df;};'use strict';var _=require(_0x0d32('0x0'));var util=require(_0x0d32('0x1'));var logger=require(_0x0d32('0x2'))(_0x0d32('0x3'));var moment=require(_0x0d32('0x4'));var BPromise=require(_0x0d32('0x5'));var rp=require(_0x0d32('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x0d32('0x7'));var attributes=require('./dashboardItem.attributes');module['exports']=function(_0x10b6be,_0x50ff0d){return _0x10b6be[_0x0d32('0x8')](_0x0d32('0x9'),attributes,{'tableName':_0x0d32('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe345=['define','DashboardItem','dashboard_items','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','exports'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xe345,0x99));var _0x5e34=function(_0x197115,_0x14d69a){_0x197115=_0x197115-0x0;var _0x19d830=_0xe345[_0x197115];return _0x19d830;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5e34('0x0'))('api');var moment=require(_0x5e34('0x1'));var BPromise=require(_0x5e34('0x2'));var rp=require(_0x5e34('0x3'));var fs=require('fs');var path=require(_0x5e34('0x4'));var rimraf=require('rimraf');var config=require(_0x5e34('0x5'));var attributes=require('./dashboardItem.attributes');module[_0x5e34('0x6')]=function(_0x5ae480,_0x1243b4){return _0x5ae480[_0x5e34('0x7')](_0x5e34('0x8'),attributes,{'tableName':_0x5e34('0x9'),'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 f33f8d1..44145d6 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 _0x1668=['client','http','redis','defaults','socket.io-emitter','./dashboardItem.socket','register','request','then','info','DashboardItem,\x20%s,\x20%s','debug','DashboardItem,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x1668,0xdf));var _0x8166=function(_0x49d339,_0x11f60c){_0x49d339=_0x49d339-0x0;var _0x3118a7=_0x1668[_0x49d339];return _0x3118a7;};'use strict';var _=require(_0x8166('0x0'));var util=require('util');var moment=require(_0x8166('0x1'));var BPromise=require(_0x8166('0x2'));var rs=require(_0x8166('0x3'));var fs=require('fs');var Redis=require(_0x8166('0x4'));var db=require(_0x8166('0x5'))['db'];var utils=require(_0x8166('0x6'));var logger=require(_0x8166('0x7'))(_0x8166('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8166('0x9')][_0x8166('0xa')]({'port':0x232a});config[_0x8166('0xb')]=_[_0x8166('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x8166('0xd'))(new Redis(config[_0x8166('0xb')]));require(_0x8166('0xe'))[_0x8166('0xf')](socket);function respondWithRpcPromise(_0x2b9f39,_0x4e0256,_0x5aa0e0){return new BPromise(function(_0x2699b0,_0x576f5b){return client[_0x8166('0x10')](_0x2b9f39,_0x5aa0e0)[_0x8166('0x11')](function(_0x13a45e){logger[_0x8166('0x12')](_0x8166('0x13'),_0x4e0256,'request\x20sent');logger[_0x8166('0x14')](_0x8166('0x15'),_0x4e0256,_0x8166('0x16'),JSON[_0x8166('0x17')](_0x13a45e));if(_0x13a45e[_0x8166('0x18')]){if(_0x13a45e[_0x8166('0x18')][_0x8166('0x19')]===0x1f4){logger[_0x8166('0x18')](_0x8166('0x13'),_0x4e0256,_0x13a45e[_0x8166('0x18')][_0x8166('0x1a')]);return _0x576f5b(_0x13a45e[_0x8166('0x18')]['message']);}logger[_0x8166('0x18')](_0x8166('0x13'),_0x4e0256,_0x13a45e['error'][_0x8166('0x1a')]);return _0x2699b0(_0x13a45e['error'][_0x8166('0x1a')]);}else{logger['info'](_0x8166('0x13'),_0x4e0256,_0x8166('0x16'));_0x2699b0(_0x13a45e[_0x8166('0x1b')][_0x8166('0x1a')]);}})[_0x8166('0x1c')](function(_0x2bb5fd){logger['error'](_0x8166('0x13'),_0x4e0256,_0x2bb5fd);_0x576f5b(_0x2bb5fd);});});} \ No newline at end of file +var _0xa27c=['request','then','info','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','error','DashboardItem,\x20%s,\x20%s','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./dashboardItem.socket','register'];(function(_0x1992f1,_0x5c61f0){var _0x413dfe=function(_0x2136e5){while(--_0x2136e5){_0x1992f1['push'](_0x1992f1['shift']());}};_0x413dfe(++_0x5c61f0);}(_0xa27c,0xac));var _0xca27=function(_0x1b6cf3,_0x2320c5){_0x1b6cf3=_0x1b6cf3-0x0;var _0x84a135=_0xa27c[_0x1b6cf3];return _0x84a135;};'use strict';var _=require(_0xca27('0x0'));var util=require(_0xca27('0x1'));var moment=require('moment');var BPromise=require(_0xca27('0x2'));var rs=require(_0xca27('0x3'));var fs=require('fs');var Redis=require(_0xca27('0x4'));var db=require(_0xca27('0x5'))['db'];var utils=require(_0xca27('0x6'));var logger=require('../../config/logger')(_0xca27('0x7'));var config=require(_0xca27('0x8'));var jayson=require(_0xca27('0x9'));var client=jayson[_0xca27('0xa')][_0xca27('0xb')]({'port':0x232a});config[_0xca27('0xc')]=_['defaults'](config[_0xca27('0xc')],{'host':_0xca27('0xd'),'port':0x18eb});var socket=require(_0xca27('0xe'))(new Redis(config[_0xca27('0xc')]));require(_0xca27('0xf'))[_0xca27('0x10')](socket);function respondWithRpcPromise(_0x11c7bc,_0x26de17,_0x4e684c){return new BPromise(function(_0x296083,_0x1a4043){return client[_0xca27('0x11')](_0x11c7bc,_0x4e684c)[_0xca27('0x12')](function(_0x2b1c11){logger[_0xca27('0x13')]('DashboardItem,\x20%s,\x20%s',_0x26de17,_0xca27('0x14'));logger[_0xca27('0x15')](_0xca27('0x16'),_0x26de17,_0xca27('0x14'),JSON['stringify'](_0x2b1c11));if(_0x2b1c11[_0xca27('0x17')]){if(_0x2b1c11[_0xca27('0x17')]['code']===0x1f4){logger[_0xca27('0x17')](_0xca27('0x18'),_0x26de17,_0x2b1c11[_0xca27('0x17')][_0xca27('0x19')]);return _0x1a4043(_0x2b1c11[_0xca27('0x17')][_0xca27('0x19')]);}logger['error'](_0xca27('0x18'),_0x26de17,_0x2b1c11[_0xca27('0x17')][_0xca27('0x19')]);return _0x296083(_0x2b1c11[_0xca27('0x17')]['message']);}else{logger['info'](_0xca27('0x18'),_0x26de17,_0xca27('0x14'));_0x296083(_0x2b1c11[_0xca27('0x1a')]['message']);}})['catch'](function(_0x87eb95){logger[_0xca27('0x17')](_0xca27('0x18'),_0x26de17,_0x87eb95);_0x1a4043(_0x87eb95);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index c62af1d..1c379d7 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 _0x1231=['length','dashboardItem:','./dashboardItem.events','save','remove','update','emit','register'];(function(_0x4d7124,_0x40b0fa){var _0x50fd5a=function(_0x44cbc9){while(--_0x44cbc9){_0x4d7124['push'](_0x4d7124['shift']());}};_0x50fd5a(++_0x40b0fa);}(_0x1231,0x122));var _0x1123=function(_0x29da26,_0x4c88ec){_0x29da26=_0x29da26-0x0;var _0x57b19a=_0x1231[_0x29da26];return _0x57b19a;};'use strict';var DashboardItemEvents=require(_0x1123('0x0'));var events=[_0x1123('0x1'),_0x1123('0x2'),_0x1123('0x3')];function createListener(_0x539a41,_0x1e63cf){return function(_0x3a7eed){_0x1e63cf[_0x1123('0x4')](_0x539a41,_0x3a7eed);};}function removeListener(_0x199f34,_0x3f0a3f){return function(){DashboardItemEvents['removeListener'](_0x199f34,_0x3f0a3f);};}exports[_0x1123('0x5')]=function(_0x341ab8){for(var _0x363cf5=0x0,_0x3fe1d7=events[_0x1123('0x6')];_0x363cf5<_0x3fe1d7;_0x363cf5++){var _0x1b6154=events[_0x363cf5];var _0x24fcb2=createListener(_0x1123('0x7')+_0x1b6154,_0x341ab8);DashboardItemEvents['on'](_0x1b6154,_0x24fcb2);}}; \ No newline at end of file +var _0xcf65=['emit','removeListener','./dashboardItem.events','save','remove','update'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xcf65,0x18e));var _0x5cf6=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xcf65[_0x3ab51d];return _0x29a04e;};'use strict';var DashboardItemEvents=require(_0x5cf6('0x0'));var events=[_0x5cf6('0x1'),_0x5cf6('0x2'),_0x5cf6('0x3')];function createListener(_0x1c2339,_0x383d59){return function(_0xbf488d){_0x383d59[_0x5cf6('0x4')](_0x1c2339,_0xbf488d);};}function removeListener(_0x4ee70d,_0x1f8875){return function(){DashboardItemEvents[_0x5cf6('0x5')](_0x4ee70d,_0x1f8875);};}exports['register']=function(_0x4c5525){for(var _0xccfcae=0x0,_0x1a0d9c=events['length'];_0xccfcae<_0x1a0d9c;_0xccfcae++){var _0x428d31=events[_0xccfcae];var _0x8000bf=createListener('dashboardItem:'+_0x428d31,_0x4c5525);DashboardItemEvents['on'](_0x428d31,_0x8000bf);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index 99dda9c..cc2fd90 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 _0x5756=['get','/:id','show','post','isAuthenticated','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller'];(function(_0x15fe8d,_0x5dcb64){var _0x3a76aa=function(_0x136782){while(--_0x136782){_0x15fe8d['push'](_0x15fe8d['shift']());}};_0x3a76aa(++_0x5dcb64);}(_0x5756,0x1ea));var _0x6575=function(_0x522e33,_0x1b4814){_0x522e33=_0x522e33-0x0;var _0x361e23=_0x5756[_0x522e33];return _0x361e23;};'use strict';var multer=require(_0x6575('0x0'));var util=require(_0x6575('0x1'));var path=require(_0x6575('0x2'));var timeout=require(_0x6575('0x3'));var express=require(_0x6575('0x4'));var router=express['Router']();var fs_extra=require(_0x6575('0x5'));var auth=require(_0x6575('0x6'));var interaction=require(_0x6575('0x7'));var config=require(_0x6575('0x8'));var controller=require(_0x6575('0x9'));router[_0x6575('0xa')](_0x6575('0xb'),auth['isAuthenticated'](),controller[_0x6575('0xc')]);router[_0x6575('0xd')]('/',auth[_0x6575('0xe')](),controller[_0x6575('0xf')]);router['put'](_0x6575('0xb'),auth['isAuthenticated'](),controller[_0x6575('0x10')]);router[_0x6575('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x6575('0x12')]);module[_0x6575('0x13')]=router; \ No newline at end of file +var _0x7a0b=['../../config/environment','./dashboardItem.controller','get','isAuthenticated','show','post','create','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x580c74,_0x5ecfe6){var _0xda011e=function(_0x32e84a){while(--_0x32e84a){_0x580c74['push'](_0x580c74['shift']());}};_0xda011e(++_0x5ecfe6);}(_0x7a0b,0x1da));var _0xb7a0=function(_0x493cc4,_0x2c8e67){_0x493cc4=_0x493cc4-0x0;var _0x539fb1=_0x7a0b[_0x493cc4];return _0x539fb1;};'use strict';var multer=require(_0xb7a0('0x0'));var util=require(_0xb7a0('0x1'));var path=require(_0xb7a0('0x2'));var timeout=require(_0xb7a0('0x3'));var express=require(_0xb7a0('0x4'));var router=express[_0xb7a0('0x5')]();var fs_extra=require(_0xb7a0('0x6'));var auth=require(_0xb7a0('0x7'));var interaction=require(_0xb7a0('0x8'));var config=require(_0xb7a0('0x9'));var controller=require(_0xb7a0('0xa'));router[_0xb7a0('0xb')]('/:id',auth[_0xb7a0('0xc')](),controller[_0xb7a0('0xd')]);router[_0xb7a0('0xe')]('/',auth[_0xb7a0('0xc')](),controller[_0xb7a0('0xf')]);router[_0xb7a0('0x10')](_0xb7a0('0x11'),auth[_0xb7a0('0xc')](),controller[_0xb7a0('0x12')]);router[_0xb7a0('0x13')](_0xb7a0('0x11'),auth[_0xb7a0('0xc')](),controller[_0xb7a0('0x14')]);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 c7a2c64..9c86c22 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 _0xac31=['first','third','STRING','sequelize','ENUM'];(function(_0x4b332a,_0x5ec2db){var _0x115a04=function(_0x422160){while(--_0x422160){_0x4b332a['push'](_0x4b332a['shift']());}};_0x115a04(++_0x5ec2db);}(_0xac31,0x1b1));var _0x1ac3=function(_0x40221d,_0x529110){_0x40221d=_0x40221d-0x0;var _0x270b17=_0xac31[_0x40221d];return _0x270b17;};'use strict';var Sequelize=require(_0x1ac3('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'level':{'type':Sequelize[_0x1ac3('0x1')](_0x1ac3('0x2'),'second',_0x1ac3('0x3')),'allowNull':![],'defaultValue':_0x1ac3('0x2')},'description':{'type':Sequelize[_0x1ac3('0x4')]}}; \ No newline at end of file +var _0xe0ba=['sequelize','exports','STRING','ENUM','first','second','third'];(function(_0x1daf2c,_0x42c1cc){var _0x4eeaf3=function(_0x2e6aae){while(--_0x2e6aae){_0x1daf2c['push'](_0x1daf2c['shift']());}};_0x4eeaf3(++_0x42c1cc);}(_0xe0ba,0x126));var _0xae0b=function(_0x2112d4,_0x3c863c){_0x2112d4=_0x2112d4-0x0;var _0x434972=_0xe0ba[_0x2112d4];return _0x434972;};'use strict';var Sequelize=require(_0xae0b('0x0'));module[_0xae0b('0x1')]={'name':{'type':Sequelize[_0xae0b('0x2')],'allowNull':![]},'level':{'type':Sequelize[_0xae0b('0x3')](_0xae0b('0x4'),_0xae0b('0x5'),_0xae0b('0x6')),'allowNull':![],'defaultValue':'first'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index 6f9d34a..56a33a5 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 _0x0999=['bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','Content-Range','json','apply','save','update','then','destroy','end','error','stack','name','send','index','Disposition','rawAttributes','fieldName','map','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','type','VIRTUAL','options','includeAll','include','catch','show','params','length','merge','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Dispositions','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','body','eml-format','zip-dir','request-promise'];(function(_0x819464,_0x46fc91){var _0x49dcc0=function(_0x36b2b2){while(--_0x36b2b2){_0x819464['push'](_0x819464['shift']());}};_0x49dcc0(++_0x46fc91);}(_0x0999,0xa5));var _0x9099=function(_0x2e2681,_0x4089c1){_0x2e2681=_0x2e2681-0x0;var _0x368a64=_0x0999[_0x2e2681];return _0x368a64;};'use strict';var emlformat=require(_0x9099('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9099('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9099('0x2'));var moment=require('moment');var BPromise=require(_0x9099('0x3'));var Mustache=require(_0x9099('0x4'));var util=require(_0x9099('0x5'));var path=require(_0x9099('0x6'));var sox=require(_0x9099('0x7'));var csv=require(_0x9099('0x8'));var ejs=require(_0x9099('0x9'));var fs=require('fs');var fs_extra=require(_0x9099('0xa'));var _=require(_0x9099('0xb'));var squel=require(_0x9099('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x9099('0xd'));var toCsv=require(_0x9099('0x8'));var querystring=require('querystring');var Papa=require(_0x9099('0xe'));var Redis=require(_0x9099('0xf'));var authService=require(_0x9099('0x10'));var qs=require(_0x9099('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9099('0x12'));var logger=require(_0x9099('0x13'))(_0x9099('0x14'));var utils=require(_0x9099('0x15'));var config=require(_0x9099('0x16'));var licenseUtil=require(_0x9099('0x17'));var db=require(_0x9099('0x18'))['db'];function respondWithStatusCode(_0xdf629b,_0x17f89b){_0x17f89b=_0x17f89b||0xcc;return function(_0x5b6ba1){if(_0x5b6ba1){return _0xdf629b[_0x9099('0x19')](_0x17f89b);}return _0xdf629b[_0x9099('0x1a')](_0x17f89b)['end']();};}function respondWithResult(_0xd49b1e,_0x25afea){_0x25afea=_0x25afea||0xc8;return function(_0x5b33aa){if(_0x5b33aa){return _0xd49b1e[_0x9099('0x1a')](_0x25afea)['json'](_0x5b33aa);}};}function respondWithFilteredResult(_0x5477a5,_0x47b93a){return function(_0x12194c){if(_0x12194c){var _0x85a049=typeof _0x47b93a[_0x9099('0x1b')]===_0x9099('0x1c')&&typeof _0x47b93a['limit']===_0x9099('0x1c');var _0x3900d7=_0x12194c['count'];var _0x187d84=_0x85a049?0x0:_0x47b93a['offset'];var _0x2a1a96=_0x85a049?_0x12194c[_0x9099('0x1d')]:_0x47b93a['offset']+_0x47b93a[_0x9099('0x1e')];var _0x409470;if(_0x2a1a96>=_0x3900d7){_0x2a1a96=_0x3900d7;_0x409470=0xc8;}else{_0x409470=0xce;}_0x5477a5['status'](_0x409470);return _0x5477a5['set'](_0x9099('0x1f'),_0x187d84+'-'+_0x2a1a96+'/'+_0x3900d7)[_0x9099('0x20')](_0x12194c);}return null;};}function patchUpdates(_0x424f53){return function(_0x466667){try{jsonpatch[_0x9099('0x21')](_0x466667,_0x424f53,!![]);}catch(_0x1e97ea){return BPromise['reject'](_0x1e97ea);}return _0x466667[_0x9099('0x22')]();};}function saveUpdates(_0x4fda23,_0x5b434c){return function(_0x284fa9){if(_0x284fa9){return _0x284fa9[_0x9099('0x23')](_0x4fda23)[_0x9099('0x24')](function(_0x49dc7a){return _0x49dc7a;});}return null;};}function removeEntity(_0x379d1c,_0x1affbf){return function(_0x5f2fb1){if(_0x5f2fb1){return _0x5f2fb1[_0x9099('0x25')]()[_0x9099('0x24')](function(){var _0x176d6e=_0x5f2fb1['get']({'plain':!![]});var _0x545d7c='Dispositions';return db['UserProfileResource'][_0x9099('0x25')]({'where':{'type':_0x545d7c,'resourceId':_0x176d6e['id']}})[_0x9099('0x24')](function(){return _0x5f2fb1;});})[_0x9099('0x24')](function(){_0x379d1c['status'](0xcc)[_0x9099('0x26')]();});}};}function handleEntityNotFound(_0x287eb7,_0x328756){return function(_0x1b195c){if(!_0x1b195c){_0x287eb7[_0x9099('0x19')](0x194);}return _0x1b195c;};}function handleError(_0x2c803f,_0x45294c){_0x45294c=_0x45294c||0x1f4;return function(_0x359a51){logger[_0x9099('0x27')](_0x359a51[_0x9099('0x28')]);if(_0x359a51['name']){delete _0x359a51[_0x9099('0x29')];}_0x2c803f['status'](_0x45294c)[_0x9099('0x2a')](_0x359a51);};}exports[_0x9099('0x2b')]=function(_0x3c47a2,_0x38135c){var _0x1d700a={},_0x57148d={},_0x1f4259={'count':0x0,'rows':[]};var _0x16c9a3=_['map'](db[_0x9099('0x2c')][_0x9099('0x2d')],function(_0x40176b){return{'name':_0x40176b[_0x9099('0x2e')],'type':_0x40176b['type']['key']};});_0x57148d['model']=_[_0x9099('0x2f')](_0x16c9a3,_0x9099('0x29'));_0x57148d['query']=_[_0x9099('0x30')](_0x3c47a2[_0x9099('0x31')]);_0x57148d[_0x9099('0x32')]=_[_0x9099('0x33')](_0x57148d[_0x9099('0x34')],_0x57148d['query']);_0x1d700a[_0x9099('0x35')]=_[_0x9099('0x33')](_0x57148d[_0x9099('0x34')],qs['fields'](_0x3c47a2['query'][_0x9099('0x36')]));_0x1d700a['attributes']=_0x1d700a[_0x9099('0x35')]['length']?_0x1d700a['attributes']:_0x57148d[_0x9099('0x34')];if(!_0x3c47a2['query'][_0x9099('0x37')](_0x9099('0x38'))){_0x1d700a[_0x9099('0x1e')]=qs[_0x9099('0x1e')](_0x3c47a2[_0x9099('0x31')][_0x9099('0x1e')]);_0x1d700a[_0x9099('0x1b')]=qs[_0x9099('0x1b')](_0x3c47a2[_0x9099('0x31')][_0x9099('0x1b')]);}_0x1d700a[_0x9099('0x39')]=qs[_0x9099('0x3a')](_0x3c47a2[_0x9099('0x31')][_0x9099('0x3a')]);_0x1d700a['where']=qs['filters'](_[_0x9099('0x3b')](_0x3c47a2[_0x9099('0x31')],_0x57148d[_0x9099('0x32')]),_0x16c9a3);if(_0x3c47a2[_0x9099('0x31')][_0x9099('0x3c')]){_0x1d700a[_0x9099('0x3d')]=_['merge'](_0x1d700a[_0x9099('0x3d')],{'$or':_[_0x9099('0x2f')](_0x16c9a3,function(_0x262c62){if(_0x262c62[_0x9099('0x3e')]!==_0x9099('0x3f')){var _0x202fdb={};_0x202fdb[_0x262c62['name']]={'$like':'%'+_0x3c47a2[_0x9099('0x31')]['filter']+'%'};return _0x202fdb;}})});}_0x1d700a=_['merge']({},_0x1d700a,_0x3c47a2[_0x9099('0x40')]);var _0x6cddf2={'where':_0x1d700a[_0x9099('0x3d')]};return db[_0x9099('0x2c')][_0x9099('0x1d')](_0x6cddf2)[_0x9099('0x24')](function(_0x56a94d){_0x1f4259['count']=_0x56a94d;if(_0x3c47a2[_0x9099('0x31')][_0x9099('0x41')]){_0x1d700a[_0x9099('0x42')]=[{'all':!![]}];}return db[_0x9099('0x2c')]['findAll'](_0x1d700a);})['then'](function(_0x588550){_0x1f4259['rows']=_0x588550;return _0x1f4259;})[_0x9099('0x24')](respondWithFilteredResult(_0x38135c,_0x1d700a))[_0x9099('0x43')](handleError(_0x38135c,null));};exports[_0x9099('0x44')]=function(_0x501e45,_0x4a468d){var _0x235850={'raw':!![],'where':{'id':_0x501e45[_0x9099('0x45')]['id']}},_0x345194={};_0x345194['model']=_['keys'](db[_0x9099('0x2c')][_0x9099('0x2d')]);_0x345194['query']=_[_0x9099('0x30')](_0x501e45[_0x9099('0x31')]);_0x345194[_0x9099('0x32')]=_[_0x9099('0x33')](_0x345194[_0x9099('0x34')],_0x345194[_0x9099('0x31')]);_0x235850[_0x9099('0x35')]=_[_0x9099('0x33')](_0x345194[_0x9099('0x34')],qs[_0x9099('0x36')](_0x501e45[_0x9099('0x31')][_0x9099('0x36')]));_0x235850[_0x9099('0x35')]=_0x235850['attributes'][_0x9099('0x46')]?_0x235850[_0x9099('0x35')]:_0x345194[_0x9099('0x34')];if(_0x501e45[_0x9099('0x31')]['includeAll']){_0x235850[_0x9099('0x42')]=[{'all':!![]}];}_0x235850=_[_0x9099('0x47')]({},_0x235850,_0x501e45[_0x9099('0x40')]);return db[_0x9099('0x2c')][_0x9099('0x48')](_0x235850)[_0x9099('0x24')](handleEntityNotFound(_0x4a468d,null))[_0x9099('0x24')](respondWithResult(_0x4a468d,null))['catch'](handleError(_0x4a468d,null));};exports[_0x9099('0x49')]=function(_0x5a91c2,_0x497314){return db['Disposition'][_0x9099('0x49')](_0x5a91c2['body'],{})[_0x9099('0x24')](function(_0x1bd32d){var _0x15e2dc=_0x5a91c2[_0x9099('0x4a')][_0x9099('0x4b')]({'plain':!![]});if(!_0x15e2dc)throw new Error(_0x9099('0x4c'));if(_0x15e2dc[_0x9099('0x4d')]===_0x9099('0x4a')){var _0x5978f4=_0x1bd32d[_0x9099('0x4b')]({'plain':!![]});var _0x179ea9=_0x9099('0x4e');return db[_0x9099('0x4f')]['find']({'where':{'name':_0x179ea9,'userProfileId':_0x15e2dc[_0x9099('0x50')]},'raw':!![]})[_0x9099('0x24')](function(_0x57a79b){if(_0x57a79b&&_0x57a79b[_0x9099('0x51')]===0x0){return db[_0x9099('0x52')][_0x9099('0x49')]({'name':_0x5978f4[_0x9099('0x29')],'resourceId':_0x5978f4['id'],'type':_0x57a79b['name'],'sectionId':_0x57a79b['id']},{})['then'](function(){return _0x1bd32d;});}else{return _0x1bd32d;}})[_0x9099('0x43')](function(_0x4347fa){logger[_0x9099('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4347fa);throw _0x4347fa;});}return _0x1bd32d;})[_0x9099('0x24')](respondWithResult(_0x497314,0xc9))['catch'](handleError(_0x497314,null));};exports[_0x9099('0x23')]=function(_0x1b4354,_0x52c704){if(_0x1b4354[_0x9099('0x53')]['id']){delete _0x1b4354[_0x9099('0x53')]['id'];}return db[_0x9099('0x2c')][_0x9099('0x48')]({'where':{'id':_0x1b4354[_0x9099('0x45')]['id']}})['then'](handleEntityNotFound(_0x52c704,null))[_0x9099('0x24')](saveUpdates(_0x1b4354[_0x9099('0x53')],null))['then'](respondWithResult(_0x52c704,null))['catch'](handleError(_0x52c704,null));};exports[_0x9099('0x25')]=function(_0x463c78,_0x42d54f){return db['Disposition'][_0x9099('0x48')]({'where':{'id':_0x463c78[_0x9099('0x45')]['id']}})[_0x9099('0x24')](handleEntityNotFound(_0x42d54f,null))[_0x9099('0x24')](removeEntity(_0x42d54f,null))[_0x9099('0x43')](handleError(_0x42d54f,null));}; \ No newline at end of file +var _0x64e4=['sendStatus','error','name','send','index','map','Disposition','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Dispositions','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource'];(function(_0x1fc4e2,_0x493c3b){var _0x2ba184=function(_0x58e64f){while(--_0x58e64f){_0x1fc4e2['push'](_0x1fc4e2['shift']());}};_0x2ba184(++_0x493c3b);}(_0x64e4,0x135));var _0x464e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x64e4[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x464e('0x0'));var rimraf=require(_0x464e('0x1'));var zipdir=require(_0x464e('0x2'));var jsonpatch=require(_0x464e('0x3'));var rp=require(_0x464e('0x4'));var moment=require(_0x464e('0x5'));var BPromise=require(_0x464e('0x6'));var Mustache=require(_0x464e('0x7'));var util=require(_0x464e('0x8'));var path=require(_0x464e('0x9'));var sox=require('sox');var csv=require(_0x464e('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x464e('0xb'));var squel=require('squel');var crypto=require(_0x464e('0xc'));var jsforce=require(_0x464e('0xd'));var deskjs=require(_0x464e('0xe'));var toCsv=require(_0x464e('0xa'));var querystring=require(_0x464e('0xf'));var Papa=require(_0x464e('0x10'));var Redis=require(_0x464e('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x464e('0x12'));var as=require(_0x464e('0x13'));var hardwareService=require(_0x464e('0x14'));var logger=require(_0x464e('0x15'))(_0x464e('0x16'));var utils=require('../../config/utils');var config=require(_0x464e('0x17'));var licenseUtil=require(_0x464e('0x18'));var db=require(_0x464e('0x19'))['db'];function respondWithStatusCode(_0x1b8734,_0x25524b){_0x25524b=_0x25524b||0xcc;return function(_0x468ed5){if(_0x468ed5){return _0x1b8734['sendStatus'](_0x25524b);}return _0x1b8734[_0x464e('0x1a')](_0x25524b)[_0x464e('0x1b')]();};}function respondWithResult(_0x166c62,_0x1354ed){_0x1354ed=_0x1354ed||0xc8;return function(_0x3fbfc2){if(_0x3fbfc2){return _0x166c62[_0x464e('0x1a')](_0x1354ed)[_0x464e('0x1c')](_0x3fbfc2);}};}function respondWithFilteredResult(_0x42c12c,_0x52052e){return function(_0x187b8d){if(_0x187b8d){var _0x134ab4=typeof _0x52052e['offset']===_0x464e('0x1d')&&typeof _0x52052e[_0x464e('0x1e')]===_0x464e('0x1d');var _0x1b382d=_0x187b8d[_0x464e('0x1f')];var _0x3806e4=_0x134ab4?0x0:_0x52052e[_0x464e('0x20')];var _0x3f8f1d=_0x134ab4?_0x187b8d[_0x464e('0x1f')]:_0x52052e[_0x464e('0x20')]+_0x52052e[_0x464e('0x1e')];var _0x1d33ce;if(_0x3f8f1d>=_0x1b382d){_0x3f8f1d=_0x1b382d;_0x1d33ce=0xc8;}else{_0x1d33ce=0xce;}_0x42c12c[_0x464e('0x1a')](_0x1d33ce);return _0x42c12c[_0x464e('0x21')](_0x464e('0x22'),_0x3806e4+'-'+_0x3f8f1d+'/'+_0x1b382d)[_0x464e('0x1c')](_0x187b8d);}return null;};}function patchUpdates(_0x1d00c3){return function(_0x3dccd4){try{jsonpatch[_0x464e('0x23')](_0x3dccd4,_0x1d00c3,!![]);}catch(_0x4bb040){return BPromise[_0x464e('0x24')](_0x4bb040);}return _0x3dccd4[_0x464e('0x25')]();};}function saveUpdates(_0x2f362b,_0x8f6c40){return function(_0x44e732){if(_0x44e732){return _0x44e732[_0x464e('0x26')](_0x2f362b)[_0x464e('0x27')](function(_0x53a0e9){return _0x53a0e9;});}return null;};}function removeEntity(_0x401e34,_0x13e71a){return function(_0x18a394){if(_0x18a394){return _0x18a394[_0x464e('0x28')]()['then'](function(){var _0xa7ecd1=_0x18a394[_0x464e('0x29')]({'plain':!![]});var _0x1bfd40='Dispositions';return db[_0x464e('0x2a')]['destroy']({'where':{'type':_0x1bfd40,'resourceId':_0xa7ecd1['id']}})[_0x464e('0x27')](function(){return _0x18a394;});})[_0x464e('0x27')](function(){_0x401e34['status'](0xcc)[_0x464e('0x1b')]();});}};}function handleEntityNotFound(_0x207636,_0x5677a9){return function(_0x50a241){if(!_0x50a241){_0x207636[_0x464e('0x2b')](0x194);}return _0x50a241;};}function handleError(_0x1ea6d9,_0x28c9fb){_0x28c9fb=_0x28c9fb||0x1f4;return function(_0x78c4a7){logger[_0x464e('0x2c')](_0x78c4a7['stack']);if(_0x78c4a7[_0x464e('0x2d')]){delete _0x78c4a7['name'];}_0x1ea6d9[_0x464e('0x1a')](_0x28c9fb)[_0x464e('0x2e')](_0x78c4a7);};}exports[_0x464e('0x2f')]=function(_0x45bc0f,_0x1fc87c){var _0x14d1bf={},_0x122185={},_0x38cdba={'count':0x0,'rows':[]};var _0x1c1d7d=_[_0x464e('0x30')](db[_0x464e('0x31')][_0x464e('0x32')],function(_0x1ef6ae){return{'name':_0x1ef6ae['fieldName'],'type':_0x1ef6ae[_0x464e('0x33')][_0x464e('0x34')]};});_0x122185[_0x464e('0x35')]=_[_0x464e('0x30')](_0x1c1d7d,_0x464e('0x2d'));_0x122185['query']=_[_0x464e('0x36')](_0x45bc0f[_0x464e('0x37')]);_0x122185[_0x464e('0x38')]=_[_0x464e('0x39')](_0x122185['model'],_0x122185[_0x464e('0x37')]);_0x14d1bf[_0x464e('0x3a')]=_['intersection'](_0x122185[_0x464e('0x35')],qs[_0x464e('0x3b')](_0x45bc0f['query']['fields']));_0x14d1bf[_0x464e('0x3a')]=_0x14d1bf[_0x464e('0x3a')][_0x464e('0x3c')]?_0x14d1bf[_0x464e('0x3a')]:_0x122185[_0x464e('0x35')];if(!_0x45bc0f['query'][_0x464e('0x3d')]('nolimit')){_0x14d1bf[_0x464e('0x1e')]=qs[_0x464e('0x1e')](_0x45bc0f[_0x464e('0x37')][_0x464e('0x1e')]);_0x14d1bf[_0x464e('0x20')]=qs[_0x464e('0x20')](_0x45bc0f[_0x464e('0x37')][_0x464e('0x20')]);}_0x14d1bf[_0x464e('0x3e')]=qs[_0x464e('0x3f')](_0x45bc0f[_0x464e('0x37')][_0x464e('0x3f')]);_0x14d1bf[_0x464e('0x40')]=qs[_0x464e('0x38')](_[_0x464e('0x41')](_0x45bc0f[_0x464e('0x37')],_0x122185['filters']),_0x1c1d7d);if(_0x45bc0f[_0x464e('0x37')][_0x464e('0x42')]){_0x14d1bf['where']=_['merge'](_0x14d1bf[_0x464e('0x40')],{'$or':_['map'](_0x1c1d7d,function(_0x4d7db9){if(_0x4d7db9[_0x464e('0x33')]!==_0x464e('0x43')){var _0x3909d5={};_0x3909d5[_0x4d7db9[_0x464e('0x2d')]]={'$like':'%'+_0x45bc0f[_0x464e('0x37')][_0x464e('0x42')]+'%'};return _0x3909d5;}})});}_0x14d1bf=_[_0x464e('0x44')]({},_0x14d1bf,_0x45bc0f[_0x464e('0x45')]);var _0x144b2a={'where':_0x14d1bf[_0x464e('0x40')]};return db[_0x464e('0x31')][_0x464e('0x1f')](_0x144b2a)[_0x464e('0x27')](function(_0x3837d1){_0x38cdba['count']=_0x3837d1;if(_0x45bc0f['query'][_0x464e('0x46')]){_0x14d1bf[_0x464e('0x47')]=[{'all':!![]}];}return db[_0x464e('0x31')][_0x464e('0x48')](_0x14d1bf);})[_0x464e('0x27')](function(_0x21b7e2){_0x38cdba[_0x464e('0x49')]=_0x21b7e2;return _0x38cdba;})[_0x464e('0x27')](respondWithFilteredResult(_0x1fc87c,_0x14d1bf))[_0x464e('0x4a')](handleError(_0x1fc87c,null));};exports[_0x464e('0x4b')]=function(_0x4e4065,_0x40e7e7){var _0x4f74e3={'raw':!![],'where':{'id':_0x4e4065[_0x464e('0x4c')]['id']}},_0x2b726e={};_0x2b726e[_0x464e('0x35')]=_['keys'](db[_0x464e('0x31')][_0x464e('0x32')]);_0x2b726e[_0x464e('0x37')]=_[_0x464e('0x36')](_0x4e4065[_0x464e('0x37')]);_0x2b726e[_0x464e('0x38')]=_[_0x464e('0x39')](_0x2b726e[_0x464e('0x35')],_0x2b726e['query']);_0x4f74e3['attributes']=_[_0x464e('0x39')](_0x2b726e['model'],qs['fields'](_0x4e4065[_0x464e('0x37')][_0x464e('0x3b')]));_0x4f74e3[_0x464e('0x3a')]=_0x4f74e3[_0x464e('0x3a')][_0x464e('0x3c')]?_0x4f74e3[_0x464e('0x3a')]:_0x2b726e[_0x464e('0x35')];if(_0x4e4065[_0x464e('0x37')][_0x464e('0x46')]){_0x4f74e3['include']=[{'all':!![]}];}_0x4f74e3=_[_0x464e('0x44')]({},_0x4f74e3,_0x4e4065['options']);return db[_0x464e('0x31')][_0x464e('0x4d')](_0x4f74e3)[_0x464e('0x27')](handleEntityNotFound(_0x40e7e7,null))[_0x464e('0x27')](respondWithResult(_0x40e7e7,null))[_0x464e('0x4a')](handleError(_0x40e7e7,null));};exports[_0x464e('0x4e')]=function(_0x565d42,_0x544cb6){return db[_0x464e('0x31')][_0x464e('0x4e')](_0x565d42['body'],{})[_0x464e('0x27')](function(_0x2ef1f3){var _0xbc01a0=_0x565d42[_0x464e('0x4f')][_0x464e('0x29')]({'plain':!![]});if(!_0xbc01a0)throw new Error(_0x464e('0x50'));if(_0xbc01a0[_0x464e('0x51')]==='user'){var _0x1f06fb=_0x2ef1f3[_0x464e('0x29')]({'plain':!![]});var _0x3a632b=_0x464e('0x52');return db[_0x464e('0x53')][_0x464e('0x4d')]({'where':{'name':_0x3a632b,'userProfileId':_0xbc01a0[_0x464e('0x54')]},'raw':!![]})[_0x464e('0x27')](function(_0x1ebd2e){if(_0x1ebd2e&&_0x1ebd2e[_0x464e('0x55')]===0x0){return db['UserProfileResource'][_0x464e('0x4e')]({'name':_0x1f06fb[_0x464e('0x2d')],'resourceId':_0x1f06fb['id'],'type':_0x1ebd2e['name'],'sectionId':_0x1ebd2e['id']},{})[_0x464e('0x27')](function(){return _0x2ef1f3;});}else{return _0x2ef1f3;}})[_0x464e('0x4a')](function(_0x5a729f){logger[_0x464e('0x2c')](_0x464e('0x56'),_0x5a729f);throw _0x5a729f;});}return _0x2ef1f3;})[_0x464e('0x27')](respondWithResult(_0x544cb6,0xc9))[_0x464e('0x4a')](handleError(_0x544cb6,null));};exports[_0x464e('0x26')]=function(_0x3421d7,_0x57108f){if(_0x3421d7[_0x464e('0x57')]['id']){delete _0x3421d7['body']['id'];}return db['Disposition'][_0x464e('0x4d')]({'where':{'id':_0x3421d7[_0x464e('0x4c')]['id']}})[_0x464e('0x27')](handleEntityNotFound(_0x57108f,null))['then'](saveUpdates(_0x3421d7[_0x464e('0x57')],null))[_0x464e('0x27')](respondWithResult(_0x57108f,null))['catch'](handleError(_0x57108f,null));};exports[_0x464e('0x28')]=function(_0xb0298e,_0x453f18){return db[_0x464e('0x31')]['find']({'where':{'id':_0xb0298e[_0x464e('0x4c')]['id']}})[_0x464e('0x27')](handleEntityNotFound(_0x453f18,null))['then'](removeEntity(_0x453f18,null))[_0x464e('0x4a')](handleError(_0x453f18,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index f33f4af..3f241ef 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 _0xd4a8=['rimraf','./disposition.attributes','exports','tools_dispositions','name_voice','name','ListId','name_chat','ChatWebsiteId','name_mail','MailAccountId','SmsAccountId','name_fax','name_openchannel','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x19dd7a,_0x51de21){var _0x3feb6a=function(_0x4a3c84){while(--_0x4a3c84){_0x19dd7a['push'](_0x19dd7a['shift']());}};_0x3feb6a(++_0x51de21);}(_0xd4a8,0x13d));var _0x8d4a=function(_0x1886b2,_0x447454){_0x1886b2=_0x1886b2-0x0;var _0x91557a=_0xd4a8[_0x1886b2];return _0x91557a;};'use strict';var _=require(_0x8d4a('0x0'));var util=require(_0x8d4a('0x1'));var logger=require(_0x8d4a('0x2'))(_0x8d4a('0x3'));var moment=require(_0x8d4a('0x4'));var BPromise=require(_0x8d4a('0x5'));var rp=require(_0x8d4a('0x6'));var fs=require('fs');var path=require(_0x8d4a('0x7'));var rimraf=require(_0x8d4a('0x8'));var config=require('../../config/environment');var attributes=require(_0x8d4a('0x9'));module[_0x8d4a('0xa')]=function(_0x502a32,_0x2dd96e){return _0x502a32['define']('Disposition',attributes,{'tableName':_0x8d4a('0xb'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x8d4a('0xc'),'fields':[_0x8d4a('0xd'),_0x8d4a('0xe')]},{'unique':!![],'name':_0x8d4a('0xf'),'fields':[_0x8d4a('0xd'),_0x8d4a('0x10')]},{'unique':!![],'name':_0x8d4a('0x11'),'fields':[_0x8d4a('0xd'),_0x8d4a('0x12')]},{'unique':!![],'name':'name_sms','fields':[_0x8d4a('0xd'),_0x8d4a('0x13')]},{'unique':!![],'name':_0x8d4a('0x14'),'fields':[_0x8d4a('0xd'),'FaxAccountId']},{'unique':!![],'name':_0x8d4a('0x15'),'fields':[_0x8d4a('0xd'),_0x8d4a('0x16')]},{'unique':!![],'name':_0x8d4a('0x17'),'fields':['name',_0x8d4a('0x18')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xed3d=['../../config/environment','./disposition.attributes','exports','define','tools_dispositions','name_voice','name','ListId','ChatWebsiteId','MailAccountId','name_fax','FaxAccountId','name_whatsapp','WhatsappAccountId','api','moment','bluebird','request-promise','path'];(function(_0x3e429d,_0x125d0d){var _0x167cf1=function(_0x44d496){while(--_0x44d496){_0x3e429d['push'](_0x3e429d['shift']());}};_0x167cf1(++_0x125d0d);}(_0xed3d,0x1e9));var _0xded3=function(_0x326c4a,_0x454deb){_0x326c4a=_0x326c4a-0x0;var _0x4b489d=_0xed3d[_0x326c4a];return _0x4b489d;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xded3('0x0'));var moment=require(_0xded3('0x1'));var BPromise=require(_0xded3('0x2'));var rp=require(_0xded3('0x3'));var fs=require('fs');var path=require(_0xded3('0x4'));var rimraf=require('rimraf');var config=require(_0xded3('0x5'));var attributes=require(_0xded3('0x6'));module[_0xded3('0x7')]=function(_0x2c4d0f,_0x57f634){return _0x2c4d0f[_0xded3('0x8')]('Disposition',attributes,{'tableName':_0xded3('0x9'),'paranoid':![],'indexes':[{'unique':!![],'name':_0xded3('0xa'),'fields':[_0xded3('0xb'),_0xded3('0xc')]},{'unique':!![],'name':'name_chat','fields':[_0xded3('0xb'),_0xded3('0xd')]},{'unique':!![],'name':'name_mail','fields':[_0xded3('0xb'),_0xded3('0xe')]},{'unique':!![],'name':'name_sms','fields':['name','SmsAccountId']},{'unique':!![],'name':_0xded3('0xf'),'fields':['name',_0xded3('0x10')]},{'unique':!![],'name':'name_openchannel','fields':[_0xded3('0xb'),'OpenchannelAccountId']},{'unique':!![],'name':_0xded3('0x11'),'fields':[_0xded3('0xb'),_0xded3('0x12')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index a204be0..4f3fd53 100644 --- a/server/api/disposition/disposition.rpc.js +++ b/server/api/disposition/disposition.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['http','info','Disposition,\x20%s,\x20%s','request\x20sent','debug','Disposition,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0xcd3e1e,_0x2c71d7){var _0x5b0edd=function(_0x1a656f){while(--_0x1a656f){_0xcd3e1e['push'](_0xcd3e1e['shift']());}};_0x5b0edd(++_0x2c71d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xa9e0[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file +var _0xa9e0=['http','info','Disposition,\x20%s,\x20%s','request\x20sent','debug','Disposition,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x52cba7,_0x570581){var _0x10d534=function(_0x103607){while(--_0x103607){_0x52cba7['push'](_0x52cba7['shift']());}};_0x10d534(++_0x570581);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xa9e0[_0x4baae2];return _0x1a2285;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file diff --git a/server/api/disposition/index.js b/server/api/disposition/index.js index a416610..94f6366 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 _0xfdd9=['post','isAuthenticated','put','update','delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','show'];(function(_0x31baec,_0x1a7f9f){var _0x23b42b=function(_0xc50c0b){while(--_0xc50c0b){_0x31baec['push'](_0x31baec['shift']());}};_0x23b42b(++_0x1a7f9f);}(_0xfdd9,0x102));var _0x9fdd=function(_0x3bd504,_0x4c333d){_0x3bd504=_0x3bd504-0x0;var _0x5dc258=_0xfdd9[_0x3bd504];return _0x5dc258;};'use strict';var multer=require(_0x9fdd('0x0'));var util=require(_0x9fdd('0x1'));var path=require(_0x9fdd('0x2'));var timeout=require(_0x9fdd('0x3'));var express=require('express');var router=express[_0x9fdd('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9fdd('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9fdd('0x6'));var controller=require('./disposition.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x9fdd('0x7')]);router[_0x9fdd('0x8')]('/',auth[_0x9fdd('0x9')](),controller['create']);router[_0x9fdd('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x9fdd('0xb')]);router[_0x9fdd('0xc')]('/:id',auth[_0x9fdd('0x9')](),controller['destroy']);module[_0x9fdd('0xd')]=router; \ No newline at end of file +var _0xb14c=['/:id','show','post','put','delete','destroy','exports','multer','util','path','connect-timeout','express','../../config/environment','get','isAuthenticated'];(function(_0x2d6e66,_0x3de933){var _0x42af90=function(_0x1cf6df){while(--_0x1cf6df){_0x2d6e66['push'](_0x2d6e66['shift']());}};_0x42af90(++_0x3de933);}(_0xb14c,0xac));var _0xcb14=function(_0x3b0866,_0x454edd){_0x3b0866=_0x3b0866-0x0;var _0x323008=_0xb14c[_0x3b0866];return _0x323008;};'use strict';var multer=require(_0xcb14('0x0'));var util=require(_0xcb14('0x1'));var path=require(_0xcb14('0x2'));var timeout=require(_0xcb14('0x3'));var express=require(_0xcb14('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xcb14('0x5'));var controller=require('./disposition.controller');router[_0xcb14('0x6')]('/',auth[_0xcb14('0x7')](),controller['index']);router[_0xcb14('0x6')](_0xcb14('0x8'),auth[_0xcb14('0x7')](),controller[_0xcb14('0x9')]);router[_0xcb14('0xa')]('/',auth['isAuthenticated'](),controller['create']);router[_0xcb14('0xb')](_0xcb14('0x8'),auth[_0xcb14('0x7')](),controller['update']);router[_0xcb14('0xc')](_0xcb14('0x8'),auth[_0xcb14('0x7')](),controller[_0xcb14('0xd')]);module[_0xcb14('0xe')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index 49344d1..6c9cfa9 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 _0x4074=['INTEGER','SIP','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','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','2400','4800','9600','14400','12000','v17,v27,v29'];(function(_0x4fc212,_0x1087aa){var _0x252317=function(_0x6facac){while(--_0x6facac){_0x4fc212['push'](_0x4fc212['shift']());}};_0x252317(++_0x1087aa);}(_0x4074,0xf0));var _0x4407=function(_0xaa2849,_0x23507b){_0xaa2849=_0xaa2849-0x0;var _0x187ea5=_0x4074[_0xaa2849];return _0x187ea5;};'use strict';var Sequelize=require(_0x4407('0x0'));module[_0x4407('0x1')]={'name':{'type':Sequelize[_0x4407('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'ecm':{'type':Sequelize[_0x4407('0x3')](_0x4407('0x4'),'no'),'defaultValue':_0x4407('0x4')},'headerinfo':{'type':Sequelize[_0x4407('0x2')],'defaultValue':_0x4407('0x5')},'localstationid':{'type':Sequelize[_0x4407('0x2')],'unique':_0x4407('0x6')},'minrate':{'type':Sequelize[_0x4407('0x3')](_0x4407('0x7'),_0x4407('0x8'),'7200',_0x4407('0x9'),'12000',_0x4407('0xa')),'defaultValue':_0x4407('0x8')},'maxrate':{'type':Sequelize[_0x4407('0x3')]('2400','4800','7200',_0x4407('0x9'),_0x4407('0xb'),_0x4407('0xa')),'defaultValue':_0x4407('0xa')},'modem':{'type':Sequelize[_0x4407('0x2')],'defaultValue':_0x4407('0xc')},'gateway':{'type':Sequelize[_0x4407('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x4407('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x4407('0xd')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x4407('0x3')](_0x4407('0xe'),'IAX',_0x4407('0xf'),_0x4407('0x10')),'defaultValue':'SIP'},'key':{'type':Sequelize[_0x4407('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x4407('0x11');}},'notificationSound':{'type':Sequelize[_0x4407('0x12')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x4407('0x12')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x4407('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x4407('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x4407('0x12')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x4407('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x4407('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x4407('0xd')],'allowNull':!![],'defaultValue':null,'comment':_0x4407('0x13')},'mandatoryDisposition':{'type':Sequelize[_0x4407('0x12')],'defaultValue':![],'comment':_0x4407('0x14'),'set':function(_0x12952e){if(!_0x12952e)this['setDataValue'](_0x4407('0x15'),null);this['setDataValue'](_0x4407('0x16'),_0x12952e);}}}; \ No newline at end of file +var _0xef17=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','sequelize','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','2400','7200','14400','4800','9600','12000','SIP','DADHI','KHOMP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER'];(function(_0x4c8833,_0x14e755){var _0x30df54=function(_0x197811){while(--_0x197811){_0x4c8833['push'](_0x4c8833['shift']());}};_0x30df54(++_0x14e755);}(_0xef17,0x136));var _0x7ef1=function(_0x48a37e,_0x2be620){_0x48a37e=_0x48a37e-0x0;var _0x1a94c3=_0xef17[_0x48a37e];return _0x1a94c3;};'use strict';var Sequelize=require(_0x7ef1('0x0'));module[_0x7ef1('0x1')]={'name':{'type':Sequelize[_0x7ef1('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x7ef1('0x2')]},'ecm':{'type':Sequelize[_0x7ef1('0x3')](_0x7ef1('0x4'),'no'),'defaultValue':_0x7ef1('0x4')},'headerinfo':{'type':Sequelize[_0x7ef1('0x2')],'defaultValue':_0x7ef1('0x5')},'localstationid':{'type':Sequelize['STRING'],'unique':_0x7ef1('0x6')},'minrate':{'type':Sequelize['ENUM'](_0x7ef1('0x7'),'4800',_0x7ef1('0x8'),'9600','12000',_0x7ef1('0x9')),'defaultValue':_0x7ef1('0xa')},'maxrate':{'type':Sequelize['ENUM'](_0x7ef1('0x7'),_0x7ef1('0xa'),_0x7ef1('0x8'),_0x7ef1('0xb'),_0x7ef1('0xc'),_0x7ef1('0x9')),'defaultValue':_0x7ef1('0x9')},'modem':{'type':Sequelize['STRING'],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize[_0x7ef1('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM'](_0x7ef1('0xd'),'IAX',_0x7ef1('0xe'),_0x7ef1('0xf')),'defaultValue':_0x7ef1('0xd')},'key':{'type':Sequelize[_0x7ef1('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x7ef1('0x10')],'defaultValue':function(){return _0x7ef1('0x11');}},'notificationSound':{'type':Sequelize[_0x7ef1('0x12')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x7ef1('0x12')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x7ef1('0x12')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x7ef1('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x7ef1('0x13')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x7ef1('0x14'),'set':function(_0x4da0fa){if(!_0x4da0fa)this[_0x7ef1('0x15')]('mandatoryDispositionPauseId',null);this['setDataValue']('mandatoryDisposition',_0x4da0fa);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 67f3ac9..f4c0e65 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 _0xac14=['FaxAccount,\x20%s,\x20%s','message','result','catch','status','json','offset','undefined','limit','count','set','Content-Range','apply','update','destroy','get','UserProfileResource','stack','name','send','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','FaxAccount','includeAll','include','findAll','show','intersection','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','params','describe','addDisposition','FaxAccountId','Disposition','findOne','rows','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addInteraction','omit','getInteractions','FaxInteraction','CmContact','User','fullname','internal','Tag','color','tag','addApplications','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','findAndCountAll','finally','sendStatus','getApplications','context','exten','localstationid','app','system','description','Fax\x20Extension','priority','appdata','Answer','push','CDR(type)=inbound-fax','Set','ecm','gateway','faxdetect','maxrate','minrate','modem','FAXOPT(','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','VoiceExtension','bulkCreate','tech','createdAt','updatedAt','TrunkId','findById','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','Contacts','attachments','join','server/files/attachments','basename','CheckAfterSend','isNil','from','fax','List\x20not\x20found','Send\x20Fax\x20failed','out','spread','filename','ContactId','Messages','dataValues','SendFax','path','SendFaxRpc,\x20%s','addAgents','emit','removeAgents','isArray','userFaxAccount:remove','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','http','client','then','info','request\x20sent','debug','stringify','error','code'];(function(_0x3b3147,_0x222c61){var _0x1b2e99=function(_0x1498d9){while(--_0x1498d9){_0x3b3147['push'](_0x3b3147['shift']());}};_0x1b2e99(++_0x222c61);}(_0xac14,0x9e));var _0x4ac1=function(_0x5e43dc,_0x21280a){_0x5e43dc=_0x5e43dc-0x0;var _0x49702a=_0xac14[_0x5e43dc];return _0x49702a;};'use strict';var emlformat=require(_0x4ac1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4ac1('0x1'));var jsonpatch=require(_0x4ac1('0x2'));var rp=require(_0x4ac1('0x3'));var moment=require(_0x4ac1('0x4'));var BPromise=require(_0x4ac1('0x5'));var Mustache=require(_0x4ac1('0x6'));var util=require(_0x4ac1('0x7'));var path=require('path');var sox=require(_0x4ac1('0x8'));var csv=require(_0x4ac1('0x9'));var ejs=require(_0x4ac1('0xa'));var fs=require('fs');var fs_extra=require(_0x4ac1('0xb'));var _=require(_0x4ac1('0xc'));var squel=require(_0x4ac1('0xd'));var crypto=require(_0x4ac1('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4ac1('0xf'));var Papa=require(_0x4ac1('0x10'));var Redis=require(_0x4ac1('0x11'));var authService=require(_0x4ac1('0x12'));var qs=require(_0x4ac1('0x13'));var as=require(_0x4ac1('0x14'));var hardwareService=require(_0x4ac1('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x4ac1('0x16'));var config=require(_0x4ac1('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x4ac1('0x18')]=_[_0x4ac1('0x19')](config[_0x4ac1('0x18')],{'host':_0x4ac1('0x1a'),'port':0x18eb});var socket=require(_0x4ac1('0x1b'))(new Redis(config[_0x4ac1('0x18')]));require(_0x4ac1('0x1c'))[_0x4ac1('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x4ac1('0x1e')]({'port':0x232c});var client9002=jayson[_0x4ac1('0x1f')][_0x4ac1('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x44da8f,_0x1d3498,_0x183097,_0x26d8d1){return new BPromise(function(_0x1dab6d,_0xd1c1e4){var _0x3b368b=_0x26d8d1||client;return _0x3b368b['request'](_0x44da8f,_0x183097)[_0x4ac1('0x20')](function(_0x5765b8){logger[_0x4ac1('0x21')]('FaxAccount,\x20%s,\x20%s',_0x1d3498,_0x4ac1('0x22'));logger[_0x4ac1('0x23')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x1d3498,_0x4ac1('0x22'),JSON[_0x4ac1('0x24')](_0x5765b8));if(_0x5765b8['error']){if(_0x5765b8[_0x4ac1('0x25')][_0x4ac1('0x26')]===0x1f4){logger['error'](_0x4ac1('0x27'),_0x1d3498,_0x5765b8[_0x4ac1('0x25')][_0x4ac1('0x28')]);return _0xd1c1e4(_0x5765b8[_0x4ac1('0x25')][_0x4ac1('0x28')]);}logger[_0x4ac1('0x25')]('FaxAccount,\x20%s,\x20%s',_0x1d3498,_0x5765b8[_0x4ac1('0x25')][_0x4ac1('0x28')]);return _0x1dab6d(_0x5765b8[_0x4ac1('0x25')][_0x4ac1('0x28')]);}else{logger[_0x4ac1('0x21')](_0x4ac1('0x27'),_0x1d3498,_0x4ac1('0x22'));_0x1dab6d(_0x5765b8[_0x4ac1('0x29')][_0x4ac1('0x28')]);}})[_0x4ac1('0x2a')](function(_0x244cfd){logger[_0x4ac1('0x25')](_0x4ac1('0x27'),_0x1d3498,_0x244cfd);_0xd1c1e4(_0x244cfd);});});}function respondWithStatusCode(_0x5a1106,_0x48d9db){_0x48d9db=_0x48d9db||0xcc;return function(_0x41ddab){if(_0x41ddab){return _0x5a1106['sendStatus'](_0x48d9db);}return _0x5a1106[_0x4ac1('0x2b')](_0x48d9db)['end']();};}function respondWithResult(_0x444745,_0x4807d7){_0x4807d7=_0x4807d7||0xc8;return function(_0x46b1cd){if(_0x46b1cd){return _0x444745['status'](_0x4807d7)[_0x4ac1('0x2c')](_0x46b1cd);}};}function respondWithFilteredResult(_0x5ca093,_0x236a19){return function(_0x53c2ec){if(_0x53c2ec){var _0x7ba5e2=typeof _0x236a19[_0x4ac1('0x2d')]===_0x4ac1('0x2e')&&typeof _0x236a19[_0x4ac1('0x2f')]===_0x4ac1('0x2e');var _0x13d22f=_0x53c2ec['count'];var _0x55a6f2=_0x7ba5e2?0x0:_0x236a19[_0x4ac1('0x2d')];var _0x4104a5=_0x7ba5e2?_0x53c2ec[_0x4ac1('0x30')]:_0x236a19[_0x4ac1('0x2d')]+_0x236a19[_0x4ac1('0x2f')];var _0x579898;if(_0x4104a5>=_0x13d22f){_0x4104a5=_0x13d22f;_0x579898=0xc8;}else{_0x579898=0xce;}_0x5ca093[_0x4ac1('0x2b')](_0x579898);return _0x5ca093[_0x4ac1('0x31')](_0x4ac1('0x32'),_0x55a6f2+'-'+_0x4104a5+'/'+_0x13d22f)[_0x4ac1('0x2c')](_0x53c2ec);}return null;};}function patchUpdates(_0x4f8761){return function(_0x29ab4d){try{jsonpatch[_0x4ac1('0x33')](_0x29ab4d,_0x4f8761,!![]);}catch(_0x1cc274){return BPromise['reject'](_0x1cc274);}return _0x29ab4d['save']();};}function saveUpdates(_0x459d40,_0x353bbf){return function(_0x1398f1){if(_0x1398f1){return _0x1398f1[_0x4ac1('0x34')](_0x459d40)[_0x4ac1('0x20')](function(_0x284769){return _0x284769;});}return null;};}function removeEntity(_0x3ce071,_0x60fbd3){return function(_0x1bcb2d){if(_0x1bcb2d){return _0x1bcb2d[_0x4ac1('0x35')]()[_0x4ac1('0x20')](function(){var _0x49bc50=_0x1bcb2d[_0x4ac1('0x36')]({'plain':!![]});var _0x5505ec='FaxAccounts';return db[_0x4ac1('0x37')]['destroy']({'where':{'type':_0x5505ec,'resourceId':_0x49bc50['id']}})[_0x4ac1('0x20')](function(){return _0x1bcb2d;});})[_0x4ac1('0x20')](function(){_0x3ce071[_0x4ac1('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x74e7,_0x35ea53){return function(_0x26c856){if(!_0x26c856){_0x74e7['sendStatus'](0x194);}return _0x26c856;};}function handleError(_0x33d3e9,_0x61ad39){_0x61ad39=_0x61ad39||0x1f4;return function(_0x3bb869){logger['error'](_0x3bb869[_0x4ac1('0x38')]);if(_0x3bb869[_0x4ac1('0x39')]){delete _0x3bb869[_0x4ac1('0x39')];}_0x33d3e9[_0x4ac1('0x2b')](_0x61ad39)[_0x4ac1('0x3a')](_0x3bb869);};}exports['index']=function(_0x8326a8,_0x1362e2){var _0x276bf4={'include':[{'model':db[_0x4ac1('0x3b')],'as':_0x4ac1('0x3c')}]},_0x58f08c={},_0x4dc0a8={'count':0x0,'rows':[]};var _0x42816d=_[_0x4ac1('0x3d')](db['FaxAccount'][_0x4ac1('0x3e')],function(_0x3f32a0){return{'name':_0x3f32a0[_0x4ac1('0x3f')],'type':_0x3f32a0[_0x4ac1('0x40')][_0x4ac1('0x41')]};});_0x58f08c[_0x4ac1('0x42')]=_[_0x4ac1('0x3d')](_0x42816d,_0x4ac1('0x39'));_0x58f08c['query']=_[_0x4ac1('0x43')](_0x8326a8[_0x4ac1('0x44')]);_0x58f08c[_0x4ac1('0x45')]=_['intersection'](_0x58f08c[_0x4ac1('0x42')],_0x58f08c['query']);_0x276bf4[_0x4ac1('0x46')]=_['intersection'](_0x58f08c['model'],qs['fields'](_0x8326a8[_0x4ac1('0x44')][_0x4ac1('0x47')]));_0x276bf4[_0x4ac1('0x46')]=_0x276bf4[_0x4ac1('0x46')][_0x4ac1('0x48')]?_0x276bf4[_0x4ac1('0x46')]:_0x58f08c[_0x4ac1('0x42')];if(!_0x8326a8[_0x4ac1('0x44')][_0x4ac1('0x49')](_0x4ac1('0x4a'))){_0x276bf4['limit']=qs['limit'](_0x8326a8['query']['limit']);_0x276bf4[_0x4ac1('0x2d')]=qs[_0x4ac1('0x2d')](_0x8326a8[_0x4ac1('0x44')][_0x4ac1('0x2d')]);}_0x276bf4[_0x4ac1('0x4b')]=qs[_0x4ac1('0x4c')](_0x8326a8[_0x4ac1('0x44')][_0x4ac1('0x4c')]);_0x276bf4[_0x4ac1('0x4d')]=qs[_0x4ac1('0x45')](_[_0x4ac1('0x4e')](_0x8326a8[_0x4ac1('0x44')],_0x58f08c[_0x4ac1('0x45')]),_0x42816d);if(_0x8326a8[_0x4ac1('0x44')][_0x4ac1('0x4f')]){_0x276bf4[_0x4ac1('0x4d')]=_[_0x4ac1('0x50')](_0x276bf4[_0x4ac1('0x4d')],{'$or':_[_0x4ac1('0x3d')](_0x42816d,function(_0x4124d6){if(_0x4124d6[_0x4ac1('0x40')]!==_0x4ac1('0x51')){var _0x38f858={};_0x38f858[_0x4124d6[_0x4ac1('0x39')]]={'$like':'%'+_0x8326a8[_0x4ac1('0x44')][_0x4ac1('0x4f')]+'%'};return _0x38f858;}})});}_0x276bf4=_[_0x4ac1('0x50')]({},_0x276bf4,_0x8326a8[_0x4ac1('0x52')]);var _0xd3efb8={'where':_0x276bf4['where']};return db[_0x4ac1('0x53')][_0x4ac1('0x30')](_0xd3efb8)[_0x4ac1('0x20')](function(_0x209959){_0x4dc0a8[_0x4ac1('0x30')]=_0x209959;if(_0x8326a8[_0x4ac1('0x44')][_0x4ac1('0x54')]){_0x276bf4[_0x4ac1('0x55')]=[{'all':!![]}];}return db['FaxAccount'][_0x4ac1('0x56')](_0x276bf4);})[_0x4ac1('0x20')](function(_0x5d6b59){_0x4dc0a8['rows']=_0x5d6b59;return _0x4dc0a8;})['then'](respondWithFilteredResult(_0x1362e2,_0x276bf4))['catch'](handleError(_0x1362e2,null));};exports[_0x4ac1('0x57')]=function(_0x1daa1f,_0x8c59a4){var _0x5cd4da={'raw':![],'where':{'id':_0x1daa1f['params']['id']},'include':[{'model':db[_0x4ac1('0x3b')],'as':_0x4ac1('0x3c')}]},_0x25ea1f={};_0x25ea1f[_0x4ac1('0x42')]=_[_0x4ac1('0x43')](db[_0x4ac1('0x53')]['rawAttributes']);_0x25ea1f[_0x4ac1('0x44')]=_[_0x4ac1('0x43')](_0x1daa1f[_0x4ac1('0x44')]);_0x25ea1f[_0x4ac1('0x45')]=_[_0x4ac1('0x58')](_0x25ea1f[_0x4ac1('0x42')],_0x25ea1f['query']);_0x5cd4da['attributes']=_[_0x4ac1('0x58')](_0x25ea1f[_0x4ac1('0x42')],qs[_0x4ac1('0x47')](_0x1daa1f[_0x4ac1('0x44')][_0x4ac1('0x47')]));_0x5cd4da['attributes']=_0x5cd4da[_0x4ac1('0x46')][_0x4ac1('0x48')]?_0x5cd4da[_0x4ac1('0x46')]:_0x25ea1f[_0x4ac1('0x42')];if(_0x1daa1f[_0x4ac1('0x44')][_0x4ac1('0x54')]){_0x5cd4da[_0x4ac1('0x55')]=[{'all':!![]}];}_0x5cd4da=_[_0x4ac1('0x50')]({},_0x5cd4da,_0x1daa1f['options']);return db[_0x4ac1('0x53')][_0x4ac1('0x59')](_0x5cd4da)['then'](handleEntityNotFound(_0x8c59a4,null))[_0x4ac1('0x20')](respondWithResult(_0x8c59a4,null))[_0x4ac1('0x2a')](handleError(_0x8c59a4,null));};exports[_0x4ac1('0x5a')]=function(_0x27afc7,_0x300c91){return db[_0x4ac1('0x53')][_0x4ac1('0x5a')](_0x27afc7[_0x4ac1('0x5b')],{})[_0x4ac1('0x20')](function(_0x5529c7){var _0x1caadb=_0x27afc7[_0x4ac1('0x5c')]['get']({'plain':!![]});if(!_0x1caadb)throw new Error(_0x4ac1('0x5d'));if(_0x1caadb[_0x4ac1('0x5e')]===_0x4ac1('0x5c')){var _0x2b9f28=_0x5529c7[_0x4ac1('0x36')]({'plain':!![]});var _0x1b1c70='FaxAccounts';return db[_0x4ac1('0x5f')][_0x4ac1('0x59')]({'where':{'name':_0x1b1c70,'userProfileId':_0x1caadb[_0x4ac1('0x60')]},'raw':!![]})[_0x4ac1('0x20')](function(_0x2d1b31){if(_0x2d1b31&&_0x2d1b31[_0x4ac1('0x61')]===0x0){return db[_0x4ac1('0x37')][_0x4ac1('0x5a')]({'name':_0x2b9f28[_0x4ac1('0x39')],'resourceId':_0x2b9f28['id'],'type':_0x2d1b31[_0x4ac1('0x39')],'sectionId':_0x2d1b31['id']},{})[_0x4ac1('0x20')](function(){return _0x5529c7;});}else{return _0x5529c7;}})[_0x4ac1('0x2a')](function(_0x2d4e0e){logger['error'](_0x4ac1('0x62'),_0x2d4e0e);throw _0x2d4e0e;});}return _0x5529c7;})[_0x4ac1('0x20')](respondWithResult(_0x300c91,0xc9))[_0x4ac1('0x2a')](handleError(_0x300c91,null));};exports[_0x4ac1('0x34')]=function(_0x288be0,_0x43ffe6){if(_0x288be0[_0x4ac1('0x5b')]['id']){delete _0x288be0[_0x4ac1('0x5b')]['id'];}return db[_0x4ac1('0x53')][_0x4ac1('0x59')]({'where':{'id':_0x288be0[_0x4ac1('0x63')]['id']},'include':[{'model':db[_0x4ac1('0x3b')],'as':_0x4ac1('0x3c')}]})[_0x4ac1('0x20')](handleEntityNotFound(_0x43ffe6,null))[_0x4ac1('0x20')](saveUpdates(_0x288be0[_0x4ac1('0x5b')],null))[_0x4ac1('0x20')](respondWithResult(_0x43ffe6,null))[_0x4ac1('0x2a')](handleError(_0x43ffe6,null));};exports[_0x4ac1('0x35')]=function(_0x1a9c6c,_0x5437e3){return db[_0x4ac1('0x53')][_0x4ac1('0x59')]({'where':{'id':_0x1a9c6c['params']['id']}})[_0x4ac1('0x20')](handleEntityNotFound(_0x5437e3,null))[_0x4ac1('0x20')](removeEntity(_0x5437e3,null))[_0x4ac1('0x2a')](handleError(_0x5437e3,null));};exports[_0x4ac1('0x64')]=function(_0x4f73fe,_0xeac487){return db['FaxAccount'][_0x4ac1('0x64')]()['then'](respondWithResult(_0xeac487,null))[_0x4ac1('0x2a')](handleError(_0xeac487,null));};exports[_0x4ac1('0x65')]=function(_0x47880f,_0x4ad9cd,_0x2f7b56){if(_0x47880f[_0x4ac1('0x5b')]['id']){delete _0x47880f[_0x4ac1('0x5b')]['id'];}return db[_0x4ac1('0x53')][_0x4ac1('0x59')]({'where':{'id':_0x47880f[_0x4ac1('0x63')]['id']}})[_0x4ac1('0x20')](handleEntityNotFound(_0x4ad9cd,null))[_0x4ac1('0x20')](function(_0x4c1154){if(_0x4c1154){_0x47880f[_0x4ac1('0x5b')][_0x4ac1('0x66')]=_0x4c1154['id'];return db[_0x4ac1('0x67')]['create'](_0x47880f[_0x4ac1('0x5b')]);}})['then'](respondWithResult(_0x4ad9cd,null))[_0x4ac1('0x2a')](handleError(_0x4ad9cd,null));};exports['getDispositions']=function(_0x4fedf1,_0x1305f9,_0x2802ab){var _0x485ae6={'raw':![],'where':{}};var _0x56b0a4={};var _0x2bd418={'count':0x0,'rows':[]};return db[_0x4ac1('0x53')][_0x4ac1('0x68')]({'where':{'id':_0x4fedf1[_0x4ac1('0x63')]['id']}})[_0x4ac1('0x20')](handleEntityNotFound(_0x1305f9,null))[_0x4ac1('0x20')](function(_0x111b7c){if(_0x111b7c){_0x56b0a4['model']=_['keys'](db['Disposition'][_0x4ac1('0x3e')]);_0x56b0a4[_0x4ac1('0x44')]=_['keys'](_0x4fedf1[_0x4ac1('0x44')]);_0x56b0a4['filters']=_[_0x4ac1('0x58')](_0x56b0a4[_0x4ac1('0x42')],_0x56b0a4[_0x4ac1('0x44')]);_0x485ae6['attributes']=_[_0x4ac1('0x58')](_0x56b0a4['model'],qs[_0x4ac1('0x47')](_0x4fedf1[_0x4ac1('0x44')][_0x4ac1('0x47')]));_0x485ae6['attributes']=_0x485ae6[_0x4ac1('0x46')][_0x4ac1('0x48')]?_0x485ae6['attributes']:_0x56b0a4['model'];if(!_0x4fedf1[_0x4ac1('0x44')][_0x4ac1('0x49')](_0x4ac1('0x4a'))){_0x485ae6[_0x4ac1('0x2f')]=qs[_0x4ac1('0x2f')](_0x4fedf1[_0x4ac1('0x44')][_0x4ac1('0x2f')]);_0x485ae6[_0x4ac1('0x2d')]=qs['offset'](_0x4fedf1['query']['offset']);}_0x485ae6[_0x4ac1('0x4b')]=qs[_0x4ac1('0x4c')](_0x4fedf1[_0x4ac1('0x44')][_0x4ac1('0x4c')]);_0x485ae6[_0x4ac1('0x4d')]=qs[_0x4ac1('0x45')](_[_0x4ac1('0x4e')](_0x4fedf1[_0x4ac1('0x44')],_0x56b0a4[_0x4ac1('0x45')]));_0x485ae6[_0x4ac1('0x4d')][_0x4ac1('0x66')]=_0x111b7c['id'];if(_0x4fedf1['query'][_0x4ac1('0x4f')]){_0x485ae6[_0x4ac1('0x4d')]=_[_0x4ac1('0x50')](_0x485ae6[_0x4ac1('0x4d')],{'$or':_['map'](_0x485ae6[_0x4ac1('0x46')],function(_0x538a57){var _0x4e3c36={};_0x4e3c36[_0x538a57]={'$like':'%'+_0x4fedf1['query'][_0x4ac1('0x4f')]+'%'};return _0x4e3c36;})});}_0x485ae6=_[_0x4ac1('0x50')]({},_0x485ae6,_0x4fedf1[_0x4ac1('0x52')]);return db[_0x4ac1('0x67')][_0x4ac1('0x30')]({'where':_0x485ae6['where']})[_0x4ac1('0x20')](function(_0x345018){_0x2bd418[_0x4ac1('0x30')]=_0x345018;if(_0x4fedf1[_0x4ac1('0x44')]['includeAll']){_0x485ae6[_0x4ac1('0x55')]=[{'all':!![]}];}return db[_0x4ac1('0x67')][_0x4ac1('0x56')](_0x485ae6);})[_0x4ac1('0x20')](function(_0x6f4f41){_0x2bd418[_0x4ac1('0x69')]=_0x6f4f41;return _0x2bd418;});}})[_0x4ac1('0x20')](respondWithFilteredResult(_0x1305f9,_0x485ae6))[_0x4ac1('0x2a')](handleError(_0x1305f9,null));};exports['removeDispositions']=function(_0xa049ca,_0x8c9c24,_0x51f56a){return db[_0x4ac1('0x53')][_0x4ac1('0x59')]({'where':{'id':_0xa049ca[_0x4ac1('0x63')]['id']}})[_0x4ac1('0x20')](handleEntityNotFound(_0x8c9c24,null))[_0x4ac1('0x20')](function(_0x31dd57){if(_0x31dd57){return _0x31dd57['removeDispositions'](_0xa049ca[_0x4ac1('0x44')][_0x4ac1('0x6a')]);}})['then'](respondWithStatusCode(_0x8c9c24,null))['catch'](handleError(_0x8c9c24,null));};exports[_0x4ac1('0x6b')]=function(_0x5379d3,_0x6c1a4f,_0x89c342){if(_0x5379d3['body']['id']){delete _0x5379d3[_0x4ac1('0x5b')]['id'];}return db['FaxAccount'][_0x4ac1('0x59')]({'where':{'id':_0x5379d3[_0x4ac1('0x63')]['id']}})[_0x4ac1('0x20')](handleEntityNotFound(_0x6c1a4f,null))[_0x4ac1('0x20')](function(_0x197c44){if(_0x197c44){_0x5379d3[_0x4ac1('0x5b')][_0x4ac1('0x66')]=_0x197c44['id'];return db[_0x4ac1('0x6c')][_0x4ac1('0x5a')](_0x5379d3['body']);}})[_0x4ac1('0x20')](respondWithResult(_0x6c1a4f,null))['catch'](handleError(_0x6c1a4f,null));};exports[_0x4ac1('0x6d')]=function(_0x4ceb88,_0x9331ae,_0x2c200a){var _0x3de1df={'raw':![],'where':{}};var _0x1892e6={};var _0xe202ed={'count':0x0,'rows':[]};return db[_0x4ac1('0x53')][_0x4ac1('0x68')]({'where':{'id':_0x4ceb88['params']['id']}})[_0x4ac1('0x20')](handleEntityNotFound(_0x9331ae,null))[_0x4ac1('0x20')](function(_0x28476c){if(_0x28476c){_0x1892e6['model']=_[_0x4ac1('0x43')](db[_0x4ac1('0x6c')]['rawAttributes']);_0x1892e6[_0x4ac1('0x44')]=_[_0x4ac1('0x43')](_0x4ceb88['query']);_0x1892e6[_0x4ac1('0x45')]=_[_0x4ac1('0x58')](_0x1892e6[_0x4ac1('0x42')],_0x1892e6['query']);_0x3de1df[_0x4ac1('0x46')]=_['intersection'](_0x1892e6[_0x4ac1('0x42')],qs['fields'](_0x4ceb88['query'][_0x4ac1('0x47')]));_0x3de1df[_0x4ac1('0x46')]=_0x3de1df[_0x4ac1('0x46')]['length']?_0x3de1df[_0x4ac1('0x46')]:_0x1892e6[_0x4ac1('0x42')];if(!_0x4ceb88['query']['hasOwnProperty'](_0x4ac1('0x4a'))){_0x3de1df['limit']=qs[_0x4ac1('0x2f')](_0x4ceb88[_0x4ac1('0x44')][_0x4ac1('0x2f')]);_0x3de1df[_0x4ac1('0x2d')]=qs['offset'](_0x4ceb88[_0x4ac1('0x44')]['offset']);}_0x3de1df[_0x4ac1('0x4b')]=qs['sort'](_0x4ceb88[_0x4ac1('0x44')][_0x4ac1('0x4c')]);_0x3de1df[_0x4ac1('0x4d')]=qs['filters'](_['pick'](_0x4ceb88[_0x4ac1('0x44')],_0x1892e6[_0x4ac1('0x45')]));_0x3de1df[_0x4ac1('0x4d')][_0x4ac1('0x66')]=_0x28476c['id'];if(_0x4ceb88[_0x4ac1('0x44')][_0x4ac1('0x4f')]){_0x3de1df[_0x4ac1('0x4d')]=_[_0x4ac1('0x50')](_0x3de1df[_0x4ac1('0x4d')],{'$or':_[_0x4ac1('0x3d')](_0x3de1df[_0x4ac1('0x46')],function(_0x9e1a0c){var _0x118a51={};_0x118a51[_0x9e1a0c]={'$like':'%'+_0x4ceb88[_0x4ac1('0x44')][_0x4ac1('0x4f')]+'%'};return _0x118a51;})});}_0x3de1df=_[_0x4ac1('0x50')]({},_0x3de1df,_0x4ceb88['options']);return db[_0x4ac1('0x6c')][_0x4ac1('0x30')]({'where':_0x3de1df[_0x4ac1('0x4d')]})['then'](function(_0x27bcbc){_0xe202ed[_0x4ac1('0x30')]=_0x27bcbc;if(_0x4ceb88['query']['includeAll']){_0x3de1df['include']=[{'all':!![]}];}return db[_0x4ac1('0x6c')]['findAll'](_0x3de1df);})['then'](function(_0x1d703f){_0xe202ed[_0x4ac1('0x69')]=_0x1d703f;return _0xe202ed;});}})[_0x4ac1('0x20')](respondWithFilteredResult(_0x9331ae,_0x3de1df))['catch'](handleError(_0x9331ae,null));};exports['removeAnswers']=function(_0x29a366,_0xb3178a,_0x544d4d){return db['FaxAccount']['find']({'where':{'id':_0x29a366[_0x4ac1('0x63')]['id']}})[_0x4ac1('0x20')](handleEntityNotFound(_0xb3178a,null))[_0x4ac1('0x20')](function(_0x3c0e2b){if(_0x3c0e2b){return _0x3c0e2b[_0x4ac1('0x6e')](_0x29a366[_0x4ac1('0x44')][_0x4ac1('0x6a')]);}})[_0x4ac1('0x20')](respondWithStatusCode(_0xb3178a,null))[_0x4ac1('0x2a')](handleError(_0xb3178a,null));};exports[_0x4ac1('0x6f')]=function(_0x563510,_0x29a701,_0x5140bc){return db['FaxInteraction'][_0x4ac1('0x59')]({'where':{'id':_0x563510[_0x4ac1('0x63')]['id']}})[_0x4ac1('0x20')](handleEntityNotFound(_0x29a701,null))[_0x4ac1('0x20')](function(_0x321866){if(_0x321866){return _0x321866[_0x4ac1('0x6f')](_0x563510[_0x4ac1('0x5b')][_0x4ac1('0x6a')],_[_0x4ac1('0x70')](_0x563510['body'],[_0x4ac1('0x6a'),'id'])||{});}})[_0x4ac1('0x20')](respondWithResult(_0x29a701,null))['catch'](handleError(_0x29a701,null));};exports[_0x4ac1('0x71')]=function(_0x468db3,_0x19e449,_0x9ed551){var _0x4b4249={'raw':![],'where':{}};var _0x3e9f51={};var _0x18b91e={'count':0x0,'rows':[]};return db[_0x4ac1('0x53')][_0x4ac1('0x68')]({'where':{'id':_0x468db3[_0x4ac1('0x63')]['id']}})['then'](handleEntityNotFound(_0x19e449,null))[_0x4ac1('0x20')](function(_0x367930){if(_0x367930){_0x3e9f51[_0x4ac1('0x42')]=_['keys'](db['FaxInteraction'][_0x4ac1('0x3e')]);_0x3e9f51['query']=_[_0x4ac1('0x43')](_0x468db3[_0x4ac1('0x44')]);_0x3e9f51[_0x4ac1('0x45')]=_[_0x4ac1('0x58')](_0x3e9f51[_0x4ac1('0x42')],_0x3e9f51['query']);_0x4b4249[_0x4ac1('0x46')]=_[_0x4ac1('0x58')](_0x3e9f51[_0x4ac1('0x42')],qs['fields'](_0x468db3['query'][_0x4ac1('0x47')]));_0x4b4249['attributes']=_0x4b4249['attributes'][_0x4ac1('0x48')]?_0x4b4249[_0x4ac1('0x46')]:_0x3e9f51[_0x4ac1('0x42')];if(!_0x468db3[_0x4ac1('0x44')]['hasOwnProperty'](_0x4ac1('0x4a'))){_0x4b4249[_0x4ac1('0x2f')]=qs['limit'](_0x468db3[_0x4ac1('0x44')]['limit']);_0x4b4249[_0x4ac1('0x2d')]=qs[_0x4ac1('0x2d')](_0x468db3[_0x4ac1('0x44')]['offset']);}_0x4b4249[_0x4ac1('0x4b')]=qs[_0x4ac1('0x4c')](_0x468db3[_0x4ac1('0x44')][_0x4ac1('0x4c')]);_0x4b4249[_0x4ac1('0x4d')]=qs['filters'](_['pick'](_0x468db3[_0x4ac1('0x44')],_0x3e9f51[_0x4ac1('0x45')]));_0x4b4249[_0x4ac1('0x4d')][_0x4ac1('0x66')]=_0x367930['id'];if(_0x468db3[_0x4ac1('0x44')]['filter']){_0x4b4249[_0x4ac1('0x4d')]=_[_0x4ac1('0x50')](_0x4b4249[_0x4ac1('0x4d')],{'$or':_['map'](_0x4b4249[_0x4ac1('0x46')],function(_0x4f1c14){var _0x216a7b={};_0x216a7b[_0x4f1c14]={'$like':'%'+_0x468db3[_0x4ac1('0x44')][_0x4ac1('0x4f')]+'%'};return _0x216a7b;})});}_0x4b4249=_['merge']({},_0x4b4249,_0x468db3['options']);return db[_0x4ac1('0x72')][_0x4ac1('0x30')]({'where':_0x4b4249[_0x4ac1('0x4d')]})[_0x4ac1('0x20')](function(_0x289f7c){_0x18b91e[_0x4ac1('0x30')]=_0x289f7c;if(_0x468db3[_0x4ac1('0x44')][_0x4ac1('0x54')]){_0x4b4249['include']=[{'model':db[_0x4ac1('0x73')],'as':'Contact','required':![]},{'model':db[_0x4ac1('0x74')],'as':'Owner','attributes':['name',_0x4ac1('0x75'),_0x4ac1('0x76')],'required':![]},{'model':db[_0x4ac1('0x77')],'as':'Tags','attributes':['id',_0x4ac1('0x39'),_0x4ac1('0x78')],'where':_0x468db3[_0x4ac1('0x44')][_0x4ac1('0x79')]?{'id':_0x468db3[_0x4ac1('0x44')][_0x4ac1('0x79')]}:undefined,'required':_0x468db3[_0x4ac1('0x44')][_0x4ac1('0x79')]?!![]:![]}];}return db[_0x4ac1('0x72')][_0x4ac1('0x56')](_0x4b4249);})[_0x4ac1('0x20')](function(_0x41a662){_0x18b91e[_0x4ac1('0x69')]=_0x41a662;return _0x18b91e;});}})['then'](respondWithFilteredResult(_0x19e449,_0x4b4249))[_0x4ac1('0x2a')](handleError(_0x19e449,null));};exports[_0x4ac1('0x7a')]=function(_0x28a722,_0x450f00){var _0x268069=_0x28a722['params']['id'];var _0x35dad0=_0x28a722[_0x4ac1('0x5b')];var _0x20e407=0xc8;var _0x423768=null;return db[_0x4ac1('0x7b')][_0x4ac1('0x7c')]({'isolationLevel':db[_0x4ac1('0x7b')]['Transaction'][_0x4ac1('0x7d')][_0x4ac1('0x7e')]},function(_0x2c8ddf){return db[_0x4ac1('0x53')][_0x4ac1('0x68')]({'where':{'id':_0x268069},'transaction':_0x2c8ddf})['then'](function(_0x3766f0){if(_0x3766f0){return db[_0x4ac1('0x7f')]['destroy']({'where':{'FaxAccountId':_0x268069},'transaction':_0x2c8ddf})[_0x4ac1('0x20')](function(){var _0x329aa4=_[_0x4ac1('0x3d')](_0x35dad0,function(_0x300ff5){_0x300ff5['FaxAccountId']=_0x268069;return _0x300ff5;});return db[_0x4ac1('0x7f')]['bulkCreate'](_0x329aa4,{'transaction':_0x2c8ddf});});}else{_0x20e407=0x194;_0x423768=[];}});})[_0x4ac1('0x20')](function(){if(_0x20e407!==0x194){return db[_0x4ac1('0x7f')][_0x4ac1('0x80')]({'where':{'FaxAccountId':_0x268069},'order':'priority'})[_0x4ac1('0x20')](function(_0x177638){_0x423768=_0x177638;});}})[_0x4ac1('0x2a')](function(_0x1ae4d1){_0x20e407=0x1f4;logger['error'](_0x1ae4d1[_0x4ac1('0x38')]);if(_0x1ae4d1[_0x4ac1('0x39')]){delete _0x1ae4d1[_0x4ac1('0x39')];}_0x423768=_0x1ae4d1;})[_0x4ac1('0x81')](function(){if(_0x423768===null){_0x450f00[_0x4ac1('0x82')](_0x20e407);}else{if(_0x20e407===0x1f4){_0x450f00[_0x4ac1('0x2b')](_0x20e407)[_0x4ac1('0x3a')](_0x423768);}else{_0x450f00[_0x4ac1('0x2b')](_0x20e407)[_0x4ac1('0x2c')](_0x423768);}}});};exports[_0x4ac1('0x83')]=function(_0x5a78dd,_0x3c936f,_0x1d5e03){var _0x430dd3={};var _0x46048b={};var _0x36194e;var _0x23eb2b;return db['FaxAccount'][_0x4ac1('0x68')]({'where':{'id':_0x5a78dd['params']['id']}})['then'](handleEntityNotFound(_0x3c936f,null))[_0x4ac1('0x20')](function(_0x2ca9dd){if(_0x2ca9dd){_0x36194e=_0x2ca9dd;_0x46048b[_0x4ac1('0x42')]=_[_0x4ac1('0x43')](db[_0x4ac1('0x7f')][_0x4ac1('0x3e')]);_0x46048b[_0x4ac1('0x44')]=_[_0x4ac1('0x43')](_0x5a78dd[_0x4ac1('0x44')]);_0x46048b[_0x4ac1('0x45')]=_[_0x4ac1('0x58')](_0x46048b[_0x4ac1('0x42')],_0x46048b[_0x4ac1('0x44')]);_0x430dd3[_0x4ac1('0x46')]=_[_0x4ac1('0x58')](_0x46048b['model'],qs['fields'](_0x5a78dd['query'][_0x4ac1('0x47')]));_0x430dd3[_0x4ac1('0x46')]=_0x430dd3['attributes']['length']?_0x430dd3[_0x4ac1('0x46')]:_0x46048b['model'];_0x430dd3[_0x4ac1('0x4b')]=qs[_0x4ac1('0x4c')](_0x5a78dd['query'][_0x4ac1('0x4c')]);_0x430dd3[_0x4ac1('0x4d')]=qs[_0x4ac1('0x45')](_[_0x4ac1('0x4e')](_0x5a78dd[_0x4ac1('0x44')],_0x46048b[_0x4ac1('0x45')]));if(_0x5a78dd['query'][_0x4ac1('0x4f')]){_0x430dd3['where']=_[_0x4ac1('0x50')](_0x430dd3[_0x4ac1('0x4d')],{'$or':_[_0x4ac1('0x3d')](_0x430dd3['attributes'],function(_0x3c0104){var _0x185289={};_0x185289[_0x3c0104]={'$like':'%'+_0x5a78dd[_0x4ac1('0x44')]['filter']+'%'};return _0x185289;})});}_0x430dd3=_['merge']({},_0x430dd3,_0x5a78dd[_0x4ac1('0x52')]);return _0x36194e[_0x4ac1('0x83')](_0x430dd3);}})[_0x4ac1('0x20')](function(_0x9bc628){if(_0x9bc628){_0x23eb2b=_0x9bc628[_0x4ac1('0x48')];if(!_0x5a78dd[_0x4ac1('0x44')]['hasOwnProperty'](_0x4ac1('0x4a'))){_0x430dd3[_0x4ac1('0x2f')]=qs[_0x4ac1('0x2f')](_0x5a78dd['query'][_0x4ac1('0x2f')]);_0x430dd3['offset']=qs[_0x4ac1('0x2d')](_0x5a78dd[_0x4ac1('0x44')][_0x4ac1('0x2d')]);}return _0x36194e[_0x4ac1('0x83')](_0x430dd3);}})[_0x4ac1('0x20')](function(_0x5c7ace){if(_0x5c7ace){return _0x5c7ace?{'count':_0x23eb2b,'rows':_0x5c7ace}:null;}})[_0x4ac1('0x20')](respondWithResult(_0x3c936f,null))[_0x4ac1('0x2a')](handleError(_0x3c936f,null));};function Extension(_0x3727e8,_0x29c167,_0x36c542,_0x422be5){this[_0x4ac1('0x84')]='from-voip-provider';this[_0x4ac1('0x85')]=_0x3727e8[_0x4ac1('0x86')];this[_0x4ac1('0x87')]=_0x422be5;this[_0x4ac1('0x40')]=_0x4ac1('0x88');this[_0x4ac1('0x89')]=_0x4ac1('0x8a');this[_0x4ac1('0x66')]=_0x3727e8['id'];this[_0x4ac1('0x8b')]=_0x29c167;this[_0x4ac1('0x8c')]=_0x36c542;}function createExtensionsReciveFax(_0x5a33ae){var _0x370aa9=0x1;var _0x1bc38e=[];_0x1bc38e['push'](new Extension(_0x5a33ae,_0x370aa9,'',_0x4ac1('0x8d')));_0x370aa9+=0x1;_0x1bc38e[_0x4ac1('0x8e')](new Extension(_0x5a33ae,_0x370aa9,_0x4ac1('0x8f'),_0x4ac1('0x90')));_0x370aa9+=0x1;for(var _0x3993ff in _0x5a33ae){if(_0x5a33ae['hasOwnProperty'](_0x3993ff)&&(_0x3993ff===_0x4ac1('0x91')||_0x3993ff==='localstationid'||_0x3993ff===_0x4ac1('0x92')||_0x3993ff===_0x4ac1('0x93')||_0x3993ff==='headerinfo'||_0x3993ff===_0x4ac1('0x94')||_0x3993ff===_0x4ac1('0x95')||_0x3993ff===_0x4ac1('0x96')||_0x3993ff==='t38timeout')){_0x1bc38e[_0x4ac1('0x8e')](new Extension(_0x5a33ae,_0x370aa9,_0x4ac1('0x97')+_0x3993ff+')='+_0x5a33ae[_0x3993ff],'Set'));_0x370aa9+=0x1;}}_0x1bc38e[_0x4ac1('0x8e')](new Extension(_0x5a33ae,_0x370aa9,'6',_0x4ac1('0x98')));_0x370aa9+=0x1;_0x1bc38e['push'](new Extension(_0x5a33ae,_0x370aa9,_0x4ac1('0x99'),_0x4ac1('0x9a')));_0x370aa9=0x0;return _0x1bc38e;}exports[_0x4ac1('0x9b')]=function(_0x2f6714,_0x3d22a5,_0x47278e){var _0x261b45;return db[_0x4ac1('0x7b')][_0x4ac1('0x7c')](function(_0x4c5a4c){return db['FaxAccount'][_0x4ac1('0x5a')](_0x2f6714[_0x4ac1('0x5b')],{'transaction':_0x4c5a4c})[_0x4ac1('0x20')](function(_0x20ac7e){_0x261b45=_0x20ac7e[_0x4ac1('0x36')]({'plain':!![]});return db[_0x4ac1('0x9c')][_0x4ac1('0x9d')](createExtensionsReciveFax(_0x261b45),{'transaction':_0x4c5a4c});});})[_0x4ac1('0x20')](function(){return _0x261b45;})['then'](respondWithResult(_0x3d22a5,null))['catch'](handleError(_0x3d22a5,null));};exports['updateAccountApplications']=function(_0x35cab8,_0x3b645a,_0x4569ba){var _0x4bba31;return db['sequelize']['transaction'](function(_0x1faa65){return db[_0x4ac1('0x53')]['update'](_0x35cab8[_0x4ac1('0x5b')],{'where':{'id':_0x35cab8[_0x4ac1('0x5b')]['id']},'transaction':_0x1faa65})[_0x4ac1('0x20')](function(_0x161644){return db[_0x4ac1('0x9c')][_0x4ac1('0x35')]({'where':{'FaxAccountId':_0x35cab8[_0x4ac1('0x5b')]['id']},'transaction':_0x1faa65})[_0x4ac1('0x20')](function(_0x302381){return db['VoiceExtension'][_0x4ac1('0x9d')](createExtensionsReciveFax(_[_0x4ac1('0x70')](_0x35cab8[_0x4ac1('0x5b')],[_0x4ac1('0x9e'),_0x4ac1('0x41'),_0x4ac1('0x9f'),_0x4ac1('0xa0'),_0x4ac1('0xa1'),'ListId'])),{'transaction':_0x1faa65});});});})[_0x4ac1('0x20')](function(){return db[_0x4ac1('0x53')][_0x4ac1('0xa2')](_0x35cab8[_0x4ac1('0x5b')]['id']);})['then'](respondWithResult(_0x3b645a,null))[_0x4ac1('0x2a')](handleError(_0x3b645a,null));};exports[_0x4ac1('0xa3')]=function(_0x473062,_0x5b023f,_0xed0850){var _0x214494={'raw':!![],'where':{}};var _0x14958a={};var _0xff2f5a={'count':0x0,'rows':[]};return db[_0x4ac1('0x53')]['findOne']({'where':{'id':_0x473062[_0x4ac1('0x63')]['id']}})[_0x4ac1('0x20')](handleEntityNotFound(_0x5b023f,null))[_0x4ac1('0x20')](function(_0x4d698e){if(_0x4d698e){_0x14958a[_0x4ac1('0x42')]=_['keys'](db[_0x4ac1('0xa4')][_0x4ac1('0x3e')]);_0x14958a[_0x4ac1('0x44')]=_[_0x4ac1('0x43')](_0x473062[_0x4ac1('0x44')]);_0x14958a['filters']=_['intersection'](_0x14958a[_0x4ac1('0x42')],_0x14958a[_0x4ac1('0x44')]);_0x214494[_0x4ac1('0x46')]=_[_0x4ac1('0x58')](_0x14958a[_0x4ac1('0x42')],qs[_0x4ac1('0x47')](_0x473062['query'][_0x4ac1('0x47')]));_0x214494[_0x4ac1('0x46')]=_0x214494['attributes'][_0x4ac1('0x48')]?_0x214494[_0x4ac1('0x46')]:_0x14958a[_0x4ac1('0x42')];if(!_0x473062['query']['hasOwnProperty']('nolimit')){_0x214494[_0x4ac1('0x2f')]=qs[_0x4ac1('0x2f')](_0x473062['query'][_0x4ac1('0x2f')]);_0x214494[_0x4ac1('0x2d')]=qs[_0x4ac1('0x2d')](_0x473062[_0x4ac1('0x44')][_0x4ac1('0x2d')]);}_0x214494[_0x4ac1('0x4b')]=qs[_0x4ac1('0x4c')](_0x473062[_0x4ac1('0x44')][_0x4ac1('0x4c')]);_0x214494[_0x4ac1('0x4d')]=qs[_0x4ac1('0x45')](_[_0x4ac1('0x4e')](_0x473062[_0x4ac1('0x44')],_0x14958a[_0x4ac1('0x45')]));_0x214494['where'][_0x4ac1('0x66')]=_0x4d698e['id'];if(_0x473062[_0x4ac1('0x44')][_0x4ac1('0x4f')]){_0x214494['where']=_['merge'](_0x214494[_0x4ac1('0x4d')],{'$or':_[_0x4ac1('0x3d')](_0x214494[_0x4ac1('0x46')],function(_0x4d2d9d){var _0x22950a={};_0x22950a[_0x4d2d9d]={'$like':'%'+_0x473062[_0x4ac1('0x44')][_0x4ac1('0x4f')]+'%'};return _0x22950a;})});}if(_0x473062[_0x4ac1('0x44')][_0x4ac1('0xa5')]){var _0xa35e5d=_0x473062[_0x4ac1('0x44')][_0x4ac1('0xa5')][_0x4ac1('0xa6')](',');var _0x40b577={};_0x40b577[_0xa35e5d[0x0]]={'$gte':moment(_0xa35e5d[0x1])[_0x4ac1('0xa7')](_0x4ac1('0xa8'))};_0x214494[_0x4ac1('0x4d')]=_[_0x4ac1('0x50')](_0x214494[_0x4ac1('0x4d')],_0x40b577);}_0x214494=_[_0x4ac1('0x50')]({},_0x214494,_0x473062[_0x4ac1('0x52')]);return db[_0x4ac1('0xa4')][_0x4ac1('0x30')]({'where':_0x214494[_0x4ac1('0x4d')]})[_0x4ac1('0x20')](function(_0x6fc3f1){_0xff2f5a['count']=_0x6fc3f1;if(_0x473062[_0x4ac1('0x44')]['includeAll']){_0x214494[_0x4ac1('0x55')]=[{'all':!![]}];}return db[_0x4ac1('0xa4')][_0x4ac1('0x56')](_0x214494);})[_0x4ac1('0x20')](function(_0x1d08d1){_0xff2f5a[_0x4ac1('0x69')]=_0x1d08d1;return _0xff2f5a;});}})[_0x4ac1('0x20')](respondWithFilteredResult(_0x5b023f,_0x214494))[_0x4ac1('0x2a')](handleError(_0x5b023f,null));};exports['send']=function(_0x265dac,_0x1aa669,_0x3420a1){var _0x3f73b9,_0x4cf7f8={},_0x184fa7;if(_0x265dac[_0x4ac1('0x5b')]['to']){_0x184fa7=_0x265dac['body']['to'][0x0];}return db[_0x4ac1('0x53')][_0x4ac1('0x59')]({'where':{'id':_0x265dac[_0x4ac1('0x63')]['id']},'include':[{'model':db[_0x4ac1('0xa9')],'as':_0x4ac1('0xaa'),'include':[{'model':db[_0x4ac1('0x73')],'as':_0x4ac1('0xab'),'where':{'fax':_0x184fa7},'limit':0x1,'order':[[_0x4ac1('0xa0'),'DESC']]}]}]})[_0x4ac1('0x20')](handleEntityNotFound(_0x1aa669,null))[_0x4ac1('0x20')](function(_0x56129b){_0x3f73b9=_0x56129b;if(_0x265dac['body'][_0x4ac1('0xac')]&&_0x265dac[_0x4ac1('0x5b')][_0x4ac1('0xac')][_0x4ac1('0x48')]){for(var _0x44e103=0x0;_0x44e103<_0x265dac[_0x4ac1('0x5b')][_0x4ac1('0xac')][_0x4ac1('0x48')];_0x44e103+=0x1){_0x265dac[_0x4ac1('0x5b')][_0x4ac1('0xac')][_0x44e103]={'filename':_0x265dac[_0x4ac1('0x5b')][_0x4ac1('0xac')][_0x44e103][_0x4ac1('0x39')],'id':_0x265dac['body'][_0x4ac1('0xac')][_0x44e103]['id'],'path':path[_0x4ac1('0xad')](config['root'],_0x4ac1('0xae'),_0x265dac[_0x4ac1('0x5b')][_0x4ac1('0xac')][_0x44e103][_0x4ac1('0xaf')])};}}return respondWithRpcPromise(_0x4ac1('0xb0'),_0x4ac1('0xb0'),{'FaxAccountId':_[_0x4ac1('0xb1')](_0x265dac[_0x4ac1('0x63')]['id'])?undefined:_0x265dac[_0x4ac1('0x63')]['id'],'path':_[_0x4ac1('0xb1')](_0x265dac[_0x4ac1('0x5b')][_0x4ac1('0xac')][0x0]['path'])?undefined:_0x265dac[_0x4ac1('0x5b')][_0x4ac1('0xac')][0x0]['path'],'fax':_[_0x4ac1('0xb1')](_0x265dac[_0x4ac1('0x5b')]['to'][0x0])?undefined:_0x265dac[_0x4ac1('0x5b')]['to'][0x0]},client9002);})[_0x4ac1('0x20')](function(){if(_0x3f73b9){if(_[_0x4ac1('0xb1')](_0x265dac['body'][_0x4ac1('0xb2')])){_0x265dac['body']['from']=util['format']('\x22%s\x22\x20<%s>',_0x3f73b9[_0x4ac1('0x39')],_0x3f73b9[_0x4ac1('0xb3')]);}if(_0x3f73b9[_0x4ac1('0xaa')]){if(_0x3f73b9[_0x4ac1('0xaa')]['Contacts'][_0x4ac1('0x48')]){return _0x3f73b9[_0x4ac1('0xaa')]['Contacts'][0x0];}else{return db[_0x4ac1('0x73')][_0x4ac1('0x5a')](_[_0x4ac1('0x19')](_0x265dac['body'],{'firstName':_0x265dac[_0x4ac1('0x5b')]['to'][0x0],'phone':_0x265dac[_0x4ac1('0x5b')]['to'][0x0],'fax':_0x265dac[_0x4ac1('0x5b')]['to'][0x0],'ListId':_0x3f73b9['ListId']}));}}else{throw new Error(_0x4ac1('0xb4'));}}else{throw new Error(_0x4ac1('0xb5'));}})['then'](function(_0x30f699){if(_0x30f699){return db['FaxInteraction']['find']({'where':{'ContactId':_0x30f699['id'],'closed':![],'FaxAccountId':_0x3f73b9['id']}})[_0x4ac1('0x20')](function(_0x3bd4a1){if(_0x3bd4a1){return[_0x3bd4a1,![]];}return db[_0x4ac1('0x72')][_0x4ac1('0x5a')]({'UserId':_0x265dac[_0x4ac1('0x5c')]['id'],'ContactId':_0x30f699['id'],'FaxAccountId':_0x3f73b9['id'],'fax':_0x265dac[_0x4ac1('0x5b')]['to'][0x0],'firstMsgDirection':_0x4ac1('0xb6'),'Messages':[_['merge'](_0x265dac[_0x4ac1('0x5b')],{'read':![],'body':_0x265dac[_0x4ac1('0x5b')]['attachments'][0x0]['filename'],'FaxAccountId':_0x3f73b9['id'],'UserId':_0x265dac[_0x4ac1('0x5c')]['id'],'ContactId':_0x30f699['id'],'AttachmentId':_0x265dac[_0x4ac1('0x5b')]['attachments'][0x0]['id']})]},{'include':[{'model':db['FaxMessage'],'as':'Messages'}]})[_0x4ac1('0x20')](function(_0x3bc45f){return[_0x3bc45f,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x4ac1('0xb7')](function(_0x4126af,_0x193921){if(_0x193921){return _0x4126af;}return db['FaxMessage'][_0x4ac1('0x5a')]({'direction':'out','read':![],'body':_0x265dac[_0x4ac1('0x5b')][_0x4ac1('0xac')][0x0][_0x4ac1('0xb8')],'FaxAccountId':_0x3f73b9['id'],'FaxInteractionId':_0x4126af['id'],'UserId':_0x265dac[_0x4ac1('0x5c')]['id'],'ContactId':_0x4126af[_0x4ac1('0xb9')],'AttachmentId':_0x265dac[_0x4ac1('0x5b')][_0x4ac1('0xac')][0x0]['id']})['then'](function(_0x5db2bb){_0x4126af['dataValues'][_0x4ac1('0xba')]=[];_0x4126af[_0x4ac1('0xbb')][_0x4ac1('0xba')]['push'](_0x5db2bb[_0x4ac1('0xbb')]);return _0x4126af;});})[_0x4ac1('0x20')](function(_0x5660a3){respondWithRpcPromise(_0x4ac1('0xbc'),_0x4ac1('0xbc'),{'FaxAccountId':_[_0x4ac1('0xb1')](_0x265dac[_0x4ac1('0x63')]['id'])?undefined:_0x265dac[_0x4ac1('0x63')]['id'],'path':_[_0x4ac1('0xb1')](_0x265dac['body'][_0x4ac1('0xac')][0x0][_0x4ac1('0xbd')])?undefined:_0x265dac[_0x4ac1('0x5b')]['attachments'][0x0][_0x4ac1('0xbd')],'fax':_['isNil'](_0x265dac[_0x4ac1('0x5b')]['to'][0x0])?undefined:_0x265dac[_0x4ac1('0x5b')]['to'][0x0],'AttachmentId':_0x265dac[_0x4ac1('0x5b')][_0x4ac1('0xac')][0x0]['id']},client9002)[_0x4ac1('0x20')](function(_0x4722fc){logger[_0x4ac1('0x21')](_0x4ac1('0xbe'),_0x4722fc);})[_0x4ac1('0x2a')](function(_0x5ce514){logger[_0x4ac1('0x21')](_0x4ac1('0xbe'),_0x5ce514);});return _0x5660a3;})['then'](respondWithResult(_0x1aa669,null))[_0x4ac1('0x2a')](handleError(_0x1aa669,null));};exports[_0x4ac1('0xbf')]=function(_0x1184db,_0x4cbca6,_0x2d98cf){return db[_0x4ac1('0x53')][_0x4ac1('0x59')]({'where':{'id':_0x1184db[_0x4ac1('0x63')]['id']}})['then'](handleEntityNotFound(_0x4cbca6,null))[_0x4ac1('0x20')](function(_0x342c2b){if(_0x342c2b){return _0x342c2b[_0x4ac1('0xbf')](_0x1184db['body'][_0x4ac1('0x6a')],_['omit'](_0x1184db[_0x4ac1('0x5b')],[_0x4ac1('0x6a'),'id'])||{})[_0x4ac1('0xb7')](function(_0x212c3d){for(var _0x2b6d89=0x0;_0x2b6d89<_0x1184db[_0x4ac1('0x5b')]['ids'][_0x4ac1('0x48')];_0x2b6d89+=0x1){socket[_0x4ac1('0xc0')]('userFaxAccount:save',{'UserId':Number(_0x1184db[_0x4ac1('0x5b')][_0x4ac1('0x6a')][_0x2b6d89]),'FaxAccountId':Number(_0x1184db[_0x4ac1('0x63')]['id'])});}return _0x212c3d;});}})[_0x4ac1('0x20')](respondWithResult(_0x4cbca6,null))['catch'](handleError(_0x4cbca6,null));};exports[_0x4ac1('0xc1')]=function(_0x437951,_0x43e05d,_0x384ad5){return db[_0x4ac1('0x53')][_0x4ac1('0x59')]({'where':{'id':_0x437951[_0x4ac1('0x63')]['id']}})['then'](handleEntityNotFound(_0x43e05d,null))[_0x4ac1('0x20')](function(_0x2e8d7f){if(_0x2e8d7f){return _0x2e8d7f[_0x4ac1('0xc1')](_0x437951[_0x4ac1('0x44')][_0x4ac1('0x6a')])[_0x4ac1('0x20')](function(){if(_[_0x4ac1('0xc2')](_0x437951[_0x4ac1('0x44')]['ids'])){for(var _0x1e6b48=0x0;_0x1e6b48<_0x437951[_0x4ac1('0x44')]['ids'][_0x4ac1('0x48')];_0x1e6b48+=0x1){socket['emit']('userFaxAccount:remove',{'UserId':Number(_0x437951[_0x4ac1('0x44')][_0x4ac1('0x6a')][_0x1e6b48]),'FaxAccountId':Number(_0x437951['params']['id'])});}}else{socket[_0x4ac1('0xc0')](_0x4ac1('0xc3'),{'UserId':Number(_0x437951[_0x4ac1('0x44')][_0x4ac1('0x6a')]),'FaxAccountId':Number(_0x437951['params']['id'])});}});}})[_0x4ac1('0x20')](respondWithStatusCode(_0x43e05d,null))[_0x4ac1('0x2a')](handleError(_0x43e05d,null));};exports['getAgents']=function(_0x2b677d,_0x494a79,_0x2e1a40){var _0x3f4ad6={};var _0x548f4e={};var _0x3f2394;var _0x43db8d;return db[_0x4ac1('0x53')]['findOne']({'where':{'id':_0x2b677d[_0x4ac1('0x63')]['id']}})[_0x4ac1('0x20')](handleEntityNotFound(_0x494a79,null))[_0x4ac1('0x20')](function(_0x16fdbe){if(_0x16fdbe){_0x3f2394=_0x16fdbe;_0x548f4e[_0x4ac1('0x42')]=_['keys'](db[_0x4ac1('0x74')][_0x4ac1('0x3e')]);_0x548f4e[_0x4ac1('0x44')]=_['keys'](_0x2b677d['query']);_0x548f4e['filters']=_[_0x4ac1('0x58')](_0x548f4e[_0x4ac1('0x42')],_0x548f4e[_0x4ac1('0x44')]);_0x3f4ad6[_0x4ac1('0x46')]=_[_0x4ac1('0x58')](_0x548f4e['model'],qs[_0x4ac1('0x47')](_0x2b677d[_0x4ac1('0x44')][_0x4ac1('0x47')]));_0x3f4ad6['attributes']=_0x3f4ad6[_0x4ac1('0x46')][_0x4ac1('0x48')]?_0x3f4ad6['attributes']:_0x548f4e['model'];_0x3f4ad6[_0x4ac1('0x4b')]=qs[_0x4ac1('0x4c')](_0x2b677d[_0x4ac1('0x44')]['sort']);_0x3f4ad6['where']=qs[_0x4ac1('0x45')](_[_0x4ac1('0x4e')](_0x2b677d[_0x4ac1('0x44')],_0x548f4e[_0x4ac1('0x45')]));if(_0x2b677d[_0x4ac1('0x44')][_0x4ac1('0x4f')]){_0x3f4ad6[_0x4ac1('0x4d')]=_[_0x4ac1('0x50')](_0x3f4ad6[_0x4ac1('0x4d')],{'$or':_[_0x4ac1('0x3d')](_0x3f4ad6[_0x4ac1('0x46')],function(_0x340c17){var _0x23e2ad={};_0x23e2ad[_0x340c17]={'$like':'%'+_0x2b677d[_0x4ac1('0x44')][_0x4ac1('0x4f')]+'%'};return _0x23e2ad;})});}_0x3f4ad6=_['merge']({},_0x3f4ad6,_0x2b677d[_0x4ac1('0x52')]);return _0x3f2394[_0x4ac1('0xc4')](_0x3f4ad6);}})['then'](function(_0x2ee9e8){if(_0x2ee9e8){_0x43db8d=_0x2ee9e8[_0x4ac1('0x48')];if(!_0x2b677d[_0x4ac1('0x44')][_0x4ac1('0x49')](_0x4ac1('0x4a'))){_0x3f4ad6['limit']=qs['limit'](_0x2b677d[_0x4ac1('0x44')][_0x4ac1('0x2f')]);_0x3f4ad6[_0x4ac1('0x2d')]=qs[_0x4ac1('0x2d')](_0x2b677d[_0x4ac1('0x44')]['offset']);}return _0x3f2394[_0x4ac1('0xc4')](_0x3f4ad6);}})[_0x4ac1('0x20')](function(_0xc5843f){if(_0xc5843f){return _0xc5843f?{'count':_0x43db8d,'rows':_0xc5843f}:null;}})[_0x4ac1('0x20')](respondWithResult(_0x494a79,null))[_0x4ac1('0x2a')](handleError(_0x494a79,null));}; \ No newline at end of file +var _0x219c=['Messages','dataValues','SendFax','SendFaxRpc,\x20%s','spread','userFaxAccount:save','removeAgents','isArray','emit','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','jayson/promise','client','request','then','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','sendStatus','status','end','json','offset','limit','set','apply','save','update','destroy','get','UserProfileResource','name','send','index','mandatoryDispositionPause','map','FaxAccount','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','count','includeAll','rows','show','params','Pause','include','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','FaxAccounts','UserProfileSection','find','userProfileId','autoAssociation','body','describe','addDisposition','FaxAccountId','getDispositions','findOne','Disposition','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','FaxInteraction','addInteraction','omit','ids','getInteractions','User','fullname','internal','Tag','Tags','color','tag','findAll','addApplications','sequelize','Transaction','ISOLATION_LEVELS','FaxApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','context','from-voip-provider','exten','localstationid','app','description','Fax\x20Extension','push','Answer','CDR(type)=inbound-fax','Set','ecm','gateway','faxdetect','headerinfo','maxrate','minrate','modem','t38timeout','FAXOPT(','Wait','ReceiveFax','addAccountApplications','VoiceExtension','tech','createdAt','updatedAt','TrunkId','findById','getMessages','$gte','split','YYYY-MM-DD\x20HH:mm:ss','FaxMessage','CmList','List','CmContact','Contacts','DESC','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','from','format','\x22%s\x22\x20<%s>','fax','ListId','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Contact\x20not\x20found','ContactId'];(function(_0x2559d0,_0x18ca47){var _0x4d1f87=function(_0x22ef0e){while(--_0x22ef0e){_0x2559d0['push'](_0x2559d0['shift']());}};_0x4d1f87(++_0x18ca47);}(_0x219c,0x19c));var _0xc219=function(_0x139ae4,_0x49e764){_0x139ae4=_0x139ae4-0x0;var _0x4a9d3b=_0x219c[_0x139ae4];return _0x4a9d3b;};'use strict';var emlformat=require(_0xc219('0x0'));var rimraf=require(_0xc219('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc219('0x2'));var rp=require(_0xc219('0x3'));var moment=require(_0xc219('0x4'));var BPromise=require(_0xc219('0x5'));var Mustache=require('mustache');var util=require(_0xc219('0x6'));var path=require(_0xc219('0x7'));var sox=require(_0xc219('0x8'));var csv=require(_0xc219('0x9'));var ejs=require(_0xc219('0xa'));var fs=require('fs');var fs_extra=require(_0xc219('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xc219('0xc'));var jsforce=require(_0xc219('0xd'));var deskjs=require(_0xc219('0xe'));var toCsv=require(_0xc219('0x9'));var querystring=require(_0xc219('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xc219('0x10'));var qs=require(_0xc219('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xc219('0x12'))(_0xc219('0x13'));var utils=require('../../config/utils');var config=require(_0xc219('0x14'));var licenseUtil=require(_0xc219('0x15'));var db=require(_0xc219('0x16'))['db'];config[_0xc219('0x17')]=_[_0xc219('0x18')](config['redis'],{'host':_0xc219('0x19'),'port':0x18eb});var socket=require(_0xc219('0x1a'))(new Redis(config[_0xc219('0x17')]));require(_0xc219('0x1b'))['register'](socket);var jayson=require(_0xc219('0x1c'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0xc219('0x1d')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2b3dbb,_0x10856f,_0x3150d1,_0x139e89){return new BPromise(function(_0x418c3f,_0x421cc1){var _0x3f2304=_0x139e89||client;return _0x3f2304[_0xc219('0x1e')](_0x2b3dbb,_0x3150d1)[_0xc219('0x1f')](function(_0x745fea){logger['info'](_0xc219('0x20'),_0x10856f,_0xc219('0x21'));logger[_0xc219('0x22')](_0xc219('0x23'),_0x10856f,_0xc219('0x21'),JSON[_0xc219('0x24')](_0x745fea));if(_0x745fea[_0xc219('0x25')]){if(_0x745fea[_0xc219('0x25')][_0xc219('0x26')]===0x1f4){logger[_0xc219('0x25')](_0xc219('0x20'),_0x10856f,_0x745fea[_0xc219('0x25')][_0xc219('0x27')]);return _0x421cc1(_0x745fea[_0xc219('0x25')][_0xc219('0x27')]);}logger['error'](_0xc219('0x20'),_0x10856f,_0x745fea[_0xc219('0x25')][_0xc219('0x27')]);return _0x418c3f(_0x745fea[_0xc219('0x25')][_0xc219('0x27')]);}else{logger[_0xc219('0x28')]('FaxAccount,\x20%s,\x20%s',_0x10856f,_0xc219('0x21'));_0x418c3f(_0x745fea[_0xc219('0x29')][_0xc219('0x27')]);}})['catch'](function(_0x3f7862){logger[_0xc219('0x25')](_0xc219('0x20'),_0x10856f,_0x3f7862);_0x421cc1(_0x3f7862);});});}function respondWithStatusCode(_0x451638,_0x330370){_0x330370=_0x330370||0xcc;return function(_0x10a027){if(_0x10a027){return _0x451638[_0xc219('0x2a')](_0x330370);}return _0x451638[_0xc219('0x2b')](_0x330370)[_0xc219('0x2c')]();};}function respondWithResult(_0x553aa9,_0xe50c11){_0xe50c11=_0xe50c11||0xc8;return function(_0x26c845){if(_0x26c845){return _0x553aa9['status'](_0xe50c11)[_0xc219('0x2d')](_0x26c845);}};}function respondWithFilteredResult(_0x1377dc,_0x467155){return function(_0x22d661){if(_0x22d661){var _0x265acf=typeof _0x467155[_0xc219('0x2e')]==='undefined'&&typeof _0x467155[_0xc219('0x2f')]==='undefined';var _0x2693d9=_0x22d661['count'];var _0x49cb06=_0x265acf?0x0:_0x467155[_0xc219('0x2e')];var _0xd06abe=_0x265acf?_0x22d661['count']:_0x467155[_0xc219('0x2e')]+_0x467155[_0xc219('0x2f')];var _0x447a11;if(_0xd06abe>=_0x2693d9){_0xd06abe=_0x2693d9;_0x447a11=0xc8;}else{_0x447a11=0xce;}_0x1377dc['status'](_0x447a11);return _0x1377dc[_0xc219('0x30')]('Content-Range',_0x49cb06+'-'+_0xd06abe+'/'+_0x2693d9)[_0xc219('0x2d')](_0x22d661);}return null;};}function patchUpdates(_0x16723f){return function(_0x48fb84){try{jsonpatch[_0xc219('0x31')](_0x48fb84,_0x16723f,!![]);}catch(_0x4a46d0){return BPromise['reject'](_0x4a46d0);}return _0x48fb84[_0xc219('0x32')]();};}function saveUpdates(_0x60f6c7,_0x5ee40c){return function(_0x31e923){if(_0x31e923){return _0x31e923[_0xc219('0x33')](_0x60f6c7)[_0xc219('0x1f')](function(_0x178036){return _0x178036;});}return null;};}function removeEntity(_0x59183a,_0x10fe2f){return function(_0x1e8613){if(_0x1e8613){return _0x1e8613[_0xc219('0x34')]()[_0xc219('0x1f')](function(){var _0x7dd6fe=_0x1e8613[_0xc219('0x35')]({'plain':!![]});var _0x7e02a8='FaxAccounts';return db[_0xc219('0x36')][_0xc219('0x34')]({'where':{'type':_0x7e02a8,'resourceId':_0x7dd6fe['id']}})[_0xc219('0x1f')](function(){return _0x1e8613;});})[_0xc219('0x1f')](function(){_0x59183a[_0xc219('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x415348,_0x2fe816){return function(_0x11446b){if(!_0x11446b){_0x415348[_0xc219('0x2a')](0x194);}return _0x11446b;};}function handleError(_0x4b88fe,_0x32d36a){_0x32d36a=_0x32d36a||0x1f4;return function(_0x21fa63){logger[_0xc219('0x25')](_0x21fa63['stack']);if(_0x21fa63[_0xc219('0x37')]){delete _0x21fa63[_0xc219('0x37')];}_0x4b88fe[_0xc219('0x2b')](_0x32d36a)[_0xc219('0x38')](_0x21fa63);};}exports[_0xc219('0x39')]=function(_0x199b16,_0x10bfec){var _0x32e025={'include':[{'model':db['Pause'],'as':_0xc219('0x3a')}]},_0x273520={},_0x586ad0={'count':0x0,'rows':[]};var _0x4234df=_[_0xc219('0x3b')](db[_0xc219('0x3c')][_0xc219('0x3d')],function(_0x35f8ba){return{'name':_0x35f8ba['fieldName'],'type':_0x35f8ba[_0xc219('0x3e')][_0xc219('0x3f')]};});_0x273520[_0xc219('0x40')]=_[_0xc219('0x3b')](_0x4234df,_0xc219('0x37'));_0x273520[_0xc219('0x41')]=_[_0xc219('0x42')](_0x199b16[_0xc219('0x41')]);_0x273520['filters']=_[_0xc219('0x43')](_0x273520[_0xc219('0x40')],_0x273520[_0xc219('0x41')]);_0x32e025[_0xc219('0x44')]=_[_0xc219('0x43')](_0x273520['model'],qs[_0xc219('0x45')](_0x199b16[_0xc219('0x41')][_0xc219('0x45')]));_0x32e025[_0xc219('0x44')]=_0x32e025['attributes'][_0xc219('0x46')]?_0x32e025[_0xc219('0x44')]:_0x273520[_0xc219('0x40')];if(!_0x199b16[_0xc219('0x41')][_0xc219('0x47')](_0xc219('0x48'))){_0x32e025[_0xc219('0x2f')]=qs[_0xc219('0x2f')](_0x199b16[_0xc219('0x41')][_0xc219('0x2f')]);_0x32e025[_0xc219('0x2e')]=qs['offset'](_0x199b16[_0xc219('0x41')]['offset']);}_0x32e025[_0xc219('0x49')]=qs[_0xc219('0x4a')](_0x199b16[_0xc219('0x41')][_0xc219('0x4a')]);_0x32e025[_0xc219('0x4b')]=qs[_0xc219('0x4c')](_[_0xc219('0x4d')](_0x199b16[_0xc219('0x41')],_0x273520['filters']),_0x4234df);if(_0x199b16[_0xc219('0x41')][_0xc219('0x4e')]){_0x32e025['where']=_[_0xc219('0x4f')](_0x32e025['where'],{'$or':_[_0xc219('0x3b')](_0x4234df,function(_0x23aa00){if(_0x23aa00[_0xc219('0x3e')]!==_0xc219('0x50')){var _0x516ba5={};_0x516ba5[_0x23aa00[_0xc219('0x37')]]={'$like':'%'+_0x199b16['query']['filter']+'%'};return _0x516ba5;}})});}_0x32e025=_['merge']({},_0x32e025,_0x199b16[_0xc219('0x51')]);var _0x141c9d={'where':_0x32e025[_0xc219('0x4b')]};return db['FaxAccount'][_0xc219('0x52')](_0x141c9d)['then'](function(_0x4af2c3){_0x586ad0[_0xc219('0x52')]=_0x4af2c3;if(_0x199b16['query'][_0xc219('0x53')]){_0x32e025['include']=[{'all':!![]}];}return db['FaxAccount']['findAll'](_0x32e025);})[_0xc219('0x1f')](function(_0x297346){_0x586ad0[_0xc219('0x54')]=_0x297346;return _0x586ad0;})[_0xc219('0x1f')](respondWithFilteredResult(_0x10bfec,_0x32e025))['catch'](handleError(_0x10bfec,null));};exports[_0xc219('0x55')]=function(_0x1f6fe8,_0x21d39a){var _0x1ec7cb={'raw':![],'where':{'id':_0x1f6fe8[_0xc219('0x56')]['id']},'include':[{'model':db[_0xc219('0x57')],'as':'mandatoryDispositionPause'}]},_0x41f5b7={};_0x41f5b7['model']=_[_0xc219('0x42')](db[_0xc219('0x3c')][_0xc219('0x3d')]);_0x41f5b7[_0xc219('0x41')]=_['keys'](_0x1f6fe8[_0xc219('0x41')]);_0x41f5b7['filters']=_[_0xc219('0x43')](_0x41f5b7[_0xc219('0x40')],_0x41f5b7[_0xc219('0x41')]);_0x1ec7cb[_0xc219('0x44')]=_[_0xc219('0x43')](_0x41f5b7[_0xc219('0x40')],qs[_0xc219('0x45')](_0x1f6fe8['query'][_0xc219('0x45')]));_0x1ec7cb[_0xc219('0x44')]=_0x1ec7cb[_0xc219('0x44')][_0xc219('0x46')]?_0x1ec7cb[_0xc219('0x44')]:_0x41f5b7[_0xc219('0x40')];if(_0x1f6fe8[_0xc219('0x41')][_0xc219('0x53')]){_0x1ec7cb[_0xc219('0x58')]=[{'all':!![]}];}_0x1ec7cb=_[_0xc219('0x4f')]({},_0x1ec7cb,_0x1f6fe8[_0xc219('0x51')]);return db['FaxAccount']['find'](_0x1ec7cb)[_0xc219('0x1f')](handleEntityNotFound(_0x21d39a,null))[_0xc219('0x1f')](respondWithResult(_0x21d39a,null))[_0xc219('0x59')](handleError(_0x21d39a,null));};exports['create']=function(_0x5ee076,_0x151586){return db[_0xc219('0x3c')][_0xc219('0x5a')](_0x5ee076['body'],{})['then'](function(_0x4b7d9b){var _0x514034=_0x5ee076[_0xc219('0x5b')][_0xc219('0x35')]({'plain':!![]});if(!_0x514034)throw new Error(_0xc219('0x5c'));if(_0x514034[_0xc219('0x5d')]===_0xc219('0x5b')){var _0x347086=_0x4b7d9b[_0xc219('0x35')]({'plain':!![]});var _0x23218a=_0xc219('0x5e');return db[_0xc219('0x5f')][_0xc219('0x60')]({'where':{'name':_0x23218a,'userProfileId':_0x514034[_0xc219('0x61')]},'raw':!![]})[_0xc219('0x1f')](function(_0x3c5ace){if(_0x3c5ace&&_0x3c5ace[_0xc219('0x62')]===0x0){return db[_0xc219('0x36')][_0xc219('0x5a')]({'name':_0x347086[_0xc219('0x37')],'resourceId':_0x347086['id'],'type':_0x3c5ace[_0xc219('0x37')],'sectionId':_0x3c5ace['id']},{})[_0xc219('0x1f')](function(){return _0x4b7d9b;});}else{return _0x4b7d9b;}})[_0xc219('0x59')](function(_0x1c0edf){logger[_0xc219('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1c0edf);throw _0x1c0edf;});}return _0x4b7d9b;})[_0xc219('0x1f')](respondWithResult(_0x151586,0xc9))['catch'](handleError(_0x151586,null));};exports[_0xc219('0x33')]=function(_0x305bee,_0x35532e){if(_0x305bee[_0xc219('0x63')]['id']){delete _0x305bee[_0xc219('0x63')]['id'];}return db[_0xc219('0x3c')][_0xc219('0x60')]({'where':{'id':_0x305bee['params']['id']},'include':[{'model':db[_0xc219('0x57')],'as':_0xc219('0x3a')}]})[_0xc219('0x1f')](handleEntityNotFound(_0x35532e,null))[_0xc219('0x1f')](saveUpdates(_0x305bee['body'],null))['then'](respondWithResult(_0x35532e,null))[_0xc219('0x59')](handleError(_0x35532e,null));};exports[_0xc219('0x34')]=function(_0x4cf1ce,_0xc0983c){return db[_0xc219('0x3c')]['find']({'where':{'id':_0x4cf1ce[_0xc219('0x56')]['id']}})[_0xc219('0x1f')](handleEntityNotFound(_0xc0983c,null))[_0xc219('0x1f')](removeEntity(_0xc0983c,null))[_0xc219('0x59')](handleError(_0xc0983c,null));};exports['describe']=function(_0x49a3bf,_0x14c09f){return db['FaxAccount'][_0xc219('0x64')]()['then'](respondWithResult(_0x14c09f,null))[_0xc219('0x59')](handleError(_0x14c09f,null));};exports[_0xc219('0x65')]=function(_0x31d640,_0x212e6c,_0x30e29a){if(_0x31d640[_0xc219('0x63')]['id']){delete _0x31d640[_0xc219('0x63')]['id'];}return db['FaxAccount']['find']({'where':{'id':_0x31d640[_0xc219('0x56')]['id']}})['then'](handleEntityNotFound(_0x212e6c,null))[_0xc219('0x1f')](function(_0x2ca4b8){if(_0x2ca4b8){_0x31d640[_0xc219('0x63')][_0xc219('0x66')]=_0x2ca4b8['id'];return db['Disposition'][_0xc219('0x5a')](_0x31d640[_0xc219('0x63')]);}})[_0xc219('0x1f')](respondWithResult(_0x212e6c,null))[_0xc219('0x59')](handleError(_0x212e6c,null));};exports[_0xc219('0x67')]=function(_0xb83924,_0x1b9751,_0x3ef9ec){var _0x2a80be={'raw':![],'where':{}};var _0x22cf97={};var _0x3cb9d2={'count':0x0,'rows':[]};return db[_0xc219('0x3c')][_0xc219('0x68')]({'where':{'id':_0xb83924[_0xc219('0x56')]['id']}})[_0xc219('0x1f')](handleEntityNotFound(_0x1b9751,null))[_0xc219('0x1f')](function(_0x4698d1){if(_0x4698d1){_0x22cf97[_0xc219('0x40')]=_['keys'](db['Disposition']['rawAttributes']);_0x22cf97[_0xc219('0x41')]=_[_0xc219('0x42')](_0xb83924[_0xc219('0x41')]);_0x22cf97[_0xc219('0x4c')]=_['intersection'](_0x22cf97[_0xc219('0x40')],_0x22cf97[_0xc219('0x41')]);_0x2a80be[_0xc219('0x44')]=_[_0xc219('0x43')](_0x22cf97['model'],qs[_0xc219('0x45')](_0xb83924[_0xc219('0x41')][_0xc219('0x45')]));_0x2a80be[_0xc219('0x44')]=_0x2a80be['attributes'][_0xc219('0x46')]?_0x2a80be[_0xc219('0x44')]:_0x22cf97[_0xc219('0x40')];if(!_0xb83924['query']['hasOwnProperty'](_0xc219('0x48'))){_0x2a80be[_0xc219('0x2f')]=qs[_0xc219('0x2f')](_0xb83924[_0xc219('0x41')][_0xc219('0x2f')]);_0x2a80be['offset']=qs['offset'](_0xb83924[_0xc219('0x41')][_0xc219('0x2e')]);}_0x2a80be[_0xc219('0x49')]=qs[_0xc219('0x4a')](_0xb83924[_0xc219('0x41')][_0xc219('0x4a')]);_0x2a80be['where']=qs[_0xc219('0x4c')](_['pick'](_0xb83924['query'],_0x22cf97['filters']));_0x2a80be['where'][_0xc219('0x66')]=_0x4698d1['id'];if(_0xb83924[_0xc219('0x41')][_0xc219('0x4e')]){_0x2a80be['where']=_[_0xc219('0x4f')](_0x2a80be['where'],{'$or':_[_0xc219('0x3b')](_0x2a80be['attributes'],function(_0x42efd6){var _0x5451b7={};_0x5451b7[_0x42efd6]={'$like':'%'+_0xb83924['query'][_0xc219('0x4e')]+'%'};return _0x5451b7;})});}_0x2a80be=_[_0xc219('0x4f')]({},_0x2a80be,_0xb83924[_0xc219('0x51')]);return db[_0xc219('0x69')]['count']({'where':_0x2a80be[_0xc219('0x4b')]})['then'](function(_0x209c0c){_0x3cb9d2[_0xc219('0x52')]=_0x209c0c;if(_0xb83924[_0xc219('0x41')][_0xc219('0x53')]){_0x2a80be['include']=[{'all':!![]}];}return db[_0xc219('0x69')]['findAll'](_0x2a80be);})['then'](function(_0x1012d5){_0x3cb9d2[_0xc219('0x54')]=_0x1012d5;return _0x3cb9d2;});}})[_0xc219('0x1f')](respondWithFilteredResult(_0x1b9751,_0x2a80be))[_0xc219('0x59')](handleError(_0x1b9751,null));};exports[_0xc219('0x6a')]=function(_0x1630c2,_0x46698f,_0x2629d6){return db['FaxAccount'][_0xc219('0x60')]({'where':{'id':_0x1630c2[_0xc219('0x56')]['id']}})[_0xc219('0x1f')](handleEntityNotFound(_0x46698f,null))[_0xc219('0x1f')](function(_0x4fbb13){if(_0x4fbb13){return _0x4fbb13['removeDispositions'](_0x1630c2[_0xc219('0x41')]['ids']);}})[_0xc219('0x1f')](respondWithStatusCode(_0x46698f,null))[_0xc219('0x59')](handleError(_0x46698f,null));};exports[_0xc219('0x6b')]=function(_0xb95efc,_0xd6ea93,_0x3b0a34){if(_0xb95efc[_0xc219('0x63')]['id']){delete _0xb95efc[_0xc219('0x63')]['id'];}return db[_0xc219('0x3c')]['find']({'where':{'id':_0xb95efc['params']['id']}})['then'](handleEntityNotFound(_0xd6ea93,null))[_0xc219('0x1f')](function(_0x12d2d8){if(_0x12d2d8){_0xb95efc['body'][_0xc219('0x66')]=_0x12d2d8['id'];return db[_0xc219('0x6c')][_0xc219('0x5a')](_0xb95efc[_0xc219('0x63')]);}})[_0xc219('0x1f')](respondWithResult(_0xd6ea93,null))['catch'](handleError(_0xd6ea93,null));};exports[_0xc219('0x6d')]=function(_0x1ac949,_0x1b6881,_0x57a6db){var _0x496657={'raw':![],'where':{}};var _0x4a392f={};var _0x193857={'count':0x0,'rows':[]};return db[_0xc219('0x3c')][_0xc219('0x68')]({'where':{'id':_0x1ac949['params']['id']}})[_0xc219('0x1f')](handleEntityNotFound(_0x1b6881,null))[_0xc219('0x1f')](function(_0x4860b8){if(_0x4860b8){_0x4a392f['model']=_[_0xc219('0x42')](db['CannedAnswer'][_0xc219('0x3d')]);_0x4a392f['query']=_[_0xc219('0x42')](_0x1ac949[_0xc219('0x41')]);_0x4a392f[_0xc219('0x4c')]=_[_0xc219('0x43')](_0x4a392f[_0xc219('0x40')],_0x4a392f[_0xc219('0x41')]);_0x496657['attributes']=_[_0xc219('0x43')](_0x4a392f[_0xc219('0x40')],qs[_0xc219('0x45')](_0x1ac949[_0xc219('0x41')][_0xc219('0x45')]));_0x496657[_0xc219('0x44')]=_0x496657[_0xc219('0x44')][_0xc219('0x46')]?_0x496657[_0xc219('0x44')]:_0x4a392f['model'];if(!_0x1ac949[_0xc219('0x41')][_0xc219('0x47')](_0xc219('0x48'))){_0x496657[_0xc219('0x2f')]=qs['limit'](_0x1ac949[_0xc219('0x41')][_0xc219('0x2f')]);_0x496657[_0xc219('0x2e')]=qs['offset'](_0x1ac949[_0xc219('0x41')][_0xc219('0x2e')]);}_0x496657[_0xc219('0x49')]=qs[_0xc219('0x4a')](_0x1ac949['query'][_0xc219('0x4a')]);_0x496657[_0xc219('0x4b')]=qs[_0xc219('0x4c')](_[_0xc219('0x4d')](_0x1ac949[_0xc219('0x41')],_0x4a392f['filters']));_0x496657[_0xc219('0x4b')][_0xc219('0x66')]=_0x4860b8['id'];if(_0x1ac949[_0xc219('0x41')][_0xc219('0x4e')]){_0x496657[_0xc219('0x4b')]=_[_0xc219('0x4f')](_0x496657[_0xc219('0x4b')],{'$or':_['map'](_0x496657[_0xc219('0x44')],function(_0x131ac1){var _0x4ea0f0={};_0x4ea0f0[_0x131ac1]={'$like':'%'+_0x1ac949['query']['filter']+'%'};return _0x4ea0f0;})});}_0x496657=_[_0xc219('0x4f')]({},_0x496657,_0x1ac949[_0xc219('0x51')]);return db[_0xc219('0x6c')][_0xc219('0x52')]({'where':_0x496657[_0xc219('0x4b')]})['then'](function(_0xb96699){_0x193857['count']=_0xb96699;if(_0x1ac949[_0xc219('0x41')][_0xc219('0x53')]){_0x496657['include']=[{'all':!![]}];}return db[_0xc219('0x6c')]['findAll'](_0x496657);})['then'](function(_0x2055da){_0x193857[_0xc219('0x54')]=_0x2055da;return _0x193857;});}})[_0xc219('0x1f')](respondWithFilteredResult(_0x1b6881,_0x496657))['catch'](handleError(_0x1b6881,null));};exports[_0xc219('0x6e')]=function(_0x1fb191,_0x36ff64,_0x5f463b){return db[_0xc219('0x3c')][_0xc219('0x60')]({'where':{'id':_0x1fb191['params']['id']}})[_0xc219('0x1f')](handleEntityNotFound(_0x36ff64,null))['then'](function(_0x5d4b4a){if(_0x5d4b4a){return _0x5d4b4a[_0xc219('0x6e')](_0x1fb191[_0xc219('0x41')]['ids']);}})[_0xc219('0x1f')](respondWithStatusCode(_0x36ff64,null))[_0xc219('0x59')](handleError(_0x36ff64,null));};exports['addInteraction']=function(_0x155723,_0x46b485,_0x917f98){return db[_0xc219('0x6f')][_0xc219('0x60')]({'where':{'id':_0x155723[_0xc219('0x56')]['id']}})[_0xc219('0x1f')](handleEntityNotFound(_0x46b485,null))[_0xc219('0x1f')](function(_0x230a27){if(_0x230a27){return _0x230a27[_0xc219('0x70')](_0x155723[_0xc219('0x63')]['ids'],_[_0xc219('0x71')](_0x155723[_0xc219('0x63')],[_0xc219('0x72'),'id'])||{});}})['then'](respondWithResult(_0x46b485,null))['catch'](handleError(_0x46b485,null));};exports[_0xc219('0x73')]=function(_0x3640b0,_0x340bb9,_0x235b5e){var _0x125a4a={'raw':![],'where':{}};var _0x177a7d={};var _0x17fc42={'count':0x0,'rows':[]};return db['FaxAccount'][_0xc219('0x68')]({'where':{'id':_0x3640b0[_0xc219('0x56')]['id']}})[_0xc219('0x1f')](handleEntityNotFound(_0x340bb9,null))[_0xc219('0x1f')](function(_0x1a6562){if(_0x1a6562){_0x177a7d['model']=_[_0xc219('0x42')](db[_0xc219('0x6f')]['rawAttributes']);_0x177a7d[_0xc219('0x41')]=_[_0xc219('0x42')](_0x3640b0[_0xc219('0x41')]);_0x177a7d['filters']=_[_0xc219('0x43')](_0x177a7d['model'],_0x177a7d[_0xc219('0x41')]);_0x125a4a[_0xc219('0x44')]=_[_0xc219('0x43')](_0x177a7d['model'],qs['fields'](_0x3640b0['query'][_0xc219('0x45')]));_0x125a4a[_0xc219('0x44')]=_0x125a4a[_0xc219('0x44')][_0xc219('0x46')]?_0x125a4a['attributes']:_0x177a7d[_0xc219('0x40')];if(!_0x3640b0[_0xc219('0x41')][_0xc219('0x47')](_0xc219('0x48'))){_0x125a4a[_0xc219('0x2f')]=qs[_0xc219('0x2f')](_0x3640b0[_0xc219('0x41')][_0xc219('0x2f')]);_0x125a4a[_0xc219('0x2e')]=qs['offset'](_0x3640b0[_0xc219('0x41')][_0xc219('0x2e')]);}_0x125a4a[_0xc219('0x49')]=qs[_0xc219('0x4a')](_0x3640b0[_0xc219('0x41')][_0xc219('0x4a')]);_0x125a4a[_0xc219('0x4b')]=qs[_0xc219('0x4c')](_[_0xc219('0x4d')](_0x3640b0[_0xc219('0x41')],_0x177a7d['filters']));_0x125a4a[_0xc219('0x4b')]['FaxAccountId']=_0x1a6562['id'];if(_0x3640b0[_0xc219('0x41')][_0xc219('0x4e')]){_0x125a4a[_0xc219('0x4b')]=_[_0xc219('0x4f')](_0x125a4a[_0xc219('0x4b')],{'$or':_[_0xc219('0x3b')](_0x125a4a[_0xc219('0x44')],function(_0x1af0ed){var _0x109567={};_0x109567[_0x1af0ed]={'$like':'%'+_0x3640b0[_0xc219('0x41')]['filter']+'%'};return _0x109567;})});}_0x125a4a=_[_0xc219('0x4f')]({},_0x125a4a,_0x3640b0[_0xc219('0x51')]);return db[_0xc219('0x6f')]['count']({'where':_0x125a4a[_0xc219('0x4b')]})[_0xc219('0x1f')](function(_0x452779){_0x17fc42[_0xc219('0x52')]=_0x452779;if(_0x3640b0[_0xc219('0x41')]['includeAll']){_0x125a4a[_0xc219('0x58')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0xc219('0x74')],'as':'Owner','attributes':[_0xc219('0x37'),_0xc219('0x75'),_0xc219('0x76')],'required':![]},{'model':db[_0xc219('0x77')],'as':_0xc219('0x78'),'attributes':['id',_0xc219('0x37'),_0xc219('0x79')],'where':_0x3640b0[_0xc219('0x41')]['tag']?{'id':_0x3640b0[_0xc219('0x41')][_0xc219('0x7a')]}:undefined,'required':_0x3640b0[_0xc219('0x41')][_0xc219('0x7a')]?!![]:![]}];}return db[_0xc219('0x6f')][_0xc219('0x7b')](_0x125a4a);})[_0xc219('0x1f')](function(_0x18a769){_0x17fc42[_0xc219('0x54')]=_0x18a769;return _0x17fc42;});}})['then'](respondWithFilteredResult(_0x340bb9,_0x125a4a))[_0xc219('0x59')](handleError(_0x340bb9,null));};exports[_0xc219('0x7c')]=function(_0x5254cb,_0x56250c){var _0x2de6dc=_0x5254cb['params']['id'];var _0x4ba5c8=_0x5254cb[_0xc219('0x63')];var _0x5ad99a=0xc8;var _0x1efdc3=null;return db[_0xc219('0x7d')]['transaction']({'isolationLevel':db[_0xc219('0x7d')][_0xc219('0x7e')][_0xc219('0x7f')]['READ_COMMITTED']},function(_0x42ce55){return db['FaxAccount']['findOne']({'where':{'id':_0x2de6dc},'transaction':_0x42ce55})[_0xc219('0x1f')](function(_0x29a169){if(_0x29a169){return db[_0xc219('0x80')][_0xc219('0x34')]({'where':{'FaxAccountId':_0x2de6dc},'transaction':_0x42ce55})[_0xc219('0x1f')](function(){var _0x356a17=_[_0xc219('0x3b')](_0x4ba5c8,function(_0x114f65){_0x114f65['FaxAccountId']=_0x2de6dc;return _0x114f65;});return db[_0xc219('0x80')][_0xc219('0x81')](_0x356a17,{'transaction':_0x42ce55});});}else{_0x5ad99a=0x194;_0x1efdc3=[];}});})['then'](function(){if(_0x5ad99a!==0x194){return db[_0xc219('0x80')][_0xc219('0x82')]({'where':{'FaxAccountId':_0x2de6dc},'order':_0xc219('0x83')})[_0xc219('0x1f')](function(_0x3b32c0){_0x1efdc3=_0x3b32c0;});}})['catch'](function(_0x215f4e){_0x5ad99a=0x1f4;logger['error'](_0x215f4e['stack']);if(_0x215f4e['name']){delete _0x215f4e['name'];}_0x1efdc3=_0x215f4e;})[_0xc219('0x84')](function(){if(_0x1efdc3===null){_0x56250c[_0xc219('0x2a')](_0x5ad99a);}else{if(_0x5ad99a===0x1f4){_0x56250c[_0xc219('0x2b')](_0x5ad99a)['send'](_0x1efdc3);}else{_0x56250c['status'](_0x5ad99a)['json'](_0x1efdc3);}}});};exports[_0xc219('0x85')]=function(_0x3db914,_0x2fa065,_0x102920){var _0x2e2599={};var _0x3cac19={};var _0x21d652;var _0x427fac;return db['FaxAccount'][_0xc219('0x68')]({'where':{'id':_0x3db914[_0xc219('0x56')]['id']}})[_0xc219('0x1f')](handleEntityNotFound(_0x2fa065,null))[_0xc219('0x1f')](function(_0x9d8450){if(_0x9d8450){_0x21d652=_0x9d8450;_0x3cac19[_0xc219('0x40')]=_[_0xc219('0x42')](db['FaxApplication'][_0xc219('0x3d')]);_0x3cac19[_0xc219('0x41')]=_[_0xc219('0x42')](_0x3db914[_0xc219('0x41')]);_0x3cac19[_0xc219('0x4c')]=_[_0xc219('0x43')](_0x3cac19[_0xc219('0x40')],_0x3cac19['query']);_0x2e2599['attributes']=_['intersection'](_0x3cac19['model'],qs['fields'](_0x3db914[_0xc219('0x41')][_0xc219('0x45')]));_0x2e2599[_0xc219('0x44')]=_0x2e2599[_0xc219('0x44')]['length']?_0x2e2599[_0xc219('0x44')]:_0x3cac19['model'];_0x2e2599[_0xc219('0x49')]=qs[_0xc219('0x4a')](_0x3db914[_0xc219('0x41')][_0xc219('0x4a')]);_0x2e2599[_0xc219('0x4b')]=qs[_0xc219('0x4c')](_['pick'](_0x3db914[_0xc219('0x41')],_0x3cac19[_0xc219('0x4c')]));if(_0x3db914[_0xc219('0x41')][_0xc219('0x4e')]){_0x2e2599['where']=_[_0xc219('0x4f')](_0x2e2599[_0xc219('0x4b')],{'$or':_['map'](_0x2e2599[_0xc219('0x44')],function(_0x28024d){var _0x36afea={};_0x36afea[_0x28024d]={'$like':'%'+_0x3db914[_0xc219('0x41')][_0xc219('0x4e')]+'%'};return _0x36afea;})});}_0x2e2599=_[_0xc219('0x4f')]({},_0x2e2599,_0x3db914[_0xc219('0x51')]);return _0x21d652[_0xc219('0x85')](_0x2e2599);}})['then'](function(_0x195cdd){if(_0x195cdd){_0x427fac=_0x195cdd['length'];if(!_0x3db914[_0xc219('0x41')]['hasOwnProperty'](_0xc219('0x48'))){_0x2e2599[_0xc219('0x2f')]=qs['limit'](_0x3db914[_0xc219('0x41')][_0xc219('0x2f')]);_0x2e2599[_0xc219('0x2e')]=qs['offset'](_0x3db914[_0xc219('0x41')][_0xc219('0x2e')]);}return _0x21d652[_0xc219('0x85')](_0x2e2599);}})[_0xc219('0x1f')](function(_0x1d073c){if(_0x1d073c){return _0x1d073c?{'count':_0x427fac,'rows':_0x1d073c}:null;}})[_0xc219('0x1f')](respondWithResult(_0x2fa065,null))[_0xc219('0x59')](handleError(_0x2fa065,null));};function Extension(_0x40ed2b,_0x59b2a7,_0x14203b,_0x581480){this[_0xc219('0x86')]=_0xc219('0x87');this[_0xc219('0x88')]=_0x40ed2b[_0xc219('0x89')];this[_0xc219('0x8a')]=_0x581480;this[_0xc219('0x3e')]='system';this[_0xc219('0x8b')]=_0xc219('0x8c');this[_0xc219('0x66')]=_0x40ed2b['id'];this[_0xc219('0x83')]=_0x59b2a7;this['appdata']=_0x14203b;}function createExtensionsReciveFax(_0x217202){var _0x5abc7f=0x1;var _0x3913ad=[];_0x3913ad[_0xc219('0x8d')](new Extension(_0x217202,_0x5abc7f,'',_0xc219('0x8e')));_0x5abc7f+=0x1;_0x3913ad[_0xc219('0x8d')](new Extension(_0x217202,_0x5abc7f,_0xc219('0x8f'),_0xc219('0x90')));_0x5abc7f+=0x1;for(var _0x38f8c0 in _0x217202){if(_0x217202[_0xc219('0x47')](_0x38f8c0)&&(_0x38f8c0===_0xc219('0x91')||_0x38f8c0===_0xc219('0x89')||_0x38f8c0===_0xc219('0x92')||_0x38f8c0===_0xc219('0x93')||_0x38f8c0===_0xc219('0x94')||_0x38f8c0===_0xc219('0x95')||_0x38f8c0===_0xc219('0x96')||_0x38f8c0===_0xc219('0x97')||_0x38f8c0===_0xc219('0x98'))){_0x3913ad[_0xc219('0x8d')](new Extension(_0x217202,_0x5abc7f,_0xc219('0x99')+_0x38f8c0+')='+_0x217202[_0x38f8c0],_0xc219('0x90')));_0x5abc7f+=0x1;}}_0x3913ad[_0xc219('0x8d')](new Extension(_0x217202,_0x5abc7f,'6',_0xc219('0x9a')));_0x5abc7f+=0x1;_0x3913ad[_0xc219('0x8d')](new Extension(_0x217202,_0x5abc7f,'/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',_0xc219('0x9b')));_0x5abc7f=0x0;return _0x3913ad;}exports[_0xc219('0x9c')]=function(_0x273387,_0xea307b,_0x5d67d0){var _0xc50aa1;return db['sequelize']['transaction'](function(_0x1f9408){return db[_0xc219('0x3c')]['create'](_0x273387[_0xc219('0x63')],{'transaction':_0x1f9408})['then'](function(_0x20f633){_0xc50aa1=_0x20f633[_0xc219('0x35')]({'plain':!![]});return db[_0xc219('0x9d')]['bulkCreate'](createExtensionsReciveFax(_0xc50aa1),{'transaction':_0x1f9408});});})[_0xc219('0x1f')](function(){return _0xc50aa1;})[_0xc219('0x1f')](respondWithResult(_0xea307b,null))[_0xc219('0x59')](handleError(_0xea307b,null));};exports['updateAccountApplications']=function(_0x5178b8,_0x2ae0d7,_0x39e768){var _0x943a61;return db[_0xc219('0x7d')]['transaction'](function(_0x1f9731){return db[_0xc219('0x3c')][_0xc219('0x33')](_0x5178b8['body'],{'where':{'id':_0x5178b8[_0xc219('0x63')]['id']},'transaction':_0x1f9731})[_0xc219('0x1f')](function(_0x443047){return db[_0xc219('0x9d')]['destroy']({'where':{'FaxAccountId':_0x5178b8['body']['id']},'transaction':_0x1f9731})[_0xc219('0x1f')](function(_0x38ede9){return db[_0xc219('0x9d')][_0xc219('0x81')](createExtensionsReciveFax(_[_0xc219('0x71')](_0x5178b8[_0xc219('0x63')],[_0xc219('0x9e'),_0xc219('0x3f'),_0xc219('0x9f'),_0xc219('0xa0'),_0xc219('0xa1'),'ListId'])),{'transaction':_0x1f9731});});});})[_0xc219('0x1f')](function(){return db[_0xc219('0x3c')][_0xc219('0xa2')](_0x5178b8[_0xc219('0x63')]['id']);})[_0xc219('0x1f')](respondWithResult(_0x2ae0d7,null))[_0xc219('0x59')](handleError(_0x2ae0d7,null));};exports[_0xc219('0xa3')]=function(_0x2e6d58,_0x12416e,_0x4248d5){var _0x4c4ae2={'raw':!![],'where':{}};var _0x297900={};var _0x33ffa3={'count':0x0,'rows':[]};return db[_0xc219('0x3c')][_0xc219('0x68')]({'where':{'id':_0x2e6d58[_0xc219('0x56')]['id']}})[_0xc219('0x1f')](handleEntityNotFound(_0x12416e,null))[_0xc219('0x1f')](function(_0x2a9e0f){if(_0x2a9e0f){_0x297900[_0xc219('0x40')]=_[_0xc219('0x42')](db['FaxMessage'][_0xc219('0x3d')]);_0x297900[_0xc219('0x41')]=_[_0xc219('0x42')](_0x2e6d58['query']);_0x297900[_0xc219('0x4c')]=_[_0xc219('0x43')](_0x297900[_0xc219('0x40')],_0x297900['query']);_0x4c4ae2[_0xc219('0x44')]=_['intersection'](_0x297900[_0xc219('0x40')],qs[_0xc219('0x45')](_0x2e6d58[_0xc219('0x41')]['fields']));_0x4c4ae2[_0xc219('0x44')]=_0x4c4ae2['attributes'][_0xc219('0x46')]?_0x4c4ae2[_0xc219('0x44')]:_0x297900['model'];if(!_0x2e6d58['query'][_0xc219('0x47')](_0xc219('0x48'))){_0x4c4ae2[_0xc219('0x2f')]=qs[_0xc219('0x2f')](_0x2e6d58[_0xc219('0x41')][_0xc219('0x2f')]);_0x4c4ae2[_0xc219('0x2e')]=qs[_0xc219('0x2e')](_0x2e6d58[_0xc219('0x41')]['offset']);}_0x4c4ae2[_0xc219('0x49')]=qs[_0xc219('0x4a')](_0x2e6d58[_0xc219('0x41')]['sort']);_0x4c4ae2[_0xc219('0x4b')]=qs[_0xc219('0x4c')](_[_0xc219('0x4d')](_0x2e6d58['query'],_0x297900[_0xc219('0x4c')]));_0x4c4ae2['where']['FaxAccountId']=_0x2a9e0f['id'];if(_0x2e6d58['query']['filter']){_0x4c4ae2['where']=_[_0xc219('0x4f')](_0x4c4ae2[_0xc219('0x4b')],{'$or':_[_0xc219('0x3b')](_0x4c4ae2[_0xc219('0x44')],function(_0x3a6771){var _0x2833dc={};_0x2833dc[_0x3a6771]={'$like':'%'+_0x2e6d58['query'][_0xc219('0x4e')]+'%'};return _0x2833dc;})});}if(_0x2e6d58[_0xc219('0x41')][_0xc219('0xa4')]){var _0x3a1b00=_0x2e6d58[_0xc219('0x41')]['$gte'][_0xc219('0xa5')](',');var _0xa825c7={};_0xa825c7[_0x3a1b00[0x0]]={'$gte':moment(_0x3a1b00[0x1])['format'](_0xc219('0xa6'))};_0x4c4ae2[_0xc219('0x4b')]=_[_0xc219('0x4f')](_0x4c4ae2['where'],_0xa825c7);}_0x4c4ae2=_[_0xc219('0x4f')]({},_0x4c4ae2,_0x2e6d58[_0xc219('0x51')]);return db[_0xc219('0xa7')][_0xc219('0x52')]({'where':_0x4c4ae2[_0xc219('0x4b')]})[_0xc219('0x1f')](function(_0x30663a){_0x33ffa3[_0xc219('0x52')]=_0x30663a;if(_0x2e6d58[_0xc219('0x41')][_0xc219('0x53')]){_0x4c4ae2['include']=[{'all':!![]}];}return db[_0xc219('0xa7')][_0xc219('0x7b')](_0x4c4ae2);})[_0xc219('0x1f')](function(_0x3ab6b2){_0x33ffa3[_0xc219('0x54')]=_0x3ab6b2;return _0x33ffa3;});}})[_0xc219('0x1f')](respondWithFilteredResult(_0x12416e,_0x4c4ae2))[_0xc219('0x59')](handleError(_0x12416e,null));};exports['send']=function(_0x4f6cf6,_0x1bc5b1,_0x32ad99){var _0x2d0876,_0x219b0d={},_0x84cee9;if(_0x4f6cf6[_0xc219('0x63')]['to']){_0x84cee9=_0x4f6cf6['body']['to'][0x0];}return db[_0xc219('0x3c')][_0xc219('0x60')]({'where':{'id':_0x4f6cf6[_0xc219('0x56')]['id']},'include':[{'model':db[_0xc219('0xa8')],'as':_0xc219('0xa9'),'include':[{'model':db[_0xc219('0xaa')],'as':_0xc219('0xab'),'where':{'fax':_0x84cee9},'limit':0x1,'order':[[_0xc219('0xa0'),_0xc219('0xac')]]}]}]})[_0xc219('0x1f')](handleEntityNotFound(_0x1bc5b1,null))[_0xc219('0x1f')](function(_0x6bd34a){_0x2d0876=_0x6bd34a;if(_0x4f6cf6[_0xc219('0x63')]['attachments']&&_0x4f6cf6['body']['attachments'][_0xc219('0x46')]){for(var _0x3d5062=0x0;_0x3d5062<_0x4f6cf6['body']['attachments'][_0xc219('0x46')];_0x3d5062+=0x1){_0x4f6cf6['body'][_0xc219('0xad')][_0x3d5062]={'filename':_0x4f6cf6[_0xc219('0x63')]['attachments'][_0x3d5062]['name'],'id':_0x4f6cf6[_0xc219('0x63')][_0xc219('0xad')][_0x3d5062]['id'],'path':path[_0xc219('0xae')](config[_0xc219('0xaf')],_0xc219('0xb0'),_0x4f6cf6[_0xc219('0x63')][_0xc219('0xad')][_0x3d5062][_0xc219('0xb1')])};}}return respondWithRpcPromise(_0xc219('0xb2'),_0xc219('0xb2'),{'FaxAccountId':_[_0xc219('0xb3')](_0x4f6cf6['params']['id'])?undefined:_0x4f6cf6[_0xc219('0x56')]['id'],'path':_[_0xc219('0xb3')](_0x4f6cf6[_0xc219('0x63')][_0xc219('0xad')][0x0][_0xc219('0x7')])?undefined:_0x4f6cf6['body']['attachments'][0x0][_0xc219('0x7')],'fax':_[_0xc219('0xb3')](_0x4f6cf6['body']['to'][0x0])?undefined:_0x4f6cf6[_0xc219('0x63')]['to'][0x0]},client9002);})['then'](function(){if(_0x2d0876){if(_[_0xc219('0xb3')](_0x4f6cf6[_0xc219('0x63')][_0xc219('0xb4')])){_0x4f6cf6['body'][_0xc219('0xb4')]=util[_0xc219('0xb5')](_0xc219('0xb6'),_0x2d0876[_0xc219('0x37')],_0x2d0876[_0xc219('0xb7')]);}if(_0x2d0876[_0xc219('0xa9')]){if(_0x2d0876[_0xc219('0xa9')]['Contacts'][_0xc219('0x46')]){return _0x2d0876[_0xc219('0xa9')][_0xc219('0xab')][0x0];}else{return db[_0xc219('0xaa')][_0xc219('0x5a')](_[_0xc219('0x18')](_0x4f6cf6[_0xc219('0x63')],{'firstName':_0x4f6cf6['body']['to'][0x0],'phone':_0x4f6cf6[_0xc219('0x63')]['to'][0x0],'fax':_0x4f6cf6['body']['to'][0x0],'ListId':_0x2d0876[_0xc219('0xb8')]}));}}else{throw new Error(_0xc219('0xb9'));}}else{throw new Error(_0xc219('0xba'));}})['then'](function(_0x4d7ec6){if(_0x4d7ec6){return db[_0xc219('0x6f')][_0xc219('0x60')]({'where':{'ContactId':_0x4d7ec6['id'],'closed':![],'FaxAccountId':_0x2d0876['id']}})[_0xc219('0x1f')](function(_0x23e9e8){if(_0x23e9e8){return[_0x23e9e8,![]];}return db[_0xc219('0x6f')][_0xc219('0x5a')]({'UserId':_0x4f6cf6[_0xc219('0x5b')]['id'],'ContactId':_0x4d7ec6['id'],'FaxAccountId':_0x2d0876['id'],'fax':_0x4f6cf6[_0xc219('0x63')]['to'][0x0],'firstMsgDirection':_0xc219('0xbb'),'Messages':[_['merge'](_0x4f6cf6[_0xc219('0x63')],{'read':![],'body':_0x4f6cf6[_0xc219('0x63')][_0xc219('0xad')][0x0][_0xc219('0xbc')],'FaxAccountId':_0x2d0876['id'],'UserId':_0x4f6cf6[_0xc219('0x5b')]['id'],'ContactId':_0x4d7ec6['id'],'AttachmentId':_0x4f6cf6[_0xc219('0x63')][_0xc219('0xad')][0x0]['id']})]},{'include':[{'model':db['FaxMessage'],'as':'Messages'}]})[_0xc219('0x1f')](function(_0x2accef){return[_0x2accef,!![]];});});}else{throw new Error(_0xc219('0xbd'));}})['spread'](function(_0x5e3952,_0x1c85ab){if(_0x1c85ab){return _0x5e3952;}return db[_0xc219('0xa7')][_0xc219('0x5a')]({'direction':_0xc219('0xbb'),'read':![],'body':_0x4f6cf6[_0xc219('0x63')][_0xc219('0xad')][0x0]['filename'],'FaxAccountId':_0x2d0876['id'],'FaxInteractionId':_0x5e3952['id'],'UserId':_0x4f6cf6[_0xc219('0x5b')]['id'],'ContactId':_0x5e3952[_0xc219('0xbe')],'AttachmentId':_0x4f6cf6[_0xc219('0x63')]['attachments'][0x0]['id']})[_0xc219('0x1f')](function(_0x310948){_0x5e3952['dataValues'][_0xc219('0xbf')]=[];_0x5e3952[_0xc219('0xc0')][_0xc219('0xbf')][_0xc219('0x8d')](_0x310948['dataValues']);return _0x5e3952;});})['then'](function(_0x371bc8){respondWithRpcPromise(_0xc219('0xc1'),_0xc219('0xc1'),{'FaxAccountId':_[_0xc219('0xb3')](_0x4f6cf6[_0xc219('0x56')]['id'])?undefined:_0x4f6cf6[_0xc219('0x56')]['id'],'path':_[_0xc219('0xb3')](_0x4f6cf6[_0xc219('0x63')][_0xc219('0xad')][0x0][_0xc219('0x7')])?undefined:_0x4f6cf6[_0xc219('0x63')][_0xc219('0xad')][0x0][_0xc219('0x7')],'fax':_[_0xc219('0xb3')](_0x4f6cf6[_0xc219('0x63')]['to'][0x0])?undefined:_0x4f6cf6['body']['to'][0x0],'AttachmentId':_0x4f6cf6[_0xc219('0x63')]['attachments'][0x0]['id']},client9002)[_0xc219('0x1f')](function(_0x14e13c){logger[_0xc219('0x28')](_0xc219('0xc2'),_0x14e13c);})[_0xc219('0x59')](function(_0x4e4406){logger[_0xc219('0x28')](_0xc219('0xc2'),_0x4e4406);});return _0x371bc8;})[_0xc219('0x1f')](respondWithResult(_0x1bc5b1,null))[_0xc219('0x59')](handleError(_0x1bc5b1,null));};exports['addAgents']=function(_0x200cb1,_0x5ccc3e,_0x30f745){return db[_0xc219('0x3c')][_0xc219('0x60')]({'where':{'id':_0x200cb1[_0xc219('0x56')]['id']}})[_0xc219('0x1f')](handleEntityNotFound(_0x5ccc3e,null))[_0xc219('0x1f')](function(_0x32d13e){if(_0x32d13e){return _0x32d13e['addAgents'](_0x200cb1[_0xc219('0x63')][_0xc219('0x72')],_[_0xc219('0x71')](_0x200cb1['body'],['ids','id'])||{})[_0xc219('0xc3')](function(_0xa80a9c){for(var _0x4290a9=0x0;_0x4290a9<_0x200cb1[_0xc219('0x63')][_0xc219('0x72')]['length'];_0x4290a9+=0x1){socket['emit'](_0xc219('0xc4'),{'UserId':Number(_0x200cb1['body'][_0xc219('0x72')][_0x4290a9]),'FaxAccountId':Number(_0x200cb1[_0xc219('0x56')]['id'])});}return _0xa80a9c;});}})[_0xc219('0x1f')](respondWithResult(_0x5ccc3e,null))[_0xc219('0x59')](handleError(_0x5ccc3e,null));};exports[_0xc219('0xc5')]=function(_0x4482a2,_0x53d123,_0x36575a){return db['FaxAccount']['find']({'where':{'id':_0x4482a2[_0xc219('0x56')]['id']}})[_0xc219('0x1f')](handleEntityNotFound(_0x53d123,null))['then'](function(_0x2d8518){if(_0x2d8518){return _0x2d8518[_0xc219('0xc5')](_0x4482a2[_0xc219('0x41')][_0xc219('0x72')])[_0xc219('0x1f')](function(){if(_[_0xc219('0xc6')](_0x4482a2[_0xc219('0x41')][_0xc219('0x72')])){for(var _0x4db85e=0x0;_0x4db85e<_0x4482a2['query']['ids'][_0xc219('0x46')];_0x4db85e+=0x1){socket[_0xc219('0xc7')]('userFaxAccount:remove',{'UserId':Number(_0x4482a2[_0xc219('0x41')][_0xc219('0x72')][_0x4db85e]),'FaxAccountId':Number(_0x4482a2['params']['id'])});}}else{socket[_0xc219('0xc7')]('userFaxAccount:remove',{'UserId':Number(_0x4482a2[_0xc219('0x41')]['ids']),'FaxAccountId':Number(_0x4482a2['params']['id'])});}});}})['then'](respondWithStatusCode(_0x53d123,null))['catch'](handleError(_0x53d123,null));};exports[_0xc219('0xc8')]=function(_0x230649,_0x4b4f69,_0x4fc42c){var _0x13bef2={};var _0x9a6975={};var _0x1b0d97;var _0x2ffe45;return db['FaxAccount'][_0xc219('0x68')]({'where':{'id':_0x230649[_0xc219('0x56')]['id']}})[_0xc219('0x1f')](handleEntityNotFound(_0x4b4f69,null))[_0xc219('0x1f')](function(_0xce9061){if(_0xce9061){_0x1b0d97=_0xce9061;_0x9a6975['model']=_[_0xc219('0x42')](db['User']['rawAttributes']);_0x9a6975[_0xc219('0x41')]=_[_0xc219('0x42')](_0x230649[_0xc219('0x41')]);_0x9a6975[_0xc219('0x4c')]=_[_0xc219('0x43')](_0x9a6975[_0xc219('0x40')],_0x9a6975[_0xc219('0x41')]);_0x13bef2[_0xc219('0x44')]=_[_0xc219('0x43')](_0x9a6975[_0xc219('0x40')],qs[_0xc219('0x45')](_0x230649[_0xc219('0x41')][_0xc219('0x45')]));_0x13bef2[_0xc219('0x44')]=_0x13bef2[_0xc219('0x44')][_0xc219('0x46')]?_0x13bef2[_0xc219('0x44')]:_0x9a6975['model'];_0x13bef2[_0xc219('0x49')]=qs[_0xc219('0x4a')](_0x230649['query'][_0xc219('0x4a')]);_0x13bef2[_0xc219('0x4b')]=qs[_0xc219('0x4c')](_['pick'](_0x230649[_0xc219('0x41')],_0x9a6975[_0xc219('0x4c')]));if(_0x230649[_0xc219('0x41')]['filter']){_0x13bef2[_0xc219('0x4b')]=_[_0xc219('0x4f')](_0x13bef2[_0xc219('0x4b')],{'$or':_['map'](_0x13bef2['attributes'],function(_0xade20){var _0xa265fa={};_0xa265fa[_0xade20]={'$like':'%'+_0x230649[_0xc219('0x41')][_0xc219('0x4e')]+'%'};return _0xa265fa;})});}_0x13bef2=_[_0xc219('0x4f')]({},_0x13bef2,_0x230649[_0xc219('0x51')]);return _0x1b0d97[_0xc219('0xc8')](_0x13bef2);}})[_0xc219('0x1f')](function(_0x32792c){if(_0x32792c){_0x2ffe45=_0x32792c['length'];if(!_0x230649['query'][_0xc219('0x47')](_0xc219('0x48'))){_0x13bef2[_0xc219('0x2f')]=qs[_0xc219('0x2f')](_0x230649[_0xc219('0x41')]['limit']);_0x13bef2[_0xc219('0x2e')]=qs[_0xc219('0x2e')](_0x230649[_0xc219('0x41')][_0xc219('0x2e')]);}return _0x1b0d97['getAgents'](_0x13bef2);}})[_0xc219('0x1f')](function(_0x12126d){if(_0x12126d){return _0x12126d?{'count':_0x2ffe45,'rows':_0x12126d}:null;}})[_0xc219('0x1f')](respondWithResult(_0x4b4f69,null))[_0xc219('0x59')](handleError(_0x4b4f69,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 409e37f..adc57db 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 _0x55e6=['hasOwnProperty','exports','events','../../mysqldb','FaxAccount','setMaxListeners','save','update','remove','emit'];(function(_0x3f3519,_0xd53cae){var _0x23b6bf=function(_0x3b3e52){while(--_0x3b3e52){_0x3f3519['push'](_0x3f3519['shift']());}};_0x23b6bf(++_0xd53cae);}(_0x55e6,0xca));var _0x655e=function(_0x35e950,_0xa88da6){_0x35e950=_0x35e950-0x0;var _0xa61f89=_0x55e6[_0x35e950];return _0xa61f89;};'use strict';var EventEmitter=require(_0x655e('0x0'));var FaxAccount=require(_0x655e('0x1'))['db'][_0x655e('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x655e('0x3')](0x0);var events={'afterCreate':_0x655e('0x4'),'afterUpdate':_0x655e('0x5'),'afterDestroy':_0x655e('0x6')};function emitEvent(_0x42961e){return function(_0x300718,_0x413ff0,_0xf62661){FaxAccountEvents['emit'](_0x42961e+':'+_0x300718['id'],_0x300718);FaxAccountEvents[_0x655e('0x7')](_0x42961e,_0x300718);_0xf62661(null);};}for(var e in events){if(events[_0x655e('0x8')](e)){var event=events[e];FaxAccount['hook'](e,emitEvent(event));}}module[_0x655e('0x9')]=FaxAccountEvents; \ No newline at end of file +var _0xfb65=['hasOwnProperty','hook','exports','events','../../mysqldb','FaxAccount','setMaxListeners','update','remove','emit'];(function(_0x12ad6b,_0x14558e){var _0x37bc97=function(_0xc34ab2){while(--_0xc34ab2){_0x12ad6b['push'](_0x12ad6b['shift']());}};_0x37bc97(++_0x14558e);}(_0xfb65,0xb7));var _0x5fb6=function(_0x1e6cf1,_0x40c6d8){_0x1e6cf1=_0x1e6cf1-0x0;var _0x527676=_0xfb65[_0x1e6cf1];return _0x527676;};'use strict';var EventEmitter=require(_0x5fb6('0x0'));var FaxAccount=require(_0x5fb6('0x1'))['db'][_0x5fb6('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x5fb6('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x5fb6('0x4'),'afterDestroy':_0x5fb6('0x5')};function emitEvent(_0x575a5d){return function(_0x4134fd,_0x2efaca,_0x47711b){FaxAccountEvents[_0x5fb6('0x6')](_0x575a5d+':'+_0x4134fd['id'],_0x4134fd);FaxAccountEvents[_0x5fb6('0x6')](_0x575a5d,_0x4134fd);_0x47711b(null);};}for(var e in events){if(events[_0x5fb6('0x7')](e)){var event=events[e];FaxAccount[_0x5fb6('0x8')](e,emitEvent(event));}}module[_0x5fb6('0x9')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index 794c042..3dc0355 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 _0xd467=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./faxAccount.attributes','define','FaxAccount','fax_accounts'];(function(_0x56e475,_0x329e26){var _0x14358b=function(_0x2254ef){while(--_0x2254ef){_0x56e475['push'](_0x56e475['shift']());}};_0x14358b(++_0x329e26);}(_0xd467,0x82));var _0x7d46=function(_0x243cdb,_0xf79734){_0x243cdb=_0x243cdb-0x0;var _0x9f32c6=_0xd467[_0x243cdb];return _0x9f32c6;};'use strict';var _=require(_0x7d46('0x0'));var util=require(_0x7d46('0x1'));var logger=require(_0x7d46('0x2'))(_0x7d46('0x3'));var moment=require(_0x7d46('0x4'));var BPromise=require(_0x7d46('0x5'));var rp=require(_0x7d46('0x6'));var fs=require('fs');var path=require(_0x7d46('0x7'));var rimraf=require(_0x7d46('0x8'));var config=require('../../config/environment');var attributes=require(_0x7d46('0x9'));module['exports']=function(_0x56c4bb,_0x2914f1){return _0x56c4bb[_0x7d46('0xa')](_0x7d46('0xb'),attributes,{'tableName':_0x7d46('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x052b=['moment','bluebird','request-promise','path','../../config/environment','./faxAccount.attributes','exports','define','fax_accounts','lodash','util','../../config/logger','api'];(function(_0xe539f9,_0x228f3b){var _0x9d8ab6=function(_0x1a8b0b){while(--_0x1a8b0b){_0xe539f9['push'](_0xe539f9['shift']());}};_0x9d8ab6(++_0x228f3b);}(_0x052b,0x18f));var _0xb052=function(_0x26c962,_0x5cc892){_0x26c962=_0x26c962-0x0;var _0x57a373=_0x052b[_0x26c962];return _0x57a373;};'use strict';var _=require(_0xb052('0x0'));var util=require(_0xb052('0x1'));var logger=require(_0xb052('0x2'))(_0xb052('0x3'));var moment=require(_0xb052('0x4'));var BPromise=require(_0xb052('0x5'));var rp=require(_0xb052('0x6'));var fs=require('fs');var path=require(_0xb052('0x7'));var rimraf=require('rimraf');var config=require(_0xb052('0x8'));var attributes=require(_0xb052('0x9'));module[_0xb052('0xa')]=function(_0x1b593a,_0x994c65){return _0x1b593a[_0xb052('0xb')]('FaxAccount',attributes,{'tableName':_0xb052('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.rpc.js b/server/api/faxAccount/faxAccount.rpc.js index e0885e1..8019a24 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 _0x8e52=['Sequelize','ValidationError','difference','keys','createdAt','updatedAt','CompanyId','ListId','body','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','List','DESC','Applications','get','applications','orderBy','priority','asc','Contacts','length','FaxInteraction','create','Contact\x20not\x20found','spread','autoclose','close','*,*,*,*','created','ContactId','AttachmentId','UserId','User','name','interaction','unshift','agent','FaxQueue','queue','waitForTheAssignedQueue','Start','startRouting','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','request','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetFaxAccount','FaxAccount','findAll','options','raw','where','limit','include','map','attributes','model','then','fax','CmContact'];(function(_0x1f0677,_0x337fe0){var _0x48a3a5=function(_0x22736f){while(--_0x22736f){_0x1f0677['push'](_0x1f0677['shift']());}};_0x48a3a5(++_0x337fe0);}(_0x8e52,0x1aa));var _0x28e5=function(_0x51ed62,_0x574379){_0x51ed62=_0x51ed62-0x0;var _0x34aee3=_0x8e52[_0x51ed62];return _0x34aee3;};'use strict';var _=require(_0x28e5('0x0'));var util=require(_0x28e5('0x1'));var moment=require(_0x28e5('0x2'));var BPromise=require(_0x28e5('0x3'));var rs=require(_0x28e5('0x4'));var fs=require('fs');var Redis=require(_0x28e5('0x5'));var db=require(_0x28e5('0x6'))['db'];var utils=require(_0x28e5('0x7'));var logger=require(_0x28e5('0x8'))('rpc');var config=require(_0x28e5('0x9'));var jayson=require(_0x28e5('0xa'));var client=jayson[_0x28e5('0xb')][_0x28e5('0xc')]({'port':0x232c});config[_0x28e5('0xd')]=_[_0x28e5('0xe')](config[_0x28e5('0xd')],{'host':_0x28e5('0xf'),'port':0x18eb});var socket=require(_0x28e5('0x10'))(new Redis(config[_0x28e5('0xd')]));require(_0x28e5('0x11'))[_0x28e5('0x12')](socket);function respondWithRpcPromise(_0x29e609,_0x597dc6,_0x33c555){return new BPromise(function(_0x5e6dab,_0x2a1809){return client[_0x28e5('0x13')](_0x29e609,_0x33c555)['then'](function(_0x3c3241){logger[_0x28e5('0x14')](_0x28e5('0x15'),_0x597dc6,_0x28e5('0x16'));logger[_0x28e5('0x17')](_0x28e5('0x18'),_0x597dc6,_0x28e5('0x16'),JSON[_0x28e5('0x19')](_0x3c3241));if(_0x3c3241['error']){if(_0x3c3241[_0x28e5('0x1a')][_0x28e5('0x1b')]===0x1f4){logger['error'](_0x28e5('0x15'),_0x597dc6,_0x3c3241[_0x28e5('0x1a')][_0x28e5('0x1c')]);return _0x2a1809(_0x3c3241[_0x28e5('0x1a')][_0x28e5('0x1c')]);}logger[_0x28e5('0x1a')]('FaxAccount,\x20%s,\x20%s',_0x597dc6,_0x3c3241['error'][_0x28e5('0x1c')]);return _0x5e6dab(_0x3c3241[_0x28e5('0x1a')][_0x28e5('0x1c')]);}else{logger[_0x28e5('0x14')](_0x28e5('0x15'),_0x597dc6,'request\x20sent');_0x5e6dab(_0x3c3241['result'][_0x28e5('0x1c')]);}})[_0x28e5('0x1d')](function(_0x2168fe){logger[_0x28e5('0x1a')]('FaxAccount,\x20%s,\x20%s',_0x597dc6,_0x2168fe);_0x2a1809(_0x2168fe);});});}exports[_0x28e5('0x1e')]=function(_0x7b2473){var _0x3ca9c7=this;return new Promise(function(_0x1fdcb8,_0x27e493){return db[_0x28e5('0x1f')][_0x28e5('0x20')]({'raw':_0x7b2473[_0x28e5('0x21')]?_0x7b2473[_0x28e5('0x21')][_0x28e5('0x22')]===undefined?!![]:![]:!![],'where':_0x7b2473[_0x28e5('0x21')]?_0x7b2473[_0x28e5('0x21')][_0x28e5('0x23')]||null:null,'attributes':_0x7b2473[_0x28e5('0x21')]?_0x7b2473[_0x28e5('0x21')]['attributes']||null:null,'limit':_0x7b2473[_0x28e5('0x21')]?_0x7b2473[_0x28e5('0x21')][_0x28e5('0x24')]||null:null,'include':_0x7b2473[_0x28e5('0x21')]?_0x7b2473[_0x28e5('0x21')][_0x28e5('0x25')]?_[_0x28e5('0x26')](_0x7b2473['options'][_0x28e5('0x25')],function(_0x470915){return{'model':db[_0x470915['model']],'as':_0x470915['as'],'attributes':_0x470915[_0x28e5('0x27')],'include':_0x470915[_0x28e5('0x25')]?_[_0x28e5('0x26')](_0x470915[_0x28e5('0x25')],function(_0x2976ae){return{'model':db[_0x2976ae[_0x28e5('0x28')]],'as':_0x2976ae['as'],'attributes':_0x2976ae[_0x28e5('0x27')],'include':_0x2976ae[_0x28e5('0x25')]?_[_0x28e5('0x26')](_0x2976ae[_0x28e5('0x25')],function(_0x31be95){return{'model':db[_0x31be95[_0x28e5('0x28')]],'as':_0x31be95['as'],'attributes':_0x31be95[_0x28e5('0x27')]};}):[]};}):[]};}):[]:[]})[_0x28e5('0x29')](function(_0x38643e){logger[_0x28e5('0x14')](_0x28e5('0x1e'),_0x7b2473);logger[_0x28e5('0x17')](_0x28e5('0x1e'),_0x7b2473,JSON['stringify'](_0x38643e));_0x1fdcb8(_0x38643e);})[_0x28e5('0x1d')](function(_0x158c52){logger[_0x28e5('0x1a')](_0x28e5('0x1e'),_0x158c52['message'],_0x7b2473);_0x27e493(_0x3ca9c7[_0x28e5('0x1a')](0x1f4,_0x158c52[_0x28e5('0x1c')]));});});};exports['NotifyFaxAccount']=function(_0x66c6e1,_0x22ecc3,_0x4f1f28){var _0x5a9076=this;return new Promise(function(_0x2fa7c0,_0x7c55f){var _0x205494={'body':_0x66c6e1['body'],'channel':_0x28e5('0x2a')};var _0x15f8a4=[];var _0x3da5df=[];var _0x964890={};return db[_0x28e5('0x2b')]['describe']()[_0x28e5('0x29')](function(_0x2193f9){if(!_0x2193f9){throw new db[(_0x28e5('0x2c'))][(_0x28e5('0x2d'))]('no\x20available\x20attributes');}_0x15f8a4=_[_0x28e5('0x2e')](_[_0x28e5('0x2f')](_0x2193f9),[_0x28e5('0x30'),_0x28e5('0x31')]);_0x3da5df=_[_0x28e5('0x2e')](_[_0x28e5('0x2f')](_0x2193f9),['createdAt',_0x28e5('0x31'),_0x28e5('0x32'),_0x28e5('0x33')]);if(_0x66c6e1[_0x28e5('0x34')]['id']){delete _0x66c6e1[_0x28e5('0x34')]['id'];}if(_[_0x28e5('0x35')](_0x66c6e1[_0x28e5('0x34')][_0x28e5('0x36')])){throw new db[(_0x28e5('0x2c'))][(_0x28e5('0x2d'))](_0x28e5('0x37'));}if(_[_0x28e5('0x35')](_0x66c6e1[_0x28e5('0x34')]['body'])||_0x66c6e1[_0x28e5('0x34')][_0x28e5('0x34')]===''){throw new db[(_0x28e5('0x2c'))][(_0x28e5('0x2d'))](_0x28e5('0x38'));}if(_[_0x28e5('0x35')](_0x66c6e1['body'][_0x28e5('0x39')])){throw new db[(_0x28e5('0x2c'))][(_0x28e5('0x2d'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3da5df);}if(!_[_0x28e5('0x3a')](_0x3da5df,_0x66c6e1[_0x28e5('0x34')][_0x28e5('0x39')])){throw new db[(_0x28e5('0x2c'))][(_0x28e5('0x2d'))](_0x28e5('0x3b')+_0x3da5df);}_0x964890[_0x66c6e1[_0x28e5('0x34')][_0x28e5('0x39')]]=_0x66c6e1['body'][_0x28e5('0x36')];})[_0x28e5('0x29')](function(){return db[_0x28e5('0x1f')][_0x28e5('0x3c')]({'where':{'id':_0x66c6e1[_0x28e5('0x3d')]['id']},'include':[{'model':db[_0x28e5('0x3e')],'as':_0x28e5('0x3f'),'include':[{'model':db[_0x28e5('0x2b')],'as':'Contacts','where':_0x964890,'limit':0x1,'order':[[_0x28e5('0x31'),_0x28e5('0x40')]]}]},{'model':db['FaxApplication'],'as':_0x28e5('0x41')}]});})[_0x28e5('0x29')](function(_0x28dbc9){if(_0x28dbc9&&_0x28dbc9['List']){var _0x114f35=_0x28dbc9[_0x28e5('0x42')]({'plain':!![]});_0x205494['account']=_0x114f35;_0x205494[_0x28e5('0x43')]=_0x114f35[_0x28e5('0x41')];_0x205494['list']=_0x114f35['List'];_0x205494[_0x28e5('0x43')]=_[_0x28e5('0x44')](_0x205494['applications'],[_0x28e5('0x45')],[_0x28e5('0x46')]);if(_0x205494[_0x28e5('0x3d')][_0x28e5('0x41')]){delete _0x205494['account']['Applications'];}if(_0x205494[_0x28e5('0x3d')][_0x28e5('0x3f')]&&_0x205494[_0x28e5('0x3d')]['List'][_0x28e5('0x47')][_0x28e5('0x48')]){return _0x205494['account']['List'][_0x28e5('0x47')][0x0];}var _0x77b187=_[_0x28e5('0xe')](_0x66c6e1['body'],{'firstName':_0x66c6e1[_0x28e5('0x34')]['from'],'ListId':_0x114f35[_0x28e5('0x33')]});_0x77b187[_0x66c6e1['body'][_0x28e5('0x39')]]=_0x66c6e1[_0x28e5('0x34')]['from'];return db[_0x28e5('0x2b')]['create'](_0x77b187,{'fields':_0x15f8a4,'raw':!![]});}})[_0x28e5('0x29')](function(_0x1f4e5f){_0x205494['contact']=_0x1f4e5f;if(_0x1f4e5f){var _0x3c65da={'ContactId':_0x1f4e5f['id'],'FaxAccountId':_0x66c6e1[_0x28e5('0x3d')]['id'],'fax':_0x1f4e5f[_0x28e5('0x2a')]};return db[_0x28e5('0x49')][_0x28e5('0x3c')]({'where':{'ContactId':_0x1f4e5f['id'],'closed':![],'FaxAccountId':_0x66c6e1[_0x28e5('0x3d')]['id']}})[_0x28e5('0x29')](function(_0x3a715e){if(_0x3a715e){return[_0x3a715e,![]];}return db['FaxInteraction'][_0x28e5('0x4a')](_0x3c65da)[_0x28e5('0x29')](function(_0x1fd4bf){return[_0x1fd4bf,!![]];});});}else{throw new Error(_0x28e5('0x4b'));}})[_0x28e5('0x4c')](function(_0x2b5954,_0x39f4f1){var _0x5c001d=_0x2b5954[_0x28e5('0x42')]({'plain':!![]});if(_0x39f4f1){if(_0x205494[_0x28e5('0x3d')][_0x28e5('0x4d')]){_0x205494[_0x28e5('0x43')]['push']({'id':0x0,'priority':_0x205494[_0x28e5('0x43')]['length']+0x1,'app':_0x28e5('0x4e'),'appdata':'unmanaged','interval':_0x28e5('0x4f')});}_0x5c001d['created']=!![];}else{_0x5c001d[_0x28e5('0x50')]=![];}_0x205494['interaction']=_0x5c001d;return db['FaxMessage'][_0x28e5('0x4a')]({'body':_0x66c6e1[_0x28e5('0x34')][_0x28e5('0x34')],'FaxAccountId':_0x66c6e1[_0x28e5('0x3d')]['id'],'FaxInteractionId':_0x2b5954['id'],'direction':'in','ContactId':_0x2b5954[_0x28e5('0x51')],'AttachmentId':_0x66c6e1[_0x28e5('0x34')][_0x28e5('0x52')]});})['then'](function(_0x3e8848){_0x205494[_0x28e5('0x1c')]=_0x3e8848;if(!_0x205494['interaction'][_0x28e5('0x53')])return;return db[_0x28e5('0x54')][_0x28e5('0x3c')]({'attributes':['id',_0x28e5('0x55')],'where':{'id':_0x205494[_0x28e5('0x56')]['UserId']}});})['then'](function(_0x5a7449){if(_0x5a7449){_0x205494[_0x28e5('0x43')][_0x28e5('0x57')]({'id':0x0,'priority':0x0,'app':_0x28e5('0x58'),'appdata':_0x5a7449[_0x28e5('0x55')]+','+(_0x205494[_0x28e5('0x3d')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});}if(!_0x205494[_0x28e5('0x56')]['queueId'])return;return db[_0x28e5('0x59')][_0x28e5('0x3c')]({'attributes':['id','name'],'where':{'id':_0x205494[_0x28e5('0x56')]['queueId']}});})['then'](function(_0x267d8c){if(_0x267d8c){_0x205494[_0x28e5('0x43')][_0x28e5('0x57')]({'id':0x0,'priority':0x1,'app':_0x28e5('0x5a'),'appdata':_0x267d8c[_0x28e5('0x55')]+','+(_0x205494[_0x28e5('0x3d')][_0x28e5('0x5b')]||0x12c),'interval':_0x28e5('0x4f')});}return respondWithRpcPromise(_0x28e5('0x5c'),_0x28e5('0x5d'),_0x205494);})['then'](function(_0x4ca389){_0x2fa7c0(_0x4ca389);})[_0x28e5('0x1d')](function(_0x26502f){_0x7c55f(_0x5a9076[_0x28e5('0x1a')](0x1f4,_0x26502f[_0x28e5('0x1c')]));});});}; \ No newline at end of file +var _0x6399=['no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','isNil','from','Sequelize','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','FaxAccount','find','account','CmList','List','Contacts','Applications','get','applications','orderBy','priority','asc','length','create','FaxInteraction','Contact\x20not\x20found','autoclose','push','close','unmanaged','created','interaction','ContactId','AttachmentId','UserId','User','name','waitForTheAssignedAgent','*,*,*,*','FaxQueue','unshift','queue','Start','startRouting','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','register','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFaxAccount','findAll','options','raw','attributes','limit','include','map','model','body','fax','CmContact','describe','ValidationError'];(function(_0x29d4b5,_0x1913e2){var _0x3fbb01=function(_0x8b0a41){while(--_0x8b0a41){_0x29d4b5['push'](_0x29d4b5['shift']());}};_0x3fbb01(++_0x1913e2);}(_0x6399,0x1f2));var _0x9639=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x6399[_0x4243a3];return _0x1b2a33;};'use strict';var _=require(_0x9639('0x0'));var util=require(_0x9639('0x1'));var moment=require('moment');var BPromise=require(_0x9639('0x2'));var rs=require(_0x9639('0x3'));var fs=require('fs');var Redis=require(_0x9639('0x4'));var db=require(_0x9639('0x5'))['db'];var utils=require(_0x9639('0x6'));var logger=require(_0x9639('0x7'))('rpc');var config=require(_0x9639('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9639('0x9')]['http']({'port':0x232c});config[_0x9639('0xa')]=_[_0x9639('0xb')](config['redis'],{'host':_0x9639('0xc'),'port':0x18eb});var socket=require(_0x9639('0xd'))(new Redis(config['redis']));require('./faxAccount.socket')[_0x9639('0xe')](socket);function respondWithRpcPromise(_0x3e1735,_0x2cf239,_0x24af27){return new BPromise(function(_0x160c7d,_0x3a095f){return client[_0x9639('0xf')](_0x3e1735,_0x24af27)[_0x9639('0x10')](function(_0x23bb23){logger[_0x9639('0x11')](_0x9639('0x12'),_0x2cf239,_0x9639('0x13'));logger[_0x9639('0x14')](_0x9639('0x15'),_0x2cf239,_0x9639('0x13'),JSON[_0x9639('0x16')](_0x23bb23));if(_0x23bb23['error']){if(_0x23bb23[_0x9639('0x17')][_0x9639('0x18')]===0x1f4){logger['error'](_0x9639('0x12'),_0x2cf239,_0x23bb23[_0x9639('0x17')]['message']);return _0x3a095f(_0x23bb23['error'][_0x9639('0x19')]);}logger[_0x9639('0x17')]('FaxAccount,\x20%s,\x20%s',_0x2cf239,_0x23bb23['error'][_0x9639('0x19')]);return _0x160c7d(_0x23bb23[_0x9639('0x17')]['message']);}else{logger[_0x9639('0x11')](_0x9639('0x12'),_0x2cf239,'request\x20sent');_0x160c7d(_0x23bb23[_0x9639('0x1a')][_0x9639('0x19')]);}})[_0x9639('0x1b')](function(_0x48dec){logger[_0x9639('0x17')](_0x9639('0x12'),_0x2cf239,_0x48dec);_0x3a095f(_0x48dec);});});}exports[_0x9639('0x1c')]=function(_0x19df71){var _0x37a0e9=this;return new Promise(function(_0x311598,_0x345277){return db['FaxAccount'][_0x9639('0x1d')]({'raw':_0x19df71[_0x9639('0x1e')]?_0x19df71[_0x9639('0x1e')][_0x9639('0x1f')]===undefined?!![]:![]:!![],'where':_0x19df71[_0x9639('0x1e')]?_0x19df71['options']['where']||null:null,'attributes':_0x19df71[_0x9639('0x1e')]?_0x19df71[_0x9639('0x1e')][_0x9639('0x20')]||null:null,'limit':_0x19df71[_0x9639('0x1e')]?_0x19df71['options'][_0x9639('0x21')]||null:null,'include':_0x19df71['options']?_0x19df71[_0x9639('0x1e')][_0x9639('0x22')]?_[_0x9639('0x23')](_0x19df71[_0x9639('0x1e')][_0x9639('0x22')],function(_0x4f47bd){return{'model':db[_0x4f47bd[_0x9639('0x24')]],'as':_0x4f47bd['as'],'attributes':_0x4f47bd[_0x9639('0x20')],'include':_0x4f47bd[_0x9639('0x22')]?_[_0x9639('0x23')](_0x4f47bd['include'],function(_0x155a8a){return{'model':db[_0x155a8a['model']],'as':_0x155a8a['as'],'attributes':_0x155a8a['attributes'],'include':_0x155a8a['include']?_['map'](_0x155a8a[_0x9639('0x22')],function(_0x358590){return{'model':db[_0x358590['model']],'as':_0x358590['as'],'attributes':_0x358590[_0x9639('0x20')]};}):[]};}):[]};}):[]:[]})[_0x9639('0x10')](function(_0x123abb){logger['info'](_0x9639('0x1c'),_0x19df71);logger['debug'](_0x9639('0x1c'),_0x19df71,JSON[_0x9639('0x16')](_0x123abb));_0x311598(_0x123abb);})[_0x9639('0x1b')](function(_0x507666){logger[_0x9639('0x17')](_0x9639('0x1c'),_0x507666[_0x9639('0x19')],_0x19df71);_0x345277(_0x37a0e9[_0x9639('0x17')](0x1f4,_0x507666[_0x9639('0x19')]));});});};exports['NotifyFaxAccount']=function(_0xd4d423,_0x37afd2,_0x50838f){var _0x1b25ba=this;return new Promise(function(_0x189d98,_0x48c924){var _0x5ebf1d={'body':_0xd4d423[_0x9639('0x25')],'channel':_0x9639('0x26')};var _0x565720=[];var _0x314240=[];var _0x43cee9={};return db[_0x9639('0x27')][_0x9639('0x28')]()[_0x9639('0x10')](function(_0x5e6d0a){if(!_0x5e6d0a){throw new db['Sequelize'][(_0x9639('0x29'))](_0x9639('0x2a'));}_0x565720=_[_0x9639('0x2b')](_['keys'](_0x5e6d0a),[_0x9639('0x2c'),_0x9639('0x2d')]);_0x314240=_[_0x9639('0x2b')](_['keys'](_0x5e6d0a),[_0x9639('0x2c'),_0x9639('0x2d'),_0x9639('0x2e'),_0x9639('0x2f')]);if(_0xd4d423[_0x9639('0x25')]['id']){delete _0xd4d423[_0x9639('0x25')]['id'];}if(_[_0x9639('0x30')](_0xd4d423[_0x9639('0x25')][_0x9639('0x31')])){throw new db[(_0x9639('0x32'))][(_0x9639('0x29'))](_0x9639('0x33'));}if(_[_0x9639('0x30')](_0xd4d423['body'][_0x9639('0x25')])||_0xd4d423['body'][_0x9639('0x25')]===''){throw new db[(_0x9639('0x32'))][(_0x9639('0x29'))](_0x9639('0x34'));}if(_[_0x9639('0x30')](_0xd4d423['body'][_0x9639('0x35')])){throw new db[(_0x9639('0x32'))][(_0x9639('0x29'))](_0x9639('0x36')+_0x314240);}if(!_['includes'](_0x314240,_0xd4d423[_0x9639('0x25')][_0x9639('0x35')])){throw new db['Sequelize'][(_0x9639('0x29'))](_0x9639('0x37')+_0x314240);}_0x43cee9[_0xd4d423[_0x9639('0x25')][_0x9639('0x35')]]=_0xd4d423[_0x9639('0x25')][_0x9639('0x31')];})[_0x9639('0x10')](function(){return db[_0x9639('0x38')][_0x9639('0x39')]({'where':{'id':_0xd4d423[_0x9639('0x3a')]['id']},'include':[{'model':db[_0x9639('0x3b')],'as':_0x9639('0x3c'),'include':[{'model':db['CmContact'],'as':_0x9639('0x3d'),'where':_0x43cee9,'limit':0x1,'order':[[_0x9639('0x2d'),'DESC']]}]},{'model':db['FaxApplication'],'as':_0x9639('0x3e')}]});})[_0x9639('0x10')](function(_0x41fc12){if(_0x41fc12&&_0x41fc12[_0x9639('0x3c')]){var _0x5def3a=_0x41fc12[_0x9639('0x3f')]({'plain':!![]});_0x5ebf1d[_0x9639('0x3a')]=_0x5def3a;_0x5ebf1d['applications']=_0x5def3a[_0x9639('0x3e')];_0x5ebf1d['list']=_0x5def3a[_0x9639('0x3c')];_0x5ebf1d[_0x9639('0x40')]=_[_0x9639('0x41')](_0x5ebf1d[_0x9639('0x40')],[_0x9639('0x42')],[_0x9639('0x43')]);if(_0x5ebf1d[_0x9639('0x3a')][_0x9639('0x3e')]){delete _0x5ebf1d[_0x9639('0x3a')][_0x9639('0x3e')];}if(_0x5ebf1d[_0x9639('0x3a')][_0x9639('0x3c')]&&_0x5ebf1d['account']['List'][_0x9639('0x3d')][_0x9639('0x44')]){return _0x5ebf1d[_0x9639('0x3a')][_0x9639('0x3c')]['Contacts'][0x0];}var _0x43b5dd=_['defaults'](_0xd4d423['body'],{'firstName':_0xd4d423[_0x9639('0x25')][_0x9639('0x31')],'ListId':_0x5def3a['ListId']});_0x43b5dd[_0xd4d423[_0x9639('0x25')]['mapKey']]=_0xd4d423[_0x9639('0x25')][_0x9639('0x31')];return db['CmContact'][_0x9639('0x45')](_0x43b5dd,{'fields':_0x565720,'raw':!![]});}})['then'](function(_0x183e1d){_0x5ebf1d['contact']=_0x183e1d;if(_0x183e1d){var _0x538cb9={'ContactId':_0x183e1d['id'],'FaxAccountId':_0xd4d423[_0x9639('0x3a')]['id'],'fax':_0x183e1d[_0x9639('0x26')]};return db[_0x9639('0x46')]['find']({'where':{'ContactId':_0x183e1d['id'],'closed':![],'FaxAccountId':_0xd4d423[_0x9639('0x3a')]['id']}})[_0x9639('0x10')](function(_0x3d3edd){if(_0x3d3edd){return[_0x3d3edd,![]];}return db[_0x9639('0x46')][_0x9639('0x45')](_0x538cb9)[_0x9639('0x10')](function(_0x896b15){return[_0x896b15,!![]];});});}else{throw new Error(_0x9639('0x47'));}})['spread'](function(_0x1cfb15,_0x4e6120){var _0x4f5522=_0x1cfb15['get']({'plain':!![]});if(_0x4e6120){if(_0x5ebf1d[_0x9639('0x3a')][_0x9639('0x48')]){_0x5ebf1d[_0x9639('0x40')][_0x9639('0x49')]({'id':0x0,'priority':_0x5ebf1d[_0x9639('0x40')][_0x9639('0x44')]+0x1,'app':_0x9639('0x4a'),'appdata':_0x9639('0x4b'),'interval':'*,*,*,*'});}_0x4f5522['created']=!![];}else{_0x4f5522[_0x9639('0x4c')]=![];}_0x5ebf1d[_0x9639('0x4d')]=_0x4f5522;return db['FaxMessage'][_0x9639('0x45')]({'body':_0xd4d423[_0x9639('0x25')][_0x9639('0x25')],'FaxAccountId':_0xd4d423[_0x9639('0x3a')]['id'],'FaxInteractionId':_0x1cfb15['id'],'direction':'in','ContactId':_0x1cfb15[_0x9639('0x4e')],'AttachmentId':_0xd4d423[_0x9639('0x25')][_0x9639('0x4f')]});})[_0x9639('0x10')](function(_0x2b0ee4){_0x5ebf1d[_0x9639('0x19')]=_0x2b0ee4;if(!_0x5ebf1d[_0x9639('0x4d')][_0x9639('0x50')])return;return db[_0x9639('0x51')][_0x9639('0x39')]({'attributes':['id','name'],'where':{'id':_0x5ebf1d[_0x9639('0x4d')][_0x9639('0x50')]}});})[_0x9639('0x10')](function(_0x181c07){if(_0x181c07){_0x5ebf1d['applications']['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x181c07[_0x9639('0x52')]+','+(_0x5ebf1d[_0x9639('0x3a')][_0x9639('0x53')]||0xa),'interval':_0x9639('0x54')});}if(!_0x5ebf1d[_0x9639('0x4d')]['queueId'])return;return db[_0x9639('0x55')][_0x9639('0x39')]({'attributes':['id','name'],'where':{'id':_0x5ebf1d[_0x9639('0x4d')]['queueId']}});})[_0x9639('0x10')](function(_0x45ea7d){if(_0x45ea7d){_0x5ebf1d[_0x9639('0x40')][_0x9639('0x56')]({'id':0x0,'priority':0x1,'app':_0x9639('0x57'),'appdata':_0x45ea7d[_0x9639('0x52')]+','+(_0x5ebf1d[_0x9639('0x3a')]['waitForTheAssignedQueue']||0x12c),'interval':_0x9639('0x54')});}return respondWithRpcPromise(_0x9639('0x58'),_0x9639('0x59'),_0x5ebf1d);})['then'](function(_0x5e0608){_0x189d98(_0x5e0608);})[_0x9639('0x1b')](function(_0x1498c7){_0x48c924(_0x1b25ba['error'](0x1f4,_0x1498c7[_0x9639('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 169677f..7a00e5d 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 _0xdbea=['remove','emit','register','faxAccount:','./faxAccount.events','save'];(function(_0x37f6e3,_0x157758){var _0x15a502=function(_0x19e4d0){while(--_0x19e4d0){_0x37f6e3['push'](_0x37f6e3['shift']());}};_0x15a502(++_0x157758);}(_0xdbea,0x9a));var _0xadbe=function(_0xab804a,_0x576bb0){_0xab804a=_0xab804a-0x0;var _0x208c62=_0xdbea[_0xab804a];return _0x208c62;};'use strict';var FaxAccountEvents=require(_0xadbe('0x0'));var events=[_0xadbe('0x1'),_0xadbe('0x2'),'update'];function createListener(_0x4a8802,_0x58a58e){return function(_0x50bad9){_0x58a58e[_0xadbe('0x3')](_0x4a8802,_0x50bad9);};}function removeListener(_0x16b6d9,_0x3300fd){return function(){FaxAccountEvents['removeListener'](_0x16b6d9,_0x3300fd);};}exports[_0xadbe('0x4')]=function(_0x42854b){for(var _0x24b5d9=0x0,_0x152f5a=events['length'];_0x24b5d9<_0x152f5a;_0x24b5d9++){var _0x43f61c=events[_0x24b5d9];var _0x221984=createListener(_0xadbe('0x5')+_0x43f61c,_0x42854b);FaxAccountEvents['on'](_0x43f61c,_0x221984);}}; \ No newline at end of file +var _0x799b=['./faxAccount.events','remove','update','emit','removeListener','register','length','faxAccount:'];(function(_0x149e7f,_0x336baf){var _0x3222aa=function(_0x930e54){while(--_0x930e54){_0x149e7f['push'](_0x149e7f['shift']());}};_0x3222aa(++_0x336baf);}(_0x799b,0xa0));var _0xb799=function(_0x32a42c,_0x5bffda){_0x32a42c=_0x32a42c-0x0;var _0x272fc9=_0x799b[_0x32a42c];return _0x272fc9;};'use strict';var FaxAccountEvents=require(_0xb799('0x0'));var events=['save',_0xb799('0x1'),_0xb799('0x2')];function createListener(_0x1012e4,_0x75f956){return function(_0x26cc19){_0x75f956[_0xb799('0x3')](_0x1012e4,_0x26cc19);};}function removeListener(_0x48eecd,_0x1d8d65){return function(){FaxAccountEvents[_0xb799('0x4')](_0x48eecd,_0x1d8d65);};}exports[_0xb799('0x5')]=function(_0x4a68bc){for(var _0x1ed5be=0x0,_0x1270e7=events[_0xb799('0x6')];_0x1ed5be<_0x1270e7;_0x1ed5be++){var _0x505c63=events[_0x1ed5be];var _0x4072a2=createListener(_0xb799('0x7')+_0x505c63,_0x4a68bc);FaxAccountEvents['on'](_0x505c63,_0x4072a2);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index e2bca77..2eb50c2 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 _0x4950=['create','/:id/canned_answers','/:id/interactions','addApplications','addAccountApplications','/updateaccountapplications','/:id/send','addAgents','put','update','destroy','delete','removeDispositions','removeAgents','multer','util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','./faxAccount.controller','index','get','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications','/:id/messages','getMessages','/:id/users','getAgents','post'];(function(_0x487c74,_0x59850e){var _0x311f9a=function(_0x538b58){while(--_0x538b58){_0x487c74['push'](_0x487c74['shift']());}};_0x311f9a(++_0x59850e);}(_0x4950,0x1b0));var _0x0495=function(_0x139243,_0x526487){_0x139243=_0x139243-0x0;var _0x3f9e74=_0x4950[_0x139243];return _0x3f9e74;};'use strict';var multer=require(_0x0495('0x0'));var util=require(_0x0495('0x1'));var path=require(_0x0495('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0495('0x3')]();var fs_extra=require(_0x0495('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x0495('0x5'));var config=require(_0x0495('0x6'));var controller=require(_0x0495('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x0495('0x8')]);router[_0x0495('0x9')]('/describe',auth[_0x0495('0xa')](),controller[_0x0495('0xb')]);router['get'](_0x0495('0xc'),auth[_0x0495('0xa')](),controller[_0x0495('0xd')]);router[_0x0495('0x9')](_0x0495('0xe'),auth[_0x0495('0xa')](),controller[_0x0495('0xf')]);router['get']('/:id/canned_answers',auth[_0x0495('0xa')](),controller[_0x0495('0x10')]);router[_0x0495('0x9')]('/:id/interactions',auth[_0x0495('0xa')](),controller['getInteractions']);router[_0x0495('0x9')](_0x0495('0x11'),auth[_0x0495('0xa')](),controller[_0x0495('0x12')]);router[_0x0495('0x9')](_0x0495('0x13'),auth[_0x0495('0xa')](),controller[_0x0495('0x14')]);router[_0x0495('0x9')](_0x0495('0x15'),auth[_0x0495('0xa')](),controller[_0x0495('0x16')]);router[_0x0495('0x17')]('/',auth[_0x0495('0xa')](),controller[_0x0495('0x18')]);router[_0x0495('0x17')](_0x0495('0xe'),auth[_0x0495('0xa')](),controller['addDisposition']);router[_0x0495('0x17')](_0x0495('0x19'),auth[_0x0495('0xa')](),controller['addAnswer']);router['post'](_0x0495('0x1a'),auth[_0x0495('0xa')](),controller['addInteraction']);router[_0x0495('0x17')](_0x0495('0x11'),auth['isAuthenticated'](),controller[_0x0495('0x1b')]);router[_0x0495('0x17')]('/addaccountapplications',auth['isAuthenticated'](),controller[_0x0495('0x1c')]);router[_0x0495('0x17')](_0x0495('0x1d'),auth['isAuthenticated'](),controller['updateAccountApplications']);router[_0x0495('0x17')](_0x0495('0x1e'),auth['isAuthenticated'](),controller['send']);router['post']('/:id/users',auth[_0x0495('0xa')](),controller[_0x0495('0x1f')]);router[_0x0495('0x20')]('/:id',auth[_0x0495('0xa')](),controller[_0x0495('0x21')]);router['delete'](_0x0495('0xc'),auth['isAuthenticated'](),controller[_0x0495('0x22')]);router[_0x0495('0x23')](_0x0495('0xe'),auth[_0x0495('0xa')](),controller[_0x0495('0x24')]);router[_0x0495('0x23')](_0x0495('0x19'),auth['isAuthenticated'](),controller['removeAnswers']);router['delete'](_0x0495('0x15'),auth[_0x0495('0xa')](),controller[_0x0495('0x25')]);module['exports']=router; \ No newline at end of file +var _0x4dd5=['addDisposition','addAnswer','addInteraction','addApplications','addAccountApplications','/updateaccountapplications','/:id/send','send','addAgents','put','update','delete','removeDispositions','removeAnswers','removeAgents','exports','util','connect-timeout','express','Router','../../components/auth/service','get','index','/describe','describe','/:id','isAuthenticated','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getInteractions','getApplications','/:id/users','getAgents','post','create'];(function(_0x236dbd,_0x77c61d){var _0x5fae80=function(_0x1c9729){while(--_0x1c9729){_0x236dbd['push'](_0x236dbd['shift']());}};_0x5fae80(++_0x77c61d);}(_0x4dd5,0xce));var _0x54dd=function(_0x19d9b7,_0x5dc707){_0x19d9b7=_0x19d9b7-0x0;var _0x1f77ab=_0x4dd5[_0x19d9b7];return _0x1f77ab;};'use strict';var multer=require('multer');var util=require(_0x54dd('0x0'));var path=require('path');var timeout=require(_0x54dd('0x1'));var express=require(_0x54dd('0x2'));var router=express[_0x54dd('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x54dd('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./faxAccount.controller');router[_0x54dd('0x5')]('/',auth['isAuthenticated'](),controller[_0x54dd('0x6')]);router[_0x54dd('0x5')](_0x54dd('0x7'),auth['isAuthenticated'](),controller[_0x54dd('0x8')]);router[_0x54dd('0x5')](_0x54dd('0x9'),auth[_0x54dd('0xa')](),controller[_0x54dd('0xb')]);router['get'](_0x54dd('0xc'),auth[_0x54dd('0xa')](),controller[_0x54dd('0xd')]);router[_0x54dd('0x5')](_0x54dd('0xe'),auth[_0x54dd('0xa')](),controller[_0x54dd('0xf')]);router[_0x54dd('0x5')]('/:id/interactions',auth[_0x54dd('0xa')](),controller[_0x54dd('0x10')]);router[_0x54dd('0x5')]('/:id/applications',auth[_0x54dd('0xa')](),controller[_0x54dd('0x11')]);router[_0x54dd('0x5')]('/:id/messages',auth[_0x54dd('0xa')](),controller['getMessages']);router[_0x54dd('0x5')](_0x54dd('0x12'),auth[_0x54dd('0xa')](),controller[_0x54dd('0x13')]);router[_0x54dd('0x14')]('/',auth[_0x54dd('0xa')](),controller[_0x54dd('0x15')]);router['post'](_0x54dd('0xc'),auth[_0x54dd('0xa')](),controller[_0x54dd('0x16')]);router[_0x54dd('0x14')](_0x54dd('0xe'),auth[_0x54dd('0xa')](),controller[_0x54dd('0x17')]);router[_0x54dd('0x14')]('/:id/interactions',auth[_0x54dd('0xa')](),controller[_0x54dd('0x18')]);router[_0x54dd('0x14')]('/:id/applications',auth['isAuthenticated'](),controller[_0x54dd('0x19')]);router[_0x54dd('0x14')]('/addaccountapplications',auth['isAuthenticated'](),controller[_0x54dd('0x1a')]);router['post'](_0x54dd('0x1b'),auth[_0x54dd('0xa')](),controller['updateAccountApplications']);router['post'](_0x54dd('0x1c'),auth[_0x54dd('0xa')](),controller[_0x54dd('0x1d')]);router[_0x54dd('0x14')](_0x54dd('0x12'),auth['isAuthenticated'](),controller[_0x54dd('0x1e')]);router[_0x54dd('0x1f')]('/:id',auth[_0x54dd('0xa')](),controller[_0x54dd('0x20')]);router[_0x54dd('0x21')](_0x54dd('0x9'),auth['isAuthenticated'](),controller['destroy']);router[_0x54dd('0x21')](_0x54dd('0xc'),auth['isAuthenticated'](),controller[_0x54dd('0x22')]);router['delete']('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x54dd('0x23')]);router[_0x54dd('0x21')](_0x54dd('0x12'),auth[_0x54dd('0xa')](),controller[_0x54dd('0x24')]);module[_0x54dd('0x25')]=router; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.attributes.js b/server/api/faxApplication/faxApplication.attributes.js index c1ab8a4..e3bc72b 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 _0x17eb=['exports','STRING','noop','*,*,*,*','sequelize'];(function(_0x345f0d,_0x42b443){var _0x33c03c=function(_0x2efd4f){while(--_0x2efd4f){_0x345f0d['push'](_0x345f0d['shift']());}};_0x33c03c(++_0x42b443);}(_0x17eb,0x11c));var _0xb17e=function(_0x45d92f,_0x5c836d){_0x45d92f=_0x45d92f-0x0;var _0x5dc483=_0x17eb[_0x45d92f];return _0x5dc483;};'use strict';var Sequelize=require(_0xb17e('0x0'));module[_0xb17e('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xb17e('0x2')],'allowNull':![],'defaultValue':_0xb17e('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xb17e('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xb17e('0x4')}}; \ No newline at end of file +var _0x0a83=['INTEGER','STRING','sequelize'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0x0a83,0x101));var _0x30a8=function(_0x3ab353,_0x5d5283){_0x3ab353=_0x3ab353-0x0;var _0x1e2285=_0x0a83[_0x3ab353];return _0x1e2285;};'use strict';var Sequelize=require(_0x30a8('0x0'));module['exports']={'priority':{'type':Sequelize[_0x30a8('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x30a8('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x30a8('0x2')]},'interval':{'type':Sequelize[_0x30a8('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index accc701..c0a026f 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 _0xa7a6=['lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','destroy','end','error','stack','name','index','map','FaxApplication','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','fields','create','body','params','catch','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x1da527,_0x2dc953){var _0x40fc7c=function(_0x9949f5){while(--_0x9949f5){_0x1da527['push'](_0x1da527['shift']());}};_0x40fc7c(++_0x2dc953);}(_0xa7a6,0x170));var _0x6a7a=function(_0x5468d1,_0x19b293){_0x5468d1=_0x5468d1-0x0;var _0x5766fc=_0xa7a6[_0x5468d1];return _0x5766fc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6a7a('0x0'));var zipdir=require(_0x6a7a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6a7a('0x2'));var moment=require(_0x6a7a('0x3'));var BPromise=require(_0x6a7a('0x4'));var Mustache=require(_0x6a7a('0x5'));var util=require(_0x6a7a('0x6'));var path=require(_0x6a7a('0x7'));var sox=require(_0x6a7a('0x8'));var csv=require(_0x6a7a('0x9'));var ejs=require(_0x6a7a('0xa'));var fs=require('fs');var fs_extra=require(_0x6a7a('0xb'));var _=require(_0x6a7a('0xc'));var squel=require(_0x6a7a('0xd'));var crypto=require(_0x6a7a('0xe'));var jsforce=require(_0x6a7a('0xf'));var deskjs=require(_0x6a7a('0x10'));var toCsv=require(_0x6a7a('0x9'));var querystring=require('querystring');var Papa=require(_0x6a7a('0x11'));var Redis=require(_0x6a7a('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x6a7a('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6a7a('0x14'));var logger=require(_0x6a7a('0x15'))(_0x6a7a('0x16'));var utils=require(_0x6a7a('0x17'));var config=require(_0x6a7a('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x6a7a('0x19'))['db'];function respondWithStatusCode(_0x4ed704,_0x240c18){_0x240c18=_0x240c18||0xcc;return function(_0x469620){if(_0x469620){return _0x4ed704[_0x6a7a('0x1a')](_0x240c18);}return _0x4ed704[_0x6a7a('0x1b')](_0x240c18)['end']();};}function respondWithResult(_0x14ce18,_0x57de7f){_0x57de7f=_0x57de7f||0xc8;return function(_0x515d8f){if(_0x515d8f){return _0x14ce18[_0x6a7a('0x1b')](_0x57de7f)[_0x6a7a('0x1c')](_0x515d8f);}};}function respondWithFilteredResult(_0x3e4e6b,_0x322354){return function(_0x4e0d33){if(_0x4e0d33){var _0x2ef639=typeof _0x322354[_0x6a7a('0x1d')]==='undefined'&&typeof _0x322354[_0x6a7a('0x1e')]===_0x6a7a('0x1f');var _0x4e7ea0=_0x4e0d33[_0x6a7a('0x20')];var _0x4a04d0=_0x2ef639?0x0:_0x322354[_0x6a7a('0x1d')];var _0x3eebb3=_0x2ef639?_0x4e0d33[_0x6a7a('0x20')]:_0x322354[_0x6a7a('0x1d')]+_0x322354[_0x6a7a('0x1e')];var _0x3e5aa8;if(_0x3eebb3>=_0x4e7ea0){_0x3eebb3=_0x4e7ea0;_0x3e5aa8=0xc8;}else{_0x3e5aa8=0xce;}_0x3e4e6b[_0x6a7a('0x1b')](_0x3e5aa8);return _0x3e4e6b[_0x6a7a('0x21')](_0x6a7a('0x22'),_0x4a04d0+'-'+_0x3eebb3+'/'+_0x4e7ea0)[_0x6a7a('0x1c')](_0x4e0d33);}return null;};}function patchUpdates(_0x35b207){return function(_0x1d4dd3){try{jsonpatch[_0x6a7a('0x23')](_0x1d4dd3,_0x35b207,!![]);}catch(_0x36cee8){return BPromise['reject'](_0x36cee8);}return _0x1d4dd3[_0x6a7a('0x24')]();};}function saveUpdates(_0x45a33b,_0x24a4a1){return function(_0x294513){if(_0x294513){return _0x294513[_0x6a7a('0x25')](_0x45a33b)[_0x6a7a('0x26')](function(_0x47dbb6){return _0x47dbb6;});}return null;};}function removeEntity(_0x480b37,_0xf614c8){return function(_0x40d6e2){if(_0x40d6e2){return _0x40d6e2[_0x6a7a('0x27')]()[_0x6a7a('0x26')](function(){_0x480b37[_0x6a7a('0x1b')](0xcc)[_0x6a7a('0x28')]();});}};}function handleEntityNotFound(_0x1db622,_0xdc7fe){return function(_0x31ead9){if(!_0x31ead9){_0x1db622['sendStatus'](0x194);}return _0x31ead9;};}function handleError(_0x5c61d5,_0x1a0ace){_0x1a0ace=_0x1a0ace||0x1f4;return function(_0x18f391){logger[_0x6a7a('0x29')](_0x18f391[_0x6a7a('0x2a')]);if(_0x18f391['name']){delete _0x18f391[_0x6a7a('0x2b')];}_0x5c61d5[_0x6a7a('0x1b')](_0x1a0ace)['send'](_0x18f391);};}exports[_0x6a7a('0x2c')]=function(_0x2cc9d5,_0x55ee12){var _0x15a32d={},_0x246de5={},_0x3dc84d={'count':0x0,'rows':[]};var _0x6ba88d=_[_0x6a7a('0x2d')](db[_0x6a7a('0x2e')][_0x6a7a('0x2f')],function(_0x40f97f){return{'name':_0x40f97f[_0x6a7a('0x30')],'type':_0x40f97f[_0x6a7a('0x31')][_0x6a7a('0x32')]};});_0x246de5[_0x6a7a('0x33')]=_['map'](_0x6ba88d,'name');_0x246de5[_0x6a7a('0x34')]=_[_0x6a7a('0x35')](_0x2cc9d5[_0x6a7a('0x34')]);_0x246de5[_0x6a7a('0x36')]=_[_0x6a7a('0x37')](_0x246de5[_0x6a7a('0x33')],_0x246de5[_0x6a7a('0x34')]);_0x15a32d[_0x6a7a('0x38')]=_['intersection'](_0x246de5['model'],qs['fields'](_0x2cc9d5['query']['fields']));_0x15a32d[_0x6a7a('0x38')]=_0x15a32d[_0x6a7a('0x38')][_0x6a7a('0x39')]?_0x15a32d[_0x6a7a('0x38')]:_0x246de5[_0x6a7a('0x33')];if(!_0x2cc9d5[_0x6a7a('0x34')][_0x6a7a('0x3a')]('nolimit')){_0x15a32d[_0x6a7a('0x1e')]=qs['limit'](_0x2cc9d5[_0x6a7a('0x34')]['limit']);_0x15a32d['offset']=qs[_0x6a7a('0x1d')](_0x2cc9d5[_0x6a7a('0x34')]['offset']);}_0x15a32d['order']=qs['sort'](_0x2cc9d5[_0x6a7a('0x34')][_0x6a7a('0x3b')]);_0x15a32d[_0x6a7a('0x3c')]=qs[_0x6a7a('0x36')](_[_0x6a7a('0x3d')](_0x2cc9d5[_0x6a7a('0x34')],_0x246de5[_0x6a7a('0x36')]),_0x6ba88d);if(_0x2cc9d5['query'][_0x6a7a('0x3e')]){_0x15a32d[_0x6a7a('0x3c')]=_[_0x6a7a('0x3f')](_0x15a32d[_0x6a7a('0x3c')],{'$or':_[_0x6a7a('0x2d')](_0x6ba88d,function(_0x3ce132){if(_0x3ce132[_0x6a7a('0x31')]!==_0x6a7a('0x40')){var _0x4dd75e={};_0x4dd75e[_0x3ce132[_0x6a7a('0x2b')]]={'$like':'%'+_0x2cc9d5[_0x6a7a('0x34')][_0x6a7a('0x3e')]+'%'};return _0x4dd75e;}})});}_0x15a32d=_['merge']({},_0x15a32d,_0x2cc9d5[_0x6a7a('0x41')]);var _0x36ddd5={'where':_0x15a32d[_0x6a7a('0x3c')]};return db[_0x6a7a('0x2e')][_0x6a7a('0x20')](_0x36ddd5)[_0x6a7a('0x26')](function(_0x27f2fd){_0x3dc84d[_0x6a7a('0x20')]=_0x27f2fd;if(_0x2cc9d5[_0x6a7a('0x34')][_0x6a7a('0x42')]){_0x15a32d[_0x6a7a('0x43')]=[{'all':!![]}];}return db[_0x6a7a('0x2e')][_0x6a7a('0x44')](_0x15a32d);})[_0x6a7a('0x26')](function(_0x37e0ae){_0x3dc84d[_0x6a7a('0x45')]=_0x37e0ae;return _0x3dc84d;})[_0x6a7a('0x26')](respondWithFilteredResult(_0x55ee12,_0x15a32d))['catch'](handleError(_0x55ee12,null));};exports[_0x6a7a('0x46')]=function(_0x5297cf,_0xd23c89){var _0x1be599={'raw':!![],'where':{'id':_0x5297cf['params']['id']}},_0x2b28c9={};_0x2b28c9['model']=_[_0x6a7a('0x35')](db['FaxApplication'][_0x6a7a('0x2f')]);_0x2b28c9[_0x6a7a('0x34')]=_[_0x6a7a('0x35')](_0x5297cf[_0x6a7a('0x34')]);_0x2b28c9[_0x6a7a('0x36')]=_[_0x6a7a('0x37')](_0x2b28c9[_0x6a7a('0x33')],_0x2b28c9[_0x6a7a('0x34')]);_0x1be599[_0x6a7a('0x38')]=_['intersection'](_0x2b28c9[_0x6a7a('0x33')],qs[_0x6a7a('0x47')](_0x5297cf['query'][_0x6a7a('0x47')]));_0x1be599[_0x6a7a('0x38')]=_0x1be599[_0x6a7a('0x38')][_0x6a7a('0x39')]?_0x1be599[_0x6a7a('0x38')]:_0x2b28c9['model'];if(_0x5297cf[_0x6a7a('0x34')][_0x6a7a('0x42')]){_0x1be599[_0x6a7a('0x43')]=[{'all':!![]}];}_0x1be599=_[_0x6a7a('0x3f')]({},_0x1be599,_0x5297cf[_0x6a7a('0x41')]);return db[_0x6a7a('0x2e')]['find'](_0x1be599)[_0x6a7a('0x26')](handleEntityNotFound(_0xd23c89,null))[_0x6a7a('0x26')](respondWithResult(_0xd23c89,null))['catch'](handleError(_0xd23c89,null));};exports[_0x6a7a('0x48')]=function(_0x2c1783,_0x48ea88){return db[_0x6a7a('0x2e')]['create'](_0x2c1783[_0x6a7a('0x49')],{})[_0x6a7a('0x26')](respondWithResult(_0x48ea88,0xc9))['catch'](handleError(_0x48ea88,null));};exports[_0x6a7a('0x25')]=function(_0x10b28b,_0xff2bd2){if(_0x10b28b[_0x6a7a('0x49')]['id']){delete _0x10b28b[_0x6a7a('0x49')]['id'];}return db[_0x6a7a('0x2e')]['find']({'where':{'id':_0x10b28b[_0x6a7a('0x4a')]['id']}})[_0x6a7a('0x26')](handleEntityNotFound(_0xff2bd2,null))[_0x6a7a('0x26')](saveUpdates(_0x10b28b[_0x6a7a('0x49')],null))[_0x6a7a('0x26')](respondWithResult(_0xff2bd2,null))[_0x6a7a('0x4b')](handleError(_0xff2bd2,null));};exports[_0x6a7a('0x27')]=function(_0x22b653,_0x461128){return db['FaxApplication']['find']({'where':{'id':_0x22b653['params']['id']}})[_0x6a7a('0x26')](handleEntityNotFound(_0x461128,null))[_0x6a7a('0x26')](removeEntity(_0x461128,null))[_0x6a7a('0x4b')](handleError(_0x461128,null));}; \ No newline at end of file +var _0x1f75=['offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','FaxApplication','includeAll','include','rows','catch','show','find','create','body','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','to-csv','ejs','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json'];(function(_0x362a64,_0x2d92b6){var _0x422477=function(_0x29f90b){while(--_0x29f90b){_0x362a64['push'](_0x362a64['shift']());}};_0x422477(++_0x2d92b6);}(_0x1f75,0x1c0));var _0x51f7=function(_0x5a79e2,_0x319b1a){_0x5a79e2=_0x5a79e2-0x0;var _0x266c45=_0x1f75[_0x5a79e2];return _0x266c45;};'use strict';var emlformat=require(_0x51f7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x51f7('0x1'));var jsonpatch=require(_0x51f7('0x2'));var rp=require(_0x51f7('0x3'));var moment=require(_0x51f7('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x51f7('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x51f7('0x6'));var ejs=require(_0x51f7('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x51f7('0x8'));var deskjs=require('desk.js');var toCsv=require(_0x51f7('0x6'));var querystring=require('querystring');var Papa=require(_0x51f7('0x9'));var Redis=require('ioredis');var authService=require(_0x51f7('0xa'));var qs=require(_0x51f7('0xb'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x51f7('0xc'));var logger=require(_0x51f7('0xd'))(_0x51f7('0xe'));var utils=require('../../config/utils');var config=require(_0x51f7('0xf'));var licenseUtil=require(_0x51f7('0x10'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x35d045,_0x42a8cf){_0x42a8cf=_0x42a8cf||0xcc;return function(_0x37d3f1){if(_0x37d3f1){return _0x35d045[_0x51f7('0x11')](_0x42a8cf);}return _0x35d045[_0x51f7('0x12')](_0x42a8cf)[_0x51f7('0x13')]();};}function respondWithResult(_0x4eaf99,_0x5eab94){_0x5eab94=_0x5eab94||0xc8;return function(_0x449d59){if(_0x449d59){return _0x4eaf99[_0x51f7('0x12')](_0x5eab94)[_0x51f7('0x14')](_0x449d59);}};}function respondWithFilteredResult(_0x165b31,_0x3394ce){return function(_0xa89791){if(_0xa89791){var _0x1882f1=typeof _0x3394ce[_0x51f7('0x15')]===_0x51f7('0x16')&&typeof _0x3394ce[_0x51f7('0x17')]===_0x51f7('0x16');var _0x7ef3ed=_0xa89791['count'];var _0x4f61d8=_0x1882f1?0x0:_0x3394ce['offset'];var _0x523aaa=_0x1882f1?_0xa89791[_0x51f7('0x18')]:_0x3394ce[_0x51f7('0x15')]+_0x3394ce[_0x51f7('0x17')];var _0x2df446;if(_0x523aaa>=_0x7ef3ed){_0x523aaa=_0x7ef3ed;_0x2df446=0xc8;}else{_0x2df446=0xce;}_0x165b31[_0x51f7('0x12')](_0x2df446);return _0x165b31['set'](_0x51f7('0x19'),_0x4f61d8+'-'+_0x523aaa+'/'+_0x7ef3ed)['json'](_0xa89791);}return null;};}function patchUpdates(_0x4f3834){return function(_0x43fae9){try{jsonpatch['apply'](_0x43fae9,_0x4f3834,!![]);}catch(_0x3a3f4c){return BPromise[_0x51f7('0x1a')](_0x3a3f4c);}return _0x43fae9[_0x51f7('0x1b')]();};}function saveUpdates(_0x2d45f9,_0x1e276e){return function(_0x272fe3){if(_0x272fe3){return _0x272fe3[_0x51f7('0x1c')](_0x2d45f9)[_0x51f7('0x1d')](function(_0x166615){return _0x166615;});}return null;};}function removeEntity(_0x4ed998,_0xda0098){return function(_0xc071b4){if(_0xc071b4){return _0xc071b4[_0x51f7('0x1e')]()[_0x51f7('0x1d')](function(){_0x4ed998[_0x51f7('0x12')](0xcc)[_0x51f7('0x13')]();});}};}function handleEntityNotFound(_0x5a3f04,_0x5114a3){return function(_0x85ae26){if(!_0x85ae26){_0x5a3f04[_0x51f7('0x11')](0x194);}return _0x85ae26;};}function handleError(_0x13e324,_0x347250){_0x347250=_0x347250||0x1f4;return function(_0x1d7dbf){logger[_0x51f7('0x1f')](_0x1d7dbf[_0x51f7('0x20')]);if(_0x1d7dbf[_0x51f7('0x21')]){delete _0x1d7dbf[_0x51f7('0x21')];}_0x13e324[_0x51f7('0x12')](_0x347250)[_0x51f7('0x22')](_0x1d7dbf);};}exports[_0x51f7('0x23')]=function(_0x2025b9,_0x1bca66){var _0x2bb865={},_0x2d4ade={},_0x5bfe99={'count':0x0,'rows':[]};var _0x183d8e=_['map'](db['FaxApplication'][_0x51f7('0x24')],function(_0x175f2a){return{'name':_0x175f2a[_0x51f7('0x25')],'type':_0x175f2a[_0x51f7('0x26')][_0x51f7('0x27')]};});_0x2d4ade[_0x51f7('0x28')]=_[_0x51f7('0x29')](_0x183d8e,_0x51f7('0x21'));_0x2d4ade['query']=_[_0x51f7('0x2a')](_0x2025b9['query']);_0x2d4ade[_0x51f7('0x2b')]=_[_0x51f7('0x2c')](_0x2d4ade[_0x51f7('0x28')],_0x2d4ade[_0x51f7('0x2d')]);_0x2bb865[_0x51f7('0x2e')]=_['intersection'](_0x2d4ade[_0x51f7('0x28')],qs[_0x51f7('0x2f')](_0x2025b9[_0x51f7('0x2d')][_0x51f7('0x2f')]));_0x2bb865[_0x51f7('0x2e')]=_0x2bb865['attributes']['length']?_0x2bb865['attributes']:_0x2d4ade['model'];if(!_0x2025b9[_0x51f7('0x2d')][_0x51f7('0x30')](_0x51f7('0x31'))){_0x2bb865[_0x51f7('0x17')]=qs[_0x51f7('0x17')](_0x2025b9['query'][_0x51f7('0x17')]);_0x2bb865['offset']=qs[_0x51f7('0x15')](_0x2025b9[_0x51f7('0x2d')][_0x51f7('0x15')]);}_0x2bb865[_0x51f7('0x32')]=qs['sort'](_0x2025b9[_0x51f7('0x2d')][_0x51f7('0x33')]);_0x2bb865[_0x51f7('0x34')]=qs[_0x51f7('0x2b')](_['pick'](_0x2025b9['query'],_0x2d4ade[_0x51f7('0x2b')]),_0x183d8e);if(_0x2025b9[_0x51f7('0x2d')][_0x51f7('0x35')]){_0x2bb865[_0x51f7('0x34')]=_[_0x51f7('0x36')](_0x2bb865[_0x51f7('0x34')],{'$or':_[_0x51f7('0x29')](_0x183d8e,function(_0x59a509){if(_0x59a509[_0x51f7('0x26')]!==_0x51f7('0x37')){var _0x9dec6d={};_0x9dec6d[_0x59a509[_0x51f7('0x21')]]={'$like':'%'+_0x2025b9[_0x51f7('0x2d')][_0x51f7('0x35')]+'%'};return _0x9dec6d;}})});}_0x2bb865=_['merge']({},_0x2bb865,_0x2025b9[_0x51f7('0x38')]);var _0x53b8c9={'where':_0x2bb865[_0x51f7('0x34')]};return db[_0x51f7('0x39')][_0x51f7('0x18')](_0x53b8c9)[_0x51f7('0x1d')](function(_0x2dec4f){_0x5bfe99[_0x51f7('0x18')]=_0x2dec4f;if(_0x2025b9[_0x51f7('0x2d')][_0x51f7('0x3a')]){_0x2bb865[_0x51f7('0x3b')]=[{'all':!![]}];}return db['FaxApplication']['findAll'](_0x2bb865);})[_0x51f7('0x1d')](function(_0x569c6c){_0x5bfe99[_0x51f7('0x3c')]=_0x569c6c;return _0x5bfe99;})[_0x51f7('0x1d')](respondWithFilteredResult(_0x1bca66,_0x2bb865))[_0x51f7('0x3d')](handleError(_0x1bca66,null));};exports[_0x51f7('0x3e')]=function(_0x19d4e5,_0xf7749f){var _0x46b265={'raw':!![],'where':{'id':_0x19d4e5['params']['id']}},_0x55c9f4={};_0x55c9f4[_0x51f7('0x28')]=_['keys'](db['FaxApplication'][_0x51f7('0x24')]);_0x55c9f4[_0x51f7('0x2d')]=_[_0x51f7('0x2a')](_0x19d4e5[_0x51f7('0x2d')]);_0x55c9f4['filters']=_[_0x51f7('0x2c')](_0x55c9f4[_0x51f7('0x28')],_0x55c9f4[_0x51f7('0x2d')]);_0x46b265[_0x51f7('0x2e')]=_[_0x51f7('0x2c')](_0x55c9f4[_0x51f7('0x28')],qs['fields'](_0x19d4e5['query']['fields']));_0x46b265[_0x51f7('0x2e')]=_0x46b265[_0x51f7('0x2e')]['length']?_0x46b265[_0x51f7('0x2e')]:_0x55c9f4['model'];if(_0x19d4e5[_0x51f7('0x2d')][_0x51f7('0x3a')]){_0x46b265[_0x51f7('0x3b')]=[{'all':!![]}];}_0x46b265=_[_0x51f7('0x36')]({},_0x46b265,_0x19d4e5['options']);return db[_0x51f7('0x39')][_0x51f7('0x3f')](_0x46b265)[_0x51f7('0x1d')](handleEntityNotFound(_0xf7749f,null))[_0x51f7('0x1d')](respondWithResult(_0xf7749f,null))[_0x51f7('0x3d')](handleError(_0xf7749f,null));};exports[_0x51f7('0x40')]=function(_0x359127,_0x233c1e){return db[_0x51f7('0x39')][_0x51f7('0x40')](_0x359127[_0x51f7('0x41')],{})[_0x51f7('0x1d')](respondWithResult(_0x233c1e,0xc9))[_0x51f7('0x3d')](handleError(_0x233c1e,null));};exports[_0x51f7('0x1c')]=function(_0x36bd42,_0x2bf2df){if(_0x36bd42[_0x51f7('0x41')]['id']){delete _0x36bd42[_0x51f7('0x41')]['id'];}return db[_0x51f7('0x39')][_0x51f7('0x3f')]({'where':{'id':_0x36bd42['params']['id']}})[_0x51f7('0x1d')](handleEntityNotFound(_0x2bf2df,null))['then'](saveUpdates(_0x36bd42[_0x51f7('0x41')],null))[_0x51f7('0x1d')](respondWithResult(_0x2bf2df,null))[_0x51f7('0x3d')](handleError(_0x2bf2df,null));};exports[_0x51f7('0x1e')]=function(_0x3da471,_0x29c47a){return db['FaxApplication'][_0x51f7('0x3f')]({'where':{'id':_0x3da471[_0x51f7('0x42')]['id']}})[_0x51f7('0x1d')](handleEntityNotFound(_0x29c47a,null))[_0x51f7('0x1d')](removeEntity(_0x29c47a,null))['catch'](handleError(_0x29c47a,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index c8cc154..75f95a1 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 _0x1843=['api','moment','path','rimraf','../../config/environment','./faxApplication.attributes','exports','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x1843,0x111));var _0x3184=function(_0x2b8871,_0x51f558){_0x2b8871=_0x2b8871-0x0;var _0x372d33=_0x1843[_0x2b8871];return _0x372d33;};'use strict';var _=require(_0x3184('0x0'));var util=require(_0x3184('0x1'));var logger=require(_0x3184('0x2'))(_0x3184('0x3'));var moment=require(_0x3184('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3184('0x5'));var rimraf=require(_0x3184('0x6'));var config=require(_0x3184('0x7'));var attributes=require(_0x3184('0x8'));module[_0x3184('0x9')]=function(_0x236bf8,_0x157c49){return _0x236bf8['define']('FaxApplication',attributes,{'tableName':'fax_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3184('0xa'),'collate':_0x3184('0xb')});}; \ No newline at end of file +var _0x1334=['request-promise','./faxApplication.attributes','exports','define','FaxApplication','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x24e1f7,_0x33a7a3){var _0xfd60c=function(_0x8ce237){while(--_0x8ce237){_0x24e1f7['push'](_0x24e1f7['shift']());}};_0xfd60c(++_0x33a7a3);}(_0x1334,0xea));var _0x4133=function(_0x31b5a5,_0x44376a){_0x31b5a5=_0x31b5a5-0x0;var _0x364cc9=_0x1334[_0x31b5a5];return _0x364cc9;};'use strict';var _=require(_0x4133('0x0'));var util=require(_0x4133('0x1'));var logger=require(_0x4133('0x2'))(_0x4133('0x3'));var moment=require(_0x4133('0x4'));var BPromise=require(_0x4133('0x5'));var rp=require(_0x4133('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4133('0x7'));module[_0x4133('0x8')]=function(_0x874548,_0x2ca04c){return _0x874548[_0x4133('0x9')](_0x4133('0xa'),attributes,{'tableName':'fax_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x4133('0xb')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index c20b82e..f67bc1c 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 _0x5d4c=['debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','FaxApplication,\x20%s,\x20%s','message','catch','UpdateFaxApplication','FaxApplication','body','options','where','attributes','limit','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent'];(function(_0x65c50e,_0x1aa926){var _0x4573e7=function(_0x5bc049){while(--_0x5bc049){_0x65c50e['push'](_0x65c50e['shift']());}};_0x4573e7(++_0x1aa926);}(_0x5d4c,0x68));var _0xc5d4=function(_0x5d2a15,_0x1726e4){_0x5d2a15=_0x5d2a15-0x0;var _0x3550fa=_0x5d4c[_0x5d2a15];return _0x3550fa;};'use strict';var _=require(_0xc5d4('0x0'));var util=require('util');var moment=require(_0xc5d4('0x1'));var BPromise=require(_0xc5d4('0x2'));var rs=require(_0xc5d4('0x3'));var fs=require('fs');var Redis=require(_0xc5d4('0x4'));var db=require(_0xc5d4('0x5'))['db'];var utils=require(_0xc5d4('0x6'));var logger=require(_0xc5d4('0x7'))(_0xc5d4('0x8'));var config=require('../../config/environment');var jayson=require(_0xc5d4('0x9'));var client=jayson[_0xc5d4('0xa')][_0xc5d4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x57d220,_0x55d090,_0x208ff8){return new BPromise(function(_0x1ecb0d,_0x44dcea){return client[_0xc5d4('0xc')](_0x57d220,_0x208ff8)[_0xc5d4('0xd')](function(_0x5cd6e4){logger[_0xc5d4('0xe')]('FaxApplication,\x20%s,\x20%s',_0x55d090,_0xc5d4('0xf'));logger[_0xc5d4('0x10')](_0xc5d4('0x11'),_0x55d090,_0xc5d4('0xf'),JSON[_0xc5d4('0x12')](_0x5cd6e4));if(_0x5cd6e4['error']){if(_0x5cd6e4[_0xc5d4('0x13')]['code']===0x1f4){logger[_0xc5d4('0x13')](_0xc5d4('0x14'),_0x55d090,_0x5cd6e4['error']['message']);return _0x44dcea(_0x5cd6e4[_0xc5d4('0x13')][_0xc5d4('0x15')]);}logger['error']('FaxApplication,\x20%s,\x20%s',_0x55d090,_0x5cd6e4[_0xc5d4('0x13')][_0xc5d4('0x15')]);return _0x1ecb0d(_0x5cd6e4[_0xc5d4('0x13')][_0xc5d4('0x15')]);}else{logger[_0xc5d4('0xe')](_0xc5d4('0x14'),_0x55d090,_0xc5d4('0xf'));_0x1ecb0d(_0x5cd6e4['result']['message']);}})[_0xc5d4('0x16')](function(_0x32eb1a){logger['error'](_0xc5d4('0x14'),_0x55d090,_0x32eb1a);_0x44dcea(_0x32eb1a);});});}exports[_0xc5d4('0x17')]=function(_0x5bfb51){var _0x596525=this;return new Promise(function(_0x261853,_0x2693c1){return db[_0xc5d4('0x18')]['update'](_0x5bfb51[_0xc5d4('0x19')],{'raw':_0x5bfb51['options']?_0x5bfb51[_0xc5d4('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5bfb51[_0xc5d4('0x1a')]?_0x5bfb51[_0xc5d4('0x1a')][_0xc5d4('0x1b')]||null:null,'attributes':_0x5bfb51[_0xc5d4('0x1a')]?_0x5bfb51[_0xc5d4('0x1a')][_0xc5d4('0x1c')]||null:null,'limit':_0x5bfb51[_0xc5d4('0x1a')]?_0x5bfb51[_0xc5d4('0x1a')][_0xc5d4('0x1d')]||null:null})[_0xc5d4('0xd')](function(_0x1c6117){logger['info'](_0xc5d4('0x17'),_0x5bfb51);logger[_0xc5d4('0x10')](_0xc5d4('0x17'),_0x5bfb51,JSON['stringify'](_0x1c6117));_0x261853(_0x1c6117);})['catch'](function(_0x33c18e){logger[_0xc5d4('0x13')](_0xc5d4('0x17'),_0x33c18e['message'],_0x5bfb51);_0x2693c1(_0x596525[_0xc5d4('0x13')](0x1f4,_0x33c18e[_0xc5d4('0x15')]));});});}; \ No newline at end of file +var _0x5570=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','FaxApplication,\x20%s,\x20%s','debug','FaxApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','UpdateFaxApplication','FaxApplication','update','body','options','raw','limit'];(function(_0x495f2b,_0x253ab3){var _0x12fa6e=function(_0xbb4b3b){while(--_0xbb4b3b){_0x495f2b['push'](_0x495f2b['shift']());}};_0x12fa6e(++_0x253ab3);}(_0x5570,0x122));var _0x0557=function(_0x118d39,_0x43be87){_0x118d39=_0x118d39-0x0;var _0x47958b=_0x5570[_0x118d39];return _0x47958b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0557('0x0'));var BPromise=require(_0x0557('0x1'));var rs=require(_0x0557('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0557('0x3'))['db'];var utils=require(_0x0557('0x4'));var logger=require('../../config/logger')(_0x0557('0x5'));var config=require(_0x0557('0x6'));var jayson=require(_0x0557('0x7'));var client=jayson[_0x0557('0x8')][_0x0557('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x17bd51,_0x168641,_0x3afc9d){return new BPromise(function(_0x13b56e,_0x28a84a){return client['request'](_0x17bd51,_0x3afc9d)[_0x0557('0xa')](function(_0x50e0e9){logger[_0x0557('0xb')](_0x0557('0xc'),_0x168641,'request\x20sent');logger[_0x0557('0xd')](_0x0557('0xe'),_0x168641,_0x0557('0xf'),JSON[_0x0557('0x10')](_0x50e0e9));if(_0x50e0e9[_0x0557('0x11')]){if(_0x50e0e9[_0x0557('0x11')][_0x0557('0x12')]===0x1f4){logger[_0x0557('0x11')]('FaxApplication,\x20%s,\x20%s',_0x168641,_0x50e0e9[_0x0557('0x11')][_0x0557('0x13')]);return _0x28a84a(_0x50e0e9[_0x0557('0x11')]['message']);}logger[_0x0557('0x11')](_0x0557('0xc'),_0x168641,_0x50e0e9[_0x0557('0x11')][_0x0557('0x13')]);return _0x13b56e(_0x50e0e9[_0x0557('0x11')]['message']);}else{logger[_0x0557('0xb')]('FaxApplication,\x20%s,\x20%s',_0x168641,_0x0557('0xf'));_0x13b56e(_0x50e0e9[_0x0557('0x14')][_0x0557('0x13')]);}})[_0x0557('0x15')](function(_0xdc727a){logger['error'](_0x0557('0xc'),_0x168641,_0xdc727a);_0x28a84a(_0xdc727a);});});}exports[_0x0557('0x16')]=function(_0x2dff77){var _0x24c4ec=this;return new Promise(function(_0x5a1e34,_0xfb871){return db[_0x0557('0x17')][_0x0557('0x18')](_0x2dff77[_0x0557('0x19')],{'raw':_0x2dff77[_0x0557('0x1a')]?_0x2dff77[_0x0557('0x1a')][_0x0557('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2dff77[_0x0557('0x1a')]?_0x2dff77[_0x0557('0x1a')]['where']||null:null,'attributes':_0x2dff77[_0x0557('0x1a')]?_0x2dff77[_0x0557('0x1a')]['attributes']||null:null,'limit':_0x2dff77[_0x0557('0x1a')]?_0x2dff77['options'][_0x0557('0x1c')]||null:null})['then'](function(_0x4b1290){logger[_0x0557('0xb')](_0x0557('0x16'),_0x2dff77);logger[_0x0557('0xd')](_0x0557('0x16'),_0x2dff77,JSON[_0x0557('0x10')](_0x4b1290));_0x5a1e34(_0x4b1290);})[_0x0557('0x15')](function(_0x4ee9f9){logger[_0x0557('0x11')]('UpdateFaxApplication',_0x4ee9f9['message'],_0x2dff77);_0xfb871(_0x24c4ec[_0x0557('0x11')](0x1f4,_0x4ee9f9[_0x0557('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 86ed24c..05ba8ba 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 _0x6e6c=['delete','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','post','create','update'];(function(_0x4b4f24,_0x5654a8){var _0x1c13d4=function(_0x4940bf){while(--_0x4940bf){_0x4b4f24['push'](_0x4b4f24['shift']());}};_0x1c13d4(++_0x5654a8);}(_0x6e6c,0xc3));var _0xc6e6=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x6e6c[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0xc6e6('0x0'));var util=require(_0xc6e6('0x1'));var path=require('path');var timeout=require(_0xc6e6('0x2'));var express=require(_0xc6e6('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xc6e6('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xc6e6('0x5'));var controller=require('./faxApplication.controller');router[_0xc6e6('0x6')]('/',auth[_0xc6e6('0x7')](),controller['index']);router[_0xc6e6('0x6')](_0xc6e6('0x8'),auth['isAuthenticated'](),controller[_0xc6e6('0x9')]);router[_0xc6e6('0xa')]('/',auth['isAuthenticated'](),controller[_0xc6e6('0xb')]);router['put'](_0xc6e6('0x8'),auth[_0xc6e6('0x7')](),controller[_0xc6e6('0xc')]);router[_0xc6e6('0xd')](_0xc6e6('0x8'),auth[_0xc6e6('0x7')](),controller[_0xc6e6('0xe')]);module[_0xc6e6('0xf')]=router; \ No newline at end of file +var _0x4024=['express','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','update','destroy','exports','multer','util','connect-timeout'];(function(_0x5b9b18,_0x533abf){var _0x141000=function(_0x294e79){while(--_0x294e79){_0x5b9b18['push'](_0x5b9b18['shift']());}};_0x141000(++_0x533abf);}(_0x4024,0x89));var _0x4402=function(_0x43d118,_0x10baf8){_0x43d118=_0x43d118-0x0;var _0x38adbd=_0x4024[_0x43d118];return _0x38adbd;};'use strict';var multer=require(_0x4402('0x0'));var util=require(_0x4402('0x1'));var path=require('path');var timeout=require(_0x4402('0x2'));var express=require(_0x4402('0x3'));var router=express['Router']();var fs_extra=require(_0x4402('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x4402('0x5'));var config=require(_0x4402('0x6'));var controller=require('./faxApplication.controller');router['get']('/',auth[_0x4402('0x7')](),controller[_0x4402('0x8')]);router[_0x4402('0x9')]('/:id',auth[_0x4402('0x7')](),controller['show']);router['post']('/',auth[_0x4402('0x7')](),controller['create']);router['put'](_0x4402('0xa'),auth['isAuthenticated'](),controller[_0x4402('0xb')]);router['delete'](_0x4402('0xa'),auth['isAuthenticated'](),controller[_0x4402('0xc')]);module[_0x4402('0xd')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index 9a243d4..d56dd0a 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 _0xb145=['out','INTEGER','exports','BOOLEAN','DATE','STRING','ENUM'];(function(_0x52afc3,_0x525402){var _0x396f17=function(_0x5f0a99){while(--_0x5f0a99){_0x52afc3['push'](_0x52afc3['shift']());}};_0x396f17(++_0x525402);}(_0xb145,0xa3));var _0x5b14=function(_0x129c67,_0x53cd44){_0x129c67=_0x129c67-0x0;var _0x5cecd1=_0xb145[_0x129c67];return _0x5cecd1;};'use strict';var Sequelize=require('sequelize');module[_0x5b14('0x0')]={'closed':{'type':Sequelize[_0x5b14('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x5b14('0x2')]},'disposition':{'type':Sequelize[_0x5b14('0x3')]},'secondDisposition':{'type':Sequelize[_0x5b14('0x3')]},'thirdDisposition':{'type':Sequelize[_0x5b14('0x3')]},'note':{'type':Sequelize[_0x5b14('0x3')]},'read1stAt':{'type':Sequelize[_0x5b14('0x2')]},'fax':{'type':Sequelize['STRING']},'firstMsgDirection':{'type':Sequelize[_0x5b14('0x4')]('in',_0x5b14('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x5b14('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x5b14('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'queueId':{'type':Sequelize[_0x5b14('0x6')]}}; \ No newline at end of file +var _0xa6b0=['sequelize','exports','STRING','DATE','ENUM','out','INTEGER'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa6b0,0xaf));var _0x0a6b=function(_0x43296a,_0x3fcef1){_0x43296a=_0x43296a-0x0;var _0x41f157=_0xa6b0[_0x43296a];return _0x41f157;};'use strict';var Sequelize=require(_0x0a6b('0x0'));module[_0x0a6b('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x0a6b('0x2')]},'secondDisposition':{'type':Sequelize[_0x0a6b('0x2')]},'thirdDisposition':{'type':Sequelize[_0x0a6b('0x2')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x0a6b('0x3')]},'fax':{'type':Sequelize[_0x0a6b('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x0a6b('0x4')]('in',_0x0a6b('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x0a6b('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x0a6b('0x4')]('in',_0x0a6b('0x5')),'defaultValue':'in','allowNull':![]},'queueId':{'type':Sequelize[_0x0a6b('0x6')]}}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js index 31e7e7c..c011889 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 _0xa993=['path','ioredis','../../components/interaction/service','../../config/logger','api','../../config/environment','redis','defaults','localhost','./faxInteraction.socket','sendStatus','status','end','json','undefined','limit','count','offset','update','destroy','then','stack','send','index','FaxInteraction','rawAttributes','type','key','findAll','fax','catch','show','params','model','keys','query','filters','intersection','attributes','fields','includeAll','include','merge','find','create','body','describe','addMessage','ids','omit','getMessages','findOne','FaxMessage','length','nolimit','order','sort','where','pick','FaxInteractionId','filter','map','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','Tag','name','color','faxInteractionTags:save','removeTags','download','unix','toString','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','push','createdAt','Messages','mkdirSync','Attachment','basename','createReadStream','createWriteStream','resolve','log','err','unlinkSync','zip-dir','moment','bluebird'];(function(_0x456fb1,_0x859a1d){var _0x4083d6=function(_0xe1d0f2){while(--_0xe1d0f2){_0x456fb1['push'](_0x456fb1['shift']());}};_0x4083d6(++_0x859a1d);}(_0xa993,0x123));var _0x3a99=function(_0x3d744f,_0x3926d5){_0x3d744f=_0x3d744f-0x0;var _0x55d756=_0xa993[_0x3d744f];return _0x55d756;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x3a99('0x0'));var moment=require(_0x3a99('0x1'));var BPromise=require(_0x3a99('0x2'));var util=require('util');var path=require(_0x3a99('0x3'));var fs=require('fs');var _=require('lodash');var Redis=require(_0x3a99('0x4'));var interaction=require(_0x3a99('0x5'));var qs=require('../../components/parsers/qs');var logger=require(_0x3a99('0x6'))(_0x3a99('0x7'));var config=require(_0x3a99('0x8'));var db=require('../../mysqldb')['db'];config[_0x3a99('0x9')]=_[_0x3a99('0xa')](config[_0x3a99('0x9')],{'host':_0x3a99('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3a99('0x9')]));require(_0x3a99('0xc'))['register'](socket);function respondWithStatusCode(_0x32fc98,_0x530a96){_0x530a96=_0x530a96||0xcc;return function(_0x19ba7d){if(_0x19ba7d){return _0x32fc98[_0x3a99('0xd')](_0x530a96);}return _0x32fc98[_0x3a99('0xe')](_0x530a96)[_0x3a99('0xf')]();};}function respondWithResult(_0x5be3b4,_0x495900){_0x495900=_0x495900||0xc8;return function(_0x3d36ea){if(_0x3d36ea){return _0x5be3b4['status'](_0x495900)[_0x3a99('0x10')](_0x3d36ea);}};}function respondWithFilteredResult(_0x20fbe3,_0x1ce0f9){return function(_0x1253cc){if(_0x1253cc){var _0x3de5d1=typeof _0x1ce0f9['offset']===_0x3a99('0x11')&&typeof _0x1ce0f9[_0x3a99('0x12')]===_0x3a99('0x11');var _0x31ab82=_0x1253cc[_0x3a99('0x13')];var _0x2fb807=_0x3de5d1?0x0:_0x1ce0f9['offset'];var _0x443e7c=_0x3de5d1?_0x1253cc['count']:_0x1ce0f9[_0x3a99('0x14')]+_0x1ce0f9[_0x3a99('0x12')];var _0x555887;if(_0x443e7c>=_0x31ab82){_0x443e7c=_0x31ab82;_0x555887=0xc8;}else{_0x555887=0xce;}_0x20fbe3['status'](_0x555887);return _0x20fbe3['set']('Content-Range',_0x2fb807+'-'+_0x443e7c+'/'+_0x31ab82)[_0x3a99('0x10')](_0x1253cc);}return null;};}function saveUpdates(_0x5d84d0){return function(_0x3fb18c){if(_0x3fb18c){return _0x3fb18c[_0x3a99('0x15')](_0x5d84d0)['then'](function(_0x476236){return _0x476236;});}return null;};}function removeEntity(_0x3bca8b){return function(_0x38a1e9){if(_0x38a1e9){return _0x38a1e9[_0x3a99('0x16')]()[_0x3a99('0x17')](function(){_0x3bca8b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a8163){return function(_0x1c76f0){if(!_0x1c76f0){_0x2a8163['sendStatus'](0x194);}return _0x1c76f0;};}function handleError(_0x4b7c72,_0x160bb0){_0x160bb0=_0x160bb0||0x1f4;return function(_0x353d74){logger['error'](_0x353d74[_0x3a99('0x18')]);if(_0x353d74['name']){delete _0x353d74['name'];}_0x4b7c72[_0x3a99('0xe')](_0x160bb0)[_0x3a99('0x19')](_0x353d74);};}exports[_0x3a99('0x1a')]=function(_0x112116,_0x3153de){var _0x5d34a5={};var _0x455272=_['map'](db[_0x3a99('0x1b')][_0x3a99('0x1c')],function(_0x2dc19d){return{'name':_0x2dc19d['fieldName'],'type':_0x2dc19d[_0x3a99('0x1d')][_0x3a99('0x1e')]};});_0x5d34a5=qs['getOptions'](_0x455272,_0x112116);return interaction[_0x3a99('0x1f')](_0x3a99('0x20'),_0x112116['query'],_0x112116['user'],_0x5d34a5,_0x455272)['then'](respondWithFilteredResult(_0x3153de,_0x5d34a5))[_0x3a99('0x21')](handleError(_0x3153de,null));};exports[_0x3a99('0x22')]=function(_0x17de04,_0x24b19f){var _0x31a171={'raw':![],'where':{'id':_0x17de04[_0x3a99('0x23')]['id']}},_0x23c205={};_0x23c205[_0x3a99('0x24')]=_[_0x3a99('0x25')](db['FaxInteraction'][_0x3a99('0x1c')]);_0x23c205[_0x3a99('0x26')]=_['keys'](_0x17de04[_0x3a99('0x26')]);_0x23c205[_0x3a99('0x27')]=_[_0x3a99('0x28')](_0x23c205[_0x3a99('0x24')],_0x23c205[_0x3a99('0x26')]);_0x31a171[_0x3a99('0x29')]=_[_0x3a99('0x28')](_0x23c205[_0x3a99('0x24')],qs['fields'](_0x17de04[_0x3a99('0x26')][_0x3a99('0x2a')]));_0x31a171['attributes']=_0x31a171[_0x3a99('0x29')]['length']?_0x31a171[_0x3a99('0x29')]:_0x23c205['model'];if(_0x17de04['query'][_0x3a99('0x2b')]){_0x31a171[_0x3a99('0x2c')]=[{'all':!![]}];}_0x31a171=_[_0x3a99('0x2d')]({},_0x31a171,_0x17de04['options']);return db[_0x3a99('0x1b')][_0x3a99('0x2e')](_0x31a171)[_0x3a99('0x17')](handleEntityNotFound(_0x24b19f,null))[_0x3a99('0x17')](respondWithResult(_0x24b19f,null))[_0x3a99('0x21')](handleError(_0x24b19f,null));};exports['create']=function(_0x49635f,_0x1a9037){return db[_0x3a99('0x1b')][_0x3a99('0x2f')](_0x49635f[_0x3a99('0x30')],{})['then'](respondWithResult(_0x1a9037,0xc9))['catch'](handleError(_0x1a9037,null));};exports[_0x3a99('0x15')]=function(_0x47e9ed,_0x626c7d){if(_0x47e9ed[_0x3a99('0x30')]['id']){delete _0x47e9ed[_0x3a99('0x30')]['id'];}return db[_0x3a99('0x1b')][_0x3a99('0x2e')]({'where':{'id':_0x47e9ed[_0x3a99('0x23')]['id']}})[_0x3a99('0x17')](handleEntityNotFound(_0x626c7d,null))[_0x3a99('0x17')](saveUpdates(_0x47e9ed[_0x3a99('0x30')],null))[_0x3a99('0x17')](respondWithResult(_0x626c7d,null))['catch'](handleError(_0x626c7d,null));};exports['destroy']=function(_0x5aa5ce,_0x17cd2e){return db[_0x3a99('0x1b')]['find']({'where':{'id':_0x5aa5ce[_0x3a99('0x23')]['id']}})[_0x3a99('0x17')](handleEntityNotFound(_0x17cd2e,null))['then'](removeEntity(_0x17cd2e,null))[_0x3a99('0x21')](handleError(_0x17cd2e,null));};exports[_0x3a99('0x31')]=function(_0x221189,_0x4f436b){return db['FaxInteraction'][_0x3a99('0x31')]()['then'](respondWithResult(_0x4f436b,null))[_0x3a99('0x21')](handleError(_0x4f436b,null));};exports[_0x3a99('0x32')]=function(_0x49192e,_0x5edd7b){return db['FaxMessage'][_0x3a99('0x2e')]({'where':{'id':_0x49192e['params']['id']}})['then'](handleEntityNotFound(_0x5edd7b,null))['then'](function(_0x193dfb){if(_0x193dfb){return _0x193dfb[_0x3a99('0x32')](_0x49192e[_0x3a99('0x30')][_0x3a99('0x33')],_[_0x3a99('0x34')](_0x49192e['body'],[_0x3a99('0x33'),'id'])||{});}})[_0x3a99('0x17')](respondWithResult(_0x5edd7b,null))[_0x3a99('0x21')](handleError(_0x5edd7b,null));};exports[_0x3a99('0x35')]=function(_0x2f0c57,_0xd2a557){var _0x219bdb={'raw':![],'where':{}};var _0x298e96={};var _0x5b4fad={'count':0x0,'rows':[]};return db[_0x3a99('0x1b')][_0x3a99('0x36')]({'where':{'id':_0x2f0c57[_0x3a99('0x23')]['id']}})[_0x3a99('0x17')](handleEntityNotFound(_0xd2a557,null))['then'](function(_0x50a17f){if(_0x50a17f){_0x298e96[_0x3a99('0x24')]=_[_0x3a99('0x25')](db[_0x3a99('0x37')][_0x3a99('0x1c')]);_0x298e96[_0x3a99('0x26')]=_[_0x3a99('0x25')](_0x2f0c57[_0x3a99('0x26')]);_0x298e96['filters']=_[_0x3a99('0x28')](_0x298e96['model'],_0x298e96['query']);_0x219bdb[_0x3a99('0x29')]=_[_0x3a99('0x28')](_0x298e96['model'],qs[_0x3a99('0x2a')](_0x2f0c57['query'][_0x3a99('0x2a')]));_0x219bdb[_0x3a99('0x29')]=_0x219bdb[_0x3a99('0x29')][_0x3a99('0x38')]?_0x219bdb['attributes']:_0x298e96[_0x3a99('0x24')];if(!_0x2f0c57[_0x3a99('0x26')]['hasOwnProperty'](_0x3a99('0x39'))){_0x219bdb[_0x3a99('0x12')]=qs[_0x3a99('0x12')](_0x2f0c57['query'][_0x3a99('0x12')]);_0x219bdb[_0x3a99('0x14')]=qs['offset'](_0x2f0c57[_0x3a99('0x26')][_0x3a99('0x14')]);}_0x219bdb[_0x3a99('0x3a')]=qs[_0x3a99('0x3b')](_0x2f0c57[_0x3a99('0x26')][_0x3a99('0x3b')]);_0x219bdb[_0x3a99('0x3c')]=qs['filters'](_[_0x3a99('0x3d')](_0x2f0c57['query'],_0x298e96[_0x3a99('0x27')]));_0x219bdb['where'][_0x3a99('0x3e')]=_0x50a17f['id'];if(_0x2f0c57['query'][_0x3a99('0x3f')]){_0x219bdb['where']=_[_0x3a99('0x2d')](_0x219bdb[_0x3a99('0x3c')],{'$or':_[_0x3a99('0x40')](_0x219bdb[_0x3a99('0x29')],function(_0xa73c21){var _0x4b2a78={};_0x4b2a78[_0xa73c21]={'$like':'%'+_0x2f0c57[_0x3a99('0x26')][_0x3a99('0x3f')]+'%'};return _0x4b2a78;})});}if(_0x2f0c57[_0x3a99('0x26')]['$gte']){var _0x4d5a02=_0x2f0c57['query'][_0x3a99('0x41')][_0x3a99('0x42')](',');var _0x4e9a6e={};_0x4e9a6e[_0x4d5a02[0x0]]={'$gte':moment(_0x4d5a02[0x1])[_0x3a99('0x43')](_0x3a99('0x44'))};_0x219bdb[_0x3a99('0x3c')]=_['merge'](_0x219bdb[_0x3a99('0x3c')],_0x4e9a6e);}_0x219bdb=_[_0x3a99('0x2d')]({},_0x219bdb,_0x2f0c57['options']);return db[_0x3a99('0x37')]['count']({'where':_0x219bdb[_0x3a99('0x3c')]})[_0x3a99('0x17')](function(_0x4870cf){_0x5b4fad[_0x3a99('0x13')]=_0x4870cf;if(_0x2f0c57[_0x3a99('0x26')][_0x3a99('0x2b')]){_0x219bdb[_0x3a99('0x2c')]=[{'all':!![]}];}return db['FaxMessage']['findAll'](_0x219bdb);})['then'](function(_0x3c9d4a){_0x5b4fad[_0x3a99('0x45')]=_0x3c9d4a;return _0x5b4fad;});}})[_0x3a99('0x17')](respondWithFilteredResult(_0xd2a557,_0x219bdb))[_0x3a99('0x21')](handleError(_0xd2a557,null));};exports[_0x3a99('0x46')]=function(_0x28bcc9,_0xb7bdb0){return db[_0x3a99('0x1b')][_0x3a99('0x2e')]({'where':{'id':_0x28bcc9[_0x3a99('0x23')]['id']}})[_0x3a99('0x17')](handleEntityNotFound(_0xb7bdb0,null))['then'](function(_0x4d662c){if(_0x4d662c){return _0x4d662c['setTags'](_0x28bcc9['body'][_0x3a99('0x33')],_[_0x3a99('0x34')](_0x28bcc9[_0x3a99('0x30')],[_0x3a99('0x33'),'id'])||{})['spread'](function(){return db[_0x3a99('0x47')][_0x3a99('0x1f')]({'attributes':['id',_0x3a99('0x48'),_0x3a99('0x49')],'where':{'id':_0x28bcc9[_0x3a99('0x30')][_0x3a99('0x33')]}});})[_0x3a99('0x17')](function(_0x1f405b){socket['emit'](_0x3a99('0x4a'),{'id':Number(_0x28bcc9[_0x3a99('0x23')]['id']),'tags':_0x1f405b||[]});return{'id':Number(_0x28bcc9[_0x3a99('0x23')]['id']),'tags':_0x1f405b||[]};});}})[_0x3a99('0x17')](respondWithResult(_0xb7bdb0,null))[_0x3a99('0x21')](handleError(_0xb7bdb0,null));};exports[_0x3a99('0x4b')]=function(_0x4779eb,_0x59d5cb){return db[_0x3a99('0x1b')][_0x3a99('0x2e')]({'where':{'id':_0x4779eb[_0x3a99('0x23')]['id']}})[_0x3a99('0x17')](handleEntityNotFound(_0x59d5cb,null))[_0x3a99('0x17')](function(_0x4913f1){if(_0x4913f1){return _0x4913f1[_0x3a99('0x4b')](_0x4779eb[_0x3a99('0x26')]['ids']);}})['then'](respondWithStatusCode(_0x59d5cb,null))[_0x3a99('0x21')](handleError(_0x59d5cb,null));};exports[_0x3a99('0x4c')]=function(_0xab9d08,_0x8e7928){var _0x2ddcd1=moment()[_0x3a99('0x4d')]()[_0x3a99('0x4e')]();var _0x790c5e=path[_0x3a99('0x4f')](config[_0x3a99('0x50')],_0x3a99('0x51'),_0x3a99('0x52'),_0x3a99('0x53'));var _0x3516c9=path['join'](config['root'],_0x3a99('0x51'),_0x3a99('0x52'),_0x3a99('0x54'));var _0x17a3b3=path['join'](_0x790c5e,_0x2ddcd1);var _0x52221c=util[_0x3a99('0x43')](_0x3a99('0x55'),_0xab9d08[_0x3a99('0x23')]['id'],_0x2ddcd1);var _0x408d08=path[_0x3a99('0x4f')](_0x790c5e,_0x52221c);var _0x5e8c9a=[];_0x5e8c9a[_0x3a99('0x56')]({'model':db['Attachment'],'as':'Attachment','raw':!![]});var _0x2f25cd=[{'model':db['FaxMessage'],'as':'Messages','attributes':['id',_0x3a99('0x30'),_0x3a99('0x57')],'include':_0x5e8c9a}];return db[_0x3a99('0x1b')][_0x3a99('0x2e')]({'where':{'id':_0xab9d08[_0x3a99('0x23')]['id']},'include':_0x2f25cd})['then'](handleEntityNotFound(_0x8e7928,null))[_0x3a99('0x17')](function(_0x18b677){if(_0x18b677&&_0x18b677[_0x3a99('0x58')]){var _0x552a10=_0x18b677['get']({'plain':!![]});fs[_0x3a99('0x59')](_0x17a3b3);for(var _0x19f7f5=0x0;_0x19f7f5<_0x552a10['Messages']['length'];_0x19f7f5++){var _0x1ff6a0=_0x552a10[_0x3a99('0x58')][_0x19f7f5][_0x3a99('0x5a')];if(_0x1ff6a0){var _0x49f461=path[_0x3a99('0x4f')](_0x3516c9,_0x1ff6a0[_0x3a99('0x5b')]);if(fs['existsSync'](_0x49f461)){fs[_0x3a99('0x5c')](_0x49f461)['pipe'](fs[_0x3a99('0x5d')](path['join'](_0x17a3b3,_0x1ff6a0[_0x3a99('0x5b')])));}}}return BPromise[_0x3a99('0x5e')]()[_0x3a99('0x17')](function(){return new BPromise(function(_0x3ec74a,_0x27777a){zipdir(_0x17a3b3,{'saveTo':_0x408d08},function(_0x5637ac,_0x60f413){if(_0x5637ac)return _0x27777a(_0x5637ac);return _0x3ec74a(_0x60f413);});})[_0x3a99('0x17')](function(){return new BPromise(function(_0x24864b,_0x5d7634){rimraf(_0x17a3b3,function(_0x31cc3f){if(_0x31cc3f)_0x5d7634(_0x31cc3f);return _0x24864b();});});})[_0x3a99('0x17')](function(){return _0x8e7928['download'](_0x408d08,_0x52221c,function(_0x4e3af4){if(_0x4e3af4){console[_0x3a99('0x5f')](_0x3a99('0x60'),_0x4e3af4);}else{fs[_0x3a99('0x61')](_0x408d08);}});});});}else{return _0x8e7928[_0x3a99('0xd')](0xc8);}})[_0x3a99('0x21')](handleError(_0x8e7928,null));}; \ No newline at end of file +var _0x78ed=['setTags','spread','color','faxInteractionTags:save','removeTags','download','toString','join','root','server','files','attachments','Attachment','Messages','createdAt','mkdirSync','basename','existsSync','createReadStream','resolve','log','err','rimraf','zip-dir','moment','bluebird','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','update','then','error','stack','name','send','index','map','FaxInteraction','rawAttributes','fieldName','type','key','findAll','fax','query','user','catch','show','params','keys','filters','attributes','intersection','model','fields','length','includeAll','merge','find','create','body','destroy','describe','addMessage','FaxMessage','omit','ids','getMessages','findOne','hasOwnProperty','nolimit','order','where','pick','FaxInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','options','include','rows','addTags'];(function(_0xe1d939,_0x3f3939){var _0x5d9e2d=function(_0x238219){while(--_0x238219){_0xe1d939['push'](_0xe1d939['shift']());}};_0x5d9e2d(++_0x3f3939);}(_0x78ed,0x1ae));var _0xd78e=function(_0x51e8c4,_0x32f7a2){_0x51e8c4=_0x51e8c4-0x0;var _0x1d5b6f=_0x78ed[_0x51e8c4];return _0x1d5b6f;};'use strict';var rimraf=require(_0xd78e('0x0'));var zipdir=require(_0xd78e('0x1'));var moment=require(_0xd78e('0x2'));var BPromise=require(_0xd78e('0x3'));var util=require('util');var path=require('path');var fs=require('fs');var _=require(_0xd78e('0x4'));var Redis=require(_0xd78e('0x5'));var interaction=require(_0xd78e('0x6'));var qs=require(_0xd78e('0x7'));var logger=require(_0xd78e('0x8'))(_0xd78e('0x9'));var config=require('../../config/environment');var db=require(_0xd78e('0xa'))['db'];config[_0xd78e('0xb')]=_[_0xd78e('0xc')](config[_0xd78e('0xb')],{'host':_0xd78e('0xd'),'port':0x18eb});var socket=require(_0xd78e('0xe'))(new Redis(config[_0xd78e('0xb')]));require('./faxInteraction.socket')[_0xd78e('0xf')](socket);function respondWithStatusCode(_0x13e323,_0x226ba4){_0x226ba4=_0x226ba4||0xcc;return function(_0x5b882b){if(_0x5b882b){return _0x13e323[_0xd78e('0x10')](_0x226ba4);}return _0x13e323['status'](_0x226ba4)[_0xd78e('0x11')]();};}function respondWithResult(_0xe7881d,_0x2ded14){_0x2ded14=_0x2ded14||0xc8;return function(_0x543b74){if(_0x543b74){return _0xe7881d[_0xd78e('0x12')](_0x2ded14)['json'](_0x543b74);}};}function respondWithFilteredResult(_0x2cde0c,_0x386873){return function(_0x5a4a21){if(_0x5a4a21){var _0x495ec9=typeof _0x386873[_0xd78e('0x13')]===_0xd78e('0x14')&&typeof _0x386873['limit']===_0xd78e('0x14');var _0x25411f=_0x5a4a21[_0xd78e('0x15')];var _0x588ee4=_0x495ec9?0x0:_0x386873[_0xd78e('0x13')];var _0x2f4162=_0x495ec9?_0x5a4a21[_0xd78e('0x15')]:_0x386873[_0xd78e('0x13')]+_0x386873[_0xd78e('0x16')];var _0x13132a;if(_0x2f4162>=_0x25411f){_0x2f4162=_0x25411f;_0x13132a=0xc8;}else{_0x13132a=0xce;}_0x2cde0c[_0xd78e('0x12')](_0x13132a);return _0x2cde0c[_0xd78e('0x17')](_0xd78e('0x18'),_0x588ee4+'-'+_0x2f4162+'/'+_0x25411f)['json'](_0x5a4a21);}return null;};}function saveUpdates(_0x575ac9){return function(_0x35480b){if(_0x35480b){return _0x35480b[_0xd78e('0x19')](_0x575ac9)['then'](function(_0x4bcc0e){return _0x4bcc0e;});}return null;};}function removeEntity(_0xfbe3a6){return function(_0x587505){if(_0x587505){return _0x587505['destroy']()[_0xd78e('0x1a')](function(){_0xfbe3a6[_0xd78e('0x12')](0xcc)[_0xd78e('0x11')]();});}};}function handleEntityNotFound(_0x3bdf1a){return function(_0x192ed5){if(!_0x192ed5){_0x3bdf1a['sendStatus'](0x194);}return _0x192ed5;};}function handleError(_0x1028d6,_0x2fad43){_0x2fad43=_0x2fad43||0x1f4;return function(_0x2f107e){logger[_0xd78e('0x1b')](_0x2f107e[_0xd78e('0x1c')]);if(_0x2f107e[_0xd78e('0x1d')]){delete _0x2f107e[_0xd78e('0x1d')];}_0x1028d6[_0xd78e('0x12')](_0x2fad43)[_0xd78e('0x1e')](_0x2f107e);};}exports[_0xd78e('0x1f')]=function(_0x57c75f,_0x2b134c){var _0x26db2a={};var _0x1cf49f=_[_0xd78e('0x20')](db[_0xd78e('0x21')][_0xd78e('0x22')],function(_0x2ed050){return{'name':_0x2ed050[_0xd78e('0x23')],'type':_0x2ed050[_0xd78e('0x24')][_0xd78e('0x25')]};});_0x26db2a=qs['getOptions'](_0x1cf49f,_0x57c75f);return interaction[_0xd78e('0x26')](_0xd78e('0x27'),_0x57c75f[_0xd78e('0x28')],_0x57c75f[_0xd78e('0x29')],_0x26db2a,_0x1cf49f)[_0xd78e('0x1a')](respondWithFilteredResult(_0x2b134c,_0x26db2a))[_0xd78e('0x2a')](handleError(_0x2b134c,null));};exports[_0xd78e('0x2b')]=function(_0x371bb8,_0x24655f){var _0x12640a={'raw':![],'where':{'id':_0x371bb8[_0xd78e('0x2c')]['id']}},_0x262d91={};_0x262d91['model']=_[_0xd78e('0x2d')](db['FaxInteraction'][_0xd78e('0x22')]);_0x262d91[_0xd78e('0x28')]=_['keys'](_0x371bb8[_0xd78e('0x28')]);_0x262d91[_0xd78e('0x2e')]=_['intersection'](_0x262d91['model'],_0x262d91[_0xd78e('0x28')]);_0x12640a[_0xd78e('0x2f')]=_[_0xd78e('0x30')](_0x262d91[_0xd78e('0x31')],qs['fields'](_0x371bb8[_0xd78e('0x28')][_0xd78e('0x32')]));_0x12640a[_0xd78e('0x2f')]=_0x12640a[_0xd78e('0x2f')][_0xd78e('0x33')]?_0x12640a[_0xd78e('0x2f')]:_0x262d91['model'];if(_0x371bb8[_0xd78e('0x28')][_0xd78e('0x34')]){_0x12640a['include']=[{'all':!![]}];}_0x12640a=_[_0xd78e('0x35')]({},_0x12640a,_0x371bb8['options']);return db[_0xd78e('0x21')][_0xd78e('0x36')](_0x12640a)['then'](handleEntityNotFound(_0x24655f,null))['then'](respondWithResult(_0x24655f,null))[_0xd78e('0x2a')](handleError(_0x24655f,null));};exports[_0xd78e('0x37')]=function(_0x5e4197,_0x301993){return db['FaxInteraction'][_0xd78e('0x37')](_0x5e4197['body'],{})[_0xd78e('0x1a')](respondWithResult(_0x301993,0xc9))[_0xd78e('0x2a')](handleError(_0x301993,null));};exports['update']=function(_0x3ec19a,_0xcc1e0b){if(_0x3ec19a['body']['id']){delete _0x3ec19a[_0xd78e('0x38')]['id'];}return db['FaxInteraction']['find']({'where':{'id':_0x3ec19a['params']['id']}})[_0xd78e('0x1a')](handleEntityNotFound(_0xcc1e0b,null))[_0xd78e('0x1a')](saveUpdates(_0x3ec19a['body'],null))[_0xd78e('0x1a')](respondWithResult(_0xcc1e0b,null))[_0xd78e('0x2a')](handleError(_0xcc1e0b,null));};exports[_0xd78e('0x39')]=function(_0x5ad494,_0x271479){return db[_0xd78e('0x21')]['find']({'where':{'id':_0x5ad494[_0xd78e('0x2c')]['id']}})[_0xd78e('0x1a')](handleEntityNotFound(_0x271479,null))[_0xd78e('0x1a')](removeEntity(_0x271479,null))['catch'](handleError(_0x271479,null));};exports[_0xd78e('0x3a')]=function(_0x20e850,_0x5ec4d8){return db['FaxInteraction']['describe']()[_0xd78e('0x1a')](respondWithResult(_0x5ec4d8,null))[_0xd78e('0x2a')](handleError(_0x5ec4d8,null));};exports[_0xd78e('0x3b')]=function(_0x4febaf,_0x3ddfc4){return db[_0xd78e('0x3c')]['find']({'where':{'id':_0x4febaf[_0xd78e('0x2c')]['id']}})[_0xd78e('0x1a')](handleEntityNotFound(_0x3ddfc4,null))[_0xd78e('0x1a')](function(_0xdb6084){if(_0xdb6084){return _0xdb6084[_0xd78e('0x3b')](_0x4febaf['body']['ids'],_[_0xd78e('0x3d')](_0x4febaf[_0xd78e('0x38')],[_0xd78e('0x3e'),'id'])||{});}})[_0xd78e('0x1a')](respondWithResult(_0x3ddfc4,null))[_0xd78e('0x2a')](handleError(_0x3ddfc4,null));};exports[_0xd78e('0x3f')]=function(_0x231170,_0x2457ff){var _0x35f4d4={'raw':![],'where':{}};var _0x4bfffb={};var _0x3fad19={'count':0x0,'rows':[]};return db[_0xd78e('0x21')][_0xd78e('0x40')]({'where':{'id':_0x231170[_0xd78e('0x2c')]['id']}})[_0xd78e('0x1a')](handleEntityNotFound(_0x2457ff,null))['then'](function(_0x383ba0){if(_0x383ba0){_0x4bfffb[_0xd78e('0x31')]=_['keys'](db[_0xd78e('0x3c')]['rawAttributes']);_0x4bfffb[_0xd78e('0x28')]=_['keys'](_0x231170[_0xd78e('0x28')]);_0x4bfffb[_0xd78e('0x2e')]=_[_0xd78e('0x30')](_0x4bfffb[_0xd78e('0x31')],_0x4bfffb[_0xd78e('0x28')]);_0x35f4d4[_0xd78e('0x2f')]=_['intersection'](_0x4bfffb['model'],qs[_0xd78e('0x32')](_0x231170[_0xd78e('0x28')]['fields']));_0x35f4d4[_0xd78e('0x2f')]=_0x35f4d4[_0xd78e('0x2f')][_0xd78e('0x33')]?_0x35f4d4[_0xd78e('0x2f')]:_0x4bfffb[_0xd78e('0x31')];if(!_0x231170[_0xd78e('0x28')][_0xd78e('0x41')](_0xd78e('0x42'))){_0x35f4d4[_0xd78e('0x16')]=qs[_0xd78e('0x16')](_0x231170['query']['limit']);_0x35f4d4['offset']=qs[_0xd78e('0x13')](_0x231170['query'][_0xd78e('0x13')]);}_0x35f4d4[_0xd78e('0x43')]=qs['sort'](_0x231170['query']['sort']);_0x35f4d4[_0xd78e('0x44')]=qs[_0xd78e('0x2e')](_[_0xd78e('0x45')](_0x231170[_0xd78e('0x28')],_0x4bfffb['filters']));_0x35f4d4[_0xd78e('0x44')][_0xd78e('0x46')]=_0x383ba0['id'];if(_0x231170[_0xd78e('0x28')][_0xd78e('0x47')]){_0x35f4d4[_0xd78e('0x44')]=_[_0xd78e('0x35')](_0x35f4d4['where'],{'$or':_[_0xd78e('0x20')](_0x35f4d4[_0xd78e('0x2f')],function(_0x51f3a1){var _0x1d403b={};_0x1d403b[_0x51f3a1]={'$like':'%'+_0x231170[_0xd78e('0x28')]['filter']+'%'};return _0x1d403b;})});}if(_0x231170[_0xd78e('0x28')]['$gte']){var _0xd006e7=_0x231170['query'][_0xd78e('0x48')][_0xd78e('0x49')](',');var _0x436a8d={};_0x436a8d[_0xd006e7[0x0]]={'$gte':moment(_0xd006e7[0x1])[_0xd78e('0x4a')](_0xd78e('0x4b'))};_0x35f4d4[_0xd78e('0x44')]=_['merge'](_0x35f4d4[_0xd78e('0x44')],_0x436a8d);}_0x35f4d4=_[_0xd78e('0x35')]({},_0x35f4d4,_0x231170[_0xd78e('0x4c')]);return db[_0xd78e('0x3c')][_0xd78e('0x15')]({'where':_0x35f4d4[_0xd78e('0x44')]})['then'](function(_0x3176a0){_0x3fad19['count']=_0x3176a0;if(_0x231170[_0xd78e('0x28')][_0xd78e('0x34')]){_0x35f4d4[_0xd78e('0x4d')]=[{'all':!![]}];}return db[_0xd78e('0x3c')]['findAll'](_0x35f4d4);})[_0xd78e('0x1a')](function(_0x13521e){_0x3fad19[_0xd78e('0x4e')]=_0x13521e;return _0x3fad19;});}})[_0xd78e('0x1a')](respondWithFilteredResult(_0x2457ff,_0x35f4d4))[_0xd78e('0x2a')](handleError(_0x2457ff,null));};exports[_0xd78e('0x4f')]=function(_0x4d2e34,_0x6a82ee){return db[_0xd78e('0x21')][_0xd78e('0x36')]({'where':{'id':_0x4d2e34['params']['id']}})[_0xd78e('0x1a')](handleEntityNotFound(_0x6a82ee,null))[_0xd78e('0x1a')](function(_0x446d68){if(_0x446d68){return _0x446d68[_0xd78e('0x50')](_0x4d2e34[_0xd78e('0x38')][_0xd78e('0x3e')],_[_0xd78e('0x3d')](_0x4d2e34[_0xd78e('0x38')],[_0xd78e('0x3e'),'id'])||{})[_0xd78e('0x51')](function(){return db['Tag'][_0xd78e('0x26')]({'attributes':['id',_0xd78e('0x1d'),_0xd78e('0x52')],'where':{'id':_0x4d2e34['body']['ids']}});})[_0xd78e('0x1a')](function(_0x2116c1){socket['emit'](_0xd78e('0x53'),{'id':Number(_0x4d2e34[_0xd78e('0x2c')]['id']),'tags':_0x2116c1||[]});return{'id':Number(_0x4d2e34['params']['id']),'tags':_0x2116c1||[]};});}})[_0xd78e('0x1a')](respondWithResult(_0x6a82ee,null))[_0xd78e('0x2a')](handleError(_0x6a82ee,null));};exports[_0xd78e('0x54')]=function(_0x102323,_0x2773d6){return db['FaxInteraction'][_0xd78e('0x36')]({'where':{'id':_0x102323[_0xd78e('0x2c')]['id']}})[_0xd78e('0x1a')](handleEntityNotFound(_0x2773d6,null))[_0xd78e('0x1a')](function(_0x1821f4){if(_0x1821f4){return _0x1821f4[_0xd78e('0x54')](_0x102323[_0xd78e('0x28')]['ids']);}})['then'](respondWithStatusCode(_0x2773d6,null))[_0xd78e('0x2a')](handleError(_0x2773d6,null));};exports[_0xd78e('0x55')]=function(_0x2fabee,_0x2faeda){var _0x202042=moment()['unix']()[_0xd78e('0x56')]();var _0x5554b9=path[_0xd78e('0x57')](config[_0xd78e('0x58')],_0xd78e('0x59'),'files','tmp');var _0x263b4d=path[_0xd78e('0x57')](config[_0xd78e('0x58')],_0xd78e('0x59'),_0xd78e('0x5a'),_0xd78e('0x5b'));var _0x596310=path['join'](_0x5554b9,_0x202042);var _0x4a9da6=util[_0xd78e('0x4a')]('transcript-%d-%s.zip',_0x2fabee[_0xd78e('0x2c')]['id'],_0x202042);var _0xa8a1e3=path[_0xd78e('0x57')](_0x5554b9,_0x4a9da6);var _0x2945a8=[];_0x2945a8['push']({'model':db[_0xd78e('0x5c')],'as':'Attachment','raw':!![]});var _0x129268=[{'model':db['FaxMessage'],'as':_0xd78e('0x5d'),'attributes':['id',_0xd78e('0x38'),_0xd78e('0x5e')],'include':_0x2945a8}];return db['FaxInteraction']['find']({'where':{'id':_0x2fabee[_0xd78e('0x2c')]['id']},'include':_0x129268})[_0xd78e('0x1a')](handleEntityNotFound(_0x2faeda,null))[_0xd78e('0x1a')](function(_0x4673e0){if(_0x4673e0&&_0x4673e0[_0xd78e('0x5d')]){var _0x5365e5=_0x4673e0['get']({'plain':!![]});fs[_0xd78e('0x5f')](_0x596310);for(var _0x2eadc3=0x0;_0x2eadc3<_0x5365e5[_0xd78e('0x5d')]['length'];_0x2eadc3++){var _0x47bb5b=_0x5365e5[_0xd78e('0x5d')][_0x2eadc3][_0xd78e('0x5c')];if(_0x47bb5b){var _0x10f7c0=path[_0xd78e('0x57')](_0x263b4d,_0x47bb5b[_0xd78e('0x60')]);if(fs[_0xd78e('0x61')](_0x10f7c0)){fs[_0xd78e('0x62')](_0x10f7c0)['pipe'](fs['createWriteStream'](path[_0xd78e('0x57')](_0x596310,_0x47bb5b[_0xd78e('0x60')])));}}}return BPromise[_0xd78e('0x63')]()['then'](function(){return new BPromise(function(_0x41ef2b,_0x5ea59e){zipdir(_0x596310,{'saveTo':_0xa8a1e3},function(_0x12f77b,_0x2937e7){if(_0x12f77b)return _0x5ea59e(_0x12f77b);return _0x41ef2b(_0x2937e7);});})[_0xd78e('0x1a')](function(){return new BPromise(function(_0x7625e0,_0x24084e){rimraf(_0x596310,function(_0x5d2ac9){if(_0x5d2ac9)_0x24084e(_0x5d2ac9);return _0x7625e0();});});})[_0xd78e('0x1a')](function(){return _0x2faeda[_0xd78e('0x55')](_0xa8a1e3,_0x4a9da6,function(_0x2d3304){if(_0x2d3304){console[_0xd78e('0x64')](_0xd78e('0x65'),_0x2d3304);}else{fs['unlinkSync'](_0xa8a1e3);}});});});}else{return _0x2faeda[_0xd78e('0x10')](0xc8);}})[_0xd78e('0x2a')](handleError(_0x2faeda,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index 29b10d2..a356a50 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 _0x4e82=['length','emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxInteraction','FaxMessage','getUsers','setDataValue','Users','map','findAll','then','unreadMessages'];(function(_0x1a280b,_0x2bcce2){var _0x9a8789=function(_0x4aa1f8){while(--_0x4aa1f8){_0x1a280b['push'](_0x1a280b['shift']());}};_0x9a8789(++_0x2bcce2);}(_0x4e82,0x1e5));var _0x24e8=function(_0x238eb0,_0x4144e9){_0x238eb0=_0x238eb0-0x0;var _0x351261=_0x4e82[_0x238eb0];return _0x351261;};'use strict';var EventEmitter=require(_0x24e8('0x0'));var FaxInteraction=require(_0x24e8('0x1'))['db'][_0x24e8('0x2')];var FaxMessage=require(_0x24e8('0x1'))['db'][_0x24e8('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x273066){return function(_0x49e5e2,_0x4a3fcd,_0x528eb4){_0x49e5e2[_0x24e8('0x4')]({'attributes':['id'],'raw':!![]})['then'](function(_0x54cc50){_0x49e5e2[_0x24e8('0x5')](_0x24e8('0x6'),_0x54cc50[_0x24e8('0x7')](function(_0x53889a){return{'id':_0x53889a['id']};}));return FaxMessage[_0x24e8('0x8')]({'where':{'FaxInteractionId':_0x49e5e2['id'],'direction':'in','read':![]},'raw':!![]});})[_0x24e8('0x9')](function(_0x1d7bd6){_0x49e5e2[_0x24e8('0x5')](_0x24e8('0xa'),_0x1d7bd6[_0x24e8('0xb')]);FaxInteractionEvents[_0x24e8('0xc')](_0x273066+':'+_0x49e5e2['id'],_0x49e5e2);FaxInteractionEvents[_0x24e8('0xc')](_0x273066,_0x49e5e2);_0x528eb4(null);})['catch'](_0x528eb4(null));};}for(var e in events){if(events[_0x24e8('0xd')](e)){var event=events[e];FaxInteraction[_0x24e8('0xe')](e,emitEvent(event));}}module[_0x24e8('0xf')]=FaxInteractionEvents; \ No newline at end of file +var _0xf99d=['emit','catch','hook','exports','events','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','save','update','remove','setDataValue','map','then','length'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf99d,0xb4));var _0xdf99=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0xf99d[_0x5f09c5];return _0x426ad9;};'use strict';var EventEmitter=require(_0xdf99('0x0'));var FaxInteraction=require(_0xdf99('0x1'))['db'][_0xdf99('0x2')];var FaxMessage=require('../../mysqldb')['db'][_0xdf99('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xdf99('0x4')](0x0);var events={'afterCreate':_0xdf99('0x5'),'afterUpdate':_0xdf99('0x6'),'afterDestroy':_0xdf99('0x7')};function emitEvent(_0xc4d10a){return function(_0x584521,_0x380588,_0x462b40){_0x584521['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x5a9825){_0x584521[_0xdf99('0x8')]('Users',_0x5a9825[_0xdf99('0x9')](function(_0x4fde12){return{'id':_0x4fde12['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0x584521['id'],'direction':'in','read':![]},'raw':!![]});})[_0xdf99('0xa')](function(_0x28e3ff){_0x584521[_0xdf99('0x8')]('unreadMessages',_0x28e3ff[_0xdf99('0xb')]);FaxInteractionEvents[_0xdf99('0xc')](_0xc4d10a+':'+_0x584521['id'],_0x584521);FaxInteractionEvents[_0xdf99('0xc')](_0xc4d10a,_0x584521);_0x462b40(null);})[_0xdf99('0xd')](_0x462b40(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxInteraction[_0xdf99('0xe')](e,emitEvent(event));}}module[_0xdf99('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 0844edf..94a39bf 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 _0x605a=['exports','define','FaxInteraction','changed','closed','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./faxInteraction.attributes'];(function(_0x3bb859,_0x589816){var _0x3bf534=function(_0xa586c){while(--_0xa586c){_0x3bb859['push'](_0x3bb859['shift']());}};_0x3bf534(++_0x589816);}(_0x605a,0x126));var _0xa605=function(_0x4e6a91,_0x11f49a){_0x4e6a91=_0x4e6a91-0x0;var _0x394af1=_0x605a[_0x4e6a91];return _0x394af1;};'use strict';var _=require(_0xa605('0x0'));var util=require(_0xa605('0x1'));var logger=require(_0xa605('0x2'))(_0xa605('0x3'));var moment=require(_0xa605('0x4'));var BPromise=require(_0xa605('0x5'));var rp=require(_0xa605('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa605('0x7'));var config=require(_0xa605('0x8'));var attributes=require(_0xa605('0x9'));module[_0xa605('0xa')]=function(_0x1c5c54,_0xb757f5){return _0x1c5c54[_0xa605('0xb')](_0xa605('0xc'),attributes,{'tableName':'fax_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x38f9ef,_0x153cf4,_0x40e96b){if(_0x38f9ef[_0xa605('0xd')](_0xa605('0xe'))){_0x38f9ef['closedAt']=moment()['format'](_0xa605('0xf'));}_0x40e96b(null,_0x38f9ef);}}});}; \ No newline at end of file +var _0x1f2e=['../../config/environment','./faxInteraction.attributes','exports','define','FaxInteraction','fax_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x581af1,_0x4f02c5){var _0x54c22e=function(_0x5a7a5a){while(--_0x5a7a5a){_0x581af1['push'](_0x581af1['shift']());}};_0x54c22e(++_0x4f02c5);}(_0x1f2e,0x82));var _0xe1f2=function(_0x634186,_0x2a0d26){_0x634186=_0x634186-0x0;var _0x1de1d8=_0x1f2e[_0x634186];return _0x1de1d8;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe1f2('0x0'))(_0xe1f2('0x1'));var moment=require(_0xe1f2('0x2'));var BPromise=require(_0xe1f2('0x3'));var rp=require(_0xe1f2('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe1f2('0x5'));var config=require(_0xe1f2('0x6'));var attributes=require(_0xe1f2('0x7'));module[_0xe1f2('0x8')]=function(_0xae6dc7,_0x41bd1a){return _0xae6dc7[_0xe1f2('0x9')](_0xe1f2('0xa'),attributes,{'tableName':_0xe1f2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1b08c4,_0x9ec46a,_0x44ba1d){if(_0x1b08c4[_0xe1f2('0xc')](_0xe1f2('0xd'))){_0x1b08c4[_0xe1f2('0xe')]=moment()[_0xe1f2('0xf')](_0xe1f2('0x10'));}_0x44ba1d(null,_0x1b08c4);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 8e3672c..1519ae9 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 _0x862f=['./faxInteraction.socket','register','then','info','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','error','code','FaxInteraction,\x20%s,\x20%s','message','catch','UpdateFaxInteraction','update','body','options','raw','where','limit','stringify','AddTagsToFaxInteraction','FaxInteraction','find','addTags','ids','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','localhost','socket.io-emitter','redis'];(function(_0x542174,_0xf4190){var _0x3b4c31=function(_0x3cae6e){while(--_0x3cae6e){_0x542174['push'](_0x542174['shift']());}};_0x3b4c31(++_0xf4190);}(_0x862f,0x1be));var _0xf862=function(_0x2d4686,_0x3d6dbb){_0x2d4686=_0x2d4686-0x0;var _0x16f68b=_0x862f[_0x2d4686];return _0x16f68b;};'use strict';var _=require(_0xf862('0x0'));var util=require(_0xf862('0x1'));var moment=require(_0xf862('0x2'));var BPromise=require(_0xf862('0x3'));var rs=require(_0xf862('0x4'));var fs=require('fs');var Redis=require(_0xf862('0x5'));var db=require(_0xf862('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xf862('0x7'))(_0xf862('0x8'));var config=require(_0xf862('0x9'));var jayson=require(_0xf862('0xa'));var client=jayson[_0xf862('0xb')]['http']({'port':0x232a});config['redis']=_[_0xf862('0xc')](config['redis'],{'host':_0xf862('0xd'),'port':0x18eb});var socket=require(_0xf862('0xe'))(new Redis(config[_0xf862('0xf')]));require(_0xf862('0x10'))[_0xf862('0x11')](socket);function respondWithRpcPromise(_0x4b63c1,_0x3612e4,_0x44125a){return new BPromise(function(_0x55a840,_0x1fac35){return client['request'](_0x4b63c1,_0x44125a)[_0xf862('0x12')](function(_0x3f201d){logger[_0xf862('0x13')]('FaxInteraction,\x20%s,\x20%s',_0x3612e4,_0xf862('0x14'));logger[_0xf862('0x15')](_0xf862('0x16'),_0x3612e4,'request\x20sent',JSON['stringify'](_0x3f201d));if(_0x3f201d[_0xf862('0x17')]){if(_0x3f201d[_0xf862('0x17')][_0xf862('0x18')]===0x1f4){logger[_0xf862('0x17')](_0xf862('0x19'),_0x3612e4,_0x3f201d[_0xf862('0x17')][_0xf862('0x1a')]);return _0x1fac35(_0x3f201d[_0xf862('0x17')][_0xf862('0x1a')]);}logger['error'](_0xf862('0x19'),_0x3612e4,_0x3f201d[_0xf862('0x17')][_0xf862('0x1a')]);return _0x55a840(_0x3f201d[_0xf862('0x17')]['message']);}else{logger['info'](_0xf862('0x19'),_0x3612e4,_0xf862('0x14'));_0x55a840(_0x3f201d['result'][_0xf862('0x1a')]);}})[_0xf862('0x1b')](function(_0x586883){logger[_0xf862('0x17')](_0xf862('0x19'),_0x3612e4,_0x586883);_0x1fac35(_0x586883);});});}exports[_0xf862('0x1c')]=function(_0x3b6978){var _0x167290=this;return new Promise(function(_0x5ec7b1,_0x5a1550){return db['FaxInteraction'][_0xf862('0x1d')](_0x3b6978[_0xf862('0x1e')],{'raw':_0x3b6978[_0xf862('0x1f')]?_0x3b6978[_0xf862('0x1f')][_0xf862('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3b6978['options']?_0x3b6978[_0xf862('0x1f')][_0xf862('0x21')]||null:null,'attributes':_0x3b6978[_0xf862('0x1f')]?_0x3b6978[_0xf862('0x1f')]['attributes']||null:null,'limit':_0x3b6978['options']?_0x3b6978[_0xf862('0x1f')][_0xf862('0x22')]||null:null})[_0xf862('0x12')](function(_0x38979e){logger[_0xf862('0x13')](_0xf862('0x1c'),_0x3b6978);logger[_0xf862('0x15')]('UpdateFaxInteraction',_0x3b6978,JSON[_0xf862('0x23')](_0x38979e));_0x5ec7b1(_0x38979e);})[_0xf862('0x1b')](function(_0x5ab0ea){logger[_0xf862('0x17')](_0xf862('0x1c'),_0x5ab0ea[_0xf862('0x1a')],_0x3b6978);_0x5a1550(_0x167290[_0xf862('0x17')](0x1f4,_0x5ab0ea[_0xf862('0x1a')]));});});};exports[_0xf862('0x24')]=function(_0x3831c5){return new Promise(function(_0x14557c,_0x3c2130){return db[_0xf862('0x25')][_0xf862('0x26')]({'where':_0x3831c5['options']?_0x3831c5[_0xf862('0x1f')][_0xf862('0x21')]||null:null})[_0xf862('0x12')](function(_0x3797ff){if(_0x3797ff){return _0x3797ff[_0xf862('0x27')](_0x3831c5['body'][_0xf862('0x28')],_['omit'](_0x3831c5[_0xf862('0x1e')],[_0xf862('0x28'),'id'])||{});}})['spread'](function(_0x4d88d3){logger['info'](_0xf862('0x29'),_0x3831c5);logger[_0xf862('0x15')](_0xf862('0x29'),_0x3831c5,JSON[_0xf862('0x23')](_0x4d88d3));_0x14557c(_0x4d88d3);})[_0xf862('0x1b')](function(_0x33fd95){logger[_0xf862('0x17')](_0xf862('0x29'),_0x33fd95[_0xf862('0x1a')],_0x3831c5);_0x3c2130(_this['error'](0x1f4,_0x33fd95[_0xf862('0x1a')]));});});}; \ No newline at end of file +var _0x2d37=['omit','spread','AddTags','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','then','info','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','UpdateFaxInteraction','FaxInteraction','update','body','raw','options','where','attributes','limit','stringify','AddTagsToFaxInteraction','addTags','ids'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0x2d37,0x1c6));var _0x72d3=function(_0x2ba56c,_0x20bece){_0x2ba56c=_0x2ba56c-0x0;var _0x44f9ba=_0x2d37[_0x2ba56c];return _0x44f9ba;};'use strict';var _=require('lodash');var util=require(_0x72d3('0x0'));var moment=require('moment');var BPromise=require(_0x72d3('0x1'));var rs=require(_0x72d3('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x72d3('0x3'))['db'];var utils=require(_0x72d3('0x4'));var logger=require(_0x72d3('0x5'))(_0x72d3('0x6'));var config=require(_0x72d3('0x7'));var jayson=require(_0x72d3('0x8'));var client=jayson[_0x72d3('0x9')]['http']({'port':0x232a});config[_0x72d3('0xa')]=_[_0x72d3('0xb')](config[_0x72d3('0xa')],{'host':_0x72d3('0xc'),'port':0x18eb});var socket=require(_0x72d3('0xd'))(new Redis(config[_0x72d3('0xa')]));require(_0x72d3('0xe'))['register'](socket);function respondWithRpcPromise(_0x494bcd,_0x1279cc,_0x2bd356){return new BPromise(function(_0x2b0a0b,_0x47ded5){return client['request'](_0x494bcd,_0x2bd356)[_0x72d3('0xf')](function(_0x3e05be){logger[_0x72d3('0x10')]('FaxInteraction,\x20%s,\x20%s',_0x1279cc,_0x72d3('0x11'));logger[_0x72d3('0x12')](_0x72d3('0x13'),_0x1279cc,_0x72d3('0x11'),JSON['stringify'](_0x3e05be));if(_0x3e05be[_0x72d3('0x14')]){if(_0x3e05be[_0x72d3('0x14')][_0x72d3('0x15')]===0x1f4){logger[_0x72d3('0x14')]('FaxInteraction,\x20%s,\x20%s',_0x1279cc,_0x3e05be[_0x72d3('0x14')][_0x72d3('0x16')]);return _0x47ded5(_0x3e05be[_0x72d3('0x14')]['message']);}logger[_0x72d3('0x14')]('FaxInteraction,\x20%s,\x20%s',_0x1279cc,_0x3e05be[_0x72d3('0x14')][_0x72d3('0x16')]);return _0x2b0a0b(_0x3e05be[_0x72d3('0x14')]['message']);}else{logger['info']('FaxInteraction,\x20%s,\x20%s',_0x1279cc,_0x72d3('0x11'));_0x2b0a0b(_0x3e05be[_0x72d3('0x17')][_0x72d3('0x16')]);}})[_0x72d3('0x18')](function(_0x3f2753){logger['error']('FaxInteraction,\x20%s,\x20%s',_0x1279cc,_0x3f2753);_0x47ded5(_0x3f2753);});});}exports[_0x72d3('0x19')]=function(_0x27e4e3){var _0x49f31c=this;return new Promise(function(_0x4138d3,_0x1bffd9){return db[_0x72d3('0x1a')][_0x72d3('0x1b')](_0x27e4e3[_0x72d3('0x1c')],{'raw':_0x27e4e3['options']?_0x27e4e3['options'][_0x72d3('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x27e4e3[_0x72d3('0x1e')]?_0x27e4e3['options'][_0x72d3('0x1f')]||null:null,'attributes':_0x27e4e3[_0x72d3('0x1e')]?_0x27e4e3[_0x72d3('0x1e')][_0x72d3('0x20')]||null:null,'limit':_0x27e4e3[_0x72d3('0x1e')]?_0x27e4e3[_0x72d3('0x1e')][_0x72d3('0x21')]||null:null})[_0x72d3('0xf')](function(_0x59a0e5){logger[_0x72d3('0x10')](_0x72d3('0x19'),_0x27e4e3);logger[_0x72d3('0x12')]('UpdateFaxInteraction',_0x27e4e3,JSON[_0x72d3('0x22')](_0x59a0e5));_0x4138d3(_0x59a0e5);})[_0x72d3('0x18')](function(_0x52c1bb){logger[_0x72d3('0x14')]('UpdateFaxInteraction',_0x52c1bb[_0x72d3('0x16')],_0x27e4e3);_0x1bffd9(_0x49f31c[_0x72d3('0x14')](0x1f4,_0x52c1bb[_0x72d3('0x16')]));});});};exports[_0x72d3('0x23')]=function(_0x41b545){return new Promise(function(_0x31a648,_0x2f8637){return db[_0x72d3('0x1a')]['find']({'where':_0x41b545['options']?_0x41b545['options'][_0x72d3('0x1f')]||null:null})[_0x72d3('0xf')](function(_0x296f63){if(_0x296f63){return _0x296f63[_0x72d3('0x24')](_0x41b545['body'][_0x72d3('0x25')],_[_0x72d3('0x26')](_0x41b545[_0x72d3('0x1c')],[_0x72d3('0x25'),'id'])||{});}})[_0x72d3('0x27')](function(_0x2616a6){logger[_0x72d3('0x10')](_0x72d3('0x28'),_0x41b545);logger[_0x72d3('0x12')]('AddTags',_0x41b545,JSON[_0x72d3('0x22')](_0x2616a6));_0x31a648(_0x2616a6);})[_0x72d3('0x18')](function(_0x540266){logger[_0x72d3('0x14')]('AddTags',_0x540266[_0x72d3('0x16')],_0x41b545);_0x2f8637(_this['error'](0x1f4,_0x540266[_0x72d3('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index 29327cf..d485f47 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 _0x9ec5=['update','emit','removeListener','length','faxInteraction:','./faxInteraction.events','save','remove'];(function(_0x582134,_0x2bf286){var _0x4f0dce=function(_0x1f7f1d){while(--_0x1f7f1d){_0x582134['push'](_0x582134['shift']());}};_0x4f0dce(++_0x2bf286);}(_0x9ec5,0x10d));var _0x59ec=function(_0x5756f8,_0x22b6d5){_0x5756f8=_0x5756f8-0x0;var _0x3bb749=_0x9ec5[_0x5756f8];return _0x3bb749;};'use strict';var FaxInteractionEvents=require(_0x59ec('0x0'));var events=[_0x59ec('0x1'),_0x59ec('0x2'),_0x59ec('0x3')];function createListener(_0x447edb,_0x333852){return function(_0x44e722){_0x333852[_0x59ec('0x4')](_0x447edb,_0x44e722);};}function removeListener(_0x2fff64,_0x3bd009){return function(){FaxInteractionEvents[_0x59ec('0x5')](_0x2fff64,_0x3bd009);};}exports['register']=function(_0x2d94ca){for(var _0x494c0=0x0,_0x36c604=events[_0x59ec('0x6')];_0x494c0<_0x36c604;_0x494c0++){var _0x10bd01=events[_0x494c0];var _0x565259=createListener(_0x59ec('0x7')+_0x10bd01,_0x2d94ca);FaxInteractionEvents['on'](_0x10bd01,_0x565259);}}; \ No newline at end of file +var _0x0468=['./faxInteraction.events','emit','removeListener','register','length','faxInteraction:'];(function(_0xca3904,_0x24fc67){var _0x5d9605=function(_0x40dedf){while(--_0x40dedf){_0xca3904['push'](_0xca3904['shift']());}};_0x5d9605(++_0x24fc67);}(_0x0468,0x1f2));var _0x8046=function(_0x3bbf06,_0x82f292){_0x3bbf06=_0x3bbf06-0x0;var _0x1dcfbb=_0x0468[_0x3bbf06];return _0x1dcfbb;};'use strict';var FaxInteractionEvents=require(_0x8046('0x0'));var events=['save','remove','update'];function createListener(_0x417694,_0x69c572){return function(_0x2c1c44){_0x69c572[_0x8046('0x1')](_0x417694,_0x2c1c44);};}function removeListener(_0xd24cef,_0x4d790c){return function(){FaxInteractionEvents[_0x8046('0x2')](_0xd24cef,_0x4d790c);};}exports[_0x8046('0x3')]=function(_0x153ab3){for(var _0x320932=0x0,_0x83e5f4=events[_0x8046('0x4')];_0x320932<_0x83e5f4;_0x320932++){var _0xd8924a=events[_0x320932];var _0x249186=createListener(_0x8046('0x5')+_0xd8924a,_0x153ab3);FaxInteractionEvents['on'](_0xd8924a,_0x249186);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index abfd55a..c4d33d0 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 _0xeb6e=['path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./faxInteraction.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','addMessage','/:id/tags','tracked','fax','faxinteraction:addtags','addTags','put','faxinteraction:destroy','destroy','delete','removeTags','exports','multer','util'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0xeb6e,0xa3));var _0xeeb6=function(_0x38235f,_0x537d9e){_0x38235f=_0x38235f-0x0;var _0x5e2676=_0xeb6e[_0x38235f];return _0x5e2676;};'use strict';var multer=require(_0xeeb6('0x0'));var util=require(_0xeeb6('0x1'));var path=require(_0xeeb6('0x2'));var timeout=require(_0xeeb6('0x3'));var express=require(_0xeeb6('0x4'));var router=express['Router']();var fs_extra=require(_0xeeb6('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xeeb6('0x6'));var config=require(_0xeeb6('0x7'));var controller=require(_0xeeb6('0x8'));router['get']('/',auth[_0xeeb6('0x9')](),controller[_0xeeb6('0xa')]);router[_0xeeb6('0xb')](_0xeeb6('0xc'),auth[_0xeeb6('0x9')](),controller[_0xeeb6('0xd')]);router[_0xeeb6('0xb')](_0xeeb6('0xe'),auth[_0xeeb6('0x9')](),controller[_0xeeb6('0xf')]);router[_0xeeb6('0xb')](_0xeeb6('0x10'),auth[_0xeeb6('0x9')](),controller[_0xeeb6('0x11')]);router[_0xeeb6('0xb')](_0xeeb6('0x12'),auth[_0xeeb6('0x9')](),controller[_0xeeb6('0x13')]);router[_0xeeb6('0x14')]('/',auth[_0xeeb6('0x9')](),controller['create']);router[_0xeeb6('0x14')](_0xeeb6('0x10'),auth[_0xeeb6('0x9')](),controller[_0xeeb6('0x15')]);router[_0xeeb6('0x14')](_0xeeb6('0x16'),auth[_0xeeb6('0x9')](),interaction[_0xeeb6('0x17')](_0xeeb6('0x18'),_0xeeb6('0x19')),controller[_0xeeb6('0x1a')]);router[_0xeeb6('0x1b')]('/:id',auth[_0xeeb6('0x9')](),interaction[_0xeeb6('0x17')](_0xeeb6('0x18'),'faxinteraction:update'),controller['update']);router['delete'](_0xeeb6('0xe'),auth[_0xeeb6('0x9')](),interaction[_0xeeb6('0x17')]('fax',_0xeeb6('0x1c')),controller[_0xeeb6('0x1d')]);router[_0xeeb6('0x1e')](_0xeeb6('0x16'),auth[_0xeeb6('0x9')](),controller[_0xeeb6('0x1f')]);module[_0xeeb6('0x20')]=router; \ No newline at end of file +var _0x8d84=['fax','addTags','faxinteraction:update','faxinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','index','describe','/:id','/:id/messages','getMessages','/:id/download','post','create','addMessage','/:id/tags','tracked'];(function(_0x52c4d3,_0x1027e0){var _0x25da6f=function(_0x11b2b3){while(--_0x11b2b3){_0x52c4d3['push'](_0x52c4d3['shift']());}};_0x25da6f(++_0x1027e0);}(_0x8d84,0x64));var _0x48d8=function(_0x1fa4ae,_0x275d5b){_0x1fa4ae=_0x1fa4ae-0x0;var _0x32eda0=_0x8d84[_0x1fa4ae];return _0x32eda0;};'use strict';var multer=require(_0x48d8('0x0'));var util=require(_0x48d8('0x1'));var path=require(_0x48d8('0x2'));var timeout=require(_0x48d8('0x3'));var express=require(_0x48d8('0x4'));var router=express[_0x48d8('0x5')]();var fs_extra=require(_0x48d8('0x6'));var auth=require(_0x48d8('0x7'));var interaction=require(_0x48d8('0x8'));var config=require(_0x48d8('0x9'));var controller=require(_0x48d8('0xa'));router[_0x48d8('0xb')]('/',auth[_0x48d8('0xc')](),controller[_0x48d8('0xd')]);router['get']('/describe',auth[_0x48d8('0xc')](),controller[_0x48d8('0xe')]);router[_0x48d8('0xb')](_0x48d8('0xf'),auth[_0x48d8('0xc')](),controller['show']);router[_0x48d8('0xb')](_0x48d8('0x10'),auth['isAuthenticated'](),controller[_0x48d8('0x11')]);router[_0x48d8('0xb')](_0x48d8('0x12'),auth[_0x48d8('0xc')](),controller['download']);router[_0x48d8('0x13')]('/',auth[_0x48d8('0xc')](),controller[_0x48d8('0x14')]);router[_0x48d8('0x13')]('/:id/messages',auth['isAuthenticated'](),controller[_0x48d8('0x15')]);router[_0x48d8('0x13')](_0x48d8('0x16'),auth[_0x48d8('0xc')](),interaction[_0x48d8('0x17')](_0x48d8('0x18'),'faxinteraction:addtags'),controller[_0x48d8('0x19')]);router['put'](_0x48d8('0xf'),auth[_0x48d8('0xc')](),interaction[_0x48d8('0x17')](_0x48d8('0x18'),_0x48d8('0x1a')),controller['update']);router['delete'](_0x48d8('0xf'),auth[_0x48d8('0xc')](),interaction[_0x48d8('0x17')](_0x48d8('0x18'),_0x48d8('0x1b')),controller[_0x48d8('0x1c')]);router['delete'](_0x48d8('0x16'),auth[_0x48d8('0xc')](),controller[_0x48d8('0x1d')]);module[_0x48d8('0x1e')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index dfe2716..738e6ea 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 _0xe739=['DATE','sequelize','TEXT','medium','BOOLEAN'];(function(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0xe739,0x105));var _0x9e73=function(_0x5db3f7,_0x2deccc){_0x5db3f7=_0x5db3f7-0x0;var _0x1a730b=_0xe739[_0x5db3f7];return _0x1a730b;};'use strict';var Sequelize=require(_0x9e73('0x0'));module['exports']={'body':{'type':Sequelize[_0x9e73('0x1')](_0x9e73('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x9e73('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'out','allowNull':![]},'failMessage':{'type':Sequelize[_0x9e73('0x1')],'defaultValue':null},'readAt':{'type':Sequelize[_0x9e73('0x4')]}}; \ No newline at end of file +var _0xb66c=['DATE','sequelize','TEXT','BOOLEAN','ENUM','out'];(function(_0x4cf3ee,_0x322ca5){var _0x347bb4=function(_0x1d9fe0){while(--_0x1d9fe0){_0x4cf3ee['push'](_0x4cf3ee['shift']());}};_0x347bb4(++_0x322ca5);}(_0xb66c,0x175));var _0xcb66=function(_0x299d8a,_0x35ccee){_0x299d8a=_0x299d8a-0x0;var _0x1375c9=_0xb66c[_0x299d8a];return _0x1375c9;};'use strict';var Sequelize=require(_0xcb66('0x0'));module['exports']={'body':{'type':Sequelize[_0xcb66('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xcb66('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xcb66('0x3')]('in',_0xcb66('0x4')),'defaultValue':'out','allowNull':![]},'failMessage':{'type':Sequelize[_0xcb66('0x1')],'defaultValue':null},'readAt':{'type':Sequelize[_0xcb66('0x5')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index c53ec8e..ff566f4 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 _0xc131=['acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','fullname','internal','manual','SIP/%s','channel','event','accept','EventManager','fax-interactions','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','RejectMessage','rejectMessage','email','interface','rejectmessage','create','CmContact','findOne','Attachment','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','download','root','server','files','attachments','join','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','./faxMessage.socket','register','jayson/promise','client','http','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','error','code','message','status','end','offset','limit','undefined','count','Content-Range','reject','save','update','sendStatus','stack','name','index','map','FaxMessage','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','rows','catch','show','keys','options','find','body','params','destroy','describe','fax','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','FaxInteraction','FaxInteractionId','isNil','interaction','null','AcceptMessage'];(function(_0x1e4fc5,_0x967500){var _0x17cf4e=function(_0x2ce0a4){while(--_0x2ce0a4){_0x1e4fc5['push'](_0x1e4fc5['shift']());}};_0x17cf4e(++_0x967500);}(_0xc131,0x1db));var _0x1c13=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xc131[_0x4a9fb1];return _0x348672;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1c13('0x0'));var zipdir=require(_0x1c13('0x1'));var jsonpatch=require(_0x1c13('0x2'));var rp=require(_0x1c13('0x3'));var moment=require(_0x1c13('0x4'));var BPromise=require(_0x1c13('0x5'));var Mustache=require(_0x1c13('0x6'));var util=require(_0x1c13('0x7'));var path=require(_0x1c13('0x8'));var sox=require(_0x1c13('0x9'));var csv=require('to-csv');var ejs=require(_0x1c13('0xa'));var fs=require('fs');var fs_extra=require(_0x1c13('0xb'));var _=require(_0x1c13('0xc'));var squel=require(_0x1c13('0xd'));var crypto=require(_0x1c13('0xe'));var jsforce=require(_0x1c13('0xf'));var deskjs=require(_0x1c13('0x10'));var toCsv=require(_0x1c13('0x11'));var querystring=require(_0x1c13('0x12'));var Papa=require(_0x1c13('0x13'));var Redis=require('ioredis');var authService=require(_0x1c13('0x14'));var qs=require(_0x1c13('0x15'));var as=require(_0x1c13('0x16'));var hardwareService=require(_0x1c13('0x17'));var logger=require(_0x1c13('0x18'))('api');var utils=require(_0x1c13('0x19'));var config=require(_0x1c13('0x1a'));var licenseUtil=require(_0x1c13('0x1b'));var db=require('../../mysqldb')['db'];config[_0x1c13('0x1c')]=_['defaults'](config[_0x1c13('0x1c')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1c13('0x1c')]));require(_0x1c13('0x1d'))[_0x1c13('0x1e')](socket);var jayson=require(_0x1c13('0x1f'));var client=jayson[_0x1c13('0x20')]['http']({'port':0x232c});var client9002=jayson[_0x1c13('0x20')][_0x1c13('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x53e193,_0x1b7cdd,_0x4a0e57,_0x350c7e){return new BPromise(function(_0x337842,_0x37d3d7){var _0x316a12=_0x350c7e||client;return _0x316a12[_0x1c13('0x22')](_0x53e193,_0x4a0e57)[_0x1c13('0x23')](function(_0x4fdd52){logger[_0x1c13('0x24')](_0x1c13('0x25'),_0x1b7cdd,_0x1c13('0x26'));logger['debug']('FaxMessage,\x20%s,\x20%s,\x20%s',_0x1b7cdd,'request\x20sent',JSON['stringify'](_0x4fdd52));if(_0x4fdd52[_0x1c13('0x27')]){if(_0x4fdd52[_0x1c13('0x27')][_0x1c13('0x28')]===0x1f4){logger[_0x1c13('0x27')]('FaxMessage,\x20%s,\x20%s',_0x1b7cdd,_0x4fdd52[_0x1c13('0x27')]['message']);return _0x37d3d7(_0x4fdd52[_0x1c13('0x27')][_0x1c13('0x29')]);}logger[_0x1c13('0x27')](_0x1c13('0x25'),_0x1b7cdd,_0x4fdd52[_0x1c13('0x27')]['message']);return _0x337842(_0x4fdd52[_0x1c13('0x27')]['message']);}else{logger[_0x1c13('0x24')](_0x1c13('0x25'),_0x1b7cdd,_0x1c13('0x26'));_0x337842(_0x4fdd52['result'][_0x1c13('0x29')]);}})['catch'](function(_0x294475){logger['error']('FaxMessage,\x20%s,\x20%s',_0x1b7cdd,_0x294475);_0x37d3d7(_0x294475);});});}function respondWithStatusCode(_0x4cffc8,_0x572910){_0x572910=_0x572910||0xcc;return function(_0x2b41b3){if(_0x2b41b3){return _0x4cffc8['sendStatus'](_0x572910);}return _0x4cffc8[_0x1c13('0x2a')](_0x572910)[_0x1c13('0x2b')]();};}function respondWithResult(_0x3bd971,_0x28aa54){_0x28aa54=_0x28aa54||0xc8;return function(_0x3d6472){if(_0x3d6472){return _0x3bd971[_0x1c13('0x2a')](_0x28aa54)['json'](_0x3d6472);}};}function respondWithFilteredResult(_0x3140d8,_0x14ef3e){return function(_0x13c4c2){if(_0x13c4c2){var _0x149c91=typeof _0x14ef3e[_0x1c13('0x2c')]==='undefined'&&typeof _0x14ef3e[_0x1c13('0x2d')]===_0x1c13('0x2e');var _0x5869a1=_0x13c4c2[_0x1c13('0x2f')];var _0x476a96=_0x149c91?0x0:_0x14ef3e[_0x1c13('0x2c')];var _0x4aefd5=_0x149c91?_0x13c4c2[_0x1c13('0x2f')]:_0x14ef3e[_0x1c13('0x2c')]+_0x14ef3e[_0x1c13('0x2d')];var _0x25bf4e;if(_0x4aefd5>=_0x5869a1){_0x4aefd5=_0x5869a1;_0x25bf4e=0xc8;}else{_0x25bf4e=0xce;}_0x3140d8[_0x1c13('0x2a')](_0x25bf4e);return _0x3140d8['set'](_0x1c13('0x30'),_0x476a96+'-'+_0x4aefd5+'/'+_0x5869a1)['json'](_0x13c4c2);}return null;};}function patchUpdates(_0x27e97f){return function(_0x581a47){try{jsonpatch['apply'](_0x581a47,_0x27e97f,!![]);}catch(_0x531cc9){return BPromise[_0x1c13('0x31')](_0x531cc9);}return _0x581a47[_0x1c13('0x32')]();};}function saveUpdates(_0x37c721,_0x4f80b1){return function(_0x45caba){if(_0x45caba){return _0x45caba[_0x1c13('0x33')](_0x37c721)[_0x1c13('0x23')](function(_0xdbedbc){return _0xdbedbc;});}return null;};}function removeEntity(_0x4f6e1f,_0xb96ea6){return function(_0x40498f){if(_0x40498f){return _0x40498f['destroy']()['then'](function(){_0x4f6e1f[_0x1c13('0x2a')](0xcc)[_0x1c13('0x2b')]();});}};}function handleEntityNotFound(_0x5a0749,_0x8e1c9f){return function(_0x2115bc){if(!_0x2115bc){_0x5a0749[_0x1c13('0x34')](0x194);}return _0x2115bc;};}function handleError(_0xa6ad02,_0x4ee8fc){_0x4ee8fc=_0x4ee8fc||0x1f4;return function(_0x5bd2e9){logger[_0x1c13('0x27')](_0x5bd2e9[_0x1c13('0x35')]);if(_0x5bd2e9[_0x1c13('0x36')]){delete _0x5bd2e9['name'];}_0xa6ad02[_0x1c13('0x2a')](_0x4ee8fc)['send'](_0x5bd2e9);};}exports[_0x1c13('0x37')]=function(_0x209c3f,_0x43d8b6){var _0x42c7f6={},_0x3b3d22={},_0x2aa59d={'count':0x0,'rows':[]};var _0x19b560=_[_0x1c13('0x38')](db[_0x1c13('0x39')][_0x1c13('0x3a')],function(_0x5ac3cd){return{'name':_0x5ac3cd[_0x1c13('0x3b')],'type':_0x5ac3cd[_0x1c13('0x3c')][_0x1c13('0x3d')]};});_0x3b3d22[_0x1c13('0x3e')]=_['map'](_0x19b560,'name');_0x3b3d22[_0x1c13('0x3f')]=_['keys'](_0x209c3f[_0x1c13('0x3f')]);_0x3b3d22[_0x1c13('0x40')]=_[_0x1c13('0x41')](_0x3b3d22[_0x1c13('0x3e')],_0x3b3d22['query']);_0x42c7f6[_0x1c13('0x42')]=_[_0x1c13('0x41')](_0x3b3d22[_0x1c13('0x3e')],qs[_0x1c13('0x43')](_0x209c3f[_0x1c13('0x3f')][_0x1c13('0x43')]));_0x42c7f6['attributes']=_0x42c7f6[_0x1c13('0x42')][_0x1c13('0x44')]?_0x42c7f6[_0x1c13('0x42')]:_0x3b3d22[_0x1c13('0x3e')];if(!_0x209c3f['query'][_0x1c13('0x45')](_0x1c13('0x46'))){_0x42c7f6[_0x1c13('0x2d')]=qs[_0x1c13('0x2d')](_0x209c3f['query']['limit']);_0x42c7f6['offset']=qs[_0x1c13('0x2c')](_0x209c3f['query'][_0x1c13('0x2c')]);}_0x42c7f6[_0x1c13('0x47')]=qs[_0x1c13('0x48')](_0x209c3f[_0x1c13('0x3f')][_0x1c13('0x48')]);_0x42c7f6['where']=qs['filters'](_[_0x1c13('0x49')](_0x209c3f[_0x1c13('0x3f')],_0x3b3d22[_0x1c13('0x40')]),_0x19b560);if(_0x209c3f[_0x1c13('0x3f')][_0x1c13('0x4a')]){_0x42c7f6[_0x1c13('0x4b')]=_[_0x1c13('0x4c')](_0x42c7f6[_0x1c13('0x4b')],{'$or':_[_0x1c13('0x38')](_0x19b560,function(_0x5d97da){if(_0x5d97da[_0x1c13('0x3c')]!==_0x1c13('0x4d')){var _0x3e72b6={};_0x3e72b6[_0x5d97da['name']]={'$like':'%'+_0x209c3f[_0x1c13('0x3f')][_0x1c13('0x4a')]+'%'};return _0x3e72b6;}})});}_0x42c7f6=_['merge']({},_0x42c7f6,_0x209c3f['options']);var _0x3800cf={'where':_0x42c7f6['where']};return db[_0x1c13('0x39')][_0x1c13('0x2f')](_0x3800cf)[_0x1c13('0x23')](function(_0x5463a3){_0x2aa59d['count']=_0x5463a3;if(_0x209c3f['query'][_0x1c13('0x4e')]){_0x42c7f6[_0x1c13('0x4f')]=[{'all':!![]}];}return db[_0x1c13('0x39')]['findAll'](_0x42c7f6);})[_0x1c13('0x23')](function(_0xcf0c2d){_0x2aa59d[_0x1c13('0x50')]=_0xcf0c2d;return _0x2aa59d;})[_0x1c13('0x23')](respondWithFilteredResult(_0x43d8b6,_0x42c7f6))[_0x1c13('0x51')](handleError(_0x43d8b6,null));};exports[_0x1c13('0x52')]=function(_0x4267d0,_0x44359f){var _0x250e17={'raw':!![],'where':{'id':_0x4267d0['params']['id']}},_0x37f740={};_0x37f740[_0x1c13('0x3e')]=_['keys'](db['FaxMessage'][_0x1c13('0x3a')]);_0x37f740[_0x1c13('0x3f')]=_[_0x1c13('0x53')](_0x4267d0[_0x1c13('0x3f')]);_0x37f740[_0x1c13('0x40')]=_[_0x1c13('0x41')](_0x37f740[_0x1c13('0x3e')],_0x37f740[_0x1c13('0x3f')]);_0x250e17['attributes']=_['intersection'](_0x37f740[_0x1c13('0x3e')],qs[_0x1c13('0x43')](_0x4267d0[_0x1c13('0x3f')][_0x1c13('0x43')]));_0x250e17[_0x1c13('0x42')]=_0x250e17[_0x1c13('0x42')][_0x1c13('0x44')]?_0x250e17[_0x1c13('0x42')]:_0x37f740[_0x1c13('0x3e')];if(_0x4267d0[_0x1c13('0x3f')][_0x1c13('0x4e')]){_0x250e17[_0x1c13('0x4f')]=[{'all':!![]}];}_0x250e17=_[_0x1c13('0x4c')]({},_0x250e17,_0x4267d0[_0x1c13('0x54')]);return db[_0x1c13('0x39')][_0x1c13('0x55')](_0x250e17)[_0x1c13('0x23')](handleEntityNotFound(_0x44359f,null))[_0x1c13('0x23')](respondWithResult(_0x44359f,null))[_0x1c13('0x51')](handleError(_0x44359f,null));};exports[_0x1c13('0x33')]=function(_0x2c2b0a,_0x5800e5){if(_0x2c2b0a[_0x1c13('0x56')]['id']){delete _0x2c2b0a['body']['id'];}return db[_0x1c13('0x39')][_0x1c13('0x55')]({'where':{'id':_0x2c2b0a[_0x1c13('0x57')]['id']}})[_0x1c13('0x23')](handleEntityNotFound(_0x5800e5,null))[_0x1c13('0x23')](saveUpdates(_0x2c2b0a[_0x1c13('0x56')],null))[_0x1c13('0x23')](respondWithResult(_0x5800e5,null))[_0x1c13('0x51')](handleError(_0x5800e5,null));};exports[_0x1c13('0x58')]=function(_0x283b27,_0x17c7fd){return db['FaxMessage'][_0x1c13('0x55')]({'where':{'id':_0x283b27[_0x1c13('0x57')]['id']}})['then'](handleEntityNotFound(_0x17c7fd,null))[_0x1c13('0x23')](removeEntity(_0x17c7fd,null))[_0x1c13('0x51')](handleError(_0x17c7fd,null));};exports[_0x1c13('0x59')]=function(_0x3a2a55,_0x700f35){return db['FaxMessage'][_0x1c13('0x59')]()[_0x1c13('0x23')](respondWithResult(_0x700f35,null))[_0x1c13('0x51')](handleError(_0x700f35,null));};var interaction_log=require(_0x1c13('0x18'))('fax-interactions');exports['accept']=function(_0x116ea9,_0x3f66e0,_0x4f29a9){var _0x26f170={'agent':{},'channel':_0x1c13('0x5a')};if(_0x116ea9[_0x1c13('0x56')]['id']){delete _0x116ea9[_0x1c13('0x56')]['id'];}_0x116ea9[_0x1c13('0x56')][_0x1c13('0x5b')]=!![];_0x116ea9[_0x1c13('0x56')][_0x1c13('0x5c')]=moment()[_0x1c13('0x5d')](_0x1c13('0x5e'));_0x116ea9[_0x1c13('0x56')][_0x1c13('0x5f')]=_0x116ea9[_0x1c13('0x56')]['UserId']||_0x116ea9[_0x1c13('0x60')]['id'];_0x26f170[_0x1c13('0x61')]['id']=_0x116ea9['body'][_0x1c13('0x5f')];return db[_0x1c13('0x39')]['find']({'where':{'id':_0x116ea9['params']['id'],'UserId':null}})[_0x1c13('0x23')](handleEntityNotFound(_0x3f66e0,null))['then'](saveUpdates(_0x116ea9[_0x1c13('0x56')],null))[_0x1c13('0x23')](function(_0x350046){if(_0x350046){_0x26f170['message']=_0x350046[_0x1c13('0x62')]({'plain':!![]});return db[_0x1c13('0x63')][_0x1c13('0x55')]({'where':{'id':_0x350046[_0x1c13('0x64')]}});}return null;})[_0x1c13('0x23')](handleEntityNotFound(_0x3f66e0,null))['then'](function(_0x5cd531){if(_0x5cd531){return _0x5cd531[_0x1c13('0x33')]({'UserId':_0x116ea9[_0x1c13('0x56')][_0x1c13('0x5f')],'read1stAt':_[_0x1c13('0x65')](_0x5cd531['read1stAt'])?moment()[_0x1c13('0x5d')](_0x1c13('0x5e')):undefined});}return null;})[_0x1c13('0x23')](function(_0x38aed3){if(_0x38aed3){_0x26f170[_0x1c13('0x66')]=_0x38aed3[_0x1c13('0x62')]({'plain':!![]});interaction_log['info']('[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x116ea9['user']['id'],_0x116ea9[_0x1c13('0x60')][_0x1c13('0x36')],_0x116ea9[_0x1c13('0x60')]['role'],_0x26f170[_0x1c13('0x66')]['id'],_0x116ea9['body']?JSON['stringify'](_0x116ea9[_0x1c13('0x56')]):_0x1c13('0x67'));return respondWithRpcPromise(_0x1c13('0x68'),_0x1c13('0x69'),_0x26f170);}return null;})['then'](function(_0x30e2c0){var _0x4f70c0=_0x1c13('0x6a')+_0x30e2c0[_0x1c13('0x29')][_0x1c13('0x6b')];return db[_0x1c13('0x6c')]['query'](_0x4f70c0,{'type':db[_0x1c13('0x6d')][_0x1c13('0x6e')][_0x1c13('0x6f')],'raw':!![]})['then'](function(_0x36b512){return _0x36b512;});})[_0x1c13('0x23')](function(_0x22536c){if(_0x22536c){_0x26f170[_0x1c13('0x29')][_0x1c13('0x70')]=_0x22536c[0x0];if(!_0x116ea9[_0x1c13('0x56')]['UserId'])return;return db['User'][_0x1c13('0x55')]({'where':{'id':_0x116ea9['body'][_0x1c13('0x5f')],'role':_0x1c13('0x61')},'attributes':['id',_0x1c13('0x36'),_0x1c13('0x71'),'email',_0x1c13('0x72')],'raw':!![]});}return null;})['then'](function(_0x229587){if(!_0x229587)return null;_0x26f170[_0x1c13('0x29')][_0x1c13('0x61')]=_0x229587;return _0x26f170;})[_0x1c13('0x23')](function(_0x4a683a){if(_0x4a683a){if(_0x116ea9[_0x1c13('0x56')][_0x1c13('0x73')]){_0x26f170[_0x1c13('0x29')]['interface']=util[_0x1c13('0x5d')](_0x1c13('0x74'),_0x116ea9[_0x1c13('0x60')][_0x1c13('0x36')]);_0x26f170[_0x1c13('0x29')][_0x1c13('0x75')]=_0x26f170['channel'];_0x26f170[_0x1c13('0x29')]['motionChannel']=_0x26f170['channel'];_0x26f170[_0x1c13('0x29')][_0x1c13('0x76')]=_0x1c13('0x77');return respondWithRpcPromise('EventManager',_0x1c13('0x78'),{'event':'acceptmessage','message':_0x26f170[_0x1c13('0x29')]},client9002)[_0x1c13('0x23')](function(){return _0x26f170;});}return _0x26f170;}return null;})[_0x1c13('0x23')](respondWithResult(_0x3f66e0,null))[_0x1c13('0x51')](handleError(_0x3f66e0,null));};var interaction_log=require(_0x1c13('0x18'))(_0x1c13('0x79'));exports[_0x1c13('0x31')]=function(_0x19f639,_0x394e99,_0x236d1e){var _0x38557f={'agent':{},'channel':_0x1c13('0x5a')};if(_0x19f639['body']['id']){delete _0x19f639[_0x1c13('0x56')]['id'];}_0x19f639[_0x1c13('0x56')][_0x1c13('0x5f')]=_0x19f639['body'][_0x1c13('0x5f')]||_0x19f639['user']['id'];_0x38557f['agent']['id']=_0x19f639[_0x1c13('0x56')][_0x1c13('0x5f')];return db[_0x1c13('0x39')][_0x1c13('0x55')]({'where':{'id':_0x19f639[_0x1c13('0x57')]['id'],'UserId':null}})[_0x1c13('0x23')](handleEntityNotFound(_0x394e99,null))[_0x1c13('0x23')](function(_0x2d4bc7){if(_0x2d4bc7){_0x38557f[_0x1c13('0x29')]=_0x2d4bc7[_0x1c13('0x62')]({'plain':!![]});return db[_0x1c13('0x63')][_0x1c13('0x55')]({'where':{'id':_0x2d4bc7[_0x1c13('0x64')]}});}return null;})[_0x1c13('0x23')](handleEntityNotFound(_0x394e99,null))[_0x1c13('0x23')](function(_0x8e8f95){if(_0x8e8f95){_0x38557f[_0x1c13('0x66')]=_0x8e8f95[_0x1c13('0x62')]({'plain':!![]});interaction_log[_0x1c13('0x24')](_0x1c13('0x7a'),_0x19f639['user']['id'],_0x19f639[_0x1c13('0x60')][_0x1c13('0x36')],_0x19f639['user'][_0x1c13('0x7b')],_0x38557f[_0x1c13('0x66')]['id'],_0x19f639[_0x1c13('0x56')]?JSON[_0x1c13('0x7c')](_0x19f639[_0x1c13('0x56')]):_0x1c13('0x67'));return respondWithRpcPromise(_0x1c13('0x7d'),_0x1c13('0x7e'),_0x38557f);}return null;})[_0x1c13('0x23')](function(_0x443627){var _0x531aee='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x443627[_0x1c13('0x29')]['ContactId'];return db[_0x1c13('0x6c')][_0x1c13('0x3f')](_0x531aee,{'type':db['Sequelize'][_0x1c13('0x6e')][_0x1c13('0x6f')],'raw':!![]})[_0x1c13('0x23')](function(_0x3d5262){return _0x3d5262;});})['then'](function(_0x434baf){if(_0x434baf){_0x38557f['message'][_0x1c13('0x70')]=_0x434baf[0x0];if(!_0x19f639[_0x1c13('0x56')][_0x1c13('0x5f')])return;return db['User'][_0x1c13('0x55')]({'where':{'id':_0x19f639[_0x1c13('0x56')][_0x1c13('0x5f')],'role':'agent'},'attributes':['id',_0x1c13('0x36'),_0x1c13('0x71'),_0x1c13('0x7f'),_0x1c13('0x72')],'raw':!![]});}return null;})['then'](function(_0x52b210){if(!_0x52b210)return null;_0x38557f[_0x1c13('0x29')]['agent']=_0x52b210;return _0x38557f;})[_0x1c13('0x23')](function(_0xcb7f7b){if(_0xcb7f7b){_0xcb7f7b[_0x1c13('0x29')][_0x1c13('0x80')]=util[_0x1c13('0x5d')](_0x1c13('0x74'),_0x19f639[_0x1c13('0x60')][_0x1c13('0x36')]);_0xcb7f7b[_0x1c13('0x29')]['channel']=_0x38557f[_0x1c13('0x75')];_0xcb7f7b[_0x1c13('0x29')]['motionChannel']=_0x38557f['channel'];_0xcb7f7b[_0x1c13('0x29')][_0x1c13('0x76')]=_0x1c13('0x31');respondWithRpcPromise(_0x1c13('0x78'),'EventManager',{'event':_0x1c13('0x81'),'message':_0xcb7f7b[_0x1c13('0x29')]},client9002);return _0x38557f;}return null;})[_0x1c13('0x23')](respondWithResult(_0x394e99,null))[_0x1c13('0x51')](handleError(_0x394e99,null));};exports[_0x1c13('0x82')]=function(_0x52b8b3,_0x8a81e4){var _0x27fc20;return db[_0x1c13('0x39')][_0x1c13('0x82')](_0x52b8b3[_0x1c13('0x56')],{})[_0x1c13('0x23')](function(_0xb9329a){_0x27fc20=_0xb9329a;return db[_0x1c13('0x83')][_0x1c13('0x84')]({'where':{'id':_0x27fc20[_0x1c13('0x6b')]}});})[_0x1c13('0x23')](function(_0x40a7fd){if(_[_0x1c13('0x65')](_0x40a7fd)){return;}else{_0x27fc20[_0x1c13('0x5a')]=_0x40a7fd[_0x1c13('0x5a')];return db[_0x1c13('0x85')]['findOne']({'where':{'id':_0x27fc20[_0x1c13('0x86')]}});}})[_0x1c13('0x23')](function(_0x410cc2){return respondWithRpcPromise(_0x1c13('0x87'),_0x1c13('0x87'),{'FaxAccountId':_[_0x1c13('0x65')](_0x52b8b3['body'])?undefined:_0x52b8b3[_0x1c13('0x56')][_0x1c13('0x88')],'path':_[_0x1c13('0x65')](_0x410cc2)?undefined:util[_0x1c13('0x5d')](_0x1c13('0x89'),_0x410cc2[_0x1c13('0x8a')]),'fax':_[_0x1c13('0x65')](_0x27fc20[_0x1c13('0x5a')])?undefined:_0x27fc20['fax'],'AttachmentId':_0x27fc20['AttachmentId']},client9002);})['then'](respondWithResult(_0x8a81e4,0xc9))[_0x1c13('0x51')](handleError(_0x8a81e4,null));};exports[_0x1c13('0x8b')]=function(_0x1c9b7c,_0x4c3974){var _0x4b54aa=path['join'](config[_0x1c13('0x8c')],_0x1c13('0x8d'),_0x1c13('0x8e'),_0x1c13('0x8f'));return db[_0x1c13('0x39')][_0x1c13('0x55')]({'where':{'id':_0x1c9b7c[_0x1c13('0x57')]['id']},'include':[{'model':db['Attachment'],'as':'Attachment'}]})[_0x1c13('0x23')](handleEntityNotFound(_0x4c3974,null))['then'](function(_0x354227){if(_0x354227){return _0x4c3974['download'](path[_0x1c13('0x90')](_0x4b54aa,_0x354227[_0x1c13('0x85')][_0x1c13('0x8a')]));}})[_0x1c13('0x51')](handleError(_0x4c3974,null));}; \ No newline at end of file +var _0x7d92=['query','keys','filters','intersection','fields','attributes','length','nolimit','sort','where','filter','merge','VIRTUAL','options','count','includeAll','include','show','params','find','update','body','describe','fax-interactions','fax','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','FaxInteractionId','isNil','read1stAt','interaction','user','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','contact','User','fullname','internal','manual','interface','SIP/%s','channel','motionChannel','event','accept','acceptmessage','FaxInteraction','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','Sequelize','email','EventManager','rejectmessage','create','CmContact','findOne','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','AttachmentId','download','join','root','files','Attachment','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./faxMessage.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FaxMessage,\x20%s,\x20%s','result','catch','sendStatus','status','json','offset','undefined','limit','set','apply','reject','save','destroy','end','stack','name','send','index','map','FaxMessage','rawAttributes','fieldName','type','key','model'];(function(_0xe17fa4,_0x5e9a7d){var _0x51c079=function(_0x4b8a81){while(--_0x4b8a81){_0xe17fa4['push'](_0xe17fa4['shift']());}};_0x51c079(++_0x5e9a7d);}(_0x7d92,0x17b));var _0x27d9=function(_0x3f0b30,_0x159bc8){_0x3f0b30=_0x3f0b30-0x0;var _0x2748a5=_0x7d92[_0x3f0b30];return _0x2748a5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x27d9('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x27d9('0x1'));var moment=require(_0x27d9('0x2'));var BPromise=require(_0x27d9('0x3'));var Mustache=require(_0x27d9('0x4'));var util=require(_0x27d9('0x5'));var path=require(_0x27d9('0x6'));var sox=require(_0x27d9('0x7'));var csv=require(_0x27d9('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x27d9('0x9'));var _=require(_0x27d9('0xa'));var squel=require(_0x27d9('0xb'));var crypto=require(_0x27d9('0xc'));var jsforce=require(_0x27d9('0xd'));var deskjs=require(_0x27d9('0xe'));var toCsv=require(_0x27d9('0x8'));var querystring=require(_0x27d9('0xf'));var Papa=require(_0x27d9('0x10'));var Redis=require(_0x27d9('0x11'));var authService=require(_0x27d9('0x12'));var qs=require(_0x27d9('0x13'));var as=require(_0x27d9('0x14'));var hardwareService=require(_0x27d9('0x15'));var logger=require(_0x27d9('0x16'))(_0x27d9('0x17'));var utils=require(_0x27d9('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x27d9('0x19'));var db=require(_0x27d9('0x1a'))['db'];config[_0x27d9('0x1b')]=_['defaults'](config['redis'],{'host':_0x27d9('0x1c'),'port':0x18eb});var socket=require(_0x27d9('0x1d'))(new Redis(config[_0x27d9('0x1b')]));require(_0x27d9('0x1e'))[_0x27d9('0x1f')](socket);var jayson=require(_0x27d9('0x20'));var client=jayson[_0x27d9('0x21')][_0x27d9('0x22')]({'port':0x232c});var client9002=jayson['client'][_0x27d9('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x3f1471,_0x5498c0,_0x520ed5,_0xab901b){return new BPromise(function(_0x39701b,_0x1190d9){var _0x1adaf0=_0xab901b||client;return _0x1adaf0[_0x27d9('0x23')](_0x3f1471,_0x520ed5)[_0x27d9('0x24')](function(_0x4e3c8d){logger[_0x27d9('0x25')]('FaxMessage,\x20%s,\x20%s',_0x5498c0,_0x27d9('0x26'));logger[_0x27d9('0x27')](_0x27d9('0x28'),_0x5498c0,_0x27d9('0x26'),JSON[_0x27d9('0x29')](_0x4e3c8d));if(_0x4e3c8d[_0x27d9('0x2a')]){if(_0x4e3c8d['error'][_0x27d9('0x2b')]===0x1f4){logger['error']('FaxMessage,\x20%s,\x20%s',_0x5498c0,_0x4e3c8d[_0x27d9('0x2a')][_0x27d9('0x2c')]);return _0x1190d9(_0x4e3c8d[_0x27d9('0x2a')]['message']);}logger[_0x27d9('0x2a')](_0x27d9('0x2d'),_0x5498c0,_0x4e3c8d[_0x27d9('0x2a')][_0x27d9('0x2c')]);return _0x39701b(_0x4e3c8d[_0x27d9('0x2a')]['message']);}else{logger[_0x27d9('0x25')]('FaxMessage,\x20%s,\x20%s',_0x5498c0,_0x27d9('0x26'));_0x39701b(_0x4e3c8d[_0x27d9('0x2e')][_0x27d9('0x2c')]);}})[_0x27d9('0x2f')](function(_0x336dd6){logger[_0x27d9('0x2a')](_0x27d9('0x2d'),_0x5498c0,_0x336dd6);_0x1190d9(_0x336dd6);});});}function respondWithStatusCode(_0xe85871,_0x18edbc){_0x18edbc=_0x18edbc||0xcc;return function(_0x421321){if(_0x421321){return _0xe85871[_0x27d9('0x30')](_0x18edbc);}return _0xe85871[_0x27d9('0x31')](_0x18edbc)['end']();};}function respondWithResult(_0x30bee8,_0x44e0b0){_0x44e0b0=_0x44e0b0||0xc8;return function(_0x29dda5){if(_0x29dda5){return _0x30bee8[_0x27d9('0x31')](_0x44e0b0)[_0x27d9('0x32')](_0x29dda5);}};}function respondWithFilteredResult(_0x2db3d9,_0x425791){return function(_0x54d9ea){if(_0x54d9ea){var _0x5f17ed=typeof _0x425791[_0x27d9('0x33')]===_0x27d9('0x34')&&typeof _0x425791[_0x27d9('0x35')]===_0x27d9('0x34');var _0x3ecc46=_0x54d9ea['count'];var _0x1f6295=_0x5f17ed?0x0:_0x425791[_0x27d9('0x33')];var _0x5a5974=_0x5f17ed?_0x54d9ea['count']:_0x425791['offset']+_0x425791[_0x27d9('0x35')];var _0x390bec;if(_0x5a5974>=_0x3ecc46){_0x5a5974=_0x3ecc46;_0x390bec=0xc8;}else{_0x390bec=0xce;}_0x2db3d9[_0x27d9('0x31')](_0x390bec);return _0x2db3d9[_0x27d9('0x36')]('Content-Range',_0x1f6295+'-'+_0x5a5974+'/'+_0x3ecc46)[_0x27d9('0x32')](_0x54d9ea);}return null;};}function patchUpdates(_0x2f1671){return function(_0x1f2b87){try{jsonpatch[_0x27d9('0x37')](_0x1f2b87,_0x2f1671,!![]);}catch(_0x4c85fb){return BPromise[_0x27d9('0x38')](_0x4c85fb);}return _0x1f2b87[_0x27d9('0x39')]();};}function saveUpdates(_0x4c4144,_0x53ceb3){return function(_0x37d805){if(_0x37d805){return _0x37d805['update'](_0x4c4144)['then'](function(_0x3b1596){return _0x3b1596;});}return null;};}function removeEntity(_0x5477d2,_0x187e12){return function(_0x388781){if(_0x388781){return _0x388781[_0x27d9('0x3a')]()[_0x27d9('0x24')](function(){_0x5477d2['status'](0xcc)[_0x27d9('0x3b')]();});}};}function handleEntityNotFound(_0x5a2013,_0x28b1e6){return function(_0x46bea9){if(!_0x46bea9){_0x5a2013[_0x27d9('0x30')](0x194);}return _0x46bea9;};}function handleError(_0x403cc0,_0x3e2df4){_0x3e2df4=_0x3e2df4||0x1f4;return function(_0x1702d4){logger[_0x27d9('0x2a')](_0x1702d4[_0x27d9('0x3c')]);if(_0x1702d4[_0x27d9('0x3d')]){delete _0x1702d4[_0x27d9('0x3d')];}_0x403cc0[_0x27d9('0x31')](_0x3e2df4)[_0x27d9('0x3e')](_0x1702d4);};}exports[_0x27d9('0x3f')]=function(_0x545e30,_0x3c96b7){var _0xaf520a={},_0x2697b0={},_0x23d088={'count':0x0,'rows':[]};var _0x19d0a6=_[_0x27d9('0x40')](db[_0x27d9('0x41')][_0x27d9('0x42')],function(_0x545d8b){return{'name':_0x545d8b[_0x27d9('0x43')],'type':_0x545d8b[_0x27d9('0x44')][_0x27d9('0x45')]};});_0x2697b0[_0x27d9('0x46')]=_['map'](_0x19d0a6,_0x27d9('0x3d'));_0x2697b0[_0x27d9('0x47')]=_[_0x27d9('0x48')](_0x545e30[_0x27d9('0x47')]);_0x2697b0[_0x27d9('0x49')]=_[_0x27d9('0x4a')](_0x2697b0[_0x27d9('0x46')],_0x2697b0[_0x27d9('0x47')]);_0xaf520a['attributes']=_[_0x27d9('0x4a')](_0x2697b0['model'],qs[_0x27d9('0x4b')](_0x545e30[_0x27d9('0x47')]['fields']));_0xaf520a[_0x27d9('0x4c')]=_0xaf520a['attributes'][_0x27d9('0x4d')]?_0xaf520a['attributes']:_0x2697b0[_0x27d9('0x46')];if(!_0x545e30['query']['hasOwnProperty'](_0x27d9('0x4e'))){_0xaf520a[_0x27d9('0x35')]=qs['limit'](_0x545e30[_0x27d9('0x47')][_0x27d9('0x35')]);_0xaf520a[_0x27d9('0x33')]=qs[_0x27d9('0x33')](_0x545e30['query']['offset']);}_0xaf520a['order']=qs[_0x27d9('0x4f')](_0x545e30[_0x27d9('0x47')]['sort']);_0xaf520a[_0x27d9('0x50')]=qs[_0x27d9('0x49')](_['pick'](_0x545e30[_0x27d9('0x47')],_0x2697b0[_0x27d9('0x49')]),_0x19d0a6);if(_0x545e30[_0x27d9('0x47')][_0x27d9('0x51')]){_0xaf520a[_0x27d9('0x50')]=_[_0x27d9('0x52')](_0xaf520a[_0x27d9('0x50')],{'$or':_[_0x27d9('0x40')](_0x19d0a6,function(_0x4708dc){if(_0x4708dc['type']!==_0x27d9('0x53')){var _0x21b40={};_0x21b40[_0x4708dc[_0x27d9('0x3d')]]={'$like':'%'+_0x545e30[_0x27d9('0x47')][_0x27d9('0x51')]+'%'};return _0x21b40;}})});}_0xaf520a=_[_0x27d9('0x52')]({},_0xaf520a,_0x545e30[_0x27d9('0x54')]);var _0x2a0eae={'where':_0xaf520a[_0x27d9('0x50')]};return db[_0x27d9('0x41')][_0x27d9('0x55')](_0x2a0eae)[_0x27d9('0x24')](function(_0x100c28){_0x23d088[_0x27d9('0x55')]=_0x100c28;if(_0x545e30[_0x27d9('0x47')][_0x27d9('0x56')]){_0xaf520a[_0x27d9('0x57')]=[{'all':!![]}];}return db[_0x27d9('0x41')]['findAll'](_0xaf520a);})[_0x27d9('0x24')](function(_0x59dc9e){_0x23d088['rows']=_0x59dc9e;return _0x23d088;})[_0x27d9('0x24')](respondWithFilteredResult(_0x3c96b7,_0xaf520a))[_0x27d9('0x2f')](handleError(_0x3c96b7,null));};exports[_0x27d9('0x58')]=function(_0x581683,_0x416ee1){var _0x44d112={'raw':!![],'where':{'id':_0x581683[_0x27d9('0x59')]['id']}},_0x191d11={};_0x191d11[_0x27d9('0x46')]=_[_0x27d9('0x48')](db[_0x27d9('0x41')][_0x27d9('0x42')]);_0x191d11[_0x27d9('0x47')]=_[_0x27d9('0x48')](_0x581683[_0x27d9('0x47')]);_0x191d11['filters']=_[_0x27d9('0x4a')](_0x191d11[_0x27d9('0x46')],_0x191d11[_0x27d9('0x47')]);_0x44d112['attributes']=_[_0x27d9('0x4a')](_0x191d11[_0x27d9('0x46')],qs[_0x27d9('0x4b')](_0x581683['query'][_0x27d9('0x4b')]));_0x44d112[_0x27d9('0x4c')]=_0x44d112[_0x27d9('0x4c')][_0x27d9('0x4d')]?_0x44d112['attributes']:_0x191d11['model'];if(_0x581683[_0x27d9('0x47')][_0x27d9('0x56')]){_0x44d112[_0x27d9('0x57')]=[{'all':!![]}];}_0x44d112=_[_0x27d9('0x52')]({},_0x44d112,_0x581683['options']);return db[_0x27d9('0x41')][_0x27d9('0x5a')](_0x44d112)[_0x27d9('0x24')](handleEntityNotFound(_0x416ee1,null))['then'](respondWithResult(_0x416ee1,null))['catch'](handleError(_0x416ee1,null));};exports[_0x27d9('0x5b')]=function(_0x4e594a,_0xa8e2b){if(_0x4e594a[_0x27d9('0x5c')]['id']){delete _0x4e594a['body']['id'];}return db['FaxMessage'][_0x27d9('0x5a')]({'where':{'id':_0x4e594a['params']['id']}})[_0x27d9('0x24')](handleEntityNotFound(_0xa8e2b,null))[_0x27d9('0x24')](saveUpdates(_0x4e594a[_0x27d9('0x5c')],null))['then'](respondWithResult(_0xa8e2b,null))[_0x27d9('0x2f')](handleError(_0xa8e2b,null));};exports[_0x27d9('0x3a')]=function(_0x73b6fc,_0x4909e4){return db[_0x27d9('0x41')][_0x27d9('0x5a')]({'where':{'id':_0x73b6fc['params']['id']}})[_0x27d9('0x24')](handleEntityNotFound(_0x4909e4,null))[_0x27d9('0x24')](removeEntity(_0x4909e4,null))['catch'](handleError(_0x4909e4,null));};exports[_0x27d9('0x5d')]=function(_0x55f574,_0x3ff606){return db['FaxMessage'][_0x27d9('0x5d')]()[_0x27d9('0x24')](respondWithResult(_0x3ff606,null))[_0x27d9('0x2f')](handleError(_0x3ff606,null));};var interaction_log=require(_0x27d9('0x16'))(_0x27d9('0x5e'));exports['accept']=function(_0x9ba91,_0x2098a9,_0x58e743){var _0x41bbcc={'agent':{},'channel':_0x27d9('0x5f')};if(_0x9ba91[_0x27d9('0x5c')]['id']){delete _0x9ba91['body']['id'];}_0x9ba91[_0x27d9('0x5c')][_0x27d9('0x60')]=!![];_0x9ba91[_0x27d9('0x5c')][_0x27d9('0x61')]=moment()[_0x27d9('0x62')](_0x27d9('0x63'));_0x9ba91[_0x27d9('0x5c')][_0x27d9('0x64')]=_0x9ba91[_0x27d9('0x5c')]['UserId']||_0x9ba91['user']['id'];_0x41bbcc[_0x27d9('0x65')]['id']=_0x9ba91[_0x27d9('0x5c')][_0x27d9('0x64')];return db['FaxMessage'][_0x27d9('0x5a')]({'where':{'id':_0x9ba91[_0x27d9('0x59')]['id'],'UserId':null}})[_0x27d9('0x24')](handleEntityNotFound(_0x2098a9,null))[_0x27d9('0x24')](saveUpdates(_0x9ba91[_0x27d9('0x5c')],null))[_0x27d9('0x24')](function(_0x4e9abc){if(_0x4e9abc){_0x41bbcc[_0x27d9('0x2c')]=_0x4e9abc[_0x27d9('0x66')]({'plain':!![]});return db['FaxInteraction'][_0x27d9('0x5a')]({'where':{'id':_0x4e9abc[_0x27d9('0x67')]}});}return null;})[_0x27d9('0x24')](handleEntityNotFound(_0x2098a9,null))['then'](function(_0x25d6b4){if(_0x25d6b4){return _0x25d6b4[_0x27d9('0x5b')]({'UserId':_0x9ba91[_0x27d9('0x5c')][_0x27d9('0x64')],'read1stAt':_[_0x27d9('0x68')](_0x25d6b4[_0x27d9('0x69')])?moment()[_0x27d9('0x62')](_0x27d9('0x63')):undefined});}return null;})['then'](function(_0x519535){if(_0x519535){_0x41bbcc[_0x27d9('0x6a')]=_0x519535['get']({'plain':!![]});interaction_log[_0x27d9('0x25')]('[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x9ba91[_0x27d9('0x6b')]['id'],_0x9ba91[_0x27d9('0x6b')][_0x27d9('0x3d')],_0x9ba91['user'][_0x27d9('0x6c')],_0x41bbcc['interaction']['id'],_0x9ba91[_0x27d9('0x5c')]?JSON['stringify'](_0x9ba91[_0x27d9('0x5c')]):_0x27d9('0x6d'));return respondWithRpcPromise(_0x27d9('0x6e'),_0x27d9('0x6f'),_0x41bbcc);}return null;})['then'](function(_0x11fd76){var _0x1da80c=_0x27d9('0x70')+_0x11fd76[_0x27d9('0x2c')][_0x27d9('0x71')];return db[_0x27d9('0x72')][_0x27d9('0x47')](_0x1da80c,{'type':db['Sequelize'][_0x27d9('0x73')][_0x27d9('0x74')],'raw':!![]})[_0x27d9('0x24')](function(_0x548ae5){return _0x548ae5;});})['then'](function(_0x59c33a){if(_0x59c33a){_0x41bbcc[_0x27d9('0x2c')][_0x27d9('0x75')]=_0x59c33a[0x0];if(!_0x9ba91[_0x27d9('0x5c')][_0x27d9('0x64')])return;return db[_0x27d9('0x76')][_0x27d9('0x5a')]({'where':{'id':_0x9ba91[_0x27d9('0x5c')][_0x27d9('0x64')],'role':_0x27d9('0x65')},'attributes':['id',_0x27d9('0x3d'),_0x27d9('0x77'),'email',_0x27d9('0x78')],'raw':!![]});}return null;})[_0x27d9('0x24')](function(_0x128b0c){if(!_0x128b0c)return null;_0x41bbcc[_0x27d9('0x2c')]['agent']=_0x128b0c;return _0x41bbcc;})[_0x27d9('0x24')](function(_0x4053ba){if(_0x4053ba){if(_0x9ba91[_0x27d9('0x5c')][_0x27d9('0x79')]){_0x41bbcc[_0x27d9('0x2c')][_0x27d9('0x7a')]=util['format'](_0x27d9('0x7b'),_0x9ba91['user'][_0x27d9('0x3d')]);_0x41bbcc[_0x27d9('0x2c')][_0x27d9('0x7c')]=_0x41bbcc[_0x27d9('0x7c')];_0x41bbcc[_0x27d9('0x2c')][_0x27d9('0x7d')]=_0x41bbcc['channel'];_0x41bbcc[_0x27d9('0x2c')][_0x27d9('0x7e')]=_0x27d9('0x7f');return respondWithRpcPromise('EventManager','EventManager',{'event':_0x27d9('0x80'),'message':_0x41bbcc['message']},client9002)[_0x27d9('0x24')](function(){return _0x41bbcc;});}return _0x41bbcc;}return null;})['then'](respondWithResult(_0x2098a9,null))[_0x27d9('0x2f')](handleError(_0x2098a9,null));};var interaction_log=require(_0x27d9('0x16'))(_0x27d9('0x5e'));exports['reject']=function(_0x549171,_0x31303b,_0xfa0b36){var _0x52b351={'agent':{},'channel':'fax'};if(_0x549171[_0x27d9('0x5c')]['id']){delete _0x549171[_0x27d9('0x5c')]['id'];}_0x549171[_0x27d9('0x5c')][_0x27d9('0x64')]=_0x549171['body'][_0x27d9('0x64')]||_0x549171[_0x27d9('0x6b')]['id'];_0x52b351[_0x27d9('0x65')]['id']=_0x549171['body'][_0x27d9('0x64')];return db[_0x27d9('0x41')][_0x27d9('0x5a')]({'where':{'id':_0x549171[_0x27d9('0x59')]['id'],'UserId':null}})[_0x27d9('0x24')](handleEntityNotFound(_0x31303b,null))[_0x27d9('0x24')](function(_0x1a2b10){if(_0x1a2b10){_0x52b351[_0x27d9('0x2c')]=_0x1a2b10[_0x27d9('0x66')]({'plain':!![]});return db[_0x27d9('0x81')]['find']({'where':{'id':_0x1a2b10[_0x27d9('0x67')]}});}return null;})['then'](handleEntityNotFound(_0x31303b,null))[_0x27d9('0x24')](function(_0x137e5a){if(_0x137e5a){_0x52b351['interaction']=_0x137e5a[_0x27d9('0x66')]({'plain':!![]});interaction_log[_0x27d9('0x25')](_0x27d9('0x82'),_0x549171[_0x27d9('0x6b')]['id'],_0x549171[_0x27d9('0x6b')][_0x27d9('0x3d')],_0x549171[_0x27d9('0x6b')][_0x27d9('0x6c')],_0x52b351['interaction']['id'],_0x549171[_0x27d9('0x5c')]?JSON[_0x27d9('0x29')](_0x549171[_0x27d9('0x5c')]):_0x27d9('0x6d'));return respondWithRpcPromise(_0x27d9('0x83'),_0x27d9('0x84'),_0x52b351);}return null;})[_0x27d9('0x24')](function(_0x56edcd){var _0x37c4a1=_0x27d9('0x70')+_0x56edcd[_0x27d9('0x2c')][_0x27d9('0x71')];return db['sequelize'][_0x27d9('0x47')](_0x37c4a1,{'type':db[_0x27d9('0x85')][_0x27d9('0x73')][_0x27d9('0x74')],'raw':!![]})[_0x27d9('0x24')](function(_0x1f9a30){return _0x1f9a30;});})[_0x27d9('0x24')](function(_0x320edd){if(_0x320edd){_0x52b351[_0x27d9('0x2c')][_0x27d9('0x75')]=_0x320edd[0x0];if(!_0x549171[_0x27d9('0x5c')][_0x27d9('0x64')])return;return db['User'][_0x27d9('0x5a')]({'where':{'id':_0x549171[_0x27d9('0x5c')][_0x27d9('0x64')],'role':_0x27d9('0x65')},'attributes':['id','name','fullname',_0x27d9('0x86'),_0x27d9('0x78')],'raw':!![]});}return null;})['then'](function(_0xade99b){if(!_0xade99b)return null;_0x52b351[_0x27d9('0x2c')]['agent']=_0xade99b;return _0x52b351;})['then'](function(_0x5eeac1){if(_0x5eeac1){_0x5eeac1['message'][_0x27d9('0x7a')]=util[_0x27d9('0x62')](_0x27d9('0x7b'),_0x549171[_0x27d9('0x6b')]['name']);_0x5eeac1['message']['channel']=_0x52b351[_0x27d9('0x7c')];_0x5eeac1['message']['motionChannel']=_0x52b351[_0x27d9('0x7c')];_0x5eeac1[_0x27d9('0x2c')][_0x27d9('0x7e')]='reject';respondWithRpcPromise(_0x27d9('0x87'),'EventManager',{'event':_0x27d9('0x88'),'message':_0x5eeac1[_0x27d9('0x2c')]},client9002);return _0x52b351;}return null;})['then'](respondWithResult(_0x31303b,null))[_0x27d9('0x2f')](handleError(_0x31303b,null));};exports[_0x27d9('0x89')]=function(_0x4378ca,_0x1827aa){var _0x33290b;return db[_0x27d9('0x41')][_0x27d9('0x89')](_0x4378ca[_0x27d9('0x5c')],{})[_0x27d9('0x24')](function(_0x4c6262){_0x33290b=_0x4c6262;return db[_0x27d9('0x8a')][_0x27d9('0x8b')]({'where':{'id':_0x33290b[_0x27d9('0x71')]}});})['then'](function(_0x58255b){if(_[_0x27d9('0x68')](_0x58255b)){return;}else{_0x33290b[_0x27d9('0x5f')]=_0x58255b['fax'];return db['Attachment'][_0x27d9('0x8b')]({'where':{'id':_0x33290b['AttachmentId']}});}})[_0x27d9('0x24')](function(_0x217a2a){return respondWithRpcPromise(_0x27d9('0x8c'),_0x27d9('0x8c'),{'FaxAccountId':_[_0x27d9('0x68')](_0x4378ca['body'])?undefined:_0x4378ca[_0x27d9('0x5c')][_0x27d9('0x8d')],'path':_[_0x27d9('0x68')](_0x217a2a)?undefined:util[_0x27d9('0x62')](_0x27d9('0x8e'),_0x217a2a[_0x27d9('0x8f')]),'fax':_[_0x27d9('0x68')](_0x33290b[_0x27d9('0x5f')])?undefined:_0x33290b['fax'],'AttachmentId':_0x33290b[_0x27d9('0x90')]},client9002);})[_0x27d9('0x24')](respondWithResult(_0x1827aa,0xc9))[_0x27d9('0x2f')](handleError(_0x1827aa,null));};exports[_0x27d9('0x91')]=function(_0x168079,_0x1e912){var _0x585d38=path[_0x27d9('0x92')](config[_0x27d9('0x93')],'server',_0x27d9('0x94'),'attachments');return db['FaxMessage']['find']({'where':{'id':_0x168079[_0x27d9('0x59')]['id']},'include':[{'model':db[_0x27d9('0x95')],'as':_0x27d9('0x95')}]})[_0x27d9('0x24')](handleEntityNotFound(_0x1e912,null))[_0x27d9('0x24')](function(_0x598206){if(_0x598206){return _0x1e912[_0x27d9('0x91')](path[_0x27d9('0x92')](_0x585d38,_0x598206[_0x27d9('0x95')]['basename']));}})[_0x27d9('0x2f')](handleError(_0x1e912,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 7051c30..fb96990 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 _0x6931=['update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','FaxMessage','setMaxListeners','save'];(function(_0x3de4f8,_0x336c7d){var _0x3d81fc=function(_0x53b9f9){while(--_0x53b9f9){_0x3de4f8['push'](_0x3de4f8['shift']());}};_0x3d81fc(++_0x336c7d);}(_0x6931,0x1a9));var _0x1693=function(_0x375a6e,_0x4ea08b){_0x375a6e=_0x375a6e-0x0;var _0x4800c5=_0x6931[_0x375a6e];return _0x4800c5;};'use strict';var EventEmitter=require(_0x1693('0x0'));var FaxMessage=require(_0x1693('0x1'))['db'][_0x1693('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x1693('0x3')](0x0);var events={'afterCreate':_0x1693('0x4'),'afterUpdate':_0x1693('0x5'),'afterDestroy':_0x1693('0x6')};function emitEvent(_0x2cb142){return function(_0x59d148,_0x19ff1c,_0x2ca960){FaxMessageEvents[_0x1693('0x7')](_0x2cb142+':'+_0x59d148['id'],_0x59d148);FaxMessageEvents[_0x1693('0x7')](_0x2cb142,_0x59d148);_0x2ca960(null);};}for(var e in events){if(events[_0x1693('0x8')](e)){var event=events[e];FaxMessage['hook'](e,emitEvent(event));}}module[_0x1693('0x9')]=FaxMessageEvents; \ No newline at end of file +var _0xe6e9=['../../mysqldb','FaxMessage','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x3a9661,_0x530b12){var _0x5bb119=function(_0x1278f){while(--_0x1278f){_0x3a9661['push'](_0x3a9661['shift']());}};_0x5bb119(++_0x530b12);}(_0xe6e9,0x182));var _0x9e6e=function(_0x305426,_0x363673){_0x305426=_0x305426-0x0;var _0x4ed3aa=_0xe6e9[_0x305426];return _0x4ed3aa;};'use strict';var EventEmitter=require(_0x9e6e('0x0'));var FaxMessage=require(_0x9e6e('0x1'))['db'][_0x9e6e('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9e6e('0x3'),'afterUpdate':_0x9e6e('0x4'),'afterDestroy':_0x9e6e('0x5')};function emitEvent(_0x3313dc){return function(_0x1f6d79,_0x5f4c0b,_0x1f64e8){FaxMessageEvents[_0x9e6e('0x6')](_0x3313dc+':'+_0x1f6d79['id'],_0x1f6d79);FaxMessageEvents[_0x9e6e('0x6')](_0x3313dc,_0x1f6d79);_0x1f64e8(null);};}for(var e in events){if(events[_0x9e6e('0x7')](e)){var event=events[e];FaxMessage[_0x9e6e('0x8')](e,emitEvent(event));}}module['exports']=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index d2ab242..cf12d95 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 _0xb964=['direction','catch','error','utf8mb4','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxMessage.attributes','exports','define','fti_fax_messages','body','FULLTEXT','toLowerCase','out','secret','isNil','UserId','FaxInteraction','FaxInteractionId','then','update','createdAt'];(function(_0x5e07f1,_0x1915b5){var _0x33b7ef=function(_0x1c7e40){while(--_0x1c7e40){_0x5e07f1['push'](_0x5e07f1['shift']());}};_0x33b7ef(++_0x1915b5);}(_0xb964,0x19a));var _0x4b96=function(_0x17aa4c,_0x2cac8d){_0x17aa4c=_0x17aa4c-0x0;var _0xceae3a=_0xb964[_0x17aa4c];return _0xceae3a;};'use strict';var _=require(_0x4b96('0x0'));var util=require(_0x4b96('0x1'));var logger=require('../../config/logger')(_0x4b96('0x2'));var moment=require(_0x4b96('0x3'));var BPromise=require(_0x4b96('0x4'));var rp=require(_0x4b96('0x5'));var fs=require('fs');var path=require(_0x4b96('0x6'));var rimraf=require(_0x4b96('0x7'));var config=require(_0x4b96('0x8'));var attributes=require(_0x4b96('0x9'));module[_0x4b96('0xa')]=function(_0x20d328,_0x568fd0){return _0x20d328[_0x4b96('0xb')]('FaxMessage',attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':_0x4b96('0xc'),'fields':[_0x4b96('0xd')],'type':_0x4b96('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1d7f40,_0x3fc74a,_0x264331){var _0x546150=_0x20d328['models'];var _0x1e8252=_0x1d7f40['get']({'plain':!![]});if(_0x1e8252['direction'][_0x4b96('0xf')]()==='in'||_0x1e8252['direction']['toLowerCase']()===_0x4b96('0x10')&&!_0x1e8252[_0x4b96('0x11')]&&!_[_0x4b96('0x12')](_0x1e8252[_0x4b96('0x13')])){_0x546150[_0x4b96('0x14')]['findOne']({'where':{'id':_0x1e8252[_0x4b96('0x15')]}})[_0x4b96('0x16')](function(_0x106d75){if(_0x106d75){_0x106d75[_0x4b96('0x17')]({'lastMsgAt':_0x1e8252[_0x4b96('0x18')],'lastMsgDirection':_0x1e8252[_0x4b96('0x19')][_0x4b96('0xf')]()});}})[_0x4b96('0x1a')](function(_0x4ecc19){console[_0x4b96('0x1b')](_0x4ecc19);});}_0x264331();}},'charset':_0x4b96('0x1c'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x7962=['lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./faxMessage.attributes','exports','FaxMessage','fax_messages','fti_fax_messages','body','FULLTEXT','models','direction','toLowerCase','out','secret','FaxInteraction','findOne','then','update','catch','utf8mb4','utf8mb4_unicode_ci'];(function(_0x1be24d,_0x16f4a5){var _0x688208=function(_0x420a72){while(--_0x420a72){_0x1be24d['push'](_0x1be24d['shift']());}};_0x688208(++_0x16f4a5);}(_0x7962,0xa2));var _0x2796=function(_0x1123cf,_0x26a612){_0x1123cf=_0x1123cf-0x0;var _0x15182d=_0x7962[_0x1123cf];return _0x15182d;};'use strict';var _=require(_0x2796('0x0'));var util=require(_0x2796('0x1'));var logger=require(_0x2796('0x2'))(_0x2796('0x3'));var moment=require(_0x2796('0x4'));var BPromise=require('bluebird');var rp=require(_0x2796('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2796('0x6'));var config=require(_0x2796('0x7'));var attributes=require(_0x2796('0x8'));module[_0x2796('0x9')]=function(_0x500f9e,_0x2001a6){return _0x500f9e['define'](_0x2796('0xa'),attributes,{'tableName':_0x2796('0xb'),'paranoid':![],'indexes':[{'name':_0x2796('0xc'),'fields':[_0x2796('0xd')],'type':_0x2796('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x257b54,_0x24e20c,_0xa03b60){var _0x33d826=_0x500f9e[_0x2796('0xf')];var _0x32b9d8=_0x257b54['get']({'plain':!![]});if(_0x32b9d8['direction']['toLowerCase']()==='in'||_0x32b9d8[_0x2796('0x10')][_0x2796('0x11')]()===_0x2796('0x12')&&!_0x32b9d8[_0x2796('0x13')]&&!_['isNil'](_0x32b9d8['UserId'])){_0x33d826[_0x2796('0x14')][_0x2796('0x15')]({'where':{'id':_0x32b9d8['FaxInteractionId']}})[_0x2796('0x16')](function(_0x830b98){if(_0x830b98){_0x830b98[_0x2796('0x17')]({'lastMsgAt':_0x32b9d8['createdAt'],'lastMsgDirection':_0x32b9d8[_0x2796('0x10')][_0x2796('0x11')]()});}})[_0x2796('0x18')](function(_0x3fa2c1){console['error'](_0x3fa2c1);});}_0xa03b60();}},'charset':_0x2796('0x19'),'collate':_0x2796('0x1a')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index ca7536e..03e535b 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 _0xeec6=['FaxMessage','create','body','options','then','catch','UpdateFaxMessage','update','attributes','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','./faxMessage.socket','register','request','info','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxMessage,\x20%s,\x20%s','message','result','CreateFaxMessage'];(function(_0x37c4e4,_0x41982f){var _0x3e319e=function(_0x53455f){while(--_0x53455f){_0x37c4e4['push'](_0x37c4e4['shift']());}};_0x3e319e(++_0x41982f);}(_0xeec6,0x1c2));var _0x6eec=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xeec6[_0x4709c0];return _0x13348b;};'use strict';var _=require(_0x6eec('0x0'));var util=require(_0x6eec('0x1'));var moment=require(_0x6eec('0x2'));var BPromise=require(_0x6eec('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6eec('0x4'));var db=require(_0x6eec('0x5'))['db'];var utils=require(_0x6eec('0x6'));var logger=require(_0x6eec('0x7'))(_0x6eec('0x8'));var config=require(_0x6eec('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x6eec('0xa')][_0x6eec('0xb')]({'port':0x232a});config['redis']=_[_0x6eec('0xc')](config[_0x6eec('0xd')],{'host':_0x6eec('0xe'),'port':0x18eb});var socket=require(_0x6eec('0xf'))(new Redis(config['redis']));require(_0x6eec('0x10'))[_0x6eec('0x11')](socket);function respondWithRpcPromise(_0x1c774d,_0x49ad4c,_0x595dd4){return new BPromise(function(_0x5e8aba,_0x295cae){return client[_0x6eec('0x12')](_0x1c774d,_0x595dd4)['then'](function(_0x4b8de1){logger[_0x6eec('0x13')]('FaxMessage,\x20%s,\x20%s',_0x49ad4c,_0x6eec('0x14'));logger[_0x6eec('0x15')](_0x6eec('0x16'),_0x49ad4c,_0x6eec('0x14'),JSON[_0x6eec('0x17')](_0x4b8de1));if(_0x4b8de1['error']){if(_0x4b8de1[_0x6eec('0x18')][_0x6eec('0x19')]===0x1f4){logger[_0x6eec('0x18')](_0x6eec('0x1a'),_0x49ad4c,_0x4b8de1[_0x6eec('0x18')][_0x6eec('0x1b')]);return _0x295cae(_0x4b8de1[_0x6eec('0x18')][_0x6eec('0x1b')]);}logger[_0x6eec('0x18')](_0x6eec('0x1a'),_0x49ad4c,_0x4b8de1['error'][_0x6eec('0x1b')]);return _0x5e8aba(_0x4b8de1['error'][_0x6eec('0x1b')]);}else{logger[_0x6eec('0x13')]('FaxMessage,\x20%s,\x20%s',_0x49ad4c,_0x6eec('0x14'));_0x5e8aba(_0x4b8de1[_0x6eec('0x1c')][_0x6eec('0x1b')]);}})['catch'](function(_0x87f3be){logger[_0x6eec('0x18')](_0x6eec('0x1a'),_0x49ad4c,_0x87f3be);_0x295cae(_0x87f3be);});});}exports[_0x6eec('0x1d')]=function(_0xd86135){var _0x1761f4=this;return new Promise(function(_0x536429,_0x328693){return db[_0x6eec('0x1e')][_0x6eec('0x1f')](_0xd86135[_0x6eec('0x20')],{'raw':_0xd86135[_0x6eec('0x21')]?_0xd86135[_0x6eec('0x21')]['raw']===undefined?!![]:![]:!![]})[_0x6eec('0x22')](function(_0x852d08){logger[_0x6eec('0x13')](_0x6eec('0x1d'),_0xd86135);logger[_0x6eec('0x15')](_0x6eec('0x1d'),_0xd86135,JSON['stringify'](_0x852d08));_0x536429(_0x852d08);})[_0x6eec('0x23')](function(_0x2ad14b){logger[_0x6eec('0x18')](_0x6eec('0x1d'),_0x2ad14b[_0x6eec('0x1b')],_0xd86135);_0x328693(_0x1761f4[_0x6eec('0x18')](0x1f4,_0x2ad14b[_0x6eec('0x1b')]));});});};exports[_0x6eec('0x24')]=function(_0x316317){var _0x58f95c=this;return new Promise(function(_0x1d750c,_0x44b31c){return db[_0x6eec('0x1e')][_0x6eec('0x25')](_0x316317['body'],{'raw':_0x316317[_0x6eec('0x21')]?_0x316317[_0x6eec('0x21')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x316317['options']?_0x316317[_0x6eec('0x21')]['where']||null:null,'attributes':_0x316317[_0x6eec('0x21')]?_0x316317[_0x6eec('0x21')][_0x6eec('0x26')]||null:null,'limit':_0x316317[_0x6eec('0x21')]?_0x316317[_0x6eec('0x21')][_0x6eec('0x27')]||null:null})[_0x6eec('0x22')](function(_0x33e4a1){logger[_0x6eec('0x13')](_0x6eec('0x24'),_0x316317);logger['debug'](_0x6eec('0x24'),_0x316317,JSON['stringify'](_0x33e4a1));_0x1d750c(_0x33e4a1);})[_0x6eec('0x23')](function(_0x125bfc){logger[_0x6eec('0x18')]('UpdateFaxMessage',_0x125bfc['message'],_0x316317);_0x44b31c(_0x58f95c['error'](0x1f4,_0x125bfc[_0x6eec('0x1b')]));});});}; \ No newline at end of file +var _0xb903=['options','raw','then','stringify','UpdateFaxMessage','update','where','attributes','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','request','info','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','error','FaxMessage,\x20%s,\x20%s','message','result','catch','CreateFaxMessage','FaxMessage','create','body'];(function(_0xdde858,_0xd01b73){var _0x400131=function(_0x42ebd9){while(--_0x42ebd9){_0xdde858['push'](_0xdde858['shift']());}};_0x400131(++_0xd01b73);}(_0xb903,0x185));var _0x3b90=function(_0x3ca93c,_0x35947c){_0x3ca93c=_0x3ca93c-0x0;var _0x3fbe83=_0xb903[_0x3ca93c];return _0x3fbe83;};'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});config['redis']=_['defaults'](config[_0x3b90('0xc')],{'host':_0x3b90('0xd'),'port':0x18eb});var socket=require(_0x3b90('0xe'))(new Redis(config[_0x3b90('0xc')]));require('./faxMessage.socket')['register'](socket);function respondWithRpcPromise(_0x52401e,_0x51f916,_0x56261b){return new BPromise(function(_0x55db3f,_0x336913){return client[_0x3b90('0xf')](_0x52401e,_0x56261b)['then'](function(_0x30c49c){logger[_0x3b90('0x10')]('FaxMessage,\x20%s,\x20%s',_0x51f916,_0x3b90('0x11'));logger[_0x3b90('0x12')](_0x3b90('0x13'),_0x51f916,'request\x20sent',JSON['stringify'](_0x30c49c));if(_0x30c49c[_0x3b90('0x14')]){if(_0x30c49c['error']['code']===0x1f4){logger[_0x3b90('0x14')](_0x3b90('0x15'),_0x51f916,_0x30c49c['error']['message']);return _0x336913(_0x30c49c[_0x3b90('0x14')][_0x3b90('0x16')]);}logger[_0x3b90('0x14')](_0x3b90('0x15'),_0x51f916,_0x30c49c[_0x3b90('0x14')]['message']);return _0x55db3f(_0x30c49c['error'][_0x3b90('0x16')]);}else{logger[_0x3b90('0x10')]('FaxMessage,\x20%s,\x20%s',_0x51f916,_0x3b90('0x11'));_0x55db3f(_0x30c49c[_0x3b90('0x17')][_0x3b90('0x16')]);}})[_0x3b90('0x18')](function(_0x4f388b){logger[_0x3b90('0x14')]('FaxMessage,\x20%s,\x20%s',_0x51f916,_0x4f388b);_0x336913(_0x4f388b);});});}exports[_0x3b90('0x19')]=function(_0x231690){var _0x535894=this;return new Promise(function(_0x39ae7c,_0x12e1cf){return db[_0x3b90('0x1a')][_0x3b90('0x1b')](_0x231690[_0x3b90('0x1c')],{'raw':_0x231690[_0x3b90('0x1d')]?_0x231690[_0x3b90('0x1d')][_0x3b90('0x1e')]===undefined?!![]:![]:!![]})[_0x3b90('0x1f')](function(_0x3e5bb8){logger['info'](_0x3b90('0x19'),_0x231690);logger[_0x3b90('0x12')](_0x3b90('0x19'),_0x231690,JSON[_0x3b90('0x20')](_0x3e5bb8));_0x39ae7c(_0x3e5bb8);})[_0x3b90('0x18')](function(_0x93b8e7){logger['error']('CreateFaxMessage',_0x93b8e7[_0x3b90('0x16')],_0x231690);_0x12e1cf(_0x535894[_0x3b90('0x14')](0x1f4,_0x93b8e7[_0x3b90('0x16')]));});});};exports[_0x3b90('0x21')]=function(_0x583523){var _0x414462=this;return new Promise(function(_0x2936d7,_0x1787d1){return db['FaxMessage'][_0x3b90('0x22')](_0x583523[_0x3b90('0x1c')],{'raw':_0x583523[_0x3b90('0x1d')]?_0x583523[_0x3b90('0x1d')][_0x3b90('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x583523[_0x3b90('0x1d')]?_0x583523['options'][_0x3b90('0x23')]||null:null,'attributes':_0x583523['options']?_0x583523[_0x3b90('0x1d')][_0x3b90('0x24')]||null:null,'limit':_0x583523[_0x3b90('0x1d')]?_0x583523[_0x3b90('0x1d')][_0x3b90('0x25')]||null:null})[_0x3b90('0x1f')](function(_0x290283){logger[_0x3b90('0x10')]('UpdateFaxMessage',_0x583523);logger['debug'](_0x3b90('0x21'),_0x583523,JSON[_0x3b90('0x20')](_0x290283));_0x2936d7(_0x290283);})[_0x3b90('0x18')](function(_0x1c2e84){logger['error']('UpdateFaxMessage',_0x1c2e84[_0x3b90('0x16')],_0x583523);_0x1787d1(_0x414462[_0x3b90('0x14')](0x1f4,_0x1c2e84[_0x3b90('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index b726759..09ac418 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 _0xb686=['save','update','emit','register','length','./faxMessage.events'];(function(_0x2fbf2c,_0xb5a8f9){var _0x132005=function(_0xaa95bb){while(--_0xaa95bb){_0x2fbf2c['push'](_0x2fbf2c['shift']());}};_0x132005(++_0xb5a8f9);}(_0xb686,0xe3));var _0x6b68=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0xb686[_0x173441];return _0x2423a8;};'use strict';var FaxMessageEvents=require(_0x6b68('0x0'));var events=[_0x6b68('0x1'),'remove',_0x6b68('0x2')];function createListener(_0x329931,_0x4ee08f){return function(_0x43f915){_0x4ee08f[_0x6b68('0x3')](_0x329931,_0x43f915);};}function removeListener(_0x4eb1aa,_0x37c513){return function(){FaxMessageEvents['removeListener'](_0x4eb1aa,_0x37c513);};}exports[_0x6b68('0x4')]=function(_0x4e97c1){for(var _0x46b1b2=0x0,_0x5366c3=events[_0x6b68('0x5')];_0x46b1b2<_0x5366c3;_0x46b1b2++){var _0x3a5b9f=events[_0x46b1b2];var _0xde968c=createListener('faxMessage:'+_0x3a5b9f,_0x4e97c1);FaxMessageEvents['on'](_0x3a5b9f,_0xde968c);}}; \ No newline at end of file +var _0x307b=['update','emit','removeListener','register','length','faxMessage:','save','remove'];(function(_0x1f2a4c,_0x289773){var _0xe3c234=function(_0x201b8e){while(--_0x201b8e){_0x1f2a4c['push'](_0x1f2a4c['shift']());}};_0xe3c234(++_0x289773);}(_0x307b,0xc6));var _0xb307=function(_0x4b2c0e,_0x45c630){_0x4b2c0e=_0x4b2c0e-0x0;var _0x3ffc1b=_0x307b[_0x4b2c0e];return _0x3ffc1b;};'use strict';var FaxMessageEvents=require('./faxMessage.events');var events=[_0xb307('0x0'),_0xb307('0x1'),_0xb307('0x2')];function createListener(_0x4f1687,_0x4bad29){return function(_0x4c9f4d){_0x4bad29[_0xb307('0x3')](_0x4f1687,_0x4c9f4d);};}function removeListener(_0x161a30,_0x586817){return function(){FaxMessageEvents[_0xb307('0x4')](_0x161a30,_0x586817);};}exports[_0xb307('0x5')]=function(_0xec63ce){for(var _0x4f23ad=0x0,_0x1d9b37=events[_0xb307('0x6')];_0x4f23ad<_0x1d9b37;_0x4f23ad++){var _0x14c658=events[_0x4f23ad];var _0x45d6d8=createListener(_0xb307('0x7')+_0x14c658,_0xec63ce);FaxMessageEvents['on'](_0x14c658,_0x45d6d8);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index 9e63f5d..6e78539 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 _0x4e81=['../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','/describe','isAuthenticated','describe','/:id','show','download','post','tracked','fax','faxmessage:create','create','update','put','/:id/accept','accept','/:id/reject','reject','delete','exports','multer','util','path','fs-extra'];(function(_0x18a79d,_0x57bd2c){var _0x4f8848=function(_0x28af80){while(--_0x28af80){_0x18a79d['push'](_0x18a79d['shift']());}};_0x4f8848(++_0x57bd2c);}(_0x4e81,0x1bc));var _0x14e8=function(_0x107f10,_0x5529f2){_0x107f10=_0x107f10-0x0;var _0x811cab=_0x4e81[_0x107f10];return _0x811cab;};'use strict';var multer=require(_0x14e8('0x0'));var util=require(_0x14e8('0x1'));var path=require(_0x14e8('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x14e8('0x3'));var auth=require(_0x14e8('0x4'));var interaction=require(_0x14e8('0x5'));var config=require(_0x14e8('0x6'));var controller=require(_0x14e8('0x7'));router[_0x14e8('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x14e8('0x8')](_0x14e8('0x9'),auth[_0x14e8('0xa')](),controller[_0x14e8('0xb')]);router[_0x14e8('0x8')](_0x14e8('0xc'),auth[_0x14e8('0xa')](),controller[_0x14e8('0xd')]);router[_0x14e8('0x8')]('/:id/download',auth[_0x14e8('0xa')](),controller[_0x14e8('0xe')]);router[_0x14e8('0xf')]('/',auth[_0x14e8('0xa')](),interaction[_0x14e8('0x10')](_0x14e8('0x11'),_0x14e8('0x12')),controller[_0x14e8('0x13')]);router['put'](_0x14e8('0xc'),auth['isAuthenticated'](),controller[_0x14e8('0x14')]);router[_0x14e8('0x15')](_0x14e8('0x16'),auth['isAuthenticated'](),controller[_0x14e8('0x17')]);router['put'](_0x14e8('0x18'),auth['isAuthenticated'](),controller[_0x14e8('0x19')]);router[_0x14e8('0x1a')](_0x14e8('0xc'),auth[_0x14e8('0xa')](),controller['destroy']);module[_0x14e8('0x1b')]=router; \ No newline at end of file +var _0xb9a7=['faxmessage:create','create','put','update','/:id/accept','/:id/reject','reject','delete','destroy','exports','util','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','index','/describe','/:id','/:id/download','post','tracked'];(function(_0x3630a7,_0x5a7d68){var _0x300b97=function(_0x1a4255){while(--_0x1a4255){_0x3630a7['push'](_0x3630a7['shift']());}};_0x300b97(++_0x5a7d68);}(_0xb9a7,0x112));var _0x7b9a=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0xb9a7[_0x36c5b0];return _0xf19333;};'use strict';var multer=require('multer');var util=require(_0x7b9a('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x7b9a('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0x7b9a('0x2'));var interaction=require(_0x7b9a('0x3'));var config=require(_0x7b9a('0x4'));var controller=require(_0x7b9a('0x5'));router[_0x7b9a('0x6')]('/',auth[_0x7b9a('0x7')](),controller[_0x7b9a('0x8')]);router[_0x7b9a('0x6')](_0x7b9a('0x9'),auth[_0x7b9a('0x7')](),controller['describe']);router[_0x7b9a('0x6')](_0x7b9a('0xa'),auth['isAuthenticated'](),controller['show']);router['get'](_0x7b9a('0xb'),auth[_0x7b9a('0x7')](),controller['download']);router[_0x7b9a('0xc')]('/',auth['isAuthenticated'](),interaction[_0x7b9a('0xd')]('fax',_0x7b9a('0xe')),controller[_0x7b9a('0xf')]);router[_0x7b9a('0x10')]('/:id',auth[_0x7b9a('0x7')](),controller[_0x7b9a('0x11')]);router['put'](_0x7b9a('0x12'),auth[_0x7b9a('0x7')](),controller['accept']);router[_0x7b9a('0x10')](_0x7b9a('0x13'),auth[_0x7b9a('0x7')](),controller[_0x7b9a('0x14')]);router[_0x7b9a('0x15')](_0x7b9a('0xa'),auth[_0x7b9a('0x7')](),controller[_0x7b9a('0x16')]);module[_0x7b9a('0x17')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index 4c1c658..be63ad1 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 _0x2484=['name','STRING','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','exports'];(function(_0x3ec501,_0x1d035a){var _0x5a3037=function(_0x383d66){while(--_0x383d66){_0x3ec501['push'](_0x3ec501['shift']());}};_0x5a3037(++_0x1d035a);}(_0x2484,0x178));var _0x4248=function(_0x17c483,_0xc69535){_0x17c483=_0x17c483-0x0;var _0x112bdb=_0x2484[_0x17c483];return _0x112bdb;};'use strict';var Sequelize=require(_0x4248('0x0'));module[_0x4248('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x4248('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x4248('0x3')]},'timeout':{'type':Sequelize[_0x4248('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x4248('0x5')](_0x4248('0x6'),_0x4248('0x7'),_0x4248('0x8')),'allowNull':![]},'lastAgent':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x9de8=['ENUM','rrmemory','beepall','sequelize','STRING','name','INTEGER'];(function(_0x49ca95,_0x50c62b){var _0x4699f9=function(_0x5a27a0){while(--_0x5a27a0){_0x49ca95['push'](_0x49ca95['shift']());}};_0x4699f9(++_0x50c62b);}(_0x9de8,0x88));var _0x89de=function(_0x43b0db,_0x2ac059){_0x43b0db=_0x43b0db-0x0;var _0x34fa79=_0x9de8[_0x43b0db];return _0x34fa79;};'use strict';var Sequelize=require(_0x89de('0x0'));module['exports']={'name':{'type':Sequelize[_0x89de('0x1')],'unique':_0x89de('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x89de('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x89de('0x4')](_0x89de('0x5'),_0x89de('0x6'),'roundrobin'),'allowNull':![]},'lastAgent':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.controller.js b/server/api/faxQueue/faxQueue.controller.js index 9f660e7..e890c12 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 _0x8c8b=['removeTeams','isEmpty','removeAgents','addAgents','omit','spread','isArray','userFaxQueue:remove','getAgents','User','bluebird','squel','ioredis','../../components/parsers/qs','../../config/logger','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','end','json','undefined','offset','limit','Content-Range','then','destroy','get','FaxQueues','UserProfileResource','error','name','send','index','map','rawAttributes','type','key','getOptions','FaxQueue','count','include','findAll','rows','catch','show','params','model','keys','query','filters','intersection','attributes','fields','length','includeAll','merge','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','describe','getMembers','findOne','nolimit','order','sort','pick','where','FaxQueueId','filter','UserFaxQueue','UserId','agent','faxPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','hasOwnProperty','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userFaxQueue:save','select','field','tq.TeamId','from','team_has_fax_queues','join','user_has_teams','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','SELECT','every','TeamId','includes','union','compact'];(function(_0x3f0b30,_0x159bc8){var _0x2748a5=function(_0x3b42cc){while(--_0x3b42cc){_0x3f0b30['push'](_0x3f0b30['shift']());}};_0x2748a5(++_0x159bc8);}(_0x8c8b,0x106));var _0xb8c8=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x8c8b[_0x2641f9];return _0x585741;};'use strict';var BPromise=require(_0xb8c8('0x0'));var util=require('util');var _=require('lodash');var squel=require(_0xb8c8('0x1'));var Redis=require(_0xb8c8('0x2'));var qs=require(_0xb8c8('0x3'));var logger=require(_0xb8c8('0x4'))('api');var config=require('../../config/environment');var db=require(_0xb8c8('0x5'))['db'];config[_0xb8c8('0x6')]=_[_0xb8c8('0x7')](config[_0xb8c8('0x6')],{'host':_0xb8c8('0x8'),'port':0x18eb});var socket=require(_0xb8c8('0x9'))(new Redis(config[_0xb8c8('0x6')]));require(_0xb8c8('0xa'))[_0xb8c8('0xb')](socket);function respondWithStatusCode(_0x2badd9,_0x142007){_0x142007=_0x142007||0xcc;return function(_0x50834e){if(_0x50834e){return _0x2badd9[_0xb8c8('0xc')](_0x142007);}return _0x2badd9[_0xb8c8('0xd')](_0x142007)[_0xb8c8('0xe')]();};}function respondWithResult(_0x1db0e7,_0x3c74d5){_0x3c74d5=_0x3c74d5||0xc8;return function(_0x3414ec){if(_0x3414ec){return _0x1db0e7[_0xb8c8('0xd')](_0x3c74d5)[_0xb8c8('0xf')](_0x3414ec);}};}function respondWithFilteredResult(_0x8814ad,_0x4b09ed){return function(_0x4758ee){if(_0x4758ee){var _0x2fe426=typeof _0x4b09ed['offset']===_0xb8c8('0x10')&&typeof _0x4b09ed['limit']===_0xb8c8('0x10');var _0x57efd1=_0x4758ee['count'];var _0x3df583=_0x2fe426?0x0:_0x4b09ed[_0xb8c8('0x11')];var _0x306a92=_0x2fe426?_0x4758ee['count']:_0x4b09ed[_0xb8c8('0x11')]+_0x4b09ed[_0xb8c8('0x12')];var _0x1c12c2;if(_0x306a92>=_0x57efd1){_0x306a92=_0x57efd1;_0x1c12c2=0xc8;}else{_0x1c12c2=0xce;}_0x8814ad[_0xb8c8('0xd')](_0x1c12c2);return _0x8814ad['set'](_0xb8c8('0x13'),_0x3df583+'-'+_0x306a92+'/'+_0x57efd1)[_0xb8c8('0xf')](_0x4758ee);}return null;};}function saveUpdates(_0x190365){return function(_0x45ed3a){if(_0x45ed3a){return _0x45ed3a['update'](_0x190365)[_0xb8c8('0x14')](function(_0x25c387){return _0x25c387;});}return null;};}function removeEntity(_0x31886c){return function(_0x3510ee){if(_0x3510ee){return _0x3510ee[_0xb8c8('0x15')]()[_0xb8c8('0x14')](function(){var _0x3c53bc=_0x3510ee[_0xb8c8('0x16')]({'plain':!![]});var _0x355e6e=_0xb8c8('0x17');return db[_0xb8c8('0x18')][_0xb8c8('0x15')]({'where':{'type':_0x355e6e,'resourceId':_0x3c53bc['id']}})[_0xb8c8('0x14')](function(){return _0x3510ee;});})[_0xb8c8('0x14')](function(){_0x31886c[_0xb8c8('0xd')](0xcc)['end']();});}};}function handleEntityNotFound(_0x41a0cb){return function(_0x1161c4){if(!_0x1161c4){_0x41a0cb[_0xb8c8('0xc')](0x194);}return _0x1161c4;};}function handleError(_0x37ec4a,_0x10adaa){_0x10adaa=_0x10adaa||0x1f4;return function(_0x50be0a){logger[_0xb8c8('0x19')](_0x50be0a['stack']);if(_0x50be0a['name']){delete _0x50be0a[_0xb8c8('0x1a')];}_0x37ec4a[_0xb8c8('0xd')](_0x10adaa)[_0xb8c8('0x1b')](_0x50be0a);};}exports[_0xb8c8('0x1c')]=function(_0x61bd9a,_0x4a7392){var _0x1682ba={};var _0x200f06={'count':0x0,'rows':[]};var _0x2bf36f=_[_0xb8c8('0x1d')](db['FaxQueue'][_0xb8c8('0x1e')],function(_0x1b3007){return{'name':_0x1b3007['fieldName'],'type':_0x1b3007[_0xb8c8('0x1f')][_0xb8c8('0x20')]};});_0x1682ba=qs[_0xb8c8('0x21')](_0x2bf36f,_0x61bd9a);var _0x5406d9={'where':_0x1682ba['where']};return db[_0xb8c8('0x22')][_0xb8c8('0x23')](_0x5406d9)['then'](function(_0x90eca8){_0x200f06[_0xb8c8('0x23')]=_0x90eca8;_0x1682ba['include']=qs[_0xb8c8('0x24')](_0x61bd9a['query']);return db[_0xb8c8('0x22')][_0xb8c8('0x25')](_0x1682ba);})[_0xb8c8('0x14')](function(_0x236347){_0x200f06[_0xb8c8('0x26')]=_0x236347;return _0x200f06;})[_0xb8c8('0x14')](respondWithFilteredResult(_0x4a7392,_0x1682ba))[_0xb8c8('0x27')](handleError(_0x4a7392,null));};exports[_0xb8c8('0x28')]=function(_0x3277e4,_0x585a61){var _0x1d00ce={'raw':!![],'where':{'id':_0x3277e4[_0xb8c8('0x29')]['id']}},_0x570895={};_0x570895[_0xb8c8('0x2a')]=_[_0xb8c8('0x2b')](db['FaxQueue'][_0xb8c8('0x1e')]);_0x570895[_0xb8c8('0x2c')]=_[_0xb8c8('0x2b')](_0x3277e4[_0xb8c8('0x2c')]);_0x570895[_0xb8c8('0x2d')]=_[_0xb8c8('0x2e')](_0x570895[_0xb8c8('0x2a')],_0x570895[_0xb8c8('0x2c')]);_0x1d00ce[_0xb8c8('0x2f')]=_[_0xb8c8('0x2e')](_0x570895['model'],qs[_0xb8c8('0x30')](_0x3277e4[_0xb8c8('0x2c')][_0xb8c8('0x30')]));_0x1d00ce[_0xb8c8('0x2f')]=_0x1d00ce[_0xb8c8('0x2f')][_0xb8c8('0x31')]?_0x1d00ce[_0xb8c8('0x2f')]:_0x570895[_0xb8c8('0x2a')];if(_0x3277e4['query'][_0xb8c8('0x32')]){_0x1d00ce['include']=[{'all':!![]}];}_0x1d00ce=_[_0xb8c8('0x33')]({},_0x1d00ce,_0x3277e4[_0xb8c8('0x34')]);return db[_0xb8c8('0x22')][_0xb8c8('0x35')](_0x1d00ce)[_0xb8c8('0x14')](handleEntityNotFound(_0x585a61,null))[_0xb8c8('0x14')](respondWithResult(_0x585a61,null))['catch'](handleError(_0x585a61,null));};exports[_0xb8c8('0x36')]=function(_0x11b8ed,_0x1f5461){return db[_0xb8c8('0x22')][_0xb8c8('0x36')](_0x11b8ed['body'],{})['then'](function(_0x2c2750){var _0xcf573c=_0x11b8ed[_0xb8c8('0x37')][_0xb8c8('0x16')]({'plain':!![]});if(!_0xcf573c)throw new Error(_0xb8c8('0x38'));if(_0xcf573c[_0xb8c8('0x39')]===_0xb8c8('0x37')){var _0x3e8667=_0x2c2750[_0xb8c8('0x16')]({'plain':!![]});var _0x4f6803=_0xb8c8('0x17');return db['UserProfileSection'][_0xb8c8('0x35')]({'where':{'name':_0x4f6803,'userProfileId':_0xcf573c[_0xb8c8('0x3a')]},'raw':!![]})[_0xb8c8('0x14')](function(_0x466222){if(_0x466222&&_0x466222[_0xb8c8('0x3b')]===0x0){return db[_0xb8c8('0x18')][_0xb8c8('0x36')]({'name':_0x3e8667[_0xb8c8('0x1a')],'resourceId':_0x3e8667['id'],'type':_0x466222[_0xb8c8('0x1a')],'sectionId':_0x466222['id']},{})['then'](function(){return _0x2c2750;});}else{return _0x2c2750;}})[_0xb8c8('0x27')](function(_0x1d5d94){logger[_0xb8c8('0x19')](_0xb8c8('0x3c'),_0x1d5d94);throw _0x1d5d94;});}return _0x2c2750;})[_0xb8c8('0x14')](respondWithResult(_0x1f5461,0xc9))[_0xb8c8('0x27')](handleError(_0x1f5461,null));};exports[_0xb8c8('0x3d')]=function(_0x23b5cc,_0x3405b0){if(_0x23b5cc[_0xb8c8('0x3e')]['id']){delete _0x23b5cc[_0xb8c8('0x3e')]['id'];}return db[_0xb8c8('0x22')][_0xb8c8('0x35')]({'where':{'id':_0x23b5cc[_0xb8c8('0x29')]['id']}})[_0xb8c8('0x14')](handleEntityNotFound(_0x3405b0,null))[_0xb8c8('0x14')](saveUpdates(_0x23b5cc[_0xb8c8('0x3e')],null))['then'](respondWithResult(_0x3405b0,null))['catch'](handleError(_0x3405b0,null));};exports[_0xb8c8('0x15')]=function(_0x23f687,_0x19d545){return db[_0xb8c8('0x22')][_0xb8c8('0x35')]({'where':{'id':_0x23f687[_0xb8c8('0x29')]['id']}})[_0xb8c8('0x14')](handleEntityNotFound(_0x19d545,null))['then'](removeEntity(_0x19d545,null))[_0xb8c8('0x27')](handleError(_0x19d545,null));};exports['describe']=function(_0x482b73,_0x340fc4){return db[_0xb8c8('0x22')][_0xb8c8('0x3f')]()[_0xb8c8('0x14')](respondWithResult(_0x340fc4,null))['catch'](handleError(_0x340fc4,null));};exports[_0xb8c8('0x40')]=function(_0x381d9d,_0x5e7edb){var _0x44f3b6={'raw':!![],'where':{}},_0x5bfec7={},_0x4f2d5c;return db['FaxQueue'][_0xb8c8('0x41')]({'where':{'id':_0x381d9d[_0xb8c8('0x29')]['id']}})['then'](handleEntityNotFound(_0x5e7edb,null))[_0xb8c8('0x14')](function(_0x562b52){if(_0x562b52){_0x4f2d5c=_0x562b52[_0xb8c8('0x16')]({'plain':!![]});_0x5bfec7[_0xb8c8('0x2a')]=_[_0xb8c8('0x2b')](db['UserFaxQueue'][_0xb8c8('0x1e')]);_0x5bfec7[_0xb8c8('0x2c')]=_['keys'](_0x381d9d[_0xb8c8('0x2c')]);_0x5bfec7[_0xb8c8('0x2d')]=_[_0xb8c8('0x2e')](_0x5bfec7[_0xb8c8('0x2a')],_0x5bfec7[_0xb8c8('0x2c')]);_0x44f3b6[_0xb8c8('0x2f')]=_['intersection'](_0x5bfec7[_0xb8c8('0x2a')],qs['fields'](_0x381d9d[_0xb8c8('0x2c')]['fields']));_0x44f3b6[_0xb8c8('0x2f')]=_0x44f3b6[_0xb8c8('0x2f')][_0xb8c8('0x31')]?_0x44f3b6['attributes']:_0x5bfec7['model'];if(!_0x381d9d[_0xb8c8('0x2c')]['hasOwnProperty'](_0xb8c8('0x42'))){_0x44f3b6['limit']=qs[_0xb8c8('0x12')](_0x381d9d[_0xb8c8('0x2c')]['limit']);_0x44f3b6[_0xb8c8('0x11')]=qs[_0xb8c8('0x11')](_0x381d9d[_0xb8c8('0x2c')][_0xb8c8('0x11')]);}_0x44f3b6[_0xb8c8('0x43')]=qs[_0xb8c8('0x44')](_0x381d9d[_0xb8c8('0x2c')][_0xb8c8('0x44')]);_0x44f3b6['where']=qs[_0xb8c8('0x2d')](_[_0xb8c8('0x45')](_0x381d9d['query'],_0x5bfec7[_0xb8c8('0x2d')]));_0x44f3b6[_0xb8c8('0x46')][_0xb8c8('0x47')]=_0x562b52['id'];if(_0x381d9d[_0xb8c8('0x2c')][_0xb8c8('0x48')]){_0x44f3b6[_0xb8c8('0x46')]=_['merge'](_0x44f3b6['where'],{'$or':_[_0xb8c8('0x1d')](_0x44f3b6[_0xb8c8('0x2f')],function(_0x387e79){var _0x54c3fe={};_0x54c3fe[_0x387e79]={'$like':'%'+_0x381d9d[_0xb8c8('0x2c')][_0xb8c8('0x48')]+'%'};return _0x54c3fe;})});}_0x44f3b6=_[_0xb8c8('0x33')]({},_0x44f3b6,_0x381d9d[_0xb8c8('0x34')]);return db[_0xb8c8('0x49')][_0xb8c8('0x25')](_0x44f3b6);}})[_0xb8c8('0x14')](function(_0x433c4b){if(_0x433c4b){return db['User']['findAndCountAll']({'where':{'id':_[_0xb8c8('0x1d')](_0x433c4b,_0xb8c8('0x4a')),'role':_0xb8c8('0x4b')},'attributes':['id',_0xb8c8('0x1a'),_0xb8c8('0x4c'),_0xb8c8('0x4d'),_0xb8c8('0x4e')]});}})['then'](function(_0x2e7af4){if(_0x2e7af4){return{'count':_0x2e7af4[_0xb8c8('0x23')],'rows':_[_0xb8c8('0x1d')](_0x2e7af4[_0xb8c8('0x26')],function(_0x4251d2){return{'membername':_0x4251d2[_0xb8c8('0x1a')],'UserId':_0x4251d2['id'],'queue_name':_0x4f2d5c[_0xb8c8('0x1a')],'FaxQueueId':_0x4f2d5c['id'],'interface':util[_0xb8c8('0x4f')](_0xb8c8('0x50'),_0xb8c8('0x51'),_0x4251d2[_0xb8c8('0x1a')]),'penalty':0x0,'paused':_0x4251d2['faxPause'],'createdAt':_0x4251d2[_0xb8c8('0x4e')],'updatedAt':_0x4251d2[_0xb8c8('0x4d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xb8c8('0x14')](respondWithFilteredResult(_0x5e7edb,_0x44f3b6))[_0xb8c8('0x27')](handleError(_0x5e7edb,null));};exports[_0xb8c8('0x52')]=function(_0x301e9c,_0x2b8fa1){var _0x14c889={};var _0xcc52a0={};var _0x48805f;var _0x1bc468;return db[_0xb8c8('0x22')]['findOne']({'where':{'id':_0x301e9c[_0xb8c8('0x29')]['id']}})['then'](handleEntityNotFound(_0x2b8fa1,null))[_0xb8c8('0x14')](function(_0xb7aa7f){if(_0xb7aa7f){_0x48805f=_0xb7aa7f;_0xcc52a0[_0xb8c8('0x2a')]=_[_0xb8c8('0x2b')](db[_0xb8c8('0x53')]['rawAttributes']);_0xcc52a0['query']=_[_0xb8c8('0x2b')](_0x301e9c['query']);_0xcc52a0[_0xb8c8('0x2d')]=_[_0xb8c8('0x2e')](_0xcc52a0[_0xb8c8('0x2a')],_0xcc52a0[_0xb8c8('0x2c')]);_0x14c889[_0xb8c8('0x2f')]=_['intersection'](_0xcc52a0['model'],qs['fields'](_0x301e9c[_0xb8c8('0x2c')]['fields']));_0x14c889[_0xb8c8('0x2f')]=_0x14c889[_0xb8c8('0x2f')]['length']?_0x14c889[_0xb8c8('0x2f')]:_0xcc52a0[_0xb8c8('0x2a')];_0x14c889['order']=qs[_0xb8c8('0x44')](_0x301e9c[_0xb8c8('0x2c')][_0xb8c8('0x44')]);_0x14c889[_0xb8c8('0x46')]=qs[_0xb8c8('0x2d')](_[_0xb8c8('0x45')](_0x301e9c['query'],_0xcc52a0[_0xb8c8('0x2d')]));if(_0x301e9c[_0xb8c8('0x2c')][_0xb8c8('0x48')]){_0x14c889[_0xb8c8('0x46')]=_[_0xb8c8('0x33')](_0x14c889[_0xb8c8('0x46')],{'$or':_['map'](_0x14c889['attributes'],function(_0x5814f0){var _0x3ee117={};_0x3ee117[_0x5814f0]={'$like':'%'+_0x301e9c[_0xb8c8('0x2c')][_0xb8c8('0x48')]+'%'};return _0x3ee117;})});}_0x14c889=_[_0xb8c8('0x33')]({},_0x14c889,_0x301e9c[_0xb8c8('0x34')]);return _0x48805f[_0xb8c8('0x52')](_0x14c889);}})[_0xb8c8('0x14')](function(_0xef5377){if(_0xef5377){_0x1bc468=_0xef5377[_0xb8c8('0x31')];if(!_0x301e9c[_0xb8c8('0x2c')][_0xb8c8('0x54')](_0xb8c8('0x42'))){_0x14c889['limit']=qs[_0xb8c8('0x12')](_0x301e9c[_0xb8c8('0x2c')]['limit']);_0x14c889['offset']=qs[_0xb8c8('0x11')](_0x301e9c[_0xb8c8('0x2c')][_0xb8c8('0x11')]);}return _0x48805f['getTeams'](_0x14c889);}})[_0xb8c8('0x14')](function(_0x53a043){if(_0x53a043){return _0x53a043?{'count':_0x1bc468,'rows':_0x53a043}:null;}})[_0xb8c8('0x14')](respondWithResult(_0x2b8fa1,null))[_0xb8c8('0x27')](handleError(_0x2b8fa1,null));};exports[_0xb8c8('0x55')]=function(_0x3c875a,_0x38a024){var _0x599228=_0x3c875a[_0xb8c8('0x3e')][_0xb8c8('0x56')];return db[_0xb8c8('0x53')]['findAll']({'where':{'id':_0x599228},'attributes':['id'],'include':[{'model':db['User'],'as':_0xb8c8('0x57'),'attributes':['id',_0xb8c8('0x1a'),_0xb8c8('0x58'),_0xb8c8('0x59'),_0xb8c8('0x5a')],'raw':!![]}]})[_0xb8c8('0x14')](function(_0x432af1){if(_0x432af1){var _0x68ac26=_[_0xb8c8('0x5b')](_0x432af1,function(_0xf6fbc7){var _0x2878ab=_0xf6fbc7[_0xb8c8('0x16')]({'plain':!![]});return _0x2878ab[_0xb8c8('0x57')];});return db['FaxQueue'][_0xb8c8('0x35')]({'where':{'id':_0x3c875a[_0xb8c8('0x29')]['id']}})[_0xb8c8('0x14')](function(_0x5a582d){return db[_0xb8c8('0x5c')][_0xb8c8('0x5d')](function(_0x2587bb){return _0x5a582d[_0xb8c8('0x55')](_0x599228,{'transaction':_0x2587bb})['then'](function(){return BPromise[_0xb8c8('0x5e')](_0x68ac26,function(_0x513f55){return db[_0xb8c8('0x49')][_0xb8c8('0x5f')]({'where':{'UserId':_0x513f55['id'],'FaxQueueId':_0x3c875a['params']['id']},'transaction':_0x2587bb});});})[_0xb8c8('0x14')](function(){_0x68ac26[_0xb8c8('0x60')](function(_0x5a24e9){socket[_0xb8c8('0x61')](_0xb8c8('0x62'),{'UserId':_0x5a24e9['id'],'FaxQueueId':_0x5a582d['id']});});});});});}})[_0xb8c8('0x14')](respondWithStatusCode(_0x38a024,null))[_0xb8c8('0x27')](handleError(_0x38a024,null));};exports['removeTeams']=function(_0xf7de92,_0x46f00d){return db[_0xb8c8('0x53')][_0xb8c8('0x25')]({'where':{'id':_0xf7de92['query'][_0xb8c8('0x56')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xb8c8('0x57'),'attributes':['id'],'raw':!![]}]})[_0xb8c8('0x14')](handleEntityNotFound(_0x46f00d,null))[_0xb8c8('0x14')](function(_0x511d39){var _0x284425=_[_0xb8c8('0x1d')](_0x511d39,'id');var _0x35dea4=[];var _0x6e871e=[];var _0x1a2dd2=squel[_0xb8c8('0x63')]();_0x1a2dd2[_0xb8c8('0x64')](_0xb8c8('0x65'))[_0xb8c8('0x66')](_0xb8c8('0x67'),'tq')[_0xb8c8('0x68')](_0xb8c8('0x69'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0xb8c8('0x6a'),_0xf7de92[_0xb8c8('0x29')]['id']);for(var _0x26580a=0x0;_0x26580a<_0x511d39[_0xb8c8('0x31')];_0x26580a+=0x1){let _0x54087f=_0x511d39[_0x26580a];for(var _0x1fa1d6=0x0;_0x1fa1d6<_0x54087f[_0xb8c8('0x57')][_0xb8c8('0x31')];_0x1fa1d6+=0x1){let _0x34d07e=_0x54087f[_0xb8c8('0x57')][_0x1fa1d6];var _0x1e7758=_0x1a2dd2[_0xb8c8('0x6b')]();_0x1e7758['where'](_0xb8c8('0x6c'),_0x34d07e['id']);_0x6e871e['push'](db[_0xb8c8('0x5c')][_0xb8c8('0x2c')](_0x1e7758[_0xb8c8('0x6d')](),{'type':db[_0xb8c8('0x5c')]['QueryTypes'][_0xb8c8('0x6e')]})['then'](function(_0x3824a2){if(_0x3824a2['length']===0x1){return _0x34d07e['id'];}else{var _0x49e40d=_[_0xb8c8('0x6f')](_[_0xb8c8('0x1d')](_0x3824a2,_0xb8c8('0x70')),function(_0x1aa3b5){return _[_0xb8c8('0x71')](_0x284425,_0x1aa3b5);});if(_0x49e40d){return _0x34d07e['id'];}}}));}}return BPromise['all'](_0x6e871e)['then'](function(_0x19adb5){_0x35dea4=_(_0x35dea4)[_0xb8c8('0x72')](_0x19adb5)[_0xb8c8('0x73')]()['value']();return db['FaxQueue'][_0xb8c8('0x35')]({'where':{'id':_0xf7de92[_0xb8c8('0x29')]['id']}})[_0xb8c8('0x14')](function(_0xef8f66){return db[_0xb8c8('0x5c')]['transaction'](function(_0x338ed3){return _0xef8f66[_0xb8c8('0x74')](_0xf7de92['query'][_0xb8c8('0x56')],{'transaction':_0x338ed3})['then'](function(){if(!_[_0xb8c8('0x75')](_0x35dea4)){return _0xef8f66[_0xb8c8('0x76')](_0x35dea4,{'transaction':_0x338ed3});}})[_0xb8c8('0x14')](function(){_0x35dea4[_0xb8c8('0x60')](function(_0x3d1d99){socket[_0xb8c8('0x61')]('userFaxQueue:remove',{'UserId':_0x3d1d99,'FaxQueueId':_0xef8f66['id']});});});});});});})[_0xb8c8('0x14')](respondWithStatusCode(_0x46f00d,null))[_0xb8c8('0x27')](handleError(_0x46f00d,null));};exports[_0xb8c8('0x77')]=function(_0x441a73,_0x17a44a){return db[_0xb8c8('0x22')][_0xb8c8('0x35')]({'where':{'id':_0x441a73['params']['id']}})[_0xb8c8('0x14')](handleEntityNotFound(_0x17a44a,null))[_0xb8c8('0x14')](function(_0x5c2ac3){if(_0x5c2ac3){return _0x5c2ac3['addAgents'](_0x441a73[_0xb8c8('0x3e')]['ids'],_[_0xb8c8('0x78')](_0x441a73[_0xb8c8('0x3e')],['ids','id'])||{})[_0xb8c8('0x79')](function(_0x5e6bb8){for(var _0x222ff4=0x0;_0x222ff4<_0x441a73['body']['ids']['length'];_0x222ff4+=0x1){socket[_0xb8c8('0x61')](_0xb8c8('0x62'),{'UserId':Number(_0x441a73[_0xb8c8('0x3e')][_0xb8c8('0x56')][_0x222ff4]),'FaxQueueId':Number(_0x441a73[_0xb8c8('0x29')]['id'])});}return _0x5e6bb8;});}})[_0xb8c8('0x14')](respondWithResult(_0x17a44a,null))[_0xb8c8('0x27')](handleError(_0x17a44a,null));};exports[_0xb8c8('0x76')]=function(_0x42382e,_0x3288cc){return db[_0xb8c8('0x22')][_0xb8c8('0x35')]({'where':{'id':_0x42382e[_0xb8c8('0x29')]['id']}})[_0xb8c8('0x14')](handleEntityNotFound(_0x3288cc,null))['then'](function(_0x4a8797){if(_0x4a8797){return _0x4a8797[_0xb8c8('0x76')](_0x42382e[_0xb8c8('0x2c')][_0xb8c8('0x56')])[_0xb8c8('0x14')](function(){if(_[_0xb8c8('0x7a')](_0x42382e[_0xb8c8('0x2c')][_0xb8c8('0x56')])){for(var _0x128c98=0x0;_0x128c98<_0x42382e[_0xb8c8('0x2c')][_0xb8c8('0x56')]['length'];_0x128c98+=0x1){socket['emit']('userFaxQueue:remove',{'UserId':Number(_0x42382e['query'][_0xb8c8('0x56')][_0x128c98]),'FaxQueueId':Number(_0x42382e['params']['id'])});}}else{socket[_0xb8c8('0x61')](_0xb8c8('0x7b'),{'UserId':Number(_0x42382e['query'][_0xb8c8('0x56')]),'FaxQueueId':Number(_0x42382e['params']['id'])});}});}})['then'](respondWithStatusCode(_0x3288cc,null))[_0xb8c8('0x27')](handleError(_0x3288cc,null));};exports[_0xb8c8('0x7c')]=function(_0x2fae13,_0x5dd20c){var _0x5e38d9={};var _0x3ddf60={};var _0x230662;var _0x15af5a;return db[_0xb8c8('0x22')][_0xb8c8('0x41')]({'where':{'id':_0x2fae13['params']['id']}})[_0xb8c8('0x14')](handleEntityNotFound(_0x5dd20c,null))[_0xb8c8('0x14')](function(_0x197ee0){if(_0x197ee0){_0x230662=_0x197ee0;_0x3ddf60['model']=_[_0xb8c8('0x2b')](db[_0xb8c8('0x7d')][_0xb8c8('0x1e')]);_0x3ddf60['query']=_[_0xb8c8('0x2b')](_0x2fae13['query']);_0x3ddf60[_0xb8c8('0x2d')]=_[_0xb8c8('0x2e')](_0x3ddf60['model'],_0x3ddf60[_0xb8c8('0x2c')]);_0x5e38d9[_0xb8c8('0x2f')]=_[_0xb8c8('0x2e')](_0x3ddf60[_0xb8c8('0x2a')],qs[_0xb8c8('0x30')](_0x2fae13[_0xb8c8('0x2c')][_0xb8c8('0x30')]));_0x5e38d9[_0xb8c8('0x2f')]=_0x5e38d9[_0xb8c8('0x2f')]['length']?_0x5e38d9[_0xb8c8('0x2f')]:_0x3ddf60[_0xb8c8('0x2a')];_0x5e38d9[_0xb8c8('0x43')]=qs[_0xb8c8('0x44')](_0x2fae13[_0xb8c8('0x2c')][_0xb8c8('0x44')]);_0x5e38d9[_0xb8c8('0x46')]=qs['filters'](_[_0xb8c8('0x45')](_0x2fae13['query'],_0x3ddf60['filters']));if(_0x2fae13[_0xb8c8('0x2c')][_0xb8c8('0x48')]){_0x5e38d9[_0xb8c8('0x46')]=_[_0xb8c8('0x33')](_0x5e38d9[_0xb8c8('0x46')],{'$or':_[_0xb8c8('0x1d')](_0x5e38d9[_0xb8c8('0x2f')],function(_0x5a61c5){var _0x550c6e={};_0x550c6e[_0x5a61c5]={'$like':'%'+_0x2fae13[_0xb8c8('0x2c')]['filter']+'%'};return _0x550c6e;})});}_0x5e38d9=_[_0xb8c8('0x33')]({},_0x5e38d9,_0x2fae13[_0xb8c8('0x34')]);return _0x230662[_0xb8c8('0x7c')](_0x5e38d9);}})[_0xb8c8('0x14')](function(_0x111fcd){if(_0x111fcd){_0x15af5a=_0x111fcd[_0xb8c8('0x31')];if(!_0x2fae13['query'][_0xb8c8('0x54')](_0xb8c8('0x42'))){_0x5e38d9[_0xb8c8('0x12')]=qs['limit'](_0x2fae13[_0xb8c8('0x2c')][_0xb8c8('0x12')]);_0x5e38d9[_0xb8c8('0x11')]=qs[_0xb8c8('0x11')](_0x2fae13['query'][_0xb8c8('0x11')]);}return _0x230662[_0xb8c8('0x7c')](_0x5e38d9);}})[_0xb8c8('0x14')](function(_0x46a0d3){if(_0x46a0d3){return _0x46a0d3?{'count':_0x15af5a,'rows':_0x46a0d3}:null;}})[_0xb8c8('0x14')](respondWithResult(_0x5dd20c,null))[_0xb8c8('0x27')](handleError(_0x5dd20c,null));}; \ No newline at end of file +var _0xa0a1=['lodash','squel','ioredis','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','offset','undefined','limit','count','set','json','destroy','get','FaxQueues','then','end','error','name','send','index','map','FaxQueue','rawAttributes','fieldName','type','key','getOptions','where','include','findAll','rows','catch','show','params','keys','query','filters','intersection','model','attributes','fields','length','includeAll','merge','options','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','create','update','describe','findOne','UserFaxQueue','hasOwnProperty','nolimit','sort','filter','findAndCountAll','UserId','agent','createdAt','format','%s/%s','SIP','faxPause','updatedAt','getTeams','Team','order','pick','addTeams','ids','Agents','online','voicePause','interface','sequelize','each','findOrCreate','forEach','userFaxQueue:save','select','field','from','team_has_fax_queues','join','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','ut.UserId\x20=\x20?','toString','SELECT','every','TeamId','includes','compact','removeTeams','isEmpty','removeAgents','emit','userFaxQueue:remove','addAgents','omit','spread','getAgents','bluebird'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xa0a1,0x15b));var _0x1a0a=function(_0x2c2174,_0x1f123c){_0x2c2174=_0x2c2174-0x0;var _0x530d3c=_0xa0a1[_0x2c2174];return _0x530d3c;};'use strict';var BPromise=require(_0x1a0a('0x0'));var util=require('util');var _=require(_0x1a0a('0x1'));var squel=require(_0x1a0a('0x2'));var Redis=require(_0x1a0a('0x3'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x1a0a('0x4'));var config=require(_0x1a0a('0x5'));var db=require('../../mysqldb')['db'];config[_0x1a0a('0x6')]=_[_0x1a0a('0x7')](config['redis'],{'host':_0x1a0a('0x8'),'port':0x18eb});var socket=require(_0x1a0a('0x9'))(new Redis(config[_0x1a0a('0x6')]));require(_0x1a0a('0xa'))[_0x1a0a('0xb')](socket);function respondWithStatusCode(_0x48d604,_0x2e5bec){_0x2e5bec=_0x2e5bec||0xcc;return function(_0x3c57b5){if(_0x3c57b5){return _0x48d604[_0x1a0a('0xc')](_0x2e5bec);}return _0x48d604['status'](_0x2e5bec)['end']();};}function respondWithResult(_0x53a060,_0x42277a){_0x42277a=_0x42277a||0xc8;return function(_0xf92e83){if(_0xf92e83){return _0x53a060[_0x1a0a('0xd')](_0x42277a)['json'](_0xf92e83);}};}function respondWithFilteredResult(_0x1d8bda,_0x4a0eda){return function(_0x280df2){if(_0x280df2){var _0x111e90=typeof _0x4a0eda[_0x1a0a('0xe')]===_0x1a0a('0xf')&&typeof _0x4a0eda[_0x1a0a('0x10')]===_0x1a0a('0xf');var _0x3f34d2=_0x280df2['count'];var _0x88d191=_0x111e90?0x0:_0x4a0eda[_0x1a0a('0xe')];var _0x3c531c=_0x111e90?_0x280df2[_0x1a0a('0x11')]:_0x4a0eda[_0x1a0a('0xe')]+_0x4a0eda['limit'];var _0x16b8c9;if(_0x3c531c>=_0x3f34d2){_0x3c531c=_0x3f34d2;_0x16b8c9=0xc8;}else{_0x16b8c9=0xce;}_0x1d8bda[_0x1a0a('0xd')](_0x16b8c9);return _0x1d8bda[_0x1a0a('0x12')]('Content-Range',_0x88d191+'-'+_0x3c531c+'/'+_0x3f34d2)[_0x1a0a('0x13')](_0x280df2);}return null;};}function saveUpdates(_0x57c942){return function(_0x20d307){if(_0x20d307){return _0x20d307['update'](_0x57c942)['then'](function(_0x3a988c){return _0x3a988c;});}return null;};}function removeEntity(_0x2a66b8){return function(_0x307fdc){if(_0x307fdc){return _0x307fdc[_0x1a0a('0x14')]()['then'](function(){var _0x56b8a5=_0x307fdc[_0x1a0a('0x15')]({'plain':!![]});var _0x40903a=_0x1a0a('0x16');return db['UserProfileResource'][_0x1a0a('0x14')]({'where':{'type':_0x40903a,'resourceId':_0x56b8a5['id']}})[_0x1a0a('0x17')](function(){return _0x307fdc;});})['then'](function(){_0x2a66b8[_0x1a0a('0xd')](0xcc)[_0x1a0a('0x18')]();});}};}function handleEntityNotFound(_0x316ae3){return function(_0x53e569){if(!_0x53e569){_0x316ae3[_0x1a0a('0xc')](0x194);}return _0x53e569;};}function handleError(_0xc33284,_0x1f4083){_0x1f4083=_0x1f4083||0x1f4;return function(_0x54e64e){logger[_0x1a0a('0x19')](_0x54e64e['stack']);if(_0x54e64e[_0x1a0a('0x1a')]){delete _0x54e64e[_0x1a0a('0x1a')];}_0xc33284[_0x1a0a('0xd')](_0x1f4083)[_0x1a0a('0x1b')](_0x54e64e);};}exports[_0x1a0a('0x1c')]=function(_0x578995,_0x1e2b28){var _0x8e4151={};var _0x561407={'count':0x0,'rows':[]};var _0x4cf939=_[_0x1a0a('0x1d')](db[_0x1a0a('0x1e')][_0x1a0a('0x1f')],function(_0x365ab5){return{'name':_0x365ab5[_0x1a0a('0x20')],'type':_0x365ab5[_0x1a0a('0x21')][_0x1a0a('0x22')]};});_0x8e4151=qs[_0x1a0a('0x23')](_0x4cf939,_0x578995);var _0x28b7e6={'where':_0x8e4151[_0x1a0a('0x24')]};return db[_0x1a0a('0x1e')][_0x1a0a('0x11')](_0x28b7e6)[_0x1a0a('0x17')](function(_0x385f2b){_0x561407[_0x1a0a('0x11')]=_0x385f2b;_0x8e4151[_0x1a0a('0x25')]=qs[_0x1a0a('0x25')](_0x578995['query']);return db[_0x1a0a('0x1e')][_0x1a0a('0x26')](_0x8e4151);})[_0x1a0a('0x17')](function(_0x39fb79){_0x561407[_0x1a0a('0x27')]=_0x39fb79;return _0x561407;})[_0x1a0a('0x17')](respondWithFilteredResult(_0x1e2b28,_0x8e4151))[_0x1a0a('0x28')](handleError(_0x1e2b28,null));};exports[_0x1a0a('0x29')]=function(_0x16a862,_0x2554c7){var _0x5de7a4={'raw':!![],'where':{'id':_0x16a862[_0x1a0a('0x2a')]['id']}},_0x2f72f4={};_0x2f72f4['model']=_[_0x1a0a('0x2b')](db['FaxQueue']['rawAttributes']);_0x2f72f4[_0x1a0a('0x2c')]=_[_0x1a0a('0x2b')](_0x16a862['query']);_0x2f72f4[_0x1a0a('0x2d')]=_[_0x1a0a('0x2e')](_0x2f72f4[_0x1a0a('0x2f')],_0x2f72f4['query']);_0x5de7a4[_0x1a0a('0x30')]=_[_0x1a0a('0x2e')](_0x2f72f4['model'],qs[_0x1a0a('0x31')](_0x16a862[_0x1a0a('0x2c')]['fields']));_0x5de7a4[_0x1a0a('0x30')]=_0x5de7a4[_0x1a0a('0x30')][_0x1a0a('0x32')]?_0x5de7a4[_0x1a0a('0x30')]:_0x2f72f4['model'];if(_0x16a862[_0x1a0a('0x2c')][_0x1a0a('0x33')]){_0x5de7a4[_0x1a0a('0x25')]=[{'all':!![]}];}_0x5de7a4=_[_0x1a0a('0x34')]({},_0x5de7a4,_0x16a862[_0x1a0a('0x35')]);return db[_0x1a0a('0x1e')][_0x1a0a('0x36')](_0x5de7a4)[_0x1a0a('0x17')](handleEntityNotFound(_0x2554c7,null))[_0x1a0a('0x17')](respondWithResult(_0x2554c7,null))['catch'](handleError(_0x2554c7,null));};exports['create']=function(_0x5bbbde,_0x50e4d7){return db[_0x1a0a('0x1e')]['create'](_0x5bbbde[_0x1a0a('0x37')],{})[_0x1a0a('0x17')](function(_0x57605a){var _0x5f586c=_0x5bbbde[_0x1a0a('0x38')][_0x1a0a('0x15')]({'plain':!![]});if(!_0x5f586c)throw new Error(_0x1a0a('0x39'));if(_0x5f586c[_0x1a0a('0x3a')]==='user'){var _0x250dd5=_0x57605a['get']({'plain':!![]});var _0x5aff39='FaxQueues';return db[_0x1a0a('0x3b')][_0x1a0a('0x36')]({'where':{'name':_0x5aff39,'userProfileId':_0x5f586c['userProfileId']},'raw':!![]})[_0x1a0a('0x17')](function(_0x2dcda5){if(_0x2dcda5&&_0x2dcda5['autoAssociation']===0x0){return db['UserProfileResource'][_0x1a0a('0x3c')]({'name':_0x250dd5[_0x1a0a('0x1a')],'resourceId':_0x250dd5['id'],'type':_0x2dcda5['name'],'sectionId':_0x2dcda5['id']},{})[_0x1a0a('0x17')](function(){return _0x57605a;});}else{return _0x57605a;}})[_0x1a0a('0x28')](function(_0x56cfd6){logger[_0x1a0a('0x19')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x56cfd6);throw _0x56cfd6;});}return _0x57605a;})[_0x1a0a('0x17')](respondWithResult(_0x50e4d7,0xc9))['catch'](handleError(_0x50e4d7,null));};exports[_0x1a0a('0x3d')]=function(_0x7b6e14,_0x3466f6){if(_0x7b6e14[_0x1a0a('0x37')]['id']){delete _0x7b6e14['body']['id'];}return db[_0x1a0a('0x1e')][_0x1a0a('0x36')]({'where':{'id':_0x7b6e14[_0x1a0a('0x2a')]['id']}})[_0x1a0a('0x17')](handleEntityNotFound(_0x3466f6,null))['then'](saveUpdates(_0x7b6e14[_0x1a0a('0x37')],null))[_0x1a0a('0x17')](respondWithResult(_0x3466f6,null))['catch'](handleError(_0x3466f6,null));};exports[_0x1a0a('0x14')]=function(_0xfba0d,_0x89f654){return db[_0x1a0a('0x1e')][_0x1a0a('0x36')]({'where':{'id':_0xfba0d[_0x1a0a('0x2a')]['id']}})[_0x1a0a('0x17')](handleEntityNotFound(_0x89f654,null))[_0x1a0a('0x17')](removeEntity(_0x89f654,null))[_0x1a0a('0x28')](handleError(_0x89f654,null));};exports[_0x1a0a('0x3e')]=function(_0x5b07f0,_0x35c133){return db[_0x1a0a('0x1e')]['describe']()['then'](respondWithResult(_0x35c133,null))['catch'](handleError(_0x35c133,null));};exports['getMembers']=function(_0x455f57,_0x190bf9){var _0x48711d={'raw':!![],'where':{}},_0x5a591c={},_0x599d6e;return db[_0x1a0a('0x1e')][_0x1a0a('0x3f')]({'where':{'id':_0x455f57[_0x1a0a('0x2a')]['id']}})[_0x1a0a('0x17')](handleEntityNotFound(_0x190bf9,null))[_0x1a0a('0x17')](function(_0x167a5e){if(_0x167a5e){_0x599d6e=_0x167a5e[_0x1a0a('0x15')]({'plain':!![]});_0x5a591c[_0x1a0a('0x2f')]=_[_0x1a0a('0x2b')](db[_0x1a0a('0x40')][_0x1a0a('0x1f')]);_0x5a591c[_0x1a0a('0x2c')]=_[_0x1a0a('0x2b')](_0x455f57['query']);_0x5a591c[_0x1a0a('0x2d')]=_[_0x1a0a('0x2e')](_0x5a591c[_0x1a0a('0x2f')],_0x5a591c['query']);_0x48711d[_0x1a0a('0x30')]=_[_0x1a0a('0x2e')](_0x5a591c['model'],qs[_0x1a0a('0x31')](_0x455f57[_0x1a0a('0x2c')]['fields']));_0x48711d['attributes']=_0x48711d[_0x1a0a('0x30')]['length']?_0x48711d['attributes']:_0x5a591c[_0x1a0a('0x2f')];if(!_0x455f57['query'][_0x1a0a('0x41')](_0x1a0a('0x42'))){_0x48711d[_0x1a0a('0x10')]=qs[_0x1a0a('0x10')](_0x455f57[_0x1a0a('0x2c')][_0x1a0a('0x10')]);_0x48711d[_0x1a0a('0xe')]=qs[_0x1a0a('0xe')](_0x455f57[_0x1a0a('0x2c')][_0x1a0a('0xe')]);}_0x48711d['order']=qs[_0x1a0a('0x43')](_0x455f57['query'][_0x1a0a('0x43')]);_0x48711d[_0x1a0a('0x24')]=qs['filters'](_['pick'](_0x455f57[_0x1a0a('0x2c')],_0x5a591c[_0x1a0a('0x2d')]));_0x48711d['where']['FaxQueueId']=_0x167a5e['id'];if(_0x455f57[_0x1a0a('0x2c')]['filter']){_0x48711d[_0x1a0a('0x24')]=_[_0x1a0a('0x34')](_0x48711d['where'],{'$or':_[_0x1a0a('0x1d')](_0x48711d['attributes'],function(_0x243a40){var _0x405d56={};_0x405d56[_0x243a40]={'$like':'%'+_0x455f57['query'][_0x1a0a('0x44')]+'%'};return _0x405d56;})});}_0x48711d=_[_0x1a0a('0x34')]({},_0x48711d,_0x455f57[_0x1a0a('0x35')]);return db['UserFaxQueue'][_0x1a0a('0x26')](_0x48711d);}})[_0x1a0a('0x17')](function(_0x526502){if(_0x526502){return db['User'][_0x1a0a('0x45')]({'where':{'id':_[_0x1a0a('0x1d')](_0x526502,_0x1a0a('0x46')),'role':_0x1a0a('0x47')},'attributes':['id','name','faxPause','updatedAt',_0x1a0a('0x48')]});}})['then'](function(_0x10fd71){if(_0x10fd71){return{'count':_0x10fd71[_0x1a0a('0x11')],'rows':_[_0x1a0a('0x1d')](_0x10fd71[_0x1a0a('0x27')],function(_0x5f6b88){return{'membername':_0x5f6b88[_0x1a0a('0x1a')],'UserId':_0x5f6b88['id'],'queue_name':_0x599d6e[_0x1a0a('0x1a')],'FaxQueueId':_0x599d6e['id'],'interface':util[_0x1a0a('0x49')](_0x1a0a('0x4a'),_0x1a0a('0x4b'),_0x5f6b88[_0x1a0a('0x1a')]),'penalty':0x0,'paused':_0x5f6b88[_0x1a0a('0x4c')],'createdAt':_0x5f6b88[_0x1a0a('0x48')],'updatedAt':_0x5f6b88[_0x1a0a('0x4d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x1a0a('0x17')](respondWithFilteredResult(_0x190bf9,_0x48711d))['catch'](handleError(_0x190bf9,null));};exports[_0x1a0a('0x4e')]=function(_0x26cb74,_0x388653){var _0x12c628={};var _0x581fcf={};var _0x21ae34;var _0x235e0e;return db[_0x1a0a('0x1e')][_0x1a0a('0x3f')]({'where':{'id':_0x26cb74[_0x1a0a('0x2a')]['id']}})[_0x1a0a('0x17')](handleEntityNotFound(_0x388653,null))[_0x1a0a('0x17')](function(_0x52cd1a){if(_0x52cd1a){_0x21ae34=_0x52cd1a;_0x581fcf[_0x1a0a('0x2f')]=_[_0x1a0a('0x2b')](db[_0x1a0a('0x4f')]['rawAttributes']);_0x581fcf[_0x1a0a('0x2c')]=_['keys'](_0x26cb74[_0x1a0a('0x2c')]);_0x581fcf['filters']=_[_0x1a0a('0x2e')](_0x581fcf[_0x1a0a('0x2f')],_0x581fcf[_0x1a0a('0x2c')]);_0x12c628[_0x1a0a('0x30')]=_[_0x1a0a('0x2e')](_0x581fcf['model'],qs[_0x1a0a('0x31')](_0x26cb74[_0x1a0a('0x2c')][_0x1a0a('0x31')]));_0x12c628[_0x1a0a('0x30')]=_0x12c628[_0x1a0a('0x30')][_0x1a0a('0x32')]?_0x12c628[_0x1a0a('0x30')]:_0x581fcf['model'];_0x12c628[_0x1a0a('0x50')]=qs[_0x1a0a('0x43')](_0x26cb74[_0x1a0a('0x2c')]['sort']);_0x12c628['where']=qs[_0x1a0a('0x2d')](_[_0x1a0a('0x51')](_0x26cb74[_0x1a0a('0x2c')],_0x581fcf[_0x1a0a('0x2d')]));if(_0x26cb74[_0x1a0a('0x2c')]['filter']){_0x12c628[_0x1a0a('0x24')]=_[_0x1a0a('0x34')](_0x12c628[_0x1a0a('0x24')],{'$or':_['map'](_0x12c628[_0x1a0a('0x30')],function(_0x95759e){var _0x3ca482={};_0x3ca482[_0x95759e]={'$like':'%'+_0x26cb74[_0x1a0a('0x2c')][_0x1a0a('0x44')]+'%'};return _0x3ca482;})});}_0x12c628=_[_0x1a0a('0x34')]({},_0x12c628,_0x26cb74[_0x1a0a('0x35')]);return _0x21ae34['getTeams'](_0x12c628);}})[_0x1a0a('0x17')](function(_0x239262){if(_0x239262){_0x235e0e=_0x239262[_0x1a0a('0x32')];if(!_0x26cb74['query'][_0x1a0a('0x41')](_0x1a0a('0x42'))){_0x12c628[_0x1a0a('0x10')]=qs[_0x1a0a('0x10')](_0x26cb74[_0x1a0a('0x2c')][_0x1a0a('0x10')]);_0x12c628[_0x1a0a('0xe')]=qs['offset'](_0x26cb74[_0x1a0a('0x2c')][_0x1a0a('0xe')]);}return _0x21ae34[_0x1a0a('0x4e')](_0x12c628);}})[_0x1a0a('0x17')](function(_0x465309){if(_0x465309){return _0x465309?{'count':_0x235e0e,'rows':_0x465309}:null;}})[_0x1a0a('0x17')](respondWithResult(_0x388653,null))[_0x1a0a('0x28')](handleError(_0x388653,null));};exports[_0x1a0a('0x52')]=function(_0x90f5ab,_0x51a1a9){var _0xc4e6f6=_0x90f5ab[_0x1a0a('0x37')][_0x1a0a('0x53')];return db[_0x1a0a('0x4f')][_0x1a0a('0x26')]({'where':{'id':_0xc4e6f6},'attributes':['id'],'include':[{'model':db['User'],'as':_0x1a0a('0x54'),'attributes':['id',_0x1a0a('0x1a'),_0x1a0a('0x55'),_0x1a0a('0x56'),_0x1a0a('0x57')],'raw':!![]}]})[_0x1a0a('0x17')](function(_0x5bc782){if(_0x5bc782){var _0x51e1df=_['flatMap'](_0x5bc782,function(_0x149e3a){var _0xf8f874=_0x149e3a[_0x1a0a('0x15')]({'plain':!![]});return _0xf8f874['Agents'];});return db[_0x1a0a('0x1e')][_0x1a0a('0x36')]({'where':{'id':_0x90f5ab[_0x1a0a('0x2a')]['id']}})['then'](function(_0x138c4b){return db[_0x1a0a('0x58')]['transaction'](function(_0x279130){return _0x138c4b['addTeams'](_0xc4e6f6,{'transaction':_0x279130})['then'](function(){return BPromise[_0x1a0a('0x59')](_0x51e1df,function(_0x189c9f){return db[_0x1a0a('0x40')][_0x1a0a('0x5a')]({'where':{'UserId':_0x189c9f['id'],'FaxQueueId':_0x90f5ab[_0x1a0a('0x2a')]['id']},'transaction':_0x279130});});})[_0x1a0a('0x17')](function(){_0x51e1df[_0x1a0a('0x5b')](function(_0x2b35cf){socket['emit'](_0x1a0a('0x5c'),{'UserId':_0x2b35cf['id'],'FaxQueueId':_0x138c4b['id']});});});});});}})[_0x1a0a('0x17')](respondWithStatusCode(_0x51a1a9,null))[_0x1a0a('0x28')](handleError(_0x51a1a9,null));};exports['removeTeams']=function(_0x3a3c87,_0x4514d8){return db[_0x1a0a('0x4f')][_0x1a0a('0x26')]({'where':{'id':_0x3a3c87['query'][_0x1a0a('0x53')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x1a0a('0x54'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x4514d8,null))['then'](function(_0x17071b){var _0x1dee5d=_[_0x1a0a('0x1d')](_0x17071b,'id');var _0x5c6dcf=[];var _0x190000=[];var _0x20c6a9=squel[_0x1a0a('0x5d')]();_0x20c6a9[_0x1a0a('0x5e')]('tq.TeamId')[_0x1a0a('0x5f')](_0x1a0a('0x60'),'tq')[_0x1a0a('0x61')]('user_has_teams','ut',_0x1a0a('0x62'))[_0x1a0a('0x24')](_0x1a0a('0x63'),_0x3a3c87[_0x1a0a('0x2a')]['id']);for(var _0x2070d9=0x0;_0x2070d9<_0x17071b[_0x1a0a('0x32')];_0x2070d9+=0x1){let _0x31237a=_0x17071b[_0x2070d9];for(var _0x5b0d5f=0x0;_0x5b0d5f<_0x31237a[_0x1a0a('0x54')]['length'];_0x5b0d5f+=0x1){let _0x3a0525=_0x31237a[_0x1a0a('0x54')][_0x5b0d5f];var _0x5c21d2=_0x20c6a9['clone']();_0x5c21d2['where'](_0x1a0a('0x64'),_0x3a0525['id']);_0x190000['push'](db[_0x1a0a('0x58')][_0x1a0a('0x2c')](_0x5c21d2[_0x1a0a('0x65')](),{'type':db['sequelize']['QueryTypes'][_0x1a0a('0x66')]})[_0x1a0a('0x17')](function(_0x58aae1){if(_0x58aae1['length']===0x1){return _0x3a0525['id'];}else{var _0x32fbc5=_[_0x1a0a('0x67')](_[_0x1a0a('0x1d')](_0x58aae1,_0x1a0a('0x68')),function(_0x3ca218){return _[_0x1a0a('0x69')](_0x1dee5d,_0x3ca218);});if(_0x32fbc5){return _0x3a0525['id'];}}}));}}return BPromise['all'](_0x190000)[_0x1a0a('0x17')](function(_0xf2bdec){_0x5c6dcf=_(_0x5c6dcf)['union'](_0xf2bdec)[_0x1a0a('0x6a')]()['value']();return db[_0x1a0a('0x1e')]['find']({'where':{'id':_0x3a3c87['params']['id']}})['then'](function(_0x3767ef){return db['sequelize']['transaction'](function(_0x477bb6){return _0x3767ef[_0x1a0a('0x6b')](_0x3a3c87['query'][_0x1a0a('0x53')],{'transaction':_0x477bb6})[_0x1a0a('0x17')](function(){if(!_[_0x1a0a('0x6c')](_0x5c6dcf)){return _0x3767ef[_0x1a0a('0x6d')](_0x5c6dcf,{'transaction':_0x477bb6});}})['then'](function(){_0x5c6dcf[_0x1a0a('0x5b')](function(_0x552617){socket[_0x1a0a('0x6e')](_0x1a0a('0x6f'),{'UserId':_0x552617,'FaxQueueId':_0x3767ef['id']});});});});});});})[_0x1a0a('0x17')](respondWithStatusCode(_0x4514d8,null))['catch'](handleError(_0x4514d8,null));};exports['addAgents']=function(_0x18e50a,_0x208509){return db[_0x1a0a('0x1e')][_0x1a0a('0x36')]({'where':{'id':_0x18e50a[_0x1a0a('0x2a')]['id']}})[_0x1a0a('0x17')](handleEntityNotFound(_0x208509,null))[_0x1a0a('0x17')](function(_0x92a816){if(_0x92a816){return _0x92a816[_0x1a0a('0x70')](_0x18e50a[_0x1a0a('0x37')][_0x1a0a('0x53')],_[_0x1a0a('0x71')](_0x18e50a[_0x1a0a('0x37')],[_0x1a0a('0x53'),'id'])||{})[_0x1a0a('0x72')](function(_0xe28625){for(var _0x3b8bb7=0x0;_0x3b8bb7<_0x18e50a[_0x1a0a('0x37')][_0x1a0a('0x53')][_0x1a0a('0x32')];_0x3b8bb7+=0x1){socket[_0x1a0a('0x6e')](_0x1a0a('0x5c'),{'UserId':Number(_0x18e50a['body'][_0x1a0a('0x53')][_0x3b8bb7]),'FaxQueueId':Number(_0x18e50a['params']['id'])});}return _0xe28625;});}})[_0x1a0a('0x17')](respondWithResult(_0x208509,null))['catch'](handleError(_0x208509,null));};exports[_0x1a0a('0x6d')]=function(_0x36eb72,_0x4cdbf1){return db['FaxQueue'][_0x1a0a('0x36')]({'where':{'id':_0x36eb72[_0x1a0a('0x2a')]['id']}})[_0x1a0a('0x17')](handleEntityNotFound(_0x4cdbf1,null))['then'](function(_0x4a18dc){if(_0x4a18dc){return _0x4a18dc[_0x1a0a('0x6d')](_0x36eb72[_0x1a0a('0x2c')][_0x1a0a('0x53')])[_0x1a0a('0x17')](function(){if(_['isArray'](_0x36eb72[_0x1a0a('0x2c')][_0x1a0a('0x53')])){for(var _0x12e46f=0x0;_0x12e46f<_0x36eb72[_0x1a0a('0x2c')][_0x1a0a('0x53')][_0x1a0a('0x32')];_0x12e46f+=0x1){socket[_0x1a0a('0x6e')](_0x1a0a('0x6f'),{'UserId':Number(_0x36eb72[_0x1a0a('0x2c')][_0x1a0a('0x53')][_0x12e46f]),'FaxQueueId':Number(_0x36eb72[_0x1a0a('0x2a')]['id'])});}}else{socket[_0x1a0a('0x6e')](_0x1a0a('0x6f'),{'UserId':Number(_0x36eb72[_0x1a0a('0x2c')][_0x1a0a('0x53')]),'FaxQueueId':Number(_0x36eb72[_0x1a0a('0x2a')]['id'])});}});}})['then'](respondWithStatusCode(_0x4cdbf1,null))['catch'](handleError(_0x4cdbf1,null));};exports[_0x1a0a('0x73')]=function(_0x1b76fe,_0x5dbe62){var _0x1ac840={};var _0x1da6d3={};var _0x14785e;var _0x202c58;return db[_0x1a0a('0x1e')]['findOne']({'where':{'id':_0x1b76fe[_0x1a0a('0x2a')]['id']}})[_0x1a0a('0x17')](handleEntityNotFound(_0x5dbe62,null))[_0x1a0a('0x17')](function(_0x8ac572){if(_0x8ac572){_0x14785e=_0x8ac572;_0x1da6d3[_0x1a0a('0x2f')]=_['keys'](db['User'][_0x1a0a('0x1f')]);_0x1da6d3[_0x1a0a('0x2c')]=_[_0x1a0a('0x2b')](_0x1b76fe['query']);_0x1da6d3['filters']=_[_0x1a0a('0x2e')](_0x1da6d3[_0x1a0a('0x2f')],_0x1da6d3[_0x1a0a('0x2c')]);_0x1ac840[_0x1a0a('0x30')]=_[_0x1a0a('0x2e')](_0x1da6d3[_0x1a0a('0x2f')],qs[_0x1a0a('0x31')](_0x1b76fe[_0x1a0a('0x2c')][_0x1a0a('0x31')]));_0x1ac840[_0x1a0a('0x30')]=_0x1ac840[_0x1a0a('0x30')]['length']?_0x1ac840['attributes']:_0x1da6d3['model'];_0x1ac840[_0x1a0a('0x50')]=qs[_0x1a0a('0x43')](_0x1b76fe[_0x1a0a('0x2c')][_0x1a0a('0x43')]);_0x1ac840[_0x1a0a('0x24')]=qs['filters'](_[_0x1a0a('0x51')](_0x1b76fe[_0x1a0a('0x2c')],_0x1da6d3['filters']));if(_0x1b76fe[_0x1a0a('0x2c')][_0x1a0a('0x44')]){_0x1ac840[_0x1a0a('0x24')]=_[_0x1a0a('0x34')](_0x1ac840[_0x1a0a('0x24')],{'$or':_[_0x1a0a('0x1d')](_0x1ac840[_0x1a0a('0x30')],function(_0x5d777a){var _0x543d97={};_0x543d97[_0x5d777a]={'$like':'%'+_0x1b76fe[_0x1a0a('0x2c')][_0x1a0a('0x44')]+'%'};return _0x543d97;})});}_0x1ac840=_['merge']({},_0x1ac840,_0x1b76fe[_0x1a0a('0x35')]);return _0x14785e[_0x1a0a('0x73')](_0x1ac840);}})[_0x1a0a('0x17')](function(_0xf0a069){if(_0xf0a069){_0x202c58=_0xf0a069[_0x1a0a('0x32')];if(!_0x1b76fe[_0x1a0a('0x2c')]['hasOwnProperty'](_0x1a0a('0x42'))){_0x1ac840[_0x1a0a('0x10')]=qs['limit'](_0x1b76fe[_0x1a0a('0x2c')][_0x1a0a('0x10')]);_0x1ac840[_0x1a0a('0xe')]=qs[_0x1a0a('0xe')](_0x1b76fe[_0x1a0a('0x2c')][_0x1a0a('0xe')]);}return _0x14785e[_0x1a0a('0x73')](_0x1ac840);}})[_0x1a0a('0x17')](function(_0x23ee2d){if(_0x23ee2d){return _0x23ee2d?{'count':_0x202c58,'rows':_0x23ee2d}:null;}})[_0x1a0a('0x17')](respondWithResult(_0x5dbe62,null))[_0x1a0a('0x28')](handleError(_0x5dbe62,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index e67818f..1f6618f 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 _0x2449=['FaxQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x59ad2b,_0x54f03d){var _0x594249=function(_0x4eb0ab){while(--_0x4eb0ab){_0x59ad2b['push'](_0x59ad2b['shift']());}};_0x594249(++_0x54f03d);}(_0x2449,0x1a3));var _0x9244=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2449[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var FaxQueue=require(_0x9244('0x0'))['db'][_0x9244('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x9244('0x2')](0x0);var events={'afterCreate':_0x9244('0x3'),'afterUpdate':_0x9244('0x4'),'afterDestroy':_0x9244('0x5')};function emitEvent(_0x12c54d){return function(_0x16f46e,_0x4e7e7b,_0x32ffff){FaxQueueEvents['emit'](_0x12c54d+':'+_0x16f46e['id'],_0x16f46e);FaxQueueEvents[_0x9244('0x6')](_0x12c54d,_0x16f46e);_0x32ffff(null);};}for(var e in events){if(events[_0x9244('0x7')](e)){var event=events[e];FaxQueue[_0x9244('0x8')](e,emitEvent(event));}}module[_0x9244('0x9')]=FaxQueueEvents; \ No newline at end of file +var _0xd705=['hook','exports','events','../../mysqldb','FaxQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x4151e5,_0x2b12c3){var _0x18f4ab=function(_0x3c3dc1){while(--_0x3c3dc1){_0x4151e5['push'](_0x4151e5['shift']());}};_0x18f4ab(++_0x2b12c3);}(_0xd705,0xf4));var _0x5d70=function(_0x51b3cf,_0x1929ca){_0x51b3cf=_0x51b3cf-0x0;var _0x5217ed=_0xd705[_0x51b3cf];return _0x5217ed;};'use strict';var EventEmitter=require(_0x5d70('0x0'));var FaxQueue=require(_0x5d70('0x1'))['db'][_0x5d70('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x5d70('0x3')](0x0);var events={'afterCreate':_0x5d70('0x4'),'afterUpdate':_0x5d70('0x5'),'afterDestroy':_0x5d70('0x6')};function emitEvent(_0x4434b3){return function(_0x1e1938,_0x530147,_0x1fa66f){FaxQueueEvents[_0x5d70('0x7')](_0x4434b3+':'+_0x1e1938['id'],_0x1e1938);FaxQueueEvents[_0x5d70('0x7')](_0x4434b3,_0x1e1938);_0x1fa66f(null);};}for(var e in events){if(events[_0x5d70('0x8')](e)){var event=events[e];FaxQueue[_0x5d70('0x9')](e,emitEvent(event));}}module[_0x5d70('0xa')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index 176c200..2daec9c 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 _0x92f0=['rimraf','../../config/environment','exports','define','FaxQueue','fax_queues','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x2b0a08,_0x351fca){var _0x51aac5=function(_0x2ccd0b){while(--_0x2ccd0b){_0x2b0a08['push'](_0x2b0a08['shift']());}};_0x51aac5(++_0x351fca);}(_0x92f0,0x88));var _0x092f=function(_0x567fff,_0xd8acd8){_0x567fff=_0x567fff-0x0;var _0x465a37=_0x92f0[_0x567fff];return _0x465a37;};'use strict';var _=require(_0x092f('0x0'));var util=require('util');var logger=require(_0x092f('0x1'))(_0x092f('0x2'));var moment=require(_0x092f('0x3'));var BPromise=require(_0x092f('0x4'));var rp=require(_0x092f('0x5'));var fs=require('fs');var path=require(_0x092f('0x6'));var rimraf=require(_0x092f('0x7'));var config=require(_0x092f('0x8'));var attributes=require('./faxQueue.attributes');module[_0x092f('0x9')]=function(_0x2e1372,_0x3dc282){return _0x2e1372[_0x092f('0xa')](_0x092f('0xb'),attributes,{'tableName':_0x092f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf0f0=['exports','FaxQueue','fax_queues','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueue.attributes'];(function(_0x4f1369,_0x4c595c){var _0xcd26a4=function(_0x1a8515){while(--_0x1a8515){_0x4f1369['push'](_0x4f1369['shift']());}};_0xcd26a4(++_0x4c595c);}(_0xf0f0,0x13b));var _0x0f0f=function(_0x479e24,_0x463bc3){_0x479e24=_0x479e24-0x0;var _0x1ad525=_0xf0f0[_0x479e24];return _0x1ad525;};'use strict';var _=require(_0x0f0f('0x0'));var util=require(_0x0f0f('0x1'));var logger=require('../../config/logger')(_0x0f0f('0x2'));var moment=require(_0x0f0f('0x3'));var BPromise=require(_0x0f0f('0x4'));var rp=require(_0x0f0f('0x5'));var fs=require('fs');var path=require(_0x0f0f('0x6'));var rimraf=require(_0x0f0f('0x7'));var config=require(_0x0f0f('0x8'));var attributes=require(_0x0f0f('0x9'));module[_0x0f0f('0xa')]=function(_0x22cff4,_0x50fc2f){return _0x22cff4['define'](_0x0f0f('0xb'),attributes,{'tableName':_0x0f0f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.rpc.js b/server/api/faxQueue/faxQueue.rpc.js index 9331c45..e1071fe 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 _0x40b1=['result','catch','GetFaxQueue','FaxQueue','findAll','raw','options','where','attributes','limit','map','include','model','ShowFaxQueue','find','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','client','http','redis','defaults','localhost','./faxQueue.socket','register','request','then','info','debug','FaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','FaxQueue,\x20%s,\x20%s','message'];(function(_0x819ce,_0xf25f51){var _0x1edcf0=function(_0x192389){while(--_0x192389){_0x819ce['push'](_0x819ce['shift']());}};_0x1edcf0(++_0xf25f51);}(_0x40b1,0xd7));var _0x140b=function(_0x3fae68,_0x4352c9){_0x3fae68=_0x3fae68-0x0;var _0x1fe42c=_0x40b1[_0x3fae68];return _0x1fe42c;};'use strict';var _=require(_0x140b('0x0'));var util=require(_0x140b('0x1'));var moment=require('moment');var BPromise=require(_0x140b('0x2'));var rs=require(_0x140b('0x3'));var fs=require('fs');var Redis=require(_0x140b('0x4'));var db=require(_0x140b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x140b('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x140b('0x7')][_0x140b('0x8')]({'port':0x232a});config[_0x140b('0x9')]=_[_0x140b('0xa')](config[_0x140b('0x9')],{'host':_0x140b('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x140b('0x9')]));require(_0x140b('0xc'))[_0x140b('0xd')](socket);function respondWithRpcPromise(_0x80c0a6,_0x1f30ca,_0x26c730){return new BPromise(function(_0x116e9d,_0x1b1a98){return client[_0x140b('0xe')](_0x80c0a6,_0x26c730)[_0x140b('0xf')](function(_0x3fe1cf){logger[_0x140b('0x10')]('FaxQueue,\x20%s,\x20%s',_0x1f30ca,'request\x20sent');logger[_0x140b('0x11')](_0x140b('0x12'),_0x1f30ca,_0x140b('0x13'),JSON[_0x140b('0x14')](_0x3fe1cf));if(_0x3fe1cf[_0x140b('0x15')]){if(_0x3fe1cf[_0x140b('0x15')][_0x140b('0x16')]===0x1f4){logger[_0x140b('0x15')](_0x140b('0x17'),_0x1f30ca,_0x3fe1cf['error']['message']);return _0x1b1a98(_0x3fe1cf['error']['message']);}logger[_0x140b('0x15')](_0x140b('0x17'),_0x1f30ca,_0x3fe1cf[_0x140b('0x15')][_0x140b('0x18')]);return _0x116e9d(_0x3fe1cf['error'][_0x140b('0x18')]);}else{logger[_0x140b('0x10')](_0x140b('0x17'),_0x1f30ca,'request\x20sent');_0x116e9d(_0x3fe1cf[_0x140b('0x19')][_0x140b('0x18')]);}})[_0x140b('0x1a')](function(_0x171f17){logger[_0x140b('0x15')]('FaxQueue,\x20%s,\x20%s',_0x1f30ca,_0x171f17);_0x1b1a98(_0x171f17);});});}exports[_0x140b('0x1b')]=function(_0x39260d){var _0x4924e4=this;return new Promise(function(_0x43814e,_0x37631e){return db[_0x140b('0x1c')][_0x140b('0x1d')]({'raw':_0x39260d['options']?_0x39260d['options'][_0x140b('0x1e')]===undefined?!![]:![]:!![],'where':_0x39260d[_0x140b('0x1f')]?_0x39260d[_0x140b('0x1f')][_0x140b('0x20')]||null:null,'attributes':_0x39260d[_0x140b('0x1f')]?_0x39260d['options'][_0x140b('0x21')]||null:null,'limit':_0x39260d[_0x140b('0x1f')]?_0x39260d['options'][_0x140b('0x22')]||null:null,'include':_0x39260d[_0x140b('0x1f')]?_0x39260d[_0x140b('0x1f')]['include']?_[_0x140b('0x23')](_0x39260d[_0x140b('0x1f')]['include'],function(_0x2083f2){return{'model':db[_0x2083f2['model']],'as':_0x2083f2['as'],'attributes':_0x2083f2['attributes'],'include':_0x2083f2[_0x140b('0x24')]?_[_0x140b('0x23')](_0x2083f2[_0x140b('0x24')],function(_0x2629c4){return{'model':db[_0x2629c4[_0x140b('0x25')]],'as':_0x2629c4['as'],'attributes':_0x2629c4[_0x140b('0x21')],'include':_0x2629c4['include']?_['map'](_0x2629c4['include'],function(_0x51b47a){return{'model':db[_0x51b47a['model']],'as':_0x51b47a['as'],'attributes':_0x51b47a[_0x140b('0x21')]};}):[]};}):[]};}):[]:[]})[_0x140b('0xf')](function(_0x15b7a7){logger['info']('GetFaxQueue',_0x39260d);logger['debug'](_0x140b('0x1b'),_0x39260d,JSON[_0x140b('0x14')](_0x15b7a7));_0x43814e(_0x15b7a7);})[_0x140b('0x1a')](function(_0x476be7){logger['error'](_0x140b('0x1b'),_0x476be7[_0x140b('0x18')],_0x39260d);_0x37631e(_0x4924e4[_0x140b('0x15')](0x1f4,_0x476be7[_0x140b('0x18')]));});});};exports[_0x140b('0x26')]=function(_0x2b79fd){var _0x5ed8aa=this;return new Promise(function(_0x2bb6ec,_0xfc5725){return db[_0x140b('0x1c')][_0x140b('0x27')]({'raw':_0x2b79fd[_0x140b('0x1f')]?_0x2b79fd[_0x140b('0x1f')][_0x140b('0x1e')]===undefined?!![]:![]:!![],'where':_0x2b79fd['options']?_0x2b79fd[_0x140b('0x1f')][_0x140b('0x20')]||null:null,'attributes':_0x2b79fd[_0x140b('0x1f')]?_0x2b79fd[_0x140b('0x1f')]['attributes']||null:null,'include':_0x2b79fd[_0x140b('0x1f')]?_0x2b79fd[_0x140b('0x1f')]['include']?_[_0x140b('0x23')](_0x2b79fd['options'][_0x140b('0x24')],function(_0x11c459){return{'model':db[_0x11c459[_0x140b('0x25')]],'as':_0x11c459['as'],'attributes':_0x11c459[_0x140b('0x21')],'include':_0x11c459[_0x140b('0x24')]?_[_0x140b('0x23')](_0x11c459['include'],function(_0xd7dd05){return{'model':db[_0xd7dd05[_0x140b('0x25')]],'as':_0xd7dd05['as'],'attributes':_0xd7dd05['attributes'],'include':_0xd7dd05[_0x140b('0x24')]?_['map'](_0xd7dd05[_0x140b('0x24')],function(_0x591eda){return{'model':db[_0x591eda[_0x140b('0x25')]],'as':_0x591eda['as'],'attributes':_0x591eda[_0x140b('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x272fdc){logger[_0x140b('0x10')](_0x140b('0x26'),_0x2b79fd);logger[_0x140b('0x11')](_0x140b('0x26'),_0x2b79fd,JSON['stringify'](_0x272fdc));_0x2bb6ec(_0x272fdc);})[_0x140b('0x1a')](function(_0x40ea46){logger[_0x140b('0x15')](_0x140b('0x26'),_0x40ea46['message'],_0x2b79fd);_0xfc5725(_0x5ed8aa[_0x140b('0x15')](0x1f4,_0x40ea46[_0x140b('0x18')]));});});}; \ No newline at end of file +var _0xd00b=['../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./faxQueue.socket','register','request','then','info','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxQueue,\x20%s,\x20%s','message','result','catch','GetFaxQueue','FaxQueue','findAll','options','raw','where','attributes','include','map','model','ShowFaxQueue','find','lodash','util','../../mysqldb','../../config/utils'];(function(_0x15f471,_0x264503){var _0x152728=function(_0x3d0303){while(--_0x3d0303){_0x15f471['push'](_0x15f471['shift']());}};_0x152728(++_0x264503);}(_0xd00b,0x1b4));var _0xbd00=function(_0x4aa17d,_0x4ae1c3){_0x4aa17d=_0x4aa17d-0x0;var _0x22fce0=_0xd00b[_0x4aa17d];return _0x22fce0;};'use strict';var _=require(_0xbd00('0x0'));var util=require(_0xbd00('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbd00('0x2'))['db'];var utils=require(_0xbd00('0x3'));var logger=require(_0xbd00('0x4'))('rpc');var config=require(_0xbd00('0x5'));var jayson=require(_0xbd00('0x6'));var client=jayson[_0xbd00('0x7')][_0xbd00('0x8')]({'port':0x232a});config['redis']=_[_0xbd00('0x9')](config[_0xbd00('0xa')],{'host':_0xbd00('0xb'),'port':0x18eb});var socket=require(_0xbd00('0xc'))(new Redis(config[_0xbd00('0xa')]));require(_0xbd00('0xd'))[_0xbd00('0xe')](socket);function respondWithRpcPromise(_0x2bf360,_0x1403f1,_0x235056){return new BPromise(function(_0x277a11,_0x25d278){return client[_0xbd00('0xf')](_0x2bf360,_0x235056)[_0xbd00('0x10')](function(_0x4e93c7){logger[_0xbd00('0x11')]('FaxQueue,\x20%s,\x20%s',_0x1403f1,_0xbd00('0x12'));logger[_0xbd00('0x13')](_0xbd00('0x14'),_0x1403f1,'request\x20sent',JSON[_0xbd00('0x15')](_0x4e93c7));if(_0x4e93c7['error']){if(_0x4e93c7[_0xbd00('0x16')][_0xbd00('0x17')]===0x1f4){logger[_0xbd00('0x16')](_0xbd00('0x18'),_0x1403f1,_0x4e93c7[_0xbd00('0x16')]['message']);return _0x25d278(_0x4e93c7['error'][_0xbd00('0x19')]);}logger[_0xbd00('0x16')](_0xbd00('0x18'),_0x1403f1,_0x4e93c7[_0xbd00('0x16')][_0xbd00('0x19')]);return _0x277a11(_0x4e93c7[_0xbd00('0x16')]['message']);}else{logger[_0xbd00('0x11')](_0xbd00('0x18'),_0x1403f1,_0xbd00('0x12'));_0x277a11(_0x4e93c7[_0xbd00('0x1a')]['message']);}})[_0xbd00('0x1b')](function(_0xfcf7e5){logger['error'](_0xbd00('0x18'),_0x1403f1,_0xfcf7e5);_0x25d278(_0xfcf7e5);});});}exports[_0xbd00('0x1c')]=function(_0x4cba38){var _0x2c65e7=this;return new Promise(function(_0x59cf9e,_0x2f61c8){return db[_0xbd00('0x1d')][_0xbd00('0x1e')]({'raw':_0x4cba38[_0xbd00('0x1f')]?_0x4cba38['options'][_0xbd00('0x20')]===undefined?!![]:![]:!![],'where':_0x4cba38['options']?_0x4cba38['options'][_0xbd00('0x21')]||null:null,'attributes':_0x4cba38[_0xbd00('0x1f')]?_0x4cba38[_0xbd00('0x1f')][_0xbd00('0x22')]||null:null,'limit':_0x4cba38[_0xbd00('0x1f')]?_0x4cba38[_0xbd00('0x1f')]['limit']||null:null,'include':_0x4cba38['options']?_0x4cba38[_0xbd00('0x1f')][_0xbd00('0x23')]?_[_0xbd00('0x24')](_0x4cba38[_0xbd00('0x1f')][_0xbd00('0x23')],function(_0x47c8e2){return{'model':db[_0x47c8e2[_0xbd00('0x25')]],'as':_0x47c8e2['as'],'attributes':_0x47c8e2[_0xbd00('0x22')],'include':_0x47c8e2[_0xbd00('0x23')]?_[_0xbd00('0x24')](_0x47c8e2['include'],function(_0x29a113){return{'model':db[_0x29a113['model']],'as':_0x29a113['as'],'attributes':_0x29a113[_0xbd00('0x22')],'include':_0x29a113[_0xbd00('0x23')]?_['map'](_0x29a113['include'],function(_0x2de5b4){return{'model':db[_0x2de5b4[_0xbd00('0x25')]],'as':_0x2de5b4['as'],'attributes':_0x2de5b4[_0xbd00('0x22')]};}):[]};}):[]};}):[]:[]})[_0xbd00('0x10')](function(_0x5d04db){logger['info'](_0xbd00('0x1c'),_0x4cba38);logger[_0xbd00('0x13')]('GetFaxQueue',_0x4cba38,JSON['stringify'](_0x5d04db));_0x59cf9e(_0x5d04db);})['catch'](function(_0xe199f7){logger['error'](_0xbd00('0x1c'),_0xe199f7['message'],_0x4cba38);_0x2f61c8(_0x2c65e7[_0xbd00('0x16')](0x1f4,_0xe199f7[_0xbd00('0x19')]));});});};exports[_0xbd00('0x26')]=function(_0x1571fe){var _0x401423=this;return new Promise(function(_0x279fb4,_0x19585a){return db[_0xbd00('0x1d')][_0xbd00('0x27')]({'raw':_0x1571fe[_0xbd00('0x1f')]?_0x1571fe[_0xbd00('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x1571fe['options']?_0x1571fe['options'][_0xbd00('0x21')]||null:null,'attributes':_0x1571fe[_0xbd00('0x1f')]?_0x1571fe[_0xbd00('0x1f')][_0xbd00('0x22')]||null:null,'include':_0x1571fe[_0xbd00('0x1f')]?_0x1571fe[_0xbd00('0x1f')][_0xbd00('0x23')]?_['map'](_0x1571fe[_0xbd00('0x1f')][_0xbd00('0x23')],function(_0x516f2f){return{'model':db[_0x516f2f['model']],'as':_0x516f2f['as'],'attributes':_0x516f2f[_0xbd00('0x22')],'include':_0x516f2f['include']?_[_0xbd00('0x24')](_0x516f2f[_0xbd00('0x23')],function(_0x3e5170){return{'model':db[_0x3e5170['model']],'as':_0x3e5170['as'],'attributes':_0x3e5170['attributes'],'include':_0x3e5170['include']?_['map'](_0x3e5170[_0xbd00('0x23')],function(_0x35d4e4){return{'model':db[_0x35d4e4[_0xbd00('0x25')]],'as':_0x35d4e4['as'],'attributes':_0x35d4e4[_0xbd00('0x22')]};}):[]};}):[]};}):[]:[]})[_0xbd00('0x10')](function(_0x358ba3){logger['info'](_0xbd00('0x26'),_0x1571fe);logger[_0xbd00('0x13')]('ShowFaxQueue',_0x1571fe,JSON['stringify'](_0x358ba3));_0x279fb4(_0x358ba3);})[_0xbd00('0x1b')](function(_0x44b22f){logger[_0xbd00('0x16')](_0xbd00('0x26'),_0x44b22f[_0xbd00('0x19')],_0x1571fe);_0x19585a(_0x401423[_0xbd00('0x16')](0x1f4,_0x44b22f['message']));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index cd6db5b..67b1c28 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 _0x757a=['length','faxQueue:','./faxQueue.events','save','remove','update','emit','removeListener','register'];(function(_0x2f0b82,_0xa07e26){var _0x5d6fb1=function(_0x178f3f){while(--_0x178f3f){_0x2f0b82['push'](_0x2f0b82['shift']());}};_0x5d6fb1(++_0xa07e26);}(_0x757a,0x110));var _0xa757=function(_0x27bb26,_0x3f9c1b){_0x27bb26=_0x27bb26-0x0;var _0x4f5fab=_0x757a[_0x27bb26];return _0x4f5fab;};'use strict';var FaxQueueEvents=require(_0xa757('0x0'));var events=[_0xa757('0x1'),_0xa757('0x2'),_0xa757('0x3')];function createListener(_0x3f4764,_0x546cc7){return function(_0x46311c){_0x546cc7[_0xa757('0x4')](_0x3f4764,_0x46311c);};}function removeListener(_0x2d3b1a,_0x4d2311){return function(){FaxQueueEvents[_0xa757('0x5')](_0x2d3b1a,_0x4d2311);};}exports[_0xa757('0x6')]=function(_0xae4c8f){for(var _0x362a9c=0x0,_0x278afc=events[_0xa757('0x7')];_0x362a9c<_0x278afc;_0x362a9c++){var _0x4b367d=events[_0x362a9c];var _0x44546e=createListener(_0xa757('0x8')+_0x4b367d,_0xae4c8f);FaxQueueEvents['on'](_0x4b367d,_0x44546e);}}; \ No newline at end of file +var _0x873a=['length','faxQueue:','./faxQueue.events','save','remove','emit','removeListener','register'];(function(_0x33bcc2,_0x644e4){var _0x400614=function(_0x2e1497){while(--_0x2e1497){_0x33bcc2['push'](_0x33bcc2['shift']());}};_0x400614(++_0x644e4);}(_0x873a,0x1c2));var _0xa873=function(_0x2634c4,_0x19a43c){_0x2634c4=_0x2634c4-0x0;var _0xaa1212=_0x873a[_0x2634c4];return _0xaa1212;};'use strict';var FaxQueueEvents=require(_0xa873('0x0'));var events=[_0xa873('0x1'),_0xa873('0x2'),'update'];function createListener(_0x1de6be,_0x5733ee){return function(_0x52c086){_0x5733ee[_0xa873('0x3')](_0x1de6be,_0x52c086);};}function removeListener(_0x46971d,_0x5a0d23){return function(){FaxQueueEvents[_0xa873('0x4')](_0x46971d,_0x5a0d23);};}exports[_0xa873('0x5')]=function(_0x5c0d74){for(var _0x370b8a=0x0,_0x56f262=events[_0xa873('0x6')];_0x370b8a<_0x56f262;_0x370b8a++){var _0x43247f=events[_0x370b8a];var _0x265c05=createListener(_0xa873('0x7')+_0x43247f,_0x5c0d74);FaxQueueEvents['on'](_0x43247f,_0x265c05);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index e91142c..96705e9 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 _0xe785=['/:id','show','/:id/members','/:id/teams','getTeams','/:id/users','post','create','addTeams','addAgents','put','update','destroy','delete','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../config/environment','./faxQueue.controller','get','isAuthenticated','/describe','describe'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xe785,0x128));var _0x5e78=function(_0x21b163,_0x4876ea){_0x21b163=_0x21b163-0x0;var _0x546e2f=_0xe785[_0x21b163];return _0x546e2f;};'use strict';var multer=require(_0x5e78('0x0'));var util=require(_0x5e78('0x1'));var path=require('path');var timeout=require(_0x5e78('0x2'));var express=require(_0x5e78('0x3'));var router=express[_0x5e78('0x4')]();var fs_extra=require(_0x5e78('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5e78('0x6'));var controller=require(_0x5e78('0x7'));router[_0x5e78('0x8')]('/',auth[_0x5e78('0x9')](),controller['index']);router['get'](_0x5e78('0xa'),auth[_0x5e78('0x9')](),controller[_0x5e78('0xb')]);router['get'](_0x5e78('0xc'),auth['isAuthenticated'](),controller[_0x5e78('0xd')]);router['get'](_0x5e78('0xe'),auth[_0x5e78('0x9')](),controller['getMembers']);router[_0x5e78('0x8')](_0x5e78('0xf'),auth[_0x5e78('0x9')](),controller[_0x5e78('0x10')]);router[_0x5e78('0x8')](_0x5e78('0x11'),auth[_0x5e78('0x9')](),controller['getAgents']);router[_0x5e78('0x12')]('/',auth[_0x5e78('0x9')](),controller[_0x5e78('0x13')]);router['post'](_0x5e78('0xf'),auth[_0x5e78('0x9')](),controller[_0x5e78('0x14')]);router[_0x5e78('0x12')]('/:id/users',auth[_0x5e78('0x9')](),controller[_0x5e78('0x15')]);router[_0x5e78('0x16')](_0x5e78('0xc'),auth[_0x5e78('0x9')](),controller[_0x5e78('0x17')]);router['delete']('/:id',auth[_0x5e78('0x9')](),controller[_0x5e78('0x18')]);router[_0x5e78('0x19')]('/:id/teams',auth['isAuthenticated'](),controller['removeTeams']);router['delete'](_0x5e78('0x11'),auth[_0x5e78('0x9')](),controller[_0x5e78('0x1a')]);module[_0x5e78('0x1b')]=router; \ No newline at end of file +var _0x7046=['../../components/auth/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','index','/describe','show','/:id/members','getMembers','/:id/teams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','/:id','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0x3fb8d4,_0x50915d){var _0xa05e7c=function(_0x5d8557){while(--_0x5d8557){_0x3fb8d4['push'](_0x3fb8d4['shift']());}};_0xa05e7c(++_0x50915d);}(_0x7046,0x144));var _0x6704=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x7046[_0x4e676e];return _0x336a3c;};'use strict';var multer=require(_0x6704('0x0'));var util=require(_0x6704('0x1'));var path=require(_0x6704('0x2'));var timeout=require(_0x6704('0x3'));var express=require('express');var router=express[_0x6704('0x4')]();var fs_extra=require(_0x6704('0x5'));var auth=require(_0x6704('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x6704('0x7'));var controller=require(_0x6704('0x8'));router[_0x6704('0x9')]('/',auth[_0x6704('0xa')](),controller[_0x6704('0xb')]);router['get'](_0x6704('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x6704('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x6704('0xd')]);router[_0x6704('0x9')](_0x6704('0xe'),auth[_0x6704('0xa')](),controller[_0x6704('0xf')]);router[_0x6704('0x9')](_0x6704('0x10'),auth[_0x6704('0xa')](),controller['getTeams']);router[_0x6704('0x9')](_0x6704('0x11'),auth['isAuthenticated'](),controller[_0x6704('0x12')]);router[_0x6704('0x13')]('/',auth[_0x6704('0xa')](),controller[_0x6704('0x14')]);router[_0x6704('0x13')](_0x6704('0x10'),auth[_0x6704('0xa')](),controller[_0x6704('0x15')]);router[_0x6704('0x13')]('/:id/users',auth[_0x6704('0xa')](),controller[_0x6704('0x16')]);router[_0x6704('0x17')]('/:id',auth[_0x6704('0xa')](),controller[_0x6704('0x18')]);router[_0x6704('0x19')](_0x6704('0x1a'),auth[_0x6704('0xa')](),controller['destroy']);router[_0x6704('0x19')](_0x6704('0x10'),auth[_0x6704('0xa')](),controller[_0x6704('0x1b')]);router[_0x6704('0x19')]('/:id/users',auth[_0x6704('0xa')](),controller[_0x6704('0x1c')]);module[_0x6704('0x1d')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index 8aa2f1b..011e840 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 _0x3c0c=['sequelize','exports','STRING','DATE','moment'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x3c0c,0x162));var _0xc3c0=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x3c0c[_0x2f5ac5];return _0x37c9a8;};'use strict';var moment=require(_0xc3c0('0x0'));var Sequelize=require(_0xc3c0('0x1'));module[_0xc3c0('0x2')]={'uniqueid':{'type':Sequelize[_0xc3c0('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xc3c0('0x3')]},'joinAt':{'type':Sequelize[_0xc3c0('0x4')]},'leaveAt':{'type':Sequelize[_0xc3c0('0x4')]},'acceptAt':{'type':Sequelize[_0xc3c0('0x4')]},'exitAt':{'type':Sequelize[_0xc3c0('0x4')]},'reason':{'type':Sequelize[_0xc3c0('0x3')]}}; \ No newline at end of file +var _0xef39=['STRING','DATE','sequelize','exports'];(function(_0x583e53,_0x5a2e76){var _0x4ca938=function(_0x42ecfe){while(--_0x42ecfe){_0x583e53['push'](_0x583e53['shift']());}};_0x4ca938(++_0x5a2e76);}(_0xef39,0x92));var _0x9ef3=function(_0x46ace3,_0x14f9a9){_0x46ace3=_0x46ace3-0x0;var _0x41e033=_0xef39[_0x46ace3];return _0x41e033;};'use strict';var moment=require('moment');var Sequelize=require(_0x9ef3('0x0'));module[_0x9ef3('0x1')]={'uniqueid':{'type':Sequelize[_0x9ef3('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x9ef3('0x2')]},'joinAt':{'type':Sequelize[_0x9ef3('0x3')]},'leaveAt':{'type':Sequelize[_0x9ef3('0x3')]},'acceptAt':{'type':Sequelize[_0x9ef3('0x3')]},'exitAt':{'type':Sequelize[_0x9ef3('0x3')]},'reason':{'type':Sequelize[_0x9ef3('0x2')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 1e4c4e2..c21f637 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 _0xa588=['jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','FaxQueueReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','filter','merge','options','includeAll','include','findAll','rows','show','params','catch','create','body','find','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0x1a11bc,_0x4358ec){var _0x2de5f7=function(_0x4ea866){while(--_0x4ea866){_0x1a11bc['push'](_0x1a11bc['shift']());}};_0x2de5f7(++_0x4358ec);}(_0xa588,0xe1));var _0x8a58=function(_0x2f1908,_0x5d837d){_0x2f1908=_0x2f1908-0x0;var _0x357795=_0xa588[_0x2f1908];return _0x357795;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8a58('0x0'));var zipdir=require(_0x8a58('0x1'));var jsonpatch=require(_0x8a58('0x2'));var rp=require(_0x8a58('0x3'));var moment=require(_0x8a58('0x4'));var BPromise=require(_0x8a58('0x5'));var Mustache=require(_0x8a58('0x6'));var util=require(_0x8a58('0x7'));var path=require(_0x8a58('0x8'));var sox=require('sox');var csv=require(_0x8a58('0x9'));var ejs=require(_0x8a58('0xa'));var fs=require('fs');var fs_extra=require(_0x8a58('0xb'));var _=require(_0x8a58('0xc'));var squel=require(_0x8a58('0xd'));var crypto=require(_0x8a58('0xe'));var jsforce=require(_0x8a58('0xf'));var deskjs=require(_0x8a58('0x10'));var toCsv=require('to-csv');var querystring=require(_0x8a58('0x11'));var Papa=require(_0x8a58('0x12'));var Redis=require(_0x8a58('0x13'));var authService=require(_0x8a58('0x14'));var qs=require(_0x8a58('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8a58('0x16'));var logger=require(_0x8a58('0x17'))(_0x8a58('0x18'));var utils=require(_0x8a58('0x19'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x8a58('0x1a'))['db'];function respondWithStatusCode(_0x5ec103,_0x21208d){_0x21208d=_0x21208d||0xcc;return function(_0xc5d2fa){if(_0xc5d2fa){return _0x5ec103['sendStatus'](_0x21208d);}return _0x5ec103[_0x8a58('0x1b')](_0x21208d)[_0x8a58('0x1c')]();};}function respondWithResult(_0x56a61d,_0x3d40a5){_0x3d40a5=_0x3d40a5||0xc8;return function(_0x268506){if(_0x268506){return _0x56a61d['status'](_0x3d40a5)[_0x8a58('0x1d')](_0x268506);}};}function respondWithFilteredResult(_0x18a33c,_0x3010ae){return function(_0x3ff39e){if(_0x3ff39e){var _0x26e3a8=typeof _0x3010ae[_0x8a58('0x1e')]===_0x8a58('0x1f')&&typeof _0x3010ae['limit']==='undefined';var _0x31de8d=_0x3ff39e[_0x8a58('0x20')];var _0x18a14d=_0x26e3a8?0x0:_0x3010ae['offset'];var _0x282f2d=_0x26e3a8?_0x3ff39e[_0x8a58('0x20')]:_0x3010ae['offset']+_0x3010ae[_0x8a58('0x21')];var _0x15b527;if(_0x282f2d>=_0x31de8d){_0x282f2d=_0x31de8d;_0x15b527=0xc8;}else{_0x15b527=0xce;}_0x18a33c[_0x8a58('0x1b')](_0x15b527);return _0x18a33c[_0x8a58('0x22')](_0x8a58('0x23'),_0x18a14d+'-'+_0x282f2d+'/'+_0x31de8d)[_0x8a58('0x1d')](_0x3ff39e);}return null;};}function patchUpdates(_0x284bb8){return function(_0x115e19){try{jsonpatch[_0x8a58('0x24')](_0x115e19,_0x284bb8,!![]);}catch(_0xbf556a){return BPromise[_0x8a58('0x25')](_0xbf556a);}return _0x115e19[_0x8a58('0x26')]();};}function saveUpdates(_0x3758fa,_0x34adb8){return function(_0x561a9a){if(_0x561a9a){return _0x561a9a[_0x8a58('0x27')](_0x3758fa)[_0x8a58('0x28')](function(_0x20a6c5){return _0x20a6c5;});}return null;};}function removeEntity(_0x3f07ab,_0x22c898){return function(_0x415946){if(_0x415946){return _0x415946[_0x8a58('0x29')]()['then'](function(){_0x3f07ab[_0x8a58('0x1b')](0xcc)[_0x8a58('0x1c')]();});}};}function handleEntityNotFound(_0x30c96b,_0x24e780){return function(_0x4fb0fb){if(!_0x4fb0fb){_0x30c96b[_0x8a58('0x2a')](0x194);}return _0x4fb0fb;};}function handleError(_0x6b5cbf,_0x231dae){_0x231dae=_0x231dae||0x1f4;return function(_0x4d4835){logger[_0x8a58('0x2b')](_0x4d4835[_0x8a58('0x2c')]);if(_0x4d4835[_0x8a58('0x2d')]){delete _0x4d4835[_0x8a58('0x2d')];}_0x6b5cbf[_0x8a58('0x1b')](_0x231dae)[_0x8a58('0x2e')](_0x4d4835);};}exports[_0x8a58('0x2f')]=function(_0x4d5041,_0x433060){var _0x4ef1eb={},_0x501aa1={},_0x5e7265={'count':0x0,'rows':[]};var _0x4cfc96=_['map'](db[_0x8a58('0x30')][_0x8a58('0x31')],function(_0x1b2d9e){return{'name':_0x1b2d9e[_0x8a58('0x32')],'type':_0x1b2d9e[_0x8a58('0x33')][_0x8a58('0x34')]};});_0x501aa1[_0x8a58('0x35')]=_[_0x8a58('0x36')](_0x4cfc96,_0x8a58('0x2d'));_0x501aa1[_0x8a58('0x37')]=_[_0x8a58('0x38')](_0x4d5041[_0x8a58('0x37')]);_0x501aa1[_0x8a58('0x39')]=_['intersection'](_0x501aa1[_0x8a58('0x35')],_0x501aa1[_0x8a58('0x37')]);_0x4ef1eb[_0x8a58('0x3a')]=_[_0x8a58('0x3b')](_0x501aa1[_0x8a58('0x35')],qs[_0x8a58('0x3c')](_0x4d5041['query'][_0x8a58('0x3c')]));_0x4ef1eb[_0x8a58('0x3a')]=_0x4ef1eb[_0x8a58('0x3a')][_0x8a58('0x3d')]?_0x4ef1eb[_0x8a58('0x3a')]:_0x501aa1[_0x8a58('0x35')];if(!_0x4d5041[_0x8a58('0x37')]['hasOwnProperty'](_0x8a58('0x3e'))){_0x4ef1eb[_0x8a58('0x21')]=qs[_0x8a58('0x21')](_0x4d5041['query']['limit']);_0x4ef1eb['offset']=qs[_0x8a58('0x1e')](_0x4d5041[_0x8a58('0x37')][_0x8a58('0x1e')]);}_0x4ef1eb[_0x8a58('0x3f')]=qs['sort'](_0x4d5041[_0x8a58('0x37')][_0x8a58('0x40')]);_0x4ef1eb[_0x8a58('0x41')]=qs[_0x8a58('0x39')](_['pick'](_0x4d5041[_0x8a58('0x37')],_0x501aa1[_0x8a58('0x39')]),_0x4cfc96);if(_0x4d5041['query'][_0x8a58('0x42')]){_0x4ef1eb[_0x8a58('0x41')]=_[_0x8a58('0x43')](_0x4ef1eb[_0x8a58('0x41')],{'$or':_[_0x8a58('0x36')](_0x4cfc96,function(_0x122e0f){if(_0x122e0f['type']!=='VIRTUAL'){var _0x3afb2b={};_0x3afb2b[_0x122e0f[_0x8a58('0x2d')]]={'$like':'%'+_0x4d5041['query'][_0x8a58('0x42')]+'%'};return _0x3afb2b;}})});}_0x4ef1eb=_[_0x8a58('0x43')]({},_0x4ef1eb,_0x4d5041[_0x8a58('0x44')]);var _0x3dfd34={'where':_0x4ef1eb[_0x8a58('0x41')]};return db['FaxQueueReport'][_0x8a58('0x20')](_0x3dfd34)['then'](function(_0x2ad76a){_0x5e7265[_0x8a58('0x20')]=_0x2ad76a;if(_0x4d5041[_0x8a58('0x37')][_0x8a58('0x45')]){_0x4ef1eb[_0x8a58('0x46')]=[{'all':!![]}];}return db[_0x8a58('0x30')][_0x8a58('0x47')](_0x4ef1eb);})['then'](function(_0x5cd9d8){_0x5e7265[_0x8a58('0x48')]=_0x5cd9d8;return _0x5e7265;})['then'](respondWithFilteredResult(_0x433060,_0x4ef1eb))['catch'](handleError(_0x433060,null));};exports[_0x8a58('0x49')]=function(_0x8a79f2,_0x299806){var _0x573cd3={'raw':!![],'where':{'id':_0x8a79f2[_0x8a58('0x4a')]['id']}},_0x56a410={};_0x56a410['model']=_[_0x8a58('0x38')](db[_0x8a58('0x30')][_0x8a58('0x31')]);_0x56a410[_0x8a58('0x37')]=_['keys'](_0x8a79f2[_0x8a58('0x37')]);_0x56a410[_0x8a58('0x39')]=_['intersection'](_0x56a410[_0x8a58('0x35')],_0x56a410[_0x8a58('0x37')]);_0x573cd3[_0x8a58('0x3a')]=_[_0x8a58('0x3b')](_0x56a410['model'],qs[_0x8a58('0x3c')](_0x8a79f2['query'][_0x8a58('0x3c')]));_0x573cd3[_0x8a58('0x3a')]=_0x573cd3['attributes'][_0x8a58('0x3d')]?_0x573cd3['attributes']:_0x56a410['model'];if(_0x8a79f2[_0x8a58('0x37')][_0x8a58('0x45')]){_0x573cd3[_0x8a58('0x46')]=[{'all':!![]}];}_0x573cd3=_[_0x8a58('0x43')]({},_0x573cd3,_0x8a79f2[_0x8a58('0x44')]);return db[_0x8a58('0x30')]['find'](_0x573cd3)['then'](handleEntityNotFound(_0x299806,null))[_0x8a58('0x28')](respondWithResult(_0x299806,null))[_0x8a58('0x4b')](handleError(_0x299806,null));};exports[_0x8a58('0x4c')]=function(_0x19682c,_0x1ec51b){return db[_0x8a58('0x30')][_0x8a58('0x4c')](_0x19682c[_0x8a58('0x4d')],{})[_0x8a58('0x28')](respondWithResult(_0x1ec51b,0xc9))[_0x8a58('0x4b')](handleError(_0x1ec51b,null));};exports[_0x8a58('0x27')]=function(_0x392c32,_0x1ea824){if(_0x392c32[_0x8a58('0x4d')]['id']){delete _0x392c32['body']['id'];}return db[_0x8a58('0x30')][_0x8a58('0x4e')]({'where':{'id':_0x392c32[_0x8a58('0x4a')]['id']}})[_0x8a58('0x28')](handleEntityNotFound(_0x1ea824,null))[_0x8a58('0x28')](saveUpdates(_0x392c32[_0x8a58('0x4d')],null))[_0x8a58('0x28')](respondWithResult(_0x1ea824,null))['catch'](handleError(_0x1ea824,null));};exports['destroy']=function(_0x5ab682,_0x31e12a){return db[_0x8a58('0x30')][_0x8a58('0x4e')]({'where':{'id':_0x5ab682['params']['id']}})[_0x8a58('0x28')](handleEntityNotFound(_0x31e12a,null))[_0x8a58('0x28')](removeEntity(_0x31e12a,null))[_0x8a58('0x4b')](handleError(_0x31e12a,null));};exports[_0x8a58('0x4f')]=function(_0x3f493c,_0x1e3f5d){return db[_0x8a58('0x30')][_0x8a58('0x4f')]()[_0x8a58('0x28')](respondWithResult(_0x1e3f5d,null))[_0x8a58('0x4b')](handleError(_0x1e3f5d,null));}; \ No newline at end of file +var _0x2a41=['to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','then','destroy','sendStatus','stack','name','index','map','FaxQueueReport','type','key','query','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','pick','filters','filter','merge','options','includeAll','findAll','rows','catch','show','params','keys','rawAttributes','length','include','create','body','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','crypto','desk.js'];(function(_0x1512b2,_0x2c481e){var _0x230433=function(_0x5672a8){while(--_0x5672a8){_0x1512b2['push'](_0x1512b2['shift']());}};_0x230433(++_0x2c481e);}(_0x2a41,0x126));var _0x12a4=function(_0x4a9bdd,_0x5098f5){_0x4a9bdd=_0x4a9bdd-0x0;var _0x1ba3a4=_0x2a41[_0x4a9bdd];return _0x1ba3a4;};'use strict';var emlformat=require(_0x12a4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x12a4('0x1'));var jsonpatch=require(_0x12a4('0x2'));var rp=require(_0x12a4('0x3'));var moment=require(_0x12a4('0x4'));var BPromise=require(_0x12a4('0x5'));var Mustache=require(_0x12a4('0x6'));var util=require(_0x12a4('0x7'));var path=require(_0x12a4('0x8'));var sox=require(_0x12a4('0x9'));var csv=require('to-csv');var ejs=require(_0x12a4('0xa'));var fs=require('fs');var fs_extra=require(_0x12a4('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x12a4('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x12a4('0xd'));var toCsv=require(_0x12a4('0xe'));var querystring=require(_0x12a4('0xf'));var Papa=require(_0x12a4('0x10'));var Redis=require(_0x12a4('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x12a4('0x12'));var as=require(_0x12a4('0x13'));var hardwareService=require(_0x12a4('0x14'));var logger=require(_0x12a4('0x15'))(_0x12a4('0x16'));var utils=require(_0x12a4('0x17'));var config=require(_0x12a4('0x18'));var licenseUtil=require(_0x12a4('0x19'));var db=require(_0x12a4('0x1a'))['db'];function respondWithStatusCode(_0x197554,_0x28059a){_0x28059a=_0x28059a||0xcc;return function(_0x2c939e){if(_0x2c939e){return _0x197554['sendStatus'](_0x28059a);}return _0x197554[_0x12a4('0x1b')](_0x28059a)[_0x12a4('0x1c')]();};}function respondWithResult(_0x1af5f8,_0x22cfde){_0x22cfde=_0x22cfde||0xc8;return function(_0x2b6e72){if(_0x2b6e72){return _0x1af5f8['status'](_0x22cfde)['json'](_0x2b6e72);}};}function respondWithFilteredResult(_0x257d27,_0x2ccfce){return function(_0x2428ba){if(_0x2428ba){var _0x1cce66=typeof _0x2ccfce['offset']===_0x12a4('0x1d')&&typeof _0x2ccfce[_0x12a4('0x1e')]===_0x12a4('0x1d');var _0x25d54f=_0x2428ba[_0x12a4('0x1f')];var _0xe274e1=_0x1cce66?0x0:_0x2ccfce['offset'];var _0x1a6bbe=_0x1cce66?_0x2428ba[_0x12a4('0x1f')]:_0x2ccfce[_0x12a4('0x20')]+_0x2ccfce['limit'];var _0x569763;if(_0x1a6bbe>=_0x25d54f){_0x1a6bbe=_0x25d54f;_0x569763=0xc8;}else{_0x569763=0xce;}_0x257d27[_0x12a4('0x1b')](_0x569763);return _0x257d27[_0x12a4('0x21')](_0x12a4('0x22'),_0xe274e1+'-'+_0x1a6bbe+'/'+_0x25d54f)[_0x12a4('0x23')](_0x2428ba);}return null;};}function patchUpdates(_0x1a35d3){return function(_0x5c92e8){try{jsonpatch[_0x12a4('0x24')](_0x5c92e8,_0x1a35d3,!![]);}catch(_0x5617d6){return BPromise[_0x12a4('0x25')](_0x5617d6);}return _0x5c92e8[_0x12a4('0x26')]();};}function saveUpdates(_0x40bf8e,_0x475939){return function(_0x17a4cc){if(_0x17a4cc){return _0x17a4cc['update'](_0x40bf8e)[_0x12a4('0x27')](function(_0x188930){return _0x188930;});}return null;};}function removeEntity(_0x35e966,_0x1c4255){return function(_0x499b22){if(_0x499b22){return _0x499b22[_0x12a4('0x28')]()[_0x12a4('0x27')](function(){_0x35e966[_0x12a4('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x395749,_0x2f3cae){return function(_0x5950fe){if(!_0x5950fe){_0x395749[_0x12a4('0x29')](0x194);}return _0x5950fe;};}function handleError(_0xcb5f1f,_0x4f1c77){_0x4f1c77=_0x4f1c77||0x1f4;return function(_0x5e952f){logger['error'](_0x5e952f[_0x12a4('0x2a')]);if(_0x5e952f[_0x12a4('0x2b')]){delete _0x5e952f[_0x12a4('0x2b')];}_0xcb5f1f[_0x12a4('0x1b')](_0x4f1c77)['send'](_0x5e952f);};}exports[_0x12a4('0x2c')]=function(_0x56c3da,_0x1979d1){var _0x3c5584={},_0x377466={},_0x15adb7={'count':0x0,'rows':[]};var _0x56df0f=_[_0x12a4('0x2d')](db[_0x12a4('0x2e')]['rawAttributes'],function(_0x283668){return{'name':_0x283668['fieldName'],'type':_0x283668[_0x12a4('0x2f')][_0x12a4('0x30')]};});_0x377466['model']=_[_0x12a4('0x2d')](_0x56df0f,_0x12a4('0x2b'));_0x377466[_0x12a4('0x31')]=_['keys'](_0x56c3da[_0x12a4('0x31')]);_0x377466['filters']=_[_0x12a4('0x32')](_0x377466[_0x12a4('0x33')],_0x377466[_0x12a4('0x31')]);_0x3c5584[_0x12a4('0x34')]=_[_0x12a4('0x32')](_0x377466[_0x12a4('0x33')],qs['fields'](_0x56c3da[_0x12a4('0x31')][_0x12a4('0x35')]));_0x3c5584[_0x12a4('0x34')]=_0x3c5584['attributes']['length']?_0x3c5584[_0x12a4('0x34')]:_0x377466['model'];if(!_0x56c3da[_0x12a4('0x31')][_0x12a4('0x36')]('nolimit')){_0x3c5584[_0x12a4('0x1e')]=qs[_0x12a4('0x1e')](_0x56c3da[_0x12a4('0x31')][_0x12a4('0x1e')]);_0x3c5584['offset']=qs[_0x12a4('0x20')](_0x56c3da[_0x12a4('0x31')][_0x12a4('0x20')]);}_0x3c5584[_0x12a4('0x37')]=qs[_0x12a4('0x38')](_0x56c3da['query']['sort']);_0x3c5584[_0x12a4('0x39')]=qs['filters'](_[_0x12a4('0x3a')](_0x56c3da[_0x12a4('0x31')],_0x377466[_0x12a4('0x3b')]),_0x56df0f);if(_0x56c3da[_0x12a4('0x31')][_0x12a4('0x3c')]){_0x3c5584[_0x12a4('0x39')]=_[_0x12a4('0x3d')](_0x3c5584[_0x12a4('0x39')],{'$or':_[_0x12a4('0x2d')](_0x56df0f,function(_0x31e9bb){if(_0x31e9bb['type']!=='VIRTUAL'){var _0x4bba08={};_0x4bba08[_0x31e9bb[_0x12a4('0x2b')]]={'$like':'%'+_0x56c3da[_0x12a4('0x31')]['filter']+'%'};return _0x4bba08;}})});}_0x3c5584=_[_0x12a4('0x3d')]({},_0x3c5584,_0x56c3da[_0x12a4('0x3e')]);var _0x487d89={'where':_0x3c5584[_0x12a4('0x39')]};return db[_0x12a4('0x2e')][_0x12a4('0x1f')](_0x487d89)[_0x12a4('0x27')](function(_0x22f6c1){_0x15adb7[_0x12a4('0x1f')]=_0x22f6c1;if(_0x56c3da['query'][_0x12a4('0x3f')]){_0x3c5584['include']=[{'all':!![]}];}return db[_0x12a4('0x2e')][_0x12a4('0x40')](_0x3c5584);})[_0x12a4('0x27')](function(_0x2826fb){_0x15adb7[_0x12a4('0x41')]=_0x2826fb;return _0x15adb7;})['then'](respondWithFilteredResult(_0x1979d1,_0x3c5584))[_0x12a4('0x42')](handleError(_0x1979d1,null));};exports[_0x12a4('0x43')]=function(_0x201755,_0x8a1643){var _0x466df1={'raw':!![],'where':{'id':_0x201755[_0x12a4('0x44')]['id']}},_0xf2751e={};_0xf2751e['model']=_[_0x12a4('0x45')](db[_0x12a4('0x2e')][_0x12a4('0x46')]);_0xf2751e[_0x12a4('0x31')]=_[_0x12a4('0x45')](_0x201755[_0x12a4('0x31')]);_0xf2751e[_0x12a4('0x3b')]=_[_0x12a4('0x32')](_0xf2751e[_0x12a4('0x33')],_0xf2751e[_0x12a4('0x31')]);_0x466df1[_0x12a4('0x34')]=_['intersection'](_0xf2751e[_0x12a4('0x33')],qs[_0x12a4('0x35')](_0x201755[_0x12a4('0x31')]['fields']));_0x466df1['attributes']=_0x466df1[_0x12a4('0x34')][_0x12a4('0x47')]?_0x466df1[_0x12a4('0x34')]:_0xf2751e['model'];if(_0x201755[_0x12a4('0x31')][_0x12a4('0x3f')]){_0x466df1[_0x12a4('0x48')]=[{'all':!![]}];}_0x466df1=_[_0x12a4('0x3d')]({},_0x466df1,_0x201755['options']);return db['FaxQueueReport']['find'](_0x466df1)['then'](handleEntityNotFound(_0x8a1643,null))[_0x12a4('0x27')](respondWithResult(_0x8a1643,null))[_0x12a4('0x42')](handleError(_0x8a1643,null));};exports[_0x12a4('0x49')]=function(_0x1568b8,_0x4348ba){return db['FaxQueueReport'][_0x12a4('0x49')](_0x1568b8[_0x12a4('0x4a')],{})[_0x12a4('0x27')](respondWithResult(_0x4348ba,0xc9))['catch'](handleError(_0x4348ba,null));};exports['update']=function(_0x41516b,_0x11ef07){if(_0x41516b['body']['id']){delete _0x41516b['body']['id'];}return db['FaxQueueReport'][_0x12a4('0x4b')]({'where':{'id':_0x41516b[_0x12a4('0x44')]['id']}})[_0x12a4('0x27')](handleEntityNotFound(_0x11ef07,null))['then'](saveUpdates(_0x41516b[_0x12a4('0x4a')],null))[_0x12a4('0x27')](respondWithResult(_0x11ef07,null))['catch'](handleError(_0x11ef07,null));};exports[_0x12a4('0x28')]=function(_0x10f12e,_0x29598b){return db[_0x12a4('0x2e')][_0x12a4('0x4b')]({'where':{'id':_0x10f12e[_0x12a4('0x44')]['id']}})['then'](handleEntityNotFound(_0x29598b,null))[_0x12a4('0x27')](removeEntity(_0x29598b,null))['catch'](handleError(_0x29598b,null));};exports[_0x12a4('0x4c')]=function(_0x30eabd,_0x86f964){return db[_0x12a4('0x2e')][_0x12a4('0x4c')]()[_0x12a4('0x27')](respondWithResult(_0x86f964,null))[_0x12a4('0x42')](handleError(_0x86f964,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index ac5872b..3fdf072 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 _0xe14b=['bluebird','path','./faxQueueReport.attributes','exports','define','FaxQueueReport','report_fax_queue','lodash','util','moment'];(function(_0x54a1b6,_0x28d620){var _0x549b2d=function(_0x540e05){while(--_0x540e05){_0x54a1b6['push'](_0x54a1b6['shift']());}};_0x549b2d(++_0x28d620);}(_0xe14b,0x93));var _0xbe14=function(_0x222a42,_0x5a128e){_0x222a42=_0x222a42-0x0;var _0x187a6e=_0xe14b[_0x222a42];return _0x187a6e;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbe14('0x2'));var BPromise=require(_0xbe14('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe14('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbe14('0x5'));module[_0xbe14('0x6')]=function(_0x1fe204,_0x1ff100){return _0x1fe204[_0xbe14('0x7')](_0xbe14('0x8'),attributes,{'tableName':_0xbe14('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x814b=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport','uniqueid','lodash','util'];(function(_0x1e3c16,_0x372caa){var _0x47a0c9=function(_0x47f81d){while(--_0x47f81d){_0x1e3c16['push'](_0x1e3c16['shift']());}};_0x47a0c9(++_0x372caa);}(_0x814b,0x1a2));var _0xb814=function(_0x2a56ad,_0x2b94bf){_0x2a56ad=_0x2a56ad-0x0;var _0x425175=_0x814b[_0x2a56ad];return _0x425175;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var logger=require(_0xb814('0x2'))(_0xb814('0x3'));var moment=require(_0xb814('0x4'));var BPromise=require(_0xb814('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb814('0x6'));var rimraf=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var attributes=require(_0xb814('0x9'));module[_0xb814('0xa')]=function(_0x322a70,_0x53e507){return _0x322a70[_0xb814('0xb')](_0xb814('0xc'),attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':_0xb814('0xd'),'fields':[_0xb814('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index 6a48828..f0bb528 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 _0x4a32=['debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateFaxQueueReport','FaxQueueReport','create','body','options','raw','limit','UpdateFaxQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','FaxQueueReport,\x20%s,\x20%s','request\x20sent'];(function(_0xc2aef0,_0x5ef733){var _0x4369e8=function(_0x397bbe){while(--_0x397bbe){_0xc2aef0['push'](_0xc2aef0['shift']());}};_0x4369e8(++_0x5ef733);}(_0x4a32,0xf8));var _0x24a3=function(_0x56247f,_0x14328c){_0x56247f=_0x56247f-0x0;var _0x366b52=_0x4a32[_0x56247f];return _0x366b52;};'use strict';var _=require(_0x24a3('0x0'));var util=require(_0x24a3('0x1'));var moment=require(_0x24a3('0x2'));var BPromise=require(_0x24a3('0x3'));var rs=require(_0x24a3('0x4'));var fs=require('fs');var Redis=require(_0x24a3('0x5'));var db=require(_0x24a3('0x6'))['db'];var utils=require(_0x24a3('0x7'));var logger=require(_0x24a3('0x8'))('rpc');var config=require(_0x24a3('0x9'));var jayson=require(_0x24a3('0xa'));var client=jayson[_0x24a3('0xb')][_0x24a3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1763a0,_0x2ca0de,_0x24f7f9){return new BPromise(function(_0x3430b2,_0x171139){return client['request'](_0x1763a0,_0x24f7f9)[_0x24a3('0xd')](function(_0x23e261){logger['info'](_0x24a3('0xe'),_0x2ca0de,_0x24a3('0xf'));logger[_0x24a3('0x10')](_0x24a3('0x11'),_0x2ca0de,_0x24a3('0xf'),JSON[_0x24a3('0x12')](_0x23e261));if(_0x23e261[_0x24a3('0x13')]){if(_0x23e261['error'][_0x24a3('0x14')]===0x1f4){logger[_0x24a3('0x13')](_0x24a3('0xe'),_0x2ca0de,_0x23e261['error'][_0x24a3('0x15')]);return _0x171139(_0x23e261[_0x24a3('0x13')][_0x24a3('0x15')]);}logger[_0x24a3('0x13')](_0x24a3('0xe'),_0x2ca0de,_0x23e261[_0x24a3('0x13')][_0x24a3('0x15')]);return _0x3430b2(_0x23e261[_0x24a3('0x13')]['message']);}else{logger[_0x24a3('0x16')](_0x24a3('0xe'),_0x2ca0de,_0x24a3('0xf'));_0x3430b2(_0x23e261[_0x24a3('0x17')]['message']);}})[_0x24a3('0x18')](function(_0xd5aa37){logger[_0x24a3('0x13')](_0x24a3('0xe'),_0x2ca0de,_0xd5aa37);_0x171139(_0xd5aa37);});});}exports[_0x24a3('0x19')]=function(_0x448677){var _0x3d739b=this;return new Promise(function(_0x1aed11,_0x17c9cc){return db[_0x24a3('0x1a')][_0x24a3('0x1b')](_0x448677[_0x24a3('0x1c')],{'raw':_0x448677[_0x24a3('0x1d')]?_0x448677['options'][_0x24a3('0x1e')]===undefined?!![]:![]:!![]})[_0x24a3('0xd')](function(_0x56a85f){logger['info'](_0x24a3('0x19'),_0x448677);logger[_0x24a3('0x10')](_0x24a3('0x19'),_0x448677,JSON[_0x24a3('0x12')](_0x56a85f));_0x1aed11(_0x56a85f);})['catch'](function(_0x234908){logger[_0x24a3('0x13')](_0x24a3('0x19'),_0x234908[_0x24a3('0x15')],_0x448677);_0x17c9cc(_0x3d739b[_0x24a3('0x13')](0x1f4,_0x234908[_0x24a3('0x15')]));});});};exports['UpdateFaxQueueReport']=function(_0xb450ca){var _0x4071bf=this;return new Promise(function(_0x568762,_0x2ba86e){return db[_0x24a3('0x1a')]['update'](_0xb450ca['body'],{'raw':_0xb450ca[_0x24a3('0x1d')]?_0xb450ca[_0x24a3('0x1d')][_0x24a3('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xb450ca[_0x24a3('0x1d')]?_0xb450ca['options']['where']||null:null,'attributes':_0xb450ca[_0x24a3('0x1d')]?_0xb450ca['options']['attributes']||null:null,'limit':_0xb450ca[_0x24a3('0x1d')]?_0xb450ca[_0x24a3('0x1d')][_0x24a3('0x1f')]||null:null})[_0x24a3('0xd')](function(_0x3f5dc7){logger[_0x24a3('0x16')](_0x24a3('0x20'),_0xb450ca);logger[_0x24a3('0x10')]('UpdateFaxQueueReport',_0xb450ca,JSON[_0x24a3('0x12')](_0x3f5dc7));_0x568762(_0x3f5dc7);})[_0x24a3('0x18')](function(_0x3082aa){logger['error']('UpdateFaxQueueReport',_0x3082aa['message'],_0xb450ca);_0x2ba86e(_0x4071bf[_0x24a3('0x13')](0x1f4,_0x3082aa[_0x24a3('0x15')]));});});}; \ No newline at end of file +var _0x1b6d=['request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateFaxQueueReport','FaxQueueReport','create','body','options','raw','UpdateFaxQueueReport','update','where','attributes','limit','then','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','info','FaxQueueReport,\x20%s,\x20%s'];(function(_0x3f01a6,_0x3e2160){var _0xd76373=function(_0x560574){while(--_0x560574){_0x3f01a6['push'](_0x3f01a6['shift']());}};_0xd76373(++_0x3e2160);}(_0x1b6d,0x180));var _0xd1b6=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x1b6d[_0x4e676e];return _0x336a3c;};'use strict';var _=require('lodash');var util=require(_0xd1b6('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd1b6('0x1'));var fs=require('fs');var Redis=require(_0xd1b6('0x2'));var db=require(_0xd1b6('0x3'))['db'];var utils=require(_0xd1b6('0x4'));var logger=require(_0xd1b6('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xd1b6('0x6'));var client=jayson[_0xd1b6('0x7')][_0xd1b6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x197788,_0x18ca03,_0x4dfb1a){return new BPromise(function(_0x8560c,_0x4ed2e7){return client[_0xd1b6('0x9')](_0x197788,_0x4dfb1a)['then'](function(_0x144f27){logger[_0xd1b6('0xa')](_0xd1b6('0xb'),_0x18ca03,_0xd1b6('0xc'));logger[_0xd1b6('0xd')](_0xd1b6('0xe'),_0x18ca03,'request\x20sent',JSON[_0xd1b6('0xf')](_0x144f27));if(_0x144f27['error']){if(_0x144f27[_0xd1b6('0x10')][_0xd1b6('0x11')]===0x1f4){logger['error'](_0xd1b6('0xb'),_0x18ca03,_0x144f27[_0xd1b6('0x10')][_0xd1b6('0x12')]);return _0x4ed2e7(_0x144f27[_0xd1b6('0x10')][_0xd1b6('0x12')]);}logger[_0xd1b6('0x10')](_0xd1b6('0xb'),_0x18ca03,_0x144f27[_0xd1b6('0x10')][_0xd1b6('0x12')]);return _0x8560c(_0x144f27['error'][_0xd1b6('0x12')]);}else{logger['info'](_0xd1b6('0xb'),_0x18ca03,_0xd1b6('0xc'));_0x8560c(_0x144f27[_0xd1b6('0x13')]['message']);}})[_0xd1b6('0x14')](function(_0x577da3){logger[_0xd1b6('0x10')]('FaxQueueReport,\x20%s,\x20%s',_0x18ca03,_0x577da3);_0x4ed2e7(_0x577da3);});});}exports[_0xd1b6('0x15')]=function(_0x253721){var _0x1bf1de=this;return new Promise(function(_0x525e5c,_0x559118){return db[_0xd1b6('0x16')][_0xd1b6('0x17')](_0x253721[_0xd1b6('0x18')],{'raw':_0x253721['options']?_0x253721[_0xd1b6('0x19')][_0xd1b6('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0xf4d47){logger[_0xd1b6('0xa')](_0xd1b6('0x15'),_0x253721);logger[_0xd1b6('0xd')](_0xd1b6('0x15'),_0x253721,JSON['stringify'](_0xf4d47));_0x525e5c(_0xf4d47);})[_0xd1b6('0x14')](function(_0x2d4be8){logger[_0xd1b6('0x10')]('CreateFaxQueueReport',_0x2d4be8[_0xd1b6('0x12')],_0x253721);_0x559118(_0x1bf1de[_0xd1b6('0x10')](0x1f4,_0x2d4be8['message']));});});};exports[_0xd1b6('0x1b')]=function(_0x353bef){var _0x40e5cf=this;return new Promise(function(_0x510ee2,_0x80f4eb){return db['FaxQueueReport'][_0xd1b6('0x1c')](_0x353bef[_0xd1b6('0x18')],{'raw':_0x353bef[_0xd1b6('0x19')]?_0x353bef[_0xd1b6('0x19')][_0xd1b6('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x353bef['options']?_0x353bef[_0xd1b6('0x19')][_0xd1b6('0x1d')]||null:null,'attributes':_0x353bef[_0xd1b6('0x19')]?_0x353bef[_0xd1b6('0x19')][_0xd1b6('0x1e')]||null:null,'limit':_0x353bef[_0xd1b6('0x19')]?_0x353bef[_0xd1b6('0x19')][_0xd1b6('0x1f')]||null:null})[_0xd1b6('0x20')](function(_0xc013cf){logger[_0xd1b6('0xa')](_0xd1b6('0x1b'),_0x353bef);logger[_0xd1b6('0xd')](_0xd1b6('0x1b'),_0x353bef,JSON[_0xd1b6('0xf')](_0xc013cf));_0x510ee2(_0xc013cf);})['catch'](function(_0x2630dc){logger['error'](_0xd1b6('0x1b'),_0x2630dc['message'],_0x353bef);_0x80f4eb(_0x40e5cf[_0xd1b6('0x10')](0x1f4,_0x2630dc[_0xd1b6('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 0fca9e5..7b53bfe 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 _0x7372=['post','create','put','/:id','delete','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxQueueReport.controller','isAuthenticated','index','get','/describe','describe','show'];(function(_0x2086c8,_0x1f4aba){var _0x424b9c=function(_0x552031){while(--_0x552031){_0x2086c8['push'](_0x2086c8['shift']());}};_0x424b9c(++_0x1f4aba);}(_0x7372,0xe2));var _0x2737=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7372[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x2737('0x0'));var util=require(_0x2737('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x2737('0x2'));var router=express[_0x2737('0x3')]();var fs_extra=require(_0x2737('0x4'));var auth=require(_0x2737('0x5'));var interaction=require(_0x2737('0x6'));var config=require('../../config/environment');var controller=require(_0x2737('0x7'));router['get']('/',auth[_0x2737('0x8')](),controller[_0x2737('0x9')]);router[_0x2737('0xa')](_0x2737('0xb'),auth[_0x2737('0x8')](),controller[_0x2737('0xc')]);router[_0x2737('0xa')]('/:id',auth[_0x2737('0x8')](),controller[_0x2737('0xd')]);router[_0x2737('0xe')]('/',auth[_0x2737('0x8')](),controller[_0x2737('0xf')]);router[_0x2737('0x10')](_0x2737('0x11'),auth[_0x2737('0x8')](),controller['update']);router[_0x2737('0x12')](_0x2737('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0x2737('0x13')]=router; \ No newline at end of file +var _0x968c=['delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','index','/describe','get','/:id','isAuthenticated','show','put','update'];(function(_0x746240,_0x364a2d){var _0x43a1d5=function(_0x1c10c6){while(--_0x1c10c6){_0x746240['push'](_0x746240['shift']());}};_0x43a1d5(++_0x364a2d);}(_0x968c,0x7b));var _0xc968=function(_0x408adb,_0x20ddda){_0x408adb=_0x408adb-0x0;var _0x3d1358=_0x968c[_0x408adb];return _0x3d1358;};'use strict';var multer=require(_0xc968('0x0'));var util=require(_0xc968('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc968('0x2'));var router=express[_0xc968('0x3')]();var fs_extra=require(_0xc968('0x4'));var auth=require(_0xc968('0x5'));var interaction=require(_0xc968('0x6'));var config=require(_0xc968('0x7'));var controller=require(_0xc968('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xc968('0x9')]);router['get'](_0xc968('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0xc968('0xb')](_0xc968('0xc'),auth[_0xc968('0xd')](),controller[_0xc968('0xe')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xc968('0xf')]('/:id',auth[_0xc968('0xd')](),controller[_0xc968('0x10')]);router[_0xc968('0x11')](_0xc968('0xc'),auth[_0xc968('0xd')](),controller[_0xc968('0x12')]);module[_0xc968('0x13')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index 7072a12..c6450ca 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 _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x4b1032,_0x36952e){var _0x5a1d55=function(_0x282e9b){while(--_0x282e9b){_0x4b1032['push'](_0x4b1032['shift']());}};_0x5a1d55(++_0x36952e);}(_0x9bde,0xe1));var _0xe9bd=function(_0x5cfb7a,_0x1e922d){_0x5cfb7a=_0x5cfb7a-0x0;var _0x121f2c=_0x9bde[_0x5cfb7a];return _0x121f2c;};'use strict';var moment=require('moment');var Sequelize=require(_0xe9bd('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe9bd('0x2'),_0xe9bd('0x3'),_0xe9bd('0x4')),'allowNull':![],'defaultValue':_0xe9bd('0x4')},'transferredAt':{'type':Sequelize[_0xe9bd('0x5')],'allowNull':![],'defaultValue':Sequelize[_0xe9bd('0x6')]}}; \ No newline at end of file +var _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x289e64,_0x5adb3c){var _0x30246c=function(_0x1bf7f6){while(--_0x1bf7f6){_0x289e64['push'](_0x289e64['shift']());}};_0x30246c(++_0x5adb3c);}(_0xb43b,0x1b2));var _0xbb43=function(_0x861e16,_0x5eed3c){_0x861e16=_0x861e16-0x0;var _0x42a4bf=_0xb43b[_0x861e16];return _0x42a4bf;};'use strict';var moment=require(_0xbb43('0x0'));var Sequelize=require(_0xbb43('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbb43('0x3')](_0xbb43('0x4'),'agent',_0xbb43('0x5')),'allowNull':![],'defaultValue':_0xbb43('0x5')},'transferredAt':{'type':Sequelize[_0xbb43('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xbb43('0x7')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index 9344ff0..f5c5dce 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 _0x3d20=['moment','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','set','Content-Range','reject','save','update','then','destroy','sendStatus','error','name','send','index','FaxTransferReport','fieldName','query','keys','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','filter','merge','map','type','VIRTUAL','includeAll','findAll','catch','params','rawAttributes','include','options','find','create','body','describe','eml-format','fast-json-patch'];(function(_0x5a7fbc,_0xa081de){var _0xcba0fc=function(_0x4f083b){while(--_0x4f083b){_0x5a7fbc['push'](_0x5a7fbc['shift']());}};_0xcba0fc(++_0xa081de);}(_0x3d20,0x8e));var _0x03d2=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0x3d20[_0x279d37];return _0x530173;};'use strict';var emlformat=require(_0x03d2('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x03d2('0x1'));var rp=require('request-promise');var moment=require(_0x03d2('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x03d2('0x3'));var path=require(_0x03d2('0x4'));var sox=require(_0x03d2('0x5'));var csv=require(_0x03d2('0x6'));var ejs=require(_0x03d2('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x03d2('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x03d2('0x9'));var deskjs=require(_0x03d2('0xa'));var toCsv=require(_0x03d2('0x6'));var querystring=require('querystring');var Papa=require(_0x03d2('0xb'));var Redis=require(_0x03d2('0xc'));var authService=require(_0x03d2('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x03d2('0xe'));var hardwareService=require(_0x03d2('0xf'));var logger=require(_0x03d2('0x10'))(_0x03d2('0x11'));var utils=require(_0x03d2('0x12'));var config=require(_0x03d2('0x13'));var licenseUtil=require(_0x03d2('0x14'));var db=require(_0x03d2('0x15'))['db'];function respondWithStatusCode(_0x1634c5,_0x369e41){_0x369e41=_0x369e41||0xcc;return function(_0x65a655){if(_0x65a655){return _0x1634c5['sendStatus'](_0x369e41);}return _0x1634c5[_0x03d2('0x16')](_0x369e41)[_0x03d2('0x17')]();};}function respondWithResult(_0x2af64e,_0x4494a9){_0x4494a9=_0x4494a9||0xc8;return function(_0x49a241){if(_0x49a241){return _0x2af64e[_0x03d2('0x16')](_0x4494a9)[_0x03d2('0x18')](_0x49a241);}};}function respondWithFilteredResult(_0x2e9a0a,_0x32bbbf){return function(_0x2968f2){if(_0x2968f2){var _0x8256c0=typeof _0x32bbbf[_0x03d2('0x19')]===_0x03d2('0x1a')&&typeof _0x32bbbf['limit']===_0x03d2('0x1a');var _0x3023c3=_0x2968f2[_0x03d2('0x1b')];var _0x32f7d8=_0x8256c0?0x0:_0x32bbbf[_0x03d2('0x19')];var _0xa0c927=_0x8256c0?_0x2968f2[_0x03d2('0x1b')]:_0x32bbbf[_0x03d2('0x19')]+_0x32bbbf['limit'];var _0x2057bc;if(_0xa0c927>=_0x3023c3){_0xa0c927=_0x3023c3;_0x2057bc=0xc8;}else{_0x2057bc=0xce;}_0x2e9a0a['status'](_0x2057bc);return _0x2e9a0a[_0x03d2('0x1c')](_0x03d2('0x1d'),_0x32f7d8+'-'+_0xa0c927+'/'+_0x3023c3)[_0x03d2('0x18')](_0x2968f2);}return null;};}function patchUpdates(_0x2a02ec){return function(_0x251727){try{jsonpatch['apply'](_0x251727,_0x2a02ec,!![]);}catch(_0x3b1a9b){return BPromise[_0x03d2('0x1e')](_0x3b1a9b);}return _0x251727[_0x03d2('0x1f')]();};}function saveUpdates(_0x41a9a5,_0x2f569b){return function(_0x5bbb6e){if(_0x5bbb6e){return _0x5bbb6e[_0x03d2('0x20')](_0x41a9a5)[_0x03d2('0x21')](function(_0x2c84b9){return _0x2c84b9;});}return null;};}function removeEntity(_0x16a5b1,_0x57b27b){return function(_0x1b0ed7){if(_0x1b0ed7){return _0x1b0ed7[_0x03d2('0x22')]()[_0x03d2('0x21')](function(){_0x16a5b1[_0x03d2('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x438a43,_0x36eefe){return function(_0x106387){if(!_0x106387){_0x438a43[_0x03d2('0x23')](0x194);}return _0x106387;};}function handleError(_0x5d682a,_0x3e5aa8){_0x3e5aa8=_0x3e5aa8||0x1f4;return function(_0x26241c){logger[_0x03d2('0x24')](_0x26241c['stack']);if(_0x26241c[_0x03d2('0x25')]){delete _0x26241c[_0x03d2('0x25')];}_0x5d682a[_0x03d2('0x16')](_0x3e5aa8)[_0x03d2('0x26')](_0x26241c);};}exports[_0x03d2('0x27')]=function(_0x9db1c7,_0xa653d7){var _0x512a5a={},_0x54074e={},_0x5a1100={'count':0x0,'rows':[]};var _0x1ad69a=_['map'](db[_0x03d2('0x28')]['rawAttributes'],function(_0x47dc05){return{'name':_0x47dc05[_0x03d2('0x29')],'type':_0x47dc05['type']['key']};});_0x54074e['model']=_['map'](_0x1ad69a,_0x03d2('0x25'));_0x54074e[_0x03d2('0x2a')]=_[_0x03d2('0x2b')](_0x9db1c7[_0x03d2('0x2a')]);_0x54074e['filters']=_[_0x03d2('0x2c')](_0x54074e['model'],_0x54074e['query']);_0x512a5a[_0x03d2('0x2d')]=_[_0x03d2('0x2c')](_0x54074e[_0x03d2('0x2e')],qs[_0x03d2('0x2f')](_0x9db1c7[_0x03d2('0x2a')][_0x03d2('0x2f')]));_0x512a5a['attributes']=_0x512a5a['attributes'][_0x03d2('0x30')]?_0x512a5a[_0x03d2('0x2d')]:_0x54074e[_0x03d2('0x2e')];if(!_0x9db1c7['query'][_0x03d2('0x31')](_0x03d2('0x32'))){_0x512a5a['limit']=qs[_0x03d2('0x33')](_0x9db1c7[_0x03d2('0x2a')][_0x03d2('0x33')]);_0x512a5a[_0x03d2('0x19')]=qs['offset'](_0x9db1c7[_0x03d2('0x2a')]['offset']);}_0x512a5a[_0x03d2('0x34')]=qs[_0x03d2('0x35')](_0x9db1c7['query'][_0x03d2('0x35')]);_0x512a5a[_0x03d2('0x36')]=qs['filters'](_['pick'](_0x9db1c7['query'],_0x54074e[_0x03d2('0x37')]),_0x1ad69a);if(_0x9db1c7[_0x03d2('0x2a')][_0x03d2('0x38')]){_0x512a5a[_0x03d2('0x36')]=_[_0x03d2('0x39')](_0x512a5a[_0x03d2('0x36')],{'$or':_[_0x03d2('0x3a')](_0x1ad69a,function(_0x235ca2){if(_0x235ca2[_0x03d2('0x3b')]!==_0x03d2('0x3c')){var _0x480920={};_0x480920[_0x235ca2['name']]={'$like':'%'+_0x9db1c7[_0x03d2('0x2a')]['filter']+'%'};return _0x480920;}})});}_0x512a5a=_[_0x03d2('0x39')]({},_0x512a5a,_0x9db1c7['options']);var _0xec3591={'where':_0x512a5a[_0x03d2('0x36')]};return db[_0x03d2('0x28')][_0x03d2('0x1b')](_0xec3591)[_0x03d2('0x21')](function(_0x519561){_0x5a1100[_0x03d2('0x1b')]=_0x519561;if(_0x9db1c7[_0x03d2('0x2a')][_0x03d2('0x3d')]){_0x512a5a['include']=[{'all':!![]}];}return db[_0x03d2('0x28')][_0x03d2('0x3e')](_0x512a5a);})[_0x03d2('0x21')](function(_0x98d637){_0x5a1100['rows']=_0x98d637;return _0x5a1100;})[_0x03d2('0x21')](respondWithFilteredResult(_0xa653d7,_0x512a5a))[_0x03d2('0x3f')](handleError(_0xa653d7,null));};exports['show']=function(_0x3c3d7b,_0x2ca8b1){var _0x589cf5={'raw':!![],'where':{'id':_0x3c3d7b[_0x03d2('0x40')]['id']}},_0x2126af={};_0x2126af[_0x03d2('0x2e')]=_[_0x03d2('0x2b')](db['FaxTransferReport'][_0x03d2('0x41')]);_0x2126af[_0x03d2('0x2a')]=_[_0x03d2('0x2b')](_0x3c3d7b['query']);_0x2126af['filters']=_[_0x03d2('0x2c')](_0x2126af['model'],_0x2126af['query']);_0x589cf5[_0x03d2('0x2d')]=_[_0x03d2('0x2c')](_0x2126af[_0x03d2('0x2e')],qs['fields'](_0x3c3d7b[_0x03d2('0x2a')][_0x03d2('0x2f')]));_0x589cf5[_0x03d2('0x2d')]=_0x589cf5['attributes'][_0x03d2('0x30')]?_0x589cf5[_0x03d2('0x2d')]:_0x2126af[_0x03d2('0x2e')];if(_0x3c3d7b[_0x03d2('0x2a')][_0x03d2('0x3d')]){_0x589cf5[_0x03d2('0x42')]=[{'all':!![]}];}_0x589cf5=_[_0x03d2('0x39')]({},_0x589cf5,_0x3c3d7b[_0x03d2('0x43')]);return db[_0x03d2('0x28')][_0x03d2('0x44')](_0x589cf5)[_0x03d2('0x21')](handleEntityNotFound(_0x2ca8b1,null))['then'](respondWithResult(_0x2ca8b1,null))[_0x03d2('0x3f')](handleError(_0x2ca8b1,null));};exports['create']=function(_0x520fd5,_0x21f0f0){return db[_0x03d2('0x28')][_0x03d2('0x45')](_0x520fd5[_0x03d2('0x46')],{})[_0x03d2('0x21')](respondWithResult(_0x21f0f0,0xc9))[_0x03d2('0x3f')](handleError(_0x21f0f0,null));};exports['update']=function(_0x426245,_0x506db9){if(_0x426245[_0x03d2('0x46')]['id']){delete _0x426245['body']['id'];}return db[_0x03d2('0x28')][_0x03d2('0x44')]({'where':{'id':_0x426245[_0x03d2('0x40')]['id']}})['then'](handleEntityNotFound(_0x506db9,null))[_0x03d2('0x21')](saveUpdates(_0x426245[_0x03d2('0x46')],null))[_0x03d2('0x21')](respondWithResult(_0x506db9,null))['catch'](handleError(_0x506db9,null));};exports[_0x03d2('0x22')]=function(_0x8dac44,_0x1838bd){return db[_0x03d2('0x28')]['find']({'where':{'id':_0x8dac44['params']['id']}})[_0x03d2('0x21')](handleEntityNotFound(_0x1838bd,null))['then'](removeEntity(_0x1838bd,null))[_0x03d2('0x3f')](handleError(_0x1838bd,null));};exports['describe']=function(_0x6f3bf0,_0x33f8ac){return db[_0x03d2('0x28')][_0x03d2('0x47')]()[_0x03d2('0x21')](respondWithResult(_0x33f8ac,null))['catch'](handleError(_0x33f8ac,null));}; \ No newline at end of file +var _0xf7d3=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','FaxTransferReport','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','length','hasOwnProperty','order','sort','pick','where','VIRTUAL','options','includeAll','include','findAll','catch','fields','merge','create','body','find','params','destroy','describe','eml-format'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xf7d3,0xef));var _0x3f7d=function(_0xe5c436,_0x3f3b8b){_0xe5c436=_0xe5c436-0x0;var _0x2d29ca=_0xf7d3[_0xe5c436];return _0x2d29ca;};'use strict';var emlformat=require(_0x3f7d('0x0'));var rimraf=require(_0x3f7d('0x1'));var zipdir=require(_0x3f7d('0x2'));var jsonpatch=require(_0x3f7d('0x3'));var rp=require(_0x3f7d('0x4'));var moment=require(_0x3f7d('0x5'));var BPromise=require(_0x3f7d('0x6'));var Mustache=require('mustache');var util=require(_0x3f7d('0x7'));var path=require('path');var sox=require(_0x3f7d('0x8'));var csv=require(_0x3f7d('0x9'));var ejs=require(_0x3f7d('0xa'));var fs=require('fs');var fs_extra=require(_0x3f7d('0xb'));var _=require(_0x3f7d('0xc'));var squel=require(_0x3f7d('0xd'));var crypto=require(_0x3f7d('0xe'));var jsforce=require(_0x3f7d('0xf'));var deskjs=require(_0x3f7d('0x10'));var toCsv=require(_0x3f7d('0x9'));var querystring=require(_0x3f7d('0x11'));var Papa=require(_0x3f7d('0x12'));var Redis=require(_0x3f7d('0x13'));var authService=require(_0x3f7d('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x3f7d('0x15'));var hardwareService=require(_0x3f7d('0x16'));var logger=require(_0x3f7d('0x17'))(_0x3f7d('0x18'));var utils=require(_0x3f7d('0x19'));var config=require(_0x3f7d('0x1a'));var licenseUtil=require(_0x3f7d('0x1b'));var db=require(_0x3f7d('0x1c'))['db'];function respondWithStatusCode(_0x33253e,_0x26dbb3){_0x26dbb3=_0x26dbb3||0xcc;return function(_0x432094){if(_0x432094){return _0x33253e[_0x3f7d('0x1d')](_0x26dbb3);}return _0x33253e[_0x3f7d('0x1e')](_0x26dbb3)[_0x3f7d('0x1f')]();};}function respondWithResult(_0x9ef2a0,_0x4fb2a2){_0x4fb2a2=_0x4fb2a2||0xc8;return function(_0x116008){if(_0x116008){return _0x9ef2a0['status'](_0x4fb2a2)[_0x3f7d('0x20')](_0x116008);}};}function respondWithFilteredResult(_0x53c69a,_0x2136e2){return function(_0x2e6ff9){if(_0x2e6ff9){var _0x5c7bd5=typeof _0x2136e2[_0x3f7d('0x21')]===_0x3f7d('0x22')&&typeof _0x2136e2[_0x3f7d('0x23')]===_0x3f7d('0x22');var _0xc97d50=_0x2e6ff9[_0x3f7d('0x24')];var _0x3f3324=_0x5c7bd5?0x0:_0x2136e2[_0x3f7d('0x21')];var _0x499c6b=_0x5c7bd5?_0x2e6ff9[_0x3f7d('0x24')]:_0x2136e2[_0x3f7d('0x21')]+_0x2136e2[_0x3f7d('0x23')];var _0x18ea06;if(_0x499c6b>=_0xc97d50){_0x499c6b=_0xc97d50;_0x18ea06=0xc8;}else{_0x18ea06=0xce;}_0x53c69a['status'](_0x18ea06);return _0x53c69a[_0x3f7d('0x25')](_0x3f7d('0x26'),_0x3f3324+'-'+_0x499c6b+'/'+_0xc97d50)['json'](_0x2e6ff9);}return null;};}function patchUpdates(_0x3f0dc4){return function(_0x320a63){try{jsonpatch[_0x3f7d('0x27')](_0x320a63,_0x3f0dc4,!![]);}catch(_0x4cca75){return BPromise[_0x3f7d('0x28')](_0x4cca75);}return _0x320a63[_0x3f7d('0x29')]();};}function saveUpdates(_0x46e55,_0x1d1613){return function(_0x1c1b3c){if(_0x1c1b3c){return _0x1c1b3c[_0x3f7d('0x2a')](_0x46e55)[_0x3f7d('0x2b')](function(_0x30381b){return _0x30381b;});}return null;};}function removeEntity(_0x1460c2,_0x955b3c){return function(_0x5ce9e3){if(_0x5ce9e3){return _0x5ce9e3['destroy']()[_0x3f7d('0x2b')](function(){_0x1460c2[_0x3f7d('0x1e')](0xcc)[_0x3f7d('0x1f')]();});}};}function handleEntityNotFound(_0x52ea58,_0x26af12){return function(_0x395fd0){if(!_0x395fd0){_0x52ea58['sendStatus'](0x194);}return _0x395fd0;};}function handleError(_0x2a671f,_0x27e907){_0x27e907=_0x27e907||0x1f4;return function(_0x14d006){logger[_0x3f7d('0x2c')](_0x14d006[_0x3f7d('0x2d')]);if(_0x14d006[_0x3f7d('0x2e')]){delete _0x14d006[_0x3f7d('0x2e')];}_0x2a671f['status'](_0x27e907)[_0x3f7d('0x2f')](_0x14d006);};}exports[_0x3f7d('0x30')]=function(_0x5adb69,_0x4b625c){var _0x78ea90={},_0x2c46ab={},_0x119cc6={'count':0x0,'rows':[]};var _0x36c6c6=_['map'](db[_0x3f7d('0x31')][_0x3f7d('0x32')],function(_0x42f1ac){return{'name':_0x42f1ac[_0x3f7d('0x33')],'type':_0x42f1ac[_0x3f7d('0x34')]['key']};});_0x2c46ab[_0x3f7d('0x35')]=_[_0x3f7d('0x36')](_0x36c6c6,_0x3f7d('0x2e'));_0x2c46ab[_0x3f7d('0x37')]=_[_0x3f7d('0x38')](_0x5adb69[_0x3f7d('0x37')]);_0x2c46ab[_0x3f7d('0x39')]=_[_0x3f7d('0x3a')](_0x2c46ab['model'],_0x2c46ab[_0x3f7d('0x37')]);_0x78ea90[_0x3f7d('0x3b')]=_[_0x3f7d('0x3a')](_0x2c46ab['model'],qs['fields'](_0x5adb69['query']['fields']));_0x78ea90[_0x3f7d('0x3b')]=_0x78ea90[_0x3f7d('0x3b')][_0x3f7d('0x3c')]?_0x78ea90['attributes']:_0x2c46ab[_0x3f7d('0x35')];if(!_0x5adb69[_0x3f7d('0x37')][_0x3f7d('0x3d')]('nolimit')){_0x78ea90[_0x3f7d('0x23')]=qs['limit'](_0x5adb69['query'][_0x3f7d('0x23')]);_0x78ea90[_0x3f7d('0x21')]=qs[_0x3f7d('0x21')](_0x5adb69['query'][_0x3f7d('0x21')]);}_0x78ea90[_0x3f7d('0x3e')]=qs[_0x3f7d('0x3f')](_0x5adb69[_0x3f7d('0x37')]['sort']);_0x78ea90['where']=qs['filters'](_[_0x3f7d('0x40')](_0x5adb69[_0x3f7d('0x37')],_0x2c46ab[_0x3f7d('0x39')]),_0x36c6c6);if(_0x5adb69['query']['filter']){_0x78ea90[_0x3f7d('0x41')]=_['merge'](_0x78ea90[_0x3f7d('0x41')],{'$or':_[_0x3f7d('0x36')](_0x36c6c6,function(_0x554100){if(_0x554100['type']!==_0x3f7d('0x42')){var _0x55c0f8={};_0x55c0f8[_0x554100['name']]={'$like':'%'+_0x5adb69['query']['filter']+'%'};return _0x55c0f8;}})});}_0x78ea90=_['merge']({},_0x78ea90,_0x5adb69[_0x3f7d('0x43')]);var _0xcad9fb={'where':_0x78ea90[_0x3f7d('0x41')]};return db[_0x3f7d('0x31')]['count'](_0xcad9fb)[_0x3f7d('0x2b')](function(_0x49da00){_0x119cc6[_0x3f7d('0x24')]=_0x49da00;if(_0x5adb69['query'][_0x3f7d('0x44')]){_0x78ea90[_0x3f7d('0x45')]=[{'all':!![]}];}return db[_0x3f7d('0x31')][_0x3f7d('0x46')](_0x78ea90);})[_0x3f7d('0x2b')](function(_0xad614f){_0x119cc6['rows']=_0xad614f;return _0x119cc6;})['then'](respondWithFilteredResult(_0x4b625c,_0x78ea90))[_0x3f7d('0x47')](handleError(_0x4b625c,null));};exports['show']=function(_0x22b691,_0x43dd6e){var _0x492c44={'raw':!![],'where':{'id':_0x22b691['params']['id']}},_0x322d19={};_0x322d19[_0x3f7d('0x35')]=_[_0x3f7d('0x38')](db[_0x3f7d('0x31')][_0x3f7d('0x32')]);_0x322d19[_0x3f7d('0x37')]=_[_0x3f7d('0x38')](_0x22b691[_0x3f7d('0x37')]);_0x322d19['filters']=_[_0x3f7d('0x3a')](_0x322d19[_0x3f7d('0x35')],_0x322d19[_0x3f7d('0x37')]);_0x492c44[_0x3f7d('0x3b')]=_[_0x3f7d('0x3a')](_0x322d19[_0x3f7d('0x35')],qs['fields'](_0x22b691[_0x3f7d('0x37')][_0x3f7d('0x48')]));_0x492c44[_0x3f7d('0x3b')]=_0x492c44[_0x3f7d('0x3b')][_0x3f7d('0x3c')]?_0x492c44['attributes']:_0x322d19[_0x3f7d('0x35')];if(_0x22b691['query'][_0x3f7d('0x44')]){_0x492c44[_0x3f7d('0x45')]=[{'all':!![]}];}_0x492c44=_[_0x3f7d('0x49')]({},_0x492c44,_0x22b691[_0x3f7d('0x43')]);return db[_0x3f7d('0x31')]['find'](_0x492c44)[_0x3f7d('0x2b')](handleEntityNotFound(_0x43dd6e,null))['then'](respondWithResult(_0x43dd6e,null))['catch'](handleError(_0x43dd6e,null));};exports[_0x3f7d('0x4a')]=function(_0x2fbd5f,_0x449446){return db['FaxTransferReport']['create'](_0x2fbd5f[_0x3f7d('0x4b')],{})[_0x3f7d('0x2b')](respondWithResult(_0x449446,0xc9))[_0x3f7d('0x47')](handleError(_0x449446,null));};exports['update']=function(_0x513c66,_0xeeabe9){if(_0x513c66['body']['id']){delete _0x513c66[_0x3f7d('0x4b')]['id'];}return db[_0x3f7d('0x31')][_0x3f7d('0x4c')]({'where':{'id':_0x513c66[_0x3f7d('0x4d')]['id']}})[_0x3f7d('0x2b')](handleEntityNotFound(_0xeeabe9,null))[_0x3f7d('0x2b')](saveUpdates(_0x513c66['body'],null))[_0x3f7d('0x2b')](respondWithResult(_0xeeabe9,null))[_0x3f7d('0x47')](handleError(_0xeeabe9,null));};exports[_0x3f7d('0x4e')]=function(_0x3a5cb8,_0xbae6b5){return db[_0x3f7d('0x31')][_0x3f7d('0x4c')]({'where':{'id':_0x3a5cb8[_0x3f7d('0x4d')]['id']}})[_0x3f7d('0x2b')](handleEntityNotFound(_0xbae6b5,null))['then'](removeEntity(_0xbae6b5,null))[_0x3f7d('0x47')](handleError(_0xbae6b5,null));};exports[_0x3f7d('0x4f')]=function(_0xab0a70,_0x57b98e){return db[_0x3f7d('0x31')][_0x3f7d('0x4f')]()[_0x3f7d('0x2b')](respondWithResult(_0x57b98e,null))[_0x3f7d('0x47')](handleError(_0x57b98e,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index b812ed4..042f987 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 _0xdb51=['bluebird','path','rimraf','../../config/environment','./faxTransferReport.attributes','exports','define','FaxTransferReport','report_fax_transfer','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x517790,_0x118122){var _0x475827=function(_0xecdfb6){while(--_0xecdfb6){_0x517790['push'](_0x517790['shift']());}};_0x475827(++_0x118122);}(_0xdb51,0x145));var _0x1db5=function(_0x131fe7,_0x21fcdb){_0x131fe7=_0x131fe7-0x0;var _0x2eddf3=_0xdb51[_0x131fe7];return _0x2eddf3;};'use strict';var _=require(_0x1db5('0x0'));var util=require(_0x1db5('0x1'));var logger=require(_0x1db5('0x2'))(_0x1db5('0x3'));var moment=require(_0x1db5('0x4'));var BPromise=require(_0x1db5('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1db5('0x6'));var rimraf=require(_0x1db5('0x7'));var config=require(_0x1db5('0x8'));var attributes=require(_0x1db5('0x9'));module[_0x1db5('0xa')]=function(_0x168cfc,_0x3dfee1){return _0x168cfc[_0x1db5('0xb')](_0x1db5('0xc'),attributes,{'tableName':_0x1db5('0xd'),'paranoid':![],'indexes':[{'name':_0x1db5('0xe'),'fields':[_0x1db5('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb6a2=['define','FaxTransferReport','report_fax_transfer','uniqueid','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./faxTransferReport.attributes','exports'];(function(_0x232cc3,_0x5940a0){var _0x1d008c=function(_0x5d163e){while(--_0x5d163e){_0x232cc3['push'](_0x232cc3['shift']());}};_0x1d008c(++_0x5940a0);}(_0xb6a2,0x170));var _0x2b6a=function(_0x542fdf,_0x318d3b){_0x542fdf=_0x542fdf-0x0;var _0x4d6666=_0xb6a2[_0x542fdf];return _0x4d6666;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2b6a('0x0'))(_0x2b6a('0x1'));var moment=require(_0x2b6a('0x2'));var BPromise=require(_0x2b6a('0x3'));var rp=require(_0x2b6a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2b6a('0x5'));var config=require(_0x2b6a('0x6'));var attributes=require(_0x2b6a('0x7'));module[_0x2b6a('0x8')]=function(_0x1eabc2,_0x4867ed){return _0x1eabc2[_0x2b6a('0x9')](_0x2b6a('0xa'),attributes,{'tableName':_0x2b6a('0xb'),'paranoid':![],'indexes':[{'name':_0x2b6a('0xc'),'fields':[_0x2b6a('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index 883f68c..34565bc 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 _0x3883=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','request','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x56df00,_0x442a24){var _0x3c3d77=function(_0x1952dc){while(--_0x1952dc){_0x56df00['push'](_0x56df00['shift']());}};_0x3c3d77(++_0x442a24);}(_0x3883,0xc5));var _0x3388=function(_0x3f9716,_0x26efc4){_0x3f9716=_0x3f9716-0x0;var _0x1dac52=_0x3883[_0x3f9716];return _0x1dac52;};'use strict';var _=require(_0x3388('0x0'));var util=require(_0x3388('0x1'));var moment=require(_0x3388('0x2'));var BPromise=require('bluebird');var rs=require(_0x3388('0x3'));var fs=require('fs');var Redis=require(_0x3388('0x4'));var db=require(_0x3388('0x5'))['db'];var utils=require(_0x3388('0x6'));var logger=require(_0x3388('0x7'))('rpc');var config=require(_0x3388('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5c8573,_0x44e149,_0x241b7e){return new BPromise(function(_0x31a140,_0xace8d4){return client[_0x3388('0x9')](_0x5c8573,_0x241b7e)['then'](function(_0x34d26){logger[_0x3388('0xa')](_0x3388('0xb'),_0x44e149,_0x3388('0xc'));logger[_0x3388('0xd')]('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x44e149,_0x3388('0xc'),JSON[_0x3388('0xe')](_0x34d26));if(_0x34d26[_0x3388('0xf')]){if(_0x34d26['error'][_0x3388('0x10')]===0x1f4){logger[_0x3388('0xf')](_0x3388('0xb'),_0x44e149,_0x34d26[_0x3388('0xf')][_0x3388('0x11')]);return _0xace8d4(_0x34d26['error'][_0x3388('0x11')]);}logger[_0x3388('0xf')](_0x3388('0xb'),_0x44e149,_0x34d26['error'][_0x3388('0x11')]);return _0x31a140(_0x34d26[_0x3388('0xf')][_0x3388('0x11')]);}else{logger['info'](_0x3388('0xb'),_0x44e149,_0x3388('0xc'));_0x31a140(_0x34d26[_0x3388('0x12')][_0x3388('0x11')]);}})[_0x3388('0x13')](function(_0x379994){logger['error']('FaxTransferReport,\x20%s,\x20%s',_0x44e149,_0x379994);_0xace8d4(_0x379994);});});} \ No newline at end of file +var _0x9095=['then','info','request\x20sent','stringify','error','code','FaxTransferReport,\x20%s,\x20%s','message','result','catch','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x9095,0x173));var _0x5909=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x9095[_0x178e48];return _0x440d7e;};'use strict';var _=require(_0x5909('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5909('0x1'));var rs=require(_0x5909('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5909('0x3'))['db'];var utils=require(_0x5909('0x4'));var logger=require(_0x5909('0x5'))(_0x5909('0x6'));var config=require('../../config/environment');var jayson=require(_0x5909('0x7'));var client=jayson[_0x5909('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x78bac8,_0x40c180,_0x3b9767){return new BPromise(function(_0x2ffb0a,_0x167f6e){return client['request'](_0x78bac8,_0x3b9767)[_0x5909('0x9')](function(_0x44473f){logger[_0x5909('0xa')]('FaxTransferReport,\x20%s,\x20%s',_0x40c180,_0x5909('0xb'));logger['debug']('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x40c180,'request\x20sent',JSON[_0x5909('0xc')](_0x44473f));if(_0x44473f[_0x5909('0xd')]){if(_0x44473f['error'][_0x5909('0xe')]===0x1f4){logger[_0x5909('0xd')](_0x5909('0xf'),_0x40c180,_0x44473f[_0x5909('0xd')][_0x5909('0x10')]);return _0x167f6e(_0x44473f[_0x5909('0xd')][_0x5909('0x10')]);}logger['error'](_0x5909('0xf'),_0x40c180,_0x44473f[_0x5909('0xd')][_0x5909('0x10')]);return _0x2ffb0a(_0x44473f[_0x5909('0xd')][_0x5909('0x10')]);}else{logger['info'](_0x5909('0xf'),_0x40c180,_0x5909('0xb'));_0x2ffb0a(_0x44473f[_0x5909('0x11')][_0x5909('0x10')]);}})[_0x5909('0x12')](function(_0x1c1012){logger[_0x5909('0xd')](_0x5909('0xf'),_0x40c180,_0x1c1012);_0x167f6e(_0x1c1012);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 2c6c76d..473e109 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 _0x4e43=['update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','get','/describe','describe','show','/:id'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x4e43,0x136));var _0x34e4=function(_0x5cceb8,_0xa8e57a){_0x5cceb8=_0x5cceb8-0x0;var _0xeaf4be=_0x4e43[_0x5cceb8];return _0xeaf4be;};'use strict';var multer=require(_0x34e4('0x0'));var util=require(_0x34e4('0x1'));var path=require(_0x34e4('0x2'));var timeout=require(_0x34e4('0x3'));var express=require('express');var router=express[_0x34e4('0x4')]();var fs_extra=require(_0x34e4('0x5'));var auth=require(_0x34e4('0x6'));var interaction=require(_0x34e4('0x7'));var config=require('../../config/environment');var controller=require('./faxTransferReport.controller');router['get']('/',auth[_0x34e4('0x8')](),controller['index']);router[_0x34e4('0x9')](_0x34e4('0xa'),auth[_0x34e4('0x8')](),controller[_0x34e4('0xb')]);router[_0x34e4('0x9')]('/:id',auth[_0x34e4('0x8')](),controller[_0x34e4('0xc')]);router['post']('/',auth[_0x34e4('0x8')](),controller['create']);router['put'](_0x34e4('0xd'),auth[_0x34e4('0x8')](),controller[_0x34e4('0xe')]);router[_0x34e4('0xf')](_0x34e4('0xd'),auth['isAuthenticated'](),controller[_0x34e4('0x10')]);module[_0x34e4('0x11')]=router; \ No newline at end of file +var _0x5b83=['get','isAuthenticated','/describe','describe','show','post','create','put','/:id','update','exports','multer','util','connect-timeout','express','Router','../../config/environment'];(function(_0x2f5dad,_0x4313ad){var _0x38e02d=function(_0x44833a){while(--_0x44833a){_0x2f5dad['push'](_0x2f5dad['shift']());}};_0x38e02d(++_0x4313ad);}(_0x5b83,0x1d6));var _0x35b8=function(_0x23bafb,_0x19ec56){_0x23bafb=_0x23bafb-0x0;var _0x3ee101=_0x5b83[_0x23bafb];return _0x3ee101;};'use strict';var multer=require(_0x35b8('0x0'));var util=require(_0x35b8('0x1'));var path=require('path');var timeout=require(_0x35b8('0x2'));var express=require(_0x35b8('0x3'));var router=express[_0x35b8('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x35b8('0x5'));var controller=require('./faxTransferReport.controller');router[_0x35b8('0x6')]('/',auth[_0x35b8('0x7')](),controller['index']);router[_0x35b8('0x6')](_0x35b8('0x8'),auth[_0x35b8('0x7')](),controller[_0x35b8('0x9')]);router['get']('/:id',auth[_0x35b8('0x7')](),controller[_0x35b8('0xa')]);router[_0x35b8('0xb')]('/',auth[_0x35b8('0x7')](),controller[_0x35b8('0xc')]);router[_0x35b8('0xd')](_0x35b8('0xe'),auth[_0x35b8('0x7')](),controller[_0x35b8('0xf')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x35b8('0x10')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index 2dfa87d..c283557 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 _0x530d=['update','delete','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','put'];(function(_0x2d522d,_0x290cab){var _0x421e6f=function(_0x5d5932){while(--_0x5d5932){_0x2d522d['push'](_0x2d522d['shift']());}};_0x421e6f(++_0x290cab);}(_0x530d,0x167));var _0xd530=function(_0x2d4001,_0x3d6714){_0x2d4001=_0x2d4001-0x0;var _0x156401=_0x530d[_0x2d4001];return _0x156401;};'use strict';var multer=require('multer');var util=require(_0xd530('0x0'));var path=require(_0xd530('0x1'));var timeout=require(_0xd530('0x2'));var express=require('express');var router=express[_0xd530('0x3')]();var fs_extra=require(_0xd530('0x4'));var auth=require(_0xd530('0x5'));var interaction=require(_0xd530('0x6'));var config=require('../../config/environment');var controller=require('./intDeskAccount.controller');router[_0xd530('0x7')]('/',auth[_0xd530('0x8')](),controller[_0xd530('0x9')]);router[_0xd530('0x7')](_0xd530('0xa'),auth[_0xd530('0x8')](),controller[_0xd530('0xb')]);router[_0xd530('0x7')](_0xd530('0xc'),auth[_0xd530('0x8')](),controller[_0xd530('0xd')]);router[_0xd530('0x7')](_0xd530('0xe'),auth['isAuthenticated'](),controller['getFields']);router[_0xd530('0xf')]('/',auth['isAuthenticated'](),controller[_0xd530('0x10')]);router[_0xd530('0xf')](_0xd530('0xc'),auth[_0xd530('0x8')](),controller[_0xd530('0x11')]);router[_0xd530('0x12')](_0xd530('0xa'),auth[_0xd530('0x8')](),controller[_0xd530('0x13')]);router[_0xd530('0x14')](_0xd530('0xa'),auth[_0xd530('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x9f91=['../../config/environment','get','index','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','put','/:id','update','delete','destroy','exports','util','path','fs-extra','../../components/auth/service'];(function(_0x1b5f5b,_0x275f16){var _0x195b74=function(_0x621d32){while(--_0x621d32){_0x1b5f5b['push'](_0x1b5f5b['shift']());}};_0x195b74(++_0x275f16);}(_0x9f91,0x14c));var _0x19f9=function(_0x238830,_0x545f75){_0x238830=_0x238830-0x0;var _0x5917f0=_0x9f91[_0x238830];return _0x5917f0;};'use strict';var multer=require('multer');var util=require(_0x19f9('0x0'));var path=require(_0x19f9('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x19f9('0x2'));var auth=require(_0x19f9('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x19f9('0x4'));var controller=require('./intDeskAccount.controller');router[_0x19f9('0x5')]('/',auth['isAuthenticated'](),controller[_0x19f9('0x6')]);router[_0x19f9('0x5')]('/:id',auth[_0x19f9('0x7')](),controller[_0x19f9('0x8')]);router[_0x19f9('0x5')](_0x19f9('0x9'),auth[_0x19f9('0x7')](),controller[_0x19f9('0xa')]);router[_0x19f9('0x5')](_0x19f9('0xb'),auth['isAuthenticated'](),controller[_0x19f9('0xc')]);router['post']('/',auth[_0x19f9('0x7')](),controller[_0x19f9('0xd')]);router[_0x19f9('0xe')](_0x19f9('0x9'),auth[_0x19f9('0x7')](),controller['addConfiguration']);router[_0x19f9('0xf')](_0x19f9('0x10'),auth[_0x19f9('0x7')](),controller[_0x19f9('0x11')]);router[_0x19f9('0x12')]('/:id',auth[_0x19f9('0x7')](),controller[_0x19f9('0x13')]);module[_0x19f9('0x14')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index d2bf706..2f95db1 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 _0xb968=['integrationTab','sequelize','exports','STRING','basic','ENUM'];(function(_0x58fb76,_0x2ee2b4){var _0x4289ba=function(_0x2119b2){while(--_0x2119b2){_0x58fb76['push'](_0x58fb76['shift']());}};_0x4289ba(++_0x2ee2b4);}(_0xb968,0xdf));var _0x8b96=function(_0x1893cc,_0x1086f2){_0x1893cc=_0x1893cc-0x0;var _0x3a599a=_0xb968[_0x1893cc];return _0x3a599a;};'use strict';var Sequelize=require(_0x8b96('0x0'));module[_0x8b96('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x8b96('0x2')]},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x8b96('0x2')]},'authType':{'type':Sequelize['ENUM']('basic'),'defaultValue':_0x8b96('0x3')},'password':{'type':Sequelize[_0x8b96('0x2')]},'consumerKey':{'type':Sequelize[_0x8b96('0x2')]},'consumerSecret':{'type':Sequelize[_0x8b96('0x2')]},'token':{'type':Sequelize['STRING']},'tokenSecret':{'type':Sequelize[_0x8b96('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x8b96('0x4')](_0x8b96('0x5'),'newTab'),'defaultValue':_0x8b96('0x5')}}; \ No newline at end of file +var _0x41c2=['exports','STRING','ENUM','basic','integrationTab','newTab'];(function(_0x1c8d5a,_0x176836){var _0x1517c0=function(_0xc0b05a){while(--_0xc0b05a){_0x1c8d5a['push'](_0x1c8d5a['shift']());}};_0x1517c0(++_0x176836);}(_0x41c2,0x1c2));var _0x241c=function(_0x456768,_0x372afa){_0x456768=_0x456768-0x0;var _0x139fa1=_0x41c2[_0x456768];return _0x139fa1;};'use strict';var Sequelize=require('sequelize');module[_0x241c('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x241c('0x1')]},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x241c('0x1')]},'authType':{'type':Sequelize[_0x241c('0x2')](_0x241c('0x3')),'defaultValue':_0x241c('0x3')},'password':{'type':Sequelize['STRING']},'consumerKey':{'type':Sequelize[_0x241c('0x1')]},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x241c('0x1')]},'tokenSecret':{'type':Sequelize[_0x241c('0x1')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x241c('0x4'),_0x241c('0x5')),'defaultValue':_0x241c('0x4')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 0a613a3..b3a1600 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 _0x50df=['_embedded','entries','active','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','offset','count','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','DeskAccount','type','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','options','find','create','body','getConfigurations','findOne','DeskConfiguration','addConfiguration','AccountId','Subjects','getSubjects','getDescriptions','DeskField','Descriptions','getFields','priority','remoteUri','authType','username','password','consumerKey','consumerSecret','token','tokenSecret','slice','lastIndexOf','GET','format','%s/custom_fields','application/json','Authorization','%s:%s','toString','concat'];(function(_0x3100e1,_0x26214c){var _0x56a4b1=function(_0x327389){while(--_0x327389){_0x3100e1['push'](_0x3100e1['shift']());}};_0x56a4b1(++_0x26214c);}(_0x50df,0x166));var _0xf50d=function(_0x313e6d,_0x1ae0e2){_0x313e6d=_0x313e6d-0x0;var _0x34065f=_0x50df[_0x313e6d];return _0x34065f;};'use strict';var emlformat=require(_0xf50d('0x0'));var rimraf=require(_0xf50d('0x1'));var zipdir=require(_0xf50d('0x2'));var jsonpatch=require(_0xf50d('0x3'));var rp=require(_0xf50d('0x4'));var moment=require(_0xf50d('0x5'));var BPromise=require(_0xf50d('0x6'));var Mustache=require(_0xf50d('0x7'));var util=require(_0xf50d('0x8'));var path=require(_0xf50d('0x9'));var sox=require(_0xf50d('0xa'));var csv=require(_0xf50d('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf50d('0xc'));var _=require(_0xf50d('0xd'));var squel=require(_0xf50d('0xe'));var crypto=require(_0xf50d('0xf'));var jsforce=require(_0xf50d('0x10'));var deskjs=require(_0xf50d('0x11'));var toCsv=require(_0xf50d('0xb'));var querystring=require(_0xf50d('0x12'));var Papa=require(_0xf50d('0x13'));var Redis=require(_0xf50d('0x14'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xf50d('0x15'));var hardwareService=require(_0xf50d('0x16'));var logger=require(_0xf50d('0x17'))(_0xf50d('0x18'));var utils=require(_0xf50d('0x19'));var config=require(_0xf50d('0x1a'));var licenseUtil=require(_0xf50d('0x1b'));var db=require('../../mysqldb')['db'];var integrations=require(_0xf50d('0x1c'));function respondWithStatusCode(_0x5c4f4a,_0x58e8a8){_0x58e8a8=_0x58e8a8||0xcc;return function(_0x19aadf){if(_0x19aadf){return _0x5c4f4a[_0xf50d('0x1d')](_0x58e8a8);}return _0x5c4f4a[_0xf50d('0x1e')](_0x58e8a8)[_0xf50d('0x1f')]();};}function respondWithResult(_0x264a9c,_0x199e6f){_0x199e6f=_0x199e6f||0xc8;return function(_0x1be671){if(_0x1be671){return _0x264a9c[_0xf50d('0x1e')](_0x199e6f)[_0xf50d('0x20')](_0x1be671);}};}function respondWithFilteredResult(_0x29efeb,_0x459a24){return function(_0x1ebbc5){if(_0x1ebbc5){var _0x34daad=typeof _0x459a24['offset']==='undefined'&&typeof _0x459a24['limit']==='undefined';var _0x1c38cf=_0x1ebbc5['count'];var _0x43710b=_0x34daad?0x0:_0x459a24[_0xf50d('0x21')];var _0x5c0d0a=_0x34daad?_0x1ebbc5[_0xf50d('0x22')]:_0x459a24[_0xf50d('0x21')]+_0x459a24[_0xf50d('0x23')];var _0x1fe135;if(_0x5c0d0a>=_0x1c38cf){_0x5c0d0a=_0x1c38cf;_0x1fe135=0xc8;}else{_0x1fe135=0xce;}_0x29efeb[_0xf50d('0x1e')](_0x1fe135);return _0x29efeb[_0xf50d('0x24')](_0xf50d('0x25'),_0x43710b+'-'+_0x5c0d0a+'/'+_0x1c38cf)['json'](_0x1ebbc5);}return null;};}function patchUpdates(_0x3ff66d){return function(_0x3bf239){try{jsonpatch[_0xf50d('0x26')](_0x3bf239,_0x3ff66d,!![]);}catch(_0x286ba2){return BPromise['reject'](_0x286ba2);}return _0x3bf239[_0xf50d('0x27')]();};}function saveUpdates(_0x15573f,_0x57cd4a){return function(_0x2a9e49){if(_0x2a9e49){return _0x2a9e49[_0xf50d('0x28')](_0x15573f)[_0xf50d('0x29')](function(_0x298c7c){return _0x298c7c;});}return null;};}function removeEntity(_0x5aa313,_0x375448){return function(_0xa8221c){if(_0xa8221c){return _0xa8221c[_0xf50d('0x2a')]()[_0xf50d('0x29')](function(){_0x5aa313[_0xf50d('0x1e')](0xcc)[_0xf50d('0x1f')]();});}};}function handleEntityNotFound(_0x1d3bce,_0x42b160){return function(_0x28aeca){if(!_0x28aeca){_0x1d3bce['sendStatus'](0x194);}return _0x28aeca;};}function handleError(_0x5d9964,_0x435f76){_0x435f76=_0x435f76||0x1f4;return function(_0x449fae){logger[_0xf50d('0x2b')](_0x449fae[_0xf50d('0x2c')]);if(_0x449fae['name']){delete _0x449fae[_0xf50d('0x2d')];}_0x5d9964['status'](_0x435f76)[_0xf50d('0x2e')](_0x449fae);};}exports[_0xf50d('0x2f')]=function(_0x39a2e8,_0x2ef2a6){var _0x30ae4b={},_0x148483={},_0xa507ee={'count':0x0,'rows':[]};var _0x3b4252=_[_0xf50d('0x30')](db[_0xf50d('0x31')]['rawAttributes'],function(_0x1826ae){return{'name':_0x1826ae['fieldName'],'type':_0x1826ae[_0xf50d('0x32')]['key']};});_0x148483['model']=_[_0xf50d('0x30')](_0x3b4252,_0xf50d('0x2d'));_0x148483[_0xf50d('0x33')]=_[_0xf50d('0x34')](_0x39a2e8[_0xf50d('0x33')]);_0x148483[_0xf50d('0x35')]=_['intersection'](_0x148483['model'],_0x148483[_0xf50d('0x33')]);_0x30ae4b['attributes']=_[_0xf50d('0x36')](_0x148483[_0xf50d('0x37')],qs[_0xf50d('0x38')](_0x39a2e8[_0xf50d('0x33')][_0xf50d('0x38')]));_0x30ae4b[_0xf50d('0x39')]=_0x30ae4b[_0xf50d('0x39')]['length']?_0x30ae4b['attributes']:_0x148483['model'];if(!_0x39a2e8[_0xf50d('0x33')][_0xf50d('0x3a')](_0xf50d('0x3b'))){_0x30ae4b['limit']=qs[_0xf50d('0x23')](_0x39a2e8[_0xf50d('0x33')][_0xf50d('0x23')]);_0x30ae4b['offset']=qs[_0xf50d('0x21')](_0x39a2e8['query'][_0xf50d('0x21')]);}_0x30ae4b[_0xf50d('0x3c')]=qs[_0xf50d('0x3d')](_0x39a2e8[_0xf50d('0x33')][_0xf50d('0x3d')]);_0x30ae4b['where']=qs[_0xf50d('0x35')](_[_0xf50d('0x3e')](_0x39a2e8['query'],_0x148483['filters']),_0x3b4252);if(_0x39a2e8[_0xf50d('0x33')]['filter']){_0x30ae4b[_0xf50d('0x3f')]=_[_0xf50d('0x40')](_0x30ae4b[_0xf50d('0x3f')],{'$or':_[_0xf50d('0x30')](_0x3b4252,function(_0x1ac69d){if(_0x1ac69d[_0xf50d('0x32')]!==_0xf50d('0x41')){var _0x3f2cbc={};_0x3f2cbc[_0x1ac69d[_0xf50d('0x2d')]]={'$like':'%'+_0x39a2e8['query'][_0xf50d('0x42')]+'%'};return _0x3f2cbc;}})});}_0x30ae4b=_[_0xf50d('0x40')]({},_0x30ae4b,_0x39a2e8['options']);var _0x27b304={'where':_0x30ae4b['where']};return db[_0xf50d('0x31')][_0xf50d('0x22')](_0x27b304)[_0xf50d('0x29')](function(_0x9fce67){_0xa507ee[_0xf50d('0x22')]=_0x9fce67;if(_0x39a2e8[_0xf50d('0x33')][_0xf50d('0x43')]){_0x30ae4b[_0xf50d('0x44')]=[{'all':!![]}];}return db[_0xf50d('0x31')][_0xf50d('0x45')](_0x30ae4b);})[_0xf50d('0x29')](function(_0xa30c6){_0xa507ee[_0xf50d('0x46')]=_0xa30c6;return _0xa507ee;})[_0xf50d('0x29')](respondWithFilteredResult(_0x2ef2a6,_0x30ae4b))[_0xf50d('0x47')](handleError(_0x2ef2a6,null));};exports[_0xf50d('0x48')]=function(_0x167512,_0x40e613){var _0x40a19a={'raw':![],'where':{'id':_0x167512[_0xf50d('0x49')]['id']}},_0x57cd92={};_0x57cd92[_0xf50d('0x37')]=_[_0xf50d('0x34')](db['DeskAccount'][_0xf50d('0x4a')]);_0x57cd92[_0xf50d('0x33')]=_[_0xf50d('0x34')](_0x167512[_0xf50d('0x33')]);_0x57cd92[_0xf50d('0x35')]=_['intersection'](_0x57cd92['model'],_0x57cd92[_0xf50d('0x33')]);_0x40a19a[_0xf50d('0x39')]=_[_0xf50d('0x36')](_0x57cd92['model'],qs['fields'](_0x167512['query']['fields']));_0x40a19a[_0xf50d('0x39')]=_0x40a19a[_0xf50d('0x39')][_0xf50d('0x4b')]?_0x40a19a[_0xf50d('0x39')]:_0x57cd92[_0xf50d('0x37')];if(_0x167512[_0xf50d('0x33')]['includeAll']){_0x40a19a[_0xf50d('0x44')]=[{'all':!![]}];}_0x40a19a=_[_0xf50d('0x40')]({},_0x40a19a,_0x167512[_0xf50d('0x4c')]);return db['DeskAccount'][_0xf50d('0x4d')](_0x40a19a)['then'](handleEntityNotFound(_0x40e613,null))[_0xf50d('0x29')](respondWithResult(_0x40e613,null))[_0xf50d('0x47')](handleError(_0x40e613,null));};exports[_0xf50d('0x4e')]=function(_0x564d7b,_0x404cc0){return db[_0xf50d('0x31')][_0xf50d('0x4e')](_0x564d7b[_0xf50d('0x4f')],{})[_0xf50d('0x29')](respondWithResult(_0x404cc0,0xc9))['catch'](handleError(_0x404cc0,null));};exports['update']=function(_0xaaaf79,_0x47dba9){if(_0xaaaf79['body']['id']){delete _0xaaaf79[_0xf50d('0x4f')]['id'];}return db['DeskAccount']['find']({'where':{'id':_0xaaaf79[_0xf50d('0x49')]['id']}})[_0xf50d('0x29')](handleEntityNotFound(_0x47dba9,null))['then'](saveUpdates(_0xaaaf79['body'],null))['then'](respondWithResult(_0x47dba9,null))[_0xf50d('0x47')](handleError(_0x47dba9,null));};exports[_0xf50d('0x2a')]=function(_0x318f4c,_0x879d6){return db[_0xf50d('0x31')][_0xf50d('0x4d')]({'where':{'id':_0x318f4c[_0xf50d('0x49')]['id']}})[_0xf50d('0x29')](handleEntityNotFound(_0x879d6,null))[_0xf50d('0x29')](removeEntity(_0x879d6,null))[_0xf50d('0x47')](handleError(_0x879d6,null));};exports[_0xf50d('0x50')]=function(_0x52a03d,_0x2b5ebe,_0x506a6c){var _0x5c35c3={};var _0x801f58={};var _0x3764c3;var _0x1f5c7a;return db[_0xf50d('0x31')][_0xf50d('0x51')]({'where':{'id':_0x52a03d[_0xf50d('0x49')]['id']}})[_0xf50d('0x29')](handleEntityNotFound(_0x2b5ebe,null))['then'](function(_0x7b2aa2){if(_0x7b2aa2){_0x3764c3=_0x7b2aa2;_0x801f58[_0xf50d('0x37')]=_[_0xf50d('0x34')](db[_0xf50d('0x52')][_0xf50d('0x4a')]);_0x801f58['query']=_[_0xf50d('0x34')](_0x52a03d[_0xf50d('0x33')]);_0x801f58[_0xf50d('0x35')]=_[_0xf50d('0x36')](_0x801f58[_0xf50d('0x37')],_0x801f58[_0xf50d('0x33')]);_0x5c35c3[_0xf50d('0x39')]=_[_0xf50d('0x36')](_0x801f58[_0xf50d('0x37')],qs[_0xf50d('0x38')](_0x52a03d['query'][_0xf50d('0x38')]));_0x5c35c3[_0xf50d('0x39')]=_0x5c35c3[_0xf50d('0x39')][_0xf50d('0x4b')]?_0x5c35c3[_0xf50d('0x39')]:_0x801f58['model'];_0x5c35c3[_0xf50d('0x3c')]=qs['sort'](_0x52a03d[_0xf50d('0x33')][_0xf50d('0x3d')]);_0x5c35c3[_0xf50d('0x3f')]=qs[_0xf50d('0x35')](_['pick'](_0x52a03d['query'],_0x801f58['filters']));if(_0x52a03d[_0xf50d('0x33')][_0xf50d('0x42')]){_0x5c35c3['where']=_[_0xf50d('0x40')](_0x5c35c3[_0xf50d('0x3f')],{'$or':_[_0xf50d('0x30')](_0x5c35c3[_0xf50d('0x39')],function(_0x5feed0){var _0x15a297={};_0x15a297[_0x5feed0]={'$like':'%'+_0x52a03d[_0xf50d('0x33')]['filter']+'%'};return _0x15a297;})});}_0x5c35c3=_[_0xf50d('0x40')]({},_0x5c35c3,_0x52a03d[_0xf50d('0x4c')]);return _0x3764c3[_0xf50d('0x50')](_0x5c35c3);}})['then'](function(_0x317fa7){if(_0x317fa7){_0x1f5c7a=_0x317fa7[_0xf50d('0x4b')];if(!_0x52a03d[_0xf50d('0x33')][_0xf50d('0x3a')](_0xf50d('0x3b'))){_0x5c35c3[_0xf50d('0x23')]=qs[_0xf50d('0x23')](_0x52a03d['query']['limit']);_0x5c35c3[_0xf50d('0x21')]=qs[_0xf50d('0x21')](_0x52a03d['query'][_0xf50d('0x21')]);}return _0x3764c3[_0xf50d('0x50')](_0x5c35c3);}})[_0xf50d('0x29')](function(_0x29f5e6){if(_0x29f5e6){return _0x29f5e6?{'count':_0x1f5c7a,'rows':_0x29f5e6}:null;}})[_0xf50d('0x29')](respondWithResult(_0x2b5ebe,null))[_0xf50d('0x47')](handleError(_0x2b5ebe,null));};exports[_0xf50d('0x53')]=function(_0x413751,_0x3be5f0,_0x2a7dd1){if(_0x413751[_0xf50d('0x4f')]['id']){delete _0x413751[_0xf50d('0x4f')]['id'];}return db[_0xf50d('0x31')][_0xf50d('0x51')]({'where':{'id':_0x413751[_0xf50d('0x49')]['id']}})[_0xf50d('0x29')](handleEntityNotFound(_0x3be5f0,null))[_0xf50d('0x29')](function(_0x321359){if(_0x321359){_0x413751[_0xf50d('0x4f')][_0xf50d('0x54')]=_0x321359['id'];_0x413751['body'][_0xf50d('0x55')]=integrations[_0xf50d('0x56')](_0x413751[_0xf50d('0x4f')]['channel'],_0x413751[_0xf50d('0x4f')][_0xf50d('0x32')]);_0x413751[_0xf50d('0x4f')]['Descriptions']=integrations[_0xf50d('0x57')](_0x413751[_0xf50d('0x4f')]['channel'],_0x413751[_0xf50d('0x4f')]['type']);return db[_0xf50d('0x52')][_0xf50d('0x4e')](_0x413751[_0xf50d('0x4f')],{'include':[{'model':db[_0xf50d('0x58')],'as':_0xf50d('0x55')},{'model':db[_0xf50d('0x58')],'as':_0xf50d('0x59')}]});}return null;})['then'](respondWithResult(_0x3be5f0,null))['catch'](handleError(_0x3be5f0,null));};exports[_0xf50d('0x5a')]=function(_0x5f0b9b,_0x326a36,_0x1984d2){var _0x416e69=[{'name':_0xf50d('0x5b'),'label':_0xf50d('0x5b'),'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 _0x4e9199='';return db[_0xf50d('0x31')][_0xf50d('0x51')]({'where':{'id':_0x5f0b9b[_0xf50d('0x49')]['id']},'attributes':['id',_0xf50d('0x5c'),_0xf50d('0x5d'),_0xf50d('0x5e'),_0xf50d('0x5f'),_0xf50d('0x60'),_0xf50d('0x61'),_0xf50d('0x62'),_0xf50d('0x63')]})[_0xf50d('0x29')](handleEntityNotFound(_0x326a36,null))['then'](function(_0x5b1735){if(_0x5b1735){_0x4e9199=_0x5b1735[_0xf50d('0x5c')];var _0x467225=_0x4e9199[_0xf50d('0x64')](-0x1);if(_0x467225==='/'){_0x4e9199=_0x4e9199['substring'](0x0,_0x4e9199[_0xf50d('0x65')](_0x467225));}var _0x4243f2={'method':_0xf50d('0x66'),'uri':util[_0xf50d('0x67')](_0xf50d('0x68'),_0x4e9199),'headers':{'Content-Type':_0xf50d('0x69'),'Accept':_0xf50d('0x69')},'json':!![]};if(_0x5b1735[_0xf50d('0x5d')]==='basic'){_0x4243f2['headers'][_0xf50d('0x6a')]=util[_0xf50d('0x67')]('Basic\x20%s',new Buffer(util[_0xf50d('0x67')](_0xf50d('0x6b'),_0x5b1735[_0xf50d('0x5e')],_0x5b1735['password']))[_0xf50d('0x6c')]('base64'));}return rp(_0x4243f2)[_0xf50d('0x29')](function(_0x17ecf0){return _0x416e69[_0xf50d('0x6d')](_[_0xf50d('0x30')](_0x17ecf0[_0xf50d('0x6e')][_0xf50d('0x6f')],function(_0x16565c){return{'id':_0x16565c[_0xf50d('0x2d')],'name':_0x16565c[_0xf50d('0x2d')],'type':_0x16565c['type'],'active':_0x16565c[_0xf50d('0x70')],'label':_0x16565c['label'],'custom':!![]};}));});}})[_0xf50d('0x29')](function(_0x1d14d0){return{'count':_0x1d14d0[_0xf50d('0x4b')],'rows':_0x1d14d0};})[_0xf50d('0x29')](respondWithResult(_0x326a36,null))['catch'](function(_0x54a16b){var _0x305114=_0x5f0b9b[_0xf50d('0x33')]['test']?0x1f4:_0x54a16b['statusCode']||0x1f4;logger[_0xf50d('0x2b')](_0xf50d('0x71'),_0xf50d('0x5a'),_0x305114,JSON[_0xf50d('0x72')](_0x54a16b));delete _0x54a16b[_0xf50d('0x2d')];if(_0x305114===0x191){_0x305114=0x190;}_0x326a36[_0xf50d('0x1e')](_0x305114)[_0xf50d('0x2e')](_0x5f0b9b['query']['test']?{'message':_0xf50d('0x73'),'statusCode':_0x54a16b[_0xf50d('0x74')]}:_0x54a16b);});}; \ No newline at end of file +var _0x545f=['fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','DeskAccount','findAll','rows','show','params','rawAttributes','length','includeAll','catch','create','body','find','getConfigurations','DeskConfiguration','findOne','Subjects','getSubjects','channel','type','Descriptions','getDescriptions','DeskField','priority','remoteUri','authType','username','password','consumerSecret','token','tokenSecret','slice','substring','lastIndexOf','GET','format','application/json','basic','headers','Basic\x20%s','toString','concat','_embedded','active','label','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','destroy','error','name','send','map','key','model','query','keys','filters','attributes','intersection'];(function(_0x4a5a5d,_0x146aa6){var _0xea850d=function(_0x11583b){while(--_0x11583b){_0x4a5a5d['push'](_0x4a5a5d['shift']());}};_0xea850d(++_0x146aa6);}(_0x545f,0xac));var _0xf545=function(_0x30faec,_0x18940b){_0x30faec=_0x30faec-0x0;var _0x29484f=_0x545f[_0x30faec];return _0x29484f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf545('0x0'));var zipdir=require(_0xf545('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xf545('0x2'));var BPromise=require(_0xf545('0x3'));var Mustache=require(_0xf545('0x4'));var util=require(_0xf545('0x5'));var path=require(_0xf545('0x6'));var sox=require(_0xf545('0x7'));var csv=require(_0xf545('0x8'));var ejs=require(_0xf545('0x9'));var fs=require('fs');var fs_extra=require(_0xf545('0xa'));var _=require(_0xf545('0xb'));var squel=require(_0xf545('0xc'));var crypto=require(_0xf545('0xd'));var jsforce=require(_0xf545('0xe'));var deskjs=require(_0xf545('0xf'));var toCsv=require(_0xf545('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf545('0x10'));var authService=require(_0xf545('0x11'));var qs=require(_0xf545('0x12'));var as=require(_0xf545('0x13'));var hardwareService=require(_0xf545('0x14'));var logger=require(_0xf545('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xf545('0x16'));var licenseUtil=require(_0xf545('0x17'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x14bee0,_0x179f8b){_0x179f8b=_0x179f8b||0xcc;return function(_0x5d73c2){if(_0x5d73c2){return _0x14bee0[_0xf545('0x18')](_0x179f8b);}return _0x14bee0[_0xf545('0x19')](_0x179f8b)[_0xf545('0x1a')]();};}function respondWithResult(_0x272a32,_0x1b64b7){_0x1b64b7=_0x1b64b7||0xc8;return function(_0x324e7d){if(_0x324e7d){return _0x272a32[_0xf545('0x19')](_0x1b64b7)[_0xf545('0x1b')](_0x324e7d);}};}function respondWithFilteredResult(_0x26a34a,_0x578e92){return function(_0x23ac57){if(_0x23ac57){var _0x21fedb=typeof _0x578e92[_0xf545('0x1c')]==='undefined'&&typeof _0x578e92[_0xf545('0x1d')]===_0xf545('0x1e');var _0x2bb17a=_0x23ac57[_0xf545('0x1f')];var _0x1a5d9b=_0x21fedb?0x0:_0x578e92[_0xf545('0x1c')];var _0x1fed33=_0x21fedb?_0x23ac57[_0xf545('0x1f')]:_0x578e92[_0xf545('0x1c')]+_0x578e92[_0xf545('0x1d')];var _0x4ac2c5;if(_0x1fed33>=_0x2bb17a){_0x1fed33=_0x2bb17a;_0x4ac2c5=0xc8;}else{_0x4ac2c5=0xce;}_0x26a34a['status'](_0x4ac2c5);return _0x26a34a[_0xf545('0x20')](_0xf545('0x21'),_0x1a5d9b+'-'+_0x1fed33+'/'+_0x2bb17a)['json'](_0x23ac57);}return null;};}function patchUpdates(_0x33be58){return function(_0xdff66b){try{jsonpatch[_0xf545('0x22')](_0xdff66b,_0x33be58,!![]);}catch(_0x39d6f5){return BPromise['reject'](_0x39d6f5);}return _0xdff66b[_0xf545('0x23')]();};}function saveUpdates(_0x14185d,_0x2b0003){return function(_0x4b4253){if(_0x4b4253){return _0x4b4253[_0xf545('0x24')](_0x14185d)[_0xf545('0x25')](function(_0x166b16){return _0x166b16;});}return null;};}function removeEntity(_0x86a2a2,_0x54c007){return function(_0x56a2f6){if(_0x56a2f6){return _0x56a2f6[_0xf545('0x26')]()['then'](function(){_0x86a2a2[_0xf545('0x19')](0xcc)[_0xf545('0x1a')]();});}};}function handleEntityNotFound(_0x545576,_0x124451){return function(_0x1320b0){if(!_0x1320b0){_0x545576[_0xf545('0x18')](0x194);}return _0x1320b0;};}function handleError(_0x9358ea,_0x1802c1){_0x1802c1=_0x1802c1||0x1f4;return function(_0x3a0345){logger[_0xf545('0x27')](_0x3a0345['stack']);if(_0x3a0345['name']){delete _0x3a0345[_0xf545('0x28')];}_0x9358ea[_0xf545('0x19')](_0x1802c1)[_0xf545('0x29')](_0x3a0345);};}exports['index']=function(_0x53801c,_0x281ea8){var _0x3d8002={},_0xc3ebd7={},_0x5414cf={'count':0x0,'rows':[]};var _0x1405eb=_[_0xf545('0x2a')](db['DeskAccount']['rawAttributes'],function(_0x2f9861){return{'name':_0x2f9861['fieldName'],'type':_0x2f9861['type'][_0xf545('0x2b')]};});_0xc3ebd7[_0xf545('0x2c')]=_['map'](_0x1405eb,'name');_0xc3ebd7[_0xf545('0x2d')]=_[_0xf545('0x2e')](_0x53801c[_0xf545('0x2d')]);_0xc3ebd7[_0xf545('0x2f')]=_['intersection'](_0xc3ebd7[_0xf545('0x2c')],_0xc3ebd7['query']);_0x3d8002[_0xf545('0x30')]=_[_0xf545('0x31')](_0xc3ebd7[_0xf545('0x2c')],qs[_0xf545('0x32')](_0x53801c[_0xf545('0x2d')][_0xf545('0x32')]));_0x3d8002['attributes']=_0x3d8002['attributes']['length']?_0x3d8002[_0xf545('0x30')]:_0xc3ebd7[_0xf545('0x2c')];if(!_0x53801c[_0xf545('0x2d')][_0xf545('0x33')](_0xf545('0x34'))){_0x3d8002[_0xf545('0x1d')]=qs[_0xf545('0x1d')](_0x53801c['query']['limit']);_0x3d8002['offset']=qs[_0xf545('0x1c')](_0x53801c[_0xf545('0x2d')][_0xf545('0x1c')]);}_0x3d8002[_0xf545('0x35')]=qs['sort'](_0x53801c[_0xf545('0x2d')][_0xf545('0x36')]);_0x3d8002[_0xf545('0x37')]=qs['filters'](_[_0xf545('0x38')](_0x53801c[_0xf545('0x2d')],_0xc3ebd7[_0xf545('0x2f')]),_0x1405eb);if(_0x53801c['query'][_0xf545('0x39')]){_0x3d8002[_0xf545('0x37')]=_[_0xf545('0x3a')](_0x3d8002[_0xf545('0x37')],{'$or':_[_0xf545('0x2a')](_0x1405eb,function(_0x2adee5){if(_0x2adee5['type']!==_0xf545('0x3b')){var _0x45afb2={};_0x45afb2[_0x2adee5[_0xf545('0x28')]]={'$like':'%'+_0x53801c[_0xf545('0x2d')][_0xf545('0x39')]+'%'};return _0x45afb2;}})});}_0x3d8002=_[_0xf545('0x3a')]({},_0x3d8002,_0x53801c[_0xf545('0x3c')]);var _0x3c72f9={'where':_0x3d8002[_0xf545('0x37')]};return db['DeskAccount'][_0xf545('0x1f')](_0x3c72f9)['then'](function(_0x16a209){_0x5414cf[_0xf545('0x1f')]=_0x16a209;if(_0x53801c['query']['includeAll']){_0x3d8002[_0xf545('0x3d')]=[{'all':!![]}];}return db[_0xf545('0x3e')][_0xf545('0x3f')](_0x3d8002);})[_0xf545('0x25')](function(_0x2045bd){_0x5414cf[_0xf545('0x40')]=_0x2045bd;return _0x5414cf;})[_0xf545('0x25')](respondWithFilteredResult(_0x281ea8,_0x3d8002))['catch'](handleError(_0x281ea8,null));};exports[_0xf545('0x41')]=function(_0x501ba4,_0x5d9119){var _0xc788b8={'raw':![],'where':{'id':_0x501ba4[_0xf545('0x42')]['id']}},_0x5d62e3={};_0x5d62e3[_0xf545('0x2c')]=_[_0xf545('0x2e')](db['DeskAccount'][_0xf545('0x43')]);_0x5d62e3[_0xf545('0x2d')]=_['keys'](_0x501ba4['query']);_0x5d62e3[_0xf545('0x2f')]=_['intersection'](_0x5d62e3[_0xf545('0x2c')],_0x5d62e3[_0xf545('0x2d')]);_0xc788b8['attributes']=_[_0xf545('0x31')](_0x5d62e3[_0xf545('0x2c')],qs[_0xf545('0x32')](_0x501ba4[_0xf545('0x2d')][_0xf545('0x32')]));_0xc788b8[_0xf545('0x30')]=_0xc788b8[_0xf545('0x30')][_0xf545('0x44')]?_0xc788b8[_0xf545('0x30')]:_0x5d62e3[_0xf545('0x2c')];if(_0x501ba4[_0xf545('0x2d')][_0xf545('0x45')]){_0xc788b8['include']=[{'all':!![]}];}_0xc788b8=_[_0xf545('0x3a')]({},_0xc788b8,_0x501ba4['options']);return db['DeskAccount']['find'](_0xc788b8)[_0xf545('0x25')](handleEntityNotFound(_0x5d9119,null))[_0xf545('0x25')](respondWithResult(_0x5d9119,null))[_0xf545('0x46')](handleError(_0x5d9119,null));};exports[_0xf545('0x47')]=function(_0x27f388,_0x251193){return db[_0xf545('0x3e')]['create'](_0x27f388[_0xf545('0x48')],{})['then'](respondWithResult(_0x251193,0xc9))[_0xf545('0x46')](handleError(_0x251193,null));};exports[_0xf545('0x24')]=function(_0x483b4a,_0x488f95){if(_0x483b4a['body']['id']){delete _0x483b4a[_0xf545('0x48')]['id'];}return db[_0xf545('0x3e')][_0xf545('0x49')]({'where':{'id':_0x483b4a[_0xf545('0x42')]['id']}})[_0xf545('0x25')](handleEntityNotFound(_0x488f95,null))[_0xf545('0x25')](saveUpdates(_0x483b4a[_0xf545('0x48')],null))[_0xf545('0x25')](respondWithResult(_0x488f95,null))[_0xf545('0x46')](handleError(_0x488f95,null));};exports[_0xf545('0x26')]=function(_0x1fa6f5,_0x5120dd){return db['DeskAccount']['find']({'where':{'id':_0x1fa6f5['params']['id']}})[_0xf545('0x25')](handleEntityNotFound(_0x5120dd,null))[_0xf545('0x25')](removeEntity(_0x5120dd,null))[_0xf545('0x46')](handleError(_0x5120dd,null));};exports[_0xf545('0x4a')]=function(_0x2c5118,_0x40aac1,_0x3b7b54){var _0x33f71d={};var _0x3bf6e7={};var _0x275ff5;var _0xc2af2c;return db[_0xf545('0x3e')]['findOne']({'where':{'id':_0x2c5118[_0xf545('0x42')]['id']}})[_0xf545('0x25')](handleEntityNotFound(_0x40aac1,null))[_0xf545('0x25')](function(_0x4e62aa){if(_0x4e62aa){_0x275ff5=_0x4e62aa;_0x3bf6e7['model']=_['keys'](db[_0xf545('0x4b')]['rawAttributes']);_0x3bf6e7['query']=_[_0xf545('0x2e')](_0x2c5118['query']);_0x3bf6e7[_0xf545('0x2f')]=_[_0xf545('0x31')](_0x3bf6e7[_0xf545('0x2c')],_0x3bf6e7[_0xf545('0x2d')]);_0x33f71d['attributes']=_[_0xf545('0x31')](_0x3bf6e7['model'],qs[_0xf545('0x32')](_0x2c5118[_0xf545('0x2d')]['fields']));_0x33f71d[_0xf545('0x30')]=_0x33f71d['attributes'][_0xf545('0x44')]?_0x33f71d['attributes']:_0x3bf6e7[_0xf545('0x2c')];_0x33f71d['order']=qs[_0xf545('0x36')](_0x2c5118[_0xf545('0x2d')][_0xf545('0x36')]);_0x33f71d['where']=qs['filters'](_[_0xf545('0x38')](_0x2c5118[_0xf545('0x2d')],_0x3bf6e7[_0xf545('0x2f')]));if(_0x2c5118[_0xf545('0x2d')][_0xf545('0x39')]){_0x33f71d['where']=_[_0xf545('0x3a')](_0x33f71d[_0xf545('0x37')],{'$or':_[_0xf545('0x2a')](_0x33f71d[_0xf545('0x30')],function(_0x41e1c){var _0x3397a4={};_0x3397a4[_0x41e1c]={'$like':'%'+_0x2c5118[_0xf545('0x2d')][_0xf545('0x39')]+'%'};return _0x3397a4;})});}_0x33f71d=_[_0xf545('0x3a')]({},_0x33f71d,_0x2c5118[_0xf545('0x3c')]);return _0x275ff5[_0xf545('0x4a')](_0x33f71d);}})[_0xf545('0x25')](function(_0x8aae49){if(_0x8aae49){_0xc2af2c=_0x8aae49[_0xf545('0x44')];if(!_0x2c5118['query']['hasOwnProperty'](_0xf545('0x34'))){_0x33f71d[_0xf545('0x1d')]=qs[_0xf545('0x1d')](_0x2c5118[_0xf545('0x2d')][_0xf545('0x1d')]);_0x33f71d[_0xf545('0x1c')]=qs[_0xf545('0x1c')](_0x2c5118[_0xf545('0x2d')][_0xf545('0x1c')]);}return _0x275ff5[_0xf545('0x4a')](_0x33f71d);}})[_0xf545('0x25')](function(_0x3e3307){if(_0x3e3307){return _0x3e3307?{'count':_0xc2af2c,'rows':_0x3e3307}:null;}})[_0xf545('0x25')](respondWithResult(_0x40aac1,null))['catch'](handleError(_0x40aac1,null));};exports['addConfiguration']=function(_0x100a71,_0x3215b2,_0x27c039){if(_0x100a71[_0xf545('0x48')]['id']){delete _0x100a71['body']['id'];}return db[_0xf545('0x3e')][_0xf545('0x4c')]({'where':{'id':_0x100a71[_0xf545('0x42')]['id']}})[_0xf545('0x25')](handleEntityNotFound(_0x3215b2,null))[_0xf545('0x25')](function(_0x286cd7){if(_0x286cd7){_0x100a71[_0xf545('0x48')]['AccountId']=_0x286cd7['id'];_0x100a71[_0xf545('0x48')][_0xf545('0x4d')]=integrations[_0xf545('0x4e')](_0x100a71['body'][_0xf545('0x4f')],_0x100a71[_0xf545('0x48')][_0xf545('0x50')]);_0x100a71[_0xf545('0x48')][_0xf545('0x51')]=integrations[_0xf545('0x52')](_0x100a71['body'][_0xf545('0x4f')],_0x100a71[_0xf545('0x48')][_0xf545('0x50')]);return db[_0xf545('0x4b')]['create'](_0x100a71[_0xf545('0x48')],{'include':[{'model':db[_0xf545('0x53')],'as':_0xf545('0x4d')},{'model':db[_0xf545('0x53')],'as':_0xf545('0x51')}]});}return null;})[_0xf545('0x25')](respondWithResult(_0x3215b2,null))[_0xf545('0x46')](handleError(_0x3215b2,null));};exports['getFields']=function(_0x2ebc81,_0x5a4d4a,_0x5c5d22){var _0x1ab75f=[{'name':_0xf545('0x54'),'label':_0xf545('0x54'),'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 _0xe08298='';return db['DeskAccount'][_0xf545('0x4c')]({'where':{'id':_0x2ebc81['params']['id']},'attributes':['id',_0xf545('0x55'),_0xf545('0x56'),_0xf545('0x57'),_0xf545('0x58'),'consumerKey',_0xf545('0x59'),_0xf545('0x5a'),_0xf545('0x5b')]})['then'](handleEntityNotFound(_0x5a4d4a,null))[_0xf545('0x25')](function(_0x52f631){if(_0x52f631){_0xe08298=_0x52f631[_0xf545('0x55')];var _0x1a03cc=_0xe08298[_0xf545('0x5c')](-0x1);if(_0x1a03cc==='/'){_0xe08298=_0xe08298[_0xf545('0x5d')](0x0,_0xe08298[_0xf545('0x5e')](_0x1a03cc));}var _0x223d75={'method':_0xf545('0x5f'),'uri':util[_0xf545('0x60')]('%s/custom_fields',_0xe08298),'headers':{'Content-Type':_0xf545('0x61'),'Accept':'application/json'},'json':!![]};if(_0x52f631[_0xf545('0x56')]===_0xf545('0x62')){_0x223d75[_0xf545('0x63')]['Authorization']=util['format'](_0xf545('0x64'),new Buffer(util['format']('%s:%s',_0x52f631[_0xf545('0x57')],_0x52f631[_0xf545('0x58')]))[_0xf545('0x65')]('base64'));}return rp(_0x223d75)[_0xf545('0x25')](function(_0x20c4d1){return _0x1ab75f[_0xf545('0x66')](_[_0xf545('0x2a')](_0x20c4d1[_0xf545('0x67')]['entries'],function(_0xd99de4){return{'id':_0xd99de4[_0xf545('0x28')],'name':_0xd99de4[_0xf545('0x28')],'type':_0xd99de4[_0xf545('0x50')],'active':_0xd99de4[_0xf545('0x68')],'label':_0xd99de4[_0xf545('0x69')],'custom':!![]};}));});}})['then'](function(_0x59270b){return{'count':_0x59270b[_0xf545('0x44')],'rows':_0x59270b};})[_0xf545('0x25')](respondWithResult(_0x5a4d4a,null))[_0xf545('0x46')](function(_0xe336fd){var _0x10796f=_0x2ebc81[_0xf545('0x2d')][_0xf545('0x6a')]?0x1f4:_0xe336fd[_0xf545('0x6b')]||0x1f4;logger[_0xf545('0x27')](_0xf545('0x6c'),_0xf545('0x6d'),_0x10796f,JSON['stringify'](_0xe336fd));delete _0xe336fd['name'];if(_0x10796f===0x191){_0x10796f=0x190;}_0x5a4d4a['status'](_0x10796f)[_0xf545('0x29')](_0x2ebc81[_0xf545('0x2d')]['test']?{'message':_0xf545('0x6e'),'statusCode':_0xe336fd[_0xf545('0x6b')]}:_0xe336fd);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 9e361e8..d788de5 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 _0x98e1=['./intDeskAccount.attributes','../../components/integrations/configuration','int_desk_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x582e21,_0x306223){var _0x49b036=function(_0x55ecde){while(--_0x55ecde){_0x582e21['push'](_0x582e21['shift']());}};_0x49b036(++_0x306223);}(_0x98e1,0x1bf));var _0x198e=function(_0x3491d7,_0x1743db){_0x3491d7=_0x3491d7-0x0;var _0x338160=_0x98e1[_0x3491d7];return _0x338160;};'use strict';var _=require(_0x198e('0x0'));var util=require(_0x198e('0x1'));var logger=require(_0x198e('0x2'))(_0x198e('0x3'));var moment=require(_0x198e('0x4'));var BPromise=require(_0x198e('0x5'));var rp=require(_0x198e('0x6'));var fs=require('fs');var path=require(_0x198e('0x7'));var rimraf=require('rimraf');var config=require(_0x198e('0x8'));var attributes=require(_0x198e('0x9'));var integrations=require(_0x198e('0xa'));module['exports']=function(_0x39309d,_0x49688b){return _0x39309d['define']('DeskAccount',attributes,{'tableName':_0x198e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc00e=['define','DeskAccount','int_desk_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x7589ab,_0x5ad429){var _0x56d958=function(_0x330a50){while(--_0x330a50){_0x7589ab['push'](_0x7589ab['shift']());}};_0x56d958(++_0x5ad429);}(_0xc00e,0x19b));var _0xec00=function(_0x5decca,_0x3543b4){_0x5decca=_0x5decca-0x0;var _0x54e3d0=_0xc00e[_0x5decca];return _0x54e3d0;};'use strict';var _=require(_0xec00('0x0'));var util=require(_0xec00('0x1'));var logger=require(_0xec00('0x2'))(_0xec00('0x3'));var moment=require(_0xec00('0x4'));var BPromise=require(_0xec00('0x5'));var rp=require(_0xec00('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xec00('0x7'));var config=require(_0xec00('0x8'));var attributes=require('./intDeskAccount.attributes');var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x43dbb7,_0x5a50f8){return _0x43dbb7[_0xec00('0x9')](_0xec00('0xa'),attributes,{'tableName':_0xec00('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.rpc.js b/server/api/intDeskAccount/intDeskAccount.rpc.js index acd1ce1..529ecfd 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 _0x0210=['rpc','jayson/promise','client','http','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','GetDeskAccount','DeskAccount','findAll','options','raw','attributes','limit','map','include','model','stringify','find','ShowDeskAccount','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x50d606,_0x41ba21){var _0x434432=function(_0x4057ef){while(--_0x4057ef){_0x50d606['push'](_0x50d606['shift']());}};_0x434432(++_0x41ba21);}(_0x0210,0xb6));var _0x0021=function(_0x38c8a7,_0x4fa0bd){_0x38c8a7=_0x38c8a7-0x0;var _0x120e0a=_0x0210[_0x38c8a7];return _0x120e0a;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0021('0x0'));var fs=require('fs');var Redis=require(_0x0021('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0x0021('0x2'));var logger=require(_0x0021('0x3'))(_0x0021('0x4'));var config=require('../../config/environment');var jayson=require(_0x0021('0x5'));var client=jayson[_0x0021('0x6')][_0x0021('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x49f828,_0x1e35c4,_0x2c2885){return new BPromise(function(_0x9956a6,_0x1b072d){return client[_0x0021('0x8')](_0x49f828,_0x2c2885)[_0x0021('0x9')](function(_0x3e47e5){logger[_0x0021('0xa')](_0x0021('0xb'),_0x1e35c4,_0x0021('0xc'));logger[_0x0021('0xd')]('DeskAccount,\x20%s,\x20%s,\x20%s',_0x1e35c4,_0x0021('0xc'),JSON['stringify'](_0x3e47e5));if(_0x3e47e5[_0x0021('0xe')]){if(_0x3e47e5[_0x0021('0xe')][_0x0021('0xf')]===0x1f4){logger[_0x0021('0xe')](_0x0021('0xb'),_0x1e35c4,_0x3e47e5['error'][_0x0021('0x10')]);return _0x1b072d(_0x3e47e5[_0x0021('0xe')][_0x0021('0x10')]);}logger['error'](_0x0021('0xb'),_0x1e35c4,_0x3e47e5[_0x0021('0xe')]['message']);return _0x9956a6(_0x3e47e5[_0x0021('0xe')]['message']);}else{logger[_0x0021('0xa')](_0x0021('0xb'),_0x1e35c4,_0x0021('0xc'));_0x9956a6(_0x3e47e5['result'][_0x0021('0x10')]);}})[_0x0021('0x11')](function(_0x3c66a9){logger['error'](_0x0021('0xb'),_0x1e35c4,_0x3c66a9);_0x1b072d(_0x3c66a9);});});}exports[_0x0021('0x12')]=function(_0x3ace3e){var _0x3c3d27=this;return new Promise(function(_0x3f3ff3,_0x1888d8){return db[_0x0021('0x13')][_0x0021('0x14')]({'raw':_0x3ace3e['options']?_0x3ace3e[_0x0021('0x15')][_0x0021('0x16')]===undefined?!![]:![]:!![],'where':_0x3ace3e[_0x0021('0x15')]?_0x3ace3e['options']['where']||null:null,'attributes':_0x3ace3e[_0x0021('0x15')]?_0x3ace3e['options'][_0x0021('0x17')]||null:null,'limit':_0x3ace3e[_0x0021('0x15')]?_0x3ace3e[_0x0021('0x15')][_0x0021('0x18')]||null:null,'include':_0x3ace3e[_0x0021('0x15')]?_0x3ace3e[_0x0021('0x15')]['include']?_[_0x0021('0x19')](_0x3ace3e[_0x0021('0x15')][_0x0021('0x1a')],function(_0x2ee0be){return{'model':db[_0x2ee0be[_0x0021('0x1b')]],'as':_0x2ee0be['as'],'attributes':_0x2ee0be[_0x0021('0x17')],'include':_0x2ee0be[_0x0021('0x1a')]?_['map'](_0x2ee0be[_0x0021('0x1a')],function(_0x12691d){return{'model':db[_0x12691d[_0x0021('0x1b')]],'as':_0x12691d['as'],'attributes':_0x12691d['attributes'],'include':_0x12691d['include']?_[_0x0021('0x19')](_0x12691d[_0x0021('0x1a')],function(_0x27d104){return{'model':db[_0x27d104['model']],'as':_0x27d104['as'],'attributes':_0x27d104['attributes']};}):[]};}):[]};}):[]:[]})[_0x0021('0x9')](function(_0x11b047){logger[_0x0021('0xa')](_0x0021('0x12'),_0x3ace3e);logger[_0x0021('0xd')](_0x0021('0x12'),_0x3ace3e,JSON[_0x0021('0x1c')](_0x11b047));_0x3f3ff3(_0x11b047);})['catch'](function(_0xe140dd){logger[_0x0021('0xe')](_0x0021('0x12'),_0xe140dd[_0x0021('0x10')],_0x3ace3e);_0x1888d8(_0x3c3d27['error'](0x1f4,_0xe140dd['message']));});});};exports['ShowDeskAccount']=function(_0x4d81e6){var _0x36e1ca=this;return new Promise(function(_0x51e2c9,_0x448b7e){return db[_0x0021('0x13')][_0x0021('0x1d')]({'raw':_0x4d81e6[_0x0021('0x15')]?_0x4d81e6[_0x0021('0x15')][_0x0021('0x16')]===undefined?!![]:![]:!![],'where':_0x4d81e6['options']?_0x4d81e6['options']['where']||null:null,'attributes':_0x4d81e6['options']?_0x4d81e6[_0x0021('0x15')]['attributes']||null:null,'include':_0x4d81e6['options']?_0x4d81e6[_0x0021('0x15')][_0x0021('0x1a')]?_[_0x0021('0x19')](_0x4d81e6[_0x0021('0x15')][_0x0021('0x1a')],function(_0x1f5956){return{'model':db[_0x1f5956['model']],'as':_0x1f5956['as'],'attributes':_0x1f5956[_0x0021('0x17')],'include':_0x1f5956['include']?_[_0x0021('0x19')](_0x1f5956[_0x0021('0x1a')],function(_0x54bd77){return{'model':db[_0x54bd77['model']],'as':_0x54bd77['as'],'attributes':_0x54bd77[_0x0021('0x17')],'include':_0x54bd77[_0x0021('0x1a')]?_[_0x0021('0x19')](_0x54bd77['include'],function(_0x584ac7){return{'model':db[_0x584ac7[_0x0021('0x1b')]],'as':_0x584ac7['as'],'attributes':_0x584ac7[_0x0021('0x17')]};}):[]};}):[]};}):[]:[]})[_0x0021('0x9')](function(_0x33d8f2){logger[_0x0021('0xa')](_0x0021('0x1e'),_0x4d81e6);logger[_0x0021('0xd')](_0x0021('0x1e'),_0x4d81e6,JSON[_0x0021('0x1c')](_0x33d8f2));_0x51e2c9(_0x33d8f2);})[_0x0021('0x11')](function(_0x13e5f6){logger['error'](_0x0021('0x1e'),_0x13e5f6[_0x0021('0x10')],_0x4d81e6);_0x448b7e(_0x36e1ca[_0x0021('0xe')](0x1f4,_0x13e5f6[_0x0021('0x10')]));});});}; \ No newline at end of file +var _0xa98f=['../../config/logger','rpc','../../config/environment','jayson/promise','http','info','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','DeskAccount,\x20%s,\x20%s','message','result','catch','GetDeskAccount','DeskAccount','options','raw','where','attributes','limit','include','map','model','then','ShowDeskAccount','lodash','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0xa98f,0x1c9));var _0xfa98=function(_0x337bee,_0x53cbca){_0x337bee=_0x337bee-0x0;var _0x24c37d=_0xa98f[_0x337bee];return _0x24c37d;};'use strict';var _=require(_0xfa98('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xfa98('0x1'));var rs=require(_0xfa98('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfa98('0x3'))['db'];var utils=require(_0xfa98('0x4'));var logger=require(_0xfa98('0x5'))(_0xfa98('0x6'));var config=require(_0xfa98('0x7'));var jayson=require(_0xfa98('0x8'));var client=jayson['client'][_0xfa98('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4875a2,_0x5a462d,_0x863df0){return new BPromise(function(_0x571924,_0x29056d){return client['request'](_0x4875a2,_0x863df0)['then'](function(_0x21a97b){logger[_0xfa98('0xa')]('DeskAccount,\x20%s,\x20%s',_0x5a462d,_0xfa98('0xb'));logger[_0xfa98('0xc')](_0xfa98('0xd'),_0x5a462d,_0xfa98('0xb'),JSON[_0xfa98('0xe')](_0x21a97b));if(_0x21a97b['error']){if(_0x21a97b[_0xfa98('0xf')][_0xfa98('0x10')]===0x1f4){logger[_0xfa98('0xf')](_0xfa98('0x11'),_0x5a462d,_0x21a97b[_0xfa98('0xf')][_0xfa98('0x12')]);return _0x29056d(_0x21a97b[_0xfa98('0xf')]['message']);}logger[_0xfa98('0xf')](_0xfa98('0x11'),_0x5a462d,_0x21a97b[_0xfa98('0xf')]['message']);return _0x571924(_0x21a97b[_0xfa98('0xf')][_0xfa98('0x12')]);}else{logger[_0xfa98('0xa')](_0xfa98('0x11'),_0x5a462d,'request\x20sent');_0x571924(_0x21a97b[_0xfa98('0x13')]['message']);}})[_0xfa98('0x14')](function(_0x28b9bb){logger[_0xfa98('0xf')](_0xfa98('0x11'),_0x5a462d,_0x28b9bb);_0x29056d(_0x28b9bb);});});}exports[_0xfa98('0x15')]=function(_0x54963d){var _0x55f8e9=this;return new Promise(function(_0x2fac2c,_0x1f5fe9){return db[_0xfa98('0x16')]['findAll']({'raw':_0x54963d[_0xfa98('0x17')]?_0x54963d[_0xfa98('0x17')][_0xfa98('0x18')]===undefined?!![]:![]:!![],'where':_0x54963d[_0xfa98('0x17')]?_0x54963d[_0xfa98('0x17')][_0xfa98('0x19')]||null:null,'attributes':_0x54963d[_0xfa98('0x17')]?_0x54963d[_0xfa98('0x17')][_0xfa98('0x1a')]||null:null,'limit':_0x54963d[_0xfa98('0x17')]?_0x54963d[_0xfa98('0x17')][_0xfa98('0x1b')]||null:null,'include':_0x54963d[_0xfa98('0x17')]?_0x54963d[_0xfa98('0x17')][_0xfa98('0x1c')]?_[_0xfa98('0x1d')](_0x54963d['options'][_0xfa98('0x1c')],function(_0x332127){return{'model':db[_0x332127[_0xfa98('0x1e')]],'as':_0x332127['as'],'attributes':_0x332127[_0xfa98('0x1a')],'include':_0x332127[_0xfa98('0x1c')]?_['map'](_0x332127[_0xfa98('0x1c')],function(_0x1b4d4f){return{'model':db[_0x1b4d4f[_0xfa98('0x1e')]],'as':_0x1b4d4f['as'],'attributes':_0x1b4d4f[_0xfa98('0x1a')],'include':_0x1b4d4f[_0xfa98('0x1c')]?_[_0xfa98('0x1d')](_0x1b4d4f['include'],function(_0x4f4d45){return{'model':db[_0x4f4d45[_0xfa98('0x1e')]],'as':_0x4f4d45['as'],'attributes':_0x4f4d45[_0xfa98('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xfa98('0x1f')](function(_0x44d6a2){logger[_0xfa98('0xa')](_0xfa98('0x15'),_0x54963d);logger['debug'](_0xfa98('0x15'),_0x54963d,JSON[_0xfa98('0xe')](_0x44d6a2));_0x2fac2c(_0x44d6a2);})['catch'](function(_0xc734d5){logger['error']('GetDeskAccount',_0xc734d5[_0xfa98('0x12')],_0x54963d);_0x1f5fe9(_0x55f8e9[_0xfa98('0xf')](0x1f4,_0xc734d5[_0xfa98('0x12')]));});});};exports[_0xfa98('0x20')]=function(_0x3f5db3){var _0x28e57a=this;return new Promise(function(_0x50ecae,_0x1b358b){return db[_0xfa98('0x16')]['find']({'raw':_0x3f5db3[_0xfa98('0x17')]?_0x3f5db3[_0xfa98('0x17')][_0xfa98('0x18')]===undefined?!![]:![]:!![],'where':_0x3f5db3['options']?_0x3f5db3[_0xfa98('0x17')][_0xfa98('0x19')]||null:null,'attributes':_0x3f5db3[_0xfa98('0x17')]?_0x3f5db3[_0xfa98('0x17')][_0xfa98('0x1a')]||null:null,'include':_0x3f5db3[_0xfa98('0x17')]?_0x3f5db3[_0xfa98('0x17')][_0xfa98('0x1c')]?_[_0xfa98('0x1d')](_0x3f5db3[_0xfa98('0x17')][_0xfa98('0x1c')],function(_0x1e3a0d){return{'model':db[_0x1e3a0d[_0xfa98('0x1e')]],'as':_0x1e3a0d['as'],'attributes':_0x1e3a0d[_0xfa98('0x1a')],'include':_0x1e3a0d[_0xfa98('0x1c')]?_[_0xfa98('0x1d')](_0x1e3a0d[_0xfa98('0x1c')],function(_0x377bab){return{'model':db[_0x377bab['model']],'as':_0x377bab['as'],'attributes':_0x377bab['attributes'],'include':_0x377bab[_0xfa98('0x1c')]?_[_0xfa98('0x1d')](_0x377bab[_0xfa98('0x1c')],function(_0x1e77de){return{'model':db[_0x1e77de['model']],'as':_0x1e77de['as'],'attributes':_0x1e77de[_0xfa98('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xfa98('0x1f')](function(_0x33815d){logger['info']('ShowDeskAccount',_0x3f5db3);logger['debug'](_0xfa98('0x20'),_0x3f5db3,JSON[_0xfa98('0xe')](_0x33815d));_0x50ecae(_0x33815d);})[_0xfa98('0x14')](function(_0x2ff98f){logger[_0xfa98('0xf')](_0xfa98('0x20'),_0x2ff98f['message'],_0x3f5db3);_0x1b358b(_0x28e57a[_0xfa98('0xf')](0x1f4,_0x2ff98f['message']));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index b85dad9..d52dbbc 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 _0xedd9=['getTags','post','create','setTags','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getSubjects','/:id/descriptions','/:id/tags'];(function(_0x4bfcaf,_0x450629){var _0x4fde81=function(_0x43162a){while(--_0x43162a){_0x4bfcaf['push'](_0x4bfcaf['shift']());}};_0x4fde81(++_0x450629);}(_0xedd9,0xfc));var _0x9edd=function(_0x1c4bc1,_0x5d552d){_0x1c4bc1=_0x1c4bc1-0x0;var _0x5a007f=_0xedd9[_0x1c4bc1];return _0x5a007f;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');var controller=require(_0x9edd('0x8'));router[_0x9edd('0x9')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xb')]);router['get'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0xd')]);router[_0x9edd('0x9')](_0x9edd('0xe'),auth[_0x9edd('0xa')](),controller['getFields']);router[_0x9edd('0x9')]('/:id/subjects',auth[_0x9edd('0xa')](),controller[_0x9edd('0xf')]);router['get'](_0x9edd('0x10'),auth[_0x9edd('0xa')](),controller['getDescriptions']);router[_0x9edd('0x9')](_0x9edd('0x11'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x12')]);router[_0x9edd('0x13')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0x14')]);router[_0x9edd('0x13')]('/:id/tags',auth[_0x9edd('0xa')](),controller[_0x9edd('0x15')]);router[_0x9edd('0x16')](_0x9edd('0xc'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x17')]);router[_0x9edd('0x18')](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0x19')]);module[_0x9edd('0x1a')]=router; \ No newline at end of file +var _0x55ca=['../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','setTags','put','/:id','update','destroy','exports','multer','util','Router','fs-extra','../../components/interaction/service'];(function(_0x105e3e,_0x4cb667){var _0x5b0125=function(_0x877866){while(--_0x877866){_0x105e3e['push'](_0x105e3e['shift']());}};_0x5b0125(++_0x4cb667);}(_0x55ca,0x126));var _0xa55c=function(_0x2610db,_0x454344){_0x2610db=_0x2610db-0x0;var _0x5d4d96=_0x55ca[_0x2610db];return _0x5d4d96;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/:id',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['getFields']);router['get'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xd')]);router[_0xa55c('0x7')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x7')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['getTags']);router['post']('/',auth[_0xa55c('0x8')](),controller['create']);router['post']('/:id/tags',auth[_0xa55c('0x8')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x13'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x14')]);router['delete'](_0xa55c('0x13'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x15')]);module[_0xa55c('0x16')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index 9edddc9..b540530 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 _0x0b98=['sequelize','exports','STRING'];(function(_0x5900b6,_0x542703){var _0x33347b=function(_0x4971d6){while(--_0x4971d6){_0x5900b6['push'](_0x5900b6['shift']());}};_0x33347b(++_0x542703);}(_0x0b98,0x7e));var _0x80b9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0b98[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x80b9('0x0'));module[_0x80b9('0x1')]={'name':{'type':Sequelize[_0x80b9('0x2')]},'description':{'type':Sequelize[_0x80b9('0x2')]}}; \ No newline at end of file +var _0x3545=['exports','STRING','sequelize'];(function(_0x295e40,_0x373e2f){var _0x20b246=function(_0x5dcd00){while(--_0x5dcd00){_0x295e40['push'](_0x295e40['shift']());}};_0x20b246(++_0x373e2f);}(_0x3545,0xef));var _0x5354=function(_0x1bc41f,_0x2e6cd7){_0x1bc41f=_0x1bc41f-0x0;var _0x1f7025=_0x3545[_0x1bc41f];return _0x1f7025;};'use strict';var Sequelize=require(_0x5354('0x0'));module[_0x5354('0x1')]={'name':{'type':Sequelize[_0x5354('0x2')]},'description':{'type':Sequelize[_0x5354('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index ee405aa..ae278eb 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 _0x6b90=['request-promise','moment','bluebird','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','set','apply','reject','save','then','status','error','stack','name','send','index','map','DeskConfiguration','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','pick','merge','VIRTUAL','where','show','params','keys','includeAll','include','options','catch','create','body','find','getFields','DeskField','filter','getSubjects','findOne','nolimit','getDescriptions','getTags','Tag','setTags','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x2a453b,_0x479c50){var _0x132f79=function(_0x5e3d83){while(--_0x5e3d83){_0x2a453b['push'](_0x2a453b['shift']());}};_0x132f79(++_0x479c50);}(_0x6b90,0x138));var _0x06b9=function(_0xdf1858,_0x5692d0){_0xdf1858=_0xdf1858-0x0;var _0x3e64f0=_0x6b90[_0xdf1858];return _0x3e64f0;};'use strict';var emlformat=require(_0x06b9('0x0'));var rimraf=require(_0x06b9('0x1'));var zipdir=require(_0x06b9('0x2'));var jsonpatch=require(_0x06b9('0x3'));var rp=require(_0x06b9('0x4'));var moment=require(_0x06b9('0x5'));var BPromise=require(_0x06b9('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x06b9('0x7'));var csv=require(_0x06b9('0x8'));var ejs=require(_0x06b9('0x9'));var fs=require('fs');var fs_extra=require(_0x06b9('0xa'));var _=require('lodash');var squel=require(_0x06b9('0xb'));var crypto=require(_0x06b9('0xc'));var jsforce=require(_0x06b9('0xd'));var deskjs=require(_0x06b9('0xe'));var toCsv=require(_0x06b9('0x8'));var querystring=require(_0x06b9('0xf'));var Papa=require(_0x06b9('0x10'));var Redis=require(_0x06b9('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x06b9('0x12'));var hardwareService=require(_0x06b9('0x13'));var logger=require(_0x06b9('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x06b9('0x15'))['db'];function respondWithStatusCode(_0x416e59,_0x519a66){_0x519a66=_0x519a66||0xcc;return function(_0x587d8c){if(_0x587d8c){return _0x416e59[_0x06b9('0x16')](_0x519a66);}return _0x416e59['status'](_0x519a66)[_0x06b9('0x17')]();};}function respondWithResult(_0x24017d,_0x330052){_0x330052=_0x330052||0xc8;return function(_0x530262){if(_0x530262){return _0x24017d['status'](_0x330052)[_0x06b9('0x18')](_0x530262);}};}function respondWithFilteredResult(_0x48385b,_0x514759){return function(_0x80e6df){if(_0x80e6df){var _0x342431=typeof _0x514759[_0x06b9('0x19')]===_0x06b9('0x1a')&&typeof _0x514759[_0x06b9('0x1b')]==='undefined';var _0x254b85=_0x80e6df['count'];var _0xcd192e=_0x342431?0x0:_0x514759['offset'];var _0xdc2a24=_0x342431?_0x80e6df[_0x06b9('0x1c')]:_0x514759[_0x06b9('0x19')]+_0x514759[_0x06b9('0x1b')];var _0x505539;if(_0xdc2a24>=_0x254b85){_0xdc2a24=_0x254b85;_0x505539=0xc8;}else{_0x505539=0xce;}_0x48385b['status'](_0x505539);return _0x48385b[_0x06b9('0x1d')]('Content-Range',_0xcd192e+'-'+_0xdc2a24+'/'+_0x254b85)[_0x06b9('0x18')](_0x80e6df);}return null;};}function patchUpdates(_0x128e4f){return function(_0x2ecd8e){try{jsonpatch[_0x06b9('0x1e')](_0x2ecd8e,_0x128e4f,!![]);}catch(_0x47d022){return BPromise[_0x06b9('0x1f')](_0x47d022);}return _0x2ecd8e[_0x06b9('0x20')]();};}function saveUpdates(_0x4adac2,_0x3d3097){return function(_0x37606f){if(_0x37606f){return _0x37606f['update'](_0x4adac2)[_0x06b9('0x21')](function(_0x5a39f6){return _0x5a39f6;});}return null;};}function removeEntity(_0x39cf8b,_0x2e3676){return function(_0x5eb41a){if(_0x5eb41a){return _0x5eb41a['destroy']()['then'](function(){_0x39cf8b[_0x06b9('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x16089d,_0x37f228){return function(_0x31cd71){if(!_0x31cd71){_0x16089d['sendStatus'](0x194);}return _0x31cd71;};}function handleError(_0x30ba75,_0x2849e7){_0x2849e7=_0x2849e7||0x1f4;return function(_0x16553c){logger[_0x06b9('0x23')](_0x16553c[_0x06b9('0x24')]);if(_0x16553c[_0x06b9('0x25')]){delete _0x16553c[_0x06b9('0x25')];}_0x30ba75['status'](_0x2849e7)[_0x06b9('0x26')](_0x16553c);};}exports[_0x06b9('0x27')]=function(_0x5795ed,_0x1e704d){var _0x16e9f6={},_0x1d3900={},_0x342e39={'count':0x0,'rows':[]};var _0x4e92ba=_[_0x06b9('0x28')](db[_0x06b9('0x29')][_0x06b9('0x2a')],function(_0x54dcae){return{'name':_0x54dcae[_0x06b9('0x2b')],'type':_0x54dcae[_0x06b9('0x2c')]['key']};});_0x1d3900[_0x06b9('0x2d')]=_[_0x06b9('0x28')](_0x4e92ba,_0x06b9('0x25'));_0x1d3900[_0x06b9('0x2e')]=_['keys'](_0x5795ed[_0x06b9('0x2e')]);_0x1d3900['filters']=_[_0x06b9('0x2f')](_0x1d3900['model'],_0x1d3900[_0x06b9('0x2e')]);_0x16e9f6[_0x06b9('0x30')]=_[_0x06b9('0x2f')](_0x1d3900[_0x06b9('0x2d')],qs[_0x06b9('0x31')](_0x5795ed[_0x06b9('0x2e')]['fields']));_0x16e9f6['attributes']=_0x16e9f6[_0x06b9('0x30')][_0x06b9('0x32')]?_0x16e9f6[_0x06b9('0x30')]:_0x1d3900[_0x06b9('0x2d')];if(!_0x5795ed[_0x06b9('0x2e')][_0x06b9('0x33')]('nolimit')){_0x16e9f6[_0x06b9('0x1b')]=qs['limit'](_0x5795ed['query'][_0x06b9('0x1b')]);_0x16e9f6['offset']=qs[_0x06b9('0x19')](_0x5795ed['query'][_0x06b9('0x19')]);}_0x16e9f6[_0x06b9('0x34')]=qs[_0x06b9('0x35')](_0x5795ed['query'][_0x06b9('0x35')]);_0x16e9f6['where']=qs[_0x06b9('0x36')](_[_0x06b9('0x37')](_0x5795ed[_0x06b9('0x2e')],_0x1d3900[_0x06b9('0x36')]),_0x4e92ba);if(_0x5795ed['query']['filter']){_0x16e9f6['where']=_[_0x06b9('0x38')](_0x16e9f6['where'],{'$or':_[_0x06b9('0x28')](_0x4e92ba,function(_0x582306){if(_0x582306['type']!==_0x06b9('0x39')){var _0x258d08={};_0x258d08[_0x582306[_0x06b9('0x25')]]={'$like':'%'+_0x5795ed['query']['filter']+'%'};return _0x258d08;}})});}_0x16e9f6=_[_0x06b9('0x38')]({},_0x16e9f6,_0x5795ed['options']);var _0xf3ecd7={'where':_0x16e9f6[_0x06b9('0x3a')]};return db[_0x06b9('0x29')]['count'](_0xf3ecd7)[_0x06b9('0x21')](function(_0x35edd4){_0x342e39['count']=_0x35edd4;if(_0x5795ed[_0x06b9('0x2e')]['includeAll']){_0x16e9f6['include']=[{'all':!![]}];}return db[_0x06b9('0x29')]['findAll'](_0x16e9f6);})['then'](function(_0x3bc573){_0x342e39['rows']=_0x3bc573;return _0x342e39;})[_0x06b9('0x21')](respondWithFilteredResult(_0x1e704d,_0x16e9f6))['catch'](handleError(_0x1e704d,null));};exports[_0x06b9('0x3b')]=function(_0x40003c,_0x2b8877){var _0x54ec33={'raw':![],'where':{'id':_0x40003c[_0x06b9('0x3c')]['id']}},_0x35c466={};_0x35c466[_0x06b9('0x2d')]=_[_0x06b9('0x3d')](db[_0x06b9('0x29')][_0x06b9('0x2a')]);_0x35c466['query']=_[_0x06b9('0x3d')](_0x40003c[_0x06b9('0x2e')]);_0x35c466[_0x06b9('0x36')]=_[_0x06b9('0x2f')](_0x35c466[_0x06b9('0x2d')],_0x35c466[_0x06b9('0x2e')]);_0x54ec33[_0x06b9('0x30')]=_[_0x06b9('0x2f')](_0x35c466['model'],qs[_0x06b9('0x31')](_0x40003c[_0x06b9('0x2e')][_0x06b9('0x31')]));_0x54ec33[_0x06b9('0x30')]=_0x54ec33[_0x06b9('0x30')]['length']?_0x54ec33[_0x06b9('0x30')]:_0x35c466[_0x06b9('0x2d')];if(_0x40003c[_0x06b9('0x2e')][_0x06b9('0x3e')]){_0x54ec33[_0x06b9('0x3f')]=[{'all':!![]}];}_0x54ec33=_[_0x06b9('0x38')]({},_0x54ec33,_0x40003c[_0x06b9('0x40')]);return db[_0x06b9('0x29')]['find'](_0x54ec33)[_0x06b9('0x21')](handleEntityNotFound(_0x2b8877,null))[_0x06b9('0x21')](respondWithResult(_0x2b8877,null))[_0x06b9('0x41')](handleError(_0x2b8877,null));};exports[_0x06b9('0x42')]=function(_0xdd238e,_0x536a28){return db[_0x06b9('0x29')][_0x06b9('0x42')](_0xdd238e['body'],{})[_0x06b9('0x21')](respondWithResult(_0x536a28,0xc9))[_0x06b9('0x41')](handleError(_0x536a28,null));};exports['update']=function(_0x1e31b3,_0x23e2a7){if(_0x1e31b3[_0x06b9('0x43')]['id']){delete _0x1e31b3['body']['id'];}return db[_0x06b9('0x29')][_0x06b9('0x44')]({'where':{'id':_0x1e31b3[_0x06b9('0x3c')]['id']}})[_0x06b9('0x21')](handleEntityNotFound(_0x23e2a7,null))[_0x06b9('0x21')](saveUpdates(_0x1e31b3[_0x06b9('0x43')],null))[_0x06b9('0x21')](respondWithResult(_0x23e2a7,null))[_0x06b9('0x41')](handleError(_0x23e2a7,null));};exports['destroy']=function(_0xa3b0f3,_0x6340f2){return db[_0x06b9('0x29')][_0x06b9('0x44')]({'where':{'id':_0xa3b0f3[_0x06b9('0x3c')]['id']}})['then'](handleEntityNotFound(_0x6340f2,null))[_0x06b9('0x21')](removeEntity(_0x6340f2,null))[_0x06b9('0x41')](handleError(_0x6340f2,null));};exports[_0x06b9('0x45')]=function(_0x4240e8,_0x27900f,_0x1247cf){var _0x216e4c={};var _0x138566={};var _0x2ed9a5;var _0xb1ab6e;return db[_0x06b9('0x29')]['findOne']({'where':{'id':_0x4240e8[_0x06b9('0x3c')]['id']}})[_0x06b9('0x21')](handleEntityNotFound(_0x27900f,null))[_0x06b9('0x21')](function(_0x4bc251){if(_0x4bc251){_0x2ed9a5=_0x4bc251;_0x138566[_0x06b9('0x2d')]=_['keys'](db[_0x06b9('0x46')][_0x06b9('0x2a')]);_0x138566[_0x06b9('0x2e')]=_[_0x06b9('0x3d')](_0x4240e8[_0x06b9('0x2e')]);_0x138566[_0x06b9('0x36')]=_[_0x06b9('0x2f')](_0x138566['model'],_0x138566[_0x06b9('0x2e')]);_0x216e4c[_0x06b9('0x30')]=_[_0x06b9('0x2f')](_0x138566[_0x06b9('0x2d')],qs[_0x06b9('0x31')](_0x4240e8[_0x06b9('0x2e')][_0x06b9('0x31')]));_0x216e4c[_0x06b9('0x30')]=_0x216e4c['attributes'][_0x06b9('0x32')]?_0x216e4c[_0x06b9('0x30')]:_0x138566[_0x06b9('0x2d')];_0x216e4c['order']=qs[_0x06b9('0x35')](_0x4240e8[_0x06b9('0x2e')][_0x06b9('0x35')]);_0x216e4c[_0x06b9('0x3a')]=qs[_0x06b9('0x36')](_[_0x06b9('0x37')](_0x4240e8[_0x06b9('0x2e')],_0x138566[_0x06b9('0x36')]));if(_0x4240e8[_0x06b9('0x2e')][_0x06b9('0x47')]){_0x216e4c[_0x06b9('0x3a')]=_[_0x06b9('0x38')](_0x216e4c['where'],{'$or':_[_0x06b9('0x28')](_0x216e4c[_0x06b9('0x30')],function(_0x236403){var _0x3b2b41={};_0x3b2b41[_0x236403]={'$like':'%'+_0x4240e8[_0x06b9('0x2e')]['filter']+'%'};return _0x3b2b41;})});}_0x216e4c=_[_0x06b9('0x38')]({},_0x216e4c,_0x4240e8[_0x06b9('0x40')]);return _0x2ed9a5[_0x06b9('0x45')](_0x216e4c);}})['then'](function(_0xc78c27){if(_0xc78c27){_0xb1ab6e=_0xc78c27[_0x06b9('0x32')];if(!_0x4240e8['query'][_0x06b9('0x33')]('nolimit')){_0x216e4c[_0x06b9('0x1b')]=qs['limit'](_0x4240e8[_0x06b9('0x2e')]['limit']);_0x216e4c[_0x06b9('0x19')]=qs[_0x06b9('0x19')](_0x4240e8[_0x06b9('0x2e')][_0x06b9('0x19')]);}return _0x2ed9a5[_0x06b9('0x45')](_0x216e4c);}})[_0x06b9('0x21')](function(_0x4e1e01){if(_0x4e1e01){return _0x4e1e01?{'count':_0xb1ab6e,'rows':_0x4e1e01}:null;}})[_0x06b9('0x21')](respondWithResult(_0x27900f,null))[_0x06b9('0x41')](handleError(_0x27900f,null));};exports[_0x06b9('0x48')]=function(_0x4b388a,_0xc84124,_0x5e87b6){var _0x500a5f={};var _0x251167={};var _0xbcd3f1;var _0x131570;return db[_0x06b9('0x29')][_0x06b9('0x49')]({'where':{'id':_0x4b388a[_0x06b9('0x3c')]['id']}})[_0x06b9('0x21')](handleEntityNotFound(_0xc84124,null))[_0x06b9('0x21')](function(_0x4a1485){if(_0x4a1485){_0xbcd3f1=_0x4a1485;_0x251167[_0x06b9('0x2d')]=_[_0x06b9('0x3d')](db[_0x06b9('0x46')][_0x06b9('0x2a')]);_0x251167['query']=_[_0x06b9('0x3d')](_0x4b388a[_0x06b9('0x2e')]);_0x251167[_0x06b9('0x36')]=_[_0x06b9('0x2f')](_0x251167[_0x06b9('0x2d')],_0x251167[_0x06b9('0x2e')]);_0x500a5f[_0x06b9('0x30')]=_[_0x06b9('0x2f')](_0x251167[_0x06b9('0x2d')],qs[_0x06b9('0x31')](_0x4b388a[_0x06b9('0x2e')][_0x06b9('0x31')]));_0x500a5f['attributes']=_0x500a5f[_0x06b9('0x30')][_0x06b9('0x32')]?_0x500a5f[_0x06b9('0x30')]:_0x251167[_0x06b9('0x2d')];_0x500a5f[_0x06b9('0x34')]=qs[_0x06b9('0x35')](_0x4b388a[_0x06b9('0x2e')][_0x06b9('0x35')]);_0x500a5f[_0x06b9('0x3a')]=qs[_0x06b9('0x36')](_[_0x06b9('0x37')](_0x4b388a[_0x06b9('0x2e')],_0x251167['filters']));if(_0x4b388a[_0x06b9('0x2e')]['filter']){_0x500a5f[_0x06b9('0x3a')]=_[_0x06b9('0x38')](_0x500a5f['where'],{'$or':_[_0x06b9('0x28')](_0x500a5f[_0x06b9('0x30')],function(_0x25cba9){var _0x53abcd={};_0x53abcd[_0x25cba9]={'$like':'%'+_0x4b388a[_0x06b9('0x2e')]['filter']+'%'};return _0x53abcd;})});}_0x500a5f=_['merge']({},_0x500a5f,_0x4b388a[_0x06b9('0x40')]);return _0xbcd3f1[_0x06b9('0x48')](_0x500a5f);}})['then'](function(_0x305567){if(_0x305567){_0x131570=_0x305567[_0x06b9('0x32')];if(!_0x4b388a['query']['hasOwnProperty'](_0x06b9('0x4a'))){_0x500a5f[_0x06b9('0x1b')]=qs[_0x06b9('0x1b')](_0x4b388a[_0x06b9('0x2e')]['limit']);_0x500a5f[_0x06b9('0x19')]=qs[_0x06b9('0x19')](_0x4b388a[_0x06b9('0x2e')]['offset']);}return _0xbcd3f1[_0x06b9('0x48')](_0x500a5f);}})[_0x06b9('0x21')](function(_0x1ae81d){if(_0x1ae81d){return _0x1ae81d?{'count':_0x131570,'rows':_0x1ae81d}:null;}})[_0x06b9('0x21')](respondWithResult(_0xc84124,null))[_0x06b9('0x41')](handleError(_0xc84124,null));};exports[_0x06b9('0x4b')]=function(_0x217851,_0x4f4cdb,_0x15909d){var _0x1f51a5={};var _0x2ed3aa={};var _0x3d85c0;var _0x41ef6d;return db[_0x06b9('0x29')][_0x06b9('0x49')]({'where':{'id':_0x217851['params']['id']}})[_0x06b9('0x21')](handleEntityNotFound(_0x4f4cdb,null))[_0x06b9('0x21')](function(_0x3a58ac){if(_0x3a58ac){_0x3d85c0=_0x3a58ac;_0x2ed3aa[_0x06b9('0x2d')]=_['keys'](db[_0x06b9('0x46')][_0x06b9('0x2a')]);_0x2ed3aa['query']=_[_0x06b9('0x3d')](_0x217851[_0x06b9('0x2e')]);_0x2ed3aa[_0x06b9('0x36')]=_['intersection'](_0x2ed3aa[_0x06b9('0x2d')],_0x2ed3aa[_0x06b9('0x2e')]);_0x1f51a5[_0x06b9('0x30')]=_['intersection'](_0x2ed3aa[_0x06b9('0x2d')],qs[_0x06b9('0x31')](_0x217851[_0x06b9('0x2e')][_0x06b9('0x31')]));_0x1f51a5[_0x06b9('0x30')]=_0x1f51a5[_0x06b9('0x30')][_0x06b9('0x32')]?_0x1f51a5['attributes']:_0x2ed3aa[_0x06b9('0x2d')];_0x1f51a5['order']=qs[_0x06b9('0x35')](_0x217851[_0x06b9('0x2e')][_0x06b9('0x35')]);_0x1f51a5[_0x06b9('0x3a')]=qs['filters'](_[_0x06b9('0x37')](_0x217851[_0x06b9('0x2e')],_0x2ed3aa[_0x06b9('0x36')]));if(_0x217851[_0x06b9('0x2e')][_0x06b9('0x47')]){_0x1f51a5[_0x06b9('0x3a')]=_[_0x06b9('0x38')](_0x1f51a5[_0x06b9('0x3a')],{'$or':_[_0x06b9('0x28')](_0x1f51a5[_0x06b9('0x30')],function(_0x424daf){var _0x3299ba={};_0x3299ba[_0x424daf]={'$like':'%'+_0x217851[_0x06b9('0x2e')][_0x06b9('0x47')]+'%'};return _0x3299ba;})});}_0x1f51a5=_[_0x06b9('0x38')]({},_0x1f51a5,_0x217851[_0x06b9('0x40')]);return _0x3d85c0['getDescriptions'](_0x1f51a5);}})[_0x06b9('0x21')](function(_0x1c3e33){if(_0x1c3e33){_0x41ef6d=_0x1c3e33['length'];if(!_0x217851[_0x06b9('0x2e')][_0x06b9('0x33')](_0x06b9('0x4a'))){_0x1f51a5[_0x06b9('0x1b')]=qs['limit'](_0x217851[_0x06b9('0x2e')][_0x06b9('0x1b')]);_0x1f51a5[_0x06b9('0x19')]=qs[_0x06b9('0x19')](_0x217851[_0x06b9('0x2e')][_0x06b9('0x19')]);}return _0x3d85c0[_0x06b9('0x4b')](_0x1f51a5);}})['then'](function(_0x5ec53f){if(_0x5ec53f){return _0x5ec53f?{'count':_0x41ef6d,'rows':_0x5ec53f}:null;}})[_0x06b9('0x21')](respondWithResult(_0x4f4cdb,null))[_0x06b9('0x41')](handleError(_0x4f4cdb,null));};exports[_0x06b9('0x4c')]=function(_0x5580f3,_0x3f1fbf,_0x2a035a){var _0x381ec5={};var _0x5df8f5={};var _0x5c48fe;var _0x1342b5;return db[_0x06b9('0x29')][_0x06b9('0x49')]({'where':{'id':_0x5580f3[_0x06b9('0x3c')]['id']}})['then'](handleEntityNotFound(_0x3f1fbf,null))[_0x06b9('0x21')](function(_0x6c8330){if(_0x6c8330){_0x5c48fe=_0x6c8330;_0x5df8f5[_0x06b9('0x2d')]=_[_0x06b9('0x3d')](db[_0x06b9('0x4d')][_0x06b9('0x2a')]);_0x5df8f5[_0x06b9('0x2e')]=_[_0x06b9('0x3d')](_0x5580f3[_0x06b9('0x2e')]);_0x5df8f5['filters']=_[_0x06b9('0x2f')](_0x5df8f5['model'],_0x5df8f5[_0x06b9('0x2e')]);_0x381ec5[_0x06b9('0x30')]=_[_0x06b9('0x2f')](_0x5df8f5[_0x06b9('0x2d')],qs[_0x06b9('0x31')](_0x5580f3[_0x06b9('0x2e')]['fields']));_0x381ec5[_0x06b9('0x30')]=_0x381ec5['attributes'][_0x06b9('0x32')]?_0x381ec5[_0x06b9('0x30')]:_0x5df8f5[_0x06b9('0x2d')];_0x381ec5[_0x06b9('0x34')]=qs[_0x06b9('0x35')](_0x5580f3[_0x06b9('0x2e')][_0x06b9('0x35')]);_0x381ec5[_0x06b9('0x3a')]=qs[_0x06b9('0x36')](_[_0x06b9('0x37')](_0x5580f3[_0x06b9('0x2e')],_0x5df8f5['filters']));if(_0x5580f3['query']['filter']){_0x381ec5[_0x06b9('0x3a')]=_[_0x06b9('0x38')](_0x381ec5[_0x06b9('0x3a')],{'$or':_[_0x06b9('0x28')](_0x381ec5[_0x06b9('0x30')],function(_0x210c85){var _0x1b244a={};_0x1b244a[_0x210c85]={'$like':'%'+_0x5580f3[_0x06b9('0x2e')][_0x06b9('0x47')]+'%'};return _0x1b244a;})});}_0x381ec5=_['merge']({},_0x381ec5,_0x5580f3['options']);return _0x5c48fe[_0x06b9('0x4c')](_0x381ec5);}})['then'](function(_0x174e98){if(_0x174e98){_0x1342b5=_0x174e98['length'];if(!_0x5580f3[_0x06b9('0x2e')][_0x06b9('0x33')](_0x06b9('0x4a'))){_0x381ec5[_0x06b9('0x1b')]=qs[_0x06b9('0x1b')](_0x5580f3['query']['limit']);_0x381ec5[_0x06b9('0x19')]=qs[_0x06b9('0x19')](_0x5580f3[_0x06b9('0x2e')][_0x06b9('0x19')]);}return _0x5c48fe[_0x06b9('0x4c')](_0x381ec5);}})[_0x06b9('0x21')](function(_0x59665d){if(_0x59665d){return _0x59665d?{'count':_0x1342b5,'rows':_0x59665d}:null;}})[_0x06b9('0x21')](respondWithResult(_0x3f1fbf,null))[_0x06b9('0x41')](handleError(_0x3f1fbf,null));};exports['setTags']=function(_0x1681b5,_0x1090e8,_0x27e71a){if(_0x1681b5[_0x06b9('0x43')]['id']){delete _0x1681b5[_0x06b9('0x43')]['id'];}return db['DeskConfiguration']['findOne']({'where':{'id':_0x1681b5[_0x06b9('0x3c')]['id']}})[_0x06b9('0x21')](handleEntityNotFound(_0x1090e8,null))[_0x06b9('0x21')](function(_0x2d9c93){if(_0x2d9c93){return _0x2d9c93[_0x06b9('0x4e')](_0x1681b5['body']['ids']||[]);}return null;})[_0x06b9('0x21')](respondWithResult(_0x1090e8,null))[_0x06b9('0x41')](handleError(_0x1090e8,null));}; \ No newline at end of file +var _0xdc81=['count','set','Content-Range','apply','reject','then','destroy','stack','name','send','index','map','DeskConfiguration','rawAttributes','type','key','model','query','keys','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','params','intersection','create','body','find','getFields','DeskField','pick','getSubjects','getDescriptions','findOne','setTags','ids','eml-format','rimraf','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','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','end','status','json','offset','limit','undefined'];(function(_0x50d17b,_0x17cc5e){var _0x35038b=function(_0x24c078){while(--_0x24c078){_0x50d17b['push'](_0x50d17b['shift']());}};_0x35038b(++_0x17cc5e);}(_0xdc81,0x82));var _0x1dc8=function(_0x161ee3,_0x5a680f){_0x161ee3=_0x161ee3-0x0;var _0x49f8f6=_0xdc81[_0x161ee3];return _0x49f8f6;};'use strict';var emlformat=require(_0x1dc8('0x0'));var rimraf=require(_0x1dc8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1dc8('0x2'));var BPromise=require(_0x1dc8('0x3'));var Mustache=require(_0x1dc8('0x4'));var util=require(_0x1dc8('0x5'));var path=require('path');var sox=require(_0x1dc8('0x6'));var csv=require(_0x1dc8('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1dc8('0x8'));var _=require(_0x1dc8('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1dc8('0xa'));var deskjs=require(_0x1dc8('0xb'));var toCsv=require(_0x1dc8('0x7'));var querystring=require(_0x1dc8('0xc'));var Papa=require('papaparse');var Redis=require(_0x1dc8('0xd'));var authService=require(_0x1dc8('0xe'));var qs=require(_0x1dc8('0xf'));var as=require(_0x1dc8('0x10'));var hardwareService=require(_0x1dc8('0x11'));var logger=require(_0x1dc8('0x12'))(_0x1dc8('0x13'));var utils=require(_0x1dc8('0x14'));var config=require(_0x1dc8('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x1dc8('0x16'))['db'];function respondWithStatusCode(_0x563c8b,_0x5c0e43){_0x5c0e43=_0x5c0e43||0xcc;return function(_0x1d1533){if(_0x1d1533){return _0x563c8b[_0x1dc8('0x17')](_0x5c0e43);}return _0x563c8b['status'](_0x5c0e43)[_0x1dc8('0x18')]();};}function respondWithResult(_0x309271,_0x529d44){_0x529d44=_0x529d44||0xc8;return function(_0x4e22c8){if(_0x4e22c8){return _0x309271[_0x1dc8('0x19')](_0x529d44)[_0x1dc8('0x1a')](_0x4e22c8);}};}function respondWithFilteredResult(_0x160e6f,_0x29e049){return function(_0x2c3cde){if(_0x2c3cde){var _0x2eacfc=typeof _0x29e049[_0x1dc8('0x1b')]==='undefined'&&typeof _0x29e049[_0x1dc8('0x1c')]===_0x1dc8('0x1d');var _0x3891ee=_0x2c3cde[_0x1dc8('0x1e')];var _0x2799d7=_0x2eacfc?0x0:_0x29e049[_0x1dc8('0x1b')];var _0x551ca8=_0x2eacfc?_0x2c3cde[_0x1dc8('0x1e')]:_0x29e049[_0x1dc8('0x1b')]+_0x29e049['limit'];var _0x41a59b;if(_0x551ca8>=_0x3891ee){_0x551ca8=_0x3891ee;_0x41a59b=0xc8;}else{_0x41a59b=0xce;}_0x160e6f[_0x1dc8('0x19')](_0x41a59b);return _0x160e6f[_0x1dc8('0x1f')](_0x1dc8('0x20'),_0x2799d7+'-'+_0x551ca8+'/'+_0x3891ee)[_0x1dc8('0x1a')](_0x2c3cde);}return null;};}function patchUpdates(_0x4cb7d5){return function(_0x54bd7d){try{jsonpatch[_0x1dc8('0x21')](_0x54bd7d,_0x4cb7d5,!![]);}catch(_0x345f49){return BPromise[_0x1dc8('0x22')](_0x345f49);}return _0x54bd7d['save']();};}function saveUpdates(_0x31ff17,_0x3112bd){return function(_0x5e1abe){if(_0x5e1abe){return _0x5e1abe['update'](_0x31ff17)[_0x1dc8('0x23')](function(_0x43e94a){return _0x43e94a;});}return null;};}function removeEntity(_0x3e7f56,_0x2a2dd9){return function(_0x299ad5){if(_0x299ad5){return _0x299ad5[_0x1dc8('0x24')]()[_0x1dc8('0x23')](function(){_0x3e7f56[_0x1dc8('0x19')](0xcc)[_0x1dc8('0x18')]();});}};}function handleEntityNotFound(_0x23ed94,_0x12938f){return function(_0x342d63){if(!_0x342d63){_0x23ed94[_0x1dc8('0x17')](0x194);}return _0x342d63;};}function handleError(_0x3d2b8f,_0x6f459e){_0x6f459e=_0x6f459e||0x1f4;return function(_0x501add){logger['error'](_0x501add[_0x1dc8('0x25')]);if(_0x501add[_0x1dc8('0x26')]){delete _0x501add[_0x1dc8('0x26')];}_0x3d2b8f[_0x1dc8('0x19')](_0x6f459e)[_0x1dc8('0x27')](_0x501add);};}exports[_0x1dc8('0x28')]=function(_0x4bfdac,_0x4a1ca3){var _0x5b8b4e={},_0x17c045={},_0x5c5587={'count':0x0,'rows':[]};var _0x4e441a=_[_0x1dc8('0x29')](db[_0x1dc8('0x2a')][_0x1dc8('0x2b')],function(_0x5a4904){return{'name':_0x5a4904['fieldName'],'type':_0x5a4904[_0x1dc8('0x2c')][_0x1dc8('0x2d')]};});_0x17c045[_0x1dc8('0x2e')]=_[_0x1dc8('0x29')](_0x4e441a,_0x1dc8('0x26'));_0x17c045[_0x1dc8('0x2f')]=_[_0x1dc8('0x30')](_0x4bfdac[_0x1dc8('0x2f')]);_0x17c045['filters']=_['intersection'](_0x17c045[_0x1dc8('0x2e')],_0x17c045[_0x1dc8('0x2f')]);_0x5b8b4e[_0x1dc8('0x31')]=_['intersection'](_0x17c045['model'],qs[_0x1dc8('0x32')](_0x4bfdac[_0x1dc8('0x2f')]['fields']));_0x5b8b4e[_0x1dc8('0x31')]=_0x5b8b4e[_0x1dc8('0x31')][_0x1dc8('0x33')]?_0x5b8b4e['attributes']:_0x17c045[_0x1dc8('0x2e')];if(!_0x4bfdac['query'][_0x1dc8('0x34')](_0x1dc8('0x35'))){_0x5b8b4e[_0x1dc8('0x1c')]=qs[_0x1dc8('0x1c')](_0x4bfdac['query'][_0x1dc8('0x1c')]);_0x5b8b4e[_0x1dc8('0x1b')]=qs[_0x1dc8('0x1b')](_0x4bfdac[_0x1dc8('0x2f')]['offset']);}_0x5b8b4e[_0x1dc8('0x36')]=qs['sort'](_0x4bfdac['query'][_0x1dc8('0x37')]);_0x5b8b4e[_0x1dc8('0x38')]=qs[_0x1dc8('0x39')](_['pick'](_0x4bfdac[_0x1dc8('0x2f')],_0x17c045[_0x1dc8('0x39')]),_0x4e441a);if(_0x4bfdac[_0x1dc8('0x2f')]['filter']){_0x5b8b4e[_0x1dc8('0x38')]=_[_0x1dc8('0x3a')](_0x5b8b4e[_0x1dc8('0x38')],{'$or':_[_0x1dc8('0x29')](_0x4e441a,function(_0x3666de){if(_0x3666de['type']!==_0x1dc8('0x3b')){var _0x328dcd={};_0x328dcd[_0x3666de[_0x1dc8('0x26')]]={'$like':'%'+_0x4bfdac['query'][_0x1dc8('0x3c')]+'%'};return _0x328dcd;}})});}_0x5b8b4e=_[_0x1dc8('0x3a')]({},_0x5b8b4e,_0x4bfdac[_0x1dc8('0x3d')]);var _0x2ee16e={'where':_0x5b8b4e[_0x1dc8('0x38')]};return db['DeskConfiguration'][_0x1dc8('0x1e')](_0x2ee16e)[_0x1dc8('0x23')](function(_0x275833){_0x5c5587[_0x1dc8('0x1e')]=_0x275833;if(_0x4bfdac['query'][_0x1dc8('0x3e')]){_0x5b8b4e[_0x1dc8('0x3f')]=[{'all':!![]}];}return db[_0x1dc8('0x2a')][_0x1dc8('0x40')](_0x5b8b4e);})[_0x1dc8('0x23')](function(_0x1624c2){_0x5c5587[_0x1dc8('0x41')]=_0x1624c2;return _0x5c5587;})['then'](respondWithFilteredResult(_0x4a1ca3,_0x5b8b4e))[_0x1dc8('0x42')](handleError(_0x4a1ca3,null));};exports['show']=function(_0x2c83d6,_0x40d19b){var _0xfb1bf9={'raw':![],'where':{'id':_0x2c83d6[_0x1dc8('0x43')]['id']}},_0x117420={};_0x117420[_0x1dc8('0x2e')]=_[_0x1dc8('0x30')](db['DeskConfiguration'][_0x1dc8('0x2b')]);_0x117420[_0x1dc8('0x2f')]=_['keys'](_0x2c83d6[_0x1dc8('0x2f')]);_0x117420['filters']=_[_0x1dc8('0x44')](_0x117420[_0x1dc8('0x2e')],_0x117420['query']);_0xfb1bf9[_0x1dc8('0x31')]=_[_0x1dc8('0x44')](_0x117420['model'],qs['fields'](_0x2c83d6[_0x1dc8('0x2f')][_0x1dc8('0x32')]));_0xfb1bf9[_0x1dc8('0x31')]=_0xfb1bf9[_0x1dc8('0x31')]['length']?_0xfb1bf9[_0x1dc8('0x31')]:_0x117420[_0x1dc8('0x2e')];if(_0x2c83d6['query'][_0x1dc8('0x3e')]){_0xfb1bf9['include']=[{'all':!![]}];}_0xfb1bf9=_[_0x1dc8('0x3a')]({},_0xfb1bf9,_0x2c83d6[_0x1dc8('0x3d')]);return db[_0x1dc8('0x2a')]['find'](_0xfb1bf9)[_0x1dc8('0x23')](handleEntityNotFound(_0x40d19b,null))[_0x1dc8('0x23')](respondWithResult(_0x40d19b,null))[_0x1dc8('0x42')](handleError(_0x40d19b,null));};exports[_0x1dc8('0x45')]=function(_0x3e953f,_0x5a73ea){return db[_0x1dc8('0x2a')][_0x1dc8('0x45')](_0x3e953f[_0x1dc8('0x46')],{})[_0x1dc8('0x23')](respondWithResult(_0x5a73ea,0xc9))[_0x1dc8('0x42')](handleError(_0x5a73ea,null));};exports['update']=function(_0x2e6bd0,_0x175d07){if(_0x2e6bd0[_0x1dc8('0x46')]['id']){delete _0x2e6bd0[_0x1dc8('0x46')]['id'];}return db[_0x1dc8('0x2a')]['find']({'where':{'id':_0x2e6bd0[_0x1dc8('0x43')]['id']}})[_0x1dc8('0x23')](handleEntityNotFound(_0x175d07,null))['then'](saveUpdates(_0x2e6bd0[_0x1dc8('0x46')],null))[_0x1dc8('0x23')](respondWithResult(_0x175d07,null))['catch'](handleError(_0x175d07,null));};exports['destroy']=function(_0x135390,_0x4c5007){return db['DeskConfiguration'][_0x1dc8('0x47')]({'where':{'id':_0x135390[_0x1dc8('0x43')]['id']}})[_0x1dc8('0x23')](handleEntityNotFound(_0x4c5007,null))['then'](removeEntity(_0x4c5007,null))[_0x1dc8('0x42')](handleError(_0x4c5007,null));};exports[_0x1dc8('0x48')]=function(_0x2b3d30,_0x3984aa,_0x2b68f6){var _0x52d29a={};var _0x23745f={};var _0x12528f;var _0xbfc5b2;return db['DeskConfiguration']['findOne']({'where':{'id':_0x2b3d30['params']['id']}})[_0x1dc8('0x23')](handleEntityNotFound(_0x3984aa,null))['then'](function(_0xd68c95){if(_0xd68c95){_0x12528f=_0xd68c95;_0x23745f[_0x1dc8('0x2e')]=_[_0x1dc8('0x30')](db[_0x1dc8('0x49')][_0x1dc8('0x2b')]);_0x23745f['query']=_[_0x1dc8('0x30')](_0x2b3d30['query']);_0x23745f[_0x1dc8('0x39')]=_[_0x1dc8('0x44')](_0x23745f['model'],_0x23745f[_0x1dc8('0x2f')]);_0x52d29a[_0x1dc8('0x31')]=_[_0x1dc8('0x44')](_0x23745f[_0x1dc8('0x2e')],qs[_0x1dc8('0x32')](_0x2b3d30['query']['fields']));_0x52d29a[_0x1dc8('0x31')]=_0x52d29a[_0x1dc8('0x31')][_0x1dc8('0x33')]?_0x52d29a[_0x1dc8('0x31')]:_0x23745f[_0x1dc8('0x2e')];_0x52d29a['order']=qs[_0x1dc8('0x37')](_0x2b3d30['query'][_0x1dc8('0x37')]);_0x52d29a[_0x1dc8('0x38')]=qs[_0x1dc8('0x39')](_[_0x1dc8('0x4a')](_0x2b3d30['query'],_0x23745f[_0x1dc8('0x39')]));if(_0x2b3d30['query']['filter']){_0x52d29a['where']=_['merge'](_0x52d29a[_0x1dc8('0x38')],{'$or':_[_0x1dc8('0x29')](_0x52d29a[_0x1dc8('0x31')],function(_0x5688a2){var _0x1d1ac6={};_0x1d1ac6[_0x5688a2]={'$like':'%'+_0x2b3d30[_0x1dc8('0x2f')]['filter']+'%'};return _0x1d1ac6;})});}_0x52d29a=_[_0x1dc8('0x3a')]({},_0x52d29a,_0x2b3d30['options']);return _0x12528f[_0x1dc8('0x48')](_0x52d29a);}})[_0x1dc8('0x23')](function(_0x2cd22c){if(_0x2cd22c){_0xbfc5b2=_0x2cd22c[_0x1dc8('0x33')];if(!_0x2b3d30['query'][_0x1dc8('0x34')](_0x1dc8('0x35'))){_0x52d29a[_0x1dc8('0x1c')]=qs[_0x1dc8('0x1c')](_0x2b3d30[_0x1dc8('0x2f')][_0x1dc8('0x1c')]);_0x52d29a[_0x1dc8('0x1b')]=qs['offset'](_0x2b3d30[_0x1dc8('0x2f')][_0x1dc8('0x1b')]);}return _0x12528f[_0x1dc8('0x48')](_0x52d29a);}})['then'](function(_0x13ed6a){if(_0x13ed6a){return _0x13ed6a?{'count':_0xbfc5b2,'rows':_0x13ed6a}:null;}})['then'](respondWithResult(_0x3984aa,null))[_0x1dc8('0x42')](handleError(_0x3984aa,null));};exports['getSubjects']=function(_0x13f4dc,_0x238bd5,_0x603de1){var _0x165772={};var _0x3dca08={};var _0x567317;var _0x3785ab;return db[_0x1dc8('0x2a')]['findOne']({'where':{'id':_0x13f4dc[_0x1dc8('0x43')]['id']}})['then'](handleEntityNotFound(_0x238bd5,null))[_0x1dc8('0x23')](function(_0x1d215f){if(_0x1d215f){_0x567317=_0x1d215f;_0x3dca08[_0x1dc8('0x2e')]=_[_0x1dc8('0x30')](db[_0x1dc8('0x49')][_0x1dc8('0x2b')]);_0x3dca08[_0x1dc8('0x2f')]=_['keys'](_0x13f4dc[_0x1dc8('0x2f')]);_0x3dca08[_0x1dc8('0x39')]=_['intersection'](_0x3dca08[_0x1dc8('0x2e')],_0x3dca08[_0x1dc8('0x2f')]);_0x165772[_0x1dc8('0x31')]=_['intersection'](_0x3dca08[_0x1dc8('0x2e')],qs[_0x1dc8('0x32')](_0x13f4dc[_0x1dc8('0x2f')][_0x1dc8('0x32')]));_0x165772['attributes']=_0x165772[_0x1dc8('0x31')]['length']?_0x165772['attributes']:_0x3dca08[_0x1dc8('0x2e')];_0x165772[_0x1dc8('0x36')]=qs[_0x1dc8('0x37')](_0x13f4dc[_0x1dc8('0x2f')][_0x1dc8('0x37')]);_0x165772[_0x1dc8('0x38')]=qs[_0x1dc8('0x39')](_[_0x1dc8('0x4a')](_0x13f4dc[_0x1dc8('0x2f')],_0x3dca08[_0x1dc8('0x39')]));if(_0x13f4dc['query'][_0x1dc8('0x3c')]){_0x165772[_0x1dc8('0x38')]=_[_0x1dc8('0x3a')](_0x165772[_0x1dc8('0x38')],{'$or':_[_0x1dc8('0x29')](_0x165772[_0x1dc8('0x31')],function(_0x50de1c){var _0x5e05ed={};_0x5e05ed[_0x50de1c]={'$like':'%'+_0x13f4dc[_0x1dc8('0x2f')][_0x1dc8('0x3c')]+'%'};return _0x5e05ed;})});}_0x165772=_['merge']({},_0x165772,_0x13f4dc[_0x1dc8('0x3d')]);return _0x567317['getSubjects'](_0x165772);}})[_0x1dc8('0x23')](function(_0x2d5929){if(_0x2d5929){_0x3785ab=_0x2d5929[_0x1dc8('0x33')];if(!_0x13f4dc['query'][_0x1dc8('0x34')](_0x1dc8('0x35'))){_0x165772['limit']=qs[_0x1dc8('0x1c')](_0x13f4dc[_0x1dc8('0x2f')]['limit']);_0x165772[_0x1dc8('0x1b')]=qs[_0x1dc8('0x1b')](_0x13f4dc['query'][_0x1dc8('0x1b')]);}return _0x567317[_0x1dc8('0x4b')](_0x165772);}})[_0x1dc8('0x23')](function(_0x2b7a90){if(_0x2b7a90){return _0x2b7a90?{'count':_0x3785ab,'rows':_0x2b7a90}:null;}})[_0x1dc8('0x23')](respondWithResult(_0x238bd5,null))[_0x1dc8('0x42')](handleError(_0x238bd5,null));};exports[_0x1dc8('0x4c')]=function(_0x865fd8,_0x53ed2a,_0x3d8226){var _0x2b9a09={};var _0x56e9c4={};var _0x428e38;var _0x4aa194;return db[_0x1dc8('0x2a')][_0x1dc8('0x4d')]({'where':{'id':_0x865fd8[_0x1dc8('0x43')]['id']}})[_0x1dc8('0x23')](handleEntityNotFound(_0x53ed2a,null))['then'](function(_0x20f90c){if(_0x20f90c){_0x428e38=_0x20f90c;_0x56e9c4[_0x1dc8('0x2e')]=_[_0x1dc8('0x30')](db[_0x1dc8('0x49')]['rawAttributes']);_0x56e9c4[_0x1dc8('0x2f')]=_[_0x1dc8('0x30')](_0x865fd8[_0x1dc8('0x2f')]);_0x56e9c4['filters']=_[_0x1dc8('0x44')](_0x56e9c4['model'],_0x56e9c4[_0x1dc8('0x2f')]);_0x2b9a09[_0x1dc8('0x31')]=_['intersection'](_0x56e9c4[_0x1dc8('0x2e')],qs[_0x1dc8('0x32')](_0x865fd8['query'][_0x1dc8('0x32')]));_0x2b9a09[_0x1dc8('0x31')]=_0x2b9a09[_0x1dc8('0x31')][_0x1dc8('0x33')]?_0x2b9a09[_0x1dc8('0x31')]:_0x56e9c4[_0x1dc8('0x2e')];_0x2b9a09['order']=qs[_0x1dc8('0x37')](_0x865fd8[_0x1dc8('0x2f')]['sort']);_0x2b9a09[_0x1dc8('0x38')]=qs[_0x1dc8('0x39')](_[_0x1dc8('0x4a')](_0x865fd8[_0x1dc8('0x2f')],_0x56e9c4['filters']));if(_0x865fd8[_0x1dc8('0x2f')]['filter']){_0x2b9a09[_0x1dc8('0x38')]=_['merge'](_0x2b9a09[_0x1dc8('0x38')],{'$or':_[_0x1dc8('0x29')](_0x2b9a09[_0x1dc8('0x31')],function(_0x261498){var _0x36cc83={};_0x36cc83[_0x261498]={'$like':'%'+_0x865fd8[_0x1dc8('0x2f')][_0x1dc8('0x3c')]+'%'};return _0x36cc83;})});}_0x2b9a09=_[_0x1dc8('0x3a')]({},_0x2b9a09,_0x865fd8[_0x1dc8('0x3d')]);return _0x428e38[_0x1dc8('0x4c')](_0x2b9a09);}})[_0x1dc8('0x23')](function(_0x1a9a6a){if(_0x1a9a6a){_0x4aa194=_0x1a9a6a['length'];if(!_0x865fd8[_0x1dc8('0x2f')][_0x1dc8('0x34')](_0x1dc8('0x35'))){_0x2b9a09[_0x1dc8('0x1c')]=qs[_0x1dc8('0x1c')](_0x865fd8['query'][_0x1dc8('0x1c')]);_0x2b9a09[_0x1dc8('0x1b')]=qs[_0x1dc8('0x1b')](_0x865fd8[_0x1dc8('0x2f')][_0x1dc8('0x1b')]);}return _0x428e38[_0x1dc8('0x4c')](_0x2b9a09);}})[_0x1dc8('0x23')](function(_0x47da32){if(_0x47da32){return _0x47da32?{'count':_0x4aa194,'rows':_0x47da32}:null;}})[_0x1dc8('0x23')](respondWithResult(_0x53ed2a,null))[_0x1dc8('0x42')](handleError(_0x53ed2a,null));};exports['getTags']=function(_0x4a2e4a,_0x5d17f0,_0x4d663c){var _0x589193={};var _0x149e5f={};var _0x3f0552;var _0x172f31;return db[_0x1dc8('0x2a')]['findOne']({'where':{'id':_0x4a2e4a[_0x1dc8('0x43')]['id']}})[_0x1dc8('0x23')](handleEntityNotFound(_0x5d17f0,null))[_0x1dc8('0x23')](function(_0x4e5260){if(_0x4e5260){_0x3f0552=_0x4e5260;_0x149e5f[_0x1dc8('0x2e')]=_[_0x1dc8('0x30')](db['Tag']['rawAttributes']);_0x149e5f[_0x1dc8('0x2f')]=_[_0x1dc8('0x30')](_0x4a2e4a[_0x1dc8('0x2f')]);_0x149e5f[_0x1dc8('0x39')]=_[_0x1dc8('0x44')](_0x149e5f['model'],_0x149e5f[_0x1dc8('0x2f')]);_0x589193[_0x1dc8('0x31')]=_[_0x1dc8('0x44')](_0x149e5f[_0x1dc8('0x2e')],qs[_0x1dc8('0x32')](_0x4a2e4a[_0x1dc8('0x2f')][_0x1dc8('0x32')]));_0x589193['attributes']=_0x589193[_0x1dc8('0x31')][_0x1dc8('0x33')]?_0x589193[_0x1dc8('0x31')]:_0x149e5f[_0x1dc8('0x2e')];_0x589193[_0x1dc8('0x36')]=qs['sort'](_0x4a2e4a[_0x1dc8('0x2f')][_0x1dc8('0x37')]);_0x589193[_0x1dc8('0x38')]=qs[_0x1dc8('0x39')](_[_0x1dc8('0x4a')](_0x4a2e4a['query'],_0x149e5f['filters']));if(_0x4a2e4a['query'][_0x1dc8('0x3c')]){_0x589193[_0x1dc8('0x38')]=_['merge'](_0x589193['where'],{'$or':_[_0x1dc8('0x29')](_0x589193[_0x1dc8('0x31')],function(_0x32c51b){var _0x1e1c0e={};_0x1e1c0e[_0x32c51b]={'$like':'%'+_0x4a2e4a['query']['filter']+'%'};return _0x1e1c0e;})});}_0x589193=_[_0x1dc8('0x3a')]({},_0x589193,_0x4a2e4a['options']);return _0x3f0552['getTags'](_0x589193);}})[_0x1dc8('0x23')](function(_0x1dd885){if(_0x1dd885){_0x172f31=_0x1dd885[_0x1dc8('0x33')];if(!_0x4a2e4a[_0x1dc8('0x2f')]['hasOwnProperty'](_0x1dc8('0x35'))){_0x589193[_0x1dc8('0x1c')]=qs[_0x1dc8('0x1c')](_0x4a2e4a[_0x1dc8('0x2f')]['limit']);_0x589193['offset']=qs[_0x1dc8('0x1b')](_0x4a2e4a['query']['offset']);}return _0x3f0552['getTags'](_0x589193);}})['then'](function(_0x36dfc1){if(_0x36dfc1){return _0x36dfc1?{'count':_0x172f31,'rows':_0x36dfc1}:null;}})['then'](respondWithResult(_0x5d17f0,null))[_0x1dc8('0x42')](handleError(_0x5d17f0,null));};exports[_0x1dc8('0x4e')]=function(_0x2dd385,_0x3ed9d8,_0x5f044b){if(_0x2dd385[_0x1dc8('0x46')]['id']){delete _0x2dd385[_0x1dc8('0x46')]['id'];}return db['DeskConfiguration']['findOne']({'where':{'id':_0x2dd385[_0x1dc8('0x43')]['id']}})['then'](handleEntityNotFound(_0x3ed9d8,null))[_0x1dc8('0x23')](function(_0x1a90cc){if(_0x1a90cc){return _0x1a90cc[_0x1dc8('0x4e')](_0x2dd385[_0x1dc8('0x46')][_0x1dc8('0x4f')]||[]);}return null;})[_0x1dc8('0x23')](respondWithResult(_0x3ed9d8,null))[_0x1dc8('0x42')](handleError(_0x3ed9d8,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 343508d..e90dcd2 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 _0x4170=['../../config/logger','api','bluebird','request-promise','path','./intDeskConfiguration.attributes','exports','define','DeskConfiguration','int_desk_configurations','lodash','util'];(function(_0x52ef6e,_0x4d4cbf){var _0x2a3017=function(_0x5a885a){while(--_0x5a885a){_0x52ef6e['push'](_0x52ef6e['shift']());}};_0x2a3017(++_0x4d4cbf);}(_0x4170,0x166));var _0x0417=function(_0x327e33,_0x2ad2e7){_0x327e33=_0x327e33-0x0;var _0x4e0025=_0x4170[_0x327e33];return _0x4e0025;};'use strict';var _=require(_0x0417('0x0'));var util=require(_0x0417('0x1'));var logger=require(_0x0417('0x2'))(_0x0417('0x3'));var moment=require('moment');var BPromise=require(_0x0417('0x4'));var rp=require(_0x0417('0x5'));var fs=require('fs');var path=require(_0x0417('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x0417('0x7'));module[_0x0417('0x8')]=function(_0x310bd6,_0x172601){return _0x310bd6[_0x0417('0x9')](_0x0417('0xa'),attributes,{'tableName':_0x0417('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc2c0=['bluebird','request-promise','./intDeskConfiguration.attributes','exports','DeskConfiguration','int_desk_configurations','lodash','util','../../config/logger','api','moment'];(function(_0x1f9e4a,_0x17dc30){var _0x40a822=function(_0x4f4705){while(--_0x4f4705){_0x1f9e4a['push'](_0x1f9e4a['shift']());}};_0x40a822(++_0x17dc30);}(_0xc2c0,0x13a));var _0x0c2c=function(_0x8e7772,_0x9d77b0){_0x8e7772=_0x8e7772-0x0;var _0x408200=_0xc2c0[_0x8e7772];return _0x408200;};'use strict';var _=require(_0x0c2c('0x0'));var util=require(_0x0c2c('0x1'));var logger=require(_0x0c2c('0x2'))(_0x0c2c('0x3'));var moment=require(_0x0c2c('0x4'));var BPromise=require(_0x0c2c('0x5'));var rp=require(_0x0c2c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x0c2c('0x7'));module[_0x0c2c('0x8')]=function(_0x34271a,_0x491259){return _0x34271a['define'](_0x0c2c('0x9'),attributes,{'tableName':_0x0c2c('0xa'),'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 32652d1..86af7c0 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 _0x32b6=['DeskConfiguration,\x20%s,\x20%s','message','info','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','debug','request\x20sent','stringify','error','code'];(function(_0x399967,_0x3230e4){var _0x430912=function(_0x362abb){while(--_0x362abb){_0x399967['push'](_0x399967['shift']());}};_0x430912(++_0x3230e4);}(_0x32b6,0x1d1));var _0x632b=function(_0x554aee,_0x544f1f){_0x554aee=_0x554aee-0x0;var _0x257666=_0x32b6[_0x554aee];return _0x257666;};'use strict';var _=require(_0x632b('0x0'));var util=require(_0x632b('0x1'));var moment=require('moment');var BPromise=require(_0x632b('0x2'));var rs=require(_0x632b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x632b('0x4'));var logger=require(_0x632b('0x5'))(_0x632b('0x6'));var config=require(_0x632b('0x7'));var jayson=require(_0x632b('0x8'));var client=jayson[_0x632b('0x9')][_0x632b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x10458a,_0x3bbf43,_0x43d6c7){return new BPromise(function(_0x5128f5,_0x33d711){return client[_0x632b('0xb')](_0x10458a,_0x43d6c7)[_0x632b('0xc')](function(_0x174201){logger['info']('DeskConfiguration,\x20%s,\x20%s',_0x3bbf43,'request\x20sent');logger[_0x632b('0xd')]('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x3bbf43,_0x632b('0xe'),JSON[_0x632b('0xf')](_0x174201));if(_0x174201[_0x632b('0x10')]){if(_0x174201[_0x632b('0x10')][_0x632b('0x11')]===0x1f4){logger[_0x632b('0x10')](_0x632b('0x12'),_0x3bbf43,_0x174201[_0x632b('0x10')][_0x632b('0x13')]);return _0x33d711(_0x174201['error'][_0x632b('0x13')]);}logger[_0x632b('0x10')](_0x632b('0x12'),_0x3bbf43,_0x174201['error'][_0x632b('0x13')]);return _0x5128f5(_0x174201[_0x632b('0x10')][_0x632b('0x13')]);}else{logger[_0x632b('0x14')](_0x632b('0x12'),_0x3bbf43,_0x632b('0xe'));_0x5128f5(_0x174201['result'][_0x632b('0x13')]);}})['catch'](function(_0x4fdef2){logger[_0x632b('0x10')]('DeskConfiguration,\x20%s,\x20%s',_0x3bbf43,_0x4fdef2);_0x33d711(_0x4fdef2);});});} \ No newline at end of file +var _0x5480=['../../config/logger','../../config/environment','jayson/promise','client','http','request','then','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','lodash','util','moment','ioredis','../../config/utils'];(function(_0x47cd62,_0x19bbf3){var _0x7923b9=function(_0x420f48){while(--_0x420f48){_0x47cd62['push'](_0x47cd62['shift']());}};_0x7923b9(++_0x19bbf3);}(_0x5480,0x18a));var _0x0548=function(_0x1e2080,_0x53283b){_0x1e2080=_0x1e2080-0x0;var _0x260111=_0x5480[_0x1e2080];return _0x260111;};'use strict';var _=require(_0x0548('0x0'));var util=require(_0x0548('0x1'));var moment=require(_0x0548('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0548('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0548('0x4'));var logger=require(_0x0548('0x5'))('rpc');var config=require(_0x0548('0x6'));var jayson=require(_0x0548('0x7'));var client=jayson[_0x0548('0x8')][_0x0548('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3d4401,_0x50c631,_0x48d43d){return new BPromise(function(_0xf69224,_0x5678e3){return client[_0x0548('0xa')](_0x3d4401,_0x48d43d)[_0x0548('0xb')](function(_0x105bb5){logger['info'](_0x0548('0xc'),_0x50c631,_0x0548('0xd'));logger[_0x0548('0xe')](_0x0548('0xf'),_0x50c631,_0x0548('0xd'),JSON[_0x0548('0x10')](_0x105bb5));if(_0x105bb5['error']){if(_0x105bb5[_0x0548('0x11')][_0x0548('0x12')]===0x1f4){logger[_0x0548('0x11')](_0x0548('0xc'),_0x50c631,_0x105bb5[_0x0548('0x11')]['message']);return _0x5678e3(_0x105bb5['error'][_0x0548('0x13')]);}logger[_0x0548('0x11')](_0x0548('0xc'),_0x50c631,_0x105bb5[_0x0548('0x11')][_0x0548('0x13')]);return _0xf69224(_0x105bb5[_0x0548('0x11')][_0x0548('0x13')]);}else{logger[_0x0548('0x14')](_0x0548('0xc'),_0x50c631,'request\x20sent');_0xf69224(_0x105bb5['result'][_0x0548('0x13')]);}})['catch'](function(_0x44d306){logger['error']('DeskConfiguration,\x20%s,\x20%s',_0x50c631,_0x44d306);_0x5678e3(_0x44d306);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 208f2df..3573e44 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 _0xbb4d=['delete','destroy','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','isAuthenticated','index','/:id','show','post','create','put','update'];(function(_0x23697f,_0x4dee4b){var _0x3e3d2f=function(_0x2c73ed){while(--_0x2c73ed){_0x23697f['push'](_0x23697f['shift']());}};_0x3e3d2f(++_0x4dee4b);}(_0xbb4d,0x74));var _0xdbb4=function(_0xccb202,_0x1b7105){_0xccb202=_0xccb202-0x0;var _0x2b40a4=_0xbb4d[_0xccb202];return _0x2b40a4;};'use strict';var multer=require(_0xdbb4('0x0'));var util=require(_0xdbb4('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xdbb4('0x2'));var router=express[_0xdbb4('0x3')]();var fs_extra=require(_0xdbb4('0x4'));var auth=require(_0xdbb4('0x5'));var interaction=require(_0xdbb4('0x6'));var config=require(_0xdbb4('0x7'));var controller=require(_0xdbb4('0x8'));router['get']('/',auth[_0xdbb4('0x9')](),controller[_0xdbb4('0xa')]);router['get'](_0xdbb4('0xb'),auth[_0xdbb4('0x9')](),controller[_0xdbb4('0xc')]);router[_0xdbb4('0xd')]('/',auth[_0xdbb4('0x9')](),controller[_0xdbb4('0xe')]);router[_0xdbb4('0xf')](_0xdbb4('0xb'),auth[_0xdbb4('0x9')](),controller[_0xdbb4('0x10')]);router[_0xdbb4('0x11')](_0xdbb4('0xb'),auth[_0xdbb4('0x9')](),controller[_0xdbb4('0x12')]);module['exports']=router; \ No newline at end of file +var _0xda28=['../../components/interaction/service','../../config/environment','./intDeskField.controller','get','index','/:id','isAuthenticated','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0xda28,0xfd));var _0x8da2=function(_0x25f71b,_0x290fb2){_0x25f71b=_0x25f71b-0x0;var _0x44f60a=_0xda28[_0x25f71b];return _0x44f60a;};'use strict';var multer=require(_0x8da2('0x0'));var util=require(_0x8da2('0x1'));var path=require(_0x8da2('0x2'));var timeout=require(_0x8da2('0x3'));var express=require(_0x8da2('0x4'));var router=express['Router']();var fs_extra=require(_0x8da2('0x5'));var auth=require(_0x8da2('0x6'));var interaction=require(_0x8da2('0x7'));var config=require(_0x8da2('0x8'));var controller=require(_0x8da2('0x9'));router[_0x8da2('0xa')]('/',auth['isAuthenticated'](),controller[_0x8da2('0xb')]);router['get'](_0x8da2('0xc'),auth[_0x8da2('0xd')](),controller['show']);router[_0x8da2('0xe')]('/',auth['isAuthenticated'](),controller[_0x8da2('0xf')]);router[_0x8da2('0x10')](_0x8da2('0xc'),auth[_0x8da2('0xd')](),controller['update']);router[_0x8da2('0x11')]('/:id',auth[_0x8da2('0xd')](),controller[_0x8da2('0x12')]);module[_0x8da2('0x13')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index 72f0640..9ac1d86 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 _0xce43=['string','variable','keyValue','STRING','ENUM','sequelize'];(function(_0x27d67f,_0x423cbe){var _0x189ac5=function(_0x53e030){while(--_0x53e030){_0x27d67f['push'](_0x27d67f['shift']());}};_0x189ac5(++_0x423cbe);}(_0xce43,0x1eb));var _0x3ce4=function(_0x188f9b,_0x2adba5){_0x188f9b=_0x188f9b-0x0;var _0x54893b=_0xce43[_0x188f9b];return _0x54893b;};'use strict';var Sequelize=require(_0x3ce4('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0x3ce4('0x1'),_0x3ce4('0x2'),'customVariable',_0x3ce4('0x3'),'picklist'),'defaultValue':_0x3ce4('0x1')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x3ce4('0x4')]},'keyType':{'type':Sequelize[_0x3ce4('0x5')]('string','variable','customVariable')},'keyContent':{'type':Sequelize[_0x3ce4('0x4')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x059f=['STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','keyValue'];(function(_0x2d9e27,_0x5965b2){var _0xd35381=function(_0x343d18){while(--_0x343d18){_0x2d9e27['push'](_0x2d9e27['shift']());}};_0xd35381(++_0x5965b2);}(_0x059f,0xb6));var _0xf059=function(_0x13b392,_0x3481f2){_0x13b392=_0x13b392-0x0;var _0x39db24=_0x059f[_0x13b392];return _0x39db24;};'use strict';var Sequelize=require(_0xf059('0x0'));module[_0xf059('0x1')]={'type':{'type':Sequelize[_0xf059('0x2')](_0xf059('0x3'),_0xf059('0x4'),_0xf059('0x5'),_0xf059('0x6'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0xf059('0x7')]},'key':{'type':Sequelize[_0xf059('0x7')]},'keyType':{'type':Sequelize[_0xf059('0x2')](_0xf059('0x3'),_0xf059('0x4'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xf059('0x7')]},'nameField':{'type':Sequelize[_0xf059('0x7')]},'customField':{'type':Sequelize[_0xf059('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index 30497c7..d403259 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 _0x9ca0=['model','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','findAll','rows','catch','params','rawAttributes','fields','include','find','create','body','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','DeskField','fieldName','type','query','keys','filters'];(function(_0x3388d8,_0x256024){var _0x2bbe73=function(_0x3c0cb2){while(--_0x3c0cb2){_0x3388d8['push'](_0x3388d8['shift']());}};_0x2bbe73(++_0x256024);}(_0x9ca0,0x65));var _0x09ca=function(_0xfb0cfd,_0x500179){_0xfb0cfd=_0xfb0cfd-0x0;var _0x2fd8aa=_0x9ca0[_0xfb0cfd];return _0x2fd8aa;};'use strict';var emlformat=require(_0x09ca('0x0'));var rimraf=require(_0x09ca('0x1'));var zipdir=require(_0x09ca('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x09ca('0x3'));var moment=require(_0x09ca('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x09ca('0x5'));var util=require(_0x09ca('0x6'));var path=require('path');var sox=require(_0x09ca('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x09ca('0x8'));var _=require(_0x09ca('0x9'));var squel=require(_0x09ca('0xa'));var crypto=require(_0x09ca('0xb'));var jsforce=require(_0x09ca('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x09ca('0xd'));var Papa=require(_0x09ca('0xe'));var Redis=require('ioredis');var authService=require(_0x09ca('0xf'));var qs=require(_0x09ca('0x10'));var as=require(_0x09ca('0x11'));var hardwareService=require(_0x09ca('0x12'));var logger=require(_0x09ca('0x13'))(_0x09ca('0x14'));var utils=require('../../config/utils');var config=require(_0x09ca('0x15'));var licenseUtil=require(_0x09ca('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x16e164,_0x5e47fa){_0x5e47fa=_0x5e47fa||0xcc;return function(_0x1ad33f){if(_0x1ad33f){return _0x16e164[_0x09ca('0x17')](_0x5e47fa);}return _0x16e164[_0x09ca('0x18')](_0x5e47fa)['end']();};}function respondWithResult(_0x57eda0,_0xc23339){_0xc23339=_0xc23339||0xc8;return function(_0x2fa47e){if(_0x2fa47e){return _0x57eda0['status'](_0xc23339)[_0x09ca('0x19')](_0x2fa47e);}};}function respondWithFilteredResult(_0xdb0c26,_0x32eb55){return function(_0x29621d){if(_0x29621d){var _0xb387a5=typeof _0x32eb55[_0x09ca('0x1a')]===_0x09ca('0x1b')&&typeof _0x32eb55[_0x09ca('0x1c')]===_0x09ca('0x1b');var _0x330b88=_0x29621d[_0x09ca('0x1d')];var _0x3d8f28=_0xb387a5?0x0:_0x32eb55['offset'];var _0x62be0c=_0xb387a5?_0x29621d[_0x09ca('0x1d')]:_0x32eb55[_0x09ca('0x1a')]+_0x32eb55[_0x09ca('0x1c')];var _0x206fdb;if(_0x62be0c>=_0x330b88){_0x62be0c=_0x330b88;_0x206fdb=0xc8;}else{_0x206fdb=0xce;}_0xdb0c26[_0x09ca('0x18')](_0x206fdb);return _0xdb0c26[_0x09ca('0x1e')](_0x09ca('0x1f'),_0x3d8f28+'-'+_0x62be0c+'/'+_0x330b88)['json'](_0x29621d);}return null;};}function patchUpdates(_0x26c2c3){return function(_0xfe4fea){try{jsonpatch[_0x09ca('0x20')](_0xfe4fea,_0x26c2c3,!![]);}catch(_0x53a36b){return BPromise[_0x09ca('0x21')](_0x53a36b);}return _0xfe4fea[_0x09ca('0x22')]();};}function saveUpdates(_0xacdffd,_0x25b2d9){return function(_0x48ec36){if(_0x48ec36){return _0x48ec36[_0x09ca('0x23')](_0xacdffd)[_0x09ca('0x24')](function(_0x3115d0){return _0x3115d0;});}return null;};}function removeEntity(_0x37288a,_0x44f036){return function(_0x234fcd){if(_0x234fcd){return _0x234fcd[_0x09ca('0x25')]()['then'](function(){_0x37288a[_0x09ca('0x18')](0xcc)[_0x09ca('0x26')]();});}};}function handleEntityNotFound(_0x459822,_0x28a5f0){return function(_0x2257f3){if(!_0x2257f3){_0x459822[_0x09ca('0x17')](0x194);}return _0x2257f3;};}function handleError(_0x12fc15,_0x17b209){_0x17b209=_0x17b209||0x1f4;return function(_0x576466){logger[_0x09ca('0x27')](_0x576466[_0x09ca('0x28')]);if(_0x576466[_0x09ca('0x29')]){delete _0x576466['name'];}_0x12fc15['status'](_0x17b209)[_0x09ca('0x2a')](_0x576466);};}exports[_0x09ca('0x2b')]=function(_0x163cee,_0x39c5f7){var _0x4ed8eb={},_0x2d2f54={},_0x5525e2={'count':0x0,'rows':[]};var _0x1ebb94=_[_0x09ca('0x2c')](db[_0x09ca('0x2d')]['rawAttributes'],function(_0x5c60cc){return{'name':_0x5c60cc[_0x09ca('0x2e')],'type':_0x5c60cc[_0x09ca('0x2f')]['key']};});_0x2d2f54['model']=_[_0x09ca('0x2c')](_0x1ebb94,_0x09ca('0x29'));_0x2d2f54[_0x09ca('0x30')]=_[_0x09ca('0x31')](_0x163cee[_0x09ca('0x30')]);_0x2d2f54[_0x09ca('0x32')]=_['intersection'](_0x2d2f54[_0x09ca('0x33')],_0x2d2f54['query']);_0x4ed8eb[_0x09ca('0x34')]=_[_0x09ca('0x35')](_0x2d2f54[_0x09ca('0x33')],qs['fields'](_0x163cee[_0x09ca('0x30')]['fields']));_0x4ed8eb[_0x09ca('0x34')]=_0x4ed8eb['attributes'][_0x09ca('0x36')]?_0x4ed8eb[_0x09ca('0x34')]:_0x2d2f54['model'];if(!_0x163cee[_0x09ca('0x30')][_0x09ca('0x37')](_0x09ca('0x38'))){_0x4ed8eb['limit']=qs[_0x09ca('0x1c')](_0x163cee[_0x09ca('0x30')][_0x09ca('0x1c')]);_0x4ed8eb[_0x09ca('0x1a')]=qs['offset'](_0x163cee[_0x09ca('0x30')][_0x09ca('0x1a')]);}_0x4ed8eb[_0x09ca('0x39')]=qs[_0x09ca('0x3a')](_0x163cee['query'][_0x09ca('0x3a')]);_0x4ed8eb['where']=qs['filters'](_[_0x09ca('0x3b')](_0x163cee['query'],_0x2d2f54[_0x09ca('0x32')]),_0x1ebb94);if(_0x163cee[_0x09ca('0x30')][_0x09ca('0x3c')]){_0x4ed8eb[_0x09ca('0x3d')]=_['merge'](_0x4ed8eb[_0x09ca('0x3d')],{'$or':_['map'](_0x1ebb94,function(_0x561990){if(_0x561990[_0x09ca('0x2f')]!==_0x09ca('0x3e')){var _0x5f3096={};_0x5f3096[_0x561990[_0x09ca('0x29')]]={'$like':'%'+_0x163cee[_0x09ca('0x30')]['filter']+'%'};return _0x5f3096;}})});}_0x4ed8eb=_[_0x09ca('0x3f')]({},_0x4ed8eb,_0x163cee[_0x09ca('0x40')]);var _0x5306df={'where':_0x4ed8eb[_0x09ca('0x3d')]};return db[_0x09ca('0x2d')][_0x09ca('0x1d')](_0x5306df)[_0x09ca('0x24')](function(_0x63a49d){_0x5525e2[_0x09ca('0x1d')]=_0x63a49d;if(_0x163cee[_0x09ca('0x30')][_0x09ca('0x41')]){_0x4ed8eb['include']=[{'all':!![]}];}return db[_0x09ca('0x2d')][_0x09ca('0x42')](_0x4ed8eb);})[_0x09ca('0x24')](function(_0x21fe62){_0x5525e2[_0x09ca('0x43')]=_0x21fe62;return _0x5525e2;})[_0x09ca('0x24')](respondWithFilteredResult(_0x39c5f7,_0x4ed8eb))[_0x09ca('0x44')](handleError(_0x39c5f7,null));};exports['show']=function(_0x145ca1,_0x4c4e2d){var _0x20ec99={'raw':!![],'where':{'id':_0x145ca1[_0x09ca('0x45')]['id']}},_0x4c1588={};_0x4c1588[_0x09ca('0x33')]=_[_0x09ca('0x31')](db[_0x09ca('0x2d')][_0x09ca('0x46')]);_0x4c1588[_0x09ca('0x30')]=_['keys'](_0x145ca1[_0x09ca('0x30')]);_0x4c1588[_0x09ca('0x32')]=_[_0x09ca('0x35')](_0x4c1588[_0x09ca('0x33')],_0x4c1588[_0x09ca('0x30')]);_0x20ec99[_0x09ca('0x34')]=_[_0x09ca('0x35')](_0x4c1588[_0x09ca('0x33')],qs['fields'](_0x145ca1[_0x09ca('0x30')][_0x09ca('0x47')]));_0x20ec99[_0x09ca('0x34')]=_0x20ec99[_0x09ca('0x34')][_0x09ca('0x36')]?_0x20ec99[_0x09ca('0x34')]:_0x4c1588['model'];if(_0x145ca1[_0x09ca('0x30')]['includeAll']){_0x20ec99[_0x09ca('0x48')]=[{'all':!![]}];}_0x20ec99=_[_0x09ca('0x3f')]({},_0x20ec99,_0x145ca1[_0x09ca('0x40')]);return db[_0x09ca('0x2d')][_0x09ca('0x49')](_0x20ec99)[_0x09ca('0x24')](handleEntityNotFound(_0x4c4e2d,null))[_0x09ca('0x24')](respondWithResult(_0x4c4e2d,null))[_0x09ca('0x44')](handleError(_0x4c4e2d,null));};exports[_0x09ca('0x4a')]=function(_0x5b1d39,_0x655643){return db[_0x09ca('0x2d')][_0x09ca('0x4a')](_0x5b1d39[_0x09ca('0x4b')],{})[_0x09ca('0x24')](respondWithResult(_0x655643,0xc9))[_0x09ca('0x44')](handleError(_0x655643,null));};exports['update']=function(_0x2004ea,_0x3a2a3b){if(_0x2004ea[_0x09ca('0x4b')]['id']){delete _0x2004ea[_0x09ca('0x4b')]['id'];}return db[_0x09ca('0x2d')][_0x09ca('0x49')]({'where':{'id':_0x2004ea[_0x09ca('0x45')]['id']}})[_0x09ca('0x24')](handleEntityNotFound(_0x3a2a3b,null))[_0x09ca('0x24')](saveUpdates(_0x2004ea[_0x09ca('0x4b')],null))[_0x09ca('0x24')](respondWithResult(_0x3a2a3b,null))[_0x09ca('0x44')](handleError(_0x3a2a3b,null));};exports['destroy']=function(_0x2fffc7,_0x7bfa96){return db['DeskField'][_0x09ca('0x49')]({'where':{'id':_0x2fffc7['params']['id']}})[_0x09ca('0x24')](handleEntityNotFound(_0x7bfa96,null))[_0x09ca('0x24')](removeEntity(_0x7bfa96,null))[_0x09ca('0x44')](handleError(_0x7bfa96,null));}; \ No newline at end of file +var _0x046b=['sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','update','then','stack','name','send','index','map','DeskField','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','type','options','includeAll','include','findAll','rows','catch','show','keys','merge','create','body','find','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path'];(function(_0xed5f9c,_0x5a25cd){var _0x3a1c43=function(_0x251202){while(--_0x251202){_0xed5f9c['push'](_0xed5f9c['shift']());}};_0x3a1c43(++_0x5a25cd);}(_0x046b,0x1ba));var _0xb046=function(_0x2f22d6,_0x531948){_0x2f22d6=_0x2f22d6-0x0;var _0x44bc1f=_0x046b[_0x2f22d6];return _0x44bc1f;};'use strict';var emlformat=require(_0xb046('0x0'));var rimraf=require(_0xb046('0x1'));var zipdir=require(_0xb046('0x2'));var jsonpatch=require(_0xb046('0x3'));var rp=require('request-promise');var moment=require(_0xb046('0x4'));var BPromise=require(_0xb046('0x5'));var Mustache=require('mustache');var util=require(_0xb046('0x6'));var path=require(_0xb046('0x7'));var sox=require(_0xb046('0x8'));var csv=require(_0xb046('0x9'));var ejs=require(_0xb046('0xa'));var fs=require('fs');var fs_extra=require(_0xb046('0xb'));var _=require(_0xb046('0xc'));var squel=require(_0xb046('0xd'));var crypto=require(_0xb046('0xe'));var jsforce=require(_0xb046('0xf'));var deskjs=require(_0xb046('0x10'));var toCsv=require(_0xb046('0x9'));var querystring=require(_0xb046('0x11'));var Papa=require('papaparse');var Redis=require(_0xb046('0x12'));var authService=require(_0xb046('0x13'));var qs=require(_0xb046('0x14'));var as=require(_0xb046('0x15'));var hardwareService=require(_0xb046('0x16'));var logger=require('../../config/logger')(_0xb046('0x17'));var utils=require(_0xb046('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb046('0x19'))['db'];function respondWithStatusCode(_0x9fda4b,_0x2ff4f3){_0x2ff4f3=_0x2ff4f3||0xcc;return function(_0x178ebf){if(_0x178ebf){return _0x9fda4b[_0xb046('0x1a')](_0x2ff4f3);}return _0x9fda4b[_0xb046('0x1b')](_0x2ff4f3)[_0xb046('0x1c')]();};}function respondWithResult(_0x1d97b0,_0x36e91f){_0x36e91f=_0x36e91f||0xc8;return function(_0x26fb6f){if(_0x26fb6f){return _0x1d97b0['status'](_0x36e91f)[_0xb046('0x1d')](_0x26fb6f);}};}function respondWithFilteredResult(_0x3a8109,_0x4fd90c){return function(_0x2b0d1e){if(_0x2b0d1e){var _0x5e54c6=typeof _0x4fd90c[_0xb046('0x1e')]===_0xb046('0x1f')&&typeof _0x4fd90c[_0xb046('0x20')]===_0xb046('0x1f');var _0x658dab=_0x2b0d1e[_0xb046('0x21')];var _0x52241f=_0x5e54c6?0x0:_0x4fd90c['offset'];var _0x17bbb0=_0x5e54c6?_0x2b0d1e[_0xb046('0x21')]:_0x4fd90c[_0xb046('0x1e')]+_0x4fd90c['limit'];var _0x541283;if(_0x17bbb0>=_0x658dab){_0x17bbb0=_0x658dab;_0x541283=0xc8;}else{_0x541283=0xce;}_0x3a8109[_0xb046('0x1b')](_0x541283);return _0x3a8109['set'](_0xb046('0x22'),_0x52241f+'-'+_0x17bbb0+'/'+_0x658dab)['json'](_0x2b0d1e);}return null;};}function patchUpdates(_0x9456ce){return function(_0x3e9a1f){try{jsonpatch[_0xb046('0x23')](_0x3e9a1f,_0x9456ce,!![]);}catch(_0x324dba){return BPromise['reject'](_0x324dba);}return _0x3e9a1f['save']();};}function saveUpdates(_0x505294,_0x2dbdde){return function(_0x2b676){if(_0x2b676){return _0x2b676[_0xb046('0x24')](_0x505294)[_0xb046('0x25')](function(_0xc3c99a){return _0xc3c99a;});}return null;};}function removeEntity(_0x433526,_0x51c65d){return function(_0x2750f8){if(_0x2750f8){return _0x2750f8['destroy']()['then'](function(){_0x433526[_0xb046('0x1b')](0xcc)[_0xb046('0x1c')]();});}};}function handleEntityNotFound(_0x1c3638,_0x3779ae){return function(_0xf1d1bd){if(!_0xf1d1bd){_0x1c3638[_0xb046('0x1a')](0x194);}return _0xf1d1bd;};}function handleError(_0x1dc546,_0x3d9d5){_0x3d9d5=_0x3d9d5||0x1f4;return function(_0x5ac704){logger['error'](_0x5ac704[_0xb046('0x26')]);if(_0x5ac704['name']){delete _0x5ac704[_0xb046('0x27')];}_0x1dc546[_0xb046('0x1b')](_0x3d9d5)[_0xb046('0x28')](_0x5ac704);};}exports[_0xb046('0x29')]=function(_0x1f7306,_0x39f817){var _0x180f77={},_0x333dbe={},_0x19ca88={'count':0x0,'rows':[]};var _0x1f75d0=_[_0xb046('0x2a')](db[_0xb046('0x2b')][_0xb046('0x2c')],function(_0x56272d){return{'name':_0x56272d[_0xb046('0x2d')],'type':_0x56272d['type'][_0xb046('0x2e')]};});_0x333dbe[_0xb046('0x2f')]=_[_0xb046('0x2a')](_0x1f75d0,_0xb046('0x27'));_0x333dbe[_0xb046('0x30')]=_['keys'](_0x1f7306['query']);_0x333dbe[_0xb046('0x31')]=_[_0xb046('0x32')](_0x333dbe[_0xb046('0x2f')],_0x333dbe[_0xb046('0x30')]);_0x180f77['attributes']=_[_0xb046('0x32')](_0x333dbe[_0xb046('0x2f')],qs[_0xb046('0x33')](_0x1f7306['query'][_0xb046('0x33')]));_0x180f77[_0xb046('0x34')]=_0x180f77[_0xb046('0x34')][_0xb046('0x35')]?_0x180f77[_0xb046('0x34')]:_0x333dbe[_0xb046('0x2f')];if(!_0x1f7306['query']['hasOwnProperty'](_0xb046('0x36'))){_0x180f77[_0xb046('0x20')]=qs[_0xb046('0x20')](_0x1f7306[_0xb046('0x30')][_0xb046('0x20')]);_0x180f77['offset']=qs[_0xb046('0x1e')](_0x1f7306['query'][_0xb046('0x1e')]);}_0x180f77[_0xb046('0x37')]=qs[_0xb046('0x38')](_0x1f7306[_0xb046('0x30')][_0xb046('0x38')]);_0x180f77[_0xb046('0x39')]=qs[_0xb046('0x31')](_[_0xb046('0x3a')](_0x1f7306['query'],_0x333dbe[_0xb046('0x31')]),_0x1f75d0);if(_0x1f7306[_0xb046('0x30')][_0xb046('0x3b')]){_0x180f77['where']=_['merge'](_0x180f77['where'],{'$or':_['map'](_0x1f75d0,function(_0x3a72c5){if(_0x3a72c5[_0xb046('0x3c')]!=='VIRTUAL'){var _0x39dab1={};_0x39dab1[_0x3a72c5[_0xb046('0x27')]]={'$like':'%'+_0x1f7306[_0xb046('0x30')][_0xb046('0x3b')]+'%'};return _0x39dab1;}})});}_0x180f77=_['merge']({},_0x180f77,_0x1f7306[_0xb046('0x3d')]);var _0x4bca39={'where':_0x180f77[_0xb046('0x39')]};return db[_0xb046('0x2b')][_0xb046('0x21')](_0x4bca39)[_0xb046('0x25')](function(_0x225af1){_0x19ca88[_0xb046('0x21')]=_0x225af1;if(_0x1f7306[_0xb046('0x30')][_0xb046('0x3e')]){_0x180f77[_0xb046('0x3f')]=[{'all':!![]}];}return db[_0xb046('0x2b')][_0xb046('0x40')](_0x180f77);})[_0xb046('0x25')](function(_0x88825){_0x19ca88[_0xb046('0x41')]=_0x88825;return _0x19ca88;})['then'](respondWithFilteredResult(_0x39f817,_0x180f77))[_0xb046('0x42')](handleError(_0x39f817,null));};exports[_0xb046('0x43')]=function(_0x13e798,_0x3deb8a){var _0x11633e={'raw':!![],'where':{'id':_0x13e798['params']['id']}},_0x1c4cfd={};_0x1c4cfd['model']=_[_0xb046('0x44')](db[_0xb046('0x2b')][_0xb046('0x2c')]);_0x1c4cfd[_0xb046('0x30')]=_[_0xb046('0x44')](_0x13e798[_0xb046('0x30')]);_0x1c4cfd[_0xb046('0x31')]=_['intersection'](_0x1c4cfd[_0xb046('0x2f')],_0x1c4cfd[_0xb046('0x30')]);_0x11633e['attributes']=_[_0xb046('0x32')](_0x1c4cfd[_0xb046('0x2f')],qs['fields'](_0x13e798[_0xb046('0x30')]['fields']));_0x11633e[_0xb046('0x34')]=_0x11633e[_0xb046('0x34')][_0xb046('0x35')]?_0x11633e['attributes']:_0x1c4cfd[_0xb046('0x2f')];if(_0x13e798[_0xb046('0x30')][_0xb046('0x3e')]){_0x11633e[_0xb046('0x3f')]=[{'all':!![]}];}_0x11633e=_[_0xb046('0x45')]({},_0x11633e,_0x13e798['options']);return db['DeskField']['find'](_0x11633e)[_0xb046('0x25')](handleEntityNotFound(_0x3deb8a,null))[_0xb046('0x25')](respondWithResult(_0x3deb8a,null))[_0xb046('0x42')](handleError(_0x3deb8a,null));};exports[_0xb046('0x46')]=function(_0x144e13,_0xdea490){return db['DeskField'][_0xb046('0x46')](_0x144e13[_0xb046('0x47')],{})[_0xb046('0x25')](respondWithResult(_0xdea490,0xc9))[_0xb046('0x42')](handleError(_0xdea490,null));};exports[_0xb046('0x24')]=function(_0x34030a,_0x377c71){if(_0x34030a[_0xb046('0x47')]['id']){delete _0x34030a['body']['id'];}return db[_0xb046('0x2b')][_0xb046('0x48')]({'where':{'id':_0x34030a[_0xb046('0x49')]['id']}})[_0xb046('0x25')](handleEntityNotFound(_0x377c71,null))[_0xb046('0x25')](saveUpdates(_0x34030a['body'],null))[_0xb046('0x25')](respondWithResult(_0x377c71,null))['catch'](handleError(_0x377c71,null));};exports[_0xb046('0x4a')]=function(_0x1c8636,_0xe65d66){return db[_0xb046('0x2b')]['find']({'where':{'id':_0x1c8636[_0xb046('0x49')]['id']}})[_0xb046('0x25')](handleEntityNotFound(_0xe65d66,null))[_0xb046('0x25')](removeEntity(_0xe65d66,null))['catch'](handleError(_0xe65d66,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index ce2118d..117ebc2 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 _0xcf65=['request-promise','rimraf','./intDeskField.attributes','exports','define','DeskField','int_desk_fields','../../config/logger','api','moment'];(function(_0x33ceb9,_0x483668){var _0x7eb79c=function(_0x1845bc){while(--_0x1845bc){_0x33ceb9['push'](_0x33ceb9['shift']());}};_0x7eb79c(++_0x483668);}(_0xcf65,0x18d));var _0x5cf6=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xcf65[_0xfae23b];return _0x200640;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5cf6('0x0'))(_0x5cf6('0x1'));var moment=require(_0x5cf6('0x2'));var BPromise=require('bluebird');var rp=require(_0x5cf6('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5cf6('0x4'));var config=require('../../config/environment');var attributes=require(_0x5cf6('0x5'));module[_0x5cf6('0x6')]=function(_0x53b7bf,_0x4f0e02){return _0x53b7bf[_0x5cf6('0x7')](_0x5cf6('0x8'),attributes,{'tableName':_0x5cf6('0x9'),'paranoid':![],'indexes':[{'name':'desk_unique_index','fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x56a0=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','int_desk_fields','lodash','util'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x56a0,0x196));var _0x056a=function(_0x469a2d,_0x53bcbe){_0x469a2d=_0x469a2d-0x0;var _0x148147=_0x56a0[_0x469a2d];return _0x148147;};'use strict';var _=require(_0x056a('0x0'));var util=require(_0x056a('0x1'));var logger=require(_0x056a('0x2'))(_0x056a('0x3'));var moment=require(_0x056a('0x4'));var BPromise=require(_0x056a('0x5'));var rp=require(_0x056a('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x056a('0x7'));var config=require(_0x056a('0x8'));var attributes=require('./intDeskField.attributes');module[_0x056a('0x9')]=function(_0x334510,_0x308416){return _0x334510[_0x056a('0xa')]('DeskField',attributes,{'tableName':_0x056a('0xb'),'paranoid':![],'indexes':[{'name':'desk_unique_index','fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.rpc.js b/server/api/intDeskField/intDeskField.rpc.js index 7b1e501..3438923 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 _0x3fa8=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','error','message','catch'];(function(_0x596ea3,_0x44fe5f){var _0x40ff39=function(_0x8ddd51){while(--_0x8ddd51){_0x596ea3['push'](_0x596ea3['shift']());}};_0x40ff39(++_0x44fe5f);}(_0x3fa8,0xb4));var _0x83fa=function(_0x43e197,_0x31384f){_0x43e197=_0x43e197-0x0;var _0x35fdd2=_0x3fa8[_0x43e197];return _0x35fdd2;};'use strict';var _=require('lodash');var util=require(_0x83fa('0x0'));var moment=require(_0x83fa('0x1'));var BPromise=require(_0x83fa('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x83fa('0x3'));var db=require(_0x83fa('0x4'))['db'];var utils=require(_0x83fa('0x5'));var logger=require(_0x83fa('0x6'))(_0x83fa('0x7'));var config=require(_0x83fa('0x8'));var jayson=require(_0x83fa('0x9'));var client=jayson[_0x83fa('0xa')][_0x83fa('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x28b512,_0x3aebf7,_0x39ab91){return new BPromise(function(_0x2453a5,_0x1749d3){return client['request'](_0x28b512,_0x39ab91)[_0x83fa('0xc')](function(_0x2b99b3){logger[_0x83fa('0xd')](_0x83fa('0xe'),_0x3aebf7,_0x83fa('0xf'));logger[_0x83fa('0x10')]('DeskField,\x20%s,\x20%s,\x20%s',_0x3aebf7,_0x83fa('0xf'),JSON['stringify'](_0x2b99b3));if(_0x2b99b3[_0x83fa('0x11')]){if(_0x2b99b3[_0x83fa('0x11')]['code']===0x1f4){logger['error']('DeskField,\x20%s,\x20%s',_0x3aebf7,_0x2b99b3[_0x83fa('0x11')][_0x83fa('0x12')]);return _0x1749d3(_0x2b99b3[_0x83fa('0x11')][_0x83fa('0x12')]);}logger[_0x83fa('0x11')](_0x83fa('0xe'),_0x3aebf7,_0x2b99b3[_0x83fa('0x11')]['message']);return _0x2453a5(_0x2b99b3['error'][_0x83fa('0x12')]);}else{logger[_0x83fa('0xd')]('DeskField,\x20%s,\x20%s',_0x3aebf7,'request\x20sent');_0x2453a5(_0x2b99b3['result'][_0x83fa('0x12')]);}})[_0x83fa('0x13')](function(_0x340bde){logger['error'](_0x83fa('0xe'),_0x3aebf7,_0x340bde);_0x1749d3(_0x340bde);});});} \ No newline at end of file +var _0xfc3b=['code','DeskField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','request','info','debug','request\x20sent','error'];(function(_0x5367f0,_0xd61082){var _0x335690=function(_0x1bc975){while(--_0x1bc975){_0x5367f0['push'](_0x5367f0['shift']());}};_0x335690(++_0xd61082);}(_0xfc3b,0x15b));var _0xbfc3=function(_0x114cd6,_0x242848){_0x114cd6=_0x114cd6-0x0;var _0x5c8e65=_0xfc3b[_0x114cd6];return _0x5c8e65;};'use strict';var _=require(_0xbfc3('0x0'));var util=require(_0xbfc3('0x1'));var moment=require(_0xbfc3('0x2'));var BPromise=require(_0xbfc3('0x3'));var rs=require(_0xbfc3('0x4'));var fs=require('fs');var Redis=require(_0xbfc3('0x5'));var db=require(_0xbfc3('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xbfc3('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xbfc3('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x57a7e6,_0x43cb87,_0x199e41){return new BPromise(function(_0x2c01bb,_0x2295e7){return client[_0xbfc3('0x9')](_0x57a7e6,_0x199e41)['then'](function(_0x5c5ef2){logger[_0xbfc3('0xa')]('DeskField,\x20%s,\x20%s',_0x43cb87,'request\x20sent');logger[_0xbfc3('0xb')]('DeskField,\x20%s,\x20%s,\x20%s',_0x43cb87,_0xbfc3('0xc'),JSON['stringify'](_0x5c5ef2));if(_0x5c5ef2[_0xbfc3('0xd')]){if(_0x5c5ef2[_0xbfc3('0xd')][_0xbfc3('0xe')]===0x1f4){logger[_0xbfc3('0xd')](_0xbfc3('0xf'),_0x43cb87,_0x5c5ef2['error']['message']);return _0x2295e7(_0x5c5ef2['error'][_0xbfc3('0x10')]);}logger[_0xbfc3('0xd')](_0xbfc3('0xf'),_0x43cb87,_0x5c5ef2[_0xbfc3('0xd')][_0xbfc3('0x10')]);return _0x2c01bb(_0x5c5ef2[_0xbfc3('0xd')][_0xbfc3('0x10')]);}else{logger[_0xbfc3('0xa')](_0xbfc3('0xf'),_0x43cb87,_0xbfc3('0xc'));_0x2c01bb(_0x5c5ef2[_0xbfc3('0x11')][_0xbfc3('0x10')]);}})[_0xbfc3('0x12')](function(_0x38c17a){logger[_0xbfc3('0xd')](_0xbfc3('0xf'),_0x43cb87,_0x38c17a);_0x2295e7(_0x38c17a);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index b988c37..2a29be2 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 _0xc368=['express','../../components/auth/service','../../config/environment','./intDynamics365Account.controller','get','isAuthenticated','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','/:id','update','exports','multer','util','path','connect-timeout'];(function(_0x455b05,_0x246a44){var _0x32da47=function(_0x35ee01){while(--_0x35ee01){_0x455b05['push'](_0x455b05['shift']());}};_0x32da47(++_0x246a44);}(_0xc368,0x119));var _0x8c36=function(_0x1c4b45,_0xc2343b){_0x1c4b45=_0x1c4b45-0x0;var _0x38d584=_0xc368[_0x1c4b45];return _0x38d584;};'use strict';var multer=require(_0x8c36('0x0'));var util=require(_0x8c36('0x1'));var path=require(_0x8c36('0x2'));var timeout=require(_0x8c36('0x3'));var express=require(_0x8c36('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8c36('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8c36('0x6'));var controller=require(_0x8c36('0x7'));router[_0x8c36('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x8c36('0x8')]('/:id',auth[_0x8c36('0x9')](),controller['show']);router[_0x8c36('0x8')](_0x8c36('0xa'),auth[_0x8c36('0x9')](),controller[_0x8c36('0xb')]);router[_0x8c36('0x8')](_0x8c36('0xc'),auth[_0x8c36('0x9')](),controller[_0x8c36('0xd')]);router[_0x8c36('0xe')]('/',auth[_0x8c36('0x9')](),controller[_0x8c36('0xf')]);router[_0x8c36('0xe')]('/:id/configurations',auth[_0x8c36('0x9')](),controller['addConfiguration']);router['put'](_0x8c36('0x10'),auth[_0x8c36('0x9')](),controller[_0x8c36('0x11')]);router['delete'](_0x8c36('0x10'),auth[_0x8c36('0x9')](),controller['destroy']);module[_0x8c36('0x12')]=router; \ No newline at end of file +var _0x7037=['delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./intDynamics365Account.controller','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','put','update'];(function(_0x3938bd,_0x248cc2){var _0x4a7fba=function(_0x283e10){while(--_0x283e10){_0x3938bd['push'](_0x3938bd['shift']());}};_0x4a7fba(++_0x248cc2);}(_0x7037,0x1cb));var _0x7703=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x7037[_0x5d6456];return _0x4d66c1;};'use strict';var multer=require(_0x7703('0x0'));var util=require(_0x7703('0x1'));var path=require(_0x7703('0x2'));var timeout=require(_0x7703('0x3'));var express=require('express');var router=express[_0x7703('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x7703('0x5'));var interaction=require(_0x7703('0x6'));var config=require('../../config/environment');var controller=require(_0x7703('0x7'));router[_0x7703('0x8')]('/',auth['isAuthenticated'](),controller[_0x7703('0x9')]);router[_0x7703('0x8')](_0x7703('0xa'),auth[_0x7703('0xb')](),controller[_0x7703('0xc')]);router[_0x7703('0x8')]('/:id/configurations',auth[_0x7703('0xb')](),controller['getConfigurations']);router[_0x7703('0x8')](_0x7703('0xd'),auth[_0x7703('0xb')](),controller[_0x7703('0xe')]);router[_0x7703('0xf')]('/',auth[_0x7703('0xb')](),controller[_0x7703('0x10')]);router['post'](_0x7703('0x11'),auth['isAuthenticated'](),controller[_0x7703('0x12')]);router[_0x7703('0x13')](_0x7703('0xa'),auth[_0x7703('0xb')](),controller[_0x7703('0x14')]);router[_0x7703('0x15')](_0x7703('0xa'),auth[_0x7703('0xb')](),controller[_0x7703('0x16')]);module[_0x7703('0x17')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index 1ba250a..f065db7 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 _0xd206=['exports','STRING','sequelize'];(function(_0x126156,_0x4cae6a){var _0x521308=function(_0x14f87c){while(--_0x14f87c){_0x126156['push'](_0x126156['shift']());}};_0x521308(++_0x4cae6a);}(_0xd206,0x107));var _0x6d20=function(_0x1b6186,_0x1ec7f2){_0x1b6186=_0x1b6186-0x0;var _0x186121=_0xd206[_0x1b6186];return _0x186121;};'use strict';var Sequelize=require(_0x6d20('0x0'));module[_0x6d20('0x1')]={'name':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x6d20('0x2')]},'password':{'type':Sequelize[_0x6d20('0x2')]},'remoteUri':{'type':Sequelize[_0x6d20('0x2')]},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x6d20('0x2')]},'clientSecret':{'type':Sequelize[_0x6d20('0x2')]},'serverUrl':{'type':Sequelize[_0x6d20('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x6d20('0x2')]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0xa7be=['BOOLEAN','sequelize','exports','STRING'];(function(_0x280e38,_0x53f78d){var _0x45e18b=function(_0x47df45){while(--_0x47df45){_0x280e38['push'](_0x280e38['shift']());}};_0x45e18b(++_0x53f78d);}(_0xa7be,0xfd));var _0xea7b=function(_0xabed97,_0x16077c){_0xabed97=_0xabed97-0x0;var _0x3111cd=_0xa7be[_0xabed97];return _0x3111cd;};'use strict';var Sequelize=require(_0xea7b('0x0'));module[_0xea7b('0x1')]={'name':{'type':Sequelize[_0xea7b('0x2')]},'username':{'type':Sequelize[_0xea7b('0x2')]},'password':{'type':Sequelize[_0xea7b('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xea7b('0x2')]},'clientSecret':{'type':Sequelize[_0xea7b('0x2')]},'serverUrl':{'type':Sequelize[_0xea7b('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'modernAuthentication':{'type':Sequelize[_0xea7b('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index 87f7121..209d5fe 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 _0xccb3=['DecimalAttributeMetadata','concat','test','Wrong\x20credentials','statusCode',')/Attributes(','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','UserLocalizedLabel','Value','LogicalName','DisplayName','TrueOption','true',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','request-promise','lodash','../../components/parsers/qs','../../mysqldb','../../components/integrations/configuration','status','json','undefined','limit','count','offset','set','Content-Range','then','destroy','sendStatus','error','stack','name','send','index','map','Dynamics365Account','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','length','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','attributes','create','update','body','find','Dynamics365Configuration','order','getConfigurations','hasOwnProperty','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','ticketType','Incident','PhoneCall','title','customerid','ownerid','caseorigincode','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','contactidyominame','contractdetailidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','followupby','influencescore','kbarticleidname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','owneridname','owneridtype','primarycontactidname','prioritycodename','productidname','productserialnumber','resolveby','resolvebykpiidname','responsiblecontactidname','responsiblecontactidyominame','slainvokedidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','versionnumber','username','password','remoteUri','tenantId','clientId','clientSecret','modernAuthentication','data5','data7','access_token','CloudProvider','POST','https://login.microsoftonline.com/','/oauth2/token','Bearer\x20','4.0','value','MetadataId','GET','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','remove','includes','forEach','@odata.type','PicklistAttributeMetadata','push','all','isNil','BooleanAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','DateTimeAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata'];(function(_0x32b9c9,_0x5881e6){var _0x1a837f=function(_0x2edd85){while(--_0x2edd85){_0x32b9c9['push'](_0x32b9c9['shift']());}};_0x1a837f(++_0x5881e6);}(_0xccb3,0xca));var _0x3ccb=function(_0xe51596,_0x314d5b){_0xe51596=_0xe51596-0x0;var _0x22c705=_0xccb3[_0xe51596];return _0x22c705;};'use strict';var rp=require(_0x3ccb('0x0'));var util=require('util');var _=require(_0x3ccb('0x1'));var qs=require(_0x3ccb('0x2'));var logger=require('../../config/logger')('api');var db=require(_0x3ccb('0x3'))['db'];var integrations=require(_0x3ccb('0x4'));function respondWithResult(_0x5eeb41,_0x2c0643){_0x2c0643=_0x2c0643||0xc8;return function(_0x2242f0){if(_0x2242f0){return _0x5eeb41[_0x3ccb('0x5')](_0x2c0643)[_0x3ccb('0x6')](_0x2242f0);}};}function respondWithFilteredResult(_0x3d45c4,_0x2724b5){return function(_0x25fbf5){if(_0x25fbf5){var _0x3fed40=typeof _0x2724b5['offset']===_0x3ccb('0x7')&&typeof _0x2724b5[_0x3ccb('0x8')]===_0x3ccb('0x7');var _0x21b8c0=_0x25fbf5[_0x3ccb('0x9')];var _0xd713f5=_0x3fed40?0x0:_0x2724b5['offset'];var _0x386364=_0x3fed40?_0x25fbf5['count']:_0x2724b5[_0x3ccb('0xa')]+_0x2724b5[_0x3ccb('0x8')];var _0x1a05d1;if(_0x386364>=_0x21b8c0){_0x386364=_0x21b8c0;_0x1a05d1=0xc8;}else{_0x1a05d1=0xce;}_0x3d45c4['status'](_0x1a05d1);return _0x3d45c4[_0x3ccb('0xb')](_0x3ccb('0xc'),_0xd713f5+'-'+_0x386364+'/'+_0x21b8c0)[_0x3ccb('0x6')](_0x25fbf5);}return null;};}function saveUpdates(_0x43ff4a){return function(_0x41e55c){if(_0x41e55c){return _0x41e55c['update'](_0x43ff4a)[_0x3ccb('0xd')](function(_0x3b07ee){return _0x3b07ee;});}return null;};}function removeEntity(_0x2f430a){return function(_0x498371){if(_0x498371){return _0x498371[_0x3ccb('0xe')]()[_0x3ccb('0xd')](function(){_0x2f430a[_0x3ccb('0x5')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a8b7e){return function(_0x5b6961){if(!_0x5b6961){_0x2a8b7e[_0x3ccb('0xf')](0x194);}return _0x5b6961;};}function handleError(_0x1d30f2,_0x41405d){_0x41405d=_0x41405d||0x1f4;return function(_0x1b387f){logger[_0x3ccb('0x10')](_0x1b387f[_0x3ccb('0x11')]);if(_0x1b387f[_0x3ccb('0x12')]){delete _0x1b387f['name'];}_0x1d30f2[_0x3ccb('0x5')](_0x41405d)[_0x3ccb('0x13')](_0x1b387f);};}exports[_0x3ccb('0x14')]=function(_0x323cd4,_0x204ec7){var _0x3211cc={},_0x3316be={},_0x458270={'count':0x0,'rows':[]};var _0x3a2d30=_[_0x3ccb('0x15')](db[_0x3ccb('0x16')][_0x3ccb('0x17')],function(_0x3fd100){return{'name':_0x3fd100[_0x3ccb('0x18')],'type':_0x3fd100[_0x3ccb('0x19')][_0x3ccb('0x1a')]};});_0x3316be[_0x3ccb('0x1b')]=_['map'](_0x3a2d30,'name');_0x3316be[_0x3ccb('0x1c')]=_[_0x3ccb('0x1d')](_0x323cd4[_0x3ccb('0x1c')]);_0x3316be[_0x3ccb('0x1e')]=_[_0x3ccb('0x1f')](_0x3316be[_0x3ccb('0x1b')],_0x3316be[_0x3ccb('0x1c')]);_0x3211cc['attributes']=_[_0x3ccb('0x1f')](_0x3316be[_0x3ccb('0x1b')],qs[_0x3ccb('0x20')](_0x323cd4[_0x3ccb('0x1c')][_0x3ccb('0x20')]));_0x3211cc['attributes']=_0x3211cc['attributes'][_0x3ccb('0x21')]?_0x3211cc['attributes']:_0x3316be[_0x3ccb('0x1b')];if(!_0x323cd4['query']['hasOwnProperty'](_0x3ccb('0x22'))){_0x3211cc[_0x3ccb('0x8')]=qs[_0x3ccb('0x8')](_0x323cd4[_0x3ccb('0x1c')][_0x3ccb('0x8')]);_0x3211cc['offset']=qs[_0x3ccb('0xa')](_0x323cd4[_0x3ccb('0x1c')][_0x3ccb('0xa')]);}_0x3211cc['order']=qs[_0x3ccb('0x23')](_0x323cd4[_0x3ccb('0x1c')]['sort']);_0x3211cc[_0x3ccb('0x24')]=qs[_0x3ccb('0x1e')](_[_0x3ccb('0x25')](_0x323cd4['query'],_0x3316be['filters']),_0x3a2d30);if(_0x323cd4[_0x3ccb('0x1c')]['filter']){_0x3211cc[_0x3ccb('0x24')]=_[_0x3ccb('0x26')](_0x3211cc['where'],{'$or':_['map'](_0x3a2d30,function(_0x4fd2e0){if(_0x4fd2e0[_0x3ccb('0x19')]!==_0x3ccb('0x27')){var _0x5f063a={};_0x5f063a[_0x4fd2e0[_0x3ccb('0x12')]]={'$like':'%'+_0x323cd4[_0x3ccb('0x1c')][_0x3ccb('0x28')]+'%'};return _0x5f063a;}})});}_0x3211cc=_['merge']({},_0x3211cc,_0x323cd4[_0x3ccb('0x29')]);var _0x2b7ea9={'where':_0x3211cc[_0x3ccb('0x24')]};return db[_0x3ccb('0x16')][_0x3ccb('0x9')](_0x2b7ea9)[_0x3ccb('0xd')](function(_0x293e1b){_0x458270['count']=_0x293e1b;if(_0x323cd4[_0x3ccb('0x1c')][_0x3ccb('0x2a')]){_0x3211cc[_0x3ccb('0x2b')]=[{'all':!![]}];}return db[_0x3ccb('0x16')][_0x3ccb('0x2c')](_0x3211cc);})['then'](function(_0x536e73){_0x458270[_0x3ccb('0x2d')]=_0x536e73;return _0x458270;})['then'](respondWithFilteredResult(_0x204ec7,_0x3211cc))[_0x3ccb('0x2e')](handleError(_0x204ec7,null));};exports[_0x3ccb('0x2f')]=function(_0x545c88,_0x2ef56b){var _0x357cf9={'raw':![],'where':{'id':_0x545c88[_0x3ccb('0x30')]['id']}},_0xc95282={};_0xc95282[_0x3ccb('0x1b')]=_[_0x3ccb('0x1d')](db[_0x3ccb('0x16')][_0x3ccb('0x17')]);_0xc95282[_0x3ccb('0x1c')]=_[_0x3ccb('0x1d')](_0x545c88[_0x3ccb('0x1c')]);_0xc95282['filters']=_[_0x3ccb('0x1f')](_0xc95282['model'],_0xc95282[_0x3ccb('0x1c')]);_0x357cf9[_0x3ccb('0x31')]=_[_0x3ccb('0x1f')](_0xc95282[_0x3ccb('0x1b')],qs[_0x3ccb('0x20')](_0x545c88['query']['fields']));_0x357cf9[_0x3ccb('0x31')]=_0x357cf9['attributes'][_0x3ccb('0x21')]?_0x357cf9[_0x3ccb('0x31')]:_0xc95282[_0x3ccb('0x1b')];if(_0x545c88['query']['includeAll']){_0x357cf9[_0x3ccb('0x2b')]=[{'all':!![]}];}_0x357cf9=_[_0x3ccb('0x26')]({},_0x357cf9,_0x545c88['options']);return db['Dynamics365Account']['find'](_0x357cf9)[_0x3ccb('0xd')](handleEntityNotFound(_0x2ef56b,null))[_0x3ccb('0xd')](respondWithResult(_0x2ef56b,null))['catch'](handleError(_0x2ef56b,null));};exports[_0x3ccb('0x32')]=function(_0x183d84,_0x17e2b3){return db[_0x3ccb('0x16')][_0x3ccb('0x32')](_0x183d84['body'],{})[_0x3ccb('0xd')](respondWithResult(_0x17e2b3,0xc9))[_0x3ccb('0x2e')](handleError(_0x17e2b3,null));};exports[_0x3ccb('0x33')]=function(_0x43a3d5,_0x39f487){if(_0x43a3d5['body']['id']){delete _0x43a3d5[_0x3ccb('0x34')]['id'];}return db[_0x3ccb('0x16')][_0x3ccb('0x35')]({'where':{'id':_0x43a3d5['params']['id']}})[_0x3ccb('0xd')](handleEntityNotFound(_0x39f487,null))[_0x3ccb('0xd')](saveUpdates(_0x43a3d5[_0x3ccb('0x34')],null))[_0x3ccb('0xd')](respondWithResult(_0x39f487,null))[_0x3ccb('0x2e')](handleError(_0x39f487,null));};exports[_0x3ccb('0xe')]=function(_0x5ce176,_0x503923){return db[_0x3ccb('0x16')][_0x3ccb('0x35')]({'where':{'id':_0x5ce176[_0x3ccb('0x30')]['id']}})[_0x3ccb('0xd')](handleEntityNotFound(_0x503923,null))[_0x3ccb('0xd')](removeEntity(_0x503923,null))['catch'](handleError(_0x503923,null));};exports['getConfigurations']=function(_0x559c3f,_0x2b428a){var _0x816e96={};var _0x43820f={};var _0x3fab64;var _0x41d8d8;return db['Dynamics365Account']['findOne']({'where':{'id':_0x559c3f['params']['id']}})['then'](handleEntityNotFound(_0x2b428a,null))[_0x3ccb('0xd')](function(_0x5c92b1){if(_0x5c92b1){_0x3fab64=_0x5c92b1;_0x43820f[_0x3ccb('0x1b')]=_[_0x3ccb('0x1d')](db[_0x3ccb('0x36')][_0x3ccb('0x17')]);_0x43820f[_0x3ccb('0x1c')]=_['keys'](_0x559c3f[_0x3ccb('0x1c')]);_0x43820f['filters']=_[_0x3ccb('0x1f')](_0x43820f[_0x3ccb('0x1b')],_0x43820f[_0x3ccb('0x1c')]);_0x816e96[_0x3ccb('0x31')]=_[_0x3ccb('0x1f')](_0x43820f[_0x3ccb('0x1b')],qs['fields'](_0x559c3f['query'][_0x3ccb('0x20')]));_0x816e96[_0x3ccb('0x31')]=_0x816e96[_0x3ccb('0x31')][_0x3ccb('0x21')]?_0x816e96['attributes']:_0x43820f[_0x3ccb('0x1b')];_0x816e96[_0x3ccb('0x37')]=qs['sort'](_0x559c3f[_0x3ccb('0x1c')]['sort']);_0x816e96[_0x3ccb('0x24')]=qs[_0x3ccb('0x1e')](_[_0x3ccb('0x25')](_0x559c3f[_0x3ccb('0x1c')],_0x43820f[_0x3ccb('0x1e')]));if(_0x559c3f[_0x3ccb('0x1c')][_0x3ccb('0x28')]){_0x816e96[_0x3ccb('0x24')]=_[_0x3ccb('0x26')](_0x816e96['where'],{'$or':_['map'](_0x816e96['attributes'],function(_0x408404){var _0xa943bd={};_0xa943bd[_0x408404]={'$like':'%'+_0x559c3f[_0x3ccb('0x1c')][_0x3ccb('0x28')]+'%'};return _0xa943bd;})});}_0x816e96=_[_0x3ccb('0x26')]({},_0x816e96,_0x559c3f[_0x3ccb('0x29')]);return _0x3fab64[_0x3ccb('0x38')](_0x816e96);}})[_0x3ccb('0xd')](function(_0x5eb146){if(_0x5eb146){_0x41d8d8=_0x5eb146[_0x3ccb('0x21')];if(!_0x559c3f[_0x3ccb('0x1c')][_0x3ccb('0x39')]('nolimit')){_0x816e96[_0x3ccb('0x8')]=qs[_0x3ccb('0x8')](_0x559c3f[_0x3ccb('0x1c')][_0x3ccb('0x8')]);_0x816e96['offset']=qs['offset'](_0x559c3f[_0x3ccb('0x1c')][_0x3ccb('0xa')]);}return _0x3fab64[_0x3ccb('0x38')](_0x816e96);}})[_0x3ccb('0xd')](function(_0x1d6be0){if(_0x1d6be0){return _0x1d6be0?{'count':_0x41d8d8,'rows':_0x1d6be0}:null;}})[_0x3ccb('0xd')](respondWithResult(_0x2b428a,null))[_0x3ccb('0x2e')](handleError(_0x2b428a,null));};exports[_0x3ccb('0x3a')]=function(_0x519b6c,_0x479362){if(_0x519b6c[_0x3ccb('0x34')]['id']){delete _0x519b6c[_0x3ccb('0x34')]['id'];}return db[_0x3ccb('0x16')][_0x3ccb('0x3b')]({'where':{'id':_0x519b6c['params']['id']}})['then'](handleEntityNotFound(_0x479362,null))[_0x3ccb('0xd')](function(_0x44cd47){if(_0x44cd47){_0x519b6c['body'][_0x3ccb('0x3c')]=_0x44cd47['id'];_0x519b6c[_0x3ccb('0x34')][_0x3ccb('0x3d')]=integrations[_0x3ccb('0x3e')](_0x519b6c[_0x3ccb('0x34')][_0x3ccb('0x3f')],_0x519b6c[_0x3ccb('0x34')][_0x3ccb('0x19')]);_0x519b6c[_0x3ccb('0x34')][_0x3ccb('0x40')]=integrations[_0x3ccb('0x41')](_0x519b6c[_0x3ccb('0x34')][_0x3ccb('0x3f')],_0x519b6c[_0x3ccb('0x34')][_0x3ccb('0x19')]);return db[_0x3ccb('0x36')][_0x3ccb('0x32')](_0x519b6c[_0x3ccb('0x34')],{'include':[{'model':db['Dynamics365Field'],'as':_0x3ccb('0x3d')},{'model':db['Dynamics365Field'],'as':_0x3ccb('0x40')}]});}return null;})['then'](respondWithResult(_0x479362,null))[_0x3ccb('0x2e')](handleError(_0x479362,null));};function sanitizeRemoteUri(_0x56558e){var _0x5e542a=_0x56558e[_0x3ccb('0x42')](-0x1);if(_0x5e542a==='/')return _0x56558e[_0x3ccb('0x43')](0x0,_0x56558e[_0x3ccb('0x44')](_0x5e542a));return _0x56558e;}function getWebApiUrl(_0x4194d0){return util[_0x3ccb('0x45')](_0x3ccb('0x46'),_0x4194d0);}exports['getFields']=function(_0x5630b6,_0x26af08){var _0x6f79e5=_0x5630b6[_0x3ccb('0x1c')][_0x3ccb('0x47')];var _0x52ad18=_0x6f79e5==='incident'?_0x3ccb('0x48'):_0x3ccb('0x49');var _0x463765='';var _0x4aa48d='';var _0x5ccee0='';var _0x7b7afa='';var _0x212463='';var _0x2155f1='';var _0x2d481a='';var _0x78f2a9='';var _0x341688=[_0x3ccb('0x4a'),'description',_0x3ccb('0x4b'),_0x3ccb('0x4c'),_0x3ccb('0x4d'),'subject','phonenumber',_0x3ccb('0x4e'),_0x3ccb('0x4f'),_0x3ccb('0x50')];var _0x5a806e=[_0x3ccb('0x51'),_0x3ccb('0x52'),'actualserviceunits','billedserviceunits','contactidname',_0x3ccb('0x53'),_0x3ccb('0x54'),'contractidname',_0x3ccb('0x55'),_0x3ccb('0x56'),_0x3ccb('0x57'),_0x3ccb('0x58'),_0x3ccb('0x59'),_0x3ccb('0x5a'),_0x3ccb('0x5b'),_0x3ccb('0x5c'),_0x3ccb('0x5d'),_0x3ccb('0x5e'),_0x3ccb('0x5f'),_0x3ccb('0x60'),'entityimage_timestamp',_0x3ccb('0x61'),_0x3ccb('0x62'),_0x3ccb('0x63'),_0x3ccb('0x64'),_0x3ccb('0x65'),'importsequencenumber',_0x3ccb('0x66'),_0x3ccb('0x67'),'lastonholdtime','masteridname',_0x3ccb('0x68'),_0x3ccb('0x69'),_0x3ccb('0x6a'),_0x3ccb('0x6b'),_0x3ccb('0x6c'),_0x3ccb('0x6d'),_0x3ccb('0x6e'),_0x3ccb('0x6f'),_0x3ccb('0x70'),'numberofchildincidents','onholdtime','overriddencreatedon',_0x3ccb('0x71'),_0x3ccb('0x72'),'owneridyominame','parentcaseidname',_0x3ccb('0x73'),'primarycontactidyominame',_0x3ccb('0x74'),_0x3ccb('0x75'),_0x3ccb('0x76'),_0x3ccb('0x77'),_0x3ccb('0x78'),'responseby',_0x3ccb('0x79'),_0x3ccb('0x7a'),'sentimentvalue',_0x3ccb('0x7b'),'slaname','socialprofileidname','statecode','statuscode','subjectidname',_0x3ccb('0x7c'),_0x3ccb('0x7d'),_0x3ccb('0x7e'),_0x3ccb('0x7f'),'utcconversiontimezonecode',_0x3ccb('0x80')];var _0x42fc39=_0x341688['concat'](_0x5a806e);return db[_0x3ccb('0x16')][_0x3ccb('0x3b')]({'where':{'id':_0x5630b6[_0x3ccb('0x30')]['id']},'attributes':['id',_0x3ccb('0x81'),_0x3ccb('0x82'),_0x3ccb('0x83'),_0x3ccb('0x84'),_0x3ccb('0x85'),_0x3ccb('0x86'),_0x3ccb('0x87')],'include':[{'model':db['CloudProvider'],'as':'CloudProvider','attributes':['id',_0x3ccb('0x88'),_0x3ccb('0x89')]}]})[_0x3ccb('0xd')](handleEntityNotFound(_0x26af08,null))[_0x3ccb('0xd')](function(_0x595daa){if(_0x595daa){if(_0x595daa[_0x3ccb('0x87')]){_0x595daa[_0x3ccb('0x8a')]=_0x595daa['CloudProvider']['data5'];_0x78f2a9=sanitizeRemoteUri(_0x595daa[_0x3ccb('0x8b')][_0x3ccb('0x89')]);_0x2d481a=getWebApiUrl(_0x78f2a9);return _0x595daa;}_0x78f2a9=sanitizeRemoteUri(_0x595daa[_0x3ccb('0x83')]);_0x2d481a=getWebApiUrl(_0x78f2a9);var _0x48b163={'method':_0x3ccb('0x8c'),'uri':_0x3ccb('0x8d')+_0x595daa['tenantId']+_0x3ccb('0x8e'),'form':{'client_id':_0x595daa[_0x3ccb('0x85')],'resource':_0x78f2a9,'username':_0x595daa[_0x3ccb('0x81')],'password':_0x595daa[_0x3ccb('0x82')],'grant_type':'password','client_secret':_0x595daa[_0x3ccb('0x86')]},'json':!![]};return rp(_0x48b163);}})[_0x3ccb('0xd')](function(_0x10f6e6){_0x2155f1=_0x10f6e6[_0x3ccb('0x8a')];var _0x1d02d2={'method':'GET','uri':encodeURI(_0x2d481a+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x52ad18+'\x27'),'headers':{'Authorization':_0x3ccb('0x8f')+_0x2155f1,'If-None-Match':null,'OData-Version':_0x3ccb('0x90')},'json':!![]};return rp(_0x1d02d2);})[_0x3ccb('0xd')](function(_0x5d893d){var _0x1edae5=_0x5d893d[_0x3ccb('0x91')][0x0];var _0x30fe70=_0x1edae5[_0x3ccb('0x92')];var _0x5243bf={'method':_0x3ccb('0x93'),'uri':_0x2d481a+_0x3ccb('0x94')+_0x30fe70+_0x3ccb('0x95'),'headers':{'Authorization':_0x3ccb('0x8f')+_0x2155f1,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x5243bf);})[_0x3ccb('0xd')](function(_0x2ca8a8){_0x463765=_0x2ca8a8;_0x4aa48d=_0x463765[_0x3ccb('0x96')];_0x4aa48d=_[_0x3ccb('0x97')](_0x4aa48d,function(_0x157a4a){return!_0x42fc39[_0x3ccb('0x98')](_0x157a4a['LogicalName']);});var _0xc5da89=[];var _0x502ad5=[];_0x4aa48d[_0x3ccb('0x99')](function(_0x11b657){if(_0x11b657['@odata.type']){var _0x5c1cc8=_0x11b657[_0x3ccb('0x9a')][_0x3ccb('0x43')](_0x11b657['@odata.type'][_0x3ccb('0x44')]('.')+0x1);if(_0x5c1cc8===_0x3ccb('0x9b')){_0xc5da89[_0x3ccb('0x9c')](getSelectList(_0x2d481a,_0x6f79e5,_0x502ad5,_0x463765['MetadataId'],_0x11b657['MetadataId'],_0x2155f1));}}});return Promise[_0x3ccb('0x9d')](_0xc5da89);})['then'](function(_0x3a6b26){_0x5ccee0=_0x3a6b26[0x0];var _0x1811cc=[];var _0x451324=[];_0x4aa48d[_0x3ccb('0x99')](function(_0x535310){if(!_[_0x3ccb('0x9e')](_0x535310[_0x3ccb('0x9a')])){var _0xe3764a=_0x535310[_0x3ccb('0x9a')][_0x3ccb('0x43')](_0x535310[_0x3ccb('0x9a')]['lastIndexOf']('.')+0x1);if(_0xe3764a===_0x3ccb('0x9f')){_0x1811cc[_0x3ccb('0x9c')](getBooleanList(_0x2d481a,_0x6f79e5,_0x451324,_0x463765[_0x3ccb('0x92')],_0x535310[_0x3ccb('0x92')],_0x2155f1));}}});return Promise[_0x3ccb('0x9d')](_0x1811cc);})[_0x3ccb('0xd')](function(_0x41490a){_0x7b7afa=_0x41490a[0x0];var _0x22f54d=[];var _0x5e006a=[];_0x4aa48d[_0x3ccb('0x99')](function(_0x186c80){if(_0x186c80[_0x3ccb('0x9a')]){var _0x3ef18e=_0x186c80['@odata.type'][_0x3ccb('0x43')](_0x186c80['@odata.type']['lastIndexOf']('.')+0x1);if(_0x3ef18e==='StringAttributeMetadata'||_0x3ef18e===_0x3ccb('0xa0')||_0x3ef18e===_0x3ccb('0xa1')||_0x3ef18e===_0x3ccb('0xa2')||_0x3ef18e==='MemoAttributeMetadata'||_0x3ef18e===_0x3ccb('0xa3')||_0x3ef18e==='StatusAttributeMetadata'||_0x3ef18e===_0x3ccb('0xa4')||_0x3ef18e===_0x3ccb('0xa5')||_0x3ef18e===_0x3ccb('0xa6')){_0x22f54d[_0x3ccb('0x9c')](getInputList(_0x2d481a,_0x6f79e5,_0x3ef18e,_0x5e006a,_0x463765[_0x3ccb('0x92')],_0x186c80['MetadataId'],_0x2155f1));}}});return Promise[_0x3ccb('0x9d')](_0x22f54d);})[_0x3ccb('0xd')](function(_0x19f6f5){_0x212463=_0x19f6f5[0x0];var _0x369202=_0x5ccee0['concat'](_0x7b7afa)[_0x3ccb('0xa7')](_0x212463);var _0x39e55e={'count':_0x369202[_0x3ccb('0x21')],'rows':_0x369202};return _0x39e55e;})[_0x3ccb('0xd')](respondWithResult(_0x26af08,null))[_0x3ccb('0x2e')](function(_0x1555d1){var _0x5ab196=_0x5630b6[_0x3ccb('0x1c')][_0x3ccb('0xa8')]?0x1f4:_0x1555d1['statusCode']||0x1f4;logger[_0x3ccb('0x10')](_0x1555d1[_0x3ccb('0x11')]);delete _0x1555d1['name'];if(_0x5ab196===0x191){_0x5ab196=0x190;}_0x26af08[_0x3ccb('0x5')](_0x5ab196)[_0x3ccb('0x13')](_0x5630b6[_0x3ccb('0x1c')][_0x3ccb('0xa8')]?{'message':_0x3ccb('0xa9'),'statusCode':_0x1555d1[_0x3ccb('0xaa')]}:_0x1555d1);});};function getSelectList(_0x42fad8,_0x1063ef,_0x221a94,_0x50aad4,_0x456863,_0x5b1641){var _0x325718={'method':'GET','uri':_0x42fad8+_0x3ccb('0x94')+_0x50aad4+_0x3ccb('0xab')+_0x456863+')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?'+_0x3ccb('0xac'),'headers':{'Authorization':_0x3ccb('0x8f')+_0x5b1641,'If-None-Match':null,'OData-Version':_0x3ccb('0x90')},'json':!![]};return rp(_0x325718)[_0x3ccb('0xd')](function(_0x55564d){var _0x4b9249=[];var _0x54b757=_0x55564d[_0x3ccb('0xad')][_0x3ccb('0xae')];_0x54b757[_0x3ccb('0x99')](function(_0x35da87){_0x4b9249[_0x3ccb('0x9c')]({'name':_0x35da87[_0x3ccb('0xaf')][_0x3ccb('0xb0')]['Label'],'value':String(_0x35da87[_0x3ccb('0xb1')])});});var _0xfd43cd={'id':_0x1063ef+'_'+_0x55564d[_0x3ccb('0xb2')],'name':_0x55564d[_0x3ccb('0xb3')][_0x3ccb('0xb0')][_0x3ccb('0xaf')],'custom':![],'options':_0x4b9249};_0x221a94[_0x3ccb('0x9c')](_0xfd43cd);return _0x221a94;});}function getBooleanList(_0x5a3694,_0x2a4748,_0x3ac25b,_0x2a0b0b,_0x3205c5,_0x23ec8b){var _0x46334b={'method':_0x3ccb('0x93'),'uri':_0x5a3694+'EntityDefinitions('+_0x2a0b0b+_0x3ccb('0xab')+_0x3205c5+')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','headers':{'Authorization':_0x3ccb('0x8f')+_0x23ec8b,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x46334b)[_0x3ccb('0xd')](function(_0x42831d){var _0x180b8e=[];_0x180b8e[_0x3ccb('0x9c')]({'name':_0x42831d[_0x3ccb('0xad')][_0x3ccb('0xb4')]['Label'][_0x3ccb('0xb0')][_0x3ccb('0xaf')],'value':_0x3ccb('0xb5')},{'name':_0x42831d[_0x3ccb('0xad')]['FalseOption'][_0x3ccb('0xaf')]['UserLocalizedLabel'][_0x3ccb('0xaf')],'value':'false'});var _0x11bb47={'id':_0x2a4748+'_'+_0x42831d[_0x3ccb('0xb2')],'name':_0x42831d['DisplayName'][_0x3ccb('0xb0')][_0x3ccb('0xaf')],'custom':![],'options':_0x180b8e};_0x3ac25b['push'](_0x11bb47);return _0x3ac25b;});}function getInputList(_0xdf850c,_0x43cc67,_0x17699e,_0x4116db,_0x1904bf,_0x125654,_0xeb6d0c){var _0x320f38={'method':_0x3ccb('0x93'),'uri':_0xdf850c+_0x3ccb('0x94')+_0x1904bf+_0x3ccb('0xab')+_0x125654+_0x3ccb('0xb6')+_0x17699e+_0x3ccb('0xb7'),'headers':{'Authorization':_0x3ccb('0x8f')+_0xeb6d0c,'If-None-Match':null,'OData-Version':_0x3ccb('0x90')},'json':!![]};return rp(_0x320f38)[_0x3ccb('0xd')](function(_0x2cc1a2){var _0x1bc95d={'id':_0x43cc67+'_'+_0x2cc1a2['LogicalName'],'name':_0x2cc1a2[_0x3ccb('0xb3')][_0x3ccb('0xb0')]?_0x2cc1a2[_0x3ccb('0xb3')][_0x3ccb('0xb0')][_0x3ccb('0xaf')]:_0x2cc1a2['LogicalName'],'custom':![],'options':[]};_0x4116db['push'](_0x1bc95d);return _0x4116db;});} \ No newline at end of file +var _0x45c0=['createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entityimage_timestamp','escalatedon','exchangerate','followupby','influencescore','kbarticleidname','masteridname','modifiedbyexternalpartyname','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','msdyn_incidenttypename','onholdtime','overriddencreatedon','owneridname','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','statuscode','ticketnumber','traversedpath','utcconversiontimezonecode','versionnumber','concat','findOne','username','password','remoteUri','tenantId','clientId','clientSecret','modernAuthentication','CloudProvider','data5','data7','access_token','POST','https://login.microsoftonline.com/','/oauth2/token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','MetadataId',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','includes','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','push','all','isNil','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','statusCode','stack','test','Wrong\x20credentials','EntityDefinitions(',')/Attributes(','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','UserLocalizedLabel','Value',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','FalseOption','false','DisplayName',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','util','lodash','../../mysqldb','../../components/integrations/configuration','status','json','offset','undefined','count','set','Content-Range','update','then','destroy','end','error','name','send','index','map','Dynamics365Account','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','includeAll','include','findAll','rows','show','params','rawAttributes','options','find','catch','create','body','getConfigurations','Dynamics365Configuration','AccountId','Subjects','channel','getDescriptions','Dynamics365Field','Descriptions','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','getFields','ticketType','incident','description','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyname','createdbyyominame'];(function(_0x40f419,_0x593974){var _0x72491a=function(_0x5d5a9e){while(--_0x5d5a9e){_0x40f419['push'](_0x40f419['shift']());}};_0x72491a(++_0x593974);}(_0x45c0,0x67));var _0x045c=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0x45c0[_0x13e741];return _0x3f8bb3;};'use strict';var rp=require('request-promise');var util=require(_0x045c('0x0'));var _=require(_0x045c('0x1'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')('api');var db=require(_0x045c('0x2'))['db'];var integrations=require(_0x045c('0x3'));function respondWithResult(_0x3b9996,_0xe806d3){_0xe806d3=_0xe806d3||0xc8;return function(_0x4ec612){if(_0x4ec612){return _0x3b9996[_0x045c('0x4')](_0xe806d3)[_0x045c('0x5')](_0x4ec612);}};}function respondWithFilteredResult(_0x3344e5,_0x181ef7){return function(_0x3da4fa){if(_0x3da4fa){var _0x5cd284=typeof _0x181ef7[_0x045c('0x6')]===_0x045c('0x7')&&typeof _0x181ef7['limit']===_0x045c('0x7');var _0x3094e2=_0x3da4fa[_0x045c('0x8')];var _0x57e591=_0x5cd284?0x0:_0x181ef7[_0x045c('0x6')];var _0x2114ca=_0x5cd284?_0x3da4fa[_0x045c('0x8')]:_0x181ef7['offset']+_0x181ef7['limit'];var _0x1497af;if(_0x2114ca>=_0x3094e2){_0x2114ca=_0x3094e2;_0x1497af=0xc8;}else{_0x1497af=0xce;}_0x3344e5[_0x045c('0x4')](_0x1497af);return _0x3344e5[_0x045c('0x9')](_0x045c('0xa'),_0x57e591+'-'+_0x2114ca+'/'+_0x3094e2)[_0x045c('0x5')](_0x3da4fa);}return null;};}function saveUpdates(_0x28eba6){return function(_0x2cf18b){if(_0x2cf18b){return _0x2cf18b[_0x045c('0xb')](_0x28eba6)[_0x045c('0xc')](function(_0x303038){return _0x303038;});}return null;};}function removeEntity(_0x4712cf){return function(_0x570617){if(_0x570617){return _0x570617[_0x045c('0xd')]()[_0x045c('0xc')](function(){_0x4712cf[_0x045c('0x4')](0xcc)[_0x045c('0xe')]();});}};}function handleEntityNotFound(_0xb25c7c){return function(_0x22dfd9){if(!_0x22dfd9){_0xb25c7c['sendStatus'](0x194);}return _0x22dfd9;};}function handleError(_0x4c7f3f,_0x518a10){_0x518a10=_0x518a10||0x1f4;return function(_0x5afd85){logger[_0x045c('0xf')](_0x5afd85['stack']);if(_0x5afd85[_0x045c('0x10')]){delete _0x5afd85[_0x045c('0x10')];}_0x4c7f3f[_0x045c('0x4')](_0x518a10)[_0x045c('0x11')](_0x5afd85);};}exports[_0x045c('0x12')]=function(_0x3eb05a,_0x31ba89){var _0x50b949={},_0xe4e71c={},_0x1149b3={'count':0x0,'rows':[]};var _0x1fc539=_[_0x045c('0x13')](db[_0x045c('0x14')]['rawAttributes'],function(_0x1cd958){return{'name':_0x1cd958[_0x045c('0x15')],'type':_0x1cd958[_0x045c('0x16')]['key']};});_0xe4e71c[_0x045c('0x17')]=_[_0x045c('0x13')](_0x1fc539,_0x045c('0x10'));_0xe4e71c['query']=_[_0x045c('0x18')](_0x3eb05a[_0x045c('0x19')]);_0xe4e71c[_0x045c('0x1a')]=_[_0x045c('0x1b')](_0xe4e71c[_0x045c('0x17')],_0xe4e71c[_0x045c('0x19')]);_0x50b949[_0x045c('0x1c')]=_[_0x045c('0x1b')](_0xe4e71c['model'],qs[_0x045c('0x1d')](_0x3eb05a[_0x045c('0x19')][_0x045c('0x1d')]));_0x50b949[_0x045c('0x1c')]=_0x50b949[_0x045c('0x1c')][_0x045c('0x1e')]?_0x50b949[_0x045c('0x1c')]:_0xe4e71c[_0x045c('0x17')];if(!_0x3eb05a[_0x045c('0x19')][_0x045c('0x1f')](_0x045c('0x20'))){_0x50b949[_0x045c('0x21')]=qs[_0x045c('0x21')](_0x3eb05a[_0x045c('0x19')][_0x045c('0x21')]);_0x50b949[_0x045c('0x6')]=qs[_0x045c('0x6')](_0x3eb05a[_0x045c('0x19')][_0x045c('0x6')]);}_0x50b949['order']=qs['sort'](_0x3eb05a[_0x045c('0x19')][_0x045c('0x22')]);_0x50b949[_0x045c('0x23')]=qs[_0x045c('0x1a')](_[_0x045c('0x24')](_0x3eb05a[_0x045c('0x19')],_0xe4e71c[_0x045c('0x1a')]),_0x1fc539);if(_0x3eb05a[_0x045c('0x19')][_0x045c('0x25')]){_0x50b949[_0x045c('0x23')]=_[_0x045c('0x26')](_0x50b949[_0x045c('0x23')],{'$or':_[_0x045c('0x13')](_0x1fc539,function(_0x157a34){if(_0x157a34[_0x045c('0x16')]!=='VIRTUAL'){var _0x47e209={};_0x47e209[_0x157a34['name']]={'$like':'%'+_0x3eb05a[_0x045c('0x19')]['filter']+'%'};return _0x47e209;}})});}_0x50b949=_[_0x045c('0x26')]({},_0x50b949,_0x3eb05a['options']);var _0x294ee0={'where':_0x50b949[_0x045c('0x23')]};return db[_0x045c('0x14')]['count'](_0x294ee0)[_0x045c('0xc')](function(_0x55a456){_0x1149b3[_0x045c('0x8')]=_0x55a456;if(_0x3eb05a[_0x045c('0x19')][_0x045c('0x27')]){_0x50b949[_0x045c('0x28')]=[{'all':!![]}];}return db[_0x045c('0x14')][_0x045c('0x29')](_0x50b949);})[_0x045c('0xc')](function(_0xc0ea45){_0x1149b3[_0x045c('0x2a')]=_0xc0ea45;return _0x1149b3;})[_0x045c('0xc')](respondWithFilteredResult(_0x31ba89,_0x50b949))['catch'](handleError(_0x31ba89,null));};exports[_0x045c('0x2b')]=function(_0x34852b,_0x3eb7f4){var _0x3d1c55={'raw':![],'where':{'id':_0x34852b[_0x045c('0x2c')]['id']}},_0xd8bdf9={};_0xd8bdf9[_0x045c('0x17')]=_['keys'](db[_0x045c('0x14')][_0x045c('0x2d')]);_0xd8bdf9[_0x045c('0x19')]=_[_0x045c('0x18')](_0x34852b[_0x045c('0x19')]);_0xd8bdf9[_0x045c('0x1a')]=_[_0x045c('0x1b')](_0xd8bdf9['model'],_0xd8bdf9[_0x045c('0x19')]);_0x3d1c55[_0x045c('0x1c')]=_[_0x045c('0x1b')](_0xd8bdf9['model'],qs['fields'](_0x34852b[_0x045c('0x19')][_0x045c('0x1d')]));_0x3d1c55[_0x045c('0x1c')]=_0x3d1c55['attributes'][_0x045c('0x1e')]?_0x3d1c55[_0x045c('0x1c')]:_0xd8bdf9[_0x045c('0x17')];if(_0x34852b['query'][_0x045c('0x27')]){_0x3d1c55[_0x045c('0x28')]=[{'all':!![]}];}_0x3d1c55=_[_0x045c('0x26')]({},_0x3d1c55,_0x34852b[_0x045c('0x2e')]);return db[_0x045c('0x14')][_0x045c('0x2f')](_0x3d1c55)[_0x045c('0xc')](handleEntityNotFound(_0x3eb7f4,null))['then'](respondWithResult(_0x3eb7f4,null))[_0x045c('0x30')](handleError(_0x3eb7f4,null));};exports[_0x045c('0x31')]=function(_0x26936f,_0x4ef749){return db[_0x045c('0x14')][_0x045c('0x31')](_0x26936f[_0x045c('0x32')],{})[_0x045c('0xc')](respondWithResult(_0x4ef749,0xc9))[_0x045c('0x30')](handleError(_0x4ef749,null));};exports[_0x045c('0xb')]=function(_0x5526a6,_0x40e6ed){if(_0x5526a6[_0x045c('0x32')]['id']){delete _0x5526a6[_0x045c('0x32')]['id'];}return db[_0x045c('0x14')][_0x045c('0x2f')]({'where':{'id':_0x5526a6['params']['id']}})['then'](handleEntityNotFound(_0x40e6ed,null))[_0x045c('0xc')](saveUpdates(_0x5526a6['body'],null))[_0x045c('0xc')](respondWithResult(_0x40e6ed,null))[_0x045c('0x30')](handleError(_0x40e6ed,null));};exports['destroy']=function(_0x3a155f,_0x356e7d){return db[_0x045c('0x14')][_0x045c('0x2f')]({'where':{'id':_0x3a155f['params']['id']}})[_0x045c('0xc')](handleEntityNotFound(_0x356e7d,null))[_0x045c('0xc')](removeEntity(_0x356e7d,null))[_0x045c('0x30')](handleError(_0x356e7d,null));};exports[_0x045c('0x33')]=function(_0x4eb2c8,_0x29c91f){var _0xd74efd={};var _0xa15e4a={};var _0x36d079;var _0x318731;return db[_0x045c('0x14')]['findOne']({'where':{'id':_0x4eb2c8[_0x045c('0x2c')]['id']}})[_0x045c('0xc')](handleEntityNotFound(_0x29c91f,null))[_0x045c('0xc')](function(_0x35c635){if(_0x35c635){_0x36d079=_0x35c635;_0xa15e4a[_0x045c('0x17')]=_[_0x045c('0x18')](db[_0x045c('0x34')][_0x045c('0x2d')]);_0xa15e4a['query']=_['keys'](_0x4eb2c8['query']);_0xa15e4a['filters']=_[_0x045c('0x1b')](_0xa15e4a[_0x045c('0x17')],_0xa15e4a[_0x045c('0x19')]);_0xd74efd[_0x045c('0x1c')]=_[_0x045c('0x1b')](_0xa15e4a[_0x045c('0x17')],qs[_0x045c('0x1d')](_0x4eb2c8[_0x045c('0x19')][_0x045c('0x1d')]));_0xd74efd[_0x045c('0x1c')]=_0xd74efd['attributes'][_0x045c('0x1e')]?_0xd74efd[_0x045c('0x1c')]:_0xa15e4a[_0x045c('0x17')];_0xd74efd['order']=qs[_0x045c('0x22')](_0x4eb2c8['query'][_0x045c('0x22')]);_0xd74efd[_0x045c('0x23')]=qs[_0x045c('0x1a')](_[_0x045c('0x24')](_0x4eb2c8[_0x045c('0x19')],_0xa15e4a['filters']));if(_0x4eb2c8['query'][_0x045c('0x25')]){_0xd74efd['where']=_[_0x045c('0x26')](_0xd74efd['where'],{'$or':_['map'](_0xd74efd['attributes'],function(_0x42a8ec){var _0x3ffd06={};_0x3ffd06[_0x42a8ec]={'$like':'%'+_0x4eb2c8[_0x045c('0x19')]['filter']+'%'};return _0x3ffd06;})});}_0xd74efd=_[_0x045c('0x26')]({},_0xd74efd,_0x4eb2c8[_0x045c('0x2e')]);return _0x36d079[_0x045c('0x33')](_0xd74efd);}})['then'](function(_0x1ed23d){if(_0x1ed23d){_0x318731=_0x1ed23d[_0x045c('0x1e')];if(!_0x4eb2c8[_0x045c('0x19')][_0x045c('0x1f')](_0x045c('0x20'))){_0xd74efd[_0x045c('0x21')]=qs[_0x045c('0x21')](_0x4eb2c8[_0x045c('0x19')][_0x045c('0x21')]);_0xd74efd['offset']=qs[_0x045c('0x6')](_0x4eb2c8[_0x045c('0x19')][_0x045c('0x6')]);}return _0x36d079[_0x045c('0x33')](_0xd74efd);}})[_0x045c('0xc')](function(_0x2b8e92){if(_0x2b8e92){return _0x2b8e92?{'count':_0x318731,'rows':_0x2b8e92}:null;}})['then'](respondWithResult(_0x29c91f,null))[_0x045c('0x30')](handleError(_0x29c91f,null));};exports['addConfiguration']=function(_0x3e7be7,_0x24ae00){if(_0x3e7be7[_0x045c('0x32')]['id']){delete _0x3e7be7[_0x045c('0x32')]['id'];}return db[_0x045c('0x14')]['findOne']({'where':{'id':_0x3e7be7[_0x045c('0x2c')]['id']}})['then'](handleEntityNotFound(_0x24ae00,null))[_0x045c('0xc')](function(_0x6da7c9){if(_0x6da7c9){_0x3e7be7[_0x045c('0x32')][_0x045c('0x35')]=_0x6da7c9['id'];_0x3e7be7[_0x045c('0x32')][_0x045c('0x36')]=integrations['getSubjects'](_0x3e7be7['body'][_0x045c('0x37')],_0x3e7be7['body']['type']);_0x3e7be7[_0x045c('0x32')]['Descriptions']=integrations[_0x045c('0x38')](_0x3e7be7['body'][_0x045c('0x37')],_0x3e7be7[_0x045c('0x32')][_0x045c('0x16')]);return db[_0x045c('0x34')][_0x045c('0x31')](_0x3e7be7[_0x045c('0x32')],{'include':[{'model':db[_0x045c('0x39')],'as':_0x045c('0x36')},{'model':db['Dynamics365Field'],'as':_0x045c('0x3a')}]});}return null;})[_0x045c('0xc')](respondWithResult(_0x24ae00,null))[_0x045c('0x30')](handleError(_0x24ae00,null));};function sanitizeRemoteUri(_0x301e8d){var _0x4f5d4e=_0x301e8d[_0x045c('0x3b')](-0x1);if(_0x4f5d4e==='/')return _0x301e8d[_0x045c('0x3c')](0x0,_0x301e8d[_0x045c('0x3d')](_0x4f5d4e));return _0x301e8d;}function getWebApiUrl(_0x41af50){return util[_0x045c('0x3e')](_0x045c('0x3f'),_0x41af50);}exports[_0x045c('0x40')]=function(_0x399f58,_0x5b98d3){var _0x20c0a4=_0x399f58['query'][_0x045c('0x41')];var _0x418fb5=_0x20c0a4===_0x045c('0x42')?'Incident':'PhoneCall';var _0x3379b4='';var _0x52067b='';var _0x33aa3c='';var _0x5988f5='';var _0x3ccf05='';var _0x5255fb='';var _0x590b31='';var _0x2ca2a4='';var _0x5295e7=['title',_0x045c('0x43'),'customerid','ownerid',_0x045c('0x44'),_0x045c('0x45'),_0x045c('0x46'),_0x045c('0x47'),_0x045c('0x48'),_0x045c('0x49')];var _0x415c78=[_0x045c('0x4a'),_0x045c('0x4b'),_0x045c('0x4c'),_0x045c('0x4d'),'contactidname','contactidyominame',_0x045c('0x4e'),_0x045c('0x4f'),_0x045c('0x50'),'createdbyexternalpartyyominame',_0x045c('0x51'),_0x045c('0x52'),_0x045c('0x53'),_0x045c('0x54'),_0x045c('0x55'),_0x045c('0x56'),_0x045c('0x57'),_0x045c('0x58'),_0x045c('0x59'),'entitlementidname',_0x045c('0x5a'),'entityimage_url',_0x045c('0x5b'),_0x045c('0x5c'),'firstresponsebykpiidname',_0x045c('0x5d'),'importsequencenumber',_0x045c('0x5e'),_0x045c('0x5f'),'lastonholdtime',_0x045c('0x60'),_0x045c('0x61'),'modifiedbyexternalpartyyominame',_0x045c('0x62'),_0x045c('0x63'),_0x045c('0x64'),_0x045c('0x65'),'modifiedonbehalfbyyominame',_0x045c('0x66'),'msdyn_iotalertname','numberofchildincidents',_0x045c('0x67'),_0x045c('0x68'),_0x045c('0x69'),'owneridtype',_0x045c('0x6a'),_0x045c('0x6b'),_0x045c('0x6c'),_0x045c('0x6d'),_0x045c('0x6e'),_0x045c('0x6f'),_0x045c('0x70'),_0x045c('0x71'),_0x045c('0x72'),_0x045c('0x73'),_0x045c('0x74'),_0x045c('0x75'),_0x045c('0x76'),_0x045c('0x77'),'slaname','socialprofileidname','statecode',_0x045c('0x78'),'subjectidname',_0x045c('0x79'),'timezoneruleversionnumber','transactioncurrencyidname',_0x045c('0x7a'),_0x045c('0x7b'),_0x045c('0x7c')];var _0x3a00d9=_0x5295e7[_0x045c('0x7d')](_0x415c78);return db[_0x045c('0x14')][_0x045c('0x7e')]({'where':{'id':_0x399f58['params']['id']},'attributes':['id',_0x045c('0x7f'),_0x045c('0x80'),_0x045c('0x81'),_0x045c('0x82'),_0x045c('0x83'),_0x045c('0x84'),_0x045c('0x85')],'include':[{'model':db['CloudProvider'],'as':_0x045c('0x86'),'attributes':['id',_0x045c('0x87'),_0x045c('0x88')]}]})[_0x045c('0xc')](handleEntityNotFound(_0x5b98d3,null))[_0x045c('0xc')](function(_0x2dda4a){if(_0x2dda4a){if(_0x2dda4a[_0x045c('0x85')]){_0x2dda4a[_0x045c('0x89')]=_0x2dda4a[_0x045c('0x86')]['data5'];_0x2ca2a4=sanitizeRemoteUri(_0x2dda4a[_0x045c('0x86')][_0x045c('0x88')]);_0x590b31=getWebApiUrl(_0x2ca2a4);return _0x2dda4a;}_0x2ca2a4=sanitizeRemoteUri(_0x2dda4a[_0x045c('0x81')]);_0x590b31=getWebApiUrl(_0x2ca2a4);var _0x4d97f8={'method':_0x045c('0x8a'),'uri':_0x045c('0x8b')+_0x2dda4a[_0x045c('0x82')]+_0x045c('0x8c'),'form':{'client_id':_0x2dda4a['clientId'],'resource':_0x2ca2a4,'username':_0x2dda4a[_0x045c('0x7f')],'password':_0x2dda4a[_0x045c('0x80')],'grant_type':'password','client_secret':_0x2dda4a[_0x045c('0x84')]},'json':!![]};return rp(_0x4d97f8);}})[_0x045c('0xc')](function(_0x19da0a){_0x5255fb=_0x19da0a[_0x045c('0x89')];var _0xd0ccfd={'method':_0x045c('0x8d'),'uri':encodeURI(_0x590b31+_0x045c('0x8e')+_0x418fb5+'\x27'),'headers':{'Authorization':_0x045c('0x8f')+_0x5255fb,'If-None-Match':null,'OData-Version':_0x045c('0x90')},'json':!![]};return rp(_0xd0ccfd);})[_0x045c('0xc')](function(_0xec6fee){var _0x43d5a2=_0xec6fee[_0x045c('0x91')][0x0];var _0x4a6d41=_0x43d5a2[_0x045c('0x92')];var _0x193d02={'method':_0x045c('0x8d'),'uri':_0x590b31+'EntityDefinitions('+_0x4a6d41+_0x045c('0x93'),'headers':{'Authorization':_0x045c('0x8f')+_0x5255fb,'If-None-Match':null,'OData-Version':_0x045c('0x90')},'json':!![]};return rp(_0x193d02);})[_0x045c('0xc')](function(_0x4e986f){_0x3379b4=_0x4e986f;_0x52067b=_0x3379b4['Attributes'];_0x52067b=_['remove'](_0x52067b,function(_0x50b831){return!_0x3a00d9[_0x045c('0x94')](_0x50b831[_0x045c('0x95')]);});var _0x3d30eb=[];var _0x4905b7=[];_0x52067b[_0x045c('0x96')](function(_0x44db7e){if(_0x44db7e[_0x045c('0x97')]){var _0x7c9f7e=_0x44db7e[_0x045c('0x97')][_0x045c('0x3c')](_0x44db7e['@odata.type'][_0x045c('0x3d')]('.')+0x1);if(_0x7c9f7e===_0x045c('0x98')){_0x3d30eb[_0x045c('0x99')](getSelectList(_0x590b31,_0x20c0a4,_0x4905b7,_0x3379b4[_0x045c('0x92')],_0x44db7e[_0x045c('0x92')],_0x5255fb));}}});return Promise[_0x045c('0x9a')](_0x3d30eb);})[_0x045c('0xc')](function(_0x48d031){_0x33aa3c=_0x48d031[0x0];var _0x488712=[];var _0x5509cd=[];_0x52067b[_0x045c('0x96')](function(_0x5dcc1f){if(!_[_0x045c('0x9b')](_0x5dcc1f[_0x045c('0x97')])){var _0x48bfc7=_0x5dcc1f[_0x045c('0x97')][_0x045c('0x3c')](_0x5dcc1f[_0x045c('0x97')][_0x045c('0x3d')]('.')+0x1);if(_0x48bfc7===_0x045c('0x9c')){_0x488712[_0x045c('0x99')](getBooleanList(_0x590b31,_0x20c0a4,_0x5509cd,_0x3379b4[_0x045c('0x92')],_0x5dcc1f[_0x045c('0x92')],_0x5255fb));}}});return Promise[_0x045c('0x9a')](_0x488712);})[_0x045c('0xc')](function(_0x3da99c){_0x5988f5=_0x3da99c[0x0];var _0xd80788=[];var _0x5e40b6=[];_0x52067b[_0x045c('0x96')](function(_0x359b8e){if(_0x359b8e[_0x045c('0x97')]){var _0x220dc1=_0x359b8e[_0x045c('0x97')][_0x045c('0x3c')](_0x359b8e[_0x045c('0x97')]['lastIndexOf']('.')+0x1);if(_0x220dc1===_0x045c('0x9d')||_0x220dc1===_0x045c('0x9e')||_0x220dc1===_0x045c('0x9f')||_0x220dc1===_0x045c('0xa0')||_0x220dc1===_0x045c('0xa1')||_0x220dc1==='DateTimeAttributeMetadata'||_0x220dc1===_0x045c('0xa2')||_0x220dc1===_0x045c('0xa3')||_0x220dc1===_0x045c('0xa4')||_0x220dc1===_0x045c('0xa5')){_0xd80788['push'](getInputList(_0x590b31,_0x20c0a4,_0x220dc1,_0x5e40b6,_0x3379b4[_0x045c('0x92')],_0x359b8e['MetadataId'],_0x5255fb));}}});return Promise[_0x045c('0x9a')](_0xd80788);})[_0x045c('0xc')](function(_0x4ad51e){_0x3ccf05=_0x4ad51e[0x0];var _0x6baf30=_0x33aa3c[_0x045c('0x7d')](_0x5988f5)['concat'](_0x3ccf05);var _0x59c975={'count':_0x6baf30[_0x045c('0x1e')],'rows':_0x6baf30};return _0x59c975;})[_0x045c('0xc')](respondWithResult(_0x5b98d3,null))[_0x045c('0x30')](function(_0x385fdb){var _0xebd404=_0x399f58[_0x045c('0x19')]['test']?0x1f4:_0x385fdb[_0x045c('0xa6')]||0x1f4;logger[_0x045c('0xf')](_0x385fdb[_0x045c('0xa7')]);delete _0x385fdb[_0x045c('0x10')];if(_0xebd404===0x191){_0xebd404=0x190;}_0x5b98d3[_0x045c('0x4')](_0xebd404)[_0x045c('0x11')](_0x399f58[_0x045c('0x19')][_0x045c('0xa8')]?{'message':_0x045c('0xa9'),'statusCode':_0x385fdb['statusCode']}:_0x385fdb);});};function getSelectList(_0x5ee003,_0x6af993,_0x41bbfb,_0xefd923,_0x4e4aef,_0x476e6c){var _0x10fba8={'method':'GET','uri':_0x5ee003+_0x045c('0xaa')+_0xefd923+_0x045c('0xab')+_0x4e4aef+')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?'+_0x045c('0xac'),'headers':{'Authorization':_0x045c('0x8f')+_0x476e6c,'If-None-Match':null,'OData-Version':_0x045c('0x90')},'json':!![]};return rp(_0x10fba8)['then'](function(_0x3f8837){var _0x3d9371=[];var _0x2752d1=_0x3f8837[_0x045c('0xad')][_0x045c('0xae')];_0x2752d1[_0x045c('0x96')](function(_0x292349){_0x3d9371[_0x045c('0x99')]({'name':_0x292349[_0x045c('0xaf')][_0x045c('0xb0')][_0x045c('0xaf')],'value':String(_0x292349[_0x045c('0xb1')])});});var _0x21ce6b={'id':_0x6af993+'_'+_0x3f8837[_0x045c('0x95')],'name':_0x3f8837['DisplayName'][_0x045c('0xb0')]['Label'],'custom':![],'options':_0x3d9371};_0x41bbfb[_0x045c('0x99')](_0x21ce6b);return _0x41bbfb;});}function getBooleanList(_0x1a54ed,_0x3828cd,_0x2a5a7f,_0x3e95b3,_0x5b5212,_0x5eb67e){var _0x14af0b={'method':_0x045c('0x8d'),'uri':_0x1a54ed+'EntityDefinitions('+_0x3e95b3+')/Attributes('+_0x5b5212+_0x045c('0xb2'),'headers':{'Authorization':_0x045c('0x8f')+_0x5eb67e,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x14af0b)[_0x045c('0xc')](function(_0x105060){var _0x41d56a=[];_0x41d56a[_0x045c('0x99')]({'name':_0x105060['OptionSet'][_0x045c('0xb3')][_0x045c('0xaf')]['UserLocalizedLabel'][_0x045c('0xaf')],'value':_0x045c('0xb4')},{'name':_0x105060[_0x045c('0xad')][_0x045c('0xb5')][_0x045c('0xaf')][_0x045c('0xb0')]['Label'],'value':_0x045c('0xb6')});var _0x180e8a={'id':_0x3828cd+'_'+_0x105060[_0x045c('0x95')],'name':_0x105060[_0x045c('0xb7')][_0x045c('0xb0')][_0x045c('0xaf')],'custom':![],'options':_0x41d56a};_0x2a5a7f['push'](_0x180e8a);return _0x2a5a7f;});}function getInputList(_0x1795ef,_0x27704c,_0x4b01f1,_0x170844,_0x1674a2,_0x49ae6b,_0x21dc23){var _0x49faa0={'method':_0x045c('0x8d'),'uri':_0x1795ef+_0x045c('0xaa')+_0x1674a2+')/Attributes('+_0x49ae6b+_0x045c('0xb8')+_0x4b01f1+_0x045c('0xb9'),'headers':{'Authorization':_0x045c('0x8f')+_0x21dc23,'If-None-Match':null,'OData-Version':_0x045c('0x90')},'json':!![]};return rp(_0x49faa0)[_0x045c('0xc')](function(_0x105b7c){var _0x2294e4={'id':_0x27704c+'_'+_0x105b7c[_0x045c('0x95')],'name':_0x105b7c['DisplayName'][_0x045c('0xb0')]?_0x105b7c[_0x045c('0xb7')][_0x045c('0xb0')][_0x045c('0xaf')]:_0x105b7c[_0x045c('0x95')],'custom':![],'options':[]};_0x170844[_0x045c('0x99')](_0x2294e4);return _0x170844;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 194bb72..313d835 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 _0xbaf0=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','util'];(function(_0x366889,_0x20e657){var _0x3ca28b=function(_0x37f5b9){while(--_0x37f5b9){_0x366889['push'](_0x366889['shift']());}};_0x3ca28b(++_0x20e657);}(_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'));var integrations=require(_0x0baf('0x9'));module[_0x0baf('0xa')]=function(_0x335e24,_0x1a10b1){return _0x335e24[_0x0baf('0xb')](_0x0baf('0xc'),attributes,{'tableName':'int_dynamics365_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','int_dynamics365_accounts','lodash','util'];(function(_0x2528dc,_0x2613ee){var _0xbd7056=function(_0x594bed){while(--_0x594bed){_0x2528dc['push'](_0x2528dc['shift']());}};_0xbd7056(++_0x2613ee);}(_0xe706,0xa3));var _0x6e70=function(_0x41bdd4,_0x3d5c76){_0x41bdd4=_0x41bdd4-0x0;var _0x5c03a6=_0xe706[_0x41bdd4];return _0x5c03a6;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));var integrations=require(_0x6e70('0xa'));module[_0x6e70('0xb')]=function(_0x4381d1,_0x36357b){return _0x4381d1[_0x6e70('0xc')](_0x6e70('0xd'),attributes,{'tableName':_0x6e70('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index bd56f5a..401204b 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 _0x136a=['lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','client','http','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetDynamics365Account','Dynamics365Account','findAll','options','raw','where','limit','include','model','map','attributes','ShowDynamics365Account','find'];(function(_0xcca928,_0x57088b){var _0x366fc8=function(_0x42852f){while(--_0x42852f){_0xcca928['push'](_0xcca928['shift']());}};_0x366fc8(++_0x57088b);}(_0x136a,0x66));var _0xa136=function(_0x41742c,_0x1d20bf){_0x41742c=_0x41742c-0x0;var _0x147342=_0x136a[_0x41742c];return _0x147342;};'use strict';var _=require(_0xa136('0x0'));var util=require('util');var moment=require(_0xa136('0x1'));var BPromise=require(_0xa136('0x2'));var rs=require(_0xa136('0x3'));var fs=require('fs');var Redis=require(_0xa136('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xa136('0x5'))(_0xa136('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa136('0x7')][_0xa136('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4d461a,_0x510271,_0x429579){return new BPromise(function(_0x39aec8,_0x5dd562){return client['request'](_0x4d461a,_0x429579)[_0xa136('0x9')](function(_0x22ccb8){logger[_0xa136('0xa')](_0xa136('0xb'),_0x510271,_0xa136('0xc'));logger[_0xa136('0xd')](_0xa136('0xe'),_0x510271,_0xa136('0xc'),JSON[_0xa136('0xf')](_0x22ccb8));if(_0x22ccb8[_0xa136('0x10')]){if(_0x22ccb8['error'][_0xa136('0x11')]===0x1f4){logger[_0xa136('0x10')](_0xa136('0xb'),_0x510271,_0x22ccb8[_0xa136('0x10')][_0xa136('0x12')]);return _0x5dd562(_0x22ccb8[_0xa136('0x10')][_0xa136('0x12')]);}logger[_0xa136('0x10')]('Dynamics365Account,\x20%s,\x20%s',_0x510271,_0x22ccb8[_0xa136('0x10')][_0xa136('0x12')]);return _0x39aec8(_0x22ccb8[_0xa136('0x10')][_0xa136('0x12')]);}else{logger[_0xa136('0xa')](_0xa136('0xb'),_0x510271,_0xa136('0xc'));_0x39aec8(_0x22ccb8[_0xa136('0x13')]['message']);}})[_0xa136('0x14')](function(_0x3bec01){logger[_0xa136('0x10')]('Dynamics365Account,\x20%s,\x20%s',_0x510271,_0x3bec01);_0x5dd562(_0x3bec01);});});}exports[_0xa136('0x15')]=function(_0x591e41){var _0x2a6f9a=this;return new Promise(function(_0x11ca0a,_0x36883c){return db[_0xa136('0x16')][_0xa136('0x17')]({'raw':_0x591e41[_0xa136('0x18')]?_0x591e41[_0xa136('0x18')][_0xa136('0x19')]===undefined?!![]:![]:!![],'where':_0x591e41[_0xa136('0x18')]?_0x591e41[_0xa136('0x18')][_0xa136('0x1a')]||null:null,'attributes':_0x591e41['options']?_0x591e41[_0xa136('0x18')]['attributes']||null:null,'limit':_0x591e41[_0xa136('0x18')]?_0x591e41[_0xa136('0x18')][_0xa136('0x1b')]||null:null,'include':_0x591e41[_0xa136('0x18')]?_0x591e41[_0xa136('0x18')][_0xa136('0x1c')]?_['map'](_0x591e41['options'][_0xa136('0x1c')],function(_0x7c12b2){return{'model':db[_0x7c12b2[_0xa136('0x1d')]],'as':_0x7c12b2['as'],'attributes':_0x7c12b2['attributes'],'include':_0x7c12b2[_0xa136('0x1c')]?_[_0xa136('0x1e')](_0x7c12b2[_0xa136('0x1c')],function(_0x5557d1){return{'model':db[_0x5557d1[_0xa136('0x1d')]],'as':_0x5557d1['as'],'attributes':_0x5557d1[_0xa136('0x1f')],'include':_0x5557d1[_0xa136('0x1c')]?_[_0xa136('0x1e')](_0x5557d1[_0xa136('0x1c')],function(_0x36dd56){return{'model':db[_0x36dd56['model']],'as':_0x36dd56['as'],'attributes':_0x36dd56['attributes']};}):[]};}):[]};}):[]:[]})[_0xa136('0x9')](function(_0xdb99fb){logger[_0xa136('0xa')](_0xa136('0x15'),_0x591e41);logger[_0xa136('0xd')]('GetDynamics365Account',_0x591e41,JSON[_0xa136('0xf')](_0xdb99fb));_0x11ca0a(_0xdb99fb);})[_0xa136('0x14')](function(_0x539a5a){logger[_0xa136('0x10')]('GetDynamics365Account',_0x539a5a[_0xa136('0x12')],_0x591e41);_0x36883c(_0x2a6f9a['error'](0x1f4,_0x539a5a[_0xa136('0x12')]));});});};exports[_0xa136('0x20')]=function(_0x471325){var _0x46442d=this;return new Promise(function(_0x440da0,_0x53f97a){return db[_0xa136('0x16')][_0xa136('0x21')]({'raw':_0x471325['options']?_0x471325[_0xa136('0x18')][_0xa136('0x19')]===undefined?!![]:![]:!![],'where':_0x471325[_0xa136('0x18')]?_0x471325[_0xa136('0x18')][_0xa136('0x1a')]||null:null,'attributes':_0x471325[_0xa136('0x18')]?_0x471325[_0xa136('0x18')][_0xa136('0x1f')]||null:null,'include':_0x471325[_0xa136('0x18')]?_0x471325[_0xa136('0x18')][_0xa136('0x1c')]?_[_0xa136('0x1e')](_0x471325[_0xa136('0x18')][_0xa136('0x1c')],function(_0x5d2d4a){return{'model':db[_0x5d2d4a['model']],'as':_0x5d2d4a['as'],'attributes':_0x5d2d4a[_0xa136('0x1f')],'include':_0x5d2d4a['include']?_[_0xa136('0x1e')](_0x5d2d4a[_0xa136('0x1c')],function(_0x2b0a8e){return{'model':db[_0x2b0a8e[_0xa136('0x1d')]],'as':_0x2b0a8e['as'],'attributes':_0x2b0a8e[_0xa136('0x1f')],'include':_0x2b0a8e[_0xa136('0x1c')]?_['map'](_0x2b0a8e[_0xa136('0x1c')],function(_0x498365){return{'model':db[_0x498365['model']],'as':_0x498365['as'],'attributes':_0x498365[_0xa136('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xa136('0x9')](function(_0x605eae){logger['info']('ShowDynamics365Account',_0x471325);logger[_0xa136('0xd')]('ShowDynamics365Account',_0x471325,JSON[_0xa136('0xf')](_0x605eae));_0x440da0(_0x605eae);})[_0xa136('0x14')](function(_0x3016e2){logger[_0xa136('0x10')]('ShowDynamics365Account',_0x3016e2[_0xa136('0x12')],_0x471325);_0x53f97a(_0x46442d['error'](0x1f4,_0x3016e2[_0xa136('0x12')]));});});}; \ No newline at end of file +var _0xe4fa=['Dynamics365Account,\x20%s,\x20%s','catch','Dynamics365Account','findAll','options','where','attributes','limit','include','model','map','then','debug','GetDynamics365Account','raw','ShowDynamics365Account','util','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','info','request\x20sent','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x58c506,_0x7d5d36){var _0x4c3d9a=function(_0x32fd80){while(--_0x32fd80){_0x58c506['push'](_0x58c506['shift']());}};_0x4c3d9a(++_0x7d5d36);}(_0xe4fa,0x130));var _0xae4f=function(_0x741cc1,_0x5de395){_0x741cc1=_0x741cc1-0x0;var _0x5ab7a5=_0xe4fa[_0x741cc1];return _0x5ab7a5;};'use strict';var _=require('lodash');var util=require(_0xae4f('0x0'));var moment=require('moment');var BPromise=require(_0xae4f('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xae4f('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xae4f('0x3'))(_0xae4f('0x4'));var config=require(_0xae4f('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xae4f('0x6')][_0xae4f('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x14a50d,_0x482ac6,_0x353c0f){return new BPromise(function(_0x4827ac,_0x1476a4){return client[_0xae4f('0x8')](_0x14a50d,_0x353c0f)['then'](function(_0x495737){logger[_0xae4f('0x9')]('Dynamics365Account,\x20%s,\x20%s',_0x482ac6,_0xae4f('0xa'));logger['debug'](_0xae4f('0xb'),_0x482ac6,_0xae4f('0xa'),JSON[_0xae4f('0xc')](_0x495737));if(_0x495737[_0xae4f('0xd')]){if(_0x495737['error'][_0xae4f('0xe')]===0x1f4){logger[_0xae4f('0xd')]('Dynamics365Account,\x20%s,\x20%s',_0x482ac6,_0x495737[_0xae4f('0xd')][_0xae4f('0xf')]);return _0x1476a4(_0x495737['error'][_0xae4f('0xf')]);}logger[_0xae4f('0xd')]('Dynamics365Account,\x20%s,\x20%s',_0x482ac6,_0x495737[_0xae4f('0xd')]['message']);return _0x4827ac(_0x495737[_0xae4f('0xd')][_0xae4f('0xf')]);}else{logger[_0xae4f('0x9')](_0xae4f('0x10'),_0x482ac6,_0xae4f('0xa'));_0x4827ac(_0x495737['result'][_0xae4f('0xf')]);}})[_0xae4f('0x11')](function(_0x450ca2){logger[_0xae4f('0xd')](_0xae4f('0x10'),_0x482ac6,_0x450ca2);_0x1476a4(_0x450ca2);});});}exports['GetDynamics365Account']=function(_0x3d1417){var _0x57e6a9=this;return new Promise(function(_0x357e67,_0x18b7a0){return db[_0xae4f('0x12')][_0xae4f('0x13')]({'raw':_0x3d1417[_0xae4f('0x14')]?_0x3d1417[_0xae4f('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x3d1417[_0xae4f('0x14')]?_0x3d1417['options'][_0xae4f('0x15')]||null:null,'attributes':_0x3d1417[_0xae4f('0x14')]?_0x3d1417[_0xae4f('0x14')][_0xae4f('0x16')]||null:null,'limit':_0x3d1417[_0xae4f('0x14')]?_0x3d1417[_0xae4f('0x14')][_0xae4f('0x17')]||null:null,'include':_0x3d1417['options']?_0x3d1417[_0xae4f('0x14')]['include']?_['map'](_0x3d1417[_0xae4f('0x14')][_0xae4f('0x18')],function(_0x2f38dc){return{'model':db[_0x2f38dc[_0xae4f('0x19')]],'as':_0x2f38dc['as'],'attributes':_0x2f38dc[_0xae4f('0x16')],'include':_0x2f38dc['include']?_[_0xae4f('0x1a')](_0x2f38dc[_0xae4f('0x18')],function(_0x51b9cf){return{'model':db[_0x51b9cf[_0xae4f('0x19')]],'as':_0x51b9cf['as'],'attributes':_0x51b9cf[_0xae4f('0x16')],'include':_0x51b9cf[_0xae4f('0x18')]?_[_0xae4f('0x1a')](_0x51b9cf[_0xae4f('0x18')],function(_0x3fc969){return{'model':db[_0x3fc969['model']],'as':_0x3fc969['as'],'attributes':_0x3fc969[_0xae4f('0x16')]};}):[]};}):[]};}):[]:[]})[_0xae4f('0x1b')](function(_0x4ad703){logger['info']('GetDynamics365Account',_0x3d1417);logger[_0xae4f('0x1c')]('GetDynamics365Account',_0x3d1417,JSON[_0xae4f('0xc')](_0x4ad703));_0x357e67(_0x4ad703);})[_0xae4f('0x11')](function(_0x3da3fc){logger[_0xae4f('0xd')](_0xae4f('0x1d'),_0x3da3fc[_0xae4f('0xf')],_0x3d1417);_0x18b7a0(_0x57e6a9[_0xae4f('0xd')](0x1f4,_0x3da3fc[_0xae4f('0xf')]));});});};exports['ShowDynamics365Account']=function(_0xe5c071){var _0x6912ef=this;return new Promise(function(_0x268d54,_0x1975a3){return db[_0xae4f('0x12')]['find']({'raw':_0xe5c071[_0xae4f('0x14')]?_0xe5c071[_0xae4f('0x14')][_0xae4f('0x1e')]===undefined?!![]:![]:!![],'where':_0xe5c071[_0xae4f('0x14')]?_0xe5c071[_0xae4f('0x14')][_0xae4f('0x15')]||null:null,'attributes':_0xe5c071['options']?_0xe5c071[_0xae4f('0x14')]['attributes']||null:null,'include':_0xe5c071[_0xae4f('0x14')]?_0xe5c071[_0xae4f('0x14')][_0xae4f('0x18')]?_['map'](_0xe5c071[_0xae4f('0x14')][_0xae4f('0x18')],function(_0x1cb788){return{'model':db[_0x1cb788[_0xae4f('0x19')]],'as':_0x1cb788['as'],'attributes':_0x1cb788['attributes'],'include':_0x1cb788[_0xae4f('0x18')]?_[_0xae4f('0x1a')](_0x1cb788[_0xae4f('0x18')],function(_0x15c0fc){return{'model':db[_0x15c0fc[_0xae4f('0x19')]],'as':_0x15c0fc['as'],'attributes':_0x15c0fc[_0xae4f('0x16')],'include':_0x15c0fc[_0xae4f('0x18')]?_['map'](_0x15c0fc[_0xae4f('0x18')],function(_0x1f3f60){return{'model':db[_0x1f3f60[_0xae4f('0x19')]],'as':_0x1f3f60['as'],'attributes':_0x1f3f60[_0xae4f('0x16')]};}):[]};}):[]};}):[]:[]})[_0xae4f('0x1b')](function(_0x5d8211){logger[_0xae4f('0x9')](_0xae4f('0x1f'),_0xe5c071);logger[_0xae4f('0x1c')](_0xae4f('0x1f'),_0xe5c071,JSON[_0xae4f('0xc')](_0x5d8211));_0x268d54(_0x5d8211);})['catch'](function(_0x3b4864){logger[_0xae4f('0xd')](_0xae4f('0x1f'),_0x3b4864[_0xae4f('0xf')],_0xe5c071);_0x1975a3(_0x6912ef[_0xae4f('0xd')](0x1f4,_0x3b4864[_0xae4f('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 3de3bd6..415653b 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 _0xf3aa=['util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','index','/:id','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','multer'];(function(_0x5de17e,_0x556efd){var _0x9db192=function(_0x4a3d2a){while(--_0x4a3d2a){_0x5de17e['push'](_0x5de17e['shift']());}};_0x9db192(++_0x556efd);}(_0xf3aa,0xf1));var _0xaf3a=function(_0x40dcd1,_0x5cd1da){_0x40dcd1=_0x40dcd1-0x0;var _0x5c056b=_0xf3aa[_0x40dcd1];return _0x5c056b;};'use strict';var multer=require(_0xaf3a('0x0'));var util=require(_0xaf3a('0x1'));var path=require(_0xaf3a('0x2'));var timeout=require(_0xaf3a('0x3'));var express=require('express');var router=express[_0xaf3a('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xaf3a('0x5'));var config=require(_0xaf3a('0x6'));var controller=require(_0xaf3a('0x7'));router[_0xaf3a('0x8')]('/',auth[_0xaf3a('0x9')](),controller[_0xaf3a('0xa')]);router[_0xaf3a('0x8')](_0xaf3a('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xaf3a('0x8')](_0xaf3a('0xc'),auth[_0xaf3a('0x9')](),controller['getFields']);router['get'](_0xaf3a('0xd'),auth[_0xaf3a('0x9')](),controller[_0xaf3a('0xe')]);router[_0xaf3a('0x8')](_0xaf3a('0xf'),auth['isAuthenticated'](),controller[_0xaf3a('0x10')]);router[_0xaf3a('0x11')]('/',auth['isAuthenticated'](),controller[_0xaf3a('0x12')]);router[_0xaf3a('0x13')](_0xaf3a('0xb'),auth['isAuthenticated'](),controller[_0xaf3a('0x14')]);router[_0xaf3a('0x15')]('/:id',auth[_0xaf3a('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x0f8e=['getSubjects','post','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','get','isAuthenticated','index','/:id/fields','getFields'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x0f8e,0x7a));var _0xe0f8=function(_0x46b01f,_0x43dc27){_0x46b01f=_0x46b01f-0x0;var _0x5b091a=_0x0f8e[_0x46b01f];return _0x5b091a;};'use strict';var multer=require('multer');var util=require(_0xe0f8('0x0'));var path=require(_0xe0f8('0x1'));var timeout=require(_0xe0f8('0x2'));var express=require(_0xe0f8('0x3'));var router=express['Router']();var fs_extra=require(_0xe0f8('0x4'));var auth=require(_0xe0f8('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intDynamics365Configuration.controller');router[_0xe0f8('0x6')]('/',auth[_0xe0f8('0x7')](),controller[_0xe0f8('0x8')]);router[_0xe0f8('0x6')]('/:id',auth[_0xe0f8('0x7')](),controller['show']);router[_0xe0f8('0x6')](_0xe0f8('0x9'),auth[_0xe0f8('0x7')](),controller[_0xe0f8('0xa')]);router[_0xe0f8('0x6')]('/:id/subjects',auth['isAuthenticated'](),controller[_0xe0f8('0xb')]);router['get']('/:id/descriptions',auth[_0xe0f8('0x7')](),controller['getDescriptions']);router[_0xe0f8('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0xe0f8('0xd')](_0xe0f8('0xe'),auth[_0xe0f8('0x7')](),controller[_0xe0f8('0xf')]);router[_0xe0f8('0x10')](_0xe0f8('0xe'),auth['isAuthenticated'](),controller[_0xe0f8('0x11')]);module[_0xe0f8('0x12')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index a177d91..dc53875 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 _0x2cfc=['incident','contact','nothing','BOOLEAN','sequelize','STRING','phonecall'];(function(_0x1a3e6a,_0x264d8a){var _0x594d52=function(_0x402605){while(--_0x402605){_0x1a3e6a['push'](_0x1a3e6a['shift']());}};_0x594d52(++_0x264d8a);}(_0x2cfc,0xba));var _0xc2cf=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x2cfc[_0x297fd3];return _0x2af381;};'use strict';var Sequelize=require(_0xc2cf('0x0'));module['exports']={'name':{'type':Sequelize[_0xc2cf('0x1')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize['ENUM']('incident',_0xc2cf('0x2')),'defaultValue':_0xc2cf('0x3')},'moduleCreate':{'type':Sequelize['ENUM'](_0xc2cf('0x4'),_0xc2cf('0x5')),'defaultValue':'contact','allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0xc2cf('0x1')],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0xc2cf('0x6')],'defaultValue':!![]}}; \ No newline at end of file +var _0x6dc9=['ENUM','incident','contact','BOOLEAN','sequelize','exports','STRING'];(function(_0x50d56a,_0x579da1){var _0x8e28a5=function(_0x37a9e0){while(--_0x37a9e0){_0x50d56a['push'](_0x50d56a['shift']());}};_0x8e28a5(++_0x579da1);}(_0x6dc9,0x74));var _0x96dc=function(_0x2926db,_0x1f6561){_0x2926db=_0x2926db-0x0;var _0x1f025d=_0x6dc9[_0x2926db];return _0x1f025d;};'use strict';var Sequelize=require(_0x96dc('0x0'));module[_0x96dc('0x1')]={'name':{'type':Sequelize[_0x96dc('0x2')]},'description':{'type':Sequelize[_0x96dc('0x2')]},'ticketType':{'type':Sequelize[_0x96dc('0x3')](_0x96dc('0x4'),'phonecall'),'defaultValue':_0x96dc('0x4')},'moduleCreate':{'type':Sequelize['ENUM'](_0x96dc('0x5'),'nothing'),'defaultValue':_0x96dc('0x5'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0x96dc('0x2')],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0x96dc('0x6')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 68ef272..56b87ae 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 _0x3df1=['params','Dynamics365Configuration','keys','includeAll','merge','find','create','update','body','getFields','Dynamics365Field','findOne','getSubjects','getDescriptions','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','status','end','json','offset','undefined','count','set','Content-Range','reject','save','then','destroy','sendStatus','error','name','send','index','map','rawAttributes','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','VIRTUAL','options','include','findAll','rows','catch','show'];(function(_0x279445,_0x54c491){var _0x53c237=function(_0x54d6e2){while(--_0x54d6e2){_0x279445['push'](_0x279445['shift']());}};_0x53c237(++_0x54c491);}(_0x3df1,0x101));var _0x13df=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x3df1[_0x3ab51d];return _0x29a04e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x13df('0x0'));var zipdir=require(_0x13df('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x13df('0x2'));var moment=require(_0x13df('0x3'));var BPromise=require(_0x13df('0x4'));var Mustache=require(_0x13df('0x5'));var util=require(_0x13df('0x6'));var path=require(_0x13df('0x7'));var sox=require(_0x13df('0x8'));var csv=require(_0x13df('0x9'));var ejs=require(_0x13df('0xa'));var fs=require('fs');var fs_extra=require(_0x13df('0xb'));var _=require(_0x13df('0xc'));var squel=require(_0x13df('0xd'));var crypto=require(_0x13df('0xe'));var jsforce=require(_0x13df('0xf'));var deskjs=require(_0x13df('0x10'));var toCsv=require(_0x13df('0x9'));var querystring=require(_0x13df('0x11'));var Papa=require('papaparse');var Redis=require(_0x13df('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x13df('0x13'));var as=require(_0x13df('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x13df('0x15'))(_0x13df('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x13df('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1bc567,_0x2a4117){_0x2a4117=_0x2a4117||0xcc;return function(_0x2963c0){if(_0x2963c0){return _0x1bc567['sendStatus'](_0x2a4117);}return _0x1bc567[_0x13df('0x18')](_0x2a4117)[_0x13df('0x19')]();};}function respondWithResult(_0x2c2de9,_0x15a76c){_0x15a76c=_0x15a76c||0xc8;return function(_0x362fca){if(_0x362fca){return _0x2c2de9[_0x13df('0x18')](_0x15a76c)[_0x13df('0x1a')](_0x362fca);}};}function respondWithFilteredResult(_0x34fd71,_0x41ee03){return function(_0x1ce7c4){if(_0x1ce7c4){var _0x53628c=typeof _0x41ee03[_0x13df('0x1b')]===_0x13df('0x1c')&&typeof _0x41ee03['limit']===_0x13df('0x1c');var _0x472f87=_0x1ce7c4[_0x13df('0x1d')];var _0x4e78e6=_0x53628c?0x0:_0x41ee03[_0x13df('0x1b')];var _0xa5f60a=_0x53628c?_0x1ce7c4['count']:_0x41ee03[_0x13df('0x1b')]+_0x41ee03['limit'];var _0xc48cae;if(_0xa5f60a>=_0x472f87){_0xa5f60a=_0x472f87;_0xc48cae=0xc8;}else{_0xc48cae=0xce;}_0x34fd71[_0x13df('0x18')](_0xc48cae);return _0x34fd71[_0x13df('0x1e')](_0x13df('0x1f'),_0x4e78e6+'-'+_0xa5f60a+'/'+_0x472f87)[_0x13df('0x1a')](_0x1ce7c4);}return null;};}function patchUpdates(_0x19bc7f){return function(_0x17de84){try{jsonpatch['apply'](_0x17de84,_0x19bc7f,!![]);}catch(_0x1658d2){return BPromise[_0x13df('0x20')](_0x1658d2);}return _0x17de84[_0x13df('0x21')]();};}function saveUpdates(_0x10b992,_0xc475cf){return function(_0x7172e4){if(_0x7172e4){return _0x7172e4['update'](_0x10b992)[_0x13df('0x22')](function(_0x485913){return _0x485913;});}return null;};}function removeEntity(_0x3e7063,_0x4b89e7){return function(_0xad1092){if(_0xad1092){return _0xad1092[_0x13df('0x23')]()[_0x13df('0x22')](function(){_0x3e7063['status'](0xcc)[_0x13df('0x19')]();});}};}function handleEntityNotFound(_0x276b19,_0x988413){return function(_0x51611a){if(!_0x51611a){_0x276b19[_0x13df('0x24')](0x194);}return _0x51611a;};}function handleError(_0x4c4ea3,_0xaefb2c){_0xaefb2c=_0xaefb2c||0x1f4;return function(_0x306b2d){logger[_0x13df('0x25')](_0x306b2d['stack']);if(_0x306b2d[_0x13df('0x26')]){delete _0x306b2d['name'];}_0x4c4ea3['status'](_0xaefb2c)[_0x13df('0x27')](_0x306b2d);};}exports[_0x13df('0x28')]=function(_0x1ae91a,_0x542562){var _0x4d56ff={},_0x586d8b={},_0x1dcbe9={'count':0x0,'rows':[]};var _0x2d085a=_[_0x13df('0x29')](db['Dynamics365Configuration'][_0x13df('0x2a')],function(_0xb217ae){return{'name':_0xb217ae['fieldName'],'type':_0xb217ae[_0x13df('0x2b')][_0x13df('0x2c')]};});_0x586d8b[_0x13df('0x2d')]=_[_0x13df('0x29')](_0x2d085a,'name');_0x586d8b[_0x13df('0x2e')]=_['keys'](_0x1ae91a[_0x13df('0x2e')]);_0x586d8b[_0x13df('0x2f')]=_['intersection'](_0x586d8b[_0x13df('0x2d')],_0x586d8b['query']);_0x4d56ff['attributes']=_[_0x13df('0x30')](_0x586d8b[_0x13df('0x2d')],qs['fields'](_0x1ae91a[_0x13df('0x2e')][_0x13df('0x31')]));_0x4d56ff[_0x13df('0x32')]=_0x4d56ff[_0x13df('0x32')][_0x13df('0x33')]?_0x4d56ff['attributes']:_0x586d8b[_0x13df('0x2d')];if(!_0x1ae91a[_0x13df('0x2e')][_0x13df('0x34')](_0x13df('0x35'))){_0x4d56ff['limit']=qs['limit'](_0x1ae91a[_0x13df('0x2e')][_0x13df('0x36')]);_0x4d56ff[_0x13df('0x1b')]=qs['offset'](_0x1ae91a['query'][_0x13df('0x1b')]);}_0x4d56ff[_0x13df('0x37')]=qs[_0x13df('0x38')](_0x1ae91a[_0x13df('0x2e')][_0x13df('0x38')]);_0x4d56ff[_0x13df('0x39')]=qs[_0x13df('0x2f')](_[_0x13df('0x3a')](_0x1ae91a[_0x13df('0x2e')],_0x586d8b['filters']),_0x2d085a);if(_0x1ae91a[_0x13df('0x2e')][_0x13df('0x3b')]){_0x4d56ff[_0x13df('0x39')]=_['merge'](_0x4d56ff['where'],{'$or':_[_0x13df('0x29')](_0x2d085a,function(_0xf94576){if(_0xf94576['type']!==_0x13df('0x3c')){var _0x34c0da={};_0x34c0da[_0xf94576[_0x13df('0x26')]]={'$like':'%'+_0x1ae91a[_0x13df('0x2e')]['filter']+'%'};return _0x34c0da;}})});}_0x4d56ff=_['merge']({},_0x4d56ff,_0x1ae91a[_0x13df('0x3d')]);var _0x5a0a45={'where':_0x4d56ff[_0x13df('0x39')]};return db['Dynamics365Configuration'][_0x13df('0x1d')](_0x5a0a45)[_0x13df('0x22')](function(_0x46918c){_0x1dcbe9[_0x13df('0x1d')]=_0x46918c;if(_0x1ae91a[_0x13df('0x2e')]['includeAll']){_0x4d56ff[_0x13df('0x3e')]=[{'all':!![]}];}return db['Dynamics365Configuration'][_0x13df('0x3f')](_0x4d56ff);})['then'](function(_0x6f88bc){_0x1dcbe9[_0x13df('0x40')]=_0x6f88bc;return _0x1dcbe9;})[_0x13df('0x22')](respondWithFilteredResult(_0x542562,_0x4d56ff))[_0x13df('0x41')](handleError(_0x542562,null));};exports[_0x13df('0x42')]=function(_0x415787,_0x2e0881){var _0x262012={'raw':![],'where':{'id':_0x415787[_0x13df('0x43')]['id']}},_0x69bf32={};_0x69bf32[_0x13df('0x2d')]=_['keys'](db[_0x13df('0x44')][_0x13df('0x2a')]);_0x69bf32[_0x13df('0x2e')]=_[_0x13df('0x45')](_0x415787[_0x13df('0x2e')]);_0x69bf32[_0x13df('0x2f')]=_[_0x13df('0x30')](_0x69bf32[_0x13df('0x2d')],_0x69bf32[_0x13df('0x2e')]);_0x262012[_0x13df('0x32')]=_['intersection'](_0x69bf32[_0x13df('0x2d')],qs[_0x13df('0x31')](_0x415787[_0x13df('0x2e')][_0x13df('0x31')]));_0x262012['attributes']=_0x262012['attributes']['length']?_0x262012[_0x13df('0x32')]:_0x69bf32[_0x13df('0x2d')];if(_0x415787[_0x13df('0x2e')][_0x13df('0x46')]){_0x262012[_0x13df('0x3e')]=[{'all':!![]}];}_0x262012=_[_0x13df('0x47')]({},_0x262012,_0x415787['options']);return db[_0x13df('0x44')][_0x13df('0x48')](_0x262012)[_0x13df('0x22')](handleEntityNotFound(_0x2e0881,null))[_0x13df('0x22')](respondWithResult(_0x2e0881,null))[_0x13df('0x41')](handleError(_0x2e0881,null));};exports['create']=function(_0x5df06c,_0x19f1a7){return db[_0x13df('0x44')][_0x13df('0x49')](_0x5df06c['body'],{})[_0x13df('0x22')](respondWithResult(_0x19f1a7,0xc9))[_0x13df('0x41')](handleError(_0x19f1a7,null));};exports[_0x13df('0x4a')]=function(_0x1f36f5,_0xc02488){if(_0x1f36f5['body']['id']){delete _0x1f36f5[_0x13df('0x4b')]['id'];}return db['Dynamics365Configuration']['find']({'where':{'id':_0x1f36f5[_0x13df('0x43')]['id']}})[_0x13df('0x22')](handleEntityNotFound(_0xc02488,null))[_0x13df('0x22')](saveUpdates(_0x1f36f5[_0x13df('0x4b')],null))[_0x13df('0x22')](respondWithResult(_0xc02488,null))[_0x13df('0x41')](handleError(_0xc02488,null));};exports[_0x13df('0x23')]=function(_0x58c4f2,_0x2c9d2a){return db['Dynamics365Configuration'][_0x13df('0x48')]({'where':{'id':_0x58c4f2[_0x13df('0x43')]['id']}})[_0x13df('0x22')](handleEntityNotFound(_0x2c9d2a,null))[_0x13df('0x22')](removeEntity(_0x2c9d2a,null))[_0x13df('0x41')](handleError(_0x2c9d2a,null));};exports[_0x13df('0x4c')]=function(_0x4d73c7,_0x93b5e6,_0x1e5cb4){var _0x116a4d={};var _0x276552={};var _0x2bf3f6;var _0x331fc3;return db['Dynamics365Configuration']['findOne']({'where':{'id':_0x4d73c7[_0x13df('0x43')]['id']}})['then'](handleEntityNotFound(_0x93b5e6,null))[_0x13df('0x22')](function(_0x1e8d3a){if(_0x1e8d3a){_0x2bf3f6=_0x1e8d3a;_0x276552[_0x13df('0x2d')]=_[_0x13df('0x45')](db[_0x13df('0x4d')]['rawAttributes']);_0x276552[_0x13df('0x2e')]=_[_0x13df('0x45')](_0x4d73c7['query']);_0x276552[_0x13df('0x2f')]=_[_0x13df('0x30')](_0x276552[_0x13df('0x2d')],_0x276552['query']);_0x116a4d['attributes']=_[_0x13df('0x30')](_0x276552[_0x13df('0x2d')],qs[_0x13df('0x31')](_0x4d73c7[_0x13df('0x2e')][_0x13df('0x31')]));_0x116a4d[_0x13df('0x32')]=_0x116a4d[_0x13df('0x32')]['length']?_0x116a4d[_0x13df('0x32')]:_0x276552[_0x13df('0x2d')];_0x116a4d[_0x13df('0x37')]=qs[_0x13df('0x38')](_0x4d73c7[_0x13df('0x2e')]['sort']);_0x116a4d[_0x13df('0x39')]=qs[_0x13df('0x2f')](_[_0x13df('0x3a')](_0x4d73c7[_0x13df('0x2e')],_0x276552[_0x13df('0x2f')]));if(_0x4d73c7[_0x13df('0x2e')]['filter']){_0x116a4d[_0x13df('0x39')]=_['merge'](_0x116a4d[_0x13df('0x39')],{'$or':_[_0x13df('0x29')](_0x116a4d[_0x13df('0x32')],function(_0xec01b0){var _0x29bc2c={};_0x29bc2c[_0xec01b0]={'$like':'%'+_0x4d73c7[_0x13df('0x2e')][_0x13df('0x3b')]+'%'};return _0x29bc2c;})});}_0x116a4d=_[_0x13df('0x47')]({},_0x116a4d,_0x4d73c7[_0x13df('0x3d')]);return _0x2bf3f6['getFields'](_0x116a4d);}})['then'](function(_0x337a1d){if(_0x337a1d){_0x331fc3=_0x337a1d[_0x13df('0x33')];if(!_0x4d73c7[_0x13df('0x2e')][_0x13df('0x34')]('nolimit')){_0x116a4d[_0x13df('0x36')]=qs[_0x13df('0x36')](_0x4d73c7[_0x13df('0x2e')][_0x13df('0x36')]);_0x116a4d[_0x13df('0x1b')]=qs['offset'](_0x4d73c7[_0x13df('0x2e')][_0x13df('0x1b')]);}return _0x2bf3f6['getFields'](_0x116a4d);}})[_0x13df('0x22')](function(_0x1d853b){if(_0x1d853b){return _0x1d853b?{'count':_0x331fc3,'rows':_0x1d853b}:null;}})[_0x13df('0x22')](respondWithResult(_0x93b5e6,null))['catch'](handleError(_0x93b5e6,null));};exports['getSubjects']=function(_0x3676db,_0x554081,_0x8062f1){var _0x3fbe27={};var _0x38b335={};var _0x588b44;var _0x27952a;return db[_0x13df('0x44')][_0x13df('0x4e')]({'where':{'id':_0x3676db[_0x13df('0x43')]['id']}})[_0x13df('0x22')](handleEntityNotFound(_0x554081,null))['then'](function(_0x1827d7){if(_0x1827d7){_0x588b44=_0x1827d7;_0x38b335[_0x13df('0x2d')]=_[_0x13df('0x45')](db[_0x13df('0x4d')][_0x13df('0x2a')]);_0x38b335['query']=_['keys'](_0x3676db['query']);_0x38b335[_0x13df('0x2f')]=_[_0x13df('0x30')](_0x38b335[_0x13df('0x2d')],_0x38b335[_0x13df('0x2e')]);_0x3fbe27[_0x13df('0x32')]=_[_0x13df('0x30')](_0x38b335['model'],qs[_0x13df('0x31')](_0x3676db[_0x13df('0x2e')]['fields']));_0x3fbe27[_0x13df('0x32')]=_0x3fbe27[_0x13df('0x32')][_0x13df('0x33')]?_0x3fbe27[_0x13df('0x32')]:_0x38b335['model'];_0x3fbe27[_0x13df('0x37')]=qs[_0x13df('0x38')](_0x3676db[_0x13df('0x2e')][_0x13df('0x38')]);_0x3fbe27[_0x13df('0x39')]=qs[_0x13df('0x2f')](_['pick'](_0x3676db[_0x13df('0x2e')],_0x38b335[_0x13df('0x2f')]));if(_0x3676db[_0x13df('0x2e')][_0x13df('0x3b')]){_0x3fbe27[_0x13df('0x39')]=_[_0x13df('0x47')](_0x3fbe27[_0x13df('0x39')],{'$or':_['map'](_0x3fbe27[_0x13df('0x32')],function(_0x2d8342){var _0x46b114={};_0x46b114[_0x2d8342]={'$like':'%'+_0x3676db[_0x13df('0x2e')][_0x13df('0x3b')]+'%'};return _0x46b114;})});}_0x3fbe27=_[_0x13df('0x47')]({},_0x3fbe27,_0x3676db[_0x13df('0x3d')]);return _0x588b44['getSubjects'](_0x3fbe27);}})[_0x13df('0x22')](function(_0x56acab){if(_0x56acab){_0x27952a=_0x56acab[_0x13df('0x33')];if(!_0x3676db['query'][_0x13df('0x34')](_0x13df('0x35'))){_0x3fbe27['limit']=qs['limit'](_0x3676db[_0x13df('0x2e')]['limit']);_0x3fbe27[_0x13df('0x1b')]=qs['offset'](_0x3676db[_0x13df('0x2e')]['offset']);}return _0x588b44[_0x13df('0x4f')](_0x3fbe27);}})[_0x13df('0x22')](function(_0x4bcc1f){if(_0x4bcc1f){return _0x4bcc1f?{'count':_0x27952a,'rows':_0x4bcc1f}:null;}})[_0x13df('0x22')](respondWithResult(_0x554081,null))[_0x13df('0x41')](handleError(_0x554081,null));};exports[_0x13df('0x50')]=function(_0x7b7e66,_0x3f1e96,_0x406f5b){var _0x1d0c68={};var _0x2e006c={};var _0x10fd45;var _0x50df92;return db[_0x13df('0x44')][_0x13df('0x4e')]({'where':{'id':_0x7b7e66[_0x13df('0x43')]['id']}})['then'](handleEntityNotFound(_0x3f1e96,null))['then'](function(_0x17e09e){if(_0x17e09e){_0x10fd45=_0x17e09e;_0x2e006c['model']=_[_0x13df('0x45')](db[_0x13df('0x4d')][_0x13df('0x2a')]);_0x2e006c['query']=_[_0x13df('0x45')](_0x7b7e66[_0x13df('0x2e')]);_0x2e006c[_0x13df('0x2f')]=_['intersection'](_0x2e006c[_0x13df('0x2d')],_0x2e006c['query']);_0x1d0c68[_0x13df('0x32')]=_[_0x13df('0x30')](_0x2e006c[_0x13df('0x2d')],qs[_0x13df('0x31')](_0x7b7e66[_0x13df('0x2e')][_0x13df('0x31')]));_0x1d0c68[_0x13df('0x32')]=_0x1d0c68[_0x13df('0x32')][_0x13df('0x33')]?_0x1d0c68[_0x13df('0x32')]:_0x2e006c[_0x13df('0x2d')];_0x1d0c68[_0x13df('0x37')]=qs['sort'](_0x7b7e66['query'][_0x13df('0x38')]);_0x1d0c68['where']=qs[_0x13df('0x2f')](_[_0x13df('0x3a')](_0x7b7e66[_0x13df('0x2e')],_0x2e006c[_0x13df('0x2f')]));if(_0x7b7e66[_0x13df('0x2e')][_0x13df('0x3b')]){_0x1d0c68['where']=_['merge'](_0x1d0c68['where'],{'$or':_[_0x13df('0x29')](_0x1d0c68[_0x13df('0x32')],function(_0x5b8942){var _0x50940e={};_0x50940e[_0x5b8942]={'$like':'%'+_0x7b7e66['query'][_0x13df('0x3b')]+'%'};return _0x50940e;})});}_0x1d0c68=_[_0x13df('0x47')]({},_0x1d0c68,_0x7b7e66['options']);return _0x10fd45['getDescriptions'](_0x1d0c68);}})[_0x13df('0x22')](function(_0x34a283){if(_0x34a283){_0x50df92=_0x34a283[_0x13df('0x33')];if(!_0x7b7e66[_0x13df('0x2e')]['hasOwnProperty'](_0x13df('0x35'))){_0x1d0c68[_0x13df('0x36')]=qs[_0x13df('0x36')](_0x7b7e66['query'][_0x13df('0x36')]);_0x1d0c68['offset']=qs[_0x13df('0x1b')](_0x7b7e66[_0x13df('0x2e')][_0x13df('0x1b')]);}return _0x10fd45[_0x13df('0x50')](_0x1d0c68);}})['then'](function(_0x915dc5){if(_0x915dc5){return _0x915dc5?{'count':_0x50df92,'rows':_0x915dc5}:null;}})[_0x13df('0x22')](respondWithResult(_0x3f1e96,null))[_0x13df('0x41')](handleError(_0x3f1e96,null));}; \ No newline at end of file +var _0x5468=['body','find','getFields','findOne','order','pick','getSubjects','Dynamics365Field','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','then','destroy','sendStatus','name','send','index','map','rawAttributes','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','options','Dynamics365Configuration','includeAll','findAll','rows','catch','show','params','include','create','update'];(function(_0x2328de,_0x5bdc11){var _0x45dfa5=function(_0x4cc259){while(--_0x4cc259){_0x2328de['push'](_0x2328de['shift']());}};_0x45dfa5(++_0x5bdc11);}(_0x5468,0xf8));var _0x8546=function(_0xa79dc4,_0x5cb28a){_0xa79dc4=_0xa79dc4-0x0;var _0x170a44=_0x5468[_0xa79dc4];return _0x170a44;};'use strict';var emlformat=require(_0x8546('0x0'));var rimraf=require(_0x8546('0x1'));var zipdir=require(_0x8546('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8546('0x3'));var moment=require(_0x8546('0x4'));var BPromise=require(_0x8546('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x8546('0x6'));var sox=require(_0x8546('0x7'));var csv=require(_0x8546('0x8'));var ejs=require(_0x8546('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8546('0xa'));var squel=require(_0x8546('0xb'));var crypto=require(_0x8546('0xc'));var jsforce=require(_0x8546('0xd'));var deskjs=require(_0x8546('0xe'));var toCsv=require(_0x8546('0x8'));var querystring=require(_0x8546('0xf'));var Papa=require(_0x8546('0x10'));var Redis=require(_0x8546('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x8546('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8546('0x13'));var logger=require(_0x8546('0x14'))(_0x8546('0x15'));var utils=require(_0x8546('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x8546('0x17'));var db=require(_0x8546('0x18'))['db'];function respondWithStatusCode(_0x2f589b,_0x50e7a4){_0x50e7a4=_0x50e7a4||0xcc;return function(_0x3c6d37){if(_0x3c6d37){return _0x2f589b['sendStatus'](_0x50e7a4);}return _0x2f589b[_0x8546('0x19')](_0x50e7a4)[_0x8546('0x1a')]();};}function respondWithResult(_0x5dbe63,_0xcf4a47){_0xcf4a47=_0xcf4a47||0xc8;return function(_0x1537d5){if(_0x1537d5){return _0x5dbe63[_0x8546('0x19')](_0xcf4a47)[_0x8546('0x1b')](_0x1537d5);}};}function respondWithFilteredResult(_0x45befa,_0x448a96){return function(_0x45ff1d){if(_0x45ff1d){var _0x1851a2=typeof _0x448a96[_0x8546('0x1c')]==='undefined'&&typeof _0x448a96[_0x8546('0x1d')]===_0x8546('0x1e');var _0x38174d=_0x45ff1d[_0x8546('0x1f')];var _0x22161c=_0x1851a2?0x0:_0x448a96[_0x8546('0x1c')];var _0x13e634=_0x1851a2?_0x45ff1d['count']:_0x448a96[_0x8546('0x1c')]+_0x448a96[_0x8546('0x1d')];var _0x3ffed8;if(_0x13e634>=_0x38174d){_0x13e634=_0x38174d;_0x3ffed8=0xc8;}else{_0x3ffed8=0xce;}_0x45befa[_0x8546('0x19')](_0x3ffed8);return _0x45befa['set'](_0x8546('0x20'),_0x22161c+'-'+_0x13e634+'/'+_0x38174d)[_0x8546('0x1b')](_0x45ff1d);}return null;};}function patchUpdates(_0x315f04){return function(_0x52c76c){try{jsonpatch[_0x8546('0x21')](_0x52c76c,_0x315f04,!![]);}catch(_0x856874){return BPromise[_0x8546('0x22')](_0x856874);}return _0x52c76c[_0x8546('0x23')]();};}function saveUpdates(_0x3e7ea6,_0x2653c2){return function(_0x16cb6e){if(_0x16cb6e){return _0x16cb6e['update'](_0x3e7ea6)[_0x8546('0x24')](function(_0x3d79c7){return _0x3d79c7;});}return null;};}function removeEntity(_0x6affba,_0x4c43f6){return function(_0x385f77){if(_0x385f77){return _0x385f77[_0x8546('0x25')]()[_0x8546('0x24')](function(){_0x6affba[_0x8546('0x19')](0xcc)[_0x8546('0x1a')]();});}};}function handleEntityNotFound(_0x3f342f,_0x95ca91){return function(_0x95903f){if(!_0x95903f){_0x3f342f[_0x8546('0x26')](0x194);}return _0x95903f;};}function handleError(_0x3d7463,_0x5272f3){_0x5272f3=_0x5272f3||0x1f4;return function(_0x117eee){logger['error'](_0x117eee['stack']);if(_0x117eee[_0x8546('0x27')]){delete _0x117eee['name'];}_0x3d7463['status'](_0x5272f3)[_0x8546('0x28')](_0x117eee);};}exports[_0x8546('0x29')]=function(_0x427f19,_0x4e8e42){var _0x4c413f={},_0x119a9a={},_0x41929d={'count':0x0,'rows':[]};var _0x3fb2d4=_[_0x8546('0x2a')](db['Dynamics365Configuration'][_0x8546('0x2b')],function(_0x89972e){return{'name':_0x89972e['fieldName'],'type':_0x89972e[_0x8546('0x2c')][_0x8546('0x2d')]};});_0x119a9a['model']=_[_0x8546('0x2a')](_0x3fb2d4,_0x8546('0x27'));_0x119a9a[_0x8546('0x2e')]=_[_0x8546('0x2f')](_0x427f19[_0x8546('0x2e')]);_0x119a9a[_0x8546('0x30')]=_[_0x8546('0x31')](_0x119a9a[_0x8546('0x32')],_0x119a9a['query']);_0x4c413f['attributes']=_[_0x8546('0x31')](_0x119a9a[_0x8546('0x32')],qs[_0x8546('0x33')](_0x427f19[_0x8546('0x2e')][_0x8546('0x33')]));_0x4c413f['attributes']=_0x4c413f[_0x8546('0x34')][_0x8546('0x35')]?_0x4c413f[_0x8546('0x34')]:_0x119a9a[_0x8546('0x32')];if(!_0x427f19['query'][_0x8546('0x36')](_0x8546('0x37'))){_0x4c413f['limit']=qs[_0x8546('0x1d')](_0x427f19['query'][_0x8546('0x1d')]);_0x4c413f[_0x8546('0x1c')]=qs[_0x8546('0x1c')](_0x427f19['query']['offset']);}_0x4c413f['order']=qs[_0x8546('0x38')](_0x427f19[_0x8546('0x2e')][_0x8546('0x38')]);_0x4c413f[_0x8546('0x39')]=qs[_0x8546('0x30')](_['pick'](_0x427f19[_0x8546('0x2e')],_0x119a9a[_0x8546('0x30')]),_0x3fb2d4);if(_0x427f19[_0x8546('0x2e')][_0x8546('0x3a')]){_0x4c413f['where']=_['merge'](_0x4c413f[_0x8546('0x39')],{'$or':_[_0x8546('0x2a')](_0x3fb2d4,function(_0x12d2c5){if(_0x12d2c5[_0x8546('0x2c')]!==_0x8546('0x3b')){var _0x516e4e={};_0x516e4e[_0x12d2c5['name']]={'$like':'%'+_0x427f19[_0x8546('0x2e')][_0x8546('0x3a')]+'%'};return _0x516e4e;}})});}_0x4c413f=_[_0x8546('0x3c')]({},_0x4c413f,_0x427f19[_0x8546('0x3d')]);var _0x2d2625={'where':_0x4c413f[_0x8546('0x39')]};return db[_0x8546('0x3e')][_0x8546('0x1f')](_0x2d2625)[_0x8546('0x24')](function(_0x506b8f){_0x41929d[_0x8546('0x1f')]=_0x506b8f;if(_0x427f19[_0x8546('0x2e')][_0x8546('0x3f')]){_0x4c413f['include']=[{'all':!![]}];}return db[_0x8546('0x3e')][_0x8546('0x40')](_0x4c413f);})[_0x8546('0x24')](function(_0x3966a4){_0x41929d[_0x8546('0x41')]=_0x3966a4;return _0x41929d;})[_0x8546('0x24')](respondWithFilteredResult(_0x4e8e42,_0x4c413f))[_0x8546('0x42')](handleError(_0x4e8e42,null));};exports[_0x8546('0x43')]=function(_0x22f7ae,_0x452cf7){var _0x30c418={'raw':![],'where':{'id':_0x22f7ae[_0x8546('0x44')]['id']}},_0x52ad2d={};_0x52ad2d[_0x8546('0x32')]=_[_0x8546('0x2f')](db[_0x8546('0x3e')]['rawAttributes']);_0x52ad2d[_0x8546('0x2e')]=_['keys'](_0x22f7ae['query']);_0x52ad2d['filters']=_[_0x8546('0x31')](_0x52ad2d[_0x8546('0x32')],_0x52ad2d[_0x8546('0x2e')]);_0x30c418['attributes']=_['intersection'](_0x52ad2d[_0x8546('0x32')],qs[_0x8546('0x33')](_0x22f7ae[_0x8546('0x2e')]['fields']));_0x30c418[_0x8546('0x34')]=_0x30c418['attributes']['length']?_0x30c418[_0x8546('0x34')]:_0x52ad2d[_0x8546('0x32')];if(_0x22f7ae['query']['includeAll']){_0x30c418[_0x8546('0x45')]=[{'all':!![]}];}_0x30c418=_[_0x8546('0x3c')]({},_0x30c418,_0x22f7ae[_0x8546('0x3d')]);return db[_0x8546('0x3e')]['find'](_0x30c418)['then'](handleEntityNotFound(_0x452cf7,null))['then'](respondWithResult(_0x452cf7,null))[_0x8546('0x42')](handleError(_0x452cf7,null));};exports[_0x8546('0x46')]=function(_0x489bfc,_0x3be861){return db['Dynamics365Configuration'][_0x8546('0x46')](_0x489bfc['body'],{})['then'](respondWithResult(_0x3be861,0xc9))[_0x8546('0x42')](handleError(_0x3be861,null));};exports[_0x8546('0x47')]=function(_0x370399,_0x5b5ec3){if(_0x370399[_0x8546('0x48')]['id']){delete _0x370399['body']['id'];}return db[_0x8546('0x3e')]['find']({'where':{'id':_0x370399[_0x8546('0x44')]['id']}})[_0x8546('0x24')](handleEntityNotFound(_0x5b5ec3,null))[_0x8546('0x24')](saveUpdates(_0x370399['body'],null))[_0x8546('0x24')](respondWithResult(_0x5b5ec3,null))[_0x8546('0x42')](handleError(_0x5b5ec3,null));};exports[_0x8546('0x25')]=function(_0x1a7bc3,_0x47e679){return db[_0x8546('0x3e')][_0x8546('0x49')]({'where':{'id':_0x1a7bc3[_0x8546('0x44')]['id']}})[_0x8546('0x24')](handleEntityNotFound(_0x47e679,null))['then'](removeEntity(_0x47e679,null))[_0x8546('0x42')](handleError(_0x47e679,null));};exports[_0x8546('0x4a')]=function(_0x39366c,_0x5bfd69,_0x4e5412){var _0x5547e2={};var _0xa5ac2={};var _0x12cfaa;var _0x15fb2f;return db['Dynamics365Configuration'][_0x8546('0x4b')]({'where':{'id':_0x39366c[_0x8546('0x44')]['id']}})['then'](handleEntityNotFound(_0x5bfd69,null))[_0x8546('0x24')](function(_0x87475d){if(_0x87475d){_0x12cfaa=_0x87475d;_0xa5ac2[_0x8546('0x32')]=_[_0x8546('0x2f')](db['Dynamics365Field'][_0x8546('0x2b')]);_0xa5ac2[_0x8546('0x2e')]=_[_0x8546('0x2f')](_0x39366c[_0x8546('0x2e')]);_0xa5ac2[_0x8546('0x30')]=_['intersection'](_0xa5ac2[_0x8546('0x32')],_0xa5ac2[_0x8546('0x2e')]);_0x5547e2[_0x8546('0x34')]=_['intersection'](_0xa5ac2['model'],qs[_0x8546('0x33')](_0x39366c[_0x8546('0x2e')][_0x8546('0x33')]));_0x5547e2[_0x8546('0x34')]=_0x5547e2[_0x8546('0x34')][_0x8546('0x35')]?_0x5547e2['attributes']:_0xa5ac2['model'];_0x5547e2[_0x8546('0x4c')]=qs[_0x8546('0x38')](_0x39366c['query'][_0x8546('0x38')]);_0x5547e2['where']=qs[_0x8546('0x30')](_[_0x8546('0x4d')](_0x39366c[_0x8546('0x2e')],_0xa5ac2[_0x8546('0x30')]));if(_0x39366c['query'][_0x8546('0x3a')]){_0x5547e2[_0x8546('0x39')]=_[_0x8546('0x3c')](_0x5547e2['where'],{'$or':_[_0x8546('0x2a')](_0x5547e2['attributes'],function(_0x109344){var _0x7ed259={};_0x7ed259[_0x109344]={'$like':'%'+_0x39366c['query'][_0x8546('0x3a')]+'%'};return _0x7ed259;})});}_0x5547e2=_[_0x8546('0x3c')]({},_0x5547e2,_0x39366c[_0x8546('0x3d')]);return _0x12cfaa[_0x8546('0x4a')](_0x5547e2);}})[_0x8546('0x24')](function(_0x54408b){if(_0x54408b){_0x15fb2f=_0x54408b[_0x8546('0x35')];if(!_0x39366c[_0x8546('0x2e')][_0x8546('0x36')](_0x8546('0x37'))){_0x5547e2[_0x8546('0x1d')]=qs['limit'](_0x39366c['query'][_0x8546('0x1d')]);_0x5547e2[_0x8546('0x1c')]=qs[_0x8546('0x1c')](_0x39366c['query'][_0x8546('0x1c')]);}return _0x12cfaa['getFields'](_0x5547e2);}})[_0x8546('0x24')](function(_0x2305e6){if(_0x2305e6){return _0x2305e6?{'count':_0x15fb2f,'rows':_0x2305e6}:null;}})['then'](respondWithResult(_0x5bfd69,null))[_0x8546('0x42')](handleError(_0x5bfd69,null));};exports[_0x8546('0x4e')]=function(_0x30e62c,_0x3e9653,_0x12d374){var _0x447db3={};var _0x15e6e1={};var _0x28ef80;var _0xa9284e;return db[_0x8546('0x3e')][_0x8546('0x4b')]({'where':{'id':_0x30e62c['params']['id']}})[_0x8546('0x24')](handleEntityNotFound(_0x3e9653,null))[_0x8546('0x24')](function(_0xe494c3){if(_0xe494c3){_0x28ef80=_0xe494c3;_0x15e6e1[_0x8546('0x32')]=_[_0x8546('0x2f')](db[_0x8546('0x4f')][_0x8546('0x2b')]);_0x15e6e1[_0x8546('0x2e')]=_['keys'](_0x30e62c[_0x8546('0x2e')]);_0x15e6e1['filters']=_[_0x8546('0x31')](_0x15e6e1[_0x8546('0x32')],_0x15e6e1[_0x8546('0x2e')]);_0x447db3[_0x8546('0x34')]=_[_0x8546('0x31')](_0x15e6e1[_0x8546('0x32')],qs['fields'](_0x30e62c[_0x8546('0x2e')][_0x8546('0x33')]));_0x447db3[_0x8546('0x34')]=_0x447db3[_0x8546('0x34')][_0x8546('0x35')]?_0x447db3[_0x8546('0x34')]:_0x15e6e1[_0x8546('0x32')];_0x447db3[_0x8546('0x4c')]=qs['sort'](_0x30e62c[_0x8546('0x2e')][_0x8546('0x38')]);_0x447db3[_0x8546('0x39')]=qs['filters'](_[_0x8546('0x4d')](_0x30e62c[_0x8546('0x2e')],_0x15e6e1['filters']));if(_0x30e62c[_0x8546('0x2e')]['filter']){_0x447db3[_0x8546('0x39')]=_[_0x8546('0x3c')](_0x447db3[_0x8546('0x39')],{'$or':_[_0x8546('0x2a')](_0x447db3[_0x8546('0x34')],function(_0x5d8b0e){var _0x28fb9a={};_0x28fb9a[_0x5d8b0e]={'$like':'%'+_0x30e62c['query']['filter']+'%'};return _0x28fb9a;})});}_0x447db3=_[_0x8546('0x3c')]({},_0x447db3,_0x30e62c[_0x8546('0x3d')]);return _0x28ef80['getSubjects'](_0x447db3);}})['then'](function(_0x3865ef){if(_0x3865ef){_0xa9284e=_0x3865ef[_0x8546('0x35')];if(!_0x30e62c[_0x8546('0x2e')][_0x8546('0x36')](_0x8546('0x37'))){_0x447db3[_0x8546('0x1d')]=qs[_0x8546('0x1d')](_0x30e62c[_0x8546('0x2e')][_0x8546('0x1d')]);_0x447db3[_0x8546('0x1c')]=qs[_0x8546('0x1c')](_0x30e62c[_0x8546('0x2e')][_0x8546('0x1c')]);}return _0x28ef80[_0x8546('0x4e')](_0x447db3);}})[_0x8546('0x24')](function(_0x58a7bb){if(_0x58a7bb){return _0x58a7bb?{'count':_0xa9284e,'rows':_0x58a7bb}:null;}})[_0x8546('0x24')](respondWithResult(_0x3e9653,null))['catch'](handleError(_0x3e9653,null));};exports['getDescriptions']=function(_0x2f80f1,_0x22d1a1,_0x291711){var _0x55607d={};var _0x4a40c3={};var _0x42e235;var _0x316c99;return db[_0x8546('0x3e')][_0x8546('0x4b')]({'where':{'id':_0x2f80f1['params']['id']}})[_0x8546('0x24')](handleEntityNotFound(_0x22d1a1,null))[_0x8546('0x24')](function(_0x1f1b06){if(_0x1f1b06){_0x42e235=_0x1f1b06;_0x4a40c3[_0x8546('0x32')]=_[_0x8546('0x2f')](db[_0x8546('0x4f')][_0x8546('0x2b')]);_0x4a40c3['query']=_[_0x8546('0x2f')](_0x2f80f1[_0x8546('0x2e')]);_0x4a40c3[_0x8546('0x30')]=_['intersection'](_0x4a40c3[_0x8546('0x32')],_0x4a40c3[_0x8546('0x2e')]);_0x55607d[_0x8546('0x34')]=_['intersection'](_0x4a40c3[_0x8546('0x32')],qs['fields'](_0x2f80f1[_0x8546('0x2e')]['fields']));_0x55607d[_0x8546('0x34')]=_0x55607d['attributes'][_0x8546('0x35')]?_0x55607d[_0x8546('0x34')]:_0x4a40c3[_0x8546('0x32')];_0x55607d[_0x8546('0x4c')]=qs[_0x8546('0x38')](_0x2f80f1[_0x8546('0x2e')][_0x8546('0x38')]);_0x55607d[_0x8546('0x39')]=qs['filters'](_[_0x8546('0x4d')](_0x2f80f1[_0x8546('0x2e')],_0x4a40c3['filters']));if(_0x2f80f1['query'][_0x8546('0x3a')]){_0x55607d[_0x8546('0x39')]=_[_0x8546('0x3c')](_0x55607d[_0x8546('0x39')],{'$or':_[_0x8546('0x2a')](_0x55607d[_0x8546('0x34')],function(_0x24bd3c){var _0x6088a9={};_0x6088a9[_0x24bd3c]={'$like':'%'+_0x2f80f1[_0x8546('0x2e')]['filter']+'%'};return _0x6088a9;})});}_0x55607d=_[_0x8546('0x3c')]({},_0x55607d,_0x2f80f1[_0x8546('0x3d')]);return _0x42e235['getDescriptions'](_0x55607d);}})[_0x8546('0x24')](function(_0x5d3d0f){if(_0x5d3d0f){_0x316c99=_0x5d3d0f[_0x8546('0x35')];if(!_0x2f80f1['query']['hasOwnProperty'](_0x8546('0x37'))){_0x55607d[_0x8546('0x1d')]=qs[_0x8546('0x1d')](_0x2f80f1[_0x8546('0x2e')][_0x8546('0x1d')]);_0x55607d[_0x8546('0x1c')]=qs[_0x8546('0x1c')](_0x2f80f1[_0x8546('0x2e')]['offset']);}return _0x42e235['getDescriptions'](_0x55607d);}})[_0x8546('0x24')](function(_0x416bc6){if(_0x416bc6){return _0x416bc6?{'count':_0x316c99,'rows':_0x416bc6}:null;}})[_0x8546('0x24')](respondWithResult(_0x22d1a1,null))['catch'](handleError(_0x22d1a1,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 59a67cb..e4dac18 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 _0x81bd=['../../config/environment','./intDynamics365Configuration.attributes','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x523adf,_0x2fda3c){var _0x2f03bd=function(_0x5eaf1e){while(--_0x5eaf1e){_0x523adf['push'](_0x523adf['shift']());}};_0x2f03bd(++_0x2fda3c);}(_0x81bd,0x7c));var _0xd81b=function(_0x1f3cf1,_0x528a06){_0x1f3cf1=_0x1f3cf1-0x0;var _0x3820da=_0x81bd[_0x1f3cf1];return _0x3820da;};'use strict';var _=require(_0xd81b('0x0'));var util=require(_0xd81b('0x1'));var logger=require(_0xd81b('0x2'))(_0xd81b('0x3'));var moment=require(_0xd81b('0x4'));var BPromise=require(_0xd81b('0x5'));var rp=require(_0xd81b('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd81b('0x7'));var config=require(_0xd81b('0x8'));var attributes=require(_0xd81b('0x9'));module['exports']=function(_0x42a0aa,_0x34eb73){return _0x42a0aa[_0xd81b('0xa')]('Dynamics365Configuration',attributes,{'tableName':'int_dynamics365_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xedd9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intDynamics365Configuration.attributes','exports','Dynamics365Configuration','util'];(function(_0x55e4dd,_0x349afe){var _0x12709d=function(_0x5a9428){while(--_0x5a9428){_0x55e4dd['push'](_0x55e4dd['shift']());}};_0x12709d(++_0x349afe);}(_0xedd9,0xfc));var _0x9edd=function(_0x176d4a,_0x3f14e0){_0x176d4a=_0x176d4a-0x0;var _0x44b481=_0xedd9[_0x176d4a];return _0x44b481;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var logger=require(_0x9edd('0x1'))(_0x9edd('0x2'));var moment=require(_0x9edd('0x3'));var BPromise=require(_0x9edd('0x4'));var rp=require(_0x9edd('0x5'));var fs=require('fs');var path=require(_0x9edd('0x6'));var rimraf=require(_0x9edd('0x7'));var config=require('../../config/environment');var attributes=require(_0x9edd('0x8'));module[_0x9edd('0x9')]=function(_0x268f9e,_0x34c1a7){return _0x268f9e['define'](_0x9edd('0xa'),attributes,{'tableName':'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 c311b47..bde1845 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 _0x7e1d=['lodash','util','bluebird','randomstring','../../config/utils','../../config/environment','jayson/promise','http','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x578de5,_0x32e100){var _0x32eb90=function(_0x367746){while(--_0x367746){_0x578de5['push'](_0x578de5['shift']());}};_0x32eb90(++_0x32e100);}(_0x7e1d,0x13b));var _0xd7e1=function(_0x11c11d,_0x3844d3){_0x11c11d=_0x11c11d-0x0;var _0x99865a=_0x7e1d[_0x11c11d];return _0x99865a;};'use strict';var _=require(_0xd7e1('0x0'));var util=require(_0xd7e1('0x1'));var moment=require('moment');var BPromise=require(_0xd7e1('0x2'));var rs=require(_0xd7e1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xd7e1('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xd7e1('0x5'));var jayson=require(_0xd7e1('0x6'));var client=jayson['client'][_0xd7e1('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x15bbad,_0x328177,_0x53864d){return new BPromise(function(_0x1c039a,_0x36bb4c){return client[_0xd7e1('0x8')](_0x15bbad,_0x53864d)[_0xd7e1('0x9')](function(_0x86b928){logger[_0xd7e1('0xa')](_0xd7e1('0xb'),_0x328177,_0xd7e1('0xc'));logger[_0xd7e1('0xd')](_0xd7e1('0xe'),_0x328177,'request\x20sent',JSON[_0xd7e1('0xf')](_0x86b928));if(_0x86b928[_0xd7e1('0x10')]){if(_0x86b928[_0xd7e1('0x10')][_0xd7e1('0x11')]===0x1f4){logger['error']('Dynamics365Configuration,\x20%s,\x20%s',_0x328177,_0x86b928[_0xd7e1('0x10')][_0xd7e1('0x12')]);return _0x36bb4c(_0x86b928[_0xd7e1('0x10')][_0xd7e1('0x12')]);}logger[_0xd7e1('0x10')](_0xd7e1('0xb'),_0x328177,_0x86b928[_0xd7e1('0x10')][_0xd7e1('0x12')]);return _0x1c039a(_0x86b928[_0xd7e1('0x10')][_0xd7e1('0x12')]);}else{logger[_0xd7e1('0xa')](_0xd7e1('0xb'),_0x328177,'request\x20sent');_0x1c039a(_0x86b928[_0xd7e1('0x13')]['message']);}})[_0xd7e1('0x14')](function(_0xa713ab){logger['error'](_0xd7e1('0xb'),_0x328177,_0xa713ab);_0x36bb4c(_0xa713ab);});});} \ No newline at end of file +var _0x7bf3=['request','Dynamics365Configuration,\x20%s,\x20%s','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','catch','lodash','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x212fcc,_0x1a8867){var _0x4d8190=function(_0x347f7b){while(--_0x347f7b){_0x212fcc['push'](_0x212fcc['shift']());}};_0x4d8190(++_0x1a8867);}(_0x7bf3,0x172));var _0x37bf=function(_0x32f25b,_0x49494a){_0x32f25b=_0x32f25b-0x0;var _0x4549b8=_0x7bf3[_0x32f25b];return _0x4549b8;};'use strict';var _=require(_0x37bf('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x37bf('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x37bf('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x37bf('0x3'));var logger=require(_0x37bf('0x4'))(_0x37bf('0x5'));var config=require(_0x37bf('0x6'));var jayson=require(_0x37bf('0x7'));var client=jayson[_0x37bf('0x8')][_0x37bf('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x437b24,_0x5d0c82,_0x291189){return new BPromise(function(_0x33401a,_0x29273b){return client[_0x37bf('0xa')](_0x437b24,_0x291189)['then'](function(_0xb8f22e){logger['info'](_0x37bf('0xb'),_0x5d0c82,'request\x20sent');logger[_0x37bf('0xc')](_0x37bf('0xd'),_0x5d0c82,'request\x20sent',JSON['stringify'](_0xb8f22e));if(_0xb8f22e[_0x37bf('0xe')]){if(_0xb8f22e[_0x37bf('0xe')][_0x37bf('0xf')]===0x1f4){logger['error'](_0x37bf('0xb'),_0x5d0c82,_0xb8f22e[_0x37bf('0xe')][_0x37bf('0x10')]);return _0x29273b(_0xb8f22e[_0x37bf('0xe')][_0x37bf('0x10')]);}logger[_0x37bf('0xe')]('Dynamics365Configuration,\x20%s,\x20%s',_0x5d0c82,_0xb8f22e[_0x37bf('0xe')][_0x37bf('0x10')]);return _0x33401a(_0xb8f22e[_0x37bf('0xe')][_0x37bf('0x10')]);}else{logger['info'](_0x37bf('0xb'),_0x5d0c82,_0x37bf('0x11'));_0x33401a(_0xb8f22e['result'][_0x37bf('0x10')]);}})[_0x37bf('0x12')](function(_0x51c6d5){logger[_0x37bf('0xe')](_0x37bf('0xb'),_0x5d0c82,_0x51c6d5);_0x29273b(_0x51c6d5);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 0a95857..49fb458 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 _0xe448=['exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','/:id','show','post','create','update','delete'];(function(_0x1621ad,_0x45d8f0){var _0x472791=function(_0x209421){while(--_0x209421){_0x1621ad['push'](_0x1621ad['shift']());}};_0x472791(++_0x45d8f0);}(_0xe448,0xb5));var _0x8e44=function(_0x4aed2c,_0x744c6f){_0x4aed2c=_0x4aed2c-0x0;var _0x4b0ba9=_0xe448[_0x4aed2c];return _0x4b0ba9;};'use strict';var multer=require(_0x8e44('0x0'));var util=require(_0x8e44('0x1'));var path=require(_0x8e44('0x2'));var timeout=require(_0x8e44('0x3'));var express=require(_0x8e44('0x4'));var router=express[_0x8e44('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8e44('0x6'));var config=require(_0x8e44('0x7'));var controller=require(_0x8e44('0x8'));router[_0x8e44('0x9')]('/',auth[_0x8e44('0xa')](),controller['index']);router[_0x8e44('0x9')](_0x8e44('0xb'),auth['isAuthenticated'](),controller[_0x8e44('0xc')]);router[_0x8e44('0xd')]('/',auth[_0x8e44('0xa')](),controller[_0x8e44('0xe')]);router['put'](_0x8e44('0xb'),auth[_0x8e44('0xa')](),controller[_0x8e44('0xf')]);router[_0x8e44('0x10')](_0x8e44('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x8e44('0x11')]=router; \ No newline at end of file +var _0x900f=['fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','create','put','update','exports','util','path','connect-timeout','Router'];(function(_0x454233,_0x4f592c){var _0x16dfbc=function(_0x4eeb40){while(--_0x4eeb40){_0x454233['push'](_0x454233['shift']());}};_0x16dfbc(++_0x4f592c);}(_0x900f,0x1be));var _0xf900=function(_0x5e895f,_0x3167d7){_0x5e895f=_0x5e895f-0x0;var _0x1a6d33=_0x900f[_0x5e895f];return _0x1a6d33;};'use strict';var multer=require('multer');var util=require(_0xf900('0x0'));var path=require(_0xf900('0x1'));var timeout=require(_0xf900('0x2'));var express=require('express');var router=express[_0xf900('0x3')]();var fs_extra=require(_0xf900('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xf900('0x5'));var config=require(_0xf900('0x6'));var controller=require('./intDynamics365Field.controller');router[_0xf900('0x7')]('/',auth[_0xf900('0x8')](),controller['index']);router[_0xf900('0x7')](_0xf900('0x9'),auth[_0xf900('0x8')](),controller[_0xf900('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0xf900('0xb')]);router[_0xf900('0xc')](_0xf900('0x9'),auth[_0xf900('0x8')](),controller[_0xf900('0xd')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xf900('0xe')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index 01b6e7a..2da838f 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 _0x364d=['sequelize','exports','ENUM','variable','keyValue','picklist','string','STRING'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x364d,0x158));var _0xd364=function(_0x474f07,_0x403469){_0x474f07=_0x474f07-0x0;var _0x2121cc=_0x364d[_0x474f07];return _0x2121cc;};'use strict';var Sequelize=require(_0xd364('0x0'));module[_0xd364('0x1')]={'type':{'type':Sequelize[_0xd364('0x2')]('string',_0xd364('0x3'),'customVariable',_0xd364('0x4'),_0xd364('0x5')),'defaultValue':_0xd364('0x6')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0xd364('0x6'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0xd364('0x7')]},'idField':{'type':Sequelize[_0xd364('0x7')]},'nameField':{'type':Sequelize[_0xd364('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xd364('0x7')]}}; \ No newline at end of file +var _0x8f8a=['STRING','ENUM','BOOLEAN','sequelize','exports','string','customVariable','picklist'];(function(_0x5e98c,_0x34edbe){var _0x42d75f=function(_0x85ce9b){while(--_0x85ce9b){_0x5e98c['push'](_0x5e98c['shift']());}};_0x42d75f(++_0x34edbe);}(_0x8f8a,0x163));var _0xa8f8=function(_0x1a6830,_0x44b168){_0x1a6830=_0x1a6830-0x0;var _0x3c96ba=_0x8f8a[_0x1a6830];return _0x3c96ba;};'use strict';var Sequelize=require(_0xa8f8('0x0'));module[_0xa8f8('0x1')]={'type':{'type':Sequelize['ENUM'](_0xa8f8('0x2'),'variable',_0xa8f8('0x3'),'keyValue',_0xa8f8('0x4')),'defaultValue':_0xa8f8('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xa8f8('0x5')]},'keyType':{'type':Sequelize[_0xa8f8('0x6')]('string','variable',_0xa8f8('0x3'))},'keyContent':{'type':Sequelize[_0xa8f8('0x5')]},'idField':{'type':Sequelize[_0xa8f8('0x5')]},'nameField':{'type':Sequelize[_0xa8f8('0x5')]},'customField':{'type':Sequelize[_0xa8f8('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa8f8('0x5')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 4b89ee0..04b2bad 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 _0x9c8e=['rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','map','VIRTUAL','includeAll','include','findAll','rows','catch','params','options','find','create','body','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','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','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','end','error','name','send','index','Dynamics365Field'];(function(_0x3c4856,_0x98f049){var _0xba2cac=function(_0x16fedc){while(--_0x16fedc){_0x3c4856['push'](_0x3c4856['shift']());}};_0xba2cac(++_0x98f049);}(_0x9c8e,0x196));var _0xe9c8=function(_0x1db380,_0x30a59b){_0x1db380=_0x1db380-0x0;var _0x1803f9=_0x9c8e[_0x1db380];return _0x1803f9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe9c8('0x0'));var zipdir=require(_0xe9c8('0x1'));var jsonpatch=require(_0xe9c8('0x2'));var rp=require('request-promise');var moment=require(_0xe9c8('0x3'));var BPromise=require(_0xe9c8('0x4'));var Mustache=require(_0xe9c8('0x5'));var util=require(_0xe9c8('0x6'));var path=require(_0xe9c8('0x7'));var sox=require(_0xe9c8('0x8'));var csv=require(_0xe9c8('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe9c8('0xa'));var _=require('lodash');var squel=require(_0xe9c8('0xb'));var crypto=require(_0xe9c8('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xe9c8('0xd'));var toCsv=require(_0xe9c8('0x9'));var querystring=require(_0xe9c8('0xe'));var Papa=require('papaparse');var Redis=require(_0xe9c8('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xe9c8('0x10'));var as=require(_0xe9c8('0x11'));var hardwareService=require(_0xe9c8('0x12'));var logger=require(_0xe9c8('0x13'))(_0xe9c8('0x14'));var utils=require(_0xe9c8('0x15'));var config=require(_0xe9c8('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe9c8('0x17'))['db'];function respondWithStatusCode(_0x24fde6,_0x55fe79){_0x55fe79=_0x55fe79||0xcc;return function(_0x5c274b){if(_0x5c274b){return _0x24fde6[_0xe9c8('0x18')](_0x55fe79);}return _0x24fde6[_0xe9c8('0x19')](_0x55fe79)['end']();};}function respondWithResult(_0x4c3732,_0x562aa9){_0x562aa9=_0x562aa9||0xc8;return function(_0x5dca3b){if(_0x5dca3b){return _0x4c3732[_0xe9c8('0x19')](_0x562aa9)[_0xe9c8('0x1a')](_0x5dca3b);}};}function respondWithFilteredResult(_0x4e1830,_0x3567ee){return function(_0x383ff2){if(_0x383ff2){var _0x275d9d=typeof _0x3567ee[_0xe9c8('0x1b')]===_0xe9c8('0x1c')&&typeof _0x3567ee[_0xe9c8('0x1d')]===_0xe9c8('0x1c');var _0xa08abc=_0x383ff2[_0xe9c8('0x1e')];var _0x514c37=_0x275d9d?0x0:_0x3567ee['offset'];var _0x370ab8=_0x275d9d?_0x383ff2[_0xe9c8('0x1e')]:_0x3567ee[_0xe9c8('0x1b')]+_0x3567ee[_0xe9c8('0x1d')];var _0x243702;if(_0x370ab8>=_0xa08abc){_0x370ab8=_0xa08abc;_0x243702=0xc8;}else{_0x243702=0xce;}_0x4e1830[_0xe9c8('0x19')](_0x243702);return _0x4e1830['set'](_0xe9c8('0x1f'),_0x514c37+'-'+_0x370ab8+'/'+_0xa08abc)['json'](_0x383ff2);}return null;};}function patchUpdates(_0x34202f){return function(_0x16d0d7){try{jsonpatch[_0xe9c8('0x20')](_0x16d0d7,_0x34202f,!![]);}catch(_0x19c428){return BPromise[_0xe9c8('0x21')](_0x19c428);}return _0x16d0d7[_0xe9c8('0x22')]();};}function saveUpdates(_0x42bbae,_0x581af4){return function(_0x4b1ffd){if(_0x4b1ffd){return _0x4b1ffd[_0xe9c8('0x23')](_0x42bbae)['then'](function(_0x5d5b57){return _0x5d5b57;});}return null;};}function removeEntity(_0x2453a5,_0x7a5bea){return function(_0x44667e){if(_0x44667e){return _0x44667e[_0xe9c8('0x24')]()[_0xe9c8('0x25')](function(){_0x2453a5['status'](0xcc)[_0xe9c8('0x26')]();});}};}function handleEntityNotFound(_0x2227c9,_0x4a1fdc){return function(_0x37e54e){if(!_0x37e54e){_0x2227c9[_0xe9c8('0x18')](0x194);}return _0x37e54e;};}function handleError(_0x387dba,_0x266b6b){_0x266b6b=_0x266b6b||0x1f4;return function(_0x292141){logger[_0xe9c8('0x27')](_0x292141['stack']);if(_0x292141['name']){delete _0x292141[_0xe9c8('0x28')];}_0x387dba[_0xe9c8('0x19')](_0x266b6b)[_0xe9c8('0x29')](_0x292141);};}exports[_0xe9c8('0x2a')]=function(_0x48194b,_0x3a0b71){var _0x31a2eb={},_0x46ec56={},_0x30c3a0={'count':0x0,'rows':[]};var _0x213b52=_['map'](db[_0xe9c8('0x2b')][_0xe9c8('0x2c')],function(_0x38c3ca){return{'name':_0x38c3ca[_0xe9c8('0x2d')],'type':_0x38c3ca[_0xe9c8('0x2e')][_0xe9c8('0x2f')]};});_0x46ec56[_0xe9c8('0x30')]=_['map'](_0x213b52,'name');_0x46ec56[_0xe9c8('0x31')]=_[_0xe9c8('0x32')](_0x48194b[_0xe9c8('0x31')]);_0x46ec56[_0xe9c8('0x33')]=_[_0xe9c8('0x34')](_0x46ec56[_0xe9c8('0x30')],_0x46ec56[_0xe9c8('0x31')]);_0x31a2eb[_0xe9c8('0x35')]=_['intersection'](_0x46ec56[_0xe9c8('0x30')],qs['fields'](_0x48194b['query'][_0xe9c8('0x36')]));_0x31a2eb['attributes']=_0x31a2eb[_0xe9c8('0x35')][_0xe9c8('0x37')]?_0x31a2eb['attributes']:_0x46ec56[_0xe9c8('0x30')];if(!_0x48194b[_0xe9c8('0x31')][_0xe9c8('0x38')]('nolimit')){_0x31a2eb[_0xe9c8('0x1d')]=qs[_0xe9c8('0x1d')](_0x48194b[_0xe9c8('0x31')][_0xe9c8('0x1d')]);_0x31a2eb['offset']=qs[_0xe9c8('0x1b')](_0x48194b[_0xe9c8('0x31')][_0xe9c8('0x1b')]);}_0x31a2eb[_0xe9c8('0x39')]=qs[_0xe9c8('0x3a')](_0x48194b[_0xe9c8('0x31')][_0xe9c8('0x3a')]);_0x31a2eb[_0xe9c8('0x3b')]=qs[_0xe9c8('0x33')](_[_0xe9c8('0x3c')](_0x48194b[_0xe9c8('0x31')],_0x46ec56['filters']),_0x213b52);if(_0x48194b['query'][_0xe9c8('0x3d')]){_0x31a2eb[_0xe9c8('0x3b')]=_[_0xe9c8('0x3e')](_0x31a2eb['where'],{'$or':_[_0xe9c8('0x3f')](_0x213b52,function(_0x31f5a3){if(_0x31f5a3[_0xe9c8('0x2e')]!==_0xe9c8('0x40')){var _0x8ae2ce={};_0x8ae2ce[_0x31f5a3[_0xe9c8('0x28')]]={'$like':'%'+_0x48194b[_0xe9c8('0x31')][_0xe9c8('0x3d')]+'%'};return _0x8ae2ce;}})});}_0x31a2eb=_[_0xe9c8('0x3e')]({},_0x31a2eb,_0x48194b['options']);var _0x7fd9ad={'where':_0x31a2eb[_0xe9c8('0x3b')]};return db[_0xe9c8('0x2b')][_0xe9c8('0x1e')](_0x7fd9ad)[_0xe9c8('0x25')](function(_0x3618e5){_0x30c3a0[_0xe9c8('0x1e')]=_0x3618e5;if(_0x48194b['query'][_0xe9c8('0x41')]){_0x31a2eb[_0xe9c8('0x42')]=[{'all':!![]}];}return db[_0xe9c8('0x2b')][_0xe9c8('0x43')](_0x31a2eb);})[_0xe9c8('0x25')](function(_0x24280a){_0x30c3a0[_0xe9c8('0x44')]=_0x24280a;return _0x30c3a0;})['then'](respondWithFilteredResult(_0x3a0b71,_0x31a2eb))[_0xe9c8('0x45')](handleError(_0x3a0b71,null));};exports['show']=function(_0x289fbf,_0x9e3fa){var _0x45762f={'raw':!![],'where':{'id':_0x289fbf[_0xe9c8('0x46')]['id']}},_0x5beee3={};_0x5beee3[_0xe9c8('0x30')]=_[_0xe9c8('0x32')](db['Dynamics365Field'][_0xe9c8('0x2c')]);_0x5beee3['query']=_[_0xe9c8('0x32')](_0x289fbf[_0xe9c8('0x31')]);_0x5beee3['filters']=_['intersection'](_0x5beee3[_0xe9c8('0x30')],_0x5beee3[_0xe9c8('0x31')]);_0x45762f[_0xe9c8('0x35')]=_[_0xe9c8('0x34')](_0x5beee3['model'],qs['fields'](_0x289fbf[_0xe9c8('0x31')][_0xe9c8('0x36')]));_0x45762f['attributes']=_0x45762f['attributes'][_0xe9c8('0x37')]?_0x45762f[_0xe9c8('0x35')]:_0x5beee3[_0xe9c8('0x30')];if(_0x289fbf[_0xe9c8('0x31')]['includeAll']){_0x45762f['include']=[{'all':!![]}];}_0x45762f=_['merge']({},_0x45762f,_0x289fbf[_0xe9c8('0x47')]);return db[_0xe9c8('0x2b')][_0xe9c8('0x48')](_0x45762f)['then'](handleEntityNotFound(_0x9e3fa,null))[_0xe9c8('0x25')](respondWithResult(_0x9e3fa,null))[_0xe9c8('0x45')](handleError(_0x9e3fa,null));};exports[_0xe9c8('0x49')]=function(_0x4a6ef2,_0x46066f){return db['Dynamics365Field'][_0xe9c8('0x49')](_0x4a6ef2[_0xe9c8('0x4a')],{})[_0xe9c8('0x25')](respondWithResult(_0x46066f,0xc9))['catch'](handleError(_0x46066f,null));};exports[_0xe9c8('0x23')]=function(_0x2564af,_0x3bdbe7){if(_0x2564af['body']['id']){delete _0x2564af[_0xe9c8('0x4a')]['id'];}return db[_0xe9c8('0x2b')][_0xe9c8('0x48')]({'where':{'id':_0x2564af[_0xe9c8('0x46')]['id']}})[_0xe9c8('0x25')](handleEntityNotFound(_0x3bdbe7,null))[_0xe9c8('0x25')](saveUpdates(_0x2564af[_0xe9c8('0x4a')],null))['then'](respondWithResult(_0x3bdbe7,null))[_0xe9c8('0x45')](handleError(_0x3bdbe7,null));};exports[_0xe9c8('0x24')]=function(_0x26e45d,_0x391b4d){return db['Dynamics365Field']['find']({'where':{'id':_0x26e45d[_0xe9c8('0x46')]['id']}})[_0xe9c8('0x25')](handleEntityNotFound(_0x391b4d,null))[_0xe9c8('0x25')](removeEntity(_0x391b4d,null))[_0xe9c8('0x45')](handleError(_0x391b4d,null));}; \ No newline at end of file +var _0xb869=['zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','Dynamics365Field','rawAttributes','type','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','fields','find','catch','create','body','params'];(function(_0x1e73cf,_0x50f647){var _0x22494b=function(_0x3c14c8){while(--_0x3c14c8){_0x1e73cf['push'](_0x1e73cf['shift']());}};_0x22494b(++_0x50f647);}(_0xb869,0xde));var _0x9b86=function(_0x2f571f,_0x469ab6){_0x2f571f=_0x2f571f-0x0;var _0x807af7=_0xb869[_0x2f571f];return _0x807af7;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9b86('0x0'));var jsonpatch=require(_0x9b86('0x1'));var rp=require(_0x9b86('0x2'));var moment=require('moment');var BPromise=require(_0x9b86('0x3'));var Mustache=require(_0x9b86('0x4'));var util=require(_0x9b86('0x5'));var path=require(_0x9b86('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x9b86('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9b86('0x8'));var squel=require(_0x9b86('0x9'));var crypto=require(_0x9b86('0xa'));var jsforce=require(_0x9b86('0xb'));var deskjs=require(_0x9b86('0xc'));var toCsv=require(_0x9b86('0xd'));var querystring=require(_0x9b86('0xe'));var Papa=require(_0x9b86('0xf'));var Redis=require('ioredis');var authService=require(_0x9b86('0x10'));var qs=require(_0x9b86('0x11'));var as=require(_0x9b86('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x9b86('0x13'));var utils=require('../../config/utils');var config=require(_0x9b86('0x14'));var licenseUtil=require(_0x9b86('0x15'));var db=require(_0x9b86('0x16'))['db'];function respondWithStatusCode(_0x1b0b5c,_0x5c0114){_0x5c0114=_0x5c0114||0xcc;return function(_0x2f3742){if(_0x2f3742){return _0x1b0b5c[_0x9b86('0x17')](_0x5c0114);}return _0x1b0b5c['status'](_0x5c0114)[_0x9b86('0x18')]();};}function respondWithResult(_0x28d3fa,_0x58a566){_0x58a566=_0x58a566||0xc8;return function(_0x209996){if(_0x209996){return _0x28d3fa['status'](_0x58a566)[_0x9b86('0x19')](_0x209996);}};}function respondWithFilteredResult(_0x58eca1,_0x5722cd){return function(_0x1271e6){if(_0x1271e6){var _0x141be4=typeof _0x5722cd[_0x9b86('0x1a')]===_0x9b86('0x1b')&&typeof _0x5722cd[_0x9b86('0x1c')]==='undefined';var _0x59c783=_0x1271e6[_0x9b86('0x1d')];var _0x1dd0f8=_0x141be4?0x0:_0x5722cd['offset'];var _0x254c27=_0x141be4?_0x1271e6[_0x9b86('0x1d')]:_0x5722cd[_0x9b86('0x1a')]+_0x5722cd[_0x9b86('0x1c')];var _0x5e5393;if(_0x254c27>=_0x59c783){_0x254c27=_0x59c783;_0x5e5393=0xc8;}else{_0x5e5393=0xce;}_0x58eca1[_0x9b86('0x1e')](_0x5e5393);return _0x58eca1[_0x9b86('0x1f')](_0x9b86('0x20'),_0x1dd0f8+'-'+_0x254c27+'/'+_0x59c783)['json'](_0x1271e6);}return null;};}function patchUpdates(_0x56f738){return function(_0x47b82c){try{jsonpatch[_0x9b86('0x21')](_0x47b82c,_0x56f738,!![]);}catch(_0x2c18cd){return BPromise[_0x9b86('0x22')](_0x2c18cd);}return _0x47b82c[_0x9b86('0x23')]();};}function saveUpdates(_0x13d046,_0x4ed7bb){return function(_0x652a7b){if(_0x652a7b){return _0x652a7b[_0x9b86('0x24')](_0x13d046)[_0x9b86('0x25')](function(_0x4e9944){return _0x4e9944;});}return null;};}function removeEntity(_0x36e1a4,_0x2cc7ee){return function(_0xd9970a){if(_0xd9970a){return _0xd9970a[_0x9b86('0x26')]()[_0x9b86('0x25')](function(){_0x36e1a4[_0x9b86('0x1e')](0xcc)[_0x9b86('0x18')]();});}};}function handleEntityNotFound(_0xa6e561,_0x5b66ea){return function(_0x148fe5){if(!_0x148fe5){_0xa6e561[_0x9b86('0x17')](0x194);}return _0x148fe5;};}function handleError(_0x59da99,_0x5dad15){_0x5dad15=_0x5dad15||0x1f4;return function(_0x13916f){logger[_0x9b86('0x27')](_0x13916f[_0x9b86('0x28')]);if(_0x13916f[_0x9b86('0x29')]){delete _0x13916f[_0x9b86('0x29')];}_0x59da99['status'](_0x5dad15)['send'](_0x13916f);};}exports[_0x9b86('0x2a')]=function(_0x2f050b,_0x1d45e5){var _0xbbaa37={},_0x5921a3={},_0x1aa1fb={'count':0x0,'rows':[]};var _0x2f4a9f=_[_0x9b86('0x2b')](db[_0x9b86('0x2c')][_0x9b86('0x2d')],function(_0x143636){return{'name':_0x143636['fieldName'],'type':_0x143636[_0x9b86('0x2e')]['key']};});_0x5921a3[_0x9b86('0x2f')]=_[_0x9b86('0x2b')](_0x2f4a9f,'name');_0x5921a3[_0x9b86('0x30')]=_[_0x9b86('0x31')](_0x2f050b[_0x9b86('0x30')]);_0x5921a3[_0x9b86('0x32')]=_[_0x9b86('0x33')](_0x5921a3[_0x9b86('0x2f')],_0x5921a3[_0x9b86('0x30')]);_0xbbaa37[_0x9b86('0x34')]=_[_0x9b86('0x33')](_0x5921a3[_0x9b86('0x2f')],qs['fields'](_0x2f050b[_0x9b86('0x30')]['fields']));_0xbbaa37['attributes']=_0xbbaa37[_0x9b86('0x34')][_0x9b86('0x35')]?_0xbbaa37[_0x9b86('0x34')]:_0x5921a3[_0x9b86('0x2f')];if(!_0x2f050b[_0x9b86('0x30')][_0x9b86('0x36')](_0x9b86('0x37'))){_0xbbaa37[_0x9b86('0x1c')]=qs['limit'](_0x2f050b[_0x9b86('0x30')][_0x9b86('0x1c')]);_0xbbaa37[_0x9b86('0x1a')]=qs[_0x9b86('0x1a')](_0x2f050b[_0x9b86('0x30')][_0x9b86('0x1a')]);}_0xbbaa37[_0x9b86('0x38')]=qs[_0x9b86('0x39')](_0x2f050b[_0x9b86('0x30')]['sort']);_0xbbaa37['where']=qs[_0x9b86('0x32')](_['pick'](_0x2f050b[_0x9b86('0x30')],_0x5921a3[_0x9b86('0x32')]),_0x2f4a9f);if(_0x2f050b[_0x9b86('0x30')][_0x9b86('0x3a')]){_0xbbaa37[_0x9b86('0x3b')]=_[_0x9b86('0x3c')](_0xbbaa37[_0x9b86('0x3b')],{'$or':_['map'](_0x2f4a9f,function(_0x15b79a){if(_0x15b79a[_0x9b86('0x2e')]!==_0x9b86('0x3d')){var _0x4e93be={};_0x4e93be[_0x15b79a[_0x9b86('0x29')]]={'$like':'%'+_0x2f050b[_0x9b86('0x30')][_0x9b86('0x3a')]+'%'};return _0x4e93be;}})});}_0xbbaa37=_['merge']({},_0xbbaa37,_0x2f050b[_0x9b86('0x3e')]);var _0x2a330f={'where':_0xbbaa37[_0x9b86('0x3b')]};return db['Dynamics365Field'][_0x9b86('0x1d')](_0x2a330f)['then'](function(_0x2098a3){_0x1aa1fb[_0x9b86('0x1d')]=_0x2098a3;if(_0x2f050b[_0x9b86('0x30')][_0x9b86('0x3f')]){_0xbbaa37[_0x9b86('0x40')]=[{'all':!![]}];}return db[_0x9b86('0x2c')][_0x9b86('0x41')](_0xbbaa37);})[_0x9b86('0x25')](function(_0x3e3260){_0x1aa1fb[_0x9b86('0x42')]=_0x3e3260;return _0x1aa1fb;})[_0x9b86('0x25')](respondWithFilteredResult(_0x1d45e5,_0xbbaa37))['catch'](handleError(_0x1d45e5,null));};exports[_0x9b86('0x43')]=function(_0x108b48,_0x3e9f08){var _0x31d172={'raw':!![],'where':{'id':_0x108b48['params']['id']}},_0x3b2dba={};_0x3b2dba[_0x9b86('0x2f')]=_[_0x9b86('0x31')](db['Dynamics365Field'][_0x9b86('0x2d')]);_0x3b2dba[_0x9b86('0x30')]=_[_0x9b86('0x31')](_0x108b48['query']);_0x3b2dba['filters']=_[_0x9b86('0x33')](_0x3b2dba['model'],_0x3b2dba[_0x9b86('0x30')]);_0x31d172[_0x9b86('0x34')]=_['intersection'](_0x3b2dba[_0x9b86('0x2f')],qs[_0x9b86('0x44')](_0x108b48['query'][_0x9b86('0x44')]));_0x31d172['attributes']=_0x31d172[_0x9b86('0x34')][_0x9b86('0x35')]?_0x31d172['attributes']:_0x3b2dba['model'];if(_0x108b48[_0x9b86('0x30')][_0x9b86('0x3f')]){_0x31d172['include']=[{'all':!![]}];}_0x31d172=_[_0x9b86('0x3c')]({},_0x31d172,_0x108b48[_0x9b86('0x3e')]);return db['Dynamics365Field'][_0x9b86('0x45')](_0x31d172)[_0x9b86('0x25')](handleEntityNotFound(_0x3e9f08,null))['then'](respondWithResult(_0x3e9f08,null))[_0x9b86('0x46')](handleError(_0x3e9f08,null));};exports[_0x9b86('0x47')]=function(_0x588814,_0x52686a){return db[_0x9b86('0x2c')][_0x9b86('0x47')](_0x588814[_0x9b86('0x48')],{})[_0x9b86('0x25')](respondWithResult(_0x52686a,0xc9))[_0x9b86('0x46')](handleError(_0x52686a,null));};exports['update']=function(_0x5ce3b4,_0x223548){if(_0x5ce3b4[_0x9b86('0x48')]['id']){delete _0x5ce3b4[_0x9b86('0x48')]['id'];}return db[_0x9b86('0x2c')][_0x9b86('0x45')]({'where':{'id':_0x5ce3b4[_0x9b86('0x49')]['id']}})['then'](handleEntityNotFound(_0x223548,null))[_0x9b86('0x25')](saveUpdates(_0x5ce3b4[_0x9b86('0x48')],null))[_0x9b86('0x25')](respondWithResult(_0x223548,null))[_0x9b86('0x46')](handleError(_0x223548,null));};exports[_0x9b86('0x26')]=function(_0x3a76ab,_0x305ea9){return db[_0x9b86('0x2c')][_0x9b86('0x45')]({'where':{'id':_0x3a76ab[_0x9b86('0x49')]['id']}})[_0x9b86('0x25')](handleEntityNotFound(_0x305ea9,null))[_0x9b86('0x25')](removeEntity(_0x305ea9,null))['catch'](handleError(_0x305ea9,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 53dfea0..db77c62 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 _0x0eab=['int_dynamics365_fields','dynamics365_unique_index','FieldId','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./intDynamics365Field.attributes','define','Dynamics365Field'];(function(_0x4e90e0,_0x4dead6){var _0x1ba9a=function(_0x4107ea){while(--_0x4107ea){_0x4e90e0['push'](_0x4e90e0['shift']());}};_0x1ba9a(++_0x4dead6);}(_0x0eab,0x1b5));var _0xb0ea=function(_0x216a74,_0x42d180){_0x216a74=_0x216a74-0x0;var _0x2c9614=_0x0eab[_0x216a74];return _0x2c9614;};'use strict';var _=require(_0xb0ea('0x0'));var util=require(_0xb0ea('0x1'));var logger=require(_0xb0ea('0x2'))(_0xb0ea('0x3'));var moment=require('moment');var BPromise=require(_0xb0ea('0x4'));var rp=require(_0xb0ea('0x5'));var fs=require('fs');var path=require(_0xb0ea('0x6'));var rimraf=require(_0xb0ea('0x7'));var config=require('../../config/environment');var attributes=require(_0xb0ea('0x8'));module['exports']=function(_0x359000,_0x55b52f){return _0x359000[_0xb0ea('0x9')](_0xb0ea('0xa'),attributes,{'tableName':_0xb0ea('0xb'),'paranoid':![],'indexes':[{'name':_0xb0ea('0xc'),'fields':['idField',_0xb0ea('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9717=['idField','FieldId','util','api','moment','request-promise','rimraf','../../config/environment','exports','define','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index'];(function(_0x521094,_0x491f3c){var _0x4433c7=function(_0x10c47d){while(--_0x10c47d){_0x521094['push'](_0x521094['shift']());}};_0x4433c7(++_0x491f3c);}(_0x9717,0xab));var _0x7971=function(_0x1f12ac,_0x4f7b54){_0x1f12ac=_0x1f12ac-0x0;var _0x1ef13b=_0x9717[_0x1f12ac];return _0x1ef13b;};'use strict';var _=require('lodash');var util=require(_0x7971('0x0'));var logger=require('../../config/logger')(_0x7971('0x1'));var moment=require(_0x7971('0x2'));var BPromise=require('bluebird');var rp=require(_0x7971('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7971('0x4'));var config=require(_0x7971('0x5'));var attributes=require('./intDynamics365Field.attributes');module[_0x7971('0x6')]=function(_0x4f62d3,_0x44bb86){return _0x4f62d3[_0x7971('0x7')](_0x7971('0x8'),attributes,{'tableName':_0x7971('0x9'),'paranoid':![],'indexes':[{'name':_0x7971('0xa'),'fields':[_0x7971('0xb'),_0x7971('0xc')],'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 06a6846..1da2dd6 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 _0x4985=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','error','code','message','info','result','lodash','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x53b968,_0x5dfb0d){var _0x42b0cf=function(_0x349e76){while(--_0x349e76){_0x53b968['push'](_0x53b968['shift']());}};_0x42b0cf(++_0x5dfb0d);}(_0x4985,0xc9));var _0x5498=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0x4985[_0x25bea7];return _0x175952;};'use strict';var _=require(_0x5498('0x0'));var util=require(_0x5498('0x1'));var moment=require(_0x5498('0x2'));var BPromise=require(_0x5498('0x3'));var rs=require(_0x5498('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5498('0x5'))['db'];var utils=require(_0x5498('0x6'));var logger=require(_0x5498('0x7'))(_0x5498('0x8'));var config=require('../../config/environment');var jayson=require(_0x5498('0x9'));var client=jayson[_0x5498('0xa')][_0x5498('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xf40104,_0x2ec37f,_0x1f49d1){return new BPromise(function(_0xe71499,_0x5e598c){return client[_0x5498('0xc')](_0xf40104,_0x1f49d1)[_0x5498('0xd')](function(_0x122737){logger['info'](_0x5498('0xe'),_0x2ec37f,_0x5498('0xf'));logger[_0x5498('0x10')](_0x5498('0x11'),_0x2ec37f,_0x5498('0xf'),JSON['stringify'](_0x122737));if(_0x122737[_0x5498('0x12')]){if(_0x122737[_0x5498('0x12')][_0x5498('0x13')]===0x1f4){logger[_0x5498('0x12')](_0x5498('0xe'),_0x2ec37f,_0x122737[_0x5498('0x12')][_0x5498('0x14')]);return _0x5e598c(_0x122737['error'][_0x5498('0x14')]);}logger[_0x5498('0x12')](_0x5498('0xe'),_0x2ec37f,_0x122737[_0x5498('0x12')][_0x5498('0x14')]);return _0xe71499(_0x122737['error'][_0x5498('0x14')]);}else{logger[_0x5498('0x15')](_0x5498('0xe'),_0x2ec37f,_0x5498('0xf'));_0xe71499(_0x122737[_0x5498('0x16')][_0x5498('0x14')]);}})['catch'](function(_0x10858c){logger['error'](_0x5498('0xe'),_0x2ec37f,_0x10858c);_0x5e598c(_0x10858c);});});} \ No newline at end of file +var _0xfe72=['request','then','info','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','message','Dynamics365Field,\x20%s,\x20%s','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x3f52d9,_0x1d748c){var _0x21e01f=function(_0x22e584){while(--_0x22e584){_0x3f52d9['push'](_0x3f52d9['shift']());}};_0x21e01f(++_0x1d748c);}(_0xfe72,0x1ef));var _0x2fe7=function(_0x581a41,_0x5dd178){_0x581a41=_0x581a41-0x0;var _0x4e5b98=_0xfe72[_0x581a41];return _0x4e5b98;};'use strict';var _=require(_0x2fe7('0x0'));var util=require(_0x2fe7('0x1'));var moment=require(_0x2fe7('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2fe7('0x3'));var db=require(_0x2fe7('0x4'))['db'];var utils=require(_0x2fe7('0x5'));var logger=require(_0x2fe7('0x6'))(_0x2fe7('0x7'));var config=require(_0x2fe7('0x8'));var jayson=require(_0x2fe7('0x9'));var client=jayson[_0x2fe7('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x54058c,_0x4bbeba,_0x55eb6f){return new BPromise(function(_0x1e79fe,_0x38ae49){return client[_0x2fe7('0xb')](_0x54058c,_0x55eb6f)[_0x2fe7('0xc')](function(_0xbcbe80){logger[_0x2fe7('0xd')]('Dynamics365Field,\x20%s,\x20%s',_0x4bbeba,_0x2fe7('0xe'));logger[_0x2fe7('0xf')](_0x2fe7('0x10'),_0x4bbeba,_0x2fe7('0xe'),JSON[_0x2fe7('0x11')](_0xbcbe80));if(_0xbcbe80[_0x2fe7('0x12')]){if(_0xbcbe80['error']['code']===0x1f4){logger[_0x2fe7('0x12')]('Dynamics365Field,\x20%s,\x20%s',_0x4bbeba,_0xbcbe80[_0x2fe7('0x12')][_0x2fe7('0x13')]);return _0x38ae49(_0xbcbe80[_0x2fe7('0x12')][_0x2fe7('0x13')]);}logger['error'](_0x2fe7('0x14'),_0x4bbeba,_0xbcbe80[_0x2fe7('0x12')][_0x2fe7('0x13')]);return _0x1e79fe(_0xbcbe80[_0x2fe7('0x12')]['message']);}else{logger['info']('Dynamics365Field,\x20%s,\x20%s',_0x4bbeba,_0x2fe7('0xe'));_0x1e79fe(_0xbcbe80[_0x2fe7('0x15')][_0x2fe7('0x13')]);}})[_0x2fe7('0x16')](function(_0x1e9051){logger[_0x2fe7('0x12')](_0x2fe7('0x14'),_0x4bbeba,_0x1e9051);_0x38ae49(_0x1e9051);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index 4099674..8ec4b3b 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 _0xa7e5=['path','connect-timeout','express','Router','../../components/interaction/service','./intFreshdeskAccount.controller','get','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','destroy','multer'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0xa7e5,0x71));var _0x5a7e=function(_0x1df45b,_0x11b0c6){_0x1df45b=_0x1df45b-0x0;var _0x502aa7=_0xa7e5[_0x1df45b];return _0x502aa7;};'use strict';var multer=require(_0x5a7e('0x0'));var util=require('util');var path=require(_0x5a7e('0x1'));var timeout=require(_0x5a7e('0x2'));var express=require(_0x5a7e('0x3'));var router=express[_0x5a7e('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x5a7e('0x5'));var config=require('../../config/environment');var controller=require(_0x5a7e('0x6'));router[_0x5a7e('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5a7e('0x7')](_0x5a7e('0x8'),auth[_0x5a7e('0x9')](),controller[_0x5a7e('0xa')]);router[_0x5a7e('0x7')](_0x5a7e('0xb'),auth[_0x5a7e('0x9')](),controller[_0x5a7e('0xc')]);router[_0x5a7e('0x7')](_0x5a7e('0xd'),auth['isAuthenticated'](),controller[_0x5a7e('0xe')]);router[_0x5a7e('0xf')]('/',auth[_0x5a7e('0x9')](),controller[_0x5a7e('0x10')]);router[_0x5a7e('0xf')](_0x5a7e('0xb'),auth[_0x5a7e('0x9')](),controller[_0x5a7e('0x11')]);router['put']('/:id',auth[_0x5a7e('0x9')](),controller['update']);router['delete']('/:id',auth[_0x5a7e('0x9')](),controller[_0x5a7e('0x12')]);module['exports']=router; \ No newline at end of file +var _0x6ac6=['getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','index','/:id','isAuthenticated','show','/:id/configurations'];(function(_0x429df0,_0x3e2ca2){var _0x4bc7ba=function(_0x59aba6){while(--_0x59aba6){_0x429df0['push'](_0x429df0['shift']());}};_0x4bc7ba(++_0x3e2ca2);}(_0x6ac6,0x1df));var _0x66ac=function(_0x4004d9,_0x526735){_0x4004d9=_0x4004d9-0x0;var _0xad9b76=_0x6ac6[_0x4004d9];return _0xad9b76;};'use strict';var multer=require(_0x66ac('0x0'));var util=require(_0x66ac('0x1'));var path=require(_0x66ac('0x2'));var timeout=require(_0x66ac('0x3'));var express=require('express');var router=express[_0x66ac('0x4')]();var fs_extra=require(_0x66ac('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x66ac('0x6'));var config=require(_0x66ac('0x7'));var controller=require(_0x66ac('0x8'));router[_0x66ac('0x9')]('/',auth['isAuthenticated'](),controller[_0x66ac('0xa')]);router[_0x66ac('0x9')](_0x66ac('0xb'),auth[_0x66ac('0xc')](),controller[_0x66ac('0xd')]);router[_0x66ac('0x9')](_0x66ac('0xe'),auth[_0x66ac('0xc')](),controller[_0x66ac('0xf')]);router[_0x66ac('0x9')](_0x66ac('0x10'),auth[_0x66ac('0xc')](),controller[_0x66ac('0x11')]);router[_0x66ac('0x12')]('/',auth[_0x66ac('0xc')](),controller[_0x66ac('0x13')]);router[_0x66ac('0x12')](_0x66ac('0xe'),auth['isAuthenticated'](),controller[_0x66ac('0x14')]);router[_0x66ac('0x15')]('/:id',auth[_0x66ac('0xc')](),controller[_0x66ac('0x16')]);router[_0x66ac('0x17')]('/:id',auth[_0x66ac('0xc')](),controller[_0x66ac('0x18')]);module[_0x66ac('0x19')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index dee0346..ed714c6 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 _0x7880=['exports','STRING','username','remoteUri'];(function(_0x3d529d,_0xa2e33c){var _0x334f87=function(_0x30bb12){while(--_0x30bb12){_0x3d529d['push'](_0x3d529d['shift']());}};_0x334f87(++_0xa2e33c);}(_0x7880,0x1f4));var _0x0788=function(_0x4f4f59,_0x4215c1){_0x4f4f59=_0x4f4f59-0x0;var _0x322725=_0x7880[_0x4f4f59];return _0x322725;};'use strict';var Sequelize=require('sequelize');module[_0x0788('0x0')]={'name':{'type':Sequelize[_0x0788('0x1')]},'description':{'type':Sequelize[_0x0788('0x1')]},'username':{'type':Sequelize[_0x0788('0x1')],'unique':_0x0788('0x2')},'apiKey':{'type':Sequelize[_0x0788('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x0788('0x3')},'serverUrl':{'type':Sequelize[_0x0788('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x958a=['sequelize','exports','STRING','username'];(function(_0x17406a,_0x1e2320){var _0x1501ff=function(_0x4b075a){while(--_0x4b075a){_0x17406a['push'](_0x17406a['shift']());}};_0x1501ff(++_0x1e2320);}(_0x958a,0x128));var _0xa958=function(_0x309dc4,_0x5ba667){_0x309dc4=_0x309dc4-0x0;var _0x44e28c=_0x958a[_0x309dc4];return _0x44e28c;};'use strict';var Sequelize=require(_0xa958('0x0'));module[_0xa958('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xa958('0x2')]},'username':{'type':Sequelize[_0xa958('0x2')],'unique':_0xa958('0x3')},'apiKey':{'type':Sequelize[_0xa958('0x2')]},'remoteUri':{'type':Sequelize[_0xa958('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0xa958('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index 1d61b31..15ba70a 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 _0x0884=['attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','show','params','intersection','length','include','find','create','body','getConfigurations','findOne','FreshdeskConfiguration','rawAttributes','map','addConfiguration','AccountId','channel','Descriptions','getDescriptions','FreshdeskField','Subjects','getFields','remoteUri','apiKey','slice','substring','GET','format','%s/%s','api/v2/ticket_fields','%s:X','base64','subject','agent','priority','group','source','ticket_type','company','remove','includes','default','custom_text','choices','capitalize','test','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','error','stack','name','index','FreshdeskAccount','fieldName','type','model','query','keys','filters'];(function(_0x9c2d5a,_0x73267c){var _0x553d95=function(_0x5cff26){while(--_0x5cff26){_0x9c2d5a['push'](_0x9c2d5a['shift']());}};_0x553d95(++_0x73267c);}(_0x0884,0xb3));var _0x4088=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0884[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x4088('0x0'));var rimraf=require(_0x4088('0x1'));var zipdir=require(_0x4088('0x2'));var jsonpatch=require(_0x4088('0x3'));var rp=require(_0x4088('0x4'));var moment=require(_0x4088('0x5'));var BPromise=require(_0x4088('0x6'));var Mustache=require('mustache');var util=require(_0x4088('0x7'));var path=require(_0x4088('0x8'));var sox=require(_0x4088('0x9'));var csv=require(_0x4088('0xa'));var ejs=require(_0x4088('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x4088('0xc'));var crypto=require('crypto');var jsforce=require(_0x4088('0xd'));var deskjs=require(_0x4088('0xe'));var toCsv=require(_0x4088('0xa'));var querystring=require(_0x4088('0xf'));var Papa=require(_0x4088('0x10'));var Redis=require(_0x4088('0x11'));var authService=require(_0x4088('0x12'));var qs=require(_0x4088('0x13'));var as=require(_0x4088('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4088('0x15'))(_0x4088('0x16'));var utils=require(_0x4088('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x4088('0x18'));var db=require(_0x4088('0x19'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x1c0e0e,_0x3ad4d4){_0x3ad4d4=_0x3ad4d4||0xcc;return function(_0x347fce){if(_0x347fce){return _0x1c0e0e[_0x4088('0x1a')](_0x3ad4d4);}return _0x1c0e0e[_0x4088('0x1b')](_0x3ad4d4)[_0x4088('0x1c')]();};}function respondWithResult(_0x10fde4,_0x30c843){_0x30c843=_0x30c843||0xc8;return function(_0x8505b5){if(_0x8505b5){return _0x10fde4[_0x4088('0x1b')](_0x30c843)[_0x4088('0x1d')](_0x8505b5);}};}function respondWithFilteredResult(_0x1c05ca,_0x2d6aca){return function(_0x51ff21){if(_0x51ff21){var _0x1f62b5=typeof _0x2d6aca[_0x4088('0x1e')]===_0x4088('0x1f')&&typeof _0x2d6aca[_0x4088('0x20')]==='undefined';var _0x155d65=_0x51ff21[_0x4088('0x21')];var _0xc7fc8e=_0x1f62b5?0x0:_0x2d6aca[_0x4088('0x1e')];var _0x40bea5=_0x1f62b5?_0x51ff21[_0x4088('0x21')]:_0x2d6aca[_0x4088('0x1e')]+_0x2d6aca[_0x4088('0x20')];var _0x38a626;if(_0x40bea5>=_0x155d65){_0x40bea5=_0x155d65;_0x38a626=0xc8;}else{_0x38a626=0xce;}_0x1c05ca[_0x4088('0x1b')](_0x38a626);return _0x1c05ca['set'](_0x4088('0x22'),_0xc7fc8e+'-'+_0x40bea5+'/'+_0x155d65)['json'](_0x51ff21);}return null;};}function patchUpdates(_0x5248ca){return function(_0x48c263){try{jsonpatch['apply'](_0x48c263,_0x5248ca,!![]);}catch(_0x12b4f3){return BPromise[_0x4088('0x23')](_0x12b4f3);}return _0x48c263[_0x4088('0x24')]();};}function saveUpdates(_0x31f333,_0x5e8031){return function(_0x706539){if(_0x706539){return _0x706539[_0x4088('0x25')](_0x31f333)[_0x4088('0x26')](function(_0x556e80){return _0x556e80;});}return null;};}function removeEntity(_0x4c98ef,_0x27ee8e){return function(_0xdca2c0){if(_0xdca2c0){return _0xdca2c0[_0x4088('0x27')]()[_0x4088('0x26')](function(){_0x4c98ef[_0x4088('0x1b')](0xcc)[_0x4088('0x1c')]();});}};}function handleEntityNotFound(_0x5933cf,_0x482758){return function(_0x2e6f91){if(!_0x2e6f91){_0x5933cf[_0x4088('0x1a')](0x194);}return _0x2e6f91;};}function handleError(_0x109d24,_0x3f49f6){_0x3f49f6=_0x3f49f6||0x1f4;return function(_0xbde1e6){logger[_0x4088('0x28')](_0xbde1e6[_0x4088('0x29')]);if(_0xbde1e6['name']){delete _0xbde1e6[_0x4088('0x2a')];}_0x109d24['status'](_0x3f49f6)['send'](_0xbde1e6);};}exports[_0x4088('0x2b')]=function(_0x5b8137,_0x40b8a5){var _0x5b2b91={},_0x2b0a9a={},_0x478376={'count':0x0,'rows':[]};var _0x2bc7dd=_['map'](db[_0x4088('0x2c')]['rawAttributes'],function(_0x539e30){return{'name':_0x539e30[_0x4088('0x2d')],'type':_0x539e30[_0x4088('0x2e')]['key']};});_0x2b0a9a[_0x4088('0x2f')]=_['map'](_0x2bc7dd,_0x4088('0x2a'));_0x2b0a9a[_0x4088('0x30')]=_[_0x4088('0x31')](_0x5b8137[_0x4088('0x30')]);_0x2b0a9a[_0x4088('0x32')]=_['intersection'](_0x2b0a9a[_0x4088('0x2f')],_0x2b0a9a[_0x4088('0x30')]);_0x5b2b91[_0x4088('0x33')]=_['intersection'](_0x2b0a9a[_0x4088('0x2f')],qs['fields'](_0x5b8137[_0x4088('0x30')][_0x4088('0x34')]));_0x5b2b91['attributes']=_0x5b2b91[_0x4088('0x33')]['length']?_0x5b2b91[_0x4088('0x33')]:_0x2b0a9a[_0x4088('0x2f')];if(!_0x5b8137[_0x4088('0x30')][_0x4088('0x35')](_0x4088('0x36'))){_0x5b2b91[_0x4088('0x20')]=qs['limit'](_0x5b8137[_0x4088('0x30')][_0x4088('0x20')]);_0x5b2b91['offset']=qs[_0x4088('0x1e')](_0x5b8137[_0x4088('0x30')]['offset']);}_0x5b2b91['order']=qs[_0x4088('0x37')](_0x5b8137[_0x4088('0x30')][_0x4088('0x37')]);_0x5b2b91[_0x4088('0x38')]=qs[_0x4088('0x32')](_[_0x4088('0x39')](_0x5b8137['query'],_0x2b0a9a[_0x4088('0x32')]),_0x2bc7dd);if(_0x5b8137[_0x4088('0x30')][_0x4088('0x3a')]){_0x5b2b91['where']=_[_0x4088('0x3b')](_0x5b2b91[_0x4088('0x38')],{'$or':_['map'](_0x2bc7dd,function(_0x10942b){if(_0x10942b[_0x4088('0x2e')]!==_0x4088('0x3c')){var _0x46bd4f={};_0x46bd4f[_0x10942b[_0x4088('0x2a')]]={'$like':'%'+_0x5b8137[_0x4088('0x30')][_0x4088('0x3a')]+'%'};return _0x46bd4f;}})});}_0x5b2b91=_[_0x4088('0x3b')]({},_0x5b2b91,_0x5b8137[_0x4088('0x3d')]);var _0x3ed07f={'where':_0x5b2b91[_0x4088('0x38')]};return db['FreshdeskAccount'][_0x4088('0x21')](_0x3ed07f)[_0x4088('0x26')](function(_0x564dfd){_0x478376['count']=_0x564dfd;if(_0x5b8137[_0x4088('0x30')]['includeAll']){_0x5b2b91['include']=[{'all':!![]}];}return db['FreshdeskAccount'][_0x4088('0x3e')](_0x5b2b91);})['then'](function(_0x2f2ca2){_0x478376[_0x4088('0x3f')]=_0x2f2ca2;return _0x478376;})[_0x4088('0x26')](respondWithFilteredResult(_0x40b8a5,_0x5b2b91))[_0x4088('0x40')](handleError(_0x40b8a5,null));};exports[_0x4088('0x41')]=function(_0x5a8303,_0x5b8db2){var _0xcb50d6={'raw':![],'where':{'id':_0x5a8303[_0x4088('0x42')]['id']}},_0x3795f4={};_0x3795f4['model']=_[_0x4088('0x31')](db[_0x4088('0x2c')]['rawAttributes']);_0x3795f4[_0x4088('0x30')]=_[_0x4088('0x31')](_0x5a8303[_0x4088('0x30')]);_0x3795f4[_0x4088('0x32')]=_[_0x4088('0x43')](_0x3795f4[_0x4088('0x2f')],_0x3795f4[_0x4088('0x30')]);_0xcb50d6[_0x4088('0x33')]=_[_0x4088('0x43')](_0x3795f4[_0x4088('0x2f')],qs[_0x4088('0x34')](_0x5a8303[_0x4088('0x30')][_0x4088('0x34')]));_0xcb50d6[_0x4088('0x33')]=_0xcb50d6[_0x4088('0x33')][_0x4088('0x44')]?_0xcb50d6[_0x4088('0x33')]:_0x3795f4[_0x4088('0x2f')];if(_0x5a8303[_0x4088('0x30')]['includeAll']){_0xcb50d6[_0x4088('0x45')]=[{'all':!![]}];}_0xcb50d6=_[_0x4088('0x3b')]({},_0xcb50d6,_0x5a8303[_0x4088('0x3d')]);return db[_0x4088('0x2c')][_0x4088('0x46')](_0xcb50d6)['then'](handleEntityNotFound(_0x5b8db2,null))['then'](respondWithResult(_0x5b8db2,null))[_0x4088('0x40')](handleError(_0x5b8db2,null));};exports[_0x4088('0x47')]=function(_0xbf9de6,_0x4ba670){return db[_0x4088('0x2c')]['create'](_0xbf9de6[_0x4088('0x48')],{})[_0x4088('0x26')](respondWithResult(_0x4ba670,0xc9))[_0x4088('0x40')](handleError(_0x4ba670,null));};exports['update']=function(_0x447f81,_0x3b4c75){if(_0x447f81[_0x4088('0x48')]['id']){delete _0x447f81[_0x4088('0x48')]['id'];}return db[_0x4088('0x2c')][_0x4088('0x46')]({'where':{'id':_0x447f81[_0x4088('0x42')]['id']}})[_0x4088('0x26')](handleEntityNotFound(_0x3b4c75,null))[_0x4088('0x26')](saveUpdates(_0x447f81[_0x4088('0x48')],null))[_0x4088('0x26')](respondWithResult(_0x3b4c75,null))[_0x4088('0x40')](handleError(_0x3b4c75,null));};exports[_0x4088('0x27')]=function(_0x2bea46,_0xdcb500){return db[_0x4088('0x2c')]['find']({'where':{'id':_0x2bea46['params']['id']}})[_0x4088('0x26')](handleEntityNotFound(_0xdcb500,null))[_0x4088('0x26')](removeEntity(_0xdcb500,null))[_0x4088('0x40')](handleError(_0xdcb500,null));};exports[_0x4088('0x49')]=function(_0x363087,_0x116175,_0x101dab){var _0x3c18b3={};var _0x10786f={};var _0x4d5d54;var _0x1bdbd6;return db['FreshdeskAccount'][_0x4088('0x4a')]({'where':{'id':_0x363087[_0x4088('0x42')]['id']}})['then'](handleEntityNotFound(_0x116175,null))[_0x4088('0x26')](function(_0x18c118){if(_0x18c118){_0x4d5d54=_0x18c118;_0x10786f[_0x4088('0x2f')]=_[_0x4088('0x31')](db[_0x4088('0x4b')][_0x4088('0x4c')]);_0x10786f[_0x4088('0x30')]=_[_0x4088('0x31')](_0x363087['query']);_0x10786f[_0x4088('0x32')]=_[_0x4088('0x43')](_0x10786f[_0x4088('0x2f')],_0x10786f[_0x4088('0x30')]);_0x3c18b3[_0x4088('0x33')]=_['intersection'](_0x10786f[_0x4088('0x2f')],qs[_0x4088('0x34')](_0x363087['query'][_0x4088('0x34')]));_0x3c18b3[_0x4088('0x33')]=_0x3c18b3[_0x4088('0x33')][_0x4088('0x44')]?_0x3c18b3['attributes']:_0x10786f['model'];_0x3c18b3['order']=qs['sort'](_0x363087['query'][_0x4088('0x37')]);_0x3c18b3[_0x4088('0x38')]=qs[_0x4088('0x32')](_[_0x4088('0x39')](_0x363087[_0x4088('0x30')],_0x10786f[_0x4088('0x32')]));if(_0x363087['query']['filter']){_0x3c18b3[_0x4088('0x38')]=_[_0x4088('0x3b')](_0x3c18b3[_0x4088('0x38')],{'$or':_[_0x4088('0x4d')](_0x3c18b3[_0x4088('0x33')],function(_0x34f577){var _0x3c1efc={};_0x3c1efc[_0x34f577]={'$like':'%'+_0x363087[_0x4088('0x30')][_0x4088('0x3a')]+'%'};return _0x3c1efc;})});}_0x3c18b3=_[_0x4088('0x3b')]({},_0x3c18b3,_0x363087[_0x4088('0x3d')]);return _0x4d5d54[_0x4088('0x49')](_0x3c18b3);}})['then'](function(_0x1e95d5){if(_0x1e95d5){_0x1bdbd6=_0x1e95d5[_0x4088('0x44')];if(!_0x363087[_0x4088('0x30')][_0x4088('0x35')](_0x4088('0x36'))){_0x3c18b3[_0x4088('0x20')]=qs[_0x4088('0x20')](_0x363087[_0x4088('0x30')][_0x4088('0x20')]);_0x3c18b3[_0x4088('0x1e')]=qs['offset'](_0x363087[_0x4088('0x30')][_0x4088('0x1e')]);}return _0x4d5d54[_0x4088('0x49')](_0x3c18b3);}})[_0x4088('0x26')](function(_0x57a1c0){if(_0x57a1c0){return _0x57a1c0?{'count':_0x1bdbd6,'rows':_0x57a1c0}:null;}})[_0x4088('0x26')](respondWithResult(_0x116175,null))['catch'](handleError(_0x116175,null));};exports[_0x4088('0x4e')]=function(_0x548a35,_0x1dda47,_0x555f51){if(_0x548a35[_0x4088('0x48')]['id']){delete _0x548a35[_0x4088('0x48')]['id'];}return db[_0x4088('0x2c')][_0x4088('0x4a')]({'where':{'id':_0x548a35['params']['id']}})['then'](handleEntityNotFound(_0x1dda47,null))[_0x4088('0x26')](function(_0x5eb03e){if(_0x5eb03e){_0x548a35[_0x4088('0x48')][_0x4088('0x4f')]=_0x5eb03e['id'];_0x548a35[_0x4088('0x48')]['Subjects']=integrations['getSubjects'](_0x548a35['body'][_0x4088('0x50')],_0x548a35[_0x4088('0x48')]['type']);_0x548a35[_0x4088('0x48')][_0x4088('0x51')]=integrations[_0x4088('0x52')](_0x548a35[_0x4088('0x48')][_0x4088('0x50')],_0x548a35[_0x4088('0x48')][_0x4088('0x2e')]);return db[_0x4088('0x4b')][_0x4088('0x47')](_0x548a35[_0x4088('0x48')],{'include':[{'model':db[_0x4088('0x53')],'as':_0x4088('0x54')},{'model':db[_0x4088('0x53')],'as':_0x4088('0x51')}]});}return null;})[_0x4088('0x26')](respondWithResult(_0x1dda47,null))[_0x4088('0x40')](handleError(_0x1dda47,null));};exports[_0x4088('0x55')]=function(_0x1310c9,_0x2f0e47,_0x1217d4){var _0x165fbe='';return db[_0x4088('0x2c')]['findOne']({'where':{'id':_0x1310c9[_0x4088('0x42')]['id']},'attributes':['id',_0x4088('0x56'),_0x4088('0x57')]})[_0x4088('0x26')](handleEntityNotFound(_0x2f0e47,null))[_0x4088('0x26')](function(_0x4d2766){if(_0x4d2766){_0x165fbe=_0x4d2766['remoteUri'];var _0x48abea=_0x165fbe[_0x4088('0x58')](-0x1);if(_0x48abea==='/'){_0x165fbe=_0x165fbe[_0x4088('0x59')](0x0,_0x165fbe['lastIndexOf'](_0x48abea));}return rp({'method':_0x4088('0x5a'),'uri':util[_0x4088('0x5b')](_0x4088('0x5c'),_0x165fbe,_0x4088('0x5d')),'headers':{'Authorization':util[_0x4088('0x5b')]('Basic\x20%s',new Buffer(util['format'](_0x4088('0x5e'),_0x4d2766[_0x4088('0x57')]))['toString'](_0x4088('0x5f')))},'json':!![]});}})[_0x4088('0x26')](function(_0xa38b1b){if(_0xa38b1b){var _0x19d34f=['requester',_0x4088('0x60'),_0x4088('0x61'),'description',_0x4088('0x1b'),_0x4088('0x62'),_0x4088('0x63'),_0x4088('0x64'),_0x4088('0x65'),_0x4088('0x63'),_0x4088('0x66')];_[_0x4088('0x67')](_0xa38b1b,function(_0x2d702b){return _0x19d34f[_0x4088('0x68')](_0x2d702b[_0x4088('0x2a')])||!_0x2d702b[_0x4088('0x69')]&&_0x2d702b['type']!==_0x4088('0x6a')&&_0x2d702b['type']!=='custom_dropdown';});return{'count':_0xa38b1b['length'],'rows':_[_0x4088('0x4d')](_0xa38b1b,function(_0x55d8f4){return{'id':_0x55d8f4[_0x4088('0x2a')],'name':_0x55d8f4['label'],'custom':!_0x55d8f4['default'],'options':_0x55d8f4[_0x4088('0x6b')]?_[_0x4088('0x4d')](_0x55d8f4[_0x4088('0x6b')],function(_0x17a0e0){return{'name':_[_0x4088('0x6c')](_0x17a0e0),'value':_0x17a0e0};}):[]};})};}})[_0x4088('0x26')](respondWithResult(_0x2f0e47,null))[_0x4088('0x40')](function(_0x236d01){var _0x295acd=_0x1310c9[_0x4088('0x30')][_0x4088('0x6d')]?0x1f4:_0x236d01['statusCode']||0x1f4;logger[_0x4088('0x28')](_0x4088('0x6e'),'getFields',_0x295acd,JSON[_0x4088('0x6f')](_0x236d01));delete _0x236d01[_0x4088('0x2a')];if(_0x295acd===0x191){_0x295acd=0x190;}_0x2f0e47[_0x4088('0x1b')](_0x295acd)[_0x4088('0x70')](_0x1310c9[_0x4088('0x30')][_0x4088('0x6d')]?{'message':_0x4088('0x71'),'statusCode':_0x236d01[_0x4088('0x72')]}:_0x236d01);});}; \ No newline at end of file +var _0xf53d=['keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','merge','VIRTUAL','filter','options','includeAll','include','rows','show','params','catch','create','body','find','findOne','FreshdeskConfiguration','order','pick','getConfigurations','nolimit','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshdeskField','getFields','remoteUri','apiKey','slice','substring','lastIndexOf','format','Basic\x20%s','toString','base64','requester','subject','agent','description','group','source','ticket_type','company','default','custom_text','custom_dropdown','label','choices','capitalize','test','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','statusCode','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','end','status','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','FreshdeskAccount','rawAttributes','fieldName','type','model','query'];(function(_0x8fbdd8,_0x4bb2cf){var _0x2c5199=function(_0x5a0a58){while(--_0x5a0a58){_0x8fbdd8['push'](_0x8fbdd8['shift']());}};_0x2c5199(++_0x4bb2cf);}(_0xf53d,0x199));var _0xdf53=function(_0x369314,_0x2def82){_0x369314=_0x369314-0x0;var _0x8c75c3=_0xf53d[_0x369314];return _0x8c75c3;};'use strict';var emlformat=require(_0xdf53('0x0'));var rimraf=require(_0xdf53('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdf53('0x2'));var rp=require(_0xdf53('0x3'));var moment=require(_0xdf53('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xdf53('0x5'));var util=require('util');var path=require(_0xdf53('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xdf53('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdf53('0x8'));var squel=require(_0xdf53('0x9'));var crypto=require(_0xdf53('0xa'));var jsforce=require(_0xdf53('0xb'));var deskjs=require(_0xdf53('0xc'));var toCsv=require(_0xdf53('0xd'));var querystring=require(_0xdf53('0xe'));var Papa=require(_0xdf53('0xf'));var Redis=require('ioredis');var authService=require(_0xdf53('0x10'));var qs=require(_0xdf53('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdf53('0x12'));var logger=require('../../config/logger')(_0xdf53('0x13'));var utils=require(_0xdf53('0x14'));var config=require(_0xdf53('0x15'));var licenseUtil=require(_0xdf53('0x16'));var db=require(_0xdf53('0x17'))['db'];var integrations=require(_0xdf53('0x18'));function respondWithStatusCode(_0x4c1eee,_0x4082e3){_0x4082e3=_0x4082e3||0xcc;return function(_0x5d5447){if(_0x5d5447){return _0x4c1eee['sendStatus'](_0x4082e3);}return _0x4c1eee['status'](_0x4082e3)[_0xdf53('0x19')]();};}function respondWithResult(_0x25f7c3,_0x1cca6c){_0x1cca6c=_0x1cca6c||0xc8;return function(_0x5a5b4b){if(_0x5a5b4b){return _0x25f7c3[_0xdf53('0x1a')](_0x1cca6c)[_0xdf53('0x1b')](_0x5a5b4b);}};}function respondWithFilteredResult(_0x2476ee,_0x174b19){return function(_0x22deb2){if(_0x22deb2){var _0x413151=typeof _0x174b19[_0xdf53('0x1c')]===_0xdf53('0x1d')&&typeof _0x174b19[_0xdf53('0x1e')]===_0xdf53('0x1d');var _0x24f9b2=_0x22deb2[_0xdf53('0x1f')];var _0x47b4b3=_0x413151?0x0:_0x174b19[_0xdf53('0x1c')];var _0x577cfb=_0x413151?_0x22deb2[_0xdf53('0x1f')]:_0x174b19[_0xdf53('0x1c')]+_0x174b19[_0xdf53('0x1e')];var _0x49f568;if(_0x577cfb>=_0x24f9b2){_0x577cfb=_0x24f9b2;_0x49f568=0xc8;}else{_0x49f568=0xce;}_0x2476ee[_0xdf53('0x1a')](_0x49f568);return _0x2476ee[_0xdf53('0x20')](_0xdf53('0x21'),_0x47b4b3+'-'+_0x577cfb+'/'+_0x24f9b2)['json'](_0x22deb2);}return null;};}function patchUpdates(_0x4a381b){return function(_0x54ccca){try{jsonpatch['apply'](_0x54ccca,_0x4a381b,!![]);}catch(_0x311155){return BPromise['reject'](_0x311155);}return _0x54ccca[_0xdf53('0x22')]();};}function saveUpdates(_0x21cc09,_0x213703){return function(_0x193b74){if(_0x193b74){return _0x193b74[_0xdf53('0x23')](_0x21cc09)[_0xdf53('0x24')](function(_0x433622){return _0x433622;});}return null;};}function removeEntity(_0x5b0303,_0x3fa668){return function(_0x344936){if(_0x344936){return _0x344936[_0xdf53('0x25')]()[_0xdf53('0x24')](function(){_0x5b0303['status'](0xcc)[_0xdf53('0x19')]();});}};}function handleEntityNotFound(_0x311792,_0x4127c5){return function(_0x42a64e){if(!_0x42a64e){_0x311792[_0xdf53('0x26')](0x194);}return _0x42a64e;};}function handleError(_0x116136,_0x305de7){_0x305de7=_0x305de7||0x1f4;return function(_0x1d94dc){logger[_0xdf53('0x27')](_0x1d94dc[_0xdf53('0x28')]);if(_0x1d94dc[_0xdf53('0x29')]){delete _0x1d94dc[_0xdf53('0x29')];}_0x116136[_0xdf53('0x1a')](_0x305de7)[_0xdf53('0x2a')](_0x1d94dc);};}exports[_0xdf53('0x2b')]=function(_0x5abbc2,_0x1687d1){var _0x5b2877={},_0x4e9056={},_0x210e3f={'count':0x0,'rows':[]};var _0x2526fa=_[_0xdf53('0x2c')](db[_0xdf53('0x2d')][_0xdf53('0x2e')],function(_0x3e8363){return{'name':_0x3e8363[_0xdf53('0x2f')],'type':_0x3e8363[_0xdf53('0x30')]['key']};});_0x4e9056[_0xdf53('0x31')]=_[_0xdf53('0x2c')](_0x2526fa,_0xdf53('0x29'));_0x4e9056[_0xdf53('0x32')]=_[_0xdf53('0x33')](_0x5abbc2[_0xdf53('0x32')]);_0x4e9056[_0xdf53('0x34')]=_[_0xdf53('0x35')](_0x4e9056[_0xdf53('0x31')],_0x4e9056[_0xdf53('0x32')]);_0x5b2877[_0xdf53('0x36')]=_[_0xdf53('0x35')](_0x4e9056[_0xdf53('0x31')],qs[_0xdf53('0x37')](_0x5abbc2['query'][_0xdf53('0x37')]));_0x5b2877['attributes']=_0x5b2877[_0xdf53('0x36')][_0xdf53('0x38')]?_0x5b2877['attributes']:_0x4e9056[_0xdf53('0x31')];if(!_0x5abbc2['query'][_0xdf53('0x39')]('nolimit')){_0x5b2877[_0xdf53('0x1e')]=qs[_0xdf53('0x1e')](_0x5abbc2[_0xdf53('0x32')]['limit']);_0x5b2877[_0xdf53('0x1c')]=qs['offset'](_0x5abbc2['query'][_0xdf53('0x1c')]);}_0x5b2877['order']=qs['sort'](_0x5abbc2[_0xdf53('0x32')][_0xdf53('0x3a')]);_0x5b2877[_0xdf53('0x3b')]=qs[_0xdf53('0x34')](_['pick'](_0x5abbc2[_0xdf53('0x32')],_0x4e9056['filters']),_0x2526fa);if(_0x5abbc2[_0xdf53('0x32')]['filter']){_0x5b2877[_0xdf53('0x3b')]=_[_0xdf53('0x3c')](_0x5b2877['where'],{'$or':_[_0xdf53('0x2c')](_0x2526fa,function(_0x34d786){if(_0x34d786[_0xdf53('0x30')]!==_0xdf53('0x3d')){var _0x925287={};_0x925287[_0x34d786[_0xdf53('0x29')]]={'$like':'%'+_0x5abbc2[_0xdf53('0x32')][_0xdf53('0x3e')]+'%'};return _0x925287;}})});}_0x5b2877=_[_0xdf53('0x3c')]({},_0x5b2877,_0x5abbc2[_0xdf53('0x3f')]);var _0x26d446={'where':_0x5b2877[_0xdf53('0x3b')]};return db['FreshdeskAccount'][_0xdf53('0x1f')](_0x26d446)[_0xdf53('0x24')](function(_0xbb1a54){_0x210e3f[_0xdf53('0x1f')]=_0xbb1a54;if(_0x5abbc2[_0xdf53('0x32')][_0xdf53('0x40')]){_0x5b2877[_0xdf53('0x41')]=[{'all':!![]}];}return db[_0xdf53('0x2d')]['findAll'](_0x5b2877);})['then'](function(_0x3bdcf4){_0x210e3f[_0xdf53('0x42')]=_0x3bdcf4;return _0x210e3f;})['then'](respondWithFilteredResult(_0x1687d1,_0x5b2877))['catch'](handleError(_0x1687d1,null));};exports[_0xdf53('0x43')]=function(_0x2f4b27,_0x5a02f4){var _0x296362={'raw':![],'where':{'id':_0x2f4b27[_0xdf53('0x44')]['id']}},_0x3ce562={};_0x3ce562[_0xdf53('0x31')]=_['keys'](db[_0xdf53('0x2d')][_0xdf53('0x2e')]);_0x3ce562[_0xdf53('0x32')]=_[_0xdf53('0x33')](_0x2f4b27[_0xdf53('0x32')]);_0x3ce562[_0xdf53('0x34')]=_['intersection'](_0x3ce562['model'],_0x3ce562[_0xdf53('0x32')]);_0x296362['attributes']=_['intersection'](_0x3ce562[_0xdf53('0x31')],qs[_0xdf53('0x37')](_0x2f4b27['query'][_0xdf53('0x37')]));_0x296362[_0xdf53('0x36')]=_0x296362[_0xdf53('0x36')][_0xdf53('0x38')]?_0x296362['attributes']:_0x3ce562[_0xdf53('0x31')];if(_0x2f4b27[_0xdf53('0x32')][_0xdf53('0x40')]){_0x296362['include']=[{'all':!![]}];}_0x296362=_[_0xdf53('0x3c')]({},_0x296362,_0x2f4b27[_0xdf53('0x3f')]);return db['FreshdeskAccount']['find'](_0x296362)['then'](handleEntityNotFound(_0x5a02f4,null))[_0xdf53('0x24')](respondWithResult(_0x5a02f4,null))[_0xdf53('0x45')](handleError(_0x5a02f4,null));};exports[_0xdf53('0x46')]=function(_0x98fe02,_0x205d7d){return db[_0xdf53('0x2d')][_0xdf53('0x46')](_0x98fe02['body'],{})['then'](respondWithResult(_0x205d7d,0xc9))[_0xdf53('0x45')](handleError(_0x205d7d,null));};exports[_0xdf53('0x23')]=function(_0x11e94c,_0x2e5a8d){if(_0x11e94c[_0xdf53('0x47')]['id']){delete _0x11e94c[_0xdf53('0x47')]['id'];}return db[_0xdf53('0x2d')][_0xdf53('0x48')]({'where':{'id':_0x11e94c[_0xdf53('0x44')]['id']}})[_0xdf53('0x24')](handleEntityNotFound(_0x2e5a8d,null))[_0xdf53('0x24')](saveUpdates(_0x11e94c[_0xdf53('0x47')],null))[_0xdf53('0x24')](respondWithResult(_0x2e5a8d,null))[_0xdf53('0x45')](handleError(_0x2e5a8d,null));};exports[_0xdf53('0x25')]=function(_0x35805e,_0x3371b5){return db[_0xdf53('0x2d')][_0xdf53('0x48')]({'where':{'id':_0x35805e['params']['id']}})[_0xdf53('0x24')](handleEntityNotFound(_0x3371b5,null))[_0xdf53('0x24')](removeEntity(_0x3371b5,null))[_0xdf53('0x45')](handleError(_0x3371b5,null));};exports['getConfigurations']=function(_0x135a37,_0x21ddfc,_0x5981bb){var _0x2b12c5={};var _0x4ce1eb={};var _0x13dc35;var _0x33853b;return db['FreshdeskAccount'][_0xdf53('0x49')]({'where':{'id':_0x135a37[_0xdf53('0x44')]['id']}})[_0xdf53('0x24')](handleEntityNotFound(_0x21ddfc,null))[_0xdf53('0x24')](function(_0x1cbef5){if(_0x1cbef5){_0x13dc35=_0x1cbef5;_0x4ce1eb[_0xdf53('0x31')]=_[_0xdf53('0x33')](db[_0xdf53('0x4a')]['rawAttributes']);_0x4ce1eb['query']=_[_0xdf53('0x33')](_0x135a37[_0xdf53('0x32')]);_0x4ce1eb[_0xdf53('0x34')]=_[_0xdf53('0x35')](_0x4ce1eb[_0xdf53('0x31')],_0x4ce1eb['query']);_0x2b12c5['attributes']=_['intersection'](_0x4ce1eb[_0xdf53('0x31')],qs['fields'](_0x135a37[_0xdf53('0x32')][_0xdf53('0x37')]));_0x2b12c5[_0xdf53('0x36')]=_0x2b12c5[_0xdf53('0x36')][_0xdf53('0x38')]?_0x2b12c5[_0xdf53('0x36')]:_0x4ce1eb[_0xdf53('0x31')];_0x2b12c5[_0xdf53('0x4b')]=qs[_0xdf53('0x3a')](_0x135a37[_0xdf53('0x32')][_0xdf53('0x3a')]);_0x2b12c5[_0xdf53('0x3b')]=qs[_0xdf53('0x34')](_[_0xdf53('0x4c')](_0x135a37['query'],_0x4ce1eb[_0xdf53('0x34')]));if(_0x135a37[_0xdf53('0x32')]['filter']){_0x2b12c5[_0xdf53('0x3b')]=_[_0xdf53('0x3c')](_0x2b12c5[_0xdf53('0x3b')],{'$or':_['map'](_0x2b12c5[_0xdf53('0x36')],function(_0x3e7cc0){var _0x1bfaf5={};_0x1bfaf5[_0x3e7cc0]={'$like':'%'+_0x135a37[_0xdf53('0x32')][_0xdf53('0x3e')]+'%'};return _0x1bfaf5;})});}_0x2b12c5=_[_0xdf53('0x3c')]({},_0x2b12c5,_0x135a37[_0xdf53('0x3f')]);return _0x13dc35[_0xdf53('0x4d')](_0x2b12c5);}})['then'](function(_0x46e5ca){if(_0x46e5ca){_0x33853b=_0x46e5ca[_0xdf53('0x38')];if(!_0x135a37[_0xdf53('0x32')][_0xdf53('0x39')](_0xdf53('0x4e'))){_0x2b12c5[_0xdf53('0x1e')]=qs['limit'](_0x135a37['query'][_0xdf53('0x1e')]);_0x2b12c5[_0xdf53('0x1c')]=qs['offset'](_0x135a37[_0xdf53('0x32')][_0xdf53('0x1c')]);}return _0x13dc35[_0xdf53('0x4d')](_0x2b12c5);}})['then'](function(_0x4dc662){if(_0x4dc662){return _0x4dc662?{'count':_0x33853b,'rows':_0x4dc662}:null;}})[_0xdf53('0x24')](respondWithResult(_0x21ddfc,null))[_0xdf53('0x45')](handleError(_0x21ddfc,null));};exports[_0xdf53('0x4f')]=function(_0x5c078a,_0x1c4da3,_0x59bb8e){if(_0x5c078a[_0xdf53('0x47')]['id']){delete _0x5c078a[_0xdf53('0x47')]['id'];}return db[_0xdf53('0x2d')]['findOne']({'where':{'id':_0x5c078a['params']['id']}})[_0xdf53('0x24')](handleEntityNotFound(_0x1c4da3,null))['then'](function(_0x25ff8b){if(_0x25ff8b){_0x5c078a['body']['AccountId']=_0x25ff8b['id'];_0x5c078a['body'][_0xdf53('0x50')]=integrations[_0xdf53('0x51')](_0x5c078a[_0xdf53('0x47')][_0xdf53('0x52')],_0x5c078a['body'][_0xdf53('0x30')]);_0x5c078a[_0xdf53('0x47')][_0xdf53('0x53')]=integrations[_0xdf53('0x54')](_0x5c078a[_0xdf53('0x47')][_0xdf53('0x52')],_0x5c078a[_0xdf53('0x47')][_0xdf53('0x30')]);return db['FreshdeskConfiguration']['create'](_0x5c078a[_0xdf53('0x47')],{'include':[{'model':db['FreshdeskField'],'as':_0xdf53('0x50')},{'model':db[_0xdf53('0x55')],'as':_0xdf53('0x53')}]});}return null;})[_0xdf53('0x24')](respondWithResult(_0x1c4da3,null))[_0xdf53('0x45')](handleError(_0x1c4da3,null));};exports[_0xdf53('0x56')]=function(_0x1476cf,_0x20595c,_0x32cbd7){var _0x46ef2e='';return db[_0xdf53('0x2d')][_0xdf53('0x49')]({'where':{'id':_0x1476cf['params']['id']},'attributes':['id',_0xdf53('0x57'),_0xdf53('0x58')]})['then'](handleEntityNotFound(_0x20595c,null))[_0xdf53('0x24')](function(_0x20c7f0){if(_0x20c7f0){_0x46ef2e=_0x20c7f0[_0xdf53('0x57')];var _0x5f39f2=_0x46ef2e[_0xdf53('0x59')](-0x1);if(_0x5f39f2==='/'){_0x46ef2e=_0x46ef2e[_0xdf53('0x5a')](0x0,_0x46ef2e[_0xdf53('0x5b')](_0x5f39f2));}return rp({'method':'GET','uri':util[_0xdf53('0x5c')]('%s/%s',_0x46ef2e,'api/v2/ticket_fields'),'headers':{'Authorization':util[_0xdf53('0x5c')](_0xdf53('0x5d'),new Buffer(util['format']('%s:X',_0x20c7f0[_0xdf53('0x58')]))[_0xdf53('0x5e')](_0xdf53('0x5f')))},'json':!![]});}})[_0xdf53('0x24')](function(_0x235631){if(_0x235631){var _0x57cfa7=[_0xdf53('0x60'),_0xdf53('0x61'),_0xdf53('0x62'),_0xdf53('0x63'),_0xdf53('0x1a'),'priority',_0xdf53('0x64'),_0xdf53('0x65'),_0xdf53('0x66'),_0xdf53('0x64'),_0xdf53('0x67')];_['remove'](_0x235631,function(_0x58ee2c){return _0x57cfa7['includes'](_0x58ee2c[_0xdf53('0x29')])||!_0x58ee2c[_0xdf53('0x68')]&&_0x58ee2c[_0xdf53('0x30')]!==_0xdf53('0x69')&&_0x58ee2c['type']!==_0xdf53('0x6a');});return{'count':_0x235631[_0xdf53('0x38')],'rows':_[_0xdf53('0x2c')](_0x235631,function(_0x1092ce){return{'id':_0x1092ce[_0xdf53('0x29')],'name':_0x1092ce[_0xdf53('0x6b')],'custom':!_0x1092ce[_0xdf53('0x68')],'options':_0x1092ce[_0xdf53('0x6c')]?_['map'](_0x1092ce[_0xdf53('0x6c')],function(_0x57d973){return{'name':_[_0xdf53('0x6d')](_0x57d973),'value':_0x57d973};}):[]};})};}})[_0xdf53('0x24')](respondWithResult(_0x20595c,null))['catch'](function(_0x17be25){var _0x4187ec=_0x1476cf['query'][_0xdf53('0x6e')]?0x1f4:_0x17be25['statusCode']||0x1f4;logger[_0xdf53('0x27')](_0xdf53('0x6f'),_0xdf53('0x56'),_0x4187ec,JSON[_0xdf53('0x70')](_0x17be25));delete _0x17be25[_0xdf53('0x29')];if(_0x4187ec===0x191){_0x4187ec=0x190;}_0x20595c[_0xdf53('0x1a')](_0x4187ec)[_0xdf53('0x2a')](_0x1476cf['query'][_0xdf53('0x6e')]?{'message':_0xdf53('0x71'),'statusCode':_0x17be25[_0xdf53('0x72')]}:_0x17be25);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index f1a1fd3..16e673d 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 _0x12bb=['../../components/integrations/configuration','define','FreshdeskAccount','int_freshdesk_accounts','lodash','api','bluebird','request-promise','rimraf'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x12bb,0x9d));var _0xb12b=function(_0x5678c1,_0x41f998){_0x5678c1=_0x5678c1-0x0;var _0x5796b9=_0x12bb[_0x5678c1];return _0x5796b9;};'use strict';var _=require(_0xb12b('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xb12b('0x1'));var moment=require('moment');var BPromise=require(_0xb12b('0x2'));var rp=require(_0xb12b('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb12b('0x4'));var config=require('../../config/environment');var attributes=require('./intFreshdeskAccount.attributes');var integrations=require(_0xb12b('0x5'));module['exports']=function(_0x54cf76,_0x629b9e){return _0x54cf76[_0xb12b('0x6')](_0xb12b('0x7'),attributes,{'tableName':_0xb12b('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5a6f=['rimraf','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','lodash','../../config/logger','api','request-promise'];(function(_0x933b98,_0xa0fc6a){var _0x5cd1f9=function(_0x20e030){while(--_0x20e030){_0x933b98['push'](_0x933b98['shift']());}};_0x5cd1f9(++_0xa0fc6a);}(_0x5a6f,0x94));var _0xf5a6=function(_0x10b4d3,_0x12e69b){_0x10b4d3=_0x10b4d3-0x0;var _0x12615b=_0x5a6f[_0x10b4d3];return _0x12615b;};'use strict';var _=require(_0xf5a6('0x0'));var util=require('util');var logger=require(_0xf5a6('0x1'))(_0xf5a6('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf5a6('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf5a6('0x4'));var config=require('../../config/environment');var attributes=require(_0xf5a6('0x5'));var integrations=require(_0xf5a6('0x6'));module[_0xf5a6('0x7')]=function(_0x22ec0a,_0x466848){return _0x22ec0a['define']('FreshdeskAccount',attributes,{'tableName':'int_freshdesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js index 6ced78d..144f5c1 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 _0x31a3=['options','raw','where','attributes','limit','include','model','map','then','catch','ShowFreshdeskAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetFreshdeskAccount','FreshdeskAccount','findAll'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x31a3,0x174));var _0x331a=function(_0x466f2e,_0x5e2a7f){_0x466f2e=_0x466f2e-0x0;var _0x22dfbb=_0x31a3[_0x466f2e];return _0x22dfbb;};'use strict';var _=require(_0x331a('0x0'));var util=require(_0x331a('0x1'));var moment=require(_0x331a('0x2'));var BPromise=require(_0x331a('0x3'));var rs=require(_0x331a('0x4'));var fs=require('fs');var Redis=require(_0x331a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x331a('0x6'));var config=require(_0x331a('0x7'));var jayson=require(_0x331a('0x8'));var client=jayson[_0x331a('0x9')][_0x331a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x45aeb4,_0x478dd6,_0x521b04){return new BPromise(function(_0x31c14a,_0x32925a){return client[_0x331a('0xb')](_0x45aeb4,_0x521b04)['then'](function(_0x3ecb6c){logger[_0x331a('0xc')](_0x331a('0xd'),_0x478dd6,_0x331a('0xe'));logger[_0x331a('0xf')](_0x331a('0x10'),_0x478dd6,_0x331a('0xe'),JSON[_0x331a('0x11')](_0x3ecb6c));if(_0x3ecb6c[_0x331a('0x12')]){if(_0x3ecb6c['error']['code']===0x1f4){logger['error'](_0x331a('0xd'),_0x478dd6,_0x3ecb6c['error']['message']);return _0x32925a(_0x3ecb6c[_0x331a('0x12')][_0x331a('0x13')]);}logger[_0x331a('0x12')](_0x331a('0xd'),_0x478dd6,_0x3ecb6c['error'][_0x331a('0x13')]);return _0x31c14a(_0x3ecb6c[_0x331a('0x12')][_0x331a('0x13')]);}else{logger[_0x331a('0xc')](_0x331a('0xd'),_0x478dd6,_0x331a('0xe'));_0x31c14a(_0x3ecb6c[_0x331a('0x14')]['message']);}})['catch'](function(_0x5c189d){logger[_0x331a('0x12')](_0x331a('0xd'),_0x478dd6,_0x5c189d);_0x32925a(_0x5c189d);});});}exports[_0x331a('0x15')]=function(_0x585a8d){var _0x51e53b=this;return new Promise(function(_0x3bb4d3,_0x163ba1){return db[_0x331a('0x16')][_0x331a('0x17')]({'raw':_0x585a8d[_0x331a('0x18')]?_0x585a8d['options'][_0x331a('0x19')]===undefined?!![]:![]:!![],'where':_0x585a8d[_0x331a('0x18')]?_0x585a8d['options'][_0x331a('0x1a')]||null:null,'attributes':_0x585a8d[_0x331a('0x18')]?_0x585a8d[_0x331a('0x18')][_0x331a('0x1b')]||null:null,'limit':_0x585a8d[_0x331a('0x18')]?_0x585a8d[_0x331a('0x18')][_0x331a('0x1c')]||null:null,'include':_0x585a8d[_0x331a('0x18')]?_0x585a8d[_0x331a('0x18')][_0x331a('0x1d')]?_['map'](_0x585a8d[_0x331a('0x18')]['include'],function(_0x42bba5){return{'model':db[_0x42bba5[_0x331a('0x1e')]],'as':_0x42bba5['as'],'attributes':_0x42bba5[_0x331a('0x1b')],'include':_0x42bba5['include']?_[_0x331a('0x1f')](_0x42bba5[_0x331a('0x1d')],function(_0x24271a){return{'model':db[_0x24271a[_0x331a('0x1e')]],'as':_0x24271a['as'],'attributes':_0x24271a[_0x331a('0x1b')],'include':_0x24271a[_0x331a('0x1d')]?_['map'](_0x24271a['include'],function(_0x37cbba){return{'model':db[_0x37cbba[_0x331a('0x1e')]],'as':_0x37cbba['as'],'attributes':_0x37cbba[_0x331a('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x331a('0x20')](function(_0x4c2db7){logger[_0x331a('0xc')](_0x331a('0x15'),_0x585a8d);logger['debug'](_0x331a('0x15'),_0x585a8d,JSON[_0x331a('0x11')](_0x4c2db7));_0x3bb4d3(_0x4c2db7);})[_0x331a('0x21')](function(_0x159ad6){logger['error'](_0x331a('0x15'),_0x159ad6['message'],_0x585a8d);_0x163ba1(_0x51e53b['error'](0x1f4,_0x159ad6[_0x331a('0x13')]));});});};exports[_0x331a('0x22')]=function(_0x17e273){var _0x45dcb2=this;return new Promise(function(_0x26ee18,_0x5aa52f){return db[_0x331a('0x16')][_0x331a('0x23')]({'raw':_0x17e273[_0x331a('0x18')]?_0x17e273[_0x331a('0x18')][_0x331a('0x19')]===undefined?!![]:![]:!![],'where':_0x17e273[_0x331a('0x18')]?_0x17e273[_0x331a('0x18')][_0x331a('0x1a')]||null:null,'attributes':_0x17e273['options']?_0x17e273[_0x331a('0x18')][_0x331a('0x1b')]||null:null,'include':_0x17e273[_0x331a('0x18')]?_0x17e273[_0x331a('0x18')][_0x331a('0x1d')]?_[_0x331a('0x1f')](_0x17e273[_0x331a('0x18')][_0x331a('0x1d')],function(_0x3c2aca){return{'model':db[_0x3c2aca[_0x331a('0x1e')]],'as':_0x3c2aca['as'],'attributes':_0x3c2aca['attributes'],'include':_0x3c2aca[_0x331a('0x1d')]?_['map'](_0x3c2aca[_0x331a('0x1d')],function(_0x16ec0e){return{'model':db[_0x16ec0e[_0x331a('0x1e')]],'as':_0x16ec0e['as'],'attributes':_0x16ec0e[_0x331a('0x1b')],'include':_0x16ec0e[_0x331a('0x1d')]?_[_0x331a('0x1f')](_0x16ec0e[_0x331a('0x1d')],function(_0x38fbc0){return{'model':db[_0x38fbc0['model']],'as':_0x38fbc0['as'],'attributes':_0x38fbc0[_0x331a('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x331a('0x20')](function(_0x327389){logger[_0x331a('0xc')](_0x331a('0x22'),_0x17e273);logger[_0x331a('0xf')]('ShowFreshdeskAccount',_0x17e273,JSON[_0x331a('0x11')](_0x327389));_0x26ee18(_0x327389);})[_0x331a('0x21')](function(_0x50ecd9){logger['error'](_0x331a('0x22'),_0x50ecd9[_0x331a('0x13')],_0x17e273);_0x5aa52f(_0x45dcb2[_0x331a('0x12')](0x1f4,_0x50ecd9[_0x331a('0x13')]));});});}; \ No newline at end of file +var _0x4a2e=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','client','http','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetFreshdeskAccount','FreshdeskAccount','options','raw','where','attributes','limit','include','map','model','debug','ShowFreshdeskAccount','find','lodash'];(function(_0x2dd390,_0x1bc894){var _0x3afe47=function(_0x42d8d3){while(--_0x42d8d3){_0x2dd390['push'](_0x2dd390['shift']());}};_0x3afe47(++_0x1bc894);}(_0x4a2e,0x87));var _0xe4a2=function(_0x20ba6d,_0x256177){_0x20ba6d=_0x20ba6d-0x0;var _0x338188=_0x4a2e[_0x20ba6d];return _0x338188;};'use strict';var _=require(_0xe4a2('0x0'));var util=require(_0xe4a2('0x1'));var moment=require(_0xe4a2('0x2'));var BPromise=require(_0xe4a2('0x3'));var rs=require(_0xe4a2('0x4'));var fs=require('fs');var Redis=require(_0xe4a2('0x5'));var db=require(_0xe4a2('0x6'))['db'];var utils=require(_0xe4a2('0x7'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe4a2('0x8')][_0xe4a2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x59887b,_0x3e95a7,_0x19c5d9){return new BPromise(function(_0x48eca6,_0x2b6e83){return client[_0xe4a2('0xa')](_0x59887b,_0x19c5d9)[_0xe4a2('0xb')](function(_0x24d4fd){logger[_0xe4a2('0xc')](_0xe4a2('0xd'),_0x3e95a7,_0xe4a2('0xe'));logger['debug'](_0xe4a2('0xf'),_0x3e95a7,'request\x20sent',JSON[_0xe4a2('0x10')](_0x24d4fd));if(_0x24d4fd[_0xe4a2('0x11')]){if(_0x24d4fd['error']['code']===0x1f4){logger['error'](_0xe4a2('0xd'),_0x3e95a7,_0x24d4fd[_0xe4a2('0x11')]['message']);return _0x2b6e83(_0x24d4fd[_0xe4a2('0x11')][_0xe4a2('0x12')]);}logger[_0xe4a2('0x11')]('FreshdeskAccount,\x20%s,\x20%s',_0x3e95a7,_0x24d4fd[_0xe4a2('0x11')]['message']);return _0x48eca6(_0x24d4fd['error']['message']);}else{logger[_0xe4a2('0xc')]('FreshdeskAccount,\x20%s,\x20%s',_0x3e95a7,_0xe4a2('0xe'));_0x48eca6(_0x24d4fd[_0xe4a2('0x13')][_0xe4a2('0x12')]);}})[_0xe4a2('0x14')](function(_0x3e3601){logger[_0xe4a2('0x11')](_0xe4a2('0xd'),_0x3e95a7,_0x3e3601);_0x2b6e83(_0x3e3601);});});}exports[_0xe4a2('0x15')]=function(_0x47d8b0){var _0x40f6bb=this;return new Promise(function(_0x20ab53,_0x942195){return db[_0xe4a2('0x16')]['findAll']({'raw':_0x47d8b0[_0xe4a2('0x17')]?_0x47d8b0[_0xe4a2('0x17')][_0xe4a2('0x18')]===undefined?!![]:![]:!![],'where':_0x47d8b0[_0xe4a2('0x17')]?_0x47d8b0[_0xe4a2('0x17')][_0xe4a2('0x19')]||null:null,'attributes':_0x47d8b0['options']?_0x47d8b0['options'][_0xe4a2('0x1a')]||null:null,'limit':_0x47d8b0['options']?_0x47d8b0[_0xe4a2('0x17')][_0xe4a2('0x1b')]||null:null,'include':_0x47d8b0[_0xe4a2('0x17')]?_0x47d8b0['options'][_0xe4a2('0x1c')]?_[_0xe4a2('0x1d')](_0x47d8b0[_0xe4a2('0x17')][_0xe4a2('0x1c')],function(_0x4ed5c0){return{'model':db[_0x4ed5c0[_0xe4a2('0x1e')]],'as':_0x4ed5c0['as'],'attributes':_0x4ed5c0[_0xe4a2('0x1a')],'include':_0x4ed5c0[_0xe4a2('0x1c')]?_[_0xe4a2('0x1d')](_0x4ed5c0[_0xe4a2('0x1c')],function(_0x40635f){return{'model':db[_0x40635f[_0xe4a2('0x1e')]],'as':_0x40635f['as'],'attributes':_0x40635f[_0xe4a2('0x1a')],'include':_0x40635f['include']?_[_0xe4a2('0x1d')](_0x40635f[_0xe4a2('0x1c')],function(_0x23995d){return{'model':db[_0x23995d[_0xe4a2('0x1e')]],'as':_0x23995d['as'],'attributes':_0x23995d[_0xe4a2('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xe4a2('0xb')](function(_0x51bbf4){logger[_0xe4a2('0xc')](_0xe4a2('0x15'),_0x47d8b0);logger[_0xe4a2('0x1f')](_0xe4a2('0x15'),_0x47d8b0,JSON[_0xe4a2('0x10')](_0x51bbf4));_0x20ab53(_0x51bbf4);})['catch'](function(_0x4f2d1e){logger[_0xe4a2('0x11')]('GetFreshdeskAccount',_0x4f2d1e['message'],_0x47d8b0);_0x942195(_0x40f6bb['error'](0x1f4,_0x4f2d1e[_0xe4a2('0x12')]));});});};exports[_0xe4a2('0x20')]=function(_0x28b06c){var _0x4f22fe=this;return new Promise(function(_0x380772,_0x22d185){return db[_0xe4a2('0x16')][_0xe4a2('0x21')]({'raw':_0x28b06c['options']?_0x28b06c[_0xe4a2('0x17')][_0xe4a2('0x18')]===undefined?!![]:![]:!![],'where':_0x28b06c[_0xe4a2('0x17')]?_0x28b06c[_0xe4a2('0x17')][_0xe4a2('0x19')]||null:null,'attributes':_0x28b06c[_0xe4a2('0x17')]?_0x28b06c['options'][_0xe4a2('0x1a')]||null:null,'include':_0x28b06c[_0xe4a2('0x17')]?_0x28b06c[_0xe4a2('0x17')]['include']?_['map'](_0x28b06c[_0xe4a2('0x17')][_0xe4a2('0x1c')],function(_0x42c2e7){return{'model':db[_0x42c2e7['model']],'as':_0x42c2e7['as'],'attributes':_0x42c2e7[_0xe4a2('0x1a')],'include':_0x42c2e7[_0xe4a2('0x1c')]?_[_0xe4a2('0x1d')](_0x42c2e7[_0xe4a2('0x1c')],function(_0x3a8f99){return{'model':db[_0x3a8f99[_0xe4a2('0x1e')]],'as':_0x3a8f99['as'],'attributes':_0x3a8f99['attributes'],'include':_0x3a8f99[_0xe4a2('0x1c')]?_[_0xe4a2('0x1d')](_0x3a8f99[_0xe4a2('0x1c')],function(_0x11b893){return{'model':db[_0x11b893[_0xe4a2('0x1e')]],'as':_0x11b893['as'],'attributes':_0x11b893['attributes']};}):[]};}):[]};}):[]:[]})[_0xe4a2('0xb')](function(_0x37db6c){logger[_0xe4a2('0xc')](_0xe4a2('0x20'),_0x28b06c);logger['debug']('ShowFreshdeskAccount',_0x28b06c,JSON[_0xe4a2('0x10')](_0x37db6c));_0x380772(_0x37db6c);})[_0xe4a2('0x14')](function(_0x4b134c){logger[_0xe4a2('0x11')](_0xe4a2('0x20'),_0x4b134c[_0xe4a2('0x12')],_0x28b06c);_0x22d185(_0x4f22fe['error'](0x1f4,_0x4b134c[_0xe4a2('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 1f6c166..a6c892c 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 _0x5cdf=['getTags','post','create','setTags','/:id','update','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshdeskConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','/:id/tags'];(function(_0x530609,_0x2f3408){var _0x14615a=function(_0x32cd4f){while(--_0x32cd4f){_0x530609['push'](_0x530609['shift']());}};_0x14615a(++_0x2f3408);}(_0x5cdf,0x8a));var _0xf5cd=function(_0x1b18dc,_0x1e1b6b){_0x1b18dc=_0x1b18dc-0x0;var _0x5c9416=_0x5cdf[_0x1b18dc];return _0x5c9416;};'use strict';var multer=require(_0xf5cd('0x0'));var util=require('util');var path=require(_0xf5cd('0x1'));var timeout=require('connect-timeout');var express=require(_0xf5cd('0x2'));var router=express[_0xf5cd('0x3')]();var fs_extra=require(_0xf5cd('0x4'));var auth=require(_0xf5cd('0x5'));var interaction=require(_0xf5cd('0x6'));var config=require('../../config/environment');var controller=require(_0xf5cd('0x7'));router[_0xf5cd('0x8')]('/',auth[_0xf5cd('0x9')](),controller[_0xf5cd('0xa')]);router['get']('/:id',auth[_0xf5cd('0x9')](),controller[_0xf5cd('0xb')]);router[_0xf5cd('0x8')](_0xf5cd('0xc'),auth['isAuthenticated'](),controller[_0xf5cd('0xd')]);router[_0xf5cd('0x8')]('/:id/subjects',auth[_0xf5cd('0x9')](),controller[_0xf5cd('0xe')]);router['get'](_0xf5cd('0xf'),auth['isAuthenticated'](),controller[_0xf5cd('0x10')]);router[_0xf5cd('0x8')](_0xf5cd('0x11'),auth[_0xf5cd('0x9')](),controller[_0xf5cd('0x12')]);router[_0xf5cd('0x13')]('/',auth[_0xf5cd('0x9')](),controller[_0xf5cd('0x14')]);router['post'](_0xf5cd('0x11'),auth[_0xf5cd('0x9')](),controller[_0xf5cd('0x15')]);router['put'](_0xf5cd('0x16'),auth[_0xf5cd('0x9')](),controller[_0xf5cd('0x17')]);router[_0xf5cd('0x18')]('/:id',auth[_0xf5cd('0x9')](),controller[_0xf5cd('0x19')]);module['exports']=router; \ No newline at end of file +var _0x1c87=['index','/:id','isAuthenticated','show','/:id/fields','getFields','getSubjects','/:id/descriptions','getTags','post','create','/:id/tags','setTags','put','update','delete','destroy','exports','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','get'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x1c87,0x125));var _0x71c8=function(_0x1b662a,_0x52cbd7){_0x1b662a=_0x1b662a-0x0;var _0x1e5118=_0x1c87[_0x1b662a];return _0x1e5118;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x71c8('0x0'));var express=require(_0x71c8('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x71c8('0x2'));var interaction=require(_0x71c8('0x3'));var config=require(_0x71c8('0x4'));var controller=require(_0x71c8('0x5'));router[_0x71c8('0x6')]('/',auth['isAuthenticated'](),controller[_0x71c8('0x7')]);router[_0x71c8('0x6')](_0x71c8('0x8'),auth[_0x71c8('0x9')](),controller[_0x71c8('0xa')]);router[_0x71c8('0x6')](_0x71c8('0xb'),auth[_0x71c8('0x9')](),controller[_0x71c8('0xc')]);router['get']('/:id/subjects',auth[_0x71c8('0x9')](),controller[_0x71c8('0xd')]);router[_0x71c8('0x6')](_0x71c8('0xe'),auth['isAuthenticated'](),controller['getDescriptions']);router['get']('/:id/tags',auth[_0x71c8('0x9')](),controller[_0x71c8('0xf')]);router[_0x71c8('0x10')]('/',auth[_0x71c8('0x9')](),controller[_0x71c8('0x11')]);router['post'](_0x71c8('0x12'),auth[_0x71c8('0x9')](),controller[_0x71c8('0x13')]);router[_0x71c8('0x14')]('/:id',auth[_0x71c8('0x9')](),controller[_0x71c8('0x15')]);router[_0x71c8('0x16')](_0x71c8('0x8'),auth['isAuthenticated'](),controller[_0x71c8('0x17')]);module[_0x71c8('0x18')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 9f21f36..e74965d 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 _0x0f98=['sequelize','exports','STRING'];(function(_0x3d319a,_0x3b9f0c){var _0x291205=function(_0x28127e){while(--_0x28127e){_0x3d319a['push'](_0x3d319a['shift']());}};_0x291205(++_0x3b9f0c);}(_0x0f98,0x84));var _0x80f9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0f98[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x80f9('0x0'));module[_0x80f9('0x1')]={'name':{'type':Sequelize[_0x80f9('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x003a=['sequelize','exports'];(function(_0x4b4aa6,_0x22d61c){var _0x27dae1=function(_0x56b3ba){while(--_0x56b3ba){_0x4b4aa6['push'](_0x4b4aa6['shift']());}};_0x27dae1(++_0x22d61c);}(_0x003a,0x148));var _0xa003=function(_0x1f0067,_0x47dfbb){_0x1f0067=_0x1f0067-0x0;var _0x329ec3=_0x003a[_0x1f0067];return _0x329ec3;};'use strict';var Sequelize=require(_0xa003('0x0'));module[_0xa003('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index 65cf2df..9e7640d 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 _0x58a1=['sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','papaparse','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','error','stack','name','send','index','map','rawAttributes','key','model','query','keys','filters','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','FreshdeskConfiguration','include','findAll','catch','show','params','fields','options','find','create','body','findOne','FreshdeskField','filter','getFields','getSubjects','getDescriptions','Tag','getTags','setTags','ids','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path'];(function(_0x5ef55a,_0x2a03b1){var _0x20ae40=function(_0x46ce81){while(--_0x46ce81){_0x5ef55a['push'](_0x5ef55a['shift']());}};_0x20ae40(++_0x2a03b1);}(_0x58a1,0xeb));var _0x158a=function(_0x174af8,_0x4416b5){_0x174af8=_0x174af8-0x0;var _0x56b0a1=_0x58a1[_0x174af8];return _0x56b0a1;};'use strict';var emlformat=require(_0x158a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x158a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x158a('0x2'));var moment=require(_0x158a('0x3'));var BPromise=require(_0x158a('0x4'));var Mustache=require(_0x158a('0x5'));var util=require(_0x158a('0x6'));var path=require(_0x158a('0x7'));var sox=require(_0x158a('0x8'));var csv=require(_0x158a('0x9'));var ejs=require(_0x158a('0xa'));var fs=require('fs');var fs_extra=require(_0x158a('0xb'));var _=require('lodash');var squel=require(_0x158a('0xc'));var crypto=require('crypto');var jsforce=require(_0x158a('0xd'));var deskjs=require(_0x158a('0xe'));var toCsv=require(_0x158a('0x9'));var querystring=require('querystring');var Papa=require(_0x158a('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x158a('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x158a('0x11'))('api');var utils=require(_0x158a('0x12'));var config=require(_0x158a('0x13'));var licenseUtil=require(_0x158a('0x14'));var db=require(_0x158a('0x15'))['db'];function respondWithStatusCode(_0x1590ee,_0x1e43b2){_0x1e43b2=_0x1e43b2||0xcc;return function(_0x2b055d){if(_0x2b055d){return _0x1590ee[_0x158a('0x16')](_0x1e43b2);}return _0x1590ee[_0x158a('0x17')](_0x1e43b2)[_0x158a('0x18')]();};}function respondWithResult(_0x1fafd3,_0x5cf7af){_0x5cf7af=_0x5cf7af||0xc8;return function(_0x2bd9e8){if(_0x2bd9e8){return _0x1fafd3['status'](_0x5cf7af)[_0x158a('0x19')](_0x2bd9e8);}};}function respondWithFilteredResult(_0xe01f3e,_0x7fd052){return function(_0x1deccf){if(_0x1deccf){var _0x39a6e8=typeof _0x7fd052[_0x158a('0x1a')]===_0x158a('0x1b')&&typeof _0x7fd052[_0x158a('0x1c')]===_0x158a('0x1b');var _0x161a55=_0x1deccf[_0x158a('0x1d')];var _0x4be097=_0x39a6e8?0x0:_0x7fd052[_0x158a('0x1a')];var _0x5af0ac=_0x39a6e8?_0x1deccf[_0x158a('0x1d')]:_0x7fd052[_0x158a('0x1a')]+_0x7fd052[_0x158a('0x1c')];var _0x5839bb;if(_0x5af0ac>=_0x161a55){_0x5af0ac=_0x161a55;_0x5839bb=0xc8;}else{_0x5839bb=0xce;}_0xe01f3e[_0x158a('0x17')](_0x5839bb);return _0xe01f3e[_0x158a('0x1e')](_0x158a('0x1f'),_0x4be097+'-'+_0x5af0ac+'/'+_0x161a55)['json'](_0x1deccf);}return null;};}function patchUpdates(_0x453ed6){return function(_0x1a0c6a){try{jsonpatch[_0x158a('0x20')](_0x1a0c6a,_0x453ed6,!![]);}catch(_0x85071f){return BPromise['reject'](_0x85071f);}return _0x1a0c6a['save']();};}function saveUpdates(_0x7f627d,_0x754e54){return function(_0x45e8be){if(_0x45e8be){return _0x45e8be[_0x158a('0x21')](_0x7f627d)[_0x158a('0x22')](function(_0x5245bf){return _0x5245bf;});}return null;};}function removeEntity(_0x234189,_0x506061){return function(_0x4b06a7){if(_0x4b06a7){return _0x4b06a7[_0x158a('0x23')]()['then'](function(){_0x234189[_0x158a('0x17')](0xcc)[_0x158a('0x18')]();});}};}function handleEntityNotFound(_0x16a7b0,_0x2d8969){return function(_0x3c312b){if(!_0x3c312b){_0x16a7b0['sendStatus'](0x194);}return _0x3c312b;};}function handleError(_0x326cc0,_0x449bf3){_0x449bf3=_0x449bf3||0x1f4;return function(_0x59fd0d){logger[_0x158a('0x24')](_0x59fd0d[_0x158a('0x25')]);if(_0x59fd0d[_0x158a('0x26')]){delete _0x59fd0d[_0x158a('0x26')];}_0x326cc0['status'](_0x449bf3)[_0x158a('0x27')](_0x59fd0d);};}exports[_0x158a('0x28')]=function(_0x450043,_0x44e44a){var _0x4b9088={},_0x1abde5={},_0x143e68={'count':0x0,'rows':[]};var _0x1702e8=_[_0x158a('0x29')](db['FreshdeskConfiguration'][_0x158a('0x2a')],function(_0x593f11){return{'name':_0x593f11['fieldName'],'type':_0x593f11['type'][_0x158a('0x2b')]};});_0x1abde5[_0x158a('0x2c')]=_[_0x158a('0x29')](_0x1702e8,_0x158a('0x26'));_0x1abde5[_0x158a('0x2d')]=_[_0x158a('0x2e')](_0x450043[_0x158a('0x2d')]);_0x1abde5[_0x158a('0x2f')]=_['intersection'](_0x1abde5[_0x158a('0x2c')],_0x1abde5[_0x158a('0x2d')]);_0x4b9088[_0x158a('0x30')]=_[_0x158a('0x31')](_0x1abde5[_0x158a('0x2c')],qs['fields'](_0x450043[_0x158a('0x2d')]['fields']));_0x4b9088[_0x158a('0x30')]=_0x4b9088[_0x158a('0x30')][_0x158a('0x32')]?_0x4b9088[_0x158a('0x30')]:_0x1abde5[_0x158a('0x2c')];if(!_0x450043[_0x158a('0x2d')][_0x158a('0x33')](_0x158a('0x34'))){_0x4b9088[_0x158a('0x1c')]=qs[_0x158a('0x1c')](_0x450043[_0x158a('0x2d')]['limit']);_0x4b9088[_0x158a('0x1a')]=qs['offset'](_0x450043['query']['offset']);}_0x4b9088[_0x158a('0x35')]=qs[_0x158a('0x36')](_0x450043[_0x158a('0x2d')][_0x158a('0x36')]);_0x4b9088[_0x158a('0x37')]=qs[_0x158a('0x2f')](_[_0x158a('0x38')](_0x450043[_0x158a('0x2d')],_0x1abde5[_0x158a('0x2f')]),_0x1702e8);if(_0x450043['query']['filter']){_0x4b9088['where']=_[_0x158a('0x39')](_0x4b9088[_0x158a('0x37')],{'$or':_['map'](_0x1702e8,function(_0x3fbb9f){if(_0x3fbb9f[_0x158a('0x3a')]!==_0x158a('0x3b')){var _0x49d7dd={};_0x49d7dd[_0x3fbb9f[_0x158a('0x26')]]={'$like':'%'+_0x450043['query']['filter']+'%'};return _0x49d7dd;}})});}_0x4b9088=_[_0x158a('0x39')]({},_0x4b9088,_0x450043['options']);var _0x5667c1={'where':_0x4b9088[_0x158a('0x37')]};return db[_0x158a('0x3c')][_0x158a('0x1d')](_0x5667c1)['then'](function(_0x542a84){_0x143e68['count']=_0x542a84;if(_0x450043[_0x158a('0x2d')]['includeAll']){_0x4b9088[_0x158a('0x3d')]=[{'all':!![]}];}return db[_0x158a('0x3c')][_0x158a('0x3e')](_0x4b9088);})[_0x158a('0x22')](function(_0x3e5c9e){_0x143e68['rows']=_0x3e5c9e;return _0x143e68;})[_0x158a('0x22')](respondWithFilteredResult(_0x44e44a,_0x4b9088))[_0x158a('0x3f')](handleError(_0x44e44a,null));};exports[_0x158a('0x40')]=function(_0xcac3d6,_0xaf7a05){var _0x3f765d={'raw':![],'where':{'id':_0xcac3d6[_0x158a('0x41')]['id']}},_0x396b92={};_0x396b92[_0x158a('0x2c')]=_[_0x158a('0x2e')](db[_0x158a('0x3c')][_0x158a('0x2a')]);_0x396b92[_0x158a('0x2d')]=_['keys'](_0xcac3d6['query']);_0x396b92['filters']=_['intersection'](_0x396b92[_0x158a('0x2c')],_0x396b92[_0x158a('0x2d')]);_0x3f765d[_0x158a('0x30')]=_['intersection'](_0x396b92[_0x158a('0x2c')],qs[_0x158a('0x42')](_0xcac3d6['query'][_0x158a('0x42')]));_0x3f765d[_0x158a('0x30')]=_0x3f765d['attributes'][_0x158a('0x32')]?_0x3f765d[_0x158a('0x30')]:_0x396b92['model'];if(_0xcac3d6[_0x158a('0x2d')]['includeAll']){_0x3f765d[_0x158a('0x3d')]=[{'all':!![]}];}_0x3f765d=_[_0x158a('0x39')]({},_0x3f765d,_0xcac3d6[_0x158a('0x43')]);return db[_0x158a('0x3c')][_0x158a('0x44')](_0x3f765d)[_0x158a('0x22')](handleEntityNotFound(_0xaf7a05,null))[_0x158a('0x22')](respondWithResult(_0xaf7a05,null))[_0x158a('0x3f')](handleError(_0xaf7a05,null));};exports[_0x158a('0x45')]=function(_0x2e1ff8,_0x124b22){return db[_0x158a('0x3c')][_0x158a('0x45')](_0x2e1ff8[_0x158a('0x46')],{})['then'](respondWithResult(_0x124b22,0xc9))['catch'](handleError(_0x124b22,null));};exports[_0x158a('0x21')]=function(_0x21c8bc,_0x13b9e9){if(_0x21c8bc['body']['id']){delete _0x21c8bc[_0x158a('0x46')]['id'];}return db['FreshdeskConfiguration'][_0x158a('0x44')]({'where':{'id':_0x21c8bc[_0x158a('0x41')]['id']}})[_0x158a('0x22')](handleEntityNotFound(_0x13b9e9,null))[_0x158a('0x22')](saveUpdates(_0x21c8bc[_0x158a('0x46')],null))['then'](respondWithResult(_0x13b9e9,null))[_0x158a('0x3f')](handleError(_0x13b9e9,null));};exports[_0x158a('0x23')]=function(_0x1193e3,_0x536f34){return db[_0x158a('0x3c')][_0x158a('0x44')]({'where':{'id':_0x1193e3[_0x158a('0x41')]['id']}})[_0x158a('0x22')](handleEntityNotFound(_0x536f34,null))['then'](removeEntity(_0x536f34,null))['catch'](handleError(_0x536f34,null));};exports['getFields']=function(_0x5e08d8,_0x375152,_0x15c5e7){var _0x4988d5={};var _0x298bff={};var _0xc61444;var _0x5a3428;return db[_0x158a('0x3c')][_0x158a('0x47')]({'where':{'id':_0x5e08d8[_0x158a('0x41')]['id']}})[_0x158a('0x22')](handleEntityNotFound(_0x375152,null))[_0x158a('0x22')](function(_0x2dc57){if(_0x2dc57){_0xc61444=_0x2dc57;_0x298bff[_0x158a('0x2c')]=_[_0x158a('0x2e')](db[_0x158a('0x48')]['rawAttributes']);_0x298bff['query']=_[_0x158a('0x2e')](_0x5e08d8[_0x158a('0x2d')]);_0x298bff[_0x158a('0x2f')]=_[_0x158a('0x31')](_0x298bff[_0x158a('0x2c')],_0x298bff[_0x158a('0x2d')]);_0x4988d5[_0x158a('0x30')]=_[_0x158a('0x31')](_0x298bff['model'],qs[_0x158a('0x42')](_0x5e08d8[_0x158a('0x2d')]['fields']));_0x4988d5[_0x158a('0x30')]=_0x4988d5[_0x158a('0x30')][_0x158a('0x32')]?_0x4988d5[_0x158a('0x30')]:_0x298bff[_0x158a('0x2c')];_0x4988d5[_0x158a('0x35')]=qs[_0x158a('0x36')](_0x5e08d8[_0x158a('0x2d')]['sort']);_0x4988d5['where']=qs['filters'](_['pick'](_0x5e08d8[_0x158a('0x2d')],_0x298bff[_0x158a('0x2f')]));if(_0x5e08d8[_0x158a('0x2d')][_0x158a('0x49')]){_0x4988d5['where']=_['merge'](_0x4988d5[_0x158a('0x37')],{'$or':_[_0x158a('0x29')](_0x4988d5['attributes'],function(_0x7ea271){var _0xc36089={};_0xc36089[_0x7ea271]={'$like':'%'+_0x5e08d8[_0x158a('0x2d')][_0x158a('0x49')]+'%'};return _0xc36089;})});}_0x4988d5=_[_0x158a('0x39')]({},_0x4988d5,_0x5e08d8[_0x158a('0x43')]);return _0xc61444[_0x158a('0x4a')](_0x4988d5);}})[_0x158a('0x22')](function(_0x23f0f0){if(_0x23f0f0){_0x5a3428=_0x23f0f0[_0x158a('0x32')];if(!_0x5e08d8[_0x158a('0x2d')]['hasOwnProperty']('nolimit')){_0x4988d5['limit']=qs[_0x158a('0x1c')](_0x5e08d8[_0x158a('0x2d')]['limit']);_0x4988d5[_0x158a('0x1a')]=qs['offset'](_0x5e08d8[_0x158a('0x2d')][_0x158a('0x1a')]);}return _0xc61444['getFields'](_0x4988d5);}})[_0x158a('0x22')](function(_0xf41b45){if(_0xf41b45){return _0xf41b45?{'count':_0x5a3428,'rows':_0xf41b45}:null;}})[_0x158a('0x22')](respondWithResult(_0x375152,null))['catch'](handleError(_0x375152,null));};exports[_0x158a('0x4b')]=function(_0x45fb1b,_0x2d9054,_0x15573d){var _0x5ed9f6={};var _0x55012d={};var _0x1a1600;var _0x77e35d;return db[_0x158a('0x3c')][_0x158a('0x47')]({'where':{'id':_0x45fb1b['params']['id']}})[_0x158a('0x22')](handleEntityNotFound(_0x2d9054,null))['then'](function(_0x446d0e){if(_0x446d0e){_0x1a1600=_0x446d0e;_0x55012d[_0x158a('0x2c')]=_[_0x158a('0x2e')](db[_0x158a('0x48')]['rawAttributes']);_0x55012d[_0x158a('0x2d')]=_['keys'](_0x45fb1b['query']);_0x55012d['filters']=_['intersection'](_0x55012d[_0x158a('0x2c')],_0x55012d[_0x158a('0x2d')]);_0x5ed9f6[_0x158a('0x30')]=_[_0x158a('0x31')](_0x55012d[_0x158a('0x2c')],qs[_0x158a('0x42')](_0x45fb1b[_0x158a('0x2d')][_0x158a('0x42')]));_0x5ed9f6[_0x158a('0x30')]=_0x5ed9f6[_0x158a('0x30')][_0x158a('0x32')]?_0x5ed9f6[_0x158a('0x30')]:_0x55012d[_0x158a('0x2c')];_0x5ed9f6[_0x158a('0x35')]=qs[_0x158a('0x36')](_0x45fb1b[_0x158a('0x2d')][_0x158a('0x36')]);_0x5ed9f6[_0x158a('0x37')]=qs[_0x158a('0x2f')](_[_0x158a('0x38')](_0x45fb1b[_0x158a('0x2d')],_0x55012d[_0x158a('0x2f')]));if(_0x45fb1b[_0x158a('0x2d')]['filter']){_0x5ed9f6[_0x158a('0x37')]=_['merge'](_0x5ed9f6[_0x158a('0x37')],{'$or':_[_0x158a('0x29')](_0x5ed9f6[_0x158a('0x30')],function(_0x3ff539){var _0xe825bc={};_0xe825bc[_0x3ff539]={'$like':'%'+_0x45fb1b[_0x158a('0x2d')]['filter']+'%'};return _0xe825bc;})});}_0x5ed9f6=_[_0x158a('0x39')]({},_0x5ed9f6,_0x45fb1b[_0x158a('0x43')]);return _0x1a1600[_0x158a('0x4b')](_0x5ed9f6);}})[_0x158a('0x22')](function(_0x3ec5e7){if(_0x3ec5e7){_0x77e35d=_0x3ec5e7['length'];if(!_0x45fb1b['query'][_0x158a('0x33')](_0x158a('0x34'))){_0x5ed9f6[_0x158a('0x1c')]=qs['limit'](_0x45fb1b[_0x158a('0x2d')][_0x158a('0x1c')]);_0x5ed9f6['offset']=qs[_0x158a('0x1a')](_0x45fb1b[_0x158a('0x2d')]['offset']);}return _0x1a1600['getSubjects'](_0x5ed9f6);}})[_0x158a('0x22')](function(_0x22bff8){if(_0x22bff8){return _0x22bff8?{'count':_0x77e35d,'rows':_0x22bff8}:null;}})[_0x158a('0x22')](respondWithResult(_0x2d9054,null))[_0x158a('0x3f')](handleError(_0x2d9054,null));};exports[_0x158a('0x4c')]=function(_0x136731,_0x5f4e65,_0x191268){var _0x595f37={};var _0x1e5701={};var _0x345c9b;var _0x371751;return db[_0x158a('0x3c')][_0x158a('0x47')]({'where':{'id':_0x136731['params']['id']}})[_0x158a('0x22')](handleEntityNotFound(_0x5f4e65,null))[_0x158a('0x22')](function(_0x30d201){if(_0x30d201){_0x345c9b=_0x30d201;_0x1e5701['model']=_['keys'](db[_0x158a('0x48')]['rawAttributes']);_0x1e5701[_0x158a('0x2d')]=_['keys'](_0x136731[_0x158a('0x2d')]);_0x1e5701[_0x158a('0x2f')]=_[_0x158a('0x31')](_0x1e5701[_0x158a('0x2c')],_0x1e5701[_0x158a('0x2d')]);_0x595f37[_0x158a('0x30')]=_[_0x158a('0x31')](_0x1e5701[_0x158a('0x2c')],qs[_0x158a('0x42')](_0x136731[_0x158a('0x2d')]['fields']));_0x595f37[_0x158a('0x30')]=_0x595f37[_0x158a('0x30')][_0x158a('0x32')]?_0x595f37[_0x158a('0x30')]:_0x1e5701[_0x158a('0x2c')];_0x595f37[_0x158a('0x35')]=qs[_0x158a('0x36')](_0x136731[_0x158a('0x2d')][_0x158a('0x36')]);_0x595f37[_0x158a('0x37')]=qs['filters'](_[_0x158a('0x38')](_0x136731[_0x158a('0x2d')],_0x1e5701['filters']));if(_0x136731[_0x158a('0x2d')]['filter']){_0x595f37[_0x158a('0x37')]=_['merge'](_0x595f37[_0x158a('0x37')],{'$or':_[_0x158a('0x29')](_0x595f37['attributes'],function(_0x5c92d5){var _0x53c23a={};_0x53c23a[_0x5c92d5]={'$like':'%'+_0x136731[_0x158a('0x2d')]['filter']+'%'};return _0x53c23a;})});}_0x595f37=_['merge']({},_0x595f37,_0x136731['options']);return _0x345c9b[_0x158a('0x4c')](_0x595f37);}})[_0x158a('0x22')](function(_0x4c45bb){if(_0x4c45bb){_0x371751=_0x4c45bb[_0x158a('0x32')];if(!_0x136731[_0x158a('0x2d')][_0x158a('0x33')]('nolimit')){_0x595f37[_0x158a('0x1c')]=qs['limit'](_0x136731[_0x158a('0x2d')][_0x158a('0x1c')]);_0x595f37[_0x158a('0x1a')]=qs[_0x158a('0x1a')](_0x136731['query'][_0x158a('0x1a')]);}return _0x345c9b[_0x158a('0x4c')](_0x595f37);}})[_0x158a('0x22')](function(_0x41e3ff){if(_0x41e3ff){return _0x41e3ff?{'count':_0x371751,'rows':_0x41e3ff}:null;}})[_0x158a('0x22')](respondWithResult(_0x5f4e65,null))[_0x158a('0x3f')](handleError(_0x5f4e65,null));};exports['getTags']=function(_0x3915f3,_0x578764,_0x5b72bf){var _0x3a063a={};var _0x2f2cdb={};var _0x478cb7;var _0x55bd8d;return db[_0x158a('0x3c')]['findOne']({'where':{'id':_0x3915f3[_0x158a('0x41')]['id']}})[_0x158a('0x22')](handleEntityNotFound(_0x578764,null))[_0x158a('0x22')](function(_0x3259b6){if(_0x3259b6){_0x478cb7=_0x3259b6;_0x2f2cdb[_0x158a('0x2c')]=_[_0x158a('0x2e')](db[_0x158a('0x4d')][_0x158a('0x2a')]);_0x2f2cdb['query']=_[_0x158a('0x2e')](_0x3915f3[_0x158a('0x2d')]);_0x2f2cdb['filters']=_[_0x158a('0x31')](_0x2f2cdb[_0x158a('0x2c')],_0x2f2cdb[_0x158a('0x2d')]);_0x3a063a[_0x158a('0x30')]=_[_0x158a('0x31')](_0x2f2cdb[_0x158a('0x2c')],qs['fields'](_0x3915f3[_0x158a('0x2d')][_0x158a('0x42')]));_0x3a063a[_0x158a('0x30')]=_0x3a063a[_0x158a('0x30')][_0x158a('0x32')]?_0x3a063a[_0x158a('0x30')]:_0x2f2cdb[_0x158a('0x2c')];_0x3a063a[_0x158a('0x35')]=qs['sort'](_0x3915f3[_0x158a('0x2d')][_0x158a('0x36')]);_0x3a063a[_0x158a('0x37')]=qs['filters'](_[_0x158a('0x38')](_0x3915f3[_0x158a('0x2d')],_0x2f2cdb['filters']));if(_0x3915f3[_0x158a('0x2d')][_0x158a('0x49')]){_0x3a063a[_0x158a('0x37')]=_[_0x158a('0x39')](_0x3a063a[_0x158a('0x37')],{'$or':_[_0x158a('0x29')](_0x3a063a[_0x158a('0x30')],function(_0x59f705){var _0x3c27ab={};_0x3c27ab[_0x59f705]={'$like':'%'+_0x3915f3['query'][_0x158a('0x49')]+'%'};return _0x3c27ab;})});}_0x3a063a=_[_0x158a('0x39')]({},_0x3a063a,_0x3915f3['options']);return _0x478cb7[_0x158a('0x4e')](_0x3a063a);}})['then'](function(_0x5b2a3e){if(_0x5b2a3e){_0x55bd8d=_0x5b2a3e[_0x158a('0x32')];if(!_0x3915f3['query']['hasOwnProperty'](_0x158a('0x34'))){_0x3a063a[_0x158a('0x1c')]=qs['limit'](_0x3915f3['query'][_0x158a('0x1c')]);_0x3a063a[_0x158a('0x1a')]=qs[_0x158a('0x1a')](_0x3915f3[_0x158a('0x2d')][_0x158a('0x1a')]);}return _0x478cb7[_0x158a('0x4e')](_0x3a063a);}})[_0x158a('0x22')](function(_0x538ce3){if(_0x538ce3){return _0x538ce3?{'count':_0x55bd8d,'rows':_0x538ce3}:null;}})['then'](respondWithResult(_0x578764,null))[_0x158a('0x3f')](handleError(_0x578764,null));};exports[_0x158a('0x4f')]=function(_0x3c64d8,_0x27a8d5,_0x32da9b){if(_0x3c64d8['body']['id']){delete _0x3c64d8[_0x158a('0x46')]['id'];}return db['FreshdeskConfiguration'][_0x158a('0x47')]({'where':{'id':_0x3c64d8['params']['id']}})[_0x158a('0x22')](handleEntityNotFound(_0x27a8d5,null))[_0x158a('0x22')](function(_0x28c29e){if(_0x28c29e){return _0x28c29e[_0x158a('0x4f')](_0x3c64d8['body'][_0x158a('0x50')]||[]);}return null;})[_0x158a('0x22')](respondWithResult(_0x27a8d5,null))[_0x158a('0x3f')](handleError(_0x27a8d5,null));}; \ No newline at end of file +var _0x7ca7=['json','offset','undefined','limit','count','Content-Range','save','then','destroy','error','stack','name','index','FreshdeskConfiguration','rawAttributes','fieldName','type','map','keys','query','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','update','getFields','findOne','FreshdeskField','getSubjects','getDescriptions','getTags','order','setTags','ids','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end'];(function(_0x32bb6b,_0x1a5fbe){var _0x58dcb4=function(_0x402ee2){while(--_0x402ee2){_0x32bb6b['push'](_0x32bb6b['shift']());}};_0x58dcb4(++_0x1a5fbe);}(_0x7ca7,0x1e5));var _0x77ca=function(_0x17bb31,_0x2fc6f8){_0x17bb31=_0x17bb31-0x0;var _0x505c71=_0x7ca7[_0x17bb31];return _0x505c71;};'use strict';var emlformat=require(_0x77ca('0x0'));var rimraf=require(_0x77ca('0x1'));var zipdir=require(_0x77ca('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x77ca('0x3'));var moment=require(_0x77ca('0x4'));var BPromise=require(_0x77ca('0x5'));var Mustache=require(_0x77ca('0x6'));var util=require(_0x77ca('0x7'));var path=require(_0x77ca('0x8'));var sox=require(_0x77ca('0x9'));var csv=require(_0x77ca('0xa'));var ejs=require(_0x77ca('0xb'));var fs=require('fs');var fs_extra=require(_0x77ca('0xc'));var _=require(_0x77ca('0xd'));var squel=require(_0x77ca('0xe'));var crypto=require(_0x77ca('0xf'));var jsforce=require(_0x77ca('0x10'));var deskjs=require(_0x77ca('0x11'));var toCsv=require('to-csv');var querystring=require(_0x77ca('0x12'));var Papa=require(_0x77ca('0x13'));var Redis=require('ioredis');var authService=require(_0x77ca('0x14'));var qs=require(_0x77ca('0x15'));var as=require(_0x77ca('0x16'));var hardwareService=require(_0x77ca('0x17'));var logger=require(_0x77ca('0x18'))('api');var utils=require(_0x77ca('0x19'));var config=require(_0x77ca('0x1a'));var licenseUtil=require(_0x77ca('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5d9ff9,_0x410c22){_0x410c22=_0x410c22||0xcc;return function(_0x5b9a84){if(_0x5b9a84){return _0x5d9ff9[_0x77ca('0x1c')](_0x410c22);}return _0x5d9ff9[_0x77ca('0x1d')](_0x410c22)[_0x77ca('0x1e')]();};}function respondWithResult(_0x3c031b,_0x36e6e9){_0x36e6e9=_0x36e6e9||0xc8;return function(_0x196352){if(_0x196352){return _0x3c031b[_0x77ca('0x1d')](_0x36e6e9)[_0x77ca('0x1f')](_0x196352);}};}function respondWithFilteredResult(_0x42ec86,_0x19ffed){return function(_0x5205f4){if(_0x5205f4){var _0x55dfe7=typeof _0x19ffed[_0x77ca('0x20')]===_0x77ca('0x21')&&typeof _0x19ffed[_0x77ca('0x22')]==='undefined';var _0x246e75=_0x5205f4[_0x77ca('0x23')];var _0x50df96=_0x55dfe7?0x0:_0x19ffed['offset'];var _0x2366de=_0x55dfe7?_0x5205f4[_0x77ca('0x23')]:_0x19ffed[_0x77ca('0x20')]+_0x19ffed[_0x77ca('0x22')];var _0x12deaf;if(_0x2366de>=_0x246e75){_0x2366de=_0x246e75;_0x12deaf=0xc8;}else{_0x12deaf=0xce;}_0x42ec86[_0x77ca('0x1d')](_0x12deaf);return _0x42ec86['set'](_0x77ca('0x24'),_0x50df96+'-'+_0x2366de+'/'+_0x246e75)['json'](_0x5205f4);}return null;};}function patchUpdates(_0x278386){return function(_0x302e81){try{jsonpatch['apply'](_0x302e81,_0x278386,!![]);}catch(_0x3d29dd){return BPromise['reject'](_0x3d29dd);}return _0x302e81[_0x77ca('0x25')]();};}function saveUpdates(_0x29b634,_0xa72622){return function(_0x368746){if(_0x368746){return _0x368746['update'](_0x29b634)[_0x77ca('0x26')](function(_0x1a71af){return _0x1a71af;});}return null;};}function removeEntity(_0x3403fc,_0xe9c22e){return function(_0x6ebce1){if(_0x6ebce1){return _0x6ebce1[_0x77ca('0x27')]()['then'](function(){_0x3403fc[_0x77ca('0x1d')](0xcc)[_0x77ca('0x1e')]();});}};}function handleEntityNotFound(_0x32a4b8,_0x5eb459){return function(_0x39b564){if(!_0x39b564){_0x32a4b8[_0x77ca('0x1c')](0x194);}return _0x39b564;};}function handleError(_0x320a64,_0x7cc2d6){_0x7cc2d6=_0x7cc2d6||0x1f4;return function(_0x549182){logger[_0x77ca('0x28')](_0x549182[_0x77ca('0x29')]);if(_0x549182[_0x77ca('0x2a')]){delete _0x549182['name'];}_0x320a64[_0x77ca('0x1d')](_0x7cc2d6)['send'](_0x549182);};}exports[_0x77ca('0x2b')]=function(_0x50d198,_0x58e90c){var _0x1f0574={},_0x5ef00c={},_0x161274={'count':0x0,'rows':[]};var _0x2278c6=_['map'](db[_0x77ca('0x2c')][_0x77ca('0x2d')],function(_0x19aa65){return{'name':_0x19aa65[_0x77ca('0x2e')],'type':_0x19aa65[_0x77ca('0x2f')]['key']};});_0x5ef00c['model']=_[_0x77ca('0x30')](_0x2278c6,_0x77ca('0x2a'));_0x5ef00c['query']=_[_0x77ca('0x31')](_0x50d198[_0x77ca('0x32')]);_0x5ef00c[_0x77ca('0x33')]=_[_0x77ca('0x34')](_0x5ef00c[_0x77ca('0x35')],_0x5ef00c['query']);_0x1f0574['attributes']=_[_0x77ca('0x34')](_0x5ef00c[_0x77ca('0x35')],qs[_0x77ca('0x36')](_0x50d198[_0x77ca('0x32')][_0x77ca('0x36')]));_0x1f0574[_0x77ca('0x37')]=_0x1f0574[_0x77ca('0x37')]['length']?_0x1f0574['attributes']:_0x5ef00c['model'];if(!_0x50d198['query'][_0x77ca('0x38')](_0x77ca('0x39'))){_0x1f0574[_0x77ca('0x22')]=qs[_0x77ca('0x22')](_0x50d198['query'][_0x77ca('0x22')]);_0x1f0574['offset']=qs['offset'](_0x50d198[_0x77ca('0x32')]['offset']);}_0x1f0574['order']=qs[_0x77ca('0x3a')](_0x50d198[_0x77ca('0x32')]['sort']);_0x1f0574[_0x77ca('0x3b')]=qs[_0x77ca('0x33')](_[_0x77ca('0x3c')](_0x50d198[_0x77ca('0x32')],_0x5ef00c[_0x77ca('0x33')]),_0x2278c6);if(_0x50d198[_0x77ca('0x32')][_0x77ca('0x3d')]){_0x1f0574[_0x77ca('0x3b')]=_['merge'](_0x1f0574[_0x77ca('0x3b')],{'$or':_['map'](_0x2278c6,function(_0x3cd9df){if(_0x3cd9df[_0x77ca('0x2f')]!==_0x77ca('0x3e')){var _0x1b5462={};_0x1b5462[_0x3cd9df[_0x77ca('0x2a')]]={'$like':'%'+_0x50d198[_0x77ca('0x32')][_0x77ca('0x3d')]+'%'};return _0x1b5462;}})});}_0x1f0574=_[_0x77ca('0x3f')]({},_0x1f0574,_0x50d198[_0x77ca('0x40')]);var _0x5f2c8f={'where':_0x1f0574[_0x77ca('0x3b')]};return db[_0x77ca('0x2c')][_0x77ca('0x23')](_0x5f2c8f)['then'](function(_0x12b713){_0x161274['count']=_0x12b713;if(_0x50d198[_0x77ca('0x32')][_0x77ca('0x41')]){_0x1f0574[_0x77ca('0x42')]=[{'all':!![]}];}return db['FreshdeskConfiguration'][_0x77ca('0x43')](_0x1f0574);})[_0x77ca('0x26')](function(_0x16eb9d){_0x161274[_0x77ca('0x44')]=_0x16eb9d;return _0x161274;})['then'](respondWithFilteredResult(_0x58e90c,_0x1f0574))[_0x77ca('0x45')](handleError(_0x58e90c,null));};exports[_0x77ca('0x46')]=function(_0x5403b1,_0x2f7d72){var _0x6d80da={'raw':![],'where':{'id':_0x5403b1[_0x77ca('0x47')]['id']}},_0x317088={};_0x317088[_0x77ca('0x35')]=_[_0x77ca('0x31')](db['FreshdeskConfiguration'][_0x77ca('0x2d')]);_0x317088['query']=_[_0x77ca('0x31')](_0x5403b1['query']);_0x317088[_0x77ca('0x33')]=_[_0x77ca('0x34')](_0x317088['model'],_0x317088[_0x77ca('0x32')]);_0x6d80da[_0x77ca('0x37')]=_[_0x77ca('0x34')](_0x317088[_0x77ca('0x35')],qs[_0x77ca('0x36')](_0x5403b1['query'][_0x77ca('0x36')]));_0x6d80da[_0x77ca('0x37')]=_0x6d80da['attributes'][_0x77ca('0x48')]?_0x6d80da['attributes']:_0x317088[_0x77ca('0x35')];if(_0x5403b1[_0x77ca('0x32')][_0x77ca('0x41')]){_0x6d80da[_0x77ca('0x42')]=[{'all':!![]}];}_0x6d80da=_['merge']({},_0x6d80da,_0x5403b1[_0x77ca('0x40')]);return db['FreshdeskConfiguration'][_0x77ca('0x49')](_0x6d80da)['then'](handleEntityNotFound(_0x2f7d72,null))[_0x77ca('0x26')](respondWithResult(_0x2f7d72,null))[_0x77ca('0x45')](handleError(_0x2f7d72,null));};exports[_0x77ca('0x4a')]=function(_0x291ab9,_0x1b3bf7){return db[_0x77ca('0x2c')][_0x77ca('0x4a')](_0x291ab9[_0x77ca('0x4b')],{})[_0x77ca('0x26')](respondWithResult(_0x1b3bf7,0xc9))[_0x77ca('0x45')](handleError(_0x1b3bf7,null));};exports[_0x77ca('0x4c')]=function(_0x96503b,_0x9816d2){if(_0x96503b[_0x77ca('0x4b')]['id']){delete _0x96503b['body']['id'];}return db['FreshdeskConfiguration'][_0x77ca('0x49')]({'where':{'id':_0x96503b['params']['id']}})[_0x77ca('0x26')](handleEntityNotFound(_0x9816d2,null))[_0x77ca('0x26')](saveUpdates(_0x96503b[_0x77ca('0x4b')],null))[_0x77ca('0x26')](respondWithResult(_0x9816d2,null))['catch'](handleError(_0x9816d2,null));};exports['destroy']=function(_0x33570e,_0x182dbc){return db[_0x77ca('0x2c')][_0x77ca('0x49')]({'where':{'id':_0x33570e[_0x77ca('0x47')]['id']}})[_0x77ca('0x26')](handleEntityNotFound(_0x182dbc,null))[_0x77ca('0x26')](removeEntity(_0x182dbc,null))[_0x77ca('0x45')](handleError(_0x182dbc,null));};exports[_0x77ca('0x4d')]=function(_0x5dbe7b,_0x1222ee,_0x23bcd4){var _0x2a550a={};var _0x1de1d2={};var _0x5ed002;var _0x1135a9;return db[_0x77ca('0x2c')][_0x77ca('0x4e')]({'where':{'id':_0x5dbe7b[_0x77ca('0x47')]['id']}})[_0x77ca('0x26')](handleEntityNotFound(_0x1222ee,null))['then'](function(_0x4adc4e){if(_0x4adc4e){_0x5ed002=_0x4adc4e;_0x1de1d2[_0x77ca('0x35')]=_[_0x77ca('0x31')](db[_0x77ca('0x4f')][_0x77ca('0x2d')]);_0x1de1d2[_0x77ca('0x32')]=_[_0x77ca('0x31')](_0x5dbe7b[_0x77ca('0x32')]);_0x1de1d2['filters']=_['intersection'](_0x1de1d2['model'],_0x1de1d2['query']);_0x2a550a['attributes']=_[_0x77ca('0x34')](_0x1de1d2[_0x77ca('0x35')],qs[_0x77ca('0x36')](_0x5dbe7b[_0x77ca('0x32')][_0x77ca('0x36')]));_0x2a550a['attributes']=_0x2a550a['attributes'][_0x77ca('0x48')]?_0x2a550a[_0x77ca('0x37')]:_0x1de1d2[_0x77ca('0x35')];_0x2a550a['order']=qs[_0x77ca('0x3a')](_0x5dbe7b[_0x77ca('0x32')][_0x77ca('0x3a')]);_0x2a550a[_0x77ca('0x3b')]=qs[_0x77ca('0x33')](_[_0x77ca('0x3c')](_0x5dbe7b[_0x77ca('0x32')],_0x1de1d2[_0x77ca('0x33')]));if(_0x5dbe7b[_0x77ca('0x32')][_0x77ca('0x3d')]){_0x2a550a[_0x77ca('0x3b')]=_[_0x77ca('0x3f')](_0x2a550a['where'],{'$or':_[_0x77ca('0x30')](_0x2a550a['attributes'],function(_0x4b66e1){var _0xf4508f={};_0xf4508f[_0x4b66e1]={'$like':'%'+_0x5dbe7b['query'][_0x77ca('0x3d')]+'%'};return _0xf4508f;})});}_0x2a550a=_[_0x77ca('0x3f')]({},_0x2a550a,_0x5dbe7b[_0x77ca('0x40')]);return _0x5ed002[_0x77ca('0x4d')](_0x2a550a);}})[_0x77ca('0x26')](function(_0x71d3d7){if(_0x71d3d7){_0x1135a9=_0x71d3d7[_0x77ca('0x48')];if(!_0x5dbe7b['query'][_0x77ca('0x38')]('nolimit')){_0x2a550a[_0x77ca('0x22')]=qs[_0x77ca('0x22')](_0x5dbe7b[_0x77ca('0x32')][_0x77ca('0x22')]);_0x2a550a[_0x77ca('0x20')]=qs[_0x77ca('0x20')](_0x5dbe7b['query'][_0x77ca('0x20')]);}return _0x5ed002['getFields'](_0x2a550a);}})[_0x77ca('0x26')](function(_0x17e00b){if(_0x17e00b){return _0x17e00b?{'count':_0x1135a9,'rows':_0x17e00b}:null;}})[_0x77ca('0x26')](respondWithResult(_0x1222ee,null))[_0x77ca('0x45')](handleError(_0x1222ee,null));};exports[_0x77ca('0x50')]=function(_0x5d3e27,_0x37d65b,_0x195991){var _0x2fb516={};var _0x40fa24={};var _0x1cb9d9;var _0xc674f0;return db[_0x77ca('0x2c')][_0x77ca('0x4e')]({'where':{'id':_0x5d3e27[_0x77ca('0x47')]['id']}})['then'](handleEntityNotFound(_0x37d65b,null))[_0x77ca('0x26')](function(_0x12b7e8){if(_0x12b7e8){_0x1cb9d9=_0x12b7e8;_0x40fa24[_0x77ca('0x35')]=_[_0x77ca('0x31')](db['FreshdeskField'][_0x77ca('0x2d')]);_0x40fa24[_0x77ca('0x32')]=_[_0x77ca('0x31')](_0x5d3e27['query']);_0x40fa24[_0x77ca('0x33')]=_[_0x77ca('0x34')](_0x40fa24[_0x77ca('0x35')],_0x40fa24[_0x77ca('0x32')]);_0x2fb516[_0x77ca('0x37')]=_[_0x77ca('0x34')](_0x40fa24[_0x77ca('0x35')],qs[_0x77ca('0x36')](_0x5d3e27['query'][_0x77ca('0x36')]));_0x2fb516['attributes']=_0x2fb516[_0x77ca('0x37')][_0x77ca('0x48')]?_0x2fb516[_0x77ca('0x37')]:_0x40fa24[_0x77ca('0x35')];_0x2fb516['order']=qs[_0x77ca('0x3a')](_0x5d3e27[_0x77ca('0x32')][_0x77ca('0x3a')]);_0x2fb516['where']=qs[_0x77ca('0x33')](_[_0x77ca('0x3c')](_0x5d3e27[_0x77ca('0x32')],_0x40fa24['filters']));if(_0x5d3e27[_0x77ca('0x32')]['filter']){_0x2fb516[_0x77ca('0x3b')]=_[_0x77ca('0x3f')](_0x2fb516[_0x77ca('0x3b')],{'$or':_[_0x77ca('0x30')](_0x2fb516[_0x77ca('0x37')],function(_0x558ad7){var _0x171874={};_0x171874[_0x558ad7]={'$like':'%'+_0x5d3e27[_0x77ca('0x32')]['filter']+'%'};return _0x171874;})});}_0x2fb516=_['merge']({},_0x2fb516,_0x5d3e27[_0x77ca('0x40')]);return _0x1cb9d9['getSubjects'](_0x2fb516);}})[_0x77ca('0x26')](function(_0x5a577b){if(_0x5a577b){_0xc674f0=_0x5a577b[_0x77ca('0x48')];if(!_0x5d3e27[_0x77ca('0x32')][_0x77ca('0x38')](_0x77ca('0x39'))){_0x2fb516[_0x77ca('0x22')]=qs[_0x77ca('0x22')](_0x5d3e27[_0x77ca('0x32')]['limit']);_0x2fb516[_0x77ca('0x20')]=qs['offset'](_0x5d3e27[_0x77ca('0x32')][_0x77ca('0x20')]);}return _0x1cb9d9[_0x77ca('0x50')](_0x2fb516);}})[_0x77ca('0x26')](function(_0x324cc1){if(_0x324cc1){return _0x324cc1?{'count':_0xc674f0,'rows':_0x324cc1}:null;}})['then'](respondWithResult(_0x37d65b,null))['catch'](handleError(_0x37d65b,null));};exports[_0x77ca('0x51')]=function(_0x3ac8cb,_0x1070c9,_0xfbc3b2){var _0x2b11d5={};var _0x5738a0={};var _0x42f14a;var _0xc27240;return db[_0x77ca('0x2c')][_0x77ca('0x4e')]({'where':{'id':_0x3ac8cb[_0x77ca('0x47')]['id']}})[_0x77ca('0x26')](handleEntityNotFound(_0x1070c9,null))[_0x77ca('0x26')](function(_0x2300d2){if(_0x2300d2){_0x42f14a=_0x2300d2;_0x5738a0[_0x77ca('0x35')]=_[_0x77ca('0x31')](db[_0x77ca('0x4f')][_0x77ca('0x2d')]);_0x5738a0[_0x77ca('0x32')]=_[_0x77ca('0x31')](_0x3ac8cb[_0x77ca('0x32')]);_0x5738a0['filters']=_[_0x77ca('0x34')](_0x5738a0['model'],_0x5738a0[_0x77ca('0x32')]);_0x2b11d5['attributes']=_[_0x77ca('0x34')](_0x5738a0['model'],qs['fields'](_0x3ac8cb['query'][_0x77ca('0x36')]));_0x2b11d5[_0x77ca('0x37')]=_0x2b11d5[_0x77ca('0x37')]['length']?_0x2b11d5[_0x77ca('0x37')]:_0x5738a0[_0x77ca('0x35')];_0x2b11d5['order']=qs['sort'](_0x3ac8cb['query'][_0x77ca('0x3a')]);_0x2b11d5[_0x77ca('0x3b')]=qs['filters'](_[_0x77ca('0x3c')](_0x3ac8cb[_0x77ca('0x32')],_0x5738a0[_0x77ca('0x33')]));if(_0x3ac8cb[_0x77ca('0x32')][_0x77ca('0x3d')]){_0x2b11d5['where']=_[_0x77ca('0x3f')](_0x2b11d5['where'],{'$or':_['map'](_0x2b11d5[_0x77ca('0x37')],function(_0x55f0df){var _0xdcf06f={};_0xdcf06f[_0x55f0df]={'$like':'%'+_0x3ac8cb[_0x77ca('0x32')][_0x77ca('0x3d')]+'%'};return _0xdcf06f;})});}_0x2b11d5=_['merge']({},_0x2b11d5,_0x3ac8cb[_0x77ca('0x40')]);return _0x42f14a[_0x77ca('0x51')](_0x2b11d5);}})[_0x77ca('0x26')](function(_0x40a4de){if(_0x40a4de){_0xc27240=_0x40a4de['length'];if(!_0x3ac8cb['query'][_0x77ca('0x38')](_0x77ca('0x39'))){_0x2b11d5[_0x77ca('0x22')]=qs[_0x77ca('0x22')](_0x3ac8cb[_0x77ca('0x32')][_0x77ca('0x22')]);_0x2b11d5[_0x77ca('0x20')]=qs[_0x77ca('0x20')](_0x3ac8cb[_0x77ca('0x32')][_0x77ca('0x20')]);}return _0x42f14a[_0x77ca('0x51')](_0x2b11d5);}})['then'](function(_0x18f26c){if(_0x18f26c){return _0x18f26c?{'count':_0xc27240,'rows':_0x18f26c}:null;}})[_0x77ca('0x26')](respondWithResult(_0x1070c9,null))[_0x77ca('0x45')](handleError(_0x1070c9,null));};exports[_0x77ca('0x52')]=function(_0x5cb820,_0x3e53b8,_0x1c3a36){var _0x2f7988={};var _0x2f4059={};var _0x3b5e26;var _0x4255c1;return db['FreshdeskConfiguration'][_0x77ca('0x4e')]({'where':{'id':_0x5cb820[_0x77ca('0x47')]['id']}})[_0x77ca('0x26')](handleEntityNotFound(_0x3e53b8,null))['then'](function(_0x57d2ec){if(_0x57d2ec){_0x3b5e26=_0x57d2ec;_0x2f4059[_0x77ca('0x35')]=_[_0x77ca('0x31')](db['Tag']['rawAttributes']);_0x2f4059[_0x77ca('0x32')]=_[_0x77ca('0x31')](_0x5cb820[_0x77ca('0x32')]);_0x2f4059[_0x77ca('0x33')]=_[_0x77ca('0x34')](_0x2f4059[_0x77ca('0x35')],_0x2f4059[_0x77ca('0x32')]);_0x2f7988[_0x77ca('0x37')]=_['intersection'](_0x2f4059[_0x77ca('0x35')],qs[_0x77ca('0x36')](_0x5cb820[_0x77ca('0x32')][_0x77ca('0x36')]));_0x2f7988[_0x77ca('0x37')]=_0x2f7988[_0x77ca('0x37')]['length']?_0x2f7988[_0x77ca('0x37')]:_0x2f4059[_0x77ca('0x35')];_0x2f7988[_0x77ca('0x53')]=qs[_0x77ca('0x3a')](_0x5cb820[_0x77ca('0x32')]['sort']);_0x2f7988[_0x77ca('0x3b')]=qs[_0x77ca('0x33')](_[_0x77ca('0x3c')](_0x5cb820['query'],_0x2f4059[_0x77ca('0x33')]));if(_0x5cb820[_0x77ca('0x32')]['filter']){_0x2f7988[_0x77ca('0x3b')]=_['merge'](_0x2f7988[_0x77ca('0x3b')],{'$or':_[_0x77ca('0x30')](_0x2f7988['attributes'],function(_0x45e963){var _0x34ced8={};_0x34ced8[_0x45e963]={'$like':'%'+_0x5cb820[_0x77ca('0x32')][_0x77ca('0x3d')]+'%'};return _0x34ced8;})});}_0x2f7988=_[_0x77ca('0x3f')]({},_0x2f7988,_0x5cb820[_0x77ca('0x40')]);return _0x3b5e26['getTags'](_0x2f7988);}})[_0x77ca('0x26')](function(_0x1e8573){if(_0x1e8573){_0x4255c1=_0x1e8573[_0x77ca('0x48')];if(!_0x5cb820['query'][_0x77ca('0x38')](_0x77ca('0x39'))){_0x2f7988[_0x77ca('0x22')]=qs[_0x77ca('0x22')](_0x5cb820[_0x77ca('0x32')][_0x77ca('0x22')]);_0x2f7988[_0x77ca('0x20')]=qs['offset'](_0x5cb820[_0x77ca('0x32')][_0x77ca('0x20')]);}return _0x3b5e26['getTags'](_0x2f7988);}})[_0x77ca('0x26')](function(_0x5944d1){if(_0x5944d1){return _0x5944d1?{'count':_0x4255c1,'rows':_0x5944d1}:null;}})[_0x77ca('0x26')](respondWithResult(_0x3e53b8,null))[_0x77ca('0x45')](handleError(_0x3e53b8,null));};exports[_0x77ca('0x54')]=function(_0x12887c,_0x114bb5,_0x572ea9){if(_0x12887c['body']['id']){delete _0x12887c[_0x77ca('0x4b')]['id'];}return db[_0x77ca('0x2c')]['findOne']({'where':{'id':_0x12887c[_0x77ca('0x47')]['id']}})['then'](handleEntityNotFound(_0x114bb5,null))[_0x77ca('0x26')](function(_0x3f09f8){if(_0x3f09f8){return _0x3f09f8[_0x77ca('0x54')](_0x12887c['body'][_0x77ca('0x55')]||[]);}return null;})[_0x77ca('0x26')](respondWithResult(_0x114bb5,null))['catch'](handleError(_0x114bb5,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index b1fe3fd..f012732 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 _0xf775=['util','api','bluebird','request-promise','path','define','FreshdeskConfiguration','int_freshdesk_configurations','lodash'];(function(_0x1a3bd1,_0x4a4613){var _0x4cd225=function(_0x4a4ab8){while(--_0x4a4ab8){_0x1a3bd1['push'](_0x1a3bd1['shift']());}};_0x4cd225(++_0x4a4613);}(_0xf775,0xa1));var _0x5f77=function(_0x2c7fe1,_0x52ef9b){_0x2c7fe1=_0x2c7fe1-0x0;var _0x48cd21=_0xf775[_0x2c7fe1];return _0x48cd21;};'use strict';var _=require(_0x5f77('0x0'));var util=require(_0x5f77('0x1'));var logger=require('../../config/logger')(_0x5f77('0x2'));var moment=require('moment');var BPromise=require(_0x5f77('0x3'));var rp=require(_0x5f77('0x4'));var fs=require('fs');var path=require(_0x5f77('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intFreshdeskConfiguration.attributes');module['exports']=function(_0x148bcc,_0xdb29be){return _0x148bcc[_0x5f77('0x6')](_0x5f77('0x7'),attributes,{'tableName':_0x5f77('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x35f0=['rimraf','./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x3c03f1,_0x433551){var _0x257e41=function(_0xd63edf){while(--_0xd63edf){_0x3c03f1['push'](_0x3c03f1['shift']());}};_0x257e41(++_0x433551);}(_0x35f0,0x148));var _0x035f=function(_0x728f69,_0x4f899b){_0x728f69=_0x728f69-0x0;var _0x2e6e14=_0x35f0[_0x728f69];return _0x2e6e14;};'use strict';var _=require(_0x035f('0x0'));var util=require(_0x035f('0x1'));var logger=require(_0x035f('0x2'))(_0x035f('0x3'));var moment=require(_0x035f('0x4'));var BPromise=require(_0x035f('0x5'));var rp=require(_0x035f('0x6'));var fs=require('fs');var path=require(_0x035f('0x7'));var rimraf=require(_0x035f('0x8'));var config=require('../../config/environment');var attributes=require(_0x035f('0x9'));module[_0x035f('0xa')]=function(_0x35544e,_0x4138c3){return _0x35544e[_0x035f('0xb')](_0x035f('0xc'),attributes,{'tableName':_0x035f('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js index 220d051..52dea82 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 _0xa4c8=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','randomstring','../../mysqldb'];(function(_0x1bad15,_0x20b4a1){var _0x10c155=function(_0x2f4001){while(--_0x2f4001){_0x1bad15['push'](_0x1bad15['shift']());}};_0x10c155(++_0x20b4a1);}(_0xa4c8,0x14c));var _0x8a4c=function(_0x11d9f6,_0xedffe1){_0x11d9f6=_0x11d9f6-0x0;var _0x16b646=_0xa4c8[_0x11d9f6];return _0x16b646;};'use strict';var _=require('lodash');var util=require(_0x8a4c('0x0'));var moment=require(_0x8a4c('0x1'));var BPromise=require('bluebird');var rs=require(_0x8a4c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8a4c('0x3'))['db'];var utils=require(_0x8a4c('0x4'));var logger=require(_0x8a4c('0x5'))(_0x8a4c('0x6'));var config=require(_0x8a4c('0x7'));var jayson=require(_0x8a4c('0x8'));var client=jayson[_0x8a4c('0x9')][_0x8a4c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x42de64,_0x3fb02d,_0x45a75){return new BPromise(function(_0x5bb1a5,_0x5472ff){return client[_0x8a4c('0xb')](_0x42de64,_0x45a75)[_0x8a4c('0xc')](function(_0x5c0cd7){logger[_0x8a4c('0xd')](_0x8a4c('0xe'),_0x3fb02d,_0x8a4c('0xf'));logger[_0x8a4c('0x10')](_0x8a4c('0x11'),_0x3fb02d,'request\x20sent',JSON[_0x8a4c('0x12')](_0x5c0cd7));if(_0x5c0cd7['error']){if(_0x5c0cd7[_0x8a4c('0x13')][_0x8a4c('0x14')]===0x1f4){logger[_0x8a4c('0x13')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x3fb02d,_0x5c0cd7[_0x8a4c('0x13')]['message']);return _0x5472ff(_0x5c0cd7[_0x8a4c('0x13')][_0x8a4c('0x15')]);}logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x3fb02d,_0x5c0cd7[_0x8a4c('0x13')]['message']);return _0x5bb1a5(_0x5c0cd7['error'][_0x8a4c('0x15')]);}else{logger[_0x8a4c('0xd')](_0x8a4c('0xe'),_0x3fb02d,'request\x20sent');_0x5bb1a5(_0x5c0cd7[_0x8a4c('0x16')][_0x8a4c('0x15')]);}})[_0x8a4c('0x17')](function(_0x3942ea){logger['error'](_0x8a4c('0xe'),_0x3fb02d,_0x3942ea);_0x5472ff(_0x3942ea);});});} \ No newline at end of file +var _0x361d=['util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','client','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash'];(function(_0x19147d,_0x2d2c03){var _0x5c3b7d=function(_0x3516b5){while(--_0x3516b5){_0x19147d['push'](_0x19147d['shift']());}};_0x5c3b7d(++_0x2d2c03);}(_0x361d,0x1a1));var _0xd361=function(_0x5d45d9,_0x1b00bf){_0x5d45d9=_0x5d45d9-0x0;var _0x1615d3=_0x361d[_0x5d45d9];return _0x1615d3;};'use strict';var _=require(_0xd361('0x0'));var util=require(_0xd361('0x1'));var moment=require(_0xd361('0x2'));var BPromise=require(_0xd361('0x3'));var rs=require(_0xd361('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd361('0x5'))['db'];var utils=require(_0xd361('0x6'));var logger=require(_0xd361('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd361('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5a8986,_0x381461,_0x3fa0d4){return new BPromise(function(_0x20b9c1,_0x265177){return client[_0xd361('0x9')](_0x5a8986,_0x3fa0d4)[_0xd361('0xa')](function(_0x583a49){logger[_0xd361('0xb')](_0xd361('0xc'),_0x381461,_0xd361('0xd'));logger['debug'](_0xd361('0xe'),_0x381461,_0xd361('0xd'),JSON[_0xd361('0xf')](_0x583a49));if(_0x583a49[_0xd361('0x10')]){if(_0x583a49[_0xd361('0x10')]['code']===0x1f4){logger[_0xd361('0x10')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x381461,_0x583a49[_0xd361('0x10')][_0xd361('0x11')]);return _0x265177(_0x583a49[_0xd361('0x10')]['message']);}logger[_0xd361('0x10')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x381461,_0x583a49['error'][_0xd361('0x11')]);return _0x20b9c1(_0x583a49['error']['message']);}else{logger[_0xd361('0xb')](_0xd361('0xc'),_0x381461,_0xd361('0xd'));_0x20b9c1(_0x583a49['result'][_0xd361('0x11')]);}})[_0xd361('0x12')](function(_0xc5859b){logger['error'](_0xd361('0xc'),_0x381461,_0xc5859b);_0x265177(_0xc5859b);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 831cede..c1ab5aa 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 _0x8322=['/:id','show','create','put','update','delete','destroy','multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','index'];(function(_0x1b7440,_0x4b7149){var _0xb79f70=function(_0x2b3693){while(--_0x2b3693){_0x1b7440['push'](_0x1b7440['shift']());}};_0xb79f70(++_0x4b7149);}(_0x8322,0x97));var _0x2832=function(_0x4b26b5,_0x4f71fd){_0x4b26b5=_0x4b26b5-0x0;var _0x4dec71=_0x8322[_0x4b26b5];return _0x4dec71;};'use strict';var multer=require(_0x2832('0x0'));var util=require(_0x2832('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x2832('0x2'));var router=express['Router']();var fs_extra=require(_0x2832('0x3'));var auth=require(_0x2832('0x4'));var interaction=require(_0x2832('0x5'));var config=require(_0x2832('0x6'));var controller=require(_0x2832('0x7'));router[_0x2832('0x8')]('/',auth[_0x2832('0x9')](),controller[_0x2832('0xa')]);router['get'](_0x2832('0xb'),auth[_0x2832('0x9')](),controller[_0x2832('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x2832('0xd')]);router[_0x2832('0xe')](_0x2832('0xb'),auth[_0x2832('0x9')](),controller[_0x2832('0xf')]);router[_0x2832('0x10')](_0x2832('0xb'),auth[_0x2832('0x9')](),controller[_0x2832('0x11')]);module['exports']=router; \ No newline at end of file +var _0xdc66=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intFreshdeskField.controller','get','isAuthenticated','index','show','create','put','/:id','update','destroy','multer','util','path'];(function(_0x1648d5,_0x1cb383){var _0x5b70c3=function(_0x565d8f){while(--_0x565d8f){_0x1648d5['push'](_0x1648d5['shift']());}};_0x5b70c3(++_0x1cb383);}(_0xdc66,0x189));var _0x6dc6=function(_0xbd2356,_0x441dc9){_0xbd2356=_0xbd2356-0x0;var _0xf0b100=_0xdc66[_0xbd2356];return _0xf0b100;};'use strict';var multer=require(_0x6dc6('0x0'));var util=require(_0x6dc6('0x1'));var path=require(_0x6dc6('0x2'));var timeout=require(_0x6dc6('0x3'));var express=require(_0x6dc6('0x4'));var router=express[_0x6dc6('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x6dc6('0x6'));var interaction=require(_0x6dc6('0x7'));var config=require('../../config/environment');var controller=require(_0x6dc6('0x8'));router[_0x6dc6('0x9')]('/',auth[_0x6dc6('0xa')](),controller[_0x6dc6('0xb')]);router[_0x6dc6('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x6dc6('0xc')]);router['post']('/',auth[_0x6dc6('0xa')](),controller[_0x6dc6('0xd')]);router[_0x6dc6('0xe')](_0x6dc6('0xf'),auth[_0x6dc6('0xa')](),controller[_0x6dc6('0x10')]);router['delete']('/:id',auth[_0x6dc6('0xa')](),controller[_0x6dc6('0x11')]);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 72a6213..9d8793e 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 _0x1047=['STRING','customVariable','BOOLEAN','sequelize','exports','ENUM','string','variable','keyValue','picklist'];(function(_0x323430,_0x3d2b6d){var _0x9eecd1=function(_0xab855a){while(--_0xab855a){_0x323430['push'](_0x323430['shift']());}};_0x9eecd1(++_0x3d2b6d);}(_0x1047,0x161));var _0x7104=function(_0x1eb42e,_0x16a42a){_0x1eb42e=_0x1eb42e-0x0;var _0x4d80ad=_0x1047[_0x1eb42e];return _0x4d80ad;};'use strict';var Sequelize=require(_0x7104('0x0'));module[_0x7104('0x1')]={'type':{'type':Sequelize[_0x7104('0x2')](_0x7104('0x3'),_0x7104('0x4'),'customVariable',_0x7104('0x5'),_0x7104('0x6')),'defaultValue':_0x7104('0x3')},'content':{'type':Sequelize[_0x7104('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x7104('0x2')](_0x7104('0x3'),_0x7104('0x4'),_0x7104('0x8'))},'keyContent':{'type':Sequelize[_0x7104('0x7')]},'idField':{'type':Sequelize[_0x7104('0x7')]},'nameField':{'type':Sequelize[_0x7104('0x7')]},'customField':{'type':Sequelize[_0x7104('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x7104('0x7')]}}; \ No newline at end of file +var _0x5bb7=['STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','picklist'];(function(_0x4d8af3,_0x4199cc){var _0x118102=function(_0x28191e){while(--_0x28191e){_0x4d8af3['push'](_0x4d8af3['shift']());}};_0x118102(++_0x4199cc);}(_0x5bb7,0xd1));var _0x75bb=function(_0x424a9a,_0x2dd9af){_0x424a9a=_0x424a9a-0x0;var _0xa7831c=_0x5bb7[_0x424a9a];return _0xa7831c;};'use strict';var Sequelize=require(_0x75bb('0x0'));module[_0x75bb('0x1')]={'type':{'type':Sequelize[_0x75bb('0x2')](_0x75bb('0x3'),_0x75bb('0x4'),_0x75bb('0x5'),'keyValue',_0x75bb('0x6')),'defaultValue':_0x75bb('0x3')},'content':{'type':Sequelize[_0x75bb('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x75bb('0x2')](_0x75bb('0x3'),_0x75bb('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0x75bb('0x7')]},'idField':{'type':Sequelize[_0x75bb('0x7')]},'nameField':{'type':Sequelize[_0x75bb('0x7')]},'customField':{'type':Sequelize[_0x75bb('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x75bb('0x7')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 51921ac..03ef44b 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 _0x073e=['length','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','FreshdeskField','rawAttributes','type','key','keys','query','filters','attributes','model','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','intersection'];(function(_0x372179,_0x26a0cc){var _0x20fcf8=function(_0x1d3e31){while(--_0x1d3e31){_0x372179['push'](_0x372179['shift']());}};_0x20fcf8(++_0x26a0cc);}(_0x073e,0x181));var _0xe073=function(_0x4caf0b,_0x1f06b6){_0x4caf0b=_0x4caf0b-0x0;var _0x42ff72=_0x073e[_0x4caf0b];return _0x42ff72;};'use strict';var emlformat=require(_0xe073('0x0'));var rimraf=require(_0xe073('0x1'));var zipdir=require(_0xe073('0x2'));var jsonpatch=require(_0xe073('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe073('0x4'));var util=require(_0xe073('0x5'));var path=require(_0xe073('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe073('0x7'));var _=require(_0xe073('0x8'));var squel=require(_0xe073('0x9'));var crypto=require(_0xe073('0xa'));var jsforce=require(_0xe073('0xb'));var deskjs=require(_0xe073('0xc'));var toCsv=require('to-csv');var querystring=require(_0xe073('0xd'));var Papa=require(_0xe073('0xe'));var Redis=require(_0xe073('0xf'));var authService=require(_0xe073('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xe073('0x11'));var hardwareService=require(_0xe073('0x12'));var logger=require(_0xe073('0x13'))(_0xe073('0x14'));var utils=require(_0xe073('0x15'));var config=require(_0xe073('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe073('0x17'))['db'];function respondWithStatusCode(_0x56e3f5,_0x3dedf7){_0x3dedf7=_0x3dedf7||0xcc;return function(_0x5d2f2f){if(_0x5d2f2f){return _0x56e3f5[_0xe073('0x18')](_0x3dedf7);}return _0x56e3f5['status'](_0x3dedf7)[_0xe073('0x19')]();};}function respondWithResult(_0x27d34,_0x47828d){_0x47828d=_0x47828d||0xc8;return function(_0x2ce92d){if(_0x2ce92d){return _0x27d34[_0xe073('0x1a')](_0x47828d)[_0xe073('0x1b')](_0x2ce92d);}};}function respondWithFilteredResult(_0x2f4b36,_0xfb28f5){return function(_0x208f2e){if(_0x208f2e){var _0x26f3d3=typeof _0xfb28f5[_0xe073('0x1c')]==='undefined'&&typeof _0xfb28f5['limit']==='undefined';var _0x4c578c=_0x208f2e[_0xe073('0x1d')];var _0x10486c=_0x26f3d3?0x0:_0xfb28f5[_0xe073('0x1c')];var _0x4f9c8e=_0x26f3d3?_0x208f2e[_0xe073('0x1d')]:_0xfb28f5[_0xe073('0x1c')]+_0xfb28f5[_0xe073('0x1e')];var _0x54c10e;if(_0x4f9c8e>=_0x4c578c){_0x4f9c8e=_0x4c578c;_0x54c10e=0xc8;}else{_0x54c10e=0xce;}_0x2f4b36[_0xe073('0x1a')](_0x54c10e);return _0x2f4b36[_0xe073('0x1f')](_0xe073('0x20'),_0x10486c+'-'+_0x4f9c8e+'/'+_0x4c578c)[_0xe073('0x1b')](_0x208f2e);}return null;};}function patchUpdates(_0x43668e){return function(_0x17dd4b){try{jsonpatch[_0xe073('0x21')](_0x17dd4b,_0x43668e,!![]);}catch(_0x1d7a13){return BPromise[_0xe073('0x22')](_0x1d7a13);}return _0x17dd4b[_0xe073('0x23')]();};}function saveUpdates(_0x5143fa,_0x4405fd){return function(_0x21f9c2){if(_0x21f9c2){return _0x21f9c2[_0xe073('0x24')](_0x5143fa)[_0xe073('0x25')](function(_0x39bcb4){return _0x39bcb4;});}return null;};}function removeEntity(_0x275aa8,_0x504c26){return function(_0x4c76ef){if(_0x4c76ef){return _0x4c76ef[_0xe073('0x26')]()['then'](function(){_0x275aa8['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c4137,_0x54a38b){return function(_0x50795f){if(!_0x50795f){_0x5c4137[_0xe073('0x18')](0x194);}return _0x50795f;};}function handleError(_0xff003,_0x5bd226){_0x5bd226=_0x5bd226||0x1f4;return function(_0x1fca27){logger[_0xe073('0x27')](_0x1fca27[_0xe073('0x28')]);if(_0x1fca27['name']){delete _0x1fca27[_0xe073('0x29')];}_0xff003['status'](_0x5bd226)[_0xe073('0x2a')](_0x1fca27);};}exports[_0xe073('0x2b')]=function(_0x599972,_0x5dfff9){var _0x15adbb={},_0x859ed8={},_0x278fbb={'count':0x0,'rows':[]};var _0x2f1cd2=_[_0xe073('0x2c')](db[_0xe073('0x2d')][_0xe073('0x2e')],function(_0x2a206a){return{'name':_0x2a206a['fieldName'],'type':_0x2a206a[_0xe073('0x2f')][_0xe073('0x30')]};});_0x859ed8['model']=_['map'](_0x2f1cd2,_0xe073('0x29'));_0x859ed8['query']=_[_0xe073('0x31')](_0x599972[_0xe073('0x32')]);_0x859ed8[_0xe073('0x33')]=_['intersection'](_0x859ed8['model'],_0x859ed8[_0xe073('0x32')]);_0x15adbb[_0xe073('0x34')]=_['intersection'](_0x859ed8[_0xe073('0x35')],qs[_0xe073('0x36')](_0x599972[_0xe073('0x32')]['fields']));_0x15adbb[_0xe073('0x34')]=_0x15adbb['attributes']['length']?_0x15adbb[_0xe073('0x34')]:_0x859ed8[_0xe073('0x35')];if(!_0x599972[_0xe073('0x32')]['hasOwnProperty'](_0xe073('0x37'))){_0x15adbb[_0xe073('0x1e')]=qs[_0xe073('0x1e')](_0x599972['query'][_0xe073('0x1e')]);_0x15adbb[_0xe073('0x1c')]=qs[_0xe073('0x1c')](_0x599972[_0xe073('0x32')][_0xe073('0x1c')]);}_0x15adbb[_0xe073('0x38')]=qs['sort'](_0x599972[_0xe073('0x32')][_0xe073('0x39')]);_0x15adbb[_0xe073('0x3a')]=qs['filters'](_[_0xe073('0x3b')](_0x599972[_0xe073('0x32')],_0x859ed8[_0xe073('0x33')]),_0x2f1cd2);if(_0x599972[_0xe073('0x32')][_0xe073('0x3c')]){_0x15adbb['where']=_[_0xe073('0x3d')](_0x15adbb['where'],{'$or':_[_0xe073('0x2c')](_0x2f1cd2,function(_0x22d278){if(_0x22d278[_0xe073('0x2f')]!==_0xe073('0x3e')){var _0x40f991={};_0x40f991[_0x22d278[_0xe073('0x29')]]={'$like':'%'+_0x599972[_0xe073('0x32')][_0xe073('0x3c')]+'%'};return _0x40f991;}})});}_0x15adbb=_[_0xe073('0x3d')]({},_0x15adbb,_0x599972[_0xe073('0x3f')]);var _0x12976c={'where':_0x15adbb[_0xe073('0x3a')]};return db[_0xe073('0x2d')]['count'](_0x12976c)[_0xe073('0x25')](function(_0x577c87){_0x278fbb[_0xe073('0x1d')]=_0x577c87;if(_0x599972[_0xe073('0x32')][_0xe073('0x40')]){_0x15adbb[_0xe073('0x41')]=[{'all':!![]}];}return db['FreshdeskField'][_0xe073('0x42')](_0x15adbb);})[_0xe073('0x25')](function(_0x93852a){_0x278fbb[_0xe073('0x43')]=_0x93852a;return _0x278fbb;})[_0xe073('0x25')](respondWithFilteredResult(_0x5dfff9,_0x15adbb))['catch'](handleError(_0x5dfff9,null));};exports[_0xe073('0x44')]=function(_0x4b2a82,_0x764196){var _0x2a8c57={'raw':!![],'where':{'id':_0x4b2a82[_0xe073('0x45')]['id']}},_0x125d1f={};_0x125d1f[_0xe073('0x35')]=_[_0xe073('0x31')](db[_0xe073('0x2d')][_0xe073('0x2e')]);_0x125d1f[_0xe073('0x32')]=_[_0xe073('0x31')](_0x4b2a82[_0xe073('0x32')]);_0x125d1f['filters']=_['intersection'](_0x125d1f[_0xe073('0x35')],_0x125d1f[_0xe073('0x32')]);_0x2a8c57[_0xe073('0x34')]=_[_0xe073('0x46')](_0x125d1f[_0xe073('0x35')],qs['fields'](_0x4b2a82[_0xe073('0x32')][_0xe073('0x36')]));_0x2a8c57[_0xe073('0x34')]=_0x2a8c57[_0xe073('0x34')][_0xe073('0x47')]?_0x2a8c57['attributes']:_0x125d1f[_0xe073('0x35')];if(_0x4b2a82['query']['includeAll']){_0x2a8c57[_0xe073('0x41')]=[{'all':!![]}];}_0x2a8c57=_[_0xe073('0x3d')]({},_0x2a8c57,_0x4b2a82['options']);return db['FreshdeskField'][_0xe073('0x48')](_0x2a8c57)[_0xe073('0x25')](handleEntityNotFound(_0x764196,null))[_0xe073('0x25')](respondWithResult(_0x764196,null))[_0xe073('0x49')](handleError(_0x764196,null));};exports[_0xe073('0x4a')]=function(_0x1eec23,_0x317159){return db['FreshdeskField'][_0xe073('0x4a')](_0x1eec23['body'],{})[_0xe073('0x25')](respondWithResult(_0x317159,0xc9))[_0xe073('0x49')](handleError(_0x317159,null));};exports[_0xe073('0x24')]=function(_0x4e1f1d,_0x4d5bcd){if(_0x4e1f1d[_0xe073('0x4b')]['id']){delete _0x4e1f1d[_0xe073('0x4b')]['id'];}return db[_0xe073('0x2d')]['find']({'where':{'id':_0x4e1f1d[_0xe073('0x45')]['id']}})[_0xe073('0x25')](handleEntityNotFound(_0x4d5bcd,null))[_0xe073('0x25')](saveUpdates(_0x4e1f1d[_0xe073('0x4b')],null))[_0xe073('0x25')](respondWithResult(_0x4d5bcd,null))[_0xe073('0x49')](handleError(_0x4d5bcd,null));};exports[_0xe073('0x26')]=function(_0x307541,_0x3238eb){return db['FreshdeskField'][_0xe073('0x48')]({'where':{'id':_0x307541['params']['id']}})[_0xe073('0x25')](handleEntityNotFound(_0x3238eb,null))['then'](removeEntity(_0x3238eb,null))[_0xe073('0x49')](handleError(_0x3238eb,null));}; \ No newline at end of file +var _0x5b02=['length','include','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','error','name','map','FreshdeskField','rawAttributes','fieldName','type','key','query','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','keys'];(function(_0x93818d,_0x5f4782){var _0x4daf9b=function(_0x3a55d9){while(--_0x3a55d9){_0x93818d['push'](_0x93818d['shift']());}};_0x4daf9b(++_0x5f4782);}(_0x5b02,0xe9));var _0x25b0=function(_0x4a858a,_0x3e55da){_0x4a858a=_0x4a858a-0x0;var _0x189647=_0x5b02[_0x4a858a];return _0x189647;};'use strict';var emlformat=require(_0x25b0('0x0'));var rimraf=require(_0x25b0('0x1'));var zipdir=require(_0x25b0('0x2'));var jsonpatch=require(_0x25b0('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x25b0('0x4'));var Mustache=require('mustache');var util=require(_0x25b0('0x5'));var path=require(_0x25b0('0x6'));var sox=require(_0x25b0('0x7'));var csv=require(_0x25b0('0x8'));var ejs=require(_0x25b0('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x25b0('0xa'));var squel=require(_0x25b0('0xb'));var crypto=require('crypto');var jsforce=require(_0x25b0('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x25b0('0xd'));var Papa=require(_0x25b0('0xe'));var Redis=require(_0x25b0('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x25b0('0x10'));var as=require(_0x25b0('0x11'));var hardwareService=require(_0x25b0('0x12'));var logger=require(_0x25b0('0x13'))(_0x25b0('0x14'));var utils=require(_0x25b0('0x15'));var config=require(_0x25b0('0x16'));var licenseUtil=require(_0x25b0('0x17'));var db=require(_0x25b0('0x18'))['db'];function respondWithStatusCode(_0x1d3178,_0x184452){_0x184452=_0x184452||0xcc;return function(_0x26a34f){if(_0x26a34f){return _0x1d3178[_0x25b0('0x19')](_0x184452);}return _0x1d3178[_0x25b0('0x1a')](_0x184452)[_0x25b0('0x1b')]();};}function respondWithResult(_0x42cc07,_0x293203){_0x293203=_0x293203||0xc8;return function(_0x211658){if(_0x211658){return _0x42cc07[_0x25b0('0x1a')](_0x293203)[_0x25b0('0x1c')](_0x211658);}};}function respondWithFilteredResult(_0x40071c,_0x5ac18d){return function(_0x51542b){if(_0x51542b){var _0xfe1ea6=typeof _0x5ac18d['offset']===_0x25b0('0x1d')&&typeof _0x5ac18d[_0x25b0('0x1e')]===_0x25b0('0x1d');var _0x3267b9=_0x51542b['count'];var _0x1d850f=_0xfe1ea6?0x0:_0x5ac18d[_0x25b0('0x1f')];var _0x20762e=_0xfe1ea6?_0x51542b[_0x25b0('0x20')]:_0x5ac18d[_0x25b0('0x1f')]+_0x5ac18d[_0x25b0('0x1e')];var _0x54f458;if(_0x20762e>=_0x3267b9){_0x20762e=_0x3267b9;_0x54f458=0xc8;}else{_0x54f458=0xce;}_0x40071c[_0x25b0('0x1a')](_0x54f458);return _0x40071c[_0x25b0('0x21')](_0x25b0('0x22'),_0x1d850f+'-'+_0x20762e+'/'+_0x3267b9)[_0x25b0('0x1c')](_0x51542b);}return null;};}function patchUpdates(_0x1dc691){return function(_0xea4162){try{jsonpatch[_0x25b0('0x23')](_0xea4162,_0x1dc691,!![]);}catch(_0x19599b){return BPromise[_0x25b0('0x24')](_0x19599b);}return _0xea4162[_0x25b0('0x25')]();};}function saveUpdates(_0x2b2eda,_0x3ce1da){return function(_0x5cb746){if(_0x5cb746){return _0x5cb746[_0x25b0('0x26')](_0x2b2eda)[_0x25b0('0x27')](function(_0x517ec5){return _0x517ec5;});}return null;};}function removeEntity(_0x2d7c17,_0x2023d8){return function(_0x3546f0){if(_0x3546f0){return _0x3546f0['destroy']()['then'](function(){_0x2d7c17['status'](0xcc)[_0x25b0('0x1b')]();});}};}function handleEntityNotFound(_0x433085,_0x99bd3a){return function(_0x24f847){if(!_0x24f847){_0x433085[_0x25b0('0x19')](0x194);}return _0x24f847;};}function handleError(_0x23b396,_0x40268a){_0x40268a=_0x40268a||0x1f4;return function(_0x75ce7a){logger[_0x25b0('0x28')](_0x75ce7a['stack']);if(_0x75ce7a[_0x25b0('0x29')]){delete _0x75ce7a[_0x25b0('0x29')];}_0x23b396['status'](_0x40268a)['send'](_0x75ce7a);};}exports['index']=function(_0x1a6212,_0x3f0a54){var _0x251fad={},_0x105129={},_0x214377={'count':0x0,'rows':[]};var _0x3285ae=_[_0x25b0('0x2a')](db[_0x25b0('0x2b')][_0x25b0('0x2c')],function(_0x285a2b){return{'name':_0x285a2b[_0x25b0('0x2d')],'type':_0x285a2b[_0x25b0('0x2e')][_0x25b0('0x2f')]};});_0x105129['model']=_['map'](_0x3285ae,_0x25b0('0x29'));_0x105129['query']=_['keys'](_0x1a6212[_0x25b0('0x30')]);_0x105129[_0x25b0('0x31')]=_[_0x25b0('0x32')](_0x105129[_0x25b0('0x33')],_0x105129[_0x25b0('0x30')]);_0x251fad['attributes']=_[_0x25b0('0x32')](_0x105129[_0x25b0('0x33')],qs['fields'](_0x1a6212[_0x25b0('0x30')][_0x25b0('0x34')]));_0x251fad['attributes']=_0x251fad[_0x25b0('0x35')]['length']?_0x251fad[_0x25b0('0x35')]:_0x105129[_0x25b0('0x33')];if(!_0x1a6212[_0x25b0('0x30')][_0x25b0('0x36')](_0x25b0('0x37'))){_0x251fad[_0x25b0('0x1e')]=qs[_0x25b0('0x1e')](_0x1a6212[_0x25b0('0x30')][_0x25b0('0x1e')]);_0x251fad['offset']=qs[_0x25b0('0x1f')](_0x1a6212[_0x25b0('0x30')][_0x25b0('0x1f')]);}_0x251fad[_0x25b0('0x38')]=qs[_0x25b0('0x39')](_0x1a6212[_0x25b0('0x30')][_0x25b0('0x39')]);_0x251fad[_0x25b0('0x3a')]=qs[_0x25b0('0x31')](_[_0x25b0('0x3b')](_0x1a6212['query'],_0x105129[_0x25b0('0x31')]),_0x3285ae);if(_0x1a6212[_0x25b0('0x30')][_0x25b0('0x3c')]){_0x251fad['where']=_[_0x25b0('0x3d')](_0x251fad[_0x25b0('0x3a')],{'$or':_[_0x25b0('0x2a')](_0x3285ae,function(_0x43e140){if(_0x43e140[_0x25b0('0x2e')]!==_0x25b0('0x3e')){var _0x28f1cd={};_0x28f1cd[_0x43e140[_0x25b0('0x29')]]={'$like':'%'+_0x1a6212['query']['filter']+'%'};return _0x28f1cd;}})});}_0x251fad=_[_0x25b0('0x3d')]({},_0x251fad,_0x1a6212[_0x25b0('0x3f')]);var _0x3f4ae0={'where':_0x251fad['where']};return db[_0x25b0('0x2b')]['count'](_0x3f4ae0)[_0x25b0('0x27')](function(_0x39617a){_0x214377[_0x25b0('0x20')]=_0x39617a;if(_0x1a6212[_0x25b0('0x30')][_0x25b0('0x40')]){_0x251fad['include']=[{'all':!![]}];}return db[_0x25b0('0x2b')][_0x25b0('0x41')](_0x251fad);})[_0x25b0('0x27')](function(_0x376d8a){_0x214377[_0x25b0('0x42')]=_0x376d8a;return _0x214377;})['then'](respondWithFilteredResult(_0x3f0a54,_0x251fad))[_0x25b0('0x43')](handleError(_0x3f0a54,null));};exports[_0x25b0('0x44')]=function(_0x3d1262,_0x44c400){var _0x35fc00={'raw':!![],'where':{'id':_0x3d1262[_0x25b0('0x45')]['id']}},_0x1adf8d={};_0x1adf8d[_0x25b0('0x33')]=_[_0x25b0('0x46')](db[_0x25b0('0x2b')][_0x25b0('0x2c')]);_0x1adf8d['query']=_[_0x25b0('0x46')](_0x3d1262['query']);_0x1adf8d[_0x25b0('0x31')]=_[_0x25b0('0x32')](_0x1adf8d[_0x25b0('0x33')],_0x1adf8d[_0x25b0('0x30')]);_0x35fc00['attributes']=_[_0x25b0('0x32')](_0x1adf8d[_0x25b0('0x33')],qs[_0x25b0('0x34')](_0x3d1262['query'][_0x25b0('0x34')]));_0x35fc00[_0x25b0('0x35')]=_0x35fc00[_0x25b0('0x35')][_0x25b0('0x47')]?_0x35fc00[_0x25b0('0x35')]:_0x1adf8d[_0x25b0('0x33')];if(_0x3d1262[_0x25b0('0x30')]['includeAll']){_0x35fc00[_0x25b0('0x48')]=[{'all':!![]}];}_0x35fc00=_[_0x25b0('0x3d')]({},_0x35fc00,_0x3d1262[_0x25b0('0x3f')]);return db['FreshdeskField'][_0x25b0('0x49')](_0x35fc00)[_0x25b0('0x27')](handleEntityNotFound(_0x44c400,null))[_0x25b0('0x27')](respondWithResult(_0x44c400,null))[_0x25b0('0x43')](handleError(_0x44c400,null));};exports[_0x25b0('0x4a')]=function(_0x568d83,_0x1e8a8d){return db[_0x25b0('0x2b')][_0x25b0('0x4a')](_0x568d83['body'],{})[_0x25b0('0x27')](respondWithResult(_0x1e8a8d,0xc9))[_0x25b0('0x43')](handleError(_0x1e8a8d,null));};exports[_0x25b0('0x26')]=function(_0x1d6d55,_0x29165e){if(_0x1d6d55[_0x25b0('0x4b')]['id']){delete _0x1d6d55['body']['id'];}return db['FreshdeskField']['find']({'where':{'id':_0x1d6d55[_0x25b0('0x45')]['id']}})['then'](handleEntityNotFound(_0x29165e,null))['then'](saveUpdates(_0x1d6d55[_0x25b0('0x4b')],null))['then'](respondWithResult(_0x29165e,null))[_0x25b0('0x43')](handleError(_0x29165e,null));};exports['destroy']=function(_0x4fc22d,_0x394e52){return db[_0x25b0('0x2b')][_0x25b0('0x49')]({'where':{'id':_0x4fc22d[_0x25b0('0x45')]['id']}})[_0x25b0('0x27')](handleEntityNotFound(_0x394e52,null))[_0x25b0('0x27')](removeEntity(_0x394e52,null))[_0x25b0('0x43')](handleError(_0x394e52,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index 860c752..feca45d 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 _0xa049=['request-promise','path','rimraf','../../config/environment','./intFreshdeskField.attributes','exports','define','int_freshdesk_fields','freshdesk_unique_index','idField','FieldId','lodash','util','api','moment','bluebird'];(function(_0x21c305,_0x2e2ae2){var _0x46e79a=function(_0x11a1f7){while(--_0x11a1f7){_0x21c305['push'](_0x21c305['shift']());}};_0x46e79a(++_0x2e2ae2);}(_0xa049,0x1db));var _0x9a04=function(_0x263721,_0x10ce8e){_0x263721=_0x263721-0x0;var _0x5d503b=_0xa049[_0x263721];return _0x5d503b;};'use strict';var _=require(_0x9a04('0x0'));var util=require(_0x9a04('0x1'));var logger=require('../../config/logger')(_0x9a04('0x2'));var moment=require(_0x9a04('0x3'));var BPromise=require(_0x9a04('0x4'));var rp=require(_0x9a04('0x5'));var fs=require('fs');var path=require(_0x9a04('0x6'));var rimraf=require(_0x9a04('0x7'));var config=require(_0x9a04('0x8'));var attributes=require(_0x9a04('0x9'));module[_0x9a04('0xa')]=function(_0x570be2,_0x3cacca){return _0x570be2[_0x9a04('0xb')]('FreshdeskField',attributes,{'tableName':_0x9a04('0xc'),'paranoid':![],'indexes':[{'name':_0x9a04('0xd'),'fields':[_0x9a04('0xe'),_0x9a04('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3cbc=['FieldId','lodash','util','api','moment','bluebird','rimraf','../../config/environment','./intFreshdeskField.attributes','define','freshdesk_unique_index','idField'];(function(_0x11e41a,_0x538c92){var _0x1cd093=function(_0x511af9){while(--_0x511af9){_0x11e41a['push'](_0x11e41a['shift']());}};_0x1cd093(++_0x538c92);}(_0x3cbc,0x151));var _0xc3cb=function(_0x663880,_0x180fb0){_0x663880=_0x663880-0x0;var _0x318aee=_0x3cbc[_0x663880];return _0x318aee;};'use strict';var _=require(_0xc3cb('0x0'));var util=require(_0xc3cb('0x1'));var logger=require('../../config/logger')(_0xc3cb('0x2'));var moment=require(_0xc3cb('0x3'));var BPromise=require(_0xc3cb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc3cb('0x5'));var config=require(_0xc3cb('0x6'));var attributes=require(_0xc3cb('0x7'));module['exports']=function(_0x13aef5,_0x452f75){return _0x13aef5[_0xc3cb('0x8')]('FreshdeskField',attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':_0xc3cb('0x9'),'fields':[_0xc3cb('0xa'),_0xc3cb('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.rpc.js b/server/api/intFreshdeskField/intFreshdeskField.rpc.js index dc7d914..75d6ca2 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 _0xd19f=['client','http','request','then','info','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','error','FreshdeskField,\x20%s,\x20%s','message','result','catch','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise'];(function(_0x46a634,_0x439b70){var _0x42007a=function(_0x2a9e29){while(--_0x2a9e29){_0x46a634['push'](_0x46a634['shift']());}};_0x42007a(++_0x439b70);}(_0xd19f,0x175));var _0xfd19=function(_0x5c38cd,_0x5a6b4e){_0x5c38cd=_0x5c38cd-0x0;var _0xc985ef=_0xd19f[_0x5c38cd];return _0xc985ef;};'use strict';var _=require('lodash');var util=require(_0xfd19('0x0'));var moment=require(_0xfd19('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfd19('0x2'));var db=require(_0xfd19('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xfd19('0x4'))(_0xfd19('0x5'));var config=require('../../config/environment');var jayson=require(_0xfd19('0x6'));var client=jayson[_0xfd19('0x7')][_0xfd19('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x47a925,_0x1ebddb,_0x25a8e5){return new BPromise(function(_0x4ebed5,_0xb65895){return client[_0xfd19('0x9')](_0x47a925,_0x25a8e5)[_0xfd19('0xa')](function(_0x47055e){logger[_0xfd19('0xb')]('FreshdeskField,\x20%s,\x20%s',_0x1ebddb,_0xfd19('0xc'));logger[_0xfd19('0xd')](_0xfd19('0xe'),_0x1ebddb,'request\x20sent',JSON['stringify'](_0x47055e));if(_0x47055e[_0xfd19('0xf')]){if(_0x47055e['error']['code']===0x1f4){logger['error'](_0xfd19('0x10'),_0x1ebddb,_0x47055e['error'][_0xfd19('0x11')]);return _0xb65895(_0x47055e[_0xfd19('0xf')][_0xfd19('0x11')]);}logger[_0xfd19('0xf')](_0xfd19('0x10'),_0x1ebddb,_0x47055e[_0xfd19('0xf')][_0xfd19('0x11')]);return _0x4ebed5(_0x47055e[_0xfd19('0xf')][_0xfd19('0x11')]);}else{logger[_0xfd19('0xb')](_0xfd19('0x10'),_0x1ebddb,_0xfd19('0xc'));_0x4ebed5(_0x47055e[_0xfd19('0x12')][_0xfd19('0x11')]);}})[_0xfd19('0x13')](function(_0x3110d1){logger[_0xfd19('0xf')]('FreshdeskField,\x20%s,\x20%s',_0x1ebddb,_0x3110d1);_0xb65895(_0x3110d1);});});} \ No newline at end of file +var _0xc5db=['FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshdeskField,\x20%s,\x20%s','debug'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0xc5db,0x141));var _0xbc5d=function(_0x4be871,_0x23375d){_0x4be871=_0x4be871-0x0;var _0xb7be3d=_0xc5db[_0x4be871];return _0xb7be3d;};'use strict';var _=require(_0xbc5d('0x0'));var util=require(_0xbc5d('0x1'));var moment=require(_0xbc5d('0x2'));var BPromise=require(_0xbc5d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbc5d('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xbc5d('0x5'));var config=require(_0xbc5d('0x6'));var jayson=require(_0xbc5d('0x7'));var client=jayson[_0xbc5d('0x8')][_0xbc5d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x18de95,_0x55175a,_0x5f1024){return new BPromise(function(_0x2596f4,_0x15df9f){return client[_0xbc5d('0xa')](_0x18de95,_0x5f1024)[_0xbc5d('0xb')](function(_0x376e05){logger[_0xbc5d('0xc')](_0xbc5d('0xd'),_0x55175a,'request\x20sent');logger[_0xbc5d('0xe')](_0xbc5d('0xf'),_0x55175a,'request\x20sent',JSON[_0xbc5d('0x10')](_0x376e05));if(_0x376e05[_0xbc5d('0x11')]){if(_0x376e05['error'][_0xbc5d('0x12')]===0x1f4){logger[_0xbc5d('0x11')](_0xbc5d('0xd'),_0x55175a,_0x376e05[_0xbc5d('0x11')][_0xbc5d('0x13')]);return _0x15df9f(_0x376e05['error'][_0xbc5d('0x13')]);}logger[_0xbc5d('0x11')](_0xbc5d('0xd'),_0x55175a,_0x376e05[_0xbc5d('0x11')][_0xbc5d('0x13')]);return _0x2596f4(_0x376e05[_0xbc5d('0x11')][_0xbc5d('0x13')]);}else{logger['info'](_0xbc5d('0xd'),_0x55175a,'request\x20sent');_0x2596f4(_0x376e05[_0xbc5d('0x14')][_0xbc5d('0x13')]);}})['catch'](function(_0x3fcdca){logger[_0xbc5d('0x11')](_0xbc5d('0xd'),_0x55175a,_0x3fcdca);_0x15df9f(_0x3fcdca);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index b32d6f3..dc03267 100644 --- a/server/api/intFreshsalesAccount/index.js +++ b/server/api/intFreshsalesAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa478=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','index','/:id','isAuthenticated','getConfigurations','getFields','post','/:id/configurations','update'];(function(_0x1413b6,_0x46a66d){var _0x133fd9=function(_0xb14d1f){while(--_0xb14d1f){_0x1413b6['push'](_0x1413b6['shift']());}};_0x133fd9(++_0x46a66d);}(_0xa478,0x136));var _0x8a47=function(_0x7d4dc8,_0x14d70e){_0x7d4dc8=_0x7d4dc8-0x0;var _0x20b216=_0xa478[_0x7d4dc8];return _0x20b216;};'use strict';var multer=require(_0x8a47('0x0'));var util=require(_0x8a47('0x1'));var path=require(_0x8a47('0x2'));var timeout=require(_0x8a47('0x3'));var express=require(_0x8a47('0x4'));var router=express[_0x8a47('0x5')]();var fs_extra=require(_0x8a47('0x6'));var auth=require(_0x8a47('0x7'));var interaction=require(_0x8a47('0x8'));var config=require(_0x8a47('0x9'));var controller=require(_0x8a47('0xa'));router[_0x8a47('0xb')]('/',auth['isAuthenticated'](),controller[_0x8a47('0xc')]);router[_0x8a47('0xb')](_0x8a47('0xd'),auth[_0x8a47('0xe')](),controller['show']);router[_0x8a47('0xb')]('/:id/configurations',auth[_0x8a47('0xe')](),controller[_0x8a47('0xf')]);router[_0x8a47('0xb')]('/:id/fields',auth[_0x8a47('0xe')](),controller[_0x8a47('0x10')]);router['post']('/',auth[_0x8a47('0xe')](),controller['create']);router[_0x8a47('0x11')](_0x8a47('0x12'),auth[_0x8a47('0xe')](),controller['addConfiguration']);router['put']('/:id',auth[_0x8a47('0xe')](),controller[_0x8a47('0x13')]);router['delete'](_0x8a47('0xd'),auth[_0x8a47('0xe')](),controller[_0x8a47('0x14')]);module[_0x8a47('0x15')]=router; \ No newline at end of file +var _0x7334=['put','update','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration'];(function(_0x2a3baf,_0x1da476){var _0x558fbc=function(_0x891327){while(--_0x891327){_0x2a3baf['push'](_0x2a3baf['shift']());}};_0x558fbc(++_0x1da476);}(_0x7334,0x184));var _0x4733=function(_0x147a5c,_0x24b09b){_0x147a5c=_0x147a5c-0x0;var _0x5f0dfd=_0x7334[_0x147a5c];return _0x5f0dfd;};'use strict';var multer=require(_0x4733('0x0'));var util=require(_0x4733('0x1'));var path=require(_0x4733('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4733('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x4733('0x4'));var interaction=require(_0x4733('0x5'));var config=require(_0x4733('0x6'));var controller=require(_0x4733('0x7'));router[_0x4733('0x8')]('/',auth[_0x4733('0x9')](),controller[_0x4733('0xa')]);router[_0x4733('0x8')](_0x4733('0xb'),auth[_0x4733('0x9')](),controller[_0x4733('0xc')]);router[_0x4733('0x8')](_0x4733('0xd'),auth[_0x4733('0x9')](),controller[_0x4733('0xe')]);router[_0x4733('0x8')](_0x4733('0xf'),auth['isAuthenticated'](),controller[_0x4733('0x10')]);router[_0x4733('0x11')]('/',auth['isAuthenticated'](),controller[_0x4733('0x12')]);router['post'](_0x4733('0xd'),auth[_0x4733('0x9')](),controller[_0x4733('0x13')]);router[_0x4733('0x14')](_0x4733('0xb'),auth[_0x4733('0x9')](),controller[_0x4733('0x15')]);router['delete'](_0x4733('0xb'),auth['isAuthenticated'](),controller[_0x4733('0x16')]);module[_0x4733('0x17')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index b207113..ac0a445 100644 --- a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js +++ b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb44a=['STRING'];(function(_0x625492,_0x1cd944){var _0x296b94=function(_0x942555){while(--_0x942555){_0x625492['push'](_0x625492['shift']());}};_0x296b94(++_0x1cd944);}(_0xb44a,0x1c2));var _0xab44=function(_0x1406c8,_0x40a801){_0x1406c8=_0x1406c8-0x0;var _0x3ec6f8=_0xb44a[_0x1406c8];return _0x3ec6f8;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xab44('0x0')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xab44('0x0')],'unique':'username'},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xab44('0x0')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0xab44('0x0')],'allowNull':![]}}; \ No newline at end of file +var _0x4325=['exports','STRING','username','remoteUri','sequelize'];(function(_0x47e397,_0x2b5f29){var _0x459950=function(_0x43f7f9){while(--_0x43f7f9){_0x47e397['push'](_0x47e397['shift']());}};_0x459950(++_0x2b5f29);}(_0x4325,0x1da));var _0x5432=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x4325[_0x3bf83f];return _0x22c4a9;};'use strict';var Sequelize=require(_0x5432('0x0'));module[_0x5432('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x5432('0x2')]},'username':{'type':Sequelize[_0x5432('0x2')],'unique':_0x5432('0x3')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x5432('0x4')},'serverUrl':{'type':Sequelize[_0x5432('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index a745e1b..7135959 100644 --- a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js +++ b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xef16=['hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','FreshsalesAccount','findAll','catch','length','create','update','body','find','params','findOne','FreshsalesConfiguration','order','getConfigurations','addConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','FreshsalesField','Subjects','getFields','username','remoteUri','apiKey','slice','substring','lastIndexOf','GET','format','%s%s','/api/selector/owners','Token\x20token=','users','email','Requested\x20Resource\x20not\x20Found','test','statusCode','error','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','offset','undefined','limit','count','status','set','json','apply','reject','save','then','destroy','name','send','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields'];(function(_0x1cf6dd,_0x5bd0c4){var _0x566408=function(_0x4dd0f0){while(--_0x4dd0f0){_0x1cf6dd['push'](_0x1cf6dd['shift']());}};_0x566408(++_0x5bd0c4);}(_0xef16,0xfb));var _0x6ef1=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0xef16[_0x42245d];return _0x4b211a;};'use strict';var emlformat=require(_0x6ef1('0x0'));var rimraf=require(_0x6ef1('0x1'));var zipdir=require(_0x6ef1('0x2'));var jsonpatch=require(_0x6ef1('0x3'));var rp=require(_0x6ef1('0x4'));var moment=require(_0x6ef1('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x6ef1('0x6'));var util=require('util');var path=require('path');var sox=require(_0x6ef1('0x7'));var csv=require(_0x6ef1('0x8'));var ejs=require(_0x6ef1('0x9'));var fs=require('fs');var fs_extra=require(_0x6ef1('0xa'));var _=require(_0x6ef1('0xb'));var squel=require(_0x6ef1('0xc'));var crypto=require(_0x6ef1('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6ef1('0x8'));var querystring=require(_0x6ef1('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6ef1('0xf'));var as=require(_0x6ef1('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6ef1('0x11'))('api');var utils=require(_0x6ef1('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x6ef1('0x13'));var db=require(_0x6ef1('0x14'))['db'];var integrations=require(_0x6ef1('0x15'));function respondWithStatusCode(_0xf1efee,_0x151658){_0x151658=_0x151658||0xcc;return function(_0x13ed74){if(_0x13ed74){return _0xf1efee[_0x6ef1('0x16')](_0x151658);}return _0xf1efee['status'](_0x151658)[_0x6ef1('0x17')]();};}function respondWithResult(_0x56b9d7,_0x2afb36){_0x2afb36=_0x2afb36||0xc8;return function(_0x4db909){if(_0x4db909){return _0x56b9d7['status'](_0x2afb36)['json'](_0x4db909);}};}function respondWithFilteredResult(_0x50ffbc,_0x2e3d1b){return function(_0x14cc95){if(_0x14cc95){var _0x1137a6=typeof _0x2e3d1b[_0x6ef1('0x18')]===_0x6ef1('0x19')&&typeof _0x2e3d1b[_0x6ef1('0x1a')]==='undefined';var _0x5016d8=_0x14cc95[_0x6ef1('0x1b')];var _0x46d29d=_0x1137a6?0x0:_0x2e3d1b['offset'];var _0x15ffd8=_0x1137a6?_0x14cc95[_0x6ef1('0x1b')]:_0x2e3d1b[_0x6ef1('0x18')]+_0x2e3d1b['limit'];var _0x2e0fea;if(_0x15ffd8>=_0x5016d8){_0x15ffd8=_0x5016d8;_0x2e0fea=0xc8;}else{_0x2e0fea=0xce;}_0x50ffbc[_0x6ef1('0x1c')](_0x2e0fea);return _0x50ffbc[_0x6ef1('0x1d')]('Content-Range',_0x46d29d+'-'+_0x15ffd8+'/'+_0x5016d8)[_0x6ef1('0x1e')](_0x14cc95);}return null;};}function patchUpdates(_0x1fc9cb){return function(_0x3ea5fb){try{jsonpatch[_0x6ef1('0x1f')](_0x3ea5fb,_0x1fc9cb,!![]);}catch(_0x241303){return BPromise[_0x6ef1('0x20')](_0x241303);}return _0x3ea5fb[_0x6ef1('0x21')]();};}function saveUpdates(_0x1f12c9,_0x5882c1){return function(_0x5d80fe){if(_0x5d80fe){return _0x5d80fe['update'](_0x1f12c9)[_0x6ef1('0x22')](function(_0x138ef0){return _0x138ef0;});}return null;};}function removeEntity(_0x485e77,_0x211578){return function(_0x23decd){if(_0x23decd){return _0x23decd[_0x6ef1('0x23')]()[_0x6ef1('0x22')](function(){_0x485e77[_0x6ef1('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x59d641,_0x111e74){return function(_0x2e627d){if(!_0x2e627d){_0x59d641['sendStatus'](0x194);}return _0x2e627d;};}function handleError(_0x12093d,_0x4bd578){_0x4bd578=_0x4bd578||0x1f4;return function(_0x292baa){logger['error'](_0x292baa['stack']);if(_0x292baa[_0x6ef1('0x24')]){delete _0x292baa['name'];}_0x12093d[_0x6ef1('0x1c')](_0x4bd578)[_0x6ef1('0x25')](_0x292baa);};}exports['index']=function(_0x5cc2b4,_0x3c7d64){var _0x35c181={},_0x264895={},_0x558da2={'count':0x0,'rows':[]};var _0x3294c5=_['map'](db['FreshsalesAccount'][_0x6ef1('0x26')],function(_0x40b6ea){return{'name':_0x40b6ea['fieldName'],'type':_0x40b6ea[_0x6ef1('0x27')][_0x6ef1('0x28')]};});_0x264895[_0x6ef1('0x29')]=_[_0x6ef1('0x2a')](_0x3294c5,'name');_0x264895[_0x6ef1('0x2b')]=_[_0x6ef1('0x2c')](_0x5cc2b4[_0x6ef1('0x2b')]);_0x264895[_0x6ef1('0x2d')]=_[_0x6ef1('0x2e')](_0x264895['model'],_0x264895['query']);_0x35c181[_0x6ef1('0x2f')]=_[_0x6ef1('0x2e')](_0x264895[_0x6ef1('0x29')],qs[_0x6ef1('0x30')](_0x5cc2b4[_0x6ef1('0x2b')][_0x6ef1('0x30')]));_0x35c181[_0x6ef1('0x2f')]=_0x35c181[_0x6ef1('0x2f')]['length']?_0x35c181[_0x6ef1('0x2f')]:_0x264895[_0x6ef1('0x29')];if(!_0x5cc2b4['query'][_0x6ef1('0x31')](_0x6ef1('0x32'))){_0x35c181[_0x6ef1('0x1a')]=qs[_0x6ef1('0x1a')](_0x5cc2b4[_0x6ef1('0x2b')]['limit']);_0x35c181[_0x6ef1('0x18')]=qs['offset'](_0x5cc2b4[_0x6ef1('0x2b')][_0x6ef1('0x18')]);}_0x35c181['order']=qs[_0x6ef1('0x33')](_0x5cc2b4[_0x6ef1('0x2b')][_0x6ef1('0x33')]);_0x35c181[_0x6ef1('0x34')]=qs['filters'](_[_0x6ef1('0x35')](_0x5cc2b4[_0x6ef1('0x2b')],_0x264895[_0x6ef1('0x2d')]),_0x3294c5);if(_0x5cc2b4[_0x6ef1('0x2b')][_0x6ef1('0x36')]){_0x35c181[_0x6ef1('0x34')]=_[_0x6ef1('0x37')](_0x35c181[_0x6ef1('0x34')],{'$or':_[_0x6ef1('0x2a')](_0x3294c5,function(_0x38d45f){if(_0x38d45f['type']!=='VIRTUAL'){var _0x1910b9={};_0x1910b9[_0x38d45f[_0x6ef1('0x24')]]={'$like':'%'+_0x5cc2b4[_0x6ef1('0x2b')]['filter']+'%'};return _0x1910b9;}})});}_0x35c181=_[_0x6ef1('0x37')]({},_0x35c181,_0x5cc2b4[_0x6ef1('0x38')]);var _0x2f9f88={'where':_0x35c181[_0x6ef1('0x34')]};return db['FreshsalesAccount']['count'](_0x2f9f88)[_0x6ef1('0x22')](function(_0x2d8ca4){_0x558da2[_0x6ef1('0x1b')]=_0x2d8ca4;if(_0x5cc2b4['query'][_0x6ef1('0x39')]){_0x35c181[_0x6ef1('0x3a')]=[{'all':!![]}];}return db[_0x6ef1('0x3b')][_0x6ef1('0x3c')](_0x35c181);})[_0x6ef1('0x22')](function(_0x54ed77){_0x558da2['rows']=_0x54ed77;return _0x558da2;})[_0x6ef1('0x22')](respondWithFilteredResult(_0x3c7d64,_0x35c181))[_0x6ef1('0x3d')](handleError(_0x3c7d64,null));};exports['show']=function(_0x27f0ab,_0x4d312b){var _0x1e79fc={'raw':![],'where':{'id':_0x27f0ab['params']['id']}},_0x45fe22={};_0x45fe22[_0x6ef1('0x29')]=_[_0x6ef1('0x2c')](db[_0x6ef1('0x3b')][_0x6ef1('0x26')]);_0x45fe22[_0x6ef1('0x2b')]=_[_0x6ef1('0x2c')](_0x27f0ab['query']);_0x45fe22[_0x6ef1('0x2d')]=_['intersection'](_0x45fe22[_0x6ef1('0x29')],_0x45fe22[_0x6ef1('0x2b')]);_0x1e79fc[_0x6ef1('0x2f')]=_['intersection'](_0x45fe22[_0x6ef1('0x29')],qs[_0x6ef1('0x30')](_0x27f0ab[_0x6ef1('0x2b')][_0x6ef1('0x30')]));_0x1e79fc[_0x6ef1('0x2f')]=_0x1e79fc[_0x6ef1('0x2f')][_0x6ef1('0x3e')]?_0x1e79fc[_0x6ef1('0x2f')]:_0x45fe22['model'];if(_0x27f0ab[_0x6ef1('0x2b')][_0x6ef1('0x39')]){_0x1e79fc[_0x6ef1('0x3a')]=[{'all':!![]}];}_0x1e79fc=_[_0x6ef1('0x37')]({},_0x1e79fc,_0x27f0ab['options']);return db[_0x6ef1('0x3b')]['find'](_0x1e79fc)[_0x6ef1('0x22')](handleEntityNotFound(_0x4d312b,null))[_0x6ef1('0x22')](respondWithResult(_0x4d312b,null))['catch'](handleError(_0x4d312b,null));};exports[_0x6ef1('0x3f')]=function(_0x5bffda,_0x35ecd2){return db[_0x6ef1('0x3b')][_0x6ef1('0x3f')](_0x5bffda['body'],{})[_0x6ef1('0x22')](respondWithResult(_0x35ecd2,0xc9))[_0x6ef1('0x3d')](handleError(_0x35ecd2,null));};exports[_0x6ef1('0x40')]=function(_0x25cb0c,_0x3bb32a){if(_0x25cb0c[_0x6ef1('0x41')]['id']){delete _0x25cb0c[_0x6ef1('0x41')]['id'];}return db[_0x6ef1('0x3b')][_0x6ef1('0x42')]({'where':{'id':_0x25cb0c[_0x6ef1('0x43')]['id']}})[_0x6ef1('0x22')](handleEntityNotFound(_0x3bb32a,null))[_0x6ef1('0x22')](saveUpdates(_0x25cb0c[_0x6ef1('0x41')],null))[_0x6ef1('0x22')](respondWithResult(_0x3bb32a,null))[_0x6ef1('0x3d')](handleError(_0x3bb32a,null));};exports[_0x6ef1('0x23')]=function(_0x87b2b9,_0x180b73){return db[_0x6ef1('0x3b')][_0x6ef1('0x42')]({'where':{'id':_0x87b2b9[_0x6ef1('0x43')]['id']}})[_0x6ef1('0x22')](handleEntityNotFound(_0x180b73,null))[_0x6ef1('0x22')](removeEntity(_0x180b73,null))[_0x6ef1('0x3d')](handleError(_0x180b73,null));};exports['getConfigurations']=function(_0x400451,_0x33e49d,_0x5a1eac){var _0xf2d624={};var _0x5a8ede={};var _0x150583;var _0x29fd9c;return db[_0x6ef1('0x3b')][_0x6ef1('0x44')]({'where':{'id':_0x400451['params']['id']}})['then'](handleEntityNotFound(_0x33e49d,null))[_0x6ef1('0x22')](function(_0x1380e9){if(_0x1380e9){_0x150583=_0x1380e9;_0x5a8ede[_0x6ef1('0x29')]=_[_0x6ef1('0x2c')](db[_0x6ef1('0x45')][_0x6ef1('0x26')]);_0x5a8ede[_0x6ef1('0x2b')]=_['keys'](_0x400451[_0x6ef1('0x2b')]);_0x5a8ede[_0x6ef1('0x2d')]=_['intersection'](_0x5a8ede['model'],_0x5a8ede[_0x6ef1('0x2b')]);_0xf2d624[_0x6ef1('0x2f')]=_[_0x6ef1('0x2e')](_0x5a8ede[_0x6ef1('0x29')],qs[_0x6ef1('0x30')](_0x400451[_0x6ef1('0x2b')]['fields']));_0xf2d624[_0x6ef1('0x2f')]=_0xf2d624[_0x6ef1('0x2f')][_0x6ef1('0x3e')]?_0xf2d624[_0x6ef1('0x2f')]:_0x5a8ede[_0x6ef1('0x29')];_0xf2d624[_0x6ef1('0x46')]=qs['sort'](_0x400451['query']['sort']);_0xf2d624['where']=qs[_0x6ef1('0x2d')](_[_0x6ef1('0x35')](_0x400451['query'],_0x5a8ede[_0x6ef1('0x2d')]));if(_0x400451[_0x6ef1('0x2b')][_0x6ef1('0x36')]){_0xf2d624[_0x6ef1('0x34')]=_['merge'](_0xf2d624[_0x6ef1('0x34')],{'$or':_[_0x6ef1('0x2a')](_0xf2d624['attributes'],function(_0x18b618){var _0x41dc84={};_0x41dc84[_0x18b618]={'$like':'%'+_0x400451[_0x6ef1('0x2b')]['filter']+'%'};return _0x41dc84;})});}_0xf2d624=_['merge']({},_0xf2d624,_0x400451['options']);return _0x150583[_0x6ef1('0x47')](_0xf2d624);}})[_0x6ef1('0x22')](function(_0x2fd59e){if(_0x2fd59e){_0x29fd9c=_0x2fd59e[_0x6ef1('0x3e')];if(!_0x400451['query'][_0x6ef1('0x31')]('nolimit')){_0xf2d624[_0x6ef1('0x1a')]=qs[_0x6ef1('0x1a')](_0x400451[_0x6ef1('0x2b')][_0x6ef1('0x1a')]);_0xf2d624[_0x6ef1('0x18')]=qs[_0x6ef1('0x18')](_0x400451['query'][_0x6ef1('0x18')]);}return _0x150583[_0x6ef1('0x47')](_0xf2d624);}})[_0x6ef1('0x22')](function(_0x1bbe59){if(_0x1bbe59){return _0x1bbe59?{'count':_0x29fd9c,'rows':_0x1bbe59}:null;}})[_0x6ef1('0x22')](respondWithResult(_0x33e49d,null))[_0x6ef1('0x3d')](handleError(_0x33e49d,null));};exports[_0x6ef1('0x48')]=function(_0x5a17f9,_0x24e822,_0x357c5d){if(_0x5a17f9[_0x6ef1('0x41')]['id']){delete _0x5a17f9['body']['id'];}return db['FreshsalesAccount']['findOne']({'where':{'id':_0x5a17f9[_0x6ef1('0x43')]['id']}})[_0x6ef1('0x22')](handleEntityNotFound(_0x24e822,null))[_0x6ef1('0x22')](function(_0x3327a7){if(_0x3327a7){_0x5a17f9[_0x6ef1('0x41')][_0x6ef1('0x49')]=_0x3327a7['id'];_0x5a17f9['body']['Subjects']=integrations[_0x6ef1('0x4a')](_0x5a17f9[_0x6ef1('0x41')][_0x6ef1('0x4b')],_0x5a17f9[_0x6ef1('0x41')][_0x6ef1('0x27')]);_0x5a17f9[_0x6ef1('0x41')][_0x6ef1('0x4c')]=integrations[_0x6ef1('0x4d')](_0x5a17f9[_0x6ef1('0x41')][_0x6ef1('0x4b')],_0x5a17f9['body']['type']);return db[_0x6ef1('0x45')]['create'](_0x5a17f9['body'],{'include':[{'model':db[_0x6ef1('0x4e')],'as':_0x6ef1('0x4f')},{'model':db[_0x6ef1('0x4e')],'as':_0x6ef1('0x4c')}]});}return null;})[_0x6ef1('0x22')](respondWithResult(_0x24e822,null))[_0x6ef1('0x3d')](handleError(_0x24e822,null));};exports[_0x6ef1('0x50')]=function(_0x46ba88,_0x29c487,_0x49661d){var _0xe819f='';var _0x39da98='';return db['FreshsalesAccount'][_0x6ef1('0x44')]({'where':{'id':_0x46ba88[_0x6ef1('0x43')]['id']},'attributes':['id',_0x6ef1('0x51'),_0x6ef1('0x52'),_0x6ef1('0x53')]})[_0x6ef1('0x22')](handleEntityNotFound(_0x29c487,null))[_0x6ef1('0x22')](function(_0x2d2ef2){if(_0x2d2ef2){_0x39da98=_0x2d2ef2[_0x6ef1('0x51')];_0xe819f=_0x2d2ef2[_0x6ef1('0x52')];var _0x1d34d2=_0x2d2ef2[_0x6ef1('0x52')][_0x6ef1('0x54')](-0x1);if(_0x1d34d2==='/'){_0xe819f=_0xe819f[_0x6ef1('0x55')](0x0,_0xe819f[_0x6ef1('0x56')](_0x1d34d2));}return rp({'method':_0x6ef1('0x57'),'uri':util[_0x6ef1('0x58')](_0x6ef1('0x59'),_0xe819f,_0x6ef1('0x5a')),'headers':{'Authorization':_0x6ef1('0x5b')+_0x2d2ef2[_0x6ef1('0x53')]},'json':!![]});}})[_0x6ef1('0x22')](function(_0x219035){if(_0x219035){var _0x3e1f29=_0x219035[_0x6ef1('0x5c')];var _0x8d5a76=![];var _0xba071f=null;for(_0xba071f=0x0;_0xba071f<_0x3e1f29[_0x6ef1('0x3e')];_0xba071f++){if(_0x3e1f29[_0xba071f][_0x6ef1('0x5d')]===_0x39da98){_0x8d5a76=!![];}}if(_0x8d5a76){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x6ef1('0x5e')});}}})[_0x6ef1('0x22')](respondWithResult(_0x29c487,null))['catch'](function(_0x3b3dcf){var _0x47bbb8=_0x46ba88['query'][_0x6ef1('0x5f')]?0x1f4:_0x3b3dcf[_0x6ef1('0x60')]||0x1f4;logger[_0x6ef1('0x61')]('getFields,\x20%s,\x20%s,\x20%s',_0x6ef1('0x50'),_0x47bbb8,JSON[_0x6ef1('0x62')](_0x3b3dcf));delete _0x3b3dcf['name'];if(_0x47bbb8===0x191){_0x47bbb8=0x190;}_0x29c487[_0x6ef1('0x1c')](_0x47bbb8)[_0x6ef1('0x25')](_0x46ba88[_0x6ef1('0x2b')]['test']?{'message':_0x6ef1('0x63'),'statusCode':_0x3b3dcf[_0x6ef1('0x60')]}:_0x3b3dcf);});}; \ No newline at end of file +var _0xcaff=['../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','name','send','index','FreshsalesAccount','rawAttributes','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','merge','options','then','includeAll','include','findAll','rows','catch','find','create','body','params','getConfigurations','filter','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshsalesField','findOne','username','remoteUri','substring','lastIndexOf','format','Token\x20token=','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util'];(function(_0x400672,_0x243a7e){var _0x27ed65=function(_0x350ca9){while(--_0x350ca9){_0x400672['push'](_0x400672['shift']());}};_0x27ed65(++_0x243a7e);}(_0xcaff,0x1bc));var _0xfcaf=function(_0x55ee68,_0x318f37){_0x55ee68=_0x55ee68-0x0;var _0x2da246=_0xcaff[_0x55ee68];return _0x2da246;};'use strict';var emlformat=require(_0xfcaf('0x0'));var rimraf=require(_0xfcaf('0x1'));var zipdir=require(_0xfcaf('0x2'));var jsonpatch=require(_0xfcaf('0x3'));var rp=require('request-promise');var moment=require(_0xfcaf('0x4'));var BPromise=require(_0xfcaf('0x5'));var Mustache=require(_0xfcaf('0x6'));var util=require(_0xfcaf('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xfcaf('0x8'));var ejs=require(_0xfcaf('0x9'));var fs=require('fs');var fs_extra=require(_0xfcaf('0xa'));var _=require(_0xfcaf('0xb'));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(_0xfcaf('0xc'));var Papa=require('papaparse');var Redis=require(_0xfcaf('0xd'));var authService=require(_0xfcaf('0xe'));var qs=require(_0xfcaf('0xf'));var as=require(_0xfcaf('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfcaf('0x11'))(_0xfcaf('0x12'));var utils=require('../../config/utils');var config=require(_0xfcaf('0x13'));var licenseUtil=require(_0xfcaf('0x14'));var db=require(_0xfcaf('0x15'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x2e913a,_0x37979b){_0x37979b=_0x37979b||0xcc;return function(_0x45602d){if(_0x45602d){return _0x2e913a[_0xfcaf('0x16')](_0x37979b);}return _0x2e913a[_0xfcaf('0x17')](_0x37979b)[_0xfcaf('0x18')]();};}function respondWithResult(_0x3dde49,_0xa7fb13){_0xa7fb13=_0xa7fb13||0xc8;return function(_0x2dc281){if(_0x2dc281){return _0x3dde49['status'](_0xa7fb13)[_0xfcaf('0x19')](_0x2dc281);}};}function respondWithFilteredResult(_0x4a9aa4,_0x3fbcf1){return function(_0x4a941d){if(_0x4a941d){var _0x2c2932=typeof _0x3fbcf1[_0xfcaf('0x1a')]===_0xfcaf('0x1b')&&typeof _0x3fbcf1['limit']===_0xfcaf('0x1b');var _0x2c123c=_0x4a941d[_0xfcaf('0x1c')];var _0x37c4de=_0x2c2932?0x0:_0x3fbcf1['offset'];var _0x5ced6b=_0x2c2932?_0x4a941d['count']:_0x3fbcf1[_0xfcaf('0x1a')]+_0x3fbcf1[_0xfcaf('0x1d')];var _0xcc9297;if(_0x5ced6b>=_0x2c123c){_0x5ced6b=_0x2c123c;_0xcc9297=0xc8;}else{_0xcc9297=0xce;}_0x4a9aa4['status'](_0xcc9297);return _0x4a9aa4[_0xfcaf('0x1e')](_0xfcaf('0x1f'),_0x37c4de+'-'+_0x5ced6b+'/'+_0x2c123c)[_0xfcaf('0x19')](_0x4a941d);}return null;};}function patchUpdates(_0x19abc2){return function(_0x49e503){try{jsonpatch[_0xfcaf('0x20')](_0x49e503,_0x19abc2,!![]);}catch(_0xce828){return BPromise[_0xfcaf('0x21')](_0xce828);}return _0x49e503[_0xfcaf('0x22')]();};}function saveUpdates(_0x1f54d2,_0xad6f6e){return function(_0x28d458){if(_0x28d458){return _0x28d458[_0xfcaf('0x23')](_0x1f54d2)['then'](function(_0x5d6bb8){return _0x5d6bb8;});}return null;};}function removeEntity(_0x268e71,_0x10fb3d){return function(_0x2ced89){if(_0x2ced89){return _0x2ced89[_0xfcaf('0x24')]()['then'](function(){_0x268e71[_0xfcaf('0x17')](0xcc)[_0xfcaf('0x18')]();});}};}function handleEntityNotFound(_0x436555,_0x420774){return function(_0x5b3a0c){if(!_0x5b3a0c){_0x436555[_0xfcaf('0x16')](0x194);}return _0x5b3a0c;};}function handleError(_0x535e01,_0x41300d){_0x41300d=_0x41300d||0x1f4;return function(_0x134f6b){logger['error'](_0x134f6b['stack']);if(_0x134f6b[_0xfcaf('0x25')]){delete _0x134f6b[_0xfcaf('0x25')];}_0x535e01[_0xfcaf('0x17')](_0x41300d)[_0xfcaf('0x26')](_0x134f6b);};}exports[_0xfcaf('0x27')]=function(_0x42c792,_0x36eb13){var _0x344289={},_0x586bc6={},_0x121c15={'count':0x0,'rows':[]};var _0x1cc8af=_['map'](db[_0xfcaf('0x28')][_0xfcaf('0x29')],function(_0xefec4a){return{'name':_0xefec4a['fieldName'],'type':_0xefec4a[_0xfcaf('0x2a')][_0xfcaf('0x2b')]};});_0x586bc6[_0xfcaf('0x2c')]=_[_0xfcaf('0x2d')](_0x1cc8af,_0xfcaf('0x25'));_0x586bc6['query']=_[_0xfcaf('0x2e')](_0x42c792[_0xfcaf('0x2f')]);_0x586bc6[_0xfcaf('0x30')]=_[_0xfcaf('0x31')](_0x586bc6[_0xfcaf('0x2c')],_0x586bc6[_0xfcaf('0x2f')]);_0x344289[_0xfcaf('0x32')]=_[_0xfcaf('0x31')](_0x586bc6[_0xfcaf('0x2c')],qs[_0xfcaf('0x33')](_0x42c792[_0xfcaf('0x2f')][_0xfcaf('0x33')]));_0x344289['attributes']=_0x344289[_0xfcaf('0x32')][_0xfcaf('0x34')]?_0x344289['attributes']:_0x586bc6[_0xfcaf('0x2c')];if(!_0x42c792[_0xfcaf('0x2f')][_0xfcaf('0x35')](_0xfcaf('0x36'))){_0x344289[_0xfcaf('0x1d')]=qs[_0xfcaf('0x1d')](_0x42c792['query']['limit']);_0x344289[_0xfcaf('0x1a')]=qs[_0xfcaf('0x1a')](_0x42c792[_0xfcaf('0x2f')]['offset']);}_0x344289[_0xfcaf('0x37')]=qs['sort'](_0x42c792[_0xfcaf('0x2f')][_0xfcaf('0x38')]);_0x344289[_0xfcaf('0x39')]=qs[_0xfcaf('0x30')](_[_0xfcaf('0x3a')](_0x42c792[_0xfcaf('0x2f')],_0x586bc6[_0xfcaf('0x30')]),_0x1cc8af);if(_0x42c792[_0xfcaf('0x2f')]['filter']){_0x344289[_0xfcaf('0x39')]=_['merge'](_0x344289[_0xfcaf('0x39')],{'$or':_[_0xfcaf('0x2d')](_0x1cc8af,function(_0x33352c){if(_0x33352c[_0xfcaf('0x2a')]!==_0xfcaf('0x3b')){var _0x1072f6={};_0x1072f6[_0x33352c[_0xfcaf('0x25')]]={'$like':'%'+_0x42c792['query']['filter']+'%'};return _0x1072f6;}})});}_0x344289=_[_0xfcaf('0x3c')]({},_0x344289,_0x42c792[_0xfcaf('0x3d')]);var _0x157733={'where':_0x344289['where']};return db[_0xfcaf('0x28')][_0xfcaf('0x1c')](_0x157733)[_0xfcaf('0x3e')](function(_0x2f65e5){_0x121c15[_0xfcaf('0x1c')]=_0x2f65e5;if(_0x42c792[_0xfcaf('0x2f')][_0xfcaf('0x3f')]){_0x344289[_0xfcaf('0x40')]=[{'all':!![]}];}return db['FreshsalesAccount'][_0xfcaf('0x41')](_0x344289);})[_0xfcaf('0x3e')](function(_0x3dc8cc){_0x121c15[_0xfcaf('0x42')]=_0x3dc8cc;return _0x121c15;})[_0xfcaf('0x3e')](respondWithFilteredResult(_0x36eb13,_0x344289))[_0xfcaf('0x43')](handleError(_0x36eb13,null));};exports['show']=function(_0x77d251,_0x4b1311){var _0x85cd72={'raw':![],'where':{'id':_0x77d251['params']['id']}},_0x1afa2c={};_0x1afa2c[_0xfcaf('0x2c')]=_['keys'](db[_0xfcaf('0x28')][_0xfcaf('0x29')]);_0x1afa2c['query']=_['keys'](_0x77d251['query']);_0x1afa2c[_0xfcaf('0x30')]=_['intersection'](_0x1afa2c['model'],_0x1afa2c[_0xfcaf('0x2f')]);_0x85cd72['attributes']=_[_0xfcaf('0x31')](_0x1afa2c[_0xfcaf('0x2c')],qs[_0xfcaf('0x33')](_0x77d251['query'][_0xfcaf('0x33')]));_0x85cd72[_0xfcaf('0x32')]=_0x85cd72['attributes'][_0xfcaf('0x34')]?_0x85cd72[_0xfcaf('0x32')]:_0x1afa2c[_0xfcaf('0x2c')];if(_0x77d251[_0xfcaf('0x2f')][_0xfcaf('0x3f')]){_0x85cd72[_0xfcaf('0x40')]=[{'all':!![]}];}_0x85cd72=_[_0xfcaf('0x3c')]({},_0x85cd72,_0x77d251[_0xfcaf('0x3d')]);return db[_0xfcaf('0x28')][_0xfcaf('0x44')](_0x85cd72)['then'](handleEntityNotFound(_0x4b1311,null))[_0xfcaf('0x3e')](respondWithResult(_0x4b1311,null))['catch'](handleError(_0x4b1311,null));};exports[_0xfcaf('0x45')]=function(_0x76fd40,_0x3d1983){return db['FreshsalesAccount'][_0xfcaf('0x45')](_0x76fd40[_0xfcaf('0x46')],{})[_0xfcaf('0x3e')](respondWithResult(_0x3d1983,0xc9))[_0xfcaf('0x43')](handleError(_0x3d1983,null));};exports[_0xfcaf('0x23')]=function(_0x2ea91b,_0x8ed726){if(_0x2ea91b[_0xfcaf('0x46')]['id']){delete _0x2ea91b[_0xfcaf('0x46')]['id'];}return db['FreshsalesAccount'][_0xfcaf('0x44')]({'where':{'id':_0x2ea91b['params']['id']}})[_0xfcaf('0x3e')](handleEntityNotFound(_0x8ed726,null))[_0xfcaf('0x3e')](saveUpdates(_0x2ea91b[_0xfcaf('0x46')],null))[_0xfcaf('0x3e')](respondWithResult(_0x8ed726,null))[_0xfcaf('0x43')](handleError(_0x8ed726,null));};exports[_0xfcaf('0x24')]=function(_0x3a400d,_0x37370a){return db[_0xfcaf('0x28')]['find']({'where':{'id':_0x3a400d[_0xfcaf('0x47')]['id']}})[_0xfcaf('0x3e')](handleEntityNotFound(_0x37370a,null))['then'](removeEntity(_0x37370a,null))['catch'](handleError(_0x37370a,null));};exports[_0xfcaf('0x48')]=function(_0x4d5727,_0x4e57bf,_0x482d1b){var _0x1243ab={};var _0x28b6d8={};var _0x24130b;var _0x4a750b;return db[_0xfcaf('0x28')]['findOne']({'where':{'id':_0x4d5727[_0xfcaf('0x47')]['id']}})[_0xfcaf('0x3e')](handleEntityNotFound(_0x4e57bf,null))[_0xfcaf('0x3e')](function(_0x25b7cc){if(_0x25b7cc){_0x24130b=_0x25b7cc;_0x28b6d8[_0xfcaf('0x2c')]=_[_0xfcaf('0x2e')](db['FreshsalesConfiguration'][_0xfcaf('0x29')]);_0x28b6d8[_0xfcaf('0x2f')]=_['keys'](_0x4d5727[_0xfcaf('0x2f')]);_0x28b6d8[_0xfcaf('0x30')]=_[_0xfcaf('0x31')](_0x28b6d8[_0xfcaf('0x2c')],_0x28b6d8[_0xfcaf('0x2f')]);_0x1243ab[_0xfcaf('0x32')]=_['intersection'](_0x28b6d8['model'],qs['fields'](_0x4d5727['query'][_0xfcaf('0x33')]));_0x1243ab['attributes']=_0x1243ab['attributes']['length']?_0x1243ab[_0xfcaf('0x32')]:_0x28b6d8[_0xfcaf('0x2c')];_0x1243ab[_0xfcaf('0x37')]=qs[_0xfcaf('0x38')](_0x4d5727['query']['sort']);_0x1243ab[_0xfcaf('0x39')]=qs[_0xfcaf('0x30')](_[_0xfcaf('0x3a')](_0x4d5727[_0xfcaf('0x2f')],_0x28b6d8[_0xfcaf('0x30')]));if(_0x4d5727[_0xfcaf('0x2f')][_0xfcaf('0x49')]){_0x1243ab[_0xfcaf('0x39')]=_['merge'](_0x1243ab[_0xfcaf('0x39')],{'$or':_[_0xfcaf('0x2d')](_0x1243ab[_0xfcaf('0x32')],function(_0x1bc7bb){var _0x3786b7={};_0x3786b7[_0x1bc7bb]={'$like':'%'+_0x4d5727[_0xfcaf('0x2f')][_0xfcaf('0x49')]+'%'};return _0x3786b7;})});}_0x1243ab=_[_0xfcaf('0x3c')]({},_0x1243ab,_0x4d5727[_0xfcaf('0x3d')]);return _0x24130b['getConfigurations'](_0x1243ab);}})['then'](function(_0x557405){if(_0x557405){_0x4a750b=_0x557405[_0xfcaf('0x34')];if(!_0x4d5727['query'][_0xfcaf('0x35')](_0xfcaf('0x36'))){_0x1243ab['limit']=qs[_0xfcaf('0x1d')](_0x4d5727[_0xfcaf('0x2f')][_0xfcaf('0x1d')]);_0x1243ab[_0xfcaf('0x1a')]=qs[_0xfcaf('0x1a')](_0x4d5727['query'][_0xfcaf('0x1a')]);}return _0x24130b['getConfigurations'](_0x1243ab);}})[_0xfcaf('0x3e')](function(_0xe11362){if(_0xe11362){return _0xe11362?{'count':_0x4a750b,'rows':_0xe11362}:null;}})['then'](respondWithResult(_0x4e57bf,null))[_0xfcaf('0x43')](handleError(_0x4e57bf,null));};exports['addConfiguration']=function(_0x1f4937,_0x3058d7,_0x3ca40a){if(_0x1f4937[_0xfcaf('0x46')]['id']){delete _0x1f4937[_0xfcaf('0x46')]['id'];}return db[_0xfcaf('0x28')]['findOne']({'where':{'id':_0x1f4937[_0xfcaf('0x47')]['id']}})[_0xfcaf('0x3e')](handleEntityNotFound(_0x3058d7,null))[_0xfcaf('0x3e')](function(_0x5d5d5e){if(_0x5d5d5e){_0x1f4937[_0xfcaf('0x46')][_0xfcaf('0x4a')]=_0x5d5d5e['id'];_0x1f4937[_0xfcaf('0x46')][_0xfcaf('0x4b')]=integrations[_0xfcaf('0x4c')](_0x1f4937['body'][_0xfcaf('0x4d')],_0x1f4937[_0xfcaf('0x46')][_0xfcaf('0x2a')]);_0x1f4937[_0xfcaf('0x46')][_0xfcaf('0x4e')]=integrations[_0xfcaf('0x4f')](_0x1f4937[_0xfcaf('0x46')]['channel'],_0x1f4937[_0xfcaf('0x46')][_0xfcaf('0x2a')]);return db['FreshsalesConfiguration'][_0xfcaf('0x45')](_0x1f4937['body'],{'include':[{'model':db[_0xfcaf('0x50')],'as':'Subjects'},{'model':db[_0xfcaf('0x50')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x3058d7,null))[_0xfcaf('0x43')](handleError(_0x3058d7,null));};exports['getFields']=function(_0x38805d,_0x3255a4,_0x4438a4){var _0x344cd6='';var _0xc367a4='';return db['FreshsalesAccount'][_0xfcaf('0x51')]({'where':{'id':_0x38805d['params']['id']},'attributes':['id',_0xfcaf('0x52'),_0xfcaf('0x53'),'apiKey']})[_0xfcaf('0x3e')](handleEntityNotFound(_0x3255a4,null))['then'](function(_0x339b03){if(_0x339b03){_0xc367a4=_0x339b03[_0xfcaf('0x52')];_0x344cd6=_0x339b03[_0xfcaf('0x53')];var _0x57d507=_0x339b03['remoteUri']['slice'](-0x1);if(_0x57d507==='/'){_0x344cd6=_0x344cd6[_0xfcaf('0x54')](0x0,_0x344cd6[_0xfcaf('0x55')](_0x57d507));}return rp({'method':'GET','uri':util[_0xfcaf('0x56')]('%s%s',_0x344cd6,'/api/selector/owners'),'headers':{'Authorization':_0xfcaf('0x57')+_0x339b03['apiKey']},'json':!![]});}})['then'](function(_0x15b40c){if(_0x15b40c){var _0x1a873e=_0x15b40c['users'];var _0x4833ab=![];var _0x139535=null;for(_0x139535=0x0;_0x139535<_0x1a873e[_0xfcaf('0x34')];_0x139535++){if(_0x1a873e[_0x139535]['email']===_0xc367a4){_0x4833ab=!![];}}if(_0x4833ab){return!![];}else{throw new Error({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}})[_0xfcaf('0x3e')](respondWithResult(_0x3255a4,null))['catch'](function(_0x1d8f01){var _0x5a2314=_0x38805d[_0xfcaf('0x2f')][_0xfcaf('0x58')]?0x1f4:_0x1d8f01[_0xfcaf('0x59')]||0x1f4;logger['error'](_0xfcaf('0x5a'),'getFields',_0x5a2314,JSON[_0xfcaf('0x5b')](_0x1d8f01));delete _0x1d8f01[_0xfcaf('0x25')];if(_0x5a2314===0x191){_0x5a2314=0x190;}_0x3255a4[_0xfcaf('0x17')](_0x5a2314)['send'](_0x38805d[_0xfcaf('0x2f')][_0xfcaf('0x58')]?{'message':_0xfcaf('0x5c'),'statusCode':_0x1d8f01[_0xfcaf('0x59')]}:_0x1d8f01);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index aaf54ca..053a271 100644 --- a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js +++ b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5464=['int_freshsales_accounts','lodash','util','../../config/logger','moment','request-promise','rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','define','FreshsalesAccount'];(function(_0x559682,_0x2a95d2){var _0x3bc0fc=function(_0x4e859e){while(--_0x4e859e){_0x559682['push'](_0x559682['shift']());}};_0x3bc0fc(++_0x2a95d2);}(_0x5464,0x15d));var _0x4546=function(_0xdf4043,_0xc3d5f3){_0xdf4043=_0xdf4043-0x0;var _0x30c5c2=_0x5464[_0xdf4043];return _0x30c5c2;};'use strict';var _=require(_0x4546('0x0'));var util=require(_0x4546('0x1'));var logger=require(_0x4546('0x2'))('api');var moment=require(_0x4546('0x3'));var BPromise=require('bluebird');var rp=require(_0x4546('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4546('0x5'));var config=require(_0x4546('0x6'));var attributes=require(_0x4546('0x7'));var integrations=require(_0x4546('0x8'));module['exports']=function(_0x57391f,_0x5c5e09){return _0x57391f[_0x4546('0x9')](_0x4546('0xa'),attributes,{'tableName':_0x4546('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5430=['../../components/integrations/configuration','exports','define','int_freshsales_accounts','lodash','util','../../config/logger','api','moment','bluebird','rimraf'];(function(_0x1314d4,_0xb0b16d){var _0x584ba5=function(_0x394269){while(--_0x394269){_0x1314d4['push'](_0x1314d4['shift']());}};_0x584ba5(++_0xb0b16d);}(_0x5430,0x10c));var _0x0543=function(_0x4e1670,_0x18122c){_0x4e1670=_0x4e1670-0x0;var _0x560bf6=_0x5430[_0x4e1670];return _0x560bf6;};'use strict';var _=require(_0x0543('0x0'));var util=require(_0x0543('0x1'));var logger=require(_0x0543('0x2'))(_0x0543('0x3'));var moment=require(_0x0543('0x4'));var BPromise=require(_0x0543('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0543('0x6'));var config=require('../../config/environment');var attributes=require('./intFreshsalesAccount.attributes');var integrations=require(_0x0543('0x7'));module[_0x0543('0x8')]=function(_0x9754ba,_0x319568){return _0x9754ba[_0x0543('0x9')]('FreshsalesAccount',attributes,{'tableName':_0x0543('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js index 3827bba..2c3c74e 100644 --- a/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js +++ b/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1a85=['info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFreshsalesAccount','FreshsalesAccount','options','raw','where','limit','include','model','map','attributes','then','ShowFreshsalesAccount','find','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','http'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x1a85,0x178));var _0x51a8=function(_0x91e5da,_0x25ce34){_0x91e5da=_0x91e5da-0x0;var _0x5533f3=_0x1a85[_0x91e5da];return _0x5533f3;};'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')]('FreshsalesAccount,\x20%s,\x20%s',_0x331117,_0x3e0603);_0x228c64(_0x3e0603);});});}exports[_0x51a8('0x13')]=function(_0x45a433){var _0xd52230=this;return new Promise(function(_0x23539e,_0x3bc1a2){return db[_0x51a8('0x14')]['findAll']({'raw':_0x45a433[_0x51a8('0x15')]?_0x45a433[_0x51a8('0x15')][_0x51a8('0x16')]===undefined?!![]:![]:!![],'where':_0x45a433[_0x51a8('0x15')]?_0x45a433[_0x51a8('0x15')][_0x51a8('0x17')]||null:null,'attributes':_0x45a433[_0x51a8('0x15')]?_0x45a433[_0x51a8('0x15')]['attributes']||null:null,'limit':_0x45a433[_0x51a8('0x15')]?_0x45a433['options'][_0x51a8('0x18')]||null:null,'include':_0x45a433[_0x51a8('0x15')]?_0x45a433[_0x51a8('0x15')][_0x51a8('0x19')]?_['map'](_0x45a433[_0x51a8('0x15')]['include'],function(_0x47f063){return{'model':db[_0x47f063[_0x51a8('0x1a')]],'as':_0x47f063['as'],'attributes':_0x47f063['attributes'],'include':_0x47f063[_0x51a8('0x19')]?_[_0x51a8('0x1b')](_0x47f063[_0x51a8('0x19')],function(_0x18e2f3){return{'model':db[_0x18e2f3[_0x51a8('0x1a')]],'as':_0x18e2f3['as'],'attributes':_0x18e2f3[_0x51a8('0x1c')],'include':_0x18e2f3[_0x51a8('0x19')]?_[_0x51a8('0x1b')](_0x18e2f3['include'],function(_0x273ce2){return{'model':db[_0x273ce2[_0x51a8('0x1a')]],'as':_0x273ce2['as'],'attributes':_0x273ce2[_0x51a8('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x51a8('0x1d')](function(_0x1c150d){logger[_0x51a8('0x8')](_0x51a8('0x13'),_0x45a433);logger[_0x51a8('0xb')](_0x51a8('0x13'),_0x45a433,JSON[_0x51a8('0xd')](_0x1c150d));_0x23539e(_0x1c150d);})[_0x51a8('0x12')](function(_0x347a02){logger['error'](_0x51a8('0x13'),_0x347a02['message'],_0x45a433);_0x3bc1a2(_0xd52230[_0x51a8('0xe')](0x1f4,_0x347a02[_0x51a8('0x10')]));});});};exports[_0x51a8('0x1e')]=function(_0x41df56){var _0x2136b4=this;return new Promise(function(_0x4ea271,_0x10c19b){return db['FreshsalesAccount'][_0x51a8('0x1f')]({'raw':_0x41df56[_0x51a8('0x15')]?_0x41df56[_0x51a8('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x41df56[_0x51a8('0x15')]?_0x41df56['options'][_0x51a8('0x17')]||null:null,'attributes':_0x41df56[_0x51a8('0x15')]?_0x41df56[_0x51a8('0x15')][_0x51a8('0x1c')]||null:null,'include':_0x41df56[_0x51a8('0x15')]?_0x41df56['options'][_0x51a8('0x19')]?_['map'](_0x41df56[_0x51a8('0x15')][_0x51a8('0x19')],function(_0x41561a){return{'model':db[_0x41561a['model']],'as':_0x41561a['as'],'attributes':_0x41561a[_0x51a8('0x1c')],'include':_0x41561a[_0x51a8('0x19')]?_[_0x51a8('0x1b')](_0x41561a[_0x51a8('0x19')],function(_0x41c020){return{'model':db[_0x41c020['model']],'as':_0x41c020['as'],'attributes':_0x41c020['attributes'],'include':_0x41c020['include']?_[_0x51a8('0x1b')](_0x41c020[_0x51a8('0x19')],function(_0x4ec1db){return{'model':db[_0x4ec1db[_0x51a8('0x1a')]],'as':_0x4ec1db['as'],'attributes':_0x4ec1db['attributes']};}):[]};}):[]};}):[]:[]})[_0x51a8('0x1d')](function(_0x38aa25){logger[_0x51a8('0x8')](_0x51a8('0x1e'),_0x41df56);logger[_0x51a8('0xb')](_0x51a8('0x1e'),_0x41df56,JSON['stringify'](_0x38aa25));_0x4ea271(_0x38aa25);})['catch'](function(_0x377b4c){logger['error']('ShowFreshsalesAccount',_0x377b4c['message'],_0x41df56);_0x10c19b(_0x2136b4[_0x51a8('0xe')](0x1f4,_0x377b4c[_0x51a8('0x10')]));});});}; \ No newline at end of file +var _0x9f0e=['moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','raw','limit','include','map','model','attributes','ShowFreshsalesAccount','find','where','lodash','util'];(function(_0x565b93,_0x12c8b8){var _0x84c5ec=function(_0x30327a){while(--_0x30327a){_0x565b93['push'](_0x565b93['shift']());}};_0x84c5ec(++_0x12c8b8);}(_0x9f0e,0x116));var _0xe9f0=function(_0x155a5a,_0x3668f2){_0x155a5a=_0x155a5a-0x0;var _0x473736=_0x9f0e[_0x155a5a];return _0x473736;};'use strict';var _=require(_0xe9f0('0x0'));var util=require(_0xe9f0('0x1'));var moment=require(_0xe9f0('0x2'));var BPromise=require(_0xe9f0('0x3'));var rs=require(_0xe9f0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe9f0('0x5'));var logger=require(_0xe9f0('0x6'))(_0xe9f0('0x7'));var config=require(_0xe9f0('0x8'));var jayson=require(_0xe9f0('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3a17b3,_0x167198,_0xe64a79){return new BPromise(function(_0x4be6a6,_0xf4a256){return client[_0xe9f0('0xa')](_0x3a17b3,_0xe64a79)[_0xe9f0('0xb')](function(_0x3386a8){logger[_0xe9f0('0xc')](_0xe9f0('0xd'),_0x167198,_0xe9f0('0xe'));logger[_0xe9f0('0xf')](_0xe9f0('0x10'),_0x167198,'request\x20sent',JSON[_0xe9f0('0x11')](_0x3386a8));if(_0x3386a8[_0xe9f0('0x12')]){if(_0x3386a8[_0xe9f0('0x12')]['code']===0x1f4){logger[_0xe9f0('0x12')]('FreshsalesAccount,\x20%s,\x20%s',_0x167198,_0x3386a8[_0xe9f0('0x12')][_0xe9f0('0x13')]);return _0xf4a256(_0x3386a8[_0xe9f0('0x12')][_0xe9f0('0x13')]);}logger['error'](_0xe9f0('0xd'),_0x167198,_0x3386a8['error'][_0xe9f0('0x13')]);return _0x4be6a6(_0x3386a8[_0xe9f0('0x12')][_0xe9f0('0x13')]);}else{logger['info'](_0xe9f0('0xd'),_0x167198,_0xe9f0('0xe'));_0x4be6a6(_0x3386a8[_0xe9f0('0x14')]['message']);}})[_0xe9f0('0x15')](function(_0x1e16e0){logger[_0xe9f0('0x12')](_0xe9f0('0xd'),_0x167198,_0x1e16e0);_0xf4a256(_0x1e16e0);});});}exports[_0xe9f0('0x16')]=function(_0x2ab12b){var _0x3da237=this;return new Promise(function(_0x59bf5a,_0x15a33b){return db[_0xe9f0('0x17')][_0xe9f0('0x18')]({'raw':_0x2ab12b['options']?_0x2ab12b[_0xe9f0('0x19')][_0xe9f0('0x1a')]===undefined?!![]:![]:!![],'where':_0x2ab12b[_0xe9f0('0x19')]?_0x2ab12b[_0xe9f0('0x19')]['where']||null:null,'attributes':_0x2ab12b[_0xe9f0('0x19')]?_0x2ab12b[_0xe9f0('0x19')]['attributes']||null:null,'limit':_0x2ab12b['options']?_0x2ab12b['options'][_0xe9f0('0x1b')]||null:null,'include':_0x2ab12b[_0xe9f0('0x19')]?_0x2ab12b[_0xe9f0('0x19')][_0xe9f0('0x1c')]?_[_0xe9f0('0x1d')](_0x2ab12b['options'][_0xe9f0('0x1c')],function(_0x38b7ee){return{'model':db[_0x38b7ee[_0xe9f0('0x1e')]],'as':_0x38b7ee['as'],'attributes':_0x38b7ee[_0xe9f0('0x1f')],'include':_0x38b7ee[_0xe9f0('0x1c')]?_[_0xe9f0('0x1d')](_0x38b7ee[_0xe9f0('0x1c')],function(_0x1321bb){return{'model':db[_0x1321bb[_0xe9f0('0x1e')]],'as':_0x1321bb['as'],'attributes':_0x1321bb[_0xe9f0('0x1f')],'include':_0x1321bb['include']?_[_0xe9f0('0x1d')](_0x1321bb[_0xe9f0('0x1c')],function(_0x2ddfba){return{'model':db[_0x2ddfba[_0xe9f0('0x1e')]],'as':_0x2ddfba['as'],'attributes':_0x2ddfba['attributes']};}):[]};}):[]};}):[]:[]})[_0xe9f0('0xb')](function(_0x2613fd){logger[_0xe9f0('0xc')](_0xe9f0('0x16'),_0x2ab12b);logger[_0xe9f0('0xf')]('GetFreshsalesAccount',_0x2ab12b,JSON[_0xe9f0('0x11')](_0x2613fd));_0x59bf5a(_0x2613fd);})[_0xe9f0('0x15')](function(_0x44fb5b){logger[_0xe9f0('0x12')](_0xe9f0('0x16'),_0x44fb5b[_0xe9f0('0x13')],_0x2ab12b);_0x15a33b(_0x3da237[_0xe9f0('0x12')](0x1f4,_0x44fb5b[_0xe9f0('0x13')]));});});};exports[_0xe9f0('0x20')]=function(_0x3dbe49){var _0x22806c=this;return new Promise(function(_0x617ad3,_0x445ad0){return db[_0xe9f0('0x17')][_0xe9f0('0x21')]({'raw':_0x3dbe49[_0xe9f0('0x19')]?_0x3dbe49[_0xe9f0('0x19')][_0xe9f0('0x1a')]===undefined?!![]:![]:!![],'where':_0x3dbe49[_0xe9f0('0x19')]?_0x3dbe49[_0xe9f0('0x19')][_0xe9f0('0x22')]||null:null,'attributes':_0x3dbe49[_0xe9f0('0x19')]?_0x3dbe49[_0xe9f0('0x19')][_0xe9f0('0x1f')]||null:null,'include':_0x3dbe49['options']?_0x3dbe49['options']['include']?_[_0xe9f0('0x1d')](_0x3dbe49['options'][_0xe9f0('0x1c')],function(_0xc5fa13){return{'model':db[_0xc5fa13['model']],'as':_0xc5fa13['as'],'attributes':_0xc5fa13[_0xe9f0('0x1f')],'include':_0xc5fa13['include']?_['map'](_0xc5fa13['include'],function(_0x165440){return{'model':db[_0x165440[_0xe9f0('0x1e')]],'as':_0x165440['as'],'attributes':_0x165440['attributes'],'include':_0x165440[_0xe9f0('0x1c')]?_[_0xe9f0('0x1d')](_0x165440[_0xe9f0('0x1c')],function(_0x4d4186){return{'model':db[_0x4d4186['model']],'as':_0x4d4186['as'],'attributes':_0x4d4186[_0xe9f0('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xe9f0('0xb')](function(_0x1917c8){logger['info'](_0xe9f0('0x20'),_0x3dbe49);logger[_0xe9f0('0xf')](_0xe9f0('0x20'),_0x3dbe49,JSON[_0xe9f0('0x11')](_0x1917c8));_0x617ad3(_0x1917c8);})[_0xe9f0('0x15')](function(_0x552ec2){logger[_0xe9f0('0x12')](_0xe9f0('0x20'),_0x552ec2[_0xe9f0('0x13')],_0x3dbe49);_0x445ad0(_0x22806c['error'](0x1f4,_0x552ec2[_0xe9f0('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index 5792475..8bd46fd 100644 --- a/server/api/intFreshsalesConfiguration/index.js +++ b/server/api/intFreshsalesConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb22e=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','/:id','show','getSubjects','/:id/descriptions','/:id/fields','getFields','post','create','put','delete','destroy'];(function(_0x274939,_0x2a2cb8){var _0x28478e=function(_0x1ffecb){while(--_0x1ffecb){_0x274939['push'](_0x274939['shift']());}};_0x28478e(++_0x2a2cb8);}(_0xb22e,0x1c8));var _0xeb22=function(_0x131911,_0x5dd8d6){_0x131911=_0x131911-0x0;var _0x5c891a=_0xb22e[_0x131911];return _0x5c891a;};'use strict';var multer=require('multer');var util=require(_0xeb22('0x0'));var path=require(_0xeb22('0x1'));var timeout=require(_0xeb22('0x2'));var express=require(_0xeb22('0x3'));var router=express[_0xeb22('0x4')]();var fs_extra=require(_0xeb22('0x5'));var auth=require(_0xeb22('0x6'));var interaction=require(_0xeb22('0x7'));var config=require(_0xeb22('0x8'));var controller=require(_0xeb22('0x9'));router[_0xeb22('0xa')]('/',auth[_0xeb22('0xb')](),controller[_0xeb22('0xc')]);router[_0xeb22('0xa')](_0xeb22('0xd'),auth[_0xeb22('0xb')](),controller[_0xeb22('0xe')]);router[_0xeb22('0xa')]('/:id/subjects',auth[_0xeb22('0xb')](),controller[_0xeb22('0xf')]);router[_0xeb22('0xa')](_0xeb22('0x10'),auth[_0xeb22('0xb')](),controller['getDescriptions']);router[_0xeb22('0xa')](_0xeb22('0x11'),auth[_0xeb22('0xb')](),controller[_0xeb22('0x12')]);router[_0xeb22('0x13')]('/',auth[_0xeb22('0xb')](),controller[_0xeb22('0x14')]);router[_0xeb22('0x15')]('/:id',auth[_0xeb22('0xb')](),controller['update']);router[_0xeb22('0x16')]('/:id',auth[_0xeb22('0xb')](),controller[_0xeb22('0x17')]);module['exports']=router; \ No newline at end of file +var _0x0fea=['create','put','update','exports','multer','util','path','connect-timeout','../../config/environment','get','index','/:id','isAuthenticated','show','/:id/subjects','getSubjects','/:id/descriptions','getFields'];(function(_0x381379,_0x3f3b86){var _0x3e1063=function(_0x4c282d){while(--_0x4c282d){_0x381379['push'](_0x381379['shift']());}};_0x3e1063(++_0x3f3b86);}(_0x0fea,0x15a));var _0xa0fe=function(_0x5de818,_0x7c4485){_0x5de818=_0x5de818-0x0;var _0x345670=_0x0fea[_0x5de818];return _0x345670;};'use strict';var multer=require(_0xa0fe('0x0'));var util=require(_0xa0fe('0x1'));var path=require(_0xa0fe('0x2'));var timeout=require(_0xa0fe('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xa0fe('0x4'));var controller=require('./intFreshsalesConfiguration.controller');router[_0xa0fe('0x5')]('/',auth['isAuthenticated'](),controller[_0xa0fe('0x6')]);router['get'](_0xa0fe('0x7'),auth[_0xa0fe('0x8')](),controller[_0xa0fe('0x9')]);router[_0xa0fe('0x5')](_0xa0fe('0xa'),auth[_0xa0fe('0x8')](),controller[_0xa0fe('0xb')]);router[_0xa0fe('0x5')](_0xa0fe('0xc'),auth[_0xa0fe('0x8')](),controller['getDescriptions']);router[_0xa0fe('0x5')]('/:id/fields',auth[_0xa0fe('0x8')](),controller[_0xa0fe('0xd')]);router['post']('/',auth[_0xa0fe('0x8')](),controller[_0xa0fe('0xe')]);router[_0xa0fe('0xf')](_0xa0fe('0x7'),auth[_0xa0fe('0x8')](),controller[_0xa0fe('0x10')]);router['delete'](_0xa0fe('0x7'),auth[_0xa0fe('0x8')](),controller['destroy']);module[_0xa0fe('0x11')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index ce3a3ed..a732516 100644 --- a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js +++ b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3c2f=['STRING','sequelize','exports'];(function(_0x10b48a,_0x1a0a3f){var _0x2c4533=function(_0x5e4be6){while(--_0x5e4be6){_0x10b48a['push'](_0x10b48a['shift']());}};_0x2c4533(++_0x1a0a3f);}(_0x3c2f,0x1ab));var _0xf3c2=function(_0x246227,_0x12bfcb){_0x246227=_0x246227-0x0;var _0x37bd4a=_0x3c2f[_0x246227];return _0x37bd4a;};'use strict';var Sequelize=require(_0xf3c2('0x0'));module[_0xf3c2('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xf3c2('0x2')]}}; \ No newline at end of file +var _0x37ef=['sequelize','exports','STRING'];(function(_0x3da934,_0x4839d1){var _0x531b08=function(_0x51985f){while(--_0x51985f){_0x3da934['push'](_0x3da934['shift']());}};_0x531b08(++_0x4839d1);}(_0x37ef,0x141));var _0xf37e=function(_0x5143ed,_0x25b2e2){_0x5143ed=_0x5143ed-0x0;var _0x5dc173=_0x37ef[_0x5143ed];return _0x5dc173;};'use strict';var Sequelize=require(_0xf37e('0x0'));module[_0xf37e('0x1')]={'name':{'type':Sequelize[_0xf37e('0x2')]},'description':{'type':Sequelize[_0xf37e('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index 187ee22..c06df1e 100644 --- a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js +++ b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe893=['Content-Range','apply','reject','save','update','then','end','error','stack','name','map','FreshsalesConfiguration','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','where','filter','merge','options','includeAll','include','rows','catch','show','params','find','create','body','destroy','getSubjects','findOne','sort','pick','hasOwnProperty','getDescriptions','FreshsalesField','getFields','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','count','limit','set'];(function(_0x4ac75f,_0x468e7b){var _0x287fc7=function(_0x523116){while(--_0x523116){_0x4ac75f['push'](_0x4ac75f['shift']());}};_0x287fc7(++_0x468e7b);}(_0xe893,0x110));var _0x3e89=function(_0x2181e0,_0x165371){_0x2181e0=_0x2181e0-0x0;var _0x10137e=_0xe893[_0x2181e0];return _0x10137e;};'use strict';var emlformat=require(_0x3e89('0x0'));var rimraf=require(_0x3e89('0x1'));var zipdir=require(_0x3e89('0x2'));var jsonpatch=require(_0x3e89('0x3'));var rp=require(_0x3e89('0x4'));var moment=require(_0x3e89('0x5'));var BPromise=require(_0x3e89('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x3e89('0x7'));var sox=require(_0x3e89('0x8'));var csv=require(_0x3e89('0x9'));var ejs=require(_0x3e89('0xa'));var fs=require('fs');var fs_extra=require(_0x3e89('0xb'));var _=require(_0x3e89('0xc'));var squel=require('squel');var crypto=require(_0x3e89('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x3e89('0xe'));var toCsv=require(_0x3e89('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3e89('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3e89('0x10'));var logger=require(_0x3e89('0x11'))('api');var utils=require(_0x3e89('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x3e89('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x43bf86,_0xe4e749){_0xe4e749=_0xe4e749||0xcc;return function(_0xb05caa){if(_0xb05caa){return _0x43bf86[_0x3e89('0x14')](_0xe4e749);}return _0x43bf86[_0x3e89('0x15')](_0xe4e749)['end']();};}function respondWithResult(_0x354b71,_0xe44bd9){_0xe44bd9=_0xe44bd9||0xc8;return function(_0x4852df){if(_0x4852df){return _0x354b71[_0x3e89('0x15')](_0xe44bd9)[_0x3e89('0x16')](_0x4852df);}};}function respondWithFilteredResult(_0x28321a,_0x46af96){return function(_0x20c7a4){if(_0x20c7a4){var _0x3cd11f=typeof _0x46af96[_0x3e89('0x17')]===_0x3e89('0x18')&&typeof _0x46af96['limit']===_0x3e89('0x18');var _0xb20dc5=_0x20c7a4['count'];var _0x255af7=_0x3cd11f?0x0:_0x46af96[_0x3e89('0x17')];var _0x4e9c32=_0x3cd11f?_0x20c7a4[_0x3e89('0x19')]:_0x46af96['offset']+_0x46af96[_0x3e89('0x1a')];var _0x3a7d06;if(_0x4e9c32>=_0xb20dc5){_0x4e9c32=_0xb20dc5;_0x3a7d06=0xc8;}else{_0x3a7d06=0xce;}_0x28321a[_0x3e89('0x15')](_0x3a7d06);return _0x28321a[_0x3e89('0x1b')](_0x3e89('0x1c'),_0x255af7+'-'+_0x4e9c32+'/'+_0xb20dc5)[_0x3e89('0x16')](_0x20c7a4);}return null;};}function patchUpdates(_0x21f8ea){return function(_0x1e467d){try{jsonpatch[_0x3e89('0x1d')](_0x1e467d,_0x21f8ea,!![]);}catch(_0x2d3888){return BPromise[_0x3e89('0x1e')](_0x2d3888);}return _0x1e467d[_0x3e89('0x1f')]();};}function saveUpdates(_0x193405,_0x200954){return function(_0xcf9ce3){if(_0xcf9ce3){return _0xcf9ce3[_0x3e89('0x20')](_0x193405)[_0x3e89('0x21')](function(_0x7967d4){return _0x7967d4;});}return null;};}function removeEntity(_0x3a17c6,_0x192e8f){return function(_0x16a6b2){if(_0x16a6b2){return _0x16a6b2['destroy']()[_0x3e89('0x21')](function(){_0x3a17c6[_0x3e89('0x15')](0xcc)[_0x3e89('0x22')]();});}};}function handleEntityNotFound(_0x1d4010,_0x125c59){return function(_0x21c8fb){if(!_0x21c8fb){_0x1d4010['sendStatus'](0x194);}return _0x21c8fb;};}function handleError(_0x3506d0,_0x35edd5){_0x35edd5=_0x35edd5||0x1f4;return function(_0x3611a2){logger[_0x3e89('0x23')](_0x3611a2[_0x3e89('0x24')]);if(_0x3611a2[_0x3e89('0x25')]){delete _0x3611a2[_0x3e89('0x25')];}_0x3506d0[_0x3e89('0x15')](_0x35edd5)['send'](_0x3611a2);};}exports['index']=function(_0x86ebc,_0xb6377a){var _0x13db2a={},_0xbe6d3b={},_0x10a56f={'count':0x0,'rows':[]};var _0x4b49fc=_[_0x3e89('0x26')](db[_0x3e89('0x27')][_0x3e89('0x28')],function(_0x60f089){return{'name':_0x60f089[_0x3e89('0x29')],'type':_0x60f089[_0x3e89('0x2a')]['key']};});_0xbe6d3b[_0x3e89('0x2b')]=_['map'](_0x4b49fc,_0x3e89('0x25'));_0xbe6d3b[_0x3e89('0x2c')]=_[_0x3e89('0x2d')](_0x86ebc[_0x3e89('0x2c')]);_0xbe6d3b[_0x3e89('0x2e')]=_[_0x3e89('0x2f')](_0xbe6d3b['model'],_0xbe6d3b[_0x3e89('0x2c')]);_0x13db2a[_0x3e89('0x30')]=_[_0x3e89('0x2f')](_0xbe6d3b[_0x3e89('0x2b')],qs[_0x3e89('0x31')](_0x86ebc[_0x3e89('0x2c')]['fields']));_0x13db2a['attributes']=_0x13db2a[_0x3e89('0x30')][_0x3e89('0x32')]?_0x13db2a[_0x3e89('0x30')]:_0xbe6d3b[_0x3e89('0x2b')];if(!_0x86ebc[_0x3e89('0x2c')]['hasOwnProperty'](_0x3e89('0x33'))){_0x13db2a[_0x3e89('0x1a')]=qs[_0x3e89('0x1a')](_0x86ebc[_0x3e89('0x2c')][_0x3e89('0x1a')]);_0x13db2a['offset']=qs[_0x3e89('0x17')](_0x86ebc[_0x3e89('0x2c')][_0x3e89('0x17')]);}_0x13db2a[_0x3e89('0x34')]=qs['sort'](_0x86ebc['query']['sort']);_0x13db2a[_0x3e89('0x35')]=qs[_0x3e89('0x2e')](_['pick'](_0x86ebc['query'],_0xbe6d3b[_0x3e89('0x2e')]),_0x4b49fc);if(_0x86ebc['query']['filter']){_0x13db2a[_0x3e89('0x35')]=_['merge'](_0x13db2a['where'],{'$or':_[_0x3e89('0x26')](_0x4b49fc,function(_0x5b5af9){if(_0x5b5af9['type']!=='VIRTUAL'){var _0x49855e={};_0x49855e[_0x5b5af9[_0x3e89('0x25')]]={'$like':'%'+_0x86ebc[_0x3e89('0x2c')][_0x3e89('0x36')]+'%'};return _0x49855e;}})});}_0x13db2a=_[_0x3e89('0x37')]({},_0x13db2a,_0x86ebc[_0x3e89('0x38')]);var _0x5379d2={'where':_0x13db2a[_0x3e89('0x35')]};return db[_0x3e89('0x27')][_0x3e89('0x19')](_0x5379d2)[_0x3e89('0x21')](function(_0x413617){_0x10a56f[_0x3e89('0x19')]=_0x413617;if(_0x86ebc[_0x3e89('0x2c')][_0x3e89('0x39')]){_0x13db2a[_0x3e89('0x3a')]=[{'all':!![]}];}return db[_0x3e89('0x27')]['findAll'](_0x13db2a);})[_0x3e89('0x21')](function(_0x3bb148){_0x10a56f[_0x3e89('0x3b')]=_0x3bb148;return _0x10a56f;})[_0x3e89('0x21')](respondWithFilteredResult(_0xb6377a,_0x13db2a))[_0x3e89('0x3c')](handleError(_0xb6377a,null));};exports[_0x3e89('0x3d')]=function(_0xa35263,_0x30dae7){var _0xfa9f2={'raw':![],'where':{'id':_0xa35263[_0x3e89('0x3e')]['id']}},_0x583d17={};_0x583d17[_0x3e89('0x2b')]=_['keys'](db[_0x3e89('0x27')][_0x3e89('0x28')]);_0x583d17[_0x3e89('0x2c')]=_[_0x3e89('0x2d')](_0xa35263[_0x3e89('0x2c')]);_0x583d17[_0x3e89('0x2e')]=_[_0x3e89('0x2f')](_0x583d17[_0x3e89('0x2b')],_0x583d17[_0x3e89('0x2c')]);_0xfa9f2[_0x3e89('0x30')]=_['intersection'](_0x583d17['model'],qs[_0x3e89('0x31')](_0xa35263[_0x3e89('0x2c')][_0x3e89('0x31')]));_0xfa9f2['attributes']=_0xfa9f2[_0x3e89('0x30')][_0x3e89('0x32')]?_0xfa9f2['attributes']:_0x583d17[_0x3e89('0x2b')];if(_0xa35263[_0x3e89('0x2c')][_0x3e89('0x39')]){_0xfa9f2['include']=[{'all':!![]}];}_0xfa9f2=_[_0x3e89('0x37')]({},_0xfa9f2,_0xa35263[_0x3e89('0x38')]);return db[_0x3e89('0x27')][_0x3e89('0x3f')](_0xfa9f2)[_0x3e89('0x21')](handleEntityNotFound(_0x30dae7,null))['then'](respondWithResult(_0x30dae7,null))['catch'](handleError(_0x30dae7,null));};exports['create']=function(_0x4c21fe,_0xdb2387){return db['FreshsalesConfiguration'][_0x3e89('0x40')](_0x4c21fe[_0x3e89('0x41')],{})[_0x3e89('0x21')](respondWithResult(_0xdb2387,0xc9))[_0x3e89('0x3c')](handleError(_0xdb2387,null));};exports[_0x3e89('0x20')]=function(_0x1e4216,_0x36bb95){if(_0x1e4216['body']['id']){delete _0x1e4216[_0x3e89('0x41')]['id'];}return db['FreshsalesConfiguration'][_0x3e89('0x3f')]({'where':{'id':_0x1e4216[_0x3e89('0x3e')]['id']}})[_0x3e89('0x21')](handleEntityNotFound(_0x36bb95,null))[_0x3e89('0x21')](saveUpdates(_0x1e4216['body'],null))['then'](respondWithResult(_0x36bb95,null))[_0x3e89('0x3c')](handleError(_0x36bb95,null));};exports[_0x3e89('0x42')]=function(_0x4bb551,_0x477211){return db[_0x3e89('0x27')]['find']({'where':{'id':_0x4bb551[_0x3e89('0x3e')]['id']}})[_0x3e89('0x21')](handleEntityNotFound(_0x477211,null))['then'](removeEntity(_0x477211,null))[_0x3e89('0x3c')](handleError(_0x477211,null));};exports[_0x3e89('0x43')]=function(_0x5d76b4,_0x49f52a,_0x1afa5d){var _0x3981a8={};var _0x4460cc={};var _0x32eeb9;var _0x1e44b4;return db[_0x3e89('0x27')][_0x3e89('0x44')]({'where':{'id':_0x5d76b4[_0x3e89('0x3e')]['id']}})['then'](handleEntityNotFound(_0x49f52a,null))[_0x3e89('0x21')](function(_0x23e69d){if(_0x23e69d){_0x32eeb9=_0x23e69d;_0x4460cc[_0x3e89('0x2b')]=_[_0x3e89('0x2d')](db['FreshsalesField'][_0x3e89('0x28')]);_0x4460cc['query']=_['keys'](_0x5d76b4[_0x3e89('0x2c')]);_0x4460cc[_0x3e89('0x2e')]=_[_0x3e89('0x2f')](_0x4460cc[_0x3e89('0x2b')],_0x4460cc[_0x3e89('0x2c')]);_0x3981a8[_0x3e89('0x30')]=_[_0x3e89('0x2f')](_0x4460cc[_0x3e89('0x2b')],qs[_0x3e89('0x31')](_0x5d76b4[_0x3e89('0x2c')][_0x3e89('0x31')]));_0x3981a8[_0x3e89('0x30')]=_0x3981a8[_0x3e89('0x30')][_0x3e89('0x32')]?_0x3981a8['attributes']:_0x4460cc[_0x3e89('0x2b')];_0x3981a8[_0x3e89('0x34')]=qs[_0x3e89('0x45')](_0x5d76b4[_0x3e89('0x2c')][_0x3e89('0x45')]);_0x3981a8['where']=qs['filters'](_[_0x3e89('0x46')](_0x5d76b4[_0x3e89('0x2c')],_0x4460cc[_0x3e89('0x2e')]));if(_0x5d76b4[_0x3e89('0x2c')][_0x3e89('0x36')]){_0x3981a8[_0x3e89('0x35')]=_[_0x3e89('0x37')](_0x3981a8[_0x3e89('0x35')],{'$or':_['map'](_0x3981a8[_0x3e89('0x30')],function(_0x25b2f0){var _0xb25b32={};_0xb25b32[_0x25b2f0]={'$like':'%'+_0x5d76b4['query'][_0x3e89('0x36')]+'%'};return _0xb25b32;})});}_0x3981a8=_[_0x3e89('0x37')]({},_0x3981a8,_0x5d76b4[_0x3e89('0x38')]);return _0x32eeb9[_0x3e89('0x43')](_0x3981a8);}})[_0x3e89('0x21')](function(_0x565579){if(_0x565579){_0x1e44b4=_0x565579[_0x3e89('0x32')];if(!_0x5d76b4[_0x3e89('0x2c')][_0x3e89('0x47')]('nolimit')){_0x3981a8[_0x3e89('0x1a')]=qs['limit'](_0x5d76b4['query'][_0x3e89('0x1a')]);_0x3981a8['offset']=qs[_0x3e89('0x17')](_0x5d76b4['query'][_0x3e89('0x17')]);}return _0x32eeb9[_0x3e89('0x43')](_0x3981a8);}})['then'](function(_0x2af969){if(_0x2af969){return _0x2af969?{'count':_0x1e44b4,'rows':_0x2af969}:null;}})[_0x3e89('0x21')](respondWithResult(_0x49f52a,null))[_0x3e89('0x3c')](handleError(_0x49f52a,null));};exports[_0x3e89('0x48')]=function(_0x292ea9,_0x1e6f2a,_0x3c207b){var _0x1ab568={};var _0x3e0014={};var _0x53275b;var _0x2474e2;return db[_0x3e89('0x27')][_0x3e89('0x44')]({'where':{'id':_0x292ea9[_0x3e89('0x3e')]['id']}})[_0x3e89('0x21')](handleEntityNotFound(_0x1e6f2a,null))[_0x3e89('0x21')](function(_0x1eb9fa){if(_0x1eb9fa){_0x53275b=_0x1eb9fa;_0x3e0014[_0x3e89('0x2b')]=_[_0x3e89('0x2d')](db[_0x3e89('0x49')][_0x3e89('0x28')]);_0x3e0014[_0x3e89('0x2c')]=_[_0x3e89('0x2d')](_0x292ea9['query']);_0x3e0014['filters']=_['intersection'](_0x3e0014['model'],_0x3e0014[_0x3e89('0x2c')]);_0x1ab568['attributes']=_[_0x3e89('0x2f')](_0x3e0014[_0x3e89('0x2b')],qs['fields'](_0x292ea9['query'][_0x3e89('0x31')]));_0x1ab568['attributes']=_0x1ab568['attributes']['length']?_0x1ab568[_0x3e89('0x30')]:_0x3e0014['model'];_0x1ab568[_0x3e89('0x34')]=qs[_0x3e89('0x45')](_0x292ea9[_0x3e89('0x2c')]['sort']);_0x1ab568[_0x3e89('0x35')]=qs[_0x3e89('0x2e')](_['pick'](_0x292ea9[_0x3e89('0x2c')],_0x3e0014[_0x3e89('0x2e')]));if(_0x292ea9[_0x3e89('0x2c')][_0x3e89('0x36')]){_0x1ab568[_0x3e89('0x35')]=_[_0x3e89('0x37')](_0x1ab568[_0x3e89('0x35')],{'$or':_['map'](_0x1ab568[_0x3e89('0x30')],function(_0x7370b1){var _0x53cc52={};_0x53cc52[_0x7370b1]={'$like':'%'+_0x292ea9[_0x3e89('0x2c')][_0x3e89('0x36')]+'%'};return _0x53cc52;})});}_0x1ab568=_[_0x3e89('0x37')]({},_0x1ab568,_0x292ea9[_0x3e89('0x38')]);return _0x53275b[_0x3e89('0x48')](_0x1ab568);}})['then'](function(_0x57f146){if(_0x57f146){_0x2474e2=_0x57f146[_0x3e89('0x32')];if(!_0x292ea9[_0x3e89('0x2c')][_0x3e89('0x47')](_0x3e89('0x33'))){_0x1ab568['limit']=qs['limit'](_0x292ea9[_0x3e89('0x2c')][_0x3e89('0x1a')]);_0x1ab568[_0x3e89('0x17')]=qs[_0x3e89('0x17')](_0x292ea9[_0x3e89('0x2c')][_0x3e89('0x17')]);}return _0x53275b[_0x3e89('0x48')](_0x1ab568);}})[_0x3e89('0x21')](function(_0x2785a7){if(_0x2785a7){return _0x2785a7?{'count':_0x2474e2,'rows':_0x2785a7}:null;}})[_0x3e89('0x21')](respondWithResult(_0x1e6f2a,null))[_0x3e89('0x3c')](handleError(_0x1e6f2a,null));};exports[_0x3e89('0x4a')]=function(_0x5218e5,_0x3c6690,_0x13a241){var _0x3c73fe={};var _0x59452c={};var _0x3dc6bd;var _0x2912a7;return db[_0x3e89('0x27')]['findOne']({'where':{'id':_0x5218e5['params']['id']}})[_0x3e89('0x21')](handleEntityNotFound(_0x3c6690,null))[_0x3e89('0x21')](function(_0x49fa85){if(_0x49fa85){_0x3dc6bd=_0x49fa85;_0x59452c[_0x3e89('0x2b')]=_[_0x3e89('0x2d')](db[_0x3e89('0x49')][_0x3e89('0x28')]);_0x59452c[_0x3e89('0x2c')]=_[_0x3e89('0x2d')](_0x5218e5[_0x3e89('0x2c')]);_0x59452c[_0x3e89('0x2e')]=_[_0x3e89('0x2f')](_0x59452c[_0x3e89('0x2b')],_0x59452c[_0x3e89('0x2c')]);_0x3c73fe[_0x3e89('0x30')]=_['intersection'](_0x59452c['model'],qs[_0x3e89('0x31')](_0x5218e5[_0x3e89('0x2c')][_0x3e89('0x31')]));_0x3c73fe[_0x3e89('0x30')]=_0x3c73fe[_0x3e89('0x30')][_0x3e89('0x32')]?_0x3c73fe[_0x3e89('0x30')]:_0x59452c[_0x3e89('0x2b')];_0x3c73fe[_0x3e89('0x34')]=qs[_0x3e89('0x45')](_0x5218e5[_0x3e89('0x2c')]['sort']);_0x3c73fe['where']=qs[_0x3e89('0x2e')](_[_0x3e89('0x46')](_0x5218e5['query'],_0x59452c['filters']));if(_0x5218e5['query']['filter']){_0x3c73fe[_0x3e89('0x35')]=_[_0x3e89('0x37')](_0x3c73fe[_0x3e89('0x35')],{'$or':_[_0x3e89('0x26')](_0x3c73fe[_0x3e89('0x30')],function(_0x7d314d){var _0x38ba0f={};_0x38ba0f[_0x7d314d]={'$like':'%'+_0x5218e5[_0x3e89('0x2c')][_0x3e89('0x36')]+'%'};return _0x38ba0f;})});}_0x3c73fe=_[_0x3e89('0x37')]({},_0x3c73fe,_0x5218e5[_0x3e89('0x38')]);return _0x3dc6bd[_0x3e89('0x4a')](_0x3c73fe);}})['then'](function(_0x42f673){if(_0x42f673){_0x2912a7=_0x42f673['length'];if(!_0x5218e5[_0x3e89('0x2c')][_0x3e89('0x47')](_0x3e89('0x33'))){_0x3c73fe[_0x3e89('0x1a')]=qs['limit'](_0x5218e5[_0x3e89('0x2c')]['limit']);_0x3c73fe['offset']=qs[_0x3e89('0x17')](_0x5218e5['query'][_0x3e89('0x17')]);}return _0x3dc6bd[_0x3e89('0x4a')](_0x3c73fe);}})['then'](function(_0xea381b){if(_0xea381b){return _0xea381b?{'count':_0x2912a7,'rows':_0xea381b}:null;}})['then'](respondWithResult(_0x3c6690,null))['catch'](handleError(_0x3c6690,null));}; \ No newline at end of file +var _0xc6ff=['status','limit','undefined','offset','set','Content-Range','json','apply','reject','save','then','destroy','error','stack','name','send','index','FreshsalesConfiguration','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','count','includeAll','include','rows','params','rawAttributes','find','create','body','catch','getSubjects','findOne','FreshsalesField','getDescriptions','getFields','rimraf','zip-dir','fast-json-patch','mustache','path','sox','ejs','fs-extra','lodash','squel','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end'];(function(_0x1c8dc3,_0x54d286){var _0x5a8672=function(_0x4bbb9b){while(--_0x4bbb9b){_0x1c8dc3['push'](_0x1c8dc3['shift']());}};_0x5a8672(++_0x54d286);}(_0xc6ff,0x85));var _0xfc6f=function(_0x4f4ef3,_0x914480){_0x4f4ef3=_0x4f4ef3-0x0;var _0x176439=_0xc6ff[_0x4f4ef3];return _0x176439;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfc6f('0x0'));var zipdir=require(_0xfc6f('0x1'));var jsonpatch=require(_0xfc6f('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xfc6f('0x3'));var util=require('util');var path=require(_0xfc6f('0x4'));var sox=require(_0xfc6f('0x5'));var csv=require('to-csv');var ejs=require(_0xfc6f('0x6'));var fs=require('fs');var fs_extra=require(_0xfc6f('0x7'));var _=require(_0xfc6f('0x8'));var squel=require(_0xfc6f('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xfc6f('0xa'));var querystring=require(_0xfc6f('0xb'));var Papa=require(_0xfc6f('0xc'));var Redis=require(_0xfc6f('0xd'));var authService=require(_0xfc6f('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xfc6f('0xf'));var hardwareService=require(_0xfc6f('0x10'));var logger=require(_0xfc6f('0x11'))('api');var utils=require(_0xfc6f('0x12'));var config=require(_0xfc6f('0x13'));var licenseUtil=require(_0xfc6f('0x14'));var db=require(_0xfc6f('0x15'))['db'];function respondWithStatusCode(_0xcad48d,_0x1fb83e){_0x1fb83e=_0x1fb83e||0xcc;return function(_0x17f0c3){if(_0x17f0c3){return _0xcad48d['sendStatus'](_0x1fb83e);}return _0xcad48d['status'](_0x1fb83e)[_0xfc6f('0x16')]();};}function respondWithResult(_0x2024b3,_0x383cc3){_0x383cc3=_0x383cc3||0xc8;return function(_0x1663df){if(_0x1663df){return _0x2024b3[_0xfc6f('0x17')](_0x383cc3)['json'](_0x1663df);}};}function respondWithFilteredResult(_0x233a6f,_0x472bf6){return function(_0x41955a){if(_0x41955a){var _0x38121c=typeof _0x472bf6['offset']==='undefined'&&typeof _0x472bf6[_0xfc6f('0x18')]===_0xfc6f('0x19');var _0x184862=_0x41955a['count'];var _0x518c5b=_0x38121c?0x0:_0x472bf6['offset'];var _0x239cdc=_0x38121c?_0x41955a['count']:_0x472bf6[_0xfc6f('0x1a')]+_0x472bf6[_0xfc6f('0x18')];var _0x106fe1;if(_0x239cdc>=_0x184862){_0x239cdc=_0x184862;_0x106fe1=0xc8;}else{_0x106fe1=0xce;}_0x233a6f[_0xfc6f('0x17')](_0x106fe1);return _0x233a6f[_0xfc6f('0x1b')](_0xfc6f('0x1c'),_0x518c5b+'-'+_0x239cdc+'/'+_0x184862)[_0xfc6f('0x1d')](_0x41955a);}return null;};}function patchUpdates(_0xa9ee2b){return function(_0x1b512a){try{jsonpatch[_0xfc6f('0x1e')](_0x1b512a,_0xa9ee2b,!![]);}catch(_0x2ac1cc){return BPromise[_0xfc6f('0x1f')](_0x2ac1cc);}return _0x1b512a[_0xfc6f('0x20')]();};}function saveUpdates(_0x3ef917,_0xaa7a2f){return function(_0x172bc5){if(_0x172bc5){return _0x172bc5['update'](_0x3ef917)[_0xfc6f('0x21')](function(_0x1bd3d1){return _0x1bd3d1;});}return null;};}function removeEntity(_0x18b91b,_0x550456){return function(_0x2017d3){if(_0x2017d3){return _0x2017d3[_0xfc6f('0x22')]()['then'](function(){_0x18b91b[_0xfc6f('0x17')](0xcc)[_0xfc6f('0x16')]();});}};}function handleEntityNotFound(_0x354ab1,_0x7e36d0){return function(_0x1b04eb){if(!_0x1b04eb){_0x354ab1['sendStatus'](0x194);}return _0x1b04eb;};}function handleError(_0x1fe205,_0x29a385){_0x29a385=_0x29a385||0x1f4;return function(_0x224ff3){logger[_0xfc6f('0x23')](_0x224ff3[_0xfc6f('0x24')]);if(_0x224ff3['name']){delete _0x224ff3[_0xfc6f('0x25')];}_0x1fe205['status'](_0x29a385)[_0xfc6f('0x26')](_0x224ff3);};}exports[_0xfc6f('0x27')]=function(_0x20db7a,_0x36bc9f){var _0x5a06bc={},_0x46908c={},_0xdce2be={'count':0x0,'rows':[]};var _0x370f25=_['map'](db[_0xfc6f('0x28')]['rawAttributes'],function(_0x462d1a){return{'name':_0x462d1a[_0xfc6f('0x29')],'type':_0x462d1a[_0xfc6f('0x2a')][_0xfc6f('0x2b')]};});_0x46908c[_0xfc6f('0x2c')]=_[_0xfc6f('0x2d')](_0x370f25,'name');_0x46908c[_0xfc6f('0x2e')]=_[_0xfc6f('0x2f')](_0x20db7a['query']);_0x46908c[_0xfc6f('0x30')]=_[_0xfc6f('0x31')](_0x46908c[_0xfc6f('0x2c')],_0x46908c[_0xfc6f('0x2e')]);_0x5a06bc[_0xfc6f('0x32')]=_[_0xfc6f('0x31')](_0x46908c[_0xfc6f('0x2c')],qs[_0xfc6f('0x33')](_0x20db7a[_0xfc6f('0x2e')]['fields']));_0x5a06bc[_0xfc6f('0x32')]=_0x5a06bc[_0xfc6f('0x32')][_0xfc6f('0x34')]?_0x5a06bc[_0xfc6f('0x32')]:_0x46908c[_0xfc6f('0x2c')];if(!_0x20db7a['query'][_0xfc6f('0x35')](_0xfc6f('0x36'))){_0x5a06bc[_0xfc6f('0x18')]=qs[_0xfc6f('0x18')](_0x20db7a[_0xfc6f('0x2e')][_0xfc6f('0x18')]);_0x5a06bc['offset']=qs[_0xfc6f('0x1a')](_0x20db7a[_0xfc6f('0x2e')][_0xfc6f('0x1a')]);}_0x5a06bc[_0xfc6f('0x37')]=qs[_0xfc6f('0x38')](_0x20db7a[_0xfc6f('0x2e')][_0xfc6f('0x38')]);_0x5a06bc['where']=qs['filters'](_[_0xfc6f('0x39')](_0x20db7a[_0xfc6f('0x2e')],_0x46908c[_0xfc6f('0x30')]),_0x370f25);if(_0x20db7a['query']['filter']){_0x5a06bc[_0xfc6f('0x3a')]=_[_0xfc6f('0x3b')](_0x5a06bc[_0xfc6f('0x3a')],{'$or':_[_0xfc6f('0x2d')](_0x370f25,function(_0x3f32de){if(_0x3f32de[_0xfc6f('0x2a')]!==_0xfc6f('0x3c')){var _0x26ee15={};_0x26ee15[_0x3f32de[_0xfc6f('0x25')]]={'$like':'%'+_0x20db7a[_0xfc6f('0x2e')][_0xfc6f('0x3d')]+'%'};return _0x26ee15;}})});}_0x5a06bc=_[_0xfc6f('0x3b')]({},_0x5a06bc,_0x20db7a[_0xfc6f('0x3e')]);var _0x2ddc65={'where':_0x5a06bc[_0xfc6f('0x3a')]};return db[_0xfc6f('0x28')][_0xfc6f('0x3f')](_0x2ddc65)[_0xfc6f('0x21')](function(_0x29881e){_0xdce2be[_0xfc6f('0x3f')]=_0x29881e;if(_0x20db7a[_0xfc6f('0x2e')][_0xfc6f('0x40')]){_0x5a06bc[_0xfc6f('0x41')]=[{'all':!![]}];}return db[_0xfc6f('0x28')]['findAll'](_0x5a06bc);})[_0xfc6f('0x21')](function(_0x22049c){_0xdce2be[_0xfc6f('0x42')]=_0x22049c;return _0xdce2be;})[_0xfc6f('0x21')](respondWithFilteredResult(_0x36bc9f,_0x5a06bc))['catch'](handleError(_0x36bc9f,null));};exports['show']=function(_0x1a81a1,_0x3128ff){var _0x55dfa0={'raw':![],'where':{'id':_0x1a81a1[_0xfc6f('0x43')]['id']}},_0x4dde09={};_0x4dde09['model']=_[_0xfc6f('0x2f')](db[_0xfc6f('0x28')][_0xfc6f('0x44')]);_0x4dde09[_0xfc6f('0x2e')]=_[_0xfc6f('0x2f')](_0x1a81a1['query']);_0x4dde09[_0xfc6f('0x30')]=_[_0xfc6f('0x31')](_0x4dde09['model'],_0x4dde09[_0xfc6f('0x2e')]);_0x55dfa0[_0xfc6f('0x32')]=_['intersection'](_0x4dde09[_0xfc6f('0x2c')],qs[_0xfc6f('0x33')](_0x1a81a1[_0xfc6f('0x2e')]['fields']));_0x55dfa0[_0xfc6f('0x32')]=_0x55dfa0[_0xfc6f('0x32')][_0xfc6f('0x34')]?_0x55dfa0[_0xfc6f('0x32')]:_0x4dde09[_0xfc6f('0x2c')];if(_0x1a81a1[_0xfc6f('0x2e')][_0xfc6f('0x40')]){_0x55dfa0[_0xfc6f('0x41')]=[{'all':!![]}];}_0x55dfa0=_[_0xfc6f('0x3b')]({},_0x55dfa0,_0x1a81a1[_0xfc6f('0x3e')]);return db[_0xfc6f('0x28')][_0xfc6f('0x45')](_0x55dfa0)[_0xfc6f('0x21')](handleEntityNotFound(_0x3128ff,null))[_0xfc6f('0x21')](respondWithResult(_0x3128ff,null))['catch'](handleError(_0x3128ff,null));};exports['create']=function(_0x2f397c,_0x3e54cc){return db[_0xfc6f('0x28')][_0xfc6f('0x46')](_0x2f397c[_0xfc6f('0x47')],{})[_0xfc6f('0x21')](respondWithResult(_0x3e54cc,0xc9))[_0xfc6f('0x48')](handleError(_0x3e54cc,null));};exports['update']=function(_0x31af57,_0x35c2ef){if(_0x31af57[_0xfc6f('0x47')]['id']){delete _0x31af57[_0xfc6f('0x47')]['id'];}return db['FreshsalesConfiguration']['find']({'where':{'id':_0x31af57[_0xfc6f('0x43')]['id']}})['then'](handleEntityNotFound(_0x35c2ef,null))[_0xfc6f('0x21')](saveUpdates(_0x31af57[_0xfc6f('0x47')],null))['then'](respondWithResult(_0x35c2ef,null))['catch'](handleError(_0x35c2ef,null));};exports[_0xfc6f('0x22')]=function(_0x58fc42,_0x1b9a25){return db['FreshsalesConfiguration'][_0xfc6f('0x45')]({'where':{'id':_0x58fc42[_0xfc6f('0x43')]['id']}})[_0xfc6f('0x21')](handleEntityNotFound(_0x1b9a25,null))[_0xfc6f('0x21')](removeEntity(_0x1b9a25,null))['catch'](handleError(_0x1b9a25,null));};exports[_0xfc6f('0x49')]=function(_0x25ea0a,_0x4e2b49,_0x4e0cbe){var _0x7b36f9={};var _0x11b40d={};var _0x54c96f;var _0x9cb5de;return db[_0xfc6f('0x28')][_0xfc6f('0x4a')]({'where':{'id':_0x25ea0a[_0xfc6f('0x43')]['id']}})[_0xfc6f('0x21')](handleEntityNotFound(_0x4e2b49,null))[_0xfc6f('0x21')](function(_0x4feac5){if(_0x4feac5){_0x54c96f=_0x4feac5;_0x11b40d[_0xfc6f('0x2c')]=_[_0xfc6f('0x2f')](db[_0xfc6f('0x4b')][_0xfc6f('0x44')]);_0x11b40d[_0xfc6f('0x2e')]=_['keys'](_0x25ea0a['query']);_0x11b40d[_0xfc6f('0x30')]=_[_0xfc6f('0x31')](_0x11b40d[_0xfc6f('0x2c')],_0x11b40d['query']);_0x7b36f9['attributes']=_['intersection'](_0x11b40d[_0xfc6f('0x2c')],qs[_0xfc6f('0x33')](_0x25ea0a['query'][_0xfc6f('0x33')]));_0x7b36f9[_0xfc6f('0x32')]=_0x7b36f9['attributes']['length']?_0x7b36f9['attributes']:_0x11b40d['model'];_0x7b36f9[_0xfc6f('0x37')]=qs[_0xfc6f('0x38')](_0x25ea0a['query'][_0xfc6f('0x38')]);_0x7b36f9[_0xfc6f('0x3a')]=qs[_0xfc6f('0x30')](_['pick'](_0x25ea0a['query'],_0x11b40d[_0xfc6f('0x30')]));if(_0x25ea0a[_0xfc6f('0x2e')][_0xfc6f('0x3d')]){_0x7b36f9[_0xfc6f('0x3a')]=_[_0xfc6f('0x3b')](_0x7b36f9[_0xfc6f('0x3a')],{'$or':_[_0xfc6f('0x2d')](_0x7b36f9[_0xfc6f('0x32')],function(_0x2bdc8f){var _0x580f77={};_0x580f77[_0x2bdc8f]={'$like':'%'+_0x25ea0a[_0xfc6f('0x2e')][_0xfc6f('0x3d')]+'%'};return _0x580f77;})});}_0x7b36f9=_[_0xfc6f('0x3b')]({},_0x7b36f9,_0x25ea0a[_0xfc6f('0x3e')]);return _0x54c96f['getSubjects'](_0x7b36f9);}})[_0xfc6f('0x21')](function(_0x54c06b){if(_0x54c06b){_0x9cb5de=_0x54c06b[_0xfc6f('0x34')];if(!_0x25ea0a[_0xfc6f('0x2e')][_0xfc6f('0x35')]('nolimit')){_0x7b36f9['limit']=qs[_0xfc6f('0x18')](_0x25ea0a[_0xfc6f('0x2e')][_0xfc6f('0x18')]);_0x7b36f9[_0xfc6f('0x1a')]=qs[_0xfc6f('0x1a')](_0x25ea0a[_0xfc6f('0x2e')][_0xfc6f('0x1a')]);}return _0x54c96f['getSubjects'](_0x7b36f9);}})[_0xfc6f('0x21')](function(_0x1c9ec8){if(_0x1c9ec8){return _0x1c9ec8?{'count':_0x9cb5de,'rows':_0x1c9ec8}:null;}})['then'](respondWithResult(_0x4e2b49,null))[_0xfc6f('0x48')](handleError(_0x4e2b49,null));};exports[_0xfc6f('0x4c')]=function(_0x184b99,_0x3de5c1,_0x24393c){var _0x29cf3b={};var _0x455e9c={};var _0x3f249b;var _0x22cad7;return db[_0xfc6f('0x28')]['findOne']({'where':{'id':_0x184b99[_0xfc6f('0x43')]['id']}})['then'](handleEntityNotFound(_0x3de5c1,null))[_0xfc6f('0x21')](function(_0xd4126e){if(_0xd4126e){_0x3f249b=_0xd4126e;_0x455e9c[_0xfc6f('0x2c')]=_[_0xfc6f('0x2f')](db[_0xfc6f('0x4b')]['rawAttributes']);_0x455e9c['query']=_[_0xfc6f('0x2f')](_0x184b99['query']);_0x455e9c[_0xfc6f('0x30')]=_[_0xfc6f('0x31')](_0x455e9c['model'],_0x455e9c['query']);_0x29cf3b[_0xfc6f('0x32')]=_['intersection'](_0x455e9c[_0xfc6f('0x2c')],qs['fields'](_0x184b99[_0xfc6f('0x2e')][_0xfc6f('0x33')]));_0x29cf3b['attributes']=_0x29cf3b['attributes'][_0xfc6f('0x34')]?_0x29cf3b[_0xfc6f('0x32')]:_0x455e9c['model'];_0x29cf3b[_0xfc6f('0x37')]=qs[_0xfc6f('0x38')](_0x184b99[_0xfc6f('0x2e')]['sort']);_0x29cf3b[_0xfc6f('0x3a')]=qs[_0xfc6f('0x30')](_[_0xfc6f('0x39')](_0x184b99['query'],_0x455e9c[_0xfc6f('0x30')]));if(_0x184b99[_0xfc6f('0x2e')][_0xfc6f('0x3d')]){_0x29cf3b[_0xfc6f('0x3a')]=_['merge'](_0x29cf3b[_0xfc6f('0x3a')],{'$or':_['map'](_0x29cf3b[_0xfc6f('0x32')],function(_0x567df3){var _0x2ec38b={};_0x2ec38b[_0x567df3]={'$like':'%'+_0x184b99['query'][_0xfc6f('0x3d')]+'%'};return _0x2ec38b;})});}_0x29cf3b=_[_0xfc6f('0x3b')]({},_0x29cf3b,_0x184b99['options']);return _0x3f249b[_0xfc6f('0x4c')](_0x29cf3b);}})[_0xfc6f('0x21')](function(_0x281a38){if(_0x281a38){_0x22cad7=_0x281a38[_0xfc6f('0x34')];if(!_0x184b99[_0xfc6f('0x2e')][_0xfc6f('0x35')](_0xfc6f('0x36'))){_0x29cf3b[_0xfc6f('0x18')]=qs[_0xfc6f('0x18')](_0x184b99[_0xfc6f('0x2e')][_0xfc6f('0x18')]);_0x29cf3b[_0xfc6f('0x1a')]=qs['offset'](_0x184b99[_0xfc6f('0x2e')]['offset']);}return _0x3f249b[_0xfc6f('0x4c')](_0x29cf3b);}})[_0xfc6f('0x21')](function(_0x40f85e){if(_0x40f85e){return _0x40f85e?{'count':_0x22cad7,'rows':_0x40f85e}:null;}})[_0xfc6f('0x21')](respondWithResult(_0x3de5c1,null))[_0xfc6f('0x48')](handleError(_0x3de5c1,null));};exports[_0xfc6f('0x4d')]=function(_0x113c02,_0x585efc,_0x1b84e7){var _0xd1ebdb={};var _0x3e11f2={};var _0x4fb1e3;var _0x197eab;return db['FreshsalesConfiguration'][_0xfc6f('0x4a')]({'where':{'id':_0x113c02[_0xfc6f('0x43')]['id']}})[_0xfc6f('0x21')](handleEntityNotFound(_0x585efc,null))[_0xfc6f('0x21')](function(_0x1e1de1){if(_0x1e1de1){_0x4fb1e3=_0x1e1de1;_0x3e11f2['model']=_[_0xfc6f('0x2f')](db['FreshsalesField'][_0xfc6f('0x44')]);_0x3e11f2[_0xfc6f('0x2e')]=_[_0xfc6f('0x2f')](_0x113c02[_0xfc6f('0x2e')]);_0x3e11f2[_0xfc6f('0x30')]=_[_0xfc6f('0x31')](_0x3e11f2[_0xfc6f('0x2c')],_0x3e11f2[_0xfc6f('0x2e')]);_0xd1ebdb['attributes']=_[_0xfc6f('0x31')](_0x3e11f2['model'],qs[_0xfc6f('0x33')](_0x113c02[_0xfc6f('0x2e')][_0xfc6f('0x33')]));_0xd1ebdb[_0xfc6f('0x32')]=_0xd1ebdb[_0xfc6f('0x32')][_0xfc6f('0x34')]?_0xd1ebdb[_0xfc6f('0x32')]:_0x3e11f2[_0xfc6f('0x2c')];_0xd1ebdb[_0xfc6f('0x37')]=qs['sort'](_0x113c02[_0xfc6f('0x2e')][_0xfc6f('0x38')]);_0xd1ebdb['where']=qs['filters'](_[_0xfc6f('0x39')](_0x113c02['query'],_0x3e11f2[_0xfc6f('0x30')]));if(_0x113c02[_0xfc6f('0x2e')]['filter']){_0xd1ebdb[_0xfc6f('0x3a')]=_[_0xfc6f('0x3b')](_0xd1ebdb[_0xfc6f('0x3a')],{'$or':_['map'](_0xd1ebdb['attributes'],function(_0x3c0ab4){var _0x2f2011={};_0x2f2011[_0x3c0ab4]={'$like':'%'+_0x113c02[_0xfc6f('0x2e')]['filter']+'%'};return _0x2f2011;})});}_0xd1ebdb=_[_0xfc6f('0x3b')]({},_0xd1ebdb,_0x113c02[_0xfc6f('0x3e')]);return _0x4fb1e3[_0xfc6f('0x4d')](_0xd1ebdb);}})[_0xfc6f('0x21')](function(_0x21f858){if(_0x21f858){_0x197eab=_0x21f858[_0xfc6f('0x34')];if(!_0x113c02[_0xfc6f('0x2e')][_0xfc6f('0x35')](_0xfc6f('0x36'))){_0xd1ebdb[_0xfc6f('0x18')]=qs[_0xfc6f('0x18')](_0x113c02[_0xfc6f('0x2e')]['limit']);_0xd1ebdb[_0xfc6f('0x1a')]=qs['offset'](_0x113c02[_0xfc6f('0x2e')][_0xfc6f('0x1a')]);}return _0x4fb1e3[_0xfc6f('0x4d')](_0xd1ebdb);}})[_0xfc6f('0x21')](function(_0x326980){if(_0x326980){return _0x326980?{'count':_0x197eab,'rows':_0x326980}:null;}})[_0xfc6f('0x21')](respondWithResult(_0x585efc,null))[_0xfc6f('0x48')](handleError(_0x585efc,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index dd06b5c..cc0e40d 100644 --- a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js +++ b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa6fb=['api','moment','bluebird','request-promise','./intFreshsalesConfiguration.attributes','FreshsalesConfiguration','int_freshsales_configurations','lodash','util','../../config/logger'];(function(_0x4f0c2b,_0x2c9d14){var _0x526436=function(_0x2e13b6){while(--_0x2e13b6){_0x4f0c2b['push'](_0x4f0c2b['shift']());}};_0x526436(++_0x2c9d14);}(_0xa6fb,0x13d));var _0xba6f=function(_0x1434e8,_0x551cf7){_0x1434e8=_0x1434e8-0x0;var _0x10dabd=_0xa6fb[_0x1434e8];return _0x10dabd;};'use strict';var _=require(_0xba6f('0x0'));var util=require(_0xba6f('0x1'));var logger=require(_0xba6f('0x2'))(_0xba6f('0x3'));var moment=require(_0xba6f('0x4'));var BPromise=require(_0xba6f('0x5'));var rp=require(_0xba6f('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xba6f('0x7'));module['exports']=function(_0x3b6e89,_0x3cb9d4){return _0x3b6e89['define'](_0xba6f('0x8'),attributes,{'tableName':_0xba6f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfddb=['../../config/logger','moment','path','../../config/environment','./intFreshsalesConfiguration.attributes','exports','define','util'];(function(_0x3a7634,_0x2db384){var _0x23bbe9=function(_0x226734){while(--_0x226734){_0x3a7634['push'](_0x3a7634['shift']());}};_0x23bbe9(++_0x2db384);}(_0xfddb,0x137));var _0xbfdd=function(_0x3b8f15,_0x356ff5){_0x3b8f15=_0x3b8f15-0x0;var _0x2ab6d3=_0xfddb[_0x3b8f15];return _0x2ab6d3;};'use strict';var _=require('lodash');var util=require(_0xbfdd('0x0'));var logger=require(_0xbfdd('0x1'))('api');var moment=require(_0xbfdd('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xbfdd('0x3'));var rimraf=require('rimraf');var config=require(_0xbfdd('0x4'));var attributes=require(_0xbfdd('0x5'));module[_0xbfdd('0x6')]=function(_0x226d6e,_0x34a215){return _0x226d6e[_0xbfdd('0x7')]('FreshsalesConfiguration',attributes,{'tableName':'int_freshsales_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js index 4d4b459..4abf138 100644 --- a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js +++ b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdaa2=['debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x2e1b3a,_0x2acefc){var _0x5d7a3a=function(_0x3c8b5c){while(--_0x3c8b5c){_0x2e1b3a['push'](_0x2e1b3a['shift']());}};_0x5d7a3a(++_0x2acefc);}(_0xdaa2,0xf6));var _0x2daa=function(_0x42c01d,_0x1a6bba){_0x42c01d=_0x42c01d-0x0;var _0x3c2bc4=_0xdaa2[_0x42c01d];return _0x3c2bc4;};'use strict';var _=require(_0x2daa('0x0'));var util=require(_0x2daa('0x1'));var moment=require('moment');var BPromise=require(_0x2daa('0x2'));var rs=require(_0x2daa('0x3'));var fs=require('fs');var Redis=require(_0x2daa('0x4'));var db=require(_0x2daa('0x5'))['db'];var utils=require(_0x2daa('0x6'));var logger=require(_0x2daa('0x7'))(_0x2daa('0x8'));var config=require(_0x2daa('0x9'));var jayson=require(_0x2daa('0xa'));var client=jayson[_0x2daa('0xb')][_0x2daa('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x10a912,_0x1b4670,_0x429189){return new BPromise(function(_0x2c6ce9,_0x18838b){return client[_0x2daa('0xd')](_0x10a912,_0x429189)[_0x2daa('0xe')](function(_0xb64101){logger[_0x2daa('0xf')](_0x2daa('0x10'),_0x1b4670,_0x2daa('0x11'));logger[_0x2daa('0x12')](_0x2daa('0x13'),_0x1b4670,_0x2daa('0x11'),JSON[_0x2daa('0x14')](_0xb64101));if(_0xb64101[_0x2daa('0x15')]){if(_0xb64101[_0x2daa('0x15')]['code']===0x1f4){logger[_0x2daa('0x15')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x1b4670,_0xb64101['error'][_0x2daa('0x16')]);return _0x18838b(_0xb64101[_0x2daa('0x15')][_0x2daa('0x16')]);}logger[_0x2daa('0x15')](_0x2daa('0x10'),_0x1b4670,_0xb64101[_0x2daa('0x15')]['message']);return _0x2c6ce9(_0xb64101['error']['message']);}else{logger['info'](_0x2daa('0x10'),_0x1b4670,_0x2daa('0x11'));_0x2c6ce9(_0xb64101[_0x2daa('0x17')][_0x2daa('0x16')]);}})['catch'](function(_0x2dff3b){logger[_0x2daa('0x15')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x1b4670,_0x2dff3b);_0x18838b(_0x2dff3b);});});} \ No newline at end of file +var _0x5c7b=['request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','then','info'];(function(_0x549f68,_0x4d0f05){var _0x48f24c=function(_0x304f7e){while(--_0x304f7e){_0x549f68['push'](_0x549f68['shift']());}};_0x48f24c(++_0x4d0f05);}(_0x5c7b,0x195));var _0xb5c7=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x5c7b[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0xb5c7('0x0'));var util=require(_0xb5c7('0x1'));var moment=require(_0xb5c7('0x2'));var BPromise=require(_0xb5c7('0x3'));var rs=require(_0xb5c7('0x4'));var fs=require('fs');var Redis=require(_0xb5c7('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb5c7('0x6'))('rpc');var config=require(_0xb5c7('0x7'));var jayson=require(_0xb5c7('0x8'));var client=jayson[_0xb5c7('0x9')][_0xb5c7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xb0b1d5,_0x4d10a2,_0x3c348e){return new BPromise(function(_0x6a4450,_0x3c581c){return client['request'](_0xb0b1d5,_0x3c348e)[_0xb5c7('0xb')](function(_0x504e41){logger[_0xb5c7('0xc')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x4d10a2,_0xb5c7('0xd'));logger[_0xb5c7('0xe')]('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0x4d10a2,'request\x20sent',JSON['stringify'](_0x504e41));if(_0x504e41['error']){if(_0x504e41['error']['code']===0x1f4){logger['error'](_0xb5c7('0xf'),_0x4d10a2,_0x504e41[_0xb5c7('0x10')][_0xb5c7('0x11')]);return _0x3c581c(_0x504e41[_0xb5c7('0x10')][_0xb5c7('0x11')]);}logger['error'](_0xb5c7('0xf'),_0x4d10a2,_0x504e41[_0xb5c7('0x10')][_0xb5c7('0x11')]);return _0x6a4450(_0x504e41[_0xb5c7('0x10')][_0xb5c7('0x11')]);}else{logger['info'](_0xb5c7('0xf'),_0x4d10a2,_0xb5c7('0xd'));_0x6a4450(_0x504e41[_0xb5c7('0x12')][_0xb5c7('0x11')]);}})['catch'](function(_0x16c730){logger[_0xb5c7('0x10')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x4d10a2,_0x16c730);_0x3c581c(_0x16c730);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index 188c2b6..a0c9be1 100644 --- a/server/api/intFreshsalesField/index.js +++ b/server/api/intFreshsalesField/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x18e0=['get','isAuthenticated','/:id','post','create','put','delete','exports','util','connect-timeout','express','Router','../../components/auth/service','./intFreshsalesField.controller'];(function(_0x5b206a,_0x1f2004){var _0x32187d=function(_0xa150d9){while(--_0xa150d9){_0x5b206a['push'](_0x5b206a['shift']());}};_0x32187d(++_0x1f2004);}(_0x18e0,0xa2));var _0x018e=function(_0x1b6186,_0x1ec7f2){_0x1b6186=_0x1b6186-0x0;var _0x186121=_0x18e0[_0x1b6186];return _0x186121;};'use strict';var multer=require('multer');var util=require(_0x018e('0x0'));var path=require('path');var timeout=require(_0x018e('0x1'));var express=require(_0x018e('0x2'));var router=express[_0x018e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x018e('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x018e('0x5'));router[_0x018e('0x6')]('/',auth[_0x018e('0x7')](),controller['index']);router['get'](_0x018e('0x8'),auth[_0x018e('0x7')](),controller['show']);router[_0x018e('0x9')]('/',auth[_0x018e('0x7')](),controller[_0x018e('0xa')]);router[_0x018e('0xb')](_0x018e('0x8'),auth[_0x018e('0x7')](),controller['update']);router[_0x018e('0xc')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x018e('0xd')]=router; \ No newline at end of file +var _0x3c7b=['connect-timeout','express','../../config/environment','./intFreshsalesField.controller','isAuthenticated','get','/:id','show','post','create','update','delete','destroy','multer','util','path'];(function(_0x325e5c,_0x5ef377){var _0x2ca2bd=function(_0x421f56){while(--_0x421f56){_0x325e5c['push'](_0x325e5c['shift']());}};_0x2ca2bd(++_0x5ef377);}(_0x3c7b,0x11d));var _0xb3c7=function(_0x21c05e,_0x524887){_0x21c05e=_0x21c05e-0x0;var _0x83757e=_0x3c7b[_0x21c05e];return _0x83757e;};'use strict';var multer=require(_0xb3c7('0x0'));var util=require(_0xb3c7('0x1'));var path=require(_0xb3c7('0x2'));var timeout=require(_0xb3c7('0x3'));var express=require(_0xb3c7('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb3c7('0x5'));var controller=require(_0xb3c7('0x6'));router['get']('/',auth[_0xb3c7('0x7')](),controller['index']);router[_0xb3c7('0x8')](_0xb3c7('0x9'),auth[_0xb3c7('0x7')](),controller[_0xb3c7('0xa')]);router[_0xb3c7('0xb')]('/',auth['isAuthenticated'](),controller[_0xb3c7('0xc')]);router['put'](_0xb3c7('0x9'),auth[_0xb3c7('0x7')](),controller[_0xb3c7('0xd')]);router[_0xb3c7('0xe')]('/:id',auth[_0xb3c7('0x7')](),controller[_0xb3c7('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index 6bdd221..bc9291c 100644 --- a/server/api/intFreshsalesField/intFreshsalesField.attributes.js +++ b/server/api/intFreshsalesField/intFreshsalesField.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xad87=['sequelize','exports','string','variable','customVariable','keyValue','picklist','STRING','ENUM','BOOLEAN'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0xad87,0xc8));var _0x7ad8=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xad87[_0x1c546c];return _0x2cc384;};'use strict';var Sequelize=require(_0x7ad8('0x0'));module[_0x7ad8('0x1')]={'type':{'type':Sequelize['ENUM'](_0x7ad8('0x2'),_0x7ad8('0x3'),_0x7ad8('0x4'),_0x7ad8('0x5'),_0x7ad8('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x7ad8('0x7')]},'key':{'type':Sequelize[_0x7ad8('0x7')]},'keyType':{'type':Sequelize[_0x7ad8('0x8')](_0x7ad8('0x2'),_0x7ad8('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x7ad8('0x7')]},'idField':{'type':Sequelize[_0x7ad8('0x7')]},'nameField':{'type':Sequelize[_0x7ad8('0x7')]},'customField':{'type':Sequelize[_0x7ad8('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x7ad8('0x7')]}}; \ No newline at end of file +var _0x4ee6=['exports','ENUM','string','variable','picklist','STRING','customVariable','BOOLEAN','sequelize'];(function(_0x463697,_0xccfdc4){var _0x33cfe1=function(_0x5c74ec){while(--_0x5c74ec){_0x463697['push'](_0x463697['shift']());}};_0x33cfe1(++_0xccfdc4);}(_0x4ee6,0x170));var _0x64ee=function(_0x4fff24,_0x57ac4d){_0x4fff24=_0x4fff24-0x0;var _0x1ad8bc=_0x4ee6[_0x4fff24];return _0x1ad8bc;};'use strict';var Sequelize=require(_0x64ee('0x0'));module[_0x64ee('0x1')]={'type':{'type':Sequelize[_0x64ee('0x2')](_0x64ee('0x3'),_0x64ee('0x4'),'customVariable','keyValue',_0x64ee('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x64ee('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x64ee('0x2')](_0x64ee('0x3'),'variable',_0x64ee('0x7'))},'keyContent':{'type':Sequelize[_0x64ee('0x6')]},'idField':{'type':Sequelize[_0x64ee('0x6')]},'nameField':{'type':Sequelize[_0x64ee('0x6')]},'customField':{'type':Sequelize[_0x64ee('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x64ee('0x6')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index cd89df1..ab99fcc 100644 --- a/server/api/intFreshsalesField/intFreshsalesField.controller.js +++ b/server/api/intFreshsalesField/intFreshsalesField.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6363=['Content-Range','apply','reject','save','update','then','destroy','stack','name','send','FreshsalesField','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','create','body','find','eml-format','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x6363,0x1b6));var _0x3636=function(_0x2ff85f,_0x332b8c){_0x2ff85f=_0x2ff85f-0x0;var _0x4304d8=_0x6363[_0x2ff85f];return _0x4304d8;};'use strict';var emlformat=require(_0x3636('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3636('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3636('0x2'));var moment=require('moment');var BPromise=require(_0x3636('0x3'));var Mustache=require(_0x3636('0x4'));var util=require(_0x3636('0x5'));var path=require(_0x3636('0x6'));var sox=require(_0x3636('0x7'));var csv=require(_0x3636('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3636('0x9'));var _=require(_0x3636('0xa'));var squel=require(_0x3636('0xb'));var crypto=require('crypto');var jsforce=require(_0x3636('0xc'));var deskjs=require(_0x3636('0xd'));var toCsv=require(_0x3636('0x8'));var querystring=require(_0x3636('0xe'));var Papa=require(_0x3636('0xf'));var Redis=require(_0x3636('0x10'));var authService=require(_0x3636('0x11'));var qs=require(_0x3636('0x12'));var as=require(_0x3636('0x13'));var hardwareService=require(_0x3636('0x14'));var logger=require(_0x3636('0x15'))(_0x3636('0x16'));var utils=require(_0x3636('0x17'));var config=require(_0x3636('0x18'));var licenseUtil=require(_0x3636('0x19'));var db=require(_0x3636('0x1a'))['db'];function respondWithStatusCode(_0x4619ec,_0x129d57){_0x129d57=_0x129d57||0xcc;return function(_0x3e0b53){if(_0x3e0b53){return _0x4619ec[_0x3636('0x1b')](_0x129d57);}return _0x4619ec['status'](_0x129d57)[_0x3636('0x1c')]();};}function respondWithResult(_0x35e65f,_0x332a71){_0x332a71=_0x332a71||0xc8;return function(_0x43625b){if(_0x43625b){return _0x35e65f['status'](_0x332a71)[_0x3636('0x1d')](_0x43625b);}};}function respondWithFilteredResult(_0x1ce86d,_0x161074){return function(_0x233db9){if(_0x233db9){var _0x2b24ca=typeof _0x161074[_0x3636('0x1e')]===_0x3636('0x1f')&&typeof _0x161074[_0x3636('0x20')]===_0x3636('0x1f');var _0x2c89bf=_0x233db9[_0x3636('0x21')];var _0x4a53ae=_0x2b24ca?0x0:_0x161074[_0x3636('0x1e')];var _0x18f577=_0x2b24ca?_0x233db9[_0x3636('0x21')]:_0x161074[_0x3636('0x1e')]+_0x161074['limit'];var _0x1d22e9;if(_0x18f577>=_0x2c89bf){_0x18f577=_0x2c89bf;_0x1d22e9=0xc8;}else{_0x1d22e9=0xce;}_0x1ce86d[_0x3636('0x22')](_0x1d22e9);return _0x1ce86d[_0x3636('0x23')](_0x3636('0x24'),_0x4a53ae+'-'+_0x18f577+'/'+_0x2c89bf)[_0x3636('0x1d')](_0x233db9);}return null;};}function patchUpdates(_0x221984){return function(_0x30fd4c){try{jsonpatch[_0x3636('0x25')](_0x30fd4c,_0x221984,!![]);}catch(_0x2e3518){return BPromise[_0x3636('0x26')](_0x2e3518);}return _0x30fd4c[_0x3636('0x27')]();};}function saveUpdates(_0x15a0c6,_0x555136){return function(_0xe784c0){if(_0xe784c0){return _0xe784c0[_0x3636('0x28')](_0x15a0c6)[_0x3636('0x29')](function(_0x2bfc3a){return _0x2bfc3a;});}return null;};}function removeEntity(_0x2de964,_0x26129f){return function(_0x9c7927){if(_0x9c7927){return _0x9c7927[_0x3636('0x2a')]()[_0x3636('0x29')](function(){_0x2de964[_0x3636('0x22')](0xcc)[_0x3636('0x1c')]();});}};}function handleEntityNotFound(_0x2a1fdd,_0x2370b8){return function(_0x1fb10f){if(!_0x1fb10f){_0x2a1fdd[_0x3636('0x1b')](0x194);}return _0x1fb10f;};}function handleError(_0x57898d,_0x4a992a){_0x4a992a=_0x4a992a||0x1f4;return function(_0x50f35d){logger['error'](_0x50f35d[_0x3636('0x2b')]);if(_0x50f35d[_0x3636('0x2c')]){delete _0x50f35d[_0x3636('0x2c')];}_0x57898d['status'](_0x4a992a)[_0x3636('0x2d')](_0x50f35d);};}exports['index']=function(_0x17f77f,_0x37777c){var _0x5cf63b={},_0x534968={},_0x1642a5={'count':0x0,'rows':[]};var _0x4baffa=_['map'](db[_0x3636('0x2e')][_0x3636('0x2f')],function(_0x40d42f){return{'name':_0x40d42f[_0x3636('0x30')],'type':_0x40d42f[_0x3636('0x31')][_0x3636('0x32')]};});_0x534968[_0x3636('0x33')]=_[_0x3636('0x34')](_0x4baffa,_0x3636('0x2c'));_0x534968[_0x3636('0x35')]=_[_0x3636('0x36')](_0x17f77f[_0x3636('0x35')]);_0x534968[_0x3636('0x37')]=_['intersection'](_0x534968[_0x3636('0x33')],_0x534968[_0x3636('0x35')]);_0x5cf63b[_0x3636('0x38')]=_[_0x3636('0x39')](_0x534968[_0x3636('0x33')],qs[_0x3636('0x3a')](_0x17f77f[_0x3636('0x35')]['fields']));_0x5cf63b[_0x3636('0x38')]=_0x5cf63b[_0x3636('0x38')][_0x3636('0x3b')]?_0x5cf63b[_0x3636('0x38')]:_0x534968[_0x3636('0x33')];if(!_0x17f77f[_0x3636('0x35')][_0x3636('0x3c')](_0x3636('0x3d'))){_0x5cf63b[_0x3636('0x20')]=qs[_0x3636('0x20')](_0x17f77f[_0x3636('0x35')][_0x3636('0x20')]);_0x5cf63b[_0x3636('0x1e')]=qs[_0x3636('0x1e')](_0x17f77f['query']['offset']);}_0x5cf63b[_0x3636('0x3e')]=qs[_0x3636('0x3f')](_0x17f77f[_0x3636('0x35')]['sort']);_0x5cf63b[_0x3636('0x40')]=qs[_0x3636('0x37')](_[_0x3636('0x41')](_0x17f77f[_0x3636('0x35')],_0x534968[_0x3636('0x37')]),_0x4baffa);if(_0x17f77f['query'][_0x3636('0x42')]){_0x5cf63b[_0x3636('0x40')]=_[_0x3636('0x43')](_0x5cf63b[_0x3636('0x40')],{'$or':_[_0x3636('0x34')](_0x4baffa,function(_0x4ea091){if(_0x4ea091[_0x3636('0x31')]!==_0x3636('0x44')){var _0x38efaf={};_0x38efaf[_0x4ea091[_0x3636('0x2c')]]={'$like':'%'+_0x17f77f[_0x3636('0x35')]['filter']+'%'};return _0x38efaf;}})});}_0x5cf63b=_[_0x3636('0x43')]({},_0x5cf63b,_0x17f77f[_0x3636('0x45')]);var _0x42e0ba={'where':_0x5cf63b[_0x3636('0x40')]};return db['FreshsalesField'][_0x3636('0x21')](_0x42e0ba)['then'](function(_0x1dd2fc){_0x1642a5[_0x3636('0x21')]=_0x1dd2fc;if(_0x17f77f[_0x3636('0x35')][_0x3636('0x46')]){_0x5cf63b[_0x3636('0x47')]=[{'all':!![]}];}return db[_0x3636('0x2e')][_0x3636('0x48')](_0x5cf63b);})[_0x3636('0x29')](function(_0x5aec86){_0x1642a5[_0x3636('0x49')]=_0x5aec86;return _0x1642a5;})[_0x3636('0x29')](respondWithFilteredResult(_0x37777c,_0x5cf63b))[_0x3636('0x4a')](handleError(_0x37777c,null));};exports[_0x3636('0x4b')]=function(_0x3bf86f,_0x7bc574){var _0x17789c={'raw':!![],'where':{'id':_0x3bf86f['params']['id']}},_0x23790b={};_0x23790b['model']=_[_0x3636('0x36')](db[_0x3636('0x2e')][_0x3636('0x2f')]);_0x23790b[_0x3636('0x35')]=_[_0x3636('0x36')](_0x3bf86f[_0x3636('0x35')]);_0x23790b['filters']=_[_0x3636('0x39')](_0x23790b[_0x3636('0x33')],_0x23790b['query']);_0x17789c[_0x3636('0x38')]=_['intersection'](_0x23790b[_0x3636('0x33')],qs[_0x3636('0x3a')](_0x3bf86f[_0x3636('0x35')]['fields']));_0x17789c[_0x3636('0x38')]=_0x17789c[_0x3636('0x38')][_0x3636('0x3b')]?_0x17789c['attributes']:_0x23790b['model'];if(_0x3bf86f[_0x3636('0x35')]['includeAll']){_0x17789c['include']=[{'all':!![]}];}_0x17789c=_[_0x3636('0x43')]({},_0x17789c,_0x3bf86f['options']);return db[_0x3636('0x2e')]['find'](_0x17789c)['then'](handleEntityNotFound(_0x7bc574,null))[_0x3636('0x29')](respondWithResult(_0x7bc574,null))[_0x3636('0x4a')](handleError(_0x7bc574,null));};exports[_0x3636('0x4c')]=function(_0x1cfeb3,_0x456a6f){return db['FreshsalesField'][_0x3636('0x4c')](_0x1cfeb3[_0x3636('0x4d')],{})[_0x3636('0x29')](respondWithResult(_0x456a6f,0xc9))['catch'](handleError(_0x456a6f,null));};exports[_0x3636('0x28')]=function(_0x24e9cc,_0x4c3ba3){if(_0x24e9cc[_0x3636('0x4d')]['id']){delete _0x24e9cc[_0x3636('0x4d')]['id'];}return db[_0x3636('0x2e')][_0x3636('0x4e')]({'where':{'id':_0x24e9cc['params']['id']}})[_0x3636('0x29')](handleEntityNotFound(_0x4c3ba3,null))[_0x3636('0x29')](saveUpdates(_0x24e9cc[_0x3636('0x4d')],null))[_0x3636('0x29')](respondWithResult(_0x4c3ba3,null))[_0x3636('0x4a')](handleError(_0x4c3ba3,null));};exports[_0x3636('0x2a')]=function(_0x179d8e,_0x3864b7){return db[_0x3636('0x2e')]['find']({'where':{'id':_0x179d8e['params']['id']}})[_0x3636('0x29')](handleEntityNotFound(_0x3864b7,null))[_0x3636('0x29')](removeEntity(_0x3864b7,null))[_0x3636('0x4a')](handleError(_0x3864b7,null));}; \ No newline at end of file +var _0x26e6=['offset','set','Content-Range','json','apply','reject','save','update','then','error','stack','name','send','index','map','FreshsalesField','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','includeAll','findAll','rows','catch','show','params','options','find','create','body','destroy','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../mysqldb','sendStatus','end','status','undefined','limit','count'];(function(_0xa61084,_0x522c19){var _0x225e68=function(_0x44e796){while(--_0x44e796){_0xa61084['push'](_0xa61084['shift']());}};_0x225e68(++_0x522c19);}(_0x26e6,0x76));var _0x626e=function(_0x419550,_0x15cdf1){_0x419550=_0x419550-0x0;var _0x55f9ef=_0x26e6[_0x419550];return _0x55f9ef;};'use strict';var emlformat=require(_0x626e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x626e('0x1'));var rp=require('request-promise');var moment=require(_0x626e('0x2'));var BPromise=require(_0x626e('0x3'));var Mustache=require(_0x626e('0x4'));var util=require(_0x626e('0x5'));var path=require(_0x626e('0x6'));var sox=require(_0x626e('0x7'));var csv=require(_0x626e('0x8'));var ejs=require(_0x626e('0x9'));var fs=require('fs');var fs_extra=require(_0x626e('0xa'));var _=require(_0x626e('0xb'));var squel=require('squel');var crypto=require(_0x626e('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x626e('0xd'));var toCsv=require(_0x626e('0x8'));var querystring=require(_0x626e('0xe'));var Papa=require(_0x626e('0xf'));var Redis=require(_0x626e('0x10'));var authService=require(_0x626e('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x626e('0x12'));var hardwareService=require(_0x626e('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x626e('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x626e('0x15'))['db'];function respondWithStatusCode(_0x5d67d9,_0xf16247){_0xf16247=_0xf16247||0xcc;return function(_0x3d8764){if(_0x3d8764){return _0x5d67d9[_0x626e('0x16')](_0xf16247);}return _0x5d67d9['status'](_0xf16247)[_0x626e('0x17')]();};}function respondWithResult(_0x4a434a,_0x1742c6){_0x1742c6=_0x1742c6||0xc8;return function(_0x309c5e){if(_0x309c5e){return _0x4a434a[_0x626e('0x18')](_0x1742c6)['json'](_0x309c5e);}};}function respondWithFilteredResult(_0x2d9c69,_0x4b8a24){return function(_0x422a66){if(_0x422a66){var _0x5561ca=typeof _0x4b8a24['offset']===_0x626e('0x19')&&typeof _0x4b8a24[_0x626e('0x1a')]===_0x626e('0x19');var _0x31724a=_0x422a66[_0x626e('0x1b')];var _0x6b525e=_0x5561ca?0x0:_0x4b8a24['offset'];var _0x142df1=_0x5561ca?_0x422a66[_0x626e('0x1b')]:_0x4b8a24[_0x626e('0x1c')]+_0x4b8a24['limit'];var _0x31c750;if(_0x142df1>=_0x31724a){_0x142df1=_0x31724a;_0x31c750=0xc8;}else{_0x31c750=0xce;}_0x2d9c69[_0x626e('0x18')](_0x31c750);return _0x2d9c69[_0x626e('0x1d')](_0x626e('0x1e'),_0x6b525e+'-'+_0x142df1+'/'+_0x31724a)[_0x626e('0x1f')](_0x422a66);}return null;};}function patchUpdates(_0x2f4d6b){return function(_0x537754){try{jsonpatch[_0x626e('0x20')](_0x537754,_0x2f4d6b,!![]);}catch(_0x43035a){return BPromise[_0x626e('0x21')](_0x43035a);}return _0x537754[_0x626e('0x22')]();};}function saveUpdates(_0x390be9,_0x251bcd){return function(_0x3fe085){if(_0x3fe085){return _0x3fe085[_0x626e('0x23')](_0x390be9)[_0x626e('0x24')](function(_0x2ba9a7){return _0x2ba9a7;});}return null;};}function removeEntity(_0x50ca77,_0x239dc3){return function(_0x57a4f8){if(_0x57a4f8){return _0x57a4f8['destroy']()['then'](function(){_0x50ca77[_0x626e('0x18')](0xcc)[_0x626e('0x17')]();});}};}function handleEntityNotFound(_0x1490e3,_0x50998c){return function(_0x115f7e){if(!_0x115f7e){_0x1490e3[_0x626e('0x16')](0x194);}return _0x115f7e;};}function handleError(_0x3ce201,_0x28e92e){_0x28e92e=_0x28e92e||0x1f4;return function(_0x261857){logger[_0x626e('0x25')](_0x261857[_0x626e('0x26')]);if(_0x261857[_0x626e('0x27')]){delete _0x261857[_0x626e('0x27')];}_0x3ce201[_0x626e('0x18')](_0x28e92e)[_0x626e('0x28')](_0x261857);};}exports[_0x626e('0x29')]=function(_0x5da051,_0x1fb7d5){var _0x3253fd={},_0x2f8153={},_0x466532={'count':0x0,'rows':[]};var _0x192956=_[_0x626e('0x2a')](db[_0x626e('0x2b')][_0x626e('0x2c')],function(_0x2ca431){return{'name':_0x2ca431[_0x626e('0x2d')],'type':_0x2ca431[_0x626e('0x2e')]['key']};});_0x2f8153[_0x626e('0x2f')]=_[_0x626e('0x2a')](_0x192956,_0x626e('0x27'));_0x2f8153[_0x626e('0x30')]=_[_0x626e('0x31')](_0x5da051[_0x626e('0x30')]);_0x2f8153[_0x626e('0x32')]=_[_0x626e('0x33')](_0x2f8153[_0x626e('0x2f')],_0x2f8153['query']);_0x3253fd[_0x626e('0x34')]=_[_0x626e('0x33')](_0x2f8153[_0x626e('0x2f')],qs[_0x626e('0x35')](_0x5da051[_0x626e('0x30')]['fields']));_0x3253fd[_0x626e('0x34')]=_0x3253fd[_0x626e('0x34')][_0x626e('0x36')]?_0x3253fd[_0x626e('0x34')]:_0x2f8153[_0x626e('0x2f')];if(!_0x5da051[_0x626e('0x30')][_0x626e('0x37')](_0x626e('0x38'))){_0x3253fd[_0x626e('0x1a')]=qs[_0x626e('0x1a')](_0x5da051[_0x626e('0x30')][_0x626e('0x1a')]);_0x3253fd[_0x626e('0x1c')]=qs['offset'](_0x5da051['query']['offset']);}_0x3253fd['order']=qs[_0x626e('0x39')](_0x5da051[_0x626e('0x30')][_0x626e('0x39')]);_0x3253fd[_0x626e('0x3a')]=qs[_0x626e('0x32')](_[_0x626e('0x3b')](_0x5da051[_0x626e('0x30')],_0x2f8153[_0x626e('0x32')]),_0x192956);if(_0x5da051[_0x626e('0x30')]['filter']){_0x3253fd[_0x626e('0x3a')]=_['merge'](_0x3253fd[_0x626e('0x3a')],{'$or':_[_0x626e('0x2a')](_0x192956,function(_0x532690){if(_0x532690[_0x626e('0x2e')]!=='VIRTUAL'){var _0x469acf={};_0x469acf[_0x532690[_0x626e('0x27')]]={'$like':'%'+_0x5da051[_0x626e('0x30')][_0x626e('0x3c')]+'%'};return _0x469acf;}})});}_0x3253fd=_[_0x626e('0x3d')]({},_0x3253fd,_0x5da051['options']);var _0x492659={'where':_0x3253fd['where']};return db[_0x626e('0x2b')][_0x626e('0x1b')](_0x492659)[_0x626e('0x24')](function(_0x31a173){_0x466532[_0x626e('0x1b')]=_0x31a173;if(_0x5da051[_0x626e('0x30')][_0x626e('0x3e')]){_0x3253fd['include']=[{'all':!![]}];}return db[_0x626e('0x2b')][_0x626e('0x3f')](_0x3253fd);})[_0x626e('0x24')](function(_0x1c428e){_0x466532[_0x626e('0x40')]=_0x1c428e;return _0x466532;})[_0x626e('0x24')](respondWithFilteredResult(_0x1fb7d5,_0x3253fd))[_0x626e('0x41')](handleError(_0x1fb7d5,null));};exports[_0x626e('0x42')]=function(_0x5d76d7,_0x19dccd){var _0x2ea638={'raw':!![],'where':{'id':_0x5d76d7[_0x626e('0x43')]['id']}},_0x72c562={};_0x72c562['model']=_[_0x626e('0x31')](db[_0x626e('0x2b')][_0x626e('0x2c')]);_0x72c562[_0x626e('0x30')]=_[_0x626e('0x31')](_0x5d76d7['query']);_0x72c562['filters']=_[_0x626e('0x33')](_0x72c562[_0x626e('0x2f')],_0x72c562[_0x626e('0x30')]);_0x2ea638[_0x626e('0x34')]=_[_0x626e('0x33')](_0x72c562[_0x626e('0x2f')],qs[_0x626e('0x35')](_0x5d76d7[_0x626e('0x30')][_0x626e('0x35')]));_0x2ea638[_0x626e('0x34')]=_0x2ea638[_0x626e('0x34')]['length']?_0x2ea638[_0x626e('0x34')]:_0x72c562[_0x626e('0x2f')];if(_0x5d76d7['query'][_0x626e('0x3e')]){_0x2ea638['include']=[{'all':!![]}];}_0x2ea638=_[_0x626e('0x3d')]({},_0x2ea638,_0x5d76d7[_0x626e('0x44')]);return db[_0x626e('0x2b')][_0x626e('0x45')](_0x2ea638)[_0x626e('0x24')](handleEntityNotFound(_0x19dccd,null))[_0x626e('0x24')](respondWithResult(_0x19dccd,null))[_0x626e('0x41')](handleError(_0x19dccd,null));};exports[_0x626e('0x46')]=function(_0x4a8e5f,_0x54964c){return db['FreshsalesField'][_0x626e('0x46')](_0x4a8e5f['body'],{})[_0x626e('0x24')](respondWithResult(_0x54964c,0xc9))['catch'](handleError(_0x54964c,null));};exports[_0x626e('0x23')]=function(_0x57821e,_0x2ae741){if(_0x57821e[_0x626e('0x47')]['id']){delete _0x57821e['body']['id'];}return db['FreshsalesField']['find']({'where':{'id':_0x57821e[_0x626e('0x43')]['id']}})[_0x626e('0x24')](handleEntityNotFound(_0x2ae741,null))[_0x626e('0x24')](saveUpdates(_0x57821e[_0x626e('0x47')],null))[_0x626e('0x24')](respondWithResult(_0x2ae741,null))[_0x626e('0x41')](handleError(_0x2ae741,null));};exports[_0x626e('0x48')]=function(_0x11c893,_0x32d7e0){return db['FreshsalesField'][_0x626e('0x45')]({'where':{'id':_0x11c893['params']['id']}})[_0x626e('0x24')](handleEntityNotFound(_0x32d7e0,null))[_0x626e('0x24')](removeEntity(_0x32d7e0,null))[_0x626e('0x41')](handleError(_0x32d7e0,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index d79d799..74e3bb6 100644 --- a/server/api/intFreshsalesField/intFreshsalesField.model.js +++ b/server/api/intFreshsalesField/intFreshsalesField.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0137=['../../config/environment','./intFreshsalesField.attributes','exports','define','int_freshsales_fields','freshsales_unique_index','idField','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x228f3e,_0x180063){var _0x45ffbc=function(_0x5821f7){while(--_0x5821f7){_0x228f3e['push'](_0x228f3e['shift']());}};_0x45ffbc(++_0x180063);}(_0x0137,0x1d8));var _0x7013=function(_0x334ad2,_0xcd1829){_0x334ad2=_0x334ad2-0x0;var _0x1560eb=_0x0137[_0x334ad2];return _0x1560eb;};'use strict';var _=require(_0x7013('0x0'));var util=require(_0x7013('0x1'));var logger=require(_0x7013('0x2'))(_0x7013('0x3'));var moment=require(_0x7013('0x4'));var BPromise=require('bluebird');var rp=require(_0x7013('0x5'));var fs=require('fs');var path=require(_0x7013('0x6'));var rimraf=require(_0x7013('0x7'));var config=require(_0x7013('0x8'));var attributes=require(_0x7013('0x9'));module[_0x7013('0xa')]=function(_0x50b822,_0x24cb85){return _0x50b822[_0x7013('0xb')]('FreshsalesField',attributes,{'tableName':_0x7013('0xc'),'paranoid':![],'indexes':[{'name':_0x7013('0xd'),'fields':[_0x7013('0xe'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xfa4d=['int_freshsales_fields','freshsales_unique_index','idField','FieldId','lodash','util','api','path','rimraf','../../config/environment','./intFreshsalesField.attributes','exports','define','FreshsalesField'];(function(_0x1e3cc5,_0x409b67){var _0x51792e=function(_0x40ad46){while(--_0x40ad46){_0x1e3cc5['push'](_0x1e3cc5['shift']());}};_0x51792e(++_0x409b67);}(_0xfa4d,0x90));var _0xdfa4=function(_0x5808f5,_0x59d9a2){_0x5808f5=_0x5808f5-0x0;var _0xdbb21c=_0xfa4d[_0x5808f5];return _0xdbb21c;};'use strict';var _=require(_0xdfa4('0x0'));var util=require(_0xdfa4('0x1'));var logger=require('../../config/logger')(_0xdfa4('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xdfa4('0x3'));var rimraf=require(_0xdfa4('0x4'));var config=require(_0xdfa4('0x5'));var attributes=require(_0xdfa4('0x6'));module[_0xdfa4('0x7')]=function(_0x383a02,_0x3e1c11){return _0x383a02[_0xdfa4('0x8')](_0xdfa4('0x9'),attributes,{'tableName':_0xdfa4('0xa'),'paranoid':![],'indexes':[{'name':_0xdfa4('0xb'),'fields':[_0xdfa4('0xc'),_0xdfa4('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.rpc.js b/server/api/intFreshsalesField/intFreshsalesField.rpc.js index dc4ab83..1a6e556 100644 --- a/server/api/intFreshsalesField/intFreshsalesField.rpc.js +++ b/server/api/intFreshsalesField/intFreshsalesField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdbf5=['util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','FreshsalesField,\x20%s,\x20%s','debug','stringify','code','error','message','request\x20sent','result','catch'];(function(_0x2ce30f,_0x15d868){var _0x5e22ed=function(_0x155157){while(--_0x155157){_0x2ce30f['push'](_0x2ce30f['shift']());}};_0x5e22ed(++_0x15d868);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x13c0c3,_0x47fbc3){_0x13c0c3=_0x13c0c3-0x0;var _0x2addec=_0xdbf5[_0x13c0c3];return _0x2addec;};'use strict';var _=require('lodash');var util=require(_0x5dbf('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5dbf('0x1'));var fs=require('fs');var Redis=require(_0x5dbf('0x2'));var db=require(_0x5dbf('0x3'))['db'];var utils=require(_0x5dbf('0x4'));var logger=require(_0x5dbf('0x5'))(_0x5dbf('0x6'));var config=require(_0x5dbf('0x7'));var jayson=require(_0x5dbf('0x8'));var client=jayson[_0x5dbf('0x9')][_0x5dbf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x209b7d,_0x88128e,_0x93e657){return new BPromise(function(_0x52b039,_0x134810){return client['request'](_0x209b7d,_0x93e657)[_0x5dbf('0xb')](function(_0x3bec50){logger[_0x5dbf('0xc')](_0x5dbf('0xd'),_0x88128e,'request\x20sent');logger[_0x5dbf('0xe')]('FreshsalesField,\x20%s,\x20%s,\x20%s',_0x88128e,'request\x20sent',JSON[_0x5dbf('0xf')](_0x3bec50));if(_0x3bec50['error']){if(_0x3bec50['error'][_0x5dbf('0x10')]===0x1f4){logger['error'](_0x5dbf('0xd'),_0x88128e,_0x3bec50[_0x5dbf('0x11')][_0x5dbf('0x12')]);return _0x134810(_0x3bec50[_0x5dbf('0x11')][_0x5dbf('0x12')]);}logger['error']('FreshsalesField,\x20%s,\x20%s',_0x88128e,_0x3bec50[_0x5dbf('0x11')][_0x5dbf('0x12')]);return _0x52b039(_0x3bec50['error'][_0x5dbf('0x12')]);}else{logger[_0x5dbf('0xc')](_0x5dbf('0xd'),_0x88128e,_0x5dbf('0x13'));_0x52b039(_0x3bec50[_0x5dbf('0x14')][_0x5dbf('0x12')]);}})[_0x5dbf('0x15')](function(_0x50ef1d){logger['error'](_0x5dbf('0xd'),_0x88128e,_0x50ef1d);_0x134810(_0x50ef1d);});});} \ No newline at end of file +var _0x90b1=['message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','http','request','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0xf3ea9e,_0x4a5ee7){var _0x4fc403=function(_0x420e00){while(--_0x420e00){_0xf3ea9e['push'](_0xf3ea9e['shift']());}};_0x4fc403(++_0x4a5ee7);}(_0x90b1,0x1bb));var _0x190b=function(_0x525798,_0x77a707){_0x525798=_0x525798-0x0;var _0x57da9a=_0x90b1[_0x525798];return _0x57da9a;};'use strict';var _=require(_0x190b('0x0'));var util=require(_0x190b('0x1'));var moment=require(_0x190b('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x190b('0x3'));var db=require(_0x190b('0x4'))['db'];var utils=require(_0x190b('0x5'));var logger=require(_0x190b('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x190b('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x34a689,_0x3b57f7,_0x626aa1){return new BPromise(function(_0x311161,_0x802924){return client[_0x190b('0x8')](_0x34a689,_0x626aa1)['then'](function(_0x14b93d){logger[_0x190b('0x9')](_0x190b('0xa'),_0x3b57f7,_0x190b('0xb'));logger[_0x190b('0xc')](_0x190b('0xd'),_0x3b57f7,_0x190b('0xb'),JSON[_0x190b('0xe')](_0x14b93d));if(_0x14b93d['error']){if(_0x14b93d[_0x190b('0xf')][_0x190b('0x10')]===0x1f4){logger['error'](_0x190b('0xa'),_0x3b57f7,_0x14b93d[_0x190b('0xf')][_0x190b('0x11')]);return _0x802924(_0x14b93d[_0x190b('0xf')][_0x190b('0x11')]);}logger[_0x190b('0xf')](_0x190b('0xa'),_0x3b57f7,_0x14b93d[_0x190b('0xf')][_0x190b('0x11')]);return _0x311161(_0x14b93d[_0x190b('0xf')][_0x190b('0x11')]);}else{logger[_0x190b('0x9')](_0x190b('0xa'),_0x3b57f7,_0x190b('0xb'));_0x311161(_0x14b93d[_0x190b('0x12')][_0x190b('0x11')]);}})[_0x190b('0x13')](function(_0x5c63d9){logger[_0x190b('0xf')]('FreshsalesField,\x20%s,\x20%s',_0x3b57f7,_0x5c63d9);_0x802924(_0x5c63d9);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 5692d8f..e883ae2 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 _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0xde978a,_0x6c1b77){var _0x5904db=function(_0xb29040){while(--_0xb29040){_0xde978a['push'](_0xde978a['shift']());}};_0x5904db(++_0x6c1b77);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xa9e0[_0x1ac595];return _0x455fff;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file +var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x3b9a5f,_0x2dc970){var _0x156136=function(_0x51b752){while(--_0x51b752){_0x3b9a5f['push'](_0x3b9a5f['shift']());}};_0x156136(++_0x2dc970);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index 3af15c2..8202b6e 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 _0x4d4e=['sequelize','STRING','username','ENUM'];(function(_0x29d3ab,_0x32af1a){var _0x2b49b8=function(_0x5b773c){while(--_0x5b773c){_0x29d3ab['push'](_0x29d3ab['shift']());}};_0x2b49b8(++_0x32af1a);}(_0x4d4e,0xa4));var _0xe4d4=function(_0x34b951,_0x554a89){_0x34b951=_0x34b951-0x0;var _0x2b259f=_0x4d4e[_0x34b951];return _0x2b259f;};'use strict';var Sequelize=require(_0xe4d4('0x0'));module['exports']={'name':{'type':Sequelize[_0xe4d4('0x1')]},'description':{'type':Sequelize[_0xe4d4('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0xe4d4('0x2')},'remoteUri':{'type':Sequelize[_0xe4d4('0x1')]},'password':{'type':Sequelize[_0xe4d4('0x1')]},'clientId':{'type':Sequelize[_0xe4d4('0x1')]},'clientSecret':{'type':Sequelize[_0xe4d4('0x1')]},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xe4d4('0x3')]('integrationTab','newTab'),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0x1399=['STRING','username','integrationTab','newTab','sequelize','exports'];(function(_0x22377a,_0x3397cb){var _0x36f105=function(_0x2174cc){while(--_0x2174cc){_0x22377a['push'](_0x22377a['shift']());}};_0x36f105(++_0x3397cb);}(_0x1399,0x16c));var _0x9139=function(_0x79e316,_0x38e778){_0x79e316=_0x79e316-0x0;var _0xb8b436=_0x1399[_0x79e316];return _0xb8b436;};'use strict';var Sequelize=require(_0x9139('0x0'));module[_0x9139('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x9139('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x9139('0x3')},'remoteUri':{'type':Sequelize[_0x9139('0x2')]},'password':{'type':Sequelize[_0x9139('0x2')]},'clientId':{'type':Sequelize[_0x9139('0x2')]},'clientSecret':{'type':Sequelize[_0x9139('0x2')]},'securityToken':{'type':Sequelize[_0x9139('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x9139('0x4'),_0x9139('0x5')),'defaultValue':_0x9139('0x4')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 098f566..6fc7a0d 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 _0xd99c=['Subject','Description','int','picklist','boolean','email','textarea','includes','label','picklistValues','value','true','False','false','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','rimraf','zip-dir','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','map','SalesforceAccount','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','findOne','filter','getConfigurations','hasOwnProperty','addConfiguration','AccountId','getSubjects','Descriptions','getDescriptions','channel','SalesforceConfiguration','SalesforceField','Subjects','remoteUri','clientId','clientSecret','username','password','securityToken','slice','substring','lastIndexOf','Connection','concat','ticketType','sobject','describe','ActivityDate','IsReminderSet','IsRecurrence'];(function(_0x3702fc,_0x359685){var _0x1c0322=function(_0x286beb){while(--_0x286beb){_0x3702fc['push'](_0x3702fc['shift']());}};_0x1c0322(++_0x359685);}(_0xd99c,0x8c));var _0xcd99=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd99c[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xcd99('0x0'));var rimraf=require(_0xcd99('0x1'));var zipdir=require(_0xcd99('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcd99('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xcd99('0x4'));var util=require('util');var path=require(_0xcd99('0x5'));var sox=require(_0xcd99('0x6'));var csv=require(_0xcd99('0x7'));var ejs=require(_0xcd99('0x8'));var fs=require('fs');var fs_extra=require(_0xcd99('0x9'));var _=require(_0xcd99('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xcd99('0xb'));var deskjs=require(_0xcd99('0xc'));var toCsv=require(_0xcd99('0x7'));var querystring=require(_0xcd99('0xd'));var Papa=require('papaparse');var Redis=require(_0xcd99('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xcd99('0xf'));var as=require(_0xcd99('0x10'));var hardwareService=require(_0xcd99('0x11'));var logger=require(_0xcd99('0x12'))(_0xcd99('0x13'));var utils=require(_0xcd99('0x14'));var config=require(_0xcd99('0x15'));var licenseUtil=require(_0xcd99('0x16'));var db=require(_0xcd99('0x17'))['db'];var integrations=require(_0xcd99('0x18'));function respondWithStatusCode(_0x4114f7,_0x507c18){_0x507c18=_0x507c18||0xcc;return function(_0x1fbcae){if(_0x1fbcae){return _0x4114f7[_0xcd99('0x19')](_0x507c18);}return _0x4114f7['status'](_0x507c18)[_0xcd99('0x1a')]();};}function respondWithResult(_0x3b09ae,_0x4742e4){_0x4742e4=_0x4742e4||0xc8;return function(_0x40947b){if(_0x40947b){return _0x3b09ae[_0xcd99('0x1b')](_0x4742e4)['json'](_0x40947b);}};}function respondWithFilteredResult(_0x209938,_0x2adea9){return function(_0x2c2a8a){if(_0x2c2a8a){var _0x26daf4=typeof _0x2adea9[_0xcd99('0x1c')]==='undefined'&&typeof _0x2adea9[_0xcd99('0x1d')]===_0xcd99('0x1e');var _0xfe8a2f=_0x2c2a8a[_0xcd99('0x1f')];var _0x1a1a39=_0x26daf4?0x0:_0x2adea9['offset'];var _0x4f3c24=_0x26daf4?_0x2c2a8a[_0xcd99('0x1f')]:_0x2adea9[_0xcd99('0x1c')]+_0x2adea9[_0xcd99('0x1d')];var _0x217a57;if(_0x4f3c24>=_0xfe8a2f){_0x4f3c24=_0xfe8a2f;_0x217a57=0xc8;}else{_0x217a57=0xce;}_0x209938[_0xcd99('0x1b')](_0x217a57);return _0x209938[_0xcd99('0x20')](_0xcd99('0x21'),_0x1a1a39+'-'+_0x4f3c24+'/'+_0xfe8a2f)['json'](_0x2c2a8a);}return null;};}function patchUpdates(_0x1f4dbe){return function(_0xc1661d){try{jsonpatch[_0xcd99('0x22')](_0xc1661d,_0x1f4dbe,!![]);}catch(_0x58034f){return BPromise[_0xcd99('0x23')](_0x58034f);}return _0xc1661d['save']();};}function saveUpdates(_0x206469,_0x39d829){return function(_0x4bb007){if(_0x4bb007){return _0x4bb007[_0xcd99('0x24')](_0x206469)[_0xcd99('0x25')](function(_0x1b16c5){return _0x1b16c5;});}return null;};}function removeEntity(_0x5763a4,_0x3aced4){return function(_0x2598d1){if(_0x2598d1){return _0x2598d1[_0xcd99('0x26')]()[_0xcd99('0x25')](function(){_0x5763a4[_0xcd99('0x1b')](0xcc)[_0xcd99('0x1a')]();});}};}function handleEntityNotFound(_0x521d6d,_0xb1df1a){return function(_0x153fc5){if(!_0x153fc5){_0x521d6d[_0xcd99('0x19')](0x194);}return _0x153fc5;};}function handleError(_0x3c2dfd,_0x263217){_0x263217=_0x263217||0x1f4;return function(_0x6aa9d7){logger[_0xcd99('0x27')](_0x6aa9d7[_0xcd99('0x28')]);if(_0x6aa9d7[_0xcd99('0x29')]){delete _0x6aa9d7[_0xcd99('0x29')];}_0x3c2dfd[_0xcd99('0x1b')](_0x263217)['send'](_0x6aa9d7);};}exports['index']=function(_0x580784,_0x36c524){var _0x283ade={},_0x38abfa={},_0x162587={'count':0x0,'rows':[]};var _0x18d804=_[_0xcd99('0x2a')](db[_0xcd99('0x2b')][_0xcd99('0x2c')],function(_0x44813b){return{'name':_0x44813b[_0xcd99('0x2d')],'type':_0x44813b[_0xcd99('0x2e')][_0xcd99('0x2f')]};});_0x38abfa[_0xcd99('0x30')]=_[_0xcd99('0x2a')](_0x18d804,_0xcd99('0x29'));_0x38abfa[_0xcd99('0x31')]=_[_0xcd99('0x32')](_0x580784['query']);_0x38abfa['filters']=_[_0xcd99('0x33')](_0x38abfa[_0xcd99('0x30')],_0x38abfa[_0xcd99('0x31')]);_0x283ade[_0xcd99('0x34')]=_['intersection'](_0x38abfa[_0xcd99('0x30')],qs['fields'](_0x580784[_0xcd99('0x31')][_0xcd99('0x35')]));_0x283ade[_0xcd99('0x34')]=_0x283ade['attributes'][_0xcd99('0x36')]?_0x283ade[_0xcd99('0x34')]:_0x38abfa['model'];if(!_0x580784[_0xcd99('0x31')]['hasOwnProperty'](_0xcd99('0x37'))){_0x283ade['limit']=qs['limit'](_0x580784[_0xcd99('0x31')][_0xcd99('0x1d')]);_0x283ade[_0xcd99('0x1c')]=qs[_0xcd99('0x1c')](_0x580784['query']['offset']);}_0x283ade[_0xcd99('0x38')]=qs[_0xcd99('0x39')](_0x580784[_0xcd99('0x31')][_0xcd99('0x39')]);_0x283ade[_0xcd99('0x3a')]=qs[_0xcd99('0x3b')](_[_0xcd99('0x3c')](_0x580784[_0xcd99('0x31')],_0x38abfa[_0xcd99('0x3b')]),_0x18d804);if(_0x580784[_0xcd99('0x31')]['filter']){_0x283ade[_0xcd99('0x3a')]=_[_0xcd99('0x3d')](_0x283ade[_0xcd99('0x3a')],{'$or':_[_0xcd99('0x2a')](_0x18d804,function(_0x1411f0){if(_0x1411f0['type']!==_0xcd99('0x3e')){var _0x8f0a15={};_0x8f0a15[_0x1411f0['name']]={'$like':'%'+_0x580784['query']['filter']+'%'};return _0x8f0a15;}})});}_0x283ade=_[_0xcd99('0x3d')]({},_0x283ade,_0x580784[_0xcd99('0x3f')]);var _0x2af1df={'where':_0x283ade[_0xcd99('0x3a')]};return db[_0xcd99('0x2b')][_0xcd99('0x1f')](_0x2af1df)['then'](function(_0x405bde){_0x162587[_0xcd99('0x1f')]=_0x405bde;if(_0x580784[_0xcd99('0x31')]['includeAll']){_0x283ade[_0xcd99('0x40')]=[{'all':!![]}];}return db['SalesforceAccount'][_0xcd99('0x41')](_0x283ade);})[_0xcd99('0x25')](function(_0x5afd6c){_0x162587[_0xcd99('0x42')]=_0x5afd6c;return _0x162587;})[_0xcd99('0x25')](respondWithFilteredResult(_0x36c524,_0x283ade))[_0xcd99('0x43')](handleError(_0x36c524,null));};exports[_0xcd99('0x44')]=function(_0x1a1422,_0x124829){var _0x296527={'raw':![],'where':{'id':_0x1a1422[_0xcd99('0x45')]['id']}},_0x41a85a={};_0x41a85a['model']=_[_0xcd99('0x32')](db[_0xcd99('0x2b')]['rawAttributes']);_0x41a85a[_0xcd99('0x31')]=_[_0xcd99('0x32')](_0x1a1422['query']);_0x41a85a[_0xcd99('0x3b')]=_[_0xcd99('0x33')](_0x41a85a[_0xcd99('0x30')],_0x41a85a[_0xcd99('0x31')]);_0x296527['attributes']=_['intersection'](_0x41a85a[_0xcd99('0x30')],qs[_0xcd99('0x35')](_0x1a1422[_0xcd99('0x31')][_0xcd99('0x35')]));_0x296527[_0xcd99('0x34')]=_0x296527[_0xcd99('0x34')][_0xcd99('0x36')]?_0x296527[_0xcd99('0x34')]:_0x41a85a[_0xcd99('0x30')];if(_0x1a1422[_0xcd99('0x31')][_0xcd99('0x46')]){_0x296527[_0xcd99('0x40')]=[{'all':!![]}];}_0x296527=_['merge']({},_0x296527,_0x1a1422[_0xcd99('0x3f')]);return db[_0xcd99('0x2b')][_0xcd99('0x47')](_0x296527)['then'](handleEntityNotFound(_0x124829,null))[_0xcd99('0x25')](respondWithResult(_0x124829,null))[_0xcd99('0x43')](handleError(_0x124829,null));};exports['create']=function(_0x53b864,_0x46ce39){return db[_0xcd99('0x2b')][_0xcd99('0x48')](_0x53b864['body'],{})[_0xcd99('0x25')](respondWithResult(_0x46ce39,0xc9))[_0xcd99('0x43')](handleError(_0x46ce39,null));};exports[_0xcd99('0x24')]=function(_0x5bd56b,_0x15149f){if(_0x5bd56b[_0xcd99('0x49')]['id']){delete _0x5bd56b[_0xcd99('0x49')]['id'];}return db[_0xcd99('0x2b')][_0xcd99('0x47')]({'where':{'id':_0x5bd56b[_0xcd99('0x45')]['id']}})[_0xcd99('0x25')](handleEntityNotFound(_0x15149f,null))[_0xcd99('0x25')](saveUpdates(_0x5bd56b[_0xcd99('0x49')],null))[_0xcd99('0x25')](respondWithResult(_0x15149f,null))[_0xcd99('0x43')](handleError(_0x15149f,null));};exports[_0xcd99('0x26')]=function(_0x255899,_0x5bba77){return db['SalesforceAccount'][_0xcd99('0x47')]({'where':{'id':_0x255899[_0xcd99('0x45')]['id']}})['then'](handleEntityNotFound(_0x5bba77,null))[_0xcd99('0x25')](removeEntity(_0x5bba77,null))[_0xcd99('0x43')](handleError(_0x5bba77,null));};exports['getConfigurations']=function(_0x34b100,_0x41224f,_0x348b4f){var _0x370fe8={};var _0x4acb91={};var _0x82ace;var _0x43e583;return db['SalesforceAccount'][_0xcd99('0x4a')]({'where':{'id':_0x34b100[_0xcd99('0x45')]['id']}})[_0xcd99('0x25')](handleEntityNotFound(_0x41224f,null))[_0xcd99('0x25')](function(_0x59a836){if(_0x59a836){_0x82ace=_0x59a836;_0x4acb91['model']=_[_0xcd99('0x32')](db['SalesforceConfiguration']['rawAttributes']);_0x4acb91[_0xcd99('0x31')]=_[_0xcd99('0x32')](_0x34b100['query']);_0x4acb91[_0xcd99('0x3b')]=_[_0xcd99('0x33')](_0x4acb91[_0xcd99('0x30')],_0x4acb91[_0xcd99('0x31')]);_0x370fe8[_0xcd99('0x34')]=_['intersection'](_0x4acb91[_0xcd99('0x30')],qs['fields'](_0x34b100[_0xcd99('0x31')][_0xcd99('0x35')]));_0x370fe8[_0xcd99('0x34')]=_0x370fe8['attributes']['length']?_0x370fe8[_0xcd99('0x34')]:_0x4acb91['model'];_0x370fe8[_0xcd99('0x38')]=qs[_0xcd99('0x39')](_0x34b100[_0xcd99('0x31')]['sort']);_0x370fe8[_0xcd99('0x3a')]=qs[_0xcd99('0x3b')](_[_0xcd99('0x3c')](_0x34b100[_0xcd99('0x31')],_0x4acb91[_0xcd99('0x3b')]));if(_0x34b100[_0xcd99('0x31')]['filter']){_0x370fe8['where']=_[_0xcd99('0x3d')](_0x370fe8[_0xcd99('0x3a')],{'$or':_[_0xcd99('0x2a')](_0x370fe8[_0xcd99('0x34')],function(_0x5ca922){var _0x34e0ce={};_0x34e0ce[_0x5ca922]={'$like':'%'+_0x34b100[_0xcd99('0x31')][_0xcd99('0x4b')]+'%'};return _0x34e0ce;})});}_0x370fe8=_[_0xcd99('0x3d')]({},_0x370fe8,_0x34b100[_0xcd99('0x3f')]);return _0x82ace[_0xcd99('0x4c')](_0x370fe8);}})[_0xcd99('0x25')](function(_0x39eb4a){if(_0x39eb4a){_0x43e583=_0x39eb4a['length'];if(!_0x34b100[_0xcd99('0x31')][_0xcd99('0x4d')]('nolimit')){_0x370fe8['limit']=qs[_0xcd99('0x1d')](_0x34b100[_0xcd99('0x31')][_0xcd99('0x1d')]);_0x370fe8[_0xcd99('0x1c')]=qs[_0xcd99('0x1c')](_0x34b100[_0xcd99('0x31')][_0xcd99('0x1c')]);}return _0x82ace['getConfigurations'](_0x370fe8);}})[_0xcd99('0x25')](function(_0x1af6a4){if(_0x1af6a4){return _0x1af6a4?{'count':_0x43e583,'rows':_0x1af6a4}:null;}})['then'](respondWithResult(_0x41224f,null))[_0xcd99('0x43')](handleError(_0x41224f,null));};exports[_0xcd99('0x4e')]=function(_0x3c00ce,_0x38b85c,_0x3aef5d){if(_0x3c00ce['body']['id']){delete _0x3c00ce[_0xcd99('0x49')]['id'];}return db['SalesforceAccount']['findOne']({'where':{'id':_0x3c00ce[_0xcd99('0x45')]['id']}})['then'](handleEntityNotFound(_0x38b85c,null))['then'](function(_0x445585){if(_0x445585){_0x3c00ce['body'][_0xcd99('0x4f')]=_0x445585['id'];_0x3c00ce[_0xcd99('0x49')]['Subjects']=integrations[_0xcd99('0x50')](_0x3c00ce[_0xcd99('0x49')]['channel'],_0x3c00ce['body'][_0xcd99('0x2e')]);_0x3c00ce['body'][_0xcd99('0x51')]=integrations[_0xcd99('0x52')](_0x3c00ce[_0xcd99('0x49')][_0xcd99('0x53')],_0x3c00ce[_0xcd99('0x49')][_0xcd99('0x2e')]);return db[_0xcd99('0x54')]['create'](_0x3c00ce['body'],{'include':[{'model':db[_0xcd99('0x55')],'as':_0xcd99('0x56')},{'model':db[_0xcd99('0x55')],'as':_0xcd99('0x51')}]});}return null;})[_0xcd99('0x25')](respondWithResult(_0x38b85c,null))[_0xcd99('0x43')](handleError(_0x38b85c,null));};exports['getFields']=function(_0x43c4f7,_0x1e84bc,_0x24e45b){var _0x4625d7;var _0x2814d3='';var _0x503ca9='Task';return db[_0xcd99('0x2b')][_0xcd99('0x4a')]({'where':{'id':_0x43c4f7[_0xcd99('0x45')]['id']},'attributes':['id',_0xcd99('0x57'),_0xcd99('0x58'),_0xcd99('0x59'),_0xcd99('0x5a'),_0xcd99('0x5b'),_0xcd99('0x5c')]})[_0xcd99('0x25')](handleEntityNotFound(_0x1e84bc,null))['then'](function(_0x179c87){if(_0x179c87){_0x2814d3=_0x179c87[_0xcd99('0x57')];var _0x1317c9=_0x2814d3[_0xcd99('0x5d')](-0x1);if(_0x1317c9==='/'){_0x2814d3=_0x2814d3[_0xcd99('0x5e')](0x0,_0x2814d3[_0xcd99('0x5f')](_0x1317c9));}_0x4625d7=new jsforce[(_0xcd99('0x60'))]({'oauth2':{'loginUrl':_0x2814d3,'clientId':_0x179c87[_0xcd99('0x58')],'clientSecret':_0x179c87[_0xcd99('0x59')]}});return _0x4625d7['login'](_0x179c87[_0xcd99('0x5a')],_0x179c87['password'][_0xcd99('0x61')](_0x179c87[_0xcd99('0x5c')]));}})[_0xcd99('0x25')](function(_0x4bc72e){if(_0x4bc72e){if(!_['isNil'](_0x43c4f7[_0xcd99('0x31')][_0xcd99('0x62')])){_0x503ca9=_0x43c4f7[_0xcd99('0x31')][_0xcd99('0x62')];}return _0x4625d7[_0xcd99('0x63')](_0x503ca9)[_0xcd99('0x64')]();}})[_0xcd99('0x25')](function(_0x22ae77){var _0x5424de=['OwnerId',_0xcd99('0x65'),_0xcd99('0x66'),_0xcd99('0x67'),_0xcd99('0x68'),_0xcd99('0x69')];var _0x4eef6d=['string',_0xcd99('0x6a'),_0xcd99('0x6b'),_0xcd99('0x6c'),_0xcd99('0x6d'),_0xcd99('0x6e'),'phone'];if(_0x22ae77){_['remove'](_0x22ae77[_0xcd99('0x35')],function(_0x21c440){return _0x5424de[_0xcd99('0x6f')](_0x21c440[_0xcd99('0x29')])||!_0x4eef6d[_0xcd99('0x6f')](_0x21c440[_0xcd99('0x2e')]);});return{'count':_0x22ae77[_0xcd99('0x35')][_0xcd99('0x36')],'rows':_[_0xcd99('0x2a')](_0x22ae77['fields'],function(_0x8c3ba9){return{'id':_0x8c3ba9[_0xcd99('0x29')],'name':_0x8c3ba9[_0xcd99('0x70')],'custom':_0x8c3ba9['custom'],'options':_0x8c3ba9[_0xcd99('0x71')][_0xcd99('0x36')]>0x0?_[_0xcd99('0x2a')](_0x8c3ba9[_0xcd99('0x71')],function(_0x4dc01c){return{'name':_0x4dc01c[_0xcd99('0x70')],'value':_0x4dc01c[_0xcd99('0x72')]};}):_0x8c3ba9['type']=='boolean'?[{'name':'True','value':_0xcd99('0x73')},{'name':_0xcd99('0x74'),'value':_0xcd99('0x75')}]:[]};})};}})[_0xcd99('0x25')](respondWithResult(_0x1e84bc,null))[_0xcd99('0x43')](function(_0x4c3a32){var _0x57753f=_0x43c4f7[_0xcd99('0x31')][_0xcd99('0x76')]?0x1f4:_0x4c3a32[_0xcd99('0x77')]||0x1f4;logger[_0xcd99('0x27')](_0xcd99('0x78'),'getFields',_0x57753f,JSON[_0xcd99('0x79')](_0x4c3a32));delete _0x4c3a32[_0xcd99('0x29')];if(_0x57753f===0x191){_0x57753f=0x190;}_0x1e84bc['status'](_0x57753f)['send'](_0x43c4f7[_0xcd99('0x31')][_0xcd99('0x76')]?{'message':'Wrong\x20credentials','statusCode':_0x4c3a32[_0xcd99('0x77')]}:_0x4c3a32);});}; \ No newline at end of file +var _0x2efb=['remove','includes','label','custom','picklistValues','value','True','true','False','false','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','count','limit','reject','save','update','destroy','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','SalesforceAccount','catch','params','includeAll','include','body','find','getConfigurations','SalesforceConfiguration','addConfiguration','findOne','AccountId','channel','Descriptions','getDescriptions','create','SalesforceField','getFields','remoteUri','clientId','username','securityToken','slice','substring','Connection','clientSecret','login','password','concat','ticketType','sobject','ActivityDate','IsReminderSet','string','int','picklist','boolean','email','phone'];(function(_0x2e1471,_0x145d83){var _0x197364=function(_0x42f5b3){while(--_0x42f5b3){_0x2e1471['push'](_0x2e1471['shift']());}};_0x197364(++_0x145d83);}(_0x2efb,0x170));var _0xb2ef=function(_0x5c8209,_0x4ab695){_0x5c8209=_0x5c8209-0x0;var _0x2e2122=_0x2efb[_0x5c8209];return _0x2e2122;};'use strict';var emlformat=require(_0xb2ef('0x0'));var rimraf=require(_0xb2ef('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb2ef('0x2'));var rp=require(_0xb2ef('0x3'));var moment=require(_0xb2ef('0x4'));var BPromise=require(_0xb2ef('0x5'));var Mustache=require(_0xb2ef('0x6'));var util=require(_0xb2ef('0x7'));var path=require(_0xb2ef('0x8'));var sox=require(_0xb2ef('0x9'));var csv=require(_0xb2ef('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb2ef('0xb'));var _=require(_0xb2ef('0xc'));var squel=require(_0xb2ef('0xd'));var crypto=require(_0xb2ef('0xe'));var jsforce=require(_0xb2ef('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xb2ef('0xa'));var querystring=require(_0xb2ef('0x10'));var Papa=require(_0xb2ef('0x11'));var Redis=require('ioredis');var authService=require(_0xb2ef('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xb2ef('0x13'));var hardwareService=require(_0xb2ef('0x14'));var logger=require(_0xb2ef('0x15'))(_0xb2ef('0x16'));var utils=require(_0xb2ef('0x17'));var config=require(_0xb2ef('0x18'));var licenseUtil=require(_0xb2ef('0x19'));var db=require(_0xb2ef('0x1a'))['db'];var integrations=require(_0xb2ef('0x1b'));function respondWithStatusCode(_0x2a625c,_0x2b4250){_0x2b4250=_0x2b4250||0xcc;return function(_0x445281){if(_0x445281){return _0x2a625c[_0xb2ef('0x1c')](_0x2b4250);}return _0x2a625c[_0xb2ef('0x1d')](_0x2b4250)['end']();};}function respondWithResult(_0x5bb8c6,_0x55e385){_0x55e385=_0x55e385||0xc8;return function(_0x21ec34){if(_0x21ec34){return _0x5bb8c6[_0xb2ef('0x1d')](_0x55e385)[_0xb2ef('0x1e')](_0x21ec34);}};}function respondWithFilteredResult(_0xedb52,_0x292dde){return function(_0x8ff73c){if(_0x8ff73c){var _0x170e3d=typeof _0x292dde[_0xb2ef('0x1f')]==='undefined'&&typeof _0x292dde['limit']==='undefined';var _0x55c846=_0x8ff73c[_0xb2ef('0x20')];var _0xb9f08c=_0x170e3d?0x0:_0x292dde[_0xb2ef('0x1f')];var _0x436e17=_0x170e3d?_0x8ff73c[_0xb2ef('0x20')]:_0x292dde[_0xb2ef('0x1f')]+_0x292dde[_0xb2ef('0x21')];var _0x2f3afe;if(_0x436e17>=_0x55c846){_0x436e17=_0x55c846;_0x2f3afe=0xc8;}else{_0x2f3afe=0xce;}_0xedb52['status'](_0x2f3afe);return _0xedb52['set']('Content-Range',_0xb9f08c+'-'+_0x436e17+'/'+_0x55c846)['json'](_0x8ff73c);}return null;};}function patchUpdates(_0x308d08){return function(_0x18ba1b){try{jsonpatch['apply'](_0x18ba1b,_0x308d08,!![]);}catch(_0x33cbed){return BPromise[_0xb2ef('0x22')](_0x33cbed);}return _0x18ba1b[_0xb2ef('0x23')]();};}function saveUpdates(_0x386f14,_0x202101){return function(_0x434b71){if(_0x434b71){return _0x434b71[_0xb2ef('0x24')](_0x386f14)['then'](function(_0x2b5700){return _0x2b5700;});}return null;};}function removeEntity(_0x1ffa33,_0x5b8c47){return function(_0x39fe73){if(_0x39fe73){return _0x39fe73[_0xb2ef('0x25')]()[_0xb2ef('0x26')](function(){_0x1ffa33[_0xb2ef('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x525b11,_0x48c303){return function(_0x3cf854){if(!_0x3cf854){_0x525b11[_0xb2ef('0x1c')](0x194);}return _0x3cf854;};}function handleError(_0x352549,_0x525674){_0x525674=_0x525674||0x1f4;return function(_0x5cac90){logger[_0xb2ef('0x27')](_0x5cac90[_0xb2ef('0x28')]);if(_0x5cac90['name']){delete _0x5cac90[_0xb2ef('0x29')];}_0x352549['status'](_0x525674)[_0xb2ef('0x2a')](_0x5cac90);};}exports[_0xb2ef('0x2b')]=function(_0x4c4408,_0x4c1164){var _0x100717={},_0x14ced4={},_0x26e59f={'count':0x0,'rows':[]};var _0x383d2f=_[_0xb2ef('0x2c')](db['SalesforceAccount'][_0xb2ef('0x2d')],function(_0x21f182){return{'name':_0x21f182[_0xb2ef('0x2e')],'type':_0x21f182[_0xb2ef('0x2f')]['key']};});_0x14ced4[_0xb2ef('0x30')]=_[_0xb2ef('0x2c')](_0x383d2f,_0xb2ef('0x29'));_0x14ced4[_0xb2ef('0x31')]=_[_0xb2ef('0x32')](_0x4c4408[_0xb2ef('0x31')]);_0x14ced4[_0xb2ef('0x33')]=_[_0xb2ef('0x34')](_0x14ced4[_0xb2ef('0x30')],_0x14ced4[_0xb2ef('0x31')]);_0x100717['attributes']=_[_0xb2ef('0x34')](_0x14ced4['model'],qs[_0xb2ef('0x35')](_0x4c4408['query'][_0xb2ef('0x35')]));_0x100717[_0xb2ef('0x36')]=_0x100717[_0xb2ef('0x36')][_0xb2ef('0x37')]?_0x100717[_0xb2ef('0x36')]:_0x14ced4[_0xb2ef('0x30')];if(!_0x4c4408['query'][_0xb2ef('0x38')](_0xb2ef('0x39'))){_0x100717[_0xb2ef('0x21')]=qs['limit'](_0x4c4408[_0xb2ef('0x31')][_0xb2ef('0x21')]);_0x100717[_0xb2ef('0x1f')]=qs['offset'](_0x4c4408[_0xb2ef('0x31')][_0xb2ef('0x1f')]);}_0x100717[_0xb2ef('0x3a')]=qs[_0xb2ef('0x3b')](_0x4c4408[_0xb2ef('0x31')]['sort']);_0x100717[_0xb2ef('0x3c')]=qs['filters'](_[_0xb2ef('0x3d')](_0x4c4408[_0xb2ef('0x31')],_0x14ced4[_0xb2ef('0x33')]),_0x383d2f);if(_0x4c4408[_0xb2ef('0x31')][_0xb2ef('0x3e')]){_0x100717[_0xb2ef('0x3c')]=_[_0xb2ef('0x3f')](_0x100717['where'],{'$or':_['map'](_0x383d2f,function(_0x2489ea){if(_0x2489ea[_0xb2ef('0x2f')]!=='VIRTUAL'){var _0x1c246b={};_0x1c246b[_0x2489ea[_0xb2ef('0x29')]]={'$like':'%'+_0x4c4408[_0xb2ef('0x31')][_0xb2ef('0x3e')]+'%'};return _0x1c246b;}})});}_0x100717=_['merge']({},_0x100717,_0x4c4408[_0xb2ef('0x40')]);var _0x1f09a6={'where':_0x100717['where']};return db['SalesforceAccount'][_0xb2ef('0x20')](_0x1f09a6)['then'](function(_0x5bb938){_0x26e59f[_0xb2ef('0x20')]=_0x5bb938;if(_0x4c4408[_0xb2ef('0x31')]['includeAll']){_0x100717['include']=[{'all':!![]}];}return db[_0xb2ef('0x41')]['findAll'](_0x100717);})[_0xb2ef('0x26')](function(_0x501ae7){_0x26e59f['rows']=_0x501ae7;return _0x26e59f;})[_0xb2ef('0x26')](respondWithFilteredResult(_0x4c1164,_0x100717))[_0xb2ef('0x42')](handleError(_0x4c1164,null));};exports['show']=function(_0x3b7f42,_0x4f2ae8){var _0x4f4b1c={'raw':![],'where':{'id':_0x3b7f42[_0xb2ef('0x43')]['id']}},_0x3effdc={};_0x3effdc['model']=_[_0xb2ef('0x32')](db['SalesforceAccount'][_0xb2ef('0x2d')]);_0x3effdc['query']=_[_0xb2ef('0x32')](_0x3b7f42['query']);_0x3effdc[_0xb2ef('0x33')]=_[_0xb2ef('0x34')](_0x3effdc[_0xb2ef('0x30')],_0x3effdc[_0xb2ef('0x31')]);_0x4f4b1c['attributes']=_['intersection'](_0x3effdc[_0xb2ef('0x30')],qs[_0xb2ef('0x35')](_0x3b7f42['query'][_0xb2ef('0x35')]));_0x4f4b1c[_0xb2ef('0x36')]=_0x4f4b1c[_0xb2ef('0x36')][_0xb2ef('0x37')]?_0x4f4b1c[_0xb2ef('0x36')]:_0x3effdc[_0xb2ef('0x30')];if(_0x3b7f42['query'][_0xb2ef('0x44')]){_0x4f4b1c[_0xb2ef('0x45')]=[{'all':!![]}];}_0x4f4b1c=_[_0xb2ef('0x3f')]({},_0x4f4b1c,_0x3b7f42[_0xb2ef('0x40')]);return db[_0xb2ef('0x41')]['find'](_0x4f4b1c)[_0xb2ef('0x26')](handleEntityNotFound(_0x4f2ae8,null))[_0xb2ef('0x26')](respondWithResult(_0x4f2ae8,null))[_0xb2ef('0x42')](handleError(_0x4f2ae8,null));};exports['create']=function(_0x381a94,_0x3a752e){return db[_0xb2ef('0x41')]['create'](_0x381a94['body'],{})[_0xb2ef('0x26')](respondWithResult(_0x3a752e,0xc9))[_0xb2ef('0x42')](handleError(_0x3a752e,null));};exports['update']=function(_0x20a8a5,_0x1c18ef){if(_0x20a8a5[_0xb2ef('0x46')]['id']){delete _0x20a8a5[_0xb2ef('0x46')]['id'];}return db['SalesforceAccount'][_0xb2ef('0x47')]({'where':{'id':_0x20a8a5['params']['id']}})[_0xb2ef('0x26')](handleEntityNotFound(_0x1c18ef,null))[_0xb2ef('0x26')](saveUpdates(_0x20a8a5['body'],null))[_0xb2ef('0x26')](respondWithResult(_0x1c18ef,null))['catch'](handleError(_0x1c18ef,null));};exports['destroy']=function(_0x2b9873,_0x361803){return db[_0xb2ef('0x41')][_0xb2ef('0x47')]({'where':{'id':_0x2b9873['params']['id']}})['then'](handleEntityNotFound(_0x361803,null))[_0xb2ef('0x26')](removeEntity(_0x361803,null))[_0xb2ef('0x42')](handleError(_0x361803,null));};exports[_0xb2ef('0x48')]=function(_0x521ceb,_0x1eaa26,_0x1f213d){var _0xd994ff={};var _0x546228={};var _0x4cbf54;var _0xcd0181;return db[_0xb2ef('0x41')]['findOne']({'where':{'id':_0x521ceb[_0xb2ef('0x43')]['id']}})[_0xb2ef('0x26')](handleEntityNotFound(_0x1eaa26,null))[_0xb2ef('0x26')](function(_0x520396){if(_0x520396){_0x4cbf54=_0x520396;_0x546228[_0xb2ef('0x30')]=_['keys'](db[_0xb2ef('0x49')][_0xb2ef('0x2d')]);_0x546228[_0xb2ef('0x31')]=_['keys'](_0x521ceb['query']);_0x546228['filters']=_['intersection'](_0x546228['model'],_0x546228[_0xb2ef('0x31')]);_0xd994ff[_0xb2ef('0x36')]=_[_0xb2ef('0x34')](_0x546228[_0xb2ef('0x30')],qs[_0xb2ef('0x35')](_0x521ceb[_0xb2ef('0x31')][_0xb2ef('0x35')]));_0xd994ff[_0xb2ef('0x36')]=_0xd994ff[_0xb2ef('0x36')][_0xb2ef('0x37')]?_0xd994ff[_0xb2ef('0x36')]:_0x546228[_0xb2ef('0x30')];_0xd994ff[_0xb2ef('0x3a')]=qs[_0xb2ef('0x3b')](_0x521ceb[_0xb2ef('0x31')][_0xb2ef('0x3b')]);_0xd994ff[_0xb2ef('0x3c')]=qs[_0xb2ef('0x33')](_[_0xb2ef('0x3d')](_0x521ceb[_0xb2ef('0x31')],_0x546228['filters']));if(_0x521ceb[_0xb2ef('0x31')][_0xb2ef('0x3e')]){_0xd994ff[_0xb2ef('0x3c')]=_[_0xb2ef('0x3f')](_0xd994ff[_0xb2ef('0x3c')],{'$or':_['map'](_0xd994ff[_0xb2ef('0x36')],function(_0x315ace){var _0x529d6f={};_0x529d6f[_0x315ace]={'$like':'%'+_0x521ceb[_0xb2ef('0x31')][_0xb2ef('0x3e')]+'%'};return _0x529d6f;})});}_0xd994ff=_[_0xb2ef('0x3f')]({},_0xd994ff,_0x521ceb[_0xb2ef('0x40')]);return _0x4cbf54[_0xb2ef('0x48')](_0xd994ff);}})[_0xb2ef('0x26')](function(_0x550eaf){if(_0x550eaf){_0xcd0181=_0x550eaf[_0xb2ef('0x37')];if(!_0x521ceb['query'][_0xb2ef('0x38')](_0xb2ef('0x39'))){_0xd994ff[_0xb2ef('0x21')]=qs['limit'](_0x521ceb[_0xb2ef('0x31')][_0xb2ef('0x21')]);_0xd994ff[_0xb2ef('0x1f')]=qs[_0xb2ef('0x1f')](_0x521ceb[_0xb2ef('0x31')][_0xb2ef('0x1f')]);}return _0x4cbf54[_0xb2ef('0x48')](_0xd994ff);}})[_0xb2ef('0x26')](function(_0x3dd43d){if(_0x3dd43d){return _0x3dd43d?{'count':_0xcd0181,'rows':_0x3dd43d}:null;}})[_0xb2ef('0x26')](respondWithResult(_0x1eaa26,null))[_0xb2ef('0x42')](handleError(_0x1eaa26,null));};exports[_0xb2ef('0x4a')]=function(_0xa79ee7,_0x5ebfac,_0x58e57d){if(_0xa79ee7['body']['id']){delete _0xa79ee7[_0xb2ef('0x46')]['id'];}return db[_0xb2ef('0x41')][_0xb2ef('0x4b')]({'where':{'id':_0xa79ee7[_0xb2ef('0x43')]['id']}})[_0xb2ef('0x26')](handleEntityNotFound(_0x5ebfac,null))['then'](function(_0x33fc0d){if(_0x33fc0d){_0xa79ee7[_0xb2ef('0x46')][_0xb2ef('0x4c')]=_0x33fc0d['id'];_0xa79ee7[_0xb2ef('0x46')]['Subjects']=integrations['getSubjects'](_0xa79ee7[_0xb2ef('0x46')][_0xb2ef('0x4d')],_0xa79ee7['body'][_0xb2ef('0x2f')]);_0xa79ee7[_0xb2ef('0x46')][_0xb2ef('0x4e')]=integrations[_0xb2ef('0x4f')](_0xa79ee7[_0xb2ef('0x46')][_0xb2ef('0x4d')],_0xa79ee7['body'][_0xb2ef('0x2f')]);return db[_0xb2ef('0x49')][_0xb2ef('0x50')](_0xa79ee7['body'],{'include':[{'model':db[_0xb2ef('0x51')],'as':'Subjects'},{'model':db[_0xb2ef('0x51')],'as':_0xb2ef('0x4e')}]});}return null;})[_0xb2ef('0x26')](respondWithResult(_0x5ebfac,null))[_0xb2ef('0x42')](handleError(_0x5ebfac,null));};exports[_0xb2ef('0x52')]=function(_0x1c6cd8,_0x58d86a,_0x2b524b){var _0x5ec3c2;var _0x5c83b1='';var _0x91f570='Task';return db[_0xb2ef('0x41')][_0xb2ef('0x4b')]({'where':{'id':_0x1c6cd8[_0xb2ef('0x43')]['id']},'attributes':['id',_0xb2ef('0x53'),_0xb2ef('0x54'),'clientSecret',_0xb2ef('0x55'),'password',_0xb2ef('0x56')]})[_0xb2ef('0x26')](handleEntityNotFound(_0x58d86a,null))[_0xb2ef('0x26')](function(_0x3faced){if(_0x3faced){_0x5c83b1=_0x3faced[_0xb2ef('0x53')];var _0x4a1dc6=_0x5c83b1[_0xb2ef('0x57')](-0x1);if(_0x4a1dc6==='/'){_0x5c83b1=_0x5c83b1[_0xb2ef('0x58')](0x0,_0x5c83b1['lastIndexOf'](_0x4a1dc6));}_0x5ec3c2=new jsforce[(_0xb2ef('0x59'))]({'oauth2':{'loginUrl':_0x5c83b1,'clientId':_0x3faced['clientId'],'clientSecret':_0x3faced[_0xb2ef('0x5a')]}});return _0x5ec3c2[_0xb2ef('0x5b')](_0x3faced[_0xb2ef('0x55')],_0x3faced[_0xb2ef('0x5c')][_0xb2ef('0x5d')](_0x3faced[_0xb2ef('0x56')]));}})[_0xb2ef('0x26')](function(_0x594cd3){if(_0x594cd3){if(!_['isNil'](_0x1c6cd8[_0xb2ef('0x31')][_0xb2ef('0x5e')])){_0x91f570=_0x1c6cd8[_0xb2ef('0x31')][_0xb2ef('0x5e')];}return _0x5ec3c2[_0xb2ef('0x5f')](_0x91f570)['describe']();}})[_0xb2ef('0x26')](function(_0x2612b7){var _0x27b2ba=['OwnerId',_0xb2ef('0x60'),_0xb2ef('0x61'),'IsRecurrence','Subject','Description'];var _0x35eefd=[_0xb2ef('0x62'),_0xb2ef('0x63'),_0xb2ef('0x64'),_0xb2ef('0x65'),_0xb2ef('0x66'),'textarea',_0xb2ef('0x67')];if(_0x2612b7){_[_0xb2ef('0x68')](_0x2612b7['fields'],function(_0x132265){return _0x27b2ba[_0xb2ef('0x69')](_0x132265[_0xb2ef('0x29')])||!_0x35eefd['includes'](_0x132265[_0xb2ef('0x2f')]);});return{'count':_0x2612b7[_0xb2ef('0x35')][_0xb2ef('0x37')],'rows':_['map'](_0x2612b7['fields'],function(_0x1b4890){return{'id':_0x1b4890[_0xb2ef('0x29')],'name':_0x1b4890[_0xb2ef('0x6a')],'custom':_0x1b4890[_0xb2ef('0x6b')],'options':_0x1b4890[_0xb2ef('0x6c')]['length']>0x0?_['map'](_0x1b4890[_0xb2ef('0x6c')],function(_0x395e5b){return{'name':_0x395e5b[_0xb2ef('0x6a')],'value':_0x395e5b[_0xb2ef('0x6d')]};}):_0x1b4890['type']==_0xb2ef('0x65')?[{'name':_0xb2ef('0x6e'),'value':_0xb2ef('0x6f')},{'name':_0xb2ef('0x70'),'value':_0xb2ef('0x71')}]:[]};})};}})[_0xb2ef('0x26')](respondWithResult(_0x58d86a,null))[_0xb2ef('0x42')](function(_0x6993df){var _0x360258=_0x1c6cd8[_0xb2ef('0x31')][_0xb2ef('0x72')]?0x1f4:_0x6993df[_0xb2ef('0x73')]||0x1f4;logger[_0xb2ef('0x27')](_0xb2ef('0x74'),_0xb2ef('0x52'),_0x360258,JSON[_0xb2ef('0x75')](_0x6993df));delete _0x6993df[_0xb2ef('0x29')];if(_0x360258===0x191){_0x360258=0x190;}_0x58d86a[_0xb2ef('0x1d')](_0x360258)['send'](_0x1c6cd8[_0xb2ef('0x31')][_0xb2ef('0x72')]?{'message':'Wrong\x20credentials','statusCode':_0x6993df[_0xb2ef('0x73')]}:_0x6993df);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 9f010dd..7939a15 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 _0xc8fc=['define','SalesforceAccount','int_salesforce_accounts','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports'];(function(_0x19a661,_0x19373d){var _0x8fdb2d=function(_0x4cb07c){while(--_0x4cb07c){_0x19a661['push'](_0x19a661['shift']());}};_0x8fdb2d(++_0x19373d);}(_0xc8fc,0x78));var _0xcc8f=function(_0x21c759,_0x181938){_0x21c759=_0x21c759-0x0;var _0x5427fc=_0xc8fc[_0x21c759];return _0x5427fc;};'use strict';var _=require('lodash');var util=require(_0xcc8f('0x0'));var logger=require(_0xcc8f('0x1'))(_0xcc8f('0x2'));var moment=require('moment');var BPromise=require(_0xcc8f('0x3'));var rp=require(_0xcc8f('0x4'));var fs=require('fs');var path=require(_0xcc8f('0x5'));var rimraf=require('rimraf');var config=require(_0xcc8f('0x6'));var attributes=require(_0xcc8f('0x7'));var integrations=require(_0xcc8f('0x8'));module[_0xcc8f('0x9')]=function(_0x51efe1,_0x30ab47){return _0x51efe1[_0xcc8f('0xa')](_0xcc8f('0xb'),attributes,{'tableName':_0xcc8f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8bfc=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','define','int_salesforce_accounts','util','../../config/logger'];(function(_0x4e6845,_0x4fb0d9){var _0x1ce690=function(_0x110d04){while(--_0x110d04){_0x4e6845['push'](_0x4e6845['shift']());}};_0x1ce690(++_0x4fb0d9);}(_0x8bfc,0x9a));var _0xc8bf=function(_0x3c8e9a,_0x384306){_0x3c8e9a=_0x3c8e9a-0x0;var _0x2d4c57=_0x8bfc[_0x3c8e9a];return _0x2d4c57;};'use strict';var _=require('lodash');var util=require(_0xc8bf('0x0'));var logger=require(_0xc8bf('0x1'))('api');var moment=require(_0xc8bf('0x2'));var BPromise=require(_0xc8bf('0x3'));var rp=require(_0xc8bf('0x4'));var fs=require('fs');var path=require(_0xc8bf('0x5'));var rimraf=require(_0xc8bf('0x6'));var config=require(_0xc8bf('0x7'));var attributes=require(_0xc8bf('0x8'));var integrations=require(_0xc8bf('0x9'));module[_0xc8bf('0xa')]=function(_0x4066a6,_0x5a3abb){return _0x4066a6[_0xc8bf('0xb')]('SalesforceAccount',attributes,{'tableName':_0xc8bf('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js b/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js index e7566d7..0f2fd64 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 _0x1218=['request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','SalesforceAccount,\x20%s,\x20%s','message','result','SalesforceAccount','findAll','options','raw','where','attributes','limit','include','map','model','catch','GetSalesforceAccount','ShowSalesforceAccount','find','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info'];(function(_0x18c85b,_0x363512){var _0x5b3147=function(_0x334bca){while(--_0x334bca){_0x18c85b['push'](_0x18c85b['shift']());}};_0x5b3147(++_0x363512);}(_0x1218,0x151));var _0x8121=function(_0x2612fd,_0x44d6bc){_0x2612fd=_0x2612fd-0x0;var _0x4a9391=_0x1218[_0x2612fd];return _0x4a9391;};'use strict';var _=require(_0x8121('0x0'));var util=require('util');var moment=require(_0x8121('0x1'));var BPromise=require('bluebird');var rs=require(_0x8121('0x2'));var fs=require('fs');var Redis=require(_0x8121('0x3'));var db=require(_0x8121('0x4'))['db'];var utils=require(_0x8121('0x5'));var logger=require('../../config/logger')(_0x8121('0x6'));var config=require(_0x8121('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x8121('0x8')][_0x8121('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x31a6b7,_0x15cd54,_0x3bff58){return new BPromise(function(_0x275f20,_0x418604){return client[_0x8121('0xa')](_0x31a6b7,_0x3bff58)[_0x8121('0xb')](function(_0x2b03df){logger[_0x8121('0xc')]('SalesforceAccount,\x20%s,\x20%s',_0x15cd54,_0x8121('0xd'));logger[_0x8121('0xe')](_0x8121('0xf'),_0x15cd54,_0x8121('0xd'),JSON[_0x8121('0x10')](_0x2b03df));if(_0x2b03df[_0x8121('0x11')]){if(_0x2b03df['error']['code']===0x1f4){logger[_0x8121('0x11')](_0x8121('0x12'),_0x15cd54,_0x2b03df['error'][_0x8121('0x13')]);return _0x418604(_0x2b03df[_0x8121('0x11')][_0x8121('0x13')]);}logger[_0x8121('0x11')]('SalesforceAccount,\x20%s,\x20%s',_0x15cd54,_0x2b03df['error'][_0x8121('0x13')]);return _0x275f20(_0x2b03df['error'][_0x8121('0x13')]);}else{logger[_0x8121('0xc')](_0x8121('0x12'),_0x15cd54,_0x8121('0xd'));_0x275f20(_0x2b03df[_0x8121('0x14')]['message']);}})['catch'](function(_0x49fa24){logger['error']('SalesforceAccount,\x20%s,\x20%s',_0x15cd54,_0x49fa24);_0x418604(_0x49fa24);});});}exports['GetSalesforceAccount']=function(_0x1eaea4){var _0x1f57cb=this;return new Promise(function(_0x51c9a0,_0x4ddb66){return db[_0x8121('0x15')][_0x8121('0x16')]({'raw':_0x1eaea4[_0x8121('0x17')]?_0x1eaea4[_0x8121('0x17')][_0x8121('0x18')]===undefined?!![]:![]:!![],'where':_0x1eaea4[_0x8121('0x17')]?_0x1eaea4[_0x8121('0x17')][_0x8121('0x19')]||null:null,'attributes':_0x1eaea4['options']?_0x1eaea4[_0x8121('0x17')][_0x8121('0x1a')]||null:null,'limit':_0x1eaea4[_0x8121('0x17')]?_0x1eaea4[_0x8121('0x17')][_0x8121('0x1b')]||null:null,'include':_0x1eaea4['options']?_0x1eaea4[_0x8121('0x17')][_0x8121('0x1c')]?_[_0x8121('0x1d')](_0x1eaea4[_0x8121('0x17')][_0x8121('0x1c')],function(_0x30595c){return{'model':db[_0x30595c[_0x8121('0x1e')]],'as':_0x30595c['as'],'attributes':_0x30595c['attributes'],'include':_0x30595c[_0x8121('0x1c')]?_['map'](_0x30595c[_0x8121('0x1c')],function(_0x170ade){return{'model':db[_0x170ade[_0x8121('0x1e')]],'as':_0x170ade['as'],'attributes':_0x170ade[_0x8121('0x1a')],'include':_0x170ade['include']?_[_0x8121('0x1d')](_0x170ade[_0x8121('0x1c')],function(_0x39acfb){return{'model':db[_0x39acfb[_0x8121('0x1e')]],'as':_0x39acfb['as'],'attributes':_0x39acfb[_0x8121('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x8121('0xb')](function(_0x35cef6){logger['info']('GetSalesforceAccount',_0x1eaea4);logger[_0x8121('0xe')]('GetSalesforceAccount',_0x1eaea4,JSON[_0x8121('0x10')](_0x35cef6));_0x51c9a0(_0x35cef6);})[_0x8121('0x1f')](function(_0x1bce0b){logger[_0x8121('0x11')](_0x8121('0x20'),_0x1bce0b[_0x8121('0x13')],_0x1eaea4);_0x4ddb66(_0x1f57cb['error'](0x1f4,_0x1bce0b[_0x8121('0x13')]));});});};exports[_0x8121('0x21')]=function(_0x3a1688){var _0x478297=this;return new Promise(function(_0x41df67,_0x494e6d){return db[_0x8121('0x15')][_0x8121('0x22')]({'raw':_0x3a1688[_0x8121('0x17')]?_0x3a1688[_0x8121('0x17')][_0x8121('0x18')]===undefined?!![]:![]:!![],'where':_0x3a1688['options']?_0x3a1688[_0x8121('0x17')][_0x8121('0x19')]||null:null,'attributes':_0x3a1688[_0x8121('0x17')]?_0x3a1688['options'][_0x8121('0x1a')]||null:null,'include':_0x3a1688[_0x8121('0x17')]?_0x3a1688[_0x8121('0x17')][_0x8121('0x1c')]?_[_0x8121('0x1d')](_0x3a1688['options']['include'],function(_0x15b115){return{'model':db[_0x15b115[_0x8121('0x1e')]],'as':_0x15b115['as'],'attributes':_0x15b115[_0x8121('0x1a')],'include':_0x15b115[_0x8121('0x1c')]?_[_0x8121('0x1d')](_0x15b115['include'],function(_0x443f9c){return{'model':db[_0x443f9c['model']],'as':_0x443f9c['as'],'attributes':_0x443f9c[_0x8121('0x1a')],'include':_0x443f9c['include']?_[_0x8121('0x1d')](_0x443f9c[_0x8121('0x1c')],function(_0x138d7b){return{'model':db[_0x138d7b[_0x8121('0x1e')]],'as':_0x138d7b['as'],'attributes':_0x138d7b['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3a6d52){logger[_0x8121('0xc')](_0x8121('0x21'),_0x3a1688);logger[_0x8121('0xe')](_0x8121('0x21'),_0x3a1688,JSON[_0x8121('0x10')](_0x3a6d52));_0x41df67(_0x3a6d52);})['catch'](function(_0x8afd34){logger[_0x8121('0x11')]('ShowSalesforceAccount',_0x8afd34[_0x8121('0x13')],_0x3a1688);_0x494e6d(_0x478297[_0x8121('0x11')](0x1f4,_0x8afd34[_0x8121('0x13')]));});});}; \ No newline at end of file +var _0x452c=['limit','include','map','model','attributes','ShowSalesforceAccount','find','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','raw','where'];(function(_0x53cc0a,_0x30848e){var _0x58044c=function(_0x5ac32a){while(--_0x5ac32a){_0x53cc0a['push'](_0x53cc0a['shift']());}};_0x58044c(++_0x30848e);}(_0x452c,0x9b));var _0xc452=function(_0x586f1f,_0x13d57a){_0x586f1f=_0x586f1f-0x0;var _0xbfece6=_0x452c[_0x586f1f];return _0xbfece6;};'use strict';var _=require('lodash');var util=require(_0xc452('0x0'));var moment=require(_0xc452('0x1'));var BPromise=require(_0xc452('0x2'));var rs=require(_0xc452('0x3'));var fs=require('fs');var Redis=require(_0xc452('0x4'));var db=require(_0xc452('0x5'))['db'];var utils=require(_0xc452('0x6'));var logger=require(_0xc452('0x7'))(_0xc452('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc452('0x9')][_0xc452('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4ad385,_0x5bff0f,_0xb2c6e1){return new BPromise(function(_0x1d9ebc,_0x5ae6c5){return client[_0xc452('0xb')](_0x4ad385,_0xb2c6e1)[_0xc452('0xc')](function(_0x4870ee){logger[_0xc452('0xd')](_0xc452('0xe'),_0x5bff0f,_0xc452('0xf'));logger[_0xc452('0x10')](_0xc452('0x11'),_0x5bff0f,_0xc452('0xf'),JSON[_0xc452('0x12')](_0x4870ee));if(_0x4870ee[_0xc452('0x13')]){if(_0x4870ee['error'][_0xc452('0x14')]===0x1f4){logger['error'](_0xc452('0xe'),_0x5bff0f,_0x4870ee['error'][_0xc452('0x15')]);return _0x5ae6c5(_0x4870ee[_0xc452('0x13')][_0xc452('0x15')]);}logger[_0xc452('0x13')](_0xc452('0xe'),_0x5bff0f,_0x4870ee[_0xc452('0x13')][_0xc452('0x15')]);return _0x1d9ebc(_0x4870ee[_0xc452('0x13')]['message']);}else{logger['info'](_0xc452('0xe'),_0x5bff0f,_0xc452('0xf'));_0x1d9ebc(_0x4870ee[_0xc452('0x16')][_0xc452('0x15')]);}})[_0xc452('0x17')](function(_0x3aa243){logger['error']('SalesforceAccount,\x20%s,\x20%s',_0x5bff0f,_0x3aa243);_0x5ae6c5(_0x3aa243);});});}exports[_0xc452('0x18')]=function(_0x3fa350){var _0xf3f6b9=this;return new Promise(function(_0x30c6c3,_0xeab522){return db[_0xc452('0x19')][_0xc452('0x1a')]({'raw':_0x3fa350[_0xc452('0x1b')]?_0x3fa350['options'][_0xc452('0x1c')]===undefined?!![]:![]:!![],'where':_0x3fa350[_0xc452('0x1b')]?_0x3fa350[_0xc452('0x1b')][_0xc452('0x1d')]||null:null,'attributes':_0x3fa350['options']?_0x3fa350[_0xc452('0x1b')]['attributes']||null:null,'limit':_0x3fa350[_0xc452('0x1b')]?_0x3fa350[_0xc452('0x1b')][_0xc452('0x1e')]||null:null,'include':_0x3fa350[_0xc452('0x1b')]?_0x3fa350[_0xc452('0x1b')][_0xc452('0x1f')]?_[_0xc452('0x20')](_0x3fa350[_0xc452('0x1b')][_0xc452('0x1f')],function(_0x1ef7c5){return{'model':db[_0x1ef7c5[_0xc452('0x21')]],'as':_0x1ef7c5['as'],'attributes':_0x1ef7c5[_0xc452('0x22')],'include':_0x1ef7c5[_0xc452('0x1f')]?_[_0xc452('0x20')](_0x1ef7c5['include'],function(_0x397115){return{'model':db[_0x397115['model']],'as':_0x397115['as'],'attributes':_0x397115['attributes'],'include':_0x397115[_0xc452('0x1f')]?_[_0xc452('0x20')](_0x397115[_0xc452('0x1f')],function(_0x107695){return{'model':db[_0x107695[_0xc452('0x21')]],'as':_0x107695['as'],'attributes':_0x107695[_0xc452('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2ee2c3){logger[_0xc452('0xd')](_0xc452('0x18'),_0x3fa350);logger['debug'](_0xc452('0x18'),_0x3fa350,JSON[_0xc452('0x12')](_0x2ee2c3));_0x30c6c3(_0x2ee2c3);})[_0xc452('0x17')](function(_0x44a225){logger[_0xc452('0x13')](_0xc452('0x18'),_0x44a225[_0xc452('0x15')],_0x3fa350);_0xeab522(_0xf3f6b9[_0xc452('0x13')](0x1f4,_0x44a225[_0xc452('0x15')]));});});};exports[_0xc452('0x23')]=function(_0x2aeb85){var _0x417684=this;return new Promise(function(_0x2d2f67,_0x5c900c){return db['SalesforceAccount'][_0xc452('0x24')]({'raw':_0x2aeb85[_0xc452('0x1b')]?_0x2aeb85[_0xc452('0x1b')][_0xc452('0x1c')]===undefined?!![]:![]:!![],'where':_0x2aeb85[_0xc452('0x1b')]?_0x2aeb85[_0xc452('0x1b')][_0xc452('0x1d')]||null:null,'attributes':_0x2aeb85['options']?_0x2aeb85[_0xc452('0x1b')][_0xc452('0x22')]||null:null,'include':_0x2aeb85[_0xc452('0x1b')]?_0x2aeb85['options'][_0xc452('0x1f')]?_[_0xc452('0x20')](_0x2aeb85[_0xc452('0x1b')]['include'],function(_0x8fffa4){return{'model':db[_0x8fffa4[_0xc452('0x21')]],'as':_0x8fffa4['as'],'attributes':_0x8fffa4[_0xc452('0x22')],'include':_0x8fffa4[_0xc452('0x1f')]?_['map'](_0x8fffa4['include'],function(_0xe0258){return{'model':db[_0xe0258[_0xc452('0x21')]],'as':_0xe0258['as'],'attributes':_0xe0258[_0xc452('0x22')],'include':_0xe0258['include']?_[_0xc452('0x20')](_0xe0258[_0xc452('0x1f')],function(_0x1adaca){return{'model':db[_0x1adaca[_0xc452('0x21')]],'as':_0x1adaca['as'],'attributes':_0x1adaca['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x550130){logger[_0xc452('0xd')](_0xc452('0x23'),_0x2aeb85);logger[_0xc452('0x10')](_0xc452('0x23'),_0x2aeb85,JSON[_0xc452('0x12')](_0x550130));_0x2d2f67(_0x550130);})[_0xc452('0x17')](function(_0x171e02){logger[_0xc452('0x13')]('ShowSalesforceAccount',_0x171e02[_0xc452('0x15')],_0x2aeb85);_0x5c900c(_0x417684[_0xc452('0x13')](0x1f4,_0x171e02[_0xc452('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 2c2afaf..4ac9513 100644 --- a/server/api/intSalesforceConfiguration/index.js +++ b/server/api/intSalesforceConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['Router','fs-extra','../../components/auth/service','./intSalesforceConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','create','put','update','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x5621af,_0x21dd6f){var _0x304796=function(_0x2210c3){while(--_0x2210c3){_0x5621af['push'](_0x5621af['shift']());}};_0x304796(++_0x21dd6f);}(_0x5f2f,0x73));var _0xf5f2=function(_0x3f4f44,_0x59b2fd){_0x3f4f44=_0x3f4f44-0x0;var _0x3e2e14=_0x5f2f[_0x3f4f44];return _0x3e2e14;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x9')](_0xf5f2('0x10'),auth['isAuthenticated'](),controller[_0xf5f2('0x11')]);router['get']('/:id/descriptions',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x12')]);router['post']('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x13')]);router[_0xf5f2('0x14')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x15')]);router['delete'](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x16')]);module[_0xf5f2('0x17')]=router; \ No newline at end of file +var _0x5f66=['express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','/:id/subjects','getSubjects','put','update','delete','destroy','exports','util','connect-timeout'];(function(_0x3ec045,_0x443f6e){var _0x58f1bf=function(_0x598f09){while(--_0x598f09){_0x3ec045['push'](_0x3ec045['shift']());}};_0x58f1bf(++_0x443f6e);}(_0x5f66,0x1a0));var _0x65f6=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x5f66[_0x4cf98e];return _0x1623ac;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./intSalesforceConfiguration.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['getFields']);router['get'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);router[_0x65f6('0x7')]('/:id/descriptions',auth[_0x65f6('0x8')](),controller['getDescriptions']);router['post']('/',auth[_0x65f6('0x8')](),controller['create']);router[_0x65f6('0xe')]('/:id',auth[_0x65f6('0x8')](),controller[_0x65f6('0xf')]);router[_0x65f6('0x10')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x11')]);module[_0x65f6('0x12')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 4a042c8..3db7f78 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 _0x7d5c=['lead','account_contact_lead','account','contact','sequelize','exports','STRING','ENUM','Task','contact_lead'];(function(_0x15b238,_0x107282){var _0x7b86c7=function(_0x57cedc){while(--_0x57cedc){_0x15b238['push'](_0x15b238['shift']());}};_0x7b86c7(++_0x107282);}(_0x7d5c,0x1ee));var _0xc7d5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7d5c[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xc7d5('0x0'));module[_0xc7d5('0x1')]={'name':{'type':Sequelize[_0xc7d5('0x2')]},'description':{'type':Sequelize[_0xc7d5('0x2')]},'ticketType':{'type':Sequelize[_0xc7d5('0x3')](_0xc7d5('0x4'),'Case'),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize['ENUM'](_0xc7d5('0x5'),'contact',_0xc7d5('0x6'),_0xc7d5('0x7'),_0xc7d5('0x8')),'defaultValue':'contact_lead'},'moduleCreate':{'type':Sequelize['ENUM']('nothing',_0xc7d5('0x9'),_0xc7d5('0x6'),_0xc7d5('0x8')),'defaultValue':_0xc7d5('0x6')},'leadId':{'type':Sequelize[_0xc7d5('0x2')]},'additionalSearchAccount':{'type':Sequelize['STRING']},'additionalSearchContact':{'type':Sequelize['STRING']},'additionalSearchLead':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x7890=['sequelize','exports','STRING','ENUM','Task','Case','contact_lead','contact','nothing','lead','account'];(function(_0x5dedb6,_0x1543dd){var _0x3ec0c6=function(_0x2d4ad2){while(--_0x2d4ad2){_0x5dedb6['push'](_0x5dedb6['shift']());}};_0x3ec0c6(++_0x1543dd);}(_0x7890,0x1c3));var _0x0789=function(_0x8fb1bc,_0x51028a){_0x8fb1bc=_0x8fb1bc-0x0;var _0x27490c=_0x7890[_0x8fb1bc];return _0x27490c;};'use strict';var Sequelize=require(_0x0789('0x0'));module[_0x0789('0x1')]={'name':{'type':Sequelize[_0x0789('0x2')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0x0789('0x3')](_0x0789('0x4'),_0x0789('0x5')),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize['ENUM'](_0x0789('0x6'),_0x0789('0x7'),'lead','account_contact_lead','account'),'defaultValue':_0x0789('0x6')},'moduleCreate':{'type':Sequelize[_0x0789('0x3')](_0x0789('0x8'),_0x0789('0x7'),_0x0789('0x9'),_0x0789('0xa')),'defaultValue':_0x0789('0x9')},'leadId':{'type':Sequelize[_0x0789('0x2')]},'additionalSearchAccount':{'type':Sequelize['STRING']},'additionalSearchContact':{'type':Sequelize[_0x0789('0x2')]},'additionalSearchLead':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 8add0ec..f8281a5 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 _0x7c22=['intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','find','create','body','getFields','findOne','SalesforceField','pick','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','error','stack','name','index','SalesforceConfiguration','rawAttributes','fieldName','type','key','map','query','filters'];(function(_0x50b70b,_0x6b7c44){var _0xb53a83=function(_0x5e2c00){while(--_0x5e2c00){_0x50b70b['push'](_0x50b70b['shift']());}};_0xb53a83(++_0x6b7c44);}(_0x7c22,0x6c));var _0x27c2=function(_0x2ea6ba,_0x1a8540){_0x2ea6ba=_0x2ea6ba-0x0;var _0x5bcfca=_0x7c22[_0x2ea6ba];return _0x5bcfca;};'use strict';var emlformat=require(_0x27c2('0x0'));var rimraf=require(_0x27c2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x27c2('0x2'));var rp=require(_0x27c2('0x3'));var moment=require('moment');var BPromise=require(_0x27c2('0x4'));var Mustache=require(_0x27c2('0x5'));var util=require('util');var path=require('path');var sox=require(_0x27c2('0x6'));var csv=require('to-csv');var ejs=require(_0x27c2('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x27c2('0x8'));var squel=require(_0x27c2('0x9'));var crypto=require('crypto');var jsforce=require(_0x27c2('0xa'));var deskjs=require(_0x27c2('0xb'));var toCsv=require(_0x27c2('0xc'));var querystring=require(_0x27c2('0xd'));var Papa=require(_0x27c2('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x27c2('0xf'));var as=require(_0x27c2('0x10'));var hardwareService=require(_0x27c2('0x11'));var logger=require(_0x27c2('0x12'))('api');var utils=require(_0x27c2('0x13'));var config=require(_0x27c2('0x14'));var licenseUtil=require(_0x27c2('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4c654a,_0x23a6ed){_0x23a6ed=_0x23a6ed||0xcc;return function(_0x3a8d1f){if(_0x3a8d1f){return _0x4c654a[_0x27c2('0x16')](_0x23a6ed);}return _0x4c654a[_0x27c2('0x17')](_0x23a6ed)[_0x27c2('0x18')]();};}function respondWithResult(_0x599589,_0xa704c2){_0xa704c2=_0xa704c2||0xc8;return function(_0x4db64a){if(_0x4db64a){return _0x599589[_0x27c2('0x17')](_0xa704c2)[_0x27c2('0x19')](_0x4db64a);}};}function respondWithFilteredResult(_0x333db1,_0x2e2193){return function(_0x49241e){if(_0x49241e){var _0x272038=typeof _0x2e2193[_0x27c2('0x1a')]===_0x27c2('0x1b')&&typeof _0x2e2193[_0x27c2('0x1c')]===_0x27c2('0x1b');var _0x2db0b6=_0x49241e[_0x27c2('0x1d')];var _0x2daee4=_0x272038?0x0:_0x2e2193[_0x27c2('0x1a')];var _0x5f197c=_0x272038?_0x49241e[_0x27c2('0x1d')]:_0x2e2193[_0x27c2('0x1a')]+_0x2e2193[_0x27c2('0x1c')];var _0x824e60;if(_0x5f197c>=_0x2db0b6){_0x5f197c=_0x2db0b6;_0x824e60=0xc8;}else{_0x824e60=0xce;}_0x333db1['status'](_0x824e60);return _0x333db1['set'](_0x27c2('0x1e'),_0x2daee4+'-'+_0x5f197c+'/'+_0x2db0b6)[_0x27c2('0x19')](_0x49241e);}return null;};}function patchUpdates(_0x25136d){return function(_0x282cdb){try{jsonpatch[_0x27c2('0x1f')](_0x282cdb,_0x25136d,!![]);}catch(_0x9f380){return BPromise['reject'](_0x9f380);}return _0x282cdb[_0x27c2('0x20')]();};}function saveUpdates(_0x111287,_0x38e982){return function(_0x136a63){if(_0x136a63){return _0x136a63[_0x27c2('0x21')](_0x111287)[_0x27c2('0x22')](function(_0x311cd2){return _0x311cd2;});}return null;};}function removeEntity(_0xb9af7f,_0x52ecc5){return function(_0x58ffa6){if(_0x58ffa6){return _0x58ffa6[_0x27c2('0x23')]()[_0x27c2('0x22')](function(){_0xb9af7f['status'](0xcc)[_0x27c2('0x18')]();});}};}function handleEntityNotFound(_0x66bf45,_0x21ccb2){return function(_0x1cf775){if(!_0x1cf775){_0x66bf45['sendStatus'](0x194);}return _0x1cf775;};}function handleError(_0x3e7563,_0x2d9974){_0x2d9974=_0x2d9974||0x1f4;return function(_0x3d2338){logger[_0x27c2('0x24')](_0x3d2338[_0x27c2('0x25')]);if(_0x3d2338[_0x27c2('0x26')]){delete _0x3d2338[_0x27c2('0x26')];}_0x3e7563[_0x27c2('0x17')](_0x2d9974)['send'](_0x3d2338);};}exports[_0x27c2('0x27')]=function(_0x3c13a1,_0x54b061){var _0x48ef72={},_0xeeba0b={},_0x34cf90={'count':0x0,'rows':[]};var _0x2b0b3=_['map'](db[_0x27c2('0x28')][_0x27c2('0x29')],function(_0x2768a6){return{'name':_0x2768a6[_0x27c2('0x2a')],'type':_0x2768a6[_0x27c2('0x2b')][_0x27c2('0x2c')]};});_0xeeba0b['model']=_[_0x27c2('0x2d')](_0x2b0b3,_0x27c2('0x26'));_0xeeba0b[_0x27c2('0x2e')]=_['keys'](_0x3c13a1[_0x27c2('0x2e')]);_0xeeba0b[_0x27c2('0x2f')]=_[_0x27c2('0x30')](_0xeeba0b[_0x27c2('0x31')],_0xeeba0b['query']);_0x48ef72[_0x27c2('0x32')]=_[_0x27c2('0x30')](_0xeeba0b[_0x27c2('0x31')],qs[_0x27c2('0x33')](_0x3c13a1[_0x27c2('0x2e')][_0x27c2('0x33')]));_0x48ef72[_0x27c2('0x32')]=_0x48ef72[_0x27c2('0x32')][_0x27c2('0x34')]?_0x48ef72['attributes']:_0xeeba0b[_0x27c2('0x31')];if(!_0x3c13a1[_0x27c2('0x2e')][_0x27c2('0x35')](_0x27c2('0x36'))){_0x48ef72[_0x27c2('0x1c')]=qs['limit'](_0x3c13a1[_0x27c2('0x2e')][_0x27c2('0x1c')]);_0x48ef72[_0x27c2('0x1a')]=qs[_0x27c2('0x1a')](_0x3c13a1['query'][_0x27c2('0x1a')]);}_0x48ef72[_0x27c2('0x37')]=qs[_0x27c2('0x38')](_0x3c13a1[_0x27c2('0x2e')][_0x27c2('0x38')]);_0x48ef72[_0x27c2('0x39')]=qs[_0x27c2('0x2f')](_['pick'](_0x3c13a1[_0x27c2('0x2e')],_0xeeba0b[_0x27c2('0x2f')]),_0x2b0b3);if(_0x3c13a1['query'][_0x27c2('0x3a')]){_0x48ef72[_0x27c2('0x39')]=_[_0x27c2('0x3b')](_0x48ef72['where'],{'$or':_[_0x27c2('0x2d')](_0x2b0b3,function(_0x303ace){if(_0x303ace[_0x27c2('0x2b')]!==_0x27c2('0x3c')){var _0x3075e5={};_0x3075e5[_0x303ace['name']]={'$like':'%'+_0x3c13a1[_0x27c2('0x2e')]['filter']+'%'};return _0x3075e5;}})});}_0x48ef72=_[_0x27c2('0x3b')]({},_0x48ef72,_0x3c13a1[_0x27c2('0x3d')]);var _0x2363df={'where':_0x48ef72[_0x27c2('0x39')]};return db[_0x27c2('0x28')][_0x27c2('0x1d')](_0x2363df)['then'](function(_0x19f1d6){_0x34cf90[_0x27c2('0x1d')]=_0x19f1d6;if(_0x3c13a1['query'][_0x27c2('0x3e')]){_0x48ef72[_0x27c2('0x3f')]=[{'all':!![]}];}return db['SalesforceConfiguration'][_0x27c2('0x40')](_0x48ef72);})[_0x27c2('0x22')](function(_0x57dcb2){_0x34cf90[_0x27c2('0x41')]=_0x57dcb2;return _0x34cf90;})[_0x27c2('0x22')](respondWithFilteredResult(_0x54b061,_0x48ef72))[_0x27c2('0x42')](handleError(_0x54b061,null));};exports['show']=function(_0x32b088,_0xd44965){var _0x30e13e={'raw':![],'where':{'id':_0x32b088[_0x27c2('0x43')]['id']}},_0x26546c={};_0x26546c[_0x27c2('0x31')]=_['keys'](db['SalesforceConfiguration'][_0x27c2('0x29')]);_0x26546c[_0x27c2('0x2e')]=_[_0x27c2('0x44')](_0x32b088[_0x27c2('0x2e')]);_0x26546c['filters']=_[_0x27c2('0x30')](_0x26546c[_0x27c2('0x31')],_0x26546c[_0x27c2('0x2e')]);_0x30e13e[_0x27c2('0x32')]=_['intersection'](_0x26546c[_0x27c2('0x31')],qs[_0x27c2('0x33')](_0x32b088[_0x27c2('0x2e')]['fields']));_0x30e13e['attributes']=_0x30e13e[_0x27c2('0x32')]['length']?_0x30e13e[_0x27c2('0x32')]:_0x26546c[_0x27c2('0x31')];if(_0x32b088[_0x27c2('0x2e')][_0x27c2('0x3e')]){_0x30e13e[_0x27c2('0x3f')]=[{'all':!![]}];}_0x30e13e=_['merge']({},_0x30e13e,_0x32b088['options']);return db[_0x27c2('0x28')][_0x27c2('0x45')](_0x30e13e)[_0x27c2('0x22')](handleEntityNotFound(_0xd44965,null))[_0x27c2('0x22')](respondWithResult(_0xd44965,null))[_0x27c2('0x42')](handleError(_0xd44965,null));};exports['create']=function(_0x5eae01,_0x31bee2){return db[_0x27c2('0x28')][_0x27c2('0x46')](_0x5eae01[_0x27c2('0x47')],{})[_0x27c2('0x22')](respondWithResult(_0x31bee2,0xc9))['catch'](handleError(_0x31bee2,null));};exports[_0x27c2('0x21')]=function(_0xa6fdea,_0x3bbd25){if(_0xa6fdea[_0x27c2('0x47')]['id']){delete _0xa6fdea[_0x27c2('0x47')]['id'];}return db[_0x27c2('0x28')]['find']({'where':{'id':_0xa6fdea[_0x27c2('0x43')]['id']}})[_0x27c2('0x22')](handleEntityNotFound(_0x3bbd25,null))[_0x27c2('0x22')](saveUpdates(_0xa6fdea['body'],null))[_0x27c2('0x22')](respondWithResult(_0x3bbd25,null))[_0x27c2('0x42')](handleError(_0x3bbd25,null));};exports[_0x27c2('0x23')]=function(_0x5a3c00,_0x11068b){return db[_0x27c2('0x28')][_0x27c2('0x45')]({'where':{'id':_0x5a3c00[_0x27c2('0x43')]['id']}})[_0x27c2('0x22')](handleEntityNotFound(_0x11068b,null))[_0x27c2('0x22')](removeEntity(_0x11068b,null))[_0x27c2('0x42')](handleError(_0x11068b,null));};exports[_0x27c2('0x48')]=function(_0x4a4248,_0x2ffa99,_0x36e705){var _0x5b633d={};var _0x29f1de={};var _0x26057e;var _0x394f75;return db['SalesforceConfiguration'][_0x27c2('0x49')]({'where':{'id':_0x4a4248[_0x27c2('0x43')]['id']}})[_0x27c2('0x22')](handleEntityNotFound(_0x2ffa99,null))[_0x27c2('0x22')](function(_0x17a9d7){if(_0x17a9d7){_0x26057e=_0x17a9d7;_0x29f1de['model']=_['keys'](db[_0x27c2('0x4a')]['rawAttributes']);_0x29f1de[_0x27c2('0x2e')]=_[_0x27c2('0x44')](_0x4a4248[_0x27c2('0x2e')]);_0x29f1de[_0x27c2('0x2f')]=_[_0x27c2('0x30')](_0x29f1de[_0x27c2('0x31')],_0x29f1de[_0x27c2('0x2e')]);_0x5b633d[_0x27c2('0x32')]=_['intersection'](_0x29f1de[_0x27c2('0x31')],qs[_0x27c2('0x33')](_0x4a4248['query']['fields']));_0x5b633d['attributes']=_0x5b633d['attributes'][_0x27c2('0x34')]?_0x5b633d[_0x27c2('0x32')]:_0x29f1de[_0x27c2('0x31')];_0x5b633d['order']=qs[_0x27c2('0x38')](_0x4a4248[_0x27c2('0x2e')]['sort']);_0x5b633d[_0x27c2('0x39')]=qs[_0x27c2('0x2f')](_[_0x27c2('0x4b')](_0x4a4248[_0x27c2('0x2e')],_0x29f1de[_0x27c2('0x2f')]));if(_0x4a4248['query'][_0x27c2('0x3a')]){_0x5b633d['where']=_[_0x27c2('0x3b')](_0x5b633d[_0x27c2('0x39')],{'$or':_[_0x27c2('0x2d')](_0x5b633d[_0x27c2('0x32')],function(_0x205cbc){var _0x471dee={};_0x471dee[_0x205cbc]={'$like':'%'+_0x4a4248[_0x27c2('0x2e')][_0x27c2('0x3a')]+'%'};return _0x471dee;})});}_0x5b633d=_[_0x27c2('0x3b')]({},_0x5b633d,_0x4a4248[_0x27c2('0x3d')]);return _0x26057e['getFields'](_0x5b633d);}})[_0x27c2('0x22')](function(_0x24a59b){if(_0x24a59b){_0x394f75=_0x24a59b[_0x27c2('0x34')];if(!_0x4a4248[_0x27c2('0x2e')][_0x27c2('0x35')](_0x27c2('0x36'))){_0x5b633d[_0x27c2('0x1c')]=qs['limit'](_0x4a4248['query'][_0x27c2('0x1c')]);_0x5b633d[_0x27c2('0x1a')]=qs[_0x27c2('0x1a')](_0x4a4248[_0x27c2('0x2e')][_0x27c2('0x1a')]);}return _0x26057e['getFields'](_0x5b633d);}})['then'](function(_0x20a84e){if(_0x20a84e){return _0x20a84e?{'count':_0x394f75,'rows':_0x20a84e}:null;}})[_0x27c2('0x22')](respondWithResult(_0x2ffa99,null))[_0x27c2('0x42')](handleError(_0x2ffa99,null));};exports[_0x27c2('0x4c')]=function(_0x6fee14,_0x1aa3d3,_0x68a60a){var _0x4a5bb2={};var _0x11eb06={};var _0x4d445e;var _0x8bef8a;return db[_0x27c2('0x28')][_0x27c2('0x49')]({'where':{'id':_0x6fee14['params']['id']}})[_0x27c2('0x22')](handleEntityNotFound(_0x1aa3d3,null))[_0x27c2('0x22')](function(_0x33a918){if(_0x33a918){_0x4d445e=_0x33a918;_0x11eb06[_0x27c2('0x31')]=_['keys'](db[_0x27c2('0x4a')][_0x27c2('0x29')]);_0x11eb06['query']=_[_0x27c2('0x44')](_0x6fee14[_0x27c2('0x2e')]);_0x11eb06[_0x27c2('0x2f')]=_[_0x27c2('0x30')](_0x11eb06[_0x27c2('0x31')],_0x11eb06[_0x27c2('0x2e')]);_0x4a5bb2[_0x27c2('0x32')]=_[_0x27c2('0x30')](_0x11eb06['model'],qs[_0x27c2('0x33')](_0x6fee14[_0x27c2('0x2e')][_0x27c2('0x33')]));_0x4a5bb2[_0x27c2('0x32')]=_0x4a5bb2[_0x27c2('0x32')]['length']?_0x4a5bb2[_0x27c2('0x32')]:_0x11eb06['model'];_0x4a5bb2[_0x27c2('0x37')]=qs[_0x27c2('0x38')](_0x6fee14[_0x27c2('0x2e')][_0x27c2('0x38')]);_0x4a5bb2[_0x27c2('0x39')]=qs[_0x27c2('0x2f')](_['pick'](_0x6fee14[_0x27c2('0x2e')],_0x11eb06[_0x27c2('0x2f')]));if(_0x6fee14[_0x27c2('0x2e')][_0x27c2('0x3a')]){_0x4a5bb2['where']=_[_0x27c2('0x3b')](_0x4a5bb2['where'],{'$or':_[_0x27c2('0x2d')](_0x4a5bb2[_0x27c2('0x32')],function(_0x5283ca){var _0x31343c={};_0x31343c[_0x5283ca]={'$like':'%'+_0x6fee14[_0x27c2('0x2e')][_0x27c2('0x3a')]+'%'};return _0x31343c;})});}_0x4a5bb2=_[_0x27c2('0x3b')]({},_0x4a5bb2,_0x6fee14[_0x27c2('0x3d')]);return _0x4d445e[_0x27c2('0x4c')](_0x4a5bb2);}})[_0x27c2('0x22')](function(_0x235ca7){if(_0x235ca7){_0x8bef8a=_0x235ca7[_0x27c2('0x34')];if(!_0x6fee14['query'][_0x27c2('0x35')]('nolimit')){_0x4a5bb2[_0x27c2('0x1c')]=qs[_0x27c2('0x1c')](_0x6fee14['query'][_0x27c2('0x1c')]);_0x4a5bb2[_0x27c2('0x1a')]=qs[_0x27c2('0x1a')](_0x6fee14['query'][_0x27c2('0x1a')]);}return _0x4d445e['getSubjects'](_0x4a5bb2);}})[_0x27c2('0x22')](function(_0x39721f){if(_0x39721f){return _0x39721f?{'count':_0x8bef8a,'rows':_0x39721f}:null;}})['then'](respondWithResult(_0x1aa3d3,null))[_0x27c2('0x42')](handleError(_0x1aa3d3,null));};exports[_0x27c2('0x4d')]=function(_0x79e594,_0x127a5d,_0x511c1e){var _0x5e2f9c={};var _0x12b6fd={};var _0x3c52fd;var _0x5ec488;return db[_0x27c2('0x28')][_0x27c2('0x49')]({'where':{'id':_0x79e594[_0x27c2('0x43')]['id']}})[_0x27c2('0x22')](handleEntityNotFound(_0x127a5d,null))['then'](function(_0x396ac3){if(_0x396ac3){_0x3c52fd=_0x396ac3;_0x12b6fd[_0x27c2('0x31')]=_['keys'](db['SalesforceField'][_0x27c2('0x29')]);_0x12b6fd[_0x27c2('0x2e')]=_[_0x27c2('0x44')](_0x79e594['query']);_0x12b6fd[_0x27c2('0x2f')]=_[_0x27c2('0x30')](_0x12b6fd[_0x27c2('0x31')],_0x12b6fd['query']);_0x5e2f9c['attributes']=_[_0x27c2('0x30')](_0x12b6fd['model'],qs[_0x27c2('0x33')](_0x79e594[_0x27c2('0x2e')]['fields']));_0x5e2f9c['attributes']=_0x5e2f9c[_0x27c2('0x32')]['length']?_0x5e2f9c[_0x27c2('0x32')]:_0x12b6fd[_0x27c2('0x31')];_0x5e2f9c[_0x27c2('0x37')]=qs[_0x27c2('0x38')](_0x79e594[_0x27c2('0x2e')][_0x27c2('0x38')]);_0x5e2f9c['where']=qs[_0x27c2('0x2f')](_[_0x27c2('0x4b')](_0x79e594[_0x27c2('0x2e')],_0x12b6fd[_0x27c2('0x2f')]));if(_0x79e594[_0x27c2('0x2e')][_0x27c2('0x3a')]){_0x5e2f9c[_0x27c2('0x39')]=_[_0x27c2('0x3b')](_0x5e2f9c[_0x27c2('0x39')],{'$or':_['map'](_0x5e2f9c[_0x27c2('0x32')],function(_0x1a792f){var _0x43592e={};_0x43592e[_0x1a792f]={'$like':'%'+_0x79e594[_0x27c2('0x2e')][_0x27c2('0x3a')]+'%'};return _0x43592e;})});}_0x5e2f9c=_[_0x27c2('0x3b')]({},_0x5e2f9c,_0x79e594[_0x27c2('0x3d')]);return _0x3c52fd[_0x27c2('0x4d')](_0x5e2f9c);}})[_0x27c2('0x22')](function(_0xf7a022){if(_0xf7a022){_0x5ec488=_0xf7a022['length'];if(!_0x79e594[_0x27c2('0x2e')][_0x27c2('0x35')]('nolimit')){_0x5e2f9c[_0x27c2('0x1c')]=qs['limit'](_0x79e594[_0x27c2('0x2e')][_0x27c2('0x1c')]);_0x5e2f9c['offset']=qs[_0x27c2('0x1a')](_0x79e594[_0x27c2('0x2e')][_0x27c2('0x1a')]);}return _0x3c52fd[_0x27c2('0x4d')](_0x5e2f9c);}})['then'](function(_0x3cb698){if(_0x3cb698){return _0x3cb698?{'count':_0x5ec488,'rows':_0x3cb698}:null;}})[_0x27c2('0x22')](respondWithResult(_0x127a5d,null))['catch'](handleError(_0x127a5d,null));}; \ No newline at end of file +var _0xa232=['SalesforceConfiguration','includeAll','include','then','rows','catch','show','params','keys','create','body','find','getFields','findOne','getSubjects','SalesforceField','getDescriptions','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','end','error','stack','name','send','index','rawAttributes','fieldName','key','model','map','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options'];(function(_0x3b3414,_0xb8c1d3){var _0x47d3f6=function(_0x381088){while(--_0x381088){_0x3b3414['push'](_0x3b3414['shift']());}};_0x47d3f6(++_0xb8c1d3);}(_0xa232,0x141));var _0x2a23=function(_0x356485,_0x20d89b){_0x356485=_0x356485-0x0;var _0x480c5a=_0xa232[_0x356485];return _0x480c5a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x2a23('0x0'));var rp=require(_0x2a23('0x1'));var moment=require(_0x2a23('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x2a23('0x3'));var util=require(_0x2a23('0x4'));var path=require('path');var sox=require(_0x2a23('0x5'));var csv=require(_0x2a23('0x6'));var ejs=require(_0x2a23('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x2a23('0x8'));var crypto=require(_0x2a23('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x2a23('0xa'));var Papa=require(_0x2a23('0xb'));var Redis=require(_0x2a23('0xc'));var authService=require(_0x2a23('0xd'));var qs=require(_0x2a23('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2a23('0xf'));var logger=require(_0x2a23('0x10'))('api');var utils=require(_0x2a23('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x2a23('0x12'));var db=require(_0x2a23('0x13'))['db'];function respondWithStatusCode(_0x137750,_0x2efaff){_0x2efaff=_0x2efaff||0xcc;return function(_0x968630){if(_0x968630){return _0x137750['sendStatus'](_0x2efaff);}return _0x137750[_0x2a23('0x14')](_0x2efaff)['end']();};}function respondWithResult(_0x5a8030,_0x14aec1){_0x14aec1=_0x14aec1||0xc8;return function(_0x2d440e){if(_0x2d440e){return _0x5a8030['status'](_0x14aec1)['json'](_0x2d440e);}};}function respondWithFilteredResult(_0xf695db,_0x10d33b){return function(_0x2f6d6b){if(_0x2f6d6b){var _0x57815b=typeof _0x10d33b[_0x2a23('0x15')]===_0x2a23('0x16')&&typeof _0x10d33b[_0x2a23('0x17')]===_0x2a23('0x16');var _0x328dd1=_0x2f6d6b['count'];var _0x3fd212=_0x57815b?0x0:_0x10d33b[_0x2a23('0x15')];var _0x4594e9=_0x57815b?_0x2f6d6b[_0x2a23('0x18')]:_0x10d33b[_0x2a23('0x15')]+_0x10d33b[_0x2a23('0x17')];var _0x5b6ba4;if(_0x4594e9>=_0x328dd1){_0x4594e9=_0x328dd1;_0x5b6ba4=0xc8;}else{_0x5b6ba4=0xce;}_0xf695db[_0x2a23('0x14')](_0x5b6ba4);return _0xf695db[_0x2a23('0x19')](_0x2a23('0x1a'),_0x3fd212+'-'+_0x4594e9+'/'+_0x328dd1)['json'](_0x2f6d6b);}return null;};}function patchUpdates(_0x2cd4f3){return function(_0x54d5e2){try{jsonpatch[_0x2a23('0x1b')](_0x54d5e2,_0x2cd4f3,!![]);}catch(_0x172e9c){return BPromise['reject'](_0x172e9c);}return _0x54d5e2[_0x2a23('0x1c')]();};}function saveUpdates(_0x16cf08,_0x2d2166){return function(_0x2cbcb8){if(_0x2cbcb8){return _0x2cbcb8[_0x2a23('0x1d')](_0x16cf08)['then'](function(_0x445aab){return _0x445aab;});}return null;};}function removeEntity(_0x15a555,_0x429281){return function(_0x4cef42){if(_0x4cef42){return _0x4cef42[_0x2a23('0x1e')]()['then'](function(){_0x15a555[_0x2a23('0x14')](0xcc)[_0x2a23('0x1f')]();});}};}function handleEntityNotFound(_0x136f77,_0x259550){return function(_0x49e95b){if(!_0x49e95b){_0x136f77['sendStatus'](0x194);}return _0x49e95b;};}function handleError(_0x28fc45,_0x2226b8){_0x2226b8=_0x2226b8||0x1f4;return function(_0x49394c){logger[_0x2a23('0x20')](_0x49394c[_0x2a23('0x21')]);if(_0x49394c[_0x2a23('0x22')]){delete _0x49394c[_0x2a23('0x22')];}_0x28fc45['status'](_0x2226b8)[_0x2a23('0x23')](_0x49394c);};}exports[_0x2a23('0x24')]=function(_0x2cbfbe,_0x3700e2){var _0x54ad77={},_0x1831c2={},_0x19d28a={'count':0x0,'rows':[]};var _0x2f4a86=_['map'](db['SalesforceConfiguration'][_0x2a23('0x25')],function(_0x525f88){return{'name':_0x525f88[_0x2a23('0x26')],'type':_0x525f88['type'][_0x2a23('0x27')]};});_0x1831c2[_0x2a23('0x28')]=_[_0x2a23('0x29')](_0x2f4a86,_0x2a23('0x22'));_0x1831c2['query']=_['keys'](_0x2cbfbe['query']);_0x1831c2[_0x2a23('0x2a')]=_[_0x2a23('0x2b')](_0x1831c2[_0x2a23('0x28')],_0x1831c2[_0x2a23('0x2c')]);_0x54ad77[_0x2a23('0x2d')]=_[_0x2a23('0x2b')](_0x1831c2[_0x2a23('0x28')],qs[_0x2a23('0x2e')](_0x2cbfbe[_0x2a23('0x2c')][_0x2a23('0x2e')]));_0x54ad77[_0x2a23('0x2d')]=_0x54ad77[_0x2a23('0x2d')][_0x2a23('0x2f')]?_0x54ad77['attributes']:_0x1831c2[_0x2a23('0x28')];if(!_0x2cbfbe[_0x2a23('0x2c')][_0x2a23('0x30')](_0x2a23('0x31'))){_0x54ad77[_0x2a23('0x17')]=qs['limit'](_0x2cbfbe[_0x2a23('0x2c')][_0x2a23('0x17')]);_0x54ad77[_0x2a23('0x15')]=qs['offset'](_0x2cbfbe['query'][_0x2a23('0x15')]);}_0x54ad77[_0x2a23('0x32')]=qs[_0x2a23('0x33')](_0x2cbfbe[_0x2a23('0x2c')]['sort']);_0x54ad77[_0x2a23('0x34')]=qs[_0x2a23('0x2a')](_[_0x2a23('0x35')](_0x2cbfbe[_0x2a23('0x2c')],_0x1831c2[_0x2a23('0x2a')]),_0x2f4a86);if(_0x2cbfbe['query'][_0x2a23('0x36')]){_0x54ad77[_0x2a23('0x34')]=_[_0x2a23('0x37')](_0x54ad77[_0x2a23('0x34')],{'$or':_[_0x2a23('0x29')](_0x2f4a86,function(_0x269c37){if(_0x269c37[_0x2a23('0x38')]!==_0x2a23('0x39')){var _0x125039={};_0x125039[_0x269c37[_0x2a23('0x22')]]={'$like':'%'+_0x2cbfbe[_0x2a23('0x2c')][_0x2a23('0x36')]+'%'};return _0x125039;}})});}_0x54ad77=_[_0x2a23('0x37')]({},_0x54ad77,_0x2cbfbe[_0x2a23('0x3a')]);var _0xaa3bd4={'where':_0x54ad77[_0x2a23('0x34')]};return db[_0x2a23('0x3b')][_0x2a23('0x18')](_0xaa3bd4)['then'](function(_0x3e00f7){_0x19d28a[_0x2a23('0x18')]=_0x3e00f7;if(_0x2cbfbe['query'][_0x2a23('0x3c')]){_0x54ad77[_0x2a23('0x3d')]=[{'all':!![]}];}return db[_0x2a23('0x3b')]['findAll'](_0x54ad77);})[_0x2a23('0x3e')](function(_0x22a0f8){_0x19d28a[_0x2a23('0x3f')]=_0x22a0f8;return _0x19d28a;})[_0x2a23('0x3e')](respondWithFilteredResult(_0x3700e2,_0x54ad77))[_0x2a23('0x40')](handleError(_0x3700e2,null));};exports[_0x2a23('0x41')]=function(_0x5b30f0,_0x118848){var _0x5901c9={'raw':![],'where':{'id':_0x5b30f0[_0x2a23('0x42')]['id']}},_0x2cb6b3={};_0x2cb6b3[_0x2a23('0x28')]=_['keys'](db[_0x2a23('0x3b')][_0x2a23('0x25')]);_0x2cb6b3[_0x2a23('0x2c')]=_[_0x2a23('0x43')](_0x5b30f0[_0x2a23('0x2c')]);_0x2cb6b3[_0x2a23('0x2a')]=_['intersection'](_0x2cb6b3[_0x2a23('0x28')],_0x2cb6b3['query']);_0x5901c9[_0x2a23('0x2d')]=_['intersection'](_0x2cb6b3[_0x2a23('0x28')],qs[_0x2a23('0x2e')](_0x5b30f0[_0x2a23('0x2c')][_0x2a23('0x2e')]));_0x5901c9[_0x2a23('0x2d')]=_0x5901c9['attributes'][_0x2a23('0x2f')]?_0x5901c9[_0x2a23('0x2d')]:_0x2cb6b3[_0x2a23('0x28')];if(_0x5b30f0[_0x2a23('0x2c')][_0x2a23('0x3c')]){_0x5901c9['include']=[{'all':!![]}];}_0x5901c9=_[_0x2a23('0x37')]({},_0x5901c9,_0x5b30f0[_0x2a23('0x3a')]);return db[_0x2a23('0x3b')]['find'](_0x5901c9)[_0x2a23('0x3e')](handleEntityNotFound(_0x118848,null))[_0x2a23('0x3e')](respondWithResult(_0x118848,null))[_0x2a23('0x40')](handleError(_0x118848,null));};exports[_0x2a23('0x44')]=function(_0x1a709d,_0x3a17a2){return db[_0x2a23('0x3b')]['create'](_0x1a709d[_0x2a23('0x45')],{})[_0x2a23('0x3e')](respondWithResult(_0x3a17a2,0xc9))[_0x2a23('0x40')](handleError(_0x3a17a2,null));};exports[_0x2a23('0x1d')]=function(_0x563e5f,_0x387262){if(_0x563e5f[_0x2a23('0x45')]['id']){delete _0x563e5f[_0x2a23('0x45')]['id'];}return db[_0x2a23('0x3b')][_0x2a23('0x46')]({'where':{'id':_0x563e5f['params']['id']}})[_0x2a23('0x3e')](handleEntityNotFound(_0x387262,null))[_0x2a23('0x3e')](saveUpdates(_0x563e5f[_0x2a23('0x45')],null))[_0x2a23('0x3e')](respondWithResult(_0x387262,null))['catch'](handleError(_0x387262,null));};exports['destroy']=function(_0x426d1f,_0x5528db){return db['SalesforceConfiguration']['find']({'where':{'id':_0x426d1f['params']['id']}})['then'](handleEntityNotFound(_0x5528db,null))[_0x2a23('0x3e')](removeEntity(_0x5528db,null))[_0x2a23('0x40')](handleError(_0x5528db,null));};exports[_0x2a23('0x47')]=function(_0x4de5f8,_0x12a1eb,_0x50a3db){var _0x1c2c88={};var _0xeea0ad={};var _0x3431aa;var _0x40e0ca;return db[_0x2a23('0x3b')][_0x2a23('0x48')]({'where':{'id':_0x4de5f8[_0x2a23('0x42')]['id']}})[_0x2a23('0x3e')](handleEntityNotFound(_0x12a1eb,null))[_0x2a23('0x3e')](function(_0x2b3886){if(_0x2b3886){_0x3431aa=_0x2b3886;_0xeea0ad[_0x2a23('0x28')]=_['keys'](db['SalesforceField']['rawAttributes']);_0xeea0ad[_0x2a23('0x2c')]=_[_0x2a23('0x43')](_0x4de5f8[_0x2a23('0x2c')]);_0xeea0ad[_0x2a23('0x2a')]=_[_0x2a23('0x2b')](_0xeea0ad[_0x2a23('0x28')],_0xeea0ad['query']);_0x1c2c88[_0x2a23('0x2d')]=_[_0x2a23('0x2b')](_0xeea0ad[_0x2a23('0x28')],qs[_0x2a23('0x2e')](_0x4de5f8[_0x2a23('0x2c')][_0x2a23('0x2e')]));_0x1c2c88[_0x2a23('0x2d')]=_0x1c2c88[_0x2a23('0x2d')][_0x2a23('0x2f')]?_0x1c2c88['attributes']:_0xeea0ad[_0x2a23('0x28')];_0x1c2c88[_0x2a23('0x32')]=qs[_0x2a23('0x33')](_0x4de5f8[_0x2a23('0x2c')]['sort']);_0x1c2c88[_0x2a23('0x34')]=qs[_0x2a23('0x2a')](_['pick'](_0x4de5f8[_0x2a23('0x2c')],_0xeea0ad[_0x2a23('0x2a')]));if(_0x4de5f8['query'][_0x2a23('0x36')]){_0x1c2c88['where']=_[_0x2a23('0x37')](_0x1c2c88[_0x2a23('0x34')],{'$or':_[_0x2a23('0x29')](_0x1c2c88['attributes'],function(_0x55df95){var _0x35630a={};_0x35630a[_0x55df95]={'$like':'%'+_0x4de5f8['query']['filter']+'%'};return _0x35630a;})});}_0x1c2c88=_['merge']({},_0x1c2c88,_0x4de5f8['options']);return _0x3431aa[_0x2a23('0x47')](_0x1c2c88);}})[_0x2a23('0x3e')](function(_0x4b48a3){if(_0x4b48a3){_0x40e0ca=_0x4b48a3[_0x2a23('0x2f')];if(!_0x4de5f8[_0x2a23('0x2c')][_0x2a23('0x30')](_0x2a23('0x31'))){_0x1c2c88[_0x2a23('0x17')]=qs[_0x2a23('0x17')](_0x4de5f8[_0x2a23('0x2c')][_0x2a23('0x17')]);_0x1c2c88[_0x2a23('0x15')]=qs['offset'](_0x4de5f8[_0x2a23('0x2c')]['offset']);}return _0x3431aa[_0x2a23('0x47')](_0x1c2c88);}})['then'](function(_0x2cf1e1){if(_0x2cf1e1){return _0x2cf1e1?{'count':_0x40e0ca,'rows':_0x2cf1e1}:null;}})[_0x2a23('0x3e')](respondWithResult(_0x12a1eb,null))[_0x2a23('0x40')](handleError(_0x12a1eb,null));};exports[_0x2a23('0x49')]=function(_0x1fb596,_0x2e7278,_0x31ebfb){var _0x419152={};var _0x5b0a36={};var _0x4c3d52;var _0x3a5f6f;return db[_0x2a23('0x3b')][_0x2a23('0x48')]({'where':{'id':_0x1fb596[_0x2a23('0x42')]['id']}})[_0x2a23('0x3e')](handleEntityNotFound(_0x2e7278,null))[_0x2a23('0x3e')](function(_0x437356){if(_0x437356){_0x4c3d52=_0x437356;_0x5b0a36[_0x2a23('0x28')]=_['keys'](db[_0x2a23('0x4a')][_0x2a23('0x25')]);_0x5b0a36[_0x2a23('0x2c')]=_[_0x2a23('0x43')](_0x1fb596['query']);_0x5b0a36[_0x2a23('0x2a')]=_['intersection'](_0x5b0a36[_0x2a23('0x28')],_0x5b0a36[_0x2a23('0x2c')]);_0x419152['attributes']=_[_0x2a23('0x2b')](_0x5b0a36['model'],qs[_0x2a23('0x2e')](_0x1fb596[_0x2a23('0x2c')][_0x2a23('0x2e')]));_0x419152['attributes']=_0x419152[_0x2a23('0x2d')]['length']?_0x419152[_0x2a23('0x2d')]:_0x5b0a36[_0x2a23('0x28')];_0x419152[_0x2a23('0x32')]=qs['sort'](_0x1fb596['query']['sort']);_0x419152['where']=qs[_0x2a23('0x2a')](_[_0x2a23('0x35')](_0x1fb596['query'],_0x5b0a36[_0x2a23('0x2a')]));if(_0x1fb596[_0x2a23('0x2c')][_0x2a23('0x36')]){_0x419152[_0x2a23('0x34')]=_[_0x2a23('0x37')](_0x419152[_0x2a23('0x34')],{'$or':_[_0x2a23('0x29')](_0x419152[_0x2a23('0x2d')],function(_0x548733){var _0x4f6cf9={};_0x4f6cf9[_0x548733]={'$like':'%'+_0x1fb596[_0x2a23('0x2c')][_0x2a23('0x36')]+'%'};return _0x4f6cf9;})});}_0x419152=_[_0x2a23('0x37')]({},_0x419152,_0x1fb596[_0x2a23('0x3a')]);return _0x4c3d52[_0x2a23('0x49')](_0x419152);}})[_0x2a23('0x3e')](function(_0x4d8399){if(_0x4d8399){_0x3a5f6f=_0x4d8399[_0x2a23('0x2f')];if(!_0x1fb596[_0x2a23('0x2c')][_0x2a23('0x30')](_0x2a23('0x31'))){_0x419152[_0x2a23('0x17')]=qs[_0x2a23('0x17')](_0x1fb596['query'][_0x2a23('0x17')]);_0x419152[_0x2a23('0x15')]=qs['offset'](_0x1fb596[_0x2a23('0x2c')][_0x2a23('0x15')]);}return _0x4c3d52['getSubjects'](_0x419152);}})[_0x2a23('0x3e')](function(_0x213c59){if(_0x213c59){return _0x213c59?{'count':_0x3a5f6f,'rows':_0x213c59}:null;}})[_0x2a23('0x3e')](respondWithResult(_0x2e7278,null))[_0x2a23('0x40')](handleError(_0x2e7278,null));};exports[_0x2a23('0x4b')]=function(_0xb13168,_0x25fbbc,_0x4d376f){var _0x54f8ae={};var _0x309b0d={};var _0x39209b;var _0x2e5e27;return db[_0x2a23('0x3b')][_0x2a23('0x48')]({'where':{'id':_0xb13168['params']['id']}})[_0x2a23('0x3e')](handleEntityNotFound(_0x25fbbc,null))[_0x2a23('0x3e')](function(_0x40cc31){if(_0x40cc31){_0x39209b=_0x40cc31;_0x309b0d[_0x2a23('0x28')]=_[_0x2a23('0x43')](db[_0x2a23('0x4a')][_0x2a23('0x25')]);_0x309b0d[_0x2a23('0x2c')]=_[_0x2a23('0x43')](_0xb13168['query']);_0x309b0d[_0x2a23('0x2a')]=_[_0x2a23('0x2b')](_0x309b0d['model'],_0x309b0d[_0x2a23('0x2c')]);_0x54f8ae['attributes']=_[_0x2a23('0x2b')](_0x309b0d['model'],qs[_0x2a23('0x2e')](_0xb13168[_0x2a23('0x2c')]['fields']));_0x54f8ae[_0x2a23('0x2d')]=_0x54f8ae[_0x2a23('0x2d')][_0x2a23('0x2f')]?_0x54f8ae[_0x2a23('0x2d')]:_0x309b0d[_0x2a23('0x28')];_0x54f8ae[_0x2a23('0x32')]=qs['sort'](_0xb13168[_0x2a23('0x2c')][_0x2a23('0x33')]);_0x54f8ae[_0x2a23('0x34')]=qs[_0x2a23('0x2a')](_[_0x2a23('0x35')](_0xb13168[_0x2a23('0x2c')],_0x309b0d['filters']));if(_0xb13168[_0x2a23('0x2c')][_0x2a23('0x36')]){_0x54f8ae[_0x2a23('0x34')]=_[_0x2a23('0x37')](_0x54f8ae[_0x2a23('0x34')],{'$or':_[_0x2a23('0x29')](_0x54f8ae['attributes'],function(_0x50b66a){var _0x31b33c={};_0x31b33c[_0x50b66a]={'$like':'%'+_0xb13168[_0x2a23('0x2c')][_0x2a23('0x36')]+'%'};return _0x31b33c;})});}_0x54f8ae=_[_0x2a23('0x37')]({},_0x54f8ae,_0xb13168[_0x2a23('0x3a')]);return _0x39209b[_0x2a23('0x4b')](_0x54f8ae);}})['then'](function(_0x78d7ac){if(_0x78d7ac){_0x2e5e27=_0x78d7ac['length'];if(!_0xb13168[_0x2a23('0x2c')][_0x2a23('0x30')]('nolimit')){_0x54f8ae[_0x2a23('0x17')]=qs[_0x2a23('0x17')](_0xb13168[_0x2a23('0x2c')][_0x2a23('0x17')]);_0x54f8ae[_0x2a23('0x15')]=qs[_0x2a23('0x15')](_0xb13168[_0x2a23('0x2c')][_0x2a23('0x15')]);}return _0x39209b['getDescriptions'](_0x54f8ae);}})['then'](function(_0x4ac7b6){if(_0x4ac7b6){return _0x4ac7b6?{'count':_0x2e5e27,'rows':_0x4ac7b6}:null;}})['then'](respondWithResult(_0x25fbbc,null))[_0x2a23('0x40')](handleError(_0x25fbbc,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 871ea97..4a7f280 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 _0x64e4=['SalesforceConfiguration','int_salesforce_configurations','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intSalesforceConfiguration.attributes','exports','define'];(function(_0x1f26c2,_0x3748dc){var _0x3b9c50=function(_0x4dd06d){while(--_0x4dd06d){_0x1f26c2['push'](_0x1f26c2['shift']());}};_0x3b9c50(++_0x3748dc);}(_0x64e4,0x91));var _0x464e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x64e4[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x464e('0x0'));var logger=require(_0x464e('0x1'))(_0x464e('0x2'));var moment=require(_0x464e('0x3'));var BPromise=require(_0x464e('0x4'));var rp=require(_0x464e('0x5'));var fs=require('fs');var path=require(_0x464e('0x6'));var rimraf=require(_0x464e('0x7'));var config=require('../../config/environment');var attributes=require(_0x464e('0x8'));module[_0x464e('0x9')]=function(_0x4d5e4b,_0x365b19){return _0x4d5e4b[_0x464e('0xa')](_0x464e('0xb'),attributes,{'tableName':_0x464e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x94f7=['../../config/logger','moment','bluebird','path','rimraf','./intSalesforceConfiguration.attributes','define','int_salesforce_configurations','lodash'];(function(_0x410cb2,_0x3c0870){var _0x356c8b=function(_0x311b6e){while(--_0x311b6e){_0x410cb2['push'](_0x410cb2['shift']());}};_0x356c8b(++_0x3c0870);}(_0x94f7,0xe0));var _0x794f=function(_0x34445b,_0x13dbe8){_0x34445b=_0x34445b-0x0;var _0x5ec527=_0x94f7[_0x34445b];return _0x5ec527;};'use strict';var _=require(_0x794f('0x0'));var util=require('util');var logger=require(_0x794f('0x1'))('api');var moment=require(_0x794f('0x2'));var BPromise=require(_0x794f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x794f('0x4'));var rimraf=require(_0x794f('0x5'));var config=require('../../config/environment');var attributes=require(_0x794f('0x6'));module['exports']=function(_0x256619,_0x378e85){return _0x256619[_0x794f('0x7')]('SalesforceConfiguration',attributes,{'tableName':_0x794f('0x8'),'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 5d0338b..10d7f38 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 _0x26fb=['client','http','request','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x26fb,0x1bd));var _0xb26f=function(_0x453176,_0x1b27c5){_0x453176=_0x453176-0x0;var _0x19ad3=_0x26fb[_0x453176];return _0x19ad3;};'use strict';var _=require(_0xb26f('0x0'));var util=require(_0xb26f('0x1'));var moment=require(_0xb26f('0x2'));var BPromise=require(_0xb26f('0x3'));var rs=require(_0xb26f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb26f('0x5'))['db'];var utils=require(_0xb26f('0x6'));var logger=require(_0xb26f('0x7'))(_0xb26f('0x8'));var config=require(_0xb26f('0x9'));var jayson=require(_0xb26f('0xa'));var client=jayson[_0xb26f('0xb')][_0xb26f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x209a5e,_0xf93b8,_0x30cec8){return new BPromise(function(_0x5bc6fa,_0x1c07cd){return client[_0xb26f('0xd')](_0x209a5e,_0x30cec8)['then'](function(_0x36fef7){logger[_0xb26f('0xe')](_0xb26f('0xf'),_0xf93b8,_0xb26f('0x10'));logger[_0xb26f('0x11')](_0xb26f('0x12'),_0xf93b8,_0xb26f('0x10'),JSON[_0xb26f('0x13')](_0x36fef7));if(_0x36fef7['error']){if(_0x36fef7['error'][_0xb26f('0x14')]===0x1f4){logger[_0xb26f('0x15')](_0xb26f('0xf'),_0xf93b8,_0x36fef7[_0xb26f('0x15')]['message']);return _0x1c07cd(_0x36fef7[_0xb26f('0x15')][_0xb26f('0x16')]);}logger[_0xb26f('0x15')](_0xb26f('0xf'),_0xf93b8,_0x36fef7[_0xb26f('0x15')][_0xb26f('0x16')]);return _0x5bc6fa(_0x36fef7[_0xb26f('0x15')][_0xb26f('0x16')]);}else{logger['info']('SalesforceConfiguration,\x20%s,\x20%s',_0xf93b8,_0xb26f('0x10'));_0x5bc6fa(_0x36fef7['result'][_0xb26f('0x16')]);}})[_0xb26f('0x17')](function(_0xe334ee){logger[_0xb26f('0x15')](_0xb26f('0xf'),_0xf93b8,_0xe334ee);_0x1c07cd(_0xe334ee);});});} \ No newline at end of file +var _0xdb4c=['lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','debug','request\x20sent','code','error','message','result','catch'];(function(_0x562b8e,_0x321a12){var _0x145918=function(_0x4a4971){while(--_0x4a4971){_0x562b8e['push'](_0x562b8e['shift']());}};_0x145918(++_0x321a12);}(_0xdb4c,0xfc));var _0xcdb4=function(_0x1a2c98,_0x912cc2){_0x1a2c98=_0x1a2c98-0x0;var _0x514c05=_0xdb4c[_0x1a2c98];return _0x514c05;};'use strict';var _=require(_0xcdb4('0x0'));var util=require(_0xcdb4('0x1'));var moment=require(_0xcdb4('0x2'));var BPromise=require(_0xcdb4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcdb4('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xcdb4('0x5'));var logger=require(_0xcdb4('0x6'))('rpc');var config=require(_0xcdb4('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xcdb4('0x8')][_0xcdb4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xc123bb,_0x436f20,_0x224e17){return new BPromise(function(_0x353b5e,_0x245368){return client[_0xcdb4('0xa')](_0xc123bb,_0x224e17)[_0xcdb4('0xb')](function(_0x2c4462){logger[_0xcdb4('0xc')](_0xcdb4('0xd'),_0x436f20,'request\x20sent');logger[_0xcdb4('0xe')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x436f20,_0xcdb4('0xf'),JSON['stringify'](_0x2c4462));if(_0x2c4462['error']){if(_0x2c4462['error'][_0xcdb4('0x10')]===0x1f4){logger['error'](_0xcdb4('0xd'),_0x436f20,_0x2c4462[_0xcdb4('0x11')]['message']);return _0x245368(_0x2c4462['error'][_0xcdb4('0x12')]);}logger[_0xcdb4('0x11')](_0xcdb4('0xd'),_0x436f20,_0x2c4462[_0xcdb4('0x11')][_0xcdb4('0x12')]);return _0x353b5e(_0x2c4462[_0xcdb4('0x11')]['message']);}else{logger[_0xcdb4('0xc')](_0xcdb4('0xd'),_0x436f20,_0xcdb4('0xf'));_0x353b5e(_0x2c4462[_0xcdb4('0x13')][_0xcdb4('0x12')]);}})[_0xcdb4('0x14')](function(_0x38c6b2){logger[_0xcdb4('0x11')]('SalesforceConfiguration,\x20%s,\x20%s',_0x436f20,_0x38c6b2);_0x245368(_0x38c6b2);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index dd794e2..eaa2d4b 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 _0x8cd4=['post','create','put','/:id','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show'];(function(_0x143333,_0x1f506a){var _0x40f9a4=function(_0x136b91){while(--_0x136b91){_0x143333['push'](_0x143333['shift']());}};_0x40f9a4(++_0x1f506a);}(_0x8cd4,0x12e));var _0x48cd=function(_0x47df54,_0x1aeb61){_0x47df54=_0x47df54-0x0;var _0x261b87=_0x8cd4[_0x47df54];return _0x261b87;};'use strict';var multer=require(_0x48cd('0x0'));var util=require(_0x48cd('0x1'));var path=require(_0x48cd('0x2'));var timeout=require('connect-timeout');var express=require(_0x48cd('0x3'));var router=express[_0x48cd('0x4')]();var fs_extra=require(_0x48cd('0x5'));var auth=require(_0x48cd('0x6'));var interaction=require(_0x48cd('0x7'));var config=require(_0x48cd('0x8'));var controller=require('./intSalesforceField.controller');router[_0x48cd('0x9')]('/',auth[_0x48cd('0xa')](),controller[_0x48cd('0xb')]);router['get']('/:id',auth[_0x48cd('0xa')](),controller[_0x48cd('0xc')]);router[_0x48cd('0xd')]('/',auth[_0x48cd('0xa')](),controller[_0x48cd('0xe')]);router[_0x48cd('0xf')](_0x48cd('0x10'),auth[_0x48cd('0xa')](),controller[_0x48cd('0x11')]);router[_0x48cd('0x12')](_0x48cd('0x10'),auth[_0x48cd('0xa')](),controller[_0x48cd('0x13')]);module[_0x48cd('0x14')]=router; \ No newline at end of file +var _0x4978=['exports','multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','./intSalesforceField.controller','get','/:id','isAuthenticated','post','create','put','update','destroy'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x4978,0xf1));var _0x8497=function(_0x51a6af,_0x219d20){_0x51a6af=_0x51a6af-0x0;var _0x190e2c=_0x4978[_0x51a6af];return _0x190e2c;};'use strict';var multer=require(_0x8497('0x0'));var util=require(_0x8497('0x1'));var path=require('path');var timeout=require(_0x8497('0x2'));var express=require(_0x8497('0x3'));var router=express['Router']();var fs_extra=require(_0x8497('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x8497('0x5'));var config=require('../../config/environment');var controller=require(_0x8497('0x6'));router[_0x8497('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x8497('0x7')](_0x8497('0x8'),auth[_0x8497('0x9')](),controller['show']);router[_0x8497('0xa')]('/',auth[_0x8497('0x9')](),controller[_0x8497('0xb')]);router[_0x8497('0xc')](_0x8497('0x8'),auth['isAuthenticated'](),controller[_0x8497('0xd')]);router['delete'](_0x8497('0x8'),auth[_0x8497('0x9')](),controller[_0x8497('0xe')]);module[_0x8497('0xf')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index 95158cc..b7dede8 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 _0xd26c=['customVariable','exports','ENUM','string','variable','keyValue','picklist','STRING'];(function(_0x3a8eaf,_0x27df8c){var _0x29a58a=function(_0x1210ed){while(--_0x1210ed){_0x3a8eaf['push'](_0x3a8eaf['shift']());}};_0x29a58a(++_0x27df8c);}(_0xd26c,0xb9));var _0xcd26=function(_0xfd13af,_0x9f0174){_0xfd13af=_0xfd13af-0x0;var _0x111dd1=_0xd26c[_0xfd13af];return _0x111dd1;};'use strict';var Sequelize=require('sequelize');module[_0xcd26('0x0')]={'type':{'type':Sequelize[_0xcd26('0x1')](_0xcd26('0x2'),_0xcd26('0x3'),'customVariable',_0xcd26('0x4'),_0xcd26('0x5')),'defaultValue':_0xcd26('0x2')},'content':{'type':Sequelize[_0xcd26('0x6')]},'key':{'type':Sequelize[_0xcd26('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0xcd26('0x2'),_0xcd26('0x3'),_0xcd26('0x7'))},'keyContent':{'type':Sequelize[_0xcd26('0x6')]},'idField':{'type':Sequelize[_0xcd26('0x6')]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x7db4=['exports','string','variable','customVariable','keyValue','STRING','ENUM'];(function(_0x1ee351,_0x54261b){var _0x245aaf=function(_0x3e4b65){while(--_0x3e4b65){_0x1ee351['push'](_0x1ee351['shift']());}};_0x245aaf(++_0x54261b);}(_0x7db4,0xa1));var _0x47db=function(_0x5f3446,_0x41bdb8){_0x5f3446=_0x5f3446-0x0;var _0x575c3f=_0x7db4[_0x5f3446];return _0x575c3f;};'use strict';var Sequelize=require('sequelize');module[_0x47db('0x0')]={'type':{'type':Sequelize['ENUM'](_0x47db('0x1'),_0x47db('0x2'),_0x47db('0x3'),_0x47db('0x4'),'picklist'),'defaultValue':_0x47db('0x1')},'content':{'type':Sequelize[_0x47db('0x5')]},'key':{'type':Sequelize[_0x47db('0x5')]},'keyType':{'type':Sequelize[_0x47db('0x6')](_0x47db('0x1'),_0x47db('0x2'),_0x47db('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x47db('0x5')]},'variableName':{'type':Sequelize[_0x47db('0x5')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index cf40d3c..4d00213 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 _0x134a=['count','limit','Content-Range','apply','reject','save','update','destroy','then','sendStatus','name','send','index','map','SalesforceField','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','params','rawAttributes','create','body','find','eml-format','request-promise','moment','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','offset','undefined'];(function(_0x249cf4,_0x24899a){var _0x9be082=function(_0x2c9411){while(--_0x2c9411){_0x249cf4['push'](_0x249cf4['shift']());}};_0x9be082(++_0x24899a);}(_0x134a,0x13a));var _0xa134=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x134a[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0xa134('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa134('0x1'));var moment=require(_0xa134('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xa134('0x3'));var path=require(_0xa134('0x4'));var sox=require('sox');var csv=require(_0xa134('0x5'));var ejs=require(_0xa134('0x6'));var fs=require('fs');var fs_extra=require(_0xa134('0x7'));var _=require(_0xa134('0x8'));var squel=require(_0xa134('0x9'));var crypto=require(_0xa134('0xa'));var jsforce=require(_0xa134('0xb'));var deskjs=require(_0xa134('0xc'));var toCsv=require('to-csv');var querystring=require(_0xa134('0xd'));var Papa=require('papaparse');var Redis=require(_0xa134('0xe'));var authService=require(_0xa134('0xf'));var qs=require(_0xa134('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa134('0x11'))(_0xa134('0x12'));var utils=require(_0xa134('0x13'));var config=require(_0xa134('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x38dc9a,_0x35114a){_0x35114a=_0x35114a||0xcc;return function(_0x31e776){if(_0x31e776){return _0x38dc9a['sendStatus'](_0x35114a);}return _0x38dc9a[_0xa134('0x15')](_0x35114a)[_0xa134('0x16')]();};}function respondWithResult(_0x14ec92,_0x1e75a2){_0x1e75a2=_0x1e75a2||0xc8;return function(_0x38e51e){if(_0x38e51e){return _0x14ec92[_0xa134('0x15')](_0x1e75a2)[_0xa134('0x17')](_0x38e51e);}};}function respondWithFilteredResult(_0x2a8b6c,_0x4b1306){return function(_0x1aff4f){if(_0x1aff4f){var _0x397403=typeof _0x4b1306[_0xa134('0x18')]==='undefined'&&typeof _0x4b1306['limit']===_0xa134('0x19');var _0x5ccd68=_0x1aff4f[_0xa134('0x1a')];var _0x2a90ae=_0x397403?0x0:_0x4b1306[_0xa134('0x18')];var _0x40d297=_0x397403?_0x1aff4f[_0xa134('0x1a')]:_0x4b1306[_0xa134('0x18')]+_0x4b1306[_0xa134('0x1b')];var _0x488d43;if(_0x40d297>=_0x5ccd68){_0x40d297=_0x5ccd68;_0x488d43=0xc8;}else{_0x488d43=0xce;}_0x2a8b6c['status'](_0x488d43);return _0x2a8b6c['set'](_0xa134('0x1c'),_0x2a90ae+'-'+_0x40d297+'/'+_0x5ccd68)[_0xa134('0x17')](_0x1aff4f);}return null;};}function patchUpdates(_0x3a7570){return function(_0x18404c){try{jsonpatch[_0xa134('0x1d')](_0x18404c,_0x3a7570,!![]);}catch(_0x1ee48a){return BPromise[_0xa134('0x1e')](_0x1ee48a);}return _0x18404c[_0xa134('0x1f')]();};}function saveUpdates(_0x2a393c,_0x55026e){return function(_0x4a7872){if(_0x4a7872){return _0x4a7872[_0xa134('0x20')](_0x2a393c)['then'](function(_0x5d3630){return _0x5d3630;});}return null;};}function removeEntity(_0x353fb5,_0x5c88e9){return function(_0x20c12d){if(_0x20c12d){return _0x20c12d[_0xa134('0x21')]()[_0xa134('0x22')](function(){_0x353fb5[_0xa134('0x15')](0xcc)[_0xa134('0x16')]();});}};}function handleEntityNotFound(_0x10c7c7,_0x2db22a){return function(_0x28a94c){if(!_0x28a94c){_0x10c7c7[_0xa134('0x23')](0x194);}return _0x28a94c;};}function handleError(_0x1d70b2,_0x337ad1){_0x337ad1=_0x337ad1||0x1f4;return function(_0x1da1c7){logger['error'](_0x1da1c7['stack']);if(_0x1da1c7[_0xa134('0x24')]){delete _0x1da1c7[_0xa134('0x24')];}_0x1d70b2[_0xa134('0x15')](_0x337ad1)[_0xa134('0x25')](_0x1da1c7);};}exports[_0xa134('0x26')]=function(_0x6acdb5,_0x4b3c5f){var _0x299000={},_0x3b5d79={},_0x5c1245={'count':0x0,'rows':[]};var _0x180a13=_[_0xa134('0x27')](db[_0xa134('0x28')]['rawAttributes'],function(_0x2ecdbb){return{'name':_0x2ecdbb['fieldName'],'type':_0x2ecdbb[_0xa134('0x29')]['key']};});_0x3b5d79[_0xa134('0x2a')]=_[_0xa134('0x27')](_0x180a13,'name');_0x3b5d79[_0xa134('0x2b')]=_[_0xa134('0x2c')](_0x6acdb5[_0xa134('0x2b')]);_0x3b5d79[_0xa134('0x2d')]=_['intersection'](_0x3b5d79['model'],_0x3b5d79[_0xa134('0x2b')]);_0x299000[_0xa134('0x2e')]=_[_0xa134('0x2f')](_0x3b5d79[_0xa134('0x2a')],qs[_0xa134('0x30')](_0x6acdb5[_0xa134('0x2b')]['fields']));_0x299000[_0xa134('0x2e')]=_0x299000[_0xa134('0x2e')][_0xa134('0x31')]?_0x299000[_0xa134('0x2e')]:_0x3b5d79[_0xa134('0x2a')];if(!_0x6acdb5[_0xa134('0x2b')][_0xa134('0x32')]('nolimit')){_0x299000['limit']=qs[_0xa134('0x1b')](_0x6acdb5[_0xa134('0x2b')][_0xa134('0x1b')]);_0x299000[_0xa134('0x18')]=qs[_0xa134('0x18')](_0x6acdb5[_0xa134('0x2b')][_0xa134('0x18')]);}_0x299000[_0xa134('0x33')]=qs[_0xa134('0x34')](_0x6acdb5['query'][_0xa134('0x34')]);_0x299000[_0xa134('0x35')]=qs[_0xa134('0x2d')](_[_0xa134('0x36')](_0x6acdb5[_0xa134('0x2b')],_0x3b5d79[_0xa134('0x2d')]),_0x180a13);if(_0x6acdb5[_0xa134('0x2b')][_0xa134('0x37')]){_0x299000[_0xa134('0x35')]=_[_0xa134('0x38')](_0x299000['where'],{'$or':_[_0xa134('0x27')](_0x180a13,function(_0x2c73c1){if(_0x2c73c1[_0xa134('0x29')]!==_0xa134('0x39')){var _0x1add47={};_0x1add47[_0x2c73c1[_0xa134('0x24')]]={'$like':'%'+_0x6acdb5[_0xa134('0x2b')][_0xa134('0x37')]+'%'};return _0x1add47;}})});}_0x299000=_['merge']({},_0x299000,_0x6acdb5[_0xa134('0x3a')]);var _0x3b17e2={'where':_0x299000[_0xa134('0x35')]};return db[_0xa134('0x28')][_0xa134('0x1a')](_0x3b17e2)['then'](function(_0x295872){_0x5c1245[_0xa134('0x1a')]=_0x295872;if(_0x6acdb5[_0xa134('0x2b')][_0xa134('0x3b')]){_0x299000[_0xa134('0x3c')]=[{'all':!![]}];}return db[_0xa134('0x28')]['findAll'](_0x299000);})[_0xa134('0x22')](function(_0x5687dc){_0x5c1245[_0xa134('0x3d')]=_0x5687dc;return _0x5c1245;})[_0xa134('0x22')](respondWithFilteredResult(_0x4b3c5f,_0x299000))[_0xa134('0x3e')](handleError(_0x4b3c5f,null));};exports['show']=function(_0x2b9f93,_0x24dc11){var _0x242d42={'raw':!![],'where':{'id':_0x2b9f93[_0xa134('0x3f')]['id']}},_0x1d7e2f={};_0x1d7e2f[_0xa134('0x2a')]=_['keys'](db['SalesforceField'][_0xa134('0x40')]);_0x1d7e2f[_0xa134('0x2b')]=_['keys'](_0x2b9f93[_0xa134('0x2b')]);_0x1d7e2f['filters']=_[_0xa134('0x2f')](_0x1d7e2f[_0xa134('0x2a')],_0x1d7e2f[_0xa134('0x2b')]);_0x242d42[_0xa134('0x2e')]=_[_0xa134('0x2f')](_0x1d7e2f[_0xa134('0x2a')],qs[_0xa134('0x30')](_0x2b9f93[_0xa134('0x2b')][_0xa134('0x30')]));_0x242d42['attributes']=_0x242d42[_0xa134('0x2e')]['length']?_0x242d42['attributes']:_0x1d7e2f[_0xa134('0x2a')];if(_0x2b9f93['query'][_0xa134('0x3b')]){_0x242d42[_0xa134('0x3c')]=[{'all':!![]}];}_0x242d42=_[_0xa134('0x38')]({},_0x242d42,_0x2b9f93[_0xa134('0x3a')]);return db[_0xa134('0x28')]['find'](_0x242d42)[_0xa134('0x22')](handleEntityNotFound(_0x24dc11,null))[_0xa134('0x22')](respondWithResult(_0x24dc11,null))['catch'](handleError(_0x24dc11,null));};exports[_0xa134('0x41')]=function(_0x288f8d,_0x59e2d6){return db[_0xa134('0x28')][_0xa134('0x41')](_0x288f8d[_0xa134('0x42')],{})['then'](respondWithResult(_0x59e2d6,0xc9))[_0xa134('0x3e')](handleError(_0x59e2d6,null));};exports[_0xa134('0x20')]=function(_0x67908d,_0x4d7b6b){if(_0x67908d[_0xa134('0x42')]['id']){delete _0x67908d[_0xa134('0x42')]['id'];}return db['SalesforceField'][_0xa134('0x43')]({'where':{'id':_0x67908d[_0xa134('0x3f')]['id']}})['then'](handleEntityNotFound(_0x4d7b6b,null))['then'](saveUpdates(_0x67908d['body'],null))['then'](respondWithResult(_0x4d7b6b,null))[_0xa134('0x3e')](handleError(_0x4d7b6b,null));};exports['destroy']=function(_0x4c27cf,_0x27d82e){return db[_0xa134('0x28')]['find']({'where':{'id':_0x4c27cf[_0xa134('0x3f')]['id']}})[_0xa134('0x22')](handleEntityNotFound(_0x27d82e,null))[_0xa134('0x22')](removeEntity(_0x27d82e,null))[_0xa134('0x3e')](handleError(_0x27d82e,null));}; \ No newline at end of file +var _0x88a6=['attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','options','includeAll','include','findAll','rows','show','params','find','create','body','catch','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','then','error','name','send','index','map','SalesforceField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection'];(function(_0x5d6ff9,_0x379ad8){var _0xb483db=function(_0x251840){while(--_0x251840){_0x5d6ff9['push'](_0x5d6ff9['shift']());}};_0xb483db(++_0x379ad8);}(_0x88a6,0xad));var _0x688a=function(_0x3738ad,_0x4e25ae){_0x3738ad=_0x3738ad-0x0;var _0x253a25=_0x88a6[_0x3738ad];return _0x253a25;};'use strict';var emlformat=require(_0x688a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x688a('0x1'));var jsonpatch=require(_0x688a('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x688a('0x3'));var Mustache=require(_0x688a('0x4'));var util=require(_0x688a('0x5'));var path=require(_0x688a('0x6'));var sox=require(_0x688a('0x7'));var csv=require(_0x688a('0x8'));var ejs=require(_0x688a('0x9'));var fs=require('fs');var fs_extra=require(_0x688a('0xa'));var _=require(_0x688a('0xb'));var squel=require(_0x688a('0xc'));var crypto=require('crypto');var jsforce=require(_0x688a('0xd'));var deskjs=require(_0x688a('0xe'));var toCsv=require(_0x688a('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x688a('0xf'));var authService=require(_0x688a('0x10'));var qs=require(_0x688a('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x688a('0x12'));var logger=require(_0x688a('0x13'))(_0x688a('0x14'));var utils=require(_0x688a('0x15'));var config=require(_0x688a('0x16'));var licenseUtil=require(_0x688a('0x17'));var db=require(_0x688a('0x18'))['db'];function respondWithStatusCode(_0x43e9b5,_0x2430b9){_0x2430b9=_0x2430b9||0xcc;return function(_0x5bd7e1){if(_0x5bd7e1){return _0x43e9b5[_0x688a('0x19')](_0x2430b9);}return _0x43e9b5['status'](_0x2430b9)[_0x688a('0x1a')]();};}function respondWithResult(_0xaaf804,_0x35cd04){_0x35cd04=_0x35cd04||0xc8;return function(_0x562795){if(_0x562795){return _0xaaf804[_0x688a('0x1b')](_0x35cd04)[_0x688a('0x1c')](_0x562795);}};}function respondWithFilteredResult(_0x54571e,_0x4b7249){return function(_0x58023c){if(_0x58023c){var _0x24849e=typeof _0x4b7249[_0x688a('0x1d')]===_0x688a('0x1e')&&typeof _0x4b7249[_0x688a('0x1f')]===_0x688a('0x1e');var _0x3c6c98=_0x58023c['count'];var _0x613cd2=_0x24849e?0x0:_0x4b7249[_0x688a('0x1d')];var _0x54d73f=_0x24849e?_0x58023c[_0x688a('0x20')]:_0x4b7249['offset']+_0x4b7249[_0x688a('0x1f')];var _0x1e0041;if(_0x54d73f>=_0x3c6c98){_0x54d73f=_0x3c6c98;_0x1e0041=0xc8;}else{_0x1e0041=0xce;}_0x54571e[_0x688a('0x1b')](_0x1e0041);return _0x54571e[_0x688a('0x21')](_0x688a('0x22'),_0x613cd2+'-'+_0x54d73f+'/'+_0x3c6c98)[_0x688a('0x1c')](_0x58023c);}return null;};}function patchUpdates(_0x141ef3){return function(_0x18fef6){try{jsonpatch[_0x688a('0x23')](_0x18fef6,_0x141ef3,!![]);}catch(_0x2d8a10){return BPromise[_0x688a('0x24')](_0x2d8a10);}return _0x18fef6['save']();};}function saveUpdates(_0x55bdfb,_0x277433){return function(_0x924a34){if(_0x924a34){return _0x924a34[_0x688a('0x25')](_0x55bdfb)['then'](function(_0x2adde5){return _0x2adde5;});}return null;};}function removeEntity(_0x1b4fe9,_0xed51dc){return function(_0x580798){if(_0x580798){return _0x580798[_0x688a('0x26')]()[_0x688a('0x27')](function(){_0x1b4fe9['status'](0xcc)[_0x688a('0x1a')]();});}};}function handleEntityNotFound(_0x55f2a0,_0x1534a9){return function(_0x1f4661){if(!_0x1f4661){_0x55f2a0[_0x688a('0x19')](0x194);}return _0x1f4661;};}function handleError(_0x1af1a1,_0x573631){_0x573631=_0x573631||0x1f4;return function(_0x3c5379){logger[_0x688a('0x28')](_0x3c5379['stack']);if(_0x3c5379[_0x688a('0x29')]){delete _0x3c5379[_0x688a('0x29')];}_0x1af1a1['status'](_0x573631)[_0x688a('0x2a')](_0x3c5379);};}exports[_0x688a('0x2b')]=function(_0x206ae3,_0x5004fd){var _0x274768={},_0x4b4108={},_0x14fbbf={'count':0x0,'rows':[]};var _0x517a2e=_[_0x688a('0x2c')](db[_0x688a('0x2d')][_0x688a('0x2e')],function(_0x1a5eca){return{'name':_0x1a5eca[_0x688a('0x2f')],'type':_0x1a5eca[_0x688a('0x30')][_0x688a('0x31')]};});_0x4b4108[_0x688a('0x32')]=_[_0x688a('0x2c')](_0x517a2e,'name');_0x4b4108[_0x688a('0x33')]=_[_0x688a('0x34')](_0x206ae3[_0x688a('0x33')]);_0x4b4108[_0x688a('0x35')]=_[_0x688a('0x36')](_0x4b4108['model'],_0x4b4108['query']);_0x274768[_0x688a('0x37')]=_[_0x688a('0x36')](_0x4b4108['model'],qs[_0x688a('0x38')](_0x206ae3[_0x688a('0x33')][_0x688a('0x38')]));_0x274768[_0x688a('0x37')]=_0x274768[_0x688a('0x37')][_0x688a('0x39')]?_0x274768['attributes']:_0x4b4108[_0x688a('0x32')];if(!_0x206ae3['query'][_0x688a('0x3a')]('nolimit')){_0x274768[_0x688a('0x1f')]=qs[_0x688a('0x1f')](_0x206ae3[_0x688a('0x33')]['limit']);_0x274768[_0x688a('0x1d')]=qs[_0x688a('0x1d')](_0x206ae3[_0x688a('0x33')][_0x688a('0x1d')]);}_0x274768[_0x688a('0x3b')]=qs[_0x688a('0x3c')](_0x206ae3[_0x688a('0x33')]['sort']);_0x274768['where']=qs[_0x688a('0x35')](_[_0x688a('0x3d')](_0x206ae3['query'],_0x4b4108[_0x688a('0x35')]),_0x517a2e);if(_0x206ae3[_0x688a('0x33')][_0x688a('0x3e')]){_0x274768[_0x688a('0x3f')]=_['merge'](_0x274768['where'],{'$or':_['map'](_0x517a2e,function(_0x171739){if(_0x171739['type']!=='VIRTUAL'){var _0x24e415={};_0x24e415[_0x171739[_0x688a('0x29')]]={'$like':'%'+_0x206ae3[_0x688a('0x33')]['filter']+'%'};return _0x24e415;}})});}_0x274768=_[_0x688a('0x40')]({},_0x274768,_0x206ae3[_0x688a('0x41')]);var _0x495f91={'where':_0x274768['where']};return db[_0x688a('0x2d')][_0x688a('0x20')](_0x495f91)[_0x688a('0x27')](function(_0x41cbb0){_0x14fbbf[_0x688a('0x20')]=_0x41cbb0;if(_0x206ae3['query'][_0x688a('0x42')]){_0x274768[_0x688a('0x43')]=[{'all':!![]}];}return db[_0x688a('0x2d')][_0x688a('0x44')](_0x274768);})[_0x688a('0x27')](function(_0x51a832){_0x14fbbf[_0x688a('0x45')]=_0x51a832;return _0x14fbbf;})['then'](respondWithFilteredResult(_0x5004fd,_0x274768))['catch'](handleError(_0x5004fd,null));};exports[_0x688a('0x46')]=function(_0x519e25,_0xeae444){var _0x4a0cf6={'raw':!![],'where':{'id':_0x519e25[_0x688a('0x47')]['id']}},_0x58784a={};_0x58784a[_0x688a('0x32')]=_[_0x688a('0x34')](db[_0x688a('0x2d')][_0x688a('0x2e')]);_0x58784a['query']=_[_0x688a('0x34')](_0x519e25[_0x688a('0x33')]);_0x58784a[_0x688a('0x35')]=_[_0x688a('0x36')](_0x58784a[_0x688a('0x32')],_0x58784a[_0x688a('0x33')]);_0x4a0cf6[_0x688a('0x37')]=_[_0x688a('0x36')](_0x58784a[_0x688a('0x32')],qs[_0x688a('0x38')](_0x519e25[_0x688a('0x33')][_0x688a('0x38')]));_0x4a0cf6[_0x688a('0x37')]=_0x4a0cf6['attributes'][_0x688a('0x39')]?_0x4a0cf6[_0x688a('0x37')]:_0x58784a[_0x688a('0x32')];if(_0x519e25['query'][_0x688a('0x42')]){_0x4a0cf6[_0x688a('0x43')]=[{'all':!![]}];}_0x4a0cf6=_[_0x688a('0x40')]({},_0x4a0cf6,_0x519e25[_0x688a('0x41')]);return db[_0x688a('0x2d')][_0x688a('0x48')](_0x4a0cf6)['then'](handleEntityNotFound(_0xeae444,null))[_0x688a('0x27')](respondWithResult(_0xeae444,null))['catch'](handleError(_0xeae444,null));};exports['create']=function(_0x496ee5,_0x47e6f1){return db[_0x688a('0x2d')][_0x688a('0x49')](_0x496ee5[_0x688a('0x4a')],{})['then'](respondWithResult(_0x47e6f1,0xc9))[_0x688a('0x4b')](handleError(_0x47e6f1,null));};exports[_0x688a('0x25')]=function(_0x296e85,_0x17a04e){if(_0x296e85['body']['id']){delete _0x296e85['body']['id'];}return db[_0x688a('0x2d')][_0x688a('0x48')]({'where':{'id':_0x296e85[_0x688a('0x47')]['id']}})[_0x688a('0x27')](handleEntityNotFound(_0x17a04e,null))['then'](saveUpdates(_0x296e85[_0x688a('0x4a')],null))['then'](respondWithResult(_0x17a04e,null))[_0x688a('0x4b')](handleError(_0x17a04e,null));};exports['destroy']=function(_0x2a2dec,_0x53848f){return db['SalesforceField'][_0x688a('0x48')]({'where':{'id':_0x2a2dec[_0x688a('0x47')]['id']}})[_0x688a('0x27')](handleEntityNotFound(_0x53848f,null))[_0x688a('0x27')](removeEntity(_0x53848f,null))[_0x688a('0x4b')](handleError(_0x53848f,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index f9f24be..db0a247 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 _0x22e8=['rimraf','../../config/environment','./intSalesforceField.attributes','exports','salesforce_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x25c8c9,_0x397eee){var _0x349c12=function(_0x14ba63){while(--_0x14ba63){_0x25c8c9['push'](_0x25c8c9['shift']());}};_0x349c12(++_0x397eee);}(_0x22e8,0x13b));var _0x822e=function(_0x3ec463,_0x486f29){_0x3ec463=_0x3ec463-0x0;var _0x5e2ac2=_0x22e8[_0x3ec463];return _0x5e2ac2;};'use strict';var _=require(_0x822e('0x0'));var util=require(_0x822e('0x1'));var logger=require(_0x822e('0x2'))(_0x822e('0x3'));var moment=require(_0x822e('0x4'));var BPromise=require('bluebird');var rp=require(_0x822e('0x5'));var fs=require('fs');var path=require(_0x822e('0x6'));var rimraf=require(_0x822e('0x7'));var config=require(_0x822e('0x8'));var attributes=require(_0x822e('0x9'));module[_0x822e('0xa')]=function(_0x351690,_0x2be1e5){return _0x351690['define']('SalesforceField',attributes,{'tableName':'int_salesforce_fields','paranoid':![],'indexes':[{'name':_0x822e('0xb'),'fields':[_0x822e('0xc'),_0x822e('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc030=['SalesforceField','int_salesforce_fields','salesforce_unique_index','FieldId','lodash','util','api','request-promise','path','rimraf','./intSalesforceField.attributes','exports'];(function(_0x5874e8,_0x483eb2){var _0x5e7bc1=function(_0x41a675){while(--_0x41a675){_0x5874e8['push'](_0x5874e8['shift']());}};_0x5e7bc1(++_0x483eb2);}(_0xc030,0x130));var _0x0c03=function(_0x18ab18,_0x40b0e9){_0x18ab18=_0x18ab18-0x0;var _0x305236=_0xc030[_0x18ab18];return _0x305236;};'use strict';var _=require(_0x0c03('0x0'));var util=require(_0x0c03('0x1'));var logger=require('../../config/logger')(_0x0c03('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0c03('0x3'));var fs=require('fs');var path=require(_0x0c03('0x4'));var rimraf=require(_0x0c03('0x5'));var config=require('../../config/environment');var attributes=require(_0x0c03('0x6'));module[_0x0c03('0x7')]=function(_0x339245,_0x13eb09){return _0x339245['define'](_0x0c03('0x8'),attributes,{'tableName':_0x0c03('0x9'),'paranoid':![],'indexes':[{'name':_0x0c03('0xa'),'fields':['idField',_0x0c03('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.rpc.js b/server/api/intSalesforceField/intSalesforceField.rpc.js index e592373..86b3885 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 _0xc393=['rpc','../../config/environment','jayson/promise','client','request','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x177fb4,_0x394341){var _0x49a4f6=function(_0x4b3de0){while(--_0x4b3de0){_0x177fb4['push'](_0x177fb4['shift']());}};_0x49a4f6(++_0x394341);}(_0xc393,0x84));var _0x3c39=function(_0x293440,_0x357eff){_0x293440=_0x293440-0x0;var _0x596af9=_0xc393[_0x293440];return _0x596af9;};'use strict';var _=require(_0x3c39('0x0'));var util=require(_0x3c39('0x1'));var moment=require(_0x3c39('0x2'));var BPromise=require(_0x3c39('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3c39('0x4'));var db=require(_0x3c39('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3c39('0x6'));var config=require(_0x3c39('0x7'));var jayson=require(_0x3c39('0x8'));var client=jayson[_0x3c39('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x485d4f,_0x1d5219,_0x2abf12){return new BPromise(function(_0x299c3c,_0x4d4743){return client[_0x3c39('0xa')](_0x485d4f,_0x2abf12)[_0x3c39('0xb')](function(_0x269ed9){logger[_0x3c39('0xc')](_0x3c39('0xd'),_0x1d5219,_0x3c39('0xe'));logger[_0x3c39('0xf')](_0x3c39('0x10'),_0x1d5219,_0x3c39('0xe'),JSON[_0x3c39('0x11')](_0x269ed9));if(_0x269ed9[_0x3c39('0x12')]){if(_0x269ed9[_0x3c39('0x12')][_0x3c39('0x13')]===0x1f4){logger[_0x3c39('0x12')]('SalesforceField,\x20%s,\x20%s',_0x1d5219,_0x269ed9[_0x3c39('0x12')][_0x3c39('0x14')]);return _0x4d4743(_0x269ed9[_0x3c39('0x12')]['message']);}logger['error'](_0x3c39('0xd'),_0x1d5219,_0x269ed9['error'][_0x3c39('0x14')]);return _0x299c3c(_0x269ed9[_0x3c39('0x12')][_0x3c39('0x14')]);}else{logger[_0x3c39('0xc')](_0x3c39('0xd'),_0x1d5219,_0x3c39('0xe'));_0x299c3c(_0x269ed9[_0x3c39('0x15')][_0x3c39('0x14')]);}})[_0x3c39('0x16')](function(_0x46b206){logger[_0x3c39('0x12')]('SalesforceField,\x20%s,\x20%s',_0x1d5219,_0x46b206);_0x4d4743(_0x46b206);});});} \ No newline at end of file +var _0xa539=['request','then','info','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','error','SalesforceField,\x20%s,\x20%s','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client'];(function(_0x1aa5eb,_0x4efec4){var _0x45f0fa=function(_0x35e7d4){while(--_0x35e7d4){_0x1aa5eb['push'](_0x1aa5eb['shift']());}};_0x45f0fa(++_0x4efec4);}(_0xa539,0xbf));var _0x9a53=function(_0x10d751,_0x119ebf){_0x10d751=_0x10d751-0x0;var _0x1569a0=_0xa539[_0x10d751];return _0x1569a0;};'use strict';var _=require('lodash');var util=require(_0x9a53('0x0'));var moment=require('moment');var BPromise=require(_0x9a53('0x1'));var rs=require(_0x9a53('0x2'));var fs=require('fs');var Redis=require(_0x9a53('0x3'));var db=require(_0x9a53('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9a53('0x5'))(_0x9a53('0x6'));var config=require('../../config/environment');var jayson=require(_0x9a53('0x7'));var client=jayson[_0x9a53('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xf2559d,_0x17ddd3,_0x306b36){return new BPromise(function(_0x322506,_0xd5dd61){return client[_0x9a53('0x9')](_0xf2559d,_0x306b36)[_0x9a53('0xa')](function(_0x2ae608){logger[_0x9a53('0xb')]('SalesforceField,\x20%s,\x20%s',_0x17ddd3,_0x9a53('0xc'));logger[_0x9a53('0xd')](_0x9a53('0xe'),_0x17ddd3,_0x9a53('0xc'),JSON['stringify'](_0x2ae608));if(_0x2ae608['error']){if(_0x2ae608[_0x9a53('0xf')]['code']===0x1f4){logger[_0x9a53('0xf')](_0x9a53('0x10'),_0x17ddd3,_0x2ae608[_0x9a53('0xf')][_0x9a53('0x11')]);return _0xd5dd61(_0x2ae608[_0x9a53('0xf')][_0x9a53('0x11')]);}logger[_0x9a53('0xf')](_0x9a53('0x10'),_0x17ddd3,_0x2ae608[_0x9a53('0xf')][_0x9a53('0x11')]);return _0x322506(_0x2ae608[_0x9a53('0xf')][_0x9a53('0x11')]);}else{logger[_0x9a53('0xb')](_0x9a53('0x10'),_0x17ddd3,_0x9a53('0xc'));_0x322506(_0x2ae608[_0x9a53('0x12')][_0x9a53('0x11')]);}})[_0x9a53('0x13')](function(_0x2f9094){logger[_0x9a53('0xf')](_0x9a53('0x10'),_0x17ddd3,_0x2f9094);_0xd5dd61(_0x2f9094);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 6e8a825..b24e33b 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 _0x9b8c=['/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','multer','util','path','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show'];(function(_0x5a563b,_0x260f62){var _0x3ad9a9=function(_0x477ed2){while(--_0x477ed2){_0x5a563b['push'](_0x5a563b['shift']());}};_0x3ad9a9(++_0x260f62);}(_0x9b8c,0x16f));var _0xc9b8=function(_0x1e1020,_0xd64a27){_0x1e1020=_0x1e1020-0x0;var _0x464719=_0x9b8c[_0x1e1020];return _0x464719;};'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 fs_extra=require('fs-extra');var auth=require(_0xc9b8('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xc9b8('0x6'));var controller=require('./intServicenowAccount.controller');router[_0xc9b8('0x7')]('/',auth[_0xc9b8('0x8')](),controller['index']);router[_0xc9b8('0x7')](_0xc9b8('0x9'),auth['isAuthenticated'](),controller[_0xc9b8('0xa')]);router[_0xc9b8('0x7')](_0xc9b8('0xb'),auth['isAuthenticated'](),controller[_0xc9b8('0xc')]);router[_0xc9b8('0x7')](_0xc9b8('0xd'),auth[_0xc9b8('0x8')](),controller[_0xc9b8('0xe')]);router[_0xc9b8('0xf')]('/',auth[_0xc9b8('0x8')](),controller[_0xc9b8('0x10')]);router[_0xc9b8('0xf')](_0xc9b8('0xb'),auth[_0xc9b8('0x8')](),controller[_0xc9b8('0x11')]);router[_0xc9b8('0x12')](_0xc9b8('0x9'),auth['isAuthenticated'](),controller[_0xc9b8('0x13')]);router[_0xc9b8('0x14')](_0xc9b8('0x9'),auth[_0xc9b8('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x5ab4=['getConfigurations','/:id/fields','getFields','create','post','addConfiguration','put','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','index','/:id','isAuthenticated','show','/:id/configurations'];(function(_0x5f4b88,_0x531217){var _0xe41785=function(_0x55dea5){while(--_0x55dea5){_0x5f4b88['push'](_0x5f4b88['shift']());}};_0xe41785(++_0x531217);}(_0x5ab4,0x9f));var _0x45ab=function(_0x4b882f,_0x232627){_0x4b882f=_0x4b882f-0x0;var _0x457ebf=_0x5ab4[_0x4b882f];return _0x457ebf;};'use strict';var multer=require(_0x45ab('0x0'));var util=require(_0x45ab('0x1'));var path=require(_0x45ab('0x2'));var timeout=require(_0x45ab('0x3'));var express=require(_0x45ab('0x4'));var router=express['Router']();var fs_extra=require(_0x45ab('0x5'));var auth=require(_0x45ab('0x6'));var interaction=require(_0x45ab('0x7'));var config=require(_0x45ab('0x8'));var controller=require(_0x45ab('0x9'));router[_0x45ab('0xa')]('/',auth['isAuthenticated'](),controller[_0x45ab('0xb')]);router[_0x45ab('0xa')](_0x45ab('0xc'),auth[_0x45ab('0xd')](),controller[_0x45ab('0xe')]);router[_0x45ab('0xa')](_0x45ab('0xf'),auth[_0x45ab('0xd')](),controller[_0x45ab('0x10')]);router[_0x45ab('0xa')](_0x45ab('0x11'),auth[_0x45ab('0xd')](),controller[_0x45ab('0x12')]);router['post']('/',auth[_0x45ab('0xd')](),controller[_0x45ab('0x13')]);router[_0x45ab('0x14')](_0x45ab('0xf'),auth[_0x45ab('0xd')](),controller[_0x45ab('0x15')]);router[_0x45ab('0x16')](_0x45ab('0xc'),auth[_0x45ab('0xd')](),controller['update']);router['delete'](_0x45ab('0xc'),auth[_0x45ab('0xd')](),controller[_0x45ab('0x17')]);module[_0x45ab('0x18')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index 209edf6..dcd810a 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 _0x9c90=['exports','STRING','username','remoteUri'];(function(_0x27423e,_0x48be87){var _0xfd4e2b=function(_0x219670){while(--_0x219670){_0x27423e['push'](_0x27423e['shift']());}};_0xfd4e2b(++_0x48be87);}(_0x9c90,0x1d0));var _0x09c9=function(_0x4ad0f7,_0x1920b0){_0x4ad0f7=_0x4ad0f7-0x0;var _0x30f5c8=_0x9c90[_0x4ad0f7];return _0x30f5c8;};'use strict';var Sequelize=require('sequelize');module[_0x09c9('0x0')]={'name':{'type':Sequelize[_0x09c9('0x1')]},'description':{'type':Sequelize[_0x09c9('0x1')]},'username':{'type':Sequelize[_0x09c9('0x1')],'unique':_0x09c9('0x2')},'password':{'type':Sequelize[_0x09c9('0x1')]},'email':{'type':Sequelize[_0x09c9('0x1')]},'remoteUri':{'type':Sequelize[_0x09c9('0x1')],'unique':_0x09c9('0x3')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x5153=['exports','STRING','username','remoteUri','sequelize'];(function(_0x33b40c,_0x38e315){var _0x3fd36f=function(_0x10f41c){while(--_0x10f41c){_0x33b40c['push'](_0x33b40c['shift']());}};_0x3fd36f(++_0x38e315);}(_0x5153,0x13a));var _0x3515=function(_0x5c7620,_0x3a6b04){_0x5c7620=_0x5c7620-0x0;var _0x8dd881=_0x5153[_0x5c7620];return _0x8dd881;};'use strict';var Sequelize=require(_0x3515('0x0'));module[_0x3515('0x1')]={'name':{'type':Sequelize[_0x3515('0x2')]},'description':{'type':Sequelize[_0x3515('0x2')]},'username':{'type':Sequelize[_0x3515('0x2')],'unique':_0x3515('0x3')},'password':{'type':Sequelize[_0x3515('0x2')]},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x3515('0x2')],'unique':_0x3515('0x4')},'serverUrl':{'type':Sequelize[_0x3515('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index 2591fcb..101fb6c 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 _0x8400=['include','rows','catch','show','params','keys','find','create','body','getConfigurations','findOne','ServicenowConfiguration','order','pick','addConfiguration','AccountId','Subjects','Descriptions','getDescriptions','channel','ServicenowField','getFields','made_sla','knowledge','subcategory','close_code','incident_state','severity','category','parent','caused_by','watch_list','upon_reject','sys_updated_on','child_incidents','approval_history','number','resolved_by','sys_updated_by','sys_created_on','sys_domain','sys_created_by','calendar_stc','closed_at','delivery_plan','impact','active','business_service','sys_domain_path','time_worked','business_duration','group_list','work_end','reopened_time','resolved_at','caller_id','short_description','correlation_display','work_start','assignment_group','business_stc','additional_assignee_list','description','calendar_duration','notify','sys_class_name','close_notes','closed_by','follow_up','sys_id','contact_type','problem_id','reassignment_count','activity_due','assigned_to','comments','sla_due','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','escalation','upon_approval','location','username','email','remoteUri','slice','substring','lastIndexOf','format','%s/api/now/table/','password','incident?sysparm_display_value=all','result','log','assign','remove','includes','forEach','internalType','label','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','push','all','concat','ServiceNow\x20error:\x20','test','statusCode','Wrong\x20credentials','boolean','true','false','GET','sys_choice?sysparm_query=name=incident^element=','inactive','value','eml-format','fast-json-patch','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../components/integrations/configuration','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','end','error','stack','name','send','index','map','ServicenowAccount','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','options'];(function(_0x1fb6e2,_0x3a22ce){var _0x354690=function(_0x51f968){while(--_0x51f968){_0x1fb6e2['push'](_0x1fb6e2['shift']());}};_0x354690(++_0x3a22ce);}(_0x8400,0x78));var _0x0840=function(_0x3192d7,_0x2bffac){_0x3192d7=_0x3192d7-0x0;var _0x378843=_0x8400[_0x3192d7];return _0x378843;};'use strict';var emlformat=require(_0x0840('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x0840('0x1'));var rp=require('request-promise');var moment=require(_0x0840('0x2'));var BPromise=require(_0x0840('0x3'));var Mustache=require('mustache');var util=require(_0x0840('0x4'));var path=require(_0x0840('0x5'));var sox=require(_0x0840('0x6'));var csv=require(_0x0840('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0840('0x8'));var _=require(_0x0840('0x9'));var squel=require('squel');var crypto=require(_0x0840('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x0840('0xb'));var toCsv=require(_0x0840('0x7'));var querystring=require('querystring');var Papa=require(_0x0840('0xc'));var Redis=require('ioredis');var authService=require(_0x0840('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x0840('0xe'));var hardwareService=require(_0x0840('0xf'));var logger=require(_0x0840('0x10'))(_0x0840('0x11'));var utils=require(_0x0840('0x12'));var config=require(_0x0840('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0x0840('0x14'));function respondWithStatusCode(_0x3e1236,_0x1094c1){_0x1094c1=_0x1094c1||0xcc;return function(_0x367197){if(_0x367197){return _0x3e1236[_0x0840('0x15')](_0x1094c1);}return _0x3e1236[_0x0840('0x16')](_0x1094c1)['end']();};}function respondWithResult(_0x1b218c,_0x36e24c){_0x36e24c=_0x36e24c||0xc8;return function(_0x502a38){if(_0x502a38){return _0x1b218c[_0x0840('0x16')](_0x36e24c)[_0x0840('0x17')](_0x502a38);}};}function respondWithFilteredResult(_0x405a14,_0x2ce2c9){return function(_0x52af3d){if(_0x52af3d){var _0x29ef8f=typeof _0x2ce2c9['offset']===_0x0840('0x18')&&typeof _0x2ce2c9[_0x0840('0x19')]===_0x0840('0x18');var _0x128a27=_0x52af3d[_0x0840('0x1a')];var _0xf1b3e7=_0x29ef8f?0x0:_0x2ce2c9[_0x0840('0x1b')];var _0x5d0343=_0x29ef8f?_0x52af3d[_0x0840('0x1a')]:_0x2ce2c9['offset']+_0x2ce2c9['limit'];var _0x3c6ad8;if(_0x5d0343>=_0x128a27){_0x5d0343=_0x128a27;_0x3c6ad8=0xc8;}else{_0x3c6ad8=0xce;}_0x405a14[_0x0840('0x16')](_0x3c6ad8);return _0x405a14[_0x0840('0x1c')](_0x0840('0x1d'),_0xf1b3e7+'-'+_0x5d0343+'/'+_0x128a27)['json'](_0x52af3d);}return null;};}function patchUpdates(_0x3ee3e6){return function(_0x3a2128){try{jsonpatch[_0x0840('0x1e')](_0x3a2128,_0x3ee3e6,!![]);}catch(_0x1b3c7d){return BPromise['reject'](_0x1b3c7d);}return _0x3a2128[_0x0840('0x1f')]();};}function saveUpdates(_0x12ecf3,_0x16f165){return function(_0x538a17){if(_0x538a17){return _0x538a17[_0x0840('0x20')](_0x12ecf3)[_0x0840('0x21')](function(_0x1ef262){return _0x1ef262;});}return null;};}function removeEntity(_0x2f4a28,_0x4d4e75){return function(_0x40d365){if(_0x40d365){return _0x40d365[_0x0840('0x22')]()[_0x0840('0x21')](function(){_0x2f4a28[_0x0840('0x16')](0xcc)[_0x0840('0x23')]();});}};}function handleEntityNotFound(_0x5e1ce3,_0x37817a){return function(_0x123701){if(!_0x123701){_0x5e1ce3[_0x0840('0x15')](0x194);}return _0x123701;};}function handleError(_0x565285,_0x236745){_0x236745=_0x236745||0x1f4;return function(_0x2acf01){logger[_0x0840('0x24')](_0x2acf01[_0x0840('0x25')]);if(_0x2acf01[_0x0840('0x26')]){delete _0x2acf01[_0x0840('0x26')];}_0x565285[_0x0840('0x16')](_0x236745)[_0x0840('0x27')](_0x2acf01);};}exports[_0x0840('0x28')]=function(_0x8d389b,_0x353795){var _0x12771b={},_0x41a34c={},_0x58f66a={'count':0x0,'rows':[]};var _0xd4e8ab=_[_0x0840('0x29')](db[_0x0840('0x2a')][_0x0840('0x2b')],function(_0x1264aa){return{'name':_0x1264aa[_0x0840('0x2c')],'type':_0x1264aa[_0x0840('0x2d')]['key']};});_0x41a34c[_0x0840('0x2e')]=_['map'](_0xd4e8ab,_0x0840('0x26'));_0x41a34c['query']=_['keys'](_0x8d389b[_0x0840('0x2f')]);_0x41a34c[_0x0840('0x30')]=_[_0x0840('0x31')](_0x41a34c[_0x0840('0x2e')],_0x41a34c['query']);_0x12771b[_0x0840('0x32')]=_['intersection'](_0x41a34c[_0x0840('0x2e')],qs[_0x0840('0x33')](_0x8d389b[_0x0840('0x2f')][_0x0840('0x33')]));_0x12771b[_0x0840('0x32')]=_0x12771b['attributes'][_0x0840('0x34')]?_0x12771b[_0x0840('0x32')]:_0x41a34c[_0x0840('0x2e')];if(!_0x8d389b['query'][_0x0840('0x35')](_0x0840('0x36'))){_0x12771b['limit']=qs[_0x0840('0x19')](_0x8d389b[_0x0840('0x2f')]['limit']);_0x12771b['offset']=qs['offset'](_0x8d389b['query'][_0x0840('0x1b')]);}_0x12771b['order']=qs[_0x0840('0x37')](_0x8d389b[_0x0840('0x2f')]['sort']);_0x12771b[_0x0840('0x38')]=qs[_0x0840('0x30')](_['pick'](_0x8d389b[_0x0840('0x2f')],_0x41a34c[_0x0840('0x30')]),_0xd4e8ab);if(_0x8d389b['query'][_0x0840('0x39')]){_0x12771b[_0x0840('0x38')]=_[_0x0840('0x3a')](_0x12771b[_0x0840('0x38')],{'$or':_[_0x0840('0x29')](_0xd4e8ab,function(_0x46b7a8){if(_0x46b7a8[_0x0840('0x2d')]!=='VIRTUAL'){var _0xdc7656={};_0xdc7656[_0x46b7a8[_0x0840('0x26')]]={'$like':'%'+_0x8d389b[_0x0840('0x2f')][_0x0840('0x39')]+'%'};return _0xdc7656;}})});}_0x12771b=_[_0x0840('0x3a')]({},_0x12771b,_0x8d389b[_0x0840('0x3b')]);var _0x2dae0d={'where':_0x12771b[_0x0840('0x38')]};return db['ServicenowAccount']['count'](_0x2dae0d)[_0x0840('0x21')](function(_0x42e7fc){_0x58f66a[_0x0840('0x1a')]=_0x42e7fc;if(_0x8d389b[_0x0840('0x2f')]['includeAll']){_0x12771b[_0x0840('0x3c')]=[{'all':!![]}];}return db['ServicenowAccount']['findAll'](_0x12771b);})[_0x0840('0x21')](function(_0x4ffbdd){_0x58f66a[_0x0840('0x3d')]=_0x4ffbdd;return _0x58f66a;})['then'](respondWithFilteredResult(_0x353795,_0x12771b))[_0x0840('0x3e')](handleError(_0x353795,null));};exports[_0x0840('0x3f')]=function(_0x2889ca,_0x26fe2e){var _0x264344={'raw':![],'where':{'id':_0x2889ca[_0x0840('0x40')]['id']}},_0x273a00={};_0x273a00[_0x0840('0x2e')]=_[_0x0840('0x41')](db['ServicenowAccount'][_0x0840('0x2b')]);_0x273a00['query']=_[_0x0840('0x41')](_0x2889ca[_0x0840('0x2f')]);_0x273a00[_0x0840('0x30')]=_[_0x0840('0x31')](_0x273a00[_0x0840('0x2e')],_0x273a00[_0x0840('0x2f')]);_0x264344[_0x0840('0x32')]=_['intersection'](_0x273a00['model'],qs[_0x0840('0x33')](_0x2889ca[_0x0840('0x2f')][_0x0840('0x33')]));_0x264344[_0x0840('0x32')]=_0x264344[_0x0840('0x32')][_0x0840('0x34')]?_0x264344['attributes']:_0x273a00['model'];if(_0x2889ca[_0x0840('0x2f')]['includeAll']){_0x264344[_0x0840('0x3c')]=[{'all':!![]}];}_0x264344=_[_0x0840('0x3a')]({},_0x264344,_0x2889ca[_0x0840('0x3b')]);return db[_0x0840('0x2a')][_0x0840('0x42')](_0x264344)['then'](handleEntityNotFound(_0x26fe2e,null))[_0x0840('0x21')](respondWithResult(_0x26fe2e,null))[_0x0840('0x3e')](handleError(_0x26fe2e,null));};exports[_0x0840('0x43')]=function(_0x2d0b4b,_0x4f0171){return db[_0x0840('0x2a')][_0x0840('0x43')](_0x2d0b4b[_0x0840('0x44')],{})[_0x0840('0x21')](respondWithResult(_0x4f0171,0xc9))['catch'](handleError(_0x4f0171,null));};exports[_0x0840('0x20')]=function(_0x2d99d7,_0x498f15){if(_0x2d99d7[_0x0840('0x44')]['id']){delete _0x2d99d7[_0x0840('0x44')]['id'];}return db[_0x0840('0x2a')]['find']({'where':{'id':_0x2d99d7['params']['id']}})['then'](handleEntityNotFound(_0x498f15,null))[_0x0840('0x21')](saveUpdates(_0x2d99d7[_0x0840('0x44')],null))[_0x0840('0x21')](respondWithResult(_0x498f15,null))[_0x0840('0x3e')](handleError(_0x498f15,null));};exports['destroy']=function(_0x13e86c,_0x6dd297){return db[_0x0840('0x2a')][_0x0840('0x42')]({'where':{'id':_0x13e86c[_0x0840('0x40')]['id']}})[_0x0840('0x21')](handleEntityNotFound(_0x6dd297,null))[_0x0840('0x21')](removeEntity(_0x6dd297,null))[_0x0840('0x3e')](handleError(_0x6dd297,null));};exports[_0x0840('0x45')]=function(_0x3aa56f,_0x27c92b,_0x491234){var _0x3f37be={};var _0x1cbc29={};var _0x230152;var _0x523077;return db['ServicenowAccount'][_0x0840('0x46')]({'where':{'id':_0x3aa56f['params']['id']}})[_0x0840('0x21')](handleEntityNotFound(_0x27c92b,null))[_0x0840('0x21')](function(_0x34c13e){if(_0x34c13e){_0x230152=_0x34c13e;_0x1cbc29[_0x0840('0x2e')]=_[_0x0840('0x41')](db[_0x0840('0x47')][_0x0840('0x2b')]);_0x1cbc29[_0x0840('0x2f')]=_[_0x0840('0x41')](_0x3aa56f[_0x0840('0x2f')]);_0x1cbc29[_0x0840('0x30')]=_['intersection'](_0x1cbc29[_0x0840('0x2e')],_0x1cbc29[_0x0840('0x2f')]);_0x3f37be['attributes']=_['intersection'](_0x1cbc29[_0x0840('0x2e')],qs['fields'](_0x3aa56f['query']['fields']));_0x3f37be[_0x0840('0x32')]=_0x3f37be[_0x0840('0x32')][_0x0840('0x34')]?_0x3f37be[_0x0840('0x32')]:_0x1cbc29[_0x0840('0x2e')];_0x3f37be[_0x0840('0x48')]=qs[_0x0840('0x37')](_0x3aa56f['query'][_0x0840('0x37')]);_0x3f37be['where']=qs[_0x0840('0x30')](_[_0x0840('0x49')](_0x3aa56f[_0x0840('0x2f')],_0x1cbc29['filters']));if(_0x3aa56f['query'][_0x0840('0x39')]){_0x3f37be['where']=_[_0x0840('0x3a')](_0x3f37be['where'],{'$or':_[_0x0840('0x29')](_0x3f37be['attributes'],function(_0x271bfe){var _0x4c8b33={};_0x4c8b33[_0x271bfe]={'$like':'%'+_0x3aa56f[_0x0840('0x2f')][_0x0840('0x39')]+'%'};return _0x4c8b33;})});}_0x3f37be=_['merge']({},_0x3f37be,_0x3aa56f['options']);return _0x230152[_0x0840('0x45')](_0x3f37be);}})['then'](function(_0x3e56cb){if(_0x3e56cb){_0x523077=_0x3e56cb['length'];if(!_0x3aa56f['query']['hasOwnProperty'](_0x0840('0x36'))){_0x3f37be[_0x0840('0x19')]=qs[_0x0840('0x19')](_0x3aa56f[_0x0840('0x2f')]['limit']);_0x3f37be[_0x0840('0x1b')]=qs[_0x0840('0x1b')](_0x3aa56f[_0x0840('0x2f')][_0x0840('0x1b')]);}return _0x230152[_0x0840('0x45')](_0x3f37be);}})[_0x0840('0x21')](function(_0x5c6a0f){if(_0x5c6a0f){return _0x5c6a0f?{'count':_0x523077,'rows':_0x5c6a0f}:null;}})[_0x0840('0x21')](respondWithResult(_0x27c92b,null))[_0x0840('0x3e')](handleError(_0x27c92b,null));};exports[_0x0840('0x4a')]=function(_0x5732c0,_0x33925e,_0x51edcc){if(_0x5732c0[_0x0840('0x44')]['id']){delete _0x5732c0[_0x0840('0x44')]['id'];}return db['ServicenowAccount'][_0x0840('0x46')]({'where':{'id':_0x5732c0[_0x0840('0x40')]['id']}})[_0x0840('0x21')](handleEntityNotFound(_0x33925e,null))['then'](function(_0x56379d){if(_0x56379d){_0x5732c0['body'][_0x0840('0x4b')]=_0x56379d['id'];_0x5732c0['body'][_0x0840('0x4c')]=integrations['getSubjects'](_0x5732c0[_0x0840('0x44')]['channel'],_0x5732c0['body']['type']);_0x5732c0[_0x0840('0x44')][_0x0840('0x4d')]=integrations[_0x0840('0x4e')](_0x5732c0[_0x0840('0x44')][_0x0840('0x4f')],_0x5732c0['body'][_0x0840('0x2d')]);return db[_0x0840('0x47')][_0x0840('0x43')](_0x5732c0[_0x0840('0x44')],{'include':[{'model':db[_0x0840('0x50')],'as':'Subjects'},{'model':db[_0x0840('0x50')],'as':_0x0840('0x4d')}]});}return null;})['then'](respondWithResult(_0x33925e,null))[_0x0840('0x3e')](handleError(_0x33925e,null));};exports[_0x0840('0x51')]=function(_0x13a215,_0x26b772,_0x145d85){var _0x417e42=[_0x0840('0x52'),'hold_reason',_0x0840('0x53'),_0x0840('0x54'),_0x0840('0x55'),'notify',_0x0840('0x56'),_0x0840('0x57'),_0x0840('0x58')];var _0x44a58b=[_0x0840('0x59'),'made_sla',_0x0840('0x5a'),_0x0840('0x5b'),_0x0840('0x5c'),_0x0840('0x5d'),_0x0840('0x5e'),'hold_reason',_0x0840('0x5f'),_0x0840('0x60'),_0x0840('0x61'),_0x0840('0x62'),'opened_by','user_input',_0x0840('0x63'),_0x0840('0x64'),'state',_0x0840('0x65'),'knowledge',_0x0840('0x48'),_0x0840('0x66'),_0x0840('0x67'),'cmdb_ci',_0x0840('0x68'),_0x0840('0x69'),_0x0840('0x6a'),'work_notes_list',_0x0840('0x6b'),'priority',_0x0840('0x6c'),'rfc',_0x0840('0x6d'),'expected_start','opened_at',_0x0840('0x6e'),_0x0840('0x6f'),_0x0840('0x70'),_0x0840('0x71'),_0x0840('0x72'),_0x0840('0x73'),'approval_set','subcategory','work_notes',_0x0840('0x74'),_0x0840('0x55'),_0x0840('0x75'),'delivery_task',_0x0840('0x76'),_0x0840('0x77'),_0x0840('0x78'),_0x0840('0x79'),_0x0840('0x7a'),_0x0840('0x7b'),_0x0840('0x7c'),_0x0840('0x7d'),_0x0840('0x7e'),_0x0840('0x7f'),_0x0840('0x80'),'parent_incident',_0x0840('0x81'),_0x0840('0x82'),'reopened_by',_0x0840('0x56'),'urgency',_0x0840('0x83'),'company',_0x0840('0x84'),_0x0840('0x85'),_0x0840('0x86'),_0x0840('0x57'),_0x0840('0x87'),_0x0840('0x88'),_0x0840('0x89'),_0x0840('0x8a'),_0x0840('0x8b'),_0x0840('0x8c'),_0x0840('0x8d'),_0x0840('0x8e'),_0x0840('0x8f'),_0x0840('0x90'),'correlation_id',_0x0840('0x91'),'category'];var _0x417f79='';var _0xe12cf6='';var _0x28193f=[];var _0x10e151='';var _0x4191e9='';var _0x2b7504=[];var _0x2063a6='';var _0x2dfe16='';var _0x575a22={};var _0xf284d4='';return db['ServicenowAccount']['findOne']({'where':{'id':_0x13a215[_0x0840('0x40')]['id']},'attributes':['id',_0x0840('0x92'),'password',_0x0840('0x93'),_0x0840('0x94'),'serverUrl']})['then'](handleEntityNotFound(_0x26b772,null))[_0x0840('0x21')](function(_0x48e6ee){if(_0x48e6ee){_0xf284d4=_0x48e6ee[_0x0840('0x94')];var _0x3897e5=_0xf284d4[_0x0840('0x95')](-0x1);if(_0x3897e5==='/'){_0xf284d4=_0xf284d4[_0x0840('0x96')](0x0,_0xf284d4[_0x0840('0x97')](_0x3897e5));}_0x2dfe16=util[_0x0840('0x98')]('%s/api/now/doc/table/schema/',_0xf284d4);_0x2063a6=util[_0x0840('0x98')](_0x0840('0x99'),_0xf284d4);_0x575a22={'user':_0x48e6ee[_0x0840('0x92')],'pass':_0x48e6ee[_0x0840('0x9a')]};var _0x2fc8ab={'method':'GET','uri':_0x2dfe16+_0x0840('0x9b'),'auth':_0x575a22,'json':!![]};return rp(_0x2fc8ab);}})[_0x0840('0x21')](function(_0x3a7a2d){if(_0x3a7a2d[_0x0840('0x9c')][_0x0840('0x34')]>0x0){_0x417f79=_0x3a7a2d[_0x0840('0x9c')];}console[_0x0840('0x9d')]('incident\x20table\x20objects',_0x417f79);_0x2b7504=[];_0xe12cf6=Object[_0x0840('0x9e')]([],_0x417f79);_[_0x0840('0x9f')](_0xe12cf6,function(_0x87a550){return!_0x417e42[_0x0840('0xa0')](_0x87a550[_0x0840('0x26')]);});_0xe12cf6[_0x0840('0xa1')](function(_0x16c6b4){var _0x23cade=createFieldObject(_0x2063a6,_0x575a22,_0x16c6b4[_0x0840('0xa2')],_0x16c6b4[_0x0840('0x26')],_0x16c6b4[_0x0840('0xa3')],![]);_0x2b7504['push'](_0x23cade);});return Promise['all'](_0x2b7504);})[_0x0840('0x21')](function(_0x501ee6){_0x28193f=_0x501ee6;_0x10e151=Object[_0x0840('0x9e')]([],_0x417f79);console[_0x0840('0x9d')](_0x0840('0xa4'),_0x417f79);_[_0x0840('0x9f')](_0x10e151,function(_0x823a59){return _0x44a58b[_0x0840('0xa0')](_0x823a59[_0x0840('0x26')]);});console[_0x0840('0x9d')](_0x0840('0xa5'),_0x10e151);_0x2b7504=[];_0x10e151[_0x0840('0xa1')](function(_0x349373){var _0x1f566a=createFieldObject(_0x2063a6,_0x575a22,_0x349373[_0x0840('0xa2')],_0x349373[_0x0840('0x26')],_0x349373['label'],!![]);_0x2b7504[_0x0840('0xa6')](_0x1f566a);});return Promise[_0x0840('0xa7')](_0x2b7504);})[_0x0840('0x21')](function(_0xba1643){_0x4191e9=_0xba1643;var _0xbac592=_0x28193f[_0x0840('0xa8')](_0x4191e9);return{'count':_0xbac592[_0x0840('0x34')],'rows':_0xbac592};})[_0x0840('0x21')](respondWithResult(_0x26b772,null))[_0x0840('0x3e')](function(_0x4dae73){console[_0x0840('0x9d')](_0x0840('0xa9')+_0x4dae73);var _0x377cb3=_0x13a215[_0x0840('0x2f')][_0x0840('0xaa')]?0x1f4:_0x4dae73[_0x0840('0xab')]||0x1f4;logger[_0x0840('0x24')](_0x4dae73[_0x0840('0x25')]);delete _0x4dae73[_0x0840('0x26')];if(_0x377cb3===0x191){_0x377cb3=0x190;}_0x26b772[_0x0840('0x16')](_0x377cb3)[_0x0840('0x27')](_0x13a215['query'][_0x0840('0xaa')]?{'message':_0x0840('0xac'),'statusCode':_0x4dae73['statusCode']}:_0x4dae73);});};function createFieldObject(_0x4b1ba5,_0x334d87,_0x102112,_0x18de2f,_0x5de68c,_0x302429){return new Promise(function(_0x346933,_0xd521b8){var _0x1b5c0d={'id':_0x18de2f,'name':_0x5de68c,'custom':_0x302429};if(_0x102112===_0x0840('0xad')){_0x1b5c0d[_0x0840('0x3b')]=[{'name':'True','value':_0x0840('0xae')},{'name':'False','value':_0x0840('0xaf')}];_0x346933(_0x1b5c0d);}else{var _0x59c06e={'method':_0x0840('0xb0'),'uri':_0x4b1ba5+_0x0840('0xb1')+_0x18de2f,'auth':_0x334d87,'json':!![]};return rp(_0x59c06e)[_0x0840('0x21')](function(_0x1431e2){var _0x784498=[];if(_0x1431e2[_0x0840('0x9c')]['length']>0x0){_0x1431e2['result'][_0x0840('0xa1')](function(_0x109e59){if(_0x109e59[_0x0840('0xb2')]==='false'){var _0x17dd14={'name':_0x109e59[_0x0840('0xa3')],'value':_0x109e59[_0x0840('0xb3')]};_0x784498[_0x0840('0xa6')](_0x17dd14);}});}_0x1b5c0d[_0x0840('0x3b')]=_0x784498;if(_0x1b5c0d[_0x0840('0x3b')][_0x0840('0x34')]>0x0){_0x346933(_0x1b5c0d);}else{if(_0x302429==![]){_0x346933();}else{_0x346933(_0x1b5c0d);}}});}});} \ No newline at end of file +var _0x287b=['knowledge','subcategory','close_code','notify','severity','category','parent','made_sla','caused_by','watch_list','upon_reject','sys_updated_on','child_incidents','approval_history','number','sys_updated_by','user_input','sys_created_on','state','calendar_stc','closed_at','cmdb_ci','delivery_plan','impact','active','work_notes_list','business_service','priority','sys_domain_path','rfc','time_worked','expected_start','opened_at','business_duration','group_list','reopened_time','caller_id','approval_set','short_description','correlation_display','delivery_task','assignment_group','additional_assignee_list','calendar_duration','sys_class_name','close_notes','closed_by','follow_up','sys_id','contact_type','incident_state','urgency','problem_id','company','reassignment_count','activity_due','assigned_to','comments','sla_due','approval','comments_and_work_notes','reopen_count','sys_tags','escalation','upon_approval','correlation_id','location','username','password','serverUrl','remoteUri','substring','lastIndexOf','%s/api/now/doc/table/schema/','format','%s/api/now/table/','GET','incident?sysparm_display_value=all','result','incident\x20table\x20objects','remove','includes','internalType','label','push','all','assign','TCL:\x20_object','log','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','forEach','concat','ServiceNow\x20error:\x20','test','Wrong\x20credentials','statusCode','boolean','True','true','False','false','inactive','value','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','sendStatus','error','stack','name','send','index','ServicenowAccount','rawAttributes','type','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','pick','merge','where','filter','include','findAll','rows','show','keys','includeAll','options','find','catch','create','body','params','destroy','getConfigurations','findOne','order','sort','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ServicenowConfiguration','ServicenowField','getFields','hold_reason'];(function(_0x1f36bb,_0x8af718){var _0xaf97fa=function(_0xeca489){while(--_0xeca489){_0x1f36bb['push'](_0x1f36bb['shift']());}};_0xaf97fa(++_0x8af718);}(_0x287b,0x67));var _0xb287=function(_0x39ff5c,_0x3de001){_0x39ff5c=_0x39ff5c-0x0;var _0x1eba54=_0x287b[_0x39ff5c];return _0x1eba54;};'use strict';var emlformat=require(_0xb287('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb287('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb287('0x2'));var moment=require(_0xb287('0x3'));var BPromise=require(_0xb287('0x4'));var Mustache=require(_0xb287('0x5'));var util=require(_0xb287('0x6'));var path=require(_0xb287('0x7'));var sox=require('sox');var csv=require(_0xb287('0x8'));var ejs=require(_0xb287('0x9'));var fs=require('fs');var fs_extra=require(_0xb287('0xa'));var _=require(_0xb287('0xb'));var squel=require('squel');var crypto=require(_0xb287('0xc'));var jsforce=require(_0xb287('0xd'));var deskjs=require(_0xb287('0xe'));var toCsv=require(_0xb287('0x8'));var querystring=require(_0xb287('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xb287('0x10'));var qs=require(_0xb287('0x11'));var as=require(_0xb287('0x12'));var hardwareService=require(_0xb287('0x13'));var logger=require(_0xb287('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xb287('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xb287('0x16'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x1f49eb,_0x41c9f3){_0x41c9f3=_0x41c9f3||0xcc;return function(_0x537f6b){if(_0x537f6b){return _0x1f49eb['sendStatus'](_0x41c9f3);}return _0x1f49eb[_0xb287('0x17')](_0x41c9f3)[_0xb287('0x18')]();};}function respondWithResult(_0x4c1feb,_0x562b50){_0x562b50=_0x562b50||0xc8;return function(_0x58e499){if(_0x58e499){return _0x4c1feb[_0xb287('0x17')](_0x562b50)[_0xb287('0x19')](_0x58e499);}};}function respondWithFilteredResult(_0x37e621,_0x369d6c){return function(_0x361f89){if(_0x361f89){var _0x35124d=typeof _0x369d6c[_0xb287('0x1a')]===_0xb287('0x1b')&&typeof _0x369d6c['limit']===_0xb287('0x1b');var _0x5516fb=_0x361f89[_0xb287('0x1c')];var _0xe18708=_0x35124d?0x0:_0x369d6c[_0xb287('0x1a')];var _0x21a856=_0x35124d?_0x361f89['count']:_0x369d6c['offset']+_0x369d6c[_0xb287('0x1d')];var _0x5da7b7;if(_0x21a856>=_0x5516fb){_0x21a856=_0x5516fb;_0x5da7b7=0xc8;}else{_0x5da7b7=0xce;}_0x37e621['status'](_0x5da7b7);return _0x37e621[_0xb287('0x1e')](_0xb287('0x1f'),_0xe18708+'-'+_0x21a856+'/'+_0x5516fb)[_0xb287('0x19')](_0x361f89);}return null;};}function patchUpdates(_0x353c71){return function(_0x30f3fd){try{jsonpatch[_0xb287('0x20')](_0x30f3fd,_0x353c71,!![]);}catch(_0x355967){return BPromise[_0xb287('0x21')](_0x355967);}return _0x30f3fd[_0xb287('0x22')]();};}function saveUpdates(_0x309923,_0x534a84){return function(_0x31ff70){if(_0x31ff70){return _0x31ff70['update'](_0x309923)[_0xb287('0x23')](function(_0x391a88){return _0x391a88;});}return null;};}function removeEntity(_0x5becaf,_0x14825e){return function(_0x2a2f50){if(_0x2a2f50){return _0x2a2f50['destroy']()[_0xb287('0x23')](function(){_0x5becaf['status'](0xcc)[_0xb287('0x18')]();});}};}function handleEntityNotFound(_0x1a2d1a,_0x542343){return function(_0x3c6cdc){if(!_0x3c6cdc){_0x1a2d1a[_0xb287('0x24')](0x194);}return _0x3c6cdc;};}function handleError(_0x35a4c5,_0x506061){_0x506061=_0x506061||0x1f4;return function(_0x40f70b){logger[_0xb287('0x25')](_0x40f70b[_0xb287('0x26')]);if(_0x40f70b['name']){delete _0x40f70b[_0xb287('0x27')];}_0x35a4c5[_0xb287('0x17')](_0x506061)[_0xb287('0x28')](_0x40f70b);};}exports[_0xb287('0x29')]=function(_0x265c26,_0xb5522d){var _0x1f3319={},_0x31ee85={},_0x288720={'count':0x0,'rows':[]};var _0x36cd03=_['map'](db[_0xb287('0x2a')][_0xb287('0x2b')],function(_0xfab991){return{'name':_0xfab991['fieldName'],'type':_0xfab991[_0xb287('0x2c')]['key']};});_0x31ee85[_0xb287('0x2d')]=_[_0xb287('0x2e')](_0x36cd03,'name');_0x31ee85[_0xb287('0x2f')]=_['keys'](_0x265c26[_0xb287('0x2f')]);_0x31ee85[_0xb287('0x30')]=_[_0xb287('0x31')](_0x31ee85['model'],_0x31ee85[_0xb287('0x2f')]);_0x1f3319[_0xb287('0x32')]=_[_0xb287('0x31')](_0x31ee85['model'],qs[_0xb287('0x33')](_0x265c26[_0xb287('0x2f')][_0xb287('0x33')]));_0x1f3319['attributes']=_0x1f3319[_0xb287('0x32')][_0xb287('0x34')]?_0x1f3319['attributes']:_0x31ee85[_0xb287('0x2d')];if(!_0x265c26['query'][_0xb287('0x35')](_0xb287('0x36'))){_0x1f3319[_0xb287('0x1d')]=qs[_0xb287('0x1d')](_0x265c26['query'][_0xb287('0x1d')]);_0x1f3319['offset']=qs[_0xb287('0x1a')](_0x265c26[_0xb287('0x2f')][_0xb287('0x1a')]);}_0x1f3319['order']=qs['sort'](_0x265c26[_0xb287('0x2f')]['sort']);_0x1f3319['where']=qs[_0xb287('0x30')](_[_0xb287('0x37')](_0x265c26['query'],_0x31ee85['filters']),_0x36cd03);if(_0x265c26[_0xb287('0x2f')]['filter']){_0x1f3319['where']=_[_0xb287('0x38')](_0x1f3319[_0xb287('0x39')],{'$or':_['map'](_0x36cd03,function(_0x22f605){if(_0x22f605[_0xb287('0x2c')]!=='VIRTUAL'){var _0x450303={};_0x450303[_0x22f605['name']]={'$like':'%'+_0x265c26[_0xb287('0x2f')][_0xb287('0x3a')]+'%'};return _0x450303;}})});}_0x1f3319=_[_0xb287('0x38')]({},_0x1f3319,_0x265c26['options']);var _0x182847={'where':_0x1f3319[_0xb287('0x39')]};return db[_0xb287('0x2a')][_0xb287('0x1c')](_0x182847)[_0xb287('0x23')](function(_0x2bf292){_0x288720[_0xb287('0x1c')]=_0x2bf292;if(_0x265c26[_0xb287('0x2f')]['includeAll']){_0x1f3319[_0xb287('0x3b')]=[{'all':!![]}];}return db[_0xb287('0x2a')][_0xb287('0x3c')](_0x1f3319);})['then'](function(_0x391731){_0x288720[_0xb287('0x3d')]=_0x391731;return _0x288720;})[_0xb287('0x23')](respondWithFilteredResult(_0xb5522d,_0x1f3319))['catch'](handleError(_0xb5522d,null));};exports[_0xb287('0x3e')]=function(_0x42a74b,_0x1b837e){var _0x273f39={'raw':![],'where':{'id':_0x42a74b['params']['id']}},_0x3af7e6={};_0x3af7e6['model']=_[_0xb287('0x3f')](db[_0xb287('0x2a')]['rawAttributes']);_0x3af7e6[_0xb287('0x2f')]=_[_0xb287('0x3f')](_0x42a74b[_0xb287('0x2f')]);_0x3af7e6['filters']=_[_0xb287('0x31')](_0x3af7e6[_0xb287('0x2d')],_0x3af7e6['query']);_0x273f39['attributes']=_[_0xb287('0x31')](_0x3af7e6[_0xb287('0x2d')],qs['fields'](_0x42a74b['query']['fields']));_0x273f39[_0xb287('0x32')]=_0x273f39['attributes'][_0xb287('0x34')]?_0x273f39['attributes']:_0x3af7e6[_0xb287('0x2d')];if(_0x42a74b['query'][_0xb287('0x40')]){_0x273f39[_0xb287('0x3b')]=[{'all':!![]}];}_0x273f39=_['merge']({},_0x273f39,_0x42a74b[_0xb287('0x41')]);return db[_0xb287('0x2a')][_0xb287('0x42')](_0x273f39)['then'](handleEntityNotFound(_0x1b837e,null))[_0xb287('0x23')](respondWithResult(_0x1b837e,null))[_0xb287('0x43')](handleError(_0x1b837e,null));};exports[_0xb287('0x44')]=function(_0x3235ad,_0x54b6de){return db[_0xb287('0x2a')][_0xb287('0x44')](_0x3235ad[_0xb287('0x45')],{})['then'](respondWithResult(_0x54b6de,0xc9))[_0xb287('0x43')](handleError(_0x54b6de,null));};exports['update']=function(_0x5e6014,_0xb1171c){if(_0x5e6014[_0xb287('0x45')]['id']){delete _0x5e6014[_0xb287('0x45')]['id'];}return db[_0xb287('0x2a')][_0xb287('0x42')]({'where':{'id':_0x5e6014[_0xb287('0x46')]['id']}})[_0xb287('0x23')](handleEntityNotFound(_0xb1171c,null))[_0xb287('0x23')](saveUpdates(_0x5e6014[_0xb287('0x45')],null))[_0xb287('0x23')](respondWithResult(_0xb1171c,null))[_0xb287('0x43')](handleError(_0xb1171c,null));};exports[_0xb287('0x47')]=function(_0x1592e2,_0x5cab98){return db['ServicenowAccount']['find']({'where':{'id':_0x1592e2[_0xb287('0x46')]['id']}})[_0xb287('0x23')](handleEntityNotFound(_0x5cab98,null))[_0xb287('0x23')](removeEntity(_0x5cab98,null))[_0xb287('0x43')](handleError(_0x5cab98,null));};exports[_0xb287('0x48')]=function(_0x5a772b,_0x2366fd,_0x787b40){var _0x2549d4={};var _0x23d862={};var _0x177881;var _0x1ee507;return db[_0xb287('0x2a')][_0xb287('0x49')]({'where':{'id':_0x5a772b['params']['id']}})[_0xb287('0x23')](handleEntityNotFound(_0x2366fd,null))[_0xb287('0x23')](function(_0x1bf1f1){if(_0x1bf1f1){_0x177881=_0x1bf1f1;_0x23d862[_0xb287('0x2d')]=_['keys'](db['ServicenowConfiguration'][_0xb287('0x2b')]);_0x23d862[_0xb287('0x2f')]=_[_0xb287('0x3f')](_0x5a772b[_0xb287('0x2f')]);_0x23d862['filters']=_['intersection'](_0x23d862[_0xb287('0x2d')],_0x23d862[_0xb287('0x2f')]);_0x2549d4[_0xb287('0x32')]=_[_0xb287('0x31')](_0x23d862[_0xb287('0x2d')],qs[_0xb287('0x33')](_0x5a772b[_0xb287('0x2f')][_0xb287('0x33')]));_0x2549d4[_0xb287('0x32')]=_0x2549d4[_0xb287('0x32')][_0xb287('0x34')]?_0x2549d4[_0xb287('0x32')]:_0x23d862[_0xb287('0x2d')];_0x2549d4[_0xb287('0x4a')]=qs[_0xb287('0x4b')](_0x5a772b[_0xb287('0x2f')][_0xb287('0x4b')]);_0x2549d4['where']=qs[_0xb287('0x30')](_[_0xb287('0x37')](_0x5a772b[_0xb287('0x2f')],_0x23d862[_0xb287('0x30')]));if(_0x5a772b[_0xb287('0x2f')]['filter']){_0x2549d4[_0xb287('0x39')]=_[_0xb287('0x38')](_0x2549d4[_0xb287('0x39')],{'$or':_[_0xb287('0x2e')](_0x2549d4[_0xb287('0x32')],function(_0x31e65f){var _0x49a589={};_0x49a589[_0x31e65f]={'$like':'%'+_0x5a772b[_0xb287('0x2f')][_0xb287('0x3a')]+'%'};return _0x49a589;})});}_0x2549d4=_[_0xb287('0x38')]({},_0x2549d4,_0x5a772b[_0xb287('0x41')]);return _0x177881['getConfigurations'](_0x2549d4);}})['then'](function(_0x559f81){if(_0x559f81){_0x1ee507=_0x559f81[_0xb287('0x34')];if(!_0x5a772b[_0xb287('0x2f')]['hasOwnProperty'](_0xb287('0x36'))){_0x2549d4[_0xb287('0x1d')]=qs[_0xb287('0x1d')](_0x5a772b[_0xb287('0x2f')]['limit']);_0x2549d4[_0xb287('0x1a')]=qs[_0xb287('0x1a')](_0x5a772b['query'][_0xb287('0x1a')]);}return _0x177881[_0xb287('0x48')](_0x2549d4);}})[_0xb287('0x23')](function(_0x2301c7){if(_0x2301c7){return _0x2301c7?{'count':_0x1ee507,'rows':_0x2301c7}:null;}})['then'](respondWithResult(_0x2366fd,null))['catch'](handleError(_0x2366fd,null));};exports[_0xb287('0x4c')]=function(_0x4d67c6,_0x53f29c,_0x889f6e){if(_0x4d67c6['body']['id']){delete _0x4d67c6[_0xb287('0x45')]['id'];}return db[_0xb287('0x2a')]['findOne']({'where':{'id':_0x4d67c6[_0xb287('0x46')]['id']}})[_0xb287('0x23')](handleEntityNotFound(_0x53f29c,null))['then'](function(_0x4d7b43){if(_0x4d7b43){_0x4d67c6['body'][_0xb287('0x4d')]=_0x4d7b43['id'];_0x4d67c6['body'][_0xb287('0x4e')]=integrations[_0xb287('0x4f')](_0x4d67c6[_0xb287('0x45')][_0xb287('0x50')],_0x4d67c6[_0xb287('0x45')][_0xb287('0x2c')]);_0x4d67c6['body'][_0xb287('0x51')]=integrations[_0xb287('0x52')](_0x4d67c6['body'][_0xb287('0x50')],_0x4d67c6[_0xb287('0x45')][_0xb287('0x2c')]);return db[_0xb287('0x53')][_0xb287('0x44')](_0x4d67c6[_0xb287('0x45')],{'include':[{'model':db[_0xb287('0x54')],'as':_0xb287('0x4e')},{'model':db[_0xb287('0x54')],'as':_0xb287('0x51')}]});}return null;})[_0xb287('0x23')](respondWithResult(_0x53f29c,null))[_0xb287('0x43')](handleError(_0x53f29c,null));};exports[_0xb287('0x55')]=function(_0x4f95b8,_0x1fee4c,_0x3748dd){var _0xc80ea4=['made_sla',_0xb287('0x56'),_0xb287('0x57'),_0xb287('0x58'),_0xb287('0x59'),_0xb287('0x5a'),'incident_state',_0xb287('0x5b'),_0xb287('0x5c')];var _0x4f9c40=[_0xb287('0x5d'),_0xb287('0x5e'),_0xb287('0x5f'),_0xb287('0x60'),_0xb287('0x61'),_0xb287('0x62'),_0xb287('0x63'),_0xb287('0x56'),_0xb287('0x64'),_0xb287('0x65'),'resolved_by',_0xb287('0x66'),'opened_by',_0xb287('0x67'),_0xb287('0x68'),'sys_domain',_0xb287('0x69'),'sys_created_by',_0xb287('0x57'),_0xb287('0x4a'),_0xb287('0x6a'),_0xb287('0x6b'),_0xb287('0x6c'),_0xb287('0x6d'),_0xb287('0x6e'),_0xb287('0x6f'),_0xb287('0x70'),_0xb287('0x71'),_0xb287('0x72'),_0xb287('0x73'),_0xb287('0x74'),_0xb287('0x75'),_0xb287('0x76'),_0xb287('0x77'),_0xb287('0x78'),_0xb287('0x79'),'work_end',_0xb287('0x7a'),'resolved_at',_0xb287('0x7b'),_0xb287('0x7c'),_0xb287('0x58'),'work_notes',_0xb287('0x7d'),_0xb287('0x59'),_0xb287('0x7e'),_0xb287('0x7f'),'work_start',_0xb287('0x80'),'business_stc',_0xb287('0x81'),'description',_0xb287('0x82'),_0xb287('0x5a'),_0xb287('0x83'),_0xb287('0x84'),_0xb287('0x85'),_0xb287('0x86'),'parent_incident',_0xb287('0x87'),_0xb287('0x88'),'reopened_by',_0xb287('0x89'),_0xb287('0x8a'),_0xb287('0x8b'),_0xb287('0x8c'),_0xb287('0x8d'),_0xb287('0x8e'),_0xb287('0x8f'),'severity',_0xb287('0x90'),_0xb287('0x91'),_0xb287('0x92'),_0xb287('0x93'),'due_date','sys_mod_count',_0xb287('0x94'),_0xb287('0x95'),_0xb287('0x96'),_0xb287('0x97'),_0xb287('0x98'),_0xb287('0x99'),_0xb287('0x5c')];var _0x515c6e='';var _0x3cca3b='';var _0x46c241=[];var _0x3dbb9b='';var _0x81fbe8='';var _0x289aa3=[];var _0x596e80='';var _0x5e4639='';var _0x4bc37b={};var _0x504ae6='';return db['ServicenowAccount'][_0xb287('0x49')]({'where':{'id':_0x4f95b8[_0xb287('0x46')]['id']},'attributes':['id',_0xb287('0x9a'),_0xb287('0x9b'),'email','remoteUri',_0xb287('0x9c')]})[_0xb287('0x23')](handleEntityNotFound(_0x1fee4c,null))['then'](function(_0x13ffaa){if(_0x13ffaa){_0x504ae6=_0x13ffaa[_0xb287('0x9d')];var _0x37b682=_0x504ae6['slice'](-0x1);if(_0x37b682==='/'){_0x504ae6=_0x504ae6[_0xb287('0x9e')](0x0,_0x504ae6[_0xb287('0x9f')](_0x37b682));}_0x5e4639=util['format'](_0xb287('0xa0'),_0x504ae6);_0x596e80=util[_0xb287('0xa1')](_0xb287('0xa2'),_0x504ae6);_0x4bc37b={'user':_0x13ffaa[_0xb287('0x9a')],'pass':_0x13ffaa[_0xb287('0x9b')]};var _0x4792e2={'method':_0xb287('0xa3'),'uri':_0x5e4639+_0xb287('0xa4'),'auth':_0x4bc37b,'json':!![]};return rp(_0x4792e2);}})[_0xb287('0x23')](function(_0xc90c38){if(_0xc90c38[_0xb287('0xa5')][_0xb287('0x34')]>0x0){_0x515c6e=_0xc90c38['result'];}console['log'](_0xb287('0xa6'),_0x515c6e);_0x289aa3=[];_0x3cca3b=Object['assign']([],_0x515c6e);_[_0xb287('0xa7')](_0x3cca3b,function(_0x5b461b){return!_0xc80ea4[_0xb287('0xa8')](_0x5b461b[_0xb287('0x27')]);});_0x3cca3b['forEach'](function(_0xcd8166){var _0x4d1075=createFieldObject(_0x596e80,_0x4bc37b,_0xcd8166[_0xb287('0xa9')],_0xcd8166[_0xb287('0x27')],_0xcd8166[_0xb287('0xaa')],![]);_0x289aa3[_0xb287('0xab')](_0x4d1075);});return Promise[_0xb287('0xac')](_0x289aa3);})['then'](function(_0x53d2ff){_0x46c241=_0x53d2ff;_0x3dbb9b=Object[_0xb287('0xad')]([],_0x515c6e);console['log'](_0xb287('0xae'),_0x515c6e);_[_0xb287('0xa7')](_0x3dbb9b,function(_0xe3c463){return _0x4f9c40[_0xb287('0xa8')](_0xe3c463[_0xb287('0x27')]);});console[_0xb287('0xaf')](_0xb287('0xb0'),_0x3dbb9b);_0x289aa3=[];_0x3dbb9b[_0xb287('0xb1')](function(_0x5edbb3){var _0x4214b6=createFieldObject(_0x596e80,_0x4bc37b,_0x5edbb3[_0xb287('0xa9')],_0x5edbb3[_0xb287('0x27')],_0x5edbb3['label'],!![]);_0x289aa3['push'](_0x4214b6);});return Promise[_0xb287('0xac')](_0x289aa3);})[_0xb287('0x23')](function(_0x11a820){_0x81fbe8=_0x11a820;var _0x411b8d=_0x46c241[_0xb287('0xb2')](_0x81fbe8);return{'count':_0x411b8d[_0xb287('0x34')],'rows':_0x411b8d};})[_0xb287('0x23')](respondWithResult(_0x1fee4c,null))['catch'](function(_0x2ecb5c){console[_0xb287('0xaf')](_0xb287('0xb3')+_0x2ecb5c);var _0x2a76ab=_0x4f95b8[_0xb287('0x2f')][_0xb287('0xb4')]?0x1f4:_0x2ecb5c['statusCode']||0x1f4;logger[_0xb287('0x25')](_0x2ecb5c[_0xb287('0x26')]);delete _0x2ecb5c[_0xb287('0x27')];if(_0x2a76ab===0x191){_0x2a76ab=0x190;}_0x1fee4c[_0xb287('0x17')](_0x2a76ab)[_0xb287('0x28')](_0x4f95b8[_0xb287('0x2f')]['test']?{'message':_0xb287('0xb5'),'statusCode':_0x2ecb5c[_0xb287('0xb6')]}:_0x2ecb5c);});};function createFieldObject(_0x2df9f5,_0x4b8cf7,_0x1fd021,_0x40b5cf,_0x512532,_0x4a510d){return new Promise(function(_0x5b5ea1,_0x146131){var _0x3a6fa2={'id':_0x40b5cf,'name':_0x512532,'custom':_0x4a510d};if(_0x1fd021===_0xb287('0xb7')){_0x3a6fa2[_0xb287('0x41')]=[{'name':_0xb287('0xb8'),'value':_0xb287('0xb9')},{'name':_0xb287('0xba'),'value':_0xb287('0xbb')}];_0x5b5ea1(_0x3a6fa2);}else{var _0xb45a93={'method':_0xb287('0xa3'),'uri':_0x2df9f5+'sys_choice?sysparm_query=name=incident^element='+_0x40b5cf,'auth':_0x4b8cf7,'json':!![]};return rp(_0xb45a93)['then'](function(_0x2a89ef){var _0x3587ff=[];if(_0x2a89ef[_0xb287('0xa5')][_0xb287('0x34')]>0x0){_0x2a89ef['result']['forEach'](function(_0x35ab53){if(_0x35ab53[_0xb287('0xbc')]===_0xb287('0xbb')){var _0x363445={'name':_0x35ab53[_0xb287('0xaa')],'value':_0x35ab53[_0xb287('0xbd')]};_0x3587ff[_0xb287('0xab')](_0x363445);}});}_0x3a6fa2[_0xb287('0x41')]=_0x3587ff;if(_0x3a6fa2[_0xb287('0x41')][_0xb287('0x34')]>0x0){_0x5b5ea1(_0x3a6fa2);}else{if(_0x4a510d==![]){_0x5b5ea1();}else{_0x5b5ea1(_0x3a6fa2);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 0e5562e..863a08e 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 _0xeda8=['path','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','ServicenowAccount','int_servicenow_accounts','lodash','util','api','moment','bluebird','request-promise'];(function(_0x108cf0,_0x55ba36){var _0x2f7247=function(_0x19c140){while(--_0x19c140){_0x108cf0['push'](_0x108cf0['shift']());}};_0x2f7247(++_0x55ba36);}(_0xeda8,0x104));var _0x8eda=function(_0x8cbad6,_0x5efb6f){_0x8cbad6=_0x8cbad6-0x0;var _0x384f6f=_0xeda8[_0x8cbad6];return _0x384f6f;};'use strict';var _=require(_0x8eda('0x0'));var util=require(_0x8eda('0x1'));var logger=require('../../config/logger')(_0x8eda('0x2'));var moment=require(_0x8eda('0x3'));var BPromise=require(_0x8eda('0x4'));var rp=require(_0x8eda('0x5'));var fs=require('fs');var path=require(_0x8eda('0x6'));var rimraf=require(_0x8eda('0x7'));var config=require(_0x8eda('0x8'));var attributes=require(_0x8eda('0x9'));var integrations=require(_0x8eda('0xa'));module[_0x8eda('0xb')]=function(_0x349361,_0x32abe8){return _0x349361['define'](_0x8eda('0xc'),attributes,{'tableName':_0x8eda('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbd51=['./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','ServicenowAccount','int_servicenow_accounts','lodash','../../config/logger','api','moment','bluebird'];(function(_0x5f583d,_0x208fa0){var _0x365c60=function(_0x25b389){while(--_0x25b389){_0x5f583d['push'](_0x5f583d['shift']());}};_0x365c60(++_0x208fa0);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x5ddd17,_0x4b73ab){_0x5ddd17=_0x5ddd17-0x0;var _0x8335a8=_0xbd51[_0x5ddd17];return _0x8335a8;};'use strict';var _=require(_0x1bd5('0x0'));var util=require('util');var logger=require(_0x1bd5('0x1'))(_0x1bd5('0x2'));var moment=require(_0x1bd5('0x3'));var BPromise=require(_0x1bd5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1bd5('0x5'));var integrations=require(_0x1bd5('0x6'));module[_0x1bd5('0x7')]=function(_0x59ddfb,_0x29abea){return _0x59ddfb[_0x1bd5('0x8')](_0x1bd5('0x9'),attributes,{'tableName':_0x1bd5('0xa'),'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 91894e1..91d305e 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 _0x6556=['info','request\x20sent','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','ServicenowAccount,\x20%s,\x20%s','message','result','catch','GetServicenowAccount','findAll','options','raw','attributes','limit','include','map','model','debug','ShowServicenowAccount','ServicenowAccount','find','where','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then'];(function(_0x35b87c,_0x166a8c){var _0x24795b=function(_0x2cb112){while(--_0x2cb112){_0x35b87c['push'](_0x35b87c['shift']());}};_0x24795b(++_0x166a8c);}(_0x6556,0x1df));var _0x6655=function(_0x27adee,_0x43de29){_0x27adee=_0x27adee-0x0;var _0x25a11b=_0x6556[_0x27adee];return _0x25a11b;};'use strict';var _=require(_0x6655('0x0'));var util=require(_0x6655('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6655('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6655('0x3'))['db'];var utils=require(_0x6655('0x4'));var logger=require(_0x6655('0x5'))(_0x6655('0x6'));var config=require('../../config/environment');var jayson=require(_0x6655('0x7'));var client=jayson[_0x6655('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2864e8,_0xd63819,_0x43bd86){return new BPromise(function(_0x160267,_0x46ce78){return client[_0x6655('0x9')](_0x2864e8,_0x43bd86)[_0x6655('0xa')](function(_0x522a5d){logger[_0x6655('0xb')]('ServicenowAccount,\x20%s,\x20%s',_0xd63819,_0x6655('0xc'));logger['debug'](_0x6655('0xd'),_0xd63819,_0x6655('0xc'),JSON[_0x6655('0xe')](_0x522a5d));if(_0x522a5d[_0x6655('0xf')]){if(_0x522a5d[_0x6655('0xf')][_0x6655('0x10')]===0x1f4){logger[_0x6655('0xf')](_0x6655('0x11'),_0xd63819,_0x522a5d[_0x6655('0xf')][_0x6655('0x12')]);return _0x46ce78(_0x522a5d[_0x6655('0xf')][_0x6655('0x12')]);}logger['error'](_0x6655('0x11'),_0xd63819,_0x522a5d[_0x6655('0xf')][_0x6655('0x12')]);return _0x160267(_0x522a5d[_0x6655('0xf')][_0x6655('0x12')]);}else{logger[_0x6655('0xb')](_0x6655('0x11'),_0xd63819,_0x6655('0xc'));_0x160267(_0x522a5d[_0x6655('0x13')][_0x6655('0x12')]);}})[_0x6655('0x14')](function(_0x5ad321){logger[_0x6655('0xf')](_0x6655('0x11'),_0xd63819,_0x5ad321);_0x46ce78(_0x5ad321);});});}exports[_0x6655('0x15')]=function(_0x30e4e3){var _0x3f8e38=this;return new Promise(function(_0x5d95ae,_0x36ceb0){return db['ServicenowAccount'][_0x6655('0x16')]({'raw':_0x30e4e3[_0x6655('0x17')]?_0x30e4e3['options'][_0x6655('0x18')]===undefined?!![]:![]:!![],'where':_0x30e4e3[_0x6655('0x17')]?_0x30e4e3[_0x6655('0x17')]['where']||null:null,'attributes':_0x30e4e3[_0x6655('0x17')]?_0x30e4e3[_0x6655('0x17')][_0x6655('0x19')]||null:null,'limit':_0x30e4e3[_0x6655('0x17')]?_0x30e4e3[_0x6655('0x17')][_0x6655('0x1a')]||null:null,'include':_0x30e4e3[_0x6655('0x17')]?_0x30e4e3[_0x6655('0x17')][_0x6655('0x1b')]?_[_0x6655('0x1c')](_0x30e4e3[_0x6655('0x17')][_0x6655('0x1b')],function(_0x5d85ea){return{'model':db[_0x5d85ea[_0x6655('0x1d')]],'as':_0x5d85ea['as'],'attributes':_0x5d85ea['attributes'],'include':_0x5d85ea[_0x6655('0x1b')]?_[_0x6655('0x1c')](_0x5d85ea[_0x6655('0x1b')],function(_0x32f51a){return{'model':db[_0x32f51a[_0x6655('0x1d')]],'as':_0x32f51a['as'],'attributes':_0x32f51a['attributes'],'include':_0x32f51a[_0x6655('0x1b')]?_[_0x6655('0x1c')](_0x32f51a[_0x6655('0x1b')],function(_0x45bdb8){return{'model':db[_0x45bdb8[_0x6655('0x1d')]],'as':_0x45bdb8['as'],'attributes':_0x45bdb8[_0x6655('0x19')]};}):[]};}):[]};}):[]:[]})[_0x6655('0xa')](function(_0x2e0ebb){logger[_0x6655('0xb')](_0x6655('0x15'),_0x30e4e3);logger[_0x6655('0x1e')]('GetServicenowAccount',_0x30e4e3,JSON[_0x6655('0xe')](_0x2e0ebb));_0x5d95ae(_0x2e0ebb);})[_0x6655('0x14')](function(_0x794092){logger[_0x6655('0xf')](_0x6655('0x15'),_0x794092[_0x6655('0x12')],_0x30e4e3);_0x36ceb0(_0x3f8e38[_0x6655('0xf')](0x1f4,_0x794092[_0x6655('0x12')]));});});};exports[_0x6655('0x1f')]=function(_0x267f09){var _0x5b6730=this;return new Promise(function(_0x148ae9,_0x2537ed){return db[_0x6655('0x20')][_0x6655('0x21')]({'raw':_0x267f09[_0x6655('0x17')]?_0x267f09[_0x6655('0x17')][_0x6655('0x18')]===undefined?!![]:![]:!![],'where':_0x267f09[_0x6655('0x17')]?_0x267f09[_0x6655('0x17')][_0x6655('0x22')]||null:null,'attributes':_0x267f09[_0x6655('0x17')]?_0x267f09[_0x6655('0x17')]['attributes']||null:null,'include':_0x267f09[_0x6655('0x17')]?_0x267f09[_0x6655('0x17')][_0x6655('0x1b')]?_[_0x6655('0x1c')](_0x267f09[_0x6655('0x17')][_0x6655('0x1b')],function(_0x12dbc3){return{'model':db[_0x12dbc3[_0x6655('0x1d')]],'as':_0x12dbc3['as'],'attributes':_0x12dbc3[_0x6655('0x19')],'include':_0x12dbc3['include']?_[_0x6655('0x1c')](_0x12dbc3[_0x6655('0x1b')],function(_0x18995b){return{'model':db[_0x18995b['model']],'as':_0x18995b['as'],'attributes':_0x18995b[_0x6655('0x19')],'include':_0x18995b[_0x6655('0x1b')]?_[_0x6655('0x1c')](_0x18995b[_0x6655('0x1b')],function(_0x40cb03){return{'model':db[_0x40cb03[_0x6655('0x1d')]],'as':_0x40cb03['as'],'attributes':_0x40cb03[_0x6655('0x19')]};}):[]};}):[]};}):[]:[]})[_0x6655('0xa')](function(_0x479b6b){logger[_0x6655('0xb')](_0x6655('0x1f'),_0x267f09);logger[_0x6655('0x1e')](_0x6655('0x1f'),_0x267f09,JSON[_0x6655('0xe')](_0x479b6b));_0x148ae9(_0x479b6b);})['catch'](function(_0x356b0d){logger[_0x6655('0xf')](_0x6655('0x1f'),_0x356b0d[_0x6655('0x12')],_0x267f09);_0x2537ed(_0x5b6730[_0x6655('0xf')](0x1f4,_0x356b0d[_0x6655('0x12')]));});});}; \ No newline at end of file +var _0x1469=['ServicenowAccount','findAll','options','raw','where','include','model','attributes','map','debug','ShowServicenowAccount','find','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','ServicenowAccount,\x20%s,\x20%s','ServicenowAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetServicenowAccount'];(function(_0x5bfe22,_0x1a397a){var _0x51002f=function(_0x48b7eb){while(--_0x48b7eb){_0x5bfe22['push'](_0x5bfe22['shift']());}};_0x51002f(++_0x1a397a);}(_0x1469,0x16a));var _0x9146=function(_0x4ec1aa,_0x157f94){_0x4ec1aa=_0x4ec1aa-0x0;var _0x491788=_0x1469[_0x4ec1aa];return _0x491788;};'use strict';var _=require(_0x9146('0x0'));var util=require(_0x9146('0x1'));var moment=require(_0x9146('0x2'));var BPromise=require(_0x9146('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9146('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9146('0x5'));var logger=require(_0x9146('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x9146('0x7'));var client=jayson[_0x9146('0x8')][_0x9146('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x31400e,_0x1b905b,_0x5d4735){return new BPromise(function(_0xceeb50,_0x49e3c2){return client[_0x9146('0xa')](_0x31400e,_0x5d4735)[_0x9146('0xb')](function(_0x31babc){logger[_0x9146('0xc')](_0x9146('0xd'),_0x1b905b,'request\x20sent');logger['debug'](_0x9146('0xe'),_0x1b905b,_0x9146('0xf'),JSON[_0x9146('0x10')](_0x31babc));if(_0x31babc[_0x9146('0x11')]){if(_0x31babc['error'][_0x9146('0x12')]===0x1f4){logger[_0x9146('0x11')](_0x9146('0xd'),_0x1b905b,_0x31babc['error'][_0x9146('0x13')]);return _0x49e3c2(_0x31babc[_0x9146('0x11')][_0x9146('0x13')]);}logger[_0x9146('0x11')](_0x9146('0xd'),_0x1b905b,_0x31babc[_0x9146('0x11')][_0x9146('0x13')]);return _0xceeb50(_0x31babc['error'][_0x9146('0x13')]);}else{logger[_0x9146('0xc')](_0x9146('0xd'),_0x1b905b,_0x9146('0xf'));_0xceeb50(_0x31babc[_0x9146('0x14')][_0x9146('0x13')]);}})[_0x9146('0x15')](function(_0x3d0da5){logger['error']('ServicenowAccount,\x20%s,\x20%s',_0x1b905b,_0x3d0da5);_0x49e3c2(_0x3d0da5);});});}exports[_0x9146('0x16')]=function(_0x562dea){var _0x1be622=this;return new Promise(function(_0x4d96c0,_0x3a77d3){return db[_0x9146('0x17')][_0x9146('0x18')]({'raw':_0x562dea[_0x9146('0x19')]?_0x562dea[_0x9146('0x19')][_0x9146('0x1a')]===undefined?!![]:![]:!![],'where':_0x562dea[_0x9146('0x19')]?_0x562dea[_0x9146('0x19')][_0x9146('0x1b')]||null:null,'attributes':_0x562dea['options']?_0x562dea[_0x9146('0x19')]['attributes']||null:null,'limit':_0x562dea[_0x9146('0x19')]?_0x562dea['options']['limit']||null:null,'include':_0x562dea[_0x9146('0x19')]?_0x562dea[_0x9146('0x19')][_0x9146('0x1c')]?_['map'](_0x562dea['options']['include'],function(_0x41030d){return{'model':db[_0x41030d[_0x9146('0x1d')]],'as':_0x41030d['as'],'attributes':_0x41030d[_0x9146('0x1e')],'include':_0x41030d[_0x9146('0x1c')]?_['map'](_0x41030d[_0x9146('0x1c')],function(_0x2b18f4){return{'model':db[_0x2b18f4[_0x9146('0x1d')]],'as':_0x2b18f4['as'],'attributes':_0x2b18f4[_0x9146('0x1e')],'include':_0x2b18f4['include']?_[_0x9146('0x1f')](_0x2b18f4[_0x9146('0x1c')],function(_0x4dbace){return{'model':db[_0x4dbace[_0x9146('0x1d')]],'as':_0x4dbace['as'],'attributes':_0x4dbace[_0x9146('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3f9aaa){logger[_0x9146('0xc')](_0x9146('0x16'),_0x562dea);logger[_0x9146('0x20')](_0x9146('0x16'),_0x562dea,JSON[_0x9146('0x10')](_0x3f9aaa));_0x4d96c0(_0x3f9aaa);})[_0x9146('0x15')](function(_0x126379){logger[_0x9146('0x11')](_0x9146('0x16'),_0x126379[_0x9146('0x13')],_0x562dea);_0x3a77d3(_0x1be622[_0x9146('0x11')](0x1f4,_0x126379[_0x9146('0x13')]));});});};exports[_0x9146('0x21')]=function(_0x41e68d){var _0x50e983=this;return new Promise(function(_0x1fafaf,_0xd57ef){return db[_0x9146('0x17')][_0x9146('0x22')]({'raw':_0x41e68d[_0x9146('0x19')]?_0x41e68d[_0x9146('0x19')][_0x9146('0x1a')]===undefined?!![]:![]:!![],'where':_0x41e68d[_0x9146('0x19')]?_0x41e68d[_0x9146('0x19')][_0x9146('0x1b')]||null:null,'attributes':_0x41e68d[_0x9146('0x19')]?_0x41e68d['options'][_0x9146('0x1e')]||null:null,'include':_0x41e68d[_0x9146('0x19')]?_0x41e68d[_0x9146('0x19')][_0x9146('0x1c')]?_[_0x9146('0x1f')](_0x41e68d[_0x9146('0x19')][_0x9146('0x1c')],function(_0x4a4f13){return{'model':db[_0x4a4f13[_0x9146('0x1d')]],'as':_0x4a4f13['as'],'attributes':_0x4a4f13[_0x9146('0x1e')],'include':_0x4a4f13[_0x9146('0x1c')]?_['map'](_0x4a4f13[_0x9146('0x1c')],function(_0xb0d751){return{'model':db[_0xb0d751[_0x9146('0x1d')]],'as':_0xb0d751['as'],'attributes':_0xb0d751[_0x9146('0x1e')],'include':_0xb0d751[_0x9146('0x1c')]?_[_0x9146('0x1f')](_0xb0d751['include'],function(_0x1cc134){return{'model':db[_0x1cc134[_0x9146('0x1d')]],'as':_0x1cc134['as'],'attributes':_0x1cc134[_0x9146('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x9146('0xb')](function(_0x4b0741){logger[_0x9146('0xc')](_0x9146('0x21'),_0x41e68d);logger[_0x9146('0x20')](_0x9146('0x21'),_0x41e68d,JSON[_0x9146('0x10')](_0x4b0741));_0x1fafaf(_0x4b0741);})[_0x9146('0x15')](function(_0x2693ae){logger['error'](_0x9146('0x21'),_0x2693ae[_0x9146('0x13')],_0x41e68d);_0xd57ef(_0x50e983['error'](0x1f4,_0x2693ae[_0x9146('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 7ed5328..c580a7f 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 _0x9959=['isAuthenticated','/:id/descriptions','getDescriptions','create','put','update','delete','/:id','exports','multer','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get','show','/:id/fields'];(function(_0x3c7607,_0x456d23){var _0x2cc74f=function(_0x107031){while(--_0x107031){_0x3c7607['push'](_0x3c7607['shift']());}};_0x2cc74f(++_0x456d23);}(_0x9959,0x1e4));var _0x9995=function(_0x160036,_0x1643ea){_0x160036=_0x160036-0x0;var _0x3bf2e5=_0x9959[_0x160036];return _0x3bf2e5;};'use strict';var multer=require(_0x9995('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x9995('0x1'));var router=express['Router']();var fs_extra=require(_0x9995('0x2'));var auth=require(_0x9995('0x3'));var interaction=require(_0x9995('0x4'));var config=require(_0x9995('0x5'));var controller=require(_0x9995('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x9995('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x9995('0x8')]);router['get'](_0x9995('0x9'),auth['isAuthenticated'](),controller['getFields']);router['get']('/:id/subjects',auth[_0x9995('0xa')](),controller['getSubjects']);router[_0x9995('0x7')](_0x9995('0xb'),auth['isAuthenticated'](),controller[_0x9995('0xc')]);router['post']('/',auth[_0x9995('0xa')](),controller[_0x9995('0xd')]);router[_0x9995('0xe')]('/:id',auth[_0x9995('0xa')](),controller[_0x9995('0xf')]);router[_0x9995('0x10')](_0x9995('0x11'),auth[_0x9995('0xa')](),controller['destroy']);module[_0x9995('0x12')]=router; \ No newline at end of file +var _0x615c=['/:id/descriptions','getDescriptions','post','/:id','update','delete','destroy','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','show','/:id/subjects','getSubjects'];(function(_0x3ffdac,_0x1cec56){var _0x2ca852=function(_0x1eac32){while(--_0x1eac32){_0x3ffdac['push'](_0x3ffdac['shift']());}};_0x2ca852(++_0x1cec56);}(_0x615c,0x1d5));var _0xc615=function(_0x1a2877,_0x4b2963){_0x1a2877=_0x1a2877-0x0;var _0xe5dbce=_0x615c[_0x1a2877];return _0xe5dbce;};'use strict';var multer=require('multer');var util=require(_0xc615('0x0'));var path=require(_0xc615('0x1'));var timeout=require(_0xc615('0x2'));var express=require(_0xc615('0x3'));var router=express[_0xc615('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xc615('0x5'));var interaction=require(_0xc615('0x6'));var config=require(_0xc615('0x7'));var controller=require('./intServicenowConfiguration.controller');router[_0xc615('0x8')]('/',auth['isAuthenticated'](),controller[_0xc615('0x9')]);router[_0xc615('0x8')]('/:id',auth[_0xc615('0xa')](),controller[_0xc615('0xb')]);router[_0xc615('0x8')]('/:id/fields',auth[_0xc615('0xa')](),controller['getFields']);router[_0xc615('0x8')](_0xc615('0xc'),auth[_0xc615('0xa')](),controller[_0xc615('0xd')]);router['get'](_0xc615('0xe'),auth['isAuthenticated'](),controller[_0xc615('0xf')]);router[_0xc615('0x10')]('/',auth[_0xc615('0xa')](),controller['create']);router['put'](_0xc615('0x11'),auth[_0xc615('0xa')](),controller[_0xc615('0x12')]);router[_0xc615('0x13')]('/:id',auth[_0xc615('0xa')](),controller[_0xc615('0x14')]);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 48064f1..ee23f7e 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 _0xda22=['sequelize'];(function(_0x82ec3f,_0x549976){var _0x20597f=function(_0x2d36fb){while(--_0x2d36fb){_0x82ec3f['push'](_0x82ec3f['shift']());}};_0x20597f(++_0x549976);}(_0xda22,0x165));var _0x2da2=function(_0x4a0a99,_0xcfe0a5){_0x4a0a99=_0x4a0a99-0x0;var _0x2199d5=_0xda22[_0x4a0a99];return _0x2199d5;};'use strict';var Sequelize=require(_0x2da2('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xc2c6=['STRING','sequelize'];(function(_0x151f07,_0x417419){var _0x289cbb=function(_0x3cb566){while(--_0x3cb566){_0x151f07['push'](_0x151f07['shift']());}};_0x289cbb(++_0x417419);}(_0xc2c6,0xfd));var _0x6c2c=function(_0x5bdd93,_0x208ccb){_0x5bdd93=_0x5bdd93-0x0;var _0x2caf5e=_0xc2c6[_0x5bdd93];return _0x2caf5e;};'use strict';var Sequelize=require(_0x6c2c('0x0'));module['exports']={'name':{'type':Sequelize[_0x6c2c('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index b4597fd..837f855 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 _0x9f9f=['merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','length','include','find','create','body','destroy','getFields','findOne','pick','nolimit','getSubjects','filter','ServicenowField','getDescriptions','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','error','stack','name','index','map','ServicenowConfiguration','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where'];(function(_0x3222c5,_0x3bf3f6){var _0x1ad076=function(_0x56a092){while(--_0x56a092){_0x3222c5['push'](_0x3222c5['shift']());}};_0x1ad076(++_0x3bf3f6);}(_0x9f9f,0x6a));var _0xf9f9=function(_0x4e668f,_0x49422a){_0x4e668f=_0x4e668f-0x0;var _0x1e2b2e=_0x9f9f[_0x4e668f];return _0x1e2b2e;};'use strict';var emlformat=require(_0xf9f9('0x0'));var rimraf=require(_0xf9f9('0x1'));var zipdir=require(_0xf9f9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf9f9('0x3'));var moment=require('moment');var BPromise=require(_0xf9f9('0x4'));var Mustache=require(_0xf9f9('0x5'));var util=require(_0xf9f9('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xf9f9('0x7'));var ejs=require(_0xf9f9('0x8'));var fs=require('fs');var fs_extra=require(_0xf9f9('0x9'));var _=require(_0xf9f9('0xa'));var squel=require(_0xf9f9('0xb'));var crypto=require(_0xf9f9('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xf9f9('0xd'));var toCsv=require(_0xf9f9('0x7'));var querystring=require(_0xf9f9('0xe'));var Papa=require(_0xf9f9('0xf'));var Redis=require(_0xf9f9('0x10'));var authService=require(_0xf9f9('0x11'));var qs=require(_0xf9f9('0x12'));var as=require(_0xf9f9('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf9f9('0x14'));var utils=require(_0xf9f9('0x15'));var config=require(_0xf9f9('0x16'));var licenseUtil=require(_0xf9f9('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x22a59a,_0x103952){_0x103952=_0x103952||0xcc;return function(_0x442113){if(_0x442113){return _0x22a59a[_0xf9f9('0x18')](_0x103952);}return _0x22a59a[_0xf9f9('0x19')](_0x103952)[_0xf9f9('0x1a')]();};}function respondWithResult(_0x5ba90d,_0x1a437a){_0x1a437a=_0x1a437a||0xc8;return function(_0x443da6){if(_0x443da6){return _0x5ba90d[_0xf9f9('0x19')](_0x1a437a)[_0xf9f9('0x1b')](_0x443da6);}};}function respondWithFilteredResult(_0x36a27c,_0x4010ae){return function(_0x98700a){if(_0x98700a){var _0x309c14=typeof _0x4010ae['offset']===_0xf9f9('0x1c')&&typeof _0x4010ae[_0xf9f9('0x1d')]===_0xf9f9('0x1c');var _0x1070f5=_0x98700a[_0xf9f9('0x1e')];var _0x356e8a=_0x309c14?0x0:_0x4010ae[_0xf9f9('0x1f')];var _0x5d0a74=_0x309c14?_0x98700a[_0xf9f9('0x1e')]:_0x4010ae[_0xf9f9('0x1f')]+_0x4010ae[_0xf9f9('0x1d')];var _0xfd5263;if(_0x5d0a74>=_0x1070f5){_0x5d0a74=_0x1070f5;_0xfd5263=0xc8;}else{_0xfd5263=0xce;}_0x36a27c[_0xf9f9('0x19')](_0xfd5263);return _0x36a27c[_0xf9f9('0x20')](_0xf9f9('0x21'),_0x356e8a+'-'+_0x5d0a74+'/'+_0x1070f5)[_0xf9f9('0x1b')](_0x98700a);}return null;};}function patchUpdates(_0xc40dd1){return function(_0x36befc){try{jsonpatch[_0xf9f9('0x22')](_0x36befc,_0xc40dd1,!![]);}catch(_0x377c0b){return BPromise[_0xf9f9('0x23')](_0x377c0b);}return _0x36befc[_0xf9f9('0x24')]();};}function saveUpdates(_0x19e225,_0xb6a63d){return function(_0x3e704d){if(_0x3e704d){return _0x3e704d[_0xf9f9('0x25')](_0x19e225)[_0xf9f9('0x26')](function(_0x4c51ad){return _0x4c51ad;});}return null;};}function removeEntity(_0x5bd4a4,_0x127763){return function(_0x4332e3){if(_0x4332e3){return _0x4332e3['destroy']()['then'](function(){_0x5bd4a4[_0xf9f9('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x34322d,_0x5a05e6){return function(_0x4d8777){if(!_0x4d8777){_0x34322d['sendStatus'](0x194);}return _0x4d8777;};}function handleError(_0x3d1cc9,_0x5eafdc){_0x5eafdc=_0x5eafdc||0x1f4;return function(_0xe5c3df){logger[_0xf9f9('0x27')](_0xe5c3df[_0xf9f9('0x28')]);if(_0xe5c3df[_0xf9f9('0x29')]){delete _0xe5c3df['name'];}_0x3d1cc9[_0xf9f9('0x19')](_0x5eafdc)['send'](_0xe5c3df);};}exports[_0xf9f9('0x2a')]=function(_0x2feea7,_0x3d1a5f){var _0x2eee32={},_0x37868c={},_0x586430={'count':0x0,'rows':[]};var _0x12ff72=_[_0xf9f9('0x2b')](db[_0xf9f9('0x2c')][_0xf9f9('0x2d')],function(_0x266443){return{'name':_0x266443[_0xf9f9('0x2e')],'type':_0x266443[_0xf9f9('0x2f')][_0xf9f9('0x30')]};});_0x37868c[_0xf9f9('0x31')]=_[_0xf9f9('0x2b')](_0x12ff72,_0xf9f9('0x29'));_0x37868c['query']=_[_0xf9f9('0x32')](_0x2feea7[_0xf9f9('0x33')]);_0x37868c[_0xf9f9('0x34')]=_[_0xf9f9('0x35')](_0x37868c[_0xf9f9('0x31')],_0x37868c[_0xf9f9('0x33')]);_0x2eee32[_0xf9f9('0x36')]=_[_0xf9f9('0x35')](_0x37868c[_0xf9f9('0x31')],qs['fields'](_0x2feea7[_0xf9f9('0x33')][_0xf9f9('0x37')]));_0x2eee32[_0xf9f9('0x36')]=_0x2eee32[_0xf9f9('0x36')]['length']?_0x2eee32[_0xf9f9('0x36')]:_0x37868c[_0xf9f9('0x31')];if(!_0x2feea7[_0xf9f9('0x33')][_0xf9f9('0x38')]('nolimit')){_0x2eee32[_0xf9f9('0x1d')]=qs[_0xf9f9('0x1d')](_0x2feea7[_0xf9f9('0x33')][_0xf9f9('0x1d')]);_0x2eee32[_0xf9f9('0x1f')]=qs[_0xf9f9('0x1f')](_0x2feea7[_0xf9f9('0x33')][_0xf9f9('0x1f')]);}_0x2eee32[_0xf9f9('0x39')]=qs[_0xf9f9('0x3a')](_0x2feea7['query'][_0xf9f9('0x3a')]);_0x2eee32[_0xf9f9('0x3b')]=qs[_0xf9f9('0x34')](_['pick'](_0x2feea7[_0xf9f9('0x33')],_0x37868c[_0xf9f9('0x34')]),_0x12ff72);if(_0x2feea7[_0xf9f9('0x33')]['filter']){_0x2eee32[_0xf9f9('0x3b')]=_[_0xf9f9('0x3c')](_0x2eee32[_0xf9f9('0x3b')],{'$or':_[_0xf9f9('0x2b')](_0x12ff72,function(_0x58d6f4){if(_0x58d6f4[_0xf9f9('0x2f')]!==_0xf9f9('0x3d')){var _0x4a7095={};_0x4a7095[_0x58d6f4[_0xf9f9('0x29')]]={'$like':'%'+_0x2feea7[_0xf9f9('0x33')]['filter']+'%'};return _0x4a7095;}})});}_0x2eee32=_[_0xf9f9('0x3c')]({},_0x2eee32,_0x2feea7[_0xf9f9('0x3e')]);var _0x309653={'where':_0x2eee32[_0xf9f9('0x3b')]};return db[_0xf9f9('0x2c')]['count'](_0x309653)[_0xf9f9('0x26')](function(_0x1a3f2f){_0x586430[_0xf9f9('0x1e')]=_0x1a3f2f;if(_0x2feea7[_0xf9f9('0x33')][_0xf9f9('0x3f')]){_0x2eee32['include']=[{'all':!![]}];}return db[_0xf9f9('0x2c')][_0xf9f9('0x40')](_0x2eee32);})[_0xf9f9('0x26')](function(_0x20174d){_0x586430[_0xf9f9('0x41')]=_0x20174d;return _0x586430;})['then'](respondWithFilteredResult(_0x3d1a5f,_0x2eee32))[_0xf9f9('0x42')](handleError(_0x3d1a5f,null));};exports[_0xf9f9('0x43')]=function(_0xfabe7b,_0x3ff146){var _0x1a5c91={'raw':![],'where':{'id':_0xfabe7b[_0xf9f9('0x44')]['id']}},_0x5aaaae={};_0x5aaaae['model']=_['keys'](db[_0xf9f9('0x2c')][_0xf9f9('0x2d')]);_0x5aaaae[_0xf9f9('0x33')]=_[_0xf9f9('0x32')](_0xfabe7b[_0xf9f9('0x33')]);_0x5aaaae['filters']=_[_0xf9f9('0x35')](_0x5aaaae[_0xf9f9('0x31')],_0x5aaaae[_0xf9f9('0x33')]);_0x1a5c91[_0xf9f9('0x36')]=_[_0xf9f9('0x35')](_0x5aaaae['model'],qs[_0xf9f9('0x37')](_0xfabe7b[_0xf9f9('0x33')][_0xf9f9('0x37')]));_0x1a5c91['attributes']=_0x1a5c91[_0xf9f9('0x36')][_0xf9f9('0x45')]?_0x1a5c91['attributes']:_0x5aaaae[_0xf9f9('0x31')];if(_0xfabe7b[_0xf9f9('0x33')]['includeAll']){_0x1a5c91[_0xf9f9('0x46')]=[{'all':!![]}];}_0x1a5c91=_[_0xf9f9('0x3c')]({},_0x1a5c91,_0xfabe7b[_0xf9f9('0x3e')]);return db[_0xf9f9('0x2c')][_0xf9f9('0x47')](_0x1a5c91)[_0xf9f9('0x26')](handleEntityNotFound(_0x3ff146,null))[_0xf9f9('0x26')](respondWithResult(_0x3ff146,null))[_0xf9f9('0x42')](handleError(_0x3ff146,null));};exports[_0xf9f9('0x48')]=function(_0x347bd1,_0xefc80c){return db[_0xf9f9('0x2c')][_0xf9f9('0x48')](_0x347bd1[_0xf9f9('0x49')],{})[_0xf9f9('0x26')](respondWithResult(_0xefc80c,0xc9))[_0xf9f9('0x42')](handleError(_0xefc80c,null));};exports[_0xf9f9('0x25')]=function(_0x54d1b0,_0x18d518){if(_0x54d1b0[_0xf9f9('0x49')]['id']){delete _0x54d1b0[_0xf9f9('0x49')]['id'];}return db['ServicenowConfiguration']['find']({'where':{'id':_0x54d1b0[_0xf9f9('0x44')]['id']}})[_0xf9f9('0x26')](handleEntityNotFound(_0x18d518,null))[_0xf9f9('0x26')](saveUpdates(_0x54d1b0['body'],null))[_0xf9f9('0x26')](respondWithResult(_0x18d518,null))[_0xf9f9('0x42')](handleError(_0x18d518,null));};exports[_0xf9f9('0x4a')]=function(_0x15c58f,_0x2a90ec){return db[_0xf9f9('0x2c')][_0xf9f9('0x47')]({'where':{'id':_0x15c58f[_0xf9f9('0x44')]['id']}})[_0xf9f9('0x26')](handleEntityNotFound(_0x2a90ec,null))['then'](removeEntity(_0x2a90ec,null))[_0xf9f9('0x42')](handleError(_0x2a90ec,null));};exports[_0xf9f9('0x4b')]=function(_0x56c45e,_0x474ff5,_0x88e219){var _0x65476d={};var _0x521441={};var _0x4a6bb2;var _0x8d44f4;return db[_0xf9f9('0x2c')][_0xf9f9('0x4c')]({'where':{'id':_0x56c45e[_0xf9f9('0x44')]['id']}})['then'](handleEntityNotFound(_0x474ff5,null))['then'](function(_0x389bc4){if(_0x389bc4){_0x4a6bb2=_0x389bc4;_0x521441['model']=_[_0xf9f9('0x32')](db['ServicenowField']['rawAttributes']);_0x521441['query']=_[_0xf9f9('0x32')](_0x56c45e[_0xf9f9('0x33')]);_0x521441[_0xf9f9('0x34')]=_[_0xf9f9('0x35')](_0x521441['model'],_0x521441[_0xf9f9('0x33')]);_0x65476d[_0xf9f9('0x36')]=_[_0xf9f9('0x35')](_0x521441[_0xf9f9('0x31')],qs['fields'](_0x56c45e['query'][_0xf9f9('0x37')]));_0x65476d[_0xf9f9('0x36')]=_0x65476d['attributes']['length']?_0x65476d[_0xf9f9('0x36')]:_0x521441[_0xf9f9('0x31')];_0x65476d[_0xf9f9('0x39')]=qs['sort'](_0x56c45e['query'][_0xf9f9('0x3a')]);_0x65476d[_0xf9f9('0x3b')]=qs[_0xf9f9('0x34')](_[_0xf9f9('0x4d')](_0x56c45e[_0xf9f9('0x33')],_0x521441[_0xf9f9('0x34')]));if(_0x56c45e[_0xf9f9('0x33')]['filter']){_0x65476d[_0xf9f9('0x3b')]=_[_0xf9f9('0x3c')](_0x65476d[_0xf9f9('0x3b')],{'$or':_[_0xf9f9('0x2b')](_0x65476d[_0xf9f9('0x36')],function(_0x1277e8){var _0x2e91e3={};_0x2e91e3[_0x1277e8]={'$like':'%'+_0x56c45e['query']['filter']+'%'};return _0x2e91e3;})});}_0x65476d=_['merge']({},_0x65476d,_0x56c45e[_0xf9f9('0x3e')]);return _0x4a6bb2[_0xf9f9('0x4b')](_0x65476d);}})[_0xf9f9('0x26')](function(_0x37e82e){if(_0x37e82e){_0x8d44f4=_0x37e82e[_0xf9f9('0x45')];if(!_0x56c45e[_0xf9f9('0x33')][_0xf9f9('0x38')](_0xf9f9('0x4e'))){_0x65476d[_0xf9f9('0x1d')]=qs[_0xf9f9('0x1d')](_0x56c45e[_0xf9f9('0x33')][_0xf9f9('0x1d')]);_0x65476d[_0xf9f9('0x1f')]=qs[_0xf9f9('0x1f')](_0x56c45e[_0xf9f9('0x33')][_0xf9f9('0x1f')]);}return _0x4a6bb2['getFields'](_0x65476d);}})[_0xf9f9('0x26')](function(_0x2c465b){if(_0x2c465b){return _0x2c465b?{'count':_0x8d44f4,'rows':_0x2c465b}:null;}})['then'](respondWithResult(_0x474ff5,null))[_0xf9f9('0x42')](handleError(_0x474ff5,null));};exports[_0xf9f9('0x4f')]=function(_0x5de575,_0x21c884,_0x490776){var _0x3b1694={};var _0x5c3c1a={};var _0x4fe9c6;var _0x5a288c;return db['ServicenowConfiguration'][_0xf9f9('0x4c')]({'where':{'id':_0x5de575[_0xf9f9('0x44')]['id']}})[_0xf9f9('0x26')](handleEntityNotFound(_0x21c884,null))[_0xf9f9('0x26')](function(_0x298974){if(_0x298974){_0x4fe9c6=_0x298974;_0x5c3c1a[_0xf9f9('0x31')]=_[_0xf9f9('0x32')](db['ServicenowField']['rawAttributes']);_0x5c3c1a['query']=_[_0xf9f9('0x32')](_0x5de575['query']);_0x5c3c1a['filters']=_['intersection'](_0x5c3c1a['model'],_0x5c3c1a[_0xf9f9('0x33')]);_0x3b1694[_0xf9f9('0x36')]=_[_0xf9f9('0x35')](_0x5c3c1a[_0xf9f9('0x31')],qs[_0xf9f9('0x37')](_0x5de575[_0xf9f9('0x33')]['fields']));_0x3b1694[_0xf9f9('0x36')]=_0x3b1694[_0xf9f9('0x36')][_0xf9f9('0x45')]?_0x3b1694[_0xf9f9('0x36')]:_0x5c3c1a['model'];_0x3b1694[_0xf9f9('0x39')]=qs['sort'](_0x5de575[_0xf9f9('0x33')]['sort']);_0x3b1694['where']=qs[_0xf9f9('0x34')](_['pick'](_0x5de575[_0xf9f9('0x33')],_0x5c3c1a['filters']));if(_0x5de575[_0xf9f9('0x33')]['filter']){_0x3b1694['where']=_[_0xf9f9('0x3c')](_0x3b1694['where'],{'$or':_[_0xf9f9('0x2b')](_0x3b1694[_0xf9f9('0x36')],function(_0x5c6b22){var _0x313255={};_0x313255[_0x5c6b22]={'$like':'%'+_0x5de575[_0xf9f9('0x33')][_0xf9f9('0x50')]+'%'};return _0x313255;})});}_0x3b1694=_[_0xf9f9('0x3c')]({},_0x3b1694,_0x5de575[_0xf9f9('0x3e')]);return _0x4fe9c6['getSubjects'](_0x3b1694);}})[_0xf9f9('0x26')](function(_0xac6cac){if(_0xac6cac){_0x5a288c=_0xac6cac[_0xf9f9('0x45')];if(!_0x5de575[_0xf9f9('0x33')][_0xf9f9('0x38')](_0xf9f9('0x4e'))){_0x3b1694[_0xf9f9('0x1d')]=qs[_0xf9f9('0x1d')](_0x5de575[_0xf9f9('0x33')]['limit']);_0x3b1694[_0xf9f9('0x1f')]=qs[_0xf9f9('0x1f')](_0x5de575['query'][_0xf9f9('0x1f')]);}return _0x4fe9c6['getSubjects'](_0x3b1694);}})['then'](function(_0x30afed){if(_0x30afed){return _0x30afed?{'count':_0x5a288c,'rows':_0x30afed}:null;}})[_0xf9f9('0x26')](respondWithResult(_0x21c884,null))[_0xf9f9('0x42')](handleError(_0x21c884,null));};exports['getDescriptions']=function(_0x5c3d17,_0x2e013b,_0x512352){var _0x27612e={};var _0x2db57f={};var _0x505e9a;var _0x335969;return db[_0xf9f9('0x2c')][_0xf9f9('0x4c')]({'where':{'id':_0x5c3d17[_0xf9f9('0x44')]['id']}})[_0xf9f9('0x26')](handleEntityNotFound(_0x2e013b,null))['then'](function(_0x261b45){if(_0x261b45){_0x505e9a=_0x261b45;_0x2db57f[_0xf9f9('0x31')]=_[_0xf9f9('0x32')](db[_0xf9f9('0x51')][_0xf9f9('0x2d')]);_0x2db57f[_0xf9f9('0x33')]=_['keys'](_0x5c3d17[_0xf9f9('0x33')]);_0x2db57f['filters']=_[_0xf9f9('0x35')](_0x2db57f[_0xf9f9('0x31')],_0x2db57f['query']);_0x27612e[_0xf9f9('0x36')]=_[_0xf9f9('0x35')](_0x2db57f[_0xf9f9('0x31')],qs[_0xf9f9('0x37')](_0x5c3d17[_0xf9f9('0x33')][_0xf9f9('0x37')]));_0x27612e[_0xf9f9('0x36')]=_0x27612e['attributes'][_0xf9f9('0x45')]?_0x27612e[_0xf9f9('0x36')]:_0x2db57f[_0xf9f9('0x31')];_0x27612e[_0xf9f9('0x39')]=qs['sort'](_0x5c3d17[_0xf9f9('0x33')][_0xf9f9('0x3a')]);_0x27612e[_0xf9f9('0x3b')]=qs[_0xf9f9('0x34')](_[_0xf9f9('0x4d')](_0x5c3d17[_0xf9f9('0x33')],_0x2db57f[_0xf9f9('0x34')]));if(_0x5c3d17['query'][_0xf9f9('0x50')]){_0x27612e[_0xf9f9('0x3b')]=_[_0xf9f9('0x3c')](_0x27612e[_0xf9f9('0x3b')],{'$or':_[_0xf9f9('0x2b')](_0x27612e[_0xf9f9('0x36')],function(_0x2a28e9){var _0xf4f7d5={};_0xf4f7d5[_0x2a28e9]={'$like':'%'+_0x5c3d17[_0xf9f9('0x33')][_0xf9f9('0x50')]+'%'};return _0xf4f7d5;})});}_0x27612e=_[_0xf9f9('0x3c')]({},_0x27612e,_0x5c3d17[_0xf9f9('0x3e')]);return _0x505e9a[_0xf9f9('0x52')](_0x27612e);}})[_0xf9f9('0x26')](function(_0x2d3c39){if(_0x2d3c39){_0x335969=_0x2d3c39[_0xf9f9('0x45')];if(!_0x5c3d17[_0xf9f9('0x33')]['hasOwnProperty'](_0xf9f9('0x4e'))){_0x27612e['limit']=qs[_0xf9f9('0x1d')](_0x5c3d17[_0xf9f9('0x33')][_0xf9f9('0x1d')]);_0x27612e['offset']=qs['offset'](_0x5c3d17[_0xf9f9('0x33')][_0xf9f9('0x1f')]);}return _0x505e9a[_0xf9f9('0x52')](_0x27612e);}})[_0xf9f9('0x26')](function(_0x41a5b7){if(_0x41a5b7){return _0x41a5b7?{'count':_0x335969,'rows':_0x41a5b7}:null;}})['then'](respondWithResult(_0x2e013b,null))[_0xf9f9('0x42')](handleError(_0x2e013b,null));}; \ No newline at end of file +var _0x1247=['where','filters','pick','filter','merge','includeAll','include','findAll','rows','catch','show','params','length','options','create','body','update','getFields','ServicenowField','getSubjects','nolimit','getDescriptions','findOne','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','offset','count','Content-Range','apply','save','then','destroy','error','name','index','map','ServicenowConfiguration','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','order','sort'];(function(_0x25a11b,_0x5783db){var _0x173342=function(_0x155f47){while(--_0x155f47){_0x25a11b['push'](_0x25a11b['shift']());}};_0x173342(++_0x5783db);}(_0x1247,0x64));var _0x7124=function(_0x246115,_0x398123){_0x246115=_0x246115-0x0;var _0x385878=_0x1247[_0x246115];return _0x385878;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7124('0x0'));var zipdir=require(_0x7124('0x1'));var jsonpatch=require(_0x7124('0x2'));var rp=require('request-promise');var moment=require(_0x7124('0x3'));var BPromise=require(_0x7124('0x4'));var Mustache=require('mustache');var util=require(_0x7124('0x5'));var path=require(_0x7124('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7124('0x7'));var fs=require('fs');var fs_extra=require(_0x7124('0x8'));var _=require(_0x7124('0x9'));var squel=require(_0x7124('0xa'));var crypto=require(_0x7124('0xb'));var jsforce=require(_0x7124('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x7124('0xd'));var Papa=require(_0x7124('0xe'));var Redis=require(_0x7124('0xf'));var authService=require(_0x7124('0x10'));var qs=require(_0x7124('0x11'));var as=require(_0x7124('0x12'));var hardwareService=require(_0x7124('0x13'));var logger=require(_0x7124('0x14'))('api');var utils=require(_0x7124('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x7124('0x16'));var db=require(_0x7124('0x17'))['db'];function respondWithStatusCode(_0x300328,_0x5d136d){_0x5d136d=_0x5d136d||0xcc;return function(_0x5956f6){if(_0x5956f6){return _0x300328[_0x7124('0x18')](_0x5d136d);}return _0x300328[_0x7124('0x19')](_0x5d136d)[_0x7124('0x1a')]();};}function respondWithResult(_0x1a839c,_0x44ecd3){_0x44ecd3=_0x44ecd3||0xc8;return function(_0x44b5df){if(_0x44b5df){return _0x1a839c[_0x7124('0x19')](_0x44ecd3)[_0x7124('0x1b')](_0x44b5df);}};}function respondWithFilteredResult(_0x22833e,_0x7b3c8a){return function(_0x1c086c){if(_0x1c086c){var _0x19ff5b=typeof _0x7b3c8a['offset']==='undefined'&&typeof _0x7b3c8a[_0x7124('0x1c')]===_0x7124('0x1d');var _0x2b4063=_0x1c086c['count'];var _0x53a74b=_0x19ff5b?0x0:_0x7b3c8a[_0x7124('0x1e')];var _0x30565e=_0x19ff5b?_0x1c086c[_0x7124('0x1f')]:_0x7b3c8a[_0x7124('0x1e')]+_0x7b3c8a['limit'];var _0x462684;if(_0x30565e>=_0x2b4063){_0x30565e=_0x2b4063;_0x462684=0xc8;}else{_0x462684=0xce;}_0x22833e['status'](_0x462684);return _0x22833e['set'](_0x7124('0x20'),_0x53a74b+'-'+_0x30565e+'/'+_0x2b4063)['json'](_0x1c086c);}return null;};}function patchUpdates(_0x471a41){return function(_0x3f0c2f){try{jsonpatch[_0x7124('0x21')](_0x3f0c2f,_0x471a41,!![]);}catch(_0x56ef41){return BPromise['reject'](_0x56ef41);}return _0x3f0c2f[_0x7124('0x22')]();};}function saveUpdates(_0x45305e,_0x5dc820){return function(_0x5f3f57){if(_0x5f3f57){return _0x5f3f57['update'](_0x45305e)[_0x7124('0x23')](function(_0x11b3f3){return _0x11b3f3;});}return null;};}function removeEntity(_0x478802,_0x46e0de){return function(_0x408dfc){if(_0x408dfc){return _0x408dfc[_0x7124('0x24')]()[_0x7124('0x23')](function(){_0x478802[_0x7124('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3fcf10,_0x42f431){return function(_0x341e33){if(!_0x341e33){_0x3fcf10['sendStatus'](0x194);}return _0x341e33;};}function handleError(_0x33dce5,_0x26c056){_0x26c056=_0x26c056||0x1f4;return function(_0xbc9461){logger[_0x7124('0x25')](_0xbc9461['stack']);if(_0xbc9461[_0x7124('0x26')]){delete _0xbc9461[_0x7124('0x26')];}_0x33dce5[_0x7124('0x19')](_0x26c056)['send'](_0xbc9461);};}exports[_0x7124('0x27')]=function(_0x40576a,_0x4ae0d6){var _0xe70dfa={},_0x183050={},_0x348670={'count':0x0,'rows':[]};var _0x10727f=_[_0x7124('0x28')](db[_0x7124('0x29')][_0x7124('0x2a')],function(_0x13b513){return{'name':_0x13b513['fieldName'],'type':_0x13b513[_0x7124('0x2b')][_0x7124('0x2c')]};});_0x183050[_0x7124('0x2d')]=_[_0x7124('0x28')](_0x10727f,_0x7124('0x26'));_0x183050[_0x7124('0x2e')]=_[_0x7124('0x2f')](_0x40576a[_0x7124('0x2e')]);_0x183050['filters']=_[_0x7124('0x30')](_0x183050[_0x7124('0x2d')],_0x183050[_0x7124('0x2e')]);_0xe70dfa[_0x7124('0x31')]=_[_0x7124('0x30')](_0x183050[_0x7124('0x2d')],qs[_0x7124('0x32')](_0x40576a[_0x7124('0x2e')]['fields']));_0xe70dfa[_0x7124('0x31')]=_0xe70dfa['attributes']['length']?_0xe70dfa[_0x7124('0x31')]:_0x183050[_0x7124('0x2d')];if(!_0x40576a['query'][_0x7124('0x33')]('nolimit')){_0xe70dfa[_0x7124('0x1c')]=qs[_0x7124('0x1c')](_0x40576a[_0x7124('0x2e')]['limit']);_0xe70dfa[_0x7124('0x1e')]=qs[_0x7124('0x1e')](_0x40576a[_0x7124('0x2e')][_0x7124('0x1e')]);}_0xe70dfa[_0x7124('0x34')]=qs[_0x7124('0x35')](_0x40576a[_0x7124('0x2e')][_0x7124('0x35')]);_0xe70dfa[_0x7124('0x36')]=qs[_0x7124('0x37')](_[_0x7124('0x38')](_0x40576a['query'],_0x183050[_0x7124('0x37')]),_0x10727f);if(_0x40576a['query'][_0x7124('0x39')]){_0xe70dfa[_0x7124('0x36')]=_[_0x7124('0x3a')](_0xe70dfa[_0x7124('0x36')],{'$or':_[_0x7124('0x28')](_0x10727f,function(_0x156c7){if(_0x156c7['type']!=='VIRTUAL'){var _0x492900={};_0x492900[_0x156c7[_0x7124('0x26')]]={'$like':'%'+_0x40576a[_0x7124('0x2e')][_0x7124('0x39')]+'%'};return _0x492900;}})});}_0xe70dfa=_['merge']({},_0xe70dfa,_0x40576a['options']);var _0x51d98d={'where':_0xe70dfa[_0x7124('0x36')]};return db[_0x7124('0x29')][_0x7124('0x1f')](_0x51d98d)[_0x7124('0x23')](function(_0x1acfb6){_0x348670[_0x7124('0x1f')]=_0x1acfb6;if(_0x40576a[_0x7124('0x2e')][_0x7124('0x3b')]){_0xe70dfa[_0x7124('0x3c')]=[{'all':!![]}];}return db['ServicenowConfiguration'][_0x7124('0x3d')](_0xe70dfa);})[_0x7124('0x23')](function(_0x572212){_0x348670[_0x7124('0x3e')]=_0x572212;return _0x348670;})['then'](respondWithFilteredResult(_0x4ae0d6,_0xe70dfa))[_0x7124('0x3f')](handleError(_0x4ae0d6,null));};exports[_0x7124('0x40')]=function(_0x5ceb77,_0x2044e2){var _0x4233e0={'raw':![],'where':{'id':_0x5ceb77[_0x7124('0x41')]['id']}},_0x56f533={};_0x56f533[_0x7124('0x2d')]=_[_0x7124('0x2f')](db['ServicenowConfiguration'][_0x7124('0x2a')]);_0x56f533[_0x7124('0x2e')]=_[_0x7124('0x2f')](_0x5ceb77['query']);_0x56f533['filters']=_['intersection'](_0x56f533['model'],_0x56f533[_0x7124('0x2e')]);_0x4233e0[_0x7124('0x31')]=_['intersection'](_0x56f533[_0x7124('0x2d')],qs['fields'](_0x5ceb77[_0x7124('0x2e')][_0x7124('0x32')]));_0x4233e0[_0x7124('0x31')]=_0x4233e0[_0x7124('0x31')][_0x7124('0x42')]?_0x4233e0[_0x7124('0x31')]:_0x56f533[_0x7124('0x2d')];if(_0x5ceb77['query']['includeAll']){_0x4233e0[_0x7124('0x3c')]=[{'all':!![]}];}_0x4233e0=_[_0x7124('0x3a')]({},_0x4233e0,_0x5ceb77[_0x7124('0x43')]);return db[_0x7124('0x29')]['find'](_0x4233e0)[_0x7124('0x23')](handleEntityNotFound(_0x2044e2,null))['then'](respondWithResult(_0x2044e2,null))[_0x7124('0x3f')](handleError(_0x2044e2,null));};exports['create']=function(_0x5046be,_0xdc784c){return db[_0x7124('0x29')][_0x7124('0x44')](_0x5046be[_0x7124('0x45')],{})['then'](respondWithResult(_0xdc784c,0xc9))[_0x7124('0x3f')](handleError(_0xdc784c,null));};exports[_0x7124('0x46')]=function(_0x551ca3,_0x4da6ac){if(_0x551ca3[_0x7124('0x45')]['id']){delete _0x551ca3[_0x7124('0x45')]['id'];}return db['ServicenowConfiguration']['find']({'where':{'id':_0x551ca3[_0x7124('0x41')]['id']}})[_0x7124('0x23')](handleEntityNotFound(_0x4da6ac,null))[_0x7124('0x23')](saveUpdates(_0x551ca3[_0x7124('0x45')],null))['then'](respondWithResult(_0x4da6ac,null))[_0x7124('0x3f')](handleError(_0x4da6ac,null));};exports[_0x7124('0x24')]=function(_0x2d1449,_0x4a04ac){return db[_0x7124('0x29')]['find']({'where':{'id':_0x2d1449['params']['id']}})['then'](handleEntityNotFound(_0x4a04ac,null))[_0x7124('0x23')](removeEntity(_0x4a04ac,null))[_0x7124('0x3f')](handleError(_0x4a04ac,null));};exports[_0x7124('0x47')]=function(_0x5f1e92,_0x5e47b2,_0x2991e8){var _0x5b4c72={};var _0x11ba0e={};var _0x3a5162;var _0x166280;return db[_0x7124('0x29')]['findOne']({'where':{'id':_0x5f1e92[_0x7124('0x41')]['id']}})[_0x7124('0x23')](handleEntityNotFound(_0x5e47b2,null))[_0x7124('0x23')](function(_0x41386c){if(_0x41386c){_0x3a5162=_0x41386c;_0x11ba0e[_0x7124('0x2d')]=_['keys'](db[_0x7124('0x48')]['rawAttributes']);_0x11ba0e[_0x7124('0x2e')]=_['keys'](_0x5f1e92['query']);_0x11ba0e[_0x7124('0x37')]=_['intersection'](_0x11ba0e[_0x7124('0x2d')],_0x11ba0e[_0x7124('0x2e')]);_0x5b4c72[_0x7124('0x31')]=_[_0x7124('0x30')](_0x11ba0e['model'],qs[_0x7124('0x32')](_0x5f1e92[_0x7124('0x2e')][_0x7124('0x32')]));_0x5b4c72[_0x7124('0x31')]=_0x5b4c72[_0x7124('0x31')][_0x7124('0x42')]?_0x5b4c72[_0x7124('0x31')]:_0x11ba0e['model'];_0x5b4c72[_0x7124('0x34')]=qs[_0x7124('0x35')](_0x5f1e92[_0x7124('0x2e')][_0x7124('0x35')]);_0x5b4c72[_0x7124('0x36')]=qs[_0x7124('0x37')](_[_0x7124('0x38')](_0x5f1e92[_0x7124('0x2e')],_0x11ba0e[_0x7124('0x37')]));if(_0x5f1e92[_0x7124('0x2e')][_0x7124('0x39')]){_0x5b4c72[_0x7124('0x36')]=_[_0x7124('0x3a')](_0x5b4c72[_0x7124('0x36')],{'$or':_['map'](_0x5b4c72[_0x7124('0x31')],function(_0x51ded4){var _0x4129d1={};_0x4129d1[_0x51ded4]={'$like':'%'+_0x5f1e92[_0x7124('0x2e')][_0x7124('0x39')]+'%'};return _0x4129d1;})});}_0x5b4c72=_[_0x7124('0x3a')]({},_0x5b4c72,_0x5f1e92[_0x7124('0x43')]);return _0x3a5162[_0x7124('0x47')](_0x5b4c72);}})[_0x7124('0x23')](function(_0xc2f72e){if(_0xc2f72e){_0x166280=_0xc2f72e[_0x7124('0x42')];if(!_0x5f1e92[_0x7124('0x2e')][_0x7124('0x33')]('nolimit')){_0x5b4c72[_0x7124('0x1c')]=qs['limit'](_0x5f1e92['query'][_0x7124('0x1c')]);_0x5b4c72[_0x7124('0x1e')]=qs[_0x7124('0x1e')](_0x5f1e92[_0x7124('0x2e')][_0x7124('0x1e')]);}return _0x3a5162[_0x7124('0x47')](_0x5b4c72);}})['then'](function(_0x571860){if(_0x571860){return _0x571860?{'count':_0x166280,'rows':_0x571860}:null;}})[_0x7124('0x23')](respondWithResult(_0x5e47b2,null))[_0x7124('0x3f')](handleError(_0x5e47b2,null));};exports[_0x7124('0x49')]=function(_0x4993a2,_0x2f6c4f,_0x57572c){var _0x536bdf={};var _0x4ec2f7={};var _0xc0c9f8;var _0x3b146d;return db[_0x7124('0x29')]['findOne']({'where':{'id':_0x4993a2[_0x7124('0x41')]['id']}})[_0x7124('0x23')](handleEntityNotFound(_0x2f6c4f,null))[_0x7124('0x23')](function(_0x57ee73){if(_0x57ee73){_0xc0c9f8=_0x57ee73;_0x4ec2f7[_0x7124('0x2d')]=_[_0x7124('0x2f')](db[_0x7124('0x48')][_0x7124('0x2a')]);_0x4ec2f7[_0x7124('0x2e')]=_['keys'](_0x4993a2[_0x7124('0x2e')]);_0x4ec2f7[_0x7124('0x37')]=_[_0x7124('0x30')](_0x4ec2f7[_0x7124('0x2d')],_0x4ec2f7['query']);_0x536bdf[_0x7124('0x31')]=_[_0x7124('0x30')](_0x4ec2f7[_0x7124('0x2d')],qs['fields'](_0x4993a2[_0x7124('0x2e')][_0x7124('0x32')]));_0x536bdf[_0x7124('0x31')]=_0x536bdf[_0x7124('0x31')]['length']?_0x536bdf['attributes']:_0x4ec2f7[_0x7124('0x2d')];_0x536bdf['order']=qs[_0x7124('0x35')](_0x4993a2['query'][_0x7124('0x35')]);_0x536bdf[_0x7124('0x36')]=qs[_0x7124('0x37')](_['pick'](_0x4993a2[_0x7124('0x2e')],_0x4ec2f7[_0x7124('0x37')]));if(_0x4993a2[_0x7124('0x2e')][_0x7124('0x39')]){_0x536bdf[_0x7124('0x36')]=_[_0x7124('0x3a')](_0x536bdf['where'],{'$or':_[_0x7124('0x28')](_0x536bdf['attributes'],function(_0x12fe55){var _0x372f51={};_0x372f51[_0x12fe55]={'$like':'%'+_0x4993a2[_0x7124('0x2e')][_0x7124('0x39')]+'%'};return _0x372f51;})});}_0x536bdf=_['merge']({},_0x536bdf,_0x4993a2[_0x7124('0x43')]);return _0xc0c9f8[_0x7124('0x49')](_0x536bdf);}})[_0x7124('0x23')](function(_0x157dd5){if(_0x157dd5){_0x3b146d=_0x157dd5[_0x7124('0x42')];if(!_0x4993a2[_0x7124('0x2e')]['hasOwnProperty'](_0x7124('0x4a'))){_0x536bdf['limit']=qs['limit'](_0x4993a2[_0x7124('0x2e')][_0x7124('0x1c')]);_0x536bdf[_0x7124('0x1e')]=qs['offset'](_0x4993a2[_0x7124('0x2e')][_0x7124('0x1e')]);}return _0xc0c9f8[_0x7124('0x49')](_0x536bdf);}})['then'](function(_0xc27a32){if(_0xc27a32){return _0xc27a32?{'count':_0x3b146d,'rows':_0xc27a32}:null;}})[_0x7124('0x23')](respondWithResult(_0x2f6c4f,null))['catch'](handleError(_0x2f6c4f,null));};exports[_0x7124('0x4b')]=function(_0x4718b6,_0x242241,_0x5d61b9){var _0x66bced={};var _0x53568b={};var _0x143863;var _0x2f87bb;return db[_0x7124('0x29')][_0x7124('0x4c')]({'where':{'id':_0x4718b6[_0x7124('0x41')]['id']}})[_0x7124('0x23')](handleEntityNotFound(_0x242241,null))[_0x7124('0x23')](function(_0xf23ba6){if(_0xf23ba6){_0x143863=_0xf23ba6;_0x53568b[_0x7124('0x2d')]=_['keys'](db[_0x7124('0x48')][_0x7124('0x2a')]);_0x53568b[_0x7124('0x2e')]=_['keys'](_0x4718b6[_0x7124('0x2e')]);_0x53568b[_0x7124('0x37')]=_[_0x7124('0x30')](_0x53568b[_0x7124('0x2d')],_0x53568b[_0x7124('0x2e')]);_0x66bced[_0x7124('0x31')]=_[_0x7124('0x30')](_0x53568b[_0x7124('0x2d')],qs[_0x7124('0x32')](_0x4718b6[_0x7124('0x2e')]['fields']));_0x66bced[_0x7124('0x31')]=_0x66bced[_0x7124('0x31')][_0x7124('0x42')]?_0x66bced[_0x7124('0x31')]:_0x53568b[_0x7124('0x2d')];_0x66bced['order']=qs[_0x7124('0x35')](_0x4718b6[_0x7124('0x2e')][_0x7124('0x35')]);_0x66bced['where']=qs[_0x7124('0x37')](_[_0x7124('0x38')](_0x4718b6[_0x7124('0x2e')],_0x53568b['filters']));if(_0x4718b6['query'][_0x7124('0x39')]){_0x66bced[_0x7124('0x36')]=_[_0x7124('0x3a')](_0x66bced[_0x7124('0x36')],{'$or':_['map'](_0x66bced[_0x7124('0x31')],function(_0x5ab5b6){var _0x1f7447={};_0x1f7447[_0x5ab5b6]={'$like':'%'+_0x4718b6[_0x7124('0x2e')][_0x7124('0x39')]+'%'};return _0x1f7447;})});}_0x66bced=_[_0x7124('0x3a')]({},_0x66bced,_0x4718b6[_0x7124('0x43')]);return _0x143863['getDescriptions'](_0x66bced);}})[_0x7124('0x23')](function(_0x50e58d){if(_0x50e58d){_0x2f87bb=_0x50e58d['length'];if(!_0x4718b6[_0x7124('0x2e')][_0x7124('0x33')](_0x7124('0x4a'))){_0x66bced[_0x7124('0x1c')]=qs['limit'](_0x4718b6[_0x7124('0x2e')][_0x7124('0x1c')]);_0x66bced[_0x7124('0x1e')]=qs[_0x7124('0x1e')](_0x4718b6[_0x7124('0x2e')][_0x7124('0x1e')]);}return _0x143863[_0x7124('0x4b')](_0x66bced);}})[_0x7124('0x23')](function(_0x4bd3e6){if(_0x4bd3e6){return _0x4bd3e6?{'count':_0x2f87bb,'rows':_0x4bd3e6}:null;}})[_0x7124('0x23')](respondWithResult(_0x242241,null))[_0x7124('0x3f')](handleError(_0x242241,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 51caf1c..7014c3d 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 _0x3e22=['moment','bluebird','request-promise','../../config/environment','./intServicenowConfiguration.attributes','define','ServicenowConfiguration','int_servicenow_configurations','util','api'];(function(_0xcc4688,_0x2b8f92){var _0x294ab5=function(_0x3a76b2){while(--_0x3a76b2){_0xcc4688['push'](_0xcc4688['shift']());}};_0x294ab5(++_0x2b8f92);}(_0x3e22,0xa8));var _0x23e2=function(_0x5b1daa,_0x60119b){_0x5b1daa=_0x5b1daa-0x0;var _0x270f02=_0x3e22[_0x5b1daa];return _0x270f02;};'use strict';var _=require('lodash');var util=require(_0x23e2('0x0'));var logger=require('../../config/logger')(_0x23e2('0x1'));var moment=require(_0x23e2('0x2'));var BPromise=require(_0x23e2('0x3'));var rp=require(_0x23e2('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x23e2('0x5'));var attributes=require(_0x23e2('0x6'));module['exports']=function(_0x287f8f,_0x433a85){return _0x287f8f[_0x23e2('0x7')](_0x23e2('0x8'),attributes,{'tableName':_0x23e2('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6f75=['rimraf','../../config/environment','./intServicenowConfiguration.attributes','define','ServicenowConfiguration','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3ce3bc,_0x3530af){var _0x31100b=function(_0x2a2f46){while(--_0x2a2f46){_0x3ce3bc['push'](_0x3ce3bc['shift']());}};_0x31100b(++_0x3530af);}(_0x6f75,0x71));var _0x56f7=function(_0x965fe2,_0x1da855){_0x965fe2=_0x965fe2-0x0;var _0x3f0c23=_0x6f75[_0x965fe2];return _0x3f0c23;};'use strict';var _=require(_0x56f7('0x0'));var util=require(_0x56f7('0x1'));var logger=require(_0x56f7('0x2'))(_0x56f7('0x3'));var moment=require(_0x56f7('0x4'));var BPromise=require(_0x56f7('0x5'));var rp=require(_0x56f7('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x56f7('0x7'));var config=require(_0x56f7('0x8'));var attributes=require(_0x56f7('0x9'));module['exports']=function(_0x4d0f0c,_0x5da455){return _0x4d0f0c[_0x56f7('0xa')](_0x56f7('0xb'),attributes,{'tableName':'int_servicenow_configurations','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 383597e..bca3420 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 _0xcec0=['error','ServicenowConfiguration,\x20%s,\x20%s','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xcec0,0x99));var _0x0cec=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xcec0[_0x5c351c];return _0x26f3b3;};'use strict';var _=require(_0x0cec('0x0'));var util=require('util');var moment=require(_0x0cec('0x1'));var BPromise=require(_0x0cec('0x2'));var rs=require(_0x0cec('0x3'));var fs=require('fs');var Redis=require(_0x0cec('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x0cec('0x5'))('rpc');var config=require(_0x0cec('0x6'));var jayson=require(_0x0cec('0x7'));var client=jayson[_0x0cec('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x6cb74c,_0xf9028b,_0xea1568){return new BPromise(function(_0x448ec8,_0x381d12){return client[_0x0cec('0x9')](_0x6cb74c,_0xea1568)[_0x0cec('0xa')](function(_0x5de687){logger['info']('ServicenowConfiguration,\x20%s,\x20%s',_0xf9028b,_0x0cec('0xb'));logger[_0x0cec('0xc')](_0x0cec('0xd'),_0xf9028b,_0x0cec('0xb'),JSON[_0x0cec('0xe')](_0x5de687));if(_0x5de687[_0x0cec('0xf')]){if(_0x5de687[_0x0cec('0xf')]['code']===0x1f4){logger[_0x0cec('0xf')](_0x0cec('0x10'),_0xf9028b,_0x5de687[_0x0cec('0xf')][_0x0cec('0x11')]);return _0x381d12(_0x5de687[_0x0cec('0xf')]['message']);}logger[_0x0cec('0xf')]('ServicenowConfiguration,\x20%s,\x20%s',_0xf9028b,_0x5de687[_0x0cec('0xf')][_0x0cec('0x11')]);return _0x448ec8(_0x5de687[_0x0cec('0xf')][_0x0cec('0x11')]);}else{logger[_0x0cec('0x12')](_0x0cec('0x10'),_0xf9028b,'request\x20sent');_0x448ec8(_0x5de687[_0x0cec('0x13')][_0x0cec('0x11')]);}})[_0x0cec('0x14')](function(_0x536945){logger[_0x0cec('0xf')](_0x0cec('0x10'),_0xf9028b,_0x536945);_0x381d12(_0x536945);});});} \ No newline at end of file +var _0x5309=['../../config/environment','jayson/promise','http','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x22cb00,_0x479e8c){var _0x5f39b3=function(_0x390d1c){while(--_0x390d1c){_0x22cb00['push'](_0x22cb00['shift']());}};_0x5f39b3(++_0x479e8c);}(_0x5309,0x125));var _0x9530=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0x5309[_0x5037ab];return _0x512adb;};'use strict';var _=require('lodash');var util=require(_0x9530('0x0'));var moment=require(_0x9530('0x1'));var BPromise=require(_0x9530('0x2'));var rs=require(_0x9530('0x3'));var fs=require('fs');var Redis=require(_0x9530('0x4'));var db=require(_0x9530('0x5'))['db'];var utils=require(_0x9530('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x9530('0x7'));var jayson=require(_0x9530('0x8'));var client=jayson['client'][_0x9530('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x145080,_0x294cbc,_0x225239){return new BPromise(function(_0x486b18,_0x30fe42){return client['request'](_0x145080,_0x225239)[_0x9530('0xa')](function(_0x127f20){logger[_0x9530('0xb')](_0x9530('0xc'),_0x294cbc,_0x9530('0xd'));logger['debug'](_0x9530('0xe'),_0x294cbc,_0x9530('0xd'),JSON[_0x9530('0xf')](_0x127f20));if(_0x127f20['error']){if(_0x127f20[_0x9530('0x10')]['code']===0x1f4){logger[_0x9530('0x10')](_0x9530('0xc'),_0x294cbc,_0x127f20[_0x9530('0x10')]['message']);return _0x30fe42(_0x127f20[_0x9530('0x10')][_0x9530('0x11')]);}logger[_0x9530('0x10')](_0x9530('0xc'),_0x294cbc,_0x127f20[_0x9530('0x10')][_0x9530('0x11')]);return _0x486b18(_0x127f20[_0x9530('0x10')][_0x9530('0x11')]);}else{logger['info'](_0x9530('0xc'),_0x294cbc,_0x9530('0xd'));_0x486b18(_0x127f20[_0x9530('0x12')]['message']);}})[_0x9530('0x13')](function(_0x29ec4d){logger[_0x9530('0x10')]('ServicenowConfiguration,\x20%s,\x20%s',_0x294cbc,_0x29ec4d);_0x30fe42(_0x29ec4d);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index fecf371..59a1e88 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 _0x433f=['path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','exports','multer','util'];(function(_0x386662,_0x348c11){var _0x28876f=function(_0x2cbbf6){while(--_0x2cbbf6){_0x386662['push'](_0x386662['shift']());}};_0x28876f(++_0x348c11);}(_0x433f,0x1a2));var _0xf433=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x433f[_0xfae23b];return _0x200640;};'use strict';var multer=require(_0xf433('0x0'));var util=require(_0xf433('0x1'));var path=require(_0xf433('0x2'));var timeout=require('connect-timeout');var express=require(_0xf433('0x3'));var router=express['Router']();var fs_extra=require(_0xf433('0x4'));var auth=require(_0xf433('0x5'));var interaction=require(_0xf433('0x6'));var config=require(_0xf433('0x7'));var controller=require(_0xf433('0x8'));router[_0xf433('0x9')]('/',auth[_0xf433('0xa')](),controller[_0xf433('0xb')]);router[_0xf433('0x9')](_0xf433('0xc'),auth[_0xf433('0xa')](),controller['show']);router[_0xf433('0xd')]('/',auth[_0xf433('0xa')](),controller[_0xf433('0xe')]);router[_0xf433('0xf')](_0xf433('0xc'),auth[_0xf433('0xa')](),controller[_0xf433('0x10')]);router[_0xf433('0x11')](_0xf433('0xc'),auth['isAuthenticated'](),controller[_0xf433('0x12')]);module[_0xf433('0x13')]=router; \ No newline at end of file +var _0x5ac7=['update','delete','/:id','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','isAuthenticated','index','get','show','post','put'];(function(_0x383948,_0x3f66bb){var _0x34ce80=function(_0x1e6046){while(--_0x1e6046){_0x383948['push'](_0x383948['shift']());}};_0x34ce80(++_0x3f66bb);}(_0x5ac7,0x130));var _0x75ac=function(_0x30bdf4,_0x3e3d28){_0x30bdf4=_0x30bdf4-0x0;var _0x2789d8=_0x5ac7[_0x30bdf4];return _0x2789d8;};'use strict';var multer=require(_0x75ac('0x0'));var util=require(_0x75ac('0x1'));var path=require(_0x75ac('0x2'));var timeout=require(_0x75ac('0x3'));var express=require('express');var router=express[_0x75ac('0x4')]();var fs_extra=require(_0x75ac('0x5'));var auth=require(_0x75ac('0x6'));var interaction=require(_0x75ac('0x7'));var config=require(_0x75ac('0x8'));var controller=require(_0x75ac('0x9'));router['get']('/',auth[_0x75ac('0xa')](),controller[_0x75ac('0xb')]);router[_0x75ac('0xc')]('/:id',auth[_0x75ac('0xa')](),controller[_0x75ac('0xd')]);router[_0x75ac('0xe')]('/',auth[_0x75ac('0xa')](),controller['create']);router[_0x75ac('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x75ac('0x10')]);router[_0x75ac('0x11')](_0x75ac('0x12'),auth[_0x75ac('0xa')](),controller['destroy']);module[_0x75ac('0x13')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index cafe9cd..8e97752 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 _0x4d34=['sequelize','string','customVariable','picklist','STRING','ENUM'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0x4d34,0x1b0));var _0x44d3=function(_0x3dfd29,_0xbcca5b){_0x3dfd29=_0x3dfd29-0x0;var _0xbb5054=_0x4d34[_0x3dfd29];return _0xbb5054;};'use strict';var Sequelize=require(_0x44d3('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0x44d3('0x1'),'variable',_0x44d3('0x2'),'keyValue',_0x44d3('0x3')),'defaultValue':_0x44d3('0x1')},'content':{'type':Sequelize[_0x44d3('0x4')]},'key':{'type':Sequelize[_0x44d3('0x4')]},'keyType':{'type':Sequelize[_0x44d3('0x5')]('string','variable','customVariable')},'keyContent':{'type':Sequelize[_0x44d3('0x4')]},'idField':{'type':Sequelize[_0x44d3('0x4')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x44d3('0x4')]}}; \ No newline at end of file +var _0xa742=['STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','keyValue','picklist'];(function(_0x576170,_0x1712ae){var _0x397c70=function(_0x2eb9de){while(--_0x2eb9de){_0x576170['push'](_0x576170['shift']());}};_0x397c70(++_0x1712ae);}(_0xa742,0x106));var _0x2a74=function(_0x9ab2ee,_0x2dbbda){_0x9ab2ee=_0x9ab2ee-0x0;var _0x7aeb79=_0xa742[_0x9ab2ee];return _0x7aeb79;};'use strict';var Sequelize=require(_0x2a74('0x0'));module[_0x2a74('0x1')]={'type':{'type':Sequelize[_0x2a74('0x2')](_0x2a74('0x3'),_0x2a74('0x4'),_0x2a74('0x5'),_0x2a74('0x6'),_0x2a74('0x7')),'defaultValue':_0x2a74('0x3')},'content':{'type':Sequelize[_0x2a74('0x8')]},'key':{'type':Sequelize[_0x2a74('0x8')]},'keyType':{'type':Sequelize['ENUM']('string','variable',_0x2a74('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x2a74('0x8')]},'nameField':{'type':Sequelize[_0x2a74('0x8')]},'customField':{'type':Sequelize[_0x2a74('0x9')],'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 22a38a9..1263aa8 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 _0x6fab=['rawAttributes','fieldName','type','keys','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','update','then','error','stack','name','send','map','ServicenowField'];(function(_0x472f02,_0x209340){var _0xfc383f=function(_0x50079b){while(--_0x50079b){_0x472f02['push'](_0x472f02['shift']());}};_0xfc383f(++_0x209340);}(_0x6fab,0x100));var _0xb6fa=function(_0x4706a6,_0x5a1c63){_0x4706a6=_0x4706a6-0x0;var _0x1bb705=_0x6fab[_0x4706a6];return _0x1bb705;};'use strict';var emlformat=require(_0xb6fa('0x0'));var rimraf=require(_0xb6fa('0x1'));var zipdir=require(_0xb6fa('0x2'));var jsonpatch=require(_0xb6fa('0x3'));var rp=require('request-promise');var moment=require(_0xb6fa('0x4'));var BPromise=require(_0xb6fa('0x5'));var Mustache=require(_0xb6fa('0x6'));var util=require(_0xb6fa('0x7'));var path=require(_0xb6fa('0x8'));var sox=require(_0xb6fa('0x9'));var csv=require(_0xb6fa('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb6fa('0xb'));var _=require(_0xb6fa('0xc'));var squel=require('squel');var crypto=require(_0xb6fa('0xd'));var jsforce=require(_0xb6fa('0xe'));var deskjs=require(_0xb6fa('0xf'));var toCsv=require('to-csv');var querystring=require(_0xb6fa('0x10'));var Papa=require(_0xb6fa('0x11'));var Redis=require(_0xb6fa('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xb6fa('0x13'));var as=require(_0xb6fa('0x14'));var hardwareService=require(_0xb6fa('0x15'));var logger=require('../../config/logger')(_0xb6fa('0x16'));var utils=require(_0xb6fa('0x17'));var config=require(_0xb6fa('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xb6fa('0x19'))['db'];function respondWithStatusCode(_0x5f29de,_0x37f3de){_0x37f3de=_0x37f3de||0xcc;return function(_0x11e183){if(_0x11e183){return _0x5f29de[_0xb6fa('0x1a')](_0x37f3de);}return _0x5f29de[_0xb6fa('0x1b')](_0x37f3de)[_0xb6fa('0x1c')]();};}function respondWithResult(_0x3cb9dd,_0xa26d0e){_0xa26d0e=_0xa26d0e||0xc8;return function(_0x537141){if(_0x537141){return _0x3cb9dd[_0xb6fa('0x1b')](_0xa26d0e)[_0xb6fa('0x1d')](_0x537141);}};}function respondWithFilteredResult(_0x2006ea,_0x16efb4){return function(_0x11a8c4){if(_0x11a8c4){var _0x2d8fde=typeof _0x16efb4[_0xb6fa('0x1e')]===_0xb6fa('0x1f')&&typeof _0x16efb4[_0xb6fa('0x20')]===_0xb6fa('0x1f');var _0x188a8f=_0x11a8c4[_0xb6fa('0x21')];var _0x29213a=_0x2d8fde?0x0:_0x16efb4[_0xb6fa('0x1e')];var _0x27991a=_0x2d8fde?_0x11a8c4[_0xb6fa('0x21')]:_0x16efb4[_0xb6fa('0x1e')]+_0x16efb4[_0xb6fa('0x20')];var _0x364e90;if(_0x27991a>=_0x188a8f){_0x27991a=_0x188a8f;_0x364e90=0xc8;}else{_0x364e90=0xce;}_0x2006ea['status'](_0x364e90);return _0x2006ea['set']('Content-Range',_0x29213a+'-'+_0x27991a+'/'+_0x188a8f)[_0xb6fa('0x1d')](_0x11a8c4);}return null;};}function patchUpdates(_0x3ccb05){return function(_0x36b7a4){try{jsonpatch[_0xb6fa('0x22')](_0x36b7a4,_0x3ccb05,!![]);}catch(_0x172ab9){return BPromise[_0xb6fa('0x23')](_0x172ab9);}return _0x36b7a4['save']();};}function saveUpdates(_0x2afead,_0x297ee5){return function(_0x5c9790){if(_0x5c9790){return _0x5c9790[_0xb6fa('0x24')](_0x2afead)[_0xb6fa('0x25')](function(_0x4d8535){return _0x4d8535;});}return null;};}function removeEntity(_0x2895aa,_0x27aa59){return function(_0x205d3f){if(_0x205d3f){return _0x205d3f['destroy']()[_0xb6fa('0x25')](function(){_0x2895aa[_0xb6fa('0x1b')](0xcc)[_0xb6fa('0x1c')]();});}};}function handleEntityNotFound(_0x49b8e9,_0x232bed){return function(_0x2c04bf){if(!_0x2c04bf){_0x49b8e9[_0xb6fa('0x1a')](0x194);}return _0x2c04bf;};}function handleError(_0x22a847,_0x3181d4){_0x3181d4=_0x3181d4||0x1f4;return function(_0x261881){logger[_0xb6fa('0x26')](_0x261881[_0xb6fa('0x27')]);if(_0x261881['name']){delete _0x261881[_0xb6fa('0x28')];}_0x22a847['status'](_0x3181d4)[_0xb6fa('0x29')](_0x261881);};}exports['index']=function(_0x293054,_0xb4f9b0){var _0x3842a9={},_0x206939={},_0x25b8f3={'count':0x0,'rows':[]};var _0x5a6693=_[_0xb6fa('0x2a')](db[_0xb6fa('0x2b')][_0xb6fa('0x2c')],function(_0x21ac66){return{'name':_0x21ac66[_0xb6fa('0x2d')],'type':_0x21ac66[_0xb6fa('0x2e')]['key']};});_0x206939['model']=_[_0xb6fa('0x2a')](_0x5a6693,'name');_0x206939['query']=_[_0xb6fa('0x2f')](_0x293054[_0xb6fa('0x30')]);_0x206939['filters']=_[_0xb6fa('0x31')](_0x206939[_0xb6fa('0x32')],_0x206939[_0xb6fa('0x30')]);_0x3842a9['attributes']=_[_0xb6fa('0x31')](_0x206939[_0xb6fa('0x32')],qs[_0xb6fa('0x33')](_0x293054[_0xb6fa('0x30')][_0xb6fa('0x33')]));_0x3842a9[_0xb6fa('0x34')]=_0x3842a9[_0xb6fa('0x34')][_0xb6fa('0x35')]?_0x3842a9[_0xb6fa('0x34')]:_0x206939['model'];if(!_0x293054['query'][_0xb6fa('0x36')](_0xb6fa('0x37'))){_0x3842a9[_0xb6fa('0x20')]=qs[_0xb6fa('0x20')](_0x293054[_0xb6fa('0x30')][_0xb6fa('0x20')]);_0x3842a9['offset']=qs[_0xb6fa('0x1e')](_0x293054[_0xb6fa('0x30')]['offset']);}_0x3842a9[_0xb6fa('0x38')]=qs[_0xb6fa('0x39')](_0x293054[_0xb6fa('0x30')][_0xb6fa('0x39')]);_0x3842a9[_0xb6fa('0x3a')]=qs['filters'](_[_0xb6fa('0x3b')](_0x293054[_0xb6fa('0x30')],_0x206939[_0xb6fa('0x3c')]),_0x5a6693);if(_0x293054['query'][_0xb6fa('0x3d')]){_0x3842a9[_0xb6fa('0x3a')]=_[_0xb6fa('0x3e')](_0x3842a9['where'],{'$or':_[_0xb6fa('0x2a')](_0x5a6693,function(_0x2a9b40){if(_0x2a9b40[_0xb6fa('0x2e')]!==_0xb6fa('0x3f')){var _0xfeed92={};_0xfeed92[_0x2a9b40['name']]={'$like':'%'+_0x293054['query'][_0xb6fa('0x3d')]+'%'};return _0xfeed92;}})});}_0x3842a9=_[_0xb6fa('0x3e')]({},_0x3842a9,_0x293054[_0xb6fa('0x40')]);var _0x150403={'where':_0x3842a9[_0xb6fa('0x3a')]};return db[_0xb6fa('0x2b')][_0xb6fa('0x21')](_0x150403)[_0xb6fa('0x25')](function(_0x38296f){_0x25b8f3[_0xb6fa('0x21')]=_0x38296f;if(_0x293054[_0xb6fa('0x30')][_0xb6fa('0x41')]){_0x3842a9[_0xb6fa('0x42')]=[{'all':!![]}];}return db['ServicenowField'][_0xb6fa('0x43')](_0x3842a9);})[_0xb6fa('0x25')](function(_0xd546eb){_0x25b8f3[_0xb6fa('0x44')]=_0xd546eb;return _0x25b8f3;})[_0xb6fa('0x25')](respondWithFilteredResult(_0xb4f9b0,_0x3842a9))[_0xb6fa('0x45')](handleError(_0xb4f9b0,null));};exports['show']=function(_0x157766,_0x5c10d7){var _0xeef8a3={'raw':!![],'where':{'id':_0x157766[_0xb6fa('0x46')]['id']}},_0x56bd89={};_0x56bd89[_0xb6fa('0x32')]=_[_0xb6fa('0x2f')](db[_0xb6fa('0x2b')][_0xb6fa('0x2c')]);_0x56bd89['query']=_[_0xb6fa('0x2f')](_0x157766['query']);_0x56bd89[_0xb6fa('0x3c')]=_[_0xb6fa('0x31')](_0x56bd89[_0xb6fa('0x32')],_0x56bd89[_0xb6fa('0x30')]);_0xeef8a3[_0xb6fa('0x34')]=_[_0xb6fa('0x31')](_0x56bd89[_0xb6fa('0x32')],qs['fields'](_0x157766[_0xb6fa('0x30')]['fields']));_0xeef8a3[_0xb6fa('0x34')]=_0xeef8a3[_0xb6fa('0x34')]['length']?_0xeef8a3[_0xb6fa('0x34')]:_0x56bd89[_0xb6fa('0x32')];if(_0x157766[_0xb6fa('0x30')][_0xb6fa('0x41')]){_0xeef8a3['include']=[{'all':!![]}];}_0xeef8a3=_[_0xb6fa('0x3e')]({},_0xeef8a3,_0x157766['options']);return db['ServicenowField'][_0xb6fa('0x47')](_0xeef8a3)['then'](handleEntityNotFound(_0x5c10d7,null))[_0xb6fa('0x25')](respondWithResult(_0x5c10d7,null))[_0xb6fa('0x45')](handleError(_0x5c10d7,null));};exports['create']=function(_0x5a3f3d,_0x1d36fa){return db['ServicenowField'][_0xb6fa('0x48')](_0x5a3f3d[_0xb6fa('0x49')],{})[_0xb6fa('0x25')](respondWithResult(_0x1d36fa,0xc9))['catch'](handleError(_0x1d36fa,null));};exports['update']=function(_0x37cb80,_0x4f3dc0){if(_0x37cb80[_0xb6fa('0x49')]['id']){delete _0x37cb80[_0xb6fa('0x49')]['id'];}return db['ServicenowField']['find']({'where':{'id':_0x37cb80[_0xb6fa('0x46')]['id']}})[_0xb6fa('0x25')](handleEntityNotFound(_0x4f3dc0,null))[_0xb6fa('0x25')](saveUpdates(_0x37cb80['body'],null))[_0xb6fa('0x25')](respondWithResult(_0x4f3dc0,null))['catch'](handleError(_0x4f3dc0,null));};exports[_0xb6fa('0x4a')]=function(_0x313311,_0x409497){return db[_0xb6fa('0x2b')][_0xb6fa('0x47')]({'where':{'id':_0x313311[_0xb6fa('0x46')]['id']}})[_0xb6fa('0x25')](handleEntityNotFound(_0x409497,null))[_0xb6fa('0x25')](removeEntity(_0x409497,null))[_0xb6fa('0x45')](handleError(_0x409497,null));}; \ No newline at end of file +var _0x178b=['reject','update','then','destroy','end','error','stack','name','send','index','ServicenowField','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','findAll','catch','show','params','include','create','body','find','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x178b,0x152));var _0xb178=function(_0x230078,_0x40e1b4){_0x230078=_0x230078-0x0;var _0x379ab7=_0x178b[_0x230078];return _0x379ab7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb178('0x0'));var zipdir=require(_0xb178('0x1'));var jsonpatch=require(_0xb178('0x2'));var rp=require(_0xb178('0x3'));var moment=require(_0xb178('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb178('0x5'));var util=require(_0xb178('0x6'));var path=require(_0xb178('0x7'));var sox=require(_0xb178('0x8'));var csv=require(_0xb178('0x9'));var ejs=require(_0xb178('0xa'));var fs=require('fs');var fs_extra=require(_0xb178('0xb'));var _=require(_0xb178('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb178('0xd'));var toCsv=require(_0xb178('0x9'));var querystring=require(_0xb178('0xe'));var Papa=require(_0xb178('0xf'));var Redis=require(_0xb178('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xb178('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb178('0x12'));var logger=require(_0xb178('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xb178('0x14'));var db=require(_0xb178('0x15'))['db'];function respondWithStatusCode(_0x244b6a,_0x29f90b){_0x29f90b=_0x29f90b||0xcc;return function(_0xeee7fd){if(_0xeee7fd){return _0x244b6a[_0xb178('0x16')](_0x29f90b);}return _0x244b6a[_0xb178('0x17')](_0x29f90b)['end']();};}function respondWithResult(_0x1841f9,_0x2c5cef){_0x2c5cef=_0x2c5cef||0xc8;return function(_0x104e12){if(_0x104e12){return _0x1841f9[_0xb178('0x17')](_0x2c5cef)[_0xb178('0x18')](_0x104e12);}};}function respondWithFilteredResult(_0x2dc42c,_0x354193){return function(_0x2f4f81){if(_0x2f4f81){var _0x535a1e=typeof _0x354193[_0xb178('0x19')]===_0xb178('0x1a')&&typeof _0x354193[_0xb178('0x1b')]===_0xb178('0x1a');var _0x2262d5=_0x2f4f81[_0xb178('0x1c')];var _0x257d8b=_0x535a1e?0x0:_0x354193['offset'];var _0x13c106=_0x535a1e?_0x2f4f81[_0xb178('0x1c')]:_0x354193[_0xb178('0x19')]+_0x354193[_0xb178('0x1b')];var _0x296c49;if(_0x13c106>=_0x2262d5){_0x13c106=_0x2262d5;_0x296c49=0xc8;}else{_0x296c49=0xce;}_0x2dc42c['status'](_0x296c49);return _0x2dc42c[_0xb178('0x1d')](_0xb178('0x1e'),_0x257d8b+'-'+_0x13c106+'/'+_0x2262d5)[_0xb178('0x18')](_0x2f4f81);}return null;};}function patchUpdates(_0x40dcda){return function(_0x3fdcf2){try{jsonpatch[_0xb178('0x1f')](_0x3fdcf2,_0x40dcda,!![]);}catch(_0xb9482a){return BPromise[_0xb178('0x20')](_0xb9482a);}return _0x3fdcf2['save']();};}function saveUpdates(_0x57f830,_0x5aeb56){return function(_0x3c5ce0){if(_0x3c5ce0){return _0x3c5ce0[_0xb178('0x21')](_0x57f830)[_0xb178('0x22')](function(_0x1eae8a){return _0x1eae8a;});}return null;};}function removeEntity(_0x83d93f,_0x4ea95a){return function(_0x1c4d19){if(_0x1c4d19){return _0x1c4d19[_0xb178('0x23')]()[_0xb178('0x22')](function(){_0x83d93f['status'](0xcc)[_0xb178('0x24')]();});}};}function handleEntityNotFound(_0x45bbfe,_0x3b1f68){return function(_0x1e0eaa){if(!_0x1e0eaa){_0x45bbfe[_0xb178('0x16')](0x194);}return _0x1e0eaa;};}function handleError(_0x538763,_0xd68c20){_0xd68c20=_0xd68c20||0x1f4;return function(_0x2eea6a){logger[_0xb178('0x25')](_0x2eea6a[_0xb178('0x26')]);if(_0x2eea6a[_0xb178('0x27')]){delete _0x2eea6a[_0xb178('0x27')];}_0x538763[_0xb178('0x17')](_0xd68c20)[_0xb178('0x28')](_0x2eea6a);};}exports[_0xb178('0x29')]=function(_0x165568,_0x208596){var _0x195e19={},_0x421828={},_0x38d746={'count':0x0,'rows':[]};var _0x20a424=_['map'](db[_0xb178('0x2a')][_0xb178('0x2b')],function(_0x399045){return{'name':_0x399045['fieldName'],'type':_0x399045[_0xb178('0x2c')][_0xb178('0x2d')]};});_0x421828[_0xb178('0x2e')]=_['map'](_0x20a424,'name');_0x421828[_0xb178('0x2f')]=_[_0xb178('0x30')](_0x165568['query']);_0x421828[_0xb178('0x31')]=_[_0xb178('0x32')](_0x421828[_0xb178('0x2e')],_0x421828[_0xb178('0x2f')]);_0x195e19[_0xb178('0x33')]=_[_0xb178('0x32')](_0x421828['model'],qs['fields'](_0x165568[_0xb178('0x2f')][_0xb178('0x34')]));_0x195e19[_0xb178('0x33')]=_0x195e19[_0xb178('0x33')][_0xb178('0x35')]?_0x195e19['attributes']:_0x421828[_0xb178('0x2e')];if(!_0x165568[_0xb178('0x2f')][_0xb178('0x36')](_0xb178('0x37'))){_0x195e19[_0xb178('0x1b')]=qs[_0xb178('0x1b')](_0x165568[_0xb178('0x2f')][_0xb178('0x1b')]);_0x195e19[_0xb178('0x19')]=qs[_0xb178('0x19')](_0x165568['query'][_0xb178('0x19')]);}_0x195e19[_0xb178('0x38')]=qs[_0xb178('0x39')](_0x165568[_0xb178('0x2f')][_0xb178('0x39')]);_0x195e19[_0xb178('0x3a')]=qs['filters'](_[_0xb178('0x3b')](_0x165568['query'],_0x421828[_0xb178('0x31')]),_0x20a424);if(_0x165568[_0xb178('0x2f')][_0xb178('0x3c')]){_0x195e19[_0xb178('0x3a')]=_[_0xb178('0x3d')](_0x195e19[_0xb178('0x3a')],{'$or':_[_0xb178('0x3e')](_0x20a424,function(_0x349752){if(_0x349752[_0xb178('0x2c')]!==_0xb178('0x3f')){var _0x53fcca={};_0x53fcca[_0x349752[_0xb178('0x27')]]={'$like':'%'+_0x165568['query'][_0xb178('0x3c')]+'%'};return _0x53fcca;}})});}_0x195e19=_[_0xb178('0x3d')]({},_0x195e19,_0x165568[_0xb178('0x40')]);var _0x57ceb4={'where':_0x195e19[_0xb178('0x3a')]};return db[_0xb178('0x2a')][_0xb178('0x1c')](_0x57ceb4)[_0xb178('0x22')](function(_0x5aeaed){_0x38d746[_0xb178('0x1c')]=_0x5aeaed;if(_0x165568[_0xb178('0x2f')][_0xb178('0x41')]){_0x195e19['include']=[{'all':!![]}];}return db[_0xb178('0x2a')][_0xb178('0x42')](_0x195e19);})['then'](function(_0x5d88b4){_0x38d746['rows']=_0x5d88b4;return _0x38d746;})[_0xb178('0x22')](respondWithFilteredResult(_0x208596,_0x195e19))[_0xb178('0x43')](handleError(_0x208596,null));};exports[_0xb178('0x44')]=function(_0xe15fc6,_0x40374f){var _0x209828={'raw':!![],'where':{'id':_0xe15fc6[_0xb178('0x45')]['id']}},_0x23768d={};_0x23768d[_0xb178('0x2e')]=_[_0xb178('0x30')](db['ServicenowField'][_0xb178('0x2b')]);_0x23768d[_0xb178('0x2f')]=_['keys'](_0xe15fc6[_0xb178('0x2f')]);_0x23768d['filters']=_[_0xb178('0x32')](_0x23768d['model'],_0x23768d[_0xb178('0x2f')]);_0x209828[_0xb178('0x33')]=_[_0xb178('0x32')](_0x23768d[_0xb178('0x2e')],qs[_0xb178('0x34')](_0xe15fc6['query']['fields']));_0x209828[_0xb178('0x33')]=_0x209828[_0xb178('0x33')][_0xb178('0x35')]?_0x209828[_0xb178('0x33')]:_0x23768d[_0xb178('0x2e')];if(_0xe15fc6['query'][_0xb178('0x41')]){_0x209828[_0xb178('0x46')]=[{'all':!![]}];}_0x209828=_[_0xb178('0x3d')]({},_0x209828,_0xe15fc6[_0xb178('0x40')]);return db['ServicenowField']['find'](_0x209828)[_0xb178('0x22')](handleEntityNotFound(_0x40374f,null))[_0xb178('0x22')](respondWithResult(_0x40374f,null))['catch'](handleError(_0x40374f,null));};exports[_0xb178('0x47')]=function(_0x36e01a,_0x5c9314){return db[_0xb178('0x2a')][_0xb178('0x47')](_0x36e01a[_0xb178('0x48')],{})['then'](respondWithResult(_0x5c9314,0xc9))[_0xb178('0x43')](handleError(_0x5c9314,null));};exports[_0xb178('0x21')]=function(_0x307edf,_0x191014){if(_0x307edf[_0xb178('0x48')]['id']){delete _0x307edf[_0xb178('0x48')]['id'];}return db[_0xb178('0x2a')][_0xb178('0x49')]({'where':{'id':_0x307edf[_0xb178('0x45')]['id']}})[_0xb178('0x22')](handleEntityNotFound(_0x191014,null))[_0xb178('0x22')](saveUpdates(_0x307edf[_0xb178('0x48')],null))[_0xb178('0x22')](respondWithResult(_0x191014,null))[_0xb178('0x43')](handleError(_0x191014,null));};exports[_0xb178('0x23')]=function(_0x21024a,_0x4411f0){return db[_0xb178('0x2a')][_0xb178('0x49')]({'where':{'id':_0x21024a[_0xb178('0x45')]['id']}})[_0xb178('0x22')](handleEntityNotFound(_0x4411f0,null))['then'](removeEntity(_0x4411f0,null))['catch'](handleError(_0x4411f0,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 71dae06..5091ac6 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 _0x14fb=['api','bluebird','rimraf','../../config/environment','./intServicenowField.attributes','define','ServicenowField','int_servicenow_fields','servicenow_unique_index','FieldId','lodash','util','../../config/logger'];(function(_0x1f77d8,_0x4174a9){var _0x2e93c0=function(_0x2ed806){while(--_0x2ed806){_0x1f77d8['push'](_0x1f77d8['shift']());}};_0x2e93c0(++_0x4174a9);}(_0x14fb,0x15c));var _0xb14f=function(_0x55d2fb,_0x535daa){_0x55d2fb=_0x55d2fb-0x0;var _0x4beb62=_0x14fb[_0x55d2fb];return _0x4beb62;};'use strict';var _=require(_0xb14f('0x0'));var util=require(_0xb14f('0x1'));var logger=require(_0xb14f('0x2'))(_0xb14f('0x3'));var moment=require('moment');var BPromise=require(_0xb14f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb14f('0x5'));var config=require(_0xb14f('0x6'));var attributes=require(_0xb14f('0x7'));module['exports']=function(_0x30235a,_0x1aae34){return _0x30235a[_0xb14f('0x8')](_0xb14f('0x9'),attributes,{'tableName':_0xb14f('0xa'),'paranoid':![],'indexes':[{'name':_0xb14f('0xb'),'fields':['idField',_0xb14f('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xee6a=['bluebird','request-promise','path','../../config/environment','./intServicenowField.attributes','exports','define','ServicenowField','int_servicenow_fields','servicenow_unique_index','idField','FieldId','lodash','util','api','moment'];(function(_0x26d344,_0x3acdf1){var _0x540fb5=function(_0x419379){while(--_0x419379){_0x26d344['push'](_0x26d344['shift']());}};_0x540fb5(++_0x3acdf1);}(_0xee6a,0xfc));var _0xaee6=function(_0x3d0669,_0x1c5ed0){_0x3d0669=_0x3d0669-0x0;var _0x461e13=_0xee6a[_0x3d0669];return _0x461e13;};'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'));module[_0xaee6('0x9')]=function(_0x514353,_0x2707b9){return _0x514353[_0xaee6('0xa')](_0xaee6('0xb'),attributes,{'tableName':_0xaee6('0xc'),'paranoid':![],'indexes':[{'name':_0xaee6('0xd'),'fields':[_0xaee6('0xe'),_0xaee6('0xf')],'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 24776e6..e3fd28e 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 _0xf4eb=['ServicenowField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x4641d5,_0x5bf8c9){var _0x253adb=function(_0x281659){while(--_0x281659){_0x4641d5['push'](_0x4641d5['shift']());}};_0x253adb(++_0x5bf8c9);}(_0xf4eb,0xec));var _0xbf4e=function(_0x475297,_0x495bba){_0x475297=_0x475297-0x0;var _0x24ca68=_0xf4eb[_0x475297];return _0x24ca68;};'use strict';var _=require(_0xbf4e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbf4e('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbf4e('0x2'))(_0xbf4e('0x3'));var config=require(_0xbf4e('0x4'));var jayson=require(_0xbf4e('0x5'));var client=jayson[_0xbf4e('0x6')][_0xbf4e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x15b99f,_0x540736,_0x449d55){return new BPromise(function(_0x5013c2,_0x5e23d4){return client[_0xbf4e('0x8')](_0x15b99f,_0x449d55)[_0xbf4e('0x9')](function(_0xcc4097){logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));logger[_0xbf4e('0xd')]('ServicenowField,\x20%s,\x20%s,\x20%s',_0x540736,'request\x20sent',JSON[_0xbf4e('0xe')](_0xcc4097));if(_0xcc4097['error']){if(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x10')]===0x1f4){logger['error'](_0xbf4e('0xb'),_0x540736,_0xcc4097['error']['message']);return _0x5e23d4(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);}logger[_0xbf4e('0xf')](_0xbf4e('0xb'),_0x540736,_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);return _0x5013c2(_0xcc4097['error']['message']);}else{logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));_0x5013c2(_0xcc4097['result'][_0xbf4e('0x11')]);}})[_0xbf4e('0x12')](function(_0x912fc0){logger[_0xbf4e('0xf')]('ServicenowField,\x20%s,\x20%s',_0x540736,_0x912fc0);_0x5e23d4(_0x912fc0);});});} \ No newline at end of file +var _0xe706=['http','request','then','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\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(_0x4838a1,_0x130213){var _0x4f330f=function(_0x341fe1){while(--_0x341fe1){_0x4838a1['push'](_0x4838a1['shift']());}};_0x4f330f(++_0x130213);}(_0xe706,0xa3));var _0x6e70=function(_0x40ddc0,_0x41c082){_0x40ddc0=_0x40ddc0-0x0;var _0x1aebf1=_0xe706[_0x40ddc0];return _0x1aebf1;};'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']('ServicenowField,\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']('ServicenowField,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 5b769c0..5e26f59 100644 --- a/server/api/intSugarcrmAccount/index.js +++ b/server/api/intSugarcrmAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x5ad5b3,_0x5e1cf1){var _0x435f78=function(_0x7dee51){while(--_0x7dee51){_0x5ad5b3['push'](_0x5ad5b3['shift']());}};_0x435f78(++_0x5e1cf1);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x3b4e42,_0x408f98){var _0x5a7256=function(_0x4ceb6c){while(--_0x4ceb6c){_0x3b4e42['push'](_0x3b4e42['shift']());}};_0x5a7256(++_0x408f98);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xa9e0[_0x2a6809];return _0x11c371;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index 84d85c3..c53358b 100644 --- a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js +++ b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['remoteUri','sequelize','exports','STRING','username'];(function(_0x2d14f3,_0x4e8329){var _0x400678=function(_0x12ddf7){while(--_0x12ddf7){_0x2d14f3['push'](_0x2d14f3['shift']());}};_0x400678(++_0x4e8329);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xa9e0[_0x5b78e8];return _0xf2c321;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x0a9e('0x3')},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x0a9e('0x2')],'unique':_0x0a9e('0x4')},'serverUrl':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xa9e0=['remoteUri','sequelize','exports','STRING','username'];(function(_0x25a352,_0x512487){var _0xd724f8=function(_0x37ece1){while(--_0x37ece1){_0x25a352['push'](_0x25a352['shift']());}};_0xd724f8(++_0x512487);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa9e0[_0x5b561d];return _0x431060;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x0a9e('0x3')},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x0a9e('0x2')],'unique':_0x0a9e('0x4')},'serverUrl':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js index a08c7ed..339986d 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 _0xe348=['Subjects','getSubjects','channel','Descriptions','getDescriptions','SugarcrmConfiguration','SugarcrmField','getFields','created_by','description','date_start','duration_hours','duration_minutes','parent_type','direction','remoteUri','substring','lastIndexOf','POST','format','%s%s','/service/v4_1/rest.php','JSON','stringify','username','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','get_module_fields','Calls','values','module_fields','endsWith','test','error','statusCode','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','destroy','sendStatus','name','send','index','map','SugarcrmAccount','rawAttributes','fieldName','type','key','model','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','where','merge','filter','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','getConfigurations','findOne','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe348,0x9e));var _0x8e34=function(_0x2b9b7f,_0x4d47df){_0x2b9b7f=_0x2b9b7f-0x0;var _0x4ed19a=_0xe348[_0x2b9b7f];return _0x4ed19a;};'use strict';var emlformat=require(_0x8e34('0x0'));var rimraf=require(_0x8e34('0x1'));var zipdir=require(_0x8e34('0x2'));var jsonpatch=require(_0x8e34('0x3'));var rp=require(_0x8e34('0x4'));var moment=require(_0x8e34('0x5'));var BPromise=require(_0x8e34('0x6'));var Mustache=require(_0x8e34('0x7'));var util=require('util');var path=require(_0x8e34('0x8'));var sox=require('sox');var csv=require(_0x8e34('0x9'));var ejs=require(_0x8e34('0xa'));var fs=require('fs');var fs_extra=require(_0x8e34('0xb'));var _=require(_0x8e34('0xc'));var squel=require(_0x8e34('0xd'));var crypto=require(_0x8e34('0xe'));var jsforce=require(_0x8e34('0xf'));var deskjs=require(_0x8e34('0x10'));var toCsv=require(_0x8e34('0x9'));var querystring=require(_0x8e34('0x11'));var Papa=require('papaparse');var Redis=require(_0x8e34('0x12'));var authService=require(_0x8e34('0x13'));var qs=require(_0x8e34('0x14'));var as=require(_0x8e34('0x15'));var hardwareService=require(_0x8e34('0x16'));var logger=require(_0x8e34('0x17'))(_0x8e34('0x18'));var utils=require(_0x8e34('0x19'));var config=require(_0x8e34('0x1a'));var licenseUtil=require(_0x8e34('0x1b'));var db=require('../../mysqldb')['db'];var integrations=require(_0x8e34('0x1c'));function respondWithStatusCode(_0x3f38db,_0x2d6f6b){_0x2d6f6b=_0x2d6f6b||0xcc;return function(_0x376068){if(_0x376068){return _0x3f38db['sendStatus'](_0x2d6f6b);}return _0x3f38db[_0x8e34('0x1d')](_0x2d6f6b)[_0x8e34('0x1e')]();};}function respondWithResult(_0x472efa,_0x9517ca){_0x9517ca=_0x9517ca||0xc8;return function(_0x1e96d5){if(_0x1e96d5){return _0x472efa[_0x8e34('0x1d')](_0x9517ca)['json'](_0x1e96d5);}};}function respondWithFilteredResult(_0x5d64a1,_0x469393){return function(_0x336532){if(_0x336532){var _0x216c34=typeof _0x469393[_0x8e34('0x1f')]===_0x8e34('0x20')&&typeof _0x469393[_0x8e34('0x21')]===_0x8e34('0x20');var _0xdf256e=_0x336532['count'];var _0x6487ab=_0x216c34?0x0:_0x469393['offset'];var _0x16a0d5=_0x216c34?_0x336532[_0x8e34('0x22')]:_0x469393[_0x8e34('0x1f')]+_0x469393[_0x8e34('0x21')];var _0x1d2203;if(_0x16a0d5>=_0xdf256e){_0x16a0d5=_0xdf256e;_0x1d2203=0xc8;}else{_0x1d2203=0xce;}_0x5d64a1[_0x8e34('0x1d')](_0x1d2203);return _0x5d64a1[_0x8e34('0x23')](_0x8e34('0x24'),_0x6487ab+'-'+_0x16a0d5+'/'+_0xdf256e)[_0x8e34('0x25')](_0x336532);}return null;};}function patchUpdates(_0x5ee394){return function(_0x2f10da){try{jsonpatch[_0x8e34('0x26')](_0x2f10da,_0x5ee394,!![]);}catch(_0x236d5a){return BPromise[_0x8e34('0x27')](_0x236d5a);}return _0x2f10da['save']();};}function saveUpdates(_0x8857e5,_0x3b5a15){return function(_0xe4d6db){if(_0xe4d6db){return _0xe4d6db[_0x8e34('0x28')](_0x8857e5)[_0x8e34('0x29')](function(_0x1ec0e8){return _0x1ec0e8;});}return null;};}function removeEntity(_0x3b4c1e,_0x1b71e4){return function(_0x508dee){if(_0x508dee){return _0x508dee[_0x8e34('0x2a')]()[_0x8e34('0x29')](function(){_0x3b4c1e[_0x8e34('0x1d')](0xcc)[_0x8e34('0x1e')]();});}};}function handleEntityNotFound(_0x1958f1,_0x3dcbff){return function(_0x4866a8){if(!_0x4866a8){_0x1958f1[_0x8e34('0x2b')](0x194);}return _0x4866a8;};}function handleError(_0x2f6627,_0x465f7d){_0x465f7d=_0x465f7d||0x1f4;return function(_0x13d972){logger['error'](_0x13d972['stack']);if(_0x13d972[_0x8e34('0x2c')]){delete _0x13d972[_0x8e34('0x2c')];}_0x2f6627[_0x8e34('0x1d')](_0x465f7d)[_0x8e34('0x2d')](_0x13d972);};}exports[_0x8e34('0x2e')]=function(_0x50ab04,_0x24c1d3){var _0x1b60b0={},_0x28f823={},_0x280557={'count':0x0,'rows':[]};var _0x1a1567=_[_0x8e34('0x2f')](db[_0x8e34('0x30')][_0x8e34('0x31')],function(_0x2dd43a){return{'name':_0x2dd43a[_0x8e34('0x32')],'type':_0x2dd43a[_0x8e34('0x33')][_0x8e34('0x34')]};});_0x28f823[_0x8e34('0x35')]=_['map'](_0x1a1567,'name');_0x28f823['query']=_['keys'](_0x50ab04['query']);_0x28f823[_0x8e34('0x36')]=_[_0x8e34('0x37')](_0x28f823[_0x8e34('0x35')],_0x28f823[_0x8e34('0x38')]);_0x1b60b0[_0x8e34('0x39')]=_['intersection'](_0x28f823[_0x8e34('0x35')],qs[_0x8e34('0x3a')](_0x50ab04[_0x8e34('0x38')][_0x8e34('0x3a')]));_0x1b60b0[_0x8e34('0x39')]=_0x1b60b0[_0x8e34('0x39')]['length']?_0x1b60b0[_0x8e34('0x39')]:_0x28f823[_0x8e34('0x35')];if(!_0x50ab04[_0x8e34('0x38')][_0x8e34('0x3b')](_0x8e34('0x3c'))){_0x1b60b0['limit']=qs[_0x8e34('0x21')](_0x50ab04[_0x8e34('0x38')][_0x8e34('0x21')]);_0x1b60b0['offset']=qs[_0x8e34('0x1f')](_0x50ab04[_0x8e34('0x38')][_0x8e34('0x1f')]);}_0x1b60b0[_0x8e34('0x3d')]=qs[_0x8e34('0x3e')](_0x50ab04[_0x8e34('0x38')]['sort']);_0x1b60b0['where']=qs[_0x8e34('0x36')](_[_0x8e34('0x3f')](_0x50ab04['query'],_0x28f823[_0x8e34('0x36')]),_0x1a1567);if(_0x50ab04['query']['filter']){_0x1b60b0[_0x8e34('0x40')]=_[_0x8e34('0x41')](_0x1b60b0[_0x8e34('0x40')],{'$or':_[_0x8e34('0x2f')](_0x1a1567,function(_0x5aa9ee){if(_0x5aa9ee[_0x8e34('0x33')]!=='VIRTUAL'){var _0x39976f={};_0x39976f[_0x5aa9ee[_0x8e34('0x2c')]]={'$like':'%'+_0x50ab04[_0x8e34('0x38')][_0x8e34('0x42')]+'%'};return _0x39976f;}})});}_0x1b60b0=_[_0x8e34('0x41')]({},_0x1b60b0,_0x50ab04[_0x8e34('0x43')]);var _0x1df9f2={'where':_0x1b60b0['where']};return db[_0x8e34('0x30')][_0x8e34('0x22')](_0x1df9f2)[_0x8e34('0x29')](function(_0x29f262){_0x280557[_0x8e34('0x22')]=_0x29f262;if(_0x50ab04['query'][_0x8e34('0x44')]){_0x1b60b0[_0x8e34('0x45')]=[{'all':!![]}];}return db[_0x8e34('0x30')][_0x8e34('0x46')](_0x1b60b0);})[_0x8e34('0x29')](function(_0x4ab773){_0x280557[_0x8e34('0x47')]=_0x4ab773;return _0x280557;})[_0x8e34('0x29')](respondWithFilteredResult(_0x24c1d3,_0x1b60b0))[_0x8e34('0x48')](handleError(_0x24c1d3,null));};exports[_0x8e34('0x49')]=function(_0xd0e32,_0x19f77f){var _0x156ff8={'raw':![],'where':{'id':_0xd0e32[_0x8e34('0x4a')]['id']}},_0x5d3886={};_0x5d3886[_0x8e34('0x35')]=_[_0x8e34('0x4b')](db[_0x8e34('0x30')][_0x8e34('0x31')]);_0x5d3886[_0x8e34('0x38')]=_['keys'](_0xd0e32['query']);_0x5d3886[_0x8e34('0x36')]=_[_0x8e34('0x37')](_0x5d3886['model'],_0x5d3886[_0x8e34('0x38')]);_0x156ff8[_0x8e34('0x39')]=_[_0x8e34('0x37')](_0x5d3886[_0x8e34('0x35')],qs[_0x8e34('0x3a')](_0xd0e32[_0x8e34('0x38')][_0x8e34('0x3a')]));_0x156ff8[_0x8e34('0x39')]=_0x156ff8[_0x8e34('0x39')]['length']?_0x156ff8[_0x8e34('0x39')]:_0x5d3886[_0x8e34('0x35')];if(_0xd0e32['query'][_0x8e34('0x44')]){_0x156ff8[_0x8e34('0x45')]=[{'all':!![]}];}_0x156ff8=_[_0x8e34('0x41')]({},_0x156ff8,_0xd0e32[_0x8e34('0x43')]);return db[_0x8e34('0x30')][_0x8e34('0x4c')](_0x156ff8)[_0x8e34('0x29')](handleEntityNotFound(_0x19f77f,null))[_0x8e34('0x29')](respondWithResult(_0x19f77f,null))[_0x8e34('0x48')](handleError(_0x19f77f,null));};exports['create']=function(_0x563ab2,_0x1f727a){return db[_0x8e34('0x30')][_0x8e34('0x4d')](_0x563ab2['body'],{})['then'](respondWithResult(_0x1f727a,0xc9))['catch'](handleError(_0x1f727a,null));};exports[_0x8e34('0x28')]=function(_0x4341f9,_0xf5c6fb){if(_0x4341f9['body']['id']){delete _0x4341f9[_0x8e34('0x4e')]['id'];}return db[_0x8e34('0x30')]['find']({'where':{'id':_0x4341f9[_0x8e34('0x4a')]['id']}})[_0x8e34('0x29')](handleEntityNotFound(_0xf5c6fb,null))[_0x8e34('0x29')](saveUpdates(_0x4341f9[_0x8e34('0x4e')],null))['then'](respondWithResult(_0xf5c6fb,null))[_0x8e34('0x48')](handleError(_0xf5c6fb,null));};exports[_0x8e34('0x2a')]=function(_0xdbfcde,_0x51190f){return db[_0x8e34('0x30')]['find']({'where':{'id':_0xdbfcde[_0x8e34('0x4a')]['id']}})[_0x8e34('0x29')](handleEntityNotFound(_0x51190f,null))[_0x8e34('0x29')](removeEntity(_0x51190f,null))[_0x8e34('0x48')](handleError(_0x51190f,null));};exports[_0x8e34('0x4f')]=function(_0x4f6e76,_0x33e23f,_0x2f8f39){var _0x10d3c7={};var _0x11e1a1={};var _0x1413aa;var _0x3d7d8f;return db[_0x8e34('0x30')][_0x8e34('0x50')]({'where':{'id':_0x4f6e76[_0x8e34('0x4a')]['id']}})['then'](handleEntityNotFound(_0x33e23f,null))[_0x8e34('0x29')](function(_0x32ed18){if(_0x32ed18){_0x1413aa=_0x32ed18;_0x11e1a1['model']=_[_0x8e34('0x4b')](db['SugarcrmConfiguration'][_0x8e34('0x31')]);_0x11e1a1['query']=_[_0x8e34('0x4b')](_0x4f6e76[_0x8e34('0x38')]);_0x11e1a1[_0x8e34('0x36')]=_[_0x8e34('0x37')](_0x11e1a1[_0x8e34('0x35')],_0x11e1a1[_0x8e34('0x38')]);_0x10d3c7[_0x8e34('0x39')]=_[_0x8e34('0x37')](_0x11e1a1['model'],qs[_0x8e34('0x3a')](_0x4f6e76[_0x8e34('0x38')][_0x8e34('0x3a')]));_0x10d3c7[_0x8e34('0x39')]=_0x10d3c7['attributes'][_0x8e34('0x51')]?_0x10d3c7[_0x8e34('0x39')]:_0x11e1a1['model'];_0x10d3c7['order']=qs[_0x8e34('0x3e')](_0x4f6e76['query'][_0x8e34('0x3e')]);_0x10d3c7[_0x8e34('0x40')]=qs[_0x8e34('0x36')](_['pick'](_0x4f6e76[_0x8e34('0x38')],_0x11e1a1[_0x8e34('0x36')]));if(_0x4f6e76[_0x8e34('0x38')][_0x8e34('0x42')]){_0x10d3c7[_0x8e34('0x40')]=_['merge'](_0x10d3c7['where'],{'$or':_[_0x8e34('0x2f')](_0x10d3c7['attributes'],function(_0x35ad57){var _0xa4ece7={};_0xa4ece7[_0x35ad57]={'$like':'%'+_0x4f6e76[_0x8e34('0x38')]['filter']+'%'};return _0xa4ece7;})});}_0x10d3c7=_[_0x8e34('0x41')]({},_0x10d3c7,_0x4f6e76['options']);return _0x1413aa[_0x8e34('0x4f')](_0x10d3c7);}})[_0x8e34('0x29')](function(_0x209a2f){if(_0x209a2f){_0x3d7d8f=_0x209a2f[_0x8e34('0x51')];if(!_0x4f6e76[_0x8e34('0x38')]['hasOwnProperty'](_0x8e34('0x3c'))){_0x10d3c7['limit']=qs[_0x8e34('0x21')](_0x4f6e76['query']['limit']);_0x10d3c7[_0x8e34('0x1f')]=qs[_0x8e34('0x1f')](_0x4f6e76[_0x8e34('0x38')][_0x8e34('0x1f')]);}return _0x1413aa['getConfigurations'](_0x10d3c7);}})[_0x8e34('0x29')](function(_0x25116c){if(_0x25116c){return _0x25116c?{'count':_0x3d7d8f,'rows':_0x25116c}:null;}})[_0x8e34('0x29')](respondWithResult(_0x33e23f,null))[_0x8e34('0x48')](handleError(_0x33e23f,null));};exports['addConfiguration']=function(_0x469a54,_0x573e2e,_0x41d070){if(_0x469a54['body']['id']){delete _0x469a54[_0x8e34('0x4e')]['id'];}return db[_0x8e34('0x30')][_0x8e34('0x50')]({'where':{'id':_0x469a54['params']['id']}})[_0x8e34('0x29')](handleEntityNotFound(_0x573e2e,null))[_0x8e34('0x29')](function(_0x16ee15){if(_0x16ee15){_0x469a54[_0x8e34('0x4e')]['AccountId']=_0x16ee15['id'];_0x469a54['body'][_0x8e34('0x52')]=integrations[_0x8e34('0x53')](_0x469a54[_0x8e34('0x4e')][_0x8e34('0x54')],_0x469a54[_0x8e34('0x4e')][_0x8e34('0x33')]);_0x469a54[_0x8e34('0x4e')][_0x8e34('0x55')]=integrations[_0x8e34('0x56')](_0x469a54['body']['channel'],_0x469a54[_0x8e34('0x4e')][_0x8e34('0x33')]);return db[_0x8e34('0x57')][_0x8e34('0x4d')](_0x469a54[_0x8e34('0x4e')],{'include':[{'model':db[_0x8e34('0x58')],'as':_0x8e34('0x52')},{'model':db[_0x8e34('0x58')],'as':'Descriptions'}]});}return null;})[_0x8e34('0x29')](respondWithResult(_0x573e2e,null))['catch'](handleError(_0x573e2e,null));};exports[_0x8e34('0x59')]=function(_0x4ad093,_0x4d08cd,_0x454381){var _0x50cf84='';var _0xf5daf4=['id',_0x8e34('0x2c'),'assigned_user_id',_0x8e34('0x5a'),_0x8e34('0x5b'),_0x8e34('0x5c'),_0x8e34('0x5d'),_0x8e34('0x5e'),'parent_id',_0x8e34('0x5f'),'parent_name',_0x8e34('0x60')];return db[_0x8e34('0x30')][_0x8e34('0x50')]({'where':{'id':_0x4ad093['params']['id']},'attributes':['id','username','password',_0x8e34('0x61')]})[_0x8e34('0x29')](handleEntityNotFound(_0x4d08cd,null))[_0x8e34('0x29')](function(_0x588cdf){if(_0x588cdf){_0x50cf84=_0x588cdf['remoteUri'];var _0x3bed98=_0x50cf84['slice'](-0x1);if(_0x3bed98==='/'){_0x50cf84=_0x50cf84[_0x8e34('0x62')](0x0,_0x50cf84[_0x8e34('0x63')](_0x3bed98));}return rp({'method':_0x8e34('0x64'),'uri':util[_0x8e34('0x65')](_0x8e34('0x66'),_0x50cf84,_0x8e34('0x67')),'json':!![],'form':{'method':'login','input_type':_0x8e34('0x68'),'response_type':_0x8e34('0x68'),'rest_data':JSON[_0x8e34('0x69')]({'user_auth':{'user_name':_0x588cdf[_0x8e34('0x6a')],'password':_0x588cdf['password'],'encryption':_0x8e34('0x6b')},'application':_0x8e34('0x6c')})}});}})[_0x8e34('0x29')](function(_0x2e614a){if(_0x2e614a&&_0x2e614a[_0x8e34('0x2c')]!==_0x8e34('0x6d')&&_0x2e614a[_0x8e34('0x2c')]!==_0x8e34('0x6e')){return rp({'method':'POST','uri':util[_0x8e34('0x65')](_0x8e34('0x66'),_0x50cf84,_0x8e34('0x67')),'json':!![],'form':{'method':_0x8e34('0x6f'),'input_type':_0x8e34('0x68'),'response_type':_0x8e34('0x68'),'rest_data':JSON[_0x8e34('0x69')]({'session':_0x2e614a['id'],'module_name':_0x8e34('0x70')})}})[_0x8e34('0x29')](function(_0x5dd9d3){if(_0x5dd9d3){var _0x46f10e=_[_0x8e34('0x71')](_0x5dd9d3[_0x8e34('0x72')]);_['remove'](_0x46f10e,function(_0x120bfa){return _0xf5daf4['includes'](_0x120bfa[_0x8e34('0x2c')]);});return{'count':_0x46f10e[_0x8e34('0x51')],'rows':_[_0x8e34('0x2f')](_0x46f10e,function(_0x79aad0){return{'id':_0x79aad0[_0x8e34('0x2c')],'name':_0x79aad0['label'],'custom':_[_0x8e34('0x73')](_0x79aad0[_0x8e34('0x2c')],'_c')?!![]:![],'options':_0x79aad0[_0x8e34('0x43')]?_[_0x8e34('0x2f')](_[_0x8e34('0x71')](_0x79aad0[_0x8e34('0x43')]),function(_0x389846){return{'name':_0x389846['value'],'value':_0x389846['name']};}):[]};})};}})[_0x8e34('0x29')](respondWithResult(_0x4d08cd,null))[_0x8e34('0x48')](function(_0x523728){var _0x1ce97e=_0x4ad093['query'][_0x8e34('0x74')]?0x1f4:_0x523728['statusCode']||0x1f4;logger[_0x8e34('0x75')]('getFields,\x20%s,\x20%s,\x20%s',_0x8e34('0x59'),_0x1ce97e,JSON[_0x8e34('0x69')](_0x523728));delete _0x523728[_0x8e34('0x2c')];if(_0x1ce97e===0x191){_0x1ce97e=0x190;}_0x4d08cd[_0x8e34('0x1d')](_0x1ce97e)[_0x8e34('0x2d')](_0x4ad093[_0x8e34('0x38')][_0x8e34('0x74')]?{'message':'Wrong\x20credentials','statusCode':_0x523728[_0x8e34('0x76')]}:_0x523728);});}else{var _0x44d304=0x1f4;_0x4d08cd[_0x8e34('0x1d')](_0x44d304)[_0x8e34('0x2d')]({'message':_0x8e34('0x77'),'statusCode':0x190});}});}; \ No newline at end of file +var _0xbc53=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','limit','undefined','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','SugarcrmAccount','findAll','rows','catch','params','includeAll','include','find','create','body','getConfigurations','findOne','SugarcrmConfiguration','order','addConfiguration','Subjects','getSubjects','channel','Descriptions','SugarcrmField','assigned_user_id','created_by','date_start','duration_hours','parent_id','parent_type','parent_name','username','remoteUri','slice','substring','lastIndexOf','POST','format','%s%s','/service/v4_1/rest.php','stringify','password','PLAIN','xCALLY\x20Motion\x20Integration','Password\x20Expired','get_module_fields','JSON','Calls','values','module_fields','remove','includes','endsWith','value','test','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','statusCode','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0xdde6fb,_0x1b1884){var _0xe8042e=function(_0xee7f43){while(--_0xee7f43){_0xdde6fb['push'](_0xdde6fb['shift']());}};_0xe8042e(++_0x1b1884);}(_0xbc53,0x1e9));var _0x3bc5=function(_0x41c31c,_0x1eeab2){_0x41c31c=_0x41c31c-0x0;var _0x1cd99c=_0xbc53[_0x41c31c];return _0x1cd99c;};'use strict';var emlformat=require(_0x3bc5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3bc5('0x1'));var jsonpatch=require(_0x3bc5('0x2'));var rp=require('request-promise');var moment=require(_0x3bc5('0x3'));var BPromise=require(_0x3bc5('0x4'));var Mustache=require(_0x3bc5('0x5'));var util=require('util');var path=require(_0x3bc5('0x6'));var sox=require(_0x3bc5('0x7'));var csv=require(_0x3bc5('0x8'));var ejs=require(_0x3bc5('0x9'));var fs=require('fs');var fs_extra=require(_0x3bc5('0xa'));var _=require(_0x3bc5('0xb'));var squel=require(_0x3bc5('0xc'));var crypto=require(_0x3bc5('0xd'));var jsforce=require(_0x3bc5('0xe'));var deskjs=require(_0x3bc5('0xf'));var toCsv=require(_0x3bc5('0x8'));var querystring=require(_0x3bc5('0x10'));var Papa=require(_0x3bc5('0x11'));var Redis=require(_0x3bc5('0x12'));var authService=require(_0x3bc5('0x13'));var qs=require(_0x3bc5('0x14'));var as=require(_0x3bc5('0x15'));var hardwareService=require(_0x3bc5('0x16'));var logger=require(_0x3bc5('0x17'))(_0x3bc5('0x18'));var utils=require(_0x3bc5('0x19'));var config=require(_0x3bc5('0x1a'));var licenseUtil=require(_0x3bc5('0x1b'));var db=require(_0x3bc5('0x1c'))['db'];var integrations=require(_0x3bc5('0x1d'));function respondWithStatusCode(_0x2593a0,_0x577d5b){_0x577d5b=_0x577d5b||0xcc;return function(_0x116970){if(_0x116970){return _0x2593a0[_0x3bc5('0x1e')](_0x577d5b);}return _0x2593a0['status'](_0x577d5b)[_0x3bc5('0x1f')]();};}function respondWithResult(_0x2f1c9a,_0x4138bf){_0x4138bf=_0x4138bf||0xc8;return function(_0x6eb78b){if(_0x6eb78b){return _0x2f1c9a[_0x3bc5('0x20')](_0x4138bf)[_0x3bc5('0x21')](_0x6eb78b);}};}function respondWithFilteredResult(_0x4b217f,_0x4cf590){return function(_0x174778){if(_0x174778){var _0xc337e2=typeof _0x4cf590['offset']==='undefined'&&typeof _0x4cf590[_0x3bc5('0x22')]===_0x3bc5('0x23');var _0x55a474=_0x174778[_0x3bc5('0x24')];var _0x4c4e70=_0xc337e2?0x0:_0x4cf590[_0x3bc5('0x25')];var _0x384fd8=_0xc337e2?_0x174778[_0x3bc5('0x24')]:_0x4cf590[_0x3bc5('0x25')]+_0x4cf590[_0x3bc5('0x22')];var _0x5331a0;if(_0x384fd8>=_0x55a474){_0x384fd8=_0x55a474;_0x5331a0=0xc8;}else{_0x5331a0=0xce;}_0x4b217f[_0x3bc5('0x20')](_0x5331a0);return _0x4b217f['set'](_0x3bc5('0x26'),_0x4c4e70+'-'+_0x384fd8+'/'+_0x55a474)['json'](_0x174778);}return null;};}function patchUpdates(_0x3a98c){return function(_0x2b0342){try{jsonpatch[_0x3bc5('0x27')](_0x2b0342,_0x3a98c,!![]);}catch(_0x39a5cb){return BPromise[_0x3bc5('0x28')](_0x39a5cb);}return _0x2b0342[_0x3bc5('0x29')]();};}function saveUpdates(_0x368ccc,_0x39e713){return function(_0x3c2267){if(_0x3c2267){return _0x3c2267[_0x3bc5('0x2a')](_0x368ccc)[_0x3bc5('0x2b')](function(_0x1ba5f1){return _0x1ba5f1;});}return null;};}function removeEntity(_0xfa21db,_0x22670c){return function(_0x5e7b15){if(_0x5e7b15){return _0x5e7b15[_0x3bc5('0x2c')]()[_0x3bc5('0x2b')](function(){_0xfa21db[_0x3bc5('0x20')](0xcc)[_0x3bc5('0x1f')]();});}};}function handleEntityNotFound(_0x3ffa31,_0x307332){return function(_0xd0ac8e){if(!_0xd0ac8e){_0x3ffa31[_0x3bc5('0x1e')](0x194);}return _0xd0ac8e;};}function handleError(_0x3994e1,_0x4391b4){_0x4391b4=_0x4391b4||0x1f4;return function(_0x47de68){logger[_0x3bc5('0x2d')](_0x47de68[_0x3bc5('0x2e')]);if(_0x47de68[_0x3bc5('0x2f')]){delete _0x47de68[_0x3bc5('0x2f')];}_0x3994e1['status'](_0x4391b4)[_0x3bc5('0x30')](_0x47de68);};}exports[_0x3bc5('0x31')]=function(_0x57292f,_0x2dc359){var _0x3f7c1c={},_0x569b52={},_0x349a06={'count':0x0,'rows':[]};var _0x388e04=_[_0x3bc5('0x32')](db['SugarcrmAccount'][_0x3bc5('0x33')],function(_0x47ee13){return{'name':_0x47ee13[_0x3bc5('0x34')],'type':_0x47ee13[_0x3bc5('0x35')][_0x3bc5('0x36')]};});_0x569b52['model']=_[_0x3bc5('0x32')](_0x388e04,_0x3bc5('0x2f'));_0x569b52[_0x3bc5('0x37')]=_[_0x3bc5('0x38')](_0x57292f[_0x3bc5('0x37')]);_0x569b52[_0x3bc5('0x39')]=_[_0x3bc5('0x3a')](_0x569b52['model'],_0x569b52[_0x3bc5('0x37')]);_0x3f7c1c[_0x3bc5('0x3b')]=_[_0x3bc5('0x3a')](_0x569b52['model'],qs[_0x3bc5('0x3c')](_0x57292f[_0x3bc5('0x37')][_0x3bc5('0x3c')]));_0x3f7c1c[_0x3bc5('0x3b')]=_0x3f7c1c[_0x3bc5('0x3b')][_0x3bc5('0x3d')]?_0x3f7c1c[_0x3bc5('0x3b')]:_0x569b52[_0x3bc5('0x3e')];if(!_0x57292f[_0x3bc5('0x37')][_0x3bc5('0x3f')](_0x3bc5('0x40'))){_0x3f7c1c[_0x3bc5('0x22')]=qs['limit'](_0x57292f[_0x3bc5('0x37')][_0x3bc5('0x22')]);_0x3f7c1c[_0x3bc5('0x25')]=qs[_0x3bc5('0x25')](_0x57292f[_0x3bc5('0x37')][_0x3bc5('0x25')]);}_0x3f7c1c['order']=qs[_0x3bc5('0x41')](_0x57292f[_0x3bc5('0x37')][_0x3bc5('0x41')]);_0x3f7c1c[_0x3bc5('0x42')]=qs[_0x3bc5('0x39')](_[_0x3bc5('0x43')](_0x57292f[_0x3bc5('0x37')],_0x569b52[_0x3bc5('0x39')]),_0x388e04);if(_0x57292f[_0x3bc5('0x37')][_0x3bc5('0x44')]){_0x3f7c1c[_0x3bc5('0x42')]=_['merge'](_0x3f7c1c[_0x3bc5('0x42')],{'$or':_[_0x3bc5('0x32')](_0x388e04,function(_0x375077){if(_0x375077[_0x3bc5('0x35')]!==_0x3bc5('0x45')){var _0x3921bb={};_0x3921bb[_0x375077[_0x3bc5('0x2f')]]={'$like':'%'+_0x57292f[_0x3bc5('0x37')][_0x3bc5('0x44')]+'%'};return _0x3921bb;}})});}_0x3f7c1c=_[_0x3bc5('0x46')]({},_0x3f7c1c,_0x57292f[_0x3bc5('0x47')]);var _0x10646b={'where':_0x3f7c1c[_0x3bc5('0x42')]};return db[_0x3bc5('0x48')]['count'](_0x10646b)['then'](function(_0x17f36c){_0x349a06['count']=_0x17f36c;if(_0x57292f[_0x3bc5('0x37')]['includeAll']){_0x3f7c1c['include']=[{'all':!![]}];}return db[_0x3bc5('0x48')][_0x3bc5('0x49')](_0x3f7c1c);})[_0x3bc5('0x2b')](function(_0x4da526){_0x349a06[_0x3bc5('0x4a')]=_0x4da526;return _0x349a06;})[_0x3bc5('0x2b')](respondWithFilteredResult(_0x2dc359,_0x3f7c1c))[_0x3bc5('0x4b')](handleError(_0x2dc359,null));};exports['show']=function(_0x5697dd,_0x1ddd5c){var _0x3c73fc={'raw':![],'where':{'id':_0x5697dd[_0x3bc5('0x4c')]['id']}},_0x2c5f91={};_0x2c5f91[_0x3bc5('0x3e')]=_[_0x3bc5('0x38')](db[_0x3bc5('0x48')][_0x3bc5('0x33')]);_0x2c5f91[_0x3bc5('0x37')]=_[_0x3bc5('0x38')](_0x5697dd[_0x3bc5('0x37')]);_0x2c5f91['filters']=_['intersection'](_0x2c5f91[_0x3bc5('0x3e')],_0x2c5f91['query']);_0x3c73fc['attributes']=_[_0x3bc5('0x3a')](_0x2c5f91[_0x3bc5('0x3e')],qs[_0x3bc5('0x3c')](_0x5697dd['query'][_0x3bc5('0x3c')]));_0x3c73fc['attributes']=_0x3c73fc[_0x3bc5('0x3b')]['length']?_0x3c73fc['attributes']:_0x2c5f91['model'];if(_0x5697dd['query'][_0x3bc5('0x4d')]){_0x3c73fc[_0x3bc5('0x4e')]=[{'all':!![]}];}_0x3c73fc=_[_0x3bc5('0x46')]({},_0x3c73fc,_0x5697dd[_0x3bc5('0x47')]);return db['SugarcrmAccount'][_0x3bc5('0x4f')](_0x3c73fc)[_0x3bc5('0x2b')](handleEntityNotFound(_0x1ddd5c,null))['then'](respondWithResult(_0x1ddd5c,null))[_0x3bc5('0x4b')](handleError(_0x1ddd5c,null));};exports[_0x3bc5('0x50')]=function(_0x540459,_0x3ba7d7){return db[_0x3bc5('0x48')][_0x3bc5('0x50')](_0x540459[_0x3bc5('0x51')],{})['then'](respondWithResult(_0x3ba7d7,0xc9))[_0x3bc5('0x4b')](handleError(_0x3ba7d7,null));};exports[_0x3bc5('0x2a')]=function(_0x30ec9f,_0x1158c8){if(_0x30ec9f[_0x3bc5('0x51')]['id']){delete _0x30ec9f[_0x3bc5('0x51')]['id'];}return db[_0x3bc5('0x48')][_0x3bc5('0x4f')]({'where':{'id':_0x30ec9f[_0x3bc5('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1158c8,null))['then'](saveUpdates(_0x30ec9f[_0x3bc5('0x51')],null))['then'](respondWithResult(_0x1158c8,null))[_0x3bc5('0x4b')](handleError(_0x1158c8,null));};exports[_0x3bc5('0x2c')]=function(_0xcb3ddc,_0x4d224c){return db[_0x3bc5('0x48')]['find']({'where':{'id':_0xcb3ddc['params']['id']}})[_0x3bc5('0x2b')](handleEntityNotFound(_0x4d224c,null))[_0x3bc5('0x2b')](removeEntity(_0x4d224c,null))['catch'](handleError(_0x4d224c,null));};exports[_0x3bc5('0x52')]=function(_0x52a1a7,_0x5c9c33,_0x5dd2fd){var _0x46d531={};var _0x3be12e={};var _0x442cd9;var _0x322c57;return db[_0x3bc5('0x48')][_0x3bc5('0x53')]({'where':{'id':_0x52a1a7['params']['id']}})[_0x3bc5('0x2b')](handleEntityNotFound(_0x5c9c33,null))['then'](function(_0x1019e4){if(_0x1019e4){_0x442cd9=_0x1019e4;_0x3be12e[_0x3bc5('0x3e')]=_[_0x3bc5('0x38')](db[_0x3bc5('0x54')][_0x3bc5('0x33')]);_0x3be12e['query']=_[_0x3bc5('0x38')](_0x52a1a7[_0x3bc5('0x37')]);_0x3be12e['filters']=_[_0x3bc5('0x3a')](_0x3be12e[_0x3bc5('0x3e')],_0x3be12e[_0x3bc5('0x37')]);_0x46d531[_0x3bc5('0x3b')]=_[_0x3bc5('0x3a')](_0x3be12e['model'],qs[_0x3bc5('0x3c')](_0x52a1a7[_0x3bc5('0x37')][_0x3bc5('0x3c')]));_0x46d531['attributes']=_0x46d531[_0x3bc5('0x3b')][_0x3bc5('0x3d')]?_0x46d531[_0x3bc5('0x3b')]:_0x3be12e[_0x3bc5('0x3e')];_0x46d531[_0x3bc5('0x55')]=qs[_0x3bc5('0x41')](_0x52a1a7[_0x3bc5('0x37')]['sort']);_0x46d531['where']=qs[_0x3bc5('0x39')](_[_0x3bc5('0x43')](_0x52a1a7[_0x3bc5('0x37')],_0x3be12e['filters']));if(_0x52a1a7[_0x3bc5('0x37')][_0x3bc5('0x44')]){_0x46d531[_0x3bc5('0x42')]=_[_0x3bc5('0x46')](_0x46d531['where'],{'$or':_[_0x3bc5('0x32')](_0x46d531['attributes'],function(_0x28bf2a){var _0x119f90={};_0x119f90[_0x28bf2a]={'$like':'%'+_0x52a1a7[_0x3bc5('0x37')][_0x3bc5('0x44')]+'%'};return _0x119f90;})});}_0x46d531=_[_0x3bc5('0x46')]({},_0x46d531,_0x52a1a7[_0x3bc5('0x47')]);return _0x442cd9[_0x3bc5('0x52')](_0x46d531);}})[_0x3bc5('0x2b')](function(_0x2e1aae){if(_0x2e1aae){_0x322c57=_0x2e1aae[_0x3bc5('0x3d')];if(!_0x52a1a7[_0x3bc5('0x37')][_0x3bc5('0x3f')](_0x3bc5('0x40'))){_0x46d531[_0x3bc5('0x22')]=qs[_0x3bc5('0x22')](_0x52a1a7[_0x3bc5('0x37')][_0x3bc5('0x22')]);_0x46d531['offset']=qs[_0x3bc5('0x25')](_0x52a1a7[_0x3bc5('0x37')]['offset']);}return _0x442cd9[_0x3bc5('0x52')](_0x46d531);}})[_0x3bc5('0x2b')](function(_0x260607){if(_0x260607){return _0x260607?{'count':_0x322c57,'rows':_0x260607}:null;}})['then'](respondWithResult(_0x5c9c33,null))[_0x3bc5('0x4b')](handleError(_0x5c9c33,null));};exports[_0x3bc5('0x56')]=function(_0x5af418,_0xc49cba,_0x568b94){if(_0x5af418['body']['id']){delete _0x5af418[_0x3bc5('0x51')]['id'];}return db[_0x3bc5('0x48')]['findOne']({'where':{'id':_0x5af418[_0x3bc5('0x4c')]['id']}})[_0x3bc5('0x2b')](handleEntityNotFound(_0xc49cba,null))['then'](function(_0x228199){if(_0x228199){_0x5af418[_0x3bc5('0x51')]['AccountId']=_0x228199['id'];_0x5af418['body'][_0x3bc5('0x57')]=integrations[_0x3bc5('0x58')](_0x5af418[_0x3bc5('0x51')][_0x3bc5('0x59')],_0x5af418[_0x3bc5('0x51')]['type']);_0x5af418['body'][_0x3bc5('0x5a')]=integrations['getDescriptions'](_0x5af418['body']['channel'],_0x5af418[_0x3bc5('0x51')][_0x3bc5('0x35')]);return db[_0x3bc5('0x54')][_0x3bc5('0x50')](_0x5af418['body'],{'include':[{'model':db[_0x3bc5('0x5b')],'as':_0x3bc5('0x57')},{'model':db[_0x3bc5('0x5b')],'as':_0x3bc5('0x5a')}]});}return null;})['then'](respondWithResult(_0xc49cba,null))[_0x3bc5('0x4b')](handleError(_0xc49cba,null));};exports['getFields']=function(_0x1bbaca,_0x4afc42,_0x15d40b){var _0x1372a2='';var _0x26bd08=['id','name',_0x3bc5('0x5c'),_0x3bc5('0x5d'),'description',_0x3bc5('0x5e'),_0x3bc5('0x5f'),'duration_minutes',_0x3bc5('0x60'),_0x3bc5('0x61'),_0x3bc5('0x62'),'direction'];return db[_0x3bc5('0x48')][_0x3bc5('0x53')]({'where':{'id':_0x1bbaca[_0x3bc5('0x4c')]['id']},'attributes':['id',_0x3bc5('0x63'),'password',_0x3bc5('0x64')]})[_0x3bc5('0x2b')](handleEntityNotFound(_0x4afc42,null))[_0x3bc5('0x2b')](function(_0x569cdd){if(_0x569cdd){_0x1372a2=_0x569cdd['remoteUri'];var _0x1d91ab=_0x1372a2[_0x3bc5('0x65')](-0x1);if(_0x1d91ab==='/'){_0x1372a2=_0x1372a2[_0x3bc5('0x66')](0x0,_0x1372a2[_0x3bc5('0x67')](_0x1d91ab));}return rp({'method':_0x3bc5('0x68'),'uri':util[_0x3bc5('0x69')](_0x3bc5('0x6a'),_0x1372a2,_0x3bc5('0x6b')),'json':!![],'form':{'method':'login','input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x3bc5('0x6c')]({'user_auth':{'user_name':_0x569cdd[_0x3bc5('0x63')],'password':_0x569cdd[_0x3bc5('0x6d')],'encryption':_0x3bc5('0x6e')},'application':_0x3bc5('0x6f')})}});}})[_0x3bc5('0x2b')](function(_0x5ae350){if(_0x5ae350&&_0x5ae350[_0x3bc5('0x2f')]!=='Invalid\x20Login'&&_0x5ae350['name']!==_0x3bc5('0x70')){return rp({'method':_0x3bc5('0x68'),'uri':util[_0x3bc5('0x69')](_0x3bc5('0x6a'),_0x1372a2,_0x3bc5('0x6b')),'json':!![],'form':{'method':_0x3bc5('0x71'),'input_type':_0x3bc5('0x72'),'response_type':_0x3bc5('0x72'),'rest_data':JSON[_0x3bc5('0x6c')]({'session':_0x5ae350['id'],'module_name':_0x3bc5('0x73')})}})[_0x3bc5('0x2b')](function(_0x1f728c){if(_0x1f728c){var _0x1e6db7=_[_0x3bc5('0x74')](_0x1f728c[_0x3bc5('0x75')]);_[_0x3bc5('0x76')](_0x1e6db7,function(_0x5a2bf4){return _0x26bd08[_0x3bc5('0x77')](_0x5a2bf4[_0x3bc5('0x2f')]);});return{'count':_0x1e6db7[_0x3bc5('0x3d')],'rows':_[_0x3bc5('0x32')](_0x1e6db7,function(_0x3c3948){return{'id':_0x3c3948['name'],'name':_0x3c3948['label'],'custom':_[_0x3bc5('0x78')](_0x3c3948[_0x3bc5('0x2f')],'_c')?!![]:![],'options':_0x3c3948['options']?_[_0x3bc5('0x32')](_[_0x3bc5('0x74')](_0x3c3948[_0x3bc5('0x47')]),function(_0x4e9995){return{'name':_0x4e9995[_0x3bc5('0x79')],'value':_0x4e9995[_0x3bc5('0x2f')]};}):[]};})};}})[_0x3bc5('0x2b')](respondWithResult(_0x4afc42,null))[_0x3bc5('0x4b')](function(_0x13d701){var _0x340314=_0x1bbaca[_0x3bc5('0x37')][_0x3bc5('0x7a')]?0x1f4:_0x13d701['statusCode']||0x1f4;logger['error'](_0x3bc5('0x7b'),_0x3bc5('0x7c'),_0x340314,JSON[_0x3bc5('0x6c')](_0x13d701));delete _0x13d701['name'];if(_0x340314===0x191){_0x340314=0x190;}_0x4afc42['status'](_0x340314)[_0x3bc5('0x30')](_0x1bbaca[_0x3bc5('0x37')][_0x3bc5('0x7a')]?{'message':_0x3bc5('0x7d'),'statusCode':_0x13d701[_0x3bc5('0x7e')]}:_0x13d701);});}else{var _0x40b3c3=0x1f4;_0x4afc42[_0x3bc5('0x20')](_0x40b3c3)[_0x3bc5('0x30')]({'message':_0x3bc5('0x7d'),'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 d161ded..344006b 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 _0x2580=['../../components/integrations/configuration','exports','define','SugarcrmAccount','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./intSugarcrmAccount.attributes'];(function(_0x3958fe,_0x3c6605){var _0x1f27d6=function(_0x2bfb4a){while(--_0x2bfb4a){_0x3958fe['push'](_0x3958fe['shift']());}};_0x1f27d6(++_0x3c6605);}(_0x2580,0x156));var _0x0258=function(_0x328751,_0x3d5675){_0x328751=_0x328751-0x0;var _0x556bf2=_0x2580[_0x328751];return _0x556bf2;};'use strict';var _=require(_0x0258('0x0'));var util=require(_0x0258('0x1'));var logger=require(_0x0258('0x2'))('api');var moment=require(_0x0258('0x3'));var BPromise=require(_0x0258('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0258('0x5'));var rimraf=require(_0x0258('0x6'));var config=require(_0x0258('0x7'));var attributes=require(_0x0258('0x8'));var integrations=require(_0x0258('0x9'));module[_0x0258('0xa')]=function(_0x1f53a4,_0x3bcf82){return _0x1f53a4[_0x0258('0xb')](_0x0258('0xc'),attributes,{'tableName':'int_sugarcrm_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4365=['int_sugarcrm_accounts','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','define'];(function(_0x30cd1e,_0x21f3e6){var _0x8d8dc7=function(_0x353499){while(--_0x353499){_0x30cd1e['push'](_0x30cd1e['shift']());}};_0x8d8dc7(++_0x21f3e6);}(_0x4365,0x143));var _0x5436=function(_0x1460f6,_0x59051a){_0x1460f6=_0x1460f6-0x0;var _0x46ce94=_0x4365[_0x1460f6];return _0x46ce94;};'use strict';var _=require(_0x5436('0x0'));var util=require(_0x5436('0x1'));var logger=require('../../config/logger')(_0x5436('0x2'));var moment=require(_0x5436('0x3'));var BPromise=require(_0x5436('0x4'));var rp=require(_0x5436('0x5'));var fs=require('fs');var path=require(_0x5436('0x6'));var rimraf=require(_0x5436('0x7'));var config=require(_0x5436('0x8'));var attributes=require(_0x5436('0x9'));var integrations=require(_0x5436('0xa'));module[_0x5436('0xb')]=function(_0x3ec009,_0x15f92f){return _0x3ec009[_0x5436('0xc')]('SugarcrmAccount',attributes,{'tableName':_0x5436('0xd'),'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 3c81d00..7cbace4 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 _0xd355=['client','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','where','attributes','limit','map','include','model','ShowSugarcrmAccount','lodash','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise'];(function(_0x496b57,_0x14e643){var _0x18e32d=function(_0x18b117){while(--_0x18b117){_0x496b57['push'](_0x496b57['shift']());}};_0x18e32d(++_0x14e643);}(_0xd355,0x18d));var _0x5d35=function(_0x566d7d,_0x1771c8){_0x566d7d=_0x566d7d-0x0;var _0x459839=_0xd355[_0x566d7d];return _0x459839;};'use strict';var _=require(_0x5d35('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5d35('0x1'));var fs=require('fs');var Redis=require(_0x5d35('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x5d35('0x3'));var logger=require(_0x5d35('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x5d35('0x5'));var client=jayson[_0x5d35('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2f1f86,_0x4bc2b,_0x2d31f5){return new BPromise(function(_0x2d04f3,_0x5a6626){return client[_0x5d35('0x7')](_0x2f1f86,_0x2d31f5)[_0x5d35('0x8')](function(_0x450a37){logger[_0x5d35('0x9')](_0x5d35('0xa'),_0x4bc2b,_0x5d35('0xb'));logger[_0x5d35('0xc')](_0x5d35('0xd'),_0x4bc2b,'request\x20sent',JSON[_0x5d35('0xe')](_0x450a37));if(_0x450a37[_0x5d35('0xf')]){if(_0x450a37[_0x5d35('0xf')]['code']===0x1f4){logger[_0x5d35('0xf')](_0x5d35('0xa'),_0x4bc2b,_0x450a37[_0x5d35('0xf')][_0x5d35('0x10')]);return _0x5a6626(_0x450a37[_0x5d35('0xf')][_0x5d35('0x10')]);}logger[_0x5d35('0xf')]('SugarcrmAccount,\x20%s,\x20%s',_0x4bc2b,_0x450a37[_0x5d35('0xf')]['message']);return _0x2d04f3(_0x450a37[_0x5d35('0xf')]['message']);}else{logger[_0x5d35('0x9')]('SugarcrmAccount,\x20%s,\x20%s',_0x4bc2b,_0x5d35('0xb'));_0x2d04f3(_0x450a37[_0x5d35('0x11')]['message']);}})[_0x5d35('0x12')](function(_0x41391d){logger[_0x5d35('0xf')](_0x5d35('0xa'),_0x4bc2b,_0x41391d);_0x5a6626(_0x41391d);});});}exports[_0x5d35('0x13')]=function(_0x5ca68b){var _0x4b2f46=this;return new Promise(function(_0xf7bb60,_0xa02b17){return db[_0x5d35('0x14')][_0x5d35('0x15')]({'raw':_0x5ca68b[_0x5d35('0x16')]?_0x5ca68b[_0x5d35('0x16')][_0x5d35('0x17')]===undefined?!![]:![]:!![],'where':_0x5ca68b['options']?_0x5ca68b[_0x5d35('0x16')][_0x5d35('0x18')]||null:null,'attributes':_0x5ca68b[_0x5d35('0x16')]?_0x5ca68b[_0x5d35('0x16')][_0x5d35('0x19')]||null:null,'limit':_0x5ca68b[_0x5d35('0x16')]?_0x5ca68b[_0x5d35('0x16')][_0x5d35('0x1a')]||null:null,'include':_0x5ca68b['options']?_0x5ca68b[_0x5d35('0x16')]['include']?_[_0x5d35('0x1b')](_0x5ca68b['options'][_0x5d35('0x1c')],function(_0x481733){return{'model':db[_0x481733[_0x5d35('0x1d')]],'as':_0x481733['as'],'attributes':_0x481733[_0x5d35('0x19')],'include':_0x481733[_0x5d35('0x1c')]?_[_0x5d35('0x1b')](_0x481733['include'],function(_0x20046b){return{'model':db[_0x20046b['model']],'as':_0x20046b['as'],'attributes':_0x20046b[_0x5d35('0x19')],'include':_0x20046b['include']?_[_0x5d35('0x1b')](_0x20046b[_0x5d35('0x1c')],function(_0x2aae34){return{'model':db[_0x2aae34[_0x5d35('0x1d')]],'as':_0x2aae34['as'],'attributes':_0x2aae34[_0x5d35('0x19')]};}):[]};}):[]};}):[]:[]})[_0x5d35('0x8')](function(_0x10a79f){logger['info'](_0x5d35('0x13'),_0x5ca68b);logger[_0x5d35('0xc')](_0x5d35('0x13'),_0x5ca68b,JSON['stringify'](_0x10a79f));_0xf7bb60(_0x10a79f);})['catch'](function(_0x2d5182){logger[_0x5d35('0xf')](_0x5d35('0x13'),_0x2d5182[_0x5d35('0x10')],_0x5ca68b);_0xa02b17(_0x4b2f46[_0x5d35('0xf')](0x1f4,_0x2d5182[_0x5d35('0x10')]));});});};exports[_0x5d35('0x1e')]=function(_0x1247b9){var _0x154d9e=this;return new Promise(function(_0x44bd80,_0x2e862f){return db[_0x5d35('0x14')]['find']({'raw':_0x1247b9[_0x5d35('0x16')]?_0x1247b9[_0x5d35('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x1247b9['options']?_0x1247b9['options'][_0x5d35('0x18')]||null:null,'attributes':_0x1247b9[_0x5d35('0x16')]?_0x1247b9[_0x5d35('0x16')][_0x5d35('0x19')]||null:null,'include':_0x1247b9[_0x5d35('0x16')]?_0x1247b9[_0x5d35('0x16')][_0x5d35('0x1c')]?_[_0x5d35('0x1b')](_0x1247b9['options'][_0x5d35('0x1c')],function(_0x1019e9){return{'model':db[_0x1019e9[_0x5d35('0x1d')]],'as':_0x1019e9['as'],'attributes':_0x1019e9['attributes'],'include':_0x1019e9[_0x5d35('0x1c')]?_[_0x5d35('0x1b')](_0x1019e9[_0x5d35('0x1c')],function(_0xfdb15){return{'model':db[_0xfdb15[_0x5d35('0x1d')]],'as':_0xfdb15['as'],'attributes':_0xfdb15[_0x5d35('0x19')],'include':_0xfdb15[_0x5d35('0x1c')]?_[_0x5d35('0x1b')](_0xfdb15[_0x5d35('0x1c')],function(_0x589b1){return{'model':db[_0x589b1['model']],'as':_0x589b1['as'],'attributes':_0x589b1[_0x5d35('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x57ee5d){logger['info'](_0x5d35('0x1e'),_0x1247b9);logger[_0x5d35('0xc')](_0x5d35('0x1e'),_0x1247b9,JSON[_0x5d35('0xe')](_0x57ee5d));_0x44bd80(_0x57ee5d);})[_0x5d35('0x12')](function(_0x5e3dfc){logger[_0x5d35('0xf')](_0x5d35('0x1e'),_0x5e3dfc[_0x5d35('0x10')],_0x1247b9);_0x2e862f(_0x154d9e[_0x5d35('0xf')](0x1f4,_0x5e3dfc[_0x5d35('0x10')]));});});}; \ No newline at end of file +var _0x6c00=['findAll','options','raw','where','attributes','limit','map','model','include','then','GetSugarcrmAccount','ShowSugarcrmAccount','find','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','SugarcrmAccount,\x20%s,\x20%s','message','result','catch','SugarcrmAccount'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0x6c00,0x135));var _0x06c0=function(_0x2665a3,_0x3bac99){_0x2665a3=_0x2665a3-0x0;var _0x586de6=_0x6c00[_0x2665a3];return _0x586de6;};'use strict';var _=require('lodash');var util=require(_0x06c0('0x0'));var moment=require(_0x06c0('0x1'));var BPromise=require(_0x06c0('0x2'));var rs=require(_0x06c0('0x3'));var fs=require('fs');var Redis=require(_0x06c0('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x06c0('0x5'))(_0x06c0('0x6'));var config=require(_0x06c0('0x7'));var jayson=require(_0x06c0('0x8'));var client=jayson[_0x06c0('0x9')][_0x06c0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3281e1,_0x20c88e,_0x3c0632){return new BPromise(function(_0x7232b4,_0x53388d){return client[_0x06c0('0xb')](_0x3281e1,_0x3c0632)['then'](function(_0x4cc5d6){logger[_0x06c0('0xc')]('SugarcrmAccount,\x20%s,\x20%s',_0x20c88e,_0x06c0('0xd'));logger[_0x06c0('0xe')](_0x06c0('0xf'),_0x20c88e,_0x06c0('0xd'),JSON[_0x06c0('0x10')](_0x4cc5d6));if(_0x4cc5d6['error']){if(_0x4cc5d6[_0x06c0('0x11')][_0x06c0('0x12')]===0x1f4){logger[_0x06c0('0x11')](_0x06c0('0x13'),_0x20c88e,_0x4cc5d6[_0x06c0('0x11')][_0x06c0('0x14')]);return _0x53388d(_0x4cc5d6[_0x06c0('0x11')][_0x06c0('0x14')]);}logger['error'](_0x06c0('0x13'),_0x20c88e,_0x4cc5d6[_0x06c0('0x11')]['message']);return _0x7232b4(_0x4cc5d6['error'][_0x06c0('0x14')]);}else{logger['info']('SugarcrmAccount,\x20%s,\x20%s',_0x20c88e,_0x06c0('0xd'));_0x7232b4(_0x4cc5d6[_0x06c0('0x15')][_0x06c0('0x14')]);}})[_0x06c0('0x16')](function(_0x4b8987){logger['error'](_0x06c0('0x13'),_0x20c88e,_0x4b8987);_0x53388d(_0x4b8987);});});}exports['GetSugarcrmAccount']=function(_0x7e08b2){var _0x3ad484=this;return new Promise(function(_0x1a13a1,_0x3c9bee){return db[_0x06c0('0x17')][_0x06c0('0x18')]({'raw':_0x7e08b2[_0x06c0('0x19')]?_0x7e08b2[_0x06c0('0x19')][_0x06c0('0x1a')]===undefined?!![]:![]:!![],'where':_0x7e08b2[_0x06c0('0x19')]?_0x7e08b2[_0x06c0('0x19')][_0x06c0('0x1b')]||null:null,'attributes':_0x7e08b2['options']?_0x7e08b2['options'][_0x06c0('0x1c')]||null:null,'limit':_0x7e08b2['options']?_0x7e08b2[_0x06c0('0x19')][_0x06c0('0x1d')]||null:null,'include':_0x7e08b2[_0x06c0('0x19')]?_0x7e08b2['options']['include']?_[_0x06c0('0x1e')](_0x7e08b2['options']['include'],function(_0x15da84){return{'model':db[_0x15da84[_0x06c0('0x1f')]],'as':_0x15da84['as'],'attributes':_0x15da84['attributes'],'include':_0x15da84['include']?_[_0x06c0('0x1e')](_0x15da84['include'],function(_0x3aa0e1){return{'model':db[_0x3aa0e1[_0x06c0('0x1f')]],'as':_0x3aa0e1['as'],'attributes':_0x3aa0e1[_0x06c0('0x1c')],'include':_0x3aa0e1[_0x06c0('0x20')]?_['map'](_0x3aa0e1[_0x06c0('0x20')],function(_0x39cc60){return{'model':db[_0x39cc60['model']],'as':_0x39cc60['as'],'attributes':_0x39cc60['attributes']};}):[]};}):[]};}):[]:[]})[_0x06c0('0x21')](function(_0x3fe164){logger[_0x06c0('0xc')](_0x06c0('0x22'),_0x7e08b2);logger[_0x06c0('0xe')](_0x06c0('0x22'),_0x7e08b2,JSON[_0x06c0('0x10')](_0x3fe164));_0x1a13a1(_0x3fe164);})[_0x06c0('0x16')](function(_0x17a874){logger['error']('GetSugarcrmAccount',_0x17a874[_0x06c0('0x14')],_0x7e08b2);_0x3c9bee(_0x3ad484[_0x06c0('0x11')](0x1f4,_0x17a874[_0x06c0('0x14')]));});});};exports[_0x06c0('0x23')]=function(_0x58aca8){var _0x141aa9=this;return new Promise(function(_0x49062a,_0x1a4f7c){return db[_0x06c0('0x17')][_0x06c0('0x24')]({'raw':_0x58aca8[_0x06c0('0x19')]?_0x58aca8['options'][_0x06c0('0x1a')]===undefined?!![]:![]:!![],'where':_0x58aca8[_0x06c0('0x19')]?_0x58aca8[_0x06c0('0x19')][_0x06c0('0x1b')]||null:null,'attributes':_0x58aca8[_0x06c0('0x19')]?_0x58aca8[_0x06c0('0x19')]['attributes']||null:null,'include':_0x58aca8['options']?_0x58aca8[_0x06c0('0x19')][_0x06c0('0x20')]?_[_0x06c0('0x1e')](_0x58aca8[_0x06c0('0x19')]['include'],function(_0x26a00e){return{'model':db[_0x26a00e[_0x06c0('0x1f')]],'as':_0x26a00e['as'],'attributes':_0x26a00e[_0x06c0('0x1c')],'include':_0x26a00e[_0x06c0('0x20')]?_[_0x06c0('0x1e')](_0x26a00e[_0x06c0('0x20')],function(_0x2028cb){return{'model':db[_0x2028cb['model']],'as':_0x2028cb['as'],'attributes':_0x2028cb['attributes'],'include':_0x2028cb['include']?_[_0x06c0('0x1e')](_0x2028cb[_0x06c0('0x20')],function(_0x5655ba){return{'model':db[_0x5655ba[_0x06c0('0x1f')]],'as':_0x5655ba['as'],'attributes':_0x5655ba['attributes']};}):[]};}):[]};}):[]:[]})[_0x06c0('0x21')](function(_0x29fea0){logger['info'](_0x06c0('0x23'),_0x58aca8);logger[_0x06c0('0xe')](_0x06c0('0x23'),_0x58aca8,JSON[_0x06c0('0x10')](_0x29fea0));_0x49062a(_0x29fea0);})[_0x06c0('0x16')](function(_0x1333c8){logger[_0x06c0('0x11')]('ShowSugarcrmAccount',_0x1333c8[_0x06c0('0x14')],_0x58aca8);_0x1a4f7c(_0x141aa9[_0x06c0('0x11')](0x1f4,_0x1333c8[_0x06c0('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 2f6e601..13759fd 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 _0x3521=['get','show','getFields','/:id/subjects','getSubjects','getDescriptions','post','create','put','/:id','update','delete','exports','multer','util','connect-timeout','express','fs-extra','../../config/environment','./intSugarcrmConfiguration.controller','isAuthenticated','index'];(function(_0x29b609,_0x19d388){var _0x54c952=function(_0xb3c38d){while(--_0xb3c38d){_0x29b609['push'](_0x29b609['shift']());}};_0x54c952(++_0x19d388);}(_0x3521,0x183));var _0x1352=function(_0x4db25c,_0x2468ef){_0x4db25c=_0x4db25c-0x0;var _0x6cb1d2=_0x3521[_0x4db25c];return _0x6cb1d2;};'use strict';var multer=require(_0x1352('0x0'));var util=require(_0x1352('0x1'));var path=require('path');var timeout=require(_0x1352('0x2'));var express=require(_0x1352('0x3'));var router=express['Router']();var fs_extra=require(_0x1352('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1352('0x5'));var controller=require(_0x1352('0x6'));router['get']('/',auth[_0x1352('0x7')](),controller[_0x1352('0x8')]);router[_0x1352('0x9')]('/:id',auth[_0x1352('0x7')](),controller[_0x1352('0xa')]);router[_0x1352('0x9')]('/:id/fields',auth['isAuthenticated'](),controller[_0x1352('0xb')]);router[_0x1352('0x9')](_0x1352('0xc'),auth['isAuthenticated'](),controller[_0x1352('0xd')]);router[_0x1352('0x9')]('/:id/descriptions',auth[_0x1352('0x7')](),controller[_0x1352('0xe')]);router[_0x1352('0xf')]('/',auth[_0x1352('0x7')](),controller[_0x1352('0x10')]);router[_0x1352('0x11')](_0x1352('0x12'),auth[_0x1352('0x7')](),controller[_0x1352('0x13')]);router[_0x1352('0x14')](_0x1352('0x12'),auth[_0x1352('0x7')](),controller['destroy']);module[_0x1352('0x15')]=router; \ No newline at end of file +var _0x3521=['getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','destroy','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','isAuthenticated','index','get','/:id','/:id/fields','getFields','/:id/subjects'];(function(_0x848da6,_0x1d1701){var _0x1c4a38=function(_0xa17960){while(--_0xa17960){_0x848da6['push'](_0x848da6['shift']());}};_0x1c4a38(++_0x1d1701);}(_0x3521,0x129));var _0x1352=function(_0x3c4087,_0x5c764b){_0x3c4087=_0x3c4087-0x0;var _0x23ad1f=_0x3521[_0x3c4087];return _0x23ad1f;};'use strict';var multer=require(_0x1352('0x0'));var util=require('util');var path=require(_0x1352('0x1'));var timeout=require(_0x1352('0x2'));var express=require(_0x1352('0x3'));var router=express[_0x1352('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x1352('0x5'));var config=require(_0x1352('0x6'));var controller=require(_0x1352('0x7'));router['get']('/',auth[_0x1352('0x8')](),controller[_0x1352('0x9')]);router[_0x1352('0xa')](_0x1352('0xb'),auth[_0x1352('0x8')](),controller['show']);router[_0x1352('0xa')](_0x1352('0xc'),auth['isAuthenticated'](),controller[_0x1352('0xd')]);router[_0x1352('0xa')](_0x1352('0xe'),auth['isAuthenticated'](),controller[_0x1352('0xf')]);router[_0x1352('0xa')](_0x1352('0x10'),auth[_0x1352('0x8')](),controller[_0x1352('0x11')]);router[_0x1352('0x12')]('/',auth['isAuthenticated'](),controller[_0x1352('0x13')]);router[_0x1352('0x14')](_0x1352('0xb'),auth[_0x1352('0x8')](),controller[_0x1352('0x15')]);router[_0x1352('0x16')](_0x1352('0xb'),auth[_0x1352('0x8')](),controller[_0x1352('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index faa3b31..11868f2 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 _0x75b4=['STRING','sequelize','exports'];(function(_0x2f3efc,_0xaa499c){var _0x292c57=function(_0x408181){while(--_0x408181){_0x2f3efc['push'](_0x2f3efc['shift']());}};_0x292c57(++_0xaa499c);}(_0x75b4,0x1cf));var _0x475b=function(_0xc11425,_0x415f2b){_0xc11425=_0xc11425-0x0;var _0x3a4f17=_0x75b4[_0xc11425];return _0x3a4f17;};'use strict';var Sequelize=require(_0x475b('0x0'));module[_0x475b('0x1')]={'name':{'type':Sequelize[_0x475b('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x9177=['STRING','sequelize','exports'];(function(_0x5037ab,_0x43209e){var _0x512adb=function(_0x261783){while(--_0x261783){_0x5037ab['push'](_0x5037ab['shift']());}};_0x512adb(++_0x43209e);}(_0x9177,0x157));var _0x7917=function(_0x4ee9cd,_0xd375b0){_0x4ee9cd=_0x4ee9cd-0x0;var _0x328a5b=_0x9177[_0x4ee9cd];return _0x328a5b;};'use strict';var Sequelize=require(_0x7917('0x0'));module[_0x7917('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x7917('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index c3e490a..33881f0 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 _0xdc52=['ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','count','offset','limit','set','Content-Range','save','update','then','sendStatus','error','name','send','index','map','rawAttributes','fieldName','type','query','intersection','model','attributes','fields','order','sort','pick','filters','filter','merge','where','options','SugarcrmConfiguration','includeAll','findAll','rows','catch','show','keys','length','include','find','create','body','params','destroy','getFields','findOne','SugarcrmField','nolimit','getSubjects','hasOwnProperty','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv'];(function(_0x5e51e,_0x4ad2a7){var _0x4268a8=function(_0x3f75c3){while(--_0x3f75c3){_0x5e51e['push'](_0x5e51e['shift']());}};_0x4268a8(++_0x4ad2a7);}(_0xdc52,0x1e8));var _0x2dc5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdc52[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x2dc5('0x0'));var rimraf=require(_0x2dc5('0x1'));var zipdir=require(_0x2dc5('0x2'));var jsonpatch=require(_0x2dc5('0x3'));var rp=require(_0x2dc5('0x4'));var moment=require(_0x2dc5('0x5'));var BPromise=require(_0x2dc5('0x6'));var Mustache=require(_0x2dc5('0x7'));var util=require('util');var path=require('path');var sox=require(_0x2dc5('0x8'));var csv=require(_0x2dc5('0x9'));var ejs=require(_0x2dc5('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2dc5('0xb'));var squel=require('squel');var crypto=require(_0x2dc5('0xc'));var jsforce=require(_0x2dc5('0xd'));var deskjs=require(_0x2dc5('0xe'));var toCsv=require('to-csv');var querystring=require(_0x2dc5('0xf'));var Papa=require(_0x2dc5('0x10'));var Redis=require(_0x2dc5('0x11'));var authService=require(_0x2dc5('0x12'));var qs=require(_0x2dc5('0x13'));var as=require(_0x2dc5('0x14'));var hardwareService=require(_0x2dc5('0x15'));var logger=require(_0x2dc5('0x16'))(_0x2dc5('0x17'));var utils=require(_0x2dc5('0x18'));var config=require(_0x2dc5('0x19'));var licenseUtil=require(_0x2dc5('0x1a'));var db=require(_0x2dc5('0x1b'))['db'];function respondWithStatusCode(_0x424cc5,_0x2a778a){_0x2a778a=_0x2a778a||0xcc;return function(_0x2badca){if(_0x2badca){return _0x424cc5['sendStatus'](_0x2a778a);}return _0x424cc5[_0x2dc5('0x1c')](_0x2a778a)[_0x2dc5('0x1d')]();};}function respondWithResult(_0x6425c,_0xcc4b30){_0xcc4b30=_0xcc4b30||0xc8;return function(_0x97e564){if(_0x97e564){return _0x6425c['status'](_0xcc4b30)[_0x2dc5('0x1e')](_0x97e564);}};}function respondWithFilteredResult(_0x36e198,_0x4288d9){return function(_0x20ee6b){if(_0x20ee6b){var _0x235b23=typeof _0x4288d9['offset']==='undefined'&&typeof _0x4288d9['limit']===_0x2dc5('0x1f');var _0x5d5bdf=_0x20ee6b[_0x2dc5('0x20')];var _0x3ec97f=_0x235b23?0x0:_0x4288d9[_0x2dc5('0x21')];var _0x144195=_0x235b23?_0x20ee6b[_0x2dc5('0x20')]:_0x4288d9[_0x2dc5('0x21')]+_0x4288d9[_0x2dc5('0x22')];var _0x435bca;if(_0x144195>=_0x5d5bdf){_0x144195=_0x5d5bdf;_0x435bca=0xc8;}else{_0x435bca=0xce;}_0x36e198[_0x2dc5('0x1c')](_0x435bca);return _0x36e198[_0x2dc5('0x23')](_0x2dc5('0x24'),_0x3ec97f+'-'+_0x144195+'/'+_0x5d5bdf)[_0x2dc5('0x1e')](_0x20ee6b);}return null;};}function patchUpdates(_0x4c8808){return function(_0x3a1578){try{jsonpatch['apply'](_0x3a1578,_0x4c8808,!![]);}catch(_0x202bed){return BPromise['reject'](_0x202bed);}return _0x3a1578[_0x2dc5('0x25')]();};}function saveUpdates(_0x55e5f6,_0x1ba198){return function(_0x675dff){if(_0x675dff){return _0x675dff[_0x2dc5('0x26')](_0x55e5f6)['then'](function(_0x25ff67){return _0x25ff67;});}return null;};}function removeEntity(_0x2b3fae,_0x1c5095){return function(_0x553e36){if(_0x553e36){return _0x553e36['destroy']()[_0x2dc5('0x27')](function(){_0x2b3fae['status'](0xcc)[_0x2dc5('0x1d')]();});}};}function handleEntityNotFound(_0x28f912,_0x4d3789){return function(_0x545cc7){if(!_0x545cc7){_0x28f912[_0x2dc5('0x28')](0x194);}return _0x545cc7;};}function handleError(_0x5911d5,_0x4917dc){_0x4917dc=_0x4917dc||0x1f4;return function(_0x4c3b83){logger[_0x2dc5('0x29')](_0x4c3b83['stack']);if(_0x4c3b83[_0x2dc5('0x2a')]){delete _0x4c3b83[_0x2dc5('0x2a')];}_0x5911d5[_0x2dc5('0x1c')](_0x4917dc)[_0x2dc5('0x2b')](_0x4c3b83);};}exports[_0x2dc5('0x2c')]=function(_0x357dd9,_0x1d6c19){var _0xd2cc74={},_0x54b3dc={},_0x4c7c8a={'count':0x0,'rows':[]};var _0x1c15f4=_[_0x2dc5('0x2d')](db['SugarcrmConfiguration'][_0x2dc5('0x2e')],function(_0xf71212){return{'name':_0xf71212[_0x2dc5('0x2f')],'type':_0xf71212[_0x2dc5('0x30')]['key']};});_0x54b3dc['model']=_[_0x2dc5('0x2d')](_0x1c15f4,_0x2dc5('0x2a'));_0x54b3dc[_0x2dc5('0x31')]=_['keys'](_0x357dd9[_0x2dc5('0x31')]);_0x54b3dc['filters']=_[_0x2dc5('0x32')](_0x54b3dc[_0x2dc5('0x33')],_0x54b3dc[_0x2dc5('0x31')]);_0xd2cc74[_0x2dc5('0x34')]=_[_0x2dc5('0x32')](_0x54b3dc[_0x2dc5('0x33')],qs['fields'](_0x357dd9[_0x2dc5('0x31')][_0x2dc5('0x35')]));_0xd2cc74[_0x2dc5('0x34')]=_0xd2cc74[_0x2dc5('0x34')]['length']?_0xd2cc74[_0x2dc5('0x34')]:_0x54b3dc[_0x2dc5('0x33')];if(!_0x357dd9[_0x2dc5('0x31')]['hasOwnProperty']('nolimit')){_0xd2cc74[_0x2dc5('0x22')]=qs[_0x2dc5('0x22')](_0x357dd9['query'][_0x2dc5('0x22')]);_0xd2cc74[_0x2dc5('0x21')]=qs[_0x2dc5('0x21')](_0x357dd9[_0x2dc5('0x31')][_0x2dc5('0x21')]);}_0xd2cc74[_0x2dc5('0x36')]=qs[_0x2dc5('0x37')](_0x357dd9[_0x2dc5('0x31')][_0x2dc5('0x37')]);_0xd2cc74['where']=qs['filters'](_[_0x2dc5('0x38')](_0x357dd9['query'],_0x54b3dc[_0x2dc5('0x39')]),_0x1c15f4);if(_0x357dd9[_0x2dc5('0x31')][_0x2dc5('0x3a')]){_0xd2cc74['where']=_[_0x2dc5('0x3b')](_0xd2cc74[_0x2dc5('0x3c')],{'$or':_[_0x2dc5('0x2d')](_0x1c15f4,function(_0x32849d){if(_0x32849d[_0x2dc5('0x30')]!=='VIRTUAL'){var _0x559ff2={};_0x559ff2[_0x32849d[_0x2dc5('0x2a')]]={'$like':'%'+_0x357dd9[_0x2dc5('0x31')][_0x2dc5('0x3a')]+'%'};return _0x559ff2;}})});}_0xd2cc74=_[_0x2dc5('0x3b')]({},_0xd2cc74,_0x357dd9[_0x2dc5('0x3d')]);var _0xea9467={'where':_0xd2cc74[_0x2dc5('0x3c')]};return db[_0x2dc5('0x3e')][_0x2dc5('0x20')](_0xea9467)['then'](function(_0x3eca97){_0x4c7c8a['count']=_0x3eca97;if(_0x357dd9[_0x2dc5('0x31')][_0x2dc5('0x3f')]){_0xd2cc74['include']=[{'all':!![]}];}return db[_0x2dc5('0x3e')][_0x2dc5('0x40')](_0xd2cc74);})['then'](function(_0x110795){_0x4c7c8a[_0x2dc5('0x41')]=_0x110795;return _0x4c7c8a;})[_0x2dc5('0x27')](respondWithFilteredResult(_0x1d6c19,_0xd2cc74))[_0x2dc5('0x42')](handleError(_0x1d6c19,null));};exports[_0x2dc5('0x43')]=function(_0x231671,_0x235add){var _0x2f68f9={'raw':![],'where':{'id':_0x231671['params']['id']}},_0x1c9dff={};_0x1c9dff[_0x2dc5('0x33')]=_[_0x2dc5('0x44')](db[_0x2dc5('0x3e')][_0x2dc5('0x2e')]);_0x1c9dff[_0x2dc5('0x31')]=_[_0x2dc5('0x44')](_0x231671[_0x2dc5('0x31')]);_0x1c9dff[_0x2dc5('0x39')]=_[_0x2dc5('0x32')](_0x1c9dff[_0x2dc5('0x33')],_0x1c9dff[_0x2dc5('0x31')]);_0x2f68f9[_0x2dc5('0x34')]=_[_0x2dc5('0x32')](_0x1c9dff['model'],qs[_0x2dc5('0x35')](_0x231671[_0x2dc5('0x31')][_0x2dc5('0x35')]));_0x2f68f9[_0x2dc5('0x34')]=_0x2f68f9[_0x2dc5('0x34')][_0x2dc5('0x45')]?_0x2f68f9['attributes']:_0x1c9dff[_0x2dc5('0x33')];if(_0x231671[_0x2dc5('0x31')][_0x2dc5('0x3f')]){_0x2f68f9[_0x2dc5('0x46')]=[{'all':!![]}];}_0x2f68f9=_[_0x2dc5('0x3b')]({},_0x2f68f9,_0x231671[_0x2dc5('0x3d')]);return db[_0x2dc5('0x3e')][_0x2dc5('0x47')](_0x2f68f9)[_0x2dc5('0x27')](handleEntityNotFound(_0x235add,null))[_0x2dc5('0x27')](respondWithResult(_0x235add,null))[_0x2dc5('0x42')](handleError(_0x235add,null));};exports['create']=function(_0x4cc333,_0x332cd8){return db['SugarcrmConfiguration'][_0x2dc5('0x48')](_0x4cc333[_0x2dc5('0x49')],{})[_0x2dc5('0x27')](respondWithResult(_0x332cd8,0xc9))[_0x2dc5('0x42')](handleError(_0x332cd8,null));};exports['update']=function(_0x1e71e2,_0x56bec5){if(_0x1e71e2[_0x2dc5('0x49')]['id']){delete _0x1e71e2[_0x2dc5('0x49')]['id'];}return db[_0x2dc5('0x3e')]['find']({'where':{'id':_0x1e71e2[_0x2dc5('0x4a')]['id']}})[_0x2dc5('0x27')](handleEntityNotFound(_0x56bec5,null))[_0x2dc5('0x27')](saveUpdates(_0x1e71e2['body'],null))[_0x2dc5('0x27')](respondWithResult(_0x56bec5,null))[_0x2dc5('0x42')](handleError(_0x56bec5,null));};exports[_0x2dc5('0x4b')]=function(_0x253a6b,_0x24f78e){return db[_0x2dc5('0x3e')][_0x2dc5('0x47')]({'where':{'id':_0x253a6b[_0x2dc5('0x4a')]['id']}})[_0x2dc5('0x27')](handleEntityNotFound(_0x24f78e,null))['then'](removeEntity(_0x24f78e,null))[_0x2dc5('0x42')](handleError(_0x24f78e,null));};exports[_0x2dc5('0x4c')]=function(_0x5b6f26,_0x313d30,_0x1a5f27){var _0x4c7ebc={};var _0x6fc5f7={};var _0x2303b9;var _0x1b60bb;return db['SugarcrmConfiguration'][_0x2dc5('0x4d')]({'where':{'id':_0x5b6f26['params']['id']}})[_0x2dc5('0x27')](handleEntityNotFound(_0x313d30,null))[_0x2dc5('0x27')](function(_0x4f8f3e){if(_0x4f8f3e){_0x2303b9=_0x4f8f3e;_0x6fc5f7[_0x2dc5('0x33')]=_[_0x2dc5('0x44')](db[_0x2dc5('0x4e')][_0x2dc5('0x2e')]);_0x6fc5f7[_0x2dc5('0x31')]=_['keys'](_0x5b6f26['query']);_0x6fc5f7[_0x2dc5('0x39')]=_[_0x2dc5('0x32')](_0x6fc5f7['model'],_0x6fc5f7[_0x2dc5('0x31')]);_0x4c7ebc[_0x2dc5('0x34')]=_[_0x2dc5('0x32')](_0x6fc5f7['model'],qs[_0x2dc5('0x35')](_0x5b6f26[_0x2dc5('0x31')]['fields']));_0x4c7ebc[_0x2dc5('0x34')]=_0x4c7ebc[_0x2dc5('0x34')][_0x2dc5('0x45')]?_0x4c7ebc['attributes']:_0x6fc5f7[_0x2dc5('0x33')];_0x4c7ebc[_0x2dc5('0x36')]=qs[_0x2dc5('0x37')](_0x5b6f26['query'][_0x2dc5('0x37')]);_0x4c7ebc[_0x2dc5('0x3c')]=qs[_0x2dc5('0x39')](_[_0x2dc5('0x38')](_0x5b6f26['query'],_0x6fc5f7[_0x2dc5('0x39')]));if(_0x5b6f26[_0x2dc5('0x31')][_0x2dc5('0x3a')]){_0x4c7ebc['where']=_[_0x2dc5('0x3b')](_0x4c7ebc[_0x2dc5('0x3c')],{'$or':_[_0x2dc5('0x2d')](_0x4c7ebc['attributes'],function(_0x30e34d){var _0x408201={};_0x408201[_0x30e34d]={'$like':'%'+_0x5b6f26[_0x2dc5('0x31')][_0x2dc5('0x3a')]+'%'};return _0x408201;})});}_0x4c7ebc=_[_0x2dc5('0x3b')]({},_0x4c7ebc,_0x5b6f26[_0x2dc5('0x3d')]);return _0x2303b9[_0x2dc5('0x4c')](_0x4c7ebc);}})[_0x2dc5('0x27')](function(_0x50397f){if(_0x50397f){_0x1b60bb=_0x50397f[_0x2dc5('0x45')];if(!_0x5b6f26[_0x2dc5('0x31')]['hasOwnProperty'](_0x2dc5('0x4f'))){_0x4c7ebc[_0x2dc5('0x22')]=qs[_0x2dc5('0x22')](_0x5b6f26[_0x2dc5('0x31')]['limit']);_0x4c7ebc[_0x2dc5('0x21')]=qs[_0x2dc5('0x21')](_0x5b6f26['query']['offset']);}return _0x2303b9[_0x2dc5('0x4c')](_0x4c7ebc);}})[_0x2dc5('0x27')](function(_0x378e01){if(_0x378e01){return _0x378e01?{'count':_0x1b60bb,'rows':_0x378e01}:null;}})[_0x2dc5('0x27')](respondWithResult(_0x313d30,null))[_0x2dc5('0x42')](handleError(_0x313d30,null));};exports[_0x2dc5('0x50')]=function(_0x57386f,_0x505db0,_0x3aacf3){var _0x57d971={};var _0x2878f1={};var _0x1093d7;var _0x672c25;return db[_0x2dc5('0x3e')][_0x2dc5('0x4d')]({'where':{'id':_0x57386f[_0x2dc5('0x4a')]['id']}})[_0x2dc5('0x27')](handleEntityNotFound(_0x505db0,null))[_0x2dc5('0x27')](function(_0x2e91c3){if(_0x2e91c3){_0x1093d7=_0x2e91c3;_0x2878f1[_0x2dc5('0x33')]=_[_0x2dc5('0x44')](db['SugarcrmField']['rawAttributes']);_0x2878f1[_0x2dc5('0x31')]=_[_0x2dc5('0x44')](_0x57386f[_0x2dc5('0x31')]);_0x2878f1[_0x2dc5('0x39')]=_[_0x2dc5('0x32')](_0x2878f1['model'],_0x2878f1[_0x2dc5('0x31')]);_0x57d971[_0x2dc5('0x34')]=_[_0x2dc5('0x32')](_0x2878f1[_0x2dc5('0x33')],qs[_0x2dc5('0x35')](_0x57386f[_0x2dc5('0x31')]['fields']));_0x57d971[_0x2dc5('0x34')]=_0x57d971['attributes'][_0x2dc5('0x45')]?_0x57d971[_0x2dc5('0x34')]:_0x2878f1[_0x2dc5('0x33')];_0x57d971[_0x2dc5('0x36')]=qs[_0x2dc5('0x37')](_0x57386f['query'][_0x2dc5('0x37')]);_0x57d971[_0x2dc5('0x3c')]=qs['filters'](_[_0x2dc5('0x38')](_0x57386f[_0x2dc5('0x31')],_0x2878f1[_0x2dc5('0x39')]));if(_0x57386f[_0x2dc5('0x31')][_0x2dc5('0x3a')]){_0x57d971[_0x2dc5('0x3c')]=_[_0x2dc5('0x3b')](_0x57d971[_0x2dc5('0x3c')],{'$or':_[_0x2dc5('0x2d')](_0x57d971[_0x2dc5('0x34')],function(_0x342397){var _0x1fdb0d={};_0x1fdb0d[_0x342397]={'$like':'%'+_0x57386f[_0x2dc5('0x31')][_0x2dc5('0x3a')]+'%'};return _0x1fdb0d;})});}_0x57d971=_['merge']({},_0x57d971,_0x57386f[_0x2dc5('0x3d')]);return _0x1093d7[_0x2dc5('0x50')](_0x57d971);}})[_0x2dc5('0x27')](function(_0x4c7b6b){if(_0x4c7b6b){_0x672c25=_0x4c7b6b[_0x2dc5('0x45')];if(!_0x57386f[_0x2dc5('0x31')][_0x2dc5('0x51')](_0x2dc5('0x4f'))){_0x57d971[_0x2dc5('0x22')]=qs['limit'](_0x57386f['query'][_0x2dc5('0x22')]);_0x57d971[_0x2dc5('0x21')]=qs[_0x2dc5('0x21')](_0x57386f[_0x2dc5('0x31')]['offset']);}return _0x1093d7['getSubjects'](_0x57d971);}})[_0x2dc5('0x27')](function(_0x5ca3ca){if(_0x5ca3ca){return _0x5ca3ca?{'count':_0x672c25,'rows':_0x5ca3ca}:null;}})['then'](respondWithResult(_0x505db0,null))[_0x2dc5('0x42')](handleError(_0x505db0,null));};exports['getDescriptions']=function(_0x891793,_0x18dbe8,_0x521fcc){var _0x4fcc90={};var _0x16c964={};var _0x45f7c8;var _0x1de17a;return db[_0x2dc5('0x3e')][_0x2dc5('0x4d')]({'where':{'id':_0x891793[_0x2dc5('0x4a')]['id']}})[_0x2dc5('0x27')](handleEntityNotFound(_0x18dbe8,null))['then'](function(_0x15a31d){if(_0x15a31d){_0x45f7c8=_0x15a31d;_0x16c964[_0x2dc5('0x33')]=_[_0x2dc5('0x44')](db['SugarcrmField'][_0x2dc5('0x2e')]);_0x16c964['query']=_[_0x2dc5('0x44')](_0x891793['query']);_0x16c964['filters']=_[_0x2dc5('0x32')](_0x16c964['model'],_0x16c964['query']);_0x4fcc90['attributes']=_[_0x2dc5('0x32')](_0x16c964['model'],qs[_0x2dc5('0x35')](_0x891793[_0x2dc5('0x31')][_0x2dc5('0x35')]));_0x4fcc90[_0x2dc5('0x34')]=_0x4fcc90[_0x2dc5('0x34')][_0x2dc5('0x45')]?_0x4fcc90[_0x2dc5('0x34')]:_0x16c964[_0x2dc5('0x33')];_0x4fcc90['order']=qs['sort'](_0x891793[_0x2dc5('0x31')][_0x2dc5('0x37')]);_0x4fcc90[_0x2dc5('0x3c')]=qs[_0x2dc5('0x39')](_[_0x2dc5('0x38')](_0x891793[_0x2dc5('0x31')],_0x16c964['filters']));if(_0x891793[_0x2dc5('0x31')]['filter']){_0x4fcc90[_0x2dc5('0x3c')]=_[_0x2dc5('0x3b')](_0x4fcc90['where'],{'$or':_['map'](_0x4fcc90[_0x2dc5('0x34')],function(_0x328588){var _0xffc3bb={};_0xffc3bb[_0x328588]={'$like':'%'+_0x891793[_0x2dc5('0x31')][_0x2dc5('0x3a')]+'%'};return _0xffc3bb;})});}_0x4fcc90=_[_0x2dc5('0x3b')]({},_0x4fcc90,_0x891793['options']);return _0x45f7c8[_0x2dc5('0x52')](_0x4fcc90);}})['then'](function(_0x32751c){if(_0x32751c){_0x1de17a=_0x32751c['length'];if(!_0x891793['query'][_0x2dc5('0x51')]('nolimit')){_0x4fcc90[_0x2dc5('0x22')]=qs[_0x2dc5('0x22')](_0x891793[_0x2dc5('0x31')][_0x2dc5('0x22')]);_0x4fcc90[_0x2dc5('0x21')]=qs['offset'](_0x891793[_0x2dc5('0x31')][_0x2dc5('0x21')]);}return _0x45f7c8['getDescriptions'](_0x4fcc90);}})['then'](function(_0x49ddd6){if(_0x49ddd6){return _0x49ddd6?{'count':_0x1de17a,'rows':_0x49ddd6}:null;}})[_0x2dc5('0x27')](respondWithResult(_0x18dbe8,null))['catch'](handleError(_0x18dbe8,null));}; \ No newline at end of file +var _0x4d1d=['order','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','destroy','then','send','index','map','SugarcrmConfiguration','rawAttributes','fieldName','type','key','model','name','query','filters','attributes','fields','length','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','intersection','find','create','body','findOne','SugarcrmField','hasOwnProperty','getSubjects'];(function(_0x3d2d6f,_0x368872){var _0x5c0022=function(_0x408819){while(--_0x408819){_0x3d2d6f['push'](_0x3d2d6f['shift']());}};_0x5c0022(++_0x368872);}(_0x4d1d,0xf2));var _0xd4d1=function(_0x24c56d,_0x588f4f){_0x24c56d=_0x24c56d-0x0;var _0x4073d1=_0x4d1d[_0x24c56d];return _0x4073d1;};'use strict';var emlformat=require(_0xd4d1('0x0'));var rimraf=require(_0xd4d1('0x1'));var zipdir=require(_0xd4d1('0x2'));var jsonpatch=require(_0xd4d1('0x3'));var rp=require(_0xd4d1('0x4'));var moment=require(_0xd4d1('0x5'));var BPromise=require(_0xd4d1('0x6'));var Mustache=require(_0xd4d1('0x7'));var util=require(_0xd4d1('0x8'));var path=require('path');var sox=require(_0xd4d1('0x9'));var csv=require(_0xd4d1('0xa'));var ejs=require(_0xd4d1('0xb'));var fs=require('fs');var fs_extra=require(_0xd4d1('0xc'));var _=require(_0xd4d1('0xd'));var squel=require(_0xd4d1('0xe'));var crypto=require(_0xd4d1('0xf'));var jsforce=require(_0xd4d1('0x10'));var deskjs=require(_0xd4d1('0x11'));var toCsv=require('to-csv');var querystring=require(_0xd4d1('0x12'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xd4d1('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd4d1('0x14'));var logger=require(_0xd4d1('0x15'))(_0xd4d1('0x16'));var utils=require(_0xd4d1('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xd4d1('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x256c4e,_0x1c9a31){_0x1c9a31=_0x1c9a31||0xcc;return function(_0x428c5f){if(_0x428c5f){return _0x256c4e[_0xd4d1('0x19')](_0x1c9a31);}return _0x256c4e['status'](_0x1c9a31)[_0xd4d1('0x1a')]();};}function respondWithResult(_0x339855,_0xdb29b){_0xdb29b=_0xdb29b||0xc8;return function(_0x1e0a1c){if(_0x1e0a1c){return _0x339855[_0xd4d1('0x1b')](_0xdb29b)[_0xd4d1('0x1c')](_0x1e0a1c);}};}function respondWithFilteredResult(_0x4b4838,_0x183df8){return function(_0xa20f80){if(_0xa20f80){var _0x1c4aaa=typeof _0x183df8[_0xd4d1('0x1d')]===_0xd4d1('0x1e')&&typeof _0x183df8['limit']===_0xd4d1('0x1e');var _0x5f75e0=_0xa20f80[_0xd4d1('0x1f')];var _0x5ac0ac=_0x1c4aaa?0x0:_0x183df8[_0xd4d1('0x1d')];var _0x17215b=_0x1c4aaa?_0xa20f80[_0xd4d1('0x1f')]:_0x183df8[_0xd4d1('0x1d')]+_0x183df8[_0xd4d1('0x20')];var _0x4e2123;if(_0x17215b>=_0x5f75e0){_0x17215b=_0x5f75e0;_0x4e2123=0xc8;}else{_0x4e2123=0xce;}_0x4b4838[_0xd4d1('0x1b')](_0x4e2123);return _0x4b4838[_0xd4d1('0x21')](_0xd4d1('0x22'),_0x5ac0ac+'-'+_0x17215b+'/'+_0x5f75e0)['json'](_0xa20f80);}return null;};}function patchUpdates(_0x3fcd63){return function(_0x2ea332){try{jsonpatch[_0xd4d1('0x23')](_0x2ea332,_0x3fcd63,!![]);}catch(_0x40f9f2){return BPromise['reject'](_0x40f9f2);}return _0x2ea332[_0xd4d1('0x24')]();};}function saveUpdates(_0x199b0a,_0x28f464){return function(_0x42f032){if(_0x42f032){return _0x42f032[_0xd4d1('0x25')](_0x199b0a)['then'](function(_0x561b42){return _0x561b42;});}return null;};}function removeEntity(_0x484c4d,_0x2784cd){return function(_0x113088){if(_0x113088){return _0x113088[_0xd4d1('0x26')]()[_0xd4d1('0x27')](function(){_0x484c4d[_0xd4d1('0x1b')](0xcc)[_0xd4d1('0x1a')]();});}};}function handleEntityNotFound(_0x391796,_0x46a76e){return function(_0x1fb002){if(!_0x1fb002){_0x391796[_0xd4d1('0x19')](0x194);}return _0x1fb002;};}function handleError(_0x8274de,_0x663255){_0x663255=_0x663255||0x1f4;return function(_0xd388b3){logger['error'](_0xd388b3['stack']);if(_0xd388b3['name']){delete _0xd388b3['name'];}_0x8274de['status'](_0x663255)[_0xd4d1('0x28')](_0xd388b3);};}exports[_0xd4d1('0x29')]=function(_0x3e53ae,_0x3fc696){var _0x1789c4={},_0xcf59ff={},_0x199789={'count':0x0,'rows':[]};var _0x1368ab=_[_0xd4d1('0x2a')](db[_0xd4d1('0x2b')][_0xd4d1('0x2c')],function(_0x8fb3fc){return{'name':_0x8fb3fc[_0xd4d1('0x2d')],'type':_0x8fb3fc[_0xd4d1('0x2e')][_0xd4d1('0x2f')]};});_0xcf59ff[_0xd4d1('0x30')]=_['map'](_0x1368ab,_0xd4d1('0x31'));_0xcf59ff['query']=_['keys'](_0x3e53ae[_0xd4d1('0x32')]);_0xcf59ff[_0xd4d1('0x33')]=_['intersection'](_0xcf59ff['model'],_0xcf59ff[_0xd4d1('0x32')]);_0x1789c4[_0xd4d1('0x34')]=_['intersection'](_0xcf59ff[_0xd4d1('0x30')],qs['fields'](_0x3e53ae['query'][_0xd4d1('0x35')]));_0x1789c4[_0xd4d1('0x34')]=_0x1789c4[_0xd4d1('0x34')][_0xd4d1('0x36')]?_0x1789c4[_0xd4d1('0x34')]:_0xcf59ff[_0xd4d1('0x30')];if(!_0x3e53ae['query']['hasOwnProperty'](_0xd4d1('0x37'))){_0x1789c4['limit']=qs['limit'](_0x3e53ae['query'][_0xd4d1('0x20')]);_0x1789c4[_0xd4d1('0x1d')]=qs[_0xd4d1('0x1d')](_0x3e53ae[_0xd4d1('0x32')]['offset']);}_0x1789c4['order']=qs[_0xd4d1('0x38')](_0x3e53ae[_0xd4d1('0x32')]['sort']);_0x1789c4[_0xd4d1('0x39')]=qs[_0xd4d1('0x33')](_[_0xd4d1('0x3a')](_0x3e53ae[_0xd4d1('0x32')],_0xcf59ff[_0xd4d1('0x33')]),_0x1368ab);if(_0x3e53ae[_0xd4d1('0x32')][_0xd4d1('0x3b')]){_0x1789c4[_0xd4d1('0x39')]=_[_0xd4d1('0x3c')](_0x1789c4['where'],{'$or':_[_0xd4d1('0x2a')](_0x1368ab,function(_0x29de24){if(_0x29de24[_0xd4d1('0x2e')]!=='VIRTUAL'){var _0x1ff4d1={};_0x1ff4d1[_0x29de24[_0xd4d1('0x31')]]={'$like':'%'+_0x3e53ae[_0xd4d1('0x32')][_0xd4d1('0x3b')]+'%'};return _0x1ff4d1;}})});}_0x1789c4=_[_0xd4d1('0x3c')]({},_0x1789c4,_0x3e53ae[_0xd4d1('0x3d')]);var _0x102b4a={'where':_0x1789c4[_0xd4d1('0x39')]};return db['SugarcrmConfiguration'][_0xd4d1('0x1f')](_0x102b4a)[_0xd4d1('0x27')](function(_0xfde094){_0x199789[_0xd4d1('0x1f')]=_0xfde094;if(_0x3e53ae[_0xd4d1('0x32')][_0xd4d1('0x3e')]){_0x1789c4[_0xd4d1('0x3f')]=[{'all':!![]}];}return db[_0xd4d1('0x2b')][_0xd4d1('0x40')](_0x1789c4);})['then'](function(_0x49ddcc){_0x199789[_0xd4d1('0x41')]=_0x49ddcc;return _0x199789;})['then'](respondWithFilteredResult(_0x3fc696,_0x1789c4))[_0xd4d1('0x42')](handleError(_0x3fc696,null));};exports[_0xd4d1('0x43')]=function(_0x44380f,_0x2b4043){var _0x5aa6bd={'raw':![],'where':{'id':_0x44380f[_0xd4d1('0x44')]['id']}},_0x31a0df={};_0x31a0df[_0xd4d1('0x30')]=_[_0xd4d1('0x45')](db[_0xd4d1('0x2b')][_0xd4d1('0x2c')]);_0x31a0df[_0xd4d1('0x32')]=_[_0xd4d1('0x45')](_0x44380f[_0xd4d1('0x32')]);_0x31a0df[_0xd4d1('0x33')]=_[_0xd4d1('0x46')](_0x31a0df[_0xd4d1('0x30')],_0x31a0df[_0xd4d1('0x32')]);_0x5aa6bd['attributes']=_['intersection'](_0x31a0df['model'],qs['fields'](_0x44380f[_0xd4d1('0x32')][_0xd4d1('0x35')]));_0x5aa6bd['attributes']=_0x5aa6bd['attributes'][_0xd4d1('0x36')]?_0x5aa6bd[_0xd4d1('0x34')]:_0x31a0df[_0xd4d1('0x30')];if(_0x44380f[_0xd4d1('0x32')][_0xd4d1('0x3e')]){_0x5aa6bd[_0xd4d1('0x3f')]=[{'all':!![]}];}_0x5aa6bd=_[_0xd4d1('0x3c')]({},_0x5aa6bd,_0x44380f['options']);return db[_0xd4d1('0x2b')][_0xd4d1('0x47')](_0x5aa6bd)[_0xd4d1('0x27')](handleEntityNotFound(_0x2b4043,null))['then'](respondWithResult(_0x2b4043,null))[_0xd4d1('0x42')](handleError(_0x2b4043,null));};exports[_0xd4d1('0x48')]=function(_0x21a23d,_0xe11057){return db[_0xd4d1('0x2b')][_0xd4d1('0x48')](_0x21a23d[_0xd4d1('0x49')],{})[_0xd4d1('0x27')](respondWithResult(_0xe11057,0xc9))['catch'](handleError(_0xe11057,null));};exports[_0xd4d1('0x25')]=function(_0x36a9bb,_0x5be233){if(_0x36a9bb[_0xd4d1('0x49')]['id']){delete _0x36a9bb[_0xd4d1('0x49')]['id'];}return db['SugarcrmConfiguration'][_0xd4d1('0x47')]({'where':{'id':_0x36a9bb['params']['id']}})[_0xd4d1('0x27')](handleEntityNotFound(_0x5be233,null))['then'](saveUpdates(_0x36a9bb[_0xd4d1('0x49')],null))['then'](respondWithResult(_0x5be233,null))[_0xd4d1('0x42')](handleError(_0x5be233,null));};exports[_0xd4d1('0x26')]=function(_0x3effb0,_0x2eaf10){return db['SugarcrmConfiguration'][_0xd4d1('0x47')]({'where':{'id':_0x3effb0[_0xd4d1('0x44')]['id']}})['then'](handleEntityNotFound(_0x2eaf10,null))[_0xd4d1('0x27')](removeEntity(_0x2eaf10,null))[_0xd4d1('0x42')](handleError(_0x2eaf10,null));};exports['getFields']=function(_0x1a3702,_0x5c3007,_0x1f05a3){var _0x4b2962={};var _0x3a0f70={};var _0x50b8bf;var _0x5c22d6;return db[_0xd4d1('0x2b')][_0xd4d1('0x4a')]({'where':{'id':_0x1a3702[_0xd4d1('0x44')]['id']}})[_0xd4d1('0x27')](handleEntityNotFound(_0x5c3007,null))[_0xd4d1('0x27')](function(_0x212908){if(_0x212908){_0x50b8bf=_0x212908;_0x3a0f70[_0xd4d1('0x30')]=_['keys'](db[_0xd4d1('0x4b')][_0xd4d1('0x2c')]);_0x3a0f70[_0xd4d1('0x32')]=_['keys'](_0x1a3702[_0xd4d1('0x32')]);_0x3a0f70[_0xd4d1('0x33')]=_['intersection'](_0x3a0f70[_0xd4d1('0x30')],_0x3a0f70['query']);_0x4b2962['attributes']=_['intersection'](_0x3a0f70['model'],qs[_0xd4d1('0x35')](_0x1a3702[_0xd4d1('0x32')][_0xd4d1('0x35')]));_0x4b2962[_0xd4d1('0x34')]=_0x4b2962[_0xd4d1('0x34')][_0xd4d1('0x36')]?_0x4b2962[_0xd4d1('0x34')]:_0x3a0f70[_0xd4d1('0x30')];_0x4b2962['order']=qs['sort'](_0x1a3702[_0xd4d1('0x32')][_0xd4d1('0x38')]);_0x4b2962[_0xd4d1('0x39')]=qs['filters'](_[_0xd4d1('0x3a')](_0x1a3702['query'],_0x3a0f70['filters']));if(_0x1a3702[_0xd4d1('0x32')][_0xd4d1('0x3b')]){_0x4b2962['where']=_[_0xd4d1('0x3c')](_0x4b2962['where'],{'$or':_[_0xd4d1('0x2a')](_0x4b2962['attributes'],function(_0x18a99e){var _0x19d2f7={};_0x19d2f7[_0x18a99e]={'$like':'%'+_0x1a3702[_0xd4d1('0x32')]['filter']+'%'};return _0x19d2f7;})});}_0x4b2962=_['merge']({},_0x4b2962,_0x1a3702[_0xd4d1('0x3d')]);return _0x50b8bf['getFields'](_0x4b2962);}})[_0xd4d1('0x27')](function(_0x43046e){if(_0x43046e){_0x5c22d6=_0x43046e[_0xd4d1('0x36')];if(!_0x1a3702[_0xd4d1('0x32')][_0xd4d1('0x4c')](_0xd4d1('0x37'))){_0x4b2962[_0xd4d1('0x20')]=qs['limit'](_0x1a3702[_0xd4d1('0x32')][_0xd4d1('0x20')]);_0x4b2962[_0xd4d1('0x1d')]=qs[_0xd4d1('0x1d')](_0x1a3702['query'][_0xd4d1('0x1d')]);}return _0x50b8bf['getFields'](_0x4b2962);}})[_0xd4d1('0x27')](function(_0x3b979b){if(_0x3b979b){return _0x3b979b?{'count':_0x5c22d6,'rows':_0x3b979b}:null;}})[_0xd4d1('0x27')](respondWithResult(_0x5c3007,null))[_0xd4d1('0x42')](handleError(_0x5c3007,null));};exports[_0xd4d1('0x4d')]=function(_0x5d4f5f,_0x41e5c7,_0x3d470e){var _0x4c4fb6={};var _0x1a8ad0={};var _0x580300;var _0xba8044;return db[_0xd4d1('0x2b')][_0xd4d1('0x4a')]({'where':{'id':_0x5d4f5f[_0xd4d1('0x44')]['id']}})[_0xd4d1('0x27')](handleEntityNotFound(_0x41e5c7,null))[_0xd4d1('0x27')](function(_0x7cad34){if(_0x7cad34){_0x580300=_0x7cad34;_0x1a8ad0['model']=_[_0xd4d1('0x45')](db[_0xd4d1('0x4b')]['rawAttributes']);_0x1a8ad0[_0xd4d1('0x32')]=_[_0xd4d1('0x45')](_0x5d4f5f[_0xd4d1('0x32')]);_0x1a8ad0[_0xd4d1('0x33')]=_[_0xd4d1('0x46')](_0x1a8ad0['model'],_0x1a8ad0['query']);_0x4c4fb6[_0xd4d1('0x34')]=_[_0xd4d1('0x46')](_0x1a8ad0['model'],qs['fields'](_0x5d4f5f[_0xd4d1('0x32')][_0xd4d1('0x35')]));_0x4c4fb6[_0xd4d1('0x34')]=_0x4c4fb6[_0xd4d1('0x34')]['length']?_0x4c4fb6[_0xd4d1('0x34')]:_0x1a8ad0['model'];_0x4c4fb6[_0xd4d1('0x4e')]=qs[_0xd4d1('0x38')](_0x5d4f5f[_0xd4d1('0x32')][_0xd4d1('0x38')]);_0x4c4fb6[_0xd4d1('0x39')]=qs[_0xd4d1('0x33')](_['pick'](_0x5d4f5f[_0xd4d1('0x32')],_0x1a8ad0[_0xd4d1('0x33')]));if(_0x5d4f5f[_0xd4d1('0x32')][_0xd4d1('0x3b')]){_0x4c4fb6['where']=_[_0xd4d1('0x3c')](_0x4c4fb6['where'],{'$or':_['map'](_0x4c4fb6['attributes'],function(_0x49d46c){var _0x2daa3a={};_0x2daa3a[_0x49d46c]={'$like':'%'+_0x5d4f5f[_0xd4d1('0x32')][_0xd4d1('0x3b')]+'%'};return _0x2daa3a;})});}_0x4c4fb6=_[_0xd4d1('0x3c')]({},_0x4c4fb6,_0x5d4f5f[_0xd4d1('0x3d')]);return _0x580300[_0xd4d1('0x4d')](_0x4c4fb6);}})[_0xd4d1('0x27')](function(_0x41713d){if(_0x41713d){_0xba8044=_0x41713d[_0xd4d1('0x36')];if(!_0x5d4f5f[_0xd4d1('0x32')]['hasOwnProperty'](_0xd4d1('0x37'))){_0x4c4fb6[_0xd4d1('0x20')]=qs[_0xd4d1('0x20')](_0x5d4f5f[_0xd4d1('0x32')][_0xd4d1('0x20')]);_0x4c4fb6[_0xd4d1('0x1d')]=qs[_0xd4d1('0x1d')](_0x5d4f5f['query']['offset']);}return _0x580300[_0xd4d1('0x4d')](_0x4c4fb6);}})[_0xd4d1('0x27')](function(_0x2f3da6){if(_0x2f3da6){return _0x2f3da6?{'count':_0xba8044,'rows':_0x2f3da6}:null;}})[_0xd4d1('0x27')](respondWithResult(_0x41e5c7,null))[_0xd4d1('0x42')](handleError(_0x41e5c7,null));};exports[_0xd4d1('0x4f')]=function(_0x320218,_0x134f44,_0x2522cb){var _0x5d496c={};var _0x3dd9e2={};var _0x4df316;var _0x496f84;return db[_0xd4d1('0x2b')]['findOne']({'where':{'id':_0x320218['params']['id']}})['then'](handleEntityNotFound(_0x134f44,null))[_0xd4d1('0x27')](function(_0xed2287){if(_0xed2287){_0x4df316=_0xed2287;_0x3dd9e2['model']=_[_0xd4d1('0x45')](db[_0xd4d1('0x4b')]['rawAttributes']);_0x3dd9e2[_0xd4d1('0x32')]=_[_0xd4d1('0x45')](_0x320218[_0xd4d1('0x32')]);_0x3dd9e2[_0xd4d1('0x33')]=_[_0xd4d1('0x46')](_0x3dd9e2[_0xd4d1('0x30')],_0x3dd9e2[_0xd4d1('0x32')]);_0x5d496c['attributes']=_[_0xd4d1('0x46')](_0x3dd9e2['model'],qs['fields'](_0x320218[_0xd4d1('0x32')][_0xd4d1('0x35')]));_0x5d496c[_0xd4d1('0x34')]=_0x5d496c[_0xd4d1('0x34')][_0xd4d1('0x36')]?_0x5d496c[_0xd4d1('0x34')]:_0x3dd9e2['model'];_0x5d496c['order']=qs[_0xd4d1('0x38')](_0x320218['query']['sort']);_0x5d496c['where']=qs[_0xd4d1('0x33')](_[_0xd4d1('0x3a')](_0x320218[_0xd4d1('0x32')],_0x3dd9e2[_0xd4d1('0x33')]));if(_0x320218[_0xd4d1('0x32')][_0xd4d1('0x3b')]){_0x5d496c[_0xd4d1('0x39')]=_[_0xd4d1('0x3c')](_0x5d496c[_0xd4d1('0x39')],{'$or':_[_0xd4d1('0x2a')](_0x5d496c[_0xd4d1('0x34')],function(_0x5c145d){var _0x385477={};_0x385477[_0x5c145d]={'$like':'%'+_0x320218[_0xd4d1('0x32')][_0xd4d1('0x3b')]+'%'};return _0x385477;})});}_0x5d496c=_[_0xd4d1('0x3c')]({},_0x5d496c,_0x320218['options']);return _0x4df316[_0xd4d1('0x4f')](_0x5d496c);}})[_0xd4d1('0x27')](function(_0x284fd2){if(_0x284fd2){_0x496f84=_0x284fd2[_0xd4d1('0x36')];if(!_0x320218[_0xd4d1('0x32')]['hasOwnProperty']('nolimit')){_0x5d496c['limit']=qs[_0xd4d1('0x20')](_0x320218[_0xd4d1('0x32')][_0xd4d1('0x20')]);_0x5d496c[_0xd4d1('0x1d')]=qs[_0xd4d1('0x1d')](_0x320218[_0xd4d1('0x32')][_0xd4d1('0x1d')]);}return _0x4df316[_0xd4d1('0x4f')](_0x5d496c);}})[_0xd4d1('0x27')](function(_0x52bec6){if(_0x52bec6){return _0x52bec6?{'count':_0x496f84,'rows':_0x52bec6}:null;}})[_0xd4d1('0x27')](respondWithResult(_0x134f44,null))['catch'](handleError(_0x134f44,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index a8344d6..bbe2524 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 _0x4bf2=['bluebird','path','rimraf','./intSugarcrmConfiguration.attributes','exports','define','int_sugarcrm_configurations','lodash','util','../../config/logger','api','moment'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x4bf2,0x10f));var _0x24bf=function(_0x257c00,_0x4c1f3f){_0x257c00=_0x257c00-0x0;var _0x124bc6=_0x4bf2[_0x257c00];return _0x124bc6;};'use strict';var _=require(_0x24bf('0x0'));var util=require(_0x24bf('0x1'));var logger=require(_0x24bf('0x2'))(_0x24bf('0x3'));var moment=require(_0x24bf('0x4'));var BPromise=require(_0x24bf('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x24bf('0x6'));var rimraf=require(_0x24bf('0x7'));var config=require('../../config/environment');var attributes=require(_0x24bf('0x8'));module[_0x24bf('0x9')]=function(_0xbc38f0,_0x540e75){return _0xbc38f0[_0x24bf('0xa')]('SugarcrmConfiguration',attributes,{'tableName':_0x24bf('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5114=['rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','exports','define','SugarcrmConfiguration','util','moment','bluebird','path'];(function(_0x37384e,_0x3de460){var _0x5cb6e8=function(_0x1fa168){while(--_0x1fa168){_0x37384e['push'](_0x37384e['shift']());}};_0x5cb6e8(++_0x3de460);}(_0x5114,0x10a));var _0x4511=function(_0x15e142,_0x576549){_0x15e142=_0x15e142-0x0;var _0x1645c9=_0x5114[_0x15e142];return _0x1645c9;};'use strict';var _=require('lodash');var util=require(_0x4511('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x4511('0x1'));var BPromise=require(_0x4511('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4511('0x3'));var rimraf=require(_0x4511('0x4'));var config=require(_0x4511('0x5'));var attributes=require(_0x4511('0x6'));module[_0x4511('0x7')]=function(_0x4c5687,_0x64089d){return _0x4c5687[_0x4511('0x8')](_0x4511('0x9'),attributes,{'tableName':'int_sugarcrm_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js index fd1b47a..e5bf90a 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 _0xf774=['../../config/environment','jayson/promise','client','http','request','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc'];(function(_0x4f7418,_0x1755cc){var _0x4afe7e=function(_0x5ae646){while(--_0x5ae646){_0x4f7418['push'](_0x4f7418['shift']());}};_0x4afe7e(++_0x1755cc);}(_0xf774,0xdf));var _0x4f77=function(_0x4a4a74,_0x244e06){_0x4a4a74=_0x4a4a74-0x0;var _0x76c2ad=_0xf774[_0x4a4a74];return _0x76c2ad;};'use strict';var _=require(_0x4f77('0x0'));var util=require('util');var moment=require(_0x4f77('0x1'));var BPromise=require(_0x4f77('0x2'));var rs=require(_0x4f77('0x3'));var fs=require('fs');var Redis=require(_0x4f77('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4f77('0x5'))(_0x4f77('0x6'));var config=require(_0x4f77('0x7'));var jayson=require(_0x4f77('0x8'));var client=jayson[_0x4f77('0x9')][_0x4f77('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3083ca,_0x3ab52c,_0x22e2b3){return new BPromise(function(_0x187248,_0x2acded){return client[_0x4f77('0xb')](_0x3083ca,_0x22e2b3)['then'](function(_0x3c6a42){logger[_0x4f77('0xc')](_0x4f77('0xd'),_0x3ab52c,_0x4f77('0xe'));logger[_0x4f77('0xf')](_0x4f77('0x10'),_0x3ab52c,_0x4f77('0xe'),JSON[_0x4f77('0x11')](_0x3c6a42));if(_0x3c6a42[_0x4f77('0x12')]){if(_0x3c6a42['error'][_0x4f77('0x13')]===0x1f4){logger[_0x4f77('0x12')](_0x4f77('0xd'),_0x3ab52c,_0x3c6a42['error'][_0x4f77('0x14')]);return _0x2acded(_0x3c6a42[_0x4f77('0x12')][_0x4f77('0x14')]);}logger[_0x4f77('0x12')](_0x4f77('0xd'),_0x3ab52c,_0x3c6a42[_0x4f77('0x12')][_0x4f77('0x14')]);return _0x187248(_0x3c6a42[_0x4f77('0x12')][_0x4f77('0x14')]);}else{logger['info'](_0x4f77('0xd'),_0x3ab52c,'request\x20sent');_0x187248(_0x3c6a42[_0x4f77('0x15')]['message']);}})[_0x4f77('0x16')](function(_0x211b25){logger[_0x4f77('0x12')](_0x4f77('0xd'),_0x3ab52c,_0x211b25);_0x2acded(_0x211b25);});});} \ No newline at end of file +var _0x4b01=['stringify','error','code','SugarcrmConfiguration,\x20%s,\x20%s','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x56b14a,_0x3e35c3){var _0x39456f=function(_0x1cf63f){while(--_0x1cf63f){_0x56b14a['push'](_0x56b14a['shift']());}};_0x39456f(++_0x3e35c3);}(_0x4b01,0x149));var _0x14b0=function(_0x5647ec,_0x30c499){_0x5647ec=_0x5647ec-0x0;var _0x411bcd=_0x4b01[_0x5647ec];return _0x411bcd;};'use strict';var _=require('lodash');var util=require(_0x14b0('0x0'));var moment=require('moment');var BPromise=require(_0x14b0('0x1'));var rs=require(_0x14b0('0x2'));var fs=require('fs');var Redis=require(_0x14b0('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x14b0('0x4'));var logger=require(_0x14b0('0x5'))(_0x14b0('0x6'));var config=require(_0x14b0('0x7'));var jayson=require(_0x14b0('0x8'));var client=jayson[_0x14b0('0x9')][_0x14b0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xb30146,_0x10a777,_0x267c07){return new BPromise(function(_0x42c040,_0x40ab8e){return client[_0x14b0('0xb')](_0xb30146,_0x267c07)['then'](function(_0x426c7e){logger[_0x14b0('0xc')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x10a777,_0x14b0('0xd'));logger[_0x14b0('0xe')](_0x14b0('0xf'),_0x10a777,_0x14b0('0xd'),JSON[_0x14b0('0x10')](_0x426c7e));if(_0x426c7e[_0x14b0('0x11')]){if(_0x426c7e[_0x14b0('0x11')][_0x14b0('0x12')]===0x1f4){logger[_0x14b0('0x11')](_0x14b0('0x13'),_0x10a777,_0x426c7e['error'][_0x14b0('0x14')]);return _0x40ab8e(_0x426c7e['error'][_0x14b0('0x14')]);}logger[_0x14b0('0x11')](_0x14b0('0x13'),_0x10a777,_0x426c7e[_0x14b0('0x11')][_0x14b0('0x14')]);return _0x42c040(_0x426c7e[_0x14b0('0x11')]['message']);}else{logger[_0x14b0('0xc')](_0x14b0('0x13'),_0x10a777,_0x14b0('0xd'));_0x42c040(_0x426c7e[_0x14b0('0x15')][_0x14b0('0x14')]);}})[_0x14b0('0x16')](function(_0x309699){logger[_0x14b0('0x11')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x10a777,_0x309699);_0x40ab8e(_0x309699);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index 0153fb8..d993db0 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 _0x9d92=['Router','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','exports','multer','util','connect-timeout','express'];(function(_0x4c8ff4,_0x55b36b){var _0x381dd4=function(_0x4782d5){while(--_0x4782d5){_0x4c8ff4['push'](_0x4c8ff4['shift']());}};_0x381dd4(++_0x55b36b);}(_0x9d92,0x152));var _0x29d9=function(_0x4a0e68,_0x45c08c){_0x4a0e68=_0x4a0e68-0x0;var _0x4fb274=_0x9d92[_0x4a0e68];return _0x4fb274;};'use strict';var multer=require(_0x29d9('0x0'));var util=require(_0x29d9('0x1'));var path=require('path');var timeout=require(_0x29d9('0x2'));var express=require(_0x29d9('0x3'));var router=express[_0x29d9('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x29d9('0x5'));var config=require(_0x29d9('0x6'));var controller=require(_0x29d9('0x7'));router[_0x29d9('0x8')]('/',auth[_0x29d9('0x9')](),controller[_0x29d9('0xa')]);router[_0x29d9('0x8')](_0x29d9('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x29d9('0xc')]('/',auth['isAuthenticated'](),controller[_0x29d9('0xd')]);router[_0x29d9('0xe')](_0x29d9('0xb'),auth[_0x29d9('0x9')](),controller[_0x29d9('0xf')]);router[_0x29d9('0x10')](_0x29d9('0xb'),auth[_0x29d9('0x9')](),controller['destroy']);module[_0x29d9('0x11')]=router; \ No newline at end of file +var _0xaba0=['multer','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','index','/:id','post','create','update','destroy','exports'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0xaba0,0x176));var _0x0aba=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xaba0[_0x397e5f];return _0x5302b8;};'use strict';var multer=require(_0x0aba('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0aba('0x1'));var router=express[_0x0aba('0x2')]();var fs_extra=require(_0x0aba('0x3'));var auth=require(_0x0aba('0x4'));var interaction=require(_0x0aba('0x5'));var config=require(_0x0aba('0x6'));var controller=require(_0x0aba('0x7'));router[_0x0aba('0x8')]('/',auth[_0x0aba('0x9')](),controller[_0x0aba('0xa')]);router[_0x0aba('0x8')](_0x0aba('0xb'),auth[_0x0aba('0x9')](),controller['show']);router[_0x0aba('0xc')]('/',auth[_0x0aba('0x9')](),controller[_0x0aba('0xd')]);router['put'](_0x0aba('0xb'),auth[_0x0aba('0x9')](),controller[_0x0aba('0xe')]);router['delete']('/:id',auth[_0x0aba('0x9')](),controller[_0x0aba('0xf')]);module[_0x0aba('0x10')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index 8510378..d89b472 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 _0x015a=['customVariable','picklist','string','STRING','BOOLEAN','sequelize','exports','ENUM'];(function(_0x4058f4,_0x3686a5){var _0x3f706e=function(_0x1a28ab){while(--_0x1a28ab){_0x4058f4['push'](_0x4058f4['shift']());}};_0x3f706e(++_0x3686a5);}(_0x015a,0x1b5));var _0xa015=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0x015a[_0x49b207];return _0x2dc8fa;};'use strict';var Sequelize=require(_0xa015('0x0'));module[_0xa015('0x1')]={'type':{'type':Sequelize[_0xa015('0x2')]('string','variable',_0xa015('0x3'),'keyValue',_0xa015('0x4')),'defaultValue':_0xa015('0x5')},'content':{'type':Sequelize[_0xa015('0x6')]},'key':{'type':Sequelize[_0xa015('0x6')]},'keyType':{'type':Sequelize[_0xa015('0x2')](_0xa015('0x5'),'variable',_0xa015('0x3'))},'keyContent':{'type':Sequelize[_0xa015('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xa015('0x6')]},'customField':{'type':Sequelize[_0xa015('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa015('0x6')]}}; \ No newline at end of file +var _0x2faa=['exports','string','variable','customVariable','keyValue','picklist','STRING','ENUM','sequelize'];(function(_0x591e0c,_0x37e294){var _0x317424=function(_0x1c8c58){while(--_0x1c8c58){_0x591e0c['push'](_0x591e0c['shift']());}};_0x317424(++_0x37e294);}(_0x2faa,0xd7));var _0xa2fa=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x2faa[_0xfae23b];return _0x200640;};'use strict';var Sequelize=require(_0xa2fa('0x0'));module[_0xa2fa('0x1')]={'type':{'type':Sequelize['ENUM'](_0xa2fa('0x2'),_0xa2fa('0x3'),_0xa2fa('0x4'),_0xa2fa('0x5'),_0xa2fa('0x6')),'defaultValue':_0xa2fa('0x2')},'content':{'type':Sequelize[_0xa2fa('0x7')]},'key':{'type':Sequelize[_0xa2fa('0x7')]},'keyType':{'type':Sequelize[_0xa2fa('0x8')](_0xa2fa('0x2'),_0xa2fa('0x3'),_0xa2fa('0x4'))},'keyContent':{'type':Sequelize[_0xa2fa('0x7')]},'idField':{'type':Sequelize[_0xa2fa('0x7')]},'nameField':{'type':Sequelize[_0xa2fa('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa2fa('0x7')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index fb8822c..d449fcf 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 _0x7d5f=['../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','apply','reject','update','then','destroy','error','stack','name','send','index','map','SugarcrmField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','merge','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x55b93d,_0x4d28c9){var _0x18f260=function(_0xf5fb8a){while(--_0xf5fb8a){_0x55b93d['push'](_0x55b93d['shift']());}};_0x18f260(++_0x4d28c9);}(_0x7d5f,0x1ab));var _0xf7d5=function(_0x1ef826,_0x71bcb7){_0x1ef826=_0x1ef826-0x0;var _0x43dbd6=_0x7d5f[_0x1ef826];return _0x43dbd6;};'use strict';var emlformat=require(_0xf7d5('0x0'));var rimraf=require(_0xf7d5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf7d5('0x2'));var rp=require(_0xf7d5('0x3'));var moment=require(_0xf7d5('0x4'));var BPromise=require(_0xf7d5('0x5'));var Mustache=require(_0xf7d5('0x6'));var util=require('util');var path=require(_0xf7d5('0x7'));var sox=require(_0xf7d5('0x8'));var csv=require(_0xf7d5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf7d5('0xa'));var _=require('lodash');var squel=require(_0xf7d5('0xb'));var crypto=require(_0xf7d5('0xc'));var jsforce=require(_0xf7d5('0xd'));var deskjs=require(_0xf7d5('0xe'));var toCsv=require(_0xf7d5('0x9'));var querystring=require('querystring');var Papa=require(_0xf7d5('0xf'));var Redis=require('ioredis');var authService=require(_0xf7d5('0x10'));var qs=require(_0xf7d5('0x11'));var as=require(_0xf7d5('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf7d5('0x13'))(_0xf7d5('0x14'));var utils=require(_0xf7d5('0x15'));var config=require(_0xf7d5('0x16'));var licenseUtil=require(_0xf7d5('0x17'));var db=require(_0xf7d5('0x18'))['db'];function respondWithStatusCode(_0x225800,_0x3490a3){_0x3490a3=_0x3490a3||0xcc;return function(_0x5bfa23){if(_0x5bfa23){return _0x225800[_0xf7d5('0x19')](_0x3490a3);}return _0x225800[_0xf7d5('0x1a')](_0x3490a3)['end']();};}function respondWithResult(_0x51e05f,_0x2c5781){_0x2c5781=_0x2c5781||0xc8;return function(_0x1f13ac){if(_0x1f13ac){return _0x51e05f['status'](_0x2c5781)[_0xf7d5('0x1b')](_0x1f13ac);}};}function respondWithFilteredResult(_0x560007,_0x36ef87){return function(_0x1a4e78){if(_0x1a4e78){var _0x7fc10d=typeof _0x36ef87[_0xf7d5('0x1c')]===_0xf7d5('0x1d')&&typeof _0x36ef87['limit']===_0xf7d5('0x1d');var _0x27e480=_0x1a4e78[_0xf7d5('0x1e')];var _0x2b8a76=_0x7fc10d?0x0:_0x36ef87[_0xf7d5('0x1c')];var _0x8cfd1d=_0x7fc10d?_0x1a4e78[_0xf7d5('0x1e')]:_0x36ef87[_0xf7d5('0x1c')]+_0x36ef87[_0xf7d5('0x1f')];var _0x5a66bd;if(_0x8cfd1d>=_0x27e480){_0x8cfd1d=_0x27e480;_0x5a66bd=0xc8;}else{_0x5a66bd=0xce;}_0x560007[_0xf7d5('0x1a')](_0x5a66bd);return _0x560007[_0xf7d5('0x20')]('Content-Range',_0x2b8a76+'-'+_0x8cfd1d+'/'+_0x27e480)[_0xf7d5('0x1b')](_0x1a4e78);}return null;};}function patchUpdates(_0x5dd557){return function(_0x52c2ce){try{jsonpatch[_0xf7d5('0x21')](_0x52c2ce,_0x5dd557,!![]);}catch(_0x2c8f8b){return BPromise[_0xf7d5('0x22')](_0x2c8f8b);}return _0x52c2ce['save']();};}function saveUpdates(_0x5da31d,_0x5683af){return function(_0x1be873){if(_0x1be873){return _0x1be873[_0xf7d5('0x23')](_0x5da31d)[_0xf7d5('0x24')](function(_0x44e8a6){return _0x44e8a6;});}return null;};}function removeEntity(_0x183761,_0x13bdfa){return function(_0x3a4891){if(_0x3a4891){return _0x3a4891[_0xf7d5('0x25')]()[_0xf7d5('0x24')](function(){_0x183761[_0xf7d5('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x56d5fe,_0x63a07b){return function(_0x233fd5){if(!_0x233fd5){_0x56d5fe[_0xf7d5('0x19')](0x194);}return _0x233fd5;};}function handleError(_0x5619bf,_0x54ba54){_0x54ba54=_0x54ba54||0x1f4;return function(_0x2c351e){logger[_0xf7d5('0x26')](_0x2c351e[_0xf7d5('0x27')]);if(_0x2c351e[_0xf7d5('0x28')]){delete _0x2c351e[_0xf7d5('0x28')];}_0x5619bf['status'](_0x54ba54)[_0xf7d5('0x29')](_0x2c351e);};}exports[_0xf7d5('0x2a')]=function(_0x106c58,_0x5e2307){var _0x2c2feb={},_0x3421de={},_0x1f57a9={'count':0x0,'rows':[]};var _0x55db9b=_[_0xf7d5('0x2b')](db[_0xf7d5('0x2c')][_0xf7d5('0x2d')],function(_0x1f6a80){return{'name':_0x1f6a80[_0xf7d5('0x2e')],'type':_0x1f6a80[_0xf7d5('0x2f')][_0xf7d5('0x30')]};});_0x3421de[_0xf7d5('0x31')]=_['map'](_0x55db9b,_0xf7d5('0x28'));_0x3421de[_0xf7d5('0x32')]=_[_0xf7d5('0x33')](_0x106c58[_0xf7d5('0x32')]);_0x3421de[_0xf7d5('0x34')]=_[_0xf7d5('0x35')](_0x3421de[_0xf7d5('0x31')],_0x3421de['query']);_0x2c2feb[_0xf7d5('0x36')]=_[_0xf7d5('0x35')](_0x3421de[_0xf7d5('0x31')],qs[_0xf7d5('0x37')](_0x106c58['query'][_0xf7d5('0x37')]));_0x2c2feb[_0xf7d5('0x36')]=_0x2c2feb[_0xf7d5('0x36')][_0xf7d5('0x38')]?_0x2c2feb[_0xf7d5('0x36')]:_0x3421de[_0xf7d5('0x31')];if(!_0x106c58[_0xf7d5('0x32')]['hasOwnProperty'](_0xf7d5('0x39'))){_0x2c2feb[_0xf7d5('0x1f')]=qs[_0xf7d5('0x1f')](_0x106c58[_0xf7d5('0x32')][_0xf7d5('0x1f')]);_0x2c2feb[_0xf7d5('0x1c')]=qs[_0xf7d5('0x1c')](_0x106c58[_0xf7d5('0x32')][_0xf7d5('0x1c')]);}_0x2c2feb['order']=qs[_0xf7d5('0x3a')](_0x106c58[_0xf7d5('0x32')][_0xf7d5('0x3a')]);_0x2c2feb[_0xf7d5('0x3b')]=qs['filters'](_[_0xf7d5('0x3c')](_0x106c58['query'],_0x3421de[_0xf7d5('0x34')]),_0x55db9b);if(_0x106c58['query'][_0xf7d5('0x3d')]){_0x2c2feb[_0xf7d5('0x3b')]=_['merge'](_0x2c2feb[_0xf7d5('0x3b')],{'$or':_[_0xf7d5('0x2b')](_0x55db9b,function(_0x155a72){if(_0x155a72[_0xf7d5('0x2f')]!==_0xf7d5('0x3e')){var _0x490a0f={};_0x490a0f[_0x155a72['name']]={'$like':'%'+_0x106c58['query'][_0xf7d5('0x3d')]+'%'};return _0x490a0f;}})});}_0x2c2feb=_['merge']({},_0x2c2feb,_0x106c58[_0xf7d5('0x3f')]);var _0x3e6833={'where':_0x2c2feb[_0xf7d5('0x3b')]};return db['SugarcrmField']['count'](_0x3e6833)['then'](function(_0x5c47ab){_0x1f57a9[_0xf7d5('0x1e')]=_0x5c47ab;if(_0x106c58[_0xf7d5('0x32')][_0xf7d5('0x40')]){_0x2c2feb[_0xf7d5('0x41')]=[{'all':!![]}];}return db[_0xf7d5('0x2c')][_0xf7d5('0x42')](_0x2c2feb);})[_0xf7d5('0x24')](function(_0x145742){_0x1f57a9[_0xf7d5('0x43')]=_0x145742;return _0x1f57a9;})[_0xf7d5('0x24')](respondWithFilteredResult(_0x5e2307,_0x2c2feb))[_0xf7d5('0x44')](handleError(_0x5e2307,null));};exports[_0xf7d5('0x45')]=function(_0x573f1b,_0x4f6ac0){var _0x2ec46d={'raw':!![],'where':{'id':_0x573f1b[_0xf7d5('0x46')]['id']}},_0x2c92b7={};_0x2c92b7['model']=_[_0xf7d5('0x33')](db[_0xf7d5('0x2c')][_0xf7d5('0x2d')]);_0x2c92b7['query']=_[_0xf7d5('0x33')](_0x573f1b[_0xf7d5('0x32')]);_0x2c92b7[_0xf7d5('0x34')]=_[_0xf7d5('0x35')](_0x2c92b7['model'],_0x2c92b7[_0xf7d5('0x32')]);_0x2ec46d[_0xf7d5('0x36')]=_[_0xf7d5('0x35')](_0x2c92b7[_0xf7d5('0x31')],qs['fields'](_0x573f1b[_0xf7d5('0x32')][_0xf7d5('0x37')]));_0x2ec46d[_0xf7d5('0x36')]=_0x2ec46d[_0xf7d5('0x36')][_0xf7d5('0x38')]?_0x2ec46d['attributes']:_0x2c92b7[_0xf7d5('0x31')];if(_0x573f1b[_0xf7d5('0x32')]['includeAll']){_0x2ec46d[_0xf7d5('0x41')]=[{'all':!![]}];}_0x2ec46d=_[_0xf7d5('0x47')]({},_0x2ec46d,_0x573f1b[_0xf7d5('0x3f')]);return db['SugarcrmField'][_0xf7d5('0x48')](_0x2ec46d)[_0xf7d5('0x24')](handleEntityNotFound(_0x4f6ac0,null))[_0xf7d5('0x24')](respondWithResult(_0x4f6ac0,null))[_0xf7d5('0x44')](handleError(_0x4f6ac0,null));};exports[_0xf7d5('0x49')]=function(_0x14c05c,_0x2afad8){return db['SugarcrmField'][_0xf7d5('0x49')](_0x14c05c[_0xf7d5('0x4a')],{})['then'](respondWithResult(_0x2afad8,0xc9))['catch'](handleError(_0x2afad8,null));};exports[_0xf7d5('0x23')]=function(_0x58cce0,_0x51fe5f){if(_0x58cce0[_0xf7d5('0x4a')]['id']){delete _0x58cce0['body']['id'];}return db[_0xf7d5('0x2c')][_0xf7d5('0x48')]({'where':{'id':_0x58cce0[_0xf7d5('0x46')]['id']}})[_0xf7d5('0x24')](handleEntityNotFound(_0x51fe5f,null))[_0xf7d5('0x24')](saveUpdates(_0x58cce0[_0xf7d5('0x4a')],null))[_0xf7d5('0x24')](respondWithResult(_0x51fe5f,null))[_0xf7d5('0x44')](handleError(_0x51fe5f,null));};exports[_0xf7d5('0x25')]=function(_0x4b5dc7,_0x371847){return db[_0xf7d5('0x2c')][_0xf7d5('0x48')]({'where':{'id':_0x4b5dc7[_0xf7d5('0x46')]['id']}})[_0xf7d5('0x24')](handleEntityNotFound(_0x371847,null))[_0xf7d5('0x24')](removeEntity(_0x371847,null))['catch'](handleError(_0x371847,null));}; \ No newline at end of file +var _0x6082=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','then','destroy','error','stack','name','index','map','SugarcrmField','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','where','merge','VIRTUAL','includeAll','include','rows','catch','show','find','create','body','update','params','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6082,0x15e));var _0x2608=function(_0x3d8522,_0x1448b0){_0x3d8522=_0x3d8522-0x0;var _0xcc6260=_0x6082[_0x3d8522];return _0xcc6260;};'use strict';var emlformat=require(_0x2608('0x0'));var rimraf=require(_0x2608('0x1'));var zipdir=require(_0x2608('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2608('0x3'));var moment=require(_0x2608('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2608('0x5'));var util=require(_0x2608('0x6'));var path=require(_0x2608('0x7'));var sox=require(_0x2608('0x8'));var csv=require('to-csv');var ejs=require(_0x2608('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2608('0xa'));var squel=require(_0x2608('0xb'));var crypto=require(_0x2608('0xc'));var jsforce=require(_0x2608('0xd'));var deskjs=require(_0x2608('0xe'));var toCsv=require(_0x2608('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x2608('0x10'));var authService=require(_0x2608('0x11'));var qs=require(_0x2608('0x12'));var as=require(_0x2608('0x13'));var hardwareService=require(_0x2608('0x14'));var logger=require(_0x2608('0x15'))(_0x2608('0x16'));var utils=require(_0x2608('0x17'));var config=require(_0x2608('0x18'));var licenseUtil=require(_0x2608('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x54a34c,_0x5c062e){_0x5c062e=_0x5c062e||0xcc;return function(_0x47a5f6){if(_0x47a5f6){return _0x54a34c[_0x2608('0x1a')](_0x5c062e);}return _0x54a34c[_0x2608('0x1b')](_0x5c062e)[_0x2608('0x1c')]();};}function respondWithResult(_0x221c14,_0x4dfd8f){_0x4dfd8f=_0x4dfd8f||0xc8;return function(_0x2a9817){if(_0x2a9817){return _0x221c14[_0x2608('0x1b')](_0x4dfd8f)[_0x2608('0x1d')](_0x2a9817);}};}function respondWithFilteredResult(_0x46e9b8,_0x7d307){return function(_0x4781dd){if(_0x4781dd){var _0xcdff9c=typeof _0x7d307[_0x2608('0x1e')]==='undefined'&&typeof _0x7d307[_0x2608('0x1f')]===_0x2608('0x20');var _0x2fe2d3=_0x4781dd[_0x2608('0x21')];var _0x17c1ca=_0xcdff9c?0x0:_0x7d307[_0x2608('0x1e')];var _0xfed0b3=_0xcdff9c?_0x4781dd[_0x2608('0x21')]:_0x7d307[_0x2608('0x1e')]+_0x7d307['limit'];var _0x4c76fe;if(_0xfed0b3>=_0x2fe2d3){_0xfed0b3=_0x2fe2d3;_0x4c76fe=0xc8;}else{_0x4c76fe=0xce;}_0x46e9b8[_0x2608('0x1b')](_0x4c76fe);return _0x46e9b8[_0x2608('0x22')](_0x2608('0x23'),_0x17c1ca+'-'+_0xfed0b3+'/'+_0x2fe2d3)[_0x2608('0x1d')](_0x4781dd);}return null;};}function patchUpdates(_0x17fc49){return function(_0x3f986c){try{jsonpatch[_0x2608('0x24')](_0x3f986c,_0x17fc49,!![]);}catch(_0x3c5721){return BPromise['reject'](_0x3c5721);}return _0x3f986c[_0x2608('0x25')]();};}function saveUpdates(_0x55da75,_0xbb8ec9){return function(_0x24214d){if(_0x24214d){return _0x24214d['update'](_0x55da75)[_0x2608('0x26')](function(_0x1b72c1){return _0x1b72c1;});}return null;};}function removeEntity(_0x3eea8e,_0x1201d1){return function(_0x28cfb3){if(_0x28cfb3){return _0x28cfb3[_0x2608('0x27')]()[_0x2608('0x26')](function(){_0x3eea8e['status'](0xcc)[_0x2608('0x1c')]();});}};}function handleEntityNotFound(_0x1e84ac,_0x4793af){return function(_0x34b48e){if(!_0x34b48e){_0x1e84ac['sendStatus'](0x194);}return _0x34b48e;};}function handleError(_0x215e6a,_0x5e8942){_0x5e8942=_0x5e8942||0x1f4;return function(_0x4580d1){logger[_0x2608('0x28')](_0x4580d1[_0x2608('0x29')]);if(_0x4580d1[_0x2608('0x2a')]){delete _0x4580d1['name'];}_0x215e6a[_0x2608('0x1b')](_0x5e8942)['send'](_0x4580d1);};}exports[_0x2608('0x2b')]=function(_0x1de2e4,_0x4a763e){var _0x471523={},_0x350c86={},_0x1e74bd={'count':0x0,'rows':[]};var _0x17b2f7=_[_0x2608('0x2c')](db[_0x2608('0x2d')][_0x2608('0x2e')],function(_0x2e93bd){return{'name':_0x2e93bd[_0x2608('0x2f')],'type':_0x2e93bd[_0x2608('0x30')]['key']};});_0x350c86[_0x2608('0x31')]=_[_0x2608('0x2c')](_0x17b2f7,_0x2608('0x2a'));_0x350c86['query']=_[_0x2608('0x32')](_0x1de2e4[_0x2608('0x33')]);_0x350c86[_0x2608('0x34')]=_[_0x2608('0x35')](_0x350c86['model'],_0x350c86[_0x2608('0x33')]);_0x471523[_0x2608('0x36')]=_[_0x2608('0x35')](_0x350c86[_0x2608('0x31')],qs['fields'](_0x1de2e4[_0x2608('0x33')][_0x2608('0x37')]));_0x471523[_0x2608('0x36')]=_0x471523['attributes'][_0x2608('0x38')]?_0x471523[_0x2608('0x36')]:_0x350c86[_0x2608('0x31')];if(!_0x1de2e4[_0x2608('0x33')][_0x2608('0x39')]('nolimit')){_0x471523[_0x2608('0x1f')]=qs['limit'](_0x1de2e4['query'][_0x2608('0x1f')]);_0x471523['offset']=qs[_0x2608('0x1e')](_0x1de2e4['query'][_0x2608('0x1e')]);}_0x471523[_0x2608('0x3a')]=qs['sort'](_0x1de2e4[_0x2608('0x33')][_0x2608('0x3b')]);_0x471523['where']=qs[_0x2608('0x34')](_[_0x2608('0x3c')](_0x1de2e4[_0x2608('0x33')],_0x350c86[_0x2608('0x34')]),_0x17b2f7);if(_0x1de2e4[_0x2608('0x33')]['filter']){_0x471523[_0x2608('0x3d')]=_[_0x2608('0x3e')](_0x471523[_0x2608('0x3d')],{'$or':_[_0x2608('0x2c')](_0x17b2f7,function(_0x48b0f7){if(_0x48b0f7[_0x2608('0x30')]!==_0x2608('0x3f')){var _0x250e1c={};_0x250e1c[_0x48b0f7[_0x2608('0x2a')]]={'$like':'%'+_0x1de2e4[_0x2608('0x33')]['filter']+'%'};return _0x250e1c;}})});}_0x471523=_['merge']({},_0x471523,_0x1de2e4['options']);var _0x59d0e3={'where':_0x471523[_0x2608('0x3d')]};return db[_0x2608('0x2d')][_0x2608('0x21')](_0x59d0e3)[_0x2608('0x26')](function(_0x14babd){_0x1e74bd[_0x2608('0x21')]=_0x14babd;if(_0x1de2e4[_0x2608('0x33')][_0x2608('0x40')]){_0x471523[_0x2608('0x41')]=[{'all':!![]}];}return db[_0x2608('0x2d')]['findAll'](_0x471523);})[_0x2608('0x26')](function(_0x474d61){_0x1e74bd[_0x2608('0x42')]=_0x474d61;return _0x1e74bd;})[_0x2608('0x26')](respondWithFilteredResult(_0x4a763e,_0x471523))[_0x2608('0x43')](handleError(_0x4a763e,null));};exports[_0x2608('0x44')]=function(_0x320f75,_0x4ff673){var _0x245e66={'raw':!![],'where':{'id':_0x320f75['params']['id']}},_0x565b3d={};_0x565b3d[_0x2608('0x31')]=_[_0x2608('0x32')](db[_0x2608('0x2d')]['rawAttributes']);_0x565b3d[_0x2608('0x33')]=_[_0x2608('0x32')](_0x320f75[_0x2608('0x33')]);_0x565b3d[_0x2608('0x34')]=_[_0x2608('0x35')](_0x565b3d[_0x2608('0x31')],_0x565b3d[_0x2608('0x33')]);_0x245e66[_0x2608('0x36')]=_[_0x2608('0x35')](_0x565b3d[_0x2608('0x31')],qs[_0x2608('0x37')](_0x320f75[_0x2608('0x33')]['fields']));_0x245e66['attributes']=_0x245e66['attributes'][_0x2608('0x38')]?_0x245e66['attributes']:_0x565b3d[_0x2608('0x31')];if(_0x320f75[_0x2608('0x33')][_0x2608('0x40')]){_0x245e66[_0x2608('0x41')]=[{'all':!![]}];}_0x245e66=_[_0x2608('0x3e')]({},_0x245e66,_0x320f75['options']);return db['SugarcrmField'][_0x2608('0x45')](_0x245e66)[_0x2608('0x26')](handleEntityNotFound(_0x4ff673,null))[_0x2608('0x26')](respondWithResult(_0x4ff673,null))['catch'](handleError(_0x4ff673,null));};exports[_0x2608('0x46')]=function(_0x936403,_0x5ac904){return db['SugarcrmField']['create'](_0x936403[_0x2608('0x47')],{})['then'](respondWithResult(_0x5ac904,0xc9))['catch'](handleError(_0x5ac904,null));};exports[_0x2608('0x48')]=function(_0x459935,_0x46637d){if(_0x459935['body']['id']){delete _0x459935['body']['id'];}return db[_0x2608('0x2d')]['find']({'where':{'id':_0x459935['params']['id']}})[_0x2608('0x26')](handleEntityNotFound(_0x46637d,null))[_0x2608('0x26')](saveUpdates(_0x459935['body'],null))['then'](respondWithResult(_0x46637d,null))[_0x2608('0x43')](handleError(_0x46637d,null));};exports[_0x2608('0x27')]=function(_0x4bcfaa,_0x46b4cd){return db[_0x2608('0x2d')][_0x2608('0x45')]({'where':{'id':_0x4bcfaa[_0x2608('0x49')]['id']}})[_0x2608('0x26')](handleEntityNotFound(_0x46b4cd,null))['then'](removeEntity(_0x46b4cd,null))[_0x2608('0x43')](handleError(_0x46b4cd,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 8f6cfd8..bf66ac7 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 _0x2d18=['api','moment','request-promise','./intSugarcrmField.attributes','idField','FieldId','lodash','util'];(function(_0x5235dd,_0x3f91cf){var _0x13059d=function(_0x355a98){while(--_0x355a98){_0x5235dd['push'](_0x5235dd['shift']());}};_0x13059d(++_0x3f91cf);}(_0x2d18,0x1b6));var _0x82d1=function(_0x4f3d8a,_0x127a82){_0x4f3d8a=_0x4f3d8a-0x0;var _0x24d49c=_0x2d18[_0x4f3d8a];return _0x24d49c;};'use strict';var _=require(_0x82d1('0x0'));var util=require(_0x82d1('0x1'));var logger=require('../../config/logger')(_0x82d1('0x2'));var moment=require(_0x82d1('0x3'));var BPromise=require('bluebird');var rp=require(_0x82d1('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x82d1('0x5'));module['exports']=function(_0x5452db,_0x4a8633){return _0x5452db['define']('SugarcrmField',attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':[_0x82d1('0x6'),_0x82d1('0x7')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc627=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intSugarcrmField.attributes','exports','define','SugarcrmField','int_sugarcrm_fields','idField'];(function(_0x2cd1f6,_0x3aa2f1){var _0x18b273=function(_0x59f863){while(--_0x59f863){_0x2cd1f6['push'](_0x2cd1f6['shift']());}};_0x18b273(++_0x3aa2f1);}(_0xc627,0xb6));var _0x7c62=function(_0x2607e3,_0x765ab6){_0x2607e3=_0x2607e3-0x0;var _0x398355=_0xc627[_0x2607e3];return _0x398355;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7c62('0x0'))(_0x7c62('0x1'));var moment=require(_0x7c62('0x2'));var BPromise=require(_0x7c62('0x3'));var rp=require(_0x7c62('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7c62('0x5'));var config=require(_0x7c62('0x6'));var attributes=require(_0x7c62('0x7'));module[_0x7c62('0x8')]=function(_0x30f702,_0x733feb){return _0x30f702[_0x7c62('0x9')](_0x7c62('0xa'),attributes,{'tableName':_0x7c62('0xb'),'paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':[_0x7c62('0xc'),'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 31c1f44..2536f28 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 _0xd390=['SugarcrmField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','SugarcrmField,\x20%s,\x20%s','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','debug'];(function(_0x15ca1a,_0x30fc82){var _0x507626=function(_0x14c9bc){while(--_0x14c9bc){_0x15ca1a['push'](_0x15ca1a['shift']());}};_0x507626(++_0x30fc82);}(_0xd390,0x80));var _0x0d39=function(_0x37b772,_0x54726b){_0x37b772=_0x37b772-0x0;var _0x4208d2=_0xd390[_0x37b772];return _0x4208d2;};'use strict';var _=require(_0x0d39('0x0'));var util=require('util');var moment=require(_0x0d39('0x1'));var BPromise=require(_0x0d39('0x2'));var rs=require(_0x0d39('0x3'));var fs=require('fs');var Redis=require(_0x0d39('0x4'));var db=require(_0x0d39('0x5'))['db'];var utils=require(_0x0d39('0x6'));var logger=require(_0x0d39('0x7'))(_0x0d39('0x8'));var config=require(_0x0d39('0x9'));var jayson=require(_0x0d39('0xa'));var client=jayson[_0x0d39('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3cbf2a,_0x1fb042,_0x1b4bda){return new BPromise(function(_0x13c203,_0xbee4d5){return client[_0x0d39('0xc')](_0x3cbf2a,_0x1b4bda)[_0x0d39('0xd')](function(_0x1eeade){logger[_0x0d39('0xe')]('SugarcrmField,\x20%s,\x20%s',_0x1fb042,'request\x20sent');logger[_0x0d39('0xf')](_0x0d39('0x10'),_0x1fb042,_0x0d39('0x11'),JSON[_0x0d39('0x12')](_0x1eeade));if(_0x1eeade[_0x0d39('0x13')]){if(_0x1eeade[_0x0d39('0x13')][_0x0d39('0x14')]===0x1f4){logger[_0x0d39('0x13')]('SugarcrmField,\x20%s,\x20%s',_0x1fb042,_0x1eeade[_0x0d39('0x13')][_0x0d39('0x15')]);return _0xbee4d5(_0x1eeade['error'][_0x0d39('0x15')]);}logger[_0x0d39('0x13')](_0x0d39('0x16'),_0x1fb042,_0x1eeade[_0x0d39('0x13')][_0x0d39('0x15')]);return _0x13c203(_0x1eeade[_0x0d39('0x13')][_0x0d39('0x15')]);}else{logger[_0x0d39('0xe')](_0x0d39('0x16'),_0x1fb042,_0x0d39('0x11'));_0x13c203(_0x1eeade[_0x0d39('0x17')][_0x0d39('0x15')]);}})['catch'](function(_0x485459){logger[_0x0d39('0x13')](_0x0d39('0x16'),_0x1fb042,_0x485459);_0xbee4d5(_0x485459);});});} \ No newline at end of file +var _0xe0e9=['http','request','then','info','request\x20sent','error','code','SugarcrmField,\x20%s,\x20%s','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise'];(function(_0x1502c2,_0x6e62f){var _0x29fdbc=function(_0x51f27d){while(--_0x51f27d){_0x1502c2['push'](_0x1502c2['shift']());}};_0x29fdbc(++_0x6e62f);}(_0xe0e9,0x101));var _0x9e0e=function(_0x51d0a9,_0x18972d){_0x51d0a9=_0x51d0a9-0x0;var _0x3ebb70=_0xe0e9[_0x51d0a9];return _0x3ebb70;};'use strict';var _=require(_0x9e0e('0x0'));var util=require(_0x9e0e('0x1'));var moment=require('moment');var BPromise=require(_0x9e0e('0x2'));var rs=require(_0x9e0e('0x3'));var fs=require('fs');var Redis=require(_0x9e0e('0x4'));var db=require(_0x9e0e('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9e0e('0x6'));var config=require(_0x9e0e('0x7'));var jayson=require(_0x9e0e('0x8'));var client=jayson['client'][_0x9e0e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x362b7a,_0x3d7cae,_0x11d4f1){return new BPromise(function(_0x2441b3,_0x3bedea){return client[_0x9e0e('0xa')](_0x362b7a,_0x11d4f1)[_0x9e0e('0xb')](function(_0x4f6bec){logger[_0x9e0e('0xc')]('SugarcrmField,\x20%s,\x20%s',_0x3d7cae,_0x9e0e('0xd'));logger['debug']('SugarcrmField,\x20%s,\x20%s,\x20%s',_0x3d7cae,_0x9e0e('0xd'),JSON['stringify'](_0x4f6bec));if(_0x4f6bec[_0x9e0e('0xe')]){if(_0x4f6bec[_0x9e0e('0xe')][_0x9e0e('0xf')]===0x1f4){logger[_0x9e0e('0xe')](_0x9e0e('0x10'),_0x3d7cae,_0x4f6bec['error'][_0x9e0e('0x11')]);return _0x3bedea(_0x4f6bec[_0x9e0e('0xe')][_0x9e0e('0x11')]);}logger['error'](_0x9e0e('0x10'),_0x3d7cae,_0x4f6bec[_0x9e0e('0xe')][_0x9e0e('0x11')]);return _0x2441b3(_0x4f6bec[_0x9e0e('0xe')][_0x9e0e('0x11')]);}else{logger['info'](_0x9e0e('0x10'),_0x3d7cae,'request\x20sent');_0x2441b3(_0x4f6bec['result'][_0x9e0e('0x11')]);}})[_0x9e0e('0x12')](function(_0x517602){logger[_0x9e0e('0xe')](_0x9e0e('0x10'),_0x3d7cae,_0x517602);_0x3bedea(_0x517602);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index fea22cd..8d0b338 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 _0x0eec=['update','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put'];(function(_0x49648e,_0xb48220){var _0x767b44=function(_0x1d2b9e){while(--_0x1d2b9e){_0x49648e['push'](_0x49648e['shift']());}};_0x767b44(++_0xb48220);}(_0x0eec,0xac));var _0xc0ee=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0eec[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0xc0ee('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xc0ee('0x1'));var express=require(_0xc0ee('0x2'));var router=express[_0xc0ee('0x3')]();var fs_extra=require(_0xc0ee('0x4'));var auth=require(_0xc0ee('0x5'));var interaction=require(_0xc0ee('0x6'));var config=require(_0xc0ee('0x7'));var controller=require('./intVtigerAccount.controller');router[_0xc0ee('0x8')]('/',auth['isAuthenticated'](),controller[_0xc0ee('0x9')]);router[_0xc0ee('0x8')](_0xc0ee('0xa'),auth[_0xc0ee('0xb')](),controller[_0xc0ee('0xc')]);router[_0xc0ee('0x8')](_0xc0ee('0xd'),auth['isAuthenticated'](),controller[_0xc0ee('0xe')]);router[_0xc0ee('0x8')](_0xc0ee('0xf'),auth[_0xc0ee('0xb')](),controller[_0xc0ee('0x10')]);router[_0xc0ee('0x11')]('/',auth[_0xc0ee('0xb')](),controller['create']);router[_0xc0ee('0x11')](_0xc0ee('0xd'),auth[_0xc0ee('0xb')](),controller[_0xc0ee('0x12')]);router[_0xc0ee('0x13')](_0xc0ee('0xa'),auth[_0xc0ee('0xb')](),controller[_0xc0ee('0x14')]);router[_0xc0ee('0x15')]('/:id',auth['isAuthenticated'](),controller[_0xc0ee('0x16')]);module[_0xc0ee('0x17')]=router; \ No newline at end of file +var _0xe198=['isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','getFields','post','create','delete','destroy','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intVtigerAccount.controller','get'];(function(_0x3b2333,_0x15d8d7){var _0x1f9826=function(_0xedc744){while(--_0xedc744){_0x3b2333['push'](_0x3b2333['shift']());}};_0x1f9826(++_0x15d8d7);}(_0xe198,0x6f));var _0x8e19=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0xe198[_0x36c5b0];return _0xf19333;};'use strict';var multer=require(_0x8e19('0x0'));var util=require(_0x8e19('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x8e19('0x2'));var router=express[_0x8e19('0x3')]();var fs_extra=require(_0x8e19('0x4'));var auth=require(_0x8e19('0x5'));var interaction=require(_0x8e19('0x6'));var config=require('../../config/environment');var controller=require(_0x8e19('0x7'));router[_0x8e19('0x8')]('/',auth[_0x8e19('0x9')](),controller[_0x8e19('0xa')]);router[_0x8e19('0x8')](_0x8e19('0xb'),auth[_0x8e19('0x9')](),controller[_0x8e19('0xc')]);router[_0x8e19('0x8')](_0x8e19('0xd'),auth[_0x8e19('0x9')](),controller[_0x8e19('0xe')]);router[_0x8e19('0x8')]('/:id/fields',auth[_0x8e19('0x9')](),controller[_0x8e19('0xf')]);router[_0x8e19('0x10')]('/',auth[_0x8e19('0x9')](),controller[_0x8e19('0x11')]);router[_0x8e19('0x10')](_0x8e19('0xd'),auth[_0x8e19('0x9')](),controller['addConfiguration']);router['put'](_0x8e19('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x8e19('0x12')](_0x8e19('0xb'),auth[_0x8e19('0x9')](),controller[_0x8e19('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index 98b2c8d..158555e 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 _0x6bc9=['sequelize','exports','STRING','HelpDesk'];(function(_0x542c11,_0x35d5df){var _0xd5ba30=function(_0x352bff){while(--_0x352bff){_0x542c11['push'](_0x542c11['shift']());}};_0xd5ba30(++_0x35d5df);}(_0x6bc9,0xb4));var _0x96bc=function(_0x3ead55,_0x22bc51){_0x3ead55=_0x3ead55-0x0;var _0x3ea16d=_0x6bc9[_0x3ead55];return _0x3ea16d;};'use strict';var Sequelize=require(_0x96bc('0x0'));module[_0x96bc('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x96bc('0x2')]},'username':{'type':Sequelize[_0x96bc('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x96bc('0x2')],'allowNull':![],'defaultValue':_0x96bc('0x3')},'remoteUri':{'type':Sequelize[_0x96bc('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x96bc('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0xaaf5=['HelpDesk','sequelize','exports','STRING'];(function(_0x18e52b,_0x1fae35){var _0x3d3062=function(_0x133b14){while(--_0x133b14){_0x18e52b['push'](_0x18e52b['shift']());}};_0x3d3062(++_0x1fae35);}(_0xaaf5,0x165));var _0x5aaf=function(_0x10f5db,_0x1ec8be){_0x10f5db=_0x10f5db-0x0;var _0x12e69a=_0xaaf5[_0x10f5db];return _0x12e69a;};'use strict';var Sequelize=require(_0x5aaf('0x0'));module[_0x5aaf('0x1')]={'name':{'type':Sequelize[_0x5aaf('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x5aaf('0x2')]},'username':{'type':Sequelize[_0x5aaf('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x5aaf('0x2')],'allowNull':![],'defaultValue':_0x5aaf('0x3')},'remoteUri':{'type':Sequelize['STRING'],'allowNull':![]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'accessKey':{'type':Sequelize[_0x5aaf('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 5eb61b0..3a8d08a 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 _0x0180=['getFields','description','moduleName','remoteUri','serverUrl','accessKey','username','slice','substring','lastIndexOf','format','%s/webservice.php','getchallenge','success','POST','login','result','token','GET','describe','autogenerated','reference','owner','remove','includes','editable','false','startsWith','cf_','picklistValues','label','value','log','vTiger\x20error:\x20','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','fast-json-patch','request-promise','bluebird','util','path','sox','ejs','lodash','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','limit','undefined','count','offset','set','Content-Range','json','save','then','destroy','error','stack','name','send','index','VtigerAccount','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','fields','create','body','update','find','getConfigurations','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','VtigerConfiguration','VtigerField'];(function(_0x5c8de2,_0x18d15f){var _0x115c45=function(_0x4d8267){while(--_0x4d8267){_0x5c8de2['push'](_0x5c8de2['shift']());}};_0x115c45(++_0x18d15f);}(_0x0180,0x9c));var _0x0018=function(_0x324e24,_0x5f5afb){_0x324e24=_0x324e24-0x0;var _0x344c5e=_0x0180[_0x324e24];return _0x344c5e;};'use strict';var emlformat=require(_0x0018('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x0018('0x1'));var rp=require(_0x0018('0x2'));var moment=require('moment');var BPromise=require(_0x0018('0x3'));var Mustache=require('mustache');var util=require(_0x0018('0x4'));var path=require(_0x0018('0x5'));var sox=require(_0x0018('0x6'));var csv=require('to-csv');var ejs=require(_0x0018('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0018('0x8'));var squel=require('squel');var crypto=require(_0x0018('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x0018('0xa'));var toCsv=require('to-csv');var querystring=require(_0x0018('0xb'));var Papa=require('papaparse');var Redis=require(_0x0018('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x0018('0xd'));var as=require(_0x0018('0xe'));var hardwareService=require(_0x0018('0xf'));var logger=require(_0x0018('0x10'))('api');var utils=require('../../config/utils');var config=require(_0x0018('0x11'));var licenseUtil=require(_0x0018('0x12'));var db=require(_0x0018('0x13'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x26ee4c,_0x2d6cf1){_0x2d6cf1=_0x2d6cf1||0xcc;return function(_0x2cf698){if(_0x2cf698){return _0x26ee4c[_0x0018('0x14')](_0x2d6cf1);}return _0x26ee4c['status'](_0x2d6cf1)[_0x0018('0x15')]();};}function respondWithResult(_0x534dbe,_0x266f15){_0x266f15=_0x266f15||0xc8;return function(_0x394e80){if(_0x394e80){return _0x534dbe[_0x0018('0x16')](_0x266f15)['json'](_0x394e80);}};}function respondWithFilteredResult(_0xf0a09d,_0x570758){return function(_0x42da5f){if(_0x42da5f){var _0x525f04=typeof _0x570758['offset']==='undefined'&&typeof _0x570758[_0x0018('0x17')]===_0x0018('0x18');var _0x3bc096=_0x42da5f[_0x0018('0x19')];var _0x599b68=_0x525f04?0x0:_0x570758[_0x0018('0x1a')];var _0x3d2083=_0x525f04?_0x42da5f['count']:_0x570758[_0x0018('0x1a')]+_0x570758['limit'];var _0x14c17a;if(_0x3d2083>=_0x3bc096){_0x3d2083=_0x3bc096;_0x14c17a=0xc8;}else{_0x14c17a=0xce;}_0xf0a09d['status'](_0x14c17a);return _0xf0a09d[_0x0018('0x1b')](_0x0018('0x1c'),_0x599b68+'-'+_0x3d2083+'/'+_0x3bc096)[_0x0018('0x1d')](_0x42da5f);}return null;};}function patchUpdates(_0x2313ed){return function(_0xc76c51){try{jsonpatch['apply'](_0xc76c51,_0x2313ed,!![]);}catch(_0x4de45c){return BPromise['reject'](_0x4de45c);}return _0xc76c51[_0x0018('0x1e')]();};}function saveUpdates(_0xbea7ba,_0x21c836){return function(_0x3a2b69){if(_0x3a2b69){return _0x3a2b69['update'](_0xbea7ba)[_0x0018('0x1f')](function(_0x48b40b){return _0x48b40b;});}return null;};}function removeEntity(_0x4c54e5,_0x3a1c8b){return function(_0x5b52a9){if(_0x5b52a9){return _0x5b52a9[_0x0018('0x20')]()[_0x0018('0x1f')](function(){_0x4c54e5['status'](0xcc)[_0x0018('0x15')]();});}};}function handleEntityNotFound(_0xc100ce,_0x1b4957){return function(_0x3fd591){if(!_0x3fd591){_0xc100ce['sendStatus'](0x194);}return _0x3fd591;};}function handleError(_0x2f9866,_0x357b42){_0x357b42=_0x357b42||0x1f4;return function(_0x56cc29){logger[_0x0018('0x21')](_0x56cc29[_0x0018('0x22')]);if(_0x56cc29[_0x0018('0x23')]){delete _0x56cc29[_0x0018('0x23')];}_0x2f9866[_0x0018('0x16')](_0x357b42)[_0x0018('0x24')](_0x56cc29);};}exports[_0x0018('0x25')]=function(_0x43a7e8,_0x3f83ce){var _0xa5371c={},_0x52eb22={},_0x5ee264={'count':0x0,'rows':[]};var _0x1fda93=_['map'](db[_0x0018('0x26')][_0x0018('0x27')],function(_0x3e63d6){return{'name':_0x3e63d6[_0x0018('0x28')],'type':_0x3e63d6[_0x0018('0x29')]['key']};});_0x52eb22[_0x0018('0x2a')]=_['map'](_0x1fda93,'name');_0x52eb22[_0x0018('0x2b')]=_['keys'](_0x43a7e8[_0x0018('0x2b')]);_0x52eb22[_0x0018('0x2c')]=_[_0x0018('0x2d')](_0x52eb22[_0x0018('0x2a')],_0x52eb22[_0x0018('0x2b')]);_0xa5371c[_0x0018('0x2e')]=_['intersection'](_0x52eb22[_0x0018('0x2a')],qs['fields'](_0x43a7e8[_0x0018('0x2b')]['fields']));_0xa5371c[_0x0018('0x2e')]=_0xa5371c['attributes'][_0x0018('0x2f')]?_0xa5371c[_0x0018('0x2e')]:_0x52eb22[_0x0018('0x2a')];if(!_0x43a7e8[_0x0018('0x2b')][_0x0018('0x30')](_0x0018('0x31'))){_0xa5371c['limit']=qs[_0x0018('0x17')](_0x43a7e8[_0x0018('0x2b')][_0x0018('0x17')]);_0xa5371c[_0x0018('0x1a')]=qs[_0x0018('0x1a')](_0x43a7e8[_0x0018('0x2b')][_0x0018('0x1a')]);}_0xa5371c[_0x0018('0x32')]=qs[_0x0018('0x33')](_0x43a7e8['query']['sort']);_0xa5371c[_0x0018('0x34')]=qs[_0x0018('0x2c')](_[_0x0018('0x35')](_0x43a7e8[_0x0018('0x2b')],_0x52eb22[_0x0018('0x2c')]),_0x1fda93);if(_0x43a7e8['query'][_0x0018('0x36')]){_0xa5371c[_0x0018('0x34')]=_[_0x0018('0x37')](_0xa5371c[_0x0018('0x34')],{'$or':_[_0x0018('0x38')](_0x1fda93,function(_0x15b107){if(_0x15b107[_0x0018('0x29')]!==_0x0018('0x39')){var _0x15fe92={};_0x15fe92[_0x15b107[_0x0018('0x23')]]={'$like':'%'+_0x43a7e8[_0x0018('0x2b')][_0x0018('0x36')]+'%'};return _0x15fe92;}})});}_0xa5371c=_[_0x0018('0x37')]({},_0xa5371c,_0x43a7e8[_0x0018('0x3a')]);var _0x5b1169={'where':_0xa5371c[_0x0018('0x34')]};return db[_0x0018('0x26')][_0x0018('0x19')](_0x5b1169)[_0x0018('0x1f')](function(_0x152e0e){_0x5ee264[_0x0018('0x19')]=_0x152e0e;if(_0x43a7e8[_0x0018('0x2b')][_0x0018('0x3b')]){_0xa5371c[_0x0018('0x3c')]=[{'all':!![]}];}return db[_0x0018('0x26')][_0x0018('0x3d')](_0xa5371c);})[_0x0018('0x1f')](function(_0x3efa85){_0x5ee264[_0x0018('0x3e')]=_0x3efa85;return _0x5ee264;})['then'](respondWithFilteredResult(_0x3f83ce,_0xa5371c))[_0x0018('0x3f')](handleError(_0x3f83ce,null));};exports[_0x0018('0x40')]=function(_0x13d15d,_0xd8f99c){var _0x1b0ac3={'raw':![],'where':{'id':_0x13d15d[_0x0018('0x41')]['id']}},_0x43a810={};_0x43a810['model']=_['keys'](db[_0x0018('0x26')]['rawAttributes']);_0x43a810['query']=_[_0x0018('0x42')](_0x13d15d[_0x0018('0x2b')]);_0x43a810[_0x0018('0x2c')]=_[_0x0018('0x2d')](_0x43a810[_0x0018('0x2a')],_0x43a810[_0x0018('0x2b')]);_0x1b0ac3[_0x0018('0x2e')]=_[_0x0018('0x2d')](_0x43a810[_0x0018('0x2a')],qs[_0x0018('0x43')](_0x13d15d['query'][_0x0018('0x43')]));_0x1b0ac3[_0x0018('0x2e')]=_0x1b0ac3[_0x0018('0x2e')][_0x0018('0x2f')]?_0x1b0ac3[_0x0018('0x2e')]:_0x43a810[_0x0018('0x2a')];if(_0x13d15d[_0x0018('0x2b')]['includeAll']){_0x1b0ac3[_0x0018('0x3c')]=[{'all':!![]}];}_0x1b0ac3=_[_0x0018('0x37')]({},_0x1b0ac3,_0x13d15d['options']);return db['VtigerAccount']['find'](_0x1b0ac3)[_0x0018('0x1f')](handleEntityNotFound(_0xd8f99c,null))[_0x0018('0x1f')](respondWithResult(_0xd8f99c,null))['catch'](handleError(_0xd8f99c,null));};exports['create']=function(_0x7c322e,_0x147ccf){return db[_0x0018('0x26')][_0x0018('0x44')](_0x7c322e[_0x0018('0x45')],{})['then'](respondWithResult(_0x147ccf,0xc9))[_0x0018('0x3f')](handleError(_0x147ccf,null));};exports[_0x0018('0x46')]=function(_0x532843,_0x18d4ec){if(_0x532843[_0x0018('0x45')]['id']){delete _0x532843[_0x0018('0x45')]['id'];}return db['VtigerAccount'][_0x0018('0x47')]({'where':{'id':_0x532843[_0x0018('0x41')]['id']}})[_0x0018('0x1f')](handleEntityNotFound(_0x18d4ec,null))[_0x0018('0x1f')](saveUpdates(_0x532843['body'],null))['then'](respondWithResult(_0x18d4ec,null))[_0x0018('0x3f')](handleError(_0x18d4ec,null));};exports[_0x0018('0x20')]=function(_0x3f1da1,_0x2d9b4b){return db['VtigerAccount']['find']({'where':{'id':_0x3f1da1[_0x0018('0x41')]['id']}})[_0x0018('0x1f')](handleEntityNotFound(_0x2d9b4b,null))[_0x0018('0x1f')](removeEntity(_0x2d9b4b,null))[_0x0018('0x3f')](handleError(_0x2d9b4b,null));};exports[_0x0018('0x48')]=function(_0x5abbe5,_0x24279f,_0x2d985d){var _0x2b1117={};var _0x2707be={};var _0x29a87d;var _0x425f59;return db[_0x0018('0x26')][_0x0018('0x49')]({'where':{'id':_0x5abbe5[_0x0018('0x41')]['id']}})[_0x0018('0x1f')](handleEntityNotFound(_0x24279f,null))[_0x0018('0x1f')](function(_0x185333){if(_0x185333){_0x29a87d=_0x185333;_0x2707be['model']=_[_0x0018('0x42')](db['VtigerConfiguration'][_0x0018('0x27')]);_0x2707be[_0x0018('0x2b')]=_[_0x0018('0x42')](_0x5abbe5['query']);_0x2707be[_0x0018('0x2c')]=_['intersection'](_0x2707be[_0x0018('0x2a')],_0x2707be[_0x0018('0x2b')]);_0x2b1117[_0x0018('0x2e')]=_['intersection'](_0x2707be[_0x0018('0x2a')],qs['fields'](_0x5abbe5[_0x0018('0x2b')][_0x0018('0x43')]));_0x2b1117['attributes']=_0x2b1117[_0x0018('0x2e')]['length']?_0x2b1117[_0x0018('0x2e')]:_0x2707be[_0x0018('0x2a')];_0x2b1117['order']=qs[_0x0018('0x33')](_0x5abbe5[_0x0018('0x2b')][_0x0018('0x33')]);_0x2b1117['where']=qs[_0x0018('0x2c')](_[_0x0018('0x35')](_0x5abbe5[_0x0018('0x2b')],_0x2707be[_0x0018('0x2c')]));if(_0x5abbe5[_0x0018('0x2b')][_0x0018('0x36')]){_0x2b1117[_0x0018('0x34')]=_[_0x0018('0x37')](_0x2b1117[_0x0018('0x34')],{'$or':_[_0x0018('0x38')](_0x2b1117[_0x0018('0x2e')],function(_0x40dc46){var _0x3f7e20={};_0x3f7e20[_0x40dc46]={'$like':'%'+_0x5abbe5[_0x0018('0x2b')][_0x0018('0x36')]+'%'};return _0x3f7e20;})});}_0x2b1117=_[_0x0018('0x37')]({},_0x2b1117,_0x5abbe5[_0x0018('0x3a')]);return _0x29a87d[_0x0018('0x48')](_0x2b1117);}})['then'](function(_0x439136){if(_0x439136){_0x425f59=_0x439136[_0x0018('0x2f')];if(!_0x5abbe5['query']['hasOwnProperty'](_0x0018('0x31'))){_0x2b1117[_0x0018('0x17')]=qs[_0x0018('0x17')](_0x5abbe5[_0x0018('0x2b')][_0x0018('0x17')]);_0x2b1117[_0x0018('0x1a')]=qs['offset'](_0x5abbe5[_0x0018('0x2b')][_0x0018('0x1a')]);}return _0x29a87d[_0x0018('0x48')](_0x2b1117);}})['then'](function(_0x4204d4){if(_0x4204d4){return _0x4204d4?{'count':_0x425f59,'rows':_0x4204d4}:null;}})[_0x0018('0x1f')](respondWithResult(_0x24279f,null))[_0x0018('0x3f')](handleError(_0x24279f,null));};exports['addConfiguration']=function(_0x527ad3,_0x4d7d87,_0x1414fc){if(_0x527ad3[_0x0018('0x45')]['id']){delete _0x527ad3[_0x0018('0x45')]['id'];}return db[_0x0018('0x26')][_0x0018('0x49')]({'where':{'id':_0x527ad3['params']['id']}})[_0x0018('0x1f')](handleEntityNotFound(_0x4d7d87,null))[_0x0018('0x1f')](function(_0x51e38f){if(_0x51e38f){_0x527ad3[_0x0018('0x45')][_0x0018('0x4a')]=_0x51e38f['id'];_0x527ad3[_0x0018('0x45')][_0x0018('0x4b')]=integrations[_0x0018('0x4c')](_0x527ad3[_0x0018('0x45')][_0x0018('0x4d')],_0x527ad3[_0x0018('0x45')]['type']);_0x527ad3[_0x0018('0x45')][_0x0018('0x4e')]=integrations[_0x0018('0x4f')](_0x527ad3[_0x0018('0x45')][_0x0018('0x4d')],_0x527ad3[_0x0018('0x45')][_0x0018('0x29')]);return db[_0x0018('0x50')][_0x0018('0x44')](_0x527ad3['body'],{'include':[{'model':db[_0x0018('0x51')],'as':_0x0018('0x4b')},{'model':db['VtigerField'],'as':'Descriptions'}]});}return null;})[_0x0018('0x1f')](respondWithResult(_0x4d7d87,null))[_0x0018('0x3f')](handleError(_0x4d7d87,null));};var md5=require('md5');exports[_0x0018('0x52')]=function(_0x2a20b5,_0x26b4d9,_0x598036){var _0x5481ad=null;var _0x782c90=null;var _0x50cdab=null;var _0x4b2a31=null;var _0x26e19f='';return db['VtigerAccount'][_0x0018('0x49')]({'where':{'id':_0x2a20b5[_0x0018('0x41')]['id']},'attributes':['id',_0x0018('0x23'),'username',_0x0018('0x53'),_0x0018('0x54'),_0x0018('0x55'),_0x0018('0x56'),_0x0018('0x57')]})[_0x0018('0x1f')](handleEntityNotFound(_0x26b4d9,null))[_0x0018('0x1f')](function(_0x2a4443){if(_0x2a4443){_0x5481ad=_0x2a4443[_0x0018('0x58')];_0x782c90=_0x2a4443['accessKey'];_0x50cdab=_0x2a4443[_0x0018('0x54')];_0x26e19f=_0x2a4443[_0x0018('0x55')];var _0x259636=_0x26e19f[_0x0018('0x59')](-0x1);if(_0x259636==='/'){_0x26e19f=_0x26e19f[_0x0018('0x5a')](0x0,_0x26e19f[_0x0018('0x5b')](_0x259636));}_0x4b2a31=util[_0x0018('0x5c')](_0x0018('0x5d'),_0x26e19f);var _0x4f7935={'method':'GET','uri':_0x4b2a31,'qs':{'operation':_0x0018('0x5e'),'username':_0x2a4443[_0x0018('0x58')]},'json':!![]};return rp(_0x4f7935);}})[_0x0018('0x1f')](function(_0x2e5ffc){if(_0x2e5ffc[_0x0018('0x5f')]){var _0x4e41d0={'method':_0x0018('0x60'),'uri':_0x4b2a31,'form':{'operation':_0x0018('0x61'),'username':_0x5481ad,'accessKey':md5(_0x2e5ffc[_0x0018('0x62')][_0x0018('0x63')]+_0x782c90)},'json':!![]};return rp(_0x4e41d0);}})[_0x0018('0x1f')](function(_0x41a7f9){if(_0x41a7f9[_0x0018('0x5f')]){var _0x405c7a={'method':_0x0018('0x64'),'uri':_0x4b2a31,'qs':{'operation':_0x0018('0x65'),'username':_0x5481ad,'sessionName':_0x41a7f9[_0x0018('0x62')]['sessionName'],'elementType':_0x50cdab},'json':!![]};return rp(_0x405c7a);}})[_0x0018('0x1f')](function(_0x280c69){if(_0x280c69['success']){var _0x32d569=[_0x0018('0x66'),_0x0018('0x67'),_0x0018('0x68')];_[_0x0018('0x69')](_0x280c69[_0x0018('0x62')]['fields'],function(_0x9640cf){return _0x32d569[_0x0018('0x6a')](_0x9640cf['type']['name']);});_[_0x0018('0x69')](_0x280c69[_0x0018('0x62')][_0x0018('0x43')],function(_0x2a7ab6){return _0x2a7ab6[_0x0018('0x6b')]===_0x0018('0x6c');});return{'count':_0x280c69[_0x0018('0x62')]['fields'][_0x0018('0x2f')],'rows':_['map'](_0x280c69['result'][_0x0018('0x43')],function(_0x4f6646){return{'id':_0x4f6646[_0x0018('0x23')],'name':_0x4f6646['label'],'custom':_[_0x0018('0x6d')](_0x4f6646[_0x0018('0x23')],_0x0018('0x6e'))?!![]:![],'options':_0x4f6646[_0x0018('0x29')][_0x0018('0x23')]==='picklist'&&_0x4f6646['type'][_0x0018('0x6f')]['length']>0x0?_[_0x0018('0x38')](_0x4f6646[_0x0018('0x29')]['picklistValues'],function(_0x3f8096){return{'name':_0x3f8096[_0x0018('0x70')],'value':_0x3f8096[_0x0018('0x71')]};}):[]};})};}})['then'](respondWithResult(_0x26b4d9,null))[_0x0018('0x3f')](function(_0x1dbe9c){console[_0x0018('0x72')](_0x0018('0x73')+_0x1dbe9c);var _0x35c512=_0x2a20b5[_0x0018('0x2b')]['test']?0x1f4:_0x1dbe9c[_0x0018('0x74')]||0x1f4;logger['error'](_0x0018('0x75'),_0x0018('0x52'),_0x35c512,JSON[_0x0018('0x76')](_0x1dbe9c));delete _0x1dbe9c['name'];if(_0x35c512===0x191){_0x35c512=0x190;}_0x26b4d9[_0x0018('0x16')](_0x35c512)['send'](_0x2a20b5[_0x0018('0x2b')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x1dbe9c[_0x0018('0x74')]}:_0x1dbe9c);});}; \ No newline at end of file +var _0x3a55=['nolimit','order','sort','where','filters','filter','merge','type','options','include','VtigerAccount','findAll','rows','catch','includeAll','find','create','body','params','getConfigurations','VtigerConfiguration','pick','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','VtigerField','Descriptions','md5','getFields','username','description','moduleName','serverUrl','accessKey','slice','lastIndexOf','format','getchallenge','success','login','token','GET','describe','result','sessionName','autogenerated','reference','owner','remove','includes','editable','false','picklist','picklistValues','label','log','vTiger\x20error:\x20','test','statusCode','stringify','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x3a55,0x134));var _0x53a5=function(_0xacdb96,_0x123d81){_0xacdb96=_0xacdb96-0x0;var _0xcf4183=_0x3a55[_0xacdb96];return _0xcf4183;};'use strict';var emlformat=require(_0x53a5('0x0'));var rimraf=require(_0x53a5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x53a5('0x2'));var rp=require(_0x53a5('0x3'));var moment=require(_0x53a5('0x4'));var BPromise=require(_0x53a5('0x5'));var Mustache=require(_0x53a5('0x6'));var util=require('util');var path=require(_0x53a5('0x7'));var sox=require(_0x53a5('0x8'));var csv=require(_0x53a5('0x9'));var ejs=require(_0x53a5('0xa'));var fs=require('fs');var fs_extra=require(_0x53a5('0xb'));var _=require(_0x53a5('0xc'));var squel=require(_0x53a5('0xd'));var crypto=require(_0x53a5('0xe'));var jsforce=require(_0x53a5('0xf'));var deskjs=require(_0x53a5('0x10'));var toCsv=require(_0x53a5('0x9'));var querystring=require(_0x53a5('0x11'));var Papa=require(_0x53a5('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x53a5('0x13'));var hardwareService=require(_0x53a5('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x53a5('0x15'));var config=require(_0x53a5('0x16'));var licenseUtil=require(_0x53a5('0x17'));var db=require(_0x53a5('0x18'))['db'];var integrations=require(_0x53a5('0x19'));function respondWithStatusCode(_0x1787e2,_0x594d3b){_0x594d3b=_0x594d3b||0xcc;return function(_0xa6340d){if(_0xa6340d){return _0x1787e2['sendStatus'](_0x594d3b);}return _0x1787e2[_0x53a5('0x1a')](_0x594d3b)[_0x53a5('0x1b')]();};}function respondWithResult(_0x108c4b,_0x50cd6e){_0x50cd6e=_0x50cd6e||0xc8;return function(_0x399ca8){if(_0x399ca8){return _0x108c4b[_0x53a5('0x1a')](_0x50cd6e)[_0x53a5('0x1c')](_0x399ca8);}};}function respondWithFilteredResult(_0x39ad46,_0x1307ad){return function(_0x3f0a7e){if(_0x3f0a7e){var _0x299a5a=typeof _0x1307ad[_0x53a5('0x1d')]==='undefined'&&typeof _0x1307ad[_0x53a5('0x1e')]===_0x53a5('0x1f');var _0x4b3efa=_0x3f0a7e['count'];var _0x41f14c=_0x299a5a?0x0:_0x1307ad[_0x53a5('0x1d')];var _0x6958e6=_0x299a5a?_0x3f0a7e[_0x53a5('0x20')]:_0x1307ad[_0x53a5('0x1d')]+_0x1307ad['limit'];var _0x21127d;if(_0x6958e6>=_0x4b3efa){_0x6958e6=_0x4b3efa;_0x21127d=0xc8;}else{_0x21127d=0xce;}_0x39ad46[_0x53a5('0x1a')](_0x21127d);return _0x39ad46[_0x53a5('0x21')]('Content-Range',_0x41f14c+'-'+_0x6958e6+'/'+_0x4b3efa)[_0x53a5('0x1c')](_0x3f0a7e);}return null;};}function patchUpdates(_0x1f159e){return function(_0x1fd172){try{jsonpatch[_0x53a5('0x22')](_0x1fd172,_0x1f159e,!![]);}catch(_0x5754f1){return BPromise[_0x53a5('0x23')](_0x5754f1);}return _0x1fd172[_0x53a5('0x24')]();};}function saveUpdates(_0x212b9a,_0x2ea5c5){return function(_0x53ef01){if(_0x53ef01){return _0x53ef01[_0x53a5('0x25')](_0x212b9a)[_0x53a5('0x26')](function(_0x533b5f){return _0x533b5f;});}return null;};}function removeEntity(_0xe68862,_0x44b8c0){return function(_0x571321){if(_0x571321){return _0x571321[_0x53a5('0x27')]()['then'](function(){_0xe68862[_0x53a5('0x1a')](0xcc)[_0x53a5('0x1b')]();});}};}function handleEntityNotFound(_0x4496fb,_0xa80551){return function(_0x5754e0){if(!_0x5754e0){_0x4496fb[_0x53a5('0x28')](0x194);}return _0x5754e0;};}function handleError(_0x39a054,_0x1e7b90){_0x1e7b90=_0x1e7b90||0x1f4;return function(_0x4d5ea1){logger[_0x53a5('0x29')](_0x4d5ea1[_0x53a5('0x2a')]);if(_0x4d5ea1[_0x53a5('0x2b')]){delete _0x4d5ea1[_0x53a5('0x2b')];}_0x39a054[_0x53a5('0x1a')](_0x1e7b90)[_0x53a5('0x2c')](_0x4d5ea1);};}exports[_0x53a5('0x2d')]=function(_0x1fb6f2,_0x26dc5a){var _0x5901f4={},_0x342816={},_0x1b8f79={'count':0x0,'rows':[]};var _0x1291fc=_[_0x53a5('0x2e')](db['VtigerAccount'][_0x53a5('0x2f')],function(_0x2b1191){return{'name':_0x2b1191[_0x53a5('0x30')],'type':_0x2b1191['type'][_0x53a5('0x31')]};});_0x342816[_0x53a5('0x32')]=_['map'](_0x1291fc,_0x53a5('0x2b'));_0x342816[_0x53a5('0x33')]=_[_0x53a5('0x34')](_0x1fb6f2[_0x53a5('0x33')]);_0x342816['filters']=_[_0x53a5('0x35')](_0x342816[_0x53a5('0x32')],_0x342816[_0x53a5('0x33')]);_0x5901f4[_0x53a5('0x36')]=_[_0x53a5('0x35')](_0x342816[_0x53a5('0x32')],qs['fields'](_0x1fb6f2[_0x53a5('0x33')][_0x53a5('0x37')]));_0x5901f4[_0x53a5('0x36')]=_0x5901f4['attributes'][_0x53a5('0x38')]?_0x5901f4[_0x53a5('0x36')]:_0x342816[_0x53a5('0x32')];if(!_0x1fb6f2['query'][_0x53a5('0x39')](_0x53a5('0x3a'))){_0x5901f4['limit']=qs[_0x53a5('0x1e')](_0x1fb6f2[_0x53a5('0x33')][_0x53a5('0x1e')]);_0x5901f4[_0x53a5('0x1d')]=qs['offset'](_0x1fb6f2[_0x53a5('0x33')][_0x53a5('0x1d')]);}_0x5901f4[_0x53a5('0x3b')]=qs['sort'](_0x1fb6f2[_0x53a5('0x33')][_0x53a5('0x3c')]);_0x5901f4[_0x53a5('0x3d')]=qs['filters'](_['pick'](_0x1fb6f2[_0x53a5('0x33')],_0x342816[_0x53a5('0x3e')]),_0x1291fc);if(_0x1fb6f2[_0x53a5('0x33')][_0x53a5('0x3f')]){_0x5901f4[_0x53a5('0x3d')]=_[_0x53a5('0x40')](_0x5901f4[_0x53a5('0x3d')],{'$or':_[_0x53a5('0x2e')](_0x1291fc,function(_0x38afa0){if(_0x38afa0[_0x53a5('0x41')]!=='VIRTUAL'){var _0x27dae1={};_0x27dae1[_0x38afa0[_0x53a5('0x2b')]]={'$like':'%'+_0x1fb6f2[_0x53a5('0x33')][_0x53a5('0x3f')]+'%'};return _0x27dae1;}})});}_0x5901f4=_[_0x53a5('0x40')]({},_0x5901f4,_0x1fb6f2[_0x53a5('0x42')]);var _0x40d301={'where':_0x5901f4[_0x53a5('0x3d')]};return db['VtigerAccount']['count'](_0x40d301)[_0x53a5('0x26')](function(_0x27192a){_0x1b8f79[_0x53a5('0x20')]=_0x27192a;if(_0x1fb6f2[_0x53a5('0x33')]['includeAll']){_0x5901f4[_0x53a5('0x43')]=[{'all':!![]}];}return db[_0x53a5('0x44')][_0x53a5('0x45')](_0x5901f4);})[_0x53a5('0x26')](function(_0x2e6599){_0x1b8f79[_0x53a5('0x46')]=_0x2e6599;return _0x1b8f79;})['then'](respondWithFilteredResult(_0x26dc5a,_0x5901f4))[_0x53a5('0x47')](handleError(_0x26dc5a,null));};exports['show']=function(_0x5ce435,_0x105753){var _0x45a553={'raw':![],'where':{'id':_0x5ce435['params']['id']}},_0x1d5329={};_0x1d5329[_0x53a5('0x32')]=_[_0x53a5('0x34')](db[_0x53a5('0x44')][_0x53a5('0x2f')]);_0x1d5329[_0x53a5('0x33')]=_['keys'](_0x5ce435[_0x53a5('0x33')]);_0x1d5329['filters']=_[_0x53a5('0x35')](_0x1d5329['model'],_0x1d5329[_0x53a5('0x33')]);_0x45a553['attributes']=_[_0x53a5('0x35')](_0x1d5329['model'],qs['fields'](_0x5ce435[_0x53a5('0x33')]['fields']));_0x45a553[_0x53a5('0x36')]=_0x45a553[_0x53a5('0x36')][_0x53a5('0x38')]?_0x45a553[_0x53a5('0x36')]:_0x1d5329[_0x53a5('0x32')];if(_0x5ce435[_0x53a5('0x33')][_0x53a5('0x48')]){_0x45a553[_0x53a5('0x43')]=[{'all':!![]}];}_0x45a553=_[_0x53a5('0x40')]({},_0x45a553,_0x5ce435[_0x53a5('0x42')]);return db['VtigerAccount'][_0x53a5('0x49')](_0x45a553)[_0x53a5('0x26')](handleEntityNotFound(_0x105753,null))['then'](respondWithResult(_0x105753,null))[_0x53a5('0x47')](handleError(_0x105753,null));};exports[_0x53a5('0x4a')]=function(_0x25c8cd,_0x48231e){return db[_0x53a5('0x44')][_0x53a5('0x4a')](_0x25c8cd[_0x53a5('0x4b')],{})['then'](respondWithResult(_0x48231e,0xc9))[_0x53a5('0x47')](handleError(_0x48231e,null));};exports[_0x53a5('0x25')]=function(_0x1d75bd,_0x4e0f5d){if(_0x1d75bd[_0x53a5('0x4b')]['id']){delete _0x1d75bd[_0x53a5('0x4b')]['id'];}return db[_0x53a5('0x44')][_0x53a5('0x49')]({'where':{'id':_0x1d75bd[_0x53a5('0x4c')]['id']}})[_0x53a5('0x26')](handleEntityNotFound(_0x4e0f5d,null))['then'](saveUpdates(_0x1d75bd[_0x53a5('0x4b')],null))[_0x53a5('0x26')](respondWithResult(_0x4e0f5d,null))['catch'](handleError(_0x4e0f5d,null));};exports['destroy']=function(_0x148d44,_0x4501a5){return db[_0x53a5('0x44')][_0x53a5('0x49')]({'where':{'id':_0x148d44['params']['id']}})[_0x53a5('0x26')](handleEntityNotFound(_0x4501a5,null))[_0x53a5('0x26')](removeEntity(_0x4501a5,null))[_0x53a5('0x47')](handleError(_0x4501a5,null));};exports[_0x53a5('0x4d')]=function(_0x3f7b9f,_0x11eeae,_0x2807ec){var _0x5e01fd={};var _0x154ef1={};var _0x5eb423;var _0x2ba099;return db[_0x53a5('0x44')]['findOne']({'where':{'id':_0x3f7b9f[_0x53a5('0x4c')]['id']}})['then'](handleEntityNotFound(_0x11eeae,null))[_0x53a5('0x26')](function(_0xa308ba){if(_0xa308ba){_0x5eb423=_0xa308ba;_0x154ef1[_0x53a5('0x32')]=_[_0x53a5('0x34')](db[_0x53a5('0x4e')][_0x53a5('0x2f')]);_0x154ef1['query']=_[_0x53a5('0x34')](_0x3f7b9f[_0x53a5('0x33')]);_0x154ef1[_0x53a5('0x3e')]=_['intersection'](_0x154ef1[_0x53a5('0x32')],_0x154ef1[_0x53a5('0x33')]);_0x5e01fd[_0x53a5('0x36')]=_[_0x53a5('0x35')](_0x154ef1[_0x53a5('0x32')],qs[_0x53a5('0x37')](_0x3f7b9f[_0x53a5('0x33')][_0x53a5('0x37')]));_0x5e01fd['attributes']=_0x5e01fd[_0x53a5('0x36')][_0x53a5('0x38')]?_0x5e01fd['attributes']:_0x154ef1[_0x53a5('0x32')];_0x5e01fd[_0x53a5('0x3b')]=qs[_0x53a5('0x3c')](_0x3f7b9f['query'][_0x53a5('0x3c')]);_0x5e01fd[_0x53a5('0x3d')]=qs['filters'](_[_0x53a5('0x4f')](_0x3f7b9f['query'],_0x154ef1['filters']));if(_0x3f7b9f[_0x53a5('0x33')]['filter']){_0x5e01fd[_0x53a5('0x3d')]=_['merge'](_0x5e01fd['where'],{'$or':_[_0x53a5('0x2e')](_0x5e01fd[_0x53a5('0x36')],function(_0x5665bc){var _0x25074f={};_0x25074f[_0x5665bc]={'$like':'%'+_0x3f7b9f[_0x53a5('0x33')][_0x53a5('0x3f')]+'%'};return _0x25074f;})});}_0x5e01fd=_[_0x53a5('0x40')]({},_0x5e01fd,_0x3f7b9f['options']);return _0x5eb423[_0x53a5('0x4d')](_0x5e01fd);}})[_0x53a5('0x26')](function(_0x1d9a92){if(_0x1d9a92){_0x2ba099=_0x1d9a92[_0x53a5('0x38')];if(!_0x3f7b9f[_0x53a5('0x33')]['hasOwnProperty'](_0x53a5('0x3a'))){_0x5e01fd[_0x53a5('0x1e')]=qs['limit'](_0x3f7b9f[_0x53a5('0x33')][_0x53a5('0x1e')]);_0x5e01fd['offset']=qs[_0x53a5('0x1d')](_0x3f7b9f[_0x53a5('0x33')][_0x53a5('0x1d')]);}return _0x5eb423['getConfigurations'](_0x5e01fd);}})[_0x53a5('0x26')](function(_0xb5d9a5){if(_0xb5d9a5){return _0xb5d9a5?{'count':_0x2ba099,'rows':_0xb5d9a5}:null;}})[_0x53a5('0x26')](respondWithResult(_0x11eeae,null))[_0x53a5('0x47')](handleError(_0x11eeae,null));};exports[_0x53a5('0x50')]=function(_0x5d3889,_0x1ffc13,_0x50ab9a){if(_0x5d3889[_0x53a5('0x4b')]['id']){delete _0x5d3889[_0x53a5('0x4b')]['id'];}return db[_0x53a5('0x44')][_0x53a5('0x51')]({'where':{'id':_0x5d3889[_0x53a5('0x4c')]['id']}})[_0x53a5('0x26')](handleEntityNotFound(_0x1ffc13,null))[_0x53a5('0x26')](function(_0x1e1014){if(_0x1e1014){_0x5d3889[_0x53a5('0x4b')][_0x53a5('0x52')]=_0x1e1014['id'];_0x5d3889[_0x53a5('0x4b')][_0x53a5('0x53')]=integrations[_0x53a5('0x54')](_0x5d3889[_0x53a5('0x4b')][_0x53a5('0x55')],_0x5d3889[_0x53a5('0x4b')][_0x53a5('0x41')]);_0x5d3889[_0x53a5('0x4b')]['Descriptions']=integrations['getDescriptions'](_0x5d3889['body'][_0x53a5('0x55')],_0x5d3889[_0x53a5('0x4b')][_0x53a5('0x41')]);return db[_0x53a5('0x4e')][_0x53a5('0x4a')](_0x5d3889[_0x53a5('0x4b')],{'include':[{'model':db[_0x53a5('0x56')],'as':_0x53a5('0x53')},{'model':db[_0x53a5('0x56')],'as':_0x53a5('0x57')}]});}return null;})['then'](respondWithResult(_0x1ffc13,null))['catch'](handleError(_0x1ffc13,null));};var md5=require(_0x53a5('0x58'));exports[_0x53a5('0x59')]=function(_0x3ab8b9,_0x50f099,_0x2bc682){var _0x35a14f=null;var _0x3b83c2=null;var _0x45454f=null;var _0x1fce0a=null;var _0x5f39a3='';return db[_0x53a5('0x44')][_0x53a5('0x51')]({'where':{'id':_0x3ab8b9[_0x53a5('0x4c')]['id']},'attributes':['id',_0x53a5('0x2b'),_0x53a5('0x5a'),_0x53a5('0x5b'),_0x53a5('0x5c'),'remoteUri',_0x53a5('0x5d'),_0x53a5('0x5e')]})[_0x53a5('0x26')](handleEntityNotFound(_0x50f099,null))['then'](function(_0x34f039){if(_0x34f039){_0x35a14f=_0x34f039[_0x53a5('0x5a')];_0x3b83c2=_0x34f039['accessKey'];_0x45454f=_0x34f039[_0x53a5('0x5c')];_0x5f39a3=_0x34f039['remoteUri'];var _0x55569e=_0x5f39a3[_0x53a5('0x5f')](-0x1);if(_0x55569e==='/'){_0x5f39a3=_0x5f39a3['substring'](0x0,_0x5f39a3[_0x53a5('0x60')](_0x55569e));}_0x1fce0a=util[_0x53a5('0x61')]('%s/webservice.php',_0x5f39a3);var _0x2ebdda={'method':'GET','uri':_0x1fce0a,'qs':{'operation':_0x53a5('0x62'),'username':_0x34f039[_0x53a5('0x5a')]},'json':!![]};return rp(_0x2ebdda);}})[_0x53a5('0x26')](function(_0x58204c){if(_0x58204c[_0x53a5('0x63')]){var _0x273a49={'method':'POST','uri':_0x1fce0a,'form':{'operation':_0x53a5('0x64'),'username':_0x35a14f,'accessKey':md5(_0x58204c['result'][_0x53a5('0x65')]+_0x3b83c2)},'json':!![]};return rp(_0x273a49);}})['then'](function(_0x56b734){if(_0x56b734[_0x53a5('0x63')]){var _0x1c6e0b={'method':_0x53a5('0x66'),'uri':_0x1fce0a,'qs':{'operation':_0x53a5('0x67'),'username':_0x35a14f,'sessionName':_0x56b734[_0x53a5('0x68')][_0x53a5('0x69')],'elementType':_0x45454f},'json':!![]};return rp(_0x1c6e0b);}})['then'](function(_0x4a266e){if(_0x4a266e[_0x53a5('0x63')]){var _0xef11dd=[_0x53a5('0x6a'),_0x53a5('0x6b'),_0x53a5('0x6c')];_[_0x53a5('0x6d')](_0x4a266e[_0x53a5('0x68')][_0x53a5('0x37')],function(_0x2bb59c){return _0xef11dd[_0x53a5('0x6e')](_0x2bb59c[_0x53a5('0x41')]['name']);});_[_0x53a5('0x6d')](_0x4a266e[_0x53a5('0x68')][_0x53a5('0x37')],function(_0x4a5607){return _0x4a5607[_0x53a5('0x6f')]===_0x53a5('0x70');});return{'count':_0x4a266e[_0x53a5('0x68')]['fields'][_0x53a5('0x38')],'rows':_[_0x53a5('0x2e')](_0x4a266e[_0x53a5('0x68')]['fields'],function(_0x82a202){return{'id':_0x82a202[_0x53a5('0x2b')],'name':_0x82a202['label'],'custom':_['startsWith'](_0x82a202[_0x53a5('0x2b')],'cf_')?!![]:![],'options':_0x82a202[_0x53a5('0x41')][_0x53a5('0x2b')]===_0x53a5('0x71')&&_0x82a202[_0x53a5('0x41')][_0x53a5('0x72')][_0x53a5('0x38')]>0x0?_[_0x53a5('0x2e')](_0x82a202[_0x53a5('0x41')][_0x53a5('0x72')],function(_0x334c11){return{'name':_0x334c11[_0x53a5('0x73')],'value':_0x334c11['value']};}):[]};})};}})[_0x53a5('0x26')](respondWithResult(_0x50f099,null))[_0x53a5('0x47')](function(_0x31bbd4){console[_0x53a5('0x74')](_0x53a5('0x75')+_0x31bbd4);var _0x30aab=_0x3ab8b9[_0x53a5('0x33')][_0x53a5('0x76')]?0x1f4:_0x31bbd4[_0x53a5('0x77')]||0x1f4;logger[_0x53a5('0x29')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x30aab,JSON[_0x53a5('0x78')](_0x31bbd4));delete _0x31bbd4[_0x53a5('0x2b')];if(_0x30aab===0x191){_0x30aab=0x190;}_0x50f099[_0x53a5('0x1a')](_0x30aab)[_0x53a5('0x2c')](_0x3ab8b9[_0x53a5('0x33')][_0x53a5('0x76')]?{'message':_0x53a5('0x79'),'statusCode':_0x31bbd4['statusCode']}:_0x31bbd4);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 3bb761f..0e8bff2 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 _0x2272=['request-promise','path','rimraf','../../components/integrations/configuration','exports','define','VtigerAccount','int_vtiger_accounts','lodash','util','../../config/logger','api','moment'];(function(_0xadafdf,_0x506951){var _0x5d46f6=function(_0x111c23){while(--_0x111c23){_0xadafdf['push'](_0xadafdf['shift']());}};_0x5d46f6(++_0x506951);}(_0x2272,0xd8));var _0x2227=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x2272[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x2227('0x0'));var util=require(_0x2227('0x1'));var logger=require(_0x2227('0x2'))(_0x2227('0x3'));var moment=require(_0x2227('0x4'));var BPromise=require('bluebird');var rp=require(_0x2227('0x5'));var fs=require('fs');var path=require(_0x2227('0x6'));var rimraf=require(_0x2227('0x7'));var config=require('../../config/environment');var attributes=require('./intVtigerAccount.attributes');var integrations=require(_0x2227('0x8'));module[_0x2227('0x9')]=function(_0xb33647,_0x2591db){return _0xb33647[_0x2227('0xa')](_0x2227('0xb'),attributes,{'tableName':_0x2227('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x98e3=['exports','define','VtigerAccount','int_vtiger_accounts','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x98e3,0xc8));var _0x398e=function(_0x26b0e9,_0x24aed4){_0x26b0e9=_0x26b0e9-0x0;var _0x17294c=_0x98e3[_0x26b0e9];return _0x17294c;};'use strict';var _=require(_0x398e('0x0'));var util=require(_0x398e('0x1'));var logger=require(_0x398e('0x2'))(_0x398e('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x398e('0x4'));var fs=require('fs');var path=require(_0x398e('0x5'));var rimraf=require(_0x398e('0x6'));var config=require(_0x398e('0x7'));var attributes=require(_0x398e('0x8'));var integrations=require(_0x398e('0x9'));module[_0x398e('0xa')]=function(_0x41995c,_0x4a9651){return _0x41995c[_0x398e('0xb')](_0x398e('0xc'),attributes,{'tableName':_0x398e('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 ce310e5..b167086 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 _0x087b=['find','where','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','VtigerAccount,\x20%s,\x20%s','message','result','findAll','options','raw','attributes','limit','map','include','model','GetVtigerAccount','catch','ShowVtigerAccount'];(function(_0x5c619e,_0xd5d312){var _0x4e4572=function(_0x467172){while(--_0x467172){_0x5c619e['push'](_0x5c619e['shift']());}};_0x4e4572(++_0xd5d312);}(_0x087b,0x11a));var _0xb087=function(_0x19b3f9,_0xade753){_0x19b3f9=_0x19b3f9-0x0;var _0x18c3f6=_0x087b[_0x19b3f9];return _0x18c3f6;};'use strict';var _=require(_0xb087('0x0'));var util=require(_0xb087('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb087('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb087('0x3'))['db'];var utils=require(_0xb087('0x4'));var logger=require(_0xb087('0x5'))(_0xb087('0x6'));var config=require(_0xb087('0x7'));var jayson=require(_0xb087('0x8'));var client=jayson[_0xb087('0x9')][_0xb087('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xecf080,_0x36ac30,_0x3cebbf){return new BPromise(function(_0x6d83fb,_0x1dbe9f){return client[_0xb087('0xb')](_0xecf080,_0x3cebbf)[_0xb087('0xc')](function(_0x23cdd7){logger[_0xb087('0xd')]('VtigerAccount,\x20%s,\x20%s',_0x36ac30,_0xb087('0xe'));logger[_0xb087('0xf')](_0xb087('0x10'),_0x36ac30,_0xb087('0xe'),JSON[_0xb087('0x11')](_0x23cdd7));if(_0x23cdd7[_0xb087('0x12')]){if(_0x23cdd7[_0xb087('0x12')]['code']===0x1f4){logger[_0xb087('0x12')](_0xb087('0x13'),_0x36ac30,_0x23cdd7[_0xb087('0x12')]['message']);return _0x1dbe9f(_0x23cdd7[_0xb087('0x12')][_0xb087('0x14')]);}logger[_0xb087('0x12')](_0xb087('0x13'),_0x36ac30,_0x23cdd7[_0xb087('0x12')][_0xb087('0x14')]);return _0x6d83fb(_0x23cdd7[_0xb087('0x12')][_0xb087('0x14')]);}else{logger[_0xb087('0xd')](_0xb087('0x13'),_0x36ac30,'request\x20sent');_0x6d83fb(_0x23cdd7[_0xb087('0x15')][_0xb087('0x14')]);}})['catch'](function(_0xcc4426){logger[_0xb087('0x12')](_0xb087('0x13'),_0x36ac30,_0xcc4426);_0x1dbe9f(_0xcc4426);});});}exports['GetVtigerAccount']=function(_0x330005){var _0x3c680f=this;return new Promise(function(_0x17200d,_0x45d074){return db['VtigerAccount'][_0xb087('0x16')]({'raw':_0x330005[_0xb087('0x17')]?_0x330005[_0xb087('0x17')][_0xb087('0x18')]===undefined?!![]:![]:!![],'where':_0x330005['options']?_0x330005['options']['where']||null:null,'attributes':_0x330005['options']?_0x330005[_0xb087('0x17')][_0xb087('0x19')]||null:null,'limit':_0x330005[_0xb087('0x17')]?_0x330005[_0xb087('0x17')][_0xb087('0x1a')]||null:null,'include':_0x330005[_0xb087('0x17')]?_0x330005[_0xb087('0x17')]['include']?_[_0xb087('0x1b')](_0x330005[_0xb087('0x17')][_0xb087('0x1c')],function(_0x1cfb3e){return{'model':db[_0x1cfb3e[_0xb087('0x1d')]],'as':_0x1cfb3e['as'],'attributes':_0x1cfb3e['attributes'],'include':_0x1cfb3e[_0xb087('0x1c')]?_[_0xb087('0x1b')](_0x1cfb3e['include'],function(_0x5a2dc6){return{'model':db[_0x5a2dc6['model']],'as':_0x5a2dc6['as'],'attributes':_0x5a2dc6['attributes'],'include':_0x5a2dc6['include']?_[_0xb087('0x1b')](_0x5a2dc6[_0xb087('0x1c')],function(_0x1d124f){return{'model':db[_0x1d124f[_0xb087('0x1d')]],'as':_0x1d124f['as'],'attributes':_0x1d124f[_0xb087('0x19')]};}):[]};}):[]};}):[]:[]})[_0xb087('0xc')](function(_0xf3f41f){logger[_0xb087('0xd')](_0xb087('0x1e'),_0x330005);logger[_0xb087('0xf')](_0xb087('0x1e'),_0x330005,JSON[_0xb087('0x11')](_0xf3f41f));_0x17200d(_0xf3f41f);})[_0xb087('0x1f')](function(_0x263259){logger['error'](_0xb087('0x1e'),_0x263259[_0xb087('0x14')],_0x330005);_0x45d074(_0x3c680f[_0xb087('0x12')](0x1f4,_0x263259[_0xb087('0x14')]));});});};exports[_0xb087('0x20')]=function(_0xa6d90c){var _0x2e1c57=this;return new Promise(function(_0x13fb2f,_0x53a535){return db['VtigerAccount'][_0xb087('0x21')]({'raw':_0xa6d90c[_0xb087('0x17')]?_0xa6d90c['options'][_0xb087('0x18')]===undefined?!![]:![]:!![],'where':_0xa6d90c[_0xb087('0x17')]?_0xa6d90c[_0xb087('0x17')][_0xb087('0x22')]||null:null,'attributes':_0xa6d90c[_0xb087('0x17')]?_0xa6d90c[_0xb087('0x17')][_0xb087('0x19')]||null:null,'include':_0xa6d90c[_0xb087('0x17')]?_0xa6d90c[_0xb087('0x17')][_0xb087('0x1c')]?_[_0xb087('0x1b')](_0xa6d90c[_0xb087('0x17')]['include'],function(_0x3bec03){return{'model':db[_0x3bec03['model']],'as':_0x3bec03['as'],'attributes':_0x3bec03[_0xb087('0x19')],'include':_0x3bec03[_0xb087('0x1c')]?_[_0xb087('0x1b')](_0x3bec03[_0xb087('0x1c')],function(_0x13cb5d){return{'model':db[_0x13cb5d[_0xb087('0x1d')]],'as':_0x13cb5d['as'],'attributes':_0x13cb5d[_0xb087('0x19')],'include':_0x13cb5d[_0xb087('0x1c')]?_[_0xb087('0x1b')](_0x13cb5d['include'],function(_0x5814c2){return{'model':db[_0x5814c2[_0xb087('0x1d')]],'as':_0x5814c2['as'],'attributes':_0x5814c2[_0xb087('0x19')]};}):[]};}):[]};}):[]:[]})[_0xb087('0xc')](function(_0x2d2902){logger[_0xb087('0xd')]('ShowVtigerAccount',_0xa6d90c);logger[_0xb087('0xf')](_0xb087('0x20'),_0xa6d90c,JSON['stringify'](_0x2d2902));_0x13fb2f(_0x2d2902);})['catch'](function(_0x1726c2){logger[_0xb087('0x12')](_0xb087('0x20'),_0x1726c2['message'],_0xa6d90c);_0x53a535(_0x2e1c57[_0xb087('0x12')](0x1f4,_0x1726c2[_0xb087('0x14')]));});});}; \ No newline at end of file +var _0x1c7c=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VtigerAccount,\x20%s,\x20%s','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','GetVtigerAccount','VtigerAccount','findAll','options','where','limit','include','map','model','attributes','ShowVtigerAccount','raw','lodash','util','moment','bluebird'];(function(_0x552fc5,_0x54972e){var _0x3ae584=function(_0x4fa784){while(--_0x4fa784){_0x552fc5['push'](_0x552fc5['shift']());}};_0x3ae584(++_0x54972e);}(_0x1c7c,0x164));var _0xc1c7=function(_0x6c546c,_0x2725e3){_0x6c546c=_0x6c546c-0x0;var _0x155a8b=_0x1c7c[_0x6c546c];return _0x155a8b;};'use strict';var _=require(_0xc1c7('0x0'));var util=require(_0xc1c7('0x1'));var moment=require(_0xc1c7('0x2'));var BPromise=require(_0xc1c7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc1c7('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc1c7('0x5'));var logger=require(_0xc1c7('0x6'))(_0xc1c7('0x7'));var config=require(_0xc1c7('0x8'));var jayson=require(_0xc1c7('0x9'));var client=jayson[_0xc1c7('0xa')][_0xc1c7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x419138,_0xce5bcd,_0x3b3e9c){return new BPromise(function(_0x434a35,_0x11c7ef){return client[_0xc1c7('0xc')](_0x419138,_0x3b3e9c)[_0xc1c7('0xd')](function(_0x339649){logger[_0xc1c7('0xe')](_0xc1c7('0xf'),_0xce5bcd,'request\x20sent');logger[_0xc1c7('0x10')](_0xc1c7('0x11'),_0xce5bcd,'request\x20sent',JSON[_0xc1c7('0x12')](_0x339649));if(_0x339649[_0xc1c7('0x13')]){if(_0x339649[_0xc1c7('0x13')]['code']===0x1f4){logger[_0xc1c7('0x13')](_0xc1c7('0xf'),_0xce5bcd,_0x339649[_0xc1c7('0x13')][_0xc1c7('0x14')]);return _0x11c7ef(_0x339649[_0xc1c7('0x13')][_0xc1c7('0x14')]);}logger[_0xc1c7('0x13')](_0xc1c7('0xf'),_0xce5bcd,_0x339649[_0xc1c7('0x13')][_0xc1c7('0x14')]);return _0x434a35(_0x339649[_0xc1c7('0x13')][_0xc1c7('0x14')]);}else{logger['info'](_0xc1c7('0xf'),_0xce5bcd,_0xc1c7('0x15'));_0x434a35(_0x339649[_0xc1c7('0x16')]['message']);}})[_0xc1c7('0x17')](function(_0x3939c1){logger[_0xc1c7('0x13')](_0xc1c7('0xf'),_0xce5bcd,_0x3939c1);_0x11c7ef(_0x3939c1);});});}exports[_0xc1c7('0x18')]=function(_0xb42702){var _0x21758a=this;return new Promise(function(_0x2e93e5,_0x5d44e9){return db[_0xc1c7('0x19')][_0xc1c7('0x1a')]({'raw':_0xb42702[_0xc1c7('0x1b')]?_0xb42702[_0xc1c7('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0xb42702[_0xc1c7('0x1b')]?_0xb42702['options'][_0xc1c7('0x1c')]||null:null,'attributes':_0xb42702[_0xc1c7('0x1b')]?_0xb42702['options']['attributes']||null:null,'limit':_0xb42702[_0xc1c7('0x1b')]?_0xb42702[_0xc1c7('0x1b')][_0xc1c7('0x1d')]||null:null,'include':_0xb42702['options']?_0xb42702[_0xc1c7('0x1b')][_0xc1c7('0x1e')]?_[_0xc1c7('0x1f')](_0xb42702[_0xc1c7('0x1b')][_0xc1c7('0x1e')],function(_0x3a2483){return{'model':db[_0x3a2483[_0xc1c7('0x20')]],'as':_0x3a2483['as'],'attributes':_0x3a2483[_0xc1c7('0x21')],'include':_0x3a2483[_0xc1c7('0x1e')]?_[_0xc1c7('0x1f')](_0x3a2483[_0xc1c7('0x1e')],function(_0x363fbc){return{'model':db[_0x363fbc[_0xc1c7('0x20')]],'as':_0x363fbc['as'],'attributes':_0x363fbc[_0xc1c7('0x21')],'include':_0x363fbc[_0xc1c7('0x1e')]?_[_0xc1c7('0x1f')](_0x363fbc['include'],function(_0xf0ab9c){return{'model':db[_0xf0ab9c[_0xc1c7('0x20')]],'as':_0xf0ab9c['as'],'attributes':_0xf0ab9c['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x352f24){logger['info']('GetVtigerAccount',_0xb42702);logger[_0xc1c7('0x10')](_0xc1c7('0x18'),_0xb42702,JSON[_0xc1c7('0x12')](_0x352f24));_0x2e93e5(_0x352f24);})[_0xc1c7('0x17')](function(_0x461360){logger['error']('GetVtigerAccount',_0x461360[_0xc1c7('0x14')],_0xb42702);_0x5d44e9(_0x21758a[_0xc1c7('0x13')](0x1f4,_0x461360[_0xc1c7('0x14')]));});});};exports[_0xc1c7('0x22')]=function(_0x2e35f1){var _0x4968b0=this;return new Promise(function(_0x50042f,_0x125920){return db[_0xc1c7('0x19')]['find']({'raw':_0x2e35f1[_0xc1c7('0x1b')]?_0x2e35f1[_0xc1c7('0x1b')][_0xc1c7('0x23')]===undefined?!![]:![]:!![],'where':_0x2e35f1[_0xc1c7('0x1b')]?_0x2e35f1[_0xc1c7('0x1b')][_0xc1c7('0x1c')]||null:null,'attributes':_0x2e35f1[_0xc1c7('0x1b')]?_0x2e35f1['options'][_0xc1c7('0x21')]||null:null,'include':_0x2e35f1[_0xc1c7('0x1b')]?_0x2e35f1[_0xc1c7('0x1b')][_0xc1c7('0x1e')]?_[_0xc1c7('0x1f')](_0x2e35f1[_0xc1c7('0x1b')][_0xc1c7('0x1e')],function(_0xef703f){return{'model':db[_0xef703f[_0xc1c7('0x20')]],'as':_0xef703f['as'],'attributes':_0xef703f['attributes'],'include':_0xef703f['include']?_[_0xc1c7('0x1f')](_0xef703f[_0xc1c7('0x1e')],function(_0x263900){return{'model':db[_0x263900[_0xc1c7('0x20')]],'as':_0x263900['as'],'attributes':_0x263900[_0xc1c7('0x21')],'include':_0x263900[_0xc1c7('0x1e')]?_[_0xc1c7('0x1f')](_0x263900[_0xc1c7('0x1e')],function(_0x3bd3b0){return{'model':db[_0x3bd3b0[_0xc1c7('0x20')]],'as':_0x3bd3b0['as'],'attributes':_0x3bd3b0[_0xc1c7('0x21')]};}):[]};}):[]};}):[]:[]})[_0xc1c7('0xd')](function(_0x154476){logger[_0xc1c7('0xe')](_0xc1c7('0x22'),_0x2e35f1);logger[_0xc1c7('0x10')](_0xc1c7('0x22'),_0x2e35f1,JSON[_0xc1c7('0x12')](_0x154476));_0x50042f(_0x154476);})[_0xc1c7('0x17')](function(_0x239a91){logger[_0xc1c7('0x13')]('ShowVtigerAccount',_0x239a91['message'],_0x2e35f1);_0x125920(_0x4968b0['error'](0x1f4,_0x239a91[_0xc1c7('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 3bc3f98..31e8190 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 _0xd320=['isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','destroy','util','path','Router','fs-extra','../../components/auth/service','get'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd320,0x12e));var _0x0d32=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xd320[_0x45e98e];return _0x374dba;};'use strict';var multer=require('multer');var util=require(_0x0d32('0x0'));var path=require(_0x0d32('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d32('0x2')]();var fs_extra=require(_0x0d32('0x3'));var auth=require(_0x0d32('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intVtigerConfiguration.controller');router[_0x0d32('0x5')]('/',auth[_0x0d32('0x6')](),controller[_0x0d32('0x7')]);router['get'](_0x0d32('0x8'),auth['isAuthenticated'](),controller[_0x0d32('0x9')]);router[_0x0d32('0x5')](_0x0d32('0xa'),auth[_0x0d32('0x6')](),controller[_0x0d32('0xb')]);router[_0x0d32('0x5')](_0x0d32('0xc'),auth[_0x0d32('0x6')](),controller[_0x0d32('0xd')]);router[_0x0d32('0x5')](_0x0d32('0xe'),auth[_0x0d32('0x6')](),controller[_0x0d32('0xf')]);router[_0x0d32('0x10')]('/',auth[_0x0d32('0x6')](),controller[_0x0d32('0x11')]);router[_0x0d32('0x12')](_0x0d32('0x8'),auth[_0x0d32('0x6')](),controller[_0x0d32('0x13')]);router[_0x0d32('0x14')](_0x0d32('0x8'),auth[_0x0d32('0x6')](),controller[_0x0d32('0x15')]);module['exports']=router; \ No newline at end of file +var _0x85f3=['index','show','get','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','put','/:id','update','destroy','exports','util','path','fs-extra','../../components/auth/service','../../config/environment','./intVtigerConfiguration.controller','isAuthenticated'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0x85f3,0xcb));var _0x385f=function(_0x487b0c,_0x14ff74){_0x487b0c=_0x487b0c-0x0;var _0x1adbdc=_0x85f3[_0x487b0c];return _0x1adbdc;};'use strict';var multer=require('multer');var util=require(_0x385f('0x0'));var path=require(_0x385f('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x385f('0x2'));var auth=require(_0x385f('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x385f('0x4'));var controller=require(_0x385f('0x5'));router['get']('/',auth[_0x385f('0x6')](),controller[_0x385f('0x7')]);router['get']('/:id',auth[_0x385f('0x6')](),controller[_0x385f('0x8')]);router[_0x385f('0x9')]('/:id/fields',auth['isAuthenticated'](),controller[_0x385f('0xa')]);router[_0x385f('0x9')](_0x385f('0xb'),auth['isAuthenticated'](),controller[_0x385f('0xc')]);router[_0x385f('0x9')](_0x385f('0xd'),auth[_0x385f('0x6')](),controller[_0x385f('0xe')]);router[_0x385f('0xf')]('/',auth[_0x385f('0x6')](),controller['create']);router[_0x385f('0x10')](_0x385f('0x11'),auth[_0x385f('0x6')](),controller[_0x385f('0x12')]);router['delete'](_0x385f('0x11'),auth['isAuthenticated'](),controller[_0x385f('0x13')]);module[_0x385f('0x14')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index d5ad833..829e7ff 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 _0x4bf4=['sequelize','exports','STRING'];(function(_0x502344,_0x132dbb){var _0x14311e=function(_0x3cbf45){while(--_0x3cbf45){_0x502344['push'](_0x502344['shift']());}};_0x14311e(++_0x132dbb);}(_0x4bf4,0x123));var _0x44bf=function(_0x162530,_0x3ad958){_0x162530=_0x162530-0x0;var _0x110514=_0x4bf4[_0x162530];return _0x110514;};'use strict';var Sequelize=require(_0x44bf('0x0'));module[_0x44bf('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x44bf('0x2')]}}; \ No newline at end of file +var _0x436d=['STRING','exports'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0x436d,0x1cb));var _0xd436=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x436d[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require('sequelize');module[_0xd436('0x0')]={'name':{'type':Sequelize[_0xd436('0x1')]},'description':{'type':Sequelize[_0xd436('0x1')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index f08c030..fb621d7 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 _0x4dbf=['desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','sendStatus','status','json','undefined','limit','count','offset','Content-Range','apply','reject','update','destroy','then','end','error','stack','VtigerConfiguration','rawAttributes','fieldName','type','key','model','map','name','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','pick','where','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','merge','options','create','body','find','params','getFields','VtigerField','order','getSubjects','findOne','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0x4dbf,0xe8));var _0xf4db=function(_0x285800,_0x26765e){_0x285800=_0x285800-0x0;var _0x4b809e=_0x4dbf[_0x285800];return _0x4b809e;};'use strict';var emlformat=require(_0xf4db('0x0'));var rimraf=require(_0xf4db('0x1'));var zipdir=require(_0xf4db('0x2'));var jsonpatch=require(_0xf4db('0x3'));var rp=require(_0xf4db('0x4'));var moment=require(_0xf4db('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xf4db('0x6'));var util=require(_0xf4db('0x7'));var path=require(_0xf4db('0x8'));var sox=require(_0xf4db('0x9'));var csv=require(_0xf4db('0xa'));var ejs=require(_0xf4db('0xb'));var fs=require('fs');var fs_extra=require(_0xf4db('0xc'));var _=require(_0xf4db('0xd'));var squel=require(_0xf4db('0xe'));var crypto=require(_0xf4db('0xf'));var jsforce=require(_0xf4db('0x10'));var deskjs=require(_0xf4db('0x11'));var toCsv=require(_0xf4db('0xa'));var querystring=require(_0xf4db('0x12'));var Papa=require(_0xf4db('0x13'));var Redis=require('ioredis');var authService=require(_0xf4db('0x14'));var qs=require(_0xf4db('0x15'));var as=require(_0xf4db('0x16'));var hardwareService=require(_0xf4db('0x17'));var logger=require(_0xf4db('0x18'))('api');var utils=require(_0xf4db('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xf4db('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x386810,_0x425c89){_0x425c89=_0x425c89||0xcc;return function(_0x2a86c6){if(_0x2a86c6){return _0x386810[_0xf4db('0x1b')](_0x425c89);}return _0x386810[_0xf4db('0x1c')](_0x425c89)['end']();};}function respondWithResult(_0x288d00,_0x4c82ad){_0x4c82ad=_0x4c82ad||0xc8;return function(_0x5e7ae7){if(_0x5e7ae7){return _0x288d00['status'](_0x4c82ad)[_0xf4db('0x1d')](_0x5e7ae7);}};}function respondWithFilteredResult(_0x19c269,_0x196e98){return function(_0x5ba281){if(_0x5ba281){var _0x47feba=typeof _0x196e98['offset']===_0xf4db('0x1e')&&typeof _0x196e98[_0xf4db('0x1f')]===_0xf4db('0x1e');var _0x303528=_0x5ba281[_0xf4db('0x20')];var _0x484846=_0x47feba?0x0:_0x196e98['offset'];var _0x27bdac=_0x47feba?_0x5ba281[_0xf4db('0x20')]:_0x196e98[_0xf4db('0x21')]+_0x196e98[_0xf4db('0x1f')];var _0x2477f6;if(_0x27bdac>=_0x303528){_0x27bdac=_0x303528;_0x2477f6=0xc8;}else{_0x2477f6=0xce;}_0x19c269[_0xf4db('0x1c')](_0x2477f6);return _0x19c269['set'](_0xf4db('0x22'),_0x484846+'-'+_0x27bdac+'/'+_0x303528)['json'](_0x5ba281);}return null;};}function patchUpdates(_0x37ad2d){return function(_0x48c656){try{jsonpatch[_0xf4db('0x23')](_0x48c656,_0x37ad2d,!![]);}catch(_0x1f4615){return BPromise[_0xf4db('0x24')](_0x1f4615);}return _0x48c656['save']();};}function saveUpdates(_0xa2b4d2,_0x146511){return function(_0x272c21){if(_0x272c21){return _0x272c21[_0xf4db('0x25')](_0xa2b4d2)['then'](function(_0x2bd2fb){return _0x2bd2fb;});}return null;};}function removeEntity(_0x5466a8,_0x10f07a){return function(_0x28e346){if(_0x28e346){return _0x28e346[_0xf4db('0x26')]()[_0xf4db('0x27')](function(){_0x5466a8[_0xf4db('0x1c')](0xcc)[_0xf4db('0x28')]();});}};}function handleEntityNotFound(_0x518b67,_0x131681){return function(_0x2c44fe){if(!_0x2c44fe){_0x518b67[_0xf4db('0x1b')](0x194);}return _0x2c44fe;};}function handleError(_0x4cd909,_0x227280){_0x227280=_0x227280||0x1f4;return function(_0xbc9ffa){logger[_0xf4db('0x29')](_0xbc9ffa[_0xf4db('0x2a')]);if(_0xbc9ffa['name']){delete _0xbc9ffa['name'];}_0x4cd909[_0xf4db('0x1c')](_0x227280)['send'](_0xbc9ffa);};}exports['index']=function(_0x4f45f4,_0x206088){var _0x561b0b={},_0x4bbe7b={},_0x498503={'count':0x0,'rows':[]};var _0x70d2c3=_['map'](db[_0xf4db('0x2b')][_0xf4db('0x2c')],function(_0x15ffda){return{'name':_0x15ffda[_0xf4db('0x2d')],'type':_0x15ffda[_0xf4db('0x2e')][_0xf4db('0x2f')]};});_0x4bbe7b[_0xf4db('0x30')]=_[_0xf4db('0x31')](_0x70d2c3,_0xf4db('0x32'));_0x4bbe7b[_0xf4db('0x33')]=_[_0xf4db('0x34')](_0x4f45f4[_0xf4db('0x33')]);_0x4bbe7b['filters']=_[_0xf4db('0x35')](_0x4bbe7b[_0xf4db('0x30')],_0x4bbe7b[_0xf4db('0x33')]);_0x561b0b[_0xf4db('0x36')]=_['intersection'](_0x4bbe7b[_0xf4db('0x30')],qs[_0xf4db('0x37')](_0x4f45f4[_0xf4db('0x33')]['fields']));_0x561b0b[_0xf4db('0x36')]=_0x561b0b[_0xf4db('0x36')][_0xf4db('0x38')]?_0x561b0b[_0xf4db('0x36')]:_0x4bbe7b[_0xf4db('0x30')];if(!_0x4f45f4[_0xf4db('0x33')][_0xf4db('0x39')](_0xf4db('0x3a'))){_0x561b0b[_0xf4db('0x1f')]=qs[_0xf4db('0x1f')](_0x4f45f4['query']['limit']);_0x561b0b['offset']=qs[_0xf4db('0x21')](_0x4f45f4[_0xf4db('0x33')][_0xf4db('0x21')]);}_0x561b0b['order']=qs[_0xf4db('0x3b')](_0x4f45f4[_0xf4db('0x33')][_0xf4db('0x3b')]);_0x561b0b['where']=qs[_0xf4db('0x3c')](_[_0xf4db('0x3d')](_0x4f45f4[_0xf4db('0x33')],_0x4bbe7b[_0xf4db('0x3c')]),_0x70d2c3);if(_0x4f45f4['query']['filter']){_0x561b0b['where']=_['merge'](_0x561b0b[_0xf4db('0x3e')],{'$or':_[_0xf4db('0x31')](_0x70d2c3,function(_0x2621a7){if(_0x2621a7['type']!==_0xf4db('0x3f')){var _0x3e4763={};_0x3e4763[_0x2621a7[_0xf4db('0x32')]]={'$like':'%'+_0x4f45f4['query'][_0xf4db('0x40')]+'%'};return _0x3e4763;}})});}_0x561b0b=_['merge']({},_0x561b0b,_0x4f45f4['options']);var _0x2552d3={'where':_0x561b0b[_0xf4db('0x3e')]};return db[_0xf4db('0x2b')][_0xf4db('0x20')](_0x2552d3)['then'](function(_0xc9a1c){_0x498503['count']=_0xc9a1c;if(_0x4f45f4[_0xf4db('0x33')][_0xf4db('0x41')]){_0x561b0b[_0xf4db('0x42')]=[{'all':!![]}];}return db['VtigerConfiguration'][_0xf4db('0x43')](_0x561b0b);})[_0xf4db('0x27')](function(_0xaa2c51){_0x498503[_0xf4db('0x44')]=_0xaa2c51;return _0x498503;})['then'](respondWithFilteredResult(_0x206088,_0x561b0b))[_0xf4db('0x45')](handleError(_0x206088,null));};exports[_0xf4db('0x46')]=function(_0xf1c2f8,_0x111252){var _0x50ba52={'raw':![],'where':{'id':_0xf1c2f8['params']['id']}},_0x385e79={};_0x385e79[_0xf4db('0x30')]=_[_0xf4db('0x34')](db[_0xf4db('0x2b')]['rawAttributes']);_0x385e79[_0xf4db('0x33')]=_[_0xf4db('0x34')](_0xf1c2f8['query']);_0x385e79[_0xf4db('0x3c')]=_[_0xf4db('0x35')](_0x385e79[_0xf4db('0x30')],_0x385e79['query']);_0x50ba52[_0xf4db('0x36')]=_[_0xf4db('0x35')](_0x385e79['model'],qs['fields'](_0xf1c2f8[_0xf4db('0x33')][_0xf4db('0x37')]));_0x50ba52[_0xf4db('0x36')]=_0x50ba52[_0xf4db('0x36')]['length']?_0x50ba52[_0xf4db('0x36')]:_0x385e79[_0xf4db('0x30')];if(_0xf1c2f8[_0xf4db('0x33')][_0xf4db('0x41')]){_0x50ba52[_0xf4db('0x42')]=[{'all':!![]}];}_0x50ba52=_[_0xf4db('0x47')]({},_0x50ba52,_0xf1c2f8[_0xf4db('0x48')]);return db[_0xf4db('0x2b')]['find'](_0x50ba52)['then'](handleEntityNotFound(_0x111252,null))[_0xf4db('0x27')](respondWithResult(_0x111252,null))[_0xf4db('0x45')](handleError(_0x111252,null));};exports[_0xf4db('0x49')]=function(_0xbf6070,_0x35102f){return db[_0xf4db('0x2b')][_0xf4db('0x49')](_0xbf6070[_0xf4db('0x4a')],{})[_0xf4db('0x27')](respondWithResult(_0x35102f,0xc9))[_0xf4db('0x45')](handleError(_0x35102f,null));};exports['update']=function(_0x5849bf,_0x1a2887){if(_0x5849bf['body']['id']){delete _0x5849bf[_0xf4db('0x4a')]['id'];}return db[_0xf4db('0x2b')]['find']({'where':{'id':_0x5849bf['params']['id']}})[_0xf4db('0x27')](handleEntityNotFound(_0x1a2887,null))['then'](saveUpdates(_0x5849bf[_0xf4db('0x4a')],null))[_0xf4db('0x27')](respondWithResult(_0x1a2887,null))[_0xf4db('0x45')](handleError(_0x1a2887,null));};exports[_0xf4db('0x26')]=function(_0x1bbe7f,_0x4b2432){return db[_0xf4db('0x2b')][_0xf4db('0x4b')]({'where':{'id':_0x1bbe7f[_0xf4db('0x4c')]['id']}})[_0xf4db('0x27')](handleEntityNotFound(_0x4b2432,null))[_0xf4db('0x27')](removeEntity(_0x4b2432,null))['catch'](handleError(_0x4b2432,null));};exports[_0xf4db('0x4d')]=function(_0x29348b,_0x3721a0,_0x2eac34){var _0x520d25={};var _0x550304={};var _0x3c16ba;var _0x3c914b;return db[_0xf4db('0x2b')]['findOne']({'where':{'id':_0x29348b[_0xf4db('0x4c')]['id']}})[_0xf4db('0x27')](handleEntityNotFound(_0x3721a0,null))[_0xf4db('0x27')](function(_0x39f72f){if(_0x39f72f){_0x3c16ba=_0x39f72f;_0x550304[_0xf4db('0x30')]=_['keys'](db[_0xf4db('0x4e')][_0xf4db('0x2c')]);_0x550304[_0xf4db('0x33')]=_['keys'](_0x29348b[_0xf4db('0x33')]);_0x550304[_0xf4db('0x3c')]=_['intersection'](_0x550304['model'],_0x550304[_0xf4db('0x33')]);_0x520d25[_0xf4db('0x36')]=_[_0xf4db('0x35')](_0x550304['model'],qs[_0xf4db('0x37')](_0x29348b[_0xf4db('0x33')][_0xf4db('0x37')]));_0x520d25[_0xf4db('0x36')]=_0x520d25[_0xf4db('0x36')][_0xf4db('0x38')]?_0x520d25[_0xf4db('0x36')]:_0x550304['model'];_0x520d25[_0xf4db('0x4f')]=qs['sort'](_0x29348b['query']['sort']);_0x520d25['where']=qs[_0xf4db('0x3c')](_[_0xf4db('0x3d')](_0x29348b[_0xf4db('0x33')],_0x550304[_0xf4db('0x3c')]));if(_0x29348b['query']['filter']){_0x520d25['where']=_['merge'](_0x520d25[_0xf4db('0x3e')],{'$or':_[_0xf4db('0x31')](_0x520d25[_0xf4db('0x36')],function(_0x4447eb){var _0x25a2c9={};_0x25a2c9[_0x4447eb]={'$like':'%'+_0x29348b['query'][_0xf4db('0x40')]+'%'};return _0x25a2c9;})});}_0x520d25=_[_0xf4db('0x47')]({},_0x520d25,_0x29348b[_0xf4db('0x48')]);return _0x3c16ba[_0xf4db('0x4d')](_0x520d25);}})['then'](function(_0x3aad7f){if(_0x3aad7f){_0x3c914b=_0x3aad7f[_0xf4db('0x38')];if(!_0x29348b[_0xf4db('0x33')][_0xf4db('0x39')]('nolimit')){_0x520d25[_0xf4db('0x1f')]=qs['limit'](_0x29348b['query']['limit']);_0x520d25[_0xf4db('0x21')]=qs[_0xf4db('0x21')](_0x29348b[_0xf4db('0x33')][_0xf4db('0x21')]);}return _0x3c16ba[_0xf4db('0x4d')](_0x520d25);}})[_0xf4db('0x27')](function(_0x27193a){if(_0x27193a){return _0x27193a?{'count':_0x3c914b,'rows':_0x27193a}:null;}})[_0xf4db('0x27')](respondWithResult(_0x3721a0,null))[_0xf4db('0x45')](handleError(_0x3721a0,null));};exports[_0xf4db('0x50')]=function(_0x67cee5,_0x2c7f3a,_0x5c0aab){var _0x1846e1={};var _0x174f4b={};var _0x355f09;var _0x5b98e8;return db[_0xf4db('0x2b')][_0xf4db('0x51')]({'where':{'id':_0x67cee5[_0xf4db('0x4c')]['id']}})[_0xf4db('0x27')](handleEntityNotFound(_0x2c7f3a,null))[_0xf4db('0x27')](function(_0x2fc236){if(_0x2fc236){_0x355f09=_0x2fc236;_0x174f4b[_0xf4db('0x30')]=_[_0xf4db('0x34')](db[_0xf4db('0x4e')][_0xf4db('0x2c')]);_0x174f4b['query']=_[_0xf4db('0x34')](_0x67cee5[_0xf4db('0x33')]);_0x174f4b[_0xf4db('0x3c')]=_['intersection'](_0x174f4b[_0xf4db('0x30')],_0x174f4b[_0xf4db('0x33')]);_0x1846e1[_0xf4db('0x36')]=_[_0xf4db('0x35')](_0x174f4b['model'],qs[_0xf4db('0x37')](_0x67cee5[_0xf4db('0x33')][_0xf4db('0x37')]));_0x1846e1[_0xf4db('0x36')]=_0x1846e1[_0xf4db('0x36')][_0xf4db('0x38')]?_0x1846e1[_0xf4db('0x36')]:_0x174f4b[_0xf4db('0x30')];_0x1846e1[_0xf4db('0x4f')]=qs[_0xf4db('0x3b')](_0x67cee5[_0xf4db('0x33')][_0xf4db('0x3b')]);_0x1846e1['where']=qs['filters'](_[_0xf4db('0x3d')](_0x67cee5[_0xf4db('0x33')],_0x174f4b[_0xf4db('0x3c')]));if(_0x67cee5[_0xf4db('0x33')][_0xf4db('0x40')]){_0x1846e1[_0xf4db('0x3e')]=_['merge'](_0x1846e1['where'],{'$or':_[_0xf4db('0x31')](_0x1846e1[_0xf4db('0x36')],function(_0x2fb7be){var _0x45d2c2={};_0x45d2c2[_0x2fb7be]={'$like':'%'+_0x67cee5[_0xf4db('0x33')][_0xf4db('0x40')]+'%'};return _0x45d2c2;})});}_0x1846e1=_[_0xf4db('0x47')]({},_0x1846e1,_0x67cee5['options']);return _0x355f09[_0xf4db('0x50')](_0x1846e1);}})[_0xf4db('0x27')](function(_0x531f0e){if(_0x531f0e){_0x5b98e8=_0x531f0e['length'];if(!_0x67cee5[_0xf4db('0x33')][_0xf4db('0x39')]('nolimit')){_0x1846e1[_0xf4db('0x1f')]=qs['limit'](_0x67cee5[_0xf4db('0x33')][_0xf4db('0x1f')]);_0x1846e1[_0xf4db('0x21')]=qs[_0xf4db('0x21')](_0x67cee5[_0xf4db('0x33')][_0xf4db('0x21')]);}return _0x355f09[_0xf4db('0x50')](_0x1846e1);}})[_0xf4db('0x27')](function(_0x50c9f4){if(_0x50c9f4){return _0x50c9f4?{'count':_0x5b98e8,'rows':_0x50c9f4}:null;}})[_0xf4db('0x27')](respondWithResult(_0x2c7f3a,null))['catch'](handleError(_0x2c7f3a,null));};exports[_0xf4db('0x52')]=function(_0x40baae,_0x3b83e0,_0x8f9194){var _0x266375={};var _0x3e8930={};var _0x53dbae;var _0x22e66e;return db[_0xf4db('0x2b')][_0xf4db('0x51')]({'where':{'id':_0x40baae[_0xf4db('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3b83e0,null))[_0xf4db('0x27')](function(_0x49226d){if(_0x49226d){_0x53dbae=_0x49226d;_0x3e8930[_0xf4db('0x30')]=_[_0xf4db('0x34')](db['VtigerField'][_0xf4db('0x2c')]);_0x3e8930[_0xf4db('0x33')]=_[_0xf4db('0x34')](_0x40baae[_0xf4db('0x33')]);_0x3e8930['filters']=_[_0xf4db('0x35')](_0x3e8930[_0xf4db('0x30')],_0x3e8930[_0xf4db('0x33')]);_0x266375['attributes']=_['intersection'](_0x3e8930[_0xf4db('0x30')],qs[_0xf4db('0x37')](_0x40baae[_0xf4db('0x33')][_0xf4db('0x37')]));_0x266375['attributes']=_0x266375[_0xf4db('0x36')]['length']?_0x266375[_0xf4db('0x36')]:_0x3e8930[_0xf4db('0x30')];_0x266375[_0xf4db('0x4f')]=qs['sort'](_0x40baae['query']['sort']);_0x266375[_0xf4db('0x3e')]=qs[_0xf4db('0x3c')](_['pick'](_0x40baae[_0xf4db('0x33')],_0x3e8930[_0xf4db('0x3c')]));if(_0x40baae[_0xf4db('0x33')][_0xf4db('0x40')]){_0x266375[_0xf4db('0x3e')]=_[_0xf4db('0x47')](_0x266375[_0xf4db('0x3e')],{'$or':_[_0xf4db('0x31')](_0x266375[_0xf4db('0x36')],function(_0x3ee30d){var _0x198b20={};_0x198b20[_0x3ee30d]={'$like':'%'+_0x40baae['query'][_0xf4db('0x40')]+'%'};return _0x198b20;})});}_0x266375=_[_0xf4db('0x47')]({},_0x266375,_0x40baae[_0xf4db('0x48')]);return _0x53dbae[_0xf4db('0x52')](_0x266375);}})[_0xf4db('0x27')](function(_0x2b9ec0){if(_0x2b9ec0){_0x22e66e=_0x2b9ec0['length'];if(!_0x40baae['query'][_0xf4db('0x39')](_0xf4db('0x3a'))){_0x266375['limit']=qs['limit'](_0x40baae[_0xf4db('0x33')][_0xf4db('0x1f')]);_0x266375[_0xf4db('0x21')]=qs[_0xf4db('0x21')](_0x40baae[_0xf4db('0x33')][_0xf4db('0x21')]);}return _0x53dbae['getDescriptions'](_0x266375);}})[_0xf4db('0x27')](function(_0x7fa33e){if(_0x7fa33e){return _0x7fa33e?{'count':_0x22e66e,'rows':_0x7fa33e}:null;}})[_0xf4db('0x27')](respondWithResult(_0x3b83e0,null))[_0xf4db('0x45')](handleError(_0x3b83e0,null));}; \ No newline at end of file +var _0x8f94=['desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','name','send','map','VtigerConfiguration','rawAttributes','fieldName','type','model','keys','query','intersection','attributes','fields','length','nolimit','sort','where','filter','VIRTUAL','options','include','rows','includeAll','merge','find','catch','create','body','params','getFields','findOne','VtigerField','filters','order','pick','getSubjects','hasOwnProperty','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','fs-extra','lodash','crypto','jsforce'];(function(_0x38854e,_0x23cbc9){var _0x3f8415=function(_0x4e493e){while(--_0x4e493e){_0x38854e['push'](_0x38854e['shift']());}};_0x3f8415(++_0x23cbc9);}(_0x8f94,0xd7));var _0x48f9=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x8f94[_0x6c993a];return _0x27f547;};'use strict';var emlformat=require(_0x48f9('0x0'));var rimraf=require(_0x48f9('0x1'));var zipdir=require(_0x48f9('0x2'));var jsonpatch=require(_0x48f9('0x3'));var rp=require(_0x48f9('0x4'));var moment=require('moment');var BPromise=require(_0x48f9('0x5'));var Mustache=require(_0x48f9('0x6'));var util=require('util');var path=require(_0x48f9('0x7'));var sox=require('sox');var csv=require(_0x48f9('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x48f9('0x9'));var _=require(_0x48f9('0xa'));var squel=require('squel');var crypto=require(_0x48f9('0xb'));var jsforce=require(_0x48f9('0xc'));var deskjs=require(_0x48f9('0xd'));var toCsv=require(_0x48f9('0x8'));var querystring=require(_0x48f9('0xe'));var Papa=require('papaparse');var Redis=require(_0x48f9('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x48f9('0x10'));var as=require(_0x48f9('0x11'));var hardwareService=require(_0x48f9('0x12'));var logger=require('../../config/logger')(_0x48f9('0x13'));var utils=require(_0x48f9('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x48f9('0x15'));var db=require(_0x48f9('0x16'))['db'];function respondWithStatusCode(_0xe9eceb,_0x5249c3){_0x5249c3=_0x5249c3||0xcc;return function(_0x28d8e9){if(_0x28d8e9){return _0xe9eceb[_0x48f9('0x17')](_0x5249c3);}return _0xe9eceb['status'](_0x5249c3)[_0x48f9('0x18')]();};}function respondWithResult(_0x3c54b4,_0x38365f){_0x38365f=_0x38365f||0xc8;return function(_0x490574){if(_0x490574){return _0x3c54b4[_0x48f9('0x19')](_0x38365f)['json'](_0x490574);}};}function respondWithFilteredResult(_0x2838e1,_0x6a644d){return function(_0x2ee180){if(_0x2ee180){var _0x1b2ff8=typeof _0x6a644d[_0x48f9('0x1a')]===_0x48f9('0x1b')&&typeof _0x6a644d[_0x48f9('0x1c')]===_0x48f9('0x1b');var _0x1ef0b3=_0x2ee180['count'];var _0x57ba3e=_0x1b2ff8?0x0:_0x6a644d[_0x48f9('0x1a')];var _0x1854ca=_0x1b2ff8?_0x2ee180[_0x48f9('0x1d')]:_0x6a644d[_0x48f9('0x1a')]+_0x6a644d[_0x48f9('0x1c')];var _0x14f663;if(_0x1854ca>=_0x1ef0b3){_0x1854ca=_0x1ef0b3;_0x14f663=0xc8;}else{_0x14f663=0xce;}_0x2838e1[_0x48f9('0x19')](_0x14f663);return _0x2838e1[_0x48f9('0x1e')](_0x48f9('0x1f'),_0x57ba3e+'-'+_0x1854ca+'/'+_0x1ef0b3)['json'](_0x2ee180);}return null;};}function patchUpdates(_0x1fc14a){return function(_0x2591ec){try{jsonpatch['apply'](_0x2591ec,_0x1fc14a,!![]);}catch(_0x3ad38c){return BPromise[_0x48f9('0x20')](_0x3ad38c);}return _0x2591ec[_0x48f9('0x21')]();};}function saveUpdates(_0x4ac795,_0x143eea){return function(_0x14562b){if(_0x14562b){return _0x14562b[_0x48f9('0x22')](_0x4ac795)[_0x48f9('0x23')](function(_0x1f71b9){return _0x1f71b9;});}return null;};}function removeEntity(_0x472655,_0x202375){return function(_0x37b104){if(_0x37b104){return _0x37b104[_0x48f9('0x24')]()['then'](function(){_0x472655[_0x48f9('0x19')](0xcc)[_0x48f9('0x18')]();});}};}function handleEntityNotFound(_0x614329,_0x1ecaad){return function(_0x22b283){if(!_0x22b283){_0x614329[_0x48f9('0x17')](0x194);}return _0x22b283;};}function handleError(_0x199693,_0x1b8d33){_0x1b8d33=_0x1b8d33||0x1f4;return function(_0x75c557){logger[_0x48f9('0x25')](_0x75c557['stack']);if(_0x75c557['name']){delete _0x75c557[_0x48f9('0x26')];}_0x199693[_0x48f9('0x19')](_0x1b8d33)[_0x48f9('0x27')](_0x75c557);};}exports['index']=function(_0x25c510,_0x1efc5e){var _0x20ebc4={},_0x2f6d62={},_0x1f6e24={'count':0x0,'rows':[]};var _0x30d436=_[_0x48f9('0x28')](db[_0x48f9('0x29')][_0x48f9('0x2a')],function(_0x3ab05f){return{'name':_0x3ab05f[_0x48f9('0x2b')],'type':_0x3ab05f[_0x48f9('0x2c')]['key']};});_0x2f6d62[_0x48f9('0x2d')]=_[_0x48f9('0x28')](_0x30d436,_0x48f9('0x26'));_0x2f6d62['query']=_[_0x48f9('0x2e')](_0x25c510[_0x48f9('0x2f')]);_0x2f6d62['filters']=_[_0x48f9('0x30')](_0x2f6d62[_0x48f9('0x2d')],_0x2f6d62[_0x48f9('0x2f')]);_0x20ebc4[_0x48f9('0x31')]=_['intersection'](_0x2f6d62['model'],qs[_0x48f9('0x32')](_0x25c510[_0x48f9('0x2f')]['fields']));_0x20ebc4[_0x48f9('0x31')]=_0x20ebc4[_0x48f9('0x31')][_0x48f9('0x33')]?_0x20ebc4[_0x48f9('0x31')]:_0x2f6d62[_0x48f9('0x2d')];if(!_0x25c510['query']['hasOwnProperty'](_0x48f9('0x34'))){_0x20ebc4[_0x48f9('0x1c')]=qs[_0x48f9('0x1c')](_0x25c510[_0x48f9('0x2f')][_0x48f9('0x1c')]);_0x20ebc4[_0x48f9('0x1a')]=qs[_0x48f9('0x1a')](_0x25c510['query']['offset']);}_0x20ebc4['order']=qs[_0x48f9('0x35')](_0x25c510['query'][_0x48f9('0x35')]);_0x20ebc4[_0x48f9('0x36')]=qs['filters'](_['pick'](_0x25c510[_0x48f9('0x2f')],_0x2f6d62['filters']),_0x30d436);if(_0x25c510['query'][_0x48f9('0x37')]){_0x20ebc4['where']=_['merge'](_0x20ebc4[_0x48f9('0x36')],{'$or':_['map'](_0x30d436,function(_0x51d9f1){if(_0x51d9f1[_0x48f9('0x2c')]!==_0x48f9('0x38')){var _0x260a57={};_0x260a57[_0x51d9f1[_0x48f9('0x26')]]={'$like':'%'+_0x25c510[_0x48f9('0x2f')][_0x48f9('0x37')]+'%'};return _0x260a57;}})});}_0x20ebc4=_['merge']({},_0x20ebc4,_0x25c510[_0x48f9('0x39')]);var _0x14f883={'where':_0x20ebc4[_0x48f9('0x36')]};return db[_0x48f9('0x29')]['count'](_0x14f883)[_0x48f9('0x23')](function(_0x263145){_0x1f6e24[_0x48f9('0x1d')]=_0x263145;if(_0x25c510[_0x48f9('0x2f')]['includeAll']){_0x20ebc4[_0x48f9('0x3a')]=[{'all':!![]}];}return db[_0x48f9('0x29')]['findAll'](_0x20ebc4);})[_0x48f9('0x23')](function(_0x2a9497){_0x1f6e24[_0x48f9('0x3b')]=_0x2a9497;return _0x1f6e24;})[_0x48f9('0x23')](respondWithFilteredResult(_0x1efc5e,_0x20ebc4))['catch'](handleError(_0x1efc5e,null));};exports['show']=function(_0x361b8e,_0x4ee4af){var _0x5da42f={'raw':![],'where':{'id':_0x361b8e['params']['id']}},_0x3d3f10={};_0x3d3f10[_0x48f9('0x2d')]=_['keys'](db[_0x48f9('0x29')][_0x48f9('0x2a')]);_0x3d3f10[_0x48f9('0x2f')]=_[_0x48f9('0x2e')](_0x361b8e[_0x48f9('0x2f')]);_0x3d3f10['filters']=_[_0x48f9('0x30')](_0x3d3f10['model'],_0x3d3f10[_0x48f9('0x2f')]);_0x5da42f[_0x48f9('0x31')]=_[_0x48f9('0x30')](_0x3d3f10[_0x48f9('0x2d')],qs[_0x48f9('0x32')](_0x361b8e[_0x48f9('0x2f')][_0x48f9('0x32')]));_0x5da42f[_0x48f9('0x31')]=_0x5da42f['attributes'][_0x48f9('0x33')]?_0x5da42f[_0x48f9('0x31')]:_0x3d3f10[_0x48f9('0x2d')];if(_0x361b8e['query'][_0x48f9('0x3c')]){_0x5da42f[_0x48f9('0x3a')]=[{'all':!![]}];}_0x5da42f=_[_0x48f9('0x3d')]({},_0x5da42f,_0x361b8e[_0x48f9('0x39')]);return db['VtigerConfiguration'][_0x48f9('0x3e')](_0x5da42f)['then'](handleEntityNotFound(_0x4ee4af,null))[_0x48f9('0x23')](respondWithResult(_0x4ee4af,null))[_0x48f9('0x3f')](handleError(_0x4ee4af,null));};exports[_0x48f9('0x40')]=function(_0x5bb4f9,_0xedf61a){return db[_0x48f9('0x29')]['create'](_0x5bb4f9[_0x48f9('0x41')],{})['then'](respondWithResult(_0xedf61a,0xc9))[_0x48f9('0x3f')](handleError(_0xedf61a,null));};exports[_0x48f9('0x22')]=function(_0x22f3fd,_0x5897ba){if(_0x22f3fd[_0x48f9('0x41')]['id']){delete _0x22f3fd[_0x48f9('0x41')]['id'];}return db[_0x48f9('0x29')][_0x48f9('0x3e')]({'where':{'id':_0x22f3fd[_0x48f9('0x42')]['id']}})[_0x48f9('0x23')](handleEntityNotFound(_0x5897ba,null))[_0x48f9('0x23')](saveUpdates(_0x22f3fd['body'],null))[_0x48f9('0x23')](respondWithResult(_0x5897ba,null))[_0x48f9('0x3f')](handleError(_0x5897ba,null));};exports['destroy']=function(_0x4082e6,_0x5022c0){return db[_0x48f9('0x29')][_0x48f9('0x3e')]({'where':{'id':_0x4082e6[_0x48f9('0x42')]['id']}})[_0x48f9('0x23')](handleEntityNotFound(_0x5022c0,null))[_0x48f9('0x23')](removeEntity(_0x5022c0,null))[_0x48f9('0x3f')](handleError(_0x5022c0,null));};exports[_0x48f9('0x43')]=function(_0x3b5862,_0x45ec71,_0x5d345d){var _0x387e09={};var _0x3b64af={};var _0x271eaa;var _0x3b364a;return db[_0x48f9('0x29')][_0x48f9('0x44')]({'where':{'id':_0x3b5862[_0x48f9('0x42')]['id']}})[_0x48f9('0x23')](handleEntityNotFound(_0x45ec71,null))[_0x48f9('0x23')](function(_0x10553b){if(_0x10553b){_0x271eaa=_0x10553b;_0x3b64af[_0x48f9('0x2d')]=_[_0x48f9('0x2e')](db[_0x48f9('0x45')][_0x48f9('0x2a')]);_0x3b64af[_0x48f9('0x2f')]=_[_0x48f9('0x2e')](_0x3b5862[_0x48f9('0x2f')]);_0x3b64af[_0x48f9('0x46')]=_[_0x48f9('0x30')](_0x3b64af[_0x48f9('0x2d')],_0x3b64af[_0x48f9('0x2f')]);_0x387e09[_0x48f9('0x31')]=_['intersection'](_0x3b64af[_0x48f9('0x2d')],qs[_0x48f9('0x32')](_0x3b5862[_0x48f9('0x2f')][_0x48f9('0x32')]));_0x387e09['attributes']=_0x387e09['attributes'][_0x48f9('0x33')]?_0x387e09[_0x48f9('0x31')]:_0x3b64af[_0x48f9('0x2d')];_0x387e09[_0x48f9('0x47')]=qs[_0x48f9('0x35')](_0x3b5862[_0x48f9('0x2f')][_0x48f9('0x35')]);_0x387e09[_0x48f9('0x36')]=qs[_0x48f9('0x46')](_[_0x48f9('0x48')](_0x3b5862['query'],_0x3b64af[_0x48f9('0x46')]));if(_0x3b5862[_0x48f9('0x2f')]['filter']){_0x387e09[_0x48f9('0x36')]=_[_0x48f9('0x3d')](_0x387e09[_0x48f9('0x36')],{'$or':_[_0x48f9('0x28')](_0x387e09[_0x48f9('0x31')],function(_0x4e3c8f){var _0x274d5f={};_0x274d5f[_0x4e3c8f]={'$like':'%'+_0x3b5862[_0x48f9('0x2f')][_0x48f9('0x37')]+'%'};return _0x274d5f;})});}_0x387e09=_[_0x48f9('0x3d')]({},_0x387e09,_0x3b5862['options']);return _0x271eaa[_0x48f9('0x43')](_0x387e09);}})[_0x48f9('0x23')](function(_0x36d964){if(_0x36d964){_0x3b364a=_0x36d964[_0x48f9('0x33')];if(!_0x3b5862[_0x48f9('0x2f')]['hasOwnProperty'](_0x48f9('0x34'))){_0x387e09[_0x48f9('0x1c')]=qs[_0x48f9('0x1c')](_0x3b5862['query'][_0x48f9('0x1c')]);_0x387e09['offset']=qs[_0x48f9('0x1a')](_0x3b5862[_0x48f9('0x2f')][_0x48f9('0x1a')]);}return _0x271eaa[_0x48f9('0x43')](_0x387e09);}})['then'](function(_0xdf1e4){if(_0xdf1e4){return _0xdf1e4?{'count':_0x3b364a,'rows':_0xdf1e4}:null;}})[_0x48f9('0x23')](respondWithResult(_0x45ec71,null))['catch'](handleError(_0x45ec71,null));};exports[_0x48f9('0x49')]=function(_0x3b6fb5,_0x435c08,_0x3583c5){var _0xa287b7={};var _0x53d233={};var _0x463656;var _0x48a66b;return db[_0x48f9('0x29')][_0x48f9('0x44')]({'where':{'id':_0x3b6fb5['params']['id']}})[_0x48f9('0x23')](handleEntityNotFound(_0x435c08,null))[_0x48f9('0x23')](function(_0x58569c){if(_0x58569c){_0x463656=_0x58569c;_0x53d233['model']=_[_0x48f9('0x2e')](db['VtigerField']['rawAttributes']);_0x53d233['query']=_['keys'](_0x3b6fb5[_0x48f9('0x2f')]);_0x53d233[_0x48f9('0x46')]=_['intersection'](_0x53d233[_0x48f9('0x2d')],_0x53d233['query']);_0xa287b7[_0x48f9('0x31')]=_[_0x48f9('0x30')](_0x53d233['model'],qs[_0x48f9('0x32')](_0x3b6fb5['query'][_0x48f9('0x32')]));_0xa287b7['attributes']=_0xa287b7[_0x48f9('0x31')][_0x48f9('0x33')]?_0xa287b7[_0x48f9('0x31')]:_0x53d233[_0x48f9('0x2d')];_0xa287b7['order']=qs[_0x48f9('0x35')](_0x3b6fb5[_0x48f9('0x2f')][_0x48f9('0x35')]);_0xa287b7['where']=qs['filters'](_['pick'](_0x3b6fb5[_0x48f9('0x2f')],_0x53d233['filters']));if(_0x3b6fb5['query'][_0x48f9('0x37')]){_0xa287b7[_0x48f9('0x36')]=_[_0x48f9('0x3d')](_0xa287b7[_0x48f9('0x36')],{'$or':_[_0x48f9('0x28')](_0xa287b7['attributes'],function(_0x5e1278){var _0x478674={};_0x478674[_0x5e1278]={'$like':'%'+_0x3b6fb5[_0x48f9('0x2f')][_0x48f9('0x37')]+'%'};return _0x478674;})});}_0xa287b7=_['merge']({},_0xa287b7,_0x3b6fb5[_0x48f9('0x39')]);return _0x463656['getSubjects'](_0xa287b7);}})[_0x48f9('0x23')](function(_0x3d9b68){if(_0x3d9b68){_0x48a66b=_0x3d9b68[_0x48f9('0x33')];if(!_0x3b6fb5[_0x48f9('0x2f')][_0x48f9('0x4a')](_0x48f9('0x34'))){_0xa287b7['limit']=qs['limit'](_0x3b6fb5['query']['limit']);_0xa287b7['offset']=qs[_0x48f9('0x1a')](_0x3b6fb5[_0x48f9('0x2f')][_0x48f9('0x1a')]);}return _0x463656[_0x48f9('0x49')](_0xa287b7);}})['then'](function(_0x5b8252){if(_0x5b8252){return _0x5b8252?{'count':_0x48a66b,'rows':_0x5b8252}:null;}})[_0x48f9('0x23')](respondWithResult(_0x435c08,null))[_0x48f9('0x3f')](handleError(_0x435c08,null));};exports[_0x48f9('0x4b')]=function(_0x1347be,_0x1df5be,_0x536190){var _0x580ddf={};var _0x1707d1={};var _0x55e1cc;var _0xea29;return db['VtigerConfiguration'][_0x48f9('0x44')]({'where':{'id':_0x1347be[_0x48f9('0x42')]['id']}})[_0x48f9('0x23')](handleEntityNotFound(_0x1df5be,null))[_0x48f9('0x23')](function(_0x375d4d){if(_0x375d4d){_0x55e1cc=_0x375d4d;_0x1707d1['model']=_[_0x48f9('0x2e')](db[_0x48f9('0x45')][_0x48f9('0x2a')]);_0x1707d1[_0x48f9('0x2f')]=_[_0x48f9('0x2e')](_0x1347be['query']);_0x1707d1[_0x48f9('0x46')]=_['intersection'](_0x1707d1[_0x48f9('0x2d')],_0x1707d1[_0x48f9('0x2f')]);_0x580ddf['attributes']=_[_0x48f9('0x30')](_0x1707d1[_0x48f9('0x2d')],qs['fields'](_0x1347be[_0x48f9('0x2f')][_0x48f9('0x32')]));_0x580ddf[_0x48f9('0x31')]=_0x580ddf[_0x48f9('0x31')]['length']?_0x580ddf['attributes']:_0x1707d1['model'];_0x580ddf[_0x48f9('0x47')]=qs[_0x48f9('0x35')](_0x1347be[_0x48f9('0x2f')][_0x48f9('0x35')]);_0x580ddf[_0x48f9('0x36')]=qs['filters'](_['pick'](_0x1347be['query'],_0x1707d1['filters']));if(_0x1347be[_0x48f9('0x2f')][_0x48f9('0x37')]){_0x580ddf[_0x48f9('0x36')]=_[_0x48f9('0x3d')](_0x580ddf[_0x48f9('0x36')],{'$or':_['map'](_0x580ddf[_0x48f9('0x31')],function(_0x1dc39f){var _0x3d1aaa={};_0x3d1aaa[_0x1dc39f]={'$like':'%'+_0x1347be['query'][_0x48f9('0x37')]+'%'};return _0x3d1aaa;})});}_0x580ddf=_[_0x48f9('0x3d')]({},_0x580ddf,_0x1347be[_0x48f9('0x39')]);return _0x55e1cc[_0x48f9('0x4b')](_0x580ddf);}})['then'](function(_0x59ea75){if(_0x59ea75){_0xea29=_0x59ea75[_0x48f9('0x33')];if(!_0x1347be[_0x48f9('0x2f')]['hasOwnProperty'](_0x48f9('0x34'))){_0x580ddf[_0x48f9('0x1c')]=qs['limit'](_0x1347be[_0x48f9('0x2f')]['limit']);_0x580ddf[_0x48f9('0x1a')]=qs[_0x48f9('0x1a')](_0x1347be[_0x48f9('0x2f')]['offset']);}return _0x55e1cc[_0x48f9('0x4b')](_0x580ddf);}})[_0x48f9('0x23')](function(_0x174507){if(_0x174507){return _0x174507?{'count':_0xea29,'rows':_0x174507}:null;}})[_0x48f9('0x23')](respondWithResult(_0x1df5be,null))[_0x48f9('0x3f')](handleError(_0x1df5be,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index b7088c8..390b825 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 _0x20cc=['../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','lodash','util'];(function(_0x5bdf2d,_0x473746){var _0x5a452a=function(_0x4bd60b){while(--_0x4bd60b){_0x5bdf2d['push'](_0x5bdf2d['shift']());}};_0x5a452a(++_0x473746);}(_0x20cc,0x6a));var _0xc20c=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0x20cc[_0x13e741];return _0x3f8bb3;};'use strict';var _=require(_0xc20c('0x0'));var util=require(_0xc20c('0x1'));var logger=require(_0xc20c('0x2'))(_0xc20c('0x3'));var moment=require(_0xc20c('0x4'));var BPromise=require(_0xc20c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc20c('0x6'));var config=require(_0xc20c('0x7'));var attributes=require(_0xc20c('0x8'));module[_0xc20c('0x9')]=function(_0xfb82e1,_0x15f12b){return _0xfb82e1[_0xc20c('0xa')](_0xc20c('0xb'),attributes,{'tableName':'int_vtiger_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe985=['bluebird','request-promise','../../config/environment','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','lodash','util','../../config/logger','api','moment'];(function(_0x4bbe38,_0x3f1c79){var _0x2880a8=function(_0x152729){while(--_0x152729){_0x4bbe38['push'](_0x4bbe38['shift']());}};_0x2880a8(++_0x3f1c79);}(_0xe985,0x13f));var _0x5e98=function(_0x3f994d,_0x249d72){_0x3f994d=_0x3f994d-0x0;var _0x5309b4=_0xe985[_0x3f994d];return _0x5309b4;};'use strict';var _=require(_0x5e98('0x0'));var util=require(_0x5e98('0x1'));var logger=require(_0x5e98('0x2'))(_0x5e98('0x3'));var moment=require(_0x5e98('0x4'));var BPromise=require(_0x5e98('0x5'));var rp=require(_0x5e98('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5e98('0x7'));var attributes=require(_0x5e98('0x8'));module[_0x5e98('0x9')]=function(_0xfa3a12,_0x332821){return _0xfa3a12[_0x5e98('0xa')](_0x5e98('0xb'),attributes,{'tableName':'int_vtiger_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js index 668be2c..8a3587a 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 _0xf782=['stringify','error','code','message','catch','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','http','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x227a2f,_0x24fc02){var _0x27fb6c=function(_0x5120e9){while(--_0x5120e9){_0x227a2f['push'](_0x227a2f['shift']());}};_0x27fb6c(++_0x24fc02);}(_0xf782,0x181));var _0x2f78=function(_0x49870c,_0x4d2e2b){_0x49870c=_0x49870c-0x0;var _0x2c98f5=_0xf782[_0x49870c];return _0x2c98f5;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2f78('0x0'));var BPromise=require('bluebird');var rs=require(_0x2f78('0x1'));var fs=require('fs');var Redis=require(_0x2f78('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2f78('0x3'))(_0x2f78('0x4'));var config=require(_0x2f78('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0x2f78('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x1dff10,_0x481b5f,_0x2ce0d4){return new BPromise(function(_0x5107e5,_0x2cb739){return client[_0x2f78('0x7')](_0x1dff10,_0x2ce0d4)[_0x2f78('0x8')](function(_0x325662){logger[_0x2f78('0x9')](_0x2f78('0xa'),_0x481b5f,_0x2f78('0xb'));logger[_0x2f78('0xc')](_0x2f78('0xd'),_0x481b5f,_0x2f78('0xb'),JSON[_0x2f78('0xe')](_0x325662));if(_0x325662[_0x2f78('0xf')]){if(_0x325662[_0x2f78('0xf')][_0x2f78('0x10')]===0x1f4){logger[_0x2f78('0xf')](_0x2f78('0xa'),_0x481b5f,_0x325662['error']['message']);return _0x2cb739(_0x325662[_0x2f78('0xf')][_0x2f78('0x11')]);}logger['error'](_0x2f78('0xa'),_0x481b5f,_0x325662[_0x2f78('0xf')][_0x2f78('0x11')]);return _0x5107e5(_0x325662[_0x2f78('0xf')]['message']);}else{logger[_0x2f78('0x9')]('VtigerConfiguration,\x20%s,\x20%s',_0x481b5f,_0x2f78('0xb'));_0x5107e5(_0x325662['result']['message']);}})[_0x2f78('0x12')](function(_0x54691e){logger['error'](_0x2f78('0xa'),_0x481b5f,_0x54691e);_0x2cb739(_0x54691e);});});} \ No newline at end of file +var _0x2277=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','lodash'];(function(_0x5192d2,_0x3519f3){var _0x22b581=function(_0x3f815d){while(--_0x3f815d){_0x5192d2['push'](_0x5192d2['shift']());}};_0x22b581(++_0x3519f3);}(_0x2277,0x11c));var _0x7227=function(_0x5b7230,_0x1c7124){_0x5b7230=_0x5b7230-0x0;var _0x32dd0f=_0x2277[_0x5b7230];return _0x32dd0f;};'use strict';var _=require(_0x7227('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x7227('0x1'));var rs=require(_0x7227('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7227('0x3'))['db'];var utils=require(_0x7227('0x4'));var logger=require(_0x7227('0x5'))(_0x7227('0x6'));var config=require(_0x7227('0x7'));var jayson=require(_0x7227('0x8'));var client=jayson[_0x7227('0x9')][_0x7227('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x54e444,_0x23662c,_0x444dc9){return new BPromise(function(_0x18acbd,_0x29e60f){return client['request'](_0x54e444,_0x444dc9)['then'](function(_0x2696ee){logger[_0x7227('0xb')](_0x7227('0xc'),_0x23662c,_0x7227('0xd'));logger[_0x7227('0xe')]('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x23662c,_0x7227('0xd'),JSON['stringify'](_0x2696ee));if(_0x2696ee[_0x7227('0xf')]){if(_0x2696ee[_0x7227('0xf')][_0x7227('0x10')]===0x1f4){logger['error'](_0x7227('0xc'),_0x23662c,_0x2696ee['error'][_0x7227('0x11')]);return _0x29e60f(_0x2696ee['error'][_0x7227('0x11')]);}logger[_0x7227('0xf')]('VtigerConfiguration,\x20%s,\x20%s',_0x23662c,_0x2696ee['error']['message']);return _0x18acbd(_0x2696ee[_0x7227('0xf')][_0x7227('0x11')]);}else{logger[_0x7227('0xb')](_0x7227('0xc'),_0x23662c,_0x7227('0xd'));_0x18acbd(_0x2696ee[_0x7227('0x12')][_0x7227('0x11')]);}})['catch'](function(_0x5188fe){logger[_0x7227('0xf')](_0x7227('0xc'),_0x23662c,_0x5188fe);_0x29e60f(_0x5188fe);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 8bba407..c18e99d 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 _0x80d4=['fs-extra','../../components/auth/service','../../config/environment','./intVtigerField.controller','get','isAuthenticated','index','/:id','show','create','put','update','delete','destroy','exports','multer','util','path','express','Router'];(function(_0x363618,_0x5ebf3a){var _0x496dee=function(_0x3b312a){while(--_0x3b312a){_0x363618['push'](_0x363618['shift']());}};_0x496dee(++_0x5ebf3a);}(_0x80d4,0xaf));var _0x480d=function(_0x431666,_0x58c74c){_0x431666=_0x431666-0x0;var _0x223c2a=_0x80d4[_0x431666];return _0x223c2a;};'use strict';var multer=require(_0x480d('0x0'));var util=require(_0x480d('0x1'));var path=require(_0x480d('0x2'));var timeout=require('connect-timeout');var express=require(_0x480d('0x3'));var router=express[_0x480d('0x4')]();var fs_extra=require(_0x480d('0x5'));var auth=require(_0x480d('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x480d('0x7'));var controller=require(_0x480d('0x8'));router[_0x480d('0x9')]('/',auth[_0x480d('0xa')](),controller[_0x480d('0xb')]);router['get'](_0x480d('0xc'),auth[_0x480d('0xa')](),controller[_0x480d('0xd')]);router['post']('/',auth[_0x480d('0xa')](),controller[_0x480d('0xe')]);router[_0x480d('0xf')]('/:id',auth[_0x480d('0xa')](),controller[_0x480d('0x10')]);router[_0x480d('0x11')](_0x480d('0xc'),auth[_0x480d('0xa')](),controller[_0x480d('0x12')]);module[_0x480d('0x13')]=router; \ No newline at end of file +var _0xe47e=['./intVtigerField.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service'];(function(_0x58693c,_0x17b3b6){var _0x307b24=function(_0x8afd69){while(--_0x8afd69){_0x58693c['push'](_0x58693c['shift']());}};_0x307b24(++_0x17b3b6);}(_0xe47e,0x12c));var _0xee47=function(_0x57928b,_0x29a111){_0x57928b=_0x57928b-0x0;var _0x49aad6=_0xe47e[_0x57928b];return _0x49aad6;};'use strict';var multer=require(_0xee47('0x0'));var util=require(_0xee47('0x1'));var path=require(_0xee47('0x2'));var timeout=require(_0xee47('0x3'));var express=require(_0xee47('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xee47('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xee47('0x6'));router[_0xee47('0x7')]('/',auth[_0xee47('0x8')](),controller[_0xee47('0x9')]);router[_0xee47('0x7')](_0xee47('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xee47('0xb')]('/',auth[_0xee47('0x8')](),controller[_0xee47('0xc')]);router[_0xee47('0xd')]('/:id',auth[_0xee47('0x8')](),controller[_0xee47('0xe')]);router[_0xee47('0xf')]('/:id',auth[_0xee47('0x8')](),controller[_0xee47('0x10')]);module[_0xee47('0x11')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index 7b517ee..1094850 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 _0x117a=['variable','BOOLEAN','exports','ENUM','string','picklist','STRING'];(function(_0x2e9c92,_0xf2220f){var _0x103fdb=function(_0x586dd2){while(--_0x586dd2){_0x2e9c92['push'](_0x2e9c92['shift']());}};_0x103fdb(++_0xf2220f);}(_0x117a,0xe2));var _0xa117=function(_0x217ff6,_0x36f75d){_0x217ff6=_0x217ff6-0x0;var _0x417c93=_0x117a[_0x217ff6];return _0x417c93;};'use strict';var Sequelize=require('sequelize');module[_0xa117('0x0')]={'type':{'type':Sequelize[_0xa117('0x1')](_0xa117('0x2'),'variable','customVariable','keyValue',_0xa117('0x3')),'defaultValue':_0xa117('0x2')},'content':{'type':Sequelize[_0xa117('0x4')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0xa117('0x2'),_0xa117('0x5'),'customVariable')},'keyContent':{'type':Sequelize[_0xa117('0x4')]},'idField':{'type':Sequelize[_0xa117('0x4')]},'nameField':{'type':Sequelize[_0xa117('0x4')]},'customField':{'type':Sequelize[_0xa117('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa117('0x4')]}}; \ No newline at end of file +var _0x6203=['ENUM','variable','string','STRING','BOOLEAN','sequelize','exports'];(function(_0x25a029,_0x112d74){var _0xbc159c=function(_0x11203d){while(--_0x11203d){_0x25a029['push'](_0x25a029['shift']());}};_0xbc159c(++_0x112d74);}(_0x6203,0x7c));var _0x3620=function(_0x46d821,_0x138b43){_0x46d821=_0x46d821-0x0;var _0x4a39db=_0x6203[_0x46d821];return _0x4a39db;};'use strict';var Sequelize=require(_0x3620('0x0'));module[_0x3620('0x1')]={'type':{'type':Sequelize[_0x3620('0x2')]('string',_0x3620('0x3'),'customVariable','keyValue','picklist'),'defaultValue':_0x3620('0x4')},'content':{'type':Sequelize[_0x3620('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x3620('0x2')](_0x3620('0x4'),_0x3620('0x3'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x3620('0x5')]},'nameField':{'type':Sequelize[_0x3620('0x5')]},'customField':{'type':Sequelize[_0x3620('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3620('0x5')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index ab2d9dd..513d3d0 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 _0x3466=['pick','merge','where','VIRTUAL','filter','includeAll','include','findAll','catch','show','options','create','body','find','params','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','then','error','stack','name','map','VtigerField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0x3466,0x1cb));var _0x6346=function(_0x3408f3,_0x4db505){_0x3408f3=_0x3408f3-0x0;var _0x31ea0b=_0x3466[_0x3408f3];return _0x31ea0b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6346('0x0'));var zipdir=require(_0x6346('0x1'));var jsonpatch=require(_0x6346('0x2'));var rp=require('request-promise');var moment=require(_0x6346('0x3'));var BPromise=require(_0x6346('0x4'));var Mustache=require(_0x6346('0x5'));var util=require(_0x6346('0x6'));var path=require(_0x6346('0x7'));var sox=require(_0x6346('0x8'));var csv=require(_0x6346('0x9'));var ejs=require(_0x6346('0xa'));var fs=require('fs');var fs_extra=require(_0x6346('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x6346('0xc'));var jsforce=require(_0x6346('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x6346('0x9'));var querystring=require(_0x6346('0xe'));var Papa=require(_0x6346('0xf'));var Redis=require(_0x6346('0x10'));var authService=require(_0x6346('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x6346('0x12'));var hardwareService=require(_0x6346('0x13'));var logger=require('../../config/logger')(_0x6346('0x14'));var utils=require('../../config/utils');var config=require(_0x6346('0x15'));var licenseUtil=require(_0x6346('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3c8001,_0x41b1bf){_0x41b1bf=_0x41b1bf||0xcc;return function(_0x30e684){if(_0x30e684){return _0x3c8001[_0x6346('0x17')](_0x41b1bf);}return _0x3c8001[_0x6346('0x18')](_0x41b1bf)[_0x6346('0x19')]();};}function respondWithResult(_0x274311,_0x2908d2){_0x2908d2=_0x2908d2||0xc8;return function(_0x1fec20){if(_0x1fec20){return _0x274311[_0x6346('0x18')](_0x2908d2)[_0x6346('0x1a')](_0x1fec20);}};}function respondWithFilteredResult(_0x4a99ea,_0x3fbe5a){return function(_0x3ff500){if(_0x3ff500){var _0x1921aa=typeof _0x3fbe5a[_0x6346('0x1b')]===_0x6346('0x1c')&&typeof _0x3fbe5a[_0x6346('0x1d')]===_0x6346('0x1c');var _0x4e090c=_0x3ff500['count'];var _0x160ab9=_0x1921aa?0x0:_0x3fbe5a['offset'];var _0x5c1bfb=_0x1921aa?_0x3ff500[_0x6346('0x1e')]:_0x3fbe5a['offset']+_0x3fbe5a[_0x6346('0x1d')];var _0x7468d;if(_0x5c1bfb>=_0x4e090c){_0x5c1bfb=_0x4e090c;_0x7468d=0xc8;}else{_0x7468d=0xce;}_0x4a99ea[_0x6346('0x18')](_0x7468d);return _0x4a99ea[_0x6346('0x1f')](_0x6346('0x20'),_0x160ab9+'-'+_0x5c1bfb+'/'+_0x4e090c)[_0x6346('0x1a')](_0x3ff500);}return null;};}function patchUpdates(_0x191eab){return function(_0x38a7af){try{jsonpatch[_0x6346('0x21')](_0x38a7af,_0x191eab,!![]);}catch(_0x3da744){return BPromise[_0x6346('0x22')](_0x3da744);}return _0x38a7af['save']();};}function saveUpdates(_0x2f5d38,_0x3008f6){return function(_0x374e5b){if(_0x374e5b){return _0x374e5b[_0x6346('0x23')](_0x2f5d38)['then'](function(_0x433f89){return _0x433f89;});}return null;};}function removeEntity(_0x2b2787,_0x54d722){return function(_0x4215a1){if(_0x4215a1){return _0x4215a1[_0x6346('0x24')]()[_0x6346('0x25')](function(){_0x2b2787[_0x6346('0x18')](0xcc)[_0x6346('0x19')]();});}};}function handleEntityNotFound(_0x143c4c,_0x541c01){return function(_0x27fc1e){if(!_0x27fc1e){_0x143c4c['sendStatus'](0x194);}return _0x27fc1e;};}function handleError(_0x57b2ec,_0x319956){_0x319956=_0x319956||0x1f4;return function(_0x43e9a6){logger[_0x6346('0x26')](_0x43e9a6[_0x6346('0x27')]);if(_0x43e9a6[_0x6346('0x28')]){delete _0x43e9a6['name'];}_0x57b2ec[_0x6346('0x18')](_0x319956)['send'](_0x43e9a6);};}exports['index']=function(_0x313557,_0x52d611){var _0x55d750={},_0x1e1ebf={},_0x2d801c={'count':0x0,'rows':[]};var _0xcc6956=_[_0x6346('0x29')](db[_0x6346('0x2a')][_0x6346('0x2b')],function(_0x4a6808){return{'name':_0x4a6808[_0x6346('0x2c')],'type':_0x4a6808[_0x6346('0x2d')][_0x6346('0x2e')]};});_0x1e1ebf[_0x6346('0x2f')]=_['map'](_0xcc6956,'name');_0x1e1ebf[_0x6346('0x30')]=_[_0x6346('0x31')](_0x313557[_0x6346('0x30')]);_0x1e1ebf[_0x6346('0x32')]=_['intersection'](_0x1e1ebf[_0x6346('0x2f')],_0x1e1ebf[_0x6346('0x30')]);_0x55d750['attributes']=_[_0x6346('0x33')](_0x1e1ebf['model'],qs[_0x6346('0x34')](_0x313557['query'][_0x6346('0x34')]));_0x55d750[_0x6346('0x35')]=_0x55d750[_0x6346('0x35')][_0x6346('0x36')]?_0x55d750[_0x6346('0x35')]:_0x1e1ebf[_0x6346('0x2f')];if(!_0x313557['query'][_0x6346('0x37')](_0x6346('0x38'))){_0x55d750[_0x6346('0x1d')]=qs[_0x6346('0x1d')](_0x313557[_0x6346('0x30')][_0x6346('0x1d')]);_0x55d750[_0x6346('0x1b')]=qs[_0x6346('0x1b')](_0x313557[_0x6346('0x30')]['offset']);}_0x55d750[_0x6346('0x39')]=qs[_0x6346('0x3a')](_0x313557[_0x6346('0x30')][_0x6346('0x3a')]);_0x55d750['where']=qs['filters'](_[_0x6346('0x3b')](_0x313557[_0x6346('0x30')],_0x1e1ebf[_0x6346('0x32')]),_0xcc6956);if(_0x313557[_0x6346('0x30')]['filter']){_0x55d750['where']=_[_0x6346('0x3c')](_0x55d750[_0x6346('0x3d')],{'$or':_[_0x6346('0x29')](_0xcc6956,function(_0x36d47e){if(_0x36d47e[_0x6346('0x2d')]!==_0x6346('0x3e')){var _0x34f831={};_0x34f831[_0x36d47e['name']]={'$like':'%'+_0x313557['query'][_0x6346('0x3f')]+'%'};return _0x34f831;}})});}_0x55d750=_[_0x6346('0x3c')]({},_0x55d750,_0x313557['options']);var _0xf93522={'where':_0x55d750[_0x6346('0x3d')]};return db[_0x6346('0x2a')][_0x6346('0x1e')](_0xf93522)[_0x6346('0x25')](function(_0x52527f){_0x2d801c[_0x6346('0x1e')]=_0x52527f;if(_0x313557[_0x6346('0x30')][_0x6346('0x40')]){_0x55d750[_0x6346('0x41')]=[{'all':!![]}];}return db['VtigerField'][_0x6346('0x42')](_0x55d750);})[_0x6346('0x25')](function(_0x3821d3){_0x2d801c['rows']=_0x3821d3;return _0x2d801c;})[_0x6346('0x25')](respondWithFilteredResult(_0x52d611,_0x55d750))[_0x6346('0x43')](handleError(_0x52d611,null));};exports[_0x6346('0x44')]=function(_0x56822b,_0x5bdabb){var _0x1a6918={'raw':!![],'where':{'id':_0x56822b['params']['id']}},_0x221d0b={};_0x221d0b[_0x6346('0x2f')]=_['keys'](db[_0x6346('0x2a')][_0x6346('0x2b')]);_0x221d0b[_0x6346('0x30')]=_[_0x6346('0x31')](_0x56822b['query']);_0x221d0b[_0x6346('0x32')]=_[_0x6346('0x33')](_0x221d0b['model'],_0x221d0b[_0x6346('0x30')]);_0x1a6918['attributes']=_[_0x6346('0x33')](_0x221d0b[_0x6346('0x2f')],qs[_0x6346('0x34')](_0x56822b['query'][_0x6346('0x34')]));_0x1a6918[_0x6346('0x35')]=_0x1a6918['attributes'][_0x6346('0x36')]?_0x1a6918[_0x6346('0x35')]:_0x221d0b[_0x6346('0x2f')];if(_0x56822b[_0x6346('0x30')]['includeAll']){_0x1a6918[_0x6346('0x41')]=[{'all':!![]}];}_0x1a6918=_[_0x6346('0x3c')]({},_0x1a6918,_0x56822b[_0x6346('0x45')]);return db['VtigerField']['find'](_0x1a6918)[_0x6346('0x25')](handleEntityNotFound(_0x5bdabb,null))[_0x6346('0x25')](respondWithResult(_0x5bdabb,null))[_0x6346('0x43')](handleError(_0x5bdabb,null));};exports[_0x6346('0x46')]=function(_0x25e89e,_0x41f2d0){return db[_0x6346('0x2a')][_0x6346('0x46')](_0x25e89e[_0x6346('0x47')],{})['then'](respondWithResult(_0x41f2d0,0xc9))[_0x6346('0x43')](handleError(_0x41f2d0,null));};exports[_0x6346('0x23')]=function(_0x306c46,_0x316d61){if(_0x306c46[_0x6346('0x47')]['id']){delete _0x306c46[_0x6346('0x47')]['id'];}return db['VtigerField']['find']({'where':{'id':_0x306c46['params']['id']}})[_0x6346('0x25')](handleEntityNotFound(_0x316d61,null))['then'](saveUpdates(_0x306c46[_0x6346('0x47')],null))['then'](respondWithResult(_0x316d61,null))[_0x6346('0x43')](handleError(_0x316d61,null));};exports[_0x6346('0x24')]=function(_0x509ad5,_0x5a800c){return db[_0x6346('0x2a')][_0x6346('0x48')]({'where':{'id':_0x509ad5[_0x6346('0x49')]['id']}})[_0x6346('0x25')](handleEntityNotFound(_0x5a800c,null))[_0x6346('0x25')](removeEntity(_0x5a800c,null))['catch'](handleError(_0x5a800c,null));}; \ No newline at end of file +var _0x3cd6=['name','send','index','map','VtigerField','rawAttributes','fieldName','type','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','sort','pick','filter','where','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','merge','find','create','body','destroy','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','sendStatus','status','end','json','undefined','offset','count','limit','set','Content-Range','apply','reject','update','then','error'];(function(_0x3cf150,_0x178cb5){var _0x931f8b=function(_0x40a693){while(--_0x40a693){_0x3cf150['push'](_0x3cf150['shift']());}};_0x931f8b(++_0x178cb5);}(_0x3cd6,0x6a));var _0x63cd=function(_0x17daa1,_0x231464){_0x17daa1=_0x17daa1-0x0;var _0x2512ed=_0x3cd6[_0x17daa1];return _0x2512ed;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x63cd('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x63cd('0x1'));var rp=require(_0x63cd('0x2'));var moment=require(_0x63cd('0x3'));var BPromise=require(_0x63cd('0x4'));var Mustache=require(_0x63cd('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x63cd('0x6'));var ejs=require(_0x63cd('0x7'));var fs=require('fs');var fs_extra=require(_0x63cd('0x8'));var _=require(_0x63cd('0x9'));var squel=require(_0x63cd('0xa'));var crypto=require(_0x63cd('0xb'));var jsforce=require(_0x63cd('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x63cd('0x6'));var querystring=require(_0x63cd('0xd'));var Papa=require(_0x63cd('0xe'));var Redis=require(_0x63cd('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x63cd('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x63cd('0x11'));var logger=require(_0x63cd('0x12'))('api');var utils=require(_0x63cd('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x63cd('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3dba08,_0x552a63){_0x552a63=_0x552a63||0xcc;return function(_0x35c758){if(_0x35c758){return _0x3dba08[_0x63cd('0x15')](_0x552a63);}return _0x3dba08[_0x63cd('0x16')](_0x552a63)[_0x63cd('0x17')]();};}function respondWithResult(_0x223183,_0x29fccd){_0x29fccd=_0x29fccd||0xc8;return function(_0x28b33a){if(_0x28b33a){return _0x223183[_0x63cd('0x16')](_0x29fccd)[_0x63cd('0x18')](_0x28b33a);}};}function respondWithFilteredResult(_0x2bfad3,_0x34202c){return function(_0x1cc623){if(_0x1cc623){var _0x3f5ec1=typeof _0x34202c['offset']===_0x63cd('0x19')&&typeof _0x34202c['limit']===_0x63cd('0x19');var _0xbea63=_0x1cc623['count'];var _0x544ce8=_0x3f5ec1?0x0:_0x34202c[_0x63cd('0x1a')];var _0x3ad851=_0x3f5ec1?_0x1cc623[_0x63cd('0x1b')]:_0x34202c[_0x63cd('0x1a')]+_0x34202c[_0x63cd('0x1c')];var _0x1d17de;if(_0x3ad851>=_0xbea63){_0x3ad851=_0xbea63;_0x1d17de=0xc8;}else{_0x1d17de=0xce;}_0x2bfad3[_0x63cd('0x16')](_0x1d17de);return _0x2bfad3[_0x63cd('0x1d')](_0x63cd('0x1e'),_0x544ce8+'-'+_0x3ad851+'/'+_0xbea63)['json'](_0x1cc623);}return null;};}function patchUpdates(_0x50bf9f){return function(_0x493e57){try{jsonpatch[_0x63cd('0x1f')](_0x493e57,_0x50bf9f,!![]);}catch(_0x26467f){return BPromise[_0x63cd('0x20')](_0x26467f);}return _0x493e57['save']();};}function saveUpdates(_0x2c3f1c,_0x34c6f6){return function(_0x3eb2ef){if(_0x3eb2ef){return _0x3eb2ef[_0x63cd('0x21')](_0x2c3f1c)[_0x63cd('0x22')](function(_0x3b7099){return _0x3b7099;});}return null;};}function removeEntity(_0x2fc5c3,_0x438ff5){return function(_0x36cb81){if(_0x36cb81){return _0x36cb81['destroy']()[_0x63cd('0x22')](function(){_0x2fc5c3[_0x63cd('0x16')](0xcc)[_0x63cd('0x17')]();});}};}function handleEntityNotFound(_0x566fce,_0x3a3659){return function(_0x1875af){if(!_0x1875af){_0x566fce[_0x63cd('0x15')](0x194);}return _0x1875af;};}function handleError(_0x41050d,_0x31bf28){_0x31bf28=_0x31bf28||0x1f4;return function(_0xc91d4b){logger[_0x63cd('0x23')](_0xc91d4b['stack']);if(_0xc91d4b['name']){delete _0xc91d4b[_0x63cd('0x24')];}_0x41050d[_0x63cd('0x16')](_0x31bf28)[_0x63cd('0x25')](_0xc91d4b);};}exports[_0x63cd('0x26')]=function(_0x15e5d3,_0x33ba55){var _0x2da3f8={},_0x232569={},_0xef05ac={'count':0x0,'rows':[]};var _0x4ba8b7=_[_0x63cd('0x27')](db[_0x63cd('0x28')][_0x63cd('0x29')],function(_0x471989){return{'name':_0x471989[_0x63cd('0x2a')],'type':_0x471989[_0x63cd('0x2b')]['key']};});_0x232569['model']=_[_0x63cd('0x27')](_0x4ba8b7,_0x63cd('0x24'));_0x232569[_0x63cd('0x2c')]=_[_0x63cd('0x2d')](_0x15e5d3[_0x63cd('0x2c')]);_0x232569[_0x63cd('0x2e')]=_[_0x63cd('0x2f')](_0x232569[_0x63cd('0x30')],_0x232569[_0x63cd('0x2c')]);_0x2da3f8['attributes']=_[_0x63cd('0x2f')](_0x232569[_0x63cd('0x30')],qs[_0x63cd('0x31')](_0x15e5d3[_0x63cd('0x2c')][_0x63cd('0x31')]));_0x2da3f8[_0x63cd('0x32')]=_0x2da3f8[_0x63cd('0x32')][_0x63cd('0x33')]?_0x2da3f8['attributes']:_0x232569[_0x63cd('0x30')];if(!_0x15e5d3[_0x63cd('0x2c')][_0x63cd('0x34')]('nolimit')){_0x2da3f8[_0x63cd('0x1c')]=qs[_0x63cd('0x1c')](_0x15e5d3['query'][_0x63cd('0x1c')]);_0x2da3f8[_0x63cd('0x1a')]=qs['offset'](_0x15e5d3[_0x63cd('0x2c')][_0x63cd('0x1a')]);}_0x2da3f8['order']=qs[_0x63cd('0x35')](_0x15e5d3[_0x63cd('0x2c')][_0x63cd('0x35')]);_0x2da3f8['where']=qs[_0x63cd('0x2e')](_[_0x63cd('0x36')](_0x15e5d3['query'],_0x232569[_0x63cd('0x2e')]),_0x4ba8b7);if(_0x15e5d3[_0x63cd('0x2c')][_0x63cd('0x37')]){_0x2da3f8[_0x63cd('0x38')]=_['merge'](_0x2da3f8[_0x63cd('0x38')],{'$or':_['map'](_0x4ba8b7,function(_0x26feb9){if(_0x26feb9['type']!==_0x63cd('0x39')){var _0x52a482={};_0x52a482[_0x26feb9[_0x63cd('0x24')]]={'$like':'%'+_0x15e5d3[_0x63cd('0x2c')][_0x63cd('0x37')]+'%'};return _0x52a482;}})});}_0x2da3f8=_['merge']({},_0x2da3f8,_0x15e5d3[_0x63cd('0x3a')]);var _0xf8370f={'where':_0x2da3f8['where']};return db[_0x63cd('0x28')]['count'](_0xf8370f)[_0x63cd('0x22')](function(_0xb13e25){_0xef05ac[_0x63cd('0x1b')]=_0xb13e25;if(_0x15e5d3['query'][_0x63cd('0x3b')]){_0x2da3f8['include']=[{'all':!![]}];}return db[_0x63cd('0x28')][_0x63cd('0x3c')](_0x2da3f8);})[_0x63cd('0x22')](function(_0xae797f){_0xef05ac[_0x63cd('0x3d')]=_0xae797f;return _0xef05ac;})[_0x63cd('0x22')](respondWithFilteredResult(_0x33ba55,_0x2da3f8))[_0x63cd('0x3e')](handleError(_0x33ba55,null));};exports[_0x63cd('0x3f')]=function(_0x2b750a,_0x39fe4b){var _0x3475bb={'raw':!![],'where':{'id':_0x2b750a[_0x63cd('0x40')]['id']}},_0x38c7b5={};_0x38c7b5['model']=_[_0x63cd('0x2d')](db['VtigerField'][_0x63cd('0x29')]);_0x38c7b5[_0x63cd('0x2c')]=_[_0x63cd('0x2d')](_0x2b750a[_0x63cd('0x2c')]);_0x38c7b5[_0x63cd('0x2e')]=_[_0x63cd('0x2f')](_0x38c7b5[_0x63cd('0x30')],_0x38c7b5['query']);_0x3475bb[_0x63cd('0x32')]=_[_0x63cd('0x2f')](_0x38c7b5[_0x63cd('0x30')],qs[_0x63cd('0x31')](_0x2b750a[_0x63cd('0x2c')]['fields']));_0x3475bb[_0x63cd('0x32')]=_0x3475bb[_0x63cd('0x32')]['length']?_0x3475bb['attributes']:_0x38c7b5[_0x63cd('0x30')];if(_0x2b750a[_0x63cd('0x2c')][_0x63cd('0x3b')]){_0x3475bb[_0x63cd('0x41')]=[{'all':!![]}];}_0x3475bb=_[_0x63cd('0x42')]({},_0x3475bb,_0x2b750a[_0x63cd('0x3a')]);return db[_0x63cd('0x28')][_0x63cd('0x43')](_0x3475bb)[_0x63cd('0x22')](handleEntityNotFound(_0x39fe4b,null))['then'](respondWithResult(_0x39fe4b,null))[_0x63cd('0x3e')](handleError(_0x39fe4b,null));};exports[_0x63cd('0x44')]=function(_0x4300ac,_0xa92966){return db[_0x63cd('0x28')][_0x63cd('0x44')](_0x4300ac[_0x63cd('0x45')],{})[_0x63cd('0x22')](respondWithResult(_0xa92966,0xc9))['catch'](handleError(_0xa92966,null));};exports[_0x63cd('0x21')]=function(_0x3fbb86,_0x4a6cfc){if(_0x3fbb86[_0x63cd('0x45')]['id']){delete _0x3fbb86[_0x63cd('0x45')]['id'];}return db[_0x63cd('0x28')][_0x63cd('0x43')]({'where':{'id':_0x3fbb86[_0x63cd('0x40')]['id']}})['then'](handleEntityNotFound(_0x4a6cfc,null))[_0x63cd('0x22')](saveUpdates(_0x3fbb86[_0x63cd('0x45')],null))[_0x63cd('0x22')](respondWithResult(_0x4a6cfc,null))['catch'](handleError(_0x4a6cfc,null));};exports[_0x63cd('0x46')]=function(_0x547c47,_0x276c8f){return db[_0x63cd('0x28')]['find']({'where':{'id':_0x547c47['params']['id']}})[_0x63cd('0x22')](handleEntityNotFound(_0x276c8f,null))[_0x63cd('0x22')](removeEntity(_0x276c8f,null))[_0x63cd('0x3e')](handleError(_0x276c8f,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index b710f04..6055db4 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 _0x4583=['idField','FieldId','lodash','util','../../config/logger','api','bluebird','request-promise','path','./intVtigerField.attributes','VtigerField','int_vtiger_fields'];(function(_0x1d3e2c,_0x3de214){var _0x1b6d3a=function(_0x16c96f){while(--_0x16c96f){_0x1d3e2c['push'](_0x1d3e2c['shift']());}};_0x1b6d3a(++_0x3de214);}(_0x4583,0xe6));var _0x3458=function(_0x507d1c,_0x519686){_0x507d1c=_0x507d1c-0x0;var _0x419c1a=_0x4583[_0x507d1c];return _0x419c1a;};'use strict';var _=require(_0x3458('0x0'));var util=require(_0x3458('0x1'));var logger=require(_0x3458('0x2'))(_0x3458('0x3'));var moment=require('moment');var BPromise=require(_0x3458('0x4'));var rp=require(_0x3458('0x5'));var fs=require('fs');var path=require(_0x3458('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3458('0x7'));module['exports']=function(_0x8cda1d,_0x218ea3){return _0x8cda1d['define'](_0x3458('0x8'),attributes,{'tableName':_0x3458('0x9'),'paranoid':![],'indexes':[{'name':'vtiger_unique_index','fields':[_0x3458('0xa'),_0x3458('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7b54=['VtigerField','vtiger_unique_index','idField','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerField.attributes','exports','define'];(function(_0x174ef5,_0x256e8e){var _0x1cc379=function(_0x3eafcf){while(--_0x3eafcf){_0x174ef5['push'](_0x174ef5['shift']());}};_0x1cc379(++_0x256e8e);}(_0x7b54,0x120));var _0x47b5=function(_0x3aaf97,_0x4fa2e8){_0x3aaf97=_0x3aaf97-0x0;var _0xeba75e=_0x7b54[_0x3aaf97];return _0xeba75e;};'use strict';var _=require(_0x47b5('0x0'));var util=require('util');var logger=require(_0x47b5('0x1'))(_0x47b5('0x2'));var moment=require(_0x47b5('0x3'));var BPromise=require(_0x47b5('0x4'));var rp=require(_0x47b5('0x5'));var fs=require('fs');var path=require(_0x47b5('0x6'));var rimraf=require(_0x47b5('0x7'));var config=require(_0x47b5('0x8'));var attributes=require(_0x47b5('0x9'));module[_0x47b5('0xa')]=function(_0x230559,_0x35c121){return _0x230559[_0x47b5('0xb')](_0x47b5('0xc'),attributes,{'tableName':'int_vtiger_fields','paranoid':![],'indexes':[{'name':_0x47b5('0xd'),'fields':[_0x47b5('0xe'),'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 79bc3ab..8da0b12 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 _0xbb1f=['util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','VtigerField,\x20%s,\x20%s','stringify','error','message'];(function(_0x1573ea,_0x434f02){var _0x51c0e2=function(_0x5c9b28){while(--_0x5c9b28){_0x1573ea['push'](_0x1573ea['shift']());}};_0x51c0e2(++_0x434f02);}(_0xbb1f,0x130));var _0xfbb1=function(_0x2586ad,_0x3a2816){_0x2586ad=_0x2586ad-0x0;var _0x4128db=_0xbb1f[_0x2586ad];return _0x4128db;};'use strict';var _=require('lodash');var util=require(_0xfbb1('0x0'));var moment=require(_0xfbb1('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfbb1('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xfbb1('0x3'));var logger=require(_0xfbb1('0x4'))(_0xfbb1('0x5'));var config=require(_0xfbb1('0x6'));var jayson=require(_0xfbb1('0x7'));var client=jayson[_0xfbb1('0x8')][_0xfbb1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5995ad,_0x3e8816,_0x18a286){return new BPromise(function(_0x3d8afe,_0x43764f){return client[_0xfbb1('0xa')](_0x5995ad,_0x18a286)['then'](function(_0x332801){logger[_0xfbb1('0xb')](_0xfbb1('0xc'),_0x3e8816,'request\x20sent');logger['debug']('VtigerField,\x20%s,\x20%s,\x20%s',_0x3e8816,'request\x20sent',JSON[_0xfbb1('0xd')](_0x332801));if(_0x332801['error']){if(_0x332801[_0xfbb1('0xe')]['code']===0x1f4){logger[_0xfbb1('0xe')](_0xfbb1('0xc'),_0x3e8816,_0x332801[_0xfbb1('0xe')]['message']);return _0x43764f(_0x332801['error']['message']);}logger[_0xfbb1('0xe')](_0xfbb1('0xc'),_0x3e8816,_0x332801[_0xfbb1('0xe')][_0xfbb1('0xf')]);return _0x3d8afe(_0x332801['error'][_0xfbb1('0xf')]);}else{logger[_0xfbb1('0xb')](_0xfbb1('0xc'),_0x3e8816,'request\x20sent');_0x3d8afe(_0x332801['result']['message']);}})['catch'](function(_0xf5f3bc){logger[_0xfbb1('0xe')](_0xfbb1('0xc'),_0x3e8816,_0xf5f3bc);_0x43764f(_0xf5f3bc);});});} \ No newline at end of file +var _0xe3f8=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VtigerField,\x20%s,\x20%s','request\x20sent','VtigerField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x2dcd8c,_0x4e0c89){var _0x215012=function(_0x37405c){while(--_0x37405c){_0x2dcd8c['push'](_0x2dcd8c['shift']());}};_0x215012(++_0x4e0c89);}(_0xe3f8,0x127));var _0x8e3f=function(_0x470eee,_0x4af3e1){_0x470eee=_0x470eee-0x0;var _0x5a65da=_0xe3f8[_0x470eee];return _0x5a65da;};'use strict';var _=require(_0x8e3f('0x0'));var util=require(_0x8e3f('0x1'));var moment=require(_0x8e3f('0x2'));var BPromise=require(_0x8e3f('0x3'));var rs=require(_0x8e3f('0x4'));var fs=require('fs');var Redis=require(_0x8e3f('0x5'));var db=require(_0x8e3f('0x6'))['db'];var utils=require(_0x8e3f('0x7'));var logger=require(_0x8e3f('0x8'))(_0x8e3f('0x9'));var config=require(_0x8e3f('0xa'));var jayson=require(_0x8e3f('0xb'));var client=jayson[_0x8e3f('0xc')][_0x8e3f('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x4de78d,_0x4ee58d,_0x495c82){return new BPromise(function(_0x11ffc1,_0x165a34){return client[_0x8e3f('0xe')](_0x4de78d,_0x495c82)[_0x8e3f('0xf')](function(_0x11f2dd){logger[_0x8e3f('0x10')](_0x8e3f('0x11'),_0x4ee58d,_0x8e3f('0x12'));logger['debug'](_0x8e3f('0x13'),_0x4ee58d,_0x8e3f('0x12'),JSON['stringify'](_0x11f2dd));if(_0x11f2dd['error']){if(_0x11f2dd[_0x8e3f('0x14')][_0x8e3f('0x15')]===0x1f4){logger[_0x8e3f('0x14')](_0x8e3f('0x11'),_0x4ee58d,_0x11f2dd[_0x8e3f('0x14')][_0x8e3f('0x16')]);return _0x165a34(_0x11f2dd[_0x8e3f('0x14')][_0x8e3f('0x16')]);}logger[_0x8e3f('0x14')]('VtigerField,\x20%s,\x20%s',_0x4ee58d,_0x11f2dd[_0x8e3f('0x14')][_0x8e3f('0x16')]);return _0x11ffc1(_0x11f2dd['error']['message']);}else{logger['info'](_0x8e3f('0x11'),_0x4ee58d,_0x8e3f('0x12'));_0x11ffc1(_0x11f2dd[_0x8e3f('0x17')][_0x8e3f('0x16')]);}})[_0x8e3f('0x18')](function(_0xda7935){logger[_0x8e3f('0x14')](_0x8e3f('0x11'),_0x4ee58d,_0xda7935);_0x165a34(_0xda7935);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 7c4891d..c78b904 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 _0x4ca5=['../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','/:id/configurations','put','delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x1f8fb0,_0x5703ad){var _0x2fedd6=function(_0x1c6879){while(--_0x1c6879){_0x1f8fb0['push'](_0x1f8fb0['shift']());}};_0x2fedd6(++_0x5703ad);}(_0x4ca5,0x1ae));var _0x54ca=function(_0x5330af,_0x2a6f4a){_0x5330af=_0x5330af-0x0;var _0x375017=_0x4ca5[_0x5330af];return _0x375017;};'use strict';var multer=require(_0x54ca('0x0'));var util=require(_0x54ca('0x1'));var path=require(_0x54ca('0x2'));var timeout=require('connect-timeout');var express=require(_0x54ca('0x3'));var router=express[_0x54ca('0x4')]();var fs_extra=require(_0x54ca('0x5'));var auth=require(_0x54ca('0x6'));var interaction=require(_0x54ca('0x7'));var config=require(_0x54ca('0x8'));var controller=require(_0x54ca('0x9'));router[_0x54ca('0xa')]('/',auth[_0x54ca('0xb')](),controller[_0x54ca('0xc')]);router['get'](_0x54ca('0xd'),auth[_0x54ca('0xb')](),controller[_0x54ca('0xe')]);router[_0x54ca('0xa')]('/:id/configurations',auth[_0x54ca('0xb')](),controller[_0x54ca('0xf')]);router[_0x54ca('0xa')](_0x54ca('0x10'),auth[_0x54ca('0xb')](),controller[_0x54ca('0x11')]);router[_0x54ca('0x12')]('/',auth[_0x54ca('0xb')](),controller['create']);router[_0x54ca('0x12')](_0x54ca('0x13'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0x54ca('0x14')]('/:id',auth[_0x54ca('0xb')](),controller['update']);router[_0x54ca('0x15')](_0x54ca('0xd'),auth[_0x54ca('0xb')](),controller['destroy']);module[_0x54ca('0x16')]=router; \ No newline at end of file +var _0x71f1=['multer','util','connect-timeout','express','../../config/environment','./intZendeskAccount.controller','get','/:id','isAuthenticated','show','/:id/configurations','/:id/fields','create','post','put','update','destroy','exports'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x71f1,0xea));var _0x171f=function(_0x4a3f10,_0x3373f1){_0x4a3f10=_0x4a3f10-0x0;var _0x1bcf08=_0x71f1[_0x4a3f10];return _0x1bcf08;};'use strict';var multer=require(_0x171f('0x0'));var util=require(_0x171f('0x1'));var path=require('path');var timeout=require(_0x171f('0x2'));var express=require(_0x171f('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x171f('0x4'));var controller=require(_0x171f('0x5'));router[_0x171f('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x171f('0x6')](_0x171f('0x7'),auth[_0x171f('0x8')](),controller[_0x171f('0x9')]);router[_0x171f('0x6')](_0x171f('0xa'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0x171f('0x6')](_0x171f('0xb'),auth[_0x171f('0x8')](),controller['getFields']);router['post']('/',auth['isAuthenticated'](),controller[_0x171f('0xc')]);router[_0x171f('0xd')](_0x171f('0xa'),auth[_0x171f('0x8')](),controller['addConfiguration']);router[_0x171f('0xe')]('/:id',auth[_0x171f('0x8')](),controller[_0x171f('0xf')]);router['delete'](_0x171f('0x7'),auth[_0x171f('0x8')](),controller[_0x171f('0x10')]);module[_0x171f('0x11')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index 78e8e36..44bb7fd 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 _0x9f37=['exports','STRING','ENUM','password','integrationTab','newTab','sequelize'];(function(_0x82d015,_0x523e8b){var _0x5c5851=function(_0x3f631a){while(--_0x3f631a){_0x82d015['push'](_0x82d015['shift']());}};_0x5c5851(++_0x523e8b);}(_0x9f37,0xd1));var _0x79f3=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x9f37[_0x5d4607];return _0x5e4a86;};'use strict';var Sequelize=require(_0x79f3('0x0'));module[_0x79f3('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x79f3('0x2')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'password':{'type':Sequelize[_0x79f3('0x2')]},'token':{'type':Sequelize[_0x79f3('0x2')]},'remoteUri':{'type':Sequelize[_0x79f3('0x2')],'unique':'remoteUri'},'authType':{'type':Sequelize[_0x79f3('0x3')](_0x79f3('0x4'),'token'),'defaultValue':'password'},'serverUrl':{'type':Sequelize[_0x79f3('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x79f3('0x3')](_0x79f3('0x5'),_0x79f3('0x6')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0x96f2=['integrationTab','newTab','sequelize','STRING','ENUM','password'];(function(_0x483d8b,_0x526c52){var _0x6500f1=function(_0x372797){while(--_0x372797){_0x483d8b['push'](_0x483d8b['shift']());}};_0x6500f1(++_0x526c52);}(_0x96f2,0xb0));var _0x296f=function(_0x4086d2,_0x31cfc8){_0x4086d2=_0x4086d2-0x0;var _0x2c0932=_0x96f2[_0x4086d2];return _0x2c0932;};'use strict';var Sequelize=require(_0x296f('0x0'));module['exports']={'name':{'type':Sequelize[_0x296f('0x1')]},'description':{'type':Sequelize[_0x296f('0x1')]},'username':{'type':Sequelize[_0x296f('0x1')],'unique':'username'},'password':{'type':Sequelize[_0x296f('0x1')]},'token':{'type':Sequelize[_0x296f('0x1')]},'remoteUri':{'type':Sequelize[_0x296f('0x1')],'unique':'remoteUri'},'authType':{'type':Sequelize[_0x296f('0x2')](_0x296f('0x3'),'token'),'defaultValue':'password'},'serverUrl':{'type':Sequelize[_0x296f('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x296f('0x2')](_0x296f('0x4'),_0x296f('0x5')),'defaultValue':_0x296f('0x4')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index b942c10..0f7213d 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 _0xb58b=['headers','toString','base64','Basic\x20%s','%s/token:%s','username','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','description','assignee','remove','ticket_fields','includes','position','title','system_field_options','custom_field_options','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','test','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','ZendeskAccount','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','includeAll','include','findAll','show','params','options','find','catch','create','update','body','getConfigurations','ZendeskConfiguration','addConfiguration','Subjects','getSubjects','channel','getDescriptions','ZendeskField','Descriptions','findOne','token','authType','remoteUri','substring','GET','format','%s/%s','password'];(function(_0x243b59,_0x3f9495){var _0x3e1676=function(_0x354052){while(--_0x354052){_0x243b59['push'](_0x243b59['shift']());}};_0x3e1676(++_0x3f9495);}(_0xb58b,0x1f1));var _0xbb58=function(_0x266d1d,_0x37fca9){_0x266d1d=_0x266d1d-0x0;var _0x4e6c80=_0xb58b[_0x266d1d];return _0x4e6c80;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbb58('0x0'));var zipdir=require(_0xbb58('0x1'));var jsonpatch=require(_0xbb58('0x2'));var rp=require('request-promise');var moment=require(_0xbb58('0x3'));var BPromise=require(_0xbb58('0x4'));var Mustache=require('mustache');var util=require(_0xbb58('0x5'));var path=require('path');var sox=require(_0xbb58('0x6'));var csv=require(_0xbb58('0x7'));var ejs=require(_0xbb58('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbb58('0x9'));var squel=require(_0xbb58('0xa'));var crypto=require(_0xbb58('0xb'));var jsforce=require(_0xbb58('0xc'));var deskjs=require(_0xbb58('0xd'));var toCsv=require(_0xbb58('0x7'));var querystring=require(_0xbb58('0xe'));var Papa=require(_0xbb58('0xf'));var Redis=require(_0xbb58('0x10'));var authService=require(_0xbb58('0x11'));var qs=require(_0xbb58('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb58('0x13'));var logger=require('../../config/logger')(_0xbb58('0x14'));var utils=require(_0xbb58('0x15'));var config=require(_0xbb58('0x16'));var licenseUtil=require(_0xbb58('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0xbb58('0x18'));function respondWithStatusCode(_0x18810f,_0x4cda21){_0x4cda21=_0x4cda21||0xcc;return function(_0x132511){if(_0x132511){return _0x18810f[_0xbb58('0x19')](_0x4cda21);}return _0x18810f[_0xbb58('0x1a')](_0x4cda21)[_0xbb58('0x1b')]();};}function respondWithResult(_0x19ceda,_0x58245f){_0x58245f=_0x58245f||0xc8;return function(_0x110944){if(_0x110944){return _0x19ceda[_0xbb58('0x1a')](_0x58245f)['json'](_0x110944);}};}function respondWithFilteredResult(_0x4ba30e,_0x33c20f){return function(_0x445b1f){if(_0x445b1f){var _0x38d69a=typeof _0x33c20f['offset']==='undefined'&&typeof _0x33c20f['limit']==='undefined';var _0x28637b=_0x445b1f[_0xbb58('0x1c')];var _0x48f3e0=_0x38d69a?0x0:_0x33c20f[_0xbb58('0x1d')];var _0x497653=_0x38d69a?_0x445b1f[_0xbb58('0x1c')]:_0x33c20f[_0xbb58('0x1d')]+_0x33c20f[_0xbb58('0x1e')];var _0xb8f982;if(_0x497653>=_0x28637b){_0x497653=_0x28637b;_0xb8f982=0xc8;}else{_0xb8f982=0xce;}_0x4ba30e[_0xbb58('0x1a')](_0xb8f982);return _0x4ba30e[_0xbb58('0x1f')](_0xbb58('0x20'),_0x48f3e0+'-'+_0x497653+'/'+_0x28637b)['json'](_0x445b1f);}return null;};}function patchUpdates(_0x84f34){return function(_0x2d8c0f){try{jsonpatch[_0xbb58('0x21')](_0x2d8c0f,_0x84f34,!![]);}catch(_0x3b4dc6){return BPromise[_0xbb58('0x22')](_0x3b4dc6);}return _0x2d8c0f[_0xbb58('0x23')]();};}function saveUpdates(_0x49453a,_0x350be7){return function(_0x27bbec){if(_0x27bbec){return _0x27bbec['update'](_0x49453a)[_0xbb58('0x24')](function(_0x53b693){return _0x53b693;});}return null;};}function removeEntity(_0x21964d,_0x287822){return function(_0x152f22){if(_0x152f22){return _0x152f22[_0xbb58('0x25')]()[_0xbb58('0x24')](function(){_0x21964d[_0xbb58('0x1a')](0xcc)[_0xbb58('0x1b')]();});}};}function handleEntityNotFound(_0x15e4c5,_0x4e0303){return function(_0x283dff){if(!_0x283dff){_0x15e4c5[_0xbb58('0x19')](0x194);}return _0x283dff;};}function handleError(_0x1be0ae,_0x129094){_0x129094=_0x129094||0x1f4;return function(_0x8e9ed9){logger[_0xbb58('0x26')](_0x8e9ed9[_0xbb58('0x27')]);if(_0x8e9ed9[_0xbb58('0x28')]){delete _0x8e9ed9[_0xbb58('0x28')];}_0x1be0ae[_0xbb58('0x1a')](_0x129094)[_0xbb58('0x29')](_0x8e9ed9);};}exports[_0xbb58('0x2a')]=function(_0x2a0481,_0x4157c4){var _0x3559b6={},_0x573cca={},_0x2b0f73={'count':0x0,'rows':[]};var _0xe46bc1=_[_0xbb58('0x2b')](db[_0xbb58('0x2c')][_0xbb58('0x2d')],function(_0x9d379f){return{'name':_0x9d379f[_0xbb58('0x2e')],'type':_0x9d379f[_0xbb58('0x2f')][_0xbb58('0x30')]};});_0x573cca['model']=_[_0xbb58('0x2b')](_0xe46bc1,_0xbb58('0x28'));_0x573cca[_0xbb58('0x31')]=_[_0xbb58('0x32')](_0x2a0481[_0xbb58('0x31')]);_0x573cca[_0xbb58('0x33')]=_[_0xbb58('0x34')](_0x573cca[_0xbb58('0x35')],_0x573cca[_0xbb58('0x31')]);_0x3559b6[_0xbb58('0x36')]=_[_0xbb58('0x34')](_0x573cca[_0xbb58('0x35')],qs[_0xbb58('0x37')](_0x2a0481['query']['fields']));_0x3559b6['attributes']=_0x3559b6[_0xbb58('0x36')][_0xbb58('0x38')]?_0x3559b6[_0xbb58('0x36')]:_0x573cca[_0xbb58('0x35')];if(!_0x2a0481[_0xbb58('0x31')][_0xbb58('0x39')](_0xbb58('0x3a'))){_0x3559b6[_0xbb58('0x1e')]=qs['limit'](_0x2a0481[_0xbb58('0x31')][_0xbb58('0x1e')]);_0x3559b6['offset']=qs[_0xbb58('0x1d')](_0x2a0481['query'][_0xbb58('0x1d')]);}_0x3559b6['order']=qs[_0xbb58('0x3b')](_0x2a0481[_0xbb58('0x31')]['sort']);_0x3559b6[_0xbb58('0x3c')]=qs[_0xbb58('0x33')](_[_0xbb58('0x3d')](_0x2a0481[_0xbb58('0x31')],_0x573cca[_0xbb58('0x33')]),_0xe46bc1);if(_0x2a0481[_0xbb58('0x31')][_0xbb58('0x3e')]){_0x3559b6[_0xbb58('0x3c')]=_['merge'](_0x3559b6[_0xbb58('0x3c')],{'$or':_[_0xbb58('0x2b')](_0xe46bc1,function(_0x2da5ff){if(_0x2da5ff['type']!=='VIRTUAL'){var _0x133d56={};_0x133d56[_0x2da5ff['name']]={'$like':'%'+_0x2a0481[_0xbb58('0x31')][_0xbb58('0x3e')]+'%'};return _0x133d56;}})});}_0x3559b6=_[_0xbb58('0x3f')]({},_0x3559b6,_0x2a0481['options']);var _0x485830={'where':_0x3559b6[_0xbb58('0x3c')]};return db[_0xbb58('0x2c')][_0xbb58('0x1c')](_0x485830)[_0xbb58('0x24')](function(_0x34a745){_0x2b0f73[_0xbb58('0x1c')]=_0x34a745;if(_0x2a0481['query'][_0xbb58('0x40')]){_0x3559b6[_0xbb58('0x41')]=[{'all':!![]}];}return db[_0xbb58('0x2c')][_0xbb58('0x42')](_0x3559b6);})[_0xbb58('0x24')](function(_0x301e15){_0x2b0f73['rows']=_0x301e15;return _0x2b0f73;})[_0xbb58('0x24')](respondWithFilteredResult(_0x4157c4,_0x3559b6))['catch'](handleError(_0x4157c4,null));};exports[_0xbb58('0x43')]=function(_0x285ad4,_0x29fb1c){var _0x45817f={'raw':![],'where':{'id':_0x285ad4[_0xbb58('0x44')]['id']}},_0x54099f={};_0x54099f[_0xbb58('0x35')]=_[_0xbb58('0x32')](db[_0xbb58('0x2c')]['rawAttributes']);_0x54099f[_0xbb58('0x31')]=_['keys'](_0x285ad4[_0xbb58('0x31')]);_0x54099f[_0xbb58('0x33')]=_[_0xbb58('0x34')](_0x54099f[_0xbb58('0x35')],_0x54099f[_0xbb58('0x31')]);_0x45817f[_0xbb58('0x36')]=_[_0xbb58('0x34')](_0x54099f[_0xbb58('0x35')],qs[_0xbb58('0x37')](_0x285ad4[_0xbb58('0x31')][_0xbb58('0x37')]));_0x45817f[_0xbb58('0x36')]=_0x45817f[_0xbb58('0x36')]['length']?_0x45817f[_0xbb58('0x36')]:_0x54099f['model'];if(_0x285ad4['query'][_0xbb58('0x40')]){_0x45817f[_0xbb58('0x41')]=[{'all':!![]}];}_0x45817f=_[_0xbb58('0x3f')]({},_0x45817f,_0x285ad4[_0xbb58('0x45')]);return db[_0xbb58('0x2c')][_0xbb58('0x46')](_0x45817f)[_0xbb58('0x24')](handleEntityNotFound(_0x29fb1c,null))[_0xbb58('0x24')](respondWithResult(_0x29fb1c,null))[_0xbb58('0x47')](handleError(_0x29fb1c,null));};exports[_0xbb58('0x48')]=function(_0x440fb3,_0x59a8cf){return db[_0xbb58('0x2c')][_0xbb58('0x48')](_0x440fb3['body'],{})[_0xbb58('0x24')](respondWithResult(_0x59a8cf,0xc9))[_0xbb58('0x47')](handleError(_0x59a8cf,null));};exports[_0xbb58('0x49')]=function(_0xdb0ff7,_0x5de68e){if(_0xdb0ff7[_0xbb58('0x4a')]['id']){delete _0xdb0ff7['body']['id'];}return db[_0xbb58('0x2c')][_0xbb58('0x46')]({'where':{'id':_0xdb0ff7[_0xbb58('0x44')]['id']}})['then'](handleEntityNotFound(_0x5de68e,null))[_0xbb58('0x24')](saveUpdates(_0xdb0ff7[_0xbb58('0x4a')],null))['then'](respondWithResult(_0x5de68e,null))[_0xbb58('0x47')](handleError(_0x5de68e,null));};exports['destroy']=function(_0x28301d,_0x2d81e0){return db[_0xbb58('0x2c')][_0xbb58('0x46')]({'where':{'id':_0x28301d[_0xbb58('0x44')]['id']}})[_0xbb58('0x24')](handleEntityNotFound(_0x2d81e0,null))[_0xbb58('0x24')](removeEntity(_0x2d81e0,null))['catch'](handleError(_0x2d81e0,null));};exports[_0xbb58('0x4b')]=function(_0x1fd892,_0x592da8,_0x3efbc6){var _0x98157={};var _0x5c19b7={};var _0x22802c;var _0x44636b;return db[_0xbb58('0x2c')]['findOne']({'where':{'id':_0x1fd892[_0xbb58('0x44')]['id']}})[_0xbb58('0x24')](handleEntityNotFound(_0x592da8,null))[_0xbb58('0x24')](function(_0x592879){if(_0x592879){_0x22802c=_0x592879;_0x5c19b7[_0xbb58('0x35')]=_['keys'](db[_0xbb58('0x4c')][_0xbb58('0x2d')]);_0x5c19b7[_0xbb58('0x31')]=_['keys'](_0x1fd892['query']);_0x5c19b7[_0xbb58('0x33')]=_[_0xbb58('0x34')](_0x5c19b7[_0xbb58('0x35')],_0x5c19b7[_0xbb58('0x31')]);_0x98157[_0xbb58('0x36')]=_['intersection'](_0x5c19b7[_0xbb58('0x35')],qs[_0xbb58('0x37')](_0x1fd892[_0xbb58('0x31')]['fields']));_0x98157[_0xbb58('0x36')]=_0x98157[_0xbb58('0x36')][_0xbb58('0x38')]?_0x98157[_0xbb58('0x36')]:_0x5c19b7[_0xbb58('0x35')];_0x98157['order']=qs[_0xbb58('0x3b')](_0x1fd892[_0xbb58('0x31')][_0xbb58('0x3b')]);_0x98157[_0xbb58('0x3c')]=qs[_0xbb58('0x33')](_[_0xbb58('0x3d')](_0x1fd892[_0xbb58('0x31')],_0x5c19b7[_0xbb58('0x33')]));if(_0x1fd892['query'][_0xbb58('0x3e')]){_0x98157['where']=_[_0xbb58('0x3f')](_0x98157[_0xbb58('0x3c')],{'$or':_[_0xbb58('0x2b')](_0x98157[_0xbb58('0x36')],function(_0x3d6fba){var _0x1dbbd9={};_0x1dbbd9[_0x3d6fba]={'$like':'%'+_0x1fd892[_0xbb58('0x31')][_0xbb58('0x3e')]+'%'};return _0x1dbbd9;})});}_0x98157=_[_0xbb58('0x3f')]({},_0x98157,_0x1fd892[_0xbb58('0x45')]);return _0x22802c[_0xbb58('0x4b')](_0x98157);}})['then'](function(_0x3933f0){if(_0x3933f0){_0x44636b=_0x3933f0[_0xbb58('0x38')];if(!_0x1fd892[_0xbb58('0x31')]['hasOwnProperty'](_0xbb58('0x3a'))){_0x98157['limit']=qs[_0xbb58('0x1e')](_0x1fd892[_0xbb58('0x31')]['limit']);_0x98157[_0xbb58('0x1d')]=qs[_0xbb58('0x1d')](_0x1fd892[_0xbb58('0x31')][_0xbb58('0x1d')]);}return _0x22802c[_0xbb58('0x4b')](_0x98157);}})['then'](function(_0x54bf2e){if(_0x54bf2e){return _0x54bf2e?{'count':_0x44636b,'rows':_0x54bf2e}:null;}})[_0xbb58('0x24')](respondWithResult(_0x592da8,null))[_0xbb58('0x47')](handleError(_0x592da8,null));};exports[_0xbb58('0x4d')]=function(_0x4bbccf,_0x11d41e,_0x419215){if(_0x4bbccf['body']['id']){delete _0x4bbccf[_0xbb58('0x4a')]['id'];}return db[_0xbb58('0x2c')]['findOne']({'where':{'id':_0x4bbccf[_0xbb58('0x44')]['id']}})[_0xbb58('0x24')](handleEntityNotFound(_0x11d41e,null))[_0xbb58('0x24')](function(_0x3c932e){if(_0x3c932e){_0x4bbccf[_0xbb58('0x4a')]['AccountId']=_0x3c932e['id'];_0x4bbccf[_0xbb58('0x4a')][_0xbb58('0x4e')]=integrations[_0xbb58('0x4f')](_0x4bbccf[_0xbb58('0x4a')][_0xbb58('0x50')],_0x4bbccf['body']['type']);_0x4bbccf[_0xbb58('0x4a')]['Descriptions']=integrations[_0xbb58('0x51')](_0x4bbccf[_0xbb58('0x4a')][_0xbb58('0x50')],_0x4bbccf[_0xbb58('0x4a')][_0xbb58('0x2f')]);return db[_0xbb58('0x4c')][_0xbb58('0x48')](_0x4bbccf[_0xbb58('0x4a')],{'include':[{'model':db[_0xbb58('0x52')],'as':_0xbb58('0x4e')},{'model':db['ZendeskField'],'as':_0xbb58('0x53')}]});}return null;})[_0xbb58('0x24')](respondWithResult(_0x11d41e,null))[_0xbb58('0x47')](handleError(_0x11d41e,null));};exports['getFields']=function(_0x50bf24,_0x4bdc30,_0x5e9319){var _0x1e315e='';return db[_0xbb58('0x2c')][_0xbb58('0x54')]({'where':{'id':_0x50bf24[_0xbb58('0x44')]['id']},'attributes':['id','username','password',_0xbb58('0x55'),_0xbb58('0x56'),'remoteUri']})[_0xbb58('0x24')](handleEntityNotFound(_0x4bdc30,null))[_0xbb58('0x24')](function(_0x3cd96a){if(_0x3cd96a){_0x1e315e=_0x3cd96a[_0xbb58('0x57')];var _0x382d16=_0x1e315e['slice'](-0x1);if(_0x382d16==='/'){_0x1e315e=_0x1e315e[_0xbb58('0x58')](0x0,_0x1e315e['lastIndexOf'](_0x382d16));}var _0x52cf79={'method':_0xbb58('0x59'),'uri':util[_0xbb58('0x5a')](_0xbb58('0x5b'),_0x1e315e,'ticket_fields'),'json':!![]};switch(_0x3cd96a[_0xbb58('0x56')]){case _0xbb58('0x5c'):_0x52cf79[_0xbb58('0x5d')]={'Authorization':util[_0xbb58('0x5a')]('Basic\x20%s',new Buffer(util[_0xbb58('0x5a')]('%s:%s',_0x3cd96a['username'],_0x3cd96a[_0xbb58('0x5c')]))[_0xbb58('0x5e')](_0xbb58('0x5f')))};break;case'token':_0x52cf79['headers']={'Authorization':util[_0xbb58('0x5a')](_0xbb58('0x60'),new Buffer(util[_0xbb58('0x5a')](_0xbb58('0x61'),_0x3cd96a[_0xbb58('0x62')],_0x3cd96a[_0xbb58('0x55')]))[_0xbb58('0x5e')](_0xbb58('0x5f')))};break;default:throw new db[(_0xbb58('0x63'))][(_0xbb58('0x64'))](_0xbb58('0x65'));}return rp(_0x52cf79);}})['then'](function(_0x502f55){if(_0x502f55){var _0x36e2eb=[_0xbb58('0x66'),_0xbb58('0x67'),'group',_0xbb58('0x68')];_[_0xbb58('0x69')](_0x502f55[_0xbb58('0x6a')],function(_0x494c33){return _0x36e2eb[_0xbb58('0x6b')](_0x494c33['type']);});return{'count':_0x502f55[_0xbb58('0x6a')]['length'],'rows':_[_0xbb58('0x2b')](_0x502f55[_0xbb58('0x6a')],function(_0xaf9d6){return{'id':_0xaf9d6['id'],'name':_0xaf9d6[_0xbb58('0x6c')]>0x7?_0xaf9d6[_0xbb58('0x6d')]:_0xaf9d6[_0xbb58('0x2f')],'custom':_0xaf9d6['position']>0x7?!![]:![],'options':_0xaf9d6['system_field_options']?_0xaf9d6[_0xbb58('0x6e')]:_0xaf9d6[_0xbb58('0x6f')]?_0xaf9d6['custom_field_options']:[]};})};}})[_0xbb58('0x24')](respondWithResult(_0x4bdc30,null))[_0xbb58('0x47')](function(_0x43eb15){var _0x5604d1=_0x50bf24[_0xbb58('0x31')]['test']?0x1f4:_0x43eb15[_0xbb58('0x70')]||0x1f4;logger[_0xbb58('0x26')](_0xbb58('0x71'),_0xbb58('0x72'),_0x5604d1,JSON[_0xbb58('0x73')](_0x43eb15));delete _0x43eb15[_0xbb58('0x28')];if(_0x5604d1===0x191){_0x5604d1=0x190;}_0x4bdc30[_0xbb58('0x1a')](_0x5604d1)['send'](_0x50bf24[_0xbb58('0x31')][_0xbb58('0x74')]?{'message':_0xbb58('0x75'),'statusCode':_0x43eb15['statusCode']}:_0x43eb15);});}; \ No newline at end of file +var _0x878f=['username','password','token','authType','remoteUri','substring','lastIndexOf','GET','format','%s/%s','ticket_fields','Basic\x20%s','%s:%s','toString','headers','%s/token:%s','base64','Sequelize','ValidationError','subject','description','group','assignee','includes','position','title','system_field_options','test','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','statusCode','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','json','offset','undefined','limit','count','status','Content-Range','apply','reject','save','update','then','error','name','send','index','ZendeskAccount','type','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','filters','catch','create','body','destroy','getConfigurations','findOne','ZendeskConfiguration','addConfiguration','getSubjects','channel','Descriptions','getDescriptions','ZendeskField','Subjects'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x878f,0x173));var _0xf878=function(_0x3625dc,_0x529523){_0x3625dc=_0x3625dc-0x0;var _0x25201f=_0x878f[_0x3625dc];return _0x25201f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf878('0x0'));var zipdir=require(_0xf878('0x1'));var jsonpatch=require(_0xf878('0x2'));var rp=require(_0xf878('0x3'));var moment=require(_0xf878('0x4'));var BPromise=require(_0xf878('0x5'));var Mustache=require(_0xf878('0x6'));var util=require(_0xf878('0x7'));var path=require(_0xf878('0x8'));var sox=require(_0xf878('0x9'));var csv=require(_0xf878('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf878('0xb'));var squel=require(_0xf878('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf878('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf878('0xd'));var authService=require(_0xf878('0xe'));var qs=require(_0xf878('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf878('0x10'));var logger=require(_0xf878('0x11'))('api');var utils=require(_0xf878('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xf878('0x13'));var db=require(_0xf878('0x14'))['db'];var integrations=require(_0xf878('0x15'));function respondWithStatusCode(_0x596fb5,_0x1ce004){_0x1ce004=_0x1ce004||0xcc;return function(_0x38eddf){if(_0x38eddf){return _0x596fb5[_0xf878('0x16')](_0x1ce004);}return _0x596fb5['status'](_0x1ce004)[_0xf878('0x17')]();};}function respondWithResult(_0x3902f7,_0x119e9e){_0x119e9e=_0x119e9e||0xc8;return function(_0x492260){if(_0x492260){return _0x3902f7['status'](_0x119e9e)[_0xf878('0x18')](_0x492260);}};}function respondWithFilteredResult(_0x35ff2d,_0x31d888){return function(_0x6dbeca){if(_0x6dbeca){var _0x44aacc=typeof _0x31d888[_0xf878('0x19')]===_0xf878('0x1a')&&typeof _0x31d888[_0xf878('0x1b')]===_0xf878('0x1a');var _0x3a55f3=_0x6dbeca[_0xf878('0x1c')];var _0x47a91a=_0x44aacc?0x0:_0x31d888[_0xf878('0x19')];var _0x34ae59=_0x44aacc?_0x6dbeca[_0xf878('0x1c')]:_0x31d888[_0xf878('0x19')]+_0x31d888[_0xf878('0x1b')];var _0x237d15;if(_0x34ae59>=_0x3a55f3){_0x34ae59=_0x3a55f3;_0x237d15=0xc8;}else{_0x237d15=0xce;}_0x35ff2d[_0xf878('0x1d')](_0x237d15);return _0x35ff2d['set'](_0xf878('0x1e'),_0x47a91a+'-'+_0x34ae59+'/'+_0x3a55f3)[_0xf878('0x18')](_0x6dbeca);}return null;};}function patchUpdates(_0x250f85){return function(_0x59efcb){try{jsonpatch[_0xf878('0x1f')](_0x59efcb,_0x250f85,!![]);}catch(_0x23590c){return BPromise[_0xf878('0x20')](_0x23590c);}return _0x59efcb[_0xf878('0x21')]();};}function saveUpdates(_0x22d884,_0x442450){return function(_0x1cbc92){if(_0x1cbc92){return _0x1cbc92[_0xf878('0x22')](_0x22d884)[_0xf878('0x23')](function(_0x1a6506){return _0x1a6506;});}return null;};}function removeEntity(_0x45e61f,_0x566995){return function(_0x2ac38b){if(_0x2ac38b){return _0x2ac38b['destroy']()[_0xf878('0x23')](function(){_0x45e61f[_0xf878('0x1d')](0xcc)[_0xf878('0x17')]();});}};}function handleEntityNotFound(_0x280036,_0x20449e){return function(_0x5ebaa0){if(!_0x5ebaa0){_0x280036['sendStatus'](0x194);}return _0x5ebaa0;};}function handleError(_0x59ba7b,_0x242926){_0x242926=_0x242926||0x1f4;return function(_0x3baba4){logger[_0xf878('0x24')](_0x3baba4['stack']);if(_0x3baba4[_0xf878('0x25')]){delete _0x3baba4[_0xf878('0x25')];}_0x59ba7b[_0xf878('0x1d')](_0x242926)[_0xf878('0x26')](_0x3baba4);};}exports[_0xf878('0x27')]=function(_0x5aff46,_0x502322){var _0x9a127d={},_0x5d9c97={},_0x4a0286={'count':0x0,'rows':[]};var _0x31e2e1=_['map'](db[_0xf878('0x28')]['rawAttributes'],function(_0x2c61c1){return{'name':_0x2c61c1['fieldName'],'type':_0x2c61c1[_0xf878('0x29')]['key']};});_0x5d9c97[_0xf878('0x2a')]=_[_0xf878('0x2b')](_0x31e2e1,_0xf878('0x25'));_0x5d9c97[_0xf878('0x2c')]=_[_0xf878('0x2d')](_0x5aff46[_0xf878('0x2c')]);_0x5d9c97['filters']=_[_0xf878('0x2e')](_0x5d9c97[_0xf878('0x2a')],_0x5d9c97[_0xf878('0x2c')]);_0x9a127d[_0xf878('0x2f')]=_[_0xf878('0x2e')](_0x5d9c97['model'],qs[_0xf878('0x30')](_0x5aff46[_0xf878('0x2c')]['fields']));_0x9a127d[_0xf878('0x2f')]=_0x9a127d[_0xf878('0x2f')][_0xf878('0x31')]?_0x9a127d[_0xf878('0x2f')]:_0x5d9c97[_0xf878('0x2a')];if(!_0x5aff46['query'][_0xf878('0x32')](_0xf878('0x33'))){_0x9a127d[_0xf878('0x1b')]=qs[_0xf878('0x1b')](_0x5aff46['query'][_0xf878('0x1b')]);_0x9a127d['offset']=qs['offset'](_0x5aff46[_0xf878('0x2c')][_0xf878('0x19')]);}_0x9a127d[_0xf878('0x34')]=qs[_0xf878('0x35')](_0x5aff46[_0xf878('0x2c')]['sort']);_0x9a127d[_0xf878('0x36')]=qs['filters'](_[_0xf878('0x37')](_0x5aff46[_0xf878('0x2c')],_0x5d9c97['filters']),_0x31e2e1);if(_0x5aff46[_0xf878('0x2c')][_0xf878('0x38')]){_0x9a127d['where']=_[_0xf878('0x39')](_0x9a127d[_0xf878('0x36')],{'$or':_['map'](_0x31e2e1,function(_0x4129c2){if(_0x4129c2[_0xf878('0x29')]!==_0xf878('0x3a')){var _0xc8eb91={};_0xc8eb91[_0x4129c2[_0xf878('0x25')]]={'$like':'%'+_0x5aff46[_0xf878('0x2c')][_0xf878('0x38')]+'%'};return _0xc8eb91;}})});}_0x9a127d=_['merge']({},_0x9a127d,_0x5aff46[_0xf878('0x3b')]);var _0x14340d={'where':_0x9a127d['where']};return db[_0xf878('0x28')]['count'](_0x14340d)['then'](function(_0x2ec109){_0x4a0286[_0xf878('0x1c')]=_0x2ec109;if(_0x5aff46[_0xf878('0x2c')][_0xf878('0x3c')]){_0x9a127d[_0xf878('0x3d')]=[{'all':!![]}];}return db['ZendeskAccount'][_0xf878('0x3e')](_0x9a127d);})['then'](function(_0xb09736){_0x4a0286[_0xf878('0x3f')]=_0xb09736;return _0x4a0286;})['then'](respondWithFilteredResult(_0x502322,_0x9a127d))['catch'](handleError(_0x502322,null));};exports[_0xf878('0x40')]=function(_0x2a66c1,_0x13fcd3){var _0x2f6ee5={'raw':![],'where':{'id':_0x2a66c1[_0xf878('0x41')]['id']}},_0x5d6e03={};_0x5d6e03[_0xf878('0x2a')]=_[_0xf878('0x2d')](db[_0xf878('0x28')]['rawAttributes']);_0x5d6e03[_0xf878('0x2c')]=_[_0xf878('0x2d')](_0x2a66c1[_0xf878('0x2c')]);_0x5d6e03[_0xf878('0x42')]=_[_0xf878('0x2e')](_0x5d6e03[_0xf878('0x2a')],_0x5d6e03['query']);_0x2f6ee5[_0xf878('0x2f')]=_[_0xf878('0x2e')](_0x5d6e03[_0xf878('0x2a')],qs[_0xf878('0x30')](_0x2a66c1[_0xf878('0x2c')]['fields']));_0x2f6ee5[_0xf878('0x2f')]=_0x2f6ee5[_0xf878('0x2f')][_0xf878('0x31')]?_0x2f6ee5[_0xf878('0x2f')]:_0x5d6e03['model'];if(_0x2a66c1[_0xf878('0x2c')][_0xf878('0x3c')]){_0x2f6ee5[_0xf878('0x3d')]=[{'all':!![]}];}_0x2f6ee5=_['merge']({},_0x2f6ee5,_0x2a66c1['options']);return db[_0xf878('0x28')]['find'](_0x2f6ee5)['then'](handleEntityNotFound(_0x13fcd3,null))['then'](respondWithResult(_0x13fcd3,null))[_0xf878('0x43')](handleError(_0x13fcd3,null));};exports['create']=function(_0x156fdb,_0x450a10){return db[_0xf878('0x28')][_0xf878('0x44')](_0x156fdb[_0xf878('0x45')],{})[_0xf878('0x23')](respondWithResult(_0x450a10,0xc9))[_0xf878('0x43')](handleError(_0x450a10,null));};exports['update']=function(_0xb0bf4c,_0x361ac8){if(_0xb0bf4c[_0xf878('0x45')]['id']){delete _0xb0bf4c[_0xf878('0x45')]['id'];}return db[_0xf878('0x28')]['find']({'where':{'id':_0xb0bf4c['params']['id']}})[_0xf878('0x23')](handleEntityNotFound(_0x361ac8,null))[_0xf878('0x23')](saveUpdates(_0xb0bf4c['body'],null))[_0xf878('0x23')](respondWithResult(_0x361ac8,null))['catch'](handleError(_0x361ac8,null));};exports[_0xf878('0x46')]=function(_0x31adde,_0x379912){return db[_0xf878('0x28')]['find']({'where':{'id':_0x31adde[_0xf878('0x41')]['id']}})[_0xf878('0x23')](handleEntityNotFound(_0x379912,null))[_0xf878('0x23')](removeEntity(_0x379912,null))['catch'](handleError(_0x379912,null));};exports[_0xf878('0x47')]=function(_0x30df05,_0x1d3427,_0x28c393){var _0x53e3c3={};var _0x112f2a={};var _0x181f09;var _0x3f9fce;return db['ZendeskAccount'][_0xf878('0x48')]({'where':{'id':_0x30df05[_0xf878('0x41')]['id']}})[_0xf878('0x23')](handleEntityNotFound(_0x1d3427,null))[_0xf878('0x23')](function(_0x5118f4){if(_0x5118f4){_0x181f09=_0x5118f4;_0x112f2a['model']=_['keys'](db[_0xf878('0x49')]['rawAttributes']);_0x112f2a['query']=_['keys'](_0x30df05[_0xf878('0x2c')]);_0x112f2a[_0xf878('0x42')]=_['intersection'](_0x112f2a[_0xf878('0x2a')],_0x112f2a[_0xf878('0x2c')]);_0x53e3c3[_0xf878('0x2f')]=_['intersection'](_0x112f2a['model'],qs[_0xf878('0x30')](_0x30df05['query'][_0xf878('0x30')]));_0x53e3c3[_0xf878('0x2f')]=_0x53e3c3[_0xf878('0x2f')][_0xf878('0x31')]?_0x53e3c3[_0xf878('0x2f')]:_0x112f2a[_0xf878('0x2a')];_0x53e3c3['order']=qs[_0xf878('0x35')](_0x30df05[_0xf878('0x2c')]['sort']);_0x53e3c3[_0xf878('0x36')]=qs[_0xf878('0x42')](_[_0xf878('0x37')](_0x30df05[_0xf878('0x2c')],_0x112f2a[_0xf878('0x42')]));if(_0x30df05[_0xf878('0x2c')][_0xf878('0x38')]){_0x53e3c3['where']=_[_0xf878('0x39')](_0x53e3c3[_0xf878('0x36')],{'$or':_[_0xf878('0x2b')](_0x53e3c3['attributes'],function(_0x392242){var _0x560e0b={};_0x560e0b[_0x392242]={'$like':'%'+_0x30df05[_0xf878('0x2c')][_0xf878('0x38')]+'%'};return _0x560e0b;})});}_0x53e3c3=_[_0xf878('0x39')]({},_0x53e3c3,_0x30df05[_0xf878('0x3b')]);return _0x181f09[_0xf878('0x47')](_0x53e3c3);}})[_0xf878('0x23')](function(_0x1141dd){if(_0x1141dd){_0x3f9fce=_0x1141dd[_0xf878('0x31')];if(!_0x30df05[_0xf878('0x2c')][_0xf878('0x32')]('nolimit')){_0x53e3c3['limit']=qs['limit'](_0x30df05[_0xf878('0x2c')]['limit']);_0x53e3c3[_0xf878('0x19')]=qs[_0xf878('0x19')](_0x30df05['query']['offset']);}return _0x181f09[_0xf878('0x47')](_0x53e3c3);}})[_0xf878('0x23')](function(_0x3340c1){if(_0x3340c1){return _0x3340c1?{'count':_0x3f9fce,'rows':_0x3340c1}:null;}})[_0xf878('0x23')](respondWithResult(_0x1d3427,null))[_0xf878('0x43')](handleError(_0x1d3427,null));};exports[_0xf878('0x4a')]=function(_0x3e78fc,_0x302258,_0x1602ed){if(_0x3e78fc[_0xf878('0x45')]['id']){delete _0x3e78fc[_0xf878('0x45')]['id'];}return db[_0xf878('0x28')][_0xf878('0x48')]({'where':{'id':_0x3e78fc[_0xf878('0x41')]['id']}})[_0xf878('0x23')](handleEntityNotFound(_0x302258,null))[_0xf878('0x23')](function(_0x1254dd){if(_0x1254dd){_0x3e78fc[_0xf878('0x45')]['AccountId']=_0x1254dd['id'];_0x3e78fc[_0xf878('0x45')]['Subjects']=integrations[_0xf878('0x4b')](_0x3e78fc[_0xf878('0x45')][_0xf878('0x4c')],_0x3e78fc[_0xf878('0x45')][_0xf878('0x29')]);_0x3e78fc[_0xf878('0x45')][_0xf878('0x4d')]=integrations[_0xf878('0x4e')](_0x3e78fc[_0xf878('0x45')]['channel'],_0x3e78fc[_0xf878('0x45')][_0xf878('0x29')]);return db[_0xf878('0x49')][_0xf878('0x44')](_0x3e78fc['body'],{'include':[{'model':db[_0xf878('0x4f')],'as':_0xf878('0x50')},{'model':db[_0xf878('0x4f')],'as':_0xf878('0x4d')}]});}return null;})[_0xf878('0x23')](respondWithResult(_0x302258,null))['catch'](handleError(_0x302258,null));};exports['getFields']=function(_0x453644,_0x1b0230,_0x193f6c){var _0x251613='';return db[_0xf878('0x28')][_0xf878('0x48')]({'where':{'id':_0x453644[_0xf878('0x41')]['id']},'attributes':['id',_0xf878('0x51'),_0xf878('0x52'),_0xf878('0x53'),_0xf878('0x54'),_0xf878('0x55')]})[_0xf878('0x23')](handleEntityNotFound(_0x1b0230,null))[_0xf878('0x23')](function(_0x3bfd00){if(_0x3bfd00){_0x251613=_0x3bfd00[_0xf878('0x55')];var _0x153069=_0x251613['slice'](-0x1);if(_0x153069==='/'){_0x251613=_0x251613[_0xf878('0x56')](0x0,_0x251613[_0xf878('0x57')](_0x153069));}var _0x288235={'method':_0xf878('0x58'),'uri':util[_0xf878('0x59')](_0xf878('0x5a'),_0x251613,_0xf878('0x5b')),'json':!![]};switch(_0x3bfd00[_0xf878('0x54')]){case _0xf878('0x52'):_0x288235['headers']={'Authorization':util[_0xf878('0x59')](_0xf878('0x5c'),new Buffer(util[_0xf878('0x59')](_0xf878('0x5d'),_0x3bfd00[_0xf878('0x51')],_0x3bfd00[_0xf878('0x52')]))[_0xf878('0x5e')]('base64'))};break;case'token':_0x288235[_0xf878('0x5f')]={'Authorization':util['format'](_0xf878('0x5c'),new Buffer(util[_0xf878('0x59')](_0xf878('0x60'),_0x3bfd00[_0xf878('0x51')],_0x3bfd00['token']))[_0xf878('0x5e')](_0xf878('0x61')))};break;default:throw new db[(_0xf878('0x62'))][(_0xf878('0x63'))]('Unknown\x20authentication\x20type');}return rp(_0x288235);}})[_0xf878('0x23')](function(_0x565e8c){if(_0x565e8c){var _0x21537f=[_0xf878('0x64'),_0xf878('0x65'),_0xf878('0x66'),_0xf878('0x67')];_['remove'](_0x565e8c[_0xf878('0x5b')],function(_0x21c5d1){return _0x21537f[_0xf878('0x68')](_0x21c5d1[_0xf878('0x29')]);});return{'count':_0x565e8c['ticket_fields'][_0xf878('0x31')],'rows':_['map'](_0x565e8c[_0xf878('0x5b')],function(_0x107456){return{'id':_0x107456['id'],'name':_0x107456[_0xf878('0x69')]>0x7?_0x107456[_0xf878('0x6a')]:_0x107456[_0xf878('0x29')],'custom':_0x107456[_0xf878('0x69')]>0x7?!![]:![],'options':_0x107456[_0xf878('0x6b')]?_0x107456[_0xf878('0x6b')]:_0x107456['custom_field_options']?_0x107456['custom_field_options']:[]};})};}})['then'](respondWithResult(_0x1b0230,null))[_0xf878('0x43')](function(_0x1a9af7){var _0x497b7a=_0x453644['query'][_0xf878('0x6c')]?0x1f4:_0x1a9af7['statusCode']||0x1f4;logger[_0xf878('0x24')](_0xf878('0x6d'),_0xf878('0x6e'),_0x497b7a,JSON[_0xf878('0x6f')](_0x1a9af7));delete _0x1a9af7[_0xf878('0x25')];if(_0x497b7a===0x191){_0x497b7a=0x190;}_0x1b0230[_0xf878('0x1d')](_0x497b7a)[_0xf878('0x26')](_0x453644[_0xf878('0x2c')][_0xf878('0x6c')]?{'message':'Wrong\x20credentials','statusCode':_0x1a9af7[_0xf878('0x70')]}:_0x1a9af7);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index d5672fa..2ef3419 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 _0xb58b=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','define','int_zendesk_accounts'];(function(_0x6c9b2c,_0x2e1e98){var _0x2dbb9c=function(_0x421b99){while(--_0x421b99){_0x6c9b2c['push'](_0x6c9b2c['shift']());}};_0x2dbb9c(++_0x2e1e98);}(_0xb58b,0xee));var _0xbb58=function(_0x1216af,_0x256750){_0x1216af=_0x1216af-0x0;var _0x50b02a=_0xb58b[_0x1216af];return _0x50b02a;};'use strict';var _=require(_0xbb58('0x0'));var util=require('util');var logger=require(_0xbb58('0x1'))(_0xbb58('0x2'));var moment=require(_0xbb58('0x3'));var BPromise=require(_0xbb58('0x4'));var rp=require(_0xbb58('0x5'));var fs=require('fs');var path=require(_0xbb58('0x6'));var rimraf=require(_0xbb58('0x7'));var config=require(_0xbb58('0x8'));var attributes=require(_0xbb58('0x9'));var integrations=require(_0xbb58('0xa'));module[_0xbb58('0xb')]=function(_0x3b36d0,_0xadbb2e){return _0x3b36d0[_0xbb58('0xc')]('ZendeskAccount',attributes,{'tableName':_0xbb58('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9ad1=['../../config/environment','./intZendeskAccount.attributes','exports','define','ZendeskAccount','int_zendesk_accounts','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x3fd724,_0x197795){var _0x4cbcc3=function(_0x3d5a23){while(--_0x3d5a23){_0x3fd724['push'](_0x3fd724['shift']());}};_0x4cbcc3(++_0x197795);}(_0x9ad1,0x13a));var _0x19ad=function(_0x461cbc,_0x2e6552){_0x461cbc=_0x461cbc-0x0;var _0x33d98a=_0x9ad1[_0x461cbc];return _0x33d98a;};'use strict';var _=require(_0x19ad('0x0'));var util=require(_0x19ad('0x1'));var logger=require(_0x19ad('0x2'))('api');var moment=require(_0x19ad('0x3'));var BPromise=require(_0x19ad('0x4'));var rp=require(_0x19ad('0x5'));var fs=require('fs');var path=require(_0x19ad('0x6'));var rimraf=require(_0x19ad('0x7'));var config=require(_0x19ad('0x8'));var attributes=require(_0x19ad('0x9'));var integrations=require('../../components/integrations/configuration');module[_0x19ad('0xa')]=function(_0x1cdafc,_0x2bb4b8){return _0x1cdafc[_0x19ad('0xb')](_0x19ad('0xc'),attributes,{'tableName':_0x19ad('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 97f7ecb..3b2ddb9 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 _0xa7f4=['info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','ZendeskAccount','findAll','options','raw','where','attributes','limit','model','map','include','GetZendeskAccount','ShowZendeskAccount','find','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x35b6ad,_0x4e6fcf){var _0x2ea92a=function(_0x36f8a1){while(--_0x36f8a1){_0x35b6ad['push'](_0x35b6ad['shift']());}};_0x2ea92a(++_0x4e6fcf);}(_0xa7f4,0xa7));var _0x4a7f=function(_0x1505a0,_0x47fb23){_0x1505a0=_0x1505a0-0x0;var _0x45b3c0=_0xa7f4[_0x1505a0];return _0x45b3c0;};'use strict';var _=require('lodash');var util=require(_0x4a7f('0x0'));var moment=require(_0x4a7f('0x1'));var BPromise=require(_0x4a7f('0x2'));var rs=require(_0x4a7f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4a7f('0x4'));var logger=require(_0x4a7f('0x5'))(_0x4a7f('0x6'));var config=require(_0x4a7f('0x7'));var jayson=require(_0x4a7f('0x8'));var client=jayson[_0x4a7f('0x9')][_0x4a7f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4464ad,_0x330237,_0x28e2bb){return new BPromise(function(_0x22224b,_0x181c1e){return client[_0x4a7f('0xb')](_0x4464ad,_0x28e2bb)[_0x4a7f('0xc')](function(_0x4500e){logger[_0x4a7f('0xd')](_0x4a7f('0xe'),_0x330237,_0x4a7f('0xf'));logger[_0x4a7f('0x10')]('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0x330237,_0x4a7f('0xf'),JSON[_0x4a7f('0x11')](_0x4500e));if(_0x4500e[_0x4a7f('0x12')]){if(_0x4500e[_0x4a7f('0x12')][_0x4a7f('0x13')]===0x1f4){logger[_0x4a7f('0x12')](_0x4a7f('0xe'),_0x330237,_0x4500e['error'][_0x4a7f('0x14')]);return _0x181c1e(_0x4500e[_0x4a7f('0x12')][_0x4a7f('0x14')]);}logger[_0x4a7f('0x12')](_0x4a7f('0xe'),_0x330237,_0x4500e['error'][_0x4a7f('0x14')]);return _0x22224b(_0x4500e['error']['message']);}else{logger[_0x4a7f('0xd')](_0x4a7f('0xe'),_0x330237,_0x4a7f('0xf'));_0x22224b(_0x4500e[_0x4a7f('0x15')][_0x4a7f('0x14')]);}})[_0x4a7f('0x16')](function(_0x1e8f02){logger[_0x4a7f('0x12')](_0x4a7f('0xe'),_0x330237,_0x1e8f02);_0x181c1e(_0x1e8f02);});});}exports['GetZendeskAccount']=function(_0x215c2f){var _0x186cfb=this;return new Promise(function(_0x1a1145,_0x2f876b){return db[_0x4a7f('0x17')][_0x4a7f('0x18')]({'raw':_0x215c2f[_0x4a7f('0x19')]?_0x215c2f[_0x4a7f('0x19')][_0x4a7f('0x1a')]===undefined?!![]:![]:!![],'where':_0x215c2f['options']?_0x215c2f['options'][_0x4a7f('0x1b')]||null:null,'attributes':_0x215c2f[_0x4a7f('0x19')]?_0x215c2f['options'][_0x4a7f('0x1c')]||null:null,'limit':_0x215c2f['options']?_0x215c2f['options'][_0x4a7f('0x1d')]||null:null,'include':_0x215c2f['options']?_0x215c2f[_0x4a7f('0x19')]['include']?_['map'](_0x215c2f[_0x4a7f('0x19')]['include'],function(_0x5b687e){return{'model':db[_0x5b687e[_0x4a7f('0x1e')]],'as':_0x5b687e['as'],'attributes':_0x5b687e[_0x4a7f('0x1c')],'include':_0x5b687e['include']?_[_0x4a7f('0x1f')](_0x5b687e[_0x4a7f('0x20')],function(_0x533ddf){return{'model':db[_0x533ddf['model']],'as':_0x533ddf['as'],'attributes':_0x533ddf[_0x4a7f('0x1c')],'include':_0x533ddf[_0x4a7f('0x20')]?_[_0x4a7f('0x1f')](_0x533ddf[_0x4a7f('0x20')],function(_0x1028d7){return{'model':db[_0x1028d7['model']],'as':_0x1028d7['as'],'attributes':_0x1028d7[_0x4a7f('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x4a7f('0xc')](function(_0xcc037e){logger['info'](_0x4a7f('0x21'),_0x215c2f);logger[_0x4a7f('0x10')](_0x4a7f('0x21'),_0x215c2f,JSON[_0x4a7f('0x11')](_0xcc037e));_0x1a1145(_0xcc037e);})['catch'](function(_0x4f7591){logger[_0x4a7f('0x12')]('GetZendeskAccount',_0x4f7591[_0x4a7f('0x14')],_0x215c2f);_0x2f876b(_0x186cfb[_0x4a7f('0x12')](0x1f4,_0x4f7591[_0x4a7f('0x14')]));});});};exports[_0x4a7f('0x22')]=function(_0x3fc859){var _0x236b3f=this;return new Promise(function(_0xf77437,_0x17d995){return db[_0x4a7f('0x17')][_0x4a7f('0x23')]({'raw':_0x3fc859['options']?_0x3fc859['options']['raw']===undefined?!![]:![]:!![],'where':_0x3fc859[_0x4a7f('0x19')]?_0x3fc859[_0x4a7f('0x19')][_0x4a7f('0x1b')]||null:null,'attributes':_0x3fc859[_0x4a7f('0x19')]?_0x3fc859['options'][_0x4a7f('0x1c')]||null:null,'include':_0x3fc859[_0x4a7f('0x19')]?_0x3fc859[_0x4a7f('0x19')][_0x4a7f('0x20')]?_[_0x4a7f('0x1f')](_0x3fc859[_0x4a7f('0x19')][_0x4a7f('0x20')],function(_0x518191){return{'model':db[_0x518191['model']],'as':_0x518191['as'],'attributes':_0x518191[_0x4a7f('0x1c')],'include':_0x518191['include']?_[_0x4a7f('0x1f')](_0x518191[_0x4a7f('0x20')],function(_0xc10300){return{'model':db[_0xc10300[_0x4a7f('0x1e')]],'as':_0xc10300['as'],'attributes':_0xc10300['attributes'],'include':_0xc10300[_0x4a7f('0x20')]?_[_0x4a7f('0x1f')](_0xc10300['include'],function(_0x3eda5c){return{'model':db[_0x3eda5c[_0x4a7f('0x1e')]],'as':_0x3eda5c['as'],'attributes':_0x3eda5c['attributes']};}):[]};}):[]};}):[]:[]})[_0x4a7f('0xc')](function(_0x57acf6){logger['info'](_0x4a7f('0x22'),_0x3fc859);logger[_0x4a7f('0x10')](_0x4a7f('0x22'),_0x3fc859,JSON[_0x4a7f('0x11')](_0x57acf6));_0xf77437(_0x57acf6);})['catch'](function(_0x433dda){logger[_0x4a7f('0x12')](_0x4a7f('0x22'),_0x433dda['message'],_0x3fc859);_0x17d995(_0x236b3f[_0x4a7f('0x12')](0x1f4,_0x433dda[_0x4a7f('0x14')]));});});}; \ No newline at end of file +var _0x20ae=['limit','include','map','model','ShowZendeskAccount','find','then','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','GetZendeskAccount','ZendeskAccount','options','where','attributes'];(function(_0x408eb1,_0x46e892){var _0x554531=function(_0x3063a9){while(--_0x3063a9){_0x408eb1['push'](_0x408eb1['shift']());}};_0x554531(++_0x46e892);}(_0x20ae,0x120));var _0xe20a=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x20ae[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0xe20a('0x0'));var util=require(_0xe20a('0x1'));var moment=require('moment');var BPromise=require(_0xe20a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe20a('0x3'));var db=require(_0xe20a('0x4'))['db'];var utils=require(_0xe20a('0x5'));var logger=require(_0xe20a('0x6'))(_0xe20a('0x7'));var config=require(_0xe20a('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe20a('0x9')][_0xe20a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x518a98,_0x7cb0d7,_0x992662){return new BPromise(function(_0x4545e2,_0x21c7f0){return client[_0xe20a('0xb')](_0x518a98,_0x992662)['then'](function(_0x247d65){logger['info'](_0xe20a('0xc'),_0x7cb0d7,_0xe20a('0xd'));logger[_0xe20a('0xe')](_0xe20a('0xf'),_0x7cb0d7,'request\x20sent',JSON[_0xe20a('0x10')](_0x247d65));if(_0x247d65[_0xe20a('0x11')]){if(_0x247d65[_0xe20a('0x11')][_0xe20a('0x12')]===0x1f4){logger[_0xe20a('0x11')]('ZendeskAccount,\x20%s,\x20%s',_0x7cb0d7,_0x247d65[_0xe20a('0x11')][_0xe20a('0x13')]);return _0x21c7f0(_0x247d65['error'][_0xe20a('0x13')]);}logger[_0xe20a('0x11')](_0xe20a('0xc'),_0x7cb0d7,_0x247d65[_0xe20a('0x11')]['message']);return _0x4545e2(_0x247d65[_0xe20a('0x11')][_0xe20a('0x13')]);}else{logger[_0xe20a('0x14')](_0xe20a('0xc'),_0x7cb0d7,'request\x20sent');_0x4545e2(_0x247d65[_0xe20a('0x15')][_0xe20a('0x13')]);}})['catch'](function(_0xc9b3e0){logger[_0xe20a('0x11')](_0xe20a('0xc'),_0x7cb0d7,_0xc9b3e0);_0x21c7f0(_0xc9b3e0);});});}exports[_0xe20a('0x16')]=function(_0xd342a){var _0x5f4335=this;return new Promise(function(_0x2890b3,_0x5164fc){return db[_0xe20a('0x17')]['findAll']({'raw':_0xd342a[_0xe20a('0x18')]?_0xd342a[_0xe20a('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0xd342a[_0xe20a('0x18')]?_0xd342a[_0xe20a('0x18')][_0xe20a('0x19')]||null:null,'attributes':_0xd342a['options']?_0xd342a[_0xe20a('0x18')][_0xe20a('0x1a')]||null:null,'limit':_0xd342a[_0xe20a('0x18')]?_0xd342a[_0xe20a('0x18')][_0xe20a('0x1b')]||null:null,'include':_0xd342a[_0xe20a('0x18')]?_0xd342a[_0xe20a('0x18')][_0xe20a('0x1c')]?_[_0xe20a('0x1d')](_0xd342a[_0xe20a('0x18')][_0xe20a('0x1c')],function(_0x102933){return{'model':db[_0x102933[_0xe20a('0x1e')]],'as':_0x102933['as'],'attributes':_0x102933['attributes'],'include':_0x102933['include']?_[_0xe20a('0x1d')](_0x102933[_0xe20a('0x1c')],function(_0x49f41f){return{'model':db[_0x49f41f[_0xe20a('0x1e')]],'as':_0x49f41f['as'],'attributes':_0x49f41f[_0xe20a('0x1a')],'include':_0x49f41f[_0xe20a('0x1c')]?_['map'](_0x49f41f[_0xe20a('0x1c')],function(_0x450b86){return{'model':db[_0x450b86[_0xe20a('0x1e')]],'as':_0x450b86['as'],'attributes':_0x450b86['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2de7ad){logger[_0xe20a('0x14')](_0xe20a('0x16'),_0xd342a);logger['debug'](_0xe20a('0x16'),_0xd342a,JSON['stringify'](_0x2de7ad));_0x2890b3(_0x2de7ad);})['catch'](function(_0x16bfe3){logger[_0xe20a('0x11')](_0xe20a('0x16'),_0x16bfe3['message'],_0xd342a);_0x5164fc(_0x5f4335[_0xe20a('0x11')](0x1f4,_0x16bfe3[_0xe20a('0x13')]));});});};exports[_0xe20a('0x1f')]=function(_0x3eddfd){var _0x274fa3=this;return new Promise(function(_0x4df811,_0x2be362){return db[_0xe20a('0x17')][_0xe20a('0x20')]({'raw':_0x3eddfd[_0xe20a('0x18')]?_0x3eddfd['options']['raw']===undefined?!![]:![]:!![],'where':_0x3eddfd[_0xe20a('0x18')]?_0x3eddfd[_0xe20a('0x18')][_0xe20a('0x19')]||null:null,'attributes':_0x3eddfd[_0xe20a('0x18')]?_0x3eddfd[_0xe20a('0x18')][_0xe20a('0x1a')]||null:null,'include':_0x3eddfd[_0xe20a('0x18')]?_0x3eddfd[_0xe20a('0x18')][_0xe20a('0x1c')]?_[_0xe20a('0x1d')](_0x3eddfd[_0xe20a('0x18')][_0xe20a('0x1c')],function(_0x3d6a83){return{'model':db[_0x3d6a83[_0xe20a('0x1e')]],'as':_0x3d6a83['as'],'attributes':_0x3d6a83[_0xe20a('0x1a')],'include':_0x3d6a83[_0xe20a('0x1c')]?_[_0xe20a('0x1d')](_0x3d6a83[_0xe20a('0x1c')],function(_0x58a78a){return{'model':db[_0x58a78a[_0xe20a('0x1e')]],'as':_0x58a78a['as'],'attributes':_0x58a78a[_0xe20a('0x1a')],'include':_0x58a78a[_0xe20a('0x1c')]?_['map'](_0x58a78a['include'],function(_0x3fe789){return{'model':db[_0x3fe789[_0xe20a('0x1e')]],'as':_0x3fe789['as'],'attributes':_0x3fe789['attributes']};}):[]};}):[]};}):[]:[]})[_0xe20a('0x21')](function(_0x76ce1f){logger[_0xe20a('0x14')](_0xe20a('0x1f'),_0x3eddfd);logger[_0xe20a('0xe')](_0xe20a('0x1f'),_0x3eddfd,JSON[_0xe20a('0x10')](_0x76ce1f));_0x4df811(_0x76ce1f);})[_0xe20a('0x22')](function(_0x185cb7){logger[_0xe20a('0x11')]('ShowZendeskAccount',_0x185cb7[_0xe20a('0x13')],_0x3eddfd);_0x2be362(_0x274fa3['error'](0x1f4,_0x185cb7[_0xe20a('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index 7e0b76e..e09659a 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 _0xda3f=['../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','/:id/tags','post','create','put','destroy','exports','util','path','fs-extra','../../components/interaction/service'];(function(_0x1bb491,_0x52431c){var _0x17bb64=function(_0x2ef7d6){while(--_0x2ef7d6){_0x1bb491['push'](_0x1bb491['shift']());}};_0x17bb64(++_0x52431c);}(_0xda3f,0xec));var _0xfda3=function(_0x5a5b18,_0x2e2f00){_0x5a5b18=_0x5a5b18-0x0;var _0xcd940b=_0xda3f[_0x5a5b18];return _0xcd940b;};'use strict';var multer=require('multer');var util=require(_0xfda3('0x0'));var path=require(_0xfda3('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xfda3('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xfda3('0x3'));var config=require(_0xfda3('0x4'));var controller=require('./intZendeskConfiguration.controller');router[_0xfda3('0x5')]('/',auth[_0xfda3('0x6')](),controller['index']);router['get'](_0xfda3('0x7'),auth[_0xfda3('0x6')](),controller[_0xfda3('0x8')]);router[_0xfda3('0x5')](_0xfda3('0x9'),auth[_0xfda3('0x6')](),controller[_0xfda3('0xa')]);router[_0xfda3('0x5')](_0xfda3('0xb'),auth[_0xfda3('0x6')](),controller[_0xfda3('0xc')]);router[_0xfda3('0x5')]('/:id/descriptions',auth[_0xfda3('0x6')](),controller[_0xfda3('0xd')]);router[_0xfda3('0x5')](_0xfda3('0xe'),auth[_0xfda3('0x6')](),controller['getTags']);router[_0xfda3('0xf')]('/',auth['isAuthenticated'](),controller[_0xfda3('0x10')]);router[_0xfda3('0xf')]('/:id/tags',auth['isAuthenticated'](),controller['setTags']);router[_0xfda3('0x11')](_0xfda3('0x7'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xfda3('0x7'),auth[_0xfda3('0x6')](),controller[_0xfda3('0x12')]);module[_0xfda3('0x13')]=router; \ No newline at end of file +var _0xb7e7=['delete','destroy','exports','multer','path','express','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','index','get','/:id','show','/:id/fields','isAuthenticated','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','create','put','update'];(function(_0x1e3c16,_0x372caa){var _0x47a0c9=function(_0x47f81d){while(--_0x47f81d){_0x1e3c16['push'](_0x1e3c16['shift']());}};_0x47a0c9(++_0x372caa);}(_0xb7e7,0x121));var _0x7b7e=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0xb7e7[_0x164eca];return _0x2ce562;};'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 fs_extra=require(_0x7b7e('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var controller=require(_0x7b7e('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x7b7e('0x7')]);router[_0x7b7e('0x8')](_0x7b7e('0x9'),auth['isAuthenticated'](),controller[_0x7b7e('0xa')]);router[_0x7b7e('0x8')](_0x7b7e('0xb'),auth[_0x7b7e('0xc')](),controller[_0x7b7e('0xd')]);router[_0x7b7e('0x8')](_0x7b7e('0xe'),auth['isAuthenticated'](),controller[_0x7b7e('0xf')]);router[_0x7b7e('0x8')](_0x7b7e('0x10'),auth[_0x7b7e('0xc')](),controller[_0x7b7e('0x11')]);router[_0x7b7e('0x8')](_0x7b7e('0x12'),auth[_0x7b7e('0xc')](),controller[_0x7b7e('0x13')]);router['post']('/',auth[_0x7b7e('0xc')](),controller[_0x7b7e('0x14')]);router['post'](_0x7b7e('0x12'),auth['isAuthenticated'](),controller['setTags']);router[_0x7b7e('0x15')](_0x7b7e('0x9'),auth[_0x7b7e('0xc')](),controller[_0x7b7e('0x16')]);router[_0x7b7e('0x17')]('/:id',auth['isAuthenticated'](),controller[_0x7b7e('0x18')]);module[_0x7b7e('0x19')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index 68b9ae6..ed54ca6 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 _0x4a0a=['STRING','sequelize'];(function(_0x1c0859,_0x19dffa){var _0x40aa60=function(_0x1c8fa8){while(--_0x1c8fa8){_0x1c0859['push'](_0x1c0859['shift']());}};_0x40aa60(++_0x19dffa);}(_0x4a0a,0x69));var _0xa4a0=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0x4a0a[_0x3ab9ee];return _0x82ee88;};'use strict';var Sequelize=require(_0xa4a0('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xa4a0('0x1')]}}; \ No newline at end of file +var _0x1a31=['STRING'];(function(_0x15b66d,_0x314999){var _0x134140=function(_0x2c928a){while(--_0x2c928a){_0x15b66d['push'](_0x15b66d['shift']());}};_0x134140(++_0x314999);}(_0x1a31,0x1d4));var _0x11a3=function(_0x39c734,_0x2f3e06){_0x39c734=_0x39c734-0x0;var _0xb2a2f9=_0x1a31[_0x39c734];return _0xb2a2f9;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x11a3('0x0')]},'description':{'type':Sequelize[_0x11a3('0x0')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index 7c71ed8..bb61657 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 _0x9ff7=['sendStatus','end','status','json','limit','undefined','count','set','Content-Range','reject','save','update','destroy','then','error','stack','name','send','index','map','ZendeskConfiguration','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','find','create','body','params','getFields','findOne','ZendeskField','pick','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x18fb16,_0x45edbc){var _0x147b0d=function(_0x5b1b00){while(--_0x5b1b00){_0x18fb16['push'](_0x18fb16['shift']());}};_0x147b0d(++_0x45edbc);}(_0x9ff7,0x93));var _0x79ff=function(_0x242919,_0x2e78ef){_0x242919=_0x242919-0x0;var _0xcc5fdb=_0x9ff7[_0x242919];return _0xcc5fdb;};'use strict';var emlformat=require(_0x79ff('0x0'));var rimraf=require(_0x79ff('0x1'));var zipdir=require(_0x79ff('0x2'));var jsonpatch=require(_0x79ff('0x3'));var rp=require(_0x79ff('0x4'));var moment=require('moment');var BPromise=require(_0x79ff('0x5'));var Mustache=require(_0x79ff('0x6'));var util=require(_0x79ff('0x7'));var path=require('path');var sox=require(_0x79ff('0x8'));var csv=require(_0x79ff('0x9'));var ejs=require(_0x79ff('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x79ff('0xb'));var crypto=require(_0x79ff('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x79ff('0x9'));var querystring=require(_0x79ff('0xd'));var Papa=require('papaparse');var Redis=require(_0x79ff('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x79ff('0xf'));var as=require(_0x79ff('0x10'));var hardwareService=require(_0x79ff('0x11'));var logger=require('../../config/logger')(_0x79ff('0x12'));var utils=require(_0x79ff('0x13'));var config=require(_0x79ff('0x14'));var licenseUtil=require(_0x79ff('0x15'));var db=require(_0x79ff('0x16'))['db'];function respondWithStatusCode(_0x3472ed,_0x12c5f7){_0x12c5f7=_0x12c5f7||0xcc;return function(_0x2c6f13){if(_0x2c6f13){return _0x3472ed[_0x79ff('0x17')](_0x12c5f7);}return _0x3472ed['status'](_0x12c5f7)[_0x79ff('0x18')]();};}function respondWithResult(_0x268d9d,_0x596930){_0x596930=_0x596930||0xc8;return function(_0x1daf17){if(_0x1daf17){return _0x268d9d[_0x79ff('0x19')](_0x596930)[_0x79ff('0x1a')](_0x1daf17);}};}function respondWithFilteredResult(_0x42feec,_0x3876bd){return function(_0x1f3ecb){if(_0x1f3ecb){var _0x5a8873=typeof _0x3876bd['offset']==='undefined'&&typeof _0x3876bd[_0x79ff('0x1b')]===_0x79ff('0x1c');var _0x58736d=_0x1f3ecb['count'];var _0x218ac0=_0x5a8873?0x0:_0x3876bd['offset'];var _0x4ecc8d=_0x5a8873?_0x1f3ecb[_0x79ff('0x1d')]:_0x3876bd['offset']+_0x3876bd[_0x79ff('0x1b')];var _0x345b98;if(_0x4ecc8d>=_0x58736d){_0x4ecc8d=_0x58736d;_0x345b98=0xc8;}else{_0x345b98=0xce;}_0x42feec[_0x79ff('0x19')](_0x345b98);return _0x42feec[_0x79ff('0x1e')](_0x79ff('0x1f'),_0x218ac0+'-'+_0x4ecc8d+'/'+_0x58736d)[_0x79ff('0x1a')](_0x1f3ecb);}return null;};}function patchUpdates(_0x36c8c4){return function(_0x47fc26){try{jsonpatch['apply'](_0x47fc26,_0x36c8c4,!![]);}catch(_0x3a4f00){return BPromise[_0x79ff('0x20')](_0x3a4f00);}return _0x47fc26[_0x79ff('0x21')]();};}function saveUpdates(_0x199fb6,_0x5db0c5){return function(_0x54aafa){if(_0x54aafa){return _0x54aafa[_0x79ff('0x22')](_0x199fb6)['then'](function(_0x28769d){return _0x28769d;});}return null;};}function removeEntity(_0x5abed6,_0x5d9c69){return function(_0x285ed7){if(_0x285ed7){return _0x285ed7[_0x79ff('0x23')]()[_0x79ff('0x24')](function(){_0x5abed6['status'](0xcc)[_0x79ff('0x18')]();});}};}function handleEntityNotFound(_0x20a52b,_0x444372){return function(_0x2803b6){if(!_0x2803b6){_0x20a52b[_0x79ff('0x17')](0x194);}return _0x2803b6;};}function handleError(_0x2e9b49,_0x4b2bd7){_0x4b2bd7=_0x4b2bd7||0x1f4;return function(_0x145b6a){logger[_0x79ff('0x25')](_0x145b6a[_0x79ff('0x26')]);if(_0x145b6a[_0x79ff('0x27')]){delete _0x145b6a['name'];}_0x2e9b49[_0x79ff('0x19')](_0x4b2bd7)[_0x79ff('0x28')](_0x145b6a);};}exports[_0x79ff('0x29')]=function(_0xebdc8d,_0x3d9ee5){var _0x1b1220={},_0xdd4371={},_0x26bb3c={'count':0x0,'rows':[]};var _0x321701=_[_0x79ff('0x2a')](db[_0x79ff('0x2b')][_0x79ff('0x2c')],function(_0x5eb949){return{'name':_0x5eb949[_0x79ff('0x2d')],'type':_0x5eb949[_0x79ff('0x2e')][_0x79ff('0x2f')]};});_0xdd4371[_0x79ff('0x30')]=_['map'](_0x321701,_0x79ff('0x27'));_0xdd4371['query']=_[_0x79ff('0x31')](_0xebdc8d['query']);_0xdd4371[_0x79ff('0x32')]=_[_0x79ff('0x33')](_0xdd4371[_0x79ff('0x30')],_0xdd4371[_0x79ff('0x34')]);_0x1b1220[_0x79ff('0x35')]=_['intersection'](_0xdd4371[_0x79ff('0x30')],qs[_0x79ff('0x36')](_0xebdc8d[_0x79ff('0x34')][_0x79ff('0x36')]));_0x1b1220[_0x79ff('0x35')]=_0x1b1220[_0x79ff('0x35')][_0x79ff('0x37')]?_0x1b1220[_0x79ff('0x35')]:_0xdd4371[_0x79ff('0x30')];if(!_0xebdc8d[_0x79ff('0x34')][_0x79ff('0x38')](_0x79ff('0x39'))){_0x1b1220['limit']=qs[_0x79ff('0x1b')](_0xebdc8d['query'][_0x79ff('0x1b')]);_0x1b1220[_0x79ff('0x3a')]=qs[_0x79ff('0x3a')](_0xebdc8d[_0x79ff('0x34')][_0x79ff('0x3a')]);}_0x1b1220[_0x79ff('0x3b')]=qs[_0x79ff('0x3c')](_0xebdc8d['query'][_0x79ff('0x3c')]);_0x1b1220[_0x79ff('0x3d')]=qs[_0x79ff('0x32')](_['pick'](_0xebdc8d[_0x79ff('0x34')],_0xdd4371['filters']),_0x321701);if(_0xebdc8d[_0x79ff('0x34')][_0x79ff('0x3e')]){_0x1b1220[_0x79ff('0x3d')]=_[_0x79ff('0x3f')](_0x1b1220[_0x79ff('0x3d')],{'$or':_[_0x79ff('0x2a')](_0x321701,function(_0xc7be49){if(_0xc7be49[_0x79ff('0x2e')]!==_0x79ff('0x40')){var _0x14ebed={};_0x14ebed[_0xc7be49['name']]={'$like':'%'+_0xebdc8d[_0x79ff('0x34')][_0x79ff('0x3e')]+'%'};return _0x14ebed;}})});}_0x1b1220=_[_0x79ff('0x3f')]({},_0x1b1220,_0xebdc8d[_0x79ff('0x41')]);var _0x3d1036={'where':_0x1b1220['where']};return db[_0x79ff('0x2b')][_0x79ff('0x1d')](_0x3d1036)[_0x79ff('0x24')](function(_0x86dfc){_0x26bb3c[_0x79ff('0x1d')]=_0x86dfc;if(_0xebdc8d[_0x79ff('0x34')][_0x79ff('0x42')]){_0x1b1220[_0x79ff('0x43')]=[{'all':!![]}];}return db[_0x79ff('0x2b')][_0x79ff('0x44')](_0x1b1220);})[_0x79ff('0x24')](function(_0x5c2c51){_0x26bb3c[_0x79ff('0x45')]=_0x5c2c51;return _0x26bb3c;})[_0x79ff('0x24')](respondWithFilteredResult(_0x3d9ee5,_0x1b1220))[_0x79ff('0x46')](handleError(_0x3d9ee5,null));};exports['show']=function(_0x1d4fd0,_0x2f5be2){var _0x2bd865={'raw':![],'where':{'id':_0x1d4fd0['params']['id']}},_0x1392e7={};_0x1392e7[_0x79ff('0x30')]=_[_0x79ff('0x31')](db[_0x79ff('0x2b')][_0x79ff('0x2c')]);_0x1392e7[_0x79ff('0x34')]=_[_0x79ff('0x31')](_0x1d4fd0[_0x79ff('0x34')]);_0x1392e7[_0x79ff('0x32')]=_[_0x79ff('0x33')](_0x1392e7['model'],_0x1392e7['query']);_0x2bd865['attributes']=_[_0x79ff('0x33')](_0x1392e7[_0x79ff('0x30')],qs[_0x79ff('0x36')](_0x1d4fd0[_0x79ff('0x34')][_0x79ff('0x36')]));_0x2bd865[_0x79ff('0x35')]=_0x2bd865[_0x79ff('0x35')][_0x79ff('0x37')]?_0x2bd865[_0x79ff('0x35')]:_0x1392e7[_0x79ff('0x30')];if(_0x1d4fd0[_0x79ff('0x34')][_0x79ff('0x42')]){_0x2bd865['include']=[{'all':!![]}];}_0x2bd865=_[_0x79ff('0x3f')]({},_0x2bd865,_0x1d4fd0[_0x79ff('0x41')]);return db['ZendeskConfiguration'][_0x79ff('0x47')](_0x2bd865)[_0x79ff('0x24')](handleEntityNotFound(_0x2f5be2,null))[_0x79ff('0x24')](respondWithResult(_0x2f5be2,null))[_0x79ff('0x46')](handleError(_0x2f5be2,null));};exports[_0x79ff('0x48')]=function(_0x18d20b,_0x2e955f){return db[_0x79ff('0x2b')]['create'](_0x18d20b[_0x79ff('0x49')],{})['then'](respondWithResult(_0x2e955f,0xc9))[_0x79ff('0x46')](handleError(_0x2e955f,null));};exports[_0x79ff('0x22')]=function(_0x8e7b75,_0xc5da15){if(_0x8e7b75[_0x79ff('0x49')]['id']){delete _0x8e7b75[_0x79ff('0x49')]['id'];}return db[_0x79ff('0x2b')][_0x79ff('0x47')]({'where':{'id':_0x8e7b75[_0x79ff('0x4a')]['id']}})[_0x79ff('0x24')](handleEntityNotFound(_0xc5da15,null))[_0x79ff('0x24')](saveUpdates(_0x8e7b75[_0x79ff('0x49')],null))[_0x79ff('0x24')](respondWithResult(_0xc5da15,null))[_0x79ff('0x46')](handleError(_0xc5da15,null));};exports[_0x79ff('0x23')]=function(_0x32d803,_0xbabe10){return db[_0x79ff('0x2b')][_0x79ff('0x47')]({'where':{'id':_0x32d803['params']['id']}})['then'](handleEntityNotFound(_0xbabe10,null))['then'](removeEntity(_0xbabe10,null))['catch'](handleError(_0xbabe10,null));};exports[_0x79ff('0x4b')]=function(_0x3d2015,_0x32547c,_0x181ca2){var _0x1fdc9c={};var _0x4f7717={};var _0x38d0a4;var _0x3415ae;return db[_0x79ff('0x2b')][_0x79ff('0x4c')]({'where':{'id':_0x3d2015['params']['id']}})['then'](handleEntityNotFound(_0x32547c,null))[_0x79ff('0x24')](function(_0x6e9fe8){if(_0x6e9fe8){_0x38d0a4=_0x6e9fe8;_0x4f7717[_0x79ff('0x30')]=_[_0x79ff('0x31')](db[_0x79ff('0x4d')][_0x79ff('0x2c')]);_0x4f7717[_0x79ff('0x34')]=_[_0x79ff('0x31')](_0x3d2015[_0x79ff('0x34')]);_0x4f7717[_0x79ff('0x32')]=_[_0x79ff('0x33')](_0x4f7717[_0x79ff('0x30')],_0x4f7717[_0x79ff('0x34')]);_0x1fdc9c[_0x79ff('0x35')]=_[_0x79ff('0x33')](_0x4f7717[_0x79ff('0x30')],qs['fields'](_0x3d2015[_0x79ff('0x34')]['fields']));_0x1fdc9c['attributes']=_0x1fdc9c[_0x79ff('0x35')][_0x79ff('0x37')]?_0x1fdc9c[_0x79ff('0x35')]:_0x4f7717[_0x79ff('0x30')];_0x1fdc9c[_0x79ff('0x3b')]=qs[_0x79ff('0x3c')](_0x3d2015[_0x79ff('0x34')]['sort']);_0x1fdc9c[_0x79ff('0x3d')]=qs[_0x79ff('0x32')](_[_0x79ff('0x4e')](_0x3d2015['query'],_0x4f7717[_0x79ff('0x32')]));if(_0x3d2015[_0x79ff('0x34')][_0x79ff('0x3e')]){_0x1fdc9c[_0x79ff('0x3d')]=_[_0x79ff('0x3f')](_0x1fdc9c[_0x79ff('0x3d')],{'$or':_['map'](_0x1fdc9c[_0x79ff('0x35')],function(_0x247e96){var _0x37fdbf={};_0x37fdbf[_0x247e96]={'$like':'%'+_0x3d2015['query'][_0x79ff('0x3e')]+'%'};return _0x37fdbf;})});}_0x1fdc9c=_['merge']({},_0x1fdc9c,_0x3d2015[_0x79ff('0x41')]);return _0x38d0a4[_0x79ff('0x4b')](_0x1fdc9c);}})[_0x79ff('0x24')](function(_0x4d164c){if(_0x4d164c){_0x3415ae=_0x4d164c[_0x79ff('0x37')];if(!_0x3d2015[_0x79ff('0x34')][_0x79ff('0x38')]('nolimit')){_0x1fdc9c[_0x79ff('0x1b')]=qs[_0x79ff('0x1b')](_0x3d2015[_0x79ff('0x34')][_0x79ff('0x1b')]);_0x1fdc9c[_0x79ff('0x3a')]=qs[_0x79ff('0x3a')](_0x3d2015[_0x79ff('0x34')][_0x79ff('0x3a')]);}return _0x38d0a4[_0x79ff('0x4b')](_0x1fdc9c);}})['then'](function(_0x1149a3){if(_0x1149a3){return _0x1149a3?{'count':_0x3415ae,'rows':_0x1149a3}:null;}})[_0x79ff('0x24')](respondWithResult(_0x32547c,null))[_0x79ff('0x46')](handleError(_0x32547c,null));};exports[_0x79ff('0x4f')]=function(_0x574bd5,_0x13040b,_0x432c73){var _0x481df7={};var _0x37dc3d={};var _0x1a3da8;var _0x18c18a;return db[_0x79ff('0x2b')]['findOne']({'where':{'id':_0x574bd5[_0x79ff('0x4a')]['id']}})['then'](handleEntityNotFound(_0x13040b,null))[_0x79ff('0x24')](function(_0x3c90d2){if(_0x3c90d2){_0x1a3da8=_0x3c90d2;_0x37dc3d[_0x79ff('0x30')]=_[_0x79ff('0x31')](db[_0x79ff('0x4d')][_0x79ff('0x2c')]);_0x37dc3d[_0x79ff('0x34')]=_[_0x79ff('0x31')](_0x574bd5[_0x79ff('0x34')]);_0x37dc3d[_0x79ff('0x32')]=_[_0x79ff('0x33')](_0x37dc3d['model'],_0x37dc3d[_0x79ff('0x34')]);_0x481df7['attributes']=_['intersection'](_0x37dc3d[_0x79ff('0x30')],qs['fields'](_0x574bd5[_0x79ff('0x34')][_0x79ff('0x36')]));_0x481df7[_0x79ff('0x35')]=_0x481df7[_0x79ff('0x35')]['length']?_0x481df7[_0x79ff('0x35')]:_0x37dc3d[_0x79ff('0x30')];_0x481df7[_0x79ff('0x3b')]=qs['sort'](_0x574bd5[_0x79ff('0x34')][_0x79ff('0x3c')]);_0x481df7['where']=qs['filters'](_[_0x79ff('0x4e')](_0x574bd5['query'],_0x37dc3d['filters']));if(_0x574bd5[_0x79ff('0x34')]['filter']){_0x481df7[_0x79ff('0x3d')]=_[_0x79ff('0x3f')](_0x481df7[_0x79ff('0x3d')],{'$or':_[_0x79ff('0x2a')](_0x481df7[_0x79ff('0x35')],function(_0x136c72){var _0x2eea9f={};_0x2eea9f[_0x136c72]={'$like':'%'+_0x574bd5[_0x79ff('0x34')]['filter']+'%'};return _0x2eea9f;})});}_0x481df7=_[_0x79ff('0x3f')]({},_0x481df7,_0x574bd5[_0x79ff('0x41')]);return _0x1a3da8['getSubjects'](_0x481df7);}})[_0x79ff('0x24')](function(_0x14baca){if(_0x14baca){_0x18c18a=_0x14baca[_0x79ff('0x37')];if(!_0x574bd5[_0x79ff('0x34')][_0x79ff('0x38')](_0x79ff('0x39'))){_0x481df7[_0x79ff('0x1b')]=qs[_0x79ff('0x1b')](_0x574bd5[_0x79ff('0x34')][_0x79ff('0x1b')]);_0x481df7[_0x79ff('0x3a')]=qs[_0x79ff('0x3a')](_0x574bd5[_0x79ff('0x34')][_0x79ff('0x3a')]);}return _0x1a3da8[_0x79ff('0x4f')](_0x481df7);}})['then'](function(_0x2a2768){if(_0x2a2768){return _0x2a2768?{'count':_0x18c18a,'rows':_0x2a2768}:null;}})[_0x79ff('0x24')](respondWithResult(_0x13040b,null))[_0x79ff('0x46')](handleError(_0x13040b,null));};exports[_0x79ff('0x50')]=function(_0xe9ffdc,_0x235133,_0x49dc3d){var _0x4d5be9={};var _0x39ca24={};var _0x1b62fa;var _0x2970b0;return db['ZendeskConfiguration'][_0x79ff('0x4c')]({'where':{'id':_0xe9ffdc[_0x79ff('0x4a')]['id']}})['then'](handleEntityNotFound(_0x235133,null))['then'](function(_0x3d9457){if(_0x3d9457){_0x1b62fa=_0x3d9457;_0x39ca24[_0x79ff('0x30')]=_[_0x79ff('0x31')](db[_0x79ff('0x4d')]['rawAttributes']);_0x39ca24[_0x79ff('0x34')]=_[_0x79ff('0x31')](_0xe9ffdc[_0x79ff('0x34')]);_0x39ca24[_0x79ff('0x32')]=_[_0x79ff('0x33')](_0x39ca24[_0x79ff('0x30')],_0x39ca24[_0x79ff('0x34')]);_0x4d5be9['attributes']=_[_0x79ff('0x33')](_0x39ca24[_0x79ff('0x30')],qs['fields'](_0xe9ffdc[_0x79ff('0x34')][_0x79ff('0x36')]));_0x4d5be9[_0x79ff('0x35')]=_0x4d5be9[_0x79ff('0x35')]['length']?_0x4d5be9[_0x79ff('0x35')]:_0x39ca24[_0x79ff('0x30')];_0x4d5be9[_0x79ff('0x3b')]=qs[_0x79ff('0x3c')](_0xe9ffdc[_0x79ff('0x34')]['sort']);_0x4d5be9[_0x79ff('0x3d')]=qs[_0x79ff('0x32')](_[_0x79ff('0x4e')](_0xe9ffdc[_0x79ff('0x34')],_0x39ca24[_0x79ff('0x32')]));if(_0xe9ffdc[_0x79ff('0x34')][_0x79ff('0x3e')]){_0x4d5be9[_0x79ff('0x3d')]=_[_0x79ff('0x3f')](_0x4d5be9[_0x79ff('0x3d')],{'$or':_[_0x79ff('0x2a')](_0x4d5be9['attributes'],function(_0x230ca0){var _0x452052={};_0x452052[_0x230ca0]={'$like':'%'+_0xe9ffdc[_0x79ff('0x34')][_0x79ff('0x3e')]+'%'};return _0x452052;})});}_0x4d5be9=_['merge']({},_0x4d5be9,_0xe9ffdc['options']);return _0x1b62fa['getDescriptions'](_0x4d5be9);}})[_0x79ff('0x24')](function(_0x2d66bf){if(_0x2d66bf){_0x2970b0=_0x2d66bf['length'];if(!_0xe9ffdc[_0x79ff('0x34')][_0x79ff('0x38')](_0x79ff('0x39'))){_0x4d5be9[_0x79ff('0x1b')]=qs[_0x79ff('0x1b')](_0xe9ffdc[_0x79ff('0x34')][_0x79ff('0x1b')]);_0x4d5be9['offset']=qs['offset'](_0xe9ffdc[_0x79ff('0x34')][_0x79ff('0x3a')]);}return _0x1b62fa['getDescriptions'](_0x4d5be9);}})[_0x79ff('0x24')](function(_0x5cd3de){if(_0x5cd3de){return _0x5cd3de?{'count':_0x2970b0,'rows':_0x5cd3de}:null;}})[_0x79ff('0x24')](respondWithResult(_0x235133,null))[_0x79ff('0x46')](handleError(_0x235133,null));};exports[_0x79ff('0x51')]=function(_0x513929,_0x607eb1,_0x181dda){var _0x3bc9ae={};var _0x4c99d5={};var _0x4130fa;var _0x116265;return db[_0x79ff('0x2b')]['findOne']({'where':{'id':_0x513929[_0x79ff('0x4a')]['id']}})[_0x79ff('0x24')](handleEntityNotFound(_0x607eb1,null))[_0x79ff('0x24')](function(_0x56fdac){if(_0x56fdac){_0x4130fa=_0x56fdac;_0x4c99d5[_0x79ff('0x30')]=_[_0x79ff('0x31')](db[_0x79ff('0x52')][_0x79ff('0x2c')]);_0x4c99d5[_0x79ff('0x34')]=_[_0x79ff('0x31')](_0x513929['query']);_0x4c99d5['filters']=_[_0x79ff('0x33')](_0x4c99d5['model'],_0x4c99d5[_0x79ff('0x34')]);_0x3bc9ae[_0x79ff('0x35')]=_['intersection'](_0x4c99d5['model'],qs[_0x79ff('0x36')](_0x513929['query']['fields']));_0x3bc9ae[_0x79ff('0x35')]=_0x3bc9ae['attributes'][_0x79ff('0x37')]?_0x3bc9ae['attributes']:_0x4c99d5['model'];_0x3bc9ae[_0x79ff('0x3b')]=qs[_0x79ff('0x3c')](_0x513929[_0x79ff('0x34')]['sort']);_0x3bc9ae[_0x79ff('0x3d')]=qs[_0x79ff('0x32')](_['pick'](_0x513929['query'],_0x4c99d5[_0x79ff('0x32')]));if(_0x513929[_0x79ff('0x34')][_0x79ff('0x3e')]){_0x3bc9ae[_0x79ff('0x3d')]=_[_0x79ff('0x3f')](_0x3bc9ae['where'],{'$or':_[_0x79ff('0x2a')](_0x3bc9ae[_0x79ff('0x35')],function(_0xac2b43){var _0x14b8c8={};_0x14b8c8[_0xac2b43]={'$like':'%'+_0x513929[_0x79ff('0x34')][_0x79ff('0x3e')]+'%'};return _0x14b8c8;})});}_0x3bc9ae=_['merge']({},_0x3bc9ae,_0x513929[_0x79ff('0x41')]);return _0x4130fa[_0x79ff('0x51')](_0x3bc9ae);}})[_0x79ff('0x24')](function(_0x245f15){if(_0x245f15){_0x116265=_0x245f15[_0x79ff('0x37')];if(!_0x513929[_0x79ff('0x34')]['hasOwnProperty'](_0x79ff('0x39'))){_0x3bc9ae[_0x79ff('0x1b')]=qs[_0x79ff('0x1b')](_0x513929[_0x79ff('0x34')][_0x79ff('0x1b')]);_0x3bc9ae['offset']=qs[_0x79ff('0x3a')](_0x513929[_0x79ff('0x34')]['offset']);}return _0x4130fa[_0x79ff('0x51')](_0x3bc9ae);}})[_0x79ff('0x24')](function(_0x4f7cbf){if(_0x4f7cbf){return _0x4f7cbf?{'count':_0x116265,'rows':_0x4f7cbf}:null;}})[_0x79ff('0x24')](respondWithResult(_0x607eb1,null))['catch'](handleError(_0x607eb1,null));};exports[_0x79ff('0x53')]=function(_0x502b2f,_0x17ce07,_0x3fb3a2){if(_0x502b2f['body']['id']){delete _0x502b2f[_0x79ff('0x49')]['id'];}return db[_0x79ff('0x2b')][_0x79ff('0x4c')]({'where':{'id':_0x502b2f[_0x79ff('0x4a')]['id']}})[_0x79ff('0x24')](handleEntityNotFound(_0x17ce07,null))[_0x79ff('0x24')](function(_0x582617){if(_0x582617){return _0x582617[_0x79ff('0x53')](_0x502b2f[_0x79ff('0x49')][_0x79ff('0x54')]||[]);}return null;})[_0x79ff('0x24')](respondWithResult(_0x17ce07,null))[_0x79ff('0x46')](handleError(_0x17ce07,null));}; \ No newline at end of file +var _0x4966=['to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','sendStatus','status','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','end','name','send','index','ZendeskConfiguration','type','key','model','map','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','rawAttributes','length','find','create','body','params','destroy','getFields','findOne','getSubjects','ZendeskField','getDescriptions','Tag','getTags','setTags','ids','eml-format','moment','bluebird','path','sox','fs-extra','lodash','squel','crypto','jsforce'];(function(_0x2e298f,_0x5933e6){var _0x5ed7d7=function(_0x140dbe){while(--_0x140dbe){_0x2e298f['push'](_0x2e298f['shift']());}};_0x5ed7d7(++_0x5933e6);}(_0x4966,0x92));var _0x6496=function(_0x3e6d5d,_0x264c7a){_0x3e6d5d=_0x3e6d5d-0x0;var _0x238923=_0x4966[_0x3e6d5d];return _0x238923;};'use strict';var emlformat=require(_0x6496('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6496('0x1'));var BPromise=require(_0x6496('0x2'));var Mustache=require('mustache');var util=require('util');var path=require(_0x6496('0x3'));var sox=require(_0x6496('0x4'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6496('0x5'));var _=require(_0x6496('0x6'));var squel=require(_0x6496('0x7'));var crypto=require(_0x6496('0x8'));var jsforce=require(_0x6496('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x6496('0xa'));var querystring=require(_0x6496('0xb'));var Papa=require(_0x6496('0xc'));var Redis=require('ioredis');var authService=require(_0x6496('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x6496('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6496('0xf'));var utils=require(_0x6496('0x10'));var config=require(_0x6496('0x11'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x25a9fb,_0x2dfc07){_0x2dfc07=_0x2dfc07||0xcc;return function(_0x56adcd){if(_0x56adcd){return _0x25a9fb[_0x6496('0x12')](_0x2dfc07);}return _0x25a9fb[_0x6496('0x13')](_0x2dfc07)['end']();};}function respondWithResult(_0x164626,_0xffbe74){_0xffbe74=_0xffbe74||0xc8;return function(_0x5813c7){if(_0x5813c7){return _0x164626[_0x6496('0x13')](_0xffbe74)[_0x6496('0x14')](_0x5813c7);}};}function respondWithFilteredResult(_0x5ea60c,_0x4e4030){return function(_0x47c013){if(_0x47c013){var _0x1e2a3c=typeof _0x4e4030['offset']===_0x6496('0x15')&&typeof _0x4e4030[_0x6496('0x16')]===_0x6496('0x15');var _0x2b7eae=_0x47c013[_0x6496('0x17')];var _0x4441a5=_0x1e2a3c?0x0:_0x4e4030['offset'];var _0x22e032=_0x1e2a3c?_0x47c013['count']:_0x4e4030[_0x6496('0x18')]+_0x4e4030['limit'];var _0x4c12f2;if(_0x22e032>=_0x2b7eae){_0x22e032=_0x2b7eae;_0x4c12f2=0xc8;}else{_0x4c12f2=0xce;}_0x5ea60c[_0x6496('0x13')](_0x4c12f2);return _0x5ea60c['set'](_0x6496('0x19'),_0x4441a5+'-'+_0x22e032+'/'+_0x2b7eae)[_0x6496('0x14')](_0x47c013);}return null;};}function patchUpdates(_0x1e15ca){return function(_0x425dba){try{jsonpatch[_0x6496('0x1a')](_0x425dba,_0x1e15ca,!![]);}catch(_0xc4ee3f){return BPromise[_0x6496('0x1b')](_0xc4ee3f);}return _0x425dba[_0x6496('0x1c')]();};}function saveUpdates(_0x4d3095,_0x2fc672){return function(_0x371a2b){if(_0x371a2b){return _0x371a2b[_0x6496('0x1d')](_0x4d3095)[_0x6496('0x1e')](function(_0x5c33fd){return _0x5c33fd;});}return null;};}function removeEntity(_0x110a66,_0x23dfc4){return function(_0x27dd20){if(_0x27dd20){return _0x27dd20['destroy']()[_0x6496('0x1e')](function(){_0x110a66[_0x6496('0x13')](0xcc)[_0x6496('0x1f')]();});}};}function handleEntityNotFound(_0x4879f1,_0x18c1a9){return function(_0x4593ef){if(!_0x4593ef){_0x4879f1['sendStatus'](0x194);}return _0x4593ef;};}function handleError(_0x213104,_0x27f2c1){_0x27f2c1=_0x27f2c1||0x1f4;return function(_0xc5c9b3){logger['error'](_0xc5c9b3['stack']);if(_0xc5c9b3[_0x6496('0x20')]){delete _0xc5c9b3[_0x6496('0x20')];}_0x213104[_0x6496('0x13')](_0x27f2c1)[_0x6496('0x21')](_0xc5c9b3);};}exports[_0x6496('0x22')]=function(_0x447a83,_0xdeb78){var _0x195559={},_0xb932ff={},_0x5ab02b={'count':0x0,'rows':[]};var _0x1c5b8a=_['map'](db[_0x6496('0x23')]['rawAttributes'],function(_0x1bf049){return{'name':_0x1bf049['fieldName'],'type':_0x1bf049[_0x6496('0x24')][_0x6496('0x25')]};});_0xb932ff[_0x6496('0x26')]=_[_0x6496('0x27')](_0x1c5b8a,'name');_0xb932ff['query']=_[_0x6496('0x28')](_0x447a83[_0x6496('0x29')]);_0xb932ff[_0x6496('0x2a')]=_[_0x6496('0x2b')](_0xb932ff[_0x6496('0x26')],_0xb932ff['query']);_0x195559['attributes']=_[_0x6496('0x2b')](_0xb932ff[_0x6496('0x26')],qs[_0x6496('0x2c')](_0x447a83[_0x6496('0x29')][_0x6496('0x2c')]));_0x195559[_0x6496('0x2d')]=_0x195559[_0x6496('0x2d')]['length']?_0x195559['attributes']:_0xb932ff[_0x6496('0x26')];if(!_0x447a83['query'][_0x6496('0x2e')](_0x6496('0x2f'))){_0x195559[_0x6496('0x16')]=qs[_0x6496('0x16')](_0x447a83['query'][_0x6496('0x16')]);_0x195559[_0x6496('0x18')]=qs['offset'](_0x447a83[_0x6496('0x29')][_0x6496('0x18')]);}_0x195559[_0x6496('0x30')]=qs[_0x6496('0x31')](_0x447a83[_0x6496('0x29')]['sort']);_0x195559[_0x6496('0x32')]=qs[_0x6496('0x2a')](_[_0x6496('0x33')](_0x447a83[_0x6496('0x29')],_0xb932ff[_0x6496('0x2a')]),_0x1c5b8a);if(_0x447a83[_0x6496('0x29')][_0x6496('0x34')]){_0x195559[_0x6496('0x32')]=_[_0x6496('0x35')](_0x195559['where'],{'$or':_[_0x6496('0x27')](_0x1c5b8a,function(_0x3b2428){if(_0x3b2428[_0x6496('0x24')]!==_0x6496('0x36')){var _0x2202bd={};_0x2202bd[_0x3b2428[_0x6496('0x20')]]={'$like':'%'+_0x447a83[_0x6496('0x29')][_0x6496('0x34')]+'%'};return _0x2202bd;}})});}_0x195559=_[_0x6496('0x35')]({},_0x195559,_0x447a83[_0x6496('0x37')]);var _0x3d5c50={'where':_0x195559['where']};return db[_0x6496('0x23')][_0x6496('0x17')](_0x3d5c50)[_0x6496('0x1e')](function(_0x1cfdb1){_0x5ab02b[_0x6496('0x17')]=_0x1cfdb1;if(_0x447a83[_0x6496('0x29')][_0x6496('0x38')]){_0x195559[_0x6496('0x39')]=[{'all':!![]}];}return db[_0x6496('0x23')][_0x6496('0x3a')](_0x195559);})['then'](function(_0x49c5c4){_0x5ab02b[_0x6496('0x3b')]=_0x49c5c4;return _0x5ab02b;})[_0x6496('0x1e')](respondWithFilteredResult(_0xdeb78,_0x195559))[_0x6496('0x3c')](handleError(_0xdeb78,null));};exports[_0x6496('0x3d')]=function(_0x343b07,_0x2b5b54){var _0x4cc14d={'raw':![],'where':{'id':_0x343b07['params']['id']}},_0x579336={};_0x579336[_0x6496('0x26')]=_['keys'](db[_0x6496('0x23')][_0x6496('0x3e')]);_0x579336[_0x6496('0x29')]=_[_0x6496('0x28')](_0x343b07[_0x6496('0x29')]);_0x579336[_0x6496('0x2a')]=_[_0x6496('0x2b')](_0x579336['model'],_0x579336['query']);_0x4cc14d[_0x6496('0x2d')]=_['intersection'](_0x579336['model'],qs[_0x6496('0x2c')](_0x343b07[_0x6496('0x29')][_0x6496('0x2c')]));_0x4cc14d[_0x6496('0x2d')]=_0x4cc14d['attributes'][_0x6496('0x3f')]?_0x4cc14d[_0x6496('0x2d')]:_0x579336[_0x6496('0x26')];if(_0x343b07[_0x6496('0x29')][_0x6496('0x38')]){_0x4cc14d[_0x6496('0x39')]=[{'all':!![]}];}_0x4cc14d=_['merge']({},_0x4cc14d,_0x343b07['options']);return db[_0x6496('0x23')][_0x6496('0x40')](_0x4cc14d)[_0x6496('0x1e')](handleEntityNotFound(_0x2b5b54,null))[_0x6496('0x1e')](respondWithResult(_0x2b5b54,null))[_0x6496('0x3c')](handleError(_0x2b5b54,null));};exports[_0x6496('0x41')]=function(_0x566cc4,_0x2db2f6){return db['ZendeskConfiguration']['create'](_0x566cc4[_0x6496('0x42')],{})['then'](respondWithResult(_0x2db2f6,0xc9))[_0x6496('0x3c')](handleError(_0x2db2f6,null));};exports[_0x6496('0x1d')]=function(_0x3f1d15,_0x19ee10){if(_0x3f1d15['body']['id']){delete _0x3f1d15['body']['id'];}return db[_0x6496('0x23')][_0x6496('0x40')]({'where':{'id':_0x3f1d15[_0x6496('0x43')]['id']}})[_0x6496('0x1e')](handleEntityNotFound(_0x19ee10,null))[_0x6496('0x1e')](saveUpdates(_0x3f1d15['body'],null))[_0x6496('0x1e')](respondWithResult(_0x19ee10,null))[_0x6496('0x3c')](handleError(_0x19ee10,null));};exports[_0x6496('0x44')]=function(_0x86042e,_0x51b389){return db[_0x6496('0x23')][_0x6496('0x40')]({'where':{'id':_0x86042e['params']['id']}})['then'](handleEntityNotFound(_0x51b389,null))[_0x6496('0x1e')](removeEntity(_0x51b389,null))[_0x6496('0x3c')](handleError(_0x51b389,null));};exports[_0x6496('0x45')]=function(_0x2633d5,_0x472f93,_0x29a1bd){var _0x141c7b={};var _0x3c46fe={};var _0x836b14;var _0x3c50ba;return db[_0x6496('0x23')][_0x6496('0x46')]({'where':{'id':_0x2633d5[_0x6496('0x43')]['id']}})[_0x6496('0x1e')](handleEntityNotFound(_0x472f93,null))[_0x6496('0x1e')](function(_0x3af207){if(_0x3af207){_0x836b14=_0x3af207;_0x3c46fe['model']=_[_0x6496('0x28')](db['ZendeskField'][_0x6496('0x3e')]);_0x3c46fe[_0x6496('0x29')]=_[_0x6496('0x28')](_0x2633d5['query']);_0x3c46fe[_0x6496('0x2a')]=_[_0x6496('0x2b')](_0x3c46fe['model'],_0x3c46fe[_0x6496('0x29')]);_0x141c7b['attributes']=_[_0x6496('0x2b')](_0x3c46fe['model'],qs[_0x6496('0x2c')](_0x2633d5[_0x6496('0x29')][_0x6496('0x2c')]));_0x141c7b[_0x6496('0x2d')]=_0x141c7b[_0x6496('0x2d')][_0x6496('0x3f')]?_0x141c7b['attributes']:_0x3c46fe['model'];_0x141c7b[_0x6496('0x30')]=qs[_0x6496('0x31')](_0x2633d5[_0x6496('0x29')][_0x6496('0x31')]);_0x141c7b[_0x6496('0x32')]=qs['filters'](_[_0x6496('0x33')](_0x2633d5[_0x6496('0x29')],_0x3c46fe[_0x6496('0x2a')]));if(_0x2633d5[_0x6496('0x29')][_0x6496('0x34')]){_0x141c7b[_0x6496('0x32')]=_[_0x6496('0x35')](_0x141c7b['where'],{'$or':_['map'](_0x141c7b['attributes'],function(_0x437883){var _0xc7a806={};_0xc7a806[_0x437883]={'$like':'%'+_0x2633d5[_0x6496('0x29')][_0x6496('0x34')]+'%'};return _0xc7a806;})});}_0x141c7b=_[_0x6496('0x35')]({},_0x141c7b,_0x2633d5['options']);return _0x836b14[_0x6496('0x45')](_0x141c7b);}})[_0x6496('0x1e')](function(_0x3a2755){if(_0x3a2755){_0x3c50ba=_0x3a2755[_0x6496('0x3f')];if(!_0x2633d5[_0x6496('0x29')][_0x6496('0x2e')](_0x6496('0x2f'))){_0x141c7b['limit']=qs[_0x6496('0x16')](_0x2633d5[_0x6496('0x29')][_0x6496('0x16')]);_0x141c7b[_0x6496('0x18')]=qs[_0x6496('0x18')](_0x2633d5['query'][_0x6496('0x18')]);}return _0x836b14['getFields'](_0x141c7b);}})['then'](function(_0x54fa58){if(_0x54fa58){return _0x54fa58?{'count':_0x3c50ba,'rows':_0x54fa58}:null;}})[_0x6496('0x1e')](respondWithResult(_0x472f93,null))['catch'](handleError(_0x472f93,null));};exports[_0x6496('0x47')]=function(_0x1f65ac,_0x3249df,_0x536083){var _0x519447={};var _0x2e2a44={};var _0x5663c9;var _0x1791af;return db[_0x6496('0x23')]['findOne']({'where':{'id':_0x1f65ac[_0x6496('0x43')]['id']}})[_0x6496('0x1e')](handleEntityNotFound(_0x3249df,null))[_0x6496('0x1e')](function(_0x1376fe){if(_0x1376fe){_0x5663c9=_0x1376fe;_0x2e2a44[_0x6496('0x26')]=_['keys'](db['ZendeskField']['rawAttributes']);_0x2e2a44[_0x6496('0x29')]=_['keys'](_0x1f65ac[_0x6496('0x29')]);_0x2e2a44[_0x6496('0x2a')]=_['intersection'](_0x2e2a44[_0x6496('0x26')],_0x2e2a44[_0x6496('0x29')]);_0x519447[_0x6496('0x2d')]=_[_0x6496('0x2b')](_0x2e2a44[_0x6496('0x26')],qs[_0x6496('0x2c')](_0x1f65ac[_0x6496('0x29')][_0x6496('0x2c')]));_0x519447[_0x6496('0x2d')]=_0x519447[_0x6496('0x2d')][_0x6496('0x3f')]?_0x519447[_0x6496('0x2d')]:_0x2e2a44['model'];_0x519447[_0x6496('0x30')]=qs['sort'](_0x1f65ac[_0x6496('0x29')]['sort']);_0x519447[_0x6496('0x32')]=qs['filters'](_[_0x6496('0x33')](_0x1f65ac[_0x6496('0x29')],_0x2e2a44[_0x6496('0x2a')]));if(_0x1f65ac[_0x6496('0x29')][_0x6496('0x34')]){_0x519447[_0x6496('0x32')]=_['merge'](_0x519447[_0x6496('0x32')],{'$or':_['map'](_0x519447[_0x6496('0x2d')],function(_0x1b4e80){var _0x57a1ff={};_0x57a1ff[_0x1b4e80]={'$like':'%'+_0x1f65ac['query'][_0x6496('0x34')]+'%'};return _0x57a1ff;})});}_0x519447=_[_0x6496('0x35')]({},_0x519447,_0x1f65ac[_0x6496('0x37')]);return _0x5663c9[_0x6496('0x47')](_0x519447);}})[_0x6496('0x1e')](function(_0x40eca7){if(_0x40eca7){_0x1791af=_0x40eca7[_0x6496('0x3f')];if(!_0x1f65ac[_0x6496('0x29')][_0x6496('0x2e')]('nolimit')){_0x519447[_0x6496('0x16')]=qs[_0x6496('0x16')](_0x1f65ac['query']['limit']);_0x519447[_0x6496('0x18')]=qs[_0x6496('0x18')](_0x1f65ac[_0x6496('0x29')][_0x6496('0x18')]);}return _0x5663c9[_0x6496('0x47')](_0x519447);}})[_0x6496('0x1e')](function(_0x161cb8){if(_0x161cb8){return _0x161cb8?{'count':_0x1791af,'rows':_0x161cb8}:null;}})[_0x6496('0x1e')](respondWithResult(_0x3249df,null))['catch'](handleError(_0x3249df,null));};exports['getDescriptions']=function(_0x3ce8ce,_0x464896,_0x34e104){var _0xfdaa6a={};var _0xabccf0={};var _0x2cf964;var _0x15265e;return db[_0x6496('0x23')][_0x6496('0x46')]({'where':{'id':_0x3ce8ce['params']['id']}})[_0x6496('0x1e')](handleEntityNotFound(_0x464896,null))[_0x6496('0x1e')](function(_0x1571cf){if(_0x1571cf){_0x2cf964=_0x1571cf;_0xabccf0[_0x6496('0x26')]=_[_0x6496('0x28')](db[_0x6496('0x48')][_0x6496('0x3e')]);_0xabccf0[_0x6496('0x29')]=_[_0x6496('0x28')](_0x3ce8ce[_0x6496('0x29')]);_0xabccf0[_0x6496('0x2a')]=_['intersection'](_0xabccf0[_0x6496('0x26')],_0xabccf0[_0x6496('0x29')]);_0xfdaa6a[_0x6496('0x2d')]=_[_0x6496('0x2b')](_0xabccf0['model'],qs[_0x6496('0x2c')](_0x3ce8ce[_0x6496('0x29')]['fields']));_0xfdaa6a[_0x6496('0x2d')]=_0xfdaa6a[_0x6496('0x2d')]['length']?_0xfdaa6a[_0x6496('0x2d')]:_0xabccf0['model'];_0xfdaa6a['order']=qs[_0x6496('0x31')](_0x3ce8ce[_0x6496('0x29')][_0x6496('0x31')]);_0xfdaa6a['where']=qs[_0x6496('0x2a')](_[_0x6496('0x33')](_0x3ce8ce[_0x6496('0x29')],_0xabccf0[_0x6496('0x2a')]));if(_0x3ce8ce[_0x6496('0x29')]['filter']){_0xfdaa6a['where']=_[_0x6496('0x35')](_0xfdaa6a[_0x6496('0x32')],{'$or':_['map'](_0xfdaa6a[_0x6496('0x2d')],function(_0x276f9e){var _0x24dd4b={};_0x24dd4b[_0x276f9e]={'$like':'%'+_0x3ce8ce[_0x6496('0x29')][_0x6496('0x34')]+'%'};return _0x24dd4b;})});}_0xfdaa6a=_[_0x6496('0x35')]({},_0xfdaa6a,_0x3ce8ce['options']);return _0x2cf964['getDescriptions'](_0xfdaa6a);}})[_0x6496('0x1e')](function(_0x101088){if(_0x101088){_0x15265e=_0x101088[_0x6496('0x3f')];if(!_0x3ce8ce[_0x6496('0x29')][_0x6496('0x2e')](_0x6496('0x2f'))){_0xfdaa6a[_0x6496('0x16')]=qs[_0x6496('0x16')](_0x3ce8ce[_0x6496('0x29')][_0x6496('0x16')]);_0xfdaa6a[_0x6496('0x18')]=qs['offset'](_0x3ce8ce[_0x6496('0x29')][_0x6496('0x18')]);}return _0x2cf964[_0x6496('0x49')](_0xfdaa6a);}})[_0x6496('0x1e')](function(_0x32ede5){if(_0x32ede5){return _0x32ede5?{'count':_0x15265e,'rows':_0x32ede5}:null;}})[_0x6496('0x1e')](respondWithResult(_0x464896,null))['catch'](handleError(_0x464896,null));};exports['getTags']=function(_0x7a94a9,_0x1dca90,_0x5e3f3b){var _0x4b52c5={};var _0x5367f9={};var _0x5d41ea;var _0x46bf8d;return db[_0x6496('0x23')][_0x6496('0x46')]({'where':{'id':_0x7a94a9[_0x6496('0x43')]['id']}})[_0x6496('0x1e')](handleEntityNotFound(_0x1dca90,null))[_0x6496('0x1e')](function(_0x4ca7d2){if(_0x4ca7d2){_0x5d41ea=_0x4ca7d2;_0x5367f9[_0x6496('0x26')]=_[_0x6496('0x28')](db[_0x6496('0x4a')][_0x6496('0x3e')]);_0x5367f9[_0x6496('0x29')]=_[_0x6496('0x28')](_0x7a94a9[_0x6496('0x29')]);_0x5367f9[_0x6496('0x2a')]=_['intersection'](_0x5367f9[_0x6496('0x26')],_0x5367f9['query']);_0x4b52c5[_0x6496('0x2d')]=_[_0x6496('0x2b')](_0x5367f9[_0x6496('0x26')],qs[_0x6496('0x2c')](_0x7a94a9[_0x6496('0x29')][_0x6496('0x2c')]));_0x4b52c5[_0x6496('0x2d')]=_0x4b52c5[_0x6496('0x2d')][_0x6496('0x3f')]?_0x4b52c5[_0x6496('0x2d')]:_0x5367f9[_0x6496('0x26')];_0x4b52c5[_0x6496('0x30')]=qs['sort'](_0x7a94a9[_0x6496('0x29')][_0x6496('0x31')]);_0x4b52c5['where']=qs[_0x6496('0x2a')](_['pick'](_0x7a94a9[_0x6496('0x29')],_0x5367f9[_0x6496('0x2a')]));if(_0x7a94a9[_0x6496('0x29')][_0x6496('0x34')]){_0x4b52c5[_0x6496('0x32')]=_['merge'](_0x4b52c5[_0x6496('0x32')],{'$or':_[_0x6496('0x27')](_0x4b52c5[_0x6496('0x2d')],function(_0x506f9f){var _0x3c50be={};_0x3c50be[_0x506f9f]={'$like':'%'+_0x7a94a9[_0x6496('0x29')][_0x6496('0x34')]+'%'};return _0x3c50be;})});}_0x4b52c5=_[_0x6496('0x35')]({},_0x4b52c5,_0x7a94a9[_0x6496('0x37')]);return _0x5d41ea[_0x6496('0x4b')](_0x4b52c5);}})[_0x6496('0x1e')](function(_0xc7218b){if(_0xc7218b){_0x46bf8d=_0xc7218b['length'];if(!_0x7a94a9[_0x6496('0x29')]['hasOwnProperty']('nolimit')){_0x4b52c5[_0x6496('0x16')]=qs[_0x6496('0x16')](_0x7a94a9['query'][_0x6496('0x16')]);_0x4b52c5[_0x6496('0x18')]=qs[_0x6496('0x18')](_0x7a94a9[_0x6496('0x29')][_0x6496('0x18')]);}return _0x5d41ea['getTags'](_0x4b52c5);}})[_0x6496('0x1e')](function(_0x337db4){if(_0x337db4){return _0x337db4?{'count':_0x46bf8d,'rows':_0x337db4}:null;}})[_0x6496('0x1e')](respondWithResult(_0x1dca90,null))[_0x6496('0x3c')](handleError(_0x1dca90,null));};exports[_0x6496('0x4c')]=function(_0x1afb5d,_0x35fc86,_0x20222f){if(_0x1afb5d[_0x6496('0x42')]['id']){delete _0x1afb5d[_0x6496('0x42')]['id'];}return db[_0x6496('0x23')][_0x6496('0x46')]({'where':{'id':_0x1afb5d[_0x6496('0x43')]['id']}})['then'](handleEntityNotFound(_0x35fc86,null))['then'](function(_0x158cdd){if(_0x158cdd){return _0x158cdd['setTags'](_0x1afb5d[_0x6496('0x42')][_0x6496('0x4d')]||[]);}return null;})[_0x6496('0x1e')](respondWithResult(_0x35fc86,null))['catch'](handleError(_0x35fc86,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 7cb8f1b..f29e71e 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 _0xbaf0=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','int_zendesk_configurations','util'];(function(_0x579873,_0x4865a9){var _0x222961=function(_0x9605fb){while(--_0x9605fb){_0x579873['push'](_0x579873['shift']());}};_0x222961(++_0x4865a9);}(_0xbaf0,0x12a));var _0x0baf=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xbaf0[_0x19e35c];return _0x3e1fe8;};'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 _0x6cb4=['bluebird','request-promise','path','rimraf','./intZendeskConfiguration.attributes','define','ZendeskConfiguration','int_zendesk_configurations','lodash','util','../../config/logger','api','moment'];(function(_0x4004e4,_0x257d4a){var _0x2bcdaf=function(_0x2dc1bd){while(--_0x2dc1bd){_0x4004e4['push'](_0x4004e4['shift']());}};_0x2bcdaf(++_0x257d4a);}(_0x6cb4,0xff));var _0x46cb=function(_0x498399,_0x14ba6b){_0x498399=_0x498399-0x0;var _0x3f6c7b=_0x6cb4[_0x498399];return _0x3f6c7b;};'use strict';var _=require(_0x46cb('0x0'));var util=require(_0x46cb('0x1'));var logger=require(_0x46cb('0x2'))(_0x46cb('0x3'));var moment=require(_0x46cb('0x4'));var BPromise=require(_0x46cb('0x5'));var rp=require(_0x46cb('0x6'));var fs=require('fs');var path=require(_0x46cb('0x7'));var rimraf=require(_0x46cb('0x8'));var config=require('../../config/environment');var attributes=require(_0x46cb('0x9'));module['exports']=function(_0x3d9d3c,_0x4d9f1d){return _0x3d9d3c[_0x46cb('0xa')](_0x46cb('0xb'),attributes,{'tableName':_0x46cb('0xc'),'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 596791d..63ca4f5 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 _0xf531=['stringify','error','code','ZendeskConfiguration,\x20%s,\x20%s','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x46773c,_0x239120){var _0x248a83=function(_0x5f29ae){while(--_0x5f29ae){_0x46773c['push'](_0x46773c['shift']());}};_0x248a83(++_0x239120);}(_0xf531,0x149));var _0x1f53=function(_0x23dbda,_0x5977dc){_0x23dbda=_0x23dbda-0x0;var _0x5298f6=_0xf531[_0x23dbda];return _0x5298f6;};'use strict';var _=require(_0x1f53('0x0'));var util=require(_0x1f53('0x1'));var moment=require(_0x1f53('0x2'));var BPromise=require(_0x1f53('0x3'));var rs=require(_0x1f53('0x4'));var fs=require('fs');var Redis=require(_0x1f53('0x5'));var db=require(_0x1f53('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x1f53('0x7'))(_0x1f53('0x8'));var config=require(_0x1f53('0x9'));var jayson=require(_0x1f53('0xa'));var client=jayson['client'][_0x1f53('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x45e5f4,_0x277e65,_0x4186c0){return new BPromise(function(_0xba0034,_0x162225){return client['request'](_0x45e5f4,_0x4186c0)[_0x1f53('0xc')](function(_0x5bfa15){logger['info']('ZendeskConfiguration,\x20%s,\x20%s',_0x277e65,_0x1f53('0xd'));logger[_0x1f53('0xe')](_0x1f53('0xf'),_0x277e65,_0x1f53('0xd'),JSON[_0x1f53('0x10')](_0x5bfa15));if(_0x5bfa15[_0x1f53('0x11')]){if(_0x5bfa15[_0x1f53('0x11')][_0x1f53('0x12')]===0x1f4){logger[_0x1f53('0x11')](_0x1f53('0x13'),_0x277e65,_0x5bfa15['error'][_0x1f53('0x14')]);return _0x162225(_0x5bfa15[_0x1f53('0x11')]['message']);}logger[_0x1f53('0x11')](_0x1f53('0x13'),_0x277e65,_0x5bfa15[_0x1f53('0x11')]['message']);return _0xba0034(_0x5bfa15['error']['message']);}else{logger[_0x1f53('0x15')]('ZendeskConfiguration,\x20%s,\x20%s',_0x277e65,_0x1f53('0xd'));_0xba0034(_0x5bfa15[_0x1f53('0x16')][_0x1f53('0x14')]);}})['catch'](function(_0x5dc077){logger[_0x1f53('0x11')](_0x1f53('0x13'),_0x277e65,_0x5dc077);_0x162225(_0x5dc077);});});} \ No newline at end of file +var _0x3277=['request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ZendeskConfiguration,\x20%s,\x20%s','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info'];(function(_0x194acc,_0x16a88a){var _0x2b7aab=function(_0x52944f){while(--_0x52944f){_0x194acc['push'](_0x194acc['shift']());}};_0x2b7aab(++_0x16a88a);}(_0x3277,0x16a));var _0x7327=function(_0x295ae4,_0x3838ce){_0x295ae4=_0x295ae4-0x0;var _0x12437b=_0x3277[_0x295ae4];return _0x12437b;};'use strict';var _=require('lodash');var util=require(_0x7327('0x0'));var moment=require(_0x7327('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7327('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x7327('0x3'));var logger=require(_0x7327('0x4'))(_0x7327('0x5'));var config=require(_0x7327('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x7327('0x7')][_0x7327('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4123c5,_0x16a9e5,_0x30ab66){return new BPromise(function(_0x24f5a7,_0x5098fa){return client[_0x7327('0x9')](_0x4123c5,_0x30ab66)[_0x7327('0xa')](function(_0x59d75d){logger[_0x7327('0xb')]('ZendeskConfiguration,\x20%s,\x20%s',_0x16a9e5,_0x7327('0xc'));logger[_0x7327('0xd')](_0x7327('0xe'),_0x16a9e5,'request\x20sent',JSON[_0x7327('0xf')](_0x59d75d));if(_0x59d75d[_0x7327('0x10')]){if(_0x59d75d['error'][_0x7327('0x11')]===0x1f4){logger[_0x7327('0x10')]('ZendeskConfiguration,\x20%s,\x20%s',_0x16a9e5,_0x59d75d[_0x7327('0x10')][_0x7327('0x12')]);return _0x5098fa(_0x59d75d[_0x7327('0x10')][_0x7327('0x12')]);}logger['error']('ZendeskConfiguration,\x20%s,\x20%s',_0x16a9e5,_0x59d75d['error'][_0x7327('0x12')]);return _0x24f5a7(_0x59d75d[_0x7327('0x10')][_0x7327('0x12')]);}else{logger[_0x7327('0xb')]('ZendeskConfiguration,\x20%s,\x20%s',_0x16a9e5,'request\x20sent');_0x24f5a7(_0x59d75d[_0x7327('0x13')][_0x7327('0x12')]);}})[_0x7327('0x14')](function(_0x25ca17){logger['error'](_0x7327('0x15'),_0x16a9e5,_0x25ca17);_0x5098fa(_0x25ca17);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index 1fe72e3..b1316b8 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 _0xb570=['./intZendeskField.controller','get','isAuthenticated','/:id','show','post','put','delete','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0xc4001c,_0x1bf8f0){var _0x49f7bc=function(_0x1059b8){while(--_0x1059b8){_0xc4001c['push'](_0xc4001c['shift']());}};_0x49f7bc(++_0x1bf8f0);}(_0xb570,0x199));var _0x0b57=function(_0x59be33,_0x299e17){_0x59be33=_0x59be33-0x0;var _0x439edb=_0xb570[_0x59be33];return _0x439edb;};'use strict';var multer=require('multer');var util=require(_0x0b57('0x0'));var path=require(_0x0b57('0x1'));var timeout=require('connect-timeout');var express=require(_0x0b57('0x2'));var router=express[_0x0b57('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0b57('0x4'));var interaction=require(_0x0b57('0x5'));var config=require(_0x0b57('0x6'));var controller=require(_0x0b57('0x7'));router[_0x0b57('0x8')]('/',auth[_0x0b57('0x9')](),controller['index']);router[_0x0b57('0x8')](_0x0b57('0xa'),auth[_0x0b57('0x9')](),controller[_0x0b57('0xb')]);router[_0x0b57('0xc')]('/',auth[_0x0b57('0x9')](),controller['create']);router[_0x0b57('0xd')](_0x0b57('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x0b57('0xe')]('/:id',auth[_0x0b57('0x9')](),controller['destroy']);module[_0x0b57('0xf')]=router; \ No newline at end of file +var _0x8a65=['delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','index','/:id','isAuthenticated','show','create','put'];(function(_0x3e4dca,_0x4541b3){var _0x3d3e08=function(_0x2f9d03){while(--_0x2f9d03){_0x3e4dca['push'](_0x3e4dca['shift']());}};_0x3d3e08(++_0x4541b3);}(_0x8a65,0x1b2));var _0x58a6=function(_0x86337d,_0x2b57c3){_0x86337d=_0x86337d-0x0;var _0x22b2c6=_0x8a65[_0x86337d];return _0x22b2c6;};'use strict';var multer=require(_0x58a6('0x0'));var util=require(_0x58a6('0x1'));var path=require(_0x58a6('0x2'));var timeout=require(_0x58a6('0x3'));var express=require('express');var router=express[_0x58a6('0x4')]();var fs_extra=require(_0x58a6('0x5'));var auth=require(_0x58a6('0x6'));var interaction=require(_0x58a6('0x7'));var config=require(_0x58a6('0x8'));var controller=require(_0x58a6('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x58a6('0xa')]);router['get'](_0x58a6('0xb'),auth[_0x58a6('0xc')](),controller[_0x58a6('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x58a6('0xe')]);router[_0x58a6('0xf')]('/:id',auth[_0x58a6('0xc')](),controller['update']);router[_0x58a6('0x10')]('/:id',auth[_0x58a6('0xc')](),controller['destroy']);module[_0x58a6('0x11')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index b6b05ec..93e8d4b 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 _0xc7ab=['BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','STRING'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xc7ab,0x1e1));var _0xbc7a=function(_0x1cc3eb,_0x537dd5){_0x1cc3eb=_0x1cc3eb-0x0;var _0x3ffbf7=_0xc7ab[_0x1cc3eb];return _0x3ffbf7;};'use strict';var Sequelize=require(_0xbc7a('0x0'));module[_0xbc7a('0x1')]={'type':{'type':Sequelize[_0xbc7a('0x2')](_0xbc7a('0x3'),_0xbc7a('0x4'),_0xbc7a('0x5'),'keyValue','picklist'),'defaultValue':_0xbc7a('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xbc7a('0x6')]},'keyType':{'type':Sequelize[_0xbc7a('0x2')](_0xbc7a('0x3'),_0xbc7a('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0xbc7a('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xbc7a('0x6')]},'customField':{'type':Sequelize[_0xbc7a('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xbc7a('0x6')]}}; \ No newline at end of file +var _0x974c=['variable','keyValue','picklist','STRING','string','BOOLEAN','sequelize','exports','ENUM'];(function(_0x55cf16,_0x1ca391){var _0x1e85b6=function(_0x139b91){while(--_0x139b91){_0x55cf16['push'](_0x55cf16['shift']());}};_0x1e85b6(++_0x1ca391);}(_0x974c,0xf9));var _0xc974=function(_0x305dc2,_0x81cbe0){_0x305dc2=_0x305dc2-0x0;var _0x5c1c2e=_0x974c[_0x305dc2];return _0x5c1c2e;};'use strict';var Sequelize=require(_0xc974('0x0'));module[_0xc974('0x1')]={'type':{'type':Sequelize[_0xc974('0x2')]('string',_0xc974('0x3'),'customVariable',_0xc974('0x4'),_0xc974('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0xc974('0x6')]},'key':{'type':Sequelize[_0xc974('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0xc974('0x7'),_0xc974('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0xc974('0x6')]},'idField':{'type':Sequelize[_0xc974('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xc974('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 58f91bb..5530fdb 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 _0x1acc=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','count','set','apply','reject','save','update','then','destroy','error','name','send','index','map','ZendeskField','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','params','keys','length','find','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch'];(function(_0x5412f6,_0x54357f){var _0x8477fd=function(_0x4ef946){while(--_0x4ef946){_0x5412f6['push'](_0x5412f6['shift']());}};_0x8477fd(++_0x54357f);}(_0x1acc,0x15c));var _0xc1ac=function(_0x58a96d,_0x361ad5){_0x58a96d=_0x58a96d-0x0;var _0x17a9e4=_0x1acc[_0x58a96d];return _0x17a9e4;};'use strict';var emlformat=require(_0xc1ac('0x0'));var rimraf=require(_0xc1ac('0x1'));var zipdir=require(_0xc1ac('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc1ac('0x3'));var moment=require(_0xc1ac('0x4'));var BPromise=require(_0xc1ac('0x5'));var Mustache=require(_0xc1ac('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xc1ac('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc1ac('0x8'));var _=require(_0xc1ac('0x9'));var squel=require(_0xc1ac('0xa'));var crypto=require(_0xc1ac('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xc1ac('0xc'));var toCsv=require('to-csv');var querystring=require(_0xc1ac('0xd'));var Papa=require(_0xc1ac('0xe'));var Redis=require('ioredis');var authService=require(_0xc1ac('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xc1ac('0x10'));var hardwareService=require(_0xc1ac('0x11'));var logger=require(_0xc1ac('0x12'))(_0xc1ac('0x13'));var utils=require(_0xc1ac('0x14'));var config=require(_0xc1ac('0x15'));var licenseUtil=require(_0xc1ac('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3380c2,_0x1ff4a8){_0x1ff4a8=_0x1ff4a8||0xcc;return function(_0x40b085){if(_0x40b085){return _0x3380c2[_0xc1ac('0x17')](_0x1ff4a8);}return _0x3380c2[_0xc1ac('0x18')](_0x1ff4a8)[_0xc1ac('0x19')]();};}function respondWithResult(_0x3f9c27,_0x8030b){_0x8030b=_0x8030b||0xc8;return function(_0xc358ff){if(_0xc358ff){return _0x3f9c27[_0xc1ac('0x18')](_0x8030b)[_0xc1ac('0x1a')](_0xc358ff);}};}function respondWithFilteredResult(_0x3bb152,_0x389bf6){return function(_0x49cbb1){if(_0x49cbb1){var _0x31cbfe=typeof _0x389bf6[_0xc1ac('0x1b')]==='undefined'&&typeof _0x389bf6[_0xc1ac('0x1c')]==='undefined';var _0x3c0065=_0x49cbb1[_0xc1ac('0x1d')];var _0x4cf798=_0x31cbfe?0x0:_0x389bf6[_0xc1ac('0x1b')];var _0x22c1ed=_0x31cbfe?_0x49cbb1['count']:_0x389bf6[_0xc1ac('0x1b')]+_0x389bf6[_0xc1ac('0x1c')];var _0x5c30cf;if(_0x22c1ed>=_0x3c0065){_0x22c1ed=_0x3c0065;_0x5c30cf=0xc8;}else{_0x5c30cf=0xce;}_0x3bb152['status'](_0x5c30cf);return _0x3bb152[_0xc1ac('0x1e')]('Content-Range',_0x4cf798+'-'+_0x22c1ed+'/'+_0x3c0065)[_0xc1ac('0x1a')](_0x49cbb1);}return null;};}function patchUpdates(_0x573c8d){return function(_0x522b32){try{jsonpatch[_0xc1ac('0x1f')](_0x522b32,_0x573c8d,!![]);}catch(_0x578b44){return BPromise[_0xc1ac('0x20')](_0x578b44);}return _0x522b32[_0xc1ac('0x21')]();};}function saveUpdates(_0x53b994,_0x3fe644){return function(_0x9aeaac){if(_0x9aeaac){return _0x9aeaac[_0xc1ac('0x22')](_0x53b994)[_0xc1ac('0x23')](function(_0x3b1e1c){return _0x3b1e1c;});}return null;};}function removeEntity(_0x2d6fa9,_0x5b6362){return function(_0x1afcb4){if(_0x1afcb4){return _0x1afcb4[_0xc1ac('0x24')]()[_0xc1ac('0x23')](function(){_0x2d6fa9[_0xc1ac('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b904b,_0x4fe0fe){return function(_0x1192e4){if(!_0x1192e4){_0x3b904b[_0xc1ac('0x17')](0x194);}return _0x1192e4;};}function handleError(_0x166b12,_0x442025){_0x442025=_0x442025||0x1f4;return function(_0x2ba4bd){logger[_0xc1ac('0x25')](_0x2ba4bd['stack']);if(_0x2ba4bd[_0xc1ac('0x26')]){delete _0x2ba4bd[_0xc1ac('0x26')];}_0x166b12[_0xc1ac('0x18')](_0x442025)[_0xc1ac('0x27')](_0x2ba4bd);};}exports[_0xc1ac('0x28')]=function(_0x58d05e,_0x39d503){var _0x2d5426={},_0x2fbe5a={},_0x56b7f2={'count':0x0,'rows':[]};var _0x163210=_[_0xc1ac('0x29')](db[_0xc1ac('0x2a')][_0xc1ac('0x2b')],function(_0x5cb01d){return{'name':_0x5cb01d[_0xc1ac('0x2c')],'type':_0x5cb01d[_0xc1ac('0x2d')][_0xc1ac('0x2e')]};});_0x2fbe5a[_0xc1ac('0x2f')]=_[_0xc1ac('0x29')](_0x163210,_0xc1ac('0x26'));_0x2fbe5a[_0xc1ac('0x30')]=_['keys'](_0x58d05e['query']);_0x2fbe5a[_0xc1ac('0x31')]=_[_0xc1ac('0x32')](_0x2fbe5a[_0xc1ac('0x2f')],_0x2fbe5a[_0xc1ac('0x30')]);_0x2d5426[_0xc1ac('0x33')]=_[_0xc1ac('0x32')](_0x2fbe5a[_0xc1ac('0x2f')],qs[_0xc1ac('0x34')](_0x58d05e[_0xc1ac('0x30')][_0xc1ac('0x34')]));_0x2d5426[_0xc1ac('0x33')]=_0x2d5426[_0xc1ac('0x33')]['length']?_0x2d5426[_0xc1ac('0x33')]:_0x2fbe5a[_0xc1ac('0x2f')];if(!_0x58d05e[_0xc1ac('0x30')][_0xc1ac('0x35')](_0xc1ac('0x36'))){_0x2d5426[_0xc1ac('0x1c')]=qs[_0xc1ac('0x1c')](_0x58d05e[_0xc1ac('0x30')][_0xc1ac('0x1c')]);_0x2d5426[_0xc1ac('0x1b')]=qs[_0xc1ac('0x1b')](_0x58d05e[_0xc1ac('0x30')][_0xc1ac('0x1b')]);}_0x2d5426[_0xc1ac('0x37')]=qs[_0xc1ac('0x38')](_0x58d05e[_0xc1ac('0x30')][_0xc1ac('0x38')]);_0x2d5426[_0xc1ac('0x39')]=qs[_0xc1ac('0x31')](_[_0xc1ac('0x3a')](_0x58d05e['query'],_0x2fbe5a['filters']),_0x163210);if(_0x58d05e[_0xc1ac('0x30')][_0xc1ac('0x3b')]){_0x2d5426[_0xc1ac('0x39')]=_[_0xc1ac('0x3c')](_0x2d5426[_0xc1ac('0x39')],{'$or':_[_0xc1ac('0x29')](_0x163210,function(_0x4700e8){if(_0x4700e8[_0xc1ac('0x2d')]!==_0xc1ac('0x3d')){var _0x1d9a72={};_0x1d9a72[_0x4700e8[_0xc1ac('0x26')]]={'$like':'%'+_0x58d05e['query'][_0xc1ac('0x3b')]+'%'};return _0x1d9a72;}})});}_0x2d5426=_[_0xc1ac('0x3c')]({},_0x2d5426,_0x58d05e[_0xc1ac('0x3e')]);var _0x3ab8e1={'where':_0x2d5426['where']};return db[_0xc1ac('0x2a')][_0xc1ac('0x1d')](_0x3ab8e1)[_0xc1ac('0x23')](function(_0x5e162c){_0x56b7f2[_0xc1ac('0x1d')]=_0x5e162c;if(_0x58d05e[_0xc1ac('0x30')][_0xc1ac('0x3f')]){_0x2d5426['include']=[{'all':!![]}];}return db[_0xc1ac('0x2a')]['findAll'](_0x2d5426);})['then'](function(_0x48e67d){_0x56b7f2[_0xc1ac('0x40')]=_0x48e67d;return _0x56b7f2;})[_0xc1ac('0x23')](respondWithFilteredResult(_0x39d503,_0x2d5426))[_0xc1ac('0x41')](handleError(_0x39d503,null));};exports[_0xc1ac('0x42')]=function(_0x5fee31,_0x3e4997){var _0x3bf412={'raw':!![],'where':{'id':_0x5fee31[_0xc1ac('0x43')]['id']}},_0x43279e={};_0x43279e[_0xc1ac('0x2f')]=_[_0xc1ac('0x44')](db[_0xc1ac('0x2a')][_0xc1ac('0x2b')]);_0x43279e['query']=_['keys'](_0x5fee31[_0xc1ac('0x30')]);_0x43279e['filters']=_[_0xc1ac('0x32')](_0x43279e[_0xc1ac('0x2f')],_0x43279e[_0xc1ac('0x30')]);_0x3bf412[_0xc1ac('0x33')]=_[_0xc1ac('0x32')](_0x43279e['model'],qs['fields'](_0x5fee31['query']['fields']));_0x3bf412['attributes']=_0x3bf412[_0xc1ac('0x33')][_0xc1ac('0x45')]?_0x3bf412[_0xc1ac('0x33')]:_0x43279e[_0xc1ac('0x2f')];if(_0x5fee31['query'][_0xc1ac('0x3f')]){_0x3bf412['include']=[{'all':!![]}];}_0x3bf412=_[_0xc1ac('0x3c')]({},_0x3bf412,_0x5fee31[_0xc1ac('0x3e')]);return db['ZendeskField'][_0xc1ac('0x46')](_0x3bf412)[_0xc1ac('0x23')](handleEntityNotFound(_0x3e4997,null))[_0xc1ac('0x23')](respondWithResult(_0x3e4997,null))[_0xc1ac('0x41')](handleError(_0x3e4997,null));};exports[_0xc1ac('0x47')]=function(_0xe714c2,_0x291f50){return db[_0xc1ac('0x2a')][_0xc1ac('0x47')](_0xe714c2['body'],{})[_0xc1ac('0x23')](respondWithResult(_0x291f50,0xc9))[_0xc1ac('0x41')](handleError(_0x291f50,null));};exports[_0xc1ac('0x22')]=function(_0x19c9a9,_0x356af8){if(_0x19c9a9[_0xc1ac('0x48')]['id']){delete _0x19c9a9[_0xc1ac('0x48')]['id'];}return db[_0xc1ac('0x2a')][_0xc1ac('0x46')]({'where':{'id':_0x19c9a9[_0xc1ac('0x43')]['id']}})[_0xc1ac('0x23')](handleEntityNotFound(_0x356af8,null))['then'](saveUpdates(_0x19c9a9['body'],null))[_0xc1ac('0x23')](respondWithResult(_0x356af8,null))['catch'](handleError(_0x356af8,null));};exports['destroy']=function(_0x2eb0b3,_0x5669aa){return db[_0xc1ac('0x2a')][_0xc1ac('0x46')]({'where':{'id':_0x2eb0b3[_0xc1ac('0x43')]['id']}})[_0xc1ac('0x23')](handleEntityNotFound(_0x5669aa,null))['then'](removeEntity(_0x5669aa,null))[_0xc1ac('0x41')](handleError(_0x5669aa,null));}; \ No newline at end of file +var _0xfde6=['ZendeskField','rawAttributes','fieldName','type','key','model','map','keys','query','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','intersection','find','create','body','update','params','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','error','name','send'];(function(_0x53276c,_0x6a1efe){var _0x4b2bcb=function(_0xdfa108){while(--_0xdfa108){_0x53276c['push'](_0x53276c['shift']());}};_0x4b2bcb(++_0x6a1efe);}(_0xfde6,0x19f));var _0x6fde=function(_0x12c005,_0x398274){_0x12c005=_0x12c005-0x0;var _0x3edc45=_0xfde6[_0x12c005];return _0x3edc45;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x6fde('0x0'));var rp=require('request-promise');var moment=require(_0x6fde('0x1'));var BPromise=require(_0x6fde('0x2'));var Mustache=require(_0x6fde('0x3'));var util=require(_0x6fde('0x4'));var path=require(_0x6fde('0x5'));var sox=require(_0x6fde('0x6'));var csv=require(_0x6fde('0x7'));var ejs=require(_0x6fde('0x8'));var fs=require('fs');var fs_extra=require(_0x6fde('0x9'));var _=require(_0x6fde('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6fde('0xb'));var deskjs=require(_0x6fde('0xc'));var toCsv=require('to-csv');var querystring=require(_0x6fde('0xd'));var Papa=require(_0x6fde('0xe'));var Redis=require('ioredis');var authService=require(_0x6fde('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x6fde('0x10'));var hardwareService=require(_0x6fde('0x11'));var logger=require(_0x6fde('0x12'))(_0x6fde('0x13'));var utils=require(_0x6fde('0x14'));var config=require(_0x6fde('0x15'));var licenseUtil=require(_0x6fde('0x16'));var db=require(_0x6fde('0x17'))['db'];function respondWithStatusCode(_0x203649,_0x1db44c){_0x1db44c=_0x1db44c||0xcc;return function(_0x1cf5ad){if(_0x1cf5ad){return _0x203649[_0x6fde('0x18')](_0x1db44c);}return _0x203649[_0x6fde('0x19')](_0x1db44c)[_0x6fde('0x1a')]();};}function respondWithResult(_0x262423,_0x8d82f0){_0x8d82f0=_0x8d82f0||0xc8;return function(_0x4f3b8b){if(_0x4f3b8b){return _0x262423['status'](_0x8d82f0)[_0x6fde('0x1b')](_0x4f3b8b);}};}function respondWithFilteredResult(_0x500f7d,_0x4ec874){return function(_0x518914){if(_0x518914){var _0x1a0e6d=typeof _0x4ec874['offset']===_0x6fde('0x1c')&&typeof _0x4ec874['limit']===_0x6fde('0x1c');var _0x385956=_0x518914[_0x6fde('0x1d')];var _0x4ab384=_0x1a0e6d?0x0:_0x4ec874['offset'];var _0x4319cd=_0x1a0e6d?_0x518914[_0x6fde('0x1d')]:_0x4ec874['offset']+_0x4ec874[_0x6fde('0x1e')];var _0x3e89ec;if(_0x4319cd>=_0x385956){_0x4319cd=_0x385956;_0x3e89ec=0xc8;}else{_0x3e89ec=0xce;}_0x500f7d[_0x6fde('0x19')](_0x3e89ec);return _0x500f7d[_0x6fde('0x1f')](_0x6fde('0x20'),_0x4ab384+'-'+_0x4319cd+'/'+_0x385956)[_0x6fde('0x1b')](_0x518914);}return null;};}function patchUpdates(_0x303268){return function(_0x2f98fe){try{jsonpatch[_0x6fde('0x21')](_0x2f98fe,_0x303268,!![]);}catch(_0x8390f2){return BPromise[_0x6fde('0x22')](_0x8390f2);}return _0x2f98fe[_0x6fde('0x23')]();};}function saveUpdates(_0xb0fd20,_0x35955d){return function(_0x3139ba){if(_0x3139ba){return _0x3139ba['update'](_0xb0fd20)[_0x6fde('0x24')](function(_0x3949dc){return _0x3949dc;});}return null;};}function removeEntity(_0x40e988,_0x169c78){return function(_0x572b1e){if(_0x572b1e){return _0x572b1e[_0x6fde('0x25')]()[_0x6fde('0x24')](function(){_0x40e988[_0x6fde('0x19')](0xcc)[_0x6fde('0x1a')]();});}};}function handleEntityNotFound(_0x5ad904,_0x30823f){return function(_0x9ac67b){if(!_0x9ac67b){_0x5ad904[_0x6fde('0x18')](0x194);}return _0x9ac67b;};}function handleError(_0x3d48c8,_0x5c5d38){_0x5c5d38=_0x5c5d38||0x1f4;return function(_0x217b29){logger[_0x6fde('0x26')](_0x217b29['stack']);if(_0x217b29[_0x6fde('0x27')]){delete _0x217b29[_0x6fde('0x27')];}_0x3d48c8['status'](_0x5c5d38)[_0x6fde('0x28')](_0x217b29);};}exports['index']=function(_0x3eafe2,_0x29be11){var _0x2f2b0b={},_0x185ac7={},_0x58b8f2={'count':0x0,'rows':[]};var _0x2f2afa=_['map'](db[_0x6fde('0x29')][_0x6fde('0x2a')],function(_0x4abacc){return{'name':_0x4abacc[_0x6fde('0x2b')],'type':_0x4abacc[_0x6fde('0x2c')][_0x6fde('0x2d')]};});_0x185ac7[_0x6fde('0x2e')]=_[_0x6fde('0x2f')](_0x2f2afa,_0x6fde('0x27'));_0x185ac7['query']=_[_0x6fde('0x30')](_0x3eafe2[_0x6fde('0x31')]);_0x185ac7['filters']=_['intersection'](_0x185ac7[_0x6fde('0x2e')],_0x185ac7['query']);_0x2f2b0b[_0x6fde('0x32')]=_['intersection'](_0x185ac7[_0x6fde('0x2e')],qs[_0x6fde('0x33')](_0x3eafe2[_0x6fde('0x31')][_0x6fde('0x33')]));_0x2f2b0b[_0x6fde('0x32')]=_0x2f2b0b['attributes'][_0x6fde('0x34')]?_0x2f2b0b[_0x6fde('0x32')]:_0x185ac7[_0x6fde('0x2e')];if(!_0x3eafe2['query'][_0x6fde('0x35')](_0x6fde('0x36'))){_0x2f2b0b[_0x6fde('0x1e')]=qs['limit'](_0x3eafe2[_0x6fde('0x31')][_0x6fde('0x1e')]);_0x2f2b0b[_0x6fde('0x37')]=qs['offset'](_0x3eafe2[_0x6fde('0x31')]['offset']);}_0x2f2b0b[_0x6fde('0x38')]=qs[_0x6fde('0x39')](_0x3eafe2[_0x6fde('0x31')][_0x6fde('0x39')]);_0x2f2b0b[_0x6fde('0x3a')]=qs[_0x6fde('0x3b')](_[_0x6fde('0x3c')](_0x3eafe2[_0x6fde('0x31')],_0x185ac7['filters']),_0x2f2afa);if(_0x3eafe2['query'][_0x6fde('0x3d')]){_0x2f2b0b[_0x6fde('0x3a')]=_['merge'](_0x2f2b0b[_0x6fde('0x3a')],{'$or':_['map'](_0x2f2afa,function(_0x47447d){if(_0x47447d[_0x6fde('0x2c')]!==_0x6fde('0x3e')){var _0x5a66a2={};_0x5a66a2[_0x47447d[_0x6fde('0x27')]]={'$like':'%'+_0x3eafe2[_0x6fde('0x31')][_0x6fde('0x3d')]+'%'};return _0x5a66a2;}})});}_0x2f2b0b=_[_0x6fde('0x3f')]({},_0x2f2b0b,_0x3eafe2[_0x6fde('0x40')]);var _0x3eca02={'where':_0x2f2b0b[_0x6fde('0x3a')]};return db[_0x6fde('0x29')]['count'](_0x3eca02)['then'](function(_0x25990e){_0x58b8f2[_0x6fde('0x1d')]=_0x25990e;if(_0x3eafe2[_0x6fde('0x31')][_0x6fde('0x41')]){_0x2f2b0b[_0x6fde('0x42')]=[{'all':!![]}];}return db[_0x6fde('0x29')]['findAll'](_0x2f2b0b);})[_0x6fde('0x24')](function(_0x3f6fd4){_0x58b8f2[_0x6fde('0x43')]=_0x3f6fd4;return _0x58b8f2;})[_0x6fde('0x24')](respondWithFilteredResult(_0x29be11,_0x2f2b0b))[_0x6fde('0x44')](handleError(_0x29be11,null));};exports[_0x6fde('0x45')]=function(_0x329fc8,_0x2b2a5a){var _0x52d0c2={'raw':!![],'where':{'id':_0x329fc8['params']['id']}},_0x38c7aa={};_0x38c7aa[_0x6fde('0x2e')]=_['keys'](db[_0x6fde('0x29')][_0x6fde('0x2a')]);_0x38c7aa['query']=_[_0x6fde('0x30')](_0x329fc8[_0x6fde('0x31')]);_0x38c7aa[_0x6fde('0x3b')]=_[_0x6fde('0x46')](_0x38c7aa[_0x6fde('0x2e')],_0x38c7aa[_0x6fde('0x31')]);_0x52d0c2['attributes']=_['intersection'](_0x38c7aa[_0x6fde('0x2e')],qs['fields'](_0x329fc8[_0x6fde('0x31')][_0x6fde('0x33')]));_0x52d0c2[_0x6fde('0x32')]=_0x52d0c2[_0x6fde('0x32')][_0x6fde('0x34')]?_0x52d0c2[_0x6fde('0x32')]:_0x38c7aa[_0x6fde('0x2e')];if(_0x329fc8[_0x6fde('0x31')][_0x6fde('0x41')]){_0x52d0c2[_0x6fde('0x42')]=[{'all':!![]}];}_0x52d0c2=_[_0x6fde('0x3f')]({},_0x52d0c2,_0x329fc8['options']);return db[_0x6fde('0x29')][_0x6fde('0x47')](_0x52d0c2)[_0x6fde('0x24')](handleEntityNotFound(_0x2b2a5a,null))['then'](respondWithResult(_0x2b2a5a,null))[_0x6fde('0x44')](handleError(_0x2b2a5a,null));};exports[_0x6fde('0x48')]=function(_0x26de38,_0x485359){return db[_0x6fde('0x29')][_0x6fde('0x48')](_0x26de38[_0x6fde('0x49')],{})['then'](respondWithResult(_0x485359,0xc9))[_0x6fde('0x44')](handleError(_0x485359,null));};exports[_0x6fde('0x4a')]=function(_0x10a66b,_0x5189f9){if(_0x10a66b['body']['id']){delete _0x10a66b['body']['id'];}return db[_0x6fde('0x29')][_0x6fde('0x47')]({'where':{'id':_0x10a66b[_0x6fde('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5189f9,null))[_0x6fde('0x24')](saveUpdates(_0x10a66b[_0x6fde('0x49')],null))['then'](respondWithResult(_0x5189f9,null))[_0x6fde('0x44')](handleError(_0x5189f9,null));};exports['destroy']=function(_0x3c98b6,_0x11b394){return db[_0x6fde('0x29')][_0x6fde('0x47')]({'where':{'id':_0x3c98b6[_0x6fde('0x4b')]['id']}})['then'](handleEntityNotFound(_0x11b394,null))[_0x6fde('0x24')](removeEntity(_0x11b394,null))[_0x6fde('0x44')](handleError(_0x11b394,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 024d4af..8bcea99 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 _0x9467=['int_zendesk_fields','zendesk_unique_index','idField','FieldId','lodash','util','api','bluebird','request-promise','path','rimraf','exports','define','ZendeskField'];(function(_0x580ef3,_0x471646){var _0x46a603=function(_0x39e7e1){while(--_0x39e7e1){_0x580ef3['push'](_0x580ef3['shift']());}};_0x46a603(++_0x471646);}(_0x9467,0x18c));var _0x7946=function(_0x4e0cb7,_0x2889de){_0x4e0cb7=_0x4e0cb7-0x0;var _0x2fcc7f=_0x9467[_0x4e0cb7];return _0x2fcc7f;};'use strict';var _=require(_0x7946('0x0'));var util=require(_0x7946('0x1'));var logger=require('../../config/logger')(_0x7946('0x2'));var moment=require('moment');var BPromise=require(_0x7946('0x3'));var rp=require(_0x7946('0x4'));var fs=require('fs');var path=require(_0x7946('0x5'));var rimraf=require(_0x7946('0x6'));var config=require('../../config/environment');var attributes=require('./intZendeskField.attributes');module[_0x7946('0x7')]=function(_0x1b189b,_0xc4a317){return _0x1b189b[_0x7946('0x8')](_0x7946('0x9'),attributes,{'tableName':_0x7946('0xa'),'paranoid':![],'indexes':[{'name':_0x7946('0xb'),'fields':[_0x7946('0xc'),_0x7946('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x021e=['zendesk_unique_index','idField','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','ZendeskField','int_zendesk_fields'];(function(_0x3b1b23,_0x21bccd){var _0x1efc85=function(_0x102a95){while(--_0x102a95){_0x3b1b23['push'](_0x3b1b23['shift']());}};_0x1efc85(++_0x21bccd);}(_0x021e,0xf9));var _0xe021=function(_0x21a7c3,_0x135dd1){_0x21a7c3=_0x21a7c3-0x0;var _0x5a6d36=_0x021e[_0x21a7c3];return _0x5a6d36;};'use strict';var _=require('lodash');var util=require(_0xe021('0x0'));var logger=require(_0xe021('0x1'))(_0xe021('0x2'));var moment=require(_0xe021('0x3'));var BPromise=require(_0xe021('0x4'));var rp=require(_0xe021('0x5'));var fs=require('fs');var path=require(_0xe021('0x6'));var rimraf=require(_0xe021('0x7'));var config=require('../../config/environment');var attributes=require('./intZendeskField.attributes');module[_0xe021('0x8')]=function(_0x2d2889,_0x3f9103){return _0x2d2889['define'](_0xe021('0x9'),attributes,{'tableName':_0xe021('0xa'),'paranoid':![],'indexes':[{'name':_0xe021('0xb'),'fields':[_0xe021('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.rpc.js b/server/api/intZendeskField/intZendeskField.rpc.js index fa6cb5e..f7a3227 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 _0x948e=['lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','info','request\x20sent','stringify','error','code','ZendeskField,\x20%s,\x20%s','message','catch'];(function(_0xd39959,_0x302d09){var _0x1ff69c=function(_0x17c97f){while(--_0x17c97f){_0xd39959['push'](_0xd39959['shift']());}};_0x1ff69c(++_0x302d09);}(_0x948e,0xb4));var _0xe948=function(_0x13fdb3,_0x493557){_0x13fdb3=_0x13fdb3-0x0;var _0x212e46=_0x948e[_0x13fdb3];return _0x212e46;};'use strict';var _=require(_0xe948('0x0'));var util=require(_0xe948('0x1'));var moment=require('moment');var BPromise=require(_0xe948('0x2'));var rs=require(_0xe948('0x3'));var fs=require('fs');var Redis=require(_0xe948('0x4'));var db=require(_0xe948('0x5'))['db'];var utils=require(_0xe948('0x6'));var logger=require(_0xe948('0x7'))(_0xe948('0x8'));var config=require('../../config/environment');var jayson=require(_0xe948('0x9'));var client=jayson[_0xe948('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x177a30,_0x185a0c,_0x12a628){return new BPromise(function(_0x42cab6,_0x60198f){return client[_0xe948('0xb')](_0x177a30,_0x12a628)['then'](function(_0x14ca75){logger[_0xe948('0xc')]('ZendeskField,\x20%s,\x20%s',_0x185a0c,_0xe948('0xd'));logger['debug']('ZendeskField,\x20%s,\x20%s,\x20%s',_0x185a0c,_0xe948('0xd'),JSON[_0xe948('0xe')](_0x14ca75));if(_0x14ca75['error']){if(_0x14ca75[_0xe948('0xf')][_0xe948('0x10')]===0x1f4){logger[_0xe948('0xf')](_0xe948('0x11'),_0x185a0c,_0x14ca75[_0xe948('0xf')][_0xe948('0x12')]);return _0x60198f(_0x14ca75[_0xe948('0xf')][_0xe948('0x12')]);}logger['error'](_0xe948('0x11'),_0x185a0c,_0x14ca75[_0xe948('0xf')][_0xe948('0x12')]);return _0x42cab6(_0x14ca75[_0xe948('0xf')][_0xe948('0x12')]);}else{logger[_0xe948('0xc')]('ZendeskField,\x20%s,\x20%s',_0x185a0c,_0xe948('0xd'));_0x42cab6(_0x14ca75['result'][_0xe948('0x12')]);}})[_0xe948('0x13')](function(_0x2e6eaa){logger['error'](_0xe948('0x11'),_0x185a0c,_0x2e6eaa);_0x60198f(_0x2e6eaa);});});} \ No newline at end of file +var _0x6123=['request','info','ZendeskField,\x20%s,\x20%s','request\x20sent','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x12c250,_0x326ae8){var _0x5eb220=function(_0x4484d0){while(--_0x4484d0){_0x12c250['push'](_0x12c250['shift']());}};_0x5eb220(++_0x326ae8);}(_0x6123,0x101));var _0x3612=function(_0x2cf224,_0x2f2384){_0x2cf224=_0x2cf224-0x0;var _0x5765bd=_0x6123[_0x2cf224];return _0x5765bd;};'use strict';var _=require('lodash');var util=require(_0x3612('0x0'));var moment=require(_0x3612('0x1'));var BPromise=require(_0x3612('0x2'));var rs=require(_0x3612('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x3612('0x4'));var logger=require(_0x3612('0x5'))(_0x3612('0x6'));var config=require(_0x3612('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x3612('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5a0b2f,_0x841d4d,_0x16df13){return new BPromise(function(_0xb1fe96,_0x18d786){return client[_0x3612('0x9')](_0x5a0b2f,_0x16df13)['then'](function(_0x2f5f5a){logger[_0x3612('0xa')](_0x3612('0xb'),_0x841d4d,_0x3612('0xc'));logger['debug'](_0x3612('0xd'),_0x841d4d,'request\x20sent',JSON[_0x3612('0xe')](_0x2f5f5a));if(_0x2f5f5a['error']){if(_0x2f5f5a[_0x3612('0xf')][_0x3612('0x10')]===0x1f4){logger[_0x3612('0xf')](_0x3612('0xb'),_0x841d4d,_0x2f5f5a['error'][_0x3612('0x11')]);return _0x18d786(_0x2f5f5a[_0x3612('0xf')][_0x3612('0x11')]);}logger[_0x3612('0xf')]('ZendeskField,\x20%s,\x20%s',_0x841d4d,_0x2f5f5a[_0x3612('0xf')][_0x3612('0x11')]);return _0xb1fe96(_0x2f5f5a[_0x3612('0xf')][_0x3612('0x11')]);}else{logger[_0x3612('0xa')](_0x3612('0xb'),_0x841d4d,'request\x20sent');_0xb1fe96(_0x2f5f5a[_0x3612('0x12')]['message']);}})['catch'](function(_0x578702){logger['error'](_0x3612('0xb'),_0x841d4d,_0x578702);_0x18d786(_0x578702);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 9851776..4af0fdd 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 _0x8a6c=['post','addConfiguration','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZohoAccount.controller','index','get','/:id','isAuthenticated','/:id/configurations','getConfigurations','/:id/fields'];(function(_0x3503dd,_0xfb45fc){var _0x21abe5=function(_0x4ccb54){while(--_0x4ccb54){_0x3503dd['push'](_0x3503dd['shift']());}};_0x21abe5(++_0xfb45fc);}(_0x8a6c,0x7f));var _0xc8a6=function(_0x383029,_0x4a91f0){_0x383029=_0x383029-0x0;var _0x5290a2=_0x8a6c[_0x383029];return _0x5290a2;};'use strict';var multer=require(_0xc8a6('0x0'));var util=require(_0xc8a6('0x1'));var path=require(_0xc8a6('0x2'));var timeout=require(_0xc8a6('0x3'));var express=require(_0xc8a6('0x4'));var router=express[_0xc8a6('0x5')]();var fs_extra=require(_0xc8a6('0x6'));var auth=require(_0xc8a6('0x7'));var interaction=require(_0xc8a6('0x8'));var config=require('../../config/environment');var controller=require(_0xc8a6('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xc8a6('0xa')]);router[_0xc8a6('0xb')](_0xc8a6('0xc'),auth[_0xc8a6('0xd')](),controller['show']);router[_0xc8a6('0xb')](_0xc8a6('0xe'),auth[_0xc8a6('0xd')](),controller[_0xc8a6('0xf')]);router[_0xc8a6('0xb')](_0xc8a6('0x10'),auth[_0xc8a6('0xd')](),controller['getFields']);router[_0xc8a6('0x11')]('/',auth[_0xc8a6('0xd')](),controller['create']);router[_0xc8a6('0x11')](_0xc8a6('0xe'),auth[_0xc8a6('0xd')](),controller[_0xc8a6('0x12')]);router[_0xc8a6('0x13')](_0xc8a6('0xc'),auth[_0xc8a6('0xd')](),controller[_0xc8a6('0x14')]);router[_0xc8a6('0x15')](_0xc8a6('0xc'),auth[_0xc8a6('0xd')](),controller[_0xc8a6('0x16')]);module[_0xc8a6('0x17')]=router; \ No newline at end of file +var _0x5959=['create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','/:id/fields','getFields','post'];(function(_0x27ef8c,_0x5a3640){var _0x1abe1f=function(_0x57db3e){while(--_0x57db3e){_0x27ef8c['push'](_0x27ef8c['shift']());}};_0x1abe1f(++_0x5a3640);}(_0x5959,0x95));var _0x9595=function(_0x31300c,_0x2823e1){_0x31300c=_0x31300c-0x0;var _0x462408=_0x5959[_0x31300c];return _0x462408;};'use strict';var multer=require(_0x9595('0x0'));var util=require(_0x9595('0x1'));var path=require(_0x9595('0x2'));var timeout=require(_0x9595('0x3'));var express=require(_0x9595('0x4'));var router=express[_0x9595('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x9595('0x6'));var interaction=require(_0x9595('0x7'));var config=require(_0x9595('0x8'));var controller=require(_0x9595('0x9'));router[_0x9595('0xa')]('/',auth[_0x9595('0xb')](),controller[_0x9595('0xc')]);router[_0x9595('0xa')](_0x9595('0xd'),auth[_0x9595('0xb')](),controller[_0x9595('0xe')]);router['get'](_0x9595('0xf'),auth[_0x9595('0xb')](),controller['getConfigurations']);router[_0x9595('0xa')](_0x9595('0x10'),auth[_0x9595('0xb')](),controller[_0x9595('0x11')]);router[_0x9595('0x12')]('/',auth[_0x9595('0xb')](),controller[_0x9595('0x13')]);router[_0x9595('0x12')](_0x9595('0xf'),auth[_0x9595('0xb')](),controller['addConfiguration']);router['put'](_0x9595('0xd'),auth['isAuthenticated'](),controller[_0x9595('0x14')]);router[_0x9595('0x15')](_0x9595('0xd'),auth[_0x9595('0xb')](),controller[_0x9595('0x16')]);module[_0x9595('0x17')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index e0f2a2a..49f540e 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 _0xb903=['exports','STRING','sequelize'];(function(_0x1c115b,_0x59d8a5){var _0x234a18=function(_0x26651c){while(--_0x26651c){_0x1c115b['push'](_0x1c115b['shift']());}};_0x234a18(++_0x59d8a5);}(_0xb903,0x185));var _0x3b90=function(_0x35ae62,_0x298a55){_0x35ae62=_0x35ae62-0x0;var _0x2e9e99=_0xb903[_0x35ae62];return _0x2e9e99;};'use strict';var Sequelize=require(_0x3b90('0x0'));module[_0x3b90('0x1')]={'name':{'type':Sequelize[_0x3b90('0x2')]},'description':{'type':Sequelize[_0x3b90('0x2')]},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0x3b90('0x2')]},'clientId':{'type':Sequelize[_0x3b90('0x2')]},'clientSecret':{'type':Sequelize[_0x3b90('0x2')]},'serverUrl':{'type':Sequelize[_0x3b90('0x2')],'allowNull':![]},'code':{'type':Sequelize[_0x3b90('0x2')]},'refreshToken':{'type':Sequelize[_0x3b90('0x2')]}}; \ No newline at end of file +var _0x84ab=['sequelize','exports','STRING'];(function(_0x3e05f1,_0x218b08){var _0x12e740=function(_0x40a7a8){while(--_0x40a7a8){_0x3e05f1['push'](_0x3e05f1['shift']());}};_0x12e740(++_0x218b08);}(_0x84ab,0x12f));var _0xb84a=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0x84ab[_0x9df060];return _0x338dfe;};'use strict';var Sequelize=require(_0xb84a('0x0'));module[_0xb84a('0x1')]={'name':{'type':Sequelize[_0xb84a('0x2')]},'description':{'type':Sequelize[_0xb84a('0x2')]},'host':{'type':Sequelize[_0xb84a('0x2')]},'zone':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xb84a('0x2')]},'clientSecret':{'type':Sequelize[_0xb84a('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'code':{'type':Sequelize[_0xb84a('0x2')]},'refreshToken':{'type':Sequelize[_0xb84a('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 0d4de84..325f5aa 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 _0xc594=['Owner','Description','WhoId','Call_Duration','Call_Start_Time','Call_Type','includes','push','custom_field','data_type','picklist','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','error','stack','name','send','index','ZohoAccount','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','create','body','catch','getConfigurations','findOne','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZohoConfiguration','ZohoField','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','access_token','getFields','host','zone','code','zoho.eu','com','serverUrl','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','response'];(function(_0x59ec00,_0x4607ec){var _0xd2620b=function(_0x2a4ddc){while(--_0x2a4ddc){_0x59ec00['push'](_0x59ec00['shift']());}};_0xd2620b(++_0x4607ec);}(_0xc594,0x191));var _0x4c59=function(_0x324a76,_0x24279c){_0x324a76=_0x324a76-0x0;var _0x25675f=_0xc594[_0x324a76];return _0x25675f;};'use strict';var emlformat=require(_0x4c59('0x0'));var rimraf=require(_0x4c59('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4c59('0x2'));var rp=require(_0x4c59('0x3'));var moment=require('moment');var BPromise=require(_0x4c59('0x4'));var Mustache=require(_0x4c59('0x5'));var util=require(_0x4c59('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x4c59('0x7'));var ejs=require(_0x4c59('0x8'));var fs=require('fs');var fs_extra=require(_0x4c59('0x9'));var _=require(_0x4c59('0xa'));var squel=require('squel');var crypto=require(_0x4c59('0xb'));var jsforce=require(_0x4c59('0xc'));var deskjs=require(_0x4c59('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4c59('0xe'));var Redis=require(_0x4c59('0xf'));var authService=require(_0x4c59('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x4c59('0x11'));var hardwareService=require(_0x4c59('0x12'));var logger=require(_0x4c59('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x4c59('0x14'));var licenseUtil=require(_0x4c59('0x15'));var db=require('../../mysqldb')['db'];var integrations=require(_0x4c59('0x16'));function respondWithStatusCode(_0x5d2ccd,_0x9f4bf1){_0x9f4bf1=_0x9f4bf1||0xcc;return function(_0x5ce113){if(_0x5ce113){return _0x5d2ccd[_0x4c59('0x17')](_0x9f4bf1);}return _0x5d2ccd[_0x4c59('0x18')](_0x9f4bf1)[_0x4c59('0x19')]();};}function respondWithResult(_0x3251f,_0x1d8a34){_0x1d8a34=_0x1d8a34||0xc8;return function(_0x2c4e5f){if(_0x2c4e5f){return _0x3251f[_0x4c59('0x18')](_0x1d8a34)['json'](_0x2c4e5f);}};}function respondWithFilteredResult(_0x51a9ce,_0x3fc55b){return function(_0x21d9fa){if(_0x21d9fa){var _0x6cb113=typeof _0x3fc55b[_0x4c59('0x1a')]===_0x4c59('0x1b')&&typeof _0x3fc55b[_0x4c59('0x1c')]===_0x4c59('0x1b');var _0x3d8648=_0x21d9fa['count'];var _0x419658=_0x6cb113?0x0:_0x3fc55b['offset'];var _0x328ebd=_0x6cb113?_0x21d9fa[_0x4c59('0x1d')]:_0x3fc55b[_0x4c59('0x1a')]+_0x3fc55b[_0x4c59('0x1c')];var _0x52d9a0;if(_0x328ebd>=_0x3d8648){_0x328ebd=_0x3d8648;_0x52d9a0=0xc8;}else{_0x52d9a0=0xce;}_0x51a9ce[_0x4c59('0x18')](_0x52d9a0);return _0x51a9ce[_0x4c59('0x1e')](_0x4c59('0x1f'),_0x419658+'-'+_0x328ebd+'/'+_0x3d8648)['json'](_0x21d9fa);}return null;};}function patchUpdates(_0x18214e){return function(_0x379f97){try{jsonpatch['apply'](_0x379f97,_0x18214e,!![]);}catch(_0x136ac4){return BPromise[_0x4c59('0x20')](_0x136ac4);}return _0x379f97['save']();};}function saveUpdates(_0x250b4a,_0x3f58e8){return function(_0x1dc432){if(_0x1dc432){return _0x1dc432[_0x4c59('0x21')](_0x250b4a)[_0x4c59('0x22')](function(_0x21e3f9){return _0x21e3f9;});}return null;};}function removeEntity(_0x5053fa,_0x5d1905){return function(_0xbb3481){if(_0xbb3481){return _0xbb3481[_0x4c59('0x23')]()[_0x4c59('0x22')](function(){_0x5053fa[_0x4c59('0x18')](0xcc)[_0x4c59('0x19')]();});}};}function handleEntityNotFound(_0x55eabe,_0x22426c){return function(_0x58fd3f){if(!_0x58fd3f){_0x55eabe['sendStatus'](0x194);}return _0x58fd3f;};}function handleError(_0x111c63,_0x5aeac1){_0x5aeac1=_0x5aeac1||0x1f4;return function(_0x4fa402){logger[_0x4c59('0x24')](_0x4fa402[_0x4c59('0x25')]);if(_0x4fa402[_0x4c59('0x26')]){delete _0x4fa402[_0x4c59('0x26')];}_0x111c63[_0x4c59('0x18')](_0x5aeac1)[_0x4c59('0x27')](_0x4fa402);};}exports[_0x4c59('0x28')]=function(_0x5beeec,_0x339d3d){var _0x2a10c1={},_0x37c49a={},_0x52b5f3={'count':0x0,'rows':[]};var _0x157a3f=_['map'](db[_0x4c59('0x29')]['rawAttributes'],function(_0x2490c8){return{'name':_0x2490c8[_0x4c59('0x2a')],'type':_0x2490c8[_0x4c59('0x2b')][_0x4c59('0x2c')]};});_0x37c49a[_0x4c59('0x2d')]=_[_0x4c59('0x2e')](_0x157a3f,_0x4c59('0x26'));_0x37c49a[_0x4c59('0x2f')]=_[_0x4c59('0x30')](_0x5beeec[_0x4c59('0x2f')]);_0x37c49a['filters']=_[_0x4c59('0x31')](_0x37c49a[_0x4c59('0x2d')],_0x37c49a[_0x4c59('0x2f')]);_0x2a10c1[_0x4c59('0x32')]=_[_0x4c59('0x31')](_0x37c49a[_0x4c59('0x2d')],qs[_0x4c59('0x33')](_0x5beeec['query']['fields']));_0x2a10c1['attributes']=_0x2a10c1[_0x4c59('0x32')][_0x4c59('0x34')]?_0x2a10c1[_0x4c59('0x32')]:_0x37c49a[_0x4c59('0x2d')];if(!_0x5beeec[_0x4c59('0x2f')]['hasOwnProperty'](_0x4c59('0x35'))){_0x2a10c1[_0x4c59('0x1c')]=qs[_0x4c59('0x1c')](_0x5beeec[_0x4c59('0x2f')][_0x4c59('0x1c')]);_0x2a10c1[_0x4c59('0x1a')]=qs[_0x4c59('0x1a')](_0x5beeec[_0x4c59('0x2f')]['offset']);}_0x2a10c1[_0x4c59('0x36')]=qs['sort'](_0x5beeec['query'][_0x4c59('0x37')]);_0x2a10c1[_0x4c59('0x38')]=qs[_0x4c59('0x39')](_[_0x4c59('0x3a')](_0x5beeec[_0x4c59('0x2f')],_0x37c49a[_0x4c59('0x39')]),_0x157a3f);if(_0x5beeec[_0x4c59('0x2f')]['filter']){_0x2a10c1[_0x4c59('0x38')]=_[_0x4c59('0x3b')](_0x2a10c1[_0x4c59('0x38')],{'$or':_[_0x4c59('0x2e')](_0x157a3f,function(_0x503211){if(_0x503211[_0x4c59('0x2b')]!==_0x4c59('0x3c')){var _0x2a6544={};_0x2a6544[_0x503211[_0x4c59('0x26')]]={'$like':'%'+_0x5beeec['query'][_0x4c59('0x3d')]+'%'};return _0x2a6544;}})});}_0x2a10c1=_['merge']({},_0x2a10c1,_0x5beeec[_0x4c59('0x3e')]);var _0x1e8965={'where':_0x2a10c1[_0x4c59('0x38')]};return db['ZohoAccount'][_0x4c59('0x1d')](_0x1e8965)['then'](function(_0x2c3dc1){_0x52b5f3[_0x4c59('0x1d')]=_0x2c3dc1;if(_0x5beeec[_0x4c59('0x2f')][_0x4c59('0x3f')]){_0x2a10c1[_0x4c59('0x40')]=[{'all':!![]}];}return db[_0x4c59('0x29')][_0x4c59('0x41')](_0x2a10c1);})[_0x4c59('0x22')](function(_0x24d397){_0x52b5f3[_0x4c59('0x42')]=_0x24d397;return _0x52b5f3;})['then'](respondWithFilteredResult(_0x339d3d,_0x2a10c1))['catch'](handleError(_0x339d3d,null));};exports[_0x4c59('0x43')]=function(_0x398f71,_0x470378){var _0x2c766c={'raw':![],'where':{'id':_0x398f71[_0x4c59('0x44')]['id']}},_0x10570a={};_0x10570a['model']=_[_0x4c59('0x30')](db[_0x4c59('0x29')][_0x4c59('0x45')]);_0x10570a[_0x4c59('0x2f')]=_[_0x4c59('0x30')](_0x398f71[_0x4c59('0x2f')]);_0x10570a[_0x4c59('0x39')]=_['intersection'](_0x10570a[_0x4c59('0x2d')],_0x10570a[_0x4c59('0x2f')]);_0x2c766c[_0x4c59('0x32')]=_[_0x4c59('0x31')](_0x10570a['model'],qs[_0x4c59('0x33')](_0x398f71[_0x4c59('0x2f')][_0x4c59('0x33')]));_0x2c766c[_0x4c59('0x32')]=_0x2c766c['attributes'][_0x4c59('0x34')]?_0x2c766c[_0x4c59('0x32')]:_0x10570a[_0x4c59('0x2d')];if(_0x398f71[_0x4c59('0x2f')][_0x4c59('0x3f')]){_0x2c766c['include']=[{'all':!![]}];}_0x2c766c=_[_0x4c59('0x3b')]({},_0x2c766c,_0x398f71[_0x4c59('0x3e')]);return db[_0x4c59('0x29')][_0x4c59('0x46')](_0x2c766c)[_0x4c59('0x22')](handleEntityNotFound(_0x470378,null))[_0x4c59('0x22')](respondWithResult(_0x470378,null))['catch'](handleError(_0x470378,null));};exports[_0x4c59('0x47')]=function(_0x2d9f9b,_0x2d7cc2){return db[_0x4c59('0x29')][_0x4c59('0x47')](_0x2d9f9b[_0x4c59('0x48')],{})['then'](respondWithResult(_0x2d7cc2,0xc9))[_0x4c59('0x49')](handleError(_0x2d7cc2,null));};exports['update']=function(_0x197230,_0x56db60){if(_0x197230[_0x4c59('0x48')]['id']){delete _0x197230[_0x4c59('0x48')]['id'];}return db[_0x4c59('0x29')][_0x4c59('0x46')]({'where':{'id':_0x197230[_0x4c59('0x44')]['id']}})[_0x4c59('0x22')](handleEntityNotFound(_0x56db60,null))[_0x4c59('0x22')](saveUpdates(_0x197230['body'],null))[_0x4c59('0x22')](respondWithResult(_0x56db60,null))[_0x4c59('0x49')](handleError(_0x56db60,null));};exports[_0x4c59('0x23')]=function(_0x1e3119,_0x5839c6){return db['ZohoAccount'][_0x4c59('0x46')]({'where':{'id':_0x1e3119[_0x4c59('0x44')]['id']}})['then'](handleEntityNotFound(_0x5839c6,null))[_0x4c59('0x22')](removeEntity(_0x5839c6,null))[_0x4c59('0x49')](handleError(_0x5839c6,null));};exports[_0x4c59('0x4a')]=function(_0x3b0ae3,_0xb1dcdd,_0x56da98){var _0xe48b86={};var _0x428335={};var _0x1b8c0f;var _0x50e7b5;return db[_0x4c59('0x29')][_0x4c59('0x4b')]({'where':{'id':_0x3b0ae3[_0x4c59('0x44')]['id']}})['then'](handleEntityNotFound(_0xb1dcdd,null))[_0x4c59('0x22')](function(_0x56ce65){if(_0x56ce65){_0x1b8c0f=_0x56ce65;_0x428335['model']=_[_0x4c59('0x30')](db['ZohoConfiguration'][_0x4c59('0x45')]);_0x428335[_0x4c59('0x2f')]=_[_0x4c59('0x30')](_0x3b0ae3[_0x4c59('0x2f')]);_0x428335[_0x4c59('0x39')]=_[_0x4c59('0x31')](_0x428335[_0x4c59('0x2d')],_0x428335[_0x4c59('0x2f')]);_0xe48b86['attributes']=_[_0x4c59('0x31')](_0x428335[_0x4c59('0x2d')],qs[_0x4c59('0x33')](_0x3b0ae3['query'][_0x4c59('0x33')]));_0xe48b86[_0x4c59('0x32')]=_0xe48b86[_0x4c59('0x32')][_0x4c59('0x34')]?_0xe48b86[_0x4c59('0x32')]:_0x428335[_0x4c59('0x2d')];_0xe48b86[_0x4c59('0x36')]=qs[_0x4c59('0x37')](_0x3b0ae3['query'][_0x4c59('0x37')]);_0xe48b86['where']=qs[_0x4c59('0x39')](_[_0x4c59('0x3a')](_0x3b0ae3[_0x4c59('0x2f')],_0x428335[_0x4c59('0x39')]));if(_0x3b0ae3[_0x4c59('0x2f')][_0x4c59('0x3d')]){_0xe48b86[_0x4c59('0x38')]=_[_0x4c59('0x3b')](_0xe48b86['where'],{'$or':_[_0x4c59('0x2e')](_0xe48b86[_0x4c59('0x32')],function(_0x5a6538){var _0x539bb3={};_0x539bb3[_0x5a6538]={'$like':'%'+_0x3b0ae3['query'][_0x4c59('0x3d')]+'%'};return _0x539bb3;})});}_0xe48b86=_[_0x4c59('0x3b')]({},_0xe48b86,_0x3b0ae3[_0x4c59('0x3e')]);return _0x1b8c0f['getConfigurations'](_0xe48b86);}})['then'](function(_0x1540b4){if(_0x1540b4){_0x50e7b5=_0x1540b4[_0x4c59('0x34')];if(!_0x3b0ae3[_0x4c59('0x2f')][_0x4c59('0x4c')](_0x4c59('0x35'))){_0xe48b86['limit']=qs[_0x4c59('0x1c')](_0x3b0ae3[_0x4c59('0x2f')][_0x4c59('0x1c')]);_0xe48b86[_0x4c59('0x1a')]=qs[_0x4c59('0x1a')](_0x3b0ae3[_0x4c59('0x2f')][_0x4c59('0x1a')]);}return _0x1b8c0f[_0x4c59('0x4a')](_0xe48b86);}})[_0x4c59('0x22')](function(_0x294d35){if(_0x294d35){return _0x294d35?{'count':_0x50e7b5,'rows':_0x294d35}:null;}})['then'](respondWithResult(_0xb1dcdd,null))['catch'](handleError(_0xb1dcdd,null));};exports[_0x4c59('0x4d')]=function(_0x52de50,_0x1c2003,_0x42579c){if(_0x52de50['body']['id']){delete _0x52de50[_0x4c59('0x48')]['id'];}return db[_0x4c59('0x29')]['findOne']({'where':{'id':_0x52de50[_0x4c59('0x44')]['id']}})[_0x4c59('0x22')](handleEntityNotFound(_0x1c2003,null))[_0x4c59('0x22')](function(_0x118af5){if(_0x118af5){_0x52de50[_0x4c59('0x48')][_0x4c59('0x4e')]=_0x118af5['id'];_0x52de50[_0x4c59('0x48')][_0x4c59('0x4f')]=integrations[_0x4c59('0x50')](_0x52de50[_0x4c59('0x48')][_0x4c59('0x51')],_0x52de50[_0x4c59('0x48')]['type']);_0x52de50['body'][_0x4c59('0x52')]=integrations[_0x4c59('0x53')](_0x52de50[_0x4c59('0x48')][_0x4c59('0x51')],_0x52de50['body'][_0x4c59('0x2b')]);return db[_0x4c59('0x54')][_0x4c59('0x47')](_0x52de50[_0x4c59('0x48')],{'include':[{'model':db['ZohoField'],'as':_0x4c59('0x4f')},{'model':db[_0x4c59('0x55')],'as':_0x4c59('0x52')}]});}return null;})[_0x4c59('0x22')](respondWithResult(_0x1c2003,null))['catch'](handleError(_0x1c2003,null));};function getAccessToken(_0x308804){return new Promise(function(_0x36a672,_0x46b21a){var _0x195bfd;switch(_0x308804['zone']){case'US':_0x195bfd='https://accounts.zoho.com';break;case'AU':_0x195bfd=_0x4c59('0x56');break;case'EU':_0x195bfd=_0x4c59('0x57');break;case'IN':_0x195bfd=_0x4c59('0x58');break;case'CN':_0x195bfd=_0x4c59('0x59');break;default:_0x195bfd='https://accounts.zoho.eu';break;}var _0x51a184={'method':_0x4c59('0x5a'),'uri':_0x195bfd+_0x4c59('0x5b'),'qs':{'refresh_token':_0x308804[_0x4c59('0x5c')],'client_id':_0x308804[_0x4c59('0x5d')],'client_secret':_0x308804[_0x4c59('0x5e')],'grant_type':_0x4c59('0x5f')},'json':!![]};return rp(_0x51a184)[_0x4c59('0x22')](function(_0xcd372){if(_0xcd372[_0x4c59('0x60')]){_0x36a672(_0xcd372[_0x4c59('0x60')]);}else{_0x46b21a('Unable\x20to\x20retrieve\x20the\x20access\x20token');}})[_0x4c59('0x49')](function(_0x49cbe6){_0x46b21a(_0x49cbe6);});});}exports[_0x4c59('0x61')]=function(_0x3d762d,_0x336cab,_0x5e8db7){var _0x28827d,_0x3d5213,_0xaf1a29,_0xa16027,_0x5546b7;return db['ZohoAccount'][_0x4c59('0x4b')]({'where':{'id':_0x3d762d[_0x4c59('0x44')]['id']},'attributes':['id',_0x4c59('0x62'),_0x4c59('0x63'),_0x4c59('0x5d'),'clientSecret','serverUrl',_0x4c59('0x64'),_0x4c59('0x5c')]})[_0x4c59('0x22')](handleEntityNotFound(_0x336cab,null))[_0x4c59('0x22')](function(_0x540af9){_0x5546b7=_0x540af9;_0x28827d=_0x5546b7[_0x4c59('0x62')];_0x3d5213=_0x28827d===_0x4c59('0x65')?'eu':_0x4c59('0x66');_0xaf1a29=_0x5546b7[_0x4c59('0x67')];var _0x36a490=_0xaf1a29['slice'](-0x1);if(_0x36a490==='/'||_0x36a490==='\x5c'||_0x36a490===':'){_0xaf1a29=_0xaf1a29[_0x4c59('0x68')](0x0,_0xaf1a29[_0x4c59('0x69')](_0x36a490));}if(!_0x5546b7[_0x4c59('0x5c')]){throw new Error(_0x4c59('0x6a'));}return getAccessToken(_0x5546b7);})[_0x4c59('0x22')](function(_0x27cc64){if(_0x27cc64){return rp({'method':_0x4c59('0x6b'),'uri':util[_0x4c59('0x6c')](_0x4c59('0x6d'),_0x3d5213),'qs':{'module':'Calls'},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x27cc64},'json':!![]});}})[_0x4c59('0x22')](function(_0x569ae7){if(_0x569ae7){if(_0x569ae7[_0x4c59('0x6e')]&&_0x569ae7[_0x4c59('0x6e')][_0x4c59('0x24')]){throw new Error(_0x569ae7[_0x4c59('0x6e')][_0x4c59('0x24')]['message']);}var _0x54fcbb=[];var _0x5e892a=[];var _0x38a5f7=[_0x4c59('0x6f'),'Subject',_0x4c59('0x70'),_0x4c59('0x71'),_0x4c59('0x72'),'Call_Result',_0x4c59('0x73'),_0x4c59('0x74')];_0x5e892a=_['remove'](_0x569ae7[_0x4c59('0x33')],function(_0x3f15a9){return _0x38a5f7[_0x4c59('0x75')](_0x3f15a9['api_name']);});for(var _0x3c19b4=0x0;_0x3c19b4<_0x5e892a[_0x4c59('0x34')];_0x3c19b4++){if(_0x5e892a[_0x3c19b4]['system_mandatory']===![]){_0x54fcbb[_0x4c59('0x76')]({'id':_0x5e892a[_0x3c19b4]['id'],'name':_0x5e892a[_0x3c19b4]['display_label'],'custom':_0x5e892a[_0x3c19b4][_0x4c59('0x77')],'options':_0x5e892a[_0x3c19b4][_0x4c59('0x78')]===_0x4c59('0x79')&&_0x5e892a[_0x3c19b4][_0x4c59('0x7a')][_0x4c59('0x34')]>-0x1?_['map'](_0x5e892a[_0x3c19b4]['pick_list_values'],function(_0x31b3f7){return{'name':_0x31b3f7,'value':_0x31b3f7};}):[]});}}return{'count':_0x54fcbb[_0x4c59('0x34')],'rows':_0x54fcbb};}else{return{'count':0x0,'rows':[]};}})[_0x4c59('0x22')](respondWithResult(_0x336cab,null))['catch'](function(_0x4da6c6){var _0x251c7f=_0x3d762d['query'][_0x4c59('0x7b')]?0x1f4:_0x4da6c6[_0x4c59('0x7c')]||0x1f4;logger[_0x4c59('0x24')](_0x4c59('0x7d'),_0x4c59('0x61'),_0x251c7f,JSON[_0x4c59('0x7e')](_0x4da6c6));delete _0x4da6c6[_0x4c59('0x26')];if(_0x251c7f===0x191){_0x251c7f=0x190;}_0x336cab[_0x4c59('0x18')](_0x251c7f)[_0x4c59('0x27')](_0x3d762d[_0x4c59('0x2f')]['test']?{'message':_0x4c59('0x7f'),'statusCode':_0x4da6c6['statusCode']}:_0x4da6c6);});}; \ No newline at end of file +var _0x2682=['to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','name','send','index','map','ZohoAccount','rawAttributes','fieldName','type','query','keys','filters','intersection','attributes','model','fields','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','findOne','ZohoConfiguration','pick','getConfigurations','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZohoField','zone','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','refreshToken','clientSecret','access_token','getFields','clientId','serverUrl','code','zoho.eu','slice','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Zoho-oauthtoken\x20','response','error','message','Owner','WhoId','Call_Duration','Call_Result','remove','api_name','push','display_label','custom_field','data_type','picklist','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js'];(function(_0x2571d8,_0x5c090f){var _0x2253b9=function(_0x2ecf76){while(--_0x2ecf76){_0x2571d8['push'](_0x2571d8['shift']());}};_0x2253b9(++_0x5c090f);}(_0x2682,0x169));var _0x2268=function(_0x3c78b3,_0x389ae1){_0x3c78b3=_0x3c78b3-0x0;var _0x549d46=_0x2682[_0x3c78b3];return _0x549d46;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x2268('0x0'));var jsonpatch=require(_0x2268('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2268('0x2'));var Mustache=require(_0x2268('0x3'));var util=require(_0x2268('0x4'));var path=require(_0x2268('0x5'));var sox=require(_0x2268('0x6'));var csv=require('to-csv');var ejs=require(_0x2268('0x7'));var fs=require('fs');var fs_extra=require(_0x2268('0x8'));var _=require(_0x2268('0x9'));var squel=require(_0x2268('0xa'));var crypto=require(_0x2268('0xb'));var jsforce=require(_0x2268('0xc'));var deskjs=require(_0x2268('0xd'));var toCsv=require(_0x2268('0xe'));var querystring=require(_0x2268('0xf'));var Papa=require(_0x2268('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2268('0x11'));var as=require(_0x2268('0x12'));var hardwareService=require(_0x2268('0x13'));var logger=require('../../config/logger')(_0x2268('0x14'));var utils=require('../../config/utils');var config=require(_0x2268('0x15'));var licenseUtil=require(_0x2268('0x16'));var db=require(_0x2268('0x17'))['db'];var integrations=require(_0x2268('0x18'));function respondWithStatusCode(_0x1bb9fe,_0x4555b4){_0x4555b4=_0x4555b4||0xcc;return function(_0x1222fd){if(_0x1222fd){return _0x1bb9fe['sendStatus'](_0x4555b4);}return _0x1bb9fe[_0x2268('0x19')](_0x4555b4)[_0x2268('0x1a')]();};}function respondWithResult(_0x108c3d,_0x5b17a2){_0x5b17a2=_0x5b17a2||0xc8;return function(_0x2188c4){if(_0x2188c4){return _0x108c3d[_0x2268('0x19')](_0x5b17a2)[_0x2268('0x1b')](_0x2188c4);}};}function respondWithFilteredResult(_0x2c19ba,_0x37f99a){return function(_0x33f2bd){if(_0x33f2bd){var _0x590989=typeof _0x37f99a[_0x2268('0x1c')]===_0x2268('0x1d')&&typeof _0x37f99a[_0x2268('0x1e')]===_0x2268('0x1d');var _0x2c9afd=_0x33f2bd[_0x2268('0x1f')];var _0x468a15=_0x590989?0x0:_0x37f99a[_0x2268('0x1c')];var _0x3f6f40=_0x590989?_0x33f2bd[_0x2268('0x1f')]:_0x37f99a['offset']+_0x37f99a[_0x2268('0x1e')];var _0x423ffb;if(_0x3f6f40>=_0x2c9afd){_0x3f6f40=_0x2c9afd;_0x423ffb=0xc8;}else{_0x423ffb=0xce;}_0x2c19ba[_0x2268('0x19')](_0x423ffb);return _0x2c19ba['set'](_0x2268('0x20'),_0x468a15+'-'+_0x3f6f40+'/'+_0x2c9afd)[_0x2268('0x1b')](_0x33f2bd);}return null;};}function patchUpdates(_0x1c4ebb){return function(_0x1264ca){try{jsonpatch[_0x2268('0x21')](_0x1264ca,_0x1c4ebb,!![]);}catch(_0x331a55){return BPromise[_0x2268('0x22')](_0x331a55);}return _0x1264ca[_0x2268('0x23')]();};}function saveUpdates(_0x224a28,_0x24c457){return function(_0x5790a7){if(_0x5790a7){return _0x5790a7[_0x2268('0x24')](_0x224a28)[_0x2268('0x25')](function(_0x1aa5db){return _0x1aa5db;});}return null;};}function removeEntity(_0x2603d8,_0x4564ed){return function(_0x1f2f97){if(_0x1f2f97){return _0x1f2f97['destroy']()[_0x2268('0x25')](function(){_0x2603d8[_0x2268('0x19')](0xcc)[_0x2268('0x1a')]();});}};}function handleEntityNotFound(_0x1c01d5,_0x10f599){return function(_0x11ea3f){if(!_0x11ea3f){_0x1c01d5['sendStatus'](0x194);}return _0x11ea3f;};}function handleError(_0x2c0171,_0x21d682){_0x21d682=_0x21d682||0x1f4;return function(_0x664e57){logger['error'](_0x664e57['stack']);if(_0x664e57['name']){delete _0x664e57[_0x2268('0x26')];}_0x2c0171[_0x2268('0x19')](_0x21d682)[_0x2268('0x27')](_0x664e57);};}exports[_0x2268('0x28')]=function(_0x14f692,_0x5557f0){var _0x3d350f={},_0x18d366={},_0x4fe6ba={'count':0x0,'rows':[]};var _0x4373fc=_[_0x2268('0x29')](db[_0x2268('0x2a')][_0x2268('0x2b')],function(_0x1fc746){return{'name':_0x1fc746[_0x2268('0x2c')],'type':_0x1fc746[_0x2268('0x2d')]['key']};});_0x18d366['model']=_['map'](_0x4373fc,_0x2268('0x26'));_0x18d366[_0x2268('0x2e')]=_[_0x2268('0x2f')](_0x14f692[_0x2268('0x2e')]);_0x18d366[_0x2268('0x30')]=_[_0x2268('0x31')](_0x18d366['model'],_0x18d366['query']);_0x3d350f[_0x2268('0x32')]=_[_0x2268('0x31')](_0x18d366[_0x2268('0x33')],qs[_0x2268('0x34')](_0x14f692['query'][_0x2268('0x34')]));_0x3d350f[_0x2268('0x32')]=_0x3d350f[_0x2268('0x32')]['length']?_0x3d350f[_0x2268('0x32')]:_0x18d366['model'];if(!_0x14f692['query'][_0x2268('0x35')]('nolimit')){_0x3d350f[_0x2268('0x1e')]=qs[_0x2268('0x1e')](_0x14f692[_0x2268('0x2e')][_0x2268('0x1e')]);_0x3d350f[_0x2268('0x1c')]=qs[_0x2268('0x1c')](_0x14f692['query']['offset']);}_0x3d350f[_0x2268('0x36')]=qs[_0x2268('0x37')](_0x14f692['query'][_0x2268('0x37')]);_0x3d350f[_0x2268('0x38')]=qs['filters'](_['pick'](_0x14f692[_0x2268('0x2e')],_0x18d366[_0x2268('0x30')]),_0x4373fc);if(_0x14f692['query'][_0x2268('0x39')]){_0x3d350f[_0x2268('0x38')]=_[_0x2268('0x3a')](_0x3d350f[_0x2268('0x38')],{'$or':_[_0x2268('0x29')](_0x4373fc,function(_0x23aff8){if(_0x23aff8[_0x2268('0x2d')]!==_0x2268('0x3b')){var _0x2a66b2={};_0x2a66b2[_0x23aff8[_0x2268('0x26')]]={'$like':'%'+_0x14f692[_0x2268('0x2e')][_0x2268('0x39')]+'%'};return _0x2a66b2;}})});}_0x3d350f=_[_0x2268('0x3a')]({},_0x3d350f,_0x14f692[_0x2268('0x3c')]);var _0x314331={'where':_0x3d350f['where']};return db['ZohoAccount'][_0x2268('0x1f')](_0x314331)['then'](function(_0xca9065){_0x4fe6ba[_0x2268('0x1f')]=_0xca9065;if(_0x14f692['query'][_0x2268('0x3d')]){_0x3d350f[_0x2268('0x3e')]=[{'all':!![]}];}return db[_0x2268('0x2a')][_0x2268('0x3f')](_0x3d350f);})[_0x2268('0x25')](function(_0x18d102){_0x4fe6ba[_0x2268('0x40')]=_0x18d102;return _0x4fe6ba;})['then'](respondWithFilteredResult(_0x5557f0,_0x3d350f))[_0x2268('0x41')](handleError(_0x5557f0,null));};exports[_0x2268('0x42')]=function(_0x18fca6,_0x5a05d5){var _0x4a2261={'raw':![],'where':{'id':_0x18fca6[_0x2268('0x43')]['id']}},_0x1a9a34={};_0x1a9a34[_0x2268('0x33')]=_[_0x2268('0x2f')](db[_0x2268('0x2a')][_0x2268('0x2b')]);_0x1a9a34['query']=_[_0x2268('0x2f')](_0x18fca6['query']);_0x1a9a34[_0x2268('0x30')]=_['intersection'](_0x1a9a34[_0x2268('0x33')],_0x1a9a34[_0x2268('0x2e')]);_0x4a2261[_0x2268('0x32')]=_['intersection'](_0x1a9a34['model'],qs[_0x2268('0x34')](_0x18fca6[_0x2268('0x2e')][_0x2268('0x34')]));_0x4a2261[_0x2268('0x32')]=_0x4a2261[_0x2268('0x32')][_0x2268('0x44')]?_0x4a2261[_0x2268('0x32')]:_0x1a9a34[_0x2268('0x33')];if(_0x18fca6[_0x2268('0x2e')][_0x2268('0x3d')]){_0x4a2261[_0x2268('0x3e')]=[{'all':!![]}];}_0x4a2261=_[_0x2268('0x3a')]({},_0x4a2261,_0x18fca6[_0x2268('0x3c')]);return db['ZohoAccount'][_0x2268('0x45')](_0x4a2261)[_0x2268('0x25')](handleEntityNotFound(_0x5a05d5,null))[_0x2268('0x25')](respondWithResult(_0x5a05d5,null))[_0x2268('0x41')](handleError(_0x5a05d5,null));};exports[_0x2268('0x46')]=function(_0x52e50d,_0x2ccb2c){return db[_0x2268('0x2a')][_0x2268('0x46')](_0x52e50d[_0x2268('0x47')],{})[_0x2268('0x25')](respondWithResult(_0x2ccb2c,0xc9))['catch'](handleError(_0x2ccb2c,null));};exports[_0x2268('0x24')]=function(_0x3d54da,_0x39134a){if(_0x3d54da[_0x2268('0x47')]['id']){delete _0x3d54da['body']['id'];}return db[_0x2268('0x2a')][_0x2268('0x45')]({'where':{'id':_0x3d54da[_0x2268('0x43')]['id']}})['then'](handleEntityNotFound(_0x39134a,null))['then'](saveUpdates(_0x3d54da['body'],null))[_0x2268('0x25')](respondWithResult(_0x39134a,null))['catch'](handleError(_0x39134a,null));};exports['destroy']=function(_0x579ae5,_0x517fe1){return db[_0x2268('0x2a')][_0x2268('0x45')]({'where':{'id':_0x579ae5[_0x2268('0x43')]['id']}})['then'](handleEntityNotFound(_0x517fe1,null))['then'](removeEntity(_0x517fe1,null))[_0x2268('0x41')](handleError(_0x517fe1,null));};exports['getConfigurations']=function(_0x3f20ba,_0x4e7178,_0x53d73d){var _0x584749={};var _0x31139e={};var _0x26d60f;var _0x56762d;return db['ZohoAccount'][_0x2268('0x48')]({'where':{'id':_0x3f20ba[_0x2268('0x43')]['id']}})['then'](handleEntityNotFound(_0x4e7178,null))['then'](function(_0x19c0f4){if(_0x19c0f4){_0x26d60f=_0x19c0f4;_0x31139e[_0x2268('0x33')]=_[_0x2268('0x2f')](db[_0x2268('0x49')]['rawAttributes']);_0x31139e[_0x2268('0x2e')]=_['keys'](_0x3f20ba[_0x2268('0x2e')]);_0x31139e['filters']=_['intersection'](_0x31139e[_0x2268('0x33')],_0x31139e[_0x2268('0x2e')]);_0x584749[_0x2268('0x32')]=_[_0x2268('0x31')](_0x31139e[_0x2268('0x33')],qs[_0x2268('0x34')](_0x3f20ba[_0x2268('0x2e')][_0x2268('0x34')]));_0x584749['attributes']=_0x584749[_0x2268('0x32')][_0x2268('0x44')]?_0x584749['attributes']:_0x31139e['model'];_0x584749['order']=qs['sort'](_0x3f20ba['query']['sort']);_0x584749[_0x2268('0x38')]=qs[_0x2268('0x30')](_[_0x2268('0x4a')](_0x3f20ba[_0x2268('0x2e')],_0x31139e['filters']));if(_0x3f20ba[_0x2268('0x2e')][_0x2268('0x39')]){_0x584749['where']=_[_0x2268('0x3a')](_0x584749['where'],{'$or':_[_0x2268('0x29')](_0x584749[_0x2268('0x32')],function(_0x3ae4ab){var _0x4fef0f={};_0x4fef0f[_0x3ae4ab]={'$like':'%'+_0x3f20ba[_0x2268('0x2e')][_0x2268('0x39')]+'%'};return _0x4fef0f;})});}_0x584749=_[_0x2268('0x3a')]({},_0x584749,_0x3f20ba[_0x2268('0x3c')]);return _0x26d60f[_0x2268('0x4b')](_0x584749);}})[_0x2268('0x25')](function(_0x4711cc){if(_0x4711cc){_0x56762d=_0x4711cc[_0x2268('0x44')];if(!_0x3f20ba[_0x2268('0x2e')]['hasOwnProperty'](_0x2268('0x4c'))){_0x584749[_0x2268('0x1e')]=qs[_0x2268('0x1e')](_0x3f20ba[_0x2268('0x2e')]['limit']);_0x584749[_0x2268('0x1c')]=qs[_0x2268('0x1c')](_0x3f20ba['query'][_0x2268('0x1c')]);}return _0x26d60f['getConfigurations'](_0x584749);}})[_0x2268('0x25')](function(_0x4e7a87){if(_0x4e7a87){return _0x4e7a87?{'count':_0x56762d,'rows':_0x4e7a87}:null;}})['then'](respondWithResult(_0x4e7178,null))['catch'](handleError(_0x4e7178,null));};exports[_0x2268('0x4d')]=function(_0x4978a3,_0x51414b,_0x453dd6){if(_0x4978a3[_0x2268('0x47')]['id']){delete _0x4978a3[_0x2268('0x47')]['id'];}return db[_0x2268('0x2a')][_0x2268('0x48')]({'where':{'id':_0x4978a3[_0x2268('0x43')]['id']}})[_0x2268('0x25')](handleEntityNotFound(_0x51414b,null))['then'](function(_0x26d6dc){if(_0x26d6dc){_0x4978a3[_0x2268('0x47')][_0x2268('0x4e')]=_0x26d6dc['id'];_0x4978a3[_0x2268('0x47')][_0x2268('0x4f')]=integrations[_0x2268('0x50')](_0x4978a3['body'][_0x2268('0x51')],_0x4978a3['body'][_0x2268('0x2d')]);_0x4978a3[_0x2268('0x47')][_0x2268('0x52')]=integrations[_0x2268('0x53')](_0x4978a3[_0x2268('0x47')][_0x2268('0x51')],_0x4978a3[_0x2268('0x47')][_0x2268('0x2d')]);return db[_0x2268('0x49')][_0x2268('0x46')](_0x4978a3['body'],{'include':[{'model':db[_0x2268('0x54')],'as':_0x2268('0x4f')},{'model':db['ZohoField'],'as':'Descriptions'}]});}return null;})[_0x2268('0x25')](respondWithResult(_0x51414b,null))[_0x2268('0x41')](handleError(_0x51414b,null));};function getAccessToken(_0x399087){return new Promise(function(_0x26d8e4,_0x53aa0e){var _0x5d7021;switch(_0x399087[_0x2268('0x55')]){case'US':_0x5d7021='https://accounts.zoho.com';break;case'AU':_0x5d7021=_0x2268('0x56');break;case'EU':_0x5d7021='https://accounts.zoho.eu';break;case'IN':_0x5d7021=_0x2268('0x57');break;case'CN':_0x5d7021=_0x2268('0x58');break;default:_0x5d7021=_0x2268('0x59');break;}var _0x3ba0a4={'method':_0x2268('0x5a'),'uri':_0x5d7021+'/oauth/v2/token','qs':{'refresh_token':_0x399087[_0x2268('0x5b')],'client_id':_0x399087['clientId'],'client_secret':_0x399087[_0x2268('0x5c')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x3ba0a4)[_0x2268('0x25')](function(_0x492cde){if(_0x492cde[_0x2268('0x5d')]){_0x26d8e4(_0x492cde[_0x2268('0x5d')]);}else{_0x53aa0e('Unable\x20to\x20retrieve\x20the\x20access\x20token');}})[_0x2268('0x41')](function(_0x138e30){_0x53aa0e(_0x138e30);});});}exports[_0x2268('0x5e')]=function(_0x4c83b6,_0x546fce,_0x56bf33){var _0xe8cc70,_0x4dbf91,_0x4ae52d,_0x5545a6,_0x4711b4;return db[_0x2268('0x2a')][_0x2268('0x48')]({'where':{'id':_0x4c83b6[_0x2268('0x43')]['id']},'attributes':['id','host',_0x2268('0x55'),_0x2268('0x5f'),_0x2268('0x5c'),_0x2268('0x60'),_0x2268('0x61'),'refreshToken']})[_0x2268('0x25')](handleEntityNotFound(_0x546fce,null))[_0x2268('0x25')](function(_0x2c8044){_0x4711b4=_0x2c8044;_0xe8cc70=_0x4711b4['host'];_0x4dbf91=_0xe8cc70===_0x2268('0x62')?'eu':'com';_0x4ae52d=_0x4711b4[_0x2268('0x60')];var _0x5a2090=_0x4ae52d[_0x2268('0x63')](-0x1);if(_0x5a2090==='/'||_0x5a2090==='\x5c'||_0x5a2090===':'){_0x4ae52d=_0x4ae52d['substring'](0x0,_0x4ae52d[_0x2268('0x64')](_0x5a2090));}if(!_0x4711b4[_0x2268('0x5b')]){throw new Error(_0x2268('0x65'));}return getAccessToken(_0x4711b4);})[_0x2268('0x25')](function(_0x166724){if(_0x166724){return rp({'method':_0x2268('0x66'),'uri':util[_0x2268('0x67')](_0x2268('0x68'),_0x4dbf91),'qs':{'module':'Calls'},'headers':{'Authorization':_0x2268('0x69')+_0x166724},'json':!![]});}})[_0x2268('0x25')](function(_0x1b68b8){if(_0x1b68b8){if(_0x1b68b8[_0x2268('0x6a')]&&_0x1b68b8[_0x2268('0x6a')][_0x2268('0x6b')]){throw new Error(_0x1b68b8[_0x2268('0x6a')]['error'][_0x2268('0x6c')]);}var _0x46202d=[];var _0x3b1922=[];var _0x1398c0=[_0x2268('0x6d'),'Subject','Description',_0x2268('0x6e'),_0x2268('0x6f'),_0x2268('0x70'),'Call_Start_Time','Call_Type'];_0x3b1922=_[_0x2268('0x71')](_0x1b68b8[_0x2268('0x34')],function(_0x3ebb2c){return _0x1398c0['includes'](_0x3ebb2c[_0x2268('0x72')]);});for(var _0x1bed84=0x0;_0x1bed84<_0x3b1922[_0x2268('0x44')];_0x1bed84++){if(_0x3b1922[_0x1bed84]['system_mandatory']===![]){_0x46202d[_0x2268('0x73')]({'id':_0x3b1922[_0x1bed84]['id'],'name':_0x3b1922[_0x1bed84][_0x2268('0x74')],'custom':_0x3b1922[_0x1bed84][_0x2268('0x75')],'options':_0x3b1922[_0x1bed84][_0x2268('0x76')]===_0x2268('0x77')&&_0x3b1922[_0x1bed84][_0x2268('0x78')]['length']>-0x1?_['map'](_0x3b1922[_0x1bed84]['pick_list_values'],function(_0x289bc7){return{'name':_0x289bc7,'value':_0x289bc7};}):[]});}}return{'count':_0x46202d[_0x2268('0x44')],'rows':_0x46202d};}else{return{'count':0x0,'rows':[]};}})[_0x2268('0x25')](respondWithResult(_0x546fce,null))[_0x2268('0x41')](function(_0x6e1f7){var _0x35e150=_0x4c83b6[_0x2268('0x2e')][_0x2268('0x79')]?0x1f4:_0x6e1f7[_0x2268('0x7a')]||0x1f4;logger[_0x2268('0x6b')](_0x2268('0x7b'),_0x2268('0x5e'),_0x35e150,JSON[_0x2268('0x7c')](_0x6e1f7));delete _0x6e1f7[_0x2268('0x26')];if(_0x35e150===0x191){_0x35e150=0x190;}_0x546fce[_0x2268('0x19')](_0x35e150)[_0x2268('0x27')](_0x4c83b6['query'][_0x2268('0x79')]?{'message':'Wrong\x20credentials','statusCode':_0x6e1f7[_0x2268('0x7a')]}:_0x6e1f7);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 97ca28a..7df2742 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 _0xdf94=['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','catch','substring','https://accounts.zoho.com.au','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','../../components/integrations/configuration','define','ZohoAccount','changed','zone','clientId','host','serverUrl','slice','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','clientSecret','code','application/x-www-form-urlencoded','then','parse','refresh_token','refreshToken','info'];(function(_0x46b5fa,_0x5059ae){var _0x14cacc=function(_0x3864be){while(--_0x3864be){_0x46b5fa['push'](_0x46b5fa['shift']());}};_0x14cacc(++_0x5059ae);}(_0xdf94,0x1d7));var _0x4df9=function(_0x10630a,_0x563fc9){_0x10630a=_0x10630a-0x0;var _0x3418ad=_0xdf94[_0x10630a];return _0x3418ad;};'use strict';var _=require('lodash');var util=require(_0x4df9('0x0'));var logger=require(_0x4df9('0x1'))(_0x4df9('0x2'));var moment=require(_0x4df9('0x3'));var BPromise=require(_0x4df9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4df9('0x5'));var rimraf=require(_0x4df9('0x6'));var config=require(_0x4df9('0x7'));var attributes=require('./intZohoAccount.attributes');var integrations=require(_0x4df9('0x8'));module['exports']=function(_0x53562e,_0x54c56d){return _0x53562e[_0x4df9('0x9')](_0x4df9('0xa'),attributes,{'tableName':'int_zoho_accounts','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x316a7a,_0x4d0d44,_0x34a0b9){if(_0x316a7a[_0x4df9('0xb')](_0x4df9('0xc'))||_0x316a7a['changed']('serverUrl')||_0x316a7a[_0x4df9('0xb')](_0x4df9('0xd'))||_0x316a7a['changed']('clientSecret')||_0x316a7a[_0x4df9('0xb')]('code')||_0x316a7a[_0x4df9('0xb')](_0x4df9('0xe'))){var _0x50957f,_0x2d1fc2;_0x50957f=_0x316a7a[_0x4df9('0xf')];var _0x433cae=_0x50957f[_0x4df9('0x10')](-0x1);if(_0x433cae==='/'||_0x433cae==='\x5c'||_0x433cae===':'){_0x50957f=_0x50957f['substring'](0x0,_0x50957f[_0x4df9('0x11')](_0x433cae));}switch(_0x316a7a['zone']){case'US':_0x2d1fc2=_0x4df9('0x12');break;case'AU':_0x2d1fc2='https://accounts.zoho.com.au';break;case'IN':_0x2d1fc2=_0x4df9('0x13');break;case'CN':_0x2d1fc2=_0x4df9('0x14');break;default:_0x2d1fc2=_0x4df9('0x15');break;}var _0x8efcbd={'method':_0x4df9('0x16'),'uri':_0x2d1fc2+_0x4df9('0x17'),'form':{'grant_type':_0x4df9('0x18'),'client_id':_0x316a7a['clientId'],'client_secret':_0x316a7a[_0x4df9('0x19')],'redirect_uri':_0x316a7a[_0x4df9('0xf')],'code':_0x316a7a[_0x4df9('0x1a')]},'headers':{'Content-Type':_0x4df9('0x1b')}};return rp(_0x8efcbd)[_0x4df9('0x1c')](function(_0x468ec4){var _0x2dc627=JSON[_0x4df9('0x1d')](_0x468ec4);if(_0x2dc627[_0x4df9('0x1e')]){_0x316a7a[_0x4df9('0x1f')]=_0x2dc627[_0x4df9('0x1e')];logger[_0x4df9('0x20')](util[_0x4df9('0x21')](_0x4df9('0x22'),_0x316a7a[_0x4df9('0x23')],_0x316a7a['id']));}else{logger[_0x4df9('0x24')](util[_0x4df9('0x21')](_0x4df9('0x25'),_0x316a7a[_0x4df9('0x23')],_0x316a7a['id']),util[_0x4df9('0x26')](_0x2dc627,{'showHidden':![],'depth':null}));}return _0x34a0b9(null,_0x4d0d44);})[_0x4df9('0x27')](function(_0x2aea3a){logger[_0x4df9('0x24')](util[_0x4df9('0x21')](_0x4df9('0x25'),_0x316a7a['name'],_0x316a7a['id']),util[_0x4df9('0x26')](parsedResult,{'showHidden':![],'depth':null}));return _0x34a0b9(_0x2aea3a);});}else{return _0x34a0b9(null,_0x4d0d44);}},'beforeUpdate':function(_0x5d3488,_0x55e50f,_0x1e0a73){if(_0x5d3488['changed'](_0x4df9('0xc'))||_0x5d3488[_0x4df9('0xb')](_0x4df9('0xf'))||_0x5d3488[_0x4df9('0xb')](_0x4df9('0xd'))||_0x5d3488[_0x4df9('0xb')](_0x4df9('0x19'))||_0x5d3488[_0x4df9('0xb')](_0x4df9('0x1a'))||_0x5d3488['changed']('host')){var _0x1f346d,_0x5996c0;_0x1f346d=_0x5d3488[_0x4df9('0xf')];var _0x27df48=_0x1f346d[_0x4df9('0x10')](-0x1);if(_0x27df48==='/'||_0x27df48==='\x5c'||_0x27df48===':'){_0x1f346d=_0x1f346d[_0x4df9('0x28')](0x0,_0x1f346d['lastIndexOf'](_0x27df48));}switch(_0x5d3488[_0x4df9('0xc')]){case'US':_0x5996c0='https://accounts.zoho.com';break;case'AU':_0x5996c0=_0x4df9('0x29');break;case'IN':_0x5996c0=_0x4df9('0x13');break;case'CN':_0x5996c0=_0x4df9('0x14');break;default:_0x5996c0=_0x4df9('0x15');break;}var _0x461c6b={'method':'POST','uri':_0x5996c0+_0x4df9('0x17'),'form':{'grant_type':_0x4df9('0x18'),'client_id':_0x5d3488['clientId'],'client_secret':_0x5d3488[_0x4df9('0x19')],'redirect_uri':_0x5d3488['serverUrl'],'code':_0x5d3488[_0x4df9('0x1a')]},'headers':{'Content-Type':_0x4df9('0x1b')}};return rp(_0x461c6b)['then'](function(_0x3eea3c){var _0x43e75c=JSON['parse'](_0x3eea3c);if(_0x43e75c[_0x4df9('0x1e')]){_0x5d3488[_0x4df9('0x1f')]=_0x43e75c[_0x4df9('0x1e')];logger['info'](util['format'](_0x4df9('0x22'),_0x5d3488[_0x4df9('0x23')],_0x5d3488['id']));}else{logger[_0x4df9('0x24')](util['format'](_0x4df9('0x25'),_0x5d3488[_0x4df9('0x23')],_0x5d3488['id']),util[_0x4df9('0x26')](_0x43e75c,{'showHidden':![],'depth':null}));}return _0x1e0a73(null,_0x55e50f);})[_0x4df9('0x27')](function(_0x5e4b9c){logger[_0x4df9('0x24')](util[_0x4df9('0x21')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x5d3488[_0x4df9('0x23')],_0x5d3488['id']),util[_0x4df9('0x26')](parsedResult,{'showHidden':![],'depth':null}));return _0x1e0a73(_0x5e4b9c);});}else{return _0x1e0a73(null,_0x55e50f);}}}});}; \ No newline at end of file +var _0x670c=['https://accounts.zoho.com.au','https://accounts.zoho.com.cn','refreshToken','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../components/integrations/configuration','exports','changed','serverUrl','clientId','code','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.in','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','clientSecret','application/x-www-form-urlencoded','then','parse','refresh_token','info','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','host','slice'];(function(_0x3d8340,_0x35b64d){var _0x29c5f3=function(_0x3772d9){while(--_0x3772d9){_0x3d8340['push'](_0x3d8340['shift']());}};_0x29c5f3(++_0x35b64d);}(_0x670c,0x1bb));var _0xc670=function(_0x530181,_0x385879){_0x530181=_0x530181-0x0;var _0x500548=_0x670c[_0x530181];return _0x500548;};'use strict';var _=require(_0xc670('0x0'));var util=require(_0xc670('0x1'));var logger=require(_0xc670('0x2'))(_0xc670('0x3'));var moment=require(_0xc670('0x4'));var BPromise=require('bluebird');var rp=require(_0xc670('0x5'));var fs=require('fs');var path=require(_0xc670('0x6'));var rimraf=require(_0xc670('0x7'));var config=require('../../config/environment');var attributes=require('./intZohoAccount.attributes');var integrations=require(_0xc670('0x8'));module[_0xc670('0x9')]=function(_0x2dbf06,_0x2e9b89){return _0x2dbf06['define']('ZohoAccount',attributes,{'tableName':'int_zoho_accounts','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x543649,_0x41bf7f,_0x470c6f){if(_0x543649[_0xc670('0xa')]('zone')||_0x543649[_0xc670('0xa')](_0xc670('0xb'))||_0x543649[_0xc670('0xa')](_0xc670('0xc'))||_0x543649[_0xc670('0xa')]('clientSecret')||_0x543649[_0xc670('0xa')](_0xc670('0xd'))||_0x543649['changed']('host')){var _0x43a42a,_0x370c95;_0x43a42a=_0x543649[_0xc670('0xb')];var _0x3aa36a=_0x43a42a['slice'](-0x1);if(_0x3aa36a==='/'||_0x3aa36a==='\x5c'||_0x3aa36a===':'){_0x43a42a=_0x43a42a[_0xc670('0xe')](0x0,_0x43a42a[_0xc670('0xf')](_0x3aa36a));}switch(_0x543649['zone']){case'US':_0x370c95=_0xc670('0x10');break;case'AU':_0x370c95='https://accounts.zoho.com.au';break;case'IN':_0x370c95=_0xc670('0x11');break;case'CN':_0x370c95='https://accounts.zoho.com.cn';break;default:_0x370c95=_0xc670('0x12');break;}var _0x7fabc6={'method':_0xc670('0x13'),'uri':_0x370c95+_0xc670('0x14'),'form':{'grant_type':_0xc670('0x15'),'client_id':_0x543649[_0xc670('0xc')],'client_secret':_0x543649[_0xc670('0x16')],'redirect_uri':_0x543649[_0xc670('0xb')],'code':_0x543649[_0xc670('0xd')]},'headers':{'Content-Type':_0xc670('0x17')}};return rp(_0x7fabc6)[_0xc670('0x18')](function(_0x5975ad){var _0x5e11a1=JSON[_0xc670('0x19')](_0x5975ad);if(_0x5e11a1[_0xc670('0x1a')]){_0x543649['refreshToken']=_0x5e11a1[_0xc670('0x1a')];logger[_0xc670('0x1b')](util[_0xc670('0x1c')](_0xc670('0x1d'),_0x543649[_0xc670('0x1e')],_0x543649['id']));}else{logger[_0xc670('0x1f')](util['format'](_0xc670('0x20'),_0x543649[_0xc670('0x1e')],_0x543649['id']),util['inspect'](_0x5e11a1,{'showHidden':![],'depth':null}));}return _0x470c6f(null,_0x41bf7f);})['catch'](function(_0xfd6457){logger[_0xc670('0x1f')](util[_0xc670('0x1c')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x543649['name'],_0x543649['id']),util[_0xc670('0x21')](parsedResult,{'showHidden':![],'depth':null}));return _0x470c6f(_0xfd6457);});}else{return _0x470c6f(null,_0x41bf7f);}},'beforeUpdate':function(_0x15c29d,_0x359156,_0x598672){if(_0x15c29d[_0xc670('0xa')](_0xc670('0x22'))||_0x15c29d['changed'](_0xc670('0xb'))||_0x15c29d[_0xc670('0xa')](_0xc670('0xc'))||_0x15c29d[_0xc670('0xa')](_0xc670('0x16'))||_0x15c29d[_0xc670('0xa')]('code')||_0x15c29d[_0xc670('0xa')](_0xc670('0x23'))){var _0x2460ba,_0x226dde;_0x2460ba=_0x15c29d[_0xc670('0xb')];var _0x1514c2=_0x2460ba[_0xc670('0x24')](-0x1);if(_0x1514c2==='/'||_0x1514c2==='\x5c'||_0x1514c2===':'){_0x2460ba=_0x2460ba[_0xc670('0xe')](0x0,_0x2460ba[_0xc670('0xf')](_0x1514c2));}switch(_0x15c29d[_0xc670('0x22')]){case'US':_0x226dde=_0xc670('0x10');break;case'AU':_0x226dde=_0xc670('0x25');break;case'IN':_0x226dde=_0xc670('0x11');break;case'CN':_0x226dde=_0xc670('0x26');break;default:_0x226dde='https://accounts.zoho.eu';break;}var _0x115da4={'method':_0xc670('0x13'),'uri':_0x226dde+'/oauth/v2/token','form':{'grant_type':_0xc670('0x15'),'client_id':_0x15c29d[_0xc670('0xc')],'client_secret':_0x15c29d[_0xc670('0x16')],'redirect_uri':_0x15c29d[_0xc670('0xb')],'code':_0x15c29d[_0xc670('0xd')]},'headers':{'Content-Type':_0xc670('0x17')}};return rp(_0x115da4)[_0xc670('0x18')](function(_0x5d3fef){var _0x21c45b=JSON[_0xc670('0x19')](_0x5d3fef);if(_0x21c45b[_0xc670('0x1a')]){_0x15c29d[_0xc670('0x27')]=_0x21c45b[_0xc670('0x1a')];logger[_0xc670('0x1b')](util[_0xc670('0x1c')](_0xc670('0x1d'),_0x15c29d['name'],_0x15c29d['id']));}else{logger[_0xc670('0x1f')](util[_0xc670('0x1c')](_0xc670('0x20'),_0x15c29d[_0xc670('0x1e')],_0x15c29d['id']),util[_0xc670('0x21')](_0x21c45b,{'showHidden':![],'depth':null}));}return _0x598672(null,_0x359156);})['catch'](function(_0x1ac4d7){logger['error'](util[_0xc670('0x1c')](_0xc670('0x20'),_0x15c29d[_0xc670('0x1e')],_0x15c29d['id']),util[_0xc670('0x21')](parsedResult,{'showHidden':![],'depth':null}));return _0x598672(_0x1ac4d7);});}else{return _0x598672(null,_0x359156);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 758205f..d336822 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 _0xf29d=['ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ZohoAccount,\x20%s,\x20%s','result','ZohoAccount','findAll','options','raw','where','attributes','limit','map','include','model','GetZohoAccount','catch','ShowZohoAccount','find','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','request','then','info','debug'];(function(_0x374ada,_0x27b3a5){var _0x449ed8=function(_0x3efc46){while(--_0x3efc46){_0x374ada['push'](_0x374ada['shift']());}};_0x449ed8(++_0x27b3a5);}(_0xf29d,0xc4));var _0xdf29=function(_0x233960,_0x3816c3){_0x233960=_0x233960-0x0;var _0x303d86=_0xf29d[_0x233960];return _0x303d86;};'use strict';var _=require(_0xdf29('0x0'));var util=require(_0xdf29('0x1'));var moment=require('moment');var BPromise=require(_0xdf29('0x2'));var rs=require(_0xdf29('0x3'));var fs=require('fs');var Redis=require(_0xdf29('0x4'));var db=require(_0xdf29('0x5'))['db'];var utils=require(_0xdf29('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xdf29('0x7'));var client=jayson[_0xdf29('0x8')][_0xdf29('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4b648e,_0x39b352,_0x1927a3){return new BPromise(function(_0x289aad,_0x54d108){return client[_0xdf29('0xa')](_0x4b648e,_0x1927a3)[_0xdf29('0xb')](function(_0x1fb3f1){logger[_0xdf29('0xc')]('ZohoAccount,\x20%s,\x20%s',_0x39b352,'request\x20sent');logger[_0xdf29('0xd')](_0xdf29('0xe'),_0x39b352,'request\x20sent',JSON[_0xdf29('0xf')](_0x1fb3f1));if(_0x1fb3f1[_0xdf29('0x10')]){if(_0x1fb3f1[_0xdf29('0x10')][_0xdf29('0x11')]===0x1f4){logger[_0xdf29('0x10')]('ZohoAccount,\x20%s,\x20%s',_0x39b352,_0x1fb3f1[_0xdf29('0x10')]['message']);return _0x54d108(_0x1fb3f1[_0xdf29('0x10')][_0xdf29('0x12')]);}logger[_0xdf29('0x10')]('ZohoAccount,\x20%s,\x20%s',_0x39b352,_0x1fb3f1[_0xdf29('0x10')][_0xdf29('0x12')]);return _0x289aad(_0x1fb3f1['error'][_0xdf29('0x12')]);}else{logger[_0xdf29('0xc')](_0xdf29('0x13'),_0x39b352,'request\x20sent');_0x289aad(_0x1fb3f1[_0xdf29('0x14')]['message']);}})['catch'](function(_0x1c993b){logger[_0xdf29('0x10')]('ZohoAccount,\x20%s,\x20%s',_0x39b352,_0x1c993b);_0x54d108(_0x1c993b);});});}exports['GetZohoAccount']=function(_0x11dc19){var _0x28a99b=this;return new Promise(function(_0x4debb5,_0x207daa){return db[_0xdf29('0x15')][_0xdf29('0x16')]({'raw':_0x11dc19[_0xdf29('0x17')]?_0x11dc19[_0xdf29('0x17')][_0xdf29('0x18')]===undefined?!![]:![]:!![],'where':_0x11dc19[_0xdf29('0x17')]?_0x11dc19[_0xdf29('0x17')][_0xdf29('0x19')]||null:null,'attributes':_0x11dc19[_0xdf29('0x17')]?_0x11dc19[_0xdf29('0x17')][_0xdf29('0x1a')]||null:null,'limit':_0x11dc19[_0xdf29('0x17')]?_0x11dc19[_0xdf29('0x17')][_0xdf29('0x1b')]||null:null,'include':_0x11dc19[_0xdf29('0x17')]?_0x11dc19['options']['include']?_[_0xdf29('0x1c')](_0x11dc19[_0xdf29('0x17')][_0xdf29('0x1d')],function(_0xfc7760){return{'model':db[_0xfc7760[_0xdf29('0x1e')]],'as':_0xfc7760['as'],'attributes':_0xfc7760['attributes'],'include':_0xfc7760[_0xdf29('0x1d')]?_[_0xdf29('0x1c')](_0xfc7760[_0xdf29('0x1d')],function(_0x41f6c5){return{'model':db[_0x41f6c5['model']],'as':_0x41f6c5['as'],'attributes':_0x41f6c5[_0xdf29('0x1a')],'include':_0x41f6c5['include']?_['map'](_0x41f6c5['include'],function(_0x484989){return{'model':db[_0x484989['model']],'as':_0x484989['as'],'attributes':_0x484989[_0xdf29('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xc7c1e6){logger['info']('GetZohoAccount',_0x11dc19);logger['debug'](_0xdf29('0x1f'),_0x11dc19,JSON[_0xdf29('0xf')](_0xc7c1e6));_0x4debb5(_0xc7c1e6);})[_0xdf29('0x20')](function(_0x333965){logger[_0xdf29('0x10')](_0xdf29('0x1f'),_0x333965['message'],_0x11dc19);_0x207daa(_0x28a99b['error'](0x1f4,_0x333965[_0xdf29('0x12')]));});});};exports[_0xdf29('0x21')]=function(_0x301bc5){var _0x240777=this;return new Promise(function(_0x34a6ee,_0x304b61){return db[_0xdf29('0x15')][_0xdf29('0x22')]({'raw':_0x301bc5[_0xdf29('0x17')]?_0x301bc5[_0xdf29('0x17')][_0xdf29('0x18')]===undefined?!![]:![]:!![],'where':_0x301bc5[_0xdf29('0x17')]?_0x301bc5[_0xdf29('0x17')][_0xdf29('0x19')]||null:null,'attributes':_0x301bc5[_0xdf29('0x17')]?_0x301bc5['options'][_0xdf29('0x1a')]||null:null,'include':_0x301bc5[_0xdf29('0x17')]?_0x301bc5['options'][_0xdf29('0x1d')]?_[_0xdf29('0x1c')](_0x301bc5[_0xdf29('0x17')]['include'],function(_0xe3127){return{'model':db[_0xe3127[_0xdf29('0x1e')]],'as':_0xe3127['as'],'attributes':_0xe3127[_0xdf29('0x1a')],'include':_0xe3127[_0xdf29('0x1d')]?_['map'](_0xe3127[_0xdf29('0x1d')],function(_0x29eb8b){return{'model':db[_0x29eb8b['model']],'as':_0x29eb8b['as'],'attributes':_0x29eb8b[_0xdf29('0x1a')],'include':_0x29eb8b['include']?_[_0xdf29('0x1c')](_0x29eb8b[_0xdf29('0x1d')],function(_0x33af6a){return{'model':db[_0x33af6a[_0xdf29('0x1e')]],'as':_0x33af6a['as'],'attributes':_0x33af6a[_0xdf29('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xdf29('0xb')](function(_0x47126b){logger[_0xdf29('0xc')](_0xdf29('0x21'),_0x301bc5);logger['debug'](_0xdf29('0x21'),_0x301bc5,JSON[_0xdf29('0xf')](_0x47126b));_0x34a6ee(_0x47126b);})[_0xdf29('0x20')](function(_0x42f58d){logger[_0xdf29('0x10')](_0xdf29('0x21'),_0x42f58d[_0xdf29('0x12')],_0x301bc5);_0x304b61(_0x240777[_0xdf29('0x10')](0x1f4,_0x42f58d['message']));});});}; \ No newline at end of file +var _0xccef=['http','request','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetZohoAccount','ZohoAccount','findAll','options','raw','include','map','model','attributes','find','where','then','ShowZohoAccount','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise'];(function(_0x30a27a,_0x1b32e4){var _0x5e2955=function(_0x5f226a){while(--_0x5f226a){_0x30a27a['push'](_0x30a27a['shift']());}};_0x5e2955(++_0x1b32e4);}(_0xccef,0x1d4));var _0xfcce=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xccef[_0x59ee6f];return _0x4c0979;};'use strict';var _=require('lodash');var util=require(_0xfcce('0x0'));var moment=require('moment');var BPromise=require(_0xfcce('0x1'));var rs=require(_0xfcce('0x2'));var fs=require('fs');var Redis=require(_0xfcce('0x3'));var db=require(_0xfcce('0x4'))['db'];var utils=require(_0xfcce('0x5'));var logger=require(_0xfcce('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xfcce('0x7'));var client=jayson['client'][_0xfcce('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xd71971,_0x12d091,_0x4598c1){return new BPromise(function(_0x117bc3,_0x380c2c){return client[_0xfcce('0x9')](_0xd71971,_0x4598c1)['then'](function(_0x382ea5){logger[_0xfcce('0xa')](_0xfcce('0xb'),_0x12d091,_0xfcce('0xc'));logger[_0xfcce('0xd')](_0xfcce('0xe'),_0x12d091,_0xfcce('0xc'),JSON[_0xfcce('0xf')](_0x382ea5));if(_0x382ea5[_0xfcce('0x10')]){if(_0x382ea5[_0xfcce('0x10')][_0xfcce('0x11')]===0x1f4){logger['error'](_0xfcce('0xb'),_0x12d091,_0x382ea5[_0xfcce('0x10')][_0xfcce('0x12')]);return _0x380c2c(_0x382ea5[_0xfcce('0x10')]['message']);}logger[_0xfcce('0x10')](_0xfcce('0xb'),_0x12d091,_0x382ea5['error']['message']);return _0x117bc3(_0x382ea5[_0xfcce('0x10')][_0xfcce('0x12')]);}else{logger[_0xfcce('0xa')](_0xfcce('0xb'),_0x12d091,_0xfcce('0xc'));_0x117bc3(_0x382ea5[_0xfcce('0x13')][_0xfcce('0x12')]);}})[_0xfcce('0x14')](function(_0x2d7611){logger[_0xfcce('0x10')](_0xfcce('0xb'),_0x12d091,_0x2d7611);_0x380c2c(_0x2d7611);});});}exports[_0xfcce('0x15')]=function(_0x40f6e4){var _0x60cee0=this;return new Promise(function(_0x3a8854,_0x33f5e2){return db[_0xfcce('0x16')][_0xfcce('0x17')]({'raw':_0x40f6e4[_0xfcce('0x18')]?_0x40f6e4[_0xfcce('0x18')][_0xfcce('0x19')]===undefined?!![]:![]:!![],'where':_0x40f6e4[_0xfcce('0x18')]?_0x40f6e4[_0xfcce('0x18')]['where']||null:null,'attributes':_0x40f6e4['options']?_0x40f6e4[_0xfcce('0x18')]['attributes']||null:null,'limit':_0x40f6e4[_0xfcce('0x18')]?_0x40f6e4[_0xfcce('0x18')]['limit']||null:null,'include':_0x40f6e4[_0xfcce('0x18')]?_0x40f6e4[_0xfcce('0x18')][_0xfcce('0x1a')]?_[_0xfcce('0x1b')](_0x40f6e4[_0xfcce('0x18')][_0xfcce('0x1a')],function(_0x52f3c8){return{'model':db[_0x52f3c8[_0xfcce('0x1c')]],'as':_0x52f3c8['as'],'attributes':_0x52f3c8[_0xfcce('0x1d')],'include':_0x52f3c8[_0xfcce('0x1a')]?_[_0xfcce('0x1b')](_0x52f3c8['include'],function(_0x4ca849){return{'model':db[_0x4ca849[_0xfcce('0x1c')]],'as':_0x4ca849['as'],'attributes':_0x4ca849[_0xfcce('0x1d')],'include':_0x4ca849[_0xfcce('0x1a')]?_[_0xfcce('0x1b')](_0x4ca849['include'],function(_0x428a4e){return{'model':db[_0x428a4e[_0xfcce('0x1c')]],'as':_0x428a4e['as'],'attributes':_0x428a4e['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x413adf){logger[_0xfcce('0xa')](_0xfcce('0x15'),_0x40f6e4);logger[_0xfcce('0xd')](_0xfcce('0x15'),_0x40f6e4,JSON[_0xfcce('0xf')](_0x413adf));_0x3a8854(_0x413adf);})[_0xfcce('0x14')](function(_0x3b7592){logger[_0xfcce('0x10')](_0xfcce('0x15'),_0x3b7592['message'],_0x40f6e4);_0x33f5e2(_0x60cee0[_0xfcce('0x10')](0x1f4,_0x3b7592['message']));});});};exports['ShowZohoAccount']=function(_0x1aaddd){var _0x46d99c=this;return new Promise(function(_0x43dc0a,_0x40c460){return db[_0xfcce('0x16')][_0xfcce('0x1e')]({'raw':_0x1aaddd[_0xfcce('0x18')]?_0x1aaddd[_0xfcce('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x1aaddd[_0xfcce('0x18')]?_0x1aaddd[_0xfcce('0x18')][_0xfcce('0x1f')]||null:null,'attributes':_0x1aaddd[_0xfcce('0x18')]?_0x1aaddd[_0xfcce('0x18')][_0xfcce('0x1d')]||null:null,'include':_0x1aaddd[_0xfcce('0x18')]?_0x1aaddd[_0xfcce('0x18')][_0xfcce('0x1a')]?_[_0xfcce('0x1b')](_0x1aaddd[_0xfcce('0x18')][_0xfcce('0x1a')],function(_0xb6015b){return{'model':db[_0xb6015b[_0xfcce('0x1c')]],'as':_0xb6015b['as'],'attributes':_0xb6015b['attributes'],'include':_0xb6015b[_0xfcce('0x1a')]?_['map'](_0xb6015b[_0xfcce('0x1a')],function(_0x278411){return{'model':db[_0x278411[_0xfcce('0x1c')]],'as':_0x278411['as'],'attributes':_0x278411[_0xfcce('0x1d')],'include':_0x278411[_0xfcce('0x1a')]?_[_0xfcce('0x1b')](_0x278411[_0xfcce('0x1a')],function(_0x3b4efd){return{'model':db[_0x3b4efd[_0xfcce('0x1c')]],'as':_0x3b4efd['as'],'attributes':_0x3b4efd[_0xfcce('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xfcce('0x20')](function(_0x12e4fc){logger[_0xfcce('0xa')](_0xfcce('0x21'),_0x1aaddd);logger[_0xfcce('0xd')](_0xfcce('0x21'),_0x1aaddd,JSON['stringify'](_0x12e4fc));_0x43dc0a(_0x12e4fc);})[_0xfcce('0x14')](function(_0x1edf08){logger['error'](_0xfcce('0x21'),_0x1edf08['message'],_0x1aaddd);_0x40c460(_0x46d99c[_0xfcce('0x10')](0x1f4,_0x1edf08[_0xfcce('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index cd0b1d0..9ece274 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 _0x6891=['isAuthenticated','index','/:id','show','/:id/fields','get','/:id/subjects','getSubjects','getDescriptions','post','create','update','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x4db38c,_0x589200){var _0x4d82db=function(_0x12b62b){while(--_0x12b62b){_0x4db38c['push'](_0x4db38c['shift']());}};_0x4d82db(++_0x589200);}(_0x6891,0xa8));var _0x1689=function(_0x5a5f47,_0x42ea38){_0x5a5f47=_0x5a5f47-0x0;var _0xb679af=_0x6891[_0x5a5f47];return _0xb679af;};'use strict';var multer=require(_0x1689('0x0'));var util=require(_0x1689('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1689('0x2'));var router=express[_0x1689('0x3')]();var fs_extra=require(_0x1689('0x4'));var auth=require(_0x1689('0x5'));var interaction=require(_0x1689('0x6'));var config=require(_0x1689('0x7'));var controller=require('./intZohoConfiguration.controller');router['get']('/',auth[_0x1689('0x8')](),controller[_0x1689('0x9')]);router['get'](_0x1689('0xa'),auth[_0x1689('0x8')](),controller[_0x1689('0xb')]);router['get'](_0x1689('0xc'),auth[_0x1689('0x8')](),controller['getFields']);router[_0x1689('0xd')](_0x1689('0xe'),auth[_0x1689('0x8')](),controller[_0x1689('0xf')]);router[_0x1689('0xd')]('/:id/descriptions',auth[_0x1689('0x8')](),controller[_0x1689('0x10')]);router[_0x1689('0x11')]('/',auth['isAuthenticated'](),controller[_0x1689('0x12')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x1689('0x13')]);router['delete'](_0x1689('0xa'),auth[_0x1689('0x8')](),controller[_0x1689('0x14')]);module[_0x1689('0x15')]=router; \ No newline at end of file +var _0xe652=['put','update','delete','destroy','exports','util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','/:id/descriptions','post'];(function(_0x4fde08,_0x463a36){var _0x12e725=function(_0x2670c5){while(--_0x2670c5){_0x4fde08['push'](_0x4fde08['shift']());}};_0x12e725(++_0x463a36);}(_0xe652,0xa5));var _0x2e65=function(_0x13a03a,_0x32da43){_0x13a03a=_0x13a03a-0x0;var _0x3ca2e5=_0xe652[_0x13a03a];return _0x3ca2e5;};'use strict';var multer=require('multer');var util=require(_0x2e65('0x0'));var path=require(_0x2e65('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2e65('0x2')]();var fs_extra=require(_0x2e65('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x2e65('0x4'));var config=require(_0x2e65('0x5'));var controller=require(_0x2e65('0x6'));router[_0x2e65('0x7')]('/',auth[_0x2e65('0x8')](),controller[_0x2e65('0x9')]);router[_0x2e65('0x7')](_0x2e65('0xa'),auth[_0x2e65('0x8')](),controller[_0x2e65('0xb')]);router[_0x2e65('0x7')](_0x2e65('0xc'),auth[_0x2e65('0x8')](),controller['getFields']);router['get']('/:id/subjects',auth[_0x2e65('0x8')](),controller['getSubjects']);router[_0x2e65('0x7')](_0x2e65('0xd'),auth[_0x2e65('0x8')](),controller['getDescriptions']);router[_0x2e65('0xe')]('/',auth[_0x2e65('0x8')](),controller['create']);router[_0x2e65('0xf')](_0x2e65('0xa'),auth[_0x2e65('0x8')](),controller[_0x2e65('0x10')]);router[_0x2e65('0x11')](_0x2e65('0xa'),auth['isAuthenticated'](),controller[_0x2e65('0x12')]);module[_0x2e65('0x13')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index f1e9bd2..fb733ff 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 _0xdcee=['lead','contact','contact_lead','exports','STRING'];(function(_0x42946c,_0x43c225){var _0x6ea99d=function(_0x14c86c){while(--_0x14c86c){_0x42946c['push'](_0x42946c['shift']());}};_0x6ea99d(++_0x43c225);}(_0xdcee,0xb7));var _0xedce=function(_0x266e57,_0x41125b){_0x266e57=_0x266e57-0x0;var _0x4cdc1d=_0xdcee[_0x266e57];return _0x4cdc1d;};'use strict';var Sequelize=require('sequelize');module[_0xedce('0x0')]={'name':{'type':Sequelize[_0xedce('0x1')]},'moduleCreate':{'type':Sequelize['ENUM'](_0xedce('0x2'),_0xedce('0x3'),'nothing'),'defaultValue':_0xedce('0x2')},'moduleSearch':{'type':Sequelize['ENUM'](_0xedce('0x4'),_0xedce('0x3'),_0xedce('0x2')),'defaultValue':_0xedce('0x4')},'description':{'type':Sequelize[_0xedce('0x1')]}}; \ No newline at end of file +var _0x00e1=['contact_lead','exports','STRING','ENUM','lead','contact','nothing'];(function(_0x27b7e2,_0x5a5962){var _0x569227=function(_0x3e1a27){while(--_0x3e1a27){_0x27b7e2['push'](_0x27b7e2['shift']());}};_0x569227(++_0x5a5962);}(_0x00e1,0x151));var _0x100e=function(_0x4f4bfd,_0x5ecb17){_0x4f4bfd=_0x4f4bfd-0x0;var _0x1a4e94=_0x00e1[_0x4f4bfd];return _0x1a4e94;};'use strict';var Sequelize=require('sequelize');module[_0x100e('0x0')]={'name':{'type':Sequelize[_0x100e('0x1')]},'moduleCreate':{'type':Sequelize[_0x100e('0x2')](_0x100e('0x3'),_0x100e('0x4'),_0x100e('0x5')),'defaultValue':_0x100e('0x3')},'moduleSearch':{'type':Sequelize[_0x100e('0x2')](_0x100e('0x6'),_0x100e('0x4'),_0x100e('0x3')),'defaultValue':'contact_lead'},'description':{'type':Sequelize[_0x100e('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 34c7b5c..ea25736 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 _0x622e=['../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','then','error','stack','name','send','map','ZohoConfiguration','fieldName','type','key','model','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','include','findAll','rows','catch','show','keys','rawAttributes','find','create','body','params','getFields','ZohoField','getSubjects','findOne','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','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'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0x622e,0x1eb));var _0xe622=function(_0x1c75bc,_0x474bac){_0x1c75bc=_0x1c75bc-0x0;var _0x30578b=_0x622e[_0x1c75bc];return _0x30578b;};'use strict';var emlformat=require(_0xe622('0x0'));var rimraf=require(_0xe622('0x1'));var zipdir=require(_0xe622('0x2'));var jsonpatch=require(_0xe622('0x3'));var rp=require(_0xe622('0x4'));var moment=require(_0xe622('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xe622('0x6'));var util=require(_0xe622('0x7'));var path=require(_0xe622('0x8'));var sox=require(_0xe622('0x9'));var csv=require('to-csv');var ejs=require(_0xe622('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe622('0xb'));var squel=require(_0xe622('0xc'));var crypto=require(_0xe622('0xd'));var jsforce=require(_0xe622('0xe'));var deskjs=require(_0xe622('0xf'));var toCsv=require(_0xe622('0x10'));var querystring=require(_0xe622('0x11'));var Papa=require(_0xe622('0x12'));var Redis=require(_0xe622('0x13'));var authService=require(_0xe622('0x14'));var qs=require(_0xe622('0x15'));var as=require(_0xe622('0x16'));var hardwareService=require(_0xe622('0x17'));var logger=require(_0xe622('0x18'))('api');var utils=require(_0xe622('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xe622('0x1a'));var db=require(_0xe622('0x1b'))['db'];function respondWithStatusCode(_0x523bf3,_0x3ab3bf){_0x3ab3bf=_0x3ab3bf||0xcc;return function(_0x8e15a6){if(_0x8e15a6){return _0x523bf3[_0xe622('0x1c')](_0x3ab3bf);}return _0x523bf3[_0xe622('0x1d')](_0x3ab3bf)[_0xe622('0x1e')]();};}function respondWithResult(_0x786d12,_0xa41de4){_0xa41de4=_0xa41de4||0xc8;return function(_0x31455d){if(_0x31455d){return _0x786d12['status'](_0xa41de4)['json'](_0x31455d);}};}function respondWithFilteredResult(_0x3f791c,_0x2ff730){return function(_0x1d7010){if(_0x1d7010){var _0x5db26d=typeof _0x2ff730[_0xe622('0x1f')]===_0xe622('0x20')&&typeof _0x2ff730[_0xe622('0x21')]===_0xe622('0x20');var _0x3c4797=_0x1d7010[_0xe622('0x22')];var _0x3a13c4=_0x5db26d?0x0:_0x2ff730[_0xe622('0x1f')];var _0x538524=_0x5db26d?_0x1d7010[_0xe622('0x22')]:_0x2ff730[_0xe622('0x1f')]+_0x2ff730[_0xe622('0x21')];var _0x19214f;if(_0x538524>=_0x3c4797){_0x538524=_0x3c4797;_0x19214f=0xc8;}else{_0x19214f=0xce;}_0x3f791c[_0xe622('0x1d')](_0x19214f);return _0x3f791c[_0xe622('0x23')](_0xe622('0x24'),_0x3a13c4+'-'+_0x538524+'/'+_0x3c4797)[_0xe622('0x25')](_0x1d7010);}return null;};}function patchUpdates(_0x2aac85){return function(_0x24ef4e){try{jsonpatch[_0xe622('0x26')](_0x24ef4e,_0x2aac85,!![]);}catch(_0x584d59){return BPromise[_0xe622('0x27')](_0x584d59);}return _0x24ef4e[_0xe622('0x28')]();};}function saveUpdates(_0x2417ee,_0x55d92a){return function(_0x57f907){if(_0x57f907){return _0x57f907[_0xe622('0x29')](_0x2417ee)['then'](function(_0x597726){return _0x597726;});}return null;};}function removeEntity(_0x37defb,_0x2969bb){return function(_0x22dd24){if(_0x22dd24){return _0x22dd24[_0xe622('0x2a')]()[_0xe622('0x2b')](function(){_0x37defb[_0xe622('0x1d')](0xcc)[_0xe622('0x1e')]();});}};}function handleEntityNotFound(_0x4bdeb3,_0x18b484){return function(_0x523701){if(!_0x523701){_0x4bdeb3[_0xe622('0x1c')](0x194);}return _0x523701;};}function handleError(_0xb0c498,_0x4bc075){_0x4bc075=_0x4bc075||0x1f4;return function(_0x42c5fd){logger[_0xe622('0x2c')](_0x42c5fd[_0xe622('0x2d')]);if(_0x42c5fd[_0xe622('0x2e')]){delete _0x42c5fd[_0xe622('0x2e')];}_0xb0c498[_0xe622('0x1d')](_0x4bc075)[_0xe622('0x2f')](_0x42c5fd);};}exports['index']=function(_0x505a35,_0x49ecf9){var _0x25aca5={},_0x42f0d1={},_0x172da3={'count':0x0,'rows':[]};var _0x57fdaf=_[_0xe622('0x30')](db[_0xe622('0x31')]['rawAttributes'],function(_0xfe2732){return{'name':_0xfe2732[_0xe622('0x32')],'type':_0xfe2732[_0xe622('0x33')][_0xe622('0x34')]};});_0x42f0d1[_0xe622('0x35')]=_[_0xe622('0x30')](_0x57fdaf,_0xe622('0x2e'));_0x42f0d1['query']=_['keys'](_0x505a35['query']);_0x42f0d1[_0xe622('0x36')]=_[_0xe622('0x37')](_0x42f0d1[_0xe622('0x35')],_0x42f0d1[_0xe622('0x38')]);_0x25aca5[_0xe622('0x39')]=_['intersection'](_0x42f0d1[_0xe622('0x35')],qs[_0xe622('0x3a')](_0x505a35[_0xe622('0x38')][_0xe622('0x3a')]));_0x25aca5['attributes']=_0x25aca5[_0xe622('0x39')][_0xe622('0x3b')]?_0x25aca5[_0xe622('0x39')]:_0x42f0d1[_0xe622('0x35')];if(!_0x505a35[_0xe622('0x38')][_0xe622('0x3c')](_0xe622('0x3d'))){_0x25aca5['limit']=qs['limit'](_0x505a35[_0xe622('0x38')]['limit']);_0x25aca5[_0xe622('0x1f')]=qs['offset'](_0x505a35['query'][_0xe622('0x1f')]);}_0x25aca5[_0xe622('0x3e')]=qs['sort'](_0x505a35[_0xe622('0x38')][_0xe622('0x3f')]);_0x25aca5['where']=qs[_0xe622('0x36')](_[_0xe622('0x40')](_0x505a35[_0xe622('0x38')],_0x42f0d1[_0xe622('0x36')]),_0x57fdaf);if(_0x505a35[_0xe622('0x38')][_0xe622('0x41')]){_0x25aca5[_0xe622('0x42')]=_[_0xe622('0x43')](_0x25aca5[_0xe622('0x42')],{'$or':_[_0xe622('0x30')](_0x57fdaf,function(_0x1d6a9f){if(_0x1d6a9f['type']!=='VIRTUAL'){var _0x150c72={};_0x150c72[_0x1d6a9f['name']]={'$like':'%'+_0x505a35[_0xe622('0x38')]['filter']+'%'};return _0x150c72;}})});}_0x25aca5=_[_0xe622('0x43')]({},_0x25aca5,_0x505a35[_0xe622('0x44')]);var _0x244bb2={'where':_0x25aca5[_0xe622('0x42')]};return db[_0xe622('0x31')][_0xe622('0x22')](_0x244bb2)['then'](function(_0x1129dd){_0x172da3['count']=_0x1129dd;if(_0x505a35['query'][_0xe622('0x45')]){_0x25aca5[_0xe622('0x46')]=[{'all':!![]}];}return db[_0xe622('0x31')][_0xe622('0x47')](_0x25aca5);})[_0xe622('0x2b')](function(_0x368750){_0x172da3[_0xe622('0x48')]=_0x368750;return _0x172da3;})[_0xe622('0x2b')](respondWithFilteredResult(_0x49ecf9,_0x25aca5))[_0xe622('0x49')](handleError(_0x49ecf9,null));};exports[_0xe622('0x4a')]=function(_0x433d62,_0x39c868){var _0x292dcb={'raw':![],'where':{'id':_0x433d62['params']['id']}},_0x3ff1aa={};_0x3ff1aa[_0xe622('0x35')]=_[_0xe622('0x4b')](db[_0xe622('0x31')][_0xe622('0x4c')]);_0x3ff1aa[_0xe622('0x38')]=_[_0xe622('0x4b')](_0x433d62[_0xe622('0x38')]);_0x3ff1aa[_0xe622('0x36')]=_[_0xe622('0x37')](_0x3ff1aa['model'],_0x3ff1aa[_0xe622('0x38')]);_0x292dcb[_0xe622('0x39')]=_[_0xe622('0x37')](_0x3ff1aa[_0xe622('0x35')],qs['fields'](_0x433d62[_0xe622('0x38')][_0xe622('0x3a')]));_0x292dcb['attributes']=_0x292dcb[_0xe622('0x39')][_0xe622('0x3b')]?_0x292dcb['attributes']:_0x3ff1aa[_0xe622('0x35')];if(_0x433d62[_0xe622('0x38')]['includeAll']){_0x292dcb[_0xe622('0x46')]=[{'all':!![]}];}_0x292dcb=_[_0xe622('0x43')]({},_0x292dcb,_0x433d62[_0xe622('0x44')]);return db[_0xe622('0x31')][_0xe622('0x4d')](_0x292dcb)['then'](handleEntityNotFound(_0x39c868,null))[_0xe622('0x2b')](respondWithResult(_0x39c868,null))[_0xe622('0x49')](handleError(_0x39c868,null));};exports[_0xe622('0x4e')]=function(_0x2285cb,_0x234745){return db[_0xe622('0x31')][_0xe622('0x4e')](_0x2285cb[_0xe622('0x4f')],{})[_0xe622('0x2b')](respondWithResult(_0x234745,0xc9))[_0xe622('0x49')](handleError(_0x234745,null));};exports[_0xe622('0x29')]=function(_0x59cb9f,_0x5961c6){if(_0x59cb9f[_0xe622('0x4f')]['id']){delete _0x59cb9f[_0xe622('0x4f')]['id'];}return db[_0xe622('0x31')][_0xe622('0x4d')]({'where':{'id':_0x59cb9f['params']['id']}})[_0xe622('0x2b')](handleEntityNotFound(_0x5961c6,null))['then'](saveUpdates(_0x59cb9f[_0xe622('0x4f')],null))['then'](respondWithResult(_0x5961c6,null))[_0xe622('0x49')](handleError(_0x5961c6,null));};exports['destroy']=function(_0x3f24ce,_0x5d0b87){return db[_0xe622('0x31')][_0xe622('0x4d')]({'where':{'id':_0x3f24ce[_0xe622('0x50')]['id']}})['then'](handleEntityNotFound(_0x5d0b87,null))[_0xe622('0x2b')](removeEntity(_0x5d0b87,null))[_0xe622('0x49')](handleError(_0x5d0b87,null));};exports[_0xe622('0x51')]=function(_0x506e0b,_0x53aa19,_0x2ab4de){var _0xf729a9={};var _0x115cc3={};var _0x26d9fe;var _0x191b46;return db[_0xe622('0x31')]['findOne']({'where':{'id':_0x506e0b[_0xe622('0x50')]['id']}})[_0xe622('0x2b')](handleEntityNotFound(_0x53aa19,null))[_0xe622('0x2b')](function(_0x1ae83a){if(_0x1ae83a){_0x26d9fe=_0x1ae83a;_0x115cc3[_0xe622('0x35')]=_['keys'](db[_0xe622('0x52')]['rawAttributes']);_0x115cc3[_0xe622('0x38')]=_[_0xe622('0x4b')](_0x506e0b[_0xe622('0x38')]);_0x115cc3['filters']=_[_0xe622('0x37')](_0x115cc3[_0xe622('0x35')],_0x115cc3['query']);_0xf729a9[_0xe622('0x39')]=_['intersection'](_0x115cc3[_0xe622('0x35')],qs['fields'](_0x506e0b[_0xe622('0x38')]['fields']));_0xf729a9[_0xe622('0x39')]=_0xf729a9[_0xe622('0x39')][_0xe622('0x3b')]?_0xf729a9[_0xe622('0x39')]:_0x115cc3[_0xe622('0x35')];_0xf729a9[_0xe622('0x3e')]=qs[_0xe622('0x3f')](_0x506e0b[_0xe622('0x38')][_0xe622('0x3f')]);_0xf729a9['where']=qs['filters'](_[_0xe622('0x40')](_0x506e0b[_0xe622('0x38')],_0x115cc3[_0xe622('0x36')]));if(_0x506e0b[_0xe622('0x38')][_0xe622('0x41')]){_0xf729a9[_0xe622('0x42')]=_['merge'](_0xf729a9[_0xe622('0x42')],{'$or':_['map'](_0xf729a9[_0xe622('0x39')],function(_0xdd5fa0){var _0x1d255f={};_0x1d255f[_0xdd5fa0]={'$like':'%'+_0x506e0b['query'][_0xe622('0x41')]+'%'};return _0x1d255f;})});}_0xf729a9=_['merge']({},_0xf729a9,_0x506e0b['options']);return _0x26d9fe[_0xe622('0x51')](_0xf729a9);}})['then'](function(_0xa1ce8e){if(_0xa1ce8e){_0x191b46=_0xa1ce8e[_0xe622('0x3b')];if(!_0x506e0b['query'][_0xe622('0x3c')](_0xe622('0x3d'))){_0xf729a9[_0xe622('0x21')]=qs[_0xe622('0x21')](_0x506e0b['query'][_0xe622('0x21')]);_0xf729a9[_0xe622('0x1f')]=qs[_0xe622('0x1f')](_0x506e0b[_0xe622('0x38')][_0xe622('0x1f')]);}return _0x26d9fe['getFields'](_0xf729a9);}})[_0xe622('0x2b')](function(_0x4cb667){if(_0x4cb667){return _0x4cb667?{'count':_0x191b46,'rows':_0x4cb667}:null;}})[_0xe622('0x2b')](respondWithResult(_0x53aa19,null))[_0xe622('0x49')](handleError(_0x53aa19,null));};exports[_0xe622('0x53')]=function(_0x55f3e0,_0x3e7837,_0x4aa09d){var _0x595872={};var _0x5c2db6={};var _0x2e7b88;var _0x1b76c1;return db[_0xe622('0x31')][_0xe622('0x54')]({'where':{'id':_0x55f3e0[_0xe622('0x50')]['id']}})[_0xe622('0x2b')](handleEntityNotFound(_0x3e7837,null))[_0xe622('0x2b')](function(_0x33d1b0){if(_0x33d1b0){_0x2e7b88=_0x33d1b0;_0x5c2db6[_0xe622('0x35')]=_[_0xe622('0x4b')](db[_0xe622('0x52')][_0xe622('0x4c')]);_0x5c2db6[_0xe622('0x38')]=_[_0xe622('0x4b')](_0x55f3e0[_0xe622('0x38')]);_0x5c2db6[_0xe622('0x36')]=_[_0xe622('0x37')](_0x5c2db6['model'],_0x5c2db6[_0xe622('0x38')]);_0x595872[_0xe622('0x39')]=_[_0xe622('0x37')](_0x5c2db6[_0xe622('0x35')],qs['fields'](_0x55f3e0[_0xe622('0x38')]['fields']));_0x595872['attributes']=_0x595872[_0xe622('0x39')][_0xe622('0x3b')]?_0x595872['attributes']:_0x5c2db6[_0xe622('0x35')];_0x595872[_0xe622('0x3e')]=qs[_0xe622('0x3f')](_0x55f3e0['query'][_0xe622('0x3f')]);_0x595872[_0xe622('0x42')]=qs['filters'](_[_0xe622('0x40')](_0x55f3e0[_0xe622('0x38')],_0x5c2db6[_0xe622('0x36')]));if(_0x55f3e0[_0xe622('0x38')][_0xe622('0x41')]){_0x595872[_0xe622('0x42')]=_[_0xe622('0x43')](_0x595872['where'],{'$or':_[_0xe622('0x30')](_0x595872['attributes'],function(_0x13e0fa){var _0x5d7fdf={};_0x5d7fdf[_0x13e0fa]={'$like':'%'+_0x55f3e0[_0xe622('0x38')]['filter']+'%'};return _0x5d7fdf;})});}_0x595872=_[_0xe622('0x43')]({},_0x595872,_0x55f3e0['options']);return _0x2e7b88['getSubjects'](_0x595872);}})[_0xe622('0x2b')](function(_0xb7185d){if(_0xb7185d){_0x1b76c1=_0xb7185d[_0xe622('0x3b')];if(!_0x55f3e0[_0xe622('0x38')][_0xe622('0x3c')]('nolimit')){_0x595872[_0xe622('0x21')]=qs[_0xe622('0x21')](_0x55f3e0[_0xe622('0x38')][_0xe622('0x21')]);_0x595872[_0xe622('0x1f')]=qs[_0xe622('0x1f')](_0x55f3e0[_0xe622('0x38')]['offset']);}return _0x2e7b88['getSubjects'](_0x595872);}})[_0xe622('0x2b')](function(_0x3a1398){if(_0x3a1398){return _0x3a1398?{'count':_0x1b76c1,'rows':_0x3a1398}:null;}})[_0xe622('0x2b')](respondWithResult(_0x3e7837,null))[_0xe622('0x49')](handleError(_0x3e7837,null));};exports[_0xe622('0x55')]=function(_0xbeb94c,_0x350480,_0x5536e2){var _0x3bc47b={};var _0x4f37c9={};var _0x364a82;var _0x478fb7;return db[_0xe622('0x31')]['findOne']({'where':{'id':_0xbeb94c[_0xe622('0x50')]['id']}})[_0xe622('0x2b')](handleEntityNotFound(_0x350480,null))[_0xe622('0x2b')](function(_0x2a9159){if(_0x2a9159){_0x364a82=_0x2a9159;_0x4f37c9[_0xe622('0x35')]=_[_0xe622('0x4b')](db[_0xe622('0x52')][_0xe622('0x4c')]);_0x4f37c9['query']=_[_0xe622('0x4b')](_0xbeb94c[_0xe622('0x38')]);_0x4f37c9[_0xe622('0x36')]=_[_0xe622('0x37')](_0x4f37c9['model'],_0x4f37c9[_0xe622('0x38')]);_0x3bc47b[_0xe622('0x39')]=_[_0xe622('0x37')](_0x4f37c9[_0xe622('0x35')],qs[_0xe622('0x3a')](_0xbeb94c[_0xe622('0x38')][_0xe622('0x3a')]));_0x3bc47b['attributes']=_0x3bc47b['attributes'][_0xe622('0x3b')]?_0x3bc47b[_0xe622('0x39')]:_0x4f37c9[_0xe622('0x35')];_0x3bc47b['order']=qs['sort'](_0xbeb94c[_0xe622('0x38')][_0xe622('0x3f')]);_0x3bc47b[_0xe622('0x42')]=qs['filters'](_[_0xe622('0x40')](_0xbeb94c[_0xe622('0x38')],_0x4f37c9['filters']));if(_0xbeb94c[_0xe622('0x38')]['filter']){_0x3bc47b[_0xe622('0x42')]=_[_0xe622('0x43')](_0x3bc47b[_0xe622('0x42')],{'$or':_['map'](_0x3bc47b[_0xe622('0x39')],function(_0x4c784c){var _0x3644a2={};_0x3644a2[_0x4c784c]={'$like':'%'+_0xbeb94c[_0xe622('0x38')][_0xe622('0x41')]+'%'};return _0x3644a2;})});}_0x3bc47b=_[_0xe622('0x43')]({},_0x3bc47b,_0xbeb94c['options']);return _0x364a82[_0xe622('0x55')](_0x3bc47b);}})[_0xe622('0x2b')](function(_0x70cc60){if(_0x70cc60){_0x478fb7=_0x70cc60[_0xe622('0x3b')];if(!_0xbeb94c[_0xe622('0x38')]['hasOwnProperty']('nolimit')){_0x3bc47b['limit']=qs[_0xe622('0x21')](_0xbeb94c[_0xe622('0x38')]['limit']);_0x3bc47b[_0xe622('0x1f')]=qs['offset'](_0xbeb94c['query'][_0xe622('0x1f')]);}return _0x364a82[_0xe622('0x55')](_0x3bc47b);}})[_0xe622('0x2b')](function(_0x5c7b3e){if(_0x5c7b3e){return _0x5c7b3e?{'count':_0x478fb7,'rows':_0x5c7b3e}:null;}})[_0xe622('0x2b')](respondWithResult(_0x350480,null))['catch'](handleError(_0x350480,null));}; \ No newline at end of file +var _0x94b5=['params','rawAttributes','filters','options','find','catch','create','update','body','findOne','ZohoField','order','pick','getFields','getSubjects','getDescriptions','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','set','apply','save','then','destroy','sendStatus','error','stack','name','send','map','ZohoConfiguration','fieldName','type','key','query','keys','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','count','includeAll','include','findAll','rows','show'];(function(_0x5c02be,_0x1a222c){var _0x3f487f=function(_0x9e562c){while(--_0x9e562c){_0x5c02be['push'](_0x5c02be['shift']());}};_0x3f487f(++_0x1a222c);}(_0x94b5,0x15c));var _0x594b=function(_0x1ff790,_0x55f1ea){_0x1ff790=_0x1ff790-0x0;var _0x3a2557=_0x94b5[_0x1ff790];return _0x3a2557;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x594b('0x0'));var jsonpatch=require(_0x594b('0x1'));var rp=require(_0x594b('0x2'));var moment=require(_0x594b('0x3'));var BPromise=require(_0x594b('0x4'));var Mustache=require(_0x594b('0x5'));var util=require(_0x594b('0x6'));var path=require(_0x594b('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x594b('0x8'));var fs=require('fs');var fs_extra=require(_0x594b('0x9'));var _=require(_0x594b('0xa'));var squel=require(_0x594b('0xb'));var crypto=require('crypto');var jsforce=require(_0x594b('0xc'));var deskjs=require(_0x594b('0xd'));var toCsv=require(_0x594b('0xe'));var querystring=require(_0x594b('0xf'));var Papa=require(_0x594b('0x10'));var Redis=require('ioredis');var authService=require(_0x594b('0x11'));var qs=require(_0x594b('0x12'));var as=require(_0x594b('0x13'));var hardwareService=require(_0x594b('0x14'));var logger=require(_0x594b('0x15'))(_0x594b('0x16'));var utils=require(_0x594b('0x17'));var config=require(_0x594b('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x594b('0x19'))['db'];function respondWithStatusCode(_0x57d555,_0x5744fe){_0x5744fe=_0x5744fe||0xcc;return function(_0x324f61){if(_0x324f61){return _0x57d555['sendStatus'](_0x5744fe);}return _0x57d555[_0x594b('0x1a')](_0x5744fe)[_0x594b('0x1b')]();};}function respondWithResult(_0x51041e,_0x51e4f5){_0x51e4f5=_0x51e4f5||0xc8;return function(_0x11192b){if(_0x11192b){return _0x51041e[_0x594b('0x1a')](_0x51e4f5)[_0x594b('0x1c')](_0x11192b);}};}function respondWithFilteredResult(_0x3a2d56,_0x242f0e){return function(_0x439ade){if(_0x439ade){var _0x534793=typeof _0x242f0e[_0x594b('0x1d')]===_0x594b('0x1e')&&typeof _0x242f0e[_0x594b('0x1f')]===_0x594b('0x1e');var _0x3d43bc=_0x439ade['count'];var _0x3af037=_0x534793?0x0:_0x242f0e[_0x594b('0x1d')];var _0x322e38=_0x534793?_0x439ade['count']:_0x242f0e['offset']+_0x242f0e[_0x594b('0x1f')];var _0x263904;if(_0x322e38>=_0x3d43bc){_0x322e38=_0x3d43bc;_0x263904=0xc8;}else{_0x263904=0xce;}_0x3a2d56['status'](_0x263904);return _0x3a2d56[_0x594b('0x20')]('Content-Range',_0x3af037+'-'+_0x322e38+'/'+_0x3d43bc)['json'](_0x439ade);}return null;};}function patchUpdates(_0x55c4d0){return function(_0x343961){try{jsonpatch[_0x594b('0x21')](_0x343961,_0x55c4d0,!![]);}catch(_0x2f4366){return BPromise['reject'](_0x2f4366);}return _0x343961[_0x594b('0x22')]();};}function saveUpdates(_0x122787,_0x3e3789){return function(_0x4e30ac){if(_0x4e30ac){return _0x4e30ac['update'](_0x122787)[_0x594b('0x23')](function(_0x549a18){return _0x549a18;});}return null;};}function removeEntity(_0x4f6a0c,_0x3d85e1){return function(_0x41632c){if(_0x41632c){return _0x41632c[_0x594b('0x24')]()[_0x594b('0x23')](function(){_0x4f6a0c[_0x594b('0x1a')](0xcc)[_0x594b('0x1b')]();});}};}function handleEntityNotFound(_0x4dcc6f,_0x5101c4){return function(_0x576bd6){if(!_0x576bd6){_0x4dcc6f[_0x594b('0x25')](0x194);}return _0x576bd6;};}function handleError(_0x6c080,_0x11d35b){_0x11d35b=_0x11d35b||0x1f4;return function(_0x13cdd8){logger[_0x594b('0x26')](_0x13cdd8[_0x594b('0x27')]);if(_0x13cdd8[_0x594b('0x28')]){delete _0x13cdd8['name'];}_0x6c080[_0x594b('0x1a')](_0x11d35b)[_0x594b('0x29')](_0x13cdd8);};}exports['index']=function(_0x53bffb,_0x3618ee){var _0x3125ec={},_0x5b13d5={},_0x1303f4={'count':0x0,'rows':[]};var _0x295950=_[_0x594b('0x2a')](db[_0x594b('0x2b')]['rawAttributes'],function(_0x4b8e50){return{'name':_0x4b8e50[_0x594b('0x2c')],'type':_0x4b8e50[_0x594b('0x2d')][_0x594b('0x2e')]};});_0x5b13d5['model']=_[_0x594b('0x2a')](_0x295950,_0x594b('0x28'));_0x5b13d5[_0x594b('0x2f')]=_[_0x594b('0x30')](_0x53bffb[_0x594b('0x2f')]);_0x5b13d5['filters']=_[_0x594b('0x31')](_0x5b13d5['model'],_0x5b13d5[_0x594b('0x2f')]);_0x3125ec[_0x594b('0x32')]=_[_0x594b('0x31')](_0x5b13d5[_0x594b('0x33')],qs[_0x594b('0x34')](_0x53bffb[_0x594b('0x2f')][_0x594b('0x34')]));_0x3125ec[_0x594b('0x32')]=_0x3125ec['attributes'][_0x594b('0x35')]?_0x3125ec[_0x594b('0x32')]:_0x5b13d5[_0x594b('0x33')];if(!_0x53bffb[_0x594b('0x2f')][_0x594b('0x36')](_0x594b('0x37'))){_0x3125ec[_0x594b('0x1f')]=qs[_0x594b('0x1f')](_0x53bffb[_0x594b('0x2f')]['limit']);_0x3125ec[_0x594b('0x1d')]=qs['offset'](_0x53bffb[_0x594b('0x2f')][_0x594b('0x1d')]);}_0x3125ec['order']=qs[_0x594b('0x38')](_0x53bffb[_0x594b('0x2f')][_0x594b('0x38')]);_0x3125ec[_0x594b('0x39')]=qs['filters'](_['pick'](_0x53bffb[_0x594b('0x2f')],_0x5b13d5['filters']),_0x295950);if(_0x53bffb[_0x594b('0x2f')][_0x594b('0x3a')]){_0x3125ec['where']=_[_0x594b('0x3b')](_0x3125ec[_0x594b('0x39')],{'$or':_[_0x594b('0x2a')](_0x295950,function(_0x222ec3){if(_0x222ec3[_0x594b('0x2d')]!==_0x594b('0x3c')){var _0x441200={};_0x441200[_0x222ec3[_0x594b('0x28')]]={'$like':'%'+_0x53bffb[_0x594b('0x2f')][_0x594b('0x3a')]+'%'};return _0x441200;}})});}_0x3125ec=_[_0x594b('0x3b')]({},_0x3125ec,_0x53bffb['options']);var _0x4e150a={'where':_0x3125ec[_0x594b('0x39')]};return db[_0x594b('0x2b')][_0x594b('0x3d')](_0x4e150a)[_0x594b('0x23')](function(_0x3aa1b5){_0x1303f4['count']=_0x3aa1b5;if(_0x53bffb[_0x594b('0x2f')][_0x594b('0x3e')]){_0x3125ec[_0x594b('0x3f')]=[{'all':!![]}];}return db[_0x594b('0x2b')][_0x594b('0x40')](_0x3125ec);})[_0x594b('0x23')](function(_0x3513f8){_0x1303f4[_0x594b('0x41')]=_0x3513f8;return _0x1303f4;})[_0x594b('0x23')](respondWithFilteredResult(_0x3618ee,_0x3125ec))['catch'](handleError(_0x3618ee,null));};exports[_0x594b('0x42')]=function(_0x347b69,_0x46aae8){var _0x576ba7={'raw':![],'where':{'id':_0x347b69[_0x594b('0x43')]['id']}},_0x3fef0e={};_0x3fef0e[_0x594b('0x33')]=_[_0x594b('0x30')](db[_0x594b('0x2b')][_0x594b('0x44')]);_0x3fef0e[_0x594b('0x2f')]=_[_0x594b('0x30')](_0x347b69[_0x594b('0x2f')]);_0x3fef0e[_0x594b('0x45')]=_[_0x594b('0x31')](_0x3fef0e[_0x594b('0x33')],_0x3fef0e['query']);_0x576ba7[_0x594b('0x32')]=_[_0x594b('0x31')](_0x3fef0e[_0x594b('0x33')],qs[_0x594b('0x34')](_0x347b69['query'][_0x594b('0x34')]));_0x576ba7[_0x594b('0x32')]=_0x576ba7[_0x594b('0x32')][_0x594b('0x35')]?_0x576ba7['attributes']:_0x3fef0e['model'];if(_0x347b69['query']['includeAll']){_0x576ba7['include']=[{'all':!![]}];}_0x576ba7=_[_0x594b('0x3b')]({},_0x576ba7,_0x347b69[_0x594b('0x46')]);return db[_0x594b('0x2b')][_0x594b('0x47')](_0x576ba7)['then'](handleEntityNotFound(_0x46aae8,null))[_0x594b('0x23')](respondWithResult(_0x46aae8,null))[_0x594b('0x48')](handleError(_0x46aae8,null));};exports[_0x594b('0x49')]=function(_0x3fc956,_0x41c2ee){return db[_0x594b('0x2b')]['create'](_0x3fc956['body'],{})[_0x594b('0x23')](respondWithResult(_0x41c2ee,0xc9))['catch'](handleError(_0x41c2ee,null));};exports[_0x594b('0x4a')]=function(_0x1c03f4,_0x1ec35f){if(_0x1c03f4[_0x594b('0x4b')]['id']){delete _0x1c03f4[_0x594b('0x4b')]['id'];}return db['ZohoConfiguration'][_0x594b('0x47')]({'where':{'id':_0x1c03f4[_0x594b('0x43')]['id']}})[_0x594b('0x23')](handleEntityNotFound(_0x1ec35f,null))[_0x594b('0x23')](saveUpdates(_0x1c03f4[_0x594b('0x4b')],null))[_0x594b('0x23')](respondWithResult(_0x1ec35f,null))[_0x594b('0x48')](handleError(_0x1ec35f,null));};exports[_0x594b('0x24')]=function(_0xdf613c,_0x30dff2){return db[_0x594b('0x2b')][_0x594b('0x47')]({'where':{'id':_0xdf613c['params']['id']}})['then'](handleEntityNotFound(_0x30dff2,null))[_0x594b('0x23')](removeEntity(_0x30dff2,null))[_0x594b('0x48')](handleError(_0x30dff2,null));};exports['getFields']=function(_0x2e607c,_0x2f2865,_0x1c05b8){var _0x444f45={};var _0x4c92f9={};var _0x428c82;var _0x4842c9;return db[_0x594b('0x2b')][_0x594b('0x4c')]({'where':{'id':_0x2e607c[_0x594b('0x43')]['id']}})[_0x594b('0x23')](handleEntityNotFound(_0x2f2865,null))[_0x594b('0x23')](function(_0xa91bc6){if(_0xa91bc6){_0x428c82=_0xa91bc6;_0x4c92f9[_0x594b('0x33')]=_[_0x594b('0x30')](db[_0x594b('0x4d')][_0x594b('0x44')]);_0x4c92f9[_0x594b('0x2f')]=_[_0x594b('0x30')](_0x2e607c[_0x594b('0x2f')]);_0x4c92f9[_0x594b('0x45')]=_[_0x594b('0x31')](_0x4c92f9[_0x594b('0x33')],_0x4c92f9['query']);_0x444f45[_0x594b('0x32')]=_['intersection'](_0x4c92f9['model'],qs[_0x594b('0x34')](_0x2e607c['query'][_0x594b('0x34')]));_0x444f45[_0x594b('0x32')]=_0x444f45[_0x594b('0x32')][_0x594b('0x35')]?_0x444f45[_0x594b('0x32')]:_0x4c92f9[_0x594b('0x33')];_0x444f45[_0x594b('0x4e')]=qs[_0x594b('0x38')](_0x2e607c[_0x594b('0x2f')][_0x594b('0x38')]);_0x444f45[_0x594b('0x39')]=qs[_0x594b('0x45')](_[_0x594b('0x4f')](_0x2e607c[_0x594b('0x2f')],_0x4c92f9[_0x594b('0x45')]));if(_0x2e607c[_0x594b('0x2f')]['filter']){_0x444f45[_0x594b('0x39')]=_[_0x594b('0x3b')](_0x444f45[_0x594b('0x39')],{'$or':_[_0x594b('0x2a')](_0x444f45[_0x594b('0x32')],function(_0x3587ce){var _0x2bd6d3={};_0x2bd6d3[_0x3587ce]={'$like':'%'+_0x2e607c[_0x594b('0x2f')][_0x594b('0x3a')]+'%'};return _0x2bd6d3;})});}_0x444f45=_[_0x594b('0x3b')]({},_0x444f45,_0x2e607c[_0x594b('0x46')]);return _0x428c82[_0x594b('0x50')](_0x444f45);}})[_0x594b('0x23')](function(_0x540fb6){if(_0x540fb6){_0x4842c9=_0x540fb6[_0x594b('0x35')];if(!_0x2e607c[_0x594b('0x2f')][_0x594b('0x36')](_0x594b('0x37'))){_0x444f45[_0x594b('0x1f')]=qs['limit'](_0x2e607c[_0x594b('0x2f')][_0x594b('0x1f')]);_0x444f45['offset']=qs[_0x594b('0x1d')](_0x2e607c[_0x594b('0x2f')][_0x594b('0x1d')]);}return _0x428c82[_0x594b('0x50')](_0x444f45);}})['then'](function(_0x37e4fa){if(_0x37e4fa){return _0x37e4fa?{'count':_0x4842c9,'rows':_0x37e4fa}:null;}})[_0x594b('0x23')](respondWithResult(_0x2f2865,null))[_0x594b('0x48')](handleError(_0x2f2865,null));};exports['getSubjects']=function(_0x46b5b5,_0x3472d8,_0x174592){var _0x13b7f9={};var _0x3e51c9={};var _0x4e48c6;var _0x27e5d2;return db[_0x594b('0x2b')][_0x594b('0x4c')]({'where':{'id':_0x46b5b5[_0x594b('0x43')]['id']}})[_0x594b('0x23')](handleEntityNotFound(_0x3472d8,null))[_0x594b('0x23')](function(_0xf3e522){if(_0xf3e522){_0x4e48c6=_0xf3e522;_0x3e51c9[_0x594b('0x33')]=_[_0x594b('0x30')](db[_0x594b('0x4d')]['rawAttributes']);_0x3e51c9[_0x594b('0x2f')]=_['keys'](_0x46b5b5['query']);_0x3e51c9[_0x594b('0x45')]=_['intersection'](_0x3e51c9[_0x594b('0x33')],_0x3e51c9['query']);_0x13b7f9['attributes']=_['intersection'](_0x3e51c9[_0x594b('0x33')],qs[_0x594b('0x34')](_0x46b5b5[_0x594b('0x2f')][_0x594b('0x34')]));_0x13b7f9[_0x594b('0x32')]=_0x13b7f9[_0x594b('0x32')][_0x594b('0x35')]?_0x13b7f9['attributes']:_0x3e51c9['model'];_0x13b7f9['order']=qs[_0x594b('0x38')](_0x46b5b5['query']['sort']);_0x13b7f9[_0x594b('0x39')]=qs[_0x594b('0x45')](_[_0x594b('0x4f')](_0x46b5b5[_0x594b('0x2f')],_0x3e51c9[_0x594b('0x45')]));if(_0x46b5b5['query'][_0x594b('0x3a')]){_0x13b7f9['where']=_[_0x594b('0x3b')](_0x13b7f9[_0x594b('0x39')],{'$or':_[_0x594b('0x2a')](_0x13b7f9['attributes'],function(_0x568d61){var _0x187c89={};_0x187c89[_0x568d61]={'$like':'%'+_0x46b5b5[_0x594b('0x2f')][_0x594b('0x3a')]+'%'};return _0x187c89;})});}_0x13b7f9=_[_0x594b('0x3b')]({},_0x13b7f9,_0x46b5b5[_0x594b('0x46')]);return _0x4e48c6[_0x594b('0x51')](_0x13b7f9);}})[_0x594b('0x23')](function(_0x576347){if(_0x576347){_0x27e5d2=_0x576347[_0x594b('0x35')];if(!_0x46b5b5[_0x594b('0x2f')][_0x594b('0x36')]('nolimit')){_0x13b7f9[_0x594b('0x1f')]=qs[_0x594b('0x1f')](_0x46b5b5[_0x594b('0x2f')][_0x594b('0x1f')]);_0x13b7f9[_0x594b('0x1d')]=qs[_0x594b('0x1d')](_0x46b5b5[_0x594b('0x2f')][_0x594b('0x1d')]);}return _0x4e48c6[_0x594b('0x51')](_0x13b7f9);}})[_0x594b('0x23')](function(_0x5e80f5){if(_0x5e80f5){return _0x5e80f5?{'count':_0x27e5d2,'rows':_0x5e80f5}:null;}})[_0x594b('0x23')](respondWithResult(_0x3472d8,null))[_0x594b('0x48')](handleError(_0x3472d8,null));};exports[_0x594b('0x52')]=function(_0x3a4ab8,_0x243167,_0x362310){var _0x1cd267={};var _0x2b5d5e={};var _0x5a1fe1;var _0x27f6b6;return db[_0x594b('0x2b')]['findOne']({'where':{'id':_0x3a4ab8[_0x594b('0x43')]['id']}})[_0x594b('0x23')](handleEntityNotFound(_0x243167,null))[_0x594b('0x23')](function(_0x580c86){if(_0x580c86){_0x5a1fe1=_0x580c86;_0x2b5d5e['model']=_['keys'](db['ZohoField'][_0x594b('0x44')]);_0x2b5d5e[_0x594b('0x2f')]=_[_0x594b('0x30')](_0x3a4ab8[_0x594b('0x2f')]);_0x2b5d5e['filters']=_[_0x594b('0x31')](_0x2b5d5e[_0x594b('0x33')],_0x2b5d5e[_0x594b('0x2f')]);_0x1cd267[_0x594b('0x32')]=_['intersection'](_0x2b5d5e['model'],qs[_0x594b('0x34')](_0x3a4ab8[_0x594b('0x2f')][_0x594b('0x34')]));_0x1cd267[_0x594b('0x32')]=_0x1cd267[_0x594b('0x32')][_0x594b('0x35')]?_0x1cd267[_0x594b('0x32')]:_0x2b5d5e[_0x594b('0x33')];_0x1cd267[_0x594b('0x4e')]=qs[_0x594b('0x38')](_0x3a4ab8[_0x594b('0x2f')][_0x594b('0x38')]);_0x1cd267['where']=qs[_0x594b('0x45')](_[_0x594b('0x4f')](_0x3a4ab8[_0x594b('0x2f')],_0x2b5d5e[_0x594b('0x45')]));if(_0x3a4ab8[_0x594b('0x2f')][_0x594b('0x3a')]){_0x1cd267[_0x594b('0x39')]=_[_0x594b('0x3b')](_0x1cd267['where'],{'$or':_[_0x594b('0x2a')](_0x1cd267[_0x594b('0x32')],function(_0x72246d){var _0x29945c={};_0x29945c[_0x72246d]={'$like':'%'+_0x3a4ab8[_0x594b('0x2f')][_0x594b('0x3a')]+'%'};return _0x29945c;})});}_0x1cd267=_['merge']({},_0x1cd267,_0x3a4ab8[_0x594b('0x46')]);return _0x5a1fe1['getDescriptions'](_0x1cd267);}})['then'](function(_0x5cfc02){if(_0x5cfc02){_0x27f6b6=_0x5cfc02[_0x594b('0x35')];if(!_0x3a4ab8[_0x594b('0x2f')][_0x594b('0x36')]('nolimit')){_0x1cd267[_0x594b('0x1f')]=qs[_0x594b('0x1f')](_0x3a4ab8[_0x594b('0x2f')]['limit']);_0x1cd267[_0x594b('0x1d')]=qs['offset'](_0x3a4ab8[_0x594b('0x2f')][_0x594b('0x1d')]);}return _0x5a1fe1['getDescriptions'](_0x1cd267);}})[_0x594b('0x23')](function(_0x12fbf5){if(_0x12fbf5){return _0x12fbf5?{'count':_0x27f6b6,'rows':_0x12fbf5}:null;}})[_0x594b('0x23')](respondWithResult(_0x243167,null))['catch'](handleError(_0x243167,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index f480816..eaac4c1 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 _0x3eee=['../../config/logger','api','moment','bluebird','request-promise','rimraf','./intZohoConfiguration.attributes','define','ZohoConfiguration','lodash','util'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x3eee,0x106));var _0xe3ee=function(_0x129a01,_0x55d4cf){_0x129a01=_0x129a01-0x0;var _0x5d8147=_0x3eee[_0x129a01];return _0x5d8147;};'use strict';var _=require(_0xe3ee('0x0'));var util=require(_0xe3ee('0x1'));var logger=require(_0xe3ee('0x2'))(_0xe3ee('0x3'));var moment=require(_0xe3ee('0x4'));var BPromise=require(_0xe3ee('0x5'));var rp=require(_0xe3ee('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe3ee('0x7'));var config=require('../../config/environment');var attributes=require(_0xe3ee('0x8'));module['exports']=function(_0x890831,_0x3fdb62){return _0x890831[_0xe3ee('0x9')](_0xe3ee('0xa'),attributes,{'tableName':'int_zoho_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1cca=['exports','define','ZohoConfiguration','int_zoho_configurations','util','../../config/logger','moment','bluebird','path','rimraf','./intZohoConfiguration.attributes'];(function(_0x315c6e,_0x51d5ad){var _0x2169f4=function(_0x31f998){while(--_0x31f998){_0x315c6e['push'](_0x315c6e['shift']());}};_0x2169f4(++_0x51d5ad);}(_0x1cca,0x164));var _0xa1cc=function(_0x50feb9,_0xebd89d){_0x50feb9=_0x50feb9-0x0;var _0x1a3d37=_0x1cca[_0x50feb9];return _0x1a3d37;};'use strict';var _=require('lodash');var util=require(_0xa1cc('0x0'));var logger=require(_0xa1cc('0x1'))('api');var moment=require(_0xa1cc('0x2'));var BPromise=require(_0xa1cc('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa1cc('0x4'));var rimraf=require(_0xa1cc('0x5'));var config=require('../../config/environment');var attributes=require(_0xa1cc('0x6'));module[_0xa1cc('0x7')]=function(_0x4e5416,_0x5a675e){return _0x4e5416[_0xa1cc('0x8')](_0xa1cc('0x9'),attributes,{'tableName':_0xa1cc('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 cea462f..b8c2568 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 _0xc2dc=['code','message','catch','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x15ae14,_0xe432ce){var _0x422b67=function(_0x7c570e){while(--_0x7c570e){_0x15ae14['push'](_0x15ae14['shift']());}};_0x422b67(++_0xe432ce);}(_0xc2dc,0xd2));var _0xcc2d=function(_0x393db8,_0x3e1157){_0x393db8=_0x393db8-0x0;var _0x4295cc=_0xc2dc[_0x393db8];return _0x4295cc;};'use strict';var _=require(_0xcc2d('0x0'));var util=require('util');var moment=require(_0xcc2d('0x1'));var BPromise=require('bluebird');var rs=require(_0xcc2d('0x2'));var fs=require('fs');var Redis=require(_0xcc2d('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xcc2d('0x4'));var logger=require(_0xcc2d('0x5'))(_0xcc2d('0x6'));var config=require(_0xcc2d('0x7'));var jayson=require(_0xcc2d('0x8'));var client=jayson[_0xcc2d('0x9')][_0xcc2d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cf1c3,_0x342d7f,_0x4be51d){return new BPromise(function(_0x51d857,_0x4a4115){return client[_0xcc2d('0xb')](_0x3cf1c3,_0x4be51d)[_0xcc2d('0xc')](function(_0xf9f9f5){logger[_0xcc2d('0xd')](_0xcc2d('0xe'),_0x342d7f,_0xcc2d('0xf'));logger[_0xcc2d('0x10')](_0xcc2d('0x11'),_0x342d7f,_0xcc2d('0xf'),JSON[_0xcc2d('0x12')](_0xf9f9f5));if(_0xf9f9f5[_0xcc2d('0x13')]){if(_0xf9f9f5[_0xcc2d('0x13')][_0xcc2d('0x14')]===0x1f4){logger[_0xcc2d('0x13')](_0xcc2d('0xe'),_0x342d7f,_0xf9f9f5[_0xcc2d('0x13')][_0xcc2d('0x15')]);return _0x4a4115(_0xf9f9f5[_0xcc2d('0x13')]['message']);}logger[_0xcc2d('0x13')](_0xcc2d('0xe'),_0x342d7f,_0xf9f9f5[_0xcc2d('0x13')][_0xcc2d('0x15')]);return _0x51d857(_0xf9f9f5['error'][_0xcc2d('0x15')]);}else{logger['info'](_0xcc2d('0xe'),_0x342d7f,'request\x20sent');_0x51d857(_0xf9f9f5['result']['message']);}})[_0xcc2d('0x16')](function(_0x3cac71){logger[_0xcc2d('0x13')](_0xcc2d('0xe'),_0x342d7f,_0x3cac71);_0x4a4115(_0x3cac71);});});} \ No newline at end of file +var _0x045b=['http','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','ZohoConfiguration,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/environment','client'];(function(_0x4616b8,_0x1d196e){var _0x276802=function(_0x44c644){while(--_0x44c644){_0x4616b8['push'](_0x4616b8['shift']());}};_0x276802(++_0x1d196e);}(_0x045b,0x7d));var _0xb045=function(_0x43a5c7,_0x2286bf){_0x43a5c7=_0x43a5c7-0x0;var _0x3b12a2=_0x045b[_0x43a5c7];return _0x3b12a2;};'use strict';var _=require(_0xb045('0x0'));var util=require(_0xb045('0x1'));var moment=require(_0xb045('0x2'));var BPromise=require('bluebird');var rs=require(_0xb045('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb045('0x4'))['db'];var utils=require(_0xb045('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xb045('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xb045('0x7')][_0xb045('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2c93ed,_0x15266a,_0x46d25e){return new BPromise(function(_0x56e878,_0x3d0ff4){return client['request'](_0x2c93ed,_0x46d25e)['then'](function(_0x5eea18){logger['info']('ZohoConfiguration,\x20%s,\x20%s',_0x15266a,'request\x20sent');logger[_0xb045('0x9')](_0xb045('0xa'),_0x15266a,_0xb045('0xb'),JSON['stringify'](_0x5eea18));if(_0x5eea18['error']){if(_0x5eea18[_0xb045('0xc')][_0xb045('0xd')]===0x1f4){logger[_0xb045('0xc')](_0xb045('0xe'),_0x15266a,_0x5eea18[_0xb045('0xc')]['message']);return _0x3d0ff4(_0x5eea18[_0xb045('0xc')]['message']);}logger[_0xb045('0xc')](_0xb045('0xe'),_0x15266a,_0x5eea18[_0xb045('0xc')][_0xb045('0xf')]);return _0x56e878(_0x5eea18[_0xb045('0xc')][_0xb045('0xf')]);}else{logger[_0xb045('0x10')](_0xb045('0xe'),_0x15266a,_0xb045('0xb'));_0x56e878(_0x5eea18[_0xb045('0x11')]['message']);}})[_0xb045('0x12')](function(_0x489c2f){logger[_0xb045('0xc')](_0xb045('0xe'),_0x15266a,_0x489c2f);_0x3d0ff4(_0x489c2f);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index ba16adb..a9aba80 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 _0x4e63=['put','delete','destroy','exports','multer','connect-timeout','express','fs-extra','isAuthenticated','index','get','/:id','show','create'];(function(_0x4190b4,_0x4ba648){var _0x213025=function(_0x437cb1){while(--_0x437cb1){_0x4190b4['push'](_0x4190b4['shift']());}};_0x213025(++_0x4ba648);}(_0x4e63,0xe4));var _0x34e6=function(_0x256b33,_0x182db9){_0x256b33=_0x256b33-0x0;var _0x460503=_0x4e63[_0x256b33];return _0x460503;};'use strict';var multer=require(_0x34e6('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x34e6('0x1'));var express=require(_0x34e6('0x2'));var router=express['Router']();var fs_extra=require(_0x34e6('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intZohoField.controller');router['get']('/',auth[_0x34e6('0x4')](),controller[_0x34e6('0x5')]);router[_0x34e6('0x6')](_0x34e6('0x7'),auth[_0x34e6('0x4')](),controller[_0x34e6('0x8')]);router['post']('/',auth[_0x34e6('0x4')](),controller[_0x34e6('0x9')]);router[_0x34e6('0xa')](_0x34e6('0x7'),auth[_0x34e6('0x4')](),controller['update']);router[_0x34e6('0xb')](_0x34e6('0x7'),auth[_0x34e6('0x4')](),controller[_0x34e6('0xc')]);module[_0x34e6('0xd')]=router; \ No newline at end of file +var _0x4e31=['delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller','get','/:id','isAuthenticated','post','create','update'];(function(_0x1133fc,_0x324619){var _0x320a68=function(_0x542cba){while(--_0x542cba){_0x1133fc['push'](_0x1133fc['shift']());}};_0x320a68(++_0x324619);}(_0x4e31,0x1f0));var _0x14e3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x4e31[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x14e3('0x0'));var util=require(_0x14e3('0x1'));var path=require(_0x14e3('0x2'));var timeout=require(_0x14e3('0x3'));var express=require(_0x14e3('0x4'));var router=express[_0x14e3('0x5')]();var fs_extra=require(_0x14e3('0x6'));var auth=require(_0x14e3('0x7'));var interaction=require(_0x14e3('0x8'));var config=require(_0x14e3('0x9'));var controller=require(_0x14e3('0xa'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x14e3('0xb')](_0x14e3('0xc'),auth[_0x14e3('0xd')](),controller['show']);router[_0x14e3('0xe')]('/',auth[_0x14e3('0xd')](),controller[_0x14e3('0xf')]);router['put']('/:id',auth[_0x14e3('0xd')](),controller[_0x14e3('0x10')]);router[_0x14e3('0x11')](_0x14e3('0xc'),auth[_0x14e3('0xd')](),controller['destroy']);module[_0x14e3('0x12')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index fbdc2d9..c4b415b 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 _0xc579=['ENUM','variable','customVariable','keyValue','picklist','string','STRING','sequelize','exports'];(function(_0x10fc81,_0x2f7539){var _0x467cb7=function(_0x79049f){while(--_0x79049f){_0x10fc81['push'](_0x10fc81['shift']());}};_0x467cb7(++_0x2f7539);}(_0xc579,0x178));var _0x9c57=function(_0xc233a1,_0x4d7de3){_0xc233a1=_0xc233a1-0x0;var _0x1a0b54=_0xc579[_0xc233a1];return _0x1a0b54;};'use strict';var Sequelize=require(_0x9c57('0x0'));module[_0x9c57('0x1')]={'type':{'type':Sequelize[_0x9c57('0x2')]('string',_0x9c57('0x3'),_0x9c57('0x4'),_0x9c57('0x5'),_0x9c57('0x6')),'defaultValue':_0x9c57('0x7')},'content':{'type':Sequelize[_0x9c57('0x8')]},'key':{'type':Sequelize[_0x9c57('0x8')]},'keyType':{'type':Sequelize[_0x9c57('0x2')](_0x9c57('0x7'),_0x9c57('0x3'),_0x9c57('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x9c57('0x8')]},'nameField':{'type':Sequelize[_0x9c57('0x8')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x3984=['sequelize','exports','ENUM','string','variable','customVariable','keyValue','picklist','STRING'];(function(_0x1bc852,_0x1a00ca){var _0x10194f=function(_0x4ac89e){while(--_0x4ac89e){_0x1bc852['push'](_0x1bc852['shift']());}};_0x10194f(++_0x1a00ca);}(_0x3984,0x156));var _0x4398=function(_0x59616b,_0x38e534){_0x59616b=_0x59616b-0x0;var _0x5c4523=_0x3984[_0x59616b];return _0x5c4523;};'use strict';var Sequelize=require(_0x4398('0x0'));module[_0x4398('0x1')]={'type':{'type':Sequelize[_0x4398('0x2')](_0x4398('0x3'),_0x4398('0x4'),_0x4398('0x5'),_0x4398('0x6'),_0x4398('0x7')),'defaultValue':_0x4398('0x3')},'content':{'type':Sequelize[_0x4398('0x8')]},'key':{'type':Sequelize[_0x4398('0x8')]},'keyType':{'type':Sequelize[_0x4398('0x2')](_0x4398('0x3'),_0x4398('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0x4398('0x8')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4398('0x8')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 8f37f50..079e0cc 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 _0x600a=['body','find','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','set','apply','reject','save','update','then','destroy','error','stack','send','map','ZohoField','type','key','model','name','filters','intersection','attributes','fields','length','query','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','count','includeAll','findAll','rows','show','params','keys','rawAttributes','catch','create'];(function(_0x4978de,_0x5912e4){var _0x675221=function(_0x3ee409){while(--_0x3ee409){_0x4978de['push'](_0x4978de['shift']());}};_0x675221(++_0x5912e4);}(_0x600a,0xe0));var _0xa600=function(_0x3e2fcf,_0x579110){_0x3e2fcf=_0x3e2fcf-0x0;var _0x497db7=_0x600a[_0x3e2fcf];return _0x497db7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa600('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa600('0x1'));var rp=require(_0xa600('0x2'));var moment=require(_0xa600('0x3'));var BPromise=require(_0xa600('0x4'));var Mustache=require(_0xa600('0x5'));var util=require(_0xa600('0x6'));var path=require(_0xa600('0x7'));var sox=require(_0xa600('0x8'));var csv=require(_0xa600('0x9'));var ejs=require(_0xa600('0xa'));var fs=require('fs');var fs_extra=require(_0xa600('0xb'));var _=require('lodash');var squel=require(_0xa600('0xc'));var crypto=require(_0xa600('0xd'));var jsforce=require(_0xa600('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xa600('0x9'));var querystring=require(_0xa600('0xf'));var Papa=require(_0xa600('0x10'));var Redis=require(_0xa600('0x11'));var authService=require(_0xa600('0x12'));var qs=require(_0xa600('0x13'));var as=require(_0xa600('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa600('0x15'));var utils=require(_0xa600('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xa600('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x46d64b,_0xa7506){_0xa7506=_0xa7506||0xcc;return function(_0x1258c5){if(_0x1258c5){return _0x46d64b[_0xa600('0x18')](_0xa7506);}return _0x46d64b['status'](_0xa7506)[_0xa600('0x19')]();};}function respondWithResult(_0x3ce424,_0x55b2b0){_0x55b2b0=_0x55b2b0||0xc8;return function(_0x329e5a){if(_0x329e5a){return _0x3ce424[_0xa600('0x1a')](_0x55b2b0)[_0xa600('0x1b')](_0x329e5a);}};}function respondWithFilteredResult(_0x5ba61c,_0x56a7b5){return function(_0x151f0d){if(_0x151f0d){var _0x379c4e=typeof _0x56a7b5[_0xa600('0x1c')]===_0xa600('0x1d')&&typeof _0x56a7b5[_0xa600('0x1e')]==='undefined';var _0x2d8ce2=_0x151f0d['count'];var _0x2bce13=_0x379c4e?0x0:_0x56a7b5[_0xa600('0x1c')];var _0x4dd5e9=_0x379c4e?_0x151f0d['count']:_0x56a7b5[_0xa600('0x1c')]+_0x56a7b5[_0xa600('0x1e')];var _0x580f5;if(_0x4dd5e9>=_0x2d8ce2){_0x4dd5e9=_0x2d8ce2;_0x580f5=0xc8;}else{_0x580f5=0xce;}_0x5ba61c[_0xa600('0x1a')](_0x580f5);return _0x5ba61c[_0xa600('0x1f')]('Content-Range',_0x2bce13+'-'+_0x4dd5e9+'/'+_0x2d8ce2)[_0xa600('0x1b')](_0x151f0d);}return null;};}function patchUpdates(_0x2f256d){return function(_0x1fc4db){try{jsonpatch[_0xa600('0x20')](_0x1fc4db,_0x2f256d,!![]);}catch(_0x427b8e){return BPromise[_0xa600('0x21')](_0x427b8e);}return _0x1fc4db[_0xa600('0x22')]();};}function saveUpdates(_0x2e5000,_0x80341d){return function(_0x519375){if(_0x519375){return _0x519375[_0xa600('0x23')](_0x2e5000)[_0xa600('0x24')](function(_0x5a2f83){return _0x5a2f83;});}return null;};}function removeEntity(_0x3ce89e,_0x225496){return function(_0x3c089d){if(_0x3c089d){return _0x3c089d[_0xa600('0x25')]()[_0xa600('0x24')](function(){_0x3ce89e[_0xa600('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x117cd9,_0x2dd6fb){return function(_0x524a60){if(!_0x524a60){_0x117cd9[_0xa600('0x18')](0x194);}return _0x524a60;};}function handleError(_0x5e09ba,_0x4fdd12){_0x4fdd12=_0x4fdd12||0x1f4;return function(_0x130efa){logger[_0xa600('0x26')](_0x130efa[_0xa600('0x27')]);if(_0x130efa['name']){delete _0x130efa['name'];}_0x5e09ba['status'](_0x4fdd12)[_0xa600('0x28')](_0x130efa);};}exports['index']=function(_0x577f5c,_0x398292){var _0x3a1070={},_0x343235={},_0x194bc8={'count':0x0,'rows':[]};var _0x4c833b=_[_0xa600('0x29')](db[_0xa600('0x2a')]['rawAttributes'],function(_0x4729a6){return{'name':_0x4729a6['fieldName'],'type':_0x4729a6[_0xa600('0x2b')][_0xa600('0x2c')]};});_0x343235[_0xa600('0x2d')]=_[_0xa600('0x29')](_0x4c833b,_0xa600('0x2e'));_0x343235['query']=_['keys'](_0x577f5c['query']);_0x343235[_0xa600('0x2f')]=_[_0xa600('0x30')](_0x343235[_0xa600('0x2d')],_0x343235['query']);_0x3a1070[_0xa600('0x31')]=_[_0xa600('0x30')](_0x343235['model'],qs[_0xa600('0x32')](_0x577f5c['query'][_0xa600('0x32')]));_0x3a1070['attributes']=_0x3a1070[_0xa600('0x31')][_0xa600('0x33')]?_0x3a1070[_0xa600('0x31')]:_0x343235[_0xa600('0x2d')];if(!_0x577f5c[_0xa600('0x34')]['hasOwnProperty'](_0xa600('0x35'))){_0x3a1070[_0xa600('0x1e')]=qs[_0xa600('0x1e')](_0x577f5c[_0xa600('0x34')][_0xa600('0x1e')]);_0x3a1070['offset']=qs['offset'](_0x577f5c[_0xa600('0x34')]['offset']);}_0x3a1070[_0xa600('0x36')]=qs['sort'](_0x577f5c[_0xa600('0x34')][_0xa600('0x37')]);_0x3a1070['where']=qs['filters'](_[_0xa600('0x38')](_0x577f5c[_0xa600('0x34')],_0x343235[_0xa600('0x2f')]),_0x4c833b);if(_0x577f5c['query']['filter']){_0x3a1070[_0xa600('0x39')]=_[_0xa600('0x3a')](_0x3a1070[_0xa600('0x39')],{'$or':_[_0xa600('0x29')](_0x4c833b,function(_0xc45a7f){if(_0xc45a7f['type']!==_0xa600('0x3b')){var _0x3692f2={};_0x3692f2[_0xc45a7f['name']]={'$like':'%'+_0x577f5c[_0xa600('0x34')][_0xa600('0x3c')]+'%'};return _0x3692f2;}})});}_0x3a1070=_[_0xa600('0x3a')]({},_0x3a1070,_0x577f5c[_0xa600('0x3d')]);var _0x1e582a={'where':_0x3a1070[_0xa600('0x39')]};return db[_0xa600('0x2a')][_0xa600('0x3e')](_0x1e582a)[_0xa600('0x24')](function(_0x422170){_0x194bc8['count']=_0x422170;if(_0x577f5c[_0xa600('0x34')][_0xa600('0x3f')]){_0x3a1070['include']=[{'all':!![]}];}return db['ZohoField'][_0xa600('0x40')](_0x3a1070);})[_0xa600('0x24')](function(_0x140396){_0x194bc8[_0xa600('0x41')]=_0x140396;return _0x194bc8;})[_0xa600('0x24')](respondWithFilteredResult(_0x398292,_0x3a1070))['catch'](handleError(_0x398292,null));};exports[_0xa600('0x42')]=function(_0x66142d,_0x1f069d){var _0x52f70d={'raw':!![],'where':{'id':_0x66142d[_0xa600('0x43')]['id']}},_0x5435bc={};_0x5435bc[_0xa600('0x2d')]=_[_0xa600('0x44')](db[_0xa600('0x2a')][_0xa600('0x45')]);_0x5435bc[_0xa600('0x34')]=_[_0xa600('0x44')](_0x66142d[_0xa600('0x34')]);_0x5435bc[_0xa600('0x2f')]=_['intersection'](_0x5435bc[_0xa600('0x2d')],_0x5435bc[_0xa600('0x34')]);_0x52f70d['attributes']=_[_0xa600('0x30')](_0x5435bc[_0xa600('0x2d')],qs['fields'](_0x66142d[_0xa600('0x34')][_0xa600('0x32')]));_0x52f70d['attributes']=_0x52f70d[_0xa600('0x31')][_0xa600('0x33')]?_0x52f70d['attributes']:_0x5435bc[_0xa600('0x2d')];if(_0x66142d[_0xa600('0x34')][_0xa600('0x3f')]){_0x52f70d['include']=[{'all':!![]}];}_0x52f70d=_['merge']({},_0x52f70d,_0x66142d['options']);return db[_0xa600('0x2a')]['find'](_0x52f70d)[_0xa600('0x24')](handleEntityNotFound(_0x1f069d,null))['then'](respondWithResult(_0x1f069d,null))[_0xa600('0x46')](handleError(_0x1f069d,null));};exports[_0xa600('0x47')]=function(_0x387d92,_0x14fdbc){return db[_0xa600('0x2a')]['create'](_0x387d92[_0xa600('0x48')],{})[_0xa600('0x24')](respondWithResult(_0x14fdbc,0xc9))['catch'](handleError(_0x14fdbc,null));};exports['update']=function(_0x36f7f4,_0x5ce021){if(_0x36f7f4[_0xa600('0x48')]['id']){delete _0x36f7f4[_0xa600('0x48')]['id'];}return db[_0xa600('0x2a')][_0xa600('0x49')]({'where':{'id':_0x36f7f4[_0xa600('0x43')]['id']}})[_0xa600('0x24')](handleEntityNotFound(_0x5ce021,null))[_0xa600('0x24')](saveUpdates(_0x36f7f4['body'],null))['then'](respondWithResult(_0x5ce021,null))[_0xa600('0x46')](handleError(_0x5ce021,null));};exports[_0xa600('0x25')]=function(_0x3f6f29,_0x307f04){return db[_0xa600('0x2a')][_0xa600('0x49')]({'where':{'id':_0x3f6f29[_0xa600('0x43')]['id']}})[_0xa600('0x24')](handleEntityNotFound(_0x307f04,null))[_0xa600('0x24')](removeEntity(_0x307f04,null))[_0xa600('0x46')](handleError(_0x307f04,null));}; \ No newline at end of file +var _0x62c9=['merge','type','VIRTUAL','options','includeAll','include','ZohoField','findAll','rows','catch','params','keys','create','body','find','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','undefined','limit','count','offset','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter'];(function(_0xbf68fe,_0x35e7ce){var _0x4e2f3e=function(_0x124bd5){while(--_0x124bd5){_0xbf68fe['push'](_0xbf68fe['shift']());}};_0x4e2f3e(++_0x35e7ce);}(_0x62c9,0x133));var _0x962c=function(_0x5cb93e,_0x28f49d){_0x5cb93e=_0x5cb93e-0x0;var _0x108071=_0x62c9[_0x5cb93e];return _0x108071;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x962c('0x0'));var zipdir=require(_0x962c('0x1'));var jsonpatch=require(_0x962c('0x2'));var rp=require(_0x962c('0x3'));var moment=require('moment');var BPromise=require(_0x962c('0x4'));var Mustache=require(_0x962c('0x5'));var util=require(_0x962c('0x6'));var path=require(_0x962c('0x7'));var sox=require(_0x962c('0x8'));var csv=require('to-csv');var ejs=require(_0x962c('0x9'));var fs=require('fs');var fs_extra=require(_0x962c('0xa'));var _=require('lodash');var squel=require(_0x962c('0xb'));var crypto=require(_0x962c('0xc'));var jsforce=require(_0x962c('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x962c('0xe'));var querystring=require(_0x962c('0xf'));var Papa=require(_0x962c('0x10'));var Redis=require('ioredis');var authService=require(_0x962c('0x11'));var qs=require(_0x962c('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x962c('0x13'))(_0x962c('0x14'));var utils=require(_0x962c('0x15'));var config=require(_0x962c('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x962c('0x17'))['db'];function respondWithStatusCode(_0x91b851,_0x186f43){_0x186f43=_0x186f43||0xcc;return function(_0x1042c5){if(_0x1042c5){return _0x91b851['sendStatus'](_0x186f43);}return _0x91b851[_0x962c('0x18')](_0x186f43)['end']();};}function respondWithResult(_0xcd49f1,_0x55560f){_0x55560f=_0x55560f||0xc8;return function(_0x691ca6){if(_0x691ca6){return _0xcd49f1[_0x962c('0x18')](_0x55560f)[_0x962c('0x19')](_0x691ca6);}};}function respondWithFilteredResult(_0x34c66b,_0x15ce32){return function(_0x1c348c){if(_0x1c348c){var _0x34debc=typeof _0x15ce32['offset']===_0x962c('0x1a')&&typeof _0x15ce32[_0x962c('0x1b')]===_0x962c('0x1a');var _0x4bd7e3=_0x1c348c[_0x962c('0x1c')];var _0x2c456a=_0x34debc?0x0:_0x15ce32[_0x962c('0x1d')];var _0x222844=_0x34debc?_0x1c348c[_0x962c('0x1c')]:_0x15ce32[_0x962c('0x1d')]+_0x15ce32[_0x962c('0x1b')];var _0x3c30b1;if(_0x222844>=_0x4bd7e3){_0x222844=_0x4bd7e3;_0x3c30b1=0xc8;}else{_0x3c30b1=0xce;}_0x34c66b[_0x962c('0x18')](_0x3c30b1);return _0x34c66b[_0x962c('0x1e')]('Content-Range',_0x2c456a+'-'+_0x222844+'/'+_0x4bd7e3)[_0x962c('0x19')](_0x1c348c);}return null;};}function patchUpdates(_0x4d1077){return function(_0x1c357e){try{jsonpatch[_0x962c('0x1f')](_0x1c357e,_0x4d1077,!![]);}catch(_0x5659d1){return BPromise[_0x962c('0x20')](_0x5659d1);}return _0x1c357e[_0x962c('0x21')]();};}function saveUpdates(_0x214dea,_0x1468c8){return function(_0x28de96){if(_0x28de96){return _0x28de96[_0x962c('0x22')](_0x214dea)[_0x962c('0x23')](function(_0x2ab590){return _0x2ab590;});}return null;};}function removeEntity(_0x1d5feb,_0x2a3517){return function(_0x5ed178){if(_0x5ed178){return _0x5ed178[_0x962c('0x24')]()[_0x962c('0x23')](function(){_0x1d5feb[_0x962c('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2bc1d2,_0x6ccede){return function(_0x36e4a4){if(!_0x36e4a4){_0x2bc1d2['sendStatus'](0x194);}return _0x36e4a4;};}function handleError(_0x27f100,_0x5d06c9){_0x5d06c9=_0x5d06c9||0x1f4;return function(_0x214826){logger[_0x962c('0x25')](_0x214826[_0x962c('0x26')]);if(_0x214826['name']){delete _0x214826[_0x962c('0x27')];}_0x27f100['status'](_0x5d06c9)[_0x962c('0x28')](_0x214826);};}exports[_0x962c('0x29')]=function(_0x4c4c2b,_0x4cc28e){var _0x483b52={},_0x2d218b={},_0x49aff0={'count':0x0,'rows':[]};var _0x4117bd=_[_0x962c('0x2a')](db['ZohoField'][_0x962c('0x2b')],function(_0xa85485){return{'name':_0xa85485['fieldName'],'type':_0xa85485['type'][_0x962c('0x2c')]};});_0x2d218b['model']=_[_0x962c('0x2a')](_0x4117bd,_0x962c('0x27'));_0x2d218b[_0x962c('0x2d')]=_['keys'](_0x4c4c2b[_0x962c('0x2d')]);_0x2d218b[_0x962c('0x2e')]=_[_0x962c('0x2f')](_0x2d218b[_0x962c('0x30')],_0x2d218b[_0x962c('0x2d')]);_0x483b52[_0x962c('0x31')]=_[_0x962c('0x2f')](_0x2d218b[_0x962c('0x30')],qs[_0x962c('0x32')](_0x4c4c2b['query']['fields']));_0x483b52[_0x962c('0x31')]=_0x483b52[_0x962c('0x31')][_0x962c('0x33')]?_0x483b52[_0x962c('0x31')]:_0x2d218b[_0x962c('0x30')];if(!_0x4c4c2b[_0x962c('0x2d')][_0x962c('0x34')]('nolimit')){_0x483b52[_0x962c('0x1b')]=qs[_0x962c('0x1b')](_0x4c4c2b[_0x962c('0x2d')][_0x962c('0x1b')]);_0x483b52[_0x962c('0x1d')]=qs[_0x962c('0x1d')](_0x4c4c2b[_0x962c('0x2d')][_0x962c('0x1d')]);}_0x483b52[_0x962c('0x35')]=qs[_0x962c('0x36')](_0x4c4c2b[_0x962c('0x2d')][_0x962c('0x36')]);_0x483b52[_0x962c('0x37')]=qs[_0x962c('0x2e')](_[_0x962c('0x38')](_0x4c4c2b['query'],_0x2d218b['filters']),_0x4117bd);if(_0x4c4c2b[_0x962c('0x2d')][_0x962c('0x39')]){_0x483b52[_0x962c('0x37')]=_[_0x962c('0x3a')](_0x483b52[_0x962c('0x37')],{'$or':_['map'](_0x4117bd,function(_0x412b09){if(_0x412b09[_0x962c('0x3b')]!==_0x962c('0x3c')){var _0x1f633e={};_0x1f633e[_0x412b09[_0x962c('0x27')]]={'$like':'%'+_0x4c4c2b[_0x962c('0x2d')][_0x962c('0x39')]+'%'};return _0x1f633e;}})});}_0x483b52=_[_0x962c('0x3a')]({},_0x483b52,_0x4c4c2b[_0x962c('0x3d')]);var _0x512253={'where':_0x483b52[_0x962c('0x37')]};return db['ZohoField'][_0x962c('0x1c')](_0x512253)[_0x962c('0x23')](function(_0x37f63f){_0x49aff0[_0x962c('0x1c')]=_0x37f63f;if(_0x4c4c2b[_0x962c('0x2d')][_0x962c('0x3e')]){_0x483b52[_0x962c('0x3f')]=[{'all':!![]}];}return db[_0x962c('0x40')][_0x962c('0x41')](_0x483b52);})[_0x962c('0x23')](function(_0x314597){_0x49aff0[_0x962c('0x42')]=_0x314597;return _0x49aff0;})[_0x962c('0x23')](respondWithFilteredResult(_0x4cc28e,_0x483b52))[_0x962c('0x43')](handleError(_0x4cc28e,null));};exports['show']=function(_0x3a797b,_0x594576){var _0x48a0db={'raw':!![],'where':{'id':_0x3a797b[_0x962c('0x44')]['id']}},_0x241f56={};_0x241f56[_0x962c('0x30')]=_[_0x962c('0x45')](db[_0x962c('0x40')][_0x962c('0x2b')]);_0x241f56[_0x962c('0x2d')]=_[_0x962c('0x45')](_0x3a797b[_0x962c('0x2d')]);_0x241f56['filters']=_['intersection'](_0x241f56[_0x962c('0x30')],_0x241f56[_0x962c('0x2d')]);_0x48a0db[_0x962c('0x31')]=_[_0x962c('0x2f')](_0x241f56[_0x962c('0x30')],qs['fields'](_0x3a797b[_0x962c('0x2d')][_0x962c('0x32')]));_0x48a0db[_0x962c('0x31')]=_0x48a0db['attributes'][_0x962c('0x33')]?_0x48a0db[_0x962c('0x31')]:_0x241f56[_0x962c('0x30')];if(_0x3a797b['query'][_0x962c('0x3e')]){_0x48a0db['include']=[{'all':!![]}];}_0x48a0db=_[_0x962c('0x3a')]({},_0x48a0db,_0x3a797b[_0x962c('0x3d')]);return db[_0x962c('0x40')]['find'](_0x48a0db)[_0x962c('0x23')](handleEntityNotFound(_0x594576,null))[_0x962c('0x23')](respondWithResult(_0x594576,null))[_0x962c('0x43')](handleError(_0x594576,null));};exports[_0x962c('0x46')]=function(_0x5846bd,_0x2cfa59){return db[_0x962c('0x40')][_0x962c('0x46')](_0x5846bd[_0x962c('0x47')],{})['then'](respondWithResult(_0x2cfa59,0xc9))[_0x962c('0x43')](handleError(_0x2cfa59,null));};exports['update']=function(_0x2291ca,_0x480cc2){if(_0x2291ca[_0x962c('0x47')]['id']){delete _0x2291ca[_0x962c('0x47')]['id'];}return db[_0x962c('0x40')][_0x962c('0x48')]({'where':{'id':_0x2291ca['params']['id']}})[_0x962c('0x23')](handleEntityNotFound(_0x480cc2,null))['then'](saveUpdates(_0x2291ca[_0x962c('0x47')],null))[_0x962c('0x23')](respondWithResult(_0x480cc2,null))['catch'](handleError(_0x480cc2,null));};exports[_0x962c('0x24')]=function(_0x24f256,_0x3a1a15){return db['ZohoField'][_0x962c('0x48')]({'where':{'id':_0x24f256[_0x962c('0x44')]['id']}})['then'](handleEntityNotFound(_0x3a1a15,null))[_0x962c('0x23')](removeEntity(_0x3a1a15,null))[_0x962c('0x43')](handleError(_0x3a1a15,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 5600a79..940bc34 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 _0x187d=['moment','bluebird','request-promise','path','../../config/environment','./intZohoField.attributes','define','ZohoField','int_zoho_fields','zoho_unique_index','idField','FieldId','lodash','../../config/logger','api'];(function(_0x5f05d6,_0x186116){var _0x1e2e95=function(_0x420092){while(--_0x420092){_0x5f05d6['push'](_0x5f05d6['shift']());}};_0x1e2e95(++_0x186116);}(_0x187d,0x93));var _0xd187=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0x187d[_0x3b5250];return _0xc844a1;};'use strict';var _=require(_0xd187('0x0'));var util=require('util');var logger=require(_0xd187('0x1'))(_0xd187('0x2'));var moment=require(_0xd187('0x3'));var BPromise=require(_0xd187('0x4'));var rp=require(_0xd187('0x5'));var fs=require('fs');var path=require(_0xd187('0x6'));var rimraf=require('rimraf');var config=require(_0xd187('0x7'));var attributes=require(_0xd187('0x8'));module['exports']=function(_0x1d2533,_0x58ee7){return _0x1d2533[_0xd187('0x9')](_0xd187('0xa'),attributes,{'tableName':_0xd187('0xb'),'paranoid':![],'indexes':[{'name':_0xd187('0xc'),'fields':[_0xd187('0xd'),_0xd187('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7046=['lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./intZohoField.attributes','exports','ZohoField','idField'];(function(_0x16dfae,_0x27dfcd){var _0x4dbda6=function(_0x1e551c){while(--_0x1e551c){_0x16dfae['push'](_0x16dfae['shift']());}};_0x4dbda6(++_0x27dfcd);}(_0x7046,0x144));var _0x6704=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x7046[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0x6704('0x0'));var util=require(_0x6704('0x1'));var logger=require(_0x6704('0x2'))(_0x6704('0x3'));var moment=require('moment');var BPromise=require(_0x6704('0x4'));var rp=require(_0x6704('0x5'));var fs=require('fs');var path=require(_0x6704('0x6'));var rimraf=require('rimraf');var config=require(_0x6704('0x7'));var attributes=require(_0x6704('0x8'));module[_0x6704('0x9')]=function(_0x626a14,_0x2917be){return _0x626a14['define'](_0x6704('0xa'),attributes,{'tableName':'int_zoho_fields','paranoid':![],'indexes':[{'name':'zoho_unique_index','fields':[_0x6704('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 25fc6bb..19f3620 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 _0xfbb7=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','ZohoField,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','ZohoField,\x20%s,\x20%s','message','result','catch','util','moment','randomstring','ioredis'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xfbb7,0x14c));var _0x7fbb=function(_0x318595,_0x5e35cd){_0x318595=_0x318595-0x0;var _0x33483b=_0xfbb7[_0x318595];return _0x33483b;};'use strict';var _=require('lodash');var util=require(_0x7fbb('0x0'));var moment=require(_0x7fbb('0x1'));var BPromise=require('bluebird');var rs=require(_0x7fbb('0x2'));var fs=require('fs');var Redis=require(_0x7fbb('0x3'));var db=require(_0x7fbb('0x4'))['db'];var utils=require(_0x7fbb('0x5'));var logger=require(_0x7fbb('0x6'))(_0x7fbb('0x7'));var config=require(_0x7fbb('0x8'));var jayson=require(_0x7fbb('0x9'));var client=jayson[_0x7fbb('0xa')][_0x7fbb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x44ce90,_0x4e6a68,_0x918528){return new BPromise(function(_0x2e78bf,_0x48bbf2){return client[_0x7fbb('0xc')](_0x44ce90,_0x918528)[_0x7fbb('0xd')](function(_0x540cbc){logger[_0x7fbb('0xe')]('ZohoField,\x20%s,\x20%s',_0x4e6a68,'request\x20sent');logger[_0x7fbb('0xf')](_0x7fbb('0x10'),_0x4e6a68,_0x7fbb('0x11'),JSON['stringify'](_0x540cbc));if(_0x540cbc[_0x7fbb('0x12')]){if(_0x540cbc[_0x7fbb('0x12')][_0x7fbb('0x13')]===0x1f4){logger[_0x7fbb('0x12')](_0x7fbb('0x14'),_0x4e6a68,_0x540cbc[_0x7fbb('0x12')][_0x7fbb('0x15')]);return _0x48bbf2(_0x540cbc[_0x7fbb('0x12')][_0x7fbb('0x15')]);}logger['error'](_0x7fbb('0x14'),_0x4e6a68,_0x540cbc[_0x7fbb('0x12')][_0x7fbb('0x15')]);return _0x2e78bf(_0x540cbc[_0x7fbb('0x12')][_0x7fbb('0x15')]);}else{logger[_0x7fbb('0xe')](_0x7fbb('0x14'),_0x4e6a68,_0x7fbb('0x11'));_0x2e78bf(_0x540cbc[_0x7fbb('0x16')]['message']);}})[_0x7fbb('0x17')](function(_0x441ac9){logger['error']('ZohoField,\x20%s,\x20%s',_0x4e6a68,_0x441ac9);_0x48bbf2(_0x441ac9);});});} \ No newline at end of file +var _0x6b07=['request','then','info','ZohoField,\x20%s,\x20%s','debug','ZohoField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x37b4af,_0x43c63b){var _0x30043a=function(_0x3b926c){while(--_0x3b926c){_0x37b4af['push'](_0x37b4af['shift']());}};_0x30043a(++_0x43c63b);}(_0x6b07,0x1f0));var _0x76b0=function(_0x342e2c,_0x25c0d6){_0x342e2c=_0x342e2c-0x0;var _0x38e0ef=_0x6b07[_0x342e2c];return _0x38e0ef;};'use strict';var _=require(_0x76b0('0x0'));var util=require(_0x76b0('0x1'));var moment=require(_0x76b0('0x2'));var BPromise=require(_0x76b0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x76b0('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x76b0('0x5'))(_0x76b0('0x6'));var config=require(_0x76b0('0x7'));var jayson=require(_0x76b0('0x8'));var client=jayson[_0x76b0('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4632e9,_0x5bedbc,_0x298542){return new BPromise(function(_0x4dafa8,_0x2d726e){return client[_0x76b0('0xa')](_0x4632e9,_0x298542)[_0x76b0('0xb')](function(_0x3ebf2c){logger[_0x76b0('0xc')](_0x76b0('0xd'),_0x5bedbc,'request\x20sent');logger[_0x76b0('0xe')](_0x76b0('0xf'),_0x5bedbc,_0x76b0('0x10'),JSON[_0x76b0('0x11')](_0x3ebf2c));if(_0x3ebf2c['error']){if(_0x3ebf2c[_0x76b0('0x12')][_0x76b0('0x13')]===0x1f4){logger[_0x76b0('0x12')](_0x76b0('0xd'),_0x5bedbc,_0x3ebf2c[_0x76b0('0x12')][_0x76b0('0x14')]);return _0x2d726e(_0x3ebf2c[_0x76b0('0x12')]['message']);}logger[_0x76b0('0x12')](_0x76b0('0xd'),_0x5bedbc,_0x3ebf2c['error'][_0x76b0('0x14')]);return _0x4dafa8(_0x3ebf2c[_0x76b0('0x12')][_0x76b0('0x14')]);}else{logger[_0x76b0('0xc')](_0x76b0('0xd'),_0x5bedbc,_0x76b0('0x10'));_0x4dafa8(_0x3ebf2c['result'][_0x76b0('0x14')]);}})[_0x76b0('0x15')](function(_0x54aec3){logger['error'](_0x76b0('0xd'),_0x5bedbc,_0x54aec3);_0x2d726e(_0x54aec3);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 92b775c..3603a4d 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x1fe598,_0x18e12c){var _0x5a8b67=function(_0x2d4113){while(--_0x2d4113){_0x1fe598['push'](_0x1fe598['shift']());}};_0x5a8b67(++_0x18e12c);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x57474e,_0x4178b8){_0x57474e=_0x57474e-0x0;var _0xfaae8c=_0xcb91[_0x57474e];return _0xfaae8c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x2ac043,_0x2db262){var _0x3a905f=function(_0x203983){while(--_0x203983){_0x2ac043['push'](_0x2ac043['shift']());}};_0x3a905f(++_0x2db262);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index ba334f4..2dc5833 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 _0x8bf7=['state','sequelize','exports','STRING','unique_name_and_version','app.js','INTEGER','BOOLEAN'];(function(_0xf84870,_0x4dc38f){var _0x4541a4=function(_0x3ff5d5){while(--_0x3ff5d5){_0xf84870['push'](_0xf84870['shift']());}};_0x4541a4(++_0x4dc38f);}(_0x8bf7,0x139));var _0x78bf=function(_0x34b4e5,_0x49e2e2){_0x34b4e5=_0x34b4e5-0x0;var _0x39ca70=_0x8bf7[_0x34b4e5];return _0x39ca70;};'use strict';var Sequelize=require(_0x78bf('0x0'));module[_0x78bf('0x1')]={'name':{'type':Sequelize[_0x78bf('0x2')],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize[_0x78bf('0x2')],'allowNull':![],'unique':_0x78bf('0x3')},'main':{'type':Sequelize[_0x78bf('0x2')],'defaultValue':_0x78bf('0x4')},'filename':{'type':Sequelize[_0x78bf('0x2')]},'path':{'type':Sequelize[_0x78bf('0x2')]},'type':{'type':Sequelize[_0x78bf('0x2')]},'size':{'type':Sequelize[_0x78bf('0x5')]},'active':{'type':Sequelize[_0x78bf('0x6')],'defaultValue':![]},'author':{'type':Sequelize[_0x78bf('0x2')]},'logo':{'type':Sequelize[_0x78bf('0x2')]},'state':{'type':Sequelize[_0x78bf('0x2')],'unique':_0x78bf('0x7')},'description':{'type':Sequelize[_0x78bf('0x2')]},'title':{'type':Sequelize[_0x78bf('0x2')]},'remoteUri':{'type':Sequelize[_0x78bf('0x2')]},'link':{'type':Sequelize[_0x78bf('0x2')],'defaultValue':'#'}}; \ No newline at end of file +var _0x4e0a=['exports','STRING','unique_name_and_version','app.js','INTEGER','BOOLEAN','state','sequelize'];(function(_0x388c38,_0x1aa19d){var _0x5c126e=function(_0x10b9cb){while(--_0x10b9cb){_0x388c38['push'](_0x388c38['shift']());}};_0x5c126e(++_0x1aa19d);}(_0x4e0a,0x127));var _0xa4e0=function(_0x316904,_0x1e8b77){_0x316904=_0x316904-0x0;var _0xfa9a21=_0x4e0a[_0x316904];return _0xfa9a21;};'use strict';var Sequelize=require(_0xa4e0('0x0'));module[_0xa4e0('0x1')]={'name':{'type':Sequelize[_0xa4e0('0x2')],'allowNull':![],'unique':_0xa4e0('0x3')},'version':{'type':Sequelize[_0xa4e0('0x2')],'allowNull':![],'unique':_0xa4e0('0x3')},'main':{'type':Sequelize[_0xa4e0('0x2')],'defaultValue':_0xa4e0('0x4')},'filename':{'type':Sequelize['STRING']},'path':{'type':Sequelize[_0xa4e0('0x2')]},'type':{'type':Sequelize[_0xa4e0('0x2')]},'size':{'type':Sequelize[_0xa4e0('0x5')]},'active':{'type':Sequelize[_0xa4e0('0x6')],'defaultValue':![]},'author':{'type':Sequelize[_0xa4e0('0x2')]},'logo':{'type':Sequelize[_0xa4e0('0x2')]},'state':{'type':Sequelize[_0xa4e0('0x2')],'unique':_0xa4e0('0x7')},'description':{'type':Sequelize[_0xa4e0('0x2')]},'title':{'type':Sequelize[_0xa4e0('0x2')]},'remoteUri':{'type':Sequelize[_0xa4e0('0x2')]},'link':{'type':Sequelize[_0xa4e0('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 ec67783..86fcc9c 100644 --- a/server/api/integration/integration.controller.js +++ b/server/api/integration/integration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xafc4=['reject','save','update','destroy','then','stack','name','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','map','VIRTUAL','options','Integration','includeAll','catch','show','params','create','body','find','eml-format','zip-dir','request-promise','moment','bluebird','mustache','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply'];(function(_0x407e14,_0x4e7c01){var _0x64e932=function(_0x1e8ff6){while(--_0x1e8ff6){_0x407e14['push'](_0x407e14['shift']());}};_0x64e932(++_0x4e7c01);}(_0xafc4,0x69));var _0x4afc=function(_0x3d89f9,_0x43aec9){_0x3d89f9=_0x3d89f9-0x0;var _0x2ffbd9=_0xafc4[_0x3d89f9];return _0x2ffbd9;};'use strict';var emlformat=require(_0x4afc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4afc('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4afc('0x2'));var moment=require(_0x4afc('0x3'));var BPromise=require(_0x4afc('0x4'));var Mustache=require(_0x4afc('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x4afc('0x6'));var ejs=require(_0x4afc('0x7'));var fs=require('fs');var fs_extra=require(_0x4afc('0x8'));var _=require(_0x4afc('0x9'));var squel=require(_0x4afc('0xa'));var crypto=require(_0x4afc('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x4afc('0xc'));var toCsv=require(_0x4afc('0x6'));var querystring=require(_0x4afc('0xd'));var Papa=require(_0x4afc('0xe'));var Redis=require(_0x4afc('0xf'));var authService=require(_0x4afc('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4afc('0x11'));var logger=require('../../config/logger')(_0x4afc('0x12'));var utils=require(_0x4afc('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x4afc('0x14'));var db=require(_0x4afc('0x15'))['db'];function respondWithStatusCode(_0x2b191c,_0x2768bf){_0x2768bf=_0x2768bf||0xcc;return function(_0x1d8f98){if(_0x1d8f98){return _0x2b191c[_0x4afc('0x16')](_0x2768bf);}return _0x2b191c[_0x4afc('0x17')](_0x2768bf)[_0x4afc('0x18')]();};}function respondWithResult(_0x5effb4,_0x26f3f1){_0x26f3f1=_0x26f3f1||0xc8;return function(_0x429fd8){if(_0x429fd8){return _0x5effb4[_0x4afc('0x17')](_0x26f3f1)[_0x4afc('0x19')](_0x429fd8);}};}function respondWithFilteredResult(_0x5f2dc9,_0x4e32e8){return function(_0x2452ae){if(_0x2452ae){var _0x4f3127=typeof _0x4e32e8[_0x4afc('0x1a')]===_0x4afc('0x1b')&&typeof _0x4e32e8[_0x4afc('0x1c')]===_0x4afc('0x1b');var _0x3a306f=_0x2452ae[_0x4afc('0x1d')];var _0x22f809=_0x4f3127?0x0:_0x4e32e8[_0x4afc('0x1a')];var _0x16365f=_0x4f3127?_0x2452ae[_0x4afc('0x1d')]:_0x4e32e8[_0x4afc('0x1a')]+_0x4e32e8['limit'];var _0x1a8f49;if(_0x16365f>=_0x3a306f){_0x16365f=_0x3a306f;_0x1a8f49=0xc8;}else{_0x1a8f49=0xce;}_0x5f2dc9[_0x4afc('0x17')](_0x1a8f49);return _0x5f2dc9[_0x4afc('0x1e')](_0x4afc('0x1f'),_0x22f809+'-'+_0x16365f+'/'+_0x3a306f)['json'](_0x2452ae);}return null;};}function patchUpdates(_0x3bddc0){return function(_0x30eda3){try{jsonpatch[_0x4afc('0x20')](_0x30eda3,_0x3bddc0,!![]);}catch(_0x280587){return BPromise[_0x4afc('0x21')](_0x280587);}return _0x30eda3[_0x4afc('0x22')]();};}function saveUpdates(_0x3ad7a5,_0x573a75){return function(_0x5403e4){if(_0x5403e4){return _0x5403e4[_0x4afc('0x23')](_0x3ad7a5)['then'](function(_0x37debf){return _0x37debf;});}return null;};}function removeEntity(_0x4e9a48,_0x1aa676){return function(_0x2a0314){if(_0x2a0314){return _0x2a0314[_0x4afc('0x24')]()[_0x4afc('0x25')](function(){_0x4e9a48[_0x4afc('0x17')](0xcc)[_0x4afc('0x18')]();});}};}function handleEntityNotFound(_0x40a0db,_0x383a71){return function(_0x2bb837){if(!_0x2bb837){_0x40a0db[_0x4afc('0x16')](0x194);}return _0x2bb837;};}function handleError(_0x4e8273,_0x359c07){_0x359c07=_0x359c07||0x1f4;return function(_0x35f5b3){logger['error'](_0x35f5b3[_0x4afc('0x26')]);if(_0x35f5b3[_0x4afc('0x27')]){delete _0x35f5b3[_0x4afc('0x27')];}_0x4e8273['status'](_0x359c07)['send'](_0x35f5b3);};}exports['index']=function(_0x426e9d,_0x5db47e){var _0x5e4747={},_0xd26d2f={},_0x628e42={'count':0x0,'rows':[]};var _0x494fe7=_['map'](db['Integration'][_0x4afc('0x28')],function(_0x34434a){return{'name':_0x34434a[_0x4afc('0x29')],'type':_0x34434a[_0x4afc('0x2a')][_0x4afc('0x2b')]};});_0xd26d2f[_0x4afc('0x2c')]=_['map'](_0x494fe7,_0x4afc('0x27'));_0xd26d2f[_0x4afc('0x2d')]=_[_0x4afc('0x2e')](_0x426e9d[_0x4afc('0x2d')]);_0xd26d2f[_0x4afc('0x2f')]=_[_0x4afc('0x30')](_0xd26d2f[_0x4afc('0x2c')],_0xd26d2f[_0x4afc('0x2d')]);_0x5e4747['attributes']=_[_0x4afc('0x30')](_0xd26d2f['model'],qs['fields'](_0x426e9d[_0x4afc('0x2d')][_0x4afc('0x31')]));_0x5e4747[_0x4afc('0x32')]=_0x5e4747[_0x4afc('0x32')][_0x4afc('0x33')]?_0x5e4747[_0x4afc('0x32')]:_0xd26d2f['model'];if(!_0x426e9d[_0x4afc('0x2d')][_0x4afc('0x34')](_0x4afc('0x35'))){_0x5e4747[_0x4afc('0x1c')]=qs[_0x4afc('0x1c')](_0x426e9d[_0x4afc('0x2d')]['limit']);_0x5e4747[_0x4afc('0x1a')]=qs[_0x4afc('0x1a')](_0x426e9d[_0x4afc('0x2d')][_0x4afc('0x1a')]);}_0x5e4747['order']=qs['sort'](_0x426e9d[_0x4afc('0x2d')][_0x4afc('0x36')]);_0x5e4747[_0x4afc('0x37')]=qs['filters'](_['pick'](_0x426e9d[_0x4afc('0x2d')],_0xd26d2f['filters']),_0x494fe7);if(_0x426e9d['query'][_0x4afc('0x38')]){_0x5e4747[_0x4afc('0x37')]=_[_0x4afc('0x39')](_0x5e4747[_0x4afc('0x37')],{'$or':_[_0x4afc('0x3a')](_0x494fe7,function(_0x4420fb){if(_0x4420fb[_0x4afc('0x2a')]!==_0x4afc('0x3b')){var _0x3ccc5a={};_0x3ccc5a[_0x4420fb[_0x4afc('0x27')]]={'$like':'%'+_0x426e9d[_0x4afc('0x2d')][_0x4afc('0x38')]+'%'};return _0x3ccc5a;}})});}_0x5e4747=_[_0x4afc('0x39')]({},_0x5e4747,_0x426e9d[_0x4afc('0x3c')]);var _0x46dd2a={'where':_0x5e4747['where']};return db[_0x4afc('0x3d')][_0x4afc('0x1d')](_0x46dd2a)[_0x4afc('0x25')](function(_0xe6db12){_0x628e42[_0x4afc('0x1d')]=_0xe6db12;if(_0x426e9d[_0x4afc('0x2d')][_0x4afc('0x3e')]){_0x5e4747['include']=[{'all':!![]}];}return db['Integration']['findAll'](_0x5e4747);})[_0x4afc('0x25')](function(_0x105c03){_0x628e42['rows']=_0x105c03;return _0x628e42;})[_0x4afc('0x25')](respondWithFilteredResult(_0x5db47e,_0x5e4747))[_0x4afc('0x3f')](handleError(_0x5db47e,null));};exports[_0x4afc('0x40')]=function(_0x397996,_0x545109){var _0x12b5db={'raw':![],'where':{'id':_0x397996[_0x4afc('0x41')]['id']}},_0x45c9c3={};_0x45c9c3[_0x4afc('0x2c')]=_[_0x4afc('0x2e')](db[_0x4afc('0x3d')]['rawAttributes']);_0x45c9c3[_0x4afc('0x2d')]=_['keys'](_0x397996[_0x4afc('0x2d')]);_0x45c9c3[_0x4afc('0x2f')]=_[_0x4afc('0x30')](_0x45c9c3['model'],_0x45c9c3['query']);_0x12b5db[_0x4afc('0x32')]=_[_0x4afc('0x30')](_0x45c9c3[_0x4afc('0x2c')],qs[_0x4afc('0x31')](_0x397996[_0x4afc('0x2d')][_0x4afc('0x31')]));_0x12b5db[_0x4afc('0x32')]=_0x12b5db[_0x4afc('0x32')]['length']?_0x12b5db[_0x4afc('0x32')]:_0x45c9c3[_0x4afc('0x2c')];if(_0x397996['query'][_0x4afc('0x3e')]){_0x12b5db['include']=[{'all':!![]}];}_0x12b5db=_[_0x4afc('0x39')]({},_0x12b5db,_0x397996[_0x4afc('0x3c')]);return db[_0x4afc('0x3d')]['find'](_0x12b5db)[_0x4afc('0x25')](handleEntityNotFound(_0x545109,null))[_0x4afc('0x25')](respondWithResult(_0x545109,null))[_0x4afc('0x3f')](handleError(_0x545109,null));};exports[_0x4afc('0x42')]=function(_0x4772db,_0x19a0ac){return db['Integration']['create'](_0x4772db['body'],{})[_0x4afc('0x25')](respondWithResult(_0x19a0ac,0xc9))[_0x4afc('0x3f')](handleError(_0x19a0ac,null));};exports[_0x4afc('0x23')]=function(_0x269c24,_0xb5cca9){if(_0x269c24[_0x4afc('0x43')]['id']){delete _0x269c24[_0x4afc('0x43')]['id'];}return db[_0x4afc('0x3d')][_0x4afc('0x44')]({'where':{'id':_0x269c24[_0x4afc('0x41')]['id']}})['then'](handleEntityNotFound(_0xb5cca9,null))[_0x4afc('0x25')](saveUpdates(_0x269c24['body'],null))['then'](respondWithResult(_0xb5cca9,null))[_0x4afc('0x3f')](handleError(_0xb5cca9,null));};exports['destroy']=function(_0x428d78,_0x355198){return db[_0x4afc('0x3d')][_0x4afc('0x44')]({'where':{'id':_0x428d78['params']['id']}})[_0x4afc('0x25')](handleEntityNotFound(_0x355198,null))['then'](removeEntity(_0x355198,null))[_0x4afc('0x3f')](handleError(_0x355198,null));}; \ No newline at end of file +var _0x4c60=['api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','then','destroy','end','error','stack','name','index','map','Integration','rawAttributes','key','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','rows','catch','show','includeAll','find','create','update','body','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/logger'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x4c60,0xc1));var _0x04c6=function(_0x55c2f3,_0x5110d2){_0x55c2f3=_0x55c2f3-0x0;var _0x2359e2=_0x4c60[_0x55c2f3];return _0x2359e2;};'use strict';var emlformat=require(_0x04c6('0x0'));var rimraf=require(_0x04c6('0x1'));var zipdir=require(_0x04c6('0x2'));var jsonpatch=require(_0x04c6('0x3'));var rp=require('request-promise');var moment=require(_0x04c6('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x04c6('0x5'));var csv=require(_0x04c6('0x6'));var ejs=require(_0x04c6('0x7'));var fs=require('fs');var fs_extra=require(_0x04c6('0x8'));var _=require(_0x04c6('0x9'));var squel=require(_0x04c6('0xa'));var crypto=require(_0x04c6('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x04c6('0xc'));var toCsv=require(_0x04c6('0x6'));var querystring=require(_0x04c6('0xd'));var Papa=require(_0x04c6('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x04c6('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x04c6('0x10'))(_0x04c6('0x11'));var utils=require('../../config/utils');var config=require(_0x04c6('0x12'));var licenseUtil=require(_0x04c6('0x13'));var db=require(_0x04c6('0x14'))['db'];function respondWithStatusCode(_0x4e5e6,_0x52cdcf){_0x52cdcf=_0x52cdcf||0xcc;return function(_0x257a0a){if(_0x257a0a){return _0x4e5e6[_0x04c6('0x15')](_0x52cdcf);}return _0x4e5e6[_0x04c6('0x16')](_0x52cdcf)['end']();};}function respondWithResult(_0x12d1c5,_0x15cbe0){_0x15cbe0=_0x15cbe0||0xc8;return function(_0x28632e){if(_0x28632e){return _0x12d1c5[_0x04c6('0x16')](_0x15cbe0)[_0x04c6('0x17')](_0x28632e);}};}function respondWithFilteredResult(_0x19a26f,_0x1cd963){return function(_0x3d46a9){if(_0x3d46a9){var _0x5a5a66=typeof _0x1cd963[_0x04c6('0x18')]===_0x04c6('0x19')&&typeof _0x1cd963[_0x04c6('0x1a')]===_0x04c6('0x19');var _0x43596a=_0x3d46a9[_0x04c6('0x1b')];var _0x21674a=_0x5a5a66?0x0:_0x1cd963[_0x04c6('0x18')];var _0x47f400=_0x5a5a66?_0x3d46a9[_0x04c6('0x1b')]:_0x1cd963[_0x04c6('0x18')]+_0x1cd963[_0x04c6('0x1a')];var _0x558b43;if(_0x47f400>=_0x43596a){_0x47f400=_0x43596a;_0x558b43=0xc8;}else{_0x558b43=0xce;}_0x19a26f['status'](_0x558b43);return _0x19a26f['set'](_0x04c6('0x1c'),_0x21674a+'-'+_0x47f400+'/'+_0x43596a)[_0x04c6('0x17')](_0x3d46a9);}return null;};}function patchUpdates(_0x50dd61){return function(_0x5a5e9e){try{jsonpatch[_0x04c6('0x1d')](_0x5a5e9e,_0x50dd61,!![]);}catch(_0x2eed94){return BPromise[_0x04c6('0x1e')](_0x2eed94);}return _0x5a5e9e['save']();};}function saveUpdates(_0x33a0f7,_0x13f2dc){return function(_0x9d41f8){if(_0x9d41f8){return _0x9d41f8['update'](_0x33a0f7)[_0x04c6('0x1f')](function(_0x41e29f){return _0x41e29f;});}return null;};}function removeEntity(_0x562491,_0x54a8b0){return function(_0x4c8d72){if(_0x4c8d72){return _0x4c8d72[_0x04c6('0x20')]()[_0x04c6('0x1f')](function(){_0x562491[_0x04c6('0x16')](0xcc)[_0x04c6('0x21')]();});}};}function handleEntityNotFound(_0x3e1328,_0x52e5f5){return function(_0x562952){if(!_0x562952){_0x3e1328[_0x04c6('0x15')](0x194);}return _0x562952;};}function handleError(_0x2ab1d2,_0x9acfa){_0x9acfa=_0x9acfa||0x1f4;return function(_0x3233d7){logger[_0x04c6('0x22')](_0x3233d7[_0x04c6('0x23')]);if(_0x3233d7['name']){delete _0x3233d7[_0x04c6('0x24')];}_0x2ab1d2[_0x04c6('0x16')](_0x9acfa)['send'](_0x3233d7);};}exports[_0x04c6('0x25')]=function(_0x1cd16a,_0x5f1331){var _0x5c9003={},_0x115d84={},_0x3a6d92={'count':0x0,'rows':[]};var _0x2a191f=_[_0x04c6('0x26')](db[_0x04c6('0x27')][_0x04c6('0x28')],function(_0x49c4ed){return{'name':_0x49c4ed['fieldName'],'type':_0x49c4ed['type'][_0x04c6('0x29')]};});_0x115d84['model']=_[_0x04c6('0x26')](_0x2a191f,_0x04c6('0x24'));_0x115d84['query']=_[_0x04c6('0x2a')](_0x1cd16a[_0x04c6('0x2b')]);_0x115d84[_0x04c6('0x2c')]=_[_0x04c6('0x2d')](_0x115d84['model'],_0x115d84[_0x04c6('0x2b')]);_0x5c9003[_0x04c6('0x2e')]=_[_0x04c6('0x2d')](_0x115d84[_0x04c6('0x2f')],qs[_0x04c6('0x30')](_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x30')]));_0x5c9003[_0x04c6('0x2e')]=_0x5c9003[_0x04c6('0x2e')][_0x04c6('0x31')]?_0x5c9003[_0x04c6('0x2e')]:_0x115d84[_0x04c6('0x2f')];if(!_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x32')](_0x04c6('0x33'))){_0x5c9003['limit']=qs[_0x04c6('0x1a')](_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x1a')]);_0x5c9003[_0x04c6('0x18')]=qs['offset'](_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x18')]);}_0x5c9003['order']=qs['sort'](_0x1cd16a['query'][_0x04c6('0x34')]);_0x5c9003[_0x04c6('0x35')]=qs['filters'](_[_0x04c6('0x36')](_0x1cd16a['query'],_0x115d84[_0x04c6('0x2c')]),_0x2a191f);if(_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x37')]){_0x5c9003[_0x04c6('0x35')]=_['merge'](_0x5c9003['where'],{'$or':_[_0x04c6('0x26')](_0x2a191f,function(_0x3a9a3b){if(_0x3a9a3b['type']!==_0x04c6('0x38')){var _0x5ce4b0={};_0x5ce4b0[_0x3a9a3b['name']]={'$like':'%'+_0x1cd16a[_0x04c6('0x2b')]['filter']+'%'};return _0x5ce4b0;}})});}_0x5c9003=_[_0x04c6('0x39')]({},_0x5c9003,_0x1cd16a[_0x04c6('0x3a')]);var _0x59ca18={'where':_0x5c9003[_0x04c6('0x35')]};return db['Integration'][_0x04c6('0x1b')](_0x59ca18)[_0x04c6('0x1f')](function(_0x2d83eb){_0x3a6d92[_0x04c6('0x1b')]=_0x2d83eb;if(_0x1cd16a[_0x04c6('0x2b')]['includeAll']){_0x5c9003[_0x04c6('0x3b')]=[{'all':!![]}];}return db['Integration'][_0x04c6('0x3c')](_0x5c9003);})['then'](function(_0x1f7ead){_0x3a6d92[_0x04c6('0x3d')]=_0x1f7ead;return _0x3a6d92;})[_0x04c6('0x1f')](respondWithFilteredResult(_0x5f1331,_0x5c9003))[_0x04c6('0x3e')](handleError(_0x5f1331,null));};exports[_0x04c6('0x3f')]=function(_0x2cdf34,_0x40477f){var _0x4a3c45={'raw':![],'where':{'id':_0x2cdf34['params']['id']}},_0xdfdc34={};_0xdfdc34[_0x04c6('0x2f')]=_['keys'](db['Integration'][_0x04c6('0x28')]);_0xdfdc34['query']=_[_0x04c6('0x2a')](_0x2cdf34[_0x04c6('0x2b')]);_0xdfdc34[_0x04c6('0x2c')]=_['intersection'](_0xdfdc34[_0x04c6('0x2f')],_0xdfdc34[_0x04c6('0x2b')]);_0x4a3c45[_0x04c6('0x2e')]=_[_0x04c6('0x2d')](_0xdfdc34[_0x04c6('0x2f')],qs[_0x04c6('0x30')](_0x2cdf34[_0x04c6('0x2b')]['fields']));_0x4a3c45['attributes']=_0x4a3c45[_0x04c6('0x2e')][_0x04c6('0x31')]?_0x4a3c45[_0x04c6('0x2e')]:_0xdfdc34['model'];if(_0x2cdf34[_0x04c6('0x2b')][_0x04c6('0x40')]){_0x4a3c45[_0x04c6('0x3b')]=[{'all':!![]}];}_0x4a3c45=_['merge']({},_0x4a3c45,_0x2cdf34['options']);return db['Integration'][_0x04c6('0x41')](_0x4a3c45)[_0x04c6('0x1f')](handleEntityNotFound(_0x40477f,null))['then'](respondWithResult(_0x40477f,null))[_0x04c6('0x3e')](handleError(_0x40477f,null));};exports[_0x04c6('0x42')]=function(_0x2bd045,_0x4ef366){return db[_0x04c6('0x27')][_0x04c6('0x42')](_0x2bd045['body'],{})[_0x04c6('0x1f')](respondWithResult(_0x4ef366,0xc9))[_0x04c6('0x3e')](handleError(_0x4ef366,null));};exports[_0x04c6('0x43')]=function(_0xee2822,_0x4cfde2){if(_0xee2822[_0x04c6('0x44')]['id']){delete _0xee2822[_0x04c6('0x44')]['id'];}return db[_0x04c6('0x27')][_0x04c6('0x41')]({'where':{'id':_0xee2822['params']['id']}})[_0x04c6('0x1f')](handleEntityNotFound(_0x4cfde2,null))[_0x04c6('0x1f')](saveUpdates(_0xee2822[_0x04c6('0x44')],null))[_0x04c6('0x1f')](respondWithResult(_0x4cfde2,null))['catch'](handleError(_0x4cfde2,null));};exports[_0x04c6('0x20')]=function(_0x42273e,_0x15ec61){return db['Integration'][_0x04c6('0x41')]({'where':{'id':_0x42273e[_0x04c6('0x45')]['id']}})[_0x04c6('0x1f')](handleEntityNotFound(_0x15ec61,null))[_0x04c6('0x1f')](removeEntity(_0x15ec61,null))[_0x04c6('0x3e')](handleError(_0x15ec61,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 0dc5ca6..934fc01 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 _0x1071=['exports','integrations','lodash','util','../../config/logger','api','path','rimraf','../../config/environment','./integration.attributes'];(function(_0x5340b7,_0x4f098f){var _0x8d3a89=function(_0x26718c){while(--_0x26718c){_0x5340b7['push'](_0x5340b7['shift']());}};_0x8d3a89(++_0x4f098f);}(_0x1071,0x192));var _0x1107=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x1071[_0x432682];return _0x463d05;};'use strict';var _=require(_0x1107('0x0'));var util=require(_0x1107('0x1'));var logger=require(_0x1107('0x2'))(_0x1107('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1107('0x4'));var rimraf=require(_0x1107('0x5'));var config=require(_0x1107('0x6'));var attributes=require(_0x1107('0x7'));module[_0x1107('0x8')]=function(_0x41efb9,_0x91c204){return _0x41efb9['define']('Integration',attributes,{'tableName':_0x1107('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe3db=['api','bluebird','path','exports','define','Integration','integrations','util','../../config/logger'];(function(_0x4adc4e,_0x39da2c){var _0x4d171e=function(_0x256aed){while(--_0x256aed){_0x4adc4e['push'](_0x4adc4e['shift']());}};_0x4d171e(++_0x39da2c);}(_0xe3db,0x181));var _0xbe3d=function(_0x1c3230,_0x47fdfa){_0x1c3230=_0x1c3230-0x0;var _0x492a7d=_0xe3db[_0x1c3230];return _0x492a7d;};'use strict';var _=require('lodash');var util=require(_0xbe3d('0x0'));var logger=require(_0xbe3d('0x1'))(_0xbe3d('0x2'));var moment=require('moment');var BPromise=require(_0xbe3d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe3d('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./integration.attributes');module[_0xbe3d('0x5')]=function(_0x180d65,_0x5470a6){return _0x180d65[_0xbe3d('0x6')](_0xbe3d('0x7'),attributes,{'tableName':_0xbe3d('0x8'),'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 3fdd494..0c34a18 100644 --- a/server/api/integration/integration.rpc.js +++ b/server/api/integration/integration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x66fa=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','info','Integration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','Integration,\x20%s,\x20%s','message','catch','lodash'];(function(_0x1afd29,_0x3f602e){var _0x33bf8b=function(_0x783da0){while(--_0x783da0){_0x1afd29['push'](_0x1afd29['shift']());}};_0x33bf8b(++_0x3f602e);}(_0x66fa,0x117));var _0xa66f=function(_0x14d0ac,_0x1dbf26){_0x14d0ac=_0x14d0ac-0x0;var _0x4f0a8c=_0x66fa[_0x14d0ac];return _0x4f0a8c;};'use strict';var _=require(_0xa66f('0x0'));var util=require(_0xa66f('0x1'));var moment=require('moment');var BPromise=require(_0xa66f('0x2'));var rs=require(_0xa66f('0x3'));var fs=require('fs');var Redis=require(_0xa66f('0x4'));var db=require(_0xa66f('0x5'))['db'];var utils=require(_0xa66f('0x6'));var logger=require(_0xa66f('0x7'))(_0xa66f('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa66f('0x9')][_0xa66f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2f0b78,_0x1d02fc,_0x38b58b){return new BPromise(function(_0x5096bf,_0x39c1ef){return client['request'](_0x2f0b78,_0x38b58b)[_0xa66f('0xb')](function(_0x597c7c){logger[_0xa66f('0xc')]('Integration,\x20%s,\x20%s',_0x1d02fc,'request\x20sent');logger['debug'](_0xa66f('0xd'),_0x1d02fc,_0xa66f('0xe'),JSON['stringify'](_0x597c7c));if(_0x597c7c[_0xa66f('0xf')]){if(_0x597c7c['error'][_0xa66f('0x10')]===0x1f4){logger['error'](_0xa66f('0x11'),_0x1d02fc,_0x597c7c[_0xa66f('0xf')][_0xa66f('0x12')]);return _0x39c1ef(_0x597c7c['error']['message']);}logger[_0xa66f('0xf')]('Integration,\x20%s,\x20%s',_0x1d02fc,_0x597c7c['error']['message']);return _0x5096bf(_0x597c7c[_0xa66f('0xf')][_0xa66f('0x12')]);}else{logger[_0xa66f('0xc')](_0xa66f('0x11'),_0x1d02fc,_0xa66f('0xe'));_0x5096bf(_0x597c7c['result']['message']);}})[_0xa66f('0x13')](function(_0x32d338){logger[_0xa66f('0xf')](_0xa66f('0x11'),_0x1d02fc,_0x32d338);_0x39c1ef(_0x32d338);});});} \ No newline at end of file +var _0x896e=['Integration,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x4734d8,_0x479950){var _0x3b1120=function(_0x4a5d1c){while(--_0x4a5d1c){_0x4734d8['push'](_0x4734d8['shift']());}};_0x3b1120(++_0x479950);}(_0x896e,0x1e9));var _0xe896=function(_0x2b863f,_0x4d5183){_0x2b863f=_0x2b863f-0x0;var _0x1380f9=_0x896e[_0x2b863f];return _0x1380f9;};'use strict';var _=require(_0xe896('0x0'));var util=require(_0xe896('0x1'));var moment=require(_0xe896('0x2'));var BPromise=require(_0xe896('0x3'));var rs=require(_0xe896('0x4'));var fs=require('fs');var Redis=require(_0xe896('0x5'));var db=require(_0xe896('0x6'))['db'];var utils=require(_0xe896('0x7'));var logger=require(_0xe896('0x8'))(_0xe896('0x9'));var config=require(_0xe896('0xa'));var jayson=require(_0xe896('0xb'));var client=jayson['client'][_0xe896('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x7a0721,_0x3b902c,_0x264eeb){return new BPromise(function(_0x43c619,_0x5a1909){return client[_0xe896('0xd')](_0x7a0721,_0x264eeb)[_0xe896('0xe')](function(_0x37a90d){logger['info'](_0xe896('0xf'),_0x3b902c,'request\x20sent');logger[_0xe896('0x10')]('Integration,\x20%s,\x20%s,\x20%s',_0x3b902c,_0xe896('0x11'),JSON[_0xe896('0x12')](_0x37a90d));if(_0x37a90d[_0xe896('0x13')]){if(_0x37a90d['error'][_0xe896('0x14')]===0x1f4){logger[_0xe896('0x13')](_0xe896('0xf'),_0x3b902c,_0x37a90d['error'][_0xe896('0x15')]);return _0x5a1909(_0x37a90d[_0xe896('0x13')][_0xe896('0x15')]);}logger['error'](_0xe896('0xf'),_0x3b902c,_0x37a90d[_0xe896('0x13')][_0xe896('0x15')]);return _0x43c619(_0x37a90d['error']['message']);}else{logger[_0xe896('0x16')](_0xe896('0xf'),_0x3b902c,'request\x20sent');_0x43c619(_0x37a90d['result'][_0xe896('0x15')]);}})[_0xe896('0x17')](function(_0x57f04b){logger[_0xe896('0x13')]('Integration,\x20%s,\x20%s',_0x3b902c,_0x57f04b);_0x5a1909(_0x57f04b);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index ae116cb..f3ae76e 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 _0xadb5=['delete','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update'];(function(_0xdf3db6,_0x2a1952){var _0x4b7a65=function(_0x2953be){while(--_0x2953be){_0xdf3db6['push'](_0xdf3db6['shift']());}};_0x4b7a65(++_0x2a1952);}(_0xadb5,0xad));var _0x5adb=function(_0x264df5,_0x1ac379){_0x264df5=_0x264df5-0x0;var _0x50261d=_0xadb5[_0x264df5];return _0x50261d;};'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 fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./integrationReport.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0xe')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0xf')]);router['put']('/:id',auth[_0x5adb('0x8')](),controller[_0x5adb('0x10')]);router[_0x5adb('0x11')]('/:id',auth[_0x5adb('0x8')](),controller['destroy']);module[_0x5adb('0x12')]=router; \ No newline at end of file +var _0xba34=['exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','isAuthenticated','index','describe','/:id','show','post','create','put','update','delete'];(function(_0x4373fe,_0x3c3c6e){var _0x4d6e86=function(_0x19caad){while(--_0x19caad){_0x4373fe['push'](_0x4373fe['shift']());}};_0x4d6e86(++_0x3c3c6e);}(_0xba34,0x119));var _0x4ba3=function(_0x10b52c,_0x2fd309){_0x10b52c=_0x10b52c-0x0;var _0x43ba57=_0xba34[_0x10b52c];return _0x43ba57;};'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 fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x4ba3('0x5'));var config=require(_0x4ba3('0x6'));var controller=require(_0x4ba3('0x7'));router[_0x4ba3('0x8')]('/',auth[_0x4ba3('0x9')](),controller[_0x4ba3('0xa')]);router[_0x4ba3('0x8')]('/describe',auth[_0x4ba3('0x9')](),controller[_0x4ba3('0xb')]);router[_0x4ba3('0x8')](_0x4ba3('0xc'),auth[_0x4ba3('0x9')](),controller[_0x4ba3('0xd')]);router[_0x4ba3('0xe')]('/',auth[_0x4ba3('0x9')](),controller[_0x4ba3('0xf')]);router[_0x4ba3('0x10')](_0x4ba3('0xc'),auth['isAuthenticated'](),controller[_0x4ba3('0x11')]);router[_0x4ba3('0x12')]('/:id',auth[_0x4ba3('0x9')](),controller['destroy']);module[_0x4ba3('0x13')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index 1f71014..fefea7b 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 _0x46f0=['FAILED','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENDING','RECEIVED'];(function(_0x29bfbe,_0x37060a){var _0x230663=function(_0x3b2a6f){while(--_0x3b2a6f){_0x29bfbe['push'](_0x29bfbe['shift']());}};_0x230663(++_0x37060a);}(_0x46f0,0x8d));var _0x046f=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x46f0[_0x57b54c];return _0x59cc19;};'use strict';var Sequelize=require('sequelize');module[_0x046f('0x0')]={'integration':{'type':Sequelize['STRING']},'eventChannel':{'type':Sequelize[_0x046f('0x1')]},'exitStatus':{'type':Sequelize[_0x046f('0x1')]},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize[_0x046f('0x2')]},'contacts':{'type':Sequelize[_0x046f('0x1')]},'uniqueid':{'type':Sequelize[_0x046f('0x1')]},'calleridnum':{'type':Sequelize[_0x046f('0x1')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x046f('0x1')]},'membername':{'type':Sequelize[_0x046f('0x1')]},'agentcalledAt':{'type':Sequelize[_0x046f('0x3')]},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x046f('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize['DATE']},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0x046f('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x046f('0x2')]},'reason':{'type':Sequelize[_0x046f('0x1')]},'agentringnoanswer':{'type':Sequelize[_0x046f('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x046f('0x3')]},'agentdump':{'type':Sequelize[_0x046f('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x046f('0x3')]},'lastevent':{'type':Sequelize[_0x046f('0x1')]},'channel':{'type':Sequelize[_0x046f('0x1')]},'channelstate':{'type':Sequelize[_0x046f('0x2')]},'channelstatedesc':{'type':Sequelize[_0x046f('0x1')]},'connectedlinenum':{'type':Sequelize[_0x046f('0x1')]},'connectedlinename':{'type':Sequelize[_0x046f('0x1')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x046f('0x1')]},'context':{'type':Sequelize[_0x046f('0x1')]},'exten':{'type':Sequelize[_0x046f('0x1')]},'priority':{'type':Sequelize[_0x046f('0x1')]},'destchannel':{'type':Sequelize[_0x046f('0x1')]},'destchannelstate':{'type':Sequelize[_0x046f('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x046f('0x1')]},'destcalleridnum':{'type':Sequelize[_0x046f('0x1')]},'destcalleridname':{'type':Sequelize[_0x046f('0x1')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x046f('0x1')]},'destlanguage':{'type':Sequelize[_0x046f('0x1')]},'destaccountcode':{'type':Sequelize[_0x046f('0x1')]},'destcontext':{'type':Sequelize[_0x046f('0x1')]},'destexten':{'type':Sequelize[_0x046f('0x1')]},'destpriority':{'type':Sequelize[_0x046f('0x1')]},'destuniqueid':{'type':Sequelize[_0x046f('0x1')]},'messageId':{'type':Sequelize[_0x046f('0x1')]},'inReplyTo':{'type':Sequelize['STRING']},'subject':{'type':Sequelize[_0x046f('0x1')]},'from':{'type':Sequelize[_0x046f('0x1')]},'to':{'type':Sequelize[_0x046f('0x1')]},'cc':{'type':Sequelize['STRING']},'attachment':{'type':Sequelize[_0x046f('0x5')]},'html':{'type':Sequelize['TEXT']},'text':{'type':Sequelize[_0x046f('0x5')]},'status':{'type':Sequelize[_0x046f('0x6')]('SENT',_0x046f('0x7'),_0x046f('0x8'),_0x046f('0x9'))},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize[_0x046f('0x1')]},'appdata':{'type':Sequelize[_0x046f('0x1')]},'projectId':{'type':Sequelize[_0x046f('0x2')]}}; \ No newline at end of file +var _0x9028=['INTEGER','BOOLEAN','TEXT','SENT','FAILED','sequelize','exports','STRING','DATE'];(function(_0x552cf8,_0x493a58){var _0x5b0eca=function(_0xbc6b6d){while(--_0xbc6b6d){_0x552cf8['push'](_0x552cf8['shift']());}};_0x5b0eca(++_0x493a58);}(_0x9028,0x12e));var _0x8902=function(_0x32bed3,_0x33c35b){_0x32bed3=_0x32bed3-0x0;var _0x508d32=_0x9028[_0x32bed3];return _0x508d32;};'use strict';var Sequelize=require(_0x8902('0x0'));module[_0x8902('0x1')]={'integration':{'type':Sequelize['STRING']},'eventChannel':{'type':Sequelize[_0x8902('0x2')]},'exitStatus':{'type':Sequelize[_0x8902('0x2')]},'ticketId':{'type':Sequelize[_0x8902('0x2')]},'integrationId':{'type':Sequelize['INTEGER']},'contacts':{'type':Sequelize[_0x8902('0x2')]},'uniqueid':{'type':Sequelize[_0x8902('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x8902('0x2')]},'queue':{'type':Sequelize[_0x8902('0x2')]},'interface':{'type':Sequelize[_0x8902('0x2')]},'membername':{'type':Sequelize[_0x8902('0x2')]},'agentcalledAt':{'type':Sequelize[_0x8902('0x3')]},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0x8902('0x4')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x8902('0x3')]},'talktime':{'type':Sequelize[_0x8902('0x4')]},'agentacw':{'type':Sequelize[_0x8902('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x8902('0x4')]},'reason':{'type':Sequelize['STRING']},'agentringnoanswer':{'type':Sequelize[_0x8902('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdump':{'type':Sequelize[_0x8902('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0x8902('0x2')]},'channel':{'type':Sequelize[_0x8902('0x2')]},'channelstate':{'type':Sequelize[_0x8902('0x4')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x8902('0x2')]},'connectedlinename':{'type':Sequelize[_0x8902('0x2')]},'language':{'type':Sequelize[_0x8902('0x2')]},'accountcode':{'type':Sequelize[_0x8902('0x2')]},'context':{'type':Sequelize[_0x8902('0x2')]},'exten':{'type':Sequelize[_0x8902('0x2')]},'priority':{'type':Sequelize[_0x8902('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x8902('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0x8902('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x8902('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x8902('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x8902('0x2')]},'destaccountcode':{'type':Sequelize[_0x8902('0x2')]},'destcontext':{'type':Sequelize[_0x8902('0x2')]},'destexten':{'type':Sequelize[_0x8902('0x2')]},'destpriority':{'type':Sequelize[_0x8902('0x2')]},'destuniqueid':{'type':Sequelize[_0x8902('0x2')]},'messageId':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0x8902('0x2')]},'subject':{'type':Sequelize[_0x8902('0x2')]},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0x8902('0x2')]},'cc':{'type':Sequelize[_0x8902('0x2')]},'attachment':{'type':Sequelize['TEXT']},'html':{'type':Sequelize[_0x8902('0x6')]},'text':{'type':Sequelize[_0x8902('0x6')]},'status':{'type':Sequelize['ENUM'](_0x8902('0x7'),'SENDING','RECEIVED',_0x8902('0x8'))},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize['STRING']},'appdata':{'type':Sequelize[_0x8902('0x2')]},'projectId':{'type':Sequelize[_0x8902('0x4')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index 0043816..fcb7bfd 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 _0x4baf=['../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','set','Content-Range','apply','save','update','then','end','error','stack','name','send','index','map','rawAttributes','key','model','keys','filters','intersection','attributes','query','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','type','VIRTUAL','IntegrationReport','includeAll','include','findAll','rows','show','params','fields','options','find','create','body','catch','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','fs-extra','lodash','squel','crypto','to-csv','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment'];(function(_0x5a51c2,_0x28bda5){var _0x3caf01=function(_0x145871){while(--_0x145871){_0x5a51c2['push'](_0x5a51c2['shift']());}};_0x3caf01(++_0x28bda5);}(_0x4baf,0x122));var _0xf4ba=function(_0x446c1a,_0x22e1ad){_0x446c1a=_0x446c1a-0x0;var _0x20eec6=_0x4baf[_0x446c1a];return _0x20eec6;};'use strict';var emlformat=require(_0xf4ba('0x0'));var rimraf=require(_0xf4ba('0x1'));var zipdir=require(_0xf4ba('0x2'));var jsonpatch=require(_0xf4ba('0x3'));var rp=require(_0xf4ba('0x4'));var moment=require(_0xf4ba('0x5'));var BPromise=require(_0xf4ba('0x6'));var Mustache=require(_0xf4ba('0x7'));var util=require('util');var path=require(_0xf4ba('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf4ba('0x9'));var fs=require('fs');var fs_extra=require(_0xf4ba('0xa'));var _=require(_0xf4ba('0xb'));var squel=require(_0xf4ba('0xc'));var crypto=require(_0xf4ba('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf4ba('0xe'));var querystring=require(_0xf4ba('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xf4ba('0x10'));var as=require(_0xf4ba('0x11'));var hardwareService=require(_0xf4ba('0x12'));var logger=require(_0xf4ba('0x13'))('api');var utils=require(_0xf4ba('0x14'));var config=require(_0xf4ba('0x15'));var licenseUtil=require(_0xf4ba('0x16'));var db=require(_0xf4ba('0x17'))['db'];function respondWithStatusCode(_0x21e4ce,_0x4c9967){_0x4c9967=_0x4c9967||0xcc;return function(_0x38f46e){if(_0x38f46e){return _0x21e4ce[_0xf4ba('0x18')](_0x4c9967);}return _0x21e4ce[_0xf4ba('0x19')](_0x4c9967)['end']();};}function respondWithResult(_0xb621ea,_0x36f7a3){_0x36f7a3=_0x36f7a3||0xc8;return function(_0x4d816c){if(_0x4d816c){return _0xb621ea[_0xf4ba('0x19')](_0x36f7a3)[_0xf4ba('0x1a')](_0x4d816c);}};}function respondWithFilteredResult(_0x20a575,_0x49d36a){return function(_0x1fed10){if(_0x1fed10){var _0x4286b2=typeof _0x49d36a['offset']===_0xf4ba('0x1b')&&typeof _0x49d36a[_0xf4ba('0x1c')]===_0xf4ba('0x1b');var _0x262a5f=_0x1fed10['count'];var _0x2b2942=_0x4286b2?0x0:_0x49d36a['offset'];var _0x4b3b7f=_0x4286b2?_0x1fed10[_0xf4ba('0x1d')]:_0x49d36a['offset']+_0x49d36a[_0xf4ba('0x1c')];var _0x5c9de1;if(_0x4b3b7f>=_0x262a5f){_0x4b3b7f=_0x262a5f;_0x5c9de1=0xc8;}else{_0x5c9de1=0xce;}_0x20a575[_0xf4ba('0x19')](_0x5c9de1);return _0x20a575[_0xf4ba('0x1e')](_0xf4ba('0x1f'),_0x2b2942+'-'+_0x4b3b7f+'/'+_0x262a5f)[_0xf4ba('0x1a')](_0x1fed10);}return null;};}function patchUpdates(_0x4c414d){return function(_0x3f7ccc){try{jsonpatch[_0xf4ba('0x20')](_0x3f7ccc,_0x4c414d,!![]);}catch(_0x48f6da){return BPromise['reject'](_0x48f6da);}return _0x3f7ccc[_0xf4ba('0x21')]();};}function saveUpdates(_0x26f0aa,_0x2edb53){return function(_0xa5b85){if(_0xa5b85){return _0xa5b85[_0xf4ba('0x22')](_0x26f0aa)[_0xf4ba('0x23')](function(_0xe29383){return _0xe29383;});}return null;};}function removeEntity(_0x2919fb,_0x9da345){return function(_0x452ead){if(_0x452ead){return _0x452ead['destroy']()[_0xf4ba('0x23')](function(){_0x2919fb[_0xf4ba('0x19')](0xcc)[_0xf4ba('0x24')]();});}};}function handleEntityNotFound(_0x4cc5b3,_0x2308d6){return function(_0x4bf971){if(!_0x4bf971){_0x4cc5b3[_0xf4ba('0x18')](0x194);}return _0x4bf971;};}function handleError(_0x4f5d2c,_0x144ed6){_0x144ed6=_0x144ed6||0x1f4;return function(_0x7e8baf){logger[_0xf4ba('0x25')](_0x7e8baf[_0xf4ba('0x26')]);if(_0x7e8baf[_0xf4ba('0x27')]){delete _0x7e8baf[_0xf4ba('0x27')];}_0x4f5d2c[_0xf4ba('0x19')](_0x144ed6)[_0xf4ba('0x28')](_0x7e8baf);};}exports[_0xf4ba('0x29')]=function(_0x474a91,_0x7cec46){var _0x4b1ef0={},_0x52fd26={},_0x1bc606={'count':0x0,'rows':[]};var _0x1e9f06=_[_0xf4ba('0x2a')](db['IntegrationReport'][_0xf4ba('0x2b')],function(_0x145ac7){return{'name':_0x145ac7['fieldName'],'type':_0x145ac7['type'][_0xf4ba('0x2c')]};});_0x52fd26[_0xf4ba('0x2d')]=_['map'](_0x1e9f06,_0xf4ba('0x27'));_0x52fd26['query']=_[_0xf4ba('0x2e')](_0x474a91['query']);_0x52fd26[_0xf4ba('0x2f')]=_[_0xf4ba('0x30')](_0x52fd26['model'],_0x52fd26['query']);_0x4b1ef0[_0xf4ba('0x31')]=_[_0xf4ba('0x30')](_0x52fd26[_0xf4ba('0x2d')],qs['fields'](_0x474a91[_0xf4ba('0x32')]['fields']));_0x4b1ef0[_0xf4ba('0x31')]=_0x4b1ef0[_0xf4ba('0x31')][_0xf4ba('0x33')]?_0x4b1ef0[_0xf4ba('0x31')]:_0x52fd26[_0xf4ba('0x2d')];if(!_0x474a91[_0xf4ba('0x32')][_0xf4ba('0x34')](_0xf4ba('0x35'))){_0x4b1ef0[_0xf4ba('0x1c')]=qs[_0xf4ba('0x1c')](_0x474a91['query'][_0xf4ba('0x1c')]);_0x4b1ef0[_0xf4ba('0x36')]=qs[_0xf4ba('0x36')](_0x474a91[_0xf4ba('0x32')]['offset']);}_0x4b1ef0[_0xf4ba('0x37')]=qs[_0xf4ba('0x38')](_0x474a91[_0xf4ba('0x32')][_0xf4ba('0x38')]);_0x4b1ef0[_0xf4ba('0x39')]=qs[_0xf4ba('0x2f')](_[_0xf4ba('0x3a')](_0x474a91['query'],_0x52fd26[_0xf4ba('0x2f')]),_0x1e9f06);if(_0x474a91[_0xf4ba('0x32')][_0xf4ba('0x3b')]){_0x4b1ef0[_0xf4ba('0x39')]=_[_0xf4ba('0x3c')](_0x4b1ef0['where'],{'$or':_['map'](_0x1e9f06,function(_0x574b45){if(_0x574b45[_0xf4ba('0x3d')]!==_0xf4ba('0x3e')){var _0x135d27={};_0x135d27[_0x574b45['name']]={'$like':'%'+_0x474a91[_0xf4ba('0x32')][_0xf4ba('0x3b')]+'%'};return _0x135d27;}})});}_0x4b1ef0=_['merge']({},_0x4b1ef0,_0x474a91['options']);var _0x30f06e={'where':_0x4b1ef0[_0xf4ba('0x39')]};return db[_0xf4ba('0x3f')][_0xf4ba('0x1d')](_0x30f06e)[_0xf4ba('0x23')](function(_0x33ad0d){_0x1bc606[_0xf4ba('0x1d')]=_0x33ad0d;if(_0x474a91['query'][_0xf4ba('0x40')]){_0x4b1ef0[_0xf4ba('0x41')]=[{'all':!![]}];}return db[_0xf4ba('0x3f')][_0xf4ba('0x42')](_0x4b1ef0);})[_0xf4ba('0x23')](function(_0x4fa6af){_0x1bc606[_0xf4ba('0x43')]=_0x4fa6af;return _0x1bc606;})[_0xf4ba('0x23')](respondWithFilteredResult(_0x7cec46,_0x4b1ef0))['catch'](handleError(_0x7cec46,null));};exports[_0xf4ba('0x44')]=function(_0xe377c7,_0x2fefc9){var _0x42210a={'raw':![],'where':{'id':_0xe377c7[_0xf4ba('0x45')]['id']}},_0x416bb4={};_0x416bb4['model']=_['keys'](db['IntegrationReport'][_0xf4ba('0x2b')]);_0x416bb4[_0xf4ba('0x32')]=_[_0xf4ba('0x2e')](_0xe377c7['query']);_0x416bb4[_0xf4ba('0x2f')]=_[_0xf4ba('0x30')](_0x416bb4[_0xf4ba('0x2d')],_0x416bb4[_0xf4ba('0x32')]);_0x42210a['attributes']=_[_0xf4ba('0x30')](_0x416bb4[_0xf4ba('0x2d')],qs['fields'](_0xe377c7[_0xf4ba('0x32')][_0xf4ba('0x46')]));_0x42210a[_0xf4ba('0x31')]=_0x42210a[_0xf4ba('0x31')][_0xf4ba('0x33')]?_0x42210a[_0xf4ba('0x31')]:_0x416bb4['model'];if(_0xe377c7[_0xf4ba('0x32')]['includeAll']){_0x42210a['include']=[{'all':!![]}];}_0x42210a=_[_0xf4ba('0x3c')]({},_0x42210a,_0xe377c7[_0xf4ba('0x47')]);return db[_0xf4ba('0x3f')][_0xf4ba('0x48')](_0x42210a)[_0xf4ba('0x23')](handleEntityNotFound(_0x2fefc9,null))[_0xf4ba('0x23')](respondWithResult(_0x2fefc9,null))['catch'](handleError(_0x2fefc9,null));};exports[_0xf4ba('0x49')]=function(_0x105c87,_0x2995a8){return db[_0xf4ba('0x3f')][_0xf4ba('0x49')](_0x105c87[_0xf4ba('0x4a')],{})[_0xf4ba('0x23')](respondWithResult(_0x2995a8,0xc9))[_0xf4ba('0x4b')](handleError(_0x2995a8,null));};exports[_0xf4ba('0x22')]=function(_0x1603be,_0x54f682){if(_0x1603be[_0xf4ba('0x4a')]['id']){delete _0x1603be[_0xf4ba('0x4a')]['id'];}return db[_0xf4ba('0x3f')][_0xf4ba('0x48')]({'where':{'id':_0x1603be['params']['id']}})['then'](handleEntityNotFound(_0x54f682,null))[_0xf4ba('0x23')](saveUpdates(_0x1603be['body'],null))[_0xf4ba('0x23')](respondWithResult(_0x54f682,null))['catch'](handleError(_0x54f682,null));};exports[_0xf4ba('0x4c')]=function(_0x5bb039,_0x3efd95){return db['IntegrationReport'][_0xf4ba('0x48')]({'where':{'id':_0x5bb039['params']['id']}})[_0xf4ba('0x23')](handleEntityNotFound(_0x3efd95,null))[_0xf4ba('0x23')](removeEntity(_0x3efd95,null))['catch'](handleError(_0x3efd95,null));};exports[_0xf4ba('0x4d')]=function(_0x6cc4b3,_0x2ffd16){return db['IntegrationReport']['describe']()[_0xf4ba('0x23')](respondWithResult(_0x2ffd16,null))['catch'](handleError(_0x2ffd16,null));}; \ No newline at end of file +var _0xfb96=['name','send','index','map','IntegrationReport','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','pick','merge','type','VIRTUAL','filter','options','rows','catch','show','params','includeAll','include','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','sendStatus','error'];(function(_0x456bd2,_0x156c79){var _0x2218c1=function(_0x44f2d4){while(--_0x44f2d4){_0x456bd2['push'](_0x456bd2['shift']());}};_0x2218c1(++_0x156c79);}(_0xfb96,0x74));var _0x6fb9=function(_0x11b76d,_0xbbebb8){_0x11b76d=_0x11b76d-0x0;var _0x567ac3=_0xfb96[_0x11b76d];return _0x567ac3;};'use strict';var emlformat=require(_0x6fb9('0x0'));var rimraf=require(_0x6fb9('0x1'));var zipdir=require(_0x6fb9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6fb9('0x3'));var moment=require(_0x6fb9('0x4'));var BPromise=require(_0x6fb9('0x5'));var Mustache=require(_0x6fb9('0x6'));var util=require(_0x6fb9('0x7'));var path=require(_0x6fb9('0x8'));var sox=require(_0x6fb9('0x9'));var csv=require(_0x6fb9('0xa'));var ejs=require(_0x6fb9('0xb'));var fs=require('fs');var fs_extra=require(_0x6fb9('0xc'));var _=require(_0x6fb9('0xd'));var squel=require(_0x6fb9('0xe'));var crypto=require(_0x6fb9('0xf'));var jsforce=require(_0x6fb9('0x10'));var deskjs=require(_0x6fb9('0x11'));var toCsv=require('to-csv');var querystring=require(_0x6fb9('0x12'));var Papa=require(_0x6fb9('0x13'));var Redis=require(_0x6fb9('0x14'));var authService=require(_0x6fb9('0x15'));var qs=require(_0x6fb9('0x16'));var as=require(_0x6fb9('0x17'));var hardwareService=require(_0x6fb9('0x18'));var logger=require(_0x6fb9('0x19'))('api');var utils=require(_0x6fb9('0x1a'));var config=require(_0x6fb9('0x1b'));var licenseUtil=require(_0x6fb9('0x1c'));var db=require(_0x6fb9('0x1d'))['db'];function respondWithStatusCode(_0x223575,_0x358c22){_0x358c22=_0x358c22||0xcc;return function(_0x4ebb02){if(_0x4ebb02){return _0x223575['sendStatus'](_0x358c22);}return _0x223575['status'](_0x358c22)[_0x6fb9('0x1e')]();};}function respondWithResult(_0xd3b4bd,_0x4352e5){_0x4352e5=_0x4352e5||0xc8;return function(_0x4a03e9){if(_0x4a03e9){return _0xd3b4bd[_0x6fb9('0x1f')](_0x4352e5)[_0x6fb9('0x20')](_0x4a03e9);}};}function respondWithFilteredResult(_0x16041d,_0x169cda){return function(_0x1e3af9){if(_0x1e3af9){var _0x39b87b=typeof _0x169cda[_0x6fb9('0x21')]===_0x6fb9('0x22')&&typeof _0x169cda[_0x6fb9('0x23')]===_0x6fb9('0x22');var _0x10e90b=_0x1e3af9['count'];var _0x49ffe3=_0x39b87b?0x0:_0x169cda[_0x6fb9('0x21')];var _0x428624=_0x39b87b?_0x1e3af9[_0x6fb9('0x24')]:_0x169cda[_0x6fb9('0x21')]+_0x169cda['limit'];var _0x145b2e;if(_0x428624>=_0x10e90b){_0x428624=_0x10e90b;_0x145b2e=0xc8;}else{_0x145b2e=0xce;}_0x16041d[_0x6fb9('0x1f')](_0x145b2e);return _0x16041d[_0x6fb9('0x25')]('Content-Range',_0x49ffe3+'-'+_0x428624+'/'+_0x10e90b)[_0x6fb9('0x20')](_0x1e3af9);}return null;};}function patchUpdates(_0x44dc8e){return function(_0x353139){try{jsonpatch[_0x6fb9('0x26')](_0x353139,_0x44dc8e,!![]);}catch(_0x2c45ad){return BPromise[_0x6fb9('0x27')](_0x2c45ad);}return _0x353139[_0x6fb9('0x28')]();};}function saveUpdates(_0x1c8db5,_0x40b58c){return function(_0x489121){if(_0x489121){return _0x489121[_0x6fb9('0x29')](_0x1c8db5)[_0x6fb9('0x2a')](function(_0x48c899){return _0x48c899;});}return null;};}function removeEntity(_0x10cb77,_0x4dc6da){return function(_0x223915){if(_0x223915){return _0x223915[_0x6fb9('0x2b')]()[_0x6fb9('0x2a')](function(){_0x10cb77[_0x6fb9('0x1f')](0xcc)[_0x6fb9('0x1e')]();});}};}function handleEntityNotFound(_0x849cb9,_0x4e30c0){return function(_0x1ad71b){if(!_0x1ad71b){_0x849cb9[_0x6fb9('0x2c')](0x194);}return _0x1ad71b;};}function handleError(_0x22f279,_0x3b1c00){_0x3b1c00=_0x3b1c00||0x1f4;return function(_0x4c054b){logger[_0x6fb9('0x2d')](_0x4c054b['stack']);if(_0x4c054b[_0x6fb9('0x2e')]){delete _0x4c054b[_0x6fb9('0x2e')];}_0x22f279[_0x6fb9('0x1f')](_0x3b1c00)[_0x6fb9('0x2f')](_0x4c054b);};}exports[_0x6fb9('0x30')]=function(_0x4bceed,_0x18aac2){var _0x5d89f4={},_0xaf11ed={},_0x12e586={'count':0x0,'rows':[]};var _0x551796=_[_0x6fb9('0x31')](db[_0x6fb9('0x32')][_0x6fb9('0x33')],function(_0xc9f6dc){return{'name':_0xc9f6dc['fieldName'],'type':_0xc9f6dc['type'][_0x6fb9('0x34')]};});_0xaf11ed[_0x6fb9('0x35')]=_[_0x6fb9('0x31')](_0x551796,_0x6fb9('0x2e'));_0xaf11ed[_0x6fb9('0x36')]=_[_0x6fb9('0x37')](_0x4bceed[_0x6fb9('0x36')]);_0xaf11ed[_0x6fb9('0x38')]=_[_0x6fb9('0x39')](_0xaf11ed['model'],_0xaf11ed[_0x6fb9('0x36')]);_0x5d89f4['attributes']=_[_0x6fb9('0x39')](_0xaf11ed[_0x6fb9('0x35')],qs[_0x6fb9('0x3a')](_0x4bceed['query'][_0x6fb9('0x3a')]));_0x5d89f4['attributes']=_0x5d89f4[_0x6fb9('0x3b')][_0x6fb9('0x3c')]?_0x5d89f4['attributes']:_0xaf11ed[_0x6fb9('0x35')];if(!_0x4bceed[_0x6fb9('0x36')][_0x6fb9('0x3d')](_0x6fb9('0x3e'))){_0x5d89f4[_0x6fb9('0x23')]=qs[_0x6fb9('0x23')](_0x4bceed['query']['limit']);_0x5d89f4['offset']=qs[_0x6fb9('0x21')](_0x4bceed['query'][_0x6fb9('0x21')]);}_0x5d89f4[_0x6fb9('0x3f')]=qs['sort'](_0x4bceed[_0x6fb9('0x36')]['sort']);_0x5d89f4[_0x6fb9('0x40')]=qs[_0x6fb9('0x38')](_[_0x6fb9('0x41')](_0x4bceed[_0x6fb9('0x36')],_0xaf11ed[_0x6fb9('0x38')]),_0x551796);if(_0x4bceed[_0x6fb9('0x36')]['filter']){_0x5d89f4[_0x6fb9('0x40')]=_[_0x6fb9('0x42')](_0x5d89f4['where'],{'$or':_[_0x6fb9('0x31')](_0x551796,function(_0x461df7){if(_0x461df7[_0x6fb9('0x43')]!==_0x6fb9('0x44')){var _0x131d9c={};_0x131d9c[_0x461df7['name']]={'$like':'%'+_0x4bceed[_0x6fb9('0x36')][_0x6fb9('0x45')]+'%'};return _0x131d9c;}})});}_0x5d89f4=_['merge']({},_0x5d89f4,_0x4bceed[_0x6fb9('0x46')]);var _0x49ae79={'where':_0x5d89f4[_0x6fb9('0x40')]};return db[_0x6fb9('0x32')][_0x6fb9('0x24')](_0x49ae79)[_0x6fb9('0x2a')](function(_0xbd5cee){_0x12e586['count']=_0xbd5cee;if(_0x4bceed['query']['includeAll']){_0x5d89f4['include']=[{'all':!![]}];}return db[_0x6fb9('0x32')]['findAll'](_0x5d89f4);})['then'](function(_0x1ea287){_0x12e586[_0x6fb9('0x47')]=_0x1ea287;return _0x12e586;})[_0x6fb9('0x2a')](respondWithFilteredResult(_0x18aac2,_0x5d89f4))[_0x6fb9('0x48')](handleError(_0x18aac2,null));};exports[_0x6fb9('0x49')]=function(_0x511fe1,_0x550543){var _0x280e55={'raw':![],'where':{'id':_0x511fe1[_0x6fb9('0x4a')]['id']}},_0x52a919={};_0x52a919[_0x6fb9('0x35')]=_[_0x6fb9('0x37')](db[_0x6fb9('0x32')][_0x6fb9('0x33')]);_0x52a919[_0x6fb9('0x36')]=_[_0x6fb9('0x37')](_0x511fe1['query']);_0x52a919[_0x6fb9('0x38')]=_['intersection'](_0x52a919[_0x6fb9('0x35')],_0x52a919['query']);_0x280e55[_0x6fb9('0x3b')]=_[_0x6fb9('0x39')](_0x52a919[_0x6fb9('0x35')],qs['fields'](_0x511fe1[_0x6fb9('0x36')][_0x6fb9('0x3a')]));_0x280e55['attributes']=_0x280e55[_0x6fb9('0x3b')]['length']?_0x280e55[_0x6fb9('0x3b')]:_0x52a919[_0x6fb9('0x35')];if(_0x511fe1['query'][_0x6fb9('0x4b')]){_0x280e55[_0x6fb9('0x4c')]=[{'all':!![]}];}_0x280e55=_[_0x6fb9('0x42')]({},_0x280e55,_0x511fe1[_0x6fb9('0x46')]);return db[_0x6fb9('0x32')][_0x6fb9('0x4d')](_0x280e55)[_0x6fb9('0x2a')](handleEntityNotFound(_0x550543,null))['then'](respondWithResult(_0x550543,null))[_0x6fb9('0x48')](handleError(_0x550543,null));};exports[_0x6fb9('0x4e')]=function(_0x2a8aaf,_0x19700d){return db['IntegrationReport']['create'](_0x2a8aaf[_0x6fb9('0x4f')],{})[_0x6fb9('0x2a')](respondWithResult(_0x19700d,0xc9))['catch'](handleError(_0x19700d,null));};exports[_0x6fb9('0x29')]=function(_0x205069,_0x4351e0){if(_0x205069[_0x6fb9('0x4f')]['id']){delete _0x205069[_0x6fb9('0x4f')]['id'];}return db[_0x6fb9('0x32')][_0x6fb9('0x4d')]({'where':{'id':_0x205069[_0x6fb9('0x4a')]['id']}})[_0x6fb9('0x2a')](handleEntityNotFound(_0x4351e0,null))[_0x6fb9('0x2a')](saveUpdates(_0x205069[_0x6fb9('0x4f')],null))['then'](respondWithResult(_0x4351e0,null))[_0x6fb9('0x48')](handleError(_0x4351e0,null));};exports[_0x6fb9('0x2b')]=function(_0x57bc14,_0x28d6f7){return db[_0x6fb9('0x32')][_0x6fb9('0x4d')]({'where':{'id':_0x57bc14[_0x6fb9('0x4a')]['id']}})[_0x6fb9('0x2a')](handleEntityNotFound(_0x28d6f7,null))[_0x6fb9('0x2a')](removeEntity(_0x28d6f7,null))['catch'](handleError(_0x28d6f7,null));};exports[_0x6fb9('0x50')]=function(_0x51705b,_0x29894a){return db[_0x6fb9('0x32')][_0x6fb9('0x50')]()[_0x6fb9('0x2a')](respondWithResult(_0x29894a,null))[_0x6fb9('0x48')](handleError(_0x29894a,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index 8342c9f..adc41dc 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 _0xbd2b=['bluebird','request-promise','path','../../config/environment','./integrationReport.attributes','exports','define','IntegrationReport','report_integration','lodash','util','../../config/logger','api','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbd2b,0xa3));var _0xbbd2=function(_0x401a89,_0x134dfd){_0x401a89=_0x401a89-0x0;var _0x5b2477=_0xbd2b[_0x401a89];return _0x5b2477;};'use strict';var _=require(_0xbbd2('0x0'));var util=require(_0xbbd2('0x1'));var logger=require(_0xbbd2('0x2'))(_0xbbd2('0x3'));var moment=require(_0xbbd2('0x4'));var BPromise=require(_0xbbd2('0x5'));var rp=require(_0xbbd2('0x6'));var fs=require('fs');var path=require(_0xbbd2('0x7'));var rimraf=require('rimraf');var config=require(_0xbbd2('0x8'));var attributes=require(_0xbbd2('0x9'));module[_0xbbd2('0xa')]=function(_0x36eb9a,_0x4e0af0){return _0x36eb9a[_0xbbd2('0xb')](_0xbbd2('0xc'),attributes,{'tableName':_0xbbd2('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3bf0=['path','rimraf','../../config/environment','./integrationReport.attributes','IntegrationReport','report_integration','lodash','../../config/logger','api','moment'];(function(_0x36aa05,_0x3117cc){var _0x293263=function(_0x1bdc70){while(--_0x1bdc70){_0x36aa05['push'](_0x36aa05['shift']());}};_0x293263(++_0x3117cc);}(_0x3bf0,0x196));var _0x03bf=function(_0xd9ec20,_0x340647){_0xd9ec20=_0xd9ec20-0x0;var _0x68f0f7=_0x3bf0[_0xd9ec20];return _0x68f0f7;};'use strict';var _=require(_0x03bf('0x0'));var util=require('util');var logger=require(_0x03bf('0x1'))(_0x03bf('0x2'));var moment=require(_0x03bf('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x03bf('0x4'));var rimraf=require(_0x03bf('0x5'));var config=require(_0x03bf('0x6'));var attributes=require(_0x03bf('0x7'));module['exports']=function(_0xf18b2a,_0x301769){return _0xf18b2a['define'](_0x03bf('0x8'),attributes,{'tableName':_0x03bf('0x9'),'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 900250f..fc0c311 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 _0x1967=['then','info','IntegrationReport,\x20%s,\x20%s','IntegrationReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x1da04e,_0x31024b){var _0xdd8c41=function(_0x2036f9){while(--_0x2036f9){_0x1da04e['push'](_0x1da04e['shift']());}};_0xdd8c41(++_0x31024b);}(_0x1967,0x173));var _0x7196=function(_0x48b534,_0x229ace){_0x48b534=_0x48b534-0x0;var _0x5c7711=_0x1967[_0x48b534];return _0x5c7711;};'use strict';var _=require('lodash');var util=require(_0x7196('0x0'));var moment=require(_0x7196('0x1'));var BPromise=require(_0x7196('0x2'));var rs=require(_0x7196('0x3'));var fs=require('fs');var Redis=require(_0x7196('0x4'));var db=require(_0x7196('0x5'))['db'];var utils=require(_0x7196('0x6'));var logger=require(_0x7196('0x7'))(_0x7196('0x8'));var config=require(_0x7196('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7196('0xa')][_0x7196('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x194746,_0x40e0af,_0x266a6e){return new BPromise(function(_0xad78a,_0x510c72){return client[_0x7196('0xc')](_0x194746,_0x266a6e)[_0x7196('0xd')](function(_0x3f846e){logger[_0x7196('0xe')](_0x7196('0xf'),_0x40e0af,'request\x20sent');logger['debug'](_0x7196('0x10'),_0x40e0af,_0x7196('0x11'),JSON[_0x7196('0x12')](_0x3f846e));if(_0x3f846e[_0x7196('0x13')]){if(_0x3f846e[_0x7196('0x13')][_0x7196('0x14')]===0x1f4){logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x3f846e[_0x7196('0x13')][_0x7196('0x15')]);return _0x510c72(_0x3f846e[_0x7196('0x13')]['message']);}logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x3f846e[_0x7196('0x13')][_0x7196('0x15')]);return _0xad78a(_0x3f846e['error'][_0x7196('0x15')]);}else{logger['info'](_0x7196('0xf'),_0x40e0af,_0x7196('0x11'));_0xad78a(_0x3f846e[_0x7196('0x16')][_0x7196('0x15')]);}})[_0x7196('0x17')](function(_0x2e3e0e){logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x2e3e0e);_0x510c72(_0x2e3e0e);});});} \ No newline at end of file +var _0x814b=['info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x814b,0x1a2));var _0xb814=function(_0x3b2c6f,_0xa9f35c){_0x3b2c6f=_0x3b2c6f-0x0;var _0x22e219=_0x814b[_0x3b2c6f];return _0x22e219;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var moment=require(_0xb814('0x2'));var BPromise=require(_0xb814('0x3'));var rs=require(_0xb814('0x4'));var fs=require('fs');var Redis=require(_0xb814('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb814('0x6'));var logger=require(_0xb814('0x7'))(_0xb814('0x8'));var config=require(_0xb814('0x9'));var jayson=require(_0xb814('0xa'));var client=jayson[_0xb814('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b0829,_0x2e6272,_0x5c8539){return new BPromise(function(_0x271af9,_0x2913a6){return client[_0xb814('0xc')](_0x3b0829,_0x5c8539)[_0xb814('0xd')](function(_0x1fea33){logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));logger[_0xb814('0x11')](_0xb814('0x12'),_0x2e6272,_0xb814('0x10'),JSON['stringify'](_0x1fea33));if(_0x1fea33[_0xb814('0x13')]){if(_0x1fea33['error'][_0xb814('0x14')]===0x1f4){logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x2913a6(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x271af9(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}else{logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));_0x271af9(_0x1fea33[_0xb814('0x16')][_0xb814('0x15')]);}})[_0xb814('0x17')](function(_0x21b73f){logger[_0xb814('0x13')]('IntegrationReport,\x20%s,\x20%s',_0x2e6272,_0x21b73f);_0x2913a6(_0x21b73f);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index c9bfaa6..4bfc609 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 _0xbb6b=['../../components/auth/service','../../config/environment','./interval.controller','get','isAuthenticated','index','show','/:id/sub_intervals','getIntervals','create','post','addInterval','/:id/sub_intervals/create_many','addIntervals','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra'];(function(_0x16818e,_0x4c3656){var _0x6fadf9=function(_0x182c97){while(--_0x182c97){_0x16818e['push'](_0x16818e['shift']());}};_0x6fadf9(++_0x4c3656);}(_0xbb6b,0xa9));var _0xbbb6=function(_0x589272,_0x4018a3){_0x589272=_0x589272-0x0;var _0x2aeabe=_0xbb6b[_0x589272];return _0x2aeabe;};'use strict';var multer=require(_0xbbb6('0x0'));var util=require(_0xbbb6('0x1'));var path=require(_0xbbb6('0x2'));var timeout=require(_0xbbb6('0x3'));var express=require(_0xbbb6('0x4'));var router=express['Router']();var fs_extra=require(_0xbbb6('0x5'));var auth=require(_0xbbb6('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xbbb6('0x7'));var controller=require(_0xbbb6('0x8'));router[_0xbbb6('0x9')]('/',auth[_0xbbb6('0xa')](),controller[_0xbbb6('0xb')]);router[_0xbbb6('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xbbb6('0xc')]);router[_0xbbb6('0x9')](_0xbbb6('0xd'),auth[_0xbbb6('0xa')](),controller[_0xbbb6('0xe')]);router['post']('/',auth[_0xbbb6('0xa')](),controller[_0xbbb6('0xf')]);router[_0xbbb6('0x10')](_0xbbb6('0xd'),auth[_0xbbb6('0xa')](),controller[_0xbbb6('0x11')]);router[_0xbbb6('0x10')](_0xbbb6('0x12'),auth['isAuthenticated'](),controller[_0xbbb6('0x13')]);router[_0xbbb6('0x14')](_0xbbb6('0x15'),auth[_0xbbb6('0xa')](),controller[_0xbbb6('0x16')]);router['delete'](_0xbbb6('0x15'),auth[_0xbbb6('0xa')](),controller[_0xbbb6('0x17')]);module[_0xbbb6('0x18')]=router; \ No newline at end of file +var _0x6bfc=['addInterval','addIntervals','put','update','delete','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./interval.controller','get','index','/:id','isAuthenticated','show','/:id/sub_intervals','post','create'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x6bfc,0x159));var _0xc6bf=function(_0x49d0df,_0x4ad27e){_0x49d0df=_0x49d0df-0x0;var _0x328a94=_0x6bfc[_0x49d0df];return _0x328a94;};'use strict';var multer=require('multer');var util=require(_0xc6bf('0x0'));var path=require(_0xc6bf('0x1'));var timeout=require(_0xc6bf('0x2'));var express=require('express');var router=express[_0xc6bf('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xc6bf('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xc6bf('0x5'));var controller=require(_0xc6bf('0x6'));router[_0xc6bf('0x7')]('/',auth['isAuthenticated'](),controller[_0xc6bf('0x8')]);router[_0xc6bf('0x7')](_0xc6bf('0x9'),auth[_0xc6bf('0xa')](),controller[_0xc6bf('0xb')]);router[_0xc6bf('0x7')](_0xc6bf('0xc'),auth[_0xc6bf('0xa')](),controller['getIntervals']);router[_0xc6bf('0xd')]('/',auth[_0xc6bf('0xa')](),controller[_0xc6bf('0xe')]);router[_0xc6bf('0xd')]('/:id/sub_intervals',auth['isAuthenticated'](),controller[_0xc6bf('0xf')]);router[_0xc6bf('0xd')]('/:id/sub_intervals/create_many',auth['isAuthenticated'](),controller[_0xc6bf('0x10')]);router[_0xc6bf('0x11')]('/:id',auth[_0xc6bf('0xa')](),controller[_0xc6bf('0x12')]);router[_0xc6bf('0x13')](_0xc6bf('0x9'),auth[_0xc6bf('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index 0759b3c..647a713 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 _0xa76b=['exports','STRING'];(function(_0x4de287,_0x25d9f1){var _0x3abd12=function(_0x163404){while(--_0x163404){_0x4de287['push'](_0x4de287['shift']());}};_0x3abd12(++_0x25d9f1);}(_0xa76b,0x166));var _0xba76=function(_0x5eb2e2,_0xa5e676){_0x5eb2e2=_0x5eb2e2-0x0;var _0x345b95=_0xa76b[_0x5eb2e2];return _0x345b95;};'use strict';var Sequelize=require('sequelize');module[_0xba76('0x0')]={'name':{'type':Sequelize[_0xba76('0x1')]},'description':{'type':Sequelize[_0xba76('0x1')]},'interval':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file +var _0x6f4c=['STRING','exports'];(function(_0x1ebce2,_0x10e903){var _0x4a330c=function(_0x4fd810){while(--_0x4fd810){_0x1ebce2['push'](_0x1ebce2['shift']());}};_0x4a330c(++_0x10e903);}(_0x6f4c,0x1d5));var _0xc6f4=function(_0x379dd5,_0x4b040c){_0x379dd5=_0x379dd5-0x0;var _0xc68134=_0x6f4c[_0x379dd5];return _0xc68134;};'use strict';var Sequelize=require('sequelize');module[_0xc6f4('0x0')]={'name':{'type':Sequelize[_0xc6f4('0x1')]},'description':{'type':Sequelize[_0xc6f4('0x1')]},'interval':{'type':Sequelize[_0xc6f4('0x1')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index 4aa6272..312cce8 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 _0x6fce=['includeAll','findAll','catch','show','params','fields','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','IntervalId','findOne','pick','getIntervals','addIntervals','sequelize','transaction','bulkCreate','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','get','Intervals','UserProfileResource','sendStatus','error','stack','name','send','index','map','Interval','rawAttributes','fieldName','key','query','keys','filters','model','attributes','intersection','length','hasOwnProperty','order','sort','filter','merge','where','type','then'];(function(_0x4526f4,_0x2ba9b3){var _0x59b2db=function(_0x26200f){while(--_0x26200f){_0x4526f4['push'](_0x4526f4['shift']());}};_0x59b2db(++_0x2ba9b3);}(_0x6fce,0x75));var _0xe6fc=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0x6fce[_0x25e7cb];return _0x375d92;};'use strict';var emlformat=require(_0xe6fc('0x0'));var rimraf=require(_0xe6fc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe6fc('0x2'));var rp=require(_0xe6fc('0x3'));var moment=require('moment');var BPromise=require(_0xe6fc('0x4'));var Mustache=require(_0xe6fc('0x5'));var util=require(_0xe6fc('0x6'));var path=require(_0xe6fc('0x7'));var sox=require(_0xe6fc('0x8'));var csv=require(_0xe6fc('0x9'));var ejs=require(_0xe6fc('0xa'));var fs=require('fs');var fs_extra=require(_0xe6fc('0xb'));var _=require(_0xe6fc('0xc'));var squel=require(_0xe6fc('0xd'));var crypto=require('crypto');var jsforce=require(_0xe6fc('0xe'));var deskjs=require(_0xe6fc('0xf'));var toCsv=require(_0xe6fc('0x9'));var querystring=require('querystring');var Papa=require(_0xe6fc('0x10'));var Redis=require(_0xe6fc('0x11'));var authService=require(_0xe6fc('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xe6fc('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe6fc('0x14'))(_0xe6fc('0x15'));var utils=require(_0xe6fc('0x16'));var config=require(_0xe6fc('0x17'));var licenseUtil=require(_0xe6fc('0x18'));var db=require(_0xe6fc('0x19'))['db'];var extensions=require(_0xe6fc('0x1a'));function respondWithStatusCode(_0x36b290,_0x12c81f){_0x12c81f=_0x12c81f||0xcc;return function(_0x569ce4){if(_0x569ce4){return _0x36b290['sendStatus'](_0x12c81f);}return _0x36b290['status'](_0x12c81f)[_0xe6fc('0x1b')]();};}function respondWithResult(_0x42dfcb,_0x311e58){_0x311e58=_0x311e58||0xc8;return function(_0x26871f){if(_0x26871f){return _0x42dfcb[_0xe6fc('0x1c')](_0x311e58)[_0xe6fc('0x1d')](_0x26871f);}};}function respondWithFilteredResult(_0x57ffa2,_0x1cb8df){return function(_0x53751c){if(_0x53751c){var _0x10b3bb=typeof _0x1cb8df[_0xe6fc('0x1e')]===_0xe6fc('0x1f')&&typeof _0x1cb8df[_0xe6fc('0x20')]===_0xe6fc('0x1f');var _0x237b7a=_0x53751c['count'];var _0x368e80=_0x10b3bb?0x0:_0x1cb8df[_0xe6fc('0x1e')];var _0x1481bd=_0x10b3bb?_0x53751c[_0xe6fc('0x21')]:_0x1cb8df[_0xe6fc('0x1e')]+_0x1cb8df[_0xe6fc('0x20')];var _0x24a16f;if(_0x1481bd>=_0x237b7a){_0x1481bd=_0x237b7a;_0x24a16f=0xc8;}else{_0x24a16f=0xce;}_0x57ffa2[_0xe6fc('0x1c')](_0x24a16f);return _0x57ffa2['set'](_0xe6fc('0x22'),_0x368e80+'-'+_0x1481bd+'/'+_0x237b7a)['json'](_0x53751c);}return null;};}function patchUpdates(_0x2815e9){return function(_0x5c1e98){try{jsonpatch[_0xe6fc('0x23')](_0x5c1e98,_0x2815e9,!![]);}catch(_0x2be6f5){return BPromise[_0xe6fc('0x24')](_0x2be6f5);}return _0x5c1e98[_0xe6fc('0x25')]();};}function saveUpdates(_0x39b347,_0x46b60e){return function(_0xacea98){if(_0xacea98){return _0xacea98[_0xe6fc('0x26')](_0x39b347)['then'](function(_0x5d44cd){return _0x5d44cd;});}return null;};}function removeEntity(_0xd6f401,_0x34fb1d){return function(_0xc272e){if(_0xc272e){return _0xc272e[_0xe6fc('0x27')]()['then'](function(){var _0x4582a8=_0xc272e[_0xe6fc('0x28')]({'plain':!![]});var _0x426e1f=_0xe6fc('0x29');return db[_0xe6fc('0x2a')]['destroy']({'where':{'type':_0x426e1f,'resourceId':_0x4582a8['id']}})['then'](function(){return _0xc272e;});})['then'](function(){_0xd6f401[_0xe6fc('0x1c')](0xcc)[_0xe6fc('0x1b')]();});}};}function handleEntityNotFound(_0x1e76a1,_0x17118c){return function(_0x4998f9){if(!_0x4998f9){_0x1e76a1[_0xe6fc('0x2b')](0x194);}return _0x4998f9;};}function handleError(_0x194d53,_0x2ca862){_0x2ca862=_0x2ca862||0x1f4;return function(_0x385326){logger[_0xe6fc('0x2c')](_0x385326[_0xe6fc('0x2d')]);if(_0x385326[_0xe6fc('0x2e')]){delete _0x385326['name'];}_0x194d53[_0xe6fc('0x1c')](_0x2ca862)[_0xe6fc('0x2f')](_0x385326);};}exports[_0xe6fc('0x30')]=function(_0x342cd6,_0x9c2374){var _0x49a39a={},_0x2918a1={},_0x8b8d56={'count':0x0,'rows':[]};var _0xec5b00=_[_0xe6fc('0x31')](db[_0xe6fc('0x32')][_0xe6fc('0x33')],function(_0x3833ac){return{'name':_0x3833ac[_0xe6fc('0x34')],'type':_0x3833ac['type'][_0xe6fc('0x35')]};});_0x2918a1['model']=_[_0xe6fc('0x31')](_0xec5b00,'name');_0x2918a1[_0xe6fc('0x36')]=_[_0xe6fc('0x37')](_0x342cd6[_0xe6fc('0x36')]);_0x2918a1[_0xe6fc('0x38')]=_['intersection'](_0x2918a1[_0xe6fc('0x39')],_0x2918a1[_0xe6fc('0x36')]);_0x49a39a[_0xe6fc('0x3a')]=_[_0xe6fc('0x3b')](_0x2918a1['model'],qs['fields'](_0x342cd6['query']['fields']));_0x49a39a[_0xe6fc('0x3a')]=_0x49a39a['attributes'][_0xe6fc('0x3c')]?_0x49a39a[_0xe6fc('0x3a')]:_0x2918a1[_0xe6fc('0x39')];if(!_0x342cd6[_0xe6fc('0x36')][_0xe6fc('0x3d')]('nolimit')){_0x49a39a['limit']=qs[_0xe6fc('0x20')](_0x342cd6[_0xe6fc('0x36')][_0xe6fc('0x20')]);_0x49a39a[_0xe6fc('0x1e')]=qs['offset'](_0x342cd6[_0xe6fc('0x36')][_0xe6fc('0x1e')]);}_0x49a39a[_0xe6fc('0x3e')]=qs[_0xe6fc('0x3f')](_0x342cd6[_0xe6fc('0x36')]['sort']);_0x49a39a['where']=qs[_0xe6fc('0x38')](_['pick'](_0x342cd6[_0xe6fc('0x36')],_0x2918a1['filters']),_0xec5b00);if(_0x342cd6[_0xe6fc('0x36')][_0xe6fc('0x40')]){_0x49a39a['where']=_[_0xe6fc('0x41')](_0x49a39a[_0xe6fc('0x42')],{'$or':_[_0xe6fc('0x31')](_0xec5b00,function(_0x9964ab){if(_0x9964ab[_0xe6fc('0x43')]!=='VIRTUAL'){var _0x36032f={};_0x36032f[_0x9964ab[_0xe6fc('0x2e')]]={'$like':'%'+_0x342cd6[_0xe6fc('0x36')][_0xe6fc('0x40')]+'%'};return _0x36032f;}})});}_0x49a39a=_[_0xe6fc('0x41')]({},_0x49a39a,_0x342cd6['options']);var _0x23ed23={'where':_0x49a39a['where']};return db[_0xe6fc('0x32')][_0xe6fc('0x21')](_0x23ed23)[_0xe6fc('0x44')](function(_0x462bdf){_0x8b8d56['count']=_0x462bdf;if(_0x342cd6[_0xe6fc('0x36')][_0xe6fc('0x45')]){_0x49a39a['include']=[{'all':!![]}];}return db[_0xe6fc('0x32')][_0xe6fc('0x46')](_0x49a39a);})[_0xe6fc('0x44')](function(_0x1f57d4){_0x8b8d56['rows']=_0x1f57d4;return _0x8b8d56;})[_0xe6fc('0x44')](respondWithFilteredResult(_0x9c2374,_0x49a39a))[_0xe6fc('0x47')](handleError(_0x9c2374,null));};exports[_0xe6fc('0x48')]=function(_0x4f0813,_0x329747){var _0x2d6b10={'raw':!![],'where':{'id':_0x4f0813[_0xe6fc('0x49')]['id']}},_0x555f35={};_0x555f35[_0xe6fc('0x39')]=_['keys'](db[_0xe6fc('0x32')]['rawAttributes']);_0x555f35[_0xe6fc('0x36')]=_[_0xe6fc('0x37')](_0x4f0813['query']);_0x555f35[_0xe6fc('0x38')]=_['intersection'](_0x555f35[_0xe6fc('0x39')],_0x555f35[_0xe6fc('0x36')]);_0x2d6b10[_0xe6fc('0x3a')]=_['intersection'](_0x555f35['model'],qs[_0xe6fc('0x4a')](_0x4f0813[_0xe6fc('0x36')]['fields']));_0x2d6b10[_0xe6fc('0x3a')]=_0x2d6b10[_0xe6fc('0x3a')]['length']?_0x2d6b10[_0xe6fc('0x3a')]:_0x555f35[_0xe6fc('0x39')];if(_0x4f0813[_0xe6fc('0x36')][_0xe6fc('0x45')]){_0x2d6b10['include']=[{'all':!![]}];}_0x2d6b10=_[_0xe6fc('0x41')]({},_0x2d6b10,_0x4f0813[_0xe6fc('0x4b')]);return db[_0xe6fc('0x32')][_0xe6fc('0x4c')](_0x2d6b10)[_0xe6fc('0x44')](handleEntityNotFound(_0x329747,null))[_0xe6fc('0x44')](respondWithResult(_0x329747,null))[_0xe6fc('0x47')](handleError(_0x329747,null));};exports[_0xe6fc('0x4d')]=function(_0x40da0b,_0x9512ad){return db[_0xe6fc('0x32')][_0xe6fc('0x4d')](_0x40da0b[_0xe6fc('0x4e')],{})['then'](function(_0x175723){var _0x7b7736=_0x40da0b[_0xe6fc('0x4f')][_0xe6fc('0x28')]({'plain':!![]});if(!_0x7b7736)throw new Error(_0xe6fc('0x50'));if(_0x7b7736[_0xe6fc('0x51')]===_0xe6fc('0x4f')){var _0xed5308=_0x175723[_0xe6fc('0x28')]({'plain':!![]});var _0x2b8baf=_0xe6fc('0x29');return db['UserProfileSection'][_0xe6fc('0x4c')]({'where':{'name':_0x2b8baf,'userProfileId':_0x7b7736[_0xe6fc('0x52')]},'raw':!![]})[_0xe6fc('0x44')](function(_0x511925){if(_0x511925&&_0x511925[_0xe6fc('0x53')]===0x0){return db[_0xe6fc('0x2a')][_0xe6fc('0x4d')]({'name':_0xed5308[_0xe6fc('0x2e')],'resourceId':_0xed5308['id'],'type':_0x511925[_0xe6fc('0x2e')],'sectionId':_0x511925['id']},{})[_0xe6fc('0x44')](function(){return _0x175723;});}else{return _0x175723;}})[_0xe6fc('0x47')](function(_0x1efd0b){logger[_0xe6fc('0x2c')](_0xe6fc('0x54'),_0x1efd0b);throw _0x1efd0b;});}return _0x175723;})[_0xe6fc('0x44')](respondWithResult(_0x9512ad,0xc9))[_0xe6fc('0x47')](handleError(_0x9512ad,null));};exports['update']=function(_0x47b3f4,_0x55db2b){if(_0x47b3f4['body']['id']){delete _0x47b3f4['body']['id'];}return db[_0xe6fc('0x32')][_0xe6fc('0x4c')]({'where':{'id':_0x47b3f4[_0xe6fc('0x49')]['id']}})[_0xe6fc('0x44')](handleEntityNotFound(_0x55db2b,null))[_0xe6fc('0x44')](saveUpdates(_0x47b3f4[_0xe6fc('0x4e')],null))[_0xe6fc('0x44')](respondWithResult(_0x55db2b,null))[_0xe6fc('0x47')](handleError(_0x55db2b,null));};exports[_0xe6fc('0x27')]=function(_0x550273,_0x416bcf){return db[_0xe6fc('0x32')]['find']({'where':{'id':_0x550273[_0xe6fc('0x49')]['id']}})[_0xe6fc('0x44')](handleEntityNotFound(_0x416bcf,null))[_0xe6fc('0x44')](removeEntity(_0x416bcf,null))['catch'](handleError(_0x416bcf,null));};exports['addInterval']=function(_0x520f51,_0x4829bf,_0x3770c1){if(_0x520f51[_0xe6fc('0x4e')]['id']){delete _0x520f51['body']['id'];}return db[_0xe6fc('0x32')]['find']({'where':{'id':_0x520f51['params']['id']}})[_0xe6fc('0x44')](handleEntityNotFound(_0x4829bf,null))[_0xe6fc('0x44')](function(_0x2af860){if(_0x2af860){_0x520f51[_0xe6fc('0x4e')][_0xe6fc('0x55')]=_0x2af860['id'];return db[_0xe6fc('0x32')][_0xe6fc('0x4d')](_0x520f51[_0xe6fc('0x4e')]);}})['then'](respondWithResult(_0x4829bf,null))[_0xe6fc('0x47')](handleError(_0x4829bf,null));};exports['getIntervals']=function(_0x3a0f34,_0x527c18,_0x5ab4a2){var _0x3f0c1a={};var _0x54f795={};var _0x2804bd;var _0x2a06d7;return db[_0xe6fc('0x32')][_0xe6fc('0x56')]({'where':{'id':_0x3a0f34['params']['id']}})[_0xe6fc('0x44')](handleEntityNotFound(_0x527c18,null))[_0xe6fc('0x44')](function(_0x328353){if(_0x328353){_0x2804bd=_0x328353;_0x54f795[_0xe6fc('0x39')]=_['keys'](db[_0xe6fc('0x32')]['rawAttributes']);_0x54f795[_0xe6fc('0x36')]=_[_0xe6fc('0x37')](_0x3a0f34[_0xe6fc('0x36')]);_0x54f795[_0xe6fc('0x38')]=_[_0xe6fc('0x3b')](_0x54f795[_0xe6fc('0x39')],_0x54f795[_0xe6fc('0x36')]);_0x3f0c1a[_0xe6fc('0x3a')]=_['intersection'](_0x54f795['model'],qs['fields'](_0x3a0f34[_0xe6fc('0x36')][_0xe6fc('0x4a')]));_0x3f0c1a[_0xe6fc('0x3a')]=_0x3f0c1a[_0xe6fc('0x3a')][_0xe6fc('0x3c')]?_0x3f0c1a[_0xe6fc('0x3a')]:_0x54f795[_0xe6fc('0x39')];_0x3f0c1a[_0xe6fc('0x3e')]=qs[_0xe6fc('0x3f')](_0x3a0f34[_0xe6fc('0x36')]['sort']);_0x3f0c1a[_0xe6fc('0x42')]=qs['filters'](_[_0xe6fc('0x57')](_0x3a0f34['query'],_0x54f795[_0xe6fc('0x38')]));if(_0x3a0f34[_0xe6fc('0x36')][_0xe6fc('0x40')]){_0x3f0c1a[_0xe6fc('0x42')]=_[_0xe6fc('0x41')](_0x3f0c1a['where'],{'$or':_[_0xe6fc('0x31')](_0x3f0c1a[_0xe6fc('0x3a')],function(_0x2e0f07){var _0x239d69={};_0x239d69[_0x2e0f07]={'$like':'%'+_0x3a0f34[_0xe6fc('0x36')][_0xe6fc('0x40')]+'%'};return _0x239d69;})});}_0x3f0c1a=_['merge']({},_0x3f0c1a,_0x3a0f34[_0xe6fc('0x4b')]);return _0x2804bd['getIntervals'](_0x3f0c1a);}})[_0xe6fc('0x44')](function(_0x570f99){if(_0x570f99){_0x2a06d7=_0x570f99[_0xe6fc('0x3c')];if(!_0x3a0f34[_0xe6fc('0x36')][_0xe6fc('0x3d')]('nolimit')){_0x3f0c1a[_0xe6fc('0x20')]=qs[_0xe6fc('0x20')](_0x3a0f34['query']['limit']);_0x3f0c1a[_0xe6fc('0x1e')]=qs[_0xe6fc('0x1e')](_0x3a0f34['query']['offset']);}return _0x2804bd[_0xe6fc('0x58')](_0x3f0c1a);}})[_0xe6fc('0x44')](function(_0x2900e3){if(_0x2900e3){return _0x2900e3?{'count':_0x2a06d7,'rows':_0x2900e3}:null;}})[_0xe6fc('0x44')](respondWithResult(_0x527c18,null))['catch'](handleError(_0x527c18,null));};exports[_0xe6fc('0x59')]=function(_0x334521,_0x4f7385,_0x3fd696){return db[_0xe6fc('0x32')][_0xe6fc('0x56')]({'where':{'id':_0x334521[_0xe6fc('0x49')]['id']}})['then'](handleEntityNotFound(_0x4f7385,null))['then'](function(_0x4ab395){if(_0x4ab395){return db[_0xe6fc('0x5a')][_0xe6fc('0x5b')](function(_0x5877ba){return db[_0xe6fc('0x32')][_0xe6fc('0x27')]({'where':{'IntervalId':_0x334521[_0xe6fc('0x49')]['id']},'transaction':_0x5877ba})[_0xe6fc('0x44')](function(_0x49a76b){var _0xb0668e=_[_0xe6fc('0x31')](_0x334521[_0xe6fc('0x4e')],function(_0x284d68){delete _0x284d68['id'];_0x284d68[_0xe6fc('0x55')]=_0x334521[_0xe6fc('0x49')]['id'];return _0x284d68;});return db[_0xe6fc('0x32')][_0xe6fc('0x5c')](_0xb0668e,{'transaction':_0x5877ba});});})[_0xe6fc('0x44')](function(){return db[_0xe6fc('0x32')][_0xe6fc('0x46')]({'where':{'IntervalId':_0x334521[_0xe6fc('0x49')]['id']}});});}})[_0xe6fc('0x44')](respondWithResult(_0x4f7385,null))['catch'](handleError(_0x4f7385,null));}; \ No newline at end of file +var _0x9145=['set','apply','destroy','then','get','Intervals','UserProfileResource','error','stack','name','send','index','map','Interval','rawAttributes','fieldName','type','query','keys','model','attributes','intersection','fields','length','hasOwnProperty','sort','where','filters','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','params','options','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','addInterval','IntervalId','order','pick','getIntervals','nolimit','findOne','transaction','bulkCreate','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','sendStatus','end','status','json','offset','limit','count'];(function(_0x20e0d9,_0x157105){var _0x2a39b3=function(_0x595e22){while(--_0x595e22){_0x20e0d9['push'](_0x20e0d9['shift']());}};_0x2a39b3(++_0x157105);}(_0x9145,0xe9));var _0x5914=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9145[_0x3947c9];return _0x2e7871;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5914('0x0'));var jsonpatch=require(_0x5914('0x1'));var rp=require(_0x5914('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5914('0x3'));var path=require(_0x5914('0x4'));var sox=require(_0x5914('0x5'));var csv=require(_0x5914('0x6'));var ejs=require(_0x5914('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5914('0x8'));var squel=require(_0x5914('0x9'));var crypto=require('crypto');var jsforce=require(_0x5914('0xa'));var deskjs=require(_0x5914('0xb'));var toCsv=require(_0x5914('0x6'));var querystring=require('querystring');var Papa=require(_0x5914('0xc'));var Redis=require(_0x5914('0xd'));var authService=require(_0x5914('0xe'));var qs=require(_0x5914('0xf'));var as=require(_0x5914('0x10'));var hardwareService=require(_0x5914('0x11'));var logger=require('../../config/logger')(_0x5914('0x12'));var utils=require(_0x5914('0x13'));var config=require(_0x5914('0x14'));var licenseUtil=require(_0x5914('0x15'));var db=require(_0x5914('0x16'))['db'];var extensions=require(_0x5914('0x17'));function respondWithStatusCode(_0x25499b,_0xdcfaca){_0xdcfaca=_0xdcfaca||0xcc;return function(_0x4ab5da){if(_0x4ab5da){return _0x25499b[_0x5914('0x18')](_0xdcfaca);}return _0x25499b['status'](_0xdcfaca)[_0x5914('0x19')]();};}function respondWithResult(_0x3d21c1,_0x407386){_0x407386=_0x407386||0xc8;return function(_0x3d93ec){if(_0x3d93ec){return _0x3d21c1[_0x5914('0x1a')](_0x407386)[_0x5914('0x1b')](_0x3d93ec);}};}function respondWithFilteredResult(_0x4a60df,_0x47c37a){return function(_0x256c2f){if(_0x256c2f){var _0x35d464=typeof _0x47c37a[_0x5914('0x1c')]==='undefined'&&typeof _0x47c37a[_0x5914('0x1d')]==='undefined';var _0x287a1f=_0x256c2f[_0x5914('0x1e')];var _0xa9aa51=_0x35d464?0x0:_0x47c37a[_0x5914('0x1c')];var _0x23d521=_0x35d464?_0x256c2f[_0x5914('0x1e')]:_0x47c37a[_0x5914('0x1c')]+_0x47c37a['limit'];var _0x4792d0;if(_0x23d521>=_0x287a1f){_0x23d521=_0x287a1f;_0x4792d0=0xc8;}else{_0x4792d0=0xce;}_0x4a60df[_0x5914('0x1a')](_0x4792d0);return _0x4a60df[_0x5914('0x1f')]('Content-Range',_0xa9aa51+'-'+_0x23d521+'/'+_0x287a1f)[_0x5914('0x1b')](_0x256c2f);}return null;};}function patchUpdates(_0x594951){return function(_0x17a24c){try{jsonpatch[_0x5914('0x20')](_0x17a24c,_0x594951,!![]);}catch(_0x1a48a7){return BPromise['reject'](_0x1a48a7);}return _0x17a24c['save']();};}function saveUpdates(_0x57d9e7,_0x16dc21){return function(_0x1da247){if(_0x1da247){return _0x1da247['update'](_0x57d9e7)['then'](function(_0x1a226e){return _0x1a226e;});}return null;};}function removeEntity(_0x5a3db1,_0x5d2b71){return function(_0x261193){if(_0x261193){return _0x261193[_0x5914('0x21')]()[_0x5914('0x22')](function(){var _0x2fcfed=_0x261193[_0x5914('0x23')]({'plain':!![]});var _0x5f2782=_0x5914('0x24');return db[_0x5914('0x25')][_0x5914('0x21')]({'where':{'type':_0x5f2782,'resourceId':_0x2fcfed['id']}})['then'](function(){return _0x261193;});})[_0x5914('0x22')](function(){_0x5a3db1[_0x5914('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x266bb6,_0x5ce015){return function(_0x186a89){if(!_0x186a89){_0x266bb6[_0x5914('0x18')](0x194);}return _0x186a89;};}function handleError(_0x354e15,_0x5438be){_0x5438be=_0x5438be||0x1f4;return function(_0x323bbc){logger[_0x5914('0x26')](_0x323bbc[_0x5914('0x27')]);if(_0x323bbc[_0x5914('0x28')]){delete _0x323bbc[_0x5914('0x28')];}_0x354e15[_0x5914('0x1a')](_0x5438be)[_0x5914('0x29')](_0x323bbc);};}exports[_0x5914('0x2a')]=function(_0x48928c,_0x19eae0){var _0x3b3530={},_0xcff3ac={},_0x1c98cc={'count':0x0,'rows':[]};var _0xb9c33=_[_0x5914('0x2b')](db[_0x5914('0x2c')][_0x5914('0x2d')],function(_0x4b55a8){return{'name':_0x4b55a8[_0x5914('0x2e')],'type':_0x4b55a8[_0x5914('0x2f')]['key']};});_0xcff3ac['model']=_[_0x5914('0x2b')](_0xb9c33,'name');_0xcff3ac[_0x5914('0x30')]=_[_0x5914('0x31')](_0x48928c[_0x5914('0x30')]);_0xcff3ac['filters']=_['intersection'](_0xcff3ac[_0x5914('0x32')],_0xcff3ac[_0x5914('0x30')]);_0x3b3530[_0x5914('0x33')]=_[_0x5914('0x34')](_0xcff3ac['model'],qs[_0x5914('0x35')](_0x48928c[_0x5914('0x30')][_0x5914('0x35')]));_0x3b3530[_0x5914('0x33')]=_0x3b3530[_0x5914('0x33')][_0x5914('0x36')]?_0x3b3530[_0x5914('0x33')]:_0xcff3ac[_0x5914('0x32')];if(!_0x48928c[_0x5914('0x30')][_0x5914('0x37')]('nolimit')){_0x3b3530['limit']=qs[_0x5914('0x1d')](_0x48928c[_0x5914('0x30')][_0x5914('0x1d')]);_0x3b3530[_0x5914('0x1c')]=qs[_0x5914('0x1c')](_0x48928c['query'][_0x5914('0x1c')]);}_0x3b3530['order']=qs[_0x5914('0x38')](_0x48928c['query']['sort']);_0x3b3530[_0x5914('0x39')]=qs[_0x5914('0x3a')](_['pick'](_0x48928c[_0x5914('0x30')],_0xcff3ac[_0x5914('0x3a')]),_0xb9c33);if(_0x48928c[_0x5914('0x30')]['filter']){_0x3b3530['where']=_[_0x5914('0x3b')](_0x3b3530[_0x5914('0x39')],{'$or':_[_0x5914('0x2b')](_0xb9c33,function(_0x42befd){if(_0x42befd['type']!==_0x5914('0x3c')){var _0x3dedfc={};_0x3dedfc[_0x42befd['name']]={'$like':'%'+_0x48928c[_0x5914('0x30')][_0x5914('0x3d')]+'%'};return _0x3dedfc;}})});}_0x3b3530=_[_0x5914('0x3b')]({},_0x3b3530,_0x48928c['options']);var _0x3ce814={'where':_0x3b3530[_0x5914('0x39')]};return db['Interval'][_0x5914('0x1e')](_0x3ce814)[_0x5914('0x22')](function(_0x3b2192){_0x1c98cc['count']=_0x3b2192;if(_0x48928c[_0x5914('0x30')][_0x5914('0x3e')]){_0x3b3530[_0x5914('0x3f')]=[{'all':!![]}];}return db[_0x5914('0x2c')][_0x5914('0x40')](_0x3b3530);})[_0x5914('0x22')](function(_0x261ad6){_0x1c98cc[_0x5914('0x41')]=_0x261ad6;return _0x1c98cc;})[_0x5914('0x22')](respondWithFilteredResult(_0x19eae0,_0x3b3530))[_0x5914('0x42')](handleError(_0x19eae0,null));};exports[_0x5914('0x43')]=function(_0x112c99,_0x5483e4){var _0x2342da={'raw':!![],'where':{'id':_0x112c99[_0x5914('0x44')]['id']}},_0x2f8e87={};_0x2f8e87[_0x5914('0x32')]=_['keys'](db['Interval']['rawAttributes']);_0x2f8e87[_0x5914('0x30')]=_[_0x5914('0x31')](_0x112c99[_0x5914('0x30')]);_0x2f8e87[_0x5914('0x3a')]=_[_0x5914('0x34')](_0x2f8e87[_0x5914('0x32')],_0x2f8e87[_0x5914('0x30')]);_0x2342da[_0x5914('0x33')]=_[_0x5914('0x34')](_0x2f8e87['model'],qs[_0x5914('0x35')](_0x112c99[_0x5914('0x30')][_0x5914('0x35')]));_0x2342da[_0x5914('0x33')]=_0x2342da[_0x5914('0x33')]['length']?_0x2342da[_0x5914('0x33')]:_0x2f8e87[_0x5914('0x32')];if(_0x112c99[_0x5914('0x30')][_0x5914('0x3e')]){_0x2342da[_0x5914('0x3f')]=[{'all':!![]}];}_0x2342da=_['merge']({},_0x2342da,_0x112c99[_0x5914('0x45')]);return db['Interval']['find'](_0x2342da)[_0x5914('0x22')](handleEntityNotFound(_0x5483e4,null))[_0x5914('0x22')](respondWithResult(_0x5483e4,null))[_0x5914('0x42')](handleError(_0x5483e4,null));};exports[_0x5914('0x46')]=function(_0x3d3b5e,_0x49c36f){return db[_0x5914('0x2c')][_0x5914('0x46')](_0x3d3b5e['body'],{})[_0x5914('0x22')](function(_0x15b213){var _0x5f0a94=_0x3d3b5e[_0x5914('0x47')][_0x5914('0x23')]({'plain':!![]});if(!_0x5f0a94)throw new Error(_0x5914('0x48'));if(_0x5f0a94[_0x5914('0x49')]===_0x5914('0x47')){var _0x52005d=_0x15b213[_0x5914('0x23')]({'plain':!![]});var _0xd9153c='Intervals';return db['UserProfileSection'][_0x5914('0x4a')]({'where':{'name':_0xd9153c,'userProfileId':_0x5f0a94[_0x5914('0x4b')]},'raw':!![]})[_0x5914('0x22')](function(_0x269dc7){if(_0x269dc7&&_0x269dc7['autoAssociation']===0x0){return db['UserProfileResource'][_0x5914('0x46')]({'name':_0x52005d[_0x5914('0x28')],'resourceId':_0x52005d['id'],'type':_0x269dc7[_0x5914('0x28')],'sectionId':_0x269dc7['id']},{})[_0x5914('0x22')](function(){return _0x15b213;});}else{return _0x15b213;}})[_0x5914('0x42')](function(_0x15b13b){logger[_0x5914('0x26')](_0x5914('0x4c'),_0x15b13b);throw _0x15b13b;});}return _0x15b213;})[_0x5914('0x22')](respondWithResult(_0x49c36f,0xc9))['catch'](handleError(_0x49c36f,null));};exports[_0x5914('0x4d')]=function(_0x7d6f25,_0x26f9c3){if(_0x7d6f25['body']['id']){delete _0x7d6f25[_0x5914('0x4e')]['id'];}return db[_0x5914('0x2c')][_0x5914('0x4a')]({'where':{'id':_0x7d6f25[_0x5914('0x44')]['id']}})[_0x5914('0x22')](handleEntityNotFound(_0x26f9c3,null))[_0x5914('0x22')](saveUpdates(_0x7d6f25[_0x5914('0x4e')],null))[_0x5914('0x22')](respondWithResult(_0x26f9c3,null))[_0x5914('0x42')](handleError(_0x26f9c3,null));};exports['destroy']=function(_0x34e6ef,_0xbde8ed){return db['Interval']['find']({'where':{'id':_0x34e6ef[_0x5914('0x44')]['id']}})[_0x5914('0x22')](handleEntityNotFound(_0xbde8ed,null))[_0x5914('0x22')](removeEntity(_0xbde8ed,null))['catch'](handleError(_0xbde8ed,null));};exports[_0x5914('0x4f')]=function(_0x163376,_0x504aca,_0x3629f5){if(_0x163376[_0x5914('0x4e')]['id']){delete _0x163376[_0x5914('0x4e')]['id'];}return db['Interval'][_0x5914('0x4a')]({'where':{'id':_0x163376['params']['id']}})[_0x5914('0x22')](handleEntityNotFound(_0x504aca,null))[_0x5914('0x22')](function(_0x1ef294){if(_0x1ef294){_0x163376['body'][_0x5914('0x50')]=_0x1ef294['id'];return db['Interval'][_0x5914('0x46')](_0x163376[_0x5914('0x4e')]);}})[_0x5914('0x22')](respondWithResult(_0x504aca,null))[_0x5914('0x42')](handleError(_0x504aca,null));};exports['getIntervals']=function(_0x5f31c3,_0x32b15c,_0x429ce1){var _0x288638={};var _0x4ba7a9={};var _0x4d6517;var _0x5c71e0;return db['Interval']['findOne']({'where':{'id':_0x5f31c3[_0x5914('0x44')]['id']}})[_0x5914('0x22')](handleEntityNotFound(_0x32b15c,null))[_0x5914('0x22')](function(_0xb9c494){if(_0xb9c494){_0x4d6517=_0xb9c494;_0x4ba7a9[_0x5914('0x32')]=_[_0x5914('0x31')](db[_0x5914('0x2c')][_0x5914('0x2d')]);_0x4ba7a9[_0x5914('0x30')]=_[_0x5914('0x31')](_0x5f31c3[_0x5914('0x30')]);_0x4ba7a9['filters']=_[_0x5914('0x34')](_0x4ba7a9[_0x5914('0x32')],_0x4ba7a9[_0x5914('0x30')]);_0x288638[_0x5914('0x33')]=_[_0x5914('0x34')](_0x4ba7a9[_0x5914('0x32')],qs['fields'](_0x5f31c3['query']['fields']));_0x288638[_0x5914('0x33')]=_0x288638[_0x5914('0x33')]['length']?_0x288638['attributes']:_0x4ba7a9['model'];_0x288638[_0x5914('0x51')]=qs[_0x5914('0x38')](_0x5f31c3[_0x5914('0x30')][_0x5914('0x38')]);_0x288638[_0x5914('0x39')]=qs[_0x5914('0x3a')](_[_0x5914('0x52')](_0x5f31c3[_0x5914('0x30')],_0x4ba7a9[_0x5914('0x3a')]));if(_0x5f31c3[_0x5914('0x30')][_0x5914('0x3d')]){_0x288638[_0x5914('0x39')]=_[_0x5914('0x3b')](_0x288638[_0x5914('0x39')],{'$or':_[_0x5914('0x2b')](_0x288638[_0x5914('0x33')],function(_0xde8768){var _0x11b02e={};_0x11b02e[_0xde8768]={'$like':'%'+_0x5f31c3[_0x5914('0x30')][_0x5914('0x3d')]+'%'};return _0x11b02e;})});}_0x288638=_[_0x5914('0x3b')]({},_0x288638,_0x5f31c3[_0x5914('0x45')]);return _0x4d6517[_0x5914('0x53')](_0x288638);}})[_0x5914('0x22')](function(_0x1e2b96){if(_0x1e2b96){_0x5c71e0=_0x1e2b96[_0x5914('0x36')];if(!_0x5f31c3[_0x5914('0x30')]['hasOwnProperty'](_0x5914('0x54'))){_0x288638['limit']=qs[_0x5914('0x1d')](_0x5f31c3['query'][_0x5914('0x1d')]);_0x288638[_0x5914('0x1c')]=qs[_0x5914('0x1c')](_0x5f31c3[_0x5914('0x30')][_0x5914('0x1c')]);}return _0x4d6517[_0x5914('0x53')](_0x288638);}})[_0x5914('0x22')](function(_0x1c8e4f){if(_0x1c8e4f){return _0x1c8e4f?{'count':_0x5c71e0,'rows':_0x1c8e4f}:null;}})[_0x5914('0x22')](respondWithResult(_0x32b15c,null))[_0x5914('0x42')](handleError(_0x32b15c,null));};exports['addIntervals']=function(_0x3e65eb,_0x2e54fd,_0x18900c){return db[_0x5914('0x2c')][_0x5914('0x55')]({'where':{'id':_0x3e65eb[_0x5914('0x44')]['id']}})[_0x5914('0x22')](handleEntityNotFound(_0x2e54fd,null))[_0x5914('0x22')](function(_0x34792f){if(_0x34792f){return db['sequelize'][_0x5914('0x56')](function(_0x59fe2f){return db[_0x5914('0x2c')][_0x5914('0x21')]({'where':{'IntervalId':_0x3e65eb[_0x5914('0x44')]['id']},'transaction':_0x59fe2f})['then'](function(_0x3e4aad){var _0x58e802=_[_0x5914('0x2b')](_0x3e65eb[_0x5914('0x4e')],function(_0x2ea38a){delete _0x2ea38a['id'];_0x2ea38a['IntervalId']=_0x3e65eb['params']['id'];return _0x2ea38a;});return db[_0x5914('0x2c')][_0x5914('0x57')](_0x58e802,{'transaction':_0x59fe2f});});})['then'](function(){return db['Interval'][_0x5914('0x40')]({'where':{'IntervalId':_0x3e65eb[_0x5914('0x44')]['id']}});});}})['then'](respondWithResult(_0x2e54fd,null))[_0x5914('0x42')](handleError(_0x2e54fd,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index e9a496c..0824c87 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 _0xf77b=['iftime','exports','define','Interval','tools_intervals','rewrite','interval','string','map','then','./interval.attributes','../../components/extensions/rewrite','../../utils/iftime'];(function(_0x2543d6,_0x3a5e78){var _0x55213c=function(_0x292768){while(--_0x292768){_0x2543d6['push'](_0x2543d6['shift']());}};_0x55213c(++_0x3a5e78);}(_0xf77b,0x7f));var _0xbf77=function(_0x16e57d,_0x2cb7ba){_0x16e57d=_0x16e57d-0x0;var _0x40239c=_0xf77b[_0x16e57d];return _0x40239c;};'use strict';var attributes=require(_0xbf77('0x0'));var extensions=require(_0xbf77('0x1'));var iftime=require(_0xbf77('0x2'))[_0xbf77('0x3')];module[_0xbf77('0x4')]=function(_0x3c9363){return _0x3c9363[_0xbf77('0x5')](_0xbf77('0x6'),attributes,{'tableName':_0xbf77('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x5cb778){extensions['rewrite'](_0x3c9363,_0x5cb778);},'afterBulkCreate':function(_0x141ab5,_0x3c726b,_0x53d50e){_0x53d50e();extensions['rewrite'](_0x3c9363,_0x141ab5[0x0]);},'afterUpdate':function(_0x2760c8){extensions[_0xbf77('0x8')](_0x3c9363,_0x2760c8);},'afterDestroy':function(_0x5b6b4b){extensions[_0xbf77('0x8')](_0x3c9363,_0x5b6b4b);}},'instanceMethods':{'ifTime':function(_0x2a4af0=undefined,_0x492da7=new Date()){if(typeof this[_0xbf77('0x9')]===_0xbf77('0xa')){return iftime(this[_0xbf77('0x9')],_0x2a4af0,_0x492da7);}else{return this['getIntervals']()['then'](function(_0x464956){return Promise['all'](_0x464956[_0xbf77('0xb')](function(_0x507911){return _0x507911['ifTime'](_0x2a4af0,_0x492da7);}));})[_0xbf77('0xc')](function(_0x55f6fc){return _0x55f6fc['reduce'](function(_0x26adca,_0x2c5f04){return _0x26adca||_0x2c5f04;},![]);});}}}});}; \ No newline at end of file +var _0xe6fe=['../../utils/iftime','exports','Interval','tools_intervals','rewrite','interval','getIntervals','all','map','ifTime','then','reduce','./interval.attributes'];(function(_0x4cafa7,_0x5a979b){var _0x216344=function(_0x5e6667){while(--_0x5e6667){_0x4cafa7['push'](_0x4cafa7['shift']());}};_0x216344(++_0x5a979b);}(_0xe6fe,0xe9));var _0xee6f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe6fe[_0x14add3];return _0x4a174f;};'use strict';var attributes=require(_0xee6f('0x0'));var extensions=require('../../components/extensions/rewrite');var iftime=require(_0xee6f('0x1'))['iftime'];module[_0xee6f('0x2')]=function(_0x47f23b){return _0x47f23b['define'](_0xee6f('0x3'),attributes,{'tableName':_0xee6f('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x586f62){extensions[_0xee6f('0x5')](_0x47f23b,_0x586f62);},'afterBulkCreate':function(_0x381de0,_0x2505cc,_0x1476eb){_0x1476eb();extensions[_0xee6f('0x5')](_0x47f23b,_0x381de0[0x0]);},'afterUpdate':function(_0x42b122){extensions[_0xee6f('0x5')](_0x47f23b,_0x42b122);},'afterDestroy':function(_0x2c422b){extensions[_0xee6f('0x5')](_0x47f23b,_0x2c422b);}},'instanceMethods':{'ifTime':function(_0x287818=undefined,_0x3b3a6f=new Date()){if(typeof this[_0xee6f('0x6')]==='string'){return iftime(this[_0xee6f('0x6')],_0x287818,_0x3b3a6f);}else{return this[_0xee6f('0x7')]()['then'](function(_0x1ef08f){return Promise[_0xee6f('0x8')](_0x1ef08f[_0xee6f('0x9')](function(_0x51d5b5){return _0x51d5b5[_0xee6f('0xa')](_0x287818,_0x3b3a6f);}));})[_0xee6f('0xb')](function(_0x5829bc){return _0x5829bc[_0xee6f('0xc')](function(_0x42561a,_0x4b6aa0){return _0x42561a||_0x4b6aa0;},![]);});}}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 4244845..47851e2 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 _0x2253=['IntervalIftime:\x20interval\x20strings\x20=\x20%s','Iftime','silly','resolve','lodash','util','../../utils/iftime','iftime','rpc','GetInterval','Interval','findAll','options','raw','where','attributes','include','map','model','then','info','debug','stringify','catch','error','message','ShowInterval','find','all','ifTime','reduce','format','IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)','name','join','findById','IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)','IntervalIftime','intervalIds','isArray','intervals','string','timezone','length'];(function(_0x497573,_0x2f1f5f){var _0x38b7ab=function(_0xb9b0bb){while(--_0xb9b0bb){_0x497573['push'](_0x497573['shift']());}};_0x38b7ab(++_0x2f1f5f);}(_0x2253,0x1bc));var _0x3225=function(_0x20ed51,_0x4326e8){_0x20ed51=_0x20ed51-0x0;var _0x5b2477=_0x2253[_0x20ed51];return _0x5b2477;};'use strict';var _=require(_0x3225('0x0'));var util=require(_0x3225('0x1'));var db=require('../../mysqldb')['db'];var iftime=require(_0x3225('0x2'))[_0x3225('0x3')];var logger=require('../../config/logger')(_0x3225('0x4'));exports[_0x3225('0x5')]=function(_0x44ec97){var _0x49dcec=this;return new Promise(function(_0x25f89a,_0x1a0116){return db[_0x3225('0x6')][_0x3225('0x7')]({'raw':_0x44ec97[_0x3225('0x8')]?_0x44ec97[_0x3225('0x8')][_0x3225('0x9')]===undefined?!![]:![]:!![],'where':_0x44ec97['options']?_0x44ec97['options'][_0x3225('0xa')]||null:null,'attributes':_0x44ec97[_0x3225('0x8')]?_0x44ec97[_0x3225('0x8')][_0x3225('0xb')]||null:null,'limit':_0x44ec97[_0x3225('0x8')]?_0x44ec97[_0x3225('0x8')]['limit']||null:null,'include':_0x44ec97[_0x3225('0x8')]?_0x44ec97[_0x3225('0x8')][_0x3225('0xc')]?_[_0x3225('0xd')](_0x44ec97[_0x3225('0x8')][_0x3225('0xc')],function(_0x44ce3f){return{'model':db[_0x44ce3f['model']],'as':_0x44ce3f['as'],'attributes':_0x44ce3f['attributes'],'include':_0x44ce3f['include']?_[_0x3225('0xd')](_0x44ce3f['include'],function(_0x2201e0){return{'model':db[_0x2201e0[_0x3225('0xe')]],'as':_0x2201e0['as'],'attributes':_0x2201e0[_0x3225('0xb')],'include':_0x2201e0[_0x3225('0xc')]?_[_0x3225('0xd')](_0x2201e0[_0x3225('0xc')],function(_0x1481be){return{'model':db[_0x1481be[_0x3225('0xe')]],'as':_0x1481be['as'],'attributes':_0x1481be[_0x3225('0xb')]};}):[]};}):[]};}):[]:[]})[_0x3225('0xf')](function(_0x428e1a){logger[_0x3225('0x10')]('GetInterval',_0x44ec97);logger[_0x3225('0x11')](_0x3225('0x5'),_0x44ec97,JSON[_0x3225('0x12')](_0x428e1a));_0x25f89a(_0x428e1a);})[_0x3225('0x13')](function(_0x7f4cf4){logger[_0x3225('0x14')](_0x3225('0x5'),_0x7f4cf4[_0x3225('0x15')],_0x44ec97);_0x1a0116(_0x49dcec[_0x3225('0x14')](0x1f4,_0x7f4cf4[_0x3225('0x15')]));});});};exports[_0x3225('0x16')]=function(_0x338a96){var _0x33ebeb=this;return new Promise(function(_0x3f4010,_0x3b6e62){return db['Interval'][_0x3225('0x17')]({'raw':_0x338a96['options']?_0x338a96[_0x3225('0x8')][_0x3225('0x9')]===undefined?!![]:![]:!![],'where':_0x338a96[_0x3225('0x8')]?_0x338a96['options']['where']||null:null,'attributes':_0x338a96[_0x3225('0x8')]?_0x338a96[_0x3225('0x8')][_0x3225('0xb')]||null:null,'include':_0x338a96[_0x3225('0x8')]?_0x338a96[_0x3225('0x8')][_0x3225('0xc')]?_[_0x3225('0xd')](_0x338a96[_0x3225('0x8')]['include'],function(_0x479418){return{'model':db[_0x479418[_0x3225('0xe')]],'as':_0x479418['as'],'attributes':_0x479418[_0x3225('0xb')],'include':_0x479418[_0x3225('0xc')]?_[_0x3225('0xd')](_0x479418[_0x3225('0xc')],function(_0x317798){return{'model':db[_0x317798[_0x3225('0xe')]],'as':_0x317798['as'],'attributes':_0x317798[_0x3225('0xb')],'include':_0x317798[_0x3225('0xc')]?_[_0x3225('0xd')](_0x317798[_0x3225('0xc')],function(_0x24725){return{'model':db[_0x24725[_0x3225('0xe')]],'as':_0x24725['as'],'attributes':_0x24725[_0x3225('0xb')]};}):[]};}):[]};}):[]:[]})[_0x3225('0xf')](function(_0x5d6221){logger[_0x3225('0x10')]('ShowInterval',_0x338a96);logger['debug']('ShowInterval',_0x338a96,JSON[_0x3225('0x12')](_0x5d6221));_0x3f4010(_0x5d6221);})[_0x3225('0x13')](function(_0x10285b){logger[_0x3225('0x14')](_0x3225('0x16'),_0x10285b['message'],_0x338a96);_0x3b6e62(_0x33ebeb['error'](0x1f4,_0x10285b[_0x3225('0x15')]));});});};function checkArrayOfIntervals(_0x2ed61f,_0x4f1b1a){var _0x1102f4=[];return db[_0x3225('0x6')]['findAll']({'where':{'id':_0x2ed61f}})[_0x3225('0xf')](function(_0x1f718e){_0x1102f4=_0x1f718e;return Promise[_0x3225('0x18')](_0x1102f4[_0x3225('0xd')](function(_0x5b07d9){return _0x5b07d9[_0x3225('0x19')](_0x4f1b1a);}));})[_0x3225('0xf')](function(_0x296ea7){var _0x3bb34d=_0x296ea7[_0x3225('0x1a')](function(_0x46a87b,_0x1ee67e){return _0x46a87b||_0x1ee67e;},![]);logger[_0x3225('0x10')](util[_0x3225('0x1b')](_0x3225('0x1c'),_0x1102f4[_0x3225('0xd')](function(_0x1f7660){return _0x1f7660[_0x3225('0x1d')];})[_0x3225('0x1e')](',\x20'),_0x1102f4[_0x3225('0xd')](function(_0x1c2fd){return _0x1c2fd['id'];})[_0x3225('0x1e')](',\x20')));return _0x3bb34d;});}function checkSingleInterval(_0x566f39,_0x1da127){return db[_0x3225('0x6')][_0x3225('0x1f')](_0x566f39)[_0x3225('0xf')](function(_0x24fe0a){if(_0x24fe0a){logger[_0x3225('0x10')](util[_0x3225('0x1b')](_0x3225('0x20'),_0x24fe0a[_0x3225('0x1d')],_0x24fe0a['id']));return _0x24fe0a['ifTime'](_0x1da127);}});}exports[_0x3225('0x21')]=function(_0x5e65bd){var _0x158648=_0x5e65bd[_0x3225('0x22')];var _0x3e9895=Array[_0x3225('0x23')](_0x5e65bd[_0x3225('0x24')])?_0x5e65bd[_0x3225('0x24')]:typeof _0x5e65bd['intervals']===_0x3225('0x25')?[_0x5e65bd[_0x3225('0x24')]]:[];var _0x60d0d3=_0x5e65bd[_0x3225('0x26')]||undefined;var _0x3db546=![];if(_0x3e9895[_0x3225('0x27')]){logger[_0x3225('0x10')](util['format'](_0x3225('0x28'),_0x3e9895[_0x3225('0x1e')](';\x20')));}if(_0x60d0d3){logger[_0x3225('0x10')](util[_0x3225('0x1b')]('IntervalIftime:\x20timezone\x20=\x20%s',_0x60d0d3));}logger[_0x3225('0x11')](_0x3225('0x29'),_0x3db546);logger[_0x3225('0x2a')]('IntervalIftime',_0x5e65bd);return Promise[_0x3225('0x2b')]()['then'](function(){if(Array[_0x3225('0x23')](_0x158648)){return checkArrayOfIntervals(_0x158648,_0x60d0d3);}else if(_0x158648){return checkSingleInterval(_0x158648,_0x60d0d3);}})['then'](function(_0x41a2bf){var _0x59a15c=_0x3e9895[_0x3225('0x1a')](function(_0x43c406,_0x3ad590){return _0x43c406||iftime(_0x3ad590,_0x60d0d3);},![]);_0x3db546=_0x41a2bf||_0x59a15c;return _0x3db546;})[_0x3225('0x13')](function(_0x2af1d0){logger[_0x3225('0x14')](_0x3225('0x21'),_0x5e65bd,_0x2af1d0);throw this[_0x3225('0x14')](0x1f4,_0x2af1d0[_0x3225('0x15')]);});}; \ No newline at end of file +var _0x4dbf=['IntervalIftime:\x20timezone\x20=\x20%s','Iftime','lodash','util','rpc','findAll','options','raw','where','limit','include','map','model','attributes','then','info','GetInterval','catch','message','error','find','ShowInterval','debug','stringify','Interval','all','reduce','format','name','join','findById','ifTime','IntervalIftime','isArray','intervals','string','timezone','length'];(function(_0xaed1fc,_0x4c74c2){var _0x1d5200=function(_0x875a59){while(--_0x875a59){_0xaed1fc['push'](_0xaed1fc['shift']());}};_0x1d5200(++_0x4c74c2);}(_0x4dbf,0x1ca));var _0xf4db=function(_0x5d6e30,_0xc21d51){_0x5d6e30=_0x5d6e30-0x0;var _0x3d3f3b=_0x4dbf[_0x5d6e30];return _0x3d3f3b;};'use strict';var _=require(_0xf4db('0x0'));var util=require(_0xf4db('0x1'));var db=require('../../mysqldb')['db'];var iftime=require('../../utils/iftime')['iftime'];var logger=require('../../config/logger')(_0xf4db('0x2'));exports['GetInterval']=function(_0x42fc5e){var _0x1b75f4=this;return new Promise(function(_0x2bcb75,_0x1761d0){return db['Interval'][_0xf4db('0x3')]({'raw':_0x42fc5e[_0xf4db('0x4')]?_0x42fc5e[_0xf4db('0x4')][_0xf4db('0x5')]===undefined?!![]:![]:!![],'where':_0x42fc5e['options']?_0x42fc5e[_0xf4db('0x4')][_0xf4db('0x6')]||null:null,'attributes':_0x42fc5e[_0xf4db('0x4')]?_0x42fc5e[_0xf4db('0x4')]['attributes']||null:null,'limit':_0x42fc5e['options']?_0x42fc5e[_0xf4db('0x4')][_0xf4db('0x7')]||null:null,'include':_0x42fc5e['options']?_0x42fc5e[_0xf4db('0x4')][_0xf4db('0x8')]?_[_0xf4db('0x9')](_0x42fc5e[_0xf4db('0x4')]['include'],function(_0x1cc19b){return{'model':db[_0x1cc19b[_0xf4db('0xa')]],'as':_0x1cc19b['as'],'attributes':_0x1cc19b[_0xf4db('0xb')],'include':_0x1cc19b[_0xf4db('0x8')]?_['map'](_0x1cc19b['include'],function(_0x5eff94){return{'model':db[_0x5eff94[_0xf4db('0xa')]],'as':_0x5eff94['as'],'attributes':_0x5eff94[_0xf4db('0xb')],'include':_0x5eff94['include']?_[_0xf4db('0x9')](_0x5eff94[_0xf4db('0x8')],function(_0x29986a){return{'model':db[_0x29986a[_0xf4db('0xa')]],'as':_0x29986a['as'],'attributes':_0x29986a[_0xf4db('0xb')]};}):[]};}):[]};}):[]:[]})[_0xf4db('0xc')](function(_0x28c719){logger[_0xf4db('0xd')](_0xf4db('0xe'),_0x42fc5e);logger['debug'](_0xf4db('0xe'),_0x42fc5e,JSON['stringify'](_0x28c719));_0x2bcb75(_0x28c719);})[_0xf4db('0xf')](function(_0x3ac028){logger['error'](_0xf4db('0xe'),_0x3ac028[_0xf4db('0x10')],_0x42fc5e);_0x1761d0(_0x1b75f4[_0xf4db('0x11')](0x1f4,_0x3ac028[_0xf4db('0x10')]));});});};exports['ShowInterval']=function(_0x25965a){var _0x4054b9=this;return new Promise(function(_0x2e2a97,_0xb06103){return db['Interval'][_0xf4db('0x12')]({'raw':_0x25965a[_0xf4db('0x4')]?_0x25965a[_0xf4db('0x4')]['raw']===undefined?!![]:![]:!![],'where':_0x25965a['options']?_0x25965a[_0xf4db('0x4')][_0xf4db('0x6')]||null:null,'attributes':_0x25965a[_0xf4db('0x4')]?_0x25965a['options'][_0xf4db('0xb')]||null:null,'include':_0x25965a[_0xf4db('0x4')]?_0x25965a['options'][_0xf4db('0x8')]?_[_0xf4db('0x9')](_0x25965a[_0xf4db('0x4')][_0xf4db('0x8')],function(_0x216f90){return{'model':db[_0x216f90[_0xf4db('0xa')]],'as':_0x216f90['as'],'attributes':_0x216f90[_0xf4db('0xb')],'include':_0x216f90[_0xf4db('0x8')]?_[_0xf4db('0x9')](_0x216f90[_0xf4db('0x8')],function(_0x5ac453){return{'model':db[_0x5ac453[_0xf4db('0xa')]],'as':_0x5ac453['as'],'attributes':_0x5ac453[_0xf4db('0xb')],'include':_0x5ac453[_0xf4db('0x8')]?_[_0xf4db('0x9')](_0x5ac453[_0xf4db('0x8')],function(_0x2105c8){return{'model':db[_0x2105c8['model']],'as':_0x2105c8['as'],'attributes':_0x2105c8[_0xf4db('0xb')]};}):[]};}):[]};}):[]:[]})[_0xf4db('0xc')](function(_0x4e5671){logger['info'](_0xf4db('0x13'),_0x25965a);logger[_0xf4db('0x14')](_0xf4db('0x13'),_0x25965a,JSON[_0xf4db('0x15')](_0x4e5671));_0x2e2a97(_0x4e5671);})['catch'](function(_0x1b7f15){logger['error'](_0xf4db('0x13'),_0x1b7f15[_0xf4db('0x10')],_0x25965a);_0xb06103(_0x4054b9[_0xf4db('0x11')](0x1f4,_0x1b7f15[_0xf4db('0x10')]));});});};function checkArrayOfIntervals(_0x4b7d7b,_0x3e8b27){var _0x5794bb=[];return db[_0xf4db('0x16')][_0xf4db('0x3')]({'where':{'id':_0x4b7d7b}})[_0xf4db('0xc')](function(_0x17bd88){_0x5794bb=_0x17bd88;return Promise[_0xf4db('0x17')](_0x5794bb[_0xf4db('0x9')](function(_0x528a28){return _0x528a28['ifTime'](_0x3e8b27);}));})['then'](function(_0x45a6fe){var _0x106b7f=_0x45a6fe[_0xf4db('0x18')](function(_0x2be1c6,_0x1872f6){return _0x2be1c6||_0x1872f6;},![]);logger[_0xf4db('0xd')](util[_0xf4db('0x19')]('IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)',_0x5794bb[_0xf4db('0x9')](function(_0x35df91){return _0x35df91[_0xf4db('0x1a')];})[_0xf4db('0x1b')](',\x20'),_0x5794bb[_0xf4db('0x9')](function(_0x253080){return _0x253080['id'];})[_0xf4db('0x1b')](',\x20')));return _0x106b7f;});}function checkSingleInterval(_0x4f8b84,_0x1a2f7f){return db[_0xf4db('0x16')][_0xf4db('0x1c')](_0x4f8b84)[_0xf4db('0xc')](function(_0x36ba58){if(_0x36ba58){logger['info'](util['format']('IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)',_0x36ba58['name'],_0x36ba58['id']));return _0x36ba58[_0xf4db('0x1d')](_0x1a2f7f);}});}exports[_0xf4db('0x1e')]=function(_0x325cc2){var _0xad5282=_0x325cc2['intervalIds'];var _0x3a334b=Array[_0xf4db('0x1f')](_0x325cc2['intervals'])?_0x325cc2[_0xf4db('0x20')]:typeof _0x325cc2[_0xf4db('0x20')]===_0xf4db('0x21')?[_0x325cc2[_0xf4db('0x20')]]:[];var _0xa50e70=_0x325cc2[_0xf4db('0x22')]||undefined;var _0x2b154e=![];if(_0x3a334b[_0xf4db('0x23')]){logger['info'](util[_0xf4db('0x19')]('IntervalIftime:\x20interval\x20strings\x20=\x20%s',_0x3a334b['join'](';\x20')));}if(_0xa50e70){logger[_0xf4db('0xd')](util[_0xf4db('0x19')](_0xf4db('0x24'),_0xa50e70));}logger[_0xf4db('0x14')](_0xf4db('0x25'),_0x2b154e);logger['silly'](_0xf4db('0x1e'),_0x325cc2);return Promise['resolve']()[_0xf4db('0xc')](function(){if(Array[_0xf4db('0x1f')](_0xad5282)){return checkArrayOfIntervals(_0xad5282,_0xa50e70);}else if(_0xad5282){return checkSingleInterval(_0xad5282,_0xa50e70);}})[_0xf4db('0xc')](function(_0x2064e0){var _0x27b9ff=_0x3a334b['reduce'](function(_0x2f2885,_0x4aac45){return _0x2f2885||iftime(_0x4aac45,_0xa50e70);},![]);_0x2b154e=_0x2064e0||_0x27b9ff;return _0x2b154e;})[_0xf4db('0xf')](function(_0x46e856){logger[_0xf4db('0x11')](_0xf4db('0x1e'),_0x325cc2,_0x46e856);throw this[_0xf4db('0x11')](0x1f4,_0x46e856[_0xf4db('0x10')]);});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index 2a9cb8a..a2af03f 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 _0x0b0e=['exports','express','../../components/auth/service','post','isAuthenticated','send'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0x0b0e,0x187));var _0xe0b0=function(_0x34e14d,_0x5dea39){_0x34e14d=_0x34e14d-0x0;var _0x3d8e08=_0x0b0e[_0x34e14d];return _0x3d8e08;};'use strict';var express=require(_0xe0b0('0x0'));var router=express['Router']();var auth=require(_0xe0b0('0x1'));var controller=require('./jira.controller');router[_0xe0b0('0x2')]('/',auth[_0xe0b0('0x3')](),controller[_0xe0b0('0x4')]);module[_0xe0b0('0x5')]=router; \ No newline at end of file +var _0xdb28=['isAuthenticated','send','exports','express','Router','../../components/auth/service','./jira.controller'];(function(_0x43dfff,_0x4e34b7){var _0x4d6c50=function(_0x2a2709){while(--_0x2a2709){_0x43dfff['push'](_0x43dfff['shift']());}};_0x4d6c50(++_0x4e34b7);}(_0xdb28,0x106));var _0x8db2=function(_0x1f9bf1,_0x1db9a8){_0x1f9bf1=_0x1f9bf1-0x0;var _0x323970=_0xdb28[_0x1f9bf1];return _0x323970;};'use strict';var express=require(_0x8db2('0x0'));var router=express[_0x8db2('0x1')]();var auth=require(_0x8db2('0x2'));var controller=require(_0x8db2('0x3'));router['post']('/',auth[_0x8db2('0x4')](),controller[_0x8db2('0x5')]);module[_0x8db2('0x6')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index b3b2ecd..cb5ae4d 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 _0x5ef0=['Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','write','end','openIssue','send','headers','x-forwarded-for','connection','remoteAddress','socket','body','bluebird','https','../../config/logger','api','3eAmWpBVP0','key','summary','Report','\x20from\x20','description','issuetype','fields','customfield_11500','email','customfield_11501','customfield_11502','newToken','customfield_11503','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','application/json','Basic\x20','toString','base64','stringify','request','setEncoding','utf8','statusCode','parse','error','json'];(function(_0x5c6434,_0x24e29f){var _0x25e4ea=function(_0x4c6b2e){while(--_0x4c6b2e){_0x5c6434['push'](_0x5c6434['shift']());}};_0x25e4ea(++_0x24e29f);}(_0x5ef0,0x8f));var _0x05ef=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x5ef0[_0x20a584];return _0x4b41a8;};'use strict';var BPromise=require(_0x05ef('0x0'));var https=require(_0x05ef('0x1'));var logger=require(_0x05ef('0x2'))(_0x05ef('0x3'));var USERNAME='support';var PASSWORD=_0x05ef('0x4');function openIssue(_0x3cd610,_0x20c173){var _0x4dc517={'fields':{'project':{'key':_0x3cd610[_0x05ef('0x5')]||'MOTGUI'},'summary':(_0x3cd610[_0x05ef('0x6')]||_0x05ef('0x7'))+_0x05ef('0x8')+_0x3cd610['ip'],'description':_0x3cd610[_0x05ef('0x9')]||JSON['stringify'](_0x3cd610),'issuetype':{'name':_0x3cd610[_0x05ef('0xa')]||'Bug'}}};_0x4dc517[_0x05ef('0xb')][_0x05ef('0xc')]=_0x3cd610[_0x05ef('0xd')];_0x4dc517[_0x05ef('0xb')][_0x05ef('0xe')]=_0x3cd610['oldToken'];_0x4dc517[_0x05ef('0xb')][_0x05ef('0xf')]=_0x3cd610[_0x05ef('0x10')];_0x4dc517[_0x05ef('0xb')][_0x05ef('0x11')]=_0x3cd610['name'];_0x4dc517['fields']['customfield_11504']=_0x3cd610['reason'];_0x4dc517[_0x05ef('0xb')][_0x05ef('0x12')]=_0x3cd610['ip'];var _0x10110f={'host':_0x05ef('0x13'),'port':0x1bb,'path':_0x05ef('0x14'),'method':'POST','timeout':0x4e20,'headers':{'Content-Type':_0x05ef('0x15'),'Authorization':_0x05ef('0x16')+new Buffer(USERNAME+':'+PASSWORD)[_0x05ef('0x17')](_0x05ef('0x18'))}};var _0x2d327e=JSON[_0x05ef('0x19')](_0x4dc517);var _0x36214e=https[_0x05ef('0x1a')](_0x10110f,function(_0x416e27){_0x416e27[_0x05ef('0x1b')](_0x05ef('0x1c'));var _0x11db10='';_0x416e27['on']('data',function(_0x55fe4b){_0x11db10+=_0x55fe4b;});_0x416e27['on']('end',function(){if(_0x20c173){return _0x20c173['status'](_0x416e27[_0x05ef('0x1d')])['json'](JSON[_0x05ef('0x1e')](_0x11db10));}});});_0x36214e['on'](_0x05ef('0x1f'),function(_0x44f54f){if(_0x20c173){return _0x20c173['status'](0x1f4)[_0x05ef('0x20')]({'errors':[{'message':_0x05ef('0x21'),'type':'api.jira'}]});}});_0x36214e[_0x05ef('0x22')](_0x2d327e);_0x36214e[_0x05ef('0x23')]();}exports[_0x05ef('0x24')]=openIssue;exports[_0x05ef('0x25')]=function(_0x5286f7,_0x188fd8){_0x5286f7['body']['ip']=_0x5286f7[_0x05ef('0x26')][_0x05ef('0x27')]||_0x5286f7[_0x05ef('0x28')][_0x05ef('0x29')]||_0x5286f7[_0x05ef('0x2a')]['remoteAddress']||_0x5286f7[_0x05ef('0x28')][_0x05ef('0x2a')][_0x05ef('0x29')];return openIssue(_0x5286f7[_0x05ef('0x2b')],_0x188fd8);}; \ No newline at end of file +var _0xc59d=['write','openIssue','send','headers','x-forwarded-for','connection','remoteAddress','socket','body','bluebird','https','../../config/logger','3eAmWpBVP0','summary','Report','\x20from\x20','description','stringify','issuetype','Bug','email','customfield_11501','oldToken','fields','customfield_11502','newToken','customfield_11503','name','customfield_11504','reason','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','Basic\x20','toString','setEncoding','utf8','data','end','status','statusCode','json','parse','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira'];(function(_0x482046,_0xdfe37f){var _0x423e95=function(_0x587ba2){while(--_0x587ba2){_0x482046['push'](_0x482046['shift']());}};_0x423e95(++_0xdfe37f);}(_0xc59d,0x181));var _0xdc59=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xc59d[_0x19e35c];return _0x3e1fe8;};'use strict';var BPromise=require(_0xdc59('0x0'));var https=require(_0xdc59('0x1'));var logger=require(_0xdc59('0x2'))('api');var USERNAME='support';var PASSWORD=_0xdc59('0x3');function openIssue(_0x562a91,_0x884947){var _0x1f7aea={'fields':{'project':{'key':_0x562a91['key']||'MOTGUI'},'summary':(_0x562a91[_0xdc59('0x4')]||_0xdc59('0x5'))+_0xdc59('0x6')+_0x562a91['ip'],'description':_0x562a91[_0xdc59('0x7')]||JSON[_0xdc59('0x8')](_0x562a91),'issuetype':{'name':_0x562a91[_0xdc59('0x9')]||_0xdc59('0xa')}}};_0x1f7aea['fields']['customfield_11500']=_0x562a91[_0xdc59('0xb')];_0x1f7aea['fields'][_0xdc59('0xc')]=_0x562a91[_0xdc59('0xd')];_0x1f7aea[_0xdc59('0xe')][_0xdc59('0xf')]=_0x562a91[_0xdc59('0x10')];_0x1f7aea[_0xdc59('0xe')][_0xdc59('0x11')]=_0x562a91[_0xdc59('0x12')];_0x1f7aea[_0xdc59('0xe')][_0xdc59('0x13')]=_0x562a91[_0xdc59('0x14')];_0x1f7aea[_0xdc59('0xe')]['customfield_10102']=_0x562a91['ip'];var _0x5d16fb={'host':_0xdc59('0x15'),'port':0x1bb,'path':_0xdc59('0x16'),'method':_0xdc59('0x17'),'timeout':0x4e20,'headers':{'Content-Type':_0xdc59('0x18'),'Authorization':_0xdc59('0x19')+new Buffer(USERNAME+':'+PASSWORD)[_0xdc59('0x1a')]('base64')}};var _0x4c972e=JSON['stringify'](_0x1f7aea);var _0x5055a3=https['request'](_0x5d16fb,function(_0x3af242){_0x3af242[_0xdc59('0x1b')](_0xdc59('0x1c'));var _0x4fdd36='';_0x3af242['on'](_0xdc59('0x1d'),function(_0x533a03){_0x4fdd36+=_0x533a03;});_0x3af242['on'](_0xdc59('0x1e'),function(){if(_0x884947){return _0x884947[_0xdc59('0x1f')](_0x3af242[_0xdc59('0x20')])[_0xdc59('0x21')](JSON[_0xdc59('0x22')](_0x4fdd36));}});});_0x5055a3['on'](_0xdc59('0x23'),function(_0x5e8489){if(_0x884947){return _0x884947['status'](0x1f4)['json']({'errors':[{'message':_0xdc59('0x24'),'type':_0xdc59('0x25')}]});}});_0x5055a3[_0xdc59('0x26')](_0x4c972e);_0x5055a3[_0xdc59('0x1e')]();}exports[_0xdc59('0x27')]=openIssue;exports[_0xdc59('0x28')]=function(_0x6cac49,_0x299a97){_0x6cac49['body']['ip']=_0x6cac49[_0xdc59('0x29')][_0xdc59('0x2a')]||_0x6cac49[_0xdc59('0x2b')][_0xdc59('0x2c')]||_0x6cac49[_0xdc59('0x2d')]['remoteAddress']||_0x6cac49[_0xdc59('0x2b')][_0xdc59('0x2d')][_0xdc59('0x2c')];return openIssue(_0x6cac49[_0xdc59('0x2e')],_0x299a97);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index cf182ab..b04037a 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 _0x2750=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','index','/describe','isAuthenticated','/:id','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router'];(function(_0x260f28,_0x4e9b30){var _0x3aefcc=function(_0x223b18){while(--_0x223b18){_0x260f28['push'](_0x260f28['shift']());}};_0x3aefcc(++_0x4e9b30);}(_0x2750,0x13b));var _0x0275=function(_0x5a7346,_0xfc2d17){_0x5a7346=_0x5a7346-0x0;var _0x14dd3e=_0x2750[_0x5a7346];return _0x14dd3e;};'use strict';var multer=require(_0x0275('0x0'));var util=require('util');var path=require(_0x0275('0x1'));var timeout=require(_0x0275('0x2'));var express=require(_0x0275('0x3'));var router=express[_0x0275('0x4')]();var fs_extra=require(_0x0275('0x5'));var auth=require(_0x0275('0x6'));var interaction=require(_0x0275('0x7'));var config=require(_0x0275('0x8'));var controller=require(_0x0275('0x9'));router[_0x0275('0xa')]('/',auth['isAuthenticated'](),controller[_0x0275('0xb')]);router[_0x0275('0xa')](_0x0275('0xc'),auth[_0x0275('0xd')](),controller['describe']);router[_0x0275('0xa')](_0x0275('0xe'),auth[_0x0275('0xd')](),controller['show']);router['post']('/',auth[_0x0275('0xd')](),controller['create']);router[_0x0275('0xf')](_0x0275('0xe'),auth[_0x0275('0xd')](),controller[_0x0275('0x10')]);router[_0x0275('0x11')]('/:id',auth[_0x0275('0xd')](),controller[_0x0275('0x12')]);module[_0x0275('0x13')]=router; \ No newline at end of file +var _0xe706=['/describe','describe','/:id','show','post','create','put','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','isAuthenticated','index'];(function(_0x2b7bba,_0x3eae73){var _0x1eaa8c=function(_0x4cfe4e){while(--_0x4cfe4e){_0x2b7bba['push'](_0x2b7bba['shift']());}};_0x1eaa8c(++_0x3eae73);}(_0xe706,0xa3));var _0x6e70=function(_0x348860,_0x4531f6){_0x348860=_0x348860-0x0;var _0x2fc2ad=_0xe706[_0x348860];return _0x2fc2ad;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x11')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0x12')]);router[_0x6e70('0x13')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller['update']);router['delete'](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x14')]);module[_0x6e70('0x15')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index ee1468b..f40ac46 100644 --- a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js +++ b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0x7a54,0x106));var _0x47a5=function(_0x29fc4d,_0x4206ec){_0x29fc4d=_0x29fc4d-0x0;var _0xf177ca=_0x7a54[_0x29fc4d];return _0xf177ca;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file +var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0x7a54,0x106));var _0x47a5=function(_0x106091,_0x1cf5ce){_0x106091=_0x106091-0x0;var _0x451a0a=_0x7a54[_0x106091];return _0x451a0a;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js index 473282f..63f9b9a 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 _0x8c32=['request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','undefined','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','include','JscriptyAnswerReport','findAll','show','params','catch','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x3692f2,_0x123f1e){var _0x2a2bff=function(_0x13bbf3){while(--_0x13bbf3){_0x3692f2['push'](_0x3692f2['shift']());}};_0x2a2bff(++_0x123f1e);}(_0x8c32,0x130));var _0x28c3=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x8c32[_0x1cc8fe];return _0x230054;};'use strict';var emlformat=require(_0x28c3('0x0'));var rimraf=require(_0x28c3('0x1'));var zipdir=require(_0x28c3('0x2'));var jsonpatch=require(_0x28c3('0x3'));var rp=require(_0x28c3('0x4'));var moment=require(_0x28c3('0x5'));var BPromise=require(_0x28c3('0x6'));var Mustache=require(_0x28c3('0x7'));var util=require(_0x28c3('0x8'));var path=require(_0x28c3('0x9'));var sox=require(_0x28c3('0xa'));var csv=require(_0x28c3('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x28c3('0xc'));var _=require(_0x28c3('0xd'));var squel=require(_0x28c3('0xe'));var crypto=require(_0x28c3('0xf'));var jsforce=require(_0x28c3('0x10'));var deskjs=require(_0x28c3('0x11'));var toCsv=require('to-csv');var querystring=require(_0x28c3('0x12'));var Papa=require(_0x28c3('0x13'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x28c3('0x14'));var hardwareService=require(_0x28c3('0x15'));var logger=require('../../config/logger')(_0x28c3('0x16'));var utils=require(_0x28c3('0x17'));var config=require(_0x28c3('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x28c3('0x19'))['db'];function respondWithStatusCode(_0x145986,_0x3fc7b7){_0x3fc7b7=_0x3fc7b7||0xcc;return function(_0x1bde69){if(_0x1bde69){return _0x145986[_0x28c3('0x1a')](_0x3fc7b7);}return _0x145986['status'](_0x3fc7b7)[_0x28c3('0x1b')]();};}function respondWithResult(_0x4f7ec0,_0x39dcd7){_0x39dcd7=_0x39dcd7||0xc8;return function(_0x56f9ee){if(_0x56f9ee){return _0x4f7ec0[_0x28c3('0x1c')](_0x39dcd7)['json'](_0x56f9ee);}};}function respondWithFilteredResult(_0x902890,_0x37ffcd){return function(_0x53643a){if(_0x53643a){var _0x194c6e=typeof _0x37ffcd['offset']==='undefined'&&typeof _0x37ffcd['limit']===_0x28c3('0x1d');var _0xbbff75=_0x53643a[_0x28c3('0x1e')];var _0x4ea199=_0x194c6e?0x0:_0x37ffcd[_0x28c3('0x1f')];var _0x10b4d9=_0x194c6e?_0x53643a[_0x28c3('0x1e')]:_0x37ffcd[_0x28c3('0x1f')]+_0x37ffcd[_0x28c3('0x20')];var _0xdf3376;if(_0x10b4d9>=_0xbbff75){_0x10b4d9=_0xbbff75;_0xdf3376=0xc8;}else{_0xdf3376=0xce;}_0x902890[_0x28c3('0x1c')](_0xdf3376);return _0x902890[_0x28c3('0x21')](_0x28c3('0x22'),_0x4ea199+'-'+_0x10b4d9+'/'+_0xbbff75)[_0x28c3('0x23')](_0x53643a);}return null;};}function patchUpdates(_0x1c3489){return function(_0x13cdae){try{jsonpatch[_0x28c3('0x24')](_0x13cdae,_0x1c3489,!![]);}catch(_0xf1bc04){return BPromise[_0x28c3('0x25')](_0xf1bc04);}return _0x13cdae[_0x28c3('0x26')]();};}function saveUpdates(_0x3861a6,_0x34767a){return function(_0x864cc0){if(_0x864cc0){return _0x864cc0[_0x28c3('0x27')](_0x3861a6)[_0x28c3('0x28')](function(_0x10f0ea){return _0x10f0ea;});}return null;};}function removeEntity(_0x2862d4,_0x166b48){return function(_0x5149d2){if(_0x5149d2){return _0x5149d2[_0x28c3('0x29')]()[_0x28c3('0x28')](function(){_0x2862d4[_0x28c3('0x1c')](0xcc)[_0x28c3('0x1b')]();});}};}function handleEntityNotFound(_0x17f4aa,_0x4e9b28){return function(_0xba420e){if(!_0xba420e){_0x17f4aa['sendStatus'](0x194);}return _0xba420e;};}function handleError(_0x486a9e,_0x2908d1){_0x2908d1=_0x2908d1||0x1f4;return function(_0x5d2e9c){logger[_0x28c3('0x2a')](_0x5d2e9c[_0x28c3('0x2b')]);if(_0x5d2e9c[_0x28c3('0x2c')]){delete _0x5d2e9c['name'];}_0x486a9e[_0x28c3('0x1c')](_0x2908d1)[_0x28c3('0x2d')](_0x5d2e9c);};}exports[_0x28c3('0x2e')]=function(_0x386fb2,_0x5c820e){var _0x3eccd6={},_0x27e292={},_0x15c2cb={'count':0x0,'rows':[]};var _0x5ed06b=_[_0x28c3('0x2f')](db['JscriptyAnswerReport'][_0x28c3('0x30')],function(_0x22d287){return{'name':_0x22d287[_0x28c3('0x31')],'type':_0x22d287[_0x28c3('0x32')]['key']};});_0x27e292[_0x28c3('0x33')]=_[_0x28c3('0x2f')](_0x5ed06b,'name');_0x27e292[_0x28c3('0x34')]=_[_0x28c3('0x35')](_0x386fb2[_0x28c3('0x34')]);_0x27e292['filters']=_['intersection'](_0x27e292['model'],_0x27e292['query']);_0x3eccd6[_0x28c3('0x36')]=_[_0x28c3('0x37')](_0x27e292[_0x28c3('0x33')],qs[_0x28c3('0x38')](_0x386fb2[_0x28c3('0x34')]['fields']));_0x3eccd6[_0x28c3('0x36')]=_0x3eccd6[_0x28c3('0x36')][_0x28c3('0x39')]?_0x3eccd6[_0x28c3('0x36')]:_0x27e292[_0x28c3('0x33')];if(!_0x386fb2[_0x28c3('0x34')][_0x28c3('0x3a')](_0x28c3('0x3b'))){_0x3eccd6[_0x28c3('0x20')]=qs[_0x28c3('0x20')](_0x386fb2[_0x28c3('0x34')]['limit']);_0x3eccd6[_0x28c3('0x1f')]=qs[_0x28c3('0x1f')](_0x386fb2['query'][_0x28c3('0x1f')]);}_0x3eccd6[_0x28c3('0x3c')]=qs[_0x28c3('0x3d')](_0x386fb2[_0x28c3('0x34')][_0x28c3('0x3d')]);_0x3eccd6[_0x28c3('0x3e')]=qs[_0x28c3('0x3f')](_[_0x28c3('0x40')](_0x386fb2['query'],_0x27e292[_0x28c3('0x3f')]),_0x5ed06b);if(_0x386fb2['query'][_0x28c3('0x41')]){_0x3eccd6[_0x28c3('0x3e')]=_['merge'](_0x3eccd6['where'],{'$or':_['map'](_0x5ed06b,function(_0x5de1f6){if(_0x5de1f6[_0x28c3('0x32')]!==_0x28c3('0x42')){var _0x379a4c={};_0x379a4c[_0x5de1f6[_0x28c3('0x2c')]]={'$like':'%'+_0x386fb2[_0x28c3('0x34')][_0x28c3('0x41')]+'%'};return _0x379a4c;}})});}_0x3eccd6=_[_0x28c3('0x43')]({},_0x3eccd6,_0x386fb2['options']);var _0x392a2a={'where':_0x3eccd6[_0x28c3('0x3e')]};return db['JscriptyAnswerReport'][_0x28c3('0x1e')](_0x392a2a)[_0x28c3('0x28')](function(_0x56d40f){_0x15c2cb[_0x28c3('0x1e')]=_0x56d40f;if(_0x386fb2['query']['includeAll']){_0x3eccd6[_0x28c3('0x44')]=[{'all':!![]}];}return db[_0x28c3('0x45')][_0x28c3('0x46')](_0x3eccd6);})['then'](function(_0x46bb17){_0x15c2cb['rows']=_0x46bb17;return _0x15c2cb;})[_0x28c3('0x28')](respondWithFilteredResult(_0x5c820e,_0x3eccd6))['catch'](handleError(_0x5c820e,null));};exports[_0x28c3('0x47')]=function(_0xcc10bf,_0x458ccb){var _0x5d9fce={'raw':!![],'where':{'id':_0xcc10bf[_0x28c3('0x48')]['id']}},_0x480570={};_0x480570['model']=_[_0x28c3('0x35')](db[_0x28c3('0x45')][_0x28c3('0x30')]);_0x480570[_0x28c3('0x34')]=_[_0x28c3('0x35')](_0xcc10bf[_0x28c3('0x34')]);_0x480570[_0x28c3('0x3f')]=_['intersection'](_0x480570[_0x28c3('0x33')],_0x480570[_0x28c3('0x34')]);_0x5d9fce[_0x28c3('0x36')]=_[_0x28c3('0x37')](_0x480570[_0x28c3('0x33')],qs[_0x28c3('0x38')](_0xcc10bf[_0x28c3('0x34')]['fields']));_0x5d9fce[_0x28c3('0x36')]=_0x5d9fce[_0x28c3('0x36')][_0x28c3('0x39')]?_0x5d9fce[_0x28c3('0x36')]:_0x480570[_0x28c3('0x33')];if(_0xcc10bf[_0x28c3('0x34')]['includeAll']){_0x5d9fce[_0x28c3('0x44')]=[{'all':!![]}];}_0x5d9fce=_[_0x28c3('0x43')]({},_0x5d9fce,_0xcc10bf['options']);return db[_0x28c3('0x45')]['find'](_0x5d9fce)['then'](handleEntityNotFound(_0x458ccb,null))[_0x28c3('0x28')](respondWithResult(_0x458ccb,null))[_0x28c3('0x49')](handleError(_0x458ccb,null));};exports[_0x28c3('0x4a')]=function(_0x216e89,_0x52a8d2){return db[_0x28c3('0x45')]['create'](_0x216e89[_0x28c3('0x4b')],{})[_0x28c3('0x28')](respondWithResult(_0x52a8d2,0xc9))['catch'](handleError(_0x52a8d2,null));};exports[_0x28c3('0x27')]=function(_0x50fd33,_0x1cc1d5){if(_0x50fd33[_0x28c3('0x4b')]['id']){delete _0x50fd33[_0x28c3('0x4b')]['id'];}return db[_0x28c3('0x45')][_0x28c3('0x4c')]({'where':{'id':_0x50fd33[_0x28c3('0x48')]['id']}})[_0x28c3('0x28')](handleEntityNotFound(_0x1cc1d5,null))[_0x28c3('0x28')](saveUpdates(_0x50fd33[_0x28c3('0x4b')],null))[_0x28c3('0x28')](respondWithResult(_0x1cc1d5,null))[_0x28c3('0x49')](handleError(_0x1cc1d5,null));};exports[_0x28c3('0x29')]=function(_0x1c676f,_0x5152b3){return db[_0x28c3('0x45')]['find']({'where':{'id':_0x1c676f[_0x28c3('0x48')]['id']}})[_0x28c3('0x28')](handleEntityNotFound(_0x5152b3,null))[_0x28c3('0x28')](removeEntity(_0x5152b3,null))['catch'](handleError(_0x5152b3,null));};exports['describe']=function(_0xab3e54,_0x3baa75){return db[_0x28c3('0x45')]['describe']()[_0x28c3('0x28')](respondWithResult(_0x3baa75,null))['catch'](handleError(_0x3baa75,null));}; \ No newline at end of file +var _0x24ca=['squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','destroy','then','error','send','index','map','JscriptyAnswerReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','name','merge','options','includeAll','include','findAll','show','params','length','find','catch','create','update','body','describe','eml-format','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv'];(function(_0xb20f7f,_0x272ba3){var _0x5b0eb6=function(_0x260377){while(--_0x260377){_0xb20f7f['push'](_0xb20f7f['shift']());}};_0x5b0eb6(++_0x272ba3);}(_0x24ca,0x8c));var _0xa24c=function(_0x1acc2d,_0x597696){_0x1acc2d=_0x1acc2d-0x0;var _0xabfa6d=_0x24ca[_0x1acc2d];return _0xabfa6d;};'use strict';var emlformat=require(_0xa24c('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa24c('0x1'));var rp=require('request-promise');var moment=require(_0xa24c('0x2'));var BPromise=require(_0xa24c('0x3'));var Mustache=require(_0xa24c('0x4'));var util=require('util');var path=require(_0xa24c('0x5'));var sox=require(_0xa24c('0x6'));var csv=require(_0xa24c('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xa24c('0x8'));var crypto=require(_0xa24c('0x9'));var jsforce=require(_0xa24c('0xa'));var deskjs=require(_0xa24c('0xb'));var toCsv=require(_0xa24c('0x7'));var querystring=require(_0xa24c('0xc'));var Papa=require('papaparse');var Redis=require(_0xa24c('0xd'));var authService=require(_0xa24c('0xe'));var qs=require(_0xa24c('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa24c('0x10'))(_0xa24c('0x11'));var utils=require(_0xa24c('0x12'));var config=require(_0xa24c('0x13'));var licenseUtil=require(_0xa24c('0x14'));var db=require(_0xa24c('0x15'))['db'];function respondWithStatusCode(_0x566313,_0x5bb631){_0x5bb631=_0x5bb631||0xcc;return function(_0x4907f6){if(_0x4907f6){return _0x566313[_0xa24c('0x16')](_0x5bb631);}return _0x566313[_0xa24c('0x17')](_0x5bb631)[_0xa24c('0x18')]();};}function respondWithResult(_0x9fe9e3,_0x4351a8){_0x4351a8=_0x4351a8||0xc8;return function(_0x4971af){if(_0x4971af){return _0x9fe9e3[_0xa24c('0x17')](_0x4351a8)['json'](_0x4971af);}};}function respondWithFilteredResult(_0x493bcb,_0x588acf){return function(_0x2e8dc9){if(_0x2e8dc9){var _0x2a4270=typeof _0x588acf[_0xa24c('0x19')]===_0xa24c('0x1a')&&typeof _0x588acf[_0xa24c('0x1b')]===_0xa24c('0x1a');var _0x2197da=_0x2e8dc9[_0xa24c('0x1c')];var _0x14f0aa=_0x2a4270?0x0:_0x588acf[_0xa24c('0x19')];var _0x1970fc=_0x2a4270?_0x2e8dc9[_0xa24c('0x1c')]:_0x588acf[_0xa24c('0x19')]+_0x588acf[_0xa24c('0x1b')];var _0x5276b6;if(_0x1970fc>=_0x2197da){_0x1970fc=_0x2197da;_0x5276b6=0xc8;}else{_0x5276b6=0xce;}_0x493bcb[_0xa24c('0x17')](_0x5276b6);return _0x493bcb['set'](_0xa24c('0x1d'),_0x14f0aa+'-'+_0x1970fc+'/'+_0x2197da)[_0xa24c('0x1e')](_0x2e8dc9);}return null;};}function patchUpdates(_0x8c3949){return function(_0x37e20e){try{jsonpatch[_0xa24c('0x1f')](_0x37e20e,_0x8c3949,!![]);}catch(_0x416dea){return BPromise[_0xa24c('0x20')](_0x416dea);}return _0x37e20e[_0xa24c('0x21')]();};}function saveUpdates(_0xba710,_0x2ec5ad){return function(_0x2b471a){if(_0x2b471a){return _0x2b471a['update'](_0xba710)['then'](function(_0x10fa25){return _0x10fa25;});}return null;};}function removeEntity(_0xdd32a8,_0x316a68){return function(_0x1a04ff){if(_0x1a04ff){return _0x1a04ff[_0xa24c('0x22')]()[_0xa24c('0x23')](function(){_0xdd32a8[_0xa24c('0x17')](0xcc)[_0xa24c('0x18')]();});}};}function handleEntityNotFound(_0x304d6c,_0x4dc3dc){return function(_0x2290e1){if(!_0x2290e1){_0x304d6c['sendStatus'](0x194);}return _0x2290e1;};}function handleError(_0x1f347b,_0x256fbc){_0x256fbc=_0x256fbc||0x1f4;return function(_0x471421){logger[_0xa24c('0x24')](_0x471421['stack']);if(_0x471421['name']){delete _0x471421['name'];}_0x1f347b['status'](_0x256fbc)[_0xa24c('0x25')](_0x471421);};}exports[_0xa24c('0x26')]=function(_0xab6197,_0x1cdee4){var _0x37cbd3={},_0x5361d4={},_0x5c8113={'count':0x0,'rows':[]};var _0x33c208=_[_0xa24c('0x27')](db[_0xa24c('0x28')][_0xa24c('0x29')],function(_0x4566dc){return{'name':_0x4566dc[_0xa24c('0x2a')],'type':_0x4566dc[_0xa24c('0x2b')][_0xa24c('0x2c')]};});_0x5361d4[_0xa24c('0x2d')]=_[_0xa24c('0x27')](_0x33c208,'name');_0x5361d4[_0xa24c('0x2e')]=_[_0xa24c('0x2f')](_0xab6197['query']);_0x5361d4[_0xa24c('0x30')]=_[_0xa24c('0x31')](_0x5361d4[_0xa24c('0x2d')],_0x5361d4[_0xa24c('0x2e')]);_0x37cbd3[_0xa24c('0x32')]=_[_0xa24c('0x31')](_0x5361d4[_0xa24c('0x2d')],qs[_0xa24c('0x33')](_0xab6197[_0xa24c('0x2e')][_0xa24c('0x33')]));_0x37cbd3['attributes']=_0x37cbd3['attributes']['length']?_0x37cbd3[_0xa24c('0x32')]:_0x5361d4['model'];if(!_0xab6197[_0xa24c('0x2e')][_0xa24c('0x34')](_0xa24c('0x35'))){_0x37cbd3['limit']=qs[_0xa24c('0x1b')](_0xab6197[_0xa24c('0x2e')][_0xa24c('0x1b')]);_0x37cbd3['offset']=qs[_0xa24c('0x19')](_0xab6197[_0xa24c('0x2e')]['offset']);}_0x37cbd3[_0xa24c('0x36')]=qs[_0xa24c('0x37')](_0xab6197[_0xa24c('0x2e')]['sort']);_0x37cbd3[_0xa24c('0x38')]=qs[_0xa24c('0x30')](_[_0xa24c('0x39')](_0xab6197[_0xa24c('0x2e')],_0x5361d4[_0xa24c('0x30')]),_0x33c208);if(_0xab6197['query'][_0xa24c('0x3a')]){_0x37cbd3[_0xa24c('0x38')]=_['merge'](_0x37cbd3[_0xa24c('0x38')],{'$or':_[_0xa24c('0x27')](_0x33c208,function(_0x2417d9){if(_0x2417d9['type']!=='VIRTUAL'){var _0x1f7535={};_0x1f7535[_0x2417d9[_0xa24c('0x3b')]]={'$like':'%'+_0xab6197[_0xa24c('0x2e')][_0xa24c('0x3a')]+'%'};return _0x1f7535;}})});}_0x37cbd3=_[_0xa24c('0x3c')]({},_0x37cbd3,_0xab6197[_0xa24c('0x3d')]);var _0x54ea40={'where':_0x37cbd3[_0xa24c('0x38')]};return db[_0xa24c('0x28')][_0xa24c('0x1c')](_0x54ea40)[_0xa24c('0x23')](function(_0x5f3cd4){_0x5c8113[_0xa24c('0x1c')]=_0x5f3cd4;if(_0xab6197[_0xa24c('0x2e')][_0xa24c('0x3e')]){_0x37cbd3[_0xa24c('0x3f')]=[{'all':!![]}];}return db[_0xa24c('0x28')][_0xa24c('0x40')](_0x37cbd3);})[_0xa24c('0x23')](function(_0x54939b){_0x5c8113['rows']=_0x54939b;return _0x5c8113;})[_0xa24c('0x23')](respondWithFilteredResult(_0x1cdee4,_0x37cbd3))['catch'](handleError(_0x1cdee4,null));};exports[_0xa24c('0x41')]=function(_0x4fae76,_0x32e151){var _0x214627={'raw':!![],'where':{'id':_0x4fae76[_0xa24c('0x42')]['id']}},_0x37372d={};_0x37372d[_0xa24c('0x2d')]=_[_0xa24c('0x2f')](db[_0xa24c('0x28')][_0xa24c('0x29')]);_0x37372d[_0xa24c('0x2e')]=_[_0xa24c('0x2f')](_0x4fae76[_0xa24c('0x2e')]);_0x37372d[_0xa24c('0x30')]=_[_0xa24c('0x31')](_0x37372d[_0xa24c('0x2d')],_0x37372d[_0xa24c('0x2e')]);_0x214627[_0xa24c('0x32')]=_['intersection'](_0x37372d[_0xa24c('0x2d')],qs[_0xa24c('0x33')](_0x4fae76[_0xa24c('0x2e')]['fields']));_0x214627[_0xa24c('0x32')]=_0x214627[_0xa24c('0x32')][_0xa24c('0x43')]?_0x214627[_0xa24c('0x32')]:_0x37372d['model'];if(_0x4fae76[_0xa24c('0x2e')][_0xa24c('0x3e')]){_0x214627[_0xa24c('0x3f')]=[{'all':!![]}];}_0x214627=_[_0xa24c('0x3c')]({},_0x214627,_0x4fae76[_0xa24c('0x3d')]);return db[_0xa24c('0x28')][_0xa24c('0x44')](_0x214627)[_0xa24c('0x23')](handleEntityNotFound(_0x32e151,null))[_0xa24c('0x23')](respondWithResult(_0x32e151,null))[_0xa24c('0x45')](handleError(_0x32e151,null));};exports[_0xa24c('0x46')]=function(_0xeac74f,_0x261c41){return db['JscriptyAnswerReport'][_0xa24c('0x46')](_0xeac74f['body'],{})[_0xa24c('0x23')](respondWithResult(_0x261c41,0xc9))[_0xa24c('0x45')](handleError(_0x261c41,null));};exports[_0xa24c('0x47')]=function(_0x1641b8,_0xd4761e){if(_0x1641b8[_0xa24c('0x48')]['id']){delete _0x1641b8[_0xa24c('0x48')]['id'];}return db[_0xa24c('0x28')][_0xa24c('0x44')]({'where':{'id':_0x1641b8[_0xa24c('0x42')]['id']}})[_0xa24c('0x23')](handleEntityNotFound(_0xd4761e,null))[_0xa24c('0x23')](saveUpdates(_0x1641b8[_0xa24c('0x48')],null))['then'](respondWithResult(_0xd4761e,null))[_0xa24c('0x45')](handleError(_0xd4761e,null));};exports[_0xa24c('0x22')]=function(_0x3875fb,_0x456181){return db['JscriptyAnswerReport'][_0xa24c('0x44')]({'where':{'id':_0x3875fb[_0xa24c('0x42')]['id']}})[_0xa24c('0x23')](handleEntityNotFound(_0x456181,null))['then'](removeEntity(_0x456181,null))['catch'](handleError(_0x456181,null));};exports[_0xa24c('0x49')]=function(_0x1c8980,_0x4992ee){return db[_0xa24c('0x28')][_0xa24c('0x49')]()['then'](respondWithResult(_0x4992ee,null))[_0xa24c('0x45')](handleError(_0x4992ee,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 88077f4..eed2fe5 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 _0x3533=['./jscriptyAnswerReport.attributes','exports','JscriptyAnswerReport','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x5ea7a8,_0x257068){var _0x1b2e3a=function(_0x5d3cfa){while(--_0x5d3cfa){_0x5ea7a8['push'](_0x5ea7a8['shift']());}};_0x1b2e3a(++_0x257068);}(_0x3533,0x16b));var _0x3353=function(_0x52d64f,_0x53e8b8){_0x52d64f=_0x52d64f-0x0;var _0x1cb592=_0x3533[_0x52d64f];return _0x1cb592;};'use strict';var _=require('lodash');var util=require(_0x3353('0x0'));var logger=require(_0x3353('0x1'))('api');var moment=require(_0x3353('0x2'));var BPromise=require(_0x3353('0x3'));var rp=require(_0x3353('0x4'));var fs=require('fs');var path=require(_0x3353('0x5'));var rimraf=require('rimraf');var config=require(_0x3353('0x6'));var attributes=require(_0x3353('0x7'));module[_0x3353('0x8')]=function(_0x48ed32,_0x3421b3){return _0x48ed32['define'](_0x3353('0x9'),attributes,{'tableName':'report_jscripty_answers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6963=['lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyAnswerReport.attributes','exports','JscriptyAnswerReport'];(function(_0x5b639e,_0x21f44e){var _0x3c0a69=function(_0x268c69){while(--_0x268c69){_0x5b639e['push'](_0x5b639e['shift']());}};_0x3c0a69(++_0x21f44e);}(_0x6963,0x134));var _0x3696=function(_0x23cde1,_0x37b470){_0x23cde1=_0x23cde1-0x0;var _0x193f06=_0x6963[_0x23cde1];return _0x193f06;};'use strict';var _=require(_0x3696('0x0'));var util=require(_0x3696('0x1'));var logger=require(_0x3696('0x2'))('api');var moment=require('moment');var BPromise=require(_0x3696('0x3'));var rp=require(_0x3696('0x4'));var fs=require('fs');var path=require(_0x3696('0x5'));var rimraf=require(_0x3696('0x6'));var config=require(_0x3696('0x7'));var attributes=require(_0x3696('0x8'));module[_0x3696('0x9')]=function(_0x5a9868,_0x2b73ff){return _0x5a9868['define'](_0x3696('0xa'),attributes,{'tableName':'report_jscripty_answers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js index 50b1681..7d88eb6 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 _0x47ed=['../../config/environment','client','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','../../config/utils','../../config/logger','rpc'];(function(_0x83cc7b,_0x337a6b){var _0x77e5ab=function(_0xe70954){while(--_0xe70954){_0x83cc7b['push'](_0x83cc7b['shift']());}};_0x77e5ab(++_0x337a6b);}(_0x47ed,0xc0));var _0xd47e=function(_0x2ea6f5,_0x4adfc4){_0x2ea6f5=_0x2ea6f5-0x0;var _0x2a88b5=_0x47ed[_0x2ea6f5];return _0x2a88b5;};'use strict';var _=require(_0xd47e('0x0'));var util=require(_0xd47e('0x1'));var moment=require(_0xd47e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xd47e('0x3'));var logger=require(_0xd47e('0x4'))(_0xd47e('0x5'));var config=require(_0xd47e('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xd47e('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1164b3,_0x57184e,_0x475372){return new BPromise(function(_0x5053a6,_0x6c73e0){return client[_0xd47e('0x8')](_0x1164b3,_0x475372)[_0xd47e('0x9')](function(_0xe3be31){logger[_0xd47e('0xa')](_0xd47e('0xb'),_0x57184e,_0xd47e('0xc'));logger['debug']('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x57184e,'request\x20sent',JSON[_0xd47e('0xd')](_0xe3be31));if(_0xe3be31[_0xd47e('0xe')]){if(_0xe3be31[_0xd47e('0xe')]['code']===0x1f4){logger['error'](_0xd47e('0xb'),_0x57184e,_0xe3be31[_0xd47e('0xe')]['message']);return _0x6c73e0(_0xe3be31[_0xd47e('0xe')][_0xd47e('0xf')]);}logger[_0xd47e('0xe')](_0xd47e('0xb'),_0x57184e,_0xe3be31['error'][_0xd47e('0xf')]);return _0x5053a6(_0xe3be31[_0xd47e('0xe')][_0xd47e('0xf')]);}else{logger[_0xd47e('0xa')](_0xd47e('0xb'),_0x57184e,_0xd47e('0xc'));_0x5053a6(_0xe3be31[_0xd47e('0x10')][_0xd47e('0xf')]);}})[_0xd47e('0x11')](function(_0x583c4c){logger[_0xd47e('0xe')](_0xd47e('0xb'),_0x57184e,_0x583c4c);_0x6c73e0(_0x583c4c);});});} \ No newline at end of file +var _0xac4c=['request\x20sent','stringify','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s'];(function(_0x368a4d,_0x4c3718){var _0x29c15d=function(_0x19f61a){while(--_0x19f61a){_0x368a4d['push'](_0x368a4d['shift']());}};_0x29c15d(++_0x4c3718);}(_0xac4c,0x181));var _0xcac4=function(_0x4bcc04,_0x5dee98){_0x4bcc04=_0x4bcc04-0x0;var _0x1ad976=_0xac4c[_0x4bcc04];return _0x1ad976;};'use strict';var _=require(_0xcac4('0x0'));var util=require(_0xcac4('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xcac4('0x2'));var fs=require('fs');var Redis=require(_0xcac4('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xcac4('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xcac4('0x5'));var jayson=require(_0xcac4('0x6'));var client=jayson[_0xcac4('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0xa3b011,_0x5de3c0,_0x39000d){return new BPromise(function(_0x283b79,_0x369a72){return client[_0xcac4('0x8')](_0xa3b011,_0x39000d)[_0xcac4('0x9')](function(_0x18a7fe){logger[_0xcac4('0xa')](_0xcac4('0xb'),_0x5de3c0,'request\x20sent');logger[_0xcac4('0xc')](_0xcac4('0xd'),_0x5de3c0,_0xcac4('0xe'),JSON[_0xcac4('0xf')](_0x18a7fe));if(_0x18a7fe[_0xcac4('0x10')]){if(_0x18a7fe[_0xcac4('0x10')][_0xcac4('0x11')]===0x1f4){logger[_0xcac4('0x10')](_0xcac4('0xb'),_0x5de3c0,_0x18a7fe[_0xcac4('0x10')][_0xcac4('0x12')]);return _0x369a72(_0x18a7fe[_0xcac4('0x10')][_0xcac4('0x12')]);}logger[_0xcac4('0x10')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x5de3c0,_0x18a7fe[_0xcac4('0x10')][_0xcac4('0x12')]);return _0x283b79(_0x18a7fe[_0xcac4('0x10')][_0xcac4('0x12')]);}else{logger[_0xcac4('0xa')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x5de3c0,'request\x20sent');_0x283b79(_0x18a7fe[_0xcac4('0x13')][_0xcac4('0x12')]);}})[_0xcac4('0x14')](function(_0xb781be){logger[_0xcac4('0x10')](_0xcac4('0xb'),_0x5de3c0,_0xb781be);_0x369a72(_0xb781be);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index fe28c5a..06a6b66 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 _0xb0f8=['/:id/sessions','/:id/answers','getAnswers','/:id/summary','post','create','/:id/clone','clone','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get','isAuthenticated','index','show'];(function(_0x3eea64,_0x26f262){var _0x28ed74=function(_0x4504c9){while(--_0x4504c9){_0x3eea64['push'](_0x3eea64['shift']());}};_0x28ed74(++_0x26f262);}(_0xb0f8,0xcb));var _0x8b0f=function(_0x54ec21,_0x93b362){_0x54ec21=_0x54ec21-0x0;var _0x150815=_0xb0f8[_0x54ec21];return _0x150815;};'use strict';var multer=require(_0x8b0f('0x0'));var util=require(_0x8b0f('0x1'));var path=require(_0x8b0f('0x2'));var timeout=require(_0x8b0f('0x3'));var express=require(_0x8b0f('0x4'));var router=express[_0x8b0f('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8b0f('0x6'));var config=require(_0x8b0f('0x7'));var controller=require(_0x8b0f('0x8'));router[_0x8b0f('0x9')]('/',auth[_0x8b0f('0xa')](),controller[_0x8b0f('0xb')]);router[_0x8b0f('0x9')]('/:id',auth[_0x8b0f('0xa')](),controller[_0x8b0f('0xc')]);router[_0x8b0f('0x9')](_0x8b0f('0xd'),auth['isAuthenticated'](),controller['getSessions']);router[_0x8b0f('0x9')](_0x8b0f('0xe'),auth['isAuthenticated'](),controller[_0x8b0f('0xf')]);router['get'](_0x8b0f('0x10'),auth[_0x8b0f('0xa')](),timeout('30s'),controller['getSummary']);router[_0x8b0f('0x11')]('/',auth['isAuthenticated'](),controller[_0x8b0f('0x12')]);router[_0x8b0f('0x11')](_0x8b0f('0x13'),auth[_0x8b0f('0xa')](),controller[_0x8b0f('0x14')]);router[_0x8b0f('0x15')](_0x8b0f('0x16'),auth[_0x8b0f('0xa')](),controller[_0x8b0f('0x17')]);router[_0x8b0f('0x18')]('/:id',auth[_0x8b0f('0xa')](),controller[_0x8b0f('0x19')]);module[_0x8b0f('0x1a')]=router; \ No newline at end of file +var _0xae4c=['index','/:id','/:id/sessions','getAnswers','/:id/summary','post','create','clone','put','update','exports','multer','util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get','isAuthenticated'];(function(_0x1cc98a,_0x2d152f){var _0x37209d=function(_0xf7cd61){while(--_0xf7cd61){_0x1cc98a['push'](_0x1cc98a['shift']());}};_0x37209d(++_0x2d152f);}(_0xae4c,0x19a));var _0xcae4=function(_0x2f9c17,_0x103d10){_0x2f9c17=_0x2f9c17-0x0;var _0x43d8a5=_0xae4c[_0x2f9c17];return _0x43d8a5;};'use strict';var multer=require(_0xcae4('0x0'));var util=require(_0xcae4('0x1'));var path=require(_0xcae4('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xcae4('0x3')]();var fs_extra=require(_0xcae4('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xcae4('0x5'));var config=require(_0xcae4('0x6'));var controller=require(_0xcae4('0x7'));router[_0xcae4('0x8')]('/',auth[_0xcae4('0x9')](),controller[_0xcae4('0xa')]);router[_0xcae4('0x8')](_0xcae4('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xcae4('0x8')](_0xcae4('0xc'),auth['isAuthenticated'](),controller['getSessions']);router['get']('/:id/answers',auth[_0xcae4('0x9')](),controller[_0xcae4('0xd')]);router[_0xcae4('0x8')](_0xcae4('0xe'),auth[_0xcae4('0x9')](),timeout('30s'),controller['getSummary']);router[_0xcae4('0xf')]('/',auth[_0xcae4('0x9')](),controller[_0xcae4('0x10')]);router[_0xcae4('0xf')]('/:id/clone',auth[_0xcae4('0x9')](),controller[_0xcae4('0x11')]);router[_0xcae4('0x12')](_0xcae4('0xb'),auth[_0xcae4('0x9')](),controller[_0xcae4('0x13')]);router['delete']('/:id',auth[_0xcae4('0x9')](),controller['destroy']);module[_0xcae4('0x14')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index 6f5971e..5cc949a 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 _0xab48=['BOOLEAN','sequelize','lodash','util','STRING','name','TEXT','long','setDataValue','formData','isString','format','getDataValue','description'];(function(_0x20f48a,_0x56e448){var _0x50a3c5=function(_0x4d0dff){while(--_0x4d0dff){_0x20f48a['push'](_0x20f48a['shift']());}};_0x50a3c5(++_0x56e448);}(_0xab48,0x1cf));var _0x8ab4=function(_0x3e81d6,_0x2f52da){_0x3e81d6=_0x3e81d6-0x0;var _0x532e4d=_0xab48[_0x3e81d6];return _0x532e4d;};'use strict';var Sequelize=require(_0x8ab4('0x0'));var _=require(_0x8ab4('0x1'));var util=require(_0x8ab4('0x2'));module['exports']={'name':{'type':Sequelize[_0x8ab4('0x3')],'unique':_0x8ab4('0x4')},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x8ab4('0x5')](_0x8ab4('0x6')),'set':function(_0x1c9bfc){if(_['isObjectLike'](_0x1c9bfc)){this[_0x8ab4('0x7')](_0x8ab4('0x8'),JSON['stringify'](_0x1c9bfc));}else if(_[_0x8ab4('0x9')](_0x1c9bfc)){this[_0x8ab4('0x7')]('formData',_0x1c9bfc);}else{this[_0x8ab4('0x7')](_0x8ab4('0x8'),util[_0x8ab4('0xa')]('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this[_0x8ab4('0xb')](_0x8ab4('0x4'))||'',this[_0x8ab4('0xb')](_0x8ab4('0xc'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x8ab4('0xd')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xeb4c=['isString','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','BOOLEAN','sequelize','lodash','STRING','name','long','isObjectLike','setDataValue','formData','stringify'];(function(_0x242d68,_0xbc7e2){var _0x10c936=function(_0x4c05c7){while(--_0x4c05c7){_0x242d68['push'](_0x242d68['shift']());}};_0x10c936(++_0xbc7e2);}(_0xeb4c,0x1b7));var _0xceb4=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xeb4c[_0x6131cd];return _0x47e916;};'use strict';var Sequelize=require(_0xceb4('0x0'));var _=require(_0xceb4('0x1'));var util=require('util');module['exports']={'name':{'type':Sequelize[_0xceb4('0x2')],'unique':_0xceb4('0x3')},'description':{'type':Sequelize[_0xceb4('0x2')]},'formData':{'type':Sequelize['TEXT'](_0xceb4('0x4')),'set':function(_0x592fee){if(_[_0xceb4('0x5')](_0x592fee)){this[_0xceb4('0x6')](_0xceb4('0x7'),JSON[_0xceb4('0x8')](_0x592fee));}else if(_[_0xceb4('0x9')](_0x592fee)){this[_0xceb4('0x6')]('formData',_0x592fee);}else{this[_0xceb4('0x6')](_0xceb4('0x7'),util[_0xceb4('0xa')](_0xceb4('0xb'),this[_0xceb4('0xc')](_0xceb4('0x3'))||'',this[_0xceb4('0xc')]('description')||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xceb4('0xd')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xceb4('0xd')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index a7a9aee..5c6c9b5 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 _0xb676=['send','index','map','JscriptyProject','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','catch','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','keys','omit','createdAt','updatedAt','user','role','getSessions','JscriptySessionReport','ProjectId','findAll','JscriptyAnswerReport','rows','number','fromCharCode','toString','indexOf','replace','getSummary','startTime','starttime','JscriptyQuestionReport','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','push','now','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Projects','UserProfileResource','stack','name'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb676,0xbc));var _0x6b67=function(_0x597484,_0x199340){_0x597484=_0x597484-0x0;var _0x218e64=_0xb676[_0x597484];return _0x218e64;};'use strict';var emlformat=require(_0x6b67('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6b67('0x1'));var jsonpatch=require(_0x6b67('0x2'));var rp=require(_0x6b67('0x3'));var moment=require(_0x6b67('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6b67('0x5'));var path=require(_0x6b67('0x6'));var sox=require('sox');var csv=require(_0x6b67('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6b67('0x8'));var _=require(_0x6b67('0x9'));var squel=require(_0x6b67('0xa'));var crypto=require('crypto');var jsforce=require(_0x6b67('0xb'));var deskjs=require(_0x6b67('0xc'));var toCsv=require(_0x6b67('0x7'));var querystring=require('querystring');var Papa=require(_0x6b67('0xd'));var Redis=require(_0x6b67('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x6b67('0xf'));var as=require(_0x6b67('0x10'));var hardwareService=require(_0x6b67('0x11'));var logger=require(_0x6b67('0x12'))('api');var utils=require(_0x6b67('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x6b67('0x14'));var db=require(_0x6b67('0x15'))['db'];function respondWithStatusCode(_0x1ebceb,_0x2ab6c5){_0x2ab6c5=_0x2ab6c5||0xcc;return function(_0x3e1bc6){if(_0x3e1bc6){return _0x1ebceb[_0x6b67('0x16')](_0x2ab6c5);}return _0x1ebceb[_0x6b67('0x17')](_0x2ab6c5)[_0x6b67('0x18')]();};}function respondWithResult(_0x2de534,_0x5fb6b3){_0x5fb6b3=_0x5fb6b3||0xc8;return function(_0x8a29a2){if(_0x8a29a2){return _0x2de534['status'](_0x5fb6b3)[_0x6b67('0x19')](_0x8a29a2);}};}function respondWithFilteredResult(_0x2213f4,_0x51e798){return function(_0x187fd4){if(_0x187fd4){var _0x1b6c60=typeof _0x51e798[_0x6b67('0x1a')]===_0x6b67('0x1b')&&typeof _0x51e798['limit']===_0x6b67('0x1b');var _0x46c44e=_0x187fd4[_0x6b67('0x1c')];var _0x46d828=_0x1b6c60?0x0:_0x51e798[_0x6b67('0x1a')];var _0x37d964=_0x1b6c60?_0x187fd4['count']:_0x51e798[_0x6b67('0x1a')]+_0x51e798['limit'];var _0x37cf6d;if(_0x37d964>=_0x46c44e){_0x37d964=_0x46c44e;_0x37cf6d=0xc8;}else{_0x37cf6d=0xce;}_0x2213f4[_0x6b67('0x17')](_0x37cf6d);return _0x2213f4[_0x6b67('0x1d')](_0x6b67('0x1e'),_0x46d828+'-'+_0x37d964+'/'+_0x46c44e)['json'](_0x187fd4);}return null;};}function patchUpdates(_0xd36be3){return function(_0x360208){try{jsonpatch[_0x6b67('0x1f')](_0x360208,_0xd36be3,!![]);}catch(_0x50fdfc){return BPromise[_0x6b67('0x20')](_0x50fdfc);}return _0x360208[_0x6b67('0x21')]();};}function saveUpdates(_0x1fedd5,_0x4d48e1){return function(_0xd4fda5){if(_0xd4fda5){return _0xd4fda5[_0x6b67('0x22')](_0x1fedd5)[_0x6b67('0x23')](function(_0x3a0a3f){return _0x3a0a3f;});}return null;};}function removeEntity(_0x393b3d,_0x17d27b){return function(_0x3c89d2){if(_0x3c89d2){return _0x3c89d2[_0x6b67('0x24')]()[_0x6b67('0x23')](function(){var _0x39bfb2=_0x3c89d2[_0x6b67('0x25')]({'plain':!![]});var _0x47c927=_0x6b67('0x26');return db[_0x6b67('0x27')][_0x6b67('0x24')]({'where':{'type':_0x47c927,'resourceId':_0x39bfb2['id']}})['then'](function(){return _0x3c89d2;});})[_0x6b67('0x23')](function(){_0x393b3d[_0x6b67('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x366039,_0x1d5d4c){return function(_0x3e781b){if(!_0x3e781b){_0x366039[_0x6b67('0x16')](0x194);}return _0x3e781b;};}function handleError(_0x2d97ab,_0x140138){_0x140138=_0x140138||0x1f4;return function(_0x3b65af){logger['error'](_0x3b65af[_0x6b67('0x28')]);if(_0x3b65af[_0x6b67('0x29')]){delete _0x3b65af[_0x6b67('0x29')];}_0x2d97ab[_0x6b67('0x17')](_0x140138)[_0x6b67('0x2a')](_0x3b65af);};}exports[_0x6b67('0x2b')]=function(_0x3c3262,_0x831f14){var _0x50f301={},_0x149e48={},_0x2c9f73={'count':0x0,'rows':[]};var _0xf47146=_[_0x6b67('0x2c')](db[_0x6b67('0x2d')][_0x6b67('0x2e')],function(_0x5af10d){return{'name':_0x5af10d['fieldName'],'type':_0x5af10d[_0x6b67('0x2f')][_0x6b67('0x30')]};});_0x149e48[_0x6b67('0x31')]=_[_0x6b67('0x2c')](_0xf47146,'name');_0x149e48[_0x6b67('0x32')]=_['keys'](_0x3c3262[_0x6b67('0x32')]);_0x149e48[_0x6b67('0x33')]=_[_0x6b67('0x34')](_0x149e48['model'],_0x149e48[_0x6b67('0x32')]);_0x50f301[_0x6b67('0x35')]=_[_0x6b67('0x34')](_0x149e48['model'],qs[_0x6b67('0x36')](_0x3c3262[_0x6b67('0x32')][_0x6b67('0x36')]));_0x50f301[_0x6b67('0x35')]=_0x50f301[_0x6b67('0x35')][_0x6b67('0x37')]?_0x50f301[_0x6b67('0x35')]:_0x149e48[_0x6b67('0x31')];if(!_0x3c3262[_0x6b67('0x32')][_0x6b67('0x38')](_0x6b67('0x39'))){_0x50f301[_0x6b67('0x3a')]=qs[_0x6b67('0x3a')](_0x3c3262['query'][_0x6b67('0x3a')]);_0x50f301[_0x6b67('0x1a')]=qs[_0x6b67('0x1a')](_0x3c3262['query'][_0x6b67('0x1a')]);}_0x50f301[_0x6b67('0x3b')]=qs[_0x6b67('0x3c')](_0x3c3262[_0x6b67('0x32')]['sort']);_0x50f301['where']=qs[_0x6b67('0x33')](_[_0x6b67('0x3d')](_0x3c3262[_0x6b67('0x32')],_0x149e48[_0x6b67('0x33')]),_0xf47146);if(_0x3c3262[_0x6b67('0x32')][_0x6b67('0x3e')]){_0x50f301[_0x6b67('0x3f')]=_[_0x6b67('0x40')](_0x50f301[_0x6b67('0x3f')],{'$or':_[_0x6b67('0x2c')](_0xf47146,function(_0x18ac29){if(_0x18ac29[_0x6b67('0x2f')]!==_0x6b67('0x41')){var _0x3a0d23={};_0x3a0d23[_0x18ac29[_0x6b67('0x29')]]={'$like':'%'+_0x3c3262[_0x6b67('0x32')]['filter']+'%'};return _0x3a0d23;}})});}_0x50f301=_['merge']({},_0x50f301,_0x3c3262[_0x6b67('0x42')]);var _0x4acc0c={'where':_0x50f301[_0x6b67('0x3f')]};return db['JscriptyProject'][_0x6b67('0x1c')](_0x4acc0c)['then'](function(_0x40582a){_0x2c9f73[_0x6b67('0x1c')]=_0x40582a;if(_0x3c3262[_0x6b67('0x32')][_0x6b67('0x43')]){_0x50f301[_0x6b67('0x44')]=[{'all':!![]}];}return db[_0x6b67('0x2d')]['findAll'](_0x50f301);})['then'](function(_0x519dac){_0x2c9f73['rows']=_0x519dac;return _0x2c9f73;})[_0x6b67('0x23')](respondWithFilteredResult(_0x831f14,_0x50f301))[_0x6b67('0x45')](handleError(_0x831f14,null));};exports['show']=function(_0x2d7d1a,_0x13b1a2){var _0x3a2f7d={'raw':![],'where':{'id':_0x2d7d1a[_0x6b67('0x46')]['id']}},_0x47935a={};_0x47935a[_0x6b67('0x31')]=_['keys'](db['JscriptyProject'][_0x6b67('0x2e')]);_0x47935a[_0x6b67('0x32')]=_['keys'](_0x2d7d1a['query']);_0x47935a[_0x6b67('0x33')]=_[_0x6b67('0x34')](_0x47935a['model'],_0x47935a[_0x6b67('0x32')]);_0x3a2f7d[_0x6b67('0x35')]=_[_0x6b67('0x34')](_0x47935a[_0x6b67('0x31')],qs[_0x6b67('0x36')](_0x2d7d1a[_0x6b67('0x32')][_0x6b67('0x36')]));_0x3a2f7d[_0x6b67('0x35')]=_0x3a2f7d['attributes'][_0x6b67('0x37')]?_0x3a2f7d[_0x6b67('0x35')]:_0x47935a[_0x6b67('0x31')];if(_0x2d7d1a[_0x6b67('0x32')][_0x6b67('0x43')]){_0x3a2f7d['include']=[{'all':!![]}];}_0x3a2f7d=_[_0x6b67('0x40')]({},_0x3a2f7d,_0x2d7d1a[_0x6b67('0x42')]);return db['JscriptyProject'][_0x6b67('0x47')](_0x3a2f7d)[_0x6b67('0x23')](handleEntityNotFound(_0x13b1a2,null))[_0x6b67('0x23')](respondWithResult(_0x13b1a2,null))[_0x6b67('0x45')](handleError(_0x13b1a2,null));};exports[_0x6b67('0x48')]=function(_0x7257d0,_0x2b1ace){return db[_0x6b67('0x2d')]['create'](_0x7257d0[_0x6b67('0x49')],{})[_0x6b67('0x23')](function(_0x44e5e1){var _0x28dc71=_0x7257d0['user'][_0x6b67('0x25')]({'plain':!![]});if(!_0x28dc71)throw new Error(_0x6b67('0x4a'));if(_0x28dc71['role']==='user'){var _0x3110b3=_0x44e5e1[_0x6b67('0x25')]({'plain':!![]});var _0x27da14=_0x6b67('0x26');return db[_0x6b67('0x4b')]['find']({'where':{'name':_0x27da14,'userProfileId':_0x28dc71[_0x6b67('0x4c')]},'raw':!![]})[_0x6b67('0x23')](function(_0x101fcd){if(_0x101fcd&&_0x101fcd[_0x6b67('0x4d')]===0x0){return db[_0x6b67('0x27')][_0x6b67('0x48')]({'name':_0x3110b3[_0x6b67('0x29')],'resourceId':_0x3110b3['id'],'type':_0x101fcd[_0x6b67('0x29')],'sectionId':_0x101fcd['id']},{})[_0x6b67('0x23')](function(){return _0x44e5e1;});}else{return _0x44e5e1;}})['catch'](function(_0x3a6078){logger[_0x6b67('0x4e')](_0x6b67('0x4f'),_0x3a6078);throw _0x3a6078;});}return _0x44e5e1;})[_0x6b67('0x23')](respondWithResult(_0x2b1ace,0xc9))[_0x6b67('0x45')](handleError(_0x2b1ace,null));};exports[_0x6b67('0x50')]=function(_0x51aad5,_0x355cae){var _0x4d5b26={'where':{'id':_0x51aad5[_0x6b67('0x46')]['id']}},_0x30a67={};_0x30a67[_0x6b67('0x31')]=_[_0x6b67('0x51')](db[_0x6b67('0x2d')]['rawAttributes']);_0x4d5b26['attributes']=_[_0x6b67('0x34')](_0x30a67[_0x6b67('0x31')],qs['fields'](_0x51aad5['query'][_0x6b67('0x36')]));_0x4d5b26['attributes']=_0x4d5b26[_0x6b67('0x35')][_0x6b67('0x37')]?_0x4d5b26[_0x6b67('0x35')]:_0x30a67['model'];if(_0x51aad5['query'][_0x6b67('0x43')]){_0x4d5b26['include']=[{'all':!![]}];}_0x4d5b26=_[_0x6b67('0x40')]({},_0x4d5b26,_0x51aad5[_0x6b67('0x42')]);return db['JscriptyProject']['find'](_0x4d5b26)['then'](handleEntityNotFound(_0x355cae,null))[_0x6b67('0x23')](function(_0x5e5190){if(_0x5e5190){var _0x248824=_0x5e5190[_0x6b67('0x25')]({'plain':!![]});_0x248824=qs[_0x6b67('0x52')](_0x248824,['id',_0x6b67('0x53'),'updatedAt']);_0x51aad5['body']=_['omit'](_0x51aad5['body'],['id','createdAt',_0x6b67('0x54')]);return db[_0x6b67('0x2d')]['create'](_['merge'](_0x248824,_0x51aad5[_0x6b67('0x49')]),{'include':_0x51aad5['query']['includeAll']?[{'all':!![]}]:undefined})[_0x6b67('0x23')](function(_0x29d966){var _0x41e88f=_0x51aad5[_0x6b67('0x55')]['get']({'plain':!![]});if(!_0x41e88f)throw new Error(_0x6b67('0x4a'));if(_0x41e88f[_0x6b67('0x56')]==='user'){var _0x391b23=_0x29d966[_0x6b67('0x25')]({'plain':!![]});var _0x232e73='Projects';return db['UserProfileSection'][_0x6b67('0x47')]({'where':{'name':_0x232e73,'userProfileId':_0x41e88f[_0x6b67('0x4c')]},'raw':!![]})[_0x6b67('0x23')](function(_0x323b81){if(_0x323b81&&_0x323b81[_0x6b67('0x4d')]===0x0){return db[_0x6b67('0x27')]['create']({'name':_0x391b23[_0x6b67('0x29')],'resourceId':_0x391b23['id'],'type':_0x323b81[_0x6b67('0x29')],'sectionId':_0x323b81['id']},{})[_0x6b67('0x23')](function(){return _0x29d966;});}else{return _0x29d966;}})['catch'](function(_0x51e01a){logger[_0x6b67('0x4e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x51e01a);throw _0x51e01a;});}return _0x29d966;});}})[_0x6b67('0x23')](respondWithResult(_0x355cae,0xc9))['catch'](handleError(_0x355cae,null));};exports[_0x6b67('0x22')]=function(_0x188a6c,_0x21fae4){if(_0x188a6c[_0x6b67('0x49')]['id']){delete _0x188a6c[_0x6b67('0x49')]['id'];}return db[_0x6b67('0x2d')][_0x6b67('0x47')]({'where':{'id':_0x188a6c[_0x6b67('0x46')]['id']}})[_0x6b67('0x23')](handleEntityNotFound(_0x21fae4,null))['then'](saveUpdates(_0x188a6c[_0x6b67('0x49')],null))[_0x6b67('0x23')](respondWithResult(_0x21fae4,null))[_0x6b67('0x45')](handleError(_0x21fae4,null));};exports['destroy']=function(_0x3555f5,_0xb34109){return db[_0x6b67('0x2d')][_0x6b67('0x47')]({'where':{'id':_0x3555f5['params']['id']}})['then'](handleEntityNotFound(_0xb34109,null))['then'](removeEntity(_0xb34109,null))['catch'](handleError(_0xb34109,null));};exports[_0x6b67('0x57')]=function(_0x4dc14a,_0x4fd077,_0x8c55f5){var _0x411e18={'raw':!![],'where':{}};var _0x42b0d3={};var _0xa9b35d={'count':0x0,'rows':[]};return db[_0x6b67('0x2d')]['findOne']({'where':{'id':_0x4dc14a[_0x6b67('0x46')]['id']}})[_0x6b67('0x23')](handleEntityNotFound(_0x4fd077,null))[_0x6b67('0x23')](function(_0x747304){if(_0x747304){_0x42b0d3[_0x6b67('0x31')]=_[_0x6b67('0x51')](db[_0x6b67('0x58')][_0x6b67('0x2e')]);_0x42b0d3['query']=_[_0x6b67('0x51')](_0x4dc14a['query']);_0x42b0d3['filters']=_[_0x6b67('0x34')](_0x42b0d3[_0x6b67('0x31')],_0x42b0d3[_0x6b67('0x32')]);_0x411e18[_0x6b67('0x35')]=_[_0x6b67('0x34')](_0x42b0d3[_0x6b67('0x31')],qs[_0x6b67('0x36')](_0x4dc14a[_0x6b67('0x32')][_0x6b67('0x36')]));_0x411e18[_0x6b67('0x35')]=_0x411e18[_0x6b67('0x35')][_0x6b67('0x37')]?_0x411e18['attributes']:_0x42b0d3[_0x6b67('0x31')];if(!_0x4dc14a[_0x6b67('0x32')][_0x6b67('0x38')](_0x6b67('0x39'))){_0x411e18[_0x6b67('0x3a')]=qs[_0x6b67('0x3a')](_0x4dc14a[_0x6b67('0x32')][_0x6b67('0x3a')]);_0x411e18['offset']=qs[_0x6b67('0x1a')](_0x4dc14a['query']['offset']);}_0x411e18[_0x6b67('0x3b')]=qs[_0x6b67('0x3c')](_0x4dc14a['query'][_0x6b67('0x3c')]);_0x411e18[_0x6b67('0x3f')]=qs[_0x6b67('0x33')](_[_0x6b67('0x3d')](_0x4dc14a[_0x6b67('0x32')],_0x42b0d3['filters']));_0x411e18[_0x6b67('0x3f')][_0x6b67('0x59')]=_0x747304['id'];if(_0x4dc14a[_0x6b67('0x32')][_0x6b67('0x3e')]){_0x411e18[_0x6b67('0x3f')]=_['merge'](_0x411e18[_0x6b67('0x3f')],{'$or':_[_0x6b67('0x2c')](_0x411e18[_0x6b67('0x35')],function(_0x1593f9){var _0x59a922={};_0x59a922[_0x1593f9]={'$like':'%'+_0x4dc14a['query']['filter']+'%'};return _0x59a922;})});}_0x411e18=_[_0x6b67('0x40')]({},_0x411e18,_0x4dc14a[_0x6b67('0x42')]);return db[_0x6b67('0x58')]['count']({'where':_0x411e18['where']})[_0x6b67('0x23')](function(_0xa9e2ef){_0xa9b35d[_0x6b67('0x1c')]=_0xa9e2ef;if(_0x4dc14a[_0x6b67('0x32')]['includeAll']){_0x411e18['include']=[{'all':!![]}];}return db[_0x6b67('0x58')][_0x6b67('0x5a')](_0x411e18);})[_0x6b67('0x23')](function(_0xd91b06){_0xa9b35d['rows']=_0xd91b06;return _0xa9b35d;});}})[_0x6b67('0x23')](respondWithFilteredResult(_0x4fd077,_0x411e18))[_0x6b67('0x45')](handleError(_0x4fd077,null));};exports['getAnswers']=function(_0x406316,_0x38f372,_0x2f86ee){var _0x3b580a={'raw':!![],'where':{}};var _0x2227a5={};var _0x229e40={'count':0x0,'rows':[]};return db['JscriptyProject']['findOne']({'where':{'id':_0x406316[_0x6b67('0x46')]['id']}})[_0x6b67('0x23')](handleEntityNotFound(_0x38f372,null))[_0x6b67('0x23')](function(_0x482cbf){if(_0x482cbf){_0x2227a5['model']=_[_0x6b67('0x51')](db[_0x6b67('0x5b')][_0x6b67('0x2e')]);_0x2227a5[_0x6b67('0x32')]=_[_0x6b67('0x51')](_0x406316[_0x6b67('0x32')]);_0x2227a5[_0x6b67('0x33')]=_[_0x6b67('0x34')](_0x2227a5[_0x6b67('0x31')],_0x2227a5['query']);_0x3b580a['attributes']=_[_0x6b67('0x34')](_0x2227a5['model'],qs[_0x6b67('0x36')](_0x406316['query'][_0x6b67('0x36')]));_0x3b580a['attributes']=_0x3b580a[_0x6b67('0x35')][_0x6b67('0x37')]?_0x3b580a[_0x6b67('0x35')]:_0x2227a5[_0x6b67('0x31')];if(!_0x406316[_0x6b67('0x32')]['hasOwnProperty'](_0x6b67('0x39'))){_0x3b580a['limit']=qs[_0x6b67('0x3a')](_0x406316[_0x6b67('0x32')][_0x6b67('0x3a')]);_0x3b580a['offset']=qs[_0x6b67('0x1a')](_0x406316[_0x6b67('0x32')][_0x6b67('0x1a')]);}_0x3b580a[_0x6b67('0x3b')]=qs[_0x6b67('0x3c')](_0x406316['query'][_0x6b67('0x3c')]);_0x3b580a[_0x6b67('0x3f')]=qs[_0x6b67('0x33')](_[_0x6b67('0x3d')](_0x406316[_0x6b67('0x32')],_0x2227a5[_0x6b67('0x33')]));_0x3b580a[_0x6b67('0x3f')]['ProjectId']=_0x482cbf['id'];if(_0x406316[_0x6b67('0x32')][_0x6b67('0x3e')]){_0x3b580a[_0x6b67('0x3f')]=_[_0x6b67('0x40')](_0x3b580a[_0x6b67('0x3f')],{'$or':_[_0x6b67('0x2c')](_0x3b580a['attributes'],function(_0x3baf0d){var _0x35cfa0={};_0x35cfa0[_0x3baf0d]={'$like':'%'+_0x406316[_0x6b67('0x32')][_0x6b67('0x3e')]+'%'};return _0x35cfa0;})});}_0x3b580a=_[_0x6b67('0x40')]({},_0x3b580a,_0x406316[_0x6b67('0x42')]);return db[_0x6b67('0x5b')]['count']({'where':_0x3b580a[_0x6b67('0x3f')]})[_0x6b67('0x23')](function(_0x58a4e5){_0x229e40[_0x6b67('0x1c')]=_0x58a4e5;if(_0x406316[_0x6b67('0x32')][_0x6b67('0x43')]){_0x3b580a[_0x6b67('0x44')]=[{'all':!![]}];}return db[_0x6b67('0x5b')][_0x6b67('0x5a')](_0x3b580a);})[_0x6b67('0x23')](function(_0x26c221){_0x229e40[_0x6b67('0x5c')]=_0x26c221;return _0x229e40;});}})[_0x6b67('0x23')](respondWithFilteredResult(_0x38f372,_0x3b580a))[_0x6b67('0x45')](handleError(_0x38f372,null));};function char(_0x3fa80a){return _0x6b67('0x5d')===typeof _0x3fa80a?String[_0x6b67('0x5e')][_0x6b67('0x1f')](null,arguments):_0x3fa80a;}function needsEncapsulation(_0x292d8d){return!!_0x292d8d&&(_0x292d8d[_0x6b67('0x5f')]()[_0x6b67('0x60')](char(0xd))>=0x0||_0x292d8d[_0x6b67('0x5f')]()['indexOf'](char(0xa))>=0x0||_0x292d8d[_0x6b67('0x5f')]()['indexOf'](char(0x2c))>=0x0||_0x292d8d[_0x6b67('0x5f')]()[_0x6b67('0x60')](char(0x22))>=0x0);}function encapsulate(_0x2d4f31){var _0xa33247=char(0x22),_0x1cfb6c='\x5c'+char(0x22),_0xc86579=_0x2d4f31['toString']()[_0x6b67('0x61')](new RegExp(_0xa33247,'g'),_0x1cfb6c);return _0xa33247+_0xc86579+_0xa33247;}exports[_0x6b67('0x62')]=function(_0x540d4e,_0x226c7a,_0x3c946e){var _0x40e7a9,_0x693d3d;var _0x797f1={'where':{'ProjectId':_0x540d4e[_0x6b67('0x46')]['id']}};if(_0x540d4e[_0x6b67('0x32')][_0x6b67('0x63')]){_0x797f1['where'][_0x6b67('0x64')]=JSON['parse'](_0x540d4e[_0x6b67('0x32')][_0x6b67('0x63')]);}return db[_0x6b67('0x58')][_0x6b67('0x5a')](_0x797f1)[_0x6b67('0x23')](handleEntityNotFound(_0x226c7a,null))[_0x6b67('0x23')](function(_0x1838fa){if(_0x1838fa){_0x40e7a9=_0x1838fa;return db[_0x6b67('0x65')][_0x6b67('0x5a')]({'where':{'SessionId':{'$in':_[_0x6b67('0x2c')](_0x40e7a9,'id')},'ProjectId':_0x540d4e[_0x6b67('0x46')]['id']},'order':_0x6b67('0x66')});}})[_0x6b67('0x23')](handleEntityNotFound(_0x226c7a,null))[_0x6b67('0x23')](function(_0x492b4c){if(_0x492b4c){_0x693d3d=_0x492b4c;var _0x4cd464={};for(var _0x38d56d=0x0,_0x2ea177=_0x693d3d['length'];_0x38d56d<_0x2ea177;_0x38d56d++){if(!_0x4cd464[_0x6b67('0x38')](_0x693d3d[_0x38d56d][_0x6b67('0x67')])){_0x4cd464[_0x693d3d[_0x38d56d][_0x6b67('0x67')]]=needsEncapsulation(_0x693d3d[_0x38d56d][_0x6b67('0x68')])?encapsulate(_0x693d3d[_0x38d56d][_0x6b67('0x68')]):_0x693d3d[_0x38d56d][_0x6b67('0x68')];}}var _0x4f32ad=[],_0x46570e={};for(var _0x512edd=0x0,_0x1f1a89=_0x40e7a9[_0x6b67('0x37')];_0x512edd<_0x1f1a89;_0x512edd++){_0x46570e={'ProjectId':_0x540d4e[_0x6b67('0x46')]['id'],'SessionId':_0x40e7a9[_0x512edd]['id'],'StartTime':moment(_0x40e7a9[_0x512edd][_0x6b67('0x64')])[_0x6b67('0x69')](_0x6b67('0x6a'))};for(var _0x3b9bde=0x0,_0x459b77=_0x693d3d[_0x6b67('0x37')];_0x3b9bde<_0x459b77;_0x3b9bde++){if(_0x693d3d[_0x3b9bde]['SessionId']==_0x40e7a9[_0x512edd]['id']&&_0x4cd464[_0x6b67('0x38')](_0x693d3d[_0x3b9bde][_0x6b67('0x67')])){_0x46570e[_0x4cd464[_0x693d3d[_0x3b9bde][_0x6b67('0x67')]]]=_0x693d3d[_0x3b9bde]['answer'];}}for(var _0x16aa9b in _0x4cd464){if(!_0x46570e['hasOwnProperty'](_0x4cd464[_0x16aa9b])){_0x46570e[_0x4cd464[_0x16aa9b]]=null;}}_0x4f32ad[_0x6b67('0x6b')](_0x46570e);}return _0x4f32ad;}})['then'](function(_0x448889){if(!_['isEmpty'](_0x448889)){var _0xfb9896=toCsv(_0x448889);var _0x45471d=Date[_0x6b67('0x6c')]();fs['writeFileSync'](util['format'](_0x6b67('0x6d'),_0x540d4e[_0x6b67('0x46')]['id'],_0x45471d),_0xfb9896);_0x226c7a[_0x6b67('0x6e')](_0x6b67('0x6f'),'attachment;\x20filename='+util['format'](_0x6b67('0x70'),_0x540d4e[_0x6b67('0x46')]['id'],_0x45471d));_0x226c7a[_0x6b67('0x6e')](_0x6b67('0x71'),_0x6b67('0x72'));return _0x226c7a['download'](util['format'](_0x6b67('0x6d'),_0x540d4e['params']['id'],_0x45471d));}else{return _0x226c7a[_0x6b67('0x16')](0xcc);}})['catch'](handleError(_0x226c7a,null));}; \ No newline at end of file +var _0xb5fa=['push','now','format','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Content-type','text/csv','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','Projects','destroy','stack','name','send','fieldName','type','key','model','map','query','filters','intersection','attributes','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','options','JscriptyProject','include','findAll','rows','catch','show','keys','rawAttributes','fields','length','includeAll','merge','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','createdAt','updatedAt','omit','user','UserProfileSection','getSessions','findOne','ProjectId','JscriptySessionReport','JscriptyAnswerReport','order','number','toString','indexOf','replace','getSummary','startTime','starttime','parse','JscriptyQuestionReport','-createdAt','questionId','question','YYYY-MM-DD\x20HH:mm:ss','answer'];(function(_0x5e94d4,_0x446746){var _0x320854=function(_0xf9824b){while(--_0xf9824b){_0x5e94d4['push'](_0x5e94d4['shift']());}};_0x320854(++_0x446746);}(_0xb5fa,0xf8));var _0xab5f=function(_0x2b91f7,_0x2d2010){_0x2b91f7=_0x2b91f7-0x0;var _0x470dd4=_0xb5fa[_0x2b91f7];return _0x470dd4;};'use strict';var emlformat=require(_0xab5f('0x0'));var rimraf=require(_0xab5f('0x1'));var zipdir=require(_0xab5f('0x2'));var jsonpatch=require(_0xab5f('0x3'));var rp=require(_0xab5f('0x4'));var moment=require(_0xab5f('0x5'));var BPromise=require(_0xab5f('0x6'));var Mustache=require(_0xab5f('0x7'));var util=require(_0xab5f('0x8'));var path=require(_0xab5f('0x9'));var sox=require(_0xab5f('0xa'));var csv=require(_0xab5f('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xab5f('0xc'));var crypto=require(_0xab5f('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xab5f('0xe'));var toCsv=require(_0xab5f('0xb'));var querystring=require(_0xab5f('0xf'));var Papa=require(_0xab5f('0x10'));var Redis=require(_0xab5f('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xab5f('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xab5f('0x13'));var logger=require('../../config/logger')(_0xab5f('0x14'));var utils=require(_0xab5f('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d9f16,_0x32fca3){_0x32fca3=_0x32fca3||0xcc;return function(_0x56d072){if(_0x56d072){return _0x3d9f16[_0xab5f('0x16')](_0x32fca3);}return _0x3d9f16[_0xab5f('0x17')](_0x32fca3)[_0xab5f('0x18')]();};}function respondWithResult(_0x318335,_0x410269){_0x410269=_0x410269||0xc8;return function(_0x4101ee){if(_0x4101ee){return _0x318335[_0xab5f('0x17')](_0x410269)[_0xab5f('0x19')](_0x4101ee);}};}function respondWithFilteredResult(_0x32def2,_0x45bbf6){return function(_0x2dcfb7){if(_0x2dcfb7){var _0x30089f=typeof _0x45bbf6[_0xab5f('0x1a')]===_0xab5f('0x1b')&&typeof _0x45bbf6[_0xab5f('0x1c')]===_0xab5f('0x1b');var _0xecd649=_0x2dcfb7[_0xab5f('0x1d')];var _0x4aca7d=_0x30089f?0x0:_0x45bbf6[_0xab5f('0x1a')];var _0x4da25e=_0x30089f?_0x2dcfb7[_0xab5f('0x1d')]:_0x45bbf6[_0xab5f('0x1a')]+_0x45bbf6[_0xab5f('0x1c')];var _0x1d6c2b;if(_0x4da25e>=_0xecd649){_0x4da25e=_0xecd649;_0x1d6c2b=0xc8;}else{_0x1d6c2b=0xce;}_0x32def2['status'](_0x1d6c2b);return _0x32def2[_0xab5f('0x1e')](_0xab5f('0x1f'),_0x4aca7d+'-'+_0x4da25e+'/'+_0xecd649)[_0xab5f('0x19')](_0x2dcfb7);}return null;};}function patchUpdates(_0x1bc5ae){return function(_0x34aa5e){try{jsonpatch[_0xab5f('0x20')](_0x34aa5e,_0x1bc5ae,!![]);}catch(_0x58cfa4){return BPromise[_0xab5f('0x21')](_0x58cfa4);}return _0x34aa5e[_0xab5f('0x22')]();};}function saveUpdates(_0x41a2af,_0x5377dd){return function(_0xb47124){if(_0xb47124){return _0xb47124[_0xab5f('0x23')](_0x41a2af)[_0xab5f('0x24')](function(_0x237704){return _0x237704;});}return null;};}function removeEntity(_0x297dff,_0x823c5){return function(_0x4b3127){if(_0x4b3127){return _0x4b3127['destroy']()[_0xab5f('0x24')](function(){var _0x3f3bae=_0x4b3127[_0xab5f('0x25')]({'plain':!![]});var _0x39bf0f=_0xab5f('0x26');return db['UserProfileResource'][_0xab5f('0x27')]({'where':{'type':_0x39bf0f,'resourceId':_0x3f3bae['id']}})[_0xab5f('0x24')](function(){return _0x4b3127;});})['then'](function(){_0x297dff[_0xab5f('0x17')](0xcc)[_0xab5f('0x18')]();});}};}function handleEntityNotFound(_0x56e074,_0x391fec){return function(_0x4fee82){if(!_0x4fee82){_0x56e074[_0xab5f('0x16')](0x194);}return _0x4fee82;};}function handleError(_0x2c0a1a,_0x1e1fa9){_0x1e1fa9=_0x1e1fa9||0x1f4;return function(_0x239229){logger['error'](_0x239229[_0xab5f('0x28')]);if(_0x239229[_0xab5f('0x29')]){delete _0x239229[_0xab5f('0x29')];}_0x2c0a1a[_0xab5f('0x17')](_0x1e1fa9)[_0xab5f('0x2a')](_0x239229);};}exports['index']=function(_0x5c6229,_0x7f5308){var _0x464287={},_0x290df8={},_0x274951={'count':0x0,'rows':[]};var _0x4bd729=_['map'](db['JscriptyProject']['rawAttributes'],function(_0x494c4b){return{'name':_0x494c4b[_0xab5f('0x2b')],'type':_0x494c4b[_0xab5f('0x2c')][_0xab5f('0x2d')]};});_0x290df8[_0xab5f('0x2e')]=_[_0xab5f('0x2f')](_0x4bd729,_0xab5f('0x29'));_0x290df8[_0xab5f('0x30')]=_['keys'](_0x5c6229[_0xab5f('0x30')]);_0x290df8[_0xab5f('0x31')]=_[_0xab5f('0x32')](_0x290df8[_0xab5f('0x2e')],_0x290df8[_0xab5f('0x30')]);_0x464287[_0xab5f('0x33')]=_['intersection'](_0x290df8[_0xab5f('0x2e')],qs['fields'](_0x5c6229[_0xab5f('0x30')]['fields']));_0x464287['attributes']=_0x464287['attributes']['length']?_0x464287[_0xab5f('0x33')]:_0x290df8['model'];if(!_0x5c6229[_0xab5f('0x30')][_0xab5f('0x34')](_0xab5f('0x35'))){_0x464287[_0xab5f('0x1c')]=qs[_0xab5f('0x1c')](_0x5c6229[_0xab5f('0x30')][_0xab5f('0x1c')]);_0x464287[_0xab5f('0x1a')]=qs[_0xab5f('0x1a')](_0x5c6229['query'][_0xab5f('0x1a')]);}_0x464287['order']=qs[_0xab5f('0x36')](_0x5c6229[_0xab5f('0x30')][_0xab5f('0x36')]);_0x464287['where']=qs[_0xab5f('0x31')](_[_0xab5f('0x37')](_0x5c6229[_0xab5f('0x30')],_0x290df8[_0xab5f('0x31')]),_0x4bd729);if(_0x5c6229[_0xab5f('0x30')][_0xab5f('0x38')]){_0x464287[_0xab5f('0x39')]=_['merge'](_0x464287[_0xab5f('0x39')],{'$or':_[_0xab5f('0x2f')](_0x4bd729,function(_0x6298c4){if(_0x6298c4[_0xab5f('0x2c')]!==_0xab5f('0x3a')){var _0x141a34={};_0x141a34[_0x6298c4[_0xab5f('0x29')]]={'$like':'%'+_0x5c6229[_0xab5f('0x30')]['filter']+'%'};return _0x141a34;}})});}_0x464287=_['merge']({},_0x464287,_0x5c6229[_0xab5f('0x3b')]);var _0x384cbf={'where':_0x464287['where']};return db[_0xab5f('0x3c')]['count'](_0x384cbf)[_0xab5f('0x24')](function(_0x71490a){_0x274951['count']=_0x71490a;if(_0x5c6229[_0xab5f('0x30')]['includeAll']){_0x464287[_0xab5f('0x3d')]=[{'all':!![]}];}return db[_0xab5f('0x3c')][_0xab5f('0x3e')](_0x464287);})[_0xab5f('0x24')](function(_0x2da96f){_0x274951[_0xab5f('0x3f')]=_0x2da96f;return _0x274951;})['then'](respondWithFilteredResult(_0x7f5308,_0x464287))[_0xab5f('0x40')](handleError(_0x7f5308,null));};exports[_0xab5f('0x41')]=function(_0x22249a,_0x2e81c6){var _0x366c5d={'raw':![],'where':{'id':_0x22249a['params']['id']}},_0x358e13={};_0x358e13[_0xab5f('0x2e')]=_[_0xab5f('0x42')](db['JscriptyProject'][_0xab5f('0x43')]);_0x358e13['query']=_[_0xab5f('0x42')](_0x22249a[_0xab5f('0x30')]);_0x358e13['filters']=_[_0xab5f('0x32')](_0x358e13[_0xab5f('0x2e')],_0x358e13[_0xab5f('0x30')]);_0x366c5d[_0xab5f('0x33')]=_[_0xab5f('0x32')](_0x358e13[_0xab5f('0x2e')],qs[_0xab5f('0x44')](_0x22249a[_0xab5f('0x30')]['fields']));_0x366c5d[_0xab5f('0x33')]=_0x366c5d[_0xab5f('0x33')][_0xab5f('0x45')]?_0x366c5d['attributes']:_0x358e13[_0xab5f('0x2e')];if(_0x22249a[_0xab5f('0x30')][_0xab5f('0x46')]){_0x366c5d[_0xab5f('0x3d')]=[{'all':!![]}];}_0x366c5d=_[_0xab5f('0x47')]({},_0x366c5d,_0x22249a[_0xab5f('0x3b')]);return db[_0xab5f('0x3c')][_0xab5f('0x48')](_0x366c5d)[_0xab5f('0x24')](handleEntityNotFound(_0x2e81c6,null))[_0xab5f('0x24')](respondWithResult(_0x2e81c6,null))[_0xab5f('0x40')](handleError(_0x2e81c6,null));};exports[_0xab5f('0x49')]=function(_0x4502ee,_0x28a126){return db['JscriptyProject'][_0xab5f('0x49')](_0x4502ee[_0xab5f('0x4a')],{})[_0xab5f('0x24')](function(_0x2456d0){var _0x8c6acb=_0x4502ee['user']['get']({'plain':!![]});if(!_0x8c6acb)throw new Error(_0xab5f('0x4b'));if(_0x8c6acb[_0xab5f('0x4c')]==='user'){var _0x409c61=_0x2456d0[_0xab5f('0x25')]({'plain':!![]});var _0x85fd96=_0xab5f('0x26');return db['UserProfileSection']['find']({'where':{'name':_0x85fd96,'userProfileId':_0x8c6acb[_0xab5f('0x4d')]},'raw':!![]})[_0xab5f('0x24')](function(_0x5869b1){if(_0x5869b1&&_0x5869b1[_0xab5f('0x4e')]===0x0){return db[_0xab5f('0x4f')]['create']({'name':_0x409c61['name'],'resourceId':_0x409c61['id'],'type':_0x5869b1[_0xab5f('0x29')],'sectionId':_0x5869b1['id']},{})['then'](function(){return _0x2456d0;});}else{return _0x2456d0;}})[_0xab5f('0x40')](function(_0x49a507){logger[_0xab5f('0x50')](_0xab5f('0x51'),_0x49a507);throw _0x49a507;});}return _0x2456d0;})[_0xab5f('0x24')](respondWithResult(_0x28a126,0xc9))[_0xab5f('0x40')](handleError(_0x28a126,null));};exports[_0xab5f('0x52')]=function(_0x81a92e,_0x149a86){var _0x454932={'where':{'id':_0x81a92e[_0xab5f('0x53')]['id']}},_0x4c5f73={};_0x4c5f73['model']=_['keys'](db[_0xab5f('0x3c')]['rawAttributes']);_0x454932[_0xab5f('0x33')]=_[_0xab5f('0x32')](_0x4c5f73[_0xab5f('0x2e')],qs[_0xab5f('0x44')](_0x81a92e[_0xab5f('0x30')][_0xab5f('0x44')]));_0x454932[_0xab5f('0x33')]=_0x454932[_0xab5f('0x33')][_0xab5f('0x45')]?_0x454932['attributes']:_0x4c5f73[_0xab5f('0x2e')];if(_0x81a92e[_0xab5f('0x30')][_0xab5f('0x46')]){_0x454932[_0xab5f('0x3d')]=[{'all':!![]}];}_0x454932=_['merge']({},_0x454932,_0x81a92e[_0xab5f('0x3b')]);return db[_0xab5f('0x3c')][_0xab5f('0x48')](_0x454932)[_0xab5f('0x24')](handleEntityNotFound(_0x149a86,null))[_0xab5f('0x24')](function(_0x4cee7a){if(_0x4cee7a){var _0x95788d=_0x4cee7a[_0xab5f('0x25')]({'plain':!![]});_0x95788d=qs['omit'](_0x95788d,['id',_0xab5f('0x54'),_0xab5f('0x55')]);_0x81a92e[_0xab5f('0x4a')]=_[_0xab5f('0x56')](_0x81a92e[_0xab5f('0x4a')],['id',_0xab5f('0x54'),_0xab5f('0x55')]);return db['JscriptyProject'][_0xab5f('0x49')](_[_0xab5f('0x47')](_0x95788d,_0x81a92e[_0xab5f('0x4a')]),{'include':_0x81a92e[_0xab5f('0x30')][_0xab5f('0x46')]?[{'all':!![]}]:undefined})[_0xab5f('0x24')](function(_0x5650b2){var _0x549c4a=_0x81a92e[_0xab5f('0x57')][_0xab5f('0x25')]({'plain':!![]});if(!_0x549c4a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x549c4a[_0xab5f('0x4c')]===_0xab5f('0x57')){var _0x4efbc4=_0x5650b2[_0xab5f('0x25')]({'plain':!![]});var _0x8e054=_0xab5f('0x26');return db[_0xab5f('0x58')]['find']({'where':{'name':_0x8e054,'userProfileId':_0x549c4a['userProfileId']},'raw':!![]})[_0xab5f('0x24')](function(_0x449fb3){if(_0x449fb3&&_0x449fb3[_0xab5f('0x4e')]===0x0){return db['UserProfileResource'][_0xab5f('0x49')]({'name':_0x4efbc4[_0xab5f('0x29')],'resourceId':_0x4efbc4['id'],'type':_0x449fb3['name'],'sectionId':_0x449fb3['id']},{})[_0xab5f('0x24')](function(){return _0x5650b2;});}else{return _0x5650b2;}})[_0xab5f('0x40')](function(_0x30911c){logger[_0xab5f('0x50')](_0xab5f('0x51'),_0x30911c);throw _0x30911c;});}return _0x5650b2;});}})[_0xab5f('0x24')](respondWithResult(_0x149a86,0xc9))[_0xab5f('0x40')](handleError(_0x149a86,null));};exports[_0xab5f('0x23')]=function(_0x30506e,_0x465c2e){if(_0x30506e[_0xab5f('0x4a')]['id']){delete _0x30506e['body']['id'];}return db[_0xab5f('0x3c')][_0xab5f('0x48')]({'where':{'id':_0x30506e[_0xab5f('0x53')]['id']}})[_0xab5f('0x24')](handleEntityNotFound(_0x465c2e,null))['then'](saveUpdates(_0x30506e[_0xab5f('0x4a')],null))[_0xab5f('0x24')](respondWithResult(_0x465c2e,null))['catch'](handleError(_0x465c2e,null));};exports[_0xab5f('0x27')]=function(_0x185f8a,_0x4893b9){return db['JscriptyProject'][_0xab5f('0x48')]({'where':{'id':_0x185f8a[_0xab5f('0x53')]['id']}})[_0xab5f('0x24')](handleEntityNotFound(_0x4893b9,null))[_0xab5f('0x24')](removeEntity(_0x4893b9,null))[_0xab5f('0x40')](handleError(_0x4893b9,null));};exports[_0xab5f('0x59')]=function(_0x2acbaf,_0x2026da,_0x58442f){var _0xfa3b29={'raw':!![],'where':{}};var _0x10b5d4={};var _0x36b3bc={'count':0x0,'rows':[]};return db[_0xab5f('0x3c')][_0xab5f('0x5a')]({'where':{'id':_0x2acbaf[_0xab5f('0x53')]['id']}})[_0xab5f('0x24')](handleEntityNotFound(_0x2026da,null))[_0xab5f('0x24')](function(_0x1939ab){if(_0x1939ab){_0x10b5d4[_0xab5f('0x2e')]=_['keys'](db['JscriptySessionReport']['rawAttributes']);_0x10b5d4[_0xab5f('0x30')]=_['keys'](_0x2acbaf[_0xab5f('0x30')]);_0x10b5d4[_0xab5f('0x31')]=_['intersection'](_0x10b5d4['model'],_0x10b5d4[_0xab5f('0x30')]);_0xfa3b29[_0xab5f('0x33')]=_[_0xab5f('0x32')](_0x10b5d4['model'],qs[_0xab5f('0x44')](_0x2acbaf[_0xab5f('0x30')][_0xab5f('0x44')]));_0xfa3b29[_0xab5f('0x33')]=_0xfa3b29[_0xab5f('0x33')][_0xab5f('0x45')]?_0xfa3b29[_0xab5f('0x33')]:_0x10b5d4[_0xab5f('0x2e')];if(!_0x2acbaf[_0xab5f('0x30')][_0xab5f('0x34')]('nolimit')){_0xfa3b29['limit']=qs[_0xab5f('0x1c')](_0x2acbaf['query'][_0xab5f('0x1c')]);_0xfa3b29['offset']=qs[_0xab5f('0x1a')](_0x2acbaf[_0xab5f('0x30')]['offset']);}_0xfa3b29['order']=qs[_0xab5f('0x36')](_0x2acbaf[_0xab5f('0x30')][_0xab5f('0x36')]);_0xfa3b29[_0xab5f('0x39')]=qs[_0xab5f('0x31')](_[_0xab5f('0x37')](_0x2acbaf[_0xab5f('0x30')],_0x10b5d4['filters']));_0xfa3b29['where'][_0xab5f('0x5b')]=_0x1939ab['id'];if(_0x2acbaf['query'][_0xab5f('0x38')]){_0xfa3b29[_0xab5f('0x39')]=_['merge'](_0xfa3b29[_0xab5f('0x39')],{'$or':_[_0xab5f('0x2f')](_0xfa3b29[_0xab5f('0x33')],function(_0x4ff35f){var _0x4f5881={};_0x4f5881[_0x4ff35f]={'$like':'%'+_0x2acbaf[_0xab5f('0x30')][_0xab5f('0x38')]+'%'};return _0x4f5881;})});}_0xfa3b29=_['merge']({},_0xfa3b29,_0x2acbaf['options']);return db[_0xab5f('0x5c')][_0xab5f('0x1d')]({'where':_0xfa3b29[_0xab5f('0x39')]})[_0xab5f('0x24')](function(_0x12430f){_0x36b3bc[_0xab5f('0x1d')]=_0x12430f;if(_0x2acbaf[_0xab5f('0x30')]['includeAll']){_0xfa3b29[_0xab5f('0x3d')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0xab5f('0x3e')](_0xfa3b29);})[_0xab5f('0x24')](function(_0x192803){_0x36b3bc[_0xab5f('0x3f')]=_0x192803;return _0x36b3bc;});}})[_0xab5f('0x24')](respondWithFilteredResult(_0x2026da,_0xfa3b29))[_0xab5f('0x40')](handleError(_0x2026da,null));};exports['getAnswers']=function(_0x36bc47,_0x12f94e,_0x12756c){var _0x9c9b9={'raw':!![],'where':{}};var _0x309735={};var _0x13b2e7={'count':0x0,'rows':[]};return db['JscriptyProject'][_0xab5f('0x5a')]({'where':{'id':_0x36bc47[_0xab5f('0x53')]['id']}})[_0xab5f('0x24')](handleEntityNotFound(_0x12f94e,null))[_0xab5f('0x24')](function(_0x4ae277){if(_0x4ae277){_0x309735['model']=_[_0xab5f('0x42')](db[_0xab5f('0x5d')][_0xab5f('0x43')]);_0x309735[_0xab5f('0x30')]=_[_0xab5f('0x42')](_0x36bc47['query']);_0x309735[_0xab5f('0x31')]=_['intersection'](_0x309735[_0xab5f('0x2e')],_0x309735['query']);_0x9c9b9[_0xab5f('0x33')]=_['intersection'](_0x309735[_0xab5f('0x2e')],qs[_0xab5f('0x44')](_0x36bc47[_0xab5f('0x30')][_0xab5f('0x44')]));_0x9c9b9[_0xab5f('0x33')]=_0x9c9b9[_0xab5f('0x33')][_0xab5f('0x45')]?_0x9c9b9[_0xab5f('0x33')]:_0x309735[_0xab5f('0x2e')];if(!_0x36bc47[_0xab5f('0x30')][_0xab5f('0x34')](_0xab5f('0x35'))){_0x9c9b9[_0xab5f('0x1c')]=qs[_0xab5f('0x1c')](_0x36bc47[_0xab5f('0x30')]['limit']);_0x9c9b9[_0xab5f('0x1a')]=qs['offset'](_0x36bc47[_0xab5f('0x30')]['offset']);}_0x9c9b9[_0xab5f('0x5e')]=qs[_0xab5f('0x36')](_0x36bc47[_0xab5f('0x30')][_0xab5f('0x36')]);_0x9c9b9['where']=qs[_0xab5f('0x31')](_['pick'](_0x36bc47['query'],_0x309735['filters']));_0x9c9b9['where'][_0xab5f('0x5b')]=_0x4ae277['id'];if(_0x36bc47[_0xab5f('0x30')][_0xab5f('0x38')]){_0x9c9b9[_0xab5f('0x39')]=_[_0xab5f('0x47')](_0x9c9b9[_0xab5f('0x39')],{'$or':_['map'](_0x9c9b9[_0xab5f('0x33')],function(_0x402a45){var _0x3b332b={};_0x3b332b[_0x402a45]={'$like':'%'+_0x36bc47['query'][_0xab5f('0x38')]+'%'};return _0x3b332b;})});}_0x9c9b9=_[_0xab5f('0x47')]({},_0x9c9b9,_0x36bc47[_0xab5f('0x3b')]);return db[_0xab5f('0x5d')][_0xab5f('0x1d')]({'where':_0x9c9b9['where']})[_0xab5f('0x24')](function(_0x291d86){_0x13b2e7['count']=_0x291d86;if(_0x36bc47[_0xab5f('0x30')][_0xab5f('0x46')]){_0x9c9b9['include']=[{'all':!![]}];}return db[_0xab5f('0x5d')][_0xab5f('0x3e')](_0x9c9b9);})[_0xab5f('0x24')](function(_0x52d479){_0x13b2e7['rows']=_0x52d479;return _0x13b2e7;});}})[_0xab5f('0x24')](respondWithFilteredResult(_0x12f94e,_0x9c9b9))[_0xab5f('0x40')](handleError(_0x12f94e,null));};function char(_0x23276f){return _0xab5f('0x5f')===typeof _0x23276f?String['fromCharCode'][_0xab5f('0x20')](null,arguments):_0x23276f;}function needsEncapsulation(_0x5d3b1b){return!!_0x5d3b1b&&(_0x5d3b1b[_0xab5f('0x60')]()[_0xab5f('0x61')](char(0xd))>=0x0||_0x5d3b1b[_0xab5f('0x60')]()[_0xab5f('0x61')](char(0xa))>=0x0||_0x5d3b1b[_0xab5f('0x60')]()[_0xab5f('0x61')](char(0x2c))>=0x0||_0x5d3b1b[_0xab5f('0x60')]()[_0xab5f('0x61')](char(0x22))>=0x0);}function encapsulate(_0x30f432){var _0x1bd586=char(0x22),_0xf1566f='\x5c'+char(0x22),_0xc78dc4=_0x30f432[_0xab5f('0x60')]()[_0xab5f('0x62')](new RegExp(_0x1bd586,'g'),_0xf1566f);return _0x1bd586+_0xc78dc4+_0x1bd586;}exports[_0xab5f('0x63')]=function(_0x32d501,_0x17c9e9,_0x50872f){var _0x28cf22,_0x543e59;var _0x296e87={'where':{'ProjectId':_0x32d501[_0xab5f('0x53')]['id']}};if(_0x32d501['query'][_0xab5f('0x64')]){_0x296e87[_0xab5f('0x39')][_0xab5f('0x65')]=JSON[_0xab5f('0x66')](_0x32d501[_0xab5f('0x30')][_0xab5f('0x64')]);}return db[_0xab5f('0x5c')][_0xab5f('0x3e')](_0x296e87)[_0xab5f('0x24')](handleEntityNotFound(_0x17c9e9,null))[_0xab5f('0x24')](function(_0x12ed24){if(_0x12ed24){_0x28cf22=_0x12ed24;return db[_0xab5f('0x67')][_0xab5f('0x3e')]({'where':{'SessionId':{'$in':_[_0xab5f('0x2f')](_0x28cf22,'id')},'ProjectId':_0x32d501[_0xab5f('0x53')]['id']},'order':_0xab5f('0x68')});}})[_0xab5f('0x24')](handleEntityNotFound(_0x17c9e9,null))[_0xab5f('0x24')](function(_0x6f9d2f){if(_0x6f9d2f){_0x543e59=_0x6f9d2f;var _0x2b1977={};for(var _0x4ff6a9=0x0,_0x5b2035=_0x543e59[_0xab5f('0x45')];_0x4ff6a9<_0x5b2035;_0x4ff6a9++){if(!_0x2b1977[_0xab5f('0x34')](_0x543e59[_0x4ff6a9][_0xab5f('0x69')])){_0x2b1977[_0x543e59[_0x4ff6a9]['questionId']]=needsEncapsulation(_0x543e59[_0x4ff6a9][_0xab5f('0x6a')])?encapsulate(_0x543e59[_0x4ff6a9][_0xab5f('0x6a')]):_0x543e59[_0x4ff6a9][_0xab5f('0x6a')];}}var _0x12e073=[],_0x6f1db9={};for(var _0x5a0d88=0x0,_0x5c16d6=_0x28cf22[_0xab5f('0x45')];_0x5a0d88<_0x5c16d6;_0x5a0d88++){_0x6f1db9={'ProjectId':_0x32d501[_0xab5f('0x53')]['id'],'SessionId':_0x28cf22[_0x5a0d88]['id'],'StartTime':moment(_0x28cf22[_0x5a0d88]['starttime'])['format'](_0xab5f('0x6b'))};for(var _0x3a8573=0x0,_0x3c7e04=_0x543e59[_0xab5f('0x45')];_0x3a8573<_0x3c7e04;_0x3a8573++){if(_0x543e59[_0x3a8573]['SessionId']==_0x28cf22[_0x5a0d88]['id']&&_0x2b1977[_0xab5f('0x34')](_0x543e59[_0x3a8573]['questionId'])){_0x6f1db9[_0x2b1977[_0x543e59[_0x3a8573][_0xab5f('0x69')]]]=_0x543e59[_0x3a8573][_0xab5f('0x6c')];}}for(var _0x21d746 in _0x2b1977){if(!_0x6f1db9[_0xab5f('0x34')](_0x2b1977[_0x21d746])){_0x6f1db9[_0x2b1977[_0x21d746]]=null;}}_0x12e073[_0xab5f('0x6d')](_0x6f1db9);}return _0x12e073;}})[_0xab5f('0x24')](function(_0x1028bc){if(!_['isEmpty'](_0x1028bc)){var _0x1baab8=toCsv(_0x1028bc);var _0x1284d0=Date[_0xab5f('0x6e')]();fs['writeFileSync'](util[_0xab5f('0x6f')](_0xab5f('0x70'),_0x32d501[_0xab5f('0x53')]['id'],_0x1284d0),_0x1baab8);_0x17c9e9[_0xab5f('0x71')](_0xab5f('0x72'),_0xab5f('0x73')+util[_0xab5f('0x6f')]('Jscripty_Project_%d_Summary_%s.csv',_0x32d501[_0xab5f('0x53')]['id'],_0x1284d0));_0x17c9e9[_0xab5f('0x71')](_0xab5f('0x74'),_0xab5f('0x75'));return _0x17c9e9[_0xab5f('0x76')](util[_0xab5f('0x6f')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x32d501['params']['id'],_0x1284d0));}else{return _0x17c9e9[_0xab5f('0x16')](0xcc);}})[_0xab5f('0x40')](handleError(_0x17c9e9,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 7fa3261..1055ff0 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 _0x8a28=['JscriptyProject','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./jscriptyProject.attributes','exports'];(function(_0xa9ae64,_0x1b1946){var _0x45637a=function(_0x4c44b0){while(--_0x4c44b0){_0xa9ae64['push'](_0xa9ae64['shift']());}};_0x45637a(++_0x1b1946);}(_0x8a28,0xfd));var _0x88a2=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x8a28[_0x2d7f0e];return _0x110b07;};'use strict';var _=require(_0x88a2('0x0'));var util=require(_0x88a2('0x1'));var logger=require(_0x88a2('0x2'))(_0x88a2('0x3'));var moment=require(_0x88a2('0x4'));var BPromise=require(_0x88a2('0x5'));var rp=require(_0x88a2('0x6'));var fs=require('fs');var path=require(_0x88a2('0x7'));var rimraf=require('rimraf');var config=require(_0x88a2('0x8'));var attributes=require(_0x88a2('0x9'));module[_0x88a2('0xa')]=function(_0x438e32,_0x29ce92){return _0x438e32['define'](_0x88a2('0xb'),attributes,{'tableName':'jscripty_projects','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa049=['path','rimraf','../../config/environment','./jscriptyProject.attributes','exports','define','jscripty_projects','lodash','util','api','moment','bluebird','request-promise'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xa049,0x1db));var _0x9a04=function(_0x18b344,_0x271f68){_0x18b344=_0x18b344-0x0;var _0x5ef6bb=_0xa049[_0x18b344];return _0x5ef6bb;};'use strict';var _=require(_0x9a04('0x0'));var util=require(_0x9a04('0x1'));var logger=require('../../config/logger')(_0x9a04('0x2'));var moment=require(_0x9a04('0x3'));var BPromise=require(_0x9a04('0x4'));var rp=require(_0x9a04('0x5'));var fs=require('fs');var path=require(_0x9a04('0x6'));var rimraf=require(_0x9a04('0x7'));var config=require(_0x9a04('0x8'));var attributes=require(_0x9a04('0x9'));module[_0x9a04('0xa')]=function(_0x570be2,_0x3cacca){return _0x570be2[_0x9a04('0xb')]('JscriptyProject',attributes,{'tableName':_0x9a04('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.rpc.js b/server/api/jscriptyProject/jscriptyProject.rpc.js index 91ccfa1..e56bac2 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 _0xda3f=['rpc','jayson/promise','client','request','then','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','../../mysqldb','../../config/logger'];(function(_0x134192,_0x36adc5){var _0x3cd080=function(_0x134371){while(--_0x134371){_0x134192['push'](_0x134192['shift']());}};_0x3cd080(++_0x36adc5);}(_0xda3f,0xec));var _0xfda3=function(_0x488df1,_0x377daa){_0x488df1=_0x488df1-0x0;var _0x3d692d=_0xda3f[_0x488df1];return _0x3d692d;};'use strict';var _=require('lodash');var util=require(_0xfda3('0x0'));var moment=require(_0xfda3('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfda3('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xfda3('0x3'))(_0xfda3('0x4'));var config=require('../../config/environment');var jayson=require(_0xfda3('0x5'));var client=jayson[_0xfda3('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e72d1,_0x316792,_0x42476a){return new BPromise(function(_0x125e2a,_0x4018c0){return client[_0xfda3('0x7')](_0x4e72d1,_0x42476a)[_0xfda3('0x8')](function(_0x46655c){logger[_0xfda3('0x9')](_0xfda3('0xa'),_0x316792,_0xfda3('0xb'));logger[_0xfda3('0xc')](_0xfda3('0xd'),_0x316792,'request\x20sent',JSON[_0xfda3('0xe')](_0x46655c));if(_0x46655c[_0xfda3('0xf')]){if(_0x46655c[_0xfda3('0xf')][_0xfda3('0x10')]===0x1f4){logger[_0xfda3('0xf')]('JscriptyProject,\x20%s,\x20%s',_0x316792,_0x46655c[_0xfda3('0xf')]['message']);return _0x4018c0(_0x46655c[_0xfda3('0xf')][_0xfda3('0x11')]);}logger['error']('JscriptyProject,\x20%s,\x20%s',_0x316792,_0x46655c['error'][_0xfda3('0x11')]);return _0x125e2a(_0x46655c[_0xfda3('0xf')]['message']);}else{logger['info']('JscriptyProject,\x20%s,\x20%s',_0x316792,_0xfda3('0xb'));_0x125e2a(_0x46655c[_0xfda3('0x12')][_0xfda3('0x11')]);}})[_0xfda3('0x13')](function(_0x34900d){logger[_0xfda3('0xf')](_0xfda3('0xa'),_0x316792,_0x34900d);_0x4018c0(_0x34900d);});});} \ No newline at end of file +var _0x0713=['JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x3b2262,_0x36c269){var _0xb85f96=function(_0x3892f3){while(--_0x3892f3){_0x3b2262['push'](_0x3b2262['shift']());}};_0xb85f96(++_0x36c269);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var BPromise=require(_0x3071('0x1'));var rs=require(_0x3071('0x2'));var fs=require('fs');var Redis=require(_0x3071('0x3'));var db=require(_0x3071('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3071('0x5'))(_0x3071('0x6'));var config=require(_0x3071('0x7'));var jayson=require(_0x3071('0x8'));var client=jayson[_0x3071('0x9')][_0x3071('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d3dd6,_0x2f1e87,_0xbd737f){return new BPromise(function(_0x22274c,_0x3e9a5e){return client[_0x3071('0xb')](_0x1d3dd6,_0xbd737f)[_0x3071('0xc')](function(_0x4a36ec){logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));logger[_0x3071('0x10')](_0x3071('0x11'),_0x2f1e87,'request\x20sent',JSON[_0x3071('0x12')](_0x4a36ec));if(_0x4a36ec[_0x3071('0x13')]){if(_0x4a36ec[_0x3071('0x13')][_0x3071('0x14')]===0x1f4){logger[_0x3071('0x13')]('JscriptyProject,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec['error'][_0x3071('0x15')]);return _0x3e9a5e(_0x4a36ec['error'][_0x3071('0x15')]);}logger[_0x3071('0x13')]('JscriptyProject,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec[_0x3071('0x13')]['message']);return _0x22274c(_0x4a36ec[_0x3071('0x13')][_0x3071('0x15')]);}else{logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));_0x22274c(_0x4a36ec[_0x3071('0x16')][_0x3071('0x15')]);}})[_0x3071('0x17')](function(_0x21aad3){logger[_0x3071('0x13')]('JscriptyProject,\x20%s,\x20%s',_0x2f1e87,_0x21aad3);_0x3e9a5e(_0x21aad3);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index 0139b35..c9ece55 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 _0x35ff=['../../components/auth/service','../../config/environment','./jscriptyQuestionReport.controller','isAuthenticated','index','get','describe','/:id','show','post','create','put','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x35ff,0x78));var _0xf35f=function(_0x2d6b83,_0x481b74){_0x2d6b83=_0x2d6b83-0x0;var _0x4ecccd=_0x35ff[_0x2d6b83];return _0x4ecccd;};'use strict';var multer=require('multer');var util=require(_0xf35f('0x0'));var path=require(_0xf35f('0x1'));var timeout=require(_0xf35f('0x2'));var express=require(_0xf35f('0x3'));var router=express[_0xf35f('0x4')]();var fs_extra=require(_0xf35f('0x5'));var auth=require(_0xf35f('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xf35f('0x7'));var controller=require(_0xf35f('0x8'));router['get']('/',auth[_0xf35f('0x9')](),controller[_0xf35f('0xa')]);router[_0xf35f('0xb')]('/describe',auth[_0xf35f('0x9')](),controller[_0xf35f('0xc')]);router[_0xf35f('0xb')](_0xf35f('0xd'),auth[_0xf35f('0x9')](),controller[_0xf35f('0xe')]);router[_0xf35f('0xf')]('/',auth[_0xf35f('0x9')](),controller[_0xf35f('0x10')]);router[_0xf35f('0x11')]('/:id',auth[_0xf35f('0x9')](),controller[_0xf35f('0x12')]);router[_0xf35f('0x13')](_0xf35f('0xd'),auth[_0xf35f('0x9')](),controller['destroy']);module[_0xf35f('0x14')]=router; \ No newline at end of file +var _0x0993=['describe','/:id','show','create','put','update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get','index','/describe','isAuthenticated'];(function(_0x481c9e,_0x1e6dd9){var _0x1127ff=function(_0x2301c8){while(--_0x2301c8){_0x481c9e['push'](_0x481c9e['shift']());}};_0x1127ff(++_0x1e6dd9);}(_0x0993,0x12e));var _0x3099=function(_0x27573e,_0x29d585){_0x27573e=_0x27573e-0x0;var _0x1d62f8=_0x0993[_0x27573e];return _0x1d62f8;};'use strict';var multer=require(_0x3099('0x0'));var util=require(_0x3099('0x1'));var path=require('path');var timeout=require(_0x3099('0x2'));var express=require(_0x3099('0x3'));var router=express[_0x3099('0x4')]();var fs_extra=require(_0x3099('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x3099('0x6'));var config=require(_0x3099('0x7'));var controller=require(_0x3099('0x8'));router[_0x3099('0x9')]('/',auth['isAuthenticated'](),controller[_0x3099('0xa')]);router[_0x3099('0x9')](_0x3099('0xb'),auth[_0x3099('0xc')](),controller[_0x3099('0xd')]);router['get'](_0x3099('0xe'),auth['isAuthenticated'](),controller[_0x3099('0xf')]);router['post']('/',auth[_0x3099('0xc')](),controller[_0x3099('0x10')]);router[_0x3099('0x11')](_0x3099('0xe'),auth[_0x3099('0xc')](),controller[_0x3099('0x12')]);router[_0x3099('0x13')](_0x3099('0xe'),auth[_0x3099('0xc')](),controller[_0x3099('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index 60bd853..90818be 100644 --- a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js +++ b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0x7a54,0x106));var _0x47a5=function(_0x27cf3f,_0x5f4485){_0x27cf3f=_0x27cf3f-0x0;var _0x4a59b2=_0x7a54[_0x27cf3f];return _0x4a59b2;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file +var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0x7a54,0x106));var _0x47a5=function(_0x35bb4d,_0x2bb602){_0x35bb4d=_0x35bb4d-0x0;var _0x92ba28=_0x7a54[_0x35bb4d];return _0x92ba28;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js index 46b6fe7..dc44d77 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 _0x258c=['index','map','JscriptyQuestionReport','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','rows','catch','show','params','include','options','find','create','body','update','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','apply','reject','save','then','destroy','error','stack','name'];(function(_0x7422bb,_0x40fee1){var _0x221bec=function(_0x46a33d){while(--_0x46a33d){_0x7422bb['push'](_0x7422bb['shift']());}};_0x221bec(++_0x40fee1);}(_0x258c,0xbc));var _0xc258=function(_0x29d94e,_0xf386d6){_0x29d94e=_0x29d94e-0x0;var _0x106237=_0x258c[_0x29d94e];return _0x106237;};'use strict';var emlformat=require(_0xc258('0x0'));var rimraf=require(_0xc258('0x1'));var zipdir=require(_0xc258('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc258('0x3'));var moment=require(_0xc258('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc258('0x5'));var util=require('util');var path=require(_0xc258('0x6'));var sox=require(_0xc258('0x7'));var csv=require(_0xc258('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc258('0x9'));var _=require(_0xc258('0xa'));var squel=require(_0xc258('0xb'));var crypto=require(_0xc258('0xc'));var jsforce=require(_0xc258('0xd'));var deskjs=require(_0xc258('0xe'));var toCsv=require(_0xc258('0x8'));var querystring=require(_0xc258('0xf'));var Papa=require(_0xc258('0x10'));var Redis=require(_0xc258('0x11'));var authService=require(_0xc258('0x12'));var qs=require(_0xc258('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc258('0x14'));var logger=require(_0xc258('0x15'))(_0xc258('0x16'));var utils=require(_0xc258('0x17'));var config=require(_0xc258('0x18'));var licenseUtil=require(_0xc258('0x19'));var db=require(_0xc258('0x1a'))['db'];function respondWithStatusCode(_0x201e23,_0x21915c){_0x21915c=_0x21915c||0xcc;return function(_0x20550c){if(_0x20550c){return _0x201e23[_0xc258('0x1b')](_0x21915c);}return _0x201e23['status'](_0x21915c)[_0xc258('0x1c')]();};}function respondWithResult(_0x4d222a,_0x4ac879){_0x4ac879=_0x4ac879||0xc8;return function(_0x570f3b){if(_0x570f3b){return _0x4d222a[_0xc258('0x1d')](_0x4ac879)[_0xc258('0x1e')](_0x570f3b);}};}function respondWithFilteredResult(_0x4e044f,_0x38f2de){return function(_0x559f5e){if(_0x559f5e){var _0x552ecd=typeof _0x38f2de[_0xc258('0x1f')]===_0xc258('0x20')&&typeof _0x38f2de[_0xc258('0x21')]===_0xc258('0x20');var _0x225b22=_0x559f5e[_0xc258('0x22')];var _0x5e0a61=_0x552ecd?0x0:_0x38f2de[_0xc258('0x1f')];var _0x48d63a=_0x552ecd?_0x559f5e['count']:_0x38f2de['offset']+_0x38f2de[_0xc258('0x21')];var _0x47b08d;if(_0x48d63a>=_0x225b22){_0x48d63a=_0x225b22;_0x47b08d=0xc8;}else{_0x47b08d=0xce;}_0x4e044f[_0xc258('0x1d')](_0x47b08d);return _0x4e044f['set']('Content-Range',_0x5e0a61+'-'+_0x48d63a+'/'+_0x225b22)[_0xc258('0x1e')](_0x559f5e);}return null;};}function patchUpdates(_0x304376){return function(_0x477bac){try{jsonpatch[_0xc258('0x23')](_0x477bac,_0x304376,!![]);}catch(_0x571d9c){return BPromise[_0xc258('0x24')](_0x571d9c);}return _0x477bac[_0xc258('0x25')]();};}function saveUpdates(_0x8eaa94,_0x23f31e){return function(_0x4da9df){if(_0x4da9df){return _0x4da9df['update'](_0x8eaa94)[_0xc258('0x26')](function(_0xda16fa){return _0xda16fa;});}return null;};}function removeEntity(_0x3a62ab,_0x4bab14){return function(_0x5aa82e){if(_0x5aa82e){return _0x5aa82e[_0xc258('0x27')]()[_0xc258('0x26')](function(){_0x3a62ab[_0xc258('0x1d')](0xcc)[_0xc258('0x1c')]();});}};}function handleEntityNotFound(_0x243662,_0x269324){return function(_0x30d257){if(!_0x30d257){_0x243662[_0xc258('0x1b')](0x194);}return _0x30d257;};}function handleError(_0x3fc45d,_0x143c54){_0x143c54=_0x143c54||0x1f4;return function(_0x25c938){logger[_0xc258('0x28')](_0x25c938[_0xc258('0x29')]);if(_0x25c938[_0xc258('0x2a')]){delete _0x25c938[_0xc258('0x2a')];}_0x3fc45d[_0xc258('0x1d')](_0x143c54)['send'](_0x25c938);};}exports[_0xc258('0x2b')]=function(_0x2ff0ba,_0x356f82){var _0x3b713e={},_0x3eead2={},_0x45b3fd={'count':0x0,'rows':[]};var _0x254454=_[_0xc258('0x2c')](db[_0xc258('0x2d')][_0xc258('0x2e')],function(_0x4e6612){return{'name':_0x4e6612['fieldName'],'type':_0x4e6612[_0xc258('0x2f')][_0xc258('0x30')]};});_0x3eead2[_0xc258('0x31')]=_[_0xc258('0x2c')](_0x254454,_0xc258('0x2a'));_0x3eead2['query']=_[_0xc258('0x32')](_0x2ff0ba[_0xc258('0x33')]);_0x3eead2[_0xc258('0x34')]=_[_0xc258('0x35')](_0x3eead2[_0xc258('0x31')],_0x3eead2['query']);_0x3b713e[_0xc258('0x36')]=_[_0xc258('0x35')](_0x3eead2['model'],qs[_0xc258('0x37')](_0x2ff0ba[_0xc258('0x33')][_0xc258('0x37')]));_0x3b713e[_0xc258('0x36')]=_0x3b713e[_0xc258('0x36')][_0xc258('0x38')]?_0x3b713e[_0xc258('0x36')]:_0x3eead2['model'];if(!_0x2ff0ba[_0xc258('0x33')][_0xc258('0x39')](_0xc258('0x3a'))){_0x3b713e['limit']=qs[_0xc258('0x21')](_0x2ff0ba[_0xc258('0x33')][_0xc258('0x21')]);_0x3b713e[_0xc258('0x1f')]=qs['offset'](_0x2ff0ba[_0xc258('0x33')][_0xc258('0x1f')]);}_0x3b713e['order']=qs[_0xc258('0x3b')](_0x2ff0ba[_0xc258('0x33')][_0xc258('0x3b')]);_0x3b713e[_0xc258('0x3c')]=qs[_0xc258('0x34')](_[_0xc258('0x3d')](_0x2ff0ba[_0xc258('0x33')],_0x3eead2['filters']),_0x254454);if(_0x2ff0ba[_0xc258('0x33')][_0xc258('0x3e')]){_0x3b713e[_0xc258('0x3c')]=_[_0xc258('0x3f')](_0x3b713e[_0xc258('0x3c')],{'$or':_[_0xc258('0x2c')](_0x254454,function(_0x2e8c3f){if(_0x2e8c3f[_0xc258('0x2f')]!==_0xc258('0x40')){var _0x1a9119={};_0x1a9119[_0x2e8c3f[_0xc258('0x2a')]]={'$like':'%'+_0x2ff0ba[_0xc258('0x33')]['filter']+'%'};return _0x1a9119;}})});}_0x3b713e=_[_0xc258('0x3f')]({},_0x3b713e,_0x2ff0ba['options']);var _0x335442={'where':_0x3b713e[_0xc258('0x3c')]};return db[_0xc258('0x2d')][_0xc258('0x22')](_0x335442)['then'](function(_0x10c902){_0x45b3fd['count']=_0x10c902;if(_0x2ff0ba['query'][_0xc258('0x41')]){_0x3b713e['include']=[{'all':!![]}];}return db['JscriptyQuestionReport']['findAll'](_0x3b713e);})['then'](function(_0x1a45fd){_0x45b3fd[_0xc258('0x42')]=_0x1a45fd;return _0x45b3fd;})[_0xc258('0x26')](respondWithFilteredResult(_0x356f82,_0x3b713e))[_0xc258('0x43')](handleError(_0x356f82,null));};exports[_0xc258('0x44')]=function(_0x31b66d,_0x2d58f1){var _0x5d9470={'raw':!![],'where':{'id':_0x31b66d[_0xc258('0x45')]['id']}},_0x21b10c={};_0x21b10c[_0xc258('0x31')]=_[_0xc258('0x32')](db[_0xc258('0x2d')][_0xc258('0x2e')]);_0x21b10c[_0xc258('0x33')]=_[_0xc258('0x32')](_0x31b66d['query']);_0x21b10c[_0xc258('0x34')]=_[_0xc258('0x35')](_0x21b10c['model'],_0x21b10c[_0xc258('0x33')]);_0x5d9470[_0xc258('0x36')]=_['intersection'](_0x21b10c['model'],qs['fields'](_0x31b66d['query'][_0xc258('0x37')]));_0x5d9470['attributes']=_0x5d9470[_0xc258('0x36')][_0xc258('0x38')]?_0x5d9470['attributes']:_0x21b10c[_0xc258('0x31')];if(_0x31b66d[_0xc258('0x33')][_0xc258('0x41')]){_0x5d9470[_0xc258('0x46')]=[{'all':!![]}];}_0x5d9470=_[_0xc258('0x3f')]({},_0x5d9470,_0x31b66d[_0xc258('0x47')]);return db['JscriptyQuestionReport'][_0xc258('0x48')](_0x5d9470)[_0xc258('0x26')](handleEntityNotFound(_0x2d58f1,null))['then'](respondWithResult(_0x2d58f1,null))[_0xc258('0x43')](handleError(_0x2d58f1,null));};exports['create']=function(_0x4a82ca,_0xf981cd){return db[_0xc258('0x2d')][_0xc258('0x49')](_0x4a82ca[_0xc258('0x4a')],{})[_0xc258('0x26')](respondWithResult(_0xf981cd,0xc9))['catch'](handleError(_0xf981cd,null));};exports[_0xc258('0x4b')]=function(_0x45b474,_0x4c2334){if(_0x45b474[_0xc258('0x4a')]['id']){delete _0x45b474[_0xc258('0x4a')]['id'];}return db[_0xc258('0x2d')]['find']({'where':{'id':_0x45b474[_0xc258('0x45')]['id']}})[_0xc258('0x26')](handleEntityNotFound(_0x4c2334,null))[_0xc258('0x26')](saveUpdates(_0x45b474[_0xc258('0x4a')],null))[_0xc258('0x26')](respondWithResult(_0x4c2334,null))['catch'](handleError(_0x4c2334,null));};exports[_0xc258('0x27')]=function(_0x28837f,_0x597682){return db[_0xc258('0x2d')]['find']({'where':{'id':_0x28837f[_0xc258('0x45')]['id']}})[_0xc258('0x26')](handleEntityNotFound(_0x597682,null))[_0xc258('0x26')](removeEntity(_0x597682,null))[_0xc258('0x43')](handleError(_0x597682,null));};exports['describe']=function(_0x184448,_0x40904a){return db[_0xc258('0x2d')][_0xc258('0x4c')]()[_0xc258('0x26')](respondWithResult(_0x40904a,null))[_0xc258('0x43')](handleError(_0x40904a,null));}; \ No newline at end of file +var _0xe684=['save','update','destroy','then','error','stack','name','index','map','JscriptyQuestionReport','rawAttributes','type','key','model','query','keys','filters','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','intersection','catch','body','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply'];(function(_0x457cea,_0x406b93){var _0x28929f=function(_0xed7f1){while(--_0xed7f1){_0x457cea['push'](_0x457cea['shift']());}};_0x28929f(++_0x406b93);}(_0xe684,0x77));var _0x4e68=function(_0x1ae5ab,_0xc5d441){_0x1ae5ab=_0x1ae5ab-0x0;var _0x1ce001=_0xe684[_0x1ae5ab];return _0x1ce001;};'use strict';var emlformat=require(_0x4e68('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4e68('0x1'));var jsonpatch=require(_0x4e68('0x2'));var rp=require(_0x4e68('0x3'));var moment=require(_0x4e68('0x4'));var BPromise=require(_0x4e68('0x5'));var Mustache=require(_0x4e68('0x6'));var util=require(_0x4e68('0x7'));var path=require(_0x4e68('0x8'));var sox=require(_0x4e68('0x9'));var csv=require(_0x4e68('0xa'));var ejs=require(_0x4e68('0xb'));var fs=require('fs');var fs_extra=require(_0x4e68('0xc'));var _=require('lodash');var squel=require(_0x4e68('0xd'));var crypto=require('crypto');var jsforce=require(_0x4e68('0xe'));var deskjs=require(_0x4e68('0xf'));var toCsv=require('to-csv');var querystring=require(_0x4e68('0x10'));var Papa=require(_0x4e68('0x11'));var Redis=require('ioredis');var authService=require(_0x4e68('0x12'));var qs=require(_0x4e68('0x13'));var as=require(_0x4e68('0x14'));var hardwareService=require(_0x4e68('0x15'));var logger=require(_0x4e68('0x16'))('api');var utils=require(_0x4e68('0x17'));var config=require(_0x4e68('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x4e68('0x19'))['db'];function respondWithStatusCode(_0x4239e2,_0x2dead9){_0x2dead9=_0x2dead9||0xcc;return function(_0x213c5e){if(_0x213c5e){return _0x4239e2[_0x4e68('0x1a')](_0x2dead9);}return _0x4239e2['status'](_0x2dead9)[_0x4e68('0x1b')]();};}function respondWithResult(_0x504356,_0x4d7346){_0x4d7346=_0x4d7346||0xc8;return function(_0x190b02){if(_0x190b02){return _0x504356[_0x4e68('0x1c')](_0x4d7346)[_0x4e68('0x1d')](_0x190b02);}};}function respondWithFilteredResult(_0x14462c,_0x13be50){return function(_0x1fc69b){if(_0x1fc69b){var _0x5b2256=typeof _0x13be50[_0x4e68('0x1e')]===_0x4e68('0x1f')&&typeof _0x13be50[_0x4e68('0x20')]===_0x4e68('0x1f');var _0x9d8848=_0x1fc69b[_0x4e68('0x21')];var _0x10e965=_0x5b2256?0x0:_0x13be50[_0x4e68('0x1e')];var _0x3494f4=_0x5b2256?_0x1fc69b['count']:_0x13be50['offset']+_0x13be50[_0x4e68('0x20')];var _0x1568b2;if(_0x3494f4>=_0x9d8848){_0x3494f4=_0x9d8848;_0x1568b2=0xc8;}else{_0x1568b2=0xce;}_0x14462c['status'](_0x1568b2);return _0x14462c[_0x4e68('0x22')](_0x4e68('0x23'),_0x10e965+'-'+_0x3494f4+'/'+_0x9d8848)['json'](_0x1fc69b);}return null;};}function patchUpdates(_0x22f8c2){return function(_0x409761){try{jsonpatch[_0x4e68('0x24')](_0x409761,_0x22f8c2,!![]);}catch(_0x1fe706){return BPromise['reject'](_0x1fe706);}return _0x409761[_0x4e68('0x25')]();};}function saveUpdates(_0x2ee600,_0x12d121){return function(_0x2615c7){if(_0x2615c7){return _0x2615c7[_0x4e68('0x26')](_0x2ee600)['then'](function(_0x505886){return _0x505886;});}return null;};}function removeEntity(_0xe921c9,_0x49d7e){return function(_0x51f893){if(_0x51f893){return _0x51f893[_0x4e68('0x27')]()[_0x4e68('0x28')](function(){_0xe921c9[_0x4e68('0x1c')](0xcc)[_0x4e68('0x1b')]();});}};}function handleEntityNotFound(_0x3188e5,_0x53237f){return function(_0x49367a){if(!_0x49367a){_0x3188e5[_0x4e68('0x1a')](0x194);}return _0x49367a;};}function handleError(_0x44afcc,_0x4695e4){_0x4695e4=_0x4695e4||0x1f4;return function(_0x11ec76){logger[_0x4e68('0x29')](_0x11ec76[_0x4e68('0x2a')]);if(_0x11ec76['name']){delete _0x11ec76[_0x4e68('0x2b')];}_0x44afcc[_0x4e68('0x1c')](_0x4695e4)['send'](_0x11ec76);};}exports[_0x4e68('0x2c')]=function(_0x54b0b5,_0x59d19f){var _0x22634a={},_0x2dd932={},_0x28fba7={'count':0x0,'rows':[]};var _0x5bf1db=_[_0x4e68('0x2d')](db[_0x4e68('0x2e')][_0x4e68('0x2f')],function(_0x2159c6){return{'name':_0x2159c6['fieldName'],'type':_0x2159c6[_0x4e68('0x30')][_0x4e68('0x31')]};});_0x2dd932[_0x4e68('0x32')]=_[_0x4e68('0x2d')](_0x5bf1db,_0x4e68('0x2b'));_0x2dd932[_0x4e68('0x33')]=_[_0x4e68('0x34')](_0x54b0b5[_0x4e68('0x33')]);_0x2dd932[_0x4e68('0x35')]=_['intersection'](_0x2dd932['model'],_0x2dd932[_0x4e68('0x33')]);_0x22634a['attributes']=_['intersection'](_0x2dd932['model'],qs[_0x4e68('0x36')](_0x54b0b5[_0x4e68('0x33')][_0x4e68('0x36')]));_0x22634a['attributes']=_0x22634a[_0x4e68('0x37')][_0x4e68('0x38')]?_0x22634a[_0x4e68('0x37')]:_0x2dd932[_0x4e68('0x32')];if(!_0x54b0b5['query'][_0x4e68('0x39')](_0x4e68('0x3a'))){_0x22634a[_0x4e68('0x20')]=qs[_0x4e68('0x20')](_0x54b0b5[_0x4e68('0x33')]['limit']);_0x22634a[_0x4e68('0x1e')]=qs[_0x4e68('0x1e')](_0x54b0b5['query'][_0x4e68('0x1e')]);}_0x22634a[_0x4e68('0x3b')]=qs[_0x4e68('0x3c')](_0x54b0b5[_0x4e68('0x33')][_0x4e68('0x3c')]);_0x22634a[_0x4e68('0x3d')]=qs[_0x4e68('0x35')](_[_0x4e68('0x3e')](_0x54b0b5['query'],_0x2dd932[_0x4e68('0x35')]),_0x5bf1db);if(_0x54b0b5[_0x4e68('0x33')][_0x4e68('0x3f')]){_0x22634a[_0x4e68('0x3d')]=_[_0x4e68('0x40')](_0x22634a[_0x4e68('0x3d')],{'$or':_[_0x4e68('0x2d')](_0x5bf1db,function(_0xcf4f23){if(_0xcf4f23[_0x4e68('0x30')]!==_0x4e68('0x41')){var _0x82f2b2={};_0x82f2b2[_0xcf4f23[_0x4e68('0x2b')]]={'$like':'%'+_0x54b0b5['query'][_0x4e68('0x3f')]+'%'};return _0x82f2b2;}})});}_0x22634a=_[_0x4e68('0x40')]({},_0x22634a,_0x54b0b5[_0x4e68('0x42')]);var _0xb0db6e={'where':_0x22634a[_0x4e68('0x3d')]};return db[_0x4e68('0x2e')][_0x4e68('0x21')](_0xb0db6e)['then'](function(_0x225100){_0x28fba7[_0x4e68('0x21')]=_0x225100;if(_0x54b0b5[_0x4e68('0x33')][_0x4e68('0x43')]){_0x22634a[_0x4e68('0x44')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0x4e68('0x45')](_0x22634a);})[_0x4e68('0x28')](function(_0x3f5bb8){_0x28fba7[_0x4e68('0x46')]=_0x3f5bb8;return _0x28fba7;})[_0x4e68('0x28')](respondWithFilteredResult(_0x59d19f,_0x22634a))['catch'](handleError(_0x59d19f,null));};exports[_0x4e68('0x47')]=function(_0x27790d,_0x22ca1a){var _0x89c8ed={'raw':!![],'where':{'id':_0x27790d[_0x4e68('0x48')]['id']}},_0x29d829={};_0x29d829[_0x4e68('0x32')]=_[_0x4e68('0x34')](db[_0x4e68('0x2e')][_0x4e68('0x2f')]);_0x29d829[_0x4e68('0x33')]=_['keys'](_0x27790d[_0x4e68('0x33')]);_0x29d829[_0x4e68('0x35')]=_[_0x4e68('0x49')](_0x29d829[_0x4e68('0x32')],_0x29d829[_0x4e68('0x33')]);_0x89c8ed[_0x4e68('0x37')]=_[_0x4e68('0x49')](_0x29d829['model'],qs[_0x4e68('0x36')](_0x27790d[_0x4e68('0x33')][_0x4e68('0x36')]));_0x89c8ed[_0x4e68('0x37')]=_0x89c8ed[_0x4e68('0x37')][_0x4e68('0x38')]?_0x89c8ed[_0x4e68('0x37')]:_0x29d829[_0x4e68('0x32')];if(_0x27790d[_0x4e68('0x33')]['includeAll']){_0x89c8ed[_0x4e68('0x44')]=[{'all':!![]}];}_0x89c8ed=_[_0x4e68('0x40')]({},_0x89c8ed,_0x27790d[_0x4e68('0x42')]);return db[_0x4e68('0x2e')]['find'](_0x89c8ed)[_0x4e68('0x28')](handleEntityNotFound(_0x22ca1a,null))[_0x4e68('0x28')](respondWithResult(_0x22ca1a,null))[_0x4e68('0x4a')](handleError(_0x22ca1a,null));};exports['create']=function(_0x965303,_0x1235d4){return db[_0x4e68('0x2e')]['create'](_0x965303[_0x4e68('0x4b')],{})[_0x4e68('0x28')](respondWithResult(_0x1235d4,0xc9))[_0x4e68('0x4a')](handleError(_0x1235d4,null));};exports[_0x4e68('0x26')]=function(_0x3185cf,_0x595c11){if(_0x3185cf[_0x4e68('0x4b')]['id']){delete _0x3185cf[_0x4e68('0x4b')]['id'];}return db[_0x4e68('0x2e')][_0x4e68('0x4c')]({'where':{'id':_0x3185cf[_0x4e68('0x48')]['id']}})[_0x4e68('0x28')](handleEntityNotFound(_0x595c11,null))['then'](saveUpdates(_0x3185cf['body'],null))[_0x4e68('0x28')](respondWithResult(_0x595c11,null))[_0x4e68('0x4a')](handleError(_0x595c11,null));};exports[_0x4e68('0x27')]=function(_0xb91c31,_0x3f0a9d){return db[_0x4e68('0x2e')]['find']({'where':{'id':_0xb91c31[_0x4e68('0x48')]['id']}})[_0x4e68('0x28')](handleEntityNotFound(_0x3f0a9d,null))[_0x4e68('0x28')](removeEntity(_0x3f0a9d,null))[_0x4e68('0x4a')](handleError(_0x3f0a9d,null));};exports[_0x4e68('0x4d')]=function(_0x2ae8c7,_0x2d3309){return db[_0x4e68('0x2e')][_0x4e68('0x4d')]()['then'](respondWithResult(_0x2d3309,null))['catch'](handleError(_0x2d3309,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index a5732e8..273524d 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 _0xea52=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','exports','define','JscriptyQuestionReport','lodash','api'];(function(_0x2d34d6,_0x397ff9){var _0x1d3d12=function(_0x558800){while(--_0x558800){_0x2d34d6['push'](_0x2d34d6['shift']());}};_0x1d3d12(++_0x397ff9);}(_0xea52,0x14e));var _0x2ea5=function(_0x3dcb6f,_0x1400fd){_0x3dcb6f=_0x3dcb6f-0x0;var _0x4ff635=_0xea52[_0x3dcb6f];return _0x4ff635;};'use strict';var _=require(_0x2ea5('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x2ea5('0x1'));var moment=require(_0x2ea5('0x2'));var BPromise=require(_0x2ea5('0x3'));var rp=require(_0x2ea5('0x4'));var fs=require('fs');var path=require(_0x2ea5('0x5'));var rimraf=require(_0x2ea5('0x6'));var config=require(_0x2ea5('0x7'));var attributes=require(_0x2ea5('0x8'));module[_0x2ea5('0x9')]=function(_0x28c916,_0x59081d){return _0x28c916[_0x2ea5('0xa')](_0x2ea5('0xb'),attributes,{'tableName':'report_jscripty_questions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6a12=['path','rimraf','./jscriptyQuestionReport.attributes','exports','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0xb06354,_0x464d11){var _0x44da6c=function(_0x1c900f){while(--_0x1c900f){_0xb06354['push'](_0xb06354['shift']());}};_0x44da6c(++_0x464d11);}(_0x6a12,0x191));var _0x26a1=function(_0x266dea,_0x3e301c){_0x266dea=_0x266dea-0x0;var _0xb87eb4=_0x6a12[_0x266dea];return _0xb87eb4;};'use strict';var _=require(_0x26a1('0x0'));var util=require(_0x26a1('0x1'));var logger=require(_0x26a1('0x2'))(_0x26a1('0x3'));var moment=require(_0x26a1('0x4'));var BPromise=require(_0x26a1('0x5'));var rp=require(_0x26a1('0x6'));var fs=require('fs');var path=require(_0x26a1('0x7'));var rimraf=require(_0x26a1('0x8'));var config=require('../../config/environment');var attributes=require(_0x26a1('0x9'));module[_0x26a1('0xa')]=function(_0x27fefe,_0x4d6b69){return _0x27fefe[_0x26a1('0xb')]('JscriptyQuestionReport',attributes,{'tableName':'report_jscripty_questions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js index 11c1e60..3fa6aaf 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 _0x2f85=['catch','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x2a7b8e,_0x50ffce){var _0x29b5c8=function(_0x131fe0){while(--_0x131fe0){_0x2a7b8e['push'](_0x2a7b8e['shift']());}};_0x29b5c8(++_0x50ffce);}(_0x2f85,0x10b));var _0x52f8=function(_0x51a0c7,_0x13200e){_0x51a0c7=_0x51a0c7-0x0;var _0x2cc5f8=_0x2f85[_0x51a0c7];return _0x2cc5f8;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x52f8('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x52f8('0x1'));var db=require(_0x52f8('0x2'))['db'];var utils=require(_0x52f8('0x3'));var logger=require(_0x52f8('0x4'))(_0x52f8('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x52f8('0x6')][_0x52f8('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x587939,_0x26f2ff,_0x1e716a){return new BPromise(function(_0x1ad558,_0x2b0bbb){return client['request'](_0x587939,_0x1e716a)[_0x52f8('0x8')](function(_0x22e304){logger[_0x52f8('0x9')](_0x52f8('0xa'),_0x26f2ff,_0x52f8('0xb'));logger[_0x52f8('0xc')](_0x52f8('0xd'),_0x26f2ff,_0x52f8('0xb'),JSON[_0x52f8('0xe')](_0x22e304));if(_0x22e304['error']){if(_0x22e304[_0x52f8('0xf')][_0x52f8('0x10')]===0x1f4){logger[_0x52f8('0xf')](_0x52f8('0xa'),_0x26f2ff,_0x22e304[_0x52f8('0xf')][_0x52f8('0x11')]);return _0x2b0bbb(_0x22e304['error'][_0x52f8('0x11')]);}logger['error']('JscriptyQuestionReport,\x20%s,\x20%s',_0x26f2ff,_0x22e304[_0x52f8('0xf')]['message']);return _0x1ad558(_0x22e304[_0x52f8('0xf')][_0x52f8('0x11')]);}else{logger[_0x52f8('0x9')](_0x52f8('0xa'),_0x26f2ff,_0x52f8('0xb'));_0x1ad558(_0x22e304['result'][_0x52f8('0x11')]);}})[_0x52f8('0x12')](function(_0x5dd44e){logger[_0x52f8('0xf')](_0x52f8('0xa'),_0x26f2ff,_0x5dd44e);_0x2b0bbb(_0x5dd44e);});});} \ No newline at end of file +var _0xd5d1=['moment','bluebird','../../mysqldb','client','http','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x4d5672,_0x4517e7){var _0x4a7aec=function(_0x29cd05){while(--_0x29cd05){_0x4d5672['push'](_0x4d5672['shift']());}};_0x4a7aec(++_0x4517e7);}(_0xd5d1,0xb3));var _0x1d5d=function(_0x2586a2,_0x69eb21){_0x2586a2=_0x2586a2-0x0;var _0x4a29bf=_0xd5d1[_0x2586a2];return _0x4a29bf;};'use strict';var _=require(_0x1d5d('0x0'));var util=require('util');var moment=require(_0x1d5d('0x1'));var BPromise=require(_0x1d5d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1d5d('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1d5d('0x4')][_0x1d5d('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x37be62,_0x3ae709,_0x3ebb0e){return new BPromise(function(_0x2cf284,_0x3fa0e8){return client['request'](_0x37be62,_0x3ebb0e)[_0x1d5d('0x6')](function(_0x1224ea){logger[_0x1d5d('0x7')](_0x1d5d('0x8'),_0x3ae709,_0x1d5d('0x9'));logger[_0x1d5d('0xa')](_0x1d5d('0xb'),_0x3ae709,_0x1d5d('0x9'),JSON[_0x1d5d('0xc')](_0x1224ea));if(_0x1224ea[_0x1d5d('0xd')]){if(_0x1224ea[_0x1d5d('0xd')][_0x1d5d('0xe')]===0x1f4){logger[_0x1d5d('0xd')](_0x1d5d('0x8'),_0x3ae709,_0x1224ea[_0x1d5d('0xd')]['message']);return _0x3fa0e8(_0x1224ea['error'][_0x1d5d('0xf')]);}logger['error'](_0x1d5d('0x8'),_0x3ae709,_0x1224ea[_0x1d5d('0xd')]['message']);return _0x2cf284(_0x1224ea[_0x1d5d('0xd')]['message']);}else{logger[_0x1d5d('0x7')](_0x1d5d('0x8'),_0x3ae709,_0x1d5d('0x9'));_0x2cf284(_0x1224ea[_0x1d5d('0x10')][_0x1d5d('0xf')]);}})[_0x1d5d('0x11')](function(_0x56e2a9){logger[_0x1d5d('0xd')](_0x1d5d('0x8'),_0x3ae709,_0x56e2a9);_0x3fa0e8(_0x56e2a9);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 3391303..8ade1fb 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 _0x0e97=['index','get','/describe','describe','/:id','/:id/questions','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated'];(function(_0x386a98,_0x2d72c1){var _0x443371=function(_0x478f75){while(--_0x478f75){_0x386a98['push'](_0x386a98['shift']());}};_0x443371(++_0x2d72c1);}(_0x0e97,0x64));var _0x70e9=function(_0x30aee3,_0x426c8d){_0x30aee3=_0x30aee3-0x0;var _0x1676a7=_0x0e97[_0x30aee3];return _0x1676a7;};'use strict';var multer=require(_0x70e9('0x0'));var util=require(_0x70e9('0x1'));var path=require(_0x70e9('0x2'));var timeout=require(_0x70e9('0x3'));var express=require(_0x70e9('0x4'));var router=express[_0x70e9('0x5')]();var fs_extra=require(_0x70e9('0x6'));var auth=require(_0x70e9('0x7'));var interaction=require(_0x70e9('0x8'));var config=require('../../config/environment');var controller=require('./jscriptySessionReport.controller');router['get']('/',auth[_0x70e9('0x9')](),controller[_0x70e9('0xa')]);router[_0x70e9('0xb')](_0x70e9('0xc'),auth['isAuthenticated'](),controller[_0x70e9('0xd')]);router[_0x70e9('0xb')](_0x70e9('0xe'),auth[_0x70e9('0x9')](),controller['show']);router[_0x70e9('0xb')](_0x70e9('0xf'),auth[_0x70e9('0x9')](),controller['getQuestions']);router[_0x70e9('0x10')]('/',auth[_0x70e9('0x9')](),controller[_0x70e9('0x11')]);router[_0x70e9('0x12')](_0x70e9('0xe'),auth[_0x70e9('0x9')](),controller[_0x70e9('0x13')]);router[_0x70e9('0x14')](_0x70e9('0xe'),auth[_0x70e9('0x9')](),controller[_0x70e9('0x15')]);module['exports']=router; \ No newline at end of file +var _0x3d09=['/:id/questions','getQuestions','post','create','delete','/:id','destroy','util','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','index','/describe','show'];(function(_0x5b001c,_0x5b7d68){var _0x583268=function(_0x4cbaf7){while(--_0x4cbaf7){_0x5b001c['push'](_0x5b001c['shift']());}};_0x583268(++_0x5b7d68);}(_0x3d09,0x111));var _0x93d0=function(_0x3bc0b1,_0x2032ee){_0x3bc0b1=_0x3bc0b1-0x0;var _0x2a4557=_0x3d09[_0x3bc0b1];return _0x2a4557;};'use strict';var multer=require('multer');var util=require(_0x93d0('0x0'));var path=require('path');var timeout=require(_0x93d0('0x1'));var express=require(_0x93d0('0x2'));var router=express['Router']();var fs_extra=require(_0x93d0('0x3'));var auth=require(_0x93d0('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x93d0('0x5'));var controller=require(_0x93d0('0x6'));router[_0x93d0('0x7')]('/',auth[_0x93d0('0x8')](),controller[_0x93d0('0x9')]);router[_0x93d0('0x7')](_0x93d0('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x93d0('0x7')]('/:id',auth[_0x93d0('0x8')](),controller[_0x93d0('0xb')]);router[_0x93d0('0x7')](_0x93d0('0xc'),auth[_0x93d0('0x8')](),controller[_0x93d0('0xd')]);router[_0x93d0('0xe')]('/',auth[_0x93d0('0x8')](),controller[_0x93d0('0xf')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x93d0('0x10')](_0x93d0('0x11'),auth[_0x93d0('0x8')](),controller[_0x93d0('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index 3c29013..aa6c56e 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 _0xf5dd=['moment','sequelize','exports','DATE','setDataValue','starttime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN'];(function(_0x1a2078,_0x2d0032){var _0x415b2b=function(_0x1667f2){while(--_0x1667f2){_0x1a2078['push'](_0x1a2078['shift']());}};_0x415b2b(++_0x2d0032);}(_0xf5dd,0x1ad));var _0xdf5d=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xf5dd[_0x57b54c];return _0x59cc19;};'use strict';var moment=require(_0xdf5d('0x0'));var Sequelize=require(_0xdf5d('0x1'));module[_0xdf5d('0x2')]={'starttime':{'type':Sequelize[_0xdf5d('0x3')],'set':function(_0x14dc92){this[_0xdf5d('0x4')](_0xdf5d('0x5'),_0x14dc92);this[_0xdf5d('0x4')](_0xdf5d('0x6'),moment()[_0xdf5d('0x7')](_0xdf5d('0x8')));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0xdf5d('0x9')]},'projectname':{'type':Sequelize[_0xdf5d('0x9')]},'queue':{'type':Sequelize[_0xdf5d('0x9')]},'uniqueid':{'type':Sequelize[_0xdf5d('0x9')]},'calleridname':{'type':Sequelize[_0xdf5d('0x9')]},'calleridnum':{'type':Sequelize[_0xdf5d('0x9')]},'completed':{'type':Sequelize[_0xdf5d('0xa')],'defaultValue':![]}}; \ No newline at end of file +var _0x5c25=['endtime','format','YYYY-MM-DD\x20HH:mm:ss','DATE','STRING','BOOLEAN','exports','setDataValue','starttime'];(function(_0x1a0457,_0x63d0af){var _0x51c138=function(_0x1a9eaa){while(--_0x1a9eaa){_0x1a0457['push'](_0x1a0457['shift']());}};_0x51c138(++_0x63d0af);}(_0x5c25,0xf9));var _0x55c2=function(_0x11fa3c,_0x484687){_0x11fa3c=_0x11fa3c-0x0;var _0x4bbed3=_0x5c25[_0x11fa3c];return _0x4bbed3;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x55c2('0x0')]={'starttime':{'type':Sequelize['DATE'],'set':function(_0x2aaeec){this[_0x55c2('0x1')](_0x55c2('0x2'),_0x2aaeec);this[_0x55c2('0x1')](_0x55c2('0x3'),moment()[_0x55c2('0x4')](_0x55c2('0x5')));}},'endtime':{'type':Sequelize[_0x55c2('0x6')]},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0x55c2('0x7')]},'queue':{'type':Sequelize[_0x55c2('0x7')]},'uniqueid':{'type':Sequelize[_0x55c2('0x7')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x55c2('0x7')]},'completed':{'type':Sequelize[_0x55c2('0x8')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index c9f18c2..8e52e25 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 _0x23a0=['undefined','limit','count','offset','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','JscriptySessionReport','rawAttributes','type','key','query','keys','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','length','options','find','create','body','describe','getQuestions','findOne','JscriptyQuestionReport','SessionId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json'];(function(_0x2459b7,_0x226bde){var _0xbc35cf=function(_0x45d8d9){while(--_0x45d8d9){_0x2459b7['push'](_0x2459b7['shift']());}};_0xbc35cf(++_0x226bde);}(_0x23a0,0x182));var _0x023a=function(_0x5ecadc,_0x1cf9f1){_0x5ecadc=_0x5ecadc-0x0;var _0x565037=_0x23a0[_0x5ecadc];return _0x565037;};'use strict';var emlformat=require(_0x023a('0x0'));var rimraf=require(_0x023a('0x1'));var zipdir=require(_0x023a('0x2'));var jsonpatch=require(_0x023a('0x3'));var rp=require(_0x023a('0x4'));var moment=require(_0x023a('0x5'));var BPromise=require(_0x023a('0x6'));var Mustache=require(_0x023a('0x7'));var util=require(_0x023a('0x8'));var path=require(_0x023a('0x9'));var sox=require('sox');var csv=require(_0x023a('0xa'));var ejs=require(_0x023a('0xb'));var fs=require('fs');var fs_extra=require(_0x023a('0xc'));var _=require('lodash');var squel=require(_0x023a('0xd'));var crypto=require('crypto');var jsforce=require(_0x023a('0xe'));var deskjs=require(_0x023a('0xf'));var toCsv=require(_0x023a('0xa'));var querystring=require(_0x023a('0x10'));var Papa=require('papaparse');var Redis=require(_0x023a('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x023a('0x12'));var as=require(_0x023a('0x13'));var hardwareService=require(_0x023a('0x14'));var logger=require('../../config/logger')(_0x023a('0x15'));var utils=require(_0x023a('0x16'));var config=require(_0x023a('0x17'));var licenseUtil=require(_0x023a('0x18'));var db=require(_0x023a('0x19'))['db'];function respondWithStatusCode(_0x10f070,_0x13bb1b){_0x13bb1b=_0x13bb1b||0xcc;return function(_0x453227){if(_0x453227){return _0x10f070['sendStatus'](_0x13bb1b);}return _0x10f070[_0x023a('0x1a')](_0x13bb1b)[_0x023a('0x1b')]();};}function respondWithResult(_0x2bcea1,_0xc1cec4){_0xc1cec4=_0xc1cec4||0xc8;return function(_0x20d02a){if(_0x20d02a){return _0x2bcea1[_0x023a('0x1a')](_0xc1cec4)[_0x023a('0x1c')](_0x20d02a);}};}function respondWithFilteredResult(_0x55e389,_0x59d763){return function(_0x5d4888){if(_0x5d4888){var _0x1dd33a=typeof _0x59d763['offset']===_0x023a('0x1d')&&typeof _0x59d763[_0x023a('0x1e')]===_0x023a('0x1d');var _0x1bcd41=_0x5d4888[_0x023a('0x1f')];var _0x259fd8=_0x1dd33a?0x0:_0x59d763[_0x023a('0x20')];var _0x29c6c3=_0x1dd33a?_0x5d4888[_0x023a('0x1f')]:_0x59d763[_0x023a('0x20')]+_0x59d763['limit'];var _0x15507c;if(_0x29c6c3>=_0x1bcd41){_0x29c6c3=_0x1bcd41;_0x15507c=0xc8;}else{_0x15507c=0xce;}_0x55e389['status'](_0x15507c);return _0x55e389['set'](_0x023a('0x21'),_0x259fd8+'-'+_0x29c6c3+'/'+_0x1bcd41)[_0x023a('0x1c')](_0x5d4888);}return null;};}function patchUpdates(_0x4625b8){return function(_0x172475){try{jsonpatch[_0x023a('0x22')](_0x172475,_0x4625b8,!![]);}catch(_0x1a5208){return BPromise[_0x023a('0x23')](_0x1a5208);}return _0x172475[_0x023a('0x24')]();};}function saveUpdates(_0x48446a,_0x50d427){return function(_0x271e80){if(_0x271e80){return _0x271e80[_0x023a('0x25')](_0x48446a)['then'](function(_0x22cfe6){return _0x22cfe6;});}return null;};}function removeEntity(_0x5d04a8,_0x1509ac){return function(_0x56d63b){if(_0x56d63b){return _0x56d63b[_0x023a('0x26')]()[_0x023a('0x27')](function(){_0x5d04a8[_0x023a('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x339e8a,_0x22b50c){return function(_0x171348){if(!_0x171348){_0x339e8a['sendStatus'](0x194);}return _0x171348;};}function handleError(_0x4714f6,_0x3495c8){_0x3495c8=_0x3495c8||0x1f4;return function(_0x5c4c32){logger[_0x023a('0x28')](_0x5c4c32[_0x023a('0x29')]);if(_0x5c4c32[_0x023a('0x2a')]){delete _0x5c4c32[_0x023a('0x2a')];}_0x4714f6[_0x023a('0x1a')](_0x3495c8)[_0x023a('0x2b')](_0x5c4c32);};}exports[_0x023a('0x2c')]=function(_0x19c013,_0x441d0b){var _0x214a13={},_0x4a9823={},_0x8e2d0c={'count':0x0,'rows':[]};var _0x583ee7=_[_0x023a('0x2d')](db[_0x023a('0x2e')][_0x023a('0x2f')],function(_0x14701a){return{'name':_0x14701a['fieldName'],'type':_0x14701a[_0x023a('0x30')][_0x023a('0x31')]};});_0x4a9823['model']=_[_0x023a('0x2d')](_0x583ee7,_0x023a('0x2a'));_0x4a9823[_0x023a('0x32')]=_[_0x023a('0x33')](_0x19c013[_0x023a('0x32')]);_0x4a9823[_0x023a('0x34')]=_['intersection'](_0x4a9823[_0x023a('0x35')],_0x4a9823[_0x023a('0x32')]);_0x214a13[_0x023a('0x36')]=_[_0x023a('0x37')](_0x4a9823[_0x023a('0x35')],qs[_0x023a('0x38')](_0x19c013[_0x023a('0x32')][_0x023a('0x38')]));_0x214a13[_0x023a('0x36')]=_0x214a13['attributes']['length']?_0x214a13['attributes']:_0x4a9823[_0x023a('0x35')];if(!_0x19c013[_0x023a('0x32')][_0x023a('0x39')](_0x023a('0x3a'))){_0x214a13['limit']=qs[_0x023a('0x1e')](_0x19c013['query'][_0x023a('0x1e')]);_0x214a13[_0x023a('0x20')]=qs[_0x023a('0x20')](_0x19c013[_0x023a('0x32')]['offset']);}_0x214a13[_0x023a('0x3b')]=qs['sort'](_0x19c013[_0x023a('0x32')][_0x023a('0x3c')]);_0x214a13['where']=qs[_0x023a('0x34')](_[_0x023a('0x3d')](_0x19c013[_0x023a('0x32')],_0x4a9823['filters']),_0x583ee7);if(_0x19c013[_0x023a('0x32')][_0x023a('0x3e')]){_0x214a13[_0x023a('0x3f')]=_[_0x023a('0x40')](_0x214a13[_0x023a('0x3f')],{'$or':_[_0x023a('0x2d')](_0x583ee7,function(_0x5086a9){if(_0x5086a9[_0x023a('0x30')]!==_0x023a('0x41')){var _0x1c8c1f={};_0x1c8c1f[_0x5086a9[_0x023a('0x2a')]]={'$like':'%'+_0x19c013[_0x023a('0x32')][_0x023a('0x3e')]+'%'};return _0x1c8c1f;}})});}_0x214a13=_[_0x023a('0x40')]({},_0x214a13,_0x19c013['options']);var _0xd599cf={'where':_0x214a13[_0x023a('0x3f')]};return db[_0x023a('0x2e')][_0x023a('0x1f')](_0xd599cf)[_0x023a('0x27')](function(_0x3b0a30){_0x8e2d0c[_0x023a('0x1f')]=_0x3b0a30;if(_0x19c013[_0x023a('0x32')][_0x023a('0x42')]){_0x214a13[_0x023a('0x43')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0x023a('0x44')](_0x214a13);})[_0x023a('0x27')](function(_0x5d39d1){_0x8e2d0c[_0x023a('0x45')]=_0x5d39d1;return _0x8e2d0c;})['then'](respondWithFilteredResult(_0x441d0b,_0x214a13))[_0x023a('0x46')](handleError(_0x441d0b,null));};exports[_0x023a('0x47')]=function(_0x4de283,_0x4b9ea8){var _0xb876d7={'raw':!![],'where':{'id':_0x4de283[_0x023a('0x48')]['id']}},_0x56d1e3={};_0x56d1e3[_0x023a('0x35')]=_['keys'](db['JscriptySessionReport']['rawAttributes']);_0x56d1e3[_0x023a('0x32')]=_[_0x023a('0x33')](_0x4de283['query']);_0x56d1e3[_0x023a('0x34')]=_['intersection'](_0x56d1e3['model'],_0x56d1e3[_0x023a('0x32')]);_0xb876d7[_0x023a('0x36')]=_['intersection'](_0x56d1e3[_0x023a('0x35')],qs[_0x023a('0x38')](_0x4de283[_0x023a('0x32')][_0x023a('0x38')]));_0xb876d7[_0x023a('0x36')]=_0xb876d7[_0x023a('0x36')][_0x023a('0x49')]?_0xb876d7[_0x023a('0x36')]:_0x56d1e3['model'];if(_0x4de283[_0x023a('0x32')][_0x023a('0x42')]){_0xb876d7[_0x023a('0x43')]=[{'all':!![]}];}_0xb876d7=_['merge']({},_0xb876d7,_0x4de283[_0x023a('0x4a')]);return db['JscriptySessionReport'][_0x023a('0x4b')](_0xb876d7)['then'](handleEntityNotFound(_0x4b9ea8,null))[_0x023a('0x27')](respondWithResult(_0x4b9ea8,null))[_0x023a('0x46')](handleError(_0x4b9ea8,null));};exports[_0x023a('0x4c')]=function(_0x22688e,_0x58679d){return db[_0x023a('0x2e')][_0x023a('0x4c')](_0x22688e[_0x023a('0x4d')],{})[_0x023a('0x27')](respondWithResult(_0x58679d,0xc9))['catch'](handleError(_0x58679d,null));};exports[_0x023a('0x25')]=function(_0x41b467,_0x2d973f){if(_0x41b467[_0x023a('0x4d')]['id']){delete _0x41b467[_0x023a('0x4d')]['id'];}return db[_0x023a('0x2e')][_0x023a('0x4b')]({'where':{'id':_0x41b467[_0x023a('0x48')]['id']}})[_0x023a('0x27')](handleEntityNotFound(_0x2d973f,null))[_0x023a('0x27')](saveUpdates(_0x41b467['body'],null))[_0x023a('0x27')](respondWithResult(_0x2d973f,null))['catch'](handleError(_0x2d973f,null));};exports[_0x023a('0x26')]=function(_0x509772,_0x235914){return db[_0x023a('0x2e')][_0x023a('0x4b')]({'where':{'id':_0x509772[_0x023a('0x48')]['id']}})['then'](handleEntityNotFound(_0x235914,null))[_0x023a('0x27')](removeEntity(_0x235914,null))['catch'](handleError(_0x235914,null));};exports[_0x023a('0x4e')]=function(_0x35b6a2,_0x55ef70){return db[_0x023a('0x2e')][_0x023a('0x4e')]()[_0x023a('0x27')](respondWithResult(_0x55ef70,null))[_0x023a('0x46')](handleError(_0x55ef70,null));};exports[_0x023a('0x4f')]=function(_0x3d12c1,_0x1f44e2,_0x410ab8){var _0x49d60c={'raw':!![],'where':{}};var _0x1dfea3={};var _0x36f8b6={'count':0x0,'rows':[]};return db[_0x023a('0x2e')][_0x023a('0x50')]({'where':{'id':_0x3d12c1['params']['id']}})[_0x023a('0x27')](handleEntityNotFound(_0x1f44e2,null))[_0x023a('0x27')](function(_0x1d1f6f){if(_0x1d1f6f){_0x1dfea3[_0x023a('0x35')]=_[_0x023a('0x33')](db[_0x023a('0x51')]['rawAttributes']);_0x1dfea3[_0x023a('0x32')]=_[_0x023a('0x33')](_0x3d12c1[_0x023a('0x32')]);_0x1dfea3['filters']=_[_0x023a('0x37')](_0x1dfea3[_0x023a('0x35')],_0x1dfea3['query']);_0x49d60c[_0x023a('0x36')]=_['intersection'](_0x1dfea3['model'],qs['fields'](_0x3d12c1['query'][_0x023a('0x38')]));_0x49d60c['attributes']=_0x49d60c[_0x023a('0x36')][_0x023a('0x49')]?_0x49d60c[_0x023a('0x36')]:_0x1dfea3['model'];if(!_0x3d12c1[_0x023a('0x32')][_0x023a('0x39')](_0x023a('0x3a'))){_0x49d60c[_0x023a('0x1e')]=qs[_0x023a('0x1e')](_0x3d12c1['query']['limit']);_0x49d60c['offset']=qs[_0x023a('0x20')](_0x3d12c1['query'][_0x023a('0x20')]);}_0x49d60c['order']=qs[_0x023a('0x3c')](_0x3d12c1[_0x023a('0x32')][_0x023a('0x3c')]);_0x49d60c[_0x023a('0x3f')]=qs[_0x023a('0x34')](_[_0x023a('0x3d')](_0x3d12c1[_0x023a('0x32')],_0x1dfea3[_0x023a('0x34')]));_0x49d60c[_0x023a('0x3f')][_0x023a('0x52')]=_0x1d1f6f['id'];if(_0x3d12c1['query']['filter']){_0x49d60c['where']=_[_0x023a('0x40')](_0x49d60c[_0x023a('0x3f')],{'$or':_[_0x023a('0x2d')](_0x49d60c['attributes'],function(_0x12ba90){var _0x37804e={};_0x37804e[_0x12ba90]={'$like':'%'+_0x3d12c1[_0x023a('0x32')][_0x023a('0x3e')]+'%'};return _0x37804e;})});}_0x49d60c=_[_0x023a('0x40')]({},_0x49d60c,_0x3d12c1[_0x023a('0x4a')]);return db[_0x023a('0x51')][_0x023a('0x1f')]({'where':_0x49d60c[_0x023a('0x3f')]})[_0x023a('0x27')](function(_0x4866a8){_0x36f8b6[_0x023a('0x1f')]=_0x4866a8;if(_0x3d12c1[_0x023a('0x32')]['includeAll']){_0x49d60c['include']=[{'all':!![]}];}return db[_0x023a('0x51')][_0x023a('0x44')](_0x49d60c);})[_0x023a('0x27')](function(_0x546d33){_0x36f8b6[_0x023a('0x45')]=_0x546d33;return _0x36f8b6;});}})[_0x023a('0x27')](respondWithFilteredResult(_0x1f44e2,_0x49d60c))[_0x023a('0x46')](handleError(_0x1f44e2,null));}; \ No newline at end of file +var _0xbb29=['send','index','map','JscriptySessionReport','rawAttributes','type','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','keys','include','find','catch','create','body','describe','getQuestions','findOne','SessionId','JscriptyQuestionReport','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','limit','undefined','count','set','apply','reject','save','update','then','destroy','error','stack','name'];(function(_0x1f7e2b,_0x32d930){var _0x2c88c9=function(_0x379d1c){while(--_0x379d1c){_0x1f7e2b['push'](_0x1f7e2b['shift']());}};_0x2c88c9(++_0x32d930);}(_0xbb29,0x118));var _0x9bb2=function(_0x168f75,_0x47c9c9){_0x168f75=_0x168f75-0x0;var _0x231bc9=_0xbb29[_0x168f75];return _0x231bc9;};'use strict';var emlformat=require(_0x9bb2('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x9bb2('0x1'));var rp=require(_0x9bb2('0x2'));var moment=require(_0x9bb2('0x3'));var BPromise=require(_0x9bb2('0x4'));var Mustache=require(_0x9bb2('0x5'));var util=require(_0x9bb2('0x6'));var path=require(_0x9bb2('0x7'));var sox=require('sox');var csv=require(_0x9bb2('0x8'));var ejs=require(_0x9bb2('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9bb2('0xa'));var squel=require(_0x9bb2('0xb'));var crypto=require(_0x9bb2('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x9bb2('0xd'));var toCsv=require(_0x9bb2('0x8'));var querystring=require(_0x9bb2('0xe'));var Papa=require(_0x9bb2('0xf'));var Redis=require('ioredis');var authService=require(_0x9bb2('0x10'));var qs=require(_0x9bb2('0x11'));var as=require(_0x9bb2('0x12'));var hardwareService=require(_0x9bb2('0x13'));var logger=require('../../config/logger')(_0x9bb2('0x14'));var utils=require('../../config/utils');var config=require(_0x9bb2('0x15'));var licenseUtil=require(_0x9bb2('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x141e2c,_0x24266c){_0x24266c=_0x24266c||0xcc;return function(_0x42e674){if(_0x42e674){return _0x141e2c[_0x9bb2('0x17')](_0x24266c);}return _0x141e2c[_0x9bb2('0x18')](_0x24266c)[_0x9bb2('0x19')]();};}function respondWithResult(_0x4244ab,_0x56bcd9){_0x56bcd9=_0x56bcd9||0xc8;return function(_0x530f7d){if(_0x530f7d){return _0x4244ab[_0x9bb2('0x18')](_0x56bcd9)[_0x9bb2('0x1a')](_0x530f7d);}};}function respondWithFilteredResult(_0x2bef78,_0x1b3835){return function(_0x117048){if(_0x117048){var _0x527e6b=typeof _0x1b3835['offset']==='undefined'&&typeof _0x1b3835[_0x9bb2('0x1b')]===_0x9bb2('0x1c');var _0x59b39f=_0x117048['count'];var _0x2ff960=_0x527e6b?0x0:_0x1b3835['offset'];var _0x21a7dd=_0x527e6b?_0x117048[_0x9bb2('0x1d')]:_0x1b3835['offset']+_0x1b3835[_0x9bb2('0x1b')];var _0x44eacb;if(_0x21a7dd>=_0x59b39f){_0x21a7dd=_0x59b39f;_0x44eacb=0xc8;}else{_0x44eacb=0xce;}_0x2bef78[_0x9bb2('0x18')](_0x44eacb);return _0x2bef78[_0x9bb2('0x1e')]('Content-Range',_0x2ff960+'-'+_0x21a7dd+'/'+_0x59b39f)['json'](_0x117048);}return null;};}function patchUpdates(_0x46b480){return function(_0x26f096){try{jsonpatch[_0x9bb2('0x1f')](_0x26f096,_0x46b480,!![]);}catch(_0x262cae){return BPromise[_0x9bb2('0x20')](_0x262cae);}return _0x26f096[_0x9bb2('0x21')]();};}function saveUpdates(_0x1587a1,_0x3254cf){return function(_0x531d2a){if(_0x531d2a){return _0x531d2a[_0x9bb2('0x22')](_0x1587a1)[_0x9bb2('0x23')](function(_0x568dbd){return _0x568dbd;});}return null;};}function removeEntity(_0x2408cb,_0x55a6a6){return function(_0x377f4f){if(_0x377f4f){return _0x377f4f[_0x9bb2('0x24')]()[_0x9bb2('0x23')](function(){_0x2408cb['status'](0xcc)[_0x9bb2('0x19')]();});}};}function handleEntityNotFound(_0x98fef5,_0x1159c8){return function(_0x223df4){if(!_0x223df4){_0x98fef5[_0x9bb2('0x17')](0x194);}return _0x223df4;};}function handleError(_0x3ec8cb,_0x20c14a){_0x20c14a=_0x20c14a||0x1f4;return function(_0x55ed6e){logger[_0x9bb2('0x25')](_0x55ed6e[_0x9bb2('0x26')]);if(_0x55ed6e[_0x9bb2('0x27')]){delete _0x55ed6e['name'];}_0x3ec8cb['status'](_0x20c14a)[_0x9bb2('0x28')](_0x55ed6e);};}exports[_0x9bb2('0x29')]=function(_0x2fc6d1,_0x2b1f2d){var _0x136697={},_0x1db99b={},_0x158f00={'count':0x0,'rows':[]};var _0x40e595=_[_0x9bb2('0x2a')](db[_0x9bb2('0x2b')][_0x9bb2('0x2c')],function(_0x292344){return{'name':_0x292344['fieldName'],'type':_0x292344[_0x9bb2('0x2d')]['key']};});_0x1db99b['model']=_[_0x9bb2('0x2a')](_0x40e595,_0x9bb2('0x27'));_0x1db99b[_0x9bb2('0x2e')]=_['keys'](_0x2fc6d1[_0x9bb2('0x2e')]);_0x1db99b['filters']=_[_0x9bb2('0x2f')](_0x1db99b[_0x9bb2('0x30')],_0x1db99b[_0x9bb2('0x2e')]);_0x136697[_0x9bb2('0x31')]=_[_0x9bb2('0x2f')](_0x1db99b[_0x9bb2('0x30')],qs[_0x9bb2('0x32')](_0x2fc6d1[_0x9bb2('0x2e')][_0x9bb2('0x32')]));_0x136697[_0x9bb2('0x31')]=_0x136697['attributes'][_0x9bb2('0x33')]?_0x136697[_0x9bb2('0x31')]:_0x1db99b[_0x9bb2('0x30')];if(!_0x2fc6d1['query'][_0x9bb2('0x34')](_0x9bb2('0x35'))){_0x136697[_0x9bb2('0x1b')]=qs['limit'](_0x2fc6d1[_0x9bb2('0x2e')][_0x9bb2('0x1b')]);_0x136697[_0x9bb2('0x36')]=qs['offset'](_0x2fc6d1[_0x9bb2('0x2e')]['offset']);}_0x136697[_0x9bb2('0x37')]=qs[_0x9bb2('0x38')](_0x2fc6d1['query']['sort']);_0x136697[_0x9bb2('0x39')]=qs['filters'](_[_0x9bb2('0x3a')](_0x2fc6d1[_0x9bb2('0x2e')],_0x1db99b[_0x9bb2('0x3b')]),_0x40e595);if(_0x2fc6d1['query'][_0x9bb2('0x3c')]){_0x136697[_0x9bb2('0x39')]=_[_0x9bb2('0x3d')](_0x136697[_0x9bb2('0x39')],{'$or':_[_0x9bb2('0x2a')](_0x40e595,function(_0x14f60e){if(_0x14f60e['type']!==_0x9bb2('0x3e')){var _0x17ec30={};_0x17ec30[_0x14f60e['name']]={'$like':'%'+_0x2fc6d1[_0x9bb2('0x2e')][_0x9bb2('0x3c')]+'%'};return _0x17ec30;}})});}_0x136697=_[_0x9bb2('0x3d')]({},_0x136697,_0x2fc6d1[_0x9bb2('0x3f')]);var _0x2266bb={'where':_0x136697['where']};return db[_0x9bb2('0x2b')][_0x9bb2('0x1d')](_0x2266bb)[_0x9bb2('0x23')](function(_0x4fd1d1){_0x158f00[_0x9bb2('0x1d')]=_0x4fd1d1;if(_0x2fc6d1[_0x9bb2('0x2e')][_0x9bb2('0x40')]){_0x136697['include']=[{'all':!![]}];}return db[_0x9bb2('0x2b')][_0x9bb2('0x41')](_0x136697);})['then'](function(_0x57710f){_0x158f00[_0x9bb2('0x42')]=_0x57710f;return _0x158f00;})[_0x9bb2('0x23')](respondWithFilteredResult(_0x2b1f2d,_0x136697))['catch'](handleError(_0x2b1f2d,null));};exports[_0x9bb2('0x43')]=function(_0x283716,_0x1802b8){var _0x209881={'raw':!![],'where':{'id':_0x283716[_0x9bb2('0x44')]['id']}},_0x577886={};_0x577886[_0x9bb2('0x30')]=_[_0x9bb2('0x45')](db[_0x9bb2('0x2b')][_0x9bb2('0x2c')]);_0x577886['query']=_[_0x9bb2('0x45')](_0x283716['query']);_0x577886['filters']=_[_0x9bb2('0x2f')](_0x577886['model'],_0x577886['query']);_0x209881[_0x9bb2('0x31')]=_[_0x9bb2('0x2f')](_0x577886[_0x9bb2('0x30')],qs['fields'](_0x283716[_0x9bb2('0x2e')][_0x9bb2('0x32')]));_0x209881[_0x9bb2('0x31')]=_0x209881[_0x9bb2('0x31')]['length']?_0x209881[_0x9bb2('0x31')]:_0x577886[_0x9bb2('0x30')];if(_0x283716['query'][_0x9bb2('0x40')]){_0x209881[_0x9bb2('0x46')]=[{'all':!![]}];}_0x209881=_[_0x9bb2('0x3d')]({},_0x209881,_0x283716['options']);return db[_0x9bb2('0x2b')][_0x9bb2('0x47')](_0x209881)[_0x9bb2('0x23')](handleEntityNotFound(_0x1802b8,null))[_0x9bb2('0x23')](respondWithResult(_0x1802b8,null))[_0x9bb2('0x48')](handleError(_0x1802b8,null));};exports[_0x9bb2('0x49')]=function(_0x1dfe11,_0x3f42ee){return db['JscriptySessionReport']['create'](_0x1dfe11['body'],{})[_0x9bb2('0x23')](respondWithResult(_0x3f42ee,0xc9))[_0x9bb2('0x48')](handleError(_0x3f42ee,null));};exports['update']=function(_0x34524e,_0x4d6e45){if(_0x34524e[_0x9bb2('0x4a')]['id']){delete _0x34524e[_0x9bb2('0x4a')]['id'];}return db['JscriptySessionReport'][_0x9bb2('0x47')]({'where':{'id':_0x34524e[_0x9bb2('0x44')]['id']}})['then'](handleEntityNotFound(_0x4d6e45,null))[_0x9bb2('0x23')](saveUpdates(_0x34524e['body'],null))[_0x9bb2('0x23')](respondWithResult(_0x4d6e45,null))[_0x9bb2('0x48')](handleError(_0x4d6e45,null));};exports[_0x9bb2('0x24')]=function(_0x4b6cc8,_0x17f994){return db['JscriptySessionReport']['find']({'where':{'id':_0x4b6cc8[_0x9bb2('0x44')]['id']}})[_0x9bb2('0x23')](handleEntityNotFound(_0x17f994,null))['then'](removeEntity(_0x17f994,null))[_0x9bb2('0x48')](handleError(_0x17f994,null));};exports[_0x9bb2('0x4b')]=function(_0xa9b88b,_0x2ffde6){return db[_0x9bb2('0x2b')]['describe']()[_0x9bb2('0x23')](respondWithResult(_0x2ffde6,null))[_0x9bb2('0x48')](handleError(_0x2ffde6,null));};exports[_0x9bb2('0x4c')]=function(_0x1ff5fd,_0x52f3ca,_0x20494e){var _0xebbc97={'raw':!![],'where':{}};var _0xc95601={};var _0x2ace43={'count':0x0,'rows':[]};return db[_0x9bb2('0x2b')][_0x9bb2('0x4d')]({'where':{'id':_0x1ff5fd['params']['id']}})[_0x9bb2('0x23')](handleEntityNotFound(_0x52f3ca,null))['then'](function(_0x4b1a5c){if(_0x4b1a5c){_0xc95601['model']=_[_0x9bb2('0x45')](db['JscriptyQuestionReport'][_0x9bb2('0x2c')]);_0xc95601[_0x9bb2('0x2e')]=_[_0x9bb2('0x45')](_0x1ff5fd[_0x9bb2('0x2e')]);_0xc95601[_0x9bb2('0x3b')]=_[_0x9bb2('0x2f')](_0xc95601[_0x9bb2('0x30')],_0xc95601[_0x9bb2('0x2e')]);_0xebbc97[_0x9bb2('0x31')]=_[_0x9bb2('0x2f')](_0xc95601['model'],qs['fields'](_0x1ff5fd[_0x9bb2('0x2e')]['fields']));_0xebbc97[_0x9bb2('0x31')]=_0xebbc97['attributes']['length']?_0xebbc97[_0x9bb2('0x31')]:_0xc95601[_0x9bb2('0x30')];if(!_0x1ff5fd[_0x9bb2('0x2e')]['hasOwnProperty']('nolimit')){_0xebbc97[_0x9bb2('0x1b')]=qs['limit'](_0x1ff5fd['query'][_0x9bb2('0x1b')]);_0xebbc97[_0x9bb2('0x36')]=qs[_0x9bb2('0x36')](_0x1ff5fd[_0x9bb2('0x2e')]['offset']);}_0xebbc97[_0x9bb2('0x37')]=qs[_0x9bb2('0x38')](_0x1ff5fd[_0x9bb2('0x2e')][_0x9bb2('0x38')]);_0xebbc97[_0x9bb2('0x39')]=qs[_0x9bb2('0x3b')](_[_0x9bb2('0x3a')](_0x1ff5fd[_0x9bb2('0x2e')],_0xc95601['filters']));_0xebbc97[_0x9bb2('0x39')][_0x9bb2('0x4e')]=_0x4b1a5c['id'];if(_0x1ff5fd['query'][_0x9bb2('0x3c')]){_0xebbc97[_0x9bb2('0x39')]=_[_0x9bb2('0x3d')](_0xebbc97[_0x9bb2('0x39')],{'$or':_[_0x9bb2('0x2a')](_0xebbc97[_0x9bb2('0x31')],function(_0xc4f0f1){var _0x2137f0={};_0x2137f0[_0xc4f0f1]={'$like':'%'+_0x1ff5fd[_0x9bb2('0x2e')][_0x9bb2('0x3c')]+'%'};return _0x2137f0;})});}_0xebbc97=_[_0x9bb2('0x3d')]({},_0xebbc97,_0x1ff5fd[_0x9bb2('0x3f')]);return db[_0x9bb2('0x4f')][_0x9bb2('0x1d')]({'where':_0xebbc97['where']})[_0x9bb2('0x23')](function(_0x423f3e){_0x2ace43[_0x9bb2('0x1d')]=_0x423f3e;if(_0x1ff5fd[_0x9bb2('0x2e')][_0x9bb2('0x40')]){_0xebbc97[_0x9bb2('0x46')]=[{'all':!![]}];}return db['JscriptyQuestionReport']['findAll'](_0xebbc97);})[_0x9bb2('0x23')](function(_0x55d751){_0x2ace43[_0x9bb2('0x42')]=_0x55d751;return _0x2ace43;});}})[_0x9bb2('0x23')](respondWithFilteredResult(_0x52f3ca,_0xebbc97))[_0x9bb2('0x48')](handleError(_0x52f3ca,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 7190e92..3025137 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 _0xafb9=['request-promise','path','rimraf','exports','report_jscripty_sessions','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x9254cf,_0x374af2){var _0x290603=function(_0x409fb8){while(--_0x409fb8){_0x9254cf['push'](_0x9254cf['shift']());}};_0x290603(++_0x374af2);}(_0xafb9,0x68));var _0x9afb=function(_0xe622fe,_0x3e2190){_0xe622fe=_0xe622fe-0x0;var _0xea9e77=_0xafb9[_0xe622fe];return _0xea9e77;};'use strict';var _=require(_0x9afb('0x0'));var util=require(_0x9afb('0x1'));var logger=require(_0x9afb('0x2'))(_0x9afb('0x3'));var moment=require(_0x9afb('0x4'));var BPromise=require(_0x9afb('0x5'));var rp=require(_0x9afb('0x6'));var fs=require('fs');var path=require(_0x9afb('0x7'));var rimraf=require(_0x9afb('0x8'));var config=require('../../config/environment');var attributes=require('./jscriptySessionReport.attributes');module[_0x9afb('0x9')]=function(_0x56a139,_0x1ccf93){return _0x56a139['define']('JscriptySessionReport',attributes,{'tableName':_0x9afb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2675=['lodash','moment','bluebird','path','rimraf','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport'];(function(_0x34232c,_0x18e61d){var _0x4d4f4e=function(_0x1aeb3d){while(--_0x1aeb3d){_0x34232c['push'](_0x34232c['shift']());}};_0x4d4f4e(++_0x18e61d);}(_0x2675,0x75));var _0x5267=function(_0x36917c,_0xae4682){_0x36917c=_0x36917c-0x0;var _0x1ee4d8=_0x2675[_0x36917c];return _0x1ee4d8;};'use strict';var _=require(_0x5267('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x5267('0x1'));var BPromise=require(_0x5267('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5267('0x3'));var rimraf=require(_0x5267('0x4'));var config=require('../../config/environment');var attributes=require(_0x5267('0x5'));module[_0x5267('0x6')]=function(_0x4bd042,_0x10f92c){return _0x4bd042[_0x5267('0x7')](_0x5267('0x8'),attributes,{'tableName':'report_jscripty_sessions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js index ff327e6..8c16dc1 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 _0x0295=['client','http','then','info','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','JscriptySessionReport,\x20%s,\x20%s','message','result','catch','lodash','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x5a9b61,_0x48d272){var _0x705175=function(_0x5a7620){while(--_0x5a7620){_0x5a9b61['push'](_0x5a9b61['shift']());}};_0x705175(++_0x48d272);}(_0x0295,0x1f0));var _0x5029=function(_0x2f06b3,_0x12feb6){_0x2f06b3=_0x2f06b3-0x0;var _0x270d4d=_0x0295[_0x2f06b3];return _0x270d4d;};'use strict';var _=require(_0x5029('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5029('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5029('0x2'))['db'];var utils=require(_0x5029('0x3'));var logger=require(_0x5029('0x4'))(_0x5029('0x5'));var config=require(_0x5029('0x6'));var jayson=require(_0x5029('0x7'));var client=jayson[_0x5029('0x8')][_0x5029('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5b3cd,_0x502a62,_0x54978f){return new BPromise(function(_0x4ee867,_0xf4459b){return client['request'](_0x5b3cd,_0x54978f)[_0x5029('0xa')](function(_0x5bccfc){logger[_0x5029('0xb')]('JscriptySessionReport,\x20%s,\x20%s',_0x502a62,_0x5029('0xc'));logger[_0x5029('0xd')](_0x5029('0xe'),_0x502a62,'request\x20sent',JSON[_0x5029('0xf')](_0x5bccfc));if(_0x5bccfc[_0x5029('0x10')]){if(_0x5bccfc[_0x5029('0x10')]['code']===0x1f4){logger[_0x5029('0x10')](_0x5029('0x11'),_0x502a62,_0x5bccfc['error']['message']);return _0xf4459b(_0x5bccfc['error']['message']);}logger[_0x5029('0x10')](_0x5029('0x11'),_0x502a62,_0x5bccfc[_0x5029('0x10')][_0x5029('0x12')]);return _0x4ee867(_0x5bccfc[_0x5029('0x10')][_0x5029('0x12')]);}else{logger[_0x5029('0xb')](_0x5029('0x11'),_0x502a62,_0x5029('0xc'));_0x4ee867(_0x5bccfc[_0x5029('0x13')][_0x5029('0x12')]);}})[_0x5029('0x14')](function(_0x3786b5){logger[_0x5029('0x10')](_0x5029('0x11'),_0x502a62,_0x3786b5);_0xf4459b(_0x3786b5);});});} \ No newline at end of file +var _0x1883=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x1400e3,_0x24bcc6){var _0x3d285b=function(_0x6bc469){while(--_0x6bc469){_0x1400e3['push'](_0x1400e3['shift']());}};_0x3d285b(++_0x24bcc6);}(_0x1883,0xab));var _0x3188=function(_0x3efdc1,_0x5c2418){_0x3efdc1=_0x3efdc1-0x0;var _0x17f380=_0x1883[_0x3efdc1];return _0x17f380;};'use strict';var _=require(_0x3188('0x0'));var util=require(_0x3188('0x1'));var moment=require(_0x3188('0x2'));var BPromise=require(_0x3188('0x3'));var rs=require(_0x3188('0x4'));var fs=require('fs');var Redis=require(_0x3188('0x5'));var db=require(_0x3188('0x6'))['db'];var utils=require(_0x3188('0x7'));var logger=require(_0x3188('0x8'))(_0x3188('0x9'));var config=require(_0x3188('0xa'));var jayson=require(_0x3188('0xb'));var client=jayson[_0x3188('0xc')][_0x3188('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x24f2f1,_0x3ce7fd,_0x3e3afb){return new BPromise(function(_0x5c8f26,_0x446ab7){return client[_0x3188('0xe')](_0x24f2f1,_0x3e3afb)['then'](function(_0x2213b5){logger['info'](_0x3188('0xf'),_0x3ce7fd,_0x3188('0x10'));logger[_0x3188('0x11')](_0x3188('0x12'),_0x3ce7fd,'request\x20sent',JSON[_0x3188('0x13')](_0x2213b5));if(_0x2213b5[_0x3188('0x14')]){if(_0x2213b5['error']['code']===0x1f4){logger[_0x3188('0x14')](_0x3188('0xf'),_0x3ce7fd,_0x2213b5[_0x3188('0x14')][_0x3188('0x15')]);return _0x446ab7(_0x2213b5[_0x3188('0x14')][_0x3188('0x15')]);}logger['error'](_0x3188('0xf'),_0x3ce7fd,_0x2213b5['error']['message']);return _0x5c8f26(_0x2213b5[_0x3188('0x14')]['message']);}else{logger['info'](_0x3188('0xf'),_0x3ce7fd,_0x3188('0x10'));_0x5c8f26(_0x2213b5[_0x3188('0x16')][_0x3188('0x15')]);}})[_0x3188('0x17')](function(_0x259321){logger['error'](_0x3188('0xf'),_0x3ce7fd,_0x259321);_0x446ab7(_0x259321);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index 6a8d3e7..3025d2b 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 _0x88f2=['./license.controller','get','index','put','/:id','isAuthenticated','update','/download_log_file','downloadLogFile','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x5103d7,_0x2f7696){var _0x48adac=function(_0x5e247f){while(--_0x5e247f){_0x5103d7['push'](_0x5103d7['shift']());}};_0x48adac(++_0x2f7696);}(_0x88f2,0x82));var _0x288f=function(_0x298a3a,_0xf9eb12){_0x298a3a=_0x298a3a-0x0;var _0x5380fa=_0x88f2[_0x298a3a];return _0x5380fa;};'use strict';var multer=require(_0x288f('0x0'));var util=require(_0x288f('0x1'));var path=require(_0x288f('0x2'));var timeout=require(_0x288f('0x3'));var express=require(_0x288f('0x4'));var router=express[_0x288f('0x5')]();var fs_extra=require(_0x288f('0x6'));var auth=require(_0x288f('0x7'));var interaction=require(_0x288f('0x8'));var config=require(_0x288f('0x9'));var controller=require(_0x288f('0xa'));router[_0x288f('0xb')]('/',controller[_0x288f('0xc')]);router[_0x288f('0xd')](_0x288f('0xe'),auth[_0x288f('0xf')](),controller[_0x288f('0x10')]);router[_0x288f('0xb')](_0x288f('0x11'),auth[_0x288f('0xf')](),controller[_0x288f('0x12')]);module[_0x288f('0x13')]=router; \ No newline at end of file +var _0xaf5a=['util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./license.controller','get','index','put','/:id','isAuthenticated','update','/download_log_file','downloadLogFile'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xaf5a,0x130));var _0xaaf5=function(_0x27a0a9,_0x1e7dd1){_0x27a0a9=_0x27a0a9-0x0;var _0x11cb3b=_0xaf5a[_0x27a0a9];return _0x11cb3b;};'use strict';var multer=require('multer');var util=require(_0xaaf5('0x0'));var path=require(_0xaaf5('0x1'));var timeout=require(_0xaaf5('0x2'));var express=require(_0xaaf5('0x3'));var router=express[_0xaaf5('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xaaf5('0x5'));var config=require(_0xaaf5('0x6'));var controller=require(_0xaaf5('0x7'));router[_0xaaf5('0x8')]('/',controller[_0xaaf5('0x9')]);router[_0xaaf5('0xa')](_0xaaf5('0xb'),auth[_0xaaf5('0xc')](),controller[_0xaaf5('0xd')]);router[_0xaaf5('0x8')](_0xaaf5('0xe'),auth[_0xaaf5('0xc')](),controller[_0xaaf5('0xf')]);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 9f07324..a4306a1 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 _0x7c13=['exports','STRING'];(function(_0x13c98c,_0x10f298){var _0x474cbb=function(_0x5b7f6e){while(--_0x5b7f6e){_0x13c98c['push'](_0x13c98c['shift']());}};_0x474cbb(++_0x10f298);}(_0x7c13,0x14e));var _0x37c1=function(_0x52a7e1,_0x189bf3){_0x52a7e1=_0x52a7e1-0x0;var _0x4f4495=_0x7c13[_0x52a7e1];return _0x4f4495;};'use strict';var Sequelize=require('sequelize');module[_0x37c1('0x0')]={'license':{'type':Sequelize['TEXT']},'data1':{'type':Sequelize[_0x37c1('0x1')]},'data2':{'type':Sequelize['STRING']},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x8356=['sequelize','exports','STRING','INTEGER'];(function(_0x4108e9,_0x58da63){var _0x369cc4=function(_0x527bfd){while(--_0x527bfd){_0x4108e9['push'](_0x4108e9['shift']());}};_0x369cc4(++_0x58da63);}(_0x8356,0xe4));var _0x6835=function(_0x11026e,_0x164422){_0x11026e=_0x11026e-0x0;var _0x334d99=_0x8356[_0x11026e];return _0x334d99;};'use strict';var Sequelize=require(_0x6835('0x0'));module[_0x6835('0x1')]={'license':{'type':Sequelize['TEXT']},'data1':{'type':Sequelize[_0x6835('0x2')]},'data2':{'type':Sequelize[_0x6835('0x2')]},'chatLicenseExceeded':{'type':Sequelize[_0x6835('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 e7f3375..a28cfdf 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 _0xb533=['ejs','fs-extra','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','update','then','error','name','send','index','model','keys','License','filters','attributes','query','fields','length','getLicense','catch','body','find','get','checkLicense','demo','downloadLogFile','join','log','xcally','setHeader','Content-disposition','text/plain','download','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv'];(function(_0x1ea8fc,_0x522c8f){var _0x432b05=function(_0x46771c){while(--_0x46771c){_0x1ea8fc['push'](_0x1ea8fc['shift']());}};_0x432b05(++_0x522c8f);}(_0xb533,0x136));var _0x3b53=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0xb533[_0x209941];return _0x1e8729;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3b53('0x0'));var zipdir=require(_0x3b53('0x1'));var jsonpatch=require(_0x3b53('0x2'));var rp=require(_0x3b53('0x3'));var moment=require(_0x3b53('0x4'));var BPromise=require(_0x3b53('0x5'));var Mustache=require(_0x3b53('0x6'));var util=require(_0x3b53('0x7'));var path=require('path');var sox=require(_0x3b53('0x8'));var csv=require(_0x3b53('0x9'));var ejs=require(_0x3b53('0xa'));var fs=require('fs');var fs_extra=require(_0x3b53('0xb'));var _=require('lodash');var squel=require(_0x3b53('0xc'));var crypto=require(_0x3b53('0xd'));var jsforce=require(_0x3b53('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x3b53('0x9'));var querystring=require('querystring');var Papa=require(_0x3b53('0xf'));var Redis=require('ioredis');var authService=require(_0x3b53('0x10'));var qs=require(_0x3b53('0x11'));var as=require(_0x3b53('0x12'));var hardwareService=require(_0x3b53('0x13'));var logger=require(_0x3b53('0x14'))(_0x3b53('0x15'));var utils=require(_0x3b53('0x16'));var config=require(_0x3b53('0x17'));var licenseUtil=require(_0x3b53('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3127a6,_0x334f2f){_0x334f2f=_0x334f2f||0xcc;return function(_0x29d272){if(_0x29d272){return _0x3127a6[_0x3b53('0x19')](_0x334f2f);}return _0x3127a6[_0x3b53('0x1a')](_0x334f2f)[_0x3b53('0x1b')]();};}function respondWithResult(_0x530ed2,_0x57eb78){_0x57eb78=_0x57eb78||0xc8;return function(_0x16a962){if(_0x16a962){return _0x530ed2[_0x3b53('0x1a')](_0x57eb78)['json'](_0x16a962);}};}function respondWithFilteredResult(_0x1de7d8,_0xa9c000){return function(_0x10723e){if(_0x10723e){var _0x369565=typeof _0xa9c000[_0x3b53('0x1c')]===_0x3b53('0x1d')&&typeof _0xa9c000[_0x3b53('0x1e')]===_0x3b53('0x1d');var _0x415764=_0x10723e['count'];var _0x12eb60=_0x369565?0x0:_0xa9c000[_0x3b53('0x1c')];var _0x2373d0=_0x369565?_0x10723e[_0x3b53('0x1f')]:_0xa9c000[_0x3b53('0x1c')]+_0xa9c000[_0x3b53('0x1e')];var _0x1ea97c;if(_0x2373d0>=_0x415764){_0x2373d0=_0x415764;_0x1ea97c=0xc8;}else{_0x1ea97c=0xce;}_0x1de7d8['status'](_0x1ea97c);return _0x1de7d8[_0x3b53('0x20')](_0x3b53('0x21'),_0x12eb60+'-'+_0x2373d0+'/'+_0x415764)[_0x3b53('0x22')](_0x10723e);}return null;};}function patchUpdates(_0x260a17){return function(_0x33ebba){try{jsonpatch['apply'](_0x33ebba,_0x260a17,!![]);}catch(_0x9d56d2){return BPromise['reject'](_0x9d56d2);}return _0x33ebba['save']();};}function saveUpdates(_0x539175,_0xbc8d98){return function(_0x51e8cb){if(_0x51e8cb){return _0x51e8cb[_0x3b53('0x23')](_0x539175)[_0x3b53('0x24')](function(_0x2c3a0e){return _0x2c3a0e;});}return null;};}function removeEntity(_0x4b0376,_0x5c94f4){return function(_0x42b57e){if(_0x42b57e){return _0x42b57e['destroy']()[_0x3b53('0x24')](function(){_0x4b0376[_0x3b53('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x45c29c,_0x168ca7){return function(_0x1a2428){if(!_0x1a2428){_0x45c29c['sendStatus'](0x194);}return _0x1a2428;};}function handleError(_0x86e96e,_0x4f4a29){_0x4f4a29=_0x4f4a29||0x1f4;return function(_0xd20280){logger[_0x3b53('0x25')](_0xd20280['stack']);if(_0xd20280[_0x3b53('0x26')]){delete _0xd20280[_0x3b53('0x26')];}_0x86e96e[_0x3b53('0x1a')](_0x4f4a29)[_0x3b53('0x27')](_0xd20280);};}var utilLicense=require(_0x3b53('0x18'));exports[_0x3b53('0x28')]=function(_0x5cf2d0,_0x34a8ba){var _0x2da5fd={'raw':!![],'where':{'id':0x1}},_0x3a28a9={};_0x3a28a9[_0x3b53('0x29')]=_[_0x3b53('0x2a')](db[_0x3b53('0x2b')]['rawAttributes']);_0x3a28a9['query']=_['keys'](_0x5cf2d0['query']);_0x3a28a9[_0x3b53('0x2c')]=_['intersection'](_0x3a28a9[_0x3b53('0x29')],_0x3a28a9['query']);_0x2da5fd[_0x3b53('0x2d')]=_['intersection'](_0x3a28a9['model'],qs['fields'](_0x5cf2d0[_0x3b53('0x2e')][_0x3b53('0x2f')]));_0x2da5fd[_0x3b53('0x2d')]=_0x2da5fd[_0x3b53('0x2d')][_0x3b53('0x30')]?_0x2da5fd[_0x3b53('0x2d')]:_0x3a28a9[_0x3b53('0x29')];_0x2da5fd=_['merge']({},_0x2da5fd,_0x5cf2d0['options']);return utilLicense[_0x3b53('0x31')](_0x2da5fd)[_0x3b53('0x24')](respondWithResult(_0x34a8ba,null))[_0x3b53('0x32')](handleError(_0x34a8ba,null));};exports[_0x3b53('0x23')]=function(_0x317f82,_0x3dee06){if(_0x317f82['body']['id']){delete _0x317f82[_0x3b53('0x33')]['id'];}return db[_0x3b53('0x2b')][_0x3b53('0x34')]({'where':{'id':_0x317f82['params']['id']}})['then'](handleEntityNotFound(_0x3dee06,null))[_0x3b53('0x24')](function(_0x52bcb8){var _0x41655a=_0x52bcb8[_0x3b53('0x35')]({'plain':!![]});return utilLicense[_0x3b53('0x36')](_0x41655a,_0x317f82['body']['key']);})['then'](function(_0x5e1fa7){if(!_0x5e1fa7[_0x3b53('0x37')]){return saveUpdates(_0x317f82[_0x3b53('0x33')],null);}return _0x5e1fa7;})['then'](respondWithResult(_0x3dee06,null))['catch'](handleError(_0x3dee06,null));};exports[_0x3b53('0x38')]=function(_0x2df9bd,_0x1cf630){var _0x24c8e8='license-info.log';var _0x499caa=path[_0x3b53('0x39')]('/var',_0x3b53('0x3a'),_0x3b53('0x3b'),_0x24c8e8);_0x1cf630[_0x3b53('0x3c')](_0x3b53('0x3d'),'attachment;\x20filename='+_0x24c8e8);_0x1cf630[_0x3b53('0x20')]('Content-Type',_0x3b53('0x3e'));_0x1cf630[_0x3b53('0x3f')](_0x499caa);}; \ No newline at end of file +var _0xb26c=['undefined','limit','count','status','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','model','keys','License','rawAttributes','query','filters','intersection','fields','attributes','merge','options','getLicense','catch','body','find','params','get','checkLicense','demo','downloadLogFile','join','/var','log','xcally','Content-disposition','attachment;\x20filename=','set','Content-Type','download','eml-format','rimraf','request-promise','bluebird','util','sox','to-csv','fs-extra','lodash','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','sendStatus','end','offset'];(function(_0x480e6d,_0x716219){var _0x5cd9cc=function(_0x20727e){while(--_0x20727e){_0x480e6d['push'](_0x480e6d['shift']());}};_0x5cd9cc(++_0x716219);}(_0xb26c,0x72));var _0xcb26=function(_0x3827fd,_0x2a5a28){_0x3827fd=_0x3827fd-0x0;var _0x3d5239=_0xb26c[_0x3827fd];return _0x3d5239;};'use strict';var emlformat=require(_0xcb26('0x0'));var rimraf=require(_0xcb26('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xcb26('0x2'));var moment=require('moment');var BPromise=require(_0xcb26('0x3'));var Mustache=require('mustache');var util=require(_0xcb26('0x4'));var path=require('path');var sox=require(_0xcb26('0x5'));var csv=require(_0xcb26('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcb26('0x7'));var _=require(_0xcb26('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xcb26('0x9'));var toCsv=require(_0xcb26('0x6'));var querystring=require('querystring');var Papa=require(_0xcb26('0xa'));var Redis=require(_0xcb26('0xb'));var authService=require(_0xcb26('0xc'));var qs=require(_0xcb26('0xd'));var as=require(_0xcb26('0xe'));var hardwareService=require(_0xcb26('0xf'));var logger=require(_0xcb26('0x10'))(_0xcb26('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xcb26('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x243d97,_0x5a3542){_0x5a3542=_0x5a3542||0xcc;return function(_0x5652e3){if(_0x5652e3){return _0x243d97[_0xcb26('0x13')](_0x5a3542);}return _0x243d97['status'](_0x5a3542)[_0xcb26('0x14')]();};}function respondWithResult(_0x4457ea,_0x4b7732){_0x4b7732=_0x4b7732||0xc8;return function(_0x129d35){if(_0x129d35){return _0x4457ea['status'](_0x4b7732)['json'](_0x129d35);}};}function respondWithFilteredResult(_0xe56c24,_0x1b6409){return function(_0x50c369){if(_0x50c369){var _0x2c162f=typeof _0x1b6409[_0xcb26('0x15')]===_0xcb26('0x16')&&typeof _0x1b6409[_0xcb26('0x17')]===_0xcb26('0x16');var _0x39f96c=_0x50c369[_0xcb26('0x18')];var _0x463eda=_0x2c162f?0x0:_0x1b6409[_0xcb26('0x15')];var _0x432fe6=_0x2c162f?_0x50c369[_0xcb26('0x18')]:_0x1b6409['offset']+_0x1b6409['limit'];var _0x2c0edd;if(_0x432fe6>=_0x39f96c){_0x432fe6=_0x39f96c;_0x2c0edd=0xc8;}else{_0x2c0edd=0xce;}_0xe56c24[_0xcb26('0x19')](_0x2c0edd);return _0xe56c24['set'](_0xcb26('0x1a'),_0x463eda+'-'+_0x432fe6+'/'+_0x39f96c)[_0xcb26('0x1b')](_0x50c369);}return null;};}function patchUpdates(_0x57cdd1){return function(_0x533c1c){try{jsonpatch[_0xcb26('0x1c')](_0x533c1c,_0x57cdd1,!![]);}catch(_0x2c4c82){return BPromise[_0xcb26('0x1d')](_0x2c4c82);}return _0x533c1c[_0xcb26('0x1e')]();};}function saveUpdates(_0x10035e,_0xccc66c){return function(_0x43d861){if(_0x43d861){return _0x43d861[_0xcb26('0x1f')](_0x10035e)[_0xcb26('0x20')](function(_0x5ab1ab){return _0x5ab1ab;});}return null;};}function removeEntity(_0x251ab4,_0x35eb9a){return function(_0x347277){if(_0x347277){return _0x347277[_0xcb26('0x21')]()[_0xcb26('0x20')](function(){_0x251ab4[_0xcb26('0x19')](0xcc)[_0xcb26('0x14')]();});}};}function handleEntityNotFound(_0x5a9b63,_0x4cb944){return function(_0x288098){if(!_0x288098){_0x5a9b63[_0xcb26('0x13')](0x194);}return _0x288098;};}function handleError(_0x2cf653,_0x407484){_0x407484=_0x407484||0x1f4;return function(_0x4919ca){logger[_0xcb26('0x22')](_0x4919ca[_0xcb26('0x23')]);if(_0x4919ca['name']){delete _0x4919ca[_0xcb26('0x24')];}_0x2cf653['status'](_0x407484)[_0xcb26('0x25')](_0x4919ca);};}var utilLicense=require(_0xcb26('0x12'));exports[_0xcb26('0x26')]=function(_0x54f42f,_0x39eeb8){var _0x12e8fe={'raw':!![],'where':{'id':0x1}},_0x43a5aa={};_0x43a5aa[_0xcb26('0x27')]=_[_0xcb26('0x28')](db[_0xcb26('0x29')][_0xcb26('0x2a')]);_0x43a5aa[_0xcb26('0x2b')]=_[_0xcb26('0x28')](_0x54f42f[_0xcb26('0x2b')]);_0x43a5aa[_0xcb26('0x2c')]=_[_0xcb26('0x2d')](_0x43a5aa['model'],_0x43a5aa[_0xcb26('0x2b')]);_0x12e8fe['attributes']=_[_0xcb26('0x2d')](_0x43a5aa['model'],qs[_0xcb26('0x2e')](_0x54f42f[_0xcb26('0x2b')][_0xcb26('0x2e')]));_0x12e8fe[_0xcb26('0x2f')]=_0x12e8fe[_0xcb26('0x2f')]['length']?_0x12e8fe['attributes']:_0x43a5aa['model'];_0x12e8fe=_[_0xcb26('0x30')]({},_0x12e8fe,_0x54f42f[_0xcb26('0x31')]);return utilLicense[_0xcb26('0x32')](_0x12e8fe)['then'](respondWithResult(_0x39eeb8,null))[_0xcb26('0x33')](handleError(_0x39eeb8,null));};exports[_0xcb26('0x1f')]=function(_0x5eb105,_0x30f2b0){if(_0x5eb105['body']['id']){delete _0x5eb105[_0xcb26('0x34')]['id'];}return db[_0xcb26('0x29')][_0xcb26('0x35')]({'where':{'id':_0x5eb105[_0xcb26('0x36')]['id']}})[_0xcb26('0x20')](handleEntityNotFound(_0x30f2b0,null))[_0xcb26('0x20')](function(_0x44ce06){var _0x365dc5=_0x44ce06[_0xcb26('0x37')]({'plain':!![]});return utilLicense[_0xcb26('0x38')](_0x365dc5,_0x5eb105[_0xcb26('0x34')]['key']);})['then'](function(_0x579d3c){if(!_0x579d3c[_0xcb26('0x39')]){return saveUpdates(_0x5eb105['body'],null);}return _0x579d3c;})[_0xcb26('0x20')](respondWithResult(_0x30f2b0,null))['catch'](handleError(_0x30f2b0,null));};exports[_0xcb26('0x3a')]=function(_0xb152d1,_0x3c1ba6){var _0x38e406='license-info.log';var _0x3d0488=path[_0xcb26('0x3b')](_0xcb26('0x3c'),_0xcb26('0x3d'),_0xcb26('0x3e'),_0x38e406);_0x3c1ba6['setHeader'](_0xcb26('0x3f'),_0xcb26('0x40')+_0x38e406);_0x3c1ba6[_0xcb26('0x41')](_0xcb26('0x42'),'text/plain');_0x3c1ba6[_0xcb26('0x43')](_0x3d0488);}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index e0326cd..bb84eec 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 _0xe656=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','define','License','license'];(function(_0x252638,_0x47860d){var _0x562981=function(_0x4a3117){while(--_0x4a3117){_0x252638['push'](_0x252638['shift']());}};_0x562981(++_0x47860d);}(_0xe656,0xf0));var _0x6e65=function(_0xdf531d,_0x1541e3){_0xdf531d=_0xdf531d-0x0;var _0xb1c366=_0xe656[_0xdf531d];return _0xb1c366;};'use strict';var _=require('lodash');var util=require(_0x6e65('0x0'));var logger=require(_0x6e65('0x1'))(_0x6e65('0x2'));var moment=require('moment');var BPromise=require(_0x6e65('0x3'));var rp=require(_0x6e65('0x4'));var fs=require('fs');var path=require(_0x6e65('0x5'));var rimraf=require(_0x6e65('0x6'));var config=require('../../config/environment');var attributes=require('./license.attributes');module['exports']=function(_0x29f800,_0x377f9a){return _0x29f800[_0x6e65('0x7')](_0x6e65('0x8'),attributes,{'tableName':_0x6e65('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5e86=['define','License','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./license.attributes','exports'];(function(_0x7929af,_0x47a374){var _0x2cea1d=function(_0x4e08d7){while(--_0x4e08d7){_0x7929af['push'](_0x7929af['shift']());}};_0x2cea1d(++_0x47a374);}(_0x5e86,0xe2));var _0x65e8=function(_0x4e9d7b,_0x1853fc){_0x4e9d7b=_0x4e9d7b-0x0;var _0x5cb7d4=_0x5e86[_0x4e9d7b];return _0x5cb7d4;};'use strict';var _=require(_0x65e8('0x0'));var util=require(_0x65e8('0x1'));var logger=require(_0x65e8('0x2'))(_0x65e8('0x3'));var moment=require(_0x65e8('0x4'));var BPromise=require(_0x65e8('0x5'));var rp=require(_0x65e8('0x6'));var fs=require('fs');var path=require(_0x65e8('0x7'));var rimraf=require(_0x65e8('0x8'));var config=require(_0x65e8('0x9'));var attributes=require(_0x65e8('0xa'));module[_0x65e8('0xb')]=function(_0x310449,_0x42f1b6){return _0x310449[_0x65e8('0xc')](_0x65e8('0xd'),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 8c6790f..16eb49d 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 _0x5f3d=['License,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','License,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x423097,_0x8a09f4){var _0x3a73f1=function(_0x9314f0){while(--_0x9314f0){_0x423097['push'](_0x423097['shift']());}};_0x3a73f1(++_0x8a09f4);}(_0x5f3d,0x8b));var _0xd5f3=function(_0x520d2f,_0x397535){_0x520d2f=_0x520d2f-0x0;var _0x343d01=_0x5f3d[_0x520d2f];return _0x343d01;};'use strict';var _=require(_0xd5f3('0x0'));var util=require(_0xd5f3('0x1'));var moment=require(_0xd5f3('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd5f3('0x3'));var db=require(_0xd5f3('0x4'))['db'];var utils=require(_0xd5f3('0x5'));var logger=require(_0xd5f3('0x6'))(_0xd5f3('0x7'));var config=require('../../config/environment');var jayson=require(_0xd5f3('0x8'));var client=jayson[_0xd5f3('0x9')][_0xd5f3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4bc738,_0x1433d7,_0x535e56){return new BPromise(function(_0x116df1,_0xbaad77){return client['request'](_0x4bc738,_0x535e56)[_0xd5f3('0xb')](function(_0x1d8bd5){logger['info'](_0xd5f3('0xc'),_0x1433d7,_0xd5f3('0xd'));logger[_0xd5f3('0xe')](_0xd5f3('0xf'),_0x1433d7,_0xd5f3('0xd'),JSON[_0xd5f3('0x10')](_0x1d8bd5));if(_0x1d8bd5[_0xd5f3('0x11')]){if(_0x1d8bd5[_0xd5f3('0x11')][_0xd5f3('0x12')]===0x1f4){logger[_0xd5f3('0x11')](_0xd5f3('0xc'),_0x1433d7,_0x1d8bd5['error'][_0xd5f3('0x13')]);return _0xbaad77(_0x1d8bd5[_0xd5f3('0x11')][_0xd5f3('0x13')]);}logger[_0xd5f3('0x11')]('License,\x20%s,\x20%s',_0x1433d7,_0x1d8bd5[_0xd5f3('0x11')][_0xd5f3('0x13')]);return _0x116df1(_0x1d8bd5[_0xd5f3('0x11')][_0xd5f3('0x13')]);}else{logger['info'](_0xd5f3('0xc'),_0x1433d7,'request\x20sent');_0x116df1(_0x1d8bd5[_0xd5f3('0x14')][_0xd5f3('0x13')]);}})[_0xd5f3('0x15')](function(_0x4f17d1){logger[_0xd5f3('0x11')](_0xd5f3('0xc'),_0x1433d7,_0x4f17d1);_0xbaad77(_0x4f17d1);});});} \ No newline at end of file +var _0x79b4=['error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','License,\x20%s,\x20%s','request\x20sent','License,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x13edfb,_0x22fa09){var _0x41a87e=function(_0x1e0c56){while(--_0x1e0c56){_0x13edfb['push'](_0x13edfb['shift']());}};_0x41a87e(++_0x22fa09);}(_0x79b4,0x118));var _0x479b=function(_0x3e96d1,_0x4f711b){_0x3e96d1=_0x3e96d1-0x0;var _0x20edc6=_0x79b4[_0x3e96d1];return _0x20edc6;};'use strict';var _=require(_0x479b('0x0'));var util=require(_0x479b('0x1'));var moment=require(_0x479b('0x2'));var BPromise=require(_0x479b('0x3'));var rs=require(_0x479b('0x4'));var fs=require('fs');var Redis=require(_0x479b('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x479b('0x6'));var logger=require(_0x479b('0x7'))(_0x479b('0x8'));var config=require(_0x479b('0x9'));var jayson=require(_0x479b('0xa'));var client=jayson[_0x479b('0xb')][_0x479b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x146fae,_0x9ad074,_0xa2dc3b){return new BPromise(function(_0x54fa2f,_0x5ee992){return client[_0x479b('0xd')](_0x146fae,_0xa2dc3b)[_0x479b('0xe')](function(_0x122a33){logger[_0x479b('0xf')](_0x479b('0x10'),_0x9ad074,_0x479b('0x11'));logger['debug'](_0x479b('0x12'),_0x9ad074,_0x479b('0x11'),JSON[_0x479b('0x13')](_0x122a33));if(_0x122a33['error']){if(_0x122a33[_0x479b('0x14')][_0x479b('0x15')]===0x1f4){logger[_0x479b('0x14')]('License,\x20%s,\x20%s',_0x9ad074,_0x122a33[_0x479b('0x14')][_0x479b('0x16')]);return _0x5ee992(_0x122a33[_0x479b('0x14')][_0x479b('0x16')]);}logger[_0x479b('0x14')](_0x479b('0x10'),_0x9ad074,_0x122a33[_0x479b('0x14')][_0x479b('0x16')]);return _0x54fa2f(_0x122a33[_0x479b('0x14')][_0x479b('0x16')]);}else{logger[_0x479b('0xf')](_0x479b('0x10'),_0x9ad074,'request\x20sent');_0x54fa2f(_0x122a33[_0x479b('0x17')]['message']);}})[_0x479b('0x18')](function(_0x3f9925){logger['error']('License,\x20%s,\x20%s',_0x9ad074,_0x3f9925);_0x5ee992(_0x3f9925);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index ff9af17..f711781 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 _0x2c77=['update','removeDispositions','delete','removeAnswers','removeImap','removeSmtp','removeAgents','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','/describe','/:id','/:id/dispositions','/:id/canned_answers','/:id/in_servers','getImap','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/verify','/:id/users','getAgents','post','addAnswer','create','addImap','/:id/out_servers','addInteraction','addApplications','send','addAgents','put'];(function(_0x50e30b,_0x216368){var _0x4b7300=function(_0x8f06d7){while(--_0x8f06d7){_0x50e30b['push'](_0x50e30b['shift']());}};_0x4b7300(++_0x216368);}(_0x2c77,0x89));var _0x72c7=function(_0x39d650,_0x4240e1){_0x39d650=_0x39d650-0x0;var _0x340ab2=_0x2c77[_0x39d650];return _0x340ab2;};'use strict';var multer=require(_0x72c7('0x0'));var util=require(_0x72c7('0x1'));var path=require('path');var timeout=require(_0x72c7('0x2'));var express=require(_0x72c7('0x3'));var router=express[_0x72c7('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x72c7('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x72c7('0x6'));var controller=require('./mailAccount.controller');router[_0x72c7('0x7')]('/',auth[_0x72c7('0x8')](),controller['index']);router[_0x72c7('0x7')](_0x72c7('0x9'),auth[_0x72c7('0x8')](),controller['describe']);router[_0x72c7('0x7')](_0x72c7('0xa'),auth[_0x72c7('0x8')](),controller['show']);router[_0x72c7('0x7')](_0x72c7('0xb'),auth[_0x72c7('0x8')](),controller['getDispositions']);router[_0x72c7('0x7')](_0x72c7('0xc'),auth[_0x72c7('0x8')](),controller['getAnswers']);router['get'](_0x72c7('0xd'),auth[_0x72c7('0x8')](),controller[_0x72c7('0xe')]);router[_0x72c7('0x7')]('/:id/out_servers',auth[_0x72c7('0x8')](),controller[_0x72c7('0xf')]);router[_0x72c7('0x7')](_0x72c7('0x10'),auth[_0x72c7('0x8')](),controller[_0x72c7('0x11')]);router[_0x72c7('0x7')](_0x72c7('0x12'),auth['isAuthenticated'](),controller[_0x72c7('0x13')]);router[_0x72c7('0x7')](_0x72c7('0x14'),auth[_0x72c7('0x8')](),controller[_0x72c7('0x15')]);router[_0x72c7('0x7')](_0x72c7('0x16'),auth[_0x72c7('0x8')](),controller['verifySmtp']);router[_0x72c7('0x7')](_0x72c7('0x17'),auth[_0x72c7('0x8')](),controller[_0x72c7('0x18')]);router[_0x72c7('0x19')](_0x72c7('0xb'),auth[_0x72c7('0x8')](),controller['addDisposition']);router[_0x72c7('0x19')](_0x72c7('0xc'),auth[_0x72c7('0x8')](),controller[_0x72c7('0x1a')]);router['post']('/',auth[_0x72c7('0x8')](),controller[_0x72c7('0x1b')]);router['post']('/:id/in_servers',auth['isAuthenticated'](),controller[_0x72c7('0x1c')]);router[_0x72c7('0x19')](_0x72c7('0x1d'),auth[_0x72c7('0x8')](),controller['addSmtp']);router[_0x72c7('0x19')](_0x72c7('0x10'),auth[_0x72c7('0x8')](),controller[_0x72c7('0x1e')]);router[_0x72c7('0x19')](_0x72c7('0x12'),auth[_0x72c7('0x8')](),controller[_0x72c7('0x1f')]);router[_0x72c7('0x19')]('/:id/send',auth[_0x72c7('0x8')](),controller[_0x72c7('0x20')]);router[_0x72c7('0x19')](_0x72c7('0x17'),auth['isAuthenticated'](),controller[_0x72c7('0x21')]);router[_0x72c7('0x22')](_0x72c7('0xa'),auth['isAuthenticated'](),controller[_0x72c7('0x23')]);router['delete']('/:id/dispositions',auth[_0x72c7('0x8')](),controller[_0x72c7('0x24')]);router[_0x72c7('0x25')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x72c7('0x26')]);router[_0x72c7('0x25')]('/:id/in_servers',auth[_0x72c7('0x8')](),controller[_0x72c7('0x27')]);router[_0x72c7('0x25')](_0x72c7('0x1d'),auth[_0x72c7('0x8')](),controller[_0x72c7('0x28')]);router[_0x72c7('0x25')](_0x72c7('0xa'),auth[_0x72c7('0x8')](),controller['destroy']);router[_0x72c7('0x25')](_0x72c7('0x17'),auth['isAuthenticated'](),controller[_0x72c7('0x29')]);module[_0x72c7('0x2a')]=router; \ No newline at end of file +var _0x4f24=['/:id/interactions','getMessages','/:id/verify','verifySmtp','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','create','addImap','addSmtp','/:id/applications','addApplications','/:id/send','send','addAgents','put','update','removeDispositions','delete','removeImap','destroy','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./mailAccount.controller','get','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','getAnswers','/:id/in_servers','/:id/out_servers','getSmtp'];(function(_0x18bbd5,_0x519b33){var _0xb895bb=function(_0x1117f8){while(--_0x1117f8){_0x18bbd5['push'](_0x18bbd5['shift']());}};_0xb895bb(++_0x519b33);}(_0x4f24,0x105));var _0x44f2=function(_0xc77819,_0x139fdc){_0xc77819=_0xc77819-0x0;var _0x1c9434=_0x4f24[_0xc77819];return _0x1c9434;};'use strict';var multer=require(_0x44f2('0x0'));var util=require(_0x44f2('0x1'));var path=require(_0x44f2('0x2'));var timeout=require(_0x44f2('0x3'));var express=require(_0x44f2('0x4'));var router=express[_0x44f2('0x5')]();var fs_extra=require(_0x44f2('0x6'));var auth=require(_0x44f2('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x44f2('0x8'));var controller=require(_0x44f2('0x9'));router[_0x44f2('0xa')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x44f2('0xb'),auth[_0x44f2('0xc')](),controller[_0x44f2('0xd')]);router[_0x44f2('0xa')](_0x44f2('0xe'),auth[_0x44f2('0xc')](),controller[_0x44f2('0xf')]);router['get'](_0x44f2('0x10'),auth[_0x44f2('0xc')](),controller['getDispositions']);router[_0x44f2('0xa')]('/:id/canned_answers',auth[_0x44f2('0xc')](),controller[_0x44f2('0x11')]);router[_0x44f2('0xa')](_0x44f2('0x12'),auth[_0x44f2('0xc')](),controller['getImap']);router[_0x44f2('0xa')](_0x44f2('0x13'),auth[_0x44f2('0xc')](),controller[_0x44f2('0x14')]);router[_0x44f2('0xa')](_0x44f2('0x15'),auth[_0x44f2('0xc')](),controller['getInteractions']);router['get']('/:id/applications',auth['isAuthenticated'](),controller['getApplications']);router[_0x44f2('0xa')]('/:id/messages',auth[_0x44f2('0xc')](),controller[_0x44f2('0x16')]);router[_0x44f2('0xa')](_0x44f2('0x17'),auth[_0x44f2('0xc')](),controller[_0x44f2('0x18')]);router[_0x44f2('0xa')](_0x44f2('0x19'),auth['isAuthenticated'](),controller[_0x44f2('0x1a')]);router[_0x44f2('0x1b')](_0x44f2('0x10'),auth['isAuthenticated'](),controller[_0x44f2('0x1c')]);router[_0x44f2('0x1b')](_0x44f2('0x1d'),auth['isAuthenticated'](),controller[_0x44f2('0x1e')]);router[_0x44f2('0x1b')]('/',auth[_0x44f2('0xc')](),controller[_0x44f2('0x1f')]);router[_0x44f2('0x1b')](_0x44f2('0x12'),auth[_0x44f2('0xc')](),controller[_0x44f2('0x20')]);router['post']('/:id/out_servers',auth[_0x44f2('0xc')](),controller[_0x44f2('0x21')]);router['post'](_0x44f2('0x15'),auth[_0x44f2('0xc')](),controller['addInteraction']);router[_0x44f2('0x1b')](_0x44f2('0x22'),auth[_0x44f2('0xc')](),controller[_0x44f2('0x23')]);router[_0x44f2('0x1b')](_0x44f2('0x24'),auth['isAuthenticated'](),controller[_0x44f2('0x25')]);router[_0x44f2('0x1b')]('/:id/users',auth[_0x44f2('0xc')](),controller[_0x44f2('0x26')]);router[_0x44f2('0x27')](_0x44f2('0xe'),auth['isAuthenticated'](),controller[_0x44f2('0x28')]);router['delete'](_0x44f2('0x10'),auth[_0x44f2('0xc')](),controller[_0x44f2('0x29')]);router[_0x44f2('0x2a')](_0x44f2('0x1d'),auth[_0x44f2('0xc')](),controller['removeAnswers']);router[_0x44f2('0x2a')](_0x44f2('0x12'),auth[_0x44f2('0xc')](),controller[_0x44f2('0x2b')]);router[_0x44f2('0x2a')](_0x44f2('0x13'),auth[_0x44f2('0xc')](),controller['removeSmtp']);router['delete'](_0x44f2('0xe'),auth[_0x44f2('0xc')](),controller[_0x44f2('0x2c')]);router[_0x44f2('0x2a')]('/:id/users',auth[_0x44f2('0xc')](),controller[_0x44f2('0x2d')]);module[_0x44f2('0x2e')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 653c415..5d53a4a 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 _0xa646=['STRING','BOOLEAN','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','TEXT','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','ENUM','gmail','hotmail','yahoo','outlook365','getDataValue','provider','custom','sequelize','exports'];(function(_0x59a602,_0x4ceae3){var _0x4db22f=function(_0x39476b){while(--_0x39476b){_0x59a602['push'](_0x59a602['shift']());}};_0x4db22f(++_0x4ceae3);}(_0xa646,0x132));var _0x6a64=function(_0x2430a8,_0x1c08e6){_0x2430a8=_0x2430a8-0x0;var _0x20b275=_0xa646[_0x2430a8];return _0x20b275;};'use strict';var Sequelize=require(_0x6a64('0x0'));module[_0x6a64('0x1')]={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x6a64('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0x6a64('0x3')],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize['TEXT']},'markAsUnread':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fontFamily':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x6a64('0x4')},'fontSize':{'type':Sequelize[_0x6a64('0x5')](0x2)[_0x6a64('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x6a64('0x7')],'defaultValue':function(){return _0x6a64('0x8');}},'notificationSound':{'type':Sequelize[_0x6a64('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x6a64('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x6a64('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x6a64('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x6a64('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x6a64('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x6a64('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x6a64('0x5')],'allowNull':!![],'defaultValue':null,'comment':_0x6a64('0x9')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x6a64('0xa'),'set':function(_0x4b3256){if(!_0x4b3256)this[_0x6a64('0xb')](_0x6a64('0xc'),null);this[_0x6a64('0xb')](_0x6a64('0xd'),_0x4b3256);}},'provider':{'type':Sequelize[_0x6a64('0xe')](_0x6a64('0xf'),_0x6a64('0x10'),_0x6a64('0x11'),_0x6a64('0x12')),'defaultValue':null,'get':function(){var _0x25a5b2=this[_0x6a64('0x13')](_0x6a64('0x14'));return _0x25a5b2||'custom';},'set':function(_0x2926d7){if(_0x2926d7===_0x6a64('0x15')){_0x2926d7=null;}return this[_0x6a64('0xb')](_0x6a64('0x14'),_0x2926d7);}}}; \ No newline at end of file +var _0xfb4e=['setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','gmail','yahoo','outlook365','getDataValue','provider','custom','sequelize','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0xfb4e,0x185));var _0xefb4=function(_0x39bcb5,_0x149d76){_0x39bcb5=_0x39bcb5-0x0;var _0x18a7b4=_0xfb4e[_0x39bcb5];return _0x18a7b4;};'use strict';var Sequelize=require(_0xefb4('0x0'));module['exports']={'description':{'type':Sequelize[_0xefb4('0x1')]},'name':{'type':Sequelize[_0xefb4('0x1')],'allowNull':![]},'service':{'type':Sequelize[_0xefb4('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0xefb4('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xefb4('0x2')],'defaultValue':!![]},'key':{'type':Sequelize[_0xefb4('0x1')],'allowNull':![]},'template':{'type':Sequelize[_0xefb4('0x3')]},'markAsUnread':{'type':Sequelize[_0xefb4('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0xefb4('0x1')],'allowNull':![],'defaultValue':_0xefb4('0x4')},'fontSize':{'type':Sequelize['INTEGER'](0x2)[_0xefb4('0x5')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0xefb4('0x3')],'defaultValue':function(){return _0xefb4('0x6');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xefb4('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xefb4('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xefb4('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xefb4('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xefb4('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xefb4('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xefb4('0x7')],'allowNull':!![],'defaultValue':null,'comment':_0xefb4('0x8')},'mandatoryDisposition':{'type':Sequelize[_0xefb4('0x2')],'defaultValue':![],'comment':_0xefb4('0x9'),'set':function(_0x5d2731){if(!_0x5d2731)this[_0xefb4('0xa')](_0xefb4('0xb'),null);this[_0xefb4('0xa')](_0xefb4('0xc'),_0x5d2731);}},'provider':{'type':Sequelize['ENUM'](_0xefb4('0xd'),'hotmail',_0xefb4('0xe'),_0xefb4('0xf')),'defaultValue':null,'get':function(){var _0x32b31b=this[_0xefb4('0x10')](_0xefb4('0x11'));return _0x32b31b||_0xefb4('0x12');},'set':function(_0x5417f3){if(_0x5417f3==='custom'){_0x5417f3=null;}return this[_0xefb4('0xa')](_0xefb4('0x11'),_0x5417f3);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 515ba06..e3dc76f 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 _0x582c=['MailInteraction','CmContact','User','internal','Tag','color','addApplications','sequelize','Transaction','ISOLATION_LEVELS','MailApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','$gte','split','format','MailMessage','Contacts','updatedAt','DESC','CloudProvider','isNil','from','%s\x20<%s>','attachments','join','root','server/files/attachments','basename','sendMail','List','attach','out','messageId','YYYY-MM-DD\x20HH:mm:ss','Interaction','Messages','verifySmtp','getSmtpOptions','VerifySmtp','ValidationError','addAgents','spread','emit','removeAgents','isArray','userMailAccount:remove','getAgents','moment','util','path','lodash','juice','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','localhost','./mailAccount.socket','register','client','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','sendStatus','status','end','undefined','limit','count','offset','set','json','update','destroy','get','MailAccounts','UserProfileResource','stack','name','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','outlook365','outlook.office365.com','Unknown\x20email\x20service\x20provider','smtp.gmail.com','smtp.mail.yahoo.com','smtp-mail.outlook.com','user','username','password','pass','modernAuthentication','CloudProviderId','host','port','secure','service','authentication','Imap','Smtp','MailServerOut','map','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','MailAccount','includeAll','include','findAll','rows','show','params','Pause','mandatoryDispositionPause','find','body','provider','MailServerIn','Mail\x20Account\x20not\x20found','describe','MailAccountId','create','getDispositions','Disposition','nolimit','removeDispositions','ids','CannedAnswer','removeAnswers','custom','email','ListId','active','description','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','findOne','addImap','removeImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','omit','getInteractions'];(function(_0x220afa,_0xf5f6cc){var _0x1b79d1=function(_0x178a39){while(--_0x178a39){_0x220afa['push'](_0x220afa['shift']());}};_0x1b79d1(++_0xf5f6cc);}(_0x582c,0x1a3));var _0xc582=function(_0x133e8d,_0x4648f1){_0x133e8d=_0x133e8d-0x0;var _0x10ce55=_0x582c[_0x133e8d];return _0x10ce55;};'use strict';var moment=require(_0xc582('0x0'));var BPromise=require('bluebird');var util=require(_0xc582('0x1'));var path=require(_0xc582('0x2'));var _=require(_0xc582('0x3'));var juice=require(_0xc582('0x4'));var Redis=require('ioredis');var qs=require(_0xc582('0x5'));var logger=require(_0xc582('0x6'))(_0xc582('0x7'));var config=require('../../config/environment');var db=require(_0xc582('0x8'))['db'];config[_0xc582('0x9')]=_[_0xc582('0xa')](config[_0xc582('0x9')],{'host':_0xc582('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xc582('0xc'))[_0xc582('0xd')](socket);var jayson=require('jayson/promise');var client=jayson[_0xc582('0xe')]['http']({'port':0x232b});function respondWithRpcPromise(_0x4667c1,_0x16f476,_0x2a72cf,_0x3b1685){return new BPromise(function(_0x2473d6,_0x3ddd62){var _0x35ecd2=_0x3b1685||client;return _0x35ecd2[_0xc582('0xf')](_0x4667c1,_0x2a72cf)[_0xc582('0x10')](function(_0x3a9a0e){logger[_0xc582('0x11')](_0xc582('0x12'),_0x16f476,_0xc582('0x13'));logger[_0xc582('0x14')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x16f476,_0xc582('0x13'),JSON[_0xc582('0x15')](_0x3a9a0e));if(_0x3a9a0e['error']){if(_0x3a9a0e[_0xc582('0x16')][_0xc582('0x17')]===0x1f4){logger[_0xc582('0x16')]('MailAccount,\x20%s,\x20%s',_0x16f476,_0x3a9a0e['error'][_0xc582('0x18')]);return _0x3ddd62(_0x3a9a0e[_0xc582('0x16')][_0xc582('0x18')]);}logger[_0xc582('0x16')](_0xc582('0x12'),_0x16f476,_0x3a9a0e[_0xc582('0x16')][_0xc582('0x18')]);return _0x2473d6(_0x3a9a0e[_0xc582('0x16')][_0xc582('0x18')]);}else{logger[_0xc582('0x11')](_0xc582('0x12'),_0x16f476,_0xc582('0x13'));_0x2473d6(_0x3a9a0e['result'][_0xc582('0x18')]);}})[_0xc582('0x19')](function(_0x14e5bc){logger[_0xc582('0x16')](_0xc582('0x12'),_0x16f476,_0x14e5bc);_0x3ddd62(_0x14e5bc);});});}function respondWithStatusCode(_0x337bba,_0x4a569d){_0x4a569d=_0x4a569d||0xcc;return function(_0x4d01a3){if(_0x4d01a3){return _0x337bba[_0xc582('0x1a')](_0x4a569d);}return _0x337bba[_0xc582('0x1b')](_0x4a569d)[_0xc582('0x1c')]();};}function respondWithResult(_0x1cd3e1,_0x3bbeed){_0x3bbeed=_0x3bbeed||0xc8;return function(_0x265d0d){if(_0x265d0d){return _0x1cd3e1[_0xc582('0x1b')](_0x3bbeed)['json'](_0x265d0d);}};}function respondWithFilteredResult(_0xd2ff5e,_0x49a8f0){return function(_0x53b01a){if(_0x53b01a){var _0x396fec=typeof _0x49a8f0['offset']===_0xc582('0x1d')&&typeof _0x49a8f0[_0xc582('0x1e')]===_0xc582('0x1d');var _0x5b164d=_0x53b01a[_0xc582('0x1f')];var _0x4455ec=_0x396fec?0x0:_0x49a8f0[_0xc582('0x20')];var _0x54546e=_0x396fec?_0x53b01a[_0xc582('0x1f')]:_0x49a8f0[_0xc582('0x20')]+_0x49a8f0[_0xc582('0x1e')];var _0x2c99f0;if(_0x54546e>=_0x5b164d){_0x54546e=_0x5b164d;_0x2c99f0=0xc8;}else{_0x2c99f0=0xce;}_0xd2ff5e[_0xc582('0x1b')](_0x2c99f0);return _0xd2ff5e[_0xc582('0x21')]('Content-Range',_0x4455ec+'-'+_0x54546e+'/'+_0x5b164d)[_0xc582('0x22')](_0x53b01a);}return null;};}function saveUpdates(_0x1d0db3){return function(_0x1d8a25){if(_0x1d8a25){return _0x1d8a25[_0xc582('0x23')](_0x1d0db3)[_0xc582('0x10')](function(_0x2a6689){return _0x2a6689;});}return null;};}function removeEntity(_0x47979c){return function(_0x50646c){if(_0x50646c){return _0x50646c[_0xc582('0x24')]()['then'](function(){var _0x2ef0d8=_0x50646c[_0xc582('0x25')]({'plain':!![]});var _0x18db45=_0xc582('0x26');return db[_0xc582('0x27')]['destroy']({'where':{'type':_0x18db45,'resourceId':_0x2ef0d8['id']}})['then'](function(){return _0x50646c;});})['then'](function(){_0x47979c[_0xc582('0x1b')](0xcc)[_0xc582('0x1c')]();});}};}function handleEntityNotFound(_0x480cea){return function(_0x54b985){if(!_0x54b985){_0x480cea[_0xc582('0x1a')](0x194);}return _0x54b985;};}function handleError(_0xf6fdea,_0x3edcfd){_0x3edcfd=_0x3edcfd||0x1f4;return function(_0x2c9bb3){logger[_0xc582('0x16')](_0x2c9bb3[_0xc582('0x28')]);if(_0x2c9bb3[_0xc582('0x29')]){delete _0x2c9bb3[_0xc582('0x29')];}_0xf6fdea[_0xc582('0x1b')](_0x3edcfd)['send'](_0x2c9bb3);};}function getImapHost(_0x7b73a0){switch(_0x7b73a0){case _0xc582('0x2a'):return _0xc582('0x2b');case _0xc582('0x2c'):return _0xc582('0x2d');case _0xc582('0x2e'):return'imap-mail.outlook.com';case _0xc582('0x2f'):return _0xc582('0x30');}throw new Error(_0xc582('0x31'),_0x7b73a0);}function getSmtpHost(_0x258625){switch(_0x258625){case _0xc582('0x2a'):return _0xc582('0x32');case _0xc582('0x2c'):return _0xc582('0x33');case _0xc582('0x2e'):return _0xc582('0x34');case _0xc582('0x2f'):return'smtp.office365.com';}throw new Error(_0xc582('0x31'),_0x258625);}function getAuthenticationOptions(_0x3abbae,_0x4b6efe){var _0x4aaa43={};var _0x35dbd6={};if(_0x3abbae){_0x4aaa43[_0xc582('0x35')]=_0x35dbd6[_0xc582('0x35')]=_0x4b6efe[_0xc582('0x36')];_0x4aaa43[_0xc582('0x37')]=_0x35dbd6[_0xc582('0x38')]=_0x4b6efe['password'];if(_0x4b6efe[_0xc582('0x39')]){_0x4aaa43[_0xc582('0x39')]=_0x35dbd6[_0xc582('0x39')]=!![];_0x4aaa43[_0xc582('0x3a')]=_0x35dbd6[_0xc582('0x3a')]=_0x4b6efe[_0xc582('0x3a')];_0x4aaa43[_0xc582('0x37')]=_0x35dbd6['pass']=null;}else{_0x4aaa43[_0xc582('0x3a')]=_0x35dbd6[_0xc582('0x3a')]=null;}_0x4aaa43[_0xc582('0x3b')]=getImapHost(_0x3abbae);_0x4aaa43[_0xc582('0x3c')]=0x3e1;_0x35dbd6[_0xc582('0x3b')]=getSmtpHost(_0x3abbae);_0x35dbd6[_0xc582('0x3c')]=0x24b;_0x35dbd6[_0xc582('0x3d')]=![];_0x4aaa43[_0xc582('0x3e')]=_0x35dbd6[_0xc582('0x3e')]=null;}else{if(_0x4b6efe[_0xc582('0x3f')]){_0x4aaa43['user']=_0x35dbd6[_0xc582('0x35')]=_0x4b6efe[_0xc582('0x36')];_0x4aaa43['password']=_0x35dbd6[_0xc582('0x38')]=_0x4b6efe[_0xc582('0x37')];}else{_0x4aaa43[_0xc582('0x3f')]=_0x35dbd6[_0xc582('0x3f')]=![];_0x4aaa43[_0xc582('0x35')]=_0x35dbd6[_0xc582('0x35')]=null;_0x4aaa43[_0xc582('0x37')]=_0x35dbd6['pass']=null;}_0x4aaa43[_0xc582('0x3b')]=_0x4b6efe[_0xc582('0x40')][_0xc582('0x3b')];_0x4aaa43[_0xc582('0x3c')]=_0x4b6efe[_0xc582('0x40')]['port'];_0x35dbd6[_0xc582('0x3b')]=_0x4b6efe[_0xc582('0x41')][_0xc582('0x3b')];_0x35dbd6[_0xc582('0x3c')]=_0x4b6efe[_0xc582('0x41')][_0xc582('0x3c')];}return{'Imap':_0x4aaa43,'Smtp':_0x35dbd6};}exports['index']=function(_0x1c6490,_0x290570){var _0x2eaf50={'include':[{'model':db['MailServerIn'],'as':_0xc582('0x40')},{'model':db[_0xc582('0x42')],'as':_0xc582('0x41')},{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x53bc57={},_0x3d9a86={'count':0x0,'rows':[]};var _0x2efc78=_[_0xc582('0x43')](db['MailAccount'][_0xc582('0x44')],function(_0x4c9919){return{'name':_0x4c9919[_0xc582('0x45')],'type':_0x4c9919['type'][_0xc582('0x46')]};});_0x53bc57[_0xc582('0x47')]=_[_0xc582('0x43')](_0x2efc78,_0xc582('0x29'));_0x53bc57[_0xc582('0x48')]=_[_0xc582('0x49')](_0x1c6490['query']);_0x53bc57[_0xc582('0x4a')]=_['intersection'](_0x53bc57['model'],_0x53bc57[_0xc582('0x48')]);_0x2eaf50[_0xc582('0x4b')]=_[_0xc582('0x4c')](_0x53bc57[_0xc582('0x47')],qs[_0xc582('0x4d')](_0x1c6490[_0xc582('0x48')][_0xc582('0x4d')]));_0x2eaf50[_0xc582('0x4b')]=_0x2eaf50[_0xc582('0x4b')][_0xc582('0x4e')]?_0x2eaf50['attributes']:_0x53bc57['model'];if(!_0x1c6490[_0xc582('0x48')][_0xc582('0x4f')]('nolimit')){_0x2eaf50[_0xc582('0x1e')]=qs['limit'](_0x1c6490['query'][_0xc582('0x1e')]);_0x2eaf50[_0xc582('0x20')]=qs[_0xc582('0x20')](_0x1c6490['query'][_0xc582('0x20')]);}_0x2eaf50[_0xc582('0x50')]=qs[_0xc582('0x51')](_0x1c6490['query'][_0xc582('0x51')]);_0x2eaf50[_0xc582('0x52')]=qs[_0xc582('0x4a')](_[_0xc582('0x53')](_0x1c6490[_0xc582('0x48')],_0x53bc57[_0xc582('0x4a')]),_0x2efc78);if(_0x1c6490[_0xc582('0x48')][_0xc582('0x54')]){_0x2eaf50['where']=_[_0xc582('0x55')](_0x2eaf50['where'],{'$or':_[_0xc582('0x43')](_0x2efc78,function(_0x3f5cb0){if(_0x3f5cb0['type']!==_0xc582('0x56')){var _0x3b3922={};_0x3b3922[_0x3f5cb0['name']]={'$like':'%'+_0x1c6490['query'][_0xc582('0x54')]+'%'};return _0x3b3922;}})});}_0x2eaf50=_[_0xc582('0x55')]({},_0x2eaf50,_0x1c6490[_0xc582('0x57')]);var _0x5c43d8={'where':_0x2eaf50['where']};return db[_0xc582('0x58')]['count'](_0x5c43d8)[_0xc582('0x10')](function(_0x2f3056){_0x3d9a86[_0xc582('0x1f')]=_0x2f3056;if(_0x1c6490['query'][_0xc582('0x59')]){_0x2eaf50[_0xc582('0x5a')]=[{'all':!![]}];}return db[_0xc582('0x58')][_0xc582('0x5b')](_0x2eaf50);})[_0xc582('0x10')](function(_0x2af4a9){_0x3d9a86[_0xc582('0x5c')]=_0x2af4a9;return _0x3d9a86;})['then'](respondWithFilteredResult(_0x290570,_0x2eaf50))[_0xc582('0x19')](handleError(_0x290570,null));};exports[_0xc582('0x5d')]=function(_0x103c05,_0x21cc3c){var _0xa87083={'raw':![],'where':{'id':_0x103c05[_0xc582('0x5e')]['id']},'include':[{'model':db['MailServerIn'],'as':_0xc582('0x40')},{'model':db[_0xc582('0x42')],'as':_0xc582('0x41')},{'model':db[_0xc582('0x5f')],'as':_0xc582('0x60')}]},_0x112789={};_0x112789[_0xc582('0x47')]=_[_0xc582('0x49')](db[_0xc582('0x58')][_0xc582('0x44')]);_0x112789['query']=_[_0xc582('0x49')](_0x103c05[_0xc582('0x48')]);_0x112789[_0xc582('0x4a')]=_[_0xc582('0x4c')](_0x112789[_0xc582('0x47')],_0x112789[_0xc582('0x48')]);_0xa87083[_0xc582('0x4b')]=_[_0xc582('0x4c')](_0x112789['model'],qs[_0xc582('0x4d')](_0x103c05[_0xc582('0x48')][_0xc582('0x4d')]));_0xa87083['attributes']=_0xa87083[_0xc582('0x4b')][_0xc582('0x4e')]?_0xa87083[_0xc582('0x4b')]:_0x112789[_0xc582('0x47')];if(_0x103c05['query'][_0xc582('0x59')]){_0xa87083[_0xc582('0x5a')]=[{'all':!![]}];}_0xa87083=_[_0xc582('0x55')]({},_0xa87083,_0x103c05[_0xc582('0x57')]);return db[_0xc582('0x58')][_0xc582('0x61')](_0xa87083)[_0xc582('0x10')](handleEntityNotFound(_0x21cc3c,null))[_0xc582('0x10')](respondWithResult(_0x21cc3c,null))[_0xc582('0x19')](handleError(_0x21cc3c,null));};exports[_0xc582('0x23')]=function(_0x2afc62,_0x4b5f18){if(_0x2afc62[_0xc582('0x62')]['id']){delete _0x2afc62['body']['id'];}var _0x12f25b=_0x2afc62[_0xc582('0x62')][_0xc582('0x63')]==='custom'?null:_0x2afc62[_0xc582('0x62')][_0xc582('0x63')];var _0x715729=_0x2afc62[_0xc582('0x62')][_0xc582('0x40')]||{};var _0x5d6710=_0x2afc62[_0xc582('0x62')][_0xc582('0x41')]||{};if(_0x12f25b){_0x715729['host']=getImapHost(_0x12f25b);_0x715729[_0xc582('0x3c')]=0x3e1;_0x5d6710[_0xc582('0x3b')]=getSmtpHost(_0x12f25b);_0x5d6710[_0xc582('0x3c')]=0x24b;_0x5d6710[_0xc582('0x3d')]=![];}if(_0x5d6710[_0xc582('0x39')]){_0x5d6710[_0xc582('0x3d')]=![];}else{_0x5d6710[_0xc582('0x3a')]=null;}if(!_0x715729[_0xc582('0x39')])_0x715729['CloudProviderId']=null;_0x2afc62[_0xc582('0x62')][_0xc582('0x40')]=_0x715729;_0x2afc62['body']['Smtp']=_0x5d6710;return db['MailAccount'][_0xc582('0x61')]({'where':{'id':_0x2afc62[_0xc582('0x5e')]['id']},'include':[{'model':db[_0xc582('0x64')],'as':'Imap'},{'model':db[_0xc582('0x42')],'as':_0xc582('0x41')},{'model':db[_0xc582('0x5f')],'as':_0xc582('0x60')}]})[_0xc582('0x10')](handleEntityNotFound(_0x4b5f18,null))[_0xc582('0x10')](function(_0x5f4877){if(!_0x5f4877)throw new Error(_0xc582('0x65'));if(_0x5f4877[_0xc582('0x3e')])delete _0x2afc62['body']['Imap'];return _0x5f4877;})[_0xc582('0x10')](saveUpdates(_0x2afc62[_0xc582('0x62')],null))[_0xc582('0x10')](function(_0x3d0677){if(!_0x2afc62[_0xc582('0x62')][_0xc582('0x40')])return _0x3d0677;return db[_0xc582('0x64')][_0xc582('0x23')](_0x2afc62[_0xc582('0x62')]['Imap'],{'where':{'MailAccountId':_0x3d0677['id']}})['then'](function(){return _0x3d0677;});})[_0xc582('0x10')](function(_0x55097c){if(!_0x2afc62[_0xc582('0x62')][_0xc582('0x41')])return _0x55097c;return db[_0xc582('0x42')][_0xc582('0x23')](_0x2afc62[_0xc582('0x62')]['Smtp'],{'where':{'MailAccountId':_0x55097c['id']}})[_0xc582('0x10')](function(){return _0x55097c;});})[_0xc582('0x10')](respondWithResult(_0x4b5f18,null))[_0xc582('0x19')](handleError(_0x4b5f18,null));};exports[_0xc582('0x66')]=function(_0x389a6f,_0x3f0fa9){return db[_0xc582('0x58')][_0xc582('0x66')]()[_0xc582('0x10')](respondWithResult(_0x3f0fa9,null))[_0xc582('0x19')](handleError(_0x3f0fa9,null));};exports['addDisposition']=function(_0x5614b3,_0x3d5cf4){if(_0x5614b3[_0xc582('0x62')]['id']){delete _0x5614b3[_0xc582('0x62')]['id'];}return db[_0xc582('0x58')][_0xc582('0x61')]({'where':{'id':_0x5614b3[_0xc582('0x5e')]['id']}})[_0xc582('0x10')](handleEntityNotFound(_0x3d5cf4,null))[_0xc582('0x10')](function(_0xb3cb16){if(_0xb3cb16){_0x5614b3[_0xc582('0x62')][_0xc582('0x67')]=_0xb3cb16['id'];return db['Disposition'][_0xc582('0x68')](_0x5614b3['body']);}})[_0xc582('0x10')](respondWithResult(_0x3d5cf4,null))['catch'](handleError(_0x3d5cf4,null));};exports[_0xc582('0x69')]=function(_0x16693e,_0x272d7f){var _0x47fa20={'raw':![],'where':{}};var _0x2c0e3d={};var _0x5a0ada={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0x16693e[_0xc582('0x5e')]['id']}})['then'](handleEntityNotFound(_0x272d7f,null))[_0xc582('0x10')](function(_0x36aaa9){if(_0x36aaa9){_0x2c0e3d['model']=_[_0xc582('0x49')](db[_0xc582('0x6a')][_0xc582('0x44')]);_0x2c0e3d[_0xc582('0x48')]=_['keys'](_0x16693e['query']);_0x2c0e3d[_0xc582('0x4a')]=_[_0xc582('0x4c')](_0x2c0e3d[_0xc582('0x47')],_0x2c0e3d[_0xc582('0x48')]);_0x47fa20[_0xc582('0x4b')]=_['intersection'](_0x2c0e3d[_0xc582('0x47')],qs['fields'](_0x16693e[_0xc582('0x48')][_0xc582('0x4d')]));_0x47fa20[_0xc582('0x4b')]=_0x47fa20['attributes'][_0xc582('0x4e')]?_0x47fa20[_0xc582('0x4b')]:_0x2c0e3d[_0xc582('0x47')];if(!_0x16693e['query'][_0xc582('0x4f')](_0xc582('0x6b'))){_0x47fa20[_0xc582('0x1e')]=qs['limit'](_0x16693e['query'][_0xc582('0x1e')]);_0x47fa20[_0xc582('0x20')]=qs[_0xc582('0x20')](_0x16693e[_0xc582('0x48')][_0xc582('0x20')]);}_0x47fa20[_0xc582('0x50')]=qs['sort'](_0x16693e['query'][_0xc582('0x51')]);_0x47fa20[_0xc582('0x52')]=qs[_0xc582('0x4a')](_[_0xc582('0x53')](_0x16693e[_0xc582('0x48')],_0x2c0e3d[_0xc582('0x4a')]));_0x47fa20[_0xc582('0x52')][_0xc582('0x67')]=_0x36aaa9['id'];if(_0x16693e['query']['filter']){_0x47fa20[_0xc582('0x52')]=_[_0xc582('0x55')](_0x47fa20[_0xc582('0x52')],{'$or':_[_0xc582('0x43')](_0x47fa20[_0xc582('0x4b')],function(_0x553f6a){var _0x1670b6={};_0x1670b6[_0x553f6a]={'$like':'%'+_0x16693e[_0xc582('0x48')][_0xc582('0x54')]+'%'};return _0x1670b6;})});}_0x47fa20=_[_0xc582('0x55')]({},_0x47fa20,_0x16693e[_0xc582('0x57')]);return db[_0xc582('0x6a')][_0xc582('0x1f')]({'where':_0x47fa20[_0xc582('0x52')]})[_0xc582('0x10')](function(_0x35ea01){_0x5a0ada[_0xc582('0x1f')]=_0x35ea01;if(_0x16693e[_0xc582('0x48')]['includeAll']){_0x47fa20[_0xc582('0x5a')]=[{'all':!![]}];}return db[_0xc582('0x6a')][_0xc582('0x5b')](_0x47fa20);})[_0xc582('0x10')](function(_0x100f1d){_0x5a0ada['rows']=_0x100f1d;return _0x5a0ada;});}})['then'](respondWithFilteredResult(_0x272d7f,_0x47fa20))[_0xc582('0x19')](handleError(_0x272d7f,null));};exports[_0xc582('0x6c')]=function(_0x52ab07,_0x6bf98f){return db['MailAccount'][_0xc582('0x61')]({'where':{'id':_0x52ab07[_0xc582('0x5e')]['id']}})[_0xc582('0x10')](handleEntityNotFound(_0x6bf98f,null))['then'](function(_0x255390){if(_0x255390){return _0x255390[_0xc582('0x6c')](_0x52ab07[_0xc582('0x48')][_0xc582('0x6d')]);}})[_0xc582('0x10')](respondWithStatusCode(_0x6bf98f,null))[_0xc582('0x19')](handleError(_0x6bf98f,null));};exports['addAnswer']=function(_0x17390b,_0x4eaab7){if(_0x17390b['body']['id']){delete _0x17390b['body']['id'];}return db[_0xc582('0x58')][_0xc582('0x61')]({'where':{'id':_0x17390b[_0xc582('0x5e')]['id']}})['then'](handleEntityNotFound(_0x4eaab7,null))[_0xc582('0x10')](function(_0x51a373){if(_0x51a373){_0x17390b['body'][_0xc582('0x67')]=_0x51a373['id'];return db['CannedAnswer']['create'](_0x17390b[_0xc582('0x62')]);}})[_0xc582('0x10')](respondWithResult(_0x4eaab7,null))['catch'](handleError(_0x4eaab7,null));};exports['getAnswers']=function(_0x32a295,_0x5908ed){var _0x524a89={'raw':![],'where':{}};var _0x3c774b={};var _0x3ee9de={'count':0x0,'rows':[]};return db[_0xc582('0x58')]['findOne']({'where':{'id':_0x32a295['params']['id']}})[_0xc582('0x10')](handleEntityNotFound(_0x5908ed,null))[_0xc582('0x10')](function(_0x2c563c){if(_0x2c563c){_0x3c774b[_0xc582('0x47')]=_[_0xc582('0x49')](db[_0xc582('0x6e')][_0xc582('0x44')]);_0x3c774b['query']=_[_0xc582('0x49')](_0x32a295['query']);_0x3c774b['filters']=_[_0xc582('0x4c')](_0x3c774b[_0xc582('0x47')],_0x3c774b[_0xc582('0x48')]);_0x524a89['attributes']=_[_0xc582('0x4c')](_0x3c774b[_0xc582('0x47')],qs[_0xc582('0x4d')](_0x32a295[_0xc582('0x48')]['fields']));_0x524a89['attributes']=_0x524a89[_0xc582('0x4b')][_0xc582('0x4e')]?_0x524a89[_0xc582('0x4b')]:_0x3c774b[_0xc582('0x47')];if(!_0x32a295[_0xc582('0x48')]['hasOwnProperty'](_0xc582('0x6b'))){_0x524a89[_0xc582('0x1e')]=qs[_0xc582('0x1e')](_0x32a295[_0xc582('0x48')][_0xc582('0x1e')]);_0x524a89['offset']=qs[_0xc582('0x20')](_0x32a295[_0xc582('0x48')][_0xc582('0x20')]);}_0x524a89[_0xc582('0x50')]=qs[_0xc582('0x51')](_0x32a295[_0xc582('0x48')]['sort']);_0x524a89[_0xc582('0x52')]=qs[_0xc582('0x4a')](_[_0xc582('0x53')](_0x32a295[_0xc582('0x48')],_0x3c774b[_0xc582('0x4a')]));_0x524a89[_0xc582('0x52')]['MailAccountId']=_0x2c563c['id'];if(_0x32a295['query']['filter']){_0x524a89['where']=_[_0xc582('0x55')](_0x524a89['where'],{'$or':_[_0xc582('0x43')](_0x524a89[_0xc582('0x4b')],function(_0x14f966){var _0x24f0bd={};_0x24f0bd[_0x14f966]={'$like':'%'+_0x32a295[_0xc582('0x48')][_0xc582('0x54')]+'%'};return _0x24f0bd;})});}_0x524a89=_[_0xc582('0x55')]({},_0x524a89,_0x32a295[_0xc582('0x57')]);return db[_0xc582('0x6e')][_0xc582('0x1f')]({'where':_0x524a89[_0xc582('0x52')]})['then'](function(_0xdb9608){_0x3ee9de[_0xc582('0x1f')]=_0xdb9608;if(_0x32a295[_0xc582('0x48')][_0xc582('0x59')]){_0x524a89[_0xc582('0x5a')]=[{'all':!![]}];}return db[_0xc582('0x6e')][_0xc582('0x5b')](_0x524a89);})[_0xc582('0x10')](function(_0x16486e){_0x3ee9de[_0xc582('0x5c')]=_0x16486e;return _0x3ee9de;});}})[_0xc582('0x10')](respondWithFilteredResult(_0x5908ed,_0x524a89))[_0xc582('0x19')](handleError(_0x5908ed,null));};exports[_0xc582('0x6f')]=function(_0x1e151f,_0x321085){return db[_0xc582('0x58')][_0xc582('0x61')]({'where':{'id':_0x1e151f['params']['id']}})[_0xc582('0x10')](handleEntityNotFound(_0x321085,null))[_0xc582('0x10')](function(_0x1a1e55){if(_0x1a1e55){return _0x1a1e55['removeAnswers'](_0x1e151f['query']['ids']);}})['then'](respondWithStatusCode(_0x321085,null))['catch'](handleError(_0x321085,null));};exports['create']=function(_0x1a541e,_0x4d7d31){var _0x3fbe97={'name':_0x1a541e[_0xc582('0x62')][_0xc582('0x29')],'key':_0x1a541e[_0xc582('0x62')][_0xc582('0x46')],'provider':_0x1a541e[_0xc582('0x62')]['provider']===_0xc582('0x70')?null:_0x1a541e[_0xc582('0x62')][_0xc582('0x63')],'email':_0x1a541e[_0xc582('0x62')][_0xc582('0x71')],'ListId':_0x1a541e[_0xc582('0x62')][_0xc582('0x72')],'active':!_['isNil'](_0x1a541e[_0xc582('0x62')][_0xc582('0x73')])?_0x1a541e['body'][_0xc582('0x73')]:!![],'description':_0x1a541e['body'][_0xc582('0x74')]||null};var _0x3066cc=getAuthenticationOptions(_0x3fbe97[_0xc582('0x63')],_0x1a541e[_0xc582('0x62')]);_0x3fbe97[_0xc582('0x40')]=_0x3066cc['Imap'];_0x3fbe97[_0xc582('0x41')]=_0x3066cc[_0xc582('0x41')];return db[_0xc582('0x58')][_0xc582('0x68')](_0x3fbe97,{'include':[{'model':db[_0xc582('0x42')],'as':_0xc582('0x41')},{'model':db[_0xc582('0x64')],'as':'Imap'}]})['then'](function(_0x4ceab0){var _0x125334=_0x1a541e[_0xc582('0x35')][_0xc582('0x25')]({'plain':!![]});if(!_0x125334)throw new Error(_0xc582('0x75'));if(_0x125334['role']===_0xc582('0x35')){var _0x27db8f=_0x4ceab0[_0xc582('0x25')]({'plain':!![]});return db[_0xc582('0x76')][_0xc582('0x61')]({'where':{'name':_0xc582('0x26'),'userProfileId':_0x125334[_0xc582('0x77')]},'raw':!![]})['then'](function(_0x3d7f93){if(_0x3d7f93&&_0x3d7f93[_0xc582('0x78')]===0x0){return db['UserProfileResource'][_0xc582('0x68')]({'name':_0x27db8f[_0xc582('0x29')],'resourceId':_0x27db8f['id'],'type':_0x3d7f93[_0xc582('0x29')],'sectionId':_0x3d7f93['id']},{})['then'](function(){return _0x4ceab0;});}else{return _0x4ceab0;}})[_0xc582('0x19')](function(_0x4c087a){logger[_0xc582('0x16')](_0xc582('0x79'),_0x4c087a);throw _0x4c087a;});}return _0x4ceab0;})[_0xc582('0x10')](respondWithResult(_0x4d7d31,0xc9))[_0xc582('0x19')](handleError(_0x4d7d31,null));};exports[_0xc582('0x7a')]=function(_0x205abf,_0x4ba084){return db[_0xc582('0x58')][_0xc582('0x7b')]({'where':{'id':_0x205abf[_0xc582('0x5e')]['id']}})[_0xc582('0x10')](handleEntityNotFound(_0x4ba084,null))[_0xc582('0x10')](function(_0x4ee691){if(_0x4ee691){return _0x4ee691[_0xc582('0x7a')]();}return null;})[_0xc582('0x10')](respondWithResult(_0x4ba084,null))['catch'](handleError(_0x4ba084,null));};exports[_0xc582('0x7c')]=function(_0x4bd82b,_0x39e440){if(_0x4bd82b[_0xc582('0x62')]['id']){delete _0x4bd82b[_0xc582('0x62')]['id'];}return db['MailAccount'][_0xc582('0x61')]({'where':{'id':_0x4bd82b[_0xc582('0x5e')]['id']}})[_0xc582('0x10')](handleEntityNotFound(_0x39e440,null))[_0xc582('0x10')](function(_0x4a6544){if(_0x4a6544){_0x4bd82b['body'][_0xc582('0x67')]=_0x4a6544['id'];return db[_0xc582('0x64')]['create'](_0x4bd82b[_0xc582('0x62')]);}})['then'](respondWithResult(_0x39e440,null))['catch'](handleError(_0x39e440,null));};exports[_0xc582('0x7d')]=function(_0x3d5cea,_0x4c8070){return db[_0xc582('0x58')][_0xc582('0x7b')]({'where':{'id':_0x3d5cea[_0xc582('0x5e')]['id']}})[_0xc582('0x10')](handleEntityNotFound(_0x4c8070,null))[_0xc582('0x10')](function(_0x4195da){if(_0x4195da){return _0x4195da['setImap'](null);}return null;})['then'](respondWithStatusCode(_0x4c8070,null))[_0xc582('0x19')](handleError(_0x4c8070,null));};exports[_0xc582('0x7e')]=function(_0x1ff924,_0x76a2ff){return db[_0xc582('0x58')][_0xc582('0x7b')]({'where':{'id':_0x1ff924[_0xc582('0x5e')]['id']}})['then'](handleEntityNotFound(_0x76a2ff,null))[_0xc582('0x10')](function(_0x514f66){if(_0x514f66){return _0x514f66[_0xc582('0x7e')]();}return null;})[_0xc582('0x10')](respondWithResult(_0x76a2ff,null))[_0xc582('0x19')](handleError(_0x76a2ff,null));};exports[_0xc582('0x7f')]=function(_0x3af0c2,_0x17ae74){if(_0x3af0c2[_0xc582('0x62')]['id']){delete _0x3af0c2['body']['id'];}return db[_0xc582('0x58')][_0xc582('0x61')]({'where':{'id':_0x3af0c2[_0xc582('0x5e')]['id']}})[_0xc582('0x10')](handleEntityNotFound(_0x17ae74,null))[_0xc582('0x10')](function(_0x33508b){if(_0x33508b){_0x3af0c2[_0xc582('0x62')][_0xc582('0x67')]=_0x33508b['id'];return db[_0xc582('0x42')][_0xc582('0x68')](_0x3af0c2['body']);}})[_0xc582('0x10')](respondWithResult(_0x17ae74,null))[_0xc582('0x19')](handleError(_0x17ae74,null));};exports[_0xc582('0x80')]=function(_0x41ebea,_0x4d6a5f){return db[_0xc582('0x58')][_0xc582('0x7b')]({'where':{'id':_0x41ebea['params']['id']}})[_0xc582('0x10')](handleEntityNotFound(_0x4d6a5f,null))[_0xc582('0x10')](function(_0x659eb2){if(_0x659eb2){return _0x659eb2[_0xc582('0x81')](null);}return null;})[_0xc582('0x10')](respondWithStatusCode(_0x4d6a5f,null))[_0xc582('0x19')](handleError(_0x4d6a5f,null));};exports['addInteraction']=function(_0x5f0cd1,_0x5756f6){return db['MailInteraction'][_0xc582('0x61')]({'where':{'id':_0x5f0cd1['params']['id']}})[_0xc582('0x10')](handleEntityNotFound(_0x5756f6,null))[_0xc582('0x10')](function(_0x3a5d0a){if(_0x3a5d0a){return _0x3a5d0a[_0xc582('0x82')](_0x5f0cd1['body'][_0xc582('0x6d')],_[_0xc582('0x83')](_0x5f0cd1[_0xc582('0x62')],[_0xc582('0x6d'),'id'])||{});}})['then'](respondWithResult(_0x5756f6,null))[_0xc582('0x19')](handleError(_0x5756f6,null));};exports[_0xc582('0x84')]=function(_0x3c3045,_0x4d1b15){var _0x1cd533={'raw':![],'where':{}};var _0x459c67={};var _0x1b7ec4={'count':0x0,'rows':[]};return db[_0xc582('0x58')]['findOne']({'where':{'id':_0x3c3045[_0xc582('0x5e')]['id']}})[_0xc582('0x10')](handleEntityNotFound(_0x4d1b15,null))[_0xc582('0x10')](function(_0x42d1fe){if(_0x42d1fe){_0x459c67[_0xc582('0x47')]=_['keys'](db[_0xc582('0x85')][_0xc582('0x44')]);_0x459c67[_0xc582('0x48')]=_[_0xc582('0x49')](_0x3c3045[_0xc582('0x48')]);_0x459c67[_0xc582('0x4a')]=_[_0xc582('0x4c')](_0x459c67['model'],_0x459c67[_0xc582('0x48')]);_0x1cd533[_0xc582('0x4b')]=_[_0xc582('0x4c')](_0x459c67[_0xc582('0x47')],qs[_0xc582('0x4d')](_0x3c3045['query']['fields']));_0x1cd533[_0xc582('0x4b')]=_0x1cd533[_0xc582('0x4b')][_0xc582('0x4e')]?_0x1cd533['attributes']:_0x459c67[_0xc582('0x47')];if(!_0x3c3045[_0xc582('0x48')][_0xc582('0x4f')](_0xc582('0x6b'))){_0x1cd533['limit']=qs[_0xc582('0x1e')](_0x3c3045[_0xc582('0x48')][_0xc582('0x1e')]);_0x1cd533[_0xc582('0x20')]=qs[_0xc582('0x20')](_0x3c3045[_0xc582('0x48')]['offset']);}_0x1cd533[_0xc582('0x50')]=qs[_0xc582('0x51')](_0x3c3045[_0xc582('0x48')]['sort']);_0x1cd533['where']=qs[_0xc582('0x4a')](_[_0xc582('0x53')](_0x3c3045[_0xc582('0x48')],_0x459c67['filters']));_0x1cd533[_0xc582('0x52')][_0xc582('0x67')]=_0x42d1fe['id'];if(_0x3c3045[_0xc582('0x48')][_0xc582('0x54')]){_0x1cd533[_0xc582('0x52')]=_[_0xc582('0x55')](_0x1cd533[_0xc582('0x52')],{'$or':_[_0xc582('0x43')](_0x1cd533[_0xc582('0x4b')],function(_0x18f0ee){var _0x5ec62c={};_0x5ec62c[_0x18f0ee]={'$like':'%'+_0x3c3045['query']['filter']+'%'};return _0x5ec62c;})});}_0x1cd533=_['merge']({},_0x1cd533,_0x3c3045['options']);return db['MailInteraction'][_0xc582('0x1f')]({'where':_0x1cd533[_0xc582('0x52')]})[_0xc582('0x10')](function(_0x53e067){_0x1b7ec4['count']=_0x53e067;if(_0x3c3045['query'][_0xc582('0x59')]){_0x1cd533[_0xc582('0x5a')]=[{'model':db[_0xc582('0x86')],'as':'Contact','required':![]},{'model':db[_0xc582('0x87')],'as':'Owner','attributes':['name','fullname',_0xc582('0x88')],'required':![]},{'model':db[_0xc582('0x89')],'as':'Tags','attributes':['id',_0xc582('0x29'),_0xc582('0x8a')],'where':_0x3c3045[_0xc582('0x48')]['tag']?{'id':_0x3c3045[_0xc582('0x48')]['tag']}:undefined,'required':_0x3c3045[_0xc582('0x48')]['tag']?!![]:![]}];}return db[_0xc582('0x85')][_0xc582('0x5b')](_0x1cd533);})[_0xc582('0x10')](function(_0xa5dddd){_0x1b7ec4['rows']=_0xa5dddd;return _0x1b7ec4;});}})[_0xc582('0x10')](respondWithFilteredResult(_0x4d1b15,_0x1cd533))[_0xc582('0x19')](handleError(_0x4d1b15,null));};exports[_0xc582('0x8b')]=function addApplications(_0x485dfa,_0x564728){var _0x19a181=_0x485dfa[_0xc582('0x5e')]['id'];var _0x2e35b0=_0x485dfa[_0xc582('0x62')];var _0x449e38=0xc8;var _0x252979=null;return db['sequelize']['transaction']({'isolationLevel':db[_0xc582('0x8c')][_0xc582('0x8d')][_0xc582('0x8e')]['READ_COMMITTED']},function(_0x3f0981){return db[_0xc582('0x58')]['findOne']({'where':{'id':_0x19a181},'transaction':_0x3f0981})[_0xc582('0x10')](function(_0x38104b){if(_0x38104b){return db[_0xc582('0x8f')][_0xc582('0x24')]({'where':{'MailAccountId':_0x19a181},'transaction':_0x3f0981})[_0xc582('0x10')](function(){var _0x28a334=_[_0xc582('0x43')](_0x2e35b0,function(_0x5db168){_0x5db168[_0xc582('0x67')]=_0x19a181;return _0x5db168;});return db[_0xc582('0x8f')][_0xc582('0x90')](_0x28a334,{'transaction':_0x3f0981});});}else{_0x449e38=0x194;_0x252979=[];}});})[_0xc582('0x10')](function(){if(_0x449e38!==0x194){return db[_0xc582('0x8f')][_0xc582('0x91')]({'where':{'MailAccountId':_0x19a181},'order':_0xc582('0x92')})[_0xc582('0x10')](function(_0x3c29f8){_0x252979=_0x3c29f8;});}})[_0xc582('0x19')](function(_0x31299b){_0x449e38=0x1f4;logger[_0xc582('0x16')](_0x31299b[_0xc582('0x28')]);if(_0x31299b[_0xc582('0x29')]){delete _0x31299b[_0xc582('0x29')];}_0x252979=_0x31299b;})[_0xc582('0x93')](function(){if(_0x252979===null){_0x564728['sendStatus'](_0x449e38);}else{if(_0x449e38===0x1f4){_0x564728[_0xc582('0x1b')](_0x449e38)['send'](_0x252979);}else{_0x564728[_0xc582('0x1b')](_0x449e38)['json'](_0x252979);}}});};exports[_0xc582('0x94')]=function(_0x271691,_0x5d484c){var _0x259cdc={};var _0x4f9e14={};var _0x580d29;var _0x271bfa;return db['MailAccount']['findOne']({'where':{'id':_0x271691['params']['id']}})[_0xc582('0x10')](handleEntityNotFound(_0x5d484c,null))[_0xc582('0x10')](function(_0x3b2a62){if(_0x3b2a62){_0x580d29=_0x3b2a62;_0x4f9e14['model']=_['keys'](db[_0xc582('0x8f')][_0xc582('0x44')]);_0x4f9e14[_0xc582('0x48')]=_[_0xc582('0x49')](_0x271691[_0xc582('0x48')]);_0x4f9e14[_0xc582('0x4a')]=_[_0xc582('0x4c')](_0x4f9e14['model'],_0x4f9e14[_0xc582('0x48')]);_0x259cdc[_0xc582('0x4b')]=_[_0xc582('0x4c')](_0x4f9e14[_0xc582('0x47')],qs[_0xc582('0x4d')](_0x271691[_0xc582('0x48')][_0xc582('0x4d')]));_0x259cdc[_0xc582('0x4b')]=_0x259cdc['attributes'][_0xc582('0x4e')]?_0x259cdc[_0xc582('0x4b')]:_0x4f9e14[_0xc582('0x47')];_0x259cdc['order']=qs['sort'](_0x271691[_0xc582('0x48')][_0xc582('0x51')]);_0x259cdc[_0xc582('0x52')]=qs[_0xc582('0x4a')](_[_0xc582('0x53')](_0x271691[_0xc582('0x48')],_0x4f9e14[_0xc582('0x4a')]));if(_0x271691[_0xc582('0x48')][_0xc582('0x54')]){_0x259cdc[_0xc582('0x52')]=_[_0xc582('0x55')](_0x259cdc['where'],{'$or':_[_0xc582('0x43')](_0x259cdc[_0xc582('0x4b')],function(_0xce3075){var _0x4959d4={};_0x4959d4[_0xce3075]={'$like':'%'+_0x271691['query']['filter']+'%'};return _0x4959d4;})});}_0x259cdc=_['merge']({},_0x259cdc,_0x271691[_0xc582('0x57')]);return _0x580d29[_0xc582('0x94')](_0x259cdc);}})[_0xc582('0x10')](function(_0x2f5158){if(_0x2f5158){_0x271bfa=_0x2f5158['length'];if(!_0x271691[_0xc582('0x48')][_0xc582('0x4f')](_0xc582('0x6b'))){_0x259cdc['limit']=qs[_0xc582('0x1e')](_0x271691['query'][_0xc582('0x1e')]);_0x259cdc[_0xc582('0x20')]=qs[_0xc582('0x20')](_0x271691[_0xc582('0x48')][_0xc582('0x20')]);}return _0x580d29[_0xc582('0x94')](_0x259cdc);}})['then'](function(_0x4f1f1b){if(_0x4f1f1b){return _0x4f1f1b?{'count':_0x271bfa,'rows':_0x4f1f1b}:null;}})[_0xc582('0x10')](respondWithResult(_0x5d484c,null))[_0xc582('0x19')](handleError(_0x5d484c,null));};exports['getMessages']=function(_0x53e6c5,_0x30a52d){var _0xc45d3b={'raw':!![],'where':{}};var _0xb7145a={};var _0x4fe5f3={'count':0x0,'rows':[]};return db[_0xc582('0x58')][_0xc582('0x7b')]({'where':{'id':_0x53e6c5['params']['id']}})[_0xc582('0x10')](handleEntityNotFound(_0x30a52d,null))[_0xc582('0x10')](function(_0x427b61){if(_0x427b61){_0xb7145a[_0xc582('0x47')]=_['keys'](db['MailMessage'][_0xc582('0x44')]);_0xb7145a[_0xc582('0x48')]=_['keys'](_0x53e6c5['query']);_0xb7145a['filters']=_['intersection'](_0xb7145a[_0xc582('0x47')],_0xb7145a['query']);_0xc45d3b[_0xc582('0x4b')]=_[_0xc582('0x4c')](_0xb7145a[_0xc582('0x47')],qs[_0xc582('0x4d')](_0x53e6c5['query']['fields']));_0xc45d3b['attributes']=_0xc45d3b[_0xc582('0x4b')][_0xc582('0x4e')]?_0xc45d3b[_0xc582('0x4b')]:_0xb7145a['model'];if(!_0x53e6c5[_0xc582('0x48')]['hasOwnProperty']('nolimit')){_0xc45d3b[_0xc582('0x1e')]=qs[_0xc582('0x1e')](_0x53e6c5[_0xc582('0x48')][_0xc582('0x1e')]);_0xc45d3b[_0xc582('0x20')]=qs['offset'](_0x53e6c5[_0xc582('0x48')][_0xc582('0x20')]);}_0xc45d3b[_0xc582('0x50')]=qs[_0xc582('0x51')](_0x53e6c5[_0xc582('0x48')][_0xc582('0x51')]);_0xc45d3b[_0xc582('0x52')]=qs[_0xc582('0x4a')](_[_0xc582('0x53')](_0x53e6c5[_0xc582('0x48')],_0xb7145a[_0xc582('0x4a')]));_0xc45d3b[_0xc582('0x52')][_0xc582('0x67')]=_0x427b61['id'];if(_0x53e6c5['query'][_0xc582('0x54')]){_0xc45d3b['where']=_[_0xc582('0x55')](_0xc45d3b[_0xc582('0x52')],{'$or':_[_0xc582('0x43')](_0xc45d3b[_0xc582('0x4b')],function(_0x2b7ab7){var _0x3141d3={};_0x3141d3[_0x2b7ab7]={'$like':'%'+_0x53e6c5[_0xc582('0x48')]['filter']+'%'};return _0x3141d3;})});}if(_0x53e6c5[_0xc582('0x48')][_0xc582('0x95')]){var _0x4df2a8=_0x53e6c5[_0xc582('0x48')][_0xc582('0x95')][_0xc582('0x96')](',');var _0x12861d={};_0x12861d[_0x4df2a8[0x0]]={'$gte':moment(_0x4df2a8[0x1])[_0xc582('0x97')]('YYYY-MM-DD\x20HH:mm:ss')};_0xc45d3b[_0xc582('0x52')]=_[_0xc582('0x55')](_0xc45d3b['where'],_0x12861d);}_0xc45d3b=_[_0xc582('0x55')]({},_0xc45d3b,_0x53e6c5[_0xc582('0x57')]);return db[_0xc582('0x98')][_0xc582('0x1f')]({'where':_0xc45d3b[_0xc582('0x52')]})[_0xc582('0x10')](function(_0x306196){_0x4fe5f3['count']=_0x306196;if(_0x53e6c5[_0xc582('0x48')][_0xc582('0x59')]){_0xc45d3b[_0xc582('0x5a')]=[{'all':!![]}];}return db[_0xc582('0x98')]['findAll'](_0xc45d3b);})[_0xc582('0x10')](function(_0x35aeaa){if(_0x53e6c5[_0xc582('0x48')]['inlineCss']==='true'){for(var _0x37e58c=0x0;_0x37e58c<_0x35aeaa[_0xc582('0x4e')];_0x37e58c++){_0x35aeaa[_0x37e58c]['body']=juice(_0x35aeaa[_0x37e58c]['body']);}}_0x4fe5f3[_0xc582('0x5c')]=_0x35aeaa;return _0x4fe5f3;});}})[_0xc582('0x10')](respondWithFilteredResult(_0x30a52d,_0xc45d3b))[_0xc582('0x19')](handleError(_0x30a52d,null));};exports['send']=function(_0x1f2617,_0x27c214){var _0x23e3f5,_0x2e9e2c={},_0x396fb4;if(_0x1f2617['body']['to']){_0x396fb4=_0x1f2617[_0xc582('0x62')]['to'][_0xc582('0x96')](',')[0x0];}return db[_0xc582('0x58')][_0xc582('0x61')]({'where':{'id':_0x1f2617[_0xc582('0x5e')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0xc582('0x86')],'as':_0xc582('0x99'),'where':{'email':_0x396fb4},'limit':0x1,'order':[[_0xc582('0x9a'),_0xc582('0x9b')]]}]},{'model':db[_0xc582('0x42')],'as':_0xc582('0x41'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0xc582('0x9c'),'raw':!![]}]}]})[_0xc582('0x10')](handleEntityNotFound(_0x27c214,null))['then'](function(_0x21bbc7){if(!_0x21bbc7)return;_0x23e3f5=_0x21bbc7;if(!_0x21bbc7[_0xc582('0x41')])throw new Error('Smtp\x20configuration\x20not\x20found');if(_[_0xc582('0x9d')](_0x1f2617[_0xc582('0x62')]['from'])){_0x1f2617['body'][_0xc582('0x9e')]=util['format'](_0xc582('0x9f'),_0x21bbc7[_0xc582('0x29')],_0x21bbc7[_0xc582('0x71')]||_0x21bbc7['Smtp'][_0xc582('0x35')]);}if(_0x1f2617[_0xc582('0x62')][_0xc582('0xa0')]&&_0x1f2617[_0xc582('0x62')][_0xc582('0xa0')][_0xc582('0x4e')]){for(var _0x2fcb0b=0x0;_0x2fcb0b<_0x1f2617[_0xc582('0x62')][_0xc582('0xa0')]['length'];_0x2fcb0b+=0x1){_0x1f2617[_0xc582('0x62')][_0xc582('0xa0')][_0x2fcb0b]={'filename':_0x1f2617['body'][_0xc582('0xa0')][_0x2fcb0b][_0xc582('0x29')],'path':path[_0xc582('0xa1')](config[_0xc582('0xa2')],_0xc582('0xa3'),_0x1f2617[_0xc582('0x62')]['attachments'][_0x2fcb0b][_0xc582('0xa4')])};}}var _0x1dcae0=_0x21bbc7['getSmtpOptions']();return respondWithRpcPromise('SendMail',_0xc582('0xa5'),{'account':_0x1dcae0,'message':_0x1f2617[_0xc582('0x62')]});})['then'](function(_0x23d9ee){if(!_0x23d9ee)return;_0x2e9e2c=_0x23d9ee;if(!_0x23e3f5['List'])throw new Error('List\x20not\x20found');if(_0x23e3f5['List'][_0xc582('0x99')][_0xc582('0x4e')])return _0x23e3f5[_0xc582('0xa6')][_0xc582('0x99')][0x0];return db[_0xc582('0x86')][_0xc582('0x68')](_[_0xc582('0xa')](_0x1f2617[_0xc582('0x62')],{'firstName':_0x1f2617[_0xc582('0x62')]['to'],'email':_0x1f2617[_0xc582('0x62')]['to'],'phone':_0x1f2617[_0xc582('0x62')]['to'],'ListId':_0x23e3f5[_0xc582('0x72')]}));})['then'](function(_0x4464bd){if(!_0x4464bd)return;var _0x5079a0={'UserId':_0x1f2617[_0xc582('0x35')]['id'],'ContactId':_0x4464bd['id'],'MailAccountId':_0x23e3f5['id'],'inReplyTo':_0x2e9e2c['messageId'],'to':_0x1f2617['body'][_0xc582('0x9e')],'cc':_0x1f2617[_0xc582('0x62')]['cc'],'subject':_0x1f2617[_0xc582('0x62')]['subject'],'attach':_0x1f2617[_0xc582('0x62')][_0xc582('0xa7')],'firstMsgDirection':_0xc582('0xa8'),'lastMsgAt':moment()[_0xc582('0x97')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':_0xc582('0xa8'),'Messages':[_[_0xc582('0x55')](_0x1f2617[_0xc582('0x62')],{'messageId':_0x2e9e2c[_0xc582('0xa9')],'sentAt':moment()[_0xc582('0x97')](_0xc582('0xaa')),'read':!![],'MailAccountId':_0x23e3f5['id'],'UserId':_0x1f2617[_0xc582('0x35')]['id'],'ContactId':_0x4464bd['id']})]};if(_0x1f2617[_0xc582('0x62')][_0xc582('0xab')]){_0x5079a0=_['merge'](_0x5079a0,_0x1f2617[_0xc582('0x62')][_0xc582('0xab')]);}return db[_0xc582('0x85')][_0xc582('0x68')](_0x5079a0,{'include':[{'model':db[_0xc582('0x98')],'as':_0xc582('0xac')}]});})['then'](respondWithResult(_0x27c214,null))['catch'](handleError(_0x27c214,null));};exports[_0xc582('0xad')]=function(_0xe369e8,_0x505b66){return db['MailAccount'][_0xc582('0x61')]({'where':{'id':_0xe369e8[_0xc582('0x5e')]['id']},'include':[{'model':db[_0xc582('0x42')],'as':_0xc582('0x41'),'raw':!![],'include':[{'model':db[_0xc582('0x9c')],'as':'CloudProvider','raw':!![]}]}]})['then'](handleEntityNotFound(_0x505b66,null))[_0xc582('0x10')](function(_0x436b84){if(!_0x436b84[_0xc582('0x41')])return;var _0x499674=_0x436b84[_0xc582('0xae')]();return respondWithRpcPromise(_0xc582('0xaf'),_0xc582('0xad'),{'account':_0x499674});})['then'](respondWithResult(_0x505b66,null))[_0xc582('0x19')](handleError(_0x505b66,null));};exports[_0xc582('0x24')]=function(_0x3ce481,_0x2c4eb2){return db['MailAccount'][_0xc582('0x61')]({'where':{'id':_0x3ce481[_0xc582('0x5e')]['id']}})[_0xc582('0x10')](handleEntityNotFound(_0x2c4eb2,null))[_0xc582('0x10')](function(_0x495744){if(_0x495744&&_0x495744[_0xc582('0x3e')]){throw new db['Sequelize'][(_0xc582('0xb0'))]('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x495744;})[_0xc582('0x10')](removeEntity(_0x2c4eb2,null))[_0xc582('0x19')](handleError(_0x2c4eb2,null));};exports[_0xc582('0xb1')]=function(_0x4d037f,_0x32f336){return db[_0xc582('0x58')][_0xc582('0x61')]({'where':{'id':_0x4d037f[_0xc582('0x5e')]['id']}})['then'](handleEntityNotFound(_0x32f336,null))['then'](function(_0x210f1d){if(_0x210f1d){return _0x210f1d['addAgents'](_0x4d037f[_0xc582('0x62')]['ids'],_[_0xc582('0x83')](_0x4d037f[_0xc582('0x62')],[_0xc582('0x6d'),'id'])||{})[_0xc582('0xb2')](function(_0x4c007a){for(var _0x387e6b=0x0;_0x387e6b<_0x4d037f[_0xc582('0x62')][_0xc582('0x6d')][_0xc582('0x4e')];_0x387e6b+=0x1){socket[_0xc582('0xb3')]('userMailAccount:save',{'UserId':Number(_0x4d037f[_0xc582('0x62')][_0xc582('0x6d')][_0x387e6b]),'MailAccountId':Number(_0x4d037f[_0xc582('0x5e')]['id'])});}return _0x4c007a;});}})['then'](respondWithResult(_0x32f336,null))[_0xc582('0x19')](handleError(_0x32f336,null));};exports[_0xc582('0xb4')]=function(_0x36f31a,_0x3fd4b1){return db['MailAccount'][_0xc582('0x61')]({'where':{'id':_0x36f31a[_0xc582('0x5e')]['id']}})[_0xc582('0x10')](handleEntityNotFound(_0x3fd4b1,null))['then'](function(_0x560d61){if(_0x560d61){return _0x560d61[_0xc582('0xb4')](_0x36f31a[_0xc582('0x48')][_0xc582('0x6d')])[_0xc582('0x10')](function(){if(_[_0xc582('0xb5')](_0x36f31a[_0xc582('0x48')][_0xc582('0x6d')])){for(var _0x4a6176=0x0;_0x4a6176<_0x36f31a[_0xc582('0x48')][_0xc582('0x6d')][_0xc582('0x4e')];_0x4a6176+=0x1){socket['emit'](_0xc582('0xb6'),{'UserId':Number(_0x36f31a[_0xc582('0x48')][_0xc582('0x6d')][_0x4a6176]),'MailAccountId':Number(_0x36f31a['params']['id'])});}}else{socket[_0xc582('0xb3')](_0xc582('0xb6'),{'UserId':Number(_0x36f31a[_0xc582('0x48')][_0xc582('0x6d')]),'MailAccountId':Number(_0x36f31a[_0xc582('0x5e')]['id'])});}});}})[_0xc582('0x10')](respondWithStatusCode(_0x3fd4b1,null))[_0xc582('0x19')](handleError(_0x3fd4b1,null));};exports[_0xc582('0xb7')]=function(_0x2ecaf9,_0x129fe3){var _0x3c6bb8={};var _0x19af2a={};var _0x3c05d5;var _0x5799ee;return db[_0xc582('0x58')]['findOne']({'where':{'id':_0x2ecaf9['params']['id']}})[_0xc582('0x10')](handleEntityNotFound(_0x129fe3,null))[_0xc582('0x10')](function(_0x4e10f0){if(_0x4e10f0){_0x3c05d5=_0x4e10f0;_0x19af2a[_0xc582('0x47')]=_['keys'](db[_0xc582('0x87')][_0xc582('0x44')]);_0x19af2a[_0xc582('0x48')]=_['keys'](_0x2ecaf9['query']);_0x19af2a[_0xc582('0x4a')]=_[_0xc582('0x4c')](_0x19af2a[_0xc582('0x47')],_0x19af2a[_0xc582('0x48')]);_0x3c6bb8[_0xc582('0x4b')]=_[_0xc582('0x4c')](_0x19af2a['model'],qs['fields'](_0x2ecaf9[_0xc582('0x48')][_0xc582('0x4d')]));_0x3c6bb8[_0xc582('0x4b')]=_0x3c6bb8[_0xc582('0x4b')][_0xc582('0x4e')]?_0x3c6bb8[_0xc582('0x4b')]:_0x19af2a[_0xc582('0x47')];_0x3c6bb8[_0xc582('0x50')]=qs[_0xc582('0x51')](_0x2ecaf9[_0xc582('0x48')][_0xc582('0x51')]);_0x3c6bb8[_0xc582('0x52')]=qs[_0xc582('0x4a')](_[_0xc582('0x53')](_0x2ecaf9['query'],_0x19af2a[_0xc582('0x4a')]));if(_0x2ecaf9[_0xc582('0x48')][_0xc582('0x54')]){_0x3c6bb8[_0xc582('0x52')]=_[_0xc582('0x55')](_0x3c6bb8[_0xc582('0x52')],{'$or':_[_0xc582('0x43')](_0x3c6bb8['attributes'],function(_0x182a2e){var _0x1f9f11={};_0x1f9f11[_0x182a2e]={'$like':'%'+_0x2ecaf9[_0xc582('0x48')]['filter']+'%'};return _0x1f9f11;})});}_0x3c6bb8=_[_0xc582('0x55')]({},_0x3c6bb8,_0x2ecaf9[_0xc582('0x57')]);return _0x3c05d5[_0xc582('0xb7')](_0x3c6bb8);}})['then'](function(_0x32555c){if(_0x32555c){_0x5799ee=_0x32555c[_0xc582('0x4e')];if(!_0x2ecaf9[_0xc582('0x48')][_0xc582('0x4f')]('nolimit')){_0x3c6bb8[_0xc582('0x1e')]=qs[_0xc582('0x1e')](_0x2ecaf9[_0xc582('0x48')][_0xc582('0x1e')]);_0x3c6bb8[_0xc582('0x20')]=qs[_0xc582('0x20')](_0x2ecaf9[_0xc582('0x48')][_0xc582('0x20')]);}return _0x3c05d5['getAgents'](_0x3c6bb8);}})['then'](function(_0x4f48cd){if(_0x4f48cd){return _0x4f48cd?{'count':_0x5799ee,'rows':_0x4f48cd}:null;}})[_0xc582('0x10')](respondWithResult(_0x129fe3,null))['catch'](handleError(_0x129fe3,null));}; \ No newline at end of file +var _0x9585=['addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','omit','getInteractions','CmContact','Contact','User','Owner','fullname','internal','Tag','Tags','tag','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','findAndCountAll','finally','getApplications','getMessages','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','CmList','List','Contacts','updatedAt','DESC','CloudProvider','Smtp\x20configuration\x20not\x20found','isNil','from','%s\x20<%s>','email','attachments','root','server/files/attachments','basename','getSmtpOptions','SendMail','sendMail','List\x20not\x20found','ListId','messageId','subject','attach','out','Interaction','Messages','verifySmtp','VerifySmtp','Sequelize','ValidationError','addAgents','spread','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','lodash','juice','ioredis','../../components/parsers/qs','api','defaults','redis','./mailAccount.socket','jayson/promise','client','request','then','info','MailAccount,\x20%s,\x20%s','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','update','destroy','get','MailAccounts','UserProfileResource','stack','name','send','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','Unknown\x20email\x20service\x20provider','gmail','smtp.gmail.com','smtp.mail.yahoo.com','smtp-mail.outlook.com','user','username','password','pass','modernAuthentication','CloudProviderId','host','port','service','authentication','Imap','Smtp','index','MailServerIn','MailServerOut','Pause','mandatoryDispositionPause','map','MailAccount','rawAttributes','fieldName','type','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','include','findAll','rows','show','params','keys','body','provider','custom','secure','describe','addDisposition','find','MailAccountId','create','findOne','Disposition','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','key','active','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','removeImap','getSmtp'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x9585,0x1cc));var _0x5958=function(_0x4ad3b1,_0x1e9a32){_0x4ad3b1=_0x4ad3b1-0x0;var _0x101146=_0x9585[_0x4ad3b1];return _0x101146;};'use strict';var moment=require('moment');var BPromise=require('bluebird');var util=require('util');var path=require('path');var _=require(_0x5958('0x0'));var juice=require(_0x5958('0x1'));var Redis=require(_0x5958('0x2'));var qs=require(_0x5958('0x3'));var logger=require('../../config/logger')(_0x5958('0x4'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config['redis']=_[_0x5958('0x5')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5958('0x6')]));require(_0x5958('0x7'))['register'](socket);var jayson=require(_0x5958('0x8'));var client=jayson[_0x5958('0x9')]['http']({'port':0x232b});function respondWithRpcPromise(_0x4b0350,_0x1ea2f8,_0x34df8f,_0x1b82ed){return new BPromise(function(_0x20da3b,_0x464924){var _0x1b0fe1=_0x1b82ed||client;return _0x1b0fe1[_0x5958('0xa')](_0x4b0350,_0x34df8f)[_0x5958('0xb')](function(_0x282c21){logger[_0x5958('0xc')](_0x5958('0xd'),_0x1ea2f8,'request\x20sent');logger['debug'](_0x5958('0xe'),_0x1ea2f8,_0x5958('0xf'),JSON[_0x5958('0x10')](_0x282c21));if(_0x282c21[_0x5958('0x11')]){if(_0x282c21[_0x5958('0x11')][_0x5958('0x12')]===0x1f4){logger['error'](_0x5958('0xd'),_0x1ea2f8,_0x282c21[_0x5958('0x11')][_0x5958('0x13')]);return _0x464924(_0x282c21[_0x5958('0x11')][_0x5958('0x13')]);}logger[_0x5958('0x11')](_0x5958('0xd'),_0x1ea2f8,_0x282c21[_0x5958('0x11')][_0x5958('0x13')]);return _0x20da3b(_0x282c21[_0x5958('0x11')]['message']);}else{logger[_0x5958('0xc')](_0x5958('0xd'),_0x1ea2f8,_0x5958('0xf'));_0x20da3b(_0x282c21['result'][_0x5958('0x13')]);}})[_0x5958('0x14')](function(_0x449eac){logger[_0x5958('0x11')](_0x5958('0xd'),_0x1ea2f8,_0x449eac);_0x464924(_0x449eac);});});}function respondWithStatusCode(_0x20db39,_0x7589c2){_0x7589c2=_0x7589c2||0xcc;return function(_0x2a2ce6){if(_0x2a2ce6){return _0x20db39[_0x5958('0x15')](_0x7589c2);}return _0x20db39[_0x5958('0x16')](_0x7589c2)[_0x5958('0x17')]();};}function respondWithResult(_0x46321a,_0x3d1aec){_0x3d1aec=_0x3d1aec||0xc8;return function(_0x5187d7){if(_0x5187d7){return _0x46321a['status'](_0x3d1aec)['json'](_0x5187d7);}};}function respondWithFilteredResult(_0x32ca7c,_0x1c7234){return function(_0x10b89c){if(_0x10b89c){var _0x447043=typeof _0x1c7234['offset']===_0x5958('0x18')&&typeof _0x1c7234[_0x5958('0x19')]===_0x5958('0x18');var _0x5149f2=_0x10b89c[_0x5958('0x1a')];var _0x14108a=_0x447043?0x0:_0x1c7234[_0x5958('0x1b')];var _0x37cd36=_0x447043?_0x10b89c[_0x5958('0x1a')]:_0x1c7234[_0x5958('0x1b')]+_0x1c7234[_0x5958('0x19')];var _0xc677cd;if(_0x37cd36>=_0x5149f2){_0x37cd36=_0x5149f2;_0xc677cd=0xc8;}else{_0xc677cd=0xce;}_0x32ca7c['status'](_0xc677cd);return _0x32ca7c[_0x5958('0x1c')](_0x5958('0x1d'),_0x14108a+'-'+_0x37cd36+'/'+_0x5149f2)[_0x5958('0x1e')](_0x10b89c);}return null;};}function saveUpdates(_0x1d2192){return function(_0x25a919){if(_0x25a919){return _0x25a919[_0x5958('0x1f')](_0x1d2192)[_0x5958('0xb')](function(_0x210ee4){return _0x210ee4;});}return null;};}function removeEntity(_0x1adce0){return function(_0x3b8a05){if(_0x3b8a05){return _0x3b8a05[_0x5958('0x20')]()[_0x5958('0xb')](function(){var _0x3e9c4a=_0x3b8a05[_0x5958('0x21')]({'plain':!![]});var _0x37a376=_0x5958('0x22');return db[_0x5958('0x23')][_0x5958('0x20')]({'where':{'type':_0x37a376,'resourceId':_0x3e9c4a['id']}})[_0x5958('0xb')](function(){return _0x3b8a05;});})['then'](function(){_0x1adce0[_0x5958('0x16')](0xcc)[_0x5958('0x17')]();});}};}function handleEntityNotFound(_0x3b21a0){return function(_0x27f7ea){if(!_0x27f7ea){_0x3b21a0[_0x5958('0x15')](0x194);}return _0x27f7ea;};}function handleError(_0xe8405b,_0x264c19){_0x264c19=_0x264c19||0x1f4;return function(_0x4a51c5){logger[_0x5958('0x11')](_0x4a51c5[_0x5958('0x24')]);if(_0x4a51c5[_0x5958('0x25')]){delete _0x4a51c5[_0x5958('0x25')];}_0xe8405b[_0x5958('0x16')](_0x264c19)[_0x5958('0x26')](_0x4a51c5);};}function getImapHost(_0x2095c0){switch(_0x2095c0){case'gmail':return _0x5958('0x27');case _0x5958('0x28'):return _0x5958('0x29');case _0x5958('0x2a'):return _0x5958('0x2b');case _0x5958('0x2c'):return _0x5958('0x2d');}throw new Error(_0x5958('0x2e'),_0x2095c0);}function getSmtpHost(_0x2f4863){switch(_0x2f4863){case _0x5958('0x2f'):return _0x5958('0x30');case _0x5958('0x28'):return _0x5958('0x31');case'hotmail':return _0x5958('0x32');case _0x5958('0x2c'):return'smtp.office365.com';}throw new Error(_0x5958('0x2e'),_0x2f4863);}function getAuthenticationOptions(_0x15a7c7,_0x4d7ac5){var _0x315fc3={};var _0x7bce16={};if(_0x15a7c7){_0x315fc3[_0x5958('0x33')]=_0x7bce16[_0x5958('0x33')]=_0x4d7ac5[_0x5958('0x34')];_0x315fc3[_0x5958('0x35')]=_0x7bce16[_0x5958('0x36')]=_0x4d7ac5[_0x5958('0x35')];if(_0x4d7ac5['modernAuthentication']){_0x315fc3[_0x5958('0x37')]=_0x7bce16[_0x5958('0x37')]=!![];_0x315fc3[_0x5958('0x38')]=_0x7bce16['CloudProviderId']=_0x4d7ac5[_0x5958('0x38')];_0x315fc3[_0x5958('0x35')]=_0x7bce16[_0x5958('0x36')]=null;}else{_0x315fc3[_0x5958('0x38')]=_0x7bce16[_0x5958('0x38')]=null;}_0x315fc3[_0x5958('0x39')]=getImapHost(_0x15a7c7);_0x315fc3[_0x5958('0x3a')]=0x3e1;_0x7bce16[_0x5958('0x39')]=getSmtpHost(_0x15a7c7);_0x7bce16[_0x5958('0x3a')]=0x24b;_0x7bce16['secure']=![];_0x315fc3[_0x5958('0x3b')]=_0x7bce16[_0x5958('0x3b')]=null;}else{if(_0x4d7ac5[_0x5958('0x3c')]){_0x315fc3[_0x5958('0x33')]=_0x7bce16[_0x5958('0x33')]=_0x4d7ac5[_0x5958('0x34')];_0x315fc3[_0x5958('0x35')]=_0x7bce16['pass']=_0x4d7ac5[_0x5958('0x35')];}else{_0x315fc3[_0x5958('0x3c')]=_0x7bce16['authentication']=![];_0x315fc3[_0x5958('0x33')]=_0x7bce16[_0x5958('0x33')]=null;_0x315fc3[_0x5958('0x35')]=_0x7bce16[_0x5958('0x36')]=null;}_0x315fc3[_0x5958('0x39')]=_0x4d7ac5[_0x5958('0x3d')][_0x5958('0x39')];_0x315fc3[_0x5958('0x3a')]=_0x4d7ac5['Imap']['port'];_0x7bce16['host']=_0x4d7ac5[_0x5958('0x3e')]['host'];_0x7bce16[_0x5958('0x3a')]=_0x4d7ac5[_0x5958('0x3e')][_0x5958('0x3a')];}return{'Imap':_0x315fc3,'Smtp':_0x7bce16};}exports[_0x5958('0x3f')]=function(_0x5d8a08,_0x31ec8c){var _0x25e59b={'include':[{'model':db[_0x5958('0x40')],'as':_0x5958('0x3d')},{'model':db[_0x5958('0x41')],'as':_0x5958('0x3e')},{'model':db[_0x5958('0x42')],'as':_0x5958('0x43')}]},_0x53de2a={},_0x474b43={'count':0x0,'rows':[]};var _0xa2695a=_[_0x5958('0x44')](db[_0x5958('0x45')][_0x5958('0x46')],function(_0xd31257){return{'name':_0xd31257[_0x5958('0x47')],'type':_0xd31257[_0x5958('0x48')]['key']};});_0x53de2a['model']=_['map'](_0xa2695a,'name');_0x53de2a[_0x5958('0x49')]=_['keys'](_0x5d8a08[_0x5958('0x49')]);_0x53de2a[_0x5958('0x4a')]=_[_0x5958('0x4b')](_0x53de2a[_0x5958('0x4c')],_0x53de2a[_0x5958('0x49')]);_0x25e59b[_0x5958('0x4d')]=_[_0x5958('0x4b')](_0x53de2a[_0x5958('0x4c')],qs[_0x5958('0x4e')](_0x5d8a08[_0x5958('0x49')]['fields']));_0x25e59b['attributes']=_0x25e59b[_0x5958('0x4d')][_0x5958('0x4f')]?_0x25e59b['attributes']:_0x53de2a[_0x5958('0x4c')];if(!_0x5d8a08[_0x5958('0x49')][_0x5958('0x50')](_0x5958('0x51'))){_0x25e59b[_0x5958('0x19')]=qs[_0x5958('0x19')](_0x5d8a08[_0x5958('0x49')][_0x5958('0x19')]);_0x25e59b[_0x5958('0x1b')]=qs[_0x5958('0x1b')](_0x5d8a08['query'][_0x5958('0x1b')]);}_0x25e59b[_0x5958('0x52')]=qs[_0x5958('0x53')](_0x5d8a08[_0x5958('0x49')][_0x5958('0x53')]);_0x25e59b['where']=qs[_0x5958('0x4a')](_[_0x5958('0x54')](_0x5d8a08[_0x5958('0x49')],_0x53de2a[_0x5958('0x4a')]),_0xa2695a);if(_0x5d8a08[_0x5958('0x49')][_0x5958('0x55')]){_0x25e59b['where']=_['merge'](_0x25e59b[_0x5958('0x56')],{'$or':_[_0x5958('0x44')](_0xa2695a,function(_0x1c1b23){if(_0x1c1b23[_0x5958('0x48')]!=='VIRTUAL'){var _0x5d22ca={};_0x5d22ca[_0x1c1b23[_0x5958('0x25')]]={'$like':'%'+_0x5d8a08[_0x5958('0x49')][_0x5958('0x55')]+'%'};return _0x5d22ca;}})});}_0x25e59b=_[_0x5958('0x57')]({},_0x25e59b,_0x5d8a08[_0x5958('0x58')]);var _0x439a33={'where':_0x25e59b[_0x5958('0x56')]};return db['MailAccount'][_0x5958('0x1a')](_0x439a33)[_0x5958('0xb')](function(_0x2a7897){_0x474b43[_0x5958('0x1a')]=_0x2a7897;if(_0x5d8a08[_0x5958('0x49')][_0x5958('0x59')]){_0x25e59b[_0x5958('0x5a')]=[{'all':!![]}];}return db[_0x5958('0x45')][_0x5958('0x5b')](_0x25e59b);})[_0x5958('0xb')](function(_0x5a7b60){_0x474b43[_0x5958('0x5c')]=_0x5a7b60;return _0x474b43;})[_0x5958('0xb')](respondWithFilteredResult(_0x31ec8c,_0x25e59b))[_0x5958('0x14')](handleError(_0x31ec8c,null));};exports[_0x5958('0x5d')]=function(_0x95332e,_0x407325){var _0x361774={'raw':![],'where':{'id':_0x95332e[_0x5958('0x5e')]['id']},'include':[{'model':db['MailServerIn'],'as':_0x5958('0x3d')},{'model':db[_0x5958('0x41')],'as':_0x5958('0x3e')},{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x508297={};_0x508297[_0x5958('0x4c')]=_[_0x5958('0x5f')](db['MailAccount']['rawAttributes']);_0x508297['query']=_['keys'](_0x95332e['query']);_0x508297[_0x5958('0x4a')]=_[_0x5958('0x4b')](_0x508297[_0x5958('0x4c')],_0x508297[_0x5958('0x49')]);_0x361774[_0x5958('0x4d')]=_[_0x5958('0x4b')](_0x508297[_0x5958('0x4c')],qs[_0x5958('0x4e')](_0x95332e[_0x5958('0x49')][_0x5958('0x4e')]));_0x361774[_0x5958('0x4d')]=_0x361774[_0x5958('0x4d')][_0x5958('0x4f')]?_0x361774['attributes']:_0x508297[_0x5958('0x4c')];if(_0x95332e[_0x5958('0x49')]['includeAll']){_0x361774['include']=[{'all':!![]}];}_0x361774=_[_0x5958('0x57')]({},_0x361774,_0x95332e[_0x5958('0x58')]);return db[_0x5958('0x45')]['find'](_0x361774)[_0x5958('0xb')](handleEntityNotFound(_0x407325,null))[_0x5958('0xb')](respondWithResult(_0x407325,null))[_0x5958('0x14')](handleError(_0x407325,null));};exports[_0x5958('0x1f')]=function(_0x1718af,_0x1dccb4){if(_0x1718af['body']['id']){delete _0x1718af[_0x5958('0x60')]['id'];}var _0x10f4c4=_0x1718af['body'][_0x5958('0x61')]===_0x5958('0x62')?null:_0x1718af['body'][_0x5958('0x61')];var _0x575562=_0x1718af[_0x5958('0x60')][_0x5958('0x3d')]||{};var _0x3a2c96=_0x1718af[_0x5958('0x60')][_0x5958('0x3e')]||{};if(_0x10f4c4){_0x575562[_0x5958('0x39')]=getImapHost(_0x10f4c4);_0x575562[_0x5958('0x3a')]=0x3e1;_0x3a2c96[_0x5958('0x39')]=getSmtpHost(_0x10f4c4);_0x3a2c96[_0x5958('0x3a')]=0x24b;_0x3a2c96[_0x5958('0x63')]=![];}if(_0x3a2c96[_0x5958('0x37')]){_0x3a2c96[_0x5958('0x63')]=![];}else{_0x3a2c96[_0x5958('0x38')]=null;}if(!_0x575562[_0x5958('0x37')])_0x575562['CloudProviderId']=null;_0x1718af[_0x5958('0x60')][_0x5958('0x3d')]=_0x575562;_0x1718af[_0x5958('0x60')]['Smtp']=_0x3a2c96;return db[_0x5958('0x45')]['find']({'where':{'id':_0x1718af['params']['id']},'include':[{'model':db[_0x5958('0x40')],'as':_0x5958('0x3d')},{'model':db[_0x5958('0x41')],'as':_0x5958('0x3e')},{'model':db['Pause'],'as':_0x5958('0x43')}]})[_0x5958('0xb')](handleEntityNotFound(_0x1dccb4,null))['then'](function(_0x521cc5){if(!_0x521cc5)throw new Error('Mail\x20Account\x20not\x20found');if(_0x521cc5['service'])delete _0x1718af[_0x5958('0x60')]['Imap'];return _0x521cc5;})[_0x5958('0xb')](saveUpdates(_0x1718af[_0x5958('0x60')],null))[_0x5958('0xb')](function(_0x365bb8){if(!_0x1718af['body']['Imap'])return _0x365bb8;return db[_0x5958('0x40')]['update'](_0x1718af[_0x5958('0x60')]['Imap'],{'where':{'MailAccountId':_0x365bb8['id']}})[_0x5958('0xb')](function(){return _0x365bb8;});})[_0x5958('0xb')](function(_0x3fbc76){if(!_0x1718af[_0x5958('0x60')]['Smtp'])return _0x3fbc76;return db[_0x5958('0x41')][_0x5958('0x1f')](_0x1718af['body'][_0x5958('0x3e')],{'where':{'MailAccountId':_0x3fbc76['id']}})[_0x5958('0xb')](function(){return _0x3fbc76;});})[_0x5958('0xb')](respondWithResult(_0x1dccb4,null))[_0x5958('0x14')](handleError(_0x1dccb4,null));};exports[_0x5958('0x64')]=function(_0x57685f,_0x1c2032){return db[_0x5958('0x45')][_0x5958('0x64')]()['then'](respondWithResult(_0x1c2032,null))['catch'](handleError(_0x1c2032,null));};exports[_0x5958('0x65')]=function(_0x15b8ea,_0x3934aa){if(_0x15b8ea[_0x5958('0x60')]['id']){delete _0x15b8ea[_0x5958('0x60')]['id'];}return db[_0x5958('0x45')][_0x5958('0x66')]({'where':{'id':_0x15b8ea['params']['id']}})[_0x5958('0xb')](handleEntityNotFound(_0x3934aa,null))[_0x5958('0xb')](function(_0x265c52){if(_0x265c52){_0x15b8ea[_0x5958('0x60')][_0x5958('0x67')]=_0x265c52['id'];return db['Disposition'][_0x5958('0x68')](_0x15b8ea[_0x5958('0x60')]);}})[_0x5958('0xb')](respondWithResult(_0x3934aa,null))['catch'](handleError(_0x3934aa,null));};exports['getDispositions']=function(_0x23d18d,_0x2dd4a6){var _0x212831={'raw':![],'where':{}};var _0x387971={};var _0x93eac5={'count':0x0,'rows':[]};return db[_0x5958('0x45')][_0x5958('0x69')]({'where':{'id':_0x23d18d[_0x5958('0x5e')]['id']}})[_0x5958('0xb')](handleEntityNotFound(_0x2dd4a6,null))['then'](function(_0x199f67){if(_0x199f67){_0x387971[_0x5958('0x4c')]=_[_0x5958('0x5f')](db[_0x5958('0x6a')][_0x5958('0x46')]);_0x387971[_0x5958('0x49')]=_['keys'](_0x23d18d[_0x5958('0x49')]);_0x387971[_0x5958('0x4a')]=_['intersection'](_0x387971['model'],_0x387971[_0x5958('0x49')]);_0x212831['attributes']=_[_0x5958('0x4b')](_0x387971[_0x5958('0x4c')],qs[_0x5958('0x4e')](_0x23d18d[_0x5958('0x49')]['fields']));_0x212831[_0x5958('0x4d')]=_0x212831[_0x5958('0x4d')]['length']?_0x212831['attributes']:_0x387971[_0x5958('0x4c')];if(!_0x23d18d[_0x5958('0x49')][_0x5958('0x50')](_0x5958('0x51'))){_0x212831['limit']=qs['limit'](_0x23d18d['query']['limit']);_0x212831[_0x5958('0x1b')]=qs['offset'](_0x23d18d[_0x5958('0x49')][_0x5958('0x1b')]);}_0x212831[_0x5958('0x52')]=qs[_0x5958('0x53')](_0x23d18d['query']['sort']);_0x212831['where']=qs['filters'](_[_0x5958('0x54')](_0x23d18d[_0x5958('0x49')],_0x387971[_0x5958('0x4a')]));_0x212831[_0x5958('0x56')]['MailAccountId']=_0x199f67['id'];if(_0x23d18d[_0x5958('0x49')][_0x5958('0x55')]){_0x212831[_0x5958('0x56')]=_[_0x5958('0x57')](_0x212831[_0x5958('0x56')],{'$or':_[_0x5958('0x44')](_0x212831['attributes'],function(_0x5232cc){var _0x4d749a={};_0x4d749a[_0x5232cc]={'$like':'%'+_0x23d18d['query'][_0x5958('0x55')]+'%'};return _0x4d749a;})});}_0x212831=_[_0x5958('0x57')]({},_0x212831,_0x23d18d[_0x5958('0x58')]);return db[_0x5958('0x6a')][_0x5958('0x1a')]({'where':_0x212831['where']})[_0x5958('0xb')](function(_0x4d46df){_0x93eac5[_0x5958('0x1a')]=_0x4d46df;if(_0x23d18d[_0x5958('0x49')][_0x5958('0x59')]){_0x212831[_0x5958('0x5a')]=[{'all':!![]}];}return db[_0x5958('0x6a')][_0x5958('0x5b')](_0x212831);})[_0x5958('0xb')](function(_0x7a0ca7){_0x93eac5[_0x5958('0x5c')]=_0x7a0ca7;return _0x93eac5;});}})[_0x5958('0xb')](respondWithFilteredResult(_0x2dd4a6,_0x212831))[_0x5958('0x14')](handleError(_0x2dd4a6,null));};exports[_0x5958('0x6b')]=function(_0x522428,_0x16a43b){return db[_0x5958('0x45')][_0x5958('0x66')]({'where':{'id':_0x522428[_0x5958('0x5e')]['id']}})[_0x5958('0xb')](handleEntityNotFound(_0x16a43b,null))[_0x5958('0xb')](function(_0x325005){if(_0x325005){return _0x325005[_0x5958('0x6b')](_0x522428[_0x5958('0x49')][_0x5958('0x6c')]);}})['then'](respondWithStatusCode(_0x16a43b,null))[_0x5958('0x14')](handleError(_0x16a43b,null));};exports[_0x5958('0x6d')]=function(_0x260fc4,_0x547884){if(_0x260fc4['body']['id']){delete _0x260fc4[_0x5958('0x60')]['id'];}return db[_0x5958('0x45')]['find']({'where':{'id':_0x260fc4['params']['id']}})[_0x5958('0xb')](handleEntityNotFound(_0x547884,null))[_0x5958('0xb')](function(_0x6ff123){if(_0x6ff123){_0x260fc4[_0x5958('0x60')]['MailAccountId']=_0x6ff123['id'];return db[_0x5958('0x6e')][_0x5958('0x68')](_0x260fc4[_0x5958('0x60')]);}})[_0x5958('0xb')](respondWithResult(_0x547884,null))[_0x5958('0x14')](handleError(_0x547884,null));};exports[_0x5958('0x6f')]=function(_0x57cbf3,_0x5f569b){var _0x1a1a17={'raw':![],'where':{}};var _0x5ef3fc={};var _0x50c6b8={'count':0x0,'rows':[]};return db[_0x5958('0x45')][_0x5958('0x69')]({'where':{'id':_0x57cbf3[_0x5958('0x5e')]['id']}})[_0x5958('0xb')](handleEntityNotFound(_0x5f569b,null))[_0x5958('0xb')](function(_0x5a0dc0){if(_0x5a0dc0){_0x5ef3fc[_0x5958('0x4c')]=_[_0x5958('0x5f')](db[_0x5958('0x6e')]['rawAttributes']);_0x5ef3fc[_0x5958('0x49')]=_['keys'](_0x57cbf3[_0x5958('0x49')]);_0x5ef3fc[_0x5958('0x4a')]=_[_0x5958('0x4b')](_0x5ef3fc[_0x5958('0x4c')],_0x5ef3fc[_0x5958('0x49')]);_0x1a1a17[_0x5958('0x4d')]=_[_0x5958('0x4b')](_0x5ef3fc[_0x5958('0x4c')],qs[_0x5958('0x4e')](_0x57cbf3[_0x5958('0x49')][_0x5958('0x4e')]));_0x1a1a17[_0x5958('0x4d')]=_0x1a1a17[_0x5958('0x4d')][_0x5958('0x4f')]?_0x1a1a17[_0x5958('0x4d')]:_0x5ef3fc[_0x5958('0x4c')];if(!_0x57cbf3[_0x5958('0x49')][_0x5958('0x50')]('nolimit')){_0x1a1a17[_0x5958('0x19')]=qs['limit'](_0x57cbf3[_0x5958('0x49')][_0x5958('0x19')]);_0x1a1a17[_0x5958('0x1b')]=qs[_0x5958('0x1b')](_0x57cbf3[_0x5958('0x49')][_0x5958('0x1b')]);}_0x1a1a17[_0x5958('0x52')]=qs[_0x5958('0x53')](_0x57cbf3[_0x5958('0x49')]['sort']);_0x1a1a17[_0x5958('0x56')]=qs[_0x5958('0x4a')](_[_0x5958('0x54')](_0x57cbf3['query'],_0x5ef3fc['filters']));_0x1a1a17[_0x5958('0x56')][_0x5958('0x67')]=_0x5a0dc0['id'];if(_0x57cbf3[_0x5958('0x49')][_0x5958('0x55')]){_0x1a1a17['where']=_['merge'](_0x1a1a17[_0x5958('0x56')],{'$or':_[_0x5958('0x44')](_0x1a1a17[_0x5958('0x4d')],function(_0x558e67){var _0x44070a={};_0x44070a[_0x558e67]={'$like':'%'+_0x57cbf3[_0x5958('0x49')][_0x5958('0x55')]+'%'};return _0x44070a;})});}_0x1a1a17=_[_0x5958('0x57')]({},_0x1a1a17,_0x57cbf3[_0x5958('0x58')]);return db[_0x5958('0x6e')]['count']({'where':_0x1a1a17[_0x5958('0x56')]})[_0x5958('0xb')](function(_0x375d3d){_0x50c6b8[_0x5958('0x1a')]=_0x375d3d;if(_0x57cbf3[_0x5958('0x49')][_0x5958('0x59')]){_0x1a1a17[_0x5958('0x5a')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x1a1a17);})[_0x5958('0xb')](function(_0x1347e8){_0x50c6b8[_0x5958('0x5c')]=_0x1347e8;return _0x50c6b8;});}})[_0x5958('0xb')](respondWithFilteredResult(_0x5f569b,_0x1a1a17))['catch'](handleError(_0x5f569b,null));};exports[_0x5958('0x70')]=function(_0x1cb537,_0x481499){return db['MailAccount']['find']({'where':{'id':_0x1cb537[_0x5958('0x5e')]['id']}})[_0x5958('0xb')](handleEntityNotFound(_0x481499,null))[_0x5958('0xb')](function(_0x119293){if(_0x119293){return _0x119293['removeAnswers'](_0x1cb537['query'][_0x5958('0x6c')]);}})[_0x5958('0xb')](respondWithStatusCode(_0x481499,null))[_0x5958('0x14')](handleError(_0x481499,null));};exports[_0x5958('0x68')]=function(_0x5e5f0b,_0x9b5455){var _0x5bcc6a={'name':_0x5e5f0b[_0x5958('0x60')]['name'],'key':_0x5e5f0b['body'][_0x5958('0x71')],'provider':_0x5e5f0b[_0x5958('0x60')]['provider']===_0x5958('0x62')?null:_0x5e5f0b['body'][_0x5958('0x61')],'email':_0x5e5f0b[_0x5958('0x60')]['email'],'ListId':_0x5e5f0b[_0x5958('0x60')]['ListId'],'active':!_['isNil'](_0x5e5f0b['body']['active'])?_0x5e5f0b['body'][_0x5958('0x72')]:!![],'description':_0x5e5f0b[_0x5958('0x60')]['description']||null};var _0x349451=getAuthenticationOptions(_0x5bcc6a['provider'],_0x5e5f0b[_0x5958('0x60')]);_0x5bcc6a['Imap']=_0x349451[_0x5958('0x3d')];_0x5bcc6a['Smtp']=_0x349451['Smtp'];return db[_0x5958('0x45')][_0x5958('0x68')](_0x5bcc6a,{'include':[{'model':db[_0x5958('0x41')],'as':_0x5958('0x3e')},{'model':db['MailServerIn'],'as':'Imap'}]})[_0x5958('0xb')](function(_0x2eee92){var _0x18147a=_0x5e5f0b['user'][_0x5958('0x21')]({'plain':!![]});if(!_0x18147a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x18147a[_0x5958('0x73')]==='user'){var _0x43fc1b=_0x2eee92[_0x5958('0x21')]({'plain':!![]});return db[_0x5958('0x74')]['find']({'where':{'name':_0x5958('0x22'),'userProfileId':_0x18147a['userProfileId']},'raw':!![]})[_0x5958('0xb')](function(_0x1b7db2){if(_0x1b7db2&&_0x1b7db2[_0x5958('0x75')]===0x0){return db[_0x5958('0x23')][_0x5958('0x68')]({'name':_0x43fc1b['name'],'resourceId':_0x43fc1b['id'],'type':_0x1b7db2[_0x5958('0x25')],'sectionId':_0x1b7db2['id']},{})[_0x5958('0xb')](function(){return _0x2eee92;});}else{return _0x2eee92;}})[_0x5958('0x14')](function(_0x3cf209){logger[_0x5958('0x11')](_0x5958('0x76'),_0x3cf209);throw _0x3cf209;});}return _0x2eee92;})[_0x5958('0xb')](respondWithResult(_0x9b5455,0xc9))['catch'](handleError(_0x9b5455,null));};exports[_0x5958('0x77')]=function(_0x2fdac2,_0x395e5f){return db['MailAccount'][_0x5958('0x69')]({'where':{'id':_0x2fdac2['params']['id']}})[_0x5958('0xb')](handleEntityNotFound(_0x395e5f,null))[_0x5958('0xb')](function(_0x5436c3){if(_0x5436c3){return _0x5436c3[_0x5958('0x77')]();}return null;})['then'](respondWithResult(_0x395e5f,null))[_0x5958('0x14')](handleError(_0x395e5f,null));};exports['addImap']=function(_0x2498ff,_0x17e2ef){if(_0x2498ff['body']['id']){delete _0x2498ff[_0x5958('0x60')]['id'];}return db[_0x5958('0x45')][_0x5958('0x66')]({'where':{'id':_0x2498ff['params']['id']}})['then'](handleEntityNotFound(_0x17e2ef,null))[_0x5958('0xb')](function(_0x1d1c1f){if(_0x1d1c1f){_0x2498ff[_0x5958('0x60')][_0x5958('0x67')]=_0x1d1c1f['id'];return db[_0x5958('0x40')]['create'](_0x2498ff[_0x5958('0x60')]);}})[_0x5958('0xb')](respondWithResult(_0x17e2ef,null))['catch'](handleError(_0x17e2ef,null));};exports[_0x5958('0x78')]=function(_0x3718fa,_0x22b2e3){return db[_0x5958('0x45')][_0x5958('0x69')]({'where':{'id':_0x3718fa[_0x5958('0x5e')]['id']}})[_0x5958('0xb')](handleEntityNotFound(_0x22b2e3,null))[_0x5958('0xb')](function(_0x79959a){if(_0x79959a){return _0x79959a['setImap'](null);}return null;})[_0x5958('0xb')](respondWithStatusCode(_0x22b2e3,null))[_0x5958('0x14')](handleError(_0x22b2e3,null));};exports[_0x5958('0x79')]=function(_0x19ddeb,_0x4c170a){return db['MailAccount']['findOne']({'where':{'id':_0x19ddeb[_0x5958('0x5e')]['id']}})[_0x5958('0xb')](handleEntityNotFound(_0x4c170a,null))[_0x5958('0xb')](function(_0x48c298){if(_0x48c298){return _0x48c298[_0x5958('0x79')]();}return null;})['then'](respondWithResult(_0x4c170a,null))[_0x5958('0x14')](handleError(_0x4c170a,null));};exports[_0x5958('0x7a')]=function(_0x3b69c5,_0x22567a){if(_0x3b69c5[_0x5958('0x60')]['id']){delete _0x3b69c5['body']['id'];}return db['MailAccount'][_0x5958('0x66')]({'where':{'id':_0x3b69c5[_0x5958('0x5e')]['id']}})[_0x5958('0xb')](handleEntityNotFound(_0x22567a,null))[_0x5958('0xb')](function(_0x113498){if(_0x113498){_0x3b69c5['body']['MailAccountId']=_0x113498['id'];return db[_0x5958('0x41')][_0x5958('0x68')](_0x3b69c5[_0x5958('0x60')]);}})[_0x5958('0xb')](respondWithResult(_0x22567a,null))[_0x5958('0x14')](handleError(_0x22567a,null));};exports[_0x5958('0x7b')]=function(_0x28696a,_0x596e73){return db['MailAccount'][_0x5958('0x69')]({'where':{'id':_0x28696a[_0x5958('0x5e')]['id']}})[_0x5958('0xb')](handleEntityNotFound(_0x596e73,null))[_0x5958('0xb')](function(_0x217168){if(_0x217168){return _0x217168[_0x5958('0x7c')](null);}return null;})[_0x5958('0xb')](respondWithStatusCode(_0x596e73,null))['catch'](handleError(_0x596e73,null));};exports[_0x5958('0x7d')]=function(_0x3ba7b9,_0x2ddc0d){return db[_0x5958('0x7e')]['find']({'where':{'id':_0x3ba7b9['params']['id']}})[_0x5958('0xb')](handleEntityNotFound(_0x2ddc0d,null))[_0x5958('0xb')](function(_0x1d9a75){if(_0x1d9a75){return _0x1d9a75['addInteraction'](_0x3ba7b9[_0x5958('0x60')]['ids'],_[_0x5958('0x7f')](_0x3ba7b9[_0x5958('0x60')],['ids','id'])||{});}})[_0x5958('0xb')](respondWithResult(_0x2ddc0d,null))[_0x5958('0x14')](handleError(_0x2ddc0d,null));};exports[_0x5958('0x80')]=function(_0x5de85f,_0x3fb360){var _0x55b5f4={'raw':![],'where':{}};var _0xd253e0={};var _0x5436fc={'count':0x0,'rows':[]};return db[_0x5958('0x45')]['findOne']({'where':{'id':_0x5de85f[_0x5958('0x5e')]['id']}})[_0x5958('0xb')](handleEntityNotFound(_0x3fb360,null))[_0x5958('0xb')](function(_0x39c061){if(_0x39c061){_0xd253e0[_0x5958('0x4c')]=_['keys'](db['MailInteraction'][_0x5958('0x46')]);_0xd253e0[_0x5958('0x49')]=_[_0x5958('0x5f')](_0x5de85f[_0x5958('0x49')]);_0xd253e0['filters']=_[_0x5958('0x4b')](_0xd253e0[_0x5958('0x4c')],_0xd253e0[_0x5958('0x49')]);_0x55b5f4[_0x5958('0x4d')]=_[_0x5958('0x4b')](_0xd253e0[_0x5958('0x4c')],qs[_0x5958('0x4e')](_0x5de85f[_0x5958('0x49')][_0x5958('0x4e')]));_0x55b5f4[_0x5958('0x4d')]=_0x55b5f4[_0x5958('0x4d')][_0x5958('0x4f')]?_0x55b5f4[_0x5958('0x4d')]:_0xd253e0[_0x5958('0x4c')];if(!_0x5de85f[_0x5958('0x49')][_0x5958('0x50')](_0x5958('0x51'))){_0x55b5f4[_0x5958('0x19')]=qs[_0x5958('0x19')](_0x5de85f['query'][_0x5958('0x19')]);_0x55b5f4['offset']=qs[_0x5958('0x1b')](_0x5de85f['query'][_0x5958('0x1b')]);}_0x55b5f4[_0x5958('0x52')]=qs[_0x5958('0x53')](_0x5de85f['query'][_0x5958('0x53')]);_0x55b5f4[_0x5958('0x56')]=qs[_0x5958('0x4a')](_[_0x5958('0x54')](_0x5de85f[_0x5958('0x49')],_0xd253e0[_0x5958('0x4a')]));_0x55b5f4[_0x5958('0x56')][_0x5958('0x67')]=_0x39c061['id'];if(_0x5de85f[_0x5958('0x49')][_0x5958('0x55')]){_0x55b5f4[_0x5958('0x56')]=_[_0x5958('0x57')](_0x55b5f4[_0x5958('0x56')],{'$or':_[_0x5958('0x44')](_0x55b5f4['attributes'],function(_0x1dc2f9){var _0x3d2782={};_0x3d2782[_0x1dc2f9]={'$like':'%'+_0x5de85f[_0x5958('0x49')][_0x5958('0x55')]+'%'};return _0x3d2782;})});}_0x55b5f4=_[_0x5958('0x57')]({},_0x55b5f4,_0x5de85f[_0x5958('0x58')]);return db[_0x5958('0x7e')]['count']({'where':_0x55b5f4[_0x5958('0x56')]})[_0x5958('0xb')](function(_0x3aa042){_0x5436fc['count']=_0x3aa042;if(_0x5de85f[_0x5958('0x49')]['includeAll']){_0x55b5f4[_0x5958('0x5a')]=[{'model':db[_0x5958('0x81')],'as':_0x5958('0x82'),'required':![]},{'model':db[_0x5958('0x83')],'as':_0x5958('0x84'),'attributes':['name',_0x5958('0x85'),_0x5958('0x86')],'required':![]},{'model':db[_0x5958('0x87')],'as':_0x5958('0x88'),'attributes':['id',_0x5958('0x25'),'color'],'where':_0x5de85f[_0x5958('0x49')][_0x5958('0x89')]?{'id':_0x5de85f['query'][_0x5958('0x89')]}:undefined,'required':_0x5de85f[_0x5958('0x49')][_0x5958('0x89')]?!![]:![]}];}return db[_0x5958('0x7e')]['findAll'](_0x55b5f4);})[_0x5958('0xb')](function(_0x23630b){_0x5436fc[_0x5958('0x5c')]=_0x23630b;return _0x5436fc;});}})[_0x5958('0xb')](respondWithFilteredResult(_0x3fb360,_0x55b5f4))[_0x5958('0x14')](handleError(_0x3fb360,null));};exports[_0x5958('0x8a')]=function addApplications(_0xe1fc65,_0x151ca9){var _0x2de351=_0xe1fc65[_0x5958('0x5e')]['id'];var _0x4d2eae=_0xe1fc65[_0x5958('0x60')];var _0x30c0a6=0xc8;var _0x5b1fd8=null;return db[_0x5958('0x8b')][_0x5958('0x8c')]({'isolationLevel':db['sequelize'][_0x5958('0x8d')][_0x5958('0x8e')][_0x5958('0x8f')]},function(_0x248e81){return db['MailAccount']['findOne']({'where':{'id':_0x2de351},'transaction':_0x248e81})[_0x5958('0xb')](function(_0x166462){if(_0x166462){return db[_0x5958('0x90')][_0x5958('0x20')]({'where':{'MailAccountId':_0x2de351},'transaction':_0x248e81})[_0x5958('0xb')](function(){var _0x1b37ec=_[_0x5958('0x44')](_0x4d2eae,function(_0x4e1d25){_0x4e1d25[_0x5958('0x67')]=_0x2de351;return _0x4e1d25;});return db[_0x5958('0x90')]['bulkCreate'](_0x1b37ec,{'transaction':_0x248e81});});}else{_0x30c0a6=0x194;_0x5b1fd8=[];}});})[_0x5958('0xb')](function(){if(_0x30c0a6!==0x194){return db['MailApplication'][_0x5958('0x91')]({'where':{'MailAccountId':_0x2de351},'order':'priority'})[_0x5958('0xb')](function(_0x4bb4e6){_0x5b1fd8=_0x4bb4e6;});}})[_0x5958('0x14')](function(_0x8234bd){_0x30c0a6=0x1f4;logger[_0x5958('0x11')](_0x8234bd['stack']);if(_0x8234bd['name']){delete _0x8234bd[_0x5958('0x25')];}_0x5b1fd8=_0x8234bd;})[_0x5958('0x92')](function(){if(_0x5b1fd8===null){_0x151ca9[_0x5958('0x15')](_0x30c0a6);}else{if(_0x30c0a6===0x1f4){_0x151ca9['status'](_0x30c0a6)[_0x5958('0x26')](_0x5b1fd8);}else{_0x151ca9['status'](_0x30c0a6)[_0x5958('0x1e')](_0x5b1fd8);}}});};exports[_0x5958('0x93')]=function(_0x76f83e,_0x2dc246){var _0x2ac0ac={};var _0x493a26={};var _0x1d34c7;var _0x5f36d4;return db[_0x5958('0x45')][_0x5958('0x69')]({'where':{'id':_0x76f83e[_0x5958('0x5e')]['id']}})[_0x5958('0xb')](handleEntityNotFound(_0x2dc246,null))['then'](function(_0x24f73a){if(_0x24f73a){_0x1d34c7=_0x24f73a;_0x493a26['model']=_['keys'](db[_0x5958('0x90')][_0x5958('0x46')]);_0x493a26['query']=_[_0x5958('0x5f')](_0x76f83e[_0x5958('0x49')]);_0x493a26[_0x5958('0x4a')]=_[_0x5958('0x4b')](_0x493a26[_0x5958('0x4c')],_0x493a26[_0x5958('0x49')]);_0x2ac0ac['attributes']=_[_0x5958('0x4b')](_0x493a26[_0x5958('0x4c')],qs[_0x5958('0x4e')](_0x76f83e[_0x5958('0x49')][_0x5958('0x4e')]));_0x2ac0ac['attributes']=_0x2ac0ac[_0x5958('0x4d')][_0x5958('0x4f')]?_0x2ac0ac[_0x5958('0x4d')]:_0x493a26[_0x5958('0x4c')];_0x2ac0ac[_0x5958('0x52')]=qs[_0x5958('0x53')](_0x76f83e[_0x5958('0x49')][_0x5958('0x53')]);_0x2ac0ac['where']=qs['filters'](_['pick'](_0x76f83e[_0x5958('0x49')],_0x493a26[_0x5958('0x4a')]));if(_0x76f83e[_0x5958('0x49')]['filter']){_0x2ac0ac[_0x5958('0x56')]=_[_0x5958('0x57')](_0x2ac0ac[_0x5958('0x56')],{'$or':_[_0x5958('0x44')](_0x2ac0ac[_0x5958('0x4d')],function(_0x2eb183){var _0x5a9588={};_0x5a9588[_0x2eb183]={'$like':'%'+_0x76f83e[_0x5958('0x49')]['filter']+'%'};return _0x5a9588;})});}_0x2ac0ac=_[_0x5958('0x57')]({},_0x2ac0ac,_0x76f83e['options']);return _0x1d34c7[_0x5958('0x93')](_0x2ac0ac);}})[_0x5958('0xb')](function(_0x562f68){if(_0x562f68){_0x5f36d4=_0x562f68['length'];if(!_0x76f83e[_0x5958('0x49')][_0x5958('0x50')](_0x5958('0x51'))){_0x2ac0ac[_0x5958('0x19')]=qs[_0x5958('0x19')](_0x76f83e[_0x5958('0x49')]['limit']);_0x2ac0ac['offset']=qs['offset'](_0x76f83e['query'][_0x5958('0x1b')]);}return _0x1d34c7[_0x5958('0x93')](_0x2ac0ac);}})[_0x5958('0xb')](function(_0x748d89){if(_0x748d89){return _0x748d89?{'count':_0x5f36d4,'rows':_0x748d89}:null;}})[_0x5958('0xb')](respondWithResult(_0x2dc246,null))[_0x5958('0x14')](handleError(_0x2dc246,null));};exports[_0x5958('0x94')]=function(_0x370ccc,_0x85cd81){var _0xb16086={'raw':!![],'where':{}};var _0x3ee9e5={};var _0x34a60d={'count':0x0,'rows':[]};return db[_0x5958('0x45')][_0x5958('0x69')]({'where':{'id':_0x370ccc[_0x5958('0x5e')]['id']}})[_0x5958('0xb')](handleEntityNotFound(_0x85cd81,null))[_0x5958('0xb')](function(_0x22c23c){if(_0x22c23c){_0x3ee9e5[_0x5958('0x4c')]=_[_0x5958('0x5f')](db[_0x5958('0x95')][_0x5958('0x46')]);_0x3ee9e5[_0x5958('0x49')]=_['keys'](_0x370ccc['query']);_0x3ee9e5[_0x5958('0x4a')]=_[_0x5958('0x4b')](_0x3ee9e5[_0x5958('0x4c')],_0x3ee9e5[_0x5958('0x49')]);_0xb16086['attributes']=_[_0x5958('0x4b')](_0x3ee9e5['model'],qs[_0x5958('0x4e')](_0x370ccc[_0x5958('0x49')]['fields']));_0xb16086[_0x5958('0x4d')]=_0xb16086['attributes'][_0x5958('0x4f')]?_0xb16086['attributes']:_0x3ee9e5['model'];if(!_0x370ccc[_0x5958('0x49')][_0x5958('0x50')](_0x5958('0x51'))){_0xb16086[_0x5958('0x19')]=qs[_0x5958('0x19')](_0x370ccc[_0x5958('0x49')][_0x5958('0x19')]);_0xb16086[_0x5958('0x1b')]=qs[_0x5958('0x1b')](_0x370ccc[_0x5958('0x49')]['offset']);}_0xb16086['order']=qs[_0x5958('0x53')](_0x370ccc[_0x5958('0x49')]['sort']);_0xb16086['where']=qs['filters'](_[_0x5958('0x54')](_0x370ccc['query'],_0x3ee9e5[_0x5958('0x4a')]));_0xb16086[_0x5958('0x56')][_0x5958('0x67')]=_0x22c23c['id'];if(_0x370ccc[_0x5958('0x49')][_0x5958('0x55')]){_0xb16086[_0x5958('0x56')]=_[_0x5958('0x57')](_0xb16086[_0x5958('0x56')],{'$or':_[_0x5958('0x44')](_0xb16086[_0x5958('0x4d')],function(_0x43440d){var _0x2a1a55={};_0x2a1a55[_0x43440d]={'$like':'%'+_0x370ccc['query'][_0x5958('0x55')]+'%'};return _0x2a1a55;})});}if(_0x370ccc['query'][_0x5958('0x96')]){var _0xb70172=_0x370ccc[_0x5958('0x49')][_0x5958('0x96')][_0x5958('0x97')](',');var _0x5cd132={};_0x5cd132[_0xb70172[0x0]]={'$gte':moment(_0xb70172[0x1])[_0x5958('0x98')](_0x5958('0x99'))};_0xb16086[_0x5958('0x56')]=_[_0x5958('0x57')](_0xb16086[_0x5958('0x56')],_0x5cd132);}_0xb16086=_[_0x5958('0x57')]({},_0xb16086,_0x370ccc[_0x5958('0x58')]);return db[_0x5958('0x95')]['count']({'where':_0xb16086[_0x5958('0x56')]})['then'](function(_0x474e45){_0x34a60d[_0x5958('0x1a')]=_0x474e45;if(_0x370ccc[_0x5958('0x49')][_0x5958('0x59')]){_0xb16086['include']=[{'all':!![]}];}return db[_0x5958('0x95')][_0x5958('0x5b')](_0xb16086);})[_0x5958('0xb')](function(_0x15b328){if(_0x370ccc[_0x5958('0x49')][_0x5958('0x9a')]===_0x5958('0x9b')){for(var _0x1a769a=0x0;_0x1a769a<_0x15b328[_0x5958('0x4f')];_0x1a769a++){_0x15b328[_0x1a769a]['body']=juice(_0x15b328[_0x1a769a][_0x5958('0x60')]);}}_0x34a60d[_0x5958('0x5c')]=_0x15b328;return _0x34a60d;});}})[_0x5958('0xb')](respondWithFilteredResult(_0x85cd81,_0xb16086))[_0x5958('0x14')](handleError(_0x85cd81,null));};exports[_0x5958('0x26')]=function(_0x26cba2,_0x313ff0){var _0x252ab3,_0x349c3d={},_0x55f960;if(_0x26cba2[_0x5958('0x60')]['to']){_0x55f960=_0x26cba2[_0x5958('0x60')]['to']['split'](',')[0x0];}return db[_0x5958('0x45')][_0x5958('0x66')]({'where':{'id':_0x26cba2[_0x5958('0x5e')]['id']},'include':[{'model':db[_0x5958('0x9c')],'as':_0x5958('0x9d'),'include':[{'model':db[_0x5958('0x81')],'as':_0x5958('0x9e'),'where':{'email':_0x55f960},'limit':0x1,'order':[[_0x5958('0x9f'),_0x5958('0xa0')]]}]},{'model':db[_0x5958('0x41')],'as':_0x5958('0x3e'),'raw':!![],'include':[{'model':db[_0x5958('0xa1')],'as':_0x5958('0xa1'),'raw':!![]}]}]})['then'](handleEntityNotFound(_0x313ff0,null))[_0x5958('0xb')](function(_0x3282b8){if(!_0x3282b8)return;_0x252ab3=_0x3282b8;if(!_0x3282b8[_0x5958('0x3e')])throw new Error(_0x5958('0xa2'));if(_[_0x5958('0xa3')](_0x26cba2[_0x5958('0x60')][_0x5958('0xa4')])){_0x26cba2[_0x5958('0x60')][_0x5958('0xa4')]=util['format'](_0x5958('0xa5'),_0x3282b8['name'],_0x3282b8[_0x5958('0xa6')]||_0x3282b8[_0x5958('0x3e')][_0x5958('0x33')]);}if(_0x26cba2[_0x5958('0x60')]['attachments']&&_0x26cba2[_0x5958('0x60')][_0x5958('0xa7')][_0x5958('0x4f')]){for(var _0x4337e7=0x0;_0x4337e7<_0x26cba2[_0x5958('0x60')][_0x5958('0xa7')][_0x5958('0x4f')];_0x4337e7+=0x1){_0x26cba2[_0x5958('0x60')]['attachments'][_0x4337e7]={'filename':_0x26cba2[_0x5958('0x60')][_0x5958('0xa7')][_0x4337e7][_0x5958('0x25')],'path':path['join'](config[_0x5958('0xa8')],_0x5958('0xa9'),_0x26cba2[_0x5958('0x60')][_0x5958('0xa7')][_0x4337e7][_0x5958('0xaa')])};}}var _0x466300=_0x3282b8[_0x5958('0xab')]();return respondWithRpcPromise(_0x5958('0xac'),_0x5958('0xad'),{'account':_0x466300,'message':_0x26cba2['body']});})['then'](function(_0x571960){if(!_0x571960)return;_0x349c3d=_0x571960;if(!_0x252ab3[_0x5958('0x9d')])throw new Error(_0x5958('0xae'));if(_0x252ab3[_0x5958('0x9d')][_0x5958('0x9e')][_0x5958('0x4f')])return _0x252ab3[_0x5958('0x9d')][_0x5958('0x9e')][0x0];return db[_0x5958('0x81')][_0x5958('0x68')](_[_0x5958('0x5')](_0x26cba2[_0x5958('0x60')],{'firstName':_0x26cba2[_0x5958('0x60')]['to'],'email':_0x26cba2[_0x5958('0x60')]['to'],'phone':_0x26cba2['body']['to'],'ListId':_0x252ab3[_0x5958('0xaf')]}));})[_0x5958('0xb')](function(_0x3ef0d6){if(!_0x3ef0d6)return;var _0x412220={'UserId':_0x26cba2[_0x5958('0x33')]['id'],'ContactId':_0x3ef0d6['id'],'MailAccountId':_0x252ab3['id'],'inReplyTo':_0x349c3d[_0x5958('0xb0')],'to':_0x26cba2['body'][_0x5958('0xa4')],'cc':_0x26cba2[_0x5958('0x60')]['cc'],'subject':_0x26cba2['body'][_0x5958('0xb1')],'attach':_0x26cba2[_0x5958('0x60')][_0x5958('0xb2')],'firstMsgDirection':_0x5958('0xb3'),'lastMsgAt':moment()[_0x5958('0x98')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':_0x5958('0xb3'),'Messages':[_['merge'](_0x26cba2[_0x5958('0x60')],{'messageId':_0x349c3d['messageId'],'sentAt':moment()[_0x5958('0x98')](_0x5958('0x99')),'read':!![],'MailAccountId':_0x252ab3['id'],'UserId':_0x26cba2[_0x5958('0x33')]['id'],'ContactId':_0x3ef0d6['id']})]};if(_0x26cba2['body']['Interaction']){_0x412220=_[_0x5958('0x57')](_0x412220,_0x26cba2[_0x5958('0x60')][_0x5958('0xb4')]);}return db[_0x5958('0x7e')]['create'](_0x412220,{'include':[{'model':db[_0x5958('0x95')],'as':_0x5958('0xb5')}]});})[_0x5958('0xb')](respondWithResult(_0x313ff0,null))['catch'](handleError(_0x313ff0,null));};exports[_0x5958('0xb6')]=function(_0x2618cd,_0x21c46d){return db[_0x5958('0x45')]['find']({'where':{'id':_0x2618cd[_0x5958('0x5e')]['id']},'include':[{'model':db['MailServerOut'],'as':_0x5958('0x3e'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':'CloudProvider','raw':!![]}]}]})['then'](handleEntityNotFound(_0x21c46d,null))[_0x5958('0xb')](function(_0x4d5ff5){if(!_0x4d5ff5[_0x5958('0x3e')])return;var _0x19ee91=_0x4d5ff5[_0x5958('0xab')]();return respondWithRpcPromise(_0x5958('0xb7'),_0x5958('0xb6'),{'account':_0x19ee91});})[_0x5958('0xb')](respondWithResult(_0x21c46d,null))[_0x5958('0x14')](handleError(_0x21c46d,null));};exports[_0x5958('0x20')]=function(_0x3cc345,_0x326681){return db[_0x5958('0x45')][_0x5958('0x66')]({'where':{'id':_0x3cc345['params']['id']}})[_0x5958('0xb')](handleEntityNotFound(_0x326681,null))['then'](function(_0x3ab34){if(_0x3ab34&&_0x3ab34[_0x5958('0x3b')]){throw new db[(_0x5958('0xb8'))][(_0x5958('0xb9'))]('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x3ab34;})[_0x5958('0xb')](removeEntity(_0x326681,null))[_0x5958('0x14')](handleError(_0x326681,null));};exports[_0x5958('0xba')]=function(_0x4013b9,_0x2e7c65){return db[_0x5958('0x45')]['find']({'where':{'id':_0x4013b9[_0x5958('0x5e')]['id']}})['then'](handleEntityNotFound(_0x2e7c65,null))[_0x5958('0xb')](function(_0x1b1630){if(_0x1b1630){return _0x1b1630[_0x5958('0xba')](_0x4013b9[_0x5958('0x60')][_0x5958('0x6c')],_['omit'](_0x4013b9[_0x5958('0x60')],[_0x5958('0x6c'),'id'])||{})[_0x5958('0xbb')](function(_0x504d09){for(var _0x4018f0=0x0;_0x4018f0<_0x4013b9['body'][_0x5958('0x6c')]['length'];_0x4018f0+=0x1){socket[_0x5958('0xbc')](_0x5958('0xbd'),{'UserId':Number(_0x4013b9[_0x5958('0x60')]['ids'][_0x4018f0]),'MailAccountId':Number(_0x4013b9['params']['id'])});}return _0x504d09;});}})[_0x5958('0xb')](respondWithResult(_0x2e7c65,null))['catch'](handleError(_0x2e7c65,null));};exports[_0x5958('0xbe')]=function(_0x280d0e,_0x54cf65){return db['MailAccount'][_0x5958('0x66')]({'where':{'id':_0x280d0e['params']['id']}})[_0x5958('0xb')](handleEntityNotFound(_0x54cf65,null))['then'](function(_0x416aa9){if(_0x416aa9){return _0x416aa9[_0x5958('0xbe')](_0x280d0e['query'][_0x5958('0x6c')])[_0x5958('0xb')](function(){if(_[_0x5958('0xbf')](_0x280d0e[_0x5958('0x49')][_0x5958('0x6c')])){for(var _0x481d65=0x0;_0x481d65<_0x280d0e[_0x5958('0x49')][_0x5958('0x6c')][_0x5958('0x4f')];_0x481d65+=0x1){socket[_0x5958('0xbc')](_0x5958('0xc0'),{'UserId':Number(_0x280d0e[_0x5958('0x49')][_0x5958('0x6c')][_0x481d65]),'MailAccountId':Number(_0x280d0e['params']['id'])});}}else{socket[_0x5958('0xbc')](_0x5958('0xc0'),{'UserId':Number(_0x280d0e[_0x5958('0x49')][_0x5958('0x6c')]),'MailAccountId':Number(_0x280d0e['params']['id'])});}});}})[_0x5958('0xb')](respondWithStatusCode(_0x54cf65,null))[_0x5958('0x14')](handleError(_0x54cf65,null));};exports[_0x5958('0xc1')]=function(_0x1d059d,_0x31bf81){var _0x43bf01={};var _0x47ee44={};var _0x4a5aa7;var _0x18c5cf;return db['MailAccount'][_0x5958('0x69')]({'where':{'id':_0x1d059d[_0x5958('0x5e')]['id']}})[_0x5958('0xb')](handleEntityNotFound(_0x31bf81,null))[_0x5958('0xb')](function(_0x24b6bb){if(_0x24b6bb){_0x4a5aa7=_0x24b6bb;_0x47ee44['model']=_['keys'](db[_0x5958('0x83')]['rawAttributes']);_0x47ee44[_0x5958('0x49')]=_[_0x5958('0x5f')](_0x1d059d['query']);_0x47ee44[_0x5958('0x4a')]=_[_0x5958('0x4b')](_0x47ee44[_0x5958('0x4c')],_0x47ee44[_0x5958('0x49')]);_0x43bf01['attributes']=_['intersection'](_0x47ee44['model'],qs['fields'](_0x1d059d[_0x5958('0x49')][_0x5958('0x4e')]));_0x43bf01[_0x5958('0x4d')]=_0x43bf01[_0x5958('0x4d')]['length']?_0x43bf01[_0x5958('0x4d')]:_0x47ee44[_0x5958('0x4c')];_0x43bf01[_0x5958('0x52')]=qs[_0x5958('0x53')](_0x1d059d['query'][_0x5958('0x53')]);_0x43bf01[_0x5958('0x56')]=qs[_0x5958('0x4a')](_[_0x5958('0x54')](_0x1d059d[_0x5958('0x49')],_0x47ee44['filters']));if(_0x1d059d[_0x5958('0x49')][_0x5958('0x55')]){_0x43bf01[_0x5958('0x56')]=_[_0x5958('0x57')](_0x43bf01[_0x5958('0x56')],{'$or':_[_0x5958('0x44')](_0x43bf01['attributes'],function(_0x26b38b){var _0x48be27={};_0x48be27[_0x26b38b]={'$like':'%'+_0x1d059d['query']['filter']+'%'};return _0x48be27;})});}_0x43bf01=_[_0x5958('0x57')]({},_0x43bf01,_0x1d059d['options']);return _0x4a5aa7[_0x5958('0xc1')](_0x43bf01);}})[_0x5958('0xb')](function(_0xa3d687){if(_0xa3d687){_0x18c5cf=_0xa3d687[_0x5958('0x4f')];if(!_0x1d059d['query'][_0x5958('0x50')](_0x5958('0x51'))){_0x43bf01[_0x5958('0x19')]=qs[_0x5958('0x19')](_0x1d059d[_0x5958('0x49')][_0x5958('0x19')]);_0x43bf01['offset']=qs[_0x5958('0x1b')](_0x1d059d[_0x5958('0x49')][_0x5958('0x1b')]);}return _0x4a5aa7['getAgents'](_0x43bf01);}})['then'](function(_0x9afa8b){if(_0x9afa8b){return _0x9afa8b?{'count':_0x18c5cf,'rows':_0x9afa8b}:null;}})[_0x5958('0xb')](respondWithResult(_0x31bf81,null))[_0x5958('0x14')](handleError(_0x31bf81,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index e7e003d..e0043b0 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 _0x6efe=['MailAccount','setMaxListeners','save','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0x6efe,0xc6));var _0xe6ef=function(_0x20fb50,_0x44a748){_0x20fb50=_0x20fb50-0x0;var _0x351ac7=_0x6efe[_0x20fb50];return _0x351ac7;};'use strict';var EventEmitter=require(_0xe6ef('0x0'));var MailAccount=require(_0xe6ef('0x1'))['db'][_0xe6ef('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xe6ef('0x3')](0x0);var events={'afterCreate':_0xe6ef('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x6bb796){return function(_0x17ed3a,_0x340687,_0x40c086){MailAccountEvents[_0xe6ef('0x5')](_0x6bb796+':'+_0x17ed3a['id'],_0x17ed3a);MailAccountEvents['emit'](_0x6bb796,_0x17ed3a);_0x40c086(null);};}for(var e in events){if(events[_0xe6ef('0x6')](e)){var event=events[e];MailAccount[_0xe6ef('0x7')](e,emitEvent(event));}}module['exports']=MailAccountEvents; \ No newline at end of file +var _0xcac3=['hasOwnProperty','hook','exports','../../mysqldb','MailAccount','setMaxListeners','save','update','remove','emit'];(function(_0x4196bd,_0xdc31ac){var _0x170b43=function(_0x200ef0){while(--_0x200ef0){_0x4196bd['push'](_0x4196bd['shift']());}};_0x170b43(++_0xdc31ac);}(_0xcac3,0x193));var _0x3cac=function(_0x27a1a0,_0x32380c){_0x27a1a0=_0x27a1a0-0x0;var _0x38cf5c=_0xcac3[_0x27a1a0];return _0x38cf5c;};'use strict';var EventEmitter=require('events');var MailAccount=require(_0x3cac('0x0'))['db'][_0x3cac('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x3cac('0x2')](0x0);var events={'afterCreate':_0x3cac('0x3'),'afterUpdate':_0x3cac('0x4'),'afterDestroy':_0x3cac('0x5')};function emitEvent(_0x40033c){return function(_0xce6bcd,_0x2d7790,_0x346c24){MailAccountEvents[_0x3cac('0x6')](_0x40033c+':'+_0xce6bcd['id'],_0xce6bcd);MailAccountEvents[_0x3cac('0x6')](_0x40033c,_0xce6bcd);_0x346c24(null);};}for(var e in events){if(events[_0x3cac('0x7')](e)){var event=events[e];MailAccount[_0x3cac('0x8')](e,emitEvent(event));}}module[_0x3cac('0x9')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index 6413320..c0e8b5e 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 _0xe5ba=['define','MailAccount','mail_accounts','provider','custom','service','host','Smtp','port','secure','authentication','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','auth','OAuth2','user','./mailAccount.attributes','exports'];(function(_0x155d87,_0x388244){var _0x228e49=function(_0x20ef15){while(--_0x20ef15){_0x155d87['push'](_0x155d87['shift']());}};_0x228e49(++_0x388244);}(_0xe5ba,0x130));var _0xae5b=function(_0x1d9d53,_0x4a16ad){_0x1d9d53=_0x1d9d53-0x0;var _0x7f6e16=_0xe5ba[_0x1d9d53];return _0x7f6e16;};'use strict';var attributes=require(_0xae5b('0x0'));module[_0xae5b('0x1')]=function(_0x43a23c){return _0x43a23c[_0xae5b('0x2')](_0xae5b('0x3'),attributes,{'tableName':_0xae5b('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x3eca8b=this;var _0x3870a1={'id':_0x3eca8b['id'],'tls':{'rejectUnauthorized':![]}};if(_0x3eca8b[_0xae5b('0x5')]!==_0xae5b('0x6')){_0x3870a1[_0xae5b('0x7')]=_0x3eca8b['provider'];}else{_0x3870a1[_0xae5b('0x8')]=_0x3eca8b[_0xae5b('0x9')]['host'];_0x3870a1[_0xae5b('0xa')]=_0x3eca8b[_0xae5b('0x9')][_0xae5b('0xa')];_0x3870a1[_0xae5b('0xb')]=_0x3eca8b[_0xae5b('0x9')][_0xae5b('0xb')];}if(_0x3eca8b[_0xae5b('0x9')][_0xae5b('0xc')]){if(_0x3eca8b[_0xae5b('0x9')]['modernAuthentication']){if(!_0x3eca8b['Smtp'][_0xae5b('0xd')])throw new Error(_0xae5b('0xe'));_0x3870a1[_0xae5b('0xf')]={'type':_0xae5b('0x10'),'user':_0x3eca8b['Smtp'][_0xae5b('0x11')],'accessToken':_0x3eca8b['Smtp'][_0xae5b('0xd')]['data5']};}else{_0x3870a1['auth']={'user':_0x3eca8b[_0xae5b('0x9')]['user'],'pass':_0x3eca8b[_0xae5b('0x9')]['pass']};}}return _0x3870a1;}}});}; \ No newline at end of file +var _0x2624=['host','port','secure','authentication','modernAuthentication','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','auth','OAuth2','user','pass','exports','define','MailAccount','mail_accounts','provider','custom','service','Smtp'];(function(_0x5904fb,_0x16fccf){var _0x57b287=function(_0x2f88e1){while(--_0x2f88e1){_0x5904fb['push'](_0x5904fb['shift']());}};_0x57b287(++_0x16fccf);}(_0x2624,0x90));var _0x4262=function(_0x30a84e,_0x36d779){_0x30a84e=_0x30a84e-0x0;var _0xe600fa=_0x2624[_0x30a84e];return _0xe600fa;};'use strict';var attributes=require('./mailAccount.attributes');module[_0x4262('0x0')]=function(_0xfd2105){return _0xfd2105[_0x4262('0x1')](_0x4262('0x2'),attributes,{'tableName':_0x4262('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x148d32=this;var _0x2e3d89={'id':_0x148d32['id'],'tls':{'rejectUnauthorized':![]}};if(_0x148d32[_0x4262('0x4')]!==_0x4262('0x5')){_0x2e3d89[_0x4262('0x6')]=_0x148d32[_0x4262('0x4')];}else{_0x2e3d89['host']=_0x148d32[_0x4262('0x7')][_0x4262('0x8')];_0x2e3d89[_0x4262('0x9')]=_0x148d32['Smtp'][_0x4262('0x9')];_0x2e3d89[_0x4262('0xa')]=_0x148d32[_0x4262('0x7')][_0x4262('0xa')];}if(_0x148d32[_0x4262('0x7')][_0x4262('0xb')]){if(_0x148d32[_0x4262('0x7')][_0x4262('0xc')]){if(!_0x148d32[_0x4262('0x7')][_0x4262('0xd')])throw new Error(_0x4262('0xe'));_0x2e3d89[_0x4262('0xf')]={'type':_0x4262('0x10'),'user':_0x148d32['Smtp'][_0x4262('0x11')],'accessToken':_0x148d32[_0x4262('0x7')][_0x4262('0xd')]['data5']};}else{_0x2e3d89['auth']={'user':_0x148d32[_0x4262('0x7')][_0x4262('0x11')],'pass':_0x148d32['Smtp'][_0x4262('0x12')]};}}return _0x2e3d89;}}});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index cf73ce1..52ffdb4 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 _0x8ca9=['autoclose','push','length','close','*,*,*,*','create','List\x20not\x20found','contact','messageId','generate','attach','MailInteraction','MailMessage','Messages','inReplyTo','Contact\x20not\x20found','spread','update','subject','format','YYYY-MM-DD\x20HH:mm:ss','interaction','created','attachments','originTo','bcc','Email','ChatOfflineMessageId','Attachments','UserId','User','name','unshift','agent','waitForTheAssignedAgent','queueId','MailQueue','queue','waitForTheAssignedQueue','Start','startRouting','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./mailAccount.socket','register','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMailAccount','MailAccount','findAll','raw','options','limit','include','map','model','attributes','debug','ShowMailAccount','find','where','setDataValue','smtpOptions','getSmtpOptions','NotifyMailAccount','body','mail','difference','keys','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','account','CmList','List','CmContact','Contacts','DESC','MailApplication','Applications','MailServerOut','CloudProvider','get','omit','list','applications','priority','asc'];(function(_0x504949,_0x386585){var _0x3358c6=function(_0x4634a7){while(--_0x4634a7){_0x504949['push'](_0x504949['shift']());}};_0x3358c6(++_0x386585);}(_0x8ca9,0x9c));var _0x98ca=function(_0x155a50,_0x11d8b6){_0x155a50=_0x155a50-0x0;var _0x42ddb9=_0x8ca9[_0x155a50];return _0x42ddb9;};'use strict';var _=require(_0x98ca('0x0'));var moment=require(_0x98ca('0x1'));var BPromise=require(_0x98ca('0x2'));var rs=require(_0x98ca('0x3'));var Redis=require(_0x98ca('0x4'));var db=require(_0x98ca('0x5'))['db'];var logger=require(_0x98ca('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x98ca('0x7'));var client=jayson['client'][_0x98ca('0x8')]({'port':0x232c});config['redis']=_[_0x98ca('0x9')](config[_0x98ca('0xa')],{'host':_0x98ca('0xb'),'port':0x18eb});var socket=require(_0x98ca('0xc'))(new Redis(config[_0x98ca('0xa')]));require(_0x98ca('0xd'))[_0x98ca('0xe')](socket);function respondWithRpcPromise(_0x210234,_0x277c29,_0x404cc1){return new BPromise(function(_0x572858,_0x2074fb){return client[_0x98ca('0xf')](_0x210234,_0x404cc1)[_0x98ca('0x10')](function(_0x220a97){logger[_0x98ca('0x11')](_0x98ca('0x12'),_0x277c29,_0x98ca('0x13'));logger['debug'](_0x98ca('0x14'),_0x277c29,_0x98ca('0x13'),JSON[_0x98ca('0x15')](_0x220a97));if(_0x220a97[_0x98ca('0x16')]){if(_0x220a97['error'][_0x98ca('0x17')]===0x1f4){logger[_0x98ca('0x16')](_0x98ca('0x12'),_0x277c29,_0x220a97[_0x98ca('0x16')][_0x98ca('0x18')]);return _0x2074fb(_0x220a97[_0x98ca('0x16')][_0x98ca('0x18')]);}logger['error'](_0x98ca('0x12'),_0x277c29,_0x220a97[_0x98ca('0x16')][_0x98ca('0x18')]);return _0x572858(_0x220a97[_0x98ca('0x16')]['message']);}else{logger[_0x98ca('0x11')](_0x98ca('0x12'),_0x277c29,_0x98ca('0x13'));_0x572858(_0x220a97[_0x98ca('0x19')][_0x98ca('0x18')]);}})[_0x98ca('0x1a')](function(_0x28c8a6){logger[_0x98ca('0x16')](_0x98ca('0x12'),_0x277c29,_0x28c8a6);_0x2074fb(_0x28c8a6);});});}exports[_0x98ca('0x1b')]=function(_0x1b2c69){var _0x4806a3=this;return new Promise(function(_0x626b37,_0x49298d){return db[_0x98ca('0x1c')][_0x98ca('0x1d')]({'raw':_0x1b2c69['options']?_0x1b2c69['options'][_0x98ca('0x1e')]===undefined?!![]:![]:!![],'where':_0x1b2c69[_0x98ca('0x1f')]?_0x1b2c69[_0x98ca('0x1f')]['where']||null:null,'attributes':_0x1b2c69[_0x98ca('0x1f')]?_0x1b2c69[_0x98ca('0x1f')]['attributes']||null:null,'limit':_0x1b2c69[_0x98ca('0x1f')]?_0x1b2c69['options'][_0x98ca('0x20')]||null:null,'include':_0x1b2c69[_0x98ca('0x1f')]?_0x1b2c69[_0x98ca('0x1f')][_0x98ca('0x21')]?_[_0x98ca('0x22')](_0x1b2c69[_0x98ca('0x1f')][_0x98ca('0x21')],function(_0x50b1a2){return{'model':db[_0x50b1a2[_0x98ca('0x23')]],'as':_0x50b1a2['as'],'attributes':_0x50b1a2['attributes'],'include':_0x50b1a2[_0x98ca('0x21')]?_[_0x98ca('0x22')](_0x50b1a2['include'],function(_0x1f569b){return{'model':db[_0x1f569b['model']],'as':_0x1f569b['as'],'attributes':_0x1f569b[_0x98ca('0x24')],'include':_0x1f569b['include']?_['map'](_0x1f569b[_0x98ca('0x21')],function(_0x540f45){return{'model':db[_0x540f45[_0x98ca('0x23')]],'as':_0x540f45['as'],'attributes':_0x540f45[_0x98ca('0x24')]};}):[]};}):[]};}):[]:[]})[_0x98ca('0x10')](function(_0x21a12a){logger[_0x98ca('0x11')](_0x98ca('0x1b'),_0x1b2c69);logger[_0x98ca('0x25')](_0x98ca('0x1b'),_0x1b2c69,JSON[_0x98ca('0x15')](_0x21a12a));_0x626b37(_0x21a12a);})['catch'](function(_0x2ebf28){logger['error'](_0x98ca('0x1b'),_0x2ebf28[_0x98ca('0x18')],_0x1b2c69);_0x49298d(_0x4806a3['error'](0x1f4,_0x2ebf28['message']));});});};exports[_0x98ca('0x26')]=function(_0x4b37b4){var _0x3990d7=this;return new Promise(function(_0x4f1622,_0x2aaf39){return db['MailAccount'][_0x98ca('0x27')]({'raw':_0x4b37b4[_0x98ca('0x1f')]?_0x4b37b4['options'][_0x98ca('0x1e')]===undefined?!![]:![]:!![],'where':_0x4b37b4[_0x98ca('0x1f')]?_0x4b37b4['options'][_0x98ca('0x28')]||null:null,'attributes':_0x4b37b4[_0x98ca('0x1f')]?_0x4b37b4['options'][_0x98ca('0x24')]||null:null,'include':_0x4b37b4[_0x98ca('0x1f')]?_0x4b37b4[_0x98ca('0x1f')][_0x98ca('0x21')]?_[_0x98ca('0x22')](_0x4b37b4['options'][_0x98ca('0x21')],function(_0x430a37){return{'model':db[_0x430a37['model']],'as':_0x430a37['as'],'attributes':_0x430a37[_0x98ca('0x24')],'include':_0x430a37[_0x98ca('0x21')]?_[_0x98ca('0x22')](_0x430a37['include'],function(_0x1ef3ff){return{'model':db[_0x1ef3ff[_0x98ca('0x23')]],'as':_0x1ef3ff['as'],'attributes':_0x1ef3ff[_0x98ca('0x24')],'include':_0x1ef3ff['include']?_[_0x98ca('0x22')](_0x1ef3ff[_0x98ca('0x21')],function(_0x10cbe0){return{'model':db[_0x10cbe0['model']],'as':_0x10cbe0['as'],'attributes':_0x10cbe0['attributes']};}):[]};}):[]};}):[]:[]})[_0x98ca('0x10')](function(_0xe77d02){if(_0x4b37b4[_0x98ca('0x1f')]['smtp']===!![])_0xe77d02[_0x98ca('0x29')](_0x98ca('0x2a'),_0xe77d02[_0x98ca('0x2b')]());logger['info'](_0x98ca('0x26'),_0x4b37b4);logger[_0x98ca('0x25')](_0x98ca('0x26'),_0x4b37b4,JSON[_0x98ca('0x15')](_0xe77d02));_0x4f1622(_0xe77d02);})[_0x98ca('0x1a')](function(_0x5d924c){logger['error']('ShowMailAccount',_0x5d924c[_0x98ca('0x18')],_0x4b37b4);_0x2aaf39(_0x3990d7[_0x98ca('0x16')](0x1f4,_0x5d924c[_0x98ca('0x18')]));});});};exports[_0x98ca('0x2c')]=function(_0x43ba26){var _0xda0db1=this;return new Promise(function(_0x29801f,_0x570afe){var _0x4900ed={'body':_0x43ba26[_0x98ca('0x2d')],'channel':_0x98ca('0x2e')};var _0x31424f=_[_0x98ca('0x2f')](_[_0x98ca('0x30')](db['CmContact']['rawAttributes']),['createdAt',_0x98ca('0x31'),_0x98ca('0x32'),_0x98ca('0x33')]);var _0x3f260b=![];if(_0x43ba26['body']['id']){delete _0x43ba26['body']['id'];}if(_[_0x98ca('0x34')](_0x43ba26[_0x98ca('0x2d')][_0x98ca('0x35')])){return _0x570afe(_0xda0db1[_0x98ca('0x16')](0x1f4,_0x98ca('0x36')));}if(_[_0x98ca('0x34')](_0x43ba26[_0x98ca('0x2d')][_0x98ca('0x2d')])||_0x43ba26[_0x98ca('0x2d')][_0x98ca('0x2d')]===''){return _0x570afe(_0xda0db1[_0x98ca('0x16')](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x98ca('0x34')](_0x43ba26[_0x98ca('0x2d')][_0x98ca('0x37')])){return _0x570afe(_0xda0db1[_0x98ca('0x16')](0x1f4,_0x98ca('0x38')+_0x31424f));}if(!_[_0x98ca('0x39')](_0x31424f,_0x43ba26[_0x98ca('0x2d')][_0x98ca('0x37')])){return _0x570afe(_0xda0db1[_0x98ca('0x16')](0x1f4,'mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x31424f));}var _0x2a4d0a={};_0x2a4d0a[_0x43ba26[_0x98ca('0x2d')]['mapKey']]=_0x43ba26[_0x98ca('0x2d')]['from'];return db[_0x98ca('0x1c')][_0x98ca('0x27')]({'where':{'id':_0x43ba26[_0x98ca('0x3a')]['id']},'include':[{'model':db[_0x98ca('0x3b')],'as':_0x98ca('0x3c'),'include':[{'model':db[_0x98ca('0x3d')],'as':_0x98ca('0x3e'),'where':_0x2a4d0a,'limit':0x1,'order':[[_0x98ca('0x31'),_0x98ca('0x3f')]]}]},{'model':db[_0x98ca('0x40')],'as':_0x98ca('0x41')},{'model':db[_0x98ca('0x42')],'as':'Smtp','include':[{'model':db[_0x98ca('0x43')],'as':_0x98ca('0x43')}]}]})[_0x98ca('0x10')](function(_0x19dc39){if(_0x19dc39&&_0x19dc39['List']){var _0xec9f92=_0x19dc39[_0x98ca('0x44')]({'plain':!![]});_0x4900ed[_0x98ca('0x3a')]=_[_0x98ca('0x45')](_0xec9f92,[_0x98ca('0x41'),_0x98ca('0x3c')]);_0x4900ed[_0x98ca('0x3a')]['smtpOptions']=_0x19dc39['getSmtpOptions']();_0x4900ed['applications']=_0xec9f92[_0x98ca('0x41')];_0x4900ed[_0x98ca('0x46')]=_0xec9f92[_0x98ca('0x3c')];_0x4900ed[_0x98ca('0x47')]=_['orderBy'](_0x4900ed['applications'],[_0x98ca('0x48')],[_0x98ca('0x49')]);if(_0x4900ed[_0x98ca('0x3a')]&&_0x4900ed[_0x98ca('0x3a')][_0x98ca('0x4a')]){_0x4900ed[_0x98ca('0x47')][_0x98ca('0x4b')]({'id':0x0,'priority':_0x4900ed[_0x98ca('0x47')][_0x98ca('0x4c')]+0x1,'app':_0x98ca('0x4d'),'appdata':_0x98ca('0x4a'),'interval':_0x98ca('0x4e')});}if(_0x4900ed[_0x98ca('0x3a')]['Applications']){delete _0x4900ed[_0x98ca('0x3a')]['Applications'];}if(_0x4900ed[_0x98ca('0x3a')][_0x98ca('0x3c')]){delete _0x4900ed[_0x98ca('0x3a')][_0x98ca('0x3c')];}if(_0xec9f92[_0x98ca('0x3c')]['Contacts'][_0x98ca('0x4c')]){return _0xec9f92[_0x98ca('0x3c')]['Contacts'][0x0];}var _0x19473e=_[_0x98ca('0x9')](_0x43ba26[_0x98ca('0x2d')],{'firstName':_0x43ba26['body'][_0x98ca('0x35')],'ListId':_0xec9f92[_0x98ca('0x33')]});_0x19473e[_0x43ba26['body'][_0x98ca('0x37')]]=_0x43ba26[_0x98ca('0x2d')][_0x98ca('0x35')];return db[_0x98ca('0x3d')][_0x98ca('0x4f')](_0x19473e);}else{throw new Error(_0x98ca('0x50'));}})[_0x98ca('0x10')](function(_0x594d82){_0x4900ed[_0x98ca('0x51')]=_0x594d82;if(_0x594d82){if(!_0x43ba26[_0x98ca('0x2d')][_0x98ca('0x18')]['messageId']){_0x43ba26['body'][_0x98ca('0x18')][_0x98ca('0x52')]=rs[_0x98ca('0x53')]()+'\x20'+_0x43ba26[_0x98ca('0x2d')][_0x98ca('0x18')][_0x98ca('0x35')];}var _0x3dc32e={'ContactId':_0x594d82['id'],'MailAccountId':_0x43ba26[_0x98ca('0x3a')]['id'],'inReplyTo':_0x43ba26['body'][_0x98ca('0x18')]['messageId'],'to':_0x43ba26['body'][_0x98ca('0x18')][_0x98ca('0x35')],'cc':_0x43ba26[_0x98ca('0x2d')][_0x98ca('0x18')]['cc'],'subject':_0x43ba26[_0x98ca('0x2d')][_0x98ca('0x18')]['subject'],'attach':_0x43ba26[_0x98ca('0x2d')][_0x98ca('0x18')][_0x98ca('0x54')],'lastMsgAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'};return db[_0x98ca('0x55')][_0x98ca('0x27')]({'where':{'closed':![],'MailAccountId':_0x43ba26[_0x98ca('0x3a')]['id']},'include':[{'model':db[_0x98ca('0x56')],'as':_0x98ca('0x57'),'attributes':[_0x98ca('0x52')],'where':{'messageId':_0x43ba26[_0x98ca('0x2d')][_0x98ca('0x18')][_0x98ca('0x58')]}}]})[_0x98ca('0x10')](function(_0x40c799){if(_0x40c799){return[_0x40c799,![]];}return db[_0x98ca('0x55')]['create'](_0x3dc32e)[_0x98ca('0x10')](function(_0xb7b30e){return[_0xb7b30e,!![]];});});}else{throw new Error(_0x98ca('0x59'));}})[_0x98ca('0x5a')](function(_0x1082f4,_0x23344b){if(_0x1082f4){_0x3f260b=_0x23344b;if(!_0x23344b){return _0x1082f4[_0x98ca('0x5b')]({'inReplyTo':_0x43ba26[_0x98ca('0x2d')][_0x98ca('0x18')]['messageId'],'to':_0x43ba26[_0x98ca('0x2d')][_0x98ca('0x18')][_0x98ca('0x35')],'cc':_0x43ba26['body'][_0x98ca('0x18')]['cc'],'subject':_0x43ba26[_0x98ca('0x2d')][_0x98ca('0x18')][_0x98ca('0x5c')],'attach':_0x1082f4[_0x98ca('0x54')]?_0x1082f4['attach']:_0x43ba26[_0x98ca('0x2d')][_0x98ca('0x18')]['attach'],'substatus':null,'substatusAt':moment()[_0x98ca('0x5d')](_0x98ca('0x5e')),'lastMsgAt':moment()[_0x98ca('0x5d')](_0x98ca('0x5e')),'lastMsgDirection':'in'});}else{return _0x1082f4;}}})[_0x98ca('0x10')](function(_0x20fcc9){_0x4900ed['interaction']=_0x20fcc9[_0x98ca('0x44')]({'plain':!![]});_0x4900ed[_0x98ca('0x5f')][_0x98ca('0x60')]=_0x3f260b;return db[_0x98ca('0x56')]['create']({'body':_0x43ba26[_0x98ca('0x2d')][_0x98ca('0x2d')],'MailAccountId':_0x43ba26['account']['id'],'MailInteractionId':_0x20fcc9['id'],'direction':'in','ContactId':_0x4900ed[_0x98ca('0x51')]['id'],'messageId':_0x43ba26[_0x98ca('0x2d')]['message'][_0x98ca('0x52')],'from':_0x43ba26[_0x98ca('0x2d')][_0x98ca('0x18')][_0x98ca('0x35')],'to':_0x43ba26[_0x98ca('0x2d')][_0x98ca('0x18')]['to'],'cc':_0x43ba26['body'][_0x98ca('0x18')]['cc'],'subject':_0x43ba26[_0x98ca('0x2d')][_0x98ca('0x18')][_0x98ca('0x5c')],'attach':_0x43ba26[_0x98ca('0x2d')][_0x98ca('0x18')][_0x98ca('0x54')],'Attachments':_0x43ba26['body'][_0x98ca('0x18')][_0x98ca('0x61')],'originTo':_0x43ba26[_0x98ca('0x2d')]['message'][_0x98ca('0x62')],'originCc':_0x43ba26[_0x98ca('0x2d')][_0x98ca('0x18')]['originCc'],'bcc':_0x43ba26[_0x98ca('0x2d')][_0x98ca('0x18')][_0x98ca('0x63')],'ChatWebsiteId':_0x43ba26[_0x98ca('0x2d')][_0x98ca('0x18')]['ChatWebsiteId']||null,'originChannel':_0x43ba26['body'][_0x98ca('0x18')]['originChannel']||_0x98ca('0x64'),'ChatOfflineMessageId':_0x43ba26[_0x98ca('0x2d')][_0x98ca('0x18')][_0x98ca('0x65')]||null},{'include':[{'model':db['Attachment'],'as':_0x98ca('0x66')}]});})[_0x98ca('0x10')](function(_0x55c8c3){_0x4900ed[_0x98ca('0x18')]=_0x55c8c3;if(!_0x4900ed[_0x98ca('0x5f')][_0x98ca('0x67')]){return;}return db[_0x98ca('0x68')][_0x98ca('0x27')]({'attributes':['id',_0x98ca('0x69')],'where':{'id':_0x4900ed[_0x98ca('0x5f')][_0x98ca('0x67')]}});})[_0x98ca('0x10')](function(_0x13114b){if(_0x13114b){_0x4900ed[_0x98ca('0x47')][_0x98ca('0x6a')]({'id':0x0,'priority':0x0,'app':_0x98ca('0x6b'),'appdata':_0x13114b[_0x98ca('0x69')]+','+(_0x4900ed[_0x98ca('0x3a')][_0x98ca('0x6c')]||0xa),'interval':_0x98ca('0x4e')});}if(!_0x4900ed[_0x98ca('0x5f')][_0x98ca('0x6d')]){return;}return db[_0x98ca('0x6e')][_0x98ca('0x27')]({'attributes':['id','name'],'where':{'id':_0x4900ed[_0x98ca('0x5f')][_0x98ca('0x6d')]}});})['then'](function(_0x34c7b7){if(_0x34c7b7){_0x4900ed[_0x98ca('0x47')]['unshift']({'id':0x0,'priority':0x1,'app':_0x98ca('0x6f'),'appdata':_0x34c7b7['name']+','+(_0x4900ed[_0x98ca('0x3a')][_0x98ca('0x70')]||0x12c),'interval':_0x98ca('0x4e')});}return respondWithRpcPromise(_0x98ca('0x71'),_0x98ca('0x72'),_0x4900ed);})['then'](function(_0x54975d){_0x29801f(_0x54975d);})[_0x98ca('0x1a')](function(_0x3f1057){_0x570afe(_0xda0db1[_0x98ca('0x16')](0x1f4,_0x3f1057[_0x98ca('0x18')]));});});}; \ No newline at end of file +var _0xa630=['MailAccount','setDataValue','smtpOptions','getSmtpOptions','NotifyMailAccount','body','mail','difference','keys','CmContact','rawAttributes','createdAt','updatedAt','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','List','Contacts','DESC','MailApplication','Applications','Smtp','CloudProvider','get','omit','list','applications','orderBy','priority','asc','autoclose','push','length','close','*,*,*,*','defaults','create','contact','messageId','generate','attach','format','MailInteraction','MailMessage','Messages','inReplyTo','Contact\x20not\x20found','spread','update','subject','YYYY-MM-DD\x20HH:mm:ss','interaction','created','originTo','originCc','bcc','ChatWebsiteId','ChatOfflineMessageId','Attachment','Attachments','User','name','UserId','unshift','waitForTheAssignedAgent','queueId','MailQueue','queue','waitForTheAssignedQueue','startRouting','lodash','moment','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./mailAccount.socket','register','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMailAccount','findAll','options','raw','attributes','limit','include','map','model','debug','ShowMailAccount'];(function(_0x21aec3,_0x5c97e9){var _0x288bbc=function(_0x2283fe){while(--_0x2283fe){_0x21aec3['push'](_0x21aec3['shift']());}};_0x288bbc(++_0x5c97e9);}(_0xa630,0xbe));var _0x0a63=function(_0x1f4adc,_0xba4637){_0x1f4adc=_0x1f4adc-0x0;var _0x468373=_0xa630[_0x1f4adc];return _0x468373;};'use strict';var _=require(_0x0a63('0x0'));var moment=require(_0x0a63('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var Redis=require(_0x0a63('0x2'));var db=require('../../mysqldb')['db'];var logger=require(_0x0a63('0x3'))('rpc');var config=require(_0x0a63('0x4'));var jayson=require(_0x0a63('0x5'));var client=jayson[_0x0a63('0x6')][_0x0a63('0x7')]({'port':0x232c});config[_0x0a63('0x8')]=_['defaults'](config[_0x0a63('0x8')],{'host':_0x0a63('0x9'),'port':0x18eb});var socket=require(_0x0a63('0xa'))(new Redis(config[_0x0a63('0x8')]));require(_0x0a63('0xb'))[_0x0a63('0xc')](socket);function respondWithRpcPromise(_0x501a82,_0x688acd,_0xb714c7){return new BPromise(function(_0x2dcbda,_0x218142){return client[_0x0a63('0xd')](_0x501a82,_0xb714c7)[_0x0a63('0xe')](function(_0x207434){logger[_0x0a63('0xf')](_0x0a63('0x10'),_0x688acd,_0x0a63('0x11'));logger['debug'](_0x0a63('0x12'),_0x688acd,_0x0a63('0x11'),JSON[_0x0a63('0x13')](_0x207434));if(_0x207434[_0x0a63('0x14')]){if(_0x207434['error'][_0x0a63('0x15')]===0x1f4){logger['error'](_0x0a63('0x10'),_0x688acd,_0x207434[_0x0a63('0x14')][_0x0a63('0x16')]);return _0x218142(_0x207434[_0x0a63('0x14')][_0x0a63('0x16')]);}logger[_0x0a63('0x14')](_0x0a63('0x10'),_0x688acd,_0x207434[_0x0a63('0x14')]['message']);return _0x2dcbda(_0x207434[_0x0a63('0x14')]['message']);}else{logger[_0x0a63('0xf')](_0x0a63('0x10'),_0x688acd,_0x0a63('0x11'));_0x2dcbda(_0x207434[_0x0a63('0x17')][_0x0a63('0x16')]);}})[_0x0a63('0x18')](function(_0x30f292){logger[_0x0a63('0x14')](_0x0a63('0x10'),_0x688acd,_0x30f292);_0x218142(_0x30f292);});});}exports[_0x0a63('0x19')]=function(_0x2ad167){var _0x4ea56f=this;return new Promise(function(_0x550568,_0x7b2ccd){return db['MailAccount'][_0x0a63('0x1a')]({'raw':_0x2ad167['options']?_0x2ad167[_0x0a63('0x1b')][_0x0a63('0x1c')]===undefined?!![]:![]:!![],'where':_0x2ad167[_0x0a63('0x1b')]?_0x2ad167[_0x0a63('0x1b')]['where']||null:null,'attributes':_0x2ad167[_0x0a63('0x1b')]?_0x2ad167['options'][_0x0a63('0x1d')]||null:null,'limit':_0x2ad167[_0x0a63('0x1b')]?_0x2ad167[_0x0a63('0x1b')][_0x0a63('0x1e')]||null:null,'include':_0x2ad167[_0x0a63('0x1b')]?_0x2ad167[_0x0a63('0x1b')][_0x0a63('0x1f')]?_[_0x0a63('0x20')](_0x2ad167['options']['include'],function(_0x55fb70){return{'model':db[_0x55fb70['model']],'as':_0x55fb70['as'],'attributes':_0x55fb70[_0x0a63('0x1d')],'include':_0x55fb70['include']?_['map'](_0x55fb70[_0x0a63('0x1f')],function(_0x1d5448){return{'model':db[_0x1d5448[_0x0a63('0x21')]],'as':_0x1d5448['as'],'attributes':_0x1d5448[_0x0a63('0x1d')],'include':_0x1d5448['include']?_[_0x0a63('0x20')](_0x1d5448[_0x0a63('0x1f')],function(_0x25ab82){return{'model':db[_0x25ab82['model']],'as':_0x25ab82['as'],'attributes':_0x25ab82[_0x0a63('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x0a63('0xe')](function(_0x1b7bdb){logger[_0x0a63('0xf')](_0x0a63('0x19'),_0x2ad167);logger[_0x0a63('0x22')](_0x0a63('0x19'),_0x2ad167,JSON[_0x0a63('0x13')](_0x1b7bdb));_0x550568(_0x1b7bdb);})['catch'](function(_0x58cc71){logger['error'](_0x0a63('0x19'),_0x58cc71[_0x0a63('0x16')],_0x2ad167);_0x7b2ccd(_0x4ea56f[_0x0a63('0x14')](0x1f4,_0x58cc71[_0x0a63('0x16')]));});});};exports[_0x0a63('0x23')]=function(_0x53a46b){var _0x22a70a=this;return new Promise(function(_0x2884f1,_0x33a717){return db[_0x0a63('0x24')]['find']({'raw':_0x53a46b[_0x0a63('0x1b')]?_0x53a46b[_0x0a63('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x53a46b['options']?_0x53a46b[_0x0a63('0x1b')]['where']||null:null,'attributes':_0x53a46b['options']?_0x53a46b[_0x0a63('0x1b')][_0x0a63('0x1d')]||null:null,'include':_0x53a46b['options']?_0x53a46b[_0x0a63('0x1b')][_0x0a63('0x1f')]?_[_0x0a63('0x20')](_0x53a46b[_0x0a63('0x1b')][_0x0a63('0x1f')],function(_0x4dcacb){return{'model':db[_0x4dcacb['model']],'as':_0x4dcacb['as'],'attributes':_0x4dcacb[_0x0a63('0x1d')],'include':_0x4dcacb[_0x0a63('0x1f')]?_[_0x0a63('0x20')](_0x4dcacb[_0x0a63('0x1f')],function(_0x1c43fc){return{'model':db[_0x1c43fc[_0x0a63('0x21')]],'as':_0x1c43fc['as'],'attributes':_0x1c43fc['attributes'],'include':_0x1c43fc[_0x0a63('0x1f')]?_[_0x0a63('0x20')](_0x1c43fc['include'],function(_0xf9c6ea){return{'model':db[_0xf9c6ea['model']],'as':_0xf9c6ea['as'],'attributes':_0xf9c6ea['attributes']};}):[]};}):[]};}):[]:[]})[_0x0a63('0xe')](function(_0x232388){if(_0x53a46b[_0x0a63('0x1b')]['smtp']===!![])_0x232388[_0x0a63('0x25')](_0x0a63('0x26'),_0x232388[_0x0a63('0x27')]());logger[_0x0a63('0xf')](_0x0a63('0x23'),_0x53a46b);logger[_0x0a63('0x22')](_0x0a63('0x23'),_0x53a46b,JSON['stringify'](_0x232388));_0x2884f1(_0x232388);})[_0x0a63('0x18')](function(_0x1c7e67){logger[_0x0a63('0x14')]('ShowMailAccount',_0x1c7e67['message'],_0x53a46b);_0x33a717(_0x22a70a[_0x0a63('0x14')](0x1f4,_0x1c7e67['message']));});});};exports[_0x0a63('0x28')]=function(_0x1e1aec){var _0x128e9e=this;return new Promise(function(_0x5c7b78,_0x2af987){var _0x14c737={'body':_0x1e1aec[_0x0a63('0x29')],'channel':_0x0a63('0x2a')};var _0x5d94e2=_[_0x0a63('0x2b')](_[_0x0a63('0x2c')](db[_0x0a63('0x2d')][_0x0a63('0x2e')]),[_0x0a63('0x2f'),_0x0a63('0x30'),'CompanyId',_0x0a63('0x31')]);var _0x218729=![];if(_0x1e1aec[_0x0a63('0x29')]['id']){delete _0x1e1aec[_0x0a63('0x29')]['id'];}if(_[_0x0a63('0x32')](_0x1e1aec[_0x0a63('0x29')][_0x0a63('0x33')])){return _0x2af987(_0x128e9e[_0x0a63('0x14')](0x1f4,_0x0a63('0x34')));}if(_[_0x0a63('0x32')](_0x1e1aec[_0x0a63('0x29')][_0x0a63('0x29')])||_0x1e1aec[_0x0a63('0x29')][_0x0a63('0x29')]===''){return _0x2af987(_0x128e9e[_0x0a63('0x14')](0x1f4,_0x0a63('0x35')));}if(_[_0x0a63('0x32')](_0x1e1aec[_0x0a63('0x29')]['mapKey'])){return _0x2af987(_0x128e9e[_0x0a63('0x14')](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5d94e2));}if(!_['includes'](_0x5d94e2,_0x1e1aec[_0x0a63('0x29')][_0x0a63('0x36')])){return _0x2af987(_0x128e9e[_0x0a63('0x14')](0x1f4,_0x0a63('0x37')+_0x5d94e2));}var _0xd9149d={};_0xd9149d[_0x1e1aec[_0x0a63('0x29')][_0x0a63('0x36')]]=_0x1e1aec[_0x0a63('0x29')][_0x0a63('0x33')];return db[_0x0a63('0x24')][_0x0a63('0x38')]({'where':{'id':_0x1e1aec[_0x0a63('0x39')]['id']},'include':[{'model':db[_0x0a63('0x3a')],'as':_0x0a63('0x3b'),'include':[{'model':db[_0x0a63('0x2d')],'as':_0x0a63('0x3c'),'where':_0xd9149d,'limit':0x1,'order':[[_0x0a63('0x30'),_0x0a63('0x3d')]]}]},{'model':db[_0x0a63('0x3e')],'as':_0x0a63('0x3f')},{'model':db['MailServerOut'],'as':_0x0a63('0x40'),'include':[{'model':db[_0x0a63('0x41')],'as':'CloudProvider'}]}]})['then'](function(_0x58e686){if(_0x58e686&&_0x58e686['List']){var _0x36d066=_0x58e686[_0x0a63('0x42')]({'plain':!![]});_0x14c737['account']=_[_0x0a63('0x43')](_0x36d066,['Applications',_0x0a63('0x3b')]);_0x14c737[_0x0a63('0x39')]['smtpOptions']=_0x58e686['getSmtpOptions']();_0x14c737['applications']=_0x36d066[_0x0a63('0x3f')];_0x14c737[_0x0a63('0x44')]=_0x36d066[_0x0a63('0x3b')];_0x14c737[_0x0a63('0x45')]=_[_0x0a63('0x46')](_0x14c737['applications'],[_0x0a63('0x47')],[_0x0a63('0x48')]);if(_0x14c737[_0x0a63('0x39')]&&_0x14c737[_0x0a63('0x39')][_0x0a63('0x49')]){_0x14c737['applications'][_0x0a63('0x4a')]({'id':0x0,'priority':_0x14c737[_0x0a63('0x45')][_0x0a63('0x4b')]+0x1,'app':_0x0a63('0x4c'),'appdata':'autoclose','interval':_0x0a63('0x4d')});}if(_0x14c737[_0x0a63('0x39')][_0x0a63('0x3f')]){delete _0x14c737[_0x0a63('0x39')][_0x0a63('0x3f')];}if(_0x14c737[_0x0a63('0x39')]['List']){delete _0x14c737[_0x0a63('0x39')][_0x0a63('0x3b')];}if(_0x36d066[_0x0a63('0x3b')][_0x0a63('0x3c')]['length']){return _0x36d066['List'][_0x0a63('0x3c')][0x0];}var _0x1f2a59=_[_0x0a63('0x4e')](_0x1e1aec[_0x0a63('0x29')],{'firstName':_0x1e1aec[_0x0a63('0x29')]['from'],'ListId':_0x36d066['ListId']});_0x1f2a59[_0x1e1aec['body'][_0x0a63('0x36')]]=_0x1e1aec['body'][_0x0a63('0x33')];return db[_0x0a63('0x2d')][_0x0a63('0x4f')](_0x1f2a59);}else{throw new Error('List\x20not\x20found');}})['then'](function(_0x2d63c6){_0x14c737[_0x0a63('0x50')]=_0x2d63c6;if(_0x2d63c6){if(!_0x1e1aec[_0x0a63('0x29')][_0x0a63('0x16')][_0x0a63('0x51')]){_0x1e1aec[_0x0a63('0x29')][_0x0a63('0x16')][_0x0a63('0x51')]=rs[_0x0a63('0x52')]()+'\x20'+_0x1e1aec[_0x0a63('0x29')][_0x0a63('0x16')][_0x0a63('0x33')];}var _0x5779c3={'ContactId':_0x2d63c6['id'],'MailAccountId':_0x1e1aec[_0x0a63('0x39')]['id'],'inReplyTo':_0x1e1aec['body']['message'][_0x0a63('0x51')],'to':_0x1e1aec[_0x0a63('0x29')]['message'][_0x0a63('0x33')],'cc':_0x1e1aec[_0x0a63('0x29')]['message']['cc'],'subject':_0x1e1aec[_0x0a63('0x29')][_0x0a63('0x16')]['subject'],'attach':_0x1e1aec['body'][_0x0a63('0x16')][_0x0a63('0x53')],'lastMsgAt':moment()[_0x0a63('0x54')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'};return db[_0x0a63('0x55')][_0x0a63('0x38')]({'where':{'closed':![],'MailAccountId':_0x1e1aec[_0x0a63('0x39')]['id']},'include':[{'model':db[_0x0a63('0x56')],'as':_0x0a63('0x57'),'attributes':['messageId'],'where':{'messageId':_0x1e1aec[_0x0a63('0x29')][_0x0a63('0x16')][_0x0a63('0x58')]}}]})[_0x0a63('0xe')](function(_0x295c06){if(_0x295c06){return[_0x295c06,![]];}return db[_0x0a63('0x55')][_0x0a63('0x4f')](_0x5779c3)['then'](function(_0x4571e7){return[_0x4571e7,!![]];});});}else{throw new Error(_0x0a63('0x59'));}})[_0x0a63('0x5a')](function(_0x1155f1,_0xd52d09){if(_0x1155f1){_0x218729=_0xd52d09;if(!_0xd52d09){return _0x1155f1[_0x0a63('0x5b')]({'inReplyTo':_0x1e1aec[_0x0a63('0x29')][_0x0a63('0x16')]['messageId'],'to':_0x1e1aec['body'][_0x0a63('0x16')][_0x0a63('0x33')],'cc':_0x1e1aec[_0x0a63('0x29')][_0x0a63('0x16')]['cc'],'subject':_0x1e1aec[_0x0a63('0x29')]['message'][_0x0a63('0x5c')],'attach':_0x1155f1[_0x0a63('0x53')]?_0x1155f1[_0x0a63('0x53')]:_0x1e1aec[_0x0a63('0x29')][_0x0a63('0x16')][_0x0a63('0x53')],'substatus':null,'substatusAt':moment()[_0x0a63('0x54')](_0x0a63('0x5d')),'lastMsgAt':moment()[_0x0a63('0x54')](_0x0a63('0x5d')),'lastMsgDirection':'in'});}else{return _0x1155f1;}}})[_0x0a63('0xe')](function(_0x485969){_0x14c737[_0x0a63('0x5e')]=_0x485969['get']({'plain':!![]});_0x14c737[_0x0a63('0x5e')][_0x0a63('0x5f')]=_0x218729;return db['MailMessage']['create']({'body':_0x1e1aec['body'][_0x0a63('0x29')],'MailAccountId':_0x1e1aec[_0x0a63('0x39')]['id'],'MailInteractionId':_0x485969['id'],'direction':'in','ContactId':_0x14c737[_0x0a63('0x50')]['id'],'messageId':_0x1e1aec[_0x0a63('0x29')][_0x0a63('0x16')][_0x0a63('0x51')],'from':_0x1e1aec['body']['message']['from'],'to':_0x1e1aec[_0x0a63('0x29')][_0x0a63('0x16')]['to'],'cc':_0x1e1aec[_0x0a63('0x29')][_0x0a63('0x16')]['cc'],'subject':_0x1e1aec['body'][_0x0a63('0x16')]['subject'],'attach':_0x1e1aec['body'][_0x0a63('0x16')]['attach'],'Attachments':_0x1e1aec[_0x0a63('0x29')][_0x0a63('0x16')]['attachments'],'originTo':_0x1e1aec[_0x0a63('0x29')]['message'][_0x0a63('0x60')],'originCc':_0x1e1aec['body'][_0x0a63('0x16')][_0x0a63('0x61')],'bcc':_0x1e1aec[_0x0a63('0x29')]['message'][_0x0a63('0x62')],'ChatWebsiteId':_0x1e1aec[_0x0a63('0x29')][_0x0a63('0x16')][_0x0a63('0x63')]||null,'originChannel':_0x1e1aec[_0x0a63('0x29')]['message']['originChannel']||'Email','ChatOfflineMessageId':_0x1e1aec[_0x0a63('0x29')]['message'][_0x0a63('0x64')]||null},{'include':[{'model':db[_0x0a63('0x65')],'as':_0x0a63('0x66')}]});})[_0x0a63('0xe')](function(_0x5540c6){_0x14c737[_0x0a63('0x16')]=_0x5540c6;if(!_0x14c737[_0x0a63('0x5e')]['UserId']){return;}return db[_0x0a63('0x67')][_0x0a63('0x38')]({'attributes':['id',_0x0a63('0x68')],'where':{'id':_0x14c737[_0x0a63('0x5e')][_0x0a63('0x69')]}});})['then'](function(_0x206221){if(_0x206221){_0x14c737[_0x0a63('0x45')][_0x0a63('0x6a')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x206221['name']+','+(_0x14c737['account'][_0x0a63('0x6b')]||0xa),'interval':_0x0a63('0x4d')});}if(!_0x14c737[_0x0a63('0x5e')][_0x0a63('0x6c')]){return;}return db[_0x0a63('0x6d')][_0x0a63('0x38')]({'attributes':['id',_0x0a63('0x68')],'where':{'id':_0x14c737[_0x0a63('0x5e')][_0x0a63('0x6c')]}});})[_0x0a63('0xe')](function(_0x5c6e18){if(_0x5c6e18){_0x14c737[_0x0a63('0x45')][_0x0a63('0x6a')]({'id':0x0,'priority':0x1,'app':_0x0a63('0x6e'),'appdata':_0x5c6e18[_0x0a63('0x68')]+','+(_0x14c737[_0x0a63('0x39')][_0x0a63('0x6f')]||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start',_0x0a63('0x70'),_0x14c737);})[_0x0a63('0xe')](function(_0x425c8c){_0x5c7b78(_0x425c8c);})[_0x0a63('0x18')](function(_0x50f07e){_0x2af987(_0x128e9e[_0x0a63('0x14')](0x1f4,_0x50f07e['message']));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 9b00b7b..82df262 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 _0xe3b7=['removeListener','register','length','mailAccount:','./mailAccount.events','save','remove','update','emit'];(function(_0x3fd6cd,_0x5b5f87){var _0x2d344e=function(_0x8e0d61){while(--_0x8e0d61){_0x3fd6cd['push'](_0x3fd6cd['shift']());}};_0x2d344e(++_0x5b5f87);}(_0xe3b7,0x17e));var _0x7e3b=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xe3b7[_0x167cc1];return _0x10bc4b;};'use strict';var MailAccountEvents=require(_0x7e3b('0x0'));var events=[_0x7e3b('0x1'),_0x7e3b('0x2'),_0x7e3b('0x3')];function createListener(_0x445e59,_0x4e58b1){return function(_0x443497){_0x4e58b1[_0x7e3b('0x4')](_0x445e59,_0x443497);};}function removeListener(_0x20ed10,_0x20ffa3){return function(){MailAccountEvents[_0x7e3b('0x5')](_0x20ed10,_0x20ffa3);};}exports[_0x7e3b('0x6')]=function(_0x6cf2c6){for(var _0x2cfa86=0x0,_0xacfb06=events[_0x7e3b('0x7')];_0x2cfa86<_0xacfb06;_0x2cfa86++){var _0x332206=events[_0x2cfa86];var _0x324ebc=createListener(_0x7e3b('0x8')+_0x332206,_0x6cf2c6);MailAccountEvents['on'](_0x332206,_0x324ebc);}}; \ No newline at end of file +var _0xc113=['removeListener','register','length','./mailAccount.events','save','remove','update','emit'];(function(_0x6b861c,_0x13994d){var _0x52038c=function(_0x292e25){while(--_0x292e25){_0x6b861c['push'](_0x6b861c['shift']());}};_0x52038c(++_0x13994d);}(_0xc113,0x1ab));var _0x3c11=function(_0x2dec14,_0x3206aa){_0x2dec14=_0x2dec14-0x0;var _0x2ac484=_0xc113[_0x2dec14];return _0x2ac484;};'use strict';var MailAccountEvents=require(_0x3c11('0x0'));var events=[_0x3c11('0x1'),_0x3c11('0x2'),_0x3c11('0x3')];function createListener(_0x27a620,_0x237e11){return function(_0x12bb58){_0x237e11[_0x3c11('0x4')](_0x27a620,_0x12bb58);};}function removeListener(_0x2286e4,_0x531ac1){return function(){MailAccountEvents[_0x3c11('0x5')](_0x2286e4,_0x531ac1);};}exports[_0x3c11('0x6')]=function(_0x595e66){for(var _0x3dd753=0x0,_0x3b181f=events[_0x3c11('0x7')];_0x3dd753<_0x3b181f;_0x3dd753++){var _0x5d6f91=events[_0x3dd753];var _0x16959a=createListener('mailAccount:'+_0x5d6f91,_0x595e66);MailAccountEvents['on'](_0x5d6f91,_0x16959a);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 568657b..8a1ea85 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 _0xb0c9=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./mailApplication.controller','/:id','show','put','update','delete','destroy','exports'];(function(_0x3e99a2,_0x4f9c0e){var _0x14422c=function(_0x2d27c4){while(--_0x2d27c4){_0x3e99a2['push'](_0x3e99a2['shift']());}};_0x14422c(++_0x4f9c0e);}(_0xb0c9,0x160));var _0x9b0c=function(_0x1812ae,_0x5c230d){_0x1812ae=_0x1812ae-0x0;var _0x253ffa=_0xb0c9[_0x1812ae];return _0x253ffa;};'use strict';var multer=require(_0x9b0c('0x0'));var util=require(_0x9b0c('0x1'));var path=require(_0x9b0c('0x2'));var timeout=require(_0x9b0c('0x3'));var express=require(_0x9b0c('0x4'));var router=express[_0x9b0c('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x9b0c('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x9b0c('0x7'));var controller=require(_0x9b0c('0x8'));router['get'](_0x9b0c('0x9'),auth['isAuthenticated'](),controller[_0x9b0c('0xa')]);router[_0x9b0c('0xb')](_0x9b0c('0x9'),auth['isAuthenticated'](),controller[_0x9b0c('0xc')]);router[_0x9b0c('0xd')](_0x9b0c('0x9'),auth['isAuthenticated'](),controller[_0x9b0c('0xe')]);module[_0x9b0c('0xf')]=router; \ No newline at end of file +var _0x6418=['delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./mailApplication.controller','get','/:id','show','put','isAuthenticated','update'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0x6418,0x145));var _0x8641=function(_0x2bcd1b,_0x24d386){_0x2bcd1b=_0x2bcd1b-0x0;var _0x577799=_0x6418[_0x2bcd1b];return _0x577799;};'use strict';var multer=require(_0x8641('0x0'));var util=require(_0x8641('0x1'));var path=require(_0x8641('0x2'));var timeout=require(_0x8641('0x3'));var express=require('express');var router=express[_0x8641('0x4')]();var fs_extra=require(_0x8641('0x5'));var auth=require(_0x8641('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x8641('0x7'));var controller=require(_0x8641('0x8'));router[_0x8641('0x9')](_0x8641('0xa'),auth['isAuthenticated'](),controller[_0x8641('0xb')]);router[_0x8641('0xc')](_0x8641('0xa'),auth[_0x8641('0xd')](),controller[_0x8641('0xe')]);router[_0x8641('0xf')](_0x8641('0xa'),auth[_0x8641('0xd')](),controller[_0x8641('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index 9373757..9332cfc 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 _0x9a9f=['TEXT','*,*,*,*','sequelize','exports','STRING','noop'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x9a9f,0x68));var _0xf9a9=function(_0xdbebd4,_0x142326){_0xdbebd4=_0xdbebd4-0x0;var _0x3faa02=_0x9a9f[_0xdbebd4];return _0x3faa02;};'use strict';var Sequelize=require(_0xf9a9('0x0'));module[_0xf9a9('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xf9a9('0x2')],'allowNull':![],'defaultValue':_0xf9a9('0x3')},'appdata':{'type':Sequelize[_0xf9a9('0x4')]()},'description':{'type':Sequelize[_0xf9a9('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xf9a9('0x5')}}; \ No newline at end of file +var _0x871b=['exports','INTEGER','STRING','sequelize'];(function(_0x51bda1,_0x44f80d){var _0x1ce08c=function(_0x5b788e){while(--_0x5b788e){_0x51bda1['push'](_0x51bda1['shift']());}};_0x1ce08c(++_0x44f80d);}(_0x871b,0x133));var _0xb871=function(_0x387651,_0x627c82){_0x387651=_0x387651-0x0;var _0x358169=_0x871b[_0x387651];return _0x358169;};'use strict';var Sequelize=require(_0xb871('0x0'));module[_0xb871('0x1')]={'priority':{'type':Sequelize[_0xb871('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xb871('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xb871('0x3')]},'interval':{'type':Sequelize[_0xb871('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index 740a737..cdd8c2e 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 _0x0713=['catch','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','stack','name','send','show','params','MailApplication','rawAttributes','query','keys','filters','intersection','model','fields','attributes','length','includeAll','include','merge','options','find','body'];(function(_0x5d3b91,_0xdedf7c){var _0x182c48=function(_0x4a847e){while(--_0x4a847e){_0x5d3b91['push'](_0x5d3b91['shift']());}};_0x182c48(++_0xdedf7c);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3071('0x0'));var jsonpatch=require(_0x3071('0x1'));var rp=require(_0x3071('0x2'));var moment=require(_0x3071('0x3'));var BPromise=require(_0x3071('0x4'));var Mustache=require('mustache');var util=require(_0x3071('0x5'));var path=require(_0x3071('0x6'));var sox=require(_0x3071('0x7'));var csv=require(_0x3071('0x8'));var ejs=require(_0x3071('0x9'));var fs=require('fs');var fs_extra=require(_0x3071('0xa'));var _=require(_0x3071('0xb'));var squel=require(_0x3071('0xc'));var crypto=require(_0x3071('0xd'));var jsforce=require(_0x3071('0xe'));var deskjs=require(_0x3071('0xf'));var toCsv=require(_0x3071('0x8'));var querystring=require(_0x3071('0x10'));var Papa=require('papaparse');var Redis=require(_0x3071('0x11'));var authService=require(_0x3071('0x12'));var qs=require(_0x3071('0x13'));var as=require(_0x3071('0x14'));var hardwareService=require(_0x3071('0x15'));var logger=require('../../config/logger')(_0x3071('0x16'));var utils=require(_0x3071('0x17'));var config=require(_0x3071('0x18'));var licenseUtil=require(_0x3071('0x19'));var db=require(_0x3071('0x1a'))['db'];function respondWithStatusCode(_0x4a8cc7,_0x5330a8){_0x5330a8=_0x5330a8||0xcc;return function(_0x1826ca){if(_0x1826ca){return _0x4a8cc7['sendStatus'](_0x5330a8);}return _0x4a8cc7[_0x3071('0x1b')](_0x5330a8)[_0x3071('0x1c')]();};}function respondWithResult(_0x5d4883,_0x104e73){_0x104e73=_0x104e73||0xc8;return function(_0x4e1219){if(_0x4e1219){return _0x5d4883[_0x3071('0x1b')](_0x104e73)[_0x3071('0x1d')](_0x4e1219);}};}function respondWithFilteredResult(_0x1271d0,_0x1f14e1){return function(_0x1caa5d){if(_0x1caa5d){var _0x2a6a4b=typeof _0x1f14e1[_0x3071('0x1e')]===_0x3071('0x1f')&&typeof _0x1f14e1[_0x3071('0x20')]===_0x3071('0x1f');var _0x5f3c22=_0x1caa5d[_0x3071('0x21')];var _0x17dbda=_0x2a6a4b?0x0:_0x1f14e1[_0x3071('0x1e')];var _0x108a83=_0x2a6a4b?_0x1caa5d[_0x3071('0x21')]:_0x1f14e1[_0x3071('0x1e')]+_0x1f14e1[_0x3071('0x20')];var _0x26f113;if(_0x108a83>=_0x5f3c22){_0x108a83=_0x5f3c22;_0x26f113=0xc8;}else{_0x26f113=0xce;}_0x1271d0['status'](_0x26f113);return _0x1271d0[_0x3071('0x22')](_0x3071('0x23'),_0x17dbda+'-'+_0x108a83+'/'+_0x5f3c22)[_0x3071('0x1d')](_0x1caa5d);}return null;};}function patchUpdates(_0x56c267){return function(_0xb8f4e3){try{jsonpatch['apply'](_0xb8f4e3,_0x56c267,!![]);}catch(_0x833074){return BPromise[_0x3071('0x24')](_0x833074);}return _0xb8f4e3[_0x3071('0x25')]();};}function saveUpdates(_0x457b57,_0x33090c){return function(_0x34c50e){if(_0x34c50e){return _0x34c50e[_0x3071('0x26')](_0x457b57)[_0x3071('0x27')](function(_0x542646){return _0x542646;});}return null;};}function removeEntity(_0x481a51,_0x2ce48a){return function(_0xb05b1d){if(_0xb05b1d){return _0xb05b1d[_0x3071('0x28')]()[_0x3071('0x27')](function(){_0x481a51[_0x3071('0x1b')](0xcc)[_0x3071('0x1c')]();});}};}function handleEntityNotFound(_0x7a4cb4,_0x1fe727){return function(_0x1de5fb){if(!_0x1de5fb){_0x7a4cb4['sendStatus'](0x194);}return _0x1de5fb;};}function handleError(_0x2e5f93,_0x3f1e6e){_0x3f1e6e=_0x3f1e6e||0x1f4;return function(_0x177138){logger['error'](_0x177138[_0x3071('0x29')]);if(_0x177138[_0x3071('0x2a')]){delete _0x177138[_0x3071('0x2a')];}_0x2e5f93[_0x3071('0x1b')](_0x3f1e6e)[_0x3071('0x2b')](_0x177138);};}exports[_0x3071('0x2c')]=function(_0x177b5f,_0x3921a1){var _0x32f1b4={'raw':!![],'where':{'id':_0x177b5f[_0x3071('0x2d')]['id']}},_0x292205={};_0x292205['model']=_['keys'](db[_0x3071('0x2e')][_0x3071('0x2f')]);_0x292205[_0x3071('0x30')]=_[_0x3071('0x31')](_0x177b5f[_0x3071('0x30')]);_0x292205[_0x3071('0x32')]=_[_0x3071('0x33')](_0x292205[_0x3071('0x34')],_0x292205['query']);_0x32f1b4['attributes']=_['intersection'](_0x292205[_0x3071('0x34')],qs[_0x3071('0x35')](_0x177b5f['query'][_0x3071('0x35')]));_0x32f1b4[_0x3071('0x36')]=_0x32f1b4[_0x3071('0x36')][_0x3071('0x37')]?_0x32f1b4['attributes']:_0x292205[_0x3071('0x34')];if(_0x177b5f[_0x3071('0x30')][_0x3071('0x38')]){_0x32f1b4[_0x3071('0x39')]=[{'all':!![]}];}_0x32f1b4=_[_0x3071('0x3a')]({},_0x32f1b4,_0x177b5f[_0x3071('0x3b')]);return db[_0x3071('0x2e')][_0x3071('0x3c')](_0x32f1b4)['then'](handleEntityNotFound(_0x3921a1,null))[_0x3071('0x27')](respondWithResult(_0x3921a1,null))['catch'](handleError(_0x3921a1,null));};exports['update']=function(_0x1a1a64,_0xa3a7ae){if(_0x1a1a64['body']['id']){delete _0x1a1a64[_0x3071('0x3d')]['id'];}return db[_0x3071('0x2e')][_0x3071('0x3c')]({'where':{'id':_0x1a1a64[_0x3071('0x2d')]['id']}})[_0x3071('0x27')](handleEntityNotFound(_0xa3a7ae,null))[_0x3071('0x27')](saveUpdates(_0x1a1a64['body'],null))[_0x3071('0x27')](respondWithResult(_0xa3a7ae,null))[_0x3071('0x3e')](handleError(_0xa3a7ae,null));};exports['destroy']=function(_0x44ad05,_0x5b1392){return db[_0x3071('0x2e')][_0x3071('0x3c')]({'where':{'id':_0x44ad05['params']['id']}})['then'](handleEntityNotFound(_0x5b1392,null))[_0x3071('0x27')](removeEntity(_0x5b1392,null))[_0x3071('0x3e')](handleError(_0x5b1392,null));}; \ No newline at end of file +var _0xb43b=['name','status','send','show','params','keys','MailApplication','rawAttributes','query','intersection','model','fields','attributes','length','includeAll','merge','options','find','then','catch','body','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','undefined','count','offset','limit','set','Content-Range','json','apply','reject','update','destroy','sendStatus'];(function(_0x21d516,_0x45b0cd){var _0x1235b3=function(_0x147f05){while(--_0x147f05){_0x21d516['push'](_0x21d516['shift']());}};_0x1235b3(++_0x45b0cd);}(_0xb43b,0x1b2));var _0xbb43=function(_0x2c58ac,_0x449fde){_0x2c58ac=_0x2c58ac-0x0;var _0x5a575b=_0xb43b[_0x2c58ac];return _0x5a575b;};'use strict';var emlformat=require(_0xbb43('0x0'));var rimraf=require(_0xbb43('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbb43('0x2'));var rp=require(_0xbb43('0x3'));var moment=require(_0xbb43('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xbb43('0x5'));var util=require(_0xbb43('0x6'));var path=require(_0xbb43('0x7'));var sox=require(_0xbb43('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbb43('0x9'));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 licenseUtil=require(_0xbb43('0x17'));var db=require(_0xbb43('0x18'))['db'];function respondWithStatusCode(_0x50e2c0,_0x578392){_0x578392=_0x578392||0xcc;return function(_0x41e7e5){if(_0x41e7e5){return _0x50e2c0['sendStatus'](_0x578392);}return _0x50e2c0['status'](_0x578392)[_0xbb43('0x19')]();};}function respondWithResult(_0x5a509f,_0x68d45d){_0x68d45d=_0x68d45d||0xc8;return function(_0x43021d){if(_0x43021d){return _0x5a509f['status'](_0x68d45d)['json'](_0x43021d);}};}function respondWithFilteredResult(_0x4d5bcf,_0x338120){return function(_0x2abce0){if(_0x2abce0){var _0x57bd1d=typeof _0x338120['offset']===_0xbb43('0x1a')&&typeof _0x338120['limit']==='undefined';var _0x2b0797=_0x2abce0[_0xbb43('0x1b')];var _0x2e3b43=_0x57bd1d?0x0:_0x338120['offset'];var _0x1c16d7=_0x57bd1d?_0x2abce0['count']:_0x338120[_0xbb43('0x1c')]+_0x338120[_0xbb43('0x1d')];var _0x4dfc54;if(_0x1c16d7>=_0x2b0797){_0x1c16d7=_0x2b0797;_0x4dfc54=0xc8;}else{_0x4dfc54=0xce;}_0x4d5bcf['status'](_0x4dfc54);return _0x4d5bcf[_0xbb43('0x1e')](_0xbb43('0x1f'),_0x2e3b43+'-'+_0x1c16d7+'/'+_0x2b0797)[_0xbb43('0x20')](_0x2abce0);}return null;};}function patchUpdates(_0x2bf2d4){return function(_0x5bcce7){try{jsonpatch[_0xbb43('0x21')](_0x5bcce7,_0x2bf2d4,!![]);}catch(_0x5f4416){return BPromise[_0xbb43('0x22')](_0x5f4416);}return _0x5bcce7['save']();};}function saveUpdates(_0x2f5e31,_0x565256){return function(_0x3f323e){if(_0x3f323e){return _0x3f323e[_0xbb43('0x23')](_0x2f5e31)['then'](function(_0x1d0768){return _0x1d0768;});}return null;};}function removeEntity(_0x4dfb7f,_0xf24e60){return function(_0x298ce2){if(_0x298ce2){return _0x298ce2[_0xbb43('0x24')]()['then'](function(){_0x4dfb7f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x269ca5,_0x32d7f0){return function(_0x5d8310){if(!_0x5d8310){_0x269ca5[_0xbb43('0x25')](0x194);}return _0x5d8310;};}function handleError(_0x2da653,_0x226827){_0x226827=_0x226827||0x1f4;return function(_0x3874fb){logger['error'](_0x3874fb['stack']);if(_0x3874fb[_0xbb43('0x26')]){delete _0x3874fb[_0xbb43('0x26')];}_0x2da653[_0xbb43('0x27')](_0x226827)[_0xbb43('0x28')](_0x3874fb);};}exports[_0xbb43('0x29')]=function(_0x40b04b,_0x21d386){var _0x473828={'raw':!![],'where':{'id':_0x40b04b[_0xbb43('0x2a')]['id']}},_0x539730={};_0x539730['model']=_[_0xbb43('0x2b')](db[_0xbb43('0x2c')][_0xbb43('0x2d')]);_0x539730[_0xbb43('0x2e')]=_['keys'](_0x40b04b[_0xbb43('0x2e')]);_0x539730['filters']=_['intersection'](_0x539730['model'],_0x539730[_0xbb43('0x2e')]);_0x473828['attributes']=_[_0xbb43('0x2f')](_0x539730[_0xbb43('0x30')],qs[_0xbb43('0x31')](_0x40b04b['query'][_0xbb43('0x31')]));_0x473828[_0xbb43('0x32')]=_0x473828[_0xbb43('0x32')][_0xbb43('0x33')]?_0x473828[_0xbb43('0x32')]:_0x539730[_0xbb43('0x30')];if(_0x40b04b[_0xbb43('0x2e')][_0xbb43('0x34')]){_0x473828['include']=[{'all':!![]}];}_0x473828=_[_0xbb43('0x35')]({},_0x473828,_0x40b04b[_0xbb43('0x36')]);return db[_0xbb43('0x2c')][_0xbb43('0x37')](_0x473828)[_0xbb43('0x38')](handleEntityNotFound(_0x21d386,null))[_0xbb43('0x38')](respondWithResult(_0x21d386,null))[_0xbb43('0x39')](handleError(_0x21d386,null));};exports[_0xbb43('0x23')]=function(_0x349a83,_0x57105c){if(_0x349a83[_0xbb43('0x3a')]['id']){delete _0x349a83[_0xbb43('0x3a')]['id'];}return db[_0xbb43('0x2c')][_0xbb43('0x37')]({'where':{'id':_0x349a83[_0xbb43('0x2a')]['id']}})[_0xbb43('0x38')](handleEntityNotFound(_0x57105c,null))['then'](saveUpdates(_0x349a83[_0xbb43('0x3a')],null))[_0xbb43('0x38')](respondWithResult(_0x57105c,null))['catch'](handleError(_0x57105c,null));};exports[_0xbb43('0x24')]=function(_0x2c9a7c,_0x11d384){return db['MailApplication']['find']({'where':{'id':_0x2c9a7c['params']['id']}})[_0xbb43('0x38')](handleEntityNotFound(_0x11d384,null))[_0xbb43('0x38')](removeEntity(_0x11d384,null))['catch'](handleError(_0x11d384,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 679d3a1..4fbc0f5 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 _0x97df=['request-promise','path','rimraf','../../config/environment','exports','MailApplication','mail_applications','utf8mb4_unicode_ci','util','api','bluebird'];(function(_0x353bf6,_0x524b6e){var _0x5cfb94=function(_0x1063db){while(--_0x1063db){_0x353bf6['push'](_0x353bf6['shift']());}};_0x5cfb94(++_0x524b6e);}(_0x97df,0xe4));var _0xf97d=function(_0x1d5400,_0x567e3c){_0x1d5400=_0x1d5400-0x0;var _0x21d9fe=_0x97df[_0x1d5400];return _0x21d9fe;};'use strict';var _=require('lodash');var util=require(_0xf97d('0x0'));var logger=require('../../config/logger')(_0xf97d('0x1'));var moment=require('moment');var BPromise=require(_0xf97d('0x2'));var rp=require(_0xf97d('0x3'));var fs=require('fs');var path=require(_0xf97d('0x4'));var rimraf=require(_0xf97d('0x5'));var config=require(_0xf97d('0x6'));var attributes=require('./mailApplication.attributes');module[_0xf97d('0x7')]=function(_0x5ddad2,_0x2fdcd1){return _0x5ddad2['define'](_0xf97d('0x8'),attributes,{'tableName':_0xf97d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xf97d('0xa')});}; \ No newline at end of file +var _0x39e8=['mail_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0x39e8,0x65));var _0x839e=function(_0x5afb9b,_0x4dc022){_0x5afb9b=_0x5afb9b-0x0;var _0xc15656=_0x39e8[_0x5afb9b];return _0xc15656;};'use strict';var _=require(_0x839e('0x0'));var util=require(_0x839e('0x1'));var logger=require(_0x839e('0x2'))(_0x839e('0x3'));var moment=require(_0x839e('0x4'));var BPromise=require('bluebird');var rp=require(_0x839e('0x5'));var fs=require('fs');var path=require(_0x839e('0x6'));var rimraf=require(_0x839e('0x7'));var config=require(_0x839e('0x8'));var attributes=require('./mailApplication.attributes');module[_0x839e('0x9')]=function(_0x3b3e50,_0x14483c){return _0x3b3e50[_0x839e('0xa')]('MailApplication',attributes,{'tableName':_0x839e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x839e('0xc'),'collate':_0x839e('0xd')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index 6cbd42f..082840c 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 _0x6948=['../../config/environment','jayson/promise','client','info','MailApplication,\x20%s,\x20%s','debug','MailApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','UpdateMailApplication','update','body','options','raw','attributes','limit','then','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x6359ca,_0xc9bbd9){var _0x3e08f2=function(_0x3a294b){while(--_0x3a294b){_0x6359ca['push'](_0x6359ca['shift']());}};_0x3e08f2(++_0xc9bbd9);}(_0x6948,0x1c9));var _0x8694=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x6948[_0x397e5f];return _0x5302b8;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8694('0x0'));var BPromise=require(_0x8694('0x1'));var rs=require(_0x8694('0x2'));var fs=require('fs');var Redis=require(_0x8694('0x3'));var db=require(_0x8694('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x8694('0x5'))(_0x8694('0x6'));var config=require(_0x8694('0x7'));var jayson=require(_0x8694('0x8'));var client=jayson[_0x8694('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b51d,_0x53691a,_0x4f77b9){return new BPromise(function(_0x19b78b,_0x3fd697){return client['request'](_0x3b51d,_0x4f77b9)['then'](function(_0x40d4b9){logger[_0x8694('0xa')](_0x8694('0xb'),_0x53691a,'request\x20sent');logger[_0x8694('0xc')](_0x8694('0xd'),_0x53691a,_0x8694('0xe'),JSON[_0x8694('0xf')](_0x40d4b9));if(_0x40d4b9['error']){if(_0x40d4b9[_0x8694('0x10')][_0x8694('0x11')]===0x1f4){logger['error'](_0x8694('0xb'),_0x53691a,_0x40d4b9[_0x8694('0x10')][_0x8694('0x12')]);return _0x3fd697(_0x40d4b9['error'][_0x8694('0x12')]);}logger[_0x8694('0x10')](_0x8694('0xb'),_0x53691a,_0x40d4b9[_0x8694('0x10')]['message']);return _0x19b78b(_0x40d4b9[_0x8694('0x10')]['message']);}else{logger['info'](_0x8694('0xb'),_0x53691a,_0x8694('0xe'));_0x19b78b(_0x40d4b9[_0x8694('0x13')][_0x8694('0x12')]);}})[_0x8694('0x14')](function(_0x13b8db){logger[_0x8694('0x10')](_0x8694('0xb'),_0x53691a,_0x13b8db);_0x3fd697(_0x13b8db);});});}exports[_0x8694('0x15')]=function(_0x1124c9){var _0x7fc1ba=this;return new Promise(function(_0x5316a4,_0x296cdf){return db['MailApplication'][_0x8694('0x16')](_0x1124c9[_0x8694('0x17')],{'raw':_0x1124c9[_0x8694('0x18')]?_0x1124c9[_0x8694('0x18')][_0x8694('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1124c9['options']?_0x1124c9[_0x8694('0x18')]['where']||null:null,'attributes':_0x1124c9[_0x8694('0x18')]?_0x1124c9['options'][_0x8694('0x1a')]||null:null,'limit':_0x1124c9[_0x8694('0x18')]?_0x1124c9['options'][_0x8694('0x1b')]||null:null})[_0x8694('0x1c')](function(_0x448c49){logger[_0x8694('0xa')](_0x8694('0x15'),_0x1124c9);logger[_0x8694('0xc')](_0x8694('0x15'),_0x1124c9,JSON[_0x8694('0xf')](_0x448c49));_0x5316a4(_0x448c49);})['catch'](function(_0x379eb9){logger[_0x8694('0x10')](_0x8694('0x15'),_0x379eb9[_0x8694('0x12')],_0x1124c9);_0x296cdf(_0x7fc1ba[_0x8694('0x10')](0x1f4,_0x379eb9[_0x8694('0x12')]));});});}; \ No newline at end of file +var _0xe74c=['../../config/logger','rpc','jayson/promise','client','http','request','then','info','MailApplication,\x20%s,\x20%s','debug','MailApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','MailApplication','update','options','raw','where','attributes','limit','UpdateMailApplication','stringify','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x368dd2,_0x108647){var _0x5e9aa7=function(_0x32ccbb){while(--_0x32ccbb){_0x368dd2['push'](_0x368dd2['shift']());}};_0x5e9aa7(++_0x108647);}(_0xe74c,0xf9));var _0xce74=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xe74c[_0x2bf141];return _0x48277b;};'use strict';var _=require(_0xce74('0x0'));var util=require(_0xce74('0x1'));var moment=require('moment');var BPromise=require(_0xce74('0x2'));var rs=require(_0xce74('0x3'));var fs=require('fs');var Redis=require(_0xce74('0x4'));var db=require(_0xce74('0x5'))['db'];var utils=require(_0xce74('0x6'));var logger=require(_0xce74('0x7'))(_0xce74('0x8'));var config=require('../../config/environment');var jayson=require(_0xce74('0x9'));var client=jayson[_0xce74('0xa')][_0xce74('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5538db,_0x112609,_0x113b6d){return new BPromise(function(_0x4d87bb,_0x13de0e){return client[_0xce74('0xc')](_0x5538db,_0x113b6d)[_0xce74('0xd')](function(_0x304193){logger[_0xce74('0xe')](_0xce74('0xf'),_0x112609,'request\x20sent');logger[_0xce74('0x10')](_0xce74('0x11'),_0x112609,_0xce74('0x12'),JSON['stringify'](_0x304193));if(_0x304193[_0xce74('0x13')]){if(_0x304193[_0xce74('0x13')]['code']===0x1f4){logger[_0xce74('0x13')]('MailApplication,\x20%s,\x20%s',_0x112609,_0x304193[_0xce74('0x13')]['message']);return _0x13de0e(_0x304193[_0xce74('0x13')][_0xce74('0x14')]);}logger[_0xce74('0x13')](_0xce74('0xf'),_0x112609,_0x304193[_0xce74('0x13')][_0xce74('0x14')]);return _0x4d87bb(_0x304193[_0xce74('0x13')]['message']);}else{logger['info'](_0xce74('0xf'),_0x112609,_0xce74('0x12'));_0x4d87bb(_0x304193[_0xce74('0x15')][_0xce74('0x14')]);}})[_0xce74('0x16')](function(_0x59f02a){logger[_0xce74('0x13')](_0xce74('0xf'),_0x112609,_0x59f02a);_0x13de0e(_0x59f02a);});});}exports['UpdateMailApplication']=function(_0x18b3f6){var _0x91ec22=this;return new Promise(function(_0x2a1fdd,_0x4083c7){return db[_0xce74('0x17')][_0xce74('0x18')](_0x18b3f6['body'],{'raw':_0x18b3f6['options']?_0x18b3f6[_0xce74('0x19')][_0xce74('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x18b3f6[_0xce74('0x19')]?_0x18b3f6[_0xce74('0x19')][_0xce74('0x1b')]||null:null,'attributes':_0x18b3f6['options']?_0x18b3f6[_0xce74('0x19')][_0xce74('0x1c')]||null:null,'limit':_0x18b3f6['options']?_0x18b3f6[_0xce74('0x19')][_0xce74('0x1d')]||null:null})['then'](function(_0x10c045){logger[_0xce74('0xe')](_0xce74('0x1e'),_0x18b3f6);logger[_0xce74('0x10')]('UpdateMailApplication',_0x18b3f6,JSON[_0xce74('0x1f')](_0x10c045));_0x2a1fdd(_0x10c045);})[_0xce74('0x16')](function(_0x15eae3){logger[_0xce74('0x13')]('UpdateMailApplication',_0x15eae3['message'],_0x18b3f6);_0x4083c7(_0x91ec22[_0xce74('0x13')](0x1f4,_0x15eae3[_0xce74('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 4a940cd..a5b27e2 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 _0x15cf=['post','create','addMessage','/:id/tags','tracked','mail','mailinteraction:addtags','addTags','put','mailinteraction:update','mailinteraction:destroy','destroy','delete','exports','express','Router','../../components/interaction/service','./mailInteraction.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download'];(function(_0x34dbd4,_0x52a779){var _0x31cf54=function(_0x443aa0){while(--_0x443aa0){_0x34dbd4['push'](_0x34dbd4['shift']());}};_0x31cf54(++_0x52a779);}(_0x15cf,0x1d9));var _0xf15c=function(_0x4a96d2,_0x689504){_0x4a96d2=_0x4a96d2-0x0;var _0x38af04=_0x15cf[_0x4a96d2];return _0x38af04;};'use strict';var express=require(_0xf15c('0x0'));var router=express[_0xf15c('0x1')]();var auth=require('../../components/auth/service');var interaction=require(_0xf15c('0x2'));var controller=require(_0xf15c('0x3'));router[_0xf15c('0x4')]('/',auth[_0xf15c('0x5')](),controller['index']);router[_0xf15c('0x4')](_0xf15c('0x6'),auth[_0xf15c('0x5')](),controller[_0xf15c('0x7')]);router[_0xf15c('0x4')](_0xf15c('0x8'),auth[_0xf15c('0x5')](),controller[_0xf15c('0x9')]);router[_0xf15c('0x4')](_0xf15c('0xa'),auth[_0xf15c('0x5')](),controller[_0xf15c('0xb')]);router[_0xf15c('0x4')](_0xf15c('0xc'),auth['isAuthenticated'](),controller['download']);router[_0xf15c('0xd')]('/',auth['isAuthenticated'](),controller[_0xf15c('0xe')]);router[_0xf15c('0xd')]('/:id/messages',auth[_0xf15c('0x5')](),controller[_0xf15c('0xf')]);router[_0xf15c('0xd')](_0xf15c('0x10'),auth[_0xf15c('0x5')](),interaction[_0xf15c('0x11')](_0xf15c('0x12'),_0xf15c('0x13')),controller[_0xf15c('0x14')]);router[_0xf15c('0x15')](_0xf15c('0x8'),auth[_0xf15c('0x5')](),interaction[_0xf15c('0x11')](_0xf15c('0x12'),_0xf15c('0x16')),controller['update']);router['delete'](_0xf15c('0x8'),auth['isAuthenticated'](),interaction[_0xf15c('0x11')]('mail',_0xf15c('0x17')),controller[_0xf15c('0x18')]);router[_0xf15c('0x19')](_0xf15c('0x10'),auth['isAuthenticated'](),controller['removeTags']);module[_0xf15c('0x1a')]=router; \ No newline at end of file +var _0x4d36=['/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','mail','mailinteraction:addtags','addTags','put','mailinteraction:update','update','mailinteraction:destroy','destroy','exports','express','Router','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x4551f6,_0x48151b){var _0x581dc2=function(_0x1842af){while(--_0x1842af){_0x4551f6['push'](_0x4551f6['shift']());}};_0x581dc2(++_0x48151b);}(_0x4d36,0xe4));var _0x64d3=function(_0xd13a88,_0x3c5269){_0xd13a88=_0xd13a88-0x0;var _0x1c993c=_0x4d36[_0xd13a88];return _0x1c993c;};'use strict';var express=require(_0x64d3('0x0'));var router=express[_0x64d3('0x1')]();var auth=require(_0x64d3('0x2'));var interaction=require(_0x64d3('0x3'));var controller=require(_0x64d3('0x4'));router[_0x64d3('0x5')]('/',auth[_0x64d3('0x6')](),controller[_0x64d3('0x7')]);router[_0x64d3('0x5')](_0x64d3('0x8'),auth[_0x64d3('0x6')](),controller[_0x64d3('0x9')]);router[_0x64d3('0x5')](_0x64d3('0xa'),auth[_0x64d3('0x6')](),controller[_0x64d3('0xb')]);router[_0x64d3('0x5')](_0x64d3('0xc'),auth[_0x64d3('0x6')](),controller[_0x64d3('0xd')]);router['get'](_0x64d3('0xe'),auth[_0x64d3('0x6')](),controller[_0x64d3('0xf')]);router[_0x64d3('0x10')]('/',auth[_0x64d3('0x6')](),controller[_0x64d3('0x11')]);router[_0x64d3('0x10')](_0x64d3('0xc'),auth[_0x64d3('0x6')](),controller[_0x64d3('0x12')]);router['post'](_0x64d3('0x13'),auth[_0x64d3('0x6')](),interaction[_0x64d3('0x14')](_0x64d3('0x15'),_0x64d3('0x16')),controller[_0x64d3('0x17')]);router[_0x64d3('0x18')](_0x64d3('0xa'),auth[_0x64d3('0x6')](),interaction[_0x64d3('0x14')](_0x64d3('0x15'),_0x64d3('0x19')),controller[_0x64d3('0x1a')]);router['delete']('/:id',auth[_0x64d3('0x6')](),interaction[_0x64d3('0x14')](_0x64d3('0x15'),_0x64d3('0x1b')),controller[_0x64d3('0x1c')]);router['delete'](_0x64d3('0x13'),auth[_0x64d3('0x6')](),controller['removeTags']);module[_0x64d3('0x1d')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index 667bfd0..0d08b28 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 _0x79d3=['BOOLEAN','DATE','STRING','long','TEXT','ENUM','out','sequelize','iconv','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x79d3,0x1a1));var _0x379d=function(_0x1b3a72,_0x3a1f98){_0x1b3a72=_0x1b3a72-0x0;var _0x8b247f=_0x79d3[_0x1b3a72];return _0x8b247f;};'use strict';var Sequelize=require(_0x379d('0x0'));var iconv=require(_0x379d('0x1'));module[_0x379d('0x2')]={'closed':{'type':Sequelize[_0x379d('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x379d('0x4')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x379d('0x5')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize[_0x379d('0x5')]},'cc':{'type':Sequelize['TEXT'](_0x379d('0x6'))},'subject':{'type':Sequelize[_0x379d('0x7')]()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x379d('0x4')]},'substatus':{'type':Sequelize[_0x379d('0x5')](0x3c)},'substatusAt':{'type':Sequelize[_0x379d('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x379d('0x8')]('in',_0x379d('0x9')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x379d('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x379d('0x8')]('in',_0x379d('0x9')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x379d('0x3')],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x19d4=['ENUM','INTEGER','sequelize','iconv','exports','BOOLEAN','DATE','STRING','TEXT','long'];(function(_0x1a9204,_0x1c9e00){var _0x17ca68=function(_0x1f4399){while(--_0x1f4399){_0x1a9204['push'](_0x1a9204['shift']());}};_0x17ca68(++_0x1c9e00);}(_0x19d4,0x1ec));var _0x419d=function(_0x529b97,_0x3a86c0){_0x529b97=_0x529b97-0x0;var _0x570b0e=_0x19d4[_0x529b97];return _0x570b0e;};'use strict';var Sequelize=require(_0x419d('0x0'));var iconv=require(_0x419d('0x1'));module[_0x419d('0x2')]={'closed':{'type':Sequelize[_0x419d('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x419d('0x4')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x419d('0x5')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize[_0x419d('0x5')]},'cc':{'type':Sequelize[_0x419d('0x6')](_0x419d('0x7'))},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize[_0x419d('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x419d('0x4')]},'substatus':{'type':Sequelize[_0x419d('0x5')](0x3c)},'substatusAt':{'type':Sequelize[_0x419d('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x419d('0x8')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x419d('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x419d('0x8')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueId':{'type':Sequelize[_0x419d('0x9')]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index 4736048..4a12436 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 _0xe8ce=['juice','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./mailInteraction.socket','register','status','offset','undefined','limit','count','set','Content-Range','then','destroy','end','error','stack','name','send','index','MailInteraction','rawAttributes','fieldName','key','findAll','mail','query','user','catch','show','model','keys','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','create','body','update','params','describe','MailMessage','addMessage','omit','ids','getMessages','findOne','hasOwnProperty','order','sort','where','MailInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','rows','setTags','spread','Tag','color','mailInteractionTags:save','removeTags','download','unix','toString','join','server','files','tmp','root','attachments','push','Attachment','Attachments','from','subject','Messages','mkdirSync','decode','createdAt','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','Bcc','type','readFileSync','writeFileSync','message%d.eml','unlinkSync','eml-format','rimraf','moment','bluebird','util','path'];(function(_0x54874b,_0x1b69db){var _0xaf6373=function(_0x2d9af5){while(--_0x2d9af5){_0x54874b['push'](_0x54874b['shift']());}};_0xaf6373(++_0x1b69db);}(_0xe8ce,0xd6));var _0xee8c=function(_0xa0d357,_0x1ec067){_0xa0d357=_0xa0d357-0x0;var _0x475c4d=_0xe8ce[_0xa0d357];return _0x475c4d;};'use strict';var emlformat=require(_0xee8c('0x0'));var rimraf=require(_0xee8c('0x1'));var zipdir=require('zip-dir');var moment=require(_0xee8c('0x2'));var BPromise=require(_0xee8c('0x3'));var util=require(_0xee8c('0x4'));var path=require(_0xee8c('0x5'));var fs=require('fs');var _=require('lodash');var juice=require(_0xee8c('0x6'));var Redis=require('ioredis');var interaction=require('../../components/interaction/service');var qs=require(_0xee8c('0x7'));var logger=require(_0xee8c('0x8'))('api');var config=require(_0xee8c('0x9'));var db=require(_0xee8c('0xa'))['db'];var htmlEntities=require('html-entities');config[_0xee8c('0xb')]=_[_0xee8c('0xc')](config[_0xee8c('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xee8c('0xd'))(new Redis(config[_0xee8c('0xb')]));require(_0xee8c('0xe'))[_0xee8c('0xf')](socket);function respondWithStatusCode(_0x3f0a1e,_0x15c1cb){_0x15c1cb=_0x15c1cb||0xcc;return function(_0x39d559){if(_0x39d559){return _0x3f0a1e['sendStatus'](_0x15c1cb);}return _0x3f0a1e[_0xee8c('0x10')](_0x15c1cb)['end']();};}function respondWithResult(_0x3831f4,_0x63c7ec){_0x63c7ec=_0x63c7ec||0xc8;return function(_0x554277){if(_0x554277){return _0x3831f4[_0xee8c('0x10')](_0x63c7ec)['json'](_0x554277);}};}function respondWithFilteredResult(_0x3f19b9,_0x18e405){return function(_0x5d4767){if(_0x5d4767){var _0x4a6d1f=typeof _0x18e405[_0xee8c('0x11')]===_0xee8c('0x12')&&typeof _0x18e405[_0xee8c('0x13')]==='undefined';var _0x3c15cc=_0x5d4767[_0xee8c('0x14')];var _0x787710=_0x4a6d1f?0x0:_0x18e405[_0xee8c('0x11')];var _0x2fc4e7=_0x4a6d1f?_0x5d4767['count']:_0x18e405[_0xee8c('0x11')]+_0x18e405[_0xee8c('0x13')];var _0x5ca3c7;if(_0x2fc4e7>=_0x3c15cc){_0x2fc4e7=_0x3c15cc;_0x5ca3c7=0xc8;}else{_0x5ca3c7=0xce;}_0x3f19b9[_0xee8c('0x10')](_0x5ca3c7);return _0x3f19b9[_0xee8c('0x15')](_0xee8c('0x16'),_0x787710+'-'+_0x2fc4e7+'/'+_0x3c15cc)['json'](_0x5d4767);}return null;};}function saveUpdates(_0x3e9811){return function(_0x55ab5d){if(_0x55ab5d){return _0x55ab5d['update'](_0x3e9811)[_0xee8c('0x17')](function(_0x23226c){return _0x23226c;});}return null;};}function removeEntity(_0x589561){return function(_0x557650){if(_0x557650){return _0x557650[_0xee8c('0x18')]()[_0xee8c('0x17')](function(){_0x589561[_0xee8c('0x10')](0xcc)[_0xee8c('0x19')]();});}};}function handleEntityNotFound(_0x4024c8){return function(_0xc2159a){if(!_0xc2159a){_0x4024c8['sendStatus'](0x194);}return _0xc2159a;};}function handleError(_0x44ab69,_0x2cc1f7){_0x2cc1f7=_0x2cc1f7||0x1f4;return function(_0x29d38e){logger[_0xee8c('0x1a')](_0x29d38e[_0xee8c('0x1b')]);if(_0x29d38e[_0xee8c('0x1c')]){delete _0x29d38e[_0xee8c('0x1c')];}_0x44ab69[_0xee8c('0x10')](_0x2cc1f7)[_0xee8c('0x1d')](_0x29d38e);};}exports[_0xee8c('0x1e')]=function(_0x2f4731,_0x52e263){var _0x5c995={};var _0x58f610=_['map'](db[_0xee8c('0x1f')][_0xee8c('0x20')],function(_0x5bf86e){return{'name':_0x5bf86e[_0xee8c('0x21')],'type':_0x5bf86e['type'][_0xee8c('0x22')]};});_0x5c995=qs['getOptions'](_0x58f610,_0x2f4731);return interaction[_0xee8c('0x23')](_0xee8c('0x24'),_0x2f4731[_0xee8c('0x25')],_0x2f4731[_0xee8c('0x26')],_0x5c995,_0x58f610)['then'](respondWithFilteredResult(_0x52e263,_0x5c995))[_0xee8c('0x27')](handleError(_0x52e263,null));};exports[_0xee8c('0x28')]=function(_0x479018,_0x7e044c){var _0xf568f5={'raw':![],'where':{'id':_0x479018['params']['id']}},_0x510eab={};_0x510eab[_0xee8c('0x29')]=_[_0xee8c('0x2a')](db[_0xee8c('0x1f')]['rawAttributes']);_0x510eab[_0xee8c('0x25')]=_[_0xee8c('0x2a')](_0x479018['query']);_0x510eab[_0xee8c('0x2b')]=_[_0xee8c('0x2c')](_0x510eab['model'],_0x510eab['query']);_0xf568f5[_0xee8c('0x2d')]=_['intersection'](_0x510eab[_0xee8c('0x29')],qs[_0xee8c('0x2e')](_0x479018[_0xee8c('0x25')][_0xee8c('0x2e')]));_0xf568f5[_0xee8c('0x2d')]=_0xf568f5['attributes'][_0xee8c('0x2f')]?_0xf568f5[_0xee8c('0x2d')]:_0x510eab[_0xee8c('0x29')];if(_0x479018['query'][_0xee8c('0x30')]){_0xf568f5[_0xee8c('0x31')]=[{'all':!![]}];}_0xf568f5=_[_0xee8c('0x32')]({},_0xf568f5,_0x479018[_0xee8c('0x33')]);return db[_0xee8c('0x1f')][_0xee8c('0x34')](_0xf568f5)[_0xee8c('0x17')](handleEntityNotFound(_0x7e044c,null))['then'](respondWithResult(_0x7e044c,null))['catch'](handleError(_0x7e044c,null));};exports['create']=function(_0xb51c83,_0x569dae){return db['MailInteraction'][_0xee8c('0x35')](_0xb51c83[_0xee8c('0x36')],{})[_0xee8c('0x17')](respondWithResult(_0x569dae,0xc9))[_0xee8c('0x27')](handleError(_0x569dae,null));};exports[_0xee8c('0x37')]=function(_0x2205e3,_0x5d61aa){if(_0x2205e3['body']['id']){delete _0x2205e3[_0xee8c('0x36')]['id'];}return db[_0xee8c('0x1f')]['find']({'where':{'id':_0x2205e3[_0xee8c('0x38')]['id']}})['then'](handleEntityNotFound(_0x5d61aa,null))[_0xee8c('0x17')](saveUpdates(_0x2205e3[_0xee8c('0x36')],null))['then'](respondWithResult(_0x5d61aa,null))['catch'](handleError(_0x5d61aa,null));};exports[_0xee8c('0x18')]=function(_0x260b9d,_0x35f929){return db[_0xee8c('0x1f')][_0xee8c('0x34')]({'where':{'id':_0x260b9d[_0xee8c('0x38')]['id']}})['then'](handleEntityNotFound(_0x35f929,null))[_0xee8c('0x17')](removeEntity(_0x35f929,null))[_0xee8c('0x27')](handleError(_0x35f929,null));};exports[_0xee8c('0x39')]=function(_0x10e639,_0x1a9adc){return db[_0xee8c('0x1f')]['describe']()['then'](respondWithResult(_0x1a9adc,null))[_0xee8c('0x27')](handleError(_0x1a9adc,null));};exports['addMessage']=function(_0x32a422,_0x56ff8b){return db[_0xee8c('0x3a')][_0xee8c('0x34')]({'where':{'id':_0x32a422[_0xee8c('0x38')]['id']}})[_0xee8c('0x17')](handleEntityNotFound(_0x56ff8b,null))[_0xee8c('0x17')](function(_0x3bbcab){if(_0x3bbcab){return _0x3bbcab[_0xee8c('0x3b')](_0x32a422[_0xee8c('0x36')]['ids'],_[_0xee8c('0x3c')](_0x32a422[_0xee8c('0x36')],[_0xee8c('0x3d'),'id'])||{});}})[_0xee8c('0x17')](respondWithResult(_0x56ff8b,null))[_0xee8c('0x27')](handleError(_0x56ff8b,null));};exports[_0xee8c('0x3e')]=function(_0x465ce1,_0x5327a5){var _0x52addc={'raw':![],'where':{}};var _0x5c9831={};var _0x2b358c={'count':0x0,'rows':[]};return db[_0xee8c('0x1f')][_0xee8c('0x3f')]({'where':{'id':_0x465ce1[_0xee8c('0x38')]['id']}})[_0xee8c('0x17')](handleEntityNotFound(_0x5327a5,null))[_0xee8c('0x17')](function(_0x1cc30f){if(_0x1cc30f){_0x5c9831[_0xee8c('0x29')]=_[_0xee8c('0x2a')](db[_0xee8c('0x3a')]['rawAttributes']);_0x5c9831[_0xee8c('0x25')]=_[_0xee8c('0x2a')](_0x465ce1[_0xee8c('0x25')]);_0x5c9831['filters']=_['intersection'](_0x5c9831[_0xee8c('0x29')],_0x5c9831[_0xee8c('0x25')]);_0x52addc['attributes']=_[_0xee8c('0x2c')](_0x5c9831[_0xee8c('0x29')],qs[_0xee8c('0x2e')](_0x465ce1[_0xee8c('0x25')][_0xee8c('0x2e')]));_0x52addc[_0xee8c('0x2d')]=_0x52addc['attributes']['length']?_0x52addc['attributes']:_0x5c9831['model'];if(!_0x465ce1[_0xee8c('0x25')][_0xee8c('0x40')]('nolimit')){_0x52addc[_0xee8c('0x13')]=qs[_0xee8c('0x13')](_0x465ce1[_0xee8c('0x25')][_0xee8c('0x13')]);_0x52addc[_0xee8c('0x11')]=qs[_0xee8c('0x11')](_0x465ce1[_0xee8c('0x25')][_0xee8c('0x11')]);}_0x52addc[_0xee8c('0x41')]=qs[_0xee8c('0x42')](_0x465ce1[_0xee8c('0x25')][_0xee8c('0x42')]);_0x52addc[_0xee8c('0x43')]=qs[_0xee8c('0x2b')](_['pick'](_0x465ce1[_0xee8c('0x25')],_0x5c9831['filters']));_0x52addc[_0xee8c('0x43')][_0xee8c('0x44')]=_0x1cc30f['id'];if(_0x465ce1[_0xee8c('0x25')][_0xee8c('0x45')]){_0x52addc[_0xee8c('0x43')]=_[_0xee8c('0x32')](_0x52addc[_0xee8c('0x43')],{'$or':_['map'](_0x52addc[_0xee8c('0x2d')],function(_0x4e1af0){var _0x262225={};_0x262225[_0x4e1af0]={'$like':'%'+_0x465ce1[_0xee8c('0x25')][_0xee8c('0x45')]+'%'};return _0x262225;})});}if(_0x465ce1[_0xee8c('0x25')][_0xee8c('0x46')]){var _0x14193e=_0x465ce1[_0xee8c('0x25')]['$gte'][_0xee8c('0x47')](',');var _0x47cc46={};_0x47cc46[_0x14193e[0x0]]={'$gte':moment(_0x14193e[0x1])[_0xee8c('0x48')](_0xee8c('0x49'))};_0x52addc['where']=_[_0xee8c('0x32')](_0x52addc[_0xee8c('0x43')],_0x47cc46);}_0x52addc=_[_0xee8c('0x32')]({},_0x52addc,_0x465ce1['options']);return db[_0xee8c('0x3a')][_0xee8c('0x14')]({'where':_0x52addc[_0xee8c('0x43')]})['then'](function(_0x18620f){_0x2b358c[_0xee8c('0x14')]=_0x18620f;if(_0x465ce1[_0xee8c('0x25')][_0xee8c('0x30')]){_0x52addc['include']=[{'all':!![]}];}return db['MailMessage'][_0xee8c('0x23')](_0x52addc);})['then'](function(_0x27a582){if(_0x465ce1[_0xee8c('0x25')][_0xee8c('0x4a')]===_0xee8c('0x4b')){for(var _0x3f7dc3=0x0;_0x3f7dc3<_0x27a582['length'];_0x3f7dc3++){_0x27a582[_0x3f7dc3][_0xee8c('0x36')]=juice(_0x27a582[_0x3f7dc3][_0xee8c('0x36')]);}}_0x2b358c[_0xee8c('0x4c')]=_0x27a582;return _0x2b358c;});}})[_0xee8c('0x17')](respondWithFilteredResult(_0x5327a5,_0x52addc))[_0xee8c('0x27')](handleError(_0x5327a5,null));};exports['addTags']=function(_0x1e9687,_0x113bfb){return db[_0xee8c('0x1f')][_0xee8c('0x34')]({'where':{'id':_0x1e9687[_0xee8c('0x38')]['id']}})[_0xee8c('0x17')](handleEntityNotFound(_0x113bfb,null))[_0xee8c('0x17')](function(_0x4c9372){if(_0x4c9372){return _0x4c9372[_0xee8c('0x4d')](_0x1e9687[_0xee8c('0x36')][_0xee8c('0x3d')],_['omit'](_0x1e9687[_0xee8c('0x36')],[_0xee8c('0x3d'),'id'])||{})[_0xee8c('0x4e')](function(){return db[_0xee8c('0x4f')]['findAll']({'attributes':['id',_0xee8c('0x1c'),_0xee8c('0x50')],'where':{'id':_0x1e9687[_0xee8c('0x36')][_0xee8c('0x3d')]}});})[_0xee8c('0x17')](function(_0x4ed8ad){socket['emit'](_0xee8c('0x51'),{'id':Number(_0x1e9687[_0xee8c('0x38')]['id']),'tags':_0x4ed8ad||[]});return{'id':Number(_0x1e9687['params']['id']),'tags':_0x4ed8ad||[]};});}})['then'](respondWithResult(_0x113bfb,null))[_0xee8c('0x27')](handleError(_0x113bfb,null));};exports['removeTags']=function(_0x44114a,_0x1c14ee){return db['MailInteraction']['find']({'where':{'id':_0x44114a['params']['id']}})[_0xee8c('0x17')](handleEntityNotFound(_0x1c14ee,null))[_0xee8c('0x17')](function(_0x58ad3a){if(_0x58ad3a){return _0x58ad3a[_0xee8c('0x52')](_0x44114a[_0xee8c('0x25')][_0xee8c('0x3d')]);}})[_0xee8c('0x17')](respondWithStatusCode(_0x1c14ee,null))['catch'](handleError(_0x1c14ee,null));};exports[_0xee8c('0x53')]=function(_0x56597e,_0x28a16c){var _0x59b783=moment()[_0xee8c('0x54')]()[_0xee8c('0x55')]();var _0x3595f1=path[_0xee8c('0x56')](config['root'],_0xee8c('0x57'),_0xee8c('0x58'),_0xee8c('0x59'));var _0x292f6a=path[_0xee8c('0x56')](config[_0xee8c('0x5a')],_0xee8c('0x57'),_0xee8c('0x58'),_0xee8c('0x5b'));var _0x4807e0=path['join'](_0x3595f1,_0x59b783);var _0x966241=util[_0xee8c('0x48')]('transcript-%d-%s.zip',_0x56597e[_0xee8c('0x38')]['id'],_0x59b783);var _0x495c6e=path[_0xee8c('0x56')](_0x3595f1,_0x966241);var _0x27fdd3=[];if(_0x56597e[_0xee8c('0x25')][_0xee8c('0x5b')]){_0x27fdd3[_0xee8c('0x5c')]({'model':db[_0xee8c('0x5d')],'as':_0xee8c('0x5e'),'raw':!![]});}var _0x4817ca=[{'model':db[_0xee8c('0x3a')],'as':'Messages','attributes':['id',_0xee8c('0x36'),_0xee8c('0x5f'),'to','cc','bcc',_0xee8c('0x60'),'createdAt'],'where':{'secret':![]},'order':qs['sort']('id'),'include':_0x27fdd3}];return db['MailInteraction'][_0xee8c('0x34')]({'where':{'id':_0x56597e['params']['id']},'include':_0x4817ca})[_0xee8c('0x17')](handleEntityNotFound(_0x28a16c,null))[_0xee8c('0x17')](function(_0x4c0cf6){if(_0x4c0cf6&&_0x4c0cf6[_0xee8c('0x61')]){var _0x2d14b5=_0x4c0cf6['get']({'plain':!![]});fs[_0xee8c('0x62')](_0x4807e0);return BPromise['each'](_0x2d14b5[_0xee8c('0x61')],function(_0x1dab96,_0x85f703){var _0x345d71={'from':_0x1dab96[_0xee8c('0x5f')],'to':_0x1dab96['to']||'missing.recipient@your.company.com','subject':_0x1dab96[_0xee8c('0x60')],'html':htmlEntities[_0xee8c('0x63')](_0x1dab96[_0xee8c('0x36')]),'headers':{'Date':moment(_0x1dab96[_0xee8c('0x64')])[_0xee8c('0x48')](_0xee8c('0x65'))},'attachments':[]};if(_0x1dab96['cc']){_0x345d71[_0xee8c('0x66')]['Cc']=_0x1dab96['cc'];}if(_0x1dab96[_0xee8c('0x67')]){_0x345d71[_0xee8c('0x66')][_0xee8c('0x68')]=_0x1dab96['bcc'];}return new BPromise(function(_0x1ba3f6,_0x4bcd46){if(_0x1dab96['Attachments']){for(var _0x512c76=0x0;_0x512c76<_0x1dab96[_0xee8c('0x5e')][_0xee8c('0x2f')];_0x512c76++){var _0x48176d=_0x1dab96[_0xee8c('0x5e')][_0x512c76];var _0x4daf86=path[_0xee8c('0x56')](_0x292f6a,_0x48176d['basename']);if(fs['existsSync'](_0x4daf86)){_0x345d71[_0xee8c('0x5b')][_0xee8c('0x5c')]({'name':_0x48176d[_0xee8c('0x1c')],'contentType':_0x48176d[_0xee8c('0x69')],'data':fs[_0xee8c('0x6a')](_0x4daf86)});}}}emlformat['build'](_0x345d71,function(_0x3c441a,_0x1c5dae){if(_0x3c441a)return _0x4bcd46(_0x3c441a);fs[_0xee8c('0x6b')](path[_0xee8c('0x56')](_0x4807e0,util['format'](_0xee8c('0x6c'),_0x85f703)),_0x1c5dae);return _0x1ba3f6(_0x1c5dae);});});})['then'](function(){return new BPromise(function(_0x2e62ab,_0x4c3e89){zipdir(_0x4807e0,{'saveTo':_0x495c6e},function(_0x3c5fcf,_0x402827){if(_0x3c5fcf)return _0x4c3e89(_0x3c5fcf);return _0x2e62ab(_0x402827);});})['then'](function(){return new BPromise(function(_0x311489,_0xa12f58){rimraf(_0x4807e0,function(_0xcd605c){if(_0xcd605c)_0xa12f58(_0xcd605c);return _0x311489();});});})[_0xee8c('0x17')](function(){return _0x28a16c[_0xee8c('0x53')](_0x495c6e,_0x966241,function(_0x11dc98){if(!_0x11dc98)fs[_0xee8c('0x6d')](_0x495c6e);});});});}else{return _0x28a16c['sendStatus'](0xc8);}})['catch'](handleError(_0x28a16c,null));}; \ No newline at end of file +var _0x90d3=['mailInteractionTags:save','removeTags','download','unix','toString','join','files','tmp','server','attachments','format','transcript-%d-%s.zip','push','Attachment','Messages','bcc','subject','get','mkdirSync','missing.recipient@your.company.com','decode','createdAt','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','Attachments','basename','existsSync','build','message%d.eml','eml-format','rimraf','moment','util','path','lodash','juice','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../mysqldb','html-entities','redis','defaults','localhost','./mailInteraction.socket','register','status','json','offset','undefined','limit','count','Content-Range','update','then','destroy','end','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','getOptions','mail','query','user','catch','show','keys','MailInteraction','model','attributes','intersection','fields','includeAll','merge','options','find','create','body','params','describe','addMessage','MailMessage','omit','ids','getMessages','findOne','filters','hasOwnProperty','nolimit','order','sort','where','MailInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','include','findAll','inlineCss','length','setTags','Tag','color','emit'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x90d3,0x91));var _0x390d=function(_0x9cd4c3,_0x1c9b2c){_0x9cd4c3=_0x9cd4c3-0x0;var _0x4c9025=_0x90d3[_0x9cd4c3];return _0x4c9025;};'use strict';var emlformat=require(_0x390d('0x0'));var rimraf=require(_0x390d('0x1'));var zipdir=require('zip-dir');var moment=require(_0x390d('0x2'));var BPromise=require('bluebird');var util=require(_0x390d('0x3'));var path=require(_0x390d('0x4'));var fs=require('fs');var _=require(_0x390d('0x5'));var juice=require(_0x390d('0x6'));var Redis=require(_0x390d('0x7'));var interaction=require(_0x390d('0x8'));var qs=require(_0x390d('0x9'));var logger=require(_0x390d('0xa'))(_0x390d('0xb'));var config=require('../../config/environment');var db=require(_0x390d('0xc'))['db'];var htmlEntities=require(_0x390d('0xd'));config[_0x390d('0xe')]=_[_0x390d('0xf')](config[_0x390d('0xe')],{'host':_0x390d('0x10'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x390d('0xe')]));require(_0x390d('0x11'))[_0x390d('0x12')](socket);function respondWithStatusCode(_0xcb24,_0x3086cc){_0x3086cc=_0x3086cc||0xcc;return function(_0x525e84){if(_0x525e84){return _0xcb24['sendStatus'](_0x3086cc);}return _0xcb24['status'](_0x3086cc)['end']();};}function respondWithResult(_0x23b6c5,_0x14cb2f){_0x14cb2f=_0x14cb2f||0xc8;return function(_0x5235d5){if(_0x5235d5){return _0x23b6c5[_0x390d('0x13')](_0x14cb2f)[_0x390d('0x14')](_0x5235d5);}};}function respondWithFilteredResult(_0x4048d5,_0x2dc96c){return function(_0x33bd36){if(_0x33bd36){var _0x2da1f6=typeof _0x2dc96c[_0x390d('0x15')]===_0x390d('0x16')&&typeof _0x2dc96c[_0x390d('0x17')]===_0x390d('0x16');var _0x246012=_0x33bd36['count'];var _0x91d12c=_0x2da1f6?0x0:_0x2dc96c[_0x390d('0x15')];var _0x49532e=_0x2da1f6?_0x33bd36[_0x390d('0x18')]:_0x2dc96c[_0x390d('0x15')]+_0x2dc96c[_0x390d('0x17')];var _0x4fdce6;if(_0x49532e>=_0x246012){_0x49532e=_0x246012;_0x4fdce6=0xc8;}else{_0x4fdce6=0xce;}_0x4048d5['status'](_0x4fdce6);return _0x4048d5['set'](_0x390d('0x19'),_0x91d12c+'-'+_0x49532e+'/'+_0x246012)[_0x390d('0x14')](_0x33bd36);}return null;};}function saveUpdates(_0x3e8da7){return function(_0x3670bf){if(_0x3670bf){return _0x3670bf[_0x390d('0x1a')](_0x3e8da7)[_0x390d('0x1b')](function(_0x1004b8){return _0x1004b8;});}return null;};}function removeEntity(_0x4e9e53){return function(_0x3e9fa5){if(_0x3e9fa5){return _0x3e9fa5[_0x390d('0x1c')]()['then'](function(){_0x4e9e53['status'](0xcc)[_0x390d('0x1d')]();});}};}function handleEntityNotFound(_0x194821){return function(_0x2ecc6f){if(!_0x2ecc6f){_0x194821[_0x390d('0x1e')](0x194);}return _0x2ecc6f;};}function handleError(_0x13cdcb,_0xdae35f){_0xdae35f=_0xdae35f||0x1f4;return function(_0xa81435){logger[_0x390d('0x1f')](_0xa81435[_0x390d('0x20')]);if(_0xa81435[_0x390d('0x21')]){delete _0xa81435[_0x390d('0x21')];}_0x13cdcb[_0x390d('0x13')](_0xdae35f)[_0x390d('0x22')](_0xa81435);};}exports[_0x390d('0x23')]=function(_0xbd3d8f,_0x173c57){var _0x37bec8={};var _0x330fdb=_[_0x390d('0x24')](db['MailInteraction'][_0x390d('0x25')],function(_0x314e9c){return{'name':_0x314e9c[_0x390d('0x26')],'type':_0x314e9c[_0x390d('0x27')]['key']};});_0x37bec8=qs[_0x390d('0x28')](_0x330fdb,_0xbd3d8f);return interaction['findAll'](_0x390d('0x29'),_0xbd3d8f[_0x390d('0x2a')],_0xbd3d8f[_0x390d('0x2b')],_0x37bec8,_0x330fdb)[_0x390d('0x1b')](respondWithFilteredResult(_0x173c57,_0x37bec8))[_0x390d('0x2c')](handleError(_0x173c57,null));};exports[_0x390d('0x2d')]=function(_0x5be009,_0x387bc9){var _0x1ea5b3={'raw':![],'where':{'id':_0x5be009['params']['id']}},_0x25fa34={};_0x25fa34['model']=_[_0x390d('0x2e')](db[_0x390d('0x2f')][_0x390d('0x25')]);_0x25fa34[_0x390d('0x2a')]=_[_0x390d('0x2e')](_0x5be009['query']);_0x25fa34['filters']=_['intersection'](_0x25fa34[_0x390d('0x30')],_0x25fa34['query']);_0x1ea5b3[_0x390d('0x31')]=_[_0x390d('0x32')](_0x25fa34['model'],qs[_0x390d('0x33')](_0x5be009[_0x390d('0x2a')][_0x390d('0x33')]));_0x1ea5b3['attributes']=_0x1ea5b3['attributes']['length']?_0x1ea5b3['attributes']:_0x25fa34[_0x390d('0x30')];if(_0x5be009[_0x390d('0x2a')][_0x390d('0x34')]){_0x1ea5b3['include']=[{'all':!![]}];}_0x1ea5b3=_[_0x390d('0x35')]({},_0x1ea5b3,_0x5be009[_0x390d('0x36')]);return db[_0x390d('0x2f')][_0x390d('0x37')](_0x1ea5b3)[_0x390d('0x1b')](handleEntityNotFound(_0x387bc9,null))[_0x390d('0x1b')](respondWithResult(_0x387bc9,null))[_0x390d('0x2c')](handleError(_0x387bc9,null));};exports['create']=function(_0x330e1c,_0x4500a2){return db[_0x390d('0x2f')][_0x390d('0x38')](_0x330e1c[_0x390d('0x39')],{})[_0x390d('0x1b')](respondWithResult(_0x4500a2,0xc9))['catch'](handleError(_0x4500a2,null));};exports['update']=function(_0x57dab1,_0x4cee65){if(_0x57dab1[_0x390d('0x39')]['id']){delete _0x57dab1[_0x390d('0x39')]['id'];}return db['MailInteraction'][_0x390d('0x37')]({'where':{'id':_0x57dab1[_0x390d('0x3a')]['id']}})[_0x390d('0x1b')](handleEntityNotFound(_0x4cee65,null))[_0x390d('0x1b')](saveUpdates(_0x57dab1[_0x390d('0x39')],null))[_0x390d('0x1b')](respondWithResult(_0x4cee65,null))[_0x390d('0x2c')](handleError(_0x4cee65,null));};exports[_0x390d('0x1c')]=function(_0x520531,_0x190090){return db['MailInteraction'][_0x390d('0x37')]({'where':{'id':_0x520531['params']['id']}})[_0x390d('0x1b')](handleEntityNotFound(_0x190090,null))[_0x390d('0x1b')](removeEntity(_0x190090,null))[_0x390d('0x2c')](handleError(_0x190090,null));};exports[_0x390d('0x3b')]=function(_0x449619,_0x56f3ab){return db[_0x390d('0x2f')][_0x390d('0x3b')]()[_0x390d('0x1b')](respondWithResult(_0x56f3ab,null))[_0x390d('0x2c')](handleError(_0x56f3ab,null));};exports[_0x390d('0x3c')]=function(_0x3ed8eb,_0x3750bf){return db[_0x390d('0x3d')][_0x390d('0x37')]({'where':{'id':_0x3ed8eb[_0x390d('0x3a')]['id']}})[_0x390d('0x1b')](handleEntityNotFound(_0x3750bf,null))[_0x390d('0x1b')](function(_0x49ff05){if(_0x49ff05){return _0x49ff05[_0x390d('0x3c')](_0x3ed8eb[_0x390d('0x39')]['ids'],_[_0x390d('0x3e')](_0x3ed8eb['body'],[_0x390d('0x3f'),'id'])||{});}})[_0x390d('0x1b')](respondWithResult(_0x3750bf,null))['catch'](handleError(_0x3750bf,null));};exports[_0x390d('0x40')]=function(_0x2c58fb,_0x441c09){var _0x336fbe={'raw':![],'where':{}};var _0x4bd6ab={};var _0x427cc3={'count':0x0,'rows':[]};return db[_0x390d('0x2f')][_0x390d('0x41')]({'where':{'id':_0x2c58fb[_0x390d('0x3a')]['id']}})[_0x390d('0x1b')](handleEntityNotFound(_0x441c09,null))['then'](function(_0x19af36){if(_0x19af36){_0x4bd6ab[_0x390d('0x30')]=_[_0x390d('0x2e')](db[_0x390d('0x3d')][_0x390d('0x25')]);_0x4bd6ab[_0x390d('0x2a')]=_[_0x390d('0x2e')](_0x2c58fb[_0x390d('0x2a')]);_0x4bd6ab[_0x390d('0x42')]=_[_0x390d('0x32')](_0x4bd6ab['model'],_0x4bd6ab[_0x390d('0x2a')]);_0x336fbe[_0x390d('0x31')]=_['intersection'](_0x4bd6ab['model'],qs[_0x390d('0x33')](_0x2c58fb[_0x390d('0x2a')]['fields']));_0x336fbe[_0x390d('0x31')]=_0x336fbe[_0x390d('0x31')]['length']?_0x336fbe[_0x390d('0x31')]:_0x4bd6ab[_0x390d('0x30')];if(!_0x2c58fb[_0x390d('0x2a')][_0x390d('0x43')](_0x390d('0x44'))){_0x336fbe[_0x390d('0x17')]=qs[_0x390d('0x17')](_0x2c58fb['query'][_0x390d('0x17')]);_0x336fbe[_0x390d('0x15')]=qs['offset'](_0x2c58fb['query']['offset']);}_0x336fbe[_0x390d('0x45')]=qs[_0x390d('0x46')](_0x2c58fb[_0x390d('0x2a')][_0x390d('0x46')]);_0x336fbe[_0x390d('0x47')]=qs[_0x390d('0x42')](_['pick'](_0x2c58fb['query'],_0x4bd6ab[_0x390d('0x42')]));_0x336fbe['where'][_0x390d('0x48')]=_0x19af36['id'];if(_0x2c58fb[_0x390d('0x2a')][_0x390d('0x49')]){_0x336fbe[_0x390d('0x47')]=_[_0x390d('0x35')](_0x336fbe[_0x390d('0x47')],{'$or':_[_0x390d('0x24')](_0x336fbe['attributes'],function(_0xa9b3bf){var _0x1b4591={};_0x1b4591[_0xa9b3bf]={'$like':'%'+_0x2c58fb[_0x390d('0x2a')][_0x390d('0x49')]+'%'};return _0x1b4591;})});}if(_0x2c58fb[_0x390d('0x2a')][_0x390d('0x4a')]){var _0x1546ad=_0x2c58fb[_0x390d('0x2a')]['$gte'][_0x390d('0x4b')](',');var _0x5245d7={};_0x5245d7[_0x1546ad[0x0]]={'$gte':moment(_0x1546ad[0x1])['format'](_0x390d('0x4c'))};_0x336fbe[_0x390d('0x47')]=_[_0x390d('0x35')](_0x336fbe['where'],_0x5245d7);}_0x336fbe=_[_0x390d('0x35')]({},_0x336fbe,_0x2c58fb[_0x390d('0x36')]);return db['MailMessage'][_0x390d('0x18')]({'where':_0x336fbe['where']})[_0x390d('0x1b')](function(_0x327904){_0x427cc3[_0x390d('0x18')]=_0x327904;if(_0x2c58fb[_0x390d('0x2a')][_0x390d('0x34')]){_0x336fbe[_0x390d('0x4d')]=[{'all':!![]}];}return db[_0x390d('0x3d')][_0x390d('0x4e')](_0x336fbe);})[_0x390d('0x1b')](function(_0x4b063a){if(_0x2c58fb[_0x390d('0x2a')][_0x390d('0x4f')]==='true'){for(var _0x86bf5d=0x0;_0x86bf5d<_0x4b063a[_0x390d('0x50')];_0x86bf5d++){_0x4b063a[_0x86bf5d][_0x390d('0x39')]=juice(_0x4b063a[_0x86bf5d][_0x390d('0x39')]);}}_0x427cc3['rows']=_0x4b063a;return _0x427cc3;});}})[_0x390d('0x1b')](respondWithFilteredResult(_0x441c09,_0x336fbe))[_0x390d('0x2c')](handleError(_0x441c09,null));};exports['addTags']=function(_0x5480fa,_0x13482a){return db[_0x390d('0x2f')]['find']({'where':{'id':_0x5480fa[_0x390d('0x3a')]['id']}})['then'](handleEntityNotFound(_0x13482a,null))[_0x390d('0x1b')](function(_0x47824f){if(_0x47824f){return _0x47824f[_0x390d('0x51')](_0x5480fa[_0x390d('0x39')][_0x390d('0x3f')],_[_0x390d('0x3e')](_0x5480fa['body'],[_0x390d('0x3f'),'id'])||{})['spread'](function(){return db[_0x390d('0x52')]['findAll']({'attributes':['id',_0x390d('0x21'),_0x390d('0x53')],'where':{'id':_0x5480fa[_0x390d('0x39')]['ids']}});})[_0x390d('0x1b')](function(_0x1a8a42){socket[_0x390d('0x54')](_0x390d('0x55'),{'id':Number(_0x5480fa[_0x390d('0x3a')]['id']),'tags':_0x1a8a42||[]});return{'id':Number(_0x5480fa[_0x390d('0x3a')]['id']),'tags':_0x1a8a42||[]};});}})[_0x390d('0x1b')](respondWithResult(_0x13482a,null))[_0x390d('0x2c')](handleError(_0x13482a,null));};exports['removeTags']=function(_0x122999,_0x13278b){return db['MailInteraction']['find']({'where':{'id':_0x122999[_0x390d('0x3a')]['id']}})[_0x390d('0x1b')](handleEntityNotFound(_0x13278b,null))['then'](function(_0x101340){if(_0x101340){return _0x101340[_0x390d('0x56')](_0x122999['query'][_0x390d('0x3f')]);}})[_0x390d('0x1b')](respondWithStatusCode(_0x13278b,null))[_0x390d('0x2c')](handleError(_0x13278b,null));};exports[_0x390d('0x57')]=function(_0x3b1cb4,_0x1c0030){var _0x584397=moment()[_0x390d('0x58')]()[_0x390d('0x59')]();var _0xdbb9e5=path[_0x390d('0x5a')](config['root'],'server',_0x390d('0x5b'),_0x390d('0x5c'));var _0x523126=path[_0x390d('0x5a')](config['root'],_0x390d('0x5d'),_0x390d('0x5b'),_0x390d('0x5e'));var _0x39df34=path[_0x390d('0x5a')](_0xdbb9e5,_0x584397);var _0x461859=util[_0x390d('0x5f')](_0x390d('0x60'),_0x3b1cb4[_0x390d('0x3a')]['id'],_0x584397);var _0x14076d=path[_0x390d('0x5a')](_0xdbb9e5,_0x461859);var _0x21f201=[];if(_0x3b1cb4[_0x390d('0x2a')][_0x390d('0x5e')]){_0x21f201[_0x390d('0x61')]({'model':db[_0x390d('0x62')],'as':'Attachments','raw':!![]});}var _0xc3f14a=[{'model':db['MailMessage'],'as':_0x390d('0x63'),'attributes':['id',_0x390d('0x39'),'from','to','cc',_0x390d('0x64'),_0x390d('0x65'),'createdAt'],'where':{'secret':![]},'order':qs['sort']('id'),'include':_0x21f201}];return db[_0x390d('0x2f')][_0x390d('0x37')]({'where':{'id':_0x3b1cb4[_0x390d('0x3a')]['id']},'include':_0xc3f14a})[_0x390d('0x1b')](handleEntityNotFound(_0x1c0030,null))['then'](function(_0x444b0a){if(_0x444b0a&&_0x444b0a[_0x390d('0x63')]){var _0x4ebff6=_0x444b0a[_0x390d('0x66')]({'plain':!![]});fs[_0x390d('0x67')](_0x39df34);return BPromise['each'](_0x4ebff6[_0x390d('0x63')],function(_0x177a0d,_0x26c4ae){var _0x2bc6ba={'from':_0x177a0d['from'],'to':_0x177a0d['to']||_0x390d('0x68'),'subject':_0x177a0d[_0x390d('0x65')],'html':htmlEntities[_0x390d('0x69')](_0x177a0d[_0x390d('0x39')]),'headers':{'Date':moment(_0x177a0d[_0x390d('0x6a')])[_0x390d('0x5f')](_0x390d('0x6b'))},'attachments':[]};if(_0x177a0d['cc']){_0x2bc6ba[_0x390d('0x6c')]['Cc']=_0x177a0d['cc'];}if(_0x177a0d[_0x390d('0x64')]){_0x2bc6ba[_0x390d('0x6c')][_0x390d('0x6d')]=_0x177a0d[_0x390d('0x64')];}return new BPromise(function(_0x4dd8d2,_0x14472a){if(_0x177a0d[_0x390d('0x6e')]){for(var _0x9a098e=0x0;_0x9a098e<_0x177a0d['Attachments'][_0x390d('0x50')];_0x9a098e++){var _0x26fed1=_0x177a0d[_0x390d('0x6e')][_0x9a098e];var _0x4a834d=path['join'](_0x523126,_0x26fed1[_0x390d('0x6f')]);if(fs[_0x390d('0x70')](_0x4a834d)){_0x2bc6ba[_0x390d('0x5e')]['push']({'name':_0x26fed1[_0x390d('0x21')],'contentType':_0x26fed1[_0x390d('0x27')],'data':fs['readFileSync'](_0x4a834d)});}}}emlformat[_0x390d('0x71')](_0x2bc6ba,function(_0x11365c,_0x6dfefe){if(_0x11365c)return _0x14472a(_0x11365c);fs['writeFileSync'](path[_0x390d('0x5a')](_0x39df34,util[_0x390d('0x5f')](_0x390d('0x72'),_0x26c4ae)),_0x6dfefe);return _0x4dd8d2(_0x6dfefe);});});})['then'](function(){return new BPromise(function(_0x22999,_0x1bac81){zipdir(_0x39df34,{'saveTo':_0x14076d},function(_0x5a79e3,_0x2c5830){if(_0x5a79e3)return _0x1bac81(_0x5a79e3);return _0x22999(_0x2c5830);});})['then'](function(){return new BPromise(function(_0x38dad5,_0x1414b1){rimraf(_0x39df34,function(_0x44bc22){if(_0x44bc22)_0x1414b1(_0x44bc22);return _0x38dad5();});});})[_0x390d('0x1b')](function(){return _0x1c0030[_0x390d('0x57')](_0x14076d,_0x461859,function(_0x17b939){if(!_0x17b939)fs['unlinkSync'](_0x14076d);});});});}else{return _0x1c0030[_0x390d('0x1e')](0xc8);}})[_0x390d('0x2c')](handleError(_0x1c0030,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index 8f7fdb6..9f306db 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 _0xfb5a=['length','emit','catch','hasOwnProperty','exports','../../mysqldb','MailInteraction','MailMessage','setMaxListeners','save','update','remove','then','Users','map','findAll','unreadMessages'];(function(_0x527943,_0x500c71){var _0xc496fe=function(_0x5255f3){while(--_0x5255f3){_0x527943['push'](_0x527943['shift']());}};_0xc496fe(++_0x500c71);}(_0xfb5a,0xe2));var _0xafb5=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xfb5a[_0x3bf83f];return _0x22c4a9;};'use strict';var EventEmitter=require('events');var MailInteraction=require(_0xafb5('0x0'))['db'][_0xafb5('0x1')];var MailMessage=require(_0xafb5('0x0'))['db'][_0xafb5('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xafb5('0x3')](0x0);var events={'afterCreate':_0xafb5('0x4'),'afterUpdate':_0xafb5('0x5'),'afterDestroy':_0xafb5('0x6')};function emitEvent(_0x48bd00){return function(_0x41ef85,_0x54c4c5,_0x40673d){_0x41ef85['getUsers']({'attributes':['id'],'raw':!![]})[_0xafb5('0x7')](function(_0x4a176c){_0x41ef85['setDataValue'](_0xafb5('0x8'),_0x4a176c[_0xafb5('0x9')](function(_0x2d6a83){return{'id':_0x2d6a83['id']};}));return MailMessage[_0xafb5('0xa')]({'where':{'MailInteractionId':_0x41ef85['id'],'direction':'in','read':![]},'raw':!![]});})[_0xafb5('0x7')](function(_0x342167){_0x41ef85['setDataValue'](_0xafb5('0xb'),_0x342167[_0xafb5('0xc')]);MailInteractionEvents[_0xafb5('0xd')](_0x48bd00+':'+_0x41ef85['id'],_0x41ef85);MailInteractionEvents['emit'](_0x48bd00,_0x41ef85);_0x40673d(null);})[_0xafb5('0xe')](_0x40673d(null));};}for(var e in events){if(events[_0xafb5('0xf')](e)){var event=events[e];MailInteraction['hook'](e,emitEvent(event));}}module[_0xafb5('0x10')]=MailInteractionEvents; \ No newline at end of file +var _0x3511=['MailMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','map','findAll','length','emit','hasOwnProperty','hook','exports','events','MailInteraction','../../mysqldb'];(function(_0x3d145d,_0x3aa561){var _0x200285=function(_0x51e7ce){while(--_0x51e7ce){_0x3d145d['push'](_0x3d145d['shift']());}};_0x200285(++_0x3aa561);}(_0x3511,0xbb));var _0x1351=function(_0x594c6d,_0x4d984f){_0x594c6d=_0x594c6d-0x0;var _0x522757=_0x3511[_0x594c6d];return _0x522757;};'use strict';var EventEmitter=require(_0x1351('0x0'));var MailInteraction=require('../../mysqldb')['db'][_0x1351('0x1')];var MailMessage=require(_0x1351('0x2'))['db'][_0x1351('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x1351('0x4')](0x0);var events={'afterCreate':_0x1351('0x5'),'afterUpdate':_0x1351('0x6'),'afterDestroy':_0x1351('0x7')};function emitEvent(_0x46b9b8){return function(_0x228fb8,_0x5b4006,_0x4e6484){_0x228fb8[_0x1351('0x8')]({'attributes':['id'],'raw':!![]})[_0x1351('0x9')](function(_0x4d17bb){_0x228fb8[_0x1351('0xa')](_0x1351('0xb'),_0x4d17bb[_0x1351('0xc')](function(_0x291584){return{'id':_0x291584['id']};}));return MailMessage[_0x1351('0xd')]({'where':{'MailInteractionId':_0x228fb8['id'],'direction':'in','read':![]},'raw':!![]});})[_0x1351('0x9')](function(_0xc8cefc){_0x228fb8[_0x1351('0xa')]('unreadMessages',_0xc8cefc[_0x1351('0xe')]);MailInteractionEvents['emit'](_0x46b9b8+':'+_0x228fb8['id'],_0x228fb8);MailInteractionEvents[_0x1351('0xf')](_0x46b9b8,_0x228fb8);_0x4e6484(null);})['catch'](_0x4e6484(null));};}for(var e in events){if(events[_0x1351('0x10')](e)){var event=events[e];MailInteraction[_0x1351('0x11')](e,emitEvent(event));}}module[_0x1351('0x12')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index 8f48f6f..c7a96ea 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 _0xb9b7=['YYYY-MM-DD\x20HH:mm:ss','models','get','MailMessage','update','then','utf8mb4','lodash','util','../../config/logger','api','path','rimraf','./mailInteraction.attributes','exports','define','MailInteraction','mail_interactions','fti_mail_interactions','subject','FULLTEXT','closed','closedAt','changed','substatusAt','substatus','format'];(function(_0x37707b,_0x5af286){var _0x258850=function(_0x4f7e71){while(--_0x4f7e71){_0x37707b['push'](_0x37707b['shift']());}};_0x258850(++_0x5af286);}(_0xb9b7,0x19c));var _0x7b9b=function(_0x36d5f4,_0x3fc530){_0x36d5f4=_0x36d5f4-0x0;var _0x4c0fc7=_0xb9b7[_0x36d5f4];return _0x4c0fc7;};'use strict';var _=require(_0x7b9b('0x0'));var util=require(_0x7b9b('0x1'));var logger=require(_0x7b9b('0x2'))(_0x7b9b('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x7b9b('0x4'));var rimraf=require(_0x7b9b('0x5'));var config=require('../../config/environment');var attributes=require(_0x7b9b('0x6'));module[_0x7b9b('0x7')]=function(_0x56b5c2,_0x358a26){return _0x56b5c2[_0x7b9b('0x8')](_0x7b9b('0x9'),attributes,{'tableName':_0x7b9b('0xa'),'paranoid':![],'indexes':[{'name':_0x7b9b('0xb'),'fields':[_0x7b9b('0xc'),'to'],'type':_0x7b9b('0xd')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4ab945,_0x34df46,_0x444470){if(_0x4ab945['substatus']){_0x4ab945['substatusAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}if(_0x4ab945[_0x7b9b('0xe')]){_0x4ab945[_0x7b9b('0xf')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x444470(null,_0x34df46);},'beforeUpdate':function(_0x2a030c,_0x5bacb1,_0xaaee7){if(_0x2a030c[_0x7b9b('0x10')]('substatus')){_0x2a030c[_0x7b9b('0x11')]=_0x2a030c[_0x7b9b('0x12')]?moment()[_0x7b9b('0x13')](_0x7b9b('0x14')):null;}if(_0x2a030c['changed']('closed')){_0x2a030c[_0x7b9b('0xf')]=moment()['format'](_0x7b9b('0x14'));_0x2a030c[_0x7b9b('0x12')]=null;_0x2a030c['substatusAt']=null;}_0xaaee7(null,_0x2a030c);},'afterUpdate':function(_0x52746a,_0x24268a,_0x1e3137){var _0x4cc753=_0x56b5c2[_0x7b9b('0x15')];var _0x28e336=_0x52746a[_0x7b9b('0x16')]({'plain':!![]});if(_0x28e336[_0x7b9b('0xe')]){return _0x4cc753[_0x7b9b('0x17')][_0x7b9b('0x18')]({'read':!![]},{'where':{'MailInteractionId':_0x28e336['id']}})[_0x7b9b('0x19')](function(){_0x1e3137();})['catch'](function(_0x53a906){_0x1e3137(_0x53a906);});}else{_0x1e3137();}}},'charset':_0x7b9b('0x1a'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x62b1=['MailInteraction','mail_interactions','subject','FULLTEXT','substatusAt','format','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','substatus','changed','get','MailMessage','update','then','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','rimraf','./mailInteraction.attributes','exports','define'];(function(_0x4b125e,_0x136d4b){var _0x3090a6=function(_0x4f385f){while(--_0x4f385f){_0x4b125e['push'](_0x4b125e['shift']());}};_0x3090a6(++_0x136d4b);}(_0x62b1,0x11f));var _0x162b=function(_0x3b1aac,_0x3b9fd6){_0x3b1aac=_0x3b1aac-0x0;var _0x18368c=_0x62b1[_0x3b1aac];return _0x18368c;};'use strict';var _=require(_0x162b('0x0'));var util=require(_0x162b('0x1'));var logger=require('../../config/logger')(_0x162b('0x2'));var moment=require(_0x162b('0x3'));var BPromise=require(_0x162b('0x4'));var rp=require(_0x162b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x162b('0x6'));var config=require('../../config/environment');var attributes=require(_0x162b('0x7'));module[_0x162b('0x8')]=function(_0x34d915,_0x155c7b){return _0x34d915[_0x162b('0x9')](_0x162b('0xa'),attributes,{'tableName':_0x162b('0xb'),'paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':[_0x162b('0xc'),'to'],'type':_0x162b('0xd')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x3c75e1,_0x281b80,_0x52db29){if(_0x3c75e1['substatus']){_0x3c75e1[_0x162b('0xe')]=moment()[_0x162b('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x3c75e1[_0x162b('0x10')]){_0x3c75e1[_0x162b('0x11')]=moment()[_0x162b('0xf')](_0x162b('0x12'));}_0x52db29(null,_0x281b80);},'beforeUpdate':function(_0x160684,_0x5acac1,_0x47a393){if(_0x160684['changed'](_0x162b('0x13'))){_0x160684[_0x162b('0xe')]=_0x160684[_0x162b('0x13')]?moment()[_0x162b('0xf')]('YYYY-MM-DD\x20HH:mm:ss'):null;}if(_0x160684[_0x162b('0x14')](_0x162b('0x10'))){_0x160684['closedAt']=moment()[_0x162b('0xf')]('YYYY-MM-DD\x20HH:mm:ss');_0x160684[_0x162b('0x13')]=null;_0x160684[_0x162b('0xe')]=null;}_0x47a393(null,_0x160684);},'afterUpdate':function(_0x52f4c7,_0xd4e82b,_0x54c7f6){var _0x320718=_0x34d915['models'];var _0x4d6562=_0x52f4c7[_0x162b('0x15')]({'plain':!![]});if(_0x4d6562['closed']){return _0x320718[_0x162b('0x16')][_0x162b('0x17')]({'read':!![]},{'where':{'MailInteractionId':_0x4d6562['id']}})[_0x162b('0x18')](function(){_0x54c7f6();})['catch'](function(_0x4e6de7){_0x54c7f6(_0x4e6de7);});}else{_0x54c7f6();}}},'charset':_0x162b('0x19'),'collate':_0x162b('0x1a')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index 672e7bc..0e7e817 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 _0x912e=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','./mailInteraction.socket','register','request','then','MailInteraction,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','MailInteraction','update','body','options','raw','where','attributes','limit','UpdateMailInteraction','debug','catch','ids','omit','AddTags','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x4f8f1f,_0x2bf431){var _0x235e97=function(_0x1b6357){while(--_0x1b6357){_0x4f8f1f['push'](_0x4f8f1f['shift']());}};_0x235e97(++_0x2bf431);}(_0x912e,0xe5));var _0xe912=function(_0x1dbf17,_0x1c7f20){_0x1dbf17=_0x1dbf17-0x0;var _0x356aac=_0x912e[_0x1dbf17];return _0x356aac;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe912('0x0'));var BPromise=require(_0xe912('0x1'));var rs=require(_0xe912('0x2'));var fs=require('fs');var Redis=require(_0xe912('0x3'));var db=require(_0xe912('0x4'))['db'];var utils=require(_0xe912('0x5'));var logger=require(_0xe912('0x6'))(_0xe912('0x7'));var config=require('../../config/environment');var jayson=require(_0xe912('0x8'));var client=jayson[_0xe912('0x9')][_0xe912('0xa')]({'port':0x232a});config[_0xe912('0xb')]=_[_0xe912('0xc')](config[_0xe912('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xe912('0xd'))(new Redis(config[_0xe912('0xb')]));require(_0xe912('0xe'))[_0xe912('0xf')](socket);function respondWithRpcPromise(_0x584d73,_0xd7873e,_0x40cd0e){return new BPromise(function(_0xa07018,_0x3e27a3){return client[_0xe912('0x10')](_0x584d73,_0x40cd0e)[_0xe912('0x11')](function(_0x171827){logger['info'](_0xe912('0x12'),_0xd7873e,'request\x20sent');logger['debug']('MailInteraction,\x20%s,\x20%s,\x20%s',_0xd7873e,_0xe912('0x13'),JSON[_0xe912('0x14')](_0x171827));if(_0x171827[_0xe912('0x15')]){if(_0x171827[_0xe912('0x15')][_0xe912('0x16')]===0x1f4){logger['error'](_0xe912('0x12'),_0xd7873e,_0x171827[_0xe912('0x15')]['message']);return _0x3e27a3(_0x171827[_0xe912('0x15')][_0xe912('0x17')]);}logger[_0xe912('0x15')]('MailInteraction,\x20%s,\x20%s',_0xd7873e,_0x171827[_0xe912('0x15')][_0xe912('0x17')]);return _0xa07018(_0x171827[_0xe912('0x15')][_0xe912('0x17')]);}else{logger[_0xe912('0x18')]('MailInteraction,\x20%s,\x20%s',_0xd7873e,_0xe912('0x13'));_0xa07018(_0x171827['result']['message']);}})['catch'](function(_0x386173){logger[_0xe912('0x15')]('MailInteraction,\x20%s,\x20%s',_0xd7873e,_0x386173);_0x3e27a3(_0x386173);});});}exports['UpdateMailInteraction']=function(_0x42790f){var _0x196f1f=this;return new Promise(function(_0xe2b5f3,_0x40f95b){return db[_0xe912('0x19')][_0xe912('0x1a')](_0x42790f[_0xe912('0x1b')],{'raw':_0x42790f[_0xe912('0x1c')]?_0x42790f['options'][_0xe912('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x42790f['options']?_0x42790f['options'][_0xe912('0x1e')]||null:null,'attributes':_0x42790f[_0xe912('0x1c')]?_0x42790f[_0xe912('0x1c')][_0xe912('0x1f')]||null:null,'limit':_0x42790f[_0xe912('0x1c')]?_0x42790f[_0xe912('0x1c')][_0xe912('0x20')]||null:null})['then'](function(_0x4046c1){logger['info'](_0xe912('0x21'),_0x42790f);logger[_0xe912('0x22')](_0xe912('0x21'),_0x42790f,JSON[_0xe912('0x14')](_0x4046c1));_0xe2b5f3(_0x4046c1);})[_0xe912('0x23')](function(_0x3c47ee){logger['error'](_0xe912('0x21'),_0x3c47ee[_0xe912('0x17')],_0x42790f);_0x40f95b(_0x196f1f[_0xe912('0x15')](0x1f4,_0x3c47ee[_0xe912('0x17')]));});});};exports['AddTagsToMailInteraction']=function(_0x1b6136){return new Promise(function(_0x2ef76f,_0x15ee73){return db[_0xe912('0x19')]['find']({'where':_0x1b6136[_0xe912('0x1c')]?_0x1b6136[_0xe912('0x1c')]['where']||null:null})['then'](function(_0x2dbc6a){if(_0x2dbc6a){return _0x2dbc6a['addTags'](_0x1b6136[_0xe912('0x1b')][_0xe912('0x24')],_[_0xe912('0x25')](_0x1b6136[_0xe912('0x1b')],['ids','id'])||{});}})['spread'](function(_0x2b679a){logger[_0xe912('0x18')](_0xe912('0x26'),_0x1b6136);logger['debug'](_0xe912('0x26'),_0x1b6136,JSON[_0xe912('0x14')](_0x2b679a));_0x2ef76f(_0x2b679a);})[_0xe912('0x23')](function(_0x166681){logger[_0xe912('0x15')]('AddTags',_0x166681[_0xe912('0x17')],_0x1b6136);_0x15ee73(_this[_0xe912('0x15')](0x1f4,_0x166681['message']));});});}; \ No newline at end of file +var _0xf984=['update','body','options','raw','where','attributes','limit','AddTagsToMailInteraction','addTags','ids','omit','spread','AddTags','lodash','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./mailInteraction.socket','register','then','info','MailInteraction,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','UpdateMailInteraction','MailInteraction'];(function(_0x41db88,_0x3f3af7){var _0x39eaff=function(_0x50c9ed){while(--_0x50c9ed){_0x41db88['push'](_0x41db88['shift']());}};_0x39eaff(++_0x3f3af7);}(_0xf984,0x193));var _0x4f98=function(_0x141e26,_0x18b19c){_0x141e26=_0x141e26-0x0;var _0xf0d405=_0xf984[_0x141e26];return _0xf0d405;};'use strict';var _=require(_0x4f98('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x4f98('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4f98('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x4f98('0x3'));var logger=require(_0x4f98('0x4'))(_0x4f98('0x5'));var config=require(_0x4f98('0x6'));var jayson=require(_0x4f98('0x7'));var client=jayson[_0x4f98('0x8')]['http']({'port':0x232a});config[_0x4f98('0x9')]=_[_0x4f98('0xa')](config[_0x4f98('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x4f98('0xb'))(new Redis(config[_0x4f98('0x9')]));require(_0x4f98('0xc'))[_0x4f98('0xd')](socket);function respondWithRpcPromise(_0x547ae6,_0x3e0e57,_0x288989){return new BPromise(function(_0x31896f,_0x1c0a35){return client['request'](_0x547ae6,_0x288989)[_0x4f98('0xe')](function(_0x13837e){logger[_0x4f98('0xf')](_0x4f98('0x10'),_0x3e0e57,'request\x20sent');logger[_0x4f98('0x11')]('MailInteraction,\x20%s,\x20%s,\x20%s',_0x3e0e57,_0x4f98('0x12'),JSON[_0x4f98('0x13')](_0x13837e));if(_0x13837e[_0x4f98('0x14')]){if(_0x13837e[_0x4f98('0x14')][_0x4f98('0x15')]===0x1f4){logger[_0x4f98('0x14')]('MailInteraction,\x20%s,\x20%s',_0x3e0e57,_0x13837e[_0x4f98('0x14')][_0x4f98('0x16')]);return _0x1c0a35(_0x13837e[_0x4f98('0x14')][_0x4f98('0x16')]);}logger['error'](_0x4f98('0x10'),_0x3e0e57,_0x13837e[_0x4f98('0x14')][_0x4f98('0x16')]);return _0x31896f(_0x13837e['error'][_0x4f98('0x16')]);}else{logger['info'](_0x4f98('0x10'),_0x3e0e57,_0x4f98('0x12'));_0x31896f(_0x13837e['result'][_0x4f98('0x16')]);}})[_0x4f98('0x17')](function(_0x49061f){logger[_0x4f98('0x14')](_0x4f98('0x10'),_0x3e0e57,_0x49061f);_0x1c0a35(_0x49061f);});});}exports[_0x4f98('0x18')]=function(_0x4e252){var _0x3114e0=this;return new Promise(function(_0x169c89,_0x1e5a92){return db[_0x4f98('0x19')][_0x4f98('0x1a')](_0x4e252[_0x4f98('0x1b')],{'raw':_0x4e252[_0x4f98('0x1c')]?_0x4e252[_0x4f98('0x1c')][_0x4f98('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4e252[_0x4f98('0x1c')]?_0x4e252[_0x4f98('0x1c')][_0x4f98('0x1e')]||null:null,'attributes':_0x4e252['options']?_0x4e252[_0x4f98('0x1c')][_0x4f98('0x1f')]||null:null,'limit':_0x4e252[_0x4f98('0x1c')]?_0x4e252['options'][_0x4f98('0x20')]||null:null})['then'](function(_0x486330){logger[_0x4f98('0xf')](_0x4f98('0x18'),_0x4e252);logger['debug']('UpdateMailInteraction',_0x4e252,JSON['stringify'](_0x486330));_0x169c89(_0x486330);})[_0x4f98('0x17')](function(_0x170bb2){logger[_0x4f98('0x14')](_0x4f98('0x18'),_0x170bb2['message'],_0x4e252);_0x1e5a92(_0x3114e0['error'](0x1f4,_0x170bb2[_0x4f98('0x16')]));});});};exports[_0x4f98('0x21')]=function(_0xcd5f20){return new Promise(function(_0x29ec6d,_0x5b0d2a){return db[_0x4f98('0x19')]['find']({'where':_0xcd5f20[_0x4f98('0x1c')]?_0xcd5f20[_0x4f98('0x1c')][_0x4f98('0x1e')]||null:null})[_0x4f98('0xe')](function(_0x540420){if(_0x540420){return _0x540420[_0x4f98('0x22')](_0xcd5f20[_0x4f98('0x1b')][_0x4f98('0x23')],_[_0x4f98('0x24')](_0xcd5f20[_0x4f98('0x1b')],[_0x4f98('0x23'),'id'])||{});}})[_0x4f98('0x25')](function(_0x347df0){logger[_0x4f98('0xf')](_0x4f98('0x26'),_0xcd5f20);logger[_0x4f98('0x11')]('AddTags',_0xcd5f20,JSON[_0x4f98('0x13')](_0x347df0));_0x29ec6d(_0x347df0);})[_0x4f98('0x17')](function(_0x1e9ff6){logger[_0x4f98('0x14')]('AddTags',_0x1e9ff6[_0x4f98('0x16')],_0xcd5f20);_0x5b0d2a(_this[_0x4f98('0x14')](0x1f4,_0x1e9ff6['message']));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index adbd181..ea1fc1c 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 _0x0334=['remove','update','emit','removeListener','register','length','./mailInteraction.events','save'];(function(_0xbfec58,_0x5f4153){var _0x3dc84d=function(_0x498ef6){while(--_0x498ef6){_0xbfec58['push'](_0xbfec58['shift']());}};_0x3dc84d(++_0x5f4153);}(_0x0334,0x1de));var _0x4033=function(_0x38c928,_0x58c48f){_0x38c928=_0x38c928-0x0;var _0x2a959a=_0x0334[_0x38c928];return _0x2a959a;};'use strict';var MailInteractionEvents=require(_0x4033('0x0'));var events=[_0x4033('0x1'),_0x4033('0x2'),_0x4033('0x3')];function createListener(_0xa044d2,_0x186c3d){return function(_0x2af7a6){_0x186c3d[_0x4033('0x4')](_0xa044d2,_0x2af7a6);};}function removeListener(_0x483d5d,_0xbce1ac){return function(){MailInteractionEvents[_0x4033('0x5')](_0x483d5d,_0xbce1ac);};}exports[_0x4033('0x6')]=function(_0x408cc5){for(var _0x6c314c=0x0,_0x50f84b=events[_0x4033('0x7')];_0x6c314c<_0x50f84b;_0x6c314c++){var _0x466c26=events[_0x6c314c];var _0x4d3024=createListener('mailInteraction:'+_0x466c26,_0x408cc5);MailInteractionEvents['on'](_0x466c26,_0x4d3024);}}; \ No newline at end of file +var _0x1e12=['remove','update','emit','removeListener','mailInteraction:','./mailInteraction.events'];(function(_0x3aef3b,_0x17a660){var _0x439021=function(_0x27f87d){while(--_0x27f87d){_0x3aef3b['push'](_0x3aef3b['shift']());}};_0x439021(++_0x17a660);}(_0x1e12,0x131));var _0x21e1=function(_0x3e0735,_0x1e221b){_0x3e0735=_0x3e0735-0x0;var _0x1391f7=_0x1e12[_0x3e0735];return _0x1391f7;};'use strict';var MailInteractionEvents=require(_0x21e1('0x0'));var events=['save',_0x21e1('0x1'),_0x21e1('0x2')];function createListener(_0x42a55b,_0x5e569a){return function(_0x1e9959){_0x5e569a[_0x21e1('0x3')](_0x42a55b,_0x1e9959);};}function removeListener(_0x2bb78e,_0x53f811){return function(){MailInteractionEvents[_0x21e1('0x4')](_0x2bb78e,_0x53f811);};}exports['register']=function(_0x139d43){for(var _0x5d8c9e=0x0,_0x3609f5=events['length'];_0x5d8c9e<_0x3609f5;_0x5d8c9e++){var _0x83c382=events[_0x5d8c9e];var _0x5b8815=createListener(_0x21e1('0x5')+_0x83c382,_0x139d43);MailInteractionEvents['on'](_0x83c382,_0x5b8815);}}; \ No newline at end of file diff --git a/server/api/mailInteractionHasTag/index.js b/server/api/mailInteractionHasTag/index.js index de048c7..72b15f0 100644 --- a/server/api/mailInteractionHasTag/index.js +++ b/server/api/mailInteractionHasTag/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6822=['/describe','isAuthenticated','describe','exports','express','Router','../../components/auth/service','./mailInteractionHasTag.controller','get'];(function(_0x34d28b,_0x46b5e3){var _0x5583ec=function(_0x1d5273){while(--_0x1d5273){_0x34d28b['push'](_0x34d28b['shift']());}};_0x5583ec(++_0x46b5e3);}(_0x6822,0xca));var _0x2682=function(_0x34778a,_0x563f8c){_0x34778a=_0x34778a-0x0;var _0x15ba20=_0x6822[_0x34778a];return _0x15ba20;};'use strict';var express=require(_0x2682('0x0'));var router=express[_0x2682('0x1')]();var auth=require(_0x2682('0x2'));var controller=require(_0x2682('0x3'));router[_0x2682('0x4')](_0x2682('0x5'),auth[_0x2682('0x6')](),controller[_0x2682('0x7')]);module[_0x2682('0x8')]=router; \ No newline at end of file +var _0x3274=['express','../../components/auth/service','./mailInteractionHasTag.controller','/describe','isAuthenticated','describe','exports'];(function(_0x189978,_0x48d117){var _0x1a7dc8=function(_0x4a5df3){while(--_0x4a5df3){_0x189978['push'](_0x189978['shift']());}};_0x1a7dc8(++_0x48d117);}(_0x3274,0x134));var _0x4327=function(_0x3cabaa,_0xc09d02){_0x3cabaa=_0x3cabaa-0x0;var _0xe69a93=_0x3274[_0x3cabaa];return _0xe69a93;};'use strict';var express=require(_0x4327('0x0'));var router=express['Router']();var auth=require(_0x4327('0x1'));var controller=require(_0x4327('0x2'));router['get'](_0x4327('0x3'),auth[_0x4327('0x4')](),controller[_0x4327('0x5')]);module[_0x4327('0x6')]=router; \ No newline at end of file diff --git a/server/api/mailInteractionHasTag/mailInteractionHasTag.controller.js b/server/api/mailInteractionHasTag/mailInteractionHasTag.controller.js index f5b7880..d100f37 100644 --- a/server/api/mailInteractionHasTag/mailInteractionHasTag.controller.js +++ b/server/api/mailInteractionHasTag/mailInteractionHasTag.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['catch','../../config/logger','api','../../mysqldb','json','error','name','status','describe','then'];(function(_0x1b4705,_0x32c799){var _0x43e422=function(_0x46f899){while(--_0x46f899){_0x1b4705['push'](_0x1b4705['shift']());}};_0x43e422(++_0x32c799);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0xa9e0[_0x1cfa0d];return _0xe33279;};'use strict';var logger=require(_0x0a9e('0x0'))(_0x0a9e('0x1'));var db=require(_0x0a9e('0x2'))['db'];function respondWithResult(_0x5dd881,_0x550fbc){_0x550fbc=_0x550fbc||0xc8;return function(_0x18d5c9){if(_0x18d5c9){return _0x5dd881['status'](_0x550fbc)[_0x0a9e('0x3')](_0x18d5c9);}};}function handleError(_0x432180,_0x2ab90b){_0x2ab90b=_0x2ab90b||0x1f4;return function(_0x991246){logger[_0x0a9e('0x4')](_0x991246['stack']);if(_0x991246[_0x0a9e('0x5')]){delete _0x991246[_0x0a9e('0x5')];}_0x432180[_0x0a9e('0x6')](_0x2ab90b)['send'](_0x991246);};}exports['describe']=function(_0xe42b77,_0x56465b){return db['MailInteractionHasTag'][_0x0a9e('0x7')]()[_0x0a9e('0x8')](respondWithResult(_0x56465b,null))[_0x0a9e('0x9')](handleError(_0x56465b,null));}; \ No newline at end of file +var _0xa9e0=['catch','../../config/logger','api','../../mysqldb','json','error','name','status','describe','then'];(function(_0x146689,_0x46f515){var _0x286567=function(_0x278e6d){while(--_0x278e6d){_0x146689['push'](_0x146689['shift']());}};_0x286567(++_0x46f515);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xa9e0[_0x37bd26];return _0xe83dc4;};'use strict';var logger=require(_0x0a9e('0x0'))(_0x0a9e('0x1'));var db=require(_0x0a9e('0x2'))['db'];function respondWithResult(_0x5dd881,_0x550fbc){_0x550fbc=_0x550fbc||0xc8;return function(_0x18d5c9){if(_0x18d5c9){return _0x5dd881['status'](_0x550fbc)[_0x0a9e('0x3')](_0x18d5c9);}};}function handleError(_0x432180,_0x2ab90b){_0x2ab90b=_0x2ab90b||0x1f4;return function(_0x991246){logger[_0x0a9e('0x4')](_0x991246['stack']);if(_0x991246[_0x0a9e('0x5')]){delete _0x991246[_0x0a9e('0x5')];}_0x432180[_0x0a9e('0x6')](_0x2ab90b)['send'](_0x991246);};}exports['describe']=function(_0xe42b77,_0x56465b){return db['MailInteractionHasTag'][_0x0a9e('0x7')]()[_0x0a9e('0x8')](respondWithResult(_0x56465b,null))[_0x0a9e('0x9')](handleError(_0x56465b,null));}; \ No newline at end of file diff --git a/server/api/mailInteractionHasTag/mailInteractionHasTag.js b/server/api/mailInteractionHasTag/mailInteractionHasTag.js index 26b6793..ab0d7c9 100644 --- a/server/api/mailInteractionHasTag/mailInteractionHasTag.js +++ b/server/api/mailInteractionHasTag/mailInteractionHasTag.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9921=['INTEGER'];(function(_0xf013fd,_0x3ad206){var _0x536b8a=function(_0x4619b4){while(--_0x4619b4){_0xf013fd['push'](_0xf013fd['shift']());}};_0x536b8a(++_0x3ad206);}(_0x9921,0x1ea));var _0x1992=function(_0xfc03e6,_0x1df989){_0xfc03e6=_0xfc03e6-0x0;var _0x236055=_0x9921[_0xfc03e6];return _0x236055;};'use strict';var Sequelize=require('sequelize');module['exports']={'MailInteractionId':{'type':Sequelize['INTEGER'],'primaryKey':!![]},'TagId':{'type':Sequelize[_0x1992('0x0')],'defaultValue':null}}; \ No newline at end of file +var _0x76c5=['INTEGER','sequelize','exports'];(function(_0x4ca871,_0x4cc9bf){var _0x139b5c=function(_0x5d2f3e){while(--_0x5d2f3e){_0x4ca871['push'](_0x4ca871['shift']());}};_0x139b5c(++_0x4cc9bf);}(_0x76c5,0x160));var _0x576c=function(_0x3e5bc8,_0x457d89){_0x3e5bc8=_0x3e5bc8-0x0;var _0xfd84bc=_0x76c5[_0x3e5bc8];return _0xfd84bc;};'use strict';var Sequelize=require(_0x576c('0x0'));module[_0x576c('0x1')]={'MailInteractionId':{'type':Sequelize[_0x576c('0x2')],'primaryKey':!![]},'TagId':{'type':Sequelize['INTEGER'],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/mailInteractionHasTag/mailInteractionHasTag.model.js b/server/api/mailInteractionHasTag/mailInteractionHasTag.model.js index 4ae8136..ab7468e 100644 --- a/server/api/mailInteractionHasTag/mailInteractionHasTag.model.js +++ b/server/api/mailInteractionHasTag/mailInteractionHasTag.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x926d=['MailInteractionHasTag','mail_interaction_has_tags','./mailInteractionHasTag','exports','define'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x926d,0x8e));var _0xd926=function(_0x267509,_0x43a69f){_0x267509=_0x267509-0x0;var _0x3ea295=_0x926d[_0x267509];return _0x3ea295;};'use strict';var attributes=require(_0xd926('0x0'));module[_0xd926('0x1')]=function(_0xdaeedc){return _0xdaeedc[_0xd926('0x2')](_0xd926('0x3'),attributes,{'tableName':_0xd926('0x4'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4ead=['define','MailInteractionHasTag','mail_interaction_has_tags','exports'];(function(_0x2d9247,_0x2a2022){var _0x53a817=function(_0x50fbda){while(--_0x50fbda){_0x2d9247['push'](_0x2d9247['shift']());}};_0x53a817(++_0x2a2022);}(_0x4ead,0x183));var _0xd4ea=function(_0x40911a,_0x55ec99){_0x40911a=_0x40911a-0x0;var _0x27e8e3=_0x4ead[_0x40911a];return _0x27e8e3;};'use strict';var attributes=require('./mailInteractionHasTag');module[_0xd4ea('0x0')]=function(_0x27789a){return _0x27789a[_0xd4ea('0x1')](_0xd4ea('0x2'),attributes,{'tableName':_0xd4ea('0x3'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index eaffb55..b9b7fd7 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 _0xf3da=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailMessage.controller','get','index','/describe','/:id','show','/:id/download','isAuthenticated','download','post','tracked','mailmessage:create','create','put','accept','/:id/reject','delete','destroy','multer'];(function(_0x208972,_0x4652c0){var _0x49ec00=function(_0x3f5d01){while(--_0x3f5d01){_0x208972['push'](_0x208972['shift']());}};_0x49ec00(++_0x4652c0);}(_0xf3da,0x143));var _0xaf3d=function(_0x25f2b6,_0x10ee5f){_0x25f2b6=_0x25f2b6-0x0;var _0x28537f=_0xf3da[_0x25f2b6];return _0x28537f;};'use strict';var multer=require(_0xaf3d('0x0'));var util=require(_0xaf3d('0x1'));var path=require(_0xaf3d('0x2'));var timeout=require(_0xaf3d('0x3'));var express=require(_0xaf3d('0x4'));var router=express[_0xaf3d('0x5')]();var fs_extra=require(_0xaf3d('0x6'));var auth=require(_0xaf3d('0x7'));var interaction=require(_0xaf3d('0x8'));var config=require('../../config/environment');var controller=require(_0xaf3d('0x9'));router[_0xaf3d('0xa')]('/',auth['isAuthenticated'](),controller[_0xaf3d('0xb')]);router[_0xaf3d('0xa')](_0xaf3d('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0xaf3d('0xa')](_0xaf3d('0xd'),auth['isAuthenticated'](),controller[_0xaf3d('0xe')]);router[_0xaf3d('0xa')](_0xaf3d('0xf'),auth[_0xaf3d('0x10')](),controller[_0xaf3d('0x11')]);router[_0xaf3d('0x12')]('/',auth['isAuthenticated'](),interaction[_0xaf3d('0x13')]('mail',_0xaf3d('0x14')),controller[_0xaf3d('0x15')]);router[_0xaf3d('0x16')](_0xaf3d('0xd'),auth[_0xaf3d('0x10')](),controller['update']);router[_0xaf3d('0x16')]('/:id/accept',auth[_0xaf3d('0x10')](),controller[_0xaf3d('0x17')]);router[_0xaf3d('0x16')](_0xaf3d('0x18'),auth[_0xaf3d('0x10')](),controller['reject']);router[_0xaf3d('0x19')](_0xaf3d('0xd'),auth[_0xaf3d('0x10')](),controller[_0xaf3d('0x1a')]);module['exports']=router; \ No newline at end of file +var _0xdc65=['/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','download','post','tracked','mailmessage:create','create','update','put','/:id/accept','accept'];(function(_0x797bf3,_0x3fcc11){var _0xc17a03=function(_0x4a3097){while(--_0x4a3097){_0x797bf3['push'](_0x797bf3['shift']());}};_0xc17a03(++_0x3fcc11);}(_0xdc65,0x79));var _0x5dc6=function(_0x2a17ac,_0x15cf1d){_0x2a17ac=_0x2a17ac-0x0;var _0x5cd932=_0xdc65[_0x2a17ac];return _0x5cd932;};'use strict';var multer=require(_0x5dc6('0x0'));var util=require(_0x5dc6('0x1'));var path=require(_0x5dc6('0x2'));var timeout=require(_0x5dc6('0x3'));var express=require('express');var router=express[_0x5dc6('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x5dc6('0x5'));var interaction=require(_0x5dc6('0x6'));var config=require(_0x5dc6('0x7'));var controller=require(_0x5dc6('0x8'));router[_0x5dc6('0x9')]('/',auth[_0x5dc6('0xa')](),controller[_0x5dc6('0xb')]);router[_0x5dc6('0x9')](_0x5dc6('0xc'),auth['isAuthenticated'](),controller[_0x5dc6('0xd')]);router[_0x5dc6('0x9')](_0x5dc6('0xe'),auth[_0x5dc6('0xa')](),controller['show']);router[_0x5dc6('0x9')]('/:id/download',auth['isAuthenticated'](),controller[_0x5dc6('0xf')]);router[_0x5dc6('0x10')]('/',auth['isAuthenticated'](),interaction[_0x5dc6('0x11')]('mail',_0x5dc6('0x12')),controller[_0x5dc6('0x13')]);router['put'](_0x5dc6('0xe'),auth[_0x5dc6('0xa')](),controller[_0x5dc6('0x14')]);router[_0x5dc6('0x15')](_0x5dc6('0x16'),auth['isAuthenticated'](),controller[_0x5dc6('0x17')]);router[_0x5dc6('0x15')](_0x5dc6('0x18'),auth[_0x5dc6('0xa')](),controller[_0x5dc6('0x19')]);router[_0x5dc6('0x1a')](_0x5dc6('0xe'),auth[_0x5dc6('0xa')](),controller[_0x5dc6('0x1b')]);module[_0x5dc6('0x1c')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index a598c80..269638c 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 _0x70a7=['exports','TEXT','long','medium','BOOLEAN','ENUM','out','STRING','DATE','INTEGER','Email','Chat','sequelize','lodash'];(function(_0x2c80e4,_0x393c34){var _0x18a461=function(_0x2332ea){while(--_0x2332ea){_0x2c80e4['push'](_0x2c80e4['shift']());}};_0x18a461(++_0x393c34);}(_0x70a7,0x116));var _0x770a=function(_0x31991b,_0xaf75d2){_0x31991b=_0x31991b-0x0;var _0x307304=_0x70a7[_0x31991b];return _0x307304;};'use strict';var Sequelize=require(_0x770a('0x0'));var _=require(_0x770a('0x1'));module[_0x770a('0x2')]={'body':{'type':Sequelize[_0x770a('0x3')](_0x770a('0x4')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x770a('0x3')](_0x770a('0x5'))},'read':{'type':Sequelize[_0x770a('0x6')],'defaultValue':![]},'direction':{'type':Sequelize[_0x770a('0x7')]('in',_0x770a('0x8')),'defaultValue':_0x770a('0x8'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0x1fe)},'from':{'type':Sequelize[_0x770a('0x9')]},'to':{'type':Sequelize[_0x770a('0x3')](_0x770a('0x4'))},'cc':{'type':Sequelize[_0x770a('0x3')]('long')},'bcc':{'type':Sequelize[_0x770a('0x3')](_0x770a('0x4'))},'subject':{'type':Sequelize[_0x770a('0x3')]},'sentAt':{'type':Sequelize[_0x770a('0xa')]},'attach':{'type':Sequelize[_0x770a('0xb')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x770a('0x6')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x770a('0xa')]},'originTo':{'type':Sequelize[_0x770a('0x3')](_0x770a('0x4'))},'originCc':{'type':Sequelize[_0x770a('0x3')]('long')},'originChannel':{'type':Sequelize[_0x770a('0x7')](_0x770a('0xc'),_0x770a('0xd')),'defaultValue':_0x770a('0xc'),'allowNull':![]}}; \ No newline at end of file +var _0x799f=['lodash','TEXT','long','medium','BOOLEAN','out','STRING','DATE','INTEGER','ENUM','Email','Chat'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x799f,0xd8));var _0xf799=function(_0x502815,_0x34c00e){_0x502815=_0x502815-0x0;var _0x101669=_0x799f[_0x502815];return _0x101669;};'use strict';var Sequelize=require('sequelize');var _=require(_0xf799('0x0'));module['exports']={'body':{'type':Sequelize[_0xf799('0x1')](_0xf799('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xf799('0x1')](_0xf799('0x3'))},'read':{'type':Sequelize[_0xf799('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xf799('0x5')),'defaultValue':_0xf799('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0xf799('0x6')](0x1fe)},'from':{'type':Sequelize[_0xf799('0x6')]},'to':{'type':Sequelize[_0xf799('0x1')](_0xf799('0x2'))},'cc':{'type':Sequelize[_0xf799('0x1')]('long')},'bcc':{'type':Sequelize[_0xf799('0x1')](_0xf799('0x2'))},'subject':{'type':Sequelize[_0xf799('0x1')]},'sentAt':{'type':Sequelize[_0xf799('0x7')]},'attach':{'type':Sequelize[_0xf799('0x8')],'defaultValue':0x0},'secret':{'type':Sequelize[_0xf799('0x4')],'defaultValue':![]},'readAt':{'type':Sequelize[_0xf799('0x7')]},'originTo':{'type':Sequelize['TEXT'](_0xf799('0x2'))},'originCc':{'type':Sequelize[_0xf799('0x1')](_0xf799('0x2'))},'originChannel':{'type':Sequelize[_0xf799('0x9')](_0xf799('0xa'),_0xf799('0xb')),'defaultValue':_0xf799('0xa'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index df68f68..ec8c761 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 _0x3549=['where','filters','pick','merge','VIRTUAL','filter','options','MailMessage','includeAll','include','findAll','rows','params','keys','find','update','body','describe','create','secret','split','MailAccount','MailAccountId','CmContact','Contacts','DESC','MailServerOut','Smtp','CloudProvider','getSmtpOptions','attachments','join','root','server/files/attachments','List','List\x20not\x20found','SendMail','format','accept','mail','read','readAt','YYYY-MM-DD\x20HH:mm:ss','user','agent','UserId','get','MailInteraction','MailInteractionId','isNil','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','sequelize','SELECT','contact','fullname','email','internal','manual','interface','SIP/%s','channel','event','fromString','EventManager','reject','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','User','motionChannel','rejectmessage','unix','toString','files','message-%s.eml','from','bcc','createdAt','Attachment','subject','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','Attachments','existsSync','push','readFileSync','build','writeFileSync','download','unlinkSync','eml-format','bluebird','util','path','lodash','ioredis','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','html-entities','./mailMessage.socket','jayson/promise','client','http','then','info','request\x20sent','debug','stringify','error','code','MailMessage,\x20%s,\x20%s','message','result','catch','offset','undefined','limit','count','set','Content-Range','json','destroy','status','sendStatus','stack','name','send','index','map','rawAttributes','type','model','query','attributes','intersection','length','nolimit','order','sort'];(function(_0x2080a3,_0x48acfa){var _0x8d7d17=function(_0x2dbc06){while(--_0x2dbc06){_0x2080a3['push'](_0x2080a3['shift']());}};_0x8d7d17(++_0x48acfa);}(_0x3549,0xf5));var _0x9354=function(_0x30b79f,_0x955433){_0x30b79f=_0x30b79f-0x0;var _0x39de0e=_0x3549[_0x30b79f];return _0x39de0e;};'use strict';var emlformat=require(_0x9354('0x0'));var moment=require('moment');var BPromise=require(_0x9354('0x1'));var util=require(_0x9354('0x2'));var path=require(_0x9354('0x3'));var fs=require('fs');var _=require(_0x9354('0x4'));var Redis=require(_0x9354('0x5'));var htmlToText=require('html-to-text');var qs=require('../../components/parsers/qs');var logger=require(_0x9354('0x6'))('api');var interaction_log=require(_0x9354('0x6'))('mail-interactions');var config=require(_0x9354('0x7'));var db=require(_0x9354('0x8'))['db'];config[_0x9354('0x9')]=_[_0x9354('0xa')](config[_0x9354('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x9354('0xb'))(new Redis(config[_0x9354('0x9')]));var htmlEntities=require(_0x9354('0xc'));require(_0x9354('0xd'))['register'](socket);var jayson=require(_0x9354('0xe'));var client=jayson[_0x9354('0xf')][_0x9354('0x10')]({'port':0x232c});var client9003=jayson[_0x9354('0xf')]['http']({'port':0x232b});var client9002=jayson[_0x9354('0xf')][_0x9354('0x10')]({'port':0x232a});function respondWithRpcPromise(_0x3dab9d,_0x2c6745,_0x4470f8,_0x411d26){return new BPromise(function(_0x1bbdd5,_0xfc622b){var _0x4369e3=_0x411d26||client;return _0x4369e3['request'](_0x3dab9d,_0x4470f8)[_0x9354('0x11')](function(_0x519cf9){logger[_0x9354('0x12')]('MailMessage,\x20%s,\x20%s',_0x2c6745,_0x9354('0x13'));logger[_0x9354('0x14')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x2c6745,_0x9354('0x13'),JSON[_0x9354('0x15')](_0x519cf9));if(_0x519cf9['error']){if(_0x519cf9[_0x9354('0x16')][_0x9354('0x17')]===0x1f4){logger[_0x9354('0x16')](_0x9354('0x18'),_0x2c6745,_0x519cf9[_0x9354('0x16')][_0x9354('0x19')]);return _0xfc622b(_0x519cf9[_0x9354('0x16')]['message']);}logger[_0x9354('0x16')](_0x9354('0x18'),_0x2c6745,_0x519cf9[_0x9354('0x16')][_0x9354('0x19')]);return _0x1bbdd5(_0x519cf9['error'][_0x9354('0x19')]);}else{logger[_0x9354('0x12')](_0x9354('0x18'),_0x2c6745,_0x9354('0x13'));_0x1bbdd5(_0x519cf9[_0x9354('0x1a')]['message']);}})[_0x9354('0x1b')](function(_0x1362b5){logger[_0x9354('0x16')](_0x9354('0x18'),_0x2c6745,_0x1362b5);_0xfc622b(_0x1362b5);});});}function respondWithResult(_0x26ad60,_0x33bfbd){_0x33bfbd=_0x33bfbd||0xc8;return function(_0x5a4497){if(_0x5a4497){return _0x26ad60['status'](_0x33bfbd)['json'](_0x5a4497);}};}function respondWithFilteredResult(_0x2c71dc,_0x41f6c8){return function(_0x4fac63){if(_0x4fac63){var _0x202a50=typeof _0x41f6c8[_0x9354('0x1c')]===_0x9354('0x1d')&&typeof _0x41f6c8[_0x9354('0x1e')]==='undefined';var _0x4a65a8=_0x4fac63[_0x9354('0x1f')];var _0x344cb3=_0x202a50?0x0:_0x41f6c8[_0x9354('0x1c')];var _0x30c953=_0x202a50?_0x4fac63[_0x9354('0x1f')]:_0x41f6c8[_0x9354('0x1c')]+_0x41f6c8[_0x9354('0x1e')];var _0x11c54e;if(_0x30c953>=_0x4a65a8){_0x30c953=_0x4a65a8;_0x11c54e=0xc8;}else{_0x11c54e=0xce;}_0x2c71dc['status'](_0x11c54e);return _0x2c71dc[_0x9354('0x20')](_0x9354('0x21'),_0x344cb3+'-'+_0x30c953+'/'+_0x4a65a8)[_0x9354('0x22')](_0x4fac63);}return null;};}function saveUpdates(_0x211859){return function(_0x2df9d5){if(_0x2df9d5){return _0x2df9d5['update'](_0x211859)[_0x9354('0x11')](function(_0x3a0d9d){return _0x3a0d9d;});}return null;};}function removeEntity(_0x82bca2){return function(_0x14fe71){if(_0x14fe71){return _0x14fe71[_0x9354('0x23')]()[_0x9354('0x11')](function(){_0x82bca2[_0x9354('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x27ff4e){return function(_0x5bbe35){if(!_0x5bbe35){_0x27ff4e[_0x9354('0x25')](0x194);}return _0x5bbe35;};}function handleError(_0x28e1da,_0x2ba2c9){_0x2ba2c9=_0x2ba2c9||0x1f4;return function(_0x5007e9){logger[_0x9354('0x16')](_0x5007e9[_0x9354('0x26')]);if(_0x5007e9[_0x9354('0x27')]){delete _0x5007e9[_0x9354('0x27')];}_0x28e1da['status'](_0x2ba2c9)[_0x9354('0x28')](_0x5007e9);};}exports[_0x9354('0x29')]=function(_0x52b726,_0x4449d5){var _0x24a325={},_0x3b65a1={},_0x182e2f={'count':0x0,'rows':[]};var _0x3360e9=_[_0x9354('0x2a')](db['MailMessage'][_0x9354('0x2b')],function(_0x385855){return{'name':_0x385855['fieldName'],'type':_0x385855[_0x9354('0x2c')]['key']};});_0x3b65a1[_0x9354('0x2d')]=_['map'](_0x3360e9,_0x9354('0x27'));_0x3b65a1[_0x9354('0x2e')]=_['keys'](_0x52b726[_0x9354('0x2e')]);_0x3b65a1['filters']=_['intersection'](_0x3b65a1['model'],_0x3b65a1['query']);_0x24a325[_0x9354('0x2f')]=_[_0x9354('0x30')](_0x3b65a1[_0x9354('0x2d')],qs['fields'](_0x52b726[_0x9354('0x2e')]['fields']));_0x24a325[_0x9354('0x2f')]=_0x24a325[_0x9354('0x2f')][_0x9354('0x31')]?_0x24a325['attributes']:_0x3b65a1['model'];if(!_0x52b726[_0x9354('0x2e')]['hasOwnProperty'](_0x9354('0x32'))){_0x24a325[_0x9354('0x1e')]=qs[_0x9354('0x1e')](_0x52b726[_0x9354('0x2e')][_0x9354('0x1e')]);_0x24a325['offset']=qs[_0x9354('0x1c')](_0x52b726[_0x9354('0x2e')][_0x9354('0x1c')]);}_0x24a325[_0x9354('0x33')]=qs['sort'](_0x52b726[_0x9354('0x2e')][_0x9354('0x34')]);_0x24a325[_0x9354('0x35')]=qs[_0x9354('0x36')](_[_0x9354('0x37')](_0x52b726[_0x9354('0x2e')],_0x3b65a1[_0x9354('0x36')]),_0x3360e9);if(_0x52b726[_0x9354('0x2e')]['filter']){_0x24a325[_0x9354('0x35')]=_[_0x9354('0x38')](_0x24a325[_0x9354('0x35')],{'$or':_[_0x9354('0x2a')](_0x3360e9,function(_0x45427e){if(_0x45427e['type']!==_0x9354('0x39')){var _0x24fcc1={};_0x24fcc1[_0x45427e[_0x9354('0x27')]]={'$like':'%'+_0x52b726[_0x9354('0x2e')][_0x9354('0x3a')]+'%'};return _0x24fcc1;}})});}_0x24a325=_['merge']({},_0x24a325,_0x52b726[_0x9354('0x3b')]);var _0x3ee3ef={'where':_0x24a325[_0x9354('0x35')]};return db[_0x9354('0x3c')]['count'](_0x3ee3ef)[_0x9354('0x11')](function(_0x109e9d){_0x182e2f['count']=_0x109e9d;if(_0x52b726[_0x9354('0x2e')][_0x9354('0x3d')]){_0x24a325[_0x9354('0x3e')]=[{'all':!![]}];}return db[_0x9354('0x3c')][_0x9354('0x3f')](_0x24a325);})[_0x9354('0x11')](function(_0x5f53ab){_0x182e2f[_0x9354('0x40')]=_0x5f53ab;return _0x182e2f;})[_0x9354('0x11')](respondWithFilteredResult(_0x4449d5,_0x24a325))[_0x9354('0x1b')](handleError(_0x4449d5,null));};exports['show']=function(_0x3a8e01,_0x55e4f9){var _0x51f511={'raw':!![],'where':{'id':_0x3a8e01[_0x9354('0x41')]['id']}},_0x3aadc5={};_0x3aadc5[_0x9354('0x2d')]=_['keys'](db[_0x9354('0x3c')][_0x9354('0x2b')]);_0x3aadc5[_0x9354('0x2e')]=_[_0x9354('0x42')](_0x3a8e01[_0x9354('0x2e')]);_0x3aadc5[_0x9354('0x36')]=_['intersection'](_0x3aadc5[_0x9354('0x2d')],_0x3aadc5[_0x9354('0x2e')]);_0x51f511[_0x9354('0x2f')]=_[_0x9354('0x30')](_0x3aadc5[_0x9354('0x2d')],qs['fields'](_0x3a8e01[_0x9354('0x2e')]['fields']));_0x51f511['attributes']=_0x51f511['attributes'][_0x9354('0x31')]?_0x51f511['attributes']:_0x3aadc5[_0x9354('0x2d')];if(_0x3a8e01['query'][_0x9354('0x3d')]){_0x51f511[_0x9354('0x3e')]=[{'all':!![]}];}_0x51f511=_[_0x9354('0x38')]({},_0x51f511,_0x3a8e01['options']);return db['MailMessage'][_0x9354('0x43')](_0x51f511)[_0x9354('0x11')](handleEntityNotFound(_0x55e4f9,null))[_0x9354('0x11')](respondWithResult(_0x55e4f9,null))['catch'](handleError(_0x55e4f9,null));};exports[_0x9354('0x44')]=function(_0x620e05,_0x45531b){if(_0x620e05[_0x9354('0x45')]['id']){delete _0x620e05[_0x9354('0x45')]['id'];}return db[_0x9354('0x3c')]['find']({'where':{'id':_0x620e05[_0x9354('0x41')]['id']}})[_0x9354('0x11')](handleEntityNotFound(_0x45531b,null))[_0x9354('0x11')](saveUpdates(_0x620e05['body'],null))[_0x9354('0x11')](respondWithResult(_0x45531b,null))[_0x9354('0x1b')](handleError(_0x45531b,null));};exports[_0x9354('0x23')]=function(_0xff5a26,_0x30dbc7){return db[_0x9354('0x3c')]['find']({'where':{'id':_0xff5a26[_0x9354('0x41')]['id']}})['then'](handleEntityNotFound(_0x30dbc7,null))[_0x9354('0x11')](removeEntity(_0x30dbc7,null))[_0x9354('0x1b')](handleError(_0x30dbc7,null));};exports['describe']=function(_0x4693a1,_0x5591c5){return db[_0x9354('0x3c')][_0x9354('0x46')]()['then'](respondWithResult(_0x5591c5,null))[_0x9354('0x1b')](handleError(_0x5591c5,null));};exports[_0x9354('0x47')]=function(_0x4123ed,_0x20fa60){return db['MailMessage'][_0x9354('0x47')](_0x4123ed['body'])['then'](function(_0x4a59bd){if(_0x4a59bd){if(_0x4a59bd['direction']==='out'&&!_0x4a59bd[_0x9354('0x48')]){var _0x174ec4,_0x9cb6fb,_0x8a6cb4;if(_0x4123ed[_0x9354('0x45')]['to']){_0x9cb6fb=_0x4123ed[_0x9354('0x45')]['to'][_0x9354('0x49')](',')[0x0];}return db[_0x9354('0x4a')]['findOne']({'where':{'id':_0x4a59bd[_0x9354('0x4b')]},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x9354('0x4c')],'as':_0x9354('0x4d'),'where':{'email':_0x9cb6fb},'limit':0x1,'order':[['updatedAt',_0x9354('0x4e')]]}]},{'model':db[_0x9354('0x4f')],'as':_0x9354('0x50'),'raw':!![],'include':[{'model':db[_0x9354('0x51')],'as':'CloudProvider','raw':!![]}]}]})[_0x9354('0x11')](function(_0x135afb){_0x174ec4=_0x135afb;if(!_0x174ec4||!_0x174ec4[_0x9354('0x50')])return;var _0x1cefb3=_0x174ec4[_0x9354('0x52')]();if(_0x4123ed[_0x9354('0x45')][_0x9354('0x53')]&&_0x4123ed[_0x9354('0x45')]['attachments'][_0x9354('0x31')]){for(var _0x998c3e=0x0;_0x998c3e<_0x4123ed[_0x9354('0x45')][_0x9354('0x53')]['length'];_0x998c3e+=0x1){_0x4123ed['body'][_0x9354('0x53')][_0x998c3e]={'filename':_0x4123ed['body'][_0x9354('0x53')][_0x998c3e]['name'],'path':path[_0x9354('0x54')](config[_0x9354('0x55')],_0x9354('0x56'),_0x4123ed[_0x9354('0x45')][_0x9354('0x53')][_0x998c3e]['basename'])};}}_0x8a6cb4={'account':_0x1cefb3,'message':_0x4123ed[_0x9354('0x45')]};return;})[_0x9354('0x11')](function(){if(_0x174ec4[_0x9354('0x57')]){if(_0x174ec4['List'][_0x9354('0x4d')]['length']){return _0x174ec4[_0x9354('0x57')][_0x9354('0x4d')][0x0];}else{return db[_0x9354('0x4c')][_0x9354('0x47')](_['defaults'](_0x4123ed[_0x9354('0x45')],{'firstName':_0x4123ed[_0x9354('0x45')]['to'],'email':_0x4123ed[_0x9354('0x45')]['to'],'phone':_0x4123ed['body']['to'],'ListId':_0x174ec4['ListId']}));}}else{throw new Error(_0x9354('0x58'));}})[_0x9354('0x11')](function(){if(_0x8a6cb4){return respondWithRpcPromise(_0x9354('0x59'),'sendMail',_0x8a6cb4,client9003)['then'](function(_0x1b3e16){return _0x4a59bd[_0x9354('0x44')]({'read':!![],'messageId':_0x1b3e16['messageId'],'sentAt':moment()[_0x9354('0x5a')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0x9354('0x1b')](function(_0x1a76fe){logger[_0x9354('0x16')]('%s',JSON['stringify'](_0x1a76fe));return _0x4a59bd;});}return _0x4a59bd;});}return _0x4a59bd;}})[_0x9354('0x11')](respondWithResult(_0x20fa60,0xc9))[_0x9354('0x1b')](handleError(_0x20fa60,null));};exports[_0x9354('0x5b')]=function(_0x45f609,_0x2b3ce6){var _0x3c4bdc={'agent':{},'channel':_0x9354('0x5c')};if(_0x45f609[_0x9354('0x45')]['id']){delete _0x45f609[_0x9354('0x45')]['id'];}_0x45f609['body'][_0x9354('0x5d')]=!![];_0x45f609[_0x9354('0x45')][_0x9354('0x5e')]=moment()[_0x9354('0x5a')](_0x9354('0x5f'));_0x45f609[_0x9354('0x45')]['UserId']=_0x45f609[_0x9354('0x45')]['UserId']||_0x45f609[_0x9354('0x60')]['id'];_0x3c4bdc[_0x9354('0x61')]['id']=_0x45f609['body'][_0x9354('0x62')];return db[_0x9354('0x3c')][_0x9354('0x43')]({'where':{'id':_0x45f609[_0x9354('0x41')]['id'],'UserId':null}})[_0x9354('0x11')](handleEntityNotFound(_0x2b3ce6,null))[_0x9354('0x11')](saveUpdates(_0x45f609[_0x9354('0x45')],null))[_0x9354('0x11')](function(_0x53047a){if(_0x53047a){_0x3c4bdc[_0x9354('0x19')]=_0x53047a[_0x9354('0x63')]({'plain':!![]});return db[_0x9354('0x64')]['find']({'where':{'id':_0x53047a[_0x9354('0x65')]}});}return null;})[_0x9354('0x11')](handleEntityNotFound(_0x2b3ce6,null))[_0x9354('0x11')](function(_0x382291){if(_0x382291){return _0x382291[_0x9354('0x44')]({'UserId':_0x45f609[_0x9354('0x45')][_0x9354('0x62')],'read1stAt':_[_0x9354('0x66')](_0x382291[_0x9354('0x67')])?moment()[_0x9354('0x5a')](_0x9354('0x5f')):undefined});}return null;})[_0x9354('0x11')](function(_0xcc3ee7){if(_0xcc3ee7){_0x3c4bdc[_0x9354('0x68')]=_0xcc3ee7[_0x9354('0x63')]({'plain':!![]});interaction_log[_0x9354('0x12')](_0x9354('0x69'),_0x45f609[_0x9354('0x60')]['id'],_0x45f609[_0x9354('0x60')]['name'],_0x45f609[_0x9354('0x60')]['role'],_0x3c4bdc[_0x9354('0x68')]['id'],_0x45f609[_0x9354('0x45')]?JSON[_0x9354('0x15')](_0x45f609[_0x9354('0x45')]):_0x9354('0x6a'));return respondWithRpcPromise(_0x9354('0x6b'),'acceptMessage',_0x3c4bdc);}return null;})[_0x9354('0x11')](function(_0x1d051f){var _0x29d010='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x1d051f[_0x9354('0x19')]['ContactId'];return db[_0x9354('0x6c')]['query'](_0x29d010,{'type':db['Sequelize']['QueryTypes'][_0x9354('0x6d')],'raw':!![]})[_0x9354('0x11')](function(_0x310ee4){return _0x310ee4;});})[_0x9354('0x11')](function(_0x1f342d){if(_0x1f342d){_0x3c4bdc['message'][_0x9354('0x6e')]=_0x1f342d[0x0];if(!_0x45f609[_0x9354('0x45')][_0x9354('0x62')])return;return db['User'][_0x9354('0x43')]({'where':{'id':_0x45f609['body'][_0x9354('0x62')],'role':_0x9354('0x61')},'attributes':['id',_0x9354('0x27'),_0x9354('0x6f'),_0x9354('0x70'),_0x9354('0x71')],'raw':!![]});}return null;})[_0x9354('0x11')](function(_0x54ab3e){if(!_0x54ab3e)return null;_0x3c4bdc[_0x9354('0x19')][_0x9354('0x61')]=_0x54ab3e;return _0x3c4bdc;})['then'](function(_0x5d76b1){if(_0x5d76b1){if(_0x45f609[_0x9354('0x45')][_0x9354('0x72')]){_0x3c4bdc[_0x9354('0x19')][_0x9354('0x73')]=util[_0x9354('0x5a')](_0x9354('0x74'),_0x45f609[_0x9354('0x60')]['name']);_0x3c4bdc['message']['channel']=_0x3c4bdc[_0x9354('0x75')];_0x3c4bdc['message']['motionChannel']=_0x3c4bdc[_0x9354('0x75')];_0x3c4bdc[_0x9354('0x19')][_0x9354('0x76')]=_0x9354('0x5b');_0x3c4bdc[_0x9354('0x19')][_0x9354('0x45')]=htmlToText[_0x9354('0x77')](_0x3c4bdc['message'][_0x9354('0x45')]);return respondWithRpcPromise(_0x9354('0x78'),_0x9354('0x78'),{'event':'acceptmessage','message':_0x3c4bdc[_0x9354('0x19')]},client9002)[_0x9354('0x11')](function(){return _0x3c4bdc;});}return _0x3c4bdc;}return null;})[_0x9354('0x11')](respondWithResult(_0x2b3ce6,null))['catch'](handleError(_0x2b3ce6,null));};exports[_0x9354('0x79')]=function(_0x92cd11,_0x5dd9a8){var _0x2bd159={'agent':{},'channel':_0x9354('0x5c')};if(_0x92cd11['body']['id']){delete _0x92cd11[_0x9354('0x45')]['id'];}_0x92cd11[_0x9354('0x45')]['UserId']=_0x92cd11[_0x9354('0x45')][_0x9354('0x62')]||_0x92cd11[_0x9354('0x60')]['id'];_0x2bd159['agent']['id']=_0x92cd11[_0x9354('0x45')]['UserId'];return db[_0x9354('0x3c')][_0x9354('0x43')]({'where':{'id':_0x92cd11[_0x9354('0x41')]['id'],'UserId':null}})[_0x9354('0x11')](handleEntityNotFound(_0x5dd9a8,null))['then'](function(_0x49ed7c){if(_0x49ed7c){_0x2bd159[_0x9354('0x19')]=_0x49ed7c[_0x9354('0x63')]({'plain':!![]});return db[_0x9354('0x64')][_0x9354('0x43')]({'where':{'id':_0x49ed7c[_0x9354('0x65')]}});}return null;})[_0x9354('0x11')](handleEntityNotFound(_0x5dd9a8,null))[_0x9354('0x11')](function(_0x15de65){if(_0x15de65){_0x2bd159[_0x9354('0x68')]=_0x15de65[_0x9354('0x63')]({'plain':!![]});interaction_log['info'](_0x9354('0x7a'),_0x92cd11[_0x9354('0x60')]['id'],_0x92cd11[_0x9354('0x60')][_0x9354('0x27')],_0x92cd11[_0x9354('0x60')]['role'],_0x2bd159[_0x9354('0x68')]['id'],_0x92cd11[_0x9354('0x45')]?JSON[_0x9354('0x15')](_0x92cd11[_0x9354('0x45')]):_0x9354('0x6a'));return respondWithRpcPromise(_0x9354('0x7b'),_0x9354('0x7c'),_0x2bd159);}return null;})[_0x9354('0x11')](function(_0x41c4dd){var _0x2b3dbe=_0x9354('0x7d')+_0x41c4dd[_0x9354('0x19')]['ContactId'];return db[_0x9354('0x6c')][_0x9354('0x2e')](_0x2b3dbe,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0x9354('0x11')](function(_0x35f392){return _0x35f392;});})[_0x9354('0x11')](function(_0x2d1045){if(_0x2d1045){_0x2bd159[_0x9354('0x19')][_0x9354('0x6e')]=_0x2d1045[0x0];if(!_0x92cd11[_0x9354('0x45')]['UserId'])return;return db[_0x9354('0x7e')][_0x9354('0x43')]({'where':{'id':_0x92cd11[_0x9354('0x45')]['UserId'],'role':'agent'},'attributes':['id','name',_0x9354('0x6f'),'email',_0x9354('0x71')],'raw':!![]});}return null;})['then'](function(_0x2761fb){if(!_0x2761fb)return null;_0x2bd159[_0x9354('0x19')][_0x9354('0x61')]=_0x2761fb;return _0x2bd159;})[_0x9354('0x11')](function(_0x51cb67){if(_0x51cb67){_0x51cb67['message']['interface']=util[_0x9354('0x5a')](_0x9354('0x74'),_0x92cd11[_0x9354('0x60')][_0x9354('0x27')]);_0x51cb67[_0x9354('0x19')][_0x9354('0x75')]=_0x2bd159[_0x9354('0x75')];_0x51cb67[_0x9354('0x19')][_0x9354('0x7f')]=_0x2bd159[_0x9354('0x75')];_0x51cb67['message'][_0x9354('0x76')]='reject';_0x51cb67['message'][_0x9354('0x45')]=htmlToText[_0x9354('0x77')](_0x2bd159[_0x9354('0x19')][_0x9354('0x45')]);respondWithRpcPromise(_0x9354('0x78'),_0x9354('0x78'),{'event':_0x9354('0x80'),'message':_0x51cb67['message']},client9002);return _0x2bd159;}return null;})['then'](respondWithResult(_0x5dd9a8,null))[_0x9354('0x1b')](handleError(_0x5dd9a8,null));};exports['download']=function(_0x3e51ae,_0x5b8678){var _0x22df99=moment()[_0x9354('0x81')]()[_0x9354('0x82')]();var _0x33e6b3=path[_0x9354('0x54')](config[_0x9354('0x55')],'server','files','tmp');var _0x1474c3=path[_0x9354('0x54')](config[_0x9354('0x55')],'server',_0x9354('0x83'),'attachments');var _0x1621c7=util['format'](_0x9354('0x84'),_0x22df99);return db[_0x9354('0x3c')][_0x9354('0x43')]({'where':{'id':_0x3e51ae[_0x9354('0x41')]['id']},'attributes':['id','body',_0x9354('0x85'),'to','cc',_0x9354('0x86'),'subject',_0x9354('0x87')],'include':_0x3e51ae['query']['attachments']?[{'model':db[_0x9354('0x88')],'as':'Attachments'}]:undefined})[_0x9354('0x11')](handleEntityNotFound(_0x5b8678,null))[_0x9354('0x11')](function(_0x67ab99){if(_0x67ab99){var _0xd952d6=_0x67ab99;var _0x187f3e={'from':_0xd952d6[_0x9354('0x85')],'to':_0xd952d6['to'],'subject':_0xd952d6[_0x9354('0x89')],'html':htmlEntities['decode'](_0xd952d6['body']),'headers':{'Date':moment(_0xd952d6['createdAt'])['format'](_0x9354('0x8a'))},'attachments':[]};if(_0x67ab99['cc']){_0x187f3e[_0x9354('0x8b')]['Cc']=_0x67ab99['cc'];}if(_0x67ab99[_0x9354('0x86')]){_0x187f3e[_0x9354('0x8b')][_0x9354('0x8c')]=_0x67ab99[_0x9354('0x86')];}return new BPromise(function(_0xb21568,_0x846037){if(_0x67ab99[_0x9354('0x8d')]){for(var _0x3f66d2=0x0;_0x3f66d2<_0x67ab99[_0x9354('0x8d')]['length'];_0x3f66d2++){var _0x3b102c=_0x67ab99[_0x9354('0x8d')][_0x3f66d2];var _0xd52ac1=path[_0x9354('0x54')](_0x1474c3,_0x3b102c['basename']);if(fs[_0x9354('0x8e')](_0xd52ac1)){_0x187f3e[_0x9354('0x53')][_0x9354('0x8f')]({'name':_0x3b102c[_0x9354('0x27')],'contentType':_0x3b102c[_0x9354('0x2c')],'data':fs[_0x9354('0x90')](_0xd52ac1)});}}}emlformat[_0x9354('0x91')](_0x187f3e,function(_0x4a0e96,_0x5054af){if(_0x4a0e96)return _0x846037(_0x4a0e96);fs[_0x9354('0x92')](path[_0x9354('0x54')](_0x33e6b3,_0x1621c7),_0x5054af);return _0xb21568(_0x5054af);});});}})[_0x9354('0x11')](function(_0x249542){if(_0x249542){return _0x5b8678[_0x9354('0x93')](path[_0x9354('0x54')](_0x33e6b3,_0x1621c7),_0x1621c7,function(_0x4962d0){if(!_0x4962d0)fs[_0x9354('0x94')](path['join'](_0x33e6b3,_0x1621c7));});}})['catch'](handleError(_0x5b8678,null));}; \ No newline at end of file +var _0xea47=['include','findAll','rows','show','params','includeAll','options','find','body','describe','create','direction','out','secret','MailAccount','findOne','MailAccountId','CmList','List','CmContact','updatedAt','DESC','MailServerOut','Smtp','CloudProvider','getSmtpOptions','attachments','join','root','basename','List\x20not\x20found','SendMail','sendMail','messageId','YYYY-MM-DD\x20HH:mm:ss','accept','read','readAt','format','UserId','user','MailInteraction','MailInteractionId','isNil','interaction','get','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','contact','agent','fullname','email','manual','interface','SIP/%s','channel','motionChannel','event','fromString','EventManager','acceptmessage','reject','mail','RejectMessage','rejectMessage','SELECT','User','internal','download','unix','toString','server','files','message-%s.eml','from','bcc','Attachment','Attachments','subject','decode','createdAt','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','push','readFileSync','build','writeFileSync','unlinkSync','eml-format','moment','path','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','html-entities','./mailMessage.socket','register','jayson/promise','client','http','request','then','MailMessage,\x20%s,\x20%s','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','status','offset','limit','undefined','count','set','Content-Range','json','update','destroy','end','sendStatus','send','map','rawAttributes','fieldName','model','name','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','type','VIRTUAL','filter','MailMessage'];(function(_0x2923fc,_0x466a44){var _0x1bdb6c=function(_0x394f83){while(--_0x394f83){_0x2923fc['push'](_0x2923fc['shift']());}};_0x1bdb6c(++_0x466a44);}(_0xea47,0xfc));var _0x7ea4=function(_0x27c0f9,_0x46ccb6){_0x27c0f9=_0x27c0f9-0x0;var _0x10064b=_0xea47[_0x27c0f9];return _0x10064b;};'use strict';var emlformat=require(_0x7ea4('0x0'));var moment=require(_0x7ea4('0x1'));var BPromise=require('bluebird');var util=require('util');var path=require(_0x7ea4('0x2'));var fs=require('fs');var _=require('lodash');var Redis=require(_0x7ea4('0x3'));var htmlToText=require('html-to-text');var qs=require(_0x7ea4('0x4'));var logger=require(_0x7ea4('0x5'))(_0x7ea4('0x6'));var interaction_log=require('../../config/logger')('mail-interactions');var config=require(_0x7ea4('0x7'));var db=require(_0x7ea4('0x8'))['db'];config['redis']=_[_0x7ea4('0x9')](config[_0x7ea4('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));var htmlEntities=require(_0x7ea4('0xb'));require(_0x7ea4('0xc'))[_0x7ea4('0xd')](socket);var jayson=require(_0x7ea4('0xe'));var client=jayson[_0x7ea4('0xf')][_0x7ea4('0x10')]({'port':0x232c});var client9003=jayson['client'][_0x7ea4('0x10')]({'port':0x232b});var client9002=jayson[_0x7ea4('0xf')][_0x7ea4('0x10')]({'port':0x232a});function respondWithRpcPromise(_0x378018,_0x4284d6,_0x18e214,_0x585ac7){return new BPromise(function(_0x5033e2,_0x1bd8cf){var _0x1761e4=_0x585ac7||client;return _0x1761e4[_0x7ea4('0x11')](_0x378018,_0x18e214)[_0x7ea4('0x12')](function(_0x1c9d0e){logger['info'](_0x7ea4('0x13'),_0x4284d6,_0x7ea4('0x14'));logger['debug'](_0x7ea4('0x15'),_0x4284d6,_0x7ea4('0x14'),JSON[_0x7ea4('0x16')](_0x1c9d0e));if(_0x1c9d0e[_0x7ea4('0x17')]){if(_0x1c9d0e[_0x7ea4('0x17')][_0x7ea4('0x18')]===0x1f4){logger['error'](_0x7ea4('0x13'),_0x4284d6,_0x1c9d0e[_0x7ea4('0x17')]['message']);return _0x1bd8cf(_0x1c9d0e[_0x7ea4('0x17')][_0x7ea4('0x19')]);}logger['error'](_0x7ea4('0x13'),_0x4284d6,_0x1c9d0e[_0x7ea4('0x17')][_0x7ea4('0x19')]);return _0x5033e2(_0x1c9d0e[_0x7ea4('0x17')][_0x7ea4('0x19')]);}else{logger[_0x7ea4('0x1a')]('MailMessage,\x20%s,\x20%s',_0x4284d6,_0x7ea4('0x14'));_0x5033e2(_0x1c9d0e['result'][_0x7ea4('0x19')]);}})[_0x7ea4('0x1b')](function(_0x46449c){logger['error']('MailMessage,\x20%s,\x20%s',_0x4284d6,_0x46449c);_0x1bd8cf(_0x46449c);});});}function respondWithResult(_0x10ace2,_0x5f01e0){_0x5f01e0=_0x5f01e0||0xc8;return function(_0x540d91){if(_0x540d91){return _0x10ace2[_0x7ea4('0x1c')](_0x5f01e0)['json'](_0x540d91);}};}function respondWithFilteredResult(_0x3356c0,_0x4030fa){return function(_0x59fa98){if(_0x59fa98){var _0x4f73a3=typeof _0x4030fa[_0x7ea4('0x1d')]==='undefined'&&typeof _0x4030fa[_0x7ea4('0x1e')]===_0x7ea4('0x1f');var _0x3f3c71=_0x59fa98[_0x7ea4('0x20')];var _0x977085=_0x4f73a3?0x0:_0x4030fa[_0x7ea4('0x1d')];var _0x1a1fd4=_0x4f73a3?_0x59fa98[_0x7ea4('0x20')]:_0x4030fa[_0x7ea4('0x1d')]+_0x4030fa[_0x7ea4('0x1e')];var _0x17addf;if(_0x1a1fd4>=_0x3f3c71){_0x1a1fd4=_0x3f3c71;_0x17addf=0xc8;}else{_0x17addf=0xce;}_0x3356c0['status'](_0x17addf);return _0x3356c0[_0x7ea4('0x21')](_0x7ea4('0x22'),_0x977085+'-'+_0x1a1fd4+'/'+_0x3f3c71)[_0x7ea4('0x23')](_0x59fa98);}return null;};}function saveUpdates(_0x2dd769){return function(_0x16732a){if(_0x16732a){return _0x16732a[_0x7ea4('0x24')](_0x2dd769)[_0x7ea4('0x12')](function(_0x347f5f){return _0x347f5f;});}return null;};}function removeEntity(_0x7c5322){return function(_0x47d0d6){if(_0x47d0d6){return _0x47d0d6[_0x7ea4('0x25')]()[_0x7ea4('0x12')](function(){_0x7c5322[_0x7ea4('0x1c')](0xcc)[_0x7ea4('0x26')]();});}};}function handleEntityNotFound(_0x28035e){return function(_0x3831ec){if(!_0x3831ec){_0x28035e[_0x7ea4('0x27')](0x194);}return _0x3831ec;};}function handleError(_0x549ac3,_0x257454){_0x257454=_0x257454||0x1f4;return function(_0x1efcc0){logger[_0x7ea4('0x17')](_0x1efcc0['stack']);if(_0x1efcc0['name']){delete _0x1efcc0['name'];}_0x549ac3[_0x7ea4('0x1c')](_0x257454)[_0x7ea4('0x28')](_0x1efcc0);};}exports['index']=function(_0x5b9fa8,_0x3fb212){var _0x360883={},_0x4a951b={},_0xabee96={'count':0x0,'rows':[]};var _0x392dfb=_[_0x7ea4('0x29')](db['MailMessage'][_0x7ea4('0x2a')],function(_0x3c1e5f){return{'name':_0x3c1e5f[_0x7ea4('0x2b')],'type':_0x3c1e5f['type']['key']};});_0x4a951b[_0x7ea4('0x2c')]=_[_0x7ea4('0x29')](_0x392dfb,_0x7ea4('0x2d'));_0x4a951b['query']=_[_0x7ea4('0x2e')](_0x5b9fa8[_0x7ea4('0x2f')]);_0x4a951b['filters']=_[_0x7ea4('0x30')](_0x4a951b[_0x7ea4('0x2c')],_0x4a951b[_0x7ea4('0x2f')]);_0x360883[_0x7ea4('0x31')]=_[_0x7ea4('0x30')](_0x4a951b[_0x7ea4('0x2c')],qs[_0x7ea4('0x32')](_0x5b9fa8['query'][_0x7ea4('0x32')]));_0x360883[_0x7ea4('0x31')]=_0x360883[_0x7ea4('0x31')][_0x7ea4('0x33')]?_0x360883['attributes']:_0x4a951b[_0x7ea4('0x2c')];if(!_0x5b9fa8[_0x7ea4('0x2f')][_0x7ea4('0x34')](_0x7ea4('0x35'))){_0x360883['limit']=qs[_0x7ea4('0x1e')](_0x5b9fa8['query'][_0x7ea4('0x1e')]);_0x360883[_0x7ea4('0x1d')]=qs[_0x7ea4('0x1d')](_0x5b9fa8[_0x7ea4('0x2f')][_0x7ea4('0x1d')]);}_0x360883[_0x7ea4('0x36')]=qs[_0x7ea4('0x37')](_0x5b9fa8[_0x7ea4('0x2f')][_0x7ea4('0x37')]);_0x360883[_0x7ea4('0x38')]=qs[_0x7ea4('0x39')](_[_0x7ea4('0x3a')](_0x5b9fa8['query'],_0x4a951b[_0x7ea4('0x39')]),_0x392dfb);if(_0x5b9fa8[_0x7ea4('0x2f')]['filter']){_0x360883[_0x7ea4('0x38')]=_[_0x7ea4('0x3b')](_0x360883[_0x7ea4('0x38')],{'$or':_[_0x7ea4('0x29')](_0x392dfb,function(_0x206acc){if(_0x206acc[_0x7ea4('0x3c')]!==_0x7ea4('0x3d')){var _0x103743={};_0x103743[_0x206acc[_0x7ea4('0x2d')]]={'$like':'%'+_0x5b9fa8[_0x7ea4('0x2f')][_0x7ea4('0x3e')]+'%'};return _0x103743;}})});}_0x360883=_[_0x7ea4('0x3b')]({},_0x360883,_0x5b9fa8['options']);var _0x146744={'where':_0x360883[_0x7ea4('0x38')]};return db[_0x7ea4('0x3f')][_0x7ea4('0x20')](_0x146744)['then'](function(_0x1b459b){_0xabee96[_0x7ea4('0x20')]=_0x1b459b;if(_0x5b9fa8[_0x7ea4('0x2f')]['includeAll']){_0x360883[_0x7ea4('0x40')]=[{'all':!![]}];}return db[_0x7ea4('0x3f')][_0x7ea4('0x41')](_0x360883);})[_0x7ea4('0x12')](function(_0x27195c){_0xabee96[_0x7ea4('0x42')]=_0x27195c;return _0xabee96;})[_0x7ea4('0x12')](respondWithFilteredResult(_0x3fb212,_0x360883))[_0x7ea4('0x1b')](handleError(_0x3fb212,null));};exports[_0x7ea4('0x43')]=function(_0x4cf7b5,_0x4cc180){var _0x45bd84={'raw':!![],'where':{'id':_0x4cf7b5[_0x7ea4('0x44')]['id']}},_0x3ab112={};_0x3ab112[_0x7ea4('0x2c')]=_['keys'](db[_0x7ea4('0x3f')][_0x7ea4('0x2a')]);_0x3ab112[_0x7ea4('0x2f')]=_[_0x7ea4('0x2e')](_0x4cf7b5[_0x7ea4('0x2f')]);_0x3ab112[_0x7ea4('0x39')]=_[_0x7ea4('0x30')](_0x3ab112[_0x7ea4('0x2c')],_0x3ab112[_0x7ea4('0x2f')]);_0x45bd84['attributes']=_[_0x7ea4('0x30')](_0x3ab112[_0x7ea4('0x2c')],qs[_0x7ea4('0x32')](_0x4cf7b5[_0x7ea4('0x2f')][_0x7ea4('0x32')]));_0x45bd84['attributes']=_0x45bd84[_0x7ea4('0x31')]['length']?_0x45bd84[_0x7ea4('0x31')]:_0x3ab112[_0x7ea4('0x2c')];if(_0x4cf7b5[_0x7ea4('0x2f')][_0x7ea4('0x45')]){_0x45bd84['include']=[{'all':!![]}];}_0x45bd84=_[_0x7ea4('0x3b')]({},_0x45bd84,_0x4cf7b5[_0x7ea4('0x46')]);return db['MailMessage'][_0x7ea4('0x47')](_0x45bd84)[_0x7ea4('0x12')](handleEntityNotFound(_0x4cc180,null))[_0x7ea4('0x12')](respondWithResult(_0x4cc180,null))[_0x7ea4('0x1b')](handleError(_0x4cc180,null));};exports[_0x7ea4('0x24')]=function(_0x48f367,_0x8b72bb){if(_0x48f367[_0x7ea4('0x48')]['id']){delete _0x48f367[_0x7ea4('0x48')]['id'];}return db['MailMessage'][_0x7ea4('0x47')]({'where':{'id':_0x48f367['params']['id']}})[_0x7ea4('0x12')](handleEntityNotFound(_0x8b72bb,null))[_0x7ea4('0x12')](saveUpdates(_0x48f367[_0x7ea4('0x48')],null))[_0x7ea4('0x12')](respondWithResult(_0x8b72bb,null))['catch'](handleError(_0x8b72bb,null));};exports['destroy']=function(_0x4316ba,_0x12f56e){return db[_0x7ea4('0x3f')][_0x7ea4('0x47')]({'where':{'id':_0x4316ba['params']['id']}})[_0x7ea4('0x12')](handleEntityNotFound(_0x12f56e,null))['then'](removeEntity(_0x12f56e,null))[_0x7ea4('0x1b')](handleError(_0x12f56e,null));};exports[_0x7ea4('0x49')]=function(_0x3104bb,_0xc71357){return db[_0x7ea4('0x3f')]['describe']()[_0x7ea4('0x12')](respondWithResult(_0xc71357,null))[_0x7ea4('0x1b')](handleError(_0xc71357,null));};exports['create']=function(_0x151068,_0x3bbb90){return db[_0x7ea4('0x3f')][_0x7ea4('0x4a')](_0x151068[_0x7ea4('0x48')])['then'](function(_0x3039c5){if(_0x3039c5){if(_0x3039c5[_0x7ea4('0x4b')]===_0x7ea4('0x4c')&&!_0x3039c5[_0x7ea4('0x4d')]){var _0x3469d4,_0x158484,_0x25b7f2;if(_0x151068[_0x7ea4('0x48')]['to']){_0x158484=_0x151068[_0x7ea4('0x48')]['to']['split'](',')[0x0];}return db[_0x7ea4('0x4e')][_0x7ea4('0x4f')]({'where':{'id':_0x3039c5[_0x7ea4('0x50')]},'include':[{'model':db[_0x7ea4('0x51')],'as':_0x7ea4('0x52'),'include':[{'model':db[_0x7ea4('0x53')],'as':'Contacts','where':{'email':_0x158484},'limit':0x1,'order':[[_0x7ea4('0x54'),_0x7ea4('0x55')]]}]},{'model':db[_0x7ea4('0x56')],'as':_0x7ea4('0x57'),'raw':!![],'include':[{'model':db[_0x7ea4('0x58')],'as':_0x7ea4('0x58'),'raw':!![]}]}]})['then'](function(_0x3b9337){_0x3469d4=_0x3b9337;if(!_0x3469d4||!_0x3469d4[_0x7ea4('0x57')])return;var _0x15ad15=_0x3469d4[_0x7ea4('0x59')]();if(_0x151068[_0x7ea4('0x48')][_0x7ea4('0x5a')]&&_0x151068[_0x7ea4('0x48')][_0x7ea4('0x5a')]['length']){for(var _0x239847=0x0;_0x239847<_0x151068[_0x7ea4('0x48')]['attachments'][_0x7ea4('0x33')];_0x239847+=0x1){_0x151068[_0x7ea4('0x48')]['attachments'][_0x239847]={'filename':_0x151068[_0x7ea4('0x48')][_0x7ea4('0x5a')][_0x239847][_0x7ea4('0x2d')],'path':path[_0x7ea4('0x5b')](config[_0x7ea4('0x5c')],'server/files/attachments',_0x151068[_0x7ea4('0x48')]['attachments'][_0x239847][_0x7ea4('0x5d')])};}}_0x25b7f2={'account':_0x15ad15,'message':_0x151068['body']};return;})[_0x7ea4('0x12')](function(){if(_0x3469d4[_0x7ea4('0x52')]){if(_0x3469d4[_0x7ea4('0x52')]['Contacts'][_0x7ea4('0x33')]){return _0x3469d4[_0x7ea4('0x52')]['Contacts'][0x0];}else{return db[_0x7ea4('0x53')][_0x7ea4('0x4a')](_[_0x7ea4('0x9')](_0x151068[_0x7ea4('0x48')],{'firstName':_0x151068[_0x7ea4('0x48')]['to'],'email':_0x151068[_0x7ea4('0x48')]['to'],'phone':_0x151068[_0x7ea4('0x48')]['to'],'ListId':_0x3469d4['ListId']}));}}else{throw new Error(_0x7ea4('0x5e'));}})['then'](function(){if(_0x25b7f2){return respondWithRpcPromise(_0x7ea4('0x5f'),_0x7ea4('0x60'),_0x25b7f2,client9003)[_0x7ea4('0x12')](function(_0x12ed4a){return _0x3039c5['update']({'read':!![],'messageId':_0x12ed4a[_0x7ea4('0x61')],'sentAt':moment()['format'](_0x7ea4('0x62'))});})[_0x7ea4('0x1b')](function(_0x16c0e0){logger['error']('%s',JSON[_0x7ea4('0x16')](_0x16c0e0));return _0x3039c5;});}return _0x3039c5;});}return _0x3039c5;}})['then'](respondWithResult(_0x3bbb90,0xc9))[_0x7ea4('0x1b')](handleError(_0x3bbb90,null));};exports[_0x7ea4('0x63')]=function(_0x5f474c,_0x480245){var _0x28102f={'agent':{},'channel':'mail'};if(_0x5f474c[_0x7ea4('0x48')]['id']){delete _0x5f474c[_0x7ea4('0x48')]['id'];}_0x5f474c[_0x7ea4('0x48')][_0x7ea4('0x64')]=!![];_0x5f474c['body'][_0x7ea4('0x65')]=moment()[_0x7ea4('0x66')](_0x7ea4('0x62'));_0x5f474c[_0x7ea4('0x48')]['UserId']=_0x5f474c['body'][_0x7ea4('0x67')]||_0x5f474c[_0x7ea4('0x68')]['id'];_0x28102f['agent']['id']=_0x5f474c[_0x7ea4('0x48')]['UserId'];return db[_0x7ea4('0x3f')][_0x7ea4('0x47')]({'where':{'id':_0x5f474c['params']['id'],'UserId':null}})[_0x7ea4('0x12')](handleEntityNotFound(_0x480245,null))[_0x7ea4('0x12')](saveUpdates(_0x5f474c['body'],null))[_0x7ea4('0x12')](function(_0x3bba28){if(_0x3bba28){_0x28102f[_0x7ea4('0x19')]=_0x3bba28['get']({'plain':!![]});return db[_0x7ea4('0x69')][_0x7ea4('0x47')]({'where':{'id':_0x3bba28[_0x7ea4('0x6a')]}});}return null;})[_0x7ea4('0x12')](handleEntityNotFound(_0x480245,null))['then'](function(_0x1609c1){if(_0x1609c1){return _0x1609c1[_0x7ea4('0x24')]({'UserId':_0x5f474c[_0x7ea4('0x48')][_0x7ea4('0x67')],'read1stAt':_[_0x7ea4('0x6b')](_0x1609c1['read1stAt'])?moment()[_0x7ea4('0x66')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x7ea4('0x12')](function(_0x45b424){if(_0x45b424){_0x28102f[_0x7ea4('0x6c')]=_0x45b424[_0x7ea4('0x6d')]({'plain':!![]});interaction_log[_0x7ea4('0x1a')](_0x7ea4('0x6e'),_0x5f474c[_0x7ea4('0x68')]['id'],_0x5f474c[_0x7ea4('0x68')][_0x7ea4('0x2d')],_0x5f474c['user']['role'],_0x28102f['interaction']['id'],_0x5f474c[_0x7ea4('0x48')]?JSON[_0x7ea4('0x16')](_0x5f474c['body']):_0x7ea4('0x6f'));return respondWithRpcPromise(_0x7ea4('0x70'),'acceptMessage',_0x28102f);}return null;})['then'](function(_0x4cbd1c){var _0x3ee54a=_0x7ea4('0x71')+_0x4cbd1c[_0x7ea4('0x19')][_0x7ea4('0x72')];return db['sequelize'][_0x7ea4('0x2f')](_0x3ee54a,{'type':db[_0x7ea4('0x73')][_0x7ea4('0x74')]['SELECT'],'raw':!![]})[_0x7ea4('0x12')](function(_0x23aba2){return _0x23aba2;});})['then'](function(_0x1e4b5a){if(_0x1e4b5a){_0x28102f[_0x7ea4('0x19')][_0x7ea4('0x75')]=_0x1e4b5a[0x0];if(!_0x5f474c[_0x7ea4('0x48')][_0x7ea4('0x67')])return;return db['User']['find']({'where':{'id':_0x5f474c[_0x7ea4('0x48')][_0x7ea4('0x67')],'role':_0x7ea4('0x76')},'attributes':['id','name',_0x7ea4('0x77'),_0x7ea4('0x78'),'internal'],'raw':!![]});}return null;})[_0x7ea4('0x12')](function(_0x2ad4b8){if(!_0x2ad4b8)return null;_0x28102f['message'][_0x7ea4('0x76')]=_0x2ad4b8;return _0x28102f;})[_0x7ea4('0x12')](function(_0x478c73){if(_0x478c73){if(_0x5f474c[_0x7ea4('0x48')][_0x7ea4('0x79')]){_0x28102f[_0x7ea4('0x19')][_0x7ea4('0x7a')]=util[_0x7ea4('0x66')](_0x7ea4('0x7b'),_0x5f474c['user'][_0x7ea4('0x2d')]);_0x28102f[_0x7ea4('0x19')][_0x7ea4('0x7c')]=_0x28102f[_0x7ea4('0x7c')];_0x28102f[_0x7ea4('0x19')][_0x7ea4('0x7d')]=_0x28102f[_0x7ea4('0x7c')];_0x28102f[_0x7ea4('0x19')][_0x7ea4('0x7e')]='accept';_0x28102f[_0x7ea4('0x19')]['body']=htmlToText[_0x7ea4('0x7f')](_0x28102f[_0x7ea4('0x19')][_0x7ea4('0x48')]);return respondWithRpcPromise(_0x7ea4('0x80'),_0x7ea4('0x80'),{'event':_0x7ea4('0x81'),'message':_0x28102f['message']},client9002)[_0x7ea4('0x12')](function(){return _0x28102f;});}return _0x28102f;}return null;})[_0x7ea4('0x12')](respondWithResult(_0x480245,null))['catch'](handleError(_0x480245,null));};exports[_0x7ea4('0x82')]=function(_0xb31493,_0x2de29e){var _0x1f2788={'agent':{},'channel':_0x7ea4('0x83')};if(_0xb31493[_0x7ea4('0x48')]['id']){delete _0xb31493['body']['id'];}_0xb31493[_0x7ea4('0x48')]['UserId']=_0xb31493['body'][_0x7ea4('0x67')]||_0xb31493[_0x7ea4('0x68')]['id'];_0x1f2788['agent']['id']=_0xb31493['body'][_0x7ea4('0x67')];return db[_0x7ea4('0x3f')][_0x7ea4('0x47')]({'where':{'id':_0xb31493['params']['id'],'UserId':null}})[_0x7ea4('0x12')](handleEntityNotFound(_0x2de29e,null))['then'](function(_0x286a1c){if(_0x286a1c){_0x1f2788['message']=_0x286a1c[_0x7ea4('0x6d')]({'plain':!![]});return db['MailInteraction']['find']({'where':{'id':_0x286a1c[_0x7ea4('0x6a')]}});}return null;})['then'](handleEntityNotFound(_0x2de29e,null))[_0x7ea4('0x12')](function(_0x252ac5){if(_0x252ac5){_0x1f2788[_0x7ea4('0x6c')]=_0x252ac5['get']({'plain':!![]});interaction_log[_0x7ea4('0x1a')]('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xb31493[_0x7ea4('0x68')]['id'],_0xb31493[_0x7ea4('0x68')][_0x7ea4('0x2d')],_0xb31493[_0x7ea4('0x68')]['role'],_0x1f2788[_0x7ea4('0x6c')]['id'],_0xb31493[_0x7ea4('0x48')]?JSON[_0x7ea4('0x16')](_0xb31493[_0x7ea4('0x48')]):_0x7ea4('0x6f'));return respondWithRpcPromise(_0x7ea4('0x84'),_0x7ea4('0x85'),_0x1f2788);}return null;})[_0x7ea4('0x12')](function(_0x54eed6){var _0x45fabf=_0x7ea4('0x71')+_0x54eed6[_0x7ea4('0x19')][_0x7ea4('0x72')];return db['sequelize'][_0x7ea4('0x2f')](_0x45fabf,{'type':db['Sequelize'][_0x7ea4('0x74')][_0x7ea4('0x86')],'raw':!![]})[_0x7ea4('0x12')](function(_0x14ec93){return _0x14ec93;});})[_0x7ea4('0x12')](function(_0x4647aa){if(_0x4647aa){_0x1f2788[_0x7ea4('0x19')][_0x7ea4('0x75')]=_0x4647aa[0x0];if(!_0xb31493[_0x7ea4('0x48')][_0x7ea4('0x67')])return;return db[_0x7ea4('0x87')][_0x7ea4('0x47')]({'where':{'id':_0xb31493[_0x7ea4('0x48')][_0x7ea4('0x67')],'role':_0x7ea4('0x76')},'attributes':['id',_0x7ea4('0x2d'),'fullname','email',_0x7ea4('0x88')],'raw':!![]});}return null;})[_0x7ea4('0x12')](function(_0xe5c905){if(!_0xe5c905)return null;_0x1f2788['message'][_0x7ea4('0x76')]=_0xe5c905;return _0x1f2788;})['then'](function(_0x4b22ac){if(_0x4b22ac){_0x4b22ac[_0x7ea4('0x19')][_0x7ea4('0x7a')]=util['format'](_0x7ea4('0x7b'),_0xb31493['user'][_0x7ea4('0x2d')]);_0x4b22ac[_0x7ea4('0x19')][_0x7ea4('0x7c')]=_0x1f2788[_0x7ea4('0x7c')];_0x4b22ac[_0x7ea4('0x19')][_0x7ea4('0x7d')]=_0x1f2788['channel'];_0x4b22ac[_0x7ea4('0x19')][_0x7ea4('0x7e')]='reject';_0x4b22ac[_0x7ea4('0x19')]['body']=htmlToText[_0x7ea4('0x7f')](_0x1f2788[_0x7ea4('0x19')][_0x7ea4('0x48')]);respondWithRpcPromise(_0x7ea4('0x80'),_0x7ea4('0x80'),{'event':'rejectmessage','message':_0x4b22ac[_0x7ea4('0x19')]},client9002);return _0x1f2788;}return null;})['then'](respondWithResult(_0x2de29e,null))[_0x7ea4('0x1b')](handleError(_0x2de29e,null));};exports[_0x7ea4('0x89')]=function(_0x311bc5,_0x2ea3c5){var _0x20c345=moment()[_0x7ea4('0x8a')]()[_0x7ea4('0x8b')]();var _0x56acf6=path['join'](config['root'],_0x7ea4('0x8c'),_0x7ea4('0x8d'),'tmp');var _0x4bfc43=path[_0x7ea4('0x5b')](config['root'],_0x7ea4('0x8c'),'files',_0x7ea4('0x5a'));var _0x46327f=util['format'](_0x7ea4('0x8e'),_0x20c345);return db[_0x7ea4('0x3f')]['find']({'where':{'id':_0x311bc5[_0x7ea4('0x44')]['id']},'attributes':['id',_0x7ea4('0x48'),_0x7ea4('0x8f'),'to','cc',_0x7ea4('0x90'),'subject','createdAt'],'include':_0x311bc5[_0x7ea4('0x2f')][_0x7ea4('0x5a')]?[{'model':db[_0x7ea4('0x91')],'as':_0x7ea4('0x92')}]:undefined})[_0x7ea4('0x12')](handleEntityNotFound(_0x2ea3c5,null))[_0x7ea4('0x12')](function(_0x5c2c0a){if(_0x5c2c0a){var _0x48b4d9=_0x5c2c0a;var _0x2f5d51={'from':_0x48b4d9[_0x7ea4('0x8f')],'to':_0x48b4d9['to'],'subject':_0x48b4d9[_0x7ea4('0x93')],'html':htmlEntities[_0x7ea4('0x94')](_0x48b4d9['body']),'headers':{'Date':moment(_0x48b4d9[_0x7ea4('0x95')])['format'](_0x7ea4('0x96'))},'attachments':[]};if(_0x5c2c0a['cc']){_0x2f5d51[_0x7ea4('0x97')]['Cc']=_0x5c2c0a['cc'];}if(_0x5c2c0a['bcc']){_0x2f5d51['headers'][_0x7ea4('0x98')]=_0x5c2c0a[_0x7ea4('0x90')];}return new BPromise(function(_0x4b10f2,_0x5d23a2){if(_0x5c2c0a[_0x7ea4('0x92')]){for(var _0x1a9109=0x0;_0x1a9109<_0x5c2c0a['Attachments']['length'];_0x1a9109++){var _0x4c807e=_0x5c2c0a[_0x7ea4('0x92')][_0x1a9109];var _0x5a376f=path[_0x7ea4('0x5b')](_0x4bfc43,_0x4c807e[_0x7ea4('0x5d')]);if(fs['existsSync'](_0x5a376f)){_0x2f5d51[_0x7ea4('0x5a')][_0x7ea4('0x99')]({'name':_0x4c807e['name'],'contentType':_0x4c807e[_0x7ea4('0x3c')],'data':fs[_0x7ea4('0x9a')](_0x5a376f)});}}}emlformat[_0x7ea4('0x9b')](_0x2f5d51,function(_0x3b989c,_0xe4a3b9){if(_0x3b989c)return _0x5d23a2(_0x3b989c);fs[_0x7ea4('0x9c')](path[_0x7ea4('0x5b')](_0x56acf6,_0x46327f),_0xe4a3b9);return _0x4b10f2(_0xe4a3b9);});});}})[_0x7ea4('0x12')](function(_0x3eae05){if(_0x3eae05){return _0x2ea3c5[_0x7ea4('0x89')](path[_0x7ea4('0x5b')](_0x56acf6,_0x46327f),_0x46327f,function(_0x1b6921){if(!_0x1b6921)fs[_0x7ea4('0x9d')](path[_0x7ea4('0x5b')](_0x56acf6,_0x46327f));});}})[_0x7ea4('0x1b')](handleError(_0x2ea3c5,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 7d134f6..df35acb 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 _0x1950=['save','update','remove','emit','hasOwnProperty','hook','exports','events','MailMessage','setMaxListeners'];(function(_0x36f724,_0x6694de){var _0x275d4b=function(_0x2f9b63){while(--_0x2f9b63){_0x36f724['push'](_0x36f724['shift']());}};_0x275d4b(++_0x6694de);}(_0x1950,0x16f));var _0x0195=function(_0x3ca3f2,_0x5237bf){_0x3ca3f2=_0x3ca3f2-0x0;var _0x265ef3=_0x1950[_0x3ca3f2];return _0x265ef3;};'use strict';var EventEmitter=require(_0x0195('0x0'));var MailMessage=require('../../mysqldb')['db'][_0x0195('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x0195('0x2')](0x0);var events={'afterCreate':_0x0195('0x3'),'afterUpdate':_0x0195('0x4'),'afterDestroy':_0x0195('0x5')};function emitEvent(_0x20e4bb){return function(_0x22ec35,_0x97543,_0x1ea578){MailMessageEvents['emit'](_0x20e4bb+':'+_0x22ec35['id'],_0x22ec35);MailMessageEvents[_0x0195('0x6')](_0x20e4bb,_0x22ec35);_0x1ea578(null);};}for(var e in events){if(events[_0x0195('0x7')](e)){var event=events[e];MailMessage[_0x0195('0x8')](e,emitEvent(event));}}module[_0x0195('0x9')]=MailMessageEvents; \ No newline at end of file +var _0xe080=['MailMessage','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x11eb1f,_0x826f0b){var _0x2121e9=function(_0x5b84a9){while(--_0x5b84a9){_0x11eb1f['push'](_0x11eb1f['shift']());}};_0x2121e9(++_0x826f0b);}(_0xe080,0x8a));var _0x0e08=function(_0x45acce,_0x2f9df6){_0x45acce=_0x45acce-0x0;var _0x10f08e=_0xe080[_0x45acce];return _0x10f08e;};'use strict';var EventEmitter=require(_0x0e08('0x0'));var MailMessage=require(_0x0e08('0x1'))['db'][_0x0e08('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x0e08('0x3')](0x0);var events={'afterCreate':_0x0e08('0x4'),'afterUpdate':'update','afterDestroy':_0x0e08('0x5')};function emitEvent(_0x52802d){return function(_0x500f49,_0x4e5c3b,_0x4e05d2){MailMessageEvents[_0x0e08('0x6')](_0x52802d+':'+_0x500f49['id'],_0x500f49);MailMessageEvents['emit'](_0x52802d,_0x500f49);_0x4e05d2(null);};}for(var e in events){if(events[_0x0e08('0x7')](e)){var event=events[e];MailMessage[_0x0e08('0x8')](e,emitEvent(event));}}module[_0x0e08('0x9')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index a0bcec1..9955fa5 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 _0x0402=['utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','request-promise','html-to-text','path','rimraf','../../config/environment','./mailMessage.attributes','exports','define','mail_messages','messageId','fti_mail_messages','plainBody','FULLTEXT','body','get','direction','toLowerCase','out','secret','isNil','MailInteraction','findOne','then','createdAt','catch','utf8mb4'];(function(_0x277c37,_0x1e2965){var _0x36a326=function(_0x1039a4){while(--_0x1039a4){_0x277c37['push'](_0x277c37['shift']());}};_0x36a326(++_0x1e2965);}(_0x0402,0x137));var _0x2040=function(_0x4d8ed9,_0x2ae284){_0x4d8ed9=_0x4d8ed9-0x0;var _0x1e2140=_0x0402[_0x4d8ed9];return _0x1e2140;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2040('0x0'))(_0x2040('0x1'));var moment=require(_0x2040('0x2'));var BPromise=require(_0x2040('0x3'));var rp=require(_0x2040('0x4'));var htmlToText=require(_0x2040('0x5'));var fs=require('fs');var path=require(_0x2040('0x6'));var rimraf=require(_0x2040('0x7'));var config=require(_0x2040('0x8'));var attributes=require(_0x2040('0x9'));module[_0x2040('0xa')]=function(_0x5093ad,_0x23b077){return _0x5093ad[_0x2040('0xb')]('MailMessage',attributes,{'tableName':_0x2040('0xc'),'paranoid':![],'indexes':[{'name':_0x2040('0xd'),'fields':[_0x2040('0xd')]},{'name':_0x2040('0xe'),'fields':[_0x2040('0xf'),'subject'],'type':_0x2040('0x10')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x45f678,_0x30195b,_0x3302ff){if(_0x45f678['body']){_0x45f678[_0x2040('0xf')]=htmlToText['fromString'](_0x45f678[_0x2040('0x11')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x3302ff(null,_0x30195b);},'afterCreate':function(_0x52b7f0,_0xfda7d3,_0x3182e7){var _0x4d592a=_0x5093ad['models'];var _0x48d964=_0x52b7f0[_0x2040('0x12')]({'plain':!![]});if(_0x48d964[_0x2040('0x13')][_0x2040('0x14')]()==='in'||_0x48d964[_0x2040('0x13')][_0x2040('0x14')]()===_0x2040('0x15')&&!_0x48d964[_0x2040('0x16')]&&!_[_0x2040('0x17')](_0x48d964['UserId'])){_0x4d592a[_0x2040('0x18')][_0x2040('0x19')]({'where':{'id':_0x48d964['MailInteractionId']}})[_0x2040('0x1a')](function(_0x3435af){if(_0x3435af){_0x3435af['update']({'lastMsgAt':_0x48d964[_0x2040('0x1b')],'lastMsgDirection':_0x48d964[_0x2040('0x13')][_0x2040('0x14')]()});}})[_0x2040('0x1c')](function(_0x6b060c){console['error'](_0x6b060c);});}_0x3182e7();}},'charset':_0x2040('0x1d'),'collate':_0x2040('0x1e')});}; \ No newline at end of file +var _0x7492=['messageId','fti_mail_messages','subject','FULLTEXT','body','plainBody','fromString','models','direction','toLowerCase','out','secret','UserId','findOne','MailInteractionId','update','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define'];(function(_0x229c2e,_0x56eb97){var _0x45defa=function(_0x153090){while(--_0x153090){_0x229c2e['push'](_0x229c2e['shift']());}};_0x45defa(++_0x56eb97);}(_0x7492,0x1a7));var _0x2749=function(_0x2caa93,_0x44fe92){_0x2caa93=_0x2caa93-0x0;var _0x2a0741=_0x7492[_0x2caa93];return _0x2a0741;};'use strict';var _=require(_0x2749('0x0'));var util=require(_0x2749('0x1'));var logger=require(_0x2749('0x2'))(_0x2749('0x3'));var moment=require(_0x2749('0x4'));var BPromise=require(_0x2749('0x5'));var rp=require(_0x2749('0x6'));var htmlToText=require('html-to-text');var fs=require('fs');var path=require('path');var rimraf=require(_0x2749('0x7'));var config=require(_0x2749('0x8'));var attributes=require('./mailMessage.attributes');module[_0x2749('0x9')]=function(_0x5e8ff6,_0x2719e9){return _0x5e8ff6[_0x2749('0xa')]('MailMessage',attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':_0x2749('0xb'),'fields':[_0x2749('0xb')]},{'name':_0x2749('0xc'),'fields':['plainBody',_0x2749('0xd')],'type':_0x2749('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2c6a6a,_0x22758b,_0x243831){if(_0x2c6a6a[_0x2749('0xf')]){_0x2c6a6a[_0x2749('0x10')]=htmlToText[_0x2749('0x11')](_0x2c6a6a[_0x2749('0xf')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x243831(null,_0x22758b);},'afterCreate':function(_0x253f1,_0x41cf7b,_0x37eb70){var _0x264933=_0x5e8ff6[_0x2749('0x12')];var _0x1017e7=_0x253f1['get']({'plain':!![]});if(_0x1017e7[_0x2749('0x13')][_0x2749('0x14')]()==='in'||_0x1017e7[_0x2749('0x13')][_0x2749('0x14')]()===_0x2749('0x15')&&!_0x1017e7[_0x2749('0x16')]&&!_['isNil'](_0x1017e7[_0x2749('0x17')])){_0x264933['MailInteraction'][_0x2749('0x18')]({'where':{'id':_0x1017e7[_0x2749('0x19')]}})['then'](function(_0x16ab72){if(_0x16ab72){_0x16ab72[_0x2749('0x1a')]({'lastMsgAt':_0x1017e7['createdAt'],'lastMsgDirection':_0x1017e7['direction'][_0x2749('0x14')]()});}})[_0x2749('0x1b')](function(_0x35a594){console[_0x2749('0x1c')](_0x35a594);});}_0x37eb70();}},'charset':_0x2749('0x1d'),'collate':_0x2749('0x1e')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 0bc5a3e..74641b8 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 _0x955f=['../../mysqldb','rpc','jayson/promise','client','http','defaults','redis','socket.io-emitter','./mailMessage.socket','register','then','info','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','MailMessage,\x20%s,\x20%s','message','result','catch','CreateMailMessage','MailMessage','create','options','raw','lodash','util','moment','bluebird','randomstring'];(function(_0x1e73e5,_0xdb571a){var _0x218c50=function(_0x55c6b8){while(--_0x55c6b8){_0x1e73e5['push'](_0x1e73e5['shift']());}};_0x218c50(++_0xdb571a);}(_0x955f,0x1eb));var _0xf955=function(_0x34ea6e,_0x16844a){_0x34ea6e=_0x34ea6e-0x0;var _0x532f38=_0x955f[_0x34ea6e];return _0x532f38;};'use strict';var _=require(_0xf955('0x0'));var util=require(_0xf955('0x1'));var moment=require(_0xf955('0x2'));var BPromise=require(_0xf955('0x3'));var rs=require(_0xf955('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf955('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf955('0x6'));var config=require('../../config/environment');var jayson=require(_0xf955('0x7'));var client=jayson[_0xf955('0x8')][_0xf955('0x9')]({'port':0x232a});config['redis']=_[_0xf955('0xa')](config[_0xf955('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xf955('0xc'))(new Redis(config[_0xf955('0xb')]));require(_0xf955('0xd'))[_0xf955('0xe')](socket);function respondWithRpcPromise(_0x134c1b,_0x421e4a,_0x186719){return new BPromise(function(_0x4d213a,_0xf7e3e){return client['request'](_0x134c1b,_0x186719)[_0xf955('0xf')](function(_0x5d6211){logger[_0xf955('0x10')]('MailMessage,\x20%s,\x20%s',_0x421e4a,_0xf955('0x11'));logger['debug'](_0xf955('0x12'),_0x421e4a,'request\x20sent',JSON[_0xf955('0x13')](_0x5d6211));if(_0x5d6211[_0xf955('0x14')]){if(_0x5d6211[_0xf955('0x14')][_0xf955('0x15')]===0x1f4){logger[_0xf955('0x14')](_0xf955('0x16'),_0x421e4a,_0x5d6211[_0xf955('0x14')][_0xf955('0x17')]);return _0xf7e3e(_0x5d6211[_0xf955('0x14')][_0xf955('0x17')]);}logger['error'](_0xf955('0x16'),_0x421e4a,_0x5d6211['error'][_0xf955('0x17')]);return _0x4d213a(_0x5d6211[_0xf955('0x14')][_0xf955('0x17')]);}else{logger[_0xf955('0x10')]('MailMessage,\x20%s,\x20%s',_0x421e4a,'request\x20sent');_0x4d213a(_0x5d6211[_0xf955('0x18')][_0xf955('0x17')]);}})[_0xf955('0x19')](function(_0x4d7b5b){logger[_0xf955('0x14')](_0xf955('0x16'),_0x421e4a,_0x4d7b5b);_0xf7e3e(_0x4d7b5b);});});}exports[_0xf955('0x1a')]=function(_0x3f960e){var _0x3ae4fb=this;return new Promise(function(_0x5f4d9a,_0x17d86a){return db[_0xf955('0x1b')][_0xf955('0x1c')](_0x3f960e['body'],{'raw':_0x3f960e[_0xf955('0x1d')]?_0x3f960e['options'][_0xf955('0x1e')]===undefined?!![]:![]:!![]})[_0xf955('0xf')](function(_0x37143d){logger[_0xf955('0x10')](_0xf955('0x1a'),_0x3f960e);logger['debug'](_0xf955('0x1a'),_0x3f960e,JSON[_0xf955('0x13')](_0x37143d));_0x5f4d9a(_0x37143d);})[_0xf955('0x19')](function(_0x13a1a7){logger[_0xf955('0x14')](_0xf955('0x1a'),_0x13a1a7[_0xf955('0x17')],_0x3f960e);_0x17d86a(_0x3ae4fb['error'](0x1f4,_0x13a1a7[_0xf955('0x17')]));});});}; \ No newline at end of file +var _0xbaf0=['request','then','info','debug','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','MailMessage,\x20%s,\x20%s','message','result','catch','MailMessage','create','body','options','raw','CreateMailMessage','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./mailMessage.socket','register'];(function(_0x3a3ce9,_0x14513b){var _0x33a6e9=function(_0x15d257){while(--_0x15d257){_0x3a3ce9['push'](_0x3a3ce9['shift']());}};_0x33a6e9(++_0x14513b);}(_0xbaf0,0x12a));var _0x0baf=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xbaf0[_0x501510];return _0x1e6ee5;};'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});config[_0x0baf('0xc')]=_[_0x0baf('0xd')](config[_0x0baf('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x0baf('0xe'))(new Redis(config['redis']));require(_0x0baf('0xf'))[_0x0baf('0x10')](socket);function respondWithRpcPromise(_0x465528,_0x2f46e8,_0x7f54d4){return new BPromise(function(_0xf4c8ac,_0x41cead){return client[_0x0baf('0x11')](_0x465528,_0x7f54d4)[_0x0baf('0x12')](function(_0x1d60a2){logger[_0x0baf('0x13')]('MailMessage,\x20%s,\x20%s',_0x2f46e8,'request\x20sent');logger[_0x0baf('0x14')](_0x0baf('0x15'),_0x2f46e8,_0x0baf('0x16'),JSON[_0x0baf('0x17')](_0x1d60a2));if(_0x1d60a2['error']){if(_0x1d60a2[_0x0baf('0x18')]['code']===0x1f4){logger[_0x0baf('0x18')](_0x0baf('0x19'),_0x2f46e8,_0x1d60a2[_0x0baf('0x18')][_0x0baf('0x1a')]);return _0x41cead(_0x1d60a2[_0x0baf('0x18')][_0x0baf('0x1a')]);}logger['error']('MailMessage,\x20%s,\x20%s',_0x2f46e8,_0x1d60a2[_0x0baf('0x18')][_0x0baf('0x1a')]);return _0xf4c8ac(_0x1d60a2[_0x0baf('0x18')][_0x0baf('0x1a')]);}else{logger[_0x0baf('0x13')](_0x0baf('0x19'),_0x2f46e8,'request\x20sent');_0xf4c8ac(_0x1d60a2[_0x0baf('0x1b')][_0x0baf('0x1a')]);}})[_0x0baf('0x1c')](function(_0x3e9cb4){logger[_0x0baf('0x18')](_0x0baf('0x19'),_0x2f46e8,_0x3e9cb4);_0x41cead(_0x3e9cb4);});});}exports['CreateMailMessage']=function(_0x5cff5d){var _0x1410ec=this;return new Promise(function(_0x154f48,_0x32e839){return db[_0x0baf('0x1d')][_0x0baf('0x1e')](_0x5cff5d[_0x0baf('0x1f')],{'raw':_0x5cff5d[_0x0baf('0x20')]?_0x5cff5d[_0x0baf('0x20')][_0x0baf('0x21')]===undefined?!![]:![]:!![]})[_0x0baf('0x12')](function(_0x54f2fa){logger[_0x0baf('0x13')]('CreateMailMessage',_0x5cff5d);logger[_0x0baf('0x14')]('CreateMailMessage',_0x5cff5d,JSON['stringify'](_0x54f2fa));_0x154f48(_0x54f2fa);})[_0x0baf('0x1c')](function(_0x48a0e9){logger['error'](_0x0baf('0x22'),_0x48a0e9[_0x0baf('0x1a')],_0x5cff5d);_0x32e839(_0x1410ec[_0x0baf('0x18')](0x1f4,_0x48a0e9[_0x0baf('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index eeb3273..2a9c048 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 _0x929a=['emit','register','./mailMessage.events','save','remove','update'];(function(_0x975b61,_0x237ba6){var _0x5325e7=function(_0x512543){while(--_0x512543){_0x975b61['push'](_0x975b61['shift']());}};_0x5325e7(++_0x237ba6);}(_0x929a,0x10a));var _0xa929=function(_0x4326b5,_0x4597e1){_0x4326b5=_0x4326b5-0x0;var _0x41f3a0=_0x929a[_0x4326b5];return _0x41f3a0;};'use strict';var MailMessageEvents=require(_0xa929('0x0'));var events=[_0xa929('0x1'),_0xa929('0x2'),_0xa929('0x3')];function createListener(_0x3cc52a,_0x9b5026){return function(_0x1076c7){_0x9b5026[_0xa929('0x4')](_0x3cc52a,_0x1076c7);};}function removeListener(_0x376206,_0x258d32){return function(){MailMessageEvents['removeListener'](_0x376206,_0x258d32);};}exports[_0xa929('0x5')]=function(_0x59017e){for(var _0x52728b=0x0,_0x204e8e=events['length'];_0x52728b<_0x204e8e;_0x52728b++){var _0xfbf2fe=events[_0x52728b];var _0x524e18=createListener('mailMessage:'+_0xfbf2fe,_0x59017e);MailMessageEvents['on'](_0xfbf2fe,_0x524e18);}}; \ No newline at end of file +var _0x0d6e=['update','emit','removeListener','./mailMessage.events','save','remove'];(function(_0xf8288e,_0x13d8ba){var _0x59f98d=function(_0x273dfd){while(--_0x273dfd){_0xf8288e['push'](_0xf8288e['shift']());}};_0x59f98d(++_0x13d8ba);}(_0x0d6e,0xc3));var _0xe0d6=function(_0x50c6ec,_0x4b7c55){_0x50c6ec=_0x50c6ec-0x0;var _0x311c3e=_0x0d6e[_0x50c6ec];return _0x311c3e;};'use strict';var MailMessageEvents=require(_0xe0d6('0x0'));var events=[_0xe0d6('0x1'),_0xe0d6('0x2'),_0xe0d6('0x3')];function createListener(_0x5ddec4,_0x228525){return function(_0x3e11d6){_0x228525[_0xe0d6('0x4')](_0x5ddec4,_0x3e11d6);};}function removeListener(_0x316a74,_0x57228d){return function(){MailMessageEvents[_0xe0d6('0x5')](_0x316a74,_0x57228d);};}exports['register']=function(_0x1c4dbe){for(var _0x40f626=0x0,_0x511b06=events['length'];_0x40f626<_0x511b06;_0x40f626++){var _0x26d150=events[_0x40f626];var _0x760900=createListener('mailMessage:'+_0x26d150,_0x1c4dbe);MailMessageEvents['on'](_0x26d150,_0x760900);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 8b3ec18..5cce578 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 _0x7340=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','/:id/members','getMembers','getTeams','/:id/users','post','create','/:id/teams','addAgents','update','delete','destroy','removeTeams','removeAgents','exports','path','express','fs-extra'];(function(_0x33d130,_0x239f63){var _0x6e93a0=function(_0x232605){while(--_0x232605){_0x33d130['push'](_0x33d130['shift']());}};_0x6e93a0(++_0x239f63);}(_0x7340,0x169));var _0x0734=function(_0x224573,_0x580b63){_0x224573=_0x224573-0x0;var _0x2bd70f=_0x7340[_0x224573];return _0x2bd70f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0734('0x0'));var timeout=require('connect-timeout');var express=require(_0x0734('0x1'));var router=express['Router']();var fs_extra=require(_0x0734('0x2'));var auth=require(_0x0734('0x3'));var interaction=require(_0x0734('0x4'));var config=require(_0x0734('0x5'));var controller=require('./mailQueue.controller');router[_0x0734('0x6')]('/',auth[_0x0734('0x7')](),controller[_0x0734('0x8')]);router[_0x0734('0x6')](_0x0734('0x9'),auth[_0x0734('0x7')](),controller[_0x0734('0xa')]);router[_0x0734('0x6')](_0x0734('0xb'),auth[_0x0734('0x7')](),controller['show']);router[_0x0734('0x6')](_0x0734('0xc'),auth['isAuthenticated'](),controller[_0x0734('0xd')]);router[_0x0734('0x6')]('/:id/teams',auth[_0x0734('0x7')](),controller[_0x0734('0xe')]);router[_0x0734('0x6')](_0x0734('0xf'),auth[_0x0734('0x7')](),controller['getAgents']);router[_0x0734('0x10')]('/',auth[_0x0734('0x7')](),controller[_0x0734('0x11')]);router[_0x0734('0x10')](_0x0734('0x12'),auth[_0x0734('0x7')](),controller['addTeams']);router[_0x0734('0x10')]('/:id/users',auth['isAuthenticated'](),controller[_0x0734('0x13')]);router['put'](_0x0734('0xb'),auth[_0x0734('0x7')](),controller[_0x0734('0x14')]);router[_0x0734('0x15')](_0x0734('0xb'),auth[_0x0734('0x7')](),controller[_0x0734('0x16')]);router[_0x0734('0x15')]('/:id/teams',auth['isAuthenticated'](),controller[_0x0734('0x17')]);router[_0x0734('0x15')]('/:id/users',auth['isAuthenticated'](),controller[_0x0734('0x18')]);module[_0x0734('0x19')]=router; \ No newline at end of file +var _0x6f1c=['util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','addAgents','put','update','destroy','delete','removeTeams','removeAgents','exports','multer'];(function(_0xef61ba,_0x4b2a1a){var _0x307a18=function(_0x2f9d2e){while(--_0x2f9d2e){_0xef61ba['push'](_0xef61ba['shift']());}};_0x307a18(++_0x4b2a1a);}(_0x6f1c,0x95));var _0xc6f1=function(_0x4e70ea,_0x4d43f8){_0x4e70ea=_0x4e70ea-0x0;var _0x5e07c5=_0x6f1c[_0x4e70ea];return _0x5e07c5;};'use strict';var multer=require(_0xc6f1('0x0'));var util=require(_0xc6f1('0x1'));var path=require(_0xc6f1('0x2'));var timeout=require(_0xc6f1('0x3'));var express=require(_0xc6f1('0x4'));var router=express['Router']();var fs_extra=require(_0xc6f1('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc6f1('0x6'));var config=require(_0xc6f1('0x7'));var controller=require(_0xc6f1('0x8'));router[_0xc6f1('0x9')]('/',auth[_0xc6f1('0xa')](),controller[_0xc6f1('0xb')]);router[_0xc6f1('0x9')](_0xc6f1('0xc'),auth[_0xc6f1('0xa')](),controller[_0xc6f1('0xd')]);router['get'](_0xc6f1('0xe'),auth['isAuthenticated'](),controller['show']);router[_0xc6f1('0x9')](_0xc6f1('0xf'),auth[_0xc6f1('0xa')](),controller[_0xc6f1('0x10')]);router[_0xc6f1('0x9')](_0xc6f1('0x11'),auth[_0xc6f1('0xa')](),controller[_0xc6f1('0x12')]);router[_0xc6f1('0x9')](_0xc6f1('0x13'),auth['isAuthenticated'](),controller[_0xc6f1('0x14')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['post'](_0xc6f1('0x11'),auth['isAuthenticated'](),controller['addTeams']);router[_0xc6f1('0x15')]('/:id/users',auth[_0xc6f1('0xa')](),controller[_0xc6f1('0x16')]);router[_0xc6f1('0x17')](_0xc6f1('0xe'),auth[_0xc6f1('0xa')](),controller[_0xc6f1('0x18')]);router['delete'](_0xc6f1('0xe'),auth[_0xc6f1('0xa')](),controller[_0xc6f1('0x19')]);router[_0xc6f1('0x1a')](_0xc6f1('0x11'),auth[_0xc6f1('0xa')](),controller[_0xc6f1('0x1b')]);router['delete']('/:id/users',auth[_0xc6f1('0xa')](),controller[_0xc6f1('0x1c')]);module[_0xc6f1('0x1d')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index a223838..5e79c3c 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 _0xae61=['ENUM','roundrobin','exports','name','STRING','INTEGER'];(function(_0x1665d5,_0x1ee0d5){var _0x58bf52=function(_0x51d508){while(--_0x51d508){_0x1665d5['push'](_0x1665d5['shift']());}};_0x58bf52(++_0x1ee0d5);}(_0xae61,0x13a));var _0x1ae6=function(_0x414f1f,_0x22b501){_0x414f1f=_0x414f1f-0x0;var _0x4ace19=_0xae61[_0x414f1f];return _0x4ace19;};'use strict';var Sequelize=require('sequelize');module[_0x1ae6('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x1ae6('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x1ae6('0x2')]},'timeout':{'type':Sequelize[_0x1ae6('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x1ae6('0x4')]('rrmemory','beepall',_0x1ae6('0x5'))}}; \ No newline at end of file +var _0x1c1e=['name','INTEGER','ENUM','beepall','roundrobin','exports','STRING'];(function(_0x5aa838,_0x29aa58){var _0x49b414=function(_0x1929ae){while(--_0x1929ae){_0x5aa838['push'](_0x5aa838['shift']());}};_0x49b414(++_0x29aa58);}(_0x1c1e,0x9f));var _0xe1c1=function(_0x5950bd,_0x103e16){_0x5950bd=_0x5950bd-0x0;var _0x33e816=_0x1c1e[_0x5950bd];return _0x33e816;};'use strict';var Sequelize=require('sequelize');module[_0xe1c1('0x0')]={'name':{'type':Sequelize[_0xe1c1('0x1')],'unique':_0xe1c1('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xe1c1('0x1')]},'timeout':{'type':Sequelize[_0xe1c1('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xe1c1('0x4')]('rrmemory',_0xe1c1('0x5'),_0xe1c1('0x6'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index b09cb36..24294de 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 _0x5cd1=['userMailQueue:save','select','field','tq.TeamId','from','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','removeTeams','isEmpty','removeAgents','userMailQueue:remove','addAgents','spread','isArray','getAgents','bluebird','util','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','update','destroy','then','get','MailQueues','UserProfileResource','error','stack','name','index','rawAttributes','key','getOptions','MailQueue','include','query','findAll','rows','catch','show','params','keys','filters','intersection','model','attributes','fields','includeAll','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMembers','findOne','UserMailQueue','hasOwnProperty','nolimit','order','sort','where','MailQueueId','filter','options','User','findAndCountAll','agent','mailPause','createdAt','map','%s/%s','SIP','updatedAt','getTeams','Team','length','pick','addTeams','ids','Agents','voicePause','interface','flatMap','sequelize','each','forEach','emit'];(function(_0xc8f777,_0xe9e88f){var _0x28bce1=function(_0x3d4da5){while(--_0x3d4da5){_0xc8f777['push'](_0xc8f777['shift']());}};_0x28bce1(++_0xe9e88f);}(_0x5cd1,0x197));var _0x15cd=function(_0x4c250b,_0x3d4731){_0x4c250b=_0x4c250b-0x0;var _0x282345=_0x5cd1[_0x4c250b];return _0x282345;};'use strict';var BPromise=require(_0x15cd('0x0'));var util=require(_0x15cd('0x1'));var _=require(_0x15cd('0x2'));var squel=require(_0x15cd('0x3'));var Redis=require(_0x15cd('0x4'));var qs=require(_0x15cd('0x5'));var logger=require(_0x15cd('0x6'))(_0x15cd('0x7'));var config=require(_0x15cd('0x8'));var db=require(_0x15cd('0x9'))['db'];config[_0x15cd('0xa')]=_[_0x15cd('0xb')](config['redis'],{'host':_0x15cd('0xc'),'port':0x18eb});var socket=require(_0x15cd('0xd'))(new Redis(config[_0x15cd('0xa')]));require(_0x15cd('0xe'))[_0x15cd('0xf')](socket);function respondWithStatusCode(_0x3cb1c7,_0x15d164){_0x15d164=_0x15d164||0xcc;return function(_0x4daea2){if(_0x4daea2){return _0x3cb1c7[_0x15cd('0x10')](_0x15d164);}return _0x3cb1c7['status'](_0x15d164)[_0x15cd('0x11')]();};}function respondWithResult(_0xca0c93,_0x44cf56){_0x44cf56=_0x44cf56||0xc8;return function(_0x467d67){if(_0x467d67){return _0xca0c93[_0x15cd('0x12')](_0x44cf56)[_0x15cd('0x13')](_0x467d67);}};}function respondWithFilteredResult(_0x43e6d4,_0x553bfb){return function(_0x2c992d){if(_0x2c992d){var _0x5b61a3=typeof _0x553bfb['offset']===_0x15cd('0x14')&&typeof _0x553bfb[_0x15cd('0x15')]===_0x15cd('0x14');var _0x498ae1=_0x2c992d[_0x15cd('0x16')];var _0x1e2d1a=_0x5b61a3?0x0:_0x553bfb[_0x15cd('0x17')];var _0x7fefc7=_0x5b61a3?_0x2c992d['count']:_0x553bfb[_0x15cd('0x17')]+_0x553bfb['limit'];var _0x42f110;if(_0x7fefc7>=_0x498ae1){_0x7fefc7=_0x498ae1;_0x42f110=0xc8;}else{_0x42f110=0xce;}_0x43e6d4['status'](_0x42f110);return _0x43e6d4[_0x15cd('0x18')](_0x15cd('0x19'),_0x1e2d1a+'-'+_0x7fefc7+'/'+_0x498ae1)[_0x15cd('0x13')](_0x2c992d);}return null;};}function saveUpdates(_0x161641){return function(_0x4535b7){if(_0x4535b7){return _0x4535b7[_0x15cd('0x1a')](_0x161641)['then'](function(_0x3a21be){return _0x3a21be;});}return null;};}function removeEntity(_0x1e2a6b){return function(_0x1dff6c){if(_0x1dff6c){return _0x1dff6c[_0x15cd('0x1b')]()[_0x15cd('0x1c')](function(){var _0xc3c838=_0x1dff6c[_0x15cd('0x1d')]({'plain':!![]});var _0x4ca33a=_0x15cd('0x1e');return db[_0x15cd('0x1f')][_0x15cd('0x1b')]({'where':{'type':_0x4ca33a,'resourceId':_0xc3c838['id']}})[_0x15cd('0x1c')](function(){return _0x1dff6c;});})['then'](function(){_0x1e2a6b[_0x15cd('0x12')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2701e4){return function(_0x449c7a){if(!_0x449c7a){_0x2701e4[_0x15cd('0x10')](0x194);}return _0x449c7a;};}function handleError(_0x7da33d,_0x461b0e){_0x461b0e=_0x461b0e||0x1f4;return function(_0x32964e){logger[_0x15cd('0x20')](_0x32964e[_0x15cd('0x21')]);if(_0x32964e['name']){delete _0x32964e[_0x15cd('0x22')];}_0x7da33d[_0x15cd('0x12')](_0x461b0e)['send'](_0x32964e);};}exports[_0x15cd('0x23')]=function(_0x576ec8,_0x36fb1f){var _0x41f06b={};var _0x163039={'count':0x0,'rows':[]};var _0x56a7b9=_['map'](db['MailQueue'][_0x15cd('0x24')],function(_0x4cf3c0){return{'name':_0x4cf3c0['fieldName'],'type':_0x4cf3c0['type'][_0x15cd('0x25')]};});_0x41f06b=qs[_0x15cd('0x26')](_0x56a7b9,_0x576ec8);var _0x154787={'where':_0x41f06b['where']};return db[_0x15cd('0x27')][_0x15cd('0x16')](_0x154787)[_0x15cd('0x1c')](function(_0x1ff57f){_0x163039[_0x15cd('0x16')]=_0x1ff57f;_0x41f06b[_0x15cd('0x28')]=qs[_0x15cd('0x28')](_0x576ec8[_0x15cd('0x29')]);return db[_0x15cd('0x27')][_0x15cd('0x2a')](_0x41f06b);})['then'](function(_0x460fba){_0x163039[_0x15cd('0x2b')]=_0x460fba;return _0x163039;})['then'](respondWithFilteredResult(_0x36fb1f,_0x41f06b))[_0x15cd('0x2c')](handleError(_0x36fb1f,null));};exports[_0x15cd('0x2d')]=function(_0x2bc0eb,_0x269260){var _0xef7a98={'raw':!![],'where':{'id':_0x2bc0eb[_0x15cd('0x2e')]['id']}},_0x32a12e={};_0x32a12e['model']=_['keys'](db[_0x15cd('0x27')][_0x15cd('0x24')]);_0x32a12e[_0x15cd('0x29')]=_[_0x15cd('0x2f')](_0x2bc0eb[_0x15cd('0x29')]);_0x32a12e[_0x15cd('0x30')]=_[_0x15cd('0x31')](_0x32a12e[_0x15cd('0x32')],_0x32a12e[_0x15cd('0x29')]);_0xef7a98[_0x15cd('0x33')]=_[_0x15cd('0x31')](_0x32a12e['model'],qs[_0x15cd('0x34')](_0x2bc0eb[_0x15cd('0x29')][_0x15cd('0x34')]));_0xef7a98[_0x15cd('0x33')]=_0xef7a98[_0x15cd('0x33')]['length']?_0xef7a98[_0x15cd('0x33')]:_0x32a12e[_0x15cd('0x32')];if(_0x2bc0eb[_0x15cd('0x29')][_0x15cd('0x35')]){_0xef7a98['include']=[{'all':!![]}];}_0xef7a98=_[_0x15cd('0x36')]({},_0xef7a98,_0x2bc0eb['options']);return db[_0x15cd('0x27')][_0x15cd('0x37')](_0xef7a98)['then'](handleEntityNotFound(_0x269260,null))[_0x15cd('0x1c')](respondWithResult(_0x269260,null))[_0x15cd('0x2c')](handleError(_0x269260,null));};exports[_0x15cd('0x38')]=function(_0x394103,_0x18b6be){return db[_0x15cd('0x27')]['create'](_0x394103[_0x15cd('0x39')],{})[_0x15cd('0x1c')](function(_0x50785b){var _0xb09efa=_0x394103[_0x15cd('0x3a')][_0x15cd('0x1d')]({'plain':!![]});if(!_0xb09efa)throw new Error(_0x15cd('0x3b'));if(_0xb09efa[_0x15cd('0x3c')]===_0x15cd('0x3a')){var _0x4e02d3=_0x50785b[_0x15cd('0x1d')]({'plain':!![]});var _0x6b33ea=_0x15cd('0x1e');return db[_0x15cd('0x3d')][_0x15cd('0x37')]({'where':{'name':_0x6b33ea,'userProfileId':_0xb09efa['userProfileId']},'raw':!![]})[_0x15cd('0x1c')](function(_0x304355){if(_0x304355&&_0x304355['autoAssociation']===0x0){return db[_0x15cd('0x1f')][_0x15cd('0x38')]({'name':_0x4e02d3[_0x15cd('0x22')],'resourceId':_0x4e02d3['id'],'type':_0x304355[_0x15cd('0x22')],'sectionId':_0x304355['id']},{})['then'](function(){return _0x50785b;});}else{return _0x50785b;}})[_0x15cd('0x2c')](function(_0x1a295a){logger[_0x15cd('0x20')](_0x15cd('0x3e'),_0x1a295a);throw _0x1a295a;});}return _0x50785b;})[_0x15cd('0x1c')](respondWithResult(_0x18b6be,0xc9))[_0x15cd('0x2c')](handleError(_0x18b6be,null));};exports[_0x15cd('0x1a')]=function(_0x1f12ad,_0x5cb5cc){if(_0x1f12ad[_0x15cd('0x39')]['id']){delete _0x1f12ad[_0x15cd('0x39')]['id'];}return db['MailQueue'][_0x15cd('0x37')]({'where':{'id':_0x1f12ad[_0x15cd('0x2e')]['id']}})[_0x15cd('0x1c')](handleEntityNotFound(_0x5cb5cc,null))[_0x15cd('0x1c')](saveUpdates(_0x1f12ad[_0x15cd('0x39')],null))['then'](respondWithResult(_0x5cb5cc,null))['catch'](handleError(_0x5cb5cc,null));};exports['destroy']=function(_0x2e47d1,_0x5dffd6){return db[_0x15cd('0x27')]['find']({'where':{'id':_0x2e47d1[_0x15cd('0x2e')]['id']}})[_0x15cd('0x1c')](handleEntityNotFound(_0x5dffd6,null))[_0x15cd('0x1c')](removeEntity(_0x5dffd6,null))[_0x15cd('0x2c')](handleError(_0x5dffd6,null));};exports['describe']=function(_0xdc3769,_0x18a6f2){return db[_0x15cd('0x27')]['describe']()['then'](respondWithResult(_0x18a6f2,null))[_0x15cd('0x2c')](handleError(_0x18a6f2,null));};exports[_0x15cd('0x3f')]=function(_0x36abce,_0x321f0f){var _0x194730={'raw':!![],'where':{}},_0x5a5111={},_0x35bb55;return db['MailQueue'][_0x15cd('0x40')]({'where':{'id':_0x36abce[_0x15cd('0x2e')]['id']}})['then'](handleEntityNotFound(_0x321f0f,null))[_0x15cd('0x1c')](function(_0x4fd0b6){if(_0x4fd0b6){_0x35bb55=_0x4fd0b6[_0x15cd('0x1d')]({'plain':!![]});_0x5a5111['model']=_[_0x15cd('0x2f')](db[_0x15cd('0x41')][_0x15cd('0x24')]);_0x5a5111['query']=_[_0x15cd('0x2f')](_0x36abce[_0x15cd('0x29')]);_0x5a5111[_0x15cd('0x30')]=_[_0x15cd('0x31')](_0x5a5111[_0x15cd('0x32')],_0x5a5111[_0x15cd('0x29')]);_0x194730[_0x15cd('0x33')]=_['intersection'](_0x5a5111[_0x15cd('0x32')],qs[_0x15cd('0x34')](_0x36abce['query'][_0x15cd('0x34')]));_0x194730['attributes']=_0x194730['attributes']['length']?_0x194730[_0x15cd('0x33')]:_0x5a5111[_0x15cd('0x32')];if(!_0x36abce[_0x15cd('0x29')][_0x15cd('0x42')](_0x15cd('0x43'))){_0x194730[_0x15cd('0x15')]=qs[_0x15cd('0x15')](_0x36abce[_0x15cd('0x29')][_0x15cd('0x15')]);_0x194730[_0x15cd('0x17')]=qs['offset'](_0x36abce['query'][_0x15cd('0x17')]);}_0x194730[_0x15cd('0x44')]=qs['sort'](_0x36abce[_0x15cd('0x29')][_0x15cd('0x45')]);_0x194730['where']=qs[_0x15cd('0x30')](_['pick'](_0x36abce['query'],_0x5a5111['filters']));_0x194730[_0x15cd('0x46')][_0x15cd('0x47')]=_0x4fd0b6['id'];if(_0x36abce['query'][_0x15cd('0x48')]){_0x194730[_0x15cd('0x46')]=_[_0x15cd('0x36')](_0x194730[_0x15cd('0x46')],{'$or':_['map'](_0x194730['attributes'],function(_0x15fb94){var _0x3417af={};_0x3417af[_0x15fb94]={'$like':'%'+_0x36abce[_0x15cd('0x29')][_0x15cd('0x48')]+'%'};return _0x3417af;})});}_0x194730=_['merge']({},_0x194730,_0x36abce[_0x15cd('0x49')]);return db[_0x15cd('0x41')][_0x15cd('0x2a')](_0x194730);}})[_0x15cd('0x1c')](function(_0x144851){if(_0x144851){return db[_0x15cd('0x4a')][_0x15cd('0x4b')]({'where':{'id':_['map'](_0x144851,'UserId'),'role':_0x15cd('0x4c')},'attributes':['id',_0x15cd('0x22'),_0x15cd('0x4d'),'updatedAt',_0x15cd('0x4e')]});}})['then'](function(_0x45238f){if(_0x45238f){return{'count':_0x45238f['count'],'rows':_[_0x15cd('0x4f')](_0x45238f['rows'],function(_0xa6abd){return{'membername':_0xa6abd['name'],'UserId':_0xa6abd['id'],'queue_name':_0x35bb55[_0x15cd('0x22')],'MailQueueId':_0x35bb55['id'],'interface':util['format'](_0x15cd('0x50'),_0x15cd('0x51'),_0xa6abd[_0x15cd('0x22')]),'penalty':0x0,'paused':_0xa6abd['mailPause'],'createdAt':_0xa6abd[_0x15cd('0x4e')],'updatedAt':_0xa6abd[_0x15cd('0x52')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x15cd('0x1c')](respondWithFilteredResult(_0x321f0f,_0x194730))[_0x15cd('0x2c')](handleError(_0x321f0f,null));};exports[_0x15cd('0x53')]=function(_0x4b13a9,_0x34cf86){var _0x37d525={};var _0x303bc5={};var _0xe78242;var _0xffd640;return db[_0x15cd('0x27')][_0x15cd('0x40')]({'where':{'id':_0x4b13a9[_0x15cd('0x2e')]['id']}})[_0x15cd('0x1c')](handleEntityNotFound(_0x34cf86,null))['then'](function(_0x2c9bb5){if(_0x2c9bb5){_0xe78242=_0x2c9bb5;_0x303bc5[_0x15cd('0x32')]=_['keys'](db[_0x15cd('0x54')][_0x15cd('0x24')]);_0x303bc5[_0x15cd('0x29')]=_['keys'](_0x4b13a9[_0x15cd('0x29')]);_0x303bc5[_0x15cd('0x30')]=_['intersection'](_0x303bc5[_0x15cd('0x32')],_0x303bc5[_0x15cd('0x29')]);_0x37d525[_0x15cd('0x33')]=_[_0x15cd('0x31')](_0x303bc5[_0x15cd('0x32')],qs[_0x15cd('0x34')](_0x4b13a9[_0x15cd('0x29')][_0x15cd('0x34')]));_0x37d525[_0x15cd('0x33')]=_0x37d525[_0x15cd('0x33')][_0x15cd('0x55')]?_0x37d525[_0x15cd('0x33')]:_0x303bc5[_0x15cd('0x32')];_0x37d525['order']=qs[_0x15cd('0x45')](_0x4b13a9[_0x15cd('0x29')][_0x15cd('0x45')]);_0x37d525[_0x15cd('0x46')]=qs[_0x15cd('0x30')](_[_0x15cd('0x56')](_0x4b13a9[_0x15cd('0x29')],_0x303bc5[_0x15cd('0x30')]));if(_0x4b13a9[_0x15cd('0x29')][_0x15cd('0x48')]){_0x37d525[_0x15cd('0x46')]=_[_0x15cd('0x36')](_0x37d525[_0x15cd('0x46')],{'$or':_[_0x15cd('0x4f')](_0x37d525['attributes'],function(_0x4ecd8b){var _0x466ede={};_0x466ede[_0x4ecd8b]={'$like':'%'+_0x4b13a9[_0x15cd('0x29')][_0x15cd('0x48')]+'%'};return _0x466ede;})});}_0x37d525=_[_0x15cd('0x36')]({},_0x37d525,_0x4b13a9[_0x15cd('0x49')]);return _0xe78242['getTeams'](_0x37d525);}})[_0x15cd('0x1c')](function(_0x577d09){if(_0x577d09){_0xffd640=_0x577d09[_0x15cd('0x55')];if(!_0x4b13a9['query'][_0x15cd('0x42')]('nolimit')){_0x37d525[_0x15cd('0x15')]=qs['limit'](_0x4b13a9[_0x15cd('0x29')]['limit']);_0x37d525[_0x15cd('0x17')]=qs[_0x15cd('0x17')](_0x4b13a9['query'][_0x15cd('0x17')]);}return _0xe78242['getTeams'](_0x37d525);}})[_0x15cd('0x1c')](function(_0x361f89){if(_0x361f89){return _0x361f89?{'count':_0xffd640,'rows':_0x361f89}:null;}})[_0x15cd('0x1c')](respondWithResult(_0x34cf86,null))['catch'](handleError(_0x34cf86,null));};exports[_0x15cd('0x57')]=function(_0x5ee0e9,_0x2544c0){var _0x1443ad=_0x5ee0e9['body'][_0x15cd('0x58')];return db[_0x15cd('0x54')][_0x15cd('0x2a')]({'where':{'id':_0x1443ad},'attributes':['id'],'include':[{'model':db[_0x15cd('0x4a')],'as':_0x15cd('0x59'),'attributes':['id',_0x15cd('0x22'),'online',_0x15cd('0x5a'),_0x15cd('0x5b')],'raw':!![]}]})[_0x15cd('0x1c')](function(_0x5056a2){if(_0x5056a2){var _0x49997f=_[_0x15cd('0x5c')](_0x5056a2,function(_0x1c7ece){var _0x5e8cc3=_0x1c7ece[_0x15cd('0x1d')]({'plain':!![]});return _0x5e8cc3[_0x15cd('0x59')];});return db[_0x15cd('0x27')][_0x15cd('0x37')]({'where':{'id':_0x5ee0e9[_0x15cd('0x2e')]['id']}})[_0x15cd('0x1c')](function(_0x511bab){return db[_0x15cd('0x5d')]['transaction'](function(_0xa9e9a4){return _0x511bab['addTeams'](_0x1443ad,{'transaction':_0xa9e9a4})[_0x15cd('0x1c')](function(){return BPromise[_0x15cd('0x5e')](_0x49997f,function(_0xa82eb6){return db[_0x15cd('0x41')]['findOrCreate']({'where':{'UserId':_0xa82eb6['id'],'MailQueueId':_0x5ee0e9['params']['id']},'transaction':_0xa9e9a4});});})[_0x15cd('0x1c')](function(){_0x49997f[_0x15cd('0x5f')](function(_0x35736e){socket[_0x15cd('0x60')](_0x15cd('0x61'),{'UserId':_0x35736e['id'],'MailQueueId':_0x511bab['id']});});});});});}})[_0x15cd('0x1c')](respondWithStatusCode(_0x2544c0,null))[_0x15cd('0x2c')](handleError(_0x2544c0,null));};exports['removeTeams']=function(_0xe22dbe,_0x5ca1c8){return db[_0x15cd('0x54')]['findAll']({'where':{'id':_0xe22dbe[_0x15cd('0x29')][_0x15cd('0x58')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x15cd('0x59'),'attributes':['id'],'raw':!![]}]})[_0x15cd('0x1c')](handleEntityNotFound(_0x5ca1c8,null))[_0x15cd('0x1c')](function(_0x259001){var _0x9e640f=_[_0x15cd('0x4f')](_0x259001,'id');var _0x143ef0=[];var _0x26aa47=[];var _0x238b9b=squel[_0x15cd('0x62')]();_0x238b9b[_0x15cd('0x63')](_0x15cd('0x64'))[_0x15cd('0x65')](_0x15cd('0x66'),'tq')[_0x15cd('0x67')](_0x15cd('0x68'),'ut',_0x15cd('0x69'))[_0x15cd('0x46')]('MailQueueId\x20=\x20?',_0xe22dbe[_0x15cd('0x2e')]['id']);for(var _0x140e6d=0x0;_0x140e6d<_0x259001[_0x15cd('0x55')];_0x140e6d+=0x1){let _0x55a71d=_0x259001[_0x140e6d];for(var _0x351606=0x0;_0x351606<_0x55a71d[_0x15cd('0x59')][_0x15cd('0x55')];_0x351606+=0x1){let _0x32b9a7=_0x55a71d['Agents'][_0x351606];var _0x967e25=_0x238b9b[_0x15cd('0x6a')]();_0x967e25[_0x15cd('0x46')](_0x15cd('0x6b'),_0x32b9a7['id']);_0x26aa47[_0x15cd('0x6c')](db[_0x15cd('0x5d')]['query'](_0x967e25['toString'](),{'type':db['sequelize'][_0x15cd('0x6d')][_0x15cd('0x6e')]})[_0x15cd('0x1c')](function(_0xd3e44){if(_0xd3e44[_0x15cd('0x55')]===0x1){return _0x32b9a7['id'];}else{var _0x5bdd29=_[_0x15cd('0x6f')](_[_0x15cd('0x4f')](_0xd3e44,_0x15cd('0x70')),function(_0x49da7a){return _[_0x15cd('0x71')](_0x9e640f,_0x49da7a);});if(_0x5bdd29){return _0x32b9a7['id'];}}}));}}return BPromise[_0x15cd('0x72')](_0x26aa47)[_0x15cd('0x1c')](function(_0x536c65){_0x143ef0=_(_0x143ef0)[_0x15cd('0x73')](_0x536c65)[_0x15cd('0x74')]()[_0x15cd('0x75')]();return db['MailQueue'][_0x15cd('0x37')]({'where':{'id':_0xe22dbe[_0x15cd('0x2e')]['id']}})['then'](function(_0x19631a){return db[_0x15cd('0x5d')]['transaction'](function(_0x358a31){return _0x19631a[_0x15cd('0x76')](_0xe22dbe[_0x15cd('0x29')]['ids'],{'transaction':_0x358a31})['then'](function(){if(!_[_0x15cd('0x77')](_0x143ef0)){return _0x19631a[_0x15cd('0x78')](_0x143ef0,{'transaction':_0x358a31});}})['then'](function(){_0x143ef0[_0x15cd('0x5f')](function(_0x482981){socket[_0x15cd('0x60')](_0x15cd('0x79'),{'UserId':_0x482981,'MailQueueId':_0x19631a['id']});});});});});});})[_0x15cd('0x1c')](respondWithStatusCode(_0x5ca1c8,null))[_0x15cd('0x2c')](handleError(_0x5ca1c8,null));};exports[_0x15cd('0x7a')]=function(_0x2f44d1,_0x244e3a){return db[_0x15cd('0x27')][_0x15cd('0x37')]({'where':{'id':_0x2f44d1[_0x15cd('0x2e')]['id']}})[_0x15cd('0x1c')](handleEntityNotFound(_0x244e3a,null))['then'](function(_0x1fcd59){if(_0x1fcd59){return _0x1fcd59[_0x15cd('0x7a')](_0x2f44d1['body'][_0x15cd('0x58')],_['omit'](_0x2f44d1[_0x15cd('0x39')],['ids','id'])||{})[_0x15cd('0x7b')](function(_0x2f10e1){for(var _0x4012fd=0x0;_0x4012fd<_0x2f44d1[_0x15cd('0x39')][_0x15cd('0x58')][_0x15cd('0x55')];_0x4012fd+=0x1){socket['emit'](_0x15cd('0x61'),{'UserId':Number(_0x2f44d1[_0x15cd('0x39')][_0x15cd('0x58')][_0x4012fd]),'MailQueueId':Number(_0x2f44d1[_0x15cd('0x2e')]['id'])});}return _0x2f10e1;});}})[_0x15cd('0x1c')](respondWithResult(_0x244e3a,null))[_0x15cd('0x2c')](handleError(_0x244e3a,null));};exports['removeAgents']=function(_0x48341a,_0x36c472){return db[_0x15cd('0x27')][_0x15cd('0x37')]({'where':{'id':_0x48341a[_0x15cd('0x2e')]['id']}})['then'](handleEntityNotFound(_0x36c472,null))[_0x15cd('0x1c')](function(_0x2280ad){if(_0x2280ad){return _0x2280ad[_0x15cd('0x78')](_0x48341a[_0x15cd('0x29')]['ids'])[_0x15cd('0x1c')](function(){if(_[_0x15cd('0x7c')](_0x48341a[_0x15cd('0x29')][_0x15cd('0x58')])){for(var _0x4c19a3=0x0;_0x4c19a3<_0x48341a['query']['ids'][_0x15cd('0x55')];_0x4c19a3+=0x1){socket['emit'](_0x15cd('0x79'),{'UserId':Number(_0x48341a['query'][_0x15cd('0x58')][_0x4c19a3]),'MailQueueId':Number(_0x48341a[_0x15cd('0x2e')]['id'])});}}else{socket['emit'](_0x15cd('0x79'),{'UserId':Number(_0x48341a[_0x15cd('0x29')]['ids']),'MailQueueId':Number(_0x48341a[_0x15cd('0x2e')]['id'])});}});}})[_0x15cd('0x1c')](respondWithStatusCode(_0x36c472,null))[_0x15cd('0x2c')](handleError(_0x36c472,null));};exports[_0x15cd('0x7d')]=function(_0x34150f,_0x3df604){var _0x4c904a={};var _0x14537a={};var _0x108f5a;var _0x3ed02a;return db[_0x15cd('0x27')][_0x15cd('0x40')]({'where':{'id':_0x34150f['params']['id']}})[_0x15cd('0x1c')](handleEntityNotFound(_0x3df604,null))['then'](function(_0x4e3b4b){if(_0x4e3b4b){_0x108f5a=_0x4e3b4b;_0x14537a[_0x15cd('0x32')]=_[_0x15cd('0x2f')](db['User'][_0x15cd('0x24')]);_0x14537a['query']=_[_0x15cd('0x2f')](_0x34150f[_0x15cd('0x29')]);_0x14537a[_0x15cd('0x30')]=_[_0x15cd('0x31')](_0x14537a[_0x15cd('0x32')],_0x14537a[_0x15cd('0x29')]);_0x4c904a[_0x15cd('0x33')]=_[_0x15cd('0x31')](_0x14537a[_0x15cd('0x32')],qs[_0x15cd('0x34')](_0x34150f[_0x15cd('0x29')][_0x15cd('0x34')]));_0x4c904a['attributes']=_0x4c904a[_0x15cd('0x33')][_0x15cd('0x55')]?_0x4c904a[_0x15cd('0x33')]:_0x14537a[_0x15cd('0x32')];_0x4c904a[_0x15cd('0x44')]=qs[_0x15cd('0x45')](_0x34150f[_0x15cd('0x29')][_0x15cd('0x45')]);_0x4c904a[_0x15cd('0x46')]=qs[_0x15cd('0x30')](_[_0x15cd('0x56')](_0x34150f[_0x15cd('0x29')],_0x14537a['filters']));if(_0x34150f[_0x15cd('0x29')][_0x15cd('0x48')]){_0x4c904a['where']=_[_0x15cd('0x36')](_0x4c904a[_0x15cd('0x46')],{'$or':_[_0x15cd('0x4f')](_0x4c904a[_0x15cd('0x33')],function(_0x3b1c){var _0x47f008={};_0x47f008[_0x3b1c]={'$like':'%'+_0x34150f[_0x15cd('0x29')][_0x15cd('0x48')]+'%'};return _0x47f008;})});}_0x4c904a=_[_0x15cd('0x36')]({},_0x4c904a,_0x34150f[_0x15cd('0x49')]);return _0x108f5a[_0x15cd('0x7d')](_0x4c904a);}})['then'](function(_0x53996d){if(_0x53996d){_0x3ed02a=_0x53996d[_0x15cd('0x55')];if(!_0x34150f[_0x15cd('0x29')]['hasOwnProperty'](_0x15cd('0x43'))){_0x4c904a[_0x15cd('0x15')]=qs[_0x15cd('0x15')](_0x34150f['query']['limit']);_0x4c904a[_0x15cd('0x17')]=qs[_0x15cd('0x17')](_0x34150f[_0x15cd('0x29')][_0x15cd('0x17')]);}return _0x108f5a[_0x15cd('0x7d')](_0x4c904a);}})[_0x15cd('0x1c')](function(_0x19e011){if(_0x19e011){return _0x19e011?{'count':_0x3ed02a,'rows':_0x19e011}:null;}})[_0x15cd('0x1c')](respondWithResult(_0x3df604,null))[_0x15cd('0x2c')](handleError(_0x3df604,null));}; \ No newline at end of file +var _0x135b=['fieldName','type','key','getOptions','where','include','findAll','rows','catch','show','params','model','keys','query','filters','intersection','attributes','fields','length','includeAll','merge','options','find','create','body','user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','hasOwnProperty','limit','order','sort','pick','filter','User','findAndCountAll','UserId','mailPause','updatedAt','createdAt','%s/%s','SIP','getTeams','nolimit','ids','Team','Agents','online','interface','flatMap','sequelize','transaction','addTeams','each','findOrCreate','forEach','emit','userMailQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','SELECT','every','TeamId','all','union','value','isEmpty','removeAgents','userMailQueue:remove','addAgents','spread','isArray','getAgents','bluebird','util','lodash','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','localhost','./mailQueue.socket','register','sendStatus','end','status','json','offset','undefined','count','set','Content-Range','then','get','MailQueues','UserProfileResource','destroy','error','name','index','map','MailQueue','rawAttributes'];(function(_0x22ed4b,_0x20609c){var _0x4e9cf6=function(_0x3a2de1){while(--_0x3a2de1){_0x22ed4b['push'](_0x22ed4b['shift']());}};_0x4e9cf6(++_0x20609c);}(_0x135b,0xd1));var _0xb135=function(_0x5ad794,_0x330eb1){_0x5ad794=_0x5ad794-0x0;var _0x58d45e=_0x135b[_0x5ad794];return _0x58d45e;};'use strict';var BPromise=require(_0xb135('0x0'));var util=require(_0xb135('0x1'));var _=require(_0xb135('0x2'));var squel=require('squel');var Redis=require('ioredis');var qs=require(_0xb135('0x3'));var logger=require(_0xb135('0x4'))(_0xb135('0x5'));var config=require('../../config/environment');var db=require(_0xb135('0x6'))['db'];config['redis']=_['defaults'](config[_0xb135('0x7')],{'host':_0xb135('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb135('0x7')]));require(_0xb135('0x9'))[_0xb135('0xa')](socket);function respondWithStatusCode(_0x200c70,_0x5ca96f){_0x5ca96f=_0x5ca96f||0xcc;return function(_0x1bedf6){if(_0x1bedf6){return _0x200c70[_0xb135('0xb')](_0x5ca96f);}return _0x200c70['status'](_0x5ca96f)[_0xb135('0xc')]();};}function respondWithResult(_0x1d4d7c,_0x1f24e4){_0x1f24e4=_0x1f24e4||0xc8;return function(_0x6457e6){if(_0x6457e6){return _0x1d4d7c[_0xb135('0xd')](_0x1f24e4)[_0xb135('0xe')](_0x6457e6);}};}function respondWithFilteredResult(_0x3e9f62,_0xdd4480){return function(_0x52ddf0){if(_0x52ddf0){var _0x47b95a=typeof _0xdd4480[_0xb135('0xf')]==='undefined'&&typeof _0xdd4480['limit']===_0xb135('0x10');var _0x308b73=_0x52ddf0[_0xb135('0x11')];var _0x31d2e3=_0x47b95a?0x0:_0xdd4480[_0xb135('0xf')];var _0x990990=_0x47b95a?_0x52ddf0[_0xb135('0x11')]:_0xdd4480[_0xb135('0xf')]+_0xdd4480['limit'];var _0x38032d;if(_0x990990>=_0x308b73){_0x990990=_0x308b73;_0x38032d=0xc8;}else{_0x38032d=0xce;}_0x3e9f62[_0xb135('0xd')](_0x38032d);return _0x3e9f62[_0xb135('0x12')](_0xb135('0x13'),_0x31d2e3+'-'+_0x990990+'/'+_0x308b73)[_0xb135('0xe')](_0x52ddf0);}return null;};}function saveUpdates(_0x45a31f){return function(_0x52ec8f){if(_0x52ec8f){return _0x52ec8f['update'](_0x45a31f)[_0xb135('0x14')](function(_0x107188){return _0x107188;});}return null;};}function removeEntity(_0x1e22bc){return function(_0x478b19){if(_0x478b19){return _0x478b19['destroy']()['then'](function(){var _0xe721ba=_0x478b19[_0xb135('0x15')]({'plain':!![]});var _0x3e3a9c=_0xb135('0x16');return db[_0xb135('0x17')][_0xb135('0x18')]({'where':{'type':_0x3e3a9c,'resourceId':_0xe721ba['id']}})[_0xb135('0x14')](function(){return _0x478b19;});})[_0xb135('0x14')](function(){_0x1e22bc['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1041cc){return function(_0x5c4bfa){if(!_0x5c4bfa){_0x1041cc['sendStatus'](0x194);}return _0x5c4bfa;};}function handleError(_0x30d209,_0x9c547){_0x9c547=_0x9c547||0x1f4;return function(_0x3ef473){logger[_0xb135('0x19')](_0x3ef473['stack']);if(_0x3ef473[_0xb135('0x1a')]){delete _0x3ef473[_0xb135('0x1a')];}_0x30d209[_0xb135('0xd')](_0x9c547)['send'](_0x3ef473);};}exports[_0xb135('0x1b')]=function(_0x4e6ec3,_0x28a9c7){var _0x4acec6={};var _0x2930b7={'count':0x0,'rows':[]};var _0x27941b=_[_0xb135('0x1c')](db[_0xb135('0x1d')][_0xb135('0x1e')],function(_0x4973b7){return{'name':_0x4973b7[_0xb135('0x1f')],'type':_0x4973b7[_0xb135('0x20')][_0xb135('0x21')]};});_0x4acec6=qs[_0xb135('0x22')](_0x27941b,_0x4e6ec3);var _0x4d3343={'where':_0x4acec6[_0xb135('0x23')]};return db[_0xb135('0x1d')][_0xb135('0x11')](_0x4d3343)[_0xb135('0x14')](function(_0x5145d1){_0x2930b7[_0xb135('0x11')]=_0x5145d1;_0x4acec6[_0xb135('0x24')]=qs[_0xb135('0x24')](_0x4e6ec3['query']);return db[_0xb135('0x1d')][_0xb135('0x25')](_0x4acec6);})[_0xb135('0x14')](function(_0x2a5a7a){_0x2930b7[_0xb135('0x26')]=_0x2a5a7a;return _0x2930b7;})[_0xb135('0x14')](respondWithFilteredResult(_0x28a9c7,_0x4acec6))[_0xb135('0x27')](handleError(_0x28a9c7,null));};exports[_0xb135('0x28')]=function(_0x81ece9,_0x1b9fd7){var _0x36b614={'raw':!![],'where':{'id':_0x81ece9[_0xb135('0x29')]['id']}},_0x252d09={};_0x252d09[_0xb135('0x2a')]=_[_0xb135('0x2b')](db[_0xb135('0x1d')][_0xb135('0x1e')]);_0x252d09[_0xb135('0x2c')]=_[_0xb135('0x2b')](_0x81ece9[_0xb135('0x2c')]);_0x252d09[_0xb135('0x2d')]=_[_0xb135('0x2e')](_0x252d09[_0xb135('0x2a')],_0x252d09['query']);_0x36b614[_0xb135('0x2f')]=_['intersection'](_0x252d09[_0xb135('0x2a')],qs[_0xb135('0x30')](_0x81ece9[_0xb135('0x2c')]['fields']));_0x36b614[_0xb135('0x2f')]=_0x36b614['attributes'][_0xb135('0x31')]?_0x36b614[_0xb135('0x2f')]:_0x252d09[_0xb135('0x2a')];if(_0x81ece9[_0xb135('0x2c')][_0xb135('0x32')]){_0x36b614[_0xb135('0x24')]=[{'all':!![]}];}_0x36b614=_[_0xb135('0x33')]({},_0x36b614,_0x81ece9[_0xb135('0x34')]);return db[_0xb135('0x1d')][_0xb135('0x35')](_0x36b614)[_0xb135('0x14')](handleEntityNotFound(_0x1b9fd7,null))[_0xb135('0x14')](respondWithResult(_0x1b9fd7,null))[_0xb135('0x27')](handleError(_0x1b9fd7,null));};exports[_0xb135('0x36')]=function(_0x32361b,_0xb3eb1f){return db[_0xb135('0x1d')][_0xb135('0x36')](_0x32361b[_0xb135('0x37')],{})['then'](function(_0x39a7c8){var _0x49d47e=_0x32361b[_0xb135('0x38')][_0xb135('0x15')]({'plain':!![]});if(!_0x49d47e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x49d47e[_0xb135('0x39')]===_0xb135('0x38')){var _0x15a8c5=_0x39a7c8[_0xb135('0x15')]({'plain':!![]});var _0x2b83b8='MailQueues';return db[_0xb135('0x3a')]['find']({'where':{'name':_0x2b83b8,'userProfileId':_0x49d47e['userProfileId']},'raw':!![]})[_0xb135('0x14')](function(_0x4e0a34){if(_0x4e0a34&&_0x4e0a34[_0xb135('0x3b')]===0x0){return db[_0xb135('0x17')][_0xb135('0x36')]({'name':_0x15a8c5[_0xb135('0x1a')],'resourceId':_0x15a8c5['id'],'type':_0x4e0a34[_0xb135('0x1a')],'sectionId':_0x4e0a34['id']},{})[_0xb135('0x14')](function(){return _0x39a7c8;});}else{return _0x39a7c8;}})[_0xb135('0x27')](function(_0x4fbbf9){logger['error'](_0xb135('0x3c'),_0x4fbbf9);throw _0x4fbbf9;});}return _0x39a7c8;})['then'](respondWithResult(_0xb3eb1f,0xc9))['catch'](handleError(_0xb3eb1f,null));};exports['update']=function(_0x6b96ce,_0x4f7e47){if(_0x6b96ce['body']['id']){delete _0x6b96ce[_0xb135('0x37')]['id'];}return db['MailQueue']['find']({'where':{'id':_0x6b96ce[_0xb135('0x29')]['id']}})[_0xb135('0x14')](handleEntityNotFound(_0x4f7e47,null))['then'](saveUpdates(_0x6b96ce[_0xb135('0x37')],null))[_0xb135('0x14')](respondWithResult(_0x4f7e47,null))[_0xb135('0x27')](handleError(_0x4f7e47,null));};exports[_0xb135('0x18')]=function(_0x4a3c0f,_0x4f182b){return db[_0xb135('0x1d')]['find']({'where':{'id':_0x4a3c0f[_0xb135('0x29')]['id']}})[_0xb135('0x14')](handleEntityNotFound(_0x4f182b,null))['then'](removeEntity(_0x4f182b,null))[_0xb135('0x27')](handleError(_0x4f182b,null));};exports[_0xb135('0x3d')]=function(_0xdb6293,_0x26d793){return db[_0xb135('0x1d')][_0xb135('0x3d')]()[_0xb135('0x14')](respondWithResult(_0x26d793,null))[_0xb135('0x27')](handleError(_0x26d793,null));};exports[_0xb135('0x3e')]=function(_0x32981b,_0x1aafda){var _0x2cfad5={'raw':!![],'where':{}},_0x2be6a6={},_0x3f91bd;return db['MailQueue'][_0xb135('0x3f')]({'where':{'id':_0x32981b[_0xb135('0x29')]['id']}})['then'](handleEntityNotFound(_0x1aafda,null))[_0xb135('0x14')](function(_0x4478ac){if(_0x4478ac){_0x3f91bd=_0x4478ac[_0xb135('0x15')]({'plain':!![]});_0x2be6a6[_0xb135('0x2a')]=_[_0xb135('0x2b')](db['UserMailQueue'][_0xb135('0x1e')]);_0x2be6a6[_0xb135('0x2c')]=_[_0xb135('0x2b')](_0x32981b[_0xb135('0x2c')]);_0x2be6a6[_0xb135('0x2d')]=_[_0xb135('0x2e')](_0x2be6a6['model'],_0x2be6a6[_0xb135('0x2c')]);_0x2cfad5[_0xb135('0x2f')]=_[_0xb135('0x2e')](_0x2be6a6[_0xb135('0x2a')],qs['fields'](_0x32981b[_0xb135('0x2c')][_0xb135('0x30')]));_0x2cfad5['attributes']=_0x2cfad5[_0xb135('0x2f')]['length']?_0x2cfad5[_0xb135('0x2f')]:_0x2be6a6['model'];if(!_0x32981b[_0xb135('0x2c')][_0xb135('0x40')]('nolimit')){_0x2cfad5[_0xb135('0x41')]=qs[_0xb135('0x41')](_0x32981b[_0xb135('0x2c')][_0xb135('0x41')]);_0x2cfad5['offset']=qs[_0xb135('0xf')](_0x32981b[_0xb135('0x2c')][_0xb135('0xf')]);}_0x2cfad5[_0xb135('0x42')]=qs[_0xb135('0x43')](_0x32981b[_0xb135('0x2c')]['sort']);_0x2cfad5['where']=qs[_0xb135('0x2d')](_[_0xb135('0x44')](_0x32981b[_0xb135('0x2c')],_0x2be6a6[_0xb135('0x2d')]));_0x2cfad5[_0xb135('0x23')]['MailQueueId']=_0x4478ac['id'];if(_0x32981b[_0xb135('0x2c')]['filter']){_0x2cfad5[_0xb135('0x23')]=_[_0xb135('0x33')](_0x2cfad5[_0xb135('0x23')],{'$or':_[_0xb135('0x1c')](_0x2cfad5[_0xb135('0x2f')],function(_0xa842a5){var _0x53cadb={};_0x53cadb[_0xa842a5]={'$like':'%'+_0x32981b['query'][_0xb135('0x45')]+'%'};return _0x53cadb;})});}_0x2cfad5=_[_0xb135('0x33')]({},_0x2cfad5,_0x32981b[_0xb135('0x34')]);return db['UserMailQueue'][_0xb135('0x25')](_0x2cfad5);}})[_0xb135('0x14')](function(_0x4186b1){if(_0x4186b1){return db[_0xb135('0x46')][_0xb135('0x47')]({'where':{'id':_[_0xb135('0x1c')](_0x4186b1,_0xb135('0x48')),'role':'agent'},'attributes':['id',_0xb135('0x1a'),_0xb135('0x49'),_0xb135('0x4a'),_0xb135('0x4b')]});}})['then'](function(_0x456886){if(_0x456886){return{'count':_0x456886[_0xb135('0x11')],'rows':_[_0xb135('0x1c')](_0x456886[_0xb135('0x26')],function(_0x3d5875){return{'membername':_0x3d5875[_0xb135('0x1a')],'UserId':_0x3d5875['id'],'queue_name':_0x3f91bd[_0xb135('0x1a')],'MailQueueId':_0x3f91bd['id'],'interface':util['format'](_0xb135('0x4c'),_0xb135('0x4d'),_0x3d5875['name']),'penalty':0x0,'paused':_0x3d5875[_0xb135('0x49')],'createdAt':_0x3d5875['createdAt'],'updatedAt':_0x3d5875[_0xb135('0x4a')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xb135('0x14')](respondWithFilteredResult(_0x1aafda,_0x2cfad5))[_0xb135('0x27')](handleError(_0x1aafda,null));};exports[_0xb135('0x4e')]=function(_0x4dcad1,_0xa2b714){var _0x4e0a60={};var _0x219078={};var _0xca4cc5;var _0x4b3b93;return db[_0xb135('0x1d')][_0xb135('0x3f')]({'where':{'id':_0x4dcad1[_0xb135('0x29')]['id']}})[_0xb135('0x14')](handleEntityNotFound(_0xa2b714,null))['then'](function(_0x32c818){if(_0x32c818){_0xca4cc5=_0x32c818;_0x219078['model']=_[_0xb135('0x2b')](db['Team'][_0xb135('0x1e')]);_0x219078[_0xb135('0x2c')]=_[_0xb135('0x2b')](_0x4dcad1['query']);_0x219078[_0xb135('0x2d')]=_[_0xb135('0x2e')](_0x219078[_0xb135('0x2a')],_0x219078[_0xb135('0x2c')]);_0x4e0a60[_0xb135('0x2f')]=_[_0xb135('0x2e')](_0x219078[_0xb135('0x2a')],qs[_0xb135('0x30')](_0x4dcad1[_0xb135('0x2c')][_0xb135('0x30')]));_0x4e0a60[_0xb135('0x2f')]=_0x4e0a60[_0xb135('0x2f')][_0xb135('0x31')]?_0x4e0a60['attributes']:_0x219078[_0xb135('0x2a')];_0x4e0a60['order']=qs['sort'](_0x4dcad1[_0xb135('0x2c')][_0xb135('0x43')]);_0x4e0a60[_0xb135('0x23')]=qs[_0xb135('0x2d')](_[_0xb135('0x44')](_0x4dcad1[_0xb135('0x2c')],_0x219078[_0xb135('0x2d')]));if(_0x4dcad1['query'][_0xb135('0x45')]){_0x4e0a60['where']=_[_0xb135('0x33')](_0x4e0a60[_0xb135('0x23')],{'$or':_[_0xb135('0x1c')](_0x4e0a60[_0xb135('0x2f')],function(_0x546527){var _0x34f9b6={};_0x34f9b6[_0x546527]={'$like':'%'+_0x4dcad1[_0xb135('0x2c')]['filter']+'%'};return _0x34f9b6;})});}_0x4e0a60=_['merge']({},_0x4e0a60,_0x4dcad1[_0xb135('0x34')]);return _0xca4cc5[_0xb135('0x4e')](_0x4e0a60);}})[_0xb135('0x14')](function(_0x55856f){if(_0x55856f){_0x4b3b93=_0x55856f[_0xb135('0x31')];if(!_0x4dcad1[_0xb135('0x2c')]['hasOwnProperty'](_0xb135('0x4f'))){_0x4e0a60['limit']=qs[_0xb135('0x41')](_0x4dcad1[_0xb135('0x2c')][_0xb135('0x41')]);_0x4e0a60['offset']=qs[_0xb135('0xf')](_0x4dcad1[_0xb135('0x2c')][_0xb135('0xf')]);}return _0xca4cc5[_0xb135('0x4e')](_0x4e0a60);}})['then'](function(_0x56bd68){if(_0x56bd68){return _0x56bd68?{'count':_0x4b3b93,'rows':_0x56bd68}:null;}})[_0xb135('0x14')](respondWithResult(_0xa2b714,null))['catch'](handleError(_0xa2b714,null));};exports['addTeams']=function(_0x10f2c2,_0x40821d){var _0x5a45a4=_0x10f2c2[_0xb135('0x37')][_0xb135('0x50')];return db[_0xb135('0x51')][_0xb135('0x25')]({'where':{'id':_0x5a45a4},'attributes':['id'],'include':[{'model':db[_0xb135('0x46')],'as':_0xb135('0x52'),'attributes':['id',_0xb135('0x1a'),_0xb135('0x53'),'voicePause',_0xb135('0x54')],'raw':!![]}]})[_0xb135('0x14')](function(_0x494e45){if(_0x494e45){var _0x211652=_[_0xb135('0x55')](_0x494e45,function(_0x3f170b){var _0x4ff389=_0x3f170b[_0xb135('0x15')]({'plain':!![]});return _0x4ff389[_0xb135('0x52')];});return db[_0xb135('0x1d')][_0xb135('0x35')]({'where':{'id':_0x10f2c2[_0xb135('0x29')]['id']}})['then'](function(_0x1e9c53){return db[_0xb135('0x56')][_0xb135('0x57')](function(_0x221530){return _0x1e9c53[_0xb135('0x58')](_0x5a45a4,{'transaction':_0x221530})[_0xb135('0x14')](function(){return BPromise[_0xb135('0x59')](_0x211652,function(_0xf09763){return db['UserMailQueue'][_0xb135('0x5a')]({'where':{'UserId':_0xf09763['id'],'MailQueueId':_0x10f2c2[_0xb135('0x29')]['id']},'transaction':_0x221530});});})[_0xb135('0x14')](function(){_0x211652[_0xb135('0x5b')](function(_0x510cf6){socket[_0xb135('0x5c')](_0xb135('0x5d'),{'UserId':_0x510cf6['id'],'MailQueueId':_0x1e9c53['id']});});});});});}})[_0xb135('0x14')](respondWithStatusCode(_0x40821d,null))[_0xb135('0x27')](handleError(_0x40821d,null));};exports[_0xb135('0x5e')]=function(_0x5c3626,_0x337d11){return db['Team']['findAll']({'where':{'id':_0x5c3626['query'][_0xb135('0x50')]},'attributes':['id'],'include':[{'model':db[_0xb135('0x46')],'as':_0xb135('0x52'),'attributes':['id'],'raw':!![]}]})[_0xb135('0x14')](handleEntityNotFound(_0x337d11,null))[_0xb135('0x14')](function(_0x58462c){var _0x2dbb6f=_[_0xb135('0x1c')](_0x58462c,'id');var _0x57803c=[];var _0x22ec12=[];var _0x1688a8=squel[_0xb135('0x5f')]();_0x1688a8[_0xb135('0x60')](_0xb135('0x61'))[_0xb135('0x62')](_0xb135('0x63'),'tq')[_0xb135('0x64')](_0xb135('0x65'),'ut',_0xb135('0x66'))['where'](_0xb135('0x67'),_0x5c3626[_0xb135('0x29')]['id']);for(var _0x57bc92=0x0;_0x57bc92<_0x58462c[_0xb135('0x31')];_0x57bc92+=0x1){let _0x4400dd=_0x58462c[_0x57bc92];for(var _0xe5946=0x0;_0xe5946<_0x4400dd['Agents'][_0xb135('0x31')];_0xe5946+=0x1){let _0x420317=_0x4400dd['Agents'][_0xe5946];var _0x54a384=_0x1688a8[_0xb135('0x68')]();_0x54a384[_0xb135('0x23')](_0xb135('0x69'),_0x420317['id']);_0x22ec12['push'](db[_0xb135('0x56')]['query'](_0x54a384[_0xb135('0x6a')](),{'type':db[_0xb135('0x56')]['QueryTypes'][_0xb135('0x6b')]})[_0xb135('0x14')](function(_0x170abc){if(_0x170abc[_0xb135('0x31')]===0x1){return _0x420317['id'];}else{var _0x102d9b=_[_0xb135('0x6c')](_[_0xb135('0x1c')](_0x170abc,_0xb135('0x6d')),function(_0xd6feba){return _['includes'](_0x2dbb6f,_0xd6feba);});if(_0x102d9b){return _0x420317['id'];}}}));}}return BPromise[_0xb135('0x6e')](_0x22ec12)['then'](function(_0x4d19cc){_0x57803c=_(_0x57803c)[_0xb135('0x6f')](_0x4d19cc)['compact']()[_0xb135('0x70')]();return db[_0xb135('0x1d')][_0xb135('0x35')]({'where':{'id':_0x5c3626['params']['id']}})[_0xb135('0x14')](function(_0x9160fa){return db['sequelize'][_0xb135('0x57')](function(_0x8b57a1){return _0x9160fa[_0xb135('0x5e')](_0x5c3626[_0xb135('0x2c')]['ids'],{'transaction':_0x8b57a1})[_0xb135('0x14')](function(){if(!_[_0xb135('0x71')](_0x57803c)){return _0x9160fa[_0xb135('0x72')](_0x57803c,{'transaction':_0x8b57a1});}})[_0xb135('0x14')](function(){_0x57803c['forEach'](function(_0x119f7e){socket[_0xb135('0x5c')](_0xb135('0x73'),{'UserId':_0x119f7e,'MailQueueId':_0x9160fa['id']});});});});});});})[_0xb135('0x14')](respondWithStatusCode(_0x337d11,null))['catch'](handleError(_0x337d11,null));};exports[_0xb135('0x74')]=function(_0x4c5e51,_0x412efe){return db['MailQueue'][_0xb135('0x35')]({'where':{'id':_0x4c5e51[_0xb135('0x29')]['id']}})[_0xb135('0x14')](handleEntityNotFound(_0x412efe,null))[_0xb135('0x14')](function(_0x595111){if(_0x595111){return _0x595111[_0xb135('0x74')](_0x4c5e51['body'][_0xb135('0x50')],_['omit'](_0x4c5e51['body'],[_0xb135('0x50'),'id'])||{})[_0xb135('0x75')](function(_0x130bbe){for(var _0x3a8d99=0x0;_0x3a8d99<_0x4c5e51[_0xb135('0x37')]['ids'][_0xb135('0x31')];_0x3a8d99+=0x1){socket[_0xb135('0x5c')](_0xb135('0x5d'),{'UserId':Number(_0x4c5e51[_0xb135('0x37')][_0xb135('0x50')][_0x3a8d99]),'MailQueueId':Number(_0x4c5e51[_0xb135('0x29')]['id'])});}return _0x130bbe;});}})[_0xb135('0x14')](respondWithResult(_0x412efe,null))[_0xb135('0x27')](handleError(_0x412efe,null));};exports['removeAgents']=function(_0x361824,_0x4ee89c){return db[_0xb135('0x1d')]['find']({'where':{'id':_0x361824[_0xb135('0x29')]['id']}})[_0xb135('0x14')](handleEntityNotFound(_0x4ee89c,null))[_0xb135('0x14')](function(_0x5c7a85){if(_0x5c7a85){return _0x5c7a85[_0xb135('0x72')](_0x361824[_0xb135('0x2c')]['ids'])['then'](function(){if(_[_0xb135('0x76')](_0x361824[_0xb135('0x2c')][_0xb135('0x50')])){for(var _0x270cff=0x0;_0x270cff<_0x361824[_0xb135('0x2c')][_0xb135('0x50')][_0xb135('0x31')];_0x270cff+=0x1){socket[_0xb135('0x5c')](_0xb135('0x73'),{'UserId':Number(_0x361824[_0xb135('0x2c')][_0xb135('0x50')][_0x270cff]),'MailQueueId':Number(_0x361824['params']['id'])});}}else{socket[_0xb135('0x5c')]('userMailQueue:remove',{'UserId':Number(_0x361824['query'][_0xb135('0x50')]),'MailQueueId':Number(_0x361824['params']['id'])});}});}})[_0xb135('0x14')](respondWithStatusCode(_0x4ee89c,null))[_0xb135('0x27')](handleError(_0x4ee89c,null));};exports[_0xb135('0x77')]=function(_0x12b43e,_0x448bf7){var _0x11283a={};var _0x57840a={};var _0x15a369;var _0x2ca6f1;return db['MailQueue']['findOne']({'where':{'id':_0x12b43e['params']['id']}})[_0xb135('0x14')](handleEntityNotFound(_0x448bf7,null))['then'](function(_0x2b48b0){if(_0x2b48b0){_0x15a369=_0x2b48b0;_0x57840a['model']=_[_0xb135('0x2b')](db[_0xb135('0x46')][_0xb135('0x1e')]);_0x57840a[_0xb135('0x2c')]=_[_0xb135('0x2b')](_0x12b43e[_0xb135('0x2c')]);_0x57840a[_0xb135('0x2d')]=_['intersection'](_0x57840a[_0xb135('0x2a')],_0x57840a[_0xb135('0x2c')]);_0x11283a[_0xb135('0x2f')]=_['intersection'](_0x57840a['model'],qs[_0xb135('0x30')](_0x12b43e[_0xb135('0x2c')][_0xb135('0x30')]));_0x11283a[_0xb135('0x2f')]=_0x11283a[_0xb135('0x2f')][_0xb135('0x31')]?_0x11283a[_0xb135('0x2f')]:_0x57840a[_0xb135('0x2a')];_0x11283a[_0xb135('0x42')]=qs['sort'](_0x12b43e[_0xb135('0x2c')][_0xb135('0x43')]);_0x11283a[_0xb135('0x23')]=qs[_0xb135('0x2d')](_[_0xb135('0x44')](_0x12b43e['query'],_0x57840a[_0xb135('0x2d')]));if(_0x12b43e[_0xb135('0x2c')]['filter']){_0x11283a[_0xb135('0x23')]=_['merge'](_0x11283a[_0xb135('0x23')],{'$or':_[_0xb135('0x1c')](_0x11283a['attributes'],function(_0x32a2ec){var _0x22d13e={};_0x22d13e[_0x32a2ec]={'$like':'%'+_0x12b43e[_0xb135('0x2c')][_0xb135('0x45')]+'%'};return _0x22d13e;})});}_0x11283a=_[_0xb135('0x33')]({},_0x11283a,_0x12b43e[_0xb135('0x34')]);return _0x15a369['getAgents'](_0x11283a);}})['then'](function(_0x4f56b6){if(_0x4f56b6){_0x2ca6f1=_0x4f56b6['length'];if(!_0x12b43e[_0xb135('0x2c')]['hasOwnProperty']('nolimit')){_0x11283a['limit']=qs[_0xb135('0x41')](_0x12b43e[_0xb135('0x2c')][_0xb135('0x41')]);_0x11283a[_0xb135('0xf')]=qs[_0xb135('0xf')](_0x12b43e['query'][_0xb135('0xf')]);}return _0x15a369['getAgents'](_0x11283a);}})[_0xb135('0x14')](function(_0x3b1776){if(_0x3b1776){return _0x3b1776?{'count':_0x2ca6f1,'rows':_0x3b1776}:null;}})['then'](respondWithResult(_0x448bf7,null))[_0xb135('0x27')](handleError(_0x448bf7,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index 6f88780..b1117d6 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 _0xf9e4=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailQueue','save','update'];(function(_0x47af83,_0x23397e){var _0x157044=function(_0x50c958){while(--_0x50c958){_0x47af83['push'](_0x47af83['shift']());}};_0x157044(++_0x23397e);}(_0xf9e4,0x1c7));var _0x4f9e=function(_0xfe772d,_0x1a070e){_0xfe772d=_0xfe772d-0x0;var _0x3222ba=_0xf9e4[_0xfe772d];return _0x3222ba;};'use strict';var EventEmitter=require(_0x4f9e('0x0'));var MailQueue=require(_0x4f9e('0x1'))['db'][_0x4f9e('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4f9e('0x3'),'afterUpdate':_0x4f9e('0x4'),'afterDestroy':_0x4f9e('0x5')};function emitEvent(_0x3d85f6){return function(_0x421c7c,_0x301956,_0x3b9c70){MailQueueEvents[_0x4f9e('0x6')](_0x3d85f6+':'+_0x421c7c['id'],_0x421c7c);MailQueueEvents['emit'](_0x3d85f6,_0x421c7c);_0x3b9c70(null);};}for(var e in events){if(events[_0x4f9e('0x7')](e)){var event=events[e];MailQueue[_0x4f9e('0x8')](e,emitEvent(event));}}module[_0x4f9e('0x9')]=MailQueueEvents; \ No newline at end of file +var _0x4e59=['emit','exports','events','../../mysqldb','MailQueue','setMaxListeners','save','update','remove'];(function(_0x5654df,_0x395bb2){var _0x7e5ba4=function(_0x38e76a){while(--_0x38e76a){_0x5654df['push'](_0x5654df['shift']());}};_0x7e5ba4(++_0x395bb2);}(_0x4e59,0xb6));var _0x94e5=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x4e59[_0x122ef9];return _0x42fba0;};'use strict';var EventEmitter=require(_0x94e5('0x0'));var MailQueue=require(_0x94e5('0x1'))['db'][_0x94e5('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x94e5('0x3')](0x0);var events={'afterCreate':_0x94e5('0x4'),'afterUpdate':_0x94e5('0x5'),'afterDestroy':_0x94e5('0x6')};function emitEvent(_0x4dbb7d){return function(_0x4fc251,_0x20a41f,_0x288faf){MailQueueEvents['emit'](_0x4dbb7d+':'+_0x4fc251['id'],_0x4fc251);MailQueueEvents[_0x94e5('0x7')](_0x4dbb7d,_0x4fc251);_0x288faf(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue['hook'](e,emitEvent(event));}}module[_0x94e5('0x8')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index d005dbc..d7d1ff0 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 _0xbb34=['./mailQueue.attributes','MailQueue','mail_queues','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xbb34,0xea));var _0x4bb3=function(_0x2d595f,_0xdfdb46){_0x2d595f=_0x2d595f-0x0;var _0x1e26a2=_0xbb34[_0x2d595f];return _0x1e26a2;};'use strict';var _=require(_0x4bb3('0x0'));var util=require(_0x4bb3('0x1'));var logger=require('../../config/logger')(_0x4bb3('0x2'));var moment=require(_0x4bb3('0x3'));var BPromise=require('bluebird');var rp=require(_0x4bb3('0x4'));var fs=require('fs');var path=require(_0x4bb3('0x5'));var rimraf=require(_0x4bb3('0x6'));var config=require(_0x4bb3('0x7'));var attributes=require(_0x4bb3('0x8'));module['exports']=function(_0x4d170f,_0x4ca2aa){return _0x4d170f['define'](_0x4bb3('0x9'),attributes,{'tableName':_0x4bb3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xef0b=['moment','request-promise','rimraf','../../config/environment','./mailQueue.attributes','exports','mail_queues','lodash','../../config/logger','api'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xef0b,0x1c9));var _0xbef0=function(_0x2d2185,_0x23db5d){_0x2d2185=_0x2d2185-0x0;var _0x17fa34=_0xef0b[_0x2d2185];return _0x17fa34;};'use strict';var _=require(_0xbef0('0x0'));var util=require('util');var logger=require(_0xbef0('0x1'))(_0xbef0('0x2'));var moment=require(_0xbef0('0x3'));var BPromise=require('bluebird');var rp=require(_0xbef0('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbef0('0x5'));var config=require(_0xbef0('0x6'));var attributes=require(_0xbef0('0x7'));module[_0xbef0('0x8')]=function(_0x1d8635,_0x27fb25){return _0x1d8635['define']('MailQueue',attributes,{'tableName':_0xbef0('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.rpc.js b/server/api/mailQueue/mailQueue.rpc.js index b4e7a35..2c64c4b 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 _0x2bce=['include','attributes','model','stringify','find','ShowMailQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','request','then','info','MailQueue,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','GetMailQueue','MailQueue','options','raw','limit','map'];(function(_0x3b702c,_0x11cf73){var _0x4aa5c4=function(_0x1e48ed){while(--_0x1e48ed){_0x3b702c['push'](_0x3b702c['shift']());}};_0x4aa5c4(++_0x11cf73);}(_0x2bce,0xd3));var _0xe2bc=function(_0xd1b4d7,_0x28b2c1){_0xd1b4d7=_0xd1b4d7-0x0;var _0x3002ec=_0x2bce[_0xd1b4d7];return _0x3002ec;};'use strict';var _=require(_0xe2bc('0x0'));var util=require(_0xe2bc('0x1'));var moment=require(_0xe2bc('0x2'));var BPromise=require(_0xe2bc('0x3'));var rs=require(_0xe2bc('0x4'));var fs=require('fs');var Redis=require(_0xe2bc('0x5'));var db=require(_0xe2bc('0x6'))['db'];var utils=require(_0xe2bc('0x7'));var logger=require('../../config/logger')(_0xe2bc('0x8'));var config=require(_0xe2bc('0x9'));var jayson=require(_0xe2bc('0xa'));var client=jayson[_0xe2bc('0xb')][_0xe2bc('0xc')]({'port':0x232a});config[_0xe2bc('0xd')]=_[_0xe2bc('0xe')](config['redis'],{'host':_0xe2bc('0xf'),'port':0x18eb});var socket=require(_0xe2bc('0x10'))(new Redis(config[_0xe2bc('0xd')]));require(_0xe2bc('0x11'))['register'](socket);function respondWithRpcPromise(_0x4a7b9a,_0x1faf81,_0x4a08c2){return new BPromise(function(_0x5972d2,_0xc399e2){return client[_0xe2bc('0x12')](_0x4a7b9a,_0x4a08c2)[_0xe2bc('0x13')](function(_0x4b6a8b){logger[_0xe2bc('0x14')](_0xe2bc('0x15'),_0x1faf81,'request\x20sent');logger[_0xe2bc('0x16')]('MailQueue,\x20%s,\x20%s,\x20%s',_0x1faf81,_0xe2bc('0x17'),JSON['stringify'](_0x4b6a8b));if(_0x4b6a8b[_0xe2bc('0x18')]){if(_0x4b6a8b[_0xe2bc('0x18')][_0xe2bc('0x19')]===0x1f4){logger[_0xe2bc('0x18')](_0xe2bc('0x15'),_0x1faf81,_0x4b6a8b[_0xe2bc('0x18')][_0xe2bc('0x1a')]);return _0xc399e2(_0x4b6a8b[_0xe2bc('0x18')]['message']);}logger[_0xe2bc('0x18')](_0xe2bc('0x15'),_0x1faf81,_0x4b6a8b[_0xe2bc('0x18')]['message']);return _0x5972d2(_0x4b6a8b[_0xe2bc('0x18')][_0xe2bc('0x1a')]);}else{logger[_0xe2bc('0x14')](_0xe2bc('0x15'),_0x1faf81,'request\x20sent');_0x5972d2(_0x4b6a8b[_0xe2bc('0x1b')][_0xe2bc('0x1a')]);}})[_0xe2bc('0x1c')](function(_0x3f87d0){logger['error']('MailQueue,\x20%s,\x20%s',_0x1faf81,_0x3f87d0);_0xc399e2(_0x3f87d0);});});}exports[_0xe2bc('0x1d')]=function(_0x5c8601){var _0x5985e6=this;return new Promise(function(_0x3f1134,_0xa7c6af){return db[_0xe2bc('0x1e')]['findAll']({'raw':_0x5c8601[_0xe2bc('0x1f')]?_0x5c8601[_0xe2bc('0x1f')][_0xe2bc('0x20')]===undefined?!![]:![]:!![],'where':_0x5c8601[_0xe2bc('0x1f')]?_0x5c8601[_0xe2bc('0x1f')]['where']||null:null,'attributes':_0x5c8601['options']?_0x5c8601[_0xe2bc('0x1f')]['attributes']||null:null,'limit':_0x5c8601[_0xe2bc('0x1f')]?_0x5c8601[_0xe2bc('0x1f')][_0xe2bc('0x21')]||null:null,'include':_0x5c8601['options']?_0x5c8601[_0xe2bc('0x1f')]['include']?_[_0xe2bc('0x22')](_0x5c8601['options'][_0xe2bc('0x23')],function(_0x347888){return{'model':db[_0x347888['model']],'as':_0x347888['as'],'attributes':_0x347888[_0xe2bc('0x24')],'include':_0x347888['include']?_['map'](_0x347888['include'],function(_0x15b3d1){return{'model':db[_0x15b3d1[_0xe2bc('0x25')]],'as':_0x15b3d1['as'],'attributes':_0x15b3d1[_0xe2bc('0x24')],'include':_0x15b3d1[_0xe2bc('0x23')]?_['map'](_0x15b3d1[_0xe2bc('0x23')],function(_0x3d8ff6){return{'model':db[_0x3d8ff6[_0xe2bc('0x25')]],'as':_0x3d8ff6['as'],'attributes':_0x3d8ff6[_0xe2bc('0x24')]};}):[]};}):[]};}):[]:[]})[_0xe2bc('0x13')](function(_0x42639f){logger['info'](_0xe2bc('0x1d'),_0x5c8601);logger['debug']('GetMailQueue',_0x5c8601,JSON[_0xe2bc('0x26')](_0x42639f));_0x3f1134(_0x42639f);})[_0xe2bc('0x1c')](function(_0x5dbaf0){logger['error']('GetMailQueue',_0x5dbaf0[_0xe2bc('0x1a')],_0x5c8601);_0xa7c6af(_0x5985e6[_0xe2bc('0x18')](0x1f4,_0x5dbaf0['message']));});});};exports['ShowMailQueue']=function(_0x3aef8f){var _0x59d0d2=this;return new Promise(function(_0x5eaf81,_0x10e793){return db[_0xe2bc('0x1e')][_0xe2bc('0x27')]({'raw':_0x3aef8f[_0xe2bc('0x1f')]?_0x3aef8f[_0xe2bc('0x1f')][_0xe2bc('0x20')]===undefined?!![]:![]:!![],'where':_0x3aef8f[_0xe2bc('0x1f')]?_0x3aef8f[_0xe2bc('0x1f')]['where']||null:null,'attributes':_0x3aef8f['options']?_0x3aef8f[_0xe2bc('0x1f')][_0xe2bc('0x24')]||null:null,'include':_0x3aef8f[_0xe2bc('0x1f')]?_0x3aef8f[_0xe2bc('0x1f')][_0xe2bc('0x23')]?_[_0xe2bc('0x22')](_0x3aef8f[_0xe2bc('0x1f')][_0xe2bc('0x23')],function(_0x4a7f97){return{'model':db[_0x4a7f97[_0xe2bc('0x25')]],'as':_0x4a7f97['as'],'attributes':_0x4a7f97[_0xe2bc('0x24')],'include':_0x4a7f97[_0xe2bc('0x23')]?_['map'](_0x4a7f97[_0xe2bc('0x23')],function(_0x133758){return{'model':db[_0x133758[_0xe2bc('0x25')]],'as':_0x133758['as'],'attributes':_0x133758['attributes'],'include':_0x133758[_0xe2bc('0x23')]?_['map'](_0x133758[_0xe2bc('0x23')],function(_0x4f22a6){return{'model':db[_0x4f22a6['model']],'as':_0x4f22a6['as'],'attributes':_0x4f22a6[_0xe2bc('0x24')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5ef3cb){logger['info'](_0xe2bc('0x28'),_0x3aef8f);logger[_0xe2bc('0x16')](_0xe2bc('0x28'),_0x3aef8f,JSON[_0xe2bc('0x26')](_0x5ef3cb));_0x5eaf81(_0x5ef3cb);})[_0xe2bc('0x1c')](function(_0x3ececa){logger[_0xe2bc('0x18')](_0xe2bc('0x28'),_0x3ececa[_0xe2bc('0x1a')],_0x3aef8f);_0x10e793(_0x59d0d2[_0xe2bc('0x18')](0x1f4,_0x3ececa[_0xe2bc('0x1a')]));});});}; \ No newline at end of file +var _0x7b19=['MailQueue','find','ShowMailQueue','lodash','moment','ioredis','../../config/logger','rpc','client','http','redis','defaults','localhost','register','request','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','GetMailQueue','findAll','options','raw','where','attributes','map','include','model'];(function(_0x5152c0,_0x318148){var _0x3d0c73=function(_0x5529e8){while(--_0x5529e8){_0x5152c0['push'](_0x5152c0['shift']());}};_0x3d0c73(++_0x318148);}(_0x7b19,0x1df));var _0x97b1=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7b19[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x97b1('0x0'));var util=require('util');var moment=require(_0x97b1('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x97b1('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x97b1('0x3'))(_0x97b1('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x97b1('0x5')][_0x97b1('0x6')]({'port':0x232a});config[_0x97b1('0x7')]=_[_0x97b1('0x8')](config[_0x97b1('0x7')],{'host':_0x97b1('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x97b1('0x7')]));require('./mailQueue.socket')[_0x97b1('0xa')](socket);function respondWithRpcPromise(_0x457f86,_0x3a7beb,_0x4f8735){return new BPromise(function(_0x431134,_0x76b612){return client[_0x97b1('0xb')](_0x457f86,_0x4f8735)[_0x97b1('0xc')](function(_0x94e716){logger[_0x97b1('0xd')](_0x97b1('0xe'),_0x3a7beb,_0x97b1('0xf'));logger[_0x97b1('0x10')]('MailQueue,\x20%s,\x20%s,\x20%s',_0x3a7beb,_0x97b1('0xf'),JSON[_0x97b1('0x11')](_0x94e716));if(_0x94e716[_0x97b1('0x12')]){if(_0x94e716[_0x97b1('0x12')][_0x97b1('0x13')]===0x1f4){logger[_0x97b1('0x12')](_0x97b1('0xe'),_0x3a7beb,_0x94e716[_0x97b1('0x12')][_0x97b1('0x14')]);return _0x76b612(_0x94e716[_0x97b1('0x12')]['message']);}logger[_0x97b1('0x12')]('MailQueue,\x20%s,\x20%s',_0x3a7beb,_0x94e716['error'][_0x97b1('0x14')]);return _0x431134(_0x94e716['error']['message']);}else{logger['info'](_0x97b1('0xe'),_0x3a7beb,_0x97b1('0xf'));_0x431134(_0x94e716['result'][_0x97b1('0x14')]);}})[_0x97b1('0x15')](function(_0x2036d5){logger['error'](_0x97b1('0xe'),_0x3a7beb,_0x2036d5);_0x76b612(_0x2036d5);});});}exports[_0x97b1('0x16')]=function(_0x17a9a5){var _0x3e6ff2=this;return new Promise(function(_0x1592d8,_0x1cb65e){return db['MailQueue'][_0x97b1('0x17')]({'raw':_0x17a9a5['options']?_0x17a9a5[_0x97b1('0x18')][_0x97b1('0x19')]===undefined?!![]:![]:!![],'where':_0x17a9a5['options']?_0x17a9a5['options'][_0x97b1('0x1a')]||null:null,'attributes':_0x17a9a5[_0x97b1('0x18')]?_0x17a9a5[_0x97b1('0x18')][_0x97b1('0x1b')]||null:null,'limit':_0x17a9a5['options']?_0x17a9a5[_0x97b1('0x18')]['limit']||null:null,'include':_0x17a9a5[_0x97b1('0x18')]?_0x17a9a5['options']['include']?_[_0x97b1('0x1c')](_0x17a9a5[_0x97b1('0x18')][_0x97b1('0x1d')],function(_0xf8257a){return{'model':db[_0xf8257a[_0x97b1('0x1e')]],'as':_0xf8257a['as'],'attributes':_0xf8257a[_0x97b1('0x1b')],'include':_0xf8257a[_0x97b1('0x1d')]?_[_0x97b1('0x1c')](_0xf8257a[_0x97b1('0x1d')],function(_0x31856a){return{'model':db[_0x31856a[_0x97b1('0x1e')]],'as':_0x31856a['as'],'attributes':_0x31856a[_0x97b1('0x1b')],'include':_0x31856a[_0x97b1('0x1d')]?_['map'](_0x31856a[_0x97b1('0x1d')],function(_0x286c52){return{'model':db[_0x286c52[_0x97b1('0x1e')]],'as':_0x286c52['as'],'attributes':_0x286c52[_0x97b1('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x97b1('0xc')](function(_0x657531){logger[_0x97b1('0xd')](_0x97b1('0x16'),_0x17a9a5);logger['debug']('GetMailQueue',_0x17a9a5,JSON[_0x97b1('0x11')](_0x657531));_0x1592d8(_0x657531);})[_0x97b1('0x15')](function(_0x340ad3){logger[_0x97b1('0x12')](_0x97b1('0x16'),_0x340ad3['message'],_0x17a9a5);_0x1cb65e(_0x3e6ff2[_0x97b1('0x12')](0x1f4,_0x340ad3[_0x97b1('0x14')]));});});};exports['ShowMailQueue']=function(_0x152fbc){var _0xa91292=this;return new Promise(function(_0x294f29,_0x5f7d7f){return db[_0x97b1('0x1f')][_0x97b1('0x20')]({'raw':_0x152fbc['options']?_0x152fbc['options'][_0x97b1('0x19')]===undefined?!![]:![]:!![],'where':_0x152fbc[_0x97b1('0x18')]?_0x152fbc[_0x97b1('0x18')][_0x97b1('0x1a')]||null:null,'attributes':_0x152fbc[_0x97b1('0x18')]?_0x152fbc['options'][_0x97b1('0x1b')]||null:null,'include':_0x152fbc[_0x97b1('0x18')]?_0x152fbc[_0x97b1('0x18')]['include']?_['map'](_0x152fbc[_0x97b1('0x18')][_0x97b1('0x1d')],function(_0x2f3f4b){return{'model':db[_0x2f3f4b[_0x97b1('0x1e')]],'as':_0x2f3f4b['as'],'attributes':_0x2f3f4b['attributes'],'include':_0x2f3f4b[_0x97b1('0x1d')]?_[_0x97b1('0x1c')](_0x2f3f4b[_0x97b1('0x1d')],function(_0x11cb7a){return{'model':db[_0x11cb7a[_0x97b1('0x1e')]],'as':_0x11cb7a['as'],'attributes':_0x11cb7a[_0x97b1('0x1b')],'include':_0x11cb7a[_0x97b1('0x1d')]?_[_0x97b1('0x1c')](_0x11cb7a['include'],function(_0x2685d4){return{'model':db[_0x2685d4[_0x97b1('0x1e')]],'as':_0x2685d4['as'],'attributes':_0x2685d4[_0x97b1('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x143d11){logger[_0x97b1('0xd')](_0x97b1('0x21'),_0x152fbc);logger[_0x97b1('0x10')](_0x97b1('0x21'),_0x152fbc,JSON['stringify'](_0x143d11));_0x294f29(_0x143d11);})[_0x97b1('0x15')](function(_0x4dd41d){logger['error'](_0x97b1('0x21'),_0x4dd41d['message'],_0x152fbc);_0x5f7d7f(_0xa91292[_0x97b1('0x12')](0x1f4,_0x4dd41d['message']));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index 98f2926..d0832a2 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 _0xe6ba=['mailQueue:','save','update','emit','register','length'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0xe6ba,0x1d5));var _0xae6b=function(_0xa63091,_0x74c273){_0xa63091=_0xa63091-0x0;var _0x120e9e=_0xe6ba[_0xa63091];return _0x120e9e;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=[_0xae6b('0x0'),'remove',_0xae6b('0x1')];function createListener(_0x588dbc,_0x1f73b0){return function(_0x6acf3){_0x1f73b0[_0xae6b('0x2')](_0x588dbc,_0x6acf3);};}function removeListener(_0x111584,_0xd3ed09){return function(){MailQueueEvents['removeListener'](_0x111584,_0xd3ed09);};}exports[_0xae6b('0x3')]=function(_0x80e2f){for(var _0x1c60de=0x0,_0x480c6c=events[_0xae6b('0x4')];_0x1c60de<_0x480c6c;_0x1c60de++){var _0xf3f054=events[_0x1c60de];var _0x5dae8b=createListener(_0xae6b('0x5')+_0xf3f054,_0x80e2f);MailQueueEvents['on'](_0xf3f054,_0x5dae8b);}}; \ No newline at end of file +var _0x6412=['length','mailQueue:','./mailQueue.events','save','remove','update','emit','removeListener','register'];(function(_0x1424e3,_0x3b266b){var _0x3200ba=function(_0x50851a){while(--_0x50851a){_0x1424e3['push'](_0x1424e3['shift']());}};_0x3200ba(++_0x3b266b);}(_0x6412,0xad));var _0x2641=function(_0x3573cb,_0x3cc455){_0x3573cb=_0x3573cb-0x0;var _0x545d09=_0x6412[_0x3573cb];return _0x545d09;};'use strict';var MailQueueEvents=require(_0x2641('0x0'));var events=[_0x2641('0x1'),_0x2641('0x2'),_0x2641('0x3')];function createListener(_0x42e268,_0x3326a3){return function(_0x21d04e){_0x3326a3[_0x2641('0x4')](_0x42e268,_0x21d04e);};}function removeListener(_0x4ccfdb,_0x66ba43){return function(){MailQueueEvents[_0x2641('0x5')](_0x4ccfdb,_0x66ba43);};}exports[_0x2641('0x6')]=function(_0x2cdab6){for(var _0x4421a1=0x0,_0x3d4af4=events[_0x2641('0x7')];_0x4421a1<_0x3d4af4;_0x4421a1++){var _0x1e04ba=events[_0x4421a1];var _0x1c218d=createListener(_0x2641('0x8')+_0x1e04ba,_0x2cdab6);MailQueueEvents['on'](_0x1e04ba,_0x1c218d);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index 1eaa355..3e7d779 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 _0x42f3=['describe','/:id','show','post','create','put','update','delete','destroy','exports','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./mailQueueReport.controller','isAuthenticated','index','get','/describe'];(function(_0x869a70,_0x4ba6e5){var _0x34d7bb=function(_0x4270c4){while(--_0x4270c4){_0x869a70['push'](_0x869a70['shift']());}};_0x34d7bb(++_0x4ba6e5);}(_0x42f3,0x172));var _0x342f=function(_0x650e11,_0x284f86){_0x650e11=_0x650e11-0x0;var _0x1a9b47=_0x42f3[_0x650e11];return _0x1a9b47;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x342f('0x0'));var express=require(_0x342f('0x1'));var router=express[_0x342f('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x342f('0x3'));var interaction=require(_0x342f('0x4'));var config=require('../../config/environment');var controller=require(_0x342f('0x5'));router['get']('/',auth[_0x342f('0x6')](),controller[_0x342f('0x7')]);router[_0x342f('0x8')](_0x342f('0x9'),auth[_0x342f('0x6')](),controller[_0x342f('0xa')]);router[_0x342f('0x8')](_0x342f('0xb'),auth[_0x342f('0x6')](),controller[_0x342f('0xc')]);router[_0x342f('0xd')]('/',auth[_0x342f('0x6')](),controller[_0x342f('0xe')]);router[_0x342f('0xf')](_0x342f('0xb'),auth[_0x342f('0x6')](),controller[_0x342f('0x10')]);router[_0x342f('0x11')](_0x342f('0xb'),auth[_0x342f('0x6')](),controller[_0x342f('0x12')]);module[_0x342f('0x13')]=router; \ No newline at end of file +var _0xf2af=['index','/describe','describe','/:id','post','create','put','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailQueueReport.controller','get','isAuthenticated'];(function(_0x114a7b,_0x4db906){var _0xd0868c=function(_0xbd07f3){while(--_0xbd07f3){_0x114a7b['push'](_0x114a7b['shift']());}};_0xd0868c(++_0x4db906);}(_0xf2af,0x149));var _0xff2a=function(_0x3334a5,_0x486d1c){_0x3334a5=_0x3334a5-0x0;var _0x528d73=_0xf2af[_0x3334a5];return _0x528d73;};'use strict';var multer=require('multer');var util=require(_0xff2a('0x0'));var path=require(_0xff2a('0x1'));var timeout=require(_0xff2a('0x2'));var express=require(_0xff2a('0x3'));var router=express[_0xff2a('0x4')]();var fs_extra=require(_0xff2a('0x5'));var auth=require(_0xff2a('0x6'));var interaction=require(_0xff2a('0x7'));var config=require('../../config/environment');var controller=require(_0xff2a('0x8'));router[_0xff2a('0x9')]('/',auth[_0xff2a('0xa')](),controller[_0xff2a('0xb')]);router[_0xff2a('0x9')](_0xff2a('0xc'),auth[_0xff2a('0xa')](),controller[_0xff2a('0xd')]);router[_0xff2a('0x9')](_0xff2a('0xe'),auth['isAuthenticated'](),controller['show']);router[_0xff2a('0xf')]('/',auth[_0xff2a('0xa')](),controller[_0xff2a('0x10')]);router[_0xff2a('0x11')]('/:id',auth[_0xff2a('0xa')](),controller['update']);router[_0xff2a('0x12')](_0xff2a('0xe'),auth['isAuthenticated'](),controller[_0xff2a('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index 3b0e946..d202d37 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 _0x1749=['STRING','DATE','moment','sequelize'];(function(_0x2aec52,_0x59d962){var _0x3b8835=function(_0x3e2604){while(--_0x3e2604){_0x2aec52['push'](_0x2aec52['shift']());}};_0x3b8835(++_0x59d962);}(_0x1749,0xfa));var _0x9174=function(_0x47ad8f,_0x50f056){_0x47ad8f=_0x47ad8f-0x0;var _0x686646=_0x1749[_0x47ad8f];return _0x686646;};'use strict';var moment=require(_0x9174('0x0'));var Sequelize=require(_0x9174('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x9174('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x9174('0x2')]},'joinAt':{'type':Sequelize[_0x9174('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x9174('0x2')]}}; \ No newline at end of file +var _0x0683=['sequelize','STRING','DATE'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x0683,0xe1));var _0x3068=function(_0xe807ee,_0x226d67){_0xe807ee=_0xe807ee-0x0;var _0x1cd439=_0x0683[_0xe807ee];return _0x1cd439;};'use strict';var moment=require('moment');var Sequelize=require(_0x3068('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x3068('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x3068('0x1')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x3068('0x2')]},'acceptAt':{'type':Sequelize[_0x3068('0x2')]},'exitAt':{'type':Sequelize[_0x3068('0x2')]},'reason':{'type':Sequelize[_0x3068('0x1')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index e82adfd..6e2b7ac 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 _0xef0f=['json','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','MailQueueReport','key','model','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','params','keys','rawAttributes','find','create','body','catch','describe','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range'];(function(_0x1ef843,_0x3f6ad8){var _0x4c1dc2=function(_0x49b2c8){while(--_0x49b2c8){_0x1ef843['push'](_0x1ef843['shift']());}};_0x4c1dc2(++_0x3f6ad8);}(_0xef0f,0x168));var _0xfef0=function(_0x1d10f5,_0x137f84){_0x1d10f5=_0x1d10f5-0x0;var _0x5168db=_0xef0f[_0x1d10f5];return _0x5168db;};'use strict';var emlformat=require(_0xfef0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfef0('0x1'));var jsonpatch=require(_0xfef0('0x2'));var rp=require(_0xfef0('0x3'));var moment=require('moment');var BPromise=require(_0xfef0('0x4'));var Mustache=require(_0xfef0('0x5'));var util=require(_0xfef0('0x6'));var path=require('path');var sox=require(_0xfef0('0x7'));var csv=require(_0xfef0('0x8'));var ejs=require(_0xfef0('0x9'));var fs=require('fs');var fs_extra=require(_0xfef0('0xa'));var _=require(_0xfef0('0xb'));var squel=require(_0xfef0('0xc'));var crypto=require('crypto');var jsforce=require(_0xfef0('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xfef0('0x8'));var querystring=require(_0xfef0('0xe'));var Papa=require(_0xfef0('0xf'));var Redis=require(_0xfef0('0x10'));var authService=require(_0xfef0('0x11'));var qs=require(_0xfef0('0x12'));var as=require(_0xfef0('0x13'));var hardwareService=require(_0xfef0('0x14'));var logger=require(_0xfef0('0x15'))(_0xfef0('0x16'));var utils=require(_0xfef0('0x17'));var config=require(_0xfef0('0x18'));var licenseUtil=require(_0xfef0('0x19'));var db=require(_0xfef0('0x1a'))['db'];function respondWithStatusCode(_0x546c7a,_0x3135ab){_0x3135ab=_0x3135ab||0xcc;return function(_0x2f4e23){if(_0x2f4e23){return _0x546c7a[_0xfef0('0x1b')](_0x3135ab);}return _0x546c7a[_0xfef0('0x1c')](_0x3135ab)[_0xfef0('0x1d')]();};}function respondWithResult(_0x45599a,_0xa9f040){_0xa9f040=_0xa9f040||0xc8;return function(_0x573ae7){if(_0x573ae7){return _0x45599a[_0xfef0('0x1c')](_0xa9f040)['json'](_0x573ae7);}};}function respondWithFilteredResult(_0x4b5bcf,_0x5acdd0){return function(_0x118b8d){if(_0x118b8d){var _0x284b6d=typeof _0x5acdd0[_0xfef0('0x1e')]===_0xfef0('0x1f')&&typeof _0x5acdd0[_0xfef0('0x20')]===_0xfef0('0x1f');var _0x155833=_0x118b8d[_0xfef0('0x21')];var _0x581459=_0x284b6d?0x0:_0x5acdd0[_0xfef0('0x1e')];var _0x1642cd=_0x284b6d?_0x118b8d[_0xfef0('0x21')]:_0x5acdd0[_0xfef0('0x1e')]+_0x5acdd0[_0xfef0('0x20')];var _0x55912f;if(_0x1642cd>=_0x155833){_0x1642cd=_0x155833;_0x55912f=0xc8;}else{_0x55912f=0xce;}_0x4b5bcf[_0xfef0('0x1c')](_0x55912f);return _0x4b5bcf['set'](_0xfef0('0x22'),_0x581459+'-'+_0x1642cd+'/'+_0x155833)[_0xfef0('0x23')](_0x118b8d);}return null;};}function patchUpdates(_0x28dee1){return function(_0x48408a){try{jsonpatch[_0xfef0('0x24')](_0x48408a,_0x28dee1,!![]);}catch(_0x4c304d){return BPromise[_0xfef0('0x25')](_0x4c304d);}return _0x48408a[_0xfef0('0x26')]();};}function saveUpdates(_0x52b93b,_0x4897af){return function(_0x4b8b22){if(_0x4b8b22){return _0x4b8b22[_0xfef0('0x27')](_0x52b93b)['then'](function(_0x1f9970){return _0x1f9970;});}return null;};}function removeEntity(_0x46b34a,_0x1a8d66){return function(_0x4483f2){if(_0x4483f2){return _0x4483f2[_0xfef0('0x28')]()[_0xfef0('0x29')](function(){_0x46b34a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x316e20,_0x1ffaa4){return function(_0x924f6e){if(!_0x924f6e){_0x316e20[_0xfef0('0x1b')](0x194);}return _0x924f6e;};}function handleError(_0xab231c,_0xf60f2){_0xf60f2=_0xf60f2||0x1f4;return function(_0x5df04f){logger[_0xfef0('0x2a')](_0x5df04f[_0xfef0('0x2b')]);if(_0x5df04f['name']){delete _0x5df04f[_0xfef0('0x2c')];}_0xab231c[_0xfef0('0x1c')](_0xf60f2)[_0xfef0('0x2d')](_0x5df04f);};}exports[_0xfef0('0x2e')]=function(_0x37921f,_0x1ac4a3){var _0x3e3c4c={},_0x3e026a={},_0x26cb9a={'count':0x0,'rows':[]};var _0x213a91=_[_0xfef0('0x2f')](db[_0xfef0('0x30')]['rawAttributes'],function(_0x445625){return{'name':_0x445625['fieldName'],'type':_0x445625['type'][_0xfef0('0x31')]};});_0x3e026a[_0xfef0('0x32')]=_['map'](_0x213a91,'name');_0x3e026a['query']=_['keys'](_0x37921f['query']);_0x3e026a[_0xfef0('0x33')]=_[_0xfef0('0x34')](_0x3e026a[_0xfef0('0x32')],_0x3e026a['query']);_0x3e3c4c['attributes']=_['intersection'](_0x3e026a[_0xfef0('0x32')],qs['fields'](_0x37921f[_0xfef0('0x35')][_0xfef0('0x36')]));_0x3e3c4c[_0xfef0('0x37')]=_0x3e3c4c['attributes'][_0xfef0('0x38')]?_0x3e3c4c['attributes']:_0x3e026a[_0xfef0('0x32')];if(!_0x37921f[_0xfef0('0x35')][_0xfef0('0x39')](_0xfef0('0x3a'))){_0x3e3c4c[_0xfef0('0x20')]=qs[_0xfef0('0x20')](_0x37921f[_0xfef0('0x35')][_0xfef0('0x20')]);_0x3e3c4c['offset']=qs[_0xfef0('0x1e')](_0x37921f[_0xfef0('0x35')][_0xfef0('0x1e')]);}_0x3e3c4c[_0xfef0('0x3b')]=qs[_0xfef0('0x3c')](_0x37921f[_0xfef0('0x35')][_0xfef0('0x3c')]);_0x3e3c4c[_0xfef0('0x3d')]=qs[_0xfef0('0x33')](_[_0xfef0('0x3e')](_0x37921f[_0xfef0('0x35')],_0x3e026a[_0xfef0('0x33')]),_0x213a91);if(_0x37921f[_0xfef0('0x35')]['filter']){_0x3e3c4c[_0xfef0('0x3d')]=_['merge'](_0x3e3c4c[_0xfef0('0x3d')],{'$or':_[_0xfef0('0x2f')](_0x213a91,function(_0x1ddce6){if(_0x1ddce6['type']!==_0xfef0('0x3f')){var _0x29469e={};_0x29469e[_0x1ddce6[_0xfef0('0x2c')]]={'$like':'%'+_0x37921f['query'][_0xfef0('0x40')]+'%'};return _0x29469e;}})});}_0x3e3c4c=_[_0xfef0('0x41')]({},_0x3e3c4c,_0x37921f[_0xfef0('0x42')]);var _0x5577f4={'where':_0x3e3c4c[_0xfef0('0x3d')]};return db['MailQueueReport']['count'](_0x5577f4)[_0xfef0('0x29')](function(_0x547a5d){_0x26cb9a['count']=_0x547a5d;if(_0x37921f[_0xfef0('0x35')][_0xfef0('0x43')]){_0x3e3c4c[_0xfef0('0x44')]=[{'all':!![]}];}return db[_0xfef0('0x30')][_0xfef0('0x45')](_0x3e3c4c);})[_0xfef0('0x29')](function(_0x4dd8f8){_0x26cb9a[_0xfef0('0x46')]=_0x4dd8f8;return _0x26cb9a;})[_0xfef0('0x29')](respondWithFilteredResult(_0x1ac4a3,_0x3e3c4c))['catch'](handleError(_0x1ac4a3,null));};exports['show']=function(_0x1d554e,_0x5dc824){var _0x1fc518={'raw':!![],'where':{'id':_0x1d554e[_0xfef0('0x47')]['id']}},_0x22c940={};_0x22c940[_0xfef0('0x32')]=_[_0xfef0('0x48')](db[_0xfef0('0x30')][_0xfef0('0x49')]);_0x22c940[_0xfef0('0x35')]=_['keys'](_0x1d554e[_0xfef0('0x35')]);_0x22c940['filters']=_['intersection'](_0x22c940[_0xfef0('0x32')],_0x22c940[_0xfef0('0x35')]);_0x1fc518['attributes']=_[_0xfef0('0x34')](_0x22c940['model'],qs[_0xfef0('0x36')](_0x1d554e[_0xfef0('0x35')][_0xfef0('0x36')]));_0x1fc518[_0xfef0('0x37')]=_0x1fc518['attributes'][_0xfef0('0x38')]?_0x1fc518[_0xfef0('0x37')]:_0x22c940['model'];if(_0x1d554e['query'][_0xfef0('0x43')]){_0x1fc518['include']=[{'all':!![]}];}_0x1fc518=_[_0xfef0('0x41')]({},_0x1fc518,_0x1d554e[_0xfef0('0x42')]);return db[_0xfef0('0x30')][_0xfef0('0x4a')](_0x1fc518)[_0xfef0('0x29')](handleEntityNotFound(_0x5dc824,null))[_0xfef0('0x29')](respondWithResult(_0x5dc824,null))['catch'](handleError(_0x5dc824,null));};exports[_0xfef0('0x4b')]=function(_0x559a28,_0x5a417e){return db[_0xfef0('0x30')][_0xfef0('0x4b')](_0x559a28[_0xfef0('0x4c')],{})['then'](respondWithResult(_0x5a417e,0xc9))[_0xfef0('0x4d')](handleError(_0x5a417e,null));};exports['update']=function(_0x5dd26b,_0x51f207){if(_0x5dd26b[_0xfef0('0x4c')]['id']){delete _0x5dd26b[_0xfef0('0x4c')]['id'];}return db[_0xfef0('0x30')][_0xfef0('0x4a')]({'where':{'id':_0x5dd26b[_0xfef0('0x47')]['id']}})[_0xfef0('0x29')](handleEntityNotFound(_0x51f207,null))[_0xfef0('0x29')](saveUpdates(_0x5dd26b[_0xfef0('0x4c')],null))[_0xfef0('0x29')](respondWithResult(_0x51f207,null))['catch'](handleError(_0x51f207,null));};exports['destroy']=function(_0x2bebec,_0x18e5ba){return db[_0xfef0('0x30')][_0xfef0('0x4a')]({'where':{'id':_0x2bebec[_0xfef0('0x47')]['id']}})[_0xfef0('0x29')](handleEntityNotFound(_0x18e5ba,null))[_0xfef0('0x29')](removeEntity(_0x18e5ba,null))[_0xfef0('0x4d')](handleError(_0x18e5ba,null));};exports['describe']=function(_0x2466e7,_0x19e449){return db[_0xfef0('0x30')][_0xfef0('0x4e')]()[_0xfef0('0x29')](respondWithResult(_0x19e449,null))['catch'](handleError(_0x19e449,null));}; \ No newline at end of file +var _0x6050=['filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','fs-extra','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','name','send','index','map','MailQueueReport','rawAttributes','type','key','model','query','keys'];(function(_0x1f4eb7,_0x113f5b){var _0x30e697=function(_0x5771e3){while(--_0x5771e3){_0x1f4eb7['push'](_0x1f4eb7['shift']());}};_0x30e697(++_0x113f5b);}(_0x6050,0x196));var _0x0605=function(_0x356c5e,_0x28d757){_0x356c5e=_0x356c5e-0x0;var _0x34d907=_0x6050[_0x356c5e];return _0x34d907;};'use strict';var emlformat=require(_0x0605('0x0'));var rimraf=require(_0x0605('0x1'));var zipdir=require(_0x0605('0x2'));var jsonpatch=require(_0x0605('0x3'));var rp=require(_0x0605('0x4'));var moment=require(_0x0605('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x0605('0x6'));var util=require(_0x0605('0x7'));var path=require(_0x0605('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0605('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0605('0xa'));var deskjs=require(_0x0605('0xb'));var toCsv=require(_0x0605('0xc'));var querystring=require(_0x0605('0xd'));var Papa=require(_0x0605('0xe'));var Redis=require('ioredis');var authService=require(_0x0605('0xf'));var qs=require(_0x0605('0x10'));var as=require(_0x0605('0x11'));var hardwareService=require(_0x0605('0x12'));var logger=require(_0x0605('0x13'))(_0x0605('0x14'));var utils=require(_0x0605('0x15'));var config=require(_0x0605('0x16'));var licenseUtil=require(_0x0605('0x17'));var db=require(_0x0605('0x18'))['db'];function respondWithStatusCode(_0xd22e35,_0x39e288){_0x39e288=_0x39e288||0xcc;return function(_0x34c9e6){if(_0x34c9e6){return _0xd22e35[_0x0605('0x19')](_0x39e288);}return _0xd22e35[_0x0605('0x1a')](_0x39e288)[_0x0605('0x1b')]();};}function respondWithResult(_0x169a70,_0x65a20b){_0x65a20b=_0x65a20b||0xc8;return function(_0x1b944f){if(_0x1b944f){return _0x169a70['status'](_0x65a20b)[_0x0605('0x1c')](_0x1b944f);}};}function respondWithFilteredResult(_0x1a802b,_0x4993ab){return function(_0x5ce56a){if(_0x5ce56a){var _0x4eefe9=typeof _0x4993ab[_0x0605('0x1d')]===_0x0605('0x1e')&&typeof _0x4993ab[_0x0605('0x1f')]===_0x0605('0x1e');var _0xefc557=_0x5ce56a[_0x0605('0x20')];var _0x2b7b5a=_0x4eefe9?0x0:_0x4993ab[_0x0605('0x1d')];var _0x193520=_0x4eefe9?_0x5ce56a[_0x0605('0x20')]:_0x4993ab[_0x0605('0x1d')]+_0x4993ab[_0x0605('0x1f')];var _0x2e2204;if(_0x193520>=_0xefc557){_0x193520=_0xefc557;_0x2e2204=0xc8;}else{_0x2e2204=0xce;}_0x1a802b[_0x0605('0x1a')](_0x2e2204);return _0x1a802b['set'](_0x0605('0x21'),_0x2b7b5a+'-'+_0x193520+'/'+_0xefc557)[_0x0605('0x1c')](_0x5ce56a);}return null;};}function patchUpdates(_0x430f28){return function(_0x443326){try{jsonpatch[_0x0605('0x22')](_0x443326,_0x430f28,!![]);}catch(_0x90b2e1){return BPromise[_0x0605('0x23')](_0x90b2e1);}return _0x443326[_0x0605('0x24')]();};}function saveUpdates(_0x226ef5,_0x5b0d44){return function(_0xc334b8){if(_0xc334b8){return _0xc334b8['update'](_0x226ef5)[_0x0605('0x25')](function(_0x118e9c){return _0x118e9c;});}return null;};}function removeEntity(_0x110098,_0xf182c4){return function(_0x10c575){if(_0x10c575){return _0x10c575[_0x0605('0x26')]()[_0x0605('0x25')](function(){_0x110098[_0x0605('0x1a')](0xcc)[_0x0605('0x1b')]();});}};}function handleEntityNotFound(_0x2896d7,_0x9f2833){return function(_0x1c3722){if(!_0x1c3722){_0x2896d7['sendStatus'](0x194);}return _0x1c3722;};}function handleError(_0x6bc204,_0x3c8e36){_0x3c8e36=_0x3c8e36||0x1f4;return function(_0x4b1e0c){logger['error'](_0x4b1e0c['stack']);if(_0x4b1e0c[_0x0605('0x27')]){delete _0x4b1e0c[_0x0605('0x27')];}_0x6bc204[_0x0605('0x1a')](_0x3c8e36)[_0x0605('0x28')](_0x4b1e0c);};}exports[_0x0605('0x29')]=function(_0x4554df,_0x4e32ef){var _0x34f25d={},_0x5daef6={},_0xa836f2={'count':0x0,'rows':[]};var _0x3640b9=_[_0x0605('0x2a')](db[_0x0605('0x2b')][_0x0605('0x2c')],function(_0x352dd6){return{'name':_0x352dd6['fieldName'],'type':_0x352dd6[_0x0605('0x2d')][_0x0605('0x2e')]};});_0x5daef6[_0x0605('0x2f')]=_[_0x0605('0x2a')](_0x3640b9,_0x0605('0x27'));_0x5daef6[_0x0605('0x30')]=_[_0x0605('0x31')](_0x4554df[_0x0605('0x30')]);_0x5daef6[_0x0605('0x32')]=_[_0x0605('0x33')](_0x5daef6[_0x0605('0x2f')],_0x5daef6[_0x0605('0x30')]);_0x34f25d[_0x0605('0x34')]=_[_0x0605('0x33')](_0x5daef6[_0x0605('0x2f')],qs[_0x0605('0x35')](_0x4554df[_0x0605('0x30')][_0x0605('0x35')]));_0x34f25d[_0x0605('0x34')]=_0x34f25d[_0x0605('0x34')][_0x0605('0x36')]?_0x34f25d[_0x0605('0x34')]:_0x5daef6[_0x0605('0x2f')];if(!_0x4554df[_0x0605('0x30')][_0x0605('0x37')](_0x0605('0x38'))){_0x34f25d[_0x0605('0x1f')]=qs['limit'](_0x4554df[_0x0605('0x30')][_0x0605('0x1f')]);_0x34f25d['offset']=qs[_0x0605('0x1d')](_0x4554df[_0x0605('0x30')]['offset']);}_0x34f25d[_0x0605('0x39')]=qs[_0x0605('0x3a')](_0x4554df[_0x0605('0x30')][_0x0605('0x3a')]);_0x34f25d[_0x0605('0x3b')]=qs[_0x0605('0x32')](_['pick'](_0x4554df['query'],_0x5daef6[_0x0605('0x32')]),_0x3640b9);if(_0x4554df[_0x0605('0x30')][_0x0605('0x3c')]){_0x34f25d['where']=_[_0x0605('0x3d')](_0x34f25d['where'],{'$or':_[_0x0605('0x2a')](_0x3640b9,function(_0x1e98f6){if(_0x1e98f6[_0x0605('0x2d')]!==_0x0605('0x3e')){var _0x42f7ce={};_0x42f7ce[_0x1e98f6[_0x0605('0x27')]]={'$like':'%'+_0x4554df[_0x0605('0x30')][_0x0605('0x3c')]+'%'};return _0x42f7ce;}})});}_0x34f25d=_[_0x0605('0x3d')]({},_0x34f25d,_0x4554df[_0x0605('0x3f')]);var _0x57aa15={'where':_0x34f25d[_0x0605('0x3b')]};return db['MailQueueReport'][_0x0605('0x20')](_0x57aa15)[_0x0605('0x25')](function(_0x45787e){_0xa836f2['count']=_0x45787e;if(_0x4554df['query'][_0x0605('0x40')]){_0x34f25d['include']=[{'all':!![]}];}return db[_0x0605('0x2b')][_0x0605('0x41')](_0x34f25d);})[_0x0605('0x25')](function(_0x3de34a){_0xa836f2[_0x0605('0x42')]=_0x3de34a;return _0xa836f2;})[_0x0605('0x25')](respondWithFilteredResult(_0x4e32ef,_0x34f25d))[_0x0605('0x43')](handleError(_0x4e32ef,null));};exports[_0x0605('0x44')]=function(_0x3fa553,_0x10bb36){var _0x18d3ce={'raw':!![],'where':{'id':_0x3fa553[_0x0605('0x45')]['id']}},_0x3616a3={};_0x3616a3['model']=_['keys'](db[_0x0605('0x2b')]['rawAttributes']);_0x3616a3[_0x0605('0x30')]=_[_0x0605('0x31')](_0x3fa553['query']);_0x3616a3[_0x0605('0x32')]=_[_0x0605('0x33')](_0x3616a3['model'],_0x3616a3[_0x0605('0x30')]);_0x18d3ce[_0x0605('0x34')]=_['intersection'](_0x3616a3[_0x0605('0x2f')],qs[_0x0605('0x35')](_0x3fa553['query'][_0x0605('0x35')]));_0x18d3ce['attributes']=_0x18d3ce['attributes'][_0x0605('0x36')]?_0x18d3ce[_0x0605('0x34')]:_0x3616a3[_0x0605('0x2f')];if(_0x3fa553[_0x0605('0x30')][_0x0605('0x40')]){_0x18d3ce[_0x0605('0x46')]=[{'all':!![]}];}_0x18d3ce=_[_0x0605('0x3d')]({},_0x18d3ce,_0x3fa553[_0x0605('0x3f')]);return db['MailQueueReport'][_0x0605('0x47')](_0x18d3ce)[_0x0605('0x25')](handleEntityNotFound(_0x10bb36,null))[_0x0605('0x25')](respondWithResult(_0x10bb36,null))['catch'](handleError(_0x10bb36,null));};exports[_0x0605('0x48')]=function(_0x1fb70b,_0x45cc1a){return db[_0x0605('0x2b')][_0x0605('0x48')](_0x1fb70b[_0x0605('0x49')],{})[_0x0605('0x25')](respondWithResult(_0x45cc1a,0xc9))[_0x0605('0x43')](handleError(_0x45cc1a,null));};exports[_0x0605('0x4a')]=function(_0x4bc55e,_0x3c597c){if(_0x4bc55e[_0x0605('0x49')]['id']){delete _0x4bc55e[_0x0605('0x49')]['id'];}return db[_0x0605('0x2b')][_0x0605('0x47')]({'where':{'id':_0x4bc55e[_0x0605('0x45')]['id']}})[_0x0605('0x25')](handleEntityNotFound(_0x3c597c,null))[_0x0605('0x25')](saveUpdates(_0x4bc55e[_0x0605('0x49')],null))[_0x0605('0x25')](respondWithResult(_0x3c597c,null))['catch'](handleError(_0x3c597c,null));};exports['destroy']=function(_0x4876c7,_0x2687a8){return db[_0x0605('0x2b')][_0x0605('0x47')]({'where':{'id':_0x4876c7[_0x0605('0x45')]['id']}})[_0x0605('0x25')](handleEntityNotFound(_0x2687a8,null))[_0x0605('0x25')](removeEntity(_0x2687a8,null))['catch'](handleError(_0x2687a8,null));};exports[_0x0605('0x4b')]=function(_0x286485,_0x184232){return db[_0x0605('0x2b')]['describe']()[_0x0605('0x25')](respondWithResult(_0x184232,null))[_0x0605('0x43')](handleError(_0x184232,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index f967ea3..8ddf53e 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 _0x5b61=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailQueueReport.attributes','exports','define','MailQueueReport','report_mail_queue','uniqueid','lodash','util'];(function(_0x108623,_0x4f41f3){var _0x3212e4=function(_0xe4c366){while(--_0xe4c366){_0x108623['push'](_0x108623['shift']());}};_0x3212e4(++_0x4f41f3);}(_0x5b61,0x13e));var _0x15b6=function(_0x5f42f1,_0x956be5){_0x5f42f1=_0x5f42f1-0x0;var _0x5534ee=_0x5b61[_0x5f42f1];return _0x5534ee;};'use strict';var _=require(_0x15b6('0x0'));var util=require(_0x15b6('0x1'));var logger=require(_0x15b6('0x2'))(_0x15b6('0x3'));var moment=require(_0x15b6('0x4'));var BPromise=require(_0x15b6('0x5'));var rp=require(_0x15b6('0x6'));var fs=require('fs');var path=require(_0x15b6('0x7'));var rimraf=require(_0x15b6('0x8'));var config=require(_0x15b6('0x9'));var attributes=require(_0x15b6('0xa'));module[_0x15b6('0xb')]=function(_0x516676,_0x2542b4){return _0x516676[_0x15b6('0xc')](_0x15b6('0xd'),attributes,{'tableName':_0x15b6('0xe'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x15b6('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5090=['path','rimraf','../../config/environment','./mailQueueReport.attributes','exports','MailQueueReport','report_mail_queue','uniqueid','util','../../config/logger','moment','bluebird'];(function(_0x5982a5,_0x3dc07b){var _0x159c80=function(_0x274c92){while(--_0x274c92){_0x5982a5['push'](_0x5982a5['shift']());}};_0x159c80(++_0x3dc07b);}(_0x5090,0x140));var _0x0509=function(_0x29b107,_0x441b7c){_0x29b107=_0x29b107-0x0;var _0x5a923b=_0x5090[_0x29b107];return _0x5a923b;};'use strict';var _=require('lodash');var util=require(_0x0509('0x0'));var logger=require(_0x0509('0x1'))('api');var moment=require(_0x0509('0x2'));var BPromise=require(_0x0509('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0509('0x4'));var rimraf=require(_0x0509('0x5'));var config=require(_0x0509('0x6'));var attributes=require(_0x0509('0x7'));module[_0x0509('0x8')]=function(_0x4fb0d8,_0x354fed){return _0x4fb0d8['define'](_0x0509('0x9'),attributes,{'tableName':_0x0509('0xa'),'paranoid':![],'indexes':[{'name':_0x0509('0xb'),'fields':[_0x0509('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index 45b88dd..c26dfec 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 _0x2ef3=['options','raw','UpdateMailQueueReport','where','attributes','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','MailQueueReport,\x20%s,\x20%s','MailQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','CreateMailQueueReport','MailQueueReport','body'];(function(_0x26aee4,_0x530ead){var _0x2e1048=function(_0x2e92db){while(--_0x2e92db){_0x26aee4['push'](_0x26aee4['shift']());}};_0x2e1048(++_0x530ead);}(_0x2ef3,0xba));var _0x32ef=function(_0x1504a6,_0x3c5468){_0x1504a6=_0x1504a6-0x0;var _0x33bcd0=_0x2ef3[_0x1504a6];return _0x33bcd0;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('MailQueueReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('MailQueueReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});}exports[_0x32ef('0x15')]=function(_0x1a9476){var _0x286bfb=this;return new Promise(function(_0x57863c,_0xbe37f6){return db[_0x32ef('0x16')]['create'](_0x1a9476[_0x32ef('0x17')],{'raw':_0x1a9476[_0x32ef('0x18')]?_0x1a9476[_0x32ef('0x18')][_0x32ef('0x19')]===undefined?!![]:![]:!![]})[_0x32ef('0xb')](function(_0x3aec05){logger['info'](_0x32ef('0x15'),_0x1a9476);logger['debug'](_0x32ef('0x15'),_0x1a9476,JSON[_0x32ef('0x10')](_0x3aec05));_0x57863c(_0x3aec05);})['catch'](function(_0x1af371){logger[_0x32ef('0x11')](_0x32ef('0x15'),_0x1af371['message'],_0x1a9476);_0xbe37f6(_0x286bfb['error'](0x1f4,_0x1af371[_0x32ef('0x13')]));});});};exports[_0x32ef('0x1a')]=function(_0x225feb){var _0x478bef=this;return new Promise(function(_0x59585f,_0x19ea6){return db['MailQueueReport']['update'](_0x225feb[_0x32ef('0x17')],{'raw':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x1b')]||null:null,'attributes':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x1c')]||null:null,'limit':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')]['limit']||null:null})[_0x32ef('0xb')](function(_0x2f5d06){logger['info'](_0x32ef('0x1a'),_0x225feb);logger[_0x32ef('0x1d')](_0x32ef('0x1a'),_0x225feb,JSON[_0x32ef('0x10')](_0x2f5d06));_0x59585f(_0x2f5d06);})['catch'](function(_0x10e38c){logger[_0x32ef('0x11')](_0x32ef('0x1a'),_0x10e38c[_0x32ef('0x13')],_0x225feb);_0x19ea6(_0x478bef[_0x32ef('0x11')](0x1f4,_0x10e38c[_0x32ef('0x13')]));});});}; \ No newline at end of file +var _0x2ef3=['options','raw','UpdateMailQueueReport','where','attributes','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','MailQueueReport,\x20%s,\x20%s','MailQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','CreateMailQueueReport','MailQueueReport','body'];(function(_0x2eaa6b,_0x5f3658){var _0x4770c9=function(_0x1a22a2){while(--_0x1a22a2){_0x2eaa6b['push'](_0x2eaa6b['shift']());}};_0x4770c9(++_0x5f3658);}(_0x2ef3,0xba));var _0x32ef=function(_0x49eac1,_0x509058){_0x49eac1=_0x49eac1-0x0;var _0x23ff7d=_0x2ef3[_0x49eac1];return _0x23ff7d;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('MailQueueReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('MailQueueReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});}exports[_0x32ef('0x15')]=function(_0x1a9476){var _0x286bfb=this;return new Promise(function(_0x57863c,_0xbe37f6){return db[_0x32ef('0x16')]['create'](_0x1a9476[_0x32ef('0x17')],{'raw':_0x1a9476[_0x32ef('0x18')]?_0x1a9476[_0x32ef('0x18')][_0x32ef('0x19')]===undefined?!![]:![]:!![]})[_0x32ef('0xb')](function(_0x3aec05){logger['info'](_0x32ef('0x15'),_0x1a9476);logger['debug'](_0x32ef('0x15'),_0x1a9476,JSON[_0x32ef('0x10')](_0x3aec05));_0x57863c(_0x3aec05);})['catch'](function(_0x1af371){logger[_0x32ef('0x11')](_0x32ef('0x15'),_0x1af371['message'],_0x1a9476);_0xbe37f6(_0x286bfb['error'](0x1f4,_0x1af371[_0x32ef('0x13')]));});});};exports[_0x32ef('0x1a')]=function(_0x225feb){var _0x478bef=this;return new Promise(function(_0x59585f,_0x19ea6){return db['MailQueueReport']['update'](_0x225feb[_0x32ef('0x17')],{'raw':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x1b')]||null:null,'attributes':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x1c')]||null:null,'limit':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')]['limit']||null:null})[_0x32ef('0xb')](function(_0x2f5d06){logger['info'](_0x32ef('0x1a'),_0x225feb);logger[_0x32ef('0x1d')](_0x32ef('0x1a'),_0x225feb,JSON[_0x32ef('0x10')](_0x2f5d06));_0x59585f(_0x2f5d06);})['catch'](function(_0x10e38c){logger[_0x32ef('0x11')](_0x32ef('0x1a'),_0x10e38c[_0x32ef('0x13')],_0x225feb);_0x19ea6(_0x478bef[_0x32ef('0x11')](0x1f4,_0x10e38c[_0x32ef('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index efa0c30..94f7962 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x27b036,_0xa6fd32){var _0x4ed319=function(_0x5b7a95){while(--_0x5b7a95){_0x27b036['push'](_0x27b036['shift']());}};_0x4ed319(++_0xa6fd32);}(_0xe706,0xa3));var _0x6e70=function(_0x4287cb,_0xe75c02){_0x4287cb=_0x4287cb-0x0;var _0x2b5fd3=_0xe706[_0x4287cb];return _0x2b5fd3;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x403ace,_0x5d7d12){var _0x2eb454=function(_0x463aac){while(--_0x463aac){_0x403ace['push'](_0x403ace['shift']());}};_0x2eb454(++_0x5d7d12);}(_0xe706,0xa3));var _0x6e70=function(_0x18b9a8,_0x1770b6){_0x18b9a8=_0x18b9a8-0x0;var _0x4a0a8f=_0xe706[_0x18b9a8];return _0x4a0a8f;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index c8833a5..22ec359 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 _0x8902=['exports','STRING','BOOLEAN','INBOX','INTEGER','sequelize'];(function(_0x500f51,_0x2751aa){var _0x5d7af5=function(_0x1a08f5){while(--_0x1a08f5){_0x500f51['push'](_0x500f51['shift']());}};_0x5d7af5(++_0x2751aa);}(_0x8902,0x1e5));var _0x2890=function(_0x121a8f,_0x265086){_0x121a8f=_0x121a8f-0x0;var _0x585386=_0x8902[_0x121a8f];return _0x585386;};'use strict';var Sequelize=require(_0x2890('0x0'));module[_0x2890('0x1')]={'description':{'type':Sequelize[_0x2890('0x2')]},'host':{'type':Sequelize[_0x2890('0x2')]},'authentication':{'type':Sequelize[_0x2890('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0x2890('0x2')]},'password':{'type':Sequelize[_0x2890('0x2')]},'port':{'type':Sequelize['INTEGER']},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x2890('0x2')],'defaultValue':_0x2890('0x4')},'connTimeout':{'type':Sequelize[_0x2890('0x5')],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize[_0x2890('0x2')]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x5ff0=['STRING','BOOLEAN','INBOX','INTEGER','exports'];(function(_0x3a2587,_0x10a5f3){var _0x5b1abc=function(_0xf4ecb7){while(--_0xf4ecb7){_0x3a2587['push'](_0x3a2587['shift']());}};_0x5b1abc(++_0x10a5f3);}(_0x5ff0,0x72));var _0x05ff=function(_0x30bb42,_0x2440d2){_0x30bb42=_0x30bb42-0x0;var _0x42ea21=_0x5ff0[_0x30bb42];return _0x42ea21;};'use strict';var Sequelize=require('sequelize');module[_0x05ff('0x0')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x05ff('0x1')]},'authentication':{'type':Sequelize[_0x05ff('0x2')],'defaultValue':!![]},'user':{'type':Sequelize[_0x05ff('0x1')]},'password':{'type':Sequelize[_0x05ff('0x1')]},'port':{'type':Sequelize['INTEGER']},'tls':{'type':Sequelize[_0x05ff('0x2')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x05ff('0x1')],'defaultValue':_0x05ff('0x3')},'connTimeout':{'type':Sequelize[_0x05ff('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x05ff('0x4')],'defaultValue':0x5},'service':{'type':Sequelize['STRING']},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index c88de63..9fa22e1 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 _0x91c8=['rimraf','../../config/environment','./mailServerIn.attributes','exports','define','MailServerIn','mail_servers_in','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x5ebb4a,_0x15563c){var _0x28c1b3=function(_0x9fda00){while(--_0x9fda00){_0x5ebb4a['push'](_0x5ebb4a['shift']());}};_0x28c1b3(++_0x15563c);}(_0x91c8,0xb0));var _0x891c=function(_0x559428,_0x3ba8cb){_0x559428=_0x559428-0x0;var _0x55754a=_0x91c8[_0x559428];return _0x55754a;};'use strict';var _=require('lodash');var util=require(_0x891c('0x0'));var logger=require(_0x891c('0x1'))('api');var moment=require(_0x891c('0x2'));var BPromise=require(_0x891c('0x3'));var rp=require(_0x891c('0x4'));var fs=require('fs');var path=require(_0x891c('0x5'));var rimraf=require(_0x891c('0x6'));var config=require(_0x891c('0x7'));var attributes=require(_0x891c('0x8'));module[_0x891c('0x9')]=function(_0x535f1a,_0x57a51e){return _0x535f1a[_0x891c('0xa')](_0x891c('0xb'),attributes,{'tableName':_0x891c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf125=['mail_servers_in','lodash','util','api','moment','bluebird','path','rimraf','./mailServerIn.attributes','define'];(function(_0x19b8cc,_0x487765){var _0x1f7596=function(_0x33dfa9){while(--_0x33dfa9){_0x19b8cc['push'](_0x19b8cc['shift']());}};_0x1f7596(++_0x487765);}(_0xf125,0x1a5));var _0x5f12=function(_0x154203,_0x249954){_0x154203=_0x154203-0x0;var _0x3a5923=_0xf125[_0x154203];return _0x3a5923;};'use strict';var _=require(_0x5f12('0x0'));var util=require(_0x5f12('0x1'));var logger=require('../../config/logger')(_0x5f12('0x2'));var moment=require(_0x5f12('0x3'));var BPromise=require(_0x5f12('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5f12('0x5'));var rimraf=require(_0x5f12('0x6'));var config=require('../../config/environment');var attributes=require(_0x5f12('0x7'));module['exports']=function(_0x47a86a,_0x2b6a07){return _0x47a86a[_0x5f12('0x8')]('MailServerIn',attributes,{'tableName':_0x5f12('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.rpc.js b/server/api/mailServerIn/mailServerIn.rpc.js index 9cc8781..125fda2 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 _0x6c05=['where','attributes','limit','map','include','model','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetMailServerIn','MailServerIn','options'];(function(_0x11b57c,_0x2ee2ca){var _0x1a1a2b=function(_0x4601ad){while(--_0x4601ad){_0x11b57c['push'](_0x11b57c['shift']());}};_0x1a1a2b(++_0x2ee2ca);}(_0x6c05,0x64));var _0x56c0=function(_0x565f55,_0x2e8657){_0x565f55=_0x565f55-0x0;var _0x2211fb=_0x6c05[_0x565f55];return _0x2211fb;};'use strict';var _=require(_0x56c0('0x0'));var util=require(_0x56c0('0x1'));var moment=require(_0x56c0('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x56c0('0x3'));var db=require(_0x56c0('0x4'))['db'];var utils=require(_0x56c0('0x5'));var logger=require(_0x56c0('0x6'))(_0x56c0('0x7'));var config=require(_0x56c0('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x56c0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x230af0,_0x20e34f,_0x30bef4){return new BPromise(function(_0x63c369,_0x1895bd){return client[_0x56c0('0xa')](_0x230af0,_0x30bef4)[_0x56c0('0xb')](function(_0x34af85){logger[_0x56c0('0xc')](_0x56c0('0xd'),_0x20e34f,_0x56c0('0xe'));logger['debug'](_0x56c0('0xf'),_0x20e34f,_0x56c0('0xe'),JSON[_0x56c0('0x10')](_0x34af85));if(_0x34af85[_0x56c0('0x11')]){if(_0x34af85[_0x56c0('0x11')][_0x56c0('0x12')]===0x1f4){logger['error'](_0x56c0('0xd'),_0x20e34f,_0x34af85[_0x56c0('0x11')]['message']);return _0x1895bd(_0x34af85[_0x56c0('0x11')][_0x56c0('0x13')]);}logger[_0x56c0('0x11')](_0x56c0('0xd'),_0x20e34f,_0x34af85[_0x56c0('0x11')]['message']);return _0x63c369(_0x34af85[_0x56c0('0x11')][_0x56c0('0x13')]);}else{logger[_0x56c0('0xc')]('MailServerIn,\x20%s,\x20%s',_0x20e34f,'request\x20sent');_0x63c369(_0x34af85[_0x56c0('0x14')]['message']);}})['catch'](function(_0x1b9ef9){logger[_0x56c0('0x11')]('MailServerIn,\x20%s,\x20%s',_0x20e34f,_0x1b9ef9);_0x1895bd(_0x1b9ef9);});});}exports[_0x56c0('0x15')]=function(_0xa8f29f){var _0x1a58fe=this;return new Promise(function(_0x3c27bc,_0x4ba2d1){return db[_0x56c0('0x16')]['findAll']({'raw':_0xa8f29f['options']?_0xa8f29f[_0x56c0('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0xa8f29f[_0x56c0('0x17')]?_0xa8f29f[_0x56c0('0x17')][_0x56c0('0x18')]||null:null,'attributes':_0xa8f29f['options']?_0xa8f29f[_0x56c0('0x17')][_0x56c0('0x19')]||null:null,'limit':_0xa8f29f['options']?_0xa8f29f[_0x56c0('0x17')][_0x56c0('0x1a')]||null:null,'include':_0xa8f29f['options']?_0xa8f29f[_0x56c0('0x17')]['include']?_[_0x56c0('0x1b')](_0xa8f29f['options'][_0x56c0('0x1c')],function(_0x38c11b){return{'model':db[_0x38c11b[_0x56c0('0x1d')]],'as':_0x38c11b['as'],'attributes':_0x38c11b[_0x56c0('0x19')],'include':_0x38c11b[_0x56c0('0x1c')]?_[_0x56c0('0x1b')](_0x38c11b[_0x56c0('0x1c')],function(_0x5a49e5){return{'model':db[_0x5a49e5[_0x56c0('0x1d')]],'as':_0x5a49e5['as'],'attributes':_0x5a49e5['attributes'],'include':_0x5a49e5[_0x56c0('0x1c')]?_['map'](_0x5a49e5[_0x56c0('0x1c')],function(_0x57b1ff){return{'model':db[_0x57b1ff['model']],'as':_0x57b1ff['as'],'attributes':_0x57b1ff[_0x56c0('0x19')]};}):[]};}):[]};}):[]:[]})[_0x56c0('0xb')](function(_0x4367d5){logger[_0x56c0('0xc')](_0x56c0('0x15'),_0xa8f29f);logger['debug']('GetMailServerIn',_0xa8f29f,JSON[_0x56c0('0x10')](_0x4367d5));_0x3c27bc(_0x4367d5);})[_0x56c0('0x1e')](function(_0x7c6c47){logger[_0x56c0('0x11')]('GetMailServerIn',_0x7c6c47['message'],_0xa8f29f);_0x4ba2d1(_0x1a58fe[_0x56c0('0x11')](0x1f4,_0x7c6c47[_0x56c0('0x13')]));});});}; \ No newline at end of file +var _0xed59=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','GetMailServerIn','MailServerIn','findAll','options','raw','where','attributes','include','map','model','then','stringify','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0xed59,0x112));var _0x9ed5=function(_0x4ab866,_0x3f3800){_0x4ab866=_0x4ab866-0x0;var _0x3d9d2c=_0xed59[_0x4ab866];return _0x3d9d2c;};'use strict';var _=require(_0x9ed5('0x0'));var util=require(_0x9ed5('0x1'));var moment=require(_0x9ed5('0x2'));var BPromise=require('bluebird');var rs=require(_0x9ed5('0x3'));var fs=require('fs');var Redis=require(_0x9ed5('0x4'));var db=require(_0x9ed5('0x5'))['db'];var utils=require(_0x9ed5('0x6'));var logger=require(_0x9ed5('0x7'))(_0x9ed5('0x8'));var config=require(_0x9ed5('0x9'));var jayson=require(_0x9ed5('0xa'));var client=jayson[_0x9ed5('0xb')][_0x9ed5('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x30dd85,_0x493b0f,_0x15d9b1){return new BPromise(function(_0x108ae4,_0x483827){return client[_0x9ed5('0xd')](_0x30dd85,_0x15d9b1)['then'](function(_0x15960e){logger['info'](_0x9ed5('0xe'),_0x493b0f,_0x9ed5('0xf'));logger[_0x9ed5('0x10')]('MailServerIn,\x20%s,\x20%s,\x20%s',_0x493b0f,_0x9ed5('0xf'),JSON['stringify'](_0x15960e));if(_0x15960e[_0x9ed5('0x11')]){if(_0x15960e[_0x9ed5('0x11')][_0x9ed5('0x12')]===0x1f4){logger['error'](_0x9ed5('0xe'),_0x493b0f,_0x15960e[_0x9ed5('0x11')][_0x9ed5('0x13')]);return _0x483827(_0x15960e[_0x9ed5('0x11')][_0x9ed5('0x13')]);}logger['error']('MailServerIn,\x20%s,\x20%s',_0x493b0f,_0x15960e[_0x9ed5('0x11')]['message']);return _0x108ae4(_0x15960e[_0x9ed5('0x11')][_0x9ed5('0x13')]);}else{logger[_0x9ed5('0x14')](_0x9ed5('0xe'),_0x493b0f,_0x9ed5('0xf'));_0x108ae4(_0x15960e[_0x9ed5('0x15')][_0x9ed5('0x13')]);}})[_0x9ed5('0x16')](function(_0x5949e1){logger[_0x9ed5('0x11')]('MailServerIn,\x20%s,\x20%s',_0x493b0f,_0x5949e1);_0x483827(_0x5949e1);});});}exports[_0x9ed5('0x17')]=function(_0x4cd40e){var _0x5a8ee3=this;return new Promise(function(_0x53bd5d,_0x5c072c){return db[_0x9ed5('0x18')][_0x9ed5('0x19')]({'raw':_0x4cd40e[_0x9ed5('0x1a')]?_0x4cd40e[_0x9ed5('0x1a')][_0x9ed5('0x1b')]===undefined?!![]:![]:!![],'where':_0x4cd40e[_0x9ed5('0x1a')]?_0x4cd40e[_0x9ed5('0x1a')][_0x9ed5('0x1c')]||null:null,'attributes':_0x4cd40e['options']?_0x4cd40e[_0x9ed5('0x1a')][_0x9ed5('0x1d')]||null:null,'limit':_0x4cd40e[_0x9ed5('0x1a')]?_0x4cd40e[_0x9ed5('0x1a')]['limit']||null:null,'include':_0x4cd40e[_0x9ed5('0x1a')]?_0x4cd40e[_0x9ed5('0x1a')][_0x9ed5('0x1e')]?_[_0x9ed5('0x1f')](_0x4cd40e[_0x9ed5('0x1a')][_0x9ed5('0x1e')],function(_0x1e0648){return{'model':db[_0x1e0648[_0x9ed5('0x20')]],'as':_0x1e0648['as'],'attributes':_0x1e0648[_0x9ed5('0x1d')],'include':_0x1e0648[_0x9ed5('0x1e')]?_[_0x9ed5('0x1f')](_0x1e0648[_0x9ed5('0x1e')],function(_0x77151d){return{'model':db[_0x77151d[_0x9ed5('0x20')]],'as':_0x77151d['as'],'attributes':_0x77151d['attributes'],'include':_0x77151d[_0x9ed5('0x1e')]?_[_0x9ed5('0x1f')](_0x77151d[_0x9ed5('0x1e')],function(_0x28dccf){return{'model':db[_0x28dccf[_0x9ed5('0x20')]],'as':_0x28dccf['as'],'attributes':_0x28dccf[_0x9ed5('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x9ed5('0x21')](function(_0x5815ef){logger[_0x9ed5('0x14')]('GetMailServerIn',_0x4cd40e);logger['debug'](_0x9ed5('0x17'),_0x4cd40e,JSON[_0x9ed5('0x22')](_0x5815ef));_0x53bd5d(_0x5815ef);})['catch'](function(_0x5d9768){logger[_0x9ed5('0x11')](_0x9ed5('0x17'),_0x5d9768[_0x9ed5('0x13')],_0x4cd40e);_0x5c072c(_0x5a8ee3[_0x9ed5('0x11')](0x1f4,_0x5d9768['message']));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index 178f9be..2245a09 100644 --- a/server/api/mailServerOut/index.js +++ b/server/api/mailServerOut/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['index','/:id','isAuthenticated','post','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x7a54,0x106));var _0x47a5=function(_0x46120a,_0x2cc9ba){_0x46120a=_0x46120a-0x0;var _0x354390=_0x7a54[_0x46120a];return _0x354390;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['update']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);module[_0x47a5('0x10')]=router; \ No newline at end of file +var _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailServerOut.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x31cb5f,_0x2df766){var _0x586042=function(_0x53c807){while(--_0x53c807){_0x31cb5f['push'](_0x31cb5f['shift']());}};_0x586042(++_0x2df766);}(_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 fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.attributes.js b/server/api/mailServerOut/mailServerOut.attributes.js index bc9860f..0754ae8 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 _0xb58b=['BOOLEAN','exports','STRING','INTEGER'];(function(_0x46bb87,_0x5a88fa){var _0x304cdc=function(_0x277021){while(--_0x277021){_0x46bb87['push'](_0x46bb87['shift']());}};_0x304cdc(++_0x5a88fa);}(_0xb58b,0x1f1));var _0xbb58=function(_0x552c03,_0x247fab){_0x552c03=_0x552c03-0x0;var _0x25e104=_0xb58b[_0x552c03];return _0x25e104;};'use strict';var Sequelize=require('sequelize');module[_0xbb58('0x0')]={'description':{'type':Sequelize[_0xbb58('0x1')]},'host':{'type':Sequelize[_0xbb58('0x1')]},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize[_0xbb58('0x1')]},'port':{'type':Sequelize[_0xbb58('0x2')]},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize[_0xbb58('0x1')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0xbb58('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xe605=['BOOLEAN','sequelize','exports','STRING','INTEGER'];(function(_0x1e3c16,_0x372caa){var _0x47a0c9=function(_0x47f81d){while(--_0x47f81d){_0x1e3c16['push'](_0x1e3c16['shift']());}};_0x47a0c9(++_0x372caa);}(_0xe605,0x92));var _0x5e60=function(_0x56585f,_0x1625c8){_0x56585f=_0x56585f-0x0;var _0x43dd2f=_0xe605[_0x56585f];return _0x43dd2f;};'use strict';var Sequelize=require(_0x5e60('0x0'));module[_0x5e60('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x5e60('0x2')]},'user':{'type':Sequelize[_0x5e60('0x2')]},'pass':{'type':Sequelize[_0x5e60('0x2')]},'port':{'type':Sequelize[_0x5e60('0x3')]},'secure':{'type':Sequelize[_0x5e60('0x4')],'defaultValue':![]},'service':{'type':Sequelize[_0x5e60('0x2')]},'authentication':{'type':Sequelize[_0x5e60('0x4')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x5e60('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index c0857b5..bb9dc9a 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 _0x3bc8=['jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','error','stack','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','MailServerOut','findAll','rows','catch','show','params','rawAttributes','create','body','find','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','squel','crypto'];(function(_0x1ffff7,_0x2f9ff6){var _0x49d017=function(_0x1d2483){while(--_0x1d2483){_0x1ffff7['push'](_0x1ffff7['shift']());}};_0x49d017(++_0x2f9ff6);}(_0x3bc8,0x1cc));var _0x83bc=function(_0x111b26,_0xf76620){_0x111b26=_0x111b26-0x0;var _0x3a0a1e=_0x3bc8[_0x111b26];return _0x3a0a1e;};'use strict';var emlformat=require(_0x83bc('0x0'));var rimraf=require(_0x83bc('0x1'));var zipdir=require(_0x83bc('0x2'));var jsonpatch=require(_0x83bc('0x3'));var rp=require(_0x83bc('0x4'));var moment=require(_0x83bc('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x83bc('0x6'));var path=require(_0x83bc('0x7'));var sox=require(_0x83bc('0x8'));var csv=require(_0x83bc('0x9'));var ejs=require(_0x83bc('0xa'));var fs=require('fs');var fs_extra=require(_0x83bc('0xb'));var _=require('lodash');var squel=require(_0x83bc('0xc'));var crypto=require(_0x83bc('0xd'));var jsforce=require(_0x83bc('0xe'));var deskjs=require(_0x83bc('0xf'));var toCsv=require(_0x83bc('0x9'));var querystring=require('querystring');var Papa=require(_0x83bc('0x10'));var Redis=require(_0x83bc('0x11'));var authService=require(_0x83bc('0x12'));var qs=require(_0x83bc('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x83bc('0x14'))(_0x83bc('0x15'));var utils=require(_0x83bc('0x16'));var config=require(_0x83bc('0x17'));var licenseUtil=require(_0x83bc('0x18'));var db=require(_0x83bc('0x19'))['db'];function respondWithStatusCode(_0xe4ceef,_0x2b7285){_0x2b7285=_0x2b7285||0xcc;return function(_0x48c7ff){if(_0x48c7ff){return _0xe4ceef[_0x83bc('0x1a')](_0x2b7285);}return _0xe4ceef['status'](_0x2b7285)[_0x83bc('0x1b')]();};}function respondWithResult(_0x34a8a6,_0x6e7ea2){_0x6e7ea2=_0x6e7ea2||0xc8;return function(_0x1755e1){if(_0x1755e1){return _0x34a8a6[_0x83bc('0x1c')](_0x6e7ea2)['json'](_0x1755e1);}};}function respondWithFilteredResult(_0x76f460,_0x25bb03){return function(_0x361b2c){if(_0x361b2c){var _0x564846=typeof _0x25bb03['offset']==='undefined'&&typeof _0x25bb03[_0x83bc('0x1d')]==='undefined';var _0x95741b=_0x361b2c[_0x83bc('0x1e')];var _0x1f7c48=_0x564846?0x0:_0x25bb03[_0x83bc('0x1f')];var _0x38eab6=_0x564846?_0x361b2c[_0x83bc('0x1e')]:_0x25bb03[_0x83bc('0x1f')]+_0x25bb03['limit'];var _0x6036b1;if(_0x38eab6>=_0x95741b){_0x38eab6=_0x95741b;_0x6036b1=0xc8;}else{_0x6036b1=0xce;}_0x76f460[_0x83bc('0x1c')](_0x6036b1);return _0x76f460[_0x83bc('0x20')](_0x83bc('0x21'),_0x1f7c48+'-'+_0x38eab6+'/'+_0x95741b)[_0x83bc('0x22')](_0x361b2c);}return null;};}function patchUpdates(_0x1318f5){return function(_0x3aef88){try{jsonpatch[_0x83bc('0x23')](_0x3aef88,_0x1318f5,!![]);}catch(_0x2583db){return BPromise[_0x83bc('0x24')](_0x2583db);}return _0x3aef88[_0x83bc('0x25')]();};}function saveUpdates(_0x269fb8,_0x48654a){return function(_0x38ab5d){if(_0x38ab5d){return _0x38ab5d[_0x83bc('0x26')](_0x269fb8)[_0x83bc('0x27')](function(_0xe2a51a){return _0xe2a51a;});}return null;};}function removeEntity(_0x1ec421,_0x315732){return function(_0x2ac64d){if(_0x2ac64d){return _0x2ac64d['destroy']()[_0x83bc('0x27')](function(){_0x1ec421[_0x83bc('0x1c')](0xcc)[_0x83bc('0x1b')]();});}};}function handleEntityNotFound(_0x4f0f8e,_0x4dd8f3){return function(_0x4befcb){if(!_0x4befcb){_0x4f0f8e[_0x83bc('0x1a')](0x194);}return _0x4befcb;};}function handleError(_0x330992,_0x5680c0){_0x5680c0=_0x5680c0||0x1f4;return function(_0x3d0a1f){logger[_0x83bc('0x28')](_0x3d0a1f[_0x83bc('0x29')]);if(_0x3d0a1f[_0x83bc('0x2a')]){delete _0x3d0a1f[_0x83bc('0x2a')];}_0x330992[_0x83bc('0x1c')](_0x5680c0)[_0x83bc('0x2b')](_0x3d0a1f);};}exports[_0x83bc('0x2c')]=function(_0x15423f,_0x47414a){var _0x1b9c8f={},_0x211eab={},_0x2fbdfd={'count':0x0,'rows':[]};var _0x1829ca=_[_0x83bc('0x2d')](db['MailServerOut']['rawAttributes'],function(_0x3609b7){return{'name':_0x3609b7[_0x83bc('0x2e')],'type':_0x3609b7[_0x83bc('0x2f')][_0x83bc('0x30')]};});_0x211eab[_0x83bc('0x31')]=_[_0x83bc('0x2d')](_0x1829ca,_0x83bc('0x2a'));_0x211eab[_0x83bc('0x32')]=_[_0x83bc('0x33')](_0x15423f[_0x83bc('0x32')]);_0x211eab[_0x83bc('0x34')]=_[_0x83bc('0x35')](_0x211eab[_0x83bc('0x31')],_0x211eab[_0x83bc('0x32')]);_0x1b9c8f[_0x83bc('0x36')]=_[_0x83bc('0x35')](_0x211eab[_0x83bc('0x31')],qs['fields'](_0x15423f[_0x83bc('0x32')][_0x83bc('0x37')]));_0x1b9c8f[_0x83bc('0x36')]=_0x1b9c8f['attributes'][_0x83bc('0x38')]?_0x1b9c8f[_0x83bc('0x36')]:_0x211eab[_0x83bc('0x31')];if(!_0x15423f['query'][_0x83bc('0x39')](_0x83bc('0x3a'))){_0x1b9c8f[_0x83bc('0x1d')]=qs[_0x83bc('0x1d')](_0x15423f[_0x83bc('0x32')][_0x83bc('0x1d')]);_0x1b9c8f['offset']=qs['offset'](_0x15423f[_0x83bc('0x32')]['offset']);}_0x1b9c8f['order']=qs[_0x83bc('0x3b')](_0x15423f['query']['sort']);_0x1b9c8f[_0x83bc('0x3c')]=qs[_0x83bc('0x34')](_[_0x83bc('0x3d')](_0x15423f['query'],_0x211eab['filters']),_0x1829ca);if(_0x15423f[_0x83bc('0x32')][_0x83bc('0x3e')]){_0x1b9c8f['where']=_[_0x83bc('0x3f')](_0x1b9c8f[_0x83bc('0x3c')],{'$or':_[_0x83bc('0x2d')](_0x1829ca,function(_0x32c5ac){if(_0x32c5ac['type']!==_0x83bc('0x40')){var _0x2137eb={};_0x2137eb[_0x32c5ac[_0x83bc('0x2a')]]={'$like':'%'+_0x15423f[_0x83bc('0x32')][_0x83bc('0x3e')]+'%'};return _0x2137eb;}})});}_0x1b9c8f=_['merge']({},_0x1b9c8f,_0x15423f[_0x83bc('0x41')]);var _0x55f350={'where':_0x1b9c8f[_0x83bc('0x3c')]};return db['MailServerOut'][_0x83bc('0x1e')](_0x55f350)['then'](function(_0xdd9bdb){_0x2fbdfd[_0x83bc('0x1e')]=_0xdd9bdb;if(_0x15423f[_0x83bc('0x32')][_0x83bc('0x42')]){_0x1b9c8f[_0x83bc('0x43')]=[{'all':!![]}];}return db[_0x83bc('0x44')][_0x83bc('0x45')](_0x1b9c8f);})[_0x83bc('0x27')](function(_0x391d64){_0x2fbdfd[_0x83bc('0x46')]=_0x391d64;return _0x2fbdfd;})[_0x83bc('0x27')](respondWithFilteredResult(_0x47414a,_0x1b9c8f))[_0x83bc('0x47')](handleError(_0x47414a,null));};exports[_0x83bc('0x48')]=function(_0x14df53,_0x594e72){var _0x14bd9e={'raw':!![],'where':{'id':_0x14df53[_0x83bc('0x49')]['id']}},_0x401802={};_0x401802[_0x83bc('0x31')]=_['keys'](db[_0x83bc('0x44')][_0x83bc('0x4a')]);_0x401802[_0x83bc('0x32')]=_[_0x83bc('0x33')](_0x14df53[_0x83bc('0x32')]);_0x401802[_0x83bc('0x34')]=_[_0x83bc('0x35')](_0x401802[_0x83bc('0x31')],_0x401802['query']);_0x14bd9e['attributes']=_[_0x83bc('0x35')](_0x401802['model'],qs[_0x83bc('0x37')](_0x14df53[_0x83bc('0x32')][_0x83bc('0x37')]));_0x14bd9e[_0x83bc('0x36')]=_0x14bd9e[_0x83bc('0x36')]['length']?_0x14bd9e[_0x83bc('0x36')]:_0x401802[_0x83bc('0x31')];if(_0x14df53[_0x83bc('0x32')][_0x83bc('0x42')]){_0x14bd9e['include']=[{'all':!![]}];}_0x14bd9e=_['merge']({},_0x14bd9e,_0x14df53[_0x83bc('0x41')]);return db[_0x83bc('0x44')]['find'](_0x14bd9e)[_0x83bc('0x27')](handleEntityNotFound(_0x594e72,null))[_0x83bc('0x27')](respondWithResult(_0x594e72,null))[_0x83bc('0x47')](handleError(_0x594e72,null));};exports[_0x83bc('0x4b')]=function(_0x4f0841,_0x1bc659){return db[_0x83bc('0x44')][_0x83bc('0x4b')](_0x4f0841[_0x83bc('0x4c')],{})[_0x83bc('0x27')](respondWithResult(_0x1bc659,0xc9))[_0x83bc('0x47')](handleError(_0x1bc659,null));};exports[_0x83bc('0x26')]=function(_0x537e74,_0x4e3bc1){if(_0x537e74[_0x83bc('0x4c')]['id']){delete _0x537e74['body']['id'];}return db[_0x83bc('0x44')][_0x83bc('0x4d')]({'where':{'id':_0x537e74['params']['id']}})['then'](handleEntityNotFound(_0x4e3bc1,null))[_0x83bc('0x27')](saveUpdates(_0x537e74[_0x83bc('0x4c')],null))[_0x83bc('0x27')](respondWithResult(_0x4e3bc1,null))['catch'](handleError(_0x4e3bc1,null));};exports[_0x83bc('0x4e')]=function(_0x4794a6,_0x3a7d6){return db[_0x83bc('0x44')]['find']({'where':{'id':_0x4794a6['params']['id']}})[_0x83bc('0x27')](handleEntityNotFound(_0x3a7d6,null))['then'](removeEntity(_0x3a7d6,null))['catch'](handleError(_0x3a7d6,null));}; \ No newline at end of file +var _0xc736=['send','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','MailServerOut','includeAll','include','rows','show','rawAttributes','catch','create','body','find','params','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','name'];(function(_0x80bf6a,_0x3beee2){var _0x1522f3=function(_0x97d91e){while(--_0x97d91e){_0x80bf6a['push'](_0x80bf6a['shift']());}};_0x1522f3(++_0x3beee2);}(_0xc736,0x18a));var _0x6c73=function(_0x3e038d,_0x24e5b1){_0x3e038d=_0x3e038d-0x0;var _0x193e27=_0xc736[_0x3e038d];return _0x193e27;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6c73('0x0'));var zipdir=require(_0x6c73('0x1'));var jsonpatch=require(_0x6c73('0x2'));var rp=require(_0x6c73('0x3'));var moment=require('moment');var BPromise=require(_0x6c73('0x4'));var Mustache=require('mustache');var util=require(_0x6c73('0x5'));var path=require(_0x6c73('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6c73('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6c73('0x8'));var squel=require(_0x6c73('0x9'));var crypto=require(_0x6c73('0xa'));var jsforce=require(_0x6c73('0xb'));var deskjs=require(_0x6c73('0xc'));var toCsv=require(_0x6c73('0xd'));var querystring=require(_0x6c73('0xe'));var Papa=require(_0x6c73('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6c73('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6c73('0x11'));var logger=require(_0x6c73('0x12'))('api');var utils=require(_0x6c73('0x13'));var config=require(_0x6c73('0x14'));var licenseUtil=require(_0x6c73('0x15'));var db=require(_0x6c73('0x16'))['db'];function respondWithStatusCode(_0x261888,_0x55efdf){_0x55efdf=_0x55efdf||0xcc;return function(_0x49144e){if(_0x49144e){return _0x261888['sendStatus'](_0x55efdf);}return _0x261888[_0x6c73('0x17')](_0x55efdf)[_0x6c73('0x18')]();};}function respondWithResult(_0x4aabcb,_0x223a29){_0x223a29=_0x223a29||0xc8;return function(_0x11ab06){if(_0x11ab06){return _0x4aabcb['status'](_0x223a29)[_0x6c73('0x19')](_0x11ab06);}};}function respondWithFilteredResult(_0x739889,_0x4afc28){return function(_0x13ae6e){if(_0x13ae6e){var _0x1fafec=typeof _0x4afc28[_0x6c73('0x1a')]==='undefined'&&typeof _0x4afc28[_0x6c73('0x1b')]==='undefined';var _0xe7e995=_0x13ae6e[_0x6c73('0x1c')];var _0x39ebd6=_0x1fafec?0x0:_0x4afc28[_0x6c73('0x1a')];var _0x125ed4=_0x1fafec?_0x13ae6e[_0x6c73('0x1c')]:_0x4afc28[_0x6c73('0x1a')]+_0x4afc28[_0x6c73('0x1b')];var _0x5977df;if(_0x125ed4>=_0xe7e995){_0x125ed4=_0xe7e995;_0x5977df=0xc8;}else{_0x5977df=0xce;}_0x739889[_0x6c73('0x17')](_0x5977df);return _0x739889[_0x6c73('0x1d')](_0x6c73('0x1e'),_0x39ebd6+'-'+_0x125ed4+'/'+_0xe7e995)[_0x6c73('0x19')](_0x13ae6e);}return null;};}function patchUpdates(_0x34f449){return function(_0x797030){try{jsonpatch[_0x6c73('0x1f')](_0x797030,_0x34f449,!![]);}catch(_0x2ac342){return BPromise[_0x6c73('0x20')](_0x2ac342);}return _0x797030['save']();};}function saveUpdates(_0x3094f2,_0xbfb91b){return function(_0x2fa098){if(_0x2fa098){return _0x2fa098[_0x6c73('0x21')](_0x3094f2)[_0x6c73('0x22')](function(_0x2756e2){return _0x2756e2;});}return null;};}function removeEntity(_0x1b5a05,_0x1cedc3){return function(_0xb6d119){if(_0xb6d119){return _0xb6d119[_0x6c73('0x23')]()[_0x6c73('0x22')](function(){_0x1b5a05[_0x6c73('0x17')](0xcc)[_0x6c73('0x18')]();});}};}function handleEntityNotFound(_0x1df750,_0x172cfa){return function(_0x488f0b){if(!_0x488f0b){_0x1df750['sendStatus'](0x194);}return _0x488f0b;};}function handleError(_0x10389c,_0x9bc9e4){_0x9bc9e4=_0x9bc9e4||0x1f4;return function(_0x3a60a0){logger[_0x6c73('0x24')](_0x3a60a0['stack']);if(_0x3a60a0[_0x6c73('0x25')]){delete _0x3a60a0[_0x6c73('0x25')];}_0x10389c['status'](_0x9bc9e4)[_0x6c73('0x26')](_0x3a60a0);};}exports[_0x6c73('0x27')]=function(_0x2a0090,_0x5127bc){var _0x56f45a={},_0x2af3c7={},_0x35b46b={'count':0x0,'rows':[]};var _0x567c0c=_[_0x6c73('0x28')](db['MailServerOut']['rawAttributes'],function(_0x33bc80){return{'name':_0x33bc80[_0x6c73('0x29')],'type':_0x33bc80[_0x6c73('0x2a')][_0x6c73('0x2b')]};});_0x2af3c7[_0x6c73('0x2c')]=_[_0x6c73('0x28')](_0x567c0c,_0x6c73('0x25'));_0x2af3c7[_0x6c73('0x2d')]=_[_0x6c73('0x2e')](_0x2a0090[_0x6c73('0x2d')]);_0x2af3c7[_0x6c73('0x2f')]=_[_0x6c73('0x30')](_0x2af3c7[_0x6c73('0x2c')],_0x2af3c7['query']);_0x56f45a[_0x6c73('0x31')]=_[_0x6c73('0x30')](_0x2af3c7['model'],qs[_0x6c73('0x32')](_0x2a0090[_0x6c73('0x2d')][_0x6c73('0x32')]));_0x56f45a[_0x6c73('0x31')]=_0x56f45a[_0x6c73('0x31')][_0x6c73('0x33')]?_0x56f45a['attributes']:_0x2af3c7['model'];if(!_0x2a0090[_0x6c73('0x2d')]['hasOwnProperty'](_0x6c73('0x34'))){_0x56f45a[_0x6c73('0x1b')]=qs[_0x6c73('0x1b')](_0x2a0090[_0x6c73('0x2d')][_0x6c73('0x1b')]);_0x56f45a[_0x6c73('0x1a')]=qs['offset'](_0x2a0090[_0x6c73('0x2d')][_0x6c73('0x1a')]);}_0x56f45a[_0x6c73('0x35')]=qs[_0x6c73('0x36')](_0x2a0090[_0x6c73('0x2d')][_0x6c73('0x36')]);_0x56f45a[_0x6c73('0x37')]=qs[_0x6c73('0x2f')](_[_0x6c73('0x38')](_0x2a0090['query'],_0x2af3c7[_0x6c73('0x2f')]),_0x567c0c);if(_0x2a0090[_0x6c73('0x2d')][_0x6c73('0x39')]){_0x56f45a[_0x6c73('0x37')]=_[_0x6c73('0x3a')](_0x56f45a[_0x6c73('0x37')],{'$or':_[_0x6c73('0x28')](_0x567c0c,function(_0x3957c4){if(_0x3957c4[_0x6c73('0x2a')]!==_0x6c73('0x3b')){var _0x5e10e3={};_0x5e10e3[_0x3957c4[_0x6c73('0x25')]]={'$like':'%'+_0x2a0090[_0x6c73('0x2d')][_0x6c73('0x39')]+'%'};return _0x5e10e3;}})});}_0x56f45a=_[_0x6c73('0x3a')]({},_0x56f45a,_0x2a0090[_0x6c73('0x3c')]);var _0x1f3d04={'where':_0x56f45a[_0x6c73('0x37')]};return db[_0x6c73('0x3d')][_0x6c73('0x1c')](_0x1f3d04)['then'](function(_0x370dcf){_0x35b46b[_0x6c73('0x1c')]=_0x370dcf;if(_0x2a0090['query'][_0x6c73('0x3e')]){_0x56f45a[_0x6c73('0x3f')]=[{'all':!![]}];}return db[_0x6c73('0x3d')]['findAll'](_0x56f45a);})[_0x6c73('0x22')](function(_0x450c64){_0x35b46b[_0x6c73('0x40')]=_0x450c64;return _0x35b46b;})['then'](respondWithFilteredResult(_0x5127bc,_0x56f45a))['catch'](handleError(_0x5127bc,null));};exports[_0x6c73('0x41')]=function(_0x4376ce,_0x51515c){var _0x8c5fb6={'raw':!![],'where':{'id':_0x4376ce['params']['id']}},_0x58168c={};_0x58168c[_0x6c73('0x2c')]=_[_0x6c73('0x2e')](db[_0x6c73('0x3d')][_0x6c73('0x42')]);_0x58168c[_0x6c73('0x2d')]=_[_0x6c73('0x2e')](_0x4376ce[_0x6c73('0x2d')]);_0x58168c[_0x6c73('0x2f')]=_[_0x6c73('0x30')](_0x58168c['model'],_0x58168c[_0x6c73('0x2d')]);_0x8c5fb6['attributes']=_[_0x6c73('0x30')](_0x58168c[_0x6c73('0x2c')],qs[_0x6c73('0x32')](_0x4376ce[_0x6c73('0x2d')]['fields']));_0x8c5fb6[_0x6c73('0x31')]=_0x8c5fb6[_0x6c73('0x31')]['length']?_0x8c5fb6['attributes']:_0x58168c[_0x6c73('0x2c')];if(_0x4376ce[_0x6c73('0x2d')]['includeAll']){_0x8c5fb6['include']=[{'all':!![]}];}_0x8c5fb6=_['merge']({},_0x8c5fb6,_0x4376ce[_0x6c73('0x3c')]);return db[_0x6c73('0x3d')]['find'](_0x8c5fb6)[_0x6c73('0x22')](handleEntityNotFound(_0x51515c,null))[_0x6c73('0x22')](respondWithResult(_0x51515c,null))[_0x6c73('0x43')](handleError(_0x51515c,null));};exports[_0x6c73('0x44')]=function(_0x514716,_0x3d00bc){return db[_0x6c73('0x3d')][_0x6c73('0x44')](_0x514716['body'],{})[_0x6c73('0x22')](respondWithResult(_0x3d00bc,0xc9))[_0x6c73('0x43')](handleError(_0x3d00bc,null));};exports[_0x6c73('0x21')]=function(_0x39723b,_0x2cb7fe){if(_0x39723b['body']['id']){delete _0x39723b[_0x6c73('0x45')]['id'];}return db['MailServerOut'][_0x6c73('0x46')]({'where':{'id':_0x39723b[_0x6c73('0x47')]['id']}})[_0x6c73('0x22')](handleEntityNotFound(_0x2cb7fe,null))[_0x6c73('0x22')](saveUpdates(_0x39723b[_0x6c73('0x45')],null))['then'](respondWithResult(_0x2cb7fe,null))[_0x6c73('0x43')](handleError(_0x2cb7fe,null));};exports['destroy']=function(_0x429be3,_0x21885a){return db[_0x6c73('0x3d')][_0x6c73('0x46')]({'where':{'id':_0x429be3[_0x6c73('0x47')]['id']}})[_0x6c73('0x22')](handleEntityNotFound(_0x21885a,null))[_0x6c73('0x22')](removeEntity(_0x21885a,null))[_0x6c73('0x43')](handleError(_0x21885a,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 3919130..d9ea44b 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 _0x5128=['MailServerOut','mail_servers_out','lodash','util','../../config/logger','api','moment','bluebird','./mailServerOut.attributes','exports'];(function(_0x3c769d,_0x215272){var _0x1c19e2=function(_0x3ddc0d){while(--_0x3ddc0d){_0x3c769d['push'](_0x3c769d['shift']());}};_0x1c19e2(++_0x215272);}(_0x5128,0x7a));var _0x8512=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x5128[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x8512('0x0'));var util=require(_0x8512('0x1'));var logger=require(_0x8512('0x2'))(_0x8512('0x3'));var moment=require(_0x8512('0x4'));var BPromise=require(_0x8512('0x5'));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(_0x8512('0x6'));module[_0x8512('0x7')]=function(_0x2c3930,_0x3c7ddc){return _0x2c3930['define'](_0x8512('0x8'),attributes,{'tableName':_0x8512('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3a15=['../../config/environment','./mailServerOut.attributes','exports','define','MailServerOut','mail_servers_out','lodash','../../config/logger','api','moment','bluebird','path'];(function(_0x33a295,_0x203e88){var _0x117b21=function(_0x356c5d){while(--_0x356c5d){_0x33a295['push'](_0x33a295['shift']());}};_0x117b21(++_0x203e88);}(_0x3a15,0x19e));var _0x53a1=function(_0x4f90af,_0x14b70c){_0x4f90af=_0x4f90af-0x0;var _0x5e62c0=_0x3a15[_0x4f90af];return _0x5e62c0;};'use strict';var _=require(_0x53a1('0x0'));var util=require('util');var logger=require(_0x53a1('0x1'))(_0x53a1('0x2'));var moment=require(_0x53a1('0x3'));var BPromise=require(_0x53a1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x53a1('0x5'));var rimraf=require('rimraf');var config=require(_0x53a1('0x6'));var attributes=require(_0x53a1('0x7'));module[_0x53a1('0x8')]=function(_0x5cf82a,_0x176003){return _0x5cf82a[_0x53a1('0x9')](_0x53a1('0xa'),attributes,{'tableName':_0x53a1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.rpc.js b/server/api/mailServerOut/mailServerOut.rpc.js index 02a84a5..6399fc2 100644 --- a/server/api/mailServerOut/mailServerOut.rpc.js +++ b/server/api/mailServerOut/mailServerOut.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1261=['then','info','MailServerOut,\x20%s,\x20%s','request\x20sent','MailServerOut,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x58138c,_0x56f8e8){var _0x3145c6=function(_0xff68d9){while(--_0xff68d9){_0x58138c['push'](_0x58138c['shift']());}};_0x3145c6(++_0x56f8e8);}(_0x1261,0x144));var _0x1126=function(_0x26371f,_0x3529d6){_0x26371f=_0x26371f-0x0;var _0x7bf77f=_0x1261[_0x26371f];return _0x7bf77f;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('MailServerOut,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});} \ No newline at end of file +var _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x5392d7,_0x2bd841){var _0x272758=function(_0x1450a2){while(--_0x1450a2){_0x5392d7['push'](_0x5392d7['shift']());}};_0x272758(++_0x2bd841);}(_0xdb28,0x106));var _0x8db2=function(_0x13e4a3,_0x576e9b){_0x13e4a3=_0x13e4a3-0x0;var _0x26b079=_0xdb28[_0x13e4a3];return _0x26b079;};'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});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index bc71b1a..90645b0 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 _0x5063=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','index','describe','/:id','show','create','update','delete','exports'];(function(_0x58bfd0,_0x36ed2e){var _0x27cdf1=function(_0x2028f3){while(--_0x2028f3){_0x58bfd0['push'](_0x58bfd0['shift']());}};_0x27cdf1(++_0x36ed2e);}(_0x5063,0x140));var _0x3506=function(_0x5d04e4,_0x2d5dc6){_0x5d04e4=_0x5d04e4-0x0;var _0x375254=_0x5063[_0x5d04e4];return _0x375254;};'use strict';var multer=require(_0x3506('0x0'));var util=require(_0x3506('0x1'));var path=require(_0x3506('0x2'));var timeout=require(_0x3506('0x3'));var express=require(_0x3506('0x4'));var router=express[_0x3506('0x5')]();var fs_extra=require(_0x3506('0x6'));var auth=require(_0x3506('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x3506('0x8'));var controller=require(_0x3506('0x9'));router[_0x3506('0xa')]('/',auth[_0x3506('0xb')](),controller[_0x3506('0xc')]);router[_0x3506('0xa')]('/describe',auth[_0x3506('0xb')](),controller[_0x3506('0xd')]);router[_0x3506('0xa')](_0x3506('0xe'),auth[_0x3506('0xb')](),controller[_0x3506('0xf')]);router['post']('/',auth[_0x3506('0xb')](),controller[_0x3506('0x10')]);router['put'](_0x3506('0xe'),auth['isAuthenticated'](),controller[_0x3506('0x11')]);router[_0x3506('0x12')](_0x3506('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x3506('0x13')]=router; \ No newline at end of file +var _0x3384=['destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','create'];(function(_0x28b70a,_0x5a40c0){var _0x117957=function(_0x1f3d6d){while(--_0x1f3d6d){_0x28b70a['push'](_0x28b70a['shift']());}};_0x117957(++_0x5a40c0);}(_0x3384,0x12e));var _0x4338=function(_0x2160b9,_0x182473){_0x2160b9=_0x2160b9-0x0;var _0x4fdd91=_0x3384[_0x2160b9];return _0x4fdd91;};'use strict';var multer=require('multer');var util=require(_0x4338('0x0'));var path=require(_0x4338('0x1'));var timeout=require(_0x4338('0x2'));var express=require(_0x4338('0x3'));var router=express['Router']();var fs_extra=require(_0x4338('0x4'));var auth=require(_0x4338('0x5'));var interaction=require(_0x4338('0x6'));var config=require(_0x4338('0x7'));var controller=require(_0x4338('0x8'));router['get']('/',auth[_0x4338('0x9')](),controller[_0x4338('0xa')]);router[_0x4338('0xb')](_0x4338('0xc'),auth[_0x4338('0x9')](),controller[_0x4338('0xd')]);router[_0x4338('0xb')](_0x4338('0xe'),auth['isAuthenticated'](),controller[_0x4338('0xf')]);router[_0x4338('0x10')]('/',auth['isAuthenticated'](),controller[_0x4338('0x11')]);router['put'](_0x4338('0xe'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x4338('0x9')](),controller[_0x4338('0x12')]);module[_0x4338('0x13')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index 4979ec8..f263e62 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 _0x23f4=['exports','STRING'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0x23f4,0x1ee));var _0x423f=function(_0x5d1ad1,_0x29b4b5){_0x5d1ad1=_0x5d1ad1-0x0;var _0x120d77=_0x23f4[_0x5d1ad1];return _0x120d77;};'use strict';var Sequelize=require('sequelize');module[_0x423f('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x423f('0x1')]}}; \ No newline at end of file +var _0xcaf2=['sequelize','STRING','name'];(function(_0x59921d,_0x4f9082){var _0x5f36ae=function(_0x585d11){while(--_0x585d11){_0x59921d['push'](_0x59921d['shift']());}};_0x5f36ae(++_0x4f9082);}(_0xcaf2,0x8a));var _0x2caf=function(_0xf2628e,_0x521bf7){_0xf2628e=_0xf2628e-0x0;var _0x13863a=_0xcaf2[_0xf2628e];return _0x13863a;};'use strict';var Sequelize=require(_0x2caf('0x0'));module['exports']={'name':{'type':Sequelize[_0x2caf('0x1')],'unique':_0x2caf('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 4334e16..cdb6288 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 _0x4d36=['to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filter','merge','VIRTUAL','options','where','MailSubstatus','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','fs-extra','squel','desk.js'];(function(_0x44608d,_0x433d3b){var _0x56b5ab=function(_0xc0a782){while(--_0xc0a782){_0x44608d['push'](_0x44608d['shift']());}};_0x56b5ab(++_0x433d3b);}(_0x4d36,0x16b));var _0x64d3=function(_0x3817a9,_0x29e215){_0x3817a9=_0x3817a9-0x0;var _0x443f30=_0x4d36[_0x3817a9];return _0x443f30;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x64d3('0x0'));var zipdir=require(_0x64d3('0x1'));var jsonpatch=require(_0x64d3('0x2'));var rp=require(_0x64d3('0x3'));var moment=require(_0x64d3('0x4'));var BPromise=require(_0x64d3('0x5'));var Mustache=require('mustache');var util=require(_0x64d3('0x6'));var path=require(_0x64d3('0x7'));var sox=require(_0x64d3('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x64d3('0x9'));var _=require('lodash');var squel=require(_0x64d3('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x64d3('0xb'));var toCsv=require(_0x64d3('0xc'));var querystring=require('querystring');var Papa=require(_0x64d3('0xd'));var Redis=require(_0x64d3('0xe'));var authService=require(_0x64d3('0xf'));var qs=require(_0x64d3('0x10'));var as=require(_0x64d3('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x64d3('0x12'));var config=require(_0x64d3('0x13'));var licenseUtil=require(_0x64d3('0x14'));var db=require(_0x64d3('0x15'))['db'];function respondWithStatusCode(_0x439804,_0x1e2f7f){_0x1e2f7f=_0x1e2f7f||0xcc;return function(_0x59b31a){if(_0x59b31a){return _0x439804[_0x64d3('0x16')](_0x1e2f7f);}return _0x439804['status'](_0x1e2f7f)[_0x64d3('0x17')]();};}function respondWithResult(_0x45c50e,_0x5aa3db){_0x5aa3db=_0x5aa3db||0xc8;return function(_0x2da552){if(_0x2da552){return _0x45c50e[_0x64d3('0x18')](_0x5aa3db)[_0x64d3('0x19')](_0x2da552);}};}function respondWithFilteredResult(_0x5ce59b,_0xe4d9da){return function(_0x498019){if(_0x498019){var _0x3263b6=typeof _0xe4d9da[_0x64d3('0x1a')]===_0x64d3('0x1b')&&typeof _0xe4d9da[_0x64d3('0x1c')]===_0x64d3('0x1b');var _0x11856=_0x498019[_0x64d3('0x1d')];var _0x20248e=_0x3263b6?0x0:_0xe4d9da[_0x64d3('0x1a')];var _0x4b2f68=_0x3263b6?_0x498019[_0x64d3('0x1d')]:_0xe4d9da[_0x64d3('0x1a')]+_0xe4d9da[_0x64d3('0x1c')];var _0x24f408;if(_0x4b2f68>=_0x11856){_0x4b2f68=_0x11856;_0x24f408=0xc8;}else{_0x24f408=0xce;}_0x5ce59b[_0x64d3('0x18')](_0x24f408);return _0x5ce59b['set'](_0x64d3('0x1e'),_0x20248e+'-'+_0x4b2f68+'/'+_0x11856)[_0x64d3('0x19')](_0x498019);}return null;};}function patchUpdates(_0x269473){return function(_0x11427b){try{jsonpatch[_0x64d3('0x1f')](_0x11427b,_0x269473,!![]);}catch(_0x8a0f8d){return BPromise['reject'](_0x8a0f8d);}return _0x11427b[_0x64d3('0x20')]();};}function saveUpdates(_0x5c324a,_0x2f4644){return function(_0x1b584d){if(_0x1b584d){return _0x1b584d[_0x64d3('0x21')](_0x5c324a)[_0x64d3('0x22')](function(_0x4f0dae){return _0x4f0dae;});}return null;};}function removeEntity(_0x5666d9,_0x1359e6){return function(_0x55cbf7){if(_0x55cbf7){return _0x55cbf7['destroy']()['then'](function(){_0x5666d9[_0x64d3('0x18')](0xcc)[_0x64d3('0x17')]();});}};}function handleEntityNotFound(_0x18eb16,_0x1bdc5a){return function(_0x503a37){if(!_0x503a37){_0x18eb16['sendStatus'](0x194);}return _0x503a37;};}function handleError(_0x4ee29b,_0x516d84){_0x516d84=_0x516d84||0x1f4;return function(_0x13d13c){logger[_0x64d3('0x23')](_0x13d13c[_0x64d3('0x24')]);if(_0x13d13c[_0x64d3('0x25')]){delete _0x13d13c[_0x64d3('0x25')];}_0x4ee29b[_0x64d3('0x18')](_0x516d84)[_0x64d3('0x26')](_0x13d13c);};}exports[_0x64d3('0x27')]=function(_0x139632,_0x6f5e19){var _0x3e5676={},_0x550939={},_0x52fc0e={'count':0x0,'rows':[]};var _0x189f35=_[_0x64d3('0x28')](db['MailSubstatus'][_0x64d3('0x29')],function(_0x4926cf){return{'name':_0x4926cf[_0x64d3('0x2a')],'type':_0x4926cf[_0x64d3('0x2b')][_0x64d3('0x2c')]};});_0x550939[_0x64d3('0x2d')]=_[_0x64d3('0x28')](_0x189f35,_0x64d3('0x25'));_0x550939['query']=_[_0x64d3('0x2e')](_0x139632['query']);_0x550939[_0x64d3('0x2f')]=_['intersection'](_0x550939[_0x64d3('0x2d')],_0x550939[_0x64d3('0x30')]);_0x3e5676[_0x64d3('0x31')]=_[_0x64d3('0x32')](_0x550939[_0x64d3('0x2d')],qs['fields'](_0x139632['query'][_0x64d3('0x33')]));_0x3e5676[_0x64d3('0x31')]=_0x3e5676[_0x64d3('0x31')][_0x64d3('0x34')]?_0x3e5676['attributes']:_0x550939[_0x64d3('0x2d')];if(!_0x139632[_0x64d3('0x30')][_0x64d3('0x35')](_0x64d3('0x36'))){_0x3e5676[_0x64d3('0x1c')]=qs[_0x64d3('0x1c')](_0x139632[_0x64d3('0x30')][_0x64d3('0x1c')]);_0x3e5676[_0x64d3('0x1a')]=qs[_0x64d3('0x1a')](_0x139632['query'][_0x64d3('0x1a')]);}_0x3e5676[_0x64d3('0x37')]=qs[_0x64d3('0x38')](_0x139632[_0x64d3('0x30')][_0x64d3('0x38')]);_0x3e5676['where']=qs['filters'](_['pick'](_0x139632['query'],_0x550939[_0x64d3('0x2f')]),_0x189f35);if(_0x139632['query'][_0x64d3('0x39')]){_0x3e5676['where']=_[_0x64d3('0x3a')](_0x3e5676['where'],{'$or':_[_0x64d3('0x28')](_0x189f35,function(_0x36e93b){if(_0x36e93b[_0x64d3('0x2b')]!==_0x64d3('0x3b')){var _0x4f2adb={};_0x4f2adb[_0x36e93b[_0x64d3('0x25')]]={'$like':'%'+_0x139632[_0x64d3('0x30')]['filter']+'%'};return _0x4f2adb;}})});}_0x3e5676=_['merge']({},_0x3e5676,_0x139632[_0x64d3('0x3c')]);var _0x5a6fdb={'where':_0x3e5676[_0x64d3('0x3d')]};return db[_0x64d3('0x3e')][_0x64d3('0x1d')](_0x5a6fdb)['then'](function(_0x336750){_0x52fc0e[_0x64d3('0x1d')]=_0x336750;if(_0x139632['query'][_0x64d3('0x3f')]){_0x3e5676[_0x64d3('0x40')]=[{'all':!![]}];}return db[_0x64d3('0x3e')][_0x64d3('0x41')](_0x3e5676);})[_0x64d3('0x22')](function(_0x4053fb){_0x52fc0e[_0x64d3('0x42')]=_0x4053fb;return _0x52fc0e;})['then'](respondWithFilteredResult(_0x6f5e19,_0x3e5676))[_0x64d3('0x43')](handleError(_0x6f5e19,null));};exports[_0x64d3('0x44')]=function(_0xfe42db,_0x1490a6){var _0x290d29={'raw':!![],'where':{'id':_0xfe42db[_0x64d3('0x45')]['id']}},_0x420d21={};_0x420d21['model']=_[_0x64d3('0x2e')](db[_0x64d3('0x3e')][_0x64d3('0x29')]);_0x420d21['query']=_[_0x64d3('0x2e')](_0xfe42db['query']);_0x420d21[_0x64d3('0x2f')]=_[_0x64d3('0x32')](_0x420d21[_0x64d3('0x2d')],_0x420d21[_0x64d3('0x30')]);_0x290d29[_0x64d3('0x31')]=_[_0x64d3('0x32')](_0x420d21[_0x64d3('0x2d')],qs['fields'](_0xfe42db[_0x64d3('0x30')][_0x64d3('0x33')]));_0x290d29[_0x64d3('0x31')]=_0x290d29['attributes'][_0x64d3('0x34')]?_0x290d29[_0x64d3('0x31')]:_0x420d21[_0x64d3('0x2d')];if(_0xfe42db[_0x64d3('0x30')][_0x64d3('0x3f')]){_0x290d29[_0x64d3('0x40')]=[{'all':!![]}];}_0x290d29=_[_0x64d3('0x3a')]({},_0x290d29,_0xfe42db['options']);return db[_0x64d3('0x3e')][_0x64d3('0x46')](_0x290d29)['then'](handleEntityNotFound(_0x1490a6,null))[_0x64d3('0x22')](respondWithResult(_0x1490a6,null))['catch'](handleError(_0x1490a6,null));};exports[_0x64d3('0x47')]=function(_0x5339b5,_0x315a8d){return db['MailSubstatus'][_0x64d3('0x47')](_0x5339b5[_0x64d3('0x48')],{})[_0x64d3('0x22')](respondWithResult(_0x315a8d,0xc9))['catch'](handleError(_0x315a8d,null));};exports['update']=function(_0x1a4e79,_0x359cc1){if(_0x1a4e79[_0x64d3('0x48')]['id']){delete _0x1a4e79['body']['id'];}return db[_0x64d3('0x3e')][_0x64d3('0x46')]({'where':{'id':_0x1a4e79[_0x64d3('0x45')]['id']}})[_0x64d3('0x22')](handleEntityNotFound(_0x359cc1,null))[_0x64d3('0x22')](saveUpdates(_0x1a4e79['body'],null))[_0x64d3('0x22')](respondWithResult(_0x359cc1,null))[_0x64d3('0x43')](handleError(_0x359cc1,null));};exports[_0x64d3('0x49')]=function(_0xc90588,_0x23e1a0){return db[_0x64d3('0x3e')][_0x64d3('0x46')]({'where':{'id':_0xc90588[_0x64d3('0x45')]['id']}})['then'](handleEntityNotFound(_0x23e1a0,null))['then'](removeEntity(_0x23e1a0,null))[_0x64d3('0x43')](handleError(_0x23e1a0,null));};exports['describe']=function(_0x260af0,_0x701693){return db[_0x64d3('0x3e')][_0x64d3('0x4a')]()[_0x64d3('0x22')](respondWithResult(_0x701693,null))[_0x64d3('0x43')](handleError(_0x701693,null));}; \ No newline at end of file +var _0x2a28=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','stack','send','index','rawAttributes','fieldName','type','model','map','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','MailSubstatus','include','rows','catch','params','find','create','body','update','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring'];(function(_0x39630a,_0x391ee1){var _0x46e078=function(_0x419ca5){while(--_0x419ca5){_0x39630a['push'](_0x39630a['shift']());}};_0x46e078(++_0x391ee1);}(_0x2a28,0x89));var _0x82a2=function(_0x557023,_0x18ce5e){_0x557023=_0x557023-0x0;var _0x559f5e=_0x2a28[_0x557023];return _0x559f5e;};'use strict';var emlformat=require(_0x82a2('0x0'));var rimraf=require(_0x82a2('0x1'));var zipdir=require(_0x82a2('0x2'));var jsonpatch=require(_0x82a2('0x3'));var rp=require(_0x82a2('0x4'));var moment=require('moment');var BPromise=require(_0x82a2('0x5'));var Mustache=require(_0x82a2('0x6'));var util=require('util');var path=require(_0x82a2('0x7'));var sox=require(_0x82a2('0x8'));var csv=require(_0x82a2('0x9'));var ejs=require(_0x82a2('0xa'));var fs=require('fs');var fs_extra=require(_0x82a2('0xb'));var _=require(_0x82a2('0xc'));var squel=require(_0x82a2('0xd'));var crypto=require(_0x82a2('0xe'));var jsforce=require(_0x82a2('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x82a2('0x9'));var querystring=require(_0x82a2('0x10'));var Papa=require(_0x82a2('0x11'));var Redis=require(_0x82a2('0x12'));var authService=require(_0x82a2('0x13'));var qs=require(_0x82a2('0x14'));var as=require(_0x82a2('0x15'));var hardwareService=require(_0x82a2('0x16'));var logger=require(_0x82a2('0x17'))(_0x82a2('0x18'));var utils=require(_0x82a2('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x82a2('0x1a'));var db=require(_0x82a2('0x1b'))['db'];function respondWithStatusCode(_0x3a3cad,_0x547134){_0x547134=_0x547134||0xcc;return function(_0x27082d){if(_0x27082d){return _0x3a3cad[_0x82a2('0x1c')](_0x547134);}return _0x3a3cad[_0x82a2('0x1d')](_0x547134)['end']();};}function respondWithResult(_0x4fe555,_0x17b63c){_0x17b63c=_0x17b63c||0xc8;return function(_0x16184a){if(_0x16184a){return _0x4fe555[_0x82a2('0x1d')](_0x17b63c)[_0x82a2('0x1e')](_0x16184a);}};}function respondWithFilteredResult(_0x2e1950,_0x2247ae){return function(_0x3d71dd){if(_0x3d71dd){var _0x8c7a21=typeof _0x2247ae[_0x82a2('0x1f')]===_0x82a2('0x20')&&typeof _0x2247ae[_0x82a2('0x21')]===_0x82a2('0x20');var _0x272530=_0x3d71dd[_0x82a2('0x22')];var _0x800683=_0x8c7a21?0x0:_0x2247ae[_0x82a2('0x1f')];var _0x1604ca=_0x8c7a21?_0x3d71dd[_0x82a2('0x22')]:_0x2247ae['offset']+_0x2247ae[_0x82a2('0x21')];var _0x3b6bc0;if(_0x1604ca>=_0x272530){_0x1604ca=_0x272530;_0x3b6bc0=0xc8;}else{_0x3b6bc0=0xce;}_0x2e1950['status'](_0x3b6bc0);return _0x2e1950[_0x82a2('0x23')](_0x82a2('0x24'),_0x800683+'-'+_0x1604ca+'/'+_0x272530)[_0x82a2('0x1e')](_0x3d71dd);}return null;};}function patchUpdates(_0x5ab538){return function(_0x312f0e){try{jsonpatch[_0x82a2('0x25')](_0x312f0e,_0x5ab538,!![]);}catch(_0x4daa84){return BPromise['reject'](_0x4daa84);}return _0x312f0e[_0x82a2('0x26')]();};}function saveUpdates(_0x53dcea,_0x4de497){return function(_0xf78be8){if(_0xf78be8){return _0xf78be8['update'](_0x53dcea)[_0x82a2('0x27')](function(_0x356f21){return _0x356f21;});}return null;};}function removeEntity(_0x3a4e86,_0x7ae9d4){return function(_0x394922){if(_0x394922){return _0x394922['destroy']()[_0x82a2('0x27')](function(){_0x3a4e86[_0x82a2('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d6d30,_0x25b8a9){return function(_0x1df339){if(!_0x1df339){_0x2d6d30['sendStatus'](0x194);}return _0x1df339;};}function handleError(_0x189f45,_0x8c75a2){_0x8c75a2=_0x8c75a2||0x1f4;return function(_0x23a69e){logger['error'](_0x23a69e[_0x82a2('0x28')]);if(_0x23a69e['name']){delete _0x23a69e['name'];}_0x189f45[_0x82a2('0x1d')](_0x8c75a2)[_0x82a2('0x29')](_0x23a69e);};}exports[_0x82a2('0x2a')]=function(_0x4b3f52,_0x53b134){var _0x864e1d={},_0x26da3d={},_0x264a8a={'count':0x0,'rows':[]};var _0x11e880=_['map'](db['MailSubstatus'][_0x82a2('0x2b')],function(_0x228071){return{'name':_0x228071[_0x82a2('0x2c')],'type':_0x228071[_0x82a2('0x2d')]['key']};});_0x26da3d[_0x82a2('0x2e')]=_[_0x82a2('0x2f')](_0x11e880,_0x82a2('0x30'));_0x26da3d[_0x82a2('0x31')]=_[_0x82a2('0x32')](_0x4b3f52[_0x82a2('0x31')]);_0x26da3d[_0x82a2('0x33')]=_[_0x82a2('0x34')](_0x26da3d[_0x82a2('0x2e')],_0x26da3d[_0x82a2('0x31')]);_0x864e1d[_0x82a2('0x35')]=_['intersection'](_0x26da3d['model'],qs[_0x82a2('0x36')](_0x4b3f52[_0x82a2('0x31')][_0x82a2('0x36')]));_0x864e1d['attributes']=_0x864e1d['attributes'][_0x82a2('0x37')]?_0x864e1d[_0x82a2('0x35')]:_0x26da3d[_0x82a2('0x2e')];if(!_0x4b3f52[_0x82a2('0x31')][_0x82a2('0x38')](_0x82a2('0x39'))){_0x864e1d[_0x82a2('0x21')]=qs[_0x82a2('0x21')](_0x4b3f52[_0x82a2('0x31')][_0x82a2('0x21')]);_0x864e1d[_0x82a2('0x1f')]=qs[_0x82a2('0x1f')](_0x4b3f52[_0x82a2('0x31')][_0x82a2('0x1f')]);}_0x864e1d[_0x82a2('0x3a')]=qs[_0x82a2('0x3b')](_0x4b3f52['query'][_0x82a2('0x3b')]);_0x864e1d[_0x82a2('0x3c')]=qs[_0x82a2('0x33')](_[_0x82a2('0x3d')](_0x4b3f52['query'],_0x26da3d[_0x82a2('0x33')]),_0x11e880);if(_0x4b3f52['query'][_0x82a2('0x3e')]){_0x864e1d['where']=_['merge'](_0x864e1d[_0x82a2('0x3c')],{'$or':_[_0x82a2('0x2f')](_0x11e880,function(_0x52c365){if(_0x52c365[_0x82a2('0x2d')]!==_0x82a2('0x3f')){var _0x15d4fc={};_0x15d4fc[_0x52c365[_0x82a2('0x30')]]={'$like':'%'+_0x4b3f52[_0x82a2('0x31')][_0x82a2('0x3e')]+'%'};return _0x15d4fc;}})});}_0x864e1d=_[_0x82a2('0x40')]({},_0x864e1d,_0x4b3f52[_0x82a2('0x41')]);var _0x3a0b30={'where':_0x864e1d[_0x82a2('0x3c')]};return db[_0x82a2('0x42')][_0x82a2('0x22')](_0x3a0b30)[_0x82a2('0x27')](function(_0x5d7dff){_0x264a8a[_0x82a2('0x22')]=_0x5d7dff;if(_0x4b3f52['query']['includeAll']){_0x864e1d[_0x82a2('0x43')]=[{'all':!![]}];}return db['MailSubstatus']['findAll'](_0x864e1d);})['then'](function(_0x129c28){_0x264a8a[_0x82a2('0x44')]=_0x129c28;return _0x264a8a;})[_0x82a2('0x27')](respondWithFilteredResult(_0x53b134,_0x864e1d))[_0x82a2('0x45')](handleError(_0x53b134,null));};exports['show']=function(_0x33ad78,_0x15c49b){var _0x3c9a37={'raw':!![],'where':{'id':_0x33ad78[_0x82a2('0x46')]['id']}},_0x6d7bd3={};_0x6d7bd3[_0x82a2('0x2e')]=_['keys'](db['MailSubstatus'][_0x82a2('0x2b')]);_0x6d7bd3[_0x82a2('0x31')]=_[_0x82a2('0x32')](_0x33ad78['query']);_0x6d7bd3['filters']=_[_0x82a2('0x34')](_0x6d7bd3['model'],_0x6d7bd3[_0x82a2('0x31')]);_0x3c9a37['attributes']=_[_0x82a2('0x34')](_0x6d7bd3[_0x82a2('0x2e')],qs[_0x82a2('0x36')](_0x33ad78[_0x82a2('0x31')]['fields']));_0x3c9a37['attributes']=_0x3c9a37[_0x82a2('0x35')]['length']?_0x3c9a37[_0x82a2('0x35')]:_0x6d7bd3[_0x82a2('0x2e')];if(_0x33ad78[_0x82a2('0x31')]['includeAll']){_0x3c9a37['include']=[{'all':!![]}];}_0x3c9a37=_[_0x82a2('0x40')]({},_0x3c9a37,_0x33ad78[_0x82a2('0x41')]);return db['MailSubstatus'][_0x82a2('0x47')](_0x3c9a37)[_0x82a2('0x27')](handleEntityNotFound(_0x15c49b,null))['then'](respondWithResult(_0x15c49b,null))[_0x82a2('0x45')](handleError(_0x15c49b,null));};exports['create']=function(_0x5d501a,_0x5bc307){return db['MailSubstatus'][_0x82a2('0x48')](_0x5d501a[_0x82a2('0x49')],{})[_0x82a2('0x27')](respondWithResult(_0x5bc307,0xc9))[_0x82a2('0x45')](handleError(_0x5bc307,null));};exports[_0x82a2('0x4a')]=function(_0x3b50af,_0x2f2a9b){if(_0x3b50af[_0x82a2('0x49')]['id']){delete _0x3b50af[_0x82a2('0x49')]['id'];}return db['MailSubstatus']['find']({'where':{'id':_0x3b50af['params']['id']}})[_0x82a2('0x27')](handleEntityNotFound(_0x2f2a9b,null))[_0x82a2('0x27')](saveUpdates(_0x3b50af[_0x82a2('0x49')],null))[_0x82a2('0x27')](respondWithResult(_0x2f2a9b,null))[_0x82a2('0x45')](handleError(_0x2f2a9b,null));};exports[_0x82a2('0x4b')]=function(_0x287db7,_0x413494){return db[_0x82a2('0x42')]['find']({'where':{'id':_0x287db7[_0x82a2('0x46')]['id']}})['then'](handleEntityNotFound(_0x413494,null))['then'](removeEntity(_0x413494,null))[_0x82a2('0x45')](handleError(_0x413494,null));};exports[_0x82a2('0x4c')]=function(_0x5195a7,_0x44275f){return db[_0x82a2('0x42')][_0x82a2('0x4c')]()[_0x82a2('0x27')](respondWithResult(_0x44275f,null))[_0x82a2('0x45')](handleError(_0x44275f,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index e28d021..dc504ba 100644 --- a/server/api/mailSubstatus/mailSubstatus.events.js +++ b/server/api/mailSubstatus/mailSubstatus.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc813=['emit','hasOwnProperty','hook','events','../../mysqldb','MailSubstatus','setMaxListeners','update'];(function(_0x5f1617,_0x46277b){var _0x3af5da=function(_0x15b934){while(--_0x15b934){_0x5f1617['push'](_0x5f1617['shift']());}};_0x3af5da(++_0x46277b);}(_0xc813,0x17b));var _0x3c81=function(_0x414ff1,_0xf0462b){_0x414ff1=_0x414ff1-0x0;var _0x29c53f=_0xc813[_0x414ff1];return _0x29c53f;};'use strict';var EventEmitter=require(_0x3c81('0x0'));var MailSubstatus=require(_0x3c81('0x1'))['db'][_0x3c81('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x3c81('0x3')](0x0);var events={'afterUpdate':_0x3c81('0x4')};function emitEvent(_0x31ca0c){return function(_0x53497d,_0xb84c44,_0x446f72){MailSubstatusEvents[_0x3c81('0x5')](_0x31ca0c+':'+_0x53497d['id'],_0x53497d);MailSubstatusEvents[_0x3c81('0x5')](_0x31ca0c,_0x53497d);_0x446f72(null);};}for(var e in events){if(events[_0x3c81('0x6')](e)){var event=events[e];MailSubstatus[_0x3c81('0x7')](e,emitEvent(event));}}module['exports']=MailSubstatusEvents; \ No newline at end of file +var _0x922b=['exports','events','../../mysqldb','MailSubstatus','emit','hook'];(function(_0x578cee,_0x298f1d){var _0x40dfd3=function(_0x1f9019){while(--_0x1f9019){_0x578cee['push'](_0x578cee['shift']());}};_0x40dfd3(++_0x298f1d);}(_0x922b,0x1ab));var _0xb922=function(_0x58eda3,_0x3a5425){_0x58eda3=_0x58eda3-0x0;var _0x2b4377=_0x922b[_0x58eda3];return _0x2b4377;};'use strict';var EventEmitter=require(_0xb922('0x0'));var MailSubstatus=require(_0xb922('0x1'))['db'][_0xb922('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents['setMaxListeners'](0x0);var events={'afterUpdate':'update'};function emitEvent(_0x58aa80){return function(_0x65d90a,_0x3f2d75,_0x257f6c){MailSubstatusEvents[_0xb922('0x3')](_0x58aa80+':'+_0x65d90a['id'],_0x65d90a);MailSubstatusEvents[_0xb922('0x3')](_0x58aa80,_0x65d90a);_0x257f6c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailSubstatus[_0xb922('0x4')](e,emitEvent(event));}}module[_0xb922('0x5')]=MailSubstatusEvents; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index a3ba3aa..ba7b4b5 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 _0xae58=['update','name','mailSubstatus','_previousDataValues','then','catch','./mailSubstatus.attributes','exports','models','define','MailSubstatus','mail_substatuses','Condition'];(function(_0x5f0d13,_0x36a8af){var _0x3b1d84=function(_0x3b5a6c){while(--_0x3b5a6c){_0x5f0d13['push'](_0x5f0d13['shift']());}};_0x3b1d84(++_0x36a8af);}(_0xae58,0x1a6));var _0x8ae5=function(_0x42bdad,_0x12836c){_0x42bdad=_0x42bdad-0x0;var _0x122626=_0xae58[_0x42bdad];return _0x122626;};'use strict';var attributes=require(_0x8ae5('0x0'));module[_0x8ae5('0x1')]=function(_0x4a306a){var _0x35785a=_0x4a306a[_0x8ae5('0x2')];return _0x4a306a[_0x8ae5('0x3')](_0x8ae5('0x4'),attributes,{'tableName':_0x8ae5('0x5'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x1cd35a,_0x1a8629,_0x3dfdd8){return _0x35785a[_0x8ae5('0x6')][_0x8ae5('0x7')]({'value':_0x1cd35a[_0x8ae5('0x8')]},{'where':{'field':_0x8ae5('0x9'),'value':_0x1cd35a[_0x8ae5('0xa')][_0x8ae5('0x8')]}})[_0x8ae5('0xb')](function(){_0x3dfdd8();})[_0x8ae5('0xc')](function(_0x98cfb4){_0x3dfdd8(_0x98cfb4);});}}});}; \ No newline at end of file +var _0x6f26=['exports','models','define','mail_substatuses','update','name','mailSubstatus','then','catch'];(function(_0x4020a7,_0x136909){var _0x4f41dc=function(_0x51bb0f){while(--_0x51bb0f){_0x4020a7['push'](_0x4020a7['shift']());}};_0x4f41dc(++_0x136909);}(_0x6f26,0x144));var _0x66f2=function(_0xbe8102,_0x5b967f){_0xbe8102=_0xbe8102-0x0;var _0x1de5d0=_0x6f26[_0xbe8102];return _0x1de5d0;};'use strict';var attributes=require('./mailSubstatus.attributes');module[_0x66f2('0x0')]=function(_0x5822b8){var _0xb77c8=_0x5822b8[_0x66f2('0x1')];return _0x5822b8[_0x66f2('0x2')]('MailSubstatus',attributes,{'tableName':_0x66f2('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x18168a,_0x4bb502,_0x349b63){return _0xb77c8['Condition'][_0x66f2('0x4')]({'value':_0x18168a[_0x66f2('0x5')]},{'where':{'field':_0x66f2('0x6'),'value':_0x18168a['_previousDataValues'][_0x66f2('0x5')]}})[_0x66f2('0x7')](function(){_0x349b63();})[_0x66f2('0x8')](function(_0x33fda5){_0x349b63(_0x33fda5);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index e71b079..7daf49d 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 _0xe0ef=['rpc','../../config/environment','client','request','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x55b460,_0x497077){var _0x3ac537=function(_0xd709b3){while(--_0xd709b3){_0x55b460['push'](_0x55b460['shift']());}};_0x3ac537(++_0x497077);}(_0xe0ef,0x88));var _0xfe0e=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0xe0ef[_0x8c43de];return _0xa6591b;};'use strict';var _=require(_0xfe0e('0x0'));var util=require(_0xfe0e('0x1'));var moment=require(_0xfe0e('0x2'));var BPromise=require(_0xfe0e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfe0e('0x4'));var db=require(_0xfe0e('0x5'))['db'];var utils=require(_0xfe0e('0x6'));var logger=require(_0xfe0e('0x7'))(_0xfe0e('0x8'));var config=require(_0xfe0e('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xfe0e('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x597518,_0x4f04ab,_0x11b640){return new BPromise(function(_0x532d41,_0x77c8cb){return client[_0xfe0e('0xb')](_0x597518,_0x11b640)[_0xfe0e('0xc')](function(_0x5565f5){logger[_0xfe0e('0xd')](_0xfe0e('0xe'),_0x4f04ab,_0xfe0e('0xf'));logger[_0xfe0e('0x10')](_0xfe0e('0x11'),_0x4f04ab,'request\x20sent',JSON[_0xfe0e('0x12')](_0x5565f5));if(_0x5565f5[_0xfe0e('0x13')]){if(_0x5565f5['error'][_0xfe0e('0x14')]===0x1f4){logger[_0xfe0e('0x13')]('MailSubstatus,\x20%s,\x20%s',_0x4f04ab,_0x5565f5['error']['message']);return _0x77c8cb(_0x5565f5[_0xfe0e('0x13')][_0xfe0e('0x15')]);}logger[_0xfe0e('0x13')]('MailSubstatus,\x20%s,\x20%s',_0x4f04ab,_0x5565f5[_0xfe0e('0x13')][_0xfe0e('0x15')]);return _0x532d41(_0x5565f5[_0xfe0e('0x13')]['message']);}else{logger[_0xfe0e('0xd')](_0xfe0e('0xe'),_0x4f04ab,_0xfe0e('0xf'));_0x532d41(_0x5565f5[_0xfe0e('0x16')]['message']);}})[_0xfe0e('0x17')](function(_0x23e4d9){logger['error'](_0xfe0e('0xe'),_0x4f04ab,_0x23e4d9);_0x77c8cb(_0x23e4d9);});});} \ No newline at end of file +var _0xb708=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','then','MailSubstatus,\x20%s,\x20%s','request\x20sent','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','moment','randomstring'];(function(_0x1f1daf,_0x478566){var _0x176104=function(_0x22d1cf){while(--_0x22d1cf){_0x1f1daf['push'](_0x1f1daf['shift']());}};_0x176104(++_0x478566);}(_0xb708,0xe7));var _0x8b70=function(_0xb833b1,_0x1c3d3f){_0xb833b1=_0xb833b1-0x0;var _0x1ab87a=_0xb708[_0xb833b1];return _0x1ab87a;};'use strict';var _=require(_0x8b70('0x0'));var util=require('util');var moment=require(_0x8b70('0x1'));var BPromise=require('bluebird');var rs=require(_0x8b70('0x2'));var fs=require('fs');var Redis=require(_0x8b70('0x3'));var db=require(_0x8b70('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x8b70('0x5'))(_0x8b70('0x6'));var config=require(_0x8b70('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x8b70('0x8')][_0x8b70('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5228a9,_0x6eadce,_0x2552dd){return new BPromise(function(_0x7695f7,_0x3a36e4){return client['request'](_0x5228a9,_0x2552dd)[_0x8b70('0xa')](function(_0x4481b1){logger['info'](_0x8b70('0xb'),_0x6eadce,_0x8b70('0xc'));logger['debug'](_0x8b70('0xd'),_0x6eadce,'request\x20sent',JSON[_0x8b70('0xe')](_0x4481b1));if(_0x4481b1[_0x8b70('0xf')]){if(_0x4481b1[_0x8b70('0xf')]['code']===0x1f4){logger[_0x8b70('0xf')](_0x8b70('0xb'),_0x6eadce,_0x4481b1['error']['message']);return _0x3a36e4(_0x4481b1[_0x8b70('0xf')]['message']);}logger[_0x8b70('0xf')](_0x8b70('0xb'),_0x6eadce,_0x4481b1['error'][_0x8b70('0x10')]);return _0x7695f7(_0x4481b1[_0x8b70('0xf')][_0x8b70('0x10')]);}else{logger['info']('MailSubstatus,\x20%s,\x20%s',_0x6eadce,_0x8b70('0xc'));_0x7695f7(_0x4481b1['result'][_0x8b70('0x10')]);}})[_0x8b70('0x11')](function(_0x494d3e){logger[_0x8b70('0xf')](_0x8b70('0xb'),_0x6eadce,_0x494d3e);_0x3a36e4(_0x494d3e);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index d9684e6..4283607 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 _0xc5a2=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','isAuthenticated','get','/describe','describe','/:id','show','post','create','put','delete','exports'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0xc5a2,0xc6));var _0x2c5a=function(_0x38fd3f,_0x4f46a9){_0x38fd3f=_0x38fd3f-0x0;var _0x174742=_0xc5a2[_0x38fd3f];return _0x174742;};'use strict';var multer=require(_0x2c5a('0x0'));var util=require(_0x2c5a('0x1'));var path=require(_0x2c5a('0x2'));var timeout=require(_0x2c5a('0x3'));var express=require(_0x2c5a('0x4'));var router=express[_0x2c5a('0x5')]();var fs_extra=require(_0x2c5a('0x6'));var auth=require(_0x2c5a('0x7'));var interaction=require(_0x2c5a('0x8'));var config=require(_0x2c5a('0x9'));var controller=require(_0x2c5a('0xa'));router['get']('/',auth[_0x2c5a('0xb')](),controller['index']);router[_0x2c5a('0xc')](_0x2c5a('0xd'),auth[_0x2c5a('0xb')](),controller[_0x2c5a('0xe')]);router[_0x2c5a('0xc')](_0x2c5a('0xf'),auth['isAuthenticated'](),controller[_0x2c5a('0x10')]);router[_0x2c5a('0x11')]('/',auth[_0x2c5a('0xb')](),controller[_0x2c5a('0x12')]);router[_0x2c5a('0x13')](_0x2c5a('0xf'),auth[_0x2c5a('0xb')](),controller['update']);router[_0x2c5a('0x14')](_0x2c5a('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0x2c5a('0x15')]=router; \ No newline at end of file +var _0x9dd3=['exports','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./mailTransferReport.controller','index','get','/describe','isAuthenticated','post','create','put','/:id','delete'];(function(_0x4145c9,_0x5ca502){var _0x4a4b95=function(_0x79a9ca){while(--_0x79a9ca){_0x4145c9['push'](_0x4145c9['shift']());}};_0x4a4b95(++_0x5ca502);}(_0x9dd3,0x199));var _0x39dd=function(_0x2db3d3,_0x5dc096){_0x2db3d3=_0x2db3d3-0x0;var _0xf00dbd=_0x9dd3[_0x2db3d3];return _0xf00dbd;};'use strict';var multer=require('multer');var util=require(_0x39dd('0x0'));var path=require('path');var timeout=require(_0x39dd('0x1'));var express=require(_0x39dd('0x2'));var router=express[_0x39dd('0x3')]();var fs_extra=require(_0x39dd('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x39dd('0x5'));var config=require('../../config/environment');var controller=require(_0x39dd('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x39dd('0x7')]);router[_0x39dd('0x8')](_0x39dd('0x9'),auth[_0x39dd('0xa')](),controller['describe']);router[_0x39dd('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x39dd('0xb')]('/',auth[_0x39dd('0xa')](),controller[_0x39dd('0xc')]);router[_0x39dd('0xd')](_0x39dd('0xe'),auth[_0x39dd('0xa')](),controller['update']);router[_0x39dd('0xf')](_0x39dd('0xe'),auth[_0x39dd('0xa')](),controller['destroy']);module[_0x39dd('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 1b1b7f8..bca05cd 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 _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x53d3b0,_0x62aa42){var _0x44f608=function(_0x47f276){while(--_0x47f276){_0x53d3b0['push'](_0x53d3b0['shift']());}};_0x44f608(++_0x62aa42);}(_0x34e8,0x12c));var _0x834e=function(_0x51d1b2,_0x3e9029){_0x51d1b2=_0x51d1b2-0x0;var _0x261f6a=_0x34e8[_0x51d1b2];return _0x261f6a;};'use strict';var moment=require(_0x834e('0x0'));var Sequelize=require(_0x834e('0x1'));module[_0x834e('0x2')]={'uniqueid':{'type':Sequelize[_0x834e('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6')),'allowNull':![],'defaultValue':_0x834e('0x6')},'transferredAt':{'type':Sequelize[_0x834e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x834e('0x8')]}}; \ No newline at end of file +var _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x9f90a,_0x113a88){var _0x5629c2=function(_0x312406){while(--_0x312406){_0x9f90a['push'](_0x9f90a['shift']());}};_0x5629c2(++_0x113a88);}(_0xf4eb,0xec));var _0xbf4e=function(_0xb4e844,_0x5ea9bc){_0xb4e844=_0xb4e844-0x0;var _0x5a786b=_0xf4eb[_0xb4e844];return _0x5a786b;};'use strict';var moment=require(_0xbf4e('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbf4e('0x1'),'agent','queue'),'allowNull':![],'defaultValue':_0xbf4e('0x2')},'transferredAt':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xbf4e('0x4')]}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index 2772a4a..71a1e2a 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 _0x8378=['nolimit','order','sort','where','pick','filter','VIRTUAL','merge','count','includeAll','include','findAll','rows','catch','rawAttributes','find','create','body','destroy','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','then','error','stack','name','index','map','MailTransferReport','fieldName','type','model','query','keys','filters','intersection','attributes','fields'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8378,0xa9));var _0x8837=function(_0xa890a2,_0x7d10d9){_0xa890a2=_0xa890a2-0x0;var _0x11b100=_0x8378[_0xa890a2];return _0x11b100;};'use strict';var emlformat=require(_0x8837('0x0'));var rimraf=require(_0x8837('0x1'));var zipdir=require(_0x8837('0x2'));var jsonpatch=require(_0x8837('0x3'));var rp=require(_0x8837('0x4'));var moment=require(_0x8837('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8837('0x6'));var path=require(_0x8837('0x7'));var sox=require(_0x8837('0x8'));var csv=require('to-csv');var ejs=require(_0x8837('0x9'));var fs=require('fs');var fs_extra=require(_0x8837('0xa'));var _=require(_0x8837('0xb'));var squel=require(_0x8837('0xc'));var crypto=require(_0x8837('0xd'));var jsforce=require(_0x8837('0xe'));var deskjs=require(_0x8837('0xf'));var toCsv=require(_0x8837('0x10'));var querystring=require(_0x8837('0x11'));var Papa=require(_0x8837('0x12'));var Redis=require(_0x8837('0x13'));var authService=require(_0x8837('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x8837('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8837('0x16'))('api');var utils=require(_0x8837('0x17'));var config=require(_0x8837('0x18'));var licenseUtil=require(_0x8837('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xb48edf,_0x33b4a4){_0x33b4a4=_0x33b4a4||0xcc;return function(_0x6cf1e0){if(_0x6cf1e0){return _0xb48edf[_0x8837('0x1a')](_0x33b4a4);}return _0xb48edf[_0x8837('0x1b')](_0x33b4a4)[_0x8837('0x1c')]();};}function respondWithResult(_0x27343e,_0x46fa2e){_0x46fa2e=_0x46fa2e||0xc8;return function(_0x1e23d9){if(_0x1e23d9){return _0x27343e['status'](_0x46fa2e)[_0x8837('0x1d')](_0x1e23d9);}};}function respondWithFilteredResult(_0x172344,_0x5044c9){return function(_0x5352c8){if(_0x5352c8){var _0x9635da=typeof _0x5044c9[_0x8837('0x1e')]==='undefined'&&typeof _0x5044c9['limit']==='undefined';var _0xa37e81=_0x5352c8['count'];var _0x41e76f=_0x9635da?0x0:_0x5044c9[_0x8837('0x1e')];var _0x233730=_0x9635da?_0x5352c8['count']:_0x5044c9[_0x8837('0x1e')]+_0x5044c9[_0x8837('0x1f')];var _0x42ed6d;if(_0x233730>=_0xa37e81){_0x233730=_0xa37e81;_0x42ed6d=0xc8;}else{_0x42ed6d=0xce;}_0x172344[_0x8837('0x1b')](_0x42ed6d);return _0x172344[_0x8837('0x20')](_0x8837('0x21'),_0x41e76f+'-'+_0x233730+'/'+_0xa37e81)['json'](_0x5352c8);}return null;};}function patchUpdates(_0x322e1a){return function(_0x3eaa00){try{jsonpatch[_0x8837('0x22')](_0x3eaa00,_0x322e1a,!![]);}catch(_0x2a1a56){return BPromise[_0x8837('0x23')](_0x2a1a56);}return _0x3eaa00[_0x8837('0x24')]();};}function saveUpdates(_0x1d239c,_0x2769b0){return function(_0x3e8e21){if(_0x3e8e21){return _0x3e8e21['update'](_0x1d239c)['then'](function(_0x14b491){return _0x14b491;});}return null;};}function removeEntity(_0x5ef46f,_0x577f5a){return function(_0x482a17){if(_0x482a17){return _0x482a17['destroy']()[_0x8837('0x25')](function(){_0x5ef46f[_0x8837('0x1b')](0xcc)[_0x8837('0x1c')]();});}};}function handleEntityNotFound(_0x270d20,_0x22f3e4){return function(_0x5c36fd){if(!_0x5c36fd){_0x270d20['sendStatus'](0x194);}return _0x5c36fd;};}function handleError(_0x8c703c,_0x108fb3){_0x108fb3=_0x108fb3||0x1f4;return function(_0x270be6){logger[_0x8837('0x26')](_0x270be6[_0x8837('0x27')]);if(_0x270be6[_0x8837('0x28')]){delete _0x270be6['name'];}_0x8c703c[_0x8837('0x1b')](_0x108fb3)['send'](_0x270be6);};}exports[_0x8837('0x29')]=function(_0x5c1800,_0x34fb0e){var _0xadf48c={},_0x731c8d={},_0x4c9b26={'count':0x0,'rows':[]};var _0x4d512d=_[_0x8837('0x2a')](db[_0x8837('0x2b')]['rawAttributes'],function(_0x515501){return{'name':_0x515501[_0x8837('0x2c')],'type':_0x515501[_0x8837('0x2d')]['key']};});_0x731c8d[_0x8837('0x2e')]=_[_0x8837('0x2a')](_0x4d512d,_0x8837('0x28'));_0x731c8d[_0x8837('0x2f')]=_[_0x8837('0x30')](_0x5c1800['query']);_0x731c8d[_0x8837('0x31')]=_[_0x8837('0x32')](_0x731c8d[_0x8837('0x2e')],_0x731c8d[_0x8837('0x2f')]);_0xadf48c[_0x8837('0x33')]=_[_0x8837('0x32')](_0x731c8d[_0x8837('0x2e')],qs[_0x8837('0x34')](_0x5c1800['query'][_0x8837('0x34')]));_0xadf48c[_0x8837('0x33')]=_0xadf48c[_0x8837('0x33')]['length']?_0xadf48c[_0x8837('0x33')]:_0x731c8d[_0x8837('0x2e')];if(!_0x5c1800['query']['hasOwnProperty'](_0x8837('0x35'))){_0xadf48c[_0x8837('0x1f')]=qs[_0x8837('0x1f')](_0x5c1800[_0x8837('0x2f')][_0x8837('0x1f')]);_0xadf48c[_0x8837('0x1e')]=qs[_0x8837('0x1e')](_0x5c1800[_0x8837('0x2f')][_0x8837('0x1e')]);}_0xadf48c[_0x8837('0x36')]=qs[_0x8837('0x37')](_0x5c1800[_0x8837('0x2f')][_0x8837('0x37')]);_0xadf48c[_0x8837('0x38')]=qs[_0x8837('0x31')](_[_0x8837('0x39')](_0x5c1800[_0x8837('0x2f')],_0x731c8d[_0x8837('0x31')]),_0x4d512d);if(_0x5c1800[_0x8837('0x2f')][_0x8837('0x3a')]){_0xadf48c[_0x8837('0x38')]=_['merge'](_0xadf48c['where'],{'$or':_['map'](_0x4d512d,function(_0x2a2208){if(_0x2a2208[_0x8837('0x2d')]!==_0x8837('0x3b')){var _0x4517f9={};_0x4517f9[_0x2a2208['name']]={'$like':'%'+_0x5c1800['query'][_0x8837('0x3a')]+'%'};return _0x4517f9;}})});}_0xadf48c=_[_0x8837('0x3c')]({},_0xadf48c,_0x5c1800['options']);var _0x55ecd1={'where':_0xadf48c[_0x8837('0x38')]};return db['MailTransferReport'][_0x8837('0x3d')](_0x55ecd1)[_0x8837('0x25')](function(_0x4647a6){_0x4c9b26['count']=_0x4647a6;if(_0x5c1800['query'][_0x8837('0x3e')]){_0xadf48c[_0x8837('0x3f')]=[{'all':!![]}];}return db['MailTransferReport'][_0x8837('0x40')](_0xadf48c);})[_0x8837('0x25')](function(_0xc33b50){_0x4c9b26[_0x8837('0x41')]=_0xc33b50;return _0x4c9b26;})[_0x8837('0x25')](respondWithFilteredResult(_0x34fb0e,_0xadf48c))[_0x8837('0x42')](handleError(_0x34fb0e,null));};exports['show']=function(_0x4bd662,_0x37fd84){var _0x4f81d5={'raw':!![],'where':{'id':_0x4bd662['params']['id']}},_0x549f80={};_0x549f80[_0x8837('0x2e')]=_[_0x8837('0x30')](db['MailTransferReport'][_0x8837('0x43')]);_0x549f80[_0x8837('0x2f')]=_[_0x8837('0x30')](_0x4bd662[_0x8837('0x2f')]);_0x549f80[_0x8837('0x31')]=_['intersection'](_0x549f80[_0x8837('0x2e')],_0x549f80['query']);_0x4f81d5[_0x8837('0x33')]=_['intersection'](_0x549f80[_0x8837('0x2e')],qs[_0x8837('0x34')](_0x4bd662[_0x8837('0x2f')][_0x8837('0x34')]));_0x4f81d5[_0x8837('0x33')]=_0x4f81d5[_0x8837('0x33')]['length']?_0x4f81d5[_0x8837('0x33')]:_0x549f80['model'];if(_0x4bd662['query']['includeAll']){_0x4f81d5[_0x8837('0x3f')]=[{'all':!![]}];}_0x4f81d5=_[_0x8837('0x3c')]({},_0x4f81d5,_0x4bd662['options']);return db[_0x8837('0x2b')][_0x8837('0x44')](_0x4f81d5)[_0x8837('0x25')](handleEntityNotFound(_0x37fd84,null))[_0x8837('0x25')](respondWithResult(_0x37fd84,null))['catch'](handleError(_0x37fd84,null));};exports[_0x8837('0x45')]=function(_0x5d9b97,_0x5e801e){return db[_0x8837('0x2b')]['create'](_0x5d9b97[_0x8837('0x46')],{})[_0x8837('0x25')](respondWithResult(_0x5e801e,0xc9))[_0x8837('0x42')](handleError(_0x5e801e,null));};exports['update']=function(_0xf8e586,_0x54f7b7){if(_0xf8e586[_0x8837('0x46')]['id']){delete _0xf8e586['body']['id'];}return db[_0x8837('0x2b')]['find']({'where':{'id':_0xf8e586['params']['id']}})[_0x8837('0x25')](handleEntityNotFound(_0x54f7b7,null))[_0x8837('0x25')](saveUpdates(_0xf8e586['body'],null))[_0x8837('0x25')](respondWithResult(_0x54f7b7,null))[_0x8837('0x42')](handleError(_0x54f7b7,null));};exports[_0x8837('0x47')]=function(_0x496fc2,_0x47fdf2){return db[_0x8837('0x2b')]['find']({'where':{'id':_0x496fc2[_0x8837('0x48')]['id']}})[_0x8837('0x25')](handleEntityNotFound(_0x47fdf2,null))[_0x8837('0x25')](removeEntity(_0x47fdf2,null))[_0x8837('0x42')](handleError(_0x47fdf2,null));};exports[_0x8837('0x49')]=function(_0x33711e,_0x112a56){return db[_0x8837('0x2b')][_0x8837('0x49')]()[_0x8837('0x25')](respondWithResult(_0x112a56,null))[_0x8837('0x42')](handleError(_0x112a56,null));}; \ No newline at end of file +var _0xe563=['end','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','then','destroy','stack','name','send','map','MailTransferReport','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','filters','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','length','catch','create','body','describe','eml-format','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status'];(function(_0x3dd910,_0x4ef4b3){var _0x2a9d7b=function(_0x112117){while(--_0x112117){_0x3dd910['push'](_0x3dd910['shift']());}};_0x2a9d7b(++_0x4ef4b3);}(_0xe563,0x197));var _0x3e56=function(_0x3341f5,_0x5c7b5f){_0x3341f5=_0x3341f5-0x0;var _0x22263e=_0xe563[_0x3341f5];return _0x22263e;};'use strict';var emlformat=require(_0x3e56('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3e56('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3e56('0x2'));var moment=require(_0x3e56('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x3e56('0x4'));var util=require(_0x3e56('0x5'));var path=require(_0x3e56('0x6'));var sox=require(_0x3e56('0x7'));var csv=require(_0x3e56('0x8'));var ejs=require(_0x3e56('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x3e56('0xa'));var crypto=require('crypto');var jsforce=require(_0x3e56('0xb'));var deskjs=require(_0x3e56('0xc'));var toCsv=require(_0x3e56('0x8'));var querystring=require(_0x3e56('0xd'));var Papa=require(_0x3e56('0xe'));var Redis=require(_0x3e56('0xf'));var authService=require(_0x3e56('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x3e56('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3e56('0x12'))(_0x3e56('0x13'));var utils=require(_0x3e56('0x14'));var config=require(_0x3e56('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x3e56('0x16'))['db'];function respondWithStatusCode(_0x5afb24,_0x37904d){_0x37904d=_0x37904d||0xcc;return function(_0x15ef6a){if(_0x15ef6a){return _0x5afb24[_0x3e56('0x17')](_0x37904d);}return _0x5afb24[_0x3e56('0x18')](_0x37904d)[_0x3e56('0x19')]();};}function respondWithResult(_0x661b04,_0x193669){_0x193669=_0x193669||0xc8;return function(_0x3bb1c9){if(_0x3bb1c9){return _0x661b04['status'](_0x193669)['json'](_0x3bb1c9);}};}function respondWithFilteredResult(_0x30f255,_0x374ffe){return function(_0x54f143){if(_0x54f143){var _0x313220=typeof _0x374ffe[_0x3e56('0x1a')]===_0x3e56('0x1b')&&typeof _0x374ffe[_0x3e56('0x1c')]===_0x3e56('0x1b');var _0x521d2d=_0x54f143[_0x3e56('0x1d')];var _0x2b2ac9=_0x313220?0x0:_0x374ffe['offset'];var _0x16c415=_0x313220?_0x54f143[_0x3e56('0x1d')]:_0x374ffe[_0x3e56('0x1a')]+_0x374ffe[_0x3e56('0x1c')];var _0x2ca121;if(_0x16c415>=_0x521d2d){_0x16c415=_0x521d2d;_0x2ca121=0xc8;}else{_0x2ca121=0xce;}_0x30f255[_0x3e56('0x18')](_0x2ca121);return _0x30f255[_0x3e56('0x1e')](_0x3e56('0x1f'),_0x2b2ac9+'-'+_0x16c415+'/'+_0x521d2d)[_0x3e56('0x20')](_0x54f143);}return null;};}function patchUpdates(_0x44081a){return function(_0x4e5b15){try{jsonpatch['apply'](_0x4e5b15,_0x44081a,!![]);}catch(_0x112c6d){return BPromise[_0x3e56('0x21')](_0x112c6d);}return _0x4e5b15[_0x3e56('0x22')]();};}function saveUpdates(_0x2ce408,_0x53e098){return function(_0x48f563){if(_0x48f563){return _0x48f563[_0x3e56('0x23')](_0x2ce408)[_0x3e56('0x24')](function(_0x5541c4){return _0x5541c4;});}return null;};}function removeEntity(_0x33de8a,_0x4b53d1){return function(_0xd0831a){if(_0xd0831a){return _0xd0831a[_0x3e56('0x25')]()[_0x3e56('0x24')](function(){_0x33de8a[_0x3e56('0x18')](0xcc)[_0x3e56('0x19')]();});}};}function handleEntityNotFound(_0x374037,_0x2546d1){return function(_0x3458a4){if(!_0x3458a4){_0x374037[_0x3e56('0x17')](0x194);}return _0x3458a4;};}function handleError(_0x585279,_0x1f0d28){_0x1f0d28=_0x1f0d28||0x1f4;return function(_0x28993b){logger['error'](_0x28993b[_0x3e56('0x26')]);if(_0x28993b[_0x3e56('0x27')]){delete _0x28993b['name'];}_0x585279[_0x3e56('0x18')](_0x1f0d28)[_0x3e56('0x28')](_0x28993b);};}exports['index']=function(_0x1b8985,_0x2f14b1){var _0x377c8c={},_0x11324c={},_0x3f5765={'count':0x0,'rows':[]};var _0x1e360a=_[_0x3e56('0x29')](db[_0x3e56('0x2a')]['rawAttributes'],function(_0x545fb7){return{'name':_0x545fb7['fieldName'],'type':_0x545fb7['type'][_0x3e56('0x2b')]};});_0x11324c[_0x3e56('0x2c')]=_[_0x3e56('0x29')](_0x1e360a,_0x3e56('0x27'));_0x11324c[_0x3e56('0x2d')]=_[_0x3e56('0x2e')](_0x1b8985[_0x3e56('0x2d')]);_0x11324c['filters']=_[_0x3e56('0x2f')](_0x11324c[_0x3e56('0x2c')],_0x11324c['query']);_0x377c8c[_0x3e56('0x30')]=_[_0x3e56('0x2f')](_0x11324c[_0x3e56('0x2c')],qs[_0x3e56('0x31')](_0x1b8985['query']['fields']));_0x377c8c[_0x3e56('0x30')]=_0x377c8c[_0x3e56('0x30')]['length']?_0x377c8c[_0x3e56('0x30')]:_0x11324c['model'];if(!_0x1b8985['query'][_0x3e56('0x32')](_0x3e56('0x33'))){_0x377c8c['limit']=qs['limit'](_0x1b8985[_0x3e56('0x2d')]['limit']);_0x377c8c['offset']=qs[_0x3e56('0x1a')](_0x1b8985[_0x3e56('0x2d')][_0x3e56('0x1a')]);}_0x377c8c['order']=qs['sort'](_0x1b8985['query'][_0x3e56('0x34')]);_0x377c8c['where']=qs[_0x3e56('0x35')](_['pick'](_0x1b8985[_0x3e56('0x2d')],_0x11324c['filters']),_0x1e360a);if(_0x1b8985[_0x3e56('0x2d')][_0x3e56('0x36')]){_0x377c8c[_0x3e56('0x37')]=_[_0x3e56('0x38')](_0x377c8c['where'],{'$or':_['map'](_0x1e360a,function(_0x1c9bf7){if(_0x1c9bf7[_0x3e56('0x39')]!==_0x3e56('0x3a')){var _0x434921={};_0x434921[_0x1c9bf7[_0x3e56('0x27')]]={'$like':'%'+_0x1b8985[_0x3e56('0x2d')]['filter']+'%'};return _0x434921;}})});}_0x377c8c=_[_0x3e56('0x38')]({},_0x377c8c,_0x1b8985[_0x3e56('0x3b')]);var _0xd6cf0f={'where':_0x377c8c[_0x3e56('0x37')]};return db['MailTransferReport'][_0x3e56('0x1d')](_0xd6cf0f)[_0x3e56('0x24')](function(_0x4dec34){_0x3f5765['count']=_0x4dec34;if(_0x1b8985[_0x3e56('0x2d')][_0x3e56('0x3c')]){_0x377c8c[_0x3e56('0x3d')]=[{'all':!![]}];}return db[_0x3e56('0x2a')][_0x3e56('0x3e')](_0x377c8c);})[_0x3e56('0x24')](function(_0x1389b5){_0x3f5765[_0x3e56('0x3f')]=_0x1389b5;return _0x3f5765;})[_0x3e56('0x24')](respondWithFilteredResult(_0x2f14b1,_0x377c8c))['catch'](handleError(_0x2f14b1,null));};exports[_0x3e56('0x40')]=function(_0x175688,_0x7316bb){var _0x433ea8={'raw':!![],'where':{'id':_0x175688[_0x3e56('0x41')]['id']}},_0x29f515={};_0x29f515['model']=_['keys'](db[_0x3e56('0x2a')][_0x3e56('0x42')]);_0x29f515[_0x3e56('0x2d')]=_[_0x3e56('0x2e')](_0x175688[_0x3e56('0x2d')]);_0x29f515['filters']=_[_0x3e56('0x2f')](_0x29f515[_0x3e56('0x2c')],_0x29f515['query']);_0x433ea8[_0x3e56('0x30')]=_[_0x3e56('0x2f')](_0x29f515[_0x3e56('0x2c')],qs[_0x3e56('0x31')](_0x175688[_0x3e56('0x2d')][_0x3e56('0x31')]));_0x433ea8[_0x3e56('0x30')]=_0x433ea8[_0x3e56('0x30')][_0x3e56('0x43')]?_0x433ea8[_0x3e56('0x30')]:_0x29f515['model'];if(_0x175688['query'][_0x3e56('0x3c')]){_0x433ea8[_0x3e56('0x3d')]=[{'all':!![]}];}_0x433ea8=_[_0x3e56('0x38')]({},_0x433ea8,_0x175688[_0x3e56('0x3b')]);return db[_0x3e56('0x2a')]['find'](_0x433ea8)['then'](handleEntityNotFound(_0x7316bb,null))[_0x3e56('0x24')](respondWithResult(_0x7316bb,null))[_0x3e56('0x44')](handleError(_0x7316bb,null));};exports[_0x3e56('0x45')]=function(_0x41ece2,_0x42ca80){return db[_0x3e56('0x2a')]['create'](_0x41ece2[_0x3e56('0x46')],{})[_0x3e56('0x24')](respondWithResult(_0x42ca80,0xc9))['catch'](handleError(_0x42ca80,null));};exports['update']=function(_0x193d70,_0x8007ab){if(_0x193d70['body']['id']){delete _0x193d70[_0x3e56('0x46')]['id'];}return db['MailTransferReport']['find']({'where':{'id':_0x193d70[_0x3e56('0x41')]['id']}})[_0x3e56('0x24')](handleEntityNotFound(_0x8007ab,null))[_0x3e56('0x24')](saveUpdates(_0x193d70[_0x3e56('0x46')],null))['then'](respondWithResult(_0x8007ab,null))[_0x3e56('0x44')](handleError(_0x8007ab,null));};exports[_0x3e56('0x25')]=function(_0x5f1828,_0x210f8f){return db[_0x3e56('0x2a')]['find']({'where':{'id':_0x5f1828[_0x3e56('0x41')]['id']}})['then'](handleEntityNotFound(_0x210f8f,null))[_0x3e56('0x24')](removeEntity(_0x210f8f,null))[_0x3e56('0x44')](handleError(_0x210f8f,null));};exports['describe']=function(_0x36edd6,_0x4b2b18){return db[_0x3e56('0x2a')][_0x3e56('0x47')]()['then'](respondWithResult(_0x4b2b18,null))[_0x3e56('0x44')](handleError(_0x4b2b18,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 363a715..fa883f0 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 _0x3212=['../../config/environment','./mailTransferReport.attributes','exports','define','MailTransferReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0x3212,0x6f));var _0x2321=function(_0x41b9f1,_0x59375d){_0x41b9f1=_0x41b9f1-0x0;var _0x58b78a=_0x3212[_0x41b9f1];return _0x58b78a;};'use strict';var _=require(_0x2321('0x0'));var util=require(_0x2321('0x1'));var logger=require(_0x2321('0x2'))(_0x2321('0x3'));var moment=require(_0x2321('0x4'));var BPromise=require(_0x2321('0x5'));var rp=require(_0x2321('0x6'));var fs=require('fs');var path=require(_0x2321('0x7'));var rimraf=require(_0x2321('0x8'));var config=require(_0x2321('0x9'));var attributes=require(_0x2321('0xa'));module[_0x2321('0xb')]=function(_0x53d2e1,_0x14b94e){return _0x53d2e1[_0x2321('0xc')](_0x2321('0xd'),attributes,{'tableName':'report_mail_transfer','paranoid':![],'indexes':[{'name':_0x2321('0xe'),'fields':[_0x2321('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x131a=['exports','define','MailTransferReport','report_mail_transfer','uniqueid','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment'];(function(_0x35b398,_0x381825){var _0xbfcb07=function(_0x77ad0c){while(--_0x77ad0c){_0x35b398['push'](_0x35b398['shift']());}};_0xbfcb07(++_0x381825);}(_0x131a,0x18b));var _0xa131=function(_0x450129,_0x3eef70){_0x450129=_0x450129-0x0;var _0x5dcd1c=_0x131a[_0x450129];return _0x5dcd1c;};'use strict';var _=require(_0xa131('0x0'));var util=require(_0xa131('0x1'));var logger=require(_0xa131('0x2'))(_0xa131('0x3'));var moment=require(_0xa131('0x4'));var BPromise=require('bluebird');var rp=require(_0xa131('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa131('0x6'));var config=require(_0xa131('0x7'));var attributes=require('./mailTransferReport.attributes');module[_0xa131('0x8')]=function(_0xdb263c,_0x1a51cf){return _0xdb263c[_0xa131('0x9')](_0xa131('0xa'),attributes,{'tableName':_0xa131('0xb'),'paranoid':![],'indexes':[{'name':_0xa131('0xc'),'fields':[_0xa131('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index d8485ae..7099be5 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 _0xfaf6=['info','result','catch','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xfaf6,0x193));var _0x6faf=function(_0x1a1c38,_0x655bf8){_0x1a1c38=_0x1a1c38-0x0;var _0x33d66c=_0xfaf6[_0x1a1c38];return _0x33d66c;};'use strict';var _=require('lodash');var util=require(_0x6faf('0x0'));var moment=require(_0x6faf('0x1'));var BPromise=require('bluebird');var rs=require(_0x6faf('0x2'));var fs=require('fs');var Redis=require(_0x6faf('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x6faf('0x4'));var logger=require(_0x6faf('0x5'))(_0x6faf('0x6'));var config=require(_0x6faf('0x7'));var jayson=require(_0x6faf('0x8'));var client=jayson[_0x6faf('0x9')][_0x6faf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2d78e3,_0x3b9087,_0x18d276){return new BPromise(function(_0x35ca0b,_0x26494f){return client['request'](_0x2d78e3,_0x18d276)['then'](function(_0x4226e4){logger['info'](_0x6faf('0xb'),_0x3b9087,_0x6faf('0xc'));logger[_0x6faf('0xd')]('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x3b9087,_0x6faf('0xc'),JSON[_0x6faf('0xe')](_0x4226e4));if(_0x4226e4[_0x6faf('0xf')]){if(_0x4226e4['error']['code']===0x1f4){logger['error'](_0x6faf('0xb'),_0x3b9087,_0x4226e4[_0x6faf('0xf')][_0x6faf('0x10')]);return _0x26494f(_0x4226e4[_0x6faf('0xf')][_0x6faf('0x10')]);}logger['error']('MailTransferReport,\x20%s,\x20%s',_0x3b9087,_0x4226e4['error']['message']);return _0x35ca0b(_0x4226e4[_0x6faf('0xf')][_0x6faf('0x10')]);}else{logger[_0x6faf('0x11')](_0x6faf('0xb'),_0x3b9087,_0x6faf('0xc'));_0x35ca0b(_0x4226e4[_0x6faf('0x12')][_0x6faf('0x10')]);}})[_0x6faf('0x13')](function(_0x1a4ef0){logger[_0x6faf('0xf')]('MailTransferReport,\x20%s,\x20%s',_0x3b9087,_0x1a4ef0);_0x26494f(_0x1a4ef0);});});} \ No newline at end of file +var _0x41f5=['MailTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','MailTransferReport,\x20%s,\x20%s','debug'];(function(_0xac6fdf,_0x315296){var _0x56d02f=function(_0x4e58c3){while(--_0x4e58c3){_0xac6fdf['push'](_0xac6fdf['shift']());}};_0x56d02f(++_0x315296);}(_0x41f5,0xa2));var _0x541f=function(_0x3fa1e1,_0x4e39f0){_0x3fa1e1=_0x3fa1e1-0x0;var _0x1cc2ad=_0x41f5[_0x3fa1e1];return _0x1cc2ad;};'use strict';var _=require(_0x541f('0x0'));var util=require(_0x541f('0x1'));var moment=require('moment');var BPromise=require(_0x541f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x541f('0x3'));var db=require(_0x541f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x541f('0x5'))(_0x541f('0x6'));var config=require(_0x541f('0x7'));var jayson=require(_0x541f('0x8'));var client=jayson['client'][_0x541f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x13a62b,_0x10b315,_0x5d2a05){return new BPromise(function(_0x33f537,_0x25be8b){return client['request'](_0x13a62b,_0x5d2a05)[_0x541f('0xa')](function(_0x267fa4){logger[_0x541f('0xb')](_0x541f('0xc'),_0x10b315,'request\x20sent');logger[_0x541f('0xd')](_0x541f('0xe'),_0x10b315,_0x541f('0xf'),JSON[_0x541f('0x10')](_0x267fa4));if(_0x267fa4['error']){if(_0x267fa4[_0x541f('0x11')][_0x541f('0x12')]===0x1f4){logger['error'](_0x541f('0xc'),_0x10b315,_0x267fa4[_0x541f('0x11')][_0x541f('0x13')]);return _0x25be8b(_0x267fa4[_0x541f('0x11')][_0x541f('0x13')]);}logger[_0x541f('0x11')](_0x541f('0xc'),_0x10b315,_0x267fa4[_0x541f('0x11')]['message']);return _0x33f537(_0x267fa4['error'][_0x541f('0x13')]);}else{logger[_0x541f('0xb')](_0x541f('0xc'),_0x10b315,_0x541f('0xf'));_0x33f537(_0x267fa4[_0x541f('0x14')][_0x541f('0x13')]);}})[_0x541f('0x15')](function(_0x424f64){logger[_0x541f('0x11')](_0x541f('0xc'),_0x10b315,_0x424f64);_0x25be8b(_0x424f64);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index fcd3618..a70c7c5 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 _0x63b8=['isAuthenticated','index','/describe','describe','show','post','put','/:id','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','get'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x63b8,0x1cb));var _0x863b=function(_0x2eb994,_0x5e6a40){_0x2eb994=_0x2eb994-0x0;var _0x2d27e6=_0x63b8[_0x2eb994];return _0x2d27e6;};'use strict';var multer=require(_0x863b('0x0'));var util=require('util');var path=require(_0x863b('0x1'));var timeout=require(_0x863b('0x2'));var express=require(_0x863b('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x863b('0x4'));var interaction=require(_0x863b('0x5'));var config=require(_0x863b('0x6'));var controller=require(_0x863b('0x7'));router[_0x863b('0x8')]('/',auth[_0x863b('0x9')](),controller[_0x863b('0xa')]);router[_0x863b('0x8')](_0x863b('0xb'),auth[_0x863b('0x9')](),controller[_0x863b('0xc')]);router[_0x863b('0x8')]('/:id',auth[_0x863b('0x9')](),controller[_0x863b('0xd')]);router[_0x863b('0xe')]('/',auth[_0x863b('0x9')](),controller['create']);router[_0x863b('0xf')](_0x863b('0x10'),auth[_0x863b('0x9')](),controller['update']);router['delete']('/:id',auth[_0x863b('0x9')](),controller['destroy']);module[_0x863b('0x11')]=router; \ No newline at end of file +var _0x0c70=['index','describe','/:id','show','post','update','delete','destroy','exports','multer','util','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated'];(function(_0x5239f6,_0x3bc30a){var _0xb66a8b=function(_0x3573ac){while(--_0x3573ac){_0x5239f6['push'](_0x5239f6['shift']());}};_0xb66a8b(++_0x3bc30a);}(_0x0c70,0xc9));var _0x00c7=function(_0x3f2c1c,_0x4f182b){_0x3f2c1c=_0x3f2c1c-0x0;var _0x391934=_0x0c70[_0x3f2c1c];return _0x391934;};'use strict';var multer=require(_0x00c7('0x0'));var util=require(_0x00c7('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x00c7('0x2'));var auth=require(_0x00c7('0x3'));var interaction=require(_0x00c7('0x4'));var config=require('../../config/environment');var controller=require('./memberReport.controller');router[_0x00c7('0x5')]('/',auth[_0x00c7('0x6')](),controller[_0x00c7('0x7')]);router[_0x00c7('0x5')]('/describe',auth['isAuthenticated'](),controller[_0x00c7('0x8')]);router[_0x00c7('0x5')](_0x00c7('0x9'),auth[_0x00c7('0x6')](),controller[_0x00c7('0xa')]);router[_0x00c7('0xb')]('/',auth[_0x00c7('0x6')](),controller['create']);router['put'](_0x00c7('0x9'),auth[_0x00c7('0x6')](),controller[_0x00c7('0xc')]);router[_0x00c7('0xd')](_0x00c7('0x9'),auth[_0x00c7('0x6')](),controller[_0x00c7('0xe')]);module[_0x00c7('0xf')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index c31116d..645af7b 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 _0x707d=['seconds','exitAt','setDataValue','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[queue]','sequelize','moment','exports','STRING','DEFAULT\x20PAUSE','enterAt','diff'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x707d,0x69));var _0xd707=function(_0x874837,_0x11b927){_0x874837=_0x874837-0x0;var _0x4acc74=_0x707d[_0x874837];return _0x4acc74;};'use strict';var Sequelize=require(_0xd707('0x0'));var moment=require(_0xd707('0x1'));module[_0xd707('0x2')]={'channel':{'type':Sequelize[_0xd707('0x3')]},'membername':{'type':Sequelize[_0xd707('0x3')]},'interface':{'type':Sequelize[_0xd707('0x3')]},'type':{'type':Sequelize[_0xd707('0x3')],'defaultValue':_0xd707('0x4'),'comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE'],'set':function(_0xb7bfae){var _0x4ced82=moment(_0xb7bfae);var _0x4813e7=moment(this['getDataValue'](_0xd707('0x5')));var _0x34a4f8=_0x4ced82[_0xd707('0x6')](_0x4813e7,_0xd707('0x7'));this['setDataValue'](_0xd707('0x8'),_0xb7bfae);this[_0xd707('0x9')]('duration',_0x34a4f8>=0x0?_0x34a4f8:null);}},'data1':{'type':Sequelize[_0xd707('0x3')],'comment':_0xd707('0xa')},'data2':{'type':Sequelize[_0xd707('0x3')],'comment':_0xd707('0xb')},'data3':{'type':Sequelize[_0xd707('0x3')],'comment':_0xd707('0xc')},'data4':{'type':Sequelize['STRING'],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize[_0xd707('0x3')],'comment':_0xd707('0xd')},'role':{'type':Sequelize[_0xd707('0x3')]},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0xd707('0x3')]}}; \ No newline at end of file +var _0xd19f=['setDataValue','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[dial\x20string]','talk:[queue]','sequelize','moment','STRING','DEFAULT\x20PAUSE','DATE','getDataValue','seconds'];(function(_0x392e52,_0x41196e){var _0x38ff9d=function(_0xd34be3){while(--_0xd34be3){_0x392e52['push'](_0x392e52['shift']());}};_0x38ff9d(++_0x41196e);}(_0xd19f,0x1e7));var _0xfd19=function(_0x2d34d6,_0x397ff9){_0x2d34d6=_0x2d34d6-0x0;var _0x1d3d12=_0xd19f[_0x2d34d6];return _0x1d3d12;};'use strict';var Sequelize=require(_0xfd19('0x0'));var moment=require(_0xfd19('0x1'));module['exports']={'channel':{'type':Sequelize[_0xfd19('0x2')]},'membername':{'type':Sequelize[_0xfd19('0x2')]},'interface':{'type':Sequelize[_0xfd19('0x2')]},'type':{'type':Sequelize[_0xfd19('0x2')],'defaultValue':_0xfd19('0x3'),'comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize[_0xfd19('0x4')]},'exitAt':{'type':Sequelize[_0xfd19('0x4')],'set':function(_0x237db7){var _0x411c73=moment(_0x237db7);var _0x1da879=moment(this[_0xfd19('0x5')]('enterAt'));var _0x4f8e85=_0x411c73['diff'](_0x1da879,_0xfd19('0x6'));this[_0xfd19('0x7')]('exitAt',_0x237db7);this[_0xfd19('0x7')](_0xfd19('0x8'),_0x4f8e85>=0x0?_0x4f8e85:null);}},'data1':{'type':Sequelize[_0xfd19('0x2')],'comment':_0xfd19('0x9')},'data2':{'type':Sequelize[_0xfd19('0x2')],'comment':_0xfd19('0xa')},'data3':{'type':Sequelize['STRING'],'comment':'talk:[destination]'},'data4':{'type':Sequelize[_0xfd19('0x2')],'comment':_0xfd19('0xb')},'data5':{'type':Sequelize[_0xfd19('0x2')],'comment':_0xfd19('0xc')},'role':{'type':Sequelize[_0xfd19('0x2')]},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0xfd19('0x2')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index aade19e..1a613ca 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 _0x9957=['util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','MemberReport','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache'];(function(_0x2a04d4,_0xa57830){var _0x40b2f9=function(_0x44f8cf){while(--_0x44f8cf){_0x2a04d4['push'](_0x2a04d4['shift']());}};_0x40b2f9(++_0xa57830);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['MemberReport']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['MemberReport'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['MemberReport'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x4ffc8a['params']['id']}})['then'](handleEntityNotFound(_0x19da63,null))['then'](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x4c')]=function(_0x4cf5db,_0x1cd85){return db[_0x7995('0x40')][_0x7995('0x4c')]()[_0x7995('0x26')](respondWithResult(_0x1cd85,null))[_0x7995('0x49')](handleError(_0x1cd85,null));}; \ No newline at end of file +var _0x008c=['destroy','sendStatus','send','index','MemberReport','rawAttributes','key','model','map','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','type','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','show','catch','create','body','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','save','update','then'];(function(_0x580308,_0x569772){var _0x1e20dc=function(_0x1d7030){while(--_0x1d7030){_0x580308['push'](_0x580308['shift']());}};_0x1e20dc(++_0x569772);}(_0x008c,0x188));var _0xc008=function(_0x593683,_0x2b3213){_0x593683=_0x593683-0x0;var _0x44cc39=_0x008c[_0x593683];return _0x44cc39;};'use strict';var emlformat=require(_0xc008('0x0'));var rimraf=require(_0xc008('0x1'));var zipdir=require(_0xc008('0x2'));var jsonpatch=require(_0xc008('0x3'));var rp=require(_0xc008('0x4'));var moment=require('moment');var BPromise=require(_0xc008('0x5'));var Mustache=require(_0xc008('0x6'));var util=require(_0xc008('0x7'));var path=require(_0xc008('0x8'));var sox=require(_0xc008('0x9'));var csv=require(_0xc008('0xa'));var ejs=require(_0xc008('0xb'));var fs=require('fs');var fs_extra=require(_0xc008('0xc'));var _=require(_0xc008('0xd'));var squel=require('squel');var crypto=require(_0xc008('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc008('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc008('0x10'));var Redis=require(_0xc008('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc008('0x12'));var logger=require(_0xc008('0x13'))('api');var utils=require(_0xc008('0x14'));var config=require(_0xc008('0x15'));var licenseUtil=require(_0xc008('0x16'));var db=require(_0xc008('0x17'))['db'];function respondWithStatusCode(_0x9ffa93,_0x1819c6){_0x1819c6=_0x1819c6||0xcc;return function(_0x69726e){if(_0x69726e){return _0x9ffa93['sendStatus'](_0x1819c6);}return _0x9ffa93['status'](_0x1819c6)[_0xc008('0x18')]();};}function respondWithResult(_0x50c1ab,_0x25e13f){_0x25e13f=_0x25e13f||0xc8;return function(_0x4584e1){if(_0x4584e1){return _0x50c1ab[_0xc008('0x19')](_0x25e13f)[_0xc008('0x1a')](_0x4584e1);}};}function respondWithFilteredResult(_0x3f0ecf,_0x5ee00b){return function(_0x5e894e){if(_0x5e894e){var _0x4bd0f4=typeof _0x5ee00b[_0xc008('0x1b')]===_0xc008('0x1c')&&typeof _0x5ee00b[_0xc008('0x1d')]===_0xc008('0x1c');var _0x4fe771=_0x5e894e['count'];var _0x540e45=_0x4bd0f4?0x0:_0x5ee00b['offset'];var _0x46042b=_0x4bd0f4?_0x5e894e[_0xc008('0x1e')]:_0x5ee00b['offset']+_0x5ee00b[_0xc008('0x1d')];var _0x5906e6;if(_0x46042b>=_0x4fe771){_0x46042b=_0x4fe771;_0x5906e6=0xc8;}else{_0x5906e6=0xce;}_0x3f0ecf['status'](_0x5906e6);return _0x3f0ecf['set']('Content-Range',_0x540e45+'-'+_0x46042b+'/'+_0x4fe771)[_0xc008('0x1a')](_0x5e894e);}return null;};}function patchUpdates(_0x4b9726){return function(_0x5560b1){try{jsonpatch['apply'](_0x5560b1,_0x4b9726,!![]);}catch(_0x4a582d){return BPromise['reject'](_0x4a582d);}return _0x5560b1[_0xc008('0x1f')]();};}function saveUpdates(_0x4777a6,_0x251db2){return function(_0x415af3){if(_0x415af3){return _0x415af3[_0xc008('0x20')](_0x4777a6)[_0xc008('0x21')](function(_0x4f43e2){return _0x4f43e2;});}return null;};}function removeEntity(_0x459fd9,_0x5c85f2){return function(_0x58a6ea){if(_0x58a6ea){return _0x58a6ea[_0xc008('0x22')]()[_0xc008('0x21')](function(){_0x459fd9[_0xc008('0x19')](0xcc)[_0xc008('0x18')]();});}};}function handleEntityNotFound(_0x5410f5,_0x48582b){return function(_0x5de1e9){if(!_0x5de1e9){_0x5410f5[_0xc008('0x23')](0x194);}return _0x5de1e9;};}function handleError(_0x15dade,_0x92c582){_0x92c582=_0x92c582||0x1f4;return function(_0x2e31c2){logger['error'](_0x2e31c2['stack']);if(_0x2e31c2['name']){delete _0x2e31c2['name'];}_0x15dade['status'](_0x92c582)[_0xc008('0x24')](_0x2e31c2);};}exports[_0xc008('0x25')]=function(_0x25eae4,_0x529961){var _0x24c14c={},_0x32390d={},_0x209591={'count':0x0,'rows':[]};var _0x2a7d4f=_['map'](db[_0xc008('0x26')][_0xc008('0x27')],function(_0x53ed35){return{'name':_0x53ed35['fieldName'],'type':_0x53ed35['type'][_0xc008('0x28')]};});_0x32390d[_0xc008('0x29')]=_[_0xc008('0x2a')](_0x2a7d4f,_0xc008('0x2b'));_0x32390d[_0xc008('0x2c')]=_[_0xc008('0x2d')](_0x25eae4[_0xc008('0x2c')]);_0x32390d[_0xc008('0x2e')]=_[_0xc008('0x2f')](_0x32390d[_0xc008('0x29')],_0x32390d[_0xc008('0x2c')]);_0x24c14c[_0xc008('0x30')]=_['intersection'](_0x32390d[_0xc008('0x29')],qs[_0xc008('0x31')](_0x25eae4['query'][_0xc008('0x31')]));_0x24c14c[_0xc008('0x30')]=_0x24c14c[_0xc008('0x30')][_0xc008('0x32')]?_0x24c14c[_0xc008('0x30')]:_0x32390d[_0xc008('0x29')];if(!_0x25eae4[_0xc008('0x2c')][_0xc008('0x33')](_0xc008('0x34'))){_0x24c14c['limit']=qs[_0xc008('0x1d')](_0x25eae4[_0xc008('0x2c')][_0xc008('0x1d')]);_0x24c14c[_0xc008('0x1b')]=qs[_0xc008('0x1b')](_0x25eae4[_0xc008('0x2c')][_0xc008('0x1b')]);}_0x24c14c['order']=qs[_0xc008('0x35')](_0x25eae4[_0xc008('0x2c')]['sort']);_0x24c14c[_0xc008('0x36')]=qs[_0xc008('0x2e')](_['pick'](_0x25eae4[_0xc008('0x2c')],_0x32390d[_0xc008('0x2e')]),_0x2a7d4f);if(_0x25eae4[_0xc008('0x2c')]['filter']){_0x24c14c['where']=_['merge'](_0x24c14c[_0xc008('0x36')],{'$or':_['map'](_0x2a7d4f,function(_0x3dd0ac){if(_0x3dd0ac[_0xc008('0x37')]!==_0xc008('0x38')){var _0x440459={};_0x440459[_0x3dd0ac[_0xc008('0x2b')]]={'$like':'%'+_0x25eae4[_0xc008('0x2c')][_0xc008('0x39')]+'%'};return _0x440459;}})});}_0x24c14c=_[_0xc008('0x3a')]({},_0x24c14c,_0x25eae4[_0xc008('0x3b')]);var _0x387dfd={'where':_0x24c14c[_0xc008('0x36')]};return db[_0xc008('0x26')][_0xc008('0x1e')](_0x387dfd)[_0xc008('0x21')](function(_0x4cace5){_0x209591[_0xc008('0x1e')]=_0x4cace5;if(_0x25eae4[_0xc008('0x2c')][_0xc008('0x3c')]){_0x24c14c[_0xc008('0x3d')]=[{'all':!![]}];}return db['MemberReport'][_0xc008('0x3e')](_0x24c14c);})[_0xc008('0x21')](function(_0xc8cb91){_0x209591[_0xc008('0x3f')]=_0xc8cb91;return _0x209591;})[_0xc008('0x21')](respondWithFilteredResult(_0x529961,_0x24c14c))['catch'](handleError(_0x529961,null));};exports[_0xc008('0x40')]=function(_0x3323f4,_0x3794b0){var _0x3e9a99={'raw':!![],'where':{'id':_0x3323f4['params']['id']}},_0x7279e8={};_0x7279e8[_0xc008('0x29')]=_[_0xc008('0x2d')](db[_0xc008('0x26')][_0xc008('0x27')]);_0x7279e8['query']=_[_0xc008('0x2d')](_0x3323f4[_0xc008('0x2c')]);_0x7279e8[_0xc008('0x2e')]=_['intersection'](_0x7279e8[_0xc008('0x29')],_0x7279e8['query']);_0x3e9a99[_0xc008('0x30')]=_['intersection'](_0x7279e8[_0xc008('0x29')],qs[_0xc008('0x31')](_0x3323f4['query'][_0xc008('0x31')]));_0x3e9a99[_0xc008('0x30')]=_0x3e9a99[_0xc008('0x30')]['length']?_0x3e9a99[_0xc008('0x30')]:_0x7279e8[_0xc008('0x29')];if(_0x3323f4[_0xc008('0x2c')][_0xc008('0x3c')]){_0x3e9a99[_0xc008('0x3d')]=[{'all':!![]}];}_0x3e9a99=_[_0xc008('0x3a')]({},_0x3e9a99,_0x3323f4['options']);return db['MemberReport']['find'](_0x3e9a99)[_0xc008('0x21')](handleEntityNotFound(_0x3794b0,null))[_0xc008('0x21')](respondWithResult(_0x3794b0,null))[_0xc008('0x41')](handleError(_0x3794b0,null));};exports[_0xc008('0x42')]=function(_0x25289f,_0x24f6a4){return db[_0xc008('0x26')][_0xc008('0x42')](_0x25289f['body'],{})['then'](respondWithResult(_0x24f6a4,0xc9))['catch'](handleError(_0x24f6a4,null));};exports[_0xc008('0x20')]=function(_0x2651cf,_0x158eae){if(_0x2651cf['body']['id']){delete _0x2651cf[_0xc008('0x43')]['id'];}return db[_0xc008('0x26')][_0xc008('0x44')]({'where':{'id':_0x2651cf[_0xc008('0x45')]['id']}})[_0xc008('0x21')](handleEntityNotFound(_0x158eae,null))[_0xc008('0x21')](saveUpdates(_0x2651cf[_0xc008('0x43')],null))[_0xc008('0x21')](respondWithResult(_0x158eae,null))[_0xc008('0x41')](handleError(_0x158eae,null));};exports[_0xc008('0x22')]=function(_0x52c444,_0x4c63d4){return db[_0xc008('0x26')]['find']({'where':{'id':_0x52c444[_0xc008('0x45')]['id']}})[_0xc008('0x21')](handleEntityNotFound(_0x4c63d4,null))[_0xc008('0x21')](removeEntity(_0x4c63d4,null))['catch'](handleError(_0x4c63d4,null));};exports[_0xc008('0x46')]=function(_0x32b435,_0xee64){return db[_0xc008('0x26')][_0xc008('0x46')]()['then'](respondWithResult(_0xee64,null))[_0xc008('0x41')](handleError(_0xee64,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index 1f177e7..4af2ecb 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 _0x9571=['exports','define','MemberReport','report_member','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x9571,0xeb));var _0x1957=function(_0x455ac0,_0x1d5f16){_0x455ac0=_0x455ac0-0x0;var _0xfb9257=_0x9571[_0x455ac0];return _0xfb9257;};'use strict';var _=require(_0x1957('0x0'));var util=require(_0x1957('0x1'));var logger=require(_0x1957('0x2'))('api');var moment=require('moment');var BPromise=require(_0x1957('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1957('0x4'));var rimraf=require(_0x1957('0x5'));var config=require(_0x1957('0x6'));var attributes=require('./memberReport.attributes');module[_0x1957('0x7')]=function(_0x564aeb,_0xb5342f){return _0x564aeb[_0x1957('0x8')](_0x1957('0x9'),attributes,{'tableName':_0x1957('0xa'),'paranoid':![],'indexes':[{'name':'membername_interface','fields':['membername','interface']}],'timestamps':!![]});}; \ No newline at end of file +var _0x0bb1=['moment','bluebird','request-promise','rimraf','../../config/environment','./memberReport.attributes','exports','define','MemberReport','report_member','membername_interface','membername','interface','util'];(function(_0xb725be,_0x45bd01){var _0x2f2424=function(_0x2566ca){while(--_0x2566ca){_0xb725be['push'](_0xb725be['shift']());}};_0x2f2424(++_0x45bd01);}(_0x0bb1,0x1cd));var _0x10bb=function(_0x23cc76,_0x9c756b){_0x23cc76=_0x23cc76-0x0;var _0x2f5c13=_0x0bb1[_0x23cc76];return _0x2f5c13;};'use strict';var _=require('lodash');var util=require(_0x10bb('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x10bb('0x1'));var BPromise=require(_0x10bb('0x2'));var rp=require(_0x10bb('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x10bb('0x4'));var config=require(_0x10bb('0x5'));var attributes=require(_0x10bb('0x6'));module[_0x10bb('0x7')]=function(_0x6e2843,_0x2b6938){return _0x6e2843[_0x10bb('0x8')](_0x10bb('0x9'),attributes,{'tableName':_0x10bb('0xa'),'paranoid':![],'indexes':[{'name':_0x10bb('0xb'),'fields':[_0x10bb('0xc'),_0x10bb('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index d0b37a1..b728a9a 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 _0x1c3b=['findAll','options','raw','where','attributes','limit','map','model','include','then','stringify','CreateMemberReport','update','body','UpdateMemberReport','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','MemberReport,\x20%s,\x20%s','debug','MemberReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetMemberReport','MemberReport'];(function(_0x128502,_0x57c2f6){var _0x5a8519=function(_0x4b30d6){while(--_0x4b30d6){_0x128502['push'](_0x128502['shift']());}};_0x5a8519(++_0x57c2f6);}(_0x1c3b,0xab));var _0xb1c3=function(_0x283259,_0x1bda30){_0x283259=_0x283259-0x0;var _0x4fa4e6=_0x1c3b[_0x283259];return _0x4fa4e6;};'use strict';var _=require(_0xb1c3('0x0'));var util=require(_0xb1c3('0x1'));var moment=require(_0xb1c3('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb1c3('0x3'));var db=require(_0xb1c3('0x4'))['db'];var utils=require(_0xb1c3('0x5'));var logger=require(_0xb1c3('0x6'))(_0xb1c3('0x7'));var config=require(_0xb1c3('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xb1c3('0x9')][_0xb1c3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x211254,_0x4c26fd,_0x504fc9){return new BPromise(function(_0x4ed6cf,_0x5f1df6){return client[_0xb1c3('0xb')](_0x211254,_0x504fc9)['then'](function(_0x2879c2){logger[_0xb1c3('0xc')](_0xb1c3('0xd'),_0x4c26fd,'request\x20sent');logger[_0xb1c3('0xe')](_0xb1c3('0xf'),_0x4c26fd,_0xb1c3('0x10'),JSON['stringify'](_0x2879c2));if(_0x2879c2[_0xb1c3('0x11')]){if(_0x2879c2[_0xb1c3('0x11')][_0xb1c3('0x12')]===0x1f4){logger[_0xb1c3('0x11')]('MemberReport,\x20%s,\x20%s',_0x4c26fd,_0x2879c2[_0xb1c3('0x11')][_0xb1c3('0x13')]);return _0x5f1df6(_0x2879c2[_0xb1c3('0x11')]['message']);}logger[_0xb1c3('0x11')](_0xb1c3('0xd'),_0x4c26fd,_0x2879c2['error'][_0xb1c3('0x13')]);return _0x4ed6cf(_0x2879c2[_0xb1c3('0x11')][_0xb1c3('0x13')]);}else{logger[_0xb1c3('0xc')](_0xb1c3('0xd'),_0x4c26fd,'request\x20sent');_0x4ed6cf(_0x2879c2[_0xb1c3('0x14')][_0xb1c3('0x13')]);}})[_0xb1c3('0x15')](function(_0x41b0fb){logger[_0xb1c3('0x11')]('MemberReport,\x20%s,\x20%s',_0x4c26fd,_0x41b0fb);_0x5f1df6(_0x41b0fb);});});}exports[_0xb1c3('0x16')]=function(_0x2bdeed){var _0x1313a8=this;return new Promise(function(_0x36b25f,_0x1bb2e4){return db[_0xb1c3('0x17')][_0xb1c3('0x18')]({'raw':_0x2bdeed[_0xb1c3('0x19')]?_0x2bdeed[_0xb1c3('0x19')][_0xb1c3('0x1a')]===undefined?!![]:![]:!![],'where':_0x2bdeed[_0xb1c3('0x19')]?_0x2bdeed[_0xb1c3('0x19')][_0xb1c3('0x1b')]||null:null,'attributes':_0x2bdeed['options']?_0x2bdeed[_0xb1c3('0x19')][_0xb1c3('0x1c')]||null:null,'limit':_0x2bdeed[_0xb1c3('0x19')]?_0x2bdeed[_0xb1c3('0x19')][_0xb1c3('0x1d')]||null:null,'include':_0x2bdeed[_0xb1c3('0x19')]?_0x2bdeed['options']['include']?_[_0xb1c3('0x1e')](_0x2bdeed[_0xb1c3('0x19')]['include'],function(_0xdb96){return{'model':db[_0xdb96[_0xb1c3('0x1f')]],'as':_0xdb96['as'],'attributes':_0xdb96[_0xb1c3('0x1c')],'include':_0xdb96[_0xb1c3('0x20')]?_['map'](_0xdb96[_0xb1c3('0x20')],function(_0x1cefff){return{'model':db[_0x1cefff[_0xb1c3('0x1f')]],'as':_0x1cefff['as'],'attributes':_0x1cefff[_0xb1c3('0x1c')],'include':_0x1cefff[_0xb1c3('0x20')]?_['map'](_0x1cefff[_0xb1c3('0x20')],function(_0xc6c566){return{'model':db[_0xc6c566[_0xb1c3('0x1f')]],'as':_0xc6c566['as'],'attributes':_0xc6c566[_0xb1c3('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xb1c3('0x21')](function(_0x17f9e7){logger[_0xb1c3('0xc')](_0xb1c3('0x16'),_0x2bdeed);logger[_0xb1c3('0xe')](_0xb1c3('0x16'),_0x2bdeed,JSON[_0xb1c3('0x22')](_0x17f9e7));_0x36b25f(_0x17f9e7);})[_0xb1c3('0x15')](function(_0x11eb58){logger['error'](_0xb1c3('0x16'),_0x11eb58['message'],_0x2bdeed);_0x1bb2e4(_0x1313a8[_0xb1c3('0x11')](0x1f4,_0x11eb58['message']));});});};exports[_0xb1c3('0x23')]=function(_0x2d6ae7){var _0x194f94=this;return new Promise(function(_0x2714a7,_0x375b03){return db[_0xb1c3('0x17')]['create'](_0x2d6ae7['body'],{'raw':_0x2d6ae7[_0xb1c3('0x19')]?_0x2d6ae7[_0xb1c3('0x19')][_0xb1c3('0x1a')]===undefined?!![]:![]:!![]})[_0xb1c3('0x21')](function(_0x1f22b2){logger[_0xb1c3('0xc')](_0xb1c3('0x23'),_0x2d6ae7);logger['debug'](_0xb1c3('0x23'),_0x2d6ae7,JSON['stringify'](_0x1f22b2));_0x2714a7(_0x1f22b2);})[_0xb1c3('0x15')](function(_0x106e06){logger['error'](_0xb1c3('0x23'),_0x106e06[_0xb1c3('0x13')],_0x2d6ae7);_0x375b03(_0x194f94[_0xb1c3('0x11')](0x1f4,_0x106e06[_0xb1c3('0x13')]));});});};exports['UpdateMemberReport']=function(_0x417372){var _0xc28b8=this;return new Promise(function(_0x2ca797,_0x450ddb){return db[_0xb1c3('0x17')][_0xb1c3('0x24')](_0x417372[_0xb1c3('0x25')],{'raw':_0x417372[_0xb1c3('0x19')]?_0x417372[_0xb1c3('0x19')][_0xb1c3('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x417372[_0xb1c3('0x19')]?_0x417372[_0xb1c3('0x19')]['where']||null:null,'attributes':_0x417372[_0xb1c3('0x19')]?_0x417372[_0xb1c3('0x19')]['attributes']||null:null,'limit':_0x417372[_0xb1c3('0x19')]?_0x417372[_0xb1c3('0x19')][_0xb1c3('0x1d')]||null:null})[_0xb1c3('0x21')](function(_0x465328){logger[_0xb1c3('0xc')](_0xb1c3('0x26'),_0x417372);logger[_0xb1c3('0xe')]('UpdateMemberReport',_0x417372,JSON[_0xb1c3('0x22')](_0x465328));_0x2ca797(_0x465328);})[_0xb1c3('0x15')](function(_0x157488){logger['error']('UpdateMemberReport',_0x157488[_0xb1c3('0x13')],_0x417372);_0x450ddb(_0xc28b8[_0xb1c3('0x11')](0x1f4,_0x157488['message']));});});}; \ No newline at end of file +var _0x82f8=['rpc','../../config/environment','jayson/promise','request','MemberReport,\x20%s,\x20%s','MemberReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','catch','GetMemberReport','options','raw','where','attributes','limit','include','model','map','then','debug','CreateMemberReport','MemberReport','body','update','UpdateMemberReport','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x39ccf9,_0x637d5a){var _0xd8ca25=function(_0x3a6a34){while(--_0x3a6a34){_0x39ccf9['push'](_0x39ccf9['shift']());}};_0xd8ca25(++_0x637d5a);}(_0x82f8,0x157));var _0x882f=function(_0x4702b5,_0x154048){_0x4702b5=_0x4702b5-0x0;var _0x3b9bdd=_0x82f8[_0x4702b5];return _0x3b9bdd;};'use strict';var _=require('lodash');var util=require(_0x882f('0x0'));var moment=require(_0x882f('0x1'));var BPromise=require('bluebird');var rs=require(_0x882f('0x2'));var fs=require('fs');var Redis=require(_0x882f('0x3'));var db=require(_0x882f('0x4'))['db'];var utils=require(_0x882f('0x5'));var logger=require(_0x882f('0x6'))(_0x882f('0x7'));var config=require(_0x882f('0x8'));var jayson=require(_0x882f('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3c414d,_0x2c7ade,_0x3efa94){return new BPromise(function(_0x2e6f92,_0x4f9dd6){return client[_0x882f('0xa')](_0x3c414d,_0x3efa94)['then'](function(_0x29c3e8){logger['info'](_0x882f('0xb'),_0x2c7ade,'request\x20sent');logger['debug'](_0x882f('0xc'),_0x2c7ade,_0x882f('0xd'),JSON[_0x882f('0xe')](_0x29c3e8));if(_0x29c3e8[_0x882f('0xf')]){if(_0x29c3e8[_0x882f('0xf')]['code']===0x1f4){logger['error'](_0x882f('0xb'),_0x2c7ade,_0x29c3e8[_0x882f('0xf')][_0x882f('0x10')]);return _0x4f9dd6(_0x29c3e8[_0x882f('0xf')][_0x882f('0x10')]);}logger[_0x882f('0xf')](_0x882f('0xb'),_0x2c7ade,_0x29c3e8['error'][_0x882f('0x10')]);return _0x2e6f92(_0x29c3e8[_0x882f('0xf')][_0x882f('0x10')]);}else{logger[_0x882f('0x11')]('MemberReport,\x20%s,\x20%s',_0x2c7ade,'request\x20sent');_0x2e6f92(_0x29c3e8['result'][_0x882f('0x10')]);}})[_0x882f('0x12')](function(_0x3357ef){logger[_0x882f('0xf')](_0x882f('0xb'),_0x2c7ade,_0x3357ef);_0x4f9dd6(_0x3357ef);});});}exports[_0x882f('0x13')]=function(_0x3bd47c){var _0x67cc4b=this;return new Promise(function(_0x544fd5,_0x3e4847){return db['MemberReport']['findAll']({'raw':_0x3bd47c[_0x882f('0x14')]?_0x3bd47c[_0x882f('0x14')][_0x882f('0x15')]===undefined?!![]:![]:!![],'where':_0x3bd47c[_0x882f('0x14')]?_0x3bd47c['options'][_0x882f('0x16')]||null:null,'attributes':_0x3bd47c[_0x882f('0x14')]?_0x3bd47c[_0x882f('0x14')][_0x882f('0x17')]||null:null,'limit':_0x3bd47c[_0x882f('0x14')]?_0x3bd47c[_0x882f('0x14')][_0x882f('0x18')]||null:null,'include':_0x3bd47c[_0x882f('0x14')]?_0x3bd47c[_0x882f('0x14')]['include']?_['map'](_0x3bd47c['options'][_0x882f('0x19')],function(_0x2c44e5){return{'model':db[_0x2c44e5[_0x882f('0x1a')]],'as':_0x2c44e5['as'],'attributes':_0x2c44e5[_0x882f('0x17')],'include':_0x2c44e5[_0x882f('0x19')]?_[_0x882f('0x1b')](_0x2c44e5[_0x882f('0x19')],function(_0x2d6f58){return{'model':db[_0x2d6f58[_0x882f('0x1a')]],'as':_0x2d6f58['as'],'attributes':_0x2d6f58['attributes'],'include':_0x2d6f58[_0x882f('0x19')]?_[_0x882f('0x1b')](_0x2d6f58['include'],function(_0x48c52b){return{'model':db[_0x48c52b[_0x882f('0x1a')]],'as':_0x48c52b['as'],'attributes':_0x48c52b[_0x882f('0x17')]};}):[]};}):[]};}):[]:[]})[_0x882f('0x1c')](function(_0x4cf987){logger[_0x882f('0x11')](_0x882f('0x13'),_0x3bd47c);logger[_0x882f('0x1d')](_0x882f('0x13'),_0x3bd47c,JSON['stringify'](_0x4cf987));_0x544fd5(_0x4cf987);})[_0x882f('0x12')](function(_0x31d0b7){logger[_0x882f('0xf')](_0x882f('0x13'),_0x31d0b7[_0x882f('0x10')],_0x3bd47c);_0x3e4847(_0x67cc4b[_0x882f('0xf')](0x1f4,_0x31d0b7[_0x882f('0x10')]));});});};exports[_0x882f('0x1e')]=function(_0x299f62){var _0x46cb78=this;return new Promise(function(_0x97706f,_0x292532){return db[_0x882f('0x1f')]['create'](_0x299f62[_0x882f('0x20')],{'raw':_0x299f62['options']?_0x299f62[_0x882f('0x14')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x20aa1c){logger[_0x882f('0x11')]('CreateMemberReport',_0x299f62);logger[_0x882f('0x1d')](_0x882f('0x1e'),_0x299f62,JSON[_0x882f('0xe')](_0x20aa1c));_0x97706f(_0x20aa1c);})[_0x882f('0x12')](function(_0x4910ab){logger[_0x882f('0xf')]('CreateMemberReport',_0x4910ab['message'],_0x299f62);_0x292532(_0x46cb78['error'](0x1f4,_0x4910ab[_0x882f('0x10')]));});});};exports['UpdateMemberReport']=function(_0x2080ac){var _0x8ce14b=this;return new Promise(function(_0x496804,_0x5de26e){return db[_0x882f('0x1f')][_0x882f('0x21')](_0x2080ac['body'],{'raw':_0x2080ac[_0x882f('0x14')]?_0x2080ac[_0x882f('0x14')][_0x882f('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2080ac[_0x882f('0x14')]?_0x2080ac[_0x882f('0x14')]['where']||null:null,'attributes':_0x2080ac[_0x882f('0x14')]?_0x2080ac[_0x882f('0x14')][_0x882f('0x17')]||null:null,'limit':_0x2080ac[_0x882f('0x14')]?_0x2080ac[_0x882f('0x14')][_0x882f('0x18')]||null:null})[_0x882f('0x1c')](function(_0x328582){logger['info'](_0x882f('0x22'),_0x2080ac);logger[_0x882f('0x1d')](_0x882f('0x22'),_0x2080ac,JSON[_0x882f('0xe')](_0x328582));_0x496804(_0x328582);})[_0x882f('0x12')](function(_0x40a82f){logger[_0x882f('0xf')](_0x882f('0x22'),_0x40a82f['message'],_0x2080ac);_0x5de26e(_0x8ce14b[_0x882f('0xf')](0x1f4,_0x40a82f[_0x882f('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 98fd528..3003517 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 _0x8813=['index','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./migration.controller','get'];(function(_0x13c153,_0x51e826){var _0x1e3a2e=function(_0x215e95){while(--_0x215e95){_0x13c153['push'](_0x13c153['shift']());}};_0x1e3a2e(++_0x51e826);}(_0x8813,0x86));var _0x3881=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8813[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x3881('0x0'));var util=require('util');var path=require(_0x3881('0x1'));var timeout=require(_0x3881('0x2'));var express=require(_0x3881('0x3'));var router=express[_0x3881('0x4')]();var fs_extra=require(_0x3881('0x5'));var auth=require(_0x3881('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3881('0x7'));router[_0x3881('0x8')]('/',controller[_0x3881('0x9')]);module[_0x3881('0xa')]=router; \ No newline at end of file +var _0x01e8=['get','exports','multer','util','path','express','fs-extra','../../components/interaction/service','./migration.controller'];(function(_0x846a6b,_0x238622){var _0x29d50c=function(_0x348bba){while(--_0x348bba){_0x846a6b['push'](_0x846a6b['shift']());}};_0x29d50c(++_0x238622);}(_0x01e8,0x6e));var _0x801e=function(_0x4fc212,_0x1087aa){_0x4fc212=_0x4fc212-0x0;var _0x252317=_0x01e8[_0x4fc212];return _0x252317;};'use strict';var multer=require(_0x801e('0x0'));var util=require(_0x801e('0x1'));var path=require(_0x801e('0x2'));var timeout=require('connect-timeout');var express=require(_0x801e('0x3'));var router=express['Router']();var fs_extra=require(_0x801e('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x801e('0x5'));var config=require('../../config/environment');var controller=require(_0x801e('0x6'));router[_0x801e('0x7')]('/',controller['index']);module[_0x801e('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 1389be1..63c67e0 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 _0x5574=['exports','version'];(function(_0x21af3a,_0x386e1d){var _0x268a49=function(_0x41a650){while(--_0x41a650){_0x21af3a['push'](_0x21af3a['shift']());}};_0x268a49(++_0x386e1d);}(_0x5574,0x16c));var _0x4557=function(_0xe50313,_0x56a52b){_0xe50313=_0xe50313-0x0;var _0x5cc811=_0x5574[_0xe50313];return _0x5cc811;};'use strict';var Sequelize=require('sequelize');module[_0x4557('0x0')]={'version':{'type':Sequelize['STRING'],'unique':_0x4557('0x1')}}; \ No newline at end of file +var _0xcbc9=['version','sequelize','exports'];(function(_0x21f266,_0x2cecb6){var _0x57c96a=function(_0x409519){while(--_0x409519){_0x21f266['push'](_0x21f266['shift']());}};_0x57c96a(++_0x2cecb6);}(_0xcbc9,0x1e4));var _0x9cbc=function(_0x39e164,_0x2cb93b){_0x39e164=_0x39e164-0x0;var _0x13fa6b=_0xcbc9[_0x39e164];return _0x13fa6b;};'use strict';var Sequelize=require(_0x9cbc('0x0'));module[_0x9cbc('0x1')]={'version':{'type':Sequelize['STRING'],'unique':_0x9cbc('0x2')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 0e3f06c..a29cbfe 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 _0x180e=['end','json','undefined','limit','count','offset','Content-Range','apply','update','destroy','error','name','send','index','map','fieldName','type','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','VIRTUAL','merge','options','where','Migration','then','includeAll','findAll','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','sendStatus','status'];(function(_0x4d31fb,_0x40d22a){var _0x3ffbe7=function(_0x423b21){while(--_0x423b21){_0x4d31fb['push'](_0x4d31fb['shift']());}};_0x3ffbe7(++_0x40d22a);}(_0x180e,0xa1));var _0xe180=function(_0x4a746e,_0x3166c0){_0x4a746e=_0x4a746e-0x0;var _0x451a87=_0x180e[_0x4a746e];return _0x451a87;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe180('0x0'));var zipdir=require(_0xe180('0x1'));var jsonpatch=require(_0xe180('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe180('0x3'));var Mustache=require(_0xe180('0x4'));var util=require(_0xe180('0x5'));var path=require(_0xe180('0x6'));var sox=require(_0xe180('0x7'));var csv=require(_0xe180('0x8'));var ejs=require(_0xe180('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe180('0xa'));var squel=require(_0xe180('0xb'));var crypto=require(_0xe180('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xe180('0xd'));var toCsv=require(_0xe180('0x8'));var querystring=require(_0xe180('0xe'));var Papa=require(_0xe180('0xf'));var Redis=require(_0xe180('0x10'));var authService=require(_0xe180('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe180('0x12'));var logger=require(_0xe180('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4fbc07,_0x21d05c){_0x21d05c=_0x21d05c||0xcc;return function(_0x543803){if(_0x543803){return _0x4fbc07[_0xe180('0x14')](_0x21d05c);}return _0x4fbc07[_0xe180('0x15')](_0x21d05c)[_0xe180('0x16')]();};}function respondWithResult(_0x390b7f,_0x4b6c34){_0x4b6c34=_0x4b6c34||0xc8;return function(_0x531425){if(_0x531425){return _0x390b7f[_0xe180('0x15')](_0x4b6c34)[_0xe180('0x17')](_0x531425);}};}function respondWithFilteredResult(_0x118271,_0x2c252c){return function(_0x1dcf7b){if(_0x1dcf7b){var _0x42920f=typeof _0x2c252c['offset']===_0xe180('0x18')&&typeof _0x2c252c[_0xe180('0x19')]===_0xe180('0x18');var _0x213360=_0x1dcf7b[_0xe180('0x1a')];var _0x12591c=_0x42920f?0x0:_0x2c252c[_0xe180('0x1b')];var _0x347084=_0x42920f?_0x1dcf7b[_0xe180('0x1a')]:_0x2c252c[_0xe180('0x1b')]+_0x2c252c['limit'];var _0xbad079;if(_0x347084>=_0x213360){_0x347084=_0x213360;_0xbad079=0xc8;}else{_0xbad079=0xce;}_0x118271[_0xe180('0x15')](_0xbad079);return _0x118271['set'](_0xe180('0x1c'),_0x12591c+'-'+_0x347084+'/'+_0x213360)[_0xe180('0x17')](_0x1dcf7b);}return null;};}function patchUpdates(_0x54a08a){return function(_0x4c095c){try{jsonpatch[_0xe180('0x1d')](_0x4c095c,_0x54a08a,!![]);}catch(_0x330283){return BPromise['reject'](_0x330283);}return _0x4c095c['save']();};}function saveUpdates(_0x269cc6,_0x4f042a){return function(_0x1f1a9a){if(_0x1f1a9a){return _0x1f1a9a[_0xe180('0x1e')](_0x269cc6)['then'](function(_0xda94b5){return _0xda94b5;});}return null;};}function removeEntity(_0x33347b,_0x4556f2){return function(_0x2d9868){if(_0x2d9868){return _0x2d9868[_0xe180('0x1f')]()['then'](function(){_0x33347b[_0xe180('0x15')](0xcc)[_0xe180('0x16')]();});}};}function handleEntityNotFound(_0x4ea1ed,_0x542e1d){return function(_0x4a3db5){if(!_0x4a3db5){_0x4ea1ed[_0xe180('0x14')](0x194);}return _0x4a3db5;};}function handleError(_0x4f584,_0xec5551){_0xec5551=_0xec5551||0x1f4;return function(_0x57b30a){logger[_0xe180('0x20')](_0x57b30a['stack']);if(_0x57b30a[_0xe180('0x21')]){delete _0x57b30a[_0xe180('0x21')];}_0x4f584[_0xe180('0x15')](_0xec5551)[_0xe180('0x22')](_0x57b30a);};}exports[_0xe180('0x23')]=function(_0xedc731,_0x22fbc2){var _0x5277f5={},_0x4a3634={},_0x3dd15d={'count':0x0,'rows':[]};var _0x42d854=_[_0xe180('0x24')](db['Migration']['rawAttributes'],function(_0x1b02fc){return{'name':_0x1b02fc[_0xe180('0x25')],'type':_0x1b02fc[_0xe180('0x26')]['key']};});_0x4a3634[_0xe180('0x27')]=_[_0xe180('0x24')](_0x42d854,'name');_0x4a3634['query']=_[_0xe180('0x28')](_0xedc731[_0xe180('0x29')]);_0x4a3634[_0xe180('0x2a')]=_['intersection'](_0x4a3634[_0xe180('0x27')],_0x4a3634[_0xe180('0x29')]);_0x5277f5[_0xe180('0x2b')]=_[_0xe180('0x2c')](_0x4a3634[_0xe180('0x27')],qs[_0xe180('0x2d')](_0xedc731['query']['fields']));_0x5277f5[_0xe180('0x2b')]=_0x5277f5[_0xe180('0x2b')][_0xe180('0x2e')]?_0x5277f5[_0xe180('0x2b')]:_0x4a3634['model'];if(!_0xedc731['query'][_0xe180('0x2f')](_0xe180('0x30'))){_0x5277f5[_0xe180('0x19')]=qs[_0xe180('0x19')](_0xedc731[_0xe180('0x29')][_0xe180('0x19')]);_0x5277f5['offset']=qs[_0xe180('0x1b')](_0xedc731[_0xe180('0x29')][_0xe180('0x1b')]);}_0x5277f5[_0xe180('0x31')]=qs[_0xe180('0x32')](_0xedc731[_0xe180('0x29')][_0xe180('0x32')]);_0x5277f5['where']=qs[_0xe180('0x2a')](_[_0xe180('0x33')](_0xedc731[_0xe180('0x29')],_0x4a3634[_0xe180('0x2a')]),_0x42d854);if(_0xedc731[_0xe180('0x29')][_0xe180('0x34')]){_0x5277f5['where']=_['merge'](_0x5277f5['where'],{'$or':_['map'](_0x42d854,function(_0x288319){if(_0x288319[_0xe180('0x26')]!==_0xe180('0x35')){var _0x1f329e={};_0x1f329e[_0x288319[_0xe180('0x21')]]={'$like':'%'+_0xedc731['query'][_0xe180('0x34')]+'%'};return _0x1f329e;}})});}_0x5277f5=_[_0xe180('0x36')]({},_0x5277f5,_0xedc731[_0xe180('0x37')]);var _0x24e62a={'where':_0x5277f5[_0xe180('0x38')]};return db[_0xe180('0x39')][_0xe180('0x1a')](_0x24e62a)[_0xe180('0x3a')](function(_0x288f45){_0x3dd15d[_0xe180('0x1a')]=_0x288f45;if(_0xedc731[_0xe180('0x29')][_0xe180('0x3b')]){_0x5277f5['include']=[{'all':!![]}];}return db[_0xe180('0x39')][_0xe180('0x3c')](_0x5277f5);})[_0xe180('0x3a')](function(_0x201eb2){_0x3dd15d['rows']=_0x201eb2;return _0x3dd15d;})[_0xe180('0x3a')](respondWithFilteredResult(_0x22fbc2,_0x5277f5))['catch'](handleError(_0x22fbc2,null));}; \ No newline at end of file +var _0xa752=['catch','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','json','apply','save','update','stack','name','send','index','map','Migration','fieldName','type','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','then','include'];(function(_0x216a3f,_0x325b5b){var _0x14bba2=function(_0x330b86){while(--_0x330b86){_0x216a3f['push'](_0x216a3f['shift']());}};_0x14bba2(++_0x325b5b);}(_0xa752,0x141));var _0x2a75=function(_0x525320,_0x8f2948){_0x525320=_0x525320-0x0;var _0x261ead=_0xa752[_0x525320];return _0x261ead;};'use strict';var emlformat=require(_0x2a75('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2a75('0x1'));var jsonpatch=require(_0x2a75('0x2'));var rp=require(_0x2a75('0x3'));var moment=require('moment');var BPromise=require(_0x2a75('0x4'));var Mustache=require(_0x2a75('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x2a75('0x6'));var ejs=require(_0x2a75('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2a75('0x8'));var squel=require(_0x2a75('0x9'));var crypto=require(_0x2a75('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x2a75('0xb'));var toCsv=require(_0x2a75('0x6'));var querystring=require(_0x2a75('0xc'));var Papa=require(_0x2a75('0xd'));var Redis=require('ioredis');var authService=require(_0x2a75('0xe'));var qs=require(_0x2a75('0xf'));var as=require(_0x2a75('0x10'));var hardwareService=require(_0x2a75('0x11'));var logger=require(_0x2a75('0x12'))(_0x2a75('0x13'));var utils=require(_0x2a75('0x14'));var config=require(_0x2a75('0x15'));var licenseUtil=require(_0x2a75('0x16'));var db=require(_0x2a75('0x17'))['db'];function respondWithStatusCode(_0x26ec7a,_0x284f91){_0x284f91=_0x284f91||0xcc;return function(_0x73453d){if(_0x73453d){return _0x26ec7a[_0x2a75('0x18')](_0x284f91);}return _0x26ec7a[_0x2a75('0x19')](_0x284f91)[_0x2a75('0x1a')]();};}function respondWithResult(_0x1e9121,_0x57103d){_0x57103d=_0x57103d||0xc8;return function(_0x109122){if(_0x109122){return _0x1e9121[_0x2a75('0x19')](_0x57103d)['json'](_0x109122);}};}function respondWithFilteredResult(_0xac8977,_0x598ab9){return function(_0x4d521d){if(_0x4d521d){var _0x4ecdea=typeof _0x598ab9[_0x2a75('0x1b')]===_0x2a75('0x1c')&&typeof _0x598ab9[_0x2a75('0x1d')]==='undefined';var _0x2d50c7=_0x4d521d[_0x2a75('0x1e')];var _0x26e294=_0x4ecdea?0x0:_0x598ab9[_0x2a75('0x1b')];var _0x30c356=_0x4ecdea?_0x4d521d[_0x2a75('0x1e')]:_0x598ab9[_0x2a75('0x1b')]+_0x598ab9[_0x2a75('0x1d')];var _0x217199;if(_0x30c356>=_0x2d50c7){_0x30c356=_0x2d50c7;_0x217199=0xc8;}else{_0x217199=0xce;}_0xac8977[_0x2a75('0x19')](_0x217199);return _0xac8977['set']('Content-Range',_0x26e294+'-'+_0x30c356+'/'+_0x2d50c7)[_0x2a75('0x1f')](_0x4d521d);}return null;};}function patchUpdates(_0x278f35){return function(_0x407e24){try{jsonpatch[_0x2a75('0x20')](_0x407e24,_0x278f35,!![]);}catch(_0x451c9d){return BPromise['reject'](_0x451c9d);}return _0x407e24[_0x2a75('0x21')]();};}function saveUpdates(_0x79dadf,_0x4fb9e4){return function(_0x4e39da){if(_0x4e39da){return _0x4e39da[_0x2a75('0x22')](_0x79dadf)['then'](function(_0x36ec9b){return _0x36ec9b;});}return null;};}function removeEntity(_0x175eda,_0x21a0c7){return function(_0x3b3800){if(_0x3b3800){return _0x3b3800['destroy']()['then'](function(){_0x175eda[_0x2a75('0x19')](0xcc)[_0x2a75('0x1a')]();});}};}function handleEntityNotFound(_0x47e58c,_0x45b1db){return function(_0x439f32){if(!_0x439f32){_0x47e58c[_0x2a75('0x18')](0x194);}return _0x439f32;};}function handleError(_0xded0a0,_0xa75375){_0xa75375=_0xa75375||0x1f4;return function(_0x17b792){logger['error'](_0x17b792[_0x2a75('0x23')]);if(_0x17b792[_0x2a75('0x24')]){delete _0x17b792['name'];}_0xded0a0[_0x2a75('0x19')](_0xa75375)[_0x2a75('0x25')](_0x17b792);};}exports[_0x2a75('0x26')]=function(_0x2e782e,_0x324ab7){var _0x267cb0={},_0x24abd6={},_0x14f689={'count':0x0,'rows':[]};var _0x1a74e4=_[_0x2a75('0x27')](db[_0x2a75('0x28')]['rawAttributes'],function(_0x5349a7){return{'name':_0x5349a7[_0x2a75('0x29')],'type':_0x5349a7[_0x2a75('0x2a')]['key']};});_0x24abd6[_0x2a75('0x2b')]=_[_0x2a75('0x27')](_0x1a74e4,_0x2a75('0x24'));_0x24abd6[_0x2a75('0x2c')]=_[_0x2a75('0x2d')](_0x2e782e[_0x2a75('0x2c')]);_0x24abd6['filters']=_['intersection'](_0x24abd6[_0x2a75('0x2b')],_0x24abd6['query']);_0x267cb0[_0x2a75('0x2e')]=_[_0x2a75('0x2f')](_0x24abd6[_0x2a75('0x2b')],qs[_0x2a75('0x30')](_0x2e782e[_0x2a75('0x2c')][_0x2a75('0x30')]));_0x267cb0[_0x2a75('0x2e')]=_0x267cb0[_0x2a75('0x2e')][_0x2a75('0x31')]?_0x267cb0[_0x2a75('0x2e')]:_0x24abd6[_0x2a75('0x2b')];if(!_0x2e782e[_0x2a75('0x2c')][_0x2a75('0x32')](_0x2a75('0x33'))){_0x267cb0['limit']=qs[_0x2a75('0x1d')](_0x2e782e['query'][_0x2a75('0x1d')]);_0x267cb0[_0x2a75('0x1b')]=qs[_0x2a75('0x1b')](_0x2e782e['query']['offset']);}_0x267cb0[_0x2a75('0x34')]=qs[_0x2a75('0x35')](_0x2e782e['query'][_0x2a75('0x35')]);_0x267cb0[_0x2a75('0x36')]=qs[_0x2a75('0x37')](_[_0x2a75('0x38')](_0x2e782e[_0x2a75('0x2c')],_0x24abd6[_0x2a75('0x37')]),_0x1a74e4);if(_0x2e782e[_0x2a75('0x2c')][_0x2a75('0x39')]){_0x267cb0['where']=_['merge'](_0x267cb0[_0x2a75('0x36')],{'$or':_[_0x2a75('0x27')](_0x1a74e4,function(_0x43d034){if(_0x43d034[_0x2a75('0x2a')]!==_0x2a75('0x3a')){var _0x4bd921={};_0x4bd921[_0x43d034['name']]={'$like':'%'+_0x2e782e['query'][_0x2a75('0x39')]+'%'};return _0x4bd921;}})});}_0x267cb0=_[_0x2a75('0x3b')]({},_0x267cb0,_0x2e782e[_0x2a75('0x3c')]);var _0x4734a3={'where':_0x267cb0['where']};return db[_0x2a75('0x28')][_0x2a75('0x1e')](_0x4734a3)[_0x2a75('0x3d')](function(_0x3989f5){_0x14f689[_0x2a75('0x1e')]=_0x3989f5;if(_0x2e782e[_0x2a75('0x2c')]['includeAll']){_0x267cb0[_0x2a75('0x3e')]=[{'all':!![]}];}return db[_0x2a75('0x28')]['findAll'](_0x267cb0);})[_0x2a75('0x3d')](function(_0x1b42ce){_0x14f689['rows']=_0x1b42ce;return _0x14f689;})['then'](respondWithFilteredResult(_0x324ab7,_0x267cb0))[_0x2a75('0x3f')](handleError(_0x324ab7,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index ff50582..c7614cf 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 _0xd2d4=['request-promise','path','../../config/environment','./migration.attributes','exports','Migration','lodash','../../config/logger','moment','bluebird'];(function(_0x5862e2,_0x1f7ad0){var _0x1640ec=function(_0x2fe79a){while(--_0x2fe79a){_0x5862e2['push'](_0x5862e2['shift']());}};_0x1640ec(++_0x1f7ad0);}(_0xd2d4,0x128));var _0x4d2d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd2d4[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x4d2d('0x0'));var util=require('util');var logger=require(_0x4d2d('0x1'))('api');var moment=require(_0x4d2d('0x2'));var BPromise=require(_0x4d2d('0x3'));var rp=require(_0x4d2d('0x4'));var fs=require('fs');var path=require(_0x4d2d('0x5'));var rimraf=require('rimraf');var config=require(_0x4d2d('0x6'));var attributes=require(_0x4d2d('0x7'));module[_0x4d2d('0x8')]=function(_0x336772,_0x4cc1fa){return _0x336772['define'](_0x4d2d('0x9'),attributes,{'tableName':'migrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2c5a=['migrations','util','../../config/logger','bluebird','request-promise','path','../../config/environment','./migration.attributes','exports','define','Migration'];(function(_0xf906a2,_0x2a4c09){var _0xfe31b1=function(_0x4bf590){while(--_0x4bf590){_0xf906a2['push'](_0xf906a2['shift']());}};_0xfe31b1(++_0x2a4c09);}(_0x2c5a,0x11f));var _0xa2c5=function(_0x34eb0a,_0x1e76d3){_0x34eb0a=_0x34eb0a-0x0;var _0x9e84d1=_0x2c5a[_0x34eb0a];return _0x9e84d1;};'use strict';var _=require('lodash');var util=require(_0xa2c5('0x0'));var logger=require(_0xa2c5('0x1'))('api');var moment=require('moment');var BPromise=require(_0xa2c5('0x2'));var rp=require(_0xa2c5('0x3'));var fs=require('fs');var path=require(_0xa2c5('0x4'));var rimraf=require('rimraf');var config=require(_0xa2c5('0x5'));var attributes=require(_0xa2c5('0x6'));module[_0xa2c5('0x7')]=function(_0x5119b7,_0x1da697){return _0x5119b7[_0xa2c5('0x8')](_0xa2c5('0x9'),attributes,{'tableName':_0xa2c5('0xa'),'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 cb73126..07570f3 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 _0x4b8a=['info','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x173def,_0x45584e){var _0x5444ec=function(_0x504043){while(--_0x504043){_0x173def['push'](_0x173def['shift']());}};_0x5444ec(++_0x45584e);}(_0x4b8a,0xd3));var _0xa4b8=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x4b8a[_0x3b380d];return _0x54502b;};'use strict';var _=require('lodash');var util=require(_0xa4b8('0x0'));var moment=require('moment');var BPromise=require(_0xa4b8('0x1'));var rs=require(_0xa4b8('0x2'));var fs=require('fs');var Redis=require(_0xa4b8('0x3'));var db=require(_0xa4b8('0x4'))['db'];var utils=require(_0xa4b8('0x5'));var logger=require(_0xa4b8('0x6'))(_0xa4b8('0x7'));var config=require(_0xa4b8('0x8'));var jayson=require(_0xa4b8('0x9'));var client=jayson[_0xa4b8('0xa')][_0xa4b8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2de84d,_0x455722,_0x1fea78){return new BPromise(function(_0x517970,_0x4632f3){return client[_0xa4b8('0xc')](_0x2de84d,_0x1fea78)[_0xa4b8('0xd')](function(_0x3fe4ed){logger[_0xa4b8('0xe')](_0xa4b8('0xf'),_0x455722,_0xa4b8('0x10'));logger[_0xa4b8('0x11')](_0xa4b8('0x12'),_0x455722,_0xa4b8('0x10'),JSON[_0xa4b8('0x13')](_0x3fe4ed));if(_0x3fe4ed[_0xa4b8('0x14')]){if(_0x3fe4ed[_0xa4b8('0x14')][_0xa4b8('0x15')]===0x1f4){logger['error']('Migration,\x20%s,\x20%s',_0x455722,_0x3fe4ed[_0xa4b8('0x14')]['message']);return _0x4632f3(_0x3fe4ed[_0xa4b8('0x14')][_0xa4b8('0x16')]);}logger['error'](_0xa4b8('0xf'),_0x455722,_0x3fe4ed[_0xa4b8('0x14')][_0xa4b8('0x16')]);return _0x517970(_0x3fe4ed[_0xa4b8('0x14')][_0xa4b8('0x16')]);}else{logger[_0xa4b8('0xe')](_0xa4b8('0xf'),_0x455722,_0xa4b8('0x10'));_0x517970(_0x3fe4ed[_0xa4b8('0x17')]['message']);}})[_0xa4b8('0x18')](function(_0x3c8ebb){logger['error'](_0xa4b8('0xf'),_0x455722,_0x3c8ebb);_0x4632f3(_0x3c8ebb);});});} \ No newline at end of file +var _0xd84c=['debug','stringify','error','code','Migration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent'];(function(_0xa8883,_0x1f107f){var _0x479426=function(_0x4e56b9){while(--_0x4e56b9){_0xa8883['push'](_0xa8883['shift']());}};_0x479426(++_0x1f107f);}(_0xd84c,0x102));var _0xcd84=function(_0x313f3c,_0x3aa28b){_0x313f3c=_0x313f3c-0x0;var _0x505716=_0xd84c[_0x313f3c];return _0x505716;};'use strict';var _=require(_0xcd84('0x0'));var util=require(_0xcd84('0x1'));var moment=require(_0xcd84('0x2'));var BPromise=require(_0xcd84('0x3'));var rs=require(_0xcd84('0x4'));var fs=require('fs');var Redis=require(_0xcd84('0x5'));var db=require(_0xcd84('0x6'))['db'];var utils=require(_0xcd84('0x7'));var logger=require(_0xcd84('0x8'))('rpc');var config=require(_0xcd84('0x9'));var jayson=require(_0xcd84('0xa'));var client=jayson[_0xcd84('0xb')][_0xcd84('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x520d49,_0x2b5383,_0x22c811){return new BPromise(function(_0x3f3617,_0x5408e2){return client[_0xcd84('0xd')](_0x520d49,_0x22c811)[_0xcd84('0xe')](function(_0xec34a2){logger[_0xcd84('0xf')]('Migration,\x20%s,\x20%s',_0x2b5383,_0xcd84('0x10'));logger[_0xcd84('0x11')]('Migration,\x20%s,\x20%s,\x20%s',_0x2b5383,_0xcd84('0x10'),JSON[_0xcd84('0x12')](_0xec34a2));if(_0xec34a2[_0xcd84('0x13')]){if(_0xec34a2['error'][_0xcd84('0x14')]===0x1f4){logger[_0xcd84('0x13')](_0xcd84('0x15'),_0x2b5383,_0xec34a2[_0xcd84('0x13')]['message']);return _0x5408e2(_0xec34a2[_0xcd84('0x13')][_0xcd84('0x16')]);}logger[_0xcd84('0x13')](_0xcd84('0x15'),_0x2b5383,_0xec34a2[_0xcd84('0x13')][_0xcd84('0x16')]);return _0x3f3617(_0xec34a2[_0xcd84('0x13')][_0xcd84('0x16')]);}else{logger[_0xcd84('0xf')](_0xcd84('0x15'),_0x2b5383,_0xcd84('0x10'));_0x3f3617(_0xec34a2[_0xcd84('0x17')][_0xcd84('0x16')]);}})[_0xcd84('0x18')](function(_0xfc4ec7){logger[_0xcd84('0x13')](_0xcd84('0x15'),_0x2b5383,_0xfc4ec7);_0x5408e2(_0xfc4ec7);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 23f63a0..c279340 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 _0xc0d7=['index','/:id','isAuthenticated','post','create','put','update','destroy','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./network.controller','get'];(function(_0x5a885a,_0x52d091){var _0x44a0ef=function(_0x2e911){while(--_0x2e911){_0x5a885a['push'](_0x5a885a['shift']());}};_0x44a0ef(++_0x52d091);}(_0xc0d7,0x7f));var _0x7c0d=function(_0xf7b607,_0x1ee1ed){_0xf7b607=_0xf7b607-0x0;var _0x380ced=_0xc0d7[_0xf7b607];return _0x380ced;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x7c0d('0x0'));var express=require(_0x7c0d('0x1'));var router=express[_0x7c0d('0x2')]();var fs_extra=require(_0x7c0d('0x3'));var auth=require(_0x7c0d('0x4'));var interaction=require(_0x7c0d('0x5'));var config=require(_0x7c0d('0x6'));var controller=require(_0x7c0d('0x7'));router[_0x7c0d('0x8')]('/',auth['isAuthenticated'](),controller[_0x7c0d('0x9')]);router[_0x7c0d('0x8')](_0x7c0d('0xa'),auth[_0x7c0d('0xb')](),controller['show']);router[_0x7c0d('0xc')]('/',auth[_0x7c0d('0xb')](),controller[_0x7c0d('0xd')]);router[_0x7c0d('0xe')]('/:id',auth[_0x7c0d('0xb')](),controller[_0x7c0d('0xf')]);router['delete']('/:id',auth[_0x7c0d('0xb')](),controller[_0x7c0d('0x10')]);module['exports']=router; \ No newline at end of file +var _0x52a1=['show','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./network.controller','get','isAuthenticated'];(function(_0x594b1b,_0xb70583){var _0x256560=function(_0x178f0f){while(--_0x178f0f){_0x594b1b['push'](_0x594b1b['shift']());}};_0x256560(++_0xb70583);}(_0x52a1,0x1b7));var _0x152a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x52a1[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x152a('0x0'));var util=require(_0x152a('0x1'));var path=require(_0x152a('0x2'));var timeout=require(_0x152a('0x3'));var express=require(_0x152a('0x4'));var router=express[_0x152a('0x5')]();var fs_extra=require(_0x152a('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x152a('0x7'));var config=require('../../config/environment');var controller=require(_0x152a('0x8'));router[_0x152a('0x9')]('/',auth[_0x152a('0xa')](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x152a('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x152a('0xc')]);router[_0x152a('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x152a('0xe')]);router[_0x152a('0xf')]('/:id',auth[_0x152a('0xa')](),controller[_0x152a('0x10')]);module[_0x152a('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 3d785f2..72f09b1 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 _0x6518=['localnet','stun','turn','STRING','ENUM'];(function(_0x47dacb,_0x547465){var _0x5ae4e4=function(_0x8d302d){while(--_0x8d302d){_0x47dacb['push'](_0x47dacb['shift']());}};_0x5ae4e4(++_0x547465);}(_0x6518,0x8b));var _0x8651=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0x6518[_0x4c7fb5];return _0x2e10ac;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x8651('0x0')](_0x8651('0x1'),'externip',_0x8651('0x2'),_0x8651('0x3'))},'value':{'type':Sequelize[_0x8651('0x4')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x4882=['exports','ENUM','localnet','externip','stun','turn','STRING','sequelize'];(function(_0x2c8ec1,_0x37988b){var _0x4708f8=function(_0x4d30e4){while(--_0x4d30e4){_0x2c8ec1['push'](_0x2c8ec1['shift']());}};_0x4708f8(++_0x37988b);}(_0x4882,0x14f));var _0x2488=function(_0x16547f,_0x162a2e){_0x16547f=_0x16547f-0x0;var _0x40ac82=_0x4882[_0x16547f];return _0x40ac82;};'use strict';var Sequelize=require(_0x2488('0x0'));module[_0x2488('0x1')]={'type':{'type':Sequelize[_0x2488('0x2')](_0x2488('0x3'),_0x2488('0x4'),_0x2488('0x5'),_0x2488('0x6'))},'value':{'type':Sequelize[_0x2488('0x7')]},'username':{'type':Sequelize[_0x2488('0x7')]},'password':{'type':Sequelize[_0x2488('0x7')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index 866d0e8..5f0ecea 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 _0x3028=['utf8','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','TURN','readFileSync','server/files/templates/turn_multiple.ejs','render','/etc/asterisk/turn_xcally.conf','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','update','destroy','server/files/templates/network.ejs','util','path','../../components/parsers/qs','api','../../config/environment','../../mysqldb','jayson/promise','client','request','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','status','offset','undefined','count','limit','Content-Range','json','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','Network','includeAll','include','findAll','rows','show','params','keys','options','find','create','body','toUpperCase','STUN','join','root','server/files/templates/stun_multiple.ejs'];(function(_0x490e61,_0x7f848e){var _0x169bc6=function(_0x1c70bf){while(--_0x1c70bf){_0x490e61['push'](_0x490e61['shift']());}};_0x169bc6(++_0x7f848e);}(_0x3028,0x68));var _0x8302=function(_0x36332c,_0xbd7e99){_0x36332c=_0x36332c-0x0;var _0x11eaba=_0x3028[_0x36332c];return _0x11eaba;};'use strict';var util=require(_0x8302('0x0'));var path=require(_0x8302('0x1'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var qs=require(_0x8302('0x2'));var logger=require('../../config/logger')(_0x8302('0x3'));var config=require(_0x8302('0x4'));var db=require(_0x8302('0x5'))['db'];var jayson=require(_0x8302('0x6'));var client=jayson[_0x8302('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x588a07,_0xb9785f,_0x4c4373,_0x2eaeed){return new Promise(function(_0x1fc2ec,_0x2aa198){var _0x3d0daf=_0x2eaeed||client;return _0x3d0daf[_0x8302('0x8')](_0x588a07,_0x4c4373)[_0x8302('0x9')](function(_0x56f763){logger[_0x8302('0xa')](_0x8302('0xb'),_0xb9785f,_0x8302('0xc'));logger[_0x8302('0xd')](_0x8302('0xe'),_0xb9785f,_0x8302('0xc'),JSON[_0x8302('0xf')](_0x56f763));if(_0x56f763[_0x8302('0x10')]){if(_0x56f763[_0x8302('0x10')]['code']===0x1f4){logger['error'](_0x8302('0xb'),_0xb9785f,_0x56f763[_0x8302('0x10')][_0x8302('0x11')]);return _0x2aa198(_0x56f763['error'][_0x8302('0x11')]);}logger[_0x8302('0x10')](_0x8302('0xb'),_0xb9785f,_0x56f763[_0x8302('0x10')][_0x8302('0x11')]);return _0x1fc2ec(_0x56f763['error'][_0x8302('0x11')]);}else{logger[_0x8302('0xa')](_0x8302('0xb'),_0xb9785f,_0x8302('0xc'));_0x1fc2ec(_0x56f763[_0x8302('0x12')]['message']);}})[_0x8302('0x13')](function(_0x300b73){logger[_0x8302('0x10')](_0x8302('0xb'),_0xb9785f,_0x300b73);_0x2aa198(_0x300b73);});});}function respondWithResult(_0x48ebd0,_0x186d11){_0x186d11=_0x186d11||0xc8;return function(_0x5ca502){if(_0x5ca502){return _0x48ebd0[_0x8302('0x14')](_0x186d11)['json'](_0x5ca502);}};}function respondWithFilteredResult(_0x1dcd7b,_0x5eb943){return function(_0x1cf121){if(_0x1cf121){var _0x5ecaf2=typeof _0x5eb943[_0x8302('0x15')]===_0x8302('0x16')&&typeof _0x5eb943['limit']==='undefined';var _0x242349=_0x1cf121[_0x8302('0x17')];var _0x2b6869=_0x5ecaf2?0x0:_0x5eb943[_0x8302('0x15')];var _0x3270e7=_0x5ecaf2?_0x1cf121['count']:_0x5eb943[_0x8302('0x15')]+_0x5eb943[_0x8302('0x18')];var _0x165d14;if(_0x3270e7>=_0x242349){_0x3270e7=_0x242349;_0x165d14=0xc8;}else{_0x165d14=0xce;}_0x1dcd7b[_0x8302('0x14')](_0x165d14);return _0x1dcd7b['set'](_0x8302('0x19'),_0x2b6869+'-'+_0x3270e7+'/'+_0x242349)[_0x8302('0x1a')](_0x1cf121);}return null;};}function saveUpdates(_0x4f5319){return function(_0x47a44d){if(_0x47a44d){return _0x47a44d['update'](_0x4f5319)[_0x8302('0x9')](function(_0x3d097f){return _0x3d097f;});}return null;};}function removeEntity(_0x166145){return function(_0x4687e3){if(_0x4687e3){return _0x4687e3['destroy']()[_0x8302('0x9')](function(){_0x166145['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x319cde){return function(_0x56674f){if(!_0x56674f){_0x319cde[_0x8302('0x1b')](0x194);}return _0x56674f;};}function handleError(_0x2693a3,_0x55f43a){_0x55f43a=_0x55f43a||0x1f4;return function(_0x4b3b00){logger['error'](_0x4b3b00[_0x8302('0x1c')]);if(_0x4b3b00[_0x8302('0x1d')]){delete _0x4b3b00[_0x8302('0x1d')];}_0x2693a3[_0x8302('0x14')](_0x55f43a)[_0x8302('0x1e')](_0x4b3b00);};}exports[_0x8302('0x1f')]=function(_0x48087b,_0x17b846){var _0x46159a={},_0x235ded={},_0x43edda={'count':0x0,'rows':[]};var _0x408b49=_[_0x8302('0x20')](db['Network'][_0x8302('0x21')],function(_0x1628b1){return{'name':_0x1628b1[_0x8302('0x22')],'type':_0x1628b1[_0x8302('0x23')][_0x8302('0x24')]};});_0x235ded[_0x8302('0x25')]=_[_0x8302('0x20')](_0x408b49,_0x8302('0x1d'));_0x235ded[_0x8302('0x26')]=_['keys'](_0x48087b['query']);_0x235ded['filters']=_[_0x8302('0x27')](_0x235ded[_0x8302('0x25')],_0x235ded[_0x8302('0x26')]);_0x46159a['attributes']=_[_0x8302('0x27')](_0x235ded[_0x8302('0x25')],qs[_0x8302('0x28')](_0x48087b[_0x8302('0x26')][_0x8302('0x28')]));_0x46159a[_0x8302('0x29')]=_0x46159a['attributes'][_0x8302('0x2a')]?_0x46159a[_0x8302('0x29')]:_0x235ded[_0x8302('0x25')];if(!_0x48087b[_0x8302('0x26')][_0x8302('0x2b')](_0x8302('0x2c'))){_0x46159a[_0x8302('0x18')]=qs['limit'](_0x48087b['query'][_0x8302('0x18')]);_0x46159a['offset']=qs['offset'](_0x48087b[_0x8302('0x26')][_0x8302('0x15')]);}_0x46159a[_0x8302('0x2d')]=qs['sort'](_0x48087b['query'][_0x8302('0x2e')]);_0x46159a[_0x8302('0x2f')]=qs['filters'](_[_0x8302('0x30')](_0x48087b[_0x8302('0x26')],_0x235ded[_0x8302('0x31')]),_0x408b49);if(_0x48087b['query'][_0x8302('0x32')]){_0x46159a[_0x8302('0x2f')]=_[_0x8302('0x33')](_0x46159a['where'],{'$or':_[_0x8302('0x20')](_0x408b49,function(_0x3331cd){if(_0x3331cd[_0x8302('0x23')]!==_0x8302('0x34')){var _0x3e4df1={};_0x3e4df1[_0x3331cd[_0x8302('0x1d')]]={'$like':'%'+_0x48087b['query']['filter']+'%'};return _0x3e4df1;}})});}_0x46159a=_[_0x8302('0x33')]({},_0x46159a,_0x48087b['options']);var _0x2b2285={'where':_0x46159a[_0x8302('0x2f')]};return db[_0x8302('0x35')][_0x8302('0x17')](_0x2b2285)[_0x8302('0x9')](function(_0x3b481e){_0x43edda[_0x8302('0x17')]=_0x3b481e;if(_0x48087b[_0x8302('0x26')][_0x8302('0x36')]){_0x46159a[_0x8302('0x37')]=[{'all':!![]}];}return db[_0x8302('0x35')][_0x8302('0x38')](_0x46159a);})['then'](function(_0x58bf64){_0x43edda[_0x8302('0x39')]=_0x58bf64;return _0x43edda;})[_0x8302('0x9')](respondWithFilteredResult(_0x17b846,_0x46159a))['catch'](handleError(_0x17b846,null));};exports[_0x8302('0x3a')]=function(_0x1dca5b,_0x5390d9){var _0x3643d5={'raw':!![],'where':{'id':_0x1dca5b[_0x8302('0x3b')]['id']}},_0x457e90={};_0x457e90[_0x8302('0x25')]=_['keys'](db[_0x8302('0x35')][_0x8302('0x21')]);_0x457e90[_0x8302('0x26')]=_[_0x8302('0x3c')](_0x1dca5b[_0x8302('0x26')]);_0x457e90[_0x8302('0x31')]=_[_0x8302('0x27')](_0x457e90[_0x8302('0x25')],_0x457e90[_0x8302('0x26')]);_0x3643d5[_0x8302('0x29')]=_[_0x8302('0x27')](_0x457e90['model'],qs[_0x8302('0x28')](_0x1dca5b['query'][_0x8302('0x28')]));_0x3643d5['attributes']=_0x3643d5[_0x8302('0x29')]['length']?_0x3643d5[_0x8302('0x29')]:_0x457e90[_0x8302('0x25')];if(_0x1dca5b[_0x8302('0x26')][_0x8302('0x36')]){_0x3643d5['include']=[{'all':!![]}];}_0x3643d5=_[_0x8302('0x33')]({},_0x3643d5,_0x1dca5b[_0x8302('0x3d')]);return db['Network'][_0x8302('0x3e')](_0x3643d5)['then'](handleEntityNotFound(_0x5390d9,null))['then'](respondWithResult(_0x5390d9,null))[_0x8302('0x13')](handleError(_0x5390d9,null));};exports[_0x8302('0x3f')]=function(_0x280869,_0x230be8){var _0x5ed4ac;return db[_0x8302('0x35')][_0x8302('0x3f')](_0x280869[_0x8302('0x40')],{'raw':!![]})[_0x8302('0x9')](function(_0x5a5eba){_0x5ed4ac=_0x5a5eba;return db[_0x8302('0x35')]['findAll']({'where':{'type':_0x280869[_0x8302('0x40')][_0x8302('0x23')]},'raw':!![]});})[_0x8302('0x9')](function(_0x5319c6){if(_0x5ed4ac['type'][_0x8302('0x41')]()==_0x8302('0x42')){var _0x262dab=fs['readFileSync'](path[_0x8302('0x43')](config[_0x8302('0x44')],_0x8302('0x45')),_0x8302('0x46'));var _0x40d96a=ejs['render'](_0x262dab,{'networks':_0x5319c6||[]});fs[_0x8302('0x47')](_0x8302('0x48'),_0x40d96a);return respondWithRpcPromise(_0x8302('0x49'),_0x8302('0x3f'),{'module':_0x8302('0x4a')});}else if(_0x5ed4ac[_0x8302('0x23')]['toUpperCase']()==_0x8302('0x4b')){var _0x11593d=fs[_0x8302('0x4c')](path[_0x8302('0x43')](config['root'],_0x8302('0x4d')),_0x8302('0x46'));var _0x7abcd4=ejs[_0x8302('0x4e')](_0x11593d,{'networks':_0x5319c6||[]});fs['writeFileSync'](_0x8302('0x4f'),_0x7abcd4);return respondWithRpcPromise(_0x8302('0x49'),_0x8302('0x3f'),{'module':_0x8302('0x4a')});}else{var _0x22d5f7=fs[_0x8302('0x4c')](path[_0x8302('0x43')](config[_0x8302('0x44')],'server/files/templates/network.ejs'),_0x8302('0x46'));var _0x43271b=ejs[_0x8302('0x4e')](_0x22d5f7,{'networks':_0x5319c6||[]});fs[_0x8302('0x47')](util[_0x8302('0x50')](_0x8302('0x51'),_0x280869['body']['type'][_0x8302('0x52')]()),_0x43271b);return respondWithRpcPromise('Reload',_0x8302('0x3f'),{'module':_0x8302('0x53')});}})[_0x8302('0x9')](function(){return _0x5ed4ac;})['then'](respondWithResult(_0x230be8,0xc9))['catch'](handleError(_0x230be8,null));};exports['update']=function(_0x36e758,_0x1160b0){var _0x5d56e5;return db[_0x8302('0x35')]['find']({'where':{'id':_0x36e758[_0x8302('0x3b')]['id']}})[_0x8302('0x9')](handleEntityNotFound(_0x1160b0,null))[_0x8302('0x9')](saveUpdates(_0x36e758[_0x8302('0x40')],null))[_0x8302('0x9')](function(_0x115d4f){if(_0x115d4f){_0x5d56e5=_0x115d4f;return db[_0x8302('0x35')][_0x8302('0x38')]({'where':{'type':_0x5d56e5[_0x8302('0x23')]},'raw':!![]});}return null;})['then'](function(_0x133aa3){if(_0x5d56e5[_0x8302('0x23')]['toUpperCase']()==_0x8302('0x42')){var _0x171542=fs[_0x8302('0x4c')](path[_0x8302('0x43')](config[_0x8302('0x44')],_0x8302('0x45')),'utf8');var _0x21f01e=ejs[_0x8302('0x4e')](_0x171542,{'networks':_0x133aa3||[]});fs['writeFileSync'](_0x8302('0x48'),_0x21f01e);return respondWithRpcPromise(_0x8302('0x49'),'update',{'module':'res_stun_monitor.so'});}else if(_0x5d56e5[_0x8302('0x23')][_0x8302('0x41')]()==_0x8302('0x4b')){var _0x2308bc=fs[_0x8302('0x4c')](path[_0x8302('0x43')](config[_0x8302('0x44')],'server/files/templates/turn_multiple.ejs'),_0x8302('0x46'));var _0x364b23=ejs[_0x8302('0x4e')](_0x2308bc,{'networks':_0x133aa3||[]});fs[_0x8302('0x47')](_0x8302('0x4f'),_0x364b23);return respondWithRpcPromise(_0x8302('0x49'),_0x8302('0x54'),{'module':'res_stun_monitor.so'});}else{var _0x49ec9c=fs[_0x8302('0x4c')](path['join'](config[_0x8302('0x44')],'server/files/templates/network.ejs'),_0x8302('0x46'));var _0x585d79=ejs[_0x8302('0x4e')](_0x49ec9c,{'networks':_0x133aa3||[]});fs[_0x8302('0x47')](util[_0x8302('0x50')](_0x8302('0x51'),_0x36e758[_0x8302('0x40')][_0x8302('0x23')][_0x8302('0x52')]()),_0x585d79);return respondWithRpcPromise(_0x8302('0x49'),_0x8302('0x54'),{'module':_0x8302('0x53')});}})[_0x8302('0x9')](function(_0x43c097){if(_0x43c097){return _0x5d56e5;}return null;})[_0x8302('0x9')](respondWithResult(_0x1160b0,null))[_0x8302('0x13')](handleError(_0x1160b0,null));};exports[_0x8302('0x55')]=function(_0x3505b5,_0x556a2f){var _0x3b8244;return db[_0x8302('0x35')][_0x8302('0x3e')]({'where':{'id':_0x3505b5[_0x8302('0x3b')]['id']}})[_0x8302('0x9')](function(_0x1e4371){_0x3b8244=_0x1e4371;return _0x1e4371;})[_0x8302('0x9')](handleEntityNotFound(_0x556a2f,null))[_0x8302('0x9')](removeEntity(_0x556a2f,null))[_0x8302('0x9')](function(){if(_0x3b8244){return db[_0x8302('0x35')][_0x8302('0x38')]({'where':{'type':_0x3b8244['type']},'raw':!![]});}})[_0x8302('0x9')](function(_0x279d60){if(_0x3b8244['type'][_0x8302('0x41')]()==_0x8302('0x42')){var _0x3d086e=fs[_0x8302('0x4c')](path['join'](config[_0x8302('0x44')],_0x8302('0x45')),_0x8302('0x46'));var _0x11891d=ejs[_0x8302('0x4e')](_0x3d086e,{'networks':_0x279d60||[]});fs[_0x8302('0x47')](_0x8302('0x48'),_0x11891d);return respondWithRpcPromise(_0x8302('0x49'),_0x8302('0x55'),{'module':'res_stun_monitor.so'});}else if(_0x3b8244[_0x8302('0x23')][_0x8302('0x41')]()==_0x8302('0x4b')){var _0x18ea36=fs[_0x8302('0x4c')](path[_0x8302('0x43')](config[_0x8302('0x44')],'server/files/templates/turn_multiple.ejs'),'utf8');var _0x85661b=ejs[_0x8302('0x4e')](_0x18ea36,{'networks':_0x279d60||[]});fs[_0x8302('0x47')]('/etc/asterisk/turn_xcally.conf',_0x85661b);return respondWithRpcPromise(_0x8302('0x49'),_0x8302('0x55'),{'module':_0x8302('0x4a')});}else{var _0x5d2d17=fs[_0x8302('0x4c')](path['join'](config[_0x8302('0x44')],_0x8302('0x56')),'utf8');var _0x2faf7a=ejs[_0x8302('0x4e')](_0x5d2d17,{'networks':_0x279d60||[]});fs[_0x8302('0x47')](util[_0x8302('0x50')](_0x8302('0x51'),_0x3b8244[_0x8302('0x23')][_0x8302('0x52')]()),_0x2faf7a);return respondWithRpcPromise(_0x8302('0x49'),'destroy',{'module':'chan_sip.so'});}})['catch'](handleError(_0x556a2f,null));}; \ No newline at end of file +var _0x6a21=['util','path','../../config/environment','client','http','request','then','info','Network,\x20%s,\x20%s','debug','Network,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','status','offset','undefined','limit','count','Content-Range','update','destroy','end','stack','name','send','index','Network','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','show','params','find','create','body','toUpperCase','readFileSync','join','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','TURN','server/files/templates/turn_multiple.ejs','Reload','res_stun_monitor.so','root','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','chan_sip.so','STUN','/etc/asterisk/turn_xcally.conf','toLowerCase'];(function(_0x500d20,_0x2eaa7b){var _0x2f96a1=function(_0x1ee9f1){while(--_0x1ee9f1){_0x500d20['push'](_0x500d20['shift']());}};_0x2f96a1(++_0x2eaa7b);}(_0x6a21,0x9c));var _0x16a2=function(_0x12a06e,_0x343946){_0x12a06e=_0x12a06e-0x0;var _0x5931a1=_0x6a21[_0x12a06e];return _0x5931a1;};'use strict';var util=require(_0x16a2('0x0'));var path=require(_0x16a2('0x1'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')('api');var config=require(_0x16a2('0x2'));var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson[_0x16a2('0x3')][_0x16a2('0x4')]({'port':0x232a});function respondWithRpcPromise(_0x1ad137,_0x69cd7f,_0x3dad85,_0x20e8c7){return new Promise(function(_0x1c9bfc,_0x14c591){var _0x78a8c4=_0x20e8c7||client;return _0x78a8c4[_0x16a2('0x5')](_0x1ad137,_0x3dad85)[_0x16a2('0x6')](function(_0x2597dd){logger[_0x16a2('0x7')](_0x16a2('0x8'),_0x69cd7f,'request\x20sent');logger[_0x16a2('0x9')](_0x16a2('0xa'),_0x69cd7f,_0x16a2('0xb'),JSON[_0x16a2('0xc')](_0x2597dd));if(_0x2597dd[_0x16a2('0xd')]){if(_0x2597dd[_0x16a2('0xd')]['code']===0x1f4){logger[_0x16a2('0xd')](_0x16a2('0x8'),_0x69cd7f,_0x2597dd[_0x16a2('0xd')][_0x16a2('0xe')]);return _0x14c591(_0x2597dd[_0x16a2('0xd')][_0x16a2('0xe')]);}logger['error'](_0x16a2('0x8'),_0x69cd7f,_0x2597dd['error'][_0x16a2('0xe')]);return _0x1c9bfc(_0x2597dd['error'][_0x16a2('0xe')]);}else{logger[_0x16a2('0x7')](_0x16a2('0x8'),_0x69cd7f,_0x16a2('0xb'));_0x1c9bfc(_0x2597dd['result'][_0x16a2('0xe')]);}})[_0x16a2('0xf')](function(_0x3f5a8a){logger['error']('Network,\x20%s,\x20%s',_0x69cd7f,_0x3f5a8a);_0x14c591(_0x3f5a8a);});});}function respondWithResult(_0x408567,_0x232a9c){_0x232a9c=_0x232a9c||0xc8;return function(_0x54490d){if(_0x54490d){return _0x408567[_0x16a2('0x10')](_0x232a9c)['json'](_0x54490d);}};}function respondWithFilteredResult(_0x5a33c2,_0x4308f9){return function(_0x6c09f0){if(_0x6c09f0){var _0x53b021=typeof _0x4308f9[_0x16a2('0x11')]===_0x16a2('0x12')&&typeof _0x4308f9[_0x16a2('0x13')]===_0x16a2('0x12');var _0x13521c=_0x6c09f0['count'];var _0x2a5f9b=_0x53b021?0x0:_0x4308f9[_0x16a2('0x11')];var _0x2981bc=_0x53b021?_0x6c09f0[_0x16a2('0x14')]:_0x4308f9[_0x16a2('0x11')]+_0x4308f9[_0x16a2('0x13')];var _0x362f4b;if(_0x2981bc>=_0x13521c){_0x2981bc=_0x13521c;_0x362f4b=0xc8;}else{_0x362f4b=0xce;}_0x5a33c2[_0x16a2('0x10')](_0x362f4b);return _0x5a33c2['set'](_0x16a2('0x15'),_0x2a5f9b+'-'+_0x2981bc+'/'+_0x13521c)['json'](_0x6c09f0);}return null;};}function saveUpdates(_0xc9200f){return function(_0x31294c){if(_0x31294c){return _0x31294c[_0x16a2('0x16')](_0xc9200f)['then'](function(_0x387fc0){return _0x387fc0;});}return null;};}function removeEntity(_0x3c3e58){return function(_0x494cd4){if(_0x494cd4){return _0x494cd4[_0x16a2('0x17')]()[_0x16a2('0x6')](function(){_0x3c3e58[_0x16a2('0x10')](0xcc)[_0x16a2('0x18')]();});}};}function handleEntityNotFound(_0x45d222){return function(_0x55b858){if(!_0x55b858){_0x45d222['sendStatus'](0x194);}return _0x55b858;};}function handleError(_0x25926c,_0x5ebe62){_0x5ebe62=_0x5ebe62||0x1f4;return function(_0x96f95b){logger[_0x16a2('0xd')](_0x96f95b[_0x16a2('0x19')]);if(_0x96f95b[_0x16a2('0x1a')]){delete _0x96f95b['name'];}_0x25926c[_0x16a2('0x10')](_0x5ebe62)[_0x16a2('0x1b')](_0x96f95b);};}exports[_0x16a2('0x1c')]=function(_0xb4425d,_0x3ccc62){var _0x261c7f={},_0x5baf4f={},_0x5d252b={'count':0x0,'rows':[]};var _0x2e7d00=_['map'](db[_0x16a2('0x1d')][_0x16a2('0x1e')],function(_0x13306b){return{'name':_0x13306b['fieldName'],'type':_0x13306b[_0x16a2('0x1f')][_0x16a2('0x20')]};});_0x5baf4f['model']=_['map'](_0x2e7d00,_0x16a2('0x1a'));_0x5baf4f[_0x16a2('0x21')]=_[_0x16a2('0x22')](_0xb4425d['query']);_0x5baf4f[_0x16a2('0x23')]=_[_0x16a2('0x24')](_0x5baf4f[_0x16a2('0x25')],_0x5baf4f[_0x16a2('0x21')]);_0x261c7f[_0x16a2('0x26')]=_[_0x16a2('0x24')](_0x5baf4f['model'],qs[_0x16a2('0x27')](_0xb4425d[_0x16a2('0x21')][_0x16a2('0x27')]));_0x261c7f['attributes']=_0x261c7f['attributes'][_0x16a2('0x28')]?_0x261c7f['attributes']:_0x5baf4f[_0x16a2('0x25')];if(!_0xb4425d[_0x16a2('0x21')]['hasOwnProperty'](_0x16a2('0x29'))){_0x261c7f[_0x16a2('0x13')]=qs[_0x16a2('0x13')](_0xb4425d['query'][_0x16a2('0x13')]);_0x261c7f[_0x16a2('0x11')]=qs[_0x16a2('0x11')](_0xb4425d[_0x16a2('0x21')][_0x16a2('0x11')]);}_0x261c7f[_0x16a2('0x2a')]=qs[_0x16a2('0x2b')](_0xb4425d[_0x16a2('0x21')][_0x16a2('0x2b')]);_0x261c7f[_0x16a2('0x2c')]=qs[_0x16a2('0x23')](_[_0x16a2('0x2d')](_0xb4425d[_0x16a2('0x21')],_0x5baf4f['filters']),_0x2e7d00);if(_0xb4425d['query'][_0x16a2('0x2e')]){_0x261c7f[_0x16a2('0x2c')]=_[_0x16a2('0x2f')](_0x261c7f[_0x16a2('0x2c')],{'$or':_[_0x16a2('0x30')](_0x2e7d00,function(_0x1bbc39){if(_0x1bbc39[_0x16a2('0x1f')]!==_0x16a2('0x31')){var _0x52bb41={};_0x52bb41[_0x1bbc39[_0x16a2('0x1a')]]={'$like':'%'+_0xb4425d['query'][_0x16a2('0x2e')]+'%'};return _0x52bb41;}})});}_0x261c7f=_[_0x16a2('0x2f')]({},_0x261c7f,_0xb4425d[_0x16a2('0x32')]);var _0x5ac1e9={'where':_0x261c7f[_0x16a2('0x2c')]};return db[_0x16a2('0x1d')][_0x16a2('0x14')](_0x5ac1e9)[_0x16a2('0x6')](function(_0x388b00){_0x5d252b[_0x16a2('0x14')]=_0x388b00;if(_0xb4425d[_0x16a2('0x21')][_0x16a2('0x33')]){_0x261c7f[_0x16a2('0x34')]=[{'all':!![]}];}return db[_0x16a2('0x1d')][_0x16a2('0x35')](_0x261c7f);})[_0x16a2('0x6')](function(_0x39d34f){_0x5d252b['rows']=_0x39d34f;return _0x5d252b;})[_0x16a2('0x6')](respondWithFilteredResult(_0x3ccc62,_0x261c7f))['catch'](handleError(_0x3ccc62,null));};exports[_0x16a2('0x36')]=function(_0x37ec83,_0x130935){var _0x286aee={'raw':!![],'where':{'id':_0x37ec83[_0x16a2('0x37')]['id']}},_0x8c0888={};_0x8c0888[_0x16a2('0x25')]=_[_0x16a2('0x22')](db[_0x16a2('0x1d')][_0x16a2('0x1e')]);_0x8c0888['query']=_['keys'](_0x37ec83[_0x16a2('0x21')]);_0x8c0888['filters']=_[_0x16a2('0x24')](_0x8c0888[_0x16a2('0x25')],_0x8c0888[_0x16a2('0x21')]);_0x286aee[_0x16a2('0x26')]=_[_0x16a2('0x24')](_0x8c0888['model'],qs[_0x16a2('0x27')](_0x37ec83['query'][_0x16a2('0x27')]));_0x286aee[_0x16a2('0x26')]=_0x286aee[_0x16a2('0x26')][_0x16a2('0x28')]?_0x286aee[_0x16a2('0x26')]:_0x8c0888['model'];if(_0x37ec83['query'][_0x16a2('0x33')]){_0x286aee[_0x16a2('0x34')]=[{'all':!![]}];}_0x286aee=_['merge']({},_0x286aee,_0x37ec83[_0x16a2('0x32')]);return db['Network'][_0x16a2('0x38')](_0x286aee)['then'](handleEntityNotFound(_0x130935,null))[_0x16a2('0x6')](respondWithResult(_0x130935,null))[_0x16a2('0xf')](handleError(_0x130935,null));};exports[_0x16a2('0x39')]=function(_0x565e93,_0x4deab7){var _0x49bc54;return db['Network'][_0x16a2('0x39')](_0x565e93[_0x16a2('0x3a')],{'raw':!![]})['then'](function(_0x109fc3){_0x49bc54=_0x109fc3;return db['Network'][_0x16a2('0x35')]({'where':{'type':_0x565e93[_0x16a2('0x3a')][_0x16a2('0x1f')]},'raw':!![]});})['then'](function(_0x42804f){if(_0x49bc54[_0x16a2('0x1f')][_0x16a2('0x3b')]()=='STUN'){var _0x5a05e1=fs[_0x16a2('0x3c')](path[_0x16a2('0x3d')](config['root'],_0x16a2('0x3e')),_0x16a2('0x3f'));var _0x3e04a0=ejs[_0x16a2('0x40')](_0x5a05e1,{'networks':_0x42804f||[]});fs[_0x16a2('0x41')]('/etc/asterisk/stun_xcally.conf',_0x3e04a0);return respondWithRpcPromise('Reload','create',{'module':'res_stun_monitor.so'});}else if(_0x49bc54['type'][_0x16a2('0x3b')]()==_0x16a2('0x42')){var _0x43f3bf=fs['readFileSync'](path['join'](config['root'],_0x16a2('0x43')),_0x16a2('0x3f'));var _0x4c3532=ejs[_0x16a2('0x40')](_0x43f3bf,{'networks':_0x42804f||[]});fs[_0x16a2('0x41')]('/etc/asterisk/turn_xcally.conf',_0x4c3532);return respondWithRpcPromise(_0x16a2('0x44'),_0x16a2('0x39'),{'module':_0x16a2('0x45')});}else{var _0x466703=fs['readFileSync'](path[_0x16a2('0x3d')](config[_0x16a2('0x46')],_0x16a2('0x47')),_0x16a2('0x3f'));var _0x2e52f7=ejs['render'](_0x466703,{'networks':_0x42804f||[]});fs['writeFileSync'](util[_0x16a2('0x48')](_0x16a2('0x49'),_0x565e93[_0x16a2('0x3a')][_0x16a2('0x1f')]['toLowerCase']()),_0x2e52f7);return respondWithRpcPromise(_0x16a2('0x44'),_0x16a2('0x39'),{'module':_0x16a2('0x4a')});}})[_0x16a2('0x6')](function(){return _0x49bc54;})['then'](respondWithResult(_0x4deab7,0xc9))[_0x16a2('0xf')](handleError(_0x4deab7,null));};exports[_0x16a2('0x16')]=function(_0x449031,_0x34a2a9){var _0x409ce5;return db[_0x16a2('0x1d')]['find']({'where':{'id':_0x449031[_0x16a2('0x37')]['id']}})[_0x16a2('0x6')](handleEntityNotFound(_0x34a2a9,null))[_0x16a2('0x6')](saveUpdates(_0x449031[_0x16a2('0x3a')],null))[_0x16a2('0x6')](function(_0x2e234b){if(_0x2e234b){_0x409ce5=_0x2e234b;return db[_0x16a2('0x1d')]['findAll']({'where':{'type':_0x409ce5['type']},'raw':!![]});}return null;})[_0x16a2('0x6')](function(_0x544a98){if(_0x409ce5['type'][_0x16a2('0x3b')]()==_0x16a2('0x4b')){var _0x8d740=fs[_0x16a2('0x3c')](path[_0x16a2('0x3d')](config[_0x16a2('0x46')],_0x16a2('0x3e')),'utf8');var _0x2a804b=ejs[_0x16a2('0x40')](_0x8d740,{'networks':_0x544a98||[]});fs[_0x16a2('0x41')]('/etc/asterisk/stun_xcally.conf',_0x2a804b);return respondWithRpcPromise(_0x16a2('0x44'),_0x16a2('0x16'),{'module':_0x16a2('0x45')});}else if(_0x409ce5[_0x16a2('0x1f')][_0x16a2('0x3b')]()==_0x16a2('0x42')){var _0x318849=fs[_0x16a2('0x3c')](path['join'](config[_0x16a2('0x46')],_0x16a2('0x43')),'utf8');var _0x2ce0d1=ejs[_0x16a2('0x40')](_0x318849,{'networks':_0x544a98||[]});fs[_0x16a2('0x41')](_0x16a2('0x4c'),_0x2ce0d1);return respondWithRpcPromise(_0x16a2('0x44'),_0x16a2('0x16'),{'module':_0x16a2('0x45')});}else{var _0x2a6394=fs[_0x16a2('0x3c')](path[_0x16a2('0x3d')](config['root'],_0x16a2('0x47')),'utf8');var _0x48e49e=ejs['render'](_0x2a6394,{'networks':_0x544a98||[]});fs['writeFileSync'](util['format'](_0x16a2('0x49'),_0x449031[_0x16a2('0x3a')]['type']['toLowerCase']()),_0x48e49e);return respondWithRpcPromise('Reload','update',{'module':_0x16a2('0x4a')});}})['then'](function(_0xc7b20c){if(_0xc7b20c){return _0x409ce5;}return null;})[_0x16a2('0x6')](respondWithResult(_0x34a2a9,null))[_0x16a2('0xf')](handleError(_0x34a2a9,null));};exports[_0x16a2('0x17')]=function(_0x66d526,_0x39e4d0){var _0x4b8a3a;return db[_0x16a2('0x1d')][_0x16a2('0x38')]({'where':{'id':_0x66d526[_0x16a2('0x37')]['id']}})['then'](function(_0x2441d6){_0x4b8a3a=_0x2441d6;return _0x2441d6;})['then'](handleEntityNotFound(_0x39e4d0,null))[_0x16a2('0x6')](removeEntity(_0x39e4d0,null))[_0x16a2('0x6')](function(){if(_0x4b8a3a){return db[_0x16a2('0x1d')][_0x16a2('0x35')]({'where':{'type':_0x4b8a3a['type']},'raw':!![]});}})[_0x16a2('0x6')](function(_0x1e75eb){if(_0x4b8a3a[_0x16a2('0x1f')][_0x16a2('0x3b')]()==_0x16a2('0x4b')){var _0x255fb4=fs[_0x16a2('0x3c')](path['join'](config[_0x16a2('0x46')],_0x16a2('0x3e')),_0x16a2('0x3f'));var _0x5055ea=ejs['render'](_0x255fb4,{'networks':_0x1e75eb||[]});fs[_0x16a2('0x41')]('/etc/asterisk/stun_xcally.conf',_0x5055ea);return respondWithRpcPromise(_0x16a2('0x44'),_0x16a2('0x17'),{'module':_0x16a2('0x45')});}else if(_0x4b8a3a[_0x16a2('0x1f')][_0x16a2('0x3b')]()==_0x16a2('0x42')){var _0x1e759f=fs[_0x16a2('0x3c')](path[_0x16a2('0x3d')](config[_0x16a2('0x46')],_0x16a2('0x43')),'utf8');var _0x331457=ejs[_0x16a2('0x40')](_0x1e759f,{'networks':_0x1e75eb||[]});fs[_0x16a2('0x41')](_0x16a2('0x4c'),_0x331457);return respondWithRpcPromise(_0x16a2('0x44'),_0x16a2('0x17'),{'module':_0x16a2('0x45')});}else{var _0x62b461=fs[_0x16a2('0x3c')](path[_0x16a2('0x3d')](config[_0x16a2('0x46')],_0x16a2('0x47')),_0x16a2('0x3f'));var _0x4172af=ejs['render'](_0x62b461,{'networks':_0x1e75eb||[]});fs['writeFileSync'](util['format']('/etc/asterisk/sip_xcally_%s.conf',_0x4b8a3a[_0x16a2('0x1f')][_0x16a2('0x4d')]()),_0x4172af);return respondWithRpcPromise(_0x16a2('0x44'),_0x16a2('0x17'),{'module':_0x16a2('0x4a')});}})[_0x16a2('0xf')](handleError(_0x39e4d0,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 97c158a..636df5f 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 _0xf45e=['exports','define','Network','network','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./network.attributes'];(function(_0x4ae625,_0xf396d0){var _0x31accf=function(_0x3ded6b){while(--_0x3ded6b){_0x4ae625['push'](_0x4ae625['shift']());}};_0x31accf(++_0xf396d0);}(_0xf45e,0x115));var _0xef45=function(_0x2a318a,_0x3f8006){_0x2a318a=_0x2a318a-0x0;var _0x346cf3=_0xf45e[_0x2a318a];return _0x346cf3;};'use strict';var _=require(_0xef45('0x0'));var util=require('util');var logger=require(_0xef45('0x1'))('api');var moment=require(_0xef45('0x2'));var BPromise=require(_0xef45('0x3'));var rp=require(_0xef45('0x4'));var fs=require('fs');var path=require(_0xef45('0x5'));var rimraf=require(_0xef45('0x6'));var config=require(_0xef45('0x7'));var attributes=require(_0xef45('0x8'));module[_0xef45('0x9')]=function(_0x338960,_0x315b84){return _0x338960[_0xef45('0xa')](_0xef45('0xb'),attributes,{'tableName':_0xef45('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7a2c=['path','rimraf','../../config/environment','exports','network','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0xa3463d,_0x323da0){var _0x18f7ca=function(_0x1c0ec4){while(--_0x1c0ec4){_0xa3463d['push'](_0xa3463d['shift']());}};_0x18f7ca(++_0x323da0);}(_0x7a2c,0x17b));var _0xc7a2=function(_0x2eb07f,_0x507792){_0x2eb07f=_0x2eb07f-0x0;var _0x591971=_0x7a2c[_0x2eb07f];return _0x591971;};'use strict';var _=require(_0xc7a2('0x0'));var util=require('util');var logger=require(_0xc7a2('0x1'))(_0xc7a2('0x2'));var moment=require(_0xc7a2('0x3'));var BPromise=require(_0xc7a2('0x4'));var rp=require(_0xc7a2('0x5'));var fs=require('fs');var path=require(_0xc7a2('0x6'));var rimraf=require(_0xc7a2('0x7'));var config=require(_0xc7a2('0x8'));var attributes=require('./network.attributes');module[_0xc7a2('0x9')]=function(_0x1ddbae,_0x5f334e){return _0x1ddbae['define']('Network',attributes,{'tableName':_0xc7a2('0xa'),'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 4a77820..58ca4bf 100644 --- a/server/api/network/network.rpc.js +++ b/server/api/network/network.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7a54,0x106));var _0x47a5=function(_0x21374e,_0x56a66f){_0x21374e=_0x21374e-0x0;var _0x15ee00=_0x7a54[_0x21374e];return _0x15ee00;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file +var _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x292eeb,_0x3dd9df){var _0x4e4d59=function(_0x3c6928){while(--_0x3c6928){_0x292eeb['push'](_0x292eeb['shift']());}};_0x4e4d59(++_0x3dd9df);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Network,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index 8431e8d..4de4d99 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 _0x0424=['getAnswers','getApplications','/:id/interactions','getInteractions','/:id/users','getAgents','create','addDisposition','post','addAnswer','/:id/notify','addAgents','/:id/send','send','put','update','delete','removeDispositions','removeAnswers','removeAgents','exports','path','connect-timeout','express','Router','../../components/auth/service','./openchannelAccount.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers'];(function(_0x2606f8,_0x3794ba){var _0x30f4e4=function(_0x5dbc5b){while(--_0x5dbc5b){_0x2606f8['push'](_0x2606f8['shift']());}};_0x30f4e4(++_0x3794ba);}(_0x0424,0x159));var _0x4042=function(_0x4bb94b,_0x50628a){_0x4bb94b=_0x4bb94b-0x0;var _0x36dcc6=_0x0424[_0x4bb94b];return _0x36dcc6;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4042('0x0'));var timeout=require(_0x4042('0x1'));var express=require(_0x4042('0x2'));var router=express[_0x4042('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x4042('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4042('0x5'));router[_0x4042('0x6')]('/',auth[_0x4042('0x7')](),controller[_0x4042('0x8')]);router[_0x4042('0x6')](_0x4042('0x9'),auth[_0x4042('0x7')](),controller['describe']);router['get'](_0x4042('0xa'),auth[_0x4042('0x7')](),controller[_0x4042('0xb')]);router['get'](_0x4042('0xc'),auth[_0x4042('0x7')](),controller[_0x4042('0xd')]);router[_0x4042('0x6')](_0x4042('0xe'),auth[_0x4042('0x7')](),controller[_0x4042('0xf')]);router[_0x4042('0x6')]('/:id/applications',auth[_0x4042('0x7')](),controller[_0x4042('0x10')]);router['get'](_0x4042('0x11'),auth[_0x4042('0x7')](),controller[_0x4042('0x12')]);router[_0x4042('0x6')](_0x4042('0x13'),auth[_0x4042('0x7')](),controller[_0x4042('0x14')]);router['post']('/',auth[_0x4042('0x7')](),controller[_0x4042('0x15')]);router['post'](_0x4042('0xc'),auth[_0x4042('0x7')](),controller[_0x4042('0x16')]);router[_0x4042('0x17')](_0x4042('0xe'),auth[_0x4042('0x7')](),controller[_0x4042('0x18')]);router[_0x4042('0x17')](_0x4042('0x19'),controller['notify']);router[_0x4042('0x17')]('/:id/applications',auth[_0x4042('0x7')](),controller['addApplications']);router[_0x4042('0x17')](_0x4042('0x13'),auth[_0x4042('0x7')](),controller[_0x4042('0x1a')]);router['post'](_0x4042('0x1b'),auth[_0x4042('0x7')](),controller[_0x4042('0x1c')]);router[_0x4042('0x1d')]('/:id',auth[_0x4042('0x7')](),controller[_0x4042('0x1e')]);router[_0x4042('0x1f')](_0x4042('0xa'),auth[_0x4042('0x7')](),controller['destroy']);router[_0x4042('0x1f')](_0x4042('0xc'),auth['isAuthenticated'](),controller[_0x4042('0x20')]);router['delete'](_0x4042('0xe'),auth[_0x4042('0x7')](),controller[_0x4042('0x21')]);router['delete'](_0x4042('0x13'),auth[_0x4042('0x7')](),controller[_0x4042('0x22')]);module[_0x4042('0x23')]=router; \ No newline at end of file +var _0xf61e=['../../config/environment','./openchannelAccount.controller','get','index','isAuthenticated','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/users','getAgents','create','post','addDisposition','addAnswer','/:id/notify','notify','addApplications','addAgents','/:id/send','send','put','update','/:id','delete','removeDispositions','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x4f0bc3,_0x5185ba){var _0x277b9a=function(_0x35e0fb){while(--_0x35e0fb){_0x4f0bc3['push'](_0x4f0bc3['shift']());}};_0x277b9a(++_0x5185ba);}(_0xf61e,0x191));var _0xef61=function(_0x3a16e3,_0x514411){_0x3a16e3=_0x3a16e3-0x0;var _0x474c2f=_0xf61e[_0x3a16e3];return _0x474c2f;};'use strict';var multer=require(_0xef61('0x0'));var util=require(_0xef61('0x1'));var path=require(_0xef61('0x2'));var timeout=require(_0xef61('0x3'));var express=require(_0xef61('0x4'));var router=express[_0xef61('0x5')]();var fs_extra=require(_0xef61('0x6'));var auth=require(_0xef61('0x7'));var interaction=require(_0xef61('0x8'));var config=require(_0xef61('0x9'));var controller=require(_0xef61('0xa'));router[_0xef61('0xb')]('/',auth['isAuthenticated'](),controller[_0xef61('0xc')]);router[_0xef61('0xb')]('/describe',auth[_0xef61('0xd')](),controller[_0xef61('0xe')]);router[_0xef61('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xef61('0xf')]);router[_0xef61('0xb')](_0xef61('0x10'),auth[_0xef61('0xd')](),controller[_0xef61('0x11')]);router[_0xef61('0xb')](_0xef61('0x12'),auth[_0xef61('0xd')](),controller[_0xef61('0x13')]);router[_0xef61('0xb')](_0xef61('0x14'),auth[_0xef61('0xd')](),controller[_0xef61('0x15')]);router[_0xef61('0xb')]('/:id/interactions',auth[_0xef61('0xd')](),controller['getInteractions']);router[_0xef61('0xb')](_0xef61('0x16'),auth[_0xef61('0xd')](),controller[_0xef61('0x17')]);router['post']('/',auth[_0xef61('0xd')](),controller[_0xef61('0x18')]);router[_0xef61('0x19')](_0xef61('0x10'),auth['isAuthenticated'](),controller[_0xef61('0x1a')]);router[_0xef61('0x19')]('/:id/canned_answers',auth[_0xef61('0xd')](),controller[_0xef61('0x1b')]);router[_0xef61('0x19')](_0xef61('0x1c'),controller[_0xef61('0x1d')]);router[_0xef61('0x19')](_0xef61('0x14'),auth['isAuthenticated'](),controller[_0xef61('0x1e')]);router[_0xef61('0x19')]('/:id/users',auth[_0xef61('0xd')](),controller[_0xef61('0x1f')]);router[_0xef61('0x19')](_0xef61('0x20'),auth[_0xef61('0xd')](),controller[_0xef61('0x21')]);router[_0xef61('0x22')]('/:id',auth['isAuthenticated'](),controller[_0xef61('0x23')]);router['delete'](_0xef61('0x24'),auth['isAuthenticated'](),controller['destroy']);router[_0xef61('0x25')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xef61('0x26')]);router[_0xef61('0x25')](_0xef61('0x12'),auth[_0xef61('0xd')](),controller['removeAnswers']);router[_0xef61('0x25')]('/:id/users',auth[_0xef61('0xd')](),controller[_0xef61('0x27')]);module[_0xef61('0x28')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 13afda6..3b70937 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 _0xc804=['Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','sequelize','randomstring','exports','STRING','name','generate','TEXT'];(function(_0x584ed0,_0x583809){var _0x1e28bb=function(_0x519e13){while(--_0x519e13){_0x584ed0['push'](_0x584ed0['shift']());}};_0x1e28bb(++_0x583809);}(_0xc804,0x1cd));var _0x4c80=function(_0x574126,_0x459fb8){_0x574126=_0x574126-0x0;var _0xe4e42f=_0xc804[_0x574126];return _0xe4e42f;};'use strict';var Sequelize=require(_0x4c80('0x0'));var rs=require(_0x4c80('0x1'));module[_0x4c80('0x2')]={'name':{'type':Sequelize[_0x4c80('0x3')],'unique':_0x4c80('0x4'),'allowNull':![]},'description':{'type':Sequelize[_0x4c80('0x3')]},'token':{'type':Sequelize[_0x4c80('0x3')],'defaultValue':function(){return rs[_0x4c80('0x5')]();}},'replyUri':{'type':Sequelize[_0x4c80('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x4c80('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x4c80('0x6')],'defaultValue':function(){return _0x4c80('0x7');}},'notificationSound':{'type':Sequelize[_0x4c80('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x4c80('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x4c80('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x4c80('0x3')]},'queueTransfer':{'type':Sequelize[_0x4c80('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x4c80('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x4c80('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x4c80('0x8')],'defaultValue':![],'comment':_0x4c80('0xa'),'set':function(_0x21728e){if(!_0x21728e)this[_0x4c80('0xb')]('mandatoryDispositionPauseId',null);this[_0x4c80('0xb')]('mandatoryDisposition',_0x21728e);}}}; \ No newline at end of file +var _0xf793=['INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','exports','STRING','name','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN'];(function(_0x30aaae,_0x2c24b3){var _0x1c8a18=function(_0x57c5b3){while(--_0x57c5b3){_0x30aaae['push'](_0x30aaae['shift']());}};_0x1c8a18(++_0x2c24b3);}(_0xf793,0x117));var _0x3f79=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf793[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x3f79('0x0'));var rs=require('randomstring');module[_0x3f79('0x1')]={'name':{'type':Sequelize[_0x3f79('0x2')],'unique':_0x3f79('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x3f79('0x2')],'defaultValue':function(){return rs['generate']();}},'replyUri':{'type':Sequelize[_0x3f79('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x3f79('0x4')],'defaultValue':function(){return _0x3f79('0x5');}},'notificationSound':{'type':Sequelize[_0x3f79('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x3f79('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x3f79('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x3f79('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x3f79('0x2')]},'queueTransfer':{'type':Sequelize[_0x3f79('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x3f79('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x3f79('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x3f79('0x6')],'defaultValue':![],'comment':_0x3f79('0x8'),'set':function(_0x170203){if(!_0x170203)this[_0x3f79('0x9')]('mandatoryDispositionPauseId',null);this[_0x3f79('0x9')](_0x3f79('0xa'),_0x170203);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index bc9f83e..64902e0 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 _0x05f1=['lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','contact','messageId','interaction','created','autoclose','push','unmanaged','UserId','User','unshift','agent','waitForTheAssignedAgent','*,*,*,*','queueId','OpenchannelQueue','queue','waitForTheAssignedQueue','Start','EventManager','notify','sequelize','ISOLATION_LEVELS','READ_COMMITTED','OpenchannelApplication','bulkCreate','priority','finally','getApplications','getInteractions','Contact','fullname','internal','Tag','Tags','color','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','out','Messages','OpenchannelMessage','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','jayson/promise','client','http','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','update','destroy','UserProfileResource','sendStatus','stack','name','send','index','Pause','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','show','params','keys','include','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','OpenchannelAccounts','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','OpenchannelAccountId','Disposition','getDispositions','findOne','hasOwnProperty','findAll','removeDispositions','addAnswer','getAnswers','CannedAnswer','rows','removeAnswers','ids','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','ListId','from','isNil','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','CmContact','Contacts','DESC','account','applications','orderBy','asc','Applications','List','firstName'];(function(_0x3acb53,_0x57aefa){var _0x29167b=function(_0x43e31f){while(--_0x43e31f){_0x3acb53['push'](_0x3acb53['shift']());}};_0x29167b(++_0x57aefa);}(_0x05f1,0xfa));var _0x105f=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x05f1[_0x2c91e9];return _0x13f0ff;};'use strict';var emlformat=require(_0x105f('0x0'));var rimraf=require(_0x105f('0x1'));var zipdir=require(_0x105f('0x2'));var jsonpatch=require(_0x105f('0x3'));var rp=require(_0x105f('0x4'));var moment=require(_0x105f('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x105f('0x6'));var util=require(_0x105f('0x7'));var path=require(_0x105f('0x8'));var sox=require(_0x105f('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x105f('0xa'));var _=require(_0x105f('0xb'));var squel=require('squel');var crypto=require(_0x105f('0xc'));var jsforce=require(_0x105f('0xd'));var deskjs=require(_0x105f('0xe'));var toCsv=require('to-csv');var querystring=require(_0x105f('0xf'));var Papa=require('papaparse');var Redis=require(_0x105f('0x10'));var authService=require(_0x105f('0x11'));var qs=require(_0x105f('0x12'));var as=require(_0x105f('0x13'));var hardwareService=require(_0x105f('0x14'));var logger=require(_0x105f('0x15'))(_0x105f('0x16'));var utils=require(_0x105f('0x17'));var config=require(_0x105f('0x18'));var licenseUtil=require(_0x105f('0x19'));var db=require(_0x105f('0x1a'))['db'];config['redis']=_[_0x105f('0x1b')](config[_0x105f('0x1c')],{'host':'localhost','port':0x18eb});var socket=require(_0x105f('0x1d'))(new Redis(config[_0x105f('0x1c')]));require('./openchannelAccount.socket')['register'](socket);var jayson=require(_0x105f('0x1e'));var client=jayson[_0x105f('0x1f')][_0x105f('0x20')]({'port':0x232c});var client9002=jayson['client'][_0x105f('0x20')]({'port':0x232a});function respondWithRpcPromise(_0xafd716,_0x6f5937,_0x441df6,_0x296581){return new BPromise(function(_0x8c31a,_0x14fc84){var _0x31d577=_0x296581||client;return _0x31d577['request'](_0xafd716,_0x441df6)[_0x105f('0x21')](function(_0x175c14){logger[_0x105f('0x22')](_0x105f('0x23'),_0x6f5937,_0x105f('0x24'));logger[_0x105f('0x25')](_0x105f('0x26'),_0x6f5937,_0x105f('0x24'),JSON['stringify'](_0x175c14));if(_0x175c14[_0x105f('0x27')]){if(_0x175c14[_0x105f('0x27')][_0x105f('0x28')]===0x1f4){logger[_0x105f('0x27')]('OpenchannelAccount,\x20%s,\x20%s',_0x6f5937,_0x175c14[_0x105f('0x27')][_0x105f('0x29')]);return _0x14fc84(_0x175c14[_0x105f('0x27')][_0x105f('0x29')]);}logger['error'](_0x105f('0x23'),_0x6f5937,_0x175c14[_0x105f('0x27')][_0x105f('0x29')]);return _0x8c31a(_0x175c14[_0x105f('0x27')][_0x105f('0x29')]);}else{logger[_0x105f('0x22')](_0x105f('0x23'),_0x6f5937,'request\x20sent');_0x8c31a(_0x175c14[_0x105f('0x2a')][_0x105f('0x29')]);}})[_0x105f('0x2b')](function(_0x466034){logger[_0x105f('0x27')]('OpenchannelAccount,\x20%s,\x20%s',_0x6f5937,_0x466034);_0x14fc84(_0x466034);});});}function respondWithStatusCode(_0x2fd3a6,_0x438b32){_0x438b32=_0x438b32||0xcc;return function(_0x156abc){if(_0x156abc){return _0x2fd3a6['sendStatus'](_0x438b32);}return _0x2fd3a6[_0x105f('0x2c')](_0x438b32)[_0x105f('0x2d')]();};}function respondWithResult(_0x4e18b3,_0x52bf39){_0x52bf39=_0x52bf39||0xc8;return function(_0x311c86){if(_0x311c86){return _0x4e18b3[_0x105f('0x2c')](_0x52bf39)['json'](_0x311c86);}};}function respondWithFilteredResult(_0x439ae0,_0x45f7f8){return function(_0x5be288){if(_0x5be288){var _0x1acf1a=typeof _0x45f7f8[_0x105f('0x2e')]===_0x105f('0x2f')&&typeof _0x45f7f8[_0x105f('0x30')]==='undefined';var _0x5344b6=_0x5be288[_0x105f('0x31')];var _0x3a7215=_0x1acf1a?0x0:_0x45f7f8[_0x105f('0x2e')];var _0x291572=_0x1acf1a?_0x5be288[_0x105f('0x31')]:_0x45f7f8[_0x105f('0x2e')]+_0x45f7f8[_0x105f('0x30')];var _0xdcb3a1;if(_0x291572>=_0x5344b6){_0x291572=_0x5344b6;_0xdcb3a1=0xc8;}else{_0xdcb3a1=0xce;}_0x439ae0['status'](_0xdcb3a1);return _0x439ae0['set'](_0x105f('0x32'),_0x3a7215+'-'+_0x291572+'/'+_0x5344b6)[_0x105f('0x33')](_0x5be288);}return null;};}function patchUpdates(_0x1a31f5){return function(_0xc36080){try{jsonpatch[_0x105f('0x34')](_0xc36080,_0x1a31f5,!![]);}catch(_0x156cde){return BPromise[_0x105f('0x35')](_0x156cde);}return _0xc36080['save']();};}function saveUpdates(_0xf87cb0,_0xba9737){return function(_0x11f4dc){if(_0x11f4dc){return _0x11f4dc[_0x105f('0x36')](_0xf87cb0)[_0x105f('0x21')](function(_0x170bed){return _0x170bed;});}return null;};}function removeEntity(_0x361929,_0x5f40f8){return function(_0x24f9b6){if(_0x24f9b6){return _0x24f9b6[_0x105f('0x37')]()[_0x105f('0x21')](function(){var _0x1cc2bb=_0x24f9b6['get']({'plain':!![]});var _0x57c264='OpenchannelAccounts';return db[_0x105f('0x38')][_0x105f('0x37')]({'where':{'type':_0x57c264,'resourceId':_0x1cc2bb['id']}})['then'](function(){return _0x24f9b6;});})[_0x105f('0x21')](function(){_0x361929['status'](0xcc)[_0x105f('0x2d')]();});}};}function handleEntityNotFound(_0x2cd180,_0x576f6f){return function(_0x5d245f){if(!_0x5d245f){_0x2cd180[_0x105f('0x39')](0x194);}return _0x5d245f;};}function handleError(_0x1d9cd9,_0x59c9b5){_0x59c9b5=_0x59c9b5||0x1f4;return function(_0x10c98d){logger[_0x105f('0x27')](_0x10c98d[_0x105f('0x3a')]);if(_0x10c98d[_0x105f('0x3b')]){delete _0x10c98d[_0x105f('0x3b')];}_0x1d9cd9[_0x105f('0x2c')](_0x59c9b5)[_0x105f('0x3c')](_0x10c98d);};}exports[_0x105f('0x3d')]=function(_0x2e713e,_0x62ad32){var _0x28c7c9={'include':[{'model':db[_0x105f('0x3e')],'as':_0x105f('0x3f')}]},_0x31993b={},_0x3d43e6={'count':0x0,'rows':[]};var _0x37f562=_[_0x105f('0x40')](db[_0x105f('0x41')][_0x105f('0x42')],function(_0x43dcd2){return{'name':_0x43dcd2[_0x105f('0x43')],'type':_0x43dcd2[_0x105f('0x44')][_0x105f('0x45')]};});_0x31993b[_0x105f('0x46')]=_['map'](_0x37f562,_0x105f('0x3b'));_0x31993b['query']=_['keys'](_0x2e713e[_0x105f('0x47')]);_0x31993b[_0x105f('0x48')]=_['intersection'](_0x31993b[_0x105f('0x46')],_0x31993b['query']);_0x28c7c9[_0x105f('0x49')]=_[_0x105f('0x4a')](_0x31993b['model'],qs[_0x105f('0x4b')](_0x2e713e[_0x105f('0x47')][_0x105f('0x4b')]));_0x28c7c9['attributes']=_0x28c7c9[_0x105f('0x49')][_0x105f('0x4c')]?_0x28c7c9[_0x105f('0x49')]:_0x31993b[_0x105f('0x46')];if(!_0x2e713e[_0x105f('0x47')]['hasOwnProperty'](_0x105f('0x4d'))){_0x28c7c9[_0x105f('0x30')]=qs['limit'](_0x2e713e['query'][_0x105f('0x30')]);_0x28c7c9['offset']=qs[_0x105f('0x2e')](_0x2e713e[_0x105f('0x47')][_0x105f('0x2e')]);}_0x28c7c9[_0x105f('0x4e')]=qs[_0x105f('0x4f')](_0x2e713e[_0x105f('0x47')][_0x105f('0x4f')]);_0x28c7c9[_0x105f('0x50')]=qs[_0x105f('0x48')](_[_0x105f('0x51')](_0x2e713e['query'],_0x31993b[_0x105f('0x48')]),_0x37f562);if(_0x2e713e['query']['filter']){_0x28c7c9[_0x105f('0x50')]=_[_0x105f('0x52')](_0x28c7c9[_0x105f('0x50')],{'$or':_[_0x105f('0x40')](_0x37f562,function(_0x9ff489){if(_0x9ff489[_0x105f('0x44')]!==_0x105f('0x53')){var _0x1065e1={};_0x1065e1[_0x9ff489[_0x105f('0x3b')]]={'$like':'%'+_0x2e713e[_0x105f('0x47')][_0x105f('0x54')]+'%'};return _0x1065e1;}})});}_0x28c7c9=_[_0x105f('0x52')]({},_0x28c7c9,_0x2e713e[_0x105f('0x55')]);var _0x31c0a9={'where':_0x28c7c9['where']};return db[_0x105f('0x41')][_0x105f('0x31')](_0x31c0a9)[_0x105f('0x21')](function(_0x5236f9){_0x3d43e6[_0x105f('0x31')]=_0x5236f9;if(_0x2e713e[_0x105f('0x47')][_0x105f('0x56')]){_0x28c7c9['include']=[{'all':!![]}];}return db[_0x105f('0x41')]['findAll'](_0x28c7c9);})[_0x105f('0x21')](function(_0x5127b4){_0x3d43e6['rows']=_0x5127b4;return _0x3d43e6;})['then'](respondWithFilteredResult(_0x62ad32,_0x28c7c9))['catch'](handleError(_0x62ad32,null));};exports[_0x105f('0x57')]=function(_0x4512d5,_0x47c020){var _0x9166be={'raw':![],'where':{'id':_0x4512d5[_0x105f('0x58')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x92fcb9={};_0x92fcb9[_0x105f('0x46')]=_['keys'](db[_0x105f('0x41')]['rawAttributes']);_0x92fcb9[_0x105f('0x47')]=_[_0x105f('0x59')](_0x4512d5[_0x105f('0x47')]);_0x92fcb9[_0x105f('0x48')]=_[_0x105f('0x4a')](_0x92fcb9[_0x105f('0x46')],_0x92fcb9[_0x105f('0x47')]);_0x9166be[_0x105f('0x49')]=_[_0x105f('0x4a')](_0x92fcb9[_0x105f('0x46')],qs[_0x105f('0x4b')](_0x4512d5[_0x105f('0x47')][_0x105f('0x4b')]));_0x9166be[_0x105f('0x49')]=_0x9166be[_0x105f('0x49')][_0x105f('0x4c')]?_0x9166be[_0x105f('0x49')]:_0x92fcb9[_0x105f('0x46')];if(_0x4512d5[_0x105f('0x47')][_0x105f('0x56')]){_0x9166be[_0x105f('0x5a')]=[{'all':!![]}];}_0x9166be=_[_0x105f('0x52')]({},_0x9166be,_0x4512d5[_0x105f('0x55')]);return db[_0x105f('0x41')]['find'](_0x9166be)[_0x105f('0x21')](handleEntityNotFound(_0x47c020,null))[_0x105f('0x21')](respondWithResult(_0x47c020,null))[_0x105f('0x2b')](handleError(_0x47c020,null));};exports[_0x105f('0x5b')]=function(_0x3f72f5,_0x1155e8){return db[_0x105f('0x41')][_0x105f('0x5b')](_0x3f72f5[_0x105f('0x5c')],{})[_0x105f('0x21')](function(_0x5b062c){var _0x138a6a=_0x3f72f5['user'][_0x105f('0x5d')]({'plain':!![]});if(!_0x138a6a)throw new Error(_0x105f('0x5e'));if(_0x138a6a['role']===_0x105f('0x5f')){var _0x166a9e=_0x5b062c[_0x105f('0x5d')]({'plain':!![]});var _0x204671=_0x105f('0x60');return db[_0x105f('0x61')][_0x105f('0x62')]({'where':{'name':_0x204671,'userProfileId':_0x138a6a[_0x105f('0x63')]},'raw':!![]})[_0x105f('0x21')](function(_0x452579){if(_0x452579&&_0x452579[_0x105f('0x64')]===0x0){return db[_0x105f('0x38')]['create']({'name':_0x166a9e[_0x105f('0x3b')],'resourceId':_0x166a9e['id'],'type':_0x452579[_0x105f('0x3b')],'sectionId':_0x452579['id']},{})[_0x105f('0x21')](function(){return _0x5b062c;});}else{return _0x5b062c;}})[_0x105f('0x2b')](function(_0x4401f5){logger[_0x105f('0x27')](_0x105f('0x65'),_0x4401f5);throw _0x4401f5;});}return _0x5b062c;})[_0x105f('0x21')](respondWithResult(_0x1155e8,0xc9))['catch'](handleError(_0x1155e8,null));};exports[_0x105f('0x36')]=function(_0x43d1e8,_0x110d5d){if(_0x43d1e8['body']['id']){delete _0x43d1e8['body']['id'];}return db[_0x105f('0x41')][_0x105f('0x62')]({'where':{'id':_0x43d1e8[_0x105f('0x58')]['id']},'include':[{'model':db[_0x105f('0x3e')],'as':_0x105f('0x3f')}]})[_0x105f('0x21')](handleEntityNotFound(_0x110d5d,null))['then'](saveUpdates(_0x43d1e8[_0x105f('0x5c')],null))[_0x105f('0x21')](respondWithResult(_0x110d5d,null))[_0x105f('0x2b')](handleError(_0x110d5d,null));};exports[_0x105f('0x37')]=function(_0x477d54,_0x2a19ec){return db[_0x105f('0x41')][_0x105f('0x62')]({'where':{'id':_0x477d54[_0x105f('0x58')]['id']}})[_0x105f('0x21')](handleEntityNotFound(_0x2a19ec,null))[_0x105f('0x21')](removeEntity(_0x2a19ec,null))[_0x105f('0x2b')](handleError(_0x2a19ec,null));};exports[_0x105f('0x66')]=function(_0x35e6d3,_0x1bd42a){return db[_0x105f('0x41')][_0x105f('0x66')]()[_0x105f('0x21')](respondWithResult(_0x1bd42a,null))['catch'](handleError(_0x1bd42a,null));};exports[_0x105f('0x67')]=function(_0x334421,_0x2baa2d,_0x1381e6){if(_0x334421[_0x105f('0x5c')]['id']){delete _0x334421[_0x105f('0x5c')]['id'];}return db[_0x105f('0x41')][_0x105f('0x62')]({'where':{'id':_0x334421[_0x105f('0x58')]['id']}})[_0x105f('0x21')](handleEntityNotFound(_0x2baa2d,null))['then'](function(_0x4e602c){if(_0x4e602c){_0x334421['body'][_0x105f('0x68')]=_0x4e602c['id'];return db[_0x105f('0x69')]['create'](_0x334421['body']);}})[_0x105f('0x21')](respondWithResult(_0x2baa2d,null))[_0x105f('0x2b')](handleError(_0x2baa2d,null));};exports[_0x105f('0x6a')]=function(_0x2bd927,_0x5ac0e1,_0x529674){var _0x477d95={'raw':![],'where':{}};var _0x3ecd49={};var _0x15bbaa={'count':0x0,'rows':[]};return db[_0x105f('0x41')][_0x105f('0x6b')]({'where':{'id':_0x2bd927[_0x105f('0x58')]['id']}})[_0x105f('0x21')](handleEntityNotFound(_0x5ac0e1,null))[_0x105f('0x21')](function(_0x5298eb){if(_0x5298eb){_0x3ecd49[_0x105f('0x46')]=_[_0x105f('0x59')](db[_0x105f('0x69')][_0x105f('0x42')]);_0x3ecd49[_0x105f('0x47')]=_[_0x105f('0x59')](_0x2bd927[_0x105f('0x47')]);_0x3ecd49['filters']=_[_0x105f('0x4a')](_0x3ecd49['model'],_0x3ecd49[_0x105f('0x47')]);_0x477d95[_0x105f('0x49')]=_[_0x105f('0x4a')](_0x3ecd49[_0x105f('0x46')],qs[_0x105f('0x4b')](_0x2bd927['query'][_0x105f('0x4b')]));_0x477d95[_0x105f('0x49')]=_0x477d95[_0x105f('0x49')]['length']?_0x477d95['attributes']:_0x3ecd49['model'];if(!_0x2bd927[_0x105f('0x47')][_0x105f('0x6c')]('nolimit')){_0x477d95[_0x105f('0x30')]=qs[_0x105f('0x30')](_0x2bd927[_0x105f('0x47')][_0x105f('0x30')]);_0x477d95[_0x105f('0x2e')]=qs[_0x105f('0x2e')](_0x2bd927[_0x105f('0x47')][_0x105f('0x2e')]);}_0x477d95[_0x105f('0x4e')]=qs[_0x105f('0x4f')](_0x2bd927['query']['sort']);_0x477d95['where']=qs[_0x105f('0x48')](_[_0x105f('0x51')](_0x2bd927[_0x105f('0x47')],_0x3ecd49['filters']));_0x477d95[_0x105f('0x50')][_0x105f('0x68')]=_0x5298eb['id'];if(_0x2bd927[_0x105f('0x47')][_0x105f('0x54')]){_0x477d95[_0x105f('0x50')]=_[_0x105f('0x52')](_0x477d95[_0x105f('0x50')],{'$or':_[_0x105f('0x40')](_0x477d95[_0x105f('0x49')],function(_0x401bba){var _0x228d66={};_0x228d66[_0x401bba]={'$like':'%'+_0x2bd927[_0x105f('0x47')][_0x105f('0x54')]+'%'};return _0x228d66;})});}_0x477d95=_[_0x105f('0x52')]({},_0x477d95,_0x2bd927['options']);return db[_0x105f('0x69')][_0x105f('0x31')]({'where':_0x477d95[_0x105f('0x50')]})[_0x105f('0x21')](function(_0x28f7e3){_0x15bbaa[_0x105f('0x31')]=_0x28f7e3;if(_0x2bd927['query'][_0x105f('0x56')]){_0x477d95[_0x105f('0x5a')]=[{'all':!![]}];}return db[_0x105f('0x69')][_0x105f('0x6d')](_0x477d95);})[_0x105f('0x21')](function(_0x53e366){_0x15bbaa['rows']=_0x53e366;return _0x15bbaa;});}})[_0x105f('0x21')](respondWithFilteredResult(_0x5ac0e1,_0x477d95))[_0x105f('0x2b')](handleError(_0x5ac0e1,null));};exports['removeDispositions']=function(_0x1aaf2c,_0x3caf01,_0x52b673){return db[_0x105f('0x41')]['find']({'where':{'id':_0x1aaf2c[_0x105f('0x58')]['id']}})[_0x105f('0x21')](handleEntityNotFound(_0x3caf01,null))[_0x105f('0x21')](function(_0xab3de2){if(_0xab3de2){return _0xab3de2[_0x105f('0x6e')](_0x1aaf2c['query']['ids']);}})[_0x105f('0x21')](respondWithStatusCode(_0x3caf01,null))[_0x105f('0x2b')](handleError(_0x3caf01,null));};exports[_0x105f('0x6f')]=function(_0x196476,_0x1b96d3,_0x285dce){if(_0x196476['body']['id']){delete _0x196476[_0x105f('0x5c')]['id'];}return db[_0x105f('0x41')][_0x105f('0x62')]({'where':{'id':_0x196476[_0x105f('0x58')]['id']}})[_0x105f('0x21')](handleEntityNotFound(_0x1b96d3,null))['then'](function(_0x8df2dc){if(_0x8df2dc){_0x196476[_0x105f('0x5c')][_0x105f('0x68')]=_0x8df2dc['id'];return db['CannedAnswer'][_0x105f('0x5b')](_0x196476[_0x105f('0x5c')]);}})[_0x105f('0x21')](respondWithResult(_0x1b96d3,null))[_0x105f('0x2b')](handleError(_0x1b96d3,null));};exports[_0x105f('0x70')]=function(_0x2517da,_0x5cee26,_0x3156e3){var _0x5604fc={'raw':![],'where':{}};var _0x119966={};var _0x4bd927={'count':0x0,'rows':[]};return db[_0x105f('0x41')]['findOne']({'where':{'id':_0x2517da[_0x105f('0x58')]['id']}})[_0x105f('0x21')](handleEntityNotFound(_0x5cee26,null))[_0x105f('0x21')](function(_0x5280d9){if(_0x5280d9){_0x119966['model']=_[_0x105f('0x59')](db[_0x105f('0x71')]['rawAttributes']);_0x119966[_0x105f('0x47')]=_[_0x105f('0x59')](_0x2517da[_0x105f('0x47')]);_0x119966['filters']=_['intersection'](_0x119966['model'],_0x119966[_0x105f('0x47')]);_0x5604fc[_0x105f('0x49')]=_[_0x105f('0x4a')](_0x119966[_0x105f('0x46')],qs[_0x105f('0x4b')](_0x2517da[_0x105f('0x47')][_0x105f('0x4b')]));_0x5604fc[_0x105f('0x49')]=_0x5604fc[_0x105f('0x49')][_0x105f('0x4c')]?_0x5604fc[_0x105f('0x49')]:_0x119966[_0x105f('0x46')];if(!_0x2517da['query']['hasOwnProperty']('nolimit')){_0x5604fc[_0x105f('0x30')]=qs[_0x105f('0x30')](_0x2517da[_0x105f('0x47')]['limit']);_0x5604fc[_0x105f('0x2e')]=qs[_0x105f('0x2e')](_0x2517da[_0x105f('0x47')][_0x105f('0x2e')]);}_0x5604fc[_0x105f('0x4e')]=qs[_0x105f('0x4f')](_0x2517da[_0x105f('0x47')][_0x105f('0x4f')]);_0x5604fc[_0x105f('0x50')]=qs[_0x105f('0x48')](_[_0x105f('0x51')](_0x2517da[_0x105f('0x47')],_0x119966[_0x105f('0x48')]));_0x5604fc[_0x105f('0x50')][_0x105f('0x68')]=_0x5280d9['id'];if(_0x2517da['query'][_0x105f('0x54')]){_0x5604fc[_0x105f('0x50')]=_['merge'](_0x5604fc[_0x105f('0x50')],{'$or':_['map'](_0x5604fc[_0x105f('0x49')],function(_0x7859bb){var _0x2a182e={};_0x2a182e[_0x7859bb]={'$like':'%'+_0x2517da[_0x105f('0x47')][_0x105f('0x54')]+'%'};return _0x2a182e;})});}_0x5604fc=_[_0x105f('0x52')]({},_0x5604fc,_0x2517da[_0x105f('0x55')]);return db[_0x105f('0x71')]['count']({'where':_0x5604fc[_0x105f('0x50')]})[_0x105f('0x21')](function(_0x491d68){_0x4bd927[_0x105f('0x31')]=_0x491d68;if(_0x2517da[_0x105f('0x47')][_0x105f('0x56')]){_0x5604fc[_0x105f('0x5a')]=[{'all':!![]}];}return db[_0x105f('0x71')][_0x105f('0x6d')](_0x5604fc);})[_0x105f('0x21')](function(_0x27f66a){_0x4bd927[_0x105f('0x72')]=_0x27f66a;return _0x4bd927;});}})[_0x105f('0x21')](respondWithFilteredResult(_0x5cee26,_0x5604fc))[_0x105f('0x2b')](handleError(_0x5cee26,null));};exports[_0x105f('0x73')]=function(_0x482637,_0x358272,_0x4943bc){return db['OpenchannelAccount'][_0x105f('0x62')]({'where':{'id':_0x482637[_0x105f('0x58')]['id']}})[_0x105f('0x21')](handleEntityNotFound(_0x358272,null))[_0x105f('0x21')](function(_0x553b06){if(_0x553b06){return _0x553b06[_0x105f('0x73')](_0x482637[_0x105f('0x47')][_0x105f('0x74')]);}})[_0x105f('0x21')](respondWithStatusCode(_0x358272,null))[_0x105f('0x2b')](handleError(_0x358272,null));};exports['notify']=function(_0x4ad7c6,_0x32cc6e,_0x4fda6b){var _0x4ea2f2={'body':_0x4ad7c6[_0x105f('0x5c')],'channel':'openchannel'};var _0x3facd5=[];var _0x30054a=[];var _0x1bf4c8={};var _0x493f0c=![];return db['CmContact'][_0x105f('0x66')]()['then'](function(_0x2f7970){if(!_0x2f7970){throw new db[(_0x105f('0x75'))][(_0x105f('0x76'))](_0x105f('0x77'));}_0x3facd5=_[_0x105f('0x78')](_[_0x105f('0x59')](_0x2f7970),['createdAt',_0x105f('0x79')]);_0x30054a=_[_0x105f('0x78')](_[_0x105f('0x59')](_0x2f7970),[_0x105f('0x7a'),_0x105f('0x79'),_0x105f('0x7b'),_0x105f('0x7c')]);if(_0x4ad7c6['body']['id']){delete _0x4ad7c6['body']['id'];}if(_['isNil'](_0x4ad7c6[_0x105f('0x5c')][_0x105f('0x7d')])){throw new db[(_0x105f('0x75'))]['ValidationError']('from\x20is\x20mandatory');}if(_[_0x105f('0x7e')](_0x4ad7c6[_0x105f('0x5c')][_0x105f('0x5c')])||_0x4ad7c6[_0x105f('0x5c')][_0x105f('0x5c')]===''){throw new db[(_0x105f('0x75'))][(_0x105f('0x76'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x105f('0x7e')](_0x4ad7c6[_0x105f('0x5c')]['mapKey'])){throw new db[(_0x105f('0x75'))][(_0x105f('0x76'))](_0x105f('0x7f')+_0x30054a);}if(!_[_0x105f('0x80')](_0x30054a,_0x4ad7c6['body'][_0x105f('0x81')])){throw new db[(_0x105f('0x75'))]['ValidationError'](_0x105f('0x82')+_0x30054a);}_0x1bf4c8[_0x4ad7c6[_0x105f('0x5c')][_0x105f('0x81')]]=_0x4ad7c6[_0x105f('0x5c')][_0x105f('0x7d')];})[_0x105f('0x21')](function(){return db[_0x105f('0x41')][_0x105f('0x62')]({'where':{'id':_0x4ad7c6[_0x105f('0x58')]['id']},'include':[{'model':db[_0x105f('0x83')],'as':'List','include':[{'model':db[_0x105f('0x84')],'as':_0x105f('0x85'),'where':_0x1bf4c8,'limit':0x1,'order':[[_0x105f('0x79'),_0x105f('0x86')]]}]},{'model':db['OpenchannelApplication'],'as':'Applications'}]});})[_0x105f('0x21')](handleEntityNotFound(_0x32cc6e,null))[_0x105f('0x21')](function(_0x309eec){if(_0x309eec&&_0x309eec['List']){_0x4ea2f2[_0x105f('0x87')]=_0x309eec;_0x4ea2f2[_0x105f('0x88')]=_0x309eec['Applications'];_0x4ea2f2['list']=_0x309eec['List'];_0x4ea2f2[_0x105f('0x88')]=_[_0x105f('0x89')](_0x4ea2f2['applications'],['priority'],[_0x105f('0x8a')]);if(_0x4ea2f2['account'][_0x105f('0x8b')]){delete _0x4ea2f2['account'][_0x105f('0x8b')];}if(_0x4ea2f2[_0x105f('0x87')][_0x105f('0x8c')]&&_0x4ea2f2[_0x105f('0x87')][_0x105f('0x8c')][_0x105f('0x85')][_0x105f('0x4c')]){return _0x4ea2f2[_0x105f('0x87')][_0x105f('0x8c')]['Contacts'][0x0];}var _0x331a19=_[_0x105f('0x1b')](_0x4ad7c6['body'],{'firstName':_0x4ad7c6[_0x105f('0x5c')][_0x105f('0x7d')],'ListId':_0x309eec[_0x105f('0x7c')]});_0x331a19[_0x4ad7c6['body'][_0x105f('0x81')]]=_0x4ad7c6[_0x105f('0x5c')]['from'];return db[_0x105f('0x84')][_0x105f('0x5b')](_0x331a19,{'fields':_0x3facd5,'raw':!![]});}})[_0x105f('0x21')](handleEntityNotFound(_0x32cc6e,null))[_0x105f('0x21')](function(_0x1e63d8){_0x4ea2f2['contact']=_0x1e63d8;if(_0x1e63d8){var _0x5652a6={'ContactId':_0x1e63d8['id'],'OpenchannelAccountId':_0x4ad7c6['params']['id'],'from':(_0x1e63d8[_0x105f('0x8d')]||'')+'\x20'+(_0x1e63d8[_0x105f('0x8e')]||'')};var _0x350b19={'OpenchannelAccountId':_0x4ad7c6[_0x105f('0x58')]['id'],'closed':![]};if(_0x4ad7c6[_0x105f('0x5c')]['threadId']){_0x350b19[_0x105f('0x8f')]=_0x4ad7c6[_0x105f('0x5c')][_0x105f('0x8f')];return db[_0x105f('0x90')]['find']({'where':_0x350b19})[_0x105f('0x21')](function(_0x39245d){if(_0x39245d){return[_0x39245d,![]];}_0x5652a6[_0x105f('0x8f')]=_0x4ad7c6[_0x105f('0x5c')][_0x105f('0x8f')];_0x5652a6['externalUrl']=_0x4ad7c6[_0x105f('0x5c')][_0x105f('0x91')];return db[_0x105f('0x90')]['create'](_0x5652a6)[_0x105f('0x21')](function(_0x3b3eb4){return[_0x3b3eb4,!![]];});});}else{_0x350b19['threadId']=null;}_0x350b19[_0x105f('0x92')]=_0x1e63d8['id'];return db[_0x105f('0x90')][_0x105f('0x62')]({'where':_0x350b19})[_0x105f('0x21')](function(_0x1cde1c){if(_0x1cde1c){return[_0x1cde1c,![]];}return db[_0x105f('0x90')][_0x105f('0x5b')](_0x5652a6)[_0x105f('0x21')](function(_0x2ff1be){return[_0x2ff1be,!![]];});});}})[_0x105f('0x93')](function(_0x9fb597,_0x12c4fd){if(_0x9fb597){_0x493f0c=_0x12c4fd;if(!_0x12c4fd){var _0x4c64e6={'from':(_0x4ea2f2[_0x105f('0x94')][_0x105f('0x8d')]||'')+'\x20'+(_0x4ea2f2['contact'][_0x105f('0x8e')]||'')};if(_0x4ad7c6['body']['threadId']&&_0x4ad7c6['body'][_0x105f('0x95')]&&_0x4ad7c6['body'][_0x105f('0x8f')]!=_0x4ad7c6[_0x105f('0x5c')][_0x105f('0x95')]){_0x4c64e6[_0x105f('0x8f')]=_0x4ad7c6[_0x105f('0x5c')]['messageId'];}return _0x9fb597[_0x105f('0x36')](_0x4c64e6);}else{return _0x9fb597;}}})[_0x105f('0x21')](function(_0x4b3b64){_0x4ea2f2[_0x105f('0x96')]=_0x4b3b64[_0x105f('0x5d')]({'plain':!![]});_0x4ea2f2['interaction'][_0x105f('0x97')]=_0x493f0c;if(_0x4ea2f2[_0x105f('0x96')][_0x105f('0x97')]){if(_0x4ea2f2[_0x105f('0x87')][_0x105f('0x98')]){_0x4ea2f2[_0x105f('0x88')][_0x105f('0x99')]({'id':0x0,'priority':_0x4ea2f2[_0x105f('0x88')][_0x105f('0x4c')]+0x1,'app':'close','appdata':_0x105f('0x9a'),'interval':'*,*,*,*'});}}return db['OpenchannelMessage']['create']({'body':_0x4ad7c6[_0x105f('0x5c')][_0x105f('0x5c')],'OpenchannelAccountId':_0x4ad7c6[_0x105f('0x58')]['id'],'OpenchannelInteractionId':_0x4b3b64['id'],'direction':'in','ContactId':_0x4ea2f2[_0x105f('0x94')]['id'],'AttachmentId':_0x4ad7c6[_0x105f('0x5c')]['AttachmentId']});})['then'](function(_0x52d3a2){_0x4ea2f2[_0x105f('0x29')]=_0x52d3a2;if(!_0x4ea2f2['interaction'][_0x105f('0x9b')])return;return db[_0x105f('0x9c')][_0x105f('0x62')]({'attributes':['id',_0x105f('0x3b')],'where':{'id':_0x4ea2f2[_0x105f('0x96')][_0x105f('0x9b')]}});})[_0x105f('0x21')](function(_0x4f25b1){if(_0x4f25b1){_0x4ea2f2['applications'][_0x105f('0x9d')]({'id':0x0,'priority':0x0,'app':_0x105f('0x9e'),'appdata':_0x4f25b1[_0x105f('0x3b')]+','+(_0x4ea2f2['account'][_0x105f('0x9f')]||0xa),'interval':_0x105f('0xa0')});}if(!_0x4ea2f2[_0x105f('0x96')][_0x105f('0xa1')])return;return db[_0x105f('0xa2')][_0x105f('0x62')]({'attributes':['id',_0x105f('0x3b')],'where':{'id':_0x4ea2f2['interaction'][_0x105f('0xa1')]}});})[_0x105f('0x21')](function(_0x3256f2){if(_0x3256f2){_0x4ea2f2[_0x105f('0x88')]['unshift']({'id':0x0,'priority':0x1,'app':_0x105f('0xa3'),'appdata':_0x3256f2[_0x105f('0x3b')]+','+(_0x4ea2f2[_0x105f('0x87')][_0x105f('0xa4')]||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x105f('0xa5'),'startRouting',_0x4ea2f2);})[_0x105f('0x21')](function(_0x3a9905){respondWithRpcPromise(_0x105f('0xa6'),_0x105f('0xa6'),{'event':_0x105f('0xa7'),'message':_0x3a9905},client9002);return _0x3a9905;})[_0x105f('0x21')](respondWithResult(_0x32cc6e,null))[_0x105f('0x2b')](handleError(_0x32cc6e,null));};exports['addApplications']=function(_0x484c51,_0x3a860c){var _0x3bcd31=_0x484c51[_0x105f('0x58')]['id'];var _0x5b85f8=_0x484c51['body'];var _0x887156=0xc8;var _0x462b51=null;return db[_0x105f('0xa8')]['transaction']({'isolationLevel':db[_0x105f('0xa8')]['Transaction'][_0x105f('0xa9')][_0x105f('0xaa')]},function(_0x45d7cf){return db['OpenchannelAccount']['findOne']({'where':{'id':_0x3bcd31},'transaction':_0x45d7cf})[_0x105f('0x21')](function(_0x44acc4){if(_0x44acc4){return db[_0x105f('0xab')][_0x105f('0x37')]({'where':{'OpenchannelAccountId':_0x3bcd31},'transaction':_0x45d7cf})['then'](function(){var _0xe05dcf=_[_0x105f('0x40')](_0x5b85f8,function(_0x5ad117){_0x5ad117[_0x105f('0x68')]=_0x3bcd31;return _0x5ad117;});return db[_0x105f('0xab')][_0x105f('0xac')](_0xe05dcf,{'transaction':_0x45d7cf});});}else{_0x887156=0x194;_0x462b51=[];}});})['then'](function(){if(_0x887156!==0x194){return db[_0x105f('0xab')]['findAndCountAll']({'where':{'OpenchannelAccountId':_0x3bcd31},'order':_0x105f('0xad')})[_0x105f('0x21')](function(_0x2cb71f){_0x462b51=_0x2cb71f;});}})[_0x105f('0x2b')](function(_0x17dfb3){_0x887156=0x1f4;logger[_0x105f('0x27')](_0x17dfb3[_0x105f('0x3a')]);if(_0x17dfb3[_0x105f('0x3b')]){delete _0x17dfb3[_0x105f('0x3b')];}_0x462b51=_0x17dfb3;})[_0x105f('0xae')](function(){if(_0x462b51===null){_0x3a860c['sendStatus'](_0x887156);}else{if(_0x887156===0x1f4){_0x3a860c['status'](_0x887156)[_0x105f('0x3c')](_0x462b51);}else{_0x3a860c[_0x105f('0x2c')](_0x887156)[_0x105f('0x33')](_0x462b51);}}});};exports['getApplications']=function(_0x3a37e8,_0x1edec2,_0x558e66){var _0x310b50={};var _0x56490a={};var _0x5dbf9c;var _0x4bf6d7;return db[_0x105f('0x41')][_0x105f('0x6b')]({'where':{'id':_0x3a37e8[_0x105f('0x58')]['id']}})[_0x105f('0x21')](handleEntityNotFound(_0x1edec2,null))['then'](function(_0x4b6feb){if(_0x4b6feb){_0x5dbf9c=_0x4b6feb;_0x56490a[_0x105f('0x46')]=_['keys'](db[_0x105f('0xab')][_0x105f('0x42')]);_0x56490a[_0x105f('0x47')]=_[_0x105f('0x59')](_0x3a37e8[_0x105f('0x47')]);_0x56490a[_0x105f('0x48')]=_['intersection'](_0x56490a[_0x105f('0x46')],_0x56490a['query']);_0x310b50[_0x105f('0x49')]=_[_0x105f('0x4a')](_0x56490a[_0x105f('0x46')],qs[_0x105f('0x4b')](_0x3a37e8['query'][_0x105f('0x4b')]));_0x310b50[_0x105f('0x49')]=_0x310b50['attributes'][_0x105f('0x4c')]?_0x310b50[_0x105f('0x49')]:_0x56490a[_0x105f('0x46')];_0x310b50[_0x105f('0x4e')]=qs['sort'](_0x3a37e8[_0x105f('0x47')][_0x105f('0x4f')]);_0x310b50[_0x105f('0x50')]=qs[_0x105f('0x48')](_[_0x105f('0x51')](_0x3a37e8['query'],_0x56490a['filters']));if(_0x3a37e8['query'][_0x105f('0x54')]){_0x310b50['where']=_[_0x105f('0x52')](_0x310b50['where'],{'$or':_['map'](_0x310b50[_0x105f('0x49')],function(_0x276a54){var _0x1c7040={};_0x1c7040[_0x276a54]={'$like':'%'+_0x3a37e8['query'][_0x105f('0x54')]+'%'};return _0x1c7040;})});}_0x310b50=_[_0x105f('0x52')]({},_0x310b50,_0x3a37e8[_0x105f('0x55')]);return _0x5dbf9c[_0x105f('0xaf')](_0x310b50);}})['then'](function(_0x6f6048){if(_0x6f6048){_0x4bf6d7=_0x6f6048[_0x105f('0x4c')];if(!_0x3a37e8[_0x105f('0x47')][_0x105f('0x6c')]('nolimit')){_0x310b50[_0x105f('0x30')]=qs[_0x105f('0x30')](_0x3a37e8['query'][_0x105f('0x30')]);_0x310b50[_0x105f('0x2e')]=qs[_0x105f('0x2e')](_0x3a37e8['query'][_0x105f('0x2e')]);}return _0x5dbf9c[_0x105f('0xaf')](_0x310b50);}})[_0x105f('0x21')](function(_0x5409af){if(_0x5409af){return _0x5409af?{'count':_0x4bf6d7,'rows':_0x5409af}:null;}})[_0x105f('0x21')](respondWithResult(_0x1edec2,null))['catch'](handleError(_0x1edec2,null));};exports[_0x105f('0xb0')]=function(_0x38baa1,_0x367bd4,_0x32c39e){var _0x51fb6a={'raw':![],'where':{}};var _0x3741e1={};var _0x439885={'count':0x0,'rows':[]};return db[_0x105f('0x41')][_0x105f('0x6b')]({'where':{'id':_0x38baa1[_0x105f('0x58')]['id']}})[_0x105f('0x21')](handleEntityNotFound(_0x367bd4,null))[_0x105f('0x21')](function(_0x35a3e1){if(_0x35a3e1){_0x3741e1[_0x105f('0x46')]=_[_0x105f('0x59')](db[_0x105f('0x90')]['rawAttributes']);_0x3741e1[_0x105f('0x47')]=_[_0x105f('0x59')](_0x38baa1[_0x105f('0x47')]);_0x3741e1[_0x105f('0x48')]=_['intersection'](_0x3741e1[_0x105f('0x46')],_0x3741e1['query']);_0x51fb6a['attributes']=_[_0x105f('0x4a')](_0x3741e1[_0x105f('0x46')],qs['fields'](_0x38baa1[_0x105f('0x47')][_0x105f('0x4b')]));_0x51fb6a[_0x105f('0x49')]=_0x51fb6a['attributes'][_0x105f('0x4c')]?_0x51fb6a[_0x105f('0x49')]:_0x3741e1['model'];if(!_0x38baa1[_0x105f('0x47')][_0x105f('0x6c')](_0x105f('0x4d'))){_0x51fb6a[_0x105f('0x30')]=qs[_0x105f('0x30')](_0x38baa1[_0x105f('0x47')][_0x105f('0x30')]);_0x51fb6a[_0x105f('0x2e')]=qs[_0x105f('0x2e')](_0x38baa1[_0x105f('0x47')][_0x105f('0x2e')]);}_0x51fb6a[_0x105f('0x4e')]=qs[_0x105f('0x4f')](_0x38baa1[_0x105f('0x47')]['sort']);_0x51fb6a[_0x105f('0x50')]=qs[_0x105f('0x48')](_[_0x105f('0x51')](_0x38baa1[_0x105f('0x47')],_0x3741e1['filters']));_0x51fb6a['where'][_0x105f('0x68')]=_0x35a3e1['id'];if(_0x38baa1[_0x105f('0x47')][_0x105f('0x54')]){_0x51fb6a[_0x105f('0x50')]=_[_0x105f('0x52')](_0x51fb6a[_0x105f('0x50')],{'$or':_[_0x105f('0x40')](_0x51fb6a['attributes'],function(_0x269f5d){var _0x230b51={};_0x230b51[_0x269f5d]={'$like':'%'+_0x38baa1[_0x105f('0x47')][_0x105f('0x54')]+'%'};return _0x230b51;})});}_0x51fb6a=_['merge']({},_0x51fb6a,_0x38baa1[_0x105f('0x55')]);return db[_0x105f('0x90')][_0x105f('0x31')]({'where':_0x51fb6a[_0x105f('0x50')]})['then'](function(_0x279a5b){_0x439885['count']=_0x279a5b;if(_0x38baa1[_0x105f('0x47')][_0x105f('0x56')]){_0x51fb6a[_0x105f('0x5a')]=[{'model':db[_0x105f('0x84')],'as':_0x105f('0xb1'),'required':![]},{'model':db['User'],'as':'Owner','attributes':[_0x105f('0x3b'),_0x105f('0xb2'),_0x105f('0xb3')],'required':![]},{'model':db[_0x105f('0xb4')],'as':_0x105f('0xb5'),'attributes':['id',_0x105f('0x3b'),_0x105f('0xb6')],'where':_0x38baa1[_0x105f('0x47')][_0x105f('0xb7')]?{'id':_0x38baa1[_0x105f('0x47')][_0x105f('0xb7')]}:undefined,'required':_0x38baa1[_0x105f('0x47')][_0x105f('0xb7')]?!![]:![]}];}return db[_0x105f('0x90')][_0x105f('0x6d')](_0x51fb6a);})[_0x105f('0x21')](function(_0x196de4){_0x439885['rows']=_0x196de4;return _0x439885;});}})['then'](respondWithFilteredResult(_0x367bd4,_0x51fb6a))['catch'](handleError(_0x367bd4,null));};exports[_0x105f('0xb8')]=function(_0x581916,_0x465c5e,_0x18fce2){return db[_0x105f('0x41')][_0x105f('0x62')]({'where':{'id':_0x581916[_0x105f('0x58')]['id']}})[_0x105f('0x21')](handleEntityNotFound(_0x465c5e,null))['then'](function(_0x4a4b86){if(_0x4a4b86){return _0x4a4b86[_0x105f('0xb8')](_0x581916[_0x105f('0x5c')][_0x105f('0x74')],_[_0x105f('0xb9')](_0x581916[_0x105f('0x5c')],[_0x105f('0x74'),'id'])||{})[_0x105f('0x93')](function(_0x4ecd66){for(var _0x132d71=0x0;_0x132d71<_0x581916[_0x105f('0x5c')][_0x105f('0x74')][_0x105f('0x4c')];_0x132d71+=0x1){socket[_0x105f('0xba')](_0x105f('0xbb'),{'UserId':Number(_0x581916[_0x105f('0x5c')]['ids'][_0x132d71]),'OpenchannelAccountId':Number(_0x581916['params']['id'])});}return _0x4ecd66;});}})['then'](respondWithResult(_0x465c5e,null))[_0x105f('0x2b')](handleError(_0x465c5e,null));};exports[_0x105f('0xbc')]=function(_0x157248,_0x3f1f5c,_0xec717a){return db[_0x105f('0x41')][_0x105f('0x62')]({'where':{'id':_0x157248[_0x105f('0x58')]['id']}})[_0x105f('0x21')](handleEntityNotFound(_0x3f1f5c,null))[_0x105f('0x21')](function(_0x380248){if(_0x380248){return _0x380248[_0x105f('0xbc')](_0x157248[_0x105f('0x47')]['ids'])['then'](function(){if(_[_0x105f('0xbd')](_0x157248[_0x105f('0x47')][_0x105f('0x74')])){for(var _0x547867=0x0;_0x547867<_0x157248[_0x105f('0x47')][_0x105f('0x74')][_0x105f('0x4c')];_0x547867+=0x1){socket[_0x105f('0xba')](_0x105f('0xbe'),{'UserId':Number(_0x157248[_0x105f('0x47')][_0x105f('0x74')][_0x547867]),'OpenchannelAccountId':Number(_0x157248[_0x105f('0x58')]['id'])});}}else{socket[_0x105f('0xba')]('userOpenchannelAccount:remove',{'UserId':Number(_0x157248[_0x105f('0x47')][_0x105f('0x74')]),'OpenchannelAccountId':Number(_0x157248[_0x105f('0x58')]['id'])});}});}})[_0x105f('0x21')](respondWithStatusCode(_0x3f1f5c,null))[_0x105f('0x2b')](handleError(_0x3f1f5c,null));};exports[_0x105f('0xbf')]=function(_0x26174c,_0x354242,_0x1f4213){var _0x5c3497={};var _0xf14d7b={};var _0x439db1;var _0x137cf3;return db['OpenchannelAccount'][_0x105f('0x6b')]({'where':{'id':_0x26174c[_0x105f('0x58')]['id']}})[_0x105f('0x21')](handleEntityNotFound(_0x354242,null))[_0x105f('0x21')](function(_0x244b9a){if(_0x244b9a){_0x439db1=_0x244b9a;_0xf14d7b[_0x105f('0x46')]=_[_0x105f('0x59')](db['User'][_0x105f('0x42')]);_0xf14d7b[_0x105f('0x47')]=_[_0x105f('0x59')](_0x26174c['query']);_0xf14d7b[_0x105f('0x48')]=_['intersection'](_0xf14d7b[_0x105f('0x46')],_0xf14d7b[_0x105f('0x47')]);_0x5c3497[_0x105f('0x49')]=_[_0x105f('0x4a')](_0xf14d7b[_0x105f('0x46')],qs[_0x105f('0x4b')](_0x26174c[_0x105f('0x47')][_0x105f('0x4b')]));_0x5c3497['attributes']=_0x5c3497[_0x105f('0x49')]['length']?_0x5c3497[_0x105f('0x49')]:_0xf14d7b[_0x105f('0x46')];_0x5c3497[_0x105f('0x4e')]=qs[_0x105f('0x4f')](_0x26174c[_0x105f('0x47')][_0x105f('0x4f')]);_0x5c3497[_0x105f('0x50')]=qs[_0x105f('0x48')](_['pick'](_0x26174c['query'],_0xf14d7b[_0x105f('0x48')]));if(_0x26174c[_0x105f('0x47')]['filter']){_0x5c3497[_0x105f('0x50')]=_['merge'](_0x5c3497[_0x105f('0x50')],{'$or':_['map'](_0x5c3497[_0x105f('0x49')],function(_0x54a703){var _0x33f6be={};_0x33f6be[_0x54a703]={'$like':'%'+_0x26174c['query'][_0x105f('0x54')]+'%'};return _0x33f6be;})});}_0x5c3497=_['merge']({},_0x5c3497,_0x26174c[_0x105f('0x55')]);return _0x439db1[_0x105f('0xbf')](_0x5c3497);}})[_0x105f('0x21')](function(_0x1020cc){if(_0x1020cc){_0x137cf3=_0x1020cc['length'];if(!_0x26174c['query'][_0x105f('0x6c')](_0x105f('0x4d'))){_0x5c3497[_0x105f('0x30')]=qs['limit'](_0x26174c[_0x105f('0x47')][_0x105f('0x30')]);_0x5c3497['offset']=qs['offset'](_0x26174c[_0x105f('0x47')][_0x105f('0x2e')]);}return _0x439db1[_0x105f('0xbf')](_0x5c3497);}})[_0x105f('0x21')](function(_0x18afb0){if(_0x18afb0){return _0x18afb0?{'count':_0x137cf3,'rows':_0x18afb0}:null;}})[_0x105f('0x21')](respondWithResult(_0x354242,null))[_0x105f('0x2b')](handleError(_0x354242,null));};exports[_0x105f('0x3c')]=function(_0x16e028,_0x562233,_0x5f2abe){var _0x5a5f14,_0x4fa02e,_0x46d82e;if(_[_0x105f('0x7e')](_0x16e028[_0x105f('0x5c')][_0x105f('0x5c')])||_0x16e028[_0x105f('0x5c')]['body']===''){throw new db[(_0x105f('0x75'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x105f('0x7e')](_0x16e028['body']['to'])){}_0x5a5f14=_0x16e028[_0x105f('0x5c')]['to'];return db[_0x105f('0x41')][_0x105f('0x6b')]({'where':{'id':_0x16e028[_0x105f('0x58')]['id']}})['then'](handleEntityNotFound(_0x562233,null))['then'](function(_0x2eebfc){if(_0x2eebfc){return db['OpenchannelAccount'][_0x105f('0x62')]({'where':{'id':_0x2eebfc['id']},'include':[{'model':db[_0x105f('0x83')],'as':'List','include':[{'model':db['CmContact'],'as':'Contacts','where':{[_0x2eebfc[_0x105f('0x81')]]:_0x5a5f14},'limit':0x1,'order':[[_0x105f('0x79'),_0x105f('0x86')]]}]}]})[_0x105f('0x21')](handleEntityNotFound(_0x562233,null))['then'](function(_0x309ba2){if(_0x309ba2&&_0x309ba2[_0x105f('0x8c')]){_0x4fa02e=_0x309ba2[_0x105f('0x5d')]({'plain':!![]});if(_0x4fa02e[_0x105f('0x8c')]&&_0x4fa02e[_0x105f('0x8c')][_0x105f('0x85')]['length']){return _0x4fa02e['List']['Contacts'][0x0];}return db[_0x105f('0x84')][_0x105f('0x5b')](_[_0x105f('0x1b')](_0x16e028[_0x105f('0x5c')],{'firstName':_0x5a5f14,[_0x309ba2[_0x105f('0x81')]]:_0x5a5f14,'phone':_0x5a5f14,'ListId':_0x4fa02e[_0x105f('0x7c')]}));}})[_0x105f('0x21')](handleEntityNotFound(_0x562233,null))[_0x105f('0x21')](function(_0x3da81c){if(_0x3da81c){_0x46d82e=_0x3da81c;return db[_0x105f('0x90')][_0x105f('0x62')]({'where':{'ContactId':_0x46d82e['id'],'closed':![],'OpenchannelAccountId':_0x4fa02e['id']}})[_0x105f('0x21')](function(_0x4a6c44){if(_0x4a6c44){return[_0x4a6c44,![]];}return db[_0x105f('0x90')][_0x105f('0x5b')]({'UserId':_0x16e028[_0x105f('0x5f')]['id'],'ContactId':_0x46d82e['id'],'OpenchannelAccountId':_0x4fa02e['id'],'lastMsgDirection':_0x105f('0xc0'),'firstMsgDirection':_0x105f('0xc0'),'Messages':[_[_0x105f('0x52')](_0x16e028[_0x105f('0x5c')],{'read':![],'body':_0x16e028[_0x105f('0x5c')][_0x105f('0x5c')],'OpenchannelAccountId':_0x4fa02e['id'],'UserId':_0x16e028[_0x105f('0x5f')]['id'],'ContactId':_0x46d82e['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':_0x105f('0xc1')}]})[_0x105f('0x21')](function(_0x4dfdfb){return[_0x4dfdfb,!![]];});});}})[_0x105f('0x93')](function(_0x37096b,_0x1bb157){if(_0x1bb157){return _0x37096b;}return db[_0x105f('0xc2')][_0x105f('0x5b')](_[_0x105f('0x52')](_0x16e028[_0x105f('0x5c')],{'read':![],'body':_0x16e028[_0x105f('0x5c')]['body'],'OpenchannelAccountId':_0x4fa02e['id'],'OpenchannelInteractionId':_0x37096b['id'],'UserId':_0x16e028['user']['id'],'ContactId':_0x46d82e['id']}))[_0x105f('0x21')](function(_0x106fd8){_0x37096b[_0x105f('0xc3')][_0x105f('0xc1')]=[];_0x37096b[_0x105f('0xc3')]['Messages'][_0x105f('0x99')](_0x106fd8[_0x105f('0xc3')]);return _0x37096b;});});}})['then'](respondWithResult(_0x562233,null))['catch'](handleError(_0x562233,null));}; \ No newline at end of file +var _0x6f46=['squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./openchannelAccount.socket','jayson/promise','http','client','request','info','debug','error','code','message','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','result','catch','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','get','destroy','stack','name','Pause','mandatoryDispositionPause','OpenchannelAccount','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','map','type','VIRTUAL','filter','merge','options','include','rows','params','rawAttributes','length','includeAll','find','create','body','user','role','OpenchannelAccounts','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','describe','addDisposition','OpenchannelAccountId','getDispositions','findOne','pick','Disposition','findAll','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','openchannel','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','difference','CompanyId','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','from','CmList','Contacts','updatedAt','DESC','Applications','account','list','List','applications','orderBy','priority','defaults','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','messageId','interaction','created','autoclose','push','close','*,*,*,*','OpenchannelMessage','AttachmentId','User','unshift','agent','waitForTheAssignedAgent','queueId','OpenchannelQueue','queue','startRouting','EventManager','notify','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','OpenchannelApplication','bulkCreate','findAndCountAll','finally','sendStatus','send','getApplications','getInteractions','fullname','internal','Tag','Tags','color','tag','addAgents','omit','emit','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','ListId','out','dataValues','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs'];(function(_0x5cde25,_0xaecb63){var _0x33c9fd=function(_0x557cff){while(--_0x557cff){_0x5cde25['push'](_0x5cde25['shift']());}};_0x33c9fd(++_0xaecb63);}(_0x6f46,0xb8));var _0x66f4=function(_0x38bcf8,_0x11307d){_0x38bcf8=_0x38bcf8-0x0;var _0x2a035e=_0x6f46[_0x38bcf8];return _0x2a035e;};'use strict';var emlformat=require(_0x66f4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x66f4('0x1'));var jsonpatch=require(_0x66f4('0x2'));var rp=require(_0x66f4('0x3'));var moment=require(_0x66f4('0x4'));var BPromise=require(_0x66f4('0x5'));var Mustache=require(_0x66f4('0x6'));var util=require(_0x66f4('0x7'));var path=require(_0x66f4('0x8'));var sox=require(_0x66f4('0x9'));var csv=require(_0x66f4('0xa'));var ejs=require(_0x66f4('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x66f4('0xc'));var crypto=require(_0x66f4('0xd'));var jsforce=require(_0x66f4('0xe'));var deskjs=require(_0x66f4('0xf'));var toCsv=require(_0x66f4('0xa'));var querystring=require(_0x66f4('0x10'));var Papa=require(_0x66f4('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x66f4('0x12'));var as=require(_0x66f4('0x13'));var hardwareService=require(_0x66f4('0x14'));var logger=require(_0x66f4('0x15'))('api');var utils=require(_0x66f4('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x66f4('0x17'));var db=require(_0x66f4('0x18'))['db'];config['redis']=_['defaults'](config[_0x66f4('0x19')],{'host':_0x66f4('0x1a'),'port':0x18eb});var socket=require(_0x66f4('0x1b'))(new Redis(config[_0x66f4('0x19')]));require(_0x66f4('0x1c'))['register'](socket);var jayson=require(_0x66f4('0x1d'));var client=jayson['client'][_0x66f4('0x1e')]({'port':0x232c});var client9002=jayson[_0x66f4('0x1f')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1e6971,_0x42058d,_0x6ce3fc,_0x45f714){return new BPromise(function(_0x8d4a5d,_0x1c8407){var _0x1adbc7=_0x45f714||client;return _0x1adbc7[_0x66f4('0x20')](_0x1e6971,_0x6ce3fc)['then'](function(_0x20b8f2){logger[_0x66f4('0x21')]('OpenchannelAccount,\x20%s,\x20%s',_0x42058d,'request\x20sent');logger[_0x66f4('0x22')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x42058d,'request\x20sent',JSON['stringify'](_0x20b8f2));if(_0x20b8f2[_0x66f4('0x23')]){if(_0x20b8f2[_0x66f4('0x23')][_0x66f4('0x24')]===0x1f4){logger[_0x66f4('0x23')]('OpenchannelAccount,\x20%s,\x20%s',_0x42058d,_0x20b8f2[_0x66f4('0x23')][_0x66f4('0x25')]);return _0x1c8407(_0x20b8f2[_0x66f4('0x23')]['message']);}logger['error'](_0x66f4('0x26'),_0x42058d,_0x20b8f2[_0x66f4('0x23')]['message']);return _0x8d4a5d(_0x20b8f2[_0x66f4('0x23')][_0x66f4('0x25')]);}else{logger[_0x66f4('0x21')]('OpenchannelAccount,\x20%s,\x20%s',_0x42058d,_0x66f4('0x27'));_0x8d4a5d(_0x20b8f2[_0x66f4('0x28')][_0x66f4('0x25')]);}})[_0x66f4('0x29')](function(_0x145c9a){logger[_0x66f4('0x23')](_0x66f4('0x26'),_0x42058d,_0x145c9a);_0x1c8407(_0x145c9a);});});}function respondWithStatusCode(_0x48e0c3,_0x582d0e){_0x582d0e=_0x582d0e||0xcc;return function(_0x2904ec){if(_0x2904ec){return _0x48e0c3['sendStatus'](_0x582d0e);}return _0x48e0c3[_0x66f4('0x2a')](_0x582d0e)[_0x66f4('0x2b')]();};}function respondWithResult(_0x2a4cdc,_0x31131d){_0x31131d=_0x31131d||0xc8;return function(_0x307d34){if(_0x307d34){return _0x2a4cdc[_0x66f4('0x2a')](_0x31131d)[_0x66f4('0x2c')](_0x307d34);}};}function respondWithFilteredResult(_0x464a25,_0x24f02b){return function(_0x2d545b){if(_0x2d545b){var _0x5df22b=typeof _0x24f02b[_0x66f4('0x2d')]===_0x66f4('0x2e')&&typeof _0x24f02b[_0x66f4('0x2f')]===_0x66f4('0x2e');var _0x161dcd=_0x2d545b[_0x66f4('0x30')];var _0x56f398=_0x5df22b?0x0:_0x24f02b['offset'];var _0x5cae64=_0x5df22b?_0x2d545b[_0x66f4('0x30')]:_0x24f02b[_0x66f4('0x2d')]+_0x24f02b[_0x66f4('0x2f')];var _0xca40c2;if(_0x5cae64>=_0x161dcd){_0x5cae64=_0x161dcd;_0xca40c2=0xc8;}else{_0xca40c2=0xce;}_0x464a25[_0x66f4('0x2a')](_0xca40c2);return _0x464a25['set'](_0x66f4('0x31'),_0x56f398+'-'+_0x5cae64+'/'+_0x161dcd)[_0x66f4('0x2c')](_0x2d545b);}return null;};}function patchUpdates(_0x2149c5){return function(_0x4652af){try{jsonpatch[_0x66f4('0x32')](_0x4652af,_0x2149c5,!![]);}catch(_0xb35595){return BPromise[_0x66f4('0x33')](_0xb35595);}return _0x4652af[_0x66f4('0x34')]();};}function saveUpdates(_0x50ecf4,_0x4ec570){return function(_0x17406d){if(_0x17406d){return _0x17406d[_0x66f4('0x35')](_0x50ecf4)[_0x66f4('0x36')](function(_0xbc439b){return _0xbc439b;});}return null;};}function removeEntity(_0x91b977,_0x220e1e){return function(_0x4175f0){if(_0x4175f0){return _0x4175f0['destroy']()[_0x66f4('0x36')](function(){var _0x18cabb=_0x4175f0[_0x66f4('0x37')]({'plain':!![]});var _0x2874a4='OpenchannelAccounts';return db['UserProfileResource'][_0x66f4('0x38')]({'where':{'type':_0x2874a4,'resourceId':_0x18cabb['id']}})[_0x66f4('0x36')](function(){return _0x4175f0;});})[_0x66f4('0x36')](function(){_0x91b977['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x150c5c,_0x1a7845){return function(_0x1a06e3){if(!_0x1a06e3){_0x150c5c['sendStatus'](0x194);}return _0x1a06e3;};}function handleError(_0x16f159,_0x3f4bb){_0x3f4bb=_0x3f4bb||0x1f4;return function(_0x311e5d){logger[_0x66f4('0x23')](_0x311e5d[_0x66f4('0x39')]);if(_0x311e5d[_0x66f4('0x3a')]){delete _0x311e5d[_0x66f4('0x3a')];}_0x16f159[_0x66f4('0x2a')](_0x3f4bb)['send'](_0x311e5d);};}exports['index']=function(_0x2067bd,_0x1b54e8){var _0x39e8a6={'include':[{'model':db[_0x66f4('0x3b')],'as':_0x66f4('0x3c')}]},_0x21b7af={},_0x1b4834={'count':0x0,'rows':[]};var _0x10ef70=_['map'](db[_0x66f4('0x3d')]['rawAttributes'],function(_0x52e7e2){return{'name':_0x52e7e2[_0x66f4('0x3e')],'type':_0x52e7e2['type'][_0x66f4('0x3f')]};});_0x21b7af[_0x66f4('0x40')]=_['map'](_0x10ef70,'name');_0x21b7af[_0x66f4('0x41')]=_[_0x66f4('0x42')](_0x2067bd[_0x66f4('0x41')]);_0x21b7af[_0x66f4('0x43')]=_[_0x66f4('0x44')](_0x21b7af['model'],_0x21b7af['query']);_0x39e8a6[_0x66f4('0x45')]=_[_0x66f4('0x44')](_0x21b7af[_0x66f4('0x40')],qs[_0x66f4('0x46')](_0x2067bd[_0x66f4('0x41')]['fields']));_0x39e8a6[_0x66f4('0x45')]=_0x39e8a6[_0x66f4('0x45')]['length']?_0x39e8a6[_0x66f4('0x45')]:_0x21b7af[_0x66f4('0x40')];if(!_0x2067bd['query'][_0x66f4('0x47')](_0x66f4('0x48'))){_0x39e8a6[_0x66f4('0x2f')]=qs['limit'](_0x2067bd[_0x66f4('0x41')]['limit']);_0x39e8a6[_0x66f4('0x2d')]=qs['offset'](_0x2067bd[_0x66f4('0x41')][_0x66f4('0x2d')]);}_0x39e8a6[_0x66f4('0x49')]=qs[_0x66f4('0x4a')](_0x2067bd[_0x66f4('0x41')][_0x66f4('0x4a')]);_0x39e8a6[_0x66f4('0x4b')]=qs['filters'](_['pick'](_0x2067bd[_0x66f4('0x41')],_0x21b7af['filters']),_0x10ef70);if(_0x2067bd[_0x66f4('0x41')]['filter']){_0x39e8a6['where']=_['merge'](_0x39e8a6['where'],{'$or':_[_0x66f4('0x4c')](_0x10ef70,function(_0x5e0303){if(_0x5e0303[_0x66f4('0x4d')]!==_0x66f4('0x4e')){var _0x1991d7={};_0x1991d7[_0x5e0303[_0x66f4('0x3a')]]={'$like':'%'+_0x2067bd[_0x66f4('0x41')][_0x66f4('0x4f')]+'%'};return _0x1991d7;}})});}_0x39e8a6=_[_0x66f4('0x50')]({},_0x39e8a6,_0x2067bd[_0x66f4('0x51')]);var _0x157270={'where':_0x39e8a6[_0x66f4('0x4b')]};return db['OpenchannelAccount'][_0x66f4('0x30')](_0x157270)['then'](function(_0x5aee6c){_0x1b4834[_0x66f4('0x30')]=_0x5aee6c;if(_0x2067bd[_0x66f4('0x41')]['includeAll']){_0x39e8a6[_0x66f4('0x52')]=[{'all':!![]}];}return db[_0x66f4('0x3d')]['findAll'](_0x39e8a6);})[_0x66f4('0x36')](function(_0x381e77){_0x1b4834[_0x66f4('0x53')]=_0x381e77;return _0x1b4834;})[_0x66f4('0x36')](respondWithFilteredResult(_0x1b54e8,_0x39e8a6))['catch'](handleError(_0x1b54e8,null));};exports['show']=function(_0x3ed41b,_0x3991f9){var _0x2c040c={'raw':![],'where':{'id':_0x3ed41b[_0x66f4('0x54')]['id']},'include':[{'model':db[_0x66f4('0x3b')],'as':_0x66f4('0x3c')}]},_0x49962c={};_0x49962c[_0x66f4('0x40')]=_[_0x66f4('0x42')](db[_0x66f4('0x3d')][_0x66f4('0x55')]);_0x49962c[_0x66f4('0x41')]=_[_0x66f4('0x42')](_0x3ed41b['query']);_0x49962c[_0x66f4('0x43')]=_[_0x66f4('0x44')](_0x49962c[_0x66f4('0x40')],_0x49962c[_0x66f4('0x41')]);_0x2c040c['attributes']=_[_0x66f4('0x44')](_0x49962c[_0x66f4('0x40')],qs[_0x66f4('0x46')](_0x3ed41b[_0x66f4('0x41')][_0x66f4('0x46')]));_0x2c040c[_0x66f4('0x45')]=_0x2c040c[_0x66f4('0x45')][_0x66f4('0x56')]?_0x2c040c[_0x66f4('0x45')]:_0x49962c[_0x66f4('0x40')];if(_0x3ed41b[_0x66f4('0x41')][_0x66f4('0x57')]){_0x2c040c['include']=[{'all':!![]}];}_0x2c040c=_[_0x66f4('0x50')]({},_0x2c040c,_0x3ed41b[_0x66f4('0x51')]);return db[_0x66f4('0x3d')][_0x66f4('0x58')](_0x2c040c)[_0x66f4('0x36')](handleEntityNotFound(_0x3991f9,null))[_0x66f4('0x36')](respondWithResult(_0x3991f9,null))[_0x66f4('0x29')](handleError(_0x3991f9,null));};exports[_0x66f4('0x59')]=function(_0x109664,_0x236211){return db[_0x66f4('0x3d')][_0x66f4('0x59')](_0x109664[_0x66f4('0x5a')],{})[_0x66f4('0x36')](function(_0x50b412){var _0x3c90e3=_0x109664[_0x66f4('0x5b')][_0x66f4('0x37')]({'plain':!![]});if(!_0x3c90e3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3c90e3[_0x66f4('0x5c')]==='user'){var _0xd7dc44=_0x50b412[_0x66f4('0x37')]({'plain':!![]});var _0x4cdedf=_0x66f4('0x5d');return db[_0x66f4('0x5e')][_0x66f4('0x58')]({'where':{'name':_0x4cdedf,'userProfileId':_0x3c90e3[_0x66f4('0x5f')]},'raw':!![]})['then'](function(_0x19f4e4){if(_0x19f4e4&&_0x19f4e4[_0x66f4('0x60')]===0x0){return db[_0x66f4('0x61')]['create']({'name':_0xd7dc44['name'],'resourceId':_0xd7dc44['id'],'type':_0x19f4e4[_0x66f4('0x3a')],'sectionId':_0x19f4e4['id']},{})[_0x66f4('0x36')](function(){return _0x50b412;});}else{return _0x50b412;}})[_0x66f4('0x29')](function(_0x296f70){logger[_0x66f4('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x296f70);throw _0x296f70;});}return _0x50b412;})['then'](respondWithResult(_0x236211,0xc9))['catch'](handleError(_0x236211,null));};exports['update']=function(_0x33a2d4,_0x10782f){if(_0x33a2d4['body']['id']){delete _0x33a2d4[_0x66f4('0x5a')]['id'];}return db[_0x66f4('0x3d')]['find']({'where':{'id':_0x33a2d4['params']['id']},'include':[{'model':db[_0x66f4('0x3b')],'as':_0x66f4('0x3c')}]})[_0x66f4('0x36')](handleEntityNotFound(_0x10782f,null))[_0x66f4('0x36')](saveUpdates(_0x33a2d4[_0x66f4('0x5a')],null))[_0x66f4('0x36')](respondWithResult(_0x10782f,null))[_0x66f4('0x29')](handleError(_0x10782f,null));};exports['destroy']=function(_0x227c97,_0x4f83d4){return db[_0x66f4('0x3d')][_0x66f4('0x58')]({'where':{'id':_0x227c97[_0x66f4('0x54')]['id']}})[_0x66f4('0x36')](handleEntityNotFound(_0x4f83d4,null))[_0x66f4('0x36')](removeEntity(_0x4f83d4,null))[_0x66f4('0x29')](handleError(_0x4f83d4,null));};exports[_0x66f4('0x62')]=function(_0xab39f9,_0x15139c){return db['OpenchannelAccount'][_0x66f4('0x62')]()[_0x66f4('0x36')](respondWithResult(_0x15139c,null))[_0x66f4('0x29')](handleError(_0x15139c,null));};exports[_0x66f4('0x63')]=function(_0x268429,_0x10ece5,_0x31a602){if(_0x268429[_0x66f4('0x5a')]['id']){delete _0x268429[_0x66f4('0x5a')]['id'];}return db['OpenchannelAccount'][_0x66f4('0x58')]({'where':{'id':_0x268429[_0x66f4('0x54')]['id']}})['then'](handleEntityNotFound(_0x10ece5,null))[_0x66f4('0x36')](function(_0x3337b6){if(_0x3337b6){_0x268429['body'][_0x66f4('0x64')]=_0x3337b6['id'];return db['Disposition'][_0x66f4('0x59')](_0x268429[_0x66f4('0x5a')]);}})[_0x66f4('0x36')](respondWithResult(_0x10ece5,null))[_0x66f4('0x29')](handleError(_0x10ece5,null));};exports[_0x66f4('0x65')]=function(_0xc96132,_0xee6f6e,_0xc2d28){var _0x59f75={'raw':![],'where':{}};var _0x2c5649={};var _0x55d3f3={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x66f4('0x66')]({'where':{'id':_0xc96132['params']['id']}})['then'](handleEntityNotFound(_0xee6f6e,null))['then'](function(_0x169357){if(_0x169357){_0x2c5649['model']=_[_0x66f4('0x42')](db['Disposition'][_0x66f4('0x55')]);_0x2c5649['query']=_['keys'](_0xc96132[_0x66f4('0x41')]);_0x2c5649[_0x66f4('0x43')]=_[_0x66f4('0x44')](_0x2c5649[_0x66f4('0x40')],_0x2c5649[_0x66f4('0x41')]);_0x59f75[_0x66f4('0x45')]=_[_0x66f4('0x44')](_0x2c5649[_0x66f4('0x40')],qs[_0x66f4('0x46')](_0xc96132[_0x66f4('0x41')][_0x66f4('0x46')]));_0x59f75[_0x66f4('0x45')]=_0x59f75[_0x66f4('0x45')]['length']?_0x59f75['attributes']:_0x2c5649['model'];if(!_0xc96132[_0x66f4('0x41')][_0x66f4('0x47')](_0x66f4('0x48'))){_0x59f75['limit']=qs['limit'](_0xc96132['query'][_0x66f4('0x2f')]);_0x59f75[_0x66f4('0x2d')]=qs[_0x66f4('0x2d')](_0xc96132['query'][_0x66f4('0x2d')]);}_0x59f75[_0x66f4('0x49')]=qs[_0x66f4('0x4a')](_0xc96132['query'][_0x66f4('0x4a')]);_0x59f75[_0x66f4('0x4b')]=qs[_0x66f4('0x43')](_[_0x66f4('0x67')](_0xc96132[_0x66f4('0x41')],_0x2c5649[_0x66f4('0x43')]));_0x59f75[_0x66f4('0x4b')]['OpenchannelAccountId']=_0x169357['id'];if(_0xc96132[_0x66f4('0x41')]['filter']){_0x59f75['where']=_[_0x66f4('0x50')](_0x59f75['where'],{'$or':_[_0x66f4('0x4c')](_0x59f75[_0x66f4('0x45')],function(_0x3fd2bb){var _0x54d90a={};_0x54d90a[_0x3fd2bb]={'$like':'%'+_0xc96132[_0x66f4('0x41')]['filter']+'%'};return _0x54d90a;})});}_0x59f75=_[_0x66f4('0x50')]({},_0x59f75,_0xc96132[_0x66f4('0x51')]);return db[_0x66f4('0x68')][_0x66f4('0x30')]({'where':_0x59f75[_0x66f4('0x4b')]})['then'](function(_0x1e81e3){_0x55d3f3[_0x66f4('0x30')]=_0x1e81e3;if(_0xc96132[_0x66f4('0x41')]['includeAll']){_0x59f75[_0x66f4('0x52')]=[{'all':!![]}];}return db[_0x66f4('0x68')][_0x66f4('0x69')](_0x59f75);})[_0x66f4('0x36')](function(_0xeb1d40){_0x55d3f3[_0x66f4('0x53')]=_0xeb1d40;return _0x55d3f3;});}})[_0x66f4('0x36')](respondWithFilteredResult(_0xee6f6e,_0x59f75))['catch'](handleError(_0xee6f6e,null));};exports[_0x66f4('0x6a')]=function(_0x1ac2a0,_0x5c785a,_0x187df4){return db['OpenchannelAccount']['find']({'where':{'id':_0x1ac2a0['params']['id']}})[_0x66f4('0x36')](handleEntityNotFound(_0x5c785a,null))[_0x66f4('0x36')](function(_0x13dc8d){if(_0x13dc8d){return _0x13dc8d[_0x66f4('0x6a')](_0x1ac2a0['query'][_0x66f4('0x6b')]);}})['then'](respondWithStatusCode(_0x5c785a,null))[_0x66f4('0x29')](handleError(_0x5c785a,null));};exports[_0x66f4('0x6c')]=function(_0x1e76e2,_0x42e133,_0x249734){if(_0x1e76e2[_0x66f4('0x5a')]['id']){delete _0x1e76e2[_0x66f4('0x5a')]['id'];}return db[_0x66f4('0x3d')][_0x66f4('0x58')]({'where':{'id':_0x1e76e2['params']['id']}})[_0x66f4('0x36')](handleEntityNotFound(_0x42e133,null))['then'](function(_0x1695a3){if(_0x1695a3){_0x1e76e2['body'][_0x66f4('0x64')]=_0x1695a3['id'];return db['CannedAnswer'][_0x66f4('0x59')](_0x1e76e2['body']);}})[_0x66f4('0x36')](respondWithResult(_0x42e133,null))[_0x66f4('0x29')](handleError(_0x42e133,null));};exports[_0x66f4('0x6d')]=function(_0x3c8048,_0x40294c,_0xda9d6c){var _0x4c94e2={'raw':![],'where':{}};var _0x1eca0b={};var _0x40d0fb={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x66f4('0x66')]({'where':{'id':_0x3c8048[_0x66f4('0x54')]['id']}})[_0x66f4('0x36')](handleEntityNotFound(_0x40294c,null))[_0x66f4('0x36')](function(_0x95976e){if(_0x95976e){_0x1eca0b[_0x66f4('0x40')]=_[_0x66f4('0x42')](db[_0x66f4('0x6e')][_0x66f4('0x55')]);_0x1eca0b[_0x66f4('0x41')]=_[_0x66f4('0x42')](_0x3c8048[_0x66f4('0x41')]);_0x1eca0b[_0x66f4('0x43')]=_[_0x66f4('0x44')](_0x1eca0b[_0x66f4('0x40')],_0x1eca0b['query']);_0x4c94e2[_0x66f4('0x45')]=_[_0x66f4('0x44')](_0x1eca0b[_0x66f4('0x40')],qs[_0x66f4('0x46')](_0x3c8048['query'][_0x66f4('0x46')]));_0x4c94e2['attributes']=_0x4c94e2[_0x66f4('0x45')][_0x66f4('0x56')]?_0x4c94e2[_0x66f4('0x45')]:_0x1eca0b[_0x66f4('0x40')];if(!_0x3c8048[_0x66f4('0x41')][_0x66f4('0x47')](_0x66f4('0x48'))){_0x4c94e2[_0x66f4('0x2f')]=qs[_0x66f4('0x2f')](_0x3c8048[_0x66f4('0x41')][_0x66f4('0x2f')]);_0x4c94e2[_0x66f4('0x2d')]=qs[_0x66f4('0x2d')](_0x3c8048['query'][_0x66f4('0x2d')]);}_0x4c94e2[_0x66f4('0x49')]=qs['sort'](_0x3c8048['query'][_0x66f4('0x4a')]);_0x4c94e2[_0x66f4('0x4b')]=qs[_0x66f4('0x43')](_[_0x66f4('0x67')](_0x3c8048[_0x66f4('0x41')],_0x1eca0b[_0x66f4('0x43')]));_0x4c94e2[_0x66f4('0x4b')][_0x66f4('0x64')]=_0x95976e['id'];if(_0x3c8048[_0x66f4('0x41')][_0x66f4('0x4f')]){_0x4c94e2[_0x66f4('0x4b')]=_[_0x66f4('0x50')](_0x4c94e2[_0x66f4('0x4b')],{'$or':_[_0x66f4('0x4c')](_0x4c94e2[_0x66f4('0x45')],function(_0x18d2a4){var _0x17356a={};_0x17356a[_0x18d2a4]={'$like':'%'+_0x3c8048['query'][_0x66f4('0x4f')]+'%'};return _0x17356a;})});}_0x4c94e2=_[_0x66f4('0x50')]({},_0x4c94e2,_0x3c8048[_0x66f4('0x51')]);return db['CannedAnswer'][_0x66f4('0x30')]({'where':_0x4c94e2['where']})[_0x66f4('0x36')](function(_0x28d411){_0x40d0fb[_0x66f4('0x30')]=_0x28d411;if(_0x3c8048['query'][_0x66f4('0x57')]){_0x4c94e2[_0x66f4('0x52')]=[{'all':!![]}];}return db[_0x66f4('0x6e')]['findAll'](_0x4c94e2);})[_0x66f4('0x36')](function(_0x16adba){_0x40d0fb[_0x66f4('0x53')]=_0x16adba;return _0x40d0fb;});}})[_0x66f4('0x36')](respondWithFilteredResult(_0x40294c,_0x4c94e2))[_0x66f4('0x29')](handleError(_0x40294c,null));};exports[_0x66f4('0x6f')]=function(_0x21222a,_0x53903a,_0x4a3f21){return db['OpenchannelAccount'][_0x66f4('0x58')]({'where':{'id':_0x21222a[_0x66f4('0x54')]['id']}})['then'](handleEntityNotFound(_0x53903a,null))[_0x66f4('0x36')](function(_0x4b1338){if(_0x4b1338){return _0x4b1338['removeAnswers'](_0x21222a[_0x66f4('0x41')]['ids']);}})[_0x66f4('0x36')](respondWithStatusCode(_0x53903a,null))[_0x66f4('0x29')](handleError(_0x53903a,null));};exports['notify']=function(_0xf6ea2b,_0x3052ba,_0x460950){var _0x5dce0b={'body':_0xf6ea2b[_0x66f4('0x5a')],'channel':_0x66f4('0x70')};var _0xdadbc8=[];var _0x482aa4=[];var _0x507f9b={};var _0x1174d4=![];return db[_0x66f4('0x71')][_0x66f4('0x62')]()[_0x66f4('0x36')](function(_0x43eb77){if(!_0x43eb77){throw new db[(_0x66f4('0x72'))][(_0x66f4('0x73'))](_0x66f4('0x74'));}_0xdadbc8=_['difference'](_['keys'](_0x43eb77),[_0x66f4('0x75'),'updatedAt']);_0x482aa4=_[_0x66f4('0x76')](_[_0x66f4('0x42')](_0x43eb77),['createdAt','updatedAt',_0x66f4('0x77'),'ListId']);if(_0xf6ea2b[_0x66f4('0x5a')]['id']){delete _0xf6ea2b[_0x66f4('0x5a')]['id'];}if(_[_0x66f4('0x78')](_0xf6ea2b[_0x66f4('0x5a')]['from'])){throw new db[(_0x66f4('0x72'))][(_0x66f4('0x73'))](_0x66f4('0x79'));}if(_['isNil'](_0xf6ea2b['body'][_0x66f4('0x5a')])||_0xf6ea2b[_0x66f4('0x5a')]['body']===''){throw new db[(_0x66f4('0x72'))][(_0x66f4('0x73'))](_0x66f4('0x7a'));}if(_[_0x66f4('0x78')](_0xf6ea2b[_0x66f4('0x5a')][_0x66f4('0x7b')])){throw new db['Sequelize'][(_0x66f4('0x73'))](_0x66f4('0x7c')+_0x482aa4);}if(!_[_0x66f4('0x7d')](_0x482aa4,_0xf6ea2b[_0x66f4('0x5a')][_0x66f4('0x7b')])){throw new db[(_0x66f4('0x72'))][(_0x66f4('0x73'))](_0x66f4('0x7e')+_0x482aa4);}_0x507f9b[_0xf6ea2b['body'][_0x66f4('0x7b')]]=_0xf6ea2b[_0x66f4('0x5a')][_0x66f4('0x7f')];})[_0x66f4('0x36')](function(){return db[_0x66f4('0x3d')]['find']({'where':{'id':_0xf6ea2b[_0x66f4('0x54')]['id']},'include':[{'model':db[_0x66f4('0x80')],'as':'List','include':[{'model':db['CmContact'],'as':_0x66f4('0x81'),'where':_0x507f9b,'limit':0x1,'order':[[_0x66f4('0x82'),_0x66f4('0x83')]]}]},{'model':db['OpenchannelApplication'],'as':_0x66f4('0x84')}]});})[_0x66f4('0x36')](handleEntityNotFound(_0x3052ba,null))['then'](function(_0x4337c7){if(_0x4337c7&&_0x4337c7['List']){_0x5dce0b[_0x66f4('0x85')]=_0x4337c7;_0x5dce0b['applications']=_0x4337c7[_0x66f4('0x84')];_0x5dce0b[_0x66f4('0x86')]=_0x4337c7[_0x66f4('0x87')];_0x5dce0b[_0x66f4('0x88')]=_[_0x66f4('0x89')](_0x5dce0b['applications'],[_0x66f4('0x8a')],['asc']);if(_0x5dce0b[_0x66f4('0x85')]['Applications']){delete _0x5dce0b[_0x66f4('0x85')]['Applications'];}if(_0x5dce0b[_0x66f4('0x85')]['List']&&_0x5dce0b[_0x66f4('0x85')]['List'][_0x66f4('0x81')][_0x66f4('0x56')]){return _0x5dce0b[_0x66f4('0x85')][_0x66f4('0x87')][_0x66f4('0x81')][0x0];}var _0x23ffd5=_[_0x66f4('0x8b')](_0xf6ea2b[_0x66f4('0x5a')],{'firstName':_0xf6ea2b[_0x66f4('0x5a')]['from'],'ListId':_0x4337c7['ListId']});_0x23ffd5[_0xf6ea2b['body']['mapKey']]=_0xf6ea2b['body'][_0x66f4('0x7f')];return db['CmContact'][_0x66f4('0x59')](_0x23ffd5,{'fields':_0xdadbc8,'raw':!![]});}})[_0x66f4('0x36')](handleEntityNotFound(_0x3052ba,null))[_0x66f4('0x36')](function(_0x4d0ccf){_0x5dce0b[_0x66f4('0x8c')]=_0x4d0ccf;if(_0x4d0ccf){var _0x1c60d5={'ContactId':_0x4d0ccf['id'],'OpenchannelAccountId':_0xf6ea2b[_0x66f4('0x54')]['id'],'from':(_0x4d0ccf[_0x66f4('0x8d')]||'')+'\x20'+(_0x4d0ccf[_0x66f4('0x8e')]||'')};var _0x2bb509={'OpenchannelAccountId':_0xf6ea2b[_0x66f4('0x54')]['id'],'closed':![]};if(_0xf6ea2b[_0x66f4('0x5a')][_0x66f4('0x8f')]){_0x2bb509[_0x66f4('0x8f')]=_0xf6ea2b[_0x66f4('0x5a')]['threadId'];return db[_0x66f4('0x90')][_0x66f4('0x58')]({'where':_0x2bb509})[_0x66f4('0x36')](function(_0x5e9b35){if(_0x5e9b35){return[_0x5e9b35,![]];}_0x1c60d5[_0x66f4('0x8f')]=_0xf6ea2b[_0x66f4('0x5a')][_0x66f4('0x8f')];_0x1c60d5['externalUrl']=_0xf6ea2b['body'][_0x66f4('0x91')];return db[_0x66f4('0x90')][_0x66f4('0x59')](_0x1c60d5)[_0x66f4('0x36')](function(_0x26de43){return[_0x26de43,!![]];});});}else{_0x2bb509['threadId']=null;}_0x2bb509[_0x66f4('0x92')]=_0x4d0ccf['id'];return db[_0x66f4('0x90')][_0x66f4('0x58')]({'where':_0x2bb509})['then'](function(_0x22086d){if(_0x22086d){return[_0x22086d,![]];}return db['OpenchannelInteraction'][_0x66f4('0x59')](_0x1c60d5)[_0x66f4('0x36')](function(_0x87a54e){return[_0x87a54e,!![]];});});}})[_0x66f4('0x93')](function(_0x20a3af,_0x3e4924){if(_0x20a3af){_0x1174d4=_0x3e4924;if(!_0x3e4924){var _0x2d796a={'from':(_0x5dce0b[_0x66f4('0x8c')]['firstName']||'')+'\x20'+(_0x5dce0b[_0x66f4('0x8c')]['lastName']||'')};if(_0xf6ea2b['body']['threadId']&&_0xf6ea2b[_0x66f4('0x5a')][_0x66f4('0x94')]&&_0xf6ea2b['body'][_0x66f4('0x8f')]!=_0xf6ea2b['body'][_0x66f4('0x94')]){_0x2d796a[_0x66f4('0x8f')]=_0xf6ea2b[_0x66f4('0x5a')]['messageId'];}return _0x20a3af['update'](_0x2d796a);}else{return _0x20a3af;}}})[_0x66f4('0x36')](function(_0x2cb445){_0x5dce0b[_0x66f4('0x95')]=_0x2cb445['get']({'plain':!![]});_0x5dce0b[_0x66f4('0x95')]['created']=_0x1174d4;if(_0x5dce0b[_0x66f4('0x95')][_0x66f4('0x96')]){if(_0x5dce0b['account'][_0x66f4('0x97')]){_0x5dce0b[_0x66f4('0x88')][_0x66f4('0x98')]({'id':0x0,'priority':_0x5dce0b['applications']['length']+0x1,'app':_0x66f4('0x99'),'appdata':'unmanaged','interval':_0x66f4('0x9a')});}}return db[_0x66f4('0x9b')][_0x66f4('0x59')]({'body':_0xf6ea2b[_0x66f4('0x5a')][_0x66f4('0x5a')],'OpenchannelAccountId':_0xf6ea2b[_0x66f4('0x54')]['id'],'OpenchannelInteractionId':_0x2cb445['id'],'direction':'in','ContactId':_0x5dce0b[_0x66f4('0x8c')]['id'],'AttachmentId':_0xf6ea2b[_0x66f4('0x5a')][_0x66f4('0x9c')]});})[_0x66f4('0x36')](function(_0x2d4471){_0x5dce0b['message']=_0x2d4471;if(!_0x5dce0b['interaction']['UserId'])return;return db[_0x66f4('0x9d')][_0x66f4('0x58')]({'attributes':['id','name'],'where':{'id':_0x5dce0b[_0x66f4('0x95')]['UserId']}});})[_0x66f4('0x36')](function(_0x4254e5){if(_0x4254e5){_0x5dce0b[_0x66f4('0x88')][_0x66f4('0x9e')]({'id':0x0,'priority':0x0,'app':_0x66f4('0x9f'),'appdata':_0x4254e5[_0x66f4('0x3a')]+','+(_0x5dce0b[_0x66f4('0x85')][_0x66f4('0xa0')]||0xa),'interval':_0x66f4('0x9a')});}if(!_0x5dce0b['interaction'][_0x66f4('0xa1')])return;return db[_0x66f4('0xa2')][_0x66f4('0x58')]({'attributes':['id',_0x66f4('0x3a')],'where':{'id':_0x5dce0b['interaction'][_0x66f4('0xa1')]}});})[_0x66f4('0x36')](function(_0xd29272){if(_0xd29272){_0x5dce0b[_0x66f4('0x88')][_0x66f4('0x9e')]({'id':0x0,'priority':0x1,'app':_0x66f4('0xa3'),'appdata':_0xd29272[_0x66f4('0x3a')]+','+(_0x5dce0b['account']['waitForTheAssignedQueue']||0x12c),'interval':_0x66f4('0x9a')});}return respondWithRpcPromise('Start',_0x66f4('0xa4'),_0x5dce0b);})[_0x66f4('0x36')](function(_0x5ebcb2){respondWithRpcPromise(_0x66f4('0xa5'),_0x66f4('0xa5'),{'event':_0x66f4('0xa6'),'message':_0x5ebcb2},client9002);return _0x5ebcb2;})['then'](respondWithResult(_0x3052ba,null))[_0x66f4('0x29')](handleError(_0x3052ba,null));};exports[_0x66f4('0xa7')]=function(_0x1578e2,_0x263216){var _0x2f2088=_0x1578e2[_0x66f4('0x54')]['id'];var _0x5497b7=_0x1578e2[_0x66f4('0x5a')];var _0x5eff23=0xc8;var _0x2520af=null;return db['sequelize']['transaction']({'isolationLevel':db[_0x66f4('0xa8')][_0x66f4('0xa9')][_0x66f4('0xaa')][_0x66f4('0xab')]},function(_0x542763){return db['OpenchannelAccount'][_0x66f4('0x66')]({'where':{'id':_0x2f2088},'transaction':_0x542763})[_0x66f4('0x36')](function(_0x37d82d){if(_0x37d82d){return db['OpenchannelApplication']['destroy']({'where':{'OpenchannelAccountId':_0x2f2088},'transaction':_0x542763})['then'](function(){var _0x3b338f=_[_0x66f4('0x4c')](_0x5497b7,function(_0x3ae36c){_0x3ae36c[_0x66f4('0x64')]=_0x2f2088;return _0x3ae36c;});return db[_0x66f4('0xac')][_0x66f4('0xad')](_0x3b338f,{'transaction':_0x542763});});}else{_0x5eff23=0x194;_0x2520af=[];}});})[_0x66f4('0x36')](function(){if(_0x5eff23!==0x194){return db[_0x66f4('0xac')][_0x66f4('0xae')]({'where':{'OpenchannelAccountId':_0x2f2088},'order':_0x66f4('0x8a')})[_0x66f4('0x36')](function(_0x154235){_0x2520af=_0x154235;});}})[_0x66f4('0x29')](function(_0x257906){_0x5eff23=0x1f4;logger[_0x66f4('0x23')](_0x257906[_0x66f4('0x39')]);if(_0x257906[_0x66f4('0x3a')]){delete _0x257906[_0x66f4('0x3a')];}_0x2520af=_0x257906;})[_0x66f4('0xaf')](function(){if(_0x2520af===null){_0x263216[_0x66f4('0xb0')](_0x5eff23);}else{if(_0x5eff23===0x1f4){_0x263216[_0x66f4('0x2a')](_0x5eff23)[_0x66f4('0xb1')](_0x2520af);}else{_0x263216[_0x66f4('0x2a')](_0x5eff23)[_0x66f4('0x2c')](_0x2520af);}}});};exports[_0x66f4('0xb2')]=function(_0x4fb1fc,_0x3e83ad,_0x5bf2ba){var _0x200f45={};var _0x4210e8={};var _0x49de7f;var _0x54e9c8;return db[_0x66f4('0x3d')][_0x66f4('0x66')]({'where':{'id':_0x4fb1fc[_0x66f4('0x54')]['id']}})[_0x66f4('0x36')](handleEntityNotFound(_0x3e83ad,null))[_0x66f4('0x36')](function(_0x3a4860){if(_0x3a4860){_0x49de7f=_0x3a4860;_0x4210e8[_0x66f4('0x40')]=_['keys'](db[_0x66f4('0xac')][_0x66f4('0x55')]);_0x4210e8['query']=_['keys'](_0x4fb1fc[_0x66f4('0x41')]);_0x4210e8[_0x66f4('0x43')]=_[_0x66f4('0x44')](_0x4210e8['model'],_0x4210e8[_0x66f4('0x41')]);_0x200f45[_0x66f4('0x45')]=_[_0x66f4('0x44')](_0x4210e8[_0x66f4('0x40')],qs[_0x66f4('0x46')](_0x4fb1fc[_0x66f4('0x41')]['fields']));_0x200f45[_0x66f4('0x45')]=_0x200f45['attributes'][_0x66f4('0x56')]?_0x200f45[_0x66f4('0x45')]:_0x4210e8['model'];_0x200f45[_0x66f4('0x49')]=qs[_0x66f4('0x4a')](_0x4fb1fc[_0x66f4('0x41')][_0x66f4('0x4a')]);_0x200f45['where']=qs[_0x66f4('0x43')](_[_0x66f4('0x67')](_0x4fb1fc[_0x66f4('0x41')],_0x4210e8[_0x66f4('0x43')]));if(_0x4fb1fc[_0x66f4('0x41')]['filter']){_0x200f45[_0x66f4('0x4b')]=_[_0x66f4('0x50')](_0x200f45[_0x66f4('0x4b')],{'$or':_[_0x66f4('0x4c')](_0x200f45[_0x66f4('0x45')],function(_0x27da25){var _0x4b229b={};_0x4b229b[_0x27da25]={'$like':'%'+_0x4fb1fc[_0x66f4('0x41')][_0x66f4('0x4f')]+'%'};return _0x4b229b;})});}_0x200f45=_['merge']({},_0x200f45,_0x4fb1fc[_0x66f4('0x51')]);return _0x49de7f[_0x66f4('0xb2')](_0x200f45);}})[_0x66f4('0x36')](function(_0x2239f0){if(_0x2239f0){_0x54e9c8=_0x2239f0[_0x66f4('0x56')];if(!_0x4fb1fc['query'][_0x66f4('0x47')](_0x66f4('0x48'))){_0x200f45[_0x66f4('0x2f')]=qs[_0x66f4('0x2f')](_0x4fb1fc[_0x66f4('0x41')][_0x66f4('0x2f')]);_0x200f45[_0x66f4('0x2d')]=qs['offset'](_0x4fb1fc['query'][_0x66f4('0x2d')]);}return _0x49de7f[_0x66f4('0xb2')](_0x200f45);}})['then'](function(_0x13be28){if(_0x13be28){return _0x13be28?{'count':_0x54e9c8,'rows':_0x13be28}:null;}})[_0x66f4('0x36')](respondWithResult(_0x3e83ad,null))[_0x66f4('0x29')](handleError(_0x3e83ad,null));};exports[_0x66f4('0xb3')]=function(_0x100b78,_0x331fb3,_0xeba647){var _0x47ca7f={'raw':![],'where':{}};var _0x5a61c6={};var _0x57b590={'count':0x0,'rows':[]};return db[_0x66f4('0x3d')]['findOne']({'where':{'id':_0x100b78[_0x66f4('0x54')]['id']}})[_0x66f4('0x36')](handleEntityNotFound(_0x331fb3,null))[_0x66f4('0x36')](function(_0x2b2f2b){if(_0x2b2f2b){_0x5a61c6['model']=_[_0x66f4('0x42')](db[_0x66f4('0x90')][_0x66f4('0x55')]);_0x5a61c6['query']=_[_0x66f4('0x42')](_0x100b78[_0x66f4('0x41')]);_0x5a61c6['filters']=_['intersection'](_0x5a61c6['model'],_0x5a61c6[_0x66f4('0x41')]);_0x47ca7f[_0x66f4('0x45')]=_[_0x66f4('0x44')](_0x5a61c6[_0x66f4('0x40')],qs['fields'](_0x100b78[_0x66f4('0x41')][_0x66f4('0x46')]));_0x47ca7f[_0x66f4('0x45')]=_0x47ca7f[_0x66f4('0x45')][_0x66f4('0x56')]?_0x47ca7f[_0x66f4('0x45')]:_0x5a61c6[_0x66f4('0x40')];if(!_0x100b78['query']['hasOwnProperty']('nolimit')){_0x47ca7f[_0x66f4('0x2f')]=qs[_0x66f4('0x2f')](_0x100b78[_0x66f4('0x41')][_0x66f4('0x2f')]);_0x47ca7f['offset']=qs[_0x66f4('0x2d')](_0x100b78[_0x66f4('0x41')][_0x66f4('0x2d')]);}_0x47ca7f[_0x66f4('0x49')]=qs[_0x66f4('0x4a')](_0x100b78[_0x66f4('0x41')][_0x66f4('0x4a')]);_0x47ca7f[_0x66f4('0x4b')]=qs[_0x66f4('0x43')](_[_0x66f4('0x67')](_0x100b78[_0x66f4('0x41')],_0x5a61c6[_0x66f4('0x43')]));_0x47ca7f[_0x66f4('0x4b')]['OpenchannelAccountId']=_0x2b2f2b['id'];if(_0x100b78[_0x66f4('0x41')]['filter']){_0x47ca7f[_0x66f4('0x4b')]=_[_0x66f4('0x50')](_0x47ca7f[_0x66f4('0x4b')],{'$or':_[_0x66f4('0x4c')](_0x47ca7f[_0x66f4('0x45')],function(_0x187215){var _0x493ba6={};_0x493ba6[_0x187215]={'$like':'%'+_0x100b78[_0x66f4('0x41')][_0x66f4('0x4f')]+'%'};return _0x493ba6;})});}_0x47ca7f=_[_0x66f4('0x50')]({},_0x47ca7f,_0x100b78[_0x66f4('0x51')]);return db['OpenchannelInteraction'][_0x66f4('0x30')]({'where':_0x47ca7f[_0x66f4('0x4b')]})[_0x66f4('0x36')](function(_0x31599a){_0x57b590[_0x66f4('0x30')]=_0x31599a;if(_0x100b78[_0x66f4('0x41')][_0x66f4('0x57')]){_0x47ca7f['include']=[{'model':db[_0x66f4('0x71')],'as':'Contact','required':![]},{'model':db[_0x66f4('0x9d')],'as':'Owner','attributes':[_0x66f4('0x3a'),_0x66f4('0xb4'),_0x66f4('0xb5')],'required':![]},{'model':db[_0x66f4('0xb6')],'as':_0x66f4('0xb7'),'attributes':['id',_0x66f4('0x3a'),_0x66f4('0xb8')],'where':_0x100b78[_0x66f4('0x41')][_0x66f4('0xb9')]?{'id':_0x100b78[_0x66f4('0x41')][_0x66f4('0xb9')]}:undefined,'required':_0x100b78[_0x66f4('0x41')][_0x66f4('0xb9')]?!![]:![]}];}return db[_0x66f4('0x90')]['findAll'](_0x47ca7f);})[_0x66f4('0x36')](function(_0x49feff){_0x57b590[_0x66f4('0x53')]=_0x49feff;return _0x57b590;});}})[_0x66f4('0x36')](respondWithFilteredResult(_0x331fb3,_0x47ca7f))['catch'](handleError(_0x331fb3,null));};exports[_0x66f4('0xba')]=function(_0xda13db,_0x5135a1,_0x111e98){return db['OpenchannelAccount'][_0x66f4('0x58')]({'where':{'id':_0xda13db[_0x66f4('0x54')]['id']}})['then'](handleEntityNotFound(_0x5135a1,null))[_0x66f4('0x36')](function(_0x4c0653){if(_0x4c0653){return _0x4c0653['addAgents'](_0xda13db['body']['ids'],_[_0x66f4('0xbb')](_0xda13db['body'],[_0x66f4('0x6b'),'id'])||{})[_0x66f4('0x93')](function(_0x777b95){for(var _0x397056=0x0;_0x397056<_0xda13db['body'][_0x66f4('0x6b')]['length'];_0x397056+=0x1){socket[_0x66f4('0xbc')]('userOpenchannelAccount:save',{'UserId':Number(_0xda13db[_0x66f4('0x5a')][_0x66f4('0x6b')][_0x397056]),'OpenchannelAccountId':Number(_0xda13db[_0x66f4('0x54')]['id'])});}return _0x777b95;});}})[_0x66f4('0x36')](respondWithResult(_0x5135a1,null))[_0x66f4('0x29')](handleError(_0x5135a1,null));};exports[_0x66f4('0xbd')]=function(_0x7c63a3,_0x3a47d0,_0x1bf9a7){return db[_0x66f4('0x3d')][_0x66f4('0x58')]({'where':{'id':_0x7c63a3['params']['id']}})[_0x66f4('0x36')](handleEntityNotFound(_0x3a47d0,null))[_0x66f4('0x36')](function(_0x7005c){if(_0x7005c){return _0x7005c[_0x66f4('0xbd')](_0x7c63a3[_0x66f4('0x41')][_0x66f4('0x6b')])[_0x66f4('0x36')](function(){if(_[_0x66f4('0xbe')](_0x7c63a3[_0x66f4('0x41')]['ids'])){for(var _0x4c7ad4=0x0;_0x4c7ad4<_0x7c63a3[_0x66f4('0x41')][_0x66f4('0x6b')]['length'];_0x4c7ad4+=0x1){socket[_0x66f4('0xbc')]('userOpenchannelAccount:remove',{'UserId':Number(_0x7c63a3[_0x66f4('0x41')][_0x66f4('0x6b')][_0x4c7ad4]),'OpenchannelAccountId':Number(_0x7c63a3[_0x66f4('0x54')]['id'])});}}else{socket[_0x66f4('0xbc')](_0x66f4('0xbf'),{'UserId':Number(_0x7c63a3[_0x66f4('0x41')]['ids']),'OpenchannelAccountId':Number(_0x7c63a3[_0x66f4('0x54')]['id'])});}});}})[_0x66f4('0x36')](respondWithStatusCode(_0x3a47d0,null))[_0x66f4('0x29')](handleError(_0x3a47d0,null));};exports[_0x66f4('0xc0')]=function(_0x3d025d,_0x84e0e6,_0x496cce){var _0xa4094e={};var _0x18140b={};var _0xc6e972;var _0x553ffd;return db[_0x66f4('0x3d')][_0x66f4('0x66')]({'where':{'id':_0x3d025d[_0x66f4('0x54')]['id']}})[_0x66f4('0x36')](handleEntityNotFound(_0x84e0e6,null))[_0x66f4('0x36')](function(_0x18e3ac){if(_0x18e3ac){_0xc6e972=_0x18e3ac;_0x18140b[_0x66f4('0x40')]=_[_0x66f4('0x42')](db[_0x66f4('0x9d')][_0x66f4('0x55')]);_0x18140b['query']=_[_0x66f4('0x42')](_0x3d025d[_0x66f4('0x41')]);_0x18140b[_0x66f4('0x43')]=_['intersection'](_0x18140b['model'],_0x18140b[_0x66f4('0x41')]);_0xa4094e[_0x66f4('0x45')]=_[_0x66f4('0x44')](_0x18140b[_0x66f4('0x40')],qs['fields'](_0x3d025d[_0x66f4('0x41')][_0x66f4('0x46')]));_0xa4094e[_0x66f4('0x45')]=_0xa4094e[_0x66f4('0x45')]['length']?_0xa4094e['attributes']:_0x18140b[_0x66f4('0x40')];_0xa4094e[_0x66f4('0x49')]=qs[_0x66f4('0x4a')](_0x3d025d[_0x66f4('0x41')]['sort']);_0xa4094e[_0x66f4('0x4b')]=qs['filters'](_['pick'](_0x3d025d[_0x66f4('0x41')],_0x18140b[_0x66f4('0x43')]));if(_0x3d025d[_0x66f4('0x41')][_0x66f4('0x4f')]){_0xa4094e['where']=_[_0x66f4('0x50')](_0xa4094e[_0x66f4('0x4b')],{'$or':_[_0x66f4('0x4c')](_0xa4094e[_0x66f4('0x45')],function(_0x35ed39){var _0x5cac9d={};_0x5cac9d[_0x35ed39]={'$like':'%'+_0x3d025d['query'][_0x66f4('0x4f')]+'%'};return _0x5cac9d;})});}_0xa4094e=_[_0x66f4('0x50')]({},_0xa4094e,_0x3d025d[_0x66f4('0x51')]);return _0xc6e972[_0x66f4('0xc0')](_0xa4094e);}})[_0x66f4('0x36')](function(_0x5af59b){if(_0x5af59b){_0x553ffd=_0x5af59b[_0x66f4('0x56')];if(!_0x3d025d[_0x66f4('0x41')]['hasOwnProperty']('nolimit')){_0xa4094e[_0x66f4('0x2f')]=qs[_0x66f4('0x2f')](_0x3d025d[_0x66f4('0x41')][_0x66f4('0x2f')]);_0xa4094e['offset']=qs['offset'](_0x3d025d[_0x66f4('0x41')]['offset']);}return _0xc6e972['getAgents'](_0xa4094e);}})[_0x66f4('0x36')](function(_0xed8867){if(_0xed8867){return _0xed8867?{'count':_0x553ffd,'rows':_0xed8867}:null;}})[_0x66f4('0x36')](respondWithResult(_0x84e0e6,null))['catch'](handleError(_0x84e0e6,null));};exports[_0x66f4('0xb1')]=function(_0x2c9ac6,_0x567120,_0x4519b4){var _0xfa5239,_0x1bb2b6,_0x3b8f52;if(_['isNil'](_0x2c9ac6[_0x66f4('0x5a')]['body'])||_0x2c9ac6[_0x66f4('0x5a')]['body']===''){throw new db[(_0x66f4('0x72'))][(_0x66f4('0x73'))](_0x66f4('0x7a'));}if(_[_0x66f4('0x78')](_0x2c9ac6[_0x66f4('0x5a')]['to'])){}_0xfa5239=_0x2c9ac6[_0x66f4('0x5a')]['to'];return db['OpenchannelAccount'][_0x66f4('0x66')]({'where':{'id':_0x2c9ac6['params']['id']}})['then'](handleEntityNotFound(_0x567120,null))[_0x66f4('0x36')](function(_0x234cb3){if(_0x234cb3){return db[_0x66f4('0x3d')][_0x66f4('0x58')]({'where':{'id':_0x234cb3['id']},'include':[{'model':db[_0x66f4('0x80')],'as':_0x66f4('0x87'),'include':[{'model':db[_0x66f4('0x71')],'as':_0x66f4('0x81'),'where':{[_0x234cb3[_0x66f4('0x7b')]]:_0xfa5239},'limit':0x1,'order':[[_0x66f4('0x82'),_0x66f4('0x83')]]}]}]})[_0x66f4('0x36')](handleEntityNotFound(_0x567120,null))[_0x66f4('0x36')](function(_0x5077ff){if(_0x5077ff&&_0x5077ff[_0x66f4('0x87')]){_0x1bb2b6=_0x5077ff[_0x66f4('0x37')]({'plain':!![]});if(_0x1bb2b6[_0x66f4('0x87')]&&_0x1bb2b6[_0x66f4('0x87')][_0x66f4('0x81')][_0x66f4('0x56')]){return _0x1bb2b6[_0x66f4('0x87')]['Contacts'][0x0];}return db['CmContact'][_0x66f4('0x59')](_['defaults'](_0x2c9ac6[_0x66f4('0x5a')],{'firstName':_0xfa5239,[_0x5077ff['mapKey']]:_0xfa5239,'phone':_0xfa5239,'ListId':_0x1bb2b6[_0x66f4('0xc1')]}));}})[_0x66f4('0x36')](handleEntityNotFound(_0x567120,null))['then'](function(_0x4a77fe){if(_0x4a77fe){_0x3b8f52=_0x4a77fe;return db[_0x66f4('0x90')]['find']({'where':{'ContactId':_0x3b8f52['id'],'closed':![],'OpenchannelAccountId':_0x1bb2b6['id']}})[_0x66f4('0x36')](function(_0x1661f4){if(_0x1661f4){return[_0x1661f4,![]];}return db[_0x66f4('0x90')]['create']({'UserId':_0x2c9ac6['user']['id'],'ContactId':_0x3b8f52['id'],'OpenchannelAccountId':_0x1bb2b6['id'],'lastMsgDirection':_0x66f4('0xc2'),'firstMsgDirection':_0x66f4('0xc2'),'Messages':[_[_0x66f4('0x50')](_0x2c9ac6['body'],{'read':![],'body':_0x2c9ac6[_0x66f4('0x5a')]['body'],'OpenchannelAccountId':_0x1bb2b6['id'],'UserId':_0x2c9ac6[_0x66f4('0x5b')]['id'],'ContactId':_0x3b8f52['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':'Messages'}]})[_0x66f4('0x36')](function(_0x3c5b14){return[_0x3c5b14,!![]];});});}})[_0x66f4('0x93')](function(_0x5743ee,_0x408ffe){if(_0x408ffe){return _0x5743ee;}return db[_0x66f4('0x9b')][_0x66f4('0x59')](_[_0x66f4('0x50')](_0x2c9ac6[_0x66f4('0x5a')],{'read':![],'body':_0x2c9ac6[_0x66f4('0x5a')][_0x66f4('0x5a')],'OpenchannelAccountId':_0x1bb2b6['id'],'OpenchannelInteractionId':_0x5743ee['id'],'UserId':_0x2c9ac6[_0x66f4('0x5b')]['id'],'ContactId':_0x3b8f52['id']}))['then'](function(_0x4cd340){_0x5743ee[_0x66f4('0xc3')]['Messages']=[];_0x5743ee[_0x66f4('0xc3')]['Messages']['push'](_0x4cd340['dataValues']);return _0x5743ee;});});}})[_0x66f4('0x36')](respondWithResult(_0x567120,null))[_0x66f4('0x29')](handleError(_0x567120,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index bacd336..af47d91 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 _0xec56=['emit','hasOwnProperty','hook','exports','events','setMaxListeners','save','update','remove'];(function(_0x5466e0,_0x586206){var _0xf32c89=function(_0x68e0e9){while(--_0x68e0e9){_0x5466e0['push'](_0x5466e0['shift']());}};_0xf32c89(++_0x586206);}(_0xec56,0x1bd));var _0x6ec5=function(_0x1402f9,_0x160244){_0x1402f9=_0x1402f9-0x0;var _0x18df93=_0xec56[_0x1402f9];return _0x18df93;};'use strict';var EventEmitter=require(_0x6ec5('0x0'));var OpenchannelAccount=require('../../mysqldb')['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x6ec5('0x1')](0x0);var events={'afterCreate':_0x6ec5('0x2'),'afterUpdate':_0x6ec5('0x3'),'afterDestroy':_0x6ec5('0x4')};function emitEvent(_0x43c2cd){return function(_0x399441,_0x469679,_0x173aeb){OpenchannelAccountEvents[_0x6ec5('0x5')](_0x43c2cd+':'+_0x399441['id'],_0x399441);OpenchannelAccountEvents[_0x6ec5('0x5')](_0x43c2cd,_0x399441);_0x173aeb(null);};}for(var e in events){if(events[_0x6ec5('0x6')](e)){var event=events[e];OpenchannelAccount[_0x6ec5('0x7')](e,emitEvent(event));}}module[_0x6ec5('0x8')]=OpenchannelAccountEvents; \ No newline at end of file +var _0x22fb=['hook','exports','OpenchannelAccount','save','update','remove','emit','hasOwnProperty'];(function(_0x93942f,_0xb48547){var _0x23fcd8=function(_0x4728be){while(--_0x4728be){_0x93942f['push'](_0x93942f['shift']());}};_0x23fcd8(++_0xb48547);}(_0x22fb,0x192));var _0xb22f=function(_0xe85ca6,_0x75aa69){_0xe85ca6=_0xe85ca6-0x0;var _0x1b1c10=_0x22fb[_0xe85ca6];return _0x1b1c10;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require('../../mysqldb')['db'][_0xb22f('0x0')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb22f('0x1'),'afterUpdate':_0xb22f('0x2'),'afterDestroy':_0xb22f('0x3')};function emitEvent(_0x10d2c4){return function(_0x201512,_0x50cdab,_0x44717d){OpenchannelAccountEvents[_0xb22f('0x4')](_0x10d2c4+':'+_0x201512['id'],_0x201512);OpenchannelAccountEvents[_0xb22f('0x4')](_0x10d2c4,_0x201512);_0x44717d(null);};}for(var e in events){if(events[_0xb22f('0x5')](e)){var event=events[e];OpenchannelAccount[_0xb22f('0x6')](e,emitEvent(event));}}module[_0xb22f('0x7')]=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index abd77a2..74a28b1 100644 --- a/server/api/openchannelAccount/openchannelAccount.model.js +++ b/server/api/openchannelAccount/openchannelAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../config/environment','./openchannelAccount.attributes','exports','define','OpenchannelAccount','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x245744,_0x348331){var _0x3ec367=function(_0x46881e){while(--_0x46881e){_0x245744['push'](_0x245744['shift']());}};_0x3ec367(++_0x348331);}(_0xa9e0,0x123));var _0x0a9e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa9e0[_0x29b609];return _0x54c952;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'openchannel_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['../../config/environment','./openchannelAccount.attributes','exports','define','OpenchannelAccount','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x325ef0,_0x2e70f7){var _0x46b472=function(_0x3f8bd1){while(--_0x3f8bd1){_0x325ef0['push'](_0x325ef0['shift']());}};_0x46b472(++_0x2e70f7);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xa9e0[_0xbe200f];return _0x192597;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'openchannel_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.rpc.js b/server/api/openchannelAccount/openchannelAccount.rpc.js index 2a72de4..62880d3 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 _0x750a=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','register','then','info','OpenchannelAccount,\x20%s,\x20%s','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x20fb17,_0xcf1d7c){var _0x3ebd5b=function(_0x43630d){while(--_0x43630d){_0x20fb17['push'](_0x20fb17['shift']());}};_0x3ebd5b(++_0xcf1d7c);}(_0x750a,0x140));var _0xa750=function(_0x1ad41a,_0x49e38e){_0x1ad41a=_0x1ad41a-0x0;var _0x45fc22=_0x750a[_0x1ad41a];return _0x45fc22;};'use strict';var _=require('lodash');var util=require(_0xa750('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa750('0x1'));var fs=require('fs');var Redis=require(_0xa750('0x2'));var db=require(_0xa750('0x3'))['db'];var utils=require(_0xa750('0x4'));var logger=require(_0xa750('0x5'))(_0xa750('0x6'));var config=require(_0xa750('0x7'));var jayson=require(_0xa750('0x8'));var client=jayson[_0xa750('0x9')][_0xa750('0xa')]({'port':0x232a});config[_0xa750('0xb')]=_[_0xa750('0xc')](config[_0xa750('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa750('0xb')]));require('./openchannelAccount.socket')[_0xa750('0xd')](socket);function respondWithRpcPromise(_0x1760f5,_0x51f594,_0x264284){return new BPromise(function(_0x2c2ea4,_0x5870f0){return client['request'](_0x1760f5,_0x264284)[_0xa750('0xe')](function(_0x4b19a1){logger[_0xa750('0xf')](_0xa750('0x10'),_0x51f594,'request\x20sent');logger[_0xa750('0x11')](_0xa750('0x12'),_0x51f594,_0xa750('0x13'),JSON['stringify'](_0x4b19a1));if(_0x4b19a1[_0xa750('0x14')]){if(_0x4b19a1[_0xa750('0x14')][_0xa750('0x15')]===0x1f4){logger[_0xa750('0x14')](_0xa750('0x10'),_0x51f594,_0x4b19a1[_0xa750('0x14')]['message']);return _0x5870f0(_0x4b19a1[_0xa750('0x14')][_0xa750('0x16')]);}logger[_0xa750('0x14')]('OpenchannelAccount,\x20%s,\x20%s',_0x51f594,_0x4b19a1[_0xa750('0x14')][_0xa750('0x16')]);return _0x2c2ea4(_0x4b19a1['error']['message']);}else{logger[_0xa750('0xf')]('OpenchannelAccount,\x20%s,\x20%s',_0x51f594,_0xa750('0x13'));_0x2c2ea4(_0x4b19a1[_0xa750('0x17')]['message']);}})[_0xa750('0x18')](function(_0x500a84){logger['error'](_0xa750('0x10'),_0x51f594,_0x500a84);_0x5870f0(_0x500a84);});});} \ No newline at end of file +var _0x84a0=['redis','defaults','socket.io-emitter','./openchannelAccount.socket','register','request','then','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelAccount,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','client','http'];(function(_0xddc012,_0x5cf07a){var _0x395581=function(_0x483e9d){while(--_0x483e9d){_0xddc012['push'](_0xddc012['shift']());}};_0x395581(++_0x5cf07a);}(_0x84a0,0x66));var _0x084a=function(_0x19aee6,_0xcb2918){_0x19aee6=_0x19aee6-0x0;var _0x511975=_0x84a0[_0x19aee6];return _0x511975;};'use strict';var _=require(_0x084a('0x0'));var util=require(_0x084a('0x1'));var moment=require(_0x084a('0x2'));var BPromise=require(_0x084a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x084a('0x4'));var db=require(_0x084a('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x084a('0x6'));var config=require(_0x084a('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x084a('0x8')][_0x084a('0x9')]({'port':0x232a});config[_0x084a('0xa')]=_[_0x084a('0xb')](config[_0x084a('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x084a('0xc'))(new Redis(config[_0x084a('0xa')]));require(_0x084a('0xd'))[_0x084a('0xe')](socket);function respondWithRpcPromise(_0x142127,_0x4c1e29,_0x4dd423){return new BPromise(function(_0x3d9dc6,_0x853df){return client[_0x084a('0xf')](_0x142127,_0x4dd423)[_0x084a('0x10')](function(_0x2d7c90){logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x4c1e29,_0x084a('0x11'));logger[_0x084a('0x12')](_0x084a('0x13'),_0x4c1e29,_0x084a('0x11'),JSON[_0x084a('0x14')](_0x2d7c90));if(_0x2d7c90[_0x084a('0x15')]){if(_0x2d7c90[_0x084a('0x15')][_0x084a('0x16')]===0x1f4){logger['error'](_0x084a('0x17'),_0x4c1e29,_0x2d7c90['error'][_0x084a('0x18')]);return _0x853df(_0x2d7c90[_0x084a('0x15')][_0x084a('0x18')]);}logger[_0x084a('0x15')](_0x084a('0x17'),_0x4c1e29,_0x2d7c90['error'][_0x084a('0x18')]);return _0x3d9dc6(_0x2d7c90['error'][_0x084a('0x18')]);}else{logger[_0x084a('0x19')]('OpenchannelAccount,\x20%s,\x20%s',_0x4c1e29,_0x084a('0x11'));_0x3d9dc6(_0x2d7c90[_0x084a('0x1a')][_0x084a('0x18')]);}})[_0x084a('0x1b')](function(_0x33d3a6){logger[_0x084a('0x15')](_0x084a('0x17'),_0x4c1e29,_0x33d3a6);_0x853df(_0x33d3a6);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 3102e19..850e607 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 _0x2356=['remove','openchannelAccount:','save'];(function(_0x59a80f,_0x522c24){var _0x30d64e=function(_0x3c530c){while(--_0x3c530c){_0x59a80f['push'](_0x59a80f['shift']());}};_0x30d64e(++_0x522c24);}(_0x2356,0x14f));var _0x6235=function(_0x4d0fa4,_0x4d649f){_0x4d0fa4=_0x4d0fa4-0x0;var _0x4ddcd6=_0x2356[_0x4d0fa4];return _0x4ddcd6;};'use strict';var OpenchannelAccountEvents=require('./openchannelAccount.events');var events=[_0x6235('0x0'),_0x6235('0x1'),'update'];function createListener(_0x49b0d5,_0x18ce63){return function(_0x32930d){_0x18ce63['emit'](_0x49b0d5,_0x32930d);};}function removeListener(_0x52e393,_0xa780c){return function(){OpenchannelAccountEvents['removeListener'](_0x52e393,_0xa780c);};}exports['register']=function(_0x390c55){for(var _0x17e08f=0x0,_0x3663e7=events['length'];_0x17e08f<_0x3663e7;_0x17e08f++){var _0x4c15c6=events[_0x17e08f];var _0x547159=createListener(_0x6235('0x2')+_0x4c15c6,_0x390c55);OpenchannelAccountEvents['on'](_0x4c15c6,_0x547159);}}; \ No newline at end of file +var _0x636f=['length','openchannelAccount:','remove','update','removeListener','register'];(function(_0x224012,_0x293e50){var _0x544142=function(_0x5f0835){while(--_0x5f0835){_0x224012['push'](_0x224012['shift']());}};_0x544142(++_0x293e50);}(_0x636f,0x188));var _0xf636=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x636f[_0x3bf83f];return _0x22c4a9;};'use strict';var OpenchannelAccountEvents=require('./openchannelAccount.events');var events=['save',_0xf636('0x0'),_0xf636('0x1')];function createListener(_0x17e637,_0x42cf1c){return function(_0x20d16a){_0x42cf1c['emit'](_0x17e637,_0x20d16a);};}function removeListener(_0x29ac70,_0x1479ae){return function(){OpenchannelAccountEvents[_0xf636('0x2')](_0x29ac70,_0x1479ae);};}exports[_0xf636('0x3')]=function(_0x39c5f1){for(var _0x526990=0x0,_0xdae985=events[_0xf636('0x4')];_0x526990<_0xdae985;_0x526990++){var _0x2da859=events[_0x526990];var _0x3f6dfb=createListener(_0xf636('0x5')+_0x2da859,_0x39c5f1);OpenchannelAccountEvents['on'](_0x2da859,_0x3f6dfb);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index abf3469..45ab023 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 _0x9edd=['path','connect-timeout','express','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','isAuthenticated','index','get','/:id','show','post','create','put','update','delete','destroy','exports','multer','util'];(function(_0x316c1c,_0x2ce61f){var _0x3a4497=function(_0x23bd04){while(--_0x23bd04){_0x316c1c['push'](_0x316c1c['shift']());}};_0x3a4497(++_0x2ce61f);}(_0x9edd,0xc6));var _0xd9ed=function(_0x17b072,_0x2f1031){_0x17b072=_0x17b072-0x0;var _0x285f24=_0x9edd[_0x17b072];return _0x285f24;};'use strict';var multer=require(_0xd9ed('0x0'));var util=require(_0xd9ed('0x1'));var path=require(_0xd9ed('0x2'));var timeout=require(_0xd9ed('0x3'));var express=require(_0xd9ed('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xd9ed('0x5'));var config=require(_0xd9ed('0x6'));var controller=require(_0xd9ed('0x7'));router['get']('/',auth[_0xd9ed('0x8')](),controller[_0xd9ed('0x9')]);router[_0xd9ed('0xa')](_0xd9ed('0xb'),auth[_0xd9ed('0x8')](),controller[_0xd9ed('0xc')]);router[_0xd9ed('0xd')]('/',auth[_0xd9ed('0x8')](),controller[_0xd9ed('0xe')]);router[_0xd9ed('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xd9ed('0x10')]);router[_0xd9ed('0x11')](_0xd9ed('0xb'),auth[_0xd9ed('0x8')](),controller[_0xd9ed('0x12')]);module[_0xd9ed('0x13')]=router; \ No newline at end of file +var _0x8560=['/:id','show','post','create','put','isAuthenticated','update','delete','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./openchannelApplication.controller','get','index'];(function(_0x152719,_0x377574){var _0x3f7961=function(_0x3cfc7d){while(--_0x3cfc7d){_0x152719['push'](_0x152719['shift']());}};_0x3f7961(++_0x377574);}(_0x8560,0xe8));var _0x0856=function(_0x30faec,_0x18940b){_0x30faec=_0x30faec-0x0;var _0x29484f=_0x8560[_0x30faec];return _0x29484f;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x0856('0x0'));var express=require(_0x0856('0x1'));var router=express[_0x0856('0x2')]();var fs_extra=require(_0x0856('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x0856('0x4'));var config=require('../../config/environment');var controller=require(_0x0856('0x5'));router[_0x0856('0x6')]('/',auth['isAuthenticated'](),controller[_0x0856('0x7')]);router[_0x0856('0x6')](_0x0856('0x8'),auth['isAuthenticated'](),controller[_0x0856('0x9')]);router[_0x0856('0xa')]('/',auth['isAuthenticated'](),controller[_0x0856('0xb')]);router[_0x0856('0xc')](_0x0856('0x8'),auth[_0x0856('0xd')](),controller[_0x0856('0xe')]);router[_0x0856('0xf')](_0x0856('0x8'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index aa9bb9a..1d03247 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 _0x53b3=['TEXT','STRING','sequelize','INTEGER'];(function(_0x5b6c2d,_0x4265a2){var _0x12d3a8=function(_0x31fb3c){while(--_0x31fb3c){_0x5b6c2d['push'](_0x5b6c2d['shift']());}};_0x12d3a8(++_0x4265a2);}(_0x53b3,0x7e));var _0x353b=function(_0x4564ff,_0xd39a3c){_0x4564ff=_0x4564ff-0x0;var _0x35b8b9=_0x53b3[_0x4564ff];return _0x35b8b9;};'use strict';var Sequelize=require(_0x353b('0x0'));module['exports']={'priority':{'type':Sequelize[_0x353b('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x353b('0x2')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x353b('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x39e7=['STRING','*,*,*,*','sequelize','exports','noop'];(function(_0x3984d0,_0x5c72ce){var _0xb71ce8=function(_0x2fd779){while(--_0x2fd779){_0x3984d0['push'](_0x3984d0['shift']());}};_0xb71ce8(++_0x5c72ce);}(_0x39e7,0x98));var _0x739e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x39e7[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x739e('0x0'));module[_0x739e('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x739e('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x739e('0x3')]},'interval':{'type':Sequelize[_0x739e('0x3')],'defaultValue':_0x739e('0x4')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 2254c5f..e8ca7c4 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 _0x0bdc=['rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','name','index','OpenchannelApplication','rawAttributes','fieldName','key','query','keys','filters','intersection','model','fields','attributes','length','order','sort','where','pick','filter','type','VIRTUAL','options','includeAll','include','findAll','show','params','find','catch','body','eml-format'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x0bdc,0x158));var _0xc0bd=function(_0x24efe6,_0x5fc5e1){_0x24efe6=_0x24efe6-0x0;var _0x161e22=_0x0bdc[_0x24efe6];return _0x161e22;};'use strict';var emlformat=require(_0xc0bd('0x0'));var rimraf=require(_0xc0bd('0x1'));var zipdir=require(_0xc0bd('0x2'));var jsonpatch=require(_0xc0bd('0x3'));var rp=require(_0xc0bd('0x4'));var moment=require('moment');var BPromise=require(_0xc0bd('0x5'));var Mustache=require(_0xc0bd('0x6'));var util=require('util');var path=require('path');var sox=require(_0xc0bd('0x7'));var csv=require(_0xc0bd('0x8'));var ejs=require(_0xc0bd('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc0bd('0xa'));var squel=require(_0xc0bd('0xb'));var crypto=require(_0xc0bd('0xc'));var jsforce=require(_0xc0bd('0xd'));var deskjs=require(_0xc0bd('0xe'));var toCsv=require(_0xc0bd('0x8'));var querystring=require('querystring');var Papa=require(_0xc0bd('0xf'));var Redis=require(_0xc0bd('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xc0bd('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc0bd('0x12'))(_0xc0bd('0x13'));var utils=require(_0xc0bd('0x14'));var config=require(_0xc0bd('0x15'));var licenseUtil=require(_0xc0bd('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5cc543,_0x3c3048){_0x3c3048=_0x3c3048||0xcc;return function(_0x4a4726){if(_0x4a4726){return _0x5cc543[_0xc0bd('0x17')](_0x3c3048);}return _0x5cc543[_0xc0bd('0x18')](_0x3c3048)[_0xc0bd('0x19')]();};}function respondWithResult(_0x639918,_0x26de2d){_0x26de2d=_0x26de2d||0xc8;return function(_0x27160d){if(_0x27160d){return _0x639918[_0xc0bd('0x18')](_0x26de2d)[_0xc0bd('0x1a')](_0x27160d);}};}function respondWithFilteredResult(_0x16b8f4,_0x3353b5){return function(_0x58276e){if(_0x58276e){var _0x2eb5f3=typeof _0x3353b5[_0xc0bd('0x1b')]===_0xc0bd('0x1c')&&typeof _0x3353b5[_0xc0bd('0x1d')]==='undefined';var _0x5bd1f0=_0x58276e[_0xc0bd('0x1e')];var _0x4a2c35=_0x2eb5f3?0x0:_0x3353b5[_0xc0bd('0x1b')];var _0x1619c0=_0x2eb5f3?_0x58276e['count']:_0x3353b5['offset']+_0x3353b5[_0xc0bd('0x1d')];var _0x93db13;if(_0x1619c0>=_0x5bd1f0){_0x1619c0=_0x5bd1f0;_0x93db13=0xc8;}else{_0x93db13=0xce;}_0x16b8f4['status'](_0x93db13);return _0x16b8f4[_0xc0bd('0x1f')](_0xc0bd('0x20'),_0x4a2c35+'-'+_0x1619c0+'/'+_0x5bd1f0)[_0xc0bd('0x1a')](_0x58276e);}return null;};}function patchUpdates(_0x66dacd){return function(_0x4e6a43){try{jsonpatch[_0xc0bd('0x21')](_0x4e6a43,_0x66dacd,!![]);}catch(_0x2e2967){return BPromise[_0xc0bd('0x22')](_0x2e2967);}return _0x4e6a43[_0xc0bd('0x23')]();};}function saveUpdates(_0x4b0259,_0x588f59){return function(_0x571a24){if(_0x571a24){return _0x571a24[_0xc0bd('0x24')](_0x4b0259)[_0xc0bd('0x25')](function(_0x2c29d4){return _0x2c29d4;});}return null;};}function removeEntity(_0x589e71,_0x5f16ed){return function(_0x27e81b){if(_0x27e81b){return _0x27e81b['destroy']()[_0xc0bd('0x25')](function(){_0x589e71['status'](0xcc)[_0xc0bd('0x19')]();});}};}function handleEntityNotFound(_0x5f4c04,_0x3fe902){return function(_0x2f0a18){if(!_0x2f0a18){_0x5f4c04['sendStatus'](0x194);}return _0x2f0a18;};}function handleError(_0x543253,_0xfe6ce3){_0xfe6ce3=_0xfe6ce3||0x1f4;return function(_0x1471be){logger[_0xc0bd('0x26')](_0x1471be['stack']);if(_0x1471be[_0xc0bd('0x27')]){delete _0x1471be[_0xc0bd('0x27')];}_0x543253[_0xc0bd('0x18')](_0xfe6ce3)['send'](_0x1471be);};}exports[_0xc0bd('0x28')]=function(_0x22142c,_0x4f78b2){var _0x241c2f={},_0x10edc2={},_0x44be73={'count':0x0,'rows':[]};var _0x3a5fad=_['map'](db[_0xc0bd('0x29')][_0xc0bd('0x2a')],function(_0x2362bc){return{'name':_0x2362bc[_0xc0bd('0x2b')],'type':_0x2362bc['type'][_0xc0bd('0x2c')]};});_0x10edc2['model']=_['map'](_0x3a5fad,'name');_0x10edc2[_0xc0bd('0x2d')]=_[_0xc0bd('0x2e')](_0x22142c[_0xc0bd('0x2d')]);_0x10edc2[_0xc0bd('0x2f')]=_[_0xc0bd('0x30')](_0x10edc2[_0xc0bd('0x31')],_0x10edc2[_0xc0bd('0x2d')]);_0x241c2f['attributes']=_[_0xc0bd('0x30')](_0x10edc2[_0xc0bd('0x31')],qs[_0xc0bd('0x32')](_0x22142c['query'][_0xc0bd('0x32')]));_0x241c2f[_0xc0bd('0x33')]=_0x241c2f[_0xc0bd('0x33')][_0xc0bd('0x34')]?_0x241c2f['attributes']:_0x10edc2[_0xc0bd('0x31')];if(!_0x22142c['query']['hasOwnProperty']('nolimit')){_0x241c2f['limit']=qs['limit'](_0x22142c['query']['limit']);_0x241c2f['offset']=qs[_0xc0bd('0x1b')](_0x22142c[_0xc0bd('0x2d')][_0xc0bd('0x1b')]);}_0x241c2f[_0xc0bd('0x35')]=qs[_0xc0bd('0x36')](_0x22142c[_0xc0bd('0x2d')][_0xc0bd('0x36')]);_0x241c2f[_0xc0bd('0x37')]=qs[_0xc0bd('0x2f')](_[_0xc0bd('0x38')](_0x22142c[_0xc0bd('0x2d')],_0x10edc2[_0xc0bd('0x2f')]),_0x3a5fad);if(_0x22142c['query'][_0xc0bd('0x39')]){_0x241c2f['where']=_['merge'](_0x241c2f[_0xc0bd('0x37')],{'$or':_['map'](_0x3a5fad,function(_0x567332){if(_0x567332[_0xc0bd('0x3a')]!==_0xc0bd('0x3b')){var _0x8ef7f2={};_0x8ef7f2[_0x567332['name']]={'$like':'%'+_0x22142c[_0xc0bd('0x2d')]['filter']+'%'};return _0x8ef7f2;}})});}_0x241c2f=_['merge']({},_0x241c2f,_0x22142c[_0xc0bd('0x3c')]);var _0x198b7b={'where':_0x241c2f[_0xc0bd('0x37')]};return db[_0xc0bd('0x29')]['count'](_0x198b7b)['then'](function(_0x468ba2){_0x44be73['count']=_0x468ba2;if(_0x22142c[_0xc0bd('0x2d')][_0xc0bd('0x3d')]){_0x241c2f[_0xc0bd('0x3e')]=[{'all':!![]}];}return db[_0xc0bd('0x29')][_0xc0bd('0x3f')](_0x241c2f);})['then'](function(_0x45237a){_0x44be73['rows']=_0x45237a;return _0x44be73;})['then'](respondWithFilteredResult(_0x4f78b2,_0x241c2f))['catch'](handleError(_0x4f78b2,null));};exports[_0xc0bd('0x40')]=function(_0x1d81b0,_0x1920f1){var _0x19e8a5={'raw':!![],'where':{'id':_0x1d81b0[_0xc0bd('0x41')]['id']}},_0x1e110d={};_0x1e110d[_0xc0bd('0x31')]=_['keys'](db[_0xc0bd('0x29')][_0xc0bd('0x2a')]);_0x1e110d[_0xc0bd('0x2d')]=_['keys'](_0x1d81b0[_0xc0bd('0x2d')]);_0x1e110d['filters']=_[_0xc0bd('0x30')](_0x1e110d[_0xc0bd('0x31')],_0x1e110d[_0xc0bd('0x2d')]);_0x19e8a5[_0xc0bd('0x33')]=_[_0xc0bd('0x30')](_0x1e110d[_0xc0bd('0x31')],qs[_0xc0bd('0x32')](_0x1d81b0[_0xc0bd('0x2d')][_0xc0bd('0x32')]));_0x19e8a5[_0xc0bd('0x33')]=_0x19e8a5['attributes'][_0xc0bd('0x34')]?_0x19e8a5[_0xc0bd('0x33')]:_0x1e110d[_0xc0bd('0x31')];if(_0x1d81b0[_0xc0bd('0x2d')][_0xc0bd('0x3d')]){_0x19e8a5[_0xc0bd('0x3e')]=[{'all':!![]}];}_0x19e8a5=_['merge']({},_0x19e8a5,_0x1d81b0['options']);return db[_0xc0bd('0x29')][_0xc0bd('0x42')](_0x19e8a5)['then'](handleEntityNotFound(_0x1920f1,null))['then'](respondWithResult(_0x1920f1,null))[_0xc0bd('0x43')](handleError(_0x1920f1,null));};exports['create']=function(_0xf2559,_0xe8179a){return db[_0xc0bd('0x29')]['create'](_0xf2559['body'],{})[_0xc0bd('0x25')](respondWithResult(_0xe8179a,0xc9))[_0xc0bd('0x43')](handleError(_0xe8179a,null));};exports[_0xc0bd('0x24')]=function(_0x382cca,_0x245432){if(_0x382cca['body']['id']){delete _0x382cca[_0xc0bd('0x44')]['id'];}return db[_0xc0bd('0x29')]['find']({'where':{'id':_0x382cca['params']['id']}})[_0xc0bd('0x25')](handleEntityNotFound(_0x245432,null))[_0xc0bd('0x25')](saveUpdates(_0x382cca[_0xc0bd('0x44')],null))[_0xc0bd('0x25')](respondWithResult(_0x245432,null))[_0xc0bd('0x43')](handleError(_0x245432,null));};exports['destroy']=function(_0x1058f8,_0x55a3a5){return db[_0xc0bd('0x29')][_0xc0bd('0x42')]({'where':{'id':_0x1058f8[_0xc0bd('0x41')]['id']}})['then'](handleEntityNotFound(_0x55a3a5,null))[_0xc0bd('0x25')](removeEntity(_0x55a3a5,null))[_0xc0bd('0x43')](handleError(_0x55a3a5,null));}; \ No newline at end of file +var _0x52b2=['fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','apply','reject','save','update','then','name','map','OpenchannelApplication','fieldName','type','key','query','keys','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','rows','show','params','rawAttributes','find','create','catch','body','destroy','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs'];(function(_0x38d2a0,_0xf48b4f){var _0x93079e=function(_0x4f6d2f){while(--_0x4f6d2f){_0x38d2a0['push'](_0x38d2a0['shift']());}};_0x93079e(++_0xf48b4f);}(_0x52b2,0x163));var _0x252b=function(_0x39e1bd,_0x469981){_0x39e1bd=_0x39e1bd-0x0;var _0x3662b9=_0x52b2[_0x39e1bd];return _0x3662b9;};'use strict';var emlformat=require(_0x252b('0x0'));var rimraf=require(_0x252b('0x1'));var zipdir=require(_0x252b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x252b('0x3'));var moment=require(_0x252b('0x4'));var BPromise=require(_0x252b('0x5'));var Mustache=require(_0x252b('0x6'));var util=require(_0x252b('0x7'));var path=require(_0x252b('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x252b('0x9'));var fs=require('fs');var fs_extra=require(_0x252b('0xa'));var _=require('lodash');var squel=require(_0x252b('0xb'));var crypto=require(_0x252b('0xc'));var jsforce=require(_0x252b('0xd'));var deskjs=require(_0x252b('0xe'));var toCsv=require('to-csv');var querystring=require(_0x252b('0xf'));var Papa=require('papaparse');var Redis=require(_0x252b('0x10'));var authService=require(_0x252b('0x11'));var qs=require(_0x252b('0x12'));var as=require(_0x252b('0x13'));var hardwareService=require(_0x252b('0x14'));var logger=require(_0x252b('0x15'))(_0x252b('0x16'));var utils=require(_0x252b('0x17'));var config=require(_0x252b('0x18'));var licenseUtil=require(_0x252b('0x19'));var db=require(_0x252b('0x1a'))['db'];function respondWithStatusCode(_0x46beb1,_0x2c5af3){_0x2c5af3=_0x2c5af3||0xcc;return function(_0x257c0d){if(_0x257c0d){return _0x46beb1[_0x252b('0x1b')](_0x2c5af3);}return _0x46beb1[_0x252b('0x1c')](_0x2c5af3)['end']();};}function respondWithResult(_0x17b5f4,_0x52fadf){_0x52fadf=_0x52fadf||0xc8;return function(_0x5bc751){if(_0x5bc751){return _0x17b5f4[_0x252b('0x1c')](_0x52fadf)[_0x252b('0x1d')](_0x5bc751);}};}function respondWithFilteredResult(_0xb5299f,_0x35dd65){return function(_0x288a53){if(_0x288a53){var _0x119e4f=typeof _0x35dd65[_0x252b('0x1e')]===_0x252b('0x1f')&&typeof _0x35dd65[_0x252b('0x20')]===_0x252b('0x1f');var _0x35fb2f=_0x288a53[_0x252b('0x21')];var _0xcef9c1=_0x119e4f?0x0:_0x35dd65[_0x252b('0x1e')];var _0x1098ce=_0x119e4f?_0x288a53[_0x252b('0x21')]:_0x35dd65[_0x252b('0x1e')]+_0x35dd65['limit'];var _0x51f2a3;if(_0x1098ce>=_0x35fb2f){_0x1098ce=_0x35fb2f;_0x51f2a3=0xc8;}else{_0x51f2a3=0xce;}_0xb5299f[_0x252b('0x1c')](_0x51f2a3);return _0xb5299f['set']('Content-Range',_0xcef9c1+'-'+_0x1098ce+'/'+_0x35fb2f)[_0x252b('0x1d')](_0x288a53);}return null;};}function patchUpdates(_0x28cf9f){return function(_0x2de61b){try{jsonpatch[_0x252b('0x22')](_0x2de61b,_0x28cf9f,!![]);}catch(_0x353d0d){return BPromise[_0x252b('0x23')](_0x353d0d);}return _0x2de61b[_0x252b('0x24')]();};}function saveUpdates(_0x3d2795,_0xb290f9){return function(_0x564491){if(_0x564491){return _0x564491[_0x252b('0x25')](_0x3d2795)[_0x252b('0x26')](function(_0x28cef7){return _0x28cef7;});}return null;};}function removeEntity(_0x3ac296,_0x54ae33){return function(_0x10f961){if(_0x10f961){return _0x10f961['destroy']()['then'](function(){_0x3ac296['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x48e9c9,_0x5181ea){return function(_0x252686){if(!_0x252686){_0x48e9c9[_0x252b('0x1b')](0x194);}return _0x252686;};}function handleError(_0x793458,_0x5287af){_0x5287af=_0x5287af||0x1f4;return function(_0x3c8ecd){logger['error'](_0x3c8ecd['stack']);if(_0x3c8ecd['name']){delete _0x3c8ecd[_0x252b('0x27')];}_0x793458[_0x252b('0x1c')](_0x5287af)['send'](_0x3c8ecd);};}exports['index']=function(_0x4fba70,_0x38b32a){var _0x13322e={},_0xd5370c={},_0x4df629={'count':0x0,'rows':[]};var _0x328faf=_[_0x252b('0x28')](db[_0x252b('0x29')]['rawAttributes'],function(_0x2b1074){return{'name':_0x2b1074[_0x252b('0x2a')],'type':_0x2b1074[_0x252b('0x2b')][_0x252b('0x2c')]};});_0xd5370c['model']=_[_0x252b('0x28')](_0x328faf,_0x252b('0x27'));_0xd5370c[_0x252b('0x2d')]=_[_0x252b('0x2e')](_0x4fba70['query']);_0xd5370c[_0x252b('0x2f')]=_[_0x252b('0x30')](_0xd5370c['model'],_0xd5370c[_0x252b('0x2d')]);_0x13322e[_0x252b('0x31')]=_[_0x252b('0x30')](_0xd5370c['model'],qs[_0x252b('0x32')](_0x4fba70['query']['fields']));_0x13322e['attributes']=_0x13322e[_0x252b('0x31')][_0x252b('0x33')]?_0x13322e[_0x252b('0x31')]:_0xd5370c[_0x252b('0x34')];if(!_0x4fba70[_0x252b('0x2d')][_0x252b('0x35')](_0x252b('0x36'))){_0x13322e[_0x252b('0x20')]=qs[_0x252b('0x20')](_0x4fba70[_0x252b('0x2d')][_0x252b('0x20')]);_0x13322e[_0x252b('0x1e')]=qs['offset'](_0x4fba70['query'][_0x252b('0x1e')]);}_0x13322e[_0x252b('0x37')]=qs[_0x252b('0x38')](_0x4fba70[_0x252b('0x2d')][_0x252b('0x38')]);_0x13322e[_0x252b('0x39')]=qs['filters'](_[_0x252b('0x3a')](_0x4fba70['query'],_0xd5370c['filters']),_0x328faf);if(_0x4fba70[_0x252b('0x2d')][_0x252b('0x3b')]){_0x13322e[_0x252b('0x39')]=_['merge'](_0x13322e['where'],{'$or':_[_0x252b('0x28')](_0x328faf,function(_0x1a9907){if(_0x1a9907[_0x252b('0x2b')]!=='VIRTUAL'){var _0x15c24c={};_0x15c24c[_0x1a9907['name']]={'$like':'%'+_0x4fba70['query'][_0x252b('0x3b')]+'%'};return _0x15c24c;}})});}_0x13322e=_[_0x252b('0x3c')]({},_0x13322e,_0x4fba70[_0x252b('0x3d')]);var _0x209d63={'where':_0x13322e[_0x252b('0x39')]};return db[_0x252b('0x29')][_0x252b('0x21')](_0x209d63)[_0x252b('0x26')](function(_0x3e8a2d){_0x4df629[_0x252b('0x21')]=_0x3e8a2d;if(_0x4fba70[_0x252b('0x2d')]['includeAll']){_0x13322e[_0x252b('0x3e')]=[{'all':!![]}];}return db['OpenchannelApplication'][_0x252b('0x3f')](_0x13322e);})[_0x252b('0x26')](function(_0x2f3659){_0x4df629[_0x252b('0x40')]=_0x2f3659;return _0x4df629;})[_0x252b('0x26')](respondWithFilteredResult(_0x38b32a,_0x13322e))['catch'](handleError(_0x38b32a,null));};exports[_0x252b('0x41')]=function(_0x3e1945,_0x41747b){var _0x55cfe1={'raw':!![],'where':{'id':_0x3e1945[_0x252b('0x42')]['id']}},_0x2fbaa={};_0x2fbaa[_0x252b('0x34')]=_[_0x252b('0x2e')](db[_0x252b('0x29')][_0x252b('0x43')]);_0x2fbaa['query']=_['keys'](_0x3e1945[_0x252b('0x2d')]);_0x2fbaa['filters']=_[_0x252b('0x30')](_0x2fbaa[_0x252b('0x34')],_0x2fbaa[_0x252b('0x2d')]);_0x55cfe1[_0x252b('0x31')]=_[_0x252b('0x30')](_0x2fbaa[_0x252b('0x34')],qs['fields'](_0x3e1945['query'][_0x252b('0x32')]));_0x55cfe1[_0x252b('0x31')]=_0x55cfe1[_0x252b('0x31')]['length']?_0x55cfe1[_0x252b('0x31')]:_0x2fbaa[_0x252b('0x34')];if(_0x3e1945['query']['includeAll']){_0x55cfe1[_0x252b('0x3e')]=[{'all':!![]}];}_0x55cfe1=_[_0x252b('0x3c')]({},_0x55cfe1,_0x3e1945[_0x252b('0x3d')]);return db['OpenchannelApplication'][_0x252b('0x44')](_0x55cfe1)[_0x252b('0x26')](handleEntityNotFound(_0x41747b,null))[_0x252b('0x26')](respondWithResult(_0x41747b,null))['catch'](handleError(_0x41747b,null));};exports[_0x252b('0x45')]=function(_0x12cd43,_0x3f7921){return db[_0x252b('0x29')][_0x252b('0x45')](_0x12cd43['body'],{})[_0x252b('0x26')](respondWithResult(_0x3f7921,0xc9))[_0x252b('0x46')](handleError(_0x3f7921,null));};exports['update']=function(_0x1a45e5,_0x26295a){if(_0x1a45e5[_0x252b('0x47')]['id']){delete _0x1a45e5[_0x252b('0x47')]['id'];}return db[_0x252b('0x29')]['find']({'where':{'id':_0x1a45e5[_0x252b('0x42')]['id']}})[_0x252b('0x26')](handleEntityNotFound(_0x26295a,null))[_0x252b('0x26')](saveUpdates(_0x1a45e5['body'],null))[_0x252b('0x26')](respondWithResult(_0x26295a,null))[_0x252b('0x46')](handleError(_0x26295a,null));};exports[_0x252b('0x48')]=function(_0x2762f6,_0x3ad44d){return db[_0x252b('0x29')][_0x252b('0x44')]({'where':{'id':_0x2762f6[_0x252b('0x42')]['id']}})[_0x252b('0x26')](handleEntityNotFound(_0x3ad44d,null))['then'](removeEntity(_0x3ad44d,null))[_0x252b('0x46')](handleError(_0x3ad44d,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index 127ded9..a72412e 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 _0xe18a=['api','bluebird','request-promise','rimraf','../../config/environment','./openchannelApplication.attributes','exports','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x549aa9,_0x58ec17){var _0x3f0b12=function(_0x410ac9){while(--_0x410ac9){_0x549aa9['push'](_0x549aa9['shift']());}};_0x3f0b12(++_0x58ec17);}(_0xe18a,0xae));var _0xae18=function(_0x212e99,_0x266874){_0x212e99=_0x212e99-0x0;var _0x49c295=_0xe18a[_0x212e99];return _0x49c295;};'use strict';var _=require(_0xae18('0x0'));var util=require(_0xae18('0x1'));var logger=require('../../config/logger')(_0xae18('0x2'));var moment=require('moment');var BPromise=require(_0xae18('0x3'));var rp=require(_0xae18('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xae18('0x5'));var config=require(_0xae18('0x6'));var attributes=require(_0xae18('0x7'));module[_0xae18('0x8')]=function(_0x1051b9,_0x43a319){return _0x1051b9['define']('OpenchannelApplication',attributes,{'tableName':'openchannel_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xae18('0x9'),'collate':_0xae18('0xa')});}; \ No newline at end of file +var _0x26bc=['utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','rimraf','./openchannelApplication.attributes','exports','define'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0x26bc,0x152));var _0xc26b=function(_0x4f7de3,_0x4662e6){_0x4f7de3=_0x4f7de3-0x0;var _0x24036c=_0x26bc[_0x4f7de3];return _0x24036c;};'use strict';var _=require(_0xc26b('0x0'));var util=require(_0xc26b('0x1'));var logger=require('../../config/logger')(_0xc26b('0x2'));var moment=require(_0xc26b('0x3'));var BPromise=require(_0xc26b('0x4'));var rp=require(_0xc26b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc26b('0x6'));var config=require('../../config/environment');var attributes=require(_0xc26b('0x7'));module[_0xc26b('0x8')]=function(_0xc40465,_0x1de666){return _0xc40465[_0xc26b('0x9')]('OpenchannelApplication',attributes,{'tableName':'openchannel_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc26b('0xa'),'collate':_0xc26b('0xb')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 706f5f3..1b05395 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 _0xb6af=['debug','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','OpenchannelApplication,\x20%s,\x20%s,\x20%s','error','OpenchannelApplication,\x20%s,\x20%s','message','result','catch','UpdateOpenchannelApplication','OpenchannelApplication','update','body','options','where','attributes','limit'];(function(_0x27fd28,_0x3818af){var _0x2448f5=function(_0x252546){while(--_0x252546){_0x27fd28['push'](_0x27fd28['shift']());}};_0x2448f5(++_0x3818af);}(_0xb6af,0x182));var _0xfb6a=function(_0x475923,_0x25d9ec){_0x475923=_0x475923-0x0;var _0x374030=_0xb6af[_0x475923];return _0x374030;};'use strict';var _=require(_0xfb6a('0x0'));var util=require(_0xfb6a('0x1'));var moment=require(_0xfb6a('0x2'));var BPromise=require(_0xfb6a('0x3'));var rs=require(_0xfb6a('0x4'));var fs=require('fs');var Redis=require(_0xfb6a('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xfb6a('0x6'));var logger=require(_0xfb6a('0x7'))(_0xfb6a('0x8'));var config=require(_0xfb6a('0x9'));var jayson=require(_0xfb6a('0xa'));var client=jayson['client'][_0xfb6a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x125b78,_0x36c727,_0x3fdc06){return new BPromise(function(_0xa7f78a,_0x5c35d4){return client[_0xfb6a('0xc')](_0x125b78,_0x3fdc06)[_0xfb6a('0xd')](function(_0x5ed9e9){logger[_0xfb6a('0xe')]('OpenchannelApplication,\x20%s,\x20%s',_0x36c727,_0xfb6a('0xf'));logger['debug'](_0xfb6a('0x10'),_0x36c727,_0xfb6a('0xf'),JSON['stringify'](_0x5ed9e9));if(_0x5ed9e9['error']){if(_0x5ed9e9[_0xfb6a('0x11')]['code']===0x1f4){logger[_0xfb6a('0x11')](_0xfb6a('0x12'),_0x36c727,_0x5ed9e9[_0xfb6a('0x11')][_0xfb6a('0x13')]);return _0x5c35d4(_0x5ed9e9[_0xfb6a('0x11')][_0xfb6a('0x13')]);}logger[_0xfb6a('0x11')](_0xfb6a('0x12'),_0x36c727,_0x5ed9e9[_0xfb6a('0x11')][_0xfb6a('0x13')]);return _0xa7f78a(_0x5ed9e9[_0xfb6a('0x11')][_0xfb6a('0x13')]);}else{logger[_0xfb6a('0xe')](_0xfb6a('0x12'),_0x36c727,_0xfb6a('0xf'));_0xa7f78a(_0x5ed9e9[_0xfb6a('0x14')][_0xfb6a('0x13')]);}})[_0xfb6a('0x15')](function(_0x5ea90c){logger[_0xfb6a('0x11')](_0xfb6a('0x12'),_0x36c727,_0x5ea90c);_0x5c35d4(_0x5ea90c);});});}exports[_0xfb6a('0x16')]=function(_0x3a5f6c){var _0x284ee8=this;return new Promise(function(_0x2cbaf2,_0xc8d569){return db[_0xfb6a('0x17')][_0xfb6a('0x18')](_0x3a5f6c[_0xfb6a('0x19')],{'raw':_0x3a5f6c['options']?_0x3a5f6c[_0xfb6a('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3a5f6c[_0xfb6a('0x1a')]?_0x3a5f6c[_0xfb6a('0x1a')][_0xfb6a('0x1b')]||null:null,'attributes':_0x3a5f6c[_0xfb6a('0x1a')]?_0x3a5f6c[_0xfb6a('0x1a')][_0xfb6a('0x1c')]||null:null,'limit':_0x3a5f6c[_0xfb6a('0x1a')]?_0x3a5f6c['options'][_0xfb6a('0x1d')]||null:null})[_0xfb6a('0xd')](function(_0x2fad1c){logger[_0xfb6a('0xe')](_0xfb6a('0x16'),_0x3a5f6c);logger[_0xfb6a('0x1e')](_0xfb6a('0x16'),_0x3a5f6c,JSON[_0xfb6a('0x1f')](_0x2fad1c));_0x2cbaf2(_0x2fad1c);})[_0xfb6a('0x15')](function(_0x519434){logger[_0xfb6a('0x11')](_0xfb6a('0x16'),_0x519434[_0xfb6a('0x13')],_0x3a5f6c);_0xc8d569(_0x284ee8['error'](0x1f4,_0x519434['message']));});});}; \ No newline at end of file +var _0xa763=['raw','attributes','then','UpdateOpenchannelApplication','debug','stringify','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','OpenchannelApplication,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','update','body','options'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa763,0x19c));var _0x3a76=function(_0x872b02,_0x4f4458){_0x872b02=_0x872b02-0x0;var _0x1a6b24=_0xa763[_0x872b02];return _0x1a6b24;};'use strict';var _=require('lodash');var util=require(_0x3a76('0x0'));var moment=require(_0x3a76('0x1'));var BPromise=require('bluebird');var rs=require(_0x3a76('0x2'));var fs=require('fs');var Redis=require(_0x3a76('0x3'));var db=require(_0x3a76('0x4'))['db'];var utils=require(_0x3a76('0x5'));var logger=require(_0x3a76('0x6'))(_0x3a76('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3a76('0x8')][_0x3a76('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1c3f7b,_0x3e6838,_0x3c6d58){return new BPromise(function(_0x38aaa1,_0xd32a38){return client[_0x3a76('0xa')](_0x1c3f7b,_0x3c6d58)['then'](function(_0x1301fc){logger[_0x3a76('0xb')](_0x3a76('0xc'),_0x3e6838,_0x3a76('0xd'));logger['debug'](_0x3a76('0xe'),_0x3e6838,'request\x20sent',JSON['stringify'](_0x1301fc));if(_0x1301fc['error']){if(_0x1301fc['error'][_0x3a76('0xf')]===0x1f4){logger[_0x3a76('0x10')]('OpenchannelApplication,\x20%s,\x20%s',_0x3e6838,_0x1301fc[_0x3a76('0x10')][_0x3a76('0x11')]);return _0xd32a38(_0x1301fc[_0x3a76('0x10')][_0x3a76('0x11')]);}logger[_0x3a76('0x10')](_0x3a76('0xc'),_0x3e6838,_0x1301fc['error'][_0x3a76('0x11')]);return _0x38aaa1(_0x1301fc['error'][_0x3a76('0x11')]);}else{logger[_0x3a76('0xb')]('OpenchannelApplication,\x20%s,\x20%s',_0x3e6838,_0x3a76('0xd'));_0x38aaa1(_0x1301fc[_0x3a76('0x12')][_0x3a76('0x11')]);}})[_0x3a76('0x13')](function(_0x1045c8){logger['error'](_0x3a76('0xc'),_0x3e6838,_0x1045c8);_0xd32a38(_0x1045c8);});});}exports['UpdateOpenchannelApplication']=function(_0x153504){var _0x2a25c3=this;return new Promise(function(_0x348b35,_0x592c29){return db['OpenchannelApplication'][_0x3a76('0x14')](_0x153504[_0x3a76('0x15')],{'raw':_0x153504[_0x3a76('0x16')]?_0x153504['options'][_0x3a76('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x153504[_0x3a76('0x16')]?_0x153504[_0x3a76('0x16')]['where']||null:null,'attributes':_0x153504[_0x3a76('0x16')]?_0x153504['options'][_0x3a76('0x18')]||null:null,'limit':_0x153504[_0x3a76('0x16')]?_0x153504[_0x3a76('0x16')]['limit']||null:null})[_0x3a76('0x19')](function(_0x24ebfc){logger['info'](_0x3a76('0x1a'),_0x153504);logger[_0x3a76('0x1b')](_0x3a76('0x1a'),_0x153504,JSON[_0x3a76('0x1c')](_0x24ebfc));_0x348b35(_0x24ebfc);})['catch'](function(_0x35f846){logger[_0x3a76('0x10')](_0x3a76('0x1a'),_0x35f846[_0x3a76('0x11')],_0x153504);_0x592c29(_0x2a25c3[_0x3a76('0x10')](0x1f4,_0x35f846['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index b7d5bbb..8762faa 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 _0x04a0=['destroy','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','get','index','/describe','describe','/:id','isAuthenticated','/:id/messages','getMessages','download','post','create','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','put','openchannelinteraction:update','update','openchannelinteraction:destroy'];(function(_0x5ed8c9,_0x4a3e38){var _0x33b49c=function(_0x218886){while(--_0x218886){_0x5ed8c9['push'](_0x5ed8c9['shift']());}};_0x33b49c(++_0x4a3e38);}(_0x04a0,0x11a));var _0x004a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x04a0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x004a('0x0'));var util=require(_0x004a('0x1'));var path=require(_0x004a('0x2'));var timeout=require(_0x004a('0x3'));var express=require(_0x004a('0x4'));var router=express['Router']();var fs_extra=require(_0x004a('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x004a('0x6'));var config=require(_0x004a('0x7'));var controller=require('./openchannelInteraction.controller');router[_0x004a('0x8')]('/',auth['isAuthenticated'](),controller[_0x004a('0x9')]);router[_0x004a('0x8')](_0x004a('0xa'),auth['isAuthenticated'](),controller[_0x004a('0xb')]);router[_0x004a('0x8')](_0x004a('0xc'),auth[_0x004a('0xd')](),controller['show']);router[_0x004a('0x8')](_0x004a('0xe'),auth[_0x004a('0xd')](),controller[_0x004a('0xf')]);router[_0x004a('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0x004a('0x10')]);router[_0x004a('0x11')]('/',auth['isAuthenticated'](),controller[_0x004a('0x12')]);router[_0x004a('0x11')]('/:id/messages',auth[_0x004a('0xd')](),controller[_0x004a('0x13')]);router['post'](_0x004a('0x14'),auth[_0x004a('0xd')](),interaction[_0x004a('0x15')](_0x004a('0x16'),_0x004a('0x17')),controller['addTags']);router[_0x004a('0x18')](_0x004a('0xc'),auth[_0x004a('0xd')](),interaction[_0x004a('0x15')](_0x004a('0x16'),_0x004a('0x19')),controller[_0x004a('0x1a')]);router['delete'](_0x004a('0xc'),auth['isAuthenticated'](),interaction['tracked'](_0x004a('0x16'),_0x004a('0x1b')),controller[_0x004a('0x1c')]);router[_0x004a('0x1d')](_0x004a('0x14'),auth[_0x004a('0xd')](),controller['removeTags']);module[_0x004a('0x1e')]=router; \ No newline at end of file +var _0x3469=['/:id/tags','tracked','openchannelinteraction:addtags','addTags','openchannel','openchannelinteraction:update','update','delete','openchannelinteraction:destroy','removeTags','exports','path','express','Router','fs-extra','../../config/environment','./openchannelInteraction.controller','isAuthenticated','index','get','/describe','/:id','show','/:id/messages','download','post','create','addMessage'];(function(_0x55f000,_0x3fd032){var _0x38cbdf=function(_0x2f2c95){while(--_0x2f2c95){_0x55f000['push'](_0x55f000['shift']());}};_0x38cbdf(++_0x3fd032);}(_0x3469,0xcf));var _0x9346=function(_0x2a5903,_0xa82139){_0x2a5903=_0x2a5903-0x0;var _0x18a2c7=_0x3469[_0x2a5903];return _0x18a2c7;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9346('0x0'));var timeout=require('connect-timeout');var express=require(_0x9346('0x1'));var router=express[_0x9346('0x2')]();var fs_extra=require(_0x9346('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x9346('0x4'));var controller=require(_0x9346('0x5'));router['get']('/',auth[_0x9346('0x6')](),controller[_0x9346('0x7')]);router[_0x9346('0x8')](_0x9346('0x9'),auth[_0x9346('0x6')](),controller['describe']);router[_0x9346('0x8')](_0x9346('0xa'),auth['isAuthenticated'](),controller[_0x9346('0xb')]);router[_0x9346('0x8')](_0x9346('0xc'),auth[_0x9346('0x6')](),controller['getMessages']);router[_0x9346('0x8')]('/:id/download',auth[_0x9346('0x6')](),controller[_0x9346('0xd')]);router[_0x9346('0xe')]('/',auth[_0x9346('0x6')](),controller[_0x9346('0xf')]);router['post'](_0x9346('0xc'),auth[_0x9346('0x6')](),controller[_0x9346('0x10')]);router[_0x9346('0xe')](_0x9346('0x11'),auth[_0x9346('0x6')](),interaction[_0x9346('0x12')]('openchannel',_0x9346('0x13')),controller[_0x9346('0x14')]);router['put'](_0x9346('0xa'),auth['isAuthenticated'](),interaction[_0x9346('0x12')](_0x9346('0x15'),_0x9346('0x16')),controller[_0x9346('0x17')]);router[_0x9346('0x18')](_0x9346('0xa'),auth['isAuthenticated'](),interaction['tracked'](_0x9346('0x15'),_0x9346('0x19')),controller['destroy']);router[_0x9346('0x18')](_0x9346('0x11'),auth[_0x9346('0x6')](),controller[_0x9346('0x1a')]);module[_0x9346('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 f5078fd..ead452e 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 _0xb5fb=['out','INTEGER','sequelize','exports','BOOLEAN','DATE','STRING','ENUM'];(function(_0x1bd3ab,_0x352c42){var _0x37e394=function(_0x2f581d){while(--_0x2f581d){_0x1bd3ab['push'](_0x1bd3ab['shift']());}};_0x37e394(++_0x352c42);}(_0xb5fb,0x172));var _0xbb5f=function(_0x3cb004,_0x25d5d1){_0x3cb004=_0x3cb004-0x0;var _0x343ec2=_0xb5fb[_0x3cb004];return _0x343ec2;};'use strict';var Sequelize=require(_0xbb5f('0x0'));module[_0xbb5f('0x1')]={'closed':{'type':Sequelize[_0xbb5f('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xbb5f('0x3')]},'disposition':{'type':Sequelize[_0xbb5f('0x4')]},'secondDisposition':{'type':Sequelize[_0xbb5f('0x4')]},'thirdDisposition':{'type':Sequelize[_0xbb5f('0x4')]},'note':{'type':Sequelize[_0xbb5f('0x4')]},'read1stAt':{'type':Sequelize[_0xbb5f('0x3')]},'threadId':{'type':Sequelize[_0xbb5f('0x4')]},'externalUrl':{'type':Sequelize[_0xbb5f('0x4')]},'lastMsgAt':{'type':Sequelize[_0xbb5f('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xbb5f('0x5')]('in',_0xbb5f('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xbb5f('0x4')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueId':{'type':Sequelize[_0xbb5f('0x7')]}}; \ No newline at end of file +var _0x0b96=['STRING','DATE','ENUM','out','sequelize','exports','BOOLEAN'];(function(_0x4256c5,_0x288cee){var _0x3c8bfd=function(_0x5471f1){while(--_0x5471f1){_0x4256c5['push'](_0x4256c5['shift']());}};_0x3c8bfd(++_0x288cee);}(_0x0b96,0xa5));var _0x60b9=function(_0x2f8bc6,_0x4dc869){_0x2f8bc6=_0x2f8bc6-0x0;var _0x2d008a=_0x0b96[_0x2f8bc6];return _0x2d008a;};'use strict';var Sequelize=require(_0x60b9('0x0'));module[_0x60b9('0x1')]={'closed':{'type':Sequelize[_0x60b9('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x60b9('0x3')]},'secondDisposition':{'type':Sequelize[_0x60b9('0x3')]},'thirdDisposition':{'type':Sequelize[_0x60b9('0x3')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x60b9('0x4')]},'threadId':{'type':Sequelize[_0x60b9('0x3')]},'externalUrl':{'type':Sequelize['STRING']},'lastMsgAt':{'type':Sequelize[_0x60b9('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x60b9('0x5')]('in',_0x60b9('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0x60b9('0x5')]('in',_0x60b9('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x60b9('0x3')]},'autoreplyExecuted':{'type':Sequelize[_0x60b9('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index df502e4..87c1c95 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 _0x770a=['moment','util','path','ejs','lodash','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','status','json','undefined','limit','count','offset','set','update','destroy','end','error','stack','name','send','index','OpenchannelInteraction','rawAttributes','fieldName','type','findAll','user','catch','show','query','from','params','model','keys','filters','intersection','attributes','fields','includeAll','merge','options','then','create','body','find','describe','addMessage','OpenchannelMessage','ids','omit','getMessages','findOne','length','hasOwnProperty','nolimit','order','sort','where','OpenchannelInteractionId','filter','map','split','include','addTags','removeTags','unix','root','server','files','format','transcript-%d-%s.zip','join','push','User','fullname','Contact','firstName','lastName','attachments','Attachment','Messages','createdAt','secret','read','Owner','mkdirSync','Openchannel','Account','N.A.','YYYY-MM-DD\x20HH:mm:ss','toString','closed','closedAt','disposition','threadId','Public','basename','createReadStream','pipe','direction','out','System','value','renderFile','views','transcript-','.pdf','createPdfFromHTML','download','Unable\x20to\x20delete\x20zip\x20file','unlinkSync','rimraf','zip-dir'];(function(_0x48ef5e,_0x2e1c47){var _0x263bfc=function(_0x35faf2){while(--_0x35faf2){_0x48ef5e['push'](_0x48ef5e['shift']());}};_0x263bfc(++_0x2e1c47);}(_0x770a,0x1ee));var _0xa770=function(_0x31cfbe,_0x1e8862){_0x31cfbe=_0x31cfbe-0x0;var _0x2b1fbe=_0x770a[_0x31cfbe];return _0x2b1fbe;};'use strict';var rimraf=require(_0xa770('0x0'));var zipdir=require(_0xa770('0x1'));var moment=require(_0xa770('0x2'));var util=require(_0xa770('0x3'));var path=require(_0xa770('0x4'));var ejs=require(_0xa770('0x5'));var fs=require('fs');var _=require(_0xa770('0x6'));var Redis=require('ioredis');var interaction=require(_0xa770('0x7'));var qs=require(_0xa770('0x8'));var pdf=require(_0xa770('0x9'));var logger=require('../../config/logger')(_0xa770('0xa'));var config=require('../../config/environment');var db=require(_0xa770('0xb'))['db'];config[_0xa770('0xc')]=_[_0xa770('0xd')](config[_0xa770('0xc')],{'host':_0xa770('0xe'),'port':0x18eb});var socket=require(_0xa770('0xf'))(new Redis(config['redis']));require(_0xa770('0x10'))[_0xa770('0x11')](socket);function respondWithStatusCode(_0x10cbcd,_0x4941df){_0x4941df=_0x4941df||0xcc;return function(_0x4643d1){if(_0x4643d1){return _0x10cbcd[_0xa770('0x12')](_0x4941df);}return _0x10cbcd[_0xa770('0x13')](_0x4941df)['end']();};}function respondWithResult(_0x5c667f,_0xe47c81){_0xe47c81=_0xe47c81||0xc8;return function(_0x40fb6a){if(_0x40fb6a){return _0x5c667f[_0xa770('0x13')](_0xe47c81)[_0xa770('0x14')](_0x40fb6a);}};}function respondWithFilteredResult(_0x460038,_0x51307d){return function(_0x454969){if(_0x454969){var _0x347153=typeof _0x51307d['offset']===_0xa770('0x15')&&typeof _0x51307d[_0xa770('0x16')]===_0xa770('0x15');var _0x3b8918=_0x454969[_0xa770('0x17')];var _0x5b5438=_0x347153?0x0:_0x51307d[_0xa770('0x18')];var _0x7fab7f=_0x347153?_0x454969[_0xa770('0x17')]:_0x51307d[_0xa770('0x18')]+_0x51307d[_0xa770('0x16')];var _0xeca8bc;if(_0x7fab7f>=_0x3b8918){_0x7fab7f=_0x3b8918;_0xeca8bc=0xc8;}else{_0xeca8bc=0xce;}_0x460038[_0xa770('0x13')](_0xeca8bc);return _0x460038[_0xa770('0x19')]('Content-Range',_0x5b5438+'-'+_0x7fab7f+'/'+_0x3b8918)['json'](_0x454969);}return null;};}function saveUpdates(_0x5766f7){return function(_0x4e4196){if(_0x4e4196){return _0x4e4196[_0xa770('0x1a')](_0x5766f7)['then'](function(_0x4852bb){return _0x4852bb;});}return null;};}function removeEntity(_0xe9113b){return function(_0x1eaeb2){if(_0x1eaeb2){return _0x1eaeb2[_0xa770('0x1b')]()['then'](function(){_0xe9113b['status'](0xcc)[_0xa770('0x1c')]();});}};}function handleEntityNotFound(_0x5ef72e){return function(_0x4f623d){if(!_0x4f623d){_0x5ef72e[_0xa770('0x12')](0x194);}return _0x4f623d;};}function handleError(_0x984bd4,_0x1fe7b6){_0x1fe7b6=_0x1fe7b6||0x1f4;return function(_0x13bd80){logger[_0xa770('0x1d')](_0x13bd80[_0xa770('0x1e')]);if(_0x13bd80[_0xa770('0x1f')]){delete _0x13bd80[_0xa770('0x1f')];}_0x984bd4[_0xa770('0x13')](_0x1fe7b6)[_0xa770('0x20')](_0x13bd80);};}exports[_0xa770('0x21')]=function(_0x375b2a,_0x5f17fd){var _0x599c97={};var _0x54bfa8=_['map'](db[_0xa770('0x22')][_0xa770('0x23')],function(_0x2c37a4){return{'name':_0x2c37a4[_0xa770('0x24')],'type':_0x2c37a4[_0xa770('0x25')]['key']};});_0x599c97=qs['getOptions'](_0x54bfa8,_0x375b2a);return interaction[_0xa770('0x26')]('openchannel',_0x375b2a['query'],_0x375b2a[_0xa770('0x27')],_0x599c97,_0x54bfa8)['then'](respondWithFilteredResult(_0x5f17fd,_0x599c97))[_0xa770('0x28')](handleError(_0x5f17fd,null));};exports[_0xa770('0x29')]=function(_0x5e49fb,_0x1363c2){var _0x230403={};if(_0x5e49fb[_0xa770('0x2a')][_0xa770('0x25')]&&_0x5e49fb[_0xa770('0x2a')][_0xa770('0x25')]===_0xa770('0x2b')){_0x230403[_0xa770('0x2b')]=_0x5e49fb[_0xa770('0x2c')]['id'];}else{_0x230403['id']=_0x5e49fb[_0xa770('0x2c')]['id'];}var _0x32b651={'raw':![],'where':_0x230403},_0x2d50c6={};_0x2d50c6[_0xa770('0x2d')]=_[_0xa770('0x2e')](db[_0xa770('0x22')]['rawAttributes']);_0x2d50c6[_0xa770('0x2a')]=_['keys'](_0x5e49fb[_0xa770('0x2a')]);_0x2d50c6[_0xa770('0x2f')]=_[_0xa770('0x30')](_0x2d50c6[_0xa770('0x2d')],_0x2d50c6[_0xa770('0x2a')]);_0x32b651[_0xa770('0x31')]=_[_0xa770('0x30')](_0x2d50c6[_0xa770('0x2d')],qs[_0xa770('0x32')](_0x5e49fb[_0xa770('0x2a')][_0xa770('0x32')]));_0x32b651[_0xa770('0x31')]=_0x32b651[_0xa770('0x31')]['length']?_0x32b651['attributes']:_0x2d50c6['model'];if(_0x5e49fb[_0xa770('0x2a')][_0xa770('0x33')]){_0x32b651['include']=[{'all':!![]}];}_0x32b651=_[_0xa770('0x34')]({},_0x32b651,_0x5e49fb[_0xa770('0x35')]);return db[_0xa770('0x22')]['find'](_0x32b651)[_0xa770('0x36')](handleEntityNotFound(_0x1363c2,null))['then'](respondWithResult(_0x1363c2,null))[_0xa770('0x28')](handleError(_0x1363c2,null));};exports[_0xa770('0x37')]=function(_0x43f6b4,_0x2ec9ac){return db['OpenchannelInteraction'][_0xa770('0x37')](_0x43f6b4['body'],{})[_0xa770('0x36')](respondWithResult(_0x2ec9ac,0xc9))[_0xa770('0x28')](handleError(_0x2ec9ac,null));};exports[_0xa770('0x1a')]=function(_0x4454d4,_0x3af9ea){if(_0x4454d4[_0xa770('0x38')]['id']){delete _0x4454d4[_0xa770('0x38')]['id'];}return db['OpenchannelInteraction']['find']({'where':{'id':_0x4454d4[_0xa770('0x2c')]['id']}})[_0xa770('0x36')](handleEntityNotFound(_0x3af9ea,null))['then'](saveUpdates(_0x4454d4[_0xa770('0x38')],null))[_0xa770('0x36')](respondWithResult(_0x3af9ea,null))[_0xa770('0x28')](handleError(_0x3af9ea,null));};exports['destroy']=function(_0x545fa2,_0x327b37){return db['OpenchannelInteraction'][_0xa770('0x39')]({'where':{'id':_0x545fa2[_0xa770('0x2c')]['id']}})[_0xa770('0x36')](handleEntityNotFound(_0x327b37,null))[_0xa770('0x36')](removeEntity(_0x327b37,null))[_0xa770('0x28')](handleError(_0x327b37,null));};exports[_0xa770('0x3a')]=function(_0x280d8d,_0x421183){return db[_0xa770('0x22')][_0xa770('0x3a')]()['then'](respondWithResult(_0x421183,null))[_0xa770('0x28')](handleError(_0x421183,null));};exports[_0xa770('0x3b')]=function(_0x1e7b0b,_0x45a570){return db[_0xa770('0x3c')]['find']({'where':{'id':_0x1e7b0b[_0xa770('0x2c')]['id']}})[_0xa770('0x36')](handleEntityNotFound(_0x45a570,null))[_0xa770('0x36')](function(_0x58ab21){if(_0x58ab21){return _0x58ab21[_0xa770('0x3b')](_0x1e7b0b[_0xa770('0x38')][_0xa770('0x3d')],_[_0xa770('0x3e')](_0x1e7b0b[_0xa770('0x38')],[_0xa770('0x3d'),'id'])||{});}})[_0xa770('0x36')](respondWithResult(_0x45a570,null))['catch'](handleError(_0x45a570,null));};exports[_0xa770('0x3f')]=function(_0x2222d9,_0x10db17){var _0x2c4f3d={'raw':![],'where':{}};var _0x2470fa={};var _0xca050c={'count':0x0,'rows':[]};return db[_0xa770('0x22')][_0xa770('0x40')]({'where':{'id':_0x2222d9[_0xa770('0x2c')]['id']}})[_0xa770('0x36')](handleEntityNotFound(_0x10db17,null))[_0xa770('0x36')](function(_0x1ac516){if(_0x1ac516){_0x2470fa['model']=_[_0xa770('0x2e')](db[_0xa770('0x3c')]['rawAttributes']);_0x2470fa[_0xa770('0x2a')]=_[_0xa770('0x2e')](_0x2222d9['query']);_0x2470fa['filters']=_['intersection'](_0x2470fa['model'],_0x2470fa[_0xa770('0x2a')]);_0x2c4f3d[_0xa770('0x31')]=_[_0xa770('0x30')](_0x2470fa[_0xa770('0x2d')],qs[_0xa770('0x32')](_0x2222d9[_0xa770('0x2a')][_0xa770('0x32')]));_0x2c4f3d[_0xa770('0x31')]=_0x2c4f3d['attributes'][_0xa770('0x41')]?_0x2c4f3d[_0xa770('0x31')]:_0x2470fa['model'];if(!_0x2222d9[_0xa770('0x2a')][_0xa770('0x42')](_0xa770('0x43'))){_0x2c4f3d[_0xa770('0x16')]=qs['limit'](_0x2222d9[_0xa770('0x2a')]['limit']);_0x2c4f3d[_0xa770('0x18')]=qs['offset'](_0x2222d9[_0xa770('0x2a')][_0xa770('0x18')]);}_0x2c4f3d[_0xa770('0x44')]=qs[_0xa770('0x45')](_0x2222d9[_0xa770('0x2a')][_0xa770('0x45')]);_0x2c4f3d[_0xa770('0x46')]=qs['filters'](_['pick'](_0x2222d9[_0xa770('0x2a')],_0x2470fa[_0xa770('0x2f')]));_0x2c4f3d[_0xa770('0x46')][_0xa770('0x47')]=_0x1ac516['id'];if(_0x2222d9[_0xa770('0x2a')][_0xa770('0x48')]){_0x2c4f3d[_0xa770('0x46')]=_[_0xa770('0x34')](_0x2c4f3d['where'],{'$or':_[_0xa770('0x49')](_0x2c4f3d['attributes'],function(_0x1eab05){var _0x3f62c7={};_0x3f62c7[_0x1eab05]={'$like':'%'+_0x2222d9[_0xa770('0x2a')][_0xa770('0x48')]+'%'};return _0x3f62c7;})});}if(_0x2222d9[_0xa770('0x2a')]['$gte']){var _0x2647a3=_0x2222d9[_0xa770('0x2a')]['$gte'][_0xa770('0x4a')](',');var _0x36b13c={};_0x36b13c[_0x2647a3[0x0]]={'$gte':moment(_0x2647a3[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x2c4f3d[_0xa770('0x46')]=_['merge'](_0x2c4f3d['where'],_0x36b13c);}_0x2c4f3d=_['merge']({},_0x2c4f3d,_0x2222d9[_0xa770('0x35')]);return db[_0xa770('0x3c')][_0xa770('0x17')]({'where':_0x2c4f3d['where']})['then'](function(_0x1826d8){_0xca050c[_0xa770('0x17')]=_0x1826d8;if(_0x2222d9[_0xa770('0x2a')][_0xa770('0x33')]){_0x2c4f3d[_0xa770('0x4b')]=[{'all':!![]}];}return db[_0xa770('0x3c')]['findAll'](_0x2c4f3d);})[_0xa770('0x36')](function(_0x19c0b5){_0xca050c['rows']=_0x19c0b5;return _0xca050c;});}})[_0xa770('0x36')](respondWithFilteredResult(_0x10db17,_0x2c4f3d))['catch'](handleError(_0x10db17,null));};exports[_0xa770('0x4c')]=function(_0x3d85b6,_0x3970fa){return db[_0xa770('0x22')][_0xa770('0x39')]({'where':{'id':_0x3d85b6[_0xa770('0x2c')]['id']}})[_0xa770('0x36')](handleEntityNotFound(_0x3970fa,null))[_0xa770('0x36')](function(_0x8b26b){if(_0x8b26b){return _0x8b26b['setTags'](_0x3d85b6[_0xa770('0x38')][_0xa770('0x3d')],_['omit'](_0x3d85b6[_0xa770('0x38')],[_0xa770('0x3d'),'id'])||{})['spread'](function(){return db['Tag'][_0xa770('0x26')]({'attributes':['id',_0xa770('0x1f'),'color'],'where':{'id':_0x3d85b6[_0xa770('0x38')][_0xa770('0x3d')]}});})[_0xa770('0x36')](function(_0x4792d6){socket['emit']('openchannelInteractionTags:save',{'id':Number(_0x3d85b6[_0xa770('0x2c')]['id']),'tags':_0x4792d6||[]});return{'id':Number(_0x3d85b6[_0xa770('0x2c')]['id']),'tags':_0x4792d6||[]};});}})[_0xa770('0x36')](respondWithResult(_0x3970fa,null))[_0xa770('0x28')](handleError(_0x3970fa,null));};exports['removeTags']=function(_0x297de4,_0x1ea450){return db[_0xa770('0x22')][_0xa770('0x39')]({'where':{'id':_0x297de4['params']['id']}})['then'](handleEntityNotFound(_0x1ea450,null))[_0xa770('0x36')](function(_0x14263d){if(_0x14263d){return _0x14263d[_0xa770('0x4d')](_0x297de4[_0xa770('0x2a')]['ids']);}})[_0xa770('0x36')](respondWithStatusCode(_0x1ea450,null))['catch'](handleError(_0x1ea450,null));};exports['download']=function(_0x450c50,_0x6d223b){var _0x16c62c=moment()[_0xa770('0x4e')]()['toString']();var _0x52f1aa=path['join'](config[_0xa770('0x4f')],_0xa770('0x50'),_0xa770('0x51'),'tmp');var _0x22ffed=path['join'](config[_0xa770('0x4f')],_0xa770('0x50'),'files','attachments');var _0x2bb3c=path['join'](_0x52f1aa,_0x16c62c);var _0x238a51=util[_0xa770('0x52')](_0xa770('0x53'),_0x450c50[_0xa770('0x2c')]['id'],_0x16c62c);var _0xbee9be=path[_0xa770('0x54')](_0x52f1aa,_0x238a51);var _0x253ede=[];_0x253ede[_0xa770('0x55')]({'model':db[_0xa770('0x56')],'as':_0xa770('0x56'),'attributes':['id',_0xa770('0x57')],'raw':!![]});_0x253ede[_0xa770('0x55')]({'model':db['CmContact'],'as':_0xa770('0x58'),'attributes':['id',_0xa770('0x59'),_0xa770('0x5a')],'raw':!![]});if(_0x450c50[_0xa770('0x2a')][_0xa770('0x5b')]){_0x253ede[_0xa770('0x55')]({'model':db[_0xa770('0x5c')],'as':_0xa770('0x5c'),'raw':!![]});}var _0x125da9=[{'model':db['OpenchannelMessage'],'as':_0xa770('0x5d'),'attributes':['id',_0xa770('0x38'),_0xa770('0x5e'),'direction',_0xa770('0x5f'),_0xa770('0x60')],'include':_0x253ede}];_0x125da9[_0xa770('0x55')]({'model':db['OpenchannelAccount'],'as':'Account','attributes':['id','name']});_0x125da9[_0xa770('0x55')]({'model':db[_0xa770('0x56')],'as':_0xa770('0x61'),'attributes':['id',_0xa770('0x57')]});return db[_0xa770('0x22')][_0xa770('0x39')]({'where':{'id':_0x450c50[_0xa770('0x2c')]['id']},'include':_0x125da9})[_0xa770('0x36')](handleEntityNotFound(_0x6d223b,null))['then'](function(_0x4bd0f5){if(_0x4bd0f5){var _0x2ed003=_0x4bd0f5['get']({'plain':!![]});fs[_0xa770('0x62')](_0x2bb3c);var _0x177d1a={'channel':_0xa770('0x63'),'account':_0x2ed003[_0xa770('0x64')][_0xa770('0x1f')],'agent':_0x2ed003[_0xa770('0x61')]?_0x2ed003[_0xa770('0x61')][_0xa770('0x57')]:_0xa770('0x65'),'createdAt':moment(_0x2ed003['createdAt'])[_0xa770('0x52')](_0xa770('0x66'))[_0xa770('0x67')](),'closedAt':_0x2ed003[_0xa770('0x68')]?moment(_0x2ed003[_0xa770('0x69')])[_0xa770('0x52')](_0xa770('0x66'))['toString']():'','disposition':_0x2ed003[_0xa770('0x6a')],'visibility':_0x2ed003[_0xa770('0x6b')]?_0xa770('0x6c'):'Private','messages':_(_0x2ed003[_0xa770('0x5d')])['filter']({'secret':![]})[_0xa770('0x49')](function(_0x4ec12c){if(_0x4ec12c[_0xa770('0x5c')]){var _0x7f0a35=path['join'](_0x22ffed,_0x4ec12c[_0xa770('0x5c')][_0xa770('0x6d')]);if(fs['existsSync'](_0x7f0a35)){fs[_0xa770('0x6e')](_0x7f0a35)[_0xa770('0x6f')](fs['createWriteStream'](path[_0xa770('0x54')](_0x2bb3c,_0x4ec12c[_0xa770('0x5c')]['basename'])));}}return{'date':moment(_0x4ec12c[_0xa770('0x5e')])[_0xa770('0x52')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0x4ec12c[_0xa770('0x70')]===_0xa770('0x71')?_0x4ec12c['User']?_0x4ec12c['User'][_0xa770('0x57')]:_0xa770('0x72'):_0x4ec12c['Contact'][_0xa770('0x59')]+(_0x4ec12c[_0xa770('0x58')]['lastName']?'\x20'+_0x4ec12c['Contact'][_0xa770('0x5a')]:''),'body':_0x4ec12c[_0xa770('0x5c')]?_0x4ec12c['Attachment'][_0xa770('0x6d')]:_0x4ec12c['body'],'direction':_0x4ec12c[_0xa770('0x70')]===_0xa770('0x71')?'A':'C','secret':_0x4ec12c['secret'],'read':_0x4ec12c[_0xa770('0x60')],'attachment':_0x4ec12c[_0xa770('0x5c')]};})[_0xa770('0x73')]()};return ejs[_0xa770('0x74')](path['join'](config[_0xa770('0x4f')],_0xa770('0x50'),_0xa770('0x75'),'downloadInteraction.ejs'),{'interaction':_0x177d1a})['then'](function(_0x5924ed){var _0x305e7b=path['join'](_0x2bb3c,_0xa770('0x76')+_0x2ed003['id']+'-'+_0x16c62c+_0xa770('0x77'));var _0x1ec33b={'path':_0x305e7b,'channel':_0xa770('0x63'),'interactionId':_0x2ed003['id']};return pdf[_0xa770('0x78')](_0x5924ed,_0x1ec33b);})[_0xa770('0x36')](function(){return new Promise(function(_0x1ac88f,_0x317e67){zipdir(_0x2bb3c,{'saveTo':_0xbee9be},function(_0x12ee26,_0x498302){if(_0x12ee26)return _0x317e67(_0x12ee26);return _0x1ac88f(_0x498302);});})[_0xa770('0x36')](function(){return new Promise(function(_0x3a2c0b,_0x2e1325){rimraf(_0x2bb3c,function(_0x426eef){if(_0x426eef)_0x2e1325(_0x426eef);return _0x3a2c0b();});});})[_0xa770('0x36')](function(){return _0x6d223b[_0xa770('0x79')](_0xbee9be,_0x238a51,function(_0x502f8f){if(_0x502f8f){logger[_0xa770('0x1d')](_0xa770('0x7a'),_0x502f8f);}else{fs[_0xa770('0x7b')](_0xbee9be);}});});});}else{return _0x6d223b['sendStatus'](0xc8);}})[_0xa770('0x28')](handleError(_0x6d223b,null));}; \ No newline at end of file +var _0x620e=['openchannel','catch','show','query','from','params','keys','filters','intersection','model','attributes','length','includeAll','include','merge','options','create','body','update','find','describe','addMessage','OpenchannelMessage','omit','getMessages','findOne','fields','nolimit','offset','order','sort','pick','where','OpenchannelInteractionId','filter','$gte','format','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','setTags','ids','spread','color','emit','openchannelInteractionTags:save','removeTags','unix','toString','join','server','files','tmp','root','attachments','transcript-%d-%s.zip','push','User','Contact','firstName','Attachment','createdAt','direction','secret','read','OpenchannelAccount','Account','Owner','fullname','mkdirSync','N.A.','closed','threadId','Public','Private','Messages','basename','existsSync','createReadStream','pipe','createWriteStream','lastName','value','renderFile','views','downloadInteraction.ejs','.pdf','Openchannel','createPdfFromHTML','download','Unable\x20to\x20delete\x20zip\x20file','rimraf','moment','util','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','status','end','json','undefined','limit','count','set','Content-Range','then','destroy','stack','name','send','index','map','OpenchannelInteraction','rawAttributes','fieldName','type','key','getOptions','findAll'];(function(_0x177d46,_0x2dd37f){var _0x3c18af=function(_0x5ba1f1){while(--_0x5ba1f1){_0x177d46['push'](_0x177d46['shift']());}};_0x3c18af(++_0x2dd37f);}(_0x620e,0x161));var _0xe620=function(_0x1b2a87,_0x1f3502){_0x1b2a87=_0x1b2a87-0x0;var _0x186e90=_0x620e[_0x1b2a87];return _0x186e90;};'use strict';var rimraf=require(_0xe620('0x0'));var zipdir=require('zip-dir');var moment=require(_0xe620('0x1'));var util=require(_0xe620('0x2'));var path=require('path');var ejs=require(_0xe620('0x3'));var fs=require('fs');var _=require(_0xe620('0x4'));var Redis=require(_0xe620('0x5'));var interaction=require(_0xe620('0x6'));var qs=require(_0xe620('0x7'));var pdf=require(_0xe620('0x8'));var logger=require(_0xe620('0x9'))('api');var config=require('../../config/environment');var db=require(_0xe620('0xa'))['db'];config[_0xe620('0xb')]=_[_0xe620('0xc')](config['redis'],{'host':_0xe620('0xd'),'port':0x18eb});var socket=require(_0xe620('0xe'))(new Redis(config[_0xe620('0xb')]));require(_0xe620('0xf'))[_0xe620('0x10')](socket);function respondWithStatusCode(_0x1a8e04,_0x14efa0){_0x14efa0=_0x14efa0||0xcc;return function(_0x4b9baa){if(_0x4b9baa){return _0x1a8e04[_0xe620('0x11')](_0x14efa0);}return _0x1a8e04[_0xe620('0x12')](_0x14efa0)[_0xe620('0x13')]();};}function respondWithResult(_0x4f4730,_0x285fe0){_0x285fe0=_0x285fe0||0xc8;return function(_0x1fd196){if(_0x1fd196){return _0x4f4730[_0xe620('0x12')](_0x285fe0)[_0xe620('0x14')](_0x1fd196);}};}function respondWithFilteredResult(_0xfd6123,_0x58b6dc){return function(_0x569928){if(_0x569928){var _0x278d52=typeof _0x58b6dc['offset']===_0xe620('0x15')&&typeof _0x58b6dc[_0xe620('0x16')]==='undefined';var _0x5a3633=_0x569928[_0xe620('0x17')];var _0x28faf7=_0x278d52?0x0:_0x58b6dc['offset'];var _0x5e98e1=_0x278d52?_0x569928[_0xe620('0x17')]:_0x58b6dc['offset']+_0x58b6dc[_0xe620('0x16')];var _0x446266;if(_0x5e98e1>=_0x5a3633){_0x5e98e1=_0x5a3633;_0x446266=0xc8;}else{_0x446266=0xce;}_0xfd6123[_0xe620('0x12')](_0x446266);return _0xfd6123[_0xe620('0x18')](_0xe620('0x19'),_0x28faf7+'-'+_0x5e98e1+'/'+_0x5a3633)[_0xe620('0x14')](_0x569928);}return null;};}function saveUpdates(_0x1903e1){return function(_0x4019c8){if(_0x4019c8){return _0x4019c8['update'](_0x1903e1)[_0xe620('0x1a')](function(_0x1be474){return _0x1be474;});}return null;};}function removeEntity(_0x38bee2){return function(_0x5ebfe9){if(_0x5ebfe9){return _0x5ebfe9[_0xe620('0x1b')]()[_0xe620('0x1a')](function(){_0x38bee2[_0xe620('0x12')](0xcc)[_0xe620('0x13')]();});}};}function handleEntityNotFound(_0x143e19){return function(_0x48d539){if(!_0x48d539){_0x143e19[_0xe620('0x11')](0x194);}return _0x48d539;};}function handleError(_0x2dade3,_0x44319a){_0x44319a=_0x44319a||0x1f4;return function(_0x5b2b15){logger['error'](_0x5b2b15[_0xe620('0x1c')]);if(_0x5b2b15[_0xe620('0x1d')]){delete _0x5b2b15[_0xe620('0x1d')];}_0x2dade3[_0xe620('0x12')](_0x44319a)[_0xe620('0x1e')](_0x5b2b15);};}exports[_0xe620('0x1f')]=function(_0x3d8df2,_0xb3c40d){var _0x2a8fcb={};var _0x3e5549=_[_0xe620('0x20')](db[_0xe620('0x21')][_0xe620('0x22')],function(_0x459e82){return{'name':_0x459e82[_0xe620('0x23')],'type':_0x459e82[_0xe620('0x24')][_0xe620('0x25')]};});_0x2a8fcb=qs[_0xe620('0x26')](_0x3e5549,_0x3d8df2);return interaction[_0xe620('0x27')](_0xe620('0x28'),_0x3d8df2['query'],_0x3d8df2['user'],_0x2a8fcb,_0x3e5549)['then'](respondWithFilteredResult(_0xb3c40d,_0x2a8fcb))[_0xe620('0x29')](handleError(_0xb3c40d,null));};exports[_0xe620('0x2a')]=function(_0x296061,_0x52e819){var _0x2a958f={};if(_0x296061[_0xe620('0x2b')][_0xe620('0x24')]&&_0x296061['query'][_0xe620('0x24')]===_0xe620('0x2c')){_0x2a958f[_0xe620('0x2c')]=_0x296061[_0xe620('0x2d')]['id'];}else{_0x2a958f['id']=_0x296061[_0xe620('0x2d')]['id'];}var _0x2927ee={'raw':![],'where':_0x2a958f},_0x3c3e62={};_0x3c3e62['model']=_[_0xe620('0x2e')](db[_0xe620('0x21')][_0xe620('0x22')]);_0x3c3e62[_0xe620('0x2b')]=_[_0xe620('0x2e')](_0x296061['query']);_0x3c3e62[_0xe620('0x2f')]=_[_0xe620('0x30')](_0x3c3e62[_0xe620('0x31')],_0x3c3e62[_0xe620('0x2b')]);_0x2927ee[_0xe620('0x32')]=_[_0xe620('0x30')](_0x3c3e62[_0xe620('0x31')],qs['fields'](_0x296061[_0xe620('0x2b')]['fields']));_0x2927ee[_0xe620('0x32')]=_0x2927ee[_0xe620('0x32')][_0xe620('0x33')]?_0x2927ee[_0xe620('0x32')]:_0x3c3e62['model'];if(_0x296061[_0xe620('0x2b')][_0xe620('0x34')]){_0x2927ee[_0xe620('0x35')]=[{'all':!![]}];}_0x2927ee=_[_0xe620('0x36')]({},_0x2927ee,_0x296061[_0xe620('0x37')]);return db[_0xe620('0x21')]['find'](_0x2927ee)[_0xe620('0x1a')](handleEntityNotFound(_0x52e819,null))[_0xe620('0x1a')](respondWithResult(_0x52e819,null))[_0xe620('0x29')](handleError(_0x52e819,null));};exports[_0xe620('0x38')]=function(_0x52313a,_0x2901b1){return db[_0xe620('0x21')][_0xe620('0x38')](_0x52313a[_0xe620('0x39')],{})[_0xe620('0x1a')](respondWithResult(_0x2901b1,0xc9))[_0xe620('0x29')](handleError(_0x2901b1,null));};exports[_0xe620('0x3a')]=function(_0x4815fc,_0x361e8e){if(_0x4815fc[_0xe620('0x39')]['id']){delete _0x4815fc['body']['id'];}return db[_0xe620('0x21')][_0xe620('0x3b')]({'where':{'id':_0x4815fc['params']['id']}})['then'](handleEntityNotFound(_0x361e8e,null))[_0xe620('0x1a')](saveUpdates(_0x4815fc[_0xe620('0x39')],null))['then'](respondWithResult(_0x361e8e,null))['catch'](handleError(_0x361e8e,null));};exports[_0xe620('0x1b')]=function(_0x18a39b,_0x5670f5){return db['OpenchannelInteraction']['find']({'where':{'id':_0x18a39b[_0xe620('0x2d')]['id']}})[_0xe620('0x1a')](handleEntityNotFound(_0x5670f5,null))[_0xe620('0x1a')](removeEntity(_0x5670f5,null))[_0xe620('0x29')](handleError(_0x5670f5,null));};exports[_0xe620('0x3c')]=function(_0x2e252e,_0x1411ab){return db['OpenchannelInteraction'][_0xe620('0x3c')]()[_0xe620('0x1a')](respondWithResult(_0x1411ab,null))[_0xe620('0x29')](handleError(_0x1411ab,null));};exports[_0xe620('0x3d')]=function(_0x1ea94c,_0x1007c3){return db[_0xe620('0x3e')][_0xe620('0x3b')]({'where':{'id':_0x1ea94c[_0xe620('0x2d')]['id']}})[_0xe620('0x1a')](handleEntityNotFound(_0x1007c3,null))[_0xe620('0x1a')](function(_0x414b78){if(_0x414b78){return _0x414b78[_0xe620('0x3d')](_0x1ea94c['body']['ids'],_[_0xe620('0x3f')](_0x1ea94c[_0xe620('0x39')],['ids','id'])||{});}})[_0xe620('0x1a')](respondWithResult(_0x1007c3,null))[_0xe620('0x29')](handleError(_0x1007c3,null));};exports[_0xe620('0x40')]=function(_0x1a20c0,_0x47c24c){var _0x2df9a8={'raw':![],'where':{}};var _0x4705bb={};var _0x1b5774={'count':0x0,'rows':[]};return db[_0xe620('0x21')][_0xe620('0x41')]({'where':{'id':_0x1a20c0[_0xe620('0x2d')]['id']}})[_0xe620('0x1a')](handleEntityNotFound(_0x47c24c,null))[_0xe620('0x1a')](function(_0x1311a8){if(_0x1311a8){_0x4705bb[_0xe620('0x31')]=_[_0xe620('0x2e')](db[_0xe620('0x3e')][_0xe620('0x22')]);_0x4705bb[_0xe620('0x2b')]=_['keys'](_0x1a20c0[_0xe620('0x2b')]);_0x4705bb['filters']=_['intersection'](_0x4705bb[_0xe620('0x31')],_0x4705bb[_0xe620('0x2b')]);_0x2df9a8[_0xe620('0x32')]=_[_0xe620('0x30')](_0x4705bb['model'],qs['fields'](_0x1a20c0[_0xe620('0x2b')][_0xe620('0x42')]));_0x2df9a8[_0xe620('0x32')]=_0x2df9a8[_0xe620('0x32')][_0xe620('0x33')]?_0x2df9a8[_0xe620('0x32')]:_0x4705bb[_0xe620('0x31')];if(!_0x1a20c0[_0xe620('0x2b')]['hasOwnProperty'](_0xe620('0x43'))){_0x2df9a8[_0xe620('0x16')]=qs[_0xe620('0x16')](_0x1a20c0['query'][_0xe620('0x16')]);_0x2df9a8[_0xe620('0x44')]=qs[_0xe620('0x44')](_0x1a20c0[_0xe620('0x2b')]['offset']);}_0x2df9a8[_0xe620('0x45')]=qs[_0xe620('0x46')](_0x1a20c0[_0xe620('0x2b')][_0xe620('0x46')]);_0x2df9a8['where']=qs['filters'](_[_0xe620('0x47')](_0x1a20c0[_0xe620('0x2b')],_0x4705bb[_0xe620('0x2f')]));_0x2df9a8[_0xe620('0x48')][_0xe620('0x49')]=_0x1311a8['id'];if(_0x1a20c0['query'][_0xe620('0x4a')]){_0x2df9a8[_0xe620('0x48')]=_[_0xe620('0x36')](_0x2df9a8['where'],{'$or':_[_0xe620('0x20')](_0x2df9a8[_0xe620('0x32')],function(_0x4a97ed){var _0x5aa191={};_0x5aa191[_0x4a97ed]={'$like':'%'+_0x1a20c0['query'][_0xe620('0x4a')]+'%'};return _0x5aa191;})});}if(_0x1a20c0['query'][_0xe620('0x4b')]){var _0x3b2ade=_0x1a20c0[_0xe620('0x2b')]['$gte']['split'](',');var _0x221277={};_0x221277[_0x3b2ade[0x0]]={'$gte':moment(_0x3b2ade[0x1])[_0xe620('0x4c')](_0xe620('0x4d'))};_0x2df9a8[_0xe620('0x48')]=_[_0xe620('0x36')](_0x2df9a8['where'],_0x221277);}_0x2df9a8=_[_0xe620('0x36')]({},_0x2df9a8,_0x1a20c0[_0xe620('0x37')]);return db[_0xe620('0x3e')][_0xe620('0x17')]({'where':_0x2df9a8[_0xe620('0x48')]})[_0xe620('0x1a')](function(_0x5304db){_0x1b5774[_0xe620('0x17')]=_0x5304db;if(_0x1a20c0[_0xe620('0x2b')][_0xe620('0x34')]){_0x2df9a8[_0xe620('0x35')]=[{'all':!![]}];}return db['OpenchannelMessage']['findAll'](_0x2df9a8);})[_0xe620('0x1a')](function(_0x284faa){_0x1b5774[_0xe620('0x4e')]=_0x284faa;return _0x1b5774;});}})[_0xe620('0x1a')](respondWithFilteredResult(_0x47c24c,_0x2df9a8))['catch'](handleError(_0x47c24c,null));};exports[_0xe620('0x4f')]=function(_0x1435cc,_0x59aa34){return db[_0xe620('0x21')][_0xe620('0x3b')]({'where':{'id':_0x1435cc[_0xe620('0x2d')]['id']}})['then'](handleEntityNotFound(_0x59aa34,null))[_0xe620('0x1a')](function(_0x350ccb){if(_0x350ccb){return _0x350ccb[_0xe620('0x50')](_0x1435cc[_0xe620('0x39')][_0xe620('0x51')],_[_0xe620('0x3f')](_0x1435cc[_0xe620('0x39')],[_0xe620('0x51'),'id'])||{})[_0xe620('0x52')](function(){return db['Tag'][_0xe620('0x27')]({'attributes':['id',_0xe620('0x1d'),_0xe620('0x53')],'where':{'id':_0x1435cc[_0xe620('0x39')][_0xe620('0x51')]}});})['then'](function(_0x2a6b26){socket[_0xe620('0x54')](_0xe620('0x55'),{'id':Number(_0x1435cc[_0xe620('0x2d')]['id']),'tags':_0x2a6b26||[]});return{'id':Number(_0x1435cc[_0xe620('0x2d')]['id']),'tags':_0x2a6b26||[]};});}})[_0xe620('0x1a')](respondWithResult(_0x59aa34,null))[_0xe620('0x29')](handleError(_0x59aa34,null));};exports['removeTags']=function(_0x296612,_0x4a5746){return db[_0xe620('0x21')][_0xe620('0x3b')]({'where':{'id':_0x296612[_0xe620('0x2d')]['id']}})['then'](handleEntityNotFound(_0x4a5746,null))[_0xe620('0x1a')](function(_0x350330){if(_0x350330){return _0x350330[_0xe620('0x56')](_0x296612['query'][_0xe620('0x51')]);}})[_0xe620('0x1a')](respondWithStatusCode(_0x4a5746,null))['catch'](handleError(_0x4a5746,null));};exports['download']=function(_0x2c4dd3,_0x141f52){var _0x1c4269=moment()[_0xe620('0x57')]()[_0xe620('0x58')]();var _0x176b22=path[_0xe620('0x59')](config['root'],_0xe620('0x5a'),_0xe620('0x5b'),_0xe620('0x5c'));var _0x1e14d2=path[_0xe620('0x59')](config[_0xe620('0x5d')],_0xe620('0x5a'),'files',_0xe620('0x5e'));var _0x46c2fd=path[_0xe620('0x59')](_0x176b22,_0x1c4269);var _0x14e97e=util['format'](_0xe620('0x5f'),_0x2c4dd3[_0xe620('0x2d')]['id'],_0x1c4269);var _0xcfc284=path[_0xe620('0x59')](_0x176b22,_0x14e97e);var _0x1b57da=[];_0x1b57da[_0xe620('0x60')]({'model':db[_0xe620('0x61')],'as':_0xe620('0x61'),'attributes':['id','fullname'],'raw':!![]});_0x1b57da['push']({'model':db['CmContact'],'as':_0xe620('0x62'),'attributes':['id',_0xe620('0x63'),'lastName'],'raw':!![]});if(_0x2c4dd3[_0xe620('0x2b')]['attachments']){_0x1b57da[_0xe620('0x60')]({'model':db[_0xe620('0x64')],'as':_0xe620('0x64'),'raw':!![]});}var _0x58302d=[{'model':db[_0xe620('0x3e')],'as':'Messages','attributes':['id',_0xe620('0x39'),_0xe620('0x65'),_0xe620('0x66'),_0xe620('0x67'),_0xe620('0x68')],'include':_0x1b57da}];_0x58302d[_0xe620('0x60')]({'model':db[_0xe620('0x69')],'as':_0xe620('0x6a'),'attributes':['id',_0xe620('0x1d')]});_0x58302d['push']({'model':db['User'],'as':_0xe620('0x6b'),'attributes':['id',_0xe620('0x6c')]});return db[_0xe620('0x21')]['find']({'where':{'id':_0x2c4dd3[_0xe620('0x2d')]['id']},'include':_0x58302d})[_0xe620('0x1a')](handleEntityNotFound(_0x141f52,null))['then'](function(_0x66e35c){if(_0x66e35c){var _0x3bbdd1=_0x66e35c['get']({'plain':!![]});fs[_0xe620('0x6d')](_0x46c2fd);var _0x4002a1={'channel':'Openchannel','account':_0x3bbdd1[_0xe620('0x6a')][_0xe620('0x1d')],'agent':_0x3bbdd1['Owner']?_0x3bbdd1[_0xe620('0x6b')][_0xe620('0x6c')]:_0xe620('0x6e'),'createdAt':moment(_0x3bbdd1['createdAt'])[_0xe620('0x4c')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x3bbdd1[_0xe620('0x6f')]?moment(_0x3bbdd1['closedAt'])[_0xe620('0x4c')](_0xe620('0x4d'))['toString']():'','disposition':_0x3bbdd1['disposition'],'visibility':_0x3bbdd1[_0xe620('0x70')]?_0xe620('0x71'):_0xe620('0x72'),'messages':_(_0x3bbdd1[_0xe620('0x73')])[_0xe620('0x4a')]({'secret':![]})['map'](function(_0x3aa11c){if(_0x3aa11c[_0xe620('0x64')]){var _0x588dd4=path[_0xe620('0x59')](_0x1e14d2,_0x3aa11c[_0xe620('0x64')][_0xe620('0x74')]);if(fs[_0xe620('0x75')](_0x588dd4)){fs[_0xe620('0x76')](_0x588dd4)[_0xe620('0x77')](fs[_0xe620('0x78')](path[_0xe620('0x59')](_0x46c2fd,_0x3aa11c[_0xe620('0x64')][_0xe620('0x74')])));}}return{'date':moment(_0x3aa11c['createdAt'])[_0xe620('0x4c')](_0xe620('0x4d'))[_0xe620('0x58')](),'sender':_0x3aa11c[_0xe620('0x66')]==='out'?_0x3aa11c[_0xe620('0x61')]?_0x3aa11c['User'][_0xe620('0x6c')]:'System':_0x3aa11c[_0xe620('0x62')][_0xe620('0x63')]+(_0x3aa11c[_0xe620('0x62')][_0xe620('0x79')]?'\x20'+_0x3aa11c[_0xe620('0x62')][_0xe620('0x79')]:''),'body':_0x3aa11c['Attachment']?_0x3aa11c['Attachment'][_0xe620('0x74')]:_0x3aa11c[_0xe620('0x39')],'direction':_0x3aa11c[_0xe620('0x66')]==='out'?'A':'C','secret':_0x3aa11c[_0xe620('0x67')],'read':_0x3aa11c[_0xe620('0x68')],'attachment':_0x3aa11c[_0xe620('0x64')]};})[_0xe620('0x7a')]()};return ejs[_0xe620('0x7b')](path[_0xe620('0x59')](config[_0xe620('0x5d')],_0xe620('0x5a'),_0xe620('0x7c'),_0xe620('0x7d')),{'interaction':_0x4002a1})['then'](function(_0x15dd7c){var _0x243141=path['join'](_0x46c2fd,'transcript-'+_0x3bbdd1['id']+'-'+_0x1c4269+_0xe620('0x7e'));var _0x1dc29e={'path':_0x243141,'channel':_0xe620('0x7f'),'interactionId':_0x3bbdd1['id']};return pdf[_0xe620('0x80')](_0x15dd7c,_0x1dc29e);})[_0xe620('0x1a')](function(){return new Promise(function(_0x34f349,_0x2509f7){zipdir(_0x46c2fd,{'saveTo':_0xcfc284},function(_0x4acda8,_0x343cca){if(_0x4acda8)return _0x2509f7(_0x4acda8);return _0x34f349(_0x343cca);});})['then'](function(){return new Promise(function(_0x12029e,_0x417ae5){rimraf(_0x46c2fd,function(_0x5d5fc9){if(_0x5d5fc9)_0x417ae5(_0x5d5fc9);return _0x12029e();});});})[_0xe620('0x1a')](function(){return _0x141f52[_0xe620('0x81')](_0xcfc284,_0x14e97e,function(_0x35f0aa){if(_0x35f0aa){logger['error'](_0xe620('0x82'),_0x35f0aa);}else{fs['unlinkSync'](_0xcfc284);}});});});}else{return _0x141f52[_0xe620('0x11')](0xc8);}})[_0xe620('0x29')](handleError(_0x141f52,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 3cd239d..dbad29f 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 _0xff60=['catch','hasOwnProperty','exports','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','update','remove','getUsers','then','setDataValue','map','findAll','length','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xff60,0xa8));var _0x0ff6=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xff60[_0x5b561d];return _0x431060;};'use strict';var EventEmitter=require('events');var OpenchannelInteraction=require(_0x0ff6('0x0'))['db'][_0x0ff6('0x1')];var OpenchannelMessage=require(_0x0ff6('0x0'))['db'][_0x0ff6('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x0ff6('0x3'),'afterDestroy':_0x0ff6('0x4')};function emitEvent(_0x7de9a5){return function(_0x2c2dae,_0x2796c3,_0x573700){_0x2c2dae[_0x0ff6('0x5')]({'attributes':['id'],'raw':!![]})[_0x0ff6('0x6')](function(_0x463f06){_0x2c2dae[_0x0ff6('0x7')]('Users',_0x463f06[_0x0ff6('0x8')](function(_0x5b60cb){return{'id':_0x5b60cb['id']};}));return OpenchannelMessage[_0x0ff6('0x9')]({'where':{'OpenchannelInteractionId':_0x2c2dae['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x564964){_0x2c2dae[_0x0ff6('0x7')]('unreadMessages',_0x564964[_0x0ff6('0xa')]);OpenchannelInteractionEvents[_0x0ff6('0xb')](_0x7de9a5+':'+_0x2c2dae['id'],_0x2c2dae);OpenchannelInteractionEvents[_0x0ff6('0xb')](_0x7de9a5,_0x2c2dae);_0x573700(null);})[_0x0ff6('0xc')](_0x573700(null));};}for(var e in events){if(events[_0x0ff6('0xd')](e)){var event=events[e];OpenchannelInteraction['hook'](e,emitEvent(event));}}module[_0x0ff6('0xe')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0x613e=['emit','catch','hasOwnProperty','hook','exports','OpenchannelInteraction','../../mysqldb','setMaxListeners','update','remove','getUsers','then','setDataValue','map'];(function(_0x2a558d,_0x2df0ff){var _0xa7bc9c=function(_0x12a30e){while(--_0x12a30e){_0x2a558d['push'](_0x2a558d['shift']());}};_0xa7bc9c(++_0x2df0ff);}(_0x613e,0xbb));var _0xe613=function(_0x39f2d0,_0x219bd2){_0x39f2d0=_0x39f2d0-0x0;var _0xf026a2=_0x613e[_0x39f2d0];return _0xf026a2;};'use strict';var EventEmitter=require('events');var OpenchannelInteraction=require('../../mysqldb')['db'][_0xe613('0x0')];var OpenchannelMessage=require(_0xe613('0x1'))['db']['OpenchannelMessage'];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xe613('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xe613('0x3'),'afterDestroy':_0xe613('0x4')};function emitEvent(_0x5c2896){return function(_0x5dbbf4,_0x28f091,_0x4933ad){_0x5dbbf4[_0xe613('0x5')]({'attributes':['id'],'raw':!![]})[_0xe613('0x6')](function(_0x43526a){_0x5dbbf4[_0xe613('0x7')]('Users',_0x43526a[_0xe613('0x8')](function(_0x9fb215){return{'id':_0x9fb215['id']};}));return OpenchannelMessage['findAll']({'where':{'OpenchannelInteractionId':_0x5dbbf4['id'],'direction':'in','read':![]},'raw':!![]});})[_0xe613('0x6')](function(_0x389c97){_0x5dbbf4['setDataValue']('unreadMessages',_0x389c97['length']);OpenchannelInteractionEvents[_0xe613('0x9')](_0x5c2896+':'+_0x5dbbf4['id'],_0x5dbbf4);OpenchannelInteractionEvents['emit'](_0x5c2896,_0x5dbbf4);_0x4933ad(null);})[_0xe613('0xa')](_0x4933ad(null));};}for(var e in events){if(events[_0xe613('0xb')](e)){var event=events[e];OpenchannelInteraction[_0xe613('0xc')](e,emitEvent(event));}}module[_0xe613('0xd')]=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index 41e8573..5d4ee4c 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 _0xf354=['utf8mb4_unicode_ci','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','moment','bluebird','path','../../config/environment','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','openchannel_interactions','utf8mb4'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf354,0x9e));var _0x4f35=function(_0x4f57dc,_0x503718){_0x4f57dc=_0x4f57dc-0x0;var _0x42ea1a=_0xf354[_0x4f57dc];return _0x42ea1a;};'use strict';var _=require('lodash');var util=require(_0x4f35('0x0'));var logger=require(_0x4f35('0x1'))('api');var moment=require(_0x4f35('0x2'));var BPromise=require(_0x4f35('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4f35('0x4'));var rimraf=require('rimraf');var config=require(_0x4f35('0x5'));var attributes=require(_0x4f35('0x6'));module[_0x4f35('0x7')]=function(_0x1468c0,_0x2cbc46){return _0x1468c0[_0x4f35('0x8')](_0x4f35('0x9'),attributes,{'tableName':_0x4f35('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4f35('0xb'),'collate':_0x4f35('0xc'),'hooks':{'beforeUpdate':function(_0x415406,_0x2a207d,_0x4addad){if(_0x415406['changed'](_0x4f35('0xd'))){_0x415406[_0x4f35('0xe')]=moment()[_0x4f35('0xf')](_0x4f35('0x10'));}_0x4addad(null,_0x415406);}}});}; \ No newline at end of file +var _0x6cd1=['closedAt','format','lodash','util','../../config/logger','bluebird','rimraf','../../config/environment','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','openchannel_interactions','utf8mb4_unicode_ci','closed'];(function(_0x41e507,_0x694b79){var _0x3bbe37=function(_0x2df851){while(--_0x2df851){_0x41e507['push'](_0x41e507['shift']());}};_0x3bbe37(++_0x694b79);}(_0x6cd1,0x1c4));var _0x16cd=function(_0xacb1e2,_0x55e0ab){_0xacb1e2=_0xacb1e2-0x0;var _0x463815=_0x6cd1[_0xacb1e2];return _0x463815;};'use strict';var _=require(_0x16cd('0x0'));var util=require(_0x16cd('0x1'));var logger=require(_0x16cd('0x2'))('api');var moment=require('moment');var BPromise=require(_0x16cd('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x16cd('0x4'));var config=require(_0x16cd('0x5'));var attributes=require(_0x16cd('0x6'));module[_0x16cd('0x7')]=function(_0x535274,_0x40941d){return _0x535274[_0x16cd('0x8')](_0x16cd('0x9'),attributes,{'tableName':_0x16cd('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x16cd('0xb'),'hooks':{'beforeUpdate':function(_0x573e56,_0x5257e1,_0x4b953d){if(_0x573e56['changed'](_0x16cd('0xc'))){_0x573e56[_0x16cd('0xd')]=moment()[_0x16cd('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x4b953d(null,_0x573e56);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index 27e0ca5..bf5be63 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 _0x796a=['code','message','OpenchannelInteraction,\x20%s,\x20%s','result','UpdateOpenchannelInteraction','OpenchannelInteraction','update','options','raw','where','attributes','limit','then','debug','catch','addTags','body','ids','AddTags','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','defaults','redis','localhost','./openchannelInteraction.socket','register','info','request\x20sent','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3c380b,_0x550ea5){var _0x49965c=function(_0x4d3971){while(--_0x4d3971){_0x3c380b['push'](_0x3c380b['shift']());}};_0x49965c(++_0x550ea5);}(_0x796a,0xfd));var _0xa796=function(_0x20d7b2,_0x1cd564){_0x20d7b2=_0x20d7b2-0x0;var _0x483991=_0x796a[_0x20d7b2];return _0x483991;};'use strict';var _=require(_0xa796('0x0'));var util=require(_0xa796('0x1'));var moment=require('moment');var BPromise=require(_0xa796('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa796('0x3'));var db=require(_0xa796('0x4'))['db'];var utils=require(_0xa796('0x5'));var logger=require('../../config/logger')(_0xa796('0x6'));var config=require('../../config/environment');var jayson=require(_0xa796('0x7'));var client=jayson[_0xa796('0x8')][_0xa796('0x9')]({'port':0x232a});config['redis']=_[_0xa796('0xa')](config[_0xa796('0xb')],{'host':_0xa796('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa796('0xb')]));require(_0xa796('0xd'))[_0xa796('0xe')](socket);function respondWithRpcPromise(_0x2f950e,_0x39710c,_0x3e2e2e){return new BPromise(function(_0x5b2378,_0x1b3eff){return client['request'](_0x2f950e,_0x3e2e2e)['then'](function(_0x29b365){logger[_0xa796('0xf')]('OpenchannelInteraction,\x20%s,\x20%s',_0x39710c,_0xa796('0x10'));logger['debug'](_0xa796('0x11'),_0x39710c,_0xa796('0x10'),JSON[_0xa796('0x12')](_0x29b365));if(_0x29b365[_0xa796('0x13')]){if(_0x29b365['error'][_0xa796('0x14')]===0x1f4){logger[_0xa796('0x13')]('OpenchannelInteraction,\x20%s,\x20%s',_0x39710c,_0x29b365[_0xa796('0x13')][_0xa796('0x15')]);return _0x1b3eff(_0x29b365['error'][_0xa796('0x15')]);}logger[_0xa796('0x13')](_0xa796('0x16'),_0x39710c,_0x29b365[_0xa796('0x13')]['message']);return _0x5b2378(_0x29b365[_0xa796('0x13')][_0xa796('0x15')]);}else{logger['info']('OpenchannelInteraction,\x20%s,\x20%s',_0x39710c,_0xa796('0x10'));_0x5b2378(_0x29b365[_0xa796('0x17')][_0xa796('0x15')]);}})['catch'](function(_0x408fdd){logger[_0xa796('0x13')](_0xa796('0x16'),_0x39710c,_0x408fdd);_0x1b3eff(_0x408fdd);});});}exports[_0xa796('0x18')]=function(_0x1363c2){var _0x1d9730=this;return new Promise(function(_0x40e300,_0x25e4c9){return db[_0xa796('0x19')][_0xa796('0x1a')](_0x1363c2['body'],{'raw':_0x1363c2[_0xa796('0x1b')]?_0x1363c2[_0xa796('0x1b')][_0xa796('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1363c2[_0xa796('0x1b')]?_0x1363c2[_0xa796('0x1b')][_0xa796('0x1d')]||null:null,'attributes':_0x1363c2[_0xa796('0x1b')]?_0x1363c2[_0xa796('0x1b')][_0xa796('0x1e')]||null:null,'limit':_0x1363c2[_0xa796('0x1b')]?_0x1363c2['options'][_0xa796('0x1f')]||null:null})[_0xa796('0x20')](function(_0x5e886d){logger[_0xa796('0xf')](_0xa796('0x18'),_0x1363c2);logger[_0xa796('0x21')](_0xa796('0x18'),_0x1363c2,JSON['stringify'](_0x5e886d));_0x40e300(_0x5e886d);})[_0xa796('0x22')](function(_0x5ccf2d){logger['error'](_0xa796('0x18'),_0x5ccf2d['message'],_0x1363c2);_0x25e4c9(_0x1d9730[_0xa796('0x13')](0x1f4,_0x5ccf2d['message']));});});};exports['AddTagsToOpenchannelInteraction']=function(_0x350c79){return new Promise(function(_0x27f99c,_0x4568e0){return db[_0xa796('0x19')]['find']({'where':_0x350c79['options']?_0x350c79[_0xa796('0x1b')][_0xa796('0x1d')]||null:null})[_0xa796('0x20')](function(_0x17dc0f){if(_0x17dc0f){return _0x17dc0f[_0xa796('0x23')](_0x350c79[_0xa796('0x24')]['ids'],_['omit'](_0x350c79['body'],[_0xa796('0x25'),'id'])||{});}})['spread'](function(_0x26cdcb){logger[_0xa796('0xf')](_0xa796('0x26'),_0x350c79);logger[_0xa796('0x21')](_0xa796('0x26'),_0x350c79,JSON[_0xa796('0x12')](_0x26cdcb));_0x27f99c(_0x26cdcb);})['catch'](function(_0x22f482){logger[_0xa796('0x13')](_0xa796('0x26'),_0x22f482[_0xa796('0x15')],_0x350c79);_0x4568e0(_this[_0xa796('0x13')](0x1f4,_0x22f482[_0xa796('0x15')]));});});}; \ No newline at end of file +var _0x6039=['body','AddTags','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','options','raw','where','attributes','limit','AddTagsToOpenchannelInteraction','find','addTags','ids'];(function(_0x23f5ae,_0x2a6e8f){var _0x3c426f=function(_0x53b83c){while(--_0x53b83c){_0x23f5ae['push'](_0x23f5ae['shift']());}};_0x3c426f(++_0x2a6e8f);}(_0x6039,0xae));var _0x9603=function(_0x3eecb2,_0x5c5bb5){_0x3eecb2=_0x3eecb2-0x0;var _0x5e86ef=_0x6039[_0x3eecb2];return _0x5e86ef;};'use strict';var _=require('lodash');var util=require(_0x9603('0x0'));var moment=require(_0x9603('0x1'));var BPromise=require('bluebird');var rs=require(_0x9603('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9603('0x3'))['db'];var utils=require(_0x9603('0x4'));var logger=require(_0x9603('0x5'))('rpc');var config=require(_0x9603('0x6'));var jayson=require(_0x9603('0x7'));var client=jayson[_0x9603('0x8')][_0x9603('0x9')]({'port':0x232a});config[_0x9603('0xa')]=_[_0x9603('0xb')](config[_0x9603('0xa')],{'host':_0x9603('0xc'),'port':0x18eb});var socket=require(_0x9603('0xd'))(new Redis(config[_0x9603('0xa')]));require(_0x9603('0xe'))[_0x9603('0xf')](socket);function respondWithRpcPromise(_0x4d2c90,_0x27da15,_0x11ef32){return new BPromise(function(_0x242167,_0x29a413){return client[_0x9603('0x10')](_0x4d2c90,_0x11ef32)[_0x9603('0x11')](function(_0x6d4a66){logger[_0x9603('0x12')](_0x9603('0x13'),_0x27da15,_0x9603('0x14'));logger[_0x9603('0x15')](_0x9603('0x16'),_0x27da15,_0x9603('0x14'),JSON[_0x9603('0x17')](_0x6d4a66));if(_0x6d4a66[_0x9603('0x18')]){if(_0x6d4a66[_0x9603('0x18')][_0x9603('0x19')]===0x1f4){logger['error']('OpenchannelInteraction,\x20%s,\x20%s',_0x27da15,_0x6d4a66[_0x9603('0x18')][_0x9603('0x1a')]);return _0x29a413(_0x6d4a66[_0x9603('0x18')]['message']);}logger[_0x9603('0x18')]('OpenchannelInteraction,\x20%s,\x20%s',_0x27da15,_0x6d4a66[_0x9603('0x18')][_0x9603('0x1a')]);return _0x242167(_0x6d4a66[_0x9603('0x18')][_0x9603('0x1a')]);}else{logger[_0x9603('0x12')](_0x9603('0x13'),_0x27da15,_0x9603('0x14'));_0x242167(_0x6d4a66[_0x9603('0x1b')][_0x9603('0x1a')]);}})[_0x9603('0x1c')](function(_0x132c54){logger[_0x9603('0x18')](_0x9603('0x13'),_0x27da15,_0x132c54);_0x29a413(_0x132c54);});});}exports[_0x9603('0x1d')]=function(_0x2b0ad6){var _0x134000=this;return new Promise(function(_0x8705f,_0x1333b5){return db[_0x9603('0x1e')][_0x9603('0x1f')](_0x2b0ad6['body'],{'raw':_0x2b0ad6[_0x9603('0x20')]?_0x2b0ad6[_0x9603('0x20')][_0x9603('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2b0ad6[_0x9603('0x20')]?_0x2b0ad6[_0x9603('0x20')][_0x9603('0x22')]||null:null,'attributes':_0x2b0ad6['options']?_0x2b0ad6['options'][_0x9603('0x23')]||null:null,'limit':_0x2b0ad6['options']?_0x2b0ad6[_0x9603('0x20')][_0x9603('0x24')]||null:null})[_0x9603('0x11')](function(_0x302d11){logger[_0x9603('0x12')](_0x9603('0x1d'),_0x2b0ad6);logger[_0x9603('0x15')](_0x9603('0x1d'),_0x2b0ad6,JSON[_0x9603('0x17')](_0x302d11));_0x8705f(_0x302d11);})[_0x9603('0x1c')](function(_0xf041d0){logger['error']('UpdateOpenchannelInteraction',_0xf041d0[_0x9603('0x1a')],_0x2b0ad6);_0x1333b5(_0x134000['error'](0x1f4,_0xf041d0[_0x9603('0x1a')]));});});};exports[_0x9603('0x25')]=function(_0x276a89){return new Promise(function(_0xaa554c,_0x4612e7){return db['OpenchannelInteraction'][_0x9603('0x26')]({'where':_0x276a89['options']?_0x276a89[_0x9603('0x20')][_0x9603('0x22')]||null:null})[_0x9603('0x11')](function(_0x516fbe){if(_0x516fbe){return _0x516fbe[_0x9603('0x27')](_0x276a89['body'][_0x9603('0x28')],_['omit'](_0x276a89[_0x9603('0x29')],[_0x9603('0x28'),'id'])||{});}})['spread'](function(_0x24be1b){logger[_0x9603('0x12')]('AddTags',_0x276a89);logger['debug'](_0x9603('0x2a'),_0x276a89,JSON[_0x9603('0x17')](_0x24be1b));_0xaa554c(_0x24be1b);})[_0x9603('0x1c')](function(_0x4d9b7d){logger[_0x9603('0x18')](_0x9603('0x2a'),_0x4d9b7d[_0x9603('0x1a')],_0x276a89);_0x4612e7(_this['error'](0x1f4,_0x4d9b7d[_0x9603('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index 67e08a3..fe27d1c 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 _0x9128=['update','emit','register','length','openchannelInteraction:','./openchannelInteraction.events','save','remove'];(function(_0x36c194,_0x544969){var _0x2aacec=function(_0x5d20e9){while(--_0x5d20e9){_0x36c194['push'](_0x36c194['shift']());}};_0x2aacec(++_0x544969);}(_0x9128,0x195));var _0x8912=function(_0x43a6cd,_0x503d1a){_0x43a6cd=_0x43a6cd-0x0;var _0x5acb36=_0x9128[_0x43a6cd];return _0x5acb36;};'use strict';var OpenchannelInteractionEvents=require(_0x8912('0x0'));var events=[_0x8912('0x1'),_0x8912('0x2'),_0x8912('0x3')];function createListener(_0xb5fcf0,_0x3cff23){return function(_0x1a1107){_0x3cff23[_0x8912('0x4')](_0xb5fcf0,_0x1a1107);};}function removeListener(_0x4374e7,_0x1c1e78){return function(){OpenchannelInteractionEvents['removeListener'](_0x4374e7,_0x1c1e78);};}exports[_0x8912('0x5')]=function(_0x462444){for(var _0x4f4b8a=0x0,_0x20ee51=events[_0x8912('0x6')];_0x4f4b8a<_0x20ee51;_0x4f4b8a++){var _0x4ba9e4=events[_0x4f4b8a];var _0x3ab642=createListener(_0x8912('0x7')+_0x4ba9e4,_0x462444);OpenchannelInteractionEvents['on'](_0x4ba9e4,_0x3ab642);}}; \ No newline at end of file +var _0x3aeb=['length','openchannelInteraction:','./openchannelInteraction.events','save','remove','emit','removeListener','register'];(function(_0x3e8d18,_0x413252){var _0x27fe76=function(_0xd25159){while(--_0xd25159){_0x3e8d18['push'](_0x3e8d18['shift']());}};_0x27fe76(++_0x413252);}(_0x3aeb,0x92));var _0xb3ae=function(_0x36e14a,_0x55d29b){_0x36e14a=_0x36e14a-0x0;var _0x33a7b6=_0x3aeb[_0x36e14a];return _0x33a7b6;};'use strict';var OpenchannelInteractionEvents=require(_0xb3ae('0x0'));var events=[_0xb3ae('0x1'),_0xb3ae('0x2'),'update'];function createListener(_0x398d28,_0x1c267d){return function(_0x4231a7){_0x1c267d[_0xb3ae('0x3')](_0x398d28,_0x4231a7);};}function removeListener(_0x1ddd99,_0x4b2b4e){return function(){OpenchannelInteractionEvents[_0xb3ae('0x4')](_0x1ddd99,_0x4b2b4e);};}exports[_0xb3ae('0x5')]=function(_0x32a76a){for(var _0x4f5538=0x0,_0x374331=events[_0xb3ae('0x6')];_0x4f5538<_0x374331;_0x4f5538++){var _0x689773=events[_0x4f5538];var _0x139052=createListener(_0xb3ae('0x7')+_0x689773,_0x32a76a);OpenchannelInteractionEvents['on'](_0x689773,_0x139052);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index e16ae02..e457ccc 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 _0xe706=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','openchannel','openchannelmessage:create','create','update','put','/:id/accept','accept','/:id/reject','exports','multer','util','path','express','Router'];(function(_0x430e87,_0x27c509){var _0x55825f=function(_0x297ee8){while(--_0x297ee8){_0x430e87['push'](_0x430e87['shift']());}};_0x55825f(++_0x27c509);}(_0xe706,0xa3));var _0x6e70=function(_0x25e95a,_0x2efe4a){_0x25e95a=_0x25e95a-0x0;var _0x2b35e8=_0xe706[_0x25e95a];return _0x2b35e8;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x11')]('/',auth[_0x6e70('0xb')](),interaction[_0x6e70('0x12')](_0x6e70('0x13'),_0x6e70('0x14')),controller[_0x6e70('0x15')]);router['put']('/:id',auth[_0x6e70('0xb')](),controller[_0x6e70('0x16')]);router[_0x6e70('0x17')](_0x6e70('0x18'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x19')]);router[_0x6e70('0x17')](_0x6e70('0x1a'),auth['isAuthenticated'](),controller['reject']);router['delete'](_0x6e70('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0x6e70('0x1b')]=router; \ No newline at end of file +var _0xe706=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','openchannel','openchannelmessage:create','create','update','put','/:id/accept','accept','/:id/reject','exports','multer','util','path','express','Router'];(function(_0x30cafe,_0x2951f){var _0x370767=function(_0x417013){while(--_0x417013){_0x30cafe['push'](_0x30cafe['shift']());}};_0x370767(++_0x2951f);}(_0xe706,0xa3));var _0x6e70=function(_0x29dda1,_0x508e13){_0x29dda1=_0x29dda1-0x0;var _0x21b0ef=_0xe706[_0x29dda1];return _0x21b0ef;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x11')]('/',auth[_0x6e70('0xb')](),interaction[_0x6e70('0x12')](_0x6e70('0x13'),_0x6e70('0x14')),controller[_0x6e70('0x15')]);router['put']('/:id',auth[_0x6e70('0xb')](),controller[_0x6e70('0x16')]);router[_0x6e70('0x17')](_0x6e70('0x18'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x19')]);router[_0x6e70('0x17')](_0x6e70('0x1a'),auth['isAuthenticated'](),controller['reject']);router['delete'](_0x6e70('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0x6e70('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 d3e8f9c..6c77aee 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 _0x7df3=['out','DATE','STRING','TEXT','sequelize','exports','medium','BOOLEAN'];(function(_0x5b3950,_0x4e5556){var _0x41e436=function(_0x139e30){while(--_0x139e30){_0x5b3950['push'](_0x5b3950['shift']());}};_0x41e436(++_0x4e5556);}(_0x7df3,0x1cc));var _0x37df=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x7df3[_0x5b561d];return _0x431060;};'use strict';var Sequelize=require(_0x37df('0x0'));module[_0x37df('0x1')]={'body':{'type':Sequelize['TEXT'](_0x37df('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x37df('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x37df('0x4')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x37df('0x5')]},'providerName':{'type':Sequelize[_0x37df('0x6')]},'providerResponse':{'type':Sequelize[_0x37df('0x7')]}}; \ No newline at end of file +var _0x6e6c=['exports','medium','BOOLEAN','out','DATE','TEXT','sequelize'];(function(_0x2114d8,_0x355df7){var _0x4bcb29=function(_0x40ae35){while(--_0x40ae35){_0x2114d8['push'](_0x2114d8['shift']());}};_0x4bcb29(++_0x355df7);}(_0x6e6c,0xc3));var _0xc6e6=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x6e6c[_0x501510];return _0x1e6ee5;};'use strict';var Sequelize=require(_0xc6e6('0x0'));module[_0xc6e6('0x1')]={'body':{'type':Sequelize['TEXT'](_0xc6e6('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xc6e6('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xc6e6('0x4')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0xc6e6('0x5')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xc6e6('0x6')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index c0c9f44..7c00c67 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 _0x0309=['status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','stack','name','send','map','OpenchannelMessage','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','count','includeAll','include','rows','show','keys','options','find','create','body','params','destroy','describe','openchannel','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','format','interaction','role','null','AcceptMessage','ContactId','Sequelize','QueryTypes','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','accept','EventManager','openchannel-interactions','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','SELECT','rejectmessage','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','client','http','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus'];(function(_0x39dfc3,_0x29b04e){var _0x15c682=function(_0x4824f9){while(--_0x4824f9){_0x39dfc3['push'](_0x39dfc3['shift']());}};_0x15c682(++_0x29b04e);}(_0x0309,0x165));var _0x9030=function(_0x1a9325,_0x3a4426){_0x1a9325=_0x1a9325-0x0;var _0x342c66=_0x0309[_0x1a9325];return _0x342c66;};'use strict';var emlformat=require(_0x9030('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9030('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9030('0x2'));var moment=require(_0x9030('0x3'));var BPromise=require(_0x9030('0x4'));var Mustache=require(_0x9030('0x5'));var util=require(_0x9030('0x6'));var path=require(_0x9030('0x7'));var sox=require(_0x9030('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9030('0x9'));var _=require(_0x9030('0xa'));var squel=require('squel');var crypto=require(_0x9030('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x9030('0xc'));var toCsv=require(_0x9030('0xd'));var querystring=require(_0x9030('0xe'));var Papa=require('papaparse');var Redis=require(_0x9030('0xf'));var authService=require(_0x9030('0x10'));var qs=require(_0x9030('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9030('0x12'));var logger=require(_0x9030('0x13'))(_0x9030('0x14'));var utils=require(_0x9030('0x15'));var config=require(_0x9030('0x16'));var licenseUtil=require(_0x9030('0x17'));var db=require(_0x9030('0x18'))['db'];config['redis']=_[_0x9030('0x19')](config[_0x9030('0x1a')],{'host':_0x9030('0x1b'),'port':0x18eb});var socket=require(_0x9030('0x1c'))(new Redis(config['redis']));require(_0x9030('0x1d'))[_0x9030('0x1e')](socket);var jayson=require(_0x9030('0x1f'));var client=jayson[_0x9030('0x20')][_0x9030('0x21')]({'port':0x232c});var client9002=jayson[_0x9030('0x20')][_0x9030('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x1776e6,_0xfc6f46,_0x55ac94,_0x213040){return new BPromise(function(_0x17e80d,_0x2bd14d){var _0x37afac=_0x213040||client;return _0x37afac[_0x9030('0x22')](_0x1776e6,_0x55ac94)[_0x9030('0x23')](function(_0x229dcd){logger[_0x9030('0x24')](_0x9030('0x25'),_0xfc6f46,_0x9030('0x26'));logger[_0x9030('0x27')](_0x9030('0x28'),_0xfc6f46,_0x9030('0x26'),JSON[_0x9030('0x29')](_0x229dcd));if(_0x229dcd[_0x9030('0x2a')]){if(_0x229dcd[_0x9030('0x2a')][_0x9030('0x2b')]===0x1f4){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0xfc6f46,_0x229dcd[_0x9030('0x2a')][_0x9030('0x2c')]);return _0x2bd14d(_0x229dcd['error'][_0x9030('0x2c')]);}logger[_0x9030('0x2a')](_0x9030('0x25'),_0xfc6f46,_0x229dcd[_0x9030('0x2a')]['message']);return _0x17e80d(_0x229dcd[_0x9030('0x2a')]['message']);}else{logger['info'](_0x9030('0x25'),_0xfc6f46,_0x9030('0x26'));_0x17e80d(_0x229dcd[_0x9030('0x2d')]['message']);}})[_0x9030('0x2e')](function(_0x408ce6){logger[_0x9030('0x2a')](_0x9030('0x25'),_0xfc6f46,_0x408ce6);_0x2bd14d(_0x408ce6);});});}function respondWithStatusCode(_0x43ca87,_0x4d6bf9){_0x4d6bf9=_0x4d6bf9||0xcc;return function(_0x5ca691){if(_0x5ca691){return _0x43ca87[_0x9030('0x2f')](_0x4d6bf9);}return _0x43ca87[_0x9030('0x30')](_0x4d6bf9)[_0x9030('0x31')]();};}function respondWithResult(_0x42d1ba,_0x3e00dd){_0x3e00dd=_0x3e00dd||0xc8;return function(_0x155b8c){if(_0x155b8c){return _0x42d1ba[_0x9030('0x30')](_0x3e00dd)[_0x9030('0x32')](_0x155b8c);}};}function respondWithFilteredResult(_0x11c47d,_0x3be936){return function(_0x1d0c5c){if(_0x1d0c5c){var _0x528f75=typeof _0x3be936[_0x9030('0x33')]==='undefined'&&typeof _0x3be936[_0x9030('0x34')]==='undefined';var _0x43a31b=_0x1d0c5c['count'];var _0x46d055=_0x528f75?0x0:_0x3be936[_0x9030('0x33')];var _0x1bbad0=_0x528f75?_0x1d0c5c['count']:_0x3be936[_0x9030('0x33')]+_0x3be936[_0x9030('0x34')];var _0x3b70ff;if(_0x1bbad0>=_0x43a31b){_0x1bbad0=_0x43a31b;_0x3b70ff=0xc8;}else{_0x3b70ff=0xce;}_0x11c47d[_0x9030('0x30')](_0x3b70ff);return _0x11c47d[_0x9030('0x35')](_0x9030('0x36'),_0x46d055+'-'+_0x1bbad0+'/'+_0x43a31b)[_0x9030('0x32')](_0x1d0c5c);}return null;};}function patchUpdates(_0x12b9b8){return function(_0x134260){try{jsonpatch[_0x9030('0x37')](_0x134260,_0x12b9b8,!![]);}catch(_0x42fbf8){return BPromise[_0x9030('0x38')](_0x42fbf8);}return _0x134260[_0x9030('0x39')]();};}function saveUpdates(_0x2fd58e,_0x2d2b5e){return function(_0xf47b04){if(_0xf47b04){return _0xf47b04[_0x9030('0x3a')](_0x2fd58e)[_0x9030('0x23')](function(_0x54ebae){return _0x54ebae;});}return null;};}function removeEntity(_0x582e57,_0x3779bc){return function(_0x29ffda){if(_0x29ffda){return _0x29ffda['destroy']()['then'](function(){_0x582e57[_0x9030('0x30')](0xcc)[_0x9030('0x31')]();});}};}function handleEntityNotFound(_0x411077,_0x3ffd44){return function(_0x47f069){if(!_0x47f069){_0x411077[_0x9030('0x2f')](0x194);}return _0x47f069;};}function handleError(_0x4d684c,_0x26f80e){_0x26f80e=_0x26f80e||0x1f4;return function(_0x9fcce9){logger['error'](_0x9fcce9[_0x9030('0x3b')]);if(_0x9fcce9[_0x9030('0x3c')]){delete _0x9fcce9[_0x9030('0x3c')];}_0x4d684c['status'](_0x26f80e)[_0x9030('0x3d')](_0x9fcce9);};}exports['index']=function(_0x438828,_0x556bb8){var _0x3c1797={},_0x5e371b={},_0x1b875a={'count':0x0,'rows':[]};var _0x11d0d8=_[_0x9030('0x3e')](db[_0x9030('0x3f')][_0x9030('0x40')],function(_0x151d64){return{'name':_0x151d64[_0x9030('0x41')],'type':_0x151d64[_0x9030('0x42')][_0x9030('0x43')]};});_0x5e371b['model']=_[_0x9030('0x3e')](_0x11d0d8,_0x9030('0x3c'));_0x5e371b[_0x9030('0x44')]=_['keys'](_0x438828[_0x9030('0x44')]);_0x5e371b[_0x9030('0x45')]=_[_0x9030('0x46')](_0x5e371b[_0x9030('0x47')],_0x5e371b['query']);_0x3c1797[_0x9030('0x48')]=_[_0x9030('0x46')](_0x5e371b[_0x9030('0x47')],qs['fields'](_0x438828[_0x9030('0x44')][_0x9030('0x49')]));_0x3c1797[_0x9030('0x48')]=_0x3c1797[_0x9030('0x48')][_0x9030('0x4a')]?_0x3c1797['attributes']:_0x5e371b[_0x9030('0x47')];if(!_0x438828['query'][_0x9030('0x4b')](_0x9030('0x4c'))){_0x3c1797[_0x9030('0x34')]=qs[_0x9030('0x34')](_0x438828[_0x9030('0x44')][_0x9030('0x34')]);_0x3c1797[_0x9030('0x33')]=qs[_0x9030('0x33')](_0x438828['query'][_0x9030('0x33')]);}_0x3c1797[_0x9030('0x4d')]=qs[_0x9030('0x4e')](_0x438828[_0x9030('0x44')][_0x9030('0x4e')]);_0x3c1797[_0x9030('0x4f')]=qs[_0x9030('0x45')](_[_0x9030('0x50')](_0x438828[_0x9030('0x44')],_0x5e371b[_0x9030('0x45')]),_0x11d0d8);if(_0x438828[_0x9030('0x44')][_0x9030('0x51')]){_0x3c1797[_0x9030('0x4f')]=_[_0x9030('0x52')](_0x3c1797['where'],{'$or':_[_0x9030('0x3e')](_0x11d0d8,function(_0x2e0283){if(_0x2e0283['type']!==_0x9030('0x53')){var _0x377a3e={};_0x377a3e[_0x2e0283[_0x9030('0x3c')]]={'$like':'%'+_0x438828['query']['filter']+'%'};return _0x377a3e;}})});}_0x3c1797=_[_0x9030('0x52')]({},_0x3c1797,_0x438828['options']);var _0x5e0059={'where':_0x3c1797[_0x9030('0x4f')]};return db[_0x9030('0x3f')][_0x9030('0x54')](_0x5e0059)[_0x9030('0x23')](function(_0x5a6d8e){_0x1b875a[_0x9030('0x54')]=_0x5a6d8e;if(_0x438828['query'][_0x9030('0x55')]){_0x3c1797[_0x9030('0x56')]=[{'all':!![]}];}return db[_0x9030('0x3f')]['findAll'](_0x3c1797);})[_0x9030('0x23')](function(_0xf54697){_0x1b875a[_0x9030('0x57')]=_0xf54697;return _0x1b875a;})['then'](respondWithFilteredResult(_0x556bb8,_0x3c1797))[_0x9030('0x2e')](handleError(_0x556bb8,null));};exports[_0x9030('0x58')]=function(_0x4b4e46,_0x39e03a){var _0x4efbfc={'raw':!![],'where':{'id':_0x4b4e46['params']['id']}},_0x16df46={};_0x16df46[_0x9030('0x47')]=_[_0x9030('0x59')](db[_0x9030('0x3f')][_0x9030('0x40')]);_0x16df46[_0x9030('0x44')]=_[_0x9030('0x59')](_0x4b4e46['query']);_0x16df46[_0x9030('0x45')]=_[_0x9030('0x46')](_0x16df46[_0x9030('0x47')],_0x16df46[_0x9030('0x44')]);_0x4efbfc[_0x9030('0x48')]=_['intersection'](_0x16df46['model'],qs[_0x9030('0x49')](_0x4b4e46[_0x9030('0x44')][_0x9030('0x49')]));_0x4efbfc[_0x9030('0x48')]=_0x4efbfc[_0x9030('0x48')][_0x9030('0x4a')]?_0x4efbfc[_0x9030('0x48')]:_0x16df46[_0x9030('0x47')];if(_0x4b4e46[_0x9030('0x44')][_0x9030('0x55')]){_0x4efbfc[_0x9030('0x56')]=[{'all':!![]}];}_0x4efbfc=_[_0x9030('0x52')]({},_0x4efbfc,_0x4b4e46[_0x9030('0x5a')]);return db['OpenchannelMessage'][_0x9030('0x5b')](_0x4efbfc)[_0x9030('0x23')](handleEntityNotFound(_0x39e03a,null))['then'](respondWithResult(_0x39e03a,null))['catch'](handleError(_0x39e03a,null));};exports[_0x9030('0x5c')]=function(_0x1b69e7,_0x24fc6c){return db[_0x9030('0x3f')][_0x9030('0x5c')](_0x1b69e7[_0x9030('0x5d')],{})['then'](respondWithResult(_0x24fc6c,0xc9))['catch'](handleError(_0x24fc6c,null));};exports[_0x9030('0x3a')]=function(_0x343dc8,_0x1bb683){if(_0x343dc8[_0x9030('0x5d')]['id']){delete _0x343dc8['body']['id'];}return db[_0x9030('0x3f')][_0x9030('0x5b')]({'where':{'id':_0x343dc8[_0x9030('0x5e')]['id']}})[_0x9030('0x23')](handleEntityNotFound(_0x1bb683,null))[_0x9030('0x23')](saveUpdates(_0x343dc8['body'],null))['then'](respondWithResult(_0x1bb683,null))[_0x9030('0x2e')](handleError(_0x1bb683,null));};exports[_0x9030('0x5f')]=function(_0x25719b,_0x19f84e){return db[_0x9030('0x3f')][_0x9030('0x5b')]({'where':{'id':_0x25719b[_0x9030('0x5e')]['id']}})[_0x9030('0x23')](handleEntityNotFound(_0x19f84e,null))[_0x9030('0x23')](removeEntity(_0x19f84e,null))[_0x9030('0x2e')](handleError(_0x19f84e,null));};exports['describe']=function(_0x1ca1aa,_0x24b579){return db[_0x9030('0x3f')][_0x9030('0x60')]()[_0x9030('0x23')](respondWithResult(_0x24b579,null))[_0x9030('0x2e')](handleError(_0x24b579,null));};var interaction_log=require(_0x9030('0x13'))('openchannel-interactions');exports['accept']=function(_0x73a39e,_0x37fa89,_0x28714f){var _0x44442f={'agent':{},'channel':_0x9030('0x61')};if(_0x73a39e[_0x9030('0x5d')]['id']){delete _0x73a39e[_0x9030('0x5d')]['id'];}_0x73a39e['body']['read']=!![];_0x73a39e['body'][_0x9030('0x62')]=moment()['format'](_0x9030('0x63'));_0x73a39e['body'][_0x9030('0x64')]=_0x73a39e[_0x9030('0x5d')][_0x9030('0x64')]||_0x73a39e[_0x9030('0x65')]['id'];_0x44442f[_0x9030('0x66')]['id']=_0x73a39e[_0x9030('0x5d')][_0x9030('0x64')];return db[_0x9030('0x3f')][_0x9030('0x5b')]({'where':{'id':_0x73a39e[_0x9030('0x5e')]['id'],'UserId':null}})[_0x9030('0x23')](handleEntityNotFound(_0x37fa89,null))[_0x9030('0x23')](saveUpdates(_0x73a39e[_0x9030('0x5d')],null))[_0x9030('0x23')](function(_0x49bad8){if(_0x49bad8){_0x44442f[_0x9030('0x2c')]=_0x49bad8[_0x9030('0x67')]({'plain':!![]});return db[_0x9030('0x68')][_0x9030('0x5b')]({'where':{'id':_0x49bad8[_0x9030('0x69')]}});}return null;})[_0x9030('0x23')](handleEntityNotFound(_0x37fa89,null))['then'](function(_0x1f6ed9){if(_0x1f6ed9){return _0x1f6ed9[_0x9030('0x3a')]({'UserId':_0x73a39e[_0x9030('0x5d')][_0x9030('0x64')],'read1stAt':_[_0x9030('0x6a')](_0x1f6ed9['read1stAt'])?moment()[_0x9030('0x6b')](_0x9030('0x63')):undefined});}return null;})[_0x9030('0x23')](function(_0x4d930b){if(_0x4d930b){_0x44442f[_0x9030('0x6c')]=_0x4d930b[_0x9030('0x67')]({'plain':!![]});interaction_log['info']('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x73a39e['user']['id'],_0x73a39e[_0x9030('0x65')][_0x9030('0x3c')],_0x73a39e[_0x9030('0x65')][_0x9030('0x6d')],_0x44442f[_0x9030('0x6c')]['id'],_0x73a39e['body']?JSON[_0x9030('0x29')](_0x73a39e[_0x9030('0x5d')]):_0x9030('0x6e'));return respondWithRpcPromise(_0x9030('0x6f'),'acceptMessage',_0x44442f);}return null;})[_0x9030('0x23')](function(_0x1f508c){var _0x1fc30d='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x1f508c[_0x9030('0x2c')][_0x9030('0x70')];return db['sequelize'][_0x9030('0x44')](_0x1fc30d,{'type':db[_0x9030('0x71')][_0x9030('0x72')]['SELECT'],'raw':!![]})[_0x9030('0x23')](function(_0x4a3760){return _0x4a3760;});})[_0x9030('0x23')](function(_0x982a9f){if(_0x982a9f){_0x44442f[_0x9030('0x2c')][_0x9030('0x73')]=_0x982a9f[0x0];if(!_0x73a39e[_0x9030('0x5d')][_0x9030('0x64')])return;return db[_0x9030('0x74')]['find']({'where':{'id':_0x73a39e[_0x9030('0x5d')]['UserId'],'role':_0x9030('0x66')},'attributes':['id',_0x9030('0x3c'),_0x9030('0x75'),_0x9030('0x76'),_0x9030('0x77')],'raw':!![]});}return null;})['then'](function(_0x53e328){if(!_0x53e328)return null;_0x44442f['message'][_0x9030('0x66')]=_0x53e328;return _0x44442f;})[_0x9030('0x23')](function(_0x3c0b37){if(_0x3c0b37){if(_0x73a39e['body'][_0x9030('0x78')]){_0x44442f[_0x9030('0x2c')][_0x9030('0x79')]=util['format'](_0x9030('0x7a'),_0x73a39e[_0x9030('0x65')][_0x9030('0x3c')]);_0x44442f[_0x9030('0x2c')][_0x9030('0x7b')]=_0x44442f['channel'];_0x44442f[_0x9030('0x2c')][_0x9030('0x7c')]=_0x44442f[_0x9030('0x7b')];_0x44442f['message'][_0x9030('0x7d')]=_0x9030('0x7e');return respondWithRpcPromise(_0x9030('0x7f'),_0x9030('0x7f'),{'event':'acceptmessage','message':_0x44442f['message']},client9002)[_0x9030('0x23')](function(){return _0x44442f;});}return _0x44442f;}return null;})[_0x9030('0x23')](respondWithResult(_0x37fa89,null))[_0x9030('0x2e')](handleError(_0x37fa89,null));};var interaction_log=require(_0x9030('0x13'))(_0x9030('0x80'));exports['reject']=function(_0xc3aa0d,_0x288bec,_0x3ea178){var _0x3e61e2={'agent':{},'channel':_0x9030('0x61')};if(_0xc3aa0d['body']['id']){delete _0xc3aa0d[_0x9030('0x5d')]['id'];}_0xc3aa0d['body'][_0x9030('0x64')]=_0xc3aa0d[_0x9030('0x5d')][_0x9030('0x64')]||_0xc3aa0d['user']['id'];_0x3e61e2['agent']['id']=_0xc3aa0d[_0x9030('0x5d')][_0x9030('0x64')];return db[_0x9030('0x3f')][_0x9030('0x5b')]({'where':{'id':_0xc3aa0d[_0x9030('0x5e')]['id'],'UserId':null}})[_0x9030('0x23')](handleEntityNotFound(_0x288bec,null))[_0x9030('0x23')](function(_0x4a80b4){if(_0x4a80b4){_0x3e61e2[_0x9030('0x2c')]=_0x4a80b4[_0x9030('0x67')]({'plain':!![]});return db['OpenchannelInteraction'][_0x9030('0x5b')]({'where':{'id':_0x4a80b4[_0x9030('0x69')]}});}return null;})[_0x9030('0x23')](handleEntityNotFound(_0x288bec,null))[_0x9030('0x23')](function(_0x346368){if(_0x346368){_0x3e61e2[_0x9030('0x6c')]=_0x346368[_0x9030('0x67')]({'plain':!![]});interaction_log[_0x9030('0x24')](_0x9030('0x81'),_0xc3aa0d['user']['id'],_0xc3aa0d[_0x9030('0x65')]['name'],_0xc3aa0d['user']['role'],_0x3e61e2[_0x9030('0x6c')]['id'],_0xc3aa0d[_0x9030('0x5d')]?JSON[_0x9030('0x29')](_0xc3aa0d[_0x9030('0x5d')]):_0x9030('0x6e'));return respondWithRpcPromise(_0x9030('0x82'),'rejectMessage',_0x3e61e2);}return null;})[_0x9030('0x23')](function(_0x78850b){var _0x5243f7=_0x9030('0x83')+_0x78850b[_0x9030('0x2c')][_0x9030('0x70')];return db[_0x9030('0x84')][_0x9030('0x44')](_0x5243f7,{'type':db[_0x9030('0x71')][_0x9030('0x72')][_0x9030('0x85')],'raw':!![]})[_0x9030('0x23')](function(_0x138474){return _0x138474;});})['then'](function(_0x51b131){if(_0x51b131){_0x3e61e2[_0x9030('0x2c')][_0x9030('0x73')]=_0x51b131[0x0];if(!_0xc3aa0d['body'][_0x9030('0x64')])return;return db[_0x9030('0x74')][_0x9030('0x5b')]({'where':{'id':_0xc3aa0d[_0x9030('0x5d')][_0x9030('0x64')],'role':'agent'},'attributes':['id',_0x9030('0x3c'),_0x9030('0x75'),_0x9030('0x76'),'internal'],'raw':!![]});}return null;})['then'](function(_0x5ba5a6){if(!_0x5ba5a6)return null;_0x3e61e2[_0x9030('0x2c')][_0x9030('0x66')]=_0x5ba5a6;return _0x3e61e2;})['then'](function(_0x5ee802){if(_0x5ee802){_0x5ee802[_0x9030('0x2c')][_0x9030('0x79')]=util['format'](_0x9030('0x7a'),_0xc3aa0d[_0x9030('0x65')][_0x9030('0x3c')]);_0x5ee802[_0x9030('0x2c')][_0x9030('0x7b')]=_0x3e61e2[_0x9030('0x7b')];_0x5ee802[_0x9030('0x2c')]['motionChannel']=_0x3e61e2[_0x9030('0x7b')];_0x5ee802['message'][_0x9030('0x7d')]=_0x9030('0x38');respondWithRpcPromise('EventManager','EventManager',{'event':_0x9030('0x86'),'message':_0x5ee802[_0x9030('0x2c')]},client9002);return _0x3e61e2;}return null;})['then'](respondWithResult(_0x288bec,null))[_0x9030('0x2e')](handleError(_0x288bec,null));}; \ No newline at end of file +var _0x7177=['info','OpenchannelMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','undefined','count','offset','limit','set','apply','reject','update','destroy','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','intersection','query','attributes','fields','hasOwnProperty','order','sort','where','filters','pick','merge','OpenchannelMessage','includeAll','findAll','rows','show','params','length','include','options','find','create','body','describe','openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','OpenchannelInteractionId','isNil','read1stAt','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','interface','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','openchannel-interactions','OpenchannelInteraction','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','Sequelize','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./openchannelMessage.socket','register','jayson/promise','http','client','then'];(function(_0x4faa7b,_0x4da8c0){var _0x4ee40b=function(_0x1fabc3){while(--_0x1fabc3){_0x4faa7b['push'](_0x4faa7b['shift']());}};_0x4ee40b(++_0x4da8c0);}(_0x7177,0x174));var _0x7717=function(_0x6a21f4,_0x220ad8){_0x6a21f4=_0x6a21f4-0x0;var _0x4c15ac=_0x7177[_0x6a21f4];return _0x4c15ac;};'use strict';var emlformat=require(_0x7717('0x0'));var rimraf=require(_0x7717('0x1'));var zipdir=require(_0x7717('0x2'));var jsonpatch=require(_0x7717('0x3'));var rp=require(_0x7717('0x4'));var moment=require(_0x7717('0x5'));var BPromise=require(_0x7717('0x6'));var Mustache=require(_0x7717('0x7'));var util=require(_0x7717('0x8'));var path=require('path');var sox=require(_0x7717('0x9'));var csv=require(_0x7717('0xa'));var ejs=require(_0x7717('0xb'));var fs=require('fs');var fs_extra=require(_0x7717('0xc'));var _=require('lodash');var squel=require(_0x7717('0xd'));var crypto=require(_0x7717('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x7717('0xf'));var toCsv=require(_0x7717('0xa'));var querystring=require(_0x7717('0x10'));var Papa=require(_0x7717('0x11'));var Redis=require(_0x7717('0x12'));var authService=require(_0x7717('0x13'));var qs=require(_0x7717('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7717('0x15'))(_0x7717('0x16'));var utils=require(_0x7717('0x17'));var config=require(_0x7717('0x18'));var licenseUtil=require(_0x7717('0x19'));var db=require(_0x7717('0x1a'))['db'];config[_0x7717('0x1b')]=_[_0x7717('0x1c')](config[_0x7717('0x1b')],{'host':_0x7717('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7717('0x1b')]));require(_0x7717('0x1e'))[_0x7717('0x1f')](socket);var jayson=require(_0x7717('0x20'));var client=jayson['client'][_0x7717('0x21')]({'port':0x232c});var client9002=jayson[_0x7717('0x22')][_0x7717('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x2fd014,_0x57c61b,_0x4b5ae9,_0x1cbf2f){return new BPromise(function(_0x344942,_0x4e45a4){var _0x2d94b7=_0x1cbf2f||client;return _0x2d94b7['request'](_0x2fd014,_0x4b5ae9)[_0x7717('0x23')](function(_0xd23cf9){logger[_0x7717('0x24')](_0x7717('0x25'),_0x57c61b,'request\x20sent');logger[_0x7717('0x26')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x57c61b,_0x7717('0x27'),JSON[_0x7717('0x28')](_0xd23cf9));if(_0xd23cf9[_0x7717('0x29')]){if(_0xd23cf9[_0x7717('0x29')][_0x7717('0x2a')]===0x1f4){logger[_0x7717('0x29')](_0x7717('0x25'),_0x57c61b,_0xd23cf9[_0x7717('0x29')][_0x7717('0x2b')]);return _0x4e45a4(_0xd23cf9[_0x7717('0x29')]['message']);}logger[_0x7717('0x29')](_0x7717('0x25'),_0x57c61b,_0xd23cf9['error'][_0x7717('0x2b')]);return _0x344942(_0xd23cf9[_0x7717('0x29')][_0x7717('0x2b')]);}else{logger[_0x7717('0x24')](_0x7717('0x25'),_0x57c61b,'request\x20sent');_0x344942(_0xd23cf9[_0x7717('0x2c')]['message']);}})[_0x7717('0x2d')](function(_0x1a9b41){logger[_0x7717('0x29')](_0x7717('0x25'),_0x57c61b,_0x1a9b41);_0x4e45a4(_0x1a9b41);});});}function respondWithStatusCode(_0x5b8a82,_0x42e112){_0x42e112=_0x42e112||0xcc;return function(_0x34a321){if(_0x34a321){return _0x5b8a82[_0x7717('0x2e')](_0x42e112);}return _0x5b8a82[_0x7717('0x2f')](_0x42e112)[_0x7717('0x30')]();};}function respondWithResult(_0x51e71d,_0x312a1c){_0x312a1c=_0x312a1c||0xc8;return function(_0x1ada0c){if(_0x1ada0c){return _0x51e71d[_0x7717('0x2f')](_0x312a1c)[_0x7717('0x31')](_0x1ada0c);}};}function respondWithFilteredResult(_0x14df72,_0x13d04a){return function(_0x27a2ca){if(_0x27a2ca){var _0x4632c1=typeof _0x13d04a['offset']==='undefined'&&typeof _0x13d04a['limit']===_0x7717('0x32');var _0x226537=_0x27a2ca[_0x7717('0x33')];var _0x50f7ed=_0x4632c1?0x0:_0x13d04a[_0x7717('0x34')];var _0x196697=_0x4632c1?_0x27a2ca[_0x7717('0x33')]:_0x13d04a[_0x7717('0x34')]+_0x13d04a[_0x7717('0x35')];var _0x2fffee;if(_0x196697>=_0x226537){_0x196697=_0x226537;_0x2fffee=0xc8;}else{_0x2fffee=0xce;}_0x14df72[_0x7717('0x2f')](_0x2fffee);return _0x14df72[_0x7717('0x36')]('Content-Range',_0x50f7ed+'-'+_0x196697+'/'+_0x226537)['json'](_0x27a2ca);}return null;};}function patchUpdates(_0x44a5e0){return function(_0x1a5ed8){try{jsonpatch[_0x7717('0x37')](_0x1a5ed8,_0x44a5e0,!![]);}catch(_0x4655d5){return BPromise[_0x7717('0x38')](_0x4655d5);}return _0x1a5ed8['save']();};}function saveUpdates(_0x336b78,_0x4d095d){return function(_0x17615b){if(_0x17615b){return _0x17615b[_0x7717('0x39')](_0x336b78)[_0x7717('0x23')](function(_0x4bc736){return _0x4bc736;});}return null;};}function removeEntity(_0x1e4c42,_0x1210ab){return function(_0xfab0c1){if(_0xfab0c1){return _0xfab0c1[_0x7717('0x3a')]()['then'](function(){_0x1e4c42['status'](0xcc)[_0x7717('0x30')]();});}};}function handleEntityNotFound(_0x976524,_0x11684d){return function(_0x17b225){if(!_0x17b225){_0x976524['sendStatus'](0x194);}return _0x17b225;};}function handleError(_0x42707a,_0x314bf9){_0x314bf9=_0x314bf9||0x1f4;return function(_0x483f32){logger[_0x7717('0x29')](_0x483f32['stack']);if(_0x483f32['name']){delete _0x483f32[_0x7717('0x3b')];}_0x42707a[_0x7717('0x2f')](_0x314bf9)[_0x7717('0x3c')](_0x483f32);};}exports[_0x7717('0x3d')]=function(_0x2aeb90,_0x495517){var _0x2e0730={},_0x281979={},_0x34a7e2={'count':0x0,'rows':[]};var _0xc9a50f=_[_0x7717('0x3e')](db['OpenchannelMessage'][_0x7717('0x3f')],function(_0x3960bc){return{'name':_0x3960bc[_0x7717('0x40')],'type':_0x3960bc[_0x7717('0x41')][_0x7717('0x42')]};});_0x281979[_0x7717('0x43')]=_['map'](_0xc9a50f,_0x7717('0x3b'));_0x281979['query']=_[_0x7717('0x44')](_0x2aeb90['query']);_0x281979['filters']=_[_0x7717('0x45')](_0x281979[_0x7717('0x43')],_0x281979[_0x7717('0x46')]);_0x2e0730[_0x7717('0x47')]=_[_0x7717('0x45')](_0x281979[_0x7717('0x43')],qs['fields'](_0x2aeb90['query'][_0x7717('0x48')]));_0x2e0730[_0x7717('0x47')]=_0x2e0730[_0x7717('0x47')]['length']?_0x2e0730['attributes']:_0x281979[_0x7717('0x43')];if(!_0x2aeb90[_0x7717('0x46')][_0x7717('0x49')]('nolimit')){_0x2e0730['limit']=qs[_0x7717('0x35')](_0x2aeb90['query'][_0x7717('0x35')]);_0x2e0730[_0x7717('0x34')]=qs[_0x7717('0x34')](_0x2aeb90['query'][_0x7717('0x34')]);}_0x2e0730[_0x7717('0x4a')]=qs['sort'](_0x2aeb90[_0x7717('0x46')][_0x7717('0x4b')]);_0x2e0730[_0x7717('0x4c')]=qs[_0x7717('0x4d')](_[_0x7717('0x4e')](_0x2aeb90['query'],_0x281979[_0x7717('0x4d')]),_0xc9a50f);if(_0x2aeb90[_0x7717('0x46')]['filter']){_0x2e0730[_0x7717('0x4c')]=_['merge'](_0x2e0730[_0x7717('0x4c')],{'$or':_[_0x7717('0x3e')](_0xc9a50f,function(_0x337a60){if(_0x337a60[_0x7717('0x41')]!=='VIRTUAL'){var _0x483d42={};_0x483d42[_0x337a60[_0x7717('0x3b')]]={'$like':'%'+_0x2aeb90[_0x7717('0x46')]['filter']+'%'};return _0x483d42;}})});}_0x2e0730=_[_0x7717('0x4f')]({},_0x2e0730,_0x2aeb90['options']);var _0x2ebd99={'where':_0x2e0730[_0x7717('0x4c')]};return db[_0x7717('0x50')][_0x7717('0x33')](_0x2ebd99)['then'](function(_0x5b6150){_0x34a7e2[_0x7717('0x33')]=_0x5b6150;if(_0x2aeb90['query'][_0x7717('0x51')]){_0x2e0730['include']=[{'all':!![]}];}return db['OpenchannelMessage'][_0x7717('0x52')](_0x2e0730);})[_0x7717('0x23')](function(_0x5b5508){_0x34a7e2[_0x7717('0x53')]=_0x5b5508;return _0x34a7e2;})['then'](respondWithFilteredResult(_0x495517,_0x2e0730))[_0x7717('0x2d')](handleError(_0x495517,null));};exports[_0x7717('0x54')]=function(_0x51c6d7,_0xefec5a){var _0xde6b46={'raw':!![],'where':{'id':_0x51c6d7[_0x7717('0x55')]['id']}},_0x2c7864={};_0x2c7864[_0x7717('0x43')]=_[_0x7717('0x44')](db['OpenchannelMessage'][_0x7717('0x3f')]);_0x2c7864['query']=_[_0x7717('0x44')](_0x51c6d7[_0x7717('0x46')]);_0x2c7864[_0x7717('0x4d')]=_[_0x7717('0x45')](_0x2c7864[_0x7717('0x43')],_0x2c7864[_0x7717('0x46')]);_0xde6b46[_0x7717('0x47')]=_[_0x7717('0x45')](_0x2c7864[_0x7717('0x43')],qs[_0x7717('0x48')](_0x51c6d7[_0x7717('0x46')]['fields']));_0xde6b46['attributes']=_0xde6b46['attributes'][_0x7717('0x56')]?_0xde6b46[_0x7717('0x47')]:_0x2c7864['model'];if(_0x51c6d7['query'][_0x7717('0x51')]){_0xde6b46[_0x7717('0x57')]=[{'all':!![]}];}_0xde6b46=_[_0x7717('0x4f')]({},_0xde6b46,_0x51c6d7[_0x7717('0x58')]);return db[_0x7717('0x50')][_0x7717('0x59')](_0xde6b46)['then'](handleEntityNotFound(_0xefec5a,null))[_0x7717('0x23')](respondWithResult(_0xefec5a,null))[_0x7717('0x2d')](handleError(_0xefec5a,null));};exports[_0x7717('0x5a')]=function(_0x3bf594,_0x506d99){return db[_0x7717('0x50')]['create'](_0x3bf594['body'],{})['then'](respondWithResult(_0x506d99,0xc9))[_0x7717('0x2d')](handleError(_0x506d99,null));};exports[_0x7717('0x39')]=function(_0x2529d6,_0x11fbaf){if(_0x2529d6['body']['id']){delete _0x2529d6[_0x7717('0x5b')]['id'];}return db[_0x7717('0x50')][_0x7717('0x59')]({'where':{'id':_0x2529d6[_0x7717('0x55')]['id']}})[_0x7717('0x23')](handleEntityNotFound(_0x11fbaf,null))['then'](saveUpdates(_0x2529d6['body'],null))[_0x7717('0x23')](respondWithResult(_0x11fbaf,null))['catch'](handleError(_0x11fbaf,null));};exports[_0x7717('0x3a')]=function(_0x1df052,_0xddaf11){return db[_0x7717('0x50')][_0x7717('0x59')]({'where':{'id':_0x1df052[_0x7717('0x55')]['id']}})[_0x7717('0x23')](handleEntityNotFound(_0xddaf11,null))[_0x7717('0x23')](removeEntity(_0xddaf11,null))[_0x7717('0x2d')](handleError(_0xddaf11,null));};exports[_0x7717('0x5c')]=function(_0x527ed1,_0x28177a){return db[_0x7717('0x50')][_0x7717('0x5c')]()[_0x7717('0x23')](respondWithResult(_0x28177a,null))[_0x7717('0x2d')](handleError(_0x28177a,null));};var interaction_log=require(_0x7717('0x15'))('openchannel-interactions');exports['accept']=function(_0x18d4fe,_0x145ea3,_0x546fd0){var _0x51bd95={'agent':{},'channel':_0x7717('0x5d')};if(_0x18d4fe[_0x7717('0x5b')]['id']){delete _0x18d4fe[_0x7717('0x5b')]['id'];}_0x18d4fe[_0x7717('0x5b')][_0x7717('0x5e')]=!![];_0x18d4fe[_0x7717('0x5b')][_0x7717('0x5f')]=moment()[_0x7717('0x60')](_0x7717('0x61'));_0x18d4fe[_0x7717('0x5b')]['UserId']=_0x18d4fe[_0x7717('0x5b')][_0x7717('0x62')]||_0x18d4fe[_0x7717('0x63')]['id'];_0x51bd95[_0x7717('0x64')]['id']=_0x18d4fe[_0x7717('0x5b')][_0x7717('0x62')];return db[_0x7717('0x50')][_0x7717('0x59')]({'where':{'id':_0x18d4fe['params']['id'],'UserId':null}})[_0x7717('0x23')](handleEntityNotFound(_0x145ea3,null))[_0x7717('0x23')](saveUpdates(_0x18d4fe[_0x7717('0x5b')],null))[_0x7717('0x23')](function(_0x5f27cf){if(_0x5f27cf){_0x51bd95[_0x7717('0x2b')]=_0x5f27cf[_0x7717('0x65')]({'plain':!![]});return db['OpenchannelInteraction']['find']({'where':{'id':_0x5f27cf[_0x7717('0x66')]}});}return null;})[_0x7717('0x23')](handleEntityNotFound(_0x145ea3,null))[_0x7717('0x23')](function(_0x178cfb){if(_0x178cfb){return _0x178cfb[_0x7717('0x39')]({'UserId':_0x18d4fe[_0x7717('0x5b')][_0x7717('0x62')],'read1stAt':_[_0x7717('0x67')](_0x178cfb[_0x7717('0x68')])?moment()[_0x7717('0x60')](_0x7717('0x61')):undefined});}return null;})['then'](function(_0x3ae5b2){if(_0x3ae5b2){_0x51bd95['interaction']=_0x3ae5b2[_0x7717('0x65')]({'plain':!![]});interaction_log[_0x7717('0x24')](_0x7717('0x69'),_0x18d4fe['user']['id'],_0x18d4fe[_0x7717('0x63')][_0x7717('0x3b')],_0x18d4fe[_0x7717('0x63')][_0x7717('0x6a')],_0x51bd95[_0x7717('0x6b')]['id'],_0x18d4fe[_0x7717('0x5b')]?JSON[_0x7717('0x28')](_0x18d4fe[_0x7717('0x5b')]):'null');return respondWithRpcPromise(_0x7717('0x6c'),_0x7717('0x6d'),_0x51bd95);}return null;})[_0x7717('0x23')](function(_0x3f0066){var _0xbeb3f1=_0x7717('0x6e')+_0x3f0066['message'][_0x7717('0x6f')];return db[_0x7717('0x70')]['query'](_0xbeb3f1,{'type':db['Sequelize'][_0x7717('0x71')][_0x7717('0x72')],'raw':!![]})[_0x7717('0x23')](function(_0x42e4f3){return _0x42e4f3;});})[_0x7717('0x23')](function(_0x2f4a62){if(_0x2f4a62){_0x51bd95[_0x7717('0x2b')][_0x7717('0x73')]=_0x2f4a62[0x0];if(!_0x18d4fe[_0x7717('0x5b')][_0x7717('0x62')])return;return db[_0x7717('0x74')]['find']({'where':{'id':_0x18d4fe[_0x7717('0x5b')][_0x7717('0x62')],'role':_0x7717('0x64')},'attributes':['id','name',_0x7717('0x75'),_0x7717('0x76'),_0x7717('0x77')],'raw':!![]});}return null;})[_0x7717('0x23')](function(_0x512737){if(!_0x512737)return null;_0x51bd95['message'][_0x7717('0x64')]=_0x512737;return _0x51bd95;})['then'](function(_0x3e10df){if(_0x3e10df){if(_0x18d4fe[_0x7717('0x5b')]['manual']){_0x51bd95[_0x7717('0x2b')][_0x7717('0x78')]=util[_0x7717('0x60')](_0x7717('0x79'),_0x18d4fe['user'][_0x7717('0x3b')]);_0x51bd95[_0x7717('0x2b')][_0x7717('0x7a')]=_0x51bd95[_0x7717('0x7a')];_0x51bd95[_0x7717('0x2b')][_0x7717('0x7b')]=_0x51bd95[_0x7717('0x7a')];_0x51bd95[_0x7717('0x2b')][_0x7717('0x7c')]=_0x7717('0x7d');return respondWithRpcPromise('EventManager',_0x7717('0x7e'),{'event':_0x7717('0x7f'),'message':_0x51bd95['message']},client9002)['then'](function(){return _0x51bd95;});}return _0x51bd95;}return null;})['then'](respondWithResult(_0x145ea3,null))[_0x7717('0x2d')](handleError(_0x145ea3,null));};var interaction_log=require(_0x7717('0x15'))(_0x7717('0x80'));exports['reject']=function(_0x171cd5,_0x402de8,_0x4cb004){var _0x562e3b={'agent':{},'channel':'openchannel'};if(_0x171cd5[_0x7717('0x5b')]['id']){delete _0x171cd5[_0x7717('0x5b')]['id'];}_0x171cd5['body'][_0x7717('0x62')]=_0x171cd5[_0x7717('0x5b')][_0x7717('0x62')]||_0x171cd5[_0x7717('0x63')]['id'];_0x562e3b['agent']['id']=_0x171cd5[_0x7717('0x5b')][_0x7717('0x62')];return db[_0x7717('0x50')][_0x7717('0x59')]({'where':{'id':_0x171cd5[_0x7717('0x55')]['id'],'UserId':null}})[_0x7717('0x23')](handleEntityNotFound(_0x402de8,null))['then'](function(_0x57d00d){if(_0x57d00d){_0x562e3b['message']=_0x57d00d[_0x7717('0x65')]({'plain':!![]});return db[_0x7717('0x81')][_0x7717('0x59')]({'where':{'id':_0x57d00d['OpenchannelInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x402de8,null))[_0x7717('0x23')](function(_0x252322){if(_0x252322){_0x562e3b[_0x7717('0x6b')]=_0x252322[_0x7717('0x65')]({'plain':!![]});interaction_log[_0x7717('0x24')](_0x7717('0x82'),_0x171cd5[_0x7717('0x63')]['id'],_0x171cd5[_0x7717('0x63')][_0x7717('0x3b')],_0x171cd5['user'][_0x7717('0x6a')],_0x562e3b[_0x7717('0x6b')]['id'],_0x171cd5[_0x7717('0x5b')]?JSON[_0x7717('0x28')](_0x171cd5[_0x7717('0x5b')]):_0x7717('0x83'));return respondWithRpcPromise(_0x7717('0x84'),_0x7717('0x85'),_0x562e3b);}return null;})[_0x7717('0x23')](function(_0x12bd0d){var _0x2cf668=_0x7717('0x6e')+_0x12bd0d[_0x7717('0x2b')]['ContactId'];return db[_0x7717('0x70')]['query'](_0x2cf668,{'type':db[_0x7717('0x86')]['QueryTypes'][_0x7717('0x72')],'raw':!![]})['then'](function(_0x423268){return _0x423268;});})[_0x7717('0x23')](function(_0x558f07){if(_0x558f07){_0x562e3b[_0x7717('0x2b')][_0x7717('0x73')]=_0x558f07[0x0];if(!_0x171cd5[_0x7717('0x5b')][_0x7717('0x62')])return;return db['User'][_0x7717('0x59')]({'where':{'id':_0x171cd5['body']['UserId'],'role':'agent'},'attributes':['id',_0x7717('0x3b'),_0x7717('0x75'),'email',_0x7717('0x77')],'raw':!![]});}return null;})[_0x7717('0x23')](function(_0x59c0ca){if(!_0x59c0ca)return null;_0x562e3b[_0x7717('0x2b')][_0x7717('0x64')]=_0x59c0ca;return _0x562e3b;})[_0x7717('0x23')](function(_0x32e0c5){if(_0x32e0c5){_0x32e0c5[_0x7717('0x2b')][_0x7717('0x78')]=util[_0x7717('0x60')]('SIP/%s',_0x171cd5[_0x7717('0x63')]['name']);_0x32e0c5[_0x7717('0x2b')][_0x7717('0x7a')]=_0x562e3b[_0x7717('0x7a')];_0x32e0c5['message']['motionChannel']=_0x562e3b[_0x7717('0x7a')];_0x32e0c5[_0x7717('0x2b')][_0x7717('0x7c')]=_0x7717('0x38');respondWithRpcPromise(_0x7717('0x7e'),'EventManager',{'event':_0x7717('0x87'),'message':_0x32e0c5[_0x7717('0x2b')]},client9002);return _0x562e3b;}return null;})[_0x7717('0x23')](respondWithResult(_0x402de8,null))[_0x7717('0x2d')](handleError(_0x402de8,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 93d466e..77662a9 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 _0x438a=['hasOwnProperty','../../mysqldb','OpenchannelMessage','setMaxListeners','save','remove','emit'];(function(_0x319e0b,_0x35b410){var _0x363e5c=function(_0xfde05d){while(--_0xfde05d){_0x319e0b['push'](_0x319e0b['shift']());}};_0x363e5c(++_0x35b410);}(_0x438a,0x1ac));var _0xa438=function(_0x50fd55,_0x126e13){_0x50fd55=_0x50fd55-0x0;var _0x1e8a4d=_0x438a[_0x50fd55];return _0x1e8a4d;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require(_0xa438('0x0'))['db'][_0xa438('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xa438('0x2')](0x0);var events={'afterCreate':_0xa438('0x3'),'afterUpdate':'update','afterDestroy':_0xa438('0x4')};function emitEvent(_0x233f64){return function(_0x264e39,_0x1a44db,_0x333f1c){OpenchannelMessageEvents[_0xa438('0x5')](_0x233f64+':'+_0x264e39['id'],_0x264e39);OpenchannelMessageEvents[_0xa438('0x5')](_0x233f64,_0x264e39);_0x333f1c(null);};}for(var e in events){if(events[_0xa438('0x6')](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module['exports']=OpenchannelMessageEvents; \ No newline at end of file +var _0xd9bc=['OpenchannelMessage','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x32ca29,_0x3308c8){var _0x4aab90=function(_0x1147e6){while(--_0x1147e6){_0x32ca29['push'](_0x32ca29['shift']());}};_0x4aab90(++_0x3308c8);}(_0xd9bc,0xe4));var _0xcd9b=function(_0x4f48d4,_0x3300c5){_0x4f48d4=_0x4f48d4-0x0;var _0x5a2989=_0xd9bc[_0x4f48d4];return _0x5a2989;};'use strict';var EventEmitter=require(_0xcd9b('0x0'));var OpenchannelMessage=require(_0xcd9b('0x1'))['db'][_0xcd9b('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xcd9b('0x3')](0x0);var events={'afterCreate':_0xcd9b('0x4'),'afterUpdate':_0xcd9b('0x5'),'afterDestroy':'remove'};function emitEvent(_0x1256b6){return function(_0x5654e2,_0x4ecc85,_0x45b3ab){OpenchannelMessageEvents[_0xcd9b('0x6')](_0x1256b6+':'+_0x5654e2['id'],_0x5654e2);OpenchannelMessageEvents['emit'](_0x1256b6,_0x5654e2);_0x45b3ab(null);};}for(var e in events){if(events[_0xcd9b('0x7')](e)){var event=events[e];OpenchannelMessage[_0xcd9b('0x8')](e,emitEvent(event));}}module[_0xcd9b('0x9')]=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index 0423398..8ba8653 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 _0x666e=['bluebird','request-promise','path','rimraf','../../config/environment','./openchannelMessage.attributes','exports','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','models','get','direction','toLowerCase','secret','UserId','OpenchannelInteraction','OpenchannelInteractionId','update','out','CmContact','describe','then','OpenchannelAccount','find','OpenchannelAccountId','Contact','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','format','Interaction','omit','Interactions','POST','method','afterCreate','Message\x20%d\x20forwarded\x20to\x20%s','threadId','catch','error','inspect','finally','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment'];(function(_0x2904a8,_0x73180){var _0x4aae50=function(_0x491df9){while(--_0x491df9){_0x2904a8['push'](_0x2904a8['shift']());}};_0x4aae50(++_0x73180);}(_0x666e,0x1f1));var _0xe666=function(_0x4fdb79,_0x12c116){_0x4fdb79=_0x4fdb79-0x0;var _0x3ec15b=_0x666e[_0x4fdb79];return _0x3ec15b;};'use strict';var _=require(_0xe666('0x0'));var util=require('util');var logger=require(_0xe666('0x1'))('api');var moment=require(_0xe666('0x2'));var BPromise=require(_0xe666('0x3'));var rp=require(_0xe666('0x4'));var fs=require('fs');var path=require(_0xe666('0x5'));var rimraf=require(_0xe666('0x6'));var config=require(_0xe666('0x7'));var attributes=require(_0xe666('0x8'));module[_0xe666('0x9')]=function(_0x555dc3,_0xe3f31){return _0x555dc3['define'](_0xe666('0xa'),attributes,{'tableName':_0xe666('0xb'),'paranoid':![],'indexes':[{'name':_0xe666('0xc'),'fields':[_0xe666('0xd')],'type':_0xe666('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3ea18b,_0x1c7691,_0x3c2252){var _0x525ccc=_0x555dc3[_0xe666('0xf')];var _0x45bbd8=_0x3ea18b[_0xe666('0x10')]({'plain':!![]});if(_0x45bbd8[_0xe666('0x11')][_0xe666('0x12')]()==='in'||_0x45bbd8['direction'][_0xe666('0x12')]()==='out'&&!_0x45bbd8[_0xe666('0x13')]&&!_['isNil'](_0x45bbd8[_0xe666('0x14')])){_0x525ccc[_0xe666('0x15')]['findOne']({'where':{'id':_0x45bbd8[_0xe666('0x16')]}})['then'](function(_0x39bfb5){if(_0x39bfb5){_0x39bfb5[_0xe666('0x17')]({'lastMsgAt':_0x45bbd8['createdAt'],'lastMsgDirection':_0x45bbd8[_0xe666('0x11')]['toLowerCase']()});}})['catch'](function(_0x21c412){console['error'](_0x21c412);});}if(_0x45bbd8['direction']===_0xe666('0x18')&&!_0x45bbd8[_0xe666('0x13')]){var _0x209e8e;_0x525ccc[_0xe666('0x19')][_0xe666('0x1a')]()[_0xe666('0x1b')](function(_0x4757ae){return _0x525ccc[_0xe666('0x1c')][_0xe666('0x1d')]({'where':{'id':_0x45bbd8[_0xe666('0x1e')]},'include':[{'model':_0x525ccc[_0xe666('0x15')],'as':'Interactions','where':{'id':_0x45bbd8[_0xe666('0x16')]},'limit':0x1,'include':[{'model':_0x525ccc[_0xe666('0x19')],'as':_0xe666('0x1f'),'attributes':_['keys'](_0x4757ae)}]}]});})['then'](function(_0x47ba1f){_0x209e8e=_0x47ba1f[_0xe666('0x10')]({'plain':!![]});if(_0x209e8e&&_0x209e8e[_0xe666('0x20')]){logger[_0xe666('0x21')](_0xe666('0x22'),'afterCreate',util[_0xe666('0x23')]('Forwarding\x20message\x20%d\x20to\x20%s',_0x45bbd8['id'],_0x209e8e[_0xe666('0x20')]));if(_0x209e8e['Interactions']&&_0x209e8e['Interactions']['length']){_0x45bbd8[_0xe666('0x24')]=_[_0xe666('0x25')](_0x209e8e[_0xe666('0x26')][0x0],_0xe666('0x1f'));_0x45bbd8['Contact']=_0x209e8e[_0xe666('0x26')][0x0][_0xe666('0x1f')];}var _0x1c7691={'method':_0xe666('0x27'),'uri':encodeURI(_0x209e8e[_0xe666('0x20')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x1c7691[_0xe666('0x28')]){case'GET':_0x1c7691['qs']=_0x45bbd8;break;case'POST':_0x1c7691['body']=_0x45bbd8;break;}return rp(_0x1c7691)['then'](function(_0x5651a7){logger['info'](_0xe666('0x22'),_0xe666('0x29'),util['format'](_0xe666('0x2a'),_0x45bbd8['id'],_0x209e8e[_0xe666('0x20')]));if(_0x5651a7[_0xe666('0xd')][_0xe666('0x2b')]&&_0x5651a7[_0xe666('0xd')]['threadId']!=_0x45bbd8[_0xe666('0x24')][_0xe666('0x2b')]){return _0x525ccc['OpenchannelInteraction']['update']({'threadId':_0x5651a7['body'][_0xe666('0x2b')]},{'where':{'id':_0x45bbd8[_0xe666('0x24')]['id']}});}else{return;}})['then'](function(){return _0x3ea18b[_0xe666('0x17')]({'read':!![]});})[_0xe666('0x2c')](function(_0x3efb70){logger[_0xe666('0x2d')](_0xe666('0x22'),_0xe666('0x29'),util[_0xe666('0x2e')](_0x3efb70,{'showHidden':![],'depth':null}));_0x3c2252();});}else{_0x3c2252();}})[_0xe666('0x2f')](function(){_0x3c2252();});}else{_0x3c2252();}}},'charset':_0xe666('0x30'),'collate':_0xe666('0x31')});}; \ No newline at end of file +var _0x2adb=['info','format','Forwarding\x20message\x20%d\x20to\x20%s','omit','method','GET','POST','OpenchannelMessage,\x20%s,\x20%s','Message\x20%d\x20forwarded\x20to\x20%s','threadId','Interaction','error','afterCreate','inspect','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','exports','define','fti_openchannel_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','findOne','OpenchannelInteractionId','then','update','createdAt','catch','CmContact','describe','find','OpenchannelInteraction','Interactions','Contact','keys','replyUri'];(function(_0x5c82c0,_0x3668aa){var _0x1fc3d9=function(_0x40ee4e){while(--_0x40ee4e){_0x5c82c0['push'](_0x5c82c0['shift']());}};_0x1fc3d9(++_0x3668aa);}(_0x2adb,0x103));var _0xb2ad=function(_0x4df86c,_0x1cc313){_0x4df86c=_0x4df86c-0x0;var _0x2283d4=_0x2adb[_0x4df86c];return _0x2283d4;};'use strict';var _=require(_0xb2ad('0x0'));var util=require(_0xb2ad('0x1'));var logger=require(_0xb2ad('0x2'))('api');var moment=require(_0xb2ad('0x3'));var BPromise=require('bluebird');var rp=require(_0xb2ad('0x4'));var fs=require('fs');var path=require(_0xb2ad('0x5'));var rimraf=require(_0xb2ad('0x6'));var config=require(_0xb2ad('0x7'));var attributes=require('./openchannelMessage.attributes');module[_0xb2ad('0x8')]=function(_0x19362,_0x3b9dcf){return _0x19362[_0xb2ad('0x9')]('OpenchannelMessage',attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':_0xb2ad('0xa'),'fields':[_0xb2ad('0xb')],'type':_0xb2ad('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4c8062,_0x37a213,_0x5ecc4e){var _0x48cd80=_0x19362[_0xb2ad('0xd')];var _0x4546aa=_0x4c8062[_0xb2ad('0xe')]({'plain':!![]});if(_0x4546aa[_0xb2ad('0xf')][_0xb2ad('0x10')]()==='in'||_0x4546aa[_0xb2ad('0xf')][_0xb2ad('0x10')]()===_0xb2ad('0x11')&&!_0x4546aa[_0xb2ad('0x12')]&&!_[_0xb2ad('0x13')](_0x4546aa[_0xb2ad('0x14')])){_0x48cd80['OpenchannelInteraction'][_0xb2ad('0x15')]({'where':{'id':_0x4546aa[_0xb2ad('0x16')]}})[_0xb2ad('0x17')](function(_0x548074){if(_0x548074){_0x548074[_0xb2ad('0x18')]({'lastMsgAt':_0x4546aa[_0xb2ad('0x19')],'lastMsgDirection':_0x4546aa[_0xb2ad('0xf')][_0xb2ad('0x10')]()});}})[_0xb2ad('0x1a')](function(_0x262a2d){console['error'](_0x262a2d);});}if(_0x4546aa[_0xb2ad('0xf')]===_0xb2ad('0x11')&&!_0x4546aa[_0xb2ad('0x12')]){var _0x4a940d;_0x48cd80[_0xb2ad('0x1b')][_0xb2ad('0x1c')]()[_0xb2ad('0x17')](function(_0x2a13c1){return _0x48cd80['OpenchannelAccount'][_0xb2ad('0x1d')]({'where':{'id':_0x4546aa['OpenchannelAccountId']},'include':[{'model':_0x48cd80[_0xb2ad('0x1e')],'as':_0xb2ad('0x1f'),'where':{'id':_0x4546aa['OpenchannelInteractionId']},'limit':0x1,'include':[{'model':_0x48cd80[_0xb2ad('0x1b')],'as':_0xb2ad('0x20'),'attributes':_[_0xb2ad('0x21')](_0x2a13c1)}]}]});})[_0xb2ad('0x17')](function(_0x4b1713){_0x4a940d=_0x4b1713[_0xb2ad('0xe')]({'plain':!![]});if(_0x4a940d&&_0x4a940d[_0xb2ad('0x22')]){logger[_0xb2ad('0x23')]('OpenchannelMessage,\x20%s,\x20%s','afterCreate',util[_0xb2ad('0x24')](_0xb2ad('0x25'),_0x4546aa['id'],_0x4a940d[_0xb2ad('0x22')]));if(_0x4a940d['Interactions']&&_0x4a940d['Interactions']['length']){_0x4546aa['Interaction']=_[_0xb2ad('0x26')](_0x4a940d[_0xb2ad('0x1f')][0x0],_0xb2ad('0x20'));_0x4546aa[_0xb2ad('0x20')]=_0x4a940d['Interactions'][0x0][_0xb2ad('0x20')];}var _0x37a213={'method':'POST','uri':encodeURI(_0x4a940d[_0xb2ad('0x22')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x37a213[_0xb2ad('0x27')]){case _0xb2ad('0x28'):_0x37a213['qs']=_0x4546aa;break;case _0xb2ad('0x29'):_0x37a213['body']=_0x4546aa;break;}return rp(_0x37a213)[_0xb2ad('0x17')](function(_0x1d9859){logger['info'](_0xb2ad('0x2a'),'afterCreate',util[_0xb2ad('0x24')](_0xb2ad('0x2b'),_0x4546aa['id'],_0x4a940d[_0xb2ad('0x22')]));if(_0x1d9859[_0xb2ad('0xb')][_0xb2ad('0x2c')]&&_0x1d9859[_0xb2ad('0xb')][_0xb2ad('0x2c')]!=_0x4546aa[_0xb2ad('0x2d')]['threadId']){return _0x48cd80[_0xb2ad('0x1e')][_0xb2ad('0x18')]({'threadId':_0x1d9859['body']['threadId']},{'where':{'id':_0x4546aa[_0xb2ad('0x2d')]['id']}});}else{return;}})[_0xb2ad('0x17')](function(){return _0x4c8062[_0xb2ad('0x18')]({'read':!![]});})[_0xb2ad('0x1a')](function(_0x503ae){logger[_0xb2ad('0x2e')](_0xb2ad('0x2a'),_0xb2ad('0x2f'),util[_0xb2ad('0x30')](_0x503ae,{'showHidden':![],'depth':null}));_0x5ecc4e();});}else{_0x5ecc4e();}})['finally'](function(){_0x5ecc4e();});}else{_0x5ecc4e();}}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index fc7c56c..2666f45 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 _0xadb5=['debug','request\x20sent','stringify','error','code','message','info','result','catch','OpenchannelMessage','body','raw','CreateOpenchannelMessage','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','request','then','OpenchannelMessage,\x20%s,\x20%s'];(function(_0x3327f1,_0x1a36ae){var _0x10a5c0=function(_0x379d36){while(--_0x379d36){_0x3327f1['push'](_0x3327f1['shift']());}};_0x10a5c0(++_0x1a36ae);}(_0xadb5,0xad));var _0x5adb=function(_0x27e6bb,_0x463511){_0x27e6bb=_0x27e6bb-0x0;var _0x29d451=_0xadb5[_0x27e6bb];return _0x29d451;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});config[_0x5adb('0xa')]=_[_0x5adb('0xb')](config[_0x5adb('0xa')],{'host':_0x5adb('0xc'),'port':0x18eb});var socket=require(_0x5adb('0xd'))(new Redis(config[_0x5adb('0xa')]));require(_0x5adb('0xe'))[_0x5adb('0xf')](socket);function respondWithRpcPromise(_0x336bad,_0x129f5a,_0x275428){return new BPromise(function(_0x563d86,_0x4c268d){return client[_0x5adb('0x10')](_0x336bad,_0x275428)[_0x5adb('0x11')](function(_0x82e67e){logger['info'](_0x5adb('0x12'),_0x129f5a,'request\x20sent');logger[_0x5adb('0x13')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x129f5a,_0x5adb('0x14'),JSON[_0x5adb('0x15')](_0x82e67e));if(_0x82e67e[_0x5adb('0x16')]){if(_0x82e67e['error'][_0x5adb('0x17')]===0x1f4){logger[_0x5adb('0x16')](_0x5adb('0x12'),_0x129f5a,_0x82e67e['error'][_0x5adb('0x18')]);return _0x4c268d(_0x82e67e['error'][_0x5adb('0x18')]);}logger[_0x5adb('0x16')](_0x5adb('0x12'),_0x129f5a,_0x82e67e[_0x5adb('0x16')][_0x5adb('0x18')]);return _0x563d86(_0x82e67e[_0x5adb('0x16')][_0x5adb('0x18')]);}else{logger[_0x5adb('0x19')](_0x5adb('0x12'),_0x129f5a,'request\x20sent');_0x563d86(_0x82e67e[_0x5adb('0x1a')]['message']);}})[_0x5adb('0x1b')](function(_0x558f76){logger[_0x5adb('0x16')]('OpenchannelMessage,\x20%s,\x20%s',_0x129f5a,_0x558f76);_0x4c268d(_0x558f76);});});}exports['CreateOpenchannelMessage']=function(_0x1fbaa5){var _0x1bed20=this;return new Promise(function(_0x438671,_0x1fd4a7){return db[_0x5adb('0x1c')]['create'](_0x1fbaa5[_0x5adb('0x1d')],{'raw':_0x1fbaa5['options']?_0x1fbaa5['options'][_0x5adb('0x1e')]===undefined?!![]:![]:!![]})[_0x5adb('0x11')](function(_0x1a38d3){logger[_0x5adb('0x19')](_0x5adb('0x1f'),_0x1fbaa5);logger[_0x5adb('0x13')](_0x5adb('0x1f'),_0x1fbaa5,JSON['stringify'](_0x1a38d3));_0x438671(_0x1a38d3);})[_0x5adb('0x1b')](function(_0x373cc3){logger[_0x5adb('0x16')](_0x5adb('0x1f'),_0x373cc3[_0x5adb('0x18')],_0x1fbaa5);_0x1fd4a7(_0x1bed20['error'](0x1f4,_0x373cc3[_0x5adb('0x18')]));});});}; \ No newline at end of file +var _0xdb28=['then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','CreateOpenchannelMessage','OpenchannelMessage','create','body','options','raw','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./openchannelMessage.socket','register','request'];(function(_0xf18977,_0x87ecc4){var _0x360bb8=function(_0x58a178){while(--_0x58a178){_0xf18977['push'](_0xf18977['shift']());}};_0x360bb8(++_0x87ecc4);}(_0xdb28,0x106));var _0x8db2=function(_0x2c6794,_0x54cf82){_0x2c6794=_0x2c6794-0x0;var _0x5d7719=_0xdb28[_0x2c6794];return _0x5d7719;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});config['redis']=_[_0x8db2('0xb')](config[_0x8db2('0xc')],{'host':_0x8db2('0xd'),'port':0x18eb});var socket=require(_0x8db2('0xe'))(new Redis(config[_0x8db2('0xc')]));require(_0x8db2('0xf'))[_0x8db2('0x10')](socket);function respondWithRpcPromise(_0x4ba340,_0x30dc90,_0x476216){return new BPromise(function(_0x1f62af,_0x57015f){return client[_0x8db2('0x11')](_0x4ba340,_0x476216)[_0x8db2('0x12')](function(_0x576475){logger[_0x8db2('0x13')](_0x8db2('0x14'),_0x30dc90,_0x8db2('0x15'));logger[_0x8db2('0x16')](_0x8db2('0x17'),_0x30dc90,'request\x20sent',JSON['stringify'](_0x576475));if(_0x576475[_0x8db2('0x18')]){if(_0x576475[_0x8db2('0x18')][_0x8db2('0x19')]===0x1f4){logger[_0x8db2('0x18')](_0x8db2('0x14'),_0x30dc90,_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);return _0x57015f(_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);}logger[_0x8db2('0x18')]('OpenchannelMessage,\x20%s,\x20%s',_0x30dc90,_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);return _0x1f62af(_0x576475['error'][_0x8db2('0x1a')]);}else{logger[_0x8db2('0x13')](_0x8db2('0x14'),_0x30dc90,_0x8db2('0x15'));_0x1f62af(_0x576475[_0x8db2('0x1b')][_0x8db2('0x1a')]);}})['catch'](function(_0x5df464){logger[_0x8db2('0x18')](_0x8db2('0x14'),_0x30dc90,_0x5df464);_0x57015f(_0x5df464);});});}exports[_0x8db2('0x1c')]=function(_0x1b64e4){var _0x58562e=this;return new Promise(function(_0x431d60,_0x36a9ff){return db[_0x8db2('0x1d')][_0x8db2('0x1e')](_0x1b64e4[_0x8db2('0x1f')],{'raw':_0x1b64e4['options']?_0x1b64e4[_0x8db2('0x20')][_0x8db2('0x21')]===undefined?!![]:![]:!![]})[_0x8db2('0x12')](function(_0x125be2){logger[_0x8db2('0x13')](_0x8db2('0x1c'),_0x1b64e4);logger[_0x8db2('0x16')]('CreateOpenchannelMessage',_0x1b64e4,JSON[_0x8db2('0x22')](_0x125be2));_0x431d60(_0x125be2);})['catch'](function(_0x5725f0){logger['error']('CreateOpenchannelMessage',_0x5725f0[_0x8db2('0x1a')],_0x1b64e4);_0x36a9ff(_0x58562e[_0x8db2('0x18')](0x1f4,_0x5725f0[_0x8db2('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index 00daa48..c270b45 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 _0x1e6c=['./openchannelMessage.events','remove','update','removeListener','register','length'];(function(_0x118e6a,_0x151481){var _0x38670b=function(_0x3bfb57){while(--_0x3bfb57){_0x118e6a['push'](_0x118e6a['shift']());}};_0x38670b(++_0x151481);}(_0x1e6c,0x11a));var _0xc1e6=function(_0x2d7226,_0x35edb1){_0x2d7226=_0x2d7226-0x0;var _0x59b03f=_0x1e6c[_0x2d7226];return _0x59b03f;};'use strict';var OpenchannelMessageEvents=require(_0xc1e6('0x0'));var events=['save',_0xc1e6('0x1'),_0xc1e6('0x2')];function createListener(_0x3eea0c,_0x17d44e){return function(_0x21faab){_0x17d44e['emit'](_0x3eea0c,_0x21faab);};}function removeListener(_0x579250,_0x477d95){return function(){OpenchannelMessageEvents[_0xc1e6('0x3')](_0x579250,_0x477d95);};}exports[_0xc1e6('0x4')]=function(_0x157b8d){for(var _0x36968b=0x0,_0x36c625=events[_0xc1e6('0x5')];_0x36968b<_0x36c625;_0x36968b++){var _0x5cd563=events[_0x36968b];var _0x399c3e=createListener('openchannelMessage:'+_0x5cd563,_0x157b8d);OpenchannelMessageEvents['on'](_0x5cd563,_0x399c3e);}}; \ No newline at end of file +var _0x6b4e=['removeListener','register','length','openchannelMessage:','save','emit'];(function(_0x4145ed,_0x1965e3){var _0x2294a6=function(_0x21c3bb){while(--_0x21c3bb){_0x4145ed['push'](_0x4145ed['shift']());}};_0x2294a6(++_0x1965e3);}(_0x6b4e,0x1a8));var _0xe6b4=function(_0x2aff56,_0x3ade94){_0x2aff56=_0x2aff56-0x0;var _0x2ffdce=_0x6b4e[_0x2aff56];return _0x2ffdce;};'use strict';var OpenchannelMessageEvents=require('./openchannelMessage.events');var events=[_0xe6b4('0x0'),'remove','update'];function createListener(_0x5c3328,_0x54da12){return function(_0x4566e9){_0x54da12[_0xe6b4('0x1')](_0x5c3328,_0x4566e9);};}function removeListener(_0x1aedc5,_0x344db1){return function(){OpenchannelMessageEvents[_0xe6b4('0x2')](_0x1aedc5,_0x344db1);};}exports[_0xe6b4('0x3')]=function(_0x598f8c){for(var _0x29c81b=0x0,_0x3458d8=events[_0xe6b4('0x4')];_0x29c81b<_0x3458d8;_0x29c81b++){var _0x1d062b=events[_0x29c81b];var _0x15cf31=createListener(_0xe6b4('0x5')+_0x1d062b,_0x598f8c);OpenchannelMessageEvents['on'](_0x1d062b,_0x15cf31);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 0acc3e8..4cc5f46 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 _0x540c=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelQueue.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','/:id/users','getAgents','post','addTeams','update','delete','destroy','removeTeams','exports','multer','path'];(function(_0x24483c,_0x38fe5a){var _0x3367e0=function(_0x256625){while(--_0x256625){_0x24483c['push'](_0x24483c['shift']());}};_0x3367e0(++_0x38fe5a);}(_0x540c,0x193));var _0xc540=function(_0x357655,_0x3ea11a){_0x357655=_0x357655-0x0;var _0x5b07c6=_0x540c[_0x357655];return _0x5b07c6;};'use strict';var multer=require(_0xc540('0x0'));var util=require('util');var path=require(_0xc540('0x1'));var timeout=require(_0xc540('0x2'));var express=require(_0xc540('0x3'));var router=express['Router']();var fs_extra=require(_0xc540('0x4'));var auth=require(_0xc540('0x5'));var interaction=require(_0xc540('0x6'));var config=require('../../config/environment');var controller=require(_0xc540('0x7'));router['get']('/',auth[_0xc540('0x8')](),controller[_0xc540('0x9')]);router[_0xc540('0xa')](_0xc540('0xb'),auth[_0xc540('0x8')](),controller[_0xc540('0xc')]);router[_0xc540('0xa')](_0xc540('0xd'),auth['isAuthenticated'](),controller[_0xc540('0xe')]);router[_0xc540('0xa')](_0xc540('0xf'),auth[_0xc540('0x8')](),controller[_0xc540('0x10')]);router[_0xc540('0xa')](_0xc540('0x11'),auth[_0xc540('0x8')](),controller['getTeams']);router[_0xc540('0xa')](_0xc540('0x12'),auth[_0xc540('0x8')](),controller[_0xc540('0x13')]);router[_0xc540('0x14')]('/',auth[_0xc540('0x8')](),controller['create']);router[_0xc540('0x14')](_0xc540('0x11'),auth[_0xc540('0x8')](),controller[_0xc540('0x15')]);router[_0xc540('0x14')](_0xc540('0x12'),auth[_0xc540('0x8')](),controller['addAgents']);router['put'](_0xc540('0xd'),auth['isAuthenticated'](),controller[_0xc540('0x16')]);router[_0xc540('0x17')]('/:id',auth[_0xc540('0x8')](),controller[_0xc540('0x18')]);router[_0xc540('0x17')]('/:id/teams',auth['isAuthenticated'](),controller[_0xc540('0x19')]);router['delete'](_0xc540('0x12'),auth[_0xc540('0x8')](),controller['removeAgents']);module[_0xc540('0x1a')]=router; \ No newline at end of file +var _0x4369=['getAgents','addTeams','post','addAgents','update','delete','destroy','removeTeams','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','/:id/members','/:id/teams','getTeams','/:id/users'];(function(_0x265006,_0x3425b0){var _0x5923c3=function(_0x1138c2){while(--_0x1138c2){_0x265006['push'](_0x265006['shift']());}};_0x5923c3(++_0x3425b0);}(_0x4369,0xab));var _0x9436=function(_0x214266,_0x1f6f52){_0x214266=_0x214266-0x0;var _0x568f75=_0x4369[_0x214266];return _0x568f75;};'use strict';var multer=require(_0x9436('0x0'));var util=require(_0x9436('0x1'));var path=require(_0x9436('0x2'));var timeout=require(_0x9436('0x3'));var express=require(_0x9436('0x4'));var router=express[_0x9436('0x5')]();var fs_extra=require(_0x9436('0x6'));var auth=require(_0x9436('0x7'));var interaction=require(_0x9436('0x8'));var config=require('../../config/environment');var controller=require('./openchannelQueue.controller');router[_0x9436('0x9')]('/',auth[_0x9436('0xa')](),controller[_0x9436('0xb')]);router[_0x9436('0x9')]('/describe',auth[_0x9436('0xa')](),controller['describe']);router[_0x9436('0x9')](_0x9436('0xc'),auth[_0x9436('0xa')](),controller[_0x9436('0xd')]);router['get'](_0x9436('0xe'),auth['isAuthenticated'](),controller['getMembers']);router['get'](_0x9436('0xf'),auth['isAuthenticated'](),controller[_0x9436('0x10')]);router['get'](_0x9436('0x11'),auth[_0x9436('0xa')](),controller[_0x9436('0x12')]);router['post']('/',auth[_0x9436('0xa')](),controller['create']);router['post'](_0x9436('0xf'),auth['isAuthenticated'](),controller[_0x9436('0x13')]);router[_0x9436('0x14')](_0x9436('0x11'),auth['isAuthenticated'](),controller[_0x9436('0x15')]);router['put'](_0x9436('0xc'),auth[_0x9436('0xa')](),controller[_0x9436('0x16')]);router[_0x9436('0x17')](_0x9436('0xc'),auth['isAuthenticated'](),controller[_0x9436('0x18')]);router[_0x9436('0x17')](_0x9436('0xf'),auth['isAuthenticated'](),controller[_0x9436('0x19')]);router[_0x9436('0x17')]('/:id/users',auth[_0x9436('0xa')](),controller[_0x9436('0x1a')]);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 b9f771f..2eef9be 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 _0xb424=['STRING','name','INTEGER','ENUM','rrmemory','sequelize','exports'];(function(_0xb24a3e,_0x4a3594){var _0x4038d7=function(_0x1ea3c3){while(--_0x1ea3c3){_0xb24a3e['push'](_0xb24a3e['shift']());}};_0x4038d7(++_0x4a3594);}(_0xb424,0x186));var _0x4b42=function(_0x999b85,_0x1edc2b){_0x999b85=_0x999b85-0x0;var _0x1d7124=_0xb424[_0x999b85];return _0x1d7124;};'use strict';var Sequelize=require(_0x4b42('0x0'));module[_0x4b42('0x1')]={'name':{'type':Sequelize[_0x4b42('0x2')],'unique':_0x4b42('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x4b42('0x2')]},'timeout':{'type':Sequelize[_0x4b42('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x4b42('0x5')](_0x4b42('0x6'),'beepall','roundrobin')}}; \ No newline at end of file +var _0xbb35=['INTEGER','ENUM','rrmemory','STRING','name'];(function(_0x28e926,_0xbafb8a){var _0x59335c=function(_0x81a596){while(--_0x81a596){_0x28e926['push'](_0x28e926['shift']());}};_0x59335c(++_0xbafb8a);}(_0xbb35,0x18e));var _0x5bb3=function(_0x19d7d9,_0x315d19){_0x19d7d9=_0x19d7d9-0x0;var _0x51d5df=_0xbb35[_0x19d7d9];return _0x51d5df;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x5bb3('0x0')],'unique':_0x5bb3('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x5bb3('0x0')]},'timeout':{'type':Sequelize[_0x5bb3('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x5bb3('0x3')](_0x5bb3('0x4'),'beepall','roundrobin')}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 322519c..73cac68 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 _0xa471=['limit','count','set','Content-Range','update','then','destroy','get','OpenchannelQueues','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','getOptions','include','OpenchannelQueue','findAll','rows','catch','params','model','keys','query','filters','intersection','attributes','fields','length','merge','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','order','where','pick','OpenchannelQueueId','filter','UserOpenchannelQueue','User','findAndCountAll','agent','openchannelPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','sort','hasOwnProperty','addTeams','ids','Team','Agents','online','interface','flatMap','transaction','each','findOrCreate','forEach','emit','userOpenchannelQueue:save','removeTeams','select','field','from','team_has_openchannel_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','every','TeamId','includes','union','compact','value','isEmpty','userOpenchannelQueue:remove','omit','removeAgents','getAgents','nolimit','bluebird','util','lodash','squel','../../components/parsers/qs','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','status','end','json','offset','undefined'];(function(_0x40162a,_0x265b0c){var _0x488161=function(_0x9307e6){while(--_0x9307e6){_0x40162a['push'](_0x40162a['shift']());}};_0x488161(++_0x265b0c);}(_0xa471,0x162));var _0x1a47=function(_0x257642,_0x270a80){_0x257642=_0x257642-0x0;var _0x3d813b=_0xa471[_0x257642];return _0x3d813b;};'use strict';var BPromise=require(_0x1a47('0x0'));var util=require(_0x1a47('0x1'));var _=require(_0x1a47('0x2'));var squel=require(_0x1a47('0x3'));var Redis=require('ioredis');var qs=require(_0x1a47('0x4'));var logger=require('../../config/logger')(_0x1a47('0x5'));var config=require('../../config/environment');var db=require(_0x1a47('0x6'))['db'];config[_0x1a47('0x7')]=_[_0x1a47('0x8')](config['redis'],{'host':_0x1a47('0x9'),'port':0x18eb});var socket=require(_0x1a47('0xa'))(new Redis(config[_0x1a47('0x7')]));require(_0x1a47('0xb'))[_0x1a47('0xc')](socket);function respondWithStatusCode(_0x5aa098,_0x5f3e4f){_0x5f3e4f=_0x5f3e4f||0xcc;return function(_0x1bc7db){if(_0x1bc7db){return _0x5aa098['sendStatus'](_0x5f3e4f);}return _0x5aa098[_0x1a47('0xd')](_0x5f3e4f)[_0x1a47('0xe')]();};}function respondWithResult(_0x160d08,_0x4c23f7){_0x4c23f7=_0x4c23f7||0xc8;return function(_0x4bc936){if(_0x4bc936){return _0x160d08[_0x1a47('0xd')](_0x4c23f7)[_0x1a47('0xf')](_0x4bc936);}};}function respondWithFilteredResult(_0x11cca9,_0x517db2){return function(_0x1e56a6){if(_0x1e56a6){var _0x48fc0d=typeof _0x517db2[_0x1a47('0x10')]===_0x1a47('0x11')&&typeof _0x517db2[_0x1a47('0x12')]==='undefined';var _0x193b67=_0x1e56a6[_0x1a47('0x13')];var _0x43dc82=_0x48fc0d?0x0:_0x517db2[_0x1a47('0x10')];var _0x238a95=_0x48fc0d?_0x1e56a6[_0x1a47('0x13')]:_0x517db2[_0x1a47('0x10')]+_0x517db2['limit'];var _0x494e6a;if(_0x238a95>=_0x193b67){_0x238a95=_0x193b67;_0x494e6a=0xc8;}else{_0x494e6a=0xce;}_0x11cca9[_0x1a47('0xd')](_0x494e6a);return _0x11cca9[_0x1a47('0x14')](_0x1a47('0x15'),_0x43dc82+'-'+_0x238a95+'/'+_0x193b67)[_0x1a47('0xf')](_0x1e56a6);}return null;};}function saveUpdates(_0x5a0216){return function(_0x14635b){if(_0x14635b){return _0x14635b[_0x1a47('0x16')](_0x5a0216)[_0x1a47('0x17')](function(_0x42780d){return _0x42780d;});}return null;};}function removeEntity(_0x2ad5e6){return function(_0x4bf069){if(_0x4bf069){return _0x4bf069[_0x1a47('0x18')]()[_0x1a47('0x17')](function(){var _0x2e51ac=_0x4bf069[_0x1a47('0x19')]({'plain':!![]});var _0x50d1c7=_0x1a47('0x1a');return db[_0x1a47('0x1b')][_0x1a47('0x18')]({'where':{'type':_0x50d1c7,'resourceId':_0x2e51ac['id']}})[_0x1a47('0x17')](function(){return _0x4bf069;});})[_0x1a47('0x17')](function(){_0x2ad5e6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5a9e3d){return function(_0x155b80){if(!_0x155b80){_0x5a9e3d['sendStatus'](0x194);}return _0x155b80;};}function handleError(_0x2ab529,_0x3f16e1){_0x3f16e1=_0x3f16e1||0x1f4;return function(_0x55a435){logger[_0x1a47('0x1c')](_0x55a435[_0x1a47('0x1d')]);if(_0x55a435[_0x1a47('0x1e')]){delete _0x55a435['name'];}_0x2ab529[_0x1a47('0xd')](_0x3f16e1)[_0x1a47('0x1f')](_0x55a435);};}exports[_0x1a47('0x20')]=function(_0x7a168a,_0x15a69){var _0x27830f={};var _0x9d298f={'count':0x0,'rows':[]};var _0x174bd3=_[_0x1a47('0x21')](db['OpenchannelQueue'][_0x1a47('0x22')],function(_0x22b61c){return{'name':_0x22b61c[_0x1a47('0x23')],'type':_0x22b61c[_0x1a47('0x24')]['key']};});_0x27830f=qs[_0x1a47('0x25')](_0x174bd3,_0x7a168a);var _0x4a9bfc={'where':_0x27830f['where']};return db['OpenchannelQueue'][_0x1a47('0x13')](_0x4a9bfc)[_0x1a47('0x17')](function(_0x3ddd37){_0x9d298f[_0x1a47('0x13')]=_0x3ddd37;_0x27830f[_0x1a47('0x26')]=qs[_0x1a47('0x26')](_0x7a168a['query']);return db[_0x1a47('0x27')][_0x1a47('0x28')](_0x27830f);})[_0x1a47('0x17')](function(_0x724817){_0x9d298f[_0x1a47('0x29')]=_0x724817;return _0x9d298f;})[_0x1a47('0x17')](respondWithFilteredResult(_0x15a69,_0x27830f))[_0x1a47('0x2a')](handleError(_0x15a69,null));};exports['show']=function(_0x4c512d,_0x4a7060){var _0x903315={'raw':!![],'where':{'id':_0x4c512d[_0x1a47('0x2b')]['id']}},_0x3875f8={};_0x3875f8[_0x1a47('0x2c')]=_[_0x1a47('0x2d')](db[_0x1a47('0x27')][_0x1a47('0x22')]);_0x3875f8[_0x1a47('0x2e')]=_[_0x1a47('0x2d')](_0x4c512d[_0x1a47('0x2e')]);_0x3875f8[_0x1a47('0x2f')]=_[_0x1a47('0x30')](_0x3875f8[_0x1a47('0x2c')],_0x3875f8[_0x1a47('0x2e')]);_0x903315[_0x1a47('0x31')]=_['intersection'](_0x3875f8[_0x1a47('0x2c')],qs[_0x1a47('0x32')](_0x4c512d['query']['fields']));_0x903315[_0x1a47('0x31')]=_0x903315[_0x1a47('0x31')][_0x1a47('0x33')]?_0x903315[_0x1a47('0x31')]:_0x3875f8[_0x1a47('0x2c')];if(_0x4c512d[_0x1a47('0x2e')]['includeAll']){_0x903315[_0x1a47('0x26')]=[{'all':!![]}];}_0x903315=_[_0x1a47('0x34')]({},_0x903315,_0x4c512d[_0x1a47('0x35')]);return db[_0x1a47('0x27')][_0x1a47('0x36')](_0x903315)[_0x1a47('0x17')](handleEntityNotFound(_0x4a7060,null))[_0x1a47('0x17')](respondWithResult(_0x4a7060,null))[_0x1a47('0x2a')](handleError(_0x4a7060,null));};exports[_0x1a47('0x37')]=function(_0x2a97dc,_0x44e087){return db[_0x1a47('0x27')][_0x1a47('0x37')](_0x2a97dc[_0x1a47('0x38')],{})['then'](function(_0x15a517){var _0x13894a=_0x2a97dc['user']['get']({'plain':!![]});if(!_0x13894a)throw new Error(_0x1a47('0x39'));if(_0x13894a[_0x1a47('0x3a')]===_0x1a47('0x3b')){var _0x3da6b9=_0x15a517['get']({'plain':!![]});var _0x5b8232=_0x1a47('0x1a');return db['UserProfileSection'][_0x1a47('0x36')]({'where':{'name':_0x5b8232,'userProfileId':_0x13894a[_0x1a47('0x3c')]},'raw':!![]})[_0x1a47('0x17')](function(_0x58462d){if(_0x58462d&&_0x58462d[_0x1a47('0x3d')]===0x0){return db[_0x1a47('0x1b')][_0x1a47('0x37')]({'name':_0x3da6b9[_0x1a47('0x1e')],'resourceId':_0x3da6b9['id'],'type':_0x58462d['name'],'sectionId':_0x58462d['id']},{})['then'](function(){return _0x15a517;});}else{return _0x15a517;}})['catch'](function(_0x1874fc){logger[_0x1a47('0x1c')](_0x1a47('0x3e'),_0x1874fc);throw _0x1874fc;});}return _0x15a517;})[_0x1a47('0x17')](respondWithResult(_0x44e087,0xc9))[_0x1a47('0x2a')](handleError(_0x44e087,null));};exports['update']=function(_0x3228a9,_0x825a07){if(_0x3228a9['body']['id']){delete _0x3228a9[_0x1a47('0x38')]['id'];}return db[_0x1a47('0x27')][_0x1a47('0x36')]({'where':{'id':_0x3228a9[_0x1a47('0x2b')]['id']}})[_0x1a47('0x17')](handleEntityNotFound(_0x825a07,null))[_0x1a47('0x17')](saveUpdates(_0x3228a9[_0x1a47('0x38')],null))[_0x1a47('0x17')](respondWithResult(_0x825a07,null))[_0x1a47('0x2a')](handleError(_0x825a07,null));};exports[_0x1a47('0x18')]=function(_0x47b94f,_0x19ba82){return db[_0x1a47('0x27')][_0x1a47('0x36')]({'where':{'id':_0x47b94f[_0x1a47('0x2b')]['id']}})[_0x1a47('0x17')](handleEntityNotFound(_0x19ba82,null))[_0x1a47('0x17')](removeEntity(_0x19ba82,null))[_0x1a47('0x2a')](handleError(_0x19ba82,null));};exports[_0x1a47('0x3f')]=function(_0x5cf3b0,_0xa1d044){return db['OpenchannelQueue'][_0x1a47('0x3f')]()['then'](respondWithResult(_0xa1d044,null))[_0x1a47('0x2a')](handleError(_0xa1d044,null));};exports[_0x1a47('0x40')]=function(_0x5b0034,_0x6161e2){var _0x24af84={'raw':!![],'where':{}},_0x149e34={},_0x5ec44c;return db[_0x1a47('0x27')][_0x1a47('0x41')]({'where':{'id':_0x5b0034[_0x1a47('0x2b')]['id']}})[_0x1a47('0x17')](handleEntityNotFound(_0x6161e2,null))[_0x1a47('0x17')](function(_0x2058ba){if(_0x2058ba){_0x5ec44c=_0x2058ba[_0x1a47('0x19')]({'plain':!![]});_0x149e34['model']=_[_0x1a47('0x2d')](db['UserOpenchannelQueue'][_0x1a47('0x22')]);_0x149e34[_0x1a47('0x2e')]=_[_0x1a47('0x2d')](_0x5b0034['query']);_0x149e34[_0x1a47('0x2f')]=_[_0x1a47('0x30')](_0x149e34[_0x1a47('0x2c')],_0x149e34[_0x1a47('0x2e')]);_0x24af84[_0x1a47('0x31')]=_['intersection'](_0x149e34[_0x1a47('0x2c')],qs['fields'](_0x5b0034[_0x1a47('0x2e')][_0x1a47('0x32')]));_0x24af84[_0x1a47('0x31')]=_0x24af84[_0x1a47('0x31')][_0x1a47('0x33')]?_0x24af84[_0x1a47('0x31')]:_0x149e34[_0x1a47('0x2c')];if(!_0x5b0034[_0x1a47('0x2e')]['hasOwnProperty']('nolimit')){_0x24af84[_0x1a47('0x12')]=qs['limit'](_0x5b0034[_0x1a47('0x2e')][_0x1a47('0x12')]);_0x24af84[_0x1a47('0x10')]=qs[_0x1a47('0x10')](_0x5b0034[_0x1a47('0x2e')][_0x1a47('0x10')]);}_0x24af84[_0x1a47('0x42')]=qs['sort'](_0x5b0034[_0x1a47('0x2e')]['sort']);_0x24af84[_0x1a47('0x43')]=qs['filters'](_[_0x1a47('0x44')](_0x5b0034[_0x1a47('0x2e')],_0x149e34[_0x1a47('0x2f')]));_0x24af84[_0x1a47('0x43')][_0x1a47('0x45')]=_0x2058ba['id'];if(_0x5b0034[_0x1a47('0x2e')][_0x1a47('0x46')]){_0x24af84[_0x1a47('0x43')]=_[_0x1a47('0x34')](_0x24af84[_0x1a47('0x43')],{'$or':_[_0x1a47('0x21')](_0x24af84[_0x1a47('0x31')],function(_0x34915d){var _0x4b5c36={};_0x4b5c36[_0x34915d]={'$like':'%'+_0x5b0034[_0x1a47('0x2e')][_0x1a47('0x46')]+'%'};return _0x4b5c36;})});}_0x24af84=_[_0x1a47('0x34')]({},_0x24af84,_0x5b0034[_0x1a47('0x35')]);return db[_0x1a47('0x47')][_0x1a47('0x28')](_0x24af84);}})[_0x1a47('0x17')](function(_0xe86e69){if(_0xe86e69){return db[_0x1a47('0x48')][_0x1a47('0x49')]({'where':{'id':_[_0x1a47('0x21')](_0xe86e69,'UserId'),'role':_0x1a47('0x4a')},'attributes':['id',_0x1a47('0x1e'),_0x1a47('0x4b'),_0x1a47('0x4c'),_0x1a47('0x4d')]});}})['then'](function(_0xfe0a36){if(_0xfe0a36){return{'count':_0xfe0a36[_0x1a47('0x13')],'rows':_[_0x1a47('0x21')](_0xfe0a36[_0x1a47('0x29')],function(_0x2975a0){return{'membername':_0x2975a0[_0x1a47('0x1e')],'UserId':_0x2975a0['id'],'queue_name':_0x5ec44c[_0x1a47('0x1e')],'OpenchannelQueueId':_0x5ec44c['id'],'interface':util[_0x1a47('0x4e')](_0x1a47('0x4f'),_0x1a47('0x50'),_0x2975a0[_0x1a47('0x1e')]),'penalty':0x0,'paused':_0x2975a0[_0x1a47('0x4b')],'createdAt':_0x2975a0['createdAt'],'updatedAt':_0x2975a0[_0x1a47('0x4c')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x6161e2,_0x24af84))['catch'](handleError(_0x6161e2,null));};exports[_0x1a47('0x51')]=function(_0x4b485e,_0x5ac3ef){var _0x110161={};var _0x16f2fa={};var _0x886e90;var _0x3d154f;return db['OpenchannelQueue']['findOne']({'where':{'id':_0x4b485e[_0x1a47('0x2b')]['id']}})[_0x1a47('0x17')](handleEntityNotFound(_0x5ac3ef,null))[_0x1a47('0x17')](function(_0x4f3fbf){if(_0x4f3fbf){_0x886e90=_0x4f3fbf;_0x16f2fa[_0x1a47('0x2c')]=_[_0x1a47('0x2d')](db['Team'][_0x1a47('0x22')]);_0x16f2fa['query']=_[_0x1a47('0x2d')](_0x4b485e['query']);_0x16f2fa[_0x1a47('0x2f')]=_['intersection'](_0x16f2fa[_0x1a47('0x2c')],_0x16f2fa[_0x1a47('0x2e')]);_0x110161[_0x1a47('0x31')]=_[_0x1a47('0x30')](_0x16f2fa[_0x1a47('0x2c')],qs['fields'](_0x4b485e[_0x1a47('0x2e')]['fields']));_0x110161['attributes']=_0x110161[_0x1a47('0x31')][_0x1a47('0x33')]?_0x110161[_0x1a47('0x31')]:_0x16f2fa[_0x1a47('0x2c')];_0x110161[_0x1a47('0x42')]=qs[_0x1a47('0x52')](_0x4b485e[_0x1a47('0x2e')][_0x1a47('0x52')]);_0x110161[_0x1a47('0x43')]=qs[_0x1a47('0x2f')](_[_0x1a47('0x44')](_0x4b485e[_0x1a47('0x2e')],_0x16f2fa[_0x1a47('0x2f')]));if(_0x4b485e[_0x1a47('0x2e')][_0x1a47('0x46')]){_0x110161[_0x1a47('0x43')]=_['merge'](_0x110161[_0x1a47('0x43')],{'$or':_[_0x1a47('0x21')](_0x110161[_0x1a47('0x31')],function(_0x731ae0){var _0x5bb10d={};_0x5bb10d[_0x731ae0]={'$like':'%'+_0x4b485e[_0x1a47('0x2e')][_0x1a47('0x46')]+'%'};return _0x5bb10d;})});}_0x110161=_[_0x1a47('0x34')]({},_0x110161,_0x4b485e[_0x1a47('0x35')]);return _0x886e90[_0x1a47('0x51')](_0x110161);}})['then'](function(_0x2a4a29){if(_0x2a4a29){_0x3d154f=_0x2a4a29[_0x1a47('0x33')];if(!_0x4b485e[_0x1a47('0x2e')][_0x1a47('0x53')]('nolimit')){_0x110161[_0x1a47('0x12')]=qs[_0x1a47('0x12')](_0x4b485e[_0x1a47('0x2e')][_0x1a47('0x12')]);_0x110161[_0x1a47('0x10')]=qs['offset'](_0x4b485e[_0x1a47('0x2e')][_0x1a47('0x10')]);}return _0x886e90['getTeams'](_0x110161);}})[_0x1a47('0x17')](function(_0x5ef88d){if(_0x5ef88d){return _0x5ef88d?{'count':_0x3d154f,'rows':_0x5ef88d}:null;}})[_0x1a47('0x17')](respondWithResult(_0x5ac3ef,null))[_0x1a47('0x2a')](handleError(_0x5ac3ef,null));};exports[_0x1a47('0x54')]=function(_0x4079e5,_0x4ae050){var _0x37f2ee=_0x4079e5[_0x1a47('0x38')][_0x1a47('0x55')];return db[_0x1a47('0x56')][_0x1a47('0x28')]({'where':{'id':_0x37f2ee},'attributes':['id'],'include':[{'model':db[_0x1a47('0x48')],'as':_0x1a47('0x57'),'attributes':['id',_0x1a47('0x1e'),_0x1a47('0x58'),'voicePause',_0x1a47('0x59')],'raw':!![]}]})[_0x1a47('0x17')](function(_0x235606){if(_0x235606){var _0x2845b9=_[_0x1a47('0x5a')](_0x235606,function(_0x206a94){var _0x25d71c=_0x206a94[_0x1a47('0x19')]({'plain':!![]});return _0x25d71c['Agents'];});return db[_0x1a47('0x27')][_0x1a47('0x36')]({'where':{'id':_0x4079e5[_0x1a47('0x2b')]['id']}})[_0x1a47('0x17')](function(_0x8fbf90){return db['sequelize'][_0x1a47('0x5b')](function(_0x4528ea){return _0x8fbf90[_0x1a47('0x54')](_0x37f2ee,{'transaction':_0x4528ea})[_0x1a47('0x17')](function(){return BPromise[_0x1a47('0x5c')](_0x2845b9,function(_0x1cfa85){return db['UserOpenchannelQueue'][_0x1a47('0x5d')]({'where':{'UserId':_0x1cfa85['id'],'OpenchannelQueueId':_0x4079e5[_0x1a47('0x2b')]['id']},'transaction':_0x4528ea});});})[_0x1a47('0x17')](function(){_0x2845b9[_0x1a47('0x5e')](function(_0x5ae179){socket[_0x1a47('0x5f')](_0x1a47('0x60'),{'UserId':_0x5ae179['id'],'OpenchannelQueueId':_0x8fbf90['id']});});});});});}})[_0x1a47('0x17')](respondWithStatusCode(_0x4ae050,null))['catch'](handleError(_0x4ae050,null));};exports[_0x1a47('0x61')]=function(_0x4363c8,_0x438544){return db['Team'][_0x1a47('0x28')]({'where':{'id':_0x4363c8[_0x1a47('0x2e')][_0x1a47('0x55')]},'attributes':['id'],'include':[{'model':db[_0x1a47('0x48')],'as':_0x1a47('0x57'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x438544,null))['then'](function(_0x889dfe){var _0x410b00=_['map'](_0x889dfe,'id');var _0x4325c1=[];var _0x1db13f=[];var _0x3f30ec=squel[_0x1a47('0x62')]();_0x3f30ec[_0x1a47('0x63')]('tq.TeamId')[_0x1a47('0x64')](_0x1a47('0x65'),'tq')[_0x1a47('0x66')](_0x1a47('0x67'),'ut',_0x1a47('0x68'))[_0x1a47('0x43')]('OpenchannelQueueId\x20=\x20?',_0x4363c8[_0x1a47('0x2b')]['id']);for(var _0x34f463=0x0;_0x34f463<_0x889dfe[_0x1a47('0x33')];_0x34f463+=0x1){let _0x3e4134=_0x889dfe[_0x34f463];for(var _0x19a2a2=0x0;_0x19a2a2<_0x3e4134['Agents'][_0x1a47('0x33')];_0x19a2a2+=0x1){let _0x37c5e7=_0x3e4134[_0x1a47('0x57')][_0x19a2a2];var _0x23ed3d=_0x3f30ec[_0x1a47('0x69')]();_0x23ed3d[_0x1a47('0x43')](_0x1a47('0x6a'),_0x37c5e7['id']);_0x1db13f[_0x1a47('0x6b')](db[_0x1a47('0x6c')][_0x1a47('0x2e')](_0x23ed3d[_0x1a47('0x6d')](),{'type':db[_0x1a47('0x6c')][_0x1a47('0x6e')][_0x1a47('0x6f')]})['then'](function(_0x3b743f){if(_0x3b743f[_0x1a47('0x33')]===0x1){return _0x37c5e7['id'];}else{var _0x117454=_[_0x1a47('0x70')](_['map'](_0x3b743f,_0x1a47('0x71')),function(_0x51fd92){return _[_0x1a47('0x72')](_0x410b00,_0x51fd92);});if(_0x117454){return _0x37c5e7['id'];}}}));}}return BPromise['all'](_0x1db13f)['then'](function(_0x276a2b){_0x4325c1=_(_0x4325c1)[_0x1a47('0x73')](_0x276a2b)[_0x1a47('0x74')]()[_0x1a47('0x75')]();return db['OpenchannelQueue'][_0x1a47('0x36')]({'where':{'id':_0x4363c8[_0x1a47('0x2b')]['id']}})[_0x1a47('0x17')](function(_0xc8a883){return db[_0x1a47('0x6c')][_0x1a47('0x5b')](function(_0x3d8f88){return _0xc8a883['removeTeams'](_0x4363c8['query']['ids'],{'transaction':_0x3d8f88})['then'](function(){if(!_[_0x1a47('0x76')](_0x4325c1)){return _0xc8a883['removeAgents'](_0x4325c1,{'transaction':_0x3d8f88});}})[_0x1a47('0x17')](function(){_0x4325c1[_0x1a47('0x5e')](function(_0x1c9786){socket[_0x1a47('0x5f')](_0x1a47('0x77'),{'UserId':_0x1c9786,'OpenchannelQueueId':_0xc8a883['id']});});});});});});})['then'](respondWithStatusCode(_0x438544,null))['catch'](handleError(_0x438544,null));};exports['addAgents']=function(_0x25b470,_0x4ac142){return db[_0x1a47('0x27')]['find']({'where':{'id':_0x25b470[_0x1a47('0x2b')]['id']}})[_0x1a47('0x17')](handleEntityNotFound(_0x4ac142,null))[_0x1a47('0x17')](function(_0x42c105){if(_0x42c105){return _0x42c105['addAgents'](_0x25b470[_0x1a47('0x38')][_0x1a47('0x55')],_[_0x1a47('0x78')](_0x25b470[_0x1a47('0x38')],[_0x1a47('0x55'),'id'])||{})['spread'](function(_0x10bd1f){for(var _0x246e1c=0x0;_0x246e1c<_0x25b470[_0x1a47('0x38')]['ids'][_0x1a47('0x33')];_0x246e1c+=0x1){socket['emit']('userOpenchannelQueue:save',{'UserId':Number(_0x25b470['body']['ids'][_0x246e1c]),'OpenchannelQueueId':Number(_0x25b470['params']['id'])});}return _0x10bd1f;});}})[_0x1a47('0x17')](respondWithResult(_0x4ac142,null))[_0x1a47('0x2a')](handleError(_0x4ac142,null));};exports[_0x1a47('0x79')]=function(_0x3a780b,_0x15a9fd){return db[_0x1a47('0x27')][_0x1a47('0x36')]({'where':{'id':_0x3a780b[_0x1a47('0x2b')]['id']}})[_0x1a47('0x17')](handleEntityNotFound(_0x15a9fd,null))[_0x1a47('0x17')](function(_0x46da1a){if(_0x46da1a){return _0x46da1a[_0x1a47('0x79')](_0x3a780b[_0x1a47('0x2e')][_0x1a47('0x55')])['then'](function(){if(_['isArray'](_0x3a780b[_0x1a47('0x2e')]['ids'])){for(var _0x4d506a=0x0;_0x4d506a<_0x3a780b[_0x1a47('0x2e')][_0x1a47('0x55')][_0x1a47('0x33')];_0x4d506a+=0x1){socket[_0x1a47('0x5f')](_0x1a47('0x77'),{'UserId':Number(_0x3a780b[_0x1a47('0x2e')][_0x1a47('0x55')][_0x4d506a]),'OpenchannelQueueId':Number(_0x3a780b[_0x1a47('0x2b')]['id'])});}}else{socket[_0x1a47('0x5f')](_0x1a47('0x77'),{'UserId':Number(_0x3a780b[_0x1a47('0x2e')]['ids']),'OpenchannelQueueId':Number(_0x3a780b[_0x1a47('0x2b')]['id'])});}});}})[_0x1a47('0x17')](respondWithStatusCode(_0x15a9fd,null))['catch'](handleError(_0x15a9fd,null));};exports[_0x1a47('0x7a')]=function(_0x2915aa,_0x20709d){var _0x41c6ef={};var _0x386391={};var _0x4548dc;var _0x53df96;return db[_0x1a47('0x27')]['findOne']({'where':{'id':_0x2915aa[_0x1a47('0x2b')]['id']}})[_0x1a47('0x17')](handleEntityNotFound(_0x20709d,null))[_0x1a47('0x17')](function(_0x53d2ce){if(_0x53d2ce){_0x4548dc=_0x53d2ce;_0x386391[_0x1a47('0x2c')]=_[_0x1a47('0x2d')](db[_0x1a47('0x48')]['rawAttributes']);_0x386391[_0x1a47('0x2e')]=_[_0x1a47('0x2d')](_0x2915aa[_0x1a47('0x2e')]);_0x386391[_0x1a47('0x2f')]=_[_0x1a47('0x30')](_0x386391[_0x1a47('0x2c')],_0x386391[_0x1a47('0x2e')]);_0x41c6ef['attributes']=_[_0x1a47('0x30')](_0x386391['model'],qs[_0x1a47('0x32')](_0x2915aa[_0x1a47('0x2e')][_0x1a47('0x32')]));_0x41c6ef[_0x1a47('0x31')]=_0x41c6ef[_0x1a47('0x31')]['length']?_0x41c6ef[_0x1a47('0x31')]:_0x386391[_0x1a47('0x2c')];_0x41c6ef[_0x1a47('0x42')]=qs[_0x1a47('0x52')](_0x2915aa[_0x1a47('0x2e')]['sort']);_0x41c6ef[_0x1a47('0x43')]=qs[_0x1a47('0x2f')](_[_0x1a47('0x44')](_0x2915aa[_0x1a47('0x2e')],_0x386391[_0x1a47('0x2f')]));if(_0x2915aa['query'][_0x1a47('0x46')]){_0x41c6ef[_0x1a47('0x43')]=_[_0x1a47('0x34')](_0x41c6ef[_0x1a47('0x43')],{'$or':_['map'](_0x41c6ef[_0x1a47('0x31')],function(_0x2183e5){var _0x400ac7={};_0x400ac7[_0x2183e5]={'$like':'%'+_0x2915aa[_0x1a47('0x2e')][_0x1a47('0x46')]+'%'};return _0x400ac7;})});}_0x41c6ef=_[_0x1a47('0x34')]({},_0x41c6ef,_0x2915aa[_0x1a47('0x35')]);return _0x4548dc[_0x1a47('0x7a')](_0x41c6ef);}})[_0x1a47('0x17')](function(_0x3bf46a){if(_0x3bf46a){_0x53df96=_0x3bf46a[_0x1a47('0x33')];if(!_0x2915aa[_0x1a47('0x2e')][_0x1a47('0x53')](_0x1a47('0x7b'))){_0x41c6ef[_0x1a47('0x12')]=qs[_0x1a47('0x12')](_0x2915aa[_0x1a47('0x2e')][_0x1a47('0x12')]);_0x41c6ef[_0x1a47('0x10')]=qs[_0x1a47('0x10')](_0x2915aa[_0x1a47('0x2e')][_0x1a47('0x10')]);}return _0x4548dc[_0x1a47('0x7a')](_0x41c6ef);}})['then'](function(_0x3846ae){if(_0x3846ae){return _0x3846ae?{'count':_0x53df96,'rows':_0x3846ae}:null;}})[_0x1a47('0x17')](respondWithResult(_0x20709d,null))['catch'](handleError(_0x20709d,null));}; \ No newline at end of file +var _0x8010=['findOrCreate','forEach','userOpenchannelQueue:save','removeTeams','ids','select','field','tq.TeamId','from','join','user_has_teams','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','includes','all','union','value','removeAgents','emit','userOpenchannelQueue:remove','addAgents','omit','spread','intersection','getAgents','bluebird','util','lodash','squel','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','update','then','destroy','get','OpenchannelQueues','UserProfileResource','error','stack','name','index','map','OpenchannelQueue','rawAttributes','fieldName','key','getOptions','where','include','query','findAll','rows','catch','show','params','model','keys','filters','attributes','fields','length','includeAll','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','describe','findOne','hasOwnProperty','order','sort','pick','OpenchannelQueueId','UserOpenchannelQueue','User','findAndCountAll','UserId','agent','openchannelPause','updatedAt','createdAt','format','%s/%s','SIP','Team','filter','options','getTeams','nolimit','addTeams','online','voicePause','interface','flatMap','Agents','sequelize','transaction','each'];(function(_0x2112d4,_0x3c863c){var _0x434972=function(_0x477020){while(--_0x477020){_0x2112d4['push'](_0x2112d4['shift']());}};_0x434972(++_0x3c863c);}(_0x8010,0x18f));var _0x0801=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8010[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require(_0x0801('0x0'));var util=require(_0x0801('0x1'));var _=require(_0x0801('0x2'));var squel=require(_0x0801('0x3'));var Redis=require('ioredis');var qs=require(_0x0801('0x4'));var logger=require(_0x0801('0x5'))(_0x0801('0x6'));var config=require(_0x0801('0x7'));var db=require(_0x0801('0x8'))['db'];config['redis']=_[_0x0801('0x9')](config[_0x0801('0xa')],{'host':_0x0801('0xb'),'port':0x18eb});var socket=require(_0x0801('0xc'))(new Redis(config['redis']));require(_0x0801('0xd'))[_0x0801('0xe')](socket);function respondWithStatusCode(_0x57d88c,_0x4e4604){_0x4e4604=_0x4e4604||0xcc;return function(_0x313c50){if(_0x313c50){return _0x57d88c[_0x0801('0xf')](_0x4e4604);}return _0x57d88c['status'](_0x4e4604)[_0x0801('0x10')]();};}function respondWithResult(_0x12e326,_0x478b0a){_0x478b0a=_0x478b0a||0xc8;return function(_0x55a5bf){if(_0x55a5bf){return _0x12e326[_0x0801('0x11')](_0x478b0a)[_0x0801('0x12')](_0x55a5bf);}};}function respondWithFilteredResult(_0x89f5e4,_0x546eaf){return function(_0x5bcfb2){if(_0x5bcfb2){var _0x3bb65a=typeof _0x546eaf['offset']===_0x0801('0x13')&&typeof _0x546eaf[_0x0801('0x14')]===_0x0801('0x13');var _0x21cfdf=_0x5bcfb2[_0x0801('0x15')];var _0xbdb9fe=_0x3bb65a?0x0:_0x546eaf['offset'];var _0x38c58d=_0x3bb65a?_0x5bcfb2['count']:_0x546eaf[_0x0801('0x16')]+_0x546eaf[_0x0801('0x14')];var _0x3e4ade;if(_0x38c58d>=_0x21cfdf){_0x38c58d=_0x21cfdf;_0x3e4ade=0xc8;}else{_0x3e4ade=0xce;}_0x89f5e4[_0x0801('0x11')](_0x3e4ade);return _0x89f5e4[_0x0801('0x17')](_0x0801('0x18'),_0xbdb9fe+'-'+_0x38c58d+'/'+_0x21cfdf)[_0x0801('0x12')](_0x5bcfb2);}return null;};}function saveUpdates(_0x4ec9c8){return function(_0x202424){if(_0x202424){return _0x202424[_0x0801('0x19')](_0x4ec9c8)[_0x0801('0x1a')](function(_0x3c4ebd){return _0x3c4ebd;});}return null;};}function removeEntity(_0x5714c9){return function(_0x243d94){if(_0x243d94){return _0x243d94[_0x0801('0x1b')]()['then'](function(){var _0x38b3fc=_0x243d94[_0x0801('0x1c')]({'plain':!![]});var _0x43eb40=_0x0801('0x1d');return db[_0x0801('0x1e')]['destroy']({'where':{'type':_0x43eb40,'resourceId':_0x38b3fc['id']}})['then'](function(){return _0x243d94;});})[_0x0801('0x1a')](function(){_0x5714c9['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x26e961){return function(_0x506dfd){if(!_0x506dfd){_0x26e961[_0x0801('0xf')](0x194);}return _0x506dfd;};}function handleError(_0x42b18a,_0x2b676a){_0x2b676a=_0x2b676a||0x1f4;return function(_0x141696){logger[_0x0801('0x1f')](_0x141696[_0x0801('0x20')]);if(_0x141696[_0x0801('0x21')]){delete _0x141696[_0x0801('0x21')];}_0x42b18a[_0x0801('0x11')](_0x2b676a)['send'](_0x141696);};}exports[_0x0801('0x22')]=function(_0x329284,_0x3b0a80){var _0x375d1f={};var _0x1c1333={'count':0x0,'rows':[]};var _0x45dce2=_[_0x0801('0x23')](db[_0x0801('0x24')][_0x0801('0x25')],function(_0x24a6f9){return{'name':_0x24a6f9[_0x0801('0x26')],'type':_0x24a6f9['type'][_0x0801('0x27')]};});_0x375d1f=qs[_0x0801('0x28')](_0x45dce2,_0x329284);var _0x199ba2={'where':_0x375d1f[_0x0801('0x29')]};return db['OpenchannelQueue'][_0x0801('0x15')](_0x199ba2)[_0x0801('0x1a')](function(_0x47bfec){_0x1c1333['count']=_0x47bfec;_0x375d1f[_0x0801('0x2a')]=qs['include'](_0x329284[_0x0801('0x2b')]);return db[_0x0801('0x24')][_0x0801('0x2c')](_0x375d1f);})[_0x0801('0x1a')](function(_0xf46b4){_0x1c1333[_0x0801('0x2d')]=_0xf46b4;return _0x1c1333;})[_0x0801('0x1a')](respondWithFilteredResult(_0x3b0a80,_0x375d1f))[_0x0801('0x2e')](handleError(_0x3b0a80,null));};exports[_0x0801('0x2f')]=function(_0x538f08,_0x55b7f1){var _0x161462={'raw':!![],'where':{'id':_0x538f08[_0x0801('0x30')]['id']}},_0x3225a9={};_0x3225a9[_0x0801('0x31')]=_[_0x0801('0x32')](db['OpenchannelQueue'][_0x0801('0x25')]);_0x3225a9['query']=_[_0x0801('0x32')](_0x538f08[_0x0801('0x2b')]);_0x3225a9[_0x0801('0x33')]=_['intersection'](_0x3225a9[_0x0801('0x31')],_0x3225a9[_0x0801('0x2b')]);_0x161462[_0x0801('0x34')]=_['intersection'](_0x3225a9[_0x0801('0x31')],qs[_0x0801('0x35')](_0x538f08[_0x0801('0x2b')][_0x0801('0x35')]));_0x161462[_0x0801('0x34')]=_0x161462[_0x0801('0x34')][_0x0801('0x36')]?_0x161462[_0x0801('0x34')]:_0x3225a9['model'];if(_0x538f08[_0x0801('0x2b')][_0x0801('0x37')]){_0x161462['include']=[{'all':!![]}];}_0x161462=_[_0x0801('0x38')]({},_0x161462,_0x538f08['options']);return db['OpenchannelQueue'][_0x0801('0x39')](_0x161462)[_0x0801('0x1a')](handleEntityNotFound(_0x55b7f1,null))[_0x0801('0x1a')](respondWithResult(_0x55b7f1,null))['catch'](handleError(_0x55b7f1,null));};exports[_0x0801('0x3a')]=function(_0x417b7c,_0x35f468){return db[_0x0801('0x24')][_0x0801('0x3a')](_0x417b7c[_0x0801('0x3b')],{})[_0x0801('0x1a')](function(_0x39ef2d){var _0x42ecaf=_0x417b7c[_0x0801('0x3c')][_0x0801('0x1c')]({'plain':!![]});if(!_0x42ecaf)throw new Error(_0x0801('0x3d'));if(_0x42ecaf['role']===_0x0801('0x3c')){var _0x4db7df=_0x39ef2d['get']({'plain':!![]});var _0x392acb=_0x0801('0x1d');return db[_0x0801('0x3e')][_0x0801('0x39')]({'where':{'name':_0x392acb,'userProfileId':_0x42ecaf[_0x0801('0x3f')]},'raw':!![]})[_0x0801('0x1a')](function(_0x197c84){if(_0x197c84&&_0x197c84[_0x0801('0x40')]===0x0){return db[_0x0801('0x1e')][_0x0801('0x3a')]({'name':_0x4db7df[_0x0801('0x21')],'resourceId':_0x4db7df['id'],'type':_0x197c84['name'],'sectionId':_0x197c84['id']},{})['then'](function(){return _0x39ef2d;});}else{return _0x39ef2d;}})['catch'](function(_0x391734){logger[_0x0801('0x1f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x391734);throw _0x391734;});}return _0x39ef2d;})[_0x0801('0x1a')](respondWithResult(_0x35f468,0xc9))[_0x0801('0x2e')](handleError(_0x35f468,null));};exports[_0x0801('0x19')]=function(_0x4b9782,_0x368c71){if(_0x4b9782['body']['id']){delete _0x4b9782[_0x0801('0x3b')]['id'];}return db[_0x0801('0x24')][_0x0801('0x39')]({'where':{'id':_0x4b9782['params']['id']}})[_0x0801('0x1a')](handleEntityNotFound(_0x368c71,null))[_0x0801('0x1a')](saveUpdates(_0x4b9782['body'],null))[_0x0801('0x1a')](respondWithResult(_0x368c71,null))[_0x0801('0x2e')](handleError(_0x368c71,null));};exports[_0x0801('0x1b')]=function(_0xdca28a,_0x722cc0){return db[_0x0801('0x24')][_0x0801('0x39')]({'where':{'id':_0xdca28a[_0x0801('0x30')]['id']}})['then'](handleEntityNotFound(_0x722cc0,null))[_0x0801('0x1a')](removeEntity(_0x722cc0,null))[_0x0801('0x2e')](handleError(_0x722cc0,null));};exports[_0x0801('0x41')]=function(_0x1b6f2c,_0x5869bc){return db[_0x0801('0x24')][_0x0801('0x41')]()['then'](respondWithResult(_0x5869bc,null))[_0x0801('0x2e')](handleError(_0x5869bc,null));};exports['getMembers']=function(_0x47db92,_0xf38fb6){var _0x1d0122={'raw':!![],'where':{}},_0x50d870={},_0x54c556;return db['OpenchannelQueue'][_0x0801('0x42')]({'where':{'id':_0x47db92[_0x0801('0x30')]['id']}})[_0x0801('0x1a')](handleEntityNotFound(_0xf38fb6,null))[_0x0801('0x1a')](function(_0x2ea92d){if(_0x2ea92d){_0x54c556=_0x2ea92d['get']({'plain':!![]});_0x50d870[_0x0801('0x31')]=_['keys'](db['UserOpenchannelQueue'][_0x0801('0x25')]);_0x50d870[_0x0801('0x2b')]=_[_0x0801('0x32')](_0x47db92[_0x0801('0x2b')]);_0x50d870[_0x0801('0x33')]=_['intersection'](_0x50d870[_0x0801('0x31')],_0x50d870[_0x0801('0x2b')]);_0x1d0122[_0x0801('0x34')]=_['intersection'](_0x50d870[_0x0801('0x31')],qs[_0x0801('0x35')](_0x47db92[_0x0801('0x2b')]['fields']));_0x1d0122['attributes']=_0x1d0122[_0x0801('0x34')][_0x0801('0x36')]?_0x1d0122[_0x0801('0x34')]:_0x50d870[_0x0801('0x31')];if(!_0x47db92[_0x0801('0x2b')][_0x0801('0x43')]('nolimit')){_0x1d0122[_0x0801('0x14')]=qs['limit'](_0x47db92[_0x0801('0x2b')]['limit']);_0x1d0122['offset']=qs[_0x0801('0x16')](_0x47db92[_0x0801('0x2b')][_0x0801('0x16')]);}_0x1d0122[_0x0801('0x44')]=qs[_0x0801('0x45')](_0x47db92[_0x0801('0x2b')]['sort']);_0x1d0122[_0x0801('0x29')]=qs[_0x0801('0x33')](_[_0x0801('0x46')](_0x47db92['query'],_0x50d870['filters']));_0x1d0122[_0x0801('0x29')][_0x0801('0x47')]=_0x2ea92d['id'];if(_0x47db92[_0x0801('0x2b')]['filter']){_0x1d0122[_0x0801('0x29')]=_[_0x0801('0x38')](_0x1d0122[_0x0801('0x29')],{'$or':_['map'](_0x1d0122[_0x0801('0x34')],function(_0xef10d3){var _0x14d1fb={};_0x14d1fb[_0xef10d3]={'$like':'%'+_0x47db92[_0x0801('0x2b')]['filter']+'%'};return _0x14d1fb;})});}_0x1d0122=_[_0x0801('0x38')]({},_0x1d0122,_0x47db92['options']);return db[_0x0801('0x48')][_0x0801('0x2c')](_0x1d0122);}})[_0x0801('0x1a')](function(_0x468da0){if(_0x468da0){return db[_0x0801('0x49')][_0x0801('0x4a')]({'where':{'id':_[_0x0801('0x23')](_0x468da0,_0x0801('0x4b')),'role':_0x0801('0x4c')},'attributes':['id',_0x0801('0x21'),_0x0801('0x4d'),_0x0801('0x4e'),_0x0801('0x4f')]});}})['then'](function(_0x450d4a){if(_0x450d4a){return{'count':_0x450d4a[_0x0801('0x15')],'rows':_[_0x0801('0x23')](_0x450d4a['rows'],function(_0x15b830){return{'membername':_0x15b830[_0x0801('0x21')],'UserId':_0x15b830['id'],'queue_name':_0x54c556[_0x0801('0x21')],'OpenchannelQueueId':_0x54c556['id'],'interface':util[_0x0801('0x50')](_0x0801('0x51'),_0x0801('0x52'),_0x15b830['name']),'penalty':0x0,'paused':_0x15b830[_0x0801('0x4d')],'createdAt':_0x15b830[_0x0801('0x4f')],'updatedAt':_0x15b830[_0x0801('0x4e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x0801('0x1a')](respondWithFilteredResult(_0xf38fb6,_0x1d0122))['catch'](handleError(_0xf38fb6,null));};exports['getTeams']=function(_0x1045e9,_0x2e7d48){var _0x5dc97a={};var _0x419b4f={};var _0x39cc0b;var _0xe70823;return db[_0x0801('0x24')]['findOne']({'where':{'id':_0x1045e9[_0x0801('0x30')]['id']}})[_0x0801('0x1a')](handleEntityNotFound(_0x2e7d48,null))[_0x0801('0x1a')](function(_0x56ef92){if(_0x56ef92){_0x39cc0b=_0x56ef92;_0x419b4f[_0x0801('0x31')]=_['keys'](db[_0x0801('0x53')][_0x0801('0x25')]);_0x419b4f[_0x0801('0x2b')]=_[_0x0801('0x32')](_0x1045e9[_0x0801('0x2b')]);_0x419b4f['filters']=_['intersection'](_0x419b4f[_0x0801('0x31')],_0x419b4f[_0x0801('0x2b')]);_0x5dc97a[_0x0801('0x34')]=_['intersection'](_0x419b4f[_0x0801('0x31')],qs[_0x0801('0x35')](_0x1045e9[_0x0801('0x2b')]['fields']));_0x5dc97a[_0x0801('0x34')]=_0x5dc97a[_0x0801('0x34')][_0x0801('0x36')]?_0x5dc97a['attributes']:_0x419b4f[_0x0801('0x31')];_0x5dc97a[_0x0801('0x44')]=qs['sort'](_0x1045e9['query'][_0x0801('0x45')]);_0x5dc97a[_0x0801('0x29')]=qs['filters'](_[_0x0801('0x46')](_0x1045e9['query'],_0x419b4f['filters']));if(_0x1045e9['query'][_0x0801('0x54')]){_0x5dc97a[_0x0801('0x29')]=_[_0x0801('0x38')](_0x5dc97a[_0x0801('0x29')],{'$or':_['map'](_0x5dc97a['attributes'],function(_0x352da0){var _0x415256={};_0x415256[_0x352da0]={'$like':'%'+_0x1045e9['query'][_0x0801('0x54')]+'%'};return _0x415256;})});}_0x5dc97a=_[_0x0801('0x38')]({},_0x5dc97a,_0x1045e9[_0x0801('0x55')]);return _0x39cc0b[_0x0801('0x56')](_0x5dc97a);}})[_0x0801('0x1a')](function(_0x650e5f){if(_0x650e5f){_0xe70823=_0x650e5f['length'];if(!_0x1045e9[_0x0801('0x2b')][_0x0801('0x43')](_0x0801('0x57'))){_0x5dc97a[_0x0801('0x14')]=qs['limit'](_0x1045e9['query'][_0x0801('0x14')]);_0x5dc97a[_0x0801('0x16')]=qs[_0x0801('0x16')](_0x1045e9['query']['offset']);}return _0x39cc0b[_0x0801('0x56')](_0x5dc97a);}})[_0x0801('0x1a')](function(_0x22a46a){if(_0x22a46a){return _0x22a46a?{'count':_0xe70823,'rows':_0x22a46a}:null;}})['then'](respondWithResult(_0x2e7d48,null))[_0x0801('0x2e')](handleError(_0x2e7d48,null));};exports[_0x0801('0x58')]=function(_0x3bdbba,_0x2c0b6b){var _0x3ea8b5=_0x3bdbba[_0x0801('0x3b')]['ids'];return db[_0x0801('0x53')][_0x0801('0x2c')]({'where':{'id':_0x3ea8b5},'attributes':['id'],'include':[{'model':db[_0x0801('0x49')],'as':'Agents','attributes':['id','name',_0x0801('0x59'),_0x0801('0x5a'),_0x0801('0x5b')],'raw':!![]}]})['then'](function(_0x174681){if(_0x174681){var _0x5f0507=_[_0x0801('0x5c')](_0x174681,function(_0x577e63){var _0x3bebaf=_0x577e63['get']({'plain':!![]});return _0x3bebaf[_0x0801('0x5d')];});return db[_0x0801('0x24')][_0x0801('0x39')]({'where':{'id':_0x3bdbba[_0x0801('0x30')]['id']}})[_0x0801('0x1a')](function(_0xaf0d85){return db[_0x0801('0x5e')][_0x0801('0x5f')](function(_0x149b48){return _0xaf0d85['addTeams'](_0x3ea8b5,{'transaction':_0x149b48})[_0x0801('0x1a')](function(){return BPromise[_0x0801('0x60')](_0x5f0507,function(_0x5ed7b7){return db[_0x0801('0x48')][_0x0801('0x61')]({'where':{'UserId':_0x5ed7b7['id'],'OpenchannelQueueId':_0x3bdbba['params']['id']},'transaction':_0x149b48});});})['then'](function(){_0x5f0507[_0x0801('0x62')](function(_0x27607b){socket['emit'](_0x0801('0x63'),{'UserId':_0x27607b['id'],'OpenchannelQueueId':_0xaf0d85['id']});});});});});}})[_0x0801('0x1a')](respondWithStatusCode(_0x2c0b6b,null))[_0x0801('0x2e')](handleError(_0x2c0b6b,null));};exports[_0x0801('0x64')]=function(_0x19c503,_0x565bf5){return db[_0x0801('0x53')][_0x0801('0x2c')]({'where':{'id':_0x19c503['query'][_0x0801('0x65')]},'attributes':['id'],'include':[{'model':db[_0x0801('0x49')],'as':_0x0801('0x5d'),'attributes':['id'],'raw':!![]}]})[_0x0801('0x1a')](handleEntityNotFound(_0x565bf5,null))[_0x0801('0x1a')](function(_0x583a63){var _0x8eabb1=_['map'](_0x583a63,'id');var _0x1a06b1=[];var _0x5775bf=[];var _0x3e0e7d=squel[_0x0801('0x66')]();_0x3e0e7d[_0x0801('0x67')](_0x0801('0x68'))[_0x0801('0x69')]('team_has_openchannel_queues','tq')[_0x0801('0x6a')](_0x0801('0x6b'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x0801('0x29')](_0x0801('0x6c'),_0x19c503[_0x0801('0x30')]['id']);for(var _0x1ea495=0x0;_0x1ea495<_0x583a63[_0x0801('0x36')];_0x1ea495+=0x1){let _0x4912f9=_0x583a63[_0x1ea495];for(var _0x40baea=0x0;_0x40baea<_0x4912f9[_0x0801('0x5d')]['length'];_0x40baea+=0x1){let _0x541dc5=_0x4912f9['Agents'][_0x40baea];var _0x1a71f8=_0x3e0e7d[_0x0801('0x6d')]();_0x1a71f8['where'](_0x0801('0x6e'),_0x541dc5['id']);_0x5775bf['push'](db[_0x0801('0x5e')]['query'](_0x1a71f8[_0x0801('0x6f')](),{'type':db[_0x0801('0x5e')]['QueryTypes']['SELECT']})[_0x0801('0x1a')](function(_0x46a2e0){if(_0x46a2e0[_0x0801('0x36')]===0x1){return _0x541dc5['id'];}else{var _0x5bfa1b=_['every'](_[_0x0801('0x23')](_0x46a2e0,'TeamId'),function(_0x417230){return _[_0x0801('0x70')](_0x8eabb1,_0x417230);});if(_0x5bfa1b){return _0x541dc5['id'];}}}));}}return BPromise[_0x0801('0x71')](_0x5775bf)['then'](function(_0x4db23a){_0x1a06b1=_(_0x1a06b1)[_0x0801('0x72')](_0x4db23a)['compact']()[_0x0801('0x73')]();return db[_0x0801('0x24')][_0x0801('0x39')]({'where':{'id':_0x19c503[_0x0801('0x30')]['id']}})[_0x0801('0x1a')](function(_0x133e6e){return db[_0x0801('0x5e')]['transaction'](function(_0x130523){return _0x133e6e[_0x0801('0x64')](_0x19c503[_0x0801('0x2b')]['ids'],{'transaction':_0x130523})[_0x0801('0x1a')](function(){if(!_['isEmpty'](_0x1a06b1)){return _0x133e6e[_0x0801('0x74')](_0x1a06b1,{'transaction':_0x130523});}})[_0x0801('0x1a')](function(){_0x1a06b1['forEach'](function(_0x2d646f){socket[_0x0801('0x75')](_0x0801('0x76'),{'UserId':_0x2d646f,'OpenchannelQueueId':_0x133e6e['id']});});});});});});})['then'](respondWithStatusCode(_0x565bf5,null))[_0x0801('0x2e')](handleError(_0x565bf5,null));};exports[_0x0801('0x77')]=function(_0x3a9b41,_0x2e32f9){return db[_0x0801('0x24')]['find']({'where':{'id':_0x3a9b41[_0x0801('0x30')]['id']}})[_0x0801('0x1a')](handleEntityNotFound(_0x2e32f9,null))['then'](function(_0x4694cd){if(_0x4694cd){return _0x4694cd[_0x0801('0x77')](_0x3a9b41[_0x0801('0x3b')][_0x0801('0x65')],_[_0x0801('0x78')](_0x3a9b41[_0x0801('0x3b')],[_0x0801('0x65'),'id'])||{})[_0x0801('0x79')](function(_0x2ba9ff){for(var _0x2f5504=0x0;_0x2f5504<_0x3a9b41[_0x0801('0x3b')][_0x0801('0x65')][_0x0801('0x36')];_0x2f5504+=0x1){socket[_0x0801('0x75')]('userOpenchannelQueue:save',{'UserId':Number(_0x3a9b41[_0x0801('0x3b')][_0x0801('0x65')][_0x2f5504]),'OpenchannelQueueId':Number(_0x3a9b41['params']['id'])});}return _0x2ba9ff;});}})[_0x0801('0x1a')](respondWithResult(_0x2e32f9,null))['catch'](handleError(_0x2e32f9,null));};exports[_0x0801('0x74')]=function(_0x551bfe,_0x2258f5){return db[_0x0801('0x24')]['find']({'where':{'id':_0x551bfe[_0x0801('0x30')]['id']}})[_0x0801('0x1a')](handleEntityNotFound(_0x2258f5,null))['then'](function(_0x42f525){if(_0x42f525){return _0x42f525[_0x0801('0x74')](_0x551bfe[_0x0801('0x2b')][_0x0801('0x65')])['then'](function(){if(_['isArray'](_0x551bfe['query'][_0x0801('0x65')])){for(var _0x31acab=0x0;_0x31acab<_0x551bfe[_0x0801('0x2b')][_0x0801('0x65')][_0x0801('0x36')];_0x31acab+=0x1){socket[_0x0801('0x75')](_0x0801('0x76'),{'UserId':Number(_0x551bfe[_0x0801('0x2b')][_0x0801('0x65')][_0x31acab]),'OpenchannelQueueId':Number(_0x551bfe[_0x0801('0x30')]['id'])});}}else{socket[_0x0801('0x75')]('userOpenchannelQueue:remove',{'UserId':Number(_0x551bfe[_0x0801('0x2b')]['ids']),'OpenchannelQueueId':Number(_0x551bfe[_0x0801('0x30')]['id'])});}});}})[_0x0801('0x1a')](respondWithStatusCode(_0x2258f5,null))['catch'](handleError(_0x2258f5,null));};exports['getAgents']=function(_0x2dedad,_0x51fb1f){var _0x5bccfe={};var _0x560963={};var _0x22e5c7;var _0x4859a4;return db['OpenchannelQueue']['findOne']({'where':{'id':_0x2dedad[_0x0801('0x30')]['id']}})[_0x0801('0x1a')](handleEntityNotFound(_0x51fb1f,null))[_0x0801('0x1a')](function(_0x67e5d5){if(_0x67e5d5){_0x22e5c7=_0x67e5d5;_0x560963[_0x0801('0x31')]=_[_0x0801('0x32')](db[_0x0801('0x49')][_0x0801('0x25')]);_0x560963[_0x0801('0x2b')]=_[_0x0801('0x32')](_0x2dedad[_0x0801('0x2b')]);_0x560963[_0x0801('0x33')]=_[_0x0801('0x7a')](_0x560963[_0x0801('0x31')],_0x560963['query']);_0x5bccfe[_0x0801('0x34')]=_['intersection'](_0x560963[_0x0801('0x31')],qs[_0x0801('0x35')](_0x2dedad[_0x0801('0x2b')][_0x0801('0x35')]));_0x5bccfe[_0x0801('0x34')]=_0x5bccfe['attributes'][_0x0801('0x36')]?_0x5bccfe['attributes']:_0x560963[_0x0801('0x31')];_0x5bccfe[_0x0801('0x44')]=qs['sort'](_0x2dedad['query']['sort']);_0x5bccfe[_0x0801('0x29')]=qs[_0x0801('0x33')](_['pick'](_0x2dedad[_0x0801('0x2b')],_0x560963[_0x0801('0x33')]));if(_0x2dedad[_0x0801('0x2b')]['filter']){_0x5bccfe[_0x0801('0x29')]=_[_0x0801('0x38')](_0x5bccfe[_0x0801('0x29')],{'$or':_['map'](_0x5bccfe[_0x0801('0x34')],function(_0x2fca73){var _0x2196b2={};_0x2196b2[_0x2fca73]={'$like':'%'+_0x2dedad[_0x0801('0x2b')][_0x0801('0x54')]+'%'};return _0x2196b2;})});}_0x5bccfe=_[_0x0801('0x38')]({},_0x5bccfe,_0x2dedad[_0x0801('0x55')]);return _0x22e5c7[_0x0801('0x7b')](_0x5bccfe);}})[_0x0801('0x1a')](function(_0x16a745){if(_0x16a745){_0x4859a4=_0x16a745[_0x0801('0x36')];if(!_0x2dedad['query'][_0x0801('0x43')](_0x0801('0x57'))){_0x5bccfe['limit']=qs[_0x0801('0x14')](_0x2dedad[_0x0801('0x2b')][_0x0801('0x14')]);_0x5bccfe['offset']=qs[_0x0801('0x16')](_0x2dedad['query'][_0x0801('0x16')]);}return _0x22e5c7[_0x0801('0x7b')](_0x5bccfe);}})['then'](function(_0x41026d){if(_0x41026d){return _0x41026d?{'count':_0x4859a4,'rows':_0x41026d}:null;}})['then'](respondWithResult(_0x51fb1f,null))[_0x0801('0x2e')](handleError(_0x51fb1f,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 7cb92da..85bf0ec 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 _0xcb54=['OpenchannelQueue','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x5756f8,_0x22b6d5){var _0x3bb749=function(_0x332204){while(--_0x332204){_0x5756f8['push'](_0x5756f8['shift']());}};_0x3bb749(++_0x22b6d5);}(_0xcb54,0x167));var _0x4cb5=function(_0x28240d,_0x419a72){_0x28240d=_0x28240d-0x0;var _0x52725f=_0xcb54[_0x28240d];return _0x52725f;};'use strict';var EventEmitter=require(_0x4cb5('0x0'));var OpenchannelQueue=require('../../mysqldb')['db'][_0x4cb5('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x4cb5('0x2')](0x0);var events={'afterCreate':_0x4cb5('0x3'),'afterUpdate':'update','afterDestroy':_0x4cb5('0x4')};function emitEvent(_0x4d1f5d){return function(_0x564379,_0x486e97,_0x1d0e00){OpenchannelQueueEvents[_0x4cb5('0x5')](_0x4d1f5d+':'+_0x564379['id'],_0x564379);OpenchannelQueueEvents[_0x4cb5('0x5')](_0x4d1f5d,_0x564379);_0x1d0e00(null);};}for(var e in events){if(events[_0x4cb5('0x6')](e)){var event=events[e];OpenchannelQueue[_0x4cb5('0x7')](e,emitEvent(event));}}module[_0x4cb5('0x8')]=OpenchannelQueueEvents; \ No newline at end of file +var _0x13ee=['hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit'];(function(_0x548467,_0x5ef1f2){var _0x53c1b0=function(_0x38644a){while(--_0x38644a){_0x548467['push'](_0x548467['shift']());}};_0x53c1b0(++_0x5ef1f2);}(_0x13ee,0x125));var _0xe13e=function(_0xa990b7,_0x26c527){_0xa990b7=_0xa990b7-0x0;var _0x52c99c=_0x13ee[_0xa990b7];return _0x52c99c;};'use strict';var EventEmitter=require(_0xe13e('0x0'));var OpenchannelQueue=require(_0xe13e('0x1'))['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xe13e('0x2')](0x0);var events={'afterCreate':_0xe13e('0x3'),'afterUpdate':_0xe13e('0x4'),'afterDestroy':_0xe13e('0x5')};function emitEvent(_0x2136a1){return function(_0x13361c,_0x2babcf,_0x1c4033){OpenchannelQueueEvents[_0xe13e('0x6')](_0x2136a1+':'+_0x13361c['id'],_0x13361c);OpenchannelQueueEvents[_0xe13e('0x6')](_0x2136a1,_0x13361c);_0x1c4033(null);};}for(var e in events){if(events[_0xe13e('0x7')](e)){var event=events[e];OpenchannelQueue[_0xe13e('0x8')](e,emitEvent(event));}}module[_0xe13e('0x9')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index f47dbd1..6fc57ea 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 _0x6b9f=['api','moment','bluebird','request-promise','path','rimraf','./openchannelQueue.attributes','exports','define','OpenchannelQueue','openchannel_queues','../../config/logger'];(function(_0x2c50a4,_0x492921){var _0x5a251e=function(_0xc10e61){while(--_0xc10e61){_0x2c50a4['push'](_0x2c50a4['shift']());}};_0x5a251e(++_0x492921);}(_0x6b9f,0x1d3));var _0xf6b9=function(_0x5f19e3,_0x3c77a9){_0x5f19e3=_0x5f19e3-0x0;var _0x2faf43=_0x6b9f[_0x5f19e3];return _0x2faf43;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf6b9('0x0'))(_0xf6b9('0x1'));var moment=require(_0xf6b9('0x2'));var BPromise=require(_0xf6b9('0x3'));var rp=require(_0xf6b9('0x4'));var fs=require('fs');var path=require(_0xf6b9('0x5'));var rimraf=require(_0xf6b9('0x6'));var config=require('../../config/environment');var attributes=require(_0xf6b9('0x7'));module[_0xf6b9('0x8')]=function(_0x5591b2,_0xff13b){return _0x5591b2[_0xf6b9('0x9')](_0xf6b9('0xa'),attributes,{'tableName':_0xf6b9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5e9f=['rimraf','./openchannelQueue.attributes','exports','define','OpenchannelQueue','openchannel_queues','../../config/logger','moment','bluebird','path'];(function(_0x151721,_0x20d5bc){var _0x2deaa7=function(_0x499812){while(--_0x499812){_0x151721['push'](_0x151721['shift']());}};_0x2deaa7(++_0x20d5bc);}(_0x5e9f,0x182));var _0xf5e9=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x5e9f[_0x4b369d];return _0x571a98;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf5e9('0x0'))('api');var moment=require(_0xf5e9('0x1'));var BPromise=require(_0xf5e9('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf5e9('0x3'));var rimraf=require(_0xf5e9('0x4'));var config=require('../../config/environment');var attributes=require(_0xf5e9('0x5'));module[_0xf5e9('0x6')]=function(_0x2abeda,_0x5a0714){return _0x2abeda[_0xf5e9('0x7')](_0xf5e9('0x8'),attributes,{'tableName':_0xf5e9('0x9'),'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 db1e522..b1561f8 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 _0x6835=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./openchannelQueue.socket','register','request','then','info','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','OpenchannelQueue,\x20%s,\x20%s','message','result','catch','findAll','options','raw','where','attributes','include','model','map','GetOpenchannelQueue','ShowOpenchannelQueue','util'];(function(_0x31d9c3,_0xe47f0f){var _0x1c0a21=function(_0x51156f){while(--_0x51156f){_0x31d9c3['push'](_0x31d9c3['shift']());}};_0x1c0a21(++_0xe47f0f);}(_0x6835,0x74));var _0x5683=function(_0x12bafe,_0x309174){_0x12bafe=_0x12bafe-0x0;var _0x543cee=_0x6835[_0x12bafe];return _0x543cee;};'use strict';var _=require('lodash');var util=require(_0x5683('0x0'));var moment=require(_0x5683('0x1'));var BPromise=require('bluebird');var rs=require(_0x5683('0x2'));var fs=require('fs');var Redis=require(_0x5683('0x3'));var db=require(_0x5683('0x4'))['db'];var utils=require(_0x5683('0x5'));var logger=require(_0x5683('0x6'))(_0x5683('0x7'));var config=require(_0x5683('0x8'));var jayson=require(_0x5683('0x9'));var client=jayson[_0x5683('0xa')][_0x5683('0xb')]({'port':0x232a});config[_0x5683('0xc')]=_[_0x5683('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x5683('0xe'))(new Redis(config[_0x5683('0xc')]));require(_0x5683('0xf'))[_0x5683('0x10')](socket);function respondWithRpcPromise(_0x1eb4b2,_0x446a3f,_0x14f3b1){return new BPromise(function(_0x15dd8d,_0x294b23){return client[_0x5683('0x11')](_0x1eb4b2,_0x14f3b1)[_0x5683('0x12')](function(_0x1534c3){logger[_0x5683('0x13')]('OpenchannelQueue,\x20%s,\x20%s',_0x446a3f,'request\x20sent');logger[_0x5683('0x14')](_0x5683('0x15'),_0x446a3f,_0x5683('0x16'),JSON['stringify'](_0x1534c3));if(_0x1534c3[_0x5683('0x17')]){if(_0x1534c3['error'][_0x5683('0x18')]===0x1f4){logger[_0x5683('0x17')](_0x5683('0x19'),_0x446a3f,_0x1534c3[_0x5683('0x17')][_0x5683('0x1a')]);return _0x294b23(_0x1534c3[_0x5683('0x17')][_0x5683('0x1a')]);}logger['error'](_0x5683('0x19'),_0x446a3f,_0x1534c3[_0x5683('0x17')]['message']);return _0x15dd8d(_0x1534c3[_0x5683('0x17')][_0x5683('0x1a')]);}else{logger[_0x5683('0x13')](_0x5683('0x19'),_0x446a3f,'request\x20sent');_0x15dd8d(_0x1534c3[_0x5683('0x1b')][_0x5683('0x1a')]);}})[_0x5683('0x1c')](function(_0x27154b){logger['error'](_0x5683('0x19'),_0x446a3f,_0x27154b);_0x294b23(_0x27154b);});});}exports['GetOpenchannelQueue']=function(_0x538b57){var _0x2b7cdc=this;return new Promise(function(_0x36425e,_0x1398de){return db['OpenchannelQueue'][_0x5683('0x1d')]({'raw':_0x538b57[_0x5683('0x1e')]?_0x538b57[_0x5683('0x1e')][_0x5683('0x1f')]===undefined?!![]:![]:!![],'where':_0x538b57[_0x5683('0x1e')]?_0x538b57['options'][_0x5683('0x20')]||null:null,'attributes':_0x538b57[_0x5683('0x1e')]?_0x538b57[_0x5683('0x1e')][_0x5683('0x21')]||null:null,'limit':_0x538b57[_0x5683('0x1e')]?_0x538b57[_0x5683('0x1e')]['limit']||null:null,'include':_0x538b57[_0x5683('0x1e')]?_0x538b57[_0x5683('0x1e')][_0x5683('0x22')]?_['map'](_0x538b57[_0x5683('0x1e')][_0x5683('0x22')],function(_0x2e98e1){return{'model':db[_0x2e98e1[_0x5683('0x23')]],'as':_0x2e98e1['as'],'attributes':_0x2e98e1[_0x5683('0x21')],'include':_0x2e98e1[_0x5683('0x22')]?_[_0x5683('0x24')](_0x2e98e1[_0x5683('0x22')],function(_0x1b7f1c){return{'model':db[_0x1b7f1c[_0x5683('0x23')]],'as':_0x1b7f1c['as'],'attributes':_0x1b7f1c[_0x5683('0x21')],'include':_0x1b7f1c[_0x5683('0x22')]?_[_0x5683('0x24')](_0x1b7f1c[_0x5683('0x22')],function(_0x477033){return{'model':db[_0x477033[_0x5683('0x23')]],'as':_0x477033['as'],'attributes':_0x477033[_0x5683('0x21')]};}):[]};}):[]};}):[]:[]})[_0x5683('0x12')](function(_0x5dc2cc){logger['info']('GetOpenchannelQueue',_0x538b57);logger[_0x5683('0x14')]('GetOpenchannelQueue',_0x538b57,JSON['stringify'](_0x5dc2cc));_0x36425e(_0x5dc2cc);})['catch'](function(_0x474079){logger[_0x5683('0x17')](_0x5683('0x25'),_0x474079['message'],_0x538b57);_0x1398de(_0x2b7cdc[_0x5683('0x17')](0x1f4,_0x474079[_0x5683('0x1a')]));});});};exports['ShowOpenchannelQueue']=function(_0x42b707){var _0x263a86=this;return new Promise(function(_0x4be69c,_0x2a08cb){return db['OpenchannelQueue']['find']({'raw':_0x42b707[_0x5683('0x1e')]?_0x42b707[_0x5683('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x42b707[_0x5683('0x1e')]?_0x42b707['options'][_0x5683('0x20')]||null:null,'attributes':_0x42b707[_0x5683('0x1e')]?_0x42b707['options']['attributes']||null:null,'include':_0x42b707[_0x5683('0x1e')]?_0x42b707[_0x5683('0x1e')][_0x5683('0x22')]?_[_0x5683('0x24')](_0x42b707[_0x5683('0x1e')][_0x5683('0x22')],function(_0x4946e0){return{'model':db[_0x4946e0['model']],'as':_0x4946e0['as'],'attributes':_0x4946e0[_0x5683('0x21')],'include':_0x4946e0['include']?_[_0x5683('0x24')](_0x4946e0[_0x5683('0x22')],function(_0x228503){return{'model':db[_0x228503[_0x5683('0x23')]],'as':_0x228503['as'],'attributes':_0x228503[_0x5683('0x21')],'include':_0x228503[_0x5683('0x22')]?_['map'](_0x228503[_0x5683('0x22')],function(_0x36fcae){return{'model':db[_0x36fcae[_0x5683('0x23')]],'as':_0x36fcae['as'],'attributes':_0x36fcae[_0x5683('0x21')]};}):[]};}):[]};}):[]:[]})[_0x5683('0x12')](function(_0x1a2983){logger[_0x5683('0x13')]('ShowOpenchannelQueue',_0x42b707);logger[_0x5683('0x14')](_0x5683('0x26'),_0x42b707,JSON['stringify'](_0x1a2983));_0x4be69c(_0x1a2983);})[_0x5683('0x1c')](function(_0x40c96d){logger[_0x5683('0x17')]('ShowOpenchannelQueue',_0x40c96d[_0x5683('0x1a')],_0x42b707);_0x2a08cb(_0x263a86[_0x5683('0x17')](0x1f4,_0x40c96d[_0x5683('0x1a')]));});});}; \ No newline at end of file +var _0x917a=['result','catch','GetOpenchannelQueue','findAll','options','where','attributes','limit','map','include','model','ShowOpenchannelQueue','OpenchannelQueue','find','raw','then','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','redis','socket.io-emitter','./openchannelQueue.socket','request','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info'];(function(_0xd1d034,_0x5d5d10){var _0x23b4e4=function(_0x52e2be){while(--_0x52e2be){_0xd1d034['push'](_0xd1d034['shift']());}};_0x23b4e4(++_0x5d5d10);}(_0x917a,0x1cc));var _0xa917=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x917a[_0x59ee6f];return _0x4c0979;};'use strict';var _=require('lodash');var util=require(_0xa917('0x0'));var moment=require(_0xa917('0x1'));var BPromise=require(_0xa917('0x2'));var rs=require(_0xa917('0x3'));var fs=require('fs');var Redis=require(_0xa917('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa917('0x5'));var config=require(_0xa917('0x6'));var jayson=require(_0xa917('0x7'));var client=jayson[_0xa917('0x8')]['http']({'port':0x232a});config[_0xa917('0x9')]=_['defaults'](config[_0xa917('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xa917('0xa'))(new Redis(config[_0xa917('0x9')]));require(_0xa917('0xb'))['register'](socket);function respondWithRpcPromise(_0x1c7351,_0x2c4539,_0x5f08c1){return new BPromise(function(_0x2c8a93,_0x3ae2a5){return client[_0xa917('0xc')](_0x1c7351,_0x5f08c1)['then'](function(_0x55e855){logger['info'](_0xa917('0xd'),_0x2c4539,_0xa917('0xe'));logger[_0xa917('0xf')]('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x2c4539,'request\x20sent',JSON[_0xa917('0x10')](_0x55e855));if(_0x55e855[_0xa917('0x11')]){if(_0x55e855[_0xa917('0x11')][_0xa917('0x12')]===0x1f4){logger[_0xa917('0x11')]('OpenchannelQueue,\x20%s,\x20%s',_0x2c4539,_0x55e855[_0xa917('0x11')][_0xa917('0x13')]);return _0x3ae2a5(_0x55e855['error']['message']);}logger[_0xa917('0x11')](_0xa917('0xd'),_0x2c4539,_0x55e855[_0xa917('0x11')][_0xa917('0x13')]);return _0x2c8a93(_0x55e855['error'][_0xa917('0x13')]);}else{logger[_0xa917('0x14')](_0xa917('0xd'),_0x2c4539,_0xa917('0xe'));_0x2c8a93(_0x55e855[_0xa917('0x15')][_0xa917('0x13')]);}})[_0xa917('0x16')](function(_0x3f34c3){logger['error'](_0xa917('0xd'),_0x2c4539,_0x3f34c3);_0x3ae2a5(_0x3f34c3);});});}exports[_0xa917('0x17')]=function(_0x290b33){var _0x3dca3e=this;return new Promise(function(_0x42bf46,_0x2b06ff){return db['OpenchannelQueue'][_0xa917('0x18')]({'raw':_0x290b33[_0xa917('0x19')]?_0x290b33['options']['raw']===undefined?!![]:![]:!![],'where':_0x290b33[_0xa917('0x19')]?_0x290b33[_0xa917('0x19')][_0xa917('0x1a')]||null:null,'attributes':_0x290b33[_0xa917('0x19')]?_0x290b33['options'][_0xa917('0x1b')]||null:null,'limit':_0x290b33[_0xa917('0x19')]?_0x290b33[_0xa917('0x19')][_0xa917('0x1c')]||null:null,'include':_0x290b33[_0xa917('0x19')]?_0x290b33[_0xa917('0x19')]['include']?_[_0xa917('0x1d')](_0x290b33['options'][_0xa917('0x1e')],function(_0x15346e){return{'model':db[_0x15346e[_0xa917('0x1f')]],'as':_0x15346e['as'],'attributes':_0x15346e[_0xa917('0x1b')],'include':_0x15346e[_0xa917('0x1e')]?_[_0xa917('0x1d')](_0x15346e['include'],function(_0x4dd368){return{'model':db[_0x4dd368[_0xa917('0x1f')]],'as':_0x4dd368['as'],'attributes':_0x4dd368[_0xa917('0x1b')],'include':_0x4dd368['include']?_[_0xa917('0x1d')](_0x4dd368[_0xa917('0x1e')],function(_0x4a8ae5){return{'model':db[_0x4a8ae5[_0xa917('0x1f')]],'as':_0x4a8ae5['as'],'attributes':_0x4a8ae5['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x51ea1b){logger['info'](_0xa917('0x17'),_0x290b33);logger[_0xa917('0xf')](_0xa917('0x17'),_0x290b33,JSON[_0xa917('0x10')](_0x51ea1b));_0x42bf46(_0x51ea1b);})[_0xa917('0x16')](function(_0x5aa60f){logger[_0xa917('0x11')](_0xa917('0x17'),_0x5aa60f['message'],_0x290b33);_0x2b06ff(_0x3dca3e['error'](0x1f4,_0x5aa60f[_0xa917('0x13')]));});});};exports[_0xa917('0x20')]=function(_0x47da8a){var _0x52d30b=this;return new Promise(function(_0x595d75,_0x4d62f1){return db[_0xa917('0x21')][_0xa917('0x22')]({'raw':_0x47da8a[_0xa917('0x19')]?_0x47da8a[_0xa917('0x19')][_0xa917('0x23')]===undefined?!![]:![]:!![],'where':_0x47da8a[_0xa917('0x19')]?_0x47da8a[_0xa917('0x19')][_0xa917('0x1a')]||null:null,'attributes':_0x47da8a[_0xa917('0x19')]?_0x47da8a['options']['attributes']||null:null,'include':_0x47da8a['options']?_0x47da8a[_0xa917('0x19')][_0xa917('0x1e')]?_[_0xa917('0x1d')](_0x47da8a[_0xa917('0x19')][_0xa917('0x1e')],function(_0x51c289){return{'model':db[_0x51c289['model']],'as':_0x51c289['as'],'attributes':_0x51c289[_0xa917('0x1b')],'include':_0x51c289[_0xa917('0x1e')]?_[_0xa917('0x1d')](_0x51c289[_0xa917('0x1e')],function(_0x4ab78b){return{'model':db[_0x4ab78b['model']],'as':_0x4ab78b['as'],'attributes':_0x4ab78b[_0xa917('0x1b')],'include':_0x4ab78b['include']?_[_0xa917('0x1d')](_0x4ab78b[_0xa917('0x1e')],function(_0x228076){return{'model':db[_0x228076[_0xa917('0x1f')]],'as':_0x228076['as'],'attributes':_0x228076['attributes']};}):[]};}):[]};}):[]:[]})[_0xa917('0x24')](function(_0x2bce12){logger[_0xa917('0x14')](_0xa917('0x20'),_0x47da8a);logger[_0xa917('0xf')](_0xa917('0x20'),_0x47da8a,JSON['stringify'](_0x2bce12));_0x595d75(_0x2bce12);})[_0xa917('0x16')](function(_0x304543){logger[_0xa917('0x11')](_0xa917('0x20'),_0x304543['message'],_0x47da8a);_0x4d62f1(_0x52d30b['error'](0x1f4,_0x304543[_0xa917('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index 41f35b1..3ec992f 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 _0xe0c8=['remove','update','removeListener','register','openchannelQueue:','./openchannelQueue.events','save'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xe0c8,0x1a9));var _0x8e0c=function(_0x4b55cb,_0x49791b){_0x4b55cb=_0x4b55cb-0x0;var _0x2631df=_0xe0c8[_0x4b55cb];return _0x2631df;};'use strict';var OpenchannelQueueEvents=require(_0x8e0c('0x0'));var events=[_0x8e0c('0x1'),_0x8e0c('0x2'),_0x8e0c('0x3')];function createListener(_0x29e500,_0x681c26){return function(_0x2bdf2f){_0x681c26['emit'](_0x29e500,_0x2bdf2f);};}function removeListener(_0x586a85,_0x5ad745){return function(){OpenchannelQueueEvents[_0x8e0c('0x4')](_0x586a85,_0x5ad745);};}exports[_0x8e0c('0x5')]=function(_0x35def7){for(var _0x23c142=0x0,_0x30caa2=events['length'];_0x23c142<_0x30caa2;_0x23c142++){var _0x1578b5=events[_0x23c142];var _0x33f589=createListener(_0x8e0c('0x6')+_0x1578b5,_0x35def7);OpenchannelQueueEvents['on'](_0x1578b5,_0x33f589);}}; \ No newline at end of file +var _0xecab=['register','length','openchannelQueue:','./openchannelQueue.events','save','remove','emit','removeListener'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xecab,0x16b));var _0xbeca=function(_0x472cac,_0x43ccd2){_0x472cac=_0x472cac-0x0;var _0x38deac=_0xecab[_0x472cac];return _0x38deac;};'use strict';var OpenchannelQueueEvents=require(_0xbeca('0x0'));var events=[_0xbeca('0x1'),_0xbeca('0x2'),'update'];function createListener(_0x2341dd,_0xcb4add){return function(_0x3bbebc){_0xcb4add[_0xbeca('0x3')](_0x2341dd,_0x3bbebc);};}function removeListener(_0x2e1e56,_0x180ab0){return function(){OpenchannelQueueEvents[_0xbeca('0x4')](_0x2e1e56,_0x180ab0);};}exports[_0xbeca('0x5')]=function(_0x56505e){for(var _0x9f772f=0x0,_0x3b3cf6=events[_0xbeca('0x6')];_0x9f772f<_0x3b3cf6;_0x9f772f++){var _0x427e6b=events[_0x9f772f];var _0x520eab=createListener(_0xbeca('0x7')+_0x427e6b,_0x56505e);OpenchannelQueueEvents['on'](_0x427e6b,_0x520eab);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index e821a7b..a07645a 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 _0x8657=['destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelQueueReport.controller','get','isAuthenticated','index','describe','post','create','put','delete','/:id'];(function(_0x4c12ce,_0x1bc72e){var _0x2b2e91=function(_0x127d53){while(--_0x127d53){_0x4c12ce['push'](_0x4c12ce['shift']());}};_0x2b2e91(++_0x1bc72e);}(_0x8657,0x16a));var _0x7865=function(_0x25545f,_0x6f9bab){_0x25545f=_0x25545f-0x0;var _0x18856d=_0x8657[_0x25545f];return _0x18856d;};'use strict';var multer=require(_0x7865('0x0'));var util=require(_0x7865('0x1'));var path=require('path');var timeout=require(_0x7865('0x2'));var express=require(_0x7865('0x3'));var router=express[_0x7865('0x4')]();var fs_extra=require(_0x7865('0x5'));var auth=require(_0x7865('0x6'));var interaction=require(_0x7865('0x7'));var config=require('../../config/environment');var controller=require(_0x7865('0x8'));router[_0x7865('0x9')]('/',auth[_0x7865('0xa')](),controller[_0x7865('0xb')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x7865('0xc')]);router['get']('/:id',auth[_0x7865('0xa')](),controller['show']);router[_0x7865('0xd')]('/',auth[_0x7865('0xa')](),controller[_0x7865('0xe')]);router[_0x7865('0xf')]('/:id',auth[_0x7865('0xa')](),controller['update']);router[_0x7865('0x10')](_0x7865('0x11'),auth[_0x7865('0xa')](),controller[_0x7865('0x12')]);module[_0x7865('0x13')]=router; \ No newline at end of file +var _0x678e=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelQueueReport.controller','get','isAuthenticated','/describe','describe','/:id','post','create','delete','destroy','exports','util','connect-timeout'];(function(_0x40971c,_0x41e1c7){var _0x46c23e=function(_0x339f52){while(--_0x339f52){_0x40971c['push'](_0x40971c['shift']());}};_0x46c23e(++_0x41e1c7);}(_0x678e,0xb2));var _0xe678=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x678e[_0x3b380d];return _0x54502b;};'use strict';var multer=require('multer');var util=require(_0xe678('0x0'));var path=require('path');var timeout=require(_0xe678('0x1'));var express=require(_0xe678('0x2'));var router=express[_0xe678('0x3')]();var fs_extra=require(_0xe678('0x4'));var auth=require(_0xe678('0x5'));var interaction=require(_0xe678('0x6'));var config=require('../../config/environment');var controller=require(_0xe678('0x7'));router[_0xe678('0x8')]('/',auth[_0xe678('0x9')](),controller['index']);router['get'](_0xe678('0xa'),auth['isAuthenticated'](),controller[_0xe678('0xb')]);router[_0xe678('0x8')](_0xe678('0xc'),auth[_0xe678('0x9')](),controller['show']);router[_0xe678('0xd')]('/',auth['isAuthenticated'](),controller[_0xe678('0xe')]);router['put'](_0xe678('0xc'),auth[_0xe678('0x9')](),controller['update']);router[_0xe678('0xf')](_0xe678('0xc'),auth[_0xe678('0x9')](),controller[_0xe678('0x10')]);module[_0xe678('0x11')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index 040731b..2b41e63 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 _0x4eb6=['DATE','moment','sequelize','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4eb6,0xf5));var _0x64eb=function(_0x2d4bf0,_0x468b4a){_0x2d4bf0=_0x2d4bf0-0x0;var _0x219862=_0x4eb6[_0x2d4bf0];return _0x219862;};'use strict';var moment=require(_0x64eb('0x0'));var Sequelize=require(_0x64eb('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x64eb('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x64eb('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x64eb('0x3')]},'acceptAt':{'type':Sequelize[_0x64eb('0x3')]},'exitAt':{'type':Sequelize[_0x64eb('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xd10c=['exports','STRING','DATE','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd10c,0x1c3));var _0xcd10=function(_0x3571dd,_0x22bfea){_0x3571dd=_0x3571dd-0x0;var _0xc523f9=_0xd10c[_0x3571dd];return _0xc523f9;};'use strict';var moment=require(_0xcd10('0x0'));var Sequelize=require('sequelize');module[_0xcd10('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xcd10('0x2')]},'joinAt':{'type':Sequelize[_0xcd10('0x3')]},'leaveAt':{'type':Sequelize[_0xcd10('0x3')]},'acceptAt':{'type':Sequelize[_0xcd10('0x3')]},'exitAt':{'type':Sequelize[_0xcd10('0x3')]},'reason':{'type':Sequelize[_0xcd10('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index 9a86a2d..1cf869f 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 _0x632b=['../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','apply','update','destroy','then','stack','name','index','map','OpenchannelQueueReport','type','key','model','keys','query','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','rawAttributes','length','create','body','find','params','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs'];(function(_0x45af13,_0x8036cc){var _0x1e1e6f=function(_0x40be66){while(--_0x40be66){_0x45af13['push'](_0x45af13['shift']());}};_0x1e1e6f(++_0x8036cc);}(_0x632b,0xc7));var _0xb632=function(_0x7b6e07,_0x1a0382){_0x7b6e07=_0x7b6e07-0x0;var _0x2a5b93=_0x632b[_0x7b6e07];return _0x2a5b93;};'use strict';var emlformat=require(_0xb632('0x0'));var rimraf=require(_0xb632('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb632('0x2'));var rp=require('request-promise');var moment=require(_0xb632('0x3'));var BPromise=require(_0xb632('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xb632('0x5'));var sox=require(_0xb632('0x6'));var csv=require(_0xb632('0x7'));var ejs=require(_0xb632('0x8'));var fs=require('fs');var fs_extra=require(_0xb632('0x9'));var _=require(_0xb632('0xa'));var squel=require(_0xb632('0xb'));var crypto=require('crypto');var jsforce=require(_0xb632('0xc'));var deskjs=require(_0xb632('0xd'));var toCsv=require(_0xb632('0x7'));var querystring=require(_0xb632('0xe'));var Papa=require(_0xb632('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb632('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb632('0x11'));var logger=require(_0xb632('0x12'))(_0xb632('0x13'));var utils=require('../../config/utils');var config=require(_0xb632('0x14'));var licenseUtil=require(_0xb632('0x15'));var db=require(_0xb632('0x16'))['db'];function respondWithStatusCode(_0x365f86,_0xd2bca4){_0xd2bca4=_0xd2bca4||0xcc;return function(_0x498bef){if(_0x498bef){return _0x365f86[_0xb632('0x17')](_0xd2bca4);}return _0x365f86[_0xb632('0x18')](_0xd2bca4)[_0xb632('0x19')]();};}function respondWithResult(_0x101790,_0x3a28da){_0x3a28da=_0x3a28da||0xc8;return function(_0xeeef69){if(_0xeeef69){return _0x101790[_0xb632('0x18')](_0x3a28da)[_0xb632('0x1a')](_0xeeef69);}};}function respondWithFilteredResult(_0x56385d,_0x4a2a7a){return function(_0x223220){if(_0x223220){var _0xb63ccb=typeof _0x4a2a7a[_0xb632('0x1b')]===_0xb632('0x1c')&&typeof _0x4a2a7a['limit']==='undefined';var _0x1fa165=_0x223220['count'];var _0x16d79d=_0xb63ccb?0x0:_0x4a2a7a['offset'];var _0x2ea2c7=_0xb63ccb?_0x223220['count']:_0x4a2a7a['offset']+_0x4a2a7a[_0xb632('0x1d')];var _0x45b34d;if(_0x2ea2c7>=_0x1fa165){_0x2ea2c7=_0x1fa165;_0x45b34d=0xc8;}else{_0x45b34d=0xce;}_0x56385d['status'](_0x45b34d);return _0x56385d[_0xb632('0x1e')]('Content-Range',_0x16d79d+'-'+_0x2ea2c7+'/'+_0x1fa165)[_0xb632('0x1a')](_0x223220);}return null;};}function patchUpdates(_0x13cd2b){return function(_0x20df58){try{jsonpatch[_0xb632('0x1f')](_0x20df58,_0x13cd2b,!![]);}catch(_0x3a3224){return BPromise['reject'](_0x3a3224);}return _0x20df58['save']();};}function saveUpdates(_0xff23cf,_0x4dc888){return function(_0x21194e){if(_0x21194e){return _0x21194e[_0xb632('0x20')](_0xff23cf)['then'](function(_0x59d23f){return _0x59d23f;});}return null;};}function removeEntity(_0x1cf73b,_0x21fe02){return function(_0x1929f7){if(_0x1929f7){return _0x1929f7[_0xb632('0x21')]()[_0xb632('0x22')](function(){_0x1cf73b[_0xb632('0x18')](0xcc)[_0xb632('0x19')]();});}};}function handleEntityNotFound(_0x2384a1,_0x3ab5a4){return function(_0x92c36e){if(!_0x92c36e){_0x2384a1[_0xb632('0x17')](0x194);}return _0x92c36e;};}function handleError(_0xd20345,_0x2aa94d){_0x2aa94d=_0x2aa94d||0x1f4;return function(_0x5a1484){logger['error'](_0x5a1484[_0xb632('0x23')]);if(_0x5a1484[_0xb632('0x24')]){delete _0x5a1484[_0xb632('0x24')];}_0xd20345[_0xb632('0x18')](_0x2aa94d)['send'](_0x5a1484);};}exports[_0xb632('0x25')]=function(_0x22ae96,_0x4abd6c){var _0x312c95={},_0x1b0c11={},_0x28fb20={'count':0x0,'rows':[]};var _0x233a1e=_[_0xb632('0x26')](db[_0xb632('0x27')]['rawAttributes'],function(_0x3ab735){return{'name':_0x3ab735['fieldName'],'type':_0x3ab735[_0xb632('0x28')][_0xb632('0x29')]};});_0x1b0c11[_0xb632('0x2a')]=_[_0xb632('0x26')](_0x233a1e,_0xb632('0x24'));_0x1b0c11['query']=_[_0xb632('0x2b')](_0x22ae96[_0xb632('0x2c')]);_0x1b0c11['filters']=_['intersection'](_0x1b0c11['model'],_0x1b0c11['query']);_0x312c95[_0xb632('0x2d')]=_[_0xb632('0x2e')](_0x1b0c11['model'],qs[_0xb632('0x2f')](_0x22ae96[_0xb632('0x2c')][_0xb632('0x2f')]));_0x312c95[_0xb632('0x2d')]=_0x312c95[_0xb632('0x2d')]['length']?_0x312c95[_0xb632('0x2d')]:_0x1b0c11['model'];if(!_0x22ae96[_0xb632('0x2c')][_0xb632('0x30')](_0xb632('0x31'))){_0x312c95[_0xb632('0x1d')]=qs['limit'](_0x22ae96[_0xb632('0x2c')][_0xb632('0x1d')]);_0x312c95[_0xb632('0x1b')]=qs[_0xb632('0x1b')](_0x22ae96[_0xb632('0x2c')][_0xb632('0x1b')]);}_0x312c95['order']=qs[_0xb632('0x32')](_0x22ae96[_0xb632('0x2c')][_0xb632('0x32')]);_0x312c95[_0xb632('0x33')]=qs[_0xb632('0x34')](_[_0xb632('0x35')](_0x22ae96[_0xb632('0x2c')],_0x1b0c11[_0xb632('0x34')]),_0x233a1e);if(_0x22ae96[_0xb632('0x2c')][_0xb632('0x36')]){_0x312c95['where']=_[_0xb632('0x37')](_0x312c95[_0xb632('0x33')],{'$or':_[_0xb632('0x26')](_0x233a1e,function(_0xf56484){if(_0xf56484[_0xb632('0x28')]!==_0xb632('0x38')){var _0x11c8c3={};_0x11c8c3[_0xf56484[_0xb632('0x24')]]={'$like':'%'+_0x22ae96['query']['filter']+'%'};return _0x11c8c3;}})});}_0x312c95=_[_0xb632('0x37')]({},_0x312c95,_0x22ae96[_0xb632('0x39')]);var _0x3f43a5={'where':_0x312c95[_0xb632('0x33')]};return db['OpenchannelQueueReport'][_0xb632('0x3a')](_0x3f43a5)[_0xb632('0x22')](function(_0x4d39cc){_0x28fb20[_0xb632('0x3a')]=_0x4d39cc;if(_0x22ae96[_0xb632('0x2c')][_0xb632('0x3b')]){_0x312c95[_0xb632('0x3c')]=[{'all':!![]}];}return db[_0xb632('0x27')][_0xb632('0x3d')](_0x312c95);})[_0xb632('0x22')](function(_0x3170bf){_0x28fb20[_0xb632('0x3e')]=_0x3170bf;return _0x28fb20;})[_0xb632('0x22')](respondWithFilteredResult(_0x4abd6c,_0x312c95))[_0xb632('0x3f')](handleError(_0x4abd6c,null));};exports[_0xb632('0x40')]=function(_0x1cde89,_0x38fc39){var _0x28dfbd={'raw':!![],'where':{'id':_0x1cde89['params']['id']}},_0x2fcc47={};_0x2fcc47['model']=_['keys'](db[_0xb632('0x27')][_0xb632('0x41')]);_0x2fcc47[_0xb632('0x2c')]=_['keys'](_0x1cde89[_0xb632('0x2c')]);_0x2fcc47[_0xb632('0x34')]=_['intersection'](_0x2fcc47[_0xb632('0x2a')],_0x2fcc47['query']);_0x28dfbd[_0xb632('0x2d')]=_[_0xb632('0x2e')](_0x2fcc47[_0xb632('0x2a')],qs[_0xb632('0x2f')](_0x1cde89['query'][_0xb632('0x2f')]));_0x28dfbd['attributes']=_0x28dfbd[_0xb632('0x2d')][_0xb632('0x42')]?_0x28dfbd[_0xb632('0x2d')]:_0x2fcc47['model'];if(_0x1cde89['query']['includeAll']){_0x28dfbd[_0xb632('0x3c')]=[{'all':!![]}];}_0x28dfbd=_[_0xb632('0x37')]({},_0x28dfbd,_0x1cde89[_0xb632('0x39')]);return db[_0xb632('0x27')]['find'](_0x28dfbd)['then'](handleEntityNotFound(_0x38fc39,null))[_0xb632('0x22')](respondWithResult(_0x38fc39,null))['catch'](handleError(_0x38fc39,null));};exports['create']=function(_0xeef7d8,_0x1d9494){return db[_0xb632('0x27')][_0xb632('0x43')](_0xeef7d8[_0xb632('0x44')],{})[_0xb632('0x22')](respondWithResult(_0x1d9494,0xc9))['catch'](handleError(_0x1d9494,null));};exports['update']=function(_0x2725d8,_0x7f2208){if(_0x2725d8[_0xb632('0x44')]['id']){delete _0x2725d8[_0xb632('0x44')]['id'];}return db['OpenchannelQueueReport'][_0xb632('0x45')]({'where':{'id':_0x2725d8['params']['id']}})[_0xb632('0x22')](handleEntityNotFound(_0x7f2208,null))['then'](saveUpdates(_0x2725d8['body'],null))['then'](respondWithResult(_0x7f2208,null))[_0xb632('0x3f')](handleError(_0x7f2208,null));};exports['destroy']=function(_0x3b0aa4,_0x27740d){return db[_0xb632('0x27')][_0xb632('0x45')]({'where':{'id':_0x3b0aa4[_0xb632('0x46')]['id']}})[_0xb632('0x22')](handleEntityNotFound(_0x27740d,null))[_0xb632('0x22')](removeEntity(_0x27740d,null))[_0xb632('0x3f')](handleError(_0x27740d,null));};exports[_0xb632('0x47')]=function(_0x362dfe,_0x2ba8a8){return db[_0xb632('0x27')][_0xb632('0x47')]()['then'](respondWithResult(_0x2ba8a8,null))[_0xb632('0x3f')](handleError(_0x2ba8a8,null));}; \ No newline at end of file +var _0xb5e1=['to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','save','update','then','destroy','error','stack','name','send','index','map','OpenchannelQueueReport','fieldName','key','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','includeAll','include','findAll','rows','fields','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xb5e1,0x89));var _0x1b5e=function(_0x1b1681,_0x3d2541){_0x1b1681=_0x1b1681-0x0;var _0x5d465d=_0xb5e1[_0x1b1681];return _0x5d465d;};'use strict';var emlformat=require(_0x1b5e('0x0'));var rimraf=require(_0x1b5e('0x1'));var zipdir=require(_0x1b5e('0x2'));var jsonpatch=require(_0x1b5e('0x3'));var rp=require(_0x1b5e('0x4'));var moment=require(_0x1b5e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x1b5e('0x6'));var util=require('util');var path=require(_0x1b5e('0x7'));var sox=require(_0x1b5e('0x8'));var csv=require(_0x1b5e('0x9'));var ejs=require(_0x1b5e('0xa'));var fs=require('fs');var fs_extra=require(_0x1b5e('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x1b5e('0xc'));var jsforce=require(_0x1b5e('0xd'));var deskjs=require(_0x1b5e('0xe'));var toCsv=require(_0x1b5e('0x9'));var querystring=require(_0x1b5e('0xf'));var Papa=require(_0x1b5e('0x10'));var Redis=require(_0x1b5e('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1b5e('0x12'));var hardwareService=require(_0x1b5e('0x13'));var logger=require(_0x1b5e('0x14'))(_0x1b5e('0x15'));var utils=require(_0x1b5e('0x16'));var config=require(_0x1b5e('0x17'));var licenseUtil=require(_0x1b5e('0x18'));var db=require(_0x1b5e('0x19'))['db'];function respondWithStatusCode(_0x527ca9,_0x5a7a4e){_0x5a7a4e=_0x5a7a4e||0xcc;return function(_0x2ce4ce){if(_0x2ce4ce){return _0x527ca9[_0x1b5e('0x1a')](_0x5a7a4e);}return _0x527ca9[_0x1b5e('0x1b')](_0x5a7a4e)[_0x1b5e('0x1c')]();};}function respondWithResult(_0x2d4686,_0x3279af){_0x3279af=_0x3279af||0xc8;return function(_0x4cbc07){if(_0x4cbc07){return _0x2d4686[_0x1b5e('0x1b')](_0x3279af)['json'](_0x4cbc07);}};}function respondWithFilteredResult(_0x5f0d96,_0x55247a){return function(_0x213204){if(_0x213204){var _0x4fd0c7=typeof _0x55247a[_0x1b5e('0x1d')]==='undefined'&&typeof _0x55247a['limit']===_0x1b5e('0x1e');var _0x479db4=_0x213204[_0x1b5e('0x1f')];var _0x5aa19b=_0x4fd0c7?0x0:_0x55247a[_0x1b5e('0x1d')];var _0x31ed9a=_0x4fd0c7?_0x213204[_0x1b5e('0x1f')]:_0x55247a[_0x1b5e('0x1d')]+_0x55247a[_0x1b5e('0x20')];var _0x2a4155;if(_0x31ed9a>=_0x479db4){_0x31ed9a=_0x479db4;_0x2a4155=0xc8;}else{_0x2a4155=0xce;}_0x5f0d96[_0x1b5e('0x1b')](_0x2a4155);return _0x5f0d96[_0x1b5e('0x21')](_0x1b5e('0x22'),_0x5aa19b+'-'+_0x31ed9a+'/'+_0x479db4)['json'](_0x213204);}return null;};}function patchUpdates(_0x2c3c8d){return function(_0x2f416e){try{jsonpatch['apply'](_0x2f416e,_0x2c3c8d,!![]);}catch(_0x4da655){return BPromise['reject'](_0x4da655);}return _0x2f416e[_0x1b5e('0x23')]();};}function saveUpdates(_0x352591,_0x5e319b){return function(_0x584d5c){if(_0x584d5c){return _0x584d5c[_0x1b5e('0x24')](_0x352591)[_0x1b5e('0x25')](function(_0x16992b){return _0x16992b;});}return null;};}function removeEntity(_0x5f7641,_0x123788){return function(_0x48339b){if(_0x48339b){return _0x48339b[_0x1b5e('0x26')]()[_0x1b5e('0x25')](function(){_0x5f7641[_0x1b5e('0x1b')](0xcc)[_0x1b5e('0x1c')]();});}};}function handleEntityNotFound(_0xb40e1a,_0x55086b){return function(_0x3b2834){if(!_0x3b2834){_0xb40e1a['sendStatus'](0x194);}return _0x3b2834;};}function handleError(_0x8271ed,_0x357d42){_0x357d42=_0x357d42||0x1f4;return function(_0x33afa0){logger[_0x1b5e('0x27')](_0x33afa0[_0x1b5e('0x28')]);if(_0x33afa0[_0x1b5e('0x29')]){delete _0x33afa0[_0x1b5e('0x29')];}_0x8271ed[_0x1b5e('0x1b')](_0x357d42)[_0x1b5e('0x2a')](_0x33afa0);};}exports[_0x1b5e('0x2b')]=function(_0x376afb,_0x33eaba){var _0x5d2f91={},_0x5a4934={},_0x46b29d={'count':0x0,'rows':[]};var _0x301230=_[_0x1b5e('0x2c')](db[_0x1b5e('0x2d')]['rawAttributes'],function(_0x2d9715){return{'name':_0x2d9715[_0x1b5e('0x2e')],'type':_0x2d9715['type'][_0x1b5e('0x2f')]};});_0x5a4934[_0x1b5e('0x30')]=_[_0x1b5e('0x2c')](_0x301230,_0x1b5e('0x29'));_0x5a4934['query']=_[_0x1b5e('0x31')](_0x376afb[_0x1b5e('0x32')]);_0x5a4934[_0x1b5e('0x33')]=_['intersection'](_0x5a4934[_0x1b5e('0x30')],_0x5a4934[_0x1b5e('0x32')]);_0x5d2f91['attributes']=_[_0x1b5e('0x34')](_0x5a4934[_0x1b5e('0x30')],qs['fields'](_0x376afb[_0x1b5e('0x32')]['fields']));_0x5d2f91[_0x1b5e('0x35')]=_0x5d2f91[_0x1b5e('0x35')][_0x1b5e('0x36')]?_0x5d2f91[_0x1b5e('0x35')]:_0x5a4934[_0x1b5e('0x30')];if(!_0x376afb[_0x1b5e('0x32')][_0x1b5e('0x37')](_0x1b5e('0x38'))){_0x5d2f91['limit']=qs[_0x1b5e('0x20')](_0x376afb['query']['limit']);_0x5d2f91['offset']=qs[_0x1b5e('0x1d')](_0x376afb['query'][_0x1b5e('0x1d')]);}_0x5d2f91[_0x1b5e('0x39')]=qs[_0x1b5e('0x3a')](_0x376afb[_0x1b5e('0x32')][_0x1b5e('0x3a')]);_0x5d2f91[_0x1b5e('0x3b')]=qs['filters'](_['pick'](_0x376afb['query'],_0x5a4934[_0x1b5e('0x33')]),_0x301230);if(_0x376afb[_0x1b5e('0x32')][_0x1b5e('0x3c')]){_0x5d2f91['where']=_[_0x1b5e('0x3d')](_0x5d2f91[_0x1b5e('0x3b')],{'$or':_[_0x1b5e('0x2c')](_0x301230,function(_0x421cad){if(_0x421cad[_0x1b5e('0x3e')]!=='VIRTUAL'){var _0x22b0b1={};_0x22b0b1[_0x421cad[_0x1b5e('0x29')]]={'$like':'%'+_0x376afb[_0x1b5e('0x32')][_0x1b5e('0x3c')]+'%'};return _0x22b0b1;}})});}_0x5d2f91=_[_0x1b5e('0x3d')]({},_0x5d2f91,_0x376afb['options']);var _0x49fed8={'where':_0x5d2f91['where']};return db[_0x1b5e('0x2d')]['count'](_0x49fed8)[_0x1b5e('0x25')](function(_0x506b2d){_0x46b29d[_0x1b5e('0x1f')]=_0x506b2d;if(_0x376afb[_0x1b5e('0x32')][_0x1b5e('0x3f')]){_0x5d2f91[_0x1b5e('0x40')]=[{'all':!![]}];}return db['OpenchannelQueueReport'][_0x1b5e('0x41')](_0x5d2f91);})[_0x1b5e('0x25')](function(_0x4f015){_0x46b29d[_0x1b5e('0x42')]=_0x4f015;return _0x46b29d;})[_0x1b5e('0x25')](respondWithFilteredResult(_0x33eaba,_0x5d2f91))['catch'](handleError(_0x33eaba,null));};exports['show']=function(_0x23633b,_0x4c240b){var _0x2e472c={'raw':!![],'where':{'id':_0x23633b['params']['id']}},_0x2d9569={};_0x2d9569[_0x1b5e('0x30')]=_[_0x1b5e('0x31')](db[_0x1b5e('0x2d')]['rawAttributes']);_0x2d9569[_0x1b5e('0x32')]=_[_0x1b5e('0x31')](_0x23633b['query']);_0x2d9569[_0x1b5e('0x33')]=_[_0x1b5e('0x34')](_0x2d9569[_0x1b5e('0x30')],_0x2d9569[_0x1b5e('0x32')]);_0x2e472c[_0x1b5e('0x35')]=_[_0x1b5e('0x34')](_0x2d9569[_0x1b5e('0x30')],qs['fields'](_0x23633b[_0x1b5e('0x32')][_0x1b5e('0x43')]));_0x2e472c[_0x1b5e('0x35')]=_0x2e472c['attributes'][_0x1b5e('0x36')]?_0x2e472c[_0x1b5e('0x35')]:_0x2d9569['model'];if(_0x23633b[_0x1b5e('0x32')]['includeAll']){_0x2e472c[_0x1b5e('0x40')]=[{'all':!![]}];}_0x2e472c=_['merge']({},_0x2e472c,_0x23633b['options']);return db[_0x1b5e('0x2d')][_0x1b5e('0x44')](_0x2e472c)[_0x1b5e('0x25')](handleEntityNotFound(_0x4c240b,null))[_0x1b5e('0x25')](respondWithResult(_0x4c240b,null))[_0x1b5e('0x45')](handleError(_0x4c240b,null));};exports[_0x1b5e('0x46')]=function(_0x2bf56f,_0x17d98f){return db[_0x1b5e('0x2d')][_0x1b5e('0x46')](_0x2bf56f['body'],{})[_0x1b5e('0x25')](respondWithResult(_0x17d98f,0xc9))[_0x1b5e('0x45')](handleError(_0x17d98f,null));};exports[_0x1b5e('0x24')]=function(_0x101ab2,_0x2ffc26){if(_0x101ab2[_0x1b5e('0x47')]['id']){delete _0x101ab2[_0x1b5e('0x47')]['id'];}return db[_0x1b5e('0x2d')][_0x1b5e('0x44')]({'where':{'id':_0x101ab2['params']['id']}})['then'](handleEntityNotFound(_0x2ffc26,null))[_0x1b5e('0x25')](saveUpdates(_0x101ab2[_0x1b5e('0x47')],null))[_0x1b5e('0x25')](respondWithResult(_0x2ffc26,null))[_0x1b5e('0x45')](handleError(_0x2ffc26,null));};exports[_0x1b5e('0x26')]=function(_0x51af1b,_0x3e028f){return db[_0x1b5e('0x2d')][_0x1b5e('0x44')]({'where':{'id':_0x51af1b['params']['id']}})[_0x1b5e('0x25')](handleEntityNotFound(_0x3e028f,null))[_0x1b5e('0x25')](removeEntity(_0x3e028f,null))[_0x1b5e('0x45')](handleError(_0x3e028f,null));};exports['describe']=function(_0x1a91bb,_0x420e09){return db[_0x1b5e('0x2d')][_0x1b5e('0x48')]()[_0x1b5e('0x25')](respondWithResult(_0x420e09,null))['catch'](handleError(_0x420e09,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index 5e0d968..5d16ecd 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 _0x2ef3=['define','OpenchannelQueueReport','report_openchannel_queue','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./openchannelQueueReport.attributes','exports'];(function(_0x14de25,_0x1f0a0f){var _0x131669=function(_0x12d863){while(--_0x12d863){_0x14de25['push'](_0x14de25['shift']());}};_0x131669(++_0x1f0a0f);}(_0x2ef3,0xba));var _0x32ef=function(_0x413d58,_0x5a4ca4){_0x413d58=_0x413d58-0x0;var _0x52251e=_0x2ef3[_0x413d58];return _0x52251e;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var logger=require(_0x32ef('0x2'))(_0x32ef('0x3'));var moment=require(_0x32ef('0x4'));var BPromise=require(_0x32ef('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x32ef('0x6'));var rimraf=require(_0x32ef('0x7'));var config=require('../../config/environment');var attributes=require(_0x32ef('0x8'));module[_0x32ef('0x9')]=function(_0x4c8104,_0x5dfa09){return _0x4c8104[_0x32ef('0xa')](_0x32ef('0xb'),attributes,{'tableName':_0x32ef('0xc'),'paranoid':![],'indexes':[{'name':_0x32ef('0xd'),'fields':[_0x32ef('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x814b=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','uniqueid','lodash','util'];(function(_0x38fb0d,_0x52b5db){var _0x30a5d6=function(_0x31eba6){while(--_0x31eba6){_0x38fb0d['push'](_0x38fb0d['shift']());}};_0x30a5d6(++_0x52b5db);}(_0x814b,0x1a2));var _0xb814=function(_0x4ab3fb,_0x776775){_0x4ab3fb=_0x4ab3fb-0x0;var _0x34fe1e=_0x814b[_0x4ab3fb];return _0x34fe1e;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var logger=require(_0xb814('0x2'))(_0xb814('0x3'));var moment=require(_0xb814('0x4'));var BPromise=require(_0xb814('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb814('0x6'));var rimraf=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var attributes=require(_0xb814('0x9'));module[_0xb814('0xa')]=function(_0x322a70,_0x53e507){return _0x322a70[_0xb814('0xb')](_0xb814('0xc'),attributes,{'tableName':'report_openchannel_queue','paranoid':![],'indexes':[{'name':_0xb814('0xd'),'fields':[_0xb814('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index 0e58163..5f77cb5 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 _0x4af8=['catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','options','raw','stringify','UpdateOpenchannelQueueReport','update','where','attributes','limit','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','OpenchannelQueueReport,\x20%s,\x20%s','result'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4af8,0x1ad));var _0x84af=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0x4af8[_0x5447fd];return _0x15b28a;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x84af('0x0'));var fs=require('fs');var Redis=require(_0x84af('0x1'));var db=require(_0x84af('0x2'))['db'];var utils=require(_0x84af('0x3'));var logger=require('../../config/logger')(_0x84af('0x4'));var config=require(_0x84af('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x84af('0x6')][_0x84af('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x550ee6,_0x422c5b,_0x294bc8){return new BPromise(function(_0x483ecc,_0x5b5e45){return client[_0x84af('0x8')](_0x550ee6,_0x294bc8)[_0x84af('0x9')](function(_0x479e1b){logger[_0x84af('0xa')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x422c5b,_0x84af('0xb'));logger[_0x84af('0xc')](_0x84af('0xd'),_0x422c5b,_0x84af('0xb'),JSON['stringify'](_0x479e1b));if(_0x479e1b[_0x84af('0xe')]){if(_0x479e1b['error'][_0x84af('0xf')]===0x1f4){logger[_0x84af('0xe')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x422c5b,_0x479e1b[_0x84af('0xe')][_0x84af('0x10')]);return _0x5b5e45(_0x479e1b[_0x84af('0xe')][_0x84af('0x10')]);}logger['error'](_0x84af('0x11'),_0x422c5b,_0x479e1b['error'][_0x84af('0x10')]);return _0x483ecc(_0x479e1b[_0x84af('0xe')]['message']);}else{logger[_0x84af('0xa')](_0x84af('0x11'),_0x422c5b,'request\x20sent');_0x483ecc(_0x479e1b[_0x84af('0x12')]['message']);}})[_0x84af('0x13')](function(_0x33baf1){logger['error']('OpenchannelQueueReport,\x20%s,\x20%s',_0x422c5b,_0x33baf1);_0x5b5e45(_0x33baf1);});});}exports[_0x84af('0x14')]=function(_0xd8120b){var _0x38a120=this;return new Promise(function(_0x4cf5b4,_0x4d0cf0){return db[_0x84af('0x15')][_0x84af('0x16')](_0xd8120b[_0x84af('0x17')],{'raw':_0xd8120b[_0x84af('0x18')]?_0xd8120b[_0x84af('0x18')][_0x84af('0x19')]===undefined?!![]:![]:!![]})[_0x84af('0x9')](function(_0x334875){logger[_0x84af('0xa')]('CreateOpenchannelQueueReport',_0xd8120b);logger[_0x84af('0xc')](_0x84af('0x14'),_0xd8120b,JSON[_0x84af('0x1a')](_0x334875));_0x4cf5b4(_0x334875);})['catch'](function(_0x2f40d6){logger[_0x84af('0xe')](_0x84af('0x14'),_0x2f40d6['message'],_0xd8120b);_0x4d0cf0(_0x38a120['error'](0x1f4,_0x2f40d6[_0x84af('0x10')]));});});};exports[_0x84af('0x1b')]=function(_0xf72093){var _0x24aa07=this;return new Promise(function(_0x21823e,_0x1b23fb){return db[_0x84af('0x15')][_0x84af('0x1c')](_0xf72093[_0x84af('0x17')],{'raw':_0xf72093[_0x84af('0x18')]?_0xf72093[_0x84af('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xf72093[_0x84af('0x18')]?_0xf72093[_0x84af('0x18')][_0x84af('0x1d')]||null:null,'attributes':_0xf72093[_0x84af('0x18')]?_0xf72093[_0x84af('0x18')][_0x84af('0x1e')]||null:null,'limit':_0xf72093[_0x84af('0x18')]?_0xf72093['options'][_0x84af('0x1f')]||null:null})[_0x84af('0x9')](function(_0x59417e){logger[_0x84af('0xa')](_0x84af('0x1b'),_0xf72093);logger[_0x84af('0xc')](_0x84af('0x1b'),_0xf72093,JSON['stringify'](_0x59417e));_0x21823e(_0x59417e);})['catch'](function(_0x3f37a0){logger[_0x84af('0xe')](_0x84af('0x1b'),_0x3f37a0[_0x84af('0x10')],_0xf72093);_0x1b23fb(_0x24aa07[_0x84af('0xe')](0x1f4,_0x3f37a0[_0x84af('0x10')]));});});}; \ No newline at end of file +var _0xa866=['catch','OpenchannelQueueReport','create','body','options','raw','CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport','update','attributes','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','OpenchannelQueueReport,\x20%s,\x20%s','message','result'];(function(_0x297a98,_0x41b89c){var _0x320676=function(_0x11c69d){while(--_0x11c69d){_0x297a98['push'](_0x297a98['shift']());}};_0x320676(++_0x41b89c);}(_0xa866,0x6a));var _0x6a86=function(_0x533df5,_0xba416c){_0x533df5=_0x533df5-0x0;var _0x45a54f=_0xa866[_0x533df5];return _0x45a54f;};'use strict';var _=require(_0x6a86('0x0'));var util=require(_0x6a86('0x1'));var moment=require(_0x6a86('0x2'));var BPromise=require(_0x6a86('0x3'));var rs=require(_0x6a86('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6a86('0x5'))['db'];var utils=require(_0x6a86('0x6'));var logger=require(_0x6a86('0x7'))('rpc');var config=require(_0x6a86('0x8'));var jayson=require(_0x6a86('0x9'));var client=jayson[_0x6a86('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x183997,_0x288910,_0x3ed589){return new BPromise(function(_0x1330e1,_0x37e3ee){return client[_0x6a86('0xb')](_0x183997,_0x3ed589)[_0x6a86('0xc')](function(_0x4a83c9){logger[_0x6a86('0xd')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x288910,_0x6a86('0xe'));logger[_0x6a86('0xf')](_0x6a86('0x10'),_0x288910,'request\x20sent',JSON[_0x6a86('0x11')](_0x4a83c9));if(_0x4a83c9[_0x6a86('0x12')]){if(_0x4a83c9['error']['code']===0x1f4){logger[_0x6a86('0x12')](_0x6a86('0x13'),_0x288910,_0x4a83c9[_0x6a86('0x12')][_0x6a86('0x14')]);return _0x37e3ee(_0x4a83c9[_0x6a86('0x12')][_0x6a86('0x14')]);}logger[_0x6a86('0x12')](_0x6a86('0x13'),_0x288910,_0x4a83c9['error'][_0x6a86('0x14')]);return _0x1330e1(_0x4a83c9[_0x6a86('0x12')]['message']);}else{logger[_0x6a86('0xd')](_0x6a86('0x13'),_0x288910,_0x6a86('0xe'));_0x1330e1(_0x4a83c9[_0x6a86('0x15')][_0x6a86('0x14')]);}})[_0x6a86('0x16')](function(_0x500b59){logger[_0x6a86('0x12')](_0x6a86('0x13'),_0x288910,_0x500b59);_0x37e3ee(_0x500b59);});});}exports['CreateOpenchannelQueueReport']=function(_0x50024d){var _0x11fe3b=this;return new Promise(function(_0x535fd9,_0x588a2f){return db[_0x6a86('0x17')][_0x6a86('0x18')](_0x50024d[_0x6a86('0x19')],{'raw':_0x50024d['options']?_0x50024d[_0x6a86('0x1a')][_0x6a86('0x1b')]===undefined?!![]:![]:!![]})[_0x6a86('0xc')](function(_0x262bf5){logger[_0x6a86('0xd')](_0x6a86('0x1c'),_0x50024d);logger['debug']('CreateOpenchannelQueueReport',_0x50024d,JSON['stringify'](_0x262bf5));_0x535fd9(_0x262bf5);})[_0x6a86('0x16')](function(_0x2007c7){logger[_0x6a86('0x12')](_0x6a86('0x1c'),_0x2007c7['message'],_0x50024d);_0x588a2f(_0x11fe3b[_0x6a86('0x12')](0x1f4,_0x2007c7[_0x6a86('0x14')]));});});};exports[_0x6a86('0x1d')]=function(_0x3f2b70){var _0x19382d=this;return new Promise(function(_0x1c41a7,_0x46f6c7){return db[_0x6a86('0x17')][_0x6a86('0x1e')](_0x3f2b70['body'],{'raw':_0x3f2b70['options']?_0x3f2b70[_0x6a86('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f2b70[_0x6a86('0x1a')]?_0x3f2b70[_0x6a86('0x1a')]['where']||null:null,'attributes':_0x3f2b70[_0x6a86('0x1a')]?_0x3f2b70[_0x6a86('0x1a')][_0x6a86('0x1f')]||null:null,'limit':_0x3f2b70['options']?_0x3f2b70[_0x6a86('0x1a')]['limit']||null:null})['then'](function(_0x4d8bf0){logger[_0x6a86('0xd')](_0x6a86('0x1d'),_0x3f2b70);logger[_0x6a86('0xf')]('UpdateOpenchannelQueueReport',_0x3f2b70,JSON[_0x6a86('0x11')](_0x4d8bf0));_0x1c41a7(_0x4d8bf0);})[_0x6a86('0x16')](function(_0x1bb745){logger[_0x6a86('0x12')]('UpdateOpenchannelQueueReport',_0x1bb745[_0x6a86('0x14')],_0x3f2b70);_0x46f6c7(_0x19382d['error'](0x1f4,_0x1bb745[_0x6a86('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 75c89bb..30c51b4 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 _0x50bc=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','post','create','update','exports','util','express'];(function(_0x218ff6,_0xf64f63){var _0xcbcbc1=function(_0x4da00d){while(--_0x4da00d){_0x218ff6['push'](_0x218ff6['shift']());}};_0xcbcbc1(++_0xf64f63);}(_0x50bc,0x75));var _0xc50b=function(_0x27a35c,_0x222d54){_0x27a35c=_0x27a35c-0x0;var _0x23bb02=_0x50bc[_0x27a35c];return _0x23bb02;};'use strict';var multer=require('multer');var util=require(_0xc50b('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc50b('0x1'));var router=express[_0xc50b('0x2')]();var fs_extra=require(_0xc50b('0x3'));var auth=require(_0xc50b('0x4'));var interaction=require(_0xc50b('0x5'));var config=require(_0xc50b('0x6'));var controller=require('./openchannelTransferReport.controller');router[_0xc50b('0x7')]('/',auth[_0xc50b('0x8')](),controller['index']);router[_0xc50b('0x7')](_0xc50b('0x9'),auth[_0xc50b('0x8')](),controller[_0xc50b('0xa')]);router[_0xc50b('0x7')](_0xc50b('0xb'),auth[_0xc50b('0x8')](),controller[_0xc50b('0xc')]);router[_0xc50b('0xd')]('/',auth[_0xc50b('0x8')](),controller[_0xc50b('0xe')]);router['put'](_0xc50b('0xb'),auth[_0xc50b('0x8')](),controller[_0xc50b('0xf')]);router['delete'](_0xc50b('0xb'),auth[_0xc50b('0x8')](),controller['destroy']);module[_0xc50b('0x10')]=router; \ No newline at end of file +var _0x1d8e=['create','put','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','post'];(function(_0x45943c,_0x292e90){var _0xe1cf98=function(_0x4ba1ae){while(--_0x4ba1ae){_0x45943c['push'](_0x45943c['shift']());}};_0xe1cf98(++_0x292e90);}(_0x1d8e,0x83));var _0xe1d8=function(_0x179b53,_0x31f6fe){_0x179b53=_0x179b53-0x0;var _0x38a146=_0x1d8e[_0x179b53];return _0x38a146;};'use strict';var multer=require(_0xe1d8('0x0'));var util=require(_0xe1d8('0x1'));var path=require(_0xe1d8('0x2'));var timeout=require(_0xe1d8('0x3'));var express=require('express');var router=express[_0xe1d8('0x4')]();var fs_extra=require(_0xe1d8('0x5'));var auth=require(_0xe1d8('0x6'));var interaction=require(_0xe1d8('0x7'));var config=require(_0xe1d8('0x8'));var controller=require('./openchannelTransferReport.controller');router[_0xe1d8('0x9')]('/',auth[_0xe1d8('0xa')](),controller['index']);router[_0xe1d8('0x9')](_0xe1d8('0xb'),auth['isAuthenticated'](),controller[_0xe1d8('0xc')]);router[_0xe1d8('0x9')](_0xe1d8('0xd'),auth[_0xe1d8('0xa')](),controller[_0xe1d8('0xe')]);router[_0xe1d8('0xf')]('/',auth[_0xe1d8('0xa')](),controller[_0xe1d8('0x10')]);router[_0xe1d8('0x11')]('/:id',auth[_0xe1d8('0xa')](),controller[_0xe1d8('0x12')]);router[_0xe1d8('0x13')](_0xe1d8('0xd'),auth[_0xe1d8('0xa')](),controller['destroy']);module[_0xe1d8('0x14')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index 1112325..5398ca0 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 _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x5e3115,_0x540600){var _0x5a1dc6=function(_0x1163f5){while(--_0x1163f5){_0x5e3115['push'](_0x5e3115['shift']());}};_0x5a1dc6(++_0x540600);}(_0x9c44,0x178));var _0x49c4=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x9c44[_0x3bf83f];return _0x22c4a9;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x49c4('0x0')]={'uniqueid':{'type':Sequelize[_0x49c4('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x49c4('0x2')](_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x49c4('0x6')]}}; \ No newline at end of file +var _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x3df871,_0xda2e11){var _0x570f7b=function(_0xfaac78){while(--_0xfaac78){_0x3df871['push'](_0x3df871['shift']());}};_0x570f7b(++_0xda2e11);}(_0x9c44,0x178));var _0x49c4=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0x9c44[_0x16b9ed];return _0x66b1f8;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x49c4('0x0')]={'uniqueid':{'type':Sequelize[_0x49c4('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x49c4('0x2')](_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x49c4('0x6')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 8cf2e7e..3c51a20 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 _0xcec5=['describe','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','map','OpenchannelTransferReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','find','create','body'];(function(_0x7e2eb0,_0x17cd58){var _0xd92de4=function(_0x5d005b){while(--_0x5d005b){_0x7e2eb0['push'](_0x7e2eb0['shift']());}};_0xd92de4(++_0x17cd58);}(_0xcec5,0x121));var _0x5cec=function(_0x3adcbc,_0x27a0fd){_0x3adcbc=_0x3adcbc-0x0;var _0x2c5473=_0xcec5[_0x3adcbc];return _0x2c5473;};'use strict';var emlformat=require(_0x5cec('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5cec('0x1'));var rp=require(_0x5cec('0x2'));var moment=require(_0x5cec('0x3'));var BPromise=require(_0x5cec('0x4'));var Mustache=require(_0x5cec('0x5'));var util=require('util');var path=require(_0x5cec('0x6'));var sox=require('sox');var csv=require(_0x5cec('0x7'));var ejs=require(_0x5cec('0x8'));var fs=require('fs');var fs_extra=require(_0x5cec('0x9'));var _=require('lodash');var squel=require(_0x5cec('0xa'));var crypto=require('crypto');var jsforce=require(_0x5cec('0xb'));var deskjs=require(_0x5cec('0xc'));var toCsv=require(_0x5cec('0x7'));var querystring=require(_0x5cec('0xd'));var Papa=require(_0x5cec('0xe'));var Redis=require(_0x5cec('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x5cec('0x10'));var hardwareService=require(_0x5cec('0x11'));var logger=require(_0x5cec('0x12'))(_0x5cec('0x13'));var utils=require(_0x5cec('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5cec('0x15'))['db'];function respondWithStatusCode(_0x3f7009,_0x27460a){_0x27460a=_0x27460a||0xcc;return function(_0x39f927){if(_0x39f927){return _0x3f7009['sendStatus'](_0x27460a);}return _0x3f7009[_0x5cec('0x16')](_0x27460a)[_0x5cec('0x17')]();};}function respondWithResult(_0x244ee8,_0x4e8f22){_0x4e8f22=_0x4e8f22||0xc8;return function(_0x1d744b){if(_0x1d744b){return _0x244ee8[_0x5cec('0x16')](_0x4e8f22)[_0x5cec('0x18')](_0x1d744b);}};}function respondWithFilteredResult(_0x233cc5,_0x59ae65){return function(_0x359348){if(_0x359348){var _0x385b68=typeof _0x59ae65[_0x5cec('0x19')]===_0x5cec('0x1a')&&typeof _0x59ae65[_0x5cec('0x1b')]===_0x5cec('0x1a');var _0x46838=_0x359348[_0x5cec('0x1c')];var _0x322680=_0x385b68?0x0:_0x59ae65[_0x5cec('0x19')];var _0x7b2a22=_0x385b68?_0x359348[_0x5cec('0x1c')]:_0x59ae65[_0x5cec('0x19')]+_0x59ae65[_0x5cec('0x1b')];var _0x1f8613;if(_0x7b2a22>=_0x46838){_0x7b2a22=_0x46838;_0x1f8613=0xc8;}else{_0x1f8613=0xce;}_0x233cc5[_0x5cec('0x16')](_0x1f8613);return _0x233cc5['set'](_0x5cec('0x1d'),_0x322680+'-'+_0x7b2a22+'/'+_0x46838)[_0x5cec('0x18')](_0x359348);}return null;};}function patchUpdates(_0x5a926d){return function(_0x499d4f){try{jsonpatch[_0x5cec('0x1e')](_0x499d4f,_0x5a926d,!![]);}catch(_0x3c4eb6){return BPromise[_0x5cec('0x1f')](_0x3c4eb6);}return _0x499d4f[_0x5cec('0x20')]();};}function saveUpdates(_0x5e0423,_0x20d62c){return function(_0x15b991){if(_0x15b991){return _0x15b991[_0x5cec('0x21')](_0x5e0423)[_0x5cec('0x22')](function(_0x541fab){return _0x541fab;});}return null;};}function removeEntity(_0x31a135,_0x2aaf93){return function(_0x54f309){if(_0x54f309){return _0x54f309[_0x5cec('0x23')]()['then'](function(){_0x31a135[_0x5cec('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x214dae,_0x4d5cb9){return function(_0x422a3c){if(!_0x422a3c){_0x214dae[_0x5cec('0x24')](0x194);}return _0x422a3c;};}function handleError(_0x521170,_0x2b50c6){_0x2b50c6=_0x2b50c6||0x1f4;return function(_0x3ac939){logger['error'](_0x3ac939[_0x5cec('0x25')]);if(_0x3ac939[_0x5cec('0x26')]){delete _0x3ac939[_0x5cec('0x26')];}_0x521170['status'](_0x2b50c6)[_0x5cec('0x27')](_0x3ac939);};}exports['index']=function(_0xfa7845,_0x16035a){var _0x3a0e65={},_0x2ebe9c={},_0x472bd7={'count':0x0,'rows':[]};var _0x5781c7=_[_0x5cec('0x28')](db[_0x5cec('0x29')][_0x5cec('0x2a')],function(_0x192376){return{'name':_0x192376[_0x5cec('0x2b')],'type':_0x192376[_0x5cec('0x2c')]['key']};});_0x2ebe9c[_0x5cec('0x2d')]=_['map'](_0x5781c7,_0x5cec('0x26'));_0x2ebe9c[_0x5cec('0x2e')]=_[_0x5cec('0x2f')](_0xfa7845[_0x5cec('0x2e')]);_0x2ebe9c[_0x5cec('0x30')]=_[_0x5cec('0x31')](_0x2ebe9c[_0x5cec('0x2d')],_0x2ebe9c[_0x5cec('0x2e')]);_0x3a0e65[_0x5cec('0x32')]=_[_0x5cec('0x31')](_0x2ebe9c['model'],qs[_0x5cec('0x33')](_0xfa7845['query']['fields']));_0x3a0e65[_0x5cec('0x32')]=_0x3a0e65[_0x5cec('0x32')][_0x5cec('0x34')]?_0x3a0e65[_0x5cec('0x32')]:_0x2ebe9c[_0x5cec('0x2d')];if(!_0xfa7845['query'][_0x5cec('0x35')]('nolimit')){_0x3a0e65['limit']=qs['limit'](_0xfa7845[_0x5cec('0x2e')][_0x5cec('0x1b')]);_0x3a0e65[_0x5cec('0x19')]=qs['offset'](_0xfa7845[_0x5cec('0x2e')][_0x5cec('0x19')]);}_0x3a0e65[_0x5cec('0x36')]=qs[_0x5cec('0x37')](_0xfa7845[_0x5cec('0x2e')]['sort']);_0x3a0e65['where']=qs['filters'](_[_0x5cec('0x38')](_0xfa7845['query'],_0x2ebe9c[_0x5cec('0x30')]),_0x5781c7);if(_0xfa7845['query'][_0x5cec('0x39')]){_0x3a0e65[_0x5cec('0x3a')]=_['merge'](_0x3a0e65[_0x5cec('0x3a')],{'$or':_[_0x5cec('0x28')](_0x5781c7,function(_0x3a1679){if(_0x3a1679[_0x5cec('0x2c')]!==_0x5cec('0x3b')){var _0x5ece7d={};_0x5ece7d[_0x3a1679['name']]={'$like':'%'+_0xfa7845[_0x5cec('0x2e')][_0x5cec('0x39')]+'%'};return _0x5ece7d;}})});}_0x3a0e65=_[_0x5cec('0x3c')]({},_0x3a0e65,_0xfa7845[_0x5cec('0x3d')]);var _0x35af99={'where':_0x3a0e65[_0x5cec('0x3a')]};return db[_0x5cec('0x29')][_0x5cec('0x1c')](_0x35af99)['then'](function(_0x4c550f){_0x472bd7[_0x5cec('0x1c')]=_0x4c550f;if(_0xfa7845[_0x5cec('0x2e')][_0x5cec('0x3e')]){_0x3a0e65[_0x5cec('0x3f')]=[{'all':!![]}];}return db[_0x5cec('0x29')]['findAll'](_0x3a0e65);})[_0x5cec('0x22')](function(_0x418494){_0x472bd7[_0x5cec('0x40')]=_0x418494;return _0x472bd7;})['then'](respondWithFilteredResult(_0x16035a,_0x3a0e65))[_0x5cec('0x41')](handleError(_0x16035a,null));};exports[_0x5cec('0x42')]=function(_0x2f0d00,_0x517ea1){var _0x565289={'raw':!![],'where':{'id':_0x2f0d00[_0x5cec('0x43')]['id']}},_0x25c789={};_0x25c789[_0x5cec('0x2d')]=_[_0x5cec('0x2f')](db[_0x5cec('0x29')]['rawAttributes']);_0x25c789[_0x5cec('0x2e')]=_[_0x5cec('0x2f')](_0x2f0d00[_0x5cec('0x2e')]);_0x25c789['filters']=_[_0x5cec('0x31')](_0x25c789[_0x5cec('0x2d')],_0x25c789[_0x5cec('0x2e')]);_0x565289['attributes']=_[_0x5cec('0x31')](_0x25c789[_0x5cec('0x2d')],qs['fields'](_0x2f0d00[_0x5cec('0x2e')][_0x5cec('0x33')]));_0x565289[_0x5cec('0x32')]=_0x565289['attributes'][_0x5cec('0x34')]?_0x565289['attributes']:_0x25c789[_0x5cec('0x2d')];if(_0x2f0d00['query'][_0x5cec('0x3e')]){_0x565289[_0x5cec('0x3f')]=[{'all':!![]}];}_0x565289=_[_0x5cec('0x3c')]({},_0x565289,_0x2f0d00['options']);return db[_0x5cec('0x29')][_0x5cec('0x44')](_0x565289)[_0x5cec('0x22')](handleEntityNotFound(_0x517ea1,null))['then'](respondWithResult(_0x517ea1,null))[_0x5cec('0x41')](handleError(_0x517ea1,null));};exports[_0x5cec('0x45')]=function(_0x4d713e,_0xc7a31a){return db[_0x5cec('0x29')][_0x5cec('0x45')](_0x4d713e[_0x5cec('0x46')],{})['then'](respondWithResult(_0xc7a31a,0xc9))[_0x5cec('0x41')](handleError(_0xc7a31a,null));};exports[_0x5cec('0x21')]=function(_0x593350,_0x16a7a7){if(_0x593350[_0x5cec('0x46')]['id']){delete _0x593350[_0x5cec('0x46')]['id'];}return db[_0x5cec('0x29')][_0x5cec('0x44')]({'where':{'id':_0x593350[_0x5cec('0x43')]['id']}})[_0x5cec('0x22')](handleEntityNotFound(_0x16a7a7,null))[_0x5cec('0x22')](saveUpdates(_0x593350['body'],null))[_0x5cec('0x22')](respondWithResult(_0x16a7a7,null))[_0x5cec('0x41')](handleError(_0x16a7a7,null));};exports[_0x5cec('0x23')]=function(_0x17219e,_0x265dda){return db[_0x5cec('0x29')]['find']({'where':{'id':_0x17219e[_0x5cec('0x43')]['id']}})[_0x5cec('0x22')](handleEntityNotFound(_0x265dda,null))[_0x5cec('0x22')](removeEntity(_0x265dda,null))[_0x5cec('0x41')](handleError(_0x265dda,null));};exports['describe']=function(_0x57270f,_0x33117e){return db[_0x5cec('0x29')][_0x5cec('0x47')]()['then'](respondWithResult(_0x33117e,null))[_0x5cec('0x41')](handleError(_0x33117e,null));}; \ No newline at end of file +var _0x11db=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','then','destroy','sendStatus','name','send','index','OpenchannelTransferReport','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','include','rows','catch','params','rawAttributes','find','create','update','body','describe','zip-dir','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse'];(function(_0x26df48,_0x22aa50){var _0x209047=function(_0x1d068b){while(--_0x1d068b){_0x26df48['push'](_0x26df48['shift']());}};_0x209047(++_0x22aa50);}(_0x11db,0x116));var _0xb11d=function(_0x1034bb,_0x4e20b3){_0x1034bb=_0x1034bb-0x0;var _0x453fdb=_0x11db[_0x1034bb];return _0x453fdb;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xb11d('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb11d('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb11d('0x2'));var util=require(_0xb11d('0x3'));var path=require(_0xb11d('0x4'));var sox=require(_0xb11d('0x5'));var csv=require(_0xb11d('0x6'));var ejs=require(_0xb11d('0x7'));var fs=require('fs');var fs_extra=require(_0xb11d('0x8'));var _=require(_0xb11d('0x9'));var squel=require(_0xb11d('0xa'));var crypto=require('crypto');var jsforce=require(_0xb11d('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xb11d('0x6'));var querystring=require(_0xb11d('0xc'));var Papa=require(_0xb11d('0xd'));var Redis=require(_0xb11d('0xe'));var authService=require(_0xb11d('0xf'));var qs=require(_0xb11d('0x10'));var as=require(_0xb11d('0x11'));var hardwareService=require(_0xb11d('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xb11d('0x13'));var config=require(_0xb11d('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xb11d('0x15'))['db'];function respondWithStatusCode(_0x14c180,_0x37dc9e){_0x37dc9e=_0x37dc9e||0xcc;return function(_0x510e5f){if(_0x510e5f){return _0x14c180['sendStatus'](_0x37dc9e);}return _0x14c180[_0xb11d('0x16')](_0x37dc9e)[_0xb11d('0x17')]();};}function respondWithResult(_0x3978f3,_0x35cdd0){_0x35cdd0=_0x35cdd0||0xc8;return function(_0xa1c5a7){if(_0xa1c5a7){return _0x3978f3['status'](_0x35cdd0)['json'](_0xa1c5a7);}};}function respondWithFilteredResult(_0x59d452,_0x5389b8){return function(_0x49b7ac){if(_0x49b7ac){var _0x479b27=typeof _0x5389b8['offset']===_0xb11d('0x18')&&typeof _0x5389b8[_0xb11d('0x19')]===_0xb11d('0x18');var _0x4e0c2d=_0x49b7ac[_0xb11d('0x1a')];var _0x3b33e4=_0x479b27?0x0:_0x5389b8[_0xb11d('0x1b')];var _0x1f253e=_0x479b27?_0x49b7ac['count']:_0x5389b8['offset']+_0x5389b8['limit'];var _0x4aa026;if(_0x1f253e>=_0x4e0c2d){_0x1f253e=_0x4e0c2d;_0x4aa026=0xc8;}else{_0x4aa026=0xce;}_0x59d452['status'](_0x4aa026);return _0x59d452[_0xb11d('0x1c')](_0xb11d('0x1d'),_0x3b33e4+'-'+_0x1f253e+'/'+_0x4e0c2d)[_0xb11d('0x1e')](_0x49b7ac);}return null;};}function patchUpdates(_0x2460d5){return function(_0x26054f){try{jsonpatch[_0xb11d('0x1f')](_0x26054f,_0x2460d5,!![]);}catch(_0x5bbf28){return BPromise[_0xb11d('0x20')](_0x5bbf28);}return _0x26054f[_0xb11d('0x21')]();};}function saveUpdates(_0x2eec8c,_0x26e2c1){return function(_0x46c1e2){if(_0x46c1e2){return _0x46c1e2['update'](_0x2eec8c)[_0xb11d('0x22')](function(_0x526e95){return _0x526e95;});}return null;};}function removeEntity(_0x4c673f,_0x1b427f){return function(_0xf47139){if(_0xf47139){return _0xf47139[_0xb11d('0x23')]()[_0xb11d('0x22')](function(){_0x4c673f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x593bf7,_0x3e43d9){return function(_0x72d06d){if(!_0x72d06d){_0x593bf7[_0xb11d('0x24')](0x194);}return _0x72d06d;};}function handleError(_0x3e9df1,_0x28bb41){_0x28bb41=_0x28bb41||0x1f4;return function(_0x55e172){logger['error'](_0x55e172['stack']);if(_0x55e172[_0xb11d('0x25')]){delete _0x55e172[_0xb11d('0x25')];}_0x3e9df1[_0xb11d('0x16')](_0x28bb41)[_0xb11d('0x26')](_0x55e172);};}exports[_0xb11d('0x27')]=function(_0x2fc6f1,_0x2910ad){var _0x5abe11={},_0x52c0e3={},_0x3de0f8={'count':0x0,'rows':[]};var _0x2372c4=_['map'](db[_0xb11d('0x28')]['rawAttributes'],function(_0x3843b0){return{'name':_0x3843b0[_0xb11d('0x29')],'type':_0x3843b0[_0xb11d('0x2a')][_0xb11d('0x2b')]};});_0x52c0e3[_0xb11d('0x2c')]=_['map'](_0x2372c4,_0xb11d('0x25'));_0x52c0e3[_0xb11d('0x2d')]=_[_0xb11d('0x2e')](_0x2fc6f1['query']);_0x52c0e3[_0xb11d('0x2f')]=_[_0xb11d('0x30')](_0x52c0e3[_0xb11d('0x2c')],_0x52c0e3[_0xb11d('0x2d')]);_0x5abe11['attributes']=_['intersection'](_0x52c0e3[_0xb11d('0x2c')],qs[_0xb11d('0x31')](_0x2fc6f1[_0xb11d('0x2d')][_0xb11d('0x31')]));_0x5abe11[_0xb11d('0x32')]=_0x5abe11[_0xb11d('0x32')][_0xb11d('0x33')]?_0x5abe11[_0xb11d('0x32')]:_0x52c0e3[_0xb11d('0x2c')];if(!_0x2fc6f1['query']['hasOwnProperty'](_0xb11d('0x34'))){_0x5abe11[_0xb11d('0x19')]=qs[_0xb11d('0x19')](_0x2fc6f1[_0xb11d('0x2d')][_0xb11d('0x19')]);_0x5abe11[_0xb11d('0x1b')]=qs[_0xb11d('0x1b')](_0x2fc6f1[_0xb11d('0x2d')][_0xb11d('0x1b')]);}_0x5abe11[_0xb11d('0x35')]=qs[_0xb11d('0x36')](_0x2fc6f1[_0xb11d('0x2d')][_0xb11d('0x36')]);_0x5abe11[_0xb11d('0x37')]=qs[_0xb11d('0x2f')](_[_0xb11d('0x38')](_0x2fc6f1['query'],_0x52c0e3[_0xb11d('0x2f')]),_0x2372c4);if(_0x2fc6f1[_0xb11d('0x2d')][_0xb11d('0x39')]){_0x5abe11[_0xb11d('0x37')]=_[_0xb11d('0x3a')](_0x5abe11['where'],{'$or':_[_0xb11d('0x3b')](_0x2372c4,function(_0x144f45){if(_0x144f45[_0xb11d('0x2a')]!==_0xb11d('0x3c')){var _0x3b760c={};_0x3b760c[_0x144f45['name']]={'$like':'%'+_0x2fc6f1[_0xb11d('0x2d')][_0xb11d('0x39')]+'%'};return _0x3b760c;}})});}_0x5abe11=_[_0xb11d('0x3a')]({},_0x5abe11,_0x2fc6f1[_0xb11d('0x3d')]);var _0x10f251={'where':_0x5abe11[_0xb11d('0x37')]};return db[_0xb11d('0x28')]['count'](_0x10f251)[_0xb11d('0x22')](function(_0x229873){_0x3de0f8[_0xb11d('0x1a')]=_0x229873;if(_0x2fc6f1[_0xb11d('0x2d')][_0xb11d('0x3e')]){_0x5abe11[_0xb11d('0x3f')]=[{'all':!![]}];}return db[_0xb11d('0x28')]['findAll'](_0x5abe11);})[_0xb11d('0x22')](function(_0x4cb208){_0x3de0f8[_0xb11d('0x40')]=_0x4cb208;return _0x3de0f8;})[_0xb11d('0x22')](respondWithFilteredResult(_0x2910ad,_0x5abe11))[_0xb11d('0x41')](handleError(_0x2910ad,null));};exports['show']=function(_0x47b82b,_0x2c88a2){var _0x117273={'raw':!![],'where':{'id':_0x47b82b[_0xb11d('0x42')]['id']}},_0x2a63bb={};_0x2a63bb[_0xb11d('0x2c')]=_[_0xb11d('0x2e')](db[_0xb11d('0x28')][_0xb11d('0x43')]);_0x2a63bb['query']=_[_0xb11d('0x2e')](_0x47b82b['query']);_0x2a63bb['filters']=_['intersection'](_0x2a63bb[_0xb11d('0x2c')],_0x2a63bb[_0xb11d('0x2d')]);_0x117273[_0xb11d('0x32')]=_[_0xb11d('0x30')](_0x2a63bb[_0xb11d('0x2c')],qs['fields'](_0x47b82b[_0xb11d('0x2d')][_0xb11d('0x31')]));_0x117273[_0xb11d('0x32')]=_0x117273[_0xb11d('0x32')][_0xb11d('0x33')]?_0x117273[_0xb11d('0x32')]:_0x2a63bb[_0xb11d('0x2c')];if(_0x47b82b[_0xb11d('0x2d')]['includeAll']){_0x117273[_0xb11d('0x3f')]=[{'all':!![]}];}_0x117273=_[_0xb11d('0x3a')]({},_0x117273,_0x47b82b[_0xb11d('0x3d')]);return db[_0xb11d('0x28')][_0xb11d('0x44')](_0x117273)[_0xb11d('0x22')](handleEntityNotFound(_0x2c88a2,null))[_0xb11d('0x22')](respondWithResult(_0x2c88a2,null))['catch'](handleError(_0x2c88a2,null));};exports['create']=function(_0x2566a2,_0x26d320){return db[_0xb11d('0x28')][_0xb11d('0x45')](_0x2566a2['body'],{})[_0xb11d('0x22')](respondWithResult(_0x26d320,0xc9))[_0xb11d('0x41')](handleError(_0x26d320,null));};exports[_0xb11d('0x46')]=function(_0xe00c3b,_0x4fc19c){if(_0xe00c3b[_0xb11d('0x47')]['id']){delete _0xe00c3b[_0xb11d('0x47')]['id'];}return db[_0xb11d('0x28')][_0xb11d('0x44')]({'where':{'id':_0xe00c3b[_0xb11d('0x42')]['id']}})[_0xb11d('0x22')](handleEntityNotFound(_0x4fc19c,null))[_0xb11d('0x22')](saveUpdates(_0xe00c3b['body'],null))[_0xb11d('0x22')](respondWithResult(_0x4fc19c,null))[_0xb11d('0x41')](handleError(_0x4fc19c,null));};exports[_0xb11d('0x23')]=function(_0x9fd5cb,_0x32dd65){return db[_0xb11d('0x28')]['find']({'where':{'id':_0x9fd5cb['params']['id']}})[_0xb11d('0x22')](handleEntityNotFound(_0x32dd65,null))[_0xb11d('0x22')](removeEntity(_0x32dd65,null))[_0xb11d('0x41')](handleError(_0x32dd65,null));};exports[_0xb11d('0x48')]=function(_0x4cea29,_0xd05b10){return db[_0xb11d('0x28')][_0xb11d('0x48')]()[_0xb11d('0x22')](respondWithResult(_0xd05b10,null))['catch'](handleError(_0xd05b10,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index e0c27b9..6e3689f 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 _0x0967=['uniqueid','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','OpenchannelTransferReport','report_openchannel_transfer'];(function(_0x3ebb69,_0x3e612e){var _0x421e59=function(_0x5a8c66){while(--_0x5a8c66){_0x3ebb69['push'](_0x3ebb69['shift']());}};_0x421e59(++_0x3e612e);}(_0x0967,0x137));var _0x7096=function(_0x2ed9e0,_0x700d08){_0x2ed9e0=_0x2ed9e0-0x0;var _0x1f32f8=_0x0967[_0x2ed9e0];return _0x1f32f8;};'use strict';var _=require('lodash');var util=require(_0x7096('0x0'));var logger=require(_0x7096('0x1'))('api');var moment=require(_0x7096('0x2'));var BPromise=require(_0x7096('0x3'));var rp=require(_0x7096('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7096('0x5'));var config=require(_0x7096('0x6'));var attributes=require('./openchannelTransferReport.attributes');module['exports']=function(_0x2cc413,_0x4d93e2){return _0x2cc413['define'](_0x7096('0x7'),attributes,{'tableName':_0x7096('0x8'),'paranoid':![],'indexes':[{'name':_0x7096('0x9'),'fields':[_0x7096('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa8c3=['exports','define','report_openchannel_transfer','uniqueid','lodash','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./openchannelTransferReport.attributes'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xa8c3,0x7c));var _0x3a8c=function(_0x30b0d8,_0x57470c){_0x30b0d8=_0x30b0d8-0x0;var _0x459c09=_0xa8c3[_0x30b0d8];return _0x459c09;};'use strict';var _=require(_0x3a8c('0x0'));var util=require('util');var logger=require(_0x3a8c('0x1'))(_0x3a8c('0x2'));var moment=require('moment');var BPromise=require(_0x3a8c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3a8c('0x4'));var rimraf=require(_0x3a8c('0x5'));var config=require(_0x3a8c('0x6'));var attributes=require(_0x3a8c('0x7'));module[_0x3a8c('0x8')]=function(_0x5277f8,_0x158e6b){return _0x5277f8[_0x3a8c('0x9')]('OpenchannelTransferReport',attributes,{'tableName':_0x3a8c('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x3a8c('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index 250a126..05b0ded 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 _0xc818=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x5d091f,_0x457a5e){var _0x581be9=function(_0x3a6e03){while(--_0x3a6e03){_0x5d091f['push'](_0x5d091f['shift']());}};_0x581be9(++_0x457a5e);}(_0xc818,0x1e3));var _0x8c81=function(_0x1709c8,_0x358615){_0x1709c8=_0x1709c8-0x0;var _0x19adec=_0xc818[_0x1709c8];return _0x19adec;};'use strict';var _=require(_0x8c81('0x0'));var util=require(_0x8c81('0x1'));var moment=require(_0x8c81('0x2'));var BPromise=require(_0x8c81('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8c81('0x4'));var db=require(_0x8c81('0x5'))['db'];var utils=require(_0x8c81('0x6'));var logger=require(_0x8c81('0x7'))(_0x8c81('0x8'));var config=require(_0x8c81('0x9'));var jayson=require(_0x8c81('0xa'));var client=jayson['client'][_0x8c81('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3d663e,_0x32cf31,_0x43d142){return new BPromise(function(_0x501240,_0x1173cf){return client[_0x8c81('0xc')](_0x3d663e,_0x43d142)[_0x8c81('0xd')](function(_0x15ebff){logger[_0x8c81('0xe')](_0x8c81('0xf'),_0x32cf31,_0x8c81('0x10'));logger['debug'](_0x8c81('0x11'),_0x32cf31,_0x8c81('0x10'),JSON[_0x8c81('0x12')](_0x15ebff));if(_0x15ebff[_0x8c81('0x13')]){if(_0x15ebff['error'][_0x8c81('0x14')]===0x1f4){logger[_0x8c81('0x13')](_0x8c81('0xf'),_0x32cf31,_0x15ebff[_0x8c81('0x13')][_0x8c81('0x15')]);return _0x1173cf(_0x15ebff[_0x8c81('0x13')][_0x8c81('0x15')]);}logger[_0x8c81('0x13')](_0x8c81('0xf'),_0x32cf31,_0x15ebff['error']['message']);return _0x501240(_0x15ebff[_0x8c81('0x13')][_0x8c81('0x15')]);}else{logger[_0x8c81('0xe')](_0x8c81('0xf'),_0x32cf31,_0x8c81('0x10'));_0x501240(_0x15ebff[_0x8c81('0x16')]['message']);}})[_0x8c81('0x17')](function(_0x29ccb0){logger[_0x8c81('0x13')](_0x8c81('0xf'),_0x32cf31,_0x29ccb0);_0x1173cf(_0x29ccb0);});});} \ No newline at end of file +var _0x0e17=['code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','error'];(function(_0x4fa1f0,_0x5b5c01){var _0x20c7b6=function(_0x5db9a4){while(--_0x5db9a4){_0x4fa1f0['push'](_0x4fa1f0['shift']());}};_0x20c7b6(++_0x5b5c01);}(_0x0e17,0xd6));var _0x70e1=function(_0x127501,_0x5a42b1){_0x127501=_0x127501-0x0;var _0xaa76c3=_0x0e17[_0x127501];return _0xaa76c3;};'use strict';var _=require(_0x70e1('0x0'));var util=require(_0x70e1('0x1'));var moment=require(_0x70e1('0x2'));var BPromise=require(_0x70e1('0x3'));var rs=require(_0x70e1('0x4'));var fs=require('fs');var Redis=require(_0x70e1('0x5'));var db=require(_0x70e1('0x6'))['db'];var utils=require(_0x70e1('0x7'));var logger=require(_0x70e1('0x8'))(_0x70e1('0x9'));var config=require(_0x70e1('0xa'));var jayson=require(_0x70e1('0xb'));var client=jayson['client'][_0x70e1('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x16a2ad,_0x191d53,_0x27f310){return new BPromise(function(_0x26218a,_0x2c45c3){return client['request'](_0x16a2ad,_0x27f310)['then'](function(_0xfe25b1){logger['info'](_0x70e1('0xd'),_0x191d53,_0x70e1('0xe'));logger['debug'](_0x70e1('0xf'),_0x191d53,_0x70e1('0xe'),JSON['stringify'](_0xfe25b1));if(_0xfe25b1[_0x70e1('0x10')]){if(_0xfe25b1['error'][_0x70e1('0x11')]===0x1f4){logger['error'](_0x70e1('0xd'),_0x191d53,_0xfe25b1[_0x70e1('0x10')][_0x70e1('0x12')]);return _0x2c45c3(_0xfe25b1[_0x70e1('0x10')][_0x70e1('0x12')]);}logger[_0x70e1('0x10')](_0x70e1('0xd'),_0x191d53,_0xfe25b1[_0x70e1('0x10')][_0x70e1('0x12')]);return _0x26218a(_0xfe25b1[_0x70e1('0x10')][_0x70e1('0x12')]);}else{logger['info'](_0x70e1('0xd'),_0x191d53,_0x70e1('0xe'));_0x26218a(_0xfe25b1[_0x70e1('0x13')][_0x70e1('0x12')]);}})[_0x70e1('0x14')](function(_0xc18a09){logger[_0x70e1('0x10')](_0x70e1('0xd'),_0x191d53,_0xc18a09);_0x2c45c3(_0xc18a09);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index c0a7827..cf68f41 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 _0x2763=['../../components/auth/service','../../config/environment','./pause.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra'];(function(_0x1fe5fc,_0x5ef4f6){var _0x18c9dc=function(_0x595ee5){while(--_0x595ee5){_0x1fe5fc['push'](_0x1fe5fc['shift']());}};_0x18c9dc(++_0x5ef4f6);}(_0x2763,0x18a));var _0x3276=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x2763[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require(_0x3276('0x0'));var path=require(_0x3276('0x1'));var timeout=require(_0x3276('0x2'));var express=require('express');var router=express[_0x3276('0x3')]();var fs_extra=require(_0x3276('0x4'));var auth=require(_0x3276('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x3276('0x6'));var controller=require(_0x3276('0x7'));router[_0x3276('0x8')]('/',auth[_0x3276('0x9')](),controller[_0x3276('0xa')]);router['get'](_0x3276('0xb'),auth[_0x3276('0x9')](),controller[_0x3276('0xc')]);router[_0x3276('0xd')]('/',auth[_0x3276('0x9')](),controller['create']);router[_0x3276('0xe')]('/:id',auth[_0x3276('0x9')](),controller[_0x3276('0xf')]);router[_0x3276('0x10')](_0x3276('0xb'),auth[_0x3276('0x9')](),controller[_0x3276('0x11')]);module[_0x3276('0x12')]=router; \ No newline at end of file +var _0x200a=['fs-extra','../../components/interaction/service','../../config/environment','./pause.controller','get','index','/:id','isAuthenticated','post','create','put','update','delete','destroy','multer','util','connect-timeout','Router'];(function(_0x4a79b8,_0x23163f){var _0xc03275=function(_0x1edfe4){while(--_0x1edfe4){_0x4a79b8['push'](_0x4a79b8['shift']());}};_0xc03275(++_0x23163f);}(_0x200a,0xf8));var _0xa200=function(_0x1b8e60,_0x21b885){_0x1b8e60=_0x1b8e60-0x0;var _0x363363=_0x200a[_0x1b8e60];return _0x363363;};'use strict';var multer=require(_0xa200('0x0'));var util=require(_0xa200('0x1'));var path=require('path');var timeout=require(_0xa200('0x2'));var express=require('express');var router=express[_0xa200('0x3')]();var fs_extra=require(_0xa200('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xa200('0x5'));var config=require(_0xa200('0x6'));var controller=require(_0xa200('0x7'));router[_0xa200('0x8')]('/',auth['isAuthenticated'](),controller[_0xa200('0x9')]);router[_0xa200('0x8')](_0xa200('0xa'),auth[_0xa200('0xb')](),controller['show']);router[_0xa200('0xc')]('/',auth[_0xa200('0xb')](),controller[_0xa200('0xd')]);router[_0xa200('0xe')]('/:id',auth[_0xa200('0xb')](),controller[_0xa200('0xf')]);router[_0xa200('0x10')](_0xa200('0xa'),auth['isAuthenticated'](),controller[_0xa200('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index c3aa03c..f99f13c 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 _0xbfde=['STRING','name','sequelize','exports'];(function(_0x381379,_0x3f3b86){var _0x3e1063=function(_0x4c282d){while(--_0x4c282d){_0x381379['push'](_0x381379['shift']());}};_0x3e1063(++_0x3f3b86);}(_0xbfde,0x166));var _0xebfd=function(_0x2bc0a6,_0x1a6106){_0x2bc0a6=_0x2bc0a6-0x0;var _0x10de33=_0xbfde[_0x2bc0a6];return _0x10de33;};'use strict';var Sequelize=require(_0xebfd('0x0'));module[_0xebfd('0x1')]={'name':{'type':Sequelize[_0xebfd('0x2')],'unique':_0xebfd('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x3495=['STRING','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3495,0x1e1));var _0x5349=function(_0x4fe1da,_0x2dc506){_0x4fe1da=_0x4fe1da-0x0;var _0x567636=_0x3495[_0x4fe1da];return _0x567636;};'use strict';var Sequelize=require(_0x5349('0x0'));module['exports']={'name':{'type':Sequelize[_0x5349('0x1')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x5349('0x1')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index a3a660c..052fffb 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 _0xeba9=['../../config/license/util','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','reject','save','then','destroy','get','end','error','stack','name','send','index','Pause','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Pauses','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','find','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment'];(function(_0x71e493,_0x4308b7){var _0x3d40ab=function(_0x29715){while(--_0x29715){_0x71e493['push'](_0x71e493['shift']());}};_0x3d40ab(++_0x4308b7);}(_0xeba9,0x145));var _0x9eba=function(_0x2e26f5,_0x2a1de7){_0x2e26f5=_0x2e26f5-0x0;var _0x53c3f6=_0xeba9[_0x2e26f5];return _0x53c3f6;};'use strict';var emlformat=require(_0x9eba('0x0'));var rimraf=require(_0x9eba('0x1'));var zipdir=require(_0x9eba('0x2'));var jsonpatch=require(_0x9eba('0x3'));var rp=require('request-promise');var moment=require(_0x9eba('0x4'));var BPromise=require(_0x9eba('0x5'));var Mustache=require('mustache');var util=require(_0x9eba('0x6'));var path=require(_0x9eba('0x7'));var sox=require(_0x9eba('0x8'));var csv=require(_0x9eba('0x9'));var ejs=require(_0x9eba('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9eba('0xb'));var squel=require(_0x9eba('0xc'));var crypto=require('crypto');var jsforce=require(_0x9eba('0xd'));var deskjs=require(_0x9eba('0xe'));var toCsv=require(_0x9eba('0x9'));var querystring=require('querystring');var Papa=require(_0x9eba('0xf'));var Redis=require(_0x9eba('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9eba('0x11'));var as=require(_0x9eba('0x12'));var hardwareService=require(_0x9eba('0x13'));var logger=require(_0x9eba('0x14'))(_0x9eba('0x15'));var utils=require('../../config/utils');var config=require(_0x9eba('0x16'));var licenseUtil=require(_0x9eba('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x131cbd,_0x1c943b){_0x1c943b=_0x1c943b||0xcc;return function(_0x22ad27){if(_0x22ad27){return _0x131cbd[_0x9eba('0x18')](_0x1c943b);}return _0x131cbd[_0x9eba('0x19')](_0x1c943b)['end']();};}function respondWithResult(_0x3b0484,_0x587441){_0x587441=_0x587441||0xc8;return function(_0x5c3a78){if(_0x5c3a78){return _0x3b0484[_0x9eba('0x19')](_0x587441)[_0x9eba('0x1a')](_0x5c3a78);}};}function respondWithFilteredResult(_0x4c36f2,_0x4c060a){return function(_0x4e2426){if(_0x4e2426){var _0x7596e3=typeof _0x4c060a['offset']===_0x9eba('0x1b')&&typeof _0x4c060a[_0x9eba('0x1c')]===_0x9eba('0x1b');var _0x24e428=_0x4e2426[_0x9eba('0x1d')];var _0x33bcb4=_0x7596e3?0x0:_0x4c060a[_0x9eba('0x1e')];var _0x1355db=_0x7596e3?_0x4e2426['count']:_0x4c060a[_0x9eba('0x1e')]+_0x4c060a['limit'];var _0x2b3d15;if(_0x1355db>=_0x24e428){_0x1355db=_0x24e428;_0x2b3d15=0xc8;}else{_0x2b3d15=0xce;}_0x4c36f2[_0x9eba('0x19')](_0x2b3d15);return _0x4c36f2[_0x9eba('0x1f')](_0x9eba('0x20'),_0x33bcb4+'-'+_0x1355db+'/'+_0x24e428)[_0x9eba('0x1a')](_0x4e2426);}return null;};}function patchUpdates(_0x3c5cc4){return function(_0x1f083f){try{jsonpatch['apply'](_0x1f083f,_0x3c5cc4,!![]);}catch(_0x204b87){return BPromise[_0x9eba('0x21')](_0x204b87);}return _0x1f083f[_0x9eba('0x22')]();};}function saveUpdates(_0x32fc98,_0x35b4db){return function(_0x48ec33){if(_0x48ec33){return _0x48ec33['update'](_0x32fc98)[_0x9eba('0x23')](function(_0x273710){return _0x273710;});}return null;};}function removeEntity(_0x45da6b,_0x3a80e0){return function(_0x314025){if(_0x314025){return _0x314025[_0x9eba('0x24')]()[_0x9eba('0x23')](function(){var _0x54ad57=_0x314025[_0x9eba('0x25')]({'plain':!![]});var _0x489a2a='Pauses';return db['UserProfileResource'][_0x9eba('0x24')]({'where':{'type':_0x489a2a,'resourceId':_0x54ad57['id']}})[_0x9eba('0x23')](function(){return _0x314025;});})[_0x9eba('0x23')](function(){_0x45da6b['status'](0xcc)[_0x9eba('0x26')]();});}};}function handleEntityNotFound(_0x123c71,_0x83117e){return function(_0x571ec5){if(!_0x571ec5){_0x123c71[_0x9eba('0x18')](0x194);}return _0x571ec5;};}function handleError(_0xbc0254,_0x64ff81){_0x64ff81=_0x64ff81||0x1f4;return function(_0x197729){logger[_0x9eba('0x27')](_0x197729[_0x9eba('0x28')]);if(_0x197729[_0x9eba('0x29')]){delete _0x197729['name'];}_0xbc0254['status'](_0x64ff81)[_0x9eba('0x2a')](_0x197729);};}exports[_0x9eba('0x2b')]=function(_0xa2d159,_0x1b1b75){var _0x1144e5={},_0x1b8839={},_0x228cb5={'count':0x0,'rows':[]};var _0x441a44=_['map'](db[_0x9eba('0x2c')]['rawAttributes'],function(_0x11e586){return{'name':_0x11e586[_0x9eba('0x2d')],'type':_0x11e586[_0x9eba('0x2e')][_0x9eba('0x2f')]};});_0x1b8839[_0x9eba('0x30')]=_['map'](_0x441a44,_0x9eba('0x29'));_0x1b8839[_0x9eba('0x31')]=_[_0x9eba('0x32')](_0xa2d159['query']);_0x1b8839['filters']=_[_0x9eba('0x33')](_0x1b8839['model'],_0x1b8839[_0x9eba('0x31')]);_0x1144e5[_0x9eba('0x34')]=_[_0x9eba('0x33')](_0x1b8839[_0x9eba('0x30')],qs[_0x9eba('0x35')](_0xa2d159[_0x9eba('0x31')]['fields']));_0x1144e5['attributes']=_0x1144e5['attributes'][_0x9eba('0x36')]?_0x1144e5[_0x9eba('0x34')]:_0x1b8839[_0x9eba('0x30')];if(!_0xa2d159[_0x9eba('0x31')][_0x9eba('0x37')](_0x9eba('0x38'))){_0x1144e5['limit']=qs[_0x9eba('0x1c')](_0xa2d159[_0x9eba('0x31')][_0x9eba('0x1c')]);_0x1144e5['offset']=qs['offset'](_0xa2d159[_0x9eba('0x31')][_0x9eba('0x1e')]);}_0x1144e5[_0x9eba('0x39')]=qs['sort'](_0xa2d159['query'][_0x9eba('0x3a')]);_0x1144e5[_0x9eba('0x3b')]=qs[_0x9eba('0x3c')](_[_0x9eba('0x3d')](_0xa2d159[_0x9eba('0x31')],_0x1b8839['filters']),_0x441a44);if(_0xa2d159[_0x9eba('0x31')][_0x9eba('0x3e')]){_0x1144e5[_0x9eba('0x3b')]=_[_0x9eba('0x3f')](_0x1144e5[_0x9eba('0x3b')],{'$or':_[_0x9eba('0x40')](_0x441a44,function(_0x4e9352){if(_0x4e9352[_0x9eba('0x2e')]!==_0x9eba('0x41')){var _0x4b522d={};_0x4b522d[_0x4e9352[_0x9eba('0x29')]]={'$like':'%'+_0xa2d159[_0x9eba('0x31')][_0x9eba('0x3e')]+'%'};return _0x4b522d;}})});}_0x1144e5=_[_0x9eba('0x3f')]({},_0x1144e5,_0xa2d159[_0x9eba('0x42')]);var _0x1d9af={'where':_0x1144e5['where']};return db[_0x9eba('0x2c')][_0x9eba('0x1d')](_0x1d9af)['then'](function(_0x12e6a2){_0x228cb5[_0x9eba('0x1d')]=_0x12e6a2;if(_0xa2d159[_0x9eba('0x31')][_0x9eba('0x43')]){_0x1144e5[_0x9eba('0x44')]=[{'all':!![]}];}return db[_0x9eba('0x2c')][_0x9eba('0x45')](_0x1144e5);})[_0x9eba('0x23')](function(_0x5ee98a){_0x228cb5[_0x9eba('0x46')]=_0x5ee98a;return _0x228cb5;})[_0x9eba('0x23')](respondWithFilteredResult(_0x1b1b75,_0x1144e5))[_0x9eba('0x47')](handleError(_0x1b1b75,null));};exports[_0x9eba('0x48')]=function(_0x23491f,_0x1d90f8){var _0x291690={'raw':!![],'where':{'id':_0x23491f[_0x9eba('0x49')]['id']}},_0x5105c5={};_0x5105c5[_0x9eba('0x30')]=_[_0x9eba('0x32')](db[_0x9eba('0x2c')]['rawAttributes']);_0x5105c5[_0x9eba('0x31')]=_[_0x9eba('0x32')](_0x23491f[_0x9eba('0x31')]);_0x5105c5[_0x9eba('0x3c')]=_[_0x9eba('0x33')](_0x5105c5[_0x9eba('0x30')],_0x5105c5[_0x9eba('0x31')]);_0x291690['attributes']=_[_0x9eba('0x33')](_0x5105c5[_0x9eba('0x30')],qs[_0x9eba('0x35')](_0x23491f[_0x9eba('0x31')][_0x9eba('0x35')]));_0x291690[_0x9eba('0x34')]=_0x291690[_0x9eba('0x34')][_0x9eba('0x36')]?_0x291690[_0x9eba('0x34')]:_0x5105c5[_0x9eba('0x30')];if(_0x23491f['query'][_0x9eba('0x43')]){_0x291690[_0x9eba('0x44')]=[{'all':!![]}];}_0x291690=_[_0x9eba('0x3f')]({},_0x291690,_0x23491f['options']);return db[_0x9eba('0x2c')]['find'](_0x291690)['then'](handleEntityNotFound(_0x1d90f8,null))[_0x9eba('0x23')](respondWithResult(_0x1d90f8,null))['catch'](handleError(_0x1d90f8,null));};exports['create']=function(_0x13483b,_0x18a48b){return db[_0x9eba('0x2c')][_0x9eba('0x4a')](_0x13483b[_0x9eba('0x4b')],{})[_0x9eba('0x23')](function(_0x189954){var _0x4b805a=_0x13483b['user'][_0x9eba('0x25')]({'plain':!![]});if(!_0x4b805a)throw new Error(_0x9eba('0x4c'));if(_0x4b805a[_0x9eba('0x4d')]===_0x9eba('0x4e')){var _0x56301b=_0x189954[_0x9eba('0x25')]({'plain':!![]});var _0x33763a=_0x9eba('0x4f');return db[_0x9eba('0x50')]['find']({'where':{'name':_0x33763a,'userProfileId':_0x4b805a[_0x9eba('0x51')]},'raw':!![]})[_0x9eba('0x23')](function(_0x281809){if(_0x281809&&_0x281809[_0x9eba('0x52')]===0x0){return db[_0x9eba('0x53')][_0x9eba('0x4a')]({'name':_0x56301b[_0x9eba('0x29')],'resourceId':_0x56301b['id'],'type':_0x281809[_0x9eba('0x29')],'sectionId':_0x281809['id']},{})[_0x9eba('0x23')](function(){return _0x189954;});}else{return _0x189954;}})['catch'](function(_0x317ff3){logger[_0x9eba('0x27')](_0x9eba('0x54'),_0x317ff3);throw _0x317ff3;});}return _0x189954;})[_0x9eba('0x23')](respondWithResult(_0x18a48b,0xc9))[_0x9eba('0x47')](handleError(_0x18a48b,null));};exports[_0x9eba('0x55')]=function(_0x5bf752,_0x1a3098){if(_0x5bf752['body']['id']){delete _0x5bf752['body']['id'];}return db[_0x9eba('0x2c')][_0x9eba('0x56')]({'where':{'id':_0x5bf752[_0x9eba('0x49')]['id']}})[_0x9eba('0x23')](handleEntityNotFound(_0x1a3098,null))[_0x9eba('0x23')](saveUpdates(_0x5bf752[_0x9eba('0x4b')],null))[_0x9eba('0x23')](respondWithResult(_0x1a3098,null))[_0x9eba('0x47')](handleError(_0x1a3098,null));};exports['destroy']=function(_0x4f0f2b,_0x3a073a){return db[_0x9eba('0x2c')]['find']({'where':{'id':_0x4f0f2b[_0x9eba('0x49')]['id']}})[_0x9eba('0x23')](handleEntityNotFound(_0x3a073a,null))['then'](removeEntity(_0x3a073a,null))[_0x9eba('0x47')](handleError(_0x3a073a,null));}; \ No newline at end of file +var _0xc609=['userProfileId','autoAssociation','error','params','eml-format','zip-dir','fast-json-patch','moment','mustache','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','reject','update','then','destroy','Pauses','UserProfileResource','sendStatus','stack','map','Pause','rawAttributes','fieldName','type','key','model','name','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get'];(function(_0x50f392,_0x1d8441){var _0x5926f2=function(_0x17df32){while(--_0x17df32){_0x50f392['push'](_0x50f392['shift']());}};_0x5926f2(++_0x1d8441);}(_0xc609,0x1ea));var _0x9c60=function(_0x16c4d0,_0x5cb02b){_0x16c4d0=_0x16c4d0-0x0;var _0x360bdd=_0xc609[_0x16c4d0];return _0x360bdd;};'use strict';var emlformat=require(_0x9c60('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9c60('0x1'));var jsonpatch=require(_0x9c60('0x2'));var rp=require('request-promise');var moment=require(_0x9c60('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x9c60('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x9c60('0x5'));var ejs=require(_0x9c60('0x6'));var fs=require('fs');var fs_extra=require(_0x9c60('0x7'));var _=require(_0x9c60('0x8'));var squel=require(_0x9c60('0x9'));var crypto=require(_0x9c60('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9c60('0x5'));var querystring=require(_0x9c60('0xb'));var Papa=require(_0x9c60('0xc'));var Redis=require(_0x9c60('0xd'));var authService=require(_0x9c60('0xe'));var qs=require(_0x9c60('0xf'));var as=require(_0x9c60('0x10'));var hardwareService=require(_0x9c60('0x11'));var logger=require(_0x9c60('0x12'))(_0x9c60('0x13'));var utils=require(_0x9c60('0x14'));var config=require(_0x9c60('0x15'));var licenseUtil=require(_0x9c60('0x16'));var db=require(_0x9c60('0x17'))['db'];function respondWithStatusCode(_0x20e92b,_0x487569){_0x487569=_0x487569||0xcc;return function(_0x2a1b2e){if(_0x2a1b2e){return _0x20e92b['sendStatus'](_0x487569);}return _0x20e92b['status'](_0x487569)[_0x9c60('0x18')]();};}function respondWithResult(_0xe2c493,_0x350b65){_0x350b65=_0x350b65||0xc8;return function(_0x23a03d){if(_0x23a03d){return _0xe2c493[_0x9c60('0x19')](_0x350b65)[_0x9c60('0x1a')](_0x23a03d);}};}function respondWithFilteredResult(_0x55a6ad,_0x1865cc){return function(_0x1c34c4){if(_0x1c34c4){var _0x2e8c0a=typeof _0x1865cc['offset']===_0x9c60('0x1b')&&typeof _0x1865cc[_0x9c60('0x1c')]==='undefined';var _0x41a902=_0x1c34c4['count'];var _0xa4b8e=_0x2e8c0a?0x0:_0x1865cc[_0x9c60('0x1d')];var _0x1915e3=_0x2e8c0a?_0x1c34c4[_0x9c60('0x1e')]:_0x1865cc['offset']+_0x1865cc[_0x9c60('0x1c')];var _0x285c10;if(_0x1915e3>=_0x41a902){_0x1915e3=_0x41a902;_0x285c10=0xc8;}else{_0x285c10=0xce;}_0x55a6ad[_0x9c60('0x19')](_0x285c10);return _0x55a6ad[_0x9c60('0x1f')](_0x9c60('0x20'),_0xa4b8e+'-'+_0x1915e3+'/'+_0x41a902)[_0x9c60('0x1a')](_0x1c34c4);}return null;};}function patchUpdates(_0x4382cf){return function(_0x445a27){try{jsonpatch[_0x9c60('0x21')](_0x445a27,_0x4382cf,!![]);}catch(_0x3b9553){return BPromise[_0x9c60('0x22')](_0x3b9553);}return _0x445a27['save']();};}function saveUpdates(_0x582082,_0x2b211a){return function(_0x260881){if(_0x260881){return _0x260881[_0x9c60('0x23')](_0x582082)[_0x9c60('0x24')](function(_0x2730a9){return _0x2730a9;});}return null;};}function removeEntity(_0x21057d,_0x444d2f){return function(_0x535512){if(_0x535512){return _0x535512[_0x9c60('0x25')]()[_0x9c60('0x24')](function(){var _0x239283=_0x535512['get']({'plain':!![]});var _0xd63597=_0x9c60('0x26');return db[_0x9c60('0x27')][_0x9c60('0x25')]({'where':{'type':_0xd63597,'resourceId':_0x239283['id']}})[_0x9c60('0x24')](function(){return _0x535512;});})[_0x9c60('0x24')](function(){_0x21057d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x59f932,_0x2a44bc){return function(_0x53d8a2){if(!_0x53d8a2){_0x59f932[_0x9c60('0x28')](0x194);}return _0x53d8a2;};}function handleError(_0x557b34,_0x4ba606){_0x4ba606=_0x4ba606||0x1f4;return function(_0x4d4f26){logger['error'](_0x4d4f26[_0x9c60('0x29')]);if(_0x4d4f26['name']){delete _0x4d4f26['name'];}_0x557b34[_0x9c60('0x19')](_0x4ba606)['send'](_0x4d4f26);};}exports['index']=function(_0x518c05,_0x47a941){var _0x16d0c6={},_0x11a0ae={},_0x28dd69={'count':0x0,'rows':[]};var _0x178bca=_[_0x9c60('0x2a')](db[_0x9c60('0x2b')][_0x9c60('0x2c')],function(_0x3dcb00){return{'name':_0x3dcb00[_0x9c60('0x2d')],'type':_0x3dcb00[_0x9c60('0x2e')][_0x9c60('0x2f')]};});_0x11a0ae[_0x9c60('0x30')]=_['map'](_0x178bca,_0x9c60('0x31'));_0x11a0ae['query']=_['keys'](_0x518c05[_0x9c60('0x32')]);_0x11a0ae['filters']=_[_0x9c60('0x33')](_0x11a0ae[_0x9c60('0x30')],_0x11a0ae[_0x9c60('0x32')]);_0x16d0c6[_0x9c60('0x34')]=_[_0x9c60('0x33')](_0x11a0ae[_0x9c60('0x30')],qs[_0x9c60('0x35')](_0x518c05[_0x9c60('0x32')][_0x9c60('0x35')]));_0x16d0c6[_0x9c60('0x34')]=_0x16d0c6[_0x9c60('0x34')][_0x9c60('0x36')]?_0x16d0c6[_0x9c60('0x34')]:_0x11a0ae[_0x9c60('0x30')];if(!_0x518c05[_0x9c60('0x32')][_0x9c60('0x37')](_0x9c60('0x38'))){_0x16d0c6[_0x9c60('0x1c')]=qs['limit'](_0x518c05[_0x9c60('0x32')][_0x9c60('0x1c')]);_0x16d0c6[_0x9c60('0x1d')]=qs[_0x9c60('0x1d')](_0x518c05[_0x9c60('0x32')][_0x9c60('0x1d')]);}_0x16d0c6['order']=qs[_0x9c60('0x39')](_0x518c05[_0x9c60('0x32')][_0x9c60('0x39')]);_0x16d0c6[_0x9c60('0x3a')]=qs['filters'](_['pick'](_0x518c05[_0x9c60('0x32')],_0x11a0ae[_0x9c60('0x3b')]),_0x178bca);if(_0x518c05[_0x9c60('0x32')][_0x9c60('0x3c')]){_0x16d0c6[_0x9c60('0x3a')]=_[_0x9c60('0x3d')](_0x16d0c6[_0x9c60('0x3a')],{'$or':_['map'](_0x178bca,function(_0x4814e5){if(_0x4814e5[_0x9c60('0x2e')]!==_0x9c60('0x3e')){var _0x5dc482={};_0x5dc482[_0x4814e5[_0x9c60('0x31')]]={'$like':'%'+_0x518c05[_0x9c60('0x32')]['filter']+'%'};return _0x5dc482;}})});}_0x16d0c6=_[_0x9c60('0x3d')]({},_0x16d0c6,_0x518c05[_0x9c60('0x3f')]);var _0x20bd39={'where':_0x16d0c6[_0x9c60('0x3a')]};return db[_0x9c60('0x2b')][_0x9c60('0x1e')](_0x20bd39)[_0x9c60('0x24')](function(_0x17a523){_0x28dd69[_0x9c60('0x1e')]=_0x17a523;if(_0x518c05[_0x9c60('0x32')][_0x9c60('0x40')]){_0x16d0c6[_0x9c60('0x41')]=[{'all':!![]}];}return db[_0x9c60('0x2b')][_0x9c60('0x42')](_0x16d0c6);})[_0x9c60('0x24')](function(_0x13f264){_0x28dd69['rows']=_0x13f264;return _0x28dd69;})['then'](respondWithFilteredResult(_0x47a941,_0x16d0c6))[_0x9c60('0x43')](handleError(_0x47a941,null));};exports[_0x9c60('0x44')]=function(_0x32ad6b,_0x80de9d){var _0x53da0f={'raw':!![],'where':{'id':_0x32ad6b['params']['id']}},_0x230bcc={};_0x230bcc[_0x9c60('0x30')]=_[_0x9c60('0x45')](db[_0x9c60('0x2b')]['rawAttributes']);_0x230bcc['query']=_[_0x9c60('0x45')](_0x32ad6b[_0x9c60('0x32')]);_0x230bcc[_0x9c60('0x3b')]=_[_0x9c60('0x33')](_0x230bcc['model'],_0x230bcc[_0x9c60('0x32')]);_0x53da0f['attributes']=_[_0x9c60('0x33')](_0x230bcc[_0x9c60('0x30')],qs['fields'](_0x32ad6b['query'][_0x9c60('0x35')]));_0x53da0f[_0x9c60('0x34')]=_0x53da0f[_0x9c60('0x34')][_0x9c60('0x36')]?_0x53da0f['attributes']:_0x230bcc[_0x9c60('0x30')];if(_0x32ad6b[_0x9c60('0x32')][_0x9c60('0x40')]){_0x53da0f[_0x9c60('0x41')]=[{'all':!![]}];}_0x53da0f=_[_0x9c60('0x3d')]({},_0x53da0f,_0x32ad6b['options']);return db['Pause'][_0x9c60('0x46')](_0x53da0f)[_0x9c60('0x24')](handleEntityNotFound(_0x80de9d,null))[_0x9c60('0x24')](respondWithResult(_0x80de9d,null))['catch'](handleError(_0x80de9d,null));};exports[_0x9c60('0x47')]=function(_0x14473c,_0x34a8fb){return db[_0x9c60('0x2b')]['create'](_0x14473c[_0x9c60('0x48')],{})[_0x9c60('0x24')](function(_0x47fc41){var _0x36a973=_0x14473c[_0x9c60('0x49')]['get']({'plain':!![]});if(!_0x36a973)throw new Error(_0x9c60('0x4a'));if(_0x36a973[_0x9c60('0x4b')]==='user'){var _0x130ecf=_0x47fc41[_0x9c60('0x4c')]({'plain':!![]});var _0x342bec=_0x9c60('0x26');return db['UserProfileSection'][_0x9c60('0x46')]({'where':{'name':_0x342bec,'userProfileId':_0x36a973[_0x9c60('0x4d')]},'raw':!![]})[_0x9c60('0x24')](function(_0x41bb){if(_0x41bb&&_0x41bb[_0x9c60('0x4e')]===0x0){return db[_0x9c60('0x27')][_0x9c60('0x47')]({'name':_0x130ecf[_0x9c60('0x31')],'resourceId':_0x130ecf['id'],'type':_0x41bb[_0x9c60('0x31')],'sectionId':_0x41bb['id']},{})[_0x9c60('0x24')](function(){return _0x47fc41;});}else{return _0x47fc41;}})['catch'](function(_0x259f0d){logger[_0x9c60('0x4f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x259f0d);throw _0x259f0d;});}return _0x47fc41;})[_0x9c60('0x24')](respondWithResult(_0x34a8fb,0xc9))[_0x9c60('0x43')](handleError(_0x34a8fb,null));};exports[_0x9c60('0x23')]=function(_0x4fe347,_0x1b6976){if(_0x4fe347[_0x9c60('0x48')]['id']){delete _0x4fe347[_0x9c60('0x48')]['id'];}return db[_0x9c60('0x2b')][_0x9c60('0x46')]({'where':{'id':_0x4fe347[_0x9c60('0x50')]['id']}})['then'](handleEntityNotFound(_0x1b6976,null))[_0x9c60('0x24')](saveUpdates(_0x4fe347['body'],null))['then'](respondWithResult(_0x1b6976,null))[_0x9c60('0x43')](handleError(_0x1b6976,null));};exports[_0x9c60('0x25')]=function(_0x3f08be,_0x897f8e){return db['Pause']['find']({'where':{'id':_0x3f08be['params']['id']}})[_0x9c60('0x24')](handleEntityNotFound(_0x897f8e,null))[_0x9c60('0x24')](removeEntity(_0x897f8e,null))[_0x9c60('0x43')](handleError(_0x897f8e,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 57ed838..7280eed 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 _0x8ef6=['exports','define','Pause','tools_pauses','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./pause.attributes'];(function(_0x4f297b,_0x19fd91){var _0x5c19f8=function(_0x47f50f){while(--_0x47f50f){_0x4f297b['push'](_0x4f297b['shift']());}};_0x5c19f8(++_0x19fd91);}(_0x8ef6,0xf2));var _0x68ef=function(_0x22807d,_0x18cd06){_0x22807d=_0x22807d-0x0;var _0x172879=_0x8ef6[_0x22807d];return _0x172879;};'use strict';var _=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var logger=require(_0x68ef('0x2'))(_0x68ef('0x3'));var moment=require(_0x68ef('0x4'));var BPromise=require(_0x68ef('0x5'));var rp=require(_0x68ef('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x68ef('0x7'));var config=require(_0x68ef('0x8'));var attributes=require(_0x68ef('0x9'));module[_0x68ef('0xa')]=function(_0x4d26e3,_0x4f77f3){return _0x4d26e3[_0x68ef('0xb')](_0x68ef('0xc'),attributes,{'tableName':_0x68ef('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf494=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./pause.attributes','exports','define','lodash','util'];(function(_0x500781,_0x28d318){var _0x4458df=function(_0xf19b3f){while(--_0xf19b3f){_0x500781['push'](_0x500781['shift']());}};_0x4458df(++_0x28d318);}(_0xf494,0x1c6));var _0x4f49=function(_0x3cb080,_0x13d62a){_0x3cb080=_0x3cb080-0x0;var _0x597c35=_0xf494[_0x3cb080];return _0x597c35;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var logger=require(_0x4f49('0x2'))('api');var moment=require(_0x4f49('0x3'));var BPromise=require(_0x4f49('0x4'));var rp=require(_0x4f49('0x5'));var fs=require('fs');var path=require(_0x4f49('0x6'));var rimraf=require(_0x4f49('0x7'));var config=require(_0x4f49('0x8'));var attributes=require(_0x4f49('0x9'));module[_0x4f49('0xa')]=function(_0xc5e778,_0x413530){return _0xc5e778[_0x4f49('0xb')]('Pause',attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/pause/pause.rpc.js b/server/api/pause/pause.rpc.js index 6989850..d3dbe78 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 _0x7a54=['message','request\x20sent','result','catch','Pause','find','options','raw','where','attributes','map','include','model','ShowPause','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Pause,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x32d905,_0x454760){var _0x20e985=function(_0x4466f3){while(--_0x4466f3){_0x32d905['push'](_0x32d905['shift']());}};_0x20e985(++_0x454760);}(_0x7a54,0x106));var _0x47a5=function(_0x531d3e,_0x509e13){_0x531d3e=_0x531d3e-0x0;var _0x2d8d32=_0x7a54[_0x531d3e];return _0x2d8d32;};'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')]('Pause,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['ShowPause']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'raw':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x18')]===undefined?!![]:![]:!![],'where':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x19')]||null:null,'attributes':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x1a')]||null:null,'include':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')]['include']?_[_0x47a5('0x1b')](_0x5247fd[_0x47a5('0x17')][_0x47a5('0x1c')],function(_0x7a9f9e){return{'model':db[_0x7a9f9e['model']],'as':_0x7a9f9e['as'],'attributes':_0x7a9f9e[_0x47a5('0x1a')],'include':_0x7a9f9e[_0x47a5('0x1c')]?_['map'](_0x7a9f9e[_0x47a5('0x1c')],function(_0xc4cd63){return{'model':db[_0xc4cd63[_0x47a5('0x1d')]],'as':_0xc4cd63['as'],'attributes':_0xc4cd63[_0x47a5('0x1a')],'include':_0xc4cd63[_0x47a5('0x1c')]?_['map'](_0xc4cd63['include'],function(_0x136745){return{'model':db[_0x136745['model']],'as':_0x136745['as'],'attributes':_0x136745[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23cb77){logger[_0x47a5('0xb')](_0x47a5('0x1e'),_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON[_0x47a5('0xe')](_0x23cb77));_0xaf70a6(_0x23cb77);})[_0x47a5('0x14')](function(_0x136b14){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0x136b14[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81[_0x47a5('0xf')](0x1f4,_0x136b14[_0x47a5('0x11')]));});});}; \ No newline at end of file +var _0x7a54=['message','request\x20sent','result','catch','Pause','find','options','raw','where','attributes','map','include','model','ShowPause','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Pause,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x2f4899,_0x2083d7){var _0x8c7341=function(_0x4d7585){while(--_0x4d7585){_0x2f4899['push'](_0x2f4899['shift']());}};_0x8c7341(++_0x2083d7);}(_0x7a54,0x106));var _0x47a5=function(_0x253f0b,_0x518384){_0x253f0b=_0x253f0b-0x0;var _0x41d77f=_0x7a54[_0x253f0b];return _0x41d77f;};'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')]('Pause,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['ShowPause']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'raw':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x18')]===undefined?!![]:![]:!![],'where':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x19')]||null:null,'attributes':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x1a')]||null:null,'include':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')]['include']?_[_0x47a5('0x1b')](_0x5247fd[_0x47a5('0x17')][_0x47a5('0x1c')],function(_0x7a9f9e){return{'model':db[_0x7a9f9e['model']],'as':_0x7a9f9e['as'],'attributes':_0x7a9f9e[_0x47a5('0x1a')],'include':_0x7a9f9e[_0x47a5('0x1c')]?_['map'](_0x7a9f9e[_0x47a5('0x1c')],function(_0xc4cd63){return{'model':db[_0xc4cd63[_0x47a5('0x1d')]],'as':_0xc4cd63['as'],'attributes':_0xc4cd63[_0x47a5('0x1a')],'include':_0xc4cd63[_0x47a5('0x1c')]?_['map'](_0xc4cd63['include'],function(_0x136745){return{'model':db[_0x136745['model']],'as':_0x136745['as'],'attributes':_0x136745[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23cb77){logger[_0x47a5('0xb')](_0x47a5('0x1e'),_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON[_0x47a5('0xe')](_0x23cb77));_0xaf70a6(_0x23cb77);})[_0x47a5('0x14')](function(_0x136b14){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0x136b14[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81[_0x47a5('0xf')](0x1f4,_0x136b14[_0x47a5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index 78734ad..0706318 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 _0xd13e=['multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./plugin.controller','get','/webhook','webhookGet','/:id','isAuthenticated','show','/:id/download','download','diskStorage','root','server/files/plugins','originalname','replace','%s-%s%s','extname','post','single','file','upload','webhookPost','put','update','delete'];(function(_0x543084,_0x4337f5){var _0x306a57=function(_0x2769ed){while(--_0x2769ed){_0x543084['push'](_0x543084['shift']());}};_0x306a57(++_0x4337f5);}(_0xd13e,0x193));var _0xed13=function(_0x147a92,_0x5559c4){_0x147a92=_0x147a92-0x0;var _0x255b64=_0xd13e[_0x147a92];return _0x255b64;};'use strict';var multer=require(_0xed13('0x0'));var util=require(_0xed13('0x1'));var path=require(_0xed13('0x2'));var timeout=require(_0xed13('0x3'));var express=require('express');var router=express[_0xed13('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xed13('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xed13('0x6'));var controller=require(_0xed13('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xed13('0x8')](_0xed13('0x9'),controller[_0xed13('0xa')]);router[_0xed13('0x8')](_0xed13('0xb'),auth[_0xed13('0xc')](),controller[_0xed13('0xd')]);router[_0xed13('0x8')](_0xed13('0xe'),auth['isAuthenticated'](),controller[_0xed13('0xf')]);var upload=multer({'storage':multer[_0xed13('0x10')]({'destination':function(_0x11adaf,_0x39575c,_0x2b290c){_0x2b290c(null,path['join'](config[_0xed13('0x11')],_0xed13('0x12')));},'filename':function(_0x2c68db,_0x3c0b22,_0x936103){_0x3c0b22[_0xed13('0x13')]=_0x3c0b22['originalname'][_0xed13('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x936103(null,util['format'](_0xed13('0x15'),path['basename'](_0x3c0b22[_0xed13('0x13')],path['extname'](_0x3c0b22[_0xed13('0x13')])),Date['now'](),path[_0xed13('0x16')](_0x3c0b22[_0xed13('0x13')])));}})});router[_0xed13('0x17')]('/',upload[_0xed13('0x18')](_0xed13('0x19')),controller[_0xed13('0x1a')]);router[_0xed13('0x17')](_0xed13('0x9'),controller[_0xed13('0x1b')]);router[_0xed13('0x1c')](_0xed13('0xb'),auth[_0xed13('0xc')](),controller[_0xed13('0x1d')]);router[_0xed13('0x1e')](_0xed13('0xb'),auth[_0xed13('0xc')](),controller['delete']);module['exports']=router; \ No newline at end of file +var _0x6aa7=['isAuthenticated','get','/webhook','webhookGet','/:id','show','/:id/download','download','diskStorage','join','root','server/files/plugins','originalname','replace','format','%s-%s%s','extname','now','post','file','webhookPost','put','delete','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x5a9782,_0x19e573){var _0x9ea8b9=function(_0x4fa80d){while(--_0x4fa80d){_0x5a9782['push'](_0x5a9782['shift']());}};_0x9ea8b9(++_0x19e573);}(_0x6aa7,0x178));var _0x76aa=function(_0x11aaac,_0x4b9083){_0x11aaac=_0x11aaac-0x0;var _0xe2a384=_0x6aa7[_0x11aaac];return _0xe2a384;};'use strict';var multer=require(_0x76aa('0x0'));var util=require('util');var path=require(_0x76aa('0x1'));var timeout=require(_0x76aa('0x2'));var express=require(_0x76aa('0x3'));var router=express[_0x76aa('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x76aa('0x5'));var interaction=require(_0x76aa('0x6'));var config=require(_0x76aa('0x7'));var controller=require('./plugin.controller');router['get']('/',auth[_0x76aa('0x8')](),controller['index']);router[_0x76aa('0x9')](_0x76aa('0xa'),controller[_0x76aa('0xb')]);router['get'](_0x76aa('0xc'),auth[_0x76aa('0x8')](),controller[_0x76aa('0xd')]);router['get'](_0x76aa('0xe'),auth[_0x76aa('0x8')](),controller[_0x76aa('0xf')]);var upload=multer({'storage':multer[_0x76aa('0x10')]({'destination':function(_0x37f1ab,_0x128435,_0x2c5075){_0x2c5075(null,path[_0x76aa('0x11')](config[_0x76aa('0x12')],_0x76aa('0x13')));},'filename':function(_0x5e5f47,_0x112c39,_0x5df49c){_0x112c39[_0x76aa('0x14')]=_0x112c39[_0x76aa('0x14')][_0x76aa('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x5df49c(null,util[_0x76aa('0x16')](_0x76aa('0x17'),path['basename'](_0x112c39['originalname'],path[_0x76aa('0x18')](_0x112c39['originalname'])),Date[_0x76aa('0x19')](),path[_0x76aa('0x18')](_0x112c39['originalname'])));}})});router[_0x76aa('0x1a')]('/',upload['single'](_0x76aa('0x1b')),controller['upload']);router[_0x76aa('0x1a')](_0x76aa('0xa'),controller[_0x76aa('0x1c')]);router[_0x76aa('0x1d')](_0x76aa('0xc'),auth[_0x76aa('0x8')](),controller['update']);router['delete'](_0x76aa('0xc'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x1e')]);module[_0x76aa('0x1f')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index 1358394..56b7900 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 _0x4a55=['TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING','ENUM'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x4a55,0x104));var _0x54a5=function(_0x50007c,_0x1cbf11){_0x50007c=_0x50007c-0x0;var _0x5c1ec7=_0x4a55[_0x50007c];return _0x5c1ec7;};'use strict';var Sequelize=require(_0x54a5('0x0'));module[_0x54a5('0x1')]={'name':{'type':Sequelize[_0x54a5('0x2')]},'type':{'type':Sequelize[_0x54a5('0x3')]('html','script')},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize[_0x54a5('0x4')]},'path':{'type':Sequelize[_0x54a5('0x2')],'comment':_0x54a5('0x5')},'active':{'type':Sequelize[_0x54a5('0x6')],'defaultValue':0x0,'comment':_0x54a5('0x7')},'sidebar':{'type':Sequelize[_0x54a5('0x3')](_0x54a5('0x8'),_0x54a5('0x9'),'always',_0x54a5('0xa')),'defaultValue':'always','comment':_0x54a5('0xb')},'icon':{'type':Sequelize[_0x54a5('0x2')]},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize[_0x54a5('0x2')]},'scriptPath':{'type':Sequelize[_0x54a5('0x2')]}}; \ No newline at end of file +var _0xb511=['BOOLEAN','ENUM','adminOnly','agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','STRING','html','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'];(function(_0x49192,_0x2fc6fb){var _0x57d8e8=function(_0xc4ed8d){while(--_0xc4ed8d){_0x49192['push'](_0x49192['shift']());}};_0x57d8e8(++_0x2fc6fb);}(_0xb511,0x166));var _0x1b51=function(_0x519eca,_0x3cced2){_0x519eca=_0x519eca-0x0;var _0xb82e4c=_0xb511[_0x519eca];return _0xb82e4c;};'use strict';var Sequelize=require(_0x1b51('0x0'));module['exports']={'name':{'type':Sequelize[_0x1b51('0x1')]},'type':{'type':Sequelize['ENUM'](_0x1b51('0x2'),_0x1b51('0x3'))},'description':{'type':Sequelize[_0x1b51('0x4')]},'version':{'type':Sequelize[_0x1b51('0x4')]},'path':{'type':Sequelize['STRING'],'comment':_0x1b51('0x5')},'active':{'type':Sequelize[_0x1b51('0x6')],'defaultValue':0x0,'comment':'Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'},'sidebar':{'type':Sequelize[_0x1b51('0x7')](_0x1b51('0x8'),_0x1b51('0x9'),_0x1b51('0xa'),_0x1b51('0xb')),'defaultValue':'always','comment':_0x1b51('0xc')},'icon':{'type':Sequelize[_0x1b51('0x1')]},'adminUrl':{'type':Sequelize[_0x1b51('0x1')]},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize[_0x1b51('0x1')]},'scriptPath':{'type':Sequelize[_0x1b51('0x1')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index 55d4f24..82dfb4d 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 _0xc3bd=['%s%s','headers','content-length','content-type','endsWith','statusCode','webhookPost','\x27PORT\x27\x20parameter\x20not\x20specified','method','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','extract-zip','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./plugin.socket','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','get','Plugins','UserProfileResource','end','error','stack','name','send','Plugin','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','merge','options','findAll','catch','show','params','includeAll','include','find','download','join','server/files/plugins','format','%s.zip','basename','zip','warning','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','glob','**/*','root','node_modules/**/*','attachments/**/*','close','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Temporary\x20file\x20removed','upload','file','filename','extname','Plugin\x20upload\x20destination:\x20%s','0777','Invalid\x20plugin\x20structure','lstatSync','isDirectory','readdirSync','some','manifest.json','readFileSync','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','Invalid\x20manifest:\x20views\x20missing','views','admin','Invalid\x20manifest:\x20no\x20view\x20specified','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','agent','script','scriptName','create','role','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','dirname','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','hostname','http://localhost:','encoding'];(function(_0x14fdbb,_0x29144e){var _0x14c4ee=function(_0x43eb39){while(--_0x43eb39){_0x14fdbb['push'](_0x14fdbb['shift']());}};_0x14c4ee(++_0x29144e);}(_0xc3bd,0x15d));var _0xdc3b=function(_0x46b5d4,_0x3ceeca){_0x46b5d4=_0x46b5d4-0x0;var _0x1b7fb0=_0xc3bd[_0x46b5d4];return _0x1b7fb0;};'use strict';var emlformat=require(_0xdc3b('0x0'));var rimraf=require(_0xdc3b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdc3b('0x2'));var rp=require(_0xdc3b('0x3'));var moment=require(_0xdc3b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xdc3b('0x5'));var util=require('util');var path=require(_0xdc3b('0x6'));var sox=require(_0xdc3b('0x7'));var csv=require(_0xdc3b('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdc3b('0x9'));var _=require(_0xdc3b('0xa'));var squel=require(_0xdc3b('0xb'));var crypto=require(_0xdc3b('0xc'));var jsforce=require(_0xdc3b('0xd'));var deskjs=require(_0xdc3b('0xe'));var toCsv=require(_0xdc3b('0x8'));var querystring=require(_0xdc3b('0xf'));var Papa=require(_0xdc3b('0x10'));var extract=require(_0xdc3b('0x11'));var rimraf=require(_0xdc3b('0x1'));var archiver=require(_0xdc3b('0x12'));var Redis=require(_0xdc3b('0x13'));var authService=require(_0xdc3b('0x14'));var qs=require(_0xdc3b('0x15'));var as=require(_0xdc3b('0x16'));var hardwareService=require(_0xdc3b('0x17'));var logger=require(_0xdc3b('0x18'))(_0xdc3b('0x19'));var utils=require(_0xdc3b('0x1a'));var config=require(_0xdc3b('0x1b'));var licenseUtil=require(_0xdc3b('0x1c'));var db=require(_0xdc3b('0x1d'))['db'];config[_0xdc3b('0x1e')]=_[_0xdc3b('0x1f')](config[_0xdc3b('0x1e')],{'host':_0xdc3b('0x20'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xdc3b('0x1e')]));require(_0xdc3b('0x21'))['register'](socket);function respondWithStatusCode(_0x5de0d7,_0x26e818){_0x26e818=_0x26e818||0xcc;return function(_0x10dabb){if(_0x10dabb){return _0x5de0d7[_0xdc3b('0x22')](_0x26e818);}return _0x5de0d7[_0xdc3b('0x23')](_0x26e818)['end']();};}function respondWithResult(_0x2f0dbb,_0x25319b){_0x25319b=_0x25319b||0xc8;return function(_0x2064f7){if(_0x2064f7){return _0x2f0dbb[_0xdc3b('0x23')](_0x25319b)[_0xdc3b('0x24')](_0x2064f7);}};}function respondWithFilteredResult(_0x366fc8,_0x25e9f8){return function(_0x2a1744){if(_0x2a1744){var _0x1b8765=typeof _0x25e9f8[_0xdc3b('0x25')]===_0xdc3b('0x26')&&typeof _0x25e9f8[_0xdc3b('0x27')]==='undefined';var _0xae2bf4=_0x2a1744['count'];var _0x232fea=_0x1b8765?0x0:_0x25e9f8[_0xdc3b('0x25')];var _0x316c7c=_0x1b8765?_0x2a1744[_0xdc3b('0x28')]:_0x25e9f8[_0xdc3b('0x25')]+_0x25e9f8['limit'];var _0x229cfb;if(_0x316c7c>=_0xae2bf4){_0x316c7c=_0xae2bf4;_0x229cfb=0xc8;}else{_0x229cfb=0xce;}_0x366fc8['status'](_0x229cfb);return _0x366fc8[_0xdc3b('0x29')](_0xdc3b('0x2a'),_0x232fea+'-'+_0x316c7c+'/'+_0xae2bf4)[_0xdc3b('0x24')](_0x2a1744);}return null;};}function patchUpdates(_0x335fe1){return function(_0x499afa){try{jsonpatch['apply'](_0x499afa,_0x335fe1,!![]);}catch(_0x2c3a1f){return BPromise['reject'](_0x2c3a1f);}return _0x499afa[_0xdc3b('0x2b')]();};}function saveUpdates(_0x4bb506,_0x4265b5){return function(_0x2c0c3e){if(_0x2c0c3e){return _0x2c0c3e[_0xdc3b('0x2c')](_0x4bb506)[_0xdc3b('0x2d')](function(_0x1a1896){return _0x1a1896;});}return null;};}function removeEntity(_0x1b8ed0,_0x51d646){return function(_0x7bdf66){if(_0x7bdf66){return _0x7bdf66[_0xdc3b('0x2e')]()['then'](function(){var _0x312610=_0x7bdf66[_0xdc3b('0x2f')]({'plain':!![]});var _0x30d3e1=_0xdc3b('0x30');return db[_0xdc3b('0x31')]['destroy']({'where':{'type':_0x30d3e1,'resourceId':_0x312610['id']}})[_0xdc3b('0x2d')](function(){return _0x7bdf66;});})[_0xdc3b('0x2d')](function(){_0x1b8ed0[_0xdc3b('0x23')](0xcc)[_0xdc3b('0x32')]();});}};}function handleEntityNotFound(_0x207ced,_0x4aea13){return function(_0x376278){if(!_0x376278){_0x207ced[_0xdc3b('0x22')](0x194);}return _0x376278;};}function handleError(_0x4c4ca2,_0x4f71cf){_0x4f71cf=_0x4f71cf||0x1f4;return function(_0x1d542a){logger[_0xdc3b('0x33')](_0x1d542a[_0xdc3b('0x34')]);if(_0x1d542a['name']){delete _0x1d542a[_0xdc3b('0x35')];}_0x4c4ca2[_0xdc3b('0x23')](_0x4f71cf)[_0xdc3b('0x36')](_0x1d542a);};}exports['index']=function(_0x56e154,_0x3cb997){var _0x297d18={},_0xdff013={},_0x46eb44={'count':0x0,'rows':[]};var _0x177be4=_['map'](db[_0xdc3b('0x37')][_0xdc3b('0x38')],function(_0x12b9b9){return{'name':_0x12b9b9[_0xdc3b('0x39')],'type':_0x12b9b9[_0xdc3b('0x3a')][_0xdc3b('0x3b')]};});_0xdff013[_0xdc3b('0x3c')]=_[_0xdc3b('0x3d')](_0x177be4,_0xdc3b('0x35'));_0xdff013[_0xdc3b('0x3e')]=_[_0xdc3b('0x3f')](_0x56e154['query']);_0xdff013['filters']=_[_0xdc3b('0x40')](_0xdff013['model'],_0xdff013[_0xdc3b('0x3e')]);_0x297d18[_0xdc3b('0x41')]=_[_0xdc3b('0x40')](_0xdff013[_0xdc3b('0x3c')],qs[_0xdc3b('0x42')](_0x56e154[_0xdc3b('0x3e')][_0xdc3b('0x42')]));_0x297d18[_0xdc3b('0x41')]=_0x297d18[_0xdc3b('0x41')][_0xdc3b('0x43')]?_0x297d18[_0xdc3b('0x41')]:_0xdff013['model'];if(!_0x56e154['query'][_0xdc3b('0x44')](_0xdc3b('0x45'))){_0x297d18[_0xdc3b('0x27')]=qs[_0xdc3b('0x27')](_0x56e154[_0xdc3b('0x3e')]['limit']);_0x297d18[_0xdc3b('0x25')]=qs['offset'](_0x56e154[_0xdc3b('0x3e')][_0xdc3b('0x25')]);}_0x297d18['order']=qs[_0xdc3b('0x46')](_0x56e154[_0xdc3b('0x3e')][_0xdc3b('0x46')]);_0x297d18[_0xdc3b('0x47')]=qs[_0xdc3b('0x48')](_['pick'](_0x56e154[_0xdc3b('0x3e')],_0xdff013['filters']),_0x177be4);if(_0x56e154[_0xdc3b('0x3e')]['filter']){_0x297d18[_0xdc3b('0x47')]=_[_0xdc3b('0x49')](_0x297d18[_0xdc3b('0x47')],{'$or':_[_0xdc3b('0x3d')](_0x177be4,function(_0x1c9c74){if(_0x1c9c74['type']!=='VIRTUAL'){var _0x342b11={};_0x342b11[_0x1c9c74[_0xdc3b('0x35')]]={'$like':'%'+_0x56e154[_0xdc3b('0x3e')]['filter']+'%'};return _0x342b11;}})});}_0x297d18=_[_0xdc3b('0x49')]({},_0x297d18,_0x56e154[_0xdc3b('0x4a')]);var _0x27b129={'where':_0x297d18[_0xdc3b('0x47')]};return db[_0xdc3b('0x37')][_0xdc3b('0x28')](_0x27b129)[_0xdc3b('0x2d')](function(_0x45876e){_0x46eb44[_0xdc3b('0x28')]=_0x45876e;if(_0x56e154[_0xdc3b('0x3e')]['includeAll']){_0x297d18['include']=[{'all':!![]}];}return db['Plugin'][_0xdc3b('0x4b')](_0x297d18);})[_0xdc3b('0x2d')](function(_0x2b90b6){_0x46eb44['rows']=_0x2b90b6;return _0x46eb44;})['then'](respondWithFilteredResult(_0x3cb997,_0x297d18))[_0xdc3b('0x4c')](handleError(_0x3cb997,null));};exports[_0xdc3b('0x4d')]=function(_0x18ed90,_0x220baa){var _0x31503c={'raw':!![],'where':{'id':_0x18ed90[_0xdc3b('0x4e')]['id']}},_0xdf2a92={};_0xdf2a92[_0xdc3b('0x3c')]=_['keys'](db[_0xdc3b('0x37')][_0xdc3b('0x38')]);_0xdf2a92[_0xdc3b('0x3e')]=_[_0xdc3b('0x3f')](_0x18ed90[_0xdc3b('0x3e')]);_0xdf2a92[_0xdc3b('0x48')]=_[_0xdc3b('0x40')](_0xdf2a92[_0xdc3b('0x3c')],_0xdf2a92[_0xdc3b('0x3e')]);_0x31503c['attributes']=_['intersection'](_0xdf2a92[_0xdc3b('0x3c')],qs[_0xdc3b('0x42')](_0x18ed90[_0xdc3b('0x3e')][_0xdc3b('0x42')]));_0x31503c[_0xdc3b('0x41')]=_0x31503c[_0xdc3b('0x41')][_0xdc3b('0x43')]?_0x31503c[_0xdc3b('0x41')]:_0xdf2a92[_0xdc3b('0x3c')];if(_0x18ed90[_0xdc3b('0x3e')][_0xdc3b('0x4f')]){_0x31503c[_0xdc3b('0x50')]=[{'all':!![]}];}_0x31503c=_[_0xdc3b('0x49')]({},_0x31503c,_0x18ed90[_0xdc3b('0x4a')]);return db[_0xdc3b('0x37')][_0xdc3b('0x51')](_0x31503c)[_0xdc3b('0x2d')](handleEntityNotFound(_0x220baa,null))['then'](respondWithResult(_0x220baa,null))[_0xdc3b('0x4c')](handleError(_0x220baa,null));};exports[_0xdc3b('0x52')]=function(_0x37d7d1,_0x404b0c,_0x5adfa4){return db[_0xdc3b('0x37')][_0xdc3b('0x51')]({'where':{'id':_0x37d7d1[_0xdc3b('0x4e')]['id']},'attributes':[_0xdc3b('0x35'),_0xdc3b('0x6')],'raw':!![]})[_0xdc3b('0x2d')](handleEntityNotFound(_0x404b0c,null))['then'](function(_0x48a53a){if(_0x48a53a){var _0x3c4275=path[_0xdc3b('0x53')](config['root'],_0xdc3b('0x54'),util[_0xdc3b('0x55')](_0xdc3b('0x56'),path[_0xdc3b('0x57')](_0x48a53a['path'])));var _0x54be03=fs['createWriteStream'](_0x3c4275);var _0x4a5d8b=archiver(_0xdc3b('0x58'),{'zlib':{'level':0x9}});_0x4a5d8b['on'](_0xdc3b('0x59'),function(_0x1a6b24){if(_0x1a6b24[_0xdc3b('0x5a')]===_0xdc3b('0x5b')){logger[_0xdc3b('0x33')](_0x1a6b24);}else{throw new db[(_0xdc3b('0x5c'))][(_0xdc3b('0x5d'))](_0xdc3b('0x5e'));}});_0x4a5d8b['on'](_0xdc3b('0x33'),function(_0x40bfa6){throw new db['Sequelize'][(_0xdc3b('0x5d'))](_0xdc3b('0x5e'));});_0x4a5d8b['pipe'](_0x54be03);_0x4a5d8b[_0xdc3b('0x5f')](_0xdc3b('0x60'),{'cwd':path[_0xdc3b('0x53')](config[_0xdc3b('0x61')],'server/files/plugins',path['dirname'](_0x48a53a['path'])),'ignore':[path[_0xdc3b('0x53')](path[_0xdc3b('0x57')](_0x48a53a[_0xdc3b('0x6')]),_0xdc3b('0x62')),path[_0xdc3b('0x53')](path['basename'](_0x48a53a[_0xdc3b('0x6')]),_0xdc3b('0x63'))],'nodir':!![]})['finalize']();_0x54be03['on'](_0xdc3b('0x64'),function(){if(!fs['existsSync'](_0x3c4275)){throw new db[(_0xdc3b('0x5c'))][(_0xdc3b('0x5d'))](_0xdc3b('0x65'));}return _0x404b0c[_0xdc3b('0x52')](_0x3c4275,util[_0xdc3b('0x55')](_0xdc3b('0x56'),path[_0xdc3b('0x57')](_0x48a53a[_0xdc3b('0x6')])),function(_0x22c80e){if(_0x22c80e){throw new db[(_0xdc3b('0x5c'))][(_0xdc3b('0x5d'))](_0xdc3b('0x66'));}fs[_0xdc3b('0x67')](_0x3c4275);logger[_0xdc3b('0x68')]('Download\x20completed');logger[_0xdc3b('0x68')](_0xdc3b('0x69'));});});}return null;})[_0xdc3b('0x4c')](handleError(_0x404b0c,null));};exports[_0xdc3b('0x6a')]=function(_0x4f979f,_0x578d47,_0x10e26f){var _0x12ef59=path[_0xdc3b('0x57')](_0x4f979f[_0xdc3b('0x6b')][_0xdc3b('0x6c')],path[_0xdc3b('0x6d')](_0x4f979f[_0xdc3b('0x6b')]['filename']));var _0x4b8000=path['join'](config['root'],'server/files/plugins',_0x4f979f[_0xdc3b('0x6b')][_0xdc3b('0x6c')]);var _0xacc0a0=path[_0xdc3b('0x53')](config[_0xdc3b('0x61')],'server/files/plugins',_0x12ef59);logger[_0xdc3b('0x68')]('Plugin\x20upload\x20filepath:\x20%s',_0x4b8000);logger[_0xdc3b('0x68')](_0xdc3b('0x6e'),_0xacc0a0);try{fs['chmodSync'](_0x4b8000,parseInt(_0xdc3b('0x6f'),0x8));extract(_0x4b8000,{'dir':_0xacc0a0},function(_0x398423){if(_0x398423){logger[_0xdc3b('0x33')](_0x398423);handleError(_0x398423,!![]);};var _0x3fc2f9=fs['readdirSync'](_0xacc0a0);if(_0x3fc2f9['length']>0x1){removeReferences(_0x4b8000,_0xacc0a0);logger['error'](_0xdc3b('0x70'));return _0x10e26f(new Error(_0xdc3b('0x70')));}var _0x1713db=fs[_0xdc3b('0x71')](path[_0xdc3b('0x53')](_0xacc0a0,_0x3fc2f9[0x0]));if(_0x1713db['isFile']()){removeReferences(_0x4b8000,_0xacc0a0);logger['error'](_0xdc3b('0x70'));return _0x10e26f(new Error(_0xdc3b('0x70')));}if(_0x1713db[_0xdc3b('0x72')]()){var _0x5da593=fs[_0xdc3b('0x73')](path[_0xdc3b('0x53')](_0xacc0a0,_0x3fc2f9[0x0]));if(_0x5da593['length']===0x0){removeReferences(_0x4b8000,_0xacc0a0);logger[_0xdc3b('0x33')](_0xdc3b('0x70'));return _0x10e26f(new Error(_0xdc3b('0x70')));}var _0x4bd7bd=_0x5da593[_0xdc3b('0x74')](function(_0x46b3d1){return _0x46b3d1===_0xdc3b('0x75');});if(!_0x4bd7bd){return _0x10e26f(new Error('Plugin\x20manifest\x20missing'));}var _0x258185=fs[_0xdc3b('0x76')](path['join'](_0xacc0a0,_0x3fc2f9[0x0],'manifest.json'));var _0x7f6348=JSON['parse'](_0x258185);if(_0xdc3b('0x26')==typeof _0x7f6348[_0xdc3b('0x35')]){return _0x10e26f(new Error('Invalid\x20manifest:\x20name\x20missing'));}if(_0xdc3b('0x26')==typeof _0x7f6348['type']){return _0x10e26f(new Error(_0xdc3b('0x77')));}if(_0xdc3b('0x26')==typeof _0x7f6348[_0xdc3b('0x78')]){return _0x10e26f(new Error(_0xdc3b('0x79')));}if(_0xdc3b('0x26')==typeof _0x7f6348[_0xdc3b('0x7a')]){return _0x10e26f(new Error(_0xdc3b('0x7b')));}if(_0x7f6348[_0xdc3b('0x3a')]===_0xdc3b('0x7c')){if(_0xdc3b('0x26')==typeof _0x7f6348['parameters']['views']){return _0x10e26f(new Error(_0xdc3b('0x7d')));}if(_0xdc3b('0x26')==typeof _0x7f6348[_0xdc3b('0x7a')][_0xdc3b('0x7e')][_0xdc3b('0x7f')]&&'undefined'==typeof _0x7f6348['parameters'][_0xdc3b('0x7e')]['agent']){return _0x10e26f(new Error(_0xdc3b('0x80')));}}else if(_0x7f6348[_0xdc3b('0x3a')]==='script'){if('undefined'==typeof _0x7f6348[_0xdc3b('0x7a')]['scriptName']){return _0x10e26f(new Error(_0xdc3b('0x81')));}if(_0xdc3b('0x26')==typeof _0x7f6348[_0xdc3b('0x7a')][_0xdc3b('0x82')]){return _0x10e26f(new Error(_0xdc3b('0x83')));}}else{return _0x10e26f(new Error(_0xdc3b('0x84')));}var _0xe0210f=_0x7f6348[_0xdc3b('0x35')];var _0x46dbf8=_0x7f6348[_0xdc3b('0x85')];var _0x38fda3=_0x7f6348['type'];var _0x3cb9da=_0x7f6348[_0xdc3b('0x86')]?_0x7f6348[_0xdc3b('0x86')]:_0xdc3b('0x87');var _0x5925f9=_0x7f6348['icon']?_0x7f6348[_0xdc3b('0x88')]:_0xdc3b('0x89');var _0x1400b2='';var _0x4864ab='';var _0x248e85='';var _0x1aeba2='';var _0x4e6d96=_0x7f6348['version'];if(_0x38fda3===_0xdc3b('0x7c')){if(_0xdc3b('0x26')!=typeof _0x7f6348[_0xdc3b('0x7a')]['views'][_0xdc3b('0x7f')]){var _0x5583f0=_0x7f6348[_0xdc3b('0x7a')][_0xdc3b('0x7e')][_0xdc3b('0x7f')];if(!/^(f|ht)tps?:\/\//i[_0xdc3b('0x8a')](_0x5583f0)){_0x1400b2=path[_0xdc3b('0x53')](_0xdc3b('0x8b'),_0x12ef59,_0x3fc2f9[0x0],_0x5583f0);}else{_0x1400b2=_0x5583f0;}}else{logger[_0xdc3b('0x68')](_0xdc3b('0x8c'));}if(_0xdc3b('0x26')!=typeof _0x7f6348[_0xdc3b('0x7a')][_0xdc3b('0x7e')]['agent']){var _0x181817=_0x7f6348[_0xdc3b('0x7a')][_0xdc3b('0x7e')][_0xdc3b('0x8d')];if(!/^(f|ht)tps?:\/\//i[_0xdc3b('0x8a')](_0x181817)){_0x4864ab=path[_0xdc3b('0x53')](_0xdc3b('0x8b'),_0x12ef59,_0x3fc2f9[0x0],_0x181817);}else{_0x4864ab=_0x181817;}}else{logger[_0xdc3b('0x68')]('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0x38fda3===_0xdc3b('0x8e')){_0x248e85=_0x7f6348[_0xdc3b('0x7a')][_0xdc3b('0x8f')];_0x1aeba2=_0x7f6348[_0xdc3b('0x7a')][_0xdc3b('0x82')];if(_0xdc3b('0x26')!=typeof _0x7f6348[_0xdc3b('0x7a')]['views']){if(_0xdc3b('0x26')!=typeof _0x7f6348['parameters']['views'][_0xdc3b('0x7f')]){var _0x5583f0=_0x7f6348[_0xdc3b('0x7a')][_0xdc3b('0x7e')][_0xdc3b('0x7f')];if(!/^(f|ht)tps?:\/\//i['test'](_0x5583f0)){_0x1400b2=path[_0xdc3b('0x53')]('plugins',_0x12ef59,_0x3fc2f9[0x0],_0x5583f0);}else{_0x1400b2=_0x5583f0;}}if('undefined'!=typeof _0x7f6348['parameters'][_0xdc3b('0x7e')]['agent']){var _0x181817=_0x7f6348[_0xdc3b('0x7a')][_0xdc3b('0x7e')][_0xdc3b('0x8d')];if(!/^(f|ht)tps?:\/\//i[_0xdc3b('0x8a')](_0x181817)){_0x4864ab=path[_0xdc3b('0x53')]('plugins',_0x12ef59,_0x3fc2f9[0x0],_0x181817);}else{_0x4864ab=_0x181817;}}}}var _0x49e8db={'name':_0xe0210f,'description':_0x46dbf8,'path':path[_0xdc3b('0x53')](_0x12ef59,_0x3fc2f9[0x0]),'type':_0x38fda3,'sidebar':_0x3cb9da,'icon':_0x5925f9,'adminUrl':_0x1400b2,'agentUrl':_0x4864ab,'scriptName':_0x248e85,'scriptPath':_0x1aeba2,'version':_0x4e6d96};removeReferences(_0x4b8000,null);return db[_0xdc3b('0x37')][_0xdc3b('0x90')](_0x49e8db)[_0xdc3b('0x2d')](function(_0x412d32){var _0x56449c={'role':_0x4f979f['body'][_0xdc3b('0x91')],'userProfileId':_0x4f979f[_0xdc3b('0x92')][_0xdc3b('0x93')]};if(!_0x56449c)throw new Error(_0xdc3b('0x94'));if(_0x56449c[_0xdc3b('0x91')]===_0xdc3b('0x95')){var _0x3de655=_0x412d32[_0xdc3b('0x2f')]({'plain':!![]});return db[_0xdc3b('0x96')][_0xdc3b('0x51')]({'where':{'name':_0xdc3b('0x30'),'userProfileId':_0x56449c['userProfileId']},'raw':!![]})[_0xdc3b('0x2d')](function(_0x3978dc){if(_0x3978dc&&_0x3978dc['autoAssociation']===0x0){return db[_0xdc3b('0x31')][_0xdc3b('0x90')]({'name':_0x3de655[_0xdc3b('0x35')],'resourceId':_0x3de655['id'],'type':_0x3978dc[_0xdc3b('0x35')],'sectionId':_0x3978dc['id']},{})[_0xdc3b('0x2d')](function(){return _0x412d32;});}else{return _0x412d32;}})[_0xdc3b('0x4c')](function(_0x5c5c77){logger[_0xdc3b('0x33')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5c5c77);throw _0x5c5c77;});}return _0x412d32;})[_0xdc3b('0x2d')](respondWithResult(_0x578d47,null))[_0xdc3b('0x4c')](handleError(_0x578d47,null));}});}catch(_0x13d909){_0x578d47['status'](0x1f4)[_0xdc3b('0x36')](_0x13d909);}};function removeReferences(_0x41a155,_0x4b555){try{if(_0x41a155){fs[_0xdc3b('0x67')](_0x41a155);logger[_0xdc3b('0x68')](_0xdc3b('0x97'));}if(_0x4b555){rimraf(_0x4b555,function(){});logger[_0xdc3b('0x68')](_0xdc3b('0x98'));}}catch(_0x5e2b35){logger[_0xdc3b('0x33')](_0x5e2b35);}}exports[_0xdc3b('0x2c')]=function(_0x11101b,_0x2c2105,_0x44ea1b){return db[_0xdc3b('0x37')][_0xdc3b('0x51')]({'where':{'id':_0x11101b[_0xdc3b('0x4e')]['id']}})[_0xdc3b('0x2d')](handleEntityNotFound(_0x2c2105,null))['then'](saveUpdates(_0x11101b[_0xdc3b('0x92')],null))[_0xdc3b('0x2d')](respondWithResult(_0x2c2105,null))[_0xdc3b('0x4c')](handleError(_0x2c2105,null));};exports['delete']=function(_0x330335,_0x17fa4d,_0x74c49c){return db[_0xdc3b('0x37')]['find']({'where':{'id':_0x330335[_0xdc3b('0x4e')]['id']}})[_0xdc3b('0x2d')](function(_0x3228d8){if(_0x3228d8){return _0x3228d8[_0xdc3b('0x2e')]();}})[_0xdc3b('0x2d')](function(_0x576a84){rimraf(path[_0xdc3b('0x53')](config['root'],'server/files/plugins',path[_0xdc3b('0x99')](_0x576a84[_0xdc3b('0x6')])),function(){});return _0x576a84;})[_0xdc3b('0x2d')](handleEntityNotFound(_0x17fa4d,null))[_0xdc3b('0x2d')](respondWithStatusCode(_0x17fa4d,null))[_0xdc3b('0x4c')](handleError(_0x17fa4d,null));};exports[_0xdc3b('0x9a')]=function(_0x2eeb36,_0x246b21,_0x4648e5){return BPromise[_0xdc3b('0x9b')]()[_0xdc3b('0x2d')](function(){if(!_0x2eeb36[_0xdc3b('0x3e')][_0xdc3b('0x6')]){throw new Error(_0xdc3b('0x9c'));}if(!_0x2eeb36[_0xdc3b('0x3e')][_0xdc3b('0x9d')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x45afae=_0x2eeb36[_0xdc3b('0x3e')][_0xdc3b('0x9e')]?_0x2eeb36['query'][_0xdc3b('0x9e')]+':'+_0x2eeb36[_0xdc3b('0x3e')][_0xdc3b('0x9d')]:_0xdc3b('0x9f')+_0x2eeb36[_0xdc3b('0x3e')]['port'];var _0xd9bdad=_0x2eeb36[_0xdc3b('0x3e')][_0xdc3b('0x24')]?_0x2eeb36[_0xdc3b('0x3e')][_0xdc3b('0x24')]:!![];var _0x533300=_0x2eeb36[_0xdc3b('0x3e')][_0xdc3b('0xa0')]?_0x2eeb36[_0xdc3b('0x3e')][_0xdc3b('0xa0')]:null;var _0x356db3={'method':_0x2eeb36['method'],'uri':util['format'](_0xdc3b('0xa1'),_0x45afae,_0x2eeb36[_0xdc3b('0x3e')]['path']),'json':_0xd9bdad,'resolveWithFullResponse':!![],'encoding':_0x533300,'qs':_0x2eeb36[_0xdc3b('0x3e')]};if(_0x2eeb36['headers']){_0x356db3['headers']=_0x2eeb36[_0xdc3b('0xa2')];if(_0x356db3['headers'][_0xdc3b('0xa3')]){delete _0x356db3[_0xdc3b('0xa2')][_0xdc3b('0xa3')];}}if(_0x356db3[_0xdc3b('0xa2')][_0xdc3b('0xa4')]){delete _0x356db3['headers'][_0xdc3b('0xa4')];}return rp(_0x356db3);})[_0xdc3b('0x2d')](function(_0x1d0fb4){if(_0x1d0fb4){_0x246b21[_0xdc3b('0x29')](_0x1d0fb4[_0xdc3b('0xa2')]);logger[_0xdc3b('0x68')](_0x1d0fb4[_0xdc3b('0x92')]);if(_[_0xdc3b('0xa5')](_0x2eeb36[_0xdc3b('0x3e')][_0xdc3b('0x6')],_0xdc3b('0x52'))&&_0x1d0fb4[_0xdc3b('0xa6')]==0x1f4){return _0x246b21[_0xdc3b('0x22')](_0x1d0fb4[_0xdc3b('0xa6')]);}else{return _0x246b21[_0xdc3b('0x23')](_0x1d0fb4[_0xdc3b('0xa6')])['send'](_0x1d0fb4[_0xdc3b('0x92')]);}}else{return _0x246b21[_0xdc3b('0x22')](0xc8);}})['catch'](handleError(_0x246b21,null));};exports[_0xdc3b('0xa7')]=function(_0x135aae,_0x3eda3f,_0x4e6320){return BPromise[_0xdc3b('0x9b')]()['then'](function(){if(!_0x135aae[_0xdc3b('0x3e')]['path']){throw new Error(_0xdc3b('0x9c'));}if(!_0x135aae[_0xdc3b('0x3e')]['port']){throw new Error(_0xdc3b('0xa8'));}var _0x508a89=_0x135aae[_0xdc3b('0x3e')]['hostname']?_0x135aae[_0xdc3b('0x3e')]['hostname']+':'+_0x135aae[_0xdc3b('0x3e')][_0xdc3b('0x9d')]:_0xdc3b('0x9f')+_0x135aae[_0xdc3b('0x3e')]['port'];var _0x5a2af4=_0x135aae[_0xdc3b('0x3e')]['json']?_0x135aae[_0xdc3b('0x3e')][_0xdc3b('0x24')]:!![];var _0x3bcb99=_0x135aae[_0xdc3b('0x3e')]['encoding']?_0x135aae[_0xdc3b('0x3e')][_0xdc3b('0xa0')]:null;var _0x22068b={'method':_0x135aae[_0xdc3b('0xa9')],'uri':util['format'](_0xdc3b('0xa1'),_0x508a89,_0x135aae[_0xdc3b('0x3e')][_0xdc3b('0x6')]),'json':_0x5a2af4,'resolveWithFullResponse':!![],'encoding':_0x3bcb99,'body':_0x135aae[_0xdc3b('0x92')]};if(_0x135aae['headers']){_0x22068b[_0xdc3b('0xa2')]=_0x135aae[_0xdc3b('0xa2')];if(_0x22068b[_0xdc3b('0xa2')]['content-length']){delete _0x22068b['headers'][_0xdc3b('0xa3')];}}if(_0x22068b[_0xdc3b('0xa2')]['content-type']){delete _0x22068b[_0xdc3b('0xa2')][_0xdc3b('0xa4')];}return rp(_0x22068b);})['then'](function(_0x1d357f){if(_0x1d357f){_0x3eda3f[_0xdc3b('0x29')](_0x1d357f['headers']);logger[_0xdc3b('0x68')](_0x1d357f[_0xdc3b('0x92')]);return _0x3eda3f[_0xdc3b('0x23')](_0x1d357f[_0xdc3b('0xa6')])[_0xdc3b('0x36')](_0x1d357f[_0xdc3b('0x92')]);}else{return _0x3eda3f['sendStatus'](0xc8);}})[_0xdc3b('0x4c')](handleError(_0x3eda3f,null));}; \ No newline at end of file +var _0x95ab=['basename','node_modules/**/*','attachments/**/*','finalize','close','existsSync','Plugin\x20not\x20found','download','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','file','filename','extname','Plugin\x20upload\x20filepath:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','isFile','isDirectory','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','undefined','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','icon','icon-apps','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','autoAssociation','create','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','update','delete','dirname','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','hostname','http://localhost:','encoding','method','%s%s','headers','content-length','content-type','endsWith','statusCode','webhookPost','\x27PORT\x27\x20parameter\x20not\x20specified','eml-format','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','extract-zip','rimraf','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./plugin.socket','sendStatus','status','end','limit','count','offset','set','Content-Range','json','apply','reject','then','destroy','Plugins','UserProfileResource','error','stack','name','send','index','map','Plugin','rawAttributes','type','key','query','filters','intersection','model','attributes','fields','length','order','sort','where','pick','filter','VIRTUAL','includeAll','catch','show','params','keys','include','find','join','root','server/files/plugins','format','%s.zip','zip','warning','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','glob','**/*'];(function(_0x2a10e7,_0x39da4c){var _0x5cfd7d=function(_0xf7e998){while(--_0xf7e998){_0x2a10e7['push'](_0x2a10e7['shift']());}};_0x5cfd7d(++_0x39da4c);}(_0x95ab,0xf9));var _0xb95a=function(_0x13f989,_0x18d87b){_0x13f989=_0x13f989-0x0;var _0x4aaf53=_0x95ab[_0x13f989];return _0x4aaf53;};'use strict';var emlformat=require(_0xb95a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb95a('0x1'));var rp=require(_0xb95a('0x2'));var moment=require(_0xb95a('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xb95a('0x4'));var util=require('util');var path=require(_0xb95a('0x5'));var sox=require('sox');var csv=require(_0xb95a('0x6'));var ejs=require(_0xb95a('0x7'));var fs=require('fs');var fs_extra=require(_0xb95a('0x8'));var _=require(_0xb95a('0x9'));var squel=require(_0xb95a('0xa'));var crypto=require(_0xb95a('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var extract=require(_0xb95a('0xc'));var rimraf=require(_0xb95a('0xd'));var archiver=require('archiver');var Redis=require(_0xb95a('0xe'));var authService=require(_0xb95a('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xb95a('0x10'));var hardwareService=require(_0xb95a('0x11'));var logger=require(_0xb95a('0x12'))(_0xb95a('0x13'));var utils=require(_0xb95a('0x14'));var config=require(_0xb95a('0x15'));var licenseUtil=require(_0xb95a('0x16'));var db=require(_0xb95a('0x17'))['db'];config[_0xb95a('0x18')]=_[_0xb95a('0x19')](config[_0xb95a('0x18')],{'host':_0xb95a('0x1a'),'port':0x18eb});var socket=require(_0xb95a('0x1b'))(new Redis(config[_0xb95a('0x18')]));require(_0xb95a('0x1c'))['register'](socket);function respondWithStatusCode(_0x14895f,_0x298770){_0x298770=_0x298770||0xcc;return function(_0x197b7c){if(_0x197b7c){return _0x14895f[_0xb95a('0x1d')](_0x298770);}return _0x14895f[_0xb95a('0x1e')](_0x298770)[_0xb95a('0x1f')]();};}function respondWithResult(_0x15313d,_0x58b152){_0x58b152=_0x58b152||0xc8;return function(_0x419c5e){if(_0x419c5e){return _0x15313d[_0xb95a('0x1e')](_0x58b152)['json'](_0x419c5e);}};}function respondWithFilteredResult(_0x3b3a67,_0x54be19){return function(_0x11fb8f){if(_0x11fb8f){var _0x2a1ff1=typeof _0x54be19['offset']==='undefined'&&typeof _0x54be19[_0xb95a('0x20')]==='undefined';var _0x3deae7=_0x11fb8f[_0xb95a('0x21')];var _0xdf5dbe=_0x2a1ff1?0x0:_0x54be19[_0xb95a('0x22')];var _0x49ff12=_0x2a1ff1?_0x11fb8f['count']:_0x54be19[_0xb95a('0x22')]+_0x54be19[_0xb95a('0x20')];var _0x56c5c5;if(_0x49ff12>=_0x3deae7){_0x49ff12=_0x3deae7;_0x56c5c5=0xc8;}else{_0x56c5c5=0xce;}_0x3b3a67[_0xb95a('0x1e')](_0x56c5c5);return _0x3b3a67[_0xb95a('0x23')](_0xb95a('0x24'),_0xdf5dbe+'-'+_0x49ff12+'/'+_0x3deae7)[_0xb95a('0x25')](_0x11fb8f);}return null;};}function patchUpdates(_0x38a786){return function(_0x464b2d){try{jsonpatch[_0xb95a('0x26')](_0x464b2d,_0x38a786,!![]);}catch(_0x3f68f1){return BPromise[_0xb95a('0x27')](_0x3f68f1);}return _0x464b2d['save']();};}function saveUpdates(_0x3c343b,_0xc3f26d){return function(_0x8249a0){if(_0x8249a0){return _0x8249a0['update'](_0x3c343b)[_0xb95a('0x28')](function(_0x968504){return _0x968504;});}return null;};}function removeEntity(_0x13fe70,_0x55d54d){return function(_0x3b251d){if(_0x3b251d){return _0x3b251d[_0xb95a('0x29')]()['then'](function(){var _0x3a1c4a=_0x3b251d['get']({'plain':!![]});var _0x50532c=_0xb95a('0x2a');return db[_0xb95a('0x2b')][_0xb95a('0x29')]({'where':{'type':_0x50532c,'resourceId':_0x3a1c4a['id']}})[_0xb95a('0x28')](function(){return _0x3b251d;});})[_0xb95a('0x28')](function(){_0x13fe70[_0xb95a('0x1e')](0xcc)[_0xb95a('0x1f')]();});}};}function handleEntityNotFound(_0x2edd73,_0x422e52){return function(_0x1bc893){if(!_0x1bc893){_0x2edd73[_0xb95a('0x1d')](0x194);}return _0x1bc893;};}function handleError(_0x5547b2,_0x36b3ce){_0x36b3ce=_0x36b3ce||0x1f4;return function(_0x3e2047){logger[_0xb95a('0x2c')](_0x3e2047[_0xb95a('0x2d')]);if(_0x3e2047[_0xb95a('0x2e')]){delete _0x3e2047[_0xb95a('0x2e')];}_0x5547b2[_0xb95a('0x1e')](_0x36b3ce)[_0xb95a('0x2f')](_0x3e2047);};}exports[_0xb95a('0x30')]=function(_0x16cde6,_0x3c637f){var _0xc60c89={},_0x1ca9aa={},_0x5def17={'count':0x0,'rows':[]};var _0x358639=_[_0xb95a('0x31')](db[_0xb95a('0x32')][_0xb95a('0x33')],function(_0x402dd5){return{'name':_0x402dd5['fieldName'],'type':_0x402dd5[_0xb95a('0x34')][_0xb95a('0x35')]};});_0x1ca9aa['model']=_[_0xb95a('0x31')](_0x358639,_0xb95a('0x2e'));_0x1ca9aa[_0xb95a('0x36')]=_['keys'](_0x16cde6[_0xb95a('0x36')]);_0x1ca9aa[_0xb95a('0x37')]=_[_0xb95a('0x38')](_0x1ca9aa[_0xb95a('0x39')],_0x1ca9aa['query']);_0xc60c89[_0xb95a('0x3a')]=_[_0xb95a('0x38')](_0x1ca9aa[_0xb95a('0x39')],qs[_0xb95a('0x3b')](_0x16cde6[_0xb95a('0x36')]['fields']));_0xc60c89['attributes']=_0xc60c89[_0xb95a('0x3a')][_0xb95a('0x3c')]?_0xc60c89[_0xb95a('0x3a')]:_0x1ca9aa['model'];if(!_0x16cde6[_0xb95a('0x36')]['hasOwnProperty']('nolimit')){_0xc60c89[_0xb95a('0x20')]=qs[_0xb95a('0x20')](_0x16cde6[_0xb95a('0x36')]['limit']);_0xc60c89[_0xb95a('0x22')]=qs['offset'](_0x16cde6[_0xb95a('0x36')]['offset']);}_0xc60c89[_0xb95a('0x3d')]=qs['sort'](_0x16cde6[_0xb95a('0x36')][_0xb95a('0x3e')]);_0xc60c89[_0xb95a('0x3f')]=qs['filters'](_[_0xb95a('0x40')](_0x16cde6[_0xb95a('0x36')],_0x1ca9aa['filters']),_0x358639);if(_0x16cde6[_0xb95a('0x36')][_0xb95a('0x41')]){_0xc60c89[_0xb95a('0x3f')]=_['merge'](_0xc60c89[_0xb95a('0x3f')],{'$or':_[_0xb95a('0x31')](_0x358639,function(_0x282a2e){if(_0x282a2e[_0xb95a('0x34')]!==_0xb95a('0x42')){var _0xc4cd8b={};_0xc4cd8b[_0x282a2e[_0xb95a('0x2e')]]={'$like':'%'+_0x16cde6[_0xb95a('0x36')][_0xb95a('0x41')]+'%'};return _0xc4cd8b;}})});}_0xc60c89=_['merge']({},_0xc60c89,_0x16cde6['options']);var _0x2a8a89={'where':_0xc60c89['where']};return db['Plugin']['count'](_0x2a8a89)[_0xb95a('0x28')](function(_0x1403ad){_0x5def17[_0xb95a('0x21')]=_0x1403ad;if(_0x16cde6[_0xb95a('0x36')][_0xb95a('0x43')]){_0xc60c89['include']=[{'all':!![]}];}return db[_0xb95a('0x32')]['findAll'](_0xc60c89);})['then'](function(_0x170249){_0x5def17['rows']=_0x170249;return _0x5def17;})[_0xb95a('0x28')](respondWithFilteredResult(_0x3c637f,_0xc60c89))[_0xb95a('0x44')](handleError(_0x3c637f,null));};exports[_0xb95a('0x45')]=function(_0x4525fb,_0x57c692){var _0x4869ec={'raw':!![],'where':{'id':_0x4525fb[_0xb95a('0x46')]['id']}},_0x3a61b0={};_0x3a61b0['model']=_[_0xb95a('0x47')](db[_0xb95a('0x32')][_0xb95a('0x33')]);_0x3a61b0[_0xb95a('0x36')]=_[_0xb95a('0x47')](_0x4525fb[_0xb95a('0x36')]);_0x3a61b0[_0xb95a('0x37')]=_[_0xb95a('0x38')](_0x3a61b0[_0xb95a('0x39')],_0x3a61b0[_0xb95a('0x36')]);_0x4869ec[_0xb95a('0x3a')]=_['intersection'](_0x3a61b0[_0xb95a('0x39')],qs['fields'](_0x4525fb['query'][_0xb95a('0x3b')]));_0x4869ec[_0xb95a('0x3a')]=_0x4869ec[_0xb95a('0x3a')][_0xb95a('0x3c')]?_0x4869ec['attributes']:_0x3a61b0['model'];if(_0x4525fb[_0xb95a('0x36')]['includeAll']){_0x4869ec[_0xb95a('0x48')]=[{'all':!![]}];}_0x4869ec=_['merge']({},_0x4869ec,_0x4525fb['options']);return db['Plugin']['find'](_0x4869ec)[_0xb95a('0x28')](handleEntityNotFound(_0x57c692,null))['then'](respondWithResult(_0x57c692,null))['catch'](handleError(_0x57c692,null));};exports['download']=function(_0x4601a4,_0x147555,_0x7ad307){return db[_0xb95a('0x32')][_0xb95a('0x49')]({'where':{'id':_0x4601a4['params']['id']},'attributes':[_0xb95a('0x2e'),_0xb95a('0x5')],'raw':!![]})[_0xb95a('0x28')](handleEntityNotFound(_0x147555,null))[_0xb95a('0x28')](function(_0xea5981){if(_0xea5981){var _0x59f2b2=path[_0xb95a('0x4a')](config[_0xb95a('0x4b')],_0xb95a('0x4c'),util[_0xb95a('0x4d')](_0xb95a('0x4e'),path['basename'](_0xea5981[_0xb95a('0x5')])));var _0x213a4f=fs['createWriteStream'](_0x59f2b2);var _0x1ed499=archiver(_0xb95a('0x4f'),{'zlib':{'level':0x9}});_0x1ed499['on'](_0xb95a('0x50'),function(_0x38a976){if(_0x38a976['code']===_0xb95a('0x51')){logger[_0xb95a('0x2c')](_0x38a976);}else{throw new db[(_0xb95a('0x52'))]['Error']('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x1ed499['on'](_0xb95a('0x2c'),function(_0x2058b9){throw new db[(_0xb95a('0x52'))][(_0xb95a('0x53'))](_0xb95a('0x54'));});_0x1ed499['pipe'](_0x213a4f);_0x1ed499[_0xb95a('0x55')](_0xb95a('0x56'),{'cwd':path[_0xb95a('0x4a')](config['root'],_0xb95a('0x4c'),path['dirname'](_0xea5981[_0xb95a('0x5')])),'ignore':[path[_0xb95a('0x4a')](path[_0xb95a('0x57')](_0xea5981[_0xb95a('0x5')]),_0xb95a('0x58')),path[_0xb95a('0x4a')](path[_0xb95a('0x57')](_0xea5981[_0xb95a('0x5')]),_0xb95a('0x59'))],'nodir':!![]})[_0xb95a('0x5a')]();_0x213a4f['on'](_0xb95a('0x5b'),function(){if(!fs[_0xb95a('0x5c')](_0x59f2b2)){throw new db[(_0xb95a('0x52'))][(_0xb95a('0x53'))](_0xb95a('0x5d'));}return _0x147555[_0xb95a('0x5e')](_0x59f2b2,util[_0xb95a('0x4d')](_0xb95a('0x4e'),path[_0xb95a('0x57')](_0xea5981[_0xb95a('0x5')])),function(_0x51e87b){if(_0x51e87b){throw new db[(_0xb95a('0x52'))][(_0xb95a('0x53'))](_0xb95a('0x5f'));}fs[_0xb95a('0x60')](_0x59f2b2);logger[_0xb95a('0x61')](_0xb95a('0x62'));logger['info']('Temporary\x20file\x20removed');});});}return null;})['catch'](handleError(_0x147555,null));};exports['upload']=function(_0x4748fe,_0x5358d8,_0x34fc53){var _0x2bec17=path[_0xb95a('0x57')](_0x4748fe[_0xb95a('0x63')][_0xb95a('0x64')],path[_0xb95a('0x65')](_0x4748fe['file']['filename']));var _0x15b6c9=path['join'](config[_0xb95a('0x4b')],_0xb95a('0x4c'),_0x4748fe[_0xb95a('0x63')][_0xb95a('0x64')]);var _0x3ad102=path[_0xb95a('0x4a')](config[_0xb95a('0x4b')],_0xb95a('0x4c'),_0x2bec17);logger[_0xb95a('0x61')](_0xb95a('0x66'),_0x15b6c9);logger[_0xb95a('0x61')]('Plugin\x20upload\x20destination:\x20%s',_0x3ad102);try{fs[_0xb95a('0x67')](_0x15b6c9,parseInt(_0xb95a('0x68'),0x8));extract(_0x15b6c9,{'dir':_0x3ad102},function(_0x5f45d2){if(_0x5f45d2){logger[_0xb95a('0x2c')](_0x5f45d2);handleError(_0x5f45d2,!![]);};var _0x2b2228=fs[_0xb95a('0x69')](_0x3ad102);if(_0x2b2228[_0xb95a('0x3c')]>0x1){removeReferences(_0x15b6c9,_0x3ad102);logger[_0xb95a('0x2c')](_0xb95a('0x6a'));return _0x34fc53(new Error(_0xb95a('0x6a')));}var _0xaf2684=fs['lstatSync'](path[_0xb95a('0x4a')](_0x3ad102,_0x2b2228[0x0]));if(_0xaf2684[_0xb95a('0x6b')]()){removeReferences(_0x15b6c9,_0x3ad102);logger[_0xb95a('0x2c')](_0xb95a('0x6a'));return _0x34fc53(new Error(_0xb95a('0x6a')));}if(_0xaf2684[_0xb95a('0x6c')]()){var _0x4dee5d=fs[_0xb95a('0x69')](path[_0xb95a('0x4a')](_0x3ad102,_0x2b2228[0x0]));if(_0x4dee5d[_0xb95a('0x3c')]===0x0){removeReferences(_0x15b6c9,_0x3ad102);logger[_0xb95a('0x2c')]('Invalid\x20plugin\x20structure');return _0x34fc53(new Error('Invalid\x20plugin\x20structure'));}var _0x1b6b8e=_0x4dee5d[_0xb95a('0x6d')](function(_0x3a6174){return _0x3a6174===_0xb95a('0x6e');});if(!_0x1b6b8e){return _0x34fc53(new Error(_0xb95a('0x6f')));}var _0x51c60e=fs[_0xb95a('0x70')](path[_0xb95a('0x4a')](_0x3ad102,_0x2b2228[0x0],_0xb95a('0x6e')));var _0x5dfd01=JSON['parse'](_0x51c60e);if(_0xb95a('0x71')==typeof _0x5dfd01[_0xb95a('0x2e')]){return _0x34fc53(new Error(_0xb95a('0x72')));}if(_0xb95a('0x71')==typeof _0x5dfd01['type']){return _0x34fc53(new Error(_0xb95a('0x73')));}if(_0xb95a('0x71')==typeof _0x5dfd01['version']){return _0x34fc53(new Error(_0xb95a('0x74')));}if(_0xb95a('0x71')==typeof _0x5dfd01[_0xb95a('0x75')]){return _0x34fc53(new Error(_0xb95a('0x76')));}if(_0x5dfd01[_0xb95a('0x34')]===_0xb95a('0x77')){if(_0xb95a('0x71')==typeof _0x5dfd01[_0xb95a('0x75')][_0xb95a('0x78')]){return _0x34fc53(new Error(_0xb95a('0x79')));}if(_0xb95a('0x71')==typeof _0x5dfd01[_0xb95a('0x75')][_0xb95a('0x78')][_0xb95a('0x7a')]&&_0xb95a('0x71')==typeof _0x5dfd01[_0xb95a('0x75')][_0xb95a('0x78')][_0xb95a('0x7b')]){return _0x34fc53(new Error(_0xb95a('0x7c')));}}else if(_0x5dfd01[_0xb95a('0x34')]===_0xb95a('0x7d')){if(_0xb95a('0x71')==typeof _0x5dfd01['parameters'][_0xb95a('0x7e')]){return _0x34fc53(new Error(_0xb95a('0x7f')));}if('undefined'==typeof _0x5dfd01[_0xb95a('0x75')][_0xb95a('0x80')]){return _0x34fc53(new Error(_0xb95a('0x81')));}}else{return _0x34fc53(new Error(_0xb95a('0x82')));}var _0x5fe458=_0x5dfd01[_0xb95a('0x2e')];var _0x599415=_0x5dfd01[_0xb95a('0x83')];var _0x3b2df1=_0x5dfd01['type'];var _0x4b6777=_0x5dfd01[_0xb95a('0x84')]?_0x5dfd01[_0xb95a('0x84')]:'always';var _0x16b560=_0x5dfd01[_0xb95a('0x85')]?_0x5dfd01['icon']:_0xb95a('0x86');var _0x5b4d40='';var _0xd96550='';var _0x5092da='';var _0x5eeb4d='';var _0x50283d=_0x5dfd01['version'];if(_0x3b2df1===_0xb95a('0x77')){if(_0xb95a('0x71')!=typeof _0x5dfd01[_0xb95a('0x75')][_0xb95a('0x78')][_0xb95a('0x7a')]){var _0x3e473f=_0x5dfd01[_0xb95a('0x75')][_0xb95a('0x78')][_0xb95a('0x7a')];if(!/^(f|ht)tps?:\/\//i[_0xb95a('0x87')](_0x3e473f)){_0x5b4d40=path[_0xb95a('0x4a')](_0xb95a('0x88'),_0x2bec17,_0x2b2228[0x0],_0x3e473f);}else{_0x5b4d40=_0x3e473f;}}else{logger[_0xb95a('0x61')](_0xb95a('0x89'));}if(_0xb95a('0x71')!=typeof _0x5dfd01[_0xb95a('0x75')][_0xb95a('0x78')]['agent']){var _0x1e27df=_0x5dfd01[_0xb95a('0x75')][_0xb95a('0x78')][_0xb95a('0x7b')];if(!/^(f|ht)tps?:\/\//i[_0xb95a('0x87')](_0x1e27df)){_0xd96550=path[_0xb95a('0x4a')](_0xb95a('0x88'),_0x2bec17,_0x2b2228[0x0],_0x1e27df);}else{_0xd96550=_0x1e27df;}}else{logger[_0xb95a('0x61')](_0xb95a('0x8a'));}}else if(_0x3b2df1===_0xb95a('0x7d')){_0x5092da=_0x5dfd01[_0xb95a('0x75')][_0xb95a('0x7e')];_0x5eeb4d=_0x5dfd01['parameters'][_0xb95a('0x80')];if(_0xb95a('0x71')!=typeof _0x5dfd01[_0xb95a('0x75')][_0xb95a('0x78')]){if('undefined'!=typeof _0x5dfd01[_0xb95a('0x75')][_0xb95a('0x78')][_0xb95a('0x7a')]){var _0x3e473f=_0x5dfd01[_0xb95a('0x75')][_0xb95a('0x78')][_0xb95a('0x7a')];if(!/^(f|ht)tps?:\/\//i[_0xb95a('0x87')](_0x3e473f)){_0x5b4d40=path[_0xb95a('0x4a')](_0xb95a('0x88'),_0x2bec17,_0x2b2228[0x0],_0x3e473f);}else{_0x5b4d40=_0x3e473f;}}if('undefined'!=typeof _0x5dfd01[_0xb95a('0x75')][_0xb95a('0x78')]['agent']){var _0x1e27df=_0x5dfd01[_0xb95a('0x75')]['views'][_0xb95a('0x7b')];if(!/^(f|ht)tps?:\/\//i[_0xb95a('0x87')](_0x1e27df)){_0xd96550=path['join']('plugins',_0x2bec17,_0x2b2228[0x0],_0x1e27df);}else{_0xd96550=_0x1e27df;}}}}var _0x3aac8c={'name':_0x5fe458,'description':_0x599415,'path':path['join'](_0x2bec17,_0x2b2228[0x0]),'type':_0x3b2df1,'sidebar':_0x4b6777,'icon':_0x16b560,'adminUrl':_0x5b4d40,'agentUrl':_0xd96550,'scriptName':_0x5092da,'scriptPath':_0x5eeb4d,'version':_0x50283d};removeReferences(_0x15b6c9,null);return db[_0xb95a('0x32')]['create'](_0x3aac8c)[_0xb95a('0x28')](function(_0x11f867){var _0x5cf13d={'role':_0x4748fe['body']['role'],'userProfileId':_0x4748fe[_0xb95a('0x8b')][_0xb95a('0x8c')]};if(!_0x5cf13d)throw new Error(_0xb95a('0x8d'));if(_0x5cf13d[_0xb95a('0x8e')]==='user'){var _0x5d2e43=_0x11f867[_0xb95a('0x8f')]({'plain':!![]});return db[_0xb95a('0x90')]['find']({'where':{'name':_0xb95a('0x2a'),'userProfileId':_0x5cf13d['userProfileId']},'raw':!![]})[_0xb95a('0x28')](function(_0x1b0e76){if(_0x1b0e76&&_0x1b0e76[_0xb95a('0x91')]===0x0){return db['UserProfileResource'][_0xb95a('0x92')]({'name':_0x5d2e43[_0xb95a('0x2e')],'resourceId':_0x5d2e43['id'],'type':_0x1b0e76['name'],'sectionId':_0x1b0e76['id']},{})[_0xb95a('0x28')](function(){return _0x11f867;});}else{return _0x11f867;}})['catch'](function(_0x5f596f){logger[_0xb95a('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5f596f);throw _0x5f596f;});}return _0x11f867;})[_0xb95a('0x28')](respondWithResult(_0x5358d8,null))['catch'](handleError(_0x5358d8,null));}});}catch(_0x16f4fd){_0x5358d8['status'](0x1f4)[_0xb95a('0x2f')](_0x16f4fd);}};function removeReferences(_0x97413,_0x1f0dc0){try{if(_0x97413){fs[_0xb95a('0x60')](_0x97413);logger[_0xb95a('0x61')](_0xb95a('0x93'));}if(_0x1f0dc0){rimraf(_0x1f0dc0,function(){});logger['info'](_0xb95a('0x94'));}}catch(_0x830e9c){logger[_0xb95a('0x2c')](_0x830e9c);}}exports[_0xb95a('0x95')]=function(_0x3c26bc,_0x12b2fc,_0x20e965){return db['Plugin'][_0xb95a('0x49')]({'where':{'id':_0x3c26bc[_0xb95a('0x46')]['id']}})[_0xb95a('0x28')](handleEntityNotFound(_0x12b2fc,null))[_0xb95a('0x28')](saveUpdates(_0x3c26bc[_0xb95a('0x8b')],null))[_0xb95a('0x28')](respondWithResult(_0x12b2fc,null))['catch'](handleError(_0x12b2fc,null));};exports[_0xb95a('0x96')]=function(_0x3c3b0c,_0xc73474,_0xb04092){return db[_0xb95a('0x32')][_0xb95a('0x49')]({'where':{'id':_0x3c3b0c[_0xb95a('0x46')]['id']}})[_0xb95a('0x28')](function(_0x183e9e){if(_0x183e9e){return _0x183e9e[_0xb95a('0x29')]();}})[_0xb95a('0x28')](function(_0x13f066){rimraf(path[_0xb95a('0x4a')](config[_0xb95a('0x4b')],_0xb95a('0x4c'),path[_0xb95a('0x97')](_0x13f066[_0xb95a('0x5')])),function(){});return _0x13f066;})[_0xb95a('0x28')](handleEntityNotFound(_0xc73474,null))['then'](respondWithStatusCode(_0xc73474,null))[_0xb95a('0x44')](handleError(_0xc73474,null));};exports[_0xb95a('0x98')]=function(_0x58f2e0,_0x953020,_0xf9b7a){return BPromise[_0xb95a('0x99')]()[_0xb95a('0x28')](function(){if(!_0x58f2e0[_0xb95a('0x36')][_0xb95a('0x5')]){throw new Error(_0xb95a('0x9a'));}if(!_0x58f2e0['query'][_0xb95a('0x9b')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x27143f=_0x58f2e0['query']['hostname']?_0x58f2e0[_0xb95a('0x36')][_0xb95a('0x9c')]+':'+_0x58f2e0[_0xb95a('0x36')][_0xb95a('0x9b')]:_0xb95a('0x9d')+_0x58f2e0[_0xb95a('0x36')][_0xb95a('0x9b')];var _0x507e7b=_0x58f2e0['query'][_0xb95a('0x25')]?_0x58f2e0[_0xb95a('0x36')][_0xb95a('0x25')]:!![];var _0x300ad0=_0x58f2e0[_0xb95a('0x36')][_0xb95a('0x9e')]?_0x58f2e0[_0xb95a('0x36')][_0xb95a('0x9e')]:null;var _0x4e3385={'method':_0x58f2e0[_0xb95a('0x9f')],'uri':util['format'](_0xb95a('0xa0'),_0x27143f,_0x58f2e0[_0xb95a('0x36')][_0xb95a('0x5')]),'json':_0x507e7b,'resolveWithFullResponse':!![],'encoding':_0x300ad0,'qs':_0x58f2e0[_0xb95a('0x36')]};if(_0x58f2e0[_0xb95a('0xa1')]){_0x4e3385[_0xb95a('0xa1')]=_0x58f2e0[_0xb95a('0xa1')];if(_0x4e3385['headers'][_0xb95a('0xa2')]){delete _0x4e3385[_0xb95a('0xa1')][_0xb95a('0xa2')];}}if(_0x4e3385['headers'][_0xb95a('0xa3')]){delete _0x4e3385[_0xb95a('0xa1')][_0xb95a('0xa3')];}return rp(_0x4e3385);})[_0xb95a('0x28')](function(_0x18ed5d){if(_0x18ed5d){_0x953020[_0xb95a('0x23')](_0x18ed5d[_0xb95a('0xa1')]);logger[_0xb95a('0x61')](_0x18ed5d['body']);if(_[_0xb95a('0xa4')](_0x58f2e0['query'][_0xb95a('0x5')],_0xb95a('0x5e'))&&_0x18ed5d[_0xb95a('0xa5')]==0x1f4){return _0x953020[_0xb95a('0x1d')](_0x18ed5d['statusCode']);}else{return _0x953020[_0xb95a('0x1e')](_0x18ed5d[_0xb95a('0xa5')])[_0xb95a('0x2f')](_0x18ed5d[_0xb95a('0x8b')]);}}else{return _0x953020[_0xb95a('0x1d')](0xc8);}})[_0xb95a('0x44')](handleError(_0x953020,null));};exports[_0xb95a('0xa6')]=function(_0x571121,_0x2ed6d6,_0x4414ae){return BPromise['resolve']()['then'](function(){if(!_0x571121[_0xb95a('0x36')][_0xb95a('0x5')]){throw new Error(_0xb95a('0x9a'));}if(!_0x571121['query'][_0xb95a('0x9b')]){throw new Error(_0xb95a('0xa7'));}var _0x2b2760=_0x571121[_0xb95a('0x36')][_0xb95a('0x9c')]?_0x571121[_0xb95a('0x36')]['hostname']+':'+_0x571121[_0xb95a('0x36')][_0xb95a('0x9b')]:_0xb95a('0x9d')+_0x571121[_0xb95a('0x36')][_0xb95a('0x9b')];var _0x57ff10=_0x571121[_0xb95a('0x36')][_0xb95a('0x25')]?_0x571121['query'][_0xb95a('0x25')]:!![];var _0x4bee36=_0x571121['query'][_0xb95a('0x9e')]?_0x571121[_0xb95a('0x36')]['encoding']:null;var _0x3f2fac={'method':_0x571121[_0xb95a('0x9f')],'uri':util['format'](_0xb95a('0xa0'),_0x2b2760,_0x571121[_0xb95a('0x36')][_0xb95a('0x5')]),'json':_0x57ff10,'resolveWithFullResponse':!![],'encoding':_0x4bee36,'body':_0x571121['body']};if(_0x571121[_0xb95a('0xa1')]){_0x3f2fac[_0xb95a('0xa1')]=_0x571121[_0xb95a('0xa1')];if(_0x3f2fac[_0xb95a('0xa1')]['content-length']){delete _0x3f2fac[_0xb95a('0xa1')][_0xb95a('0xa2')];}}if(_0x3f2fac['headers'][_0xb95a('0xa3')]){delete _0x3f2fac[_0xb95a('0xa1')][_0xb95a('0xa3')];}return rp(_0x3f2fac);})[_0xb95a('0x28')](function(_0x37394d){if(_0x37394d){_0x2ed6d6[_0xb95a('0x23')](_0x37394d[_0xb95a('0xa1')]);logger[_0xb95a('0x61')](_0x37394d[_0xb95a('0x8b')]);return _0x2ed6d6[_0xb95a('0x1e')](_0x37394d[_0xb95a('0xa5')])[_0xb95a('0x2f')](_0x37394d['body']);}else{return _0x2ed6d6['sendStatus'](0xc8);}})[_0xb95a('0x44')](handleError(_0x2ed6d6,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index eaacbcd..bd7ddfd 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 _0xd819=['exports','../../mysqldb','Plugin','setMaxListeners','save','remove','emit','hook'];(function(_0x1ca9e9,_0x1c4391){var _0x309f3c=function(_0x5ab318){while(--_0x5ab318){_0x1ca9e9['push'](_0x1ca9e9['shift']());}};_0x309f3c(++_0x1c4391);}(_0xd819,0x181));var _0x9d81=function(_0x328b9b,_0x13082a){_0x328b9b=_0x328b9b-0x0;var _0x3a2d51=_0xd819[_0x328b9b];return _0x3a2d51;};'use strict';var EventEmitter=require('events');var Plugin=require(_0x9d81('0x0'))['db'][_0x9d81('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0x9d81('0x2')](0x0);var events={'afterCreate':_0x9d81('0x3'),'afterUpdate':'update','afterDestroy':_0x9d81('0x4')};function emitEvent(_0x5591a5){return function(_0x301265,_0x53ff09,_0x382cc1){PluginEvents[_0x9d81('0x5')](_0x5591a5+':'+_0x301265['id'],_0x301265);PluginEvents[_0x9d81('0x5')](_0x5591a5,_0x301265);_0x382cc1(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin[_0x9d81('0x6')](e,emitEvent(event));}}module[_0x9d81('0x7')]=PluginEvents; \ No newline at end of file +var _0x7278=['hook','exports','events','../../mysqldb','Plugin','setMaxListeners','save','remove','emit'];(function(_0x573c19,_0x5525bd){var _0x26df1d=function(_0x1ce098){while(--_0x1ce098){_0x573c19['push'](_0x573c19['shift']());}};_0x26df1d(++_0x5525bd);}(_0x7278,0x161));var _0x8727=function(_0x489afb,_0x40738f){_0x489afb=_0x489afb-0x0;var _0x45ad1b=_0x7278[_0x489afb];return _0x45ad1b;};'use strict';var EventEmitter=require(_0x8727('0x0'));var Plugin=require(_0x8727('0x1'))['db'][_0x8727('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0x8727('0x3')](0x0);var events={'afterCreate':_0x8727('0x4'),'afterUpdate':'update','afterDestroy':_0x8727('0x5')};function emitEvent(_0x19c8ac){return function(_0x6007de,_0x221021,_0x2df052){PluginEvents[_0x8727('0x6')](_0x19c8ac+':'+_0x6007de['id'],_0x6007de);PluginEvents[_0x8727('0x6')](_0x19c8ac,_0x6007de);_0x2df052(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin[_0x8727('0x7')](e,emitEvent(event));}}module[_0x8727('0x8')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index a1de3a4..a6913fe 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 _0xcbf6=['lodash','../../config/logger','api','moment','request-promise','path','../../config/environment','./plugin.attributes','plugins'];(function(_0x30ce1e,_0x51de8d){var _0x525851=function(_0x2c45d3){while(--_0x2c45d3){_0x30ce1e['push'](_0x30ce1e['shift']());}};_0x525851(++_0x51de8d);}(_0xcbf6,0xd8));var _0x6cbf=function(_0xf4d05,_0x5e601f){_0xf4d05=_0xf4d05-0x0;var _0x47c971=_0xcbf6[_0xf4d05];return _0x47c971;};'use strict';var _=require(_0x6cbf('0x0'));var util=require('util');var logger=require(_0x6cbf('0x1'))(_0x6cbf('0x2'));var moment=require(_0x6cbf('0x3'));var BPromise=require('bluebird');var rp=require(_0x6cbf('0x4'));var fs=require('fs');var path=require(_0x6cbf('0x5'));var rimraf=require('rimraf');var config=require(_0x6cbf('0x6'));var attributes=require(_0x6cbf('0x7'));module['exports']=function(_0x1fb618,_0x54a974){return _0x1fb618['define']('Plugin',attributes,{'tableName':_0x6cbf('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8840=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./plugin.attributes','exports','define','Plugin','plugins','lodash','util','../../config/logger'];(function(_0x3163e9,_0x45f4c4){var _0x175bf0=function(_0x589888){while(--_0x589888){_0x3163e9['push'](_0x3163e9['shift']());}};_0x175bf0(++_0x45f4c4);}(_0x8840,0x15b));var _0x0884=function(_0x319df2,_0x4085fb){_0x319df2=_0x319df2-0x0;var _0x41f9df=_0x8840[_0x319df2];return _0x41f9df;};'use strict';var _=require(_0x0884('0x0'));var util=require(_0x0884('0x1'));var logger=require(_0x0884('0x2'))(_0x0884('0x3'));var moment=require(_0x0884('0x4'));var BPromise=require(_0x0884('0x5'));var rp=require(_0x0884('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0884('0x7'));var config=require(_0x0884('0x8'));var attributes=require(_0x0884('0x9'));module[_0x0884('0xa')]=function(_0x4dfa82,_0x45a820){return _0x4dfa82[_0x0884('0xb')](_0x0884('0xc'),attributes,{'tableName':_0x0884('0xd'),'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 7a543b9..5f20f30 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 _0x1aa2=['defaults','socket.io-emitter','./plugin.socket','register','request','then','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','error','code','message','CreatePlugin','create','body','options','raw','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0x1aa2,0x1b7));var _0x21aa=function(_0x2867d8,_0xef3ee0){_0x2867d8=_0x2867d8-0x0;var _0x3b8176=_0x1aa2[_0x2867d8];return _0x3b8176;};'use strict';var _=require('lodash');var util=require(_0x21aa('0x0'));var moment=require(_0x21aa('0x1'));var BPromise=require('bluebird');var rs=require(_0x21aa('0x2'));var fs=require('fs');var Redis=require(_0x21aa('0x3'));var db=require(_0x21aa('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x21aa('0x5'))(_0x21aa('0x6'));var config=require(_0x21aa('0x7'));var jayson=require(_0x21aa('0x8'));var client=jayson['client'][_0x21aa('0x9')]({'port':0x232a});config[_0x21aa('0xa')]=_[_0x21aa('0xb')](config[_0x21aa('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x21aa('0xc'))(new Redis(config[_0x21aa('0xa')]));require(_0x21aa('0xd'))[_0x21aa('0xe')](socket);function respondWithRpcPromise(_0x281e07,_0x27da34,_0x28f9ed){return new BPromise(function(_0x45a807,_0x44dc50){return client[_0x21aa('0xf')](_0x281e07,_0x28f9ed)[_0x21aa('0x10')](function(_0x3ecf3d){logger[_0x21aa('0x11')](_0x21aa('0x12'),_0x27da34,_0x21aa('0x13'));logger[_0x21aa('0x14')](_0x21aa('0x15'),_0x27da34,_0x21aa('0x13'),JSON['stringify'](_0x3ecf3d));if(_0x3ecf3d[_0x21aa('0x16')]){if(_0x3ecf3d[_0x21aa('0x16')][_0x21aa('0x17')]===0x1f4){logger['error'](_0x21aa('0x12'),_0x27da34,_0x3ecf3d['error'][_0x21aa('0x18')]);return _0x44dc50(_0x3ecf3d['error'][_0x21aa('0x18')]);}logger[_0x21aa('0x16')](_0x21aa('0x12'),_0x27da34,_0x3ecf3d['error'][_0x21aa('0x18')]);return _0x45a807(_0x3ecf3d[_0x21aa('0x16')]['message']);}else{logger[_0x21aa('0x11')](_0x21aa('0x12'),_0x27da34,_0x21aa('0x13'));_0x45a807(_0x3ecf3d['result'][_0x21aa('0x18')]);}})['catch'](function(_0x18a385){logger[_0x21aa('0x16')](_0x21aa('0x12'),_0x27da34,_0x18a385);_0x44dc50(_0x18a385);});});}exports[_0x21aa('0x19')]=function(_0x3ed995){var _0x224b73=this;return new Promise(function(_0x33980,_0x1d3043){return db['Plugin'][_0x21aa('0x1a')](_0x3ed995[_0x21aa('0x1b')],{'raw':_0x3ed995[_0x21aa('0x1c')]?_0x3ed995['options'][_0x21aa('0x1d')]===undefined?!![]:![]:!![]})[_0x21aa('0x10')](function(_0x4bc1e4){logger[_0x21aa('0x11')](_0x21aa('0x19'),_0x3ed995);logger[_0x21aa('0x14')](_0x21aa('0x19'),_0x3ed995,JSON['stringify'](_0x4bc1e4));_0x33980(_0x4bc1e4);})['catch'](function(_0x48506){logger[_0x21aa('0x16')](_0x21aa('0x19'),_0x48506[_0x21aa('0x18')],_0x3ed995);_0x1d3043(_0x224b73[_0x21aa('0x16')](0x1f4,_0x48506[_0x21aa('0x18')]));});});}; \ No newline at end of file +var _0x5fbd=['../../config/logger','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','./plugin.socket','register','request','then','info','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','Plugin,\x20%s,\x20%s','message','result','CreatePlugin','body','options','raw','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x418570,_0x565e2f){var _0x2fcd53=function(_0x39cddc){while(--_0x39cddc){_0x418570['push'](_0x418570['shift']());}};_0x2fcd53(++_0x565e2f);}(_0x5fbd,0x109));var _0xd5fb=function(_0x4db775,_0x30f6d0){_0x4db775=_0x4db775-0x0;var _0x5b245d=_0x5fbd[_0x4db775];return _0x5b245d;};'use strict';var _=require('lodash');var util=require(_0xd5fb('0x0'));var moment=require(_0xd5fb('0x1'));var BPromise=require(_0xd5fb('0x2'));var rs=require(_0xd5fb('0x3'));var fs=require('fs');var Redis=require(_0xd5fb('0x4'));var db=require(_0xd5fb('0x5'))['db'];var utils=require(_0xd5fb('0x6'));var logger=require(_0xd5fb('0x7'))(_0xd5fb('0x8'));var config=require(_0xd5fb('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xd5fb('0xa')][_0xd5fb('0xb')]({'port':0x232a});config[_0xd5fb('0xc')]=_['defaults'](config['redis'],{'host':_0xd5fb('0xd'),'port':0x18eb});var socket=require(_0xd5fb('0xe'))(new Redis(config[_0xd5fb('0xc')]));require(_0xd5fb('0xf'))[_0xd5fb('0x10')](socket);function respondWithRpcPromise(_0x138115,_0x13b990,_0x1a47f7){return new BPromise(function(_0x5aaa1e,_0x1fd53c){return client[_0xd5fb('0x11')](_0x138115,_0x1a47f7)[_0xd5fb('0x12')](function(_0x43e8d6){logger[_0xd5fb('0x13')]('Plugin,\x20%s,\x20%s',_0x13b990,_0xd5fb('0x14'));logger[_0xd5fb('0x15')](_0xd5fb('0x16'),_0x13b990,_0xd5fb('0x14'),JSON[_0xd5fb('0x17')](_0x43e8d6));if(_0x43e8d6[_0xd5fb('0x18')]){if(_0x43e8d6[_0xd5fb('0x18')][_0xd5fb('0x19')]===0x1f4){logger[_0xd5fb('0x18')](_0xd5fb('0x1a'),_0x13b990,_0x43e8d6[_0xd5fb('0x18')][_0xd5fb('0x1b')]);return _0x1fd53c(_0x43e8d6[_0xd5fb('0x18')][_0xd5fb('0x1b')]);}logger['error'](_0xd5fb('0x1a'),_0x13b990,_0x43e8d6['error'][_0xd5fb('0x1b')]);return _0x5aaa1e(_0x43e8d6[_0xd5fb('0x18')][_0xd5fb('0x1b')]);}else{logger['info']('Plugin,\x20%s,\x20%s',_0x13b990,'request\x20sent');_0x5aaa1e(_0x43e8d6[_0xd5fb('0x1c')][_0xd5fb('0x1b')]);}})['catch'](function(_0x591b95){logger['error']('Plugin,\x20%s,\x20%s',_0x13b990,_0x591b95);_0x1fd53c(_0x591b95);});});}exports[_0xd5fb('0x1d')]=function(_0x5cad62){var _0x5f4295=this;return new Promise(function(_0x3b932a,_0x3fe254){return db['Plugin']['create'](_0x5cad62[_0xd5fb('0x1e')],{'raw':_0x5cad62[_0xd5fb('0x1f')]?_0x5cad62[_0xd5fb('0x1f')][_0xd5fb('0x20')]===undefined?!![]:![]:!![]})[_0xd5fb('0x12')](function(_0x5a3d44){logger['info'](_0xd5fb('0x1d'),_0x5cad62);logger['debug'](_0xd5fb('0x1d'),_0x5cad62,JSON['stringify'](_0x5a3d44));_0x3b932a(_0x5a3d44);})[_0xd5fb('0x21')](function(_0x341748){logger[_0xd5fb('0x18')](_0xd5fb('0x1d'),_0x341748[_0xd5fb('0x1b')],_0x5cad62);_0x3fe254(_0x5f4295['error'](0x1f4,_0x341748[_0xd5fb('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 1d1db65..4b61c7b 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 _0xd923=['save','remove','update','emit','removeListener','register','length','plugin:','./plugin.events'];(function(_0x250873,_0x3e8932){var _0x437de2=function(_0x434923){while(--_0x434923){_0x250873['push'](_0x250873['shift']());}};_0x437de2(++_0x3e8932);}(_0xd923,0x1af));var _0x3d92=function(_0x412da9,_0x27ea9e){_0x412da9=_0x412da9-0x0;var _0x9e5453=_0xd923[_0x412da9];return _0x9e5453;};'use strict';var PluginEvents=require(_0x3d92('0x0'));var events=[_0x3d92('0x1'),_0x3d92('0x2'),_0x3d92('0x3')];function createListener(_0x57b05d,_0x5775db){return function(_0x410bb8){_0x5775db[_0x3d92('0x4')](_0x57b05d,_0x410bb8);};}function removeListener(_0xbced5c,_0x32ff82){return function(){PluginEvents[_0x3d92('0x5')](_0xbced5c,_0x32ff82);};}exports[_0x3d92('0x6')]=function(_0x3783c4){for(var _0x55a138=0x0,_0xcea49c=events[_0x3d92('0x7')];_0x55a138<_0xcea49c;_0x55a138++){var _0x432229=events[_0x55a138];var _0x3f7474=createListener(_0x3d92('0x8')+_0x432229,_0x3783c4);PluginEvents['on'](_0x432229,_0x3f7474);}}; \ No newline at end of file +var _0x2b30=['emit','register','./plugin.events','remove','update'];(function(_0x3850de,_0x2acfca){var _0x3c405f=function(_0x1e0b0d){while(--_0x1e0b0d){_0x3850de['push'](_0x3850de['shift']());}};_0x3c405f(++_0x2acfca);}(_0x2b30,0x1d3));var _0x02b3=function(_0x1da155,_0x142860){_0x1da155=_0x1da155-0x0;var _0x489653=_0x2b30[_0x1da155];return _0x489653;};'use strict';var PluginEvents=require(_0x02b3('0x0'));var events=['save',_0x02b3('0x1'),_0x02b3('0x2')];function createListener(_0x3048be,_0x25a5be){return function(_0x4724fe){_0x25a5be[_0x02b3('0x3')](_0x3048be,_0x4724fe);};}function removeListener(_0x27db1e,_0x2aa313){return function(){PluginEvents['removeListener'](_0x27db1e,_0x2aa313);};}exports[_0x02b3('0x4')]=function(_0x5d3f26){for(var _0x4779ad=0x0,_0x3861f9=events['length'];_0x4779ad<_0x3861f9;_0x4779ad++){var _0xd284cb=events[_0x4779ad];var _0x390ce4=createListener('plugin:'+_0xd284cb,_0x5d3f26);PluginEvents['on'](_0xd284cb,_0x390ce4);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 043d727..aebd5fd 100644 --- a/server/api/pm2/index.js +++ b/server/api/pm2/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['create','put','delete','destroy','exports','express','Router','../../components/auth/service','isAuthenticated','get','/:id','show','post'];(function(_0x3d7d74,_0xab2175){var _0x210516=function(_0x308d90){while(--_0x308d90){_0x3d7d74['push'](_0x3d7d74['shift']());}};_0x210516(++_0xab2175);}(_0xa9e0,0x123));var _0x0a9e=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xa9e0[_0xea8947];return _0x2455e9;};'use strict';var express=require(_0x0a9e('0x0'));var router=express[_0x0a9e('0x1')]();var auth=require(_0x0a9e('0x2'));var controller=require('./pm2.controller');router['get']('/',auth[_0x0a9e('0x3')](),controller['index']);router[_0x0a9e('0x4')](_0x0a9e('0x5'),auth[_0x0a9e('0x3')](),controller[_0x0a9e('0x6')]);router[_0x0a9e('0x7')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x8')]);router[_0x0a9e('0x9')](_0x0a9e('0x5'),auth['isAuthenticated'](),controller['update']);router[_0x0a9e('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);module[_0x0a9e('0xc')]=router; \ No newline at end of file +var _0xa9e0=['create','put','delete','destroy','exports','express','Router','../../components/auth/service','isAuthenticated','get','/:id','show','post'];(function(_0x6810a7,_0x3bb876){var _0x51ab69=function(_0x37e7aa){while(--_0x37e7aa){_0x6810a7['push'](_0x6810a7['shift']());}};_0x51ab69(++_0x3bb876);}(_0xa9e0,0x123));var _0x0a9e=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xa9e0[_0x46aff0];return _0x9d78cf;};'use strict';var express=require(_0x0a9e('0x0'));var router=express[_0x0a9e('0x1')]();var auth=require(_0x0a9e('0x2'));var controller=require('./pm2.controller');router['get']('/',auth[_0x0a9e('0x3')](),controller['index']);router[_0x0a9e('0x4')](_0x0a9e('0x5'),auth[_0x0a9e('0x3')](),controller[_0x0a9e('0x6')]);router[_0x0a9e('0x7')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x8')]);router[_0x0a9e('0x9')](_0x0a9e('0x5'),auth['isAuthenticated'](),controller['update']);router[_0x0a9e('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);module[_0x0a9e('0xc')]=router; \ No newline at end of file diff --git a/server/api/pm2/pm2.controller.js b/server/api/pm2/pm2.controller.js index 0dd4505..5387697 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 _0xe205=['cwd','chdir','dirname','dump','Missing\x20name\x20and/or\x20path','restart','stop','hasOwnProperty','Unknown\x20status','destroy','delete','lodash','../../config/pm2','../../config/logger','api','path','child_process','exec','bluebird','sendStatus','json','error','name','status','send','npm\x20install','info','index','list','reject','express','length','then','catch','show','describe','params','body','script'];(function(_0x474607,_0xb2fe4b){var _0x5bc58d=function(_0x450711){while(--_0x450711){_0x474607['push'](_0x474607['shift']());}};_0x5bc58d(++_0xb2fe4b);}(_0xe205,0xa7));var _0x5e20=function(_0xbcd4e,_0x60cdad){_0xbcd4e=_0xbcd4e-0x0;var _0x10f017=_0xe205[_0xbcd4e];return _0x10f017;};'use strict';var _=require(_0x5e20('0x0'));var pm2=require(_0x5e20('0x1'));var logger=require(_0x5e20('0x2'))(_0x5e20('0x3'));var path=require(_0x5e20('0x4'));var exec=require(_0x5e20('0x5'))[_0x5e20('0x6')];var BPromise=require(_0x5e20('0x7'));function handleEntityNotFound(_0x37c5e9,_0x4ac934){return function(_0x1a6198){if(!_0x1a6198){_0x37c5e9[_0x5e20('0x8')](0x194);;}return _0x1a6198;};}function respondWithResult(_0x44dbb3,_0x3c4203){_0x3c4203=_0x3c4203||0xc8;return function(_0x5eca5c){if(_0x5eca5c){return _0x44dbb3['status'](_0x3c4203)[_0x5e20('0x9')](_0x5eca5c);}return null;};}function handleError(_0x4c9332,_0x533e18){_0x533e18=_0x533e18||0x1f4;return function(_0x30b757){logger[_0x5e20('0xa')](_0x30b757['stack']);if(_0x30b757[_0x5e20('0xb')]){delete _0x30b757[_0x5e20('0xb')];}_0x4c9332[_0x5e20('0xc')](_0x533e18)[_0x5e20('0xd')](_0x30b757);};}function execChildProcess(){return new BPromise(function(_0x5cb51d,_0x349613){exec(_0x5e20('0xe'),function(_0x270689,_0x27f1f9,_0x165824){logger[_0x5e20('0xf')](_0x27f1f9);logger['info'](_0x165824);if(_0x270689){logger[_0x5e20('0xa')](_0x270689);return _0x349613(_0x270689);}return _0x5cb51d(_0x27f1f9);});});}exports[_0x5e20('0x10')]=function(_0x22540d,_0x5868c0){return pm2[_0x5e20('0x11')]()['then'](function(_0x1f47f3){if(_0x1f47f3){var _0x5ba833=_[_0x5e20('0x12')](_0x1f47f3,function(_0x330cdf){return _0x330cdf[_0x5e20('0xb')]===_0x5e20('0x13')||_0x330cdf[_0x5e20('0xb')]==='motion2';});return{'rows':_0x5ba833,'count':_0x5ba833[_0x5e20('0x14')]};}return null;})[_0x5e20('0x15')](respondWithResult(_0x5868c0,null))[_0x5e20('0x16')](handleError(_0x5868c0,null));};exports[_0x5e20('0x17')]=function(_0x2f194b,_0x3b353f){return pm2[_0x5e20('0x18')](_0x2f194b[_0x5e20('0x19')]['id'])['then'](respondWithResult(_0x3b353f,null))[_0x5e20('0x15')](handleEntityNotFound(_0x3b353f,null))[_0x5e20('0x16')](handleError(_0x3b353f,null));};exports['create']=function(_0x295eb3,_0x1b1457){if(_0x295eb3[_0x5e20('0x1a')][_0x5e20('0xb')]&&_0x295eb3['body'][_0x5e20('0x1b')]){var _0x50f222=path['join'](__dirname,'../../files/plugins',_0x295eb3['body'][_0x5e20('0x1b')]);var _0x5cca90=process[_0x5e20('0x1c')]();process[_0x5e20('0x1d')](path[_0x5e20('0x1e')](_0x50f222));return execChildProcess()[_0x5e20('0x15')](function(_0x3ef7fa){process[_0x5e20('0x1d')](_0x5cca90);return pm2['start']({'name':_0x295eb3[_0x5e20('0x1a')]['name'],'script':_0x50f222});})['then'](function(_0x33993a){pm2[_0x5e20('0x1f')]();return _0x33993a[0x0];})[_0x5e20('0x15')](respondWithResult(_0x1b1457,0xc9))[_0x5e20('0x16')](handleError(_0x1b1457,null));}else{return _0x1b1457[_0x5e20('0xc')](0x1f4)[_0x5e20('0xd')]({'message':_0x5e20('0x20')});}};exports['update']=function(_0x3bf4f4,_0x420f63){if(_0x3bf4f4[_0x5e20('0x1a')]['id']){delete _0x3bf4f4[_0x5e20('0x1a')]['id'];}var _0x4c799d={'online':_0x5e20('0x21'),'stopped':_0x5e20('0x22')};if(_0x4c799d[_0x5e20('0x23')](_0x3bf4f4[_0x5e20('0x1a')][_0x5e20('0xc')])){return pm2[_0x4c799d[_0x3bf4f4[_0x5e20('0x1a')]['status']]](_0x3bf4f4[_0x5e20('0x19')]['id'])[_0x5e20('0x15')](respondWithResult(_0x420f63,0xc8))['catch'](handleError(_0x420f63,null));}else{return _0x420f63[_0x5e20('0xc')](0x1f4)[_0x5e20('0xd')]({'message':_0x5e20('0x24')});}};exports[_0x5e20('0x25')]=function(_0x1548c8,_0x395a27){if(_0x1548c8['body']['id']){delete _0x1548c8[_0x5e20('0x1a')]['id'];}if(_0x1548c8[_0x5e20('0x19')]['id']){return pm2[_0x5e20('0x26')](_0x1548c8[_0x5e20('0x19')]['id'])[_0x5e20('0x15')](function(_0x1ac162){pm2[_0x5e20('0x1f')]();return _0x1ac162[0x0];})[_0x5e20('0x15')](respondWithResult(_0x395a27,null))[_0x5e20('0x16')](handleError(_0x395a27,null));}else{return _0x395a27[_0x5e20('0xc')](0x1f4)[_0x5e20('0xd')]({'message':'Unknown\x20id'});}}; \ No newline at end of file +var _0x70e0=['dump','Missing\x20name\x20and/or\x20path','update','restart','stop','hasOwnProperty','status','destroy','delete','Unknown\x20id','lodash','../../config/pm2','../../config/logger','child_process','exec','bluebird','json','error','stack','name','send','npm\x20install','info','index','list','reject','motion2','length','then','describe','params','catch','create','body','join','../../files/plugins','script','cwd','chdir','dirname','start'];(function(_0x1a2f9c,_0x18ae12){var _0x1aa41e=function(_0x2fe65f){while(--_0x2fe65f){_0x1a2f9c['push'](_0x1a2f9c['shift']());}};_0x1aa41e(++_0x18ae12);}(_0x70e0,0x17b));var _0x070e=function(_0x400c68,_0x3aca03){_0x400c68=_0x400c68-0x0;var _0xe0ce3e=_0x70e0[_0x400c68];return _0xe0ce3e;};'use strict';var _=require(_0x070e('0x0'));var pm2=require(_0x070e('0x1'));var logger=require(_0x070e('0x2'))('api');var path=require('path');var exec=require(_0x070e('0x3'))[_0x070e('0x4')];var BPromise=require(_0x070e('0x5'));function handleEntityNotFound(_0x2593e5,_0x5c90fc){return function(_0x7bce9b){if(!_0x7bce9b){_0x2593e5['sendStatus'](0x194);;}return _0x7bce9b;};}function respondWithResult(_0x46fe68,_0x4b041d){_0x4b041d=_0x4b041d||0xc8;return function(_0x56e420){if(_0x56e420){return _0x46fe68['status'](_0x4b041d)[_0x070e('0x6')](_0x56e420);}return null;};}function handleError(_0x1e11f0,_0x604664){_0x604664=_0x604664||0x1f4;return function(_0x2611e6){logger[_0x070e('0x7')](_0x2611e6[_0x070e('0x8')]);if(_0x2611e6[_0x070e('0x9')]){delete _0x2611e6['name'];}_0x1e11f0['status'](_0x604664)[_0x070e('0xa')](_0x2611e6);};}function execChildProcess(){return new BPromise(function(_0x2e3e5e,_0x12bb37){exec(_0x070e('0xb'),function(_0xa927a2,_0xffcdd6,_0x25cfe1){logger[_0x070e('0xc')](_0xffcdd6);logger[_0x070e('0xc')](_0x25cfe1);if(_0xa927a2){logger[_0x070e('0x7')](_0xa927a2);return _0x12bb37(_0xa927a2);}return _0x2e3e5e(_0xffcdd6);});});}exports[_0x070e('0xd')]=function(_0x52da3b,_0x5dca0f){return pm2[_0x070e('0xe')]()['then'](function(_0x4a33d2){if(_0x4a33d2){var _0x5bae0f=_[_0x070e('0xf')](_0x4a33d2,function(_0x14c3fd){return _0x14c3fd['name']==='express'||_0x14c3fd[_0x070e('0x9')]===_0x070e('0x10');});return{'rows':_0x5bae0f,'count':_0x5bae0f[_0x070e('0x11')]};}return null;})[_0x070e('0x12')](respondWithResult(_0x5dca0f,null))['catch'](handleError(_0x5dca0f,null));};exports['show']=function(_0x17e2e4,_0x2bd937){return pm2[_0x070e('0x13')](_0x17e2e4[_0x070e('0x14')]['id'])[_0x070e('0x12')](respondWithResult(_0x2bd937,null))['then'](handleEntityNotFound(_0x2bd937,null))[_0x070e('0x15')](handleError(_0x2bd937,null));};exports[_0x070e('0x16')]=function(_0x1ad3de,_0x3ea105){if(_0x1ad3de[_0x070e('0x17')]['name']&&_0x1ad3de['body']['script']){var _0x9907cf=path[_0x070e('0x18')](__dirname,_0x070e('0x19'),_0x1ad3de['body'][_0x070e('0x1a')]);var _0x5dc5d2=process[_0x070e('0x1b')]();process[_0x070e('0x1c')](path[_0x070e('0x1d')](_0x9907cf));return execChildProcess()[_0x070e('0x12')](function(_0x28a1c3){process[_0x070e('0x1c')](_0x5dc5d2);return pm2[_0x070e('0x1e')]({'name':_0x1ad3de[_0x070e('0x17')]['name'],'script':_0x9907cf});})[_0x070e('0x12')](function(_0x270061){pm2[_0x070e('0x1f')]();return _0x270061[0x0];})['then'](respondWithResult(_0x3ea105,0xc9))[_0x070e('0x15')](handleError(_0x3ea105,null));}else{return _0x3ea105['status'](0x1f4)['send']({'message':_0x070e('0x20')});}};exports[_0x070e('0x21')]=function(_0x41deb1,_0x1743cc){if(_0x41deb1[_0x070e('0x17')]['id']){delete _0x41deb1['body']['id'];}var _0x374c54={'online':_0x070e('0x22'),'stopped':_0x070e('0x23')};if(_0x374c54[_0x070e('0x24')](_0x41deb1[_0x070e('0x17')][_0x070e('0x25')])){return pm2[_0x374c54[_0x41deb1[_0x070e('0x17')][_0x070e('0x25')]]](_0x41deb1['params']['id'])[_0x070e('0x12')](respondWithResult(_0x1743cc,0xc8))[_0x070e('0x15')](handleError(_0x1743cc,null));}else{return _0x1743cc[_0x070e('0x25')](0x1f4)['send']({'message':'Unknown\x20status'});}};exports[_0x070e('0x26')]=function(_0x46065c,_0xa6c0ab){if(_0x46065c['body']['id']){delete _0x46065c[_0x070e('0x17')]['id'];}if(_0x46065c[_0x070e('0x14')]['id']){return pm2[_0x070e('0x27')](_0x46065c[_0x070e('0x14')]['id'])['then'](function(_0x5bf522){pm2['dump']();return _0x5bf522[0x0];})['then'](respondWithResult(_0xa6c0ab,null))[_0x070e('0x15')](handleError(_0xa6c0ab,null));}else{return _0xa6c0ab['status'](0x1f4)[_0x070e('0xa')]({'message':_0x070e('0x28')});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index 4cb1584..a6dfa06 100644 --- a/server/api/realtime/index.js +++ b/server/api/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf1b2=['Router','../../components/auth/service','./realtime.controller','get','/agents','isAuthenticated','/queues'];(function(_0x455aed,_0x1eefd2){var _0xfc3a2a=function(_0x4e8254){while(--_0x4e8254){_0x455aed['push'](_0x455aed['shift']());}};_0xfc3a2a(++_0x1eefd2);}(_0xf1b2,0x1ea));var _0x2f1b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf1b2[_0x3dd15e];return _0x231fd0;};'use strict';var express=require('express');var router=express[_0x2f1b('0x0')]();var auth=require(_0x2f1b('0x1'));var controller=require(_0x2f1b('0x2'));router[_0x2f1b('0x3')](_0x2f1b('0x4'),auth[_0x2f1b('0x5')](),controller['getAgents']);router[_0x2f1b('0x3')](_0x2f1b('0x6'),auth[_0x2f1b('0x5')](),controller['getQueues']);module['exports']=router; \ No newline at end of file +var _0xcd80=['getAgents','get','/queues','getQueues','exports','express','Router','/agents','isAuthenticated'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xcd80,0x137));var _0x0cd8=function(_0x211b9c,_0x3e4a38){_0x211b9c=_0x211b9c-0x0;var _0x5be03d=_0xcd80[_0x211b9c];return _0x5be03d;};'use strict';var express=require(_0x0cd8('0x0'));var router=express[_0x0cd8('0x1')]();var auth=require('../../components/auth/service');var controller=require('./realtime.controller');router['get'](_0x0cd8('0x2'),auth[_0x0cd8('0x3')](),controller[_0x0cd8('0x4')]);router[_0x0cd8('0x5')](_0x0cd8('0x6'),auth[_0x0cd8('0x3')](),controller[_0x0cd8('0x7')]);module[_0x0cd8('0x8')]=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index 966b179..c60e223 100644 --- a/server/api/realtime/realtime.controller.js +++ b/server/api/realtime/realtime.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1666=['startCase','Queue','name','outbound','dialActive','dialMethod','QueueCampaigns','Queues','filter','UserProfile','getRealtimeQueues','initializeQueues','util','../../components/realtime/agents','../../components/realtime/queues','../../components/parsers/qs','../../config/utils','../../mysqldb','APIBadRequestError','../../errors/api','handleError','offset','undefined','limit','count','status','set','Content-Range','json','getAgents','query','globalQueueFilter','globalStatusFilter','pauseTypeFilter','pause','*pause','resolve','channel','isValidChannel','format','Channel\x20parameter\x20%s\x20is\x20invalid','toLowerCase','sort','validateSortParameter','getUpdatedSortOptions','join','then','getRealtimeAgents','rows','getSortedAgentsIdsByStatus','getAgentIdsByStatus','length','User','rawAttributes','fieldName','type','key','role','agent','getOptions','raw','push','sequelize','FIELD(id,','forEach','Pause','where','merge','user','userProfileId','Agents','online','extraQueryConditions','assign','omit','getResources','findAndCountAll','map','find','filterAgentAttributes','getAgentStatus','globalStatus','includes','voice','voiceStatus','sortAgentsByStatus','pick'];(function(_0x21a5b2,_0xfcae3){var _0x288cfe=function(_0x251bd5){while(--_0x251bd5){_0x21a5b2['push'](_0x21a5b2['shift']());}};_0x288cfe(++_0xfcae3);}(_0x1666,0xba));var _0x6166=function(_0x14b23d,_0x4c01a1){_0x14b23d=_0x14b23d-0x0;var _0x4ce191=_0x1666[_0x14b23d];return _0x4ce191;};'use strict';var _=require('lodash');var util=require(_0x6166('0x0'));var rta=require(_0x6166('0x1'));var rtq=require(_0x6166('0x2'));var qs=require(_0x6166('0x3'));var utils=require(_0x6166('0x4'));var db=require(_0x6166('0x5'))['db'];var APIBadRequestError=require('../../errors/api')[_0x6166('0x6')];var APIHandleError=require(_0x6166('0x7'))[_0x6166('0x8')];function respondWithFilteredResult(_0x101c36,_0x11f451){return function(_0x2f9a48){if(_0x2f9a48){var _0x147efb=typeof _0x11f451[_0x6166('0x9')]===_0x6166('0xa')&&typeof _0x11f451[_0x6166('0xb')]===_0x6166('0xa');var _0x5e0c8f=_0x2f9a48[_0x6166('0xc')];var _0x3e7774=_0x147efb?0x0:_0x11f451[_0x6166('0x9')];var _0x4a5664=_0x147efb?_0x2f9a48[_0x6166('0xc')]:_0x11f451[_0x6166('0x9')]+_0x11f451[_0x6166('0xb')];var _0x2c7f35;if(_0x4a5664>=_0x5e0c8f){_0x4a5664=_0x5e0c8f;_0x2c7f35=0xc8;}else{_0x2c7f35=0xce;}_0x101c36[_0x6166('0xd')](_0x2c7f35);return _0x101c36[_0x6166('0xe')](_0x6166('0xf'),_0x3e7774+'-'+_0x4a5664+'/'+_0x5e0c8f)[_0x6166('0x10')](_0x2f9a48);}return null;};}exports[_0x6166('0x11')]=function(_0x553375,_0x4b7bfc){var _0x14b3d9={'count':0x0,'rows':[]};var _0x2ca8f9={};var _0x3458c3;var _0x1fddcb=utils['getChannels']();var _0x27a84a;var _0x8d94df;var _0x55036b=_0x553375[_0x6166('0x12')][_0x6166('0x13')];var _0x2ce703=_0x553375[_0x6166('0x12')][_0x6166('0x14')];var _0x7b1155=_0x553375[_0x6166('0x12')][_0x6166('0x15')];var _0x192e60=_0x2ce703===_0x6166('0x16')||_0x2ce703===_0x6166('0x17')?!![]:![];var _0x424eb3=[];var _0x34b170;var _0x235924;Promise[_0x6166('0x18')]()['then'](function(){if(_0x553375[_0x6166('0x12')][_0x6166('0x19')]){if(!utils[_0x6166('0x1a')](_0x553375[_0x6166('0x12')][_0x6166('0x19')])){throw new APIBadRequestError(util[_0x6166('0x1b')](_0x6166('0x1c'),_0x553375[_0x6166('0x12')][_0x6166('0x19')]));}_0x3458c3=_0x553375[_0x6166('0x12')][_0x6166('0x19')][_0x6166('0x1d')]();}if(!_0x553375[_0x6166('0x12')]['sort']||!_0x553375[_0x6166('0x12')][_0x6166('0x1e')]['includes']('globalStatus')){_0x553375[_0x6166('0x12')][_0x6166('0x1e')]=rta[_0x6166('0x1f')](_0x553375[_0x6166('0x12')][_0x6166('0x1e')]);return;}var _0x1d4b69=rta[_0x6166('0x20')](_0x553375[_0x6166('0x12')][_0x6166('0x1e')]);_0x553375['query']['sort']=_0x1d4b69['fields'][_0x6166('0x21')](',');_0x34b170=_0x1d4b69['order'];})[_0x6166('0x22')](function(){if(!_0x55036b){return[];}return rta['getAgentIdsByQueues'](_0x55036b,_0x3458c3);})[_0x6166('0x22')](function(_0x459eee){_0x424eb3=_0x459eee;return rta[_0x6166('0x23')]();})[_0x6166('0x22')](function(_0x4db638){_0x8d94df=_0x4db638[_0x6166('0x24')];if((!_0x2ce703||_0x192e60)&&!_0x34b170){return _0x424eb3;}if(_0x34b170&&!_0x2ce703){return rta[_0x6166('0x25')](_0x8d94df,_0x424eb3,_0x34b170);}else{return rta[_0x6166('0x26')](_0x8d94df,_0x424eb3,_0x2ce703);}})[_0x6166('0x22')](function(_0x1348c4){_0x424eb3=_0x1348c4;var _0x22a539=![];if(_0x424eb3[_0x6166('0x27')]===0x0){if(_0x55036b||_0x2ce703){_0x22a539=!![];}if(_0x192e60){_0x22a539=![];}}if(_0x22a539){return _0x14b3d9;}var _0x43279d=_['map'](db[_0x6166('0x28')][_0x6166('0x29')],function(_0x29d48c){return{'name':_0x29d48c[_0x6166('0x2a')],'type':_0x29d48c[_0x6166('0x2b')][_0x6166('0x2c')]};});_0x553375[_0x6166('0x12')][_0x6166('0x2d')]=_0x6166('0x2e');_0x2ca8f9=qs[_0x6166('0x2f')](_0x43279d,_0x553375);_0x2ca8f9[_0x6166('0x30')]=!![];var _0x51aa3a=[];if(_0x424eb3['length']>0x0){_0x51aa3a[_0x6166('0x31')]({'id':{'$in':_0x424eb3}});if(_0x34b170&&!_0x2ce703){_0x235924=[db[_0x6166('0x32')]['literal'](_0x6166('0x33')+_0x424eb3+')')];_0x2ca8f9['order']=_0x235924;}}if(_0x192e60){_0x1fddcb[_0x6166('0x34')](function(_0x33fe3b){var _0x59fe04=!![];if(_0x2ce703===_0x6166('0x17')&&_0x3458c3!==_0x33fe3b){_0x59fe04=![];}_0x51aa3a[_0x6166('0x31')]({[_0x33fe3b+_0x6166('0x35')]:_0x59fe04});});if(_0x7b1155){_0x51aa3a[_0x6166('0x31')]({'pauseType':_0x7b1155});}}else if(_0x2ce703){_0x1fddcb[_0x6166('0x34')](function(_0x45837e){_0x51aa3a[_0x6166('0x31')]({[_0x45837e+_0x6166('0x35')]:![]});});}_0x2ca8f9[_0x6166('0x36')]=_[_0x6166('0x37')](_0x2ca8f9[_0x6166('0x36')],{'$and':_0x51aa3a});if(_0x553375[_0x6166('0x38')][_0x6166('0x2d')]==='user'){var _0x4a5694={'params':{'id':_0x553375[_0x6166('0x38')][_0x6166('0x39')]},'query':{'section':_0x6166('0x3a'),'role':'agent','raw':!![],'ids':_0x424eb3,'customSorting':_0x235924}};if(_0x553375[_0x6166('0x12')][_0x6166('0x3b')]){_0x4a5694[_0x6166('0x12')]['online']=!![];}if(_0x192e60){_0x4a5694['query'][_0x6166('0x3c')]=_0x51aa3a;}_0x4a5694[_0x6166('0x12')]=Object[_0x6166('0x3d')](_0x4a5694['query'],_[_0x6166('0x3e')](_0x553375[_0x6166('0x12')],'id'));return db['UserProfile'][_0x6166('0x3f')](_0x4a5694);}return db[_0x6166('0x28')][_0x6166('0x40')](_0x2ca8f9);})[_0x6166('0x22')](function(_0x8f74dd){_0x14b3d9[_0x6166('0xc')]=_0x8f74dd[_0x6166('0xc')];_0x27a84a=_0x8f74dd[_0x6166('0x24')];return _0x27a84a[_0x6166('0x41')](function(_0x3e51c6){var _0x16ecce=_[_0x6166('0x42')](_0x8d94df,['id',_0x3e51c6['id']]);if(_0x16ecce){var _0x1755fa=rta[_0x6166('0x43')](_0x16ecce);_[_0x6166('0x37')](_0x3e51c6,_0x1755fa);}_0x3e51c6['globalStatus']=rta[_0x6166('0x44')](_0x3e51c6);if(_0x3e51c6[_0x6166('0x45')][_0x6166('0x46')](_0x6166('0x16'))){_0x1fddcb[_0x6166('0x34')](function(_0xad14d2){if(_0x3e51c6[_0xad14d2+_0x6166('0x35')]){if(_0xad14d2===_0x6166('0x47')){if(_0x3e51c6['voiceStatus']!=='talking'){_0x3e51c6[_0x6166('0x48')]=_0x6166('0x16');}}else{_0x3e51c6[_0xad14d2+'Status']=_0x6166('0x16');}}});}return _0x3e51c6;});})['then'](function(_0x1c2565){if(!_0x34b170||_0x235924){return _0x1c2565;}return rta[_0x6166('0x49')](_0x1c2565,_0x34b170);})['then'](function(_0x2f2e20){var _0x4349ef=rta['getRealtimeAgentsQueryFields']();_0x14b3d9[_0x6166('0x24')]=_0x2f2e20['map'](function(_0x416f91){return _[_0x6166('0x4a')](_0x416f91,_0x4349ef);});return _0x14b3d9;})[_0x6166('0x22')](respondWithFilteredResult(_0x4b7bfc,_0x2ca8f9))['catch'](APIHandleError(_0x4b7bfc));};exports['getQueues']=function(_0x5c412e,_0xc199a9){var _0x28fd7d={'count':0x0,'rows':[]};var _0x243e65={};var _0x7d2e35;var _0x2b8923;var _0xbd131f;Promise[_0x6166('0x18')]()[_0x6166('0x22')](function(){if(_0x5c412e[_0x6166('0x12')]['channel']){if(!utils['isValidChannel'](_0x5c412e[_0x6166('0x12')][_0x6166('0x19')])){throw new APIBadRequestError(util[_0x6166('0x1b')](_0x6166('0x1c'),_0x5c412e['query']['channel']));}_0x7d2e35=_0x5c412e[_0x6166('0x12')][_0x6166('0x19')][_0x6166('0x1d')]();}var _0x5ecb7d=_[_0x6166('0x4b')](_0x7d2e35)+_0x6166('0x4c');var _0x433dd5=_[_0x6166('0x41')](db[_0x5ecb7d][_0x6166('0x29')],function(_0x47bdda){return{'name':_0x47bdda['fieldName'],'type':_0x47bdda['type'][_0x6166('0x2c')]};});if(!_0x5c412e[_0x6166('0x12')]['fields']){var _0x4d7d6b=['id',_0x6166('0x4d')];if(_0x7d2e35==='voice'){_0x4d7d6b[_0x6166('0x31')](_0x6166('0x2b'));if(_0x5c412e[_0x6166('0x12')][_0x6166('0x2b')]===_0x6166('0x4e')){_0x4d7d6b[_0x6166('0x31')]([_0x6166('0x4f'),_0x6166('0x50')]);}}_0x5c412e[_0x6166('0x12')]['fields']=_0x4d7d6b[_0x6166('0x21')](',');}_0x243e65=qs[_0x6166('0x2f')](_0x433dd5,_0x5c412e);if(_0x5c412e[_0x6166('0x38')][_0x6166('0x2d')]===_0x6166('0x38')){var _0x1085da={'params':{'id':_0x5c412e[_0x6166('0x38')][_0x6166('0x39')]},'query':{'section':_0x7d2e35==='voice'&&_0x5c412e[_0x6166('0x12')]['type']===_0x6166('0x4e')?_0x6166('0x51'):_[_0x6166('0x4b')](_0x7d2e35)+_0x6166('0x52'),'type':_0x5c412e[_0x6166('0x12')]['type'],'nolimit':!![],'sort':_0x6166('0x4d'),'filter':_0x5c412e['query'][_0x6166('0x53')]}};_0x1085da[_0x6166('0x12')]=Object[_0x6166('0x3d')](_0x1085da[_0x6166('0x12')],_0x5c412e[_0x6166('0x12')]);delete _0x1085da[_0x6166('0x12')]['id'];return db[_0x6166('0x54')]['getResources'](_0x1085da);}return db[_0x5ecb7d][_0x6166('0x40')](_0x243e65);})['then'](function(_0x1eb4df){_0x28fd7d['count']=_0x1eb4df[_0x6166('0xc')];_0x2b8923=_0x1eb4df[_0x6166('0x24')];return rtq[_0x6166('0x55')](_0x5c412e,_0x7d2e35);})['then'](function(_0x570858){_0xbd131f=_0x570858[_0x6166('0x24')];return rtq[_0x6166('0x56')](_0x2b8923,_0xbd131f,_0x7d2e35,_0x5c412e[_0x6166('0x12')]['type']);})[_0x6166('0x22')](function(_0x2acbba){_0x28fd7d['rows']=_0x2acbba;return _0x28fd7d;})[_0x6166('0x22')](respondWithFilteredResult(_0xc199a9,_0x243e65))['catch'](APIHandleError(_0xc199a9));}; \ No newline at end of file +var _0x892a=['fields','join','order','then','getRealtimeAgents','rows','getSortedAgentsIdsByStatus','getAgentIdsByStatus','length','map','User','rawAttributes','fieldName','type','key','role','agent','raw','push','sequelize','literal','forEach','Pause','where','merge','user','online','extraQueryConditions','assign','omit','UserProfile','getResources','findAndCountAll','filterAgentAttributes','getAgentStatus','globalStatus','pause','voice','voiceStatus','getRealtimeAgentsQueryFields','pick','getQueues','resolve','toLowerCase','startCase','Queue','outbound','dialActive','getOptions','userProfileId','QueueCampaigns','name','initializeQueues','catch','lodash','util','../../components/realtime/agents','../../components/realtime/queues','../../components/parsers/qs','../../errors/api','handleError','offset','undefined','limit','count','set','json','getAgents','getChannels','query','globalStatusFilter','pauseTypeFilter','*pause','channel','isValidChannel','format','Channel\x20parameter\x20%s\x20is\x20invalid','sort','includes','validateSortParameter'];(function(_0x188a6e,_0x1db968){var _0x3e36b0=function(_0x43383c){while(--_0x43383c){_0x188a6e['push'](_0x188a6e['shift']());}};_0x3e36b0(++_0x1db968);}(_0x892a,0x176));var _0xa892=function(_0x3a78a0,_0x44985f){_0x3a78a0=_0x3a78a0-0x0;var _0x48e917=_0x892a[_0x3a78a0];return _0x48e917;};'use strict';var _=require(_0xa892('0x0'));var util=require(_0xa892('0x1'));var rta=require(_0xa892('0x2'));var rtq=require(_0xa892('0x3'));var qs=require(_0xa892('0x4'));var utils=require('../../config/utils');var db=require('../../mysqldb')['db'];var APIBadRequestError=require(_0xa892('0x5'))['APIBadRequestError'];var APIHandleError=require('../../errors/api')[_0xa892('0x6')];function respondWithFilteredResult(_0x408dc2,_0x557cd4){return function(_0x5cced7){if(_0x5cced7){var _0x2b0721=typeof _0x557cd4[_0xa892('0x7')]===_0xa892('0x8')&&typeof _0x557cd4[_0xa892('0x9')]===_0xa892('0x8');var _0x166d4d=_0x5cced7[_0xa892('0xa')];var _0x560c99=_0x2b0721?0x0:_0x557cd4[_0xa892('0x7')];var _0x3f7404=_0x2b0721?_0x5cced7['count']:_0x557cd4['offset']+_0x557cd4[_0xa892('0x9')];var _0x2e56da;if(_0x3f7404>=_0x166d4d){_0x3f7404=_0x166d4d;_0x2e56da=0xc8;}else{_0x2e56da=0xce;}_0x408dc2['status'](_0x2e56da);return _0x408dc2[_0xa892('0xb')]('Content-Range',_0x560c99+'-'+_0x3f7404+'/'+_0x166d4d)[_0xa892('0xc')](_0x5cced7);}return null;};}exports[_0xa892('0xd')]=function(_0x47755d,_0x478aa4){var _0x48f50c={'count':0x0,'rows':[]};var _0xdf9ed1={};var _0x2d0c3a;var _0x550e2a=utils[_0xa892('0xe')]();var _0x234060;var _0x33a4fd;var _0x3eb84a=_0x47755d[_0xa892('0xf')]['globalQueueFilter'];var _0x349b50=_0x47755d[_0xa892('0xf')][_0xa892('0x10')];var _0x1e1227=_0x47755d[_0xa892('0xf')][_0xa892('0x11')];var _0xafd86d=_0x349b50==='pause'||_0x349b50===_0xa892('0x12')?!![]:![];var _0x158995=[];var _0x5bc9b3;var _0x4480aa;Promise['resolve']()['then'](function(){if(_0x47755d['query'][_0xa892('0x13')]){if(!utils[_0xa892('0x14')](_0x47755d[_0xa892('0xf')][_0xa892('0x13')])){throw new APIBadRequestError(util[_0xa892('0x15')](_0xa892('0x16'),_0x47755d[_0xa892('0xf')][_0xa892('0x13')]));}_0x2d0c3a=_0x47755d[_0xa892('0xf')][_0xa892('0x13')]['toLowerCase']();}if(!_0x47755d[_0xa892('0xf')]['sort']||!_0x47755d[_0xa892('0xf')][_0xa892('0x17')][_0xa892('0x18')]('globalStatus')){_0x47755d[_0xa892('0xf')][_0xa892('0x17')]=rta[_0xa892('0x19')](_0x47755d['query'][_0xa892('0x17')]);return;}var _0x4ede6c=rta['getUpdatedSortOptions'](_0x47755d[_0xa892('0xf')][_0xa892('0x17')]);_0x47755d[_0xa892('0xf')][_0xa892('0x17')]=_0x4ede6c[_0xa892('0x1a')][_0xa892('0x1b')](',');_0x5bc9b3=_0x4ede6c[_0xa892('0x1c')];})['then'](function(){if(!_0x3eb84a){return[];}return rta['getAgentIdsByQueues'](_0x3eb84a,_0x2d0c3a);})[_0xa892('0x1d')](function(_0x443ac8){_0x158995=_0x443ac8;return rta[_0xa892('0x1e')]();})[_0xa892('0x1d')](function(_0x1a9aa1){_0x33a4fd=_0x1a9aa1[_0xa892('0x1f')];if((!_0x349b50||_0xafd86d)&&!_0x5bc9b3){return _0x158995;}if(_0x5bc9b3&&!_0x349b50){return rta[_0xa892('0x20')](_0x33a4fd,_0x158995,_0x5bc9b3);}else{return rta[_0xa892('0x21')](_0x33a4fd,_0x158995,_0x349b50);}})[_0xa892('0x1d')](function(_0x36ee18){_0x158995=_0x36ee18;var _0x4d5bbc=![];if(_0x158995[_0xa892('0x22')]===0x0){if(_0x3eb84a||_0x349b50){_0x4d5bbc=!![];}if(_0xafd86d){_0x4d5bbc=![];}}if(_0x4d5bbc){return _0x48f50c;}var _0x29d5d3=_[_0xa892('0x23')](db[_0xa892('0x24')][_0xa892('0x25')],function(_0x18520b){return{'name':_0x18520b[_0xa892('0x26')],'type':_0x18520b[_0xa892('0x27')][_0xa892('0x28')]};});_0x47755d[_0xa892('0xf')][_0xa892('0x29')]=_0xa892('0x2a');_0xdf9ed1=qs['getOptions'](_0x29d5d3,_0x47755d);_0xdf9ed1[_0xa892('0x2b')]=!![];var _0x4bcd2d=[];if(_0x158995[_0xa892('0x22')]>0x0){_0x4bcd2d[_0xa892('0x2c')]({'id':{'$in':_0x158995}});if(_0x5bc9b3&&!_0x349b50){_0x4480aa=[db[_0xa892('0x2d')][_0xa892('0x2e')]('FIELD(id,'+_0x158995+')')];_0xdf9ed1[_0xa892('0x1c')]=_0x4480aa;}}if(_0xafd86d){_0x550e2a['forEach'](function(_0x64b4ca){var _0x50e5cd=!![];if(_0x349b50===_0xa892('0x12')&&_0x2d0c3a!==_0x64b4ca){_0x50e5cd=![];}_0x4bcd2d[_0xa892('0x2c')]({[_0x64b4ca+'Pause']:_0x50e5cd});});if(_0x1e1227){_0x4bcd2d[_0xa892('0x2c')]({'pauseType':_0x1e1227});}}else if(_0x349b50){_0x550e2a[_0xa892('0x2f')](function(_0x32cd94){_0x4bcd2d[_0xa892('0x2c')]({[_0x32cd94+_0xa892('0x30')]:![]});});}_0xdf9ed1[_0xa892('0x31')]=_[_0xa892('0x32')](_0xdf9ed1[_0xa892('0x31')],{'$and':_0x4bcd2d});if(_0x47755d['user'][_0xa892('0x29')]===_0xa892('0x33')){var _0xc49883={'params':{'id':_0x47755d[_0xa892('0x33')]['userProfileId']},'query':{'section':'Agents','role':'agent','raw':!![],'ids':_0x158995,'customSorting':_0x4480aa}};if(_0x47755d[_0xa892('0xf')][_0xa892('0x34')]){_0xc49883[_0xa892('0xf')][_0xa892('0x34')]=!![];}if(_0xafd86d){_0xc49883['query'][_0xa892('0x35')]=_0x4bcd2d;}_0xc49883[_0xa892('0xf')]=Object[_0xa892('0x36')](_0xc49883['query'],_[_0xa892('0x37')](_0x47755d['query'],'id'));return db[_0xa892('0x38')][_0xa892('0x39')](_0xc49883);}return db['User'][_0xa892('0x3a')](_0xdf9ed1);})[_0xa892('0x1d')](function(_0x4a8c8d){_0x48f50c['count']=_0x4a8c8d['count'];_0x234060=_0x4a8c8d[_0xa892('0x1f')];return _0x234060[_0xa892('0x23')](function(_0xcf2064){var _0x558e55=_['find'](_0x33a4fd,['id',_0xcf2064['id']]);if(_0x558e55){var _0x2610de=rta[_0xa892('0x3b')](_0x558e55);_[_0xa892('0x32')](_0xcf2064,_0x2610de);}_0xcf2064['globalStatus']=rta[_0xa892('0x3c')](_0xcf2064);if(_0xcf2064[_0xa892('0x3d')][_0xa892('0x18')](_0xa892('0x3e'))){_0x550e2a[_0xa892('0x2f')](function(_0xee9936){if(_0xcf2064[_0xee9936+_0xa892('0x30')]){if(_0xee9936===_0xa892('0x3f')){if(_0xcf2064['voiceStatus']!=='talking'){_0xcf2064[_0xa892('0x40')]=_0xa892('0x3e');}}else{_0xcf2064[_0xee9936+'Status']=_0xa892('0x3e');}}});}return _0xcf2064;});})[_0xa892('0x1d')](function(_0x80316c){if(!_0x5bc9b3||_0x4480aa){return _0x80316c;}return rta['sortAgentsByStatus'](_0x80316c,_0x5bc9b3);})[_0xa892('0x1d')](function(_0x1fb352){var _0x2cde27=rta[_0xa892('0x41')]();_0x48f50c[_0xa892('0x1f')]=_0x1fb352[_0xa892('0x23')](function(_0xfcb3a8){return _[_0xa892('0x42')](_0xfcb3a8,_0x2cde27);});return _0x48f50c;})[_0xa892('0x1d')](respondWithFilteredResult(_0x478aa4,_0xdf9ed1))['catch'](APIHandleError(_0x478aa4));};exports[_0xa892('0x43')]=function(_0x45cb4d,_0xf2df9){var _0x4fbc97={'count':0x0,'rows':[]};var _0x36bbee={};var _0x30871f;var _0x17ded0;var _0x4de064;Promise[_0xa892('0x44')]()[_0xa892('0x1d')](function(){if(_0x45cb4d[_0xa892('0xf')][_0xa892('0x13')]){if(!utils[_0xa892('0x14')](_0x45cb4d[_0xa892('0xf')][_0xa892('0x13')])){throw new APIBadRequestError(util[_0xa892('0x15')](_0xa892('0x16'),_0x45cb4d['query'][_0xa892('0x13')]));}_0x30871f=_0x45cb4d[_0xa892('0xf')][_0xa892('0x13')][_0xa892('0x45')]();}var _0x2aa39d=_[_0xa892('0x46')](_0x30871f)+_0xa892('0x47');var _0x52a73f=_['map'](db[_0x2aa39d][_0xa892('0x25')],function(_0x5f37d1){return{'name':_0x5f37d1[_0xa892('0x26')],'type':_0x5f37d1[_0xa892('0x27')]['key']};});if(!_0x45cb4d[_0xa892('0xf')]['fields']){var _0x1fcbce=['id','name'];if(_0x30871f==='voice'){_0x1fcbce[_0xa892('0x2c')](_0xa892('0x27'));if(_0x45cb4d['query'][_0xa892('0x27')]===_0xa892('0x48')){_0x1fcbce['push']([_0xa892('0x49'),'dialMethod']);}}_0x45cb4d[_0xa892('0xf')][_0xa892('0x1a')]=_0x1fcbce[_0xa892('0x1b')](',');}_0x36bbee=qs[_0xa892('0x4a')](_0x52a73f,_0x45cb4d);if(_0x45cb4d[_0xa892('0x33')][_0xa892('0x29')]===_0xa892('0x33')){var _0x1d8108={'params':{'id':_0x45cb4d[_0xa892('0x33')][_0xa892('0x4b')]},'query':{'section':_0x30871f===_0xa892('0x3f')&&_0x45cb4d[_0xa892('0xf')][_0xa892('0x27')]===_0xa892('0x48')?_0xa892('0x4c'):_['startCase'](_0x30871f)+'Queues','type':_0x45cb4d[_0xa892('0xf')][_0xa892('0x27')],'nolimit':!![],'sort':_0xa892('0x4d'),'filter':_0x45cb4d[_0xa892('0xf')]['filter']}};_0x1d8108[_0xa892('0xf')]=Object[_0xa892('0x36')](_0x1d8108[_0xa892('0xf')],_0x45cb4d[_0xa892('0xf')]);delete _0x1d8108['query']['id'];return db['UserProfile'][_0xa892('0x39')](_0x1d8108);}return db[_0x2aa39d][_0xa892('0x3a')](_0x36bbee);})[_0xa892('0x1d')](function(_0x52bea3){_0x4fbc97[_0xa892('0xa')]=_0x52bea3[_0xa892('0xa')];_0x17ded0=_0x52bea3[_0xa892('0x1f')];return rtq['getRealtimeQueues'](_0x45cb4d,_0x30871f);})[_0xa892('0x1d')](function(_0x3c51a0){_0x4de064=_0x3c51a0[_0xa892('0x1f')];return rtq[_0xa892('0x4e')](_0x17ded0,_0x4de064,_0x30871f,_0x45cb4d[_0xa892('0xf')]['type']);})['then'](function(_0x45560c){_0x4fbc97['rows']=_0x45560c;return _0x4fbc97;})[_0xa892('0x1d')](respondWithFilteredResult(_0xf2df9,_0x36bbee))[_0xa892('0x4f')](APIHandleError(_0xf2df9));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 8d9ea51..ffd4ae6 100644 --- a/server/api/reportAgentPreview/index.js +++ b/server/api/reportAgentPreview/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x48d933,_0x4eaabe){var _0x4caf07=function(_0x403c1f){while(--_0x403c1f){_0x48d933['push'](_0x48d933['shift']());}};_0x4caf07(++_0x4eaabe);}(_0x9c44,0x178));var _0x49c4=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0x9c44[_0x3511d3];return _0x5d6321;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x59781a,_0x460f2f){var _0x371685=function(_0x3d8069){while(--_0x3d8069){_0x59781a['push'](_0x59781a['shift']());}};_0x371685(++_0x460f2f);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x257a28,_0x2cd00d){_0x257a28=_0x257a28-0x0;var _0x13bccc=_0xcb91[_0x257a28];return _0x13bccc;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index 83eeb5a..a5c2b9d 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 _0xb1d3=['STRING','sequelize','DATE'];(function(_0x3da14f,_0x17ff80){var _0x116acb=function(_0x5c9193){while(--_0x5c9193){_0x3da14f['push'](_0x3da14f['shift']());}};_0x116acb(++_0x17ff80);}(_0xb1d3,0xe8));var _0x3b1d=function(_0x38e0b1,_0xd6963a){_0x38e0b1=_0x38e0b1-0x0;var _0x350ff7=_0xb1d3[_0x38e0b1];return _0x350ff7;};'use strict';var Sequelize=require(_0x3b1d('0x0'));module['exports']={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x3b1d('0x1')]},'uniqueid':{'type':Sequelize[_0x3b1d('0x2')]},'starttime':{'type':Sequelize[_0x3b1d('0x1')]},'responsetime':{'type':Sequelize[_0x3b1d('0x1')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x3b1d('0x2')]},'campaigntype':{'type':Sequelize[_0x3b1d('0x2')]},'membername':{'type':Sequelize[_0x3b1d('0x2')]}}; \ No newline at end of file +var _0x6b8f=['exports','STRING','DATE'];(function(_0x1ed5cf,_0x5e50b9){var _0x4a1b1c=function(_0x516981){while(--_0x516981){_0x1ed5cf['push'](_0x1ed5cf['shift']());}};_0x4a1b1c(++_0x5e50b9);}(_0x6b8f,0x1bc));var _0xf6b8=function(_0x353d8b,_0x506ca6){_0x353d8b=_0x353d8b-0x0;var _0x3cf9af=_0x6b8f[_0x353d8b];return _0x3cf9af;};'use strict';var Sequelize=require('sequelize');module[_0xf6b8('0x0')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0xf6b8('0x1')]},'scheduledat':{'type':Sequelize['DATE']},'uniqueid':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xf6b8('0x2')]},'responsetime':{'type':Sequelize[_0xf6b8('0x2')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xf6b8('0x1')]},'campaigntype':{'type':Sequelize[_0xf6b8('0x1')]},'membername':{'type':Sequelize[_0xf6b8('0x1')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index 28918cf..a7d5e1a 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 _0x507a=['ReportAgentPreview','report_agent_preview','lodash','../../config/logger','api','request-promise','path','../../config/environment','./reportAgentPreview.attributes','exports','define'];(function(_0x43384e,_0x5ba50a){var _0x267ac6=function(_0x2bc3a8){while(--_0x2bc3a8){_0x43384e['push'](_0x43384e['shift']());}};_0x267ac6(++_0x5ba50a);}(_0x507a,0x157));var _0xa507=function(_0x4cb7e4,_0x2fbc96){_0x4cb7e4=_0x4cb7e4-0x0;var _0x3b3b01=_0x507a[_0x4cb7e4];return _0x3b3b01;};'use strict';var _=require(_0xa507('0x0'));var util=require('util');var logger=require(_0xa507('0x1'))(_0xa507('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa507('0x3'));var fs=require('fs');var path=require(_0xa507('0x4'));var rimraf=require('rimraf');var config=require(_0xa507('0x5'));var attributes=require(_0xa507('0x6'));module[_0xa507('0x7')]=function(_0x464e17,_0x482fcf){return _0x464e17[_0xa507('0x8')](_0xa507('0x9'),attributes,{'tableName':_0xa507('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6615=['../../config/environment','./reportAgentPreview.attributes','define','ReportAgentPreview','report_agent_preview','../../config/logger','api','moment','bluebird','rimraf'];(function(_0x3a10b6,_0x3181f0){var _0x463dc3=function(_0x5e37f2){while(--_0x5e37f2){_0x3a10b6['push'](_0x3a10b6['shift']());}};_0x463dc3(++_0x3181f0);}(_0x6615,0x18b));var _0x5661=function(_0x117994,_0x46bbbb){_0x117994=_0x117994-0x0;var _0x40814a=_0x6615[_0x117994];return _0x40814a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5661('0x0'))(_0x5661('0x1'));var moment=require(_0x5661('0x2'));var BPromise=require(_0x5661('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5661('0x4'));var config=require(_0x5661('0x5'));var attributes=require(_0x5661('0x6'));module['exports']=function(_0x48c693,_0x5a37e8){return _0x48c693[_0x5661('0x7')](_0x5661('0x8'),attributes,{'tableName':_0x5661('0x9'),'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 dd0f5c3..bc785e2 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 _0x5915=['ReportAgentPreview','create','body','options','raw','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','client','http','request','info','request\x20sent','ReportAgentPreview,\x20%s,\x20%s,\x20%s','error','code','message','ReportAgentPreview,\x20%s,\x20%s','result','catch','CreateReportAgentPreview'];(function(_0x5834bc,_0x3d4801){var _0x3e183a=function(_0x18b023){while(--_0x18b023){_0x5834bc['push'](_0x5834bc['shift']());}};_0x3e183a(++_0x3d4801);}(_0x5915,0x14a));var _0x5591=function(_0x19f1b8,_0x2119a5){_0x19f1b8=_0x19f1b8-0x0;var _0x3bab4d=_0x5915[_0x19f1b8];return _0x3bab4d;};'use strict';var _=require(_0x5591('0x0'));var util=require(_0x5591('0x1'));var moment=require(_0x5591('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5591('0x3'));var db=require(_0x5591('0x4'))['db'];var utils=require(_0x5591('0x5'));var logger=require('../../config/logger')(_0x5591('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5591('0x7')][_0x5591('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4e6601,_0x12ea45,_0xaaaa98){return new BPromise(function(_0x9a31e4,_0x139ed2){return client[_0x5591('0x9')](_0x4e6601,_0xaaaa98)['then'](function(_0x27048b){logger[_0x5591('0xa')]('ReportAgentPreview,\x20%s,\x20%s',_0x12ea45,_0x5591('0xb'));logger['debug'](_0x5591('0xc'),_0x12ea45,_0x5591('0xb'),JSON['stringify'](_0x27048b));if(_0x27048b[_0x5591('0xd')]){if(_0x27048b['error'][_0x5591('0xe')]===0x1f4){logger[_0x5591('0xd')]('ReportAgentPreview,\x20%s,\x20%s',_0x12ea45,_0x27048b[_0x5591('0xd')][_0x5591('0xf')]);return _0x139ed2(_0x27048b[_0x5591('0xd')][_0x5591('0xf')]);}logger[_0x5591('0xd')](_0x5591('0x10'),_0x12ea45,_0x27048b['error'][_0x5591('0xf')]);return _0x9a31e4(_0x27048b[_0x5591('0xd')]['message']);}else{logger[_0x5591('0xa')](_0x5591('0x10'),_0x12ea45,_0x5591('0xb'));_0x9a31e4(_0x27048b[_0x5591('0x11')]['message']);}})[_0x5591('0x12')](function(_0x3c8eda){logger[_0x5591('0xd')](_0x5591('0x10'),_0x12ea45,_0x3c8eda);_0x139ed2(_0x3c8eda);});});}exports[_0x5591('0x13')]=function(_0x11a3c3){var _0xe21340=this;return new Promise(function(_0x184017,_0x667199){return db[_0x5591('0x14')][_0x5591('0x15')](_0x11a3c3[_0x5591('0x16')],{'raw':_0x11a3c3[_0x5591('0x17')]?_0x11a3c3[_0x5591('0x17')][_0x5591('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x15694a){logger[_0x5591('0xa')]('CreateReportAgentPreview',_0x11a3c3);logger['debug']('CreateReportAgentPreview',_0x11a3c3,JSON['stringify'](_0x15694a));_0x184017(_0x15694a);})[_0x5591('0x12')](function(_0x42e585){logger[_0x5591('0xd')](_0x5591('0x13'),_0x42e585[_0x5591('0xf')],_0x11a3c3);_0x667199(_0xe21340[_0x5591('0xd')](0x1f4,_0x42e585[_0x5591('0xf')]));});});}; \ No newline at end of file +var _0x5004=['catch','ReportAgentPreview','body','options','raw','CreateReportAgentPreview','stringify','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','error','message'];(function(_0x4b7b69,_0x3ab075){var _0x173b4c=function(_0x234d5f){while(--_0x234d5f){_0x4b7b69['push'](_0x4b7b69['shift']());}};_0x173b4c(++_0x3ab075);}(_0x5004,0x84));var _0x4500=function(_0x18588,_0x5e1235){_0x18588=_0x18588-0x0;var _0x5a21b2=_0x5004[_0x18588];return _0x5a21b2;};'use strict';var _=require('lodash');var util=require(_0x4500('0x0'));var moment=require(_0x4500('0x1'));var BPromise=require('bluebird');var rs=require(_0x4500('0x2'));var fs=require('fs');var Redis=require(_0x4500('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4500('0x4'));var logger=require(_0x4500('0x5'))(_0x4500('0x6'));var config=require(_0x4500('0x7'));var jayson=require(_0x4500('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x318684,_0x5e692e,_0x562591){return new BPromise(function(_0x20174e,_0x2d5172){return client[_0x4500('0x9')](_0x318684,_0x562591)[_0x4500('0xa')](function(_0xc3ad78){logger[_0x4500('0xb')](_0x4500('0xc'),_0x5e692e,_0x4500('0xd'));logger[_0x4500('0xe')](_0x4500('0xf'),_0x5e692e,_0x4500('0xd'),JSON['stringify'](_0xc3ad78));if(_0xc3ad78[_0x4500('0x10')]){if(_0xc3ad78[_0x4500('0x10')]['code']===0x1f4){logger['error'](_0x4500('0xc'),_0x5e692e,_0xc3ad78[_0x4500('0x10')][_0x4500('0x11')]);return _0x2d5172(_0xc3ad78[_0x4500('0x10')][_0x4500('0x11')]);}logger[_0x4500('0x10')](_0x4500('0xc'),_0x5e692e,_0xc3ad78['error']['message']);return _0x20174e(_0xc3ad78[_0x4500('0x10')][_0x4500('0x11')]);}else{logger['info'](_0x4500('0xc'),_0x5e692e,_0x4500('0xd'));_0x20174e(_0xc3ad78['result'][_0x4500('0x11')]);}})[_0x4500('0x12')](function(_0x540c6f){logger[_0x4500('0x10')](_0x4500('0xc'),_0x5e692e,_0x540c6f);_0x2d5172(_0x540c6f);});});}exports['CreateReportAgentPreview']=function(_0x46030d){var _0x19e601=this;return new Promise(function(_0x20f3ae,_0x15ef4b){return db[_0x4500('0x13')]['create'](_0x46030d[_0x4500('0x14')],{'raw':_0x46030d[_0x4500('0x15')]?_0x46030d[_0x4500('0x15')][_0x4500('0x16')]===undefined?!![]:![]:!![]})['then'](function(_0x3e07e5){logger[_0x4500('0xb')]('CreateReportAgentPreview',_0x46030d);logger[_0x4500('0xe')](_0x4500('0x17'),_0x46030d,JSON[_0x4500('0x18')](_0x3e07e5));_0x20f3ae(_0x3e07e5);})['catch'](function(_0x566859){logger[_0x4500('0x10')](_0x4500('0x17'),_0x566859[_0x4500('0x11')],_0x46030d);_0x15ef4b(_0x19e601[_0x4500('0x10')](0x1f4,_0x566859[_0x4500('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index d26776b..de9c72d 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 _0x7610=['updateVoiceQueue','/outbound','outboundChannels','/agents','agents','put','/agents/:id/capacity','agentCapacity','/telephones','telephones','/trunks','trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues','post','/chat/queues/:id/notify','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','showFaxQueues','/openchannel/queues/:id/notify','/openchannel/queues/:id','/sms/queues/:id/notify','sms','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','multer','get','/voice/channels','isAuthenticated','voiceChannels','voiceChannelMixMonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','/mail/queues','/mail/accounts','openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues','faxQueues','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues'];(function(_0x836824,_0x6582cc){var _0x9b1398=function(_0x186219){while(--_0x186219){_0x836824['push'](_0x836824['shift']());}};_0x9b1398(++_0x6582cc);}(_0x7610,0x1b3));var _0x0761=function(_0x58c033,_0x501c94){_0x58c033=_0x58c033-0x0;var _0x19ee9a=_0x7610[_0x58c033];return _0x19ee9a;};'use strict';var multer=require(_0x0761('0x0'));var util=require('util');var path=require('path');var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var controller=require('./rpc.controller');router[_0x0761('0x1')](_0x0761('0x2'),auth[_0x0761('0x3')](),controller[_0x0761('0x4')]);router[_0x0761('0x1')]('/voice/channels/:uniqueid/mixmonitor',auth['isAuthenticated'](),controller[_0x0761('0x5')]);router[_0x0761('0x1')]('/voice/channels/:uniqueid/stopmixmonitor',auth[_0x0761('0x3')](),controller['voiceChannelStopMixMonitor']);router['get'](_0x0761('0x6'),auth['isAuthenticated'](),controller[_0x0761('0x7')]);router[_0x0761('0x1')](_0x0761('0x8'),auth[_0x0761('0x3')](),controller[_0x0761('0x9')]);router[_0x0761('0x1')](_0x0761('0xa'),auth[_0x0761('0x3')](),controller['mailQueues']);router[_0x0761('0x1')](_0x0761('0xb'),auth[_0x0761('0x3')](),controller['mailAccounts']);router[_0x0761('0x1')]('/openchannel/queues',auth[_0x0761('0x3')](),controller[_0x0761('0xc')]);router[_0x0761('0x1')](_0x0761('0xd'),auth[_0x0761('0x3')](),controller[_0x0761('0xe')]);router['get'](_0x0761('0xf'),auth[_0x0761('0x3')](),controller['whatsappQueues']);router[_0x0761('0x1')]('/fax/queues',auth['isAuthenticated'](),controller[_0x0761('0x10')]);router[_0x0761('0x1')]('/voice/queues/preview/:id',auth[_0x0761('0x3')](),controller[_0x0761('0x11')]);router['get'](_0x0761('0x12'),auth[_0x0761('0x3')](),controller[_0x0761('0x13')]);router['get'](_0x0761('0x14'),auth[_0x0761('0x3')](),controller[_0x0761('0x15')]);router[_0x0761('0x1')](_0x0761('0x16'),auth[_0x0761('0x3')](),controller[_0x0761('0x17')]);router[_0x0761('0x1')]('/voice/queues/channels/:uniqueid/redirect/:exten',auth['isAuthenticated'](),controller[_0x0761('0x18')]);router['get'](_0x0761('0x19'),auth['isAuthenticated'](),controller[_0x0761('0x1a')]);router['put'](_0x0761('0x19'),auth[_0x0761('0x3')](),controller[_0x0761('0x1b')]);router[_0x0761('0x1')](_0x0761('0x1c'),auth[_0x0761('0x3')](),controller['outbound']);router[_0x0761('0x1')]('/outbound/channels',auth[_0x0761('0x3')](),controller[_0x0761('0x1d')]);router[_0x0761('0x1')](_0x0761('0x1e'),auth[_0x0761('0x3')](),controller[_0x0761('0x1f')]);router[_0x0761('0x20')](_0x0761('0x21'),auth[_0x0761('0x3')](),controller[_0x0761('0x22')]);router[_0x0761('0x1')](_0x0761('0x23'),auth[_0x0761('0x3')](),controller[_0x0761('0x24')]);router[_0x0761('0x1')](_0x0761('0x25'),auth['isAuthenticated'](),controller[_0x0761('0x26')]);router[_0x0761('0x1')](_0x0761('0x27'),auth['isAuthenticated'](),controller[_0x0761('0x28')]);router[_0x0761('0x1')](_0x0761('0x29'),auth[_0x0761('0x3')](),controller[_0x0761('0x2a')]);router['get'](_0x0761('0x2b'),auth[_0x0761('0x3')](),controller['chatQueuesWaitingInteractions']);router[_0x0761('0x1')](_0x0761('0x2c'),auth[_0x0761('0x3')](),controller[_0x0761('0x2d')]);router[_0x0761('0x1')](_0x0761('0x2e'),auth[_0x0761('0x3')](),controller[_0x0761('0x2f')]);router['get']('/openchannel/queues/:id/waitinginteractions',auth[_0x0761('0x3')](),controller[_0x0761('0x30')]);router[_0x0761('0x1')]('/sms/queues/waitinginteractions',auth['isAuthenticated'](),controller['smsQueuesWaitingInteractions']);router[_0x0761('0x1')](_0x0761('0x31'),auth[_0x0761('0x3')](),controller[_0x0761('0x32')]);router['get'](_0x0761('0x33'),auth[_0x0761('0x3')](),controller[_0x0761('0x34')]);router['post'](_0x0761('0x35'),auth['isAuthenticated'](),controller[_0x0761('0x36')](_0x0761('0x37')));router[_0x0761('0x1')](_0x0761('0x38'),auth[_0x0761('0x3')](),controller[_0x0761('0x39')]);router[_0x0761('0x3a')](_0x0761('0x3b'),auth[_0x0761('0x3')](),controller[_0x0761('0x36')](_0x0761('0x3c')));router['get'](_0x0761('0x3d'),auth[_0x0761('0x3')](),controller[_0x0761('0x3e')]);router[_0x0761('0x3a')](_0x0761('0x3f'),auth[_0x0761('0x3')](),controller['queueNotify']('fax'));router['get']('/fax/queues/:id',auth[_0x0761('0x3')](),controller[_0x0761('0x40')]);router['post'](_0x0761('0x41'),auth['isAuthenticated'](),controller[_0x0761('0x36')]('openchannel'));router[_0x0761('0x1')](_0x0761('0x42'),auth['isAuthenticated'](),controller['showOpenchannelQueues']);router['post'](_0x0761('0x43'),auth[_0x0761('0x3')](),controller[_0x0761('0x36')](_0x0761('0x44')));router['post']('/whatsapp/queues/:id/notify',auth[_0x0761('0x3')](),controller['queueNotify'](_0x0761('0x45')));router[_0x0761('0x1')](_0x0761('0x46'),auth[_0x0761('0x3')](),controller[_0x0761('0x47')]);router[_0x0761('0x1')](_0x0761('0x48'),auth['isAuthenticated'](),controller[_0x0761('0x49')]);router[_0x0761('0x3a')](_0x0761('0x4a'),auth[_0x0761('0x3')](),controller[_0x0761('0x4b')]);module[_0x0761('0x4c')]=router; \ No newline at end of file +var _0x9847=['whatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','/mail/queues/:id/notify','queueNotify','/mail/queues/:id','post','/chat/queues/:id/notify','/chat/queues/:id','showChatQueues','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','util','express','../../components/auth/service','./rpc.controller','get','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','/mail/queues','/mail/accounts','mailAccounts','/sms/queues','smsQueues','/whatsapp/queues','whatsappQueues','/fax/queues','/voice/queues/preview/:id','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','showVoiceQueues','put','updateVoiceQueue','/outbound','outbound','/outbound/channels','outboundChannels','/agents/:id/capacity','/telephones','telephones','/trunks','trunks','/campaigns','/fax/accounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions'];(function(_0xf79bae,_0x263b2a){var _0x5d2cb7=function(_0x27c86b){while(--_0x27c86b){_0xf79bae['push'](_0xf79bae['shift']());}};_0x5d2cb7(++_0x263b2a);}(_0x9847,0xf9));var _0x7984=function(_0x2bdcfd,_0x32697d){_0x2bdcfd=_0x2bdcfd-0x0;var _0x53a635=_0x9847[_0x2bdcfd];return _0x53a635;};'use strict';var multer=require('multer');var util=require(_0x7984('0x0'));var path=require('path');var express=require(_0x7984('0x1'));var router=express['Router']();var auth=require(_0x7984('0x2'));var controller=require(_0x7984('0x3'));router[_0x7984('0x4')](_0x7984('0x5'),auth[_0x7984('0x6')](),controller[_0x7984('0x7')]);router[_0x7984('0x4')](_0x7984('0x8'),auth[_0x7984('0x6')](),controller['voiceChannelMixMonitor']);router[_0x7984('0x4')](_0x7984('0x9'),auth[_0x7984('0x6')](),controller[_0x7984('0xa')]);router['get'](_0x7984('0xb'),auth[_0x7984('0x6')](),controller[_0x7984('0xc')]);router[_0x7984('0x4')](_0x7984('0xd'),auth[_0x7984('0x6')](),controller[_0x7984('0xe')]);router[_0x7984('0x4')](_0x7984('0xf'),auth[_0x7984('0x6')](),controller['mailQueues']);router['get'](_0x7984('0x10'),auth[_0x7984('0x6')](),controller[_0x7984('0x11')]);router[_0x7984('0x4')]('/openchannel/queues',auth[_0x7984('0x6')](),controller['openchannelQueues']);router[_0x7984('0x4')](_0x7984('0x12'),auth[_0x7984('0x6')](),controller[_0x7984('0x13')]);router[_0x7984('0x4')](_0x7984('0x14'),auth[_0x7984('0x6')](),controller[_0x7984('0x15')]);router[_0x7984('0x4')](_0x7984('0x16'),auth[_0x7984('0x6')](),controller['faxQueues']);router[_0x7984('0x4')](_0x7984('0x17'),auth[_0x7984('0x6')](),controller['voiceQueuesPreview']);router[_0x7984('0x4')](_0x7984('0x18'),auth['isAuthenticated'](),controller[_0x7984('0x19')]);router[_0x7984('0x4')]('/voice/queues/channels/:uniqueid',auth['isAuthenticated'](),controller['voiceQueuesChannel']);router[_0x7984('0x4')](_0x7984('0x1a'),auth[_0x7984('0x6')](),controller[_0x7984('0x1b')]);router['get'](_0x7984('0x1c'),auth[_0x7984('0x6')](),controller[_0x7984('0x1d')]);router[_0x7984('0x4')]('/voice/queues/:id',auth[_0x7984('0x6')](),controller[_0x7984('0x1e')]);router[_0x7984('0x1f')]('/voice/queues/:id',auth['isAuthenticated'](),controller[_0x7984('0x20')]);router['get'](_0x7984('0x21'),auth[_0x7984('0x6')](),controller[_0x7984('0x22')]);router[_0x7984('0x4')](_0x7984('0x23'),auth[_0x7984('0x6')](),controller[_0x7984('0x24')]);router['get']('/agents',auth[_0x7984('0x6')](),controller['agents']);router[_0x7984('0x1f')](_0x7984('0x25'),auth['isAuthenticated'](),controller['agentCapacity']);router[_0x7984('0x4')](_0x7984('0x26'),auth[_0x7984('0x6')](),controller[_0x7984('0x27')]);router['get'](_0x7984('0x28'),auth['isAuthenticated'](),controller[_0x7984('0x29')]);router[_0x7984('0x4')](_0x7984('0x2a'),auth[_0x7984('0x6')](),controller['campaigns']);router['get'](_0x7984('0x2b'),auth[_0x7984('0x6')](),controller['faxAccounts']);router[_0x7984('0x4')](_0x7984('0x2c'),auth[_0x7984('0x6')](),controller[_0x7984('0x2d')]);router[_0x7984('0x4')](_0x7984('0x2e'),auth['isAuthenticated'](),controller[_0x7984('0x2f')]);router[_0x7984('0x4')]('/openchannel/queues/waitinginteractions',auth['isAuthenticated'](),controller['openchannelQueuesWaitingInteractions']);router[_0x7984('0x4')]('/openchannel/queues/:id/waitinginteractions',auth[_0x7984('0x6')](),controller['openchannelQueuesIdWaitingInteractions']);router[_0x7984('0x4')](_0x7984('0x30'),auth[_0x7984('0x6')](),controller[_0x7984('0x31')]);router[_0x7984('0x4')](_0x7984('0x32'),auth['isAuthenticated'](),controller[_0x7984('0x33')]);router[_0x7984('0x4')]('/fax/queues/waitinginteractions',auth[_0x7984('0x6')](),controller[_0x7984('0x34')]);router['post'](_0x7984('0x35'),auth[_0x7984('0x6')](),controller[_0x7984('0x36')]('mail'));router[_0x7984('0x4')](_0x7984('0x37'),auth[_0x7984('0x6')](),controller['showMailQueues']);router[_0x7984('0x38')](_0x7984('0x39'),auth[_0x7984('0x6')](),controller[_0x7984('0x36')]('chat'));router[_0x7984('0x4')](_0x7984('0x3a'),auth[_0x7984('0x6')](),controller[_0x7984('0x3b')]);router[_0x7984('0x38')]('/fax/queues/:id/notify',auth[_0x7984('0x6')](),controller[_0x7984('0x36')]('fax'));router[_0x7984('0x4')](_0x7984('0x3c'),auth[_0x7984('0x6')](),controller[_0x7984('0x3d')]);router[_0x7984('0x38')]('/openchannel/queues/:id/notify',auth[_0x7984('0x6')](),controller[_0x7984('0x36')]('openchannel'));router['get'](_0x7984('0x3e'),auth['isAuthenticated'](),controller[_0x7984('0x3f')]);router[_0x7984('0x38')](_0x7984('0x40'),auth[_0x7984('0x6')](),controller[_0x7984('0x36')](_0x7984('0x41')));router[_0x7984('0x38')](_0x7984('0x42'),auth['isAuthenticated'](),controller[_0x7984('0x36')](_0x7984('0x43')));router[_0x7984('0x4')](_0x7984('0x44'),auth[_0x7984('0x6')](),controller[_0x7984('0x45')]);router[_0x7984('0x4')](_0x7984('0x46'),auth['isAuthenticated'](),controller[_0x7984('0x47')]);router[_0x7984('0x38')](_0x7984('0x48'),auth[_0x7984('0x6')](),controller[_0x7984('0x49')]);module[_0x7984('0x4a')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index a6dcb26..1ffc160 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 _0xa9e0=['mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','filter','map','queue_id','uniq','indexOf','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','queueNotify','chat','Website','Account','findOne','\x20Queue\x20not\x20found','Message','Interaction','\x20Message\x20not\x20found','MessageId','InteractionId','From','QueueId','create','Start','queue','queueTransferTimeout','*,*,*,*','agentNotify','Channel\x20field\x20is\x20mandatory','channel','capitalize','User','messageId','update','bluebird','moment','lodash','../../config/logger','jayson/promise','client','http','then','error','code','catch','status','sendStatus','stack','name','send','isNil','find','rows','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','voiceQueues','showVoiceQueues','VoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','Agents','agentCapacity','interaction','user','hasOwnProperty','MemberReport','findAll','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','INTERACTION','interface','SIP/%s','agent','internal','AgentCapacity','telephones','Telephones','Trunks','campaigns','ChatQueues','mailQueues','showMailQueues','MailQueues','mailAccounts','MailAccounts','openchannelQueues','OpenchannelQueues','SmsQueues','showSmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0xa9e0[_0x4e1d03];return _0x362d4b;};'use strict';var BPromise=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var util=require('util');var db=require('../../mysqldb')['db'];var logger=require(_0x0a9e('0x3'))('api');var jayson=require(_0x0a9e('0x4'));var amiClient=jayson[_0x0a9e('0x5')][_0x0a9e('0x6')]({'port':0x232a});var mailClient=jayson[_0x0a9e('0x5')][_0x0a9e('0x6')]({'port':0x232b});var routingClient=jayson['client'][_0x0a9e('0x6')]({'port':0x232c});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){var _0x56465b=_0x5f41ea?_0x5f41ea:amiClient;return _0x56465b['request'](_0x441e3a,_0x2cc193)[_0x0a9e('0x7')](function(_0xf81284){if(_0xf81284[_0x0a9e('0x8')]){if(_0xf81284[_0x0a9e('0x8')][_0x0a9e('0x9')]===0x1f4){return _0xe42b77(_0xf81284[_0x0a9e('0x8')]['message']);}return _0x503809(_0xf81284['error']['message']);}else{_0x503809(_0xf81284['result']);}})[_0x0a9e('0xa')](function(_0x36471c){_0xe42b77(_0x36471c);});});}function respondWithResult(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xc8;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0xb')](_0x26d672)['json'](_0x32d742);}return _0xd5b662[_0x0a9e('0xc')](0x194);};}function handleError(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0x1f4;return function(_0x281129){logger[_0x0a9e('0x8')](_0x281129[_0x0a9e('0xd')]);if(_0x281129['name']){delete _0x281129[_0x0a9e('0xe')];}_0x239b12['status'](_0x2b4227)[_0x0a9e('0xf')](_0x281129);};}function findById(_0x519dfd){return function(_0x16033c){if(!_[_0x0a9e('0x10')](_0x519dfd)&&!_['isNil'](_0x16033c)&&!_[_0x0a9e('0x10')](_0x16033c['rows'])){return _[_0x0a9e('0x11')](_0x16033c[_0x0a9e('0x12')],function(_0x106033){return _0x106033['id']==_0x519dfd;});}return null;};}exports[_0x0a9e('0x13')]=function(_0x31b1ca,_0x2eb11f){return respondWithRpcPromise(_0x0a9e('0x14'),_0x31b1ca[_0x0a9e('0x15')])[_0x0a9e('0x7')](respondWithResult(_0x2eb11f,null))[_0x0a9e('0xa')](handleError(_0x2eb11f,null));};exports[_0x0a9e('0x16')]=function(_0x105080,_0x4bb1e3){return respondWithRpcPromise(_0x0a9e('0x17'),_[_0x0a9e('0x18')](_0x105080['query'],_0x105080[_0x0a9e('0x19')]))['then'](respondWithResult(_0x4bb1e3,null))['catch'](handleError(_0x4bb1e3,null));};exports[_0x0a9e('0x1a')]=function(_0x432e56,_0x38e7c4){return respondWithRpcPromise(_0x0a9e('0x1b'),_['merge'](_0x432e56[_0x0a9e('0x15')],_0x432e56[_0x0a9e('0x19')]))[_0x0a9e('0x7')](respondWithResult(_0x38e7c4,null))[_0x0a9e('0xa')](handleError(_0x38e7c4,null));};exports[_0x0a9e('0x1c')]=function(_0x42ac8f,_0x16b1ca){return respondWithRpcPromise('VoiceQueues',_0x42ac8f['query'])[_0x0a9e('0x7')](respondWithResult(_0x16b1ca,null))[_0x0a9e('0xa')](handleError(_0x16b1ca,null));};exports[_0x0a9e('0x1d')]=function(_0x33161b,_0x526cf3){return respondWithRpcPromise(_0x0a9e('0x1e'),_0x33161b['query'])[_0x0a9e('0x7')](findById(_0x33161b['params']['id']))[_0x0a9e('0x7')](respondWithResult(_0x526cf3,null))[_0x0a9e('0xa')](handleError(_0x526cf3,null));};exports[_0x0a9e('0x1f')]=function(_0x14433c,_0x140511){return respondWithRpcPromise(_0x0a9e('0x20'),_[_0x0a9e('0x18')](_0x14433c[_0x0a9e('0x21')],_0x14433c['params']))[_0x0a9e('0x7')](respondWithResult(_0x140511,null))[_0x0a9e('0xa')](handleError(_0x140511,null));};exports[_0x0a9e('0x22')]=function(_0x2ec755,_0x5c877d){return respondWithRpcPromise(_0x0a9e('0x23'),_[_0x0a9e('0x18')](_0x2ec755[_0x0a9e('0x15')],_0x2ec755[_0x0a9e('0x19')]))[_0x0a9e('0x7')](respondWithResult(_0x5c877d,null))[_0x0a9e('0xa')](handleError(_0x5c877d,null));};exports[_0x0a9e('0x24')]=function(_0x2e8759,_0x1dbde2){return respondWithRpcPromise('VoiceQueuesChannels',_0x2e8759[_0x0a9e('0x15')])['then'](respondWithResult(_0x1dbde2,null))[_0x0a9e('0xa')](handleError(_0x1dbde2,null));};exports[_0x0a9e('0x25')]=function(_0x1122db,_0x33bdb7){return respondWithRpcPromise(_0x0a9e('0x26'),_['merge'](_0x1122db[_0x0a9e('0x15')],_0x1122db[_0x0a9e('0x19')]))[_0x0a9e('0x7')](respondWithResult(_0x33bdb7,null))[_0x0a9e('0xa')](handleError(_0x33bdb7,null));};exports[_0x0a9e('0x27')]=function(_0x409319,_0x332d35){return respondWithRpcPromise(_0x0a9e('0x28'),_['merge'](_0x409319[_0x0a9e('0x15')],_0x409319['params']))[_0x0a9e('0x7')](respondWithResult(_0x332d35,null))[_0x0a9e('0xa')](handleError(_0x332d35,null));};exports[_0x0a9e('0x29')]=function(_0x3f3d41,_0x567193){return respondWithRpcPromise(_0x0a9e('0x2a'),_[_0x0a9e('0x18')](_0x3f3d41[_0x0a9e('0x15')],_0x3f3d41[_0x0a9e('0x19')]))['then'](respondWithResult(_0x567193,null))['catch'](handleError(_0x567193,null));};exports[_0x0a9e('0x2b')]=function(_0x5640eb,_0x24936a){return respondWithRpcPromise(_0x0a9e('0x2c'),_0x5640eb[_0x0a9e('0x15')])[_0x0a9e('0x7')](respondWithResult(_0x24936a,null))['catch'](handleError(_0x24936a,null));};exports[_0x0a9e('0x2d')]=function(_0x3bfce8,_0x3cae){return respondWithRpcPromise('OutboundChannels',_0x3bfce8[_0x0a9e('0x15')])[_0x0a9e('0x7')](respondWithResult(_0x3cae,null))[_0x0a9e('0xa')](handleError(_0x3cae,null));};exports['agents']=function(_0x546ef8,_0x11b61d){var _0x40d766;return respondWithRpcPromise('Agents',_0x546ef8[_0x0a9e('0x15')])[_0x0a9e('0x7')](function(_0x2e1b3a){_0x40d766=_0x2e1b3a;return respondWithRpcPromise(_0x0a9e('0x2e'),_0x546ef8['query'],routingClient);})['then'](function(_0x15e37d){return _[_0x0a9e('0x18')]({},_0x15e37d,_0x40d766);})['then'](respondWithResult(_0x11b61d,null))[_0x0a9e('0xa')](handleError(_0x11b61d,null));};exports[_0x0a9e('0x2f')]=function(_0x1459bb,_0x5b4f5e){if(_0x1459bb[_0x0a9e('0x21')]&&_0x1459bb[_0x0a9e('0x21')][_0x0a9e('0x30')]&&_0x1459bb[_0x0a9e('0x31')]&&_0x1459bb[_0x0a9e('0x31')][_0x0a9e('0xe')]){for(var _0x2881b3 in _0x1459bb[_0x0a9e('0x21')][_0x0a9e('0x30')]){if(_0x1459bb[_0x0a9e('0x21')][_0x0a9e('0x30')][_0x0a9e('0x32')](_0x2881b3)){db[_0x0a9e('0x33')][_0x0a9e('0x34')]({'where':{'channel':_0x2881b3,'membername':_0x1459bb[_0x0a9e('0x31')]['name'],'type':'INTERACTION','exitAt':null,'uniqueid':_0x1459bb[_0x0a9e('0x21')][_0x0a9e('0x30')][_0x2881b3]&&_0x1459bb[_0x0a9e('0x21')][_0x0a9e('0x30')][_0x2881b3][_0x0a9e('0x35')]?{'$notIn':_0x1459bb[_0x0a9e('0x21')][_0x0a9e('0x30')][_0x2881b3]}:{'$ne':null}}})[_0x0a9e('0x7')](function(_0x432fcc){var _0x25c6e6=moment()[_0x0a9e('0x36')](_0x0a9e('0x37'));for(var _0x5026aa=0x0,_0x117c99=_0x432fcc[_0x0a9e('0x35')];_0x5026aa<_0x117c99;_0x5026aa+=0x1){_0x432fcc[_0x5026aa][_0x0a9e('0x38')]({'exitAt':_0x25c6e6});}});for(var _0xfbd5ad=0x0;_0xfbd5ad<_0x1459bb[_0x0a9e('0x21')][_0x0a9e('0x30')][_0x2881b3][_0x0a9e('0x35')];_0xfbd5ad+=0x1){db[_0x0a9e('0x33')]['findOrCreate']({'where':{'channel':_0x2881b3,'membername':_0x1459bb[_0x0a9e('0x31')]['name'],'type':_0x0a9e('0x39'),'uniqueid':_0x1459bb[_0x0a9e('0x21')][_0x0a9e('0x30')][_0x2881b3][_0xfbd5ad],'exitAt':null},'defaults':{'channel':_0x2881b3,'membername':_0x1459bb['user'][_0x0a9e('0xe')],'interface':_[_0x0a9e('0x10')](_0x1459bb[_0x0a9e('0x31')][_0x0a9e('0x3a')])?util[_0x0a9e('0x36')](_0x0a9e('0x3b'),_0x1459bb[_0x0a9e('0x31')]['name']):_0x1459bb[_0x0a9e('0x31')][_0x0a9e('0x3a')],'type':_0x0a9e('0x39'),'enterAt':moment()[_0x0a9e('0x36')](_0x0a9e('0x37')),'role':_0x0a9e('0x3c'),'internal':_0x1459bb[_0x0a9e('0x31')][_0x0a9e('0x3d')],'uniqueid':_0x1459bb[_0x0a9e('0x21')]['interaction'][_0x2881b3][_0xfbd5ad]}});}}}}return respondWithRpcPromise(_0x0a9e('0x3e'),{'id':_0x1459bb[_0x0a9e('0x19')]['id'],'capacity':_0x1459bb['body']['capacity']},routingClient)['then'](respondWithResult(_0x5b4f5e,null))[_0x0a9e('0xa')](handleError(_0x5b4f5e,null));};exports[_0x0a9e('0x3f')]=function(_0x37edaa,_0x11545a){return respondWithRpcPromise(_0x0a9e('0x40'),_0x37edaa[_0x0a9e('0x15')])[_0x0a9e('0x7')](respondWithResult(_0x11545a,null))[_0x0a9e('0xa')](handleError(_0x11545a,null));};exports['trunks']=function(_0x4b1b9f,_0x53975a){return respondWithRpcPromise(_0x0a9e('0x41'),_0x4b1b9f[_0x0a9e('0x15')])[_0x0a9e('0x7')](respondWithResult(_0x53975a,null))['catch'](handleError(_0x53975a,null));};exports[_0x0a9e('0x42')]=function(_0x161aa7,_0x53d113){return respondWithRpcPromise('Campaigns',_0x161aa7[_0x0a9e('0x15')])['then'](respondWithResult(_0x53d113,null))[_0x0a9e('0xa')](handleError(_0x53d113,null));};exports['chatQueues']=function(_0x2e5e62,_0x3c20b2){return respondWithRpcPromise(_0x0a9e('0x43'),_0x2e5e62['query'],routingClient)[_0x0a9e('0x7')](respondWithResult(_0x3c20b2,null))[_0x0a9e('0xa')](handleError(_0x3c20b2,null));};exports['showChatQueues']=function(_0x50f687,_0x128aa6){return respondWithRpcPromise(_0x0a9e('0x43'),_0x50f687['query'],routingClient)[_0x0a9e('0x7')](findById(_0x50f687['params']['id']))[_0x0a9e('0x7')](respondWithResult(_0x128aa6,null))['catch'](handleError(_0x128aa6,null));};exports[_0x0a9e('0x44')]=function(_0x4a6deb,_0x5da27d){return respondWithRpcPromise('MailQueues',_0x4a6deb[_0x0a9e('0x15')],routingClient)['then'](respondWithResult(_0x5da27d,null))[_0x0a9e('0xa')](handleError(_0x5da27d,null));};exports[_0x0a9e('0x45')]=function(_0x3cfd00,_0x19b4df){return respondWithRpcPromise(_0x0a9e('0x46'),_0x3cfd00[_0x0a9e('0x15')],routingClient)[_0x0a9e('0x7')](findById(_0x3cfd00[_0x0a9e('0x19')]['id']))['then'](respondWithResult(_0x19b4df,null))[_0x0a9e('0xa')](handleError(_0x19b4df,null));};exports[_0x0a9e('0x47')]=function(_0x2642bb,_0x30c491){return respondWithRpcPromise(_0x0a9e('0x48'),_0x2642bb[_0x0a9e('0x15')],mailClient)['then'](respondWithResult(_0x30c491,null))[_0x0a9e('0xa')](handleError(_0x30c491,null));};exports[_0x0a9e('0x49')]=function(_0x5239ef,_0x3649cc){return respondWithRpcPromise('OpenchannelQueues',_0x5239ef[_0x0a9e('0x15')],routingClient)['then'](respondWithResult(_0x3649cc,null))['catch'](handleError(_0x3649cc,null));};exports['showOpenchannelQueues']=function(_0x273cb5,_0x49d231){return respondWithRpcPromise(_0x0a9e('0x4a'),_0x273cb5[_0x0a9e('0x15')],routingClient)[_0x0a9e('0x7')](findById(_0x273cb5[_0x0a9e('0x19')]['id']))[_0x0a9e('0x7')](respondWithResult(_0x49d231,null))[_0x0a9e('0xa')](handleError(_0x49d231,null));};exports['smsQueues']=function(_0x1627a7,_0x5854cc){return respondWithRpcPromise(_0x0a9e('0x4b'),_0x1627a7[_0x0a9e('0x15')],routingClient)[_0x0a9e('0x7')](respondWithResult(_0x5854cc,null))['catch'](handleError(_0x5854cc,null));};exports[_0x0a9e('0x4c')]=function(_0x156f1c,_0x119677){return respondWithRpcPromise(_0x0a9e('0x4b'),_0x156f1c['query'],routingClient)[_0x0a9e('0x7')](findById(_0x156f1c[_0x0a9e('0x19')]['id']))['then'](respondWithResult(_0x119677,null))[_0x0a9e('0xa')](handleError(_0x119677,null));};exports[_0x0a9e('0x4d')]=function(_0x88dcbf,_0x409b29){return respondWithRpcPromise(_0x0a9e('0x4e'),_0x88dcbf['query'],routingClient)[_0x0a9e('0x7')](respondWithResult(_0x409b29,null))[_0x0a9e('0xa')](handleError(_0x409b29,null));};exports[_0x0a9e('0x4f')]=function(_0x47bb43,_0x3528b7){return respondWithRpcPromise('WhatsappQueues',_0x47bb43['query'],routingClient)[_0x0a9e('0x7')](findById(_0x47bb43[_0x0a9e('0x19')]['id']))[_0x0a9e('0x7')](respondWithResult(_0x3528b7,null))[_0x0a9e('0xa')](handleError(_0x3528b7,null));};exports[_0x0a9e('0x50')]=function(_0xc8c264,_0x387489){return respondWithRpcPromise(_0x0a9e('0x51'),_0xc8c264[_0x0a9e('0x15')],routingClient)[_0x0a9e('0x7')](respondWithResult(_0x387489,null))[_0x0a9e('0xa')](handleError(_0x387489,null));};exports[_0x0a9e('0x52')]=function(_0x2bbb86,_0x2b8192){return respondWithRpcPromise(_0x0a9e('0x51'),_0x2bbb86[_0x0a9e('0x15')],routingClient)[_0x0a9e('0x7')](findById(_0x2bbb86[_0x0a9e('0x19')]['id']))['then'](respondWithResult(_0x2b8192,null))[_0x0a9e('0xa')](handleError(_0x2b8192,null));};exports[_0x0a9e('0x53')]=function(_0x243d12,_0x4edbb0){return respondWithRpcPromise(_0x0a9e('0x54'),_0x243d12[_0x0a9e('0x15')])['then'](respondWithResult(_0x4edbb0,null))[_0x0a9e('0xa')](handleError(_0x4edbb0,null));};exports[_0x0a9e('0x55')]=function(_0x3ef315,_0x427946){return respondWithRpcPromise(_0x0a9e('0x56'),_0x3ef315['query'],routingClient)['then'](respondWithResult(_0x427946,null))['catch'](handleError(_0x427946,null));};exports[_0x0a9e('0x57')]=function(_0x18bf5d,_0x1104ad){return respondWithRpcPromise(_0x0a9e('0x58'),_0x18bf5d[_0x0a9e('0x15')],routingClient)[_0x0a9e('0x7')](respondWithResult(_0x1104ad,null))[_0x0a9e('0xa')](handleError(_0x1104ad,null));};exports[_0x0a9e('0x59')]=function(_0x5512d1,_0x235f8f){return respondWithRpcPromise(_0x0a9e('0x5a'),_0x5512d1[_0x0a9e('0x15')],routingClient)['then'](respondWithResult(_0x235f8f,null))[_0x0a9e('0xa')](handleError(_0x235f8f,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x4437ff,_0x44351d){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x4437ff[_0x0a9e('0x15')],routingClient)[_0x0a9e('0x7')](function(_0x2cc7a7){if(_0x4437ff[_0x0a9e('0x15')]['type']!==undefined){var _0x1d442c=_(_0x2cc7a7[_0x0a9e('0x12')])[_0x0a9e('0x5b')]([_0x4437ff[_0x0a9e('0x15')]['type'],_0x4437ff[_0x0a9e('0x19')]['id']])[_0x0a9e('0x5c')](_0x0a9e('0x5d'))[_0x0a9e('0x5e')]()['value']();return _0x2cc7a7[_0x0a9e('0x12')][_0x0a9e('0x5b')](function(_0x30a4c7){return _0x1d442c[_0x0a9e('0x5f')](_0x30a4c7[_0x0a9e('0x5d')])>-0x1;});}else{return _0x2cc7a7[_0x0a9e('0x12')][_0x0a9e('0x5b')](function(_0x3df0e3){return _0x3df0e3[_0x0a9e('0x5d')]===parseInt(_0x4437ff[_0x0a9e('0x19')]['id']);});}})[_0x0a9e('0x7')](respondWithResult(_0x44351d,null))[_0x0a9e('0xa')](handleError(_0x44351d,null));};exports[_0x0a9e('0x60')]=function(_0xe0749e,_0x5b35db){return respondWithRpcPromise(_0x0a9e('0x61'),_0xe0749e[_0x0a9e('0x15')],routingClient)[_0x0a9e('0x7')](respondWithResult(_0x5b35db,null))['catch'](handleError(_0x5b35db,null));};exports[_0x0a9e('0x62')]=function(_0x33dda0,_0x8cea96){return respondWithRpcPromise(_0x0a9e('0x63'),_0x33dda0['query'],routingClient)['then'](respondWithResult(_0x8cea96,null))[_0x0a9e('0xa')](handleError(_0x8cea96,null));};exports[_0x0a9e('0x64')]=function(_0x4c54fa,_0x45108c){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x4c54fa[_0x0a9e('0x15')],routingClient)[_0x0a9e('0x7')](respondWithResult(_0x45108c,null))['catch'](handleError(_0x45108c,null));};exports[_0x0a9e('0x65')]=function(_0x41cf12){return function(_0x2d2286,_0x42b959){var _0x3755fe,_0x1f42a0;var _0x444f1f=_['capitalize'](_0x41cf12);var _0x2973d3=_0x41cf12===_0x0a9e('0x66')?_0x0a9e('0x67'):_0x0a9e('0x68');return db[_0x444f1f+'Queue'][_0x0a9e('0x69')]({'raw':!![],'where':{'id':_0x2d2286[_0x0a9e('0x19')]['id']}})['then'](function(_0x1d6834){if(_['isNil'](_0x1d6834)){throw new Error(_0x444f1f+_0x0a9e('0x6a'));}_0x3755fe=_0x1d6834;return db[_0x444f1f+_0x0a9e('0x6b')][_0x0a9e('0x69')]({'where':{'id':_0x2d2286[_0x0a9e('0x21')]['messageId']},'include':[{'model':db[_0x444f1f+'Interaction'],'as':_0x0a9e('0x6c')},{'model':db[_0x444f1f+_0x2973d3],'as':_0x0a9e('0x68')}]});})[_0x0a9e('0x7')](function(_0x5ac73d){if(_[_0x0a9e('0x10')](_0x5ac73d)){throw new Error(_0x444f1f+_0x0a9e('0x6d'));}_0x1f42a0=_0x5ac73d;return _0x5ac73d['update']({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0xf0a802={'uniqueid':_0x41cf12+'.'+_0x1f42a0['id']+'.'+_0x1f42a0['Interaction']['id'],'FromUserId':_0x2d2286['user']['id'],'type':'queue'};_0xf0a802[_0x444f1f+_0x0a9e('0x6e')]=_0x1f42a0['id'];_0xf0a802[_0x444f1f+_0x0a9e('0x6f')]=_0x1f42a0[_0x0a9e('0x6c')]['id'];_0xf0a802[_0x0a9e('0x70')+_0x444f1f+_0x2973d3+'Id']=_0x1f42a0[_0x0a9e('0x68')]['id'];_0xf0a802['To'+_0x444f1f+_0x0a9e('0x71')]=_0x3755fe['id'];return db[_0x444f1f+'TransferReport'][_0x0a9e('0x72')](_0xf0a802);})['then'](function(){return respondWithRpcPromise(_0x0a9e('0x73'),{'channel':_0x41cf12,'interaction':_0x1f42a0[_0x0a9e('0x6c')],'message':_0x1f42a0,'account':_0x1f42a0[_0x0a9e('0x68')],'applications':[{'id':0x0,'priority':0x1,'app':_0x0a9e('0x74'),'appdata':_0x3755fe['name']+','+(_0x1f42a0[_0x0a9e('0x68')][_0x0a9e('0x75')]||0x12c),'interval':_0x0a9e('0x76')}],'transfer':!![]},routingClient);})['then'](respondWithResult(_0x42b959,null))[_0x0a9e('0xa')](handleError(_0x42b959,null));};};exports[_0x0a9e('0x77')]=function(_0x2a563d,_0x22063c){var _0x255e49,_0x1910bf;if(_[_0x0a9e('0x10')](_0x2a563d[_0x0a9e('0x21')]['channel'])){throw new Error(_0x0a9e('0x78'));}var _0x3325c5=_0x2a563d['body'][_0x0a9e('0x79')];var _0x982340=_[_0x0a9e('0x7a')](_0x3325c5);var _0x5a26c8=_0x3325c5===_0x0a9e('0x66')?'Website':_0x0a9e('0x68');return db[_0x0a9e('0x7b')][_0x0a9e('0x69')]({'raw':!![],'where':{'id':_0x2a563d[_0x0a9e('0x19')]['id'],'role':_0x0a9e('0x3c')}})[_0x0a9e('0x7')](function(_0x16a039){if(_[_0x0a9e('0x10')](_0x16a039)){throw new Error('Agent\x20not\x20found');}_0x255e49=_0x16a039;return db[_0x982340+_0x0a9e('0x6b')][_0x0a9e('0x69')]({'where':{'id':_0x2a563d[_0x0a9e('0x21')][_0x0a9e('0x7c')]},'include':[{'model':db[_0x982340+_0x0a9e('0x6c')],'as':_0x0a9e('0x6c')},{'model':db[_0x982340+_0x5a26c8],'as':_0x0a9e('0x68')}]});})[_0x0a9e('0x7')](function(_0x1808ba){if(_[_0x0a9e('0x10')](_0x1808ba)){throw new Error(_0x982340+_0x0a9e('0x6d'));}_0x1910bf=_0x1808ba;return _0x1808ba[_0x0a9e('0x7d')]({'read':0x0,'readAt':null,'UserId':null});})[_0x0a9e('0x7')](function(){var _0x4989f9={'uniqueid':_0x3325c5+'.'+_0x1910bf['id']+'.'+_0x1910bf[_0x0a9e('0x6c')]['id'],'FromUserId':_0x2a563d[_0x0a9e('0x31')]['id'],'type':_0x0a9e('0x3c'),'ToUserId':_0x255e49['id']};_0x4989f9[_0x982340+_0x0a9e('0x6e')]=_0x1910bf['id'];_0x4989f9[_0x982340+_0x0a9e('0x6f')]=_0x1910bf['Interaction']['id'];_0x4989f9[_0x0a9e('0x70')+_0x982340+_0x5a26c8+'Id']=_0x1910bf[_0x0a9e('0x68')]['id'];return db[_0x982340+'TransferReport'][_0x0a9e('0x72')](_0x4989f9);})['then'](function(){return respondWithRpcPromise(_0x0a9e('0x73'),{'channel':_0x3325c5,'interaction':_0x1910bf[_0x0a9e('0x6c')],'message':_0x1910bf,'account':_0x1910bf[_0x0a9e('0x68')],'applications':[{'id':0x0,'priority':0x1,'app':_0x0a9e('0x3c'),'appdata':_0x255e49['name']+','+(_0x1910bf[_0x0a9e('0x68')]['agentTransferTimeout']||0x12c),'interval':_0x0a9e('0x76')}],'transfer':!![]},routingClient);})[_0x0a9e('0x7')](respondWithResult(_0x22063c,null))['catch'](handleError(_0x22063c,null));}; \ No newline at end of file +var _0xa9e0=['mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','filter','map','queue_id','uniq','indexOf','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','queueNotify','chat','Website','Account','findOne','\x20Queue\x20not\x20found','Message','Interaction','\x20Message\x20not\x20found','MessageId','InteractionId','From','QueueId','create','Start','queue','queueTransferTimeout','*,*,*,*','agentNotify','Channel\x20field\x20is\x20mandatory','channel','capitalize','User','messageId','update','bluebird','moment','lodash','../../config/logger','jayson/promise','client','http','then','error','code','catch','status','sendStatus','stack','name','send','isNil','find','rows','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','voiceQueues','showVoiceQueues','VoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','Agents','agentCapacity','interaction','user','hasOwnProperty','MemberReport','findAll','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','INTERACTION','interface','SIP/%s','agent','internal','AgentCapacity','telephones','Telephones','Trunks','campaigns','ChatQueues','mailQueues','showMailQueues','MailQueues','mailAccounts','MailAccounts','openchannelQueues','OpenchannelQueues','SmsQueues','showSmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xa9e0[_0xf50820];return _0x2a9b10;};'use strict';var BPromise=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var util=require('util');var db=require('../../mysqldb')['db'];var logger=require(_0x0a9e('0x3'))('api');var jayson=require(_0x0a9e('0x4'));var amiClient=jayson[_0x0a9e('0x5')][_0x0a9e('0x6')]({'port':0x232a});var mailClient=jayson[_0x0a9e('0x5')][_0x0a9e('0x6')]({'port':0x232b});var routingClient=jayson['client'][_0x0a9e('0x6')]({'port':0x232c});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){var _0x56465b=_0x5f41ea?_0x5f41ea:amiClient;return _0x56465b['request'](_0x441e3a,_0x2cc193)[_0x0a9e('0x7')](function(_0xf81284){if(_0xf81284[_0x0a9e('0x8')]){if(_0xf81284[_0x0a9e('0x8')][_0x0a9e('0x9')]===0x1f4){return _0xe42b77(_0xf81284[_0x0a9e('0x8')]['message']);}return _0x503809(_0xf81284['error']['message']);}else{_0x503809(_0xf81284['result']);}})[_0x0a9e('0xa')](function(_0x36471c){_0xe42b77(_0x36471c);});});}function respondWithResult(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xc8;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0xb')](_0x26d672)['json'](_0x32d742);}return _0xd5b662[_0x0a9e('0xc')](0x194);};}function handleError(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0x1f4;return function(_0x281129){logger[_0x0a9e('0x8')](_0x281129[_0x0a9e('0xd')]);if(_0x281129['name']){delete _0x281129[_0x0a9e('0xe')];}_0x239b12['status'](_0x2b4227)[_0x0a9e('0xf')](_0x281129);};}function findById(_0x519dfd){return function(_0x16033c){if(!_[_0x0a9e('0x10')](_0x519dfd)&&!_['isNil'](_0x16033c)&&!_[_0x0a9e('0x10')](_0x16033c['rows'])){return _[_0x0a9e('0x11')](_0x16033c[_0x0a9e('0x12')],function(_0x106033){return _0x106033['id']==_0x519dfd;});}return null;};}exports[_0x0a9e('0x13')]=function(_0x31b1ca,_0x2eb11f){return respondWithRpcPromise(_0x0a9e('0x14'),_0x31b1ca[_0x0a9e('0x15')])[_0x0a9e('0x7')](respondWithResult(_0x2eb11f,null))[_0x0a9e('0xa')](handleError(_0x2eb11f,null));};exports[_0x0a9e('0x16')]=function(_0x105080,_0x4bb1e3){return respondWithRpcPromise(_0x0a9e('0x17'),_[_0x0a9e('0x18')](_0x105080['query'],_0x105080[_0x0a9e('0x19')]))['then'](respondWithResult(_0x4bb1e3,null))['catch'](handleError(_0x4bb1e3,null));};exports[_0x0a9e('0x1a')]=function(_0x432e56,_0x38e7c4){return respondWithRpcPromise(_0x0a9e('0x1b'),_['merge'](_0x432e56[_0x0a9e('0x15')],_0x432e56[_0x0a9e('0x19')]))[_0x0a9e('0x7')](respondWithResult(_0x38e7c4,null))[_0x0a9e('0xa')](handleError(_0x38e7c4,null));};exports[_0x0a9e('0x1c')]=function(_0x42ac8f,_0x16b1ca){return respondWithRpcPromise('VoiceQueues',_0x42ac8f['query'])[_0x0a9e('0x7')](respondWithResult(_0x16b1ca,null))[_0x0a9e('0xa')](handleError(_0x16b1ca,null));};exports[_0x0a9e('0x1d')]=function(_0x33161b,_0x526cf3){return respondWithRpcPromise(_0x0a9e('0x1e'),_0x33161b['query'])[_0x0a9e('0x7')](findById(_0x33161b['params']['id']))[_0x0a9e('0x7')](respondWithResult(_0x526cf3,null))[_0x0a9e('0xa')](handleError(_0x526cf3,null));};exports[_0x0a9e('0x1f')]=function(_0x14433c,_0x140511){return respondWithRpcPromise(_0x0a9e('0x20'),_[_0x0a9e('0x18')](_0x14433c[_0x0a9e('0x21')],_0x14433c['params']))[_0x0a9e('0x7')](respondWithResult(_0x140511,null))[_0x0a9e('0xa')](handleError(_0x140511,null));};exports[_0x0a9e('0x22')]=function(_0x2ec755,_0x5c877d){return respondWithRpcPromise(_0x0a9e('0x23'),_[_0x0a9e('0x18')](_0x2ec755[_0x0a9e('0x15')],_0x2ec755[_0x0a9e('0x19')]))[_0x0a9e('0x7')](respondWithResult(_0x5c877d,null))[_0x0a9e('0xa')](handleError(_0x5c877d,null));};exports[_0x0a9e('0x24')]=function(_0x2e8759,_0x1dbde2){return respondWithRpcPromise('VoiceQueuesChannels',_0x2e8759[_0x0a9e('0x15')])['then'](respondWithResult(_0x1dbde2,null))[_0x0a9e('0xa')](handleError(_0x1dbde2,null));};exports[_0x0a9e('0x25')]=function(_0x1122db,_0x33bdb7){return respondWithRpcPromise(_0x0a9e('0x26'),_['merge'](_0x1122db[_0x0a9e('0x15')],_0x1122db[_0x0a9e('0x19')]))[_0x0a9e('0x7')](respondWithResult(_0x33bdb7,null))[_0x0a9e('0xa')](handleError(_0x33bdb7,null));};exports[_0x0a9e('0x27')]=function(_0x409319,_0x332d35){return respondWithRpcPromise(_0x0a9e('0x28'),_['merge'](_0x409319[_0x0a9e('0x15')],_0x409319['params']))[_0x0a9e('0x7')](respondWithResult(_0x332d35,null))[_0x0a9e('0xa')](handleError(_0x332d35,null));};exports[_0x0a9e('0x29')]=function(_0x3f3d41,_0x567193){return respondWithRpcPromise(_0x0a9e('0x2a'),_[_0x0a9e('0x18')](_0x3f3d41[_0x0a9e('0x15')],_0x3f3d41[_0x0a9e('0x19')]))['then'](respondWithResult(_0x567193,null))['catch'](handleError(_0x567193,null));};exports[_0x0a9e('0x2b')]=function(_0x5640eb,_0x24936a){return respondWithRpcPromise(_0x0a9e('0x2c'),_0x5640eb[_0x0a9e('0x15')])[_0x0a9e('0x7')](respondWithResult(_0x24936a,null))['catch'](handleError(_0x24936a,null));};exports[_0x0a9e('0x2d')]=function(_0x3bfce8,_0x3cae){return respondWithRpcPromise('OutboundChannels',_0x3bfce8[_0x0a9e('0x15')])[_0x0a9e('0x7')](respondWithResult(_0x3cae,null))[_0x0a9e('0xa')](handleError(_0x3cae,null));};exports['agents']=function(_0x546ef8,_0x11b61d){var _0x40d766;return respondWithRpcPromise('Agents',_0x546ef8[_0x0a9e('0x15')])[_0x0a9e('0x7')](function(_0x2e1b3a){_0x40d766=_0x2e1b3a;return respondWithRpcPromise(_0x0a9e('0x2e'),_0x546ef8['query'],routingClient);})['then'](function(_0x15e37d){return _[_0x0a9e('0x18')]({},_0x15e37d,_0x40d766);})['then'](respondWithResult(_0x11b61d,null))[_0x0a9e('0xa')](handleError(_0x11b61d,null));};exports[_0x0a9e('0x2f')]=function(_0x1459bb,_0x5b4f5e){if(_0x1459bb[_0x0a9e('0x21')]&&_0x1459bb[_0x0a9e('0x21')][_0x0a9e('0x30')]&&_0x1459bb[_0x0a9e('0x31')]&&_0x1459bb[_0x0a9e('0x31')][_0x0a9e('0xe')]){for(var _0x2881b3 in _0x1459bb[_0x0a9e('0x21')][_0x0a9e('0x30')]){if(_0x1459bb[_0x0a9e('0x21')][_0x0a9e('0x30')][_0x0a9e('0x32')](_0x2881b3)){db[_0x0a9e('0x33')][_0x0a9e('0x34')]({'where':{'channel':_0x2881b3,'membername':_0x1459bb[_0x0a9e('0x31')]['name'],'type':'INTERACTION','exitAt':null,'uniqueid':_0x1459bb[_0x0a9e('0x21')][_0x0a9e('0x30')][_0x2881b3]&&_0x1459bb[_0x0a9e('0x21')][_0x0a9e('0x30')][_0x2881b3][_0x0a9e('0x35')]?{'$notIn':_0x1459bb[_0x0a9e('0x21')][_0x0a9e('0x30')][_0x2881b3]}:{'$ne':null}}})[_0x0a9e('0x7')](function(_0x432fcc){var _0x25c6e6=moment()[_0x0a9e('0x36')](_0x0a9e('0x37'));for(var _0x5026aa=0x0,_0x117c99=_0x432fcc[_0x0a9e('0x35')];_0x5026aa<_0x117c99;_0x5026aa+=0x1){_0x432fcc[_0x5026aa][_0x0a9e('0x38')]({'exitAt':_0x25c6e6});}});for(var _0xfbd5ad=0x0;_0xfbd5ad<_0x1459bb[_0x0a9e('0x21')][_0x0a9e('0x30')][_0x2881b3][_0x0a9e('0x35')];_0xfbd5ad+=0x1){db[_0x0a9e('0x33')]['findOrCreate']({'where':{'channel':_0x2881b3,'membername':_0x1459bb[_0x0a9e('0x31')]['name'],'type':_0x0a9e('0x39'),'uniqueid':_0x1459bb[_0x0a9e('0x21')][_0x0a9e('0x30')][_0x2881b3][_0xfbd5ad],'exitAt':null},'defaults':{'channel':_0x2881b3,'membername':_0x1459bb['user'][_0x0a9e('0xe')],'interface':_[_0x0a9e('0x10')](_0x1459bb[_0x0a9e('0x31')][_0x0a9e('0x3a')])?util[_0x0a9e('0x36')](_0x0a9e('0x3b'),_0x1459bb[_0x0a9e('0x31')]['name']):_0x1459bb[_0x0a9e('0x31')][_0x0a9e('0x3a')],'type':_0x0a9e('0x39'),'enterAt':moment()[_0x0a9e('0x36')](_0x0a9e('0x37')),'role':_0x0a9e('0x3c'),'internal':_0x1459bb[_0x0a9e('0x31')][_0x0a9e('0x3d')],'uniqueid':_0x1459bb[_0x0a9e('0x21')]['interaction'][_0x2881b3][_0xfbd5ad]}});}}}}return respondWithRpcPromise(_0x0a9e('0x3e'),{'id':_0x1459bb[_0x0a9e('0x19')]['id'],'capacity':_0x1459bb['body']['capacity']},routingClient)['then'](respondWithResult(_0x5b4f5e,null))[_0x0a9e('0xa')](handleError(_0x5b4f5e,null));};exports[_0x0a9e('0x3f')]=function(_0x37edaa,_0x11545a){return respondWithRpcPromise(_0x0a9e('0x40'),_0x37edaa[_0x0a9e('0x15')])[_0x0a9e('0x7')](respondWithResult(_0x11545a,null))[_0x0a9e('0xa')](handleError(_0x11545a,null));};exports['trunks']=function(_0x4b1b9f,_0x53975a){return respondWithRpcPromise(_0x0a9e('0x41'),_0x4b1b9f[_0x0a9e('0x15')])[_0x0a9e('0x7')](respondWithResult(_0x53975a,null))['catch'](handleError(_0x53975a,null));};exports[_0x0a9e('0x42')]=function(_0x161aa7,_0x53d113){return respondWithRpcPromise('Campaigns',_0x161aa7[_0x0a9e('0x15')])['then'](respondWithResult(_0x53d113,null))[_0x0a9e('0xa')](handleError(_0x53d113,null));};exports['chatQueues']=function(_0x2e5e62,_0x3c20b2){return respondWithRpcPromise(_0x0a9e('0x43'),_0x2e5e62['query'],routingClient)[_0x0a9e('0x7')](respondWithResult(_0x3c20b2,null))[_0x0a9e('0xa')](handleError(_0x3c20b2,null));};exports['showChatQueues']=function(_0x50f687,_0x128aa6){return respondWithRpcPromise(_0x0a9e('0x43'),_0x50f687['query'],routingClient)[_0x0a9e('0x7')](findById(_0x50f687['params']['id']))[_0x0a9e('0x7')](respondWithResult(_0x128aa6,null))['catch'](handleError(_0x128aa6,null));};exports[_0x0a9e('0x44')]=function(_0x4a6deb,_0x5da27d){return respondWithRpcPromise('MailQueues',_0x4a6deb[_0x0a9e('0x15')],routingClient)['then'](respondWithResult(_0x5da27d,null))[_0x0a9e('0xa')](handleError(_0x5da27d,null));};exports[_0x0a9e('0x45')]=function(_0x3cfd00,_0x19b4df){return respondWithRpcPromise(_0x0a9e('0x46'),_0x3cfd00[_0x0a9e('0x15')],routingClient)[_0x0a9e('0x7')](findById(_0x3cfd00[_0x0a9e('0x19')]['id']))['then'](respondWithResult(_0x19b4df,null))[_0x0a9e('0xa')](handleError(_0x19b4df,null));};exports[_0x0a9e('0x47')]=function(_0x2642bb,_0x30c491){return respondWithRpcPromise(_0x0a9e('0x48'),_0x2642bb[_0x0a9e('0x15')],mailClient)['then'](respondWithResult(_0x30c491,null))[_0x0a9e('0xa')](handleError(_0x30c491,null));};exports[_0x0a9e('0x49')]=function(_0x5239ef,_0x3649cc){return respondWithRpcPromise('OpenchannelQueues',_0x5239ef[_0x0a9e('0x15')],routingClient)['then'](respondWithResult(_0x3649cc,null))['catch'](handleError(_0x3649cc,null));};exports['showOpenchannelQueues']=function(_0x273cb5,_0x49d231){return respondWithRpcPromise(_0x0a9e('0x4a'),_0x273cb5[_0x0a9e('0x15')],routingClient)[_0x0a9e('0x7')](findById(_0x273cb5[_0x0a9e('0x19')]['id']))[_0x0a9e('0x7')](respondWithResult(_0x49d231,null))[_0x0a9e('0xa')](handleError(_0x49d231,null));};exports['smsQueues']=function(_0x1627a7,_0x5854cc){return respondWithRpcPromise(_0x0a9e('0x4b'),_0x1627a7[_0x0a9e('0x15')],routingClient)[_0x0a9e('0x7')](respondWithResult(_0x5854cc,null))['catch'](handleError(_0x5854cc,null));};exports[_0x0a9e('0x4c')]=function(_0x156f1c,_0x119677){return respondWithRpcPromise(_0x0a9e('0x4b'),_0x156f1c['query'],routingClient)[_0x0a9e('0x7')](findById(_0x156f1c[_0x0a9e('0x19')]['id']))['then'](respondWithResult(_0x119677,null))[_0x0a9e('0xa')](handleError(_0x119677,null));};exports[_0x0a9e('0x4d')]=function(_0x88dcbf,_0x409b29){return respondWithRpcPromise(_0x0a9e('0x4e'),_0x88dcbf['query'],routingClient)[_0x0a9e('0x7')](respondWithResult(_0x409b29,null))[_0x0a9e('0xa')](handleError(_0x409b29,null));};exports[_0x0a9e('0x4f')]=function(_0x47bb43,_0x3528b7){return respondWithRpcPromise('WhatsappQueues',_0x47bb43['query'],routingClient)[_0x0a9e('0x7')](findById(_0x47bb43[_0x0a9e('0x19')]['id']))[_0x0a9e('0x7')](respondWithResult(_0x3528b7,null))[_0x0a9e('0xa')](handleError(_0x3528b7,null));};exports[_0x0a9e('0x50')]=function(_0xc8c264,_0x387489){return respondWithRpcPromise(_0x0a9e('0x51'),_0xc8c264[_0x0a9e('0x15')],routingClient)[_0x0a9e('0x7')](respondWithResult(_0x387489,null))[_0x0a9e('0xa')](handleError(_0x387489,null));};exports[_0x0a9e('0x52')]=function(_0x2bbb86,_0x2b8192){return respondWithRpcPromise(_0x0a9e('0x51'),_0x2bbb86[_0x0a9e('0x15')],routingClient)[_0x0a9e('0x7')](findById(_0x2bbb86[_0x0a9e('0x19')]['id']))['then'](respondWithResult(_0x2b8192,null))[_0x0a9e('0xa')](handleError(_0x2b8192,null));};exports[_0x0a9e('0x53')]=function(_0x243d12,_0x4edbb0){return respondWithRpcPromise(_0x0a9e('0x54'),_0x243d12[_0x0a9e('0x15')])['then'](respondWithResult(_0x4edbb0,null))[_0x0a9e('0xa')](handleError(_0x4edbb0,null));};exports[_0x0a9e('0x55')]=function(_0x3ef315,_0x427946){return respondWithRpcPromise(_0x0a9e('0x56'),_0x3ef315['query'],routingClient)['then'](respondWithResult(_0x427946,null))['catch'](handleError(_0x427946,null));};exports[_0x0a9e('0x57')]=function(_0x18bf5d,_0x1104ad){return respondWithRpcPromise(_0x0a9e('0x58'),_0x18bf5d[_0x0a9e('0x15')],routingClient)[_0x0a9e('0x7')](respondWithResult(_0x1104ad,null))[_0x0a9e('0xa')](handleError(_0x1104ad,null));};exports[_0x0a9e('0x59')]=function(_0x5512d1,_0x235f8f){return respondWithRpcPromise(_0x0a9e('0x5a'),_0x5512d1[_0x0a9e('0x15')],routingClient)['then'](respondWithResult(_0x235f8f,null))[_0x0a9e('0xa')](handleError(_0x235f8f,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x4437ff,_0x44351d){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x4437ff[_0x0a9e('0x15')],routingClient)[_0x0a9e('0x7')](function(_0x2cc7a7){if(_0x4437ff[_0x0a9e('0x15')]['type']!==undefined){var _0x1d442c=_(_0x2cc7a7[_0x0a9e('0x12')])[_0x0a9e('0x5b')]([_0x4437ff[_0x0a9e('0x15')]['type'],_0x4437ff[_0x0a9e('0x19')]['id']])[_0x0a9e('0x5c')](_0x0a9e('0x5d'))[_0x0a9e('0x5e')]()['value']();return _0x2cc7a7[_0x0a9e('0x12')][_0x0a9e('0x5b')](function(_0x30a4c7){return _0x1d442c[_0x0a9e('0x5f')](_0x30a4c7[_0x0a9e('0x5d')])>-0x1;});}else{return _0x2cc7a7[_0x0a9e('0x12')][_0x0a9e('0x5b')](function(_0x3df0e3){return _0x3df0e3[_0x0a9e('0x5d')]===parseInt(_0x4437ff[_0x0a9e('0x19')]['id']);});}})[_0x0a9e('0x7')](respondWithResult(_0x44351d,null))[_0x0a9e('0xa')](handleError(_0x44351d,null));};exports[_0x0a9e('0x60')]=function(_0xe0749e,_0x5b35db){return respondWithRpcPromise(_0x0a9e('0x61'),_0xe0749e[_0x0a9e('0x15')],routingClient)[_0x0a9e('0x7')](respondWithResult(_0x5b35db,null))['catch'](handleError(_0x5b35db,null));};exports[_0x0a9e('0x62')]=function(_0x33dda0,_0x8cea96){return respondWithRpcPromise(_0x0a9e('0x63'),_0x33dda0['query'],routingClient)['then'](respondWithResult(_0x8cea96,null))[_0x0a9e('0xa')](handleError(_0x8cea96,null));};exports[_0x0a9e('0x64')]=function(_0x4c54fa,_0x45108c){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x4c54fa[_0x0a9e('0x15')],routingClient)[_0x0a9e('0x7')](respondWithResult(_0x45108c,null))['catch'](handleError(_0x45108c,null));};exports[_0x0a9e('0x65')]=function(_0x41cf12){return function(_0x2d2286,_0x42b959){var _0x3755fe,_0x1f42a0;var _0x444f1f=_['capitalize'](_0x41cf12);var _0x2973d3=_0x41cf12===_0x0a9e('0x66')?_0x0a9e('0x67'):_0x0a9e('0x68');return db[_0x444f1f+'Queue'][_0x0a9e('0x69')]({'raw':!![],'where':{'id':_0x2d2286[_0x0a9e('0x19')]['id']}})['then'](function(_0x1d6834){if(_['isNil'](_0x1d6834)){throw new Error(_0x444f1f+_0x0a9e('0x6a'));}_0x3755fe=_0x1d6834;return db[_0x444f1f+_0x0a9e('0x6b')][_0x0a9e('0x69')]({'where':{'id':_0x2d2286[_0x0a9e('0x21')]['messageId']},'include':[{'model':db[_0x444f1f+'Interaction'],'as':_0x0a9e('0x6c')},{'model':db[_0x444f1f+_0x2973d3],'as':_0x0a9e('0x68')}]});})[_0x0a9e('0x7')](function(_0x5ac73d){if(_[_0x0a9e('0x10')](_0x5ac73d)){throw new Error(_0x444f1f+_0x0a9e('0x6d'));}_0x1f42a0=_0x5ac73d;return _0x5ac73d['update']({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0xf0a802={'uniqueid':_0x41cf12+'.'+_0x1f42a0['id']+'.'+_0x1f42a0['Interaction']['id'],'FromUserId':_0x2d2286['user']['id'],'type':'queue'};_0xf0a802[_0x444f1f+_0x0a9e('0x6e')]=_0x1f42a0['id'];_0xf0a802[_0x444f1f+_0x0a9e('0x6f')]=_0x1f42a0[_0x0a9e('0x6c')]['id'];_0xf0a802[_0x0a9e('0x70')+_0x444f1f+_0x2973d3+'Id']=_0x1f42a0[_0x0a9e('0x68')]['id'];_0xf0a802['To'+_0x444f1f+_0x0a9e('0x71')]=_0x3755fe['id'];return db[_0x444f1f+'TransferReport'][_0x0a9e('0x72')](_0xf0a802);})['then'](function(){return respondWithRpcPromise(_0x0a9e('0x73'),{'channel':_0x41cf12,'interaction':_0x1f42a0[_0x0a9e('0x6c')],'message':_0x1f42a0,'account':_0x1f42a0[_0x0a9e('0x68')],'applications':[{'id':0x0,'priority':0x1,'app':_0x0a9e('0x74'),'appdata':_0x3755fe['name']+','+(_0x1f42a0[_0x0a9e('0x68')][_0x0a9e('0x75')]||0x12c),'interval':_0x0a9e('0x76')}],'transfer':!![]},routingClient);})['then'](respondWithResult(_0x42b959,null))[_0x0a9e('0xa')](handleError(_0x42b959,null));};};exports[_0x0a9e('0x77')]=function(_0x2a563d,_0x22063c){var _0x255e49,_0x1910bf;if(_[_0x0a9e('0x10')](_0x2a563d[_0x0a9e('0x21')]['channel'])){throw new Error(_0x0a9e('0x78'));}var _0x3325c5=_0x2a563d['body'][_0x0a9e('0x79')];var _0x982340=_[_0x0a9e('0x7a')](_0x3325c5);var _0x5a26c8=_0x3325c5===_0x0a9e('0x66')?'Website':_0x0a9e('0x68');return db[_0x0a9e('0x7b')][_0x0a9e('0x69')]({'raw':!![],'where':{'id':_0x2a563d[_0x0a9e('0x19')]['id'],'role':_0x0a9e('0x3c')}})[_0x0a9e('0x7')](function(_0x16a039){if(_[_0x0a9e('0x10')](_0x16a039)){throw new Error('Agent\x20not\x20found');}_0x255e49=_0x16a039;return db[_0x982340+_0x0a9e('0x6b')][_0x0a9e('0x69')]({'where':{'id':_0x2a563d[_0x0a9e('0x21')][_0x0a9e('0x7c')]},'include':[{'model':db[_0x982340+_0x0a9e('0x6c')],'as':_0x0a9e('0x6c')},{'model':db[_0x982340+_0x5a26c8],'as':_0x0a9e('0x68')}]});})[_0x0a9e('0x7')](function(_0x1808ba){if(_[_0x0a9e('0x10')](_0x1808ba)){throw new Error(_0x982340+_0x0a9e('0x6d'));}_0x1910bf=_0x1808ba;return _0x1808ba[_0x0a9e('0x7d')]({'read':0x0,'readAt':null,'UserId':null});})[_0x0a9e('0x7')](function(){var _0x4989f9={'uniqueid':_0x3325c5+'.'+_0x1910bf['id']+'.'+_0x1910bf[_0x0a9e('0x6c')]['id'],'FromUserId':_0x2a563d[_0x0a9e('0x31')]['id'],'type':_0x0a9e('0x3c'),'ToUserId':_0x255e49['id']};_0x4989f9[_0x982340+_0x0a9e('0x6e')]=_0x1910bf['id'];_0x4989f9[_0x982340+_0x0a9e('0x6f')]=_0x1910bf['Interaction']['id'];_0x4989f9[_0x0a9e('0x70')+_0x982340+_0x5a26c8+'Id']=_0x1910bf[_0x0a9e('0x68')]['id'];return db[_0x982340+'TransferReport'][_0x0a9e('0x72')](_0x4989f9);})['then'](function(){return respondWithRpcPromise(_0x0a9e('0x73'),{'channel':_0x3325c5,'interaction':_0x1910bf[_0x0a9e('0x6c')],'message':_0x1910bf,'account':_0x1910bf[_0x0a9e('0x68')],'applications':[{'id':0x0,'priority':0x1,'app':_0x0a9e('0x3c'),'appdata':_0x255e49['name']+','+(_0x1910bf[_0x0a9e('0x68')]['agentTransferTimeout']||0x12c),'interval':_0x0a9e('0x76')}],'transfer':!![]},routingClient);})[_0x0a9e('0x7')](respondWithResult(_0x22063c,null))['catch'](handleError(_0x22063c,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index f4c2829..205950a 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 _0x22b7=['put','update','delete','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./schedule.controller','isAuthenticated','index','get','/:id','/:id/run','run','post','create'];(function(_0x43b08,_0x15f967){var _0x5e05f4=function(_0x4bb0cb){while(--_0x4bb0cb){_0x43b08['push'](_0x43b08['shift']());}};_0x5e05f4(++_0x15f967);}(_0x22b7,0x1a5));var _0x722b=function(_0x21c80a,_0x275d41){_0x21c80a=_0x21c80a-0x0;var _0x4a7719=_0x22b7[_0x21c80a];return _0x4a7719;};'use strict';var multer=require(_0x722b('0x0'));var util=require(_0x722b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x722b('0x2'));var router=express[_0x722b('0x3')]();var fs_extra=require(_0x722b('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x722b('0x5'));var config=require(_0x722b('0x6'));var controller=require(_0x722b('0x7'));router['get']('/',auth[_0x722b('0x8')](),controller[_0x722b('0x9')]);router[_0x722b('0xa')](_0x722b('0xb'),auth[_0x722b('0x8')](),controller['show']);router[_0x722b('0xa')](_0x722b('0xc'),auth['isAuthenticated'](),controller[_0x722b('0xd')]);router[_0x722b('0xe')]('/',auth[_0x722b('0x8')](),controller[_0x722b('0xf')]);router[_0x722b('0x10')](_0x722b('0xb'),auth[_0x722b('0x8')](),controller[_0x722b('0x11')]);router[_0x722b('0x12')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x122b=['put','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/run','post'];(function(_0x3d97eb,_0x357d0e){var _0x3291e1=function(_0x34df49){while(--_0x34df49){_0x3d97eb['push'](_0x3d97eb['shift']());}};_0x3291e1(++_0x357d0e);}(_0x122b,0xd0));var _0xb122=function(_0x4b2436,_0x452299){_0x4b2436=_0x4b2436-0x0;var _0x4f5ab2=_0x122b[_0x4b2436];return _0x4f5ab2;};'use strict';var multer=require(_0xb122('0x0'));var util=require('util');var path=require(_0xb122('0x1'));var timeout=require('connect-timeout');var express=require(_0xb122('0x2'));var router=express[_0xb122('0x3')]();var fs_extra=require(_0xb122('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xb122('0x5'));var config=require(_0xb122('0x6'));var controller=require('./schedule.controller');router[_0xb122('0x7')]('/',auth[_0xb122('0x8')](),controller[_0xb122('0x9')]);router[_0xb122('0x7')](_0xb122('0xa'),auth['isAuthenticated'](),controller['show']);router['get'](_0xb122('0xb'),auth[_0xb122('0x8')](),controller['run']);router[_0xb122('0xc')]('/',auth[_0xb122('0x8')](),controller['create']);router[_0xb122('0xd')](_0xb122('0xa'),auth[_0xb122('0x8')](),controller['update']);router[_0xb122('0xe')]('/:id',auth[_0xb122('0x8')](),controller[_0xb122('0xf')]);module[_0xb122('0x10')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index 5680e16..00e3a67 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 _0x5d55=['BOOLEAN','DATE','INTEGER','years','quarters','months','weeks','days','hours','ENUM','pdf','xlsx','default','custom','TEXT','exports','STRING'];(function(_0x533b72,_0x362795){var _0x423405=function(_0x1dfbd2){while(--_0x1dfbd2){_0x533b72['push'](_0x533b72['shift']());}};_0x423405(++_0x362795);}(_0x5d55,0xdb));var _0x55d5=function(_0x14765e,_0x527959){_0x14765e=_0x14765e-0x0;var _0x562dca=_0x5d55[_0x14765e];return _0x562dca;};'use strict';var Sequelize=require('sequelize');module[_0x55d5('0x0')]={'name':{'type':Sequelize[_0x55d5('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x55d5('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'0\x200\x20*\x20*\x20*'},'startAt':{'type':Sequelize[_0x55d5('0x3')],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x55d5('0x4')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM'](_0x55d5('0x5'),_0x55d5('0x6'),_0x55d5('0x7'),_0x55d5('0x8'),_0x55d5('0x9'),_0x55d5('0xa'),'minutes'),'allowNull':![],'defaultValue':_0x55d5('0x9')},'output':{'type':Sequelize[_0x55d5('0xb')]('csv',_0x55d5('0xc'),_0x55d5('0xd')),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize['ENUM']('custom',_0x55d5('0xe')),'allowNull':![],'defaultValue':_0x55d5('0xf')},'sendMail':{'type':Sequelize[_0x55d5('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x55d5('0x1')]},'cc':{'type':Sequelize[_0x55d5('0x10')]},'bcc':{'type':Sequelize['TEXT']},'sendIfEmpty':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x1e48=['BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','years','quarters','months','weeks','hours','minutes','days','csv','pdf','xlsx','custom','TEXT','STRING'];(function(_0x3fe32a,_0x35ec60){var _0x7541fb=function(_0x2b36fd){while(--_0x2b36fd){_0x3fe32a['push'](_0x3fe32a['shift']());}};_0x7541fb(++_0x35ec60);}(_0x1e48,0xd7));var _0x81e4=function(_0x12ceba,_0x59ba15){_0x12ceba=_0x12ceba-0x0;var _0x36c243=_0x1e48[_0x12ceba];return _0x36c243;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x81e4('0x0')]},'active':{'type':Sequelize[_0x81e4('0x1')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x81e4('0x0')],'allowNull':![],'defaultValue':_0x81e4('0x2')},'startAt':{'type':Sequelize[_0x81e4('0x3')],'allowNull':![]},'endAt':{'type':Sequelize[_0x81e4('0x3')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x81e4('0x4')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x81e4('0x5')](_0x81e4('0x6'),_0x81e4('0x7'),_0x81e4('0x8'),_0x81e4('0x9'),'days',_0x81e4('0xa'),_0x81e4('0xb')),'allowNull':![],'defaultValue':_0x81e4('0xc')},'output':{'type':Sequelize['ENUM'](_0x81e4('0xd'),_0x81e4('0xe'),_0x81e4('0xf')),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize[_0x81e4('0x5')]('custom','default'),'allowNull':![],'defaultValue':_0x81e4('0x10')},'sendMail':{'type':Sequelize[_0x81e4('0x1')],'defaultValue':![]},'email':{'type':Sequelize[_0x81e4('0x0')]},'cc':{'type':Sequelize[_0x81e4('0x11')]},'bcc':{'type':Sequelize[_0x81e4('0x11')]},'sendIfEmpty':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index 4103315..a40d950 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 _0x7634=['Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','../../config/schedule','run','zip-dir','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','destroy','UserProfileResource','then','end','stack','name','send','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','Schedule','include','catch','show','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','Scheduler','userProfileId','autoAssociation','error'];(function(_0x17afd2,_0x4deb5e){var _0x3c7fec=function(_0x10a031){while(--_0x10a031){_0x17afd2['push'](_0x17afd2['shift']());}};_0x3c7fec(++_0x4deb5e);}(_0x7634,0xf8));var _0x4763=function(_0x13d299,_0x2ac3e8){_0x13d299=_0x13d299-0x0;var _0x5b697f=_0x7634[_0x13d299];return _0x5b697f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4763('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4763('0x1'));var Mustache=require(_0x4763('0x2'));var util=require(_0x4763('0x3'));var path=require(_0x4763('0x4'));var sox=require(_0x4763('0x5'));var csv=require(_0x4763('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4763('0x7'));var _=require(_0x4763('0x8'));var squel=require(_0x4763('0x9'));var crypto=require(_0x4763('0xa'));var jsforce=require(_0x4763('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4763('0xc'));var Papa=require(_0x4763('0xd'));var Redis=require('ioredis');var authService=require(_0x4763('0xe'));var qs=require(_0x4763('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x4763('0x10'))('api');var utils=require('../../config/utils');var config=require(_0x4763('0x11'));var licenseUtil=require(_0x4763('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1c5e21,_0x373064){_0x373064=_0x373064||0xcc;return function(_0x696465){if(_0x696465){return _0x1c5e21[_0x4763('0x13')](_0x373064);}return _0x1c5e21[_0x4763('0x14')](_0x373064)['end']();};}function respondWithResult(_0x3d7d08,_0x2c22d5){_0x2c22d5=_0x2c22d5||0xc8;return function(_0x588145){if(_0x588145){return _0x3d7d08['status'](_0x2c22d5)[_0x4763('0x15')](_0x588145);}};}function respondWithFilteredResult(_0x52d2e3,_0x22d018){return function(_0x2b1c9a){if(_0x2b1c9a){var _0x2196e3=typeof _0x22d018[_0x4763('0x16')]===_0x4763('0x17')&&typeof _0x22d018['limit']===_0x4763('0x17');var _0x14bf9c=_0x2b1c9a[_0x4763('0x18')];var _0x5eb5e6=_0x2196e3?0x0:_0x22d018['offset'];var _0x40922a=_0x2196e3?_0x2b1c9a['count']:_0x22d018[_0x4763('0x16')]+_0x22d018[_0x4763('0x19')];var _0x27fc6b;if(_0x40922a>=_0x14bf9c){_0x40922a=_0x14bf9c;_0x27fc6b=0xc8;}else{_0x27fc6b=0xce;}_0x52d2e3[_0x4763('0x14')](_0x27fc6b);return _0x52d2e3[_0x4763('0x1a')](_0x4763('0x1b'),_0x5eb5e6+'-'+_0x40922a+'/'+_0x14bf9c)['json'](_0x2b1c9a);}return null;};}function patchUpdates(_0x3609ce){return function(_0x362202){try{jsonpatch[_0x4763('0x1c')](_0x362202,_0x3609ce,!![]);}catch(_0x1f2bc6){return BPromise[_0x4763('0x1d')](_0x1f2bc6);}return _0x362202['save']();};}function saveUpdates(_0x4ec3c6,_0x658179){return function(_0x5e6f5d){if(_0x5e6f5d){return _0x5e6f5d[_0x4763('0x1e')](_0x4ec3c6)['then'](function(_0x4d5d60){return _0x4d5d60;});}return null;};}function removeEntity(_0x38181f,_0xd804ea){return function(_0x1592bc){if(_0x1592bc){return _0x1592bc[_0x4763('0x1f')]()['then'](function(){var _0x244ce3=_0x1592bc['get']({'plain':!![]});var _0x5f0467='Scheduler';return db[_0x4763('0x20')][_0x4763('0x1f')]({'where':{'type':_0x5f0467,'resourceId':_0x244ce3['id']}})[_0x4763('0x21')](function(){return _0x1592bc;});})[_0x4763('0x21')](function(){_0x38181f[_0x4763('0x14')](0xcc)[_0x4763('0x22')]();});}};}function handleEntityNotFound(_0x110739,_0x241c18){return function(_0x8e1ce2){if(!_0x8e1ce2){_0x110739[_0x4763('0x13')](0x194);}return _0x8e1ce2;};}function handleError(_0x40779a,_0x3578ce){_0x3578ce=_0x3578ce||0x1f4;return function(_0x2ee162){logger['error'](_0x2ee162[_0x4763('0x23')]);if(_0x2ee162['name']){delete _0x2ee162[_0x4763('0x24')];}_0x40779a[_0x4763('0x14')](_0x3578ce)[_0x4763('0x25')](_0x2ee162);};}exports['index']=function(_0x50af03,_0xe7a808){var _0x43e500={},_0x677450={},_0x47af9b={'count':0x0,'rows':[]};var _0x284f75=_[_0x4763('0x26')](db['Schedule'][_0x4763('0x27')],function(_0x3ce065){return{'name':_0x3ce065[_0x4763('0x28')],'type':_0x3ce065[_0x4763('0x29')][_0x4763('0x2a')]};});_0x677450['model']=_[_0x4763('0x26')](_0x284f75,_0x4763('0x24'));_0x677450[_0x4763('0x2b')]=_[_0x4763('0x2c')](_0x50af03[_0x4763('0x2b')]);_0x677450[_0x4763('0x2d')]=_[_0x4763('0x2e')](_0x677450[_0x4763('0x2f')],_0x677450[_0x4763('0x2b')]);_0x43e500['attributes']=_[_0x4763('0x2e')](_0x677450[_0x4763('0x2f')],qs[_0x4763('0x30')](_0x50af03[_0x4763('0x2b')]['fields']));_0x43e500[_0x4763('0x31')]=_0x43e500['attributes'][_0x4763('0x32')]?_0x43e500[_0x4763('0x31')]:_0x677450[_0x4763('0x2f')];if(!_0x50af03[_0x4763('0x2b')][_0x4763('0x33')](_0x4763('0x34'))){_0x43e500[_0x4763('0x19')]=qs[_0x4763('0x19')](_0x50af03[_0x4763('0x2b')][_0x4763('0x19')]);_0x43e500[_0x4763('0x16')]=qs[_0x4763('0x16')](_0x50af03[_0x4763('0x2b')][_0x4763('0x16')]);}_0x43e500[_0x4763('0x35')]=qs[_0x4763('0x36')](_0x50af03[_0x4763('0x2b')]['sort']);_0x43e500['where']=qs[_0x4763('0x2d')](_[_0x4763('0x37')](_0x50af03['query'],_0x677450[_0x4763('0x2d')]),_0x284f75);if(_0x50af03[_0x4763('0x2b')][_0x4763('0x38')]){_0x43e500[_0x4763('0x39')]=_[_0x4763('0x3a')](_0x43e500[_0x4763('0x39')],{'$or':_[_0x4763('0x26')](_0x284f75,function(_0x31127f){if(_0x31127f[_0x4763('0x29')]!==_0x4763('0x3b')){var _0x108dcc={};_0x108dcc[_0x31127f['name']]={'$like':'%'+_0x50af03[_0x4763('0x2b')]['filter']+'%'};return _0x108dcc;}})});}_0x43e500=_[_0x4763('0x3a')]({},_0x43e500,_0x50af03[_0x4763('0x3c')]);var _0x4f1108={'where':_0x43e500[_0x4763('0x39')]};return db[_0x4763('0x3d')][_0x4763('0x18')](_0x4f1108)[_0x4763('0x21')](function(_0x107ebd){_0x47af9b[_0x4763('0x18')]=_0x107ebd;if(_0x50af03['query']['includeAll']){_0x43e500[_0x4763('0x3e')]=[{'all':!![]}];}return db[_0x4763('0x3d')]['findAll'](_0x43e500);})[_0x4763('0x21')](function(_0x37a137){_0x47af9b['rows']=_0x37a137;return _0x47af9b;})[_0x4763('0x21')](respondWithFilteredResult(_0xe7a808,_0x43e500))[_0x4763('0x3f')](handleError(_0xe7a808,null));};exports[_0x4763('0x40')]=function(_0x16af57,_0x304983){var _0x34edf1={'raw':![],'where':{'id':_0x16af57['params']['id']}},_0x322cc4={};_0x322cc4[_0x4763('0x2f')]=_[_0x4763('0x2c')](db[_0x4763('0x3d')][_0x4763('0x27')]);_0x322cc4[_0x4763('0x2b')]=_[_0x4763('0x2c')](_0x16af57[_0x4763('0x2b')]);_0x322cc4[_0x4763('0x2d')]=_[_0x4763('0x2e')](_0x322cc4[_0x4763('0x2f')],_0x322cc4[_0x4763('0x2b')]);_0x34edf1[_0x4763('0x31')]=_[_0x4763('0x2e')](_0x322cc4[_0x4763('0x2f')],qs[_0x4763('0x30')](_0x16af57[_0x4763('0x2b')][_0x4763('0x30')]));_0x34edf1['attributes']=_0x34edf1[_0x4763('0x31')][_0x4763('0x32')]?_0x34edf1[_0x4763('0x31')]:_0x322cc4[_0x4763('0x2f')];if(_0x16af57[_0x4763('0x2b')][_0x4763('0x41')]){_0x34edf1[_0x4763('0x3e')]=[{'all':!![]}];}_0x34edf1=_[_0x4763('0x3a')]({},_0x34edf1,_0x16af57['options']);return db[_0x4763('0x3d')][_0x4763('0x42')](_0x34edf1)['then'](handleEntityNotFound(_0x304983,null))[_0x4763('0x21')](respondWithResult(_0x304983,null))['catch'](handleError(_0x304983,null));};exports[_0x4763('0x43')]=function(_0x2b39aa,_0x3fd01b){return db[_0x4763('0x3d')][_0x4763('0x43')](_0x2b39aa['body'],{})[_0x4763('0x21')](function(_0x37578e){var _0x414f97=_0x2b39aa[_0x4763('0x44')]['get']({'plain':!![]});if(!_0x414f97)throw new Error(_0x4763('0x45'));if(_0x414f97[_0x4763('0x46')]===_0x4763('0x44')){var _0x14cd2d=_0x37578e[_0x4763('0x47')]({'plain':!![]});var _0x15eca3=_0x4763('0x48');return db['UserProfileSection']['find']({'where':{'name':_0x15eca3,'userProfileId':_0x414f97[_0x4763('0x49')]},'raw':!![]})[_0x4763('0x21')](function(_0x4d01eb){if(_0x4d01eb&&_0x4d01eb[_0x4763('0x4a')]===0x0){return db[_0x4763('0x20')][_0x4763('0x43')]({'name':_0x14cd2d['name'],'resourceId':_0x14cd2d['id'],'type':_0x4d01eb['name'],'sectionId':_0x4d01eb['id']},{})[_0x4763('0x21')](function(){return _0x37578e;});}else{return _0x37578e;}})[_0x4763('0x3f')](function(_0x4a08cb){logger[_0x4763('0x4b')](_0x4763('0x4c'),_0x4a08cb);throw _0x4a08cb;});}return _0x37578e;})[_0x4763('0x21')](respondWithResult(_0x3fd01b,0xc9))[_0x4763('0x3f')](handleError(_0x3fd01b,null));};exports[_0x4763('0x1e')]=function(_0x3cbe66,_0x48635c){if(_0x3cbe66[_0x4763('0x4d')]['id']){delete _0x3cbe66[_0x4763('0x4d')]['id'];}return db[_0x4763('0x3d')][_0x4763('0x42')]({'where':{'id':_0x3cbe66[_0x4763('0x4e')]['id']}})[_0x4763('0x21')](handleEntityNotFound(_0x48635c,null))['then'](saveUpdates(_0x3cbe66[_0x4763('0x4d')],null))[_0x4763('0x21')](respondWithResult(_0x48635c,null))[_0x4763('0x3f')](handleError(_0x48635c,null));};exports['destroy']=function(_0x3b1226,_0x358863){return db[_0x4763('0x3d')][_0x4763('0x42')]({'where':{'id':_0x3b1226[_0x4763('0x4e')]['id']}})[_0x4763('0x21')](handleEntityNotFound(_0x358863,null))[_0x4763('0x21')](removeEntity(_0x358863,null))[_0x4763('0x3f')](handleError(_0x358863,null));};exports['run']=function(_0x3a237c,_0x445e72,_0x2dd12a){var _0x53bb24=require(_0x4763('0x4f'));return db['Schedule'][_0x4763('0x42')]({'where':{'id':_0x3a237c[_0x4763('0x4e')]['id']},'raw':!![]})[_0x4763('0x21')](handleEntityNotFound(_0x445e72,null))[_0x4763('0x21')](function(){_0x53bb24[_0x4763('0x50')](_0x3a237c[_0x4763('0x4e')]['id']);})[_0x4763('0x21')](respondWithStatusCode(_0x445e72,null))[_0x4763('0x3f')](handleError(_0x445e72,null));}; \ No newline at end of file +var _0x0fa3=['Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','run','../../config/schedule','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','get','Scheduler','UserProfileResource','sendStatus','stack','name','index','map','Schedule','rawAttributes','fieldName','type','model','query','keys','filters','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','findAll','rows','show','params','intersection','include','find','catch','create','body','user'];(function(_0x8b8046,_0x525556){var _0x5c6832=function(_0x5a3e24){while(--_0x5a3e24){_0x8b8046['push'](_0x8b8046['shift']());}};_0x5c6832(++_0x525556);}(_0x0fa3,0x1b1));var _0x30fa=function(_0x10a6c5,_0x3b8168){_0x10a6c5=_0x10a6c5-0x0;var _0x79e4b8=_0x0fa3[_0x10a6c5];return _0x79e4b8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x30fa('0x0'));var zipdir=require(_0x30fa('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x30fa('0x2'));var moment=require(_0x30fa('0x3'));var BPromise=require(_0x30fa('0x4'));var Mustache=require(_0x30fa('0x5'));var util=require(_0x30fa('0x6'));var path=require(_0x30fa('0x7'));var sox=require(_0x30fa('0x8'));var csv=require(_0x30fa('0x9'));var ejs=require(_0x30fa('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x30fa('0xb'));var crypto=require(_0x30fa('0xc'));var jsforce=require(_0x30fa('0xd'));var deskjs=require(_0x30fa('0xe'));var toCsv=require(_0x30fa('0x9'));var querystring=require(_0x30fa('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x30fa('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x30fa('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x30fa('0x12'))('api');var utils=require(_0x30fa('0x13'));var config=require(_0x30fa('0x14'));var licenseUtil=require(_0x30fa('0x15'));var db=require(_0x30fa('0x16'))['db'];function respondWithStatusCode(_0x6647ff,_0xfdcadb){_0xfdcadb=_0xfdcadb||0xcc;return function(_0x1fabc5){if(_0x1fabc5){return _0x6647ff['sendStatus'](_0xfdcadb);}return _0x6647ff[_0x30fa('0x17')](_0xfdcadb)['end']();};}function respondWithResult(_0xd1f98c,_0x539365){_0x539365=_0x539365||0xc8;return function(_0x1059eb){if(_0x1059eb){return _0xd1f98c[_0x30fa('0x17')](_0x539365)['json'](_0x1059eb);}};}function respondWithFilteredResult(_0x1d0a65,_0x32ca97){return function(_0x283d12){if(_0x283d12){var _0x3d5e43=typeof _0x32ca97[_0x30fa('0x18')]===_0x30fa('0x19')&&typeof _0x32ca97[_0x30fa('0x1a')]===_0x30fa('0x19');var _0x6536e8=_0x283d12[_0x30fa('0x1b')];var _0x23ca1e=_0x3d5e43?0x0:_0x32ca97[_0x30fa('0x18')];var _0x4f306e=_0x3d5e43?_0x283d12[_0x30fa('0x1b')]:_0x32ca97[_0x30fa('0x18')]+_0x32ca97['limit'];var _0x363196;if(_0x4f306e>=_0x6536e8){_0x4f306e=_0x6536e8;_0x363196=0xc8;}else{_0x363196=0xce;}_0x1d0a65[_0x30fa('0x17')](_0x363196);return _0x1d0a65[_0x30fa('0x1c')](_0x30fa('0x1d'),_0x23ca1e+'-'+_0x4f306e+'/'+_0x6536e8)[_0x30fa('0x1e')](_0x283d12);}return null;};}function patchUpdates(_0x150dd7){return function(_0x27d184){try{jsonpatch[_0x30fa('0x1f')](_0x27d184,_0x150dd7,!![]);}catch(_0x56b67d){return BPromise[_0x30fa('0x20')](_0x56b67d);}return _0x27d184[_0x30fa('0x21')]();};}function saveUpdates(_0x44ae48,_0x5b5912){return function(_0x209fa2){if(_0x209fa2){return _0x209fa2[_0x30fa('0x22')](_0x44ae48)[_0x30fa('0x23')](function(_0x1854de){return _0x1854de;});}return null;};}function removeEntity(_0x49b51b,_0x10f0ea){return function(_0x5b3e9f){if(_0x5b3e9f){return _0x5b3e9f[_0x30fa('0x24')]()[_0x30fa('0x23')](function(){var _0x24efb5=_0x5b3e9f[_0x30fa('0x25')]({'plain':!![]});var _0x25e322=_0x30fa('0x26');return db[_0x30fa('0x27')]['destroy']({'where':{'type':_0x25e322,'resourceId':_0x24efb5['id']}})['then'](function(){return _0x5b3e9f;});})[_0x30fa('0x23')](function(){_0x49b51b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x52a2c0,_0x411526){return function(_0x48c150){if(!_0x48c150){_0x52a2c0[_0x30fa('0x28')](0x194);}return _0x48c150;};}function handleError(_0xf7abf5,_0x2025c4){_0x2025c4=_0x2025c4||0x1f4;return function(_0x5708e8){logger['error'](_0x5708e8[_0x30fa('0x29')]);if(_0x5708e8[_0x30fa('0x2a')]){delete _0x5708e8[_0x30fa('0x2a')];}_0xf7abf5[_0x30fa('0x17')](_0x2025c4)['send'](_0x5708e8);};}exports[_0x30fa('0x2b')]=function(_0x483e10,_0x227b5c){var _0x19fa27={},_0x7a97c6={},_0x390918={'count':0x0,'rows':[]};var _0x2de608=_[_0x30fa('0x2c')](db[_0x30fa('0x2d')][_0x30fa('0x2e')],function(_0x2dbed8){return{'name':_0x2dbed8[_0x30fa('0x2f')],'type':_0x2dbed8[_0x30fa('0x30')]['key']};});_0x7a97c6[_0x30fa('0x31')]=_[_0x30fa('0x2c')](_0x2de608,_0x30fa('0x2a'));_0x7a97c6[_0x30fa('0x32')]=_[_0x30fa('0x33')](_0x483e10['query']);_0x7a97c6[_0x30fa('0x34')]=_['intersection'](_0x7a97c6[_0x30fa('0x31')],_0x7a97c6['query']);_0x19fa27[_0x30fa('0x35')]=_['intersection'](_0x7a97c6[_0x30fa('0x31')],qs['fields'](_0x483e10[_0x30fa('0x32')][_0x30fa('0x36')]));_0x19fa27[_0x30fa('0x35')]=_0x19fa27[_0x30fa('0x35')][_0x30fa('0x37')]?_0x19fa27['attributes']:_0x7a97c6[_0x30fa('0x31')];if(!_0x483e10[_0x30fa('0x32')][_0x30fa('0x38')]('nolimit')){_0x19fa27[_0x30fa('0x1a')]=qs[_0x30fa('0x1a')](_0x483e10[_0x30fa('0x32')][_0x30fa('0x1a')]);_0x19fa27[_0x30fa('0x18')]=qs[_0x30fa('0x18')](_0x483e10['query'][_0x30fa('0x18')]);}_0x19fa27[_0x30fa('0x39')]=qs['sort'](_0x483e10[_0x30fa('0x32')][_0x30fa('0x3a')]);_0x19fa27[_0x30fa('0x3b')]=qs['filters'](_[_0x30fa('0x3c')](_0x483e10[_0x30fa('0x32')],_0x7a97c6[_0x30fa('0x34')]),_0x2de608);if(_0x483e10[_0x30fa('0x32')]['filter']){_0x19fa27[_0x30fa('0x3b')]=_[_0x30fa('0x3d')](_0x19fa27[_0x30fa('0x3b')],{'$or':_[_0x30fa('0x2c')](_0x2de608,function(_0x29bca6){if(_0x29bca6['type']!==_0x30fa('0x3e')){var _0xf11ba={};_0xf11ba[_0x29bca6[_0x30fa('0x2a')]]={'$like':'%'+_0x483e10[_0x30fa('0x32')][_0x30fa('0x3f')]+'%'};return _0xf11ba;}})});}_0x19fa27=_[_0x30fa('0x3d')]({},_0x19fa27,_0x483e10[_0x30fa('0x40')]);var _0xc5fd78={'where':_0x19fa27[_0x30fa('0x3b')]};return db[_0x30fa('0x2d')][_0x30fa('0x1b')](_0xc5fd78)['then'](function(_0x21ff89){_0x390918[_0x30fa('0x1b')]=_0x21ff89;if(_0x483e10[_0x30fa('0x32')][_0x30fa('0x41')]){_0x19fa27['include']=[{'all':!![]}];}return db[_0x30fa('0x2d')][_0x30fa('0x42')](_0x19fa27);})[_0x30fa('0x23')](function(_0x378a42){_0x390918[_0x30fa('0x43')]=_0x378a42;return _0x390918;})[_0x30fa('0x23')](respondWithFilteredResult(_0x227b5c,_0x19fa27))['catch'](handleError(_0x227b5c,null));};exports[_0x30fa('0x44')]=function(_0xf29e77,_0xacce19){var _0x12f307={'raw':![],'where':{'id':_0xf29e77[_0x30fa('0x45')]['id']}},_0x112138={};_0x112138[_0x30fa('0x31')]=_['keys'](db[_0x30fa('0x2d')][_0x30fa('0x2e')]);_0x112138[_0x30fa('0x32')]=_[_0x30fa('0x33')](_0xf29e77[_0x30fa('0x32')]);_0x112138[_0x30fa('0x34')]=_[_0x30fa('0x46')](_0x112138[_0x30fa('0x31')],_0x112138[_0x30fa('0x32')]);_0x12f307[_0x30fa('0x35')]=_[_0x30fa('0x46')](_0x112138[_0x30fa('0x31')],qs[_0x30fa('0x36')](_0xf29e77[_0x30fa('0x32')][_0x30fa('0x36')]));_0x12f307[_0x30fa('0x35')]=_0x12f307[_0x30fa('0x35')][_0x30fa('0x37')]?_0x12f307['attributes']:_0x112138['model'];if(_0xf29e77[_0x30fa('0x32')][_0x30fa('0x41')]){_0x12f307[_0x30fa('0x47')]=[{'all':!![]}];}_0x12f307=_[_0x30fa('0x3d')]({},_0x12f307,_0xf29e77['options']);return db[_0x30fa('0x2d')][_0x30fa('0x48')](_0x12f307)['then'](handleEntityNotFound(_0xacce19,null))['then'](respondWithResult(_0xacce19,null))[_0x30fa('0x49')](handleError(_0xacce19,null));};exports[_0x30fa('0x4a')]=function(_0x1eb640,_0x531e99){return db[_0x30fa('0x2d')][_0x30fa('0x4a')](_0x1eb640[_0x30fa('0x4b')],{})[_0x30fa('0x23')](function(_0xabb5b7){var _0x57175f=_0x1eb640[_0x30fa('0x4c')][_0x30fa('0x25')]({'plain':!![]});if(!_0x57175f)throw new Error(_0x30fa('0x4d'));if(_0x57175f['role']===_0x30fa('0x4c')){var _0x470027=_0xabb5b7['get']({'plain':!![]});var _0x440d22='Scheduler';return db[_0x30fa('0x4e')][_0x30fa('0x48')]({'where':{'name':_0x440d22,'userProfileId':_0x57175f[_0x30fa('0x4f')]},'raw':!![]})[_0x30fa('0x23')](function(_0x30ed86){if(_0x30ed86&&_0x30ed86[_0x30fa('0x50')]===0x0){return db['UserProfileResource'][_0x30fa('0x4a')]({'name':_0x470027[_0x30fa('0x2a')],'resourceId':_0x470027['id'],'type':_0x30ed86[_0x30fa('0x2a')],'sectionId':_0x30ed86['id']},{})[_0x30fa('0x23')](function(){return _0xabb5b7;});}else{return _0xabb5b7;}})['catch'](function(_0x4d1039){logger[_0x30fa('0x51')](_0x30fa('0x52'),_0x4d1039);throw _0x4d1039;});}return _0xabb5b7;})[_0x30fa('0x23')](respondWithResult(_0x531e99,0xc9))[_0x30fa('0x49')](handleError(_0x531e99,null));};exports[_0x30fa('0x22')]=function(_0x26d1c0,_0x440325){if(_0x26d1c0[_0x30fa('0x4b')]['id']){delete _0x26d1c0[_0x30fa('0x4b')]['id'];}return db[_0x30fa('0x2d')][_0x30fa('0x48')]({'where':{'id':_0x26d1c0[_0x30fa('0x45')]['id']}})[_0x30fa('0x23')](handleEntityNotFound(_0x440325,null))['then'](saveUpdates(_0x26d1c0[_0x30fa('0x4b')],null))['then'](respondWithResult(_0x440325,null))[_0x30fa('0x49')](handleError(_0x440325,null));};exports[_0x30fa('0x24')]=function(_0x144bef,_0x266259){return db[_0x30fa('0x2d')][_0x30fa('0x48')]({'where':{'id':_0x144bef[_0x30fa('0x45')]['id']}})[_0x30fa('0x23')](handleEntityNotFound(_0x266259,null))['then'](removeEntity(_0x266259,null))[_0x30fa('0x49')](handleError(_0x266259,null));};exports[_0x30fa('0x53')]=function(_0x34352b,_0x4687b4,_0x189146){var _0x3e2bca=require(_0x30fa('0x54'));return db[_0x30fa('0x2d')][_0x30fa('0x48')]({'where':{'id':_0x34352b[_0x30fa('0x45')]['id']},'raw':!![]})[_0x30fa('0x23')](handleEntityNotFound(_0x4687b4,null))[_0x30fa('0x23')](function(){_0x3e2bca[_0x30fa('0x53')](_0x34352b['params']['id']);})[_0x30fa('0x23')](respondWithStatusCode(_0x4687b4,null))[_0x30fa('0x49')](handleError(_0x4687b4,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 6d2885c..34e61b6 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 _0x9616=['api','moment','bluebird','request-promise','path','rimraf','./schedule.attributes','define','Schedule','tools_schedules','lodash','util','../../config/logger'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x9616,0xe7));var _0x6961=function(_0x343090,_0x433a80){_0x343090=_0x343090-0x0;var _0x3ff3e8=_0x9616[_0x343090];return _0x3ff3e8;};'use strict';var _=require(_0x6961('0x0'));var util=require(_0x6961('0x1'));var logger=require(_0x6961('0x2'))(_0x6961('0x3'));var moment=require(_0x6961('0x4'));var BPromise=require(_0x6961('0x5'));var rp=require(_0x6961('0x6'));var fs=require('fs');var path=require(_0x6961('0x7'));var rimraf=require(_0x6961('0x8'));var config=require('../../config/environment');var attributes=require(_0x6961('0x9'));module['exports']=function(_0x576d47,_0x1968f0){return _0x576d47[_0x6961('0xa')](_0x6961('0xb'),attributes,{'tableName':_0x6961('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd318=['api','moment','request-promise','path','rimraf','../../config/environment','./schedule.attributes','exports','Schedule','tools_schedules','lodash','util','../../config/logger'];(function(_0x3b3210,_0x25e8ed){var _0x5b5484=function(_0x417858){while(--_0x417858){_0x3b3210['push'](_0x3b3210['shift']());}};_0x5b5484(++_0x25e8ed);}(_0xd318,0x1de));var _0x8d31=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xd318[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x8d31('0x0'));var util=require(_0x8d31('0x1'));var logger=require(_0x8d31('0x2'))(_0x8d31('0x3'));var moment=require(_0x8d31('0x4'));var BPromise=require('bluebird');var rp=require(_0x8d31('0x5'));var fs=require('fs');var path=require(_0x8d31('0x6'));var rimraf=require(_0x8d31('0x7'));var config=require(_0x8d31('0x8'));var attributes=require(_0x8d31('0x9'));module[_0x8d31('0xa')]=function(_0x165b84,_0x3b5d6d){return _0x165b84['define'](_0x8d31('0xb'),attributes,{'tableName':_0x8d31('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/schedule/schedule.rpc.js b/server/api/schedule/schedule.rpc.js index 5f86eaa..922685e 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 _0x462e=['catch','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Schedule,\x20%s,\x20%s','debug','Schedule,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0xb68695,_0x1881a4){var _0x15a817=function(_0x4d04d6){while(--_0x4d04d6){_0xb68695['push'](_0xb68695['shift']());}};_0x15a817(++_0x1881a4);}(_0x462e,0xf1));var _0xe462=function(_0x5ce8c5,_0x114636){_0x5ce8c5=_0x5ce8c5-0x0;var _0x3592d2=_0x462e[_0x5ce8c5];return _0x3592d2;};'use strict';var _=require(_0xe462('0x0'));var util=require(_0xe462('0x1'));var moment=require(_0xe462('0x2'));var BPromise=require(_0xe462('0x3'));var rs=require(_0xe462('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe462('0x5'))(_0xe462('0x6'));var config=require(_0xe462('0x7'));var jayson=require(_0xe462('0x8'));var client=jayson[_0xe462('0x9')][_0xe462('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2cfa78,_0x3beed2,_0x330b95){return new BPromise(function(_0x4b7034,_0x10aec6){return client[_0xe462('0xb')](_0x2cfa78,_0x330b95)[_0xe462('0xc')](function(_0x1165cc){logger[_0xe462('0xd')](_0xe462('0xe'),_0x3beed2,'request\x20sent');logger[_0xe462('0xf')](_0xe462('0x10'),_0x3beed2,_0xe462('0x11'),JSON[_0xe462('0x12')](_0x1165cc));if(_0x1165cc['error']){if(_0x1165cc[_0xe462('0x13')][_0xe462('0x14')]===0x1f4){logger['error'](_0xe462('0xe'),_0x3beed2,_0x1165cc[_0xe462('0x13')][_0xe462('0x15')]);return _0x10aec6(_0x1165cc['error'][_0xe462('0x15')]);}logger['error'](_0xe462('0xe'),_0x3beed2,_0x1165cc[_0xe462('0x13')][_0xe462('0x15')]);return _0x4b7034(_0x1165cc['error'][_0xe462('0x15')]);}else{logger['info'](_0xe462('0xe'),_0x3beed2,_0xe462('0x11'));_0x4b7034(_0x1165cc[_0xe462('0x16')][_0xe462('0x15')]);}})[_0xe462('0x17')](function(_0x10d009){logger['error'](_0xe462('0xe'),_0x3beed2,_0x10d009);_0x10aec6(_0x10d009);});});} \ No newline at end of file +var _0xb8db=['rpc','../../config/environment','client','http','request','then','info','Schedule,\x20%s,\x20%s','request\x20sent','Schedule,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x44a3b0,_0x352810){var _0x39e6f6=function(_0x248002){while(--_0x248002){_0x44a3b0['push'](_0x44a3b0['shift']());}};_0x39e6f6(++_0x352810);}(_0xb8db,0xb7));var _0xbb8d=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xb8db[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xbb8d('0x0'));var util=require(_0xbb8d('0x1'));var moment=require(_0xbb8d('0x2'));var BPromise=require(_0xbb8d('0x3'));var rs=require(_0xbb8d('0x4'));var fs=require('fs');var Redis=require(_0xbb8d('0x5'));var db=require(_0xbb8d('0x6'))['db'];var utils=require(_0xbb8d('0x7'));var logger=require(_0xbb8d('0x8'))(_0xbb8d('0x9'));var config=require(_0xbb8d('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xbb8d('0xb')][_0xbb8d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3f1b3b,_0x1617f4,_0x18daa7){return new BPromise(function(_0x439668,_0x6b9d87){return client[_0xbb8d('0xd')](_0x3f1b3b,_0x18daa7)[_0xbb8d('0xe')](function(_0x4ee9e9){logger[_0xbb8d('0xf')](_0xbb8d('0x10'),_0x1617f4,_0xbb8d('0x11'));logger['debug'](_0xbb8d('0x12'),_0x1617f4,_0xbb8d('0x11'),JSON['stringify'](_0x4ee9e9));if(_0x4ee9e9[_0xbb8d('0x13')]){if(_0x4ee9e9[_0xbb8d('0x13')][_0xbb8d('0x14')]===0x1f4){logger['error'](_0xbb8d('0x10'),_0x1617f4,_0x4ee9e9[_0xbb8d('0x13')][_0xbb8d('0x15')]);return _0x6b9d87(_0x4ee9e9[_0xbb8d('0x13')][_0xbb8d('0x15')]);}logger['error'](_0xbb8d('0x10'),_0x1617f4,_0x4ee9e9[_0xbb8d('0x13')][_0xbb8d('0x15')]);return _0x439668(_0x4ee9e9['error'][_0xbb8d('0x15')]);}else{logger[_0xbb8d('0xf')]('Schedule,\x20%s,\x20%s',_0x1617f4,'request\x20sent');_0x439668(_0x4ee9e9[_0xbb8d('0x16')]['message']);}})[_0xbb8d('0x17')](function(_0x323c11){logger[_0xbb8d('0x13')](_0xbb8d('0x10'),_0x1617f4,_0x323c11);_0x6b9d87(_0x323c11);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index ff2b6fa..78dc760 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 _0x7581=['put','/:id','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','isAuthenticated','index','/describe','describe','get','show','download','post','create'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7581,0xbc));var _0x1758=function(_0xabe2c0,_0x4c4e5f){_0xabe2c0=_0xabe2c0-0x0;var _0x26791f=_0x7581[_0xabe2c0];return _0x26791f;};'use strict';var multer=require(_0x1758('0x0'));var util=require(_0x1758('0x1'));var path=require(_0x1758('0x2'));var timeout=require('connect-timeout');var express=require(_0x1758('0x3'));var router=express[_0x1758('0x4')]();var fs_extra=require(_0x1758('0x5'));var auth=require(_0x1758('0x6'));var interaction=require(_0x1758('0x7'));var config=require(_0x1758('0x8'));var controller=require(_0x1758('0x9'));router['get']('/',auth[_0x1758('0xa')](),controller[_0x1758('0xb')]);router['get'](_0x1758('0xc'),auth[_0x1758('0xa')](),controller[_0x1758('0xd')]);router[_0x1758('0xe')]('/:id',auth[_0x1758('0xa')](),controller[_0x1758('0xf')]);router[_0x1758('0xe')]('/:id/download',auth[_0x1758('0xa')](),controller[_0x1758('0x10')]);router[_0x1758('0x11')]('/',auth[_0x1758('0xa')](),controller[_0x1758('0x12')]);router[_0x1758('0x13')](_0x1758('0x14'),auth[_0x1758('0xa')](),controller['update']);router[_0x1758('0x15')](_0x1758('0x14'),auth['isAuthenticated'](),controller[_0x1758('0x16')]);module['exports']=router; \ No newline at end of file +var _0x4116=['../../components/auth/service','../../config/environment','./screenRecording.controller','get','isAuthenticated','index','describe','/:id/download','download','post','create','put','/:id','update','delete','multer','util','path','connect-timeout','fs-extra'];(function(_0x3f2ecf,_0x4ccad6){var _0xa6dd7e=function(_0x5e04c3){while(--_0x5e04c3){_0x3f2ecf['push'](_0x3f2ecf['shift']());}};_0xa6dd7e(++_0x4ccad6);}(_0x4116,0x87));var _0x6411=function(_0x4fa166,_0x58b7fb){_0x4fa166=_0x4fa166-0x0;var _0x5dd974=_0x4116[_0x4fa166];return _0x5dd974;};'use strict';var multer=require(_0x6411('0x0'));var util=require(_0x6411('0x1'));var path=require(_0x6411('0x2'));var timeout=require(_0x6411('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x6411('0x4'));var auth=require(_0x6411('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6411('0x6'));var controller=require(_0x6411('0x7'));router[_0x6411('0x8')]('/',auth[_0x6411('0x9')](),controller[_0x6411('0xa')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x6411('0xb')]);router[_0x6411('0x8')]('/:id',auth[_0x6411('0x9')](),controller['show']);router[_0x6411('0x8')](_0x6411('0xc'),auth[_0x6411('0x9')](),controller[_0x6411('0xd')]);router[_0x6411('0xe')]('/',auth[_0x6411('0x9')](),controller[_0x6411('0xf')]);router[_0x6411('0x10')](_0x6411('0x11'),auth[_0x6411('0x9')](),controller[_0x6411('0x12')]);router[_0x6411('0x13')]('/:id',auth[_0x6411('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index 31ad0bc..2f1dacb 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 _0x39d2=['extname','STRING','replace','setDataValue','INTEGER','startedAt','subtract','closedAt','duration','DATE','MM-DD-YYYY\x20HH:mm','toString','format','createdAt','sequelize','path','../../config/environment','exports','VIRTUAL','getDataValue','value'];(function(_0x3ae285,_0x27a64f){var _0x38de01=function(_0xdd2ac8){while(--_0xdd2ac8){_0x3ae285['push'](_0x3ae285['shift']());}};_0x38de01(++_0x27a64f);}(_0x39d2,0xf5));var _0x239d=function(_0x1f71d8,_0x278518){_0x1f71d8=_0x1f71d8-0x0;var _0x10b045=_0x39d2[_0x1f71d8];return _0x10b045;};'use strict';var Sequelize=require(_0x239d('0x0'));var moment=require('moment');var path=require(_0x239d('0x1'));var config=require(_0x239d('0x2'));module[_0x239d('0x3')]={'format':{'type':Sequelize[_0x239d('0x4')],'get':function(){return this[_0x239d('0x5')](_0x239d('0x6'))?path[_0x239d('0x7')](this[_0x239d('0x5')](_0x239d('0x6'))):undefined;}},'interactionid':{'type':Sequelize[_0x239d('0x8')]},'channel':{'type':Sequelize[_0x239d('0x8')]},'value':{'type':Sequelize[_0x239d('0x8')],'set':function(_0x1f0947){var _0x53d457=_0x1f0947[_0x239d('0x9')](/\\/g,'/');this[_0x239d('0xa')](_0x239d('0x6'),_0x53d457);}},'rating':{'type':Sequelize[_0x239d('0xb')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x239d('0xb')],'set':function(_0x3d7f32){this[_0x239d('0xa')](_0x239d('0xc'),moment()[_0x239d('0xd')](_0x3d7f32,'ms'));this[_0x239d('0xa')](_0x239d('0xe'),moment());this[_0x239d('0xa')](_0x239d('0xf'),_0x3d7f32);}},'startedAt':{'type':Sequelize[_0x239d('0x10')],'get':function(){return moment(this[_0x239d('0x5')]('startedAt'))['format'](_0x239d('0x11'))[_0x239d('0x12')]();}},'closedAt':{'type':Sequelize[_0x239d('0x10')],'get':function(){return moment(this[_0x239d('0x5')](_0x239d('0xe')))[_0x239d('0x13')](_0x239d('0x11'))[_0x239d('0x12')]();}},'createdAt':{'type':Sequelize[_0x239d('0x10')],'get':function(){return moment(this['getDataValue'](_0x239d('0x14')))[_0x239d('0x13')](_0x239d('0x11'))[_0x239d('0x12')]();}},'updatedAt':{'type':Sequelize[_0x239d('0x10')],'get':function(){return moment(this['getDataValue']('updatedAt'))[_0x239d('0x13')]('MM-DD-YYYY\x20HH:mm')[_0x239d('0x12')]();}}}; \ No newline at end of file +var _0x3fc6=['exports','VIRTUAL','value','extname','getDataValue','STRING','setDataValue','INTEGER','startedAt','closedAt','duration','DATE','format','MM-DD-YYYY\x20HH:mm','toString','createdAt','updatedAt','sequelize','path','../../config/environment'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0x3fc6,0x115));var _0x63fc=function(_0x396880,_0x1ee0cc){_0x396880=_0x396880-0x0;var _0x381a29=_0x3fc6[_0x396880];return _0x381a29;};'use strict';var Sequelize=require(_0x63fc('0x0'));var moment=require('moment');var path=require(_0x63fc('0x1'));var config=require(_0x63fc('0x2'));module[_0x63fc('0x3')]={'format':{'type':Sequelize[_0x63fc('0x4')],'get':function(){return this['getDataValue'](_0x63fc('0x5'))?path[_0x63fc('0x6')](this[_0x63fc('0x7')]('value')):undefined;}},'interactionid':{'type':Sequelize[_0x63fc('0x8')]},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize[_0x63fc('0x8')],'set':function(_0x1c7f72){var _0x3e8157=_0x1c7f72['replace'](/\\/g,'/');this[_0x63fc('0x9')](_0x63fc('0x5'),_0x3e8157);}},'rating':{'type':Sequelize[_0x63fc('0xa')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x63fc('0xa')],'set':function(_0x32749b){this['setDataValue'](_0x63fc('0xb'),moment()['subtract'](_0x32749b,'ms'));this['setDataValue'](_0x63fc('0xc'),moment());this[_0x63fc('0x9')](_0x63fc('0xd'),_0x32749b);}},'startedAt':{'type':Sequelize[_0x63fc('0xe')],'get':function(){return moment(this[_0x63fc('0x7')](_0x63fc('0xb')))[_0x63fc('0xf')](_0x63fc('0x10'))['toString']();}},'closedAt':{'type':Sequelize[_0x63fc('0xe')],'get':function(){return moment(this[_0x63fc('0x7')](_0x63fc('0xc')))['format'](_0x63fc('0x10'))[_0x63fc('0x11')]();}},'createdAt':{'type':Sequelize[_0x63fc('0xe')],'get':function(){return moment(this['getDataValue'](_0x63fc('0x12')))[_0x63fc('0xf')](_0x63fc('0x10'))[_0x63fc('0x11')]();}},'updatedAt':{'type':Sequelize[_0x63fc('0xe')],'get':function(){return moment(this[_0x63fc('0x7')](_0x63fc('0x13')))[_0x63fc('0xf')](_0x63fc('0x10'))[_0x63fc('0x11')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index 2edcf35..8536929 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 _0x7fbe=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','end','error','stack','send','index','map','ScreenRecording','rawAttributes','fieldName','type','key','format','query','keys','intersection','model','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','find','catch','create','body','duration','createdAt','closedAt','params','describe','uniqueid','value','join','root','server/files/screen_recordings','%s.cypher','existsSync','decryptFile','secrets','Sequelize','ValidationError','filename','download','extname','unlink','message','ScreenRecording\x20not\x20found','destroy','isNil','info','cancellazione\x20fisica\x20documento\x20%s','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','File:\x20\x22','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x46e8a9,_0x1bd946){var _0x48a221=function(_0x2484d2){while(--_0x2484d2){_0x46e8a9['push'](_0x46e8a9['shift']());}};_0x48a221(++_0x1bd946);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x5eae0c,_0x36d39b){_0x5eae0c=_0x5eae0c-0x0;var _0x1695ed=_0x7fbe[_0x5eae0c];return _0x1695ed;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe7fb('0x0'));var jsonpatch=require(_0xe7fb('0x1'));var rp=require(_0xe7fb('0x2'));var moment=require(_0xe7fb('0x3'));var BPromise=require(_0xe7fb('0x4'));var Mustache=require(_0xe7fb('0x5'));var util=require(_0xe7fb('0x6'));var path=require(_0xe7fb('0x7'));var sox=require(_0xe7fb('0x8'));var csv=require(_0xe7fb('0x9'));var ejs=require(_0xe7fb('0xa'));var fs=require('fs');var fs_extra=require(_0xe7fb('0xb'));var _=require(_0xe7fb('0xc'));var squel=require(_0xe7fb('0xd'));var crypto=require('crypto');var jsforce=require(_0xe7fb('0xe'));var deskjs=require(_0xe7fb('0xf'));var toCsv=require(_0xe7fb('0x9'));var querystring=require(_0xe7fb('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe7fb('0x11'));var qs=require(_0xe7fb('0x12'));var as=require(_0xe7fb('0x13'));var hardwareService=require(_0xe7fb('0x14'));var logger=require(_0xe7fb('0x15'))(_0xe7fb('0x16'));var utils=require(_0xe7fb('0x17'));var config=require(_0xe7fb('0x18'));var licenseUtil=require(_0xe7fb('0x19'));var db=require(_0xe7fb('0x1a'))['db'];function respondWithStatusCode(_0x2437d4,_0x188e1d){_0x188e1d=_0x188e1d||0xcc;return function(_0xdf9760){if(_0xdf9760){return _0x2437d4[_0xe7fb('0x1b')](_0x188e1d);}return _0x2437d4[_0xe7fb('0x1c')](_0x188e1d)['end']();};}function respondWithResult(_0x278b75,_0x2225e5){_0x2225e5=_0x2225e5||0xc8;return function(_0x5573ab){if(_0x5573ab){return _0x278b75[_0xe7fb('0x1c')](_0x2225e5)[_0xe7fb('0x1d')](_0x5573ab);}};}function respondWithFilteredResult(_0x482f7d,_0xa76acf){return function(_0x559129){if(_0x559129){var _0x12fff6=typeof _0xa76acf[_0xe7fb('0x1e')]===_0xe7fb('0x1f')&&typeof _0xa76acf[_0xe7fb('0x20')]==='undefined';var _0x892b0f=_0x559129['count'];var _0x293a47=_0x12fff6?0x0:_0xa76acf['offset'];var _0x1e77fd=_0x12fff6?_0x559129[_0xe7fb('0x21')]:_0xa76acf[_0xe7fb('0x1e')]+_0xa76acf[_0xe7fb('0x20')];var _0x5df1a1;if(_0x1e77fd>=_0x892b0f){_0x1e77fd=_0x892b0f;_0x5df1a1=0xc8;}else{_0x5df1a1=0xce;}_0x482f7d[_0xe7fb('0x1c')](_0x5df1a1);return _0x482f7d['set'](_0xe7fb('0x22'),_0x293a47+'-'+_0x1e77fd+'/'+_0x892b0f)['json'](_0x559129);}return null;};}function patchUpdates(_0x15f7a4){return function(_0x4ea664){try{jsonpatch[_0xe7fb('0x23')](_0x4ea664,_0x15f7a4,!![]);}catch(_0x135624){return BPromise['reject'](_0x135624);}return _0x4ea664[_0xe7fb('0x24')]();};}function saveUpdates(_0x4742bd,_0x3ae8f1){return function(_0x4dcb4b){if(_0x4dcb4b){return _0x4dcb4b[_0xe7fb('0x25')](_0x4742bd)[_0xe7fb('0x26')](function(_0x5da3d9){return _0x5da3d9;});}return null;};}function removeEntity(_0x5bea27,_0x52f08b){return function(_0x35e4db){if(_0x35e4db){return _0x35e4db['destroy']()['then'](function(){_0x5bea27[_0xe7fb('0x1c')](0xcc)[_0xe7fb('0x27')]();});}};}function handleEntityNotFound(_0x2996ae,_0x4f6c73){return function(_0x6c930){if(!_0x6c930){_0x2996ae[_0xe7fb('0x1b')](0x194);}return _0x6c930;};}function handleError(_0x390f32,_0x1ceed8){_0x1ceed8=_0x1ceed8||0x1f4;return function(_0x392d75){logger[_0xe7fb('0x28')](_0x392d75[_0xe7fb('0x29')]);if(_0x392d75['name']){delete _0x392d75['name'];}_0x390f32[_0xe7fb('0x1c')](_0x1ceed8)[_0xe7fb('0x2a')](_0x392d75);};}exports[_0xe7fb('0x2b')]=function(_0x4fd290,_0xb1f2f4){var _0x251807={},_0xd3fffe={},_0x5f265f={'count':0x0,'rows':[]};var _0x219554=_[_0xe7fb('0x2c')](db[_0xe7fb('0x2d')][_0xe7fb('0x2e')],function(_0x4ce993){return{'name':_0x4ce993[_0xe7fb('0x2f')],'type':_0x4ce993[_0xe7fb('0x30')][_0xe7fb('0x31')]};});_0xd3fffe['model']=_['differenceBy'](_[_0xe7fb('0x2c')](_0x219554,'name'),[_0xe7fb('0x32')]);_0xd3fffe[_0xe7fb('0x33')]=_[_0xe7fb('0x34')](_0x4fd290[_0xe7fb('0x33')]);_0xd3fffe['filters']=_[_0xe7fb('0x35')](_0xd3fffe[_0xe7fb('0x36')],_0xd3fffe[_0xe7fb('0x33')]);_0x251807[_0xe7fb('0x37')]=_[_0xe7fb('0x35')](_0xd3fffe['model'],qs[_0xe7fb('0x38')](_0x4fd290[_0xe7fb('0x33')][_0xe7fb('0x38')]));_0x251807[_0xe7fb('0x37')]=_0x251807[_0xe7fb('0x37')][_0xe7fb('0x39')]?_0x251807[_0xe7fb('0x37')]:_0xd3fffe[_0xe7fb('0x36')];if(!_0x4fd290[_0xe7fb('0x33')]['hasOwnProperty'](_0xe7fb('0x3a'))){_0x251807[_0xe7fb('0x20')]=qs[_0xe7fb('0x20')](_0x4fd290['query'][_0xe7fb('0x20')]);_0x251807[_0xe7fb('0x1e')]=qs[_0xe7fb('0x1e')](_0x4fd290[_0xe7fb('0x33')][_0xe7fb('0x1e')]);}_0x251807[_0xe7fb('0x3b')]=qs[_0xe7fb('0x3c')](_0x4fd290[_0xe7fb('0x33')][_0xe7fb('0x3c')]);_0x251807[_0xe7fb('0x3d')]=qs[_0xe7fb('0x3e')](_[_0xe7fb('0x3f')](_0x4fd290[_0xe7fb('0x33')],_0xd3fffe[_0xe7fb('0x3e')]),_0x219554);if(_0x4fd290[_0xe7fb('0x33')][_0xe7fb('0x40')]){_0x251807[_0xe7fb('0x3d')]=_[_0xe7fb('0x41')](_0x251807[_0xe7fb('0x3d')],{'$or':_['map'](_0x219554,function(_0x261ec5){if(_0x261ec5[_0xe7fb('0x30')]!==_0xe7fb('0x42')){var _0x444f98={};_0x444f98[_0x261ec5['name']]={'$like':'%'+_0x4fd290[_0xe7fb('0x33')][_0xe7fb('0x40')]+'%'};return _0x444f98;}})});}_0x251807=_[_0xe7fb('0x41')]({},_0x251807,_0x4fd290[_0xe7fb('0x43')]);var _0x49fe9d={'where':_0x251807[_0xe7fb('0x3d')]};return db[_0xe7fb('0x2d')][_0xe7fb('0x21')](_0x49fe9d)[_0xe7fb('0x26')](function(_0x468d16){_0x5f265f[_0xe7fb('0x21')]=_0x468d16;if(_0x4fd290['query'][_0xe7fb('0x44')]){_0x251807[_0xe7fb('0x45')]=[{'all':!![]}];}return db[_0xe7fb('0x2d')]['findAll'](_0x251807);})[_0xe7fb('0x26')](function(_0x3a8c52){_0x5f265f['rows']=_0x3a8c52;return _0x5f265f;})['then'](respondWithFilteredResult(_0xb1f2f4,_0x251807))['catch'](handleError(_0xb1f2f4,null));};exports['show']=function(_0x5e0153,_0x900d67){var _0x957ca3={'raw':![],'where':{'id':_0x5e0153['params']['id']}},_0xed62e9={};_0xed62e9[_0xe7fb('0x36')]=_['keys'](db[_0xe7fb('0x2d')][_0xe7fb('0x2e')]);_0xed62e9['query']=_[_0xe7fb('0x34')](_0x5e0153[_0xe7fb('0x33')]);_0xed62e9[_0xe7fb('0x3e')]=_[_0xe7fb('0x35')](_0xed62e9['model'],_0xed62e9[_0xe7fb('0x33')]);_0x957ca3[_0xe7fb('0x37')]=_[_0xe7fb('0x35')](_0xed62e9['model'],qs[_0xe7fb('0x38')](_0x5e0153[_0xe7fb('0x33')][_0xe7fb('0x38')]));_0x957ca3[_0xe7fb('0x37')]=_0x957ca3[_0xe7fb('0x37')]['length']?_0x957ca3[_0xe7fb('0x37')]:_0xed62e9['model'];if(_0x5e0153[_0xe7fb('0x33')][_0xe7fb('0x44')]){_0x957ca3[_0xe7fb('0x45')]=[{'all':!![]}];}_0x957ca3=_[_0xe7fb('0x41')]({},_0x957ca3,_0x5e0153[_0xe7fb('0x43')]);return db['ScreenRecording'][_0xe7fb('0x46')](_0x957ca3)['then'](handleEntityNotFound(_0x900d67,null))['then'](respondWithResult(_0x900d67,null))[_0xe7fb('0x47')](handleError(_0x900d67,null));};exports[_0xe7fb('0x48')]=function(_0x16327f,_0x589555){return db[_0xe7fb('0x2d')][_0xe7fb('0x48')](_0x16327f['body'],{})['then'](respondWithResult(_0x589555,0xc9))[_0xe7fb('0x47')](handleError(_0x589555,null));};exports[_0xe7fb('0x25')]=function(_0x1cbf34,_0x3dd6bf){if(_0x1cbf34[_0xe7fb('0x49')]['id']){delete _0x1cbf34[_0xe7fb('0x49')]['id'];}delete _0x1cbf34[_0xe7fb('0x49')][_0xe7fb('0x4a')];delete _0x1cbf34['body'][_0xe7fb('0x4b')];delete _0x1cbf34['body'][_0xe7fb('0x4c')];delete _0x1cbf34[_0xe7fb('0x49')]['value'];return db[_0xe7fb('0x2d')]['find']({'where':{'id':_0x1cbf34[_0xe7fb('0x4d')]['id']}})['then'](handleEntityNotFound(_0x3dd6bf,null))[_0xe7fb('0x26')](saveUpdates(_0x1cbf34['body'],null))[_0xe7fb('0x26')](respondWithResult(_0x3dd6bf,null))['catch'](handleError(_0x3dd6bf,null));};exports[_0xe7fb('0x4e')]=function(_0x1b6442,_0x41fcfb){return db[_0xe7fb('0x2d')][_0xe7fb('0x4e')]()[_0xe7fb('0x26')](respondWithResult(_0x41fcfb,null))[_0xe7fb('0x47')](handleError(_0x41fcfb,null));};exports['download']=function(_0x5d20dc,_0x20aa55,_0x4948a7){var _0x4f4240=require('../../components/encryptor');var _0x50b8df=![];var _0x539252={};if(_0x5d20dc[_0xe7fb('0x33')][_0xe7fb('0x30')]&&_0x5d20dc[_0xe7fb('0x33')][_0xe7fb('0x30')]==='uniqueid'){_0x539252[_0xe7fb('0x4f')]=_0x5d20dc[_0xe7fb('0x4d')]['id'];}else{_0x539252['id']=_0x5d20dc[_0xe7fb('0x4d')]['id'];}return db['ScreenRecording']['find']({'where':_0x539252,'attributes':['id',_0xe7fb('0x50')],'raw':!![]})[_0xe7fb('0x26')](handleEntityNotFound(_0x20aa55,null))[_0xe7fb('0x26')](function(_0x4f4ba3){if(_0x4f4ba3){var _0x27f860=path[_0xe7fb('0x51')](config[_0xe7fb('0x52')],_0xe7fb('0x53'),_0x4f4ba3['value']);var _0x4b35f9=util[_0xe7fb('0x32')](_0xe7fb('0x54'),_0x27f860);if(fs[_0xe7fb('0x55')](_0x4b35f9)){_0x50b8df=!![];return _0x4f4240[_0xe7fb('0x56')](_0x4b35f9,_0x27f860,config[_0xe7fb('0x57')]['recording'])[_0xe7fb('0x26')](function(){return _0x4f4ba3;});}return _0x4f4ba3;}})[_0xe7fb('0x26')](function(_0x23755b){if(_0x23755b){var _0x590d7a=path['join'](config[_0xe7fb('0x52')],_0xe7fb('0x53'),_0x23755b[_0xe7fb('0x50')]);if(!fs[_0xe7fb('0x55')](_0x590d7a)){throw new db[(_0xe7fb('0x58'))][(_0xe7fb('0x59'))]('ScreenRecording\x20not\x20found');}if(_0x23755b[_0xe7fb('0x5a')]){return _0x20aa55[_0xe7fb('0x5b')](_0x590d7a,_0x23755b[_0xe7fb('0x5a')]+path[_0xe7fb('0x5c')](_0x590d7a),function(){if(_0x50b8df){fs[_0xe7fb('0x5d')](_0x590d7a);}});}else{return _0x20aa55[_0xe7fb('0x5b')](_0x590d7a,function(_0x554092){if(_0x50b8df){fs[_0xe7fb('0x5d')](_0x590d7a);}});}}})['catch'](function(_0x1eda1d){if(_0x1eda1d[_0xe7fb('0x5e')]===_0xe7fb('0x5f')){_0x20aa55[_0xe7fb('0x1c')](0x194)['send']('Not\x20found');}else{return handleError(_0x20aa55,null);}});};exports[_0xe7fb('0x60')]=function(_0x11e15a,_0x25aeb2){return db[_0xe7fb('0x2d')][_0xe7fb('0x46')]({'where':{'id':_0x11e15a['params']['id']}})[_0xe7fb('0x26')](function(_0x58d4ec){if(_[_0xe7fb('0x61')](_0x58d4ec)){throw new ReferenceError('Entity\x20not\x20found');}return _0x58d4ec;})['then'](function(_0xc13fac){var _0x203da3=path[_0xe7fb('0x51')](config['root'],_0xe7fb('0x53'),_0xc13fac[_0xe7fb('0x50')]);logger[_0xe7fb('0x62')](_0xe7fb('0x63'),_0x203da3);if(!_[_0xe7fb('0x61')](_0xc13fac['value'])&&fs[_0xe7fb('0x55')](_0x203da3)){logger[_0xe7fb('0x62')]('File:\x20\x22'+_0x203da3+_0xe7fb('0x64'));fs[_0xe7fb('0x65')](_0x203da3);}_0x203da3=_0x203da3+'.cypher';if(!_[_0xe7fb('0x61')](_0xc13fac['value'])&&fs[_0xe7fb('0x55')](_0x203da3)){logger[_0xe7fb('0x62')](_0xe7fb('0x66')+_0x203da3+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xe7fb('0x65')](_0x203da3);}return _0xc13fac;})[_0xe7fb('0x26')](function(_0x2c558a){if(!_0x2c558a)throw new InternalError();return _0x2c558a[_0xe7fb('0x60')]();})[_0xe7fb('0x26')](function(){_0x25aeb2[_0xe7fb('0x1c')](0xcc)[_0xe7fb('0x27')]();})[_0xe7fb('0x47')](handleError(_0x25aeb2,null));}; \ No newline at end of file +var _0xb138=['format','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','merge','options','findAll','rows','catch','params','keys','includeAll','include','find','create','body','closedAt','value','describe','download','../../components/encryptor','uniqueid','join','root','server/files/screen_recordings','%s.cypher','decryptFile','secrets','existsSync','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','Entity\x20not\x20found','info','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','ScreenRecording','rawAttributes','fieldName','type','key','model'];(function(_0x1b943f,_0x6f6e83){var _0x8b7549=function(_0x5b52d3){while(--_0x5b52d3){_0x1b943f['push'](_0x1b943f['shift']());}};_0x8b7549(++_0x6f6e83);}(_0xb138,0x1dd));var _0x8b13=function(_0x569bf8,_0x3dcec0){_0x569bf8=_0x569bf8-0x0;var _0x29045e=_0xb138[_0x569bf8];return _0x29045e;};'use strict';var emlformat=require(_0x8b13('0x0'));var rimraf=require(_0x8b13('0x1'));var zipdir=require(_0x8b13('0x2'));var jsonpatch=require(_0x8b13('0x3'));var rp=require(_0x8b13('0x4'));var moment=require(_0x8b13('0x5'));var BPromise=require(_0x8b13('0x6'));var Mustache=require('mustache');var util=require(_0x8b13('0x7'));var path=require(_0x8b13('0x8'));var sox=require(_0x8b13('0x9'));var csv=require('to-csv');var ejs=require(_0x8b13('0xa'));var fs=require('fs');var fs_extra=require(_0x8b13('0xb'));var _=require('lodash');var squel=require(_0x8b13('0xc'));var crypto=require(_0x8b13('0xd'));var jsforce=require(_0x8b13('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x8b13('0xf'));var querystring=require(_0x8b13('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8b13('0x11'));var qs=require(_0x8b13('0x12'));var as=require(_0x8b13('0x13'));var hardwareService=require(_0x8b13('0x14'));var logger=require(_0x8b13('0x15'))('api');var utils=require(_0x8b13('0x16'));var config=require(_0x8b13('0x17'));var licenseUtil=require(_0x8b13('0x18'));var db=require(_0x8b13('0x19'))['db'];function respondWithStatusCode(_0xb227e0,_0x1893b1){_0x1893b1=_0x1893b1||0xcc;return function(_0x58f97e){if(_0x58f97e){return _0xb227e0['sendStatus'](_0x1893b1);}return _0xb227e0[_0x8b13('0x1a')](_0x1893b1)[_0x8b13('0x1b')]();};}function respondWithResult(_0x5f12b5,_0x51a935){_0x51a935=_0x51a935||0xc8;return function(_0x479773){if(_0x479773){return _0x5f12b5[_0x8b13('0x1a')](_0x51a935)[_0x8b13('0x1c')](_0x479773);}};}function respondWithFilteredResult(_0xf29086,_0x2c615a){return function(_0x13f956){if(_0x13f956){var _0x542357=typeof _0x2c615a[_0x8b13('0x1d')]===_0x8b13('0x1e')&&typeof _0x2c615a[_0x8b13('0x1f')]===_0x8b13('0x1e');var _0x3eed21=_0x13f956[_0x8b13('0x20')];var _0x10fbde=_0x542357?0x0:_0x2c615a[_0x8b13('0x1d')];var _0x4989d3=_0x542357?_0x13f956['count']:_0x2c615a[_0x8b13('0x1d')]+_0x2c615a[_0x8b13('0x1f')];var _0x14a8ac;if(_0x4989d3>=_0x3eed21){_0x4989d3=_0x3eed21;_0x14a8ac=0xc8;}else{_0x14a8ac=0xce;}_0xf29086[_0x8b13('0x1a')](_0x14a8ac);return _0xf29086[_0x8b13('0x21')](_0x8b13('0x22'),_0x10fbde+'-'+_0x4989d3+'/'+_0x3eed21)['json'](_0x13f956);}return null;};}function patchUpdates(_0x1e8a48){return function(_0x3c4d4f){try{jsonpatch[_0x8b13('0x23')](_0x3c4d4f,_0x1e8a48,!![]);}catch(_0x54a309){return BPromise['reject'](_0x54a309);}return _0x3c4d4f[_0x8b13('0x24')]();};}function saveUpdates(_0xcb7621,_0x4f9902){return function(_0x3187ed){if(_0x3187ed){return _0x3187ed[_0x8b13('0x25')](_0xcb7621)[_0x8b13('0x26')](function(_0x213280){return _0x213280;});}return null;};}function removeEntity(_0xc05d5c,_0x583639){return function(_0x339271){if(_0x339271){return _0x339271[_0x8b13('0x27')]()['then'](function(){_0xc05d5c[_0x8b13('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x420772,_0x325d68){return function(_0x54786a){if(!_0x54786a){_0x420772[_0x8b13('0x28')](0x194);}return _0x54786a;};}function handleError(_0x3223d8,_0x4f8e58){_0x4f8e58=_0x4f8e58||0x1f4;return function(_0x134c5e){logger[_0x8b13('0x29')](_0x134c5e[_0x8b13('0x2a')]);if(_0x134c5e[_0x8b13('0x2b')]){delete _0x134c5e[_0x8b13('0x2b')];}_0x3223d8['status'](_0x4f8e58)[_0x8b13('0x2c')](_0x134c5e);};}exports[_0x8b13('0x2d')]=function(_0x3475d8,_0x1511bf){var _0x114b01={},_0x2bb51d={},_0x5ab161={'count':0x0,'rows':[]};var _0x35fdca=_[_0x8b13('0x2e')](db[_0x8b13('0x2f')][_0x8b13('0x30')],function(_0x23fde7){return{'name':_0x23fde7[_0x8b13('0x31')],'type':_0x23fde7[_0x8b13('0x32')][_0x8b13('0x33')]};});_0x2bb51d[_0x8b13('0x34')]=_['differenceBy'](_[_0x8b13('0x2e')](_0x35fdca,_0x8b13('0x2b')),[_0x8b13('0x35')]);_0x2bb51d[_0x8b13('0x36')]=_['keys'](_0x3475d8['query']);_0x2bb51d[_0x8b13('0x37')]=_['intersection'](_0x2bb51d['model'],_0x2bb51d[_0x8b13('0x36')]);_0x114b01['attributes']=_[_0x8b13('0x38')](_0x2bb51d[_0x8b13('0x34')],qs[_0x8b13('0x39')](_0x3475d8[_0x8b13('0x36')][_0x8b13('0x39')]));_0x114b01[_0x8b13('0x3a')]=_0x114b01[_0x8b13('0x3a')][_0x8b13('0x3b')]?_0x114b01[_0x8b13('0x3a')]:_0x2bb51d[_0x8b13('0x34')];if(!_0x3475d8['query'][_0x8b13('0x3c')](_0x8b13('0x3d'))){_0x114b01[_0x8b13('0x1f')]=qs[_0x8b13('0x1f')](_0x3475d8[_0x8b13('0x36')][_0x8b13('0x1f')]);_0x114b01[_0x8b13('0x1d')]=qs[_0x8b13('0x1d')](_0x3475d8['query'][_0x8b13('0x1d')]);}_0x114b01['order']=qs[_0x8b13('0x3e')](_0x3475d8[_0x8b13('0x36')][_0x8b13('0x3e')]);_0x114b01[_0x8b13('0x3f')]=qs[_0x8b13('0x37')](_[_0x8b13('0x40')](_0x3475d8['query'],_0x2bb51d['filters']),_0x35fdca);if(_0x3475d8[_0x8b13('0x36')]['filter']){_0x114b01[_0x8b13('0x3f')]=_['merge'](_0x114b01[_0x8b13('0x3f')],{'$or':_[_0x8b13('0x2e')](_0x35fdca,function(_0x29a359){if(_0x29a359[_0x8b13('0x32')]!==_0x8b13('0x41')){var _0x4e16e7={};_0x4e16e7[_0x29a359['name']]={'$like':'%'+_0x3475d8[_0x8b13('0x36')]['filter']+'%'};return _0x4e16e7;}})});}_0x114b01=_[_0x8b13('0x42')]({},_0x114b01,_0x3475d8[_0x8b13('0x43')]);var _0x4dc268={'where':_0x114b01[_0x8b13('0x3f')]};return db[_0x8b13('0x2f')][_0x8b13('0x20')](_0x4dc268)[_0x8b13('0x26')](function(_0x2f4e7f){_0x5ab161[_0x8b13('0x20')]=_0x2f4e7f;if(_0x3475d8[_0x8b13('0x36')]['includeAll']){_0x114b01['include']=[{'all':!![]}];}return db['ScreenRecording'][_0x8b13('0x44')](_0x114b01);})[_0x8b13('0x26')](function(_0x27cfe5){_0x5ab161[_0x8b13('0x45')]=_0x27cfe5;return _0x5ab161;})[_0x8b13('0x26')](respondWithFilteredResult(_0x1511bf,_0x114b01))[_0x8b13('0x46')](handleError(_0x1511bf,null));};exports['show']=function(_0x4342db,_0x50e535){var _0x13d0ef={'raw':![],'where':{'id':_0x4342db[_0x8b13('0x47')]['id']}},_0x5ce9c8={};_0x5ce9c8[_0x8b13('0x34')]=_[_0x8b13('0x48')](db[_0x8b13('0x2f')][_0x8b13('0x30')]);_0x5ce9c8[_0x8b13('0x36')]=_[_0x8b13('0x48')](_0x4342db['query']);_0x5ce9c8['filters']=_['intersection'](_0x5ce9c8[_0x8b13('0x34')],_0x5ce9c8[_0x8b13('0x36')]);_0x13d0ef[_0x8b13('0x3a')]=_[_0x8b13('0x38')](_0x5ce9c8['model'],qs['fields'](_0x4342db[_0x8b13('0x36')]['fields']));_0x13d0ef[_0x8b13('0x3a')]=_0x13d0ef[_0x8b13('0x3a')][_0x8b13('0x3b')]?_0x13d0ef[_0x8b13('0x3a')]:_0x5ce9c8[_0x8b13('0x34')];if(_0x4342db['query'][_0x8b13('0x49')]){_0x13d0ef[_0x8b13('0x4a')]=[{'all':!![]}];}_0x13d0ef=_[_0x8b13('0x42')]({},_0x13d0ef,_0x4342db[_0x8b13('0x43')]);return db[_0x8b13('0x2f')][_0x8b13('0x4b')](_0x13d0ef)[_0x8b13('0x26')](handleEntityNotFound(_0x50e535,null))[_0x8b13('0x26')](respondWithResult(_0x50e535,null))[_0x8b13('0x46')](handleError(_0x50e535,null));};exports['create']=function(_0x46d096,_0x59d863){return db[_0x8b13('0x2f')][_0x8b13('0x4c')](_0x46d096[_0x8b13('0x4d')],{})['then'](respondWithResult(_0x59d863,0xc9))[_0x8b13('0x46')](handleError(_0x59d863,null));};exports[_0x8b13('0x25')]=function(_0x257107,_0x4129c0){if(_0x257107[_0x8b13('0x4d')]['id']){delete _0x257107[_0x8b13('0x4d')]['id'];}delete _0x257107[_0x8b13('0x4d')]['duration'];delete _0x257107[_0x8b13('0x4d')]['createdAt'];delete _0x257107[_0x8b13('0x4d')][_0x8b13('0x4e')];delete _0x257107[_0x8b13('0x4d')][_0x8b13('0x4f')];return db[_0x8b13('0x2f')][_0x8b13('0x4b')]({'where':{'id':_0x257107[_0x8b13('0x47')]['id']}})[_0x8b13('0x26')](handleEntityNotFound(_0x4129c0,null))[_0x8b13('0x26')](saveUpdates(_0x257107[_0x8b13('0x4d')],null))[_0x8b13('0x26')](respondWithResult(_0x4129c0,null))[_0x8b13('0x46')](handleError(_0x4129c0,null));};exports[_0x8b13('0x50')]=function(_0x2bdfae,_0x42c29d){return db[_0x8b13('0x2f')][_0x8b13('0x50')]()['then'](respondWithResult(_0x42c29d,null))[_0x8b13('0x46')](handleError(_0x42c29d,null));};exports[_0x8b13('0x51')]=function(_0x4c19f6,_0x342fff,_0x328373){var _0x2fc00c=require(_0x8b13('0x52'));var _0x25cb45=![];var _0x12549b={};if(_0x4c19f6[_0x8b13('0x36')][_0x8b13('0x32')]&&_0x4c19f6[_0x8b13('0x36')][_0x8b13('0x32')]===_0x8b13('0x53')){_0x12549b[_0x8b13('0x53')]=_0x4c19f6[_0x8b13('0x47')]['id'];}else{_0x12549b['id']=_0x4c19f6[_0x8b13('0x47')]['id'];}return db[_0x8b13('0x2f')]['find']({'where':_0x12549b,'attributes':['id',_0x8b13('0x4f')],'raw':!![]})[_0x8b13('0x26')](handleEntityNotFound(_0x342fff,null))['then'](function(_0x11e8af){if(_0x11e8af){var _0x73aba5=path[_0x8b13('0x54')](config[_0x8b13('0x55')],_0x8b13('0x56'),_0x11e8af['value']);var _0x1fd105=util[_0x8b13('0x35')](_0x8b13('0x57'),_0x73aba5);if(fs['existsSync'](_0x1fd105)){_0x25cb45=!![];return _0x2fc00c[_0x8b13('0x58')](_0x1fd105,_0x73aba5,config[_0x8b13('0x59')]['recording'])[_0x8b13('0x26')](function(){return _0x11e8af;});}return _0x11e8af;}})[_0x8b13('0x26')](function(_0x475c8d){if(_0x475c8d){var _0xd29067=path['join'](config[_0x8b13('0x55')],_0x8b13('0x56'),_0x475c8d['value']);if(!fs[_0x8b13('0x5a')](_0xd29067)){throw new db[(_0x8b13('0x5b'))][(_0x8b13('0x5c'))](_0x8b13('0x5d'));}if(_0x475c8d['filename']){return _0x342fff[_0x8b13('0x51')](_0xd29067,_0x475c8d[_0x8b13('0x5e')]+path[_0x8b13('0x5f')](_0xd29067),function(){if(_0x25cb45){fs[_0x8b13('0x60')](_0xd29067);}});}else{return _0x342fff[_0x8b13('0x51')](_0xd29067,function(_0x2fff4e){if(_0x25cb45){fs['unlink'](_0xd29067);}});}}})[_0x8b13('0x46')](function(_0x1082d9){if(_0x1082d9[_0x8b13('0x61')]==='ScreenRecording\x20not\x20found'){_0x342fff[_0x8b13('0x1a')](0x194)[_0x8b13('0x2c')](_0x8b13('0x62'));}else{return handleError(_0x342fff,null);}});};exports[_0x8b13('0x27')]=function(_0x4d8f23,_0x59a6b3){return db['ScreenRecording']['find']({'where':{'id':_0x4d8f23['params']['id']}})[_0x8b13('0x26')](function(_0x1bc936){if(_['isNil'](_0x1bc936)){throw new ReferenceError(_0x8b13('0x63'));}return _0x1bc936;})['then'](function(_0x274bad){var _0x2d2fa3=path[_0x8b13('0x54')](config[_0x8b13('0x55')],_0x8b13('0x56'),_0x274bad[_0x8b13('0x4f')]);logger[_0x8b13('0x64')]('cancellazione\x20fisica\x20documento\x20%s',_0x2d2fa3);if(!_[_0x8b13('0x65')](_0x274bad['value'])&&fs[_0x8b13('0x5a')](_0x2d2fa3)){logger[_0x8b13('0x64')](_0x8b13('0x66')+_0x2d2fa3+_0x8b13('0x67'));fs[_0x8b13('0x68')](_0x2d2fa3);}_0x2d2fa3=_0x2d2fa3+_0x8b13('0x69');if(!_[_0x8b13('0x65')](_0x274bad['value'])&&fs[_0x8b13('0x5a')](_0x2d2fa3)){logger['info'](_0x8b13('0x66')+_0x2d2fa3+_0x8b13('0x67'));fs[_0x8b13('0x68')](_0x2d2fa3);}return _0x274bad;})[_0x8b13('0x26')](function(_0x177a64){if(!_0x177a64)throw new InternalError();return _0x177a64['destroy']();})['then'](function(){_0x59a6b3[_0x8b13('0x1a')](0xcc)[_0x8b13('0x1b')]();})['catch'](handleError(_0x59a6b3,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index d5a1797..f3cc5fe 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 _0x97ef=['util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','ScreenRecording','screen_recordings','interactionid'];(function(_0x54af0d,_0x3e5db0){var _0x57b08d=function(_0x35d93a){while(--_0x35d93a){_0x54af0d['push'](_0x54af0d['shift']());}};_0x57b08d(++_0x3e5db0);}(_0x97ef,0x168));var _0xf97e=function(_0x57796a,_0x3db5fc){_0x57796a=_0x57796a-0x0;var _0x39883b=_0x97ef[_0x57796a];return _0x39883b;};'use strict';var _=require('lodash');var util=require(_0xf97e('0x0'));var logger=require(_0xf97e('0x1'))(_0xf97e('0x2'));var moment=require(_0xf97e('0x3'));var BPromise=require(_0xf97e('0x4'));var rp=require(_0xf97e('0x5'));var fs=require('fs');var path=require(_0xf97e('0x6'));var rimraf=require('rimraf');var config=require(_0xf97e('0x7'));var attributes=require('./screenRecording.attributes');module[_0xf97e('0x8')]=function(_0x559db3,_0x43383d){return _0x559db3['define'](_0xf97e('0x9'),attributes,{'tableName':_0xf97e('0xa'),'paranoid':![],'indexes':[{'name':_0xf97e('0xb'),'fields':[_0xf97e('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2017=['ScreenRecording','interactionid','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./screenRecording.attributes','exports'];(function(_0x8dc04d,_0xaa7559){var _0x2f5f28=function(_0xdd2d1d){while(--_0xdd2d1d){_0x8dc04d['push'](_0x8dc04d['shift']());}};_0x2f5f28(++_0xaa7559);}(_0x2017,0x113));var _0x7201=function(_0x1d0499,_0x23e22f){_0x1d0499=_0x1d0499-0x0;var _0x153fb3=_0x2017[_0x1d0499];return _0x153fb3;};'use strict';var _=require(_0x7201('0x0'));var util=require(_0x7201('0x1'));var logger=require(_0x7201('0x2'))('api');var moment=require(_0x7201('0x3'));var BPromise=require(_0x7201('0x4'));var rp=require(_0x7201('0x5'));var fs=require('fs');var path=require(_0x7201('0x6'));var rimraf=require(_0x7201('0x7'));var config=require(_0x7201('0x8'));var attributes=require(_0x7201('0x9'));module[_0x7201('0xa')]=function(_0x4822e4,_0x46cd5a){return _0x4822e4['define'](_0x7201('0xb'),attributes,{'tableName':'screen_recordings','paranoid':![],'indexes':[{'name':_0x7201('0xc'),'fields':[_0x7201('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index 5c66e8d..345b18d 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 _0x967f=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','ScreenRecording,\x20%s,\x20%s','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','lodash'];(function(_0x5b13c0,_0x450043){var _0x45c616=function(_0x5b7bd7){while(--_0x5b7bd7){_0x5b13c0['push'](_0x5b13c0['shift']());}};_0x45c616(++_0x450043);}(_0x967f,0xbf));var _0xf967=function(_0x4cb6c9,_0x35808c){_0x4cb6c9=_0x4cb6c9-0x0;var _0x1fe48c=_0x967f[_0x4cb6c9];return _0x1fe48c;};'use strict';var _=require(_0xf967('0x0'));var util=require(_0xf967('0x1'));var moment=require('moment');var BPromise=require(_0xf967('0x2'));var rs=require(_0xf967('0x3'));var fs=require('fs');var Redis=require(_0xf967('0x4'));var db=require(_0xf967('0x5'))['db'];var utils=require(_0xf967('0x6'));var logger=require(_0xf967('0x7'))(_0xf967('0x8'));var config=require(_0xf967('0x9'));var jayson=require(_0xf967('0xa'));var client=jayson[_0xf967('0xb')][_0xf967('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x19ddac,_0x39273b,_0x2e6ab8){return new BPromise(function(_0x258acf,_0x22f13d){return client[_0xf967('0xd')](_0x19ddac,_0x2e6ab8)['then'](function(_0x4ca82a){logger[_0xf967('0xe')](_0xf967('0xf'),_0x39273b,'request\x20sent');logger[_0xf967('0x10')](_0xf967('0x11'),_0x39273b,'request\x20sent',JSON[_0xf967('0x12')](_0x4ca82a));if(_0x4ca82a['error']){if(_0x4ca82a[_0xf967('0x13')][_0xf967('0x14')]===0x1f4){logger[_0xf967('0x13')](_0xf967('0xf'),_0x39273b,_0x4ca82a['error']['message']);return _0x22f13d(_0x4ca82a['error'][_0xf967('0x15')]);}logger[_0xf967('0x13')](_0xf967('0xf'),_0x39273b,_0x4ca82a['error'][_0xf967('0x15')]);return _0x258acf(_0x4ca82a['error'][_0xf967('0x15')]);}else{logger['info'](_0xf967('0xf'),_0x39273b,_0xf967('0x16'));_0x258acf(_0x4ca82a['result'][_0xf967('0x15')]);}})[_0xf967('0x17')](function(_0x974605){logger[_0xf967('0x13')](_0xf967('0xf'),_0x39273b,_0x974605);_0x22f13d(_0x974605);});});} \ No newline at end of file +var _0xd2dd=['moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','ScreenRecording,\x20%s,\x20%s','message','error','result','lodash','util'];(function(_0x5e4a4d,_0x522015){var _0x1ffbfc=function(_0xdb4f23){while(--_0xdb4f23){_0x5e4a4d['push'](_0x5e4a4d['shift']());}};_0x1ffbfc(++_0x522015);}(_0xd2dd,0x1de));var _0xdd2d=function(_0x31793e,_0x48f246){_0x31793e=_0x31793e-0x0;var _0x3e4f32=_0xd2dd[_0x31793e];return _0x3e4f32;};'use strict';var _=require(_0xdd2d('0x0'));var util=require(_0xdd2d('0x1'));var moment=require(_0xdd2d('0x2'));var BPromise=require(_0xdd2d('0x3'));var rs=require(_0xdd2d('0x4'));var fs=require('fs');var Redis=require(_0xdd2d('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xdd2d('0x6'));var logger=require('../../config/logger')(_0xdd2d('0x7'));var config=require(_0xdd2d('0x8'));var jayson=require(_0xdd2d('0x9'));var client=jayson[_0xdd2d('0xa')][_0xdd2d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x50f638,_0x1cb55a,_0x3ce98f){return new BPromise(function(_0x177a3f,_0x48538b){return client[_0xdd2d('0xc')](_0x50f638,_0x3ce98f)[_0xdd2d('0xd')](function(_0x5f6458){logger[_0xdd2d('0xe')]('ScreenRecording,\x20%s,\x20%s',_0x1cb55a,'request\x20sent');logger[_0xdd2d('0xf')](_0xdd2d('0x10'),_0x1cb55a,_0xdd2d('0x11'),JSON[_0xdd2d('0x12')](_0x5f6458));if(_0x5f6458['error']){if(_0x5f6458['error'][_0xdd2d('0x13')]===0x1f4){logger['error'](_0xdd2d('0x14'),_0x1cb55a,_0x5f6458['error'][_0xdd2d('0x15')]);return _0x48538b(_0x5f6458[_0xdd2d('0x16')][_0xdd2d('0x15')]);}logger[_0xdd2d('0x16')](_0xdd2d('0x14'),_0x1cb55a,_0x5f6458[_0xdd2d('0x16')][_0xdd2d('0x15')]);return _0x177a3f(_0x5f6458['error'][_0xdd2d('0x15')]);}else{logger[_0xdd2d('0xe')]('ScreenRecording,\x20%s,\x20%s',_0x1cb55a,'request\x20sent');_0x177a3f(_0x5f6458[_0xdd2d('0x17')]['message']);}})['catch'](function(_0x58bc82){logger['error']('ScreenRecording,\x20%s,\x20%s',_0x1cb55a,_0x58bc82);_0x48538b(_0x58bc82);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 245ea25..3633baf 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 _0xed13=['./setting.controller','get','isAuthenticated','/now','/:id','show','/:id/logo_login','getLogoLogin','gdpr','/:id/preferred','/:id/favicon','getFavicon','diskStorage','join','root','server/files/images/logos/','format','%s%s','extname','originalname','/:id/logo','file','addLogo','post','single','addLogoLogin','addPreferred','favicon','addFavicon','update','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3b0295,_0x4bbcc9){var _0x7ec08c=function(_0x4bfc0a){while(--_0x4bfc0a){_0x3b0295['push'](_0x3b0295['shift']());}};_0x7ec08c(++_0x4bbcc9);}(_0xed13,0x10f));var _0x3ed1=function(_0x38b859,_0x70f120){_0x38b859=_0x38b859-0x0;var _0x287eb5=_0xed13[_0x38b859];return _0x287eb5;};'use strict';var multer=require(_0x3ed1('0x0'));var util=require(_0x3ed1('0x1'));var path=require(_0x3ed1('0x2'));var timeout=require(_0x3ed1('0x3'));var express=require(_0x3ed1('0x4'));var router=express[_0x3ed1('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x3ed1('0x6'));var interaction=require(_0x3ed1('0x7'));var config=require(_0x3ed1('0x8'));var controller=require(_0x3ed1('0x9'));router[_0x3ed1('0xa')]('/',auth[_0x3ed1('0xb')](),controller['index']);router[_0x3ed1('0xa')](_0x3ed1('0xc'),controller['getDate']);router['get'](_0x3ed1('0xd'),controller[_0x3ed1('0xe')]);router[_0x3ed1('0xa')]('/:id/logo',controller['getLogo']);router[_0x3ed1('0xa')](_0x3ed1('0xf'),controller[_0x3ed1('0x10')]);router[_0x3ed1('0xa')]('/:id/gdpr',controller[_0x3ed1('0x11')]);router[_0x3ed1('0xa')](_0x3ed1('0x12'),controller['getPreferred']);router[_0x3ed1('0xa')](_0x3ed1('0x13'),controller[_0x3ed1('0x14')]);var upload=multer({'storage':multer[_0x3ed1('0x15')]({'destination':function(_0x4c69ef,_0x5d3d22,_0x212cb5){_0x212cb5(null,path[_0x3ed1('0x16')](config[_0x3ed1('0x17')],_0x3ed1('0x18')));},'filename':function(_0xb53b1b,_0x484330,_0x941e1f){_0x941e1f(null,util[_0x3ed1('0x19')](_0x3ed1('0x1a'),'logo',path[_0x3ed1('0x1b')](_0x484330[_0x3ed1('0x1c')])));}})});router['post'](_0x3ed1('0x1d'),upload['single'](_0x3ed1('0x1e')),controller[_0x3ed1('0x1f')]);var upload=multer({'storage':multer[_0x3ed1('0x15')]({'destination':function(_0x266be9,_0x529710,_0x16dc95){_0x16dc95(null,path[_0x3ed1('0x16')](config[_0x3ed1('0x17')],_0x3ed1('0x18')));},'filename':function(_0x5ea327,_0x32204d,_0x12f145){_0x12f145(null,util[_0x3ed1('0x19')](_0x3ed1('0x1a'),'logologin',path[_0x3ed1('0x1b')](_0x32204d['originalname'])));}})});router[_0x3ed1('0x20')](_0x3ed1('0xf'),upload[_0x3ed1('0x21')](_0x3ed1('0x1e')),controller[_0x3ed1('0x22')]);var upload=multer({'storage':multer[_0x3ed1('0x15')]({'destination':function(_0x253a21,_0x1709f1,_0x25a8c3){_0x25a8c3(null,path['join'](config[_0x3ed1('0x17')],_0x3ed1('0x18')));},'filename':function(_0xe6391a,_0x478532,_0x2b82b2){_0x2b82b2(null,util['format'](_0x3ed1('0x1a'),'preferred',path[_0x3ed1('0x1b')](_0x478532[_0x3ed1('0x1c')])));}})});router['post'](_0x3ed1('0x12'),upload['single']('file'),controller[_0x3ed1('0x23')]);var upload=multer({'storage':multer[_0x3ed1('0x15')]({'destination':function(_0x2b5059,_0x23cce5,_0x2d98ed){_0x2d98ed(null,path[_0x3ed1('0x16')](config[_0x3ed1('0x17')],_0x3ed1('0x18')));},'filename':function(_0x510879,_0x4c1c58,_0x150327){_0x150327(null,util[_0x3ed1('0x19')](_0x3ed1('0x1a'),_0x3ed1('0x24'),path[_0x3ed1('0x1b')](_0x4c1c58[_0x3ed1('0x1c')])));}})});router['post'](_0x3ed1('0x13'),upload[_0x3ed1('0x21')]('file'),controller[_0x3ed1('0x25')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x3ed1('0x26')]);module[_0x3ed1('0x27')]=router; \ No newline at end of file +var _0x6461=['addLogoLogin','/:id/preferred','addPreferred','favicon','addFavicon','put','update','exports','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','isAuthenticated','index','/now','/:id','show','getLogo','/:id/favicon','join','root','server/files/images/logos/','format','%s%s','logo','extname','originalname','post','single','file','addLogo','diskStorage','logologin','/:id/logo_login'];(function(_0x799123,_0x4e7fbc){var _0x46d7bc=function(_0x2577c4){while(--_0x2577c4){_0x799123['push'](_0x799123['shift']());}};_0x46d7bc(++_0x4e7fbc);}(_0x6461,0x138));var _0x1646=function(_0x3d5f07,_0x4a7b08){_0x3d5f07=_0x3d5f07-0x0;var _0x58f33f=_0x6461[_0x3d5f07];return _0x58f33f;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x1646('0x0'));var express=require('express');var router=express[_0x1646('0x1')]();var fs_extra=require(_0x1646('0x2'));var auth=require(_0x1646('0x3'));var interaction=require(_0x1646('0x4'));var config=require(_0x1646('0x5'));var controller=require(_0x1646('0x6'));router[_0x1646('0x7')]('/',auth[_0x1646('0x8')](),controller[_0x1646('0x9')]);router[_0x1646('0x7')](_0x1646('0xa'),controller['getDate']);router[_0x1646('0x7')](_0x1646('0xb'),controller[_0x1646('0xc')]);router[_0x1646('0x7')]('/:id/logo',controller[_0x1646('0xd')]);router['get']('/:id/logo_login',controller['getLogoLogin']);router[_0x1646('0x7')]('/:id/gdpr',controller['gdpr']);router[_0x1646('0x7')]('/:id/preferred',controller['getPreferred']);router[_0x1646('0x7')](_0x1646('0xe'),controller['getFavicon']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x6dcdc0,_0x569df4,_0x1ef184){_0x1ef184(null,path[_0x1646('0xf')](config[_0x1646('0x10')],_0x1646('0x11')));},'filename':function(_0xf43f40,_0x5463a2,_0x94cfaa){_0x94cfaa(null,util[_0x1646('0x12')](_0x1646('0x13'),_0x1646('0x14'),path[_0x1646('0x15')](_0x5463a2[_0x1646('0x16')])));}})});router[_0x1646('0x17')]('/:id/logo',upload[_0x1646('0x18')](_0x1646('0x19')),controller[_0x1646('0x1a')]);var upload=multer({'storage':multer[_0x1646('0x1b')]({'destination':function(_0x5e85a7,_0x2cf61e,_0x5aaabe){_0x5aaabe(null,path[_0x1646('0xf')](config[_0x1646('0x10')],_0x1646('0x11')));},'filename':function(_0x3f4a2d,_0x35a163,_0x26ec95){_0x26ec95(null,util[_0x1646('0x12')](_0x1646('0x13'),_0x1646('0x1c'),path[_0x1646('0x15')](_0x35a163[_0x1646('0x16')])));}})});router[_0x1646('0x17')](_0x1646('0x1d'),upload[_0x1646('0x18')](_0x1646('0x19')),controller[_0x1646('0x1e')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2f3af9,_0xea139b,_0x1acce4){_0x1acce4(null,path[_0x1646('0xf')](config[_0x1646('0x10')],_0x1646('0x11')));},'filename':function(_0x2ac580,_0x2df041,_0x57635a){_0x57635a(null,util[_0x1646('0x12')](_0x1646('0x13'),'preferred',path[_0x1646('0x15')](_0x2df041[_0x1646('0x16')])));}})});router[_0x1646('0x17')](_0x1646('0x1f'),upload[_0x1646('0x18')]('file'),controller[_0x1646('0x20')]);var upload=multer({'storage':multer[_0x1646('0x1b')]({'destination':function(_0x4a56dc,_0x4fa151,_0xd3a77a){_0xd3a77a(null,path['join'](config[_0x1646('0x10')],'server/files/images/logos/'));},'filename':function(_0x4a4bf7,_0x20c208,_0x2c7ba5){_0x2c7ba5(null,util[_0x1646('0x12')](_0x1646('0x13'),_0x1646('0x21'),path[_0x1646('0x15')](_0x20c208[_0x1646('0x16')])));}})});router[_0x1646('0x17')]('/:id/favicon',upload[_0x1646('0x18')](_0x1646('0x19')),controller[_0x1646('0x22')]);router[_0x1646('0x23')](_0x1646('0xb'),auth[_0x1646('0x8')](),controller[_0x1646('0x24')]);module[_0x1646('0x25')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index 7264cec..bcddaad 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 _0x41cd=['UNSIGNED','exports','INTEGER','min_internal','min_mailbox','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','STRING','https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate'];(function(_0x65206f,_0x2ed2db){var _0x37e8da=function(_0x150f37){while(--_0x150f37){_0x65206f['push'](_0x65206f['shift']());}};_0x37e8da(++_0x2ed2db);}(_0x41cd,0x97));var _0xd41c=function(_0x1d5fb9,_0x43aa73){_0x1d5fb9=_0x1d5fb9-0x0;var _0xd72009=_0x41cd[_0x1d5fb9];return _0xd72009;};'use strict';var Sequelize=require('sequelize');module[_0xd41c('0x0')]={'min_internal':{'type':Sequelize[_0xd41c('0x1')](0xb),'unique':_0xd41c('0x2'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0xd41c('0x1')](0xb),'unique':_0xd41c('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0xd41c('0x1')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize['STRING'],'defaultValue':_0xd41c('0x4')},'logo':{'type':Sequelize['STRING']},'defaultLogo':{'type':Sequelize[_0xd41c('0x5')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0xd41c('0x6')]},'defaultLoginLogo':{'type':Sequelize[_0xd41c('0x5')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize['STRING']},'defaultHeaderWhiteLabel':{'type':Sequelize[_0xd41c('0x5')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0xd41c('0x5')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0xd41c('0x5')],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize['STRING']},'turnusername':{'type':Sequelize[_0xd41c('0x6')]},'turnpassword':{'type':Sequelize[_0xd41c('0x6')]},'pageTitle':{'type':Sequelize[_0xd41c('0x6')]},'defaultPageTitle':{'type':Sequelize[_0xd41c('0x5')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0xd41c('0x1')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0xd41c('0x5')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0xd41c('0x6')],'defaultValue':_0xd41c('0x7')},'enableEmailPreview':{'type':Sequelize[_0xd41c('0x5')],'defaultValue':![]},'split':{'type':Sequelize[_0xd41c('0x5')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0xd41c('0x1')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0xd41c('0x8')},'chatTimeout':{'type':Sequelize[_0xd41c('0x1')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0xd41c('0x5')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0xd41c('0x6')]},'defaultPreferred':{'type':Sequelize[_0xd41c('0x5')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0xd41c('0x6')]},'allowedLoginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'blockDuration':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'favicon':{'type':Sequelize['STRING']},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0xd41c('0x1')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0xd41c('0x5')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize['STRING']},'sentiment':{'type':Sequelize[_0xd41c('0x5')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0xd41c('0x5')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0xd41c('0x1')]},'sentimentRegion':{'type':Sequelize[_0xd41c('0x6')]},'language':{'type':Sequelize[_0xd41c('0x6')]},'bucket':{'type':Sequelize[_0xd41c('0x6')]},'googleSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0xd41c('0x5')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0xd41c('0x1')](0x2)[_0xd41c('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize['INTEGER'](0x2)[_0xd41c('0x9')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0xd41c('0x1')](0x2)[_0xd41c('0x9')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0xd41c('0x1')](0x2)[_0xd41c('0x9')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0xd41c('0x5')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0xd41c('0x1')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0xd41c('0x1')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0xd41c('0x1')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0xd41c('0x1')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0xd41c('0x5')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0xd41c('0x5')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0xd41c('0x5')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0xd41c('0x1')],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0xd41c('0x1')],'defaultValue':0x14},'filterFullName':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x50cd=['alternate','UNSIGNED','sequelize','INTEGER','min_internal','min_mailbox','STRING','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml'];(function(_0x13c7e4,_0x58b9c5){var _0x5652a8=function(_0x3f56a9){while(--_0x3f56a9){_0x13c7e4['push'](_0x13c7e4['shift']());}};_0x5652a8(++_0x58b9c5);}(_0x50cd,0x146));var _0xd50c=function(_0x138387,_0x2a16ac){_0x138387=_0x138387-0x0;var _0x45b15a=_0x50cd[_0x138387];return _0x45b15a;};'use strict';var Sequelize=require(_0xd50c('0x0'));module['exports']={'min_internal':{'type':Sequelize[_0xd50c('0x1')](0xb),'unique':_0xd50c('0x2'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0xd50c('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0xd50c('0x1')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0xd50c('0x4')],'defaultValue':'/var/opt/motion2/server/files/sounds/converted'},'logo':{'type':Sequelize['STRING']},'defaultLogo':{'type':Sequelize[_0xd50c('0x5')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0xd50c('0x4')]},'defaultLoginLogo':{'type':Sequelize[_0xd50c('0x5')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0xd50c('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0xd50c('0x5')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0xd50c('0x5')],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0xd50c('0x4')]},'turnusername':{'type':Sequelize[_0xd50c('0x4')]},'turnpassword':{'type':Sequelize[_0xd50c('0x4')]},'pageTitle':{'type':Sequelize[_0xd50c('0x4')]},'defaultPageTitle':{'type':Sequelize[_0xd50c('0x5')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0xd50c('0x5')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0xd50c('0x1')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0xd50c('0x5')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0xd50c('0x4')],'defaultValue':_0xd50c('0x6')},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize[_0xd50c('0x5')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0xd50c('0x1')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0xd50c('0x1')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0xd50c('0x1')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0xd50c('0x7')},'chatTimeout':{'type':Sequelize[_0xd50c('0x1')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'preferred':{'type':Sequelize[_0xd50c('0x4')]},'defaultPreferred':{'type':Sequelize[_0xd50c('0x5')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0xd50c('0x5')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0xd50c('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0xd50c('0x1')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0xd50c('0x1')],'defaultValue':0xa},'favicon':{'type':Sequelize['STRING']},'defaultFavicon':{'type':Sequelize[_0xd50c('0x5')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize['INTEGER'],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0xd50c('0x5')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0xd50c('0x4')]},'sentiment':{'type':Sequelize[_0xd50c('0x5')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0xd50c('0x1')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xd50c('0x4')]},'bucket':{'type':Sequelize[_0xd50c('0x4')]},'googleSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0xd50c('0x5')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0xd50c('0x1')](0x2)[_0xd50c('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0xd50c('0x1')](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0xd50c('0x1')](0x2)[_0xd50c('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0xd50c('0x1')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0xd50c('0x1')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0xd50c('0x1')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0xd50c('0x1')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0xd50c('0x1')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0xd50c('0x5')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0xd50c('0x5')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0xd50c('0x1')],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0xd50c('0x1')],'defaultValue':0x14},'filterFullName':{'type':Sequelize[_0xd50c('0x5')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index c455249..0061a0b 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 _0x23d3=['querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','name','send','index','map','Setting','rawAttributes','fieldName','type','query','keys','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','where','merge','filter','options','includeAll','findAll','params','include','find','body','file','logo','filename','addLogoLogin','loginLogo','getLogo','server/files/images/logos','getLicense','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','join','root','toLower','default_logo.svg','upperFirst','custom','existsSync','Sequelize','ValidationError','download','preferred','default','default_loginLogo.svg','\x20not\x20found','gdpr','securePassword','addPreferred','getPreferred','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','getDate','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x23d3,0xe8));var _0x323d=function(_0x4daf94,_0x206145){_0x4daf94=_0x4daf94-0x0;var _0x252880=_0x23d3[_0x4daf94];return _0x252880;};'use strict';var emlformat=require(_0x323d('0x0'));var rimraf=require(_0x323d('0x1'));var zipdir=require(_0x323d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x323d('0x3'));var moment=require(_0x323d('0x4'));var BPromise=require(_0x323d('0x5'));var Mustache=require(_0x323d('0x6'));var util=require(_0x323d('0x7'));var path=require(_0x323d('0x8'));var sox=require('sox');var csv=require(_0x323d('0x9'));var ejs=require(_0x323d('0xa'));var fs=require('fs');var fs_extra=require(_0x323d('0xb'));var _=require(_0x323d('0xc'));var squel=require('squel');var crypto=require(_0x323d('0xd'));var jsforce=require(_0x323d('0xe'));var deskjs=require(_0x323d('0xf'));var toCsv=require('to-csv');var querystring=require(_0x323d('0x10'));var Papa=require(_0x323d('0x11'));var Redis=require('ioredis');var authService=require(_0x323d('0x12'));var qs=require(_0x323d('0x13'));var as=require(_0x323d('0x14'));var hardwareService=require(_0x323d('0x15'));var logger=require('../../config/logger')(_0x323d('0x16'));var utils=require(_0x323d('0x17'));var config=require(_0x323d('0x18'));var licenseUtil=require(_0x323d('0x19'));var db=require(_0x323d('0x1a'))['db'];var jayson=require(_0x323d('0x1b'));var client=jayson[_0x323d('0x1c')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3913bd,_0x537c50,_0x2510d8,_0xfb5ad2){return new BPromise(function(_0x1a2d9e,_0x171468){var _0x302b8f=_0xfb5ad2||client;return _0x302b8f[_0x323d('0x1d')](_0x3913bd,_0x2510d8)[_0x323d('0x1e')](function(_0x3d8b1c){logger[_0x323d('0x1f')](_0x323d('0x20'),_0x537c50,_0x323d('0x21'));logger[_0x323d('0x22')](_0x323d('0x23'),_0x537c50,_0x323d('0x21'),JSON['stringify'](_0x3d8b1c));if(_0x3d8b1c[_0x323d('0x24')]){if(_0x3d8b1c[_0x323d('0x24')][_0x323d('0x25')]===0x1f4){logger[_0x323d('0x24')](_0x323d('0x20'),_0x537c50,_0x3d8b1c[_0x323d('0x24')][_0x323d('0x26')]);return _0x171468(_0x3d8b1c['error'][_0x323d('0x26')]);}logger[_0x323d('0x24')](_0x323d('0x20'),_0x537c50,_0x3d8b1c[_0x323d('0x24')][_0x323d('0x26')]);return _0x1a2d9e(_0x3d8b1c[_0x323d('0x24')][_0x323d('0x26')]);}else{logger[_0x323d('0x1f')]('Setting,\x20%s,\x20%s',_0x537c50,_0x323d('0x21'));_0x1a2d9e(_0x3d8b1c[_0x323d('0x27')][_0x323d('0x26')]);}})[_0x323d('0x28')](function(_0x35b1dc){logger['error']('Setting,\x20%s,\x20%s',_0x537c50,_0x35b1dc);_0x171468(_0x35b1dc);});});}function respondWithStatusCode(_0x2fb023,_0x1c6819){_0x1c6819=_0x1c6819||0xcc;return function(_0x50efbe){if(_0x50efbe){return _0x2fb023[_0x323d('0x29')](_0x1c6819);}return _0x2fb023[_0x323d('0x2a')](_0x1c6819)[_0x323d('0x2b')]();};}function respondWithResult(_0xadbd58,_0x8f3191){_0x8f3191=_0x8f3191||0xc8;return function(_0x9445){if(_0x9445){return _0xadbd58[_0x323d('0x2a')](_0x8f3191)[_0x323d('0x2c')](_0x9445);}};}function respondWithFilteredResult(_0x1cf1e,_0xf6cd44){return function(_0x5a8f92){if(_0x5a8f92){var _0x3d3b23=typeof _0xf6cd44[_0x323d('0x2d')]===_0x323d('0x2e')&&typeof _0xf6cd44[_0x323d('0x2f')]===_0x323d('0x2e');var _0x22902e=_0x5a8f92['count'];var _0x146a80=_0x3d3b23?0x0:_0xf6cd44[_0x323d('0x2d')];var _0x355f51=_0x3d3b23?_0x5a8f92[_0x323d('0x30')]:_0xf6cd44[_0x323d('0x2d')]+_0xf6cd44['limit'];var _0x326915;if(_0x355f51>=_0x22902e){_0x355f51=_0x22902e;_0x326915=0xc8;}else{_0x326915=0xce;}_0x1cf1e[_0x323d('0x2a')](_0x326915);return _0x1cf1e[_0x323d('0x31')]('Content-Range',_0x146a80+'-'+_0x355f51+'/'+_0x22902e)[_0x323d('0x2c')](_0x5a8f92);}return null;};}function patchUpdates(_0xf4fcf4){return function(_0x578291){try{jsonpatch[_0x323d('0x32')](_0x578291,_0xf4fcf4,!![]);}catch(_0x3fbc85){return BPromise[_0x323d('0x33')](_0x3fbc85);}return _0x578291[_0x323d('0x34')]();};}function saveUpdates(_0x108734,_0x968fd8){return function(_0x5a9e80){if(_0x5a9e80){return _0x5a9e80[_0x323d('0x35')](_0x108734)[_0x323d('0x1e')](function(_0x2b9e16){return _0x2b9e16;});}return null;};}function removeEntity(_0xdbeb89,_0x1d0e87){return function(_0x2bbb14){if(_0x2bbb14){return _0x2bbb14['destroy']()[_0x323d('0x1e')](function(){_0xdbeb89['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x312fa6,_0x2f86ef){return function(_0x2ec250){if(!_0x2ec250){_0x312fa6[_0x323d('0x29')](0x194);}return _0x2ec250;};}function handleError(_0x18076f,_0x5ce9d7){_0x5ce9d7=_0x5ce9d7||0x1f4;return function(_0x4e5379){logger['error'](_0x4e5379['stack']);if(_0x4e5379[_0x323d('0x36')]){delete _0x4e5379[_0x323d('0x36')];}_0x18076f[_0x323d('0x2a')](_0x5ce9d7)[_0x323d('0x37')](_0x4e5379);};}exports[_0x323d('0x38')]=function(_0x200b29,_0x785bed){var _0x897164={},_0x2f1d4a={},_0x46199a={'count':0x0,'rows':[]};var _0x5740fb=_[_0x323d('0x39')](db[_0x323d('0x3a')][_0x323d('0x3b')],function(_0x25cab1){return{'name':_0x25cab1[_0x323d('0x3c')],'type':_0x25cab1[_0x323d('0x3d')]['key']};});_0x2f1d4a['model']=_[_0x323d('0x39')](_0x5740fb,_0x323d('0x36'));_0x2f1d4a[_0x323d('0x3e')]=_[_0x323d('0x3f')](_0x200b29['query']);_0x2f1d4a[_0x323d('0x40')]=_['intersection'](_0x2f1d4a[_0x323d('0x41')],_0x2f1d4a['query']);_0x897164['attributes']=_[_0x323d('0x42')](_0x2f1d4a[_0x323d('0x41')],qs['fields'](_0x200b29[_0x323d('0x3e')][_0x323d('0x43')]));_0x897164[_0x323d('0x44')]=_0x897164['attributes'][_0x323d('0x45')]?_0x897164[_0x323d('0x44')]:_0x2f1d4a[_0x323d('0x41')];if(!_0x200b29[_0x323d('0x3e')][_0x323d('0x46')](_0x323d('0x47'))){_0x897164[_0x323d('0x2f')]=qs[_0x323d('0x2f')](_0x200b29[_0x323d('0x3e')]['limit']);_0x897164[_0x323d('0x2d')]=qs[_0x323d('0x2d')](_0x200b29['query'][_0x323d('0x2d')]);}_0x897164['order']=qs[_0x323d('0x48')](_0x200b29['query'][_0x323d('0x48')]);_0x897164['where']=qs['filters'](_[_0x323d('0x49')](_0x200b29[_0x323d('0x3e')],_0x2f1d4a['filters']),_0x5740fb);if(_0x200b29['query']['filter']){_0x897164[_0x323d('0x4a')]=_[_0x323d('0x4b')](_0x897164[_0x323d('0x4a')],{'$or':_[_0x323d('0x39')](_0x5740fb,function(_0x1594a1){if(_0x1594a1[_0x323d('0x3d')]!=='VIRTUAL'){var _0x463aac={};_0x463aac[_0x1594a1['name']]={'$like':'%'+_0x200b29[_0x323d('0x3e')][_0x323d('0x4c')]+'%'};return _0x463aac;}})});}_0x897164=_['merge']({},_0x897164,_0x200b29[_0x323d('0x4d')]);var _0x25e6d0={'where':_0x897164[_0x323d('0x4a')]};return db['Setting'][_0x323d('0x30')](_0x25e6d0)[_0x323d('0x1e')](function(_0x3d46f6){_0x46199a[_0x323d('0x30')]=_0x3d46f6;if(_0x200b29['query'][_0x323d('0x4e')]){_0x897164['include']=[{'all':!![]}];}return db[_0x323d('0x3a')][_0x323d('0x4f')](_0x897164);})['then'](function(_0x1f202a){_0x46199a['rows']=_0x1f202a;return _0x46199a;})['then'](respondWithFilteredResult(_0x785bed,_0x897164))[_0x323d('0x28')](handleError(_0x785bed,null));};exports['show']=function(_0x3b700e,_0x32c8bd){var _0x337da3={'raw':![],'where':{'id':_0x3b700e[_0x323d('0x50')]['id']}},_0x3b596e={};_0x3b596e[_0x323d('0x41')]=_[_0x323d('0x3f')](db[_0x323d('0x3a')]['rawAttributes']);_0x3b596e[_0x323d('0x3e')]=_[_0x323d('0x3f')](_0x3b700e[_0x323d('0x3e')]);_0x3b596e[_0x323d('0x40')]=_[_0x323d('0x42')](_0x3b596e[_0x323d('0x41')],_0x3b596e['query']);_0x337da3[_0x323d('0x44')]=_[_0x323d('0x42')](_0x3b596e['model'],qs['fields'](_0x3b700e['query'][_0x323d('0x43')]));_0x337da3[_0x323d('0x44')]=_0x337da3[_0x323d('0x44')][_0x323d('0x45')]?_0x337da3['attributes']:_0x3b596e['model'];if(_0x3b700e[_0x323d('0x3e')][_0x323d('0x4e')]){_0x337da3[_0x323d('0x51')]=[{'all':!![]}];}_0x337da3=_[_0x323d('0x4b')]({},_0x337da3,_0x3b700e[_0x323d('0x4d')]);return db[_0x323d('0x3a')][_0x323d('0x52')](_0x337da3)[_0x323d('0x1e')](handleEntityNotFound(_0x32c8bd,null))['then'](respondWithResult(_0x32c8bd,null))[_0x323d('0x28')](handleError(_0x32c8bd,null));};exports['update']=function(_0x24f187,_0x3a570c){if(_0x24f187[_0x323d('0x53')]['id']){delete _0x24f187[_0x323d('0x53')]['id'];}return db[_0x323d('0x3a')][_0x323d('0x52')]({'where':{'id':_0x24f187[_0x323d('0x50')]['id']}})[_0x323d('0x1e')](handleEntityNotFound(_0x3a570c,null))[_0x323d('0x1e')](saveUpdates(_0x24f187[_0x323d('0x53')],null))[_0x323d('0x1e')](respondWithResult(_0x3a570c,null))['catch'](handleError(_0x3a570c,null));};exports['addLogo']=function(_0x2b5189,_0x32b665,_0x25abcd){if(_0x2b5189[_0x323d('0x54')]&&_0x2b5189[_0x323d('0x54')]['filename']){_0x2b5189['body'][_0x323d('0x55')]=_0x2b5189[_0x323d('0x54')][_0x323d('0x56')];}return db['Setting'][_0x323d('0x52')]({'where':{'id':_0x2b5189[_0x323d('0x50')]['id']}})[_0x323d('0x1e')](handleEntityNotFound(_0x32b665,null))[_0x323d('0x1e')](saveUpdates(_0x2b5189[_0x323d('0x53')],null))[_0x323d('0x1e')](respondWithResult(_0x32b665,null))[_0x323d('0x28')](handleError(_0x32b665,null));};exports[_0x323d('0x57')]=function(_0x52f78b,_0x2e5a32,_0x556e1b){if(_0x52f78b['file']&&_0x52f78b[_0x323d('0x54')]['filename']){_0x52f78b[_0x323d('0x53')][_0x323d('0x58')]=_0x52f78b[_0x323d('0x54')]['filename'];}return db[_0x323d('0x3a')]['find']({'where':{'id':_0x52f78b[_0x323d('0x50')]['id']}})[_0x323d('0x1e')](handleEntityNotFound(_0x2e5a32,null))[_0x323d('0x1e')](saveUpdates(_0x52f78b[_0x323d('0x53')],null))[_0x323d('0x1e')](respondWithResult(_0x2e5a32,null))[_0x323d('0x28')](handleError(_0x2e5a32,null));};var utilLicense=require(_0x323d('0x19'));exports[_0x323d('0x59')]=function(_0x4ebc54,_0x3338a4,_0x4fa3cc){var _0x1a568e=_0x323d('0x5a');var _0x34d60f={'custom':![]};return utilLicense[_0x323d('0x5b')]()[_0x323d('0x1e')](function(_0x2c97b6){if(_0x2c97b6){_0x34d60f=_0x2c97b6;}return db['Setting'][_0x323d('0x52')]({'where':{'id':_0x4ebc54['params']['id']},'attributes':[_0x323d('0x55'),_0x323d('0x58'),'preferred',_0x323d('0x5c'),_0x323d('0x5d'),_0x323d('0x5e'),_0x323d('0x5f'),_0x323d('0x60')],'raw':!![]});})['then'](handleEntityNotFound(_0x3338a4,null))[_0x323d('0x1e')](function(_0x330f5a){if(_0x330f5a){var _0x15f707=_0x330f5a['logo']&&fs['existsSync'](path[_0x323d('0x61')](config[_0x323d('0x62')],_0x1a568e,_[_0x323d('0x63')](_0x330f5a['logo'])))?path['join'](config[_0x323d('0x62')],_0x1a568e,_[_0x323d('0x63')](_0x330f5a[_0x323d('0x55')])):path[_0x323d('0x61')](config[_0x323d('0x62')],_0x1a568e,_[_0x323d('0x63')](_0x323d('0x64')));var _0x4914dd='default'+_[_0x323d('0x65')]('logo');if(_0x330f5a[_0x4914dd]||!_0x34d60f[_0x323d('0x66')]){_0x15f707=path[_0x323d('0x61')](config[_0x323d('0x62')],_0x1a568e,_[_0x323d('0x63')](_0x323d('0x64')));}if(!fs[_0x323d('0x67')](_0x15f707)){throw new db[(_0x323d('0x68'))][(_0x323d('0x69'))](_['upperFirst']('logo')+'\x20not\x20found');}return _0x3338a4[_0x323d('0x6a')](_0x15f707);}})[_0x323d('0x28')](handleError(_0x3338a4,null));};var utilLicense=require(_0x323d('0x19'));exports['getLogoLogin']=function(_0x495984,_0x32c3d3,_0x15a819){var _0x5b42a1=_0x323d('0x5a');var _0x5df0d3={'custom':![]};return utilLicense[_0x323d('0x5b')]()[_0x323d('0x1e')](function(_0x1f952e){if(_0x1f952e){_0x5df0d3=_0x1f952e;}return db[_0x323d('0x3a')][_0x323d('0x52')]({'where':{'id':_0x495984[_0x323d('0x50')]['id']},'attributes':[_0x323d('0x55'),_0x323d('0x58'),_0x323d('0x6b'),_0x323d('0x5c'),_0x323d('0x5d'),'defaultLoginLogo','defaultPreferred','defaultFavicon'],'raw':!![]});})[_0x323d('0x1e')](handleEntityNotFound(_0x32c3d3,null))['then'](function(_0x5b6e43){if(_0x5b6e43){var _0x4e1b73=_0x5b6e43['loginLogo']&&fs['existsSync'](path['join'](config[_0x323d('0x62')],_0x5b42a1,_['toLower'](_0x5b6e43[_0x323d('0x58')])))?path[_0x323d('0x61')](config[_0x323d('0x62')],_0x5b42a1,_[_0x323d('0x63')](_0x5b6e43[_0x323d('0x58')])):path[_0x323d('0x61')](config[_0x323d('0x62')],_0x5b42a1,_[_0x323d('0x63')]('default_loginLogo.svg'));var _0x4a2c0f=_0x323d('0x6c')+_[_0x323d('0x65')]('loginLogo');if(_0x5b6e43[_0x4a2c0f]||!_0x5df0d3[_0x323d('0x66')]){_0x4e1b73=path[_0x323d('0x61')](config[_0x323d('0x62')],_0x5b42a1,_[_0x323d('0x63')](_0x323d('0x6d')));}if(!fs[_0x323d('0x67')](_0x4e1b73)){throw new db[(_0x323d('0x68'))][(_0x323d('0x69'))](_[_0x323d('0x65')]('loginLogo')+_0x323d('0x6e'));}return _0x32c3d3[_0x323d('0x6a')](_0x4e1b73);}})[_0x323d('0x28')](handleError(_0x32c3d3,null));};exports[_0x323d('0x6f')]=function(_0x337cb2,_0x57462d){return db[_0x323d('0x3a')]['find']({'where':{'id':_0x337cb2[_0x323d('0x50')]['id']},'attributes':[_0x323d('0x70')]})[_0x323d('0x1e')](respondWithResult(_0x57462d,null))[_0x323d('0x28')](handleError(_0x57462d,null));};exports[_0x323d('0x71')]=function(_0xb53b38,_0x4006e1,_0x4efbf5){if(_0xb53b38[_0x323d('0x54')]&&_0xb53b38[_0x323d('0x54')][_0x323d('0x56')]){_0xb53b38[_0x323d('0x53')][_0x323d('0x6b')]=_0xb53b38[_0x323d('0x54')][_0x323d('0x56')];}return db[_0x323d('0x3a')][_0x323d('0x52')]({'where':{'id':_0xb53b38[_0x323d('0x50')]['id']}})[_0x323d('0x1e')](handleEntityNotFound(_0x4006e1,null))[_0x323d('0x1e')](saveUpdates(_0xb53b38[_0x323d('0x53')],null))['then'](respondWithResult(_0x4006e1,null))[_0x323d('0x28')](handleError(_0x4006e1,null));};var utilLicense=require(_0x323d('0x19'));exports[_0x323d('0x72')]=function(_0x5a6eaa,_0x26bd92,_0x10239e){var _0x8674b3=_0x323d('0x5a');var _0x36be47={'custom':![]};return utilLicense['getLicense']()['then'](function(_0xb8614a){if(_0xb8614a){_0x36be47=_0xb8614a;}return db[_0x323d('0x3a')][_0x323d('0x52')]({'where':{'id':_0x5a6eaa[_0x323d('0x50')]['id']},'attributes':[_0x323d('0x55'),'loginLogo',_0x323d('0x6b'),_0x323d('0x5c'),_0x323d('0x5d'),_0x323d('0x5e'),_0x323d('0x5f'),_0x323d('0x60')],'raw':!![]});})[_0x323d('0x1e')](handleEntityNotFound(_0x26bd92,null))[_0x323d('0x1e')](function(_0x222132){if(_0x222132){var _0x3e078b=_0x222132[_0x323d('0x6b')]&&fs[_0x323d('0x67')](path[_0x323d('0x61')](config[_0x323d('0x62')],_0x8674b3,_['toLower'](_0x222132['preferred'])))?path[_0x323d('0x61')](config[_0x323d('0x62')],_0x8674b3,_[_0x323d('0x63')](_0x222132[_0x323d('0x6b')])):path[_0x323d('0x61')](config[_0x323d('0x62')],_0x8674b3,_[_0x323d('0x63')](_0x323d('0x73')));var _0x585098=_0x323d('0x6c')+_[_0x323d('0x65')](_0x323d('0x6b'));if(_0x222132[_0x585098]||!_0x36be47[_0x323d('0x66')]||!_0x36be47[_0x323d('0x6b')]){_0x3e078b=path[_0x323d('0x61')](config[_0x323d('0x62')],_0x8674b3,_[_0x323d('0x63')](_0x323d('0x73')));}if(!fs[_0x323d('0x67')](_0x3e078b)){throw new db[(_0x323d('0x68'))][(_0x323d('0x69'))](_[_0x323d('0x65')](_0x323d('0x6b'))+_0x323d('0x6e'));}return _0x26bd92[_0x323d('0x6a')](_0x3e078b);}})['catch'](handleError(_0x26bd92,null));};exports[_0x323d('0x74')]=function(_0xd7b29c,_0x372bef,_0x2dafd3){if(_0xd7b29c[_0x323d('0x54')]&&_0xd7b29c[_0x323d('0x54')][_0x323d('0x56')]){_0xd7b29c[_0x323d('0x53')][_0x323d('0x5c')]=_0xd7b29c[_0x323d('0x54')]['filename'];}return db['Setting'][_0x323d('0x52')]({'where':{'id':_0xd7b29c[_0x323d('0x50')]['id']}})[_0x323d('0x1e')](handleEntityNotFound(_0x372bef,null))[_0x323d('0x1e')](saveUpdates(_0xd7b29c[_0x323d('0x53')],null))['then'](respondWithResult(_0x372bef,null))['catch'](handleError(_0x372bef,null));};var utilLicense=require('../../config/license/util');exports[_0x323d('0x75')]=function(_0x5ad569,_0x38208b,_0x31b2be){var _0x55b11f=_0x323d('0x5a');var _0x5d24c3={'custom':![]};return utilLicense[_0x323d('0x5b')]()[_0x323d('0x1e')](function(_0x254dd2){if(_0x254dd2){_0x5d24c3=_0x254dd2;}return db[_0x323d('0x3a')][_0x323d('0x52')]({'where':{'id':_0x5ad569[_0x323d('0x50')]['id']},'attributes':['logo',_0x323d('0x58'),_0x323d('0x6b'),_0x323d('0x5c'),_0x323d('0x5d'),_0x323d('0x5e'),_0x323d('0x5f'),'defaultFavicon'],'raw':!![]});})[_0x323d('0x1e')](handleEntityNotFound(_0x38208b,null))[_0x323d('0x1e')](function(_0x346724){if(_0x346724){var _0x39b4db=_0x346724[_0x323d('0x5c')]&&fs[_0x323d('0x67')](path[_0x323d('0x61')](config[_0x323d('0x62')],_0x55b11f,_[_0x323d('0x63')](_0x346724['favicon'])))?path['join'](config[_0x323d('0x62')],_0x55b11f,_[_0x323d('0x63')](_0x346724[_0x323d('0x5c')])):path[_0x323d('0x61')](config['root'],_0x55b11f,_[_0x323d('0x63')](_0x323d('0x76')));var _0xb08784=_0x323d('0x6c')+_[_0x323d('0x65')](_0x323d('0x5c'));if(_0x346724[_0xb08784]||!_0x5d24c3['custom']){_0x39b4db=path[_0x323d('0x61')](config[_0x323d('0x62')],_0x55b11f,_['toLower'](_0x323d('0x76')));}if(!fs[_0x323d('0x67')](_0x39b4db)){throw new db[(_0x323d('0x68'))][(_0x323d('0x69'))](_['upperFirst']('favicon')+_0x323d('0x6e'));}return _0x38208b['download'](_0x39b4db);}})['catch'](handleError(_0x38208b,null));};exports[_0x323d('0x77')]=function(_0x126526,_0x4a28e2){var _0x5e1867={'offset':moment()[_0x323d('0x78')]()};_0x5e1867[_0x323d('0x79')]=moment()[_0x323d('0x78')](_0x5e1867[_0x323d('0x2d')])[_0x323d('0x7a')](_0x323d('0x7b'));return _0x4a28e2['status'](0xc8)[_0x323d('0x37')](_0x5e1867);}; \ No newline at end of file +var _0xf418=['jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','jayson/promise','client','http','request','then','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','name','send','map','Setting','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','includeAll','body','find','addLogo','file','filename','logo','addLogoLogin','loginLogo','getLogo','server/files/images/logos','preferred','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join','toLower','default_logo.svg','default','custom','root','upperFirst','\x20not\x20found','download','getLogoLogin','getLicense','favicon','default_loginLogo.svg','Sequelize','ValidationError','gdpr','securePassword','addPreferred','getPreferred','default_preferred.png','default_favicon.ico','utcOffset','format','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto'];(function(_0x82434e,_0x3af2fb){var _0x24a7a4=function(_0x5ac3d8){while(--_0x5ac3d8){_0x82434e['push'](_0x82434e['shift']());}};_0x24a7a4(++_0x3af2fb);}(_0xf418,0x1e3));var _0x8f41=function(_0x2e8a06,_0x22b27b){_0x2e8a06=_0x2e8a06-0x0;var _0x2fb353=_0xf418[_0x2e8a06];return _0x2fb353;};'use strict';var emlformat=require(_0x8f41('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8f41('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8f41('0x2'));var moment=require(_0x8f41('0x3'));var BPromise=require(_0x8f41('0x4'));var Mustache=require(_0x8f41('0x5'));var util=require('util');var path=require(_0x8f41('0x6'));var sox=require(_0x8f41('0x7'));var csv=require(_0x8f41('0x8'));var ejs=require(_0x8f41('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8f41('0xa'));var squel=require(_0x8f41('0xb'));var crypto=require(_0x8f41('0xc'));var jsforce=require(_0x8f41('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8f41('0xe'));var Redis=require(_0x8f41('0xf'));var authService=require(_0x8f41('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x8f41('0x11'));var hardwareService=require(_0x8f41('0x12'));var logger=require(_0x8f41('0x13'))('api');var utils=require(_0x8f41('0x14'));var config=require(_0x8f41('0x15'));var licenseUtil=require(_0x8f41('0x16'));var db=require('../../mysqldb')['db'];var jayson=require(_0x8f41('0x17'));var client=jayson[_0x8f41('0x18')][_0x8f41('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x31578a,_0x1e9fd3,_0x5e5773,_0x4be780){return new BPromise(function(_0x59f81e,_0x54b08f){var _0x2e2ced=_0x4be780||client;return _0x2e2ced[_0x8f41('0x1a')](_0x31578a,_0x5e5773)[_0x8f41('0x1b')](function(_0x26a231){logger['info'](_0x8f41('0x1c'),_0x1e9fd3,_0x8f41('0x1d'));logger[_0x8f41('0x1e')](_0x8f41('0x1f'),_0x1e9fd3,_0x8f41('0x1d'),JSON[_0x8f41('0x20')](_0x26a231));if(_0x26a231[_0x8f41('0x21')]){if(_0x26a231[_0x8f41('0x21')]['code']===0x1f4){logger[_0x8f41('0x21')](_0x8f41('0x1c'),_0x1e9fd3,_0x26a231['error'][_0x8f41('0x22')]);return _0x54b08f(_0x26a231[_0x8f41('0x21')][_0x8f41('0x22')]);}logger['error'](_0x8f41('0x1c'),_0x1e9fd3,_0x26a231[_0x8f41('0x21')][_0x8f41('0x22')]);return _0x59f81e(_0x26a231[_0x8f41('0x21')][_0x8f41('0x22')]);}else{logger[_0x8f41('0x23')](_0x8f41('0x1c'),_0x1e9fd3,_0x8f41('0x1d'));_0x59f81e(_0x26a231[_0x8f41('0x24')]['message']);}})[_0x8f41('0x25')](function(_0xb7970a){logger[_0x8f41('0x21')](_0x8f41('0x1c'),_0x1e9fd3,_0xb7970a);_0x54b08f(_0xb7970a);});});}function respondWithStatusCode(_0x42fc88,_0x597c5f){_0x597c5f=_0x597c5f||0xcc;return function(_0x4c0920){if(_0x4c0920){return _0x42fc88[_0x8f41('0x26')](_0x597c5f);}return _0x42fc88[_0x8f41('0x27')](_0x597c5f)[_0x8f41('0x28')]();};}function respondWithResult(_0x39a9ef,_0x4c0075){_0x4c0075=_0x4c0075||0xc8;return function(_0x5597df){if(_0x5597df){return _0x39a9ef[_0x8f41('0x27')](_0x4c0075)[_0x8f41('0x29')](_0x5597df);}};}function respondWithFilteredResult(_0x275678,_0x2d13fe){return function(_0xe4415a){if(_0xe4415a){var _0x4a5f3f=typeof _0x2d13fe[_0x8f41('0x2a')]===_0x8f41('0x2b')&&typeof _0x2d13fe['limit']===_0x8f41('0x2b');var _0x550b8e=_0xe4415a[_0x8f41('0x2c')];var _0x1c14c6=_0x4a5f3f?0x0:_0x2d13fe[_0x8f41('0x2a')];var _0x280d88=_0x4a5f3f?_0xe4415a[_0x8f41('0x2c')]:_0x2d13fe['offset']+_0x2d13fe[_0x8f41('0x2d')];var _0x4bde2b;if(_0x280d88>=_0x550b8e){_0x280d88=_0x550b8e;_0x4bde2b=0xc8;}else{_0x4bde2b=0xce;}_0x275678[_0x8f41('0x27')](_0x4bde2b);return _0x275678[_0x8f41('0x2e')](_0x8f41('0x2f'),_0x1c14c6+'-'+_0x280d88+'/'+_0x550b8e)[_0x8f41('0x29')](_0xe4415a);}return null;};}function patchUpdates(_0x105bed){return function(_0x22c6ec){try{jsonpatch[_0x8f41('0x30')](_0x22c6ec,_0x105bed,!![]);}catch(_0xb6af76){return BPromise[_0x8f41('0x31')](_0xb6af76);}return _0x22c6ec[_0x8f41('0x32')]();};}function saveUpdates(_0x1f4861,_0x2b674a){return function(_0x3734e5){if(_0x3734e5){return _0x3734e5[_0x8f41('0x33')](_0x1f4861)[_0x8f41('0x1b')](function(_0x416fd2){return _0x416fd2;});}return null;};}function removeEntity(_0x2d5157,_0x25b106){return function(_0x2587ac){if(_0x2587ac){return _0x2587ac[_0x8f41('0x34')]()[_0x8f41('0x1b')](function(){_0x2d5157['status'](0xcc)[_0x8f41('0x28')]();});}};}function handleEntityNotFound(_0x4d11f0,_0x515cf2){return function(_0x58c4b7){if(!_0x58c4b7){_0x4d11f0['sendStatus'](0x194);}return _0x58c4b7;};}function handleError(_0x7e94b2,_0x1d5d1e){_0x1d5d1e=_0x1d5d1e||0x1f4;return function(_0x35ab9c){logger[_0x8f41('0x21')](_0x35ab9c['stack']);if(_0x35ab9c[_0x8f41('0x35')]){delete _0x35ab9c['name'];}_0x7e94b2[_0x8f41('0x27')](_0x1d5d1e)[_0x8f41('0x36')](_0x35ab9c);};}exports['index']=function(_0x496398,_0x2cc1aa){var _0x4f09ca={},_0x156d54={},_0xf748c7={'count':0x0,'rows':[]};var _0x36b6c8=_[_0x8f41('0x37')](db[_0x8f41('0x38')][_0x8f41('0x39')],function(_0x521211){return{'name':_0x521211[_0x8f41('0x3a')],'type':_0x521211[_0x8f41('0x3b')][_0x8f41('0x3c')]};});_0x156d54[_0x8f41('0x3d')]=_['map'](_0x36b6c8,'name');_0x156d54[_0x8f41('0x3e')]=_[_0x8f41('0x3f')](_0x496398['query']);_0x156d54[_0x8f41('0x40')]=_[_0x8f41('0x41')](_0x156d54[_0x8f41('0x3d')],_0x156d54[_0x8f41('0x3e')]);_0x4f09ca[_0x8f41('0x42')]=_[_0x8f41('0x41')](_0x156d54['model'],qs[_0x8f41('0x43')](_0x496398[_0x8f41('0x3e')]['fields']));_0x4f09ca[_0x8f41('0x42')]=_0x4f09ca[_0x8f41('0x42')][_0x8f41('0x44')]?_0x4f09ca['attributes']:_0x156d54[_0x8f41('0x3d')];if(!_0x496398[_0x8f41('0x3e')][_0x8f41('0x45')](_0x8f41('0x46'))){_0x4f09ca[_0x8f41('0x2d')]=qs[_0x8f41('0x2d')](_0x496398[_0x8f41('0x3e')][_0x8f41('0x2d')]);_0x4f09ca[_0x8f41('0x2a')]=qs[_0x8f41('0x2a')](_0x496398[_0x8f41('0x3e')][_0x8f41('0x2a')]);}_0x4f09ca[_0x8f41('0x47')]=qs[_0x8f41('0x48')](_0x496398['query'][_0x8f41('0x48')]);_0x4f09ca[_0x8f41('0x49')]=qs[_0x8f41('0x40')](_[_0x8f41('0x4a')](_0x496398['query'],_0x156d54['filters']),_0x36b6c8);if(_0x496398[_0x8f41('0x3e')][_0x8f41('0x4b')]){_0x4f09ca[_0x8f41('0x49')]=_[_0x8f41('0x4c')](_0x4f09ca[_0x8f41('0x49')],{'$or':_[_0x8f41('0x37')](_0x36b6c8,function(_0x37bd08){if(_0x37bd08[_0x8f41('0x3b')]!==_0x8f41('0x4d')){var _0x36d09b={};_0x36d09b[_0x37bd08[_0x8f41('0x35')]]={'$like':'%'+_0x496398[_0x8f41('0x3e')][_0x8f41('0x4b')]+'%'};return _0x36d09b;}})});}_0x4f09ca=_[_0x8f41('0x4c')]({},_0x4f09ca,_0x496398[_0x8f41('0x4e')]);var _0x134a82={'where':_0x4f09ca['where']};return db[_0x8f41('0x38')][_0x8f41('0x2c')](_0x134a82)[_0x8f41('0x1b')](function(_0x55a3ad){_0xf748c7[_0x8f41('0x2c')]=_0x55a3ad;if(_0x496398[_0x8f41('0x3e')]['includeAll']){_0x4f09ca[_0x8f41('0x4f')]=[{'all':!![]}];}return db[_0x8f41('0x38')][_0x8f41('0x50')](_0x4f09ca);})[_0x8f41('0x1b')](function(_0x1e8a46){_0xf748c7[_0x8f41('0x51')]=_0x1e8a46;return _0xf748c7;})['then'](respondWithFilteredResult(_0x2cc1aa,_0x4f09ca))[_0x8f41('0x25')](handleError(_0x2cc1aa,null));};exports[_0x8f41('0x52')]=function(_0x36592d,_0x25d5a0){var _0x2f1220={'raw':![],'where':{'id':_0x36592d[_0x8f41('0x53')]['id']}},_0x398a45={};_0x398a45['model']=_[_0x8f41('0x3f')](db['Setting']['rawAttributes']);_0x398a45[_0x8f41('0x3e')]=_[_0x8f41('0x3f')](_0x36592d['query']);_0x398a45['filters']=_['intersection'](_0x398a45[_0x8f41('0x3d')],_0x398a45[_0x8f41('0x3e')]);_0x2f1220[_0x8f41('0x42')]=_[_0x8f41('0x41')](_0x398a45[_0x8f41('0x3d')],qs[_0x8f41('0x43')](_0x36592d[_0x8f41('0x3e')]['fields']));_0x2f1220[_0x8f41('0x42')]=_0x2f1220[_0x8f41('0x42')][_0x8f41('0x44')]?_0x2f1220['attributes']:_0x398a45[_0x8f41('0x3d')];if(_0x36592d[_0x8f41('0x3e')][_0x8f41('0x54')]){_0x2f1220[_0x8f41('0x4f')]=[{'all':!![]}];}_0x2f1220=_[_0x8f41('0x4c')]({},_0x2f1220,_0x36592d[_0x8f41('0x4e')]);return db[_0x8f41('0x38')]['find'](_0x2f1220)['then'](handleEntityNotFound(_0x25d5a0,null))[_0x8f41('0x1b')](respondWithResult(_0x25d5a0,null))['catch'](handleError(_0x25d5a0,null));};exports['update']=function(_0x1750d7,_0x43c740){if(_0x1750d7['body']['id']){delete _0x1750d7[_0x8f41('0x55')]['id'];}return db[_0x8f41('0x38')][_0x8f41('0x56')]({'where':{'id':_0x1750d7[_0x8f41('0x53')]['id']}})[_0x8f41('0x1b')](handleEntityNotFound(_0x43c740,null))[_0x8f41('0x1b')](saveUpdates(_0x1750d7['body'],null))['then'](respondWithResult(_0x43c740,null))[_0x8f41('0x25')](handleError(_0x43c740,null));};exports[_0x8f41('0x57')]=function(_0x4f2522,_0x4c631b,_0x44260a){if(_0x4f2522[_0x8f41('0x58')]&&_0x4f2522['file'][_0x8f41('0x59')]){_0x4f2522['body'][_0x8f41('0x5a')]=_0x4f2522['file']['filename'];}return db['Setting'][_0x8f41('0x56')]({'where':{'id':_0x4f2522[_0x8f41('0x53')]['id']}})[_0x8f41('0x1b')](handleEntityNotFound(_0x4c631b,null))[_0x8f41('0x1b')](saveUpdates(_0x4f2522[_0x8f41('0x55')],null))[_0x8f41('0x1b')](respondWithResult(_0x4c631b,null))[_0x8f41('0x25')](handleError(_0x4c631b,null));};exports[_0x8f41('0x5b')]=function(_0x1b34d3,_0x4a9e4e,_0x52d62a){if(_0x1b34d3[_0x8f41('0x58')]&&_0x1b34d3[_0x8f41('0x58')][_0x8f41('0x59')]){_0x1b34d3[_0x8f41('0x55')][_0x8f41('0x5c')]=_0x1b34d3[_0x8f41('0x58')]['filename'];}return db['Setting'][_0x8f41('0x56')]({'where':{'id':_0x1b34d3[_0x8f41('0x53')]['id']}})[_0x8f41('0x1b')](handleEntityNotFound(_0x4a9e4e,null))[_0x8f41('0x1b')](saveUpdates(_0x1b34d3[_0x8f41('0x55')],null))[_0x8f41('0x1b')](respondWithResult(_0x4a9e4e,null))[_0x8f41('0x25')](handleError(_0x4a9e4e,null));};var utilLicense=require(_0x8f41('0x16'));exports[_0x8f41('0x5d')]=function(_0x5eea04,_0x309fa4,_0xe1bb78){var _0x1d2ec4=_0x8f41('0x5e');var _0xac2cd1={'custom':![]};return utilLicense['getLicense']()[_0x8f41('0x1b')](function(_0x128969){if(_0x128969){_0xac2cd1=_0x128969;}return db[_0x8f41('0x38')][_0x8f41('0x56')]({'where':{'id':_0x5eea04[_0x8f41('0x53')]['id']},'attributes':['logo',_0x8f41('0x5c'),_0x8f41('0x5f'),'favicon',_0x8f41('0x60'),_0x8f41('0x61'),_0x8f41('0x62'),_0x8f41('0x63')],'raw':!![]});})[_0x8f41('0x1b')](handleEntityNotFound(_0x309fa4,null))[_0x8f41('0x1b')](function(_0x4f0450){if(_0x4f0450){var _0x403ee5=_0x4f0450[_0x8f41('0x5a')]&&fs[_0x8f41('0x64')](path[_0x8f41('0x65')](config['root'],_0x1d2ec4,_[_0x8f41('0x66')](_0x4f0450[_0x8f41('0x5a')])))?path[_0x8f41('0x65')](config['root'],_0x1d2ec4,_['toLower'](_0x4f0450[_0x8f41('0x5a')])):path[_0x8f41('0x65')](config['root'],_0x1d2ec4,_[_0x8f41('0x66')](_0x8f41('0x67')));var _0x2e6666=_0x8f41('0x68')+_['upperFirst'](_0x8f41('0x5a'));if(_0x4f0450[_0x2e6666]||!_0xac2cd1[_0x8f41('0x69')]){_0x403ee5=path[_0x8f41('0x65')](config[_0x8f41('0x6a')],_0x1d2ec4,_[_0x8f41('0x66')]('default_logo.svg'));}if(!fs[_0x8f41('0x64')](_0x403ee5)){throw new db['Sequelize']['ValidationError'](_[_0x8f41('0x6b')](_0x8f41('0x5a'))+_0x8f41('0x6c'));}return _0x309fa4[_0x8f41('0x6d')](_0x403ee5);}})[_0x8f41('0x25')](handleError(_0x309fa4,null));};var utilLicense=require(_0x8f41('0x16'));exports[_0x8f41('0x6e')]=function(_0x4822d9,_0xa1553d,_0x302a4b){var _0x2505b2=_0x8f41('0x5e');var _0x2df03c={'custom':![]};return utilLicense[_0x8f41('0x6f')]()[_0x8f41('0x1b')](function(_0x5f864f){if(_0x5f864f){_0x2df03c=_0x5f864f;}return db['Setting']['find']({'where':{'id':_0x4822d9['params']['id']},'attributes':[_0x8f41('0x5a'),_0x8f41('0x5c'),_0x8f41('0x5f'),_0x8f41('0x70'),_0x8f41('0x60'),_0x8f41('0x61'),_0x8f41('0x62'),_0x8f41('0x63')],'raw':!![]});})['then'](handleEntityNotFound(_0xa1553d,null))[_0x8f41('0x1b')](function(_0x47599f){if(_0x47599f){var _0x484c34=_0x47599f[_0x8f41('0x5c')]&&fs[_0x8f41('0x64')](path[_0x8f41('0x65')](config['root'],_0x2505b2,_[_0x8f41('0x66')](_0x47599f[_0x8f41('0x5c')])))?path[_0x8f41('0x65')](config[_0x8f41('0x6a')],_0x2505b2,_[_0x8f41('0x66')](_0x47599f[_0x8f41('0x5c')])):path[_0x8f41('0x65')](config[_0x8f41('0x6a')],_0x2505b2,_[_0x8f41('0x66')]('default_loginLogo.svg'));var _0x47eb8b='default'+_[_0x8f41('0x6b')](_0x8f41('0x5c'));if(_0x47599f[_0x47eb8b]||!_0x2df03c[_0x8f41('0x69')]){_0x484c34=path[_0x8f41('0x65')](config[_0x8f41('0x6a')],_0x2505b2,_[_0x8f41('0x66')](_0x8f41('0x71')));}if(!fs[_0x8f41('0x64')](_0x484c34)){throw new db[(_0x8f41('0x72'))][(_0x8f41('0x73'))](_['upperFirst'](_0x8f41('0x5c'))+_0x8f41('0x6c'));}return _0xa1553d[_0x8f41('0x6d')](_0x484c34);}})[_0x8f41('0x25')](handleError(_0xa1553d,null));};exports[_0x8f41('0x74')]=function(_0x2602c9,_0x11bd28){return db[_0x8f41('0x38')]['find']({'where':{'id':_0x2602c9[_0x8f41('0x53')]['id']},'attributes':[_0x8f41('0x75')]})[_0x8f41('0x1b')](respondWithResult(_0x11bd28,null))[_0x8f41('0x25')](handleError(_0x11bd28,null));};exports[_0x8f41('0x76')]=function(_0x3fec5b,_0x4a66b0,_0x4fe8e9){if(_0x3fec5b[_0x8f41('0x58')]&&_0x3fec5b[_0x8f41('0x58')][_0x8f41('0x59')]){_0x3fec5b['body'][_0x8f41('0x5f')]=_0x3fec5b[_0x8f41('0x58')]['filename'];}return db[_0x8f41('0x38')]['find']({'where':{'id':_0x3fec5b[_0x8f41('0x53')]['id']}})[_0x8f41('0x1b')](handleEntityNotFound(_0x4a66b0,null))[_0x8f41('0x1b')](saveUpdates(_0x3fec5b[_0x8f41('0x55')],null))['then'](respondWithResult(_0x4a66b0,null))[_0x8f41('0x25')](handleError(_0x4a66b0,null));};var utilLicense=require(_0x8f41('0x16'));exports[_0x8f41('0x77')]=function(_0x2b64b5,_0x48d514,_0x5d6ef5){var _0x39600a=_0x8f41('0x5e');var _0x15c4f9={'custom':![]};return utilLicense[_0x8f41('0x6f')]()['then'](function(_0x386b95){if(_0x386b95){_0x15c4f9=_0x386b95;}return db[_0x8f41('0x38')][_0x8f41('0x56')]({'where':{'id':_0x2b64b5[_0x8f41('0x53')]['id']},'attributes':[_0x8f41('0x5a'),_0x8f41('0x5c'),_0x8f41('0x5f'),_0x8f41('0x70'),_0x8f41('0x60'),_0x8f41('0x61'),'defaultPreferred',_0x8f41('0x63')],'raw':!![]});})[_0x8f41('0x1b')](handleEntityNotFound(_0x48d514,null))[_0x8f41('0x1b')](function(_0x3cc26e){if(_0x3cc26e){var _0x1de8e2=_0x3cc26e[_0x8f41('0x5f')]&&fs[_0x8f41('0x64')](path[_0x8f41('0x65')](config['root'],_0x39600a,_[_0x8f41('0x66')](_0x3cc26e[_0x8f41('0x5f')])))?path[_0x8f41('0x65')](config['root'],_0x39600a,_[_0x8f41('0x66')](_0x3cc26e[_0x8f41('0x5f')])):path[_0x8f41('0x65')](config[_0x8f41('0x6a')],_0x39600a,_[_0x8f41('0x66')]('default_preferred.png'));var _0x299ae8=_0x8f41('0x68')+_[_0x8f41('0x6b')](_0x8f41('0x5f'));if(_0x3cc26e[_0x299ae8]||!_0x15c4f9[_0x8f41('0x69')]||!_0x15c4f9[_0x8f41('0x5f')]){_0x1de8e2=path[_0x8f41('0x65')](config[_0x8f41('0x6a')],_0x39600a,_[_0x8f41('0x66')](_0x8f41('0x78')));}if(!fs['existsSync'](_0x1de8e2)){throw new db['Sequelize']['ValidationError'](_[_0x8f41('0x6b')](_0x8f41('0x5f'))+_0x8f41('0x6c'));}return _0x48d514['download'](_0x1de8e2);}})[_0x8f41('0x25')](handleError(_0x48d514,null));};exports['addFavicon']=function(_0x2af5c1,_0x33fd4f,_0x4ae924){if(_0x2af5c1[_0x8f41('0x58')]&&_0x2af5c1[_0x8f41('0x58')][_0x8f41('0x59')]){_0x2af5c1[_0x8f41('0x55')][_0x8f41('0x70')]=_0x2af5c1['file'][_0x8f41('0x59')];}return db[_0x8f41('0x38')][_0x8f41('0x56')]({'where':{'id':_0x2af5c1[_0x8f41('0x53')]['id']}})[_0x8f41('0x1b')](handleEntityNotFound(_0x33fd4f,null))[_0x8f41('0x1b')](saveUpdates(_0x2af5c1['body'],null))[_0x8f41('0x1b')](respondWithResult(_0x33fd4f,null))['catch'](handleError(_0x33fd4f,null));};var utilLicense=require(_0x8f41('0x16'));exports['getFavicon']=function(_0x9bbfe,_0x40ad22,_0x59808){var _0x286d71=_0x8f41('0x5e');var _0x248a4d={'custom':![]};return utilLicense[_0x8f41('0x6f')]()['then'](function(_0x523853){if(_0x523853){_0x248a4d=_0x523853;}return db['Setting']['find']({'where':{'id':_0x9bbfe[_0x8f41('0x53')]['id']},'attributes':[_0x8f41('0x5a'),_0x8f41('0x5c'),_0x8f41('0x5f'),'favicon',_0x8f41('0x60'),_0x8f41('0x61'),'defaultPreferred',_0x8f41('0x63')],'raw':!![]});})[_0x8f41('0x1b')](handleEntityNotFound(_0x40ad22,null))[_0x8f41('0x1b')](function(_0xada734){if(_0xada734){var _0x75c661=_0xada734[_0x8f41('0x70')]&&fs[_0x8f41('0x64')](path[_0x8f41('0x65')](config[_0x8f41('0x6a')],_0x286d71,_['toLower'](_0xada734[_0x8f41('0x70')])))?path['join'](config['root'],_0x286d71,_[_0x8f41('0x66')](_0xada734[_0x8f41('0x70')])):path[_0x8f41('0x65')](config['root'],_0x286d71,_['toLower'](_0x8f41('0x79')));var _0x499450=_0x8f41('0x68')+_[_0x8f41('0x6b')]('favicon');if(_0xada734[_0x499450]||!_0x248a4d['custom']){_0x75c661=path[_0x8f41('0x65')](config['root'],_0x286d71,_[_0x8f41('0x66')](_0x8f41('0x79')));}if(!fs[_0x8f41('0x64')](_0x75c661)){throw new db[(_0x8f41('0x72'))]['ValidationError'](_[_0x8f41('0x6b')](_0x8f41('0x70'))+_0x8f41('0x6c'));}return _0x40ad22[_0x8f41('0x6d')](_0x75c661);}})[_0x8f41('0x25')](handleError(_0x40ad22,null));};exports['getDate']=function(_0x3a2901,_0x239ef8){var _0x3f5ded={'offset':moment()[_0x8f41('0x7a')]()};_0x3f5ded['now']=moment()[_0x8f41('0x7a')](_0x3f5ded[_0x8f41('0x2a')])[_0x8f41('0x7b')]('YYYY-MM-DD\x20HH:mm:ss:SSS');return _0x239ef8[_0x8f41('0x27')](0xc8)['send'](_0x3f5ded);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index 507da47..4b15ae0 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 _0x7217=['../../config/environment','./setting.attributes','exports','define','Setting','settings','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2c5340,_0x5c86e5){var _0x3c505e=function(_0x1089d9){while(--_0x1089d9){_0x2c5340['push'](_0x2c5340['shift']());}};_0x3c505e(++_0x5c86e5);}(_0x7217,0x19e));var _0x7721=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0x7217[_0x5b78e8];return _0xf2c321;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var logger=require(_0x7721('0x1'))(_0x7721('0x2'));var moment=require(_0x7721('0x3'));var BPromise=require(_0x7721('0x4'));var rp=require(_0x7721('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7721('0x6'));var attributes=require(_0x7721('0x7'));module[_0x7721('0x8')]=function(_0x3fe47c,_0xb239e0){return _0x3fe47c[_0x7721('0x9')](_0x7721('0xa'),attributes,{'tableName':_0x7721('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3e74=['exports','Setting','settings','lodash','../../config/logger','api','moment','path','../../config/environment','./setting.attributes'];(function(_0xaf29da,_0x117f5a){var _0x295c51=function(_0x3feaf4){while(--_0x3feaf4){_0xaf29da['push'](_0xaf29da['shift']());}};_0x295c51(++_0x117f5a);}(_0x3e74,0x175));var _0x43e7=function(_0x4a2f3a,_0x56cf1d){_0x4a2f3a=_0x4a2f3a-0x0;var _0x1608c6=_0x3e74[_0x4a2f3a];return _0x1608c6;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var logger=require(_0x43e7('0x1'))(_0x43e7('0x2'));var moment=require(_0x43e7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x43e7('0x4'));var rimraf=require('rimraf');var config=require(_0x43e7('0x5'));var attributes=require(_0x43e7('0x6'));module[_0x43e7('0x7')]=function(_0x1c503b,_0xc98b9c){return _0x1c503b['define'](_0x43e7('0x8'),attributes,{'tableName':_0x43e7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index e479653..2609aa0 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 _0xb961=['then','info','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Setting,\x20%s,\x20%s','result','catch','ShowSetting','Setting','find','options','raw','where','map','model','attributes','include','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x3b5e6e,_0x1fa58f){var _0x917880=function(_0x19a6d0){while(--_0x19a6d0){_0x3b5e6e['push'](_0x3b5e6e['shift']());}};_0x917880(++_0x1fa58f);}(_0xb961,0x1dd));var _0x1b96=function(_0x5c587b,_0x5707a8){_0x5c587b=_0x5c587b-0x0;var _0x2d2e5a=_0xb961[_0x5c587b];return _0x2d2e5a;};'use strict';var _=require(_0x1b96('0x0'));var util=require(_0x1b96('0x1'));var moment=require(_0x1b96('0x2'));var BPromise=require(_0x1b96('0x3'));var rs=require(_0x1b96('0x4'));var fs=require('fs');var Redis=require(_0x1b96('0x5'));var db=require(_0x1b96('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x1b96('0x7'))(_0x1b96('0x8'));var config=require(_0x1b96('0x9'));var jayson=require(_0x1b96('0xa'));var client=jayson['client'][_0x1b96('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1b60c8,_0x567f01,_0x4c4545){return new BPromise(function(_0xf191dc,_0x16784a){return client[_0x1b96('0xc')](_0x1b60c8,_0x4c4545)[_0x1b96('0xd')](function(_0x222ce5){logger[_0x1b96('0xe')]('Setting,\x20%s,\x20%s',_0x567f01,_0x1b96('0xf'));logger[_0x1b96('0x10')](_0x1b96('0x11'),_0x567f01,_0x1b96('0xf'),JSON[_0x1b96('0x12')](_0x222ce5));if(_0x222ce5[_0x1b96('0x13')]){if(_0x222ce5['error'][_0x1b96('0x14')]===0x1f4){logger['error']('Setting,\x20%s,\x20%s',_0x567f01,_0x222ce5['error'][_0x1b96('0x15')]);return _0x16784a(_0x222ce5[_0x1b96('0x13')][_0x1b96('0x15')]);}logger[_0x1b96('0x13')](_0x1b96('0x16'),_0x567f01,_0x222ce5[_0x1b96('0x13')]['message']);return _0xf191dc(_0x222ce5['error'][_0x1b96('0x15')]);}else{logger[_0x1b96('0xe')](_0x1b96('0x16'),_0x567f01,_0x1b96('0xf'));_0xf191dc(_0x222ce5[_0x1b96('0x17')][_0x1b96('0x15')]);}})[_0x1b96('0x18')](function(_0x5e6610){logger[_0x1b96('0x13')](_0x1b96('0x16'),_0x567f01,_0x5e6610);_0x16784a(_0x5e6610);});});}exports[_0x1b96('0x19')]=function(_0x56a219){var _0xa572d=this;return new Promise(function(_0x2baf1a,_0x52a365){return db[_0x1b96('0x1a')][_0x1b96('0x1b')]({'raw':_0x56a219[_0x1b96('0x1c')]?_0x56a219['options'][_0x1b96('0x1d')]===undefined?!![]:![]:!![],'where':_0x56a219[_0x1b96('0x1c')]?_0x56a219[_0x1b96('0x1c')][_0x1b96('0x1e')]||null:null,'attributes':_0x56a219['options']?_0x56a219[_0x1b96('0x1c')]['attributes']||null:null,'include':_0x56a219['options']?_0x56a219[_0x1b96('0x1c')]['include']?_[_0x1b96('0x1f')](_0x56a219[_0x1b96('0x1c')]['include'],function(_0x42929a){return{'model':db[_0x42929a[_0x1b96('0x20')]],'as':_0x42929a['as'],'attributes':_0x42929a[_0x1b96('0x21')],'include':_0x42929a[_0x1b96('0x22')]?_[_0x1b96('0x1f')](_0x42929a[_0x1b96('0x22')],function(_0x275264){return{'model':db[_0x275264[_0x1b96('0x20')]],'as':_0x275264['as'],'attributes':_0x275264[_0x1b96('0x21')],'include':_0x275264['include']?_[_0x1b96('0x1f')](_0x275264[_0x1b96('0x22')],function(_0x34c233){return{'model':db[_0x34c233['model']],'as':_0x34c233['as'],'attributes':_0x34c233[_0x1b96('0x21')]};}):[]};}):[]};}):[]:[]})[_0x1b96('0xd')](function(_0x4a748e){logger[_0x1b96('0xe')](_0x1b96('0x19'),_0x56a219);logger[_0x1b96('0x10')]('ShowSetting',_0x56a219,JSON[_0x1b96('0x12')](_0x4a748e));_0x2baf1a(_0x4a748e);})[_0x1b96('0x18')](function(_0xb3c5db){logger[_0x1b96('0x13')](_0x1b96('0x19'),_0xb3c5db[_0x1b96('0x15')],_0x56a219);_0x52a365(_0xa572d[_0x1b96('0x13')](0x1f4,_0xb3c5db[_0x1b96('0x15')]));});});}; \ No newline at end of file +var _0x156f=['http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','ShowSetting','find','options','raw','attributes','include','model','map','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x1e247a,_0x25bafb){var _0x582c37=function(_0x392e7d){while(--_0x392e7d){_0x1e247a['push'](_0x1e247a['shift']());}};_0x582c37(++_0x25bafb);}(_0x156f,0x95));var _0xf156=function(_0x476322,_0x4ef7de){_0x476322=_0x476322-0x0;var _0x35e35f=_0x156f[_0x476322];return _0x35e35f;};'use strict';var _=require(_0xf156('0x0'));var util=require(_0xf156('0x1'));var moment=require(_0xf156('0x2'));var BPromise=require(_0xf156('0x3'));var rs=require(_0xf156('0x4'));var fs=require('fs');var Redis=require(_0xf156('0x5'));var db=require(_0xf156('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xf156('0x7'))(_0xf156('0x8'));var config=require(_0xf156('0x9'));var jayson=require(_0xf156('0xa'));var client=jayson['client'][_0xf156('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xa4aa32,_0x363f16,_0x1fad59){return new BPromise(function(_0x794f64,_0x388411){return client[_0xf156('0xc')](_0xa4aa32,_0x1fad59)[_0xf156('0xd')](function(_0x1fb008){logger[_0xf156('0xe')](_0xf156('0xf'),_0x363f16,_0xf156('0x10'));logger['debug']('Setting,\x20%s,\x20%s,\x20%s',_0x363f16,_0xf156('0x10'),JSON[_0xf156('0x11')](_0x1fb008));if(_0x1fb008[_0xf156('0x12')]){if(_0x1fb008[_0xf156('0x12')][_0xf156('0x13')]===0x1f4){logger[_0xf156('0x12')](_0xf156('0xf'),_0x363f16,_0x1fb008[_0xf156('0x12')]['message']);return _0x388411(_0x1fb008['error'][_0xf156('0x14')]);}logger[_0xf156('0x12')](_0xf156('0xf'),_0x363f16,_0x1fb008[_0xf156('0x12')][_0xf156('0x14')]);return _0x794f64(_0x1fb008[_0xf156('0x12')][_0xf156('0x14')]);}else{logger[_0xf156('0xe')](_0xf156('0xf'),_0x363f16,_0xf156('0x10'));_0x794f64(_0x1fb008[_0xf156('0x15')][_0xf156('0x14')]);}})[_0xf156('0x16')](function(_0x424a3c){logger['error'](_0xf156('0xf'),_0x363f16,_0x424a3c);_0x388411(_0x424a3c);});});}exports[_0xf156('0x17')]=function(_0x16738e){var _0x3f7a48=this;return new Promise(function(_0x3ef41b,_0x19e268){return db['Setting'][_0xf156('0x18')]({'raw':_0x16738e[_0xf156('0x19')]?_0x16738e[_0xf156('0x19')][_0xf156('0x1a')]===undefined?!![]:![]:!![],'where':_0x16738e[_0xf156('0x19')]?_0x16738e['options']['where']||null:null,'attributes':_0x16738e[_0xf156('0x19')]?_0x16738e['options'][_0xf156('0x1b')]||null:null,'include':_0x16738e[_0xf156('0x19')]?_0x16738e[_0xf156('0x19')][_0xf156('0x1c')]?_['map'](_0x16738e['options']['include'],function(_0x44470f){return{'model':db[_0x44470f[_0xf156('0x1d')]],'as':_0x44470f['as'],'attributes':_0x44470f[_0xf156('0x1b')],'include':_0x44470f[_0xf156('0x1c')]?_[_0xf156('0x1e')](_0x44470f['include'],function(_0x596442){return{'model':db[_0x596442[_0xf156('0x1d')]],'as':_0x596442['as'],'attributes':_0x596442[_0xf156('0x1b')],'include':_0x596442[_0xf156('0x1c')]?_[_0xf156('0x1e')](_0x596442[_0xf156('0x1c')],function(_0x80b383){return{'model':db[_0x80b383['model']],'as':_0x80b383['as'],'attributes':_0x80b383[_0xf156('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2e0831){logger[_0xf156('0xe')](_0xf156('0x17'),_0x16738e);logger[_0xf156('0x1f')]('ShowSetting',_0x16738e,JSON[_0xf156('0x11')](_0x2e0831));_0x3ef41b(_0x2e0831);})['catch'](function(_0x26a3c6){logger[_0xf156('0x12')](_0xf156('0x17'),_0x26a3c6[_0xf156('0x14')],_0x16738e);_0x19e268(_0x3f7a48['error'](0x1f4,_0x26a3c6[_0xf156('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 9bd55d4..d96dfec 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 _0x9957=['getInteractions','statusGet','/:id/users','getAgents','post','create','addDisposition','/:id/canned_answers','addAnswer','addApplications','/:id/status','status','addAgents','/:id','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsAccount.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications','/:id/interactions'];(function(_0x3a47b1,_0x318a5e){var _0x464796=function(_0x755bd2){while(--_0x755bd2){_0x3a47b1['push'](_0x3a47b1['shift']());}};_0x464796(++_0x318a5e);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/canned_answers',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x9')](_0x7995('0x14'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router['get']('/:id/status',controller[_0x7995('0x16')]);router[_0x7995('0x9')](_0x7995('0x17'),auth[_0x7995('0xa')](),controller[_0x7995('0x18')]);router[_0x7995('0x19')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x1a')]);router['post'](_0x7995('0xf'),auth['isAuthenticated'](),controller[_0x7995('0x1b')]);router[_0x7995('0x19')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router[_0x7995('0x19')]('/:id/notify',controller['notify']);router[_0x7995('0x19')]('/:id/applications',auth['isAuthenticated'](),controller[_0x7995('0x1e')]);router[_0x7995('0x19')]('/:id/send',auth[_0x7995('0xa')](),controller['send']);router['post'](_0x7995('0x1f'),controller[_0x7995('0x20')]);router[_0x7995('0x19')](_0x7995('0x17'),auth[_0x7995('0xa')](),controller[_0x7995('0x21')]);router['put'](_0x7995('0x22'),auth[_0x7995('0xa')](),controller[_0x7995('0x23')]);router[_0x7995('0x24')](_0x7995('0x22'),auth[_0x7995('0xa')](),controller[_0x7995('0x25')]);router[_0x7995('0x24')]('/:id/dispositions',auth[_0x7995('0xa')](),controller[_0x7995('0x26')]);router[_0x7995('0x24')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x27')]);router['delete'](_0x7995('0x17'),auth['isAuthenticated'](),controller[_0x7995('0x28')]);module[_0x7995('0x29')]=router; \ No newline at end of file +var _0x7a54=['getInteractions','/:id/status','statusGet','/:id/users','post','create','addAnswer','/:id/notify','notify','addApplications','send','status','addAgents','put','/:id','update','delete','destroy','/:id/canned_answers','removeAnswers','removeAgents','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','index','/describe','isAuthenticated','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications'];(function(_0x4ee87e,_0x4cba98){var _0x254709=function(_0x539f68){while(--_0x539f68){_0x4ee87e['push'](_0x4ee87e['shift']());}};_0x254709(++_0x4cba98);}(_0x7a54,0x106));var _0x47a5=function(_0x219b97,_0x1fa138){_0x219b97=_0x219b97-0x0;var _0x59c8ae=_0x7a54[_0x219b97];return _0x59c8ae;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['describe']);router[_0x47a5('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x47a5('0x9')](_0x47a5('0xd'),auth['isAuthenticated'](),controller[_0x47a5('0xe')]);router['get']('/:id/canned_answers',auth[_0x47a5('0xc')](),controller[_0x47a5('0xf')]);router[_0x47a5('0x9')](_0x47a5('0x10'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x11')]);router[_0x47a5('0x9')]('/:id/interactions',auth[_0x47a5('0xc')](),controller[_0x47a5('0x12')]);router[_0x47a5('0x9')](_0x47a5('0x13'),controller[_0x47a5('0x14')]);router[_0x47a5('0x9')](_0x47a5('0x15'),auth[_0x47a5('0xc')](),controller['getAgents']);router[_0x47a5('0x16')]('/',auth[_0x47a5('0xc')](),controller[_0x47a5('0x17')]);router[_0x47a5('0x16')](_0x47a5('0xd'),auth['isAuthenticated'](),controller['addDisposition']);router[_0x47a5('0x16')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x47a5('0x18')]);router[_0x47a5('0x16')](_0x47a5('0x19'),controller[_0x47a5('0x1a')]);router[_0x47a5('0x16')](_0x47a5('0x10'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x1b')]);router[_0x47a5('0x16')]('/:id/send',auth[_0x47a5('0xc')](),controller[_0x47a5('0x1c')]);router['post'](_0x47a5('0x13'),controller[_0x47a5('0x1d')]);router[_0x47a5('0x16')]('/:id/users',auth[_0x47a5('0xc')](),controller[_0x47a5('0x1e')]);router[_0x47a5('0x1f')](_0x47a5('0x20'),auth['isAuthenticated'](),controller[_0x47a5('0x21')]);router[_0x47a5('0x22')]('/:id',auth[_0x47a5('0xc')](),controller[_0x47a5('0x23')]);router[_0x47a5('0x22')](_0x47a5('0xd'),auth[_0x47a5('0xc')](),controller['removeDispositions']);router['delete'](_0x47a5('0x24'),auth['isAuthenticated'](),controller[_0x47a5('0x25')]);router['delete'](_0x47a5('0x15'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x26')]);module[_0x47a5('0x27')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index edc3c17..f1e92dd 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 _0xdfe1=['intelepeer','ENUM','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','name','generate','twilio','skebby','connectel','clicksend'];(function(_0x3c6310,_0x13601d){var _0x320122=function(_0x596176){while(--_0x596176){_0x3c6310['push'](_0x3c6310['shift']());}};_0x320122(++_0x13601d);}(_0xdfe1,0x1be));var _0x1dfe=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdfe1[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x1dfe('0x0'));var rs=require(_0x1dfe('0x1'));module[_0x1dfe('0x2')]={'name':{'type':Sequelize[_0x1dfe('0x3')],'unique':_0x1dfe('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0x1dfe('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x1dfe('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0x1dfe('0x3')],'defaultValue':function(){return rs[_0x1dfe('0x5')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0x1dfe('0x6'),_0x1dfe('0x7'),_0x1dfe('0x8'),_0x1dfe('0x9'),'plivo','clickatell','bandwidth','csc','infobip',_0x1dfe('0xa'))},'accountSid':{'type':Sequelize[_0x1dfe('0x3')]},'authId':{'type':Sequelize[_0x1dfe('0x3')]},'authToken':{'type':Sequelize[_0x1dfe('0x3')]},'smsMethod':{'type':Sequelize[_0x1dfe('0xb')]('SI','TI','GP')},'username':{'type':Sequelize[_0x1dfe('0x3')]},'password':{'type':Sequelize[_0x1dfe('0x3')]},'apiKey':{'type':Sequelize[_0x1dfe('0x3')]},'applicationId':{'type':Sequelize['STRING']},'accountId':{'type':Sequelize[_0x1dfe('0x3')]},'senderString':{'type':Sequelize[_0x1dfe('0x3')]},'deliveryReport':{'type':Sequelize[_0x1dfe('0xc')],'defaultValue':![]},'description':{'type':Sequelize[_0x1dfe('0x3')]},'notificationTemplate':{'type':Sequelize[_0x1dfe('0xd')],'defaultValue':function(){return _0x1dfe('0xe');}},'notificationSound':{'type':Sequelize[_0x1dfe('0xc')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x1dfe('0xc')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x1dfe('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x1dfe('0xc')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x1dfe('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x1dfe('0xc')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x1dfe('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x1dfe('0xc')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0xb741e){if(!_0xb741e)this[_0x1dfe('0x10')](_0x1dfe('0x11'),null);this[_0x1dfe('0x10')](_0x1dfe('0x12'),_0xb741e);}}}; \ No newline at end of file +var _0x2a23=['skebby','connectel','clicksend','plivo','clickatell','infobip','intelepeer','BOOLEAN','TEXT','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','randomstring','STRING','ENUM','twilio'];(function(_0x8b4dd3,_0x120bdc){var _0x1f9fda=function(_0x59eb16){while(--_0x59eb16){_0x8b4dd3['push'](_0x8b4dd3['shift']());}};_0x1f9fda(++_0x120bdc);}(_0x2a23,0x6d));var _0x32a2=function(_0x354a15,_0x27b020){_0x354a15=_0x354a15-0x0;var _0x49159d=_0x2a23[_0x354a15];return _0x49159d;};'use strict';var Sequelize=require(_0x32a2('0x0'));var rs=require(_0x32a2('0x1'));module['exports']={'name':{'type':Sequelize[_0x32a2('0x2')],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0x32a2('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0x32a2('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0x32a2('0x2')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0x32a2('0x2')]},'type':{'type':Sequelize[_0x32a2('0x3')](_0x32a2('0x4'),_0x32a2('0x5'),_0x32a2('0x6'),_0x32a2('0x7'),_0x32a2('0x8'),_0x32a2('0x9'),'bandwidth','csc',_0x32a2('0xa'),_0x32a2('0xb'))},'accountSid':{'type':Sequelize[_0x32a2('0x2')]},'authId':{'type':Sequelize[_0x32a2('0x2')]},'authToken':{'type':Sequelize['STRING']},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize[_0x32a2('0x2')]},'password':{'type':Sequelize[_0x32a2('0x2')]},'apiKey':{'type':Sequelize[_0x32a2('0x2')]},'applicationId':{'type':Sequelize[_0x32a2('0x2')]},'accountId':{'type':Sequelize[_0x32a2('0x2')]},'senderString':{'type':Sequelize['STRING']},'deliveryReport':{'type':Sequelize[_0x32a2('0xc')],'defaultValue':![]},'description':{'type':Sequelize[_0x32a2('0x2')]},'notificationTemplate':{'type':Sequelize[_0x32a2('0xd')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x32a2('0xc')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x32a2('0xc')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x32a2('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x32a2('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x32a2('0xc')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x32a2('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x32a2('0xc')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x32a2('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x32a2('0x2')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x32a2('0xe')],'comment':_0x32a2('0xf')},'mandatoryDisposition':{'type':Sequelize[_0x32a2('0xc')],'defaultValue':![],'comment':_0x32a2('0x10'),'set':function(_0x192509){if(!_0x192509)this[_0x32a2('0x11')]('mandatoryDispositionPauseId',null);this[_0x32a2('0x11')](_0x32a2('0x12'),_0x192509);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index bb9d260..e024a0c 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 _0xc6dc=['redif','DELIVERED','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','DELIVRD','ACCEPTD','state','csc','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','register','http','request','then','SmsAccount,\x20%s,\x20%s','debug','SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','sendStatus','status','offset','undefined','count','Content-Range','apply','reject','update','get','destroy','end','stack','send','index','mandatoryDispositionPause','map','SmsAccount','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','params','Pause','includeAll','include','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','SmsAccounts','UserProfileSection','userProfileId','autoAssociation','describe','addDisposition','SmsAccountId','Disposition','getDispositions','findOne','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','notify','account','applications','orderBy','Applications','priority','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','ListId','twilio','From','Body','messageId','skebby','from','sender','clicksend','Text','MessageUUID','infobip','results','text','originatingAddress','segmentedMessage','fromNumber','intelepeer','refid','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','CmList','Contacts','DESC','list','omit','SmsInteraction','spread','interaction','created','autoclose','unmanaged','*,*,*,*','SmsMessage','ContactId','AttachmentId','User','UserId','agent','queueId','waitForTheAssignedQueue','Start','startRouting','receiveMessage','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','entity\x20found','set','Content-Type','text/xml','addApplications','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','SmsApplication','bulkCreate','findAndCountAll','finally','json','getApplications','Contact','Owner','fullname','internal','Tag','tag','to\x20is\x20mandatory','List','out','Messages','dataValues','push','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','connectel','requestid','statusInt','message_id','groupName','clickatell','bandwidth'];(function(_0x3b3f44,_0x3f0c2c){var _0x13bcee=function(_0x2dc98f){while(--_0x2dc98f){_0x3b3f44['push'](_0x3b3f44['shift']());}};_0x13bcee(++_0x3f0c2c);}(_0xc6dc,0xfa));var _0xcc6d=function(_0x496496,_0x229034){_0x496496=_0x496496-0x0;var _0x196b82=_0xc6dc[_0x496496];return _0x196b82;};'use strict';var emlformat=require(_0xcc6d('0x0'));var rimraf=require(_0xcc6d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xcc6d('0x2'));var rp=require(_0xcc6d('0x3'));var moment=require(_0xcc6d('0x4'));var BPromise=require(_0xcc6d('0x5'));var Mustache=require(_0xcc6d('0x6'));var util=require(_0xcc6d('0x7'));var path=require(_0xcc6d('0x8'));var sox=require(_0xcc6d('0x9'));var csv=require('to-csv');var ejs=require(_0xcc6d('0xa'));var fs=require('fs');var fs_extra=require(_0xcc6d('0xb'));var _=require(_0xcc6d('0xc'));var squel=require('squel');var crypto=require(_0xcc6d('0xd'));var jsforce=require(_0xcc6d('0xe'));var deskjs=require(_0xcc6d('0xf'));var toCsv=require(_0xcc6d('0x10'));var querystring=require(_0xcc6d('0x11'));var Papa=require('papaparse');var Redis=require(_0xcc6d('0x12'));var authService=require(_0xcc6d('0x13'));var qs=require(_0xcc6d('0x14'));var as=require(_0xcc6d('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcc6d('0x16'))(_0xcc6d('0x17'));var utils=require(_0xcc6d('0x18'));var config=require(_0xcc6d('0x19'));var licenseUtil=require(_0xcc6d('0x1a'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xcc6d('0x1b')](config[_0xcc6d('0x1c')],{'host':_0xcc6d('0x1d'),'port':0x18eb});var socket=require(_0xcc6d('0x1e'))(new Redis(config[_0xcc6d('0x1c')]));require('./smsAccount.socket')[_0xcc6d('0x1f')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xcc6d('0x20')]({'port':0x232c});function respondWithRpcPromise(_0x56403b,_0x58de3b,_0x342d7d,_0x4b4094){return new BPromise(function(_0x2906c8,_0x179830){var _0x53e95f=_0x4b4094||client;return _0x53e95f[_0xcc6d('0x21')](_0x56403b,_0x342d7d)[_0xcc6d('0x22')](function(_0x2e219c){logger['info'](_0xcc6d('0x23'),_0x58de3b,'request\x20sent');logger[_0xcc6d('0x24')](_0xcc6d('0x25'),_0x58de3b,_0xcc6d('0x26'),JSON[_0xcc6d('0x27')](_0x2e219c));if(_0x2e219c[_0xcc6d('0x28')]){if(_0x2e219c[_0xcc6d('0x28')][_0xcc6d('0x29')]===0x1f4){logger[_0xcc6d('0x28')](_0xcc6d('0x23'),_0x58de3b,_0x2e219c[_0xcc6d('0x28')][_0xcc6d('0x2a')]);return _0x179830(_0x2e219c[_0xcc6d('0x28')][_0xcc6d('0x2a')]);}logger[_0xcc6d('0x28')](_0xcc6d('0x23'),_0x58de3b,_0x2e219c[_0xcc6d('0x28')][_0xcc6d('0x2a')]);return _0x2906c8(_0x2e219c['error'][_0xcc6d('0x2a')]);}else{logger[_0xcc6d('0x2b')](_0xcc6d('0x23'),_0x58de3b,_0xcc6d('0x26'));_0x2906c8(_0x2e219c[_0xcc6d('0x2c')][_0xcc6d('0x2a')]);}})['catch'](function(_0x424712){logger[_0xcc6d('0x28')](_0xcc6d('0x23'),_0x58de3b,_0x424712);_0x179830(_0x424712);});});}function respondWithStatusCode(_0x5d231d,_0x9534a6){_0x9534a6=_0x9534a6||0xcc;return function(_0x5c753){if(_0x5c753){return _0x5d231d[_0xcc6d('0x2d')](_0x9534a6);}return _0x5d231d['status'](_0x9534a6)['end']();};}function respondWithResult(_0x354dc4,_0x3f5ef6){_0x3f5ef6=_0x3f5ef6||0xc8;return function(_0x46fd09){if(_0x46fd09){return _0x354dc4[_0xcc6d('0x2e')](_0x3f5ef6)['json'](_0x46fd09);}};}function respondWithFilteredResult(_0x376c29,_0x323add){return function(_0x226b0a){if(_0x226b0a){var _0x7d2ebe=typeof _0x323add[_0xcc6d('0x2f')]===_0xcc6d('0x30')&&typeof _0x323add['limit']==='undefined';var _0x8ce574=_0x226b0a[_0xcc6d('0x31')];var _0x14d6d9=_0x7d2ebe?0x0:_0x323add['offset'];var _0x5330f4=_0x7d2ebe?_0x226b0a['count']:_0x323add[_0xcc6d('0x2f')]+_0x323add['limit'];var _0x1aabe6;if(_0x5330f4>=_0x8ce574){_0x5330f4=_0x8ce574;_0x1aabe6=0xc8;}else{_0x1aabe6=0xce;}_0x376c29[_0xcc6d('0x2e')](_0x1aabe6);return _0x376c29['set'](_0xcc6d('0x32'),_0x14d6d9+'-'+_0x5330f4+'/'+_0x8ce574)['json'](_0x226b0a);}return null;};}function patchUpdates(_0x3677e4){return function(_0x1cd3ba){try{jsonpatch[_0xcc6d('0x33')](_0x1cd3ba,_0x3677e4,!![]);}catch(_0x124b50){return BPromise[_0xcc6d('0x34')](_0x124b50);}return _0x1cd3ba['save']();};}function saveUpdates(_0x1b2589,_0x1655b4){return function(_0x194f0d){if(_0x194f0d){return _0x194f0d[_0xcc6d('0x35')](_0x1b2589)[_0xcc6d('0x22')](function(_0x581bda){return _0x581bda;});}return null;};}function removeEntity(_0x139816,_0x33ee66){return function(_0x454110){if(_0x454110){return _0x454110['destroy']()[_0xcc6d('0x22')](function(){var _0x36c1e0=_0x454110[_0xcc6d('0x36')]({'plain':!![]});var _0x382155='SmsAccounts';return db['UserProfileResource'][_0xcc6d('0x37')]({'where':{'type':_0x382155,'resourceId':_0x36c1e0['id']}})[_0xcc6d('0x22')](function(){return _0x454110;});})[_0xcc6d('0x22')](function(){_0x139816['status'](0xcc)[_0xcc6d('0x38')]();});}};}function handleEntityNotFound(_0x4940de,_0x36156e){return function(_0x2b694d){if(!_0x2b694d){_0x4940de[_0xcc6d('0x2d')](0x194);}return _0x2b694d;};}function handleError(_0xf7c7ef,_0x166f1e){_0x166f1e=_0x166f1e||0x1f4;return function(_0x5552d3){logger['error'](_0x5552d3[_0xcc6d('0x39')]);if(_0x5552d3['name']){delete _0x5552d3['name'];}_0xf7c7ef[_0xcc6d('0x2e')](_0x166f1e)[_0xcc6d('0x3a')](_0x5552d3);};}exports[_0xcc6d('0x3b')]=function(_0x1e3551,_0x2f14aa){var _0x43ea42={'include':[{'model':db['Pause'],'as':_0xcc6d('0x3c')}]},_0x4a4678={},_0x42b1ea={'count':0x0,'rows':[]};var _0x3365e8=_[_0xcc6d('0x3d')](db[_0xcc6d('0x3e')][_0xcc6d('0x3f')],function(_0x289382){return{'name':_0x289382[_0xcc6d('0x40')],'type':_0x289382[_0xcc6d('0x41')][_0xcc6d('0x42')]};});_0x4a4678[_0xcc6d('0x43')]=_[_0xcc6d('0x3d')](_0x3365e8,_0xcc6d('0x44'));_0x4a4678[_0xcc6d('0x45')]=_[_0xcc6d('0x46')](_0x1e3551['query']);_0x4a4678[_0xcc6d('0x47')]=_[_0xcc6d('0x48')](_0x4a4678['model'],_0x4a4678[_0xcc6d('0x45')]);_0x43ea42[_0xcc6d('0x49')]=_['intersection'](_0x4a4678[_0xcc6d('0x43')],qs['fields'](_0x1e3551['query'][_0xcc6d('0x4a')]));_0x43ea42[_0xcc6d('0x49')]=_0x43ea42[_0xcc6d('0x49')][_0xcc6d('0x4b')]?_0x43ea42['attributes']:_0x4a4678[_0xcc6d('0x43')];if(!_0x1e3551['query'][_0xcc6d('0x4c')](_0xcc6d('0x4d'))){_0x43ea42['limit']=qs[_0xcc6d('0x4e')](_0x1e3551['query'][_0xcc6d('0x4e')]);_0x43ea42[_0xcc6d('0x2f')]=qs[_0xcc6d('0x2f')](_0x1e3551[_0xcc6d('0x45')][_0xcc6d('0x2f')]);}_0x43ea42[_0xcc6d('0x4f')]=qs[_0xcc6d('0x50')](_0x1e3551[_0xcc6d('0x45')]['sort']);_0x43ea42[_0xcc6d('0x51')]=qs['filters'](_[_0xcc6d('0x52')](_0x1e3551['query'],_0x4a4678[_0xcc6d('0x47')]),_0x3365e8);if(_0x1e3551[_0xcc6d('0x45')][_0xcc6d('0x53')]){_0x43ea42[_0xcc6d('0x51')]=_[_0xcc6d('0x54')](_0x43ea42['where'],{'$or':_[_0xcc6d('0x3d')](_0x3365e8,function(_0xa87713){if(_0xa87713[_0xcc6d('0x41')]!==_0xcc6d('0x55')){var _0xb3081a={};_0xb3081a[_0xa87713[_0xcc6d('0x44')]]={'$like':'%'+_0x1e3551[_0xcc6d('0x45')][_0xcc6d('0x53')]+'%'};return _0xb3081a;}})});}_0x43ea42=_[_0xcc6d('0x54')]({},_0x43ea42,_0x1e3551[_0xcc6d('0x56')]);var _0x492e65={'where':_0x43ea42['where']};return db[_0xcc6d('0x3e')][_0xcc6d('0x31')](_0x492e65)[_0xcc6d('0x22')](function(_0x68738b){_0x42b1ea[_0xcc6d('0x31')]=_0x68738b;if(_0x1e3551['query']['includeAll']){_0x43ea42['include']=[{'all':!![]}];}return db[_0xcc6d('0x3e')][_0xcc6d('0x57')](_0x43ea42);})[_0xcc6d('0x22')](function(_0x3246c8){_0x42b1ea[_0xcc6d('0x58')]=_0x3246c8;return _0x42b1ea;})[_0xcc6d('0x22')](respondWithFilteredResult(_0x2f14aa,_0x43ea42))['catch'](handleError(_0x2f14aa,null));};exports['show']=function(_0x406afe,_0x459a20){var _0xe328a={'raw':![],'where':{'id':_0x406afe[_0xcc6d('0x59')]['id']},'include':[{'model':db[_0xcc6d('0x5a')],'as':'mandatoryDispositionPause'}]},_0x41a60f={};_0x41a60f[_0xcc6d('0x43')]=_['keys'](db[_0xcc6d('0x3e')]['rawAttributes']);_0x41a60f['query']=_['keys'](_0x406afe[_0xcc6d('0x45')]);_0x41a60f[_0xcc6d('0x47')]=_[_0xcc6d('0x48')](_0x41a60f[_0xcc6d('0x43')],_0x41a60f[_0xcc6d('0x45')]);_0xe328a['attributes']=_[_0xcc6d('0x48')](_0x41a60f[_0xcc6d('0x43')],qs[_0xcc6d('0x4a')](_0x406afe[_0xcc6d('0x45')]['fields']));_0xe328a[_0xcc6d('0x49')]=_0xe328a[_0xcc6d('0x49')][_0xcc6d('0x4b')]?_0xe328a[_0xcc6d('0x49')]:_0x41a60f[_0xcc6d('0x43')];if(_0x406afe[_0xcc6d('0x45')][_0xcc6d('0x5b')]){_0xe328a[_0xcc6d('0x5c')]=[{'all':!![]}];}_0xe328a=_['merge']({},_0xe328a,_0x406afe[_0xcc6d('0x56')]);return db[_0xcc6d('0x3e')][_0xcc6d('0x5d')](_0xe328a)[_0xcc6d('0x22')](handleEntityNotFound(_0x459a20,null))[_0xcc6d('0x22')](respondWithResult(_0x459a20,null))[_0xcc6d('0x5e')](handleError(_0x459a20,null));};exports['create']=function(_0x2ece13,_0x31b16e){return db[_0xcc6d('0x3e')][_0xcc6d('0x5f')](_0x2ece13[_0xcc6d('0x60')],{})[_0xcc6d('0x22')](function(_0x570d9e){var _0x5e8071=_0x2ece13[_0xcc6d('0x61')][_0xcc6d('0x36')]({'plain':!![]});if(!_0x5e8071)throw new Error(_0xcc6d('0x62'));if(_0x5e8071[_0xcc6d('0x63')]===_0xcc6d('0x61')){var _0xee7096=_0x570d9e[_0xcc6d('0x36')]({'plain':!![]});var _0x208fa=_0xcc6d('0x64');return db[_0xcc6d('0x65')]['find']({'where':{'name':_0x208fa,'userProfileId':_0x5e8071[_0xcc6d('0x66')]},'raw':!![]})['then'](function(_0x2397a4){if(_0x2397a4&&_0x2397a4[_0xcc6d('0x67')]===0x0){return db['UserProfileResource'][_0xcc6d('0x5f')]({'name':_0xee7096[_0xcc6d('0x44')],'resourceId':_0xee7096['id'],'type':_0x2397a4[_0xcc6d('0x44')],'sectionId':_0x2397a4['id']},{})['then'](function(){return _0x570d9e;});}else{return _0x570d9e;}})[_0xcc6d('0x5e')](function(_0x4a8928){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4a8928);throw _0x4a8928;});}return _0x570d9e;})[_0xcc6d('0x22')](respondWithResult(_0x31b16e,0xc9))[_0xcc6d('0x5e')](handleError(_0x31b16e,null));};exports[_0xcc6d('0x35')]=function(_0x585a47,_0x13124a){if(_0x585a47['body']['id']){delete _0x585a47['body']['id'];}return db[_0xcc6d('0x3e')][_0xcc6d('0x5d')]({'where':{'id':_0x585a47['params']['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0xcc6d('0x22')](handleEntityNotFound(_0x13124a,null))[_0xcc6d('0x22')](saveUpdates(_0x585a47[_0xcc6d('0x60')],null))['then'](respondWithResult(_0x13124a,null))[_0xcc6d('0x5e')](handleError(_0x13124a,null));};exports[_0xcc6d('0x37')]=function(_0x2c42d5,_0x5625c6){return db[_0xcc6d('0x3e')][_0xcc6d('0x5d')]({'where':{'id':_0x2c42d5[_0xcc6d('0x59')]['id']}})['then'](handleEntityNotFound(_0x5625c6,null))[_0xcc6d('0x22')](removeEntity(_0x5625c6,null))[_0xcc6d('0x5e')](handleError(_0x5625c6,null));};exports['describe']=function(_0x2a611e,_0xf013b5){return db[_0xcc6d('0x3e')][_0xcc6d('0x68')]()['then'](respondWithResult(_0xf013b5,null))['catch'](handleError(_0xf013b5,null));};exports[_0xcc6d('0x69')]=function(_0xf21d1a,_0x383488,_0x1f703c){if(_0xf21d1a[_0xcc6d('0x60')]['id']){delete _0xf21d1a[_0xcc6d('0x60')]['id'];}return db[_0xcc6d('0x3e')]['find']({'where':{'id':_0xf21d1a[_0xcc6d('0x59')]['id']}})[_0xcc6d('0x22')](handleEntityNotFound(_0x383488,null))[_0xcc6d('0x22')](function(_0x87f913){if(_0x87f913){_0xf21d1a[_0xcc6d('0x60')][_0xcc6d('0x6a')]=_0x87f913['id'];return db[_0xcc6d('0x6b')][_0xcc6d('0x5f')](_0xf21d1a[_0xcc6d('0x60')]);}})['then'](respondWithResult(_0x383488,null))['catch'](handleError(_0x383488,null));};exports[_0xcc6d('0x6c')]=function(_0x1fa5de,_0x276789,_0x2c4c3d){var _0x5abdf8={'raw':![],'where':{}};var _0x480f31={};var _0x56345b={'count':0x0,'rows':[]};return db[_0xcc6d('0x3e')][_0xcc6d('0x6d')]({'where':{'id':_0x1fa5de['params']['id']}})[_0xcc6d('0x22')](handleEntityNotFound(_0x276789,null))[_0xcc6d('0x22')](function(_0x13d4fa){if(_0x13d4fa){_0x480f31[_0xcc6d('0x43')]=_[_0xcc6d('0x46')](db[_0xcc6d('0x6b')]['rawAttributes']);_0x480f31[_0xcc6d('0x45')]=_[_0xcc6d('0x46')](_0x1fa5de['query']);_0x480f31[_0xcc6d('0x47')]=_[_0xcc6d('0x48')](_0x480f31[_0xcc6d('0x43')],_0x480f31[_0xcc6d('0x45')]);_0x5abdf8[_0xcc6d('0x49')]=_[_0xcc6d('0x48')](_0x480f31[_0xcc6d('0x43')],qs[_0xcc6d('0x4a')](_0x1fa5de[_0xcc6d('0x45')][_0xcc6d('0x4a')]));_0x5abdf8[_0xcc6d('0x49')]=_0x5abdf8['attributes'][_0xcc6d('0x4b')]?_0x5abdf8[_0xcc6d('0x49')]:_0x480f31[_0xcc6d('0x43')];if(!_0x1fa5de[_0xcc6d('0x45')][_0xcc6d('0x4c')](_0xcc6d('0x4d'))){_0x5abdf8[_0xcc6d('0x4e')]=qs[_0xcc6d('0x4e')](_0x1fa5de[_0xcc6d('0x45')][_0xcc6d('0x4e')]);_0x5abdf8['offset']=qs[_0xcc6d('0x2f')](_0x1fa5de[_0xcc6d('0x45')][_0xcc6d('0x2f')]);}_0x5abdf8[_0xcc6d('0x4f')]=qs[_0xcc6d('0x50')](_0x1fa5de[_0xcc6d('0x45')][_0xcc6d('0x50')]);_0x5abdf8[_0xcc6d('0x51')]=qs[_0xcc6d('0x47')](_['pick'](_0x1fa5de[_0xcc6d('0x45')],_0x480f31[_0xcc6d('0x47')]));_0x5abdf8['where'][_0xcc6d('0x6a')]=_0x13d4fa['id'];if(_0x1fa5de['query'][_0xcc6d('0x53')]){_0x5abdf8['where']=_['merge'](_0x5abdf8['where'],{'$or':_['map'](_0x5abdf8[_0xcc6d('0x49')],function(_0x4a8cce){var _0x318d33={};_0x318d33[_0x4a8cce]={'$like':'%'+_0x1fa5de['query'][_0xcc6d('0x53')]+'%'};return _0x318d33;})});}_0x5abdf8=_[_0xcc6d('0x54')]({},_0x5abdf8,_0x1fa5de[_0xcc6d('0x56')]);return db[_0xcc6d('0x6b')][_0xcc6d('0x31')]({'where':_0x5abdf8['where']})[_0xcc6d('0x22')](function(_0x14821b){_0x56345b[_0xcc6d('0x31')]=_0x14821b;if(_0x1fa5de['query'][_0xcc6d('0x5b')]){_0x5abdf8[_0xcc6d('0x5c')]=[{'all':!![]}];}return db[_0xcc6d('0x6b')][_0xcc6d('0x57')](_0x5abdf8);})['then'](function(_0x4d3258){_0x56345b[_0xcc6d('0x58')]=_0x4d3258;return _0x56345b;});}})['then'](respondWithFilteredResult(_0x276789,_0x5abdf8))['catch'](handleError(_0x276789,null));};exports[_0xcc6d('0x6e')]=function(_0x224220,_0x4f8dc0,_0x5819f8){return db['SmsAccount'][_0xcc6d('0x5d')]({'where':{'id':_0x224220[_0xcc6d('0x59')]['id']}})[_0xcc6d('0x22')](handleEntityNotFound(_0x4f8dc0,null))[_0xcc6d('0x22')](function(_0x250987){if(_0x250987){return _0x250987[_0xcc6d('0x6e')](_0x224220['query'][_0xcc6d('0x6f')]);}})[_0xcc6d('0x22')](respondWithStatusCode(_0x4f8dc0,null))[_0xcc6d('0x5e')](handleError(_0x4f8dc0,null));};exports[_0xcc6d('0x70')]=function(_0x180bc5,_0x4c9b2d,_0x530067){if(_0x180bc5[_0xcc6d('0x60')]['id']){delete _0x180bc5[_0xcc6d('0x60')]['id'];}return db[_0xcc6d('0x3e')]['find']({'where':{'id':_0x180bc5[_0xcc6d('0x59')]['id']}})[_0xcc6d('0x22')](handleEntityNotFound(_0x4c9b2d,null))[_0xcc6d('0x22')](function(_0x1ac5c9){if(_0x1ac5c9){_0x180bc5['body'][_0xcc6d('0x6a')]=_0x1ac5c9['id'];return db[_0xcc6d('0x71')][_0xcc6d('0x5f')](_0x180bc5[_0xcc6d('0x60')]);}})['then'](respondWithResult(_0x4c9b2d,null))[_0xcc6d('0x5e')](handleError(_0x4c9b2d,null));};exports[_0xcc6d('0x72')]=function(_0x172b59,_0x376cb9,_0x40c09e){var _0x16e094={'raw':![],'where':{}};var _0x3b4ffc={};var _0xa0392f={'count':0x0,'rows':[]};return db['SmsAccount'][_0xcc6d('0x6d')]({'where':{'id':_0x172b59[_0xcc6d('0x59')]['id']}})[_0xcc6d('0x22')](handleEntityNotFound(_0x376cb9,null))['then'](function(_0x36292e){if(_0x36292e){_0x3b4ffc[_0xcc6d('0x43')]=_[_0xcc6d('0x46')](db[_0xcc6d('0x71')][_0xcc6d('0x3f')]);_0x3b4ffc['query']=_[_0xcc6d('0x46')](_0x172b59[_0xcc6d('0x45')]);_0x3b4ffc[_0xcc6d('0x47')]=_[_0xcc6d('0x48')](_0x3b4ffc[_0xcc6d('0x43')],_0x3b4ffc[_0xcc6d('0x45')]);_0x16e094[_0xcc6d('0x49')]=_['intersection'](_0x3b4ffc['model'],qs[_0xcc6d('0x4a')](_0x172b59[_0xcc6d('0x45')]['fields']));_0x16e094[_0xcc6d('0x49')]=_0x16e094[_0xcc6d('0x49')][_0xcc6d('0x4b')]?_0x16e094[_0xcc6d('0x49')]:_0x3b4ffc[_0xcc6d('0x43')];if(!_0x172b59[_0xcc6d('0x45')][_0xcc6d('0x4c')](_0xcc6d('0x4d'))){_0x16e094[_0xcc6d('0x4e')]=qs[_0xcc6d('0x4e')](_0x172b59[_0xcc6d('0x45')][_0xcc6d('0x4e')]);_0x16e094[_0xcc6d('0x2f')]=qs[_0xcc6d('0x2f')](_0x172b59[_0xcc6d('0x45')][_0xcc6d('0x2f')]);}_0x16e094[_0xcc6d('0x4f')]=qs['sort'](_0x172b59[_0xcc6d('0x45')][_0xcc6d('0x50')]);_0x16e094['where']=qs[_0xcc6d('0x47')](_['pick'](_0x172b59['query'],_0x3b4ffc[_0xcc6d('0x47')]));_0x16e094[_0xcc6d('0x51')]['SmsAccountId']=_0x36292e['id'];if(_0x172b59[_0xcc6d('0x45')][_0xcc6d('0x53')]){_0x16e094['where']=_[_0xcc6d('0x54')](_0x16e094[_0xcc6d('0x51')],{'$or':_['map'](_0x16e094['attributes'],function(_0x1f9621){var _0xf1673={};_0xf1673[_0x1f9621]={'$like':'%'+_0x172b59[_0xcc6d('0x45')][_0xcc6d('0x53')]+'%'};return _0xf1673;})});}_0x16e094=_[_0xcc6d('0x54')]({},_0x16e094,_0x172b59[_0xcc6d('0x56')]);return db[_0xcc6d('0x71')][_0xcc6d('0x31')]({'where':_0x16e094[_0xcc6d('0x51')]})[_0xcc6d('0x22')](function(_0xcba1c3){_0xa0392f[_0xcc6d('0x31')]=_0xcba1c3;if(_0x172b59[_0xcc6d('0x45')]['includeAll']){_0x16e094['include']=[{'all':!![]}];}return db[_0xcc6d('0x71')][_0xcc6d('0x57')](_0x16e094);})[_0xcc6d('0x22')](function(_0x1b972c){_0xa0392f[_0xcc6d('0x58')]=_0x1b972c;return _0xa0392f;});}})[_0xcc6d('0x22')](respondWithFilteredResult(_0x376cb9,_0x16e094))[_0xcc6d('0x5e')](handleError(_0x376cb9,null));};exports[_0xcc6d('0x73')]=function(_0x1d78f2,_0x17f518,_0x51c451){return db[_0xcc6d('0x3e')][_0xcc6d('0x5d')]({'where':{'id':_0x1d78f2[_0xcc6d('0x59')]['id']}})[_0xcc6d('0x22')](handleEntityNotFound(_0x17f518,null))[_0xcc6d('0x22')](function(_0x2c2206){if(_0x2c2206){return _0x2c2206[_0xcc6d('0x73')](_0x1d78f2[_0xcc6d('0x45')][_0xcc6d('0x6f')]);}})[_0xcc6d('0x22')](respondWithStatusCode(_0x17f518,null))[_0xcc6d('0x5e')](handleError(_0x17f518,null));};exports[_0xcc6d('0x74')]=function(_0x23a46a,_0x930409,_0x56b8c8){var _0x54273e={'channel':'sms'};var _0x4d6c51=[];var _0x52de45=[];var _0x2bf299={};return db[_0xcc6d('0x3e')][_0xcc6d('0x5d')]({'where':{'id':_0x23a46a[_0xcc6d('0x59')]['id']},'include':[{'model':db['SmsApplication'],'as':'Applications'}]})['then'](handleEntityNotFound(_0x930409,null))[_0xcc6d('0x22')](function(_0x435717){_0x54273e[_0xcc6d('0x75')]=_0x435717;_0x54273e[_0xcc6d('0x76')]=_[_0xcc6d('0x77')](_0x435717[_0xcc6d('0x78')],[_0xcc6d('0x79')],[_0xcc6d('0x7a')]);if(_0x54273e['account'][_0xcc6d('0x78')]){delete _0x54273e['account'][_0xcc6d('0x78')];}return db[_0xcc6d('0x7b')][_0xcc6d('0x68')]();})[_0xcc6d('0x22')](function(_0x46cf76){if(!_0x46cf76){throw new db[(_0xcc6d('0x7c'))][(_0xcc6d('0x7d'))](_0xcc6d('0x7e'));}_0x4d6c51=_['difference'](_['keys'](_0x46cf76),[_0xcc6d('0x7f'),_0xcc6d('0x80')]);_0x52de45=_[_0xcc6d('0x81')](_[_0xcc6d('0x46')](_0x46cf76),[_0xcc6d('0x7f'),_0xcc6d('0x80'),'CompanyId',_0xcc6d('0x82')]);_0x54273e[_0xcc6d('0x60')]={'mapKey':'mobile'};if(_0x54273e[_0xcc6d('0x75')][_0xcc6d('0x41')]){switch(_0x54273e[_0xcc6d('0x75')]['type']){case _0xcc6d('0x83'):_0x54273e[_0xcc6d('0x60')]['from']=_0x23a46a['body'][_0xcc6d('0x84')];_0x54273e[_0xcc6d('0x60')][_0xcc6d('0x60')]=_0x23a46a[_0xcc6d('0x60')][_0xcc6d('0x85')];_0x54273e['body'][_0xcc6d('0x86')]=_0x23a46a[_0xcc6d('0x60')]['MessageSid'];break;case _0xcc6d('0x87'):_0x54273e[_0xcc6d('0x60')][_0xcc6d('0x88')]='+'+_0x23a46a[_0xcc6d('0x60')][_0xcc6d('0x89')];_0x54273e['body'][_0xcc6d('0x60')]=_0x23a46a[_0xcc6d('0x60')]['text'];break;case'connectel':_0x54273e[_0xcc6d('0x60')]['from']=_0x23a46a[_0xcc6d('0x60')]['from'];_0x54273e[_0xcc6d('0x60')][_0xcc6d('0x60')]=_0x23a46a[_0xcc6d('0x60')][_0xcc6d('0x2a')];break;case _0xcc6d('0x8a'):_0x54273e[_0xcc6d('0x60')]['from']=_0x23a46a['body'][_0xcc6d('0x88')];_0x54273e[_0xcc6d('0x60')][_0xcc6d('0x60')]=_0x23a46a['body'][_0xcc6d('0x60')];_0x54273e[_0xcc6d('0x60')]['messageId']=_0x23a46a[_0xcc6d('0x60')]['message_id'];break;case'plivo':_0x54273e[_0xcc6d('0x60')]['from']=_0x23a46a[_0xcc6d('0x60')][_0xcc6d('0x84')];_0x54273e[_0xcc6d('0x60')]['body']=_0x23a46a[_0xcc6d('0x60')][_0xcc6d('0x8b')];_0x54273e['body'][_0xcc6d('0x86')]=_0x23a46a[_0xcc6d('0x60')][_0xcc6d('0x8c')];break;case _0xcc6d('0x8d'):_0x54273e[_0xcc6d('0x60')][_0xcc6d('0x88')]='+'+_0x23a46a[_0xcc6d('0x60')][_0xcc6d('0x8e')][0x0][_0xcc6d('0x88')];_0x54273e[_0xcc6d('0x60')][_0xcc6d('0x60')]=_0x23a46a[_0xcc6d('0x60')][_0xcc6d('0x8e')][0x0][_0xcc6d('0x8f')];_0x54273e[_0xcc6d('0x60')][_0xcc6d('0x86')]=_0x23a46a['body'][_0xcc6d('0x8e')][0x0][_0xcc6d('0x86')];break;case'csc':_0x54273e['body'][_0xcc6d('0x88')]=_0x23a46a['body'][_0xcc6d('0x90')];_0x54273e[_0xcc6d('0x60')][_0xcc6d('0x60')]=_0x23a46a[_0xcc6d('0x60')][_0xcc6d('0x91')]['message'];break;case'clickatell':_0x54273e[_0xcc6d('0x60')][_0xcc6d('0x88')]=_0x23a46a['body'][_0xcc6d('0x92')];_0x54273e[_0xcc6d('0x60')][_0xcc6d('0x60')]=_0x23a46a[_0xcc6d('0x60')][_0xcc6d('0x8f')];_0x54273e[_0xcc6d('0x60')][_0xcc6d('0x86')]=_0x23a46a[_0xcc6d('0x60')]['replyMessageId'];break;case'bandwidth':_0x54273e[_0xcc6d('0x60')][_0xcc6d('0x86')]=_0x23a46a['body'][0x0]['message']['id'];_0x54273e[_0xcc6d('0x60')][_0xcc6d('0x88')]=_0x23a46a[_0xcc6d('0x60')][0x0][_0xcc6d('0x2a')][_0xcc6d('0x88')];_0x54273e[_0xcc6d('0x60')][_0xcc6d('0x60')]=_0x23a46a[_0xcc6d('0x60')][0x0]['message']['text'];break;case _0xcc6d('0x93'):_0x54273e['body'][_0xcc6d('0x88')]=_0x23a46a[_0xcc6d('0x60')][_0xcc6d('0x88')];_0x54273e[_0xcc6d('0x60')][_0xcc6d('0x60')]=_0x23a46a['body'][_0xcc6d('0x2a')];_0x54273e['body'][_0xcc6d('0x86')]=_0x23a46a['body'][_0xcc6d('0x94')];break;}}if(_0x54273e[_0xcc6d('0x60')]['id']){delete _0x54273e[_0xcc6d('0x60')]['id'];}if(_[_0xcc6d('0x95')](_0x54273e[_0xcc6d('0x60')]['from'])){throw new db[(_0xcc6d('0x7c'))][(_0xcc6d('0x7d'))](_0xcc6d('0x96'));}if(_[_0xcc6d('0x95')](_0x54273e['body'][_0xcc6d('0x60')])||_0x54273e['body'][_0xcc6d('0x60')]===''){throw new db['Sequelize'][(_0xcc6d('0x7d'))](_0xcc6d('0x97'));}if(_[_0xcc6d('0x95')](_0x54273e['body']['mapKey'])){throw new db[(_0xcc6d('0x7c'))]['ValidationError'](_0xcc6d('0x98')+_0x52de45);}if(!_[_0xcc6d('0x99')](_0x52de45,_0x54273e[_0xcc6d('0x60')][_0xcc6d('0x9a')])){throw new db[(_0xcc6d('0x7c'))][(_0xcc6d('0x7d'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x52de45);}_0x2bf299[_0x54273e[_0xcc6d('0x60')][_0xcc6d('0x9a')]]=_0x54273e['body'][_0xcc6d('0x88')];return db[_0xcc6d('0x9b')]['find']({'where':{'id':_0x54273e[_0xcc6d('0x75')][_0xcc6d('0x82')]},'include':[{'model':db['CmContact'],'as':_0xcc6d('0x9c'),'where':_0x2bf299,'limit':0x1,'order':[[_0xcc6d('0x80'),_0xcc6d('0x9d')]]}]});})[_0xcc6d('0x22')](handleEntityNotFound(_0x930409,null))[_0xcc6d('0x22')](function(_0x4e1e3d){if(_0x4e1e3d){_0x54273e[_0xcc6d('0x9e')]=_[_0xcc6d('0x9f')](_0x4e1e3d,['Contacts']);if(_0x4e1e3d['Contacts'][_0xcc6d('0x4b')]){return _0x4e1e3d[_0xcc6d('0x9c')][0x0];}var _0x567459=_[_0xcc6d('0x1b')](_0x54273e[_0xcc6d('0x60')],{'firstName':_0x54273e[_0xcc6d('0x60')]['from'],'ListId':_0x4e1e3d['id']});_0x567459[_0x54273e[_0xcc6d('0x60')]['mapKey']]=_0x54273e[_0xcc6d('0x60')]['from'];return db[_0xcc6d('0x7b')][_0xcc6d('0x5f')](_0x567459,{'fields':_0x4d6c51,'raw':!![]});}})[_0xcc6d('0x22')](handleEntityNotFound(_0x930409,null))[_0xcc6d('0x22')](function(_0x519e70){if(_0x519e70){_0x54273e['contact']=_0x519e70;var _0x158dde={'ContactId':_0x519e70['id'],'phone':_0x54273e[_0xcc6d('0x60')]['from'],'SmsAccountId':_0x23a46a[_0xcc6d('0x59')]['id']};var _0x4b03e5={'ContactId':_0x519e70['id'],'SmsAccountId':_0x23a46a[_0xcc6d('0x59')]['id'],'closed':![]};return db[_0xcc6d('0xa0')]['find']({'where':_0x4b03e5})['then'](function(_0x1d630d){if(_0x1d630d){return[_0x1d630d,![]];}return db[_0xcc6d('0xa0')][_0xcc6d('0x5f')](_0x158dde)[_0xcc6d('0x22')](function(_0x2eaa77){return[_0x2eaa77,!![]];});});}})[_0xcc6d('0xa1')](function(_0x3f8da0,_0x57bb2f){_0x54273e[_0xcc6d('0xa2')]=_0x3f8da0[_0xcc6d('0x36')]({'plain':!![]});_0x54273e[_0xcc6d('0xa2')][_0xcc6d('0xa3')]=![];if(_0x57bb2f){if(_0x54273e['account'][_0xcc6d('0xa4')]){_0x54273e[_0xcc6d('0x76')]['push']({'id':0x0,'priority':_0x54273e[_0xcc6d('0x76')][_0xcc6d('0x4b')]+0x1,'app':'close','appdata':_0xcc6d('0xa5'),'interval':_0xcc6d('0xa6')});}_0x54273e['interaction']['created']=!![];}return db[_0xcc6d('0xa7')][_0xcc6d('0x5f')]({'phone':_0x54273e['body'][_0xcc6d('0x88')],'messageId':_0x54273e[_0xcc6d('0x60')][_0xcc6d('0x86')],'body':_0x54273e[_0xcc6d('0x60')][_0xcc6d('0x60')],'SmsAccountId':_0x23a46a[_0xcc6d('0x59')]['id'],'SmsInteractionId':_0x3f8da0['id'],'direction':'in','ContactId':_0x3f8da0[_0xcc6d('0xa8')],'AttachmentId':_0x54273e['body'][_0xcc6d('0xa9')]});})[_0xcc6d('0x22')](function(_0x30b8cb){_0x54273e[_0xcc6d('0x2a')]=_0x30b8cb;if(!_0x54273e[_0xcc6d('0xa2')]['UserId'])return;return db[_0xcc6d('0xaa')][_0xcc6d('0x5d')]({'attributes':['id',_0xcc6d('0x44')],'where':{'id':_0x54273e[_0xcc6d('0xa2')][_0xcc6d('0xab')]}});})[_0xcc6d('0x22')](function(_0x4472f1){if(_0x4472f1){_0x54273e[_0xcc6d('0x76')]['unshift']({'id':0x0,'priority':0x0,'app':_0xcc6d('0xac'),'appdata':_0x4472f1[_0xcc6d('0x44')]+','+(_0x54273e['account']['waitForTheAssignedAgent']||0xa),'interval':_0xcc6d('0xa6')});}if(!_0x54273e[_0xcc6d('0xa2')][_0xcc6d('0xad')])return;return db['SmsQueue'][_0xcc6d('0x5d')]({'attributes':['id','name'],'where':{'id':_0x54273e['interaction'][_0xcc6d('0xad')]}});})[_0xcc6d('0x22')](function(_0xd09339){if(_0xd09339){_0x54273e[_0xcc6d('0x76')]['unshift']({'id':0x0,'priority':0x1,'app':'queue','appdata':_0xd09339[_0xcc6d('0x44')]+','+(_0x54273e['account'][_0xcc6d('0xae')]||0x12c),'interval':_0xcc6d('0xa6')});}return respondWithRpcPromise(_0xcc6d('0xaf'),_0xcc6d('0xb0'),_0x54273e);})[_0xcc6d('0x22')](function(_0x30cbba){if(_0x30cbba){var _0xe9c9fe=0xc8;var _0x40c388=_0xcc6d('0xb1');logger[_0xcc6d('0x2b')](_0xcc6d('0x25'),_0x40c388,_0xe9c9fe,'entity\x20found');logger[_0xcc6d('0x24')](_0xcc6d('0xb2'),_0x40c388,_0xe9c9fe,_0xcc6d('0xb3'),JSON[_0xcc6d('0x27')](_0x30cbba));if(_0x54273e[_0xcc6d('0x75')]['type']===_0xcc6d('0x83')){return _0x930409[_0xcc6d('0x2e')](_0xe9c9fe)[_0xcc6d('0xb4')](_0xcc6d('0xb5'),_0xcc6d('0xb6'))[_0xcc6d('0x3a')]('\x0a');}else{return _0x930409[_0xcc6d('0x2e')](_0xe9c9fe)['json'](_0x30cbba);}}})['catch'](handleError(_0x930409,null));};exports[_0xcc6d('0xb7')]=function(_0x171092,_0x4d69fa){var _0x47367f=_0x171092['params']['id'];var _0x496bf2=_0x171092[_0xcc6d('0x60')];var _0x3e7703=0xc8;var _0x540933=null;return db[_0xcc6d('0xb8')][_0xcc6d('0xb9')]({'isolationLevel':db[_0xcc6d('0xb8')]['Transaction'][_0xcc6d('0xba')][_0xcc6d('0xbb')]},function(_0x4def10){return db[_0xcc6d('0x3e')][_0xcc6d('0x6d')]({'where':{'id':_0x47367f},'transaction':_0x4def10})[_0xcc6d('0x22')](function(_0x35521b){if(_0x35521b){return db[_0xcc6d('0xbc')]['destroy']({'where':{'SmsAccountId':_0x47367f},'transaction':_0x4def10})[_0xcc6d('0x22')](function(){var _0x263f8c=_[_0xcc6d('0x3d')](_0x496bf2,function(_0x51573d){_0x51573d['SmsAccountId']=_0x47367f;return _0x51573d;});return db[_0xcc6d('0xbc')][_0xcc6d('0xbd')](_0x263f8c,{'transaction':_0x4def10});});}else{_0x3e7703=0x194;_0x540933=[];}});})[_0xcc6d('0x22')](function(){if(_0x3e7703!==0x194){return db['SmsApplication'][_0xcc6d('0xbe')]({'where':{'SmsAccountId':_0x47367f},'order':_0xcc6d('0x79')})[_0xcc6d('0x22')](function(_0x4e5bdc){_0x540933=_0x4e5bdc;});}})[_0xcc6d('0x5e')](function(_0x42ea9c){_0x3e7703=0x1f4;logger[_0xcc6d('0x28')](_0x42ea9c[_0xcc6d('0x39')]);if(_0x42ea9c[_0xcc6d('0x44')]){delete _0x42ea9c[_0xcc6d('0x44')];}_0x540933=_0x42ea9c;})[_0xcc6d('0xbf')](function(){if(_0x540933===null){_0x4d69fa[_0xcc6d('0x2d')](_0x3e7703);}else{if(_0x3e7703===0x1f4){_0x4d69fa[_0xcc6d('0x2e')](_0x3e7703)[_0xcc6d('0x3a')](_0x540933);}else{_0x4d69fa[_0xcc6d('0x2e')](_0x3e7703)[_0xcc6d('0xc0')](_0x540933);}}});};exports['getApplications']=function(_0x5192e1,_0x5d9ed8,_0x215641){var _0x54d0b5={};var _0x6e7b1c={};var _0x2e7047;var _0x46a542;return db['SmsAccount']['findOne']({'where':{'id':_0x5192e1['params']['id']}})[_0xcc6d('0x22')](handleEntityNotFound(_0x5d9ed8,null))[_0xcc6d('0x22')](function(_0x172b2e){if(_0x172b2e){_0x2e7047=_0x172b2e;_0x6e7b1c['model']=_[_0xcc6d('0x46')](db[_0xcc6d('0xbc')][_0xcc6d('0x3f')]);_0x6e7b1c[_0xcc6d('0x45')]=_['keys'](_0x5192e1[_0xcc6d('0x45')]);_0x6e7b1c[_0xcc6d('0x47')]=_[_0xcc6d('0x48')](_0x6e7b1c[_0xcc6d('0x43')],_0x6e7b1c[_0xcc6d('0x45')]);_0x54d0b5[_0xcc6d('0x49')]=_[_0xcc6d('0x48')](_0x6e7b1c['model'],qs[_0xcc6d('0x4a')](_0x5192e1[_0xcc6d('0x45')][_0xcc6d('0x4a')]));_0x54d0b5['attributes']=_0x54d0b5['attributes'][_0xcc6d('0x4b')]?_0x54d0b5[_0xcc6d('0x49')]:_0x6e7b1c[_0xcc6d('0x43')];_0x54d0b5[_0xcc6d('0x4f')]=qs[_0xcc6d('0x50')](_0x5192e1[_0xcc6d('0x45')][_0xcc6d('0x50')]);_0x54d0b5[_0xcc6d('0x51')]=qs[_0xcc6d('0x47')](_['pick'](_0x5192e1[_0xcc6d('0x45')],_0x6e7b1c['filters']));if(_0x5192e1['query']['filter']){_0x54d0b5[_0xcc6d('0x51')]=_[_0xcc6d('0x54')](_0x54d0b5[_0xcc6d('0x51')],{'$or':_[_0xcc6d('0x3d')](_0x54d0b5[_0xcc6d('0x49')],function(_0x47b6ab){var _0x147ad4={};_0x147ad4[_0x47b6ab]={'$like':'%'+_0x5192e1[_0xcc6d('0x45')][_0xcc6d('0x53')]+'%'};return _0x147ad4;})});}_0x54d0b5=_[_0xcc6d('0x54')]({},_0x54d0b5,_0x5192e1[_0xcc6d('0x56')]);return _0x2e7047[_0xcc6d('0xc1')](_0x54d0b5);}})['then'](function(_0x375b70){if(_0x375b70){_0x46a542=_0x375b70[_0xcc6d('0x4b')];if(!_0x5192e1[_0xcc6d('0x45')][_0xcc6d('0x4c')](_0xcc6d('0x4d'))){_0x54d0b5[_0xcc6d('0x4e')]=qs[_0xcc6d('0x4e')](_0x5192e1[_0xcc6d('0x45')][_0xcc6d('0x4e')]);_0x54d0b5['offset']=qs[_0xcc6d('0x2f')](_0x5192e1[_0xcc6d('0x45')]['offset']);}return _0x2e7047[_0xcc6d('0xc1')](_0x54d0b5);}})[_0xcc6d('0x22')](function(_0x48b170){if(_0x48b170){return _0x48b170?{'count':_0x46a542,'rows':_0x48b170}:null;}})[_0xcc6d('0x22')](respondWithResult(_0x5d9ed8,null))[_0xcc6d('0x5e')](handleError(_0x5d9ed8,null));};exports['getInteractions']=function(_0x6281ff,_0x442a16,_0x5040a6){var _0x270a6d={'raw':![],'where':{}};var _0x1af48a={};var _0x49b2bb={'count':0x0,'rows':[]};return db[_0xcc6d('0x3e')][_0xcc6d('0x6d')]({'where':{'id':_0x6281ff[_0xcc6d('0x59')]['id']}})['then'](handleEntityNotFound(_0x442a16,null))[_0xcc6d('0x22')](function(_0x5d4f6d){if(_0x5d4f6d){_0x1af48a[_0xcc6d('0x43')]=_['keys'](db[_0xcc6d('0xa0')]['rawAttributes']);_0x1af48a[_0xcc6d('0x45')]=_['keys'](_0x6281ff[_0xcc6d('0x45')]);_0x1af48a[_0xcc6d('0x47')]=_[_0xcc6d('0x48')](_0x1af48a['model'],_0x1af48a['query']);_0x270a6d['attributes']=_[_0xcc6d('0x48')](_0x1af48a['model'],qs['fields'](_0x6281ff[_0xcc6d('0x45')]['fields']));_0x270a6d['attributes']=_0x270a6d[_0xcc6d('0x49')][_0xcc6d('0x4b')]?_0x270a6d[_0xcc6d('0x49')]:_0x1af48a[_0xcc6d('0x43')];if(!_0x6281ff[_0xcc6d('0x45')][_0xcc6d('0x4c')](_0xcc6d('0x4d'))){_0x270a6d[_0xcc6d('0x4e')]=qs[_0xcc6d('0x4e')](_0x6281ff[_0xcc6d('0x45')][_0xcc6d('0x4e')]);_0x270a6d[_0xcc6d('0x2f')]=qs[_0xcc6d('0x2f')](_0x6281ff[_0xcc6d('0x45')][_0xcc6d('0x2f')]);}_0x270a6d[_0xcc6d('0x4f')]=qs[_0xcc6d('0x50')](_0x6281ff[_0xcc6d('0x45')]['sort']);_0x270a6d['where']=qs[_0xcc6d('0x47')](_['pick'](_0x6281ff[_0xcc6d('0x45')],_0x1af48a['filters']));_0x270a6d[_0xcc6d('0x51')][_0xcc6d('0x6a')]=_0x5d4f6d['id'];if(_0x6281ff['query'][_0xcc6d('0x53')]){_0x270a6d['where']=_[_0xcc6d('0x54')](_0x270a6d[_0xcc6d('0x51')],{'$or':_['map'](_0x270a6d[_0xcc6d('0x49')],function(_0x47f319){var _0x151cef={};_0x151cef[_0x47f319]={'$like':'%'+_0x6281ff[_0xcc6d('0x45')][_0xcc6d('0x53')]+'%'};return _0x151cef;})});}_0x270a6d=_[_0xcc6d('0x54')]({},_0x270a6d,_0x6281ff[_0xcc6d('0x56')]);return db[_0xcc6d('0xa0')]['count']({'where':_0x270a6d[_0xcc6d('0x51')]})[_0xcc6d('0x22')](function(_0x43f9e3){_0x49b2bb[_0xcc6d('0x31')]=_0x43f9e3;if(_0x6281ff[_0xcc6d('0x45')][_0xcc6d('0x5b')]){_0x270a6d[_0xcc6d('0x5c')]=[{'model':db['CmContact'],'as':_0xcc6d('0xc2'),'required':![]},{'model':db[_0xcc6d('0xaa')],'as':_0xcc6d('0xc3'),'attributes':[_0xcc6d('0x44'),_0xcc6d('0xc4'),_0xcc6d('0xc5')],'required':![]},{'model':db[_0xcc6d('0xc6')],'as':'Tags','attributes':['id',_0xcc6d('0x44'),'color'],'where':_0x6281ff[_0xcc6d('0x45')]['tag']?{'id':_0x6281ff[_0xcc6d('0x45')]['tag']}:undefined,'required':_0x6281ff[_0xcc6d('0x45')][_0xcc6d('0xc7')]?!![]:![]}];}return db[_0xcc6d('0xa0')][_0xcc6d('0x57')](_0x270a6d);})[_0xcc6d('0x22')](function(_0x329571){_0x49b2bb['rows']=_0x329571;return _0x49b2bb;});}})[_0xcc6d('0x22')](respondWithFilteredResult(_0x442a16,_0x270a6d))[_0xcc6d('0x5e')](handleError(_0x442a16,null));};exports[_0xcc6d('0x3a')]=function(_0x2cc55f,_0x54a709,_0x2f4c00){var _0x32a51f,_0x1f1d51,_0xc776eb;if(_[_0xcc6d('0x95')](_0x2cc55f['body']['body'])||_0x2cc55f[_0xcc6d('0x60')][_0xcc6d('0x60')]===''){throw new db[(_0xcc6d('0x7c'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xcc6d('0x95')](_0x2cc55f[_0xcc6d('0x60')]['to'])){throw new db[(_0xcc6d('0x7c'))][(_0xcc6d('0x7d'))](_0xcc6d('0xc8'));}_0x32a51f=_0x2cc55f[_0xcc6d('0x60')]['to'];return db[_0xcc6d('0x3e')][_0xcc6d('0x5d')]({'where':{'id':_0x2cc55f['params']['id']},'include':[{'model':db[_0xcc6d('0x9b')],'as':_0xcc6d('0xc9'),'include':[{'model':db['CmContact'],'as':_0xcc6d('0x9c'),'where':{'mobile':_0x32a51f},'limit':0x1,'order':[[_0xcc6d('0x80'),_0xcc6d('0x9d')]]}]}]})[_0xcc6d('0x22')](handleEntityNotFound(_0x54a709,null))['then'](function(_0x32d025){if(_0x32d025&&_0x32d025['List']){_0x1f1d51=_0x32d025['get']({'plain':!![]});if(_0x1f1d51[_0xcc6d('0xc9')]&&_0x1f1d51['List']['Contacts'][_0xcc6d('0x4b')]){return _0x1f1d51[_0xcc6d('0xc9')]['Contacts'][0x0];}return db[_0xcc6d('0x7b')]['create'](_['defaults'](_0x2cc55f[_0xcc6d('0x60')],{'firstName':_0x32a51f,'mobile':_0x32a51f,'phone':_0x32a51f,'ListId':_0x1f1d51[_0xcc6d('0x82')]}));}})['then'](handleEntityNotFound(_0x54a709,null))[_0xcc6d('0x22')](function(_0x5a528){if(_0x5a528){_0xc776eb=_0x5a528;return db[_0xcc6d('0xa0')]['find']({'where':{'ContactId':_0xc776eb['id'],'closed':![],'SmsAccountId':_0x1f1d51['id']}})[_0xcc6d('0x22')](function(_0x40ccc8){if(_0x40ccc8){return[_0x40ccc8,![]];}return db[_0xcc6d('0xa0')][_0xcc6d('0x5f')]({'UserId':_0x2cc55f[_0xcc6d('0x61')]['id'],'ContactId':_0xc776eb['id'],'SmsAccountId':_0x1f1d51['id'],'phone':_0x32a51f,'firstMsgDirection':_0xcc6d('0xca'),'Messages':[_[_0xcc6d('0x54')](_0x2cc55f[_0xcc6d('0x60')],{'read':![],'body':_0x2cc55f[_0xcc6d('0x60')][_0xcc6d('0x60')],'phone':_0x32a51f,'SmsAccountId':_0x1f1d51['id'],'UserId':_0x2cc55f['user']['id'],'ContactId':_0xc776eb['id']})]},{'include':[{'model':db[_0xcc6d('0xa7')],'as':_0xcc6d('0xcb')}]})['then'](function(_0x1ee5d0){return[_0x1ee5d0,!![]];});});}})[_0xcc6d('0xa1')](function(_0x4753bd,_0x2cdf64){if(_0x2cdf64){return _0x4753bd;}return db[_0xcc6d('0xa7')][_0xcc6d('0x5f')](_[_0xcc6d('0x54')](_0x2cc55f[_0xcc6d('0x60')],{'read':![],'body':_0x2cc55f[_0xcc6d('0x60')][_0xcc6d('0x60')],'phone':_0x32a51f,'SmsAccountId':_0x1f1d51['id'],'SmsInteractionId':_0x4753bd['id'],'UserId':_0x2cc55f[_0xcc6d('0x61')]['id'],'ContactId':_0xc776eb['id']}))['then'](function(_0x373dd5){_0x4753bd['dataValues'][_0xcc6d('0xcb')]=[];_0x4753bd[_0xcc6d('0xcc')]['Messages'][_0xcc6d('0xcd')](_0x373dd5[_0xcc6d('0xcc')]);return _0x4753bd;});})[_0xcc6d('0x22')](respondWithResult(_0x54a709,null))['catch'](handleError(_0x54a709,null));};exports[_0xcc6d('0x2e')]=function(_0x270c51,_0x325e2e,_0x20dd8b){if(_0x270c51[_0xcc6d('0x60')]['id']){delete _0x270c51[_0xcc6d('0x60')]['id'];}var _0x287d31,_0x1d5aaa,_0xeb3fde;return db[_0xcc6d('0x3e')][_0xcc6d('0x5d')]({'where':{'id':_0x270c51[_0xcc6d('0x59')]['id']}})['then'](handleEntityNotFound(_0x325e2e,null))['then'](function(_0x29714e){if(_0x29714e){_0xeb3fde=_0x29714e;logger[_0xcc6d('0x24')](_0xcc6d('0x25'),_0xcc6d('0x2e'),_0xcc6d('0xce'),_0x29714e[_0xcc6d('0x41')],util[_0xcc6d('0xcf')](_0x270c51[_0xcc6d('0x60')],{'showHidden':![],'depth':null}));switch(_0x29714e[_0xcc6d('0x41')]){case _0xcc6d('0x87'):if(_0x270c51[_0xcc6d('0x60')][_0xcc6d('0xd0')]&&_0x270c51[_0xcc6d('0x60')][_0xcc6d('0x2e')]){_0x1d5aaa=_0x270c51[_0xcc6d('0x60')][_0xcc6d('0x2e')];return db['SmsMessage'][_0xcc6d('0x5d')]({'where':{'messageId':_0x270c51[_0xcc6d('0x60')][_0xcc6d('0xd0')]}});}break;case _0xcc6d('0xd1'):if(_0x270c51[_0xcc6d('0x60')][_0xcc6d('0xd2')]&&_0x270c51[_0xcc6d('0x60')][_0xcc6d('0xd3')]){_0x1d5aaa=_0x270c51[_0xcc6d('0x60')][_0xcc6d('0xd3')];return db[_0xcc6d('0xa7')][_0xcc6d('0x5d')]({'where':{'messageId':_0x270c51[_0xcc6d('0x60')][_0xcc6d('0xd2')]}});}break;case _0xcc6d('0x8a'):if(_0x270c51[_0xcc6d('0x60')][_0xcc6d('0xd4')]&&_0x270c51[_0xcc6d('0x60')]['status_code']){_0x1d5aaa=_0x270c51[_0xcc6d('0x60')]['status_code'];return db[_0xcc6d('0xa7')][_0xcc6d('0x5d')]({'where':{'messageId':_0x270c51[_0xcc6d('0x60')][_0xcc6d('0xd4')]}});}break;case'infobip':var _0x631d58=_0x270c51[_0xcc6d('0x60')][_0xcc6d('0x8e')][0x0];if(_0x631d58[_0xcc6d('0x86')]&&_0x631d58[_0xcc6d('0x2e')]['groupName']==='DELIVERED'){_0x1d5aaa=_0x631d58[_0xcc6d('0x2e')][_0xcc6d('0xd5')];return db[_0xcc6d('0xa7')]['find']({'where':{'messageId':_0x631d58[_0xcc6d('0x86')]}});}break;case _0xcc6d('0xd6'):if(_0x270c51[_0xcc6d('0x60')][_0xcc6d('0x86')]&&_0x270c51[_0xcc6d('0x60')][_0xcc6d('0x2e')]){_0x1d5aaa=_0x270c51[_0xcc6d('0x60')][_0xcc6d('0x2e')];return db[_0xcc6d('0xa7')]['find']({'where':{'messageId':_0x270c51[_0xcc6d('0x60')][_0xcc6d('0x86')]}});}break;case _0xcc6d('0xd7'):if(_0x270c51[_0xcc6d('0x60')][0x0][_0xcc6d('0x2a')]['id']){_0x1d5aaa=_0x270c51[_0xcc6d('0x60')][0x0]['type'];return db[_0xcc6d('0xa7')]['find']({'where':{'messageId':_0x270c51[_0xcc6d('0x60')][0x0]['message']['id']}});}break;case _0xcc6d('0x93'):if(_0x270c51['body'][_0xcc6d('0xd8')]&&_0x270c51[_0xcc6d('0x60')]['status']){_0x1d5aaa=_0x270c51['body']['status'];return db[_0xcc6d('0xa7')][_0xcc6d('0x5d')]({'where':{'messageId':_0x270c51['body'][_0xcc6d('0xd8')]}});}break;}}})['then'](handleEntityNotFound(_0x325e2e,null))['then'](function(_0x46a8cd){if(_0x46a8cd){_0x287d31=_0x46a8cd;switch(_0xeb3fde[_0xcc6d('0x41')]){case _0xcc6d('0x87'):if(_0x1d5aaa===_0xcc6d('0xd9')){return _0x287d31[_0xcc6d('0x35')]({'read':!![]});}else{logger[_0xcc6d('0x28')](_0xcc6d('0x25'),'status',_0xcc6d('0x87'),util['inspect'](_0x270c51[_0xcc6d('0x60')],{'showHidden':![],'depth':null}));}break;case _0xcc6d('0xd1'):if(_0x1d5aaa==='1'){return _0x287d31[_0xcc6d('0x35')]({'read':!![]});}else{logger[_0xcc6d('0x28')](_0xcc6d('0x25'),_0xcc6d('0x2e'),_0xcc6d('0x87'),util[_0xcc6d('0xcf')](_0x270c51[_0xcc6d('0x60')],{'showHidden':![],'depth':null}));}break;case _0xcc6d('0x8a'):if(!_0x270c51[_0xcc6d('0x60')][_0xcc6d('0xda')]&&_0x1d5aaa>=0xc8&&_0x1d5aaa<=0xce){return _0x287d31[_0xcc6d('0x35')]({'read':!![]});}else{logger[_0xcc6d('0x28')](_0xcc6d('0x25'),_0xcc6d('0x2e'),'clicksend',util[_0xcc6d('0xcf')](_0x270c51[_0xcc6d('0x60')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x25a04e=_0x270c51['body'][_0xcc6d('0x8e')][0x0];if(_0x25a04e[_0xcc6d('0x2e')][_0xcc6d('0xd5')]===_0xcc6d('0xd9')){return _0x287d31['update']({'read':!![]});}else{logger[_0xcc6d('0x28')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0xcc6d('0x8d'),util['inspect'](_0x270c51[_0xcc6d('0x60')],{'showHidden':![],'depth':null}));}break;case _0xcc6d('0xd6'):if(_0x1d5aaa==_0xcc6d('0xdb')||_0x1d5aaa==_0xcc6d('0xdc')){return _0x287d31[_0xcc6d('0x35')]({'read':!![]});}else{logger[_0xcc6d('0x28')](_0xcc6d('0x25'),_0xcc6d('0x2e'),_0xcc6d('0xd6'),util[_0xcc6d('0xcf')](_0x270c51[_0xcc6d('0x60')],{'showHidden':![],'depth':null}));}break;case _0xcc6d('0xd7'):if(_0x1d5aaa==_0xcc6d('0xdd')){return _0x287d31[_0xcc6d('0x35')]({'read':!![]});}else{logger['error'](_0xcc6d('0x25'),_0xcc6d('0x2e'),'bandwidth',util[_0xcc6d('0xcf')](_0x270c51[_0xcc6d('0x60')],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0x1d5aaa===_0xcc6d('0xde')||_0x1d5aaa===_0xcc6d('0xdf')){return _0x287d31['update']({'read':!![]});}else{logger['error'](_0xcc6d('0x25'),_0xcc6d('0x2e'),_0xcc6d('0x93'),util['inspect'](_0x270c51['body'],{'showHidden':![],'depth':null}));}break;}return _0x287d31;}})[_0xcc6d('0x22')](respondWithResult(_0x325e2e,null))[_0xcc6d('0x5e')](handleError(_0x325e2e,null));};exports['statusGet']=function(_0x34b744,_0x36ccd1,_0xf8b9f0){var _0x78fa0f,_0x24e62,_0x2521e5;return db[_0xcc6d('0x3e')][_0xcc6d('0x5d')]({'where':{'id':_0x34b744[_0xcc6d('0x59')]['id']}})[_0xcc6d('0x22')](handleEntityNotFound(_0x36ccd1,null))[_0xcc6d('0x22')](function(_0x517769){if(_0x517769){_0x2521e5=_0x517769;logger[_0xcc6d('0x24')](_0xcc6d('0x25'),_0xcc6d('0x2e'),_0xcc6d('0xce'),_0x517769[_0xcc6d('0x41')],util['inspect'](_0x34b744[_0xcc6d('0x45')],{'showHidden':![],'depth':null}));switch(_0x517769[_0xcc6d('0x41')]){case'csc':if(_0x34b744[_0xcc6d('0x45')]['message-id']&&_0x34b744['query'][_0xcc6d('0xe0')]){_0x24e62=_0x34b744[_0xcc6d('0x45')][_0xcc6d('0xe0')];return db['SmsMessage']['find']({'where':{'messageId':_0x34b744[_0xcc6d('0x45')]['message-id']}});}break;}}})[_0xcc6d('0x22')](handleEntityNotFound(_0x36ccd1,null))[_0xcc6d('0x22')](function(_0x2d8de2){if(_0x2d8de2){_0x78fa0f=_0x2d8de2;switch(_0x2521e5[_0xcc6d('0x41')]){case _0xcc6d('0xe1'):if(_0x24e62==='2'||_0x24e62==='6'){return _0x78fa0f['update']({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0xcc6d('0x2e'),'csc',util[_0xcc6d('0xcf')](_0x34b744[_0xcc6d('0x45')],{'showHidden':![],'depth':null}));};break;}return _0x78fa0f;}})[_0xcc6d('0x22')](respondWithResult(_0x36ccd1,null))[_0xcc6d('0x5e')](handleError(_0x36ccd1,null));};exports[_0xcc6d('0xe2')]=function(_0x539ef5,_0x163e4d,_0x1d5863){return db[_0xcc6d('0x3e')][_0xcc6d('0x5d')]({'where':{'id':_0x539ef5[_0xcc6d('0x59')]['id']}})[_0xcc6d('0x22')](handleEntityNotFound(_0x163e4d,null))[_0xcc6d('0x22')](function(_0x5c7876){if(_0x5c7876){return _0x5c7876['addAgents'](_0x539ef5[_0xcc6d('0x60')][_0xcc6d('0x6f')],_[_0xcc6d('0x9f')](_0x539ef5[_0xcc6d('0x60')],[_0xcc6d('0x6f'),'id'])||{})[_0xcc6d('0xa1')](function(_0x14417d){for(var _0x3a81f5=0x0;_0x3a81f5<_0x539ef5[_0xcc6d('0x60')]['ids'][_0xcc6d('0x4b')];_0x3a81f5+=0x1){socket[_0xcc6d('0xe3')](_0xcc6d('0xe4'),{'UserId':Number(_0x539ef5[_0xcc6d('0x60')][_0xcc6d('0x6f')][_0x3a81f5]),'SmsAccountId':Number(_0x539ef5['params']['id'])});}return _0x14417d;});}})[_0xcc6d('0x22')](respondWithResult(_0x163e4d,null))[_0xcc6d('0x5e')](handleError(_0x163e4d,null));};exports[_0xcc6d('0xe5')]=function(_0xb7e688,_0x254b42,_0x2b5e41){return db[_0xcc6d('0x3e')]['find']({'where':{'id':_0xb7e688['params']['id']}})[_0xcc6d('0x22')](handleEntityNotFound(_0x254b42,null))['then'](function(_0x2e6dcd){if(_0x2e6dcd){return _0x2e6dcd['removeAgents'](_0xb7e688[_0xcc6d('0x45')][_0xcc6d('0x6f')])[_0xcc6d('0x22')](function(){if(_[_0xcc6d('0xe6')](_0xb7e688['query'][_0xcc6d('0x6f')])){for(var _0x924e64=0x0;_0x924e64<_0xb7e688[_0xcc6d('0x45')][_0xcc6d('0x6f')]['length'];_0x924e64+=0x1){socket[_0xcc6d('0xe3')]('userSmsAccount:remove',{'UserId':Number(_0xb7e688[_0xcc6d('0x45')][_0xcc6d('0x6f')][_0x924e64]),'SmsAccountId':Number(_0xb7e688[_0xcc6d('0x59')]['id'])});}}else{socket[_0xcc6d('0xe3')](_0xcc6d('0xe7'),{'UserId':Number(_0xb7e688[_0xcc6d('0x45')][_0xcc6d('0x6f')]),'SmsAccountId':Number(_0xb7e688['params']['id'])});}});}})[_0xcc6d('0x22')](respondWithStatusCode(_0x254b42,null))[_0xcc6d('0x5e')](handleError(_0x254b42,null));};exports[_0xcc6d('0xe8')]=function(_0x4e9433,_0x3241b1,_0x26bb2a){var _0x184493={};var _0x7c816={};var _0x301149;var _0x349389;return db[_0xcc6d('0x3e')][_0xcc6d('0x6d')]({'where':{'id':_0x4e9433[_0xcc6d('0x59')]['id']}})[_0xcc6d('0x22')](handleEntityNotFound(_0x3241b1,null))[_0xcc6d('0x22')](function(_0x368d73){if(_0x368d73){_0x301149=_0x368d73;_0x7c816[_0xcc6d('0x43')]=_[_0xcc6d('0x46')](db[_0xcc6d('0xaa')]['rawAttributes']);_0x7c816['query']=_[_0xcc6d('0x46')](_0x4e9433[_0xcc6d('0x45')]);_0x7c816[_0xcc6d('0x47')]=_[_0xcc6d('0x48')](_0x7c816['model'],_0x7c816[_0xcc6d('0x45')]);_0x184493[_0xcc6d('0x49')]=_[_0xcc6d('0x48')](_0x7c816[_0xcc6d('0x43')],qs['fields'](_0x4e9433[_0xcc6d('0x45')]['fields']));_0x184493[_0xcc6d('0x49')]=_0x184493[_0xcc6d('0x49')][_0xcc6d('0x4b')]?_0x184493[_0xcc6d('0x49')]:_0x7c816['model'];_0x184493['order']=qs[_0xcc6d('0x50')](_0x4e9433[_0xcc6d('0x45')][_0xcc6d('0x50')]);_0x184493[_0xcc6d('0x51')]=qs['filters'](_[_0xcc6d('0x52')](_0x4e9433[_0xcc6d('0x45')],_0x7c816[_0xcc6d('0x47')]));if(_0x4e9433[_0xcc6d('0x45')][_0xcc6d('0x53')]){_0x184493['where']=_[_0xcc6d('0x54')](_0x184493[_0xcc6d('0x51')],{'$or':_['map'](_0x184493['attributes'],function(_0x54042a){var _0x20edd9={};_0x20edd9[_0x54042a]={'$like':'%'+_0x4e9433[_0xcc6d('0x45')][_0xcc6d('0x53')]+'%'};return _0x20edd9;})});}_0x184493=_[_0xcc6d('0x54')]({},_0x184493,_0x4e9433[_0xcc6d('0x56')]);return _0x301149[_0xcc6d('0xe8')](_0x184493);}})['then'](function(_0x2e4b61){if(_0x2e4b61){_0x349389=_0x2e4b61['length'];if(!_0x4e9433['query']['hasOwnProperty']('nolimit')){_0x184493[_0xcc6d('0x4e')]=qs['limit'](_0x4e9433[_0xcc6d('0x45')][_0xcc6d('0x4e')]);_0x184493[_0xcc6d('0x2f')]=qs[_0xcc6d('0x2f')](_0x4e9433['query'][_0xcc6d('0x2f')]);}return _0x301149[_0xcc6d('0xe8')](_0x184493);}})[_0xcc6d('0x22')](function(_0x5d58bb){if(_0x5d58bb){return _0x5d58bb?{'count':_0x349389,'rows':_0x5d58bb}:null;}})[_0xcc6d('0x22')](respondWithResult(_0x3241b1,null))[_0xcc6d('0x5e')](handleError(_0x3241b1,null));}; \ No newline at end of file +var _0xd325=['Sequelize','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','omit','SmsInteraction','created','autoclose','push','close','unmanaged','*,*,*,*','interaction','ContactId','AttachmentId','User','UserId','agent','waitForTheAssignedAgent','queueId','SmsQueue','queue','waitForTheAssignedQueue','Start','startRouting','receiveMessage','SmsAccount,\x20%s,\x20%s,\x20%s','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','set','text/xml','\x0a','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','findOne','SmsApplication','bulkCreate','findAndCountAll','priority','stack','finally','sendStatus','getApplications','getInteractions','fullname','internal','Tag','color','tag','List','out','Messages','spread','SmsMessage','dataValues','debug','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','requestid','statusInt','status_code','groupName','DELIVERED','redif','error_code','RECEIVED_BY_RECIPIENT','message-delivered','DELIVRD','ACCEPTD','statusGet','csc','state','message-id','addAgents','emit','userSmsAccount:save','removeAgents','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','util','path','sox','to-csv','ejs','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./smsAccount.socket','register','client','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','destroy','get','SmsAccounts','name','send','index','Pause','map','SmsAccount','rawAttributes','fieldName','key','keys','query','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','options','includeAll','include','params','mandatoryDispositionPause','length','find','create','body','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','SmsAccountId','Disposition','findAll','rows','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','sms','Applications','applications','orderBy','account','CmContact','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','from','Body','messageId','MessageSid','skebby','connectel','clicksend','message_id','plivo','From','Text','MessageUUID','infobip','results','originatingAddress','clickatell','fromNumber','replyMessageId','bandwidth','text','intelepeer','isNil'];(function(_0x1356df,_0x5685f8){var _0x376d50=function(_0x4129ac){while(--_0x4129ac){_0x1356df['push'](_0x1356df['shift']());}};_0x376d50(++_0x5685f8);}(_0xd325,0x13d));var _0x5d32=function(_0x132558,_0x521d93){_0x132558=_0x132558-0x0;var _0x34f138=_0xd325[_0x132558];return _0x34f138;};'use strict';var emlformat=require(_0x5d32('0x0'));var rimraf=require(_0x5d32('0x1'));var zipdir=require(_0x5d32('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5d32('0x3'));var moment=require(_0x5d32('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5d32('0x5'));var path=require(_0x5d32('0x6'));var sox=require(_0x5d32('0x7'));var csv=require(_0x5d32('0x8'));var ejs=require(_0x5d32('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x5d32('0xa'));var crypto=require(_0x5d32('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x5d32('0xc'));var toCsv=require(_0x5d32('0x8'));var querystring=require('querystring');var Papa=require(_0x5d32('0xd'));var Redis=require(_0x5d32('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x5d32('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5d32('0x10'));var logger=require('../../config/logger')(_0x5d32('0x11'));var utils=require(_0x5d32('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x5d32('0x13'));var db=require(_0x5d32('0x14'))['db'];config[_0x5d32('0x15')]=_[_0x5d32('0x16')](config[_0x5d32('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x5d32('0x17'))(new Redis(config['redis']));require(_0x5d32('0x18'))[_0x5d32('0x19')](socket);var jayson=require('jayson/promise');var client=jayson[_0x5d32('0x1a')]['http']({'port':0x232c});function respondWithRpcPromise(_0x5d5fc9,_0x48aa18,_0x11136e,_0x4437d1){return new BPromise(function(_0xfaedfd,_0x7e07b9){var _0x1b3cb5=_0x4437d1||client;return _0x1b3cb5[_0x5d32('0x1b')](_0x5d5fc9,_0x11136e)[_0x5d32('0x1c')](function(_0x3b057c){logger[_0x5d32('0x1d')](_0x5d32('0x1e'),_0x48aa18,'request\x20sent');logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x48aa18,_0x5d32('0x1f'),JSON[_0x5d32('0x20')](_0x3b057c));if(_0x3b057c[_0x5d32('0x21')]){if(_0x3b057c['error'][_0x5d32('0x22')]===0x1f4){logger[_0x5d32('0x21')]('SmsAccount,\x20%s,\x20%s',_0x48aa18,_0x3b057c[_0x5d32('0x21')]['message']);return _0x7e07b9(_0x3b057c['error'][_0x5d32('0x23')]);}logger[_0x5d32('0x21')](_0x5d32('0x1e'),_0x48aa18,_0x3b057c['error'][_0x5d32('0x23')]);return _0xfaedfd(_0x3b057c['error'][_0x5d32('0x23')]);}else{logger[_0x5d32('0x1d')](_0x5d32('0x1e'),_0x48aa18,_0x5d32('0x1f'));_0xfaedfd(_0x3b057c['result'][_0x5d32('0x23')]);}})[_0x5d32('0x24')](function(_0x48445e){logger[_0x5d32('0x21')](_0x5d32('0x1e'),_0x48aa18,_0x48445e);_0x7e07b9(_0x48445e);});});}function respondWithStatusCode(_0xc4ee96,_0x4219cf){_0x4219cf=_0x4219cf||0xcc;return function(_0x5c413b){if(_0x5c413b){return _0xc4ee96['sendStatus'](_0x4219cf);}return _0xc4ee96[_0x5d32('0x25')](_0x4219cf)[_0x5d32('0x26')]();};}function respondWithResult(_0x472f64,_0x5babb6){_0x5babb6=_0x5babb6||0xc8;return function(_0x4ad32d){if(_0x4ad32d){return _0x472f64[_0x5d32('0x25')](_0x5babb6)[_0x5d32('0x27')](_0x4ad32d);}};}function respondWithFilteredResult(_0x493c37,_0x1f5d20){return function(_0x30a705){if(_0x30a705){var _0x1a180b=typeof _0x1f5d20[_0x5d32('0x28')]===_0x5d32('0x29')&&typeof _0x1f5d20['limit']===_0x5d32('0x29');var _0x36883b=_0x30a705[_0x5d32('0x2a')];var _0x570670=_0x1a180b?0x0:_0x1f5d20['offset'];var _0x50e44c=_0x1a180b?_0x30a705[_0x5d32('0x2a')]:_0x1f5d20[_0x5d32('0x28')]+_0x1f5d20[_0x5d32('0x2b')];var _0x1d2228;if(_0x50e44c>=_0x36883b){_0x50e44c=_0x36883b;_0x1d2228=0xc8;}else{_0x1d2228=0xce;}_0x493c37[_0x5d32('0x25')](_0x1d2228);return _0x493c37['set'](_0x5d32('0x2c'),_0x570670+'-'+_0x50e44c+'/'+_0x36883b)[_0x5d32('0x27')](_0x30a705);}return null;};}function patchUpdates(_0x19080f){return function(_0x5e34d2){try{jsonpatch[_0x5d32('0x2d')](_0x5e34d2,_0x19080f,!![]);}catch(_0x3a87e0){return BPromise[_0x5d32('0x2e')](_0x3a87e0);}return _0x5e34d2[_0x5d32('0x2f')]();};}function saveUpdates(_0x4ac03f,_0x7952e9){return function(_0x4cae4d){if(_0x4cae4d){return _0x4cae4d['update'](_0x4ac03f)[_0x5d32('0x1c')](function(_0x11c5b6){return _0x11c5b6;});}return null;};}function removeEntity(_0x338cb0,_0x5b13fd){return function(_0x54d3ee){if(_0x54d3ee){return _0x54d3ee[_0x5d32('0x30')]()[_0x5d32('0x1c')](function(){var _0x268411=_0x54d3ee[_0x5d32('0x31')]({'plain':!![]});var _0x5becb7=_0x5d32('0x32');return db['UserProfileResource'][_0x5d32('0x30')]({'where':{'type':_0x5becb7,'resourceId':_0x268411['id']}})[_0x5d32('0x1c')](function(){return _0x54d3ee;});})[_0x5d32('0x1c')](function(){_0x338cb0[_0x5d32('0x25')](0xcc)[_0x5d32('0x26')]();});}};}function handleEntityNotFound(_0x453754,_0x5aec14){return function(_0x523a1a){if(!_0x523a1a){_0x453754['sendStatus'](0x194);}return _0x523a1a;};}function handleError(_0x20a4c5,_0x30e1dd){_0x30e1dd=_0x30e1dd||0x1f4;return function(_0x56816f){logger[_0x5d32('0x21')](_0x56816f['stack']);if(_0x56816f[_0x5d32('0x33')]){delete _0x56816f[_0x5d32('0x33')];}_0x20a4c5['status'](_0x30e1dd)[_0x5d32('0x34')](_0x56816f);};}exports[_0x5d32('0x35')]=function(_0xfb577a,_0x51099c){var _0x289812={'include':[{'model':db[_0x5d32('0x36')],'as':'mandatoryDispositionPause'}]},_0x3433e3={},_0x3d3960={'count':0x0,'rows':[]};var _0x57494d=_[_0x5d32('0x37')](db[_0x5d32('0x38')][_0x5d32('0x39')],function(_0x185eff){return{'name':_0x185eff[_0x5d32('0x3a')],'type':_0x185eff['type'][_0x5d32('0x3b')]};});_0x3433e3['model']=_[_0x5d32('0x37')](_0x57494d,_0x5d32('0x33'));_0x3433e3['query']=_[_0x5d32('0x3c')](_0xfb577a[_0x5d32('0x3d')]);_0x3433e3['filters']=_[_0x5d32('0x3e')](_0x3433e3[_0x5d32('0x3f')],_0x3433e3[_0x5d32('0x3d')]);_0x289812[_0x5d32('0x40')]=_[_0x5d32('0x3e')](_0x3433e3[_0x5d32('0x3f')],qs[_0x5d32('0x41')](_0xfb577a[_0x5d32('0x3d')]['fields']));_0x289812[_0x5d32('0x40')]=_0x289812['attributes']['length']?_0x289812[_0x5d32('0x40')]:_0x3433e3[_0x5d32('0x3f')];if(!_0xfb577a[_0x5d32('0x3d')][_0x5d32('0x42')](_0x5d32('0x43'))){_0x289812['limit']=qs[_0x5d32('0x2b')](_0xfb577a[_0x5d32('0x3d')][_0x5d32('0x2b')]);_0x289812[_0x5d32('0x28')]=qs[_0x5d32('0x28')](_0xfb577a['query'][_0x5d32('0x28')]);}_0x289812[_0x5d32('0x44')]=qs[_0x5d32('0x45')](_0xfb577a[_0x5d32('0x3d')][_0x5d32('0x45')]);_0x289812[_0x5d32('0x46')]=qs[_0x5d32('0x47')](_[_0x5d32('0x48')](_0xfb577a[_0x5d32('0x3d')],_0x3433e3[_0x5d32('0x47')]),_0x57494d);if(_0xfb577a['query'][_0x5d32('0x49')]){_0x289812[_0x5d32('0x46')]=_[_0x5d32('0x4a')](_0x289812[_0x5d32('0x46')],{'$or':_[_0x5d32('0x37')](_0x57494d,function(_0x50e587){if(_0x50e587[_0x5d32('0x4b')]!=='VIRTUAL'){var _0x952899={};_0x952899[_0x50e587['name']]={'$like':'%'+_0xfb577a[_0x5d32('0x3d')][_0x5d32('0x49')]+'%'};return _0x952899;}})});}_0x289812=_[_0x5d32('0x4a')]({},_0x289812,_0xfb577a[_0x5d32('0x4c')]);var _0x28bb6e={'where':_0x289812[_0x5d32('0x46')]};return db[_0x5d32('0x38')][_0x5d32('0x2a')](_0x28bb6e)[_0x5d32('0x1c')](function(_0x436b0b){_0x3d3960[_0x5d32('0x2a')]=_0x436b0b;if(_0xfb577a['query'][_0x5d32('0x4d')]){_0x289812[_0x5d32('0x4e')]=[{'all':!![]}];}return db['SmsAccount']['findAll'](_0x289812);})['then'](function(_0x48d583){_0x3d3960['rows']=_0x48d583;return _0x3d3960;})[_0x5d32('0x1c')](respondWithFilteredResult(_0x51099c,_0x289812))[_0x5d32('0x24')](handleError(_0x51099c,null));};exports['show']=function(_0x97a2fa,_0x1c53a5){var _0x15ff4f={'raw':![],'where':{'id':_0x97a2fa[_0x5d32('0x4f')]['id']},'include':[{'model':db[_0x5d32('0x36')],'as':_0x5d32('0x50')}]},_0x57e169={};_0x57e169[_0x5d32('0x3f')]=_[_0x5d32('0x3c')](db[_0x5d32('0x38')][_0x5d32('0x39')]);_0x57e169[_0x5d32('0x3d')]=_['keys'](_0x97a2fa['query']);_0x57e169[_0x5d32('0x47')]=_[_0x5d32('0x3e')](_0x57e169['model'],_0x57e169[_0x5d32('0x3d')]);_0x15ff4f[_0x5d32('0x40')]=_[_0x5d32('0x3e')](_0x57e169[_0x5d32('0x3f')],qs[_0x5d32('0x41')](_0x97a2fa['query'][_0x5d32('0x41')]));_0x15ff4f['attributes']=_0x15ff4f[_0x5d32('0x40')][_0x5d32('0x51')]?_0x15ff4f[_0x5d32('0x40')]:_0x57e169[_0x5d32('0x3f')];if(_0x97a2fa[_0x5d32('0x3d')][_0x5d32('0x4d')]){_0x15ff4f[_0x5d32('0x4e')]=[{'all':!![]}];}_0x15ff4f=_[_0x5d32('0x4a')]({},_0x15ff4f,_0x97a2fa[_0x5d32('0x4c')]);return db[_0x5d32('0x38')][_0x5d32('0x52')](_0x15ff4f)[_0x5d32('0x1c')](handleEntityNotFound(_0x1c53a5,null))[_0x5d32('0x1c')](respondWithResult(_0x1c53a5,null))[_0x5d32('0x24')](handleError(_0x1c53a5,null));};exports[_0x5d32('0x53')]=function(_0x31f614,_0x558b0f){return db[_0x5d32('0x38')]['create'](_0x31f614[_0x5d32('0x54')],{})[_0x5d32('0x1c')](function(_0x37a2e1){var _0xc8a49b=_0x31f614['user'][_0x5d32('0x31')]({'plain':!![]});if(!_0xc8a49b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xc8a49b[_0x5d32('0x55')]===_0x5d32('0x56')){var _0x4017af=_0x37a2e1[_0x5d32('0x31')]({'plain':!![]});var _0x592494='SmsAccounts';return db[_0x5d32('0x57')][_0x5d32('0x52')]({'where':{'name':_0x592494,'userProfileId':_0xc8a49b[_0x5d32('0x58')]},'raw':!![]})[_0x5d32('0x1c')](function(_0x5e3f1c){if(_0x5e3f1c&&_0x5e3f1c[_0x5d32('0x59')]===0x0){return db[_0x5d32('0x5a')][_0x5d32('0x53')]({'name':_0x4017af['name'],'resourceId':_0x4017af['id'],'type':_0x5e3f1c['name'],'sectionId':_0x5e3f1c['id']},{})[_0x5d32('0x1c')](function(){return _0x37a2e1;});}else{return _0x37a2e1;}})[_0x5d32('0x24')](function(_0x6fd029){logger['error'](_0x5d32('0x5b'),_0x6fd029);throw _0x6fd029;});}return _0x37a2e1;})[_0x5d32('0x1c')](respondWithResult(_0x558b0f,0xc9))[_0x5d32('0x24')](handleError(_0x558b0f,null));};exports[_0x5d32('0x5c')]=function(_0x1965a7,_0x563f50){if(_0x1965a7['body']['id']){delete _0x1965a7[_0x5d32('0x54')]['id'];}return db[_0x5d32('0x38')][_0x5d32('0x52')]({'where':{'id':_0x1965a7['params']['id']},'include':[{'model':db[_0x5d32('0x36')],'as':_0x5d32('0x50')}]})[_0x5d32('0x1c')](handleEntityNotFound(_0x563f50,null))[_0x5d32('0x1c')](saveUpdates(_0x1965a7[_0x5d32('0x54')],null))[_0x5d32('0x1c')](respondWithResult(_0x563f50,null))['catch'](handleError(_0x563f50,null));};exports['destroy']=function(_0x524720,_0xa9ae12){return db[_0x5d32('0x38')][_0x5d32('0x52')]({'where':{'id':_0x524720[_0x5d32('0x4f')]['id']}})['then'](handleEntityNotFound(_0xa9ae12,null))[_0x5d32('0x1c')](removeEntity(_0xa9ae12,null))[_0x5d32('0x24')](handleError(_0xa9ae12,null));};exports['describe']=function(_0x482a01,_0x578d87){return db[_0x5d32('0x38')][_0x5d32('0x5d')]()[_0x5d32('0x1c')](respondWithResult(_0x578d87,null))[_0x5d32('0x24')](handleError(_0x578d87,null));};exports[_0x5d32('0x5e')]=function(_0x25d080,_0x5acb37,_0xe2092){if(_0x25d080[_0x5d32('0x54')]['id']){delete _0x25d080[_0x5d32('0x54')]['id'];}return db[_0x5d32('0x38')][_0x5d32('0x52')]({'where':{'id':_0x25d080[_0x5d32('0x4f')]['id']}})['then'](handleEntityNotFound(_0x5acb37,null))[_0x5d32('0x1c')](function(_0x2fedb8){if(_0x2fedb8){_0x25d080[_0x5d32('0x54')][_0x5d32('0x5f')]=_0x2fedb8['id'];return db[_0x5d32('0x60')][_0x5d32('0x53')](_0x25d080['body']);}})['then'](respondWithResult(_0x5acb37,null))[_0x5d32('0x24')](handleError(_0x5acb37,null));};exports['getDispositions']=function(_0x4e4acd,_0x4abaeb,_0x3e8fab){var _0x6c01c6={'raw':![],'where':{}};var _0x1669ff={};var _0x2fac4a={'count':0x0,'rows':[]};return db['SmsAccount']['findOne']({'where':{'id':_0x4e4acd[_0x5d32('0x4f')]['id']}})[_0x5d32('0x1c')](handleEntityNotFound(_0x4abaeb,null))[_0x5d32('0x1c')](function(_0x1b106f){if(_0x1b106f){_0x1669ff[_0x5d32('0x3f')]=_[_0x5d32('0x3c')](db['Disposition'][_0x5d32('0x39')]);_0x1669ff[_0x5d32('0x3d')]=_[_0x5d32('0x3c')](_0x4e4acd[_0x5d32('0x3d')]);_0x1669ff['filters']=_[_0x5d32('0x3e')](_0x1669ff['model'],_0x1669ff[_0x5d32('0x3d')]);_0x6c01c6[_0x5d32('0x40')]=_[_0x5d32('0x3e')](_0x1669ff[_0x5d32('0x3f')],qs[_0x5d32('0x41')](_0x4e4acd[_0x5d32('0x3d')]['fields']));_0x6c01c6[_0x5d32('0x40')]=_0x6c01c6[_0x5d32('0x40')][_0x5d32('0x51')]?_0x6c01c6[_0x5d32('0x40')]:_0x1669ff[_0x5d32('0x3f')];if(!_0x4e4acd[_0x5d32('0x3d')][_0x5d32('0x42')]('nolimit')){_0x6c01c6[_0x5d32('0x2b')]=qs['limit'](_0x4e4acd['query'][_0x5d32('0x2b')]);_0x6c01c6[_0x5d32('0x28')]=qs[_0x5d32('0x28')](_0x4e4acd['query'][_0x5d32('0x28')]);}_0x6c01c6[_0x5d32('0x44')]=qs['sort'](_0x4e4acd[_0x5d32('0x3d')][_0x5d32('0x45')]);_0x6c01c6[_0x5d32('0x46')]=qs[_0x5d32('0x47')](_[_0x5d32('0x48')](_0x4e4acd[_0x5d32('0x3d')],_0x1669ff[_0x5d32('0x47')]));_0x6c01c6[_0x5d32('0x46')][_0x5d32('0x5f')]=_0x1b106f['id'];if(_0x4e4acd['query']['filter']){_0x6c01c6[_0x5d32('0x46')]=_[_0x5d32('0x4a')](_0x6c01c6[_0x5d32('0x46')],{'$or':_[_0x5d32('0x37')](_0x6c01c6['attributes'],function(_0x3ab218){var _0x49a412={};_0x49a412[_0x3ab218]={'$like':'%'+_0x4e4acd[_0x5d32('0x3d')][_0x5d32('0x49')]+'%'};return _0x49a412;})});}_0x6c01c6=_[_0x5d32('0x4a')]({},_0x6c01c6,_0x4e4acd[_0x5d32('0x4c')]);return db[_0x5d32('0x60')]['count']({'where':_0x6c01c6[_0x5d32('0x46')]})[_0x5d32('0x1c')](function(_0x57474b){_0x2fac4a[_0x5d32('0x2a')]=_0x57474b;if(_0x4e4acd[_0x5d32('0x3d')][_0x5d32('0x4d')]){_0x6c01c6[_0x5d32('0x4e')]=[{'all':!![]}];}return db[_0x5d32('0x60')][_0x5d32('0x61')](_0x6c01c6);})[_0x5d32('0x1c')](function(_0x314f1b){_0x2fac4a[_0x5d32('0x62')]=_0x314f1b;return _0x2fac4a;});}})['then'](respondWithFilteredResult(_0x4abaeb,_0x6c01c6))[_0x5d32('0x24')](handleError(_0x4abaeb,null));};exports['removeDispositions']=function(_0x5c4842,_0x5127b9,_0x499a85){return db[_0x5d32('0x38')][_0x5d32('0x52')]({'where':{'id':_0x5c4842['params']['id']}})[_0x5d32('0x1c')](handleEntityNotFound(_0x5127b9,null))[_0x5d32('0x1c')](function(_0x1c1655){if(_0x1c1655){return _0x1c1655[_0x5d32('0x63')](_0x5c4842[_0x5d32('0x3d')][_0x5d32('0x64')]);}})[_0x5d32('0x1c')](respondWithStatusCode(_0x5127b9,null))[_0x5d32('0x24')](handleError(_0x5127b9,null));};exports[_0x5d32('0x65')]=function(_0x2d9c5e,_0x40a3c8,_0x18c2a1){if(_0x2d9c5e[_0x5d32('0x54')]['id']){delete _0x2d9c5e[_0x5d32('0x54')]['id'];}return db[_0x5d32('0x38')][_0x5d32('0x52')]({'where':{'id':_0x2d9c5e[_0x5d32('0x4f')]['id']}})['then'](handleEntityNotFound(_0x40a3c8,null))[_0x5d32('0x1c')](function(_0x313f10){if(_0x313f10){_0x2d9c5e['body'][_0x5d32('0x5f')]=_0x313f10['id'];return db['CannedAnswer']['create'](_0x2d9c5e['body']);}})[_0x5d32('0x1c')](respondWithResult(_0x40a3c8,null))[_0x5d32('0x24')](handleError(_0x40a3c8,null));};exports[_0x5d32('0x66')]=function(_0xba9d35,_0x18ea67,_0x52880d){var _0x122189={'raw':![],'where':{}};var _0x83ff6b={};var _0x2860ea={'count':0x0,'rows':[]};return db['SmsAccount']['findOne']({'where':{'id':_0xba9d35[_0x5d32('0x4f')]['id']}})['then'](handleEntityNotFound(_0x18ea67,null))['then'](function(_0x4fe2c0){if(_0x4fe2c0){_0x83ff6b['model']=_['keys'](db[_0x5d32('0x67')]['rawAttributes']);_0x83ff6b['query']=_['keys'](_0xba9d35[_0x5d32('0x3d')]);_0x83ff6b[_0x5d32('0x47')]=_[_0x5d32('0x3e')](_0x83ff6b['model'],_0x83ff6b[_0x5d32('0x3d')]);_0x122189['attributes']=_[_0x5d32('0x3e')](_0x83ff6b[_0x5d32('0x3f')],qs[_0x5d32('0x41')](_0xba9d35[_0x5d32('0x3d')]['fields']));_0x122189[_0x5d32('0x40')]=_0x122189['attributes'][_0x5d32('0x51')]?_0x122189[_0x5d32('0x40')]:_0x83ff6b[_0x5d32('0x3f')];if(!_0xba9d35[_0x5d32('0x3d')][_0x5d32('0x42')](_0x5d32('0x43'))){_0x122189['limit']=qs[_0x5d32('0x2b')](_0xba9d35[_0x5d32('0x3d')][_0x5d32('0x2b')]);_0x122189['offset']=qs['offset'](_0xba9d35[_0x5d32('0x3d')][_0x5d32('0x28')]);}_0x122189[_0x5d32('0x44')]=qs[_0x5d32('0x45')](_0xba9d35[_0x5d32('0x3d')]['sort']);_0x122189[_0x5d32('0x46')]=qs[_0x5d32('0x47')](_['pick'](_0xba9d35[_0x5d32('0x3d')],_0x83ff6b[_0x5d32('0x47')]));_0x122189[_0x5d32('0x46')]['SmsAccountId']=_0x4fe2c0['id'];if(_0xba9d35[_0x5d32('0x3d')][_0x5d32('0x49')]){_0x122189[_0x5d32('0x46')]=_['merge'](_0x122189[_0x5d32('0x46')],{'$or':_[_0x5d32('0x37')](_0x122189[_0x5d32('0x40')],function(_0x5cf8cc){var _0x4d5533={};_0x4d5533[_0x5cf8cc]={'$like':'%'+_0xba9d35[_0x5d32('0x3d')][_0x5d32('0x49')]+'%'};return _0x4d5533;})});}_0x122189=_['merge']({},_0x122189,_0xba9d35[_0x5d32('0x4c')]);return db[_0x5d32('0x67')]['count']({'where':_0x122189[_0x5d32('0x46')]})[_0x5d32('0x1c')](function(_0x3ef992){_0x2860ea[_0x5d32('0x2a')]=_0x3ef992;if(_0xba9d35[_0x5d32('0x3d')][_0x5d32('0x4d')]){_0x122189[_0x5d32('0x4e')]=[{'all':!![]}];}return db[_0x5d32('0x67')][_0x5d32('0x61')](_0x122189);})[_0x5d32('0x1c')](function(_0x235940){_0x2860ea[_0x5d32('0x62')]=_0x235940;return _0x2860ea;});}})[_0x5d32('0x1c')](respondWithFilteredResult(_0x18ea67,_0x122189))[_0x5d32('0x24')](handleError(_0x18ea67,null));};exports[_0x5d32('0x68')]=function(_0x1aee55,_0x39f5fa,_0x1fb21f){return db[_0x5d32('0x38')][_0x5d32('0x52')]({'where':{'id':_0x1aee55[_0x5d32('0x4f')]['id']}})['then'](handleEntityNotFound(_0x39f5fa,null))['then'](function(_0x5b956d){if(_0x5b956d){return _0x5b956d['removeAnswers'](_0x1aee55[_0x5d32('0x3d')][_0x5d32('0x64')]);}})['then'](respondWithStatusCode(_0x39f5fa,null))['catch'](handleError(_0x39f5fa,null));};exports['notify']=function(_0x153993,_0x185180,_0xab5090){var _0x48e0d9={'channel':_0x5d32('0x69')};var _0x259f18=[];var _0x25a98f=[];var _0x20afc7={};return db[_0x5d32('0x38')][_0x5d32('0x52')]({'where':{'id':_0x153993[_0x5d32('0x4f')]['id']},'include':[{'model':db['SmsApplication'],'as':_0x5d32('0x6a')}]})[_0x5d32('0x1c')](handleEntityNotFound(_0x185180,null))[_0x5d32('0x1c')](function(_0x5c5e14){_0x48e0d9['account']=_0x5c5e14;_0x48e0d9[_0x5d32('0x6b')]=_[_0x5d32('0x6c')](_0x5c5e14['Applications'],['priority'],['asc']);if(_0x48e0d9[_0x5d32('0x6d')][_0x5d32('0x6a')]){delete _0x48e0d9[_0x5d32('0x6d')][_0x5d32('0x6a')];}return db[_0x5d32('0x6e')][_0x5d32('0x5d')]();})[_0x5d32('0x1c')](function(_0x267662){if(!_0x267662){throw new db['Sequelize']['ValidationError'](_0x5d32('0x6f'));}_0x259f18=_[_0x5d32('0x70')](_['keys'](_0x267662),['createdAt','updatedAt']);_0x25a98f=_[_0x5d32('0x70')](_[_0x5d32('0x3c')](_0x267662),[_0x5d32('0x71'),_0x5d32('0x72'),_0x5d32('0x73'),_0x5d32('0x74')]);_0x48e0d9['body']={'mapKey':_0x5d32('0x75')};if(_0x48e0d9[_0x5d32('0x6d')][_0x5d32('0x4b')]){switch(_0x48e0d9['account'][_0x5d32('0x4b')]){case _0x5d32('0x76'):_0x48e0d9[_0x5d32('0x54')][_0x5d32('0x77')]=_0x153993[_0x5d32('0x54')]['From'];_0x48e0d9['body'][_0x5d32('0x54')]=_0x153993[_0x5d32('0x54')][_0x5d32('0x78')];_0x48e0d9['body'][_0x5d32('0x79')]=_0x153993['body'][_0x5d32('0x7a')];break;case _0x5d32('0x7b'):_0x48e0d9[_0x5d32('0x54')][_0x5d32('0x77')]='+'+_0x153993[_0x5d32('0x54')]['sender'];_0x48e0d9['body'][_0x5d32('0x54')]=_0x153993[_0x5d32('0x54')]['text'];break;case _0x5d32('0x7c'):_0x48e0d9[_0x5d32('0x54')][_0x5d32('0x77')]=_0x153993['body']['from'];_0x48e0d9[_0x5d32('0x54')]['body']=_0x153993[_0x5d32('0x54')]['message'];break;case _0x5d32('0x7d'):_0x48e0d9[_0x5d32('0x54')][_0x5d32('0x77')]=_0x153993[_0x5d32('0x54')]['from'];_0x48e0d9[_0x5d32('0x54')][_0x5d32('0x54')]=_0x153993[_0x5d32('0x54')][_0x5d32('0x54')];_0x48e0d9[_0x5d32('0x54')][_0x5d32('0x79')]=_0x153993[_0x5d32('0x54')][_0x5d32('0x7e')];break;case _0x5d32('0x7f'):_0x48e0d9['body'][_0x5d32('0x77')]=_0x153993[_0x5d32('0x54')][_0x5d32('0x80')];_0x48e0d9[_0x5d32('0x54')][_0x5d32('0x54')]=_0x153993['body'][_0x5d32('0x81')];_0x48e0d9[_0x5d32('0x54')][_0x5d32('0x79')]=_0x153993[_0x5d32('0x54')][_0x5d32('0x82')];break;case _0x5d32('0x83'):_0x48e0d9[_0x5d32('0x54')]['from']='+'+_0x153993[_0x5d32('0x54')]['results'][0x0][_0x5d32('0x77')];_0x48e0d9[_0x5d32('0x54')][_0x5d32('0x54')]=_0x153993[_0x5d32('0x54')][_0x5d32('0x84')][0x0]['text'];_0x48e0d9[_0x5d32('0x54')][_0x5d32('0x79')]=_0x153993[_0x5d32('0x54')]['results'][0x0][_0x5d32('0x79')];break;case'csc':_0x48e0d9[_0x5d32('0x54')][_0x5d32('0x77')]=_0x153993[_0x5d32('0x54')][_0x5d32('0x85')];_0x48e0d9[_0x5d32('0x54')][_0x5d32('0x54')]=_0x153993[_0x5d32('0x54')]['segmentedMessage']['message'];break;case _0x5d32('0x86'):_0x48e0d9[_0x5d32('0x54')][_0x5d32('0x77')]=_0x153993[_0x5d32('0x54')][_0x5d32('0x87')];_0x48e0d9[_0x5d32('0x54')][_0x5d32('0x54')]=_0x153993['body']['text'];_0x48e0d9[_0x5d32('0x54')][_0x5d32('0x79')]=_0x153993[_0x5d32('0x54')][_0x5d32('0x88')];break;case _0x5d32('0x89'):_0x48e0d9['body'][_0x5d32('0x79')]=_0x153993[_0x5d32('0x54')][0x0][_0x5d32('0x23')]['id'];_0x48e0d9[_0x5d32('0x54')][_0x5d32('0x77')]=_0x153993[_0x5d32('0x54')][0x0][_0x5d32('0x23')][_0x5d32('0x77')];_0x48e0d9[_0x5d32('0x54')]['body']=_0x153993['body'][0x0][_0x5d32('0x23')][_0x5d32('0x8a')];break;case _0x5d32('0x8b'):_0x48e0d9['body']['from']=_0x153993[_0x5d32('0x54')]['from'];_0x48e0d9[_0x5d32('0x54')][_0x5d32('0x54')]=_0x153993[_0x5d32('0x54')][_0x5d32('0x23')];_0x48e0d9['body'][_0x5d32('0x79')]=_0x153993['body']['refid'];break;}}if(_0x48e0d9['body']['id']){delete _0x48e0d9['body']['id'];}if(_[_0x5d32('0x8c')](_0x48e0d9[_0x5d32('0x54')][_0x5d32('0x77')])){throw new db[(_0x5d32('0x8d'))][(_0x5d32('0x8e'))]('from\x20is\x20mandatory');}if(_['isNil'](_0x48e0d9[_0x5d32('0x54')][_0x5d32('0x54')])||_0x48e0d9[_0x5d32('0x54')][_0x5d32('0x54')]===''){throw new db[(_0x5d32('0x8d'))]['ValidationError'](_0x5d32('0x8f'));}if(_[_0x5d32('0x8c')](_0x48e0d9[_0x5d32('0x54')][_0x5d32('0x90')])){throw new db[(_0x5d32('0x8d'))][(_0x5d32('0x8e'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x25a98f);}if(!_[_0x5d32('0x91')](_0x25a98f,_0x48e0d9[_0x5d32('0x54')][_0x5d32('0x90')])){throw new db[(_0x5d32('0x8d'))]['ValidationError'](_0x5d32('0x92')+_0x25a98f);}_0x20afc7[_0x48e0d9['body'][_0x5d32('0x90')]]=_0x48e0d9['body'][_0x5d32('0x77')];return db[_0x5d32('0x93')][_0x5d32('0x52')]({'where':{'id':_0x48e0d9[_0x5d32('0x6d')][_0x5d32('0x74')]},'include':[{'model':db[_0x5d32('0x6e')],'as':_0x5d32('0x94'),'where':_0x20afc7,'limit':0x1,'order':[[_0x5d32('0x72'),_0x5d32('0x95')]]}]});})[_0x5d32('0x1c')](handleEntityNotFound(_0x185180,null))[_0x5d32('0x1c')](function(_0x314e6c){if(_0x314e6c){_0x48e0d9['list']=_[_0x5d32('0x96')](_0x314e6c,['Contacts']);if(_0x314e6c[_0x5d32('0x94')][_0x5d32('0x51')]){return _0x314e6c[_0x5d32('0x94')][0x0];}var _0x76dddf=_[_0x5d32('0x16')](_0x48e0d9[_0x5d32('0x54')],{'firstName':_0x48e0d9['body'][_0x5d32('0x77')],'ListId':_0x314e6c['id']});_0x76dddf[_0x48e0d9[_0x5d32('0x54')]['mapKey']]=_0x48e0d9[_0x5d32('0x54')]['from'];return db[_0x5d32('0x6e')][_0x5d32('0x53')](_0x76dddf,{'fields':_0x259f18,'raw':!![]});}})[_0x5d32('0x1c')](handleEntityNotFound(_0x185180,null))[_0x5d32('0x1c')](function(_0x4b97d1){if(_0x4b97d1){_0x48e0d9['contact']=_0x4b97d1;var _0x23f96a={'ContactId':_0x4b97d1['id'],'phone':_0x48e0d9[_0x5d32('0x54')][_0x5d32('0x77')],'SmsAccountId':_0x153993['params']['id']};var _0x2fbde4={'ContactId':_0x4b97d1['id'],'SmsAccountId':_0x153993['params']['id'],'closed':![]};return db[_0x5d32('0x97')][_0x5d32('0x52')]({'where':_0x2fbde4})[_0x5d32('0x1c')](function(_0x403aa2){if(_0x403aa2){return[_0x403aa2,![]];}return db[_0x5d32('0x97')][_0x5d32('0x53')](_0x23f96a)[_0x5d32('0x1c')](function(_0x471734){return[_0x471734,!![]];});});}})['spread'](function(_0x27ceda,_0x563e4f){_0x48e0d9['interaction']=_0x27ceda[_0x5d32('0x31')]({'plain':!![]});_0x48e0d9['interaction'][_0x5d32('0x98')]=![];if(_0x563e4f){if(_0x48e0d9[_0x5d32('0x6d')][_0x5d32('0x99')]){_0x48e0d9[_0x5d32('0x6b')][_0x5d32('0x9a')]({'id':0x0,'priority':_0x48e0d9['applications'][_0x5d32('0x51')]+0x1,'app':_0x5d32('0x9b'),'appdata':_0x5d32('0x9c'),'interval':_0x5d32('0x9d')});}_0x48e0d9[_0x5d32('0x9e')][_0x5d32('0x98')]=!![];}return db['SmsMessage'][_0x5d32('0x53')]({'phone':_0x48e0d9[_0x5d32('0x54')]['from'],'messageId':_0x48e0d9[_0x5d32('0x54')][_0x5d32('0x79')],'body':_0x48e0d9[_0x5d32('0x54')][_0x5d32('0x54')],'SmsAccountId':_0x153993[_0x5d32('0x4f')]['id'],'SmsInteractionId':_0x27ceda['id'],'direction':'in','ContactId':_0x27ceda[_0x5d32('0x9f')],'AttachmentId':_0x48e0d9[_0x5d32('0x54')][_0x5d32('0xa0')]});})[_0x5d32('0x1c')](function(_0x5472a4){_0x48e0d9[_0x5d32('0x23')]=_0x5472a4;if(!_0x48e0d9[_0x5d32('0x9e')]['UserId'])return;return db[_0x5d32('0xa1')][_0x5d32('0x52')]({'attributes':['id','name'],'where':{'id':_0x48e0d9['interaction'][_0x5d32('0xa2')]}});})[_0x5d32('0x1c')](function(_0x1f566e){if(_0x1f566e){_0x48e0d9[_0x5d32('0x6b')]['unshift']({'id':0x0,'priority':0x0,'app':_0x5d32('0xa3'),'appdata':_0x1f566e['name']+','+(_0x48e0d9[_0x5d32('0x6d')][_0x5d32('0xa4')]||0xa),'interval':_0x5d32('0x9d')});}if(!_0x48e0d9[_0x5d32('0x9e')][_0x5d32('0xa5')])return;return db[_0x5d32('0xa6')][_0x5d32('0x52')]({'attributes':['id',_0x5d32('0x33')],'where':{'id':_0x48e0d9[_0x5d32('0x9e')]['queueId']}});})['then'](function(_0x3c0464){if(_0x3c0464){_0x48e0d9['applications']['unshift']({'id':0x0,'priority':0x1,'app':_0x5d32('0xa7'),'appdata':_0x3c0464[_0x5d32('0x33')]+','+(_0x48e0d9[_0x5d32('0x6d')][_0x5d32('0xa8')]||0x12c),'interval':_0x5d32('0x9d')});}return respondWithRpcPromise(_0x5d32('0xa9'),_0x5d32('0xaa'),_0x48e0d9);})['then'](function(_0x1627eb){if(_0x1627eb){var _0x21eabe=0xc8;var _0x4dd266=_0x5d32('0xab');logger[_0x5d32('0x1d')](_0x5d32('0xac'),_0x4dd266,_0x21eabe,_0x5d32('0xad'));logger['debug'](_0x5d32('0xae'),_0x4dd266,_0x21eabe,_0x5d32('0xad'),JSON['stringify'](_0x1627eb));if(_0x48e0d9[_0x5d32('0x6d')][_0x5d32('0x4b')]===_0x5d32('0x76')){return _0x185180[_0x5d32('0x25')](_0x21eabe)[_0x5d32('0xaf')]('Content-Type',_0x5d32('0xb0'))[_0x5d32('0x34')](_0x5d32('0xb1'));}else{return _0x185180[_0x5d32('0x25')](_0x21eabe)[_0x5d32('0x27')](_0x1627eb);}}})[_0x5d32('0x24')](handleError(_0x185180,null));};exports[_0x5d32('0xb2')]=function(_0x33e698,_0x44ed38){var _0x355255=_0x33e698[_0x5d32('0x4f')]['id'];var _0x34f898=_0x33e698[_0x5d32('0x54')];var _0xbf38d7=0xc8;var _0x19fd26=null;return db[_0x5d32('0xb3')][_0x5d32('0xb4')]({'isolationLevel':db[_0x5d32('0xb3')][_0x5d32('0xb5')][_0x5d32('0xb6')]['READ_COMMITTED']},function(_0x1e6a08){return db['SmsAccount'][_0x5d32('0xb7')]({'where':{'id':_0x355255},'transaction':_0x1e6a08})[_0x5d32('0x1c')](function(_0xb320f8){if(_0xb320f8){return db[_0x5d32('0xb8')]['destroy']({'where':{'SmsAccountId':_0x355255},'transaction':_0x1e6a08})[_0x5d32('0x1c')](function(){var _0x3db4e6=_[_0x5d32('0x37')](_0x34f898,function(_0x268732){_0x268732[_0x5d32('0x5f')]=_0x355255;return _0x268732;});return db[_0x5d32('0xb8')][_0x5d32('0xb9')](_0x3db4e6,{'transaction':_0x1e6a08});});}else{_0xbf38d7=0x194;_0x19fd26=[];}});})[_0x5d32('0x1c')](function(){if(_0xbf38d7!==0x194){return db['SmsApplication'][_0x5d32('0xba')]({'where':{'SmsAccountId':_0x355255},'order':_0x5d32('0xbb')})[_0x5d32('0x1c')](function(_0x377850){_0x19fd26=_0x377850;});}})[_0x5d32('0x24')](function(_0x2bae3e){_0xbf38d7=0x1f4;logger[_0x5d32('0x21')](_0x2bae3e[_0x5d32('0xbc')]);if(_0x2bae3e[_0x5d32('0x33')]){delete _0x2bae3e[_0x5d32('0x33')];}_0x19fd26=_0x2bae3e;})[_0x5d32('0xbd')](function(){if(_0x19fd26===null){_0x44ed38[_0x5d32('0xbe')](_0xbf38d7);}else{if(_0xbf38d7===0x1f4){_0x44ed38[_0x5d32('0x25')](_0xbf38d7)['send'](_0x19fd26);}else{_0x44ed38['status'](_0xbf38d7)[_0x5d32('0x27')](_0x19fd26);}}});};exports['getApplications']=function(_0x54bdd3,_0x23a5e5,_0x2f73ca){var _0x5f1627={};var _0x341bee={};var _0x30f56c;var _0x540a22;return db[_0x5d32('0x38')]['findOne']({'where':{'id':_0x54bdd3[_0x5d32('0x4f')]['id']}})[_0x5d32('0x1c')](handleEntityNotFound(_0x23a5e5,null))[_0x5d32('0x1c')](function(_0x39ecff){if(_0x39ecff){_0x30f56c=_0x39ecff;_0x341bee[_0x5d32('0x3f')]=_[_0x5d32('0x3c')](db[_0x5d32('0xb8')][_0x5d32('0x39')]);_0x341bee[_0x5d32('0x3d')]=_[_0x5d32('0x3c')](_0x54bdd3[_0x5d32('0x3d')]);_0x341bee[_0x5d32('0x47')]=_[_0x5d32('0x3e')](_0x341bee['model'],_0x341bee[_0x5d32('0x3d')]);_0x5f1627[_0x5d32('0x40')]=_[_0x5d32('0x3e')](_0x341bee['model'],qs['fields'](_0x54bdd3[_0x5d32('0x3d')][_0x5d32('0x41')]));_0x5f1627[_0x5d32('0x40')]=_0x5f1627[_0x5d32('0x40')][_0x5d32('0x51')]?_0x5f1627[_0x5d32('0x40')]:_0x341bee[_0x5d32('0x3f')];_0x5f1627[_0x5d32('0x44')]=qs['sort'](_0x54bdd3[_0x5d32('0x3d')][_0x5d32('0x45')]);_0x5f1627[_0x5d32('0x46')]=qs['filters'](_[_0x5d32('0x48')](_0x54bdd3[_0x5d32('0x3d')],_0x341bee['filters']));if(_0x54bdd3[_0x5d32('0x3d')]['filter']){_0x5f1627[_0x5d32('0x46')]=_[_0x5d32('0x4a')](_0x5f1627[_0x5d32('0x46')],{'$or':_[_0x5d32('0x37')](_0x5f1627[_0x5d32('0x40')],function(_0xaf9826){var _0x46d04f={};_0x46d04f[_0xaf9826]={'$like':'%'+_0x54bdd3[_0x5d32('0x3d')][_0x5d32('0x49')]+'%'};return _0x46d04f;})});}_0x5f1627=_['merge']({},_0x5f1627,_0x54bdd3[_0x5d32('0x4c')]);return _0x30f56c[_0x5d32('0xbf')](_0x5f1627);}})['then'](function(_0x498081){if(_0x498081){_0x540a22=_0x498081[_0x5d32('0x51')];if(!_0x54bdd3['query'][_0x5d32('0x42')](_0x5d32('0x43'))){_0x5f1627[_0x5d32('0x2b')]=qs[_0x5d32('0x2b')](_0x54bdd3[_0x5d32('0x3d')][_0x5d32('0x2b')]);_0x5f1627[_0x5d32('0x28')]=qs[_0x5d32('0x28')](_0x54bdd3[_0x5d32('0x3d')][_0x5d32('0x28')]);}return _0x30f56c[_0x5d32('0xbf')](_0x5f1627);}})[_0x5d32('0x1c')](function(_0x554407){if(_0x554407){return _0x554407?{'count':_0x540a22,'rows':_0x554407}:null;}})[_0x5d32('0x1c')](respondWithResult(_0x23a5e5,null))[_0x5d32('0x24')](handleError(_0x23a5e5,null));};exports[_0x5d32('0xc0')]=function(_0x263b2c,_0x2bee42,_0x33ff7c){var _0x1c0eda={'raw':![],'where':{}};var _0x35a052={};var _0x1cc77b={'count':0x0,'rows':[]};return db[_0x5d32('0x38')]['findOne']({'where':{'id':_0x263b2c[_0x5d32('0x4f')]['id']}})[_0x5d32('0x1c')](handleEntityNotFound(_0x2bee42,null))['then'](function(_0x4137b2){if(_0x4137b2){_0x35a052[_0x5d32('0x3f')]=_['keys'](db[_0x5d32('0x97')]['rawAttributes']);_0x35a052['query']=_['keys'](_0x263b2c['query']);_0x35a052[_0x5d32('0x47')]=_['intersection'](_0x35a052[_0x5d32('0x3f')],_0x35a052[_0x5d32('0x3d')]);_0x1c0eda[_0x5d32('0x40')]=_[_0x5d32('0x3e')](_0x35a052[_0x5d32('0x3f')],qs[_0x5d32('0x41')](_0x263b2c[_0x5d32('0x3d')]['fields']));_0x1c0eda[_0x5d32('0x40')]=_0x1c0eda[_0x5d32('0x40')][_0x5d32('0x51')]?_0x1c0eda['attributes']:_0x35a052[_0x5d32('0x3f')];if(!_0x263b2c[_0x5d32('0x3d')]['hasOwnProperty'](_0x5d32('0x43'))){_0x1c0eda[_0x5d32('0x2b')]=qs[_0x5d32('0x2b')](_0x263b2c[_0x5d32('0x3d')][_0x5d32('0x2b')]);_0x1c0eda[_0x5d32('0x28')]=qs['offset'](_0x263b2c[_0x5d32('0x3d')][_0x5d32('0x28')]);}_0x1c0eda[_0x5d32('0x44')]=qs[_0x5d32('0x45')](_0x263b2c[_0x5d32('0x3d')]['sort']);_0x1c0eda[_0x5d32('0x46')]=qs['filters'](_[_0x5d32('0x48')](_0x263b2c[_0x5d32('0x3d')],_0x35a052[_0x5d32('0x47')]));_0x1c0eda[_0x5d32('0x46')]['SmsAccountId']=_0x4137b2['id'];if(_0x263b2c['query'][_0x5d32('0x49')]){_0x1c0eda[_0x5d32('0x46')]=_['merge'](_0x1c0eda['where'],{'$or':_[_0x5d32('0x37')](_0x1c0eda['attributes'],function(_0x15038e){var _0x3be936={};_0x3be936[_0x15038e]={'$like':'%'+_0x263b2c[_0x5d32('0x3d')]['filter']+'%'};return _0x3be936;})});}_0x1c0eda=_['merge']({},_0x1c0eda,_0x263b2c['options']);return db['SmsInteraction']['count']({'where':_0x1c0eda[_0x5d32('0x46')]})[_0x5d32('0x1c')](function(_0x4f3ed0){_0x1cc77b['count']=_0x4f3ed0;if(_0x263b2c[_0x5d32('0x3d')][_0x5d32('0x4d')]){_0x1c0eda[_0x5d32('0x4e')]=[{'model':db[_0x5d32('0x6e')],'as':'Contact','required':![]},{'model':db['User'],'as':'Owner','attributes':[_0x5d32('0x33'),_0x5d32('0xc1'),_0x5d32('0xc2')],'required':![]},{'model':db[_0x5d32('0xc3')],'as':'Tags','attributes':['id',_0x5d32('0x33'),_0x5d32('0xc4')],'where':_0x263b2c[_0x5d32('0x3d')][_0x5d32('0xc5')]?{'id':_0x263b2c[_0x5d32('0x3d')]['tag']}:undefined,'required':_0x263b2c['query'][_0x5d32('0xc5')]?!![]:![]}];}return db[_0x5d32('0x97')]['findAll'](_0x1c0eda);})[_0x5d32('0x1c')](function(_0x2ac5fb){_0x1cc77b['rows']=_0x2ac5fb;return _0x1cc77b;});}})['then'](respondWithFilteredResult(_0x2bee42,_0x1c0eda))[_0x5d32('0x24')](handleError(_0x2bee42,null));};exports[_0x5d32('0x34')]=function(_0xbb4298,_0x21057c,_0x71c4a0){var _0x593c5a,_0x22e565,_0x395f9f;if(_['isNil'](_0xbb4298[_0x5d32('0x54')][_0x5d32('0x54')])||_0xbb4298['body'][_0x5d32('0x54')]===''){throw new db[(_0x5d32('0x8d'))][(_0x5d32('0x8e'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x5d32('0x8c')](_0xbb4298['body']['to'])){throw new db[(_0x5d32('0x8d'))][(_0x5d32('0x8e'))]('to\x20is\x20mandatory');}_0x593c5a=_0xbb4298[_0x5d32('0x54')]['to'];return db[_0x5d32('0x38')][_0x5d32('0x52')]({'where':{'id':_0xbb4298[_0x5d32('0x4f')]['id']},'include':[{'model':db[_0x5d32('0x93')],'as':'List','include':[{'model':db[_0x5d32('0x6e')],'as':_0x5d32('0x94'),'where':{'mobile':_0x593c5a},'limit':0x1,'order':[[_0x5d32('0x72'),_0x5d32('0x95')]]}]}]})[_0x5d32('0x1c')](handleEntityNotFound(_0x21057c,null))[_0x5d32('0x1c')](function(_0x393d17){if(_0x393d17&&_0x393d17[_0x5d32('0xc6')]){_0x22e565=_0x393d17['get']({'plain':!![]});if(_0x22e565[_0x5d32('0xc6')]&&_0x22e565['List'][_0x5d32('0x94')]['length']){return _0x22e565[_0x5d32('0xc6')]['Contacts'][0x0];}return db[_0x5d32('0x6e')][_0x5d32('0x53')](_['defaults'](_0xbb4298[_0x5d32('0x54')],{'firstName':_0x593c5a,'mobile':_0x593c5a,'phone':_0x593c5a,'ListId':_0x22e565[_0x5d32('0x74')]}));}})[_0x5d32('0x1c')](handleEntityNotFound(_0x21057c,null))[_0x5d32('0x1c')](function(_0x39d991){if(_0x39d991){_0x395f9f=_0x39d991;return db['SmsInteraction'][_0x5d32('0x52')]({'where':{'ContactId':_0x395f9f['id'],'closed':![],'SmsAccountId':_0x22e565['id']}})[_0x5d32('0x1c')](function(_0x2c7a61){if(_0x2c7a61){return[_0x2c7a61,![]];}return db['SmsInteraction'][_0x5d32('0x53')]({'UserId':_0xbb4298[_0x5d32('0x56')]['id'],'ContactId':_0x395f9f['id'],'SmsAccountId':_0x22e565['id'],'phone':_0x593c5a,'firstMsgDirection':_0x5d32('0xc7'),'Messages':[_[_0x5d32('0x4a')](_0xbb4298[_0x5d32('0x54')],{'read':![],'body':_0xbb4298[_0x5d32('0x54')][_0x5d32('0x54')],'phone':_0x593c5a,'SmsAccountId':_0x22e565['id'],'UserId':_0xbb4298[_0x5d32('0x56')]['id'],'ContactId':_0x395f9f['id']})]},{'include':[{'model':db['SmsMessage'],'as':_0x5d32('0xc8')}]})[_0x5d32('0x1c')](function(_0x6b140f){return[_0x6b140f,!![]];});});}})[_0x5d32('0xc9')](function(_0x42a1d1,_0x20f517){if(_0x20f517){return _0x42a1d1;}return db[_0x5d32('0xca')][_0x5d32('0x53')](_[_0x5d32('0x4a')](_0xbb4298[_0x5d32('0x54')],{'read':![],'body':_0xbb4298['body']['body'],'phone':_0x593c5a,'SmsAccountId':_0x22e565['id'],'SmsInteractionId':_0x42a1d1['id'],'UserId':_0xbb4298[_0x5d32('0x56')]['id'],'ContactId':_0x395f9f['id']}))[_0x5d32('0x1c')](function(_0x442201){_0x42a1d1[_0x5d32('0xcb')][_0x5d32('0xc8')]=[];_0x42a1d1['dataValues'][_0x5d32('0xc8')][_0x5d32('0x9a')](_0x442201['dataValues']);return _0x42a1d1;});})[_0x5d32('0x1c')](respondWithResult(_0x21057c,null))[_0x5d32('0x24')](handleError(_0x21057c,null));};exports[_0x5d32('0x25')]=function(_0x45f67f,_0x3f6def,_0x32484f){if(_0x45f67f[_0x5d32('0x54')]['id']){delete _0x45f67f[_0x5d32('0x54')]['id'];}var _0x56a9a0,_0x2fb92f,_0x5d4087;return db[_0x5d32('0x38')][_0x5d32('0x52')]({'where':{'id':_0x45f67f[_0x5d32('0x4f')]['id']}})[_0x5d32('0x1c')](handleEntityNotFound(_0x3f6def,null))[_0x5d32('0x1c')](function(_0x4932d3){if(_0x4932d3){_0x5d4087=_0x4932d3;logger[_0x5d32('0xcc')](_0x5d32('0xac'),_0x5d32('0x25'),_0x5d32('0xcd'),_0x4932d3[_0x5d32('0x4b')],util[_0x5d32('0xce')](_0x45f67f[_0x5d32('0x54')],{'showHidden':![],'depth':null}));switch(_0x4932d3[_0x5d32('0x4b')]){case _0x5d32('0x7b'):if(_0x45f67f[_0x5d32('0x54')]['skebby_dispatch_id']&&_0x45f67f['body'][_0x5d32('0x25')]){_0x2fb92f=_0x45f67f[_0x5d32('0x54')][_0x5d32('0x25')];return db[_0x5d32('0xca')][_0x5d32('0x52')]({'where':{'messageId':_0x45f67f[_0x5d32('0x54')][_0x5d32('0xcf')]}});}break;case _0x5d32('0x7c'):if(_0x45f67f[_0x5d32('0x54')][_0x5d32('0xd0')]&&_0x45f67f['body'][_0x5d32('0xd1')]){_0x2fb92f=_0x45f67f['body'][_0x5d32('0xd1')];return db[_0x5d32('0xca')][_0x5d32('0x52')]({'where':{'messageId':_0x45f67f[_0x5d32('0x54')][_0x5d32('0xd0')]}});}break;case _0x5d32('0x7d'):if(_0x45f67f[_0x5d32('0x54')]['message_id']&&_0x45f67f['body'][_0x5d32('0xd2')]){_0x2fb92f=_0x45f67f[_0x5d32('0x54')][_0x5d32('0xd2')];return db[_0x5d32('0xca')][_0x5d32('0x52')]({'where':{'messageId':_0x45f67f[_0x5d32('0x54')][_0x5d32('0x7e')]}});}break;case'infobip':var _0xc403be=_0x45f67f[_0x5d32('0x54')]['results'][0x0];if(_0xc403be[_0x5d32('0x79')]&&_0xc403be[_0x5d32('0x25')][_0x5d32('0xd3')]===_0x5d32('0xd4')){_0x2fb92f=_0xc403be[_0x5d32('0x25')][_0x5d32('0xd3')];return db[_0x5d32('0xca')][_0x5d32('0x52')]({'where':{'messageId':_0xc403be['messageId']}});}break;case _0x5d32('0x86'):if(_0x45f67f['body'][_0x5d32('0x79')]&&_0x45f67f[_0x5d32('0x54')]['status']){_0x2fb92f=_0x45f67f['body']['status'];return db[_0x5d32('0xca')]['find']({'where':{'messageId':_0x45f67f[_0x5d32('0x54')][_0x5d32('0x79')]}});}break;case _0x5d32('0x89'):if(_0x45f67f[_0x5d32('0x54')][0x0]['message']['id']){_0x2fb92f=_0x45f67f['body'][0x0][_0x5d32('0x4b')];return db['SmsMessage'][_0x5d32('0x52')]({'where':{'messageId':_0x45f67f[_0x5d32('0x54')][0x0]['message']['id']}});}break;case _0x5d32('0x8b'):if(_0x45f67f['body'][_0x5d32('0xd5')]&&_0x45f67f[_0x5d32('0x54')][_0x5d32('0x25')]){_0x2fb92f=_0x45f67f['body']['status'];return db[_0x5d32('0xca')][_0x5d32('0x52')]({'where':{'messageId':_0x45f67f['body']['redif']}});}break;}}})[_0x5d32('0x1c')](handleEntityNotFound(_0x3f6def,null))[_0x5d32('0x1c')](function(_0x4426a1){if(_0x4426a1){_0x56a9a0=_0x4426a1;switch(_0x5d4087[_0x5d32('0x4b')]){case _0x5d32('0x7b'):if(_0x2fb92f==='DELIVERED'){return _0x56a9a0[_0x5d32('0x5c')]({'read':!![]});}else{logger[_0x5d32('0x21')](_0x5d32('0xac'),_0x5d32('0x25'),_0x5d32('0x7b'),util[_0x5d32('0xce')](_0x45f67f['body'],{'showHidden':![],'depth':null}));}break;case _0x5d32('0x7c'):if(_0x2fb92f==='1'){return _0x56a9a0[_0x5d32('0x5c')]({'read':!![]});}else{logger[_0x5d32('0x21')](_0x5d32('0xac'),_0x5d32('0x25'),'skebby',util[_0x5d32('0xce')](_0x45f67f[_0x5d32('0x54')],{'showHidden':![],'depth':null}));}break;case _0x5d32('0x7d'):if(!_0x45f67f['body'][_0x5d32('0xd6')]&&_0x2fb92f>=0xc8&&_0x2fb92f<=0xce){return _0x56a9a0['update']({'read':!![]});}else{logger['error'](_0x5d32('0xac'),_0x5d32('0x25'),_0x5d32('0x7d'),util[_0x5d32('0xce')](_0x45f67f[_0x5d32('0x54')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x457cb0=_0x45f67f['body']['results'][0x0];if(_0x457cb0[_0x5d32('0x25')]['groupName']===_0x5d32('0xd4')){return _0x56a9a0[_0x5d32('0x5c')]({'read':!![]});}else{logger['error'](_0x5d32('0xac'),'status','infobip',util['inspect'](_0x45f67f['body'],{'showHidden':![],'depth':null}));}break;case _0x5d32('0x86'):if(_0x2fb92f=='DELIVERED_TO_GATEWAY'||_0x2fb92f==_0x5d32('0xd7')){return _0x56a9a0[_0x5d32('0x5c')]({'read':!![]});}else{logger[_0x5d32('0x21')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x5d32('0x25'),'clickatell',util[_0x5d32('0xce')](_0x45f67f[_0x5d32('0x54')],{'showHidden':![],'depth':null}));}break;case _0x5d32('0x89'):if(_0x2fb92f==_0x5d32('0xd8')){return _0x56a9a0[_0x5d32('0x5c')]({'read':!![]});}else{logger['error'](_0x5d32('0xac'),_0x5d32('0x25'),_0x5d32('0x89'),util[_0x5d32('0xce')](_0x45f67f[_0x5d32('0x54')],{'showHidden':![],'depth':null}));}break;case _0x5d32('0x8b'):if(_0x2fb92f===_0x5d32('0xd9')||_0x2fb92f===_0x5d32('0xda')){return _0x56a9a0[_0x5d32('0x5c')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x5d32('0x8b'),util['inspect'](_0x45f67f[_0x5d32('0x54')],{'showHidden':![],'depth':null}));}break;}return _0x56a9a0;}})['then'](respondWithResult(_0x3f6def,null))[_0x5d32('0x24')](handleError(_0x3f6def,null));};exports[_0x5d32('0xdb')]=function(_0x3f55ef,_0x5eb5ee,_0x502885){var _0x248671,_0x191a09,_0x3273f7;return db[_0x5d32('0x38')][_0x5d32('0x52')]({'where':{'id':_0x3f55ef[_0x5d32('0x4f')]['id']}})[_0x5d32('0x1c')](handleEntityNotFound(_0x5eb5ee,null))['then'](function(_0x24f492){if(_0x24f492){_0x3273f7=_0x24f492;logger[_0x5d32('0xcc')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x5d32('0xcd'),_0x24f492[_0x5d32('0x4b')],util[_0x5d32('0xce')](_0x3f55ef[_0x5d32('0x3d')],{'showHidden':![],'depth':null}));switch(_0x24f492[_0x5d32('0x4b')]){case _0x5d32('0xdc'):if(_0x3f55ef[_0x5d32('0x3d')]['message-id']&&_0x3f55ef[_0x5d32('0x3d')][_0x5d32('0xdd')]){_0x191a09=_0x3f55ef[_0x5d32('0x3d')]['state'];return db[_0x5d32('0xca')][_0x5d32('0x52')]({'where':{'messageId':_0x3f55ef[_0x5d32('0x3d')][_0x5d32('0xde')]}});}break;}}})[_0x5d32('0x1c')](handleEntityNotFound(_0x5eb5ee,null))[_0x5d32('0x1c')](function(_0x597d97){if(_0x597d97){_0x248671=_0x597d97;switch(_0x3273f7['type']){case'csc':if(_0x191a09==='2'||_0x191a09==='6'){return _0x248671[_0x5d32('0x5c')]({'read':!![]});}else{logger[_0x5d32('0x21')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x5d32('0xdc'),util[_0x5d32('0xce')](_0x3f55ef[_0x5d32('0x3d')],{'showHidden':![],'depth':null}));};break;}return _0x248671;}})['then'](respondWithResult(_0x5eb5ee,null))[_0x5d32('0x24')](handleError(_0x5eb5ee,null));};exports[_0x5d32('0xdf')]=function(_0x1a3de9,_0xb99668,_0x3397b0){return db[_0x5d32('0x38')]['find']({'where':{'id':_0x1a3de9[_0x5d32('0x4f')]['id']}})[_0x5d32('0x1c')](handleEntityNotFound(_0xb99668,null))[_0x5d32('0x1c')](function(_0x373df4){if(_0x373df4){return _0x373df4['addAgents'](_0x1a3de9[_0x5d32('0x54')][_0x5d32('0x64')],_[_0x5d32('0x96')](_0x1a3de9['body'],[_0x5d32('0x64'),'id'])||{})['spread'](function(_0x3e0764){for(var _0xd1f981=0x0;_0xd1f981<_0x1a3de9['body'][_0x5d32('0x64')][_0x5d32('0x51')];_0xd1f981+=0x1){socket[_0x5d32('0xe0')](_0x5d32('0xe1'),{'UserId':Number(_0x1a3de9[_0x5d32('0x54')][_0x5d32('0x64')][_0xd1f981]),'SmsAccountId':Number(_0x1a3de9[_0x5d32('0x4f')]['id'])});}return _0x3e0764;});}})['then'](respondWithResult(_0xb99668,null))[_0x5d32('0x24')](handleError(_0xb99668,null));};exports[_0x5d32('0xe2')]=function(_0x2d3270,_0x4e4b56,_0x3ceeaa){return db[_0x5d32('0x38')][_0x5d32('0x52')]({'where':{'id':_0x2d3270['params']['id']}})[_0x5d32('0x1c')](handleEntityNotFound(_0x4e4b56,null))['then'](function(_0x1d8ae2){if(_0x1d8ae2){return _0x1d8ae2[_0x5d32('0xe2')](_0x2d3270[_0x5d32('0x3d')][_0x5d32('0x64')])[_0x5d32('0x1c')](function(){if(_['isArray'](_0x2d3270['query']['ids'])){for(var _0x587e3a=0x0;_0x587e3a<_0x2d3270['query'][_0x5d32('0x64')][_0x5d32('0x51')];_0x587e3a+=0x1){socket[_0x5d32('0xe0')](_0x5d32('0xe3'),{'UserId':Number(_0x2d3270[_0x5d32('0x3d')][_0x5d32('0x64')][_0x587e3a]),'SmsAccountId':Number(_0x2d3270[_0x5d32('0x4f')]['id'])});}}else{socket[_0x5d32('0xe0')]('userSmsAccount:remove',{'UserId':Number(_0x2d3270[_0x5d32('0x3d')]['ids']),'SmsAccountId':Number(_0x2d3270['params']['id'])});}});}})['then'](respondWithStatusCode(_0x4e4b56,null))['catch'](handleError(_0x4e4b56,null));};exports[_0x5d32('0xe4')]=function(_0x37a557,_0x5ddbc1,_0x1223d6){var _0x27c6bd={};var _0x1965c9={};var _0x2ef015;var _0x5024e4;return db[_0x5d32('0x38')][_0x5d32('0xb7')]({'where':{'id':_0x37a557[_0x5d32('0x4f')]['id']}})[_0x5d32('0x1c')](handleEntityNotFound(_0x5ddbc1,null))[_0x5d32('0x1c')](function(_0x36d091){if(_0x36d091){_0x2ef015=_0x36d091;_0x1965c9[_0x5d32('0x3f')]=_[_0x5d32('0x3c')](db['User'][_0x5d32('0x39')]);_0x1965c9[_0x5d32('0x3d')]=_[_0x5d32('0x3c')](_0x37a557[_0x5d32('0x3d')]);_0x1965c9[_0x5d32('0x47')]=_[_0x5d32('0x3e')](_0x1965c9['model'],_0x1965c9['query']);_0x27c6bd['attributes']=_['intersection'](_0x1965c9[_0x5d32('0x3f')],qs['fields'](_0x37a557[_0x5d32('0x3d')]['fields']));_0x27c6bd['attributes']=_0x27c6bd[_0x5d32('0x40')]['length']?_0x27c6bd[_0x5d32('0x40')]:_0x1965c9[_0x5d32('0x3f')];_0x27c6bd[_0x5d32('0x44')]=qs[_0x5d32('0x45')](_0x37a557[_0x5d32('0x3d')][_0x5d32('0x45')]);_0x27c6bd[_0x5d32('0x46')]=qs[_0x5d32('0x47')](_[_0x5d32('0x48')](_0x37a557[_0x5d32('0x3d')],_0x1965c9[_0x5d32('0x47')]));if(_0x37a557[_0x5d32('0x3d')][_0x5d32('0x49')]){_0x27c6bd[_0x5d32('0x46')]=_[_0x5d32('0x4a')](_0x27c6bd[_0x5d32('0x46')],{'$or':_['map'](_0x27c6bd['attributes'],function(_0x35cb19){var _0x29cf5a={};_0x29cf5a[_0x35cb19]={'$like':'%'+_0x37a557['query'][_0x5d32('0x49')]+'%'};return _0x29cf5a;})});}_0x27c6bd=_[_0x5d32('0x4a')]({},_0x27c6bd,_0x37a557[_0x5d32('0x4c')]);return _0x2ef015[_0x5d32('0xe4')](_0x27c6bd);}})[_0x5d32('0x1c')](function(_0x87908){if(_0x87908){_0x5024e4=_0x87908['length'];if(!_0x37a557['query']['hasOwnProperty'](_0x5d32('0x43'))){_0x27c6bd[_0x5d32('0x2b')]=qs[_0x5d32('0x2b')](_0x37a557['query']['limit']);_0x27c6bd[_0x5d32('0x28')]=qs[_0x5d32('0x28')](_0x37a557[_0x5d32('0x3d')][_0x5d32('0x28')]);}return _0x2ef015[_0x5d32('0xe4')](_0x27c6bd);}})[_0x5d32('0x1c')](function(_0x55c4b3){if(_0x55c4b3){return _0x55c4b3?{'count':_0x5024e4,'rows':_0x55c4b3}:null;}})[_0x5d32('0x1c')](respondWithResult(_0x5ddbc1,null))[_0x5d32('0x24')](handleError(_0x5ddbc1,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 2c13a8d..aa5ba4a 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 _0x0956=['remove','emit','hook','exports','events','SmsAccount','setMaxListeners','save','update'];(function(_0x12675a,_0x493ddd){var _0x19fd07=function(_0xfd3275){while(--_0xfd3275){_0x12675a['push'](_0x12675a['shift']());}};_0x19fd07(++_0x493ddd);}(_0x0956,0x1cf));var _0x6095=function(_0x23b1eb,_0x154413){_0x23b1eb=_0x23b1eb-0x0;var _0x2e9938=_0x0956[_0x23b1eb];return _0x2e9938;};'use strict';var EventEmitter=require(_0x6095('0x0'));var SmsAccount=require('../../mysqldb')['db'][_0x6095('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x6095('0x2')](0x0);var events={'afterCreate':_0x6095('0x3'),'afterUpdate':_0x6095('0x4'),'afterDestroy':_0x6095('0x5')};function emitEvent(_0x56791e){return function(_0x3b42fb,_0x7772db,_0x32fca8){SmsAccountEvents[_0x6095('0x6')](_0x56791e+':'+_0x3b42fb['id'],_0x3b42fb);SmsAccountEvents[_0x6095('0x6')](_0x56791e,_0x3b42fb);_0x32fca8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount[_0x6095('0x7')](e,emitEvent(event));}}module[_0x6095('0x8')]=SmsAccountEvents; \ No newline at end of file +var _0xd106=['update','emit','hasOwnProperty','hook','exports','../../mysqldb','SmsAccount','setMaxListeners','save'];(function(_0x178dff,_0x5c5c24){var _0x538b4b=function(_0x261a0d){while(--_0x261a0d){_0x178dff['push'](_0x178dff['shift']());}};_0x538b4b(++_0x5c5c24);}(_0xd106,0x19a));var _0x6d10=function(_0x7a2a06,_0x4f8a8d){_0x7a2a06=_0x7a2a06-0x0;var _0x24ae55=_0xd106[_0x7a2a06];return _0x24ae55;};'use strict';var EventEmitter=require('events');var SmsAccount=require(_0x6d10('0x0'))['db'][_0x6d10('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x6d10('0x2')](0x0);var events={'afterCreate':_0x6d10('0x3'),'afterUpdate':_0x6d10('0x4'),'afterDestroy':'remove'};function emitEvent(_0x22abcf){return function(_0x5dbb63,_0x1f93cb,_0x46318f){SmsAccountEvents[_0x6d10('0x5')](_0x22abcf+':'+_0x5dbb63['id'],_0x5dbb63);SmsAccountEvents[_0x6d10('0x5')](_0x22abcf,_0x5dbb63);_0x46318f(null);};}for(var e in events){if(events[_0x6d10('0x6')](e)){var event=events[e];SmsAccount[_0x6d10('0x7')](e,emitEvent(event));}}module[_0x6d10('0x8')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index d55d5c0..b36078d 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 _0x1693=['api','request-promise','rimraf','./smsAccount.attributes','exports','define','SmsAccount','lodash','util','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1693,0x16f));var _0x3169=function(_0x4bb2b9,_0x459c78){_0x4bb2b9=_0x4bb2b9-0x0;var _0x40e2a2=_0x1693[_0x4bb2b9];return _0x40e2a2;};'use strict';var _=require(_0x3169('0x0'));var util=require(_0x3169('0x1'));var logger=require(_0x3169('0x2'))(_0x3169('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3169('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3169('0x5'));var config=require('../../config/environment');var attributes=require(_0x3169('0x6'));module[_0x3169('0x7')]=function(_0x1bd9bb,_0x48dd2f){return _0x1bd9bb[_0x3169('0x8')](_0x3169('0x9'),attributes,{'tableName':'sms_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2143=['lodash','util','../../config/logger','moment','bluebird','path','rimraf','./smsAccount.attributes','exports','define'];(function(_0x3e0601,_0x342916){var _0x4dceda=function(_0x32e7da){while(--_0x32e7da){_0x3e0601['push'](_0x3e0601['shift']());}};_0x4dceda(++_0x342916);}(_0x2143,0xf0));var _0x3214=function(_0x43d65d,_0x54d57c){_0x43d65d=_0x43d65d-0x0;var _0x2a5f77=_0x2143[_0x43d65d];return _0x2a5f77;};'use strict';var _=require(_0x3214('0x0'));var util=require(_0x3214('0x1'));var logger=require(_0x3214('0x2'))('api');var moment=require(_0x3214('0x3'));var BPromise=require(_0x3214('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3214('0x5'));var rimraf=require(_0x3214('0x6'));var config=require('../../config/environment');var attributes=require(_0x3214('0x7'));module[_0x3214('0x8')]=function(_0x51a071,_0x24bdc5){return _0x51a071[_0x3214('0x9')]('SmsAccount',attributes,{'tableName':'sms_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.rpc.js b/server/api/smsAccount/smsAccount.rpc.js index 0f54f64..6cc90c7 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 _0x5bd7=['where','include','model','attributes','map','stringify','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','request','then','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','ShowSmsAccount','SmsAccount','find','raw','options'];(function(_0x30306b,_0x1e4558){var _0x265447=function(_0x19cb27){while(--_0x19cb27){_0x30306b['push'](_0x30306b['shift']());}};_0x265447(++_0x1e4558);}(_0x5bd7,0x1ce));var _0x75bd=function(_0x1eae73,_0x5a029b){_0x1eae73=_0x1eae73-0x0;var _0x2714dc=_0x5bd7[_0x1eae73];return _0x2714dc;};'use strict';var _=require(_0x75bd('0x0'));var util=require('util');var moment=require(_0x75bd('0x1'));var BPromise=require(_0x75bd('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x75bd('0x3'));var db=require(_0x75bd('0x4'))['db'];var utils=require(_0x75bd('0x5'));var logger=require(_0x75bd('0x6'))(_0x75bd('0x7'));var config=require('../../config/environment');var jayson=require(_0x75bd('0x8'));var client=jayson['client'][_0x75bd('0x9')]({'port':0x232a});config[_0x75bd('0xa')]=_[_0x75bd('0xb')](config['redis'],{'host':_0x75bd('0xc'),'port':0x18eb});var socket=require(_0x75bd('0xd'))(new Redis(config[_0x75bd('0xa')]));require(_0x75bd('0xe'))[_0x75bd('0xf')](socket);function respondWithRpcPromise(_0x38124f,_0x2dc21e,_0x2e64ce){return new BPromise(function(_0x536748,_0x45f243){return client[_0x75bd('0x10')](_0x38124f,_0x2e64ce)[_0x75bd('0x11')](function(_0x11ff48){logger['info'](_0x75bd('0x12'),_0x2dc21e,_0x75bd('0x13'));logger[_0x75bd('0x14')](_0x75bd('0x15'),_0x2dc21e,_0x75bd('0x13'),JSON['stringify'](_0x11ff48));if(_0x11ff48[_0x75bd('0x16')]){if(_0x11ff48[_0x75bd('0x16')][_0x75bd('0x17')]===0x1f4){logger[_0x75bd('0x16')](_0x75bd('0x12'),_0x2dc21e,_0x11ff48[_0x75bd('0x16')][_0x75bd('0x18')]);return _0x45f243(_0x11ff48[_0x75bd('0x16')][_0x75bd('0x18')]);}logger['error'](_0x75bd('0x12'),_0x2dc21e,_0x11ff48[_0x75bd('0x16')][_0x75bd('0x18')]);return _0x536748(_0x11ff48['error'][_0x75bd('0x18')]);}else{logger[_0x75bd('0x19')](_0x75bd('0x12'),_0x2dc21e,'request\x20sent');_0x536748(_0x11ff48['result'][_0x75bd('0x18')]);}})[_0x75bd('0x1a')](function(_0x42c2d9){logger[_0x75bd('0x16')]('SmsAccount,\x20%s,\x20%s',_0x2dc21e,_0x42c2d9);_0x45f243(_0x42c2d9);});});}exports[_0x75bd('0x1b')]=function(_0x2a4b07){var _0x203db9=this;return new Promise(function(_0x3fba18,_0x89a807){return db[_0x75bd('0x1c')][_0x75bd('0x1d')]({'raw':_0x2a4b07['options']?_0x2a4b07['options'][_0x75bd('0x1e')]===undefined?!![]:![]:!![],'where':_0x2a4b07[_0x75bd('0x1f')]?_0x2a4b07['options'][_0x75bd('0x20')]||null:null,'attributes':_0x2a4b07['options']?_0x2a4b07[_0x75bd('0x1f')]['attributes']||null:null,'include':_0x2a4b07['options']?_0x2a4b07[_0x75bd('0x1f')]['include']?_['map'](_0x2a4b07['options'][_0x75bd('0x21')],function(_0x2a6faa){return{'model':db[_0x2a6faa[_0x75bd('0x22')]],'as':_0x2a6faa['as'],'attributes':_0x2a6faa[_0x75bd('0x23')],'include':_0x2a6faa[_0x75bd('0x21')]?_[_0x75bd('0x24')](_0x2a6faa[_0x75bd('0x21')],function(_0x3f15b5){return{'model':db[_0x3f15b5[_0x75bd('0x22')]],'as':_0x3f15b5['as'],'attributes':_0x3f15b5['attributes'],'include':_0x3f15b5[_0x75bd('0x21')]?_['map'](_0x3f15b5[_0x75bd('0x21')],function(_0x2a72e9){return{'model':db[_0x2a72e9[_0x75bd('0x22')]],'as':_0x2a72e9['as'],'attributes':_0x2a72e9[_0x75bd('0x23')]};}):[]};}):[]};}):[]:[]})[_0x75bd('0x11')](function(_0x31438e){logger[_0x75bd('0x19')](_0x75bd('0x1b'),_0x2a4b07);logger[_0x75bd('0x14')](_0x75bd('0x1b'),_0x2a4b07,JSON[_0x75bd('0x25')](_0x31438e));_0x3fba18(_0x31438e);})['catch'](function(_0x4bc07c){logger['error'](_0x75bd('0x1b'),_0x4bc07c[_0x75bd('0x18')],_0x2a4b07);_0x89a807(_0x203db9[_0x75bd('0x16')](0x1f4,_0x4bc07c[_0x75bd('0x18')]));});});}; \ No newline at end of file +var _0x767c=['../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','socket.io-emitter','./smsAccount.socket','register','request','info','SmsAccount,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','ShowSmsAccount','SmsAccount','find','options','raw','where','attributes','include','model','map','then','debug','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x53a1a3,_0x5d31e3){var _0xd0402c=function(_0x3c2e61){while(--_0x3c2e61){_0x53a1a3['push'](_0x53a1a3['shift']());}};_0xd0402c(++_0x5d31e3);}(_0x767c,0x11b));var _0xc767=function(_0x22d1ef,_0x4a5152){_0x22d1ef=_0x22d1ef-0x0;var _0x47c5a3=_0x767c[_0x22d1ef];return _0x47c5a3;};'use strict';var _=require('lodash');var util=require(_0xc767('0x0'));var moment=require(_0xc767('0x1'));var BPromise=require('bluebird');var rs=require(_0xc767('0x2'));var fs=require('fs');var Redis=require(_0xc767('0x3'));var db=require(_0xc767('0x4'))['db'];var utils=require(_0xc767('0x5'));var logger=require(_0xc767('0x6'))(_0xc767('0x7'));var config=require(_0xc767('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc767('0x9')]['http']({'port':0x232a});config[_0xc767('0xa')]=_[_0xc767('0xb')](config[_0xc767('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xc767('0xc'))(new Redis(config['redis']));require(_0xc767('0xd'))[_0xc767('0xe')](socket);function respondWithRpcPromise(_0x2106f1,_0x591fba,_0x11567a){return new BPromise(function(_0x20314a,_0x43cc30){return client[_0xc767('0xf')](_0x2106f1,_0x11567a)['then'](function(_0xb8f5d8){logger[_0xc767('0x10')](_0xc767('0x11'),_0x591fba,_0xc767('0x12'));logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x591fba,_0xc767('0x12'),JSON[_0xc767('0x13')](_0xb8f5d8));if(_0xb8f5d8['error']){if(_0xb8f5d8['error']['code']===0x1f4){logger[_0xc767('0x14')]('SmsAccount,\x20%s,\x20%s',_0x591fba,_0xb8f5d8[_0xc767('0x14')][_0xc767('0x15')]);return _0x43cc30(_0xb8f5d8[_0xc767('0x14')][_0xc767('0x15')]);}logger[_0xc767('0x14')]('SmsAccount,\x20%s,\x20%s',_0x591fba,_0xb8f5d8[_0xc767('0x14')]['message']);return _0x20314a(_0xb8f5d8[_0xc767('0x14')][_0xc767('0x15')]);}else{logger[_0xc767('0x10')](_0xc767('0x11'),_0x591fba,_0xc767('0x12'));_0x20314a(_0xb8f5d8[_0xc767('0x16')][_0xc767('0x15')]);}})[_0xc767('0x17')](function(_0x514029){logger[_0xc767('0x14')](_0xc767('0x11'),_0x591fba,_0x514029);_0x43cc30(_0x514029);});});}exports[_0xc767('0x18')]=function(_0x519957){var _0xe12ddd=this;return new Promise(function(_0x25c6de,_0x4d1d0c){return db[_0xc767('0x19')][_0xc767('0x1a')]({'raw':_0x519957[_0xc767('0x1b')]?_0x519957[_0xc767('0x1b')][_0xc767('0x1c')]===undefined?!![]:![]:!![],'where':_0x519957[_0xc767('0x1b')]?_0x519957['options'][_0xc767('0x1d')]||null:null,'attributes':_0x519957[_0xc767('0x1b')]?_0x519957['options'][_0xc767('0x1e')]||null:null,'include':_0x519957['options']?_0x519957[_0xc767('0x1b')][_0xc767('0x1f')]?_['map'](_0x519957['options'][_0xc767('0x1f')],function(_0x48d415){return{'model':db[_0x48d415[_0xc767('0x20')]],'as':_0x48d415['as'],'attributes':_0x48d415[_0xc767('0x1e')],'include':_0x48d415[_0xc767('0x1f')]?_[_0xc767('0x21')](_0x48d415[_0xc767('0x1f')],function(_0x1d2a41){return{'model':db[_0x1d2a41[_0xc767('0x20')]],'as':_0x1d2a41['as'],'attributes':_0x1d2a41[_0xc767('0x1e')],'include':_0x1d2a41[_0xc767('0x1f')]?_[_0xc767('0x21')](_0x1d2a41[_0xc767('0x1f')],function(_0x594c91){return{'model':db[_0x594c91[_0xc767('0x20')]],'as':_0x594c91['as'],'attributes':_0x594c91[_0xc767('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xc767('0x22')](function(_0x4fed21){logger['info']('ShowSmsAccount',_0x519957);logger[_0xc767('0x23')](_0xc767('0x18'),_0x519957,JSON[_0xc767('0x13')](_0x4fed21));_0x25c6de(_0x4fed21);})[_0xc767('0x17')](function(_0x21166d){logger[_0xc767('0x14')]('ShowSmsAccount',_0x21166d[_0xc767('0x15')],_0x519957);_0x4d1d0c(_0xe12ddd[_0xc767('0x14')](0x1f4,_0x21166d[_0xc767('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index fe0470c..da38b0f 100644 --- a/server/api/smsAccount/smsAccount.socket.js +++ b/server/api/smsAccount/smsAccount.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xa9e0[_0x110c3d];return _0x226d67;};'use strict';var SmsAccountEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){SmsAccountEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file +var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xa9e0[_0x4709c0];return _0x13348b;};'use strict';var SmsAccountEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){SmsAccountEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file diff --git a/server/api/smsApplication/index.js b/server/api/smsApplication/index.js index dfda5e8..0864be6 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 _0x3e74=['path','connect-timeout','express','../../components/auth/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','exports','multer'];(function(_0x3f6fe1,_0xb63339){var _0x5d40ff=function(_0xff1b95){while(--_0xff1b95){_0x3f6fe1['push'](_0x3f6fe1['shift']());}};_0x5d40ff(++_0xb63339);}(_0x3e74,0x175));var _0x43e7=function(_0x24d0c2,_0x154a5d){_0x24d0c2=_0x24d0c2-0x0;var _0x35d277=_0x3e74[_0x24d0c2];return _0x35d277;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0xc')]('/',auth[_0x43e7('0x8')](),controller['create']);router[_0x43e7('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x43e7('0xe')]);router[_0x43e7('0xf')]('/:id',auth[_0x43e7('0x8')](),controller['destroy']);module[_0x43e7('0x10')]=router; \ No newline at end of file +var _0x7217=['Router','fs-extra','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy','exports','multer','path','connect-timeout','express'];(function(_0x1c5ac3,_0x2c5a2f){var _0x2e872c=function(_0xb14d){while(--_0xb14d){_0x1c5ac3['push'](_0x1c5ac3['shift']());}};_0x2e872c(++_0x2c5a2f);}(_0x7217,0x19e));var _0x7721=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0x7217[_0x28947d];return _0x12d2ee;};'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 fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0xd')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0xf')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller['update']);router[_0x7721('0x10')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0x11')]);module[_0x7721('0x12')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index a8f95f8..e55bd1d 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 _0xff67=['*,*,*,*','sequelize','exports','TEXT','STRING'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0xff67,0xab));var _0x7ff6=function(_0x1d1087,_0x35ea40){_0x1d1087=_0x1d1087-0x0;var _0x12efdd=_0xff67[_0x1d1087];return _0x12efdd;};'use strict';var Sequelize=require(_0x7ff6('0x0'));module[_0x7ff6('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x7ff6('0x2')]()},'description':{'type':Sequelize[_0x7ff6('0x3')]},'interval':{'type':Sequelize[_0x7ff6('0x3')],'defaultValue':_0x7ff6('0x4')}}; \ No newline at end of file +var _0x841b=['exports','INTEGER','noop','STRING','*,*,*,*','sequelize'];(function(_0x3cebff,_0x20b43d){var _0x6e5423=function(_0x1043e1){while(--_0x1043e1){_0x3cebff['push'](_0x3cebff['shift']());}};_0x6e5423(++_0x20b43d);}(_0x841b,0xe3));var _0xb841=function(_0x164a40,_0xb704f7){_0x164a40=_0x164a40-0x0;var _0x2a551a=_0x841b[_0x164a40];return _0x2a551a;};'use strict';var Sequelize=require(_0xb841('0x0'));module[_0xb841('0x1')]={'priority':{'type':Sequelize[_0xb841('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xb841('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xb841('0x4')]},'interval':{'type':Sequelize[_0xb841('0x4')],'defaultValue':_0xb841('0x5')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 9822905..9c5a00f 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 _0xd595=['../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','sendStatus','error','name','index','SmsApplication','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','rows','catch','show','includeAll','find','create','body','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api'];(function(_0x3f993e,_0x2d5757){var _0x39c135=function(_0x39e00b){while(--_0x39e00b){_0x3f993e['push'](_0x3f993e['shift']());}};_0x39c135(++_0x2d5757);}(_0xd595,0xc6));var _0x5d59=function(_0x3aafed,_0x576ef8){_0x3aafed=_0x3aafed-0x0;var _0x3bb92e=_0xd595[_0x3aafed];return _0x3bb92e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5d59('0x0'));var zipdir=require(_0x5d59('0x1'));var jsonpatch=require(_0x5d59('0x2'));var rp=require(_0x5d59('0x3'));var moment=require(_0x5d59('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5d59('0x5'));var path=require(_0x5d59('0x6'));var sox=require('sox');var csv=require(_0x5d59('0x7'));var ejs=require(_0x5d59('0x8'));var fs=require('fs');var fs_extra=require(_0x5d59('0x9'));var _=require('lodash');var squel=require(_0x5d59('0xa'));var crypto=require(_0x5d59('0xb'));var jsforce=require(_0x5d59('0xc'));var deskjs=require(_0x5d59('0xd'));var toCsv=require('to-csv');var querystring=require(_0x5d59('0xe'));var Papa=require(_0x5d59('0xf'));var Redis=require(_0x5d59('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x5d59('0x11'));var as=require(_0x5d59('0x12'));var hardwareService=require(_0x5d59('0x13'));var logger=require('../../config/logger')(_0x5d59('0x14'));var utils=require(_0x5d59('0x15'));var config=require(_0x5d59('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x5d59('0x17'))['db'];function respondWithStatusCode(_0x3c32c9,_0x37c64a){_0x37c64a=_0x37c64a||0xcc;return function(_0x182c7b){if(_0x182c7b){return _0x3c32c9['sendStatus'](_0x37c64a);}return _0x3c32c9[_0x5d59('0x18')](_0x37c64a)[_0x5d59('0x19')]();};}function respondWithResult(_0x251b7c,_0x126983){_0x126983=_0x126983||0xc8;return function(_0x34ea21){if(_0x34ea21){return _0x251b7c[_0x5d59('0x18')](_0x126983)[_0x5d59('0x1a')](_0x34ea21);}};}function respondWithFilteredResult(_0x5d594f,_0x1ad4ca){return function(_0x281814){if(_0x281814){var _0x142ecf=typeof _0x1ad4ca[_0x5d59('0x1b')]===_0x5d59('0x1c')&&typeof _0x1ad4ca[_0x5d59('0x1d')]===_0x5d59('0x1c');var _0x48d8c5=_0x281814[_0x5d59('0x1e')];var _0x44a1c2=_0x142ecf?0x0:_0x1ad4ca['offset'];var _0x5d4f26=_0x142ecf?_0x281814[_0x5d59('0x1e')]:_0x1ad4ca[_0x5d59('0x1b')]+_0x1ad4ca['limit'];var _0x28776e;if(_0x5d4f26>=_0x48d8c5){_0x5d4f26=_0x48d8c5;_0x28776e=0xc8;}else{_0x28776e=0xce;}_0x5d594f[_0x5d59('0x18')](_0x28776e);return _0x5d594f[_0x5d59('0x1f')](_0x5d59('0x20'),_0x44a1c2+'-'+_0x5d4f26+'/'+_0x48d8c5)['json'](_0x281814);}return null;};}function patchUpdates(_0x500925){return function(_0x40126f){try{jsonpatch['apply'](_0x40126f,_0x500925,!![]);}catch(_0x4e06f){return BPromise['reject'](_0x4e06f);}return _0x40126f[_0x5d59('0x21')]();};}function saveUpdates(_0x87faee,_0x56c745){return function(_0x18fb65){if(_0x18fb65){return _0x18fb65[_0x5d59('0x22')](_0x87faee)[_0x5d59('0x23')](function(_0x45140f){return _0x45140f;});}return null;};}function removeEntity(_0x42b5ec,_0x57db79){return function(_0x203620){if(_0x203620){return _0x203620[_0x5d59('0x24')]()[_0x5d59('0x23')](function(){_0x42b5ec[_0x5d59('0x18')](0xcc)[_0x5d59('0x19')]();});}};}function handleEntityNotFound(_0x3a341c,_0x1d80c9){return function(_0x4e7bfd){if(!_0x4e7bfd){_0x3a341c[_0x5d59('0x25')](0x194);}return _0x4e7bfd;};}function handleError(_0x1649cc,_0x7c2352){_0x7c2352=_0x7c2352||0x1f4;return function(_0xff28fd){logger[_0x5d59('0x26')](_0xff28fd['stack']);if(_0xff28fd[_0x5d59('0x27')]){delete _0xff28fd['name'];}_0x1649cc[_0x5d59('0x18')](_0x7c2352)['send'](_0xff28fd);};}exports[_0x5d59('0x28')]=function(_0x37ec45,_0x2d6e81){var _0x2600c2={},_0x29e67b={},_0x3d8519={'count':0x0,'rows':[]};var _0x23ca2e=_['map'](db[_0x5d59('0x29')][_0x5d59('0x2a')],function(_0x2eb8d1){return{'name':_0x2eb8d1[_0x5d59('0x2b')],'type':_0x2eb8d1[_0x5d59('0x2c')][_0x5d59('0x2d')]};});_0x29e67b[_0x5d59('0x2e')]=_[_0x5d59('0x2f')](_0x23ca2e,_0x5d59('0x27'));_0x29e67b[_0x5d59('0x30')]=_[_0x5d59('0x31')](_0x37ec45[_0x5d59('0x30')]);_0x29e67b['filters']=_[_0x5d59('0x32')](_0x29e67b[_0x5d59('0x2e')],_0x29e67b['query']);_0x2600c2['attributes']=_[_0x5d59('0x32')](_0x29e67b['model'],qs[_0x5d59('0x33')](_0x37ec45[_0x5d59('0x30')][_0x5d59('0x33')]));_0x2600c2[_0x5d59('0x34')]=_0x2600c2[_0x5d59('0x34')][_0x5d59('0x35')]?_0x2600c2[_0x5d59('0x34')]:_0x29e67b['model'];if(!_0x37ec45[_0x5d59('0x30')][_0x5d59('0x36')]('nolimit')){_0x2600c2[_0x5d59('0x1d')]=qs[_0x5d59('0x1d')](_0x37ec45[_0x5d59('0x30')][_0x5d59('0x1d')]);_0x2600c2[_0x5d59('0x1b')]=qs[_0x5d59('0x1b')](_0x37ec45[_0x5d59('0x30')][_0x5d59('0x1b')]);}_0x2600c2[_0x5d59('0x37')]=qs[_0x5d59('0x38')](_0x37ec45['query'][_0x5d59('0x38')]);_0x2600c2[_0x5d59('0x39')]=qs[_0x5d59('0x3a')](_[_0x5d59('0x3b')](_0x37ec45[_0x5d59('0x30')],_0x29e67b[_0x5d59('0x3a')]),_0x23ca2e);if(_0x37ec45[_0x5d59('0x30')][_0x5d59('0x3c')]){_0x2600c2[_0x5d59('0x39')]=_[_0x5d59('0x3d')](_0x2600c2['where'],{'$or':_[_0x5d59('0x2f')](_0x23ca2e,function(_0x2ebc21){if(_0x2ebc21[_0x5d59('0x2c')]!==_0x5d59('0x3e')){var _0x3f95a4={};_0x3f95a4[_0x2ebc21[_0x5d59('0x27')]]={'$like':'%'+_0x37ec45['query'][_0x5d59('0x3c')]+'%'};return _0x3f95a4;}})});}_0x2600c2=_[_0x5d59('0x3d')]({},_0x2600c2,_0x37ec45[_0x5d59('0x3f')]);var _0x4cd2dd={'where':_0x2600c2[_0x5d59('0x39')]};return db['SmsApplication'][_0x5d59('0x1e')](_0x4cd2dd)[_0x5d59('0x23')](function(_0x172efa){_0x3d8519[_0x5d59('0x1e')]=_0x172efa;if(_0x37ec45[_0x5d59('0x30')]['includeAll']){_0x2600c2[_0x5d59('0x40')]=[{'all':!![]}];}return db[_0x5d59('0x29')]['findAll'](_0x2600c2);})[_0x5d59('0x23')](function(_0xba9f5f){_0x3d8519[_0x5d59('0x41')]=_0xba9f5f;return _0x3d8519;})['then'](respondWithFilteredResult(_0x2d6e81,_0x2600c2))[_0x5d59('0x42')](handleError(_0x2d6e81,null));};exports[_0x5d59('0x43')]=function(_0x1788bb,_0x33d248){var _0x2ee724={'raw':!![],'where':{'id':_0x1788bb['params']['id']}},_0x64c6e2={};_0x64c6e2[_0x5d59('0x2e')]=_[_0x5d59('0x31')](db[_0x5d59('0x29')][_0x5d59('0x2a')]);_0x64c6e2['query']=_['keys'](_0x1788bb[_0x5d59('0x30')]);_0x64c6e2[_0x5d59('0x3a')]=_[_0x5d59('0x32')](_0x64c6e2[_0x5d59('0x2e')],_0x64c6e2[_0x5d59('0x30')]);_0x2ee724[_0x5d59('0x34')]=_[_0x5d59('0x32')](_0x64c6e2[_0x5d59('0x2e')],qs[_0x5d59('0x33')](_0x1788bb['query']['fields']));_0x2ee724[_0x5d59('0x34')]=_0x2ee724[_0x5d59('0x34')][_0x5d59('0x35')]?_0x2ee724[_0x5d59('0x34')]:_0x64c6e2[_0x5d59('0x2e')];if(_0x1788bb[_0x5d59('0x30')][_0x5d59('0x44')]){_0x2ee724[_0x5d59('0x40')]=[{'all':!![]}];}_0x2ee724=_[_0x5d59('0x3d')]({},_0x2ee724,_0x1788bb['options']);return db[_0x5d59('0x29')][_0x5d59('0x45')](_0x2ee724)[_0x5d59('0x23')](handleEntityNotFound(_0x33d248,null))[_0x5d59('0x23')](respondWithResult(_0x33d248,null))[_0x5d59('0x42')](handleError(_0x33d248,null));};exports[_0x5d59('0x46')]=function(_0x30faab,_0x62c4e4){return db['SmsApplication'][_0x5d59('0x46')](_0x30faab[_0x5d59('0x47')],{})['then'](respondWithResult(_0x62c4e4,0xc9))[_0x5d59('0x42')](handleError(_0x62c4e4,null));};exports[_0x5d59('0x22')]=function(_0x1aa12b,_0x327de4){if(_0x1aa12b['body']['id']){delete _0x1aa12b['body']['id'];}return db[_0x5d59('0x29')]['find']({'where':{'id':_0x1aa12b[_0x5d59('0x48')]['id']}})['then'](handleEntityNotFound(_0x327de4,null))['then'](saveUpdates(_0x1aa12b[_0x5d59('0x47')],null))['then'](respondWithResult(_0x327de4,null))['catch'](handleError(_0x327de4,null));};exports[_0x5d59('0x24')]=function(_0x189e3f,_0x3435ab){return db['SmsApplication'][_0x5d59('0x45')]({'where':{'id':_0x189e3f[_0x5d59('0x48')]['id']}})[_0x5d59('0x23')](handleEntityNotFound(_0x3435ab,null))[_0x5d59('0x23')](removeEntity(_0x3435ab,null))[_0x5d59('0x42')](handleError(_0x3435ab,null));}; \ No newline at end of file +var _0x071d=['name','send','index','map','SmsApplication','rawAttributes','fieldName','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','findAll','params','includeAll','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','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','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','then','destroy','sendStatus','stack'];(function(_0x2794cd,_0x1bd97e){var _0x12642a=function(_0x5f200b){while(--_0x5f200b){_0x2794cd['push'](_0x2794cd['shift']());}};_0x12642a(++_0x1bd97e);}(_0x071d,0x6f));var _0xd071=function(_0x2f62aa,_0x108e95){_0x2f62aa=_0x2f62aa-0x0;var _0x1a341f=_0x071d[_0x2f62aa];return _0x1a341f;};'use strict';var emlformat=require(_0xd071('0x0'));var rimraf=require(_0xd071('0x1'));var zipdir=require(_0xd071('0x2'));var jsonpatch=require(_0xd071('0x3'));var rp=require(_0xd071('0x4'));var moment=require(_0xd071('0x5'));var BPromise=require(_0xd071('0x6'));var Mustache=require(_0xd071('0x7'));var util=require(_0xd071('0x8'));var path=require('path');var sox=require(_0xd071('0x9'));var csv=require(_0xd071('0xa'));var ejs=require(_0xd071('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd071('0xc'));var squel=require(_0xd071('0xd'));var crypto=require(_0xd071('0xe'));var jsforce=require(_0xd071('0xf'));var deskjs=require(_0xd071('0x10'));var toCsv=require(_0xd071('0xa'));var querystring=require(_0xd071('0x11'));var Papa=require(_0xd071('0x12'));var Redis=require(_0xd071('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xd071('0x14'));var as=require(_0xd071('0x15'));var hardwareService=require(_0xd071('0x16'));var logger=require(_0xd071('0x17'))(_0xd071('0x18'));var utils=require(_0xd071('0x19'));var config=require(_0xd071('0x1a'));var licenseUtil=require(_0xd071('0x1b'));var db=require(_0xd071('0x1c'))['db'];function respondWithStatusCode(_0x36166d,_0x4ac36d){_0x4ac36d=_0x4ac36d||0xcc;return function(_0x300019){if(_0x300019){return _0x36166d['sendStatus'](_0x4ac36d);}return _0x36166d[_0xd071('0x1d')](_0x4ac36d)[_0xd071('0x1e')]();};}function respondWithResult(_0x4b58ae,_0x215a45){_0x215a45=_0x215a45||0xc8;return function(_0x4c1eda){if(_0x4c1eda){return _0x4b58ae['status'](_0x215a45)[_0xd071('0x1f')](_0x4c1eda);}};}function respondWithFilteredResult(_0x25fc0b,_0x4793c1){return function(_0x2b6733){if(_0x2b6733){var _0x24ff8f=typeof _0x4793c1[_0xd071('0x20')]==='undefined'&&typeof _0x4793c1[_0xd071('0x21')]===_0xd071('0x22');var _0x448cda=_0x2b6733[_0xd071('0x23')];var _0x96e185=_0x24ff8f?0x0:_0x4793c1[_0xd071('0x20')];var _0x2dcfe9=_0x24ff8f?_0x2b6733[_0xd071('0x23')]:_0x4793c1['offset']+_0x4793c1[_0xd071('0x21')];var _0xd8fc6f;if(_0x2dcfe9>=_0x448cda){_0x2dcfe9=_0x448cda;_0xd8fc6f=0xc8;}else{_0xd8fc6f=0xce;}_0x25fc0b[_0xd071('0x1d')](_0xd8fc6f);return _0x25fc0b[_0xd071('0x24')]('Content-Range',_0x96e185+'-'+_0x2dcfe9+'/'+_0x448cda)['json'](_0x2b6733);}return null;};}function patchUpdates(_0x67cad9){return function(_0x1171d7){try{jsonpatch[_0xd071('0x25')](_0x1171d7,_0x67cad9,!![]);}catch(_0x2a6b68){return BPromise[_0xd071('0x26')](_0x2a6b68);}return _0x1171d7[_0xd071('0x27')]();};}function saveUpdates(_0x4644e5,_0x2fd235){return function(_0x55ed1c){if(_0x55ed1c){return _0x55ed1c[_0xd071('0x28')](_0x4644e5)[_0xd071('0x29')](function(_0x12ade6){return _0x12ade6;});}return null;};}function removeEntity(_0x35ae0f,_0x437191){return function(_0x13be3d){if(_0x13be3d){return _0x13be3d[_0xd071('0x2a')]()[_0xd071('0x29')](function(){_0x35ae0f[_0xd071('0x1d')](0xcc)[_0xd071('0x1e')]();});}};}function handleEntityNotFound(_0x144ce3,_0x1fb1ca){return function(_0x2dc76c){if(!_0x2dc76c){_0x144ce3[_0xd071('0x2b')](0x194);}return _0x2dc76c;};}function handleError(_0x4a0edb,_0x2e702a){_0x2e702a=_0x2e702a||0x1f4;return function(_0x3db8cf){logger['error'](_0x3db8cf[_0xd071('0x2c')]);if(_0x3db8cf[_0xd071('0x2d')]){delete _0x3db8cf[_0xd071('0x2d')];}_0x4a0edb[_0xd071('0x1d')](_0x2e702a)[_0xd071('0x2e')](_0x3db8cf);};}exports[_0xd071('0x2f')]=function(_0x74dea1,_0x4eb1d){var _0x4fb33c={},_0x4c50c9={},_0x158eb3={'count':0x0,'rows':[]};var _0x2685b5=_[_0xd071('0x30')](db[_0xd071('0x31')][_0xd071('0x32')],function(_0x2dc75c){return{'name':_0x2dc75c[_0xd071('0x33')],'type':_0x2dc75c['type'][_0xd071('0x34')]};});_0x4c50c9[_0xd071('0x35')]=_['map'](_0x2685b5,'name');_0x4c50c9[_0xd071('0x36')]=_[_0xd071('0x37')](_0x74dea1[_0xd071('0x36')]);_0x4c50c9['filters']=_[_0xd071('0x38')](_0x4c50c9[_0xd071('0x35')],_0x4c50c9[_0xd071('0x36')]);_0x4fb33c['attributes']=_[_0xd071('0x38')](_0x4c50c9[_0xd071('0x35')],qs[_0xd071('0x39')](_0x74dea1['query'][_0xd071('0x39')]));_0x4fb33c[_0xd071('0x3a')]=_0x4fb33c[_0xd071('0x3a')][_0xd071('0x3b')]?_0x4fb33c[_0xd071('0x3a')]:_0x4c50c9[_0xd071('0x35')];if(!_0x74dea1[_0xd071('0x36')][_0xd071('0x3c')]('nolimit')){_0x4fb33c[_0xd071('0x21')]=qs[_0xd071('0x21')](_0x74dea1[_0xd071('0x36')]['limit']);_0x4fb33c[_0xd071('0x20')]=qs[_0xd071('0x20')](_0x74dea1['query']['offset']);}_0x4fb33c[_0xd071('0x3d')]=qs[_0xd071('0x3e')](_0x74dea1[_0xd071('0x36')][_0xd071('0x3e')]);_0x4fb33c[_0xd071('0x3f')]=qs[_0xd071('0x40')](_[_0xd071('0x41')](_0x74dea1[_0xd071('0x36')],_0x4c50c9[_0xd071('0x40')]),_0x2685b5);if(_0x74dea1[_0xd071('0x36')][_0xd071('0x42')]){_0x4fb33c['where']=_[_0xd071('0x43')](_0x4fb33c[_0xd071('0x3f')],{'$or':_['map'](_0x2685b5,function(_0x204242){if(_0x204242[_0xd071('0x44')]!==_0xd071('0x45')){var _0x19ad57={};_0x19ad57[_0x204242[_0xd071('0x2d')]]={'$like':'%'+_0x74dea1[_0xd071('0x36')][_0xd071('0x42')]+'%'};return _0x19ad57;}})});}_0x4fb33c=_[_0xd071('0x43')]({},_0x4fb33c,_0x74dea1[_0xd071('0x46')]);var _0x2db925={'where':_0x4fb33c[_0xd071('0x3f')]};return db[_0xd071('0x31')][_0xd071('0x23')](_0x2db925)[_0xd071('0x29')](function(_0xc2b8){_0x158eb3['count']=_0xc2b8;if(_0x74dea1['query']['includeAll']){_0x4fb33c['include']=[{'all':!![]}];}return db[_0xd071('0x31')][_0xd071('0x47')](_0x4fb33c);})['then'](function(_0x498145){_0x158eb3['rows']=_0x498145;return _0x158eb3;})[_0xd071('0x29')](respondWithFilteredResult(_0x4eb1d,_0x4fb33c))['catch'](handleError(_0x4eb1d,null));};exports['show']=function(_0x450b85,_0x1ddc12){var _0x184020={'raw':!![],'where':{'id':_0x450b85[_0xd071('0x48')]['id']}},_0x563e7b={};_0x563e7b['model']=_['keys'](db[_0xd071('0x31')][_0xd071('0x32')]);_0x563e7b[_0xd071('0x36')]=_['keys'](_0x450b85[_0xd071('0x36')]);_0x563e7b['filters']=_['intersection'](_0x563e7b[_0xd071('0x35')],_0x563e7b[_0xd071('0x36')]);_0x184020['attributes']=_[_0xd071('0x38')](_0x563e7b[_0xd071('0x35')],qs[_0xd071('0x39')](_0x450b85[_0xd071('0x36')]['fields']));_0x184020[_0xd071('0x3a')]=_0x184020[_0xd071('0x3a')]['length']?_0x184020[_0xd071('0x3a')]:_0x563e7b[_0xd071('0x35')];if(_0x450b85['query'][_0xd071('0x49')]){_0x184020['include']=[{'all':!![]}];}_0x184020=_['merge']({},_0x184020,_0x450b85[_0xd071('0x46')]);return db[_0xd071('0x31')][_0xd071('0x4a')](_0x184020)[_0xd071('0x29')](handleEntityNotFound(_0x1ddc12,null))[_0xd071('0x29')](respondWithResult(_0x1ddc12,null))[_0xd071('0x4b')](handleError(_0x1ddc12,null));};exports['create']=function(_0x4c1211,_0x1bd9b2){return db['SmsApplication'][_0xd071('0x4c')](_0x4c1211[_0xd071('0x4d')],{})[_0xd071('0x29')](respondWithResult(_0x1bd9b2,0xc9))['catch'](handleError(_0x1bd9b2,null));};exports[_0xd071('0x28')]=function(_0x17886b,_0x3d5821){if(_0x17886b[_0xd071('0x4d')]['id']){delete _0x17886b[_0xd071('0x4d')]['id'];}return db[_0xd071('0x31')][_0xd071('0x4a')]({'where':{'id':_0x17886b[_0xd071('0x48')]['id']}})['then'](handleEntityNotFound(_0x3d5821,null))[_0xd071('0x29')](saveUpdates(_0x17886b[_0xd071('0x4d')],null))['then'](respondWithResult(_0x3d5821,null))[_0xd071('0x4b')](handleError(_0x3d5821,null));};exports[_0xd071('0x2a')]=function(_0x2e23b7,_0x3f03f7){return db[_0xd071('0x31')][_0xd071('0x4a')]({'where':{'id':_0x2e23b7[_0xd071('0x48')]['id']}})[_0xd071('0x29')](handleEntityNotFound(_0x3f03f7,null))['then'](removeEntity(_0x3f03f7,null))[_0xd071('0x4b')](handleError(_0x3f03f7,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index 7efd1c8..c028d4f 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 _0xcec0=['moment','bluebird','rimraf','./smsApplication.attributes','exports','define','SmsApplication','sms_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api'];(function(_0x2d8734,_0x3da8cf){var _0x9cbdd=function(_0x2f1706){while(--_0x2f1706){_0x2d8734['push'](_0x2d8734['shift']());}};_0x9cbdd(++_0x3da8cf);}(_0xcec0,0x99));var _0x0cec=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xcec0[_0x47b58b];return _0x46bebe;};'use strict';var _=require(_0x0cec('0x0'));var util=require('util');var logger=require(_0x0cec('0x1'))(_0x0cec('0x2'));var moment=require(_0x0cec('0x3'));var BPromise=require(_0x0cec('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0cec('0x5'));var config=require('../../config/environment');var attributes=require(_0x0cec('0x6'));module[_0x0cec('0x7')]=function(_0xccad0b,_0x5b4a7e){return _0xccad0b[_0x0cec('0x8')](_0x0cec('0x9'),attributes,{'tableName':_0x0cec('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0cec('0xb'),'collate':_0x0cec('0xc')});}; \ No newline at end of file +var _0x127f=['rimraf','exports','define','SmsApplication','sms_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x2f5c10,_0x104d44){var _0x652ebd=function(_0x38f684){while(--_0x38f684){_0x2f5c10['push'](_0x2f5c10['shift']());}};_0x652ebd(++_0x104d44);}(_0x127f,0xbc));var _0xf127=function(_0x2a83dd,_0x595542){_0x2a83dd=_0x2a83dd-0x0;var _0x5c89f6=_0x127f[_0x2a83dd];return _0x5c89f6;};'use strict';var _=require(_0xf127('0x0'));var util=require(_0xf127('0x1'));var logger=require(_0xf127('0x2'))('api');var moment=require(_0xf127('0x3'));var BPromise=require(_0xf127('0x4'));var rp=require(_0xf127('0x5'));var fs=require('fs');var path=require(_0xf127('0x6'));var rimraf=require(_0xf127('0x7'));var config=require('../../config/environment');var attributes=require('./smsApplication.attributes');module[_0xf127('0x8')]=function(_0x560234,_0x22864d){return _0x560234[_0xf127('0x9')](_0xf127('0xa'),attributes,{'tableName':_0xf127('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xf127('0xc')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index cbfc465..803f67b 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 _0xed3c=['result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x1e3742,_0x5ae092){var _0x3499fe=function(_0xdc83e9){while(--_0xdc83e9){_0x1e3742['push'](_0x1e3742['shift']());}};_0x3499fe(++_0x5ae092);}(_0xed3c,0x1a6));var _0xced3=function(_0x54b719,_0x39ade5){_0x54b719=_0x54b719-0x0;var _0x31edd9=_0xed3c[_0x54b719];return _0x31edd9;};'use strict';var _=require(_0xced3('0x0'));var util=require(_0xced3('0x1'));var moment=require(_0xced3('0x2'));var BPromise=require(_0xced3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xced3('0x4'));var db=require(_0xced3('0x5'))['db'];var utils=require(_0xced3('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xced3('0x7'));var jayson=require(_0xced3('0x8'));var client=jayson[_0xced3('0x9')][_0xced3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4795cd,_0x510164,_0x5ca701){return new BPromise(function(_0x851bd3,_0x5f2f90){return client['request'](_0x4795cd,_0x5ca701)['then'](function(_0x19a727){logger[_0xced3('0xb')](_0xced3('0xc'),_0x510164,_0xced3('0xd'));logger[_0xced3('0xe')]('SmsApplication,\x20%s,\x20%s,\x20%s',_0x510164,_0xced3('0xd'),JSON[_0xced3('0xf')](_0x19a727));if(_0x19a727[_0xced3('0x10')]){if(_0x19a727['error'][_0xced3('0x11')]===0x1f4){logger[_0xced3('0x10')](_0xced3('0xc'),_0x510164,_0x19a727[_0xced3('0x10')][_0xced3('0x12')]);return _0x5f2f90(_0x19a727[_0xced3('0x10')][_0xced3('0x12')]);}logger['error'](_0xced3('0xc'),_0x510164,_0x19a727['error'][_0xced3('0x12')]);return _0x851bd3(_0x19a727[_0xced3('0x10')][_0xced3('0x12')]);}else{logger[_0xced3('0xb')]('SmsApplication,\x20%s,\x20%s',_0x510164,_0xced3('0xd'));_0x851bd3(_0x19a727[_0xced3('0x13')]['message']);}})[_0xced3('0x14')](function(_0x37e2d5){logger[_0xced3('0x10')](_0xced3('0xc'),_0x510164,_0x37e2d5);_0x5f2f90(_0x37e2d5);});});} \ No newline at end of file +var _0xc23d=['stringify','error','code','SmsApplication,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0xc23d,0x7f));var _0xdc23=function(_0x5a8aa3,_0x2294d5){_0x5a8aa3=_0x5a8aa3-0x0;var _0x5d0458=_0xc23d[_0x5a8aa3];return _0x5d0458;};'use strict';var _=require(_0xdc23('0x0'));var util=require(_0xdc23('0x1'));var moment=require(_0xdc23('0x2'));var BPromise=require(_0xdc23('0x3'));var rs=require(_0xdc23('0x4'));var fs=require('fs');var Redis=require(_0xdc23('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xdc23('0x6'));var logger=require(_0xdc23('0x7'))(_0xdc23('0x8'));var config=require(_0xdc23('0x9'));var jayson=require(_0xdc23('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x17cb48,_0x47c9cd,_0x2a5303){return new BPromise(function(_0x4d16cf,_0x459f6d){return client[_0xdc23('0xb')](_0x17cb48,_0x2a5303)[_0xdc23('0xc')](function(_0x43ba94){logger[_0xdc23('0xd')]('SmsApplication,\x20%s,\x20%s',_0x47c9cd,_0xdc23('0xe'));logger[_0xdc23('0xf')](_0xdc23('0x10'),_0x47c9cd,_0xdc23('0xe'),JSON[_0xdc23('0x11')](_0x43ba94));if(_0x43ba94[_0xdc23('0x12')]){if(_0x43ba94['error'][_0xdc23('0x13')]===0x1f4){logger[_0xdc23('0x12')](_0xdc23('0x14'),_0x47c9cd,_0x43ba94[_0xdc23('0x12')]['message']);return _0x459f6d(_0x43ba94[_0xdc23('0x12')][_0xdc23('0x15')]);}logger[_0xdc23('0x12')](_0xdc23('0x14'),_0x47c9cd,_0x43ba94[_0xdc23('0x12')][_0xdc23('0x15')]);return _0x4d16cf(_0x43ba94['error'][_0xdc23('0x15')]);}else{logger['info'](_0xdc23('0x14'),_0x47c9cd,_0xdc23('0xe'));_0x4d16cf(_0x43ba94[_0xdc23('0x16')]['message']);}})[_0xdc23('0x17')](function(_0x476654){logger[_0xdc23('0x12')](_0xdc23('0x14'),_0x47c9cd,_0x476654);_0x459f6d(_0x476654);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 698ee56..867081c 100644 --- a/server/api/smsInteraction/index.js +++ b/server/api/smsInteraction/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x80ed=['delete','smsinteraction:destroy','destroy','/:id/tags','removeTags','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','/:id/download','download','post','create','tracked','sms','smsinteraction:addtags','addTags','smsinteraction:update','update'];(function(_0x300b26,_0x3a9b67){var _0x5cb1ae=function(_0x2b8e7f){while(--_0x2b8e7f){_0x300b26['push'](_0x300b26['shift']());}};_0x5cb1ae(++_0x3a9b67);}(_0x80ed,0x11c));var _0xd80e=function(_0x1cff8b,_0x2d641d){_0x1cff8b=_0x1cff8b-0x0;var _0x998b71=_0x80ed[_0x1cff8b];return _0x998b71;};'use strict';var multer=require(_0xd80e('0x0'));var util=require('util');var path=require(_0xd80e('0x1'));var timeout=require(_0xd80e('0x2'));var express=require(_0xd80e('0x3'));var router=express['Router']();var fs_extra=require(_0xd80e('0x4'));var auth=require(_0xd80e('0x5'));var interaction=require(_0xd80e('0x6'));var config=require(_0xd80e('0x7'));var controller=require('./smsInteraction.controller');router[_0xd80e('0x8')]('/',auth[_0xd80e('0x9')](),controller[_0xd80e('0xa')]);router['get'](_0xd80e('0xb'),auth[_0xd80e('0x9')](),controller[_0xd80e('0xc')]);router[_0xd80e('0x8')](_0xd80e('0xd'),auth[_0xd80e('0x9')](),controller[_0xd80e('0xe')]);router[_0xd80e('0x8')](_0xd80e('0xf'),auth[_0xd80e('0x9')](),controller['getMessages']);router[_0xd80e('0x8')](_0xd80e('0x10'),auth[_0xd80e('0x9')](),controller[_0xd80e('0x11')]);router[_0xd80e('0x12')]('/',auth[_0xd80e('0x9')](),controller[_0xd80e('0x13')]);router[_0xd80e('0x12')](_0xd80e('0xf'),auth['isAuthenticated'](),controller['addMessage']);router['post']('/:id/tags',auth[_0xd80e('0x9')](),interaction[_0xd80e('0x14')](_0xd80e('0x15'),_0xd80e('0x16')),controller[_0xd80e('0x17')]);router['put'](_0xd80e('0xd'),auth[_0xd80e('0x9')](),interaction[_0xd80e('0x14')](_0xd80e('0x15'),_0xd80e('0x18')),controller[_0xd80e('0x19')]);router[_0xd80e('0x1a')](_0xd80e('0xd'),auth['isAuthenticated'](),interaction[_0xd80e('0x14')](_0xd80e('0x15'),_0xd80e('0x1b')),controller[_0xd80e('0x1c')]);router['delete'](_0xd80e('0x1d'),auth[_0xd80e('0x9')](),controller[_0xd80e('0x1e')]);module['exports']=router; \ No newline at end of file +var _0xd7d1=['update','delete','smsinteraction:destroy','/:id/tags','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/messages','download','post','addMessage','tracked','sms','smsinteraction:addtags','addTags','put','smsinteraction:update'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0xa07a61,_0x480ee3){_0xa07a61=_0xa07a61-0x0;var _0x2e717b=_0xd7d1[_0xa07a61];return _0x2e717b;};'use strict';var multer=require(_0x1d7d('0x0'));var util=require(_0x1d7d('0x1'));var path=require(_0x1d7d('0x2'));var timeout=require(_0x1d7d('0x3'));var express=require(_0x1d7d('0x4'));var router=express[_0x1d7d('0x5')]();var fs_extra=require(_0x1d7d('0x6'));var auth=require(_0x1d7d('0x7'));var interaction=require(_0x1d7d('0x8'));var config=require(_0x1d7d('0x9'));var controller=require(_0x1d7d('0xa'));router[_0x1d7d('0xb')]('/',auth[_0x1d7d('0xc')](),controller['index']);router[_0x1d7d('0xb')](_0x1d7d('0xd'),auth[_0x1d7d('0xc')](),controller[_0x1d7d('0xe')]);router[_0x1d7d('0xb')](_0x1d7d('0xf'),auth[_0x1d7d('0xc')](),controller[_0x1d7d('0x10')]);router[_0x1d7d('0xb')](_0x1d7d('0x11'),auth[_0x1d7d('0xc')](),controller['getMessages']);router[_0x1d7d('0xb')]('/:id/download',auth[_0x1d7d('0xc')](),controller[_0x1d7d('0x12')]);router[_0x1d7d('0x13')]('/',auth[_0x1d7d('0xc')](),controller['create']);router[_0x1d7d('0x13')]('/:id/messages',auth['isAuthenticated'](),controller[_0x1d7d('0x14')]);router[_0x1d7d('0x13')]('/:id/tags',auth['isAuthenticated'](),interaction[_0x1d7d('0x15')](_0x1d7d('0x16'),_0x1d7d('0x17')),controller[_0x1d7d('0x18')]);router[_0x1d7d('0x19')]('/:id',auth[_0x1d7d('0xc')](),interaction[_0x1d7d('0x15')]('sms',_0x1d7d('0x1a')),controller[_0x1d7d('0x1b')]);router[_0x1d7d('0x1c')](_0x1d7d('0xf'),auth[_0x1d7d('0xc')](),interaction['tracked'](_0x1d7d('0x16'),_0x1d7d('0x1d')),controller['destroy']);router['delete'](_0x1d7d('0x1e'),auth[_0x1d7d('0xc')](),controller[_0x1d7d('0x1f')]);module[_0x1d7d('0x20')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 054e9da..7618d60 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 _0x8710=['sequelize','moment','BOOLEAN','DATE','STRING','out','ENUM','INTEGER'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x8710,0x68));var _0x0871=function(_0x230ea4,_0x25c82d){_0x230ea4=_0x230ea4-0x0;var _0x1212c9=_0x8710[_0x230ea4];return _0x1212c9;};'use strict';var Sequelize=require(_0x0871('0x0'));var moment=require(_0x0871('0x1'));module['exports']={'closed':{'type':Sequelize[_0x0871('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x0871('0x3')]},'disposition':{'type':Sequelize[_0x0871('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x0871('0x4')]},'note':{'type':Sequelize[_0x0871('0x4')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x0871('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x0871('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x0871('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x0871('0x6')]('in',_0x0871('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x0871('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x0871('0x7')]}}; \ No newline at end of file +var _0x0833=['BOOLEAN','DATE','STRING','ENUM','out','sequelize','moment','exports'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x0833,0x1bd));var _0x3083=function(_0x51ded0,_0x45b05b){_0x51ded0=_0x51ded0-0x0;var _0x492c4f=_0x0833[_0x51ded0];return _0x492c4f;};'use strict';var Sequelize=require(_0x3083('0x0'));var moment=require(_0x3083('0x1'));module[_0x3083('0x2')]={'closed':{'type':Sequelize[_0x3083('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x3083('0x4')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x3083('0x5')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x3083('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x3083('0x6')]('in',_0x3083('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x3083('0x6')]('in',_0x3083('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index 62ec1e8..2254137 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 _0x54b7=['join','root','files','push','User','Contact','Messages','createdAt','direction','secret','read','SmsAccount','Account','fullname','get','mkdirSync','Sms','Owner','N.A.','closedAt','disposition','System','lastName','out','value','renderFile','server','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','moment','bluebird','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/export/pdf','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','offset','undefined','limit','count','Content-Range','json','update','then','destroy','error','stack','name','send','index','SmsInteraction','type','key','findAll','sms','query','user','catch','show','params','keys','model','attributes','intersection','fields','length','includeAll','include','options','find','create','body','describe','SmsMessage','addMessage','ids','omit','getMessages','findOne','rawAttributes','filters','nolimit','order','sort','where','pick','filter','merge','map','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','setTags','color','emit','removeTags','download','unix','toString'];(function(_0x45346d,_0xffd56b){var _0x5ce7ca=function(_0x27ce87){while(--_0x27ce87){_0x45346d['push'](_0x45346d['shift']());}};_0x5ce7ca(++_0xffd56b);}(_0x54b7,0x187));var _0x754b=function(_0x26f821,_0x30175b){_0x26f821=_0x26f821-0x0;var _0x4af27f=_0x54b7[_0x26f821];return _0x4af27f;};'use strict';var rimraf=require('rimraf');var zipdir=require('zip-dir');var moment=require(_0x754b('0x0'));var BPromise=require(_0x754b('0x1'));var util=require(_0x754b('0x2'));var path=require(_0x754b('0x3'));var ejs=require(_0x754b('0x4'));var fs=require('fs');var _=require(_0x754b('0x5'));var Redis=require(_0x754b('0x6'));var interaction=require(_0x754b('0x7'));var qs=require('../../components/parsers/qs');var pdf=require(_0x754b('0x8'));var logger=require('../../config/logger')(_0x754b('0x9'));var config=require(_0x754b('0xa'));var db=require(_0x754b('0xb'))['db'];config[_0x754b('0xc')]=_[_0x754b('0xd')](config[_0x754b('0xc')],{'host':_0x754b('0xe'),'port':0x18eb});var socket=require(_0x754b('0xf'))(new Redis(config[_0x754b('0xc')]));require('./smsInteraction.socket')[_0x754b('0x10')](socket);function respondWithStatusCode(_0x4b117e,_0x23aa4e){_0x23aa4e=_0x23aa4e||0xcc;return function(_0x47cb46){if(_0x47cb46){return _0x4b117e[_0x754b('0x11')](_0x23aa4e);}return _0x4b117e[_0x754b('0x12')](_0x23aa4e)['end']();};}function respondWithResult(_0x2b3c10,_0x48a2c3){_0x48a2c3=_0x48a2c3||0xc8;return function(_0x28a3cd){if(_0x28a3cd){return _0x2b3c10[_0x754b('0x12')](_0x48a2c3)['json'](_0x28a3cd);}};}function respondWithFilteredResult(_0x34cda6,_0x3ce4a8){return function(_0x45ff82){if(_0x45ff82){var _0x466d36=typeof _0x3ce4a8[_0x754b('0x13')]===_0x754b('0x14')&&typeof _0x3ce4a8[_0x754b('0x15')]==='undefined';var _0xa2c5c1=_0x45ff82[_0x754b('0x16')];var _0x16a350=_0x466d36?0x0:_0x3ce4a8[_0x754b('0x13')];var _0x43569d=_0x466d36?_0x45ff82[_0x754b('0x16')]:_0x3ce4a8['offset']+_0x3ce4a8['limit'];var _0x3a6688;if(_0x43569d>=_0xa2c5c1){_0x43569d=_0xa2c5c1;_0x3a6688=0xc8;}else{_0x3a6688=0xce;}_0x34cda6['status'](_0x3a6688);return _0x34cda6['set'](_0x754b('0x17'),_0x16a350+'-'+_0x43569d+'/'+_0xa2c5c1)[_0x754b('0x18')](_0x45ff82);}return null;};}function saveUpdates(_0x20dd16){return function(_0x242683){if(_0x242683){return _0x242683[_0x754b('0x19')](_0x20dd16)[_0x754b('0x1a')](function(_0x1a923d){return _0x1a923d;});}return null;};}function removeEntity(_0x3d4652){return function(_0x489486){if(_0x489486){return _0x489486[_0x754b('0x1b')]()[_0x754b('0x1a')](function(){_0x3d4652[_0x754b('0x12')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4245fb){return function(_0x1eb097){if(!_0x1eb097){_0x4245fb[_0x754b('0x11')](0x194);}return _0x1eb097;};}function handleError(_0x30c659,_0x326a4f){_0x326a4f=_0x326a4f||0x1f4;return function(_0x292a64){logger[_0x754b('0x1c')](_0x292a64[_0x754b('0x1d')]);if(_0x292a64[_0x754b('0x1e')]){delete _0x292a64[_0x754b('0x1e')];}_0x30c659[_0x754b('0x12')](_0x326a4f)[_0x754b('0x1f')](_0x292a64);};}exports[_0x754b('0x20')]=function(_0x68676d,_0x543285){var _0xb39f22={};var _0x7df335=_['map'](db[_0x754b('0x21')]['rawAttributes'],function(_0x246916){return{'name':_0x246916['fieldName'],'type':_0x246916[_0x754b('0x22')][_0x754b('0x23')]};});_0xb39f22=qs['getOptions'](_0x7df335,_0x68676d);return interaction[_0x754b('0x24')](_0x754b('0x25'),_0x68676d[_0x754b('0x26')],_0x68676d[_0x754b('0x27')],_0xb39f22,_0x7df335)['then'](respondWithFilteredResult(_0x543285,_0xb39f22))[_0x754b('0x28')](handleError(_0x543285,null));};exports[_0x754b('0x29')]=function(_0x1a7fd4,_0x2b908b){var _0x5804c8={'raw':![],'where':{'id':_0x1a7fd4[_0x754b('0x2a')]['id']}},_0x3de909={};_0x3de909['model']=_[_0x754b('0x2b')](db['SmsInteraction']['rawAttributes']);_0x3de909[_0x754b('0x26')]=_[_0x754b('0x2b')](_0x1a7fd4['query']);_0x3de909['filters']=_['intersection'](_0x3de909[_0x754b('0x2c')],_0x3de909[_0x754b('0x26')]);_0x5804c8[_0x754b('0x2d')]=_[_0x754b('0x2e')](_0x3de909['model'],qs['fields'](_0x1a7fd4['query'][_0x754b('0x2f')]));_0x5804c8[_0x754b('0x2d')]=_0x5804c8[_0x754b('0x2d')][_0x754b('0x30')]?_0x5804c8[_0x754b('0x2d')]:_0x3de909['model'];if(_0x1a7fd4[_0x754b('0x26')][_0x754b('0x31')]){_0x5804c8[_0x754b('0x32')]=[{'all':!![]}];}_0x5804c8=_['merge']({},_0x5804c8,_0x1a7fd4[_0x754b('0x33')]);return db[_0x754b('0x21')][_0x754b('0x34')](_0x5804c8)[_0x754b('0x1a')](handleEntityNotFound(_0x2b908b,null))[_0x754b('0x1a')](respondWithResult(_0x2b908b,null))[_0x754b('0x28')](handleError(_0x2b908b,null));};exports[_0x754b('0x35')]=function(_0x3a905e,_0xf9b848){return db[_0x754b('0x21')][_0x754b('0x35')](_0x3a905e[_0x754b('0x36')],{})['then'](respondWithResult(_0xf9b848,0xc9))[_0x754b('0x28')](handleError(_0xf9b848,null));};exports[_0x754b('0x19')]=function(_0x1a320e,_0x137463){if(_0x1a320e['body']['id']){delete _0x1a320e['body']['id'];}return db[_0x754b('0x21')][_0x754b('0x34')]({'where':{'id':_0x1a320e[_0x754b('0x2a')]['id']}})[_0x754b('0x1a')](handleEntityNotFound(_0x137463,null))[_0x754b('0x1a')](saveUpdates(_0x1a320e[_0x754b('0x36')],null))[_0x754b('0x1a')](respondWithResult(_0x137463,null))[_0x754b('0x28')](handleError(_0x137463,null));};exports['destroy']=function(_0xae4e57,_0x46a9b8){return db['SmsInteraction']['find']({'where':{'id':_0xae4e57['params']['id']}})[_0x754b('0x1a')](handleEntityNotFound(_0x46a9b8,null))[_0x754b('0x1a')](removeEntity(_0x46a9b8,null))[_0x754b('0x28')](handleError(_0x46a9b8,null));};exports['describe']=function(_0x497738,_0x1a55be){return db[_0x754b('0x21')][_0x754b('0x37')]()[_0x754b('0x1a')](respondWithResult(_0x1a55be,null))[_0x754b('0x28')](handleError(_0x1a55be,null));};exports['addMessage']=function(_0x57db85,_0x24ebce){return db[_0x754b('0x38')][_0x754b('0x34')]({'where':{'id':_0x57db85[_0x754b('0x2a')]['id']}})[_0x754b('0x1a')](handleEntityNotFound(_0x24ebce,null))[_0x754b('0x1a')](function(_0x21b230){if(_0x21b230){return _0x21b230[_0x754b('0x39')](_0x57db85[_0x754b('0x36')][_0x754b('0x3a')],_[_0x754b('0x3b')](_0x57db85[_0x754b('0x36')],[_0x754b('0x3a'),'id'])||{});}})['then'](respondWithResult(_0x24ebce,null))[_0x754b('0x28')](handleError(_0x24ebce,null));};exports[_0x754b('0x3c')]=function(_0x5d4c87,_0x95f9da){var _0x579fb4={'raw':![],'where':{}};var _0x54b71e={};var _0x26e1b4={'count':0x0,'rows':[]};return db[_0x754b('0x21')][_0x754b('0x3d')]({'where':{'id':_0x5d4c87[_0x754b('0x2a')]['id']}})[_0x754b('0x1a')](handleEntityNotFound(_0x95f9da,null))[_0x754b('0x1a')](function(_0x35fa51){if(_0x35fa51){_0x54b71e[_0x754b('0x2c')]=_[_0x754b('0x2b')](db[_0x754b('0x38')][_0x754b('0x3e')]);_0x54b71e[_0x754b('0x26')]=_[_0x754b('0x2b')](_0x5d4c87[_0x754b('0x26')]);_0x54b71e[_0x754b('0x3f')]=_[_0x754b('0x2e')](_0x54b71e[_0x754b('0x2c')],_0x54b71e['query']);_0x579fb4[_0x754b('0x2d')]=_[_0x754b('0x2e')](_0x54b71e['model'],qs[_0x754b('0x2f')](_0x5d4c87[_0x754b('0x26')][_0x754b('0x2f')]));_0x579fb4[_0x754b('0x2d')]=_0x579fb4[_0x754b('0x2d')]['length']?_0x579fb4[_0x754b('0x2d')]:_0x54b71e[_0x754b('0x2c')];if(!_0x5d4c87['query']['hasOwnProperty'](_0x754b('0x40'))){_0x579fb4['limit']=qs['limit'](_0x5d4c87[_0x754b('0x26')]['limit']);_0x579fb4[_0x754b('0x13')]=qs[_0x754b('0x13')](_0x5d4c87['query'][_0x754b('0x13')]);}_0x579fb4[_0x754b('0x41')]=qs['sort'](_0x5d4c87[_0x754b('0x26')][_0x754b('0x42')]);_0x579fb4[_0x754b('0x43')]=qs[_0x754b('0x3f')](_[_0x754b('0x44')](_0x5d4c87[_0x754b('0x26')],_0x54b71e[_0x754b('0x3f')]));_0x579fb4[_0x754b('0x43')]['SmsInteractionId']=_0x35fa51['id'];if(_0x5d4c87[_0x754b('0x26')][_0x754b('0x45')]){_0x579fb4[_0x754b('0x43')]=_[_0x754b('0x46')](_0x579fb4[_0x754b('0x43')],{'$or':_[_0x754b('0x47')](_0x579fb4[_0x754b('0x2d')],function(_0x4cbfd0){var _0x448203={};_0x448203[_0x4cbfd0]={'$like':'%'+_0x5d4c87[_0x754b('0x26')][_0x754b('0x45')]+'%'};return _0x448203;})});}if(_0x5d4c87[_0x754b('0x26')][_0x754b('0x48')]){var _0x33de60=_0x5d4c87[_0x754b('0x26')]['$gte'][_0x754b('0x49')](',');var _0x21e5e4={};_0x21e5e4[_0x33de60[0x0]]={'$gte':moment(_0x33de60[0x1])[_0x754b('0x4a')](_0x754b('0x4b'))};_0x579fb4['where']=_[_0x754b('0x46')](_0x579fb4[_0x754b('0x43')],_0x21e5e4);}_0x579fb4=_[_0x754b('0x46')]({},_0x579fb4,_0x5d4c87[_0x754b('0x33')]);return db[_0x754b('0x38')][_0x754b('0x16')]({'where':_0x579fb4[_0x754b('0x43')]})[_0x754b('0x1a')](function(_0x7adb54){_0x26e1b4[_0x754b('0x16')]=_0x7adb54;if(_0x5d4c87[_0x754b('0x26')]['includeAll']){_0x579fb4[_0x754b('0x32')]=[{'all':!![]}];}return db[_0x754b('0x38')]['findAll'](_0x579fb4);})['then'](function(_0x1acbff){_0x26e1b4[_0x754b('0x4c')]=_0x1acbff;return _0x26e1b4;});}})[_0x754b('0x1a')](respondWithFilteredResult(_0x95f9da,_0x579fb4))['catch'](handleError(_0x95f9da,null));};exports[_0x754b('0x4d')]=function(_0x37bb88,_0x109779){return db[_0x754b('0x21')][_0x754b('0x34')]({'where':{'id':_0x37bb88['params']['id']}})['then'](handleEntityNotFound(_0x109779,null))[_0x754b('0x1a')](function(_0x37aafb){if(_0x37aafb){return _0x37aafb[_0x754b('0x4e')](_0x37bb88[_0x754b('0x36')][_0x754b('0x3a')],_[_0x754b('0x3b')](_0x37bb88[_0x754b('0x36')],[_0x754b('0x3a'),'id'])||{})['spread'](function(){return db['Tag'][_0x754b('0x24')]({'attributes':['id','name',_0x754b('0x4f')],'where':{'id':_0x37bb88[_0x754b('0x36')][_0x754b('0x3a')]}});})[_0x754b('0x1a')](function(_0x454081){socket[_0x754b('0x50')]('smsInteractionTags:save',{'id':Number(_0x37bb88[_0x754b('0x2a')]['id']),'tags':_0x454081||[]});return{'id':Number(_0x37bb88[_0x754b('0x2a')]['id']),'tags':_0x454081||[]};});}})[_0x754b('0x1a')](respondWithResult(_0x109779,null))[_0x754b('0x28')](handleError(_0x109779,null));};exports[_0x754b('0x51')]=function(_0x29df18,_0x2e4404){return db[_0x754b('0x21')][_0x754b('0x34')]({'where':{'id':_0x29df18[_0x754b('0x2a')]['id']}})[_0x754b('0x1a')](handleEntityNotFound(_0x2e4404,null))['then'](function(_0x3210b4){if(_0x3210b4){return _0x3210b4[_0x754b('0x51')](_0x29df18['query'][_0x754b('0x3a')]);}})[_0x754b('0x1a')](respondWithStatusCode(_0x2e4404,null))['catch'](handleError(_0x2e4404,null));};exports[_0x754b('0x52')]=function(_0x16d9a3,_0x1e6937){var _0x5c18d2=moment()[_0x754b('0x53')]()[_0x754b('0x54')]();var _0x48b0f5=path[_0x754b('0x55')](config[_0x754b('0x56')],'server',_0x754b('0x57'),'tmp');var _0x5ec3c7=path[_0x754b('0x55')](_0x48b0f5,_0x5c18d2);var _0x7a4b18=util['format']('transcript-%d-%s.zip',_0x16d9a3['params']['id'],_0x5c18d2);var _0x233ec5=path[_0x754b('0x55')](_0x48b0f5,_0x7a4b18);var _0x5abe9a=[];_0x5abe9a[_0x754b('0x58')]({'model':db[_0x754b('0x59')],'as':_0x754b('0x59'),'attributes':['id','fullname'],'raw':!![]});_0x5abe9a[_0x754b('0x58')]({'model':db['CmContact'],'as':_0x754b('0x5a'),'attributes':['id','firstName','lastName'],'raw':!![]});var _0x1e2faf=[{'model':db[_0x754b('0x38')],'as':_0x754b('0x5b'),'attributes':['id','body',_0x754b('0x5c'),_0x754b('0x5d'),_0x754b('0x5e'),_0x754b('0x5f')],'include':_0x5abe9a}];_0x1e2faf[_0x754b('0x58')]({'model':db[_0x754b('0x60')],'as':_0x754b('0x61'),'attributes':['id','name']});_0x1e2faf['push']({'model':db['User'],'as':'Owner','attributes':['id',_0x754b('0x62')]});return db[_0x754b('0x21')][_0x754b('0x34')]({'where':{'id':_0x16d9a3[_0x754b('0x2a')]['id']},'include':_0x1e2faf})[_0x754b('0x1a')](handleEntityNotFound(_0x1e6937,null))[_0x754b('0x1a')](function(_0x1fc221){if(_0x1fc221){var _0x2254c0=_0x1fc221[_0x754b('0x63')]({'plain':!![]});fs[_0x754b('0x64')](_0x5ec3c7);var _0x5471f7={'channel':_0x754b('0x65'),'account':_0x2254c0[_0x754b('0x61')][_0x754b('0x1e')],'agent':_0x2254c0[_0x754b('0x66')]?_0x2254c0['Owner'][_0x754b('0x62')]:_0x754b('0x67'),'createdAt':moment(_0x2254c0['createdAt'])[_0x754b('0x4a')](_0x754b('0x4b'))[_0x754b('0x54')](),'closedAt':_0x2254c0['closed']?moment(_0x2254c0[_0x754b('0x68')])['format'](_0x754b('0x4b'))[_0x754b('0x54')]():'','disposition':_0x2254c0[_0x754b('0x69')],'messages':_(_0x2254c0[_0x754b('0x5b')])[_0x754b('0x45')]({'secret':![]})[_0x754b('0x47')](function(_0x25df6e){return{'date':moment(_0x25df6e[_0x754b('0x5c')])[_0x754b('0x4a')](_0x754b('0x4b'))[_0x754b('0x54')](),'sender':_0x25df6e[_0x754b('0x5d')]==='out'?_0x25df6e['User']?_0x25df6e['User']['fullname']:_0x754b('0x6a'):_0x25df6e[_0x754b('0x5a')]['firstName']+(_0x25df6e[_0x754b('0x5a')][_0x754b('0x6b')]?'\x20'+_0x25df6e[_0x754b('0x5a')][_0x754b('0x6b')]:''),'body':_0x25df6e[_0x754b('0x36')],'direction':_0x25df6e['direction']===_0x754b('0x6c')?'A':'C','secret':_0x25df6e[_0x754b('0x5e')],'read':_0x25df6e['read']};})[_0x754b('0x6d')]()};return ejs[_0x754b('0x6e')](path[_0x754b('0x55')](config[_0x754b('0x56')],_0x754b('0x6f'),'views',_0x754b('0x70')),{'interaction':_0x5471f7})[_0x754b('0x1a')](function(_0x443494){var _0x5131e1=path[_0x754b('0x55')](_0x5ec3c7,_0x754b('0x71')+_0x2254c0['id']+'-'+_0x5c18d2+_0x754b('0x72'));var _0x6531cf={'path':_0x5131e1,'channel':_0x754b('0x65'),'interactionId':_0x2254c0['id']};return pdf[_0x754b('0x73')](_0x443494,_0x6531cf);})['then'](function(){return new BPromise(function(_0x463b14,_0xc040f8){zipdir(_0x5ec3c7,{'saveTo':_0x233ec5},function(_0x13ae2a,_0x2d7098){if(_0x13ae2a)return _0xc040f8(_0x13ae2a);return _0x463b14(_0x2d7098);});})[_0x754b('0x1a')](function(){return new BPromise(function(_0x5b3274,_0x54b127){rimraf(_0x5ec3c7,function(_0x282b13){if(_0x282b13)_0x54b127(_0x282b13);return _0x5b3274();});});})[_0x754b('0x1a')](function(){return _0x1e6937[_0x754b('0x52')](_0x233ec5,_0x7a4b18,function(_0xea2305){if(_0xea2305){console[_0x754b('0x74')](_0x754b('0x75'),_0xea2305);}else{fs[_0x754b('0x76')](_0x233ec5);}});});});}else{return _0x1e6937[_0x754b('0x11')](0xc8);}})['catch'](handleError(_0x1e6937,null));}; \ No newline at end of file +var _0x76a5=['lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','socket.io-emitter','./smsInteraction.socket','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','update','then','destroy','error','name','send','index','map','rawAttributes','fieldName','type','key','findAll','query','user','catch','show','model','keys','SmsInteraction','filters','intersection','attributes','fields','length','merge','options','find','body','params','describe','addMessage','SmsMessage','ids','getMessages','findOne','hasOwnProperty','nolimit','sort','where','pick','SmsInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','include','rows','addTags','setTags','spread','color','smsInteractionTags:save','removeTags','download','unix','toString','join','root','tmp','transcript-%d-%s.zip','push','User','fullname','CmContact','Contact','firstName','Messages','direction','secret','read','SmsAccount','Account','Owner','get','mkdirSync','Sms','createdAt','closed','closedAt','out','System','lastName','value','renderFile','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','log','err','unlinkSync','zip-dir','util','path','ejs'];(function(_0x451de4,_0x35bc19){var _0x32ccfc=function(_0x47d468){while(--_0x47d468){_0x451de4['push'](_0x451de4['shift']());}};_0x32ccfc(++_0x35bc19);}(_0x76a5,0x74));var _0x576a=function(_0x4ccc2d,_0x437454){_0x4ccc2d=_0x4ccc2d-0x0;var _0x3284ae=_0x76a5[_0x4ccc2d];return _0x3284ae;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x576a('0x0'));var moment=require('moment');var BPromise=require('bluebird');var util=require(_0x576a('0x1'));var path=require(_0x576a('0x2'));var ejs=require(_0x576a('0x3'));var fs=require('fs');var _=require(_0x576a('0x4'));var Redis=require(_0x576a('0x5'));var interaction=require(_0x576a('0x6'));var qs=require(_0x576a('0x7'));var pdf=require(_0x576a('0x8'));var logger=require(_0x576a('0x9'))(_0x576a('0xa'));var config=require(_0x576a('0xb'));var db=require(_0x576a('0xc'))['db'];config[_0x576a('0xd')]=_['defaults'](config[_0x576a('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x576a('0xe'))(new Redis(config[_0x576a('0xd')]));require(_0x576a('0xf'))['register'](socket);function respondWithStatusCode(_0x1d7dd6,_0x10ef4e){_0x10ef4e=_0x10ef4e||0xcc;return function(_0x2e9823){if(_0x2e9823){return _0x1d7dd6[_0x576a('0x10')](_0x10ef4e);}return _0x1d7dd6['status'](_0x10ef4e)[_0x576a('0x11')]();};}function respondWithResult(_0x1623e2,_0x3bdfa9){_0x3bdfa9=_0x3bdfa9||0xc8;return function(_0x50309a){if(_0x50309a){return _0x1623e2[_0x576a('0x12')](_0x3bdfa9)[_0x576a('0x13')](_0x50309a);}};}function respondWithFilteredResult(_0x4f1e44,_0x304e27){return function(_0x3826cc){if(_0x3826cc){var _0x21111e=typeof _0x304e27[_0x576a('0x14')]==='undefined'&&typeof _0x304e27['limit']===_0x576a('0x15');var _0x2548da=_0x3826cc['count'];var _0x19f26b=_0x21111e?0x0:_0x304e27['offset'];var _0x415b9c=_0x21111e?_0x3826cc[_0x576a('0x16')]:_0x304e27[_0x576a('0x14')]+_0x304e27[_0x576a('0x17')];var _0x60c7d9;if(_0x415b9c>=_0x2548da){_0x415b9c=_0x2548da;_0x60c7d9=0xc8;}else{_0x60c7d9=0xce;}_0x4f1e44[_0x576a('0x12')](_0x60c7d9);return _0x4f1e44[_0x576a('0x18')](_0x576a('0x19'),_0x19f26b+'-'+_0x415b9c+'/'+_0x2548da)[_0x576a('0x13')](_0x3826cc);}return null;};}function saveUpdates(_0x4697de){return function(_0x2a39a5){if(_0x2a39a5){return _0x2a39a5[_0x576a('0x1a')](_0x4697de)[_0x576a('0x1b')](function(_0x995abf){return _0x995abf;});}return null;};}function removeEntity(_0x1ee08d){return function(_0x29284e){if(_0x29284e){return _0x29284e[_0x576a('0x1c')]()[_0x576a('0x1b')](function(){_0x1ee08d[_0x576a('0x12')](0xcc)[_0x576a('0x11')]();});}};}function handleEntityNotFound(_0x5d95e3){return function(_0x35713a){if(!_0x35713a){_0x5d95e3[_0x576a('0x10')](0x194);}return _0x35713a;};}function handleError(_0x8aefaf,_0x37dd51){_0x37dd51=_0x37dd51||0x1f4;return function(_0x3d8650){logger[_0x576a('0x1d')](_0x3d8650['stack']);if(_0x3d8650[_0x576a('0x1e')]){delete _0x3d8650[_0x576a('0x1e')];}_0x8aefaf[_0x576a('0x12')](_0x37dd51)[_0x576a('0x1f')](_0x3d8650);};}exports[_0x576a('0x20')]=function(_0x3dcfa8,_0x542dfe){var _0x3fff5e={};var _0x34a0aa=_[_0x576a('0x21')](db['SmsInteraction'][_0x576a('0x22')],function(_0x50f92a){return{'name':_0x50f92a[_0x576a('0x23')],'type':_0x50f92a[_0x576a('0x24')][_0x576a('0x25')]};});_0x3fff5e=qs['getOptions'](_0x34a0aa,_0x3dcfa8);return interaction[_0x576a('0x26')]('sms',_0x3dcfa8[_0x576a('0x27')],_0x3dcfa8[_0x576a('0x28')],_0x3fff5e,_0x34a0aa)[_0x576a('0x1b')](respondWithFilteredResult(_0x542dfe,_0x3fff5e))[_0x576a('0x29')](handleError(_0x542dfe,null));};exports[_0x576a('0x2a')]=function(_0x51058a,_0x302ad4){var _0x307893={'raw':![],'where':{'id':_0x51058a['params']['id']}},_0x1a9f83={};_0x1a9f83[_0x576a('0x2b')]=_[_0x576a('0x2c')](db[_0x576a('0x2d')][_0x576a('0x22')]);_0x1a9f83[_0x576a('0x27')]=_[_0x576a('0x2c')](_0x51058a[_0x576a('0x27')]);_0x1a9f83[_0x576a('0x2e')]=_[_0x576a('0x2f')](_0x1a9f83[_0x576a('0x2b')],_0x1a9f83[_0x576a('0x27')]);_0x307893[_0x576a('0x30')]=_[_0x576a('0x2f')](_0x1a9f83[_0x576a('0x2b')],qs[_0x576a('0x31')](_0x51058a['query'][_0x576a('0x31')]));_0x307893[_0x576a('0x30')]=_0x307893[_0x576a('0x30')][_0x576a('0x32')]?_0x307893[_0x576a('0x30')]:_0x1a9f83['model'];if(_0x51058a[_0x576a('0x27')]['includeAll']){_0x307893['include']=[{'all':!![]}];}_0x307893=_[_0x576a('0x33')]({},_0x307893,_0x51058a[_0x576a('0x34')]);return db[_0x576a('0x2d')][_0x576a('0x35')](_0x307893)[_0x576a('0x1b')](handleEntityNotFound(_0x302ad4,null))['then'](respondWithResult(_0x302ad4,null))[_0x576a('0x29')](handleError(_0x302ad4,null));};exports['create']=function(_0x201f1e,_0xc31bb5){return db[_0x576a('0x2d')]['create'](_0x201f1e[_0x576a('0x36')],{})[_0x576a('0x1b')](respondWithResult(_0xc31bb5,0xc9))[_0x576a('0x29')](handleError(_0xc31bb5,null));};exports[_0x576a('0x1a')]=function(_0x3b3e17,_0x2288f6){if(_0x3b3e17['body']['id']){delete _0x3b3e17[_0x576a('0x36')]['id'];}return db[_0x576a('0x2d')][_0x576a('0x35')]({'where':{'id':_0x3b3e17['params']['id']}})[_0x576a('0x1b')](handleEntityNotFound(_0x2288f6,null))[_0x576a('0x1b')](saveUpdates(_0x3b3e17[_0x576a('0x36')],null))[_0x576a('0x1b')](respondWithResult(_0x2288f6,null))[_0x576a('0x29')](handleError(_0x2288f6,null));};exports[_0x576a('0x1c')]=function(_0x4d230d,_0x1d6362){return db['SmsInteraction'][_0x576a('0x35')]({'where':{'id':_0x4d230d[_0x576a('0x37')]['id']}})[_0x576a('0x1b')](handleEntityNotFound(_0x1d6362,null))[_0x576a('0x1b')](removeEntity(_0x1d6362,null))['catch'](handleError(_0x1d6362,null));};exports[_0x576a('0x38')]=function(_0x325e4b,_0x23d76d){return db[_0x576a('0x2d')][_0x576a('0x38')]()[_0x576a('0x1b')](respondWithResult(_0x23d76d,null))[_0x576a('0x29')](handleError(_0x23d76d,null));};exports[_0x576a('0x39')]=function(_0x3952d7,_0xc53048){return db[_0x576a('0x3a')][_0x576a('0x35')]({'where':{'id':_0x3952d7['params']['id']}})[_0x576a('0x1b')](handleEntityNotFound(_0xc53048,null))[_0x576a('0x1b')](function(_0x4f5218){if(_0x4f5218){return _0x4f5218['addMessage'](_0x3952d7[_0x576a('0x36')][_0x576a('0x3b')],_['omit'](_0x3952d7[_0x576a('0x36')],[_0x576a('0x3b'),'id'])||{});}})[_0x576a('0x1b')](respondWithResult(_0xc53048,null))[_0x576a('0x29')](handleError(_0xc53048,null));};exports[_0x576a('0x3c')]=function(_0x5d25e3,_0x261277){var _0x2f3537={'raw':![],'where':{}};var _0x4048be={};var _0x1bfc34={'count':0x0,'rows':[]};return db[_0x576a('0x2d')][_0x576a('0x3d')]({'where':{'id':_0x5d25e3['params']['id']}})[_0x576a('0x1b')](handleEntityNotFound(_0x261277,null))[_0x576a('0x1b')](function(_0x38e2ab){if(_0x38e2ab){_0x4048be[_0x576a('0x2b')]=_['keys'](db[_0x576a('0x3a')][_0x576a('0x22')]);_0x4048be[_0x576a('0x27')]=_[_0x576a('0x2c')](_0x5d25e3[_0x576a('0x27')]);_0x4048be[_0x576a('0x2e')]=_[_0x576a('0x2f')](_0x4048be[_0x576a('0x2b')],_0x4048be[_0x576a('0x27')]);_0x2f3537['attributes']=_[_0x576a('0x2f')](_0x4048be['model'],qs[_0x576a('0x31')](_0x5d25e3[_0x576a('0x27')][_0x576a('0x31')]));_0x2f3537[_0x576a('0x30')]=_0x2f3537[_0x576a('0x30')]['length']?_0x2f3537[_0x576a('0x30')]:_0x4048be[_0x576a('0x2b')];if(!_0x5d25e3[_0x576a('0x27')][_0x576a('0x3e')](_0x576a('0x3f'))){_0x2f3537[_0x576a('0x17')]=qs[_0x576a('0x17')](_0x5d25e3['query']['limit']);_0x2f3537[_0x576a('0x14')]=qs[_0x576a('0x14')](_0x5d25e3[_0x576a('0x27')][_0x576a('0x14')]);}_0x2f3537['order']=qs[_0x576a('0x40')](_0x5d25e3[_0x576a('0x27')]['sort']);_0x2f3537[_0x576a('0x41')]=qs[_0x576a('0x2e')](_[_0x576a('0x42')](_0x5d25e3['query'],_0x4048be[_0x576a('0x2e')]));_0x2f3537[_0x576a('0x41')][_0x576a('0x43')]=_0x38e2ab['id'];if(_0x5d25e3['query'][_0x576a('0x44')]){_0x2f3537['where']=_[_0x576a('0x33')](_0x2f3537[_0x576a('0x41')],{'$or':_['map'](_0x2f3537[_0x576a('0x30')],function(_0x4bbde0){var _0x42e3e5={};_0x42e3e5[_0x4bbde0]={'$like':'%'+_0x5d25e3[_0x576a('0x27')][_0x576a('0x44')]+'%'};return _0x42e3e5;})});}if(_0x5d25e3[_0x576a('0x27')][_0x576a('0x45')]){var _0x48b25e=_0x5d25e3['query'][_0x576a('0x45')][_0x576a('0x46')](',');var _0x190274={};_0x190274[_0x48b25e[0x0]]={'$gte':moment(_0x48b25e[0x1])[_0x576a('0x47')](_0x576a('0x48'))};_0x2f3537[_0x576a('0x41')]=_[_0x576a('0x33')](_0x2f3537[_0x576a('0x41')],_0x190274);}_0x2f3537=_['merge']({},_0x2f3537,_0x5d25e3[_0x576a('0x34')]);return db[_0x576a('0x3a')][_0x576a('0x16')]({'where':_0x2f3537[_0x576a('0x41')]})[_0x576a('0x1b')](function(_0x5aaf72){_0x1bfc34[_0x576a('0x16')]=_0x5aaf72;if(_0x5d25e3[_0x576a('0x27')][_0x576a('0x49')]){_0x2f3537[_0x576a('0x4a')]=[{'all':!![]}];}return db['SmsMessage'][_0x576a('0x26')](_0x2f3537);})[_0x576a('0x1b')](function(_0x23f723){_0x1bfc34[_0x576a('0x4b')]=_0x23f723;return _0x1bfc34;});}})['then'](respondWithFilteredResult(_0x261277,_0x2f3537))[_0x576a('0x29')](handleError(_0x261277,null));};exports[_0x576a('0x4c')]=function(_0x3cdfe9,_0x180ea9){return db[_0x576a('0x2d')][_0x576a('0x35')]({'where':{'id':_0x3cdfe9[_0x576a('0x37')]['id']}})['then'](handleEntityNotFound(_0x180ea9,null))['then'](function(_0xa01f08){if(_0xa01f08){return _0xa01f08[_0x576a('0x4d')](_0x3cdfe9[_0x576a('0x36')][_0x576a('0x3b')],_['omit'](_0x3cdfe9[_0x576a('0x36')],[_0x576a('0x3b'),'id'])||{})[_0x576a('0x4e')](function(){return db['Tag']['findAll']({'attributes':['id',_0x576a('0x1e'),_0x576a('0x4f')],'where':{'id':_0x3cdfe9[_0x576a('0x36')][_0x576a('0x3b')]}});})[_0x576a('0x1b')](function(_0x303fe7){socket['emit'](_0x576a('0x50'),{'id':Number(_0x3cdfe9[_0x576a('0x37')]['id']),'tags':_0x303fe7||[]});return{'id':Number(_0x3cdfe9[_0x576a('0x37')]['id']),'tags':_0x303fe7||[]};});}})['then'](respondWithResult(_0x180ea9,null))[_0x576a('0x29')](handleError(_0x180ea9,null));};exports[_0x576a('0x51')]=function(_0xd376b0,_0xc0b8e9){return db[_0x576a('0x2d')]['find']({'where':{'id':_0xd376b0[_0x576a('0x37')]['id']}})['then'](handleEntityNotFound(_0xc0b8e9,null))['then'](function(_0x5b4c1f){if(_0x5b4c1f){return _0x5b4c1f['removeTags'](_0xd376b0['query'][_0x576a('0x3b')]);}})[_0x576a('0x1b')](respondWithStatusCode(_0xc0b8e9,null))[_0x576a('0x29')](handleError(_0xc0b8e9,null));};exports[_0x576a('0x52')]=function(_0x64ad14,_0x599141){var _0x4051d6=moment()[_0x576a('0x53')]()[_0x576a('0x54')]();var _0x3b2b6a=path[_0x576a('0x55')](config[_0x576a('0x56')],'server','files',_0x576a('0x57'));var _0x2aa641=path[_0x576a('0x55')](_0x3b2b6a,_0x4051d6);var _0x590d91=util[_0x576a('0x47')](_0x576a('0x58'),_0x64ad14[_0x576a('0x37')]['id'],_0x4051d6);var _0x54f089=path[_0x576a('0x55')](_0x3b2b6a,_0x590d91);var _0x315a02=[];_0x315a02[_0x576a('0x59')]({'model':db['User'],'as':_0x576a('0x5a'),'attributes':['id',_0x576a('0x5b')],'raw':!![]});_0x315a02[_0x576a('0x59')]({'model':db[_0x576a('0x5c')],'as':_0x576a('0x5d'),'attributes':['id',_0x576a('0x5e'),'lastName'],'raw':!![]});var _0x39af4a=[{'model':db[_0x576a('0x3a')],'as':_0x576a('0x5f'),'attributes':['id',_0x576a('0x36'),'createdAt',_0x576a('0x60'),_0x576a('0x61'),_0x576a('0x62')],'include':_0x315a02}];_0x39af4a['push']({'model':db[_0x576a('0x63')],'as':_0x576a('0x64'),'attributes':['id',_0x576a('0x1e')]});_0x39af4a[_0x576a('0x59')]({'model':db[_0x576a('0x5a')],'as':_0x576a('0x65'),'attributes':['id','fullname']});return db['SmsInteraction'][_0x576a('0x35')]({'where':{'id':_0x64ad14[_0x576a('0x37')]['id']},'include':_0x39af4a})[_0x576a('0x1b')](handleEntityNotFound(_0x599141,null))[_0x576a('0x1b')](function(_0x1b609b){if(_0x1b609b){var _0x1f873d=_0x1b609b[_0x576a('0x66')]({'plain':!![]});fs[_0x576a('0x67')](_0x2aa641);var _0x3705a2={'channel':_0x576a('0x68'),'account':_0x1f873d[_0x576a('0x64')][_0x576a('0x1e')],'agent':_0x1f873d[_0x576a('0x65')]?_0x1f873d[_0x576a('0x65')][_0x576a('0x5b')]:'N.A.','createdAt':moment(_0x1f873d[_0x576a('0x69')])[_0x576a('0x47')]('YYYY-MM-DD\x20HH:mm:ss')[_0x576a('0x54')](),'closedAt':_0x1f873d[_0x576a('0x6a')]?moment(_0x1f873d[_0x576a('0x6b')])[_0x576a('0x47')](_0x576a('0x48'))[_0x576a('0x54')]():'','disposition':_0x1f873d['disposition'],'messages':_(_0x1f873d[_0x576a('0x5f')])[_0x576a('0x44')]({'secret':![]})[_0x576a('0x21')](function(_0x446221){return{'date':moment(_0x446221[_0x576a('0x69')])[_0x576a('0x47')](_0x576a('0x48'))[_0x576a('0x54')](),'sender':_0x446221[_0x576a('0x60')]===_0x576a('0x6c')?_0x446221[_0x576a('0x5a')]?_0x446221[_0x576a('0x5a')][_0x576a('0x5b')]:_0x576a('0x6d'):_0x446221[_0x576a('0x5d')][_0x576a('0x5e')]+(_0x446221[_0x576a('0x5d')][_0x576a('0x6e')]?'\x20'+_0x446221[_0x576a('0x5d')][_0x576a('0x6e')]:''),'body':_0x446221[_0x576a('0x36')],'direction':_0x446221['direction']===_0x576a('0x6c')?'A':'C','secret':_0x446221[_0x576a('0x61')],'read':_0x446221[_0x576a('0x62')]};})[_0x576a('0x6f')]()};return ejs[_0x576a('0x70')](path[_0x576a('0x55')](config[_0x576a('0x56')],'server',_0x576a('0x71'),_0x576a('0x72')),{'interaction':_0x3705a2})[_0x576a('0x1b')](function(_0x5b2db6){var _0x7c7aec=path[_0x576a('0x55')](_0x2aa641,_0x576a('0x73')+_0x1f873d['id']+'-'+_0x4051d6+'.pdf');var _0x56e535={'path':_0x7c7aec,'channel':_0x576a('0x68'),'interactionId':_0x1f873d['id']};return pdf[_0x576a('0x74')](_0x5b2db6,_0x56e535);})[_0x576a('0x1b')](function(){return new BPromise(function(_0x2b7926,_0x11a72e){zipdir(_0x2aa641,{'saveTo':_0x54f089},function(_0x287795,_0x2acf43){if(_0x287795)return _0x11a72e(_0x287795);return _0x2b7926(_0x2acf43);});})['then'](function(){return new BPromise(function(_0x404c79,_0x883469){rimraf(_0x2aa641,function(_0x3f075f){if(_0x3f075f)_0x883469(_0x3f075f);return _0x404c79();});});})[_0x576a('0x1b')](function(){return _0x599141[_0x576a('0x52')](_0x54f089,_0x590d91,function(_0x5449d6){if(_0x5449d6){console[_0x576a('0x75')](_0x576a('0x76'),_0x5449d6);}else{fs[_0x576a('0x77')](_0x54f089);}});});});}else{return _0x599141[_0x576a('0x10')](0xc8);}})[_0x576a('0x29')](handleError(_0x599141,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 1ddd037..900eec0 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 _0x1893=['SmsInteraction','../../mysqldb','SmsMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports'];(function(_0x31c294,_0xaf0e9d){var _0x33bb5b=function(_0x5eb15c){while(--_0x5eb15c){_0x31c294['push'](_0x31c294['shift']());}};_0x33bb5b(++_0xaf0e9d);}(_0x1893,0xa2));var _0x3189=function(_0xe80e5c,_0x38e90a){_0xe80e5c=_0xe80e5c-0x0;var _0x2bff61=_0x1893[_0xe80e5c];return _0x2bff61;};'use strict';var EventEmitter=require('events');var SmsInteraction=require('../../mysqldb')['db'][_0x3189('0x0')];var SmsMessage=require(_0x3189('0x1'))['db'][_0x3189('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x3189('0x3')](0x0);var events={'afterCreate':_0x3189('0x4'),'afterUpdate':_0x3189('0x5'),'afterDestroy':_0x3189('0x6')};function emitEvent(_0x5371db){return function(_0x27445,_0x4faebf,_0x2333e6){_0x27445[_0x3189('0x7')]({'attributes':['id'],'raw':!![]})[_0x3189('0x8')](function(_0x118970){_0x27445[_0x3189('0x9')](_0x3189('0xa'),_0x118970['map'](function(_0x1d5f6a){return{'id':_0x1d5f6a['id']};}));return SmsMessage['findAll']({'where':{'SmsInteractionId':_0x27445['id'],'direction':'in','read':![]},'raw':!![]});})[_0x3189('0x8')](function(_0x4ac683){_0x27445[_0x3189('0x9')](_0x3189('0xb'),_0x4ac683[_0x3189('0xc')]);SmsInteractionEvents[_0x3189('0xd')](_0x5371db+':'+_0x27445['id'],_0x27445);SmsInteractionEvents['emit'](_0x5371db,_0x27445);_0x2333e6(null);})[_0x3189('0xe')](_0x2333e6(null));};}for(var e in events){if(events[_0x3189('0xf')](e)){var event=events[e];SmsInteraction[_0x3189('0x10')](e,emitEvent(event));}}module[_0x3189('0x11')]=SmsInteractionEvents; \ No newline at end of file +var _0xb78e=['exports','events','../../mysqldb','SmsMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hook'];(function(_0x2d196f,_0x4285d2){var _0x236e3e=function(_0x55f9c0){while(--_0x55f9c0){_0x2d196f['push'](_0x2d196f['shift']());}};_0x236e3e(++_0x4285d2);}(_0xb78e,0x1c9));var _0xeb78=function(_0x5b8e4a,_0x1593f2){_0x5b8e4a=_0x5b8e4a-0x0;var _0x2e79f2=_0xb78e[_0x5b8e4a];return _0x2e79f2;};'use strict';var EventEmitter=require(_0xeb78('0x0'));var SmsInteraction=require(_0xeb78('0x1'))['db']['SmsInteraction'];var SmsMessage=require(_0xeb78('0x1'))['db'][_0xeb78('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0xeb78('0x3')](0x0);var events={'afterCreate':_0xeb78('0x4'),'afterUpdate':_0xeb78('0x5'),'afterDestroy':_0xeb78('0x6')};function emitEvent(_0x13ef9d){return function(_0x1bdf83,_0x57ec6b,_0x3c35e7){_0x1bdf83[_0xeb78('0x7')]({'attributes':['id'],'raw':!![]})[_0xeb78('0x8')](function(_0x30c884){_0x1bdf83[_0xeb78('0x9')](_0xeb78('0xa'),_0x30c884[_0xeb78('0xb')](function(_0x573406){return{'id':_0x573406['id']};}));return SmsMessage[_0xeb78('0xc')]({'where':{'SmsInteractionId':_0x1bdf83['id'],'direction':'in','read':![]},'raw':!![]});})[_0xeb78('0x8')](function(_0xa1ca82){_0x1bdf83[_0xeb78('0x9')](_0xeb78('0xd'),_0xa1ca82[_0xeb78('0xe')]);SmsInteractionEvents[_0xeb78('0xf')](_0x13ef9d+':'+_0x1bdf83['id'],_0x1bdf83);SmsInteractionEvents[_0xeb78('0xf')](_0x13ef9d,_0x1bdf83);_0x3c35e7(null);})[_0xeb78('0x10')](_0x3c35e7(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsInteraction[_0xeb78('0x11')](e,emitEvent(event));}}module[_0xeb78('0x12')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index b5bae66..2a8949b 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 _0x932e=['closedAt','format','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','exports','SmsInteraction','sms_interactions','changed','closed'];(function(_0x1ef78e,_0x17d1d3){var _0x300b2c=function(_0x20ddd8){while(--_0x20ddd8){_0x1ef78e['push'](_0x1ef78e['shift']());}};_0x300b2c(++_0x17d1d3);}(_0x932e,0x160));var _0xe932=function(_0x2ea24b,_0x4b0c5e){_0x2ea24b=_0x2ea24b-0x0;var _0x13b19c=_0x932e[_0x2ea24b];return _0x13b19c;};'use strict';var _=require('lodash');var util=require(_0xe932('0x0'));var logger=require(_0xe932('0x1'))('api');var moment=require(_0xe932('0x2'));var BPromise=require('bluebird');var rp=require(_0xe932('0x3'));var fs=require('fs');var path=require(_0xe932('0x4'));var rimraf=require(_0xe932('0x5'));var config=require(_0xe932('0x6'));var attributes=require('./smsInteraction.attributes');module[_0xe932('0x7')]=function(_0xa55933,_0x1555ba){return _0xa55933['define'](_0xe932('0x8'),attributes,{'tableName':_0xe932('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x691ed2,_0x2a3d08,_0x1c3a2c){if(_0x691ed2[_0xe932('0xa')](_0xe932('0xb'))){_0x691ed2[_0xe932('0xc')]=moment()[_0xe932('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}_0x1c3a2c(null,_0x691ed2);}}});}; \ No newline at end of file +var _0x8ad2=['changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./smsInteraction.attributes','SmsInteraction','sms_interactions'];(function(_0x4f1eb3,_0x58f0b3){var _0x2ae396=function(_0x5c5985){while(--_0x5c5985){_0x4f1eb3['push'](_0x4f1eb3['shift']());}};_0x2ae396(++_0x58f0b3);}(_0x8ad2,0xe4));var _0x28ad=function(_0x1ebb66,_0x37402a){_0x1ebb66=_0x1ebb66-0x0;var _0x3c4300=_0x8ad2[_0x1ebb66];return _0x3c4300;};'use strict';var _=require('lodash');var util=require(_0x28ad('0x0'));var logger=require(_0x28ad('0x1'))('api');var moment=require(_0x28ad('0x2'));var BPromise=require(_0x28ad('0x3'));var rp=require(_0x28ad('0x4'));var fs=require('fs');var path=require(_0x28ad('0x5'));var rimraf=require(_0x28ad('0x6'));var config=require('../../config/environment');var attributes=require(_0x28ad('0x7'));module['exports']=function(_0xfabf1b,_0x14c963){return _0xfabf1b['define'](_0x28ad('0x8'),attributes,{'tableName':_0x28ad('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3b630b,_0x532589,_0xd30228){if(_0x3b630b[_0x28ad('0xa')]('closed')){_0x3b630b[_0x28ad('0xb')]=moment()[_0x28ad('0xc')](_0x28ad('0xd'));}_0xd30228(null,_0x3b630b);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 5089879..0926707 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 _0x5260=['../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','request','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','error','message','UpdateSmsInteraction','update','body','options','where','attributes','limit','then','stringify','AddTagsToSmsInteraction','SmsInteraction','find','ids','omit','spread','AddTags','catch','util','moment','../../mysqldb','../../config/utils'];(function(_0x6eb813,_0x3dc082){var _0x1fd334=function(_0xe861bf){while(--_0xe861bf){_0x6eb813['push'](_0x6eb813['shift']());}};_0x1fd334(++_0x3dc082);}(_0x5260,0x182));var _0x0526=function(_0x25a27f,_0x5d377f){_0x25a27f=_0x25a27f-0x0;var _0x37caaf=_0x5260[_0x25a27f];return _0x37caaf;};'use strict';var _=require('lodash');var util=require(_0x0526('0x0'));var moment=require(_0x0526('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0526('0x2'))['db'];var utils=require(_0x0526('0x3'));var logger=require(_0x0526('0x4'))(_0x0526('0x5'));var config=require(_0x0526('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x0526('0x7')]({'port':0x232a});config[_0x0526('0x8')]=_[_0x0526('0x9')](config[_0x0526('0x8')],{'host':_0x0526('0xa'),'port':0x18eb});var socket=require(_0x0526('0xb'))(new Redis(config['redis']));require(_0x0526('0xc'))[_0x0526('0xd')](socket);function respondWithRpcPromise(_0xabae0c,_0xe622d8,_0x18ea55){return new BPromise(function(_0xf156e4,_0x279110){return client[_0x0526('0xe')](_0xabae0c,_0x18ea55)['then'](function(_0x4c6f46){logger[_0x0526('0xf')](_0x0526('0x10'),_0xe622d8,_0x0526('0x11'));logger[_0x0526('0x12')](_0x0526('0x13'),_0xe622d8,'request\x20sent',JSON['stringify'](_0x4c6f46));if(_0x4c6f46[_0x0526('0x14')]){if(_0x4c6f46[_0x0526('0x14')]['code']===0x1f4){logger[_0x0526('0x14')](_0x0526('0x10'),_0xe622d8,_0x4c6f46['error'][_0x0526('0x15')]);return _0x279110(_0x4c6f46['error'][_0x0526('0x15')]);}logger[_0x0526('0x14')](_0x0526('0x10'),_0xe622d8,_0x4c6f46[_0x0526('0x14')][_0x0526('0x15')]);return _0xf156e4(_0x4c6f46[_0x0526('0x14')][_0x0526('0x15')]);}else{logger[_0x0526('0xf')](_0x0526('0x10'),_0xe622d8,_0x0526('0x11'));_0xf156e4(_0x4c6f46['result'][_0x0526('0x15')]);}})['catch'](function(_0x30ed68){logger[_0x0526('0x14')]('SmsInteraction,\x20%s,\x20%s',_0xe622d8,_0x30ed68);_0x279110(_0x30ed68);});});}exports[_0x0526('0x16')]=function(_0x4e9ee3){var _0x40afc0=this;return new Promise(function(_0x53fdfa,_0x5a0498){return db['SmsInteraction'][_0x0526('0x17')](_0x4e9ee3[_0x0526('0x18')],{'raw':_0x4e9ee3['options']?_0x4e9ee3[_0x0526('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4e9ee3[_0x0526('0x19')]?_0x4e9ee3[_0x0526('0x19')][_0x0526('0x1a')]||null:null,'attributes':_0x4e9ee3[_0x0526('0x19')]?_0x4e9ee3[_0x0526('0x19')][_0x0526('0x1b')]||null:null,'limit':_0x4e9ee3[_0x0526('0x19')]?_0x4e9ee3[_0x0526('0x19')][_0x0526('0x1c')]||null:null})[_0x0526('0x1d')](function(_0x18ce44){logger['info'](_0x0526('0x16'),_0x4e9ee3);logger[_0x0526('0x12')](_0x0526('0x16'),_0x4e9ee3,JSON[_0x0526('0x1e')](_0x18ce44));_0x53fdfa(_0x18ce44);})['catch'](function(_0x434868){logger[_0x0526('0x14')](_0x0526('0x16'),_0x434868[_0x0526('0x15')],_0x4e9ee3);_0x5a0498(_0x40afc0['error'](0x1f4,_0x434868[_0x0526('0x15')]));});});};exports[_0x0526('0x1f')]=function(_0x18e2ae){return new Promise(function(_0x533022,_0x3dd036){return db[_0x0526('0x20')][_0x0526('0x21')]({'where':_0x18e2ae[_0x0526('0x19')]?_0x18e2ae[_0x0526('0x19')][_0x0526('0x1a')]||null:null})[_0x0526('0x1d')](function(_0x1740e6){if(_0x1740e6){return _0x1740e6['addTags'](_0x18e2ae[_0x0526('0x18')][_0x0526('0x22')],_[_0x0526('0x23')](_0x18e2ae[_0x0526('0x18')],[_0x0526('0x22'),'id'])||{});}})[_0x0526('0x24')](function(_0x4dbc21){logger[_0x0526('0xf')](_0x0526('0x25'),_0x18e2ae);logger[_0x0526('0x12')]('AddTags',_0x18e2ae,JSON[_0x0526('0x1e')](_0x4dbc21));_0x533022(_0x4dbc21);})[_0x0526('0x26')](function(_0x960be0){logger['error'](_0x0526('0x25'),_0x960be0[_0x0526('0x15')],_0x18e2ae);_0x3dd036(_this[_0x0526('0x14')](0x1f4,_0x960be0['message']));});});}; \ No newline at end of file +var _0x4e3a=['client','http','redis','./smsInteraction.socket','register','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateSmsInteraction','SmsInteraction','update','body','options','raw','where','limit','then','debug','find','ids','omit','AddTags','bluebird','ioredis','rpc','../../config/environment','jayson/promise'];(function(_0xe0c89b,_0x18cb9d){var _0x3d9162=function(_0x2c4f3b){while(--_0x2c4f3b){_0xe0c89b['push'](_0xe0c89b['shift']());}};_0x3d9162(++_0x18cb9d);}(_0x4e3a,0x83));var _0xa4e3=function(_0xbf171b,_0x21c916){_0xbf171b=_0xbf171b-0x0;var _0x21ab7e=_0x4e3a[_0xbf171b];return _0x21ab7e;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xa4e3('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa4e3('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa4e3('0x2'));var config=require(_0xa4e3('0x3'));var jayson=require(_0xa4e3('0x4'));var client=jayson[_0xa4e3('0x5')][_0xa4e3('0x6')]({'port':0x232a});config[_0xa4e3('0x7')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa4e3('0x7')]));require(_0xa4e3('0x8'))[_0xa4e3('0x9')](socket);function respondWithRpcPromise(_0x2cfb62,_0x3c1e2b,_0x1e7454){return new BPromise(function(_0x209c22,_0x526a47){return client['request'](_0x2cfb62,_0x1e7454)['then'](function(_0x2ed5e1){logger[_0xa4e3('0xa')](_0xa4e3('0xb'),_0x3c1e2b,_0xa4e3('0xc'));logger['debug'](_0xa4e3('0xd'),_0x3c1e2b,_0xa4e3('0xc'),JSON[_0xa4e3('0xe')](_0x2ed5e1));if(_0x2ed5e1[_0xa4e3('0xf')]){if(_0x2ed5e1[_0xa4e3('0xf')][_0xa4e3('0x10')]===0x1f4){logger[_0xa4e3('0xf')](_0xa4e3('0xb'),_0x3c1e2b,_0x2ed5e1[_0xa4e3('0xf')][_0xa4e3('0x11')]);return _0x526a47(_0x2ed5e1[_0xa4e3('0xf')][_0xa4e3('0x11')]);}logger['error'](_0xa4e3('0xb'),_0x3c1e2b,_0x2ed5e1['error'][_0xa4e3('0x11')]);return _0x209c22(_0x2ed5e1[_0xa4e3('0xf')][_0xa4e3('0x11')]);}else{logger['info'](_0xa4e3('0xb'),_0x3c1e2b,_0xa4e3('0xc'));_0x209c22(_0x2ed5e1[_0xa4e3('0x12')]['message']);}})[_0xa4e3('0x13')](function(_0x1e25c7){logger[_0xa4e3('0xf')](_0xa4e3('0xb'),_0x3c1e2b,_0x1e25c7);_0x526a47(_0x1e25c7);});});}exports[_0xa4e3('0x14')]=function(_0x2d43f5){var _0x54a443=this;return new Promise(function(_0x56c7fe,_0x167109){return db[_0xa4e3('0x15')][_0xa4e3('0x16')](_0x2d43f5[_0xa4e3('0x17')],{'raw':_0x2d43f5[_0xa4e3('0x18')]?_0x2d43f5[_0xa4e3('0x18')][_0xa4e3('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2d43f5[_0xa4e3('0x18')]?_0x2d43f5[_0xa4e3('0x18')][_0xa4e3('0x1a')]||null:null,'attributes':_0x2d43f5[_0xa4e3('0x18')]?_0x2d43f5[_0xa4e3('0x18')]['attributes']||null:null,'limit':_0x2d43f5['options']?_0x2d43f5[_0xa4e3('0x18')][_0xa4e3('0x1b')]||null:null})[_0xa4e3('0x1c')](function(_0x1b4a0b){logger[_0xa4e3('0xa')](_0xa4e3('0x14'),_0x2d43f5);logger[_0xa4e3('0x1d')](_0xa4e3('0x14'),_0x2d43f5,JSON[_0xa4e3('0xe')](_0x1b4a0b));_0x56c7fe(_0x1b4a0b);})[_0xa4e3('0x13')](function(_0x40df37){logger[_0xa4e3('0xf')](_0xa4e3('0x14'),_0x40df37[_0xa4e3('0x11')],_0x2d43f5);_0x167109(_0x54a443['error'](0x1f4,_0x40df37[_0xa4e3('0x11')]));});});};exports['AddTagsToSmsInteraction']=function(_0x63b537){return new Promise(function(_0x34d72d,_0x2e20d3){return db[_0xa4e3('0x15')][_0xa4e3('0x1e')]({'where':_0x63b537[_0xa4e3('0x18')]?_0x63b537[_0xa4e3('0x18')]['where']||null:null})[_0xa4e3('0x1c')](function(_0xf5e8c7){if(_0xf5e8c7){return _0xf5e8c7['addTags'](_0x63b537[_0xa4e3('0x17')][_0xa4e3('0x1f')],_[_0xa4e3('0x20')](_0x63b537[_0xa4e3('0x17')],['ids','id'])||{});}})['spread'](function(_0x1449a7){logger[_0xa4e3('0xa')]('AddTags',_0x63b537);logger['debug'](_0xa4e3('0x21'),_0x63b537,JSON[_0xa4e3('0xe')](_0x1449a7));_0x34d72d(_0x1449a7);})[_0xa4e3('0x13')](function(_0xe59e81){logger[_0xa4e3('0xf')](_0xa4e3('0x21'),_0xe59e81[_0xa4e3('0x11')],_0x63b537);_0x2e20d3(_this['error'](0x1f4,_0xe59e81[_0xa4e3('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 5f8436c..b89397c 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 _0xa1c2=['save','remove','update','emit','removeListener','register','length','smsInteraction:'];(function(_0x410344,_0x11c039){var _0x210ff4=function(_0x24501a){while(--_0x24501a){_0x410344['push'](_0x410344['shift']());}};_0x210ff4(++_0x11c039);}(_0xa1c2,0xa0));var _0x2a1c=function(_0xf04c6d,_0xe98786){_0xf04c6d=_0xf04c6d-0x0;var _0x4a804e=_0xa1c2[_0xf04c6d];return _0x4a804e;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0x2a1c('0x0'),_0x2a1c('0x1'),_0x2a1c('0x2')];function createListener(_0x14634b,_0x3330df){return function(_0x4e1ecf){_0x3330df[_0x2a1c('0x3')](_0x14634b,_0x4e1ecf);};}function removeListener(_0x121811,_0x4615eb){return function(){SmsInteractionEvents[_0x2a1c('0x4')](_0x121811,_0x4615eb);};}exports[_0x2a1c('0x5')]=function(_0x752d5b){for(var _0x13635f=0x0,_0x3a874d=events[_0x2a1c('0x6')];_0x13635f<_0x3a874d;_0x13635f++){var _0x4047bf=events[_0x13635f];var _0x43c30b=createListener(_0x2a1c('0x7')+_0x4047bf,_0x752d5b);SmsInteractionEvents['on'](_0x4047bf,_0x43c30b);}}; \ No newline at end of file +var _0x2174=['removeListener','register','length','smsInteraction:','save','remove','update','emit'];(function(_0x5a6981,_0x4e35e2){var _0x3c1fa2=function(_0x170a30){while(--_0x170a30){_0x5a6981['push'](_0x5a6981['shift']());}};_0x3c1fa2(++_0x4e35e2);}(_0x2174,0x1ac));var _0x4217=function(_0x3109c0,_0x8c0569){_0x3109c0=_0x3109c0-0x0;var _0x34f514=_0x2174[_0x3109c0];return _0x34f514;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0x4217('0x0'),_0x4217('0x1'),_0x4217('0x2')];function createListener(_0xd9747b,_0x41e5e1){return function(_0x1fbb1a){_0x41e5e1[_0x4217('0x3')](_0xd9747b,_0x1fbb1a);};}function removeListener(_0x50936d,_0x2e6bf1){return function(){SmsInteractionEvents[_0x4217('0x4')](_0x50936d,_0x2e6bf1);};}exports[_0x4217('0x5')]=function(_0x4d611e){for(var _0x53694f=0x0,_0x28968a=events[_0x4217('0x6')];_0x53694f<_0x28968a;_0x53694f++){var _0x5cbe76=events[_0x53694f];var _0x14f2bf=createListener(_0x4217('0x7')+_0x5cbe76,_0x4d611e);SmsInteractionEvents['on'](_0x5cbe76,_0x14f2bf);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index d7ded5e..5f75e0b 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 _0xa8d0=['tracked','sms','create','/:id/status','status','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsMessage.controller','get','index','/describe','describe','/:id','isAuthenticated','show','post'];(function(_0x1c208e,_0x2a0a5b){var _0x5104ff=function(_0x3ca41f){while(--_0x3ca41f){_0x1c208e['push'](_0x1c208e['shift']());}};_0x5104ff(++_0x2a0a5b);}(_0xa8d0,0x11c));var _0x0a8d=function(_0x4cbac8,_0x106456){_0x4cbac8=_0x4cbac8-0x0;var _0x5b0480=_0xa8d0[_0x4cbac8];return _0x5b0480;};'use strict';var multer=require('multer');var util=require(_0x0a8d('0x0'));var path=require(_0x0a8d('0x1'));var timeout=require(_0x0a8d('0x2'));var express=require('express');var router=express[_0x0a8d('0x3')]();var fs_extra=require(_0x0a8d('0x4'));var auth=require(_0x0a8d('0x5'));var interaction=require(_0x0a8d('0x6'));var config=require('../../config/environment');var controller=require(_0x0a8d('0x7'));router[_0x0a8d('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a8d('0x9')]);router[_0x0a8d('0x8')](_0x0a8d('0xa'),auth['isAuthenticated'](),controller[_0x0a8d('0xb')]);router['get'](_0x0a8d('0xc'),auth[_0x0a8d('0xd')](),controller[_0x0a8d('0xe')]);router[_0x0a8d('0xf')]('/',auth[_0x0a8d('0xd')](),interaction[_0x0a8d('0x10')](_0x0a8d('0x11'),'smsmessage:create'),controller[_0x0a8d('0x12')]);router[_0x0a8d('0xf')](_0x0a8d('0x13'),controller[_0x0a8d('0x14')]);router[_0x0a8d('0x15')](_0x0a8d('0xc'),auth[_0x0a8d('0xd')](),controller[_0x0a8d('0x16')]);router[_0x0a8d('0x15')](_0x0a8d('0x17'),auth[_0x0a8d('0xd')](),controller[_0x0a8d('0x18')]);router['put'](_0x0a8d('0x19'),auth[_0x0a8d('0xd')](),controller[_0x0a8d('0x1a')]);router[_0x0a8d('0x1b')]('/:id',auth[_0x0a8d('0xd')](),controller[_0x0a8d('0x1c')]);module[_0x0a8d('0x1d')]=router; \ No newline at end of file +var _0x7df3=['multer','util','connect-timeout','Router','../../components/auth/service','../../config/environment','./smsMessage.controller','get','isAuthenticated','index','/:id','show','tracked','sms','create','post','/:id/status','put','update','accept','reject','destroy','exports'];(function(_0x14da84,_0x5d849b){var _0x1ab813=function(_0x5d56e6){while(--_0x5d56e6){_0x14da84['push'](_0x14da84['shift']());}};_0x1ab813(++_0x5d849b);}(_0x7df3,0x1cc));var _0x37df=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x7df3[_0x465028];return _0xb783d4;};'use strict';var multer=require(_0x37df('0x0'));var util=require(_0x37df('0x1'));var path=require('path');var timeout=require(_0x37df('0x2'));var express=require('express');var router=express[_0x37df('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x37df('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x37df('0x5'));var controller=require(_0x37df('0x6'));router[_0x37df('0x7')]('/',auth[_0x37df('0x8')](),controller[_0x37df('0x9')]);router[_0x37df('0x7')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x37df('0x7')](_0x37df('0xa'),auth[_0x37df('0x8')](),controller[_0x37df('0xb')]);router['post']('/',auth[_0x37df('0x8')](),interaction[_0x37df('0xc')](_0x37df('0xd'),'smsmessage:create'),controller[_0x37df('0xe')]);router[_0x37df('0xf')](_0x37df('0x10'),controller['status']);router[_0x37df('0x11')](_0x37df('0xa'),auth[_0x37df('0x8')](),controller[_0x37df('0x12')]);router[_0x37df('0x11')]('/:id/accept',auth[_0x37df('0x8')](),controller[_0x37df('0x13')]);router[_0x37df('0x11')]('/:id/reject',auth[_0x37df('0x8')](),controller[_0x37df('0x14')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x37df('0x15')]);module[_0x37df('0x16')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index 9f4b9c7..93195dc 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 _0xe526=['sequelize','exports','TEXT','medium','out','STRING','DATE'];(function(_0x5a5942,_0x10d206){var _0x471a1b=function(_0x20ff6e){while(--_0x20ff6e){_0x5a5942['push'](_0x5a5942['shift']());}};_0x471a1b(++_0x10d206);}(_0xe526,0x103));var _0x6e52=function(_0x5a5cd3,_0x4bdac8){_0x5a5cd3=_0x5a5cd3-0x0;var _0x583f96=_0xe526[_0x5a5cd3];return _0x583f96;};'use strict';var Sequelize=require(_0x6e52('0x0'));module[_0x6e52('0x1')]={'body':{'type':Sequelize[_0x6e52('0x2')](_0x6e52('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x6e52('0x4')),'defaultValue':_0x6e52('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0x6e52('0x5')](0xbe)},'phone':{'type':Sequelize[_0x6e52('0x5')]},'readAt':{'type':Sequelize[_0x6e52('0x6')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x6e52('0x2')]}}; \ No newline at end of file +var _0xece2=['BOOLEAN','ENUM','STRING','sequelize','TEXT'];(function(_0x11baab,_0x5bd419){var _0x4039bf=function(_0x1f3651){while(--_0x1f3651){_0x11baab['push'](_0x11baab['shift']());}};_0x4039bf(++_0x5bd419);}(_0xece2,0x1f2));var _0x2ece=function(_0x263d61,_0x198f38){_0x263d61=_0x263d61-0x0;var _0x53dc8f=_0xece2[_0x263d61];return _0x53dc8f;};'use strict';var Sequelize=require(_0x2ece('0x0'));module['exports']={'body':{'type':Sequelize[_0x2ece('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x2ece('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x2ece('0x3')]('in','out'),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0x2ece('0x4')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0x2ece('0x2')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x2ece('0x4')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 5fb86c2..0e81c5f 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 _0x3dd7=['keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','rawAttributes','find','create','body','params','describe','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','SmsInteraction','SmsInteractionId','read1stAt','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','event','EventManager','sms-interactions','sms','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','rejectMessage','sequelize','motionChannel','reject','SmsAccountId','SmsMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','twilio','plivo','MessageUUID','indexOf','delivered','Status','plivio','infobip','results','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','register','client','http','request','then','info','debug','request\x20sent','error','code','SmsMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','limit','undefined','count','offset','set','apply','update','destroy','stack','name','send','index','map','SmsMessage','fieldName','type','key','query'];(function(_0x404f13,_0x4fa35f){var _0x1f9dbb=function(_0x492b33){while(--_0x492b33){_0x404f13['push'](_0x404f13['shift']());}};_0x1f9dbb(++_0x4fa35f);}(_0x3dd7,0xe9));var _0x73dd=function(_0x55393c,_0x4c16f2){_0x55393c=_0x55393c-0x0;var _0x2849e4=_0x3dd7[_0x55393c];return _0x2849e4;};'use strict';var emlformat=require(_0x73dd('0x0'));var rimraf=require(_0x73dd('0x1'));var zipdir=require(_0x73dd('0x2'));var jsonpatch=require(_0x73dd('0x3'));var rp=require('request-promise');var moment=require(_0x73dd('0x4'));var BPromise=require(_0x73dd('0x5'));var Mustache=require(_0x73dd('0x6'));var util=require('util');var path=require(_0x73dd('0x7'));var sox=require(_0x73dd('0x8'));var csv=require(_0x73dd('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x73dd('0xa'));var _=require(_0x73dd('0xb'));var squel=require(_0x73dd('0xc'));var crypto=require(_0x73dd('0xd'));var jsforce=require(_0x73dd('0xe'));var deskjs=require(_0x73dd('0xf'));var toCsv=require(_0x73dd('0x9'));var querystring=require(_0x73dd('0x10'));var Papa=require(_0x73dd('0x11'));var Redis=require(_0x73dd('0x12'));var authService=require(_0x73dd('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x73dd('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x73dd('0x15'))('api');var utils=require(_0x73dd('0x16'));var config=require(_0x73dd('0x17'));var licenseUtil=require(_0x73dd('0x18'));var db=require(_0x73dd('0x19'))['db'];config[_0x73dd('0x1a')]=_[_0x73dd('0x1b')](config[_0x73dd('0x1a')],{'host':_0x73dd('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./smsMessage.socket')[_0x73dd('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson[_0x73dd('0x1e')][_0x73dd('0x1f')]({'port':0x232c});var client9002=jayson[_0x73dd('0x1e')]['http']({'port':0x232a});function respondWithRpcPromise(_0x457401,_0x2748c8,_0x228430,_0x2529d7){return new BPromise(function(_0x2a96b6,_0x463cbb){var _0x2be9be=_0x2529d7||client;return _0x2be9be[_0x73dd('0x20')](_0x457401,_0x228430)[_0x73dd('0x21')](function(_0x34df54){logger[_0x73dd('0x22')]('SmsMessage,\x20%s,\x20%s',_0x2748c8,'request\x20sent');logger[_0x73dd('0x23')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x2748c8,_0x73dd('0x24'),JSON['stringify'](_0x34df54));if(_0x34df54[_0x73dd('0x25')]){if(_0x34df54[_0x73dd('0x25')][_0x73dd('0x26')]===0x1f4){logger[_0x73dd('0x25')](_0x73dd('0x27'),_0x2748c8,_0x34df54[_0x73dd('0x25')][_0x73dd('0x28')]);return _0x463cbb(_0x34df54[_0x73dd('0x25')][_0x73dd('0x28')]);}logger[_0x73dd('0x25')](_0x73dd('0x27'),_0x2748c8,_0x34df54[_0x73dd('0x25')][_0x73dd('0x28')]);return _0x2a96b6(_0x34df54['error'][_0x73dd('0x28')]);}else{logger[_0x73dd('0x22')](_0x73dd('0x27'),_0x2748c8,_0x73dd('0x24'));_0x2a96b6(_0x34df54[_0x73dd('0x29')][_0x73dd('0x28')]);}})[_0x73dd('0x2a')](function(_0x2b2823){logger['error'](_0x73dd('0x27'),_0x2748c8,_0x2b2823);_0x463cbb(_0x2b2823);});});}function respondWithStatusCode(_0x356a85,_0x4239b8){_0x4239b8=_0x4239b8||0xcc;return function(_0x191058){if(_0x191058){return _0x356a85[_0x73dd('0x2b')](_0x4239b8);}return _0x356a85[_0x73dd('0x2c')](_0x4239b8)[_0x73dd('0x2d')]();};}function respondWithResult(_0x4ac44e,_0x42a8ac){_0x42a8ac=_0x42a8ac||0xc8;return function(_0x31a27a){if(_0x31a27a){return _0x4ac44e[_0x73dd('0x2c')](_0x42a8ac)[_0x73dd('0x2e')](_0x31a27a);}};}function respondWithFilteredResult(_0x1f6688,_0x49001a){return function(_0xd4f16a){if(_0xd4f16a){var _0x34a7fb=typeof _0x49001a['offset']==='undefined'&&typeof _0x49001a[_0x73dd('0x2f')]===_0x73dd('0x30');var _0x84a46c=_0xd4f16a[_0x73dd('0x31')];var _0x4d6969=_0x34a7fb?0x0:_0x49001a[_0x73dd('0x32')];var _0x2c95ea=_0x34a7fb?_0xd4f16a[_0x73dd('0x31')]:_0x49001a['offset']+_0x49001a[_0x73dd('0x2f')];var _0x49280a;if(_0x2c95ea>=_0x84a46c){_0x2c95ea=_0x84a46c;_0x49280a=0xc8;}else{_0x49280a=0xce;}_0x1f6688[_0x73dd('0x2c')](_0x49280a);return _0x1f6688[_0x73dd('0x33')]('Content-Range',_0x4d6969+'-'+_0x2c95ea+'/'+_0x84a46c)[_0x73dd('0x2e')](_0xd4f16a);}return null;};}function patchUpdates(_0x1de888){return function(_0x24012f){try{jsonpatch[_0x73dd('0x34')](_0x24012f,_0x1de888,!![]);}catch(_0x14fac9){return BPromise['reject'](_0x14fac9);}return _0x24012f['save']();};}function saveUpdates(_0x745c36,_0x120430){return function(_0x5d320a){if(_0x5d320a){return _0x5d320a[_0x73dd('0x35')](_0x745c36)['then'](function(_0x3a1cad){return _0x3a1cad;});}return null;};}function removeEntity(_0xf1e5db,_0x34d124){return function(_0x579b6c){if(_0x579b6c){return _0x579b6c[_0x73dd('0x36')]()['then'](function(){_0xf1e5db[_0x73dd('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0xbf5040,_0x27005b){return function(_0x19e3d1){if(!_0x19e3d1){_0xbf5040[_0x73dd('0x2b')](0x194);}return _0x19e3d1;};}function handleError(_0x579718,_0x4937c3){_0x4937c3=_0x4937c3||0x1f4;return function(_0xbf5bac){logger['error'](_0xbf5bac[_0x73dd('0x37')]);if(_0xbf5bac[_0x73dd('0x38')]){delete _0xbf5bac['name'];}_0x579718[_0x73dd('0x2c')](_0x4937c3)[_0x73dd('0x39')](_0xbf5bac);};}exports[_0x73dd('0x3a')]=function(_0xb37dbf,_0x58f486){var _0xb21fbc={},_0x33515e={},_0x1eb37e={'count':0x0,'rows':[]};var _0x304a8d=_[_0x73dd('0x3b')](db[_0x73dd('0x3c')]['rawAttributes'],function(_0x48ec1e){return{'name':_0x48ec1e[_0x73dd('0x3d')],'type':_0x48ec1e[_0x73dd('0x3e')][_0x73dd('0x3f')]};});_0x33515e['model']=_[_0x73dd('0x3b')](_0x304a8d,_0x73dd('0x38'));_0x33515e[_0x73dd('0x40')]=_[_0x73dd('0x41')](_0xb37dbf[_0x73dd('0x40')]);_0x33515e[_0x73dd('0x42')]=_[_0x73dd('0x43')](_0x33515e[_0x73dd('0x44')],_0x33515e['query']);_0xb21fbc['attributes']=_[_0x73dd('0x43')](_0x33515e['model'],qs[_0x73dd('0x45')](_0xb37dbf[_0x73dd('0x40')]['fields']));_0xb21fbc[_0x73dd('0x46')]=_0xb21fbc['attributes'][_0x73dd('0x47')]?_0xb21fbc[_0x73dd('0x46')]:_0x33515e[_0x73dd('0x44')];if(!_0xb37dbf[_0x73dd('0x40')][_0x73dd('0x48')](_0x73dd('0x49'))){_0xb21fbc[_0x73dd('0x2f')]=qs[_0x73dd('0x2f')](_0xb37dbf[_0x73dd('0x40')]['limit']);_0xb21fbc[_0x73dd('0x32')]=qs[_0x73dd('0x32')](_0xb37dbf[_0x73dd('0x40')][_0x73dd('0x32')]);}_0xb21fbc[_0x73dd('0x4a')]=qs['sort'](_0xb37dbf[_0x73dd('0x40')][_0x73dd('0x4b')]);_0xb21fbc[_0x73dd('0x4c')]=qs['filters'](_[_0x73dd('0x4d')](_0xb37dbf[_0x73dd('0x40')],_0x33515e['filters']),_0x304a8d);if(_0xb37dbf[_0x73dd('0x40')][_0x73dd('0x4e')]){_0xb21fbc[_0x73dd('0x4c')]=_[_0x73dd('0x4f')](_0xb21fbc['where'],{'$or':_[_0x73dd('0x3b')](_0x304a8d,function(_0x108c9b){if(_0x108c9b['type']!=='VIRTUAL'){var _0x495b1e={};_0x495b1e[_0x108c9b[_0x73dd('0x38')]]={'$like':'%'+_0xb37dbf['query'][_0x73dd('0x4e')]+'%'};return _0x495b1e;}})});}_0xb21fbc=_[_0x73dd('0x4f')]({},_0xb21fbc,_0xb37dbf[_0x73dd('0x50')]);var _0x418398={'where':_0xb21fbc[_0x73dd('0x4c')]};return db['SmsMessage'][_0x73dd('0x31')](_0x418398)['then'](function(_0x329ff7){_0x1eb37e['count']=_0x329ff7;if(_0xb37dbf[_0x73dd('0x40')][_0x73dd('0x51')]){_0xb21fbc[_0x73dd('0x52')]=[{'all':!![]}];}return db[_0x73dd('0x3c')][_0x73dd('0x53')](_0xb21fbc);})[_0x73dd('0x21')](function(_0x5ba1a4){_0x1eb37e[_0x73dd('0x54')]=_0x5ba1a4;return _0x1eb37e;})['then'](respondWithFilteredResult(_0x58f486,_0xb21fbc))[_0x73dd('0x2a')](handleError(_0x58f486,null));};exports[_0x73dd('0x55')]=function(_0x2734db,_0x3ac528){var _0x5130a1={'raw':!![],'where':{'id':_0x2734db['params']['id']}},_0x3e0548={};_0x3e0548['model']=_['keys'](db['SmsMessage'][_0x73dd('0x56')]);_0x3e0548[_0x73dd('0x40')]=_[_0x73dd('0x41')](_0x2734db['query']);_0x3e0548['filters']=_[_0x73dd('0x43')](_0x3e0548['model'],_0x3e0548[_0x73dd('0x40')]);_0x5130a1['attributes']=_[_0x73dd('0x43')](_0x3e0548['model'],qs[_0x73dd('0x45')](_0x2734db[_0x73dd('0x40')][_0x73dd('0x45')]));_0x5130a1[_0x73dd('0x46')]=_0x5130a1[_0x73dd('0x46')][_0x73dd('0x47')]?_0x5130a1[_0x73dd('0x46')]:_0x3e0548[_0x73dd('0x44')];if(_0x2734db[_0x73dd('0x40')][_0x73dd('0x51')]){_0x5130a1[_0x73dd('0x52')]=[{'all':!![]}];}_0x5130a1=_[_0x73dd('0x4f')]({},_0x5130a1,_0x2734db[_0x73dd('0x50')]);return db[_0x73dd('0x3c')][_0x73dd('0x57')](_0x5130a1)[_0x73dd('0x21')](handleEntityNotFound(_0x3ac528,null))[_0x73dd('0x21')](respondWithResult(_0x3ac528,null))[_0x73dd('0x2a')](handleError(_0x3ac528,null));};exports[_0x73dd('0x58')]=function(_0x45329c,_0x268b1b){return db[_0x73dd('0x3c')][_0x73dd('0x58')](_0x45329c[_0x73dd('0x59')],{})[_0x73dd('0x21')](respondWithResult(_0x268b1b,0xc9))[_0x73dd('0x2a')](handleError(_0x268b1b,null));};exports['update']=function(_0x5b30ad,_0x2aadd7){if(_0x5b30ad[_0x73dd('0x59')]['id']){delete _0x5b30ad[_0x73dd('0x59')]['id'];}return db['SmsMessage'][_0x73dd('0x57')]({'where':{'id':_0x5b30ad[_0x73dd('0x5a')]['id']}})[_0x73dd('0x21')](handleEntityNotFound(_0x2aadd7,null))[_0x73dd('0x21')](saveUpdates(_0x5b30ad[_0x73dd('0x59')],null))[_0x73dd('0x21')](respondWithResult(_0x2aadd7,null))['catch'](handleError(_0x2aadd7,null));};exports[_0x73dd('0x36')]=function(_0x30c646,_0x4f9d2e){return db[_0x73dd('0x3c')][_0x73dd('0x57')]({'where':{'id':_0x30c646[_0x73dd('0x5a')]['id']}})['then'](handleEntityNotFound(_0x4f9d2e,null))[_0x73dd('0x21')](removeEntity(_0x4f9d2e,null))[_0x73dd('0x2a')](handleError(_0x4f9d2e,null));};exports[_0x73dd('0x5b')]=function(_0x55887e,_0x342e9c){return db[_0x73dd('0x3c')]['describe']()[_0x73dd('0x21')](respondWithResult(_0x342e9c,null))[_0x73dd('0x2a')](handleError(_0x342e9c,null));};var interaction_log=require(_0x73dd('0x15'))('sms-interactions');exports[_0x73dd('0x5c')]=function(_0x384804,_0x3741a0,_0x4f0404){var _0x36c316={'agent':{},'channel':'sms'};if(_0x384804[_0x73dd('0x59')]['id']){delete _0x384804[_0x73dd('0x59')]['id'];}_0x384804[_0x73dd('0x59')][_0x73dd('0x5d')]=!![];_0x384804[_0x73dd('0x59')][_0x73dd('0x5e')]=moment()[_0x73dd('0x5f')](_0x73dd('0x60'));_0x384804[_0x73dd('0x59')][_0x73dd('0x61')]=_0x384804[_0x73dd('0x59')][_0x73dd('0x61')]||_0x384804[_0x73dd('0x62')]['id'];_0x36c316[_0x73dd('0x63')]['id']=_0x384804[_0x73dd('0x59')][_0x73dd('0x61')];return db[_0x73dd('0x3c')]['find']({'where':{'id':_0x384804[_0x73dd('0x5a')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3741a0,null))['then'](saveUpdates(_0x384804[_0x73dd('0x59')],null))['then'](function(_0x21ba3b){if(_0x21ba3b){_0x36c316[_0x73dd('0x28')]=_0x21ba3b[_0x73dd('0x64')]({'plain':!![]});return db[_0x73dd('0x65')][_0x73dd('0x57')]({'where':{'id':_0x21ba3b[_0x73dd('0x66')]}});}return null;})[_0x73dd('0x21')](handleEntityNotFound(_0x3741a0,null))['then'](function(_0x486f99){if(_0x486f99){return _0x486f99[_0x73dd('0x35')]({'UserId':_0x384804[_0x73dd('0x59')][_0x73dd('0x61')],'read1stAt':_['isNil'](_0x486f99[_0x73dd('0x67')])?moment()[_0x73dd('0x5f')](_0x73dd('0x60')):undefined});}return null;})[_0x73dd('0x21')](function(_0x38e34b){if(_0x38e34b){_0x36c316[_0x73dd('0x68')]=_0x38e34b[_0x73dd('0x64')]({'plain':!![]});interaction_log['info'](_0x73dd('0x69'),_0x384804[_0x73dd('0x62')]['id'],_0x384804[_0x73dd('0x62')][_0x73dd('0x38')],_0x384804[_0x73dd('0x62')]['role'],_0x36c316[_0x73dd('0x68')]['id'],_0x384804[_0x73dd('0x59')]?JSON[_0x73dd('0x6a')](_0x384804[_0x73dd('0x59')]):_0x73dd('0x6b'));return respondWithRpcPromise('AcceptMessage',_0x73dd('0x6c'),_0x36c316);}return null;})[_0x73dd('0x21')](function(_0x44a5e2){var _0xcff974=_0x73dd('0x6d')+_0x44a5e2['message'][_0x73dd('0x6e')];return db['sequelize'][_0x73dd('0x40')](_0xcff974,{'type':db[_0x73dd('0x6f')][_0x73dd('0x70')][_0x73dd('0x71')],'raw':!![]})[_0x73dd('0x21')](function(_0x1fdac9){return _0x1fdac9;});})['then'](function(_0x6a3bf1){if(_0x6a3bf1){_0x36c316['message'][_0x73dd('0x72')]=_0x6a3bf1[0x0];if(!_0x384804[_0x73dd('0x59')]['UserId'])return;return db[_0x73dd('0x73')][_0x73dd('0x57')]({'where':{'id':_0x384804[_0x73dd('0x59')][_0x73dd('0x61')],'role':_0x73dd('0x63')},'attributes':['id',_0x73dd('0x38'),_0x73dd('0x74'),_0x73dd('0x75'),_0x73dd('0x76')],'raw':!![]});}return null;})[_0x73dd('0x21')](function(_0x5f3309){if(!_0x5f3309)return null;_0x36c316[_0x73dd('0x28')][_0x73dd('0x63')]=_0x5f3309;return _0x36c316;})[_0x73dd('0x21')](function(_0x25d391){if(_0x25d391){if(_0x384804[_0x73dd('0x59')][_0x73dd('0x77')]){_0x36c316[_0x73dd('0x28')][_0x73dd('0x78')]=util[_0x73dd('0x5f')](_0x73dd('0x79'),_0x384804[_0x73dd('0x62')]['name']);_0x36c316['message'][_0x73dd('0x7a')]=_0x36c316[_0x73dd('0x7a')];_0x36c316[_0x73dd('0x28')]['motionChannel']=_0x36c316[_0x73dd('0x7a')];_0x36c316[_0x73dd('0x28')][_0x73dd('0x7b')]=_0x73dd('0x5c');return respondWithRpcPromise(_0x73dd('0x7c'),_0x73dd('0x7c'),{'event':'acceptmessage','message':_0x36c316['message']},client9002)[_0x73dd('0x21')](function(){return _0x36c316;});}return _0x36c316;}return null;})[_0x73dd('0x21')](respondWithResult(_0x3741a0,null))['catch'](handleError(_0x3741a0,null));};var interaction_log=require(_0x73dd('0x15'))(_0x73dd('0x7d'));exports['reject']=function(_0x403e59,_0x3e6de4,_0x1e785e){var _0x251580={'agent':{},'channel':_0x73dd('0x7e')};if(_0x403e59[_0x73dd('0x59')]['id']){delete _0x403e59[_0x73dd('0x59')]['id'];}_0x403e59[_0x73dd('0x59')][_0x73dd('0x61')]=_0x403e59[_0x73dd('0x59')][_0x73dd('0x61')]||_0x403e59[_0x73dd('0x62')]['id'];_0x251580[_0x73dd('0x63')]['id']=_0x403e59[_0x73dd('0x59')]['UserId'];return db[_0x73dd('0x3c')]['find']({'where':{'id':_0x403e59['params']['id'],'UserId':null}})[_0x73dd('0x21')](handleEntityNotFound(_0x3e6de4,null))[_0x73dd('0x21')](function(_0x1817c2){if(_0x1817c2){_0x251580['message']=_0x1817c2['get']({'plain':!![]});return db[_0x73dd('0x65')]['find']({'where':{'id':_0x1817c2['SmsInteractionId']}});}return null;})[_0x73dd('0x21')](handleEntityNotFound(_0x3e6de4,null))[_0x73dd('0x21')](function(_0x432e51){if(_0x432e51){_0x251580[_0x73dd('0x68')]=_0x432e51['get']({'plain':!![]});interaction_log[_0x73dd('0x22')](_0x73dd('0x7f'),_0x403e59[_0x73dd('0x62')]['id'],_0x403e59[_0x73dd('0x62')]['name'],_0x403e59[_0x73dd('0x62')][_0x73dd('0x80')],_0x251580[_0x73dd('0x68')]['id'],_0x403e59[_0x73dd('0x59')]?JSON['stringify'](_0x403e59[_0x73dd('0x59')]):_0x73dd('0x6b'));return respondWithRpcPromise('RejectMessage',_0x73dd('0x81'),_0x251580);}return null;})['then'](function(_0x4c3b53){var _0x22bd95=_0x73dd('0x6d')+_0x4c3b53['message']['ContactId'];return db[_0x73dd('0x82')][_0x73dd('0x40')](_0x22bd95,{'type':db[_0x73dd('0x6f')]['QueryTypes'][_0x73dd('0x71')],'raw':!![]})[_0x73dd('0x21')](function(_0x464015){return _0x464015;});})[_0x73dd('0x21')](function(_0x7680f9){if(_0x7680f9){_0x251580[_0x73dd('0x28')][_0x73dd('0x72')]=_0x7680f9[0x0];if(!_0x403e59['body'][_0x73dd('0x61')])return;return db[_0x73dd('0x73')][_0x73dd('0x57')]({'where':{'id':_0x403e59[_0x73dd('0x59')][_0x73dd('0x61')],'role':_0x73dd('0x63')},'attributes':['id',_0x73dd('0x38'),_0x73dd('0x74'),_0x73dd('0x75'),_0x73dd('0x76')],'raw':!![]});}return null;})['then'](function(_0x25f0f4){if(!_0x25f0f4)return null;_0x251580['message'][_0x73dd('0x63')]=_0x25f0f4;return _0x251580;})[_0x73dd('0x21')](function(_0x1c7790){if(_0x1c7790){_0x1c7790[_0x73dd('0x28')][_0x73dd('0x78')]=util[_0x73dd('0x5f')](_0x73dd('0x79'),_0x403e59[_0x73dd('0x62')][_0x73dd('0x38')]);_0x1c7790[_0x73dd('0x28')]['channel']=_0x251580[_0x73dd('0x7a')];_0x1c7790[_0x73dd('0x28')][_0x73dd('0x83')]=_0x251580[_0x73dd('0x7a')];_0x1c7790['message'][_0x73dd('0x7b')]=_0x73dd('0x84');respondWithRpcPromise(_0x73dd('0x7c'),_0x73dd('0x7c'),{'event':'rejectmessage','message':_0x1c7790['message']},client9002);return _0x251580;}return null;})[_0x73dd('0x21')](respondWithResult(_0x3e6de4,null))[_0x73dd('0x2a')](handleError(_0x3e6de4,null));};exports[_0x73dd('0x2c')]=function(_0x3e9dd3,_0x1f0e44,_0x182677){if(_0x3e9dd3[_0x73dd('0x59')]['id']){delete _0x3e9dd3[_0x73dd('0x59')]['id'];}var _0x5e2794;return db[_0x73dd('0x3c')][_0x73dd('0x57')]({'where':{'id':_0x3e9dd3[_0x73dd('0x5a')]['id']}})[_0x73dd('0x21')](handleEntityNotFound(_0x1f0e44,null))[_0x73dd('0x21')](function(_0x54bf9d){if(_0x54bf9d){_0x5e2794=_0x54bf9d;return db['SmsAccount']['find']({'where':{'id':_0x54bf9d[_0x73dd('0x85')]}});}})[_0x73dd('0x21')](handleEntityNotFound(_0x1f0e44,null))[_0x73dd('0x21')](function(_0x3e546e){if(_0x3e546e){logger[_0x73dd('0x23')](_0x73dd('0x86'),_0x73dd('0x2c'),_0x73dd('0x87'),_0x3e546e[_0x73dd('0x3e')],util[_0x73dd('0x88')](_0x3e9dd3[_0x73dd('0x59')],{'showHidden':![],'depth':null}));switch(_0x3e546e[_0x73dd('0x3e')]){case'twilio':if(_0x3e9dd3[_0x73dd('0x59')][_0x73dd('0x89')]&&_0x3e9dd3[_0x73dd('0x59')][_0x73dd('0x89')]===_0x5e2794[_0x73dd('0x8a')]){return _0x5e2794['update']({'read':!![]});}else{logger['error'](_0x73dd('0x8b'),_0x73dd('0x2c'),_0x73dd('0x8c'),util[_0x73dd('0x88')](_0x3e9dd3['body'],{'showHidden':![],'depth':null}));}break;case _0x73dd('0x8d'):if(_0x3e9dd3[_0x73dd('0x59')][_0x73dd('0x8e')]&&_0x3e9dd3['body']['MessageUUID']===_0x5e2794[_0x73dd('0x8a')]&&_[_0x73dd('0x8f')](['sent',_0x73dd('0x90')],_0x3e9dd3[_0x73dd('0x59')][_0x73dd('0x91')])>=0x0){return _0x5e2794[_0x73dd('0x35')]({'read':!![]});}else{logger[_0x73dd('0x25')](_0x73dd('0x8b'),_0x73dd('0x2c'),_0x73dd('0x92'),util[_0x73dd('0x88')](_0x3e9dd3[_0x73dd('0x59')],{'showHidden':![],'depth':null}));}break;case _0x73dd('0x93'):var _0x1f4075=_0x3e9dd3[_0x73dd('0x59')][_0x73dd('0x94')][0x0];if(_0x1f4075[_0x73dd('0x2c')]['groupName']==='DELIVERED'){return _0x5e2794[_0x73dd('0x35')]({'read':!![]});}else{logger[_0x73dd('0x25')](_0x73dd('0x8b'),_0x73dd('0x2c'),_0x73dd('0x93'),util[_0x73dd('0x88')](_0x3e9dd3[_0x73dd('0x59')],{'showHidden':![],'depth':null}));}break;}return _0x5e2794;}})[_0x73dd('0x21')](respondWithResult(_0x1f0e44,null))[_0x73dd('0x2a')](handleError(_0x1f0e44,null));}; \ No newline at end of file +var _0x9666=['end','json','offset','limit','count','set','Content-Range','apply','reject','update','then','destroy','sendStatus','name','send','map','SmsMessage','rawAttributes','fieldName','type','key','keys','query','model','attributes','fields','length','order','sort','where','filters','pick','merge','filter','options','includeAll','rows','intersection','include','find','create','body','params','describe','sms-interactions','accept','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','SmsInteraction','SmsInteractionId','isNil','interaction','info','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','null','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','internal','rejectmessage','SmsAccount','SmsAccountId','received\x20delivery\x20report\x20from','inspect','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','twilio','MessageUUID','sent','Status','plivio','results','groupName','DELIVERED','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','defaults','redis','localhost','register','jayson/promise','client','http','request','debug','code','error','SmsMessage,\x20%s,\x20%s','message','request\x20sent','result','catch','status'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x9666,0x17a));var _0x6966=function(_0xf7a6d5,_0x12436d){_0xf7a6d5=_0xf7a6d5-0x0;var _0x5bb1c1=_0x9666[_0xf7a6d5];return _0x5bb1c1;};'use strict';var emlformat=require(_0x6966('0x0'));var rimraf=require(_0x6966('0x1'));var zipdir=require(_0x6966('0x2'));var jsonpatch=require(_0x6966('0x3'));var rp=require('request-promise');var moment=require(_0x6966('0x4'));var BPromise=require(_0x6966('0x5'));var Mustache=require(_0x6966('0x6'));var util=require('util');var path=require('path');var sox=require(_0x6966('0x7'));var csv=require(_0x6966('0x8'));var ejs=require(_0x6966('0x9'));var fs=require('fs');var fs_extra=require(_0x6966('0xa'));var _=require(_0x6966('0xb'));var squel=require(_0x6966('0xc'));var crypto=require('crypto');var jsforce=require(_0x6966('0xd'));var deskjs=require(_0x6966('0xe'));var toCsv=require(_0x6966('0x8'));var querystring=require('querystring');var Papa=require(_0x6966('0xf'));var Redis=require(_0x6966('0x10'));var authService=require(_0x6966('0x11'));var qs=require(_0x6966('0x12'));var as=require(_0x6966('0x13'));var hardwareService=require(_0x6966('0x14'));var logger=require(_0x6966('0x15'))(_0x6966('0x16'));var utils=require(_0x6966('0x17'));var config=require(_0x6966('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0x6966('0x19')](config[_0x6966('0x1a')],{'host':_0x6966('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./smsMessage.socket')[_0x6966('0x1c')](socket);var jayson=require(_0x6966('0x1d'));var client=jayson[_0x6966('0x1e')][_0x6966('0x1f')]({'port':0x232c});var client9002=jayson[_0x6966('0x1e')]['http']({'port':0x232a});function respondWithRpcPromise(_0x204200,_0x1bf59d,_0x550d77,_0x376300){return new BPromise(function(_0x30f650,_0x26df66){var _0x529dbd=_0x376300||client;return _0x529dbd[_0x6966('0x20')](_0x204200,_0x550d77)['then'](function(_0x43e2e9){logger['info']('SmsMessage,\x20%s,\x20%s',_0x1bf59d,'request\x20sent');logger[_0x6966('0x21')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x1bf59d,'request\x20sent',JSON['stringify'](_0x43e2e9));if(_0x43e2e9['error']){if(_0x43e2e9['error'][_0x6966('0x22')]===0x1f4){logger[_0x6966('0x23')](_0x6966('0x24'),_0x1bf59d,_0x43e2e9['error'][_0x6966('0x25')]);return _0x26df66(_0x43e2e9[_0x6966('0x23')][_0x6966('0x25')]);}logger[_0x6966('0x23')](_0x6966('0x24'),_0x1bf59d,_0x43e2e9[_0x6966('0x23')][_0x6966('0x25')]);return _0x30f650(_0x43e2e9[_0x6966('0x23')][_0x6966('0x25')]);}else{logger['info'](_0x6966('0x24'),_0x1bf59d,_0x6966('0x26'));_0x30f650(_0x43e2e9[_0x6966('0x27')][_0x6966('0x25')]);}})[_0x6966('0x28')](function(_0x27db0e){logger[_0x6966('0x23')]('SmsMessage,\x20%s,\x20%s',_0x1bf59d,_0x27db0e);_0x26df66(_0x27db0e);});});}function respondWithStatusCode(_0x221b7d,_0x5a7f85){_0x5a7f85=_0x5a7f85||0xcc;return function(_0x433601){if(_0x433601){return _0x221b7d['sendStatus'](_0x5a7f85);}return _0x221b7d[_0x6966('0x29')](_0x5a7f85)[_0x6966('0x2a')]();};}function respondWithResult(_0xeae4fb,_0x85106d){_0x85106d=_0x85106d||0xc8;return function(_0x3c2b41){if(_0x3c2b41){return _0xeae4fb[_0x6966('0x29')](_0x85106d)[_0x6966('0x2b')](_0x3c2b41);}};}function respondWithFilteredResult(_0x1b86a7,_0x2c9fbb){return function(_0x4a85c7){if(_0x4a85c7){var _0x270919=typeof _0x2c9fbb[_0x6966('0x2c')]==='undefined'&&typeof _0x2c9fbb[_0x6966('0x2d')]==='undefined';var _0x44b6b0=_0x4a85c7[_0x6966('0x2e')];var _0x171f19=_0x270919?0x0:_0x2c9fbb[_0x6966('0x2c')];var _0x40a50d=_0x270919?_0x4a85c7[_0x6966('0x2e')]:_0x2c9fbb[_0x6966('0x2c')]+_0x2c9fbb[_0x6966('0x2d')];var _0x3346f5;if(_0x40a50d>=_0x44b6b0){_0x40a50d=_0x44b6b0;_0x3346f5=0xc8;}else{_0x3346f5=0xce;}_0x1b86a7[_0x6966('0x29')](_0x3346f5);return _0x1b86a7[_0x6966('0x2f')](_0x6966('0x30'),_0x171f19+'-'+_0x40a50d+'/'+_0x44b6b0)[_0x6966('0x2b')](_0x4a85c7);}return null;};}function patchUpdates(_0x1b433c){return function(_0x8e7e81){try{jsonpatch[_0x6966('0x31')](_0x8e7e81,_0x1b433c,!![]);}catch(_0x4af933){return BPromise[_0x6966('0x32')](_0x4af933);}return _0x8e7e81['save']();};}function saveUpdates(_0x167ed7,_0x9d4803){return function(_0x1b0118){if(_0x1b0118){return _0x1b0118[_0x6966('0x33')](_0x167ed7)[_0x6966('0x34')](function(_0x1fb851){return _0x1fb851;});}return null;};}function removeEntity(_0x3316b0,_0x12f579){return function(_0x129a56){if(_0x129a56){return _0x129a56[_0x6966('0x35')]()['then'](function(){_0x3316b0[_0x6966('0x29')](0xcc)[_0x6966('0x2a')]();});}};}function handleEntityNotFound(_0x45976a,_0x4fbdc6){return function(_0x5edd22){if(!_0x5edd22){_0x45976a[_0x6966('0x36')](0x194);}return _0x5edd22;};}function handleError(_0x1cc795,_0x492528){_0x492528=_0x492528||0x1f4;return function(_0x1b4925){logger['error'](_0x1b4925['stack']);if(_0x1b4925[_0x6966('0x37')]){delete _0x1b4925[_0x6966('0x37')];}_0x1cc795[_0x6966('0x29')](_0x492528)[_0x6966('0x38')](_0x1b4925);};}exports['index']=function(_0x40667f,_0x678ac){var _0xd47a92={},_0xa47954={},_0x2520e2={'count':0x0,'rows':[]};var _0x14496f=_[_0x6966('0x39')](db[_0x6966('0x3a')][_0x6966('0x3b')],function(_0x112bff){return{'name':_0x112bff[_0x6966('0x3c')],'type':_0x112bff[_0x6966('0x3d')][_0x6966('0x3e')]};});_0xa47954['model']=_[_0x6966('0x39')](_0x14496f,_0x6966('0x37'));_0xa47954['query']=_[_0x6966('0x3f')](_0x40667f[_0x6966('0x40')]);_0xa47954['filters']=_['intersection'](_0xa47954[_0x6966('0x41')],_0xa47954[_0x6966('0x40')]);_0xd47a92[_0x6966('0x42')]=_['intersection'](_0xa47954[_0x6966('0x41')],qs[_0x6966('0x43')](_0x40667f[_0x6966('0x40')][_0x6966('0x43')]));_0xd47a92[_0x6966('0x42')]=_0xd47a92[_0x6966('0x42')][_0x6966('0x44')]?_0xd47a92[_0x6966('0x42')]:_0xa47954[_0x6966('0x41')];if(!_0x40667f['query']['hasOwnProperty']('nolimit')){_0xd47a92[_0x6966('0x2d')]=qs['limit'](_0x40667f[_0x6966('0x40')][_0x6966('0x2d')]);_0xd47a92['offset']=qs[_0x6966('0x2c')](_0x40667f['query'][_0x6966('0x2c')]);}_0xd47a92[_0x6966('0x45')]=qs[_0x6966('0x46')](_0x40667f[_0x6966('0x40')][_0x6966('0x46')]);_0xd47a92[_0x6966('0x47')]=qs[_0x6966('0x48')](_[_0x6966('0x49')](_0x40667f[_0x6966('0x40')],_0xa47954[_0x6966('0x48')]),_0x14496f);if(_0x40667f[_0x6966('0x40')]['filter']){_0xd47a92[_0x6966('0x47')]=_[_0x6966('0x4a')](_0xd47a92[_0x6966('0x47')],{'$or':_['map'](_0x14496f,function(_0x1a9bf6){if(_0x1a9bf6[_0x6966('0x3d')]!=='VIRTUAL'){var _0x3153d9={};_0x3153d9[_0x1a9bf6[_0x6966('0x37')]]={'$like':'%'+_0x40667f[_0x6966('0x40')][_0x6966('0x4b')]+'%'};return _0x3153d9;}})});}_0xd47a92=_[_0x6966('0x4a')]({},_0xd47a92,_0x40667f[_0x6966('0x4c')]);var _0xf4227d={'where':_0xd47a92[_0x6966('0x47')]};return db[_0x6966('0x3a')][_0x6966('0x2e')](_0xf4227d)['then'](function(_0x882953){_0x2520e2['count']=_0x882953;if(_0x40667f[_0x6966('0x40')][_0x6966('0x4d')]){_0xd47a92['include']=[{'all':!![]}];}return db[_0x6966('0x3a')]['findAll'](_0xd47a92);})[_0x6966('0x34')](function(_0x165bdd){_0x2520e2[_0x6966('0x4e')]=_0x165bdd;return _0x2520e2;})['then'](respondWithFilteredResult(_0x678ac,_0xd47a92))[_0x6966('0x28')](handleError(_0x678ac,null));};exports['show']=function(_0x26f69f,_0xffdd04){var _0x348319={'raw':!![],'where':{'id':_0x26f69f['params']['id']}},_0x4b9091={};_0x4b9091[_0x6966('0x41')]=_[_0x6966('0x3f')](db[_0x6966('0x3a')][_0x6966('0x3b')]);_0x4b9091[_0x6966('0x40')]=_['keys'](_0x26f69f[_0x6966('0x40')]);_0x4b9091[_0x6966('0x48')]=_[_0x6966('0x4f')](_0x4b9091[_0x6966('0x41')],_0x4b9091[_0x6966('0x40')]);_0x348319[_0x6966('0x42')]=_[_0x6966('0x4f')](_0x4b9091[_0x6966('0x41')],qs[_0x6966('0x43')](_0x26f69f['query']['fields']));_0x348319[_0x6966('0x42')]=_0x348319['attributes']['length']?_0x348319[_0x6966('0x42')]:_0x4b9091[_0x6966('0x41')];if(_0x26f69f[_0x6966('0x40')][_0x6966('0x4d')]){_0x348319[_0x6966('0x50')]=[{'all':!![]}];}_0x348319=_[_0x6966('0x4a')]({},_0x348319,_0x26f69f[_0x6966('0x4c')]);return db[_0x6966('0x3a')][_0x6966('0x51')](_0x348319)[_0x6966('0x34')](handleEntityNotFound(_0xffdd04,null))[_0x6966('0x34')](respondWithResult(_0xffdd04,null))[_0x6966('0x28')](handleError(_0xffdd04,null));};exports['create']=function(_0x4fa465,_0x42f437){return db[_0x6966('0x3a')][_0x6966('0x52')](_0x4fa465[_0x6966('0x53')],{})[_0x6966('0x34')](respondWithResult(_0x42f437,0xc9))['catch'](handleError(_0x42f437,null));};exports[_0x6966('0x33')]=function(_0x2775e0,_0xce65be){if(_0x2775e0['body']['id']){delete _0x2775e0[_0x6966('0x53')]['id'];}return db[_0x6966('0x3a')][_0x6966('0x51')]({'where':{'id':_0x2775e0[_0x6966('0x54')]['id']}})[_0x6966('0x34')](handleEntityNotFound(_0xce65be,null))[_0x6966('0x34')](saveUpdates(_0x2775e0[_0x6966('0x53')],null))[_0x6966('0x34')](respondWithResult(_0xce65be,null))[_0x6966('0x28')](handleError(_0xce65be,null));};exports[_0x6966('0x35')]=function(_0x537a7d,_0x58c1e1){return db[_0x6966('0x3a')][_0x6966('0x51')]({'where':{'id':_0x537a7d[_0x6966('0x54')]['id']}})[_0x6966('0x34')](handleEntityNotFound(_0x58c1e1,null))[_0x6966('0x34')](removeEntity(_0x58c1e1,null))[_0x6966('0x28')](handleError(_0x58c1e1,null));};exports['describe']=function(_0x3b4a15,_0x1b3d45){return db[_0x6966('0x3a')][_0x6966('0x55')]()[_0x6966('0x34')](respondWithResult(_0x1b3d45,null))[_0x6966('0x28')](handleError(_0x1b3d45,null));};var interaction_log=require('../../config/logger')(_0x6966('0x56'));exports[_0x6966('0x57')]=function(_0x333f45,_0x34110d,_0x5d2519){var _0x41ec2e={'agent':{},'channel':'sms'};if(_0x333f45[_0x6966('0x53')]['id']){delete _0x333f45[_0x6966('0x53')]['id'];}_0x333f45[_0x6966('0x53')]['read']=!![];_0x333f45['body']['readAt']=moment()[_0x6966('0x58')](_0x6966('0x59'));_0x333f45['body']['UserId']=_0x333f45['body'][_0x6966('0x5a')]||_0x333f45[_0x6966('0x5b')]['id'];_0x41ec2e[_0x6966('0x5c')]['id']=_0x333f45[_0x6966('0x53')][_0x6966('0x5a')];return db[_0x6966('0x3a')]['find']({'where':{'id':_0x333f45['params']['id'],'UserId':null}})[_0x6966('0x34')](handleEntityNotFound(_0x34110d,null))['then'](saveUpdates(_0x333f45[_0x6966('0x53')],null))[_0x6966('0x34')](function(_0x11135f){if(_0x11135f){_0x41ec2e[_0x6966('0x25')]=_0x11135f[_0x6966('0x5d')]({'plain':!![]});return db[_0x6966('0x5e')][_0x6966('0x51')]({'where':{'id':_0x11135f[_0x6966('0x5f')]}});}return null;})[_0x6966('0x34')](handleEntityNotFound(_0x34110d,null))[_0x6966('0x34')](function(_0x1d0af3){if(_0x1d0af3){return _0x1d0af3['update']({'UserId':_0x333f45[_0x6966('0x53')][_0x6966('0x5a')],'read1stAt':_[_0x6966('0x60')](_0x1d0af3['read1stAt'])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x6966('0x34')](function(_0xd73efc){if(_0xd73efc){_0x41ec2e[_0x6966('0x61')]=_0xd73efc['get']({'plain':!![]});interaction_log[_0x6966('0x62')](_0x6966('0x63'),_0x333f45[_0x6966('0x5b')]['id'],_0x333f45['user'][_0x6966('0x37')],_0x333f45[_0x6966('0x5b')]['role'],_0x41ec2e[_0x6966('0x61')]['id'],_0x333f45[_0x6966('0x53')]?JSON[_0x6966('0x64')](_0x333f45['body']):_0x6966('0x65'));return respondWithRpcPromise(_0x6966('0x66'),_0x6966('0x67'),_0x41ec2e);}return null;})['then'](function(_0xc260e0){var _0x589560='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0xc260e0[_0x6966('0x25')][_0x6966('0x68')];return db[_0x6966('0x69')]['query'](_0x589560,{'type':db[_0x6966('0x6a')][_0x6966('0x6b')][_0x6966('0x6c')],'raw':!![]})[_0x6966('0x34')](function(_0x3e8164){return _0x3e8164;});})[_0x6966('0x34')](function(_0x5370dc){if(_0x5370dc){_0x41ec2e['message'][_0x6966('0x6d')]=_0x5370dc[0x0];if(!_0x333f45[_0x6966('0x53')][_0x6966('0x5a')])return;return db[_0x6966('0x6e')][_0x6966('0x51')]({'where':{'id':_0x333f45[_0x6966('0x53')][_0x6966('0x5a')],'role':_0x6966('0x5c')},'attributes':['id',_0x6966('0x37'),_0x6966('0x6f'),_0x6966('0x70'),'internal'],'raw':!![]});}return null;})[_0x6966('0x34')](function(_0x4ba9af){if(!_0x4ba9af)return null;_0x41ec2e['message'][_0x6966('0x5c')]=_0x4ba9af;return _0x41ec2e;})[_0x6966('0x34')](function(_0x1781b9){if(_0x1781b9){if(_0x333f45['body']['manual']){_0x41ec2e[_0x6966('0x25')][_0x6966('0x71')]=util[_0x6966('0x58')](_0x6966('0x72'),_0x333f45[_0x6966('0x5b')]['name']);_0x41ec2e[_0x6966('0x25')][_0x6966('0x73')]=_0x41ec2e[_0x6966('0x73')];_0x41ec2e['message'][_0x6966('0x74')]=_0x41ec2e[_0x6966('0x73')];_0x41ec2e[_0x6966('0x25')][_0x6966('0x75')]=_0x6966('0x57');return respondWithRpcPromise(_0x6966('0x76'),_0x6966('0x76'),{'event':_0x6966('0x77'),'message':_0x41ec2e['message']},client9002)[_0x6966('0x34')](function(){return _0x41ec2e;});}return _0x41ec2e;}return null;})[_0x6966('0x34')](respondWithResult(_0x34110d,null))[_0x6966('0x28')](handleError(_0x34110d,null));};var interaction_log=require(_0x6966('0x15'))(_0x6966('0x56'));exports['reject']=function(_0x57b1c7,_0xc9fc00,_0x43178b){var _0x29d229={'agent':{},'channel':'sms'};if(_0x57b1c7['body']['id']){delete _0x57b1c7[_0x6966('0x53')]['id'];}_0x57b1c7[_0x6966('0x53')]['UserId']=_0x57b1c7[_0x6966('0x53')][_0x6966('0x5a')]||_0x57b1c7['user']['id'];_0x29d229[_0x6966('0x5c')]['id']=_0x57b1c7[_0x6966('0x53')][_0x6966('0x5a')];return db[_0x6966('0x3a')][_0x6966('0x51')]({'where':{'id':_0x57b1c7['params']['id'],'UserId':null}})[_0x6966('0x34')](handleEntityNotFound(_0xc9fc00,null))['then'](function(_0x2d0fe8){if(_0x2d0fe8){_0x29d229[_0x6966('0x25')]=_0x2d0fe8[_0x6966('0x5d')]({'plain':!![]});return db['SmsInteraction'][_0x6966('0x51')]({'where':{'id':_0x2d0fe8[_0x6966('0x5f')]}});}return null;})['then'](handleEntityNotFound(_0xc9fc00,null))['then'](function(_0x54ff54){if(_0x54ff54){_0x29d229[_0x6966('0x61')]=_0x54ff54[_0x6966('0x5d')]({'plain':!![]});interaction_log[_0x6966('0x62')]('[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x57b1c7[_0x6966('0x5b')]['id'],_0x57b1c7[_0x6966('0x5b')][_0x6966('0x37')],_0x57b1c7['user']['role'],_0x29d229[_0x6966('0x61')]['id'],_0x57b1c7[_0x6966('0x53')]?JSON[_0x6966('0x64')](_0x57b1c7[_0x6966('0x53')]):_0x6966('0x65'));return respondWithRpcPromise(_0x6966('0x78'),_0x6966('0x79'),_0x29d229);}return null;})['then'](function(_0x58849c){var _0x500dcd=_0x6966('0x7a')+_0x58849c[_0x6966('0x25')][_0x6966('0x68')];return db[_0x6966('0x69')][_0x6966('0x40')](_0x500dcd,{'type':db[_0x6966('0x6a')]['QueryTypes']['SELECT'],'raw':!![]})['then'](function(_0x13dd27){return _0x13dd27;});})[_0x6966('0x34')](function(_0x4dc2c1){if(_0x4dc2c1){_0x29d229[_0x6966('0x25')][_0x6966('0x6d')]=_0x4dc2c1[0x0];if(!_0x57b1c7[_0x6966('0x53')]['UserId'])return;return db['User'][_0x6966('0x51')]({'where':{'id':_0x57b1c7[_0x6966('0x53')][_0x6966('0x5a')],'role':_0x6966('0x5c')},'attributes':['id',_0x6966('0x37'),_0x6966('0x6f'),_0x6966('0x70'),_0x6966('0x7b')],'raw':!![]});}return null;})[_0x6966('0x34')](function(_0x246d25){if(!_0x246d25)return null;_0x29d229[_0x6966('0x25')][_0x6966('0x5c')]=_0x246d25;return _0x29d229;})[_0x6966('0x34')](function(_0x4e8806){if(_0x4e8806){_0x4e8806[_0x6966('0x25')][_0x6966('0x71')]=util[_0x6966('0x58')](_0x6966('0x72'),_0x57b1c7[_0x6966('0x5b')]['name']);_0x4e8806[_0x6966('0x25')][_0x6966('0x73')]=_0x29d229[_0x6966('0x73')];_0x4e8806[_0x6966('0x25')][_0x6966('0x74')]=_0x29d229[_0x6966('0x73')];_0x4e8806[_0x6966('0x25')][_0x6966('0x75')]=_0x6966('0x32');respondWithRpcPromise(_0x6966('0x76'),'EventManager',{'event':_0x6966('0x7c'),'message':_0x4e8806[_0x6966('0x25')]},client9002);return _0x29d229;}return null;})[_0x6966('0x34')](respondWithResult(_0xc9fc00,null))[_0x6966('0x28')](handleError(_0xc9fc00,null));};exports[_0x6966('0x29')]=function(_0xdb0b73,_0x475904,_0x889e80){if(_0xdb0b73[_0x6966('0x53')]['id']){delete _0xdb0b73[_0x6966('0x53')]['id'];}var _0x444de8;return db[_0x6966('0x3a')][_0x6966('0x51')]({'where':{'id':_0xdb0b73['params']['id']}})[_0x6966('0x34')](handleEntityNotFound(_0x475904,null))[_0x6966('0x34')](function(_0x482906){if(_0x482906){_0x444de8=_0x482906;return db[_0x6966('0x7d')][_0x6966('0x51')]({'where':{'id':_0x482906[_0x6966('0x7e')]}});}})[_0x6966('0x34')](handleEntityNotFound(_0x475904,null))[_0x6966('0x34')](function(_0x4f7672){if(_0x4f7672){logger['debug']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x6966('0x29'),_0x6966('0x7f'),_0x4f7672['type'],util[_0x6966('0x80')](_0xdb0b73[_0x6966('0x53')],{'showHidden':![],'depth':null}));switch(_0x4f7672[_0x6966('0x3d')]){case'twilio':if(_0xdb0b73[_0x6966('0x53')][_0x6966('0x81')]&&_0xdb0b73[_0x6966('0x53')][_0x6966('0x81')]===_0x444de8[_0x6966('0x82')]){return _0x444de8[_0x6966('0x33')]({'read':!![]});}else{logger['error'](_0x6966('0x83'),_0x6966('0x29'),_0x6966('0x84'),util[_0x6966('0x80')](_0xdb0b73[_0x6966('0x53')],{'showHidden':![],'depth':null}));}break;case'plivo':if(_0xdb0b73[_0x6966('0x53')][_0x6966('0x85')]&&_0xdb0b73[_0x6966('0x53')][_0x6966('0x85')]===_0x444de8[_0x6966('0x82')]&&_['indexOf']([_0x6966('0x86'),'delivered'],_0xdb0b73[_0x6966('0x53')][_0x6966('0x87')])>=0x0){return _0x444de8[_0x6966('0x33')]({'read':!![]});}else{logger['error'](_0x6966('0x83'),_0x6966('0x29'),_0x6966('0x88'),util[_0x6966('0x80')](_0xdb0b73['body'],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x2e08af=_0xdb0b73[_0x6966('0x53')][_0x6966('0x89')][0x0];if(_0x2e08af[_0x6966('0x29')][_0x6966('0x8a')]===_0x6966('0x8b')){return _0x444de8['update']({'read':!![]});}else{logger['error'](_0x6966('0x83'),_0x6966('0x29'),'infobip',util[_0x6966('0x80')](_0xdb0b73['body'],{'showHidden':![],'depth':null}));}break;}return _0x444de8;}})[_0x6966('0x34')](respondWithResult(_0x475904,null))['catch'](handleError(_0x475904,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 0a17115..b1f852d 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 _0xadee=['remove','emit','hasOwnProperty','hook','exports','setMaxListeners','save','update'];(function(_0x26ef37,_0x34b7e5){var _0x45144a=function(_0x15113e){while(--_0x15113e){_0x26ef37['push'](_0x26ef37['shift']());}};_0x45144a(++_0x34b7e5);}(_0xadee,0x12d));var _0xeade=function(_0x20c8ec,_0x3af485){_0x20c8ec=_0x20c8ec-0x0;var _0x161cf8=_0xadee[_0x20c8ec];return _0x161cf8;};'use strict';var EventEmitter=require('events');var SmsMessage=require('../../mysqldb')['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xeade('0x0')](0x0);var events={'afterCreate':_0xeade('0x1'),'afterUpdate':_0xeade('0x2'),'afterDestroy':_0xeade('0x3')};function emitEvent(_0x3277a3){return function(_0x186001,_0x133433,_0x6dd5aa){SmsMessageEvents[_0xeade('0x4')](_0x3277a3+':'+_0x186001['id'],_0x186001);SmsMessageEvents[_0xeade('0x4')](_0x3277a3,_0x186001);_0x6dd5aa(null);};}for(var e in events){if(events[_0xeade('0x5')](e)){var event=events[e];SmsMessage[_0xeade('0x6')](e,emitEvent(event));}}module[_0xeade('0x7')]=SmsMessageEvents; \ No newline at end of file +var _0x6662=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','SmsMessage','setMaxListeners','save','update'];(function(_0x12402a,_0x550650){var _0x3213d4=function(_0x221318){while(--_0x221318){_0x12402a['push'](_0x12402a['shift']());}};_0x3213d4(++_0x550650);}(_0x6662,0x1b2));var _0x2666=function(_0x542149,_0x5df180){_0x542149=_0x542149-0x0;var _0x36df57=_0x6662[_0x542149];return _0x36df57;};'use strict';var EventEmitter=require(_0x2666('0x0'));var SmsMessage=require(_0x2666('0x1'))['db'][_0x2666('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x2666('0x3')](0x0);var events={'afterCreate':_0x2666('0x4'),'afterUpdate':_0x2666('0x5'),'afterDestroy':_0x2666('0x6')};function emitEvent(_0x1f99c6){return function(_0x2575eb,_0x12d004,_0x572862){SmsMessageEvents[_0x2666('0x7')](_0x1f99c6+':'+_0x2575eb['id'],_0x2575eb);SmsMessageEvents['emit'](_0x1f99c6,_0x2575eb);_0x572862(null);};}for(var e in events){if(events[_0x2666('0x8')](e)){var event=events[e];SmsMessage[_0x2666('0x9')](e,emitEvent(event));}}module[_0x2666('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 984bf1d..52552dc 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 _0x7eb7=['Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/sms/2/text/advanced','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','login','text','timestamp','keys','sort','length','apiKey','createHash','md5','hex','GET','/external/get/send.php?','id_sms','csc','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','apiMessageId','https://messaging.bandwidth.com/api/v2/users/','accountId','applicationId','bandwidth','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','message','intelepeer','finally','utf8mb4','lodash','util','api','moment','bluebird','request-promise','path','messageId','fti_sms_messages','body','FULLTEXT','get','direction','toLowerCase','out','secret','UserId','isNil','SmsInteractionId','then','update','createdAt','catch','error','SmsAccount','SmsAccountId','type','twilio','accountSid','authToken','phone','messages','create','remote','token','sid','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','login?username=','split','POST','total_sent','deliveryReport','read','Missing\x20parameters:\x20username,\x20password','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','http_code','data','queued_count','head','message_id','clickSend','plivo','authId','/status?token=','https://api.plivo.com/v1/Account/%s/Message/','base64','message_uuid'];(function(_0x1e54a8,_0x1c23e0){var _0x1d2e92=function(_0x22d69f){while(--_0x22d69f){_0x1e54a8['push'](_0x1e54a8['shift']());}};_0x1d2e92(++_0x1c23e0);}(_0x7eb7,0x112));var _0x77eb=function(_0x8cadf3,_0x4ad69d){_0x8cadf3=_0x8cadf3-0x0;var _0x2b7eca=_0x7eb7[_0x8cadf3];return _0x2b7eca;};'use strict';var _=require(_0x77eb('0x0'));var util=require(_0x77eb('0x1'));var logger=require('../../config/logger')(_0x77eb('0x2'));var moment=require(_0x77eb('0x3'));var BPromise=require(_0x77eb('0x4'));var rp=require(_0x77eb('0x5'));var fs=require('fs');var path=require(_0x77eb('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./smsMessage.attributes');module['exports']=function(_0x3bb915,_0x4a9041){return _0x3bb915['define']('SmsMessage',attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':_0x77eb('0x7'),'fields':['messageId']},{'name':_0x77eb('0x8'),'fields':[_0x77eb('0x9')],'type':_0x77eb('0xa')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x16aee6,_0x274db1,_0x1a0947){var _0xfd704c=_0x3bb915['models'];var _0x3fb8e8=_0x16aee6[_0x77eb('0xb')]({'plain':!![]});if(_0x3fb8e8[_0x77eb('0xc')][_0x77eb('0xd')]()==='in'||_0x3fb8e8['direction'][_0x77eb('0xd')]()===_0x77eb('0xe')&&!_0x3fb8e8[_0x77eb('0xf')]&&!_['isNil'](_0x3fb8e8[_0x77eb('0x10')])&&!_[_0x77eb('0x11')](_0x3fb8e8[_0x77eb('0x12')])){_0xfd704c['SmsInteraction']['findOne']({'where':{'id':_0x3fb8e8[_0x77eb('0x12')]}})[_0x77eb('0x13')](function(_0x515faa){if(_0x515faa){_0x515faa[_0x77eb('0x14')]({'lastMsgAt':_0x3fb8e8[_0x77eb('0x15')],'lastMsgDirection':_0x3fb8e8[_0x77eb('0xc')][_0x77eb('0xd')]()});}})[_0x77eb('0x16')](function(_0x36b25b){console[_0x77eb('0x17')](_0x36b25b);});}if(_0x3fb8e8[_0x77eb('0xc')]===_0x77eb('0xe')&&!_0x3fb8e8[_0x77eb('0xf')]){var _0x246b41;_0xfd704c[_0x77eb('0x18')]['find']({'where':{'id':_0x3fb8e8[_0x77eb('0x19')]},'raw':!![]})[_0x77eb('0x13')](function(_0x33b5fd){_0x246b41=_0x33b5fd;if(_0x246b41&&_0x246b41[_0x77eb('0x1a')]){switch(_0x246b41[_0x77eb('0x1a')]){case'twilio':var _0x1e88dd=require(_0x77eb('0x1b'));if(_0x246b41[_0x77eb('0x1c')]&&_0x246b41[_0x77eb('0x1d')]&&_0x246b41[_0x77eb('0x1e')]){var _0x1179b2=new _0x1e88dd(_0x246b41[_0x77eb('0x1c')],_0x246b41[_0x77eb('0x1d')]);_0x1179b2[_0x77eb('0x1f')][_0x77eb('0x20')]({'body':_0x3fb8e8['body'],'to':_0x3fb8e8[_0x77eb('0x1e')],'from':_0x246b41[_0x77eb('0x1e')],'statusCallback':_0x246b41[_0x77eb('0x21')]+'/api/sms/messages/'+_0x3fb8e8['id']+'/status?token='+_0x246b41[_0x77eb('0x22')]})['then'](function(_0x818c8b){if(_0x818c8b[_0x77eb('0x23')]){return _0x16aee6[_0x77eb('0x14')]({'messageId':_0x818c8b['sid']});}})[_0x77eb('0x16')](function(_0x5ef765){logger[_0x77eb('0x17')](_0x77eb('0x24'),_0x77eb('0x25'),_0x77eb('0x1b'),util[_0x77eb('0x26')](_0x5ef765,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x77eb('0x24'),_0x77eb('0x25'),_0x77eb('0x1b'),_0x77eb('0x27'));}break;case _0x77eb('0x28'):var _0x4a72c1=_0x77eb('0x29');if(_0x246b41[_0x77eb('0x2a')]&&_0x246b41[_0x77eb('0x2b')]){var _0x308094={'recipient':[_0x3fb8e8['phone']],'message':_0x3fb8e8['body'],'message_type':_0x246b41[_0x77eb('0x2c')]};if(_0x246b41[_0x77eb('0x2c')]&&_0x246b41['smsMethod']!=='SI'){_0x308094[_0x77eb('0x2d')]=_0x246b41['phone'];}var _0x5e317a={'url':_0x4a72c1+_0x77eb('0x2e')+_0x246b41[_0x77eb('0x2a')]+'&password='+_0x246b41[_0x77eb('0x2b')],'method':'GET'};rp(_0x5e317a)[_0x77eb('0x13')](function(_0x37a587){var _0x408bfe=_0x37a587[_0x77eb('0x2f')](';');var _0x40ee4f={'user_key':_0x408bfe[0x0],'session_key':_0x408bfe[0x1]};_0x5e317a={'url':_0x4a72c1+'sms','method':_0x77eb('0x30'),'headers':{'user_key':_0x40ee4f['user_key'],'Session_key':_0x40ee4f['session_key']},'json':!![],'body':_0x308094};return rp(_0x5e317a);})[_0x77eb('0x13')](function(_0x2ccb57){if(_0x2ccb57[_0x77eb('0x31')]>=0x1){var _0x353621={'messageId':_0x2ccb57['internal_order_id']};if(_0x246b41['smsMethod']!=='GP'||!_0x246b41[_0x77eb('0x32')]){_0x353621[_0x77eb('0x33')]=!![];}return _0x16aee6[_0x77eb('0x14')](_0x353621);}else{return logger[_0x77eb('0x17')](_0x77eb('0x24'),_0x77eb('0x25'),_0x77eb('0x28'),util[_0x77eb('0x26')](_0x2ccb57,{'showHidden':![],'depth':null}));}})[_0x77eb('0x16')](function(_0x4cc67a){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x77eb('0x25'),_0x77eb('0x28'),util[_0x77eb('0x26')](_0x4cc67a,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x77eb('0x24'),_0x77eb('0x25'),'skebby',_0x77eb('0x34'));}break;case _0x77eb('0x35'):if(_0x246b41[_0x77eb('0x1d')]){var _0x28d2a4={'recipient':_0x3fb8e8['phone'],'message':_0x3fb8e8[_0x77eb('0x9')],'sender':_0x246b41[_0x77eb('0x36')]||_0x246b41[_0x77eb('0x1e')],'authorization':_0x246b41[_0x77eb('0x1d')]};var _0x274db1={'method':_0x77eb('0x30'),'uri':_0x77eb('0x37'),'body':_0x28d2a4,'json':!![]};rp(_0x274db1)[_0x77eb('0x13')](function(_0x22bc58){var _0x5ecfad={'messageId':_0x22bc58[_0x77eb('0x38')]};if(!_0x246b41[_0x77eb('0x32')]){_0x5ecfad[_0x77eb('0x33')]=!![];}return _0x16aee6[_0x77eb('0x14')](_0x5ecfad);})['catch'](function(_0x26a48d){logger[_0x77eb('0x17')](_0x77eb('0x24'),_0x77eb('0x25'),_0x77eb('0x35'),util[_0x77eb('0x26')](_0x26a48d,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x77eb('0x25'),'connectel',_0x77eb('0x39'));}break;case _0x77eb('0x3a'):if(_0x246b41['username']&&_0x246b41[_0x77eb('0x2b')]){var _0x28d2a4={'messages':[{'source':_0x77eb('0x3b'),'to':_0x3fb8e8['phone'],'body':_0x3fb8e8[_0x77eb('0x9')],'from':_0x246b41[_0x77eb('0x36')]||_0x246b41[_0x77eb('0x1e')]}]};var _0x49e922=util[_0x77eb('0x3c')](_0x77eb('0x3d'),_0x246b41[_0x77eb('0x2a')],_0x246b41[_0x77eb('0x2b')]);var _0x274db1={'method':_0x77eb('0x30'),'uri':_0x77eb('0x3e'),'body':_0x28d2a4,'headers':{'Authorization':util[_0x77eb('0x3c')](_0x77eb('0x3f'),new Buffer(_0x49e922)[_0x77eb('0x40')]('base64'))},'json':!![]};rp(_0x274db1)['then'](function(_0x511e87){if(_0x511e87[_0x77eb('0x41')]>=0xc8&&_0x511e87['http_code']<=0xce){if(_0x511e87['data']&&_0x511e87[_0x77eb('0x42')][_0x77eb('0x43')]>0x0){var _0x285b5e=_[_0x77eb('0x44')](_0x511e87[_0x77eb('0x42')][_0x77eb('0x1f')]);var _0x532304={'messageId':_0x285b5e[_0x77eb('0x45')]};if(!_0x246b41['deliveryReport']){_0x532304[_0x77eb('0x33')]=!![];}return _0x16aee6[_0x77eb('0x14')](_0x532304);}else{logger[_0x77eb('0x17')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x77eb('0x25'),'clickSend',util[_0x77eb('0x26')](_0x511e87,{'showHidden':![],'depth':null}));}}else{logger[_0x77eb('0x17')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x77eb('0x46'),util[_0x77eb('0x26')](_0x511e87,{'showHidden':![],'depth':null}));}})['catch'](function(_0x2115e9){logger[_0x77eb('0x17')](_0x77eb('0x24'),_0x77eb('0x25'),'clickSend',util[_0x77eb('0x26')](_0x2115e9,{'showHidden':![],'depth':null}));});}else{logger[_0x77eb('0x17')](_0x77eb('0x24'),_0x77eb('0x25'),_0x77eb('0x46'),_0x77eb('0x34'));}break;case _0x77eb('0x47'):if(_0x246b41[_0x77eb('0x48')]&&_0x246b41['authToken']){var _0x28d2a4={'dst':_0x3fb8e8[_0x77eb('0x1e')],'text':_0x3fb8e8['body'],'src':_0x246b41['senderString']||_0x246b41[_0x77eb('0x1e')],'url':_0x246b41['remote']+'/api/sms/messages/'+_0x3fb8e8['id']+_0x77eb('0x49')+_0x246b41[_0x77eb('0x22')]};var _0x49e922=util['format'](_0x77eb('0x3d'),_0x246b41[_0x77eb('0x48')],_0x246b41[_0x77eb('0x1d')]);var _0x274db1={'method':'POST','uri':util['format'](_0x77eb('0x4a'),_0x246b41[_0x77eb('0x48')]),'body':_0x28d2a4,'headers':{'Authorization':util[_0x77eb('0x3c')](_0x77eb('0x3f'),new Buffer(_0x49e922)[_0x77eb('0x40')](_0x77eb('0x4b')))},'json':!![]};rp(_0x274db1)['then'](function(_0x169ed){var _0xff7e62={'messageId':_0x169ed[_0x77eb('0x4c')][0x0]};return _0x16aee6[_0x77eb('0x14')](_0xff7e62);})[_0x77eb('0x16')](function(_0xeb68c){logger[_0x77eb('0x17')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x77eb('0x47'),util['inspect'](_0xeb68c,{'showHidden':![],'depth':null}));});}else{logger[_0x77eb('0x17')](_0x77eb('0x24'),'afterCreate','plivo',_0x77eb('0x4d'));}break;case _0x77eb('0x4e'):if(_0x246b41['username']&&_0x246b41['password']){if(_0x246b41[_0x77eb('0x4f')]){var _0x42d5e2={'method':_0x77eb('0x30'),'uri':_0x246b41[_0x77eb('0x4f')]+'/auth/1/session','body':{'username':_0x246b41[_0x77eb('0x2a')],'password':_0x246b41[_0x77eb('0x2b')]},'json':!![]};return rp(_0x42d5e2)[_0x77eb('0x13')](function(_0x2c3fcb){var _0x3beabe={'method':_0x77eb('0x30'),'uri':_0x246b41[_0x77eb('0x4f')]+_0x77eb('0x50'),'body':{'messages':[{'from':_0x246b41['phone'],'destinations':[{'to':_0x3fb8e8[_0x77eb('0x1e')]}],'text':_0x3fb8e8['body'],'notifyUrl':_0x246b41[_0x77eb('0x21')]+'/api/sms/messages/'+_0x3fb8e8['id']+_0x77eb('0x49')+_0x246b41[_0x77eb('0x22')],'notifyContentType':_0x77eb('0x51'),'callbackData':_0x246b41['phone']+';'+_0x3fb8e8[_0x77eb('0x9')]}]},'headers':{'Authorization':_0x77eb('0x52')+_0x2c3fcb[_0x77eb('0x22')]},'json':!![]};return rp(_0x3beabe)['then'](function(_0x4d88a8){if(_0x4d88a8[_0x77eb('0x1f')]){var _0x3bc155={'messageId':_0x4d88a8[_0x77eb('0x1f')][0x0]['messageId']};if(!_0x246b41['deliveryReport']){_0x3bc155[_0x77eb('0x33')]=!![];}return _0x16aee6[_0x77eb('0x14')](_0x3bc155);}else{return logger[_0x77eb('0x17')](_0x77eb('0x24'),_0x77eb('0x25'),_0x77eb('0x4e'),util[_0x77eb('0x26')](_0x4d88a8,{'showHidden':![],'depth':null}));}});})[_0x77eb('0x16')](function(_0x525653){return logger['error'](_0x77eb('0x24'),'afterCreate',_0x77eb('0x4e'),util[_0x77eb('0x26')](_0x525653,{'showHidden':![],'depth':null}));});}else{logger[_0x77eb('0x17')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x77eb('0x25'),'infobip',_0x77eb('0x53'));}}else{logger[_0x77eb('0x17')](_0x77eb('0x24'),'afterCreate','infobip','Missing\x20parameters:\x20username,\x20password');}break;case'csc':var _0x10c6c4=require('crypto');if(_0x246b41['apiKey']){var _0x493cd1={};_0x493cd1[_0x77eb('0x54')]=_0x246b41['username'];_0x493cd1[_0x77eb('0x1e')]=_0x3fb8e8[_0x77eb('0x1e')];_0x493cd1['sender']=_0x246b41[_0x77eb('0x1e')];_0x493cd1[_0x77eb('0x55')]=_0x3fb8e8[_0x77eb('0x9')];_0x493cd1[_0x77eb('0x56')]=+new Date();var _0x1e4abb='';var _0x26c8dd='';var _0x3d16f1=Object[_0x77eb('0x57')](_0x493cd1);_0x3d16f1[_0x77eb('0x58')]();for(var _0x3f4f33=0x0;_0x3f4f33<_0x3d16f1[_0x77eb('0x59')];_0x3f4f33++){if(_0x1e4abb!=''){_0x1e4abb+='&';}_0x1e4abb+=_0x3d16f1[_0x3f4f33]+'='+encodeURIComponent(_0x493cd1[_0x3d16f1[_0x3f4f33]]);_0x26c8dd+=_0x493cd1[_0x3d16f1[_0x3f4f33]];}_0x26c8dd+=_0x246b41[_0x77eb('0x5a')];_0x26c8dd=_0x10c6c4[_0x77eb('0x5b')](_0x77eb('0x5c'))[_0x77eb('0x14')](_0x26c8dd)['digest'](_0x77eb('0x5d'));if(_0x1e4abb!==''){_0x1e4abb+='&';}_0x1e4abb+='signature='+_0x26c8dd;var _0x5e317a={'method':_0x77eb('0x5e'),'uri':_0x246b41['baseUrl']+_0x77eb('0x5f')+_0x1e4abb,'json':!![]};return rp(_0x5e317a)[_0x77eb('0x13')](function(_0xb948d9){var _0x5c3ec0=Object[_0x77eb('0x57')](_0xb948d9);if(_0xb948d9[_0x5c3ec0[0x0]][_0x77eb('0x17')]&&parseInt(_0xb948d9[_0x5c3ec0[0x0]][_0x77eb('0x17')])===0x0){var _0x5044ed={'messageId':_0xb948d9[_0x5c3ec0[0x0]][_0x77eb('0x60')]};if(!_0x246b41[_0x77eb('0x32')]){_0x5044ed[_0x77eb('0x33')]=!![];}return _0x16aee6['update'](_0x5044ed);}else{return logger[_0x77eb('0x17')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x77eb('0x25'),_0x77eb('0x61'),util['inspect'](_0xb948d9[_0x77eb('0x17')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x21c11f){return logger[_0x77eb('0x17')](_0x77eb('0x24'),_0x77eb('0x25'),_0x77eb('0x61'),util[_0x77eb('0x26')](_0x21c11f,{'showHidden':![],'depth':null}));});}else{logger[_0x77eb('0x17')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x77eb('0x25'),_0x77eb('0x61'),_0x77eb('0x62'));}break;case _0x77eb('0x63'):if(_0x246b41[_0x77eb('0x5a')]){var _0x138013={'method':'POST','uri':_0x77eb('0x64'),'headers':{'Authorization':_0x246b41[_0x77eb('0x5a')]},'body':{'content':_0x3fb8e8[_0x77eb('0x9')],'to':[_0x3fb8e8[_0x77eb('0x1e')]],'from':_0x246b41[_0x77eb('0x1e')],'binary':![],'clientMessageId':_0x77eb('0x65'),'charset':'UTF-8'},'json':!![]};rp(_0x138013)['then'](function(_0x34dbd6){if(!_0x34dbd6[_0x77eb('0x17')]){var _0x21d213={'messageId':_0x34dbd6[_0x77eb('0x1f')][0x0][_0x77eb('0x66')]};if(!_0x246b41['deliveryReport']){_0x21d213[_0x77eb('0x33')]=!![];}return _0x16aee6[_0x77eb('0x14')](_0x21d213);}else{return logger[_0x77eb('0x17')](_0x77eb('0x24'),_0x77eb('0x25'),_0x77eb('0x63'),util[_0x77eb('0x26')](_0x34dbd6[_0x77eb('0x17')],{'showHidden':![],'depth':null}));}})[_0x77eb('0x16')](function(_0x26da2b){return logger['error'](_0x77eb('0x24'),_0x77eb('0x25'),_0x77eb('0x63'),util['inspect'](_0x26da2b,{'showHidden':![],'depth':null}));});}else{logger[_0x77eb('0x17')](_0x77eb('0x24'),_0x77eb('0x25'),'clickatell',_0x77eb('0x62'));}break;case'bandwidth':if(_0x246b41['username']&&_0x246b41[_0x77eb('0x2b')]){var _0x49e922=util['format']('%s:%s',_0x246b41['username'],_0x246b41[_0x77eb('0x2b')]);var _0x274db1={'method':_0x77eb('0x30'),'uri':_0x77eb('0x67')+_0x246b41[_0x77eb('0x68')]+'/messages','body':{'to':[_0x3fb8e8['phone']],'text':_0x3fb8e8[_0x77eb('0x9')],'from':_0x246b41['phone'],'applicationId':_0x246b41[_0x77eb('0x69')]},'headers':{'Authorization':util[_0x77eb('0x3c')](_0x77eb('0x3f'),new Buffer(_0x49e922)[_0x77eb('0x40')](_0x77eb('0x4b')))},'json':!![]};rp(_0x274db1)['then'](function(_0x474957){if(_0x474957['id']){var _0x501032={'messageId':_0x474957['id']};return _0x16aee6[_0x77eb('0x14')](_0x501032);}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x77eb('0x6a'),util[_0x77eb('0x26')](_0x474957,{'showHidden':![],'depth':null}));}})[_0x77eb('0x16')](function(_0x1b2006){logger['error'](_0x77eb('0x24'),_0x77eb('0x25'),_0x77eb('0x6a'),util[_0x77eb('0x26')](_0x1b2006,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x77eb('0x24'),_0x77eb('0x25'),'bandwidth',_0x77eb('0x34'));}break;case'intelepeer':if(_0x246b41[_0x77eb('0x5a')]){var _0x5ae3fd={};var _0x5e317a={'method':_0x77eb('0x30'),'uri':_0x77eb('0x6b'),'headers':{'Authorization':_0x77eb('0x6c')+_0x246b41['apiKey'],'Content-Type':_0x77eb('0x51')},'body':{'from':_0x246b41['phone'],'to':_0x3fb8e8[_0x77eb('0x1e')],'text':_0x3fb8e8['body']},'json':!![]};return rp(_0x5e317a)[_0x77eb('0x13')](function(_0x5a86e7){if(_0x5a86e7[_0x77eb('0x6d')]==0xca){_0x5ae3fd['message']=_0x5a86e7;var _0x279549={'method':'POST','uri':_0x77eb('0x6e'),'headers':{'Authorization':'Bearer\x20'+_0x246b41[_0x77eb('0x5a')],'Content-Type':'application/json'},'body':{'refid':_0x5ae3fd['message'][_0x77eb('0x6f')]},'json':!![]};return rp(_0x279549)[_0x77eb('0x13')](function(_0x142d52){_0x5ae3fd[_0x77eb('0x70')]=_0x142d52;var _0x560aac={'messageId':_0x5ae3fd[_0x77eb('0x71')]['refid'],'read':!![]};return _0x16aee6['update'](_0x560aac);});}else{return logger['error'](_0x77eb('0x24'),_0x77eb('0x25'),_0x77eb('0x72'),util[_0x77eb('0x26')](_0x5a86e7,{'showHidden':![],'depth':null}));}})[_0x77eb('0x16')](function(_0x4d4db2){return logger['error'](_0x77eb('0x24'),_0x77eb('0x25'),_0x77eb('0x72'),util[_0x77eb('0x26')](_0x4d4db2,{'showHidden':![],'depth':null}));});}else{return logger[_0x77eb('0x17')](_0x77eb('0x24'),'afterCreate',_0x77eb('0x72'),'Token\x20not\x20received');}break;}}})[_0x77eb('0x73')](function(){_0x1a0947();});}else{_0x1a0947();}}},'charset':_0x77eb('0x74'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x386d=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsMessage.attributes','exports','sms_messages','messageId','FULLTEXT','models','get','direction','toLowerCase','out','SmsInteractionId','SmsInteraction','findOne','update','catch','error','secret','SmsAccount','SmsAccountId','then','type','twilio','accountSid','authToken','messages','create','phone','remote','/status?token=','token','sid','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','skebby','https://api.skebby.it/API/v1.0/REST/','username','body','smsMethod','sender','login?username=','&password=','password','GET','POST','user_key','session_key','deliveryReport','inspect','Missing\x20parameters:\x20username,\x20password','connectel','https://smsapi.connectel.se/api/v2/send/','read','clicksend','senderString','%s:%s','https://rest.clicksend.com/v3/sms/send','format','Basic\x20%s','base64','http_code','data','queued_count','message_id','clickSend','plivo','authId','https://api.plivo.com/v1/Account/%s/Message/','toString','infobip','baseUrl','/auth/1/session','/api/sms/messages/','application/json','Missing\x20parameters:\x20base_url','csc','apiKey','login','text','timestamp','keys','sort','length','createHash','md5','digest','signature=','/external/get/send.php?','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','UTF-8','apiMessageId','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','applicationId','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','Bearer\x20','refid','status','intelepeer','Token\x20not\x20received','finally','utf8mb4','lodash'];(function(_0x1f5887,_0x2fa1f1){var _0x21774b=function(_0x48a7e5){while(--_0x48a7e5){_0x1f5887['push'](_0x1f5887['shift']());}};_0x21774b(++_0x2fa1f1);}(_0x386d,0x1cf));var _0xd386=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x386d[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0xd386('0x0'));var util=require(_0xd386('0x1'));var logger=require(_0xd386('0x2'))(_0xd386('0x3'));var moment=require(_0xd386('0x4'));var BPromise=require(_0xd386('0x5'));var rp=require(_0xd386('0x6'));var fs=require('fs');var path=require(_0xd386('0x7'));var rimraf=require(_0xd386('0x8'));var config=require(_0xd386('0x9'));var attributes=require(_0xd386('0xa'));module[_0xd386('0xb')]=function(_0x3a1d84,_0x502a5a){return _0x3a1d84['define']('SmsMessage',attributes,{'tableName':_0xd386('0xc'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0xd386('0xd')]},{'name':'fti_sms_messages','fields':['body'],'type':_0xd386('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3e2c0f,_0x225be1,_0x26348a){var _0x534452=_0x3a1d84[_0xd386('0xf')];var _0x4b5225=_0x3e2c0f[_0xd386('0x10')]({'plain':!![]});if(_0x4b5225[_0xd386('0x11')]['toLowerCase']()==='in'||_0x4b5225[_0xd386('0x11')][_0xd386('0x12')]()===_0xd386('0x13')&&!_0x4b5225['secret']&&!_['isNil'](_0x4b5225['UserId'])&&!_['isNil'](_0x4b5225[_0xd386('0x14')])){_0x534452[_0xd386('0x15')][_0xd386('0x16')]({'where':{'id':_0x4b5225['SmsInteractionId']}})['then'](function(_0x317980){if(_0x317980){_0x317980[_0xd386('0x17')]({'lastMsgAt':_0x4b5225['createdAt'],'lastMsgDirection':_0x4b5225[_0xd386('0x11')][_0xd386('0x12')]()});}})[_0xd386('0x18')](function(_0x6b3e9b){console[_0xd386('0x19')](_0x6b3e9b);});}if(_0x4b5225[_0xd386('0x11')]===_0xd386('0x13')&&!_0x4b5225[_0xd386('0x1a')]){var _0xed4708;_0x534452[_0xd386('0x1b')]['find']({'where':{'id':_0x4b5225[_0xd386('0x1c')]},'raw':!![]})[_0xd386('0x1d')](function(_0x44df7a){_0xed4708=_0x44df7a;if(_0xed4708&&_0xed4708['type']){switch(_0xed4708[_0xd386('0x1e')]){case _0xd386('0x1f'):var _0x44b335=require(_0xd386('0x1f'));if(_0xed4708[_0xd386('0x20')]&&_0xed4708[_0xd386('0x21')]&&_0xed4708['phone']){var _0xaa2c92=new _0x44b335(_0xed4708[_0xd386('0x20')],_0xed4708[_0xd386('0x21')]);_0xaa2c92[_0xd386('0x22')][_0xd386('0x23')]({'body':_0x4b5225['body'],'to':_0x4b5225[_0xd386('0x24')],'from':_0xed4708[_0xd386('0x24')],'statusCallback':_0xed4708[_0xd386('0x25')]+'/api/sms/messages/'+_0x4b5225['id']+_0xd386('0x26')+_0xed4708[_0xd386('0x27')]})['then'](function(_0x3d638d){if(_0x3d638d[_0xd386('0x28')]){return _0x3e2c0f[_0xd386('0x17')]({'messageId':_0x3d638d[_0xd386('0x28')]});}})[_0xd386('0x18')](function(_0x4a5365){logger[_0xd386('0x19')](_0xd386('0x29'),'afterCreate',_0xd386('0x1f'),util['inspect'](_0x4a5365,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xd386('0x29'),_0xd386('0x2a'),_0xd386('0x1f'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0xd386('0x2b'):var _0x3a69de=_0xd386('0x2c');if(_0xed4708[_0xd386('0x2d')]&&_0xed4708['password']){var _0x5f4be1={'recipient':[_0x4b5225[_0xd386('0x24')]],'message':_0x4b5225[_0xd386('0x2e')],'message_type':_0xed4708[_0xd386('0x2f')]};if(_0xed4708['smsMethod']&&_0xed4708['smsMethod']!=='SI'){_0x5f4be1[_0xd386('0x30')]=_0xed4708[_0xd386('0x24')];}var _0x2df79f={'url':_0x3a69de+_0xd386('0x31')+_0xed4708[_0xd386('0x2d')]+_0xd386('0x32')+_0xed4708[_0xd386('0x33')],'method':_0xd386('0x34')};rp(_0x2df79f)[_0xd386('0x1d')](function(_0x1ff4c9){var _0x527329=_0x1ff4c9['split'](';');var _0x3b7232={'user_key':_0x527329[0x0],'session_key':_0x527329[0x1]};_0x2df79f={'url':_0x3a69de+'sms','method':_0xd386('0x35'),'headers':{'user_key':_0x3b7232[_0xd386('0x36')],'Session_key':_0x3b7232[_0xd386('0x37')]},'json':!![],'body':_0x5f4be1};return rp(_0x2df79f);})['then'](function(_0x1e07a7){if(_0x1e07a7['total_sent']>=0x1){var _0x4e827b={'messageId':_0x1e07a7['internal_order_id']};if(_0xed4708[_0xd386('0x2f')]!=='GP'||!_0xed4708[_0xd386('0x38')]){_0x4e827b['read']=!![];}return _0x3e2c0f['update'](_0x4e827b);}else{return logger[_0xd386('0x19')](_0xd386('0x29'),_0xd386('0x2a'),_0xd386('0x2b'),util[_0xd386('0x39')](_0x1e07a7,{'showHidden':![],'depth':null}));}})[_0xd386('0x18')](function(_0xbdbbc9){return logger[_0xd386('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd386('0x2a'),'skebby',util[_0xd386('0x39')](_0xbdbbc9,{'showHidden':![],'depth':null}));});}else{logger[_0xd386('0x19')](_0xd386('0x29'),_0xd386('0x2a'),_0xd386('0x2b'),_0xd386('0x3a'));}break;case _0xd386('0x3b'):if(_0xed4708[_0xd386('0x21')]){var _0x4fc7ee={'recipient':_0x4b5225['phone'],'message':_0x4b5225[_0xd386('0x2e')],'sender':_0xed4708['senderString']||_0xed4708['phone'],'authorization':_0xed4708['authToken']};var _0x225be1={'method':_0xd386('0x35'),'uri':_0xd386('0x3c'),'body':_0x4fc7ee,'json':!![]};rp(_0x225be1)[_0xd386('0x1d')](function(_0x4fb6c5){var _0x2c6cec={'messageId':_0x4fb6c5['requestid']};if(!_0xed4708['deliveryReport']){_0x2c6cec[_0xd386('0x3d')]=!![];}return _0x3e2c0f[_0xd386('0x17')](_0x2c6cec);})[_0xd386('0x18')](function(_0x3a1b32){logger[_0xd386('0x19')](_0xd386('0x29'),'afterCreate','connectel',util[_0xd386('0x39')](_0x3a1b32,{'showHidden':![],'depth':null}));});}else{logger[_0xd386('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd386('0x2a'),'connectel','Missing\x20parameters:\x20authToken');}break;case _0xd386('0x3e'):if(_0xed4708[_0xd386('0x2d')]&&_0xed4708['password']){var _0x4fc7ee={'messages':[{'source':'xCALLY\x20Motion','to':_0x4b5225[_0xd386('0x24')],'body':_0x4b5225[_0xd386('0x2e')],'from':_0xed4708[_0xd386('0x3f')]||_0xed4708['phone']}]};var _0x30c4e3=util['format'](_0xd386('0x40'),_0xed4708[_0xd386('0x2d')],_0xed4708[_0xd386('0x33')]);var _0x225be1={'method':'POST','uri':_0xd386('0x41'),'body':_0x4fc7ee,'headers':{'Authorization':util[_0xd386('0x42')](_0xd386('0x43'),new Buffer(_0x30c4e3)['toString'](_0xd386('0x44')))},'json':!![]};rp(_0x225be1)[_0xd386('0x1d')](function(_0x24e192){if(_0x24e192[_0xd386('0x45')]>=0xc8&&_0x24e192[_0xd386('0x45')]<=0xce){if(_0x24e192[_0xd386('0x46')]&&_0x24e192[_0xd386('0x46')][_0xd386('0x47')]>0x0){var _0x4a2856=_['head'](_0x24e192[_0xd386('0x46')][_0xd386('0x22')]);var _0x118839={'messageId':_0x4a2856[_0xd386('0x48')]};if(!_0xed4708['deliveryReport']){_0x118839[_0xd386('0x3d')]=!![];}return _0x3e2c0f[_0xd386('0x17')](_0x118839);}else{logger[_0xd386('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd386('0x2a'),_0xd386('0x49'),util['inspect'](_0x24e192,{'showHidden':![],'depth':null}));}}else{logger[_0xd386('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd386('0x2a'),_0xd386('0x49'),util[_0xd386('0x39')](_0x24e192,{'showHidden':![],'depth':null}));}})[_0xd386('0x18')](function(_0x1b3fcb){logger[_0xd386('0x19')](_0xd386('0x29'),'afterCreate',_0xd386('0x49'),util[_0xd386('0x39')](_0x1b3fcb,{'showHidden':![],'depth':null}));});}else{logger[_0xd386('0x19')](_0xd386('0x29'),_0xd386('0x2a'),_0xd386('0x49'),_0xd386('0x3a'));}break;case _0xd386('0x4a'):if(_0xed4708[_0xd386('0x4b')]&&_0xed4708['authToken']){var _0x4fc7ee={'dst':_0x4b5225[_0xd386('0x24')],'text':_0x4b5225[_0xd386('0x2e')],'src':_0xed4708[_0xd386('0x3f')]||_0xed4708[_0xd386('0x24')],'url':_0xed4708['remote']+'/api/sms/messages/'+_0x4b5225['id']+'/status?token='+_0xed4708[_0xd386('0x27')]};var _0x30c4e3=util[_0xd386('0x42')](_0xd386('0x40'),_0xed4708[_0xd386('0x4b')],_0xed4708[_0xd386('0x21')]);var _0x225be1={'method':_0xd386('0x35'),'uri':util[_0xd386('0x42')](_0xd386('0x4c'),_0xed4708[_0xd386('0x4b')]),'body':_0x4fc7ee,'headers':{'Authorization':util[_0xd386('0x42')]('Basic\x20%s',new Buffer(_0x30c4e3)[_0xd386('0x4d')](_0xd386('0x44')))},'json':!![]};rp(_0x225be1)[_0xd386('0x1d')](function(_0x1e04df){var _0x48690b={'messageId':_0x1e04df['message_uuid'][0x0]};return _0x3e2c0f[_0xd386('0x17')](_0x48690b);})[_0xd386('0x18')](function(_0x48cf9e){logger[_0xd386('0x19')](_0xd386('0x29'),_0xd386('0x2a'),_0xd386('0x4a'),util[_0xd386('0x39')](_0x48cf9e,{'showHidden':![],'depth':null}));});}else{logger[_0xd386('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd386('0x2a'),_0xd386('0x4a'),'Missing\x20parameters:\x20authId,\x20authToken');}break;case _0xd386('0x4e'):if(_0xed4708[_0xd386('0x2d')]&&_0xed4708[_0xd386('0x33')]){if(_0xed4708[_0xd386('0x4f')]){var _0xd54ea2={'method':_0xd386('0x35'),'uri':_0xed4708[_0xd386('0x4f')]+_0xd386('0x50'),'body':{'username':_0xed4708[_0xd386('0x2d')],'password':_0xed4708[_0xd386('0x33')]},'json':!![]};return rp(_0xd54ea2)[_0xd386('0x1d')](function(_0x2735ba){var _0x654814={'method':_0xd386('0x35'),'uri':_0xed4708['baseUrl']+'/sms/2/text/advanced','body':{'messages':[{'from':_0xed4708[_0xd386('0x24')],'destinations':[{'to':_0x4b5225[_0xd386('0x24')]}],'text':_0x4b5225['body'],'notifyUrl':_0xed4708['remote']+_0xd386('0x51')+_0x4b5225['id']+'/status?token='+_0xed4708[_0xd386('0x27')],'notifyContentType':_0xd386('0x52'),'callbackData':_0xed4708[_0xd386('0x24')]+';'+_0x4b5225[_0xd386('0x2e')]}]},'headers':{'Authorization':'IBSSO\x20'+_0x2735ba[_0xd386('0x27')]},'json':!![]};return rp(_0x654814)['then'](function(_0x44df08){if(_0x44df08[_0xd386('0x22')]){var _0x235023={'messageId':_0x44df08['messages'][0x0][_0xd386('0xd')]};if(!_0xed4708[_0xd386('0x38')]){_0x235023[_0xd386('0x3d')]=!![];}return _0x3e2c0f['update'](_0x235023);}else{return logger[_0xd386('0x19')](_0xd386('0x29'),'afterCreate',_0xd386('0x4e'),util[_0xd386('0x39')](_0x44df08,{'showHidden':![],'depth':null}));}});})[_0xd386('0x18')](function(_0x4379dd){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd386('0x2a'),'infobip',util[_0xd386('0x39')](_0x4379dd,{'showHidden':![],'depth':null}));});}else{logger[_0xd386('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xd386('0x4e'),_0xd386('0x53'));}}else{logger[_0xd386('0x19')](_0xd386('0x29'),_0xd386('0x2a'),'infobip',_0xd386('0x3a'));}break;case _0xd386('0x54'):var _0x38432e=require('crypto');if(_0xed4708[_0xd386('0x55')]){var _0x501900={};_0x501900[_0xd386('0x56')]=_0xed4708['username'];_0x501900[_0xd386('0x24')]=_0x4b5225[_0xd386('0x24')];_0x501900['sender']=_0xed4708[_0xd386('0x24')];_0x501900[_0xd386('0x57')]=_0x4b5225['body'];_0x501900[_0xd386('0x58')]=+new Date();var _0x22b1fa='';var _0x24b6e0='';var _0x2360d3=Object[_0xd386('0x59')](_0x501900);_0x2360d3[_0xd386('0x5a')]();for(var _0x5a72f7=0x0;_0x5a72f7<_0x2360d3[_0xd386('0x5b')];_0x5a72f7++){if(_0x22b1fa!=''){_0x22b1fa+='&';}_0x22b1fa+=_0x2360d3[_0x5a72f7]+'='+encodeURIComponent(_0x501900[_0x2360d3[_0x5a72f7]]);_0x24b6e0+=_0x501900[_0x2360d3[_0x5a72f7]];}_0x24b6e0+=_0xed4708[_0xd386('0x55')];_0x24b6e0=_0x38432e[_0xd386('0x5c')](_0xd386('0x5d'))[_0xd386('0x17')](_0x24b6e0)[_0xd386('0x5e')]('hex');if(_0x22b1fa!==''){_0x22b1fa+='&';}_0x22b1fa+=_0xd386('0x5f')+_0x24b6e0;var _0x2df79f={'method':'GET','uri':_0xed4708[_0xd386('0x4f')]+_0xd386('0x60')+_0x22b1fa,'json':!![]};return rp(_0x2df79f)[_0xd386('0x1d')](function(_0x417ff4){var _0x5aca34=Object[_0xd386('0x59')](_0x417ff4);if(_0x417ff4[_0x5aca34[0x0]][_0xd386('0x19')]&&parseInt(_0x417ff4[_0x5aca34[0x0]]['error'])===0x0){var _0x44224a={'messageId':_0x417ff4[_0x5aca34[0x0]]['id_sms']};if(!_0xed4708[_0xd386('0x38')]){_0x44224a[_0xd386('0x3d')]=!![];}return _0x3e2c0f[_0xd386('0x17')](_0x44224a);}else{return logger[_0xd386('0x19')](_0xd386('0x29'),_0xd386('0x2a'),_0xd386('0x54'),util['inspect'](_0x417ff4['error'],{'showHidden':![],'depth':null}));}})[_0xd386('0x18')](function(_0x377370){return logger[_0xd386('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','csc',util[_0xd386('0x39')](_0x377370,{'showHidden':![],'depth':null}));});}else{logger[_0xd386('0x19')](_0xd386('0x29'),_0xd386('0x2a'),_0xd386('0x54'),_0xd386('0x61'));}break;case _0xd386('0x62'):if(_0xed4708[_0xd386('0x55')]){var _0x2d9b92={'method':'POST','uri':_0xd386('0x63'),'headers':{'Authorization':_0xed4708['apiKey']},'body':{'content':_0x4b5225[_0xd386('0x2e')],'to':[_0x4b5225[_0xd386('0x24')]],'from':_0xed4708[_0xd386('0x24')],'binary':![],'clientMessageId':'uuid','charset':_0xd386('0x64')},'json':!![]};rp(_0x2d9b92)['then'](function(_0xde2218){if(!_0xde2218['error']){var _0xe0285d={'messageId':_0xde2218[_0xd386('0x22')][0x0][_0xd386('0x65')]};if(!_0xed4708[_0xd386('0x38')]){_0xe0285d[_0xd386('0x3d')]=!![];}return _0x3e2c0f[_0xd386('0x17')](_0xe0285d);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd386('0x2a'),'clickatell',util[_0xd386('0x39')](_0xde2218[_0xd386('0x19')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x10116d){return logger[_0xd386('0x19')](_0xd386('0x29'),_0xd386('0x2a'),_0xd386('0x62'),util[_0xd386('0x39')](_0x10116d,{'showHidden':![],'depth':null}));});}else{logger[_0xd386('0x19')](_0xd386('0x29'),_0xd386('0x2a'),_0xd386('0x62'),_0xd386('0x61'));}break;case _0xd386('0x66'):if(_0xed4708[_0xd386('0x2d')]&&_0xed4708['password']){var _0x30c4e3=util['format'](_0xd386('0x40'),_0xed4708[_0xd386('0x2d')],_0xed4708[_0xd386('0x33')]);var _0x225be1={'method':_0xd386('0x35'),'uri':_0xd386('0x67')+_0xed4708[_0xd386('0x68')]+'/messages','body':{'to':[_0x4b5225['phone']],'text':_0x4b5225[_0xd386('0x2e')],'from':_0xed4708[_0xd386('0x24')],'applicationId':_0xed4708[_0xd386('0x69')]},'headers':{'Authorization':util[_0xd386('0x42')](_0xd386('0x43'),new Buffer(_0x30c4e3)['toString'](_0xd386('0x44')))},'json':!![]};rp(_0x225be1)[_0xd386('0x1d')](function(_0x21b3bd){if(_0x21b3bd['id']){var _0x177ad0={'messageId':_0x21b3bd['id']};return _0x3e2c0f['update'](_0x177ad0);}else{logger['error'](_0xd386('0x29'),'afterCreate',_0xd386('0x66'),util[_0xd386('0x39')](_0x21b3bd,{'showHidden':![],'depth':null}));}})[_0xd386('0x18')](function(_0x63a5ae){logger[_0xd386('0x19')](_0xd386('0x29'),'afterCreate','bandwidth',util[_0xd386('0x39')](_0x63a5ae,{'showHidden':![],'depth':null}));});}else{logger[_0xd386('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd386('0x2a'),_0xd386('0x66'),_0xd386('0x3a'));}break;case'intelepeer':if(_0xed4708['apiKey']){var _0x3853d9={};var _0x2df79f={'method':_0xd386('0x35'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':'Bearer\x20'+_0xed4708[_0xd386('0x55')],'Content-Type':'application/json'},'body':{'from':_0xed4708['phone'],'to':_0x4b5225[_0xd386('0x24')],'text':_0x4b5225[_0xd386('0x2e')]},'json':!![]};return rp(_0x2df79f)[_0xd386('0x1d')](function(_0x1d1a46){if(_0x1d1a46[_0xd386('0x6a')]==0xca){_0x3853d9[_0xd386('0x6b')]=_0x1d1a46;var _0x5a2f44={'method':_0xd386('0x35'),'uri':_0xd386('0x6c'),'headers':{'Authorization':_0xd386('0x6d')+_0xed4708[_0xd386('0x55')],'Content-Type':_0xd386('0x52')},'body':{'refid':_0x3853d9[_0xd386('0x6b')][_0xd386('0x6e')]},'json':!![]};return rp(_0x5a2f44)[_0xd386('0x1d')](function(_0x4b288a){_0x3853d9[_0xd386('0x6f')]=_0x4b288a;var _0x23fb54={'messageId':_0x3853d9[_0xd386('0x6b')][_0xd386('0x6e')],'read':!![]};return _0x3e2c0f[_0xd386('0x17')](_0x23fb54);});}else{return logger[_0xd386('0x19')](_0xd386('0x29'),_0xd386('0x2a'),_0xd386('0x70'),util[_0xd386('0x39')](_0x1d1a46,{'showHidden':![],'depth':null}));}})['catch'](function(_0x18a8e5){return logger[_0xd386('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd386('0x2a'),_0xd386('0x70'),util['inspect'](_0x18a8e5,{'showHidden':![],'depth':null}));});}else{return logger[_0xd386('0x19')](_0xd386('0x29'),'afterCreate',_0xd386('0x70'),_0xd386('0x71'));}break;}}})[_0xd386('0x72')](function(){_0x26348a();});}else{_0x26348a();}}},'charset':_0xd386('0x73'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index e833959..b607785 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 _0x0783=['SmsMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','CreateSmsMessage','SmsMessage','create','options','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./smsMessage.socket','register','request','then','info'];(function(_0x25dbd6,_0x32e635){var _0x31152d=function(_0x59ac7c){while(--_0x59ac7c){_0x25dbd6['push'](_0x25dbd6['shift']());}};_0x31152d(++_0x32e635);}(_0x0783,0x70));var _0x3078=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0783[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x3078('0x0'));var util=require(_0x3078('0x1'));var moment=require(_0x3078('0x2'));var BPromise=require(_0x3078('0x3'));var rs=require(_0x3078('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3078('0x5'))['db'];var utils=require(_0x3078('0x6'));var logger=require(_0x3078('0x7'))(_0x3078('0x8'));var config=require('../../config/environment');var jayson=require(_0x3078('0x9'));var client=jayson[_0x3078('0xa')][_0x3078('0xb')]({'port':0x232a});config[_0x3078('0xc')]=_['defaults'](config[_0x3078('0xc')],{'host':_0x3078('0xd'),'port':0x18eb});var socket=require(_0x3078('0xe'))(new Redis(config[_0x3078('0xc')]));require(_0x3078('0xf'))[_0x3078('0x10')](socket);function respondWithRpcPromise(_0x33605b,_0x3acc04,_0x30858b){return new BPromise(function(_0x4bdc9d,_0x6f9e7c){return client[_0x3078('0x11')](_0x33605b,_0x30858b)[_0x3078('0x12')](function(_0x564c51){logger[_0x3078('0x13')](_0x3078('0x14'),_0x3acc04,'request\x20sent');logger[_0x3078('0x15')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3acc04,_0x3078('0x16'),JSON[_0x3078('0x17')](_0x564c51));if(_0x564c51[_0x3078('0x18')]){if(_0x564c51[_0x3078('0x18')][_0x3078('0x19')]===0x1f4){logger[_0x3078('0x18')]('SmsMessage,\x20%s,\x20%s',_0x3acc04,_0x564c51[_0x3078('0x18')][_0x3078('0x1a')]);return _0x6f9e7c(_0x564c51['error'][_0x3078('0x1a')]);}logger[_0x3078('0x18')]('SmsMessage,\x20%s,\x20%s',_0x3acc04,_0x564c51['error'][_0x3078('0x1a')]);return _0x4bdc9d(_0x564c51[_0x3078('0x18')]['message']);}else{logger[_0x3078('0x13')](_0x3078('0x14'),_0x3acc04,_0x3078('0x16'));_0x4bdc9d(_0x564c51[_0x3078('0x1b')][_0x3078('0x1a')]);}})[_0x3078('0x1c')](function(_0xd7cc8e){logger[_0x3078('0x18')](_0x3078('0x14'),_0x3acc04,_0xd7cc8e);_0x6f9e7c(_0xd7cc8e);});});}exports[_0x3078('0x1d')]=function(_0x57d892){var _0x460fca=this;return new Promise(function(_0x1cbbaa,_0x37deff){return db[_0x3078('0x1e')][_0x3078('0x1f')](_0x57d892['body'],{'raw':_0x57d892[_0x3078('0x20')]?_0x57d892['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x2cbb25){logger[_0x3078('0x13')](_0x3078('0x1d'),_0x57d892);logger[_0x3078('0x15')](_0x3078('0x1d'),_0x57d892,JSON[_0x3078('0x17')](_0x2cbb25));_0x1cbbaa(_0x2cbb25);})['catch'](function(_0x7fccaf){logger['error']('CreateSmsMessage',_0x7fccaf[_0x3078('0x1a')],_0x57d892);_0x37deff(_0x460fca[_0x3078('0x18')](0x1f4,_0x7fccaf[_0x3078('0x1a')]));});});}; \ No newline at end of file +var _0x65fc=['info','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsMessage,\x20%s,\x20%s','message','catch','CreateSmsMessage','create','options','raw','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','localhost','socket.io-emitter','./smsMessage.socket','register','then'];(function(_0x2c6761,_0x5aefd1){var _0x4f9445=function(_0x464f54){while(--_0x464f54){_0x2c6761['push'](_0x2c6761['shift']());}};_0x4f9445(++_0x5aefd1);}(_0x65fc,0x176));var _0xc65f=function(_0x2f1182,_0x1551ea){_0x2f1182=_0x2f1182-0x0;var _0x412471=_0x65fc[_0x2f1182];return _0x412471;};'use strict';var _=require('lodash');var util=require(_0xc65f('0x0'));var moment=require(_0xc65f('0x1'));var BPromise=require(_0xc65f('0x2'));var rs=require(_0xc65f('0x3'));var fs=require('fs');var Redis=require(_0xc65f('0x4'));var db=require(_0xc65f('0x5'))['db'];var utils=require(_0xc65f('0x6'));var logger=require('../../config/logger')(_0xc65f('0x7'));var config=require(_0xc65f('0x8'));var jayson=require(_0xc65f('0x9'));var client=jayson[_0xc65f('0xa')]['http']({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0xc65f('0xb'),'port':0x18eb});var socket=require(_0xc65f('0xc'))(new Redis(config['redis']));require(_0xc65f('0xd'))[_0xc65f('0xe')](socket);function respondWithRpcPromise(_0x312a25,_0x90c8cf,_0x53a7ae){return new BPromise(function(_0xbceacc,_0x2fe498){return client['request'](_0x312a25,_0x53a7ae)[_0xc65f('0xf')](function(_0x519fc5){logger[_0xc65f('0x10')]('SmsMessage,\x20%s,\x20%s',_0x90c8cf,_0xc65f('0x11'));logger[_0xc65f('0x12')](_0xc65f('0x13'),_0x90c8cf,_0xc65f('0x11'),JSON[_0xc65f('0x14')](_0x519fc5));if(_0x519fc5['error']){if(_0x519fc5[_0xc65f('0x15')][_0xc65f('0x16')]===0x1f4){logger[_0xc65f('0x15')](_0xc65f('0x17'),_0x90c8cf,_0x519fc5[_0xc65f('0x15')][_0xc65f('0x18')]);return _0x2fe498(_0x519fc5[_0xc65f('0x15')][_0xc65f('0x18')]);}logger[_0xc65f('0x15')](_0xc65f('0x17'),_0x90c8cf,_0x519fc5[_0xc65f('0x15')][_0xc65f('0x18')]);return _0xbceacc(_0x519fc5[_0xc65f('0x15')]['message']);}else{logger[_0xc65f('0x10')](_0xc65f('0x17'),_0x90c8cf,_0xc65f('0x11'));_0xbceacc(_0x519fc5['result'][_0xc65f('0x18')]);}})[_0xc65f('0x19')](function(_0x5a24a7){logger[_0xc65f('0x15')](_0xc65f('0x17'),_0x90c8cf,_0x5a24a7);_0x2fe498(_0x5a24a7);});});}exports[_0xc65f('0x1a')]=function(_0x4a4975){var _0x4fdbac=this;return new Promise(function(_0x3b2b96,_0x2393a2){return db['SmsMessage'][_0xc65f('0x1b')](_0x4a4975['body'],{'raw':_0x4a4975[_0xc65f('0x1c')]?_0x4a4975['options'][_0xc65f('0x1d')]===undefined?!![]:![]:!![]})[_0xc65f('0xf')](function(_0x653614){logger[_0xc65f('0x10')](_0xc65f('0x1a'),_0x4a4975);logger['debug'](_0xc65f('0x1a'),_0x4a4975,JSON[_0xc65f('0x14')](_0x653614));_0x3b2b96(_0x653614);})[_0xc65f('0x19')](function(_0x27331b){logger[_0xc65f('0x15')]('CreateSmsMessage',_0x27331b[_0xc65f('0x18')],_0x4a4975);_0x2393a2(_0x4fdbac['error'](0x1f4,_0x27331b['message']));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index e39ab82..4f5bfa3 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 _0xdb78=['smsMessage:','./smsMessage.events','save','remove','update','emit','register','length'];(function(_0x5b34c0,_0x3ad403){var _0x242bd3=function(_0x51d0ce){while(--_0x51d0ce){_0x5b34c0['push'](_0x5b34c0['shift']());}};_0x242bd3(++_0x3ad403);}(_0xdb78,0x1d1));var _0x8db7=function(_0x11b78a,_0x107b5c){_0x11b78a=_0x11b78a-0x0;var _0x139891=_0xdb78[_0x11b78a];return _0x139891;};'use strict';var SmsMessageEvents=require(_0x8db7('0x0'));var events=[_0x8db7('0x1'),_0x8db7('0x2'),_0x8db7('0x3')];function createListener(_0xb9b94b,_0x3c8a02){return function(_0xcccdcc){_0x3c8a02[_0x8db7('0x4')](_0xb9b94b,_0xcccdcc);};}function removeListener(_0x1ddfdc,_0x5ddc8f){return function(){SmsMessageEvents['removeListener'](_0x1ddfdc,_0x5ddc8f);};}exports[_0x8db7('0x5')]=function(_0x54679d){for(var _0x9e6af8=0x0,_0x49b1d3=events[_0x8db7('0x6')];_0x9e6af8<_0x49b1d3;_0x9e6af8++){var _0x4b7f06=events[_0x9e6af8];var _0x39b3c7=createListener(_0x8db7('0x7')+_0x4b7f06,_0x54679d);SmsMessageEvents['on'](_0x4b7f06,_0x39b3c7);}}; \ No newline at end of file +var _0x0123=['./smsMessage.events','save','remove','emit','register','length','smsMessage:'];(function(_0x1ae4a9,_0x4c0ed9){var _0x54d0b0=function(_0x4fff20){while(--_0x4fff20){_0x1ae4a9['push'](_0x1ae4a9['shift']());}};_0x54d0b0(++_0x4c0ed9);}(_0x0123,0x165));var _0x3012=function(_0x31fdcd,_0x2b43f3){_0x31fdcd=_0x31fdcd-0x0;var _0xe1a26c=_0x0123[_0x31fdcd];return _0xe1a26c;};'use strict';var SmsMessageEvents=require(_0x3012('0x0'));var events=[_0x3012('0x1'),_0x3012('0x2'),'update'];function createListener(_0x12faaf,_0x3ee0e9){return function(_0x3d8717){_0x3ee0e9[_0x3012('0x3')](_0x12faaf,_0x3d8717);};}function removeListener(_0x4e22fd,_0xe7803e){return function(){SmsMessageEvents['removeListener'](_0x4e22fd,_0xe7803e);};}exports[_0x3012('0x4')]=function(_0x34b02f){for(var _0x15faaf=0x0,_0x790c16=events[_0x3012('0x5')];_0x15faaf<_0x790c16;_0x15faaf++){var _0x203939=events[_0x15faaf];var _0x111adb=createListener(_0x3012('0x6')+_0x203939,_0x34b02f);SmsMessageEvents['on'](_0x203939,_0x111adb);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index ab8e0b8..f8a1d78 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 _0xd2ed=['get','index','/describe','isAuthenticated','describe','/:id','show','/:id/teams','getTeams','/:id/users','create','post','addTeams','addAgents','put','delete','removeTeams','removeAgents','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsQueue.controller'];(function(_0x33c2af,_0x163198){var _0x13c04a=function(_0x4de68e){while(--_0x4de68e){_0x33c2af['push'](_0x33c2af['shift']());}};_0x13c04a(++_0x163198);}(_0xd2ed,0x172));var _0xdd2e=function(_0x2a50fc,_0x792726){_0x2a50fc=_0x2a50fc-0x0;var _0x5aa6a2=_0xd2ed[_0x2a50fc];return _0x5aa6a2;};'use strict';var multer=require('multer');var util=require(_0xdd2e('0x0'));var path=require(_0xdd2e('0x1'));var timeout=require(_0xdd2e('0x2'));var express=require('express');var router=express[_0xdd2e('0x3')]();var fs_extra=require(_0xdd2e('0x4'));var auth=require(_0xdd2e('0x5'));var interaction=require(_0xdd2e('0x6'));var config=require('../../config/environment');var controller=require(_0xdd2e('0x7'));router[_0xdd2e('0x8')]('/',auth['isAuthenticated'](),controller[_0xdd2e('0x9')]);router[_0xdd2e('0x8')](_0xdd2e('0xa'),auth[_0xdd2e('0xb')](),controller[_0xdd2e('0xc')]);router[_0xdd2e('0x8')](_0xdd2e('0xd'),auth[_0xdd2e('0xb')](),controller[_0xdd2e('0xe')]);router[_0xdd2e('0x8')]('/:id/members',auth[_0xdd2e('0xb')](),controller['getMembers']);router[_0xdd2e('0x8')](_0xdd2e('0xf'),auth['isAuthenticated'](),controller[_0xdd2e('0x10')]);router[_0xdd2e('0x8')](_0xdd2e('0x11'),auth[_0xdd2e('0xb')](),controller['getAgents']);router['post']('/',auth[_0xdd2e('0xb')](),controller[_0xdd2e('0x12')]);router[_0xdd2e('0x13')](_0xdd2e('0xf'),auth[_0xdd2e('0xb')](),controller[_0xdd2e('0x14')]);router['post'](_0xdd2e('0x11'),auth[_0xdd2e('0xb')](),controller[_0xdd2e('0x15')]);router[_0xdd2e('0x16')](_0xdd2e('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xdd2e('0x17')](_0xdd2e('0xd'),auth['isAuthenticated'](),controller['destroy']);router[_0xdd2e('0x17')]('/:id/teams',auth['isAuthenticated'](),controller[_0xdd2e('0x18')]);router[_0xdd2e('0x17')](_0xdd2e('0x11'),auth[_0xdd2e('0xb')](),controller[_0xdd2e('0x19')]);module[_0xdd2e('0x1a')]=router; \ No newline at end of file +var _0xcce2=['/:id','getMembers','/:id/teams','getTeams','create','post','/:id/users','update','delete','destroy','removeTeams','removeAgents','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x4f045c,_0x383164){var _0x430ec4=function(_0x3a6488){while(--_0x3a6488){_0x4f045c['push'](_0x4f045c['shift']());}};_0x430ec4(++_0x383164);}(_0xcce2,0x135));var _0x2cce=function(_0x1aade5,_0x28d424){_0x1aade5=_0x1aade5-0x0;var _0x538d6d=_0xcce2[_0x1aade5];return _0x538d6d;};'use strict';var multer=require(_0x2cce('0x0'));var util=require(_0x2cce('0x1'));var path=require('path');var timeout=require(_0x2cce('0x2'));var express=require(_0x2cce('0x3'));var router=express[_0x2cce('0x4')]();var fs_extra=require(_0x2cce('0x5'));var auth=require(_0x2cce('0x6'));var interaction=require(_0x2cce('0x7'));var config=require(_0x2cce('0x8'));var controller=require(_0x2cce('0x9'));router[_0x2cce('0xa')]('/',auth[_0x2cce('0xb')](),controller[_0x2cce('0xc')]);router[_0x2cce('0xa')](_0x2cce('0xd'),auth['isAuthenticated'](),controller[_0x2cce('0xe')]);router[_0x2cce('0xa')](_0x2cce('0xf'),auth['isAuthenticated'](),controller['show']);router[_0x2cce('0xa')]('/:id/members',auth[_0x2cce('0xb')](),controller[_0x2cce('0x10')]);router[_0x2cce('0xa')](_0x2cce('0x11'),auth[_0x2cce('0xb')](),controller[_0x2cce('0x12')]);router[_0x2cce('0xa')]('/:id/users',auth[_0x2cce('0xb')](),controller['getAgents']);router['post']('/',auth[_0x2cce('0xb')](),controller[_0x2cce('0x13')]);router[_0x2cce('0x14')](_0x2cce('0x11'),auth['isAuthenticated'](),controller['addTeams']);router[_0x2cce('0x14')](_0x2cce('0x15'),auth[_0x2cce('0xb')](),controller['addAgents']);router['put'](_0x2cce('0xf'),auth['isAuthenticated'](),controller[_0x2cce('0x16')]);router[_0x2cce('0x17')](_0x2cce('0xf'),auth[_0x2cce('0xb')](),controller[_0x2cce('0x18')]);router[_0x2cce('0x17')](_0x2cce('0x11'),auth['isAuthenticated'](),controller[_0x2cce('0x19')]);router[_0x2cce('0x17')](_0x2cce('0x15'),auth[_0x2cce('0xb')](),controller[_0x2cce('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index 41c43a7..1aaac79 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 _0xdd3c=['rrmemory','sequelize','STRING','ENUM'];(function(_0x435805,_0x115cc0){var _0x8b0cc6=function(_0x39beb4){while(--_0x39beb4){_0x435805['push'](_0x435805['shift']());}};_0x8b0cc6(++_0x115cc0);}(_0xdd3c,0x115));var _0xcdd3=function(_0x3e865d,_0x3733f7){_0x3e865d=_0x3e865d-0x0;var _0x579525=_0xdd3c[_0x3e865d];return _0x579525;};'use strict';var Sequelize=require(_0xcdd3('0x0'));module['exports']={'name':{'type':Sequelize[_0xcdd3('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xcdd3('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xcdd3('0x2')](_0xcdd3('0x3'),'beepall','roundrobin')}}; \ No newline at end of file +var _0x459c=['rrmemory','beepall','roundrobin','sequelize','exports','STRING','name','ENUM'];(function(_0x1830e9,_0x32a22e){var _0x327d99=function(_0x11c48f){while(--_0x11c48f){_0x1830e9['push'](_0x1830e9['shift']());}};_0x327d99(++_0x32a22e);}(_0x459c,0x18b));var _0xc459=function(_0x279893,_0x210445){_0x279893=_0x279893-0x0;var _0x174c6b=_0x459c[_0x279893];return _0x174c6b;};'use strict';var Sequelize=require(_0xc459('0x0'));module[_0xc459('0x1')]={'name':{'type':Sequelize[_0xc459('0x2')],'unique':_0xc459('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xc459('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xc459('0x4')](_0xc459('0x5'),_0xc459('0x6'),_0xc459('0x7'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index 74ac1e0..b32f11a 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 _0xdb28=['userSmsQueue:save','removeTeams','select','field','from','team_has_sms_queues','join','SmsQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','QueryTypes','TeamId','includes','all','union','value','isEmpty','removeAgents','forEach','addAgents','omit','spread','userSmsQueue:remove','getAgents','bluebird','util','lodash','squel','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','./smsQueue.socket','register','sendStatus','end','status','json','offset','undefined','count','limit','Content-Range','update','then','get','SmsQueues','destroy','error','stack','name','map','SmsQueue','fieldName','type','key','where','include','rows','show','keys','query','filters','intersection','model','attributes','fields','length','includeAll','merge','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','catch','body','params','describe','getMembers','findOne','UserSmsQueue','rawAttributes','hasOwnProperty','nolimit','order','sort','SmsQueueId','filter','findAll','User','findAndCountAll','UserId','agent','smsPause','updatedAt','createdAt','format','%s/%s','getTeams','Team','pick','ids','Agents','online','voicePause','interface','sequelize','transaction','addTeams','each','emit'];(function(_0x477d8e,_0x48245c){var _0x145115=function(_0x184663){while(--_0x184663){_0x477d8e['push'](_0x477d8e['shift']());}};_0x145115(++_0x48245c);}(_0xdb28,0x106));var _0x8db2=function(_0x41b8bf,_0x148fc7){_0x41b8bf=_0x41b8bf-0x0;var _0x361344=_0xdb28[_0x41b8bf];return _0x361344;};'use strict';var BPromise=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var _=require(_0x8db2('0x2'));var squel=require(_0x8db2('0x3'));var Redis=require('ioredis');var qs=require(_0x8db2('0x4'));var logger=require(_0x8db2('0x5'))(_0x8db2('0x6'));var config=require(_0x8db2('0x7'));var db=require(_0x8db2('0x8'))['db'];config['redis']=_[_0x8db2('0x9')](config[_0x8db2('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8db2('0xa')]));require(_0x8db2('0xb'))[_0x8db2('0xc')](socket);function respondWithStatusCode(_0x29f698,_0x2f3f2f){_0x2f3f2f=_0x2f3f2f||0xcc;return function(_0x1ff362){if(_0x1ff362){return _0x29f698[_0x8db2('0xd')](_0x2f3f2f);}return _0x29f698['status'](_0x2f3f2f)[_0x8db2('0xe')]();};}function respondWithResult(_0x476216,_0x1f62af){_0x1f62af=_0x1f62af||0xc8;return function(_0x57015f){if(_0x57015f){return _0x476216[_0x8db2('0xf')](_0x1f62af)[_0x8db2('0x10')](_0x57015f);}};}function respondWithFilteredResult(_0x576475,_0x41beda){return function(_0x3b2faa){if(_0x3b2faa){var _0x1349f6=typeof _0x41beda[_0x8db2('0x11')]===_0x8db2('0x12')&&typeof _0x41beda['limit']==='undefined';var _0x15070d=_0x3b2faa[_0x8db2('0x13')];var _0x350d61=_0x1349f6?0x0:_0x41beda[_0x8db2('0x11')];var _0x227355=_0x1349f6?_0x3b2faa[_0x8db2('0x13')]:_0x41beda[_0x8db2('0x11')]+_0x41beda[_0x8db2('0x14')];var _0x131252;if(_0x227355>=_0x15070d){_0x227355=_0x15070d;_0x131252=0xc8;}else{_0x131252=0xce;}_0x576475[_0x8db2('0xf')](_0x131252);return _0x576475['set'](_0x8db2('0x15'),_0x350d61+'-'+_0x227355+'/'+_0x15070d)[_0x8db2('0x10')](_0x3b2faa);}return null;};}function saveUpdates(_0x48101e){return function(_0x2b3f73){if(_0x2b3f73){return _0x2b3f73[_0x8db2('0x16')](_0x48101e)[_0x8db2('0x17')](function(_0x3fddc2){return _0x3fddc2;});}return null;};}function removeEntity(_0x2efd06){return function(_0x46ce14){if(_0x46ce14){return _0x46ce14['destroy']()['then'](function(){var _0x77789=_0x46ce14[_0x8db2('0x18')]({'plain':!![]});var _0x1310d3=_0x8db2('0x19');return db['UserProfileResource'][_0x8db2('0x1a')]({'where':{'type':_0x1310d3,'resourceId':_0x77789['id']}})[_0x8db2('0x17')](function(){return _0x46ce14;});})[_0x8db2('0x17')](function(){_0x2efd06[_0x8db2('0xf')](0xcc)[_0x8db2('0xe')]();});}};}function handleEntityNotFound(_0x597260){return function(_0x124467){if(!_0x124467){_0x597260[_0x8db2('0xd')](0x194);}return _0x124467;};}function handleError(_0x18f69c,_0x125be2){_0x125be2=_0x125be2||0x1f4;return function(_0x2260d8){logger[_0x8db2('0x1b')](_0x2260d8[_0x8db2('0x1c')]);if(_0x2260d8['name']){delete _0x2260d8[_0x8db2('0x1d')];}_0x18f69c['status'](_0x125be2)['send'](_0x2260d8);};}exports['index']=function(_0x4d923c,_0xec8cd2){var _0x29b5cd={};var _0x3be281={'count':0x0,'rows':[]};var _0x2baed0=_[_0x8db2('0x1e')](db[_0x8db2('0x1f')]['rawAttributes'],function(_0x3544ba){return{'name':_0x3544ba[_0x8db2('0x20')],'type':_0x3544ba[_0x8db2('0x21')][_0x8db2('0x22')]};});_0x29b5cd=qs['getOptions'](_0x2baed0,_0x4d923c);var _0x2e0691={'where':_0x29b5cd[_0x8db2('0x23')]};return db[_0x8db2('0x1f')][_0x8db2('0x13')](_0x2e0691)[_0x8db2('0x17')](function(_0x21bae5){_0x3be281[_0x8db2('0x13')]=_0x21bae5;_0x29b5cd[_0x8db2('0x24')]=qs[_0x8db2('0x24')](_0x4d923c['query']);return db[_0x8db2('0x1f')]['findAll'](_0x29b5cd);})['then'](function(_0x302188){_0x3be281[_0x8db2('0x25')]=_0x302188;return _0x3be281;})[_0x8db2('0x17')](respondWithFilteredResult(_0xec8cd2,_0x29b5cd))['catch'](handleError(_0xec8cd2,null));};exports[_0x8db2('0x26')]=function(_0x56b71a,_0x3f7aac){var _0x2b653b={'raw':!![],'where':{'id':_0x56b71a['params']['id']}},_0x14bd12={};_0x14bd12['model']=_[_0x8db2('0x27')](db[_0x8db2('0x1f')]['rawAttributes']);_0x14bd12['query']=_[_0x8db2('0x27')](_0x56b71a[_0x8db2('0x28')]);_0x14bd12[_0x8db2('0x29')]=_[_0x8db2('0x2a')](_0x14bd12[_0x8db2('0x2b')],_0x14bd12[_0x8db2('0x28')]);_0x2b653b[_0x8db2('0x2c')]=_[_0x8db2('0x2a')](_0x14bd12[_0x8db2('0x2b')],qs[_0x8db2('0x2d')](_0x56b71a['query'][_0x8db2('0x2d')]));_0x2b653b[_0x8db2('0x2c')]=_0x2b653b['attributes'][_0x8db2('0x2e')]?_0x2b653b[_0x8db2('0x2c')]:_0x14bd12['model'];if(_0x56b71a['query'][_0x8db2('0x2f')]){_0x2b653b['include']=[{'all':!![]}];}_0x2b653b=_[_0x8db2('0x30')]({},_0x2b653b,_0x56b71a[_0x8db2('0x31')]);return db[_0x8db2('0x1f')][_0x8db2('0x32')](_0x2b653b)['then'](handleEntityNotFound(_0x3f7aac,null))[_0x8db2('0x17')](respondWithResult(_0x3f7aac,null))['catch'](handleError(_0x3f7aac,null));};exports[_0x8db2('0x33')]=function(_0xd550ae,_0x2c8bc9){return db[_0x8db2('0x1f')]['create'](_0xd550ae['body'],{})[_0x8db2('0x17')](function(_0x2c0507){var _0x5dc2b4=_0xd550ae[_0x8db2('0x34')][_0x8db2('0x18')]({'plain':!![]});if(!_0x5dc2b4)throw new Error(_0x8db2('0x35'));if(_0x5dc2b4['role']===_0x8db2('0x34')){var _0x149186=_0x2c0507[_0x8db2('0x18')]({'plain':!![]});var _0x279e74=_0x8db2('0x19');return db[_0x8db2('0x36')][_0x8db2('0x32')]({'where':{'name':_0x279e74,'userProfileId':_0x5dc2b4[_0x8db2('0x37')]},'raw':!![]})[_0x8db2('0x17')](function(_0x63c561){if(_0x63c561&&_0x63c561[_0x8db2('0x38')]===0x0){return db[_0x8db2('0x39')][_0x8db2('0x33')]({'name':_0x149186['name'],'resourceId':_0x149186['id'],'type':_0x63c561[_0x8db2('0x1d')],'sectionId':_0x63c561['id']},{})[_0x8db2('0x17')](function(){return _0x2c0507;});}else{return _0x2c0507;}})['catch'](function(_0x49a7ae){logger[_0x8db2('0x1b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x49a7ae);throw _0x49a7ae;});}return _0x2c0507;})[_0x8db2('0x17')](respondWithResult(_0x2c8bc9,0xc9))[_0x8db2('0x3a')](handleError(_0x2c8bc9,null));};exports[_0x8db2('0x16')]=function(_0x307783,_0xb4fe2c){if(_0x307783[_0x8db2('0x3b')]['id']){delete _0x307783[_0x8db2('0x3b')]['id'];}return db['SmsQueue'][_0x8db2('0x32')]({'where':{'id':_0x307783[_0x8db2('0x3c')]['id']}})[_0x8db2('0x17')](handleEntityNotFound(_0xb4fe2c,null))[_0x8db2('0x17')](saveUpdates(_0x307783['body'],null))[_0x8db2('0x17')](respondWithResult(_0xb4fe2c,null))[_0x8db2('0x3a')](handleError(_0xb4fe2c,null));};exports[_0x8db2('0x1a')]=function(_0x2c47cc,_0x5427af){return db[_0x8db2('0x1f')]['find']({'where':{'id':_0x2c47cc[_0x8db2('0x3c')]['id']}})[_0x8db2('0x17')](handleEntityNotFound(_0x5427af,null))[_0x8db2('0x17')](removeEntity(_0x5427af,null))['catch'](handleError(_0x5427af,null));};exports['describe']=function(_0x1ec3d0,_0x47c556){return db[_0x8db2('0x1f')][_0x8db2('0x3d')]()[_0x8db2('0x17')](respondWithResult(_0x47c556,null))[_0x8db2('0x3a')](handleError(_0x47c556,null));};exports[_0x8db2('0x3e')]=function(_0x40c6e6,_0x4355e2){var _0xab6bdd={'raw':!![],'where':{}},_0x4291e3={},_0x12a1ef;return db[_0x8db2('0x1f')][_0x8db2('0x3f')]({'where':{'id':_0x40c6e6['params']['id']}})[_0x8db2('0x17')](handleEntityNotFound(_0x4355e2,null))[_0x8db2('0x17')](function(_0xdbba64){if(_0xdbba64){_0x12a1ef=_0xdbba64[_0x8db2('0x18')]({'plain':!![]});_0x4291e3['model']=_['keys'](db[_0x8db2('0x40')][_0x8db2('0x41')]);_0x4291e3[_0x8db2('0x28')]=_['keys'](_0x40c6e6['query']);_0x4291e3['filters']=_[_0x8db2('0x2a')](_0x4291e3[_0x8db2('0x2b')],_0x4291e3[_0x8db2('0x28')]);_0xab6bdd[_0x8db2('0x2c')]=_[_0x8db2('0x2a')](_0x4291e3[_0x8db2('0x2b')],qs[_0x8db2('0x2d')](_0x40c6e6['query']['fields']));_0xab6bdd[_0x8db2('0x2c')]=_0xab6bdd[_0x8db2('0x2c')][_0x8db2('0x2e')]?_0xab6bdd[_0x8db2('0x2c')]:_0x4291e3[_0x8db2('0x2b')];if(!_0x40c6e6[_0x8db2('0x28')][_0x8db2('0x42')](_0x8db2('0x43'))){_0xab6bdd[_0x8db2('0x14')]=qs[_0x8db2('0x14')](_0x40c6e6[_0x8db2('0x28')][_0x8db2('0x14')]);_0xab6bdd[_0x8db2('0x11')]=qs[_0x8db2('0x11')](_0x40c6e6[_0x8db2('0x28')]['offset']);}_0xab6bdd[_0x8db2('0x44')]=qs[_0x8db2('0x45')](_0x40c6e6['query'][_0x8db2('0x45')]);_0xab6bdd[_0x8db2('0x23')]=qs[_0x8db2('0x29')](_['pick'](_0x40c6e6[_0x8db2('0x28')],_0x4291e3[_0x8db2('0x29')]));_0xab6bdd[_0x8db2('0x23')][_0x8db2('0x46')]=_0xdbba64['id'];if(_0x40c6e6[_0x8db2('0x28')]['filter']){_0xab6bdd[_0x8db2('0x23')]=_[_0x8db2('0x30')](_0xab6bdd[_0x8db2('0x23')],{'$or':_['map'](_0xab6bdd[_0x8db2('0x2c')],function(_0x18cc13){var _0x33dddd={};_0x33dddd[_0x18cc13]={'$like':'%'+_0x40c6e6[_0x8db2('0x28')][_0x8db2('0x47')]+'%'};return _0x33dddd;})});}_0xab6bdd=_[_0x8db2('0x30')]({},_0xab6bdd,_0x40c6e6[_0x8db2('0x31')]);return db['UserSmsQueue'][_0x8db2('0x48')](_0xab6bdd);}})[_0x8db2('0x17')](function(_0x4d3c19){if(_0x4d3c19){return db[_0x8db2('0x49')][_0x8db2('0x4a')]({'where':{'id':_['map'](_0x4d3c19,_0x8db2('0x4b')),'role':_0x8db2('0x4c')},'attributes':['id',_0x8db2('0x1d'),_0x8db2('0x4d'),_0x8db2('0x4e'),_0x8db2('0x4f')]});}})[_0x8db2('0x17')](function(_0x33a600){if(_0x33a600){return{'count':_0x33a600[_0x8db2('0x13')],'rows':_[_0x8db2('0x1e')](_0x33a600[_0x8db2('0x25')],function(_0x447a47){return{'membername':_0x447a47[_0x8db2('0x1d')],'UserId':_0x447a47['id'],'queue_name':_0x12a1ef[_0x8db2('0x1d')],'SmsQueueId':_0x12a1ef['id'],'interface':util[_0x8db2('0x50')](_0x8db2('0x51'),'SIP',_0x447a47[_0x8db2('0x1d')]),'penalty':0x0,'paused':_0x447a47[_0x8db2('0x4d')],'createdAt':_0x447a47[_0x8db2('0x4f')],'updatedAt':_0x447a47[_0x8db2('0x4e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x8db2('0x17')](respondWithFilteredResult(_0x4355e2,_0xab6bdd))['catch'](handleError(_0x4355e2,null));};exports[_0x8db2('0x52')]=function(_0x2c3087,_0x3ab670){var _0x1e1c0d={};var _0x2ad70f={};var _0x348da8;var _0x17341d;return db[_0x8db2('0x1f')][_0x8db2('0x3f')]({'where':{'id':_0x2c3087[_0x8db2('0x3c')]['id']}})[_0x8db2('0x17')](handleEntityNotFound(_0x3ab670,null))[_0x8db2('0x17')](function(_0x170a72){if(_0x170a72){_0x348da8=_0x170a72;_0x2ad70f[_0x8db2('0x2b')]=_[_0x8db2('0x27')](db[_0x8db2('0x53')][_0x8db2('0x41')]);_0x2ad70f[_0x8db2('0x28')]=_['keys'](_0x2c3087[_0x8db2('0x28')]);_0x2ad70f['filters']=_[_0x8db2('0x2a')](_0x2ad70f['model'],_0x2ad70f[_0x8db2('0x28')]);_0x1e1c0d[_0x8db2('0x2c')]=_[_0x8db2('0x2a')](_0x2ad70f[_0x8db2('0x2b')],qs[_0x8db2('0x2d')](_0x2c3087['query']['fields']));_0x1e1c0d[_0x8db2('0x2c')]=_0x1e1c0d[_0x8db2('0x2c')][_0x8db2('0x2e')]?_0x1e1c0d[_0x8db2('0x2c')]:_0x2ad70f[_0x8db2('0x2b')];_0x1e1c0d[_0x8db2('0x44')]=qs[_0x8db2('0x45')](_0x2c3087[_0x8db2('0x28')]['sort']);_0x1e1c0d[_0x8db2('0x23')]=qs[_0x8db2('0x29')](_[_0x8db2('0x54')](_0x2c3087[_0x8db2('0x28')],_0x2ad70f[_0x8db2('0x29')]));if(_0x2c3087[_0x8db2('0x28')][_0x8db2('0x47')]){_0x1e1c0d[_0x8db2('0x23')]=_['merge'](_0x1e1c0d['where'],{'$or':_[_0x8db2('0x1e')](_0x1e1c0d[_0x8db2('0x2c')],function(_0x1d2dfc){var _0x27f4cd={};_0x27f4cd[_0x1d2dfc]={'$like':'%'+_0x2c3087[_0x8db2('0x28')]['filter']+'%'};return _0x27f4cd;})});}_0x1e1c0d=_['merge']({},_0x1e1c0d,_0x2c3087[_0x8db2('0x31')]);return _0x348da8[_0x8db2('0x52')](_0x1e1c0d);}})['then'](function(_0xa698bd){if(_0xa698bd){_0x17341d=_0xa698bd[_0x8db2('0x2e')];if(!_0x2c3087[_0x8db2('0x28')]['hasOwnProperty'](_0x8db2('0x43'))){_0x1e1c0d[_0x8db2('0x14')]=qs[_0x8db2('0x14')](_0x2c3087['query'][_0x8db2('0x14')]);_0x1e1c0d[_0x8db2('0x11')]=qs[_0x8db2('0x11')](_0x2c3087[_0x8db2('0x28')][_0x8db2('0x11')]);}return _0x348da8['getTeams'](_0x1e1c0d);}})[_0x8db2('0x17')](function(_0x3023fe){if(_0x3023fe){return _0x3023fe?{'count':_0x17341d,'rows':_0x3023fe}:null;}})[_0x8db2('0x17')](respondWithResult(_0x3ab670,null))['catch'](handleError(_0x3ab670,null));};exports['addTeams']=function(_0x2cdf3c,_0xbe05ca){var _0x487dcb=_0x2cdf3c[_0x8db2('0x3b')][_0x8db2('0x55')];return db[_0x8db2('0x53')][_0x8db2('0x48')]({'where':{'id':_0x487dcb},'attributes':['id'],'include':[{'model':db[_0x8db2('0x49')],'as':_0x8db2('0x56'),'attributes':['id',_0x8db2('0x1d'),_0x8db2('0x57'),_0x8db2('0x58'),_0x8db2('0x59')],'raw':!![]}]})[_0x8db2('0x17')](function(_0x3e1478){if(_0x3e1478){var _0x24a52d=_['flatMap'](_0x3e1478,function(_0x2ba42d){var _0x4f29f1=_0x2ba42d[_0x8db2('0x18')]({'plain':!![]});return _0x4f29f1[_0x8db2('0x56')];});return db['SmsQueue'][_0x8db2('0x32')]({'where':{'id':_0x2cdf3c[_0x8db2('0x3c')]['id']}})['then'](function(_0x2159c4){return db[_0x8db2('0x5a')][_0x8db2('0x5b')](function(_0x25a3ab){return _0x2159c4[_0x8db2('0x5c')](_0x487dcb,{'transaction':_0x25a3ab})[_0x8db2('0x17')](function(){return BPromise[_0x8db2('0x5d')](_0x24a52d,function(_0x3ac0fa){return db[_0x8db2('0x40')]['findOrCreate']({'where':{'UserId':_0x3ac0fa['id'],'SmsQueueId':_0x2cdf3c['params']['id']},'transaction':_0x25a3ab});});})[_0x8db2('0x17')](function(){_0x24a52d['forEach'](function(_0xf8afa5){socket[_0x8db2('0x5e')](_0x8db2('0x5f'),{'UserId':_0xf8afa5['id'],'SmsQueueId':_0x2159c4['id']});});});});});}})['then'](respondWithStatusCode(_0xbe05ca,null))[_0x8db2('0x3a')](handleError(_0xbe05ca,null));};exports[_0x8db2('0x60')]=function(_0x3e37e7,_0x591c5d){return db[_0x8db2('0x53')][_0x8db2('0x48')]({'where':{'id':_0x3e37e7[_0x8db2('0x28')][_0x8db2('0x55')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x8db2('0x56'),'attributes':['id'],'raw':!![]}]})[_0x8db2('0x17')](handleEntityNotFound(_0x591c5d,null))[_0x8db2('0x17')](function(_0x1edb1a){var _0xcf1c42=_[_0x8db2('0x1e')](_0x1edb1a,'id');var _0x1aadfb=[];var _0x3682bf=[];var _0x358f48=squel[_0x8db2('0x61')]();_0x358f48[_0x8db2('0x62')]('tq.TeamId')[_0x8db2('0x63')](_0x8db2('0x64'),'tq')[_0x8db2('0x65')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x8db2('0x66'),_0x3e37e7[_0x8db2('0x3c')]['id']);for(var _0x3191c8=0x0;_0x3191c8<_0x1edb1a[_0x8db2('0x2e')];_0x3191c8+=0x1){let _0x2ad024=_0x1edb1a[_0x3191c8];for(var _0x313918=0x0;_0x313918<_0x2ad024[_0x8db2('0x56')][_0x8db2('0x2e')];_0x313918+=0x1){let _0x3b1929=_0x2ad024[_0x8db2('0x56')][_0x313918];var _0x46eb80=_0x358f48['clone']();_0x46eb80[_0x8db2('0x23')](_0x8db2('0x67'),_0x3b1929['id']);_0x3682bf[_0x8db2('0x68')](db[_0x8db2('0x5a')]['query'](_0x46eb80['toString'](),{'type':db[_0x8db2('0x5a')][_0x8db2('0x69')]['SELECT']})[_0x8db2('0x17')](function(_0x121f31){if(_0x121f31[_0x8db2('0x2e')]===0x1){return _0x3b1929['id'];}else{var _0x5f2ece=_['every'](_['map'](_0x121f31,_0x8db2('0x6a')),function(_0x18b4a6){return _[_0x8db2('0x6b')](_0xcf1c42,_0x18b4a6);});if(_0x5f2ece){return _0x3b1929['id'];}}}));}}return BPromise[_0x8db2('0x6c')](_0x3682bf)[_0x8db2('0x17')](function(_0x4e8aac){_0x1aadfb=_(_0x1aadfb)[_0x8db2('0x6d')](_0x4e8aac)['compact']()[_0x8db2('0x6e')]();return db[_0x8db2('0x1f')][_0x8db2('0x32')]({'where':{'id':_0x3e37e7[_0x8db2('0x3c')]['id']}})[_0x8db2('0x17')](function(_0x5d5380){return db['sequelize'][_0x8db2('0x5b')](function(_0x51afcf){return _0x5d5380[_0x8db2('0x60')](_0x3e37e7[_0x8db2('0x28')][_0x8db2('0x55')],{'transaction':_0x51afcf})[_0x8db2('0x17')](function(){if(!_[_0x8db2('0x6f')](_0x1aadfb)){return _0x5d5380[_0x8db2('0x70')](_0x1aadfb,{'transaction':_0x51afcf});}})['then'](function(){_0x1aadfb[_0x8db2('0x71')](function(_0x222ea2){socket[_0x8db2('0x5e')]('userSmsQueue:remove',{'UserId':_0x222ea2,'SmsQueueId':_0x5d5380['id']});});});});});});})[_0x8db2('0x17')](respondWithStatusCode(_0x591c5d,null))[_0x8db2('0x3a')](handleError(_0x591c5d,null));};exports['addAgents']=function(_0x2d7abf,_0x7cb97d){return db[_0x8db2('0x1f')][_0x8db2('0x32')]({'where':{'id':_0x2d7abf[_0x8db2('0x3c')]['id']}})[_0x8db2('0x17')](handleEntityNotFound(_0x7cb97d,null))[_0x8db2('0x17')](function(_0x19e25b){if(_0x19e25b){return _0x19e25b[_0x8db2('0x72')](_0x2d7abf['body'][_0x8db2('0x55')],_[_0x8db2('0x73')](_0x2d7abf[_0x8db2('0x3b')],[_0x8db2('0x55'),'id'])||{})[_0x8db2('0x74')](function(_0x345ff9){for(var _0x16d1c5=0x0;_0x16d1c5<_0x2d7abf[_0x8db2('0x3b')][_0x8db2('0x55')][_0x8db2('0x2e')];_0x16d1c5+=0x1){socket['emit'](_0x8db2('0x5f'),{'UserId':Number(_0x2d7abf[_0x8db2('0x3b')][_0x8db2('0x55')][_0x16d1c5]),'SmsQueueId':Number(_0x2d7abf[_0x8db2('0x3c')]['id'])});}return _0x345ff9;});}})['then'](respondWithResult(_0x7cb97d,null))[_0x8db2('0x3a')](handleError(_0x7cb97d,null));};exports[_0x8db2('0x70')]=function(_0x46476e,_0x4f653e){return db['SmsQueue'][_0x8db2('0x32')]({'where':{'id':_0x46476e[_0x8db2('0x3c')]['id']}})[_0x8db2('0x17')](handleEntityNotFound(_0x4f653e,null))[_0x8db2('0x17')](function(_0x4f9ce4){if(_0x4f9ce4){return _0x4f9ce4[_0x8db2('0x70')](_0x46476e[_0x8db2('0x28')][_0x8db2('0x55')])[_0x8db2('0x17')](function(){if(_['isArray'](_0x46476e[_0x8db2('0x28')][_0x8db2('0x55')])){for(var _0x3e7b24=0x0;_0x3e7b24<_0x46476e['query']['ids']['length'];_0x3e7b24+=0x1){socket[_0x8db2('0x5e')](_0x8db2('0x75'),{'UserId':Number(_0x46476e[_0x8db2('0x28')][_0x8db2('0x55')][_0x3e7b24]),'SmsQueueId':Number(_0x46476e['params']['id'])});}}else{socket['emit'](_0x8db2('0x75'),{'UserId':Number(_0x46476e[_0x8db2('0x28')][_0x8db2('0x55')]),'SmsQueueId':Number(_0x46476e[_0x8db2('0x3c')]['id'])});}});}})[_0x8db2('0x17')](respondWithStatusCode(_0x4f653e,null))[_0x8db2('0x3a')](handleError(_0x4f653e,null));};exports['getAgents']=function(_0x2942eb,_0x5f32ce){var _0x432780={};var _0x23457b={};var _0x1ef898;var _0x39f2d3;return db[_0x8db2('0x1f')]['findOne']({'where':{'id':_0x2942eb[_0x8db2('0x3c')]['id']}})[_0x8db2('0x17')](handleEntityNotFound(_0x5f32ce,null))['then'](function(_0x28beec){if(_0x28beec){_0x1ef898=_0x28beec;_0x23457b[_0x8db2('0x2b')]=_[_0x8db2('0x27')](db[_0x8db2('0x49')]['rawAttributes']);_0x23457b[_0x8db2('0x28')]=_['keys'](_0x2942eb['query']);_0x23457b[_0x8db2('0x29')]=_[_0x8db2('0x2a')](_0x23457b[_0x8db2('0x2b')],_0x23457b[_0x8db2('0x28')]);_0x432780[_0x8db2('0x2c')]=_[_0x8db2('0x2a')](_0x23457b[_0x8db2('0x2b')],qs['fields'](_0x2942eb[_0x8db2('0x28')]['fields']));_0x432780['attributes']=_0x432780[_0x8db2('0x2c')]['length']?_0x432780['attributes']:_0x23457b[_0x8db2('0x2b')];_0x432780[_0x8db2('0x44')]=qs[_0x8db2('0x45')](_0x2942eb['query'][_0x8db2('0x45')]);_0x432780[_0x8db2('0x23')]=qs[_0x8db2('0x29')](_['pick'](_0x2942eb[_0x8db2('0x28')],_0x23457b[_0x8db2('0x29')]));if(_0x2942eb[_0x8db2('0x28')][_0x8db2('0x47')]){_0x432780[_0x8db2('0x23')]=_[_0x8db2('0x30')](_0x432780[_0x8db2('0x23')],{'$or':_[_0x8db2('0x1e')](_0x432780['attributes'],function(_0xa7b208){var _0x3cb456={};_0x3cb456[_0xa7b208]={'$like':'%'+_0x2942eb[_0x8db2('0x28')][_0x8db2('0x47')]+'%'};return _0x3cb456;})});}_0x432780=_[_0x8db2('0x30')]({},_0x432780,_0x2942eb[_0x8db2('0x31')]);return _0x1ef898[_0x8db2('0x76')](_0x432780);}})[_0x8db2('0x17')](function(_0x3a53e2){if(_0x3a53e2){_0x39f2d3=_0x3a53e2[_0x8db2('0x2e')];if(!_0x2942eb[_0x8db2('0x28')]['hasOwnProperty'](_0x8db2('0x43'))){_0x432780[_0x8db2('0x14')]=qs[_0x8db2('0x14')](_0x2942eb['query'][_0x8db2('0x14')]);_0x432780[_0x8db2('0x11')]=qs[_0x8db2('0x11')](_0x2942eb['query']['offset']);}return _0x1ef898[_0x8db2('0x76')](_0x432780);}})[_0x8db2('0x17')](function(_0x296966){if(_0x296966){return _0x296966?{'count':_0x39f2d3,'rows':_0x296966}:null;}})[_0x8db2('0x17')](respondWithResult(_0x5f32ce,null))[_0x8db2('0x3a')](handleError(_0x5f32ce,null));}; \ No newline at end of file +var _0xdb28=['userSmsQueue:save','removeTeams','select','field','from','team_has_sms_queues','join','SmsQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','QueryTypes','TeamId','includes','all','union','value','isEmpty','removeAgents','forEach','addAgents','omit','spread','userSmsQueue:remove','getAgents','bluebird','util','lodash','squel','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','./smsQueue.socket','register','sendStatus','end','status','json','offset','undefined','count','limit','Content-Range','update','then','get','SmsQueues','destroy','error','stack','name','map','SmsQueue','fieldName','type','key','where','include','rows','show','keys','query','filters','intersection','model','attributes','fields','length','includeAll','merge','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','catch','body','params','describe','getMembers','findOne','UserSmsQueue','rawAttributes','hasOwnProperty','nolimit','order','sort','SmsQueueId','filter','findAll','User','findAndCountAll','UserId','agent','smsPause','updatedAt','createdAt','format','%s/%s','getTeams','Team','pick','ids','Agents','online','voicePause','interface','sequelize','transaction','addTeams','each','emit'];(function(_0x48ebe8,_0x25cf34){var _0x2aa204=function(_0x3b13af){while(--_0x3b13af){_0x48ebe8['push'](_0x48ebe8['shift']());}};_0x2aa204(++_0x25cf34);}(_0xdb28,0x106));var _0x8db2=function(_0x4daee2,_0x5d6b1){_0x4daee2=_0x4daee2-0x0;var _0x55120e=_0xdb28[_0x4daee2];return _0x55120e;};'use strict';var BPromise=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var _=require(_0x8db2('0x2'));var squel=require(_0x8db2('0x3'));var Redis=require('ioredis');var qs=require(_0x8db2('0x4'));var logger=require(_0x8db2('0x5'))(_0x8db2('0x6'));var config=require(_0x8db2('0x7'));var db=require(_0x8db2('0x8'))['db'];config['redis']=_[_0x8db2('0x9')](config[_0x8db2('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8db2('0xa')]));require(_0x8db2('0xb'))[_0x8db2('0xc')](socket);function respondWithStatusCode(_0x29f698,_0x2f3f2f){_0x2f3f2f=_0x2f3f2f||0xcc;return function(_0x1ff362){if(_0x1ff362){return _0x29f698[_0x8db2('0xd')](_0x2f3f2f);}return _0x29f698['status'](_0x2f3f2f)[_0x8db2('0xe')]();};}function respondWithResult(_0x476216,_0x1f62af){_0x1f62af=_0x1f62af||0xc8;return function(_0x57015f){if(_0x57015f){return _0x476216[_0x8db2('0xf')](_0x1f62af)[_0x8db2('0x10')](_0x57015f);}};}function respondWithFilteredResult(_0x576475,_0x41beda){return function(_0x3b2faa){if(_0x3b2faa){var _0x1349f6=typeof _0x41beda[_0x8db2('0x11')]===_0x8db2('0x12')&&typeof _0x41beda['limit']==='undefined';var _0x15070d=_0x3b2faa[_0x8db2('0x13')];var _0x350d61=_0x1349f6?0x0:_0x41beda[_0x8db2('0x11')];var _0x227355=_0x1349f6?_0x3b2faa[_0x8db2('0x13')]:_0x41beda[_0x8db2('0x11')]+_0x41beda[_0x8db2('0x14')];var _0x131252;if(_0x227355>=_0x15070d){_0x227355=_0x15070d;_0x131252=0xc8;}else{_0x131252=0xce;}_0x576475[_0x8db2('0xf')](_0x131252);return _0x576475['set'](_0x8db2('0x15'),_0x350d61+'-'+_0x227355+'/'+_0x15070d)[_0x8db2('0x10')](_0x3b2faa);}return null;};}function saveUpdates(_0x48101e){return function(_0x2b3f73){if(_0x2b3f73){return _0x2b3f73[_0x8db2('0x16')](_0x48101e)[_0x8db2('0x17')](function(_0x3fddc2){return _0x3fddc2;});}return null;};}function removeEntity(_0x2efd06){return function(_0x46ce14){if(_0x46ce14){return _0x46ce14['destroy']()['then'](function(){var _0x77789=_0x46ce14[_0x8db2('0x18')]({'plain':!![]});var _0x1310d3=_0x8db2('0x19');return db['UserProfileResource'][_0x8db2('0x1a')]({'where':{'type':_0x1310d3,'resourceId':_0x77789['id']}})[_0x8db2('0x17')](function(){return _0x46ce14;});})[_0x8db2('0x17')](function(){_0x2efd06[_0x8db2('0xf')](0xcc)[_0x8db2('0xe')]();});}};}function handleEntityNotFound(_0x597260){return function(_0x124467){if(!_0x124467){_0x597260[_0x8db2('0xd')](0x194);}return _0x124467;};}function handleError(_0x18f69c,_0x125be2){_0x125be2=_0x125be2||0x1f4;return function(_0x2260d8){logger[_0x8db2('0x1b')](_0x2260d8[_0x8db2('0x1c')]);if(_0x2260d8['name']){delete _0x2260d8[_0x8db2('0x1d')];}_0x18f69c['status'](_0x125be2)['send'](_0x2260d8);};}exports['index']=function(_0x4d923c,_0xec8cd2){var _0x29b5cd={};var _0x3be281={'count':0x0,'rows':[]};var _0x2baed0=_[_0x8db2('0x1e')](db[_0x8db2('0x1f')]['rawAttributes'],function(_0x3544ba){return{'name':_0x3544ba[_0x8db2('0x20')],'type':_0x3544ba[_0x8db2('0x21')][_0x8db2('0x22')]};});_0x29b5cd=qs['getOptions'](_0x2baed0,_0x4d923c);var _0x2e0691={'where':_0x29b5cd[_0x8db2('0x23')]};return db[_0x8db2('0x1f')][_0x8db2('0x13')](_0x2e0691)[_0x8db2('0x17')](function(_0x21bae5){_0x3be281[_0x8db2('0x13')]=_0x21bae5;_0x29b5cd[_0x8db2('0x24')]=qs[_0x8db2('0x24')](_0x4d923c['query']);return db[_0x8db2('0x1f')]['findAll'](_0x29b5cd);})['then'](function(_0x302188){_0x3be281[_0x8db2('0x25')]=_0x302188;return _0x3be281;})[_0x8db2('0x17')](respondWithFilteredResult(_0xec8cd2,_0x29b5cd))['catch'](handleError(_0xec8cd2,null));};exports[_0x8db2('0x26')]=function(_0x56b71a,_0x3f7aac){var _0x2b653b={'raw':!![],'where':{'id':_0x56b71a['params']['id']}},_0x14bd12={};_0x14bd12['model']=_[_0x8db2('0x27')](db[_0x8db2('0x1f')]['rawAttributes']);_0x14bd12['query']=_[_0x8db2('0x27')](_0x56b71a[_0x8db2('0x28')]);_0x14bd12[_0x8db2('0x29')]=_[_0x8db2('0x2a')](_0x14bd12[_0x8db2('0x2b')],_0x14bd12[_0x8db2('0x28')]);_0x2b653b[_0x8db2('0x2c')]=_[_0x8db2('0x2a')](_0x14bd12[_0x8db2('0x2b')],qs[_0x8db2('0x2d')](_0x56b71a['query'][_0x8db2('0x2d')]));_0x2b653b[_0x8db2('0x2c')]=_0x2b653b['attributes'][_0x8db2('0x2e')]?_0x2b653b[_0x8db2('0x2c')]:_0x14bd12['model'];if(_0x56b71a['query'][_0x8db2('0x2f')]){_0x2b653b['include']=[{'all':!![]}];}_0x2b653b=_[_0x8db2('0x30')]({},_0x2b653b,_0x56b71a[_0x8db2('0x31')]);return db[_0x8db2('0x1f')][_0x8db2('0x32')](_0x2b653b)['then'](handleEntityNotFound(_0x3f7aac,null))[_0x8db2('0x17')](respondWithResult(_0x3f7aac,null))['catch'](handleError(_0x3f7aac,null));};exports[_0x8db2('0x33')]=function(_0xd550ae,_0x2c8bc9){return db[_0x8db2('0x1f')]['create'](_0xd550ae['body'],{})[_0x8db2('0x17')](function(_0x2c0507){var _0x5dc2b4=_0xd550ae[_0x8db2('0x34')][_0x8db2('0x18')]({'plain':!![]});if(!_0x5dc2b4)throw new Error(_0x8db2('0x35'));if(_0x5dc2b4['role']===_0x8db2('0x34')){var _0x149186=_0x2c0507[_0x8db2('0x18')]({'plain':!![]});var _0x279e74=_0x8db2('0x19');return db[_0x8db2('0x36')][_0x8db2('0x32')]({'where':{'name':_0x279e74,'userProfileId':_0x5dc2b4[_0x8db2('0x37')]},'raw':!![]})[_0x8db2('0x17')](function(_0x63c561){if(_0x63c561&&_0x63c561[_0x8db2('0x38')]===0x0){return db[_0x8db2('0x39')][_0x8db2('0x33')]({'name':_0x149186['name'],'resourceId':_0x149186['id'],'type':_0x63c561[_0x8db2('0x1d')],'sectionId':_0x63c561['id']},{})[_0x8db2('0x17')](function(){return _0x2c0507;});}else{return _0x2c0507;}})['catch'](function(_0x49a7ae){logger[_0x8db2('0x1b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x49a7ae);throw _0x49a7ae;});}return _0x2c0507;})[_0x8db2('0x17')](respondWithResult(_0x2c8bc9,0xc9))[_0x8db2('0x3a')](handleError(_0x2c8bc9,null));};exports[_0x8db2('0x16')]=function(_0x307783,_0xb4fe2c){if(_0x307783[_0x8db2('0x3b')]['id']){delete _0x307783[_0x8db2('0x3b')]['id'];}return db['SmsQueue'][_0x8db2('0x32')]({'where':{'id':_0x307783[_0x8db2('0x3c')]['id']}})[_0x8db2('0x17')](handleEntityNotFound(_0xb4fe2c,null))[_0x8db2('0x17')](saveUpdates(_0x307783['body'],null))[_0x8db2('0x17')](respondWithResult(_0xb4fe2c,null))[_0x8db2('0x3a')](handleError(_0xb4fe2c,null));};exports[_0x8db2('0x1a')]=function(_0x2c47cc,_0x5427af){return db[_0x8db2('0x1f')]['find']({'where':{'id':_0x2c47cc[_0x8db2('0x3c')]['id']}})[_0x8db2('0x17')](handleEntityNotFound(_0x5427af,null))[_0x8db2('0x17')](removeEntity(_0x5427af,null))['catch'](handleError(_0x5427af,null));};exports['describe']=function(_0x1ec3d0,_0x47c556){return db[_0x8db2('0x1f')][_0x8db2('0x3d')]()[_0x8db2('0x17')](respondWithResult(_0x47c556,null))[_0x8db2('0x3a')](handleError(_0x47c556,null));};exports[_0x8db2('0x3e')]=function(_0x40c6e6,_0x4355e2){var _0xab6bdd={'raw':!![],'where':{}},_0x4291e3={},_0x12a1ef;return db[_0x8db2('0x1f')][_0x8db2('0x3f')]({'where':{'id':_0x40c6e6['params']['id']}})[_0x8db2('0x17')](handleEntityNotFound(_0x4355e2,null))[_0x8db2('0x17')](function(_0xdbba64){if(_0xdbba64){_0x12a1ef=_0xdbba64[_0x8db2('0x18')]({'plain':!![]});_0x4291e3['model']=_['keys'](db[_0x8db2('0x40')][_0x8db2('0x41')]);_0x4291e3[_0x8db2('0x28')]=_['keys'](_0x40c6e6['query']);_0x4291e3['filters']=_[_0x8db2('0x2a')](_0x4291e3[_0x8db2('0x2b')],_0x4291e3[_0x8db2('0x28')]);_0xab6bdd[_0x8db2('0x2c')]=_[_0x8db2('0x2a')](_0x4291e3[_0x8db2('0x2b')],qs[_0x8db2('0x2d')](_0x40c6e6['query']['fields']));_0xab6bdd[_0x8db2('0x2c')]=_0xab6bdd[_0x8db2('0x2c')][_0x8db2('0x2e')]?_0xab6bdd[_0x8db2('0x2c')]:_0x4291e3[_0x8db2('0x2b')];if(!_0x40c6e6[_0x8db2('0x28')][_0x8db2('0x42')](_0x8db2('0x43'))){_0xab6bdd[_0x8db2('0x14')]=qs[_0x8db2('0x14')](_0x40c6e6[_0x8db2('0x28')][_0x8db2('0x14')]);_0xab6bdd[_0x8db2('0x11')]=qs[_0x8db2('0x11')](_0x40c6e6[_0x8db2('0x28')]['offset']);}_0xab6bdd[_0x8db2('0x44')]=qs[_0x8db2('0x45')](_0x40c6e6['query'][_0x8db2('0x45')]);_0xab6bdd[_0x8db2('0x23')]=qs[_0x8db2('0x29')](_['pick'](_0x40c6e6[_0x8db2('0x28')],_0x4291e3[_0x8db2('0x29')]));_0xab6bdd[_0x8db2('0x23')][_0x8db2('0x46')]=_0xdbba64['id'];if(_0x40c6e6[_0x8db2('0x28')]['filter']){_0xab6bdd[_0x8db2('0x23')]=_[_0x8db2('0x30')](_0xab6bdd[_0x8db2('0x23')],{'$or':_['map'](_0xab6bdd[_0x8db2('0x2c')],function(_0x18cc13){var _0x33dddd={};_0x33dddd[_0x18cc13]={'$like':'%'+_0x40c6e6[_0x8db2('0x28')][_0x8db2('0x47')]+'%'};return _0x33dddd;})});}_0xab6bdd=_[_0x8db2('0x30')]({},_0xab6bdd,_0x40c6e6[_0x8db2('0x31')]);return db['UserSmsQueue'][_0x8db2('0x48')](_0xab6bdd);}})[_0x8db2('0x17')](function(_0x4d3c19){if(_0x4d3c19){return db[_0x8db2('0x49')][_0x8db2('0x4a')]({'where':{'id':_['map'](_0x4d3c19,_0x8db2('0x4b')),'role':_0x8db2('0x4c')},'attributes':['id',_0x8db2('0x1d'),_0x8db2('0x4d'),_0x8db2('0x4e'),_0x8db2('0x4f')]});}})[_0x8db2('0x17')](function(_0x33a600){if(_0x33a600){return{'count':_0x33a600[_0x8db2('0x13')],'rows':_[_0x8db2('0x1e')](_0x33a600[_0x8db2('0x25')],function(_0x447a47){return{'membername':_0x447a47[_0x8db2('0x1d')],'UserId':_0x447a47['id'],'queue_name':_0x12a1ef[_0x8db2('0x1d')],'SmsQueueId':_0x12a1ef['id'],'interface':util[_0x8db2('0x50')](_0x8db2('0x51'),'SIP',_0x447a47[_0x8db2('0x1d')]),'penalty':0x0,'paused':_0x447a47[_0x8db2('0x4d')],'createdAt':_0x447a47[_0x8db2('0x4f')],'updatedAt':_0x447a47[_0x8db2('0x4e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x8db2('0x17')](respondWithFilteredResult(_0x4355e2,_0xab6bdd))['catch'](handleError(_0x4355e2,null));};exports[_0x8db2('0x52')]=function(_0x2c3087,_0x3ab670){var _0x1e1c0d={};var _0x2ad70f={};var _0x348da8;var _0x17341d;return db[_0x8db2('0x1f')][_0x8db2('0x3f')]({'where':{'id':_0x2c3087[_0x8db2('0x3c')]['id']}})[_0x8db2('0x17')](handleEntityNotFound(_0x3ab670,null))[_0x8db2('0x17')](function(_0x170a72){if(_0x170a72){_0x348da8=_0x170a72;_0x2ad70f[_0x8db2('0x2b')]=_[_0x8db2('0x27')](db[_0x8db2('0x53')][_0x8db2('0x41')]);_0x2ad70f[_0x8db2('0x28')]=_['keys'](_0x2c3087[_0x8db2('0x28')]);_0x2ad70f['filters']=_[_0x8db2('0x2a')](_0x2ad70f['model'],_0x2ad70f[_0x8db2('0x28')]);_0x1e1c0d[_0x8db2('0x2c')]=_[_0x8db2('0x2a')](_0x2ad70f[_0x8db2('0x2b')],qs[_0x8db2('0x2d')](_0x2c3087['query']['fields']));_0x1e1c0d[_0x8db2('0x2c')]=_0x1e1c0d[_0x8db2('0x2c')][_0x8db2('0x2e')]?_0x1e1c0d[_0x8db2('0x2c')]:_0x2ad70f[_0x8db2('0x2b')];_0x1e1c0d[_0x8db2('0x44')]=qs[_0x8db2('0x45')](_0x2c3087[_0x8db2('0x28')]['sort']);_0x1e1c0d[_0x8db2('0x23')]=qs[_0x8db2('0x29')](_[_0x8db2('0x54')](_0x2c3087[_0x8db2('0x28')],_0x2ad70f[_0x8db2('0x29')]));if(_0x2c3087[_0x8db2('0x28')][_0x8db2('0x47')]){_0x1e1c0d[_0x8db2('0x23')]=_['merge'](_0x1e1c0d['where'],{'$or':_[_0x8db2('0x1e')](_0x1e1c0d[_0x8db2('0x2c')],function(_0x1d2dfc){var _0x27f4cd={};_0x27f4cd[_0x1d2dfc]={'$like':'%'+_0x2c3087[_0x8db2('0x28')]['filter']+'%'};return _0x27f4cd;})});}_0x1e1c0d=_['merge']({},_0x1e1c0d,_0x2c3087[_0x8db2('0x31')]);return _0x348da8[_0x8db2('0x52')](_0x1e1c0d);}})['then'](function(_0xa698bd){if(_0xa698bd){_0x17341d=_0xa698bd[_0x8db2('0x2e')];if(!_0x2c3087[_0x8db2('0x28')]['hasOwnProperty'](_0x8db2('0x43'))){_0x1e1c0d[_0x8db2('0x14')]=qs[_0x8db2('0x14')](_0x2c3087['query'][_0x8db2('0x14')]);_0x1e1c0d[_0x8db2('0x11')]=qs[_0x8db2('0x11')](_0x2c3087[_0x8db2('0x28')][_0x8db2('0x11')]);}return _0x348da8['getTeams'](_0x1e1c0d);}})[_0x8db2('0x17')](function(_0x3023fe){if(_0x3023fe){return _0x3023fe?{'count':_0x17341d,'rows':_0x3023fe}:null;}})[_0x8db2('0x17')](respondWithResult(_0x3ab670,null))['catch'](handleError(_0x3ab670,null));};exports['addTeams']=function(_0x2cdf3c,_0xbe05ca){var _0x487dcb=_0x2cdf3c[_0x8db2('0x3b')][_0x8db2('0x55')];return db[_0x8db2('0x53')][_0x8db2('0x48')]({'where':{'id':_0x487dcb},'attributes':['id'],'include':[{'model':db[_0x8db2('0x49')],'as':_0x8db2('0x56'),'attributes':['id',_0x8db2('0x1d'),_0x8db2('0x57'),_0x8db2('0x58'),_0x8db2('0x59')],'raw':!![]}]})[_0x8db2('0x17')](function(_0x3e1478){if(_0x3e1478){var _0x24a52d=_['flatMap'](_0x3e1478,function(_0x2ba42d){var _0x4f29f1=_0x2ba42d[_0x8db2('0x18')]({'plain':!![]});return _0x4f29f1[_0x8db2('0x56')];});return db['SmsQueue'][_0x8db2('0x32')]({'where':{'id':_0x2cdf3c[_0x8db2('0x3c')]['id']}})['then'](function(_0x2159c4){return db[_0x8db2('0x5a')][_0x8db2('0x5b')](function(_0x25a3ab){return _0x2159c4[_0x8db2('0x5c')](_0x487dcb,{'transaction':_0x25a3ab})[_0x8db2('0x17')](function(){return BPromise[_0x8db2('0x5d')](_0x24a52d,function(_0x3ac0fa){return db[_0x8db2('0x40')]['findOrCreate']({'where':{'UserId':_0x3ac0fa['id'],'SmsQueueId':_0x2cdf3c['params']['id']},'transaction':_0x25a3ab});});})[_0x8db2('0x17')](function(){_0x24a52d['forEach'](function(_0xf8afa5){socket[_0x8db2('0x5e')](_0x8db2('0x5f'),{'UserId':_0xf8afa5['id'],'SmsQueueId':_0x2159c4['id']});});});});});}})['then'](respondWithStatusCode(_0xbe05ca,null))[_0x8db2('0x3a')](handleError(_0xbe05ca,null));};exports[_0x8db2('0x60')]=function(_0x3e37e7,_0x591c5d){return db[_0x8db2('0x53')][_0x8db2('0x48')]({'where':{'id':_0x3e37e7[_0x8db2('0x28')][_0x8db2('0x55')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x8db2('0x56'),'attributes':['id'],'raw':!![]}]})[_0x8db2('0x17')](handleEntityNotFound(_0x591c5d,null))[_0x8db2('0x17')](function(_0x1edb1a){var _0xcf1c42=_[_0x8db2('0x1e')](_0x1edb1a,'id');var _0x1aadfb=[];var _0x3682bf=[];var _0x358f48=squel[_0x8db2('0x61')]();_0x358f48[_0x8db2('0x62')]('tq.TeamId')[_0x8db2('0x63')](_0x8db2('0x64'),'tq')[_0x8db2('0x65')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x8db2('0x66'),_0x3e37e7[_0x8db2('0x3c')]['id']);for(var _0x3191c8=0x0;_0x3191c8<_0x1edb1a[_0x8db2('0x2e')];_0x3191c8+=0x1){let _0x2ad024=_0x1edb1a[_0x3191c8];for(var _0x313918=0x0;_0x313918<_0x2ad024[_0x8db2('0x56')][_0x8db2('0x2e')];_0x313918+=0x1){let _0x3b1929=_0x2ad024[_0x8db2('0x56')][_0x313918];var _0x46eb80=_0x358f48['clone']();_0x46eb80[_0x8db2('0x23')](_0x8db2('0x67'),_0x3b1929['id']);_0x3682bf[_0x8db2('0x68')](db[_0x8db2('0x5a')]['query'](_0x46eb80['toString'](),{'type':db[_0x8db2('0x5a')][_0x8db2('0x69')]['SELECT']})[_0x8db2('0x17')](function(_0x121f31){if(_0x121f31[_0x8db2('0x2e')]===0x1){return _0x3b1929['id'];}else{var _0x5f2ece=_['every'](_['map'](_0x121f31,_0x8db2('0x6a')),function(_0x18b4a6){return _[_0x8db2('0x6b')](_0xcf1c42,_0x18b4a6);});if(_0x5f2ece){return _0x3b1929['id'];}}}));}}return BPromise[_0x8db2('0x6c')](_0x3682bf)[_0x8db2('0x17')](function(_0x4e8aac){_0x1aadfb=_(_0x1aadfb)[_0x8db2('0x6d')](_0x4e8aac)['compact']()[_0x8db2('0x6e')]();return db[_0x8db2('0x1f')][_0x8db2('0x32')]({'where':{'id':_0x3e37e7[_0x8db2('0x3c')]['id']}})[_0x8db2('0x17')](function(_0x5d5380){return db['sequelize'][_0x8db2('0x5b')](function(_0x51afcf){return _0x5d5380[_0x8db2('0x60')](_0x3e37e7[_0x8db2('0x28')][_0x8db2('0x55')],{'transaction':_0x51afcf})[_0x8db2('0x17')](function(){if(!_[_0x8db2('0x6f')](_0x1aadfb)){return _0x5d5380[_0x8db2('0x70')](_0x1aadfb,{'transaction':_0x51afcf});}})['then'](function(){_0x1aadfb[_0x8db2('0x71')](function(_0x222ea2){socket[_0x8db2('0x5e')]('userSmsQueue:remove',{'UserId':_0x222ea2,'SmsQueueId':_0x5d5380['id']});});});});});});})[_0x8db2('0x17')](respondWithStatusCode(_0x591c5d,null))[_0x8db2('0x3a')](handleError(_0x591c5d,null));};exports['addAgents']=function(_0x2d7abf,_0x7cb97d){return db[_0x8db2('0x1f')][_0x8db2('0x32')]({'where':{'id':_0x2d7abf[_0x8db2('0x3c')]['id']}})[_0x8db2('0x17')](handleEntityNotFound(_0x7cb97d,null))[_0x8db2('0x17')](function(_0x19e25b){if(_0x19e25b){return _0x19e25b[_0x8db2('0x72')](_0x2d7abf['body'][_0x8db2('0x55')],_[_0x8db2('0x73')](_0x2d7abf[_0x8db2('0x3b')],[_0x8db2('0x55'),'id'])||{})[_0x8db2('0x74')](function(_0x345ff9){for(var _0x16d1c5=0x0;_0x16d1c5<_0x2d7abf[_0x8db2('0x3b')][_0x8db2('0x55')][_0x8db2('0x2e')];_0x16d1c5+=0x1){socket['emit'](_0x8db2('0x5f'),{'UserId':Number(_0x2d7abf[_0x8db2('0x3b')][_0x8db2('0x55')][_0x16d1c5]),'SmsQueueId':Number(_0x2d7abf[_0x8db2('0x3c')]['id'])});}return _0x345ff9;});}})['then'](respondWithResult(_0x7cb97d,null))[_0x8db2('0x3a')](handleError(_0x7cb97d,null));};exports[_0x8db2('0x70')]=function(_0x46476e,_0x4f653e){return db['SmsQueue'][_0x8db2('0x32')]({'where':{'id':_0x46476e[_0x8db2('0x3c')]['id']}})[_0x8db2('0x17')](handleEntityNotFound(_0x4f653e,null))[_0x8db2('0x17')](function(_0x4f9ce4){if(_0x4f9ce4){return _0x4f9ce4[_0x8db2('0x70')](_0x46476e[_0x8db2('0x28')][_0x8db2('0x55')])[_0x8db2('0x17')](function(){if(_['isArray'](_0x46476e[_0x8db2('0x28')][_0x8db2('0x55')])){for(var _0x3e7b24=0x0;_0x3e7b24<_0x46476e['query']['ids']['length'];_0x3e7b24+=0x1){socket[_0x8db2('0x5e')](_0x8db2('0x75'),{'UserId':Number(_0x46476e[_0x8db2('0x28')][_0x8db2('0x55')][_0x3e7b24]),'SmsQueueId':Number(_0x46476e['params']['id'])});}}else{socket['emit'](_0x8db2('0x75'),{'UserId':Number(_0x46476e[_0x8db2('0x28')][_0x8db2('0x55')]),'SmsQueueId':Number(_0x46476e[_0x8db2('0x3c')]['id'])});}});}})[_0x8db2('0x17')](respondWithStatusCode(_0x4f653e,null))[_0x8db2('0x3a')](handleError(_0x4f653e,null));};exports['getAgents']=function(_0x2942eb,_0x5f32ce){var _0x432780={};var _0x23457b={};var _0x1ef898;var _0x39f2d3;return db[_0x8db2('0x1f')]['findOne']({'where':{'id':_0x2942eb[_0x8db2('0x3c')]['id']}})[_0x8db2('0x17')](handleEntityNotFound(_0x5f32ce,null))['then'](function(_0x28beec){if(_0x28beec){_0x1ef898=_0x28beec;_0x23457b[_0x8db2('0x2b')]=_[_0x8db2('0x27')](db[_0x8db2('0x49')]['rawAttributes']);_0x23457b[_0x8db2('0x28')]=_['keys'](_0x2942eb['query']);_0x23457b[_0x8db2('0x29')]=_[_0x8db2('0x2a')](_0x23457b[_0x8db2('0x2b')],_0x23457b[_0x8db2('0x28')]);_0x432780[_0x8db2('0x2c')]=_[_0x8db2('0x2a')](_0x23457b[_0x8db2('0x2b')],qs['fields'](_0x2942eb[_0x8db2('0x28')]['fields']));_0x432780['attributes']=_0x432780[_0x8db2('0x2c')]['length']?_0x432780['attributes']:_0x23457b[_0x8db2('0x2b')];_0x432780[_0x8db2('0x44')]=qs[_0x8db2('0x45')](_0x2942eb['query'][_0x8db2('0x45')]);_0x432780[_0x8db2('0x23')]=qs[_0x8db2('0x29')](_['pick'](_0x2942eb[_0x8db2('0x28')],_0x23457b[_0x8db2('0x29')]));if(_0x2942eb[_0x8db2('0x28')][_0x8db2('0x47')]){_0x432780[_0x8db2('0x23')]=_[_0x8db2('0x30')](_0x432780[_0x8db2('0x23')],{'$or':_[_0x8db2('0x1e')](_0x432780['attributes'],function(_0xa7b208){var _0x3cb456={};_0x3cb456[_0xa7b208]={'$like':'%'+_0x2942eb[_0x8db2('0x28')][_0x8db2('0x47')]+'%'};return _0x3cb456;})});}_0x432780=_[_0x8db2('0x30')]({},_0x432780,_0x2942eb[_0x8db2('0x31')]);return _0x1ef898[_0x8db2('0x76')](_0x432780);}})[_0x8db2('0x17')](function(_0x3a53e2){if(_0x3a53e2){_0x39f2d3=_0x3a53e2[_0x8db2('0x2e')];if(!_0x2942eb[_0x8db2('0x28')]['hasOwnProperty'](_0x8db2('0x43'))){_0x432780[_0x8db2('0x14')]=qs[_0x8db2('0x14')](_0x2942eb['query'][_0x8db2('0x14')]);_0x432780[_0x8db2('0x11')]=qs[_0x8db2('0x11')](_0x2942eb['query']['offset']);}return _0x1ef898[_0x8db2('0x76')](_0x432780);}})[_0x8db2('0x17')](function(_0x296966){if(_0x296966){return _0x296966?{'count':_0x39f2d3,'rows':_0x296966}:null;}})[_0x8db2('0x17')](respondWithResult(_0x5f32ce,null))[_0x8db2('0x3a')](handleError(_0x5f32ce,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index bb3a213..9fe3e94 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 _0xbab3=['emit','hasOwnProperty','events','SmsQueue','setMaxListeners','update'];(function(_0x437aba,_0x4a4280){var _0x4ea241=function(_0xab2fc7){while(--_0xab2fc7){_0x437aba['push'](_0x437aba['shift']());}};_0x4ea241(++_0x4a4280);}(_0xbab3,0x1f4));var _0x3bab=function(_0x2c0c8d,_0x4a86c7){_0x2c0c8d=_0x2c0c8d-0x0;var _0x114e7a=_0xbab3[_0x2c0c8d];return _0x114e7a;};'use strict';var EventEmitter=require(_0x3bab('0x0'));var SmsQueue=require('../../mysqldb')['db'][_0x3bab('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x3bab('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x3bab('0x3'),'afterDestroy':'remove'};function emitEvent(_0x3846ef){return function(_0x2cb5bc,_0x3b8eaa,_0x4a4a3f){SmsQueueEvents[_0x3bab('0x4')](_0x3846ef+':'+_0x2cb5bc['id'],_0x2cb5bc);SmsQueueEvents[_0x3bab('0x4')](_0x3846ef,_0x2cb5bc);_0x4a4a3f(null);};}for(var e in events){if(events[_0x3bab('0x5')](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module['exports']=SmsQueueEvents; \ No newline at end of file +var _0x32ce=['events','SmsQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x1acdd9,_0x4be278){var _0x2058c4=function(_0x1bc472){while(--_0x1bc472){_0x1acdd9['push'](_0x1acdd9['shift']());}};_0x2058c4(++_0x4be278);}(_0x32ce,0x104));var _0xe32c=function(_0x4cceef,_0x1313a3){_0x4cceef=_0x4cceef-0x0;var _0x54d224=_0x32ce[_0x4cceef];return _0x54d224;};'use strict';var EventEmitter=require(_0xe32c('0x0'));var SmsQueue=require('../../mysqldb')['db'][_0xe32c('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xe32c('0x2')](0x0);var events={'afterCreate':_0xe32c('0x3'),'afterUpdate':_0xe32c('0x4'),'afterDestroy':_0xe32c('0x5')};function emitEvent(_0x4288ac){return function(_0x16ab73,_0x54b575,_0x318d49){SmsQueueEvents[_0xe32c('0x6')](_0x4288ac+':'+_0x16ab73['id'],_0x16ab73);SmsQueueEvents[_0xe32c('0x6')](_0x4288ac,_0x16ab73);_0x318d49(null);};}for(var e in events){if(events[_0xe32c('0x7')](e)){var event=events[e];SmsQueue[_0xe32c('0x8')](e,emitEvent(event));}}module[_0xe32c('0x9')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index bf9755c..059b283 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 _0xd279=['../../config/logger','api','bluebird','request-promise','path','rimraf','./smsQueue.attributes','exports','define','SmsQueue'];(function(_0xa23ec2,_0x4b353d){var _0x3cab51=function(_0x446a93){while(--_0x446a93){_0xa23ec2['push'](_0xa23ec2['shift']());}};_0x3cab51(++_0x4b353d);}(_0xd279,0x1ea));var _0x9d27=function(_0x5780e0,_0x30b719){_0x5780e0=_0x5780e0-0x0;var _0x63a817=_0xd279[_0x5780e0];return _0x63a817;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9d27('0x0'))(_0x9d27('0x1'));var moment=require('moment');var BPromise=require(_0x9d27('0x2'));var rp=require(_0x9d27('0x3'));var fs=require('fs');var path=require(_0x9d27('0x4'));var rimraf=require(_0x9d27('0x5'));var config=require('../../config/environment');var attributes=require(_0x9d27('0x6'));module[_0x9d27('0x7')]=function(_0x5421eb,_0x42f3f8){return _0x5421eb[_0x9d27('0x8')](_0x9d27('0x9'),attributes,{'tableName':'sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9cd7=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsQueue.attributes','exports','sms_queues','lodash','util','../../config/logger','api'];(function(_0x1c7de4,_0x5629c8){var _0x49e3d1=function(_0x31db26){while(--_0x31db26){_0x1c7de4['push'](_0x1c7de4['shift']());}};_0x49e3d1(++_0x5629c8);}(_0x9cd7,0x168));var _0x79cd=function(_0x3dfa3e,_0x293558){_0x3dfa3e=_0x3dfa3e-0x0;var _0x3ff9ed=_0x9cd7[_0x3dfa3e];return _0x3ff9ed;};'use strict';var _=require(_0x79cd('0x0'));var util=require(_0x79cd('0x1'));var logger=require(_0x79cd('0x2'))(_0x79cd('0x3'));var moment=require(_0x79cd('0x4'));var BPromise=require(_0x79cd('0x5'));var rp=require(_0x79cd('0x6'));var fs=require('fs');var path=require(_0x79cd('0x7'));var rimraf=require(_0x79cd('0x8'));var config=require(_0x79cd('0x9'));var attributes=require(_0x79cd('0xa'));module[_0x79cd('0xb')]=function(_0x1f1d22,_0x61302a){return _0x1f1d22['define']('SmsQueue',attributes,{'tableName':_0x79cd('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.rpc.js b/server/api/smsQueue/smsQueue.rpc.js index 11aef20..920a06a 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 _0x9fbe=['options','raw','attributes','limit','map','include','model','GetSmsQueue','ShowSmsQueue','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','socket.io-emitter','./smsQueue.socket','register','then','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','SmsQueue,\x20%s,\x20%s','message','info','result','catch','SmsQueue'];(function(_0x3005d5,_0xf588c7){var _0x547c7e=function(_0x4514dc){while(--_0x4514dc){_0x3005d5['push'](_0x3005d5['shift']());}};_0x547c7e(++_0xf588c7);}(_0x9fbe,0x171));var _0xe9fb=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0x9fbe[_0x13b8f3];return _0x1a6d06;};'use strict';var _=require(_0xe9fb('0x0'));var util=require(_0xe9fb('0x1'));var moment=require(_0xe9fb('0x2'));var BPromise=require('bluebird');var rs=require(_0xe9fb('0x3'));var fs=require('fs');var Redis=require(_0xe9fb('0x4'));var db=require(_0xe9fb('0x5'))['db'];var utils=require(_0xe9fb('0x6'));var logger=require(_0xe9fb('0x7'))(_0xe9fb('0x8'));var config=require('../../config/environment');var jayson=require(_0xe9fb('0x9'));var client=jayson[_0xe9fb('0xa')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0xe9fb('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xe9fb('0xc'))(new Redis(config[_0xe9fb('0xb')]));require(_0xe9fb('0xd'))[_0xe9fb('0xe')](socket);function respondWithRpcPromise(_0x477c59,_0x4ac98c,_0x3b2782){return new BPromise(function(_0x3d7d26,_0x49275c){return client['request'](_0x477c59,_0x3b2782)[_0xe9fb('0xf')](function(_0x4c9201){logger['info']('SmsQueue,\x20%s,\x20%s',_0x4ac98c,_0xe9fb('0x10'));logger[_0xe9fb('0x11')](_0xe9fb('0x12'),_0x4ac98c,'request\x20sent',JSON[_0xe9fb('0x13')](_0x4c9201));if(_0x4c9201[_0xe9fb('0x14')]){if(_0x4c9201[_0xe9fb('0x14')]['code']===0x1f4){logger[_0xe9fb('0x14')](_0xe9fb('0x15'),_0x4ac98c,_0x4c9201[_0xe9fb('0x14')]['message']);return _0x49275c(_0x4c9201[_0xe9fb('0x14')][_0xe9fb('0x16')]);}logger['error']('SmsQueue,\x20%s,\x20%s',_0x4ac98c,_0x4c9201[_0xe9fb('0x14')][_0xe9fb('0x16')]);return _0x3d7d26(_0x4c9201['error'][_0xe9fb('0x16')]);}else{logger[_0xe9fb('0x17')]('SmsQueue,\x20%s,\x20%s',_0x4ac98c,_0xe9fb('0x10'));_0x3d7d26(_0x4c9201[_0xe9fb('0x18')][_0xe9fb('0x16')]);}})[_0xe9fb('0x19')](function(_0x519301){logger[_0xe9fb('0x14')](_0xe9fb('0x15'),_0x4ac98c,_0x519301);_0x49275c(_0x519301);});});}exports['GetSmsQueue']=function(_0x33cd7d){var _0x2a5bb7=this;return new Promise(function(_0x1b682b,_0x2d562e){return db[_0xe9fb('0x1a')]['findAll']({'raw':_0x33cd7d[_0xe9fb('0x1b')]?_0x33cd7d['options'][_0xe9fb('0x1c')]===undefined?!![]:![]:!![],'where':_0x33cd7d[_0xe9fb('0x1b')]?_0x33cd7d[_0xe9fb('0x1b')]['where']||null:null,'attributes':_0x33cd7d[_0xe9fb('0x1b')]?_0x33cd7d[_0xe9fb('0x1b')][_0xe9fb('0x1d')]||null:null,'limit':_0x33cd7d[_0xe9fb('0x1b')]?_0x33cd7d[_0xe9fb('0x1b')][_0xe9fb('0x1e')]||null:null,'include':_0x33cd7d[_0xe9fb('0x1b')]?_0x33cd7d[_0xe9fb('0x1b')]['include']?_[_0xe9fb('0x1f')](_0x33cd7d[_0xe9fb('0x1b')][_0xe9fb('0x20')],function(_0x410eaa){return{'model':db[_0x410eaa[_0xe9fb('0x21')]],'as':_0x410eaa['as'],'attributes':_0x410eaa[_0xe9fb('0x1d')],'include':_0x410eaa[_0xe9fb('0x20')]?_[_0xe9fb('0x1f')](_0x410eaa[_0xe9fb('0x20')],function(_0x572570){return{'model':db[_0x572570[_0xe9fb('0x21')]],'as':_0x572570['as'],'attributes':_0x572570[_0xe9fb('0x1d')],'include':_0x572570['include']?_['map'](_0x572570[_0xe9fb('0x20')],function(_0x3e7d4c){return{'model':db[_0x3e7d4c['model']],'as':_0x3e7d4c['as'],'attributes':_0x3e7d4c[_0xe9fb('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xe9fb('0xf')](function(_0x5be78f){logger[_0xe9fb('0x17')](_0xe9fb('0x22'),_0x33cd7d);logger['debug']('GetSmsQueue',_0x33cd7d,JSON[_0xe9fb('0x13')](_0x5be78f));_0x1b682b(_0x5be78f);})[_0xe9fb('0x19')](function(_0x154473){logger[_0xe9fb('0x14')](_0xe9fb('0x22'),_0x154473['message'],_0x33cd7d);_0x2d562e(_0x2a5bb7[_0xe9fb('0x14')](0x1f4,_0x154473[_0xe9fb('0x16')]));});});};exports['ShowSmsQueue']=function(_0x54cb06){var _0x3878a8=this;return new Promise(function(_0x2cc5d5,_0x2f2e30){return db[_0xe9fb('0x1a')]['find']({'raw':_0x54cb06[_0xe9fb('0x1b')]?_0x54cb06[_0xe9fb('0x1b')][_0xe9fb('0x1c')]===undefined?!![]:![]:!![],'where':_0x54cb06[_0xe9fb('0x1b')]?_0x54cb06['options']['where']||null:null,'attributes':_0x54cb06[_0xe9fb('0x1b')]?_0x54cb06[_0xe9fb('0x1b')]['attributes']||null:null,'include':_0x54cb06[_0xe9fb('0x1b')]?_0x54cb06['options'][_0xe9fb('0x20')]?_['map'](_0x54cb06['options']['include'],function(_0x510dca){return{'model':db[_0x510dca[_0xe9fb('0x21')]],'as':_0x510dca['as'],'attributes':_0x510dca[_0xe9fb('0x1d')],'include':_0x510dca['include']?_[_0xe9fb('0x1f')](_0x510dca[_0xe9fb('0x20')],function(_0x23ac11){return{'model':db[_0x23ac11[_0xe9fb('0x21')]],'as':_0x23ac11['as'],'attributes':_0x23ac11[_0xe9fb('0x1d')],'include':_0x23ac11['include']?_['map'](_0x23ac11[_0xe9fb('0x20')],function(_0x23a666){return{'model':db[_0x23a666['model']],'as':_0x23a666['as'],'attributes':_0x23a666[_0xe9fb('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xe9fb('0xf')](function(_0x4f3172){logger['info']('ShowSmsQueue',_0x54cb06);logger[_0xe9fb('0x11')]('ShowSmsQueue',_0x54cb06,JSON[_0xe9fb('0x13')](_0x4f3172));_0x2cc5d5(_0x4f3172);})[_0xe9fb('0x19')](function(_0x114ff2){logger[_0xe9fb('0x14')](_0xe9fb('0x23'),_0x114ff2[_0xe9fb('0x16')],_0x54cb06);_0x2f2e30(_0x3878a8[_0xe9fb('0x14')](0x1f4,_0x114ff2[_0xe9fb('0x16')]));});});}; \ No newline at end of file +var _0x14fb=['SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetSmsQueue','SmsQueue','findAll','options','raw','where','attributes','limit','include','map','model','ShowSmsQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x195024,_0x1401f2){var _0x352ef7=function(_0x36bc16){while(--_0x36bc16){_0x195024['push'](_0x195024['shift']());}};_0x352ef7(++_0x1401f2);}(_0x14fb,0x91));var _0xb14f=function(_0xd7d31d,_0xdc9735){_0xd7d31d=_0xd7d31d-0x0;var _0x1a54f=_0x14fb[_0xd7d31d];return _0x1a54f;};'use strict';var _=require(_0xb14f('0x0'));var util=require(_0xb14f('0x1'));var moment=require(_0xb14f('0x2'));var BPromise=require(_0xb14f('0x3'));var rs=require(_0xb14f('0x4'));var fs=require('fs');var Redis=require(_0xb14f('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb14f('0x6'));var logger=require(_0xb14f('0x7'))(_0xb14f('0x8'));var config=require(_0xb14f('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xb14f('0xa')][_0xb14f('0xb')]({'port':0x232a});config[_0xb14f('0xc')]=_[_0xb14f('0xd')](config[_0xb14f('0xc')],{'host':_0xb14f('0xe'),'port':0x18eb});var socket=require(_0xb14f('0xf'))(new Redis(config[_0xb14f('0xc')]));require('./smsQueue.socket')[_0xb14f('0x10')](socket);function respondWithRpcPromise(_0xfc598e,_0x579387,_0x2cb4f9){return new BPromise(function(_0x238073,_0x533367){return client[_0xb14f('0x11')](_0xfc598e,_0x2cb4f9)[_0xb14f('0x12')](function(_0x3908d4){logger[_0xb14f('0x13')](_0xb14f('0x14'),_0x579387,_0xb14f('0x15'));logger[_0xb14f('0x16')](_0xb14f('0x17'),_0x579387,_0xb14f('0x15'),JSON[_0xb14f('0x18')](_0x3908d4));if(_0x3908d4['error']){if(_0x3908d4[_0xb14f('0x19')][_0xb14f('0x1a')]===0x1f4){logger[_0xb14f('0x19')](_0xb14f('0x14'),_0x579387,_0x3908d4['error']['message']);return _0x533367(_0x3908d4['error'][_0xb14f('0x1b')]);}logger[_0xb14f('0x19')]('SmsQueue,\x20%s,\x20%s',_0x579387,_0x3908d4['error'][_0xb14f('0x1b')]);return _0x238073(_0x3908d4[_0xb14f('0x19')][_0xb14f('0x1b')]);}else{logger['info'](_0xb14f('0x14'),_0x579387,_0xb14f('0x15'));_0x238073(_0x3908d4[_0xb14f('0x1c')]['message']);}})[_0xb14f('0x1d')](function(_0x2a1f8c){logger[_0xb14f('0x19')](_0xb14f('0x14'),_0x579387,_0x2a1f8c);_0x533367(_0x2a1f8c);});});}exports[_0xb14f('0x1e')]=function(_0x5e56e8){var _0x13f436=this;return new Promise(function(_0x1e60d4,_0x451ea3){return db[_0xb14f('0x1f')][_0xb14f('0x20')]({'raw':_0x5e56e8[_0xb14f('0x21')]?_0x5e56e8[_0xb14f('0x21')][_0xb14f('0x22')]===undefined?!![]:![]:!![],'where':_0x5e56e8['options']?_0x5e56e8[_0xb14f('0x21')][_0xb14f('0x23')]||null:null,'attributes':_0x5e56e8[_0xb14f('0x21')]?_0x5e56e8[_0xb14f('0x21')][_0xb14f('0x24')]||null:null,'limit':_0x5e56e8[_0xb14f('0x21')]?_0x5e56e8[_0xb14f('0x21')][_0xb14f('0x25')]||null:null,'include':_0x5e56e8['options']?_0x5e56e8[_0xb14f('0x21')][_0xb14f('0x26')]?_[_0xb14f('0x27')](_0x5e56e8[_0xb14f('0x21')][_0xb14f('0x26')],function(_0x51f1ea){return{'model':db[_0x51f1ea[_0xb14f('0x28')]],'as':_0x51f1ea['as'],'attributes':_0x51f1ea[_0xb14f('0x24')],'include':_0x51f1ea[_0xb14f('0x26')]?_[_0xb14f('0x27')](_0x51f1ea[_0xb14f('0x26')],function(_0x277022){return{'model':db[_0x277022[_0xb14f('0x28')]],'as':_0x277022['as'],'attributes':_0x277022['attributes'],'include':_0x277022[_0xb14f('0x26')]?_['map'](_0x277022[_0xb14f('0x26')],function(_0x2b7bbf){return{'model':db[_0x2b7bbf[_0xb14f('0x28')]],'as':_0x2b7bbf['as'],'attributes':_0x2b7bbf[_0xb14f('0x24')]};}):[]};}):[]};}):[]:[]})[_0xb14f('0x12')](function(_0x51b2ba){logger[_0xb14f('0x13')](_0xb14f('0x1e'),_0x5e56e8);logger[_0xb14f('0x16')](_0xb14f('0x1e'),_0x5e56e8,JSON[_0xb14f('0x18')](_0x51b2ba));_0x1e60d4(_0x51b2ba);})[_0xb14f('0x1d')](function(_0x52a18a){logger['error'](_0xb14f('0x1e'),_0x52a18a[_0xb14f('0x1b')],_0x5e56e8);_0x451ea3(_0x13f436[_0xb14f('0x19')](0x1f4,_0x52a18a[_0xb14f('0x1b')]));});});};exports['ShowSmsQueue']=function(_0x53dec1){var _0x6b5637=this;return new Promise(function(_0x457cbf,_0x56c5e8){return db['SmsQueue']['find']({'raw':_0x53dec1[_0xb14f('0x21')]?_0x53dec1[_0xb14f('0x21')][_0xb14f('0x22')]===undefined?!![]:![]:!![],'where':_0x53dec1['options']?_0x53dec1[_0xb14f('0x21')][_0xb14f('0x23')]||null:null,'attributes':_0x53dec1[_0xb14f('0x21')]?_0x53dec1['options']['attributes']||null:null,'include':_0x53dec1[_0xb14f('0x21')]?_0x53dec1['options'][_0xb14f('0x26')]?_['map'](_0x53dec1['options'][_0xb14f('0x26')],function(_0x15d9ee){return{'model':db[_0x15d9ee[_0xb14f('0x28')]],'as':_0x15d9ee['as'],'attributes':_0x15d9ee[_0xb14f('0x24')],'include':_0x15d9ee[_0xb14f('0x26')]?_[_0xb14f('0x27')](_0x15d9ee[_0xb14f('0x26')],function(_0x8ead01){return{'model':db[_0x8ead01[_0xb14f('0x28')]],'as':_0x8ead01['as'],'attributes':_0x8ead01['attributes'],'include':_0x8ead01[_0xb14f('0x26')]?_[_0xb14f('0x27')](_0x8ead01['include'],function(_0x5e847a){return{'model':db[_0x5e847a['model']],'as':_0x5e847a['as'],'attributes':_0x5e847a[_0xb14f('0x24')]};}):[]};}):[]};}):[]:[]})[_0xb14f('0x12')](function(_0xebe515){logger['info']('ShowSmsQueue',_0x53dec1);logger[_0xb14f('0x16')](_0xb14f('0x29'),_0x53dec1,JSON['stringify'](_0xebe515));_0x457cbf(_0xebe515);})[_0xb14f('0x1d')](function(_0x598c39){logger[_0xb14f('0x19')](_0xb14f('0x29'),_0x598c39[_0xb14f('0x1b')],_0x53dec1);_0x56c5e8(_0x6b5637[_0xb14f('0x19')](0x1f4,_0x598c39['message']));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 38b0a64..22efbd1 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 _0xd684=['emit','smsQueue:','./smsQueue.events','save','remove','update'];(function(_0x5ea5c4,_0x19bd85){var _0x56367a=function(_0x322de9){while(--_0x322de9){_0x5ea5c4['push'](_0x5ea5c4['shift']());}};_0x56367a(++_0x19bd85);}(_0xd684,0x110));var _0x4d68=function(_0x2b3c9d,_0x1c8c0c){_0x2b3c9d=_0x2b3c9d-0x0;var _0x4b8037=_0xd684[_0x2b3c9d];return _0x4b8037;};'use strict';var SmsQueueEvents=require(_0x4d68('0x0'));var events=[_0x4d68('0x1'),_0x4d68('0x2'),_0x4d68('0x3')];function createListener(_0x4ed8d3,_0x46aedd){return function(_0x438581){_0x46aedd[_0x4d68('0x4')](_0x4ed8d3,_0x438581);};}function removeListener(_0x5bc4c6,_0x2bd154){return function(){SmsQueueEvents['removeListener'](_0x5bc4c6,_0x2bd154);};}exports['register']=function(_0x27f4bd){for(var _0x232602=0x0,_0x5c7c3d=events['length'];_0x232602<_0x5c7c3d;_0x232602++){var _0x1af82e=events[_0x232602];var _0x43105b=createListener(_0x4d68('0x5')+_0x1af82e,_0x27f4bd);SmsQueueEvents['on'](_0x1af82e,_0x43105b);}}; \ No newline at end of file +var _0xd5df=['save','remove','update','emit','register','length'];(function(_0x547f2f,_0x42b2c2){var _0x5ea1f5=function(_0x5516ab){while(--_0x5516ab){_0x547f2f['push'](_0x547f2f['shift']());}};_0x5ea1f5(++_0x42b2c2);}(_0xd5df,0x16e));var _0xfd5d=function(_0x1c9f1e,_0x1fbc36){_0x1c9f1e=_0x1c9f1e-0x0;var _0x18ebcc=_0xd5df[_0x1c9f1e];return _0x18ebcc;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=[_0xfd5d('0x0'),_0xfd5d('0x1'),_0xfd5d('0x2')];function createListener(_0x1c22fd,_0x8ecfb1){return function(_0x6d3a0b){_0x8ecfb1[_0xfd5d('0x3')](_0x1c22fd,_0x6d3a0b);};}function removeListener(_0x52e923,_0x356d94){return function(){SmsQueueEvents['removeListener'](_0x52e923,_0x356d94);};}exports[_0xfd5d('0x4')]=function(_0x1168aa){for(var _0x391eaf=0x0,_0x28b8b3=events[_0xfd5d('0x5')];_0x391eaf<_0x28b8b3;_0x391eaf++){var _0x18a325=events[_0x391eaf];var _0x3ff71d=createListener('smsQueue:'+_0x18a325,_0x1168aa);SmsQueueEvents['on'](_0x18a325,_0x3ff71d);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index ad60b49..26c76b1 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 _0xce2a=['/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated'];(function(_0x316365,_0x17aeb5){var _0x16e2b3=function(_0x3c0483){while(--_0x3c0483){_0x316365['push'](_0x316365['shift']());}};_0x16e2b3(++_0x17aeb5);}(_0xce2a,0xd3));var _0xace2=function(_0x2bc4d0,_0x586504){_0x2bc4d0=_0x2bc4d0-0x0;var _0x206a3a=_0xce2a[_0x2bc4d0];return _0x206a3a;};'use strict';var multer=require('multer');var util=require(_0xace2('0x0'));var path=require(_0xace2('0x1'));var timeout=require(_0xace2('0x2'));var express=require('express');var router=express[_0xace2('0x3')]();var fs_extra=require(_0xace2('0x4'));var auth=require(_0xace2('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xace2('0x6'));var controller=require('./smsQueueReport.controller');router[_0xace2('0x7')]('/',auth[_0xace2('0x8')](),controller['index']);router['get'](_0xace2('0x9'),auth[_0xace2('0x8')](),controller[_0xace2('0xa')]);router[_0xace2('0x7')](_0xace2('0xb'),auth['isAuthenticated'](),controller[_0xace2('0xc')]);router[_0xace2('0xd')]('/',auth['isAuthenticated'](),controller[_0xace2('0xe')]);router[_0xace2('0xf')](_0xace2('0xb'),auth[_0xace2('0x8')](),controller[_0xace2('0x10')]);router[_0xace2('0x11')](_0xace2('0xb'),auth[_0xace2('0x8')](),controller[_0xace2('0x12')]);module[_0xace2('0x13')]=router; \ No newline at end of file +var _0xf2fc=['/describe','describe','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsQueueReport.controller','get'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xf2fc,0x15c));var _0xcf2f=function(_0x5e02cf,_0x118c03){_0x5e02cf=_0x5e02cf-0x0;var _0x1beca5=_0xf2fc[_0x5e02cf];return _0x1beca5;};'use strict';var multer=require(_0xcf2f('0x0'));var util=require(_0xcf2f('0x1'));var path=require(_0xcf2f('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xcf2f('0x3')]();var fs_extra=require(_0xcf2f('0x4'));var auth=require(_0xcf2f('0x5'));var interaction=require(_0xcf2f('0x6'));var config=require('../../config/environment');var controller=require(_0xcf2f('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xcf2f('0x8')](_0xcf2f('0x9'),auth['isAuthenticated'](),controller[_0xcf2f('0xa')]);router[_0xcf2f('0x8')](_0xcf2f('0xb'),auth[_0xcf2f('0xc')](),controller[_0xcf2f('0xd')]);router[_0xcf2f('0xe')]('/',auth['isAuthenticated'](),controller[_0xcf2f('0xf')]);router[_0xcf2f('0x10')](_0xcf2f('0xb'),auth[_0xcf2f('0xc')](),controller[_0xcf2f('0x11')]);router[_0xcf2f('0x12')](_0xcf2f('0xb'),auth['isAuthenticated'](),controller[_0xcf2f('0x13')]);module[_0xcf2f('0x14')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index cbee89e..e471b8b 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 _0x5c17=['STRING','DATE','moment','sequelize'];(function(_0x557810,_0xcf73be){var _0x3e2bad=function(_0x29db02){while(--_0x29db02){_0x557810['push'](_0x557810['shift']());}};_0x3e2bad(++_0xcf73be);}(_0x5c17,0x1ba));var _0x75c1=function(_0x3e0d86,_0x9d679c){_0x3e0d86=_0x3e0d86-0x0;var _0x1c9bae=_0x5c17[_0x3e0d86];return _0x1c9bae;};'use strict';var moment=require(_0x75c1('0x0'));var Sequelize=require(_0x75c1('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x75c1('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x75c1('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x75c1('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x75c1('0x3')]},'reason':{'type':Sequelize[_0x75c1('0x2')]}}; \ No newline at end of file +var _0x41ed=['STRING','DATE','moment','exports'];(function(_0x263664,_0x4779c9){var _0x44e79a=function(_0x456ff5){while(--_0x456ff5){_0x263664['push'](_0x263664['shift']());}};_0x44e79a(++_0x4779c9);}(_0x41ed,0xa6));var _0xd41e=function(_0x39561b,_0x4b88fe){_0x39561b=_0x39561b-0x0;var _0x576767=_0x41ed[_0x39561b];return _0x576767;};'use strict';var moment=require(_0xd41e('0x0'));var Sequelize=require('sequelize');module[_0xd41e('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xd41e('0x2')]},'joinAt':{'type':Sequelize[_0xd41e('0x3')]},'leaveAt':{'type':Sequelize[_0xd41e('0x3')]},'acceptAt':{'type':Sequelize[_0xd41e('0x3')]},'exitAt':{'type':Sequelize[_0xd41e('0x3')]},'reason':{'type':Sequelize[_0xd41e('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 9e329f8..6cceee6 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 _0x6464=['key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','where','pick','filter','VIRTUAL','merge','options','include','findAll','rows','catch','params','create','body','find','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','apply','reject','update','then','sendStatus','error','name','send','map','SmsQueueReport','rawAttributes','fieldName','type'];(function(_0x57add2,_0x4f2b7d){var _0x4e3670=function(_0x3311b){while(--_0x3311b){_0x57add2['push'](_0x57add2['shift']());}};_0x4e3670(++_0x4f2b7d);}(_0x6464,0x1ef));var _0x4646=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x6464[_0x2641f9];return _0x585741;};'use strict';var emlformat=require(_0x4646('0x0'));var rimraf=require(_0x4646('0x1'));var zipdir=require(_0x4646('0x2'));var jsonpatch=require(_0x4646('0x3'));var rp=require(_0x4646('0x4'));var moment=require('moment');var BPromise=require(_0x4646('0x5'));var Mustache=require('mustache');var util=require(_0x4646('0x6'));var path=require(_0x4646('0x7'));var sox=require(_0x4646('0x8'));var csv=require(_0x4646('0x9'));var ejs=require(_0x4646('0xa'));var fs=require('fs');var fs_extra=require(_0x4646('0xb'));var _=require(_0x4646('0xc'));var squel=require(_0x4646('0xd'));var crypto=require(_0x4646('0xe'));var jsforce=require(_0x4646('0xf'));var deskjs=require(_0x4646('0x10'));var toCsv=require(_0x4646('0x9'));var querystring=require(_0x4646('0x11'));var Papa=require(_0x4646('0x12'));var Redis=require(_0x4646('0x13'));var authService=require(_0x4646('0x14'));var qs=require(_0x4646('0x15'));var as=require(_0x4646('0x16'));var hardwareService=require(_0x4646('0x17'));var logger=require(_0x4646('0x18'))(_0x4646('0x19'));var utils=require(_0x4646('0x1a'));var config=require(_0x4646('0x1b'));var licenseUtil=require(_0x4646('0x1c'));var db=require(_0x4646('0x1d'))['db'];function respondWithStatusCode(_0x3756c6,_0x4488ee){_0x4488ee=_0x4488ee||0xcc;return function(_0xfb75e1){if(_0xfb75e1){return _0x3756c6['sendStatus'](_0x4488ee);}return _0x3756c6[_0x4646('0x1e')](_0x4488ee)[_0x4646('0x1f')]();};}function respondWithResult(_0x5e460a,_0x1ff61e){_0x1ff61e=_0x1ff61e||0xc8;return function(_0x1d6510){if(_0x1d6510){return _0x5e460a[_0x4646('0x1e')](_0x1ff61e)[_0x4646('0x20')](_0x1d6510);}};}function respondWithFilteredResult(_0x5229e5,_0x71a53f){return function(_0x445c8b){if(_0x445c8b){var _0xfb3c36=typeof _0x71a53f[_0x4646('0x21')]==='undefined'&&typeof _0x71a53f['limit']===_0x4646('0x22');var _0x3e6e6b=_0x445c8b[_0x4646('0x23')];var _0x2b07a4=_0xfb3c36?0x0:_0x71a53f[_0x4646('0x21')];var _0x9681ef=_0xfb3c36?_0x445c8b[_0x4646('0x23')]:_0x71a53f[_0x4646('0x21')]+_0x71a53f[_0x4646('0x24')];var _0x1a6084;if(_0x9681ef>=_0x3e6e6b){_0x9681ef=_0x3e6e6b;_0x1a6084=0xc8;}else{_0x1a6084=0xce;}_0x5229e5[_0x4646('0x1e')](_0x1a6084);return _0x5229e5[_0x4646('0x25')]('Content-Range',_0x2b07a4+'-'+_0x9681ef+'/'+_0x3e6e6b)['json'](_0x445c8b);}return null;};}function patchUpdates(_0x183a5f){return function(_0x240369){try{jsonpatch[_0x4646('0x26')](_0x240369,_0x183a5f,!![]);}catch(_0x5c9bcc){return BPromise[_0x4646('0x27')](_0x5c9bcc);}return _0x240369['save']();};}function saveUpdates(_0x2bde80,_0x1ea1e6){return function(_0x4747be){if(_0x4747be){return _0x4747be[_0x4646('0x28')](_0x2bde80)[_0x4646('0x29')](function(_0x4f440d){return _0x4f440d;});}return null;};}function removeEntity(_0x171361,_0x6b6b05){return function(_0x3eb1de){if(_0x3eb1de){return _0x3eb1de['destroy']()['then'](function(){_0x171361[_0x4646('0x1e')](0xcc)[_0x4646('0x1f')]();});}};}function handleEntityNotFound(_0x2f1923,_0x2a9116){return function(_0x129166){if(!_0x129166){_0x2f1923[_0x4646('0x2a')](0x194);}return _0x129166;};}function handleError(_0x52d9ba,_0x79fdb9){_0x79fdb9=_0x79fdb9||0x1f4;return function(_0x12b43e){logger[_0x4646('0x2b')](_0x12b43e['stack']);if(_0x12b43e['name']){delete _0x12b43e[_0x4646('0x2c')];}_0x52d9ba[_0x4646('0x1e')](_0x79fdb9)[_0x4646('0x2d')](_0x12b43e);};}exports['index']=function(_0x24d6a5,_0x39a351){var _0x1c7494={},_0x35b450={},_0x59c0ab={'count':0x0,'rows':[]};var _0x13a92a=_[_0x4646('0x2e')](db[_0x4646('0x2f')][_0x4646('0x30')],function(_0x394d02){return{'name':_0x394d02[_0x4646('0x31')],'type':_0x394d02[_0x4646('0x32')][_0x4646('0x33')]};});_0x35b450[_0x4646('0x34')]=_['map'](_0x13a92a,_0x4646('0x2c'));_0x35b450[_0x4646('0x35')]=_[_0x4646('0x36')](_0x24d6a5[_0x4646('0x35')]);_0x35b450[_0x4646('0x37')]=_[_0x4646('0x38')](_0x35b450['model'],_0x35b450[_0x4646('0x35')]);_0x1c7494[_0x4646('0x39')]=_[_0x4646('0x38')](_0x35b450['model'],qs[_0x4646('0x3a')](_0x24d6a5[_0x4646('0x35')]['fields']));_0x1c7494[_0x4646('0x39')]=_0x1c7494[_0x4646('0x39')][_0x4646('0x3b')]?_0x1c7494['attributes']:_0x35b450['model'];if(!_0x24d6a5[_0x4646('0x35')][_0x4646('0x3c')]('nolimit')){_0x1c7494[_0x4646('0x24')]=qs[_0x4646('0x24')](_0x24d6a5[_0x4646('0x35')][_0x4646('0x24')]);_0x1c7494[_0x4646('0x21')]=qs[_0x4646('0x21')](_0x24d6a5[_0x4646('0x35')]['offset']);}_0x1c7494[_0x4646('0x3d')]=qs['sort'](_0x24d6a5[_0x4646('0x35')]['sort']);_0x1c7494[_0x4646('0x3e')]=qs['filters'](_[_0x4646('0x3f')](_0x24d6a5['query'],_0x35b450[_0x4646('0x37')]),_0x13a92a);if(_0x24d6a5['query'][_0x4646('0x40')]){_0x1c7494[_0x4646('0x3e')]=_['merge'](_0x1c7494[_0x4646('0x3e')],{'$or':_['map'](_0x13a92a,function(_0x22647a){if(_0x22647a[_0x4646('0x32')]!==_0x4646('0x41')){var _0x259194={};_0x259194[_0x22647a[_0x4646('0x2c')]]={'$like':'%'+_0x24d6a5[_0x4646('0x35')][_0x4646('0x40')]+'%'};return _0x259194;}})});}_0x1c7494=_[_0x4646('0x42')]({},_0x1c7494,_0x24d6a5[_0x4646('0x43')]);var _0x521a82={'where':_0x1c7494[_0x4646('0x3e')]};return db[_0x4646('0x2f')][_0x4646('0x23')](_0x521a82)[_0x4646('0x29')](function(_0x349c1f){_0x59c0ab[_0x4646('0x23')]=_0x349c1f;if(_0x24d6a5[_0x4646('0x35')]['includeAll']){_0x1c7494[_0x4646('0x44')]=[{'all':!![]}];}return db[_0x4646('0x2f')][_0x4646('0x45')](_0x1c7494);})['then'](function(_0x3350e6){_0x59c0ab[_0x4646('0x46')]=_0x3350e6;return _0x59c0ab;})[_0x4646('0x29')](respondWithFilteredResult(_0x39a351,_0x1c7494))[_0x4646('0x47')](handleError(_0x39a351,null));};exports['show']=function(_0x3bff58,_0x3674d8){var _0xb5db46={'raw':!![],'where':{'id':_0x3bff58[_0x4646('0x48')]['id']}},_0x33bc8d={};_0x33bc8d[_0x4646('0x34')]=_['keys'](db['SmsQueueReport']['rawAttributes']);_0x33bc8d[_0x4646('0x35')]=_[_0x4646('0x36')](_0x3bff58[_0x4646('0x35')]);_0x33bc8d['filters']=_[_0x4646('0x38')](_0x33bc8d[_0x4646('0x34')],_0x33bc8d[_0x4646('0x35')]);_0xb5db46['attributes']=_[_0x4646('0x38')](_0x33bc8d[_0x4646('0x34')],qs[_0x4646('0x3a')](_0x3bff58[_0x4646('0x35')][_0x4646('0x3a')]));_0xb5db46[_0x4646('0x39')]=_0xb5db46[_0x4646('0x39')][_0x4646('0x3b')]?_0xb5db46['attributes']:_0x33bc8d[_0x4646('0x34')];if(_0x3bff58[_0x4646('0x35')]['includeAll']){_0xb5db46[_0x4646('0x44')]=[{'all':!![]}];}_0xb5db46=_['merge']({},_0xb5db46,_0x3bff58[_0x4646('0x43')]);return db[_0x4646('0x2f')]['find'](_0xb5db46)[_0x4646('0x29')](handleEntityNotFound(_0x3674d8,null))['then'](respondWithResult(_0x3674d8,null))[_0x4646('0x47')](handleError(_0x3674d8,null));};exports[_0x4646('0x49')]=function(_0x7dff5e,_0x3c8fa0){return db[_0x4646('0x2f')]['create'](_0x7dff5e['body'],{})[_0x4646('0x29')](respondWithResult(_0x3c8fa0,0xc9))[_0x4646('0x47')](handleError(_0x3c8fa0,null));};exports['update']=function(_0x1ed584,_0x3bd88e){if(_0x1ed584[_0x4646('0x4a')]['id']){delete _0x1ed584[_0x4646('0x4a')]['id'];}return db[_0x4646('0x2f')][_0x4646('0x4b')]({'where':{'id':_0x1ed584[_0x4646('0x48')]['id']}})['then'](handleEntityNotFound(_0x3bd88e,null))[_0x4646('0x29')](saveUpdates(_0x1ed584[_0x4646('0x4a')],null))[_0x4646('0x29')](respondWithResult(_0x3bd88e,null))[_0x4646('0x47')](handleError(_0x3bd88e,null));};exports[_0x4646('0x4c')]=function(_0x33bb4e,_0x2dd8df){return db['SmsQueueReport'][_0x4646('0x4b')]({'where':{'id':_0x33bb4e[_0x4646('0x48')]['id']}})['then'](handleEntityNotFound(_0x2dd8df,null))[_0x4646('0x29')](removeEntity(_0x2dd8df,null))['catch'](handleError(_0x2dd8df,null));};exports[_0x4646('0x4d')]=function(_0x357faf,_0x2f7953){return db['SmsQueueReport'][_0x4646('0x4d')]()[_0x4646('0x29')](respondWithResult(_0x2f7953,null))[_0x4646('0x47')](handleError(_0x2f7953,null));}; \ No newline at end of file +var _0xc105=['include','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','SmsQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','length','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','findAll','catch','show','fields'];(function(_0x120123,_0x4eff59){var _0x3bec4c=function(_0x182818){while(--_0x182818){_0x120123['push'](_0x120123['shift']());}};_0x3bec4c(++_0x4eff59);}(_0xc105,0x1d4));var _0x5c10=function(_0x372a57,_0x9aa407){_0x372a57=_0x372a57-0x0;var _0x358f6d=_0xc105[_0x372a57];return _0x358f6d;};'use strict';var emlformat=require(_0x5c10('0x0'));var rimraf=require(_0x5c10('0x1'));var zipdir=require(_0x5c10('0x2'));var jsonpatch=require(_0x5c10('0x3'));var rp=require(_0x5c10('0x4'));var moment=require(_0x5c10('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x5c10('0x6'));var util=require(_0x5c10('0x7'));var path=require('path');var sox=require(_0x5c10('0x8'));var csv=require(_0x5c10('0x9'));var ejs=require(_0x5c10('0xa'));var fs=require('fs');var fs_extra=require(_0x5c10('0xb'));var _=require(_0x5c10('0xc'));var squel=require(_0x5c10('0xd'));var crypto=require('crypto');var jsforce=require(_0x5c10('0xe'));var deskjs=require(_0x5c10('0xf'));var toCsv=require(_0x5c10('0x9'));var querystring=require(_0x5c10('0x10'));var Papa=require(_0x5c10('0x11'));var Redis=require(_0x5c10('0x12'));var authService=require(_0x5c10('0x13'));var qs=require(_0x5c10('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5c10('0x15'));var utils=require('../../config/utils');var config=require(_0x5c10('0x16'));var licenseUtil=require(_0x5c10('0x17'));var db=require(_0x5c10('0x18'))['db'];function respondWithStatusCode(_0x360268,_0x1b1470){_0x1b1470=_0x1b1470||0xcc;return function(_0x9d7aa9){if(_0x9d7aa9){return _0x360268['sendStatus'](_0x1b1470);}return _0x360268[_0x5c10('0x19')](_0x1b1470)[_0x5c10('0x1a')]();};}function respondWithResult(_0x57ef36,_0x2a7602){_0x2a7602=_0x2a7602||0xc8;return function(_0x3bf9ed){if(_0x3bf9ed){return _0x57ef36[_0x5c10('0x19')](_0x2a7602)[_0x5c10('0x1b')](_0x3bf9ed);}};}function respondWithFilteredResult(_0x176724,_0x27fadd){return function(_0x1241c7){if(_0x1241c7){var _0x2a4f2c=typeof _0x27fadd[_0x5c10('0x1c')]==='undefined'&&typeof _0x27fadd[_0x5c10('0x1d')]===_0x5c10('0x1e');var _0x3a2625=_0x1241c7['count'];var _0xb4e162=_0x2a4f2c?0x0:_0x27fadd['offset'];var _0x18c5bd=_0x2a4f2c?_0x1241c7[_0x5c10('0x1f')]:_0x27fadd[_0x5c10('0x1c')]+_0x27fadd[_0x5c10('0x1d')];var _0x490eaa;if(_0x18c5bd>=_0x3a2625){_0x18c5bd=_0x3a2625;_0x490eaa=0xc8;}else{_0x490eaa=0xce;}_0x176724[_0x5c10('0x19')](_0x490eaa);return _0x176724[_0x5c10('0x20')](_0x5c10('0x21'),_0xb4e162+'-'+_0x18c5bd+'/'+_0x3a2625)['json'](_0x1241c7);}return null;};}function patchUpdates(_0x2761ad){return function(_0x7aff15){try{jsonpatch[_0x5c10('0x22')](_0x7aff15,_0x2761ad,!![]);}catch(_0x5582fa){return BPromise['reject'](_0x5582fa);}return _0x7aff15[_0x5c10('0x23')]();};}function saveUpdates(_0x48eb94,_0xce3cfb){return function(_0x102db3){if(_0x102db3){return _0x102db3[_0x5c10('0x24')](_0x48eb94)[_0x5c10('0x25')](function(_0xb1c660){return _0xb1c660;});}return null;};}function removeEntity(_0x3f6bc4,_0x4a4f3f){return function(_0x493b26){if(_0x493b26){return _0x493b26[_0x5c10('0x26')]()[_0x5c10('0x25')](function(){_0x3f6bc4[_0x5c10('0x19')](0xcc)[_0x5c10('0x1a')]();});}};}function handleEntityNotFound(_0x49a2f9,_0x2c8f56){return function(_0xde14bd){if(!_0xde14bd){_0x49a2f9[_0x5c10('0x27')](0x194);}return _0xde14bd;};}function handleError(_0x25831d,_0x4810e4){_0x4810e4=_0x4810e4||0x1f4;return function(_0x57514f){logger[_0x5c10('0x28')](_0x57514f[_0x5c10('0x29')]);if(_0x57514f[_0x5c10('0x2a')]){delete _0x57514f[_0x5c10('0x2a')];}_0x25831d[_0x5c10('0x19')](_0x4810e4)[_0x5c10('0x2b')](_0x57514f);};}exports[_0x5c10('0x2c')]=function(_0x1e80fc,_0x4d13fa){var _0x1a4435={},_0x7724a2={},_0x34ad51={'count':0x0,'rows':[]};var _0x468db7=_[_0x5c10('0x2d')](db[_0x5c10('0x2e')][_0x5c10('0x2f')],function(_0x4e0104){return{'name':_0x4e0104[_0x5c10('0x30')],'type':_0x4e0104[_0x5c10('0x31')][_0x5c10('0x32')]};});_0x7724a2[_0x5c10('0x33')]=_[_0x5c10('0x2d')](_0x468db7,_0x5c10('0x2a'));_0x7724a2[_0x5c10('0x34')]=_[_0x5c10('0x35')](_0x1e80fc[_0x5c10('0x34')]);_0x7724a2[_0x5c10('0x36')]=_['intersection'](_0x7724a2[_0x5c10('0x33')],_0x7724a2['query']);_0x1a4435[_0x5c10('0x37')]=_[_0x5c10('0x38')](_0x7724a2['model'],qs['fields'](_0x1e80fc['query']['fields']));_0x1a4435[_0x5c10('0x37')]=_0x1a4435[_0x5c10('0x37')][_0x5c10('0x39')]?_0x1a4435['attributes']:_0x7724a2[_0x5c10('0x33')];if(!_0x1e80fc[_0x5c10('0x34')]['hasOwnProperty']('nolimit')){_0x1a4435[_0x5c10('0x1d')]=qs['limit'](_0x1e80fc['query']['limit']);_0x1a4435[_0x5c10('0x1c')]=qs[_0x5c10('0x1c')](_0x1e80fc[_0x5c10('0x34')][_0x5c10('0x1c')]);}_0x1a4435[_0x5c10('0x3a')]=qs[_0x5c10('0x3b')](_0x1e80fc[_0x5c10('0x34')][_0x5c10('0x3b')]);_0x1a4435['where']=qs['filters'](_[_0x5c10('0x3c')](_0x1e80fc['query'],_0x7724a2[_0x5c10('0x36')]),_0x468db7);if(_0x1e80fc[_0x5c10('0x34')][_0x5c10('0x3d')]){_0x1a4435['where']=_['merge'](_0x1a4435[_0x5c10('0x3e')],{'$or':_[_0x5c10('0x2d')](_0x468db7,function(_0x57384b){if(_0x57384b[_0x5c10('0x31')]!==_0x5c10('0x3f')){var _0x41e84c={};_0x41e84c[_0x57384b[_0x5c10('0x2a')]]={'$like':'%'+_0x1e80fc[_0x5c10('0x34')][_0x5c10('0x3d')]+'%'};return _0x41e84c;}})});}_0x1a4435=_[_0x5c10('0x40')]({},_0x1a4435,_0x1e80fc[_0x5c10('0x41')]);var _0x14d292={'where':_0x1a4435[_0x5c10('0x3e')]};return db[_0x5c10('0x2e')][_0x5c10('0x1f')](_0x14d292)[_0x5c10('0x25')](function(_0x42f964){_0x34ad51[_0x5c10('0x1f')]=_0x42f964;if(_0x1e80fc[_0x5c10('0x34')][_0x5c10('0x42')]){_0x1a4435['include']=[{'all':!![]}];}return db[_0x5c10('0x2e')][_0x5c10('0x43')](_0x1a4435);})[_0x5c10('0x25')](function(_0x583861){_0x34ad51['rows']=_0x583861;return _0x34ad51;})[_0x5c10('0x25')](respondWithFilteredResult(_0x4d13fa,_0x1a4435))[_0x5c10('0x44')](handleError(_0x4d13fa,null));};exports[_0x5c10('0x45')]=function(_0x4be469,_0xc7979c){var _0x2119f5={'raw':!![],'where':{'id':_0x4be469['params']['id']}},_0xff9613={};_0xff9613[_0x5c10('0x33')]=_['keys'](db[_0x5c10('0x2e')][_0x5c10('0x2f')]);_0xff9613[_0x5c10('0x34')]=_[_0x5c10('0x35')](_0x4be469[_0x5c10('0x34')]);_0xff9613[_0x5c10('0x36')]=_[_0x5c10('0x38')](_0xff9613[_0x5c10('0x33')],_0xff9613['query']);_0x2119f5[_0x5c10('0x37')]=_['intersection'](_0xff9613[_0x5c10('0x33')],qs[_0x5c10('0x46')](_0x4be469[_0x5c10('0x34')][_0x5c10('0x46')]));_0x2119f5[_0x5c10('0x37')]=_0x2119f5[_0x5c10('0x37')]['length']?_0x2119f5[_0x5c10('0x37')]:_0xff9613[_0x5c10('0x33')];if(_0x4be469[_0x5c10('0x34')]['includeAll']){_0x2119f5[_0x5c10('0x47')]=[{'all':!![]}];}_0x2119f5=_[_0x5c10('0x40')]({},_0x2119f5,_0x4be469['options']);return db['SmsQueueReport'][_0x5c10('0x48')](_0x2119f5)[_0x5c10('0x25')](handleEntityNotFound(_0xc7979c,null))[_0x5c10('0x25')](respondWithResult(_0xc7979c,null))[_0x5c10('0x44')](handleError(_0xc7979c,null));};exports[_0x5c10('0x49')]=function(_0x2363e6,_0x2af183){return db[_0x5c10('0x2e')][_0x5c10('0x49')](_0x2363e6[_0x5c10('0x4a')],{})[_0x5c10('0x25')](respondWithResult(_0x2af183,0xc9))[_0x5c10('0x44')](handleError(_0x2af183,null));};exports[_0x5c10('0x24')]=function(_0x1f32c7,_0x7afc1f){if(_0x1f32c7['body']['id']){delete _0x1f32c7[_0x5c10('0x4a')]['id'];}return db['SmsQueueReport'][_0x5c10('0x48')]({'where':{'id':_0x1f32c7[_0x5c10('0x4b')]['id']}})[_0x5c10('0x25')](handleEntityNotFound(_0x7afc1f,null))[_0x5c10('0x25')](saveUpdates(_0x1f32c7[_0x5c10('0x4a')],null))[_0x5c10('0x25')](respondWithResult(_0x7afc1f,null))[_0x5c10('0x44')](handleError(_0x7afc1f,null));};exports[_0x5c10('0x26')]=function(_0x1f7c2d,_0x3f9536){return db['SmsQueueReport'][_0x5c10('0x48')]({'where':{'id':_0x1f7c2d[_0x5c10('0x4b')]['id']}})[_0x5c10('0x25')](handleEntityNotFound(_0x3f9536,null))[_0x5c10('0x25')](removeEntity(_0x3f9536,null))['catch'](handleError(_0x3f9536,null));};exports[_0x5c10('0x4c')]=function(_0xf28674,_0x2d6be4){return db[_0x5c10('0x2e')]['describe']()[_0x5c10('0x25')](respondWithResult(_0x2d6be4,null))[_0x5c10('0x44')](handleError(_0x2d6be4,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 1c7e606..e1e8d21 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 _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','define','SmsQueueReport','uniqueid','lodash'];(function(_0xeeddea,_0x135ec1){var _0x5b7782=function(_0x4e2a20){while(--_0x4e2a20){_0xeeddea['push'](_0xeeddea['shift']());}};_0x5b7782(++_0x135ec1);}(_0xb7e7,0x121));var _0x7b7e=function(_0x1c8c28,_0x3ee093){_0x1c8c28=_0x1c8c28-0x0;var _0x1f59b4=_0xb7e7[_0x1c8c28];return _0x1f59b4;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'report_sms_queue','paranoid':![],'indexes':[{'name':_0x7b7e('0x9'),'fields':[_0x7b7e('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','exports','define','SmsQueueReport','report_sms_queue','uniqueid'];(function(_0x2ff739,_0x1c8e0f){var _0x12dc13=function(_0x26fc97){while(--_0x26fc97){_0x2ff739['push'](_0x2ff739['shift']());}};_0x12dc13(++_0x1c8e0f);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[{'name':_0x3071('0xc'),'fields':[_0x3071('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index 7f109e6..aca1ea5 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 _0xe576=['UpdateSmsQueueReport','where','attributes','limit','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','error','message','result','CreateSmsQueueReport','SmsQueueReport','create','body','options','raw','stringify','catch'];(function(_0x4ae2e9,_0x2c6299){var _0x23b9be=function(_0x1ab639){while(--_0x1ab639){_0x4ae2e9['push'](_0x4ae2e9['shift']());}};_0x23b9be(++_0x2c6299);}(_0xe576,0x10c));var _0x6e57=function(_0x42e6c7,_0x5e1927){_0x42e6c7=_0x42e6c7-0x0;var _0x54b8e3=_0xe576[_0x42e6c7];return _0x54b8e3;};'use strict';var _=require('lodash');var util=require(_0x6e57('0x0'));var moment=require(_0x6e57('0x1'));var BPromise=require('bluebird');var rs=require(_0x6e57('0x2'));var fs=require('fs');var Redis=require(_0x6e57('0x3'));var db=require(_0x6e57('0x4'))['db'];var utils=require(_0x6e57('0x5'));var logger=require('../../config/logger')(_0x6e57('0x6'));var config=require(_0x6e57('0x7'));var jayson=require(_0x6e57('0x8'));var client=jayson[_0x6e57('0x9')][_0x6e57('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x383698,_0x4adb14,_0x9bfb4){return new BPromise(function(_0x2336d3,_0x2aa9c0){return client[_0x6e57('0xb')](_0x383698,_0x9bfb4)[_0x6e57('0xc')](function(_0x48c707){logger[_0x6e57('0xd')](_0x6e57('0xe'),_0x4adb14,_0x6e57('0xf'));logger[_0x6e57('0x10')](_0x6e57('0x11'),_0x4adb14,_0x6e57('0xf'),JSON['stringify'](_0x48c707));if(_0x48c707[_0x6e57('0x12')]){if(_0x48c707[_0x6e57('0x12')]['code']===0x1f4){logger[_0x6e57('0x12')](_0x6e57('0xe'),_0x4adb14,_0x48c707['error'][_0x6e57('0x13')]);return _0x2aa9c0(_0x48c707[_0x6e57('0x12')][_0x6e57('0x13')]);}logger['error'](_0x6e57('0xe'),_0x4adb14,_0x48c707['error'][_0x6e57('0x13')]);return _0x2336d3(_0x48c707['error'][_0x6e57('0x13')]);}else{logger[_0x6e57('0xd')](_0x6e57('0xe'),_0x4adb14,_0x6e57('0xf'));_0x2336d3(_0x48c707[_0x6e57('0x14')][_0x6e57('0x13')]);}})['catch'](function(_0x13ce24){logger[_0x6e57('0x12')]('SmsQueueReport,\x20%s,\x20%s',_0x4adb14,_0x13ce24);_0x2aa9c0(_0x13ce24);});});}exports[_0x6e57('0x15')]=function(_0x46154f){var _0x1d804b=this;return new Promise(function(_0xe7ca65,_0x374bd6){return db[_0x6e57('0x16')][_0x6e57('0x17')](_0x46154f[_0x6e57('0x18')],{'raw':_0x46154f[_0x6e57('0x19')]?_0x46154f[_0x6e57('0x19')][_0x6e57('0x1a')]===undefined?!![]:![]:!![]})[_0x6e57('0xc')](function(_0x3a9a0a){logger[_0x6e57('0xd')]('CreateSmsQueueReport',_0x46154f);logger[_0x6e57('0x10')](_0x6e57('0x15'),_0x46154f,JSON[_0x6e57('0x1b')](_0x3a9a0a));_0xe7ca65(_0x3a9a0a);})[_0x6e57('0x1c')](function(_0x2f0a85){logger[_0x6e57('0x12')](_0x6e57('0x15'),_0x2f0a85[_0x6e57('0x13')],_0x46154f);_0x374bd6(_0x1d804b[_0x6e57('0x12')](0x1f4,_0x2f0a85[_0x6e57('0x13')]));});});};exports[_0x6e57('0x1d')]=function(_0xb14896){var _0x3ee79f=this;return new Promise(function(_0x398ba9,_0x2ce1c2){return db[_0x6e57('0x16')]['update'](_0xb14896['body'],{'raw':_0xb14896[_0x6e57('0x19')]?_0xb14896[_0x6e57('0x19')][_0x6e57('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xb14896[_0x6e57('0x19')]?_0xb14896[_0x6e57('0x19')][_0x6e57('0x1e')]||null:null,'attributes':_0xb14896[_0x6e57('0x19')]?_0xb14896[_0x6e57('0x19')][_0x6e57('0x1f')]||null:null,'limit':_0xb14896[_0x6e57('0x19')]?_0xb14896[_0x6e57('0x19')][_0x6e57('0x20')]||null:null})[_0x6e57('0xc')](function(_0x375c60){logger['info'](_0x6e57('0x1d'),_0xb14896);logger[_0x6e57('0x10')](_0x6e57('0x1d'),_0xb14896,JSON['stringify'](_0x375c60));_0x398ba9(_0x375c60);})[_0x6e57('0x1c')](function(_0x1b13ab){logger[_0x6e57('0x12')](_0x6e57('0x1d'),_0x1b13ab[_0x6e57('0x13')],_0xb14896);_0x2ce1c2(_0x3ee79f[_0x6e57('0x12')](0x1f4,_0x1b13ab[_0x6e57('0x13')]));});});}; \ No newline at end of file +var _0x1045=['CreateSmsQueueReport','UpdateSmsQueueReport','update','options','where','attributes','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','SmsQueueReport','create','body','raw','then','debug'];(function(_0xac9d09,_0x8f8173){var _0x35410a=function(_0x4ed66b){while(--_0x4ed66b){_0xac9d09['push'](_0xac9d09['shift']());}};_0x35410a(++_0x8f8173);}(_0x1045,0xc6));var _0x5104=function(_0x52bd65,_0x160646){_0x52bd65=_0x52bd65-0x0;var _0x13fd57=_0x1045[_0x52bd65];return _0x13fd57;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5104('0x0'));var BPromise=require('bluebird');var rs=require(_0x5104('0x1'));var fs=require('fs');var Redis=require(_0x5104('0x2'));var db=require(_0x5104('0x3'))['db'];var utils=require(_0x5104('0x4'));var logger=require('../../config/logger')(_0x5104('0x5'));var config=require(_0x5104('0x6'));var jayson=require(_0x5104('0x7'));var client=jayson[_0x5104('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41191d,_0x4ce979,_0x45558b){return new BPromise(function(_0x817bdf,_0x7b851a){return client[_0x5104('0x9')](_0x41191d,_0x45558b)['then'](function(_0x566ed8){logger[_0x5104('0xa')](_0x5104('0xb'),_0x4ce979,_0x5104('0xc'));logger['debug'](_0x5104('0xd'),_0x4ce979,_0x5104('0xc'),JSON[_0x5104('0xe')](_0x566ed8));if(_0x566ed8[_0x5104('0xf')]){if(_0x566ed8[_0x5104('0xf')][_0x5104('0x10')]===0x1f4){logger[_0x5104('0xf')](_0x5104('0xb'),_0x4ce979,_0x566ed8[_0x5104('0xf')][_0x5104('0x11')]);return _0x7b851a(_0x566ed8['error'][_0x5104('0x11')]);}logger[_0x5104('0xf')]('SmsQueueReport,\x20%s,\x20%s',_0x4ce979,_0x566ed8[_0x5104('0xf')]['message']);return _0x817bdf(_0x566ed8[_0x5104('0xf')]['message']);}else{logger[_0x5104('0xa')]('SmsQueueReport,\x20%s,\x20%s',_0x4ce979,_0x5104('0xc'));_0x817bdf(_0x566ed8[_0x5104('0x12')]['message']);}})[_0x5104('0x13')](function(_0x55a590){logger[_0x5104('0xf')](_0x5104('0xb'),_0x4ce979,_0x55a590);_0x7b851a(_0x55a590);});});}exports['CreateSmsQueueReport']=function(_0x46763f){var _0x217ded=this;return new Promise(function(_0x46f5b5,_0x526ab9){return db[_0x5104('0x14')][_0x5104('0x15')](_0x46763f[_0x5104('0x16')],{'raw':_0x46763f['options']?_0x46763f['options'][_0x5104('0x17')]===undefined?!![]:![]:!![]})[_0x5104('0x18')](function(_0x6caf97){logger[_0x5104('0xa')]('CreateSmsQueueReport',_0x46763f);logger[_0x5104('0x19')]('CreateSmsQueueReport',_0x46763f,JSON[_0x5104('0xe')](_0x6caf97));_0x46f5b5(_0x6caf97);})[_0x5104('0x13')](function(_0x532786){logger['error'](_0x5104('0x1a'),_0x532786[_0x5104('0x11')],_0x46763f);_0x526ab9(_0x217ded[_0x5104('0xf')](0x1f4,_0x532786[_0x5104('0x11')]));});});};exports[_0x5104('0x1b')]=function(_0x284489){var _0x4393b3=this;return new Promise(function(_0x2c1ff5,_0x5b4e5f){return db[_0x5104('0x14')][_0x5104('0x1c')](_0x284489[_0x5104('0x16')],{'raw':_0x284489[_0x5104('0x1d')]?_0x284489[_0x5104('0x1d')][_0x5104('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x284489[_0x5104('0x1d')]?_0x284489[_0x5104('0x1d')][_0x5104('0x1e')]||null:null,'attributes':_0x284489[_0x5104('0x1d')]?_0x284489[_0x5104('0x1d')][_0x5104('0x1f')]||null:null,'limit':_0x284489[_0x5104('0x1d')]?_0x284489[_0x5104('0x1d')]['limit']||null:null})[_0x5104('0x18')](function(_0x35f2d4){logger['info']('UpdateSmsQueueReport',_0x284489);logger[_0x5104('0x19')](_0x5104('0x1b'),_0x284489,JSON[_0x5104('0xe')](_0x35f2d4));_0x2c1ff5(_0x35f2d4);})['catch'](function(_0xa6d72a){logger[_0x5104('0xf')](_0x5104('0x1b'),_0xa6d72a[_0x5104('0x11')],_0x284489);_0x5b4e5f(_0x4393b3['error'](0x1f4,_0xa6d72a[_0x5104('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 771d2a7..2ea8b8e 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 _0x4b1f=['put','/:id','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','post'];(function(_0x231544,_0x592bab){var _0x3a96df=function(_0x542502){while(--_0x542502){_0x231544['push'](_0x231544['shift']());}};_0x3a96df(++_0x592bab);}(_0x4b1f,0x195));var _0xf4b1=function(_0x3070dc,_0x40cf11){_0x3070dc=_0x3070dc-0x0;var _0x431489=_0x4b1f[_0x3070dc];return _0x431489;};'use strict';var multer=require(_0xf4b1('0x0'));var util=require(_0xf4b1('0x1'));var path=require('path');var timeout=require(_0xf4b1('0x2'));var express=require(_0xf4b1('0x3'));var router=express[_0xf4b1('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xf4b1('0x5'));var interaction=require(_0xf4b1('0x6'));var config=require(_0xf4b1('0x7'));var controller=require('./smsTransferReport.controller');router['get']('/',auth[_0xf4b1('0x8')](),controller[_0xf4b1('0x9')]);router[_0xf4b1('0xa')](_0xf4b1('0xb'),auth[_0xf4b1('0x8')](),controller['describe']);router['get']('/:id',auth[_0xf4b1('0x8')](),controller['show']);router[_0xf4b1('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0xf4b1('0xd')](_0xf4b1('0xe'),auth[_0xf4b1('0x8')](),controller[_0xf4b1('0xf')]);router[_0xf4b1('0x10')](_0xf4b1('0xe'),auth[_0xf4b1('0x8')](),controller[_0xf4b1('0x11')]);module[_0xf4b1('0x12')]=router; \ No newline at end of file +var _0x8958=['index','get','/describe','/:id','show','post','create','put','delete','destroy','exports','util','fs-extra','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','isAuthenticated'];(function(_0x464e05,_0x430401){var _0x45bb69=function(_0x501b49){while(--_0x501b49){_0x464e05['push'](_0x464e05['shift']());}};_0x45bb69(++_0x430401);}(_0x8958,0x93));var _0x8895=function(_0x15715d,_0x2bedee){_0x15715d=_0x15715d-0x0;var _0x4f24ba=_0x8958[_0x15715d];return _0x4f24ba;};'use strict';var multer=require('multer');var util=require(_0x8895('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x8895('0x1'));var auth=require('../../components/auth/service');var interaction=require(_0x8895('0x2'));var config=require(_0x8895('0x3'));var controller=require(_0x8895('0x4'));router['get']('/',auth[_0x8895('0x5')](),controller[_0x8895('0x6')]);router[_0x8895('0x7')](_0x8895('0x8'),auth[_0x8895('0x5')](),controller['describe']);router[_0x8895('0x7')](_0x8895('0x9'),auth[_0x8895('0x5')](),controller[_0x8895('0xa')]);router[_0x8895('0xb')]('/',auth[_0x8895('0x5')](),controller[_0x8895('0xc')]);router[_0x8895('0xd')](_0x8895('0x9'),auth[_0x8895('0x5')](),controller['update']);router[_0x8895('0xe')](_0x8895('0x9'),auth[_0x8895('0x5')](),controller[_0x8895('0xf')]);module[_0x8895('0x10')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index a8ba71e..198cdb9 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 _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x1c2135,_0x280715){var _0x1761f4=function(_0x5cc055){while(--_0x5cc055){_0x1c2135['push'](_0x1c2135['shift']());}};_0x1761f4(++_0x280715);}(_0x00bb,0x1d8));var _0xb00b=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0x00bb[_0x550d12];return _0x12103d;};'use strict';var moment=require(_0xb00b('0x0'));var Sequelize=require(_0xb00b('0x1'));module[_0xb00b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb00b('0x3')]('account',_0xb00b('0x4'),_0xb00b('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xb00b('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xb00b('0x7')]}}; \ No newline at end of file +var _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x1cb087,_0x386593){var _0x328574=function(_0x2fa71b){while(--_0x2fa71b){_0x1cb087['push'](_0x1cb087['shift']());}};_0x328574(++_0x386593);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x32cd29,_0x29f6bb){_0x32cd29=_0x32cd29-0x0;var _0x2f7e6e=_0xf3cd[_0x32cd29];return _0x2f7e6e;};'use strict';var moment=require(_0xdf3c('0x0'));var Sequelize=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'uniqueid':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf3c('0x4')](_0xdf3c('0x5'),'agent',_0xdf3c('0x6')),'allowNull':![],'defaultValue':_0xdf3c('0x6')},'transferredAt':{'type':Sequelize[_0xdf3c('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index a2fb281..7b49385 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 _0xf603=['rawAttributes','include','find','create','update','body','describe','rimraf','fast-json-patch','request-promise','mustache','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','count','limit','set','Content-Range','json','apply','reject','save','then','destroy','error','stack','name','send','map','SmsTransferReport','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','findAll','catch','show','params'];(function(_0x342f70,_0x699ff7){var _0xd7099=function(_0x54c1a1){while(--_0x54c1a1){_0x342f70['push'](_0x342f70['shift']());}};_0xd7099(++_0x699ff7);}(_0xf603,0x1a5));var _0x3f60=function(_0x28d04e,_0x2b5b26){_0x28d04e=_0x28d04e-0x0;var _0x4608b6=_0xf603[_0x28d04e];return _0x4608b6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3f60('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3f60('0x1'));var rp=require(_0x3f60('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3f60('0x3'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3f60('0x4'));var fs=require('fs');var fs_extra=require(_0x3f60('0x5'));var _=require('lodash');var squel=require(_0x3f60('0x6'));var crypto=require(_0x3f60('0x7'));var jsforce=require(_0x3f60('0x8'));var deskjs=require(_0x3f60('0x9'));var toCsv=require(_0x3f60('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x3f60('0xb'));var qs=require(_0x3f60('0xc'));var as=require(_0x3f60('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3f60('0xe'))('api');var utils=require(_0x3f60('0xf'));var config=require(_0x3f60('0x10'));var licenseUtil=require(_0x3f60('0x11'));var db=require(_0x3f60('0x12'))['db'];function respondWithStatusCode(_0x9353ca,_0xfb1356){_0xfb1356=_0xfb1356||0xcc;return function(_0x2cc9f2){if(_0x2cc9f2){return _0x9353ca[_0x3f60('0x13')](_0xfb1356);}return _0x9353ca[_0x3f60('0x14')](_0xfb1356)[_0x3f60('0x15')]();};}function respondWithResult(_0x44bb99,_0xc30e0b){_0xc30e0b=_0xc30e0b||0xc8;return function(_0x2ddfd9){if(_0x2ddfd9){return _0x44bb99[_0x3f60('0x14')](_0xc30e0b)['json'](_0x2ddfd9);}};}function respondWithFilteredResult(_0x1e48ad,_0x22cffd){return function(_0xef35b0){if(_0xef35b0){var _0x415804=typeof _0x22cffd[_0x3f60('0x16')]==='undefined'&&typeof _0x22cffd['limit']==='undefined';var _0x4d6a79=_0xef35b0['count'];var _0x49aa4d=_0x415804?0x0:_0x22cffd[_0x3f60('0x16')];var _0x35f987=_0x415804?_0xef35b0[_0x3f60('0x17')]:_0x22cffd[_0x3f60('0x16')]+_0x22cffd[_0x3f60('0x18')];var _0x39a65d;if(_0x35f987>=_0x4d6a79){_0x35f987=_0x4d6a79;_0x39a65d=0xc8;}else{_0x39a65d=0xce;}_0x1e48ad[_0x3f60('0x14')](_0x39a65d);return _0x1e48ad[_0x3f60('0x19')](_0x3f60('0x1a'),_0x49aa4d+'-'+_0x35f987+'/'+_0x4d6a79)[_0x3f60('0x1b')](_0xef35b0);}return null;};}function patchUpdates(_0x2478f1){return function(_0x1f0742){try{jsonpatch[_0x3f60('0x1c')](_0x1f0742,_0x2478f1,!![]);}catch(_0xfb8038){return BPromise[_0x3f60('0x1d')](_0xfb8038);}return _0x1f0742[_0x3f60('0x1e')]();};}function saveUpdates(_0x10ac8a,_0x161691){return function(_0x131744){if(_0x131744){return _0x131744['update'](_0x10ac8a)[_0x3f60('0x1f')](function(_0x21a298){return _0x21a298;});}return null;};}function removeEntity(_0x1d886b,_0x2aca7e){return function(_0x387eb1){if(_0x387eb1){return _0x387eb1[_0x3f60('0x20')]()[_0x3f60('0x1f')](function(){_0x1d886b[_0x3f60('0x14')](0xcc)[_0x3f60('0x15')]();});}};}function handleEntityNotFound(_0x30c628,_0x120929){return function(_0x405e0d){if(!_0x405e0d){_0x30c628[_0x3f60('0x13')](0x194);}return _0x405e0d;};}function handleError(_0x173bfb,_0x236835){_0x236835=_0x236835||0x1f4;return function(_0xeab01){logger[_0x3f60('0x21')](_0xeab01[_0x3f60('0x22')]);if(_0xeab01[_0x3f60('0x23')]){delete _0xeab01[_0x3f60('0x23')];}_0x173bfb[_0x3f60('0x14')](_0x236835)[_0x3f60('0x24')](_0xeab01);};}exports['index']=function(_0x5456d8,_0x37a5a4){var _0x3e074f={},_0x4b15c0={},_0x33d0cc={'count':0x0,'rows':[]};var _0x2d82e2=_[_0x3f60('0x25')](db[_0x3f60('0x26')]['rawAttributes'],function(_0xa23300){return{'name':_0xa23300[_0x3f60('0x27')],'type':_0xa23300[_0x3f60('0x28')][_0x3f60('0x29')]};});_0x4b15c0['model']=_[_0x3f60('0x25')](_0x2d82e2,_0x3f60('0x23'));_0x4b15c0[_0x3f60('0x2a')]=_[_0x3f60('0x2b')](_0x5456d8['query']);_0x4b15c0[_0x3f60('0x2c')]=_[_0x3f60('0x2d')](_0x4b15c0[_0x3f60('0x2e')],_0x4b15c0[_0x3f60('0x2a')]);_0x3e074f[_0x3f60('0x2f')]=_[_0x3f60('0x2d')](_0x4b15c0[_0x3f60('0x2e')],qs[_0x3f60('0x30')](_0x5456d8[_0x3f60('0x2a')][_0x3f60('0x30')]));_0x3e074f[_0x3f60('0x2f')]=_0x3e074f['attributes'][_0x3f60('0x31')]?_0x3e074f[_0x3f60('0x2f')]:_0x4b15c0[_0x3f60('0x2e')];if(!_0x5456d8[_0x3f60('0x2a')]['hasOwnProperty'](_0x3f60('0x32'))){_0x3e074f[_0x3f60('0x18')]=qs[_0x3f60('0x18')](_0x5456d8[_0x3f60('0x2a')][_0x3f60('0x18')]);_0x3e074f[_0x3f60('0x16')]=qs['offset'](_0x5456d8['query'][_0x3f60('0x16')]);}_0x3e074f[_0x3f60('0x33')]=qs[_0x3f60('0x34')](_0x5456d8[_0x3f60('0x2a')]['sort']);_0x3e074f[_0x3f60('0x35')]=qs['filters'](_[_0x3f60('0x36')](_0x5456d8[_0x3f60('0x2a')],_0x4b15c0[_0x3f60('0x2c')]),_0x2d82e2);if(_0x5456d8[_0x3f60('0x2a')][_0x3f60('0x37')]){_0x3e074f[_0x3f60('0x35')]=_[_0x3f60('0x38')](_0x3e074f[_0x3f60('0x35')],{'$or':_['map'](_0x2d82e2,function(_0x1713f4){if(_0x1713f4[_0x3f60('0x28')]!=='VIRTUAL'){var _0x3e97c1={};_0x3e97c1[_0x1713f4[_0x3f60('0x23')]]={'$like':'%'+_0x5456d8[_0x3f60('0x2a')][_0x3f60('0x37')]+'%'};return _0x3e97c1;}})});}_0x3e074f=_['merge']({},_0x3e074f,_0x5456d8[_0x3f60('0x39')]);var _0x233275={'where':_0x3e074f[_0x3f60('0x35')]};return db[_0x3f60('0x26')][_0x3f60('0x17')](_0x233275)[_0x3f60('0x1f')](function(_0x27102f){_0x33d0cc['count']=_0x27102f;if(_0x5456d8[_0x3f60('0x2a')]['includeAll']){_0x3e074f['include']=[{'all':!![]}];}return db[_0x3f60('0x26')][_0x3f60('0x3a')](_0x3e074f);})[_0x3f60('0x1f')](function(_0x202f6e){_0x33d0cc['rows']=_0x202f6e;return _0x33d0cc;})[_0x3f60('0x1f')](respondWithFilteredResult(_0x37a5a4,_0x3e074f))[_0x3f60('0x3b')](handleError(_0x37a5a4,null));};exports[_0x3f60('0x3c')]=function(_0x5d5f6b,_0x42d516){var _0x5c141c={'raw':!![],'where':{'id':_0x5d5f6b[_0x3f60('0x3d')]['id']}},_0x203cb1={};_0x203cb1['model']=_[_0x3f60('0x2b')](db['SmsTransferReport'][_0x3f60('0x3e')]);_0x203cb1[_0x3f60('0x2a')]=_[_0x3f60('0x2b')](_0x5d5f6b[_0x3f60('0x2a')]);_0x203cb1[_0x3f60('0x2c')]=_[_0x3f60('0x2d')](_0x203cb1['model'],_0x203cb1[_0x3f60('0x2a')]);_0x5c141c[_0x3f60('0x2f')]=_[_0x3f60('0x2d')](_0x203cb1[_0x3f60('0x2e')],qs[_0x3f60('0x30')](_0x5d5f6b[_0x3f60('0x2a')][_0x3f60('0x30')]));_0x5c141c[_0x3f60('0x2f')]=_0x5c141c[_0x3f60('0x2f')]['length']?_0x5c141c[_0x3f60('0x2f')]:_0x203cb1['model'];if(_0x5d5f6b[_0x3f60('0x2a')]['includeAll']){_0x5c141c[_0x3f60('0x3f')]=[{'all':!![]}];}_0x5c141c=_['merge']({},_0x5c141c,_0x5d5f6b[_0x3f60('0x39')]);return db[_0x3f60('0x26')][_0x3f60('0x40')](_0x5c141c)[_0x3f60('0x1f')](handleEntityNotFound(_0x42d516,null))[_0x3f60('0x1f')](respondWithResult(_0x42d516,null))['catch'](handleError(_0x42d516,null));};exports[_0x3f60('0x41')]=function(_0x2805a7,_0x3a71da){return db[_0x3f60('0x26')][_0x3f60('0x41')](_0x2805a7['body'],{})[_0x3f60('0x1f')](respondWithResult(_0x3a71da,0xc9))[_0x3f60('0x3b')](handleError(_0x3a71da,null));};exports[_0x3f60('0x42')]=function(_0x20dfad,_0x318c49){if(_0x20dfad[_0x3f60('0x43')]['id']){delete _0x20dfad['body']['id'];}return db[_0x3f60('0x26')]['find']({'where':{'id':_0x20dfad['params']['id']}})[_0x3f60('0x1f')](handleEntityNotFound(_0x318c49,null))['then'](saveUpdates(_0x20dfad['body'],null))[_0x3f60('0x1f')](respondWithResult(_0x318c49,null))[_0x3f60('0x3b')](handleError(_0x318c49,null));};exports[_0x3f60('0x20')]=function(_0xa9a7b2,_0x4f4193){return db[_0x3f60('0x26')]['find']({'where':{'id':_0xa9a7b2[_0x3f60('0x3d')]['id']}})[_0x3f60('0x1f')](handleEntityNotFound(_0x4f4193,null))['then'](removeEntity(_0x4f4193,null))['catch'](handleError(_0x4f4193,null));};exports['describe']=function(_0x5bc804,_0xd6fa35){return db['SmsTransferReport'][_0x3f60('0x44')]()['then'](respondWithResult(_0xd6fa35,null))[_0x3f60('0x3b')](handleError(_0xd6fa35,null));}; \ No newline at end of file +var _0x8dae=['length','hasOwnProperty','nolimit','offset','sort','where','pick','filter','type','VIRTUAL','merge','includeAll','include','findAll','rows','catch','params','options','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','util','sox','lodash','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','SmsTransferReport','rawAttributes','key','query','keys','filters','intersection','model','attributes','fields'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x8dae,0x1d8));var _0xe8da=function(_0x58c3ab,_0x4977c3){_0x58c3ab=_0x58c3ab-0x0;var _0x20ee8f=_0x8dae[_0x58c3ab];return _0x20ee8f;};'use strict';var emlformat=require(_0xe8da('0x0'));var rimraf=require(_0xe8da('0x1'));var zipdir=require(_0xe8da('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe8da('0x3'));var moment=require(_0xe8da('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xe8da('0x5'));var path=require('path');var sox=require(_0xe8da('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe8da('0x7'));var squel=require(_0xe8da('0x8'));var crypto=require(_0xe8da('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xe8da('0xa'));var toCsv=require(_0xe8da('0xb'));var querystring=require('querystring');var Papa=require(_0xe8da('0xc'));var Redis=require(_0xe8da('0xd'));var authService=require(_0xe8da('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xe8da('0xf'));var hardwareService=require(_0xe8da('0x10'));var logger=require(_0xe8da('0x11'))(_0xe8da('0x12'));var utils=require(_0xe8da('0x13'));var config=require(_0xe8da('0x14'));var licenseUtil=require(_0xe8da('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4854db,_0x7225f6){_0x7225f6=_0x7225f6||0xcc;return function(_0x5ad333){if(_0x5ad333){return _0x4854db[_0xe8da('0x16')](_0x7225f6);}return _0x4854db[_0xe8da('0x17')](_0x7225f6)[_0xe8da('0x18')]();};}function respondWithResult(_0x2b7f20,_0x1b6566){_0x1b6566=_0x1b6566||0xc8;return function(_0x1253f4){if(_0x1253f4){return _0x2b7f20['status'](_0x1b6566)[_0xe8da('0x19')](_0x1253f4);}};}function respondWithFilteredResult(_0x166afa,_0x2d8b68){return function(_0x5416c8){if(_0x5416c8){var _0x58e24b=typeof _0x2d8b68['offset']==='undefined'&&typeof _0x2d8b68[_0xe8da('0x1a')]===_0xe8da('0x1b');var _0x2e2f15=_0x5416c8[_0xe8da('0x1c')];var _0x19e4ee=_0x58e24b?0x0:_0x2d8b68['offset'];var _0x4f5aa2=_0x58e24b?_0x5416c8['count']:_0x2d8b68['offset']+_0x2d8b68[_0xe8da('0x1a')];var _0x54ced5;if(_0x4f5aa2>=_0x2e2f15){_0x4f5aa2=_0x2e2f15;_0x54ced5=0xc8;}else{_0x54ced5=0xce;}_0x166afa[_0xe8da('0x17')](_0x54ced5);return _0x166afa[_0xe8da('0x1d')](_0xe8da('0x1e'),_0x19e4ee+'-'+_0x4f5aa2+'/'+_0x2e2f15)[_0xe8da('0x19')](_0x5416c8);}return null;};}function patchUpdates(_0x3c5651){return function(_0x2e3e73){try{jsonpatch[_0xe8da('0x1f')](_0x2e3e73,_0x3c5651,!![]);}catch(_0x4f7b2b){return BPromise[_0xe8da('0x20')](_0x4f7b2b);}return _0x2e3e73[_0xe8da('0x21')]();};}function saveUpdates(_0x112834,_0x839ba9){return function(_0x5270af){if(_0x5270af){return _0x5270af[_0xe8da('0x22')](_0x112834)[_0xe8da('0x23')](function(_0x18cc1a){return _0x18cc1a;});}return null;};}function removeEntity(_0x152dc2,_0x2048d6){return function(_0x3419d1){if(_0x3419d1){return _0x3419d1[_0xe8da('0x24')]()[_0xe8da('0x23')](function(){_0x152dc2[_0xe8da('0x17')](0xcc)[_0xe8da('0x18')]();});}};}function handleEntityNotFound(_0x27a030,_0x4bdb08){return function(_0x50d192){if(!_0x50d192){_0x27a030[_0xe8da('0x16')](0x194);}return _0x50d192;};}function handleError(_0x4df7bd,_0x5b56ad){_0x5b56ad=_0x5b56ad||0x1f4;return function(_0x462653){logger[_0xe8da('0x25')](_0x462653[_0xe8da('0x26')]);if(_0x462653[_0xe8da('0x27')]){delete _0x462653[_0xe8da('0x27')];}_0x4df7bd['status'](_0x5b56ad)[_0xe8da('0x28')](_0x462653);};}exports[_0xe8da('0x29')]=function(_0x4dab44,_0x498da4){var _0x171dc9={},_0x57cf4a={},_0x3f9ccf={'count':0x0,'rows':[]};var _0x585c2e=_[_0xe8da('0x2a')](db[_0xe8da('0x2b')][_0xe8da('0x2c')],function(_0x266b76){return{'name':_0x266b76['fieldName'],'type':_0x266b76['type'][_0xe8da('0x2d')]};});_0x57cf4a['model']=_['map'](_0x585c2e,_0xe8da('0x27'));_0x57cf4a[_0xe8da('0x2e')]=_[_0xe8da('0x2f')](_0x4dab44[_0xe8da('0x2e')]);_0x57cf4a[_0xe8da('0x30')]=_[_0xe8da('0x31')](_0x57cf4a[_0xe8da('0x32')],_0x57cf4a[_0xe8da('0x2e')]);_0x171dc9[_0xe8da('0x33')]=_[_0xe8da('0x31')](_0x57cf4a[_0xe8da('0x32')],qs[_0xe8da('0x34')](_0x4dab44[_0xe8da('0x2e')][_0xe8da('0x34')]));_0x171dc9[_0xe8da('0x33')]=_0x171dc9[_0xe8da('0x33')][_0xe8da('0x35')]?_0x171dc9[_0xe8da('0x33')]:_0x57cf4a[_0xe8da('0x32')];if(!_0x4dab44[_0xe8da('0x2e')][_0xe8da('0x36')](_0xe8da('0x37'))){_0x171dc9[_0xe8da('0x1a')]=qs['limit'](_0x4dab44[_0xe8da('0x2e')][_0xe8da('0x1a')]);_0x171dc9['offset']=qs['offset'](_0x4dab44['query'][_0xe8da('0x38')]);}_0x171dc9['order']=qs[_0xe8da('0x39')](_0x4dab44[_0xe8da('0x2e')][_0xe8da('0x39')]);_0x171dc9[_0xe8da('0x3a')]=qs[_0xe8da('0x30')](_[_0xe8da('0x3b')](_0x4dab44[_0xe8da('0x2e')],_0x57cf4a[_0xe8da('0x30')]),_0x585c2e);if(_0x4dab44['query'][_0xe8da('0x3c')]){_0x171dc9['where']=_['merge'](_0x171dc9[_0xe8da('0x3a')],{'$or':_[_0xe8da('0x2a')](_0x585c2e,function(_0x491e7e){if(_0x491e7e[_0xe8da('0x3d')]!==_0xe8da('0x3e')){var _0x365e01={};_0x365e01[_0x491e7e[_0xe8da('0x27')]]={'$like':'%'+_0x4dab44['query'][_0xe8da('0x3c')]+'%'};return _0x365e01;}})});}_0x171dc9=_[_0xe8da('0x3f')]({},_0x171dc9,_0x4dab44['options']);var _0x4d1b43={'where':_0x171dc9[_0xe8da('0x3a')]};return db['SmsTransferReport']['count'](_0x4d1b43)[_0xe8da('0x23')](function(_0x8c6525){_0x3f9ccf[_0xe8da('0x1c')]=_0x8c6525;if(_0x4dab44[_0xe8da('0x2e')][_0xe8da('0x40')]){_0x171dc9[_0xe8da('0x41')]=[{'all':!![]}];}return db[_0xe8da('0x2b')][_0xe8da('0x42')](_0x171dc9);})[_0xe8da('0x23')](function(_0x5db44a){_0x3f9ccf[_0xe8da('0x43')]=_0x5db44a;return _0x3f9ccf;})[_0xe8da('0x23')](respondWithFilteredResult(_0x498da4,_0x171dc9))[_0xe8da('0x44')](handleError(_0x498da4,null));};exports['show']=function(_0x13a676,_0x104e57){var _0x5c13ee={'raw':!![],'where':{'id':_0x13a676[_0xe8da('0x45')]['id']}},_0x478b30={};_0x478b30['model']=_[_0xe8da('0x2f')](db['SmsTransferReport'][_0xe8da('0x2c')]);_0x478b30[_0xe8da('0x2e')]=_[_0xe8da('0x2f')](_0x13a676[_0xe8da('0x2e')]);_0x478b30[_0xe8da('0x30')]=_['intersection'](_0x478b30[_0xe8da('0x32')],_0x478b30[_0xe8da('0x2e')]);_0x5c13ee['attributes']=_[_0xe8da('0x31')](_0x478b30[_0xe8da('0x32')],qs[_0xe8da('0x34')](_0x13a676['query']['fields']));_0x5c13ee[_0xe8da('0x33')]=_0x5c13ee[_0xe8da('0x33')][_0xe8da('0x35')]?_0x5c13ee[_0xe8da('0x33')]:_0x478b30[_0xe8da('0x32')];if(_0x13a676[_0xe8da('0x2e')][_0xe8da('0x40')]){_0x5c13ee[_0xe8da('0x41')]=[{'all':!![]}];}_0x5c13ee=_[_0xe8da('0x3f')]({},_0x5c13ee,_0x13a676[_0xe8da('0x46')]);return db['SmsTransferReport'][_0xe8da('0x47')](_0x5c13ee)[_0xe8da('0x23')](handleEntityNotFound(_0x104e57,null))[_0xe8da('0x23')](respondWithResult(_0x104e57,null))[_0xe8da('0x44')](handleError(_0x104e57,null));};exports[_0xe8da('0x48')]=function(_0x5bbcba,_0x2abb52){return db['SmsTransferReport']['create'](_0x5bbcba[_0xe8da('0x49')],{})[_0xe8da('0x23')](respondWithResult(_0x2abb52,0xc9))[_0xe8da('0x44')](handleError(_0x2abb52,null));};exports[_0xe8da('0x22')]=function(_0x3f962b,_0x3ccfc0){if(_0x3f962b[_0xe8da('0x49')]['id']){delete _0x3f962b[_0xe8da('0x49')]['id'];}return db[_0xe8da('0x2b')][_0xe8da('0x47')]({'where':{'id':_0x3f962b[_0xe8da('0x45')]['id']}})[_0xe8da('0x23')](handleEntityNotFound(_0x3ccfc0,null))['then'](saveUpdates(_0x3f962b[_0xe8da('0x49')],null))['then'](respondWithResult(_0x3ccfc0,null))[_0xe8da('0x44')](handleError(_0x3ccfc0,null));};exports['destroy']=function(_0x527269,_0x88d4b5){return db[_0xe8da('0x2b')][_0xe8da('0x47')]({'where':{'id':_0x527269[_0xe8da('0x45')]['id']}})[_0xe8da('0x23')](handleEntityNotFound(_0x88d4b5,null))[_0xe8da('0x23')](removeEntity(_0x88d4b5,null))['catch'](handleError(_0x88d4b5,null));};exports[_0xe8da('0x4a')]=function(_0x1e3a1d,_0x30c2c6){return db['SmsTransferReport']['describe']()[_0xe8da('0x23')](respondWithResult(_0x30c2c6,null))[_0xe8da('0x44')](handleError(_0x30c2c6,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index d47c866..322f707 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 _0xb88f=['SmsTransferReport','uniqueid','util','api','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x36aca7,_0x213f9d){var _0x520c48=function(_0x142fa1){while(--_0x142fa1){_0x36aca7['push'](_0x36aca7['shift']());}};_0x520c48(++_0x213f9d);}(_0xb88f,0x124));var _0xfb88=function(_0x5a99db,_0x1cece5){_0x5a99db=_0x5a99db-0x0;var _0x3aad62=_0xb88f[_0x5a99db];return _0x3aad62;};'use strict';var _=require('lodash');var util=require(_0xfb88('0x0'));var logger=require('../../config/logger')(_0xfb88('0x1'));var moment=require('moment');var BPromise=require(_0xfb88('0x2'));var rp=require(_0xfb88('0x3'));var fs=require('fs');var path=require(_0xfb88('0x4'));var rimraf=require(_0xfb88('0x5'));var config=require(_0xfb88('0x6'));var attributes=require('./smsTransferReport.attributes');module[_0xfb88('0x7')]=function(_0x299565,_0x11ba28){return _0x299565['define'](_0xfb88('0x8'),attributes,{'tableName':'report_sms_transfer','paranoid':![],'indexes':[{'name':_0xfb88('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x4f5d=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./smsTransferReport.attributes','exports','define','SmsTransferReport','report_sms_transfer','uniqueid'];(function(_0x21aec3,_0x5c97e9){var _0x288bbc=function(_0x2283fe){while(--_0x2283fe){_0x21aec3['push'](_0x21aec3['shift']());}};_0x288bbc(++_0x5c97e9);}(_0x4f5d,0x1d1));var _0xd4f5=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0x4f5d[_0x18ab2a];return _0x16dcee;};'use strict';var _=require(_0xd4f5('0x0'));var util=require(_0xd4f5('0x1'));var logger=require(_0xd4f5('0x2'))(_0xd4f5('0x3'));var moment=require(_0xd4f5('0x4'));var BPromise=require(_0xd4f5('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd4f5('0x6'));var rimraf=require(_0xd4f5('0x7'));var config=require(_0xd4f5('0x8'));var attributes=require(_0xd4f5('0x9'));module[_0xd4f5('0xa')]=function(_0x2c44bb,_0x121bfd){return _0x2c44bb[_0xd4f5('0xb')](_0xd4f5('0xc'),attributes,{'tableName':_0xd4f5('0xd'),'paranoid':![],'indexes':[{'name':_0xd4f5('0xe'),'fields':[_0xd4f5('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index 0de3157..dd5f75c 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 _0x5a01=['request','then','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsTransferReport,\x20%s,\x20%s','message','info','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http'];(function(_0x27031e,_0x1eb8cd){var _0xfd46b3=function(_0x9fdcf8){while(--_0x9fdcf8){_0x27031e['push'](_0x27031e['shift']());}};_0xfd46b3(++_0x1eb8cd);}(_0x5a01,0x1af));var _0x15a0=function(_0x5f42f1,_0x956be5){_0x5f42f1=_0x5f42f1-0x0;var _0x5534ee=_0x5a01[_0x5f42f1];return _0x5534ee;};'use strict';var _=require(_0x15a0('0x0'));var util=require(_0x15a0('0x1'));var moment=require(_0x15a0('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x15a0('0x3'));var db=require(_0x15a0('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x15a0('0x5'))(_0x15a0('0x6'));var config=require(_0x15a0('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x15a0('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x52ab0,_0x40fd51,_0x502248){return new BPromise(function(_0x44f39a,_0x3e7755){return client[_0x15a0('0x9')](_0x52ab0,_0x502248)[_0x15a0('0xa')](function(_0x3728c6){logger['info']('SmsTransferReport,\x20%s,\x20%s',_0x40fd51,_0x15a0('0xb'));logger[_0x15a0('0xc')](_0x15a0('0xd'),_0x40fd51,_0x15a0('0xb'),JSON[_0x15a0('0xe')](_0x3728c6));if(_0x3728c6[_0x15a0('0xf')]){if(_0x3728c6[_0x15a0('0xf')][_0x15a0('0x10')]===0x1f4){logger[_0x15a0('0xf')](_0x15a0('0x11'),_0x40fd51,_0x3728c6[_0x15a0('0xf')][_0x15a0('0x12')]);return _0x3e7755(_0x3728c6['error']['message']);}logger[_0x15a0('0xf')](_0x15a0('0x11'),_0x40fd51,_0x3728c6[_0x15a0('0xf')][_0x15a0('0x12')]);return _0x44f39a(_0x3728c6[_0x15a0('0xf')][_0x15a0('0x12')]);}else{logger[_0x15a0('0x13')](_0x15a0('0x11'),_0x40fd51,_0x15a0('0xb'));_0x44f39a(_0x3728c6['result'][_0x15a0('0x12')]);}})['catch'](function(_0x593f2c){logger[_0x15a0('0xf')](_0x15a0('0x11'),_0x40fd51,_0x593f2c);_0x3e7755(_0x593f2c);});});} \ No newline at end of file +var _0x2263=['stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x88c91a,_0x5066ee){var _0x1c86f2=function(_0x413fa1){while(--_0x413fa1){_0x88c91a['push'](_0x88c91a['shift']());}};_0x1c86f2(++_0x5066ee);}(_0x2263,0x6e));var _0x3226=function(_0x5216e0,_0x4f8cb9){_0x5216e0=_0x5216e0-0x0;var _0x5b3f40=_0x2263[_0x5216e0];return _0x5b3f40;};'use strict';var _=require(_0x3226('0x0'));var util=require(_0x3226('0x1'));var moment=require(_0x3226('0x2'));var BPromise=require(_0x3226('0x3'));var rs=require(_0x3226('0x4'));var fs=require('fs');var Redis=require(_0x3226('0x5'));var db=require(_0x3226('0x6'))['db'];var utils=require(_0x3226('0x7'));var logger=require('../../config/logger')(_0x3226('0x8'));var config=require(_0x3226('0x9'));var jayson=require(_0x3226('0xa'));var client=jayson[_0x3226('0xb')][_0x3226('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x52d8e2,_0x45feb1,_0x1e05af){return new BPromise(function(_0x5d235b,_0x5a0667){return client[_0x3226('0xd')](_0x52d8e2,_0x1e05af)[_0x3226('0xe')](function(_0x51e819){logger[_0x3226('0xf')](_0x3226('0x10'),_0x45feb1,_0x3226('0x11'));logger[_0x3226('0x12')](_0x3226('0x13'),_0x45feb1,_0x3226('0x11'),JSON[_0x3226('0x14')](_0x51e819));if(_0x51e819['error']){if(_0x51e819[_0x3226('0x15')][_0x3226('0x16')]===0x1f4){logger[_0x3226('0x15')](_0x3226('0x10'),_0x45feb1,_0x51e819['error']['message']);return _0x5a0667(_0x51e819['error']['message']);}logger['error'](_0x3226('0x10'),_0x45feb1,_0x51e819[_0x3226('0x15')][_0x3226('0x17')]);return _0x5d235b(_0x51e819[_0x3226('0x15')]['message']);}else{logger['info'](_0x3226('0x10'),_0x45feb1,_0x3226('0x11'));_0x5d235b(_0x51e819[_0x3226('0x18')]['message']);}})[_0x3226('0x19')](function(_0x20f66c){logger[_0x3226('0x15')](_0x3226('0x10'),_0x45feb1,_0x20f66c);_0x5a0667(_0x20f66c);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 1454a8c..f845d14 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 _0x9596=['originalname','replace','format','extname','now','post','file','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','/:id/download','diskStorage','join','server/files/sounds/original/'];(function(_0x261e29,_0x10fffd){var _0x25ef43=function(_0x21b8e7){while(--_0x21b8e7){_0x261e29['push'](_0x261e29['shift']());}};_0x25ef43(++_0x10fffd);}(_0x9596,0x84));var _0x6959=function(_0x17882c,_0x4b964b){_0x17882c=_0x17882c-0x0;var _0x355a59=_0x9596[_0x17882c];return _0x355a59;};'use strict';var multer=require(_0x6959('0x0'));var util=require(_0x6959('0x1'));var path=require(_0x6959('0x2'));var timeout=require(_0x6959('0x3'));var express=require(_0x6959('0x4'));var router=express[_0x6959('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x6959('0x6'));var interaction=require(_0x6959('0x7'));var config=require(_0x6959('0x8'));var controller=require('./sound.controller');router[_0x6959('0x9')]('/',auth['isAuthenticated'](),controller[_0x6959('0xa')]);router['get'](_0x6959('0xb'),auth[_0x6959('0xc')](),controller[_0x6959('0xd')]);router[_0x6959('0x9')](_0x6959('0xe'),auth[_0x6959('0xc')](),controller['download']);var upload=multer({'storage':multer[_0x6959('0xf')]({'destination':function(_0x207677,_0x33ef09,_0x5c603f){_0x5c603f(null,path[_0x6959('0x10')](config['root'],_0x6959('0x11')));},'filename':function(_0x48bfec,_0xb5096e,_0x5ad0c9){_0xb5096e['originalname']=_0xb5096e[_0x6959('0x12')][_0x6959('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x5ad0c9(null,util[_0x6959('0x14')]('%s-%s%s',path['basename'](_0xb5096e[_0x6959('0x12')],path[_0x6959('0x15')](_0xb5096e[_0x6959('0x12')])),Date[_0x6959('0x16')](),path[_0x6959('0x15')](_0xb5096e['originalname'])));}})});router[_0x6959('0x17')]('/',upload['single'](_0x6959('0x18')),controller[_0x6959('0x19')]);router[_0x6959('0x1a')]('/:id',auth[_0x6959('0xc')](),controller[_0x6959('0x1b')]);router[_0x6959('0x1c')](_0x6959('0xb'),auth[_0x6959('0xc')](),controller[_0x6959('0x1c')]);module[_0x6959('0x1d')]=router; \ No newline at end of file +var _0x5ef9=['get','isAuthenticated','index','/:id','download','root','server/files/sounds/original/','originalname','replace','format','%s-%s%s','basename','extname','post','file','create','put','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','./sound.controller'];(function(_0x3ee5df,_0x583073){var _0x446d24=function(_0x12e54e){while(--_0x12e54e){_0x3ee5df['push'](_0x3ee5df['shift']());}};_0x446d24(++_0x583073);}(_0x5ef9,0xbc));var _0x95ef=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0x5ef9[_0x565ed7];return _0x183ad7;};'use strict';var multer=require(_0x95ef('0x0'));var util=require(_0x95ef('0x1'));var path=require(_0x95ef('0x2'));var timeout=require(_0x95ef('0x3'));var express=require(_0x95ef('0x4'));var router=express['Router']();var fs_extra=require(_0x95ef('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x95ef('0x6'));var config=require('../../config/environment');var controller=require(_0x95ef('0x7'));router[_0x95ef('0x8')]('/',auth[_0x95ef('0x9')](),controller[_0x95ef('0xa')]);router[_0x95ef('0x8')](_0x95ef('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x95ef('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0x95ef('0xc')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x28d08d,_0x2f5958,_0xc0261f){_0xc0261f(null,path['join'](config[_0x95ef('0xd')],_0x95ef('0xe')));},'filename':function(_0x1e3126,_0x44dae8,_0x3c8373){_0x44dae8[_0x95ef('0xf')]=_0x44dae8[_0x95ef('0xf')][_0x95ef('0x10')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x3c8373(null,util[_0x95ef('0x11')](_0x95ef('0x12'),path[_0x95ef('0x13')](_0x44dae8[_0x95ef('0xf')],path[_0x95ef('0x14')](_0x44dae8['originalname'])),Date['now'](),path[_0x95ef('0x14')](_0x44dae8[_0x95ef('0xf')])));}})});router[_0x95ef('0x15')]('/',upload['single'](_0x95ef('0x16')),controller[_0x95ef('0x17')]);router[_0x95ef('0x18')](_0x95ef('0xb'),auth[_0x95ef('0x9')](),controller[_0x95ef('0x19')]);router[_0x95ef('0x1a')](_0x95ef('0xb'),auth[_0x95ef('0x9')](),controller[_0x95ef('0x1a')]);module[_0x95ef('0x1b')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index d086034..9b0e1d4 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 _0x3184=['STRING','name','FLOAT','BIGINT','INTEGER'];(function(_0x53c83a,_0x2a441b){var _0x390792=function(_0x424145){while(--_0x424145){_0x53c83a['push'](_0x53c83a['shift']());}};_0x390792(++_0x2a441b);}(_0x3184,0x10e));var _0x4318=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0x3184[_0x50a0c2];return _0x5ebadd;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x4318('0x0')],'unique':_0x4318('0x1'),'allowNull':![]},'save_name':{'type':Sequelize[_0x4318('0x0')]},'display_name':{'type':Sequelize[_0x4318('0x0')],'defaultValue':''},'description':{'type':Sequelize[_0x4318('0x0')]},'original_format':{'type':Sequelize[_0x4318('0x0')]},'original_duration':{'type':Sequelize[_0x4318('0x2')]},'original_sampleCount':{'type':Sequelize[_0x4318('0x3')]},'original_channelCount':{'type':Sequelize[_0x4318('0x4')]},'original_bitRate':{'type':Sequelize[_0x4318('0x3')]},'original_sampleRate':{'type':Sequelize[_0x4318('0x4')]},'converted_format':{'type':Sequelize[_0x4318('0x0')]},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize[_0x4318('0x3')]},'converted_channelCount':{'type':Sequelize[_0x4318('0x4')]},'converted_bitRate':{'type':Sequelize['BIGINT']},'converted_sampleRate':{'type':Sequelize[_0x4318('0x4')]}}; \ No newline at end of file +var _0x1214=['name','FLOAT','BIGINT','INTEGER','exports','STRING'];(function(_0x53463e,_0x5ec885){var _0x193687=function(_0x1a2a9c){while(--_0x1a2a9c){_0x53463e['push'](_0x53463e['shift']());}};_0x193687(++_0x5ec885);}(_0x1214,0x1c0));var _0x4121=function(_0x59ef3d,_0x5c7aee){_0x59ef3d=_0x59ef3d-0x0;var _0x585558=_0x1214[_0x59ef3d];return _0x585558;};'use strict';var Sequelize=require('sequelize');module[_0x4121('0x0')]={'name':{'type':Sequelize[_0x4121('0x1')],'unique':_0x4121('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0x4121('0x1')]},'display_name':{'type':Sequelize[_0x4121('0x1')],'defaultValue':''},'description':{'type':Sequelize[_0x4121('0x1')]},'original_format':{'type':Sequelize[_0x4121('0x1')]},'original_duration':{'type':Sequelize[_0x4121('0x3')]},'original_sampleCount':{'type':Sequelize[_0x4121('0x4')]},'original_channelCount':{'type':Sequelize[_0x4121('0x5')]},'original_bitRate':{'type':Sequelize[_0x4121('0x4')]},'original_sampleRate':{'type':Sequelize[_0x4121('0x5')]},'converted_format':{'type':Sequelize[_0x4121('0x1')]},'converted_duration':{'type':Sequelize[_0x4121('0x3')]},'converted_sampleCount':{'type':Sequelize[_0x4121('0x4')]},'converted_channelCount':{'type':Sequelize[_0x4121('0x5')]},'converted_bitRate':{'type':Sequelize[_0x4121('0x4')]},'converted_sampleRate':{'type':Sequelize[_0x4121('0x5')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index 46d3812..b1780bd 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 _0x89e3=['then','get','Sounds','UserProfileResource','end','error','stack','name','send','index','map','Sound','fieldName','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','include','findAll','catch','show','rawAttributes','fields','merge','options','find','download','params','root','server/files/sounds/converted','converted_format','Sequelize','ValidationError','join','%s.%s','save_name','basename','file','extname','originalname','filename','substring','wav','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','src','original_duration','duration','sampleCount','channelCount','sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','bitRate','create','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','delete','server/files/sounds/original','original_format','format','unlinkSync','rimraf','mustache','sox','to-csv','ejs','lodash','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','count','apply','reject','save','update','destroy'];(function(_0x5cb378,_0x3d28e7){var _0x1da545=function(_0x4e1c1b){while(--_0x4e1c1b){_0x5cb378['push'](_0x5cb378['shift']());}};_0x1da545(++_0x3d28e7);}(_0x89e3,0x13a));var _0x389e=function(_0x4faf34,_0x47677f){_0x4faf34=_0x4faf34-0x0;var _0xf31a72=_0x89e3[_0x4faf34];return _0xf31a72;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x389e('0x0'));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(_0x389e('0x1'));var util=require('util');var path=require('path');var sox=require(_0x389e('0x2'));var csv=require(_0x389e('0x3'));var ejs=require(_0x389e('0x4'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x389e('0x5'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x389e('0x6'));var toCsv=require(_0x389e('0x3'));var querystring=require(_0x389e('0x7'));var Papa=require(_0x389e('0x8'));var Redis=require(_0x389e('0x9'));var authService=require(_0x389e('0xa'));var qs=require(_0x389e('0xb'));var as=require(_0x389e('0xc'));var hardwareService=require(_0x389e('0xd'));var logger=require(_0x389e('0xe'))('api');var utils=require(_0x389e('0xf'));var config=require(_0x389e('0x10'));var licenseUtil=require('../../config/license/util');var db=require(_0x389e('0x11'))['db'];function respondWithStatusCode(_0x4f2863,_0x133f3c){_0x133f3c=_0x133f3c||0xcc;return function(_0x3d37bd){if(_0x3d37bd){return _0x4f2863[_0x389e('0x12')](_0x133f3c);}return _0x4f2863[_0x389e('0x13')](_0x133f3c)['end']();};}function respondWithResult(_0x3232ae,_0x42e4fa){_0x42e4fa=_0x42e4fa||0xc8;return function(_0x294c2f){if(_0x294c2f){return _0x3232ae[_0x389e('0x13')](_0x42e4fa)['json'](_0x294c2f);}};}function respondWithFilteredResult(_0x319f0d,_0x2b0c61){return function(_0x4e5a63){if(_0x4e5a63){var _0x368b55=typeof _0x2b0c61[_0x389e('0x14')]===_0x389e('0x15')&&typeof _0x2b0c61['limit']===_0x389e('0x15');var _0x37af9=_0x4e5a63[_0x389e('0x16')];var _0x2e68c2=_0x368b55?0x0:_0x2b0c61[_0x389e('0x14')];var _0x573182=_0x368b55?_0x4e5a63[_0x389e('0x16')]:_0x2b0c61['offset']+_0x2b0c61['limit'];var _0x3207a0;if(_0x573182>=_0x37af9){_0x573182=_0x37af9;_0x3207a0=0xc8;}else{_0x3207a0=0xce;}_0x319f0d[_0x389e('0x13')](_0x3207a0);return _0x319f0d['set']('Content-Range',_0x2e68c2+'-'+_0x573182+'/'+_0x37af9)['json'](_0x4e5a63);}return null;};}function patchUpdates(_0x5064ee){return function(_0x8dc5e8){try{jsonpatch[_0x389e('0x17')](_0x8dc5e8,_0x5064ee,!![]);}catch(_0x129cc2){return BPromise[_0x389e('0x18')](_0x129cc2);}return _0x8dc5e8[_0x389e('0x19')]();};}function saveUpdates(_0x55b0a4,_0x482db5){return function(_0x1e53d8){if(_0x1e53d8){return _0x1e53d8[_0x389e('0x1a')](_0x55b0a4)['then'](function(_0x4cb1f5){return _0x4cb1f5;});}return null;};}function removeEntity(_0x58c8aa,_0x5173b6){return function(_0x59eef7){if(_0x59eef7){return _0x59eef7[_0x389e('0x1b')]()[_0x389e('0x1c')](function(){var _0x578ede=_0x59eef7[_0x389e('0x1d')]({'plain':!![]});var _0x40f4c0=_0x389e('0x1e');return db[_0x389e('0x1f')]['destroy']({'where':{'type':_0x40f4c0,'resourceId':_0x578ede['id']}})[_0x389e('0x1c')](function(){return _0x59eef7;});})['then'](function(){_0x58c8aa[_0x389e('0x13')](0xcc)[_0x389e('0x20')]();});}};}function handleEntityNotFound(_0x673336,_0x12658a){return function(_0x822b7f){if(!_0x822b7f){_0x673336[_0x389e('0x12')](0x194);}return _0x822b7f;};}function handleError(_0x2f4c43,_0x348f1a){_0x348f1a=_0x348f1a||0x1f4;return function(_0x52b2af){logger[_0x389e('0x21')](_0x52b2af[_0x389e('0x22')]);if(_0x52b2af['name']){delete _0x52b2af[_0x389e('0x23')];}_0x2f4c43['status'](_0x348f1a)[_0x389e('0x24')](_0x52b2af);};}exports[_0x389e('0x25')]=function(_0xff0051,_0x578a14){var _0x48e9f6={},_0x393039={},_0x2eda80={'count':0x0,'rows':[]};var _0x9acfe1=_[_0x389e('0x26')](db[_0x389e('0x27')]['rawAttributes'],function(_0xb11d2){return{'name':_0xb11d2[_0x389e('0x28')],'type':_0xb11d2['type'][_0x389e('0x29')]};});_0x393039[_0x389e('0x2a')]=_['map'](_0x9acfe1,'name');_0x393039[_0x389e('0x2b')]=_[_0x389e('0x2c')](_0xff0051['query']);_0x393039[_0x389e('0x2d')]=_[_0x389e('0x2e')](_0x393039[_0x389e('0x2a')],_0x393039[_0x389e('0x2b')]);_0x48e9f6[_0x389e('0x2f')]=_['intersection'](_0x393039[_0x389e('0x2a')],qs['fields'](_0xff0051[_0x389e('0x2b')]['fields']));_0x48e9f6[_0x389e('0x2f')]=_0x48e9f6[_0x389e('0x2f')][_0x389e('0x30')]?_0x48e9f6[_0x389e('0x2f')]:_0x393039[_0x389e('0x2a')];if(!_0xff0051[_0x389e('0x2b')][_0x389e('0x31')](_0x389e('0x32'))){_0x48e9f6['limit']=qs['limit'](_0xff0051['query']['limit']);_0x48e9f6[_0x389e('0x14')]=qs[_0x389e('0x14')](_0xff0051[_0x389e('0x2b')][_0x389e('0x14')]);}_0x48e9f6[_0x389e('0x33')]=qs[_0x389e('0x34')](_0xff0051['query'][_0x389e('0x34')]);_0x48e9f6[_0x389e('0x35')]=qs[_0x389e('0x2d')](_[_0x389e('0x36')](_0xff0051[_0x389e('0x2b')],_0x393039[_0x389e('0x2d')]),_0x9acfe1);if(_0xff0051['query'][_0x389e('0x37')]){_0x48e9f6[_0x389e('0x35')]=_['merge'](_0x48e9f6[_0x389e('0x35')],{'$or':_[_0x389e('0x26')](_0x9acfe1,function(_0x5a95aa){if(_0x5a95aa['type']!==_0x389e('0x38')){var _0x591399={};_0x591399[_0x5a95aa['name']]={'$like':'%'+_0xff0051[_0x389e('0x2b')]['filter']+'%'};return _0x591399;}})});}_0x48e9f6=_['merge']({},_0x48e9f6,_0xff0051['options']);var _0x5b7a00={'where':_0x48e9f6[_0x389e('0x35')]};return db[_0x389e('0x27')][_0x389e('0x16')](_0x5b7a00)[_0x389e('0x1c')](function(_0x2a313d){_0x2eda80['count']=_0x2a313d;if(_0xff0051[_0x389e('0x2b')]['includeAll']){_0x48e9f6[_0x389e('0x39')]=[{'all':!![]}];}return db[_0x389e('0x27')][_0x389e('0x3a')](_0x48e9f6);})[_0x389e('0x1c')](function(_0x755db4){_0x2eda80['rows']=_0x755db4;return _0x2eda80;})['then'](respondWithFilteredResult(_0x578a14,_0x48e9f6))[_0x389e('0x3b')](handleError(_0x578a14,null));};exports[_0x389e('0x3c')]=function(_0x68050,_0xefec7b){var _0x56cf64={'raw':!![],'where':{'id':_0x68050['params']['id']}},_0x5d04e9={};_0x5d04e9[_0x389e('0x2a')]=_[_0x389e('0x2c')](db[_0x389e('0x27')][_0x389e('0x3d')]);_0x5d04e9[_0x389e('0x2b')]=_[_0x389e('0x2c')](_0x68050[_0x389e('0x2b')]);_0x5d04e9[_0x389e('0x2d')]=_['intersection'](_0x5d04e9['model'],_0x5d04e9[_0x389e('0x2b')]);_0x56cf64['attributes']=_[_0x389e('0x2e')](_0x5d04e9[_0x389e('0x2a')],qs[_0x389e('0x3e')](_0x68050[_0x389e('0x2b')][_0x389e('0x3e')]));_0x56cf64[_0x389e('0x2f')]=_0x56cf64[_0x389e('0x2f')][_0x389e('0x30')]?_0x56cf64[_0x389e('0x2f')]:_0x5d04e9[_0x389e('0x2a')];if(_0x68050[_0x389e('0x2b')]['includeAll']){_0x56cf64[_0x389e('0x39')]=[{'all':!![]}];}_0x56cf64=_[_0x389e('0x3f')]({},_0x56cf64,_0x68050[_0x389e('0x40')]);return db['Sound'][_0x389e('0x41')](_0x56cf64)[_0x389e('0x1c')](handleEntityNotFound(_0xefec7b,null))['then'](respondWithResult(_0xefec7b,null))[_0x389e('0x3b')](handleError(_0xefec7b,null));};exports[_0x389e('0x42')]=function(_0x17a217,_0x4cc367,_0x222e19){return db[_0x389e('0x27')][_0x389e('0x41')]({'where':{'id':_0x17a217[_0x389e('0x43')]['id']},'attributes':[_0x389e('0x23'),'save_name','converted_format'],'raw':!![]})['then'](handleEntityNotFound(_0x4cc367,null))[_0x389e('0x1c')](function(_0x42578e){if(_0x42578e){if(!fs['existsSync'](path['join'](config[_0x389e('0x44')],_0x389e('0x45'),_0x42578e['save_name']+'.'+_0x42578e[_0x389e('0x46')]))){throw new db[(_0x389e('0x47'))][(_0x389e('0x48'))]('Sound\x20not\x20found');}return _0x4cc367['download'](path[_0x389e('0x49')](config[_0x389e('0x44')],_0x389e('0x45'),util['format'](_0x389e('0x4a'),_0x42578e[_0x389e('0x4b')],_0x42578e[_0x389e('0x46')])),util['format'](_0x389e('0x4a'),_0x42578e[_0x389e('0x23')],_0x42578e['converted_format']));}return null;})[_0x389e('0x3b')](handleError(_0x4cc367,null));};exports['create']=function(_0x5d6507,_0x1a7362,_0x4ce93e){var _0x18a60f={'name':path[_0x389e('0x4c')](_0x5d6507[_0x389e('0x4d')]['originalname'],path[_0x389e('0x4e')](_0x5d6507[_0x389e('0x4d')][_0x389e('0x4f')])),'save_name':path[_0x389e('0x4c')](_0x5d6507['file'][_0x389e('0x50')],path['extname'](_0x5d6507[_0x389e('0x4d')][_0x389e('0x50')])),'original_format':path['extname'](_0x5d6507[_0x389e('0x4d')][_0x389e('0x4f')])[_0x389e('0x51')](0x1),'converted_format':_0x389e('0x52')};var _0x59b168=path[_0x389e('0x49')](config[_0x389e('0x44')],'server/files/sounds/original',_0x5d6507['file'][_0x389e('0x50')]);var _0x45dbc5=path['join'](config[_0x389e('0x44')],_0x389e('0x45'),util['format'](_0x389e('0x4a'),path[_0x389e('0x4c')](_0x5d6507[_0x389e('0x4d')][_0x389e('0x50')],path['extname'](_0x5d6507[_0x389e('0x4d')][_0x389e('0x50')])),_0x18a60f[_0x389e('0x46')]));logger[_0x389e('0x53')](_0x389e('0x54'),_0x59b168);logger[_0x389e('0x53')](_0x389e('0x55'),_0x45dbc5);try{fs[_0x389e('0x56')](_0x59b168,parseInt(_0x389e('0x57'),0x8));var _0x5bd1a8=sox['transcode'](_0x59b168,_0x45dbc5,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x5bd1a8['on'](_0x389e('0x21'),function(_0x9c1325){fs['unlinkSync'](_0x59b168);_0x1a7362['status'](0x1f4)[_0x389e('0x24')](_0x9c1325);});_0x5bd1a8['on'](_0x389e('0x58'),function(_0x1a9fd1){_0x18a60f[_0x389e('0x59')]=isNaN(_0x1a9fd1[_0x389e('0x5a')])?null:_0x1a9fd1[_0x389e('0x5a')]*0x3e8;_0x18a60f['original_sampleCount']=isNaN(_0x1a9fd1[_0x389e('0x5b')])?null:_0x1a9fd1['sampleCount'];_0x18a60f['original_channelCount']=isNaN(_0x1a9fd1[_0x389e('0x5c')])?null:_0x1a9fd1['channelCount'];_0x18a60f['original_bitRate']=isNaN(_0x1a9fd1['bitRate'])?null:_0x1a9fd1['bitRate'];_0x18a60f['original_sampleRate']=isNaN(_0x1a9fd1['sampleRate'])?null:_0x1a9fd1[_0x389e('0x5d')];});_0x5bd1a8['on'](_0x389e('0x5e'),function(_0x59c7a5){_0x18a60f[_0x389e('0x5f')]=isNaN(_0x59c7a5[_0x389e('0x5a')])?null:_0x59c7a5[_0x389e('0x5a')]*0x3e8;_0x18a60f[_0x389e('0x60')]=isNaN(_0x59c7a5[_0x389e('0x5b')])?null:_0x59c7a5[_0x389e('0x5b')];_0x18a60f[_0x389e('0x61')]=isNaN(_0x59c7a5[_0x389e('0x5c')])?null:_0x59c7a5[_0x389e('0x5c')];_0x18a60f[_0x389e('0x62')]=isNaN(_0x59c7a5[_0x389e('0x63')])?null:_0x59c7a5[_0x389e('0x63')];_0x18a60f['converted_sampleRate']=isNaN(_0x59c7a5[_0x389e('0x5d')])?null:_0x59c7a5['sampleRate'];});_0x5bd1a8['on'](_0x389e('0x20'),function(){fs['chmodSync'](_0x45dbc5,parseInt(_0x389e('0x57'),0x8));return db[_0x389e('0x27')][_0x389e('0x64')](_0x18a60f)['then'](function(_0x4a7608){var _0x12de6b={'role':_0x5d6507[_0x389e('0x65')]['role'],'userProfileId':_0x5d6507[_0x389e('0x65')][_0x389e('0x66')]};if(!_0x12de6b)throw new Error(_0x389e('0x67'));if(_0x12de6b['role']===_0x389e('0x68')){var _0x563511=_0x4a7608[_0x389e('0x1d')]({'plain':!![]});return db[_0x389e('0x69')][_0x389e('0x41')]({'where':{'name':'Sounds','userProfileId':_0x12de6b[_0x389e('0x66')]},'raw':!![]})[_0x389e('0x1c')](function(_0x5ca36d){if(_0x5ca36d&&_0x5ca36d[_0x389e('0x6a')]===0x0){return db[_0x389e('0x1f')]['create']({'name':_0x563511[_0x389e('0x23')],'resourceId':_0x563511['id'],'type':_0x5ca36d[_0x389e('0x23')],'sectionId':_0x5ca36d['id']},{})[_0x389e('0x1c')](function(){return _0x4a7608;});}else{return _0x4a7608;}})[_0x389e('0x3b')](function(_0x29e2f3){logger[_0x389e('0x21')](_0x389e('0x6b'),_0x29e2f3);throw _0x29e2f3;});}return _0x4a7608;})[_0x389e('0x1c')](respondWithResult(_0x1a7362,null))[_0x389e('0x3b')](handleError(_0x1a7362,null));});_0x5bd1a8[_0x389e('0x6c')]();}catch(_0x443297){_0x1a7362['status'](0x1f4)[_0x389e('0x24')](_0x443297);}};exports[_0x389e('0x1a')]=function(_0x24eb4a,_0x45ab7e,_0x3f477f){return db[_0x389e('0x27')][_0x389e('0x41')]({'where':{'id':_0x24eb4a[_0x389e('0x43')]['id']}})[_0x389e('0x1c')](handleEntityNotFound(_0x45ab7e,null))['then'](saveUpdates(_['pick'](_0x24eb4a[_0x389e('0x65')],[_0x389e('0x23'),'description']),null))[_0x389e('0x1c')](respondWithResult(_0x45ab7e,null))[_0x389e('0x3b')](handleError(_0x45ab7e,null));};exports[_0x389e('0x6d')]=function(_0x364252,_0x4ee2ec,_0x1bfaf8){return db[_0x389e('0x27')][_0x389e('0x41')]({'where':{'id':_0x364252[_0x389e('0x43')]['id']}})[_0x389e('0x1c')](function(_0x5ba432){if(_0x5ba432){return _0x5ba432[_0x389e('0x1b')]();}})[_0x389e('0x1c')](function(_0x5049cd){var _0xf6068=path[_0x389e('0x49')](config['root'],_0x389e('0x6e'),util['format'](_0x389e('0x4a'),_0x5049cd[_0x389e('0x4b')],_0x5049cd[_0x389e('0x6f')]));var _0x16859a=path[_0x389e('0x49')](config[_0x389e('0x44')],'server/files/sounds/converted',util[_0x389e('0x70')](_0x389e('0x4a'),_0x5049cd[_0x389e('0x4b')],_0x5049cd['converted_format']));fs[_0x389e('0x71')](_0xf6068);fs['unlinkSync'](_0x16859a);return _0x5049cd;})[_0x389e('0x1c')](function(_0x5051cc){if(_0x5051cc){return _0x4ee2ec[_0x389e('0x13')](0xcc)[_0x389e('0x20')]();}})[_0x389e('0x1c')](handleEntityNotFound(_0x4ee2ec,null))[_0x389e('0x3b')](handleError(_0x4ee2ec,null));}; \ No newline at end of file +var _0xf783=['converted_format','existsSync','join','root','server/files/sounds/converted','save_name','Sound\x20not\x20found','download','%s.%s','format','create','basename','originalname','file','filename','substring','wav','server/files/sounds/original','info','Sound\x20upload\x20destination:\x20%s','chmodSync','transcode','duration','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','converted_duration','converted_sampleCount','converted_bitRate','converted_sampleRate','0777','body','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','description','delete','unlinkSync','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','reject','save','then','destroy','get','Sounds','UserProfileResource','error','stack','name','send','map','Sound','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find'];(function(_0x466f2e,_0x5e2a7f){var _0x22dfbb=function(_0x308bbf){while(--_0x308bbf){_0x466f2e['push'](_0x466f2e['shift']());}};_0x22dfbb(++_0x5e2a7f);}(_0xf783,0xa7));var _0x3f78=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf783[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x3f78('0x0'));var rimraf=require(_0x3f78('0x1'));var zipdir=require(_0x3f78('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3f78('0x3'));var moment=require(_0x3f78('0x4'));var BPromise=require(_0x3f78('0x5'));var Mustache=require(_0x3f78('0x6'));var util=require(_0x3f78('0x7'));var path=require(_0x3f78('0x8'));var sox=require(_0x3f78('0x9'));var csv=require('to-csv');var ejs=require(_0x3f78('0xa'));var fs=require('fs');var fs_extra=require(_0x3f78('0xb'));var _=require('lodash');var squel=require(_0x3f78('0xc'));var crypto=require(_0x3f78('0xd'));var jsforce=require(_0x3f78('0xe'));var deskjs=require(_0x3f78('0xf'));var toCsv=require(_0x3f78('0x10'));var querystring=require(_0x3f78('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x3f78('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x3f78('0x13'));var hardwareService=require(_0x3f78('0x14'));var logger=require(_0x3f78('0x15'))(_0x3f78('0x16'));var utils=require(_0x3f78('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x3f78('0x18'));var db=require(_0x3f78('0x19'))['db'];function respondWithStatusCode(_0x2be61c,_0xbe4fac){_0xbe4fac=_0xbe4fac||0xcc;return function(_0x447c08){if(_0x447c08){return _0x2be61c[_0x3f78('0x1a')](_0xbe4fac);}return _0x2be61c[_0x3f78('0x1b')](_0xbe4fac)[_0x3f78('0x1c')]();};}function respondWithResult(_0x39c1ec,_0x23bd0b){_0x23bd0b=_0x23bd0b||0xc8;return function(_0x40efcc){if(_0x40efcc){return _0x39c1ec[_0x3f78('0x1b')](_0x23bd0b)[_0x3f78('0x1d')](_0x40efcc);}};}function respondWithFilteredResult(_0x23e837,_0x5aa173){return function(_0x1467d6){if(_0x1467d6){var _0x28c50d=typeof _0x5aa173['offset']===_0x3f78('0x1e')&&typeof _0x5aa173[_0x3f78('0x1f')]===_0x3f78('0x1e');var _0x5029f6=_0x1467d6['count'];var _0x30d6b=_0x28c50d?0x0:_0x5aa173[_0x3f78('0x20')];var _0x391d5b=_0x28c50d?_0x1467d6[_0x3f78('0x21')]:_0x5aa173['offset']+_0x5aa173[_0x3f78('0x1f')];var _0x3c8ddf;if(_0x391d5b>=_0x5029f6){_0x391d5b=_0x5029f6;_0x3c8ddf=0xc8;}else{_0x3c8ddf=0xce;}_0x23e837[_0x3f78('0x1b')](_0x3c8ddf);return _0x23e837[_0x3f78('0x22')](_0x3f78('0x23'),_0x30d6b+'-'+_0x391d5b+'/'+_0x5029f6)['json'](_0x1467d6);}return null;};}function patchUpdates(_0x2f170b){return function(_0x3ac071){try{jsonpatch['apply'](_0x3ac071,_0x2f170b,!![]);}catch(_0x487d10){return BPromise[_0x3f78('0x24')](_0x487d10);}return _0x3ac071[_0x3f78('0x25')]();};}function saveUpdates(_0x45fe7a,_0x16d28c){return function(_0x80315c){if(_0x80315c){return _0x80315c['update'](_0x45fe7a)[_0x3f78('0x26')](function(_0x3c42f1){return _0x3c42f1;});}return null;};}function removeEntity(_0x524743,_0x2567b8){return function(_0x14c1c9){if(_0x14c1c9){return _0x14c1c9[_0x3f78('0x27')]()['then'](function(){var _0x31e3e8=_0x14c1c9[_0x3f78('0x28')]({'plain':!![]});var _0x1306e9=_0x3f78('0x29');return db[_0x3f78('0x2a')][_0x3f78('0x27')]({'where':{'type':_0x1306e9,'resourceId':_0x31e3e8['id']}})[_0x3f78('0x26')](function(){return _0x14c1c9;});})[_0x3f78('0x26')](function(){_0x524743[_0x3f78('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ba1d8,_0x4b83a8){return function(_0x5b48fa){if(!_0x5b48fa){_0x2ba1d8[_0x3f78('0x1a')](0x194);}return _0x5b48fa;};}function handleError(_0xd1b4a4,_0x4d0667){_0x4d0667=_0x4d0667||0x1f4;return function(_0x216de8){logger[_0x3f78('0x2b')](_0x216de8[_0x3f78('0x2c')]);if(_0x216de8['name']){delete _0x216de8[_0x3f78('0x2d')];}_0xd1b4a4[_0x3f78('0x1b')](_0x4d0667)[_0x3f78('0x2e')](_0x216de8);};}exports['index']=function(_0x5478e7,_0x55b3b0){var _0x535f5f={},_0x493dca={},_0x3500b3={'count':0x0,'rows':[]};var _0x120774=_[_0x3f78('0x2f')](db[_0x3f78('0x30')][_0x3f78('0x31')],function(_0x2d637f){return{'name':_0x2d637f[_0x3f78('0x32')],'type':_0x2d637f[_0x3f78('0x33')][_0x3f78('0x34')]};});_0x493dca[_0x3f78('0x35')]=_[_0x3f78('0x2f')](_0x120774,_0x3f78('0x2d'));_0x493dca[_0x3f78('0x36')]=_[_0x3f78('0x37')](_0x5478e7[_0x3f78('0x36')]);_0x493dca[_0x3f78('0x38')]=_[_0x3f78('0x39')](_0x493dca['model'],_0x493dca[_0x3f78('0x36')]);_0x535f5f[_0x3f78('0x3a')]=_[_0x3f78('0x39')](_0x493dca[_0x3f78('0x35')],qs[_0x3f78('0x3b')](_0x5478e7[_0x3f78('0x36')][_0x3f78('0x3b')]));_0x535f5f[_0x3f78('0x3a')]=_0x535f5f['attributes']['length']?_0x535f5f[_0x3f78('0x3a')]:_0x493dca['model'];if(!_0x5478e7['query'][_0x3f78('0x3c')](_0x3f78('0x3d'))){_0x535f5f[_0x3f78('0x1f')]=qs[_0x3f78('0x1f')](_0x5478e7[_0x3f78('0x36')][_0x3f78('0x1f')]);_0x535f5f[_0x3f78('0x20')]=qs[_0x3f78('0x20')](_0x5478e7[_0x3f78('0x36')]['offset']);}_0x535f5f[_0x3f78('0x3e')]=qs[_0x3f78('0x3f')](_0x5478e7['query'][_0x3f78('0x3f')]);_0x535f5f['where']=qs[_0x3f78('0x38')](_[_0x3f78('0x40')](_0x5478e7['query'],_0x493dca[_0x3f78('0x38')]),_0x120774);if(_0x5478e7[_0x3f78('0x36')][_0x3f78('0x41')]){_0x535f5f['where']=_[_0x3f78('0x42')](_0x535f5f[_0x3f78('0x43')],{'$or':_[_0x3f78('0x2f')](_0x120774,function(_0x509a3c){if(_0x509a3c[_0x3f78('0x33')]!==_0x3f78('0x44')){var _0x208042={};_0x208042[_0x509a3c['name']]={'$like':'%'+_0x5478e7[_0x3f78('0x36')][_0x3f78('0x41')]+'%'};return _0x208042;}})});}_0x535f5f=_[_0x3f78('0x42')]({},_0x535f5f,_0x5478e7[_0x3f78('0x45')]);var _0x59422a={'where':_0x535f5f[_0x3f78('0x43')]};return db[_0x3f78('0x30')]['count'](_0x59422a)[_0x3f78('0x26')](function(_0x296307){_0x3500b3[_0x3f78('0x21')]=_0x296307;if(_0x5478e7['query'][_0x3f78('0x46')]){_0x535f5f[_0x3f78('0x47')]=[{'all':!![]}];}return db['Sound'][_0x3f78('0x48')](_0x535f5f);})[_0x3f78('0x26')](function(_0x5cc101){_0x3500b3[_0x3f78('0x49')]=_0x5cc101;return _0x3500b3;})[_0x3f78('0x26')](respondWithFilteredResult(_0x55b3b0,_0x535f5f))[_0x3f78('0x4a')](handleError(_0x55b3b0,null));};exports[_0x3f78('0x4b')]=function(_0x17edda,_0x108b42){var _0x6aa2a3={'raw':!![],'where':{'id':_0x17edda[_0x3f78('0x4c')]['id']}},_0x1562e2={};_0x1562e2[_0x3f78('0x35')]=_[_0x3f78('0x37')](db[_0x3f78('0x30')][_0x3f78('0x31')]);_0x1562e2[_0x3f78('0x36')]=_[_0x3f78('0x37')](_0x17edda[_0x3f78('0x36')]);_0x1562e2[_0x3f78('0x38')]=_['intersection'](_0x1562e2['model'],_0x1562e2[_0x3f78('0x36')]);_0x6aa2a3[_0x3f78('0x3a')]=_['intersection'](_0x1562e2[_0x3f78('0x35')],qs['fields'](_0x17edda[_0x3f78('0x36')][_0x3f78('0x3b')]));_0x6aa2a3[_0x3f78('0x3a')]=_0x6aa2a3[_0x3f78('0x3a')][_0x3f78('0x4d')]?_0x6aa2a3[_0x3f78('0x3a')]:_0x1562e2[_0x3f78('0x35')];if(_0x17edda[_0x3f78('0x36')][_0x3f78('0x46')]){_0x6aa2a3[_0x3f78('0x47')]=[{'all':!![]}];}_0x6aa2a3=_[_0x3f78('0x42')]({},_0x6aa2a3,_0x17edda[_0x3f78('0x45')]);return db[_0x3f78('0x30')][_0x3f78('0x4e')](_0x6aa2a3)[_0x3f78('0x26')](handleEntityNotFound(_0x108b42,null))[_0x3f78('0x26')](respondWithResult(_0x108b42,null))['catch'](handleError(_0x108b42,null));};exports['download']=function(_0x333851,_0x4699fd,_0x503535){return db[_0x3f78('0x30')][_0x3f78('0x4e')]({'where':{'id':_0x333851[_0x3f78('0x4c')]['id']},'attributes':[_0x3f78('0x2d'),'save_name',_0x3f78('0x4f')],'raw':!![]})['then'](handleEntityNotFound(_0x4699fd,null))[_0x3f78('0x26')](function(_0x11ba10){if(_0x11ba10){if(!fs[_0x3f78('0x50')](path[_0x3f78('0x51')](config[_0x3f78('0x52')],_0x3f78('0x53'),_0x11ba10[_0x3f78('0x54')]+'.'+_0x11ba10['converted_format']))){throw new db['Sequelize']['ValidationError'](_0x3f78('0x55'));}return _0x4699fd[_0x3f78('0x56')](path[_0x3f78('0x51')](config[_0x3f78('0x52')],_0x3f78('0x53'),util['format'](_0x3f78('0x57'),_0x11ba10[_0x3f78('0x54')],_0x11ba10[_0x3f78('0x4f')])),util[_0x3f78('0x58')](_0x3f78('0x57'),_0x11ba10[_0x3f78('0x2d')],_0x11ba10[_0x3f78('0x4f')]));}return null;})[_0x3f78('0x4a')](handleError(_0x4699fd,null));};exports[_0x3f78('0x59')]=function(_0x67f5e,_0x2413d9,_0xec9ce){var _0x1c202b={'name':path[_0x3f78('0x5a')](_0x67f5e['file'][_0x3f78('0x5b')],path['extname'](_0x67f5e[_0x3f78('0x5c')][_0x3f78('0x5b')])),'save_name':path['basename'](_0x67f5e['file'][_0x3f78('0x5d')],path['extname'](_0x67f5e[_0x3f78('0x5c')]['filename'])),'original_format':path['extname'](_0x67f5e[_0x3f78('0x5c')][_0x3f78('0x5b')])[_0x3f78('0x5e')](0x1),'converted_format':_0x3f78('0x5f')};var _0x52d89a=path[_0x3f78('0x51')](config[_0x3f78('0x52')],_0x3f78('0x60'),_0x67f5e[_0x3f78('0x5c')][_0x3f78('0x5d')]);var _0x15efcc=path[_0x3f78('0x51')](config[_0x3f78('0x52')],'server/files/sounds/converted',util[_0x3f78('0x58')](_0x3f78('0x57'),path[_0x3f78('0x5a')](_0x67f5e['file']['filename'],path['extname'](_0x67f5e['file']['filename'])),_0x1c202b[_0x3f78('0x4f')]));logger[_0x3f78('0x61')]('Sound\x20upload\x20filepath:\x20%s',_0x52d89a);logger[_0x3f78('0x61')](_0x3f78('0x62'),_0x15efcc);try{fs[_0x3f78('0x63')](_0x52d89a,parseInt('0777',0x8));var _0x401796=sox[_0x3f78('0x64')](_0x52d89a,_0x15efcc,{'sampleRate':0x1f40,'format':_0x3f78('0x5f'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x401796['on'](_0x3f78('0x2b'),function(_0x1ef7c7){fs['unlinkSync'](_0x52d89a);_0x2413d9[_0x3f78('0x1b')](0x1f4)['send'](_0x1ef7c7);});_0x401796['on']('src',function(_0x4d3606){_0x1c202b['original_duration']=isNaN(_0x4d3606[_0x3f78('0x65')])?null:_0x4d3606[_0x3f78('0x65')]*0x3e8;_0x1c202b['original_sampleCount']=isNaN(_0x4d3606[_0x3f78('0x66')])?null:_0x4d3606[_0x3f78('0x66')];_0x1c202b[_0x3f78('0x67')]=isNaN(_0x4d3606[_0x3f78('0x68')])?null:_0x4d3606[_0x3f78('0x68')];_0x1c202b[_0x3f78('0x69')]=isNaN(_0x4d3606[_0x3f78('0x6a')])?null:_0x4d3606[_0x3f78('0x6a')];_0x1c202b[_0x3f78('0x6b')]=isNaN(_0x4d3606[_0x3f78('0x6c')])?null:_0x4d3606[_0x3f78('0x6c')];});_0x401796['on']('dest',function(_0x4d72ba){_0x1c202b[_0x3f78('0x6d')]=isNaN(_0x4d72ba[_0x3f78('0x65')])?null:_0x4d72ba[_0x3f78('0x65')]*0x3e8;_0x1c202b[_0x3f78('0x6e')]=isNaN(_0x4d72ba[_0x3f78('0x66')])?null:_0x4d72ba[_0x3f78('0x66')];_0x1c202b['converted_channelCount']=isNaN(_0x4d72ba[_0x3f78('0x68')])?null:_0x4d72ba[_0x3f78('0x68')];_0x1c202b[_0x3f78('0x6f')]=isNaN(_0x4d72ba[_0x3f78('0x6a')])?null:_0x4d72ba['bitRate'];_0x1c202b[_0x3f78('0x70')]=isNaN(_0x4d72ba[_0x3f78('0x6c')])?null:_0x4d72ba[_0x3f78('0x6c')];});_0x401796['on'](_0x3f78('0x1c'),function(){fs[_0x3f78('0x63')](_0x15efcc,parseInt(_0x3f78('0x71'),0x8));return db[_0x3f78('0x30')][_0x3f78('0x59')](_0x1c202b)[_0x3f78('0x26')](function(_0x53b257){var _0x497831={'role':_0x67f5e[_0x3f78('0x72')][_0x3f78('0x73')],'userProfileId':_0x67f5e['body'][_0x3f78('0x74')]};if(!_0x497831)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x497831[_0x3f78('0x73')]==='user'){var _0x15a8ce=_0x53b257[_0x3f78('0x28')]({'plain':!![]});return db['UserProfileSection'][_0x3f78('0x4e')]({'where':{'name':_0x3f78('0x29'),'userProfileId':_0x497831[_0x3f78('0x74')]},'raw':!![]})['then'](function(_0x439916){if(_0x439916&&_0x439916[_0x3f78('0x75')]===0x0){return db[_0x3f78('0x2a')][_0x3f78('0x59')]({'name':_0x15a8ce[_0x3f78('0x2d')],'resourceId':_0x15a8ce['id'],'type':_0x439916[_0x3f78('0x2d')],'sectionId':_0x439916['id']},{})[_0x3f78('0x26')](function(){return _0x53b257;});}else{return _0x53b257;}})[_0x3f78('0x4a')](function(_0xba1773){logger[_0x3f78('0x2b')](_0x3f78('0x76'),_0xba1773);throw _0xba1773;});}return _0x53b257;})[_0x3f78('0x26')](respondWithResult(_0x2413d9,null))[_0x3f78('0x4a')](handleError(_0x2413d9,null));});_0x401796[_0x3f78('0x77')]();}catch(_0x423afb){_0x2413d9['status'](0x1f4)['send'](_0x423afb);}};exports['update']=function(_0x366b06,_0x4733ad,_0x23caa0){return db[_0x3f78('0x30')][_0x3f78('0x4e')]({'where':{'id':_0x366b06[_0x3f78('0x4c')]['id']}})[_0x3f78('0x26')](handleEntityNotFound(_0x4733ad,null))[_0x3f78('0x26')](saveUpdates(_['pick'](_0x366b06[_0x3f78('0x72')],['name',_0x3f78('0x78')]),null))[_0x3f78('0x26')](respondWithResult(_0x4733ad,null))['catch'](handleError(_0x4733ad,null));};exports[_0x3f78('0x79')]=function(_0x3e88ac,_0x3965eb,_0x3e1c1e){return db[_0x3f78('0x30')][_0x3f78('0x4e')]({'where':{'id':_0x3e88ac['params']['id']}})[_0x3f78('0x26')](function(_0x1fd86d){if(_0x1fd86d){return _0x1fd86d['destroy']();}})[_0x3f78('0x26')](function(_0x216eb4){var _0x4313d1=path['join'](config[_0x3f78('0x52')],_0x3f78('0x60'),util[_0x3f78('0x58')](_0x3f78('0x57'),_0x216eb4[_0x3f78('0x54')],_0x216eb4['original_format']));var _0xb14edd=path[_0x3f78('0x51')](config['root'],_0x3f78('0x53'),util[_0x3f78('0x58')]('%s.%s',_0x216eb4['save_name'],_0x216eb4[_0x3f78('0x4f')]));fs[_0x3f78('0x7a')](_0x4313d1);fs[_0x3f78('0x7a')](_0xb14edd);return _0x216eb4;})[_0x3f78('0x26')](function(_0x257d9c){if(_0x257d9c){return _0x3965eb[_0x3f78('0x1b')](0xcc)[_0x3f78('0x1c')]();}})[_0x3f78('0x26')](handleEntityNotFound(_0x3965eb,null))[_0x3f78('0x4a')](handleError(_0x3965eb,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index 54fb59c..3563f40 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 _0xf005=['exports','define','Sound','tools_sounds','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./sound.attributes'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf005,0x124));var _0x5f00=function(_0x5ba0ff,_0x57bac1){_0x5ba0ff=_0x5ba0ff-0x0;var _0x53ff7b=_0xf005[_0x5ba0ff];return _0x53ff7b;};'use strict';var _=require('lodash');var util=require(_0x5f00('0x0'));var logger=require(_0x5f00('0x1'))('api');var moment=require(_0x5f00('0x2'));var BPromise=require(_0x5f00('0x3'));var rp=require(_0x5f00('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5f00('0x5'));var config=require(_0x5f00('0x6'));var attributes=require(_0x5f00('0x7'));module[_0x5f00('0x8')]=function(_0x218b7d,_0x4ccb11){return _0x218b7d[_0x5f00('0x9')](_0x5f00('0xa'),attributes,{'tableName':_0x5f00('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1087=['define','Sound','lodash','../../config/logger','api','moment','rimraf','../../config/environment','./sound.attributes'];(function(_0x289710,_0x523524){var _0x5bf7b1=function(_0x466e31){while(--_0x466e31){_0x289710['push'](_0x289710['shift']());}};_0x5bf7b1(++_0x523524);}(_0x1087,0xad));var _0x7108=function(_0xedbc0,_0x4ec66f){_0xedbc0=_0xedbc0-0x0;var _0x3318c5=_0x1087[_0xedbc0];return _0x3318c5;};'use strict';var _=require(_0x7108('0x0'));var util=require('util');var logger=require(_0x7108('0x1'))(_0x7108('0x2'));var moment=require(_0x7108('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x7108('0x4'));var config=require(_0x7108('0x5'));var attributes=require(_0x7108('0x6'));module['exports']=function(_0x11eccd,_0x421a1c){return _0x11eccd[_0x7108('0x7')](_0x7108('0x8'),attributes,{'tableName':'tools_sounds','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/sound/sound.rpc.js b/server/api/sound/sound.rpc.js index 051c656..5b9f70c 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 _0xc703=['then','Sound,\x20%s,\x20%s','debug','Sound,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','ShowSound','Sound','options','where','attributes','include','map','model','lodash','util','moment','randomstring','ioredis','../../config/logger','rpc','jayson/promise','http','request'];(function(_0x2ed5d8,_0x738134){var _0x27724a=function(_0x439e44){while(--_0x439e44){_0x2ed5d8['push'](_0x2ed5d8['shift']());}};_0x27724a(++_0x738134);}(_0xc703,0x1e3));var _0x3c70=function(_0x141dd8,_0x48363d){_0x141dd8=_0x141dd8-0x0;var _0x348080=_0xc703[_0x141dd8];return _0x348080;};'use strict';var _=require(_0x3c70('0x0'));var util=require(_0x3c70('0x1'));var moment=require(_0x3c70('0x2'));var BPromise=require('bluebird');var rs=require(_0x3c70('0x3'));var fs=require('fs');var Redis=require(_0x3c70('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3c70('0x5'))(_0x3c70('0x6'));var config=require('../../config/environment');var jayson=require(_0x3c70('0x7'));var client=jayson['client'][_0x3c70('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3a9cad,_0x96732a,_0x4d70b4){return new BPromise(function(_0x1e0d02,_0x30d021){return client[_0x3c70('0x9')](_0x3a9cad,_0x4d70b4)[_0x3c70('0xa')](function(_0x268f97){logger['info'](_0x3c70('0xb'),_0x96732a,'request\x20sent');logger[_0x3c70('0xc')](_0x3c70('0xd'),_0x96732a,_0x3c70('0xe'),JSON[_0x3c70('0xf')](_0x268f97));if(_0x268f97[_0x3c70('0x10')]){if(_0x268f97[_0x3c70('0x10')][_0x3c70('0x11')]===0x1f4){logger['error']('Sound,\x20%s,\x20%s',_0x96732a,_0x268f97[_0x3c70('0x10')][_0x3c70('0x12')]);return _0x30d021(_0x268f97[_0x3c70('0x10')][_0x3c70('0x12')]);}logger[_0x3c70('0x10')]('Sound,\x20%s,\x20%s',_0x96732a,_0x268f97[_0x3c70('0x10')][_0x3c70('0x12')]);return _0x1e0d02(_0x268f97[_0x3c70('0x10')]['message']);}else{logger[_0x3c70('0x13')](_0x3c70('0xb'),_0x96732a,_0x3c70('0xe'));_0x1e0d02(_0x268f97[_0x3c70('0x14')][_0x3c70('0x12')]);}})['catch'](function(_0x380155){logger[_0x3c70('0x10')](_0x3c70('0xb'),_0x96732a,_0x380155);_0x30d021(_0x380155);});});}exports[_0x3c70('0x15')]=function(_0x32101b){var _0x359285=this;return new Promise(function(_0x42dfe9,_0x1f6fe5){return db[_0x3c70('0x16')]['find']({'raw':_0x32101b[_0x3c70('0x17')]?_0x32101b[_0x3c70('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x32101b[_0x3c70('0x17')]?_0x32101b[_0x3c70('0x17')][_0x3c70('0x18')]||null:null,'attributes':_0x32101b[_0x3c70('0x17')]?_0x32101b[_0x3c70('0x17')][_0x3c70('0x19')]||null:null,'include':_0x32101b[_0x3c70('0x17')]?_0x32101b[_0x3c70('0x17')][_0x3c70('0x1a')]?_[_0x3c70('0x1b')](_0x32101b['options'][_0x3c70('0x1a')],function(_0x328fd4){return{'model':db[_0x328fd4[_0x3c70('0x1c')]],'as':_0x328fd4['as'],'attributes':_0x328fd4[_0x3c70('0x19')],'include':_0x328fd4[_0x3c70('0x1a')]?_[_0x3c70('0x1b')](_0x328fd4['include'],function(_0x2655d9){return{'model':db[_0x2655d9['model']],'as':_0x2655d9['as'],'attributes':_0x2655d9['attributes'],'include':_0x2655d9[_0x3c70('0x1a')]?_[_0x3c70('0x1b')](_0x2655d9[_0x3c70('0x1a')],function(_0x394dd4){return{'model':db[_0x394dd4['model']],'as':_0x394dd4['as'],'attributes':_0x394dd4['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1cb6ab){logger['info']('ShowSound',_0x32101b);logger[_0x3c70('0xc')](_0x3c70('0x15'),_0x32101b,JSON['stringify'](_0x1cb6ab));_0x42dfe9(_0x1cb6ab);})['catch'](function(_0x4598ac){logger['error'](_0x3c70('0x15'),_0x4598ac[_0x3c70('0x12')],_0x32101b);_0x1f6fe5(_0x359285['error'](0x1f4,_0x4598ac[_0x3c70('0x12')]));});});}; \ No newline at end of file +var _0xd471=['raw','where','attributes','include','map','model','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','Sound,\x20%s,\x20%s','message','info','catch','ShowSound','Sound','find','options'];(function(_0x71b765,_0x3053f8){var _0x34cb24=function(_0x2dd237){while(--_0x2dd237){_0x71b765['push'](_0x71b765['shift']());}};_0x34cb24(++_0x3053f8);}(_0xd471,0x6c));var _0x1d47=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd471[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x1d47('0x0'));var util=require('util');var moment=require(_0x1d47('0x1'));var BPromise=require(_0x1d47('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1d47('0x3'));var db=require(_0x1d47('0x4'))['db'];var utils=require(_0x1d47('0x5'));var logger=require(_0x1d47('0x6'))(_0x1d47('0x7'));var config=require(_0x1d47('0x8'));var jayson=require(_0x1d47('0x9'));var client=jayson[_0x1d47('0xa')][_0x1d47('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x17376a,_0x163e4,_0x39b863){return new BPromise(function(_0x43f0b8,_0x3bb6ec){return client[_0x1d47('0xc')](_0x17376a,_0x39b863)[_0x1d47('0xd')](function(_0x334a29){logger['info']('Sound,\x20%s,\x20%s',_0x163e4,_0x1d47('0xe'));logger[_0x1d47('0xf')](_0x1d47('0x10'),_0x163e4,_0x1d47('0xe'),JSON[_0x1d47('0x11')](_0x334a29));if(_0x334a29[_0x1d47('0x12')]){if(_0x334a29[_0x1d47('0x12')][_0x1d47('0x13')]===0x1f4){logger['error'](_0x1d47('0x14'),_0x163e4,_0x334a29[_0x1d47('0x12')][_0x1d47('0x15')]);return _0x3bb6ec(_0x334a29[_0x1d47('0x12')]['message']);}logger['error'](_0x1d47('0x14'),_0x163e4,_0x334a29[_0x1d47('0x12')][_0x1d47('0x15')]);return _0x43f0b8(_0x334a29[_0x1d47('0x12')][_0x1d47('0x15')]);}else{logger[_0x1d47('0x16')](_0x1d47('0x14'),_0x163e4,_0x1d47('0xe'));_0x43f0b8(_0x334a29['result'][_0x1d47('0x15')]);}})[_0x1d47('0x17')](function(_0x3bff33){logger[_0x1d47('0x12')](_0x1d47('0x14'),_0x163e4,_0x3bff33);_0x3bb6ec(_0x3bff33);});});}exports[_0x1d47('0x18')]=function(_0xe47edf){var _0x3d8250=this;return new Promise(function(_0x39bcb1,_0x49c71d){return db[_0x1d47('0x19')][_0x1d47('0x1a')]({'raw':_0xe47edf[_0x1d47('0x1b')]?_0xe47edf[_0x1d47('0x1b')][_0x1d47('0x1c')]===undefined?!![]:![]:!![],'where':_0xe47edf[_0x1d47('0x1b')]?_0xe47edf[_0x1d47('0x1b')][_0x1d47('0x1d')]||null:null,'attributes':_0xe47edf[_0x1d47('0x1b')]?_0xe47edf['options'][_0x1d47('0x1e')]||null:null,'include':_0xe47edf[_0x1d47('0x1b')]?_0xe47edf['options'][_0x1d47('0x1f')]?_[_0x1d47('0x20')](_0xe47edf[_0x1d47('0x1b')][_0x1d47('0x1f')],function(_0x571b69){return{'model':db[_0x571b69[_0x1d47('0x21')]],'as':_0x571b69['as'],'attributes':_0x571b69[_0x1d47('0x1e')],'include':_0x571b69[_0x1d47('0x1f')]?_['map'](_0x571b69[_0x1d47('0x1f')],function(_0x225152){return{'model':db[_0x225152[_0x1d47('0x21')]],'as':_0x225152['as'],'attributes':_0x225152[_0x1d47('0x1e')],'include':_0x225152['include']?_[_0x1d47('0x20')](_0x225152['include'],function(_0x34ba45){return{'model':db[_0x34ba45['model']],'as':_0x34ba45['as'],'attributes':_0x34ba45[_0x1d47('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x1d47('0xd')](function(_0x5261fc){logger[_0x1d47('0x16')](_0x1d47('0x18'),_0xe47edf);logger[_0x1d47('0xf')](_0x1d47('0x18'),_0xe47edf,JSON[_0x1d47('0x11')](_0x5261fc));_0x39bcb1(_0x5261fc);})[_0x1d47('0x17')](function(_0x5997ff){logger['error'](_0x1d47('0x18'),_0x5997ff[_0x1d47('0x15')],_0xe47edf);_0x49c71d(_0x3d8250[_0x1d47('0x12')](0x1f4,_0x5997ff[_0x1d47('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index 4a12162..0614be4 100644 --- a/server/api/squareMessage/index.js +++ b/server/api/squareMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9ffd=['util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./squareMessage.controller','isAuthenticated','index','get','/:id','show','post','create','delete','destroy','exports','multer'];(function(_0x602ca8,_0x568e82){var _0x26e8ab=function(_0x3fb700){while(--_0x3fb700){_0x602ca8['push'](_0x602ca8['shift']());}};_0x26e8ab(++_0x568e82);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x486a51,_0x15e1b1){_0x486a51=_0x486a51-0x0;var _0x2abad3=_0x9ffd[_0x486a51];return _0x2abad3;};'use strict';var multer=require(_0xd9ff('0x0'));var util=require(_0xd9ff('0x1'));var path=require(_0xd9ff('0x2'));var timeout=require('connect-timeout');var express=require(_0xd9ff('0x3'));var router=express[_0xd9ff('0x4')]();var fs_extra=require(_0xd9ff('0x5'));var auth=require(_0xd9ff('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd9ff('0x7'));var controller=require(_0xd9ff('0x8'));router['get']('/',auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xa')]);router[_0xd9ff('0xb')](_0xd9ff('0xc'),auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xd')]);router[_0xd9ff('0xe')]('/',auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xf')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0xd9ff('0x10')](_0xd9ff('0xc'),auth[_0xd9ff('0x9')](),controller[_0xd9ff('0x11')]);module[_0xd9ff('0x12')]=router; \ No newline at end of file +var _0x9ffd=['util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./squareMessage.controller','isAuthenticated','index','get','/:id','show','post','create','delete','destroy','exports','multer'];(function(_0x56fe98,_0x43dc16){var _0x212f4f=function(_0xc3427d){while(--_0xc3427d){_0x56fe98['push'](_0x56fe98['shift']());}};_0x212f4f(++_0x43dc16);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x201be4,_0xce265e){_0x201be4=_0x201be4-0x0;var _0x31e220=_0x9ffd[_0x201be4];return _0x31e220;};'use strict';var multer=require(_0xd9ff('0x0'));var util=require(_0xd9ff('0x1'));var path=require(_0xd9ff('0x2'));var timeout=require('connect-timeout');var express=require(_0xd9ff('0x3'));var router=express[_0xd9ff('0x4')]();var fs_extra=require(_0xd9ff('0x5'));var auth=require(_0xd9ff('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd9ff('0x7'));var controller=require(_0xd9ff('0x8'));router['get']('/',auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xa')]);router[_0xd9ff('0xb')](_0xd9ff('0xc'),auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xd')]);router[_0xd9ff('0xe')]('/',auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xf')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0xd9ff('0x10')](_0xd9ff('0xc'),auth[_0xd9ff('0x9')](),controller[_0xd9ff('0x11')]);module[_0xd9ff('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index 0d62ee7..061cf11 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 _0x9016=['medium','ENUM','out','STRING','sequelize','exports','TEXT'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x9016,0xa5));var _0x6901=function(_0x90cc8,_0x4b75c9){_0x90cc8=_0x90cc8-0x0;var _0x4bf32a=_0x9016[_0x90cc8];return _0x4bf32a;};'use strict';var Sequelize=require(_0x6901('0x0'));module[_0x6901('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'body':{'type':Sequelize[_0x6901('0x2')](_0x6901('0x3')),'allowNull':![]},'direction':{'type':Sequelize[_0x6901('0x4')]('in',_0x6901('0x5')),'defaultValue':_0x6901('0x5'),'allowNull':![]},'providerName':{'type':Sequelize[_0x6901('0x6')]},'providerResponse':{'type':Sequelize[_0x6901('0x2')]}}; \ No newline at end of file +var _0x4f96=['sequelize','exports','out','TEXT'];(function(_0x308c00,_0x3cbd67){var _0x2b21b2=function(_0x4ce3fc){while(--_0x4ce3fc){_0x308c00['push'](_0x308c00['shift']());}};_0x2b21b2(++_0x3cbd67);}(_0x4f96,0xbc));var _0x64f9=function(_0x369e54,_0x17530a){_0x369e54=_0x369e54-0x0;var _0x3b5b5b=_0x4f96[_0x369e54];return _0x3b5b5b;};'use strict';var Sequelize=require(_0x64f9('0x0'));module[_0x64f9('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in',_0x64f9('0x2')),'defaultValue':_0x64f9('0x2'),'allowNull':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x64f9('0x3')]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index e10564f..cf9ab07 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 _0xa9b2=['params','length','find','create','body','update','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','status','json','limit','count','offset','Content-Range','apply','save','then','destroy','end','sendStatus','error','stack','name','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','SquareMessage','findAll','rows','catch','show'];(function(_0x37ae2e,_0x35be3a){var _0x19c50f=function(_0x49732a){while(--_0x49732a){_0x37ae2e['push'](_0x37ae2e['shift']());}};_0x19c50f(++_0x35be3a);}(_0xa9b2,0xde));var _0x2a9b=function(_0x5c7e53,_0x174ce5){_0x5c7e53=_0x5c7e53-0x0;var _0x1c9af9=_0xa9b2[_0x5c7e53];return _0x1c9af9;};'use strict';var emlformat=require(_0x2a9b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2a9b('0x1'));var jsonpatch=require(_0x2a9b('0x2'));var rp=require(_0x2a9b('0x3'));var moment=require(_0x2a9b('0x4'));var BPromise=require(_0x2a9b('0x5'));var Mustache=require(_0x2a9b('0x6'));var util=require(_0x2a9b('0x7'));var path=require(_0x2a9b('0x8'));var sox=require(_0x2a9b('0x9'));var csv=require(_0x2a9b('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2a9b('0xb'));var _=require(_0x2a9b('0xc'));var squel=require('squel');var crypto=require(_0x2a9b('0xd'));var jsforce=require(_0x2a9b('0xe'));var deskjs=require(_0x2a9b('0xf'));var toCsv=require(_0x2a9b('0xa'));var querystring=require(_0x2a9b('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2a9b('0x11'));var as=require(_0x2a9b('0x12'));var hardwareService=require(_0x2a9b('0x13'));var logger=require(_0x2a9b('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2a9b('0x15'));var db=require(_0x2a9b('0x16'))['db'];function respondWithStatusCode(_0x365287,_0x66991d){_0x66991d=_0x66991d||0xcc;return function(_0x15889e){if(_0x15889e){return _0x365287['sendStatus'](_0x66991d);}return _0x365287[_0x2a9b('0x17')](_0x66991d)['end']();};}function respondWithResult(_0xc8b1eb,_0x4f2e0a){_0x4f2e0a=_0x4f2e0a||0xc8;return function(_0x16c71c){if(_0x16c71c){return _0xc8b1eb[_0x2a9b('0x17')](_0x4f2e0a)[_0x2a9b('0x18')](_0x16c71c);}};}function respondWithFilteredResult(_0x1857fe,_0x1ef061){return function(_0xeca51b){if(_0xeca51b){var _0x56499f=typeof _0x1ef061['offset']==='undefined'&&typeof _0x1ef061[_0x2a9b('0x19')]==='undefined';var _0x2a94c8=_0xeca51b[_0x2a9b('0x1a')];var _0x536cba=_0x56499f?0x0:_0x1ef061['offset'];var _0x3caa0e=_0x56499f?_0xeca51b['count']:_0x1ef061[_0x2a9b('0x1b')]+_0x1ef061['limit'];var _0x258e60;if(_0x3caa0e>=_0x2a94c8){_0x3caa0e=_0x2a94c8;_0x258e60=0xc8;}else{_0x258e60=0xce;}_0x1857fe[_0x2a9b('0x17')](_0x258e60);return _0x1857fe['set'](_0x2a9b('0x1c'),_0x536cba+'-'+_0x3caa0e+'/'+_0x2a94c8)[_0x2a9b('0x18')](_0xeca51b);}return null;};}function patchUpdates(_0x100bdc){return function(_0x1eae90){try{jsonpatch[_0x2a9b('0x1d')](_0x1eae90,_0x100bdc,!![]);}catch(_0x252a2f){return BPromise['reject'](_0x252a2f);}return _0x1eae90[_0x2a9b('0x1e')]();};}function saveUpdates(_0x32a13c,_0x3f93a7){return function(_0x3c3743){if(_0x3c3743){return _0x3c3743['update'](_0x32a13c)[_0x2a9b('0x1f')](function(_0x4c108c){return _0x4c108c;});}return null;};}function removeEntity(_0x4dc30c,_0xfc2ee7){return function(_0x1becb0){if(_0x1becb0){return _0x1becb0[_0x2a9b('0x20')]()[_0x2a9b('0x1f')](function(){_0x4dc30c[_0x2a9b('0x17')](0xcc)[_0x2a9b('0x21')]();});}};}function handleEntityNotFound(_0x5da9d9,_0x2f3653){return function(_0x8bb928){if(!_0x8bb928){_0x5da9d9[_0x2a9b('0x22')](0x194);}return _0x8bb928;};}function handleError(_0x26f760,_0x568911){_0x568911=_0x568911||0x1f4;return function(_0x253ce6){logger[_0x2a9b('0x23')](_0x253ce6[_0x2a9b('0x24')]);if(_0x253ce6[_0x2a9b('0x25')]){delete _0x253ce6[_0x2a9b('0x25')];}_0x26f760[_0x2a9b('0x17')](_0x568911)['send'](_0x253ce6);};}exports[_0x2a9b('0x26')]=function(_0x4789fe,_0x1b36e3){var _0x486b19={},_0x211cd8={},_0x2e0e99={'count':0x0,'rows':[]};var _0x247089=_[_0x2a9b('0x27')](db['SquareMessage'][_0x2a9b('0x28')],function(_0x30f926){return{'name':_0x30f926[_0x2a9b('0x29')],'type':_0x30f926[_0x2a9b('0x2a')]['key']};});_0x211cd8[_0x2a9b('0x2b')]=_[_0x2a9b('0x27')](_0x247089,_0x2a9b('0x25'));_0x211cd8[_0x2a9b('0x2c')]=_[_0x2a9b('0x2d')](_0x4789fe[_0x2a9b('0x2c')]);_0x211cd8[_0x2a9b('0x2e')]=_['intersection'](_0x211cd8[_0x2a9b('0x2b')],_0x211cd8[_0x2a9b('0x2c')]);_0x486b19['attributes']=_[_0x2a9b('0x2f')](_0x211cd8[_0x2a9b('0x2b')],qs[_0x2a9b('0x30')](_0x4789fe[_0x2a9b('0x2c')][_0x2a9b('0x30')]));_0x486b19[_0x2a9b('0x31')]=_0x486b19[_0x2a9b('0x31')]['length']?_0x486b19[_0x2a9b('0x31')]:_0x211cd8[_0x2a9b('0x2b')];if(!_0x4789fe[_0x2a9b('0x2c')][_0x2a9b('0x32')](_0x2a9b('0x33'))){_0x486b19[_0x2a9b('0x19')]=qs['limit'](_0x4789fe[_0x2a9b('0x2c')]['limit']);_0x486b19[_0x2a9b('0x1b')]=qs[_0x2a9b('0x1b')](_0x4789fe['query']['offset']);}_0x486b19[_0x2a9b('0x34')]=qs[_0x2a9b('0x35')](_0x4789fe['query']['sort']);_0x486b19[_0x2a9b('0x36')]=qs[_0x2a9b('0x2e')](_[_0x2a9b('0x37')](_0x4789fe['query'],_0x211cd8[_0x2a9b('0x2e')]),_0x247089);if(_0x4789fe[_0x2a9b('0x2c')]['filter']){_0x486b19[_0x2a9b('0x36')]=_['merge'](_0x486b19['where'],{'$or':_[_0x2a9b('0x27')](_0x247089,function(_0x28791d){if(_0x28791d[_0x2a9b('0x2a')]!==_0x2a9b('0x38')){var _0x2909ba={};_0x2909ba[_0x28791d[_0x2a9b('0x25')]]={'$like':'%'+_0x4789fe[_0x2a9b('0x2c')][_0x2a9b('0x39')]+'%'};return _0x2909ba;}})});}_0x486b19=_[_0x2a9b('0x3a')]({},_0x486b19,_0x4789fe[_0x2a9b('0x3b')]);var _0x29ecd1={'where':_0x486b19['where']};return db['SquareMessage'][_0x2a9b('0x1a')](_0x29ecd1)[_0x2a9b('0x1f')](function(_0x33d316){_0x2e0e99['count']=_0x33d316;if(_0x4789fe[_0x2a9b('0x2c')][_0x2a9b('0x3c')]){_0x486b19['include']=[{'all':!![]}];}return db[_0x2a9b('0x3d')][_0x2a9b('0x3e')](_0x486b19);})['then'](function(_0x43e6c4){_0x2e0e99[_0x2a9b('0x3f')]=_0x43e6c4;return _0x2e0e99;})[_0x2a9b('0x1f')](respondWithFilteredResult(_0x1b36e3,_0x486b19))[_0x2a9b('0x40')](handleError(_0x1b36e3,null));};exports[_0x2a9b('0x41')]=function(_0x5eeb18,_0x14f957){var _0x572c49={'raw':!![],'where':{'id':_0x5eeb18[_0x2a9b('0x42')]['id']}},_0x2c65fb={};_0x2c65fb[_0x2a9b('0x2b')]=_['keys'](db[_0x2a9b('0x3d')][_0x2a9b('0x28')]);_0x2c65fb['query']=_[_0x2a9b('0x2d')](_0x5eeb18[_0x2a9b('0x2c')]);_0x2c65fb[_0x2a9b('0x2e')]=_['intersection'](_0x2c65fb['model'],_0x2c65fb[_0x2a9b('0x2c')]);_0x572c49[_0x2a9b('0x31')]=_[_0x2a9b('0x2f')](_0x2c65fb['model'],qs[_0x2a9b('0x30')](_0x5eeb18[_0x2a9b('0x2c')][_0x2a9b('0x30')]));_0x572c49[_0x2a9b('0x31')]=_0x572c49[_0x2a9b('0x31')][_0x2a9b('0x43')]?_0x572c49[_0x2a9b('0x31')]:_0x2c65fb[_0x2a9b('0x2b')];if(_0x5eeb18[_0x2a9b('0x2c')]['includeAll']){_0x572c49['include']=[{'all':!![]}];}_0x572c49=_[_0x2a9b('0x3a')]({},_0x572c49,_0x5eeb18[_0x2a9b('0x3b')]);return db['SquareMessage'][_0x2a9b('0x44')](_0x572c49)['then'](handleEntityNotFound(_0x14f957,null))[_0x2a9b('0x1f')](respondWithResult(_0x14f957,null))['catch'](handleError(_0x14f957,null));};exports['create']=function(_0x5efdc6,_0xbdd98a){return db[_0x2a9b('0x3d')][_0x2a9b('0x45')](_0x5efdc6[_0x2a9b('0x46')],{})[_0x2a9b('0x1f')](respondWithResult(_0xbdd98a,0xc9))[_0x2a9b('0x40')](handleError(_0xbdd98a,null));};exports[_0x2a9b('0x47')]=function(_0x9f4203,_0x4f369a){if(_0x9f4203[_0x2a9b('0x46')]['id']){delete _0x9f4203[_0x2a9b('0x46')]['id'];}return db[_0x2a9b('0x3d')]['find']({'where':{'id':_0x9f4203[_0x2a9b('0x42')]['id']}})[_0x2a9b('0x1f')](handleEntityNotFound(_0x4f369a,null))['then'](saveUpdates(_0x9f4203[_0x2a9b('0x46')],null))[_0x2a9b('0x1f')](respondWithResult(_0x4f369a,null))['catch'](handleError(_0x4f369a,null));};exports[_0x2a9b('0x20')]=function(_0x3f4580,_0x314da8){return db[_0x2a9b('0x3d')][_0x2a9b('0x44')]({'where':{'id':_0x3f4580[_0x2a9b('0x42')]['id']}})[_0x2a9b('0x1f')](handleEntityNotFound(_0x314da8,null))[_0x2a9b('0x1f')](removeEntity(_0x314da8,null))[_0x2a9b('0x40')](handleError(_0x314da8,null));}; \ No newline at end of file +var _0x567a=['find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','limit','undefined','offset','count','set','apply','save','update','destroy','sendStatus','stack','name','send','index','map','SquareMessage','fieldName','type','key','model','keys','filters','query','attributes','fields','length','nolimit','sort','where','merge','VIRTUAL','filter','options','then','includeAll','include','findAll','show','params','intersection','catch','body'];(function(_0x3b2c6f,_0xa9f35c){var _0x22e219=function(_0x3ee04c){while(--_0x3ee04c){_0x3b2c6f['push'](_0x3b2c6f['shift']());}};_0x22e219(++_0xa9f35c);}(_0x567a,0x8d));var _0xa567=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x567a[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0xa567('0x0'));var rimraf=require(_0xa567('0x1'));var zipdir=require(_0xa567('0x2'));var jsonpatch=require(_0xa567('0x3'));var rp=require(_0xa567('0x4'));var moment=require(_0xa567('0x5'));var BPromise=require(_0xa567('0x6'));var Mustache=require('mustache');var util=require(_0xa567('0x7'));var path=require('path');var sox=require(_0xa567('0x8'));var csv=require(_0xa567('0x9'));var ejs=require(_0xa567('0xa'));var fs=require('fs');var fs_extra=require(_0xa567('0xb'));var _=require(_0xa567('0xc'));var squel=require(_0xa567('0xd'));var crypto=require(_0xa567('0xe'));var jsforce=require(_0xa567('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa567('0x10'));var Papa=require('papaparse');var Redis=require(_0xa567('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa567('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa567('0x13'))(_0xa567('0x14'));var utils=require(_0xa567('0x15'));var config=require(_0xa567('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xa567('0x17'))['db'];function respondWithStatusCode(_0x158f5e,_0x42089f){_0x42089f=_0x42089f||0xcc;return function(_0x593f1b){if(_0x593f1b){return _0x158f5e['sendStatus'](_0x42089f);}return _0x158f5e[_0xa567('0x18')](_0x42089f)[_0xa567('0x19')]();};}function respondWithResult(_0x4d329d,_0xb59e0f){_0xb59e0f=_0xb59e0f||0xc8;return function(_0x4177b8){if(_0x4177b8){return _0x4d329d['status'](_0xb59e0f)[_0xa567('0x1a')](_0x4177b8);}};}function respondWithFilteredResult(_0x5b3070,_0x4b5353){return function(_0x8f93fa){if(_0x8f93fa){var _0x1fe0cc=typeof _0x4b5353['offset']==='undefined'&&typeof _0x4b5353[_0xa567('0x1b')]===_0xa567('0x1c');var _0xaf202f=_0x8f93fa['count'];var _0x1a47ee=_0x1fe0cc?0x0:_0x4b5353[_0xa567('0x1d')];var _0x4e013f=_0x1fe0cc?_0x8f93fa[_0xa567('0x1e')]:_0x4b5353[_0xa567('0x1d')]+_0x4b5353[_0xa567('0x1b')];var _0x186a6b;if(_0x4e013f>=_0xaf202f){_0x4e013f=_0xaf202f;_0x186a6b=0xc8;}else{_0x186a6b=0xce;}_0x5b3070[_0xa567('0x18')](_0x186a6b);return _0x5b3070[_0xa567('0x1f')]('Content-Range',_0x1a47ee+'-'+_0x4e013f+'/'+_0xaf202f)['json'](_0x8f93fa);}return null;};}function patchUpdates(_0x29fee8){return function(_0x2910b6){try{jsonpatch[_0xa567('0x20')](_0x2910b6,_0x29fee8,!![]);}catch(_0x2d72ab){return BPromise['reject'](_0x2d72ab);}return _0x2910b6[_0xa567('0x21')]();};}function saveUpdates(_0x1e261e,_0x5aeabf){return function(_0x215605){if(_0x215605){return _0x215605[_0xa567('0x22')](_0x1e261e)['then'](function(_0x4041a3){return _0x4041a3;});}return null;};}function removeEntity(_0x15b02b,_0x5ea11b){return function(_0x41a3eb){if(_0x41a3eb){return _0x41a3eb[_0xa567('0x23')]()['then'](function(){_0x15b02b[_0xa567('0x18')](0xcc)[_0xa567('0x19')]();});}};}function handleEntityNotFound(_0x2e7430,_0x3778d2){return function(_0x5eda94){if(!_0x5eda94){_0x2e7430[_0xa567('0x24')](0x194);}return _0x5eda94;};}function handleError(_0x5c0d49,_0xf7f01d){_0xf7f01d=_0xf7f01d||0x1f4;return function(_0xbdca8f){logger['error'](_0xbdca8f[_0xa567('0x25')]);if(_0xbdca8f[_0xa567('0x26')]){delete _0xbdca8f[_0xa567('0x26')];}_0x5c0d49[_0xa567('0x18')](_0xf7f01d)[_0xa567('0x27')](_0xbdca8f);};}exports[_0xa567('0x28')]=function(_0x26042d,_0x389f06){var _0x266f93={},_0x479ed0={},_0xdb134a={'count':0x0,'rows':[]};var _0x543d22=_[_0xa567('0x29')](db[_0xa567('0x2a')]['rawAttributes'],function(_0x226f7f){return{'name':_0x226f7f[_0xa567('0x2b')],'type':_0x226f7f[_0xa567('0x2c')][_0xa567('0x2d')]};});_0x479ed0[_0xa567('0x2e')]=_[_0xa567('0x29')](_0x543d22,_0xa567('0x26'));_0x479ed0['query']=_[_0xa567('0x2f')](_0x26042d['query']);_0x479ed0[_0xa567('0x30')]=_['intersection'](_0x479ed0[_0xa567('0x2e')],_0x479ed0[_0xa567('0x31')]);_0x266f93[_0xa567('0x32')]=_['intersection'](_0x479ed0[_0xa567('0x2e')],qs[_0xa567('0x33')](_0x26042d[_0xa567('0x31')][_0xa567('0x33')]));_0x266f93[_0xa567('0x32')]=_0x266f93[_0xa567('0x32')][_0xa567('0x34')]?_0x266f93['attributes']:_0x479ed0[_0xa567('0x2e')];if(!_0x26042d[_0xa567('0x31')]['hasOwnProperty'](_0xa567('0x35'))){_0x266f93[_0xa567('0x1b')]=qs[_0xa567('0x1b')](_0x26042d[_0xa567('0x31')][_0xa567('0x1b')]);_0x266f93['offset']=qs[_0xa567('0x1d')](_0x26042d['query']['offset']);}_0x266f93['order']=qs['sort'](_0x26042d[_0xa567('0x31')][_0xa567('0x36')]);_0x266f93[_0xa567('0x37')]=qs[_0xa567('0x30')](_['pick'](_0x26042d[_0xa567('0x31')],_0x479ed0[_0xa567('0x30')]),_0x543d22);if(_0x26042d[_0xa567('0x31')]['filter']){_0x266f93[_0xa567('0x37')]=_[_0xa567('0x38')](_0x266f93[_0xa567('0x37')],{'$or':_[_0xa567('0x29')](_0x543d22,function(_0x36f2b0){if(_0x36f2b0['type']!==_0xa567('0x39')){var _0x3cd2e8={};_0x3cd2e8[_0x36f2b0[_0xa567('0x26')]]={'$like':'%'+_0x26042d['query'][_0xa567('0x3a')]+'%'};return _0x3cd2e8;}})});}_0x266f93=_[_0xa567('0x38')]({},_0x266f93,_0x26042d[_0xa567('0x3b')]);var _0x4eb4c9={'where':_0x266f93[_0xa567('0x37')]};return db['SquareMessage'][_0xa567('0x1e')](_0x4eb4c9)[_0xa567('0x3c')](function(_0x33a0dc){_0xdb134a[_0xa567('0x1e')]=_0x33a0dc;if(_0x26042d[_0xa567('0x31')][_0xa567('0x3d')]){_0x266f93[_0xa567('0x3e')]=[{'all':!![]}];}return db[_0xa567('0x2a')][_0xa567('0x3f')](_0x266f93);})['then'](function(_0x1b8dc3){_0xdb134a['rows']=_0x1b8dc3;return _0xdb134a;})[_0xa567('0x3c')](respondWithFilteredResult(_0x389f06,_0x266f93))['catch'](handleError(_0x389f06,null));};exports[_0xa567('0x40')]=function(_0x16579f,_0x494723){var _0x4576aa={'raw':!![],'where':{'id':_0x16579f[_0xa567('0x41')]['id']}},_0x479947={};_0x479947[_0xa567('0x2e')]=_[_0xa567('0x2f')](db[_0xa567('0x2a')]['rawAttributes']);_0x479947[_0xa567('0x31')]=_['keys'](_0x16579f['query']);_0x479947[_0xa567('0x30')]=_['intersection'](_0x479947[_0xa567('0x2e')],_0x479947[_0xa567('0x31')]);_0x4576aa['attributes']=_[_0xa567('0x42')](_0x479947[_0xa567('0x2e')],qs[_0xa567('0x33')](_0x16579f[_0xa567('0x31')]['fields']));_0x4576aa[_0xa567('0x32')]=_0x4576aa[_0xa567('0x32')]['length']?_0x4576aa[_0xa567('0x32')]:_0x479947[_0xa567('0x2e')];if(_0x16579f['query'][_0xa567('0x3d')]){_0x4576aa[_0xa567('0x3e')]=[{'all':!![]}];}_0x4576aa=_['merge']({},_0x4576aa,_0x16579f['options']);return db[_0xa567('0x2a')]['find'](_0x4576aa)['then'](handleEntityNotFound(_0x494723,null))['then'](respondWithResult(_0x494723,null))['catch'](handleError(_0x494723,null));};exports['create']=function(_0x4428ae,_0x1e69d6){return db[_0xa567('0x2a')]['create'](_0x4428ae['body'],{})['then'](respondWithResult(_0x1e69d6,0xc9))[_0xa567('0x43')](handleError(_0x1e69d6,null));};exports[_0xa567('0x22')]=function(_0x47fbb8,_0x403ca8){if(_0x47fbb8[_0xa567('0x44')]['id']){delete _0x47fbb8[_0xa567('0x44')]['id'];}return db[_0xa567('0x2a')][_0xa567('0x45')]({'where':{'id':_0x47fbb8[_0xa567('0x41')]['id']}})[_0xa567('0x3c')](handleEntityNotFound(_0x403ca8,null))[_0xa567('0x3c')](saveUpdates(_0x47fbb8[_0xa567('0x44')],null))['then'](respondWithResult(_0x403ca8,null))[_0xa567('0x43')](handleError(_0x403ca8,null));};exports[_0xa567('0x23')]=function(_0x6af71,_0x439088){return db[_0xa567('0x2a')][_0xa567('0x45')]({'where':{'id':_0x6af71[_0xa567('0x41')]['id']}})[_0xa567('0x3c')](handleEntityNotFound(_0x439088,null))[_0xa567('0x3c')](removeEntity(_0x439088,null))['catch'](handleError(_0x439088,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index d5be44f..bc82cf1 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 _0xc23e=['rimraf','exports','define','SquareMessage','square_messages','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x5456d7,_0x7027f7){var _0x6c4f0e=function(_0x40f69f){while(--_0x40f69f){_0x5456d7['push'](_0x5456d7['shift']());}};_0x6c4f0e(++_0x7027f7);}(_0xc23e,0x191));var _0xec23=function(_0x33049c,_0xd6ea31){_0x33049c=_0x33049c-0x0;var _0x4da299=_0xc23e[_0x33049c];return _0x4da299;};'use strict';var _=require(_0xec23('0x0'));var util=require(_0xec23('0x1'));var logger=require(_0xec23('0x2'))(_0xec23('0x3'));var moment=require(_0xec23('0x4'));var BPromise=require('bluebird');var rp=require(_0xec23('0x5'));var fs=require('fs');var path=require(_0xec23('0x6'));var rimraf=require(_0xec23('0x7'));var config=require('../../config/environment');var attributes=require('./squareMessage.attributes');module[_0xec23('0x8')]=function(_0x5ac04f,_0x1e4205){return _0x5ac04f[_0xec23('0x9')](_0xec23('0xa'),attributes,{'tableName':_0xec23('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2fe8=['./squareMessage.attributes','exports','define','square_messages','api','moment','request-promise','rimraf','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2fe8,0x1e1));var _0x82fe=function(_0x3ee134,_0x28b844){_0x3ee134=_0x3ee134-0x0;var _0x1eda39=_0x2fe8[_0x3ee134];return _0x1eda39;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x82fe('0x0'));var moment=require(_0x82fe('0x1'));var BPromise=require('bluebird');var rp=require(_0x82fe('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x82fe('0x3'));var config=require(_0x82fe('0x4'));var attributes=require(_0x82fe('0x5'));module[_0x82fe('0x6')]=function(_0x51c4ed,_0x48a52e){return _0x51c4ed[_0x82fe('0x7')]('SquareMessage',attributes,{'tableName':_0x82fe('0x8'),'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 4f7a8fd..d1a7249 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 _0x4b32=['jayson/promise','client','http','request','then','info','SquareMessage,\x20%s,\x20%s','debug','SquareMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','catch','CreateSquareMessage','SquareMessage','create','body','options','raw','stringify','util','moment','../../mysqldb','../../config/environment'];(function(_0x483030,_0x2d317b){var _0x553ac0=function(_0x3ca7d8){while(--_0x3ca7d8){_0x483030['push'](_0x483030['shift']());}};_0x553ac0(++_0x2d317b);}(_0x4b32,0xa4));var _0x24b3=function(_0x46d7d8,_0x2e7e34){_0x46d7d8=_0x46d7d8-0x0;var _0x141154=_0x4b32[_0x46d7d8];return _0x141154;};'use strict';var _=require('lodash');var util=require(_0x24b3('0x0'));var moment=require(_0x24b3('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x24b3('0x2'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x24b3('0x3'));var jayson=require(_0x24b3('0x4'));var client=jayson[_0x24b3('0x5')][_0x24b3('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x187751,_0x2a9b5f,_0x34295c){return new BPromise(function(_0x165455,_0xef734a){return client[_0x24b3('0x7')](_0x187751,_0x34295c)[_0x24b3('0x8')](function(_0x7b425c){logger[_0x24b3('0x9')](_0x24b3('0xa'),_0x2a9b5f,'request\x20sent');logger[_0x24b3('0xb')](_0x24b3('0xc'),_0x2a9b5f,_0x24b3('0xd'),JSON['stringify'](_0x7b425c));if(_0x7b425c[_0x24b3('0xe')]){if(_0x7b425c['error']['code']===0x1f4){logger[_0x24b3('0xe')](_0x24b3('0xa'),_0x2a9b5f,_0x7b425c[_0x24b3('0xe')][_0x24b3('0xf')]);return _0xef734a(_0x7b425c[_0x24b3('0xe')][_0x24b3('0xf')]);}logger[_0x24b3('0xe')](_0x24b3('0xa'),_0x2a9b5f,_0x7b425c[_0x24b3('0xe')]['message']);return _0x165455(_0x7b425c[_0x24b3('0xe')]['message']);}else{logger[_0x24b3('0x9')](_0x24b3('0xa'),_0x2a9b5f,'request\x20sent');_0x165455(_0x7b425c['result']['message']);}})[_0x24b3('0x10')](function(_0x25ab9f){logger[_0x24b3('0xe')]('SquareMessage,\x20%s,\x20%s',_0x2a9b5f,_0x25ab9f);_0xef734a(_0x25ab9f);});});}exports[_0x24b3('0x11')]=function(_0x56c1a1){var _0x3aeae=this;return new Promise(function(_0x47a667,_0x5102b9){return db[_0x24b3('0x12')][_0x24b3('0x13')](_0x56c1a1[_0x24b3('0x14')],{'raw':_0x56c1a1[_0x24b3('0x15')]?_0x56c1a1[_0x24b3('0x15')][_0x24b3('0x16')]===undefined?!![]:![]:!![]})[_0x24b3('0x8')](function(_0x40687f){logger['info'](_0x24b3('0x11'),_0x56c1a1);logger['debug']('CreateSquareMessage',_0x56c1a1,JSON[_0x24b3('0x17')](_0x40687f));_0x47a667(_0x40687f);})[_0x24b3('0x10')](function(_0x325c20){logger[_0x24b3('0xe')](_0x24b3('0x11'),_0x325c20['message'],_0x56c1a1);_0x5102b9(_0x3aeae[_0x24b3('0xe')](0x1f4,_0x325c20[_0x24b3('0xf')]));});});}; \ No newline at end of file +var _0x607d=['options','raw','stringify','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','error','code','message','info','result','CreateSquareMessage','SquareMessage'];(function(_0x214a31,_0x41447a){var _0x354fb9=function(_0x5eef67){while(--_0x5eef67){_0x214a31['push'](_0x214a31['shift']());}};_0x354fb9(++_0x41447a);}(_0x607d,0x78));var _0xd607=function(_0x2a4e0f,_0x32f7df){_0x2a4e0f=_0x2a4e0f-0x0;var _0x217ae0=_0x607d[_0x2a4e0f];return _0x217ae0;};'use strict';var _=require(_0xd607('0x0'));var util=require(_0xd607('0x1'));var moment=require(_0xd607('0x2'));var BPromise=require(_0xd607('0x3'));var rs=require(_0xd607('0x4'));var fs=require('fs');var Redis=require(_0xd607('0x5'));var db=require(_0xd607('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xd607('0x7'))(_0xd607('0x8'));var config=require(_0xd607('0x9'));var jayson=require(_0xd607('0xa'));var client=jayson[_0xd607('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1b4643,_0x797f74,_0x63871b){return new BPromise(function(_0x5d90a3,_0x30ad79){return client[_0xd607('0xc')](_0x1b4643,_0x63871b)[_0xd607('0xd')](function(_0x58b93e){logger['info'](_0xd607('0xe'),_0x797f74,_0xd607('0xf'));logger[_0xd607('0x10')](_0xd607('0x11'),_0x797f74,_0xd607('0xf'),JSON['stringify'](_0x58b93e));if(_0x58b93e[_0xd607('0x12')]){if(_0x58b93e[_0xd607('0x12')][_0xd607('0x13')]===0x1f4){logger[_0xd607('0x12')](_0xd607('0xe'),_0x797f74,_0x58b93e[_0xd607('0x12')]['message']);return _0x30ad79(_0x58b93e[_0xd607('0x12')]['message']);}logger[_0xd607('0x12')](_0xd607('0xe'),_0x797f74,_0x58b93e[_0xd607('0x12')][_0xd607('0x14')]);return _0x5d90a3(_0x58b93e['error'][_0xd607('0x14')]);}else{logger[_0xd607('0x15')]('SquareMessage,\x20%s,\x20%s',_0x797f74,_0xd607('0xf'));_0x5d90a3(_0x58b93e[_0xd607('0x16')][_0xd607('0x14')]);}})['catch'](function(_0x5169e8){logger['error'](_0xd607('0xe'),_0x797f74,_0x5169e8);_0x30ad79(_0x5169e8);});});}exports[_0xd607('0x17')]=function(_0x25e49e){var _0x1616c6=this;return new Promise(function(_0x326e8a,_0x5a8a48){return db[_0xd607('0x18')]['create'](_0x25e49e['body'],{'raw':_0x25e49e[_0xd607('0x19')]?_0x25e49e[_0xd607('0x19')][_0xd607('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x3c0aa0){logger['info'](_0xd607('0x17'),_0x25e49e);logger[_0xd607('0x10')](_0xd607('0x17'),_0x25e49e,JSON[_0xd607('0x1b')](_0x3c0aa0));_0x326e8a(_0x3c0aa0);})[_0xd607('0x1c')](function(_0x525e8e){logger['error'](_0xd607('0x17'),_0x525e8e[_0xd607('0x14')],_0x25e49e);_0x5a8a48(_0x1616c6[_0xd607('0x12')](0x1f4,_0x525e8e['message']));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index 714687a..49859a0 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 _0x1d57=['isAuthenticated','index','get','/:id','show','/:id/test','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./squareOdbc.controller'];(function(_0x3167ad,_0x120128){var _0x2611f7=function(_0x1bae6c){while(--_0x1bae6c){_0x3167ad['push'](_0x3167ad['shift']());}};_0x2611f7(++_0x120128);}(_0x1d57,0x15d));var _0x71d5=function(_0x2c9e61,_0x2d13f5){_0x2c9e61=_0x2c9e61-0x0;var _0x4d55d6=_0x1d57[_0x2c9e61];return _0x4d55d6;};'use strict';var multer=require('multer');var util=require(_0x71d5('0x0'));var path=require(_0x71d5('0x1'));var timeout=require(_0x71d5('0x2'));var express=require(_0x71d5('0x3'));var router=express[_0x71d5('0x4')]();var fs_extra=require(_0x71d5('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x71d5('0x6'));var config=require('../../config/environment');var controller=require(_0x71d5('0x7'));router['get']('/',auth[_0x71d5('0x8')](),controller[_0x71d5('0x9')]);router[_0x71d5('0xa')](_0x71d5('0xb'),auth['isAuthenticated'](),controller[_0x71d5('0xc')]);router['get'](_0x71d5('0xd'),auth[_0x71d5('0x8')](),timeout('15s'),controller['test']);router[_0x71d5('0xe')]('/',auth[_0x71d5('0x8')](),controller[_0x71d5('0xf')]);router[_0x71d5('0x10')](_0x71d5('0xb'),auth[_0x71d5('0x8')](),controller[_0x71d5('0x11')]);router[_0x71d5('0x12')](_0x71d5('0xb'),auth[_0x71d5('0x8')](),controller[_0x71d5('0x13')]);module[_0x71d5('0x14')]=router; \ No newline at end of file +var _0x3003=['/:id/test','post','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index','/:id','show'];(function(_0x515afd,_0x1a1e91){var _0x536d53=function(_0x1d3a89){while(--_0x1d3a89){_0x515afd['push'](_0x515afd['shift']());}};_0x536d53(++_0x1a1e91);}(_0x3003,0x91));var _0x3300=function(_0x23fb89,_0x45dfe4){_0x23fb89=_0x23fb89-0x0;var _0x95cb84=_0x3003[_0x23fb89];return _0x95cb84;};'use strict';var multer=require(_0x3300('0x0'));var util=require(_0x3300('0x1'));var path=require('path');var timeout=require(_0x3300('0x2'));var express=require(_0x3300('0x3'));var router=express[_0x3300('0x4')]();var fs_extra=require(_0x3300('0x5'));var auth=require(_0x3300('0x6'));var interaction=require(_0x3300('0x7'));var config=require(_0x3300('0x8'));var controller=require(_0x3300('0x9'));router[_0x3300('0xa')]('/',auth[_0x3300('0xb')](),controller[_0x3300('0xc')]);router[_0x3300('0xa')](_0x3300('0xd'),auth[_0x3300('0xb')](),controller[_0x3300('0xe')]);router[_0x3300('0xa')](_0x3300('0xf'),auth['isAuthenticated'](),timeout('15s'),controller['test']);router[_0x3300('0x10')]('/',auth[_0x3300('0xb')](),controller['create']);router['put'](_0x3300('0xd'),auth[_0x3300('0xb')](),controller[_0x3300('0x11')]);router[_0x3300('0x12')](_0x3300('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x3300('0x13')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index c0b887f..cde3253 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 _0xd4c1=['STRING','name','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd4c1,0x15a));var _0x1d4c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd4c1[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x1d4c('0x0'));module[_0x1d4c('0x1')]={'name':{'type':Sequelize[_0x1d4c('0x2')],'unique':_0x1d4c('0x3'),'allowNull':![]},'dsn':{'type':Sequelize[_0x1d4c('0x2')]},'description':{'type':Sequelize[_0x1d4c('0x2')]}}; \ No newline at end of file +var _0xb2af=['exports','STRING'];(function(_0x34cec5,_0x15c71c){var _0x203227=function(_0x570dfd){while(--_0x570dfd){_0x34cec5['push'](_0x34cec5['shift']());}};_0x203227(++_0x15c71c);}(_0xb2af,0x14a));var _0xfb2a=function(_0x41eb02,_0x2f0de6){_0x41eb02=_0x41eb02-0x0;var _0x59710d=_0xb2af[_0x41eb02];return _0x59710d;};'use strict';var Sequelize=require('sequelize');module[_0xfb2a('0x0')]={'name':{'type':Sequelize[_0xfb2a('0x1')],'unique':'name','allowNull':![]},'dsn':{'type':Sequelize[_0xfb2a('0x1')]},'description':{'type':Sequelize[_0xfb2a('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index 08181ce..3aba7b2 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 _0xf915=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','then','get','UserProfileResource','error','name','send','index','map','SquareOdbc','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','where','merge','options','includeAll','include','findAll','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','userProfileId','autoAssociation','catch','update','test','dsn','odbc','openSync','closeSync','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse'];(function(_0xf0bcac,_0x531755){var _0x4e4c65=function(_0x35a77a){while(--_0x35a77a){_0xf0bcac['push'](_0xf0bcac['shift']());}};_0x4e4c65(++_0x531755);}(_0xf915,0x183));var _0x5f91=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xf915[_0x59ee6f];return _0x4c0979;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5f91('0x0'));var jsonpatch=require(_0x5f91('0x1'));var rp=require(_0x5f91('0x2'));var moment=require(_0x5f91('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5f91('0x4'));var path=require('path');var sox=require(_0x5f91('0x5'));var csv=require(_0x5f91('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5f91('0x7'));var squel=require(_0x5f91('0x8'));var crypto=require(_0x5f91('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x5f91('0xa'));var toCsv=require(_0x5f91('0x6'));var querystring=require(_0x5f91('0xb'));var Papa=require(_0x5f91('0xc'));var Redis=require(_0x5f91('0xd'));var authService=require(_0x5f91('0xe'));var qs=require(_0x5f91('0xf'));var as=require(_0x5f91('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5f91('0x11'));var utils=require('../../config/utils');var config=require(_0x5f91('0x12'));var licenseUtil=require(_0x5f91('0x13'));var db=require(_0x5f91('0x14'))['db'];function respondWithStatusCode(_0x29073f,_0x2c87db){_0x2c87db=_0x2c87db||0xcc;return function(_0x39f485){if(_0x39f485){return _0x29073f[_0x5f91('0x15')](_0x2c87db);}return _0x29073f['status'](_0x2c87db)['end']();};}function respondWithResult(_0x556b40,_0x441abf){_0x441abf=_0x441abf||0xc8;return function(_0x59863f){if(_0x59863f){return _0x556b40[_0x5f91('0x16')](_0x441abf)[_0x5f91('0x17')](_0x59863f);}};}function respondWithFilteredResult(_0x1ed992,_0x4ea491){return function(_0x1b6829){if(_0x1b6829){var _0x3ad8da=typeof _0x4ea491[_0x5f91('0x18')]===_0x5f91('0x19')&&typeof _0x4ea491[_0x5f91('0x1a')]==='undefined';var _0x5acb38=_0x1b6829[_0x5f91('0x1b')];var _0x4d5aeb=_0x3ad8da?0x0:_0x4ea491[_0x5f91('0x18')];var _0x95736e=_0x3ad8da?_0x1b6829['count']:_0x4ea491[_0x5f91('0x18')]+_0x4ea491[_0x5f91('0x1a')];var _0x45cdfb;if(_0x95736e>=_0x5acb38){_0x95736e=_0x5acb38;_0x45cdfb=0xc8;}else{_0x45cdfb=0xce;}_0x1ed992[_0x5f91('0x16')](_0x45cdfb);return _0x1ed992[_0x5f91('0x1c')](_0x5f91('0x1d'),_0x4d5aeb+'-'+_0x95736e+'/'+_0x5acb38)[_0x5f91('0x17')](_0x1b6829);}return null;};}function patchUpdates(_0x188a8f){return function(_0x9d6938){try{jsonpatch[_0x5f91('0x1e')](_0x9d6938,_0x188a8f,!![]);}catch(_0x450613){return BPromise[_0x5f91('0x1f')](_0x450613);}return _0x9d6938[_0x5f91('0x20')]();};}function saveUpdates(_0x3b67b4,_0x3490b2){return function(_0x231ac4){if(_0x231ac4){return _0x231ac4['update'](_0x3b67b4)['then'](function(_0x4efabb){return _0x4efabb;});}return null;};}function removeEntity(_0x56c1c6,_0xc8988c){return function(_0x4e92b5){if(_0x4e92b5){return _0x4e92b5[_0x5f91('0x21')]()[_0x5f91('0x22')](function(){var _0x466c43=_0x4e92b5[_0x5f91('0x23')]({'plain':!![]});var _0x13df62='ODBC';return db[_0x5f91('0x24')][_0x5f91('0x21')]({'where':{'type':_0x13df62,'resourceId':_0x466c43['id']}})[_0x5f91('0x22')](function(){return _0x4e92b5;});})[_0x5f91('0x22')](function(){_0x56c1c6[_0x5f91('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x16141f,_0xdcdf03){return function(_0x29b1e5){if(!_0x29b1e5){_0x16141f[_0x5f91('0x15')](0x194);}return _0x29b1e5;};}function handleError(_0x263398,_0x59a25f){_0x59a25f=_0x59a25f||0x1f4;return function(_0x1b7eb6){logger[_0x5f91('0x25')](_0x1b7eb6['stack']);if(_0x1b7eb6[_0x5f91('0x26')]){delete _0x1b7eb6['name'];}_0x263398[_0x5f91('0x16')](_0x59a25f)[_0x5f91('0x27')](_0x1b7eb6);};}exports[_0x5f91('0x28')]=function(_0x126aae,_0x479fae){var _0x117050={},_0xb767c4={},_0x41cfb7={'count':0x0,'rows':[]};var _0x2f6bec=_[_0x5f91('0x29')](db[_0x5f91('0x2a')][_0x5f91('0x2b')],function(_0x5321d0){return{'name':_0x5321d0[_0x5f91('0x2c')],'type':_0x5321d0[_0x5f91('0x2d')][_0x5f91('0x2e')]};});_0xb767c4[_0x5f91('0x2f')]=_[_0x5f91('0x29')](_0x2f6bec,_0x5f91('0x26'));_0xb767c4[_0x5f91('0x30')]=_[_0x5f91('0x31')](_0x126aae[_0x5f91('0x30')]);_0xb767c4[_0x5f91('0x32')]=_[_0x5f91('0x33')](_0xb767c4[_0x5f91('0x2f')],_0xb767c4['query']);_0x117050[_0x5f91('0x34')]=_[_0x5f91('0x33')](_0xb767c4[_0x5f91('0x2f')],qs[_0x5f91('0x35')](_0x126aae[_0x5f91('0x30')][_0x5f91('0x35')]));_0x117050[_0x5f91('0x34')]=_0x117050[_0x5f91('0x34')][_0x5f91('0x36')]?_0x117050['attributes']:_0xb767c4[_0x5f91('0x2f')];if(!_0x126aae[_0x5f91('0x30')][_0x5f91('0x37')](_0x5f91('0x38'))){_0x117050[_0x5f91('0x1a')]=qs[_0x5f91('0x1a')](_0x126aae[_0x5f91('0x30')]['limit']);_0x117050[_0x5f91('0x18')]=qs[_0x5f91('0x18')](_0x126aae[_0x5f91('0x30')]['offset']);}_0x117050['order']=qs[_0x5f91('0x39')](_0x126aae['query'][_0x5f91('0x39')]);_0x117050['where']=qs[_0x5f91('0x32')](_[_0x5f91('0x3a')](_0x126aae[_0x5f91('0x30')],_0xb767c4[_0x5f91('0x32')]),_0x2f6bec);if(_0x126aae[_0x5f91('0x30')]['filter']){_0x117050[_0x5f91('0x3b')]=_['merge'](_0x117050[_0x5f91('0x3b')],{'$or':_[_0x5f91('0x29')](_0x2f6bec,function(_0x1b73bc){if(_0x1b73bc[_0x5f91('0x2d')]!=='VIRTUAL'){var _0x38c8c5={};_0x38c8c5[_0x1b73bc[_0x5f91('0x26')]]={'$like':'%'+_0x126aae[_0x5f91('0x30')]['filter']+'%'};return _0x38c8c5;}})});}_0x117050=_[_0x5f91('0x3c')]({},_0x117050,_0x126aae[_0x5f91('0x3d')]);var _0x54668e={'where':_0x117050['where']};return db[_0x5f91('0x2a')]['count'](_0x54668e)[_0x5f91('0x22')](function(_0x590da1){_0x41cfb7[_0x5f91('0x1b')]=_0x590da1;if(_0x126aae['query'][_0x5f91('0x3e')]){_0x117050[_0x5f91('0x3f')]=[{'all':!![]}];}return db[_0x5f91('0x2a')][_0x5f91('0x40')](_0x117050);})[_0x5f91('0x22')](function(_0x5db492){_0x41cfb7['rows']=_0x5db492;return _0x41cfb7;})[_0x5f91('0x22')](respondWithFilteredResult(_0x479fae,_0x117050))['catch'](handleError(_0x479fae,null));};exports['show']=function(_0x1a413c,_0x106328){var _0x397777={'raw':!![],'where':{'id':_0x1a413c[_0x5f91('0x41')]['id']}},_0x45e0da={};_0x45e0da[_0x5f91('0x2f')]=_[_0x5f91('0x31')](db[_0x5f91('0x2a')][_0x5f91('0x2b')]);_0x45e0da[_0x5f91('0x30')]=_['keys'](_0x1a413c[_0x5f91('0x30')]);_0x45e0da[_0x5f91('0x32')]=_[_0x5f91('0x33')](_0x45e0da['model'],_0x45e0da[_0x5f91('0x30')]);_0x397777[_0x5f91('0x34')]=_['intersection'](_0x45e0da['model'],qs[_0x5f91('0x35')](_0x1a413c[_0x5f91('0x30')]['fields']));_0x397777[_0x5f91('0x34')]=_0x397777[_0x5f91('0x34')][_0x5f91('0x36')]?_0x397777[_0x5f91('0x34')]:_0x45e0da['model'];if(_0x1a413c[_0x5f91('0x30')][_0x5f91('0x3e')]){_0x397777['include']=[{'all':!![]}];}_0x397777=_['merge']({},_0x397777,_0x1a413c[_0x5f91('0x3d')]);return db['SquareOdbc'][_0x5f91('0x42')](_0x397777)[_0x5f91('0x22')](handleEntityNotFound(_0x106328,null))[_0x5f91('0x22')](respondWithResult(_0x106328,null))['catch'](handleError(_0x106328,null));};exports[_0x5f91('0x43')]=function(_0x22ebe3,_0x39b688){return db[_0x5f91('0x2a')][_0x5f91('0x43')](_0x22ebe3[_0x5f91('0x44')],{})[_0x5f91('0x22')](function(_0x2fa415){var _0x5e960c=_0x22ebe3['user'][_0x5f91('0x23')]({'plain':!![]});if(!_0x5e960c)throw new Error(_0x5f91('0x45'));if(_0x5e960c['role']===_0x5f91('0x46')){var _0x5a66f5=_0x2fa415['get']({'plain':!![]});var _0xab8524='ODBC';return db['UserProfileSection'][_0x5f91('0x42')]({'where':{'name':_0xab8524,'userProfileId':_0x5e960c[_0x5f91('0x47')]},'raw':!![]})['then'](function(_0x16a4d7){if(_0x16a4d7&&_0x16a4d7[_0x5f91('0x48')]===0x0){return db[_0x5f91('0x24')][_0x5f91('0x43')]({'name':_0x5a66f5['name'],'resourceId':_0x5a66f5['id'],'type':_0x16a4d7[_0x5f91('0x26')],'sectionId':_0x16a4d7['id']},{})[_0x5f91('0x22')](function(){return _0x2fa415;});}else{return _0x2fa415;}})['catch'](function(_0x5dd76a){logger[_0x5f91('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5dd76a);throw _0x5dd76a;});}return _0x2fa415;})[_0x5f91('0x22')](respondWithResult(_0x39b688,0xc9))[_0x5f91('0x49')](handleError(_0x39b688,null));};exports[_0x5f91('0x4a')]=function(_0x2c89d2,_0x54e6eb){if(_0x2c89d2['body']['id']){delete _0x2c89d2[_0x5f91('0x44')]['id'];}return db[_0x5f91('0x2a')][_0x5f91('0x42')]({'where':{'id':_0x2c89d2[_0x5f91('0x41')]['id']}})[_0x5f91('0x22')](handleEntityNotFound(_0x54e6eb,null))[_0x5f91('0x22')](saveUpdates(_0x2c89d2['body'],null))[_0x5f91('0x22')](respondWithResult(_0x54e6eb,null))['catch'](handleError(_0x54e6eb,null));};exports[_0x5f91('0x21')]=function(_0x3d8325,_0x5a9773){return db[_0x5f91('0x2a')]['find']({'where':{'id':_0x3d8325[_0x5f91('0x41')]['id']}})[_0x5f91('0x22')](handleEntityNotFound(_0x5a9773,null))['then'](removeEntity(_0x5a9773,null))['catch'](handleError(_0x5a9773,null));};exports[_0x5f91('0x4b')]=function(_0x2dda18,_0x101e27,_0x11182a){var _0x13d5ed;return db[_0x5f91('0x2a')]['find']({'where':{'id':_0x2dda18[_0x5f91('0x41')]['id']},'attributes':['id',_0x5f91('0x4c')]})['then'](handleEntityNotFound(_0x101e27,null))[_0x5f91('0x22')](function(_0x1591d6){if(_0x1591d6){var _0xf60569=require(_0x5f91('0x4d'))();_0xf60569[_0x5f91('0x4e')](_0x1591d6[_0x5f91('0x4c')]);_0xf60569[_0x5f91('0x4f')]();return _0x1591d6;}})[_0x5f91('0x22')](respondWithResult(_0x101e27,null))['catch'](handleError(_0x101e27,null));}; \ No newline at end of file +var _0xefa5=['papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','json','undefined','count','offset','limit','Content-Range','apply','reject','update','then','get','ODBC','UserProfileResource','destroy','end','sendStatus','stack','name','send','index','SquareOdbc','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','pick','where','merge','type','VIRTUAL','filter','includeAll','include','findAll','catch','show','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','params','test','odbc','openSync','dsn','closeSync','eml-format','zip-dir','request-promise','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce'];(function(_0x10a2fd,_0x31c178){var _0x1e16f9=function(_0x28e3ef){while(--_0x28e3ef){_0x10a2fd['push'](_0x10a2fd['shift']());}};_0x1e16f9(++_0x31c178);}(_0xefa5,0x9c));var _0x5efa=function(_0x29cd14,_0x245c40){_0x29cd14=_0x29cd14-0x0;var _0x4229d1=_0xefa5[_0x29cd14];return _0x4229d1;};'use strict';var emlformat=require(_0x5efa('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5efa('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5efa('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5efa('0x3'));var util=require(_0x5efa('0x4'));var path=require('path');var sox=require(_0x5efa('0x5'));var csv=require(_0x5efa('0x6'));var ejs=require(_0x5efa('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5efa('0x8'));var squel=require(_0x5efa('0x9'));var crypto=require(_0x5efa('0xa'));var jsforce=require(_0x5efa('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x5efa('0x6'));var querystring=require('querystring');var Papa=require(_0x5efa('0xc'));var Redis=require('ioredis');var authService=require(_0x5efa('0xd'));var qs=require(_0x5efa('0xe'));var as=require(_0x5efa('0xf'));var hardwareService=require(_0x5efa('0x10'));var logger=require(_0x5efa('0x11'))('api');var utils=require(_0x5efa('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x5efa('0x13'));var db=require(_0x5efa('0x14'))['db'];function respondWithStatusCode(_0x7aa488,_0xf4bd4c){_0xf4bd4c=_0xf4bd4c||0xcc;return function(_0x3dcd35){if(_0x3dcd35){return _0x7aa488['sendStatus'](_0xf4bd4c);}return _0x7aa488['status'](_0xf4bd4c)['end']();};}function respondWithResult(_0x1d19ab,_0x29c9a3){_0x29c9a3=_0x29c9a3||0xc8;return function(_0x300553){if(_0x300553){return _0x1d19ab[_0x5efa('0x15')](_0x29c9a3)[_0x5efa('0x16')](_0x300553);}};}function respondWithFilteredResult(_0x5dab51,_0x546f05){return function(_0x460974){if(_0x460974){var _0x1564a3=typeof _0x546f05['offset']===_0x5efa('0x17')&&typeof _0x546f05['limit']===_0x5efa('0x17');var _0x5011b6=_0x460974[_0x5efa('0x18')];var _0x170b85=_0x1564a3?0x0:_0x546f05[_0x5efa('0x19')];var _0xf9ccbe=_0x1564a3?_0x460974['count']:_0x546f05['offset']+_0x546f05[_0x5efa('0x1a')];var _0x1968ff;if(_0xf9ccbe>=_0x5011b6){_0xf9ccbe=_0x5011b6;_0x1968ff=0xc8;}else{_0x1968ff=0xce;}_0x5dab51['status'](_0x1968ff);return _0x5dab51['set'](_0x5efa('0x1b'),_0x170b85+'-'+_0xf9ccbe+'/'+_0x5011b6)['json'](_0x460974);}return null;};}function patchUpdates(_0x4106dc){return function(_0x4a7693){try{jsonpatch[_0x5efa('0x1c')](_0x4a7693,_0x4106dc,!![]);}catch(_0x80060d){return BPromise[_0x5efa('0x1d')](_0x80060d);}return _0x4a7693['save']();};}function saveUpdates(_0x1ef1e4,_0x4b79e0){return function(_0x3004b8){if(_0x3004b8){return _0x3004b8[_0x5efa('0x1e')](_0x1ef1e4)[_0x5efa('0x1f')](function(_0x34f3c5){return _0x34f3c5;});}return null;};}function removeEntity(_0x7acad7,_0x28c942){return function(_0x580236){if(_0x580236){return _0x580236['destroy']()[_0x5efa('0x1f')](function(){var _0x164bb9=_0x580236[_0x5efa('0x20')]({'plain':!![]});var _0x1c51d0=_0x5efa('0x21');return db[_0x5efa('0x22')][_0x5efa('0x23')]({'where':{'type':_0x1c51d0,'resourceId':_0x164bb9['id']}})[_0x5efa('0x1f')](function(){return _0x580236;});})[_0x5efa('0x1f')](function(){_0x7acad7['status'](0xcc)[_0x5efa('0x24')]();});}};}function handleEntityNotFound(_0x514725,_0xa2f411){return function(_0x331794){if(!_0x331794){_0x514725[_0x5efa('0x25')](0x194);}return _0x331794;};}function handleError(_0x36b915,_0x17f26b){_0x17f26b=_0x17f26b||0x1f4;return function(_0x1bd244){logger['error'](_0x1bd244[_0x5efa('0x26')]);if(_0x1bd244[_0x5efa('0x27')]){delete _0x1bd244[_0x5efa('0x27')];}_0x36b915[_0x5efa('0x15')](_0x17f26b)[_0x5efa('0x28')](_0x1bd244);};}exports[_0x5efa('0x29')]=function(_0x1bf8ec,_0x10a679){var _0x464bc5={},_0x5976d6={},_0x10b284={'count':0x0,'rows':[]};var _0x4310c4=_['map'](db[_0x5efa('0x2a')][_0x5efa('0x2b')],function(_0x4efeac){return{'name':_0x4efeac[_0x5efa('0x2c')],'type':_0x4efeac['type'][_0x5efa('0x2d')]};});_0x5976d6[_0x5efa('0x2e')]=_['map'](_0x4310c4,_0x5efa('0x27'));_0x5976d6[_0x5efa('0x2f')]=_[_0x5efa('0x30')](_0x1bf8ec[_0x5efa('0x2f')]);_0x5976d6['filters']=_[_0x5efa('0x31')](_0x5976d6[_0x5efa('0x2e')],_0x5976d6[_0x5efa('0x2f')]);_0x464bc5[_0x5efa('0x32')]=_[_0x5efa('0x31')](_0x5976d6[_0x5efa('0x2e')],qs[_0x5efa('0x33')](_0x1bf8ec[_0x5efa('0x2f')][_0x5efa('0x33')]));_0x464bc5[_0x5efa('0x32')]=_0x464bc5[_0x5efa('0x32')][_0x5efa('0x34')]?_0x464bc5[_0x5efa('0x32')]:_0x5976d6[_0x5efa('0x2e')];if(!_0x1bf8ec[_0x5efa('0x2f')][_0x5efa('0x35')](_0x5efa('0x36'))){_0x464bc5[_0x5efa('0x1a')]=qs[_0x5efa('0x1a')](_0x1bf8ec[_0x5efa('0x2f')]['limit']);_0x464bc5['offset']=qs[_0x5efa('0x19')](_0x1bf8ec[_0x5efa('0x2f')][_0x5efa('0x19')]);}_0x464bc5['order']=qs[_0x5efa('0x37')](_0x1bf8ec['query'][_0x5efa('0x37')]);_0x464bc5['where']=qs[_0x5efa('0x38')](_[_0x5efa('0x39')](_0x1bf8ec[_0x5efa('0x2f')],_0x5976d6['filters']),_0x4310c4);if(_0x1bf8ec['query']['filter']){_0x464bc5[_0x5efa('0x3a')]=_[_0x5efa('0x3b')](_0x464bc5['where'],{'$or':_['map'](_0x4310c4,function(_0x3b64f6){if(_0x3b64f6[_0x5efa('0x3c')]!==_0x5efa('0x3d')){var _0x28f384={};_0x28f384[_0x3b64f6[_0x5efa('0x27')]]={'$like':'%'+_0x1bf8ec[_0x5efa('0x2f')][_0x5efa('0x3e')]+'%'};return _0x28f384;}})});}_0x464bc5=_[_0x5efa('0x3b')]({},_0x464bc5,_0x1bf8ec['options']);var _0x3f43c3={'where':_0x464bc5['where']};return db[_0x5efa('0x2a')]['count'](_0x3f43c3)[_0x5efa('0x1f')](function(_0xbbe5b4){_0x10b284[_0x5efa('0x18')]=_0xbbe5b4;if(_0x1bf8ec['query'][_0x5efa('0x3f')]){_0x464bc5[_0x5efa('0x40')]=[{'all':!![]}];}return db[_0x5efa('0x2a')][_0x5efa('0x41')](_0x464bc5);})[_0x5efa('0x1f')](function(_0x56e6a4){_0x10b284['rows']=_0x56e6a4;return _0x10b284;})[_0x5efa('0x1f')](respondWithFilteredResult(_0x10a679,_0x464bc5))[_0x5efa('0x42')](handleError(_0x10a679,null));};exports[_0x5efa('0x43')]=function(_0x2f3112,_0x487445){var _0x1eaec0={'raw':!![],'where':{'id':_0x2f3112['params']['id']}},_0x400d29={};_0x400d29[_0x5efa('0x2e')]=_[_0x5efa('0x30')](db[_0x5efa('0x2a')]['rawAttributes']);_0x400d29['query']=_['keys'](_0x2f3112['query']);_0x400d29['filters']=_[_0x5efa('0x31')](_0x400d29[_0x5efa('0x2e')],_0x400d29[_0x5efa('0x2f')]);_0x1eaec0['attributes']=_[_0x5efa('0x31')](_0x400d29[_0x5efa('0x2e')],qs[_0x5efa('0x33')](_0x2f3112[_0x5efa('0x2f')][_0x5efa('0x33')]));_0x1eaec0[_0x5efa('0x32')]=_0x1eaec0[_0x5efa('0x32')]['length']?_0x1eaec0[_0x5efa('0x32')]:_0x400d29[_0x5efa('0x2e')];if(_0x2f3112['query'][_0x5efa('0x3f')]){_0x1eaec0[_0x5efa('0x40')]=[{'all':!![]}];}_0x1eaec0=_['merge']({},_0x1eaec0,_0x2f3112[_0x5efa('0x44')]);return db[_0x5efa('0x2a')][_0x5efa('0x45')](_0x1eaec0)[_0x5efa('0x1f')](handleEntityNotFound(_0x487445,null))['then'](respondWithResult(_0x487445,null))[_0x5efa('0x42')](handleError(_0x487445,null));};exports['create']=function(_0xef5f02,_0x627d01){return db['SquareOdbc'][_0x5efa('0x46')](_0xef5f02[_0x5efa('0x47')],{})[_0x5efa('0x1f')](function(_0x1e37df){var _0x3bc88a=_0xef5f02[_0x5efa('0x48')][_0x5efa('0x20')]({'plain':!![]});if(!_0x3bc88a)throw new Error(_0x5efa('0x49'));if(_0x3bc88a[_0x5efa('0x4a')]===_0x5efa('0x48')){var _0x3feb46=_0x1e37df[_0x5efa('0x20')]({'plain':!![]});var _0x5b389c=_0x5efa('0x21');return db[_0x5efa('0x4b')][_0x5efa('0x45')]({'where':{'name':_0x5b389c,'userProfileId':_0x3bc88a[_0x5efa('0x4c')]},'raw':!![]})[_0x5efa('0x1f')](function(_0x2c1520){if(_0x2c1520&&_0x2c1520[_0x5efa('0x4d')]===0x0){return db['UserProfileResource'][_0x5efa('0x46')]({'name':_0x3feb46['name'],'resourceId':_0x3feb46['id'],'type':_0x2c1520[_0x5efa('0x27')],'sectionId':_0x2c1520['id']},{})[_0x5efa('0x1f')](function(){return _0x1e37df;});}else{return _0x1e37df;}})['catch'](function(_0x236c59){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x236c59);throw _0x236c59;});}return _0x1e37df;})[_0x5efa('0x1f')](respondWithResult(_0x627d01,0xc9))[_0x5efa('0x42')](handleError(_0x627d01,null));};exports['update']=function(_0x4b3dbf,_0x24b6dc){if(_0x4b3dbf[_0x5efa('0x47')]['id']){delete _0x4b3dbf[_0x5efa('0x47')]['id'];}return db[_0x5efa('0x2a')][_0x5efa('0x45')]({'where':{'id':_0x4b3dbf[_0x5efa('0x4e')]['id']}})['then'](handleEntityNotFound(_0x24b6dc,null))[_0x5efa('0x1f')](saveUpdates(_0x4b3dbf['body'],null))[_0x5efa('0x1f')](respondWithResult(_0x24b6dc,null))[_0x5efa('0x42')](handleError(_0x24b6dc,null));};exports[_0x5efa('0x23')]=function(_0x52772d,_0xff6ca8){return db[_0x5efa('0x2a')][_0x5efa('0x45')]({'where':{'id':_0x52772d[_0x5efa('0x4e')]['id']}})[_0x5efa('0x1f')](handleEntityNotFound(_0xff6ca8,null))[_0x5efa('0x1f')](removeEntity(_0xff6ca8,null))[_0x5efa('0x42')](handleError(_0xff6ca8,null));};exports[_0x5efa('0x4f')]=function(_0x1d9ba0,_0x5466fb,_0x3f687b){var _0x1f3e2e;return db[_0x5efa('0x2a')]['find']({'where':{'id':_0x1d9ba0[_0x5efa('0x4e')]['id']},'attributes':['id','dsn']})[_0x5efa('0x1f')](handleEntityNotFound(_0x5466fb,null))[_0x5efa('0x1f')](function(_0x36f464){if(_0x36f464){var _0x19d8cd=require(_0x5efa('0x50'))();_0x19d8cd[_0x5efa('0x51')](_0x36f464[_0x5efa('0x52')]);_0x19d8cd[_0x5efa('0x53')]();return _0x36f464;}})[_0x5efa('0x1f')](respondWithResult(_0x5466fb,null))[_0x5efa('0x42')](handleError(_0x5466fb,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index 057567a..e2dea91 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 _0x8a49=['util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareOdbc.attributes','exports','define','SquareOdbc','square_odbc'];(function(_0x12cfa0,_0x4975f5){var _0x111146=function(_0x32a80c){while(--_0x32a80c){_0x12cfa0['push'](_0x12cfa0['shift']());}};_0x111146(++_0x4975f5);}(_0x8a49,0x84));var _0x98a4=function(_0x329935,_0x24b29f){_0x329935=_0x329935-0x0;var _0x26d30a=_0x8a49[_0x329935];return _0x26d30a;};'use strict';var _=require('lodash');var util=require(_0x98a4('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x98a4('0x1'));var BPromise=require(_0x98a4('0x2'));var rp=require(_0x98a4('0x3'));var fs=require('fs');var path=require(_0x98a4('0x4'));var rimraf=require(_0x98a4('0x5'));var config=require(_0x98a4('0x6'));var attributes=require(_0x98a4('0x7'));module[_0x98a4('0x8')]=function(_0xd70186,_0x1d9dce){return _0xd70186[_0x98a4('0x9')](_0x98a4('0xa'),attributes,{'tableName':_0x98a4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2a2c=['./squareOdbc.attributes','exports','define','SquareOdbc','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x8de54f,_0x271987){var _0x14cba4=function(_0x58ed41){while(--_0x58ed41){_0x8de54f['push'](_0x8de54f['shift']());}};_0x14cba4(++_0x271987);}(_0x2a2c,0x197));var _0xc2a2=function(_0x769fc1,_0x4b4339){_0x769fc1=_0x769fc1-0x0;var _0x2bbb37=_0x2a2c[_0x769fc1];return _0x2bbb37;};'use strict';var _=require(_0xc2a2('0x0'));var util=require(_0xc2a2('0x1'));var logger=require('../../config/logger')(_0xc2a2('0x2'));var moment=require(_0xc2a2('0x3'));var BPromise=require(_0xc2a2('0x4'));var rp=require(_0xc2a2('0x5'));var fs=require('fs');var path=require(_0xc2a2('0x6'));var rimraf=require(_0xc2a2('0x7'));var config=require(_0xc2a2('0x8'));var attributes=require(_0xc2a2('0x9'));module[_0xc2a2('0xa')]=function(_0x149092,_0x401797){return _0x149092[_0xc2a2('0xb')](_0xc2a2('0xc'),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 fd9e822..211f619 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 _0x9a2d=['debug','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','request','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','message','result','ShowSquareOdbc','SquareOdbc','find','options','raw','where','attributes','include','map','model','then'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x9a2d,0xd3));var _0xd9a2=function(_0x37ace2,_0x3f3f7f){_0x37ace2=_0x37ace2-0x0;var _0x57060f=_0x9a2d[_0x37ace2];return _0x57060f;};'use strict';var _=require(_0xd9a2('0x0'));var util=require(_0xd9a2('0x1'));var moment=require(_0xd9a2('0x2'));var BPromise=require(_0xd9a2('0x3'));var rs=require(_0xd9a2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd9a2('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd9a2('0x6'))(_0xd9a2('0x7'));var config=require(_0xd9a2('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3d34e6,_0x3e1bdc,_0x10869f){return new BPromise(function(_0x5000ac,_0x281ccd){return client[_0xd9a2('0x9')](_0x3d34e6,_0x10869f)['then'](function(_0x50d063){logger[_0xd9a2('0xa')](_0xd9a2('0xb'),_0x3e1bdc,_0xd9a2('0xc'));logger['debug'](_0xd9a2('0xd'),_0x3e1bdc,_0xd9a2('0xc'),JSON[_0xd9a2('0xe')](_0x50d063));if(_0x50d063[_0xd9a2('0xf')]){if(_0x50d063[_0xd9a2('0xf')]['code']===0x1f4){logger[_0xd9a2('0xf')](_0xd9a2('0xb'),_0x3e1bdc,_0x50d063[_0xd9a2('0xf')]['message']);return _0x281ccd(_0x50d063[_0xd9a2('0xf')][_0xd9a2('0x10')]);}logger[_0xd9a2('0xf')](_0xd9a2('0xb'),_0x3e1bdc,_0x50d063['error'][_0xd9a2('0x10')]);return _0x5000ac(_0x50d063[_0xd9a2('0xf')][_0xd9a2('0x10')]);}else{logger['info'](_0xd9a2('0xb'),_0x3e1bdc,_0xd9a2('0xc'));_0x5000ac(_0x50d063[_0xd9a2('0x11')][_0xd9a2('0x10')]);}})['catch'](function(_0x2277c8){logger[_0xd9a2('0xf')](_0xd9a2('0xb'),_0x3e1bdc,_0x2277c8);_0x281ccd(_0x2277c8);});});}exports[_0xd9a2('0x12')]=function(_0x519fb4){var _0x17fe30=this;return new Promise(function(_0x212edb,_0x3bd267){return db[_0xd9a2('0x13')][_0xd9a2('0x14')]({'raw':_0x519fb4[_0xd9a2('0x15')]?_0x519fb4[_0xd9a2('0x15')][_0xd9a2('0x16')]===undefined?!![]:![]:!![],'where':_0x519fb4['options']?_0x519fb4[_0xd9a2('0x15')][_0xd9a2('0x17')]||null:null,'attributes':_0x519fb4[_0xd9a2('0x15')]?_0x519fb4[_0xd9a2('0x15')][_0xd9a2('0x18')]||null:null,'include':_0x519fb4[_0xd9a2('0x15')]?_0x519fb4[_0xd9a2('0x15')][_0xd9a2('0x19')]?_[_0xd9a2('0x1a')](_0x519fb4['options']['include'],function(_0x16a2b9){return{'model':db[_0x16a2b9[_0xd9a2('0x1b')]],'as':_0x16a2b9['as'],'attributes':_0x16a2b9['attributes'],'include':_0x16a2b9[_0xd9a2('0x19')]?_[_0xd9a2('0x1a')](_0x16a2b9[_0xd9a2('0x19')],function(_0xff88a9){return{'model':db[_0xff88a9[_0xd9a2('0x1b')]],'as':_0xff88a9['as'],'attributes':_0xff88a9[_0xd9a2('0x18')],'include':_0xff88a9[_0xd9a2('0x19')]?_[_0xd9a2('0x1a')](_0xff88a9['include'],function(_0x27de56){return{'model':db[_0x27de56['model']],'as':_0x27de56['as'],'attributes':_0x27de56['attributes']};}):[]};}):[]};}):[]:[]})[_0xd9a2('0x1c')](function(_0x52ab77){logger[_0xd9a2('0xa')](_0xd9a2('0x12'),_0x519fb4);logger[_0xd9a2('0x1d')](_0xd9a2('0x12'),_0x519fb4,JSON[_0xd9a2('0xe')](_0x52ab77));_0x212edb(_0x52ab77);})['catch'](function(_0xe4e804){logger[_0xd9a2('0xf')](_0xd9a2('0x12'),_0xe4e804[_0xd9a2('0x10')],_0x519fb4);_0x3bd267(_0x17fe30['error'](0x1f4,_0xe4e804['message']));});});}; \ No newline at end of file +var _0x9dbd=['error','code','SquareOdbc,\x20%s,\x20%s','message','result','catch','ShowSquareOdbc','SquareOdbc','find','options','raw','attributes','include','map','model','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x38aa54,_0x379627){var _0x46b04e=function(_0x21691e){while(--_0x21691e){_0x38aa54['push'](_0x38aa54['shift']());}};_0x46b04e(++_0x379627);}(_0x9dbd,0x72));var _0xd9db=function(_0x4d5b51,_0x4b2851){_0x4d5b51=_0x4d5b51-0x0;var _0x51db59=_0x9dbd[_0x4d5b51];return _0x51db59;};'use strict';var _=require(_0xd9db('0x0'));var util=require(_0xd9db('0x1'));var moment=require(_0xd9db('0x2'));var BPromise=require(_0xd9db('0x3'));var rs=require(_0xd9db('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd9db('0x5'))['db'];var utils=require(_0xd9db('0x6'));var logger=require(_0xd9db('0x7'))(_0xd9db('0x8'));var config=require('../../config/environment');var jayson=require(_0xd9db('0x9'));var client=jayson[_0xd9db('0xa')][_0xd9db('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x257b10,_0x39626e,_0x10ce11){return new BPromise(function(_0x16b1ff,_0x1dd60a){return client[_0xd9db('0xc')](_0x257b10,_0x10ce11)[_0xd9db('0xd')](function(_0x3ffbad){logger[_0xd9db('0xe')]('SquareOdbc,\x20%s,\x20%s',_0x39626e,'request\x20sent');logger[_0xd9db('0xf')](_0xd9db('0x10'),_0x39626e,'request\x20sent',JSON[_0xd9db('0x11')](_0x3ffbad));if(_0x3ffbad['error']){if(_0x3ffbad[_0xd9db('0x12')][_0xd9db('0x13')]===0x1f4){logger[_0xd9db('0x12')](_0xd9db('0x14'),_0x39626e,_0x3ffbad[_0xd9db('0x12')]['message']);return _0x1dd60a(_0x3ffbad[_0xd9db('0x12')][_0xd9db('0x15')]);}logger[_0xd9db('0x12')](_0xd9db('0x14'),_0x39626e,_0x3ffbad[_0xd9db('0x12')][_0xd9db('0x15')]);return _0x16b1ff(_0x3ffbad['error']['message']);}else{logger[_0xd9db('0xe')](_0xd9db('0x14'),_0x39626e,'request\x20sent');_0x16b1ff(_0x3ffbad[_0xd9db('0x16')][_0xd9db('0x15')]);}})[_0xd9db('0x17')](function(_0x203623){logger[_0xd9db('0x12')](_0xd9db('0x14'),_0x39626e,_0x203623);_0x1dd60a(_0x203623);});});}exports[_0xd9db('0x18')]=function(_0x38a3e4){var _0x2426cf=this;return new Promise(function(_0xf286c,_0x10243d){return db[_0xd9db('0x19')][_0xd9db('0x1a')]({'raw':_0x38a3e4[_0xd9db('0x1b')]?_0x38a3e4[_0xd9db('0x1b')][_0xd9db('0x1c')]===undefined?!![]:![]:!![],'where':_0x38a3e4['options']?_0x38a3e4[_0xd9db('0x1b')]['where']||null:null,'attributes':_0x38a3e4[_0xd9db('0x1b')]?_0x38a3e4[_0xd9db('0x1b')][_0xd9db('0x1d')]||null:null,'include':_0x38a3e4[_0xd9db('0x1b')]?_0x38a3e4[_0xd9db('0x1b')][_0xd9db('0x1e')]?_[_0xd9db('0x1f')](_0x38a3e4['options'][_0xd9db('0x1e')],function(_0x564195){return{'model':db[_0x564195[_0xd9db('0x20')]],'as':_0x564195['as'],'attributes':_0x564195[_0xd9db('0x1d')],'include':_0x564195[_0xd9db('0x1e')]?_[_0xd9db('0x1f')](_0x564195[_0xd9db('0x1e')],function(_0x2e34e1){return{'model':db[_0x2e34e1[_0xd9db('0x20')]],'as':_0x2e34e1['as'],'attributes':_0x2e34e1[_0xd9db('0x1d')],'include':_0x2e34e1[_0xd9db('0x1e')]?_[_0xd9db('0x1f')](_0x2e34e1[_0xd9db('0x1e')],function(_0x19a999){return{'model':db[_0x19a999[_0xd9db('0x20')]],'as':_0x19a999['as'],'attributes':_0x19a999[_0xd9db('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xd9db('0xd')](function(_0x458145){logger[_0xd9db('0xe')](_0xd9db('0x18'),_0x38a3e4);logger[_0xd9db('0xf')]('ShowSquareOdbc',_0x38a3e4,JSON['stringify'](_0x458145));_0xf286c(_0x458145);})[_0xd9db('0x17')](function(_0xa9098b){logger[_0xd9db('0x12')](_0xd9db('0x18'),_0xa9098b[_0xd9db('0x15')],_0x38a3e4);_0x10243d(_0x2426cf[_0xd9db('0x12')](0x1f4,_0xa9098b[_0xd9db('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index f10bd58..29514fa 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 _0xe1c2=['get','isAuthenticated','show','post','create','put','/:id','destroy','multer','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./squareProject.controller'];(function(_0x21c494,_0x3cb9c6){var _0x577fd2=function(_0x33e29a){while(--_0x33e29a){_0x21c494['push'](_0x21c494['shift']());}};_0x577fd2(++_0x3cb9c6);}(_0xe1c2,0x1ca));var _0x2e1c=function(_0x5a9925,_0x2e5624){_0x5a9925=_0x5a9925-0x0;var _0x374cb6=_0xe1c2[_0x5a9925];return _0x374cb6;};'use strict';var multer=require(_0x2e1c('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x2e1c('0x1'));var router=express[_0x2e1c('0x2')]();var fs_extra=require(_0x2e1c('0x3'));var auth=require(_0x2e1c('0x4'));var interaction=require(_0x2e1c('0x5'));var config=require('../../config/environment');var controller=require(_0x2e1c('0x6'));router[_0x2e1c('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/:id',auth[_0x2e1c('0x8')](),controller[_0x2e1c('0x9')]);router[_0x2e1c('0xa')]('/',auth['isAuthenticated'](),controller[_0x2e1c('0xb')]);router[_0x2e1c('0xc')](_0x2e1c('0xd'),auth[_0x2e1c('0x8')](),controller['update']);router['delete'](_0x2e1c('0xd'),auth['isAuthenticated'](),controller[_0x2e1c('0xe')]);module['exports']=router; \ No newline at end of file +var _0xd205=['update','delete','exports','util','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./squareProject.controller','isAuthenticated','index','get','show','post','put','/:id'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xd205,0x1ac));var _0x5d20=function(_0x16df9f,_0x55db97){_0x16df9f=_0x16df9f-0x0;var _0x16f0da=_0xd205[_0x16df9f];return _0x16f0da;};'use strict';var multer=require('multer');var util=require(_0x5d20('0x0'));var path=require('path');var timeout=require(_0x5d20('0x1'));var express=require(_0x5d20('0x2'));var router=express['Router']();var fs_extra=require(_0x5d20('0x3'));var auth=require(_0x5d20('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x5d20('0x5'));var controller=require(_0x5d20('0x6'));router['get']('/',auth[_0x5d20('0x7')](),controller[_0x5d20('0x8')]);router[_0x5d20('0x9')]('/:id',auth[_0x5d20('0x7')](),controller[_0x5d20('0xa')]);router[_0x5d20('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x5d20('0xc')](_0x5d20('0xd'),auth[_0x5d20('0x7')](),controller[_0x5d20('0xe')]);router[_0x5d20('0xf')]('/:id',auth[_0x5d20('0x7')](),controller['destroy']);module[_0x5d20('0x10')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 0802729..76cd836 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 _0x30b9=['utf8','long','production','DATE','sequelize','exports','STRING','name','TEXT','BLOB','getDataValue','preproduction','toString'];(function(_0x37a0ce,_0x28dc04){var _0x569f4e=function(_0x1671c0){while(--_0x1671c0){_0x37a0ce['push'](_0x37a0ce['shift']());}};_0x569f4e(++_0x28dc04);}(_0x30b9,0xd4));var _0x930b=function(_0x38e5ee,_0x3cd0cb){_0x38e5ee=_0x38e5ee-0x0;var _0x85812d=_0x30b9[_0x38e5ee];return _0x85812d;};'use strict';var Sequelize=require(_0x930b('0x0'));module[_0x930b('0x1')]={'name':{'type':Sequelize[_0x930b('0x2')],'unique':_0x930b('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x930b('0x2')]},'notes':{'type':Sequelize[_0x930b('0x4')]},'preproduction':{'type':Sequelize[_0x930b('0x5')]('long'),'get':function(){if(this[_0x930b('0x6')](_0x930b('0x7'))){return this[_0x930b('0x6')](_0x930b('0x7'))[_0x930b('0x8')](_0x930b('0x9'));}}},'production':{'type':Sequelize[_0x930b('0x5')](_0x930b('0xa')),'get':function(){if(this['getDataValue']('production')){return this[_0x930b('0x6')](_0x930b('0xb'))[_0x930b('0x8')](_0x930b('0x9'));}}},'savedAt':{'type':Sequelize[_0x930b('0xc')]},'publishedAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0x63e2=['exports','STRING','name','TEXT','BLOB','long','getDataValue','preproduction','utf8','production','toString','DATE'];(function(_0x1f2307,_0x36394e){var _0x66841b=function(_0x9abb9d){while(--_0x9abb9d){_0x1f2307['push'](_0x1f2307['shift']());}};_0x66841b(++_0x36394e);}(_0x63e2,0x180));var _0x263e=function(_0x5a015b,_0x3aa47a){_0x5a015b=_0x5a015b-0x0;var _0x12db7c=_0x63e2[_0x5a015b];return _0x12db7c;};'use strict';var Sequelize=require('sequelize');module[_0x263e('0x0')]={'name':{'type':Sequelize[_0x263e('0x1')],'unique':_0x263e('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x263e('0x1')]},'notes':{'type':Sequelize[_0x263e('0x3')]},'preproduction':{'type':Sequelize[_0x263e('0x4')](_0x263e('0x5')),'get':function(){if(this['getDataValue']('preproduction')){return this[_0x263e('0x6')](_0x263e('0x7'))['toString'](_0x263e('0x8'));}}},'production':{'type':Sequelize[_0x263e('0x4')](_0x263e('0x5')),'get':function(){if(this[_0x263e('0x6')](_0x263e('0x9'))){return this['getDataValue'](_0x263e('0x9'))[_0x263e('0xa')](_0x263e('0x8'));}}},'savedAt':{'type':Sequelize[_0x263e('0xb')]},'publishedAt':{'type':Sequelize[_0x263e('0xb')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index ba8afa6..f683958 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 _0xfc9a=['../../mysqldb','defaults','localhost','socket.io-emitter','./squareProject.socket','status','offset','undefined','count','limit','set','Content-Range','update','then','destroy','get','SquareProjects','UserProfileResource','publish','sendStatus','error','stack','index','map','SquareProject','rawAttributes','fieldName','type','key','name','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','rows','catch','show','params','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','redis','agi','stringify','lodash','ioredis','../../components/parsers/qs','../../config/logger','api'];(function(_0xd16466,_0x401512){var _0x5b4cf0=function(_0x3ca147){while(--_0x3ca147){_0xd16466['push'](_0xd16466['shift']());}};_0x5b4cf0(++_0x401512);}(_0xfc9a,0x87));var _0xafc9=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xfc9a[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0xafc9('0x0'));var Redis=require(_0xafc9('0x1'));var qs=require(_0xafc9('0x2'));var logger=require(_0xafc9('0x3'))(_0xafc9('0x4'));var config=require('../../config/environment');var db=require(_0xafc9('0x5'))['db'];config['redis']=_[_0xafc9('0x6')](config['redis'],{'host':_0xafc9('0x7'),'port':0x18eb});var socket=require(_0xafc9('0x8'))(new Redis(config['redis']));require(_0xafc9('0x9'))['register'](socket);function respondWithResult(_0x3a3552,_0x195754){_0x195754=_0x195754||0xc8;return function(_0x40d2be){if(_0x40d2be){return _0x3a3552[_0xafc9('0xa')](_0x195754)['json'](_0x40d2be);}};}function respondWithFilteredResult(_0x1118bb,_0x2abfbd){return function(_0x2dd2e8){if(_0x2dd2e8){var _0x929b3b=typeof _0x2abfbd[_0xafc9('0xb')]===_0xafc9('0xc')&&typeof _0x2abfbd['limit']===_0xafc9('0xc');var _0x114c9f=_0x2dd2e8[_0xafc9('0xd')];var _0xb5f9b9=_0x929b3b?0x0:_0x2abfbd[_0xafc9('0xb')];var _0x191caf=_0x929b3b?_0x2dd2e8[_0xafc9('0xd')]:_0x2abfbd[_0xafc9('0xb')]+_0x2abfbd[_0xafc9('0xe')];var _0x44e730;if(_0x191caf>=_0x114c9f){_0x191caf=_0x114c9f;_0x44e730=0xc8;}else{_0x44e730=0xce;}_0x1118bb['status'](_0x44e730);return _0x1118bb[_0xafc9('0xf')](_0xafc9('0x10'),_0xb5f9b9+'-'+_0x191caf+'/'+_0x114c9f)['json'](_0x2dd2e8);}return null;};}function saveUpdates(_0x3b5174){return function(_0x314b7c){if(_0x314b7c){return _0x314b7c[_0xafc9('0x11')](_0x3b5174)[_0xafc9('0x12')](function(_0x4e7632){return _0x4e7632;});}return null;};}function removeEntity(_0x44670e){return function(_0x2fb36a){if(_0x2fb36a){return _0x2fb36a[_0xafc9('0x13')]()[_0xafc9('0x12')](function(){var _0x241e0a=_0x2fb36a[_0xafc9('0x14')]({'plain':!![]});var _0x2979b3=_0xafc9('0x15');return db[_0xafc9('0x16')]['destroy']({'where':{'type':_0x2979b3,'resourceId':_0x241e0a['id']}})[_0xafc9('0x12')](function(){return _0x2fb36a;});})[_0xafc9('0x12')](function(){var _0x25bbbe=new Redis(config['redis']);_0x25bbbe[_0xafc9('0x17')]('agi',JSON['stringify']({'id':_0x2fb36a['id'],'deleted':!![]}));})['then'](function(){_0x44670e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x455ff1){return function(_0x24ceff){if(!_0x24ceff){_0x455ff1[_0xafc9('0x18')](0x194);}return _0x24ceff;};}function handleError(_0x4014f7,_0x4d6822){_0x4d6822=_0x4d6822||0x1f4;return function(_0x17941b){logger[_0xafc9('0x19')](_0x17941b[_0xafc9('0x1a')]);if(_0x17941b['name']){delete _0x17941b['name'];}_0x4014f7['status'](_0x4d6822)['send'](_0x17941b);};}exports[_0xafc9('0x1b')]=function(_0x14da11,_0xdfb293){var _0xa7362={},_0x242d8d={},_0xce90c7={'count':0x0,'rows':[]};var _0x2dea3a=_[_0xafc9('0x1c')](db[_0xafc9('0x1d')][_0xafc9('0x1e')],function(_0xe2ce78){return{'name':_0xe2ce78[_0xafc9('0x1f')],'type':_0xe2ce78[_0xafc9('0x20')][_0xafc9('0x21')]};});_0x242d8d['model']=_[_0xafc9('0x1c')](_0x2dea3a,_0xafc9('0x22'));_0x242d8d['query']=_[_0xafc9('0x23')](_0x14da11[_0xafc9('0x24')]);_0x242d8d[_0xafc9('0x25')]=_[_0xafc9('0x26')](_0x242d8d[_0xafc9('0x27')],_0x242d8d[_0xafc9('0x24')]);_0xa7362['attributes']=_['intersection'](_0x242d8d[_0xafc9('0x27')],qs[_0xafc9('0x28')](_0x14da11[_0xafc9('0x24')][_0xafc9('0x28')]));_0xa7362[_0xafc9('0x29')]=_0xa7362['attributes'][_0xafc9('0x2a')]?_0xa7362[_0xafc9('0x29')]:_0x242d8d['model'];if(!_0x14da11[_0xafc9('0x24')][_0xafc9('0x2b')](_0xafc9('0x2c'))){_0xa7362[_0xafc9('0xe')]=qs[_0xafc9('0xe')](_0x14da11[_0xafc9('0x24')][_0xafc9('0xe')]);_0xa7362[_0xafc9('0xb')]=qs[_0xafc9('0xb')](_0x14da11[_0xafc9('0x24')][_0xafc9('0xb')]);}_0xa7362[_0xafc9('0x2d')]=qs[_0xafc9('0x2e')](_0x14da11[_0xafc9('0x24')]['sort']);_0xa7362[_0xafc9('0x2f')]=qs[_0xafc9('0x25')](_[_0xafc9('0x30')](_0x14da11['query'],_0x242d8d[_0xafc9('0x25')]),_0x2dea3a);if(_0x14da11[_0xafc9('0x24')][_0xafc9('0x31')]){_0xa7362[_0xafc9('0x2f')]=_[_0xafc9('0x32')](_0xa7362[_0xafc9('0x2f')],{'$or':_[_0xafc9('0x1c')](_0x2dea3a,function(_0x17a8de){if(_0x17a8de[_0xafc9('0x20')]!=='VIRTUAL'){var _0x2e88d5={};_0x2e88d5[_0x17a8de[_0xafc9('0x22')]]={'$like':'%'+_0x14da11[_0xafc9('0x24')][_0xafc9('0x31')]+'%'};return _0x2e88d5;}})});}_0xa7362=_[_0xafc9('0x32')]({},_0xa7362,_0x14da11[_0xafc9('0x33')]);var _0xe7194d={'where':_0xa7362[_0xafc9('0x2f')]};return db[_0xafc9('0x1d')][_0xafc9('0xd')](_0xe7194d)[_0xafc9('0x12')](function(_0x4ffb71){_0xce90c7[_0xafc9('0xd')]=_0x4ffb71;if(_0x14da11[_0xafc9('0x24')]['includeAll']){_0xa7362[_0xafc9('0x34')]=[{'all':!![]}];}return db[_0xafc9('0x1d')]['findAll'](_0xa7362);})['then'](function(_0x447d5d){_0xce90c7[_0xafc9('0x35')]=_0x447d5d;return _0xce90c7;})[_0xafc9('0x12')](respondWithFilteredResult(_0xdfb293,_0xa7362))[_0xafc9('0x36')](handleError(_0xdfb293,null));};exports[_0xafc9('0x37')]=function(_0x12f8d4,_0x36bf3f){var _0xcd95cf={'raw':![],'where':{'id':_0x12f8d4[_0xafc9('0x38')]['id']}},_0x25731b={};_0x25731b[_0xafc9('0x27')]=_['keys'](db[_0xafc9('0x1d')][_0xafc9('0x1e')]);_0x25731b[_0xafc9('0x24')]=_[_0xafc9('0x23')](_0x12f8d4[_0xafc9('0x24')]);_0x25731b['filters']=_[_0xafc9('0x26')](_0x25731b[_0xafc9('0x27')],_0x25731b[_0xafc9('0x24')]);_0xcd95cf[_0xafc9('0x29')]=_[_0xafc9('0x26')](_0x25731b[_0xafc9('0x27')],qs[_0xafc9('0x28')](_0x12f8d4['query'][_0xafc9('0x28')]));_0xcd95cf[_0xafc9('0x29')]=_0xcd95cf[_0xafc9('0x29')][_0xafc9('0x2a')]?_0xcd95cf[_0xafc9('0x29')]:_0x25731b['model'];if(_0x12f8d4[_0xafc9('0x24')][_0xafc9('0x39')]){_0xcd95cf[_0xafc9('0x34')]=[{'all':!![]}];}_0xcd95cf=_[_0xafc9('0x32')]({},_0xcd95cf,_0x12f8d4[_0xafc9('0x33')]);return db['SquareProject'][_0xafc9('0x3a')](_0xcd95cf)['then'](handleEntityNotFound(_0x36bf3f,null))[_0xafc9('0x12')](respondWithResult(_0x36bf3f,null))[_0xafc9('0x36')](handleError(_0x36bf3f,null));};exports[_0xafc9('0x3b')]=function(_0x1f5161,_0x18c904){return db[_0xafc9('0x1d')][_0xafc9('0x3b')](_0x1f5161['body'],{})['then'](function(_0x2f95d3){var _0x84305c=_0x1f5161[_0xafc9('0x3c')]['get']({'plain':!![]});if(!_0x84305c)throw new Error(_0xafc9('0x3d'));if(_0x84305c[_0xafc9('0x3e')]===_0xafc9('0x3c')){var _0x5dce4c=_0x2f95d3[_0xafc9('0x14')]({'plain':!![]});var _0x151c90=_0xafc9('0x15');return db[_0xafc9('0x3f')][_0xafc9('0x3a')]({'where':{'name':_0x151c90,'userProfileId':_0x84305c['userProfileId']},'raw':!![]})[_0xafc9('0x12')](function(_0x3a2946){if(_0x3a2946&&_0x3a2946[_0xafc9('0x40')]===0x0){return db[_0xafc9('0x16')][_0xafc9('0x3b')]({'name':_0x5dce4c[_0xafc9('0x22')],'resourceId':_0x5dce4c['id'],'type':_0x3a2946[_0xafc9('0x22')],'sectionId':_0x3a2946['id']},{})[_0xafc9('0x12')](function(){return _0x2f95d3;});}else{return _0x2f95d3;}})[_0xafc9('0x36')](function(_0x2f8040){logger[_0xafc9('0x19')](_0xafc9('0x41'),_0x2f8040);throw _0x2f8040;});}return _0x2f95d3;})[_0xafc9('0x12')](respondWithResult(_0x18c904,0xc9))[_0xafc9('0x36')](handleError(_0x18c904,null));};exports[_0xafc9('0x11')]=function(_0x2b137,_0x4e3bd3){if(_0x2b137[_0xafc9('0x42')]['id']){delete _0x2b137[_0xafc9('0x42')]['id'];}return db[_0xafc9('0x1d')][_0xafc9('0x3a')]({'where':{'id':_0x2b137[_0xafc9('0x38')]['id']}})[_0xafc9('0x12')](handleEntityNotFound(_0x4e3bd3,null))[_0xafc9('0x12')](saveUpdates(_0x2b137[_0xafc9('0x42')],null))[_0xafc9('0x12')](function(_0x4799be){if(!_0x4799be)return;var _0x4ed3ba=_0x4799be[_0xafc9('0x14')]({'plain':!![]});return _0x4ed3ba;})[_0xafc9('0x12')](function(_0x4aba2e){var _0x38c396=new Redis(config[_0xafc9('0x43')]);_0x38c396['publish'](_0xafc9('0x44'),JSON[_0xafc9('0x45')](_[_0xafc9('0x30')](_0x4aba2e,['id','name','production'])));return _0x4aba2e;})[_0xafc9('0x12')](respondWithResult(_0x4e3bd3,null))[_0xafc9('0x36')](handleError(_0x4e3bd3,null));};exports[_0xafc9('0x13')]=function(_0x5bed5c,_0x2e1747){return db['SquareProject'][_0xafc9('0x3a')]({'where':{'id':_0x5bed5c['params']['id']}})['then'](handleEntityNotFound(_0x2e1747,null))[_0xafc9('0x12')](removeEntity(_0x2e1747,null))['catch'](handleError(_0x2e1747,null));}; \ No newline at end of file +var _0xddda=['name','index','rawAttributes','fieldName','type','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','SquareProject','includeAll','include','findAll','rows','show','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','stringify','production','lodash','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','status','json','offset','limit','undefined','count','set','Content-Range','update','then','destroy','get','UserProfileResource','publish','agi','end','sendStatus','error'];(function(_0x4ddd99,_0x11bbcd){var _0x583ca6=function(_0x1e36d8){while(--_0x1e36d8){_0x4ddd99['push'](_0x4ddd99['shift']());}};_0x583ca6(++_0x11bbcd);}(_0xddda,0x13d));var _0xaddd=function(_0x2991d8,_0x6b8bf4){_0x2991d8=_0x2991d8-0x0;var _0x17e45b=_0xddda[_0x2991d8];return _0x17e45b;};'use strict';var _=require(_0xaddd('0x0'));var Redis=require(_0xaddd('0x1'));var qs=require(_0xaddd('0x2'));var logger=require(_0xaddd('0x3'))('api');var config=require(_0xaddd('0x4'));var db=require(_0xaddd('0x5'))['db'];config[_0xaddd('0x6')]=_[_0xaddd('0x7')](config[_0xaddd('0x6')],{'host':_0xaddd('0x8'),'port':0x18eb});var socket=require(_0xaddd('0x9'))(new Redis(config[_0xaddd('0x6')]));require('./squareProject.socket')['register'](socket);function respondWithResult(_0x5aaf58,_0x55b229){_0x55b229=_0x55b229||0xc8;return function(_0x44f12d){if(_0x44f12d){return _0x5aaf58[_0xaddd('0xa')](_0x55b229)[_0xaddd('0xb')](_0x44f12d);}};}function respondWithFilteredResult(_0x263952,_0x309086){return function(_0x523b10){if(_0x523b10){var _0x18fa96=typeof _0x309086[_0xaddd('0xc')]==='undefined'&&typeof _0x309086[_0xaddd('0xd')]===_0xaddd('0xe');var _0x125500=_0x523b10[_0xaddd('0xf')];var _0x109555=_0x18fa96?0x0:_0x309086[_0xaddd('0xc')];var _0x1f7e2e=_0x18fa96?_0x523b10[_0xaddd('0xf')]:_0x309086['offset']+_0x309086[_0xaddd('0xd')];var _0x1019d8;if(_0x1f7e2e>=_0x125500){_0x1f7e2e=_0x125500;_0x1019d8=0xc8;}else{_0x1019d8=0xce;}_0x263952['status'](_0x1019d8);return _0x263952[_0xaddd('0x10')](_0xaddd('0x11'),_0x109555+'-'+_0x1f7e2e+'/'+_0x125500)[_0xaddd('0xb')](_0x523b10);}return null;};}function saveUpdates(_0x140de7){return function(_0x3a0250){if(_0x3a0250){return _0x3a0250[_0xaddd('0x12')](_0x140de7)[_0xaddd('0x13')](function(_0x2ad742){return _0x2ad742;});}return null;};}function removeEntity(_0x2ab00d){return function(_0x5f3b16){if(_0x5f3b16){return _0x5f3b16[_0xaddd('0x14')]()[_0xaddd('0x13')](function(){var _0x21593a=_0x5f3b16[_0xaddd('0x15')]({'plain':!![]});var _0x5da048='SquareProjects';return db[_0xaddd('0x16')][_0xaddd('0x14')]({'where':{'type':_0x5da048,'resourceId':_0x21593a['id']}})[_0xaddd('0x13')](function(){return _0x5f3b16;});})[_0xaddd('0x13')](function(){var _0x4a13d5=new Redis(config[_0xaddd('0x6')]);_0x4a13d5[_0xaddd('0x17')](_0xaddd('0x18'),JSON['stringify']({'id':_0x5f3b16['id'],'deleted':!![]}));})['then'](function(){_0x2ab00d[_0xaddd('0xa')](0xcc)[_0xaddd('0x19')]();});}};}function handleEntityNotFound(_0x33aebf){return function(_0xe02095){if(!_0xe02095){_0x33aebf[_0xaddd('0x1a')](0x194);}return _0xe02095;};}function handleError(_0x1c67cd,_0x320e81){_0x320e81=_0x320e81||0x1f4;return function(_0x18182d){logger[_0xaddd('0x1b')](_0x18182d['stack']);if(_0x18182d[_0xaddd('0x1c')]){delete _0x18182d[_0xaddd('0x1c')];}_0x1c67cd[_0xaddd('0xa')](_0x320e81)['send'](_0x18182d);};}exports[_0xaddd('0x1d')]=function(_0x18af4b,_0x213afc){var _0x5479cb={},_0xaf8aa9={},_0x1bb1b3={'count':0x0,'rows':[]};var _0x11535e=_['map'](db['SquareProject'][_0xaddd('0x1e')],function(_0x32cd3a){return{'name':_0x32cd3a[_0xaddd('0x1f')],'type':_0x32cd3a[_0xaddd('0x20')]['key']};});_0xaf8aa9['model']=_[_0xaddd('0x21')](_0x11535e,'name');_0xaf8aa9[_0xaddd('0x22')]=_[_0xaddd('0x23')](_0x18af4b[_0xaddd('0x22')]);_0xaf8aa9[_0xaddd('0x24')]=_[_0xaddd('0x25')](_0xaf8aa9[_0xaddd('0x26')],_0xaf8aa9[_0xaddd('0x22')]);_0x5479cb[_0xaddd('0x27')]=_['intersection'](_0xaf8aa9['model'],qs[_0xaddd('0x28')](_0x18af4b['query']['fields']));_0x5479cb[_0xaddd('0x27')]=_0x5479cb['attributes'][_0xaddd('0x29')]?_0x5479cb[_0xaddd('0x27')]:_0xaf8aa9[_0xaddd('0x26')];if(!_0x18af4b[_0xaddd('0x22')][_0xaddd('0x2a')]('nolimit')){_0x5479cb[_0xaddd('0xd')]=qs[_0xaddd('0xd')](_0x18af4b[_0xaddd('0x22')]['limit']);_0x5479cb[_0xaddd('0xc')]=qs[_0xaddd('0xc')](_0x18af4b[_0xaddd('0x22')][_0xaddd('0xc')]);}_0x5479cb[_0xaddd('0x2b')]=qs['sort'](_0x18af4b[_0xaddd('0x22')][_0xaddd('0x2c')]);_0x5479cb[_0xaddd('0x2d')]=qs['filters'](_[_0xaddd('0x2e')](_0x18af4b[_0xaddd('0x22')],_0xaf8aa9[_0xaddd('0x24')]),_0x11535e);if(_0x18af4b[_0xaddd('0x22')][_0xaddd('0x2f')]){_0x5479cb[_0xaddd('0x2d')]=_[_0xaddd('0x30')](_0x5479cb['where'],{'$or':_[_0xaddd('0x21')](_0x11535e,function(_0x427d43){if(_0x427d43[_0xaddd('0x20')]!==_0xaddd('0x31')){var _0x1d3406={};_0x1d3406[_0x427d43[_0xaddd('0x1c')]]={'$like':'%'+_0x18af4b[_0xaddd('0x22')][_0xaddd('0x2f')]+'%'};return _0x1d3406;}})});}_0x5479cb=_[_0xaddd('0x30')]({},_0x5479cb,_0x18af4b['options']);var _0x3938cf={'where':_0x5479cb['where']};return db[_0xaddd('0x32')][_0xaddd('0xf')](_0x3938cf)[_0xaddd('0x13')](function(_0x5acd85){_0x1bb1b3[_0xaddd('0xf')]=_0x5acd85;if(_0x18af4b['query'][_0xaddd('0x33')]){_0x5479cb[_0xaddd('0x34')]=[{'all':!![]}];}return db[_0xaddd('0x32')][_0xaddd('0x35')](_0x5479cb);})['then'](function(_0x37d648){_0x1bb1b3[_0xaddd('0x36')]=_0x37d648;return _0x1bb1b3;})[_0xaddd('0x13')](respondWithFilteredResult(_0x213afc,_0x5479cb))['catch'](handleError(_0x213afc,null));};exports[_0xaddd('0x37')]=function(_0x2c3cb4,_0x5c06d1){var _0x49e991={'raw':![],'where':{'id':_0x2c3cb4['params']['id']}},_0x432913={};_0x432913[_0xaddd('0x26')]=_[_0xaddd('0x23')](db[_0xaddd('0x32')]['rawAttributes']);_0x432913['query']=_[_0xaddd('0x23')](_0x2c3cb4['query']);_0x432913['filters']=_[_0xaddd('0x25')](_0x432913[_0xaddd('0x26')],_0x432913[_0xaddd('0x22')]);_0x49e991[_0xaddd('0x27')]=_[_0xaddd('0x25')](_0x432913[_0xaddd('0x26')],qs[_0xaddd('0x28')](_0x2c3cb4[_0xaddd('0x22')][_0xaddd('0x28')]));_0x49e991[_0xaddd('0x27')]=_0x49e991[_0xaddd('0x27')][_0xaddd('0x29')]?_0x49e991[_0xaddd('0x27')]:_0x432913[_0xaddd('0x26')];if(_0x2c3cb4[_0xaddd('0x22')][_0xaddd('0x33')]){_0x49e991[_0xaddd('0x34')]=[{'all':!![]}];}_0x49e991=_[_0xaddd('0x30')]({},_0x49e991,_0x2c3cb4[_0xaddd('0x38')]);return db['SquareProject'][_0xaddd('0x39')](_0x49e991)[_0xaddd('0x13')](handleEntityNotFound(_0x5c06d1,null))[_0xaddd('0x13')](respondWithResult(_0x5c06d1,null))[_0xaddd('0x3a')](handleError(_0x5c06d1,null));};exports[_0xaddd('0x3b')]=function(_0x2d7444,_0x1e86b4){return db[_0xaddd('0x32')][_0xaddd('0x3b')](_0x2d7444[_0xaddd('0x3c')],{})[_0xaddd('0x13')](function(_0x44ac59){var _0x54bc30=_0x2d7444[_0xaddd('0x3d')][_0xaddd('0x15')]({'plain':!![]});if(!_0x54bc30)throw new Error(_0xaddd('0x3e'));if(_0x54bc30[_0xaddd('0x3f')]===_0xaddd('0x3d')){var _0x101fb5=_0x44ac59[_0xaddd('0x15')]({'plain':!![]});var _0x241e93='SquareProjects';return db['UserProfileSection'][_0xaddd('0x39')]({'where':{'name':_0x241e93,'userProfileId':_0x54bc30[_0xaddd('0x40')]},'raw':!![]})[_0xaddd('0x13')](function(_0x1ebb18){if(_0x1ebb18&&_0x1ebb18[_0xaddd('0x41')]===0x0){return db[_0xaddd('0x16')]['create']({'name':_0x101fb5['name'],'resourceId':_0x101fb5['id'],'type':_0x1ebb18[_0xaddd('0x1c')],'sectionId':_0x1ebb18['id']},{})['then'](function(){return _0x44ac59;});}else{return _0x44ac59;}})[_0xaddd('0x3a')](function(_0x7fac0a){logger['error'](_0xaddd('0x42'),_0x7fac0a);throw _0x7fac0a;});}return _0x44ac59;})[_0xaddd('0x13')](respondWithResult(_0x1e86b4,0xc9))[_0xaddd('0x3a')](handleError(_0x1e86b4,null));};exports[_0xaddd('0x12')]=function(_0x5d0834,_0x527e9b){if(_0x5d0834[_0xaddd('0x3c')]['id']){delete _0x5d0834[_0xaddd('0x3c')]['id'];}return db[_0xaddd('0x32')]['find']({'where':{'id':_0x5d0834['params']['id']}})['then'](handleEntityNotFound(_0x527e9b,null))[_0xaddd('0x13')](saveUpdates(_0x5d0834['body'],null))[_0xaddd('0x13')](function(_0x575015){if(!_0x575015)return;var _0x3893fc=_0x575015[_0xaddd('0x15')]({'plain':!![]});return _0x3893fc;})[_0xaddd('0x13')](function(_0xb40aa9){var _0x5b6c54=new Redis(config[_0xaddd('0x6')]);_0x5b6c54[_0xaddd('0x17')](_0xaddd('0x18'),JSON[_0xaddd('0x43')](_[_0xaddd('0x2e')](_0xb40aa9,['id',_0xaddd('0x1c'),_0xaddd('0x44')])));return _0xb40aa9;})['then'](respondWithResult(_0x527e9b,null))[_0xaddd('0x3a')](handleError(_0x527e9b,null));};exports['destroy']=function(_0x2786ef,_0x30a6ee){return db[_0xaddd('0x32')][_0xaddd('0x39')]({'where':{'id':_0x2786ef['params']['id']}})[_0xaddd('0x13')](handleEntityNotFound(_0x30a6ee,null))[_0xaddd('0x13')](removeEntity(_0x30a6ee,null))[_0xaddd('0x3a')](handleError(_0x30a6ee,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index d915ca1..cb61702 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 _0xca7e=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','remove'];(function(_0x4dca58,_0x74424){var _0x5f3a5c=function(_0x165bab){while(--_0x165bab){_0x4dca58['push'](_0x4dca58['shift']());}};_0x5f3a5c(++_0x74424);}(_0xca7e,0x11b));var _0xeca7=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0xca7e[_0x40220a];return _0x3903cc;};'use strict';var EventEmitter=require(_0xeca7('0x0'));var SquareProject=require(_0xeca7('0x1'))['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xeca7('0x2')](0x0);var events={'afterCreate':_0xeca7('0x3'),'afterUpdate':'update','afterDestroy':_0xeca7('0x4')};function emitEvent(_0x3ab555){return function(_0x589fae,_0x25d46e,_0x35a096){SquareProjectEvents[_0xeca7('0x5')](_0x3ab555+':'+_0x589fae['id'],_0x589fae);SquareProjectEvents[_0xeca7('0x5')](_0x3ab555,_0x589fae);_0x35a096(null);};}for(var e in events){if(events[_0xeca7('0x6')](e)){var event=events[e];SquareProject[_0xeca7('0x7')](e,emitEvent(event));}}module[_0xeca7('0x8')]=SquareProjectEvents; \ No newline at end of file +var _0xde21=['../../mysqldb','SquareProject','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0xde21,0x107));var _0x1de2=function(_0x5a405b,_0x2550b9){_0x5a405b=_0x5a405b-0x0;var _0x19145e=_0xde21[_0x5a405b];return _0x19145e;};'use strict';var EventEmitter=require(_0x1de2('0x0'));var SquareProject=require(_0x1de2('0x1'))['db'][_0x1de2('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x1de2('0x3')](0x0);var events={'afterCreate':_0x1de2('0x4'),'afterUpdate':_0x1de2('0x5'),'afterDestroy':_0x1de2('0x6')};function emitEvent(_0x1288d4){return function(_0x3a25c2,_0x63cb6f,_0x22a106){SquareProjectEvents[_0x1de2('0x7')](_0x1288d4+':'+_0x3a25c2['id'],_0x3a25c2);SquareProjectEvents[_0x1de2('0x7')](_0x1288d4,_0x3a25c2);_0x22a106(null);};}for(var e in events){if(events[_0x1de2('0x8')](e)){var event=events[e];SquareProject[_0x1de2('0x9')](e,emitEvent(event));}}module[_0x1de2('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 beb599e..84dbe94 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 _0x9d23=['path','rimraf','./squareProject.attributes','exports','SquareProject','changed','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','production','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x421fa9,_0x5da593){var _0x366b27=function(_0x5ece8e){while(--_0x5ece8e){_0x421fa9['push'](_0x421fa9['shift']());}};_0x366b27(++_0x5da593);}(_0x9d23,0x13a));var _0x39d2=function(_0xaf87e6,_0x2ccd84){_0xaf87e6=_0xaf87e6-0x0;var _0x1c6c8a=_0x9d23[_0xaf87e6];return _0x1c6c8a;};'use strict';var _=require(_0x39d2('0x0'));var util=require(_0x39d2('0x1'));var logger=require(_0x39d2('0x2'))(_0x39d2('0x3'));var moment=require(_0x39d2('0x4'));var BPromise=require(_0x39d2('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x39d2('0x6'));var rimraf=require(_0x39d2('0x7'));var config=require('../../config/environment');var attributes=require(_0x39d2('0x8'));module[_0x39d2('0x9')]=function(_0xd2a2f,_0x32b41d){return _0xd2a2f['define'](_0x39d2('0xa'),attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x45f726,_0xc6b9de,_0x441aea){if(_0x45f726[_0x39d2('0xb')]('preproduction')){_0x45f726[_0x39d2('0xc')]=moment()[_0x39d2('0xd')](_0x39d2('0xe'));}if(_0x45f726[_0x39d2('0xb')](_0x39d2('0xf'))){_0x45f726['publishedAt']=moment()['format'](_0x39d2('0xe'));}_0x441aea(null,_0x45f726);}}});}; \ No newline at end of file +var _0x7587=['path','../../config/environment','./squareProject.attributes','define','SquareProject','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','changed','production','publishedAt','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0xab4a7c,_0x28b640){var _0x4b0bd2=function(_0x254009){while(--_0x254009){_0xab4a7c['push'](_0xab4a7c['shift']());}};_0x4b0bd2(++_0x28b640);}(_0x7587,0x1bb));var _0x7758=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0x7587[_0x3054be];return _0x3df150;};'use strict';var _=require(_0x7758('0x0'));var util=require(_0x7758('0x1'));var logger=require(_0x7758('0x2'))(_0x7758('0x3'));var moment=require(_0x7758('0x4'));var BPromise=require(_0x7758('0x5'));var rp=require(_0x7758('0x6'));var fs=require('fs');var path=require(_0x7758('0x7'));var rimraf=require('rimraf');var config=require(_0x7758('0x8'));var attributes=require(_0x7758('0x9'));module['exports']=function(_0x2a56e5,_0x140e71){return _0x2a56e5[_0x7758('0xa')](_0x7758('0xb'),attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xe2f5a6,_0x1a2bb3,_0x27dd8f){if(_0xe2f5a6['changed']('preproduction')){_0xe2f5a6[_0x7758('0xc')]=moment()[_0x7758('0xd')](_0x7758('0xe'));}if(_0xe2f5a6[_0x7758('0xf')](_0x7758('0x10'))){_0xe2f5a6[_0x7758('0x11')]=moment()[_0x7758('0xd')](_0x7758('0xe'));}_0x27dd8f(null,_0xe2f5a6);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index f0f06cf..82a68bf 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 _0xcf34=['lodash','ioredis','../../mysqldb','rpc','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','SquareProject','findAll','options','attributes','limit','include','map','model','GetSquareProjects','debug','catch','message','error','ShowSquareProject','find','then'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xcf34,0x1ee));var _0x4cf3=function(_0x20aae1,_0x51efd4){_0x20aae1=_0x20aae1-0x0;var _0x510601=_0xcf34[_0x20aae1];return _0x510601;};'use strict';var _=require(_0x4cf3('0x0'));var Redis=require(_0x4cf3('0x1'));var db=require(_0x4cf3('0x2'))['db'];var logger=require('../../config/logger')(_0x4cf3('0x3'));var config=require('../../config/environment');config[_0x4cf3('0x4')]=_[_0x4cf3('0x5')](config[_0x4cf3('0x4')],{'host':_0x4cf3('0x6'),'port':0x18eb});var socket=require(_0x4cf3('0x7'))(new Redis(config['redis']));require(_0x4cf3('0x8'))[_0x4cf3('0x9')](socket);exports['GetSquareProjects']=function(_0x1a7aed){var _0x3f2a30=this;return new Promise(function(_0x5b098c,_0x5dd2d1){return db[_0x4cf3('0xa')][_0x4cf3('0xb')]({'raw':_0x1a7aed['options']?_0x1a7aed[_0x4cf3('0xc')]['raw']===undefined?!![]:![]:!![],'where':_0x1a7aed['options']?_0x1a7aed['options']['where']||null:null,'attributes':_0x1a7aed['options']?_0x1a7aed['options'][_0x4cf3('0xd')]||null:null,'limit':_0x1a7aed[_0x4cf3('0xc')]?_0x1a7aed[_0x4cf3('0xc')][_0x4cf3('0xe')]||null:null,'include':_0x1a7aed['options']?_0x1a7aed[_0x4cf3('0xc')][_0x4cf3('0xf')]?_[_0x4cf3('0x10')](_0x1a7aed[_0x4cf3('0xc')][_0x4cf3('0xf')],function(_0x11fcf4){return{'model':db[_0x11fcf4[_0x4cf3('0x11')]],'as':_0x11fcf4['as'],'attributes':_0x11fcf4[_0x4cf3('0xd')],'include':_0x11fcf4[_0x4cf3('0xf')]?_[_0x4cf3('0x10')](_0x11fcf4['include'],function(_0x2c9029){return{'model':db[_0x2c9029['model']],'as':_0x2c9029['as'],'attributes':_0x2c9029[_0x4cf3('0xd')],'include':_0x2c9029[_0x4cf3('0xf')]?_['map'](_0x2c9029[_0x4cf3('0xf')],function(_0x4eac46){return{'model':db[_0x4eac46[_0x4cf3('0x11')]],'as':_0x4eac46['as'],'attributes':_0x4eac46[_0x4cf3('0xd')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2f08fd){logger['info'](_0x4cf3('0x12'),_0x1a7aed);logger[_0x4cf3('0x13')](_0x4cf3('0x12'),_0x1a7aed,JSON['stringify'](_0x2f08fd));_0x5b098c(_0x2f08fd);})[_0x4cf3('0x14')](function(_0x317c59){logger['error'](_0x4cf3('0x12'),_0x317c59[_0x4cf3('0x15')],_0x1a7aed);_0x5dd2d1(_0x3f2a30[_0x4cf3('0x16')](0x1f4,_0x317c59['message']));});});};exports[_0x4cf3('0x17')]=function(_0x2591ce){var _0x47d35a=this;return new Promise(function(_0x31f755,_0x26a942){return db[_0x4cf3('0xa')][_0x4cf3('0x18')]({'raw':_0x2591ce[_0x4cf3('0xc')]?_0x2591ce[_0x4cf3('0xc')]['raw']===undefined?!![]:![]:!![],'where':_0x2591ce[_0x4cf3('0xc')]?_0x2591ce[_0x4cf3('0xc')]['where']||null:null,'attributes':_0x2591ce[_0x4cf3('0xc')]?_0x2591ce[_0x4cf3('0xc')][_0x4cf3('0xd')]||null:null,'include':_0x2591ce[_0x4cf3('0xc')]?_0x2591ce[_0x4cf3('0xc')][_0x4cf3('0xf')]?_[_0x4cf3('0x10')](_0x2591ce[_0x4cf3('0xc')][_0x4cf3('0xf')],function(_0x456ef4){return{'model':db[_0x456ef4['model']],'as':_0x456ef4['as'],'attributes':_0x456ef4['attributes'],'include':_0x456ef4[_0x4cf3('0xf')]?_[_0x4cf3('0x10')](_0x456ef4[_0x4cf3('0xf')],function(_0x5f2acc){return{'model':db[_0x5f2acc[_0x4cf3('0x11')]],'as':_0x5f2acc['as'],'attributes':_0x5f2acc[_0x4cf3('0xd')],'include':_0x5f2acc[_0x4cf3('0xf')]?_[_0x4cf3('0x10')](_0x5f2acc[_0x4cf3('0xf')],function(_0xad6dea){return{'model':db[_0xad6dea[_0x4cf3('0x11')]],'as':_0xad6dea['as'],'attributes':_0xad6dea['attributes']};}):[]};}):[]};}):[]:[]})[_0x4cf3('0x19')](function(_0x51d43f){logger['info'](_0x4cf3('0x17'),_0x2591ce);logger['debug'](_0x4cf3('0x17'),_0x2591ce,JSON['stringify'](_0x51d43f));_0x31f755(_0x51d43f);})[_0x4cf3('0x14')](function(_0x300bb9){logger[_0x4cf3('0x16')]('ShowSquareProject',_0x300bb9[_0x4cf3('0x15')],_0x2591ce);_0x26a942(_0x47d35a['error'](0x1f4,_0x300bb9['message']));});});}; \ No newline at end of file +var _0x5c4e=['../../config/environment','redis','defaults','socket.io-emitter','register','GetSquareProjects','SquareProject','findAll','options','raw','where','attributes','limit','map','include','model','then','info','debug','stringify','error','message','find','ShowSquareProject','lodash','../../mysqldb'];(function(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0x5c4e,0x9a));var _0xe5c4=function(_0x2bc551,_0x35c0bf){_0x2bc551=_0x2bc551-0x0;var _0x4466db=_0x5c4e[_0x2bc551];return _0x4466db;};'use strict';var _=require(_0xe5c4('0x0'));var Redis=require('ioredis');var db=require(_0xe5c4('0x1'))['db'];var logger=require('../../config/logger')('rpc');var config=require(_0xe5c4('0x2'));config[_0xe5c4('0x3')]=_[_0xe5c4('0x4')](config[_0xe5c4('0x3')],{'host':'localhost','port':0x18eb});var socket=require(_0xe5c4('0x5'))(new Redis(config[_0xe5c4('0x3')]));require('./squareProject.socket')[_0xe5c4('0x6')](socket);exports[_0xe5c4('0x7')]=function(_0xd82673){var _0x1e529c=this;return new Promise(function(_0x4ee591,_0xf82889){return db[_0xe5c4('0x8')][_0xe5c4('0x9')]({'raw':_0xd82673[_0xe5c4('0xa')]?_0xd82673[_0xe5c4('0xa')][_0xe5c4('0xb')]===undefined?!![]:![]:!![],'where':_0xd82673['options']?_0xd82673[_0xe5c4('0xa')][_0xe5c4('0xc')]||null:null,'attributes':_0xd82673[_0xe5c4('0xa')]?_0xd82673[_0xe5c4('0xa')][_0xe5c4('0xd')]||null:null,'limit':_0xd82673[_0xe5c4('0xa')]?_0xd82673[_0xe5c4('0xa')][_0xe5c4('0xe')]||null:null,'include':_0xd82673[_0xe5c4('0xa')]?_0xd82673[_0xe5c4('0xa')]['include']?_[_0xe5c4('0xf')](_0xd82673[_0xe5c4('0xa')][_0xe5c4('0x10')],function(_0x33972f){return{'model':db[_0x33972f[_0xe5c4('0x11')]],'as':_0x33972f['as'],'attributes':_0x33972f['attributes'],'include':_0x33972f['include']?_[_0xe5c4('0xf')](_0x33972f['include'],function(_0x5aff5b){return{'model':db[_0x5aff5b[_0xe5c4('0x11')]],'as':_0x5aff5b['as'],'attributes':_0x5aff5b['attributes'],'include':_0x5aff5b[_0xe5c4('0x10')]?_['map'](_0x5aff5b[_0xe5c4('0x10')],function(_0x40a51c){return{'model':db[_0x40a51c[_0xe5c4('0x11')]],'as':_0x40a51c['as'],'attributes':_0x40a51c['attributes']};}):[]};}):[]};}):[]:[]})[_0xe5c4('0x12')](function(_0x1092f0){logger[_0xe5c4('0x13')](_0xe5c4('0x7'),_0xd82673);logger[_0xe5c4('0x14')](_0xe5c4('0x7'),_0xd82673,JSON[_0xe5c4('0x15')](_0x1092f0));_0x4ee591(_0x1092f0);})['catch'](function(_0x13f09c){logger[_0xe5c4('0x16')]('GetSquareProjects',_0x13f09c[_0xe5c4('0x17')],_0xd82673);_0xf82889(_0x1e529c[_0xe5c4('0x16')](0x1f4,_0x13f09c[_0xe5c4('0x17')]));});});};exports['ShowSquareProject']=function(_0xa3dbed){var _0x403ee7=this;return new Promise(function(_0xa189cf,_0x1f7049){return db['SquareProject'][_0xe5c4('0x18')]({'raw':_0xa3dbed['options']?_0xa3dbed[_0xe5c4('0xa')][_0xe5c4('0xb')]===undefined?!![]:![]:!![],'where':_0xa3dbed[_0xe5c4('0xa')]?_0xa3dbed[_0xe5c4('0xa')]['where']||null:null,'attributes':_0xa3dbed['options']?_0xa3dbed[_0xe5c4('0xa')]['attributes']||null:null,'include':_0xa3dbed[_0xe5c4('0xa')]?_0xa3dbed['options'][_0xe5c4('0x10')]?_['map'](_0xa3dbed['options'][_0xe5c4('0x10')],function(_0x366c43){return{'model':db[_0x366c43[_0xe5c4('0x11')]],'as':_0x366c43['as'],'attributes':_0x366c43[_0xe5c4('0xd')],'include':_0x366c43[_0xe5c4('0x10')]?_[_0xe5c4('0xf')](_0x366c43[_0xe5c4('0x10')],function(_0xe1adcf){return{'model':db[_0xe1adcf[_0xe5c4('0x11')]],'as':_0xe1adcf['as'],'attributes':_0xe1adcf['attributes'],'include':_0xe1adcf[_0xe5c4('0x10')]?_[_0xe5c4('0xf')](_0xe1adcf[_0xe5c4('0x10')],function(_0x42deae){return{'model':db[_0x42deae[_0xe5c4('0x11')]],'as':_0x42deae['as'],'attributes':_0x42deae[_0xe5c4('0xd')]};}):[]};}):[]};}):[]:[]})[_0xe5c4('0x12')](function(_0x560402){logger['info'](_0xe5c4('0x19'),_0xa3dbed);logger[_0xe5c4('0x14')]('ShowSquareProject',_0xa3dbed,JSON[_0xe5c4('0x15')](_0x560402));_0xa189cf(_0x560402);})['catch'](function(_0x35cb3a){logger['error'](_0xe5c4('0x19'),_0x35cb3a['message'],_0xa3dbed);_0x1f7049(_0x403ee7[_0xe5c4('0x16')](0x1f4,_0x35cb3a[_0xe5c4('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index 078e472..2808e3c 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 _0xffcb=['update','emit','register','length','squareProject:','./squareProject.events','save','remove'];(function(_0x7228f7,_0x306ea9){var _0xf7b00b=function(_0x4b4309){while(--_0x4b4309){_0x7228f7['push'](_0x7228f7['shift']());}};_0xf7b00b(++_0x306ea9);}(_0xffcb,0x165));var _0xbffc=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xffcb[_0x502c7d];return _0x30b7ed;};'use strict';var SquareProjectEvents=require(_0xbffc('0x0'));var events=[_0xbffc('0x1'),_0xbffc('0x2'),_0xbffc('0x3')];function createListener(_0x50abd6,_0x4d3400){return function(_0x4ba361){_0x4d3400[_0xbffc('0x4')](_0x50abd6,_0x4ba361);};}function removeListener(_0x271998,_0x59e747){return function(){SquareProjectEvents['removeListener'](_0x271998,_0x59e747);};}exports[_0xbffc('0x5')]=function(_0x463061){for(var _0x121b72=0x0,_0x130400=events[_0xbffc('0x6')];_0x121b72<_0x130400;_0x121b72++){var _0xfbafaf=events[_0x121b72];var _0x1ab8df=createListener(_0xbffc('0x7')+_0xfbafaf,_0x463061);SquareProjectEvents['on'](_0xfbafaf,_0x1ab8df);}}; \ No newline at end of file +var _0xa788=['length','squareProject:','remove','emit'];(function(_0x5228cc,_0x31e708){var _0x5b8f6a=function(_0x11deb8){while(--_0x11deb8){_0x5228cc['push'](_0x5228cc['shift']());}};_0x5b8f6a(++_0x31e708);}(_0xa788,0xfa));var _0x8a78=function(_0x321fc3,_0x233331){_0x321fc3=_0x321fc3-0x0;var _0x38cdb8=_0xa788[_0x321fc3];return _0x38cdb8;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=['save',_0x8a78('0x0'),'update'];function createListener(_0x294c3e,_0x8afc2a){return function(_0x478593){_0x8afc2a[_0x8a78('0x1')](_0x294c3e,_0x478593);};}function removeListener(_0x26b0e0,_0xfc9e1a){return function(){SquareProjectEvents['removeListener'](_0x26b0e0,_0xfc9e1a);};}exports['register']=function(_0x1399af){for(var _0x5c2255=0x0,_0x2c3157=events[_0x8a78('0x2')];_0x5c2255<_0x2c3157;_0x5c2255++){var _0x1390fd=events[_0x5c2255];var _0x4cd18a=createListener(_0x8a78('0x3')+_0x1390fd,_0x1399af);SquareProjectEvents['on'](_0x1390fd,_0x4cd18a);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index e952de6..b92c089 100644 --- a/server/api/squareRecording/index.js +++ b/server/api/squareRecording/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','index','/:id','isAuthenticated','post','put','update','delete','destroy','exports','multer','util','path','express'];(function(_0x58a7f7,_0x5e01e0){var _0x120447=function(_0x141c72){while(--_0x141c72){_0x58a7f7['push'](_0x58a7f7['shift']());}};_0x120447(++_0x5e01e0);}(_0x7a54,0x106));var _0x47a5=function(_0x46a507,_0x3ad636){_0x46a507=_0x46a507-0x0;var _0x5e575b=_0x7a54[_0x46a507];return _0x5e575b;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0x9')]('/:id/download',auth['isAuthenticated'](),controller['download']);router[_0x47a5('0xd')]('/',auth[_0x47a5('0xc')](),controller['create']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);router[_0x47a5('0x10')](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x11')]);module[_0x47a5('0x12')]=router; \ No newline at end of file +var _0x326f=['multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','/:id','show','download','post','create','put','delete','exports'];(function(_0x51491a,_0x8858df){var _0x3f2b9d=function(_0x1239d3){while(--_0x1239d3){_0x51491a['push'](_0x51491a['shift']());}};_0x3f2b9d(++_0x8858df);}(_0x326f,0xd1));var _0xf326=function(_0x117c5d,_0x2997f3){_0x117c5d=_0x117c5d-0x0;var _0x248b58=_0x326f[_0x117c5d];return _0x248b58;};'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 fs_extra=require(_0xf326('0x4'));var auth=require(_0xf326('0x5'));var interaction=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var controller=require(_0xf326('0x8'));router[_0xf326('0x9')]('/',auth[_0xf326('0xa')](),controller['index']);router[_0xf326('0x9')](_0xf326('0xb'),auth[_0xf326('0xa')](),controller[_0xf326('0xc')]);router['get']('/:id/download',auth['isAuthenticated'](),controller[_0xf326('0xd')]);router[_0xf326('0xe')]('/',auth[_0xf326('0xa')](),controller[_0xf326('0xf')]);router[_0xf326('0x10')]('/:id',auth[_0xf326('0xa')](),controller['update']);router[_0xf326('0x11')]('/:id',auth[_0xf326('0xa')](),controller['destroy']);module[_0xf326('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index 7e42906..2efb860 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 _0x5fc3=['sequelize','exports','STRING','VIRTUAL','getDataValue','savePath','substring','lastIndexOf'];(function(_0x65d12e,_0x4b0a30){var _0x4274e0=function(_0x121624){while(--_0x121624){_0x65d12e['push'](_0x65d12e['shift']());}};_0x4274e0(++_0x4b0a30);}(_0x5fc3,0xa8));var _0x35fc=function(_0x2bf888,_0x374f0b){_0x2bf888=_0x2bf888-0x0;var _0x3038d6=_0x5fc3[_0x2bf888];return _0x3038d6;};'use strict';var Sequelize=require(_0x35fc('0x0'));module[_0x35fc('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x35fc('0x2')]},'calleridname':{'type':Sequelize[_0x35fc('0x2')]},'context':{'type':Sequelize[_0x35fc('0x2')]},'extension':{'type':Sequelize[_0x35fc('0x2')]},'priority':{'type':Sequelize[_0x35fc('0x2')]},'accountcode':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x35fc('0x2')]},'projectName':{'type':Sequelize[_0x35fc('0x2')]},'saveName':{'type':Sequelize[_0x35fc('0x2')]},'filename':{'type':Sequelize['STRING']},'savePath':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x35fc('0x3')],'get':function(){var _0x508b32='';var _0x16e153=this[_0x35fc('0x4')](_0x35fc('0x5'));if(_0x16e153){_0x508b32=_0x16e153[_0x35fc('0x6')](_0x16e153[_0x35fc('0x7')]('.'));}return _0x508b32;}}}; \ No newline at end of file +var _0x7dfd=['substring','lastIndexOf','sequelize','exports','STRING','VIRTUAL','savePath'];(function(_0x258df2,_0x3d0e78){var _0x4a4277=function(_0x10cbf6){while(--_0x10cbf6){_0x258df2['push'](_0x258df2['shift']());}};_0x4a4277(++_0x3d0e78);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xd7df('0x0'));module[_0xd7df('0x1')]={'uniqueid':{'type':Sequelize[_0xd7df('0x2')]},'callerid':{'type':Sequelize[_0xd7df('0x2')]},'calleridname':{'type':Sequelize[_0xd7df('0x2')]},'context':{'type':Sequelize[_0xd7df('0x2')]},'extension':{'type':Sequelize[_0xd7df('0x2')]},'priority':{'type':Sequelize[_0xd7df('0x2')]},'accountcode':{'type':Sequelize[_0xd7df('0x2')]},'dnid':{'type':Sequelize[_0xd7df('0x2')]},'projectName':{'type':Sequelize[_0xd7df('0x2')]},'saveName':{'type':Sequelize[_0xd7df('0x2')]},'filename':{'type':Sequelize[_0xd7df('0x2')]},'savePath':{'type':Sequelize[_0xd7df('0x2')]},'format':{'type':Sequelize[_0xd7df('0x3')],'get':function(){var _0x16e50='';var _0x2c48a4=this['getDataValue'](_0xd7df('0x4'));if(_0x2c48a4){_0x16e50=_0x2c48a4[_0xd7df('0x5')](_0x2c48a4[_0xd7df('0x6')]('.'));}return _0x16e50;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index cc7ef0f..ade33f5 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 _0x7a7a=['cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','unlinkSync','.cypher','info','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','Content-Range','apply','reject','update','then','error','stack','name','send','index','SquareRecording','rawAttributes','fieldName','model','keys','query','filters','attributes','fields','length','nolimit','order','sort','where','pick','filter','map','type','VIRTUAL','options','count','include','findAll','catch','params','intersection','includeAll','merge','find','create','body','download','uniqueid','savePath','filename','format','%s.cypher','secrets','recording','existsSync','Sequelize','ValidationError','SquareRecording\x20not\x20found','extname','unlink','Not\x20found','destroy','isNil','Entity\x20not\x20found'];(function(_0x474d10,_0x1b2d34){var _0x166ec9=function(_0xac72f0){while(--_0xac72f0){_0x474d10['push'](_0x474d10['shift']());}};_0x166ec9(++_0x1b2d34);}(_0x7a7a,0x69));var _0xa7a7=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0x7a7a[_0x1969a7];return _0x3d665f;};'use strict';var emlformat=require(_0xa7a7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa7a7('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa7a7('0x2'));var moment=require(_0xa7a7('0x3'));var BPromise=require(_0xa7a7('0x4'));var Mustache=require(_0xa7a7('0x5'));var util=require(_0xa7a7('0x6'));var path=require(_0xa7a7('0x7'));var sox=require(_0xa7a7('0x8'));var csv=require(_0xa7a7('0x9'));var ejs=require(_0xa7a7('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa7a7('0xb'));var squel=require(_0xa7a7('0xc'));var crypto=require(_0xa7a7('0xd'));var jsforce=require(_0xa7a7('0xe'));var deskjs=require(_0xa7a7('0xf'));var toCsv=require(_0xa7a7('0x9'));var querystring=require(_0xa7a7('0x10'));var Papa=require(_0xa7a7('0x11'));var Redis=require(_0xa7a7('0x12'));var authService=require(_0xa7a7('0x13'));var qs=require(_0xa7a7('0x14'));var as=require(_0xa7a7('0x15'));var hardwareService=require(_0xa7a7('0x16'));var logger=require('../../config/logger')(_0xa7a7('0x17'));var utils=require(_0xa7a7('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xa7a7('0x19'));var db=require(_0xa7a7('0x1a'))['db'];function respondWithStatusCode(_0x39a4a4,_0x86d125){_0x86d125=_0x86d125||0xcc;return function(_0x44beba){if(_0x44beba){return _0x39a4a4[_0xa7a7('0x1b')](_0x86d125);}return _0x39a4a4['status'](_0x86d125)[_0xa7a7('0x1c')]();};}function respondWithResult(_0xcc9695,_0xa6768a){_0xa6768a=_0xa6768a||0xc8;return function(_0x5ecf02){if(_0x5ecf02){return _0xcc9695[_0xa7a7('0x1d')](_0xa6768a)[_0xa7a7('0x1e')](_0x5ecf02);}};}function respondWithFilteredResult(_0x48154e,_0x5da572){return function(_0xe6d054){if(_0xe6d054){var _0x4eb921=typeof _0x5da572['offset']===_0xa7a7('0x1f')&&typeof _0x5da572[_0xa7a7('0x20')]===_0xa7a7('0x1f');var _0x59005b=_0xe6d054['count'];var _0x364c29=_0x4eb921?0x0:_0x5da572[_0xa7a7('0x21')];var _0x3294aa=_0x4eb921?_0xe6d054['count']:_0x5da572['offset']+_0x5da572[_0xa7a7('0x20')];var _0x2bf938;if(_0x3294aa>=_0x59005b){_0x3294aa=_0x59005b;_0x2bf938=0xc8;}else{_0x2bf938=0xce;}_0x48154e[_0xa7a7('0x1d')](_0x2bf938);return _0x48154e['set'](_0xa7a7('0x22'),_0x364c29+'-'+_0x3294aa+'/'+_0x59005b)[_0xa7a7('0x1e')](_0xe6d054);}return null;};}function patchUpdates(_0x1c5fe0){return function(_0x1e1f85){try{jsonpatch[_0xa7a7('0x23')](_0x1e1f85,_0x1c5fe0,!![]);}catch(_0x8d29fd){return BPromise[_0xa7a7('0x24')](_0x8d29fd);}return _0x1e1f85['save']();};}function saveUpdates(_0x4ce5bf,_0x4c7b64){return function(_0x326bdb){if(_0x326bdb){return _0x326bdb[_0xa7a7('0x25')](_0x4ce5bf)[_0xa7a7('0x26')](function(_0x46da68){return _0x46da68;});}return null;};}function removeEntity(_0x2a4650,_0x34f156){return function(_0x43c82e){if(_0x43c82e){return _0x43c82e['destroy']()[_0xa7a7('0x26')](function(){_0x2a4650[_0xa7a7('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5177b5,_0xa8e2d4){return function(_0x556925){if(!_0x556925){_0x5177b5[_0xa7a7('0x1b')](0x194);}return _0x556925;};}function handleError(_0x2a6e26,_0x138fe1){_0x138fe1=_0x138fe1||0x1f4;return function(_0x2bc7f0){logger[_0xa7a7('0x27')](_0x2bc7f0[_0xa7a7('0x28')]);if(_0x2bc7f0[_0xa7a7('0x29')]){delete _0x2bc7f0[_0xa7a7('0x29')];}_0x2a6e26['status'](_0x138fe1)[_0xa7a7('0x2a')](_0x2bc7f0);};}exports[_0xa7a7('0x2b')]=function(_0x5c4630,_0x5bfa90){var _0x130723={},_0x4d9fc7={},_0x483e6b={'count':0x0,'rows':[]};var _0x4192d9=_['map'](db[_0xa7a7('0x2c')][_0xa7a7('0x2d')],function(_0x3661eb){return{'name':_0x3661eb[_0xa7a7('0x2e')],'type':_0x3661eb['type']['key']};});_0x4d9fc7[_0xa7a7('0x2f')]=_['map'](_0x4192d9,'name');_0x4d9fc7['query']=_[_0xa7a7('0x30')](_0x5c4630[_0xa7a7('0x31')]);_0x4d9fc7[_0xa7a7('0x32')]=_['intersection'](_0x4d9fc7[_0xa7a7('0x2f')],_0x4d9fc7[_0xa7a7('0x31')]);_0x130723[_0xa7a7('0x33')]=_['intersection'](_0x4d9fc7['model'],qs[_0xa7a7('0x34')](_0x5c4630[_0xa7a7('0x31')][_0xa7a7('0x34')]));_0x130723[_0xa7a7('0x33')]=_0x130723[_0xa7a7('0x33')][_0xa7a7('0x35')]?_0x130723[_0xa7a7('0x33')]:_0x4d9fc7[_0xa7a7('0x2f')];if(!_0x5c4630[_0xa7a7('0x31')]['hasOwnProperty'](_0xa7a7('0x36'))){_0x130723[_0xa7a7('0x20')]=qs[_0xa7a7('0x20')](_0x5c4630['query']['limit']);_0x130723[_0xa7a7('0x21')]=qs[_0xa7a7('0x21')](_0x5c4630['query']['offset']);}_0x130723[_0xa7a7('0x37')]=qs[_0xa7a7('0x38')](_0x5c4630['query'][_0xa7a7('0x38')]);_0x130723[_0xa7a7('0x39')]=qs['filters'](_[_0xa7a7('0x3a')](_0x5c4630[_0xa7a7('0x31')],_0x4d9fc7[_0xa7a7('0x32')]),_0x4192d9);if(_0x5c4630['query'][_0xa7a7('0x3b')]){_0x130723['where']=_['merge'](_0x130723[_0xa7a7('0x39')],{'$or':_[_0xa7a7('0x3c')](_0x4192d9,function(_0x4a711a){if(_0x4a711a[_0xa7a7('0x3d')]!==_0xa7a7('0x3e')){var _0xceaf0b={};_0xceaf0b[_0x4a711a[_0xa7a7('0x29')]]={'$like':'%'+_0x5c4630[_0xa7a7('0x31')][_0xa7a7('0x3b')]+'%'};return _0xceaf0b;}})});}_0x130723=_['merge']({},_0x130723,_0x5c4630[_0xa7a7('0x3f')]);var _0x22ca1c={'where':_0x130723['where']};return db[_0xa7a7('0x2c')][_0xa7a7('0x40')](_0x22ca1c)['then'](function(_0xaf1fc8){_0x483e6b[_0xa7a7('0x40')]=_0xaf1fc8;if(_0x5c4630[_0xa7a7('0x31')]['includeAll']){_0x130723[_0xa7a7('0x41')]=[{'all':!![]}];}return db['SquareRecording'][_0xa7a7('0x42')](_0x130723);})[_0xa7a7('0x26')](function(_0xb6d41f){_0x483e6b['rows']=_0xb6d41f;return _0x483e6b;})['then'](respondWithFilteredResult(_0x5bfa90,_0x130723))[_0xa7a7('0x43')](handleError(_0x5bfa90,null));};exports['show']=function(_0x38aadd,_0x1490e8){var _0x58760c={'raw':!![],'where':{'id':_0x38aadd[_0xa7a7('0x44')]['id']}},_0x40a338={};_0x40a338[_0xa7a7('0x2f')]=_[_0xa7a7('0x30')](db['SquareRecording'][_0xa7a7('0x2d')]);_0x40a338[_0xa7a7('0x31')]=_[_0xa7a7('0x30')](_0x38aadd[_0xa7a7('0x31')]);_0x40a338['filters']=_['intersection'](_0x40a338[_0xa7a7('0x2f')],_0x40a338[_0xa7a7('0x31')]);_0x58760c[_0xa7a7('0x33')]=_[_0xa7a7('0x45')](_0x40a338['model'],qs[_0xa7a7('0x34')](_0x38aadd[_0xa7a7('0x31')][_0xa7a7('0x34')]));_0x58760c[_0xa7a7('0x33')]=_0x58760c[_0xa7a7('0x33')][_0xa7a7('0x35')]?_0x58760c[_0xa7a7('0x33')]:_0x40a338[_0xa7a7('0x2f')];if(_0x38aadd[_0xa7a7('0x31')][_0xa7a7('0x46')]){_0x58760c['include']=[{'all':!![]}];}_0x58760c=_[_0xa7a7('0x47')]({},_0x58760c,_0x38aadd[_0xa7a7('0x3f')]);return db[_0xa7a7('0x2c')][_0xa7a7('0x48')](_0x58760c)[_0xa7a7('0x26')](handleEntityNotFound(_0x1490e8,null))[_0xa7a7('0x26')](respondWithResult(_0x1490e8,null))[_0xa7a7('0x43')](handleError(_0x1490e8,null));};exports[_0xa7a7('0x49')]=function(_0x199876,_0x40c51b){return db[_0xa7a7('0x2c')][_0xa7a7('0x49')](_0x199876['body'],{})[_0xa7a7('0x26')](respondWithResult(_0x40c51b,0xc9))[_0xa7a7('0x43')](handleError(_0x40c51b,null));};exports[_0xa7a7('0x25')]=function(_0x44cd16,_0x42bdff){if(_0x44cd16[_0xa7a7('0x4a')]['id']){delete _0x44cd16[_0xa7a7('0x4a')]['id'];}return db[_0xa7a7('0x2c')][_0xa7a7('0x48')]({'where':{'id':_0x44cd16[_0xa7a7('0x44')]['id']}})[_0xa7a7('0x26')](handleEntityNotFound(_0x42bdff,null))[_0xa7a7('0x26')](saveUpdates(_0x44cd16[_0xa7a7('0x4a')],null))['then'](respondWithResult(_0x42bdff,null))[_0xa7a7('0x43')](handleError(_0x42bdff,null));};exports[_0xa7a7('0x4b')]=function(_0x4a18d8,_0x545d7a,_0x3b6f98){var _0x12892c=require('../../components/encryptor');var _0x31c361=![];var _0x1a9186={};if(_0x4a18d8[_0xa7a7('0x31')]['type']&&_0x4a18d8[_0xa7a7('0x31')][_0xa7a7('0x3d')]===_0xa7a7('0x4c')){_0x1a9186[_0xa7a7('0x4c')]=_0x4a18d8[_0xa7a7('0x44')]['id'];}else{_0x1a9186['id']=_0x4a18d8[_0xa7a7('0x44')]['id'];}return db[_0xa7a7('0x2c')][_0xa7a7('0x48')]({'where':_0x1a9186,'attributes':['id',_0xa7a7('0x4d'),_0xa7a7('0x4e')],'raw':!![]})[_0xa7a7('0x26')](handleEntityNotFound(_0x545d7a,null))['then'](function(_0x4e1bf2){if(_0x4e1bf2){var _0x311371=_0x4e1bf2[_0xa7a7('0x4d')];var _0x75d418=util[_0xa7a7('0x4f')](_0xa7a7('0x50'),_0x311371);if(fs['existsSync'](_0x75d418)){_0x31c361=!![];return _0x12892c['decryptFile'](_0x75d418,_0x311371,config[_0xa7a7('0x51')][_0xa7a7('0x52')])['then'](function(){return _0x4e1bf2;});}return _0x4e1bf2;}})['then'](function(_0x2de3aa){if(_0x2de3aa){var _0x404186=_0x2de3aa['savePath'];if(!fs[_0xa7a7('0x53')](_0x404186)){throw new db[(_0xa7a7('0x54'))][(_0xa7a7('0x55'))](_0xa7a7('0x56'));}if(_0x2de3aa[_0xa7a7('0x4e')]){return _0x545d7a[_0xa7a7('0x4b')](_0x404186,_0x2de3aa['filename']+path[_0xa7a7('0x57')](_0x404186),function(){if(_0x31c361){fs[_0xa7a7('0x58')](_0x404186);}});}else{return _0x545d7a['download'](_0x404186,function(_0x53b1e7){if(_0x31c361){fs['unlink'](_0x404186);}});}}})[_0xa7a7('0x43')](function(_0x374f71){if(_0x374f71['message']===_0xa7a7('0x56')){_0x545d7a['status'](0x194)[_0xa7a7('0x2a')](_0xa7a7('0x59'));}else{return handleError(_0x545d7a,null);}});};exports[_0xa7a7('0x5a')]=function(_0x400621,_0x5e2182){return db[_0xa7a7('0x2c')][_0xa7a7('0x48')]({'where':{'id':_0x400621[_0xa7a7('0x44')]['id']}})[_0xa7a7('0x26')](function(_0x495d34){if(_[_0xa7a7('0x5b')](_0x495d34)){throw new ReferenceError(_0xa7a7('0x5c'));}return _0x495d34;})[_0xa7a7('0x26')](function(_0x10c63a){var _0x308ee3=_0x10c63a[_0xa7a7('0x4d')];logger['info'](_0xa7a7('0x5d'),_0x308ee3);if(!_[_0xa7a7('0x5b')](_0x10c63a[_0xa7a7('0x4d')])&&fs[_0xa7a7('0x53')](_0x308ee3)){logger['info'](_0xa7a7('0x5e')+_0x308ee3+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xa7a7('0x5f')](_0x308ee3);}_0x308ee3=_0x308ee3+_0xa7a7('0x60');if(!_[_0xa7a7('0x5b')](_0x10c63a[_0xa7a7('0x4d')])&&fs['existsSync'](_0x308ee3)){logger[_0xa7a7('0x61')](_0xa7a7('0x5e')+_0x308ee3+_0xa7a7('0x62'));fs[_0xa7a7('0x5f')](_0x308ee3);}return _0x10c63a;})[_0xa7a7('0x26')](function(_0x221a75){if(!_0x221a75)throw new InternalError();return _0x221a75[_0xa7a7('0x5a')]();})[_0xa7a7('0x26')](function(){_0x5e2182['status'](0xcc)[_0xa7a7('0x1c')]();})[_0xa7a7('0x43')](handleError(_0x5e2182,null));}; \ No newline at end of file +var _0x8223=['where','filters','pick','filter','merge','options','includeAll','findAll','rows','show','params','include','find','catch','create','body','download','../../components/encryptor','uniqueid','savePath','filename','format','%s.cypher','existsSync','decryptFile','secrets','Sequelize','SquareRecording\x20not\x20found','extname','unlink','message','Not\x20found','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','rimraf','zip-dir','fast-json-patch','request-promise','moment','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','update','destroy','then','stack','name','send','index','map','SquareRecording','rawAttributes','type','query','keys','intersection','model','fields','attributes','length','nolimit','order','sort'];(function(_0x544372,_0x102d0a){var _0x45bf94=function(_0x4ffbdc){while(--_0x4ffbdc){_0x544372['push'](_0x544372['shift']());}};_0x45bf94(++_0x102d0a);}(_0x8223,0x80));var _0x3822=function(_0x111f05,_0x3801da){_0x111f05=_0x111f05-0x0;var _0xbcdf6a=_0x8223[_0x111f05];return _0xbcdf6a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3822('0x0'));var zipdir=require(_0x3822('0x1'));var jsonpatch=require(_0x3822('0x2'));var rp=require(_0x3822('0x3'));var moment=require(_0x3822('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x3822('0x5'));var crypto=require(_0x3822('0x6'));var jsforce=require(_0x3822('0x7'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3822('0x8'));var Redis=require(_0x3822('0x9'));var authService=require(_0x3822('0xa'));var qs=require(_0x3822('0xb'));var as=require(_0x3822('0xc'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3822('0xd'))('api');var utils=require(_0x3822('0xe'));var config=require(_0x3822('0xf'));var licenseUtil=require(_0x3822('0x10'));var db=require(_0x3822('0x11'))['db'];function respondWithStatusCode(_0x3a65c4,_0x5c975a){_0x5c975a=_0x5c975a||0xcc;return function(_0xa15b22){if(_0xa15b22){return _0x3a65c4[_0x3822('0x12')](_0x5c975a);}return _0x3a65c4['status'](_0x5c975a)[_0x3822('0x13')]();};}function respondWithResult(_0x498f3e,_0x55c74c){_0x55c74c=_0x55c74c||0xc8;return function(_0xb85e51){if(_0xb85e51){return _0x498f3e[_0x3822('0x14')](_0x55c74c)[_0x3822('0x15')](_0xb85e51);}};}function respondWithFilteredResult(_0x47d6fd,_0x5ec429){return function(_0x1c4e4a){if(_0x1c4e4a){var _0x1a0e43=typeof _0x5ec429[_0x3822('0x16')]===_0x3822('0x17')&&typeof _0x5ec429[_0x3822('0x18')]===_0x3822('0x17');var _0x5476d6=_0x1c4e4a[_0x3822('0x19')];var _0x4f9949=_0x1a0e43?0x0:_0x5ec429[_0x3822('0x16')];var _0x338d8d=_0x1a0e43?_0x1c4e4a['count']:_0x5ec429[_0x3822('0x16')]+_0x5ec429[_0x3822('0x18')];var _0x36e9c7;if(_0x338d8d>=_0x5476d6){_0x338d8d=_0x5476d6;_0x36e9c7=0xc8;}else{_0x36e9c7=0xce;}_0x47d6fd[_0x3822('0x14')](_0x36e9c7);return _0x47d6fd[_0x3822('0x1a')]('Content-Range',_0x4f9949+'-'+_0x338d8d+'/'+_0x5476d6)['json'](_0x1c4e4a);}return null;};}function patchUpdates(_0x5d7ee4){return function(_0xb67cae){try{jsonpatch[_0x3822('0x1b')](_0xb67cae,_0x5d7ee4,!![]);}catch(_0x17dc7b){return BPromise[_0x3822('0x1c')](_0x17dc7b);}return _0xb67cae['save']();};}function saveUpdates(_0x41062c,_0x11a861){return function(_0x3c3ea8){if(_0x3c3ea8){return _0x3c3ea8[_0x3822('0x1d')](_0x41062c)['then'](function(_0x3d4b09){return _0x3d4b09;});}return null;};}function removeEntity(_0x475a90,_0xbb958c){return function(_0x422185){if(_0x422185){return _0x422185[_0x3822('0x1e')]()[_0x3822('0x1f')](function(){_0x475a90['status'](0xcc)[_0x3822('0x13')]();});}};}function handleEntityNotFound(_0x48c7bb,_0x556ecc){return function(_0x28307e){if(!_0x28307e){_0x48c7bb['sendStatus'](0x194);}return _0x28307e;};}function handleError(_0x56714a,_0x3893ec){_0x3893ec=_0x3893ec||0x1f4;return function(_0xbbccc9){logger['error'](_0xbbccc9[_0x3822('0x20')]);if(_0xbbccc9[_0x3822('0x21')]){delete _0xbbccc9['name'];}_0x56714a[_0x3822('0x14')](_0x3893ec)[_0x3822('0x22')](_0xbbccc9);};}exports[_0x3822('0x23')]=function(_0x4c3ae8,_0x108106){var _0x4eb9a6={},_0x31e017={},_0x53ff44={'count':0x0,'rows':[]};var _0x5bb6a3=_[_0x3822('0x24')](db[_0x3822('0x25')][_0x3822('0x26')],function(_0x1b8e5f){return{'name':_0x1b8e5f['fieldName'],'type':_0x1b8e5f[_0x3822('0x27')]['key']};});_0x31e017['model']=_[_0x3822('0x24')](_0x5bb6a3,'name');_0x31e017[_0x3822('0x28')]=_[_0x3822('0x29')](_0x4c3ae8[_0x3822('0x28')]);_0x31e017['filters']=_[_0x3822('0x2a')](_0x31e017[_0x3822('0x2b')],_0x31e017[_0x3822('0x28')]);_0x4eb9a6['attributes']=_[_0x3822('0x2a')](_0x31e017[_0x3822('0x2b')],qs[_0x3822('0x2c')](_0x4c3ae8[_0x3822('0x28')]['fields']));_0x4eb9a6[_0x3822('0x2d')]=_0x4eb9a6[_0x3822('0x2d')][_0x3822('0x2e')]?_0x4eb9a6['attributes']:_0x31e017['model'];if(!_0x4c3ae8[_0x3822('0x28')]['hasOwnProperty'](_0x3822('0x2f'))){_0x4eb9a6[_0x3822('0x18')]=qs[_0x3822('0x18')](_0x4c3ae8[_0x3822('0x28')][_0x3822('0x18')]);_0x4eb9a6[_0x3822('0x16')]=qs[_0x3822('0x16')](_0x4c3ae8['query'][_0x3822('0x16')]);}_0x4eb9a6[_0x3822('0x30')]=qs[_0x3822('0x31')](_0x4c3ae8[_0x3822('0x28')][_0x3822('0x31')]);_0x4eb9a6[_0x3822('0x32')]=qs[_0x3822('0x33')](_[_0x3822('0x34')](_0x4c3ae8['query'],_0x31e017['filters']),_0x5bb6a3);if(_0x4c3ae8[_0x3822('0x28')]['filter']){_0x4eb9a6[_0x3822('0x32')]=_['merge'](_0x4eb9a6[_0x3822('0x32')],{'$or':_[_0x3822('0x24')](_0x5bb6a3,function(_0x1222e1){if(_0x1222e1[_0x3822('0x27')]!=='VIRTUAL'){var _0x5bf548={};_0x5bf548[_0x1222e1[_0x3822('0x21')]]={'$like':'%'+_0x4c3ae8['query'][_0x3822('0x35')]+'%'};return _0x5bf548;}})});}_0x4eb9a6=_[_0x3822('0x36')]({},_0x4eb9a6,_0x4c3ae8[_0x3822('0x37')]);var _0x22a3ad={'where':_0x4eb9a6[_0x3822('0x32')]};return db[_0x3822('0x25')][_0x3822('0x19')](_0x22a3ad)[_0x3822('0x1f')](function(_0x5b1fea){_0x53ff44[_0x3822('0x19')]=_0x5b1fea;if(_0x4c3ae8['query'][_0x3822('0x38')]){_0x4eb9a6['include']=[{'all':!![]}];}return db[_0x3822('0x25')][_0x3822('0x39')](_0x4eb9a6);})[_0x3822('0x1f')](function(_0x4ac3b0){_0x53ff44[_0x3822('0x3a')]=_0x4ac3b0;return _0x53ff44;})[_0x3822('0x1f')](respondWithFilteredResult(_0x108106,_0x4eb9a6))['catch'](handleError(_0x108106,null));};exports[_0x3822('0x3b')]=function(_0x425d22,_0x37b09d){var _0x338ed1={'raw':!![],'where':{'id':_0x425d22[_0x3822('0x3c')]['id']}},_0x4d4da6={};_0x4d4da6[_0x3822('0x2b')]=_['keys'](db['SquareRecording'][_0x3822('0x26')]);_0x4d4da6['query']=_[_0x3822('0x29')](_0x425d22[_0x3822('0x28')]);_0x4d4da6['filters']=_[_0x3822('0x2a')](_0x4d4da6[_0x3822('0x2b')],_0x4d4da6[_0x3822('0x28')]);_0x338ed1[_0x3822('0x2d')]=_[_0x3822('0x2a')](_0x4d4da6[_0x3822('0x2b')],qs['fields'](_0x425d22[_0x3822('0x28')]['fields']));_0x338ed1[_0x3822('0x2d')]=_0x338ed1[_0x3822('0x2d')][_0x3822('0x2e')]?_0x338ed1[_0x3822('0x2d')]:_0x4d4da6[_0x3822('0x2b')];if(_0x425d22[_0x3822('0x28')][_0x3822('0x38')]){_0x338ed1[_0x3822('0x3d')]=[{'all':!![]}];}_0x338ed1=_['merge']({},_0x338ed1,_0x425d22[_0x3822('0x37')]);return db['SquareRecording'][_0x3822('0x3e')](_0x338ed1)[_0x3822('0x1f')](handleEntityNotFound(_0x37b09d,null))[_0x3822('0x1f')](respondWithResult(_0x37b09d,null))[_0x3822('0x3f')](handleError(_0x37b09d,null));};exports[_0x3822('0x40')]=function(_0x1b390a,_0x145cf6){return db[_0x3822('0x25')][_0x3822('0x40')](_0x1b390a[_0x3822('0x41')],{})[_0x3822('0x1f')](respondWithResult(_0x145cf6,0xc9))[_0x3822('0x3f')](handleError(_0x145cf6,null));};exports[_0x3822('0x1d')]=function(_0x48411e,_0x37aaa1){if(_0x48411e['body']['id']){delete _0x48411e['body']['id'];}return db['SquareRecording'][_0x3822('0x3e')]({'where':{'id':_0x48411e[_0x3822('0x3c')]['id']}})[_0x3822('0x1f')](handleEntityNotFound(_0x37aaa1,null))[_0x3822('0x1f')](saveUpdates(_0x48411e[_0x3822('0x41')],null))[_0x3822('0x1f')](respondWithResult(_0x37aaa1,null))[_0x3822('0x3f')](handleError(_0x37aaa1,null));};exports[_0x3822('0x42')]=function(_0x340e90,_0x5accec,_0x1747ab){var _0x2fe7b7=require(_0x3822('0x43'));var _0x4c9ab6=![];var _0x1cca6e={};if(_0x340e90[_0x3822('0x28')][_0x3822('0x27')]&&_0x340e90[_0x3822('0x28')][_0x3822('0x27')]===_0x3822('0x44')){_0x1cca6e[_0x3822('0x44')]=_0x340e90['params']['id'];}else{_0x1cca6e['id']=_0x340e90[_0x3822('0x3c')]['id'];}return db[_0x3822('0x25')]['find']({'where':_0x1cca6e,'attributes':['id',_0x3822('0x45'),_0x3822('0x46')],'raw':!![]})[_0x3822('0x1f')](handleEntityNotFound(_0x5accec,null))[_0x3822('0x1f')](function(_0x1f797e){if(_0x1f797e){var _0x828317=_0x1f797e[_0x3822('0x45')];var _0x2c894a=util[_0x3822('0x47')](_0x3822('0x48'),_0x828317);if(fs[_0x3822('0x49')](_0x2c894a)){_0x4c9ab6=!![];return _0x2fe7b7[_0x3822('0x4a')](_0x2c894a,_0x828317,config[_0x3822('0x4b')]['recording'])[_0x3822('0x1f')](function(){return _0x1f797e;});}return _0x1f797e;}})[_0x3822('0x1f')](function(_0x506f35){if(_0x506f35){var _0x45c5cf=_0x506f35[_0x3822('0x45')];if(!fs[_0x3822('0x49')](_0x45c5cf)){throw new db[(_0x3822('0x4c'))]['ValidationError'](_0x3822('0x4d'));}if(_0x506f35[_0x3822('0x46')]){return _0x5accec[_0x3822('0x42')](_0x45c5cf,_0x506f35[_0x3822('0x46')]+path[_0x3822('0x4e')](_0x45c5cf),function(){if(_0x4c9ab6){fs[_0x3822('0x4f')](_0x45c5cf);}});}else{return _0x5accec[_0x3822('0x42')](_0x45c5cf,function(_0x28ccda){if(_0x4c9ab6){fs[_0x3822('0x4f')](_0x45c5cf);}});}}})[_0x3822('0x3f')](function(_0x2bc1b0){if(_0x2bc1b0[_0x3822('0x50')]===_0x3822('0x4d')){_0x5accec['status'](0x194)['send'](_0x3822('0x51'));}else{return handleError(_0x5accec,null);}});};exports[_0x3822('0x1e')]=function(_0x4123e6,_0x1b6c91){return db[_0x3822('0x25')][_0x3822('0x3e')]({'where':{'id':_0x4123e6[_0x3822('0x3c')]['id']}})['then'](function(_0x510c97){if(_['isNil'](_0x510c97)){throw new ReferenceError(_0x3822('0x52'));}return _0x510c97;})[_0x3822('0x1f')](function(_0x62bea6){var _0xecd3d9=_0x62bea6[_0x3822('0x45')];logger[_0x3822('0x53')](_0x3822('0x54'),_0xecd3d9);if(!_[_0x3822('0x55')](_0x62bea6['savePath'])&&fs[_0x3822('0x49')](_0xecd3d9)){logger[_0x3822('0x53')](_0x3822('0x56')+_0xecd3d9+_0x3822('0x57'));fs[_0x3822('0x58')](_0xecd3d9);}_0xecd3d9=_0xecd3d9+'.cypher';if(!_[_0x3822('0x55')](_0x62bea6['savePath'])&&fs[_0x3822('0x49')](_0xecd3d9)){logger['info'](_0x3822('0x56')+_0xecd3d9+_0x3822('0x57'));fs[_0x3822('0x58')](_0xecd3d9);}return _0x62bea6;})[_0x3822('0x1f')](function(_0x4b72b7){if(!_0x4b72b7)throw new InternalError();return _0x4b72b7[_0x3822('0x1e')]();})[_0x3822('0x1f')](function(){_0x1b6c91['status'](0xcc)[_0x3822('0x13')]();})[_0x3822('0x3f')](handleError(_0x1b6c91,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 8ca8d3f..1091f4e 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 _0xf105=['define','SquareRecording','square_recordings','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./squareRecording.attributes','exports'];(function(_0x2f4748,_0x24af55){var _0x18eece=function(_0x489dd6){while(--_0x489dd6){_0x2f4748['push'](_0x2f4748['shift']());}};_0x18eece(++_0x24af55);}(_0xf105,0x1b0));var _0x5f10=function(_0x3e9b87,_0x4eaf11){_0x3e9b87=_0x3e9b87-0x0;var _0x356b2d=_0xf105[_0x3e9b87];return _0x356b2d;};'use strict';var _=require(_0x5f10('0x0'));var util=require(_0x5f10('0x1'));var logger=require(_0x5f10('0x2'))(_0x5f10('0x3'));var moment=require(_0x5f10('0x4'));var BPromise=require(_0x5f10('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5f10('0x6'));var rimraf=require('rimraf');var config=require(_0x5f10('0x7'));var attributes=require(_0x5f10('0x8'));module[_0x5f10('0x9')]=function(_0x1b7489,_0x46b6f2){return _0x1b7489[_0x5f10('0xa')](_0x5f10('0xb'),attributes,{'tableName':_0x5f10('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd0da=['square_recordings','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','exports','define','SquareRecording'];(function(_0x46759d,_0x13e994){var _0x3e7fe0=function(_0x2f427d){while(--_0x2f427d){_0x46759d['push'](_0x46759d['shift']());}};_0x3e7fe0(++_0x13e994);}(_0xd0da,0x1b1));var _0xad0d=function(_0x28014d,_0x383e2f){_0x28014d=_0x28014d-0x0;var _0x2572cc=_0xd0da[_0x28014d];return _0x2572cc;};'use strict';var _=require(_0xad0d('0x0'));var util=require(_0xad0d('0x1'));var logger=require(_0xad0d('0x2'))(_0xad0d('0x3'));var moment=require(_0xad0d('0x4'));var BPromise=require('bluebird');var rp=require(_0xad0d('0x5'));var fs=require('fs');var path=require(_0xad0d('0x6'));var rimraf=require(_0xad0d('0x7'));var config=require('../../config/environment');var attributes=require('./squareRecording.attributes');module[_0xad0d('0x8')]=function(_0x5ddb42,_0x5cfc7d){return _0x5ddb42[_0xad0d('0x9')](_0xad0d('0xa'),attributes,{'tableName':_0xad0d('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 4160171..0058bdd 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 _0xb435=['request\x20sent','stringify','error','code','message','catch','CreateSquareRecording','SquareRecording','create','raw','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','SquareRecording,\x20%s,\x20%s','debug','SquareRecording,\x20%s,\x20%s,\x20%s'];(function(_0x5bf420,_0x2d068d){var _0x1c5255=function(_0x4964a2){while(--_0x4964a2){_0x5bf420['push'](_0x5bf420['shift']());}};_0x1c5255(++_0x2d068d);}(_0xb435,0x13e));var _0x5b43=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb435[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x5b43('0x0'));var util=require('util');var moment=require(_0x5b43('0x1'));var BPromise=require(_0x5b43('0x2'));var rs=require(_0x5b43('0x3'));var fs=require('fs');var Redis=require(_0x5b43('0x4'));var db=require(_0x5b43('0x5'))['db'];var utils=require(_0x5b43('0x6'));var logger=require(_0x5b43('0x7'))(_0x5b43('0x8'));var config=require('../../config/environment');var jayson=require(_0x5b43('0x9'));var client=jayson[_0x5b43('0xa')][_0x5b43('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x50c87d,_0x4650d5,_0x2f07ac){return new BPromise(function(_0x55f8e6,_0x37bf23){return client[_0x5b43('0xc')](_0x50c87d,_0x2f07ac)[_0x5b43('0xd')](function(_0x4819b8){logger[_0x5b43('0xe')](_0x5b43('0xf'),_0x4650d5,'request\x20sent');logger[_0x5b43('0x10')](_0x5b43('0x11'),_0x4650d5,_0x5b43('0x12'),JSON[_0x5b43('0x13')](_0x4819b8));if(_0x4819b8['error']){if(_0x4819b8[_0x5b43('0x14')][_0x5b43('0x15')]===0x1f4){logger[_0x5b43('0x14')](_0x5b43('0xf'),_0x4650d5,_0x4819b8[_0x5b43('0x14')][_0x5b43('0x16')]);return _0x37bf23(_0x4819b8[_0x5b43('0x14')][_0x5b43('0x16')]);}logger[_0x5b43('0x14')](_0x5b43('0xf'),_0x4650d5,_0x4819b8[_0x5b43('0x14')][_0x5b43('0x16')]);return _0x55f8e6(_0x4819b8['error'][_0x5b43('0x16')]);}else{logger[_0x5b43('0xe')](_0x5b43('0xf'),_0x4650d5,_0x5b43('0x12'));_0x55f8e6(_0x4819b8['result'][_0x5b43('0x16')]);}})[_0x5b43('0x17')](function(_0x2f6a79){logger[_0x5b43('0x14')]('SquareRecording,\x20%s,\x20%s',_0x4650d5,_0x2f6a79);_0x37bf23(_0x2f6a79);});});}exports[_0x5b43('0x18')]=function(_0x1d5017){var _0x2b0a9d=this;return new Promise(function(_0x12cae7,_0x4c1b68){return db[_0x5b43('0x19')][_0x5b43('0x1a')](_0x1d5017['body'],{'raw':_0x1d5017['options']?_0x1d5017['options'][_0x5b43('0x1b')]===undefined?!![]:![]:!![]})[_0x5b43('0xd')](function(_0x5ab69f){logger[_0x5b43('0xe')]('CreateSquareRecording',_0x1d5017);logger[_0x5b43('0x10')]('CreateSquareRecording',_0x1d5017,JSON[_0x5b43('0x13')](_0x5ab69f));_0x12cae7(_0x5ab69f);})[_0x5b43('0x17')](function(_0x1d3d7e){logger[_0x5b43('0x14')](_0x5b43('0x18'),_0x1d3d7e[_0x5b43('0x16')],_0x1d5017);_0x4c1b68(_0x2b0a9d[_0x5b43('0x14')](0x1f4,_0x1d3d7e[_0x5b43('0x16')]));});});}; \ No newline at end of file +var _0xe287=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','error','message','result','catch','CreateSquareRecording','create','options','raw','stringify','lodash'];(function(_0x231b09,_0x4342ab){var _0x407bb6=function(_0x4744f7){while(--_0x4744f7){_0x231b09['push'](_0x231b09['shift']());}};_0x407bb6(++_0x4342ab);}(_0xe287,0x1cf));var _0x7e28=function(_0x383784,_0x396876){_0x383784=_0x383784-0x0;var _0x487b67=_0xe287[_0x383784];return _0x487b67;};'use strict';var _=require(_0x7e28('0x0'));var util=require(_0x7e28('0x1'));var moment=require(_0x7e28('0x2'));var BPromise=require(_0x7e28('0x3'));var rs=require(_0x7e28('0x4'));var fs=require('fs');var Redis=require(_0x7e28('0x5'));var db=require(_0x7e28('0x6'))['db'];var utils=require(_0x7e28('0x7'));var logger=require(_0x7e28('0x8'))(_0x7e28('0x9'));var config=require(_0x7e28('0xa'));var jayson=require(_0x7e28('0xb'));var client=jayson['client'][_0x7e28('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3d807b,_0x583884,_0x23b099){return new BPromise(function(_0x4b9250,_0x5cfbec){return client[_0x7e28('0xd')](_0x3d807b,_0x23b099)[_0x7e28('0xe')](function(_0x29bc24){logger[_0x7e28('0xf')](_0x7e28('0x10'),_0x583884,_0x7e28('0x11'));logger[_0x7e28('0x12')](_0x7e28('0x13'),_0x583884,_0x7e28('0x11'),JSON['stringify'](_0x29bc24));if(_0x29bc24[_0x7e28('0x14')]){if(_0x29bc24[_0x7e28('0x14')]['code']===0x1f4){logger['error'](_0x7e28('0x10'),_0x583884,_0x29bc24[_0x7e28('0x14')][_0x7e28('0x15')]);return _0x5cfbec(_0x29bc24[_0x7e28('0x14')][_0x7e28('0x15')]);}logger[_0x7e28('0x14')]('SquareRecording,\x20%s,\x20%s',_0x583884,_0x29bc24[_0x7e28('0x14')]['message']);return _0x4b9250(_0x29bc24[_0x7e28('0x14')][_0x7e28('0x15')]);}else{logger['info'](_0x7e28('0x10'),_0x583884,'request\x20sent');_0x4b9250(_0x29bc24[_0x7e28('0x16')][_0x7e28('0x15')]);}})[_0x7e28('0x17')](function(_0x15e1e8){logger[_0x7e28('0x14')](_0x7e28('0x10'),_0x583884,_0x15e1e8);_0x5cfbec(_0x15e1e8);});});}exports[_0x7e28('0x18')]=function(_0x38de4a){var _0x95fc75=this;return new Promise(function(_0x1957ec,_0x45b32d){return db['SquareRecording'][_0x7e28('0x19')](_0x38de4a['body'],{'raw':_0x38de4a[_0x7e28('0x1a')]?_0x38de4a[_0x7e28('0x1a')][_0x7e28('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x14016b){logger[_0x7e28('0xf')](_0x7e28('0x18'),_0x38de4a);logger[_0x7e28('0x12')](_0x7e28('0x18'),_0x38de4a,JSON[_0x7e28('0x1c')](_0x14016b));_0x1957ec(_0x14016b);})[_0x7e28('0x17')](function(_0x4f52e9){logger[_0x7e28('0x14')]('CreateSquareRecording',_0x4f52e9[_0x7e28('0x15')],_0x38de4a);_0x45b32d(_0x95fc75['error'](0x1f4,_0x4f52e9[_0x7e28('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 44a4c12..cf5ad89 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 _0xe706=['/describe','describe','/:id','show','post','create','put','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index'];(function(_0x12ae1f,_0x59b137){var _0x49da85=function(_0x4d6c6e){while(--_0x4d6c6e){_0x12ae1f['push'](_0x12ae1f['shift']());}};_0x49da85(++_0x59b137);}(_0xe706,0xa3));var _0x6e70=function(_0x31efe7,_0x52fe9e){_0x31efe7=_0x31efe7-0x0;var _0x24b6ee=_0xe706[_0x31efe7];return _0x24b6ee;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x11')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0x12')]);router[_0x6e70('0x13')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller['update']);router['delete'](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x14')]);module[_0x6e70('0x15')]=router; \ No newline at end of file +var _0xe706=['/describe','describe','/:id','show','post','create','put','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index'];(function(_0x404011,_0xa1651b){var _0x3eca08=function(_0x436cc1){while(--_0x436cc1){_0x404011['push'](_0x404011['shift']());}};_0x3eca08(++_0xa1651b);}(_0xe706,0xa3));var _0x6e70=function(_0x35a384,_0x1e102e){_0x35a384=_0x35a384-0x0;var _0x3d6e8e=_0xe706[_0x35a384];return _0x3d6e8e;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x11')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0x12')]);router[_0x6e70('0x13')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller['update']);router['delete'](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x14')]);module[_0x6e70('0x15')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index 874ca63..40e006d 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 _0x431c=['exports','STRING','DATE','BOOLEAN'];(function(_0xd0a847,_0x72562b){var _0x2536ec=function(_0x20e4db){while(--_0x20e4db){_0xd0a847['push'](_0xd0a847['shift']());}};_0x2536ec(++_0x72562b);}(_0x431c,0x1e8));var _0xc431=function(_0x35be0c,_0x29fa46){_0x35be0c=_0x35be0c-0x0;var _0x49076c=_0x431c[_0x35be0c];return _0x49076c;};'use strict';var Sequelize=require('sequelize');module[_0xc431('0x0')]={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize[_0xc431('0x1')]},'request':{'type':Sequelize[_0xc431('0x1')]},'channel':{'type':Sequelize[_0xc431('0x1')]},'language':{'type':Sequelize[_0xc431('0x1')]},'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xc431('0x1')]},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize['STRING']},'callington':{'type':Sequelize[_0xc431('0x1')]},'callingtns':{'type':Sequelize[_0xc431('0x1')]},'dnid':{'type':Sequelize[_0xc431('0x1')]},'rdnis':{'type':Sequelize[_0xc431('0x1')]},'context':{'type':Sequelize[_0xc431('0x1')]},'extension':{'type':Sequelize[_0xc431('0x1')]},'priority':{'type':Sequelize[_0xc431('0x1')]},'enhanced':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xc431('0x1')]},'threadid':{'type':Sequelize[_0xc431('0x1')]},'project_name':{'type':Sequelize[_0xc431('0x1')]},'joinAt':{'type':Sequelize[_0xc431('0x2')]},'leaveAt':{'type':Sequelize['DATE']},'bot':{'type':Sequelize[_0xc431('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x8a7d=['exports','STRING','DATE','BOOLEAN','sequelize'];(function(_0xdc51ac,_0x45e375){var _0x495d75=function(_0x4f30bb){while(--_0x4f30bb){_0xdc51ac['push'](_0xdc51ac['shift']());}};_0x495d75(++_0x45e375);}(_0x8a7d,0x14e));var _0xd8a7=function(_0x4bb1d9,_0x25ef55){_0x4bb1d9=_0x4bb1d9-0x0;var _0x415e18=_0x8a7d[_0x4bb1d9];return _0x415e18;};'use strict';var Sequelize=require(_0xd8a7('0x0'));module[_0xd8a7('0x1')]={'network':{'type':Sequelize[_0xd8a7('0x2')]},'network_script':{'type':Sequelize[_0xd8a7('0x2')]},'request':{'type':Sequelize[_0xd8a7('0x2')]},'channel':{'type':Sequelize[_0xd8a7('0x2')]},'language':{'type':Sequelize[_0xd8a7('0x2')]},'type':{'type':Sequelize[_0xd8a7('0x2')]},'uniqueid':{'type':Sequelize[_0xd8a7('0x2')]},'version':{'type':Sequelize[_0xd8a7('0x2')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xd8a7('0x2')]},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize[_0xd8a7('0x2')]},'callington':{'type':Sequelize[_0xd8a7('0x2')]},'callingtns':{'type':Sequelize[_0xd8a7('0x2')]},'dnid':{'type':Sequelize[_0xd8a7('0x2')]},'rdnis':{'type':Sequelize[_0xd8a7('0x2')]},'context':{'type':Sequelize[_0xd8a7('0x2')]},'extension':{'type':Sequelize[_0xd8a7('0x2')]},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xd8a7('0x2')]},'threadid':{'type':Sequelize[_0xd8a7('0x2')]},'project_name':{'type':Sequelize[_0xd8a7('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xd8a7('0x3')]},'bot':{'type':Sequelize[_0xd8a7('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 a609b7c..9b09bf2 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 _0x8032=['ejs','fs-extra','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','map','SquareReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','merge','where','VIRTUAL','includeAll','include','findAll','rows','show','params','options','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','sox'];(function(_0x491a7f,_0x28bb80){var _0x3d8f44=function(_0xdaa716){while(--_0xdaa716){_0x491a7f['push'](_0x491a7f['shift']());}};_0x3d8f44(++_0x28bb80);}(_0x8032,0xda));var _0x2803=function(_0xbe0bad,_0x242e22){_0xbe0bad=_0xbe0bad-0x0;var _0x2a18cc=_0x8032[_0xbe0bad];return _0x2a18cc;};'use strict';var emlformat=require(_0x2803('0x0'));var rimraf=require(_0x2803('0x1'));var zipdir=require(_0x2803('0x2'));var jsonpatch=require(_0x2803('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2803('0x4'));var Mustache=require(_0x2803('0x5'));var util=require('util');var path=require('path');var sox=require(_0x2803('0x6'));var csv=require('to-csv');var ejs=require(_0x2803('0x7'));var fs=require('fs');var fs_extra=require(_0x2803('0x8'));var _=require('lodash');var squel=require(_0x2803('0x9'));var crypto=require('crypto');var jsforce=require(_0x2803('0xa'));var deskjs=require(_0x2803('0xb'));var toCsv=require(_0x2803('0xc'));var querystring=require(_0x2803('0xd'));var Papa=require(_0x2803('0xe'));var Redis=require(_0x2803('0xf'));var authService=require(_0x2803('0x10'));var qs=require(_0x2803('0x11'));var as=require(_0x2803('0x12'));var hardwareService=require(_0x2803('0x13'));var logger=require('../../config/logger')(_0x2803('0x14'));var utils=require(_0x2803('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x2803('0x16'));var db=require(_0x2803('0x17'))['db'];function respondWithStatusCode(_0x5e4c74,_0x49aab5){_0x49aab5=_0x49aab5||0xcc;return function(_0xadc94b){if(_0xadc94b){return _0x5e4c74[_0x2803('0x18')](_0x49aab5);}return _0x5e4c74[_0x2803('0x19')](_0x49aab5)[_0x2803('0x1a')]();};}function respondWithResult(_0x169082,_0x2b6e1f){_0x2b6e1f=_0x2b6e1f||0xc8;return function(_0x5a0c08){if(_0x5a0c08){return _0x169082[_0x2803('0x19')](_0x2b6e1f)[_0x2803('0x1b')](_0x5a0c08);}};}function respondWithFilteredResult(_0xf87592,_0x3e82e4){return function(_0x464b95){if(_0x464b95){var _0x307d7f=typeof _0x3e82e4[_0x2803('0x1c')]==='undefined'&&typeof _0x3e82e4['limit']===_0x2803('0x1d');var _0x180903=_0x464b95[_0x2803('0x1e')];var _0x4a0737=_0x307d7f?0x0:_0x3e82e4['offset'];var _0x4d0e9a=_0x307d7f?_0x464b95[_0x2803('0x1e')]:_0x3e82e4[_0x2803('0x1c')]+_0x3e82e4[_0x2803('0x1f')];var _0xabcd84;if(_0x4d0e9a>=_0x180903){_0x4d0e9a=_0x180903;_0xabcd84=0xc8;}else{_0xabcd84=0xce;}_0xf87592[_0x2803('0x19')](_0xabcd84);return _0xf87592[_0x2803('0x20')](_0x2803('0x21'),_0x4a0737+'-'+_0x4d0e9a+'/'+_0x180903)['json'](_0x464b95);}return null;};}function patchUpdates(_0x2f2f8e){return function(_0x11c074){try{jsonpatch[_0x2803('0x22')](_0x11c074,_0x2f2f8e,!![]);}catch(_0x4064b5){return BPromise[_0x2803('0x23')](_0x4064b5);}return _0x11c074[_0x2803('0x24')]();};}function saveUpdates(_0x5c0dc8,_0x4b55fe){return function(_0x1bc8be){if(_0x1bc8be){return _0x1bc8be[_0x2803('0x25')](_0x5c0dc8)[_0x2803('0x26')](function(_0x44283b){return _0x44283b;});}return null;};}function removeEntity(_0x5ecb27,_0xf6777f){return function(_0x2a7f86){if(_0x2a7f86){return _0x2a7f86[_0x2803('0x27')]()['then'](function(){_0x5ecb27['status'](0xcc)[_0x2803('0x1a')]();});}};}function handleEntityNotFound(_0x588a69,_0x26e671){return function(_0x2cad4d){if(!_0x2cad4d){_0x588a69[_0x2803('0x18')](0x194);}return _0x2cad4d;};}function handleError(_0x1cc405,_0x324bd1){_0x324bd1=_0x324bd1||0x1f4;return function(_0x560064){logger[_0x2803('0x28')](_0x560064['stack']);if(_0x560064[_0x2803('0x29')]){delete _0x560064['name'];}_0x1cc405[_0x2803('0x19')](_0x324bd1)['send'](_0x560064);};}exports['index']=function(_0x22b50c,_0x54bad6){var _0xa88d20={},_0x153985={},_0x5ceac0={'count':0x0,'rows':[]};var _0x5e830a=_[_0x2803('0x2a')](db[_0x2803('0x2b')][_0x2803('0x2c')],function(_0xd06afe){return{'name':_0xd06afe['fieldName'],'type':_0xd06afe[_0x2803('0x2d')][_0x2803('0x2e')]};});_0x153985[_0x2803('0x2f')]=_[_0x2803('0x2a')](_0x5e830a,_0x2803('0x29'));_0x153985[_0x2803('0x30')]=_[_0x2803('0x31')](_0x22b50c[_0x2803('0x30')]);_0x153985[_0x2803('0x32')]=_[_0x2803('0x33')](_0x153985[_0x2803('0x2f')],_0x153985[_0x2803('0x30')]);_0xa88d20[_0x2803('0x34')]=_[_0x2803('0x33')](_0x153985[_0x2803('0x2f')],qs['fields'](_0x22b50c[_0x2803('0x30')][_0x2803('0x35')]));_0xa88d20[_0x2803('0x34')]=_0xa88d20[_0x2803('0x34')][_0x2803('0x36')]?_0xa88d20[_0x2803('0x34')]:_0x153985[_0x2803('0x2f')];if(!_0x22b50c[_0x2803('0x30')][_0x2803('0x37')](_0x2803('0x38'))){_0xa88d20['limit']=qs[_0x2803('0x1f')](_0x22b50c[_0x2803('0x30')]['limit']);_0xa88d20['offset']=qs[_0x2803('0x1c')](_0x22b50c['query'][_0x2803('0x1c')]);}_0xa88d20['order']=qs[_0x2803('0x39')](_0x22b50c[_0x2803('0x30')][_0x2803('0x39')]);_0xa88d20['where']=qs['filters'](_[_0x2803('0x3a')](_0x22b50c[_0x2803('0x30')],_0x153985[_0x2803('0x32')]),_0x5e830a);if(_0x22b50c[_0x2803('0x30')][_0x2803('0x3b')]){_0xa88d20['where']=_[_0x2803('0x3c')](_0xa88d20[_0x2803('0x3d')],{'$or':_[_0x2803('0x2a')](_0x5e830a,function(_0x44794b){if(_0x44794b[_0x2803('0x2d')]!==_0x2803('0x3e')){var _0x40599f={};_0x40599f[_0x44794b[_0x2803('0x29')]]={'$like':'%'+_0x22b50c['query'][_0x2803('0x3b')]+'%'};return _0x40599f;}})});}_0xa88d20=_[_0x2803('0x3c')]({},_0xa88d20,_0x22b50c['options']);var _0xfc97c5={'where':_0xa88d20['where']};return db['SquareReport'][_0x2803('0x1e')](_0xfc97c5)['then'](function(_0x3ae211){_0x5ceac0[_0x2803('0x1e')]=_0x3ae211;if(_0x22b50c[_0x2803('0x30')][_0x2803('0x3f')]){_0xa88d20[_0x2803('0x40')]=[{'all':!![]}];}return db['SquareReport'][_0x2803('0x41')](_0xa88d20);})[_0x2803('0x26')](function(_0x274c7e){_0x5ceac0[_0x2803('0x42')]=_0x274c7e;return _0x5ceac0;})[_0x2803('0x26')](respondWithFilteredResult(_0x54bad6,_0xa88d20))['catch'](handleError(_0x54bad6,null));};exports[_0x2803('0x43')]=function(_0x49e010,_0x40e2fb){var _0x9a2383={'raw':!![],'where':{'id':_0x49e010[_0x2803('0x44')]['id']}},_0x41264e={};_0x41264e[_0x2803('0x2f')]=_[_0x2803('0x31')](db['SquareReport'][_0x2803('0x2c')]);_0x41264e['query']=_[_0x2803('0x31')](_0x49e010[_0x2803('0x30')]);_0x41264e['filters']=_[_0x2803('0x33')](_0x41264e['model'],_0x41264e[_0x2803('0x30')]);_0x9a2383[_0x2803('0x34')]=_[_0x2803('0x33')](_0x41264e[_0x2803('0x2f')],qs[_0x2803('0x35')](_0x49e010[_0x2803('0x30')]['fields']));_0x9a2383[_0x2803('0x34')]=_0x9a2383[_0x2803('0x34')][_0x2803('0x36')]?_0x9a2383[_0x2803('0x34')]:_0x41264e[_0x2803('0x2f')];if(_0x49e010[_0x2803('0x30')][_0x2803('0x3f')]){_0x9a2383[_0x2803('0x40')]=[{'all':!![]}];}_0x9a2383=_[_0x2803('0x3c')]({},_0x9a2383,_0x49e010[_0x2803('0x45')]);return db['SquareReport'][_0x2803('0x46')](_0x9a2383)['then'](handleEntityNotFound(_0x40e2fb,null))[_0x2803('0x26')](respondWithResult(_0x40e2fb,null))[_0x2803('0x47')](handleError(_0x40e2fb,null));};exports['create']=function(_0x39cd28,_0x197d9c){return db[_0x2803('0x2b')][_0x2803('0x48')](_0x39cd28[_0x2803('0x49')],{})[_0x2803('0x26')](respondWithResult(_0x197d9c,0xc9))[_0x2803('0x47')](handleError(_0x197d9c,null));};exports[_0x2803('0x25')]=function(_0x841589,_0x51da12){if(_0x841589[_0x2803('0x49')]['id']){delete _0x841589['body']['id'];}return db['SquareReport']['find']({'where':{'id':_0x841589[_0x2803('0x44')]['id']}})[_0x2803('0x26')](handleEntityNotFound(_0x51da12,null))[_0x2803('0x26')](saveUpdates(_0x841589[_0x2803('0x49')],null))[_0x2803('0x26')](respondWithResult(_0x51da12,null))[_0x2803('0x47')](handleError(_0x51da12,null));};exports['destroy']=function(_0x49df56,_0x28ec9e){return db['SquareReport']['find']({'where':{'id':_0x49df56['params']['id']}})[_0x2803('0x26')](handleEntityNotFound(_0x28ec9e,null))[_0x2803('0x26')](removeEntity(_0x28ec9e,null))['catch'](handleError(_0x28ec9e,null));};exports[_0x2803('0x4a')]=function(_0x35b882,_0x12a4a9){return db['SquareReport'][_0x2803('0x4a')]()[_0x2803('0x26')](respondWithResult(_0x12a4a9,null))['catch'](handleError(_0x12a4a9,null));}; \ No newline at end of file +var _0x676e=['path','sox','to-csv','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','save','update','destroy','then','error','stack','send','SquareReport','rawAttributes','type','key','model','map','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','name','merge','options','includeAll','include','findAll','rows','catch','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x5690a4,_0x572d64){var _0x170f91=function(_0x5458c1){while(--_0x5458c1){_0x5690a4['push'](_0x5690a4['shift']());}};_0x170f91(++_0x572d64);}(_0x676e,0x113));var _0xe676=function(_0x5a7112,_0x1f9492){_0x5a7112=_0x5a7112-0x0;var _0x3147f7=_0x676e[_0x5a7112];return _0x3147f7;};'use strict';var emlformat=require(_0xe676('0x0'));var rimraf=require(_0xe676('0x1'));var zipdir=require(_0xe676('0x2'));var jsonpatch=require(_0xe676('0x3'));var rp=require(_0xe676('0x4'));var moment=require(_0xe676('0x5'));var BPromise=require(_0xe676('0x6'));var Mustache=require(_0xe676('0x7'));var util=require(_0xe676('0x8'));var path=require(_0xe676('0x9'));var sox=require(_0xe676('0xa'));var csv=require(_0xe676('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xe676('0xc'));var crypto=require(_0xe676('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xe676('0xe'));var toCsv=require('to-csv');var querystring=require(_0xe676('0xf'));var Papa=require(_0xe676('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe676('0x11'));var hardwareService=require(_0xe676('0x12'));var logger=require(_0xe676('0x13'))(_0xe676('0x14'));var utils=require(_0xe676('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xe676('0x16'));var db=require(_0xe676('0x17'))['db'];function respondWithStatusCode(_0x1d5118,_0x1ffb55){_0x1ffb55=_0x1ffb55||0xcc;return function(_0x80b2e7){if(_0x80b2e7){return _0x1d5118[_0xe676('0x18')](_0x1ffb55);}return _0x1d5118['status'](_0x1ffb55)[_0xe676('0x19')]();};}function respondWithResult(_0x5d567a,_0x3925f7){_0x3925f7=_0x3925f7||0xc8;return function(_0x4a2e6f){if(_0x4a2e6f){return _0x5d567a[_0xe676('0x1a')](_0x3925f7)[_0xe676('0x1b')](_0x4a2e6f);}};}function respondWithFilteredResult(_0x1ae934,_0x4946eb){return function(_0x134926){if(_0x134926){var _0x4d8c9a=typeof _0x4946eb[_0xe676('0x1c')]===_0xe676('0x1d')&&typeof _0x4946eb[_0xe676('0x1e')]===_0xe676('0x1d');var _0x4b7f0c=_0x134926[_0xe676('0x1f')];var _0x421b8c=_0x4d8c9a?0x0:_0x4946eb[_0xe676('0x1c')];var _0xbc6536=_0x4d8c9a?_0x134926[_0xe676('0x1f')]:_0x4946eb['offset']+_0x4946eb[_0xe676('0x1e')];var _0x417062;if(_0xbc6536>=_0x4b7f0c){_0xbc6536=_0x4b7f0c;_0x417062=0xc8;}else{_0x417062=0xce;}_0x1ae934[_0xe676('0x1a')](_0x417062);return _0x1ae934[_0xe676('0x20')](_0xe676('0x21'),_0x421b8c+'-'+_0xbc6536+'/'+_0x4b7f0c)[_0xe676('0x1b')](_0x134926);}return null;};}function patchUpdates(_0xd46553){return function(_0x342884){try{jsonpatch['apply'](_0x342884,_0xd46553,!![]);}catch(_0x3c8fbe){return BPromise['reject'](_0x3c8fbe);}return _0x342884[_0xe676('0x22')]();};}function saveUpdates(_0x1c4e03,_0x3f5d17){return function(_0x3fb590){if(_0x3fb590){return _0x3fb590[_0xe676('0x23')](_0x1c4e03)['then'](function(_0x185456){return _0x185456;});}return null;};}function removeEntity(_0x3f9638,_0x2bd899){return function(_0x522970){if(_0x522970){return _0x522970[_0xe676('0x24')]()[_0xe676('0x25')](function(){_0x3f9638['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x6ada4d,_0x303a1f){return function(_0x3c41a0){if(!_0x3c41a0){_0x6ada4d[_0xe676('0x18')](0x194);}return _0x3c41a0;};}function handleError(_0x4a1d1d,_0x4e6d29){_0x4e6d29=_0x4e6d29||0x1f4;return function(_0x2d2af0){logger[_0xe676('0x26')](_0x2d2af0[_0xe676('0x27')]);if(_0x2d2af0['name']){delete _0x2d2af0['name'];}_0x4a1d1d[_0xe676('0x1a')](_0x4e6d29)[_0xe676('0x28')](_0x2d2af0);};}exports['index']=function(_0x2ae1e9,_0x5003b6){var _0x2590a1={},_0x3f268b={},_0x3eb977={'count':0x0,'rows':[]};var _0x1385a5=_['map'](db[_0xe676('0x29')][_0xe676('0x2a')],function(_0x117320){return{'name':_0x117320['fieldName'],'type':_0x117320[_0xe676('0x2b')][_0xe676('0x2c')]};});_0x3f268b[_0xe676('0x2d')]=_[_0xe676('0x2e')](_0x1385a5,'name');_0x3f268b['query']=_[_0xe676('0x2f')](_0x2ae1e9[_0xe676('0x30')]);_0x3f268b[_0xe676('0x31')]=_[_0xe676('0x32')](_0x3f268b[_0xe676('0x2d')],_0x3f268b[_0xe676('0x30')]);_0x2590a1['attributes']=_[_0xe676('0x32')](_0x3f268b[_0xe676('0x2d')],qs[_0xe676('0x33')](_0x2ae1e9[_0xe676('0x30')]['fields']));_0x2590a1[_0xe676('0x34')]=_0x2590a1['attributes'][_0xe676('0x35')]?_0x2590a1[_0xe676('0x34')]:_0x3f268b[_0xe676('0x2d')];if(!_0x2ae1e9[_0xe676('0x30')][_0xe676('0x36')]('nolimit')){_0x2590a1[_0xe676('0x1e')]=qs[_0xe676('0x1e')](_0x2ae1e9[_0xe676('0x30')][_0xe676('0x1e')]);_0x2590a1['offset']=qs[_0xe676('0x1c')](_0x2ae1e9[_0xe676('0x30')][_0xe676('0x1c')]);}_0x2590a1[_0xe676('0x37')]=qs[_0xe676('0x38')](_0x2ae1e9['query'][_0xe676('0x38')]);_0x2590a1[_0xe676('0x39')]=qs[_0xe676('0x31')](_[_0xe676('0x3a')](_0x2ae1e9[_0xe676('0x30')],_0x3f268b['filters']),_0x1385a5);if(_0x2ae1e9['query']['filter']){_0x2590a1['where']=_['merge'](_0x2590a1[_0xe676('0x39')],{'$or':_[_0xe676('0x2e')](_0x1385a5,function(_0x3ee627){if(_0x3ee627[_0xe676('0x2b')]!=='VIRTUAL'){var _0x2d4486={};_0x2d4486[_0x3ee627[_0xe676('0x3b')]]={'$like':'%'+_0x2ae1e9[_0xe676('0x30')]['filter']+'%'};return _0x2d4486;}})});}_0x2590a1=_[_0xe676('0x3c')]({},_0x2590a1,_0x2ae1e9[_0xe676('0x3d')]);var _0x735639={'where':_0x2590a1[_0xe676('0x39')]};return db[_0xe676('0x29')][_0xe676('0x1f')](_0x735639)[_0xe676('0x25')](function(_0x405efd){_0x3eb977[_0xe676('0x1f')]=_0x405efd;if(_0x2ae1e9[_0xe676('0x30')][_0xe676('0x3e')]){_0x2590a1[_0xe676('0x3f')]=[{'all':!![]}];}return db[_0xe676('0x29')][_0xe676('0x40')](_0x2590a1);})[_0xe676('0x25')](function(_0x336330){_0x3eb977[_0xe676('0x41')]=_0x336330;return _0x3eb977;})[_0xe676('0x25')](respondWithFilteredResult(_0x5003b6,_0x2590a1))['catch'](handleError(_0x5003b6,null));};exports['show']=function(_0x486a03,_0x341e28){var _0xcb36aa={'raw':!![],'where':{'id':_0x486a03['params']['id']}},_0x120b6b={};_0x120b6b[_0xe676('0x2d')]=_[_0xe676('0x2f')](db[_0xe676('0x29')]['rawAttributes']);_0x120b6b[_0xe676('0x30')]=_[_0xe676('0x2f')](_0x486a03[_0xe676('0x30')]);_0x120b6b[_0xe676('0x31')]=_['intersection'](_0x120b6b['model'],_0x120b6b[_0xe676('0x30')]);_0xcb36aa[_0xe676('0x34')]=_[_0xe676('0x32')](_0x120b6b['model'],qs[_0xe676('0x33')](_0x486a03['query'][_0xe676('0x33')]));_0xcb36aa['attributes']=_0xcb36aa[_0xe676('0x34')][_0xe676('0x35')]?_0xcb36aa[_0xe676('0x34')]:_0x120b6b[_0xe676('0x2d')];if(_0x486a03[_0xe676('0x30')][_0xe676('0x3e')]){_0xcb36aa[_0xe676('0x3f')]=[{'all':!![]}];}_0xcb36aa=_[_0xe676('0x3c')]({},_0xcb36aa,_0x486a03['options']);return db[_0xe676('0x29')]['find'](_0xcb36aa)[_0xe676('0x25')](handleEntityNotFound(_0x341e28,null))[_0xe676('0x25')](respondWithResult(_0x341e28,null))[_0xe676('0x42')](handleError(_0x341e28,null));};exports[_0xe676('0x43')]=function(_0x2d0de9,_0x1a4ab2){return db[_0xe676('0x29')]['create'](_0x2d0de9['body'],{})['then'](respondWithResult(_0x1a4ab2,0xc9))[_0xe676('0x42')](handleError(_0x1a4ab2,null));};exports[_0xe676('0x23')]=function(_0x4fc874,_0x3e9040){if(_0x4fc874[_0xe676('0x44')]['id']){delete _0x4fc874[_0xe676('0x44')]['id'];}return db['SquareReport']['find']({'where':{'id':_0x4fc874[_0xe676('0x45')]['id']}})['then'](handleEntityNotFound(_0x3e9040,null))[_0xe676('0x25')](saveUpdates(_0x4fc874[_0xe676('0x44')],null))[_0xe676('0x25')](respondWithResult(_0x3e9040,null))[_0xe676('0x42')](handleError(_0x3e9040,null));};exports[_0xe676('0x24')]=function(_0x32c859,_0x37b7ae){return db['SquareReport']['find']({'where':{'id':_0x32c859[_0xe676('0x45')]['id']}})[_0xe676('0x25')](handleEntityNotFound(_0x37b7ae,null))['then'](removeEntity(_0x37b7ae,null))[_0xe676('0x42')](handleError(_0x37b7ae,null));};exports['describe']=function(_0x460f00,_0x554297){return db['SquareReport'][_0xe676('0x46')]()[_0xe676('0x25')](respondWithResult(_0x554297,null))[_0xe676('0x42')](handleError(_0x554297,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 6ef517e..0ab31bf 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 _0x6449=['moment','bluebird','request-promise','rimraf','../../config/environment','./squareReport.attributes','report_square','uid_pname','uniqueid','leaveAt','util','../../config/logger','api'];(function(_0x3e2c6e,_0x5a33db){var _0x3ebe30=function(_0x17996c){while(--_0x17996c){_0x3e2c6e['push'](_0x3e2c6e['shift']());}};_0x3ebe30(++_0x5a33db);}(_0x6449,0xf4));var _0x9644=function(_0x4ce028,_0x526d4b){_0x4ce028=_0x4ce028-0x0;var _0x583d0c=_0x6449[_0x4ce028];return _0x583d0c;};'use strict';var _=require('lodash');var util=require(_0x9644('0x0'));var logger=require(_0x9644('0x1'))(_0x9644('0x2'));var moment=require(_0x9644('0x3'));var BPromise=require(_0x9644('0x4'));var rp=require(_0x9644('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9644('0x6'));var config=require(_0x9644('0x7'));var attributes=require(_0x9644('0x8'));module['exports']=function(_0x3ae794,_0x303454){return _0x3ae794['define']('SquareReport',attributes,{'tableName':_0x9644('0x9'),'paranoid':![],'indexes':[{'name':_0x9644('0xa'),'fields':[_0x9644('0xb'),'project_name']},{'name':'leaveAt','fields':[_0x9644('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x109e=['leaveAt','lodash','util','moment','bluebird','path','../../config/environment','exports','define','uid_pname','uniqueid','project_name'];(function(_0x45c61e,_0x59694d){var _0x19033c=function(_0x19fc2b){while(--_0x19fc2b){_0x45c61e['push'](_0x45c61e['shift']());}};_0x19033c(++_0x59694d);}(_0x109e,0x121));var _0xe109=function(_0x26ea61,_0x1b983c){_0x26ea61=_0x26ea61-0x0;var _0x1b89c4=_0x109e[_0x26ea61];return _0x1b89c4;};'use strict';var _=require(_0xe109('0x0'));var util=require(_0xe109('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xe109('0x2'));var BPromise=require(_0xe109('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe109('0x4'));var rimraf=require('rimraf');var config=require(_0xe109('0x5'));var attributes=require('./squareReport.attributes');module[_0xe109('0x6')]=function(_0xdbf69c,_0x2c9f3e){return _0xdbf69c[_0xe109('0x7')]('SquareReport',attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':_0xe109('0x8'),'fields':[_0xe109('0x9'),_0xe109('0xa')]},{'name':'leaveAt','fields':[_0xe109('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index f92ec6a..a26c23c 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 _0x88d7=['SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','SquareReport','create','body','raw','CreateSquareReport','UpdateSquareReport','options','where','attributes','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','http','request','then','info'];(function(_0x29b24d,_0x4079c1){var _0x14e7cd=function(_0x324b44){while(--_0x324b44){_0x29b24d['push'](_0x29b24d['shift']());}};_0x14e7cd(++_0x4079c1);}(_0x88d7,0x117));var _0x788d=function(_0x673e94,_0x359dc1){_0x673e94=_0x673e94-0x0;var _0x5a003d=_0x88d7[_0x673e94];return _0x5a003d;};'use strict';var _=require(_0x788d('0x0'));var util=require(_0x788d('0x1'));var moment=require(_0x788d('0x2'));var BPromise=require('bluebird');var rs=require(_0x788d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x788d('0x4'))['db'];var utils=require(_0x788d('0x5'));var logger=require('../../config/logger')(_0x788d('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x788d('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x13622d,_0x57b83e,_0xca9f94){return new BPromise(function(_0xad4728,_0x4b6a80){return client[_0x788d('0x8')](_0x13622d,_0xca9f94)[_0x788d('0x9')](function(_0x1ecadc){logger[_0x788d('0xa')](_0x788d('0xb'),_0x57b83e,_0x788d('0xc'));logger[_0x788d('0xd')](_0x788d('0xe'),_0x57b83e,'request\x20sent',JSON[_0x788d('0xf')](_0x1ecadc));if(_0x1ecadc[_0x788d('0x10')]){if(_0x1ecadc[_0x788d('0x10')]['code']===0x1f4){logger['error'](_0x788d('0xb'),_0x57b83e,_0x1ecadc[_0x788d('0x10')][_0x788d('0x11')]);return _0x4b6a80(_0x1ecadc[_0x788d('0x10')][_0x788d('0x11')]);}logger[_0x788d('0x10')]('SquareReport,\x20%s,\x20%s',_0x57b83e,_0x1ecadc['error']['message']);return _0xad4728(_0x1ecadc[_0x788d('0x10')][_0x788d('0x11')]);}else{logger['info'](_0x788d('0xb'),_0x57b83e,'request\x20sent');_0xad4728(_0x1ecadc[_0x788d('0x12')][_0x788d('0x11')]);}})[_0x788d('0x13')](function(_0x1f00b6){logger['error'](_0x788d('0xb'),_0x57b83e,_0x1f00b6);_0x4b6a80(_0x1f00b6);});});}exports['CreateSquareReport']=function(_0x1d15b9){var _0xfe22d1=this;return new Promise(function(_0x32ce04,_0x1860c0){return db[_0x788d('0x14')][_0x788d('0x15')](_0x1d15b9[_0x788d('0x16')],{'raw':_0x1d15b9['options']?_0x1d15b9['options'][_0x788d('0x17')]===undefined?!![]:![]:!![]})[_0x788d('0x9')](function(_0x4968c8){logger[_0x788d('0xa')]('CreateSquareReport',_0x1d15b9);logger[_0x788d('0xd')](_0x788d('0x18'),_0x1d15b9,JSON[_0x788d('0xf')](_0x4968c8));_0x32ce04(_0x4968c8);})[_0x788d('0x13')](function(_0x922bb0){logger[_0x788d('0x10')](_0x788d('0x18'),_0x922bb0[_0x788d('0x11')],_0x1d15b9);_0x1860c0(_0xfe22d1[_0x788d('0x10')](0x1f4,_0x922bb0[_0x788d('0x11')]));});});};exports[_0x788d('0x19')]=function(_0x1a6a32){var _0x25ce86=this;return new Promise(function(_0x1784c2,_0x5c3493){return db['SquareReport']['update'](_0x1a6a32[_0x788d('0x16')],{'raw':_0x1a6a32[_0x788d('0x1a')]?_0x1a6a32[_0x788d('0x1a')][_0x788d('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1a6a32[_0x788d('0x1a')]?_0x1a6a32[_0x788d('0x1a')][_0x788d('0x1b')]||null:null,'attributes':_0x1a6a32[_0x788d('0x1a')]?_0x1a6a32[_0x788d('0x1a')][_0x788d('0x1c')]||null:null,'limit':_0x1a6a32[_0x788d('0x1a')]?_0x1a6a32[_0x788d('0x1a')]['limit']||null:null})[_0x788d('0x9')](function(_0x4ea74d){logger[_0x788d('0xa')](_0x788d('0x19'),_0x1a6a32);logger['debug'](_0x788d('0x19'),_0x1a6a32,JSON[_0x788d('0xf')](_0x4ea74d));_0x1784c2(_0x4ea74d);})[_0x788d('0x13')](function(_0x562eee){logger[_0x788d('0x10')](_0x788d('0x19'),_0x562eee[_0x788d('0x11')],_0x1a6a32);_0x5c3493(_0x25ce86[_0x788d('0x10')](0x1f4,_0x562eee[_0x788d('0x11')]));});});}; \ No newline at end of file +var _0x559d=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CreateSquareReport','SquareReport','create','body','options','raw','catch','UpdateSquareReport','update','where','attributes','limit','then'];(function(_0x130667,_0x444ae8){var _0x389d0d=function(_0x541b32){while(--_0x541b32){_0x130667['push'](_0x130667['shift']());}};_0x389d0d(++_0x444ae8);}(_0x559d,0x108));var _0xd559=function(_0x10bcb7,_0x518c99){_0x10bcb7=_0x10bcb7-0x0;var _0x3c1b3b=_0x559d[_0x10bcb7];return _0x3c1b3b;};'use strict';var _=require('lodash');var util=require(_0xd559('0x0'));var moment=require(_0xd559('0x1'));var BPromise=require(_0xd559('0x2'));var rs=require(_0xd559('0x3'));var fs=require('fs');var Redis=require(_0xd559('0x4'));var db=require(_0xd559('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd559('0x6'))(_0xd559('0x7'));var config=require(_0xd559('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd559('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x488fe5,_0x26949d,_0x501a9a){return new BPromise(function(_0x2856d6,_0x32faae){return client[_0xd559('0xa')](_0x488fe5,_0x501a9a)['then'](function(_0x142948){logger[_0xd559('0xb')](_0xd559('0xc'),_0x26949d,_0xd559('0xd'));logger[_0xd559('0xe')](_0xd559('0xf'),_0x26949d,_0xd559('0xd'),JSON[_0xd559('0x10')](_0x142948));if(_0x142948[_0xd559('0x11')]){if(_0x142948[_0xd559('0x11')][_0xd559('0x12')]===0x1f4){logger[_0xd559('0x11')]('SquareReport,\x20%s,\x20%s',_0x26949d,_0x142948[_0xd559('0x11')][_0xd559('0x13')]);return _0x32faae(_0x142948[_0xd559('0x11')][_0xd559('0x13')]);}logger['error'](_0xd559('0xc'),_0x26949d,_0x142948[_0xd559('0x11')]['message']);return _0x2856d6(_0x142948['error'][_0xd559('0x13')]);}else{logger[_0xd559('0xb')](_0xd559('0xc'),_0x26949d,_0xd559('0xd'));_0x2856d6(_0x142948['result']['message']);}})['catch'](function(_0x43fc3a){logger[_0xd559('0x11')](_0xd559('0xc'),_0x26949d,_0x43fc3a);_0x32faae(_0x43fc3a);});});}exports[_0xd559('0x14')]=function(_0x874769){var _0x265afd=this;return new Promise(function(_0x4aa929,_0x155fb2){return db[_0xd559('0x15')][_0xd559('0x16')](_0x874769[_0xd559('0x17')],{'raw':_0x874769[_0xd559('0x18')]?_0x874769[_0xd559('0x18')][_0xd559('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x3af2ee){logger[_0xd559('0xb')](_0xd559('0x14'),_0x874769);logger[_0xd559('0xe')](_0xd559('0x14'),_0x874769,JSON[_0xd559('0x10')](_0x3af2ee));_0x4aa929(_0x3af2ee);})[_0xd559('0x1a')](function(_0x103c19){logger[_0xd559('0x11')](_0xd559('0x14'),_0x103c19[_0xd559('0x13')],_0x874769);_0x155fb2(_0x265afd[_0xd559('0x11')](0x1f4,_0x103c19['message']));});});};exports[_0xd559('0x1b')]=function(_0x132ddb){var _0x4fff16=this;return new Promise(function(_0x59c012,_0xb7c984){return db[_0xd559('0x15')][_0xd559('0x1c')](_0x132ddb[_0xd559('0x17')],{'raw':_0x132ddb[_0xd559('0x18')]?_0x132ddb[_0xd559('0x18')][_0xd559('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x132ddb[_0xd559('0x18')]?_0x132ddb[_0xd559('0x18')][_0xd559('0x1d')]||null:null,'attributes':_0x132ddb['options']?_0x132ddb['options'][_0xd559('0x1e')]||null:null,'limit':_0x132ddb[_0xd559('0x18')]?_0x132ddb[_0xd559('0x18')][_0xd559('0x1f')]||null:null})[_0xd559('0x20')](function(_0x1b1f7a){logger[_0xd559('0xb')](_0xd559('0x1b'),_0x132ddb);logger[_0xd559('0xe')](_0xd559('0x1b'),_0x132ddb,JSON[_0xd559('0x10')](_0x1b1f7a));_0x59c012(_0x1b1f7a);})[_0xd559('0x1a')](function(_0x1dc7dc){logger[_0xd559('0x11')](_0xd559('0x1b'),_0x1dc7dc[_0xd559('0x13')],_0x132ddb);_0xb7c984(_0x4fff16[_0xd559('0x11')](0x1f4,_0x1dc7dc['message']));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 0c242a1..16d1145 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 _0x7ceb=['put','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','./squareReportDetail.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create'];(function(_0x59fd7b,_0x2efaca){var _0x5aa063=function(_0x315f72){while(--_0x315f72){_0x59fd7b['push'](_0x59fd7b['shift']());}};_0x5aa063(++_0x2efaca);}(_0x7ceb,0xd4));var _0xb7ce=function(_0x10fcfe,_0x591957){_0x10fcfe=_0x10fcfe-0x0;var _0x1f4c07=_0x7ceb[_0x10fcfe];return _0x1f4c07;};'use strict';var multer=require(_0xb7ce('0x0'));var util=require('util');var path=require(_0xb7ce('0x1'));var timeout=require(_0xb7ce('0x2'));var express=require(_0xb7ce('0x3'));var router=express[_0xb7ce('0x4')]();var fs_extra=require(_0xb7ce('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb7ce('0x6'));var controller=require(_0xb7ce('0x7'));router[_0xb7ce('0x8')]('/',auth[_0xb7ce('0x9')](),controller[_0xb7ce('0xa')]);router[_0xb7ce('0x8')](_0xb7ce('0xb'),auth[_0xb7ce('0x9')](),controller[_0xb7ce('0xc')]);router['get'](_0xb7ce('0xd'),auth[_0xb7ce('0x9')](),controller['show']);router[_0xb7ce('0xe')]('/',auth[_0xb7ce('0x9')](),controller[_0xb7ce('0xf')]);router[_0xb7ce('0x10')](_0xb7ce('0xd'),auth[_0xb7ce('0x9')](),controller['update']);router['delete'](_0xb7ce('0xd'),auth[_0xb7ce('0x9')](),controller[_0xb7ce('0x11')]);module[_0xb7ce('0x12')]=router; \ No newline at end of file +var _0x6630=['../../config/environment','./squareReportDetail.controller','isAuthenticated','get','/describe','describe','/:id','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x50352a,_0x3cf37e){var _0x4e1204=function(_0x242759){while(--_0x242759){_0x50352a['push'](_0x50352a['shift']());}};_0x4e1204(++_0x3cf37e);}(_0x6630,0xb5));var _0x0663=function(_0x373d13,_0xbbf7ad){_0x373d13=_0x373d13-0x0;var _0x3ffd36=_0x6630[_0x373d13];return _0x3ffd36;};'use strict';var multer=require(_0x0663('0x0'));var util=require(_0x0663('0x1'));var path=require(_0x0663('0x2'));var timeout=require(_0x0663('0x3'));var express=require(_0x0663('0x4'));var router=express['Router']();var fs_extra=require(_0x0663('0x5'));var auth=require(_0x0663('0x6'));var interaction=require(_0x0663('0x7'));var config=require(_0x0663('0x8'));var controller=require(_0x0663('0x9'));router['get']('/',auth[_0x0663('0xa')](),controller['index']);router[_0x0663('0xb')](_0x0663('0xc'),auth[_0x0663('0xa')](),controller[_0x0663('0xd')]);router[_0x0663('0xb')](_0x0663('0xe'),auth[_0x0663('0xa')](),controller['show']);router[_0x0663('0xf')]('/',auth[_0x0663('0xa')](),controller['create']);router[_0x0663('0x10')](_0x0663('0xe'),auth[_0x0663('0xa')](),controller[_0x0663('0x11')]);router[_0x0663('0x12')](_0x0663('0xe'),auth['isAuthenticated'](),controller[_0x0663('0x13')]);module[_0x0663('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 03b6d4e..f5f5e69 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 _0x4d0e=['TEXT','sequelize','STRING'];(function(_0x593752,_0xfc3827){var _0x4612be=function(_0x2d64c6){while(--_0x2d64c6){_0x593752['push'](_0x593752['shift']());}};_0x4612be(++_0xfc3827);}(_0x4d0e,0x15a));var _0xe4d0=function(_0x5d454e,_0x2a87bd){_0x5d454e=_0x5d454e-0x0;var _0x5deeb3=_0x4d0e[_0x5d454e];return _0x5deeb3;};'use strict';var Sequelize=require(_0xe4d0('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe4d0('0x1')]},'node':{'type':Sequelize[_0xe4d0('0x1')]},'application':{'type':Sequelize[_0xe4d0('0x1')]},'data':{'type':Sequelize[_0xe4d0('0x2')]},'project_name':{'type':Sequelize[_0xe4d0('0x1')]},'callerid':{'type':Sequelize[_0xe4d0('0x1')]}}; \ No newline at end of file +var _0xed43=['STRING','sequelize','exports'];(function(_0x3186aa,_0x34c21e){var _0x2d8c36=function(_0x239e99){while(--_0x239e99){_0x3186aa['push'](_0x3186aa['shift']());}};_0x2d8c36(++_0x34c21e);}(_0xed43,0x13f));var _0x3ed4=function(_0x19d24c,_0x62bc50){_0x19d24c=_0x19d24c-0x0;var _0x2fae8d=_0xed43[_0x19d24c];return _0x2fae8d;};'use strict';var Sequelize=require(_0x3ed4('0x0'));module[_0x3ed4('0x1')]={'uniqueid':{'type':Sequelize[_0x3ed4('0x2')]},'node':{'type':Sequelize['STRING']},'application':{'type':Sequelize[_0x3ed4('0x2')]},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize[_0x3ed4('0x2')]},'callerid':{'type':Sequelize[_0x3ed4('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 2138e5d..42f0ec1 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 _0x3945=['name','send','index','SquareDetailsReport','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','merge','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','end','sendStatus'];(function(_0x5139fd,_0x515789){var _0x51fa4a=function(_0x59af61){while(--_0x59af61){_0x5139fd['push'](_0x5139fd['shift']());}};_0x51fa4a(++_0x515789);}(_0x3945,0x6f));var _0x5394=function(_0x211ebd,_0x20e0f4){_0x211ebd=_0x211ebd-0x0;var _0x4b24f5=_0x3945[_0x211ebd];return _0x4b24f5;};'use strict';var emlformat=require(_0x5394('0x0'));var rimraf=require(_0x5394('0x1'));var zipdir=require(_0x5394('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5394('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5394('0x4'));var path=require(_0x5394('0x5'));var sox=require(_0x5394('0x6'));var csv=require(_0x5394('0x7'));var ejs=require(_0x5394('0x8'));var fs=require('fs');var fs_extra=require(_0x5394('0x9'));var _=require(_0x5394('0xa'));var squel=require(_0x5394('0xb'));var crypto=require('crypto');var jsforce=require(_0x5394('0xc'));var deskjs=require(_0x5394('0xd'));var toCsv=require(_0x5394('0x7'));var querystring=require('querystring');var Papa=require(_0x5394('0xe'));var Redis=require(_0x5394('0xf'));var authService=require(_0x5394('0x10'));var qs=require(_0x5394('0x11'));var as=require(_0x5394('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x5394('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x5394('0x14'));var db=require(_0x5394('0x15'))['db'];function respondWithStatusCode(_0x3c19a6,_0x30e9a0){_0x30e9a0=_0x30e9a0||0xcc;return function(_0x5a674c){if(_0x5a674c){return _0x3c19a6['sendStatus'](_0x30e9a0);}return _0x3c19a6[_0x5394('0x16')](_0x30e9a0)['end']();};}function respondWithResult(_0x389f59,_0x4a3417){_0x4a3417=_0x4a3417||0xc8;return function(_0x1acbbc){if(_0x1acbbc){return _0x389f59['status'](_0x4a3417)[_0x5394('0x17')](_0x1acbbc);}};}function respondWithFilteredResult(_0x17a2ae,_0x34d6dd){return function(_0x357ab2){if(_0x357ab2){var _0xe5a3c1=typeof _0x34d6dd[_0x5394('0x18')]===_0x5394('0x19')&&typeof _0x34d6dd[_0x5394('0x1a')]===_0x5394('0x19');var _0x256fc1=_0x357ab2[_0x5394('0x1b')];var _0x302d8e=_0xe5a3c1?0x0:_0x34d6dd[_0x5394('0x18')];var _0x3b041c=_0xe5a3c1?_0x357ab2[_0x5394('0x1b')]:_0x34d6dd[_0x5394('0x18')]+_0x34d6dd[_0x5394('0x1a')];var _0x31a42c;if(_0x3b041c>=_0x256fc1){_0x3b041c=_0x256fc1;_0x31a42c=0xc8;}else{_0x31a42c=0xce;}_0x17a2ae[_0x5394('0x16')](_0x31a42c);return _0x17a2ae[_0x5394('0x1c')](_0x5394('0x1d'),_0x302d8e+'-'+_0x3b041c+'/'+_0x256fc1)[_0x5394('0x17')](_0x357ab2);}return null;};}function patchUpdates(_0x49d076){return function(_0x24b168){try{jsonpatch['apply'](_0x24b168,_0x49d076,!![]);}catch(_0xbb058f){return BPromise[_0x5394('0x1e')](_0xbb058f);}return _0x24b168[_0x5394('0x1f')]();};}function saveUpdates(_0x4b7d12,_0x5a9643){return function(_0x17a54d){if(_0x17a54d){return _0x17a54d[_0x5394('0x20')](_0x4b7d12)[_0x5394('0x21')](function(_0x28e61e){return _0x28e61e;});}return null;};}function removeEntity(_0x6760,_0x26c739){return function(_0x31263b){if(_0x31263b){return _0x31263b[_0x5394('0x22')]()['then'](function(){_0x6760[_0x5394('0x16')](0xcc)[_0x5394('0x23')]();});}};}function handleEntityNotFound(_0x1d5f90,_0x36da91){return function(_0x375f4f){if(!_0x375f4f){_0x1d5f90[_0x5394('0x24')](0x194);}return _0x375f4f;};}function handleError(_0x177499,_0x1e425c){_0x1e425c=_0x1e425c||0x1f4;return function(_0x4dfc3){logger['error'](_0x4dfc3['stack']);if(_0x4dfc3['name']){delete _0x4dfc3[_0x5394('0x25')];}_0x177499['status'](_0x1e425c)[_0x5394('0x26')](_0x4dfc3);};}exports[_0x5394('0x27')]=function(_0x304776,_0x2fcb9c){var _0x3ff9fd={},_0x1f023f={},_0x436383={'count':0x0,'rows':[]};var _0x28da54=_['map'](db[_0x5394('0x28')][_0x5394('0x29')],function(_0x24d0b2){return{'name':_0x24d0b2[_0x5394('0x2a')],'type':_0x24d0b2[_0x5394('0x2b')][_0x5394('0x2c')]};});_0x1f023f[_0x5394('0x2d')]=_[_0x5394('0x2e')](_0x28da54,_0x5394('0x25'));_0x1f023f['query']=_[_0x5394('0x2f')](_0x304776[_0x5394('0x30')]);_0x1f023f[_0x5394('0x31')]=_[_0x5394('0x32')](_0x1f023f[_0x5394('0x2d')],_0x1f023f[_0x5394('0x30')]);_0x3ff9fd[_0x5394('0x33')]=_[_0x5394('0x32')](_0x1f023f[_0x5394('0x2d')],qs['fields'](_0x304776[_0x5394('0x30')][_0x5394('0x34')]));_0x3ff9fd['attributes']=_0x3ff9fd[_0x5394('0x33')][_0x5394('0x35')]?_0x3ff9fd[_0x5394('0x33')]:_0x1f023f[_0x5394('0x2d')];if(!_0x304776[_0x5394('0x30')][_0x5394('0x36')](_0x5394('0x37'))){_0x3ff9fd['limit']=qs[_0x5394('0x1a')](_0x304776[_0x5394('0x30')][_0x5394('0x1a')]);_0x3ff9fd[_0x5394('0x18')]=qs[_0x5394('0x18')](_0x304776[_0x5394('0x30')][_0x5394('0x18')]);}_0x3ff9fd[_0x5394('0x38')]=qs['sort'](_0x304776[_0x5394('0x30')]['sort']);_0x3ff9fd[_0x5394('0x39')]=qs['filters'](_[_0x5394('0x3a')](_0x304776[_0x5394('0x30')],_0x1f023f[_0x5394('0x31')]),_0x28da54);if(_0x304776[_0x5394('0x30')][_0x5394('0x3b')]){_0x3ff9fd[_0x5394('0x39')]=_['merge'](_0x3ff9fd['where'],{'$or':_['map'](_0x28da54,function(_0x2f1ce5){if(_0x2f1ce5[_0x5394('0x2b')]!==_0x5394('0x3c')){var _0x2d4590={};_0x2d4590[_0x2f1ce5[_0x5394('0x25')]]={'$like':'%'+_0x304776[_0x5394('0x30')][_0x5394('0x3b')]+'%'};return _0x2d4590;}})});}_0x3ff9fd=_['merge']({},_0x3ff9fd,_0x304776[_0x5394('0x3d')]);var _0x3b8541={'where':_0x3ff9fd['where']};return db['SquareDetailsReport'][_0x5394('0x1b')](_0x3b8541)['then'](function(_0x2fc397){_0x436383[_0x5394('0x1b')]=_0x2fc397;if(_0x304776[_0x5394('0x30')][_0x5394('0x3e')]){_0x3ff9fd[_0x5394('0x3f')]=[{'all':!![]}];}return db[_0x5394('0x28')][_0x5394('0x40')](_0x3ff9fd);})[_0x5394('0x21')](function(_0x1f3e7b){_0x436383[_0x5394('0x41')]=_0x1f3e7b;return _0x436383;})[_0x5394('0x21')](respondWithFilteredResult(_0x2fcb9c,_0x3ff9fd))[_0x5394('0x42')](handleError(_0x2fcb9c,null));};exports[_0x5394('0x43')]=function(_0x4ed101,_0x1d331c){var _0x35611f={'raw':!![],'where':{'id':_0x4ed101[_0x5394('0x44')]['id']}},_0x91f21a={};_0x91f21a[_0x5394('0x2d')]=_[_0x5394('0x2f')](db[_0x5394('0x28')]['rawAttributes']);_0x91f21a['query']=_['keys'](_0x4ed101[_0x5394('0x30')]);_0x91f21a[_0x5394('0x31')]=_[_0x5394('0x32')](_0x91f21a[_0x5394('0x2d')],_0x91f21a['query']);_0x35611f[_0x5394('0x33')]=_[_0x5394('0x32')](_0x91f21a['model'],qs['fields'](_0x4ed101[_0x5394('0x30')][_0x5394('0x34')]));_0x35611f[_0x5394('0x33')]=_0x35611f[_0x5394('0x33')][_0x5394('0x35')]?_0x35611f[_0x5394('0x33')]:_0x91f21a[_0x5394('0x2d')];if(_0x4ed101[_0x5394('0x30')]['includeAll']){_0x35611f[_0x5394('0x3f')]=[{'all':!![]}];}_0x35611f=_[_0x5394('0x45')]({},_0x35611f,_0x4ed101[_0x5394('0x3d')]);return db[_0x5394('0x28')][_0x5394('0x46')](_0x35611f)['then'](handleEntityNotFound(_0x1d331c,null))[_0x5394('0x21')](respondWithResult(_0x1d331c,null))[_0x5394('0x42')](handleError(_0x1d331c,null));};exports[_0x5394('0x47')]=function(_0x1eb596,_0x297ffe){return db['SquareDetailsReport']['create'](_0x1eb596[_0x5394('0x48')],{})['then'](respondWithResult(_0x297ffe,0xc9))['catch'](handleError(_0x297ffe,null));};exports[_0x5394('0x20')]=function(_0x291ffe,_0x332d77){if(_0x291ffe['body']['id']){delete _0x291ffe[_0x5394('0x48')]['id'];}return db['SquareDetailsReport']['find']({'where':{'id':_0x291ffe[_0x5394('0x44')]['id']}})[_0x5394('0x21')](handleEntityNotFound(_0x332d77,null))[_0x5394('0x21')](saveUpdates(_0x291ffe['body'],null))[_0x5394('0x21')](respondWithResult(_0x332d77,null))[_0x5394('0x42')](handleError(_0x332d77,null));};exports[_0x5394('0x22')]=function(_0x363725,_0x20e021){return db[_0x5394('0x28')][_0x5394('0x46')]({'where':{'id':_0x363725['params']['id']}})[_0x5394('0x21')](handleEntityNotFound(_0x20e021,null))['then'](removeEntity(_0x20e021,null))[_0x5394('0x42')](handleError(_0x20e021,null));};exports[_0x5394('0x49')]=function(_0x7764ac,_0x161c92){return db[_0x5394('0x28')][_0x5394('0x49')]()[_0x5394('0x21')](respondWithResult(_0x161c92,null))['catch'](handleError(_0x161c92,null));}; \ No newline at end of file +var _0x8130=['where','pick','filter','type','VIRTUAL','merge','options','includeAll','findAll','rows','catch','params','filters','include','create','body','find','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','end','stack','name','send','index','map','SquareDetailsReport','rawAttributes','fieldName','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8130,0x146));var _0x0813=function(_0x463dfd,_0x12488b){_0x463dfd=_0x463dfd-0x0;var _0x4ca1b3=_0x8130[_0x463dfd];return _0x4ca1b3;};'use strict';var emlformat=require(_0x0813('0x0'));var rimraf=require(_0x0813('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0813('0x2'));var rp=require(_0x0813('0x3'));var moment=require(_0x0813('0x4'));var BPromise=require(_0x0813('0x5'));var Mustache=require(_0x0813('0x6'));var util=require(_0x0813('0x7'));var path=require('path');var sox=require(_0x0813('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0813('0x9'));var _=require(_0x0813('0xa'));var squel=require(_0x0813('0xb'));var crypto=require(_0x0813('0xc'));var jsforce=require(_0x0813('0xd'));var deskjs=require(_0x0813('0xe'));var toCsv=require(_0x0813('0xf'));var querystring=require('querystring');var Papa=require(_0x0813('0x10'));var Redis=require(_0x0813('0x11'));var authService=require(_0x0813('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0813('0x13'));var logger=require('../../config/logger')(_0x0813('0x14'));var utils=require('../../config/utils');var config=require(_0x0813('0x15'));var licenseUtil=require(_0x0813('0x16'));var db=require(_0x0813('0x17'))['db'];function respondWithStatusCode(_0x230ec7,_0x5b17f2){_0x5b17f2=_0x5b17f2||0xcc;return function(_0x4dcc3a){if(_0x4dcc3a){return _0x230ec7[_0x0813('0x18')](_0x5b17f2);}return _0x230ec7[_0x0813('0x19')](_0x5b17f2)['end']();};}function respondWithResult(_0x403e40,_0x4dae33){_0x4dae33=_0x4dae33||0xc8;return function(_0x58e56c){if(_0x58e56c){return _0x403e40[_0x0813('0x19')](_0x4dae33)[_0x0813('0x1a')](_0x58e56c);}};}function respondWithFilteredResult(_0x4ffaad,_0x2cf4f1){return function(_0x5793cb){if(_0x5793cb){var _0x29537f=typeof _0x2cf4f1[_0x0813('0x1b')]===_0x0813('0x1c')&&typeof _0x2cf4f1[_0x0813('0x1d')]===_0x0813('0x1c');var _0x10e29a=_0x5793cb[_0x0813('0x1e')];var _0x3e15da=_0x29537f?0x0:_0x2cf4f1['offset'];var _0x3ec7b5=_0x29537f?_0x5793cb['count']:_0x2cf4f1[_0x0813('0x1b')]+_0x2cf4f1[_0x0813('0x1d')];var _0x518923;if(_0x3ec7b5>=_0x10e29a){_0x3ec7b5=_0x10e29a;_0x518923=0xc8;}else{_0x518923=0xce;}_0x4ffaad[_0x0813('0x19')](_0x518923);return _0x4ffaad[_0x0813('0x1f')]('Content-Range',_0x3e15da+'-'+_0x3ec7b5+'/'+_0x10e29a)[_0x0813('0x1a')](_0x5793cb);}return null;};}function patchUpdates(_0x334741){return function(_0x4d7680){try{jsonpatch[_0x0813('0x20')](_0x4d7680,_0x334741,!![]);}catch(_0x3b3662){return BPromise[_0x0813('0x21')](_0x3b3662);}return _0x4d7680[_0x0813('0x22')]();};}function saveUpdates(_0xf6ee0c,_0x5a6cdc){return function(_0x2bb694){if(_0x2bb694){return _0x2bb694[_0x0813('0x23')](_0xf6ee0c)[_0x0813('0x24')](function(_0x598cf2){return _0x598cf2;});}return null;};}function removeEntity(_0x35b3d6,_0x5eabe4){return function(_0x56f4b6){if(_0x56f4b6){return _0x56f4b6[_0x0813('0x25')]()['then'](function(){_0x35b3d6['status'](0xcc)[_0x0813('0x26')]();});}};}function handleEntityNotFound(_0x2366a3,_0x1a8d2a){return function(_0x2f8849){if(!_0x2f8849){_0x2366a3[_0x0813('0x18')](0x194);}return _0x2f8849;};}function handleError(_0x1418c7,_0x42627c){_0x42627c=_0x42627c||0x1f4;return function(_0x3ac129){logger['error'](_0x3ac129[_0x0813('0x27')]);if(_0x3ac129[_0x0813('0x28')]){delete _0x3ac129[_0x0813('0x28')];}_0x1418c7[_0x0813('0x19')](_0x42627c)[_0x0813('0x29')](_0x3ac129);};}exports[_0x0813('0x2a')]=function(_0x55e115,_0xa36d86){var _0x48294b={},_0x54ed64={},_0x54bf5d={'count':0x0,'rows':[]};var _0x3c3321=_[_0x0813('0x2b')](db[_0x0813('0x2c')][_0x0813('0x2d')],function(_0x21f388){return{'name':_0x21f388[_0x0813('0x2e')],'type':_0x21f388['type'][_0x0813('0x2f')]};});_0x54ed64[_0x0813('0x30')]=_['map'](_0x3c3321,'name');_0x54ed64[_0x0813('0x31')]=_[_0x0813('0x32')](_0x55e115[_0x0813('0x31')]);_0x54ed64['filters']=_[_0x0813('0x33')](_0x54ed64[_0x0813('0x30')],_0x54ed64['query']);_0x48294b['attributes']=_[_0x0813('0x33')](_0x54ed64[_0x0813('0x30')],qs[_0x0813('0x34')](_0x55e115[_0x0813('0x31')]['fields']));_0x48294b[_0x0813('0x35')]=_0x48294b[_0x0813('0x35')][_0x0813('0x36')]?_0x48294b[_0x0813('0x35')]:_0x54ed64['model'];if(!_0x55e115['query'][_0x0813('0x37')](_0x0813('0x38'))){_0x48294b[_0x0813('0x1d')]=qs['limit'](_0x55e115[_0x0813('0x31')][_0x0813('0x1d')]);_0x48294b[_0x0813('0x1b')]=qs['offset'](_0x55e115['query'][_0x0813('0x1b')]);}_0x48294b[_0x0813('0x39')]=qs[_0x0813('0x3a')](_0x55e115[_0x0813('0x31')][_0x0813('0x3a')]);_0x48294b[_0x0813('0x3b')]=qs['filters'](_[_0x0813('0x3c')](_0x55e115['query'],_0x54ed64['filters']),_0x3c3321);if(_0x55e115['query'][_0x0813('0x3d')]){_0x48294b[_0x0813('0x3b')]=_['merge'](_0x48294b['where'],{'$or':_[_0x0813('0x2b')](_0x3c3321,function(_0x36ce6d){if(_0x36ce6d[_0x0813('0x3e')]!==_0x0813('0x3f')){var _0x36f4d5={};_0x36f4d5[_0x36ce6d[_0x0813('0x28')]]={'$like':'%'+_0x55e115[_0x0813('0x31')][_0x0813('0x3d')]+'%'};return _0x36f4d5;}})});}_0x48294b=_[_0x0813('0x40')]({},_0x48294b,_0x55e115[_0x0813('0x41')]);var _0x54b271={'where':_0x48294b['where']};return db['SquareDetailsReport'][_0x0813('0x1e')](_0x54b271)[_0x0813('0x24')](function(_0x5cb01b){_0x54bf5d[_0x0813('0x1e')]=_0x5cb01b;if(_0x55e115[_0x0813('0x31')][_0x0813('0x42')]){_0x48294b['include']=[{'all':!![]}];}return db[_0x0813('0x2c')][_0x0813('0x43')](_0x48294b);})[_0x0813('0x24')](function(_0x4e94b0){_0x54bf5d[_0x0813('0x44')]=_0x4e94b0;return _0x54bf5d;})[_0x0813('0x24')](respondWithFilteredResult(_0xa36d86,_0x48294b))[_0x0813('0x45')](handleError(_0xa36d86,null));};exports['show']=function(_0x22564d,_0x38dc22){var _0x47da3b={'raw':!![],'where':{'id':_0x22564d[_0x0813('0x46')]['id']}},_0x171a5e={};_0x171a5e['model']=_[_0x0813('0x32')](db['SquareDetailsReport'][_0x0813('0x2d')]);_0x171a5e[_0x0813('0x31')]=_[_0x0813('0x32')](_0x22564d['query']);_0x171a5e[_0x0813('0x47')]=_['intersection'](_0x171a5e[_0x0813('0x30')],_0x171a5e[_0x0813('0x31')]);_0x47da3b[_0x0813('0x35')]=_[_0x0813('0x33')](_0x171a5e[_0x0813('0x30')],qs[_0x0813('0x34')](_0x22564d['query'][_0x0813('0x34')]));_0x47da3b['attributes']=_0x47da3b[_0x0813('0x35')]['length']?_0x47da3b['attributes']:_0x171a5e['model'];if(_0x22564d[_0x0813('0x31')][_0x0813('0x42')]){_0x47da3b[_0x0813('0x48')]=[{'all':!![]}];}_0x47da3b=_[_0x0813('0x40')]({},_0x47da3b,_0x22564d[_0x0813('0x41')]);return db[_0x0813('0x2c')]['find'](_0x47da3b)['then'](handleEntityNotFound(_0x38dc22,null))[_0x0813('0x24')](respondWithResult(_0x38dc22,null))[_0x0813('0x45')](handleError(_0x38dc22,null));};exports[_0x0813('0x49')]=function(_0x3fd5f9,_0xadaead){return db[_0x0813('0x2c')][_0x0813('0x49')](_0x3fd5f9[_0x0813('0x4a')],{})['then'](respondWithResult(_0xadaead,0xc9))[_0x0813('0x45')](handleError(_0xadaead,null));};exports[_0x0813('0x23')]=function(_0x42e4e4,_0x1baf77){if(_0x42e4e4[_0x0813('0x4a')]['id']){delete _0x42e4e4[_0x0813('0x4a')]['id'];}return db['SquareDetailsReport'][_0x0813('0x4b')]({'where':{'id':_0x42e4e4['params']['id']}})[_0x0813('0x24')](handleEntityNotFound(_0x1baf77,null))[_0x0813('0x24')](saveUpdates(_0x42e4e4[_0x0813('0x4a')],null))[_0x0813('0x24')](respondWithResult(_0x1baf77,null))['catch'](handleError(_0x1baf77,null));};exports[_0x0813('0x25')]=function(_0x3a93eb,_0x353e25){return db[_0x0813('0x2c')]['find']({'where':{'id':_0x3a93eb[_0x0813('0x46')]['id']}})[_0x0813('0x24')](handleEntityNotFound(_0x353e25,null))['then'](removeEntity(_0x353e25,null))['catch'](handleError(_0x353e25,null));};exports[_0x0813('0x4c')]=function(_0x30956a,_0x2846a7){return db['SquareDetailsReport']['describe']()['then'](respondWithResult(_0x2846a7,null))['catch'](handleError(_0x2846a7,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 793d779..e6d9094 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 _0xf826=['define','SquareDetailsReport','report_square_details','lodash','util','moment','bluebird','request-promise','rimraf','../../config/environment','./squareReportDetail.attributes'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xf826,0x1d1));var _0x6f82=function(_0x488139,_0x45049f){_0x488139=_0x488139-0x0;var _0x131f8f=_0xf826[_0x488139];return _0x131f8f;};'use strict';var _=require(_0x6f82('0x0'));var util=require(_0x6f82('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x6f82('0x2'));var BPromise=require(_0x6f82('0x3'));var rp=require(_0x6f82('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6f82('0x5'));var config=require(_0x6f82('0x6'));var attributes=require(_0x6f82('0x7'));module['exports']=function(_0x5b6a04,_0x177ca3){return _0x5b6a04[_0x6f82('0x8')](_0x6f82('0x9'),attributes,{'tableName':_0x6f82('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5725=['exports','define','util','../../config/logger','api','moment','request-promise','../../config/environment','./squareReportDetail.attributes'];(function(_0x13b103,_0x45ad6b){var _0x1b0436=function(_0x574652){while(--_0x574652){_0x13b103['push'](_0x13b103['shift']());}};_0x1b0436(++_0x45ad6b);}(_0x5725,0x18e));var _0x5572=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x5725[_0x57b54c];return _0x59cc19;};'use strict';var _=require('lodash');var util=require(_0x5572('0x0'));var logger=require(_0x5572('0x1'))(_0x5572('0x2'));var moment=require(_0x5572('0x3'));var BPromise=require('bluebird');var rp=require(_0x5572('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5572('0x5'));var attributes=require(_0x5572('0x6'));module[_0x5572('0x7')]=function(_0x922afe,_0x4244d6){return _0x922afe[_0x5572('0x8')]('SquareDetailsReport',attributes,{'tableName':'report_square_details','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 7b25eb9..7a6ebd6 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 _0xb9be=['then','info','SquareDetailsReport,\x20%s,\x20%s','debug','stringify','error','code','request\x20sent','result','message','catch','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request'];(function(_0x199551,_0x107c1d){var _0x318fa8=function(_0xf265e4){while(--_0xf265e4){_0x199551['push'](_0x199551['shift']());}};_0x318fa8(++_0x107c1d);}(_0xb9be,0xc5));var _0xeb9b=function(_0x1df7b8,_0x2fe5e5){_0x1df7b8=_0x1df7b8-0x0;var _0x29d911=_0xb9be[_0x1df7b8];return _0x29d911;};'use strict';var _=require(_0xeb9b('0x0'));var util=require(_0xeb9b('0x1'));var moment=require(_0xeb9b('0x2'));var BPromise=require(_0xeb9b('0x3'));var rs=require(_0xeb9b('0x4'));var fs=require('fs');var Redis=require(_0xeb9b('0x5'));var db=require(_0xeb9b('0x6'))['db'];var utils=require(_0xeb9b('0x7'));var logger=require(_0xeb9b('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xeb9b('0x9'));var client=jayson[_0xeb9b('0xa')][_0xeb9b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x49a8b9,_0x1ee7e0,_0x58ca1d){return new BPromise(function(_0x210eeb,_0x28dc5f){return client[_0xeb9b('0xc')](_0x49a8b9,_0x58ca1d)[_0xeb9b('0xd')](function(_0x418204){logger[_0xeb9b('0xe')](_0xeb9b('0xf'),_0x1ee7e0,'request\x20sent');logger[_0xeb9b('0x10')]('SquareDetailsReport,\x20%s,\x20%s,\x20%s',_0x1ee7e0,'request\x20sent',JSON[_0xeb9b('0x11')](_0x418204));if(_0x418204[_0xeb9b('0x12')]){if(_0x418204['error'][_0xeb9b('0x13')]===0x1f4){logger[_0xeb9b('0x12')](_0xeb9b('0xf'),_0x1ee7e0,_0x418204[_0xeb9b('0x12')]['message']);return _0x28dc5f(_0x418204['error']['message']);}logger[_0xeb9b('0x12')](_0xeb9b('0xf'),_0x1ee7e0,_0x418204[_0xeb9b('0x12')]['message']);return _0x210eeb(_0x418204['error']['message']);}else{logger[_0xeb9b('0xe')](_0xeb9b('0xf'),_0x1ee7e0,_0xeb9b('0x14'));_0x210eeb(_0x418204[_0xeb9b('0x15')][_0xeb9b('0x16')]);}})[_0xeb9b('0x17')](function(_0x239ccf){logger['error'](_0xeb9b('0xf'),_0x1ee7e0,_0x239ccf);_0x28dc5f(_0x239ccf);});});}exports[_0xeb9b('0x18')]=function(_0x21aca6){var _0x3a11e3=this;return new Promise(function(_0x3cbe3e,_0x1a140c){return db[_0xeb9b('0x19')][_0xeb9b('0x1a')](_0x21aca6[_0xeb9b('0x1b')],{'raw':_0x21aca6[_0xeb9b('0x1c')]?_0x21aca6['options'][_0xeb9b('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x5d5f54){logger[_0xeb9b('0xe')](_0xeb9b('0x18'),_0x21aca6);logger['debug'](_0xeb9b('0x18'),_0x21aca6,JSON[_0xeb9b('0x11')](_0x5d5f54));_0x3cbe3e(_0x5d5f54);})[_0xeb9b('0x17')](function(_0x37d7e0){logger[_0xeb9b('0x12')](_0xeb9b('0x18'),_0x37d7e0[_0xeb9b('0x16')],_0x21aca6);_0x1a140c(_0x3a11e3[_0xeb9b('0x12')](0x1f4,_0x37d7e0[_0xeb9b('0x16')]));});});}; \ No newline at end of file +var _0x51c5=['options','raw','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','debug','request\x20sent','stringify','error','code','message','SquareDetailsReport,\x20%s,\x20%s','info','catch','CreateSquareDetailsReport','create'];(function(_0x2ceb9c,_0x107a89){var _0x696c6b=function(_0x2f5525){while(--_0x2f5525){_0x2ceb9c['push'](_0x2ceb9c['shift']());}};_0x696c6b(++_0x107a89);}(_0x51c5,0x8f));var _0x551c=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0x51c5[_0x2070da];return _0x4f9fe1;};'use strict';var _=require(_0x551c('0x0'));var util=require(_0x551c('0x1'));var moment=require(_0x551c('0x2'));var BPromise=require(_0x551c('0x3'));var rs=require(_0x551c('0x4'));var fs=require('fs');var Redis=require(_0x551c('0x5'));var db=require(_0x551c('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x551c('0x7'))(_0x551c('0x8'));var config=require(_0x551c('0x9'));var jayson=require(_0x551c('0xa'));var client=jayson[_0x551c('0xb')][_0x551c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x21dfa1,_0x196955,_0x4f3a0a){return new BPromise(function(_0x414edb,_0x15f4f8){return client[_0x551c('0xd')](_0x21dfa1,_0x4f3a0a)['then'](function(_0x17683c){logger['info']('SquareDetailsReport,\x20%s,\x20%s',_0x196955,'request\x20sent');logger[_0x551c('0xe')]('SquareDetailsReport,\x20%s,\x20%s,\x20%s',_0x196955,_0x551c('0xf'),JSON[_0x551c('0x10')](_0x17683c));if(_0x17683c[_0x551c('0x11')]){if(_0x17683c[_0x551c('0x11')][_0x551c('0x12')]===0x1f4){logger[_0x551c('0x11')]('SquareDetailsReport,\x20%s,\x20%s',_0x196955,_0x17683c[_0x551c('0x11')][_0x551c('0x13')]);return _0x15f4f8(_0x17683c[_0x551c('0x11')]['message']);}logger[_0x551c('0x11')](_0x551c('0x14'),_0x196955,_0x17683c['error'][_0x551c('0x13')]);return _0x414edb(_0x17683c['error'][_0x551c('0x13')]);}else{logger[_0x551c('0x15')](_0x551c('0x14'),_0x196955,_0x551c('0xf'));_0x414edb(_0x17683c['result']['message']);}})[_0x551c('0x16')](function(_0xcdf011){logger['error'](_0x551c('0x14'),_0x196955,_0xcdf011);_0x15f4f8(_0xcdf011);});});}exports[_0x551c('0x17')]=function(_0x274432){var _0x2a0b55=this;return new Promise(function(_0x4c8dba,_0x4fcaf3){return db['SquareDetailsReport'][_0x551c('0x18')](_0x274432['body'],{'raw':_0x274432['options']?_0x274432[_0x551c('0x19')][_0x551c('0x1a')]===undefined?!![]:![]:!![]})[_0x551c('0x1b')](function(_0x1927e7){logger[_0x551c('0x15')](_0x551c('0x17'),_0x274432);logger['debug']('CreateSquareDetailsReport',_0x274432,JSON[_0x551c('0x10')](_0x1927e7));_0x4c8dba(_0x1927e7);})['catch'](function(_0x330160){logger[_0x551c('0x11')](_0x551c('0x17'),_0x330160[_0x551c('0x13')],_0x274432);_0x4fcaf3(_0x2a0b55[_0x551c('0x11')](0x1f4,_0x330160['message']));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 025386d..621f286 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 _0xc260=['killProcess','exports','express','Router','./system.controller','isAuthenticated','index','get','/process/:pid/kill'];(function(_0x4c5c97,_0x4f85bf){var _0xd5d2cb=function(_0x1e6100){while(--_0x1e6100){_0x4c5c97['push'](_0x4c5c97['shift']());}};_0xd5d2cb(++_0x4f85bf);}(_0xc260,0x89));var _0x0c26=function(_0x764e11,_0x1b6e2f){_0x764e11=_0x764e11-0x0;var _0x461748=_0xc260[_0x764e11];return _0x461748;};'use strict';var express=require(_0x0c26('0x0'));var router=express[_0x0c26('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x0c26('0x2'));router['get']('/',auth[_0x0c26('0x3')](),controller[_0x0c26('0x4')]);router[_0x0c26('0x5')](_0x0c26('0x6'),auth[_0x0c26('0x3')](),controller[_0x0c26('0x7')]);module[_0x0c26('0x8')]=router; \ No newline at end of file +var _0x716c=['killProcess','express','Router','../../components/auth/service','./system.controller','get','isAuthenticated','index'];(function(_0x1d5c65,_0x81e95c){var _0x38a8bf=function(_0x29f1e2){while(--_0x29f1e2){_0x1d5c65['push'](_0x1d5c65['shift']());}};_0x38a8bf(++_0x81e95c);}(_0x716c,0x1d1));var _0xc716=function(_0xcd9e09,_0x4817fb){_0xcd9e09=_0xcd9e09-0x0;var _0x587429=_0x716c[_0xcd9e09];return _0x587429;};'use strict';var express=require(_0xc716('0x0'));var router=express[_0xc716('0x1')]();var auth=require(_0xc716('0x2'));var controller=require(_0xc716('0x3'));router[_0xc716('0x4')]('/',auth[_0xc716('0x5')](),controller[_0xc716('0x6')]);router[_0xc716('0x4')]('/process/:pid/kill',auth[_0xc716('0x5')](),controller[_0xc716('0x7')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index 2bb8ed0..c2c4dbc 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 _0x9857=['child_process','exec','../../config/logger','api','util','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','status','send','getAllData','then','json','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation'];(function(_0x5a95fa,_0x4a2fc9){var _0x1a61b8=function(_0x59f119){while(--_0x59f119){_0x5a95fa['push'](_0x5a95fa['shift']());}};_0x1a61b8(++_0x4a2fc9);}(_0x9857,0x86));var _0x7985=function(_0x39ce86,_0x443990){_0x39ce86=_0x39ce86-0x0;var _0x18d410=_0x9857[_0x39ce86];return _0x18d410;};'use strict';var info=require(_0x7985('0x0'));var exec=require(_0x7985('0x1'))[_0x7985('0x2')];var logger=require(_0x7985('0x3'))(_0x7985('0x4'));var util=require(_0x7985('0x5'));var BPromise=require('bluebird');var _=require(_0x7985('0x6'));function handleError(_0x4822e3,_0xb7a991,_0x1b820a){_0xb7a991=_0xb7a991||0x1f4;return function(_0x24f397){logger[_0x7985('0x7')](_0x7985('0x8'),_0x1b820a,_0xb7a991,util[_0x7985('0x9')](_0x24f397,{'showHidden':![],'depth':null}));delete _0x24f397['name'];_0x4822e3[_0x7985('0xa')](_0xb7a991)[_0x7985('0xb')](_0x24f397);};}exports['index']=function(_0x28e4e5,_0x572648){return info[_0x7985('0xc')]()[_0x7985('0xd')](function(_0x1526dc){return _0x572648['status'](0xc8)[_0x7985('0xe')](_0x1526dc);})['catch'](function(_0x351968){return _0x572648[_0x7985('0xa')](0x1f4)['json'](_0x351968);});};exports[_0x7985('0xf')]=function(_0x4ca0a0,_0x71ec81){var _0x32ee26=[_0x7985('0x10')];return new BPromise(function(_0x2acf0d,_0x11039e){return exec(util[_0x7985('0x11')](_0x7985('0x12'),_0x4ca0a0[_0x7985('0x13')][_0x7985('0x14')]),function(_0x46f743,_0x3e1460,_0x347b09){if(_0x46f743){return _0x11039e(_0x46f743);}return _0x2acf0d(_0x3e1460);});})[_0x7985('0xd')](function(_0x203c4c){var _0x56aff9=![];var _0x472672=_0x203c4c['split'](/\n/);for(var _0x44d587=0x0,_0x3fd7a3=_0x32ee26[_0x7985('0x15')];_0x44d587<_0x3fd7a3,_0x56aff9===![];_0x44d587+=0x1){if(_0x203c4c[_0x7985('0x16')](_0x32ee26[_0x44d587])>=0x0){_0x56aff9=!![];}}if(!_0x56aff9){throw new Error(util[_0x7985('0x11')](_0x7985('0x17'),_0x4ca0a0[_0x7985('0x13')][_0x7985('0x14')]));}process[_0x7985('0x18')](_0x4ca0a0['params'][_0x7985('0x14')],_0x7985('0x19'));return _0x71ec81['status'](0xc8)[_0x7985('0xe')]({'message':util[_0x7985('0x11')](_0x7985('0x1a'),_0x4ca0a0[_0x7985('0x13')]['pid'])});})['catch'](handleError(_0x71ec81,null,_0x7985('0xf')));}; \ No newline at end of file +var _0x528d=['<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','send','index','getAllData','json','catch','killProcess','components/import/cm','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','split','length','indexOf','format','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','child_process','api','util','bluebird','lodash'];(function(_0x4c3a36,_0xdba60f){var _0x40f945=function(_0x4efdb2){while(--_0x4efdb2){_0x4c3a36['push'](_0x4c3a36['shift']());}};_0x40f945(++_0xdba60f);}(_0x528d,0xf6));var _0xd528=function(_0x5ce4e8,_0x1cf7ee){_0x5ce4e8=_0x5ce4e8-0x0;var _0x3edc5b=_0x528d[_0x5ce4e8];return _0x3edc5b;};'use strict';var info=require(_0xd528('0x0'));var exec=require(_0xd528('0x1'))['exec'];var logger=require('../../config/logger')(_0xd528('0x2'));var util=require(_0xd528('0x3'));var BPromise=require(_0xd528('0x4'));var _=require(_0xd528('0x5'));function handleError(_0x468f02,_0x28d751,_0x584062){_0x28d751=_0x28d751||0x1f4;return function(_0x2bd8e0){logger['error'](_0xd528('0x6'),_0x584062,_0x28d751,util[_0xd528('0x7')](_0x2bd8e0,{'showHidden':![],'depth':null}));delete _0x2bd8e0[_0xd528('0x8')];_0x468f02[_0xd528('0x9')](_0x28d751)[_0xd528('0xa')](_0x2bd8e0);};}exports[_0xd528('0xb')]=function(_0x909f76,_0xd19d86){return info[_0xd528('0xc')]()['then'](function(_0x339381){return _0xd19d86[_0xd528('0x9')](0xc8)[_0xd528('0xd')](_0x339381);})[_0xd528('0xe')](function(_0x47a1f5){return _0xd19d86[_0xd528('0x9')](0x1f4)[_0xd528('0xd')](_0x47a1f5);});};exports[_0xd528('0xf')]=function(_0x1ffa01,_0x3a5b42){var _0x1f4a8a=[_0xd528('0x10')];return new BPromise(function(_0x49f4c1,_0x3ee671){return exec(util['format'](_0xd528('0x11'),_0x1ffa01[_0xd528('0x12')][_0xd528('0x13')]),function(_0x1f5e53,_0xcc8f83,_0x233308){if(_0x1f5e53){return _0x3ee671(_0x1f5e53);}return _0x49f4c1(_0xcc8f83);});})['then'](function(_0x364926){var _0x330809=![];var _0x333e6a=_0x364926[_0xd528('0x14')](/\n/);for(var _0x2f28ad=0x0,_0x53a57a=_0x1f4a8a[_0xd528('0x15')];_0x2f28ad<_0x53a57a,_0x330809===![];_0x2f28ad+=0x1){if(_0x364926[_0xd528('0x16')](_0x1f4a8a[_0x2f28ad])>=0x0){_0x330809=!![];}}if(!_0x330809){throw new Error(util[_0xd528('0x17')](_0xd528('0x18'),_0x1ffa01[_0xd528('0x12')][_0xd528('0x13')]));}process[_0xd528('0x19')](_0x1ffa01['params']['pid'],_0xd528('0x1a'));return _0x3a5b42[_0xd528('0x9')](0xc8)[_0xd528('0xd')]({'message':util[_0xd528('0x17')](_0xd528('0x1b'),_0x1ffa01['params'][_0xd528('0x13')])});})[_0xd528('0xe')](handleError(_0x3a5b42,null,_0xd528('0xf')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 03ba23e..6acf779 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 _0x2750=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','get','index','/describe','isAuthenticated','/:id','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router'];(function(_0xbc4560,_0x4020b8){var _0x298cfb=function(_0x254423){while(--_0x254423){_0xbc4560['push'](_0xbc4560['shift']());}};_0x298cfb(++_0x4020b8);}(_0x2750,0x13b));var _0x0275=function(_0x23820d,_0x527c51){_0x23820d=_0x23820d-0x0;var _0x45186f=_0x2750[_0x23820d];return _0x45186f;};'use strict';var multer=require(_0x0275('0x0'));var util=require('util');var path=require(_0x0275('0x1'));var timeout=require(_0x0275('0x2'));var express=require(_0x0275('0x3'));var router=express[_0x0275('0x4')]();var fs_extra=require(_0x0275('0x5'));var auth=require(_0x0275('0x6'));var interaction=require(_0x0275('0x7'));var config=require(_0x0275('0x8'));var controller=require(_0x0275('0x9'));router[_0x0275('0xa')]('/',auth['isAuthenticated'](),controller[_0x0275('0xb')]);router[_0x0275('0xa')](_0x0275('0xc'),auth[_0x0275('0xd')](),controller['describe']);router[_0x0275('0xa')](_0x0275('0xe'),auth[_0x0275('0xd')](),controller['show']);router['post']('/',auth[_0x0275('0xd')](),controller['create']);router[_0x0275('0xf')](_0x0275('0xe'),auth[_0x0275('0xd')](),controller[_0x0275('0x10')]);router[_0x0275('0x11')]('/:id',auth[_0x0275('0xd')](),controller[_0x0275('0x12')]);module[_0x0275('0x13')]=router; \ No newline at end of file +var _0xbd50=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/describe','/:id','show','create','delete','exports','multer','util'];(function(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0xbd50,0x196));var _0x0bd5=function(_0x244240,_0x3b44e2){_0x244240=_0x244240-0x0;var _0x57af02=_0xbd50[_0x244240];return _0x57af02;};'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 fs_extra=require(_0x0bd5('0x5'));var auth=require(_0x0bd5('0x6'));var interaction=require(_0x0bd5('0x7'));var config=require('../../config/environment');var controller=require('./tag.controller');router['get']('/',auth[_0x0bd5('0x8')](),controller[_0x0bd5('0x9')]);router[_0x0bd5('0xa')](_0x0bd5('0xb'),auth[_0x0bd5('0x8')](),controller['describe']);router['get'](_0x0bd5('0xc'),auth[_0x0bd5('0x8')](),controller[_0x0bd5('0xd')]);router['post']('/',auth[_0x0bd5('0x8')](),controller[_0x0bd5('0xe')]);router['put'](_0x0bd5('0xc'),auth[_0x0bd5('0x8')](),controller['update']);router[_0x0bd5('0xf')](_0x0bd5('0xc'),auth[_0x0bd5('0x8')](),controller['destroy']);module[_0x0bd5('0x10')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index 277ab93..d1071f0 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 _0x8efc=['STRING','name','exports'];(function(_0x457d2a,_0x1ef267){var _0x487f6a=function(_0x21745f){while(--_0x21745f){_0x457d2a['push'](_0x457d2a['shift']());}};_0x487f6a(++_0x1ef267);}(_0x8efc,0xb3));var _0xc8ef=function(_0x3a7a9c,_0x24f7d6){_0x3a7a9c=_0x3a7a9c-0x0;var _0x59156e=_0x8efc[_0x3a7a9c];return _0x59156e;};'use strict';var Sequelize=require('sequelize');module[_0xc8ef('0x0')]={'name':{'type':Sequelize[_0xc8ef('0x1')],'unique':_0xc8ef('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xc8ef('0x1')],'defaultValue':'#0091EA'},'description':{'type':Sequelize[_0xc8ef('0x1')]}}; \ No newline at end of file +var _0x4a3c=['sequelize','STRING','name','#0091EA'];(function(_0xc4001c,_0x1bf8f0){var _0x49f7bc=function(_0x1059b8){while(--_0x1059b8){_0xc4001c['push'](_0xc4001c['shift']());}};_0x49f7bc(++_0x1bf8f0);}(_0x4a3c,0x13c));var _0xc4a3=function(_0x2f0a08,_0x81ff8c){_0x2f0a08=_0x2f0a08-0x0;var _0x3597d7=_0x4a3c[_0x2f0a08];return _0x3597d7;};'use strict';var Sequelize=require(_0xc4a3('0x0'));module['exports']={'name':{'type':Sequelize[_0xc4a3('0x1')],'unique':_0xc4a3('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xc4a3('0x1')],'defaultValue':_0xc4a3('0x3')},'description':{'type':Sequelize[_0xc4a3('0x1')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index adcef20..ef10e70 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 _0xa272=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','Tags','UserProfileResource','error','send','index','map','Tag','fieldName','key','name','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where','merge','type','VIRTUAL','filter','options','includeAll','findAll','rows','params','keys','rawAttributes','length','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','find','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api'];(function(_0x318410,_0x451962){var _0x2898a3=function(_0x58e572){while(--_0x58e572){_0x318410['push'](_0x318410['shift']());}};_0x2898a3(++_0x451962);}(_0xa272,0x1d6));var _0x2a27=function(_0x379d8f,_0x3b6d64){_0x379d8f=_0x379d8f-0x0;var _0x30bc60=_0xa272[_0x379d8f];return _0x30bc60;};'use strict';var emlformat=require(_0x2a27('0x0'));var rimraf=require(_0x2a27('0x1'));var zipdir=require(_0x2a27('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2a27('0x3'));var moment=require(_0x2a27('0x4'));var BPromise=require(_0x2a27('0x5'));var Mustache=require(_0x2a27('0x6'));var util=require(_0x2a27('0x7'));var path=require(_0x2a27('0x8'));var sox=require('sox');var csv=require(_0x2a27('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2a27('0xa'));var _=require(_0x2a27('0xb'));var squel=require(_0x2a27('0xc'));var crypto=require(_0x2a27('0xd'));var jsforce=require(_0x2a27('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2a27('0xf'));var Redis=require(_0x2a27('0x10'));var authService=require(_0x2a27('0x11'));var qs=require(_0x2a27('0x12'));var as=require(_0x2a27('0x13'));var hardwareService=require(_0x2a27('0x14'));var logger=require('../../config/logger')(_0x2a27('0x15'));var utils=require('../../config/utils');var config=require(_0x2a27('0x16'));var licenseUtil=require(_0x2a27('0x17'));var db=require(_0x2a27('0x18'))['db'];function respondWithStatusCode(_0x529d24,_0x3ca1d0){_0x3ca1d0=_0x3ca1d0||0xcc;return function(_0x24f5d3){if(_0x24f5d3){return _0x529d24[_0x2a27('0x19')](_0x3ca1d0);}return _0x529d24['status'](_0x3ca1d0)[_0x2a27('0x1a')]();};}function respondWithResult(_0x2b64f5,_0x4bf6f7){_0x4bf6f7=_0x4bf6f7||0xc8;return function(_0x4d5041){if(_0x4d5041){return _0x2b64f5[_0x2a27('0x1b')](_0x4bf6f7)[_0x2a27('0x1c')](_0x4d5041);}};}function respondWithFilteredResult(_0x4937d4,_0x349088){return function(_0x2f0365){if(_0x2f0365){var _0x2e18f7=typeof _0x349088[_0x2a27('0x1d')]===_0x2a27('0x1e')&&typeof _0x349088[_0x2a27('0x1f')]===_0x2a27('0x1e');var _0x12d7a7=_0x2f0365[_0x2a27('0x20')];var _0x23b2e0=_0x2e18f7?0x0:_0x349088[_0x2a27('0x1d')];var _0xaf8fdc=_0x2e18f7?_0x2f0365[_0x2a27('0x20')]:_0x349088[_0x2a27('0x1d')]+_0x349088[_0x2a27('0x1f')];var _0x4724af;if(_0xaf8fdc>=_0x12d7a7){_0xaf8fdc=_0x12d7a7;_0x4724af=0xc8;}else{_0x4724af=0xce;}_0x4937d4[_0x2a27('0x1b')](_0x4724af);return _0x4937d4[_0x2a27('0x21')](_0x2a27('0x22'),_0x23b2e0+'-'+_0xaf8fdc+'/'+_0x12d7a7)[_0x2a27('0x1c')](_0x2f0365);}return null;};}function patchUpdates(_0xf4dbe4){return function(_0x1bac5e){try{jsonpatch[_0x2a27('0x23')](_0x1bac5e,_0xf4dbe4,!![]);}catch(_0x338c3c){return BPromise[_0x2a27('0x24')](_0x338c3c);}return _0x1bac5e[_0x2a27('0x25')]();};}function saveUpdates(_0x20183c,_0x4cd9e6){return function(_0x548024){if(_0x548024){return _0x548024[_0x2a27('0x26')](_0x20183c)[_0x2a27('0x27')](function(_0x258375){return _0x258375;});}return null;};}function removeEntity(_0x4d8ea0,_0x557940){return function(_0x3f7536){if(_0x3f7536){return _0x3f7536[_0x2a27('0x28')]()[_0x2a27('0x27')](function(){var _0x1a0154=_0x3f7536['get']({'plain':!![]});var _0x401737=_0x2a27('0x29');return db[_0x2a27('0x2a')][_0x2a27('0x28')]({'where':{'type':_0x401737,'resourceId':_0x1a0154['id']}})[_0x2a27('0x27')](function(){return _0x3f7536;});})[_0x2a27('0x27')](function(){_0x4d8ea0[_0x2a27('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4822d9,_0x5ea00d){return function(_0x3f9022){if(!_0x3f9022){_0x4822d9[_0x2a27('0x19')](0x194);}return _0x3f9022;};}function handleError(_0x41c551,_0x3b3979){_0x3b3979=_0x3b3979||0x1f4;return function(_0x216d3f){logger[_0x2a27('0x2b')](_0x216d3f['stack']);if(_0x216d3f['name']){delete _0x216d3f['name'];}_0x41c551[_0x2a27('0x1b')](_0x3b3979)[_0x2a27('0x2c')](_0x216d3f);};}exports[_0x2a27('0x2d')]=function(_0x3b2a39,_0x2022a1){var _0x28c8fe={},_0x3a91d6={},_0x4f1bc6={'count':0x0,'rows':[]};var _0x59f5be=_[_0x2a27('0x2e')](db[_0x2a27('0x2f')]['rawAttributes'],function(_0x390489){return{'name':_0x390489[_0x2a27('0x30')],'type':_0x390489['type'][_0x2a27('0x31')]};});_0x3a91d6['model']=_[_0x2a27('0x2e')](_0x59f5be,_0x2a27('0x32'));_0x3a91d6[_0x2a27('0x33')]=_['keys'](_0x3b2a39[_0x2a27('0x33')]);_0x3a91d6[_0x2a27('0x34')]=_[_0x2a27('0x35')](_0x3a91d6[_0x2a27('0x36')],_0x3a91d6[_0x2a27('0x33')]);_0x28c8fe[_0x2a27('0x37')]=_['intersection'](_0x3a91d6[_0x2a27('0x36')],qs[_0x2a27('0x38')](_0x3b2a39[_0x2a27('0x33')][_0x2a27('0x38')]));_0x28c8fe[_0x2a27('0x37')]=_0x28c8fe[_0x2a27('0x37')]['length']?_0x28c8fe[_0x2a27('0x37')]:_0x3a91d6['model'];if(!_0x3b2a39[_0x2a27('0x33')][_0x2a27('0x39')](_0x2a27('0x3a'))){_0x28c8fe[_0x2a27('0x1f')]=qs[_0x2a27('0x1f')](_0x3b2a39['query'][_0x2a27('0x1f')]);_0x28c8fe['offset']=qs[_0x2a27('0x1d')](_0x3b2a39['query']['offset']);}_0x28c8fe['order']=qs[_0x2a27('0x3b')](_0x3b2a39[_0x2a27('0x33')][_0x2a27('0x3b')]);_0x28c8fe[_0x2a27('0x3c')]=qs[_0x2a27('0x34')](_['pick'](_0x3b2a39[_0x2a27('0x33')],_0x3a91d6[_0x2a27('0x34')]),_0x59f5be);if(_0x3b2a39[_0x2a27('0x33')]['filter']){_0x28c8fe[_0x2a27('0x3c')]=_[_0x2a27('0x3d')](_0x28c8fe[_0x2a27('0x3c')],{'$or':_[_0x2a27('0x2e')](_0x59f5be,function(_0x5e740d){if(_0x5e740d[_0x2a27('0x3e')]!==_0x2a27('0x3f')){var _0x44b88b={};_0x44b88b[_0x5e740d['name']]={'$like':'%'+_0x3b2a39[_0x2a27('0x33')][_0x2a27('0x40')]+'%'};return _0x44b88b;}})});}_0x28c8fe=_[_0x2a27('0x3d')]({},_0x28c8fe,_0x3b2a39[_0x2a27('0x41')]);var _0x2936f7={'where':_0x28c8fe[_0x2a27('0x3c')]};return db[_0x2a27('0x2f')]['count'](_0x2936f7)[_0x2a27('0x27')](function(_0x45df07){_0x4f1bc6[_0x2a27('0x20')]=_0x45df07;if(_0x3b2a39[_0x2a27('0x33')][_0x2a27('0x42')]){_0x28c8fe['include']=[{'all':!![]}];}return db[_0x2a27('0x2f')][_0x2a27('0x43')](_0x28c8fe);})[_0x2a27('0x27')](function(_0x1ac15d){_0x4f1bc6[_0x2a27('0x44')]=_0x1ac15d;return _0x4f1bc6;})[_0x2a27('0x27')](respondWithFilteredResult(_0x2022a1,_0x28c8fe))['catch'](handleError(_0x2022a1,null));};exports['show']=function(_0x153ba6,_0x5bb791){var _0x28c450={'raw':!![],'where':{'id':_0x153ba6[_0x2a27('0x45')]['id']}},_0x23e9be={};_0x23e9be[_0x2a27('0x36')]=_[_0x2a27('0x46')](db[_0x2a27('0x2f')][_0x2a27('0x47')]);_0x23e9be['query']=_[_0x2a27('0x46')](_0x153ba6[_0x2a27('0x33')]);_0x23e9be[_0x2a27('0x34')]=_[_0x2a27('0x35')](_0x23e9be['model'],_0x23e9be[_0x2a27('0x33')]);_0x28c450[_0x2a27('0x37')]=_[_0x2a27('0x35')](_0x23e9be['model'],qs[_0x2a27('0x38')](_0x153ba6[_0x2a27('0x33')]['fields']));_0x28c450[_0x2a27('0x37')]=_0x28c450[_0x2a27('0x37')][_0x2a27('0x48')]?_0x28c450['attributes']:_0x23e9be[_0x2a27('0x36')];if(_0x153ba6[_0x2a27('0x33')][_0x2a27('0x42')]){_0x28c450['include']=[{'all':!![]}];}_0x28c450=_[_0x2a27('0x3d')]({},_0x28c450,_0x153ba6['options']);return db[_0x2a27('0x2f')]['find'](_0x28c450)[_0x2a27('0x27')](handleEntityNotFound(_0x5bb791,null))[_0x2a27('0x27')](respondWithResult(_0x5bb791,null))[_0x2a27('0x49')](handleError(_0x5bb791,null));};exports[_0x2a27('0x4a')]=function(_0x5957d4,_0x103bf4){return db[_0x2a27('0x2f')][_0x2a27('0x4a')](_0x5957d4[_0x2a27('0x4b')],{})[_0x2a27('0x27')](function(_0x3cffc7){var _0x5b9b37=_0x5957d4[_0x2a27('0x4c')][_0x2a27('0x4d')]({'plain':!![]});if(!_0x5b9b37)throw new Error(_0x2a27('0x4e'));if(_0x5b9b37['role']===_0x2a27('0x4c')){var _0x206d13=_0x3cffc7[_0x2a27('0x4d')]({'plain':!![]});var _0x45e589='Tags';return db['UserProfileSection']['find']({'where':{'name':_0x45e589,'userProfileId':_0x5b9b37[_0x2a27('0x4f')]},'raw':!![]})['then'](function(_0x2e4799){if(_0x2e4799&&_0x2e4799['autoAssociation']===0x0){return db[_0x2a27('0x2a')][_0x2a27('0x4a')]({'name':_0x206d13[_0x2a27('0x32')],'resourceId':_0x206d13['id'],'type':_0x2e4799[_0x2a27('0x32')],'sectionId':_0x2e4799['id']},{})[_0x2a27('0x27')](function(){return _0x3cffc7;});}else{return _0x3cffc7;}})[_0x2a27('0x49')](function(_0x4fd4b7){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4fd4b7);throw _0x4fd4b7;});}return _0x3cffc7;})[_0x2a27('0x27')](respondWithResult(_0x103bf4,0xc9))['catch'](handleError(_0x103bf4,null));};exports[_0x2a27('0x26')]=function(_0x3ac96c,_0x1e8323){if(_0x3ac96c[_0x2a27('0x4b')]['id']){delete _0x3ac96c['body']['id'];}return db[_0x2a27('0x2f')][_0x2a27('0x50')]({'where':{'id':_0x3ac96c[_0x2a27('0x45')]['id']}})['then'](handleEntityNotFound(_0x1e8323,null))[_0x2a27('0x27')](saveUpdates(_0x3ac96c['body'],null))[_0x2a27('0x27')](respondWithResult(_0x1e8323,null))[_0x2a27('0x49')](handleError(_0x1e8323,null));};exports[_0x2a27('0x28')]=function(_0x2a5f83,_0x2402a3){return db[_0x2a27('0x2f')][_0x2a27('0x50')]({'where':{'id':_0x2a5f83[_0x2a27('0x45')]['id']}})[_0x2a27('0x27')](handleEntityNotFound(_0x2402a3,null))[_0x2a27('0x27')](removeEntity(_0x2402a3,null))['catch'](handleError(_0x2402a3,null));};exports[_0x2a27('0x51')]=function(_0xdcfc81,_0x37500e){return db[_0x2a27('0x2f')][_0x2a27('0x51')]()[_0x2a27('0x27')](respondWithResult(_0x37500e,null))[_0x2a27('0x49')](handleError(_0x37500e,null));}; \ No newline at end of file +var _0x0218=['describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','get','end','error','stack','name','index','map','Tag','fieldName','type','key','query','filters','intersection','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','keys','rawAttributes','attributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Tags','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params'];(function(_0x303098,_0x443898){var _0x5b8a81=function(_0x29e6f0){while(--_0x29e6f0){_0x303098['push'](_0x303098['shift']());}};_0x5b8a81(++_0x443898);}(_0x0218,0x1aa));var _0x8021=function(_0x1f6035,_0x592ec0){_0x1f6035=_0x1f6035-0x0;var _0x3ac85d=_0x0218[_0x1f6035];return _0x3ac85d;};'use strict';var emlformat=require(_0x8021('0x0'));var rimraf=require(_0x8021('0x1'));var zipdir=require(_0x8021('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8021('0x3'));var moment=require(_0x8021('0x4'));var BPromise=require(_0x8021('0x5'));var Mustache=require(_0x8021('0x6'));var util=require(_0x8021('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x8021('0x8'));var ejs=require(_0x8021('0x9'));var fs=require('fs');var fs_extra=require(_0x8021('0xa'));var _=require(_0x8021('0xb'));var squel=require('squel');var crypto=require(_0x8021('0xc'));var jsforce=require(_0x8021('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x8021('0x8'));var querystring=require(_0x8021('0xe'));var Papa=require(_0x8021('0xf'));var Redis=require(_0x8021('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8021('0x11'));var logger=require(_0x8021('0x12'))(_0x8021('0x13'));var utils=require(_0x8021('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x8021('0x15'));var db=require(_0x8021('0x16'))['db'];function respondWithStatusCode(_0x2f46e2,_0x52d0c9){_0x52d0c9=_0x52d0c9||0xcc;return function(_0x5e42ab){if(_0x5e42ab){return _0x2f46e2[_0x8021('0x17')](_0x52d0c9);}return _0x2f46e2[_0x8021('0x18')](_0x52d0c9)['end']();};}function respondWithResult(_0x2f4187,_0x1b32fb){_0x1b32fb=_0x1b32fb||0xc8;return function(_0x728259){if(_0x728259){return _0x2f4187[_0x8021('0x18')](_0x1b32fb)[_0x8021('0x19')](_0x728259);}};}function respondWithFilteredResult(_0x2c5a30,_0x3930b0){return function(_0x4efbff){if(_0x4efbff){var _0x17d483=typeof _0x3930b0[_0x8021('0x1a')]===_0x8021('0x1b')&&typeof _0x3930b0[_0x8021('0x1c')]==='undefined';var _0x241e2a=_0x4efbff[_0x8021('0x1d')];var _0x483327=_0x17d483?0x0:_0x3930b0[_0x8021('0x1a')];var _0x3bf542=_0x17d483?_0x4efbff['count']:_0x3930b0[_0x8021('0x1a')]+_0x3930b0['limit'];var _0x33698b;if(_0x3bf542>=_0x241e2a){_0x3bf542=_0x241e2a;_0x33698b=0xc8;}else{_0x33698b=0xce;}_0x2c5a30[_0x8021('0x18')](_0x33698b);return _0x2c5a30[_0x8021('0x1e')](_0x8021('0x1f'),_0x483327+'-'+_0x3bf542+'/'+_0x241e2a)[_0x8021('0x19')](_0x4efbff);}return null;};}function patchUpdates(_0x3c18e0){return function(_0x41b493){try{jsonpatch[_0x8021('0x20')](_0x41b493,_0x3c18e0,!![]);}catch(_0x316975){return BPromise[_0x8021('0x21')](_0x316975);}return _0x41b493[_0x8021('0x22')]();};}function saveUpdates(_0x42e8b9,_0x32743f){return function(_0x5589a4){if(_0x5589a4){return _0x5589a4['update'](_0x42e8b9)[_0x8021('0x23')](function(_0x58734d){return _0x58734d;});}return null;};}function removeEntity(_0x34e725,_0x5e5118){return function(_0x5ec06b){if(_0x5ec06b){return _0x5ec06b[_0x8021('0x24')]()[_0x8021('0x23')](function(){var _0x16083d=_0x5ec06b[_0x8021('0x25')]({'plain':!![]});var _0x372730='Tags';return db['UserProfileResource'][_0x8021('0x24')]({'where':{'type':_0x372730,'resourceId':_0x16083d['id']}})[_0x8021('0x23')](function(){return _0x5ec06b;});})['then'](function(){_0x34e725['status'](0xcc)[_0x8021('0x26')]();});}};}function handleEntityNotFound(_0x8e423,_0xdaa748){return function(_0x26742a){if(!_0x26742a){_0x8e423[_0x8021('0x17')](0x194);}return _0x26742a;};}function handleError(_0x11213a,_0x2ee0f0){_0x2ee0f0=_0x2ee0f0||0x1f4;return function(_0x18f0f8){logger[_0x8021('0x27')](_0x18f0f8[_0x8021('0x28')]);if(_0x18f0f8[_0x8021('0x29')]){delete _0x18f0f8[_0x8021('0x29')];}_0x11213a[_0x8021('0x18')](_0x2ee0f0)['send'](_0x18f0f8);};}exports[_0x8021('0x2a')]=function(_0x4ac419,_0x5e0d57){var _0x3a7ab0={},_0x48596f={},_0x4f0b2b={'count':0x0,'rows':[]};var _0x112f25=_[_0x8021('0x2b')](db[_0x8021('0x2c')]['rawAttributes'],function(_0x358e31){return{'name':_0x358e31[_0x8021('0x2d')],'type':_0x358e31[_0x8021('0x2e')][_0x8021('0x2f')]};});_0x48596f['model']=_[_0x8021('0x2b')](_0x112f25,_0x8021('0x29'));_0x48596f[_0x8021('0x30')]=_['keys'](_0x4ac419[_0x8021('0x30')]);_0x48596f[_0x8021('0x31')]=_[_0x8021('0x32')](_0x48596f['model'],_0x48596f[_0x8021('0x30')]);_0x3a7ab0['attributes']=_['intersection'](_0x48596f[_0x8021('0x33')],qs[_0x8021('0x34')](_0x4ac419['query'][_0x8021('0x34')]));_0x3a7ab0['attributes']=_0x3a7ab0['attributes'][_0x8021('0x35')]?_0x3a7ab0['attributes']:_0x48596f['model'];if(!_0x4ac419[_0x8021('0x30')][_0x8021('0x36')](_0x8021('0x37'))){_0x3a7ab0['limit']=qs[_0x8021('0x1c')](_0x4ac419['query'][_0x8021('0x1c')]);_0x3a7ab0[_0x8021('0x1a')]=qs[_0x8021('0x1a')](_0x4ac419[_0x8021('0x30')][_0x8021('0x1a')]);}_0x3a7ab0[_0x8021('0x38')]=qs[_0x8021('0x39')](_0x4ac419[_0x8021('0x30')][_0x8021('0x39')]);_0x3a7ab0[_0x8021('0x3a')]=qs[_0x8021('0x31')](_['pick'](_0x4ac419[_0x8021('0x30')],_0x48596f[_0x8021('0x31')]),_0x112f25);if(_0x4ac419[_0x8021('0x30')][_0x8021('0x3b')]){_0x3a7ab0[_0x8021('0x3a')]=_['merge'](_0x3a7ab0[_0x8021('0x3a')],{'$or':_[_0x8021('0x2b')](_0x112f25,function(_0xcd366a){if(_0xcd366a['type']!==_0x8021('0x3c')){var _0x36e68d={};_0x36e68d[_0xcd366a[_0x8021('0x29')]]={'$like':'%'+_0x4ac419['query'][_0x8021('0x3b')]+'%'};return _0x36e68d;}})});}_0x3a7ab0=_[_0x8021('0x3d')]({},_0x3a7ab0,_0x4ac419[_0x8021('0x3e')]);var _0xc8b9c5={'where':_0x3a7ab0[_0x8021('0x3a')]};return db[_0x8021('0x2c')][_0x8021('0x1d')](_0xc8b9c5)[_0x8021('0x23')](function(_0x4306ce){_0x4f0b2b[_0x8021('0x1d')]=_0x4306ce;if(_0x4ac419[_0x8021('0x30')][_0x8021('0x3f')]){_0x3a7ab0[_0x8021('0x40')]=[{'all':!![]}];}return db[_0x8021('0x2c')][_0x8021('0x41')](_0x3a7ab0);})[_0x8021('0x23')](function(_0x5dcf39){_0x4f0b2b[_0x8021('0x42')]=_0x5dcf39;return _0x4f0b2b;})[_0x8021('0x23')](respondWithFilteredResult(_0x5e0d57,_0x3a7ab0))[_0x8021('0x43')](handleError(_0x5e0d57,null));};exports['show']=function(_0x541f49,_0x57f888){var _0x271b32={'raw':!![],'where':{'id':_0x541f49['params']['id']}},_0x4a5a8a={};_0x4a5a8a[_0x8021('0x33')]=_[_0x8021('0x44')](db['Tag'][_0x8021('0x45')]);_0x4a5a8a['query']=_[_0x8021('0x44')](_0x541f49[_0x8021('0x30')]);_0x4a5a8a['filters']=_['intersection'](_0x4a5a8a['model'],_0x4a5a8a['query']);_0x271b32[_0x8021('0x46')]=_[_0x8021('0x32')](_0x4a5a8a['model'],qs[_0x8021('0x34')](_0x541f49[_0x8021('0x30')][_0x8021('0x34')]));_0x271b32[_0x8021('0x46')]=_0x271b32[_0x8021('0x46')][_0x8021('0x35')]?_0x271b32['attributes']:_0x4a5a8a[_0x8021('0x33')];if(_0x541f49[_0x8021('0x30')]['includeAll']){_0x271b32[_0x8021('0x40')]=[{'all':!![]}];}_0x271b32=_[_0x8021('0x3d')]({},_0x271b32,_0x541f49[_0x8021('0x3e')]);return db[_0x8021('0x2c')][_0x8021('0x47')](_0x271b32)[_0x8021('0x23')](handleEntityNotFound(_0x57f888,null))[_0x8021('0x23')](respondWithResult(_0x57f888,null))[_0x8021('0x43')](handleError(_0x57f888,null));};exports['create']=function(_0x4a57d9,_0x3c10ed){return db[_0x8021('0x2c')][_0x8021('0x48')](_0x4a57d9[_0x8021('0x49')],{})[_0x8021('0x23')](function(_0x3cd4fa){var _0xd18e82=_0x4a57d9[_0x8021('0x4a')][_0x8021('0x25')]({'plain':!![]});if(!_0xd18e82)throw new Error(_0x8021('0x4b'));if(_0xd18e82[_0x8021('0x4c')]===_0x8021('0x4a')){var _0x568fc5=_0x3cd4fa[_0x8021('0x25')]({'plain':!![]});var _0x580299=_0x8021('0x4d');return db['UserProfileSection'][_0x8021('0x47')]({'where':{'name':_0x580299,'userProfileId':_0xd18e82[_0x8021('0x4e')]},'raw':!![]})[_0x8021('0x23')](function(_0x132e28){if(_0x132e28&&_0x132e28[_0x8021('0x4f')]===0x0){return db[_0x8021('0x50')][_0x8021('0x48')]({'name':_0x568fc5['name'],'resourceId':_0x568fc5['id'],'type':_0x132e28[_0x8021('0x29')],'sectionId':_0x132e28['id']},{})[_0x8021('0x23')](function(){return _0x3cd4fa;});}else{return _0x3cd4fa;}})[_0x8021('0x43')](function(_0x3f8f69){logger[_0x8021('0x27')](_0x8021('0x51'),_0x3f8f69);throw _0x3f8f69;});}return _0x3cd4fa;})[_0x8021('0x23')](respondWithResult(_0x3c10ed,0xc9))[_0x8021('0x43')](handleError(_0x3c10ed,null));};exports[_0x8021('0x52')]=function(_0x1a707b,_0x29e23f){if(_0x1a707b[_0x8021('0x49')]['id']){delete _0x1a707b['body']['id'];}return db[_0x8021('0x2c')][_0x8021('0x47')]({'where':{'id':_0x1a707b[_0x8021('0x53')]['id']}})[_0x8021('0x23')](handleEntityNotFound(_0x29e23f,null))['then'](saveUpdates(_0x1a707b['body'],null))[_0x8021('0x23')](respondWithResult(_0x29e23f,null))['catch'](handleError(_0x29e23f,null));};exports['destroy']=function(_0x36804b,_0xb649ea){return db[_0x8021('0x2c')]['find']({'where':{'id':_0x36804b[_0x8021('0x53')]['id']}})[_0x8021('0x23')](handleEntityNotFound(_0xb649ea,null))['then'](removeEntity(_0xb649ea,null))[_0x8021('0x43')](handleError(_0xb649ea,null));};exports[_0x8021('0x54')]=function(_0x52bcaf,_0x4c40eb){return db[_0x8021('0x2c')][_0x8021('0x54')]()[_0x8021('0x23')](respondWithResult(_0x4c40eb,null))[_0x8021('0x43')](handleError(_0x4c40eb,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 9600169..ea60ea2 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 _0xab44=['../../config/logger','api','moment','bluebird','request-promise','path','./tag.attributes','exports','define','Tag','lodash','util'];(function(_0x2358dc,_0xf1b827){var _0x929b09=function(_0x3e67b7){while(--_0x3e67b7){_0x2358dc['push'](_0x2358dc['shift']());}};_0x929b09(++_0xf1b827);}(_0xab44,0xe2));var _0x4ab4=function(_0x42301b,_0x177775){_0x42301b=_0x42301b-0x0;var _0x5b1576=_0xab44[_0x42301b];return _0x5b1576;};'use strict';var _=require(_0x4ab4('0x0'));var util=require(_0x4ab4('0x1'));var logger=require(_0x4ab4('0x2'))(_0x4ab4('0x3'));var moment=require(_0x4ab4('0x4'));var BPromise=require(_0x4ab4('0x5'));var rp=require(_0x4ab4('0x6'));var fs=require('fs');var path=require(_0x4ab4('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4ab4('0x8'));module[_0x4ab4('0x9')]=function(_0x2629b9,_0x498e85){return _0x2629b9[_0x4ab4('0xa')](_0x4ab4('0xb'),attributes,{'tableName':'tools_tags','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2993=['request-promise','path','exports','Tag','tools_tags','util','../../config/logger','api','moment','bluebird'];(function(_0x4a4563,_0x2771c3){var _0x201be1=function(_0x32505c){while(--_0x32505c){_0x4a4563['push'](_0x4a4563['shift']());}};_0x201be1(++_0x2771c3);}(_0x2993,0x113));var _0x3299=function(_0x123657,_0x464b83){_0x123657=_0x123657-0x0;var _0x49b15b=_0x2993[_0x123657];return _0x49b15b;};'use strict';var _=require('lodash');var util=require(_0x3299('0x0'));var logger=require(_0x3299('0x1'))(_0x3299('0x2'));var moment=require(_0x3299('0x3'));var BPromise=require(_0x3299('0x4'));var rp=require(_0x3299('0x5'));var fs=require('fs');var path=require(_0x3299('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./tag.attributes');module[_0x3299('0x7')]=function(_0x42bf70,_0xce1b55){return _0x42bf70['define'](_0x3299('0x8'),attributes,{'tableName':_0x3299('0x9'),'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 1306656..212ef62 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 _0x26c2=['message','info','result','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','Tag,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x459847,_0x3d79f4){var _0x3720fe=function(_0x213c83){while(--_0x213c83){_0x459847['push'](_0x459847['shift']());}};_0x3720fe(++_0x3d79f4);}(_0x26c2,0x130));var _0x226c=function(_0x4fb02e,_0x4d7c16){_0x4fb02e=_0x4fb02e-0x0;var _0x386ad8=_0x26c2[_0x4fb02e];return _0x386ad8;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x226c('0x0'));var rs=require(_0x226c('0x1'));var fs=require('fs');var Redis=require(_0x226c('0x2'));var db=require(_0x226c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x226c('0x4'))(_0x226c('0x5'));var config=require('../../config/environment');var jayson=require(_0x226c('0x6'));var client=jayson[_0x226c('0x7')][_0x226c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3c4e5d,_0x4306c9,_0x59804e){return new BPromise(function(_0x34cbc3,_0x461773){return client[_0x226c('0x9')](_0x3c4e5d,_0x59804e)[_0x226c('0xa')](function(_0x127f10){logger['info'](_0x226c('0xb'),_0x4306c9,_0x226c('0xc'));logger['debug']('Tag,\x20%s,\x20%s,\x20%s',_0x4306c9,_0x226c('0xc'),JSON[_0x226c('0xd')](_0x127f10));if(_0x127f10[_0x226c('0xe')]){if(_0x127f10[_0x226c('0xe')][_0x226c('0xf')]===0x1f4){logger[_0x226c('0xe')](_0x226c('0xb'),_0x4306c9,_0x127f10['error']['message']);return _0x461773(_0x127f10[_0x226c('0xe')][_0x226c('0x10')]);}logger[_0x226c('0xe')](_0x226c('0xb'),_0x4306c9,_0x127f10['error']['message']);return _0x34cbc3(_0x127f10[_0x226c('0xe')][_0x226c('0x10')]);}else{logger[_0x226c('0x11')]('Tag,\x20%s,\x20%s',_0x4306c9,'request\x20sent');_0x34cbc3(_0x127f10[_0x226c('0x12')][_0x226c('0x10')]);}})[_0x226c('0x13')](function(_0x45a804){logger[_0x226c('0xe')]('Tag,\x20%s,\x20%s',_0x4306c9,_0x45a804);_0x461773(_0x45a804);});});} \ No newline at end of file +var _0xc3b5=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','Tag,\x20%s,\x20%s','message','result','catch','moment','bluebird','randomstring','ioredis'];(function(_0x238e59,_0x3d5bd8){var _0x2cdb69=function(_0x45125b){while(--_0x45125b){_0x238e59['push'](_0x238e59['shift']());}};_0x2cdb69(++_0x3d5bd8);}(_0xc3b5,0x6f));var _0x5c3b=function(_0x57173a,_0x4fb2ce){_0x57173a=_0x57173a-0x0;var _0x5f52aa=_0xc3b5[_0x57173a];return _0x5f52aa;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5c3b('0x0'));var BPromise=require(_0x5c3b('0x1'));var rs=require(_0x5c3b('0x2'));var fs=require('fs');var Redis=require(_0x5c3b('0x3'));var db=require(_0x5c3b('0x4'))['db'];var utils=require(_0x5c3b('0x5'));var logger=require(_0x5c3b('0x6'))(_0x5c3b('0x7'));var config=require('../../config/environment');var jayson=require(_0x5c3b('0x8'));var client=jayson[_0x5c3b('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x568a28,_0x30a08f,_0x420839){return new BPromise(function(_0x3892ad,_0x5be9ee){return client[_0x5c3b('0xa')](_0x568a28,_0x420839)[_0x5c3b('0xb')](function(_0x159db5){logger[_0x5c3b('0xc')]('Tag,\x20%s,\x20%s',_0x30a08f,_0x5c3b('0xd'));logger[_0x5c3b('0xe')](_0x5c3b('0xf'),_0x30a08f,_0x5c3b('0xd'),JSON[_0x5c3b('0x10')](_0x159db5));if(_0x159db5['error']){if(_0x159db5[_0x5c3b('0x11')][_0x5c3b('0x12')]===0x1f4){logger['error'](_0x5c3b('0x13'),_0x30a08f,_0x159db5[_0x5c3b('0x11')]['message']);return _0x5be9ee(_0x159db5[_0x5c3b('0x11')][_0x5c3b('0x14')]);}logger[_0x5c3b('0x11')](_0x5c3b('0x13'),_0x30a08f,_0x159db5[_0x5c3b('0x11')][_0x5c3b('0x14')]);return _0x3892ad(_0x159db5[_0x5c3b('0x11')]['message']);}else{logger[_0x5c3b('0xc')]('Tag,\x20%s,\x20%s',_0x30a08f,'request\x20sent');_0x3892ad(_0x159db5[_0x5c3b('0x15')][_0x5c3b('0x14')]);}})[_0x5c3b('0x16')](function(_0x589797){logger[_0x5c3b('0x11')](_0x5c3b('0x13'),_0x30a08f,_0x589797);_0x5be9ee(_0x589797);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index b31b88c..fc56631 100644 --- a/server/api/team/index.js +++ b/server/api/team/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','getQueues','/:id/users','isAuthenticated','getAgents','post','addQueues','addAgents','update','delete','removeAgents','multer','util','path'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xa9e0[_0x31e29a];return _0x32d892;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/queues',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/queues',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller['destroy']);router[_0x0a9e('0x13')]('/:id/queues',auth[_0x0a9e('0xd')](),controller['removeQueues']);router[_0x0a9e('0x13')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x14')]);module['exports']=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','getQueues','/:id/users','isAuthenticated','getAgents','post','addQueues','addAgents','update','delete','removeAgents','multer','util','path'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xa9e0[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/queues',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/queues',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller['destroy']);router[_0x0a9e('0x13')]('/:id/queues',auth[_0x0a9e('0xd')](),controller['removeQueues']);router[_0x0a9e('0x13')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/team/team.attributes.js b/server/api/team/team.attributes.js index 6f7589c..2e61e6c 100644 --- a/server/api/team/team.attributes.js +++ b/server/api/team/team.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['STRING','name'];(function(_0x1579d4,_0xf6ff18){var _0x3e64f5=function(_0xd941ee){while(--_0xd941ee){_0x1579d4['push'](_0x1579d4['shift']());}};_0x3e64f5(++_0xf6ff18);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3071('0x0')],'allowNull':![],'unique':_0x3071('0x1')},'description':{'type':Sequelize[_0x3071('0x0')]}}; \ No newline at end of file +var _0x0713=['STRING','name'];(function(_0x5a7caf,_0x2dc952){var _0x5bcd83=function(_0x410e06){while(--_0x410e06){_0x5a7caf['push'](_0x5a7caf['shift']());}};_0x5bcd83(++_0x2dc952);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3071('0x0')],'allowNull':![],'unique':_0x3071('0x1')},'description':{'type':Sequelize[_0x3071('0x0')]}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index b35116a..8045eac 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 _0xea81=['UserVoicePrefix','VoicePrefixId','UserProfileResource','Teams','findOne','channel','isValidChannel','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queue','Queues','addQueues','add','ids','removeQueues','remove','addAgents','isArray','Chat','Mail','Fax','Whatsapp','Voice','through','penalty','QueueId','User','findOrCreate','emit','Queue:save','online','voicePause','UserVoiceQueueRt','upsert','isNil','SIP/%s','all','TeamVoicePrefix','removeAgents','Openchannel','Queue:remove','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','defaults','redis','localhost','socket.io-emitter','register','end','json','offset','limit','undefined','count','status','set','Content-Range','apply','reject','save','update','sendStatus','error','stack','name','send','map','Team','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','findAll','rows','then','catch','show','params','keys','includeAll','include','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','transaction','sequelize','QueryTypes','SELECT','Sequelize','VoiceQueueId','UserVoiceQueue','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','UserFaxQueue','OpenchannelQueueId','UserOpenchannelQueue','WhatsappQueueId','UserWhatsappQueue'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xea81,0x15c));var _0x1ea8=function(_0x4e2482,_0x306774){_0x4e2482=_0x4e2482-0x0;var _0x4e85bf=_0xea81[_0x4e2482];return _0x4e85bf;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1ea8('0x0'));var zipdir=require(_0x1ea8('0x1'));var jsonpatch=require(_0x1ea8('0x2'));var rp=require(_0x1ea8('0x3'));var moment=require(_0x1ea8('0x4'));var BPromise=require(_0x1ea8('0x5'));var Mustache=require(_0x1ea8('0x6'));var util=require(_0x1ea8('0x7'));var path=require(_0x1ea8('0x8'));var sox=require('sox');var csv=require(_0x1ea8('0x9'));var ejs=require(_0x1ea8('0xa'));var fs=require('fs');var fs_extra=require(_0x1ea8('0xb'));var _=require('lodash');var squel=require(_0x1ea8('0xc'));var crypto=require(_0x1ea8('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x1ea8('0xe'));var toCsv=require('to-csv');var querystring=require(_0x1ea8('0xf'));var Papa=require('papaparse');var Redis=require(_0x1ea8('0x10'));var authService=require(_0x1ea8('0x11'));var qs=require(_0x1ea8('0x12'));var as=require(_0x1ea8('0x13'));var hardwareService=require(_0x1ea8('0x14'));var logger=require('../../config/logger')(_0x1ea8('0x15'));var utils=require(_0x1ea8('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x1ea8('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x1ea8('0x18')](config[_0x1ea8('0x19')],{'host':_0x1ea8('0x1a'),'port':0x18eb});var socket=require(_0x1ea8('0x1b'))(new Redis(config[_0x1ea8('0x19')]));require('./team.socket')[_0x1ea8('0x1c')](socket);function respondWithStatusCode(_0x3e6799,_0x3c8433){_0x3c8433=_0x3c8433||0xcc;return function(_0x3850fc){if(_0x3850fc){return _0x3e6799['sendStatus'](_0x3c8433);}return _0x3e6799['status'](_0x3c8433)[_0x1ea8('0x1d')]();};}function respondWithResult(_0xd24493,_0x2bdbd1){_0x2bdbd1=_0x2bdbd1||0xc8;return function(_0x9b7473){if(_0x9b7473){return _0xd24493['status'](_0x2bdbd1)[_0x1ea8('0x1e')](_0x9b7473);}};}function respondWithFilteredResult(_0x3fe491,_0x3006f3){return function(_0x151d04){if(_0x151d04){var _0x39db01=typeof _0x3006f3[_0x1ea8('0x1f')]==='undefined'&&typeof _0x3006f3[_0x1ea8('0x20')]===_0x1ea8('0x21');var _0x2206f9=_0x151d04[_0x1ea8('0x22')];var _0xa4390f=_0x39db01?0x0:_0x3006f3[_0x1ea8('0x1f')];var _0x398681=_0x39db01?_0x151d04[_0x1ea8('0x22')]:_0x3006f3[_0x1ea8('0x1f')]+_0x3006f3[_0x1ea8('0x20')];var _0x49f674;if(_0x398681>=_0x2206f9){_0x398681=_0x2206f9;_0x49f674=0xc8;}else{_0x49f674=0xce;}_0x3fe491[_0x1ea8('0x23')](_0x49f674);return _0x3fe491[_0x1ea8('0x24')](_0x1ea8('0x25'),_0xa4390f+'-'+_0x398681+'/'+_0x2206f9)[_0x1ea8('0x1e')](_0x151d04);}return null;};}function patchUpdates(_0x1251b0){return function(_0x4c7036){try{jsonpatch[_0x1ea8('0x26')](_0x4c7036,_0x1251b0,!![]);}catch(_0x1ffa71){return BPromise[_0x1ea8('0x27')](_0x1ffa71);}return _0x4c7036[_0x1ea8('0x28')]();};}function saveUpdates(_0x3fa3d7,_0x19f4d4){return function(_0x5d9033){if(_0x5d9033){return _0x5d9033[_0x1ea8('0x29')](_0x3fa3d7)['then'](function(_0x113515){return _0x113515;});}return null;};}function handleEntityNotFound(_0x1e5af2,_0x385b6c){return function(_0x141a46){if(!_0x141a46){_0x1e5af2[_0x1ea8('0x2a')](0x194);}return _0x141a46;};}function handleError(_0x1f8e31,_0x510f44){_0x510f44=_0x510f44||0x1f4;return function(_0x4adad6){logger[_0x1ea8('0x2b')](_0x4adad6[_0x1ea8('0x2c')]);if(_0x4adad6[_0x1ea8('0x2d')]){delete _0x4adad6[_0x1ea8('0x2d')];}_0x1f8e31[_0x1ea8('0x23')](_0x510f44)[_0x1ea8('0x2e')](_0x4adad6);};}exports['index']=function(_0x2f0c92,_0x58369c){var _0x129e1c={},_0x1b97c1={},_0x396fb4={'count':0x0,'rows':[]};var _0x4b4829=_[_0x1ea8('0x2f')](db[_0x1ea8('0x30')][_0x1ea8('0x31')],function(_0x13e8b2){return{'name':_0x13e8b2[_0x1ea8('0x32')],'type':_0x13e8b2['type'][_0x1ea8('0x33')]};});_0x1b97c1[_0x1ea8('0x34')]=_['map'](_0x4b4829,_0x1ea8('0x2d'));_0x1b97c1['query']=_['keys'](_0x2f0c92[_0x1ea8('0x35')]);_0x1b97c1[_0x1ea8('0x36')]=_[_0x1ea8('0x37')](_0x1b97c1[_0x1ea8('0x34')],_0x1b97c1[_0x1ea8('0x35')]);_0x129e1c[_0x1ea8('0x38')]=_[_0x1ea8('0x37')](_0x1b97c1[_0x1ea8('0x34')],qs[_0x1ea8('0x39')](_0x2f0c92[_0x1ea8('0x35')][_0x1ea8('0x39')]));_0x129e1c[_0x1ea8('0x38')]=_0x129e1c[_0x1ea8('0x38')][_0x1ea8('0x3a')]?_0x129e1c['attributes']:_0x1b97c1[_0x1ea8('0x34')];if(!_0x2f0c92[_0x1ea8('0x35')]['hasOwnProperty'](_0x1ea8('0x3b'))){_0x129e1c[_0x1ea8('0x20')]=qs[_0x1ea8('0x20')](_0x2f0c92[_0x1ea8('0x35')][_0x1ea8('0x20')]);_0x129e1c[_0x1ea8('0x1f')]=qs['offset'](_0x2f0c92['query'][_0x1ea8('0x1f')]);}_0x129e1c[_0x1ea8('0x3c')]=qs[_0x1ea8('0x3d')](_0x2f0c92['query'][_0x1ea8('0x3d')]);_0x129e1c[_0x1ea8('0x3e')]=qs[_0x1ea8('0x36')](_[_0x1ea8('0x3f')](_0x2f0c92[_0x1ea8('0x35')],_0x1b97c1[_0x1ea8('0x36')]),_0x4b4829);if(_0x2f0c92['query'][_0x1ea8('0x40')]){_0x129e1c[_0x1ea8('0x3e')]=_[_0x1ea8('0x41')](_0x129e1c[_0x1ea8('0x3e')],{'$or':_[_0x1ea8('0x2f')](_0x4b4829,function(_0x1169cc){if(_0x1169cc['type']!==_0x1ea8('0x42')){var _0x4ecbbc={};_0x4ecbbc[_0x1169cc[_0x1ea8('0x2d')]]={'$like':'%'+_0x2f0c92['query'][_0x1ea8('0x40')]+'%'};return _0x4ecbbc;}})});}_0x129e1c=_[_0x1ea8('0x41')]({},_0x129e1c,_0x2f0c92['options']);var _0x113900={'where':_0x129e1c[_0x1ea8('0x3e')]};return db['Team'][_0x1ea8('0x22')](_0x113900)['then'](function(_0x16fb7a){_0x396fb4[_0x1ea8('0x22')]=_0x16fb7a;if(_0x2f0c92[_0x1ea8('0x35')]['includeAll']){_0x129e1c['include']=[{'all':!![]}];}return db[_0x1ea8('0x30')][_0x1ea8('0x43')](_0x129e1c);})['then'](function(_0x1b5916){_0x396fb4[_0x1ea8('0x44')]=_0x1b5916;return _0x396fb4;})[_0x1ea8('0x45')](respondWithFilteredResult(_0x58369c,_0x129e1c))[_0x1ea8('0x46')](handleError(_0x58369c,null));};exports[_0x1ea8('0x47')]=function(_0x57aca0,_0x28f61b){var _0x3bd2a7={'raw':![],'where':{'id':_0x57aca0[_0x1ea8('0x48')]['id']}},_0x3c2b11={};_0x3c2b11[_0x1ea8('0x34')]=_[_0x1ea8('0x49')](db[_0x1ea8('0x30')][_0x1ea8('0x31')]);_0x3c2b11[_0x1ea8('0x35')]=_[_0x1ea8('0x49')](_0x57aca0[_0x1ea8('0x35')]);_0x3c2b11[_0x1ea8('0x36')]=_['intersection'](_0x3c2b11[_0x1ea8('0x34')],_0x3c2b11[_0x1ea8('0x35')]);_0x3bd2a7[_0x1ea8('0x38')]=_[_0x1ea8('0x37')](_0x3c2b11[_0x1ea8('0x34')],qs[_0x1ea8('0x39')](_0x57aca0[_0x1ea8('0x35')][_0x1ea8('0x39')]));_0x3bd2a7[_0x1ea8('0x38')]=_0x3bd2a7[_0x1ea8('0x38')]['length']?_0x3bd2a7[_0x1ea8('0x38')]:_0x3c2b11['model'];if(_0x57aca0[_0x1ea8('0x35')][_0x1ea8('0x4a')]){_0x3bd2a7[_0x1ea8('0x4b')]=[{'all':!![]}];}_0x3bd2a7=_[_0x1ea8('0x41')]({},_0x3bd2a7,_0x57aca0[_0x1ea8('0x4c')]);return db['Team'][_0x1ea8('0x4d')](_0x3bd2a7)[_0x1ea8('0x45')](handleEntityNotFound(_0x28f61b,null))[_0x1ea8('0x45')](respondWithResult(_0x28f61b,null))[_0x1ea8('0x46')](handleError(_0x28f61b,null));};exports[_0x1ea8('0x4e')]=function(_0x3c9e38,_0x5d25c8){return db[_0x1ea8('0x30')][_0x1ea8('0x4e')](_0x3c9e38[_0x1ea8('0x4f')],{})[_0x1ea8('0x45')](function(_0x3c9d59){var _0x38b7de=_0x3c9e38[_0x1ea8('0x50')][_0x1ea8('0x51')]({'plain':!![]});if(!_0x38b7de)throw new Error(_0x1ea8('0x52'));if(_0x38b7de[_0x1ea8('0x53')]==='user'){var _0x2c5ca2=_0x3c9d59[_0x1ea8('0x51')]({'plain':!![]});var _0x1d9052='Teams';return db[_0x1ea8('0x54')][_0x1ea8('0x4d')]({'where':{'name':_0x1d9052,'userProfileId':_0x38b7de[_0x1ea8('0x55')]},'raw':!![]})[_0x1ea8('0x45')](function(_0x2a6ff3){if(_0x2a6ff3&&_0x2a6ff3['autoAssociation']===0x0){return db['UserProfileResource'][_0x1ea8('0x4e')]({'name':_0x2c5ca2['name'],'resourceId':_0x2c5ca2['id'],'type':_0x2a6ff3['name'],'sectionId':_0x2a6ff3['id']},{})[_0x1ea8('0x45')](function(){return _0x3c9d59;});}else{return _0x3c9d59;}})[_0x1ea8('0x46')](function(_0x47e3f3){logger['error'](_0x1ea8('0x56'),_0x47e3f3);throw _0x47e3f3;});}return _0x3c9d59;})[_0x1ea8('0x45')](respondWithResult(_0x5d25c8,0xc9))[_0x1ea8('0x46')](handleError(_0x5d25c8,null));};exports[_0x1ea8('0x29')]=function(_0x1f9aa7,_0x1bd209){if(_0x1f9aa7[_0x1ea8('0x4f')]['id']){delete _0x1f9aa7[_0x1ea8('0x4f')]['id'];}return db[_0x1ea8('0x30')]['find']({'where':{'id':_0x1f9aa7[_0x1ea8('0x48')]['id']}})[_0x1ea8('0x45')](handleEntityNotFound(_0x1bd209,null))['then'](saveUpdates(_0x1f9aa7['body'],null))['then'](respondWithResult(_0x1bd209,null))[_0x1ea8('0x46')](handleError(_0x1bd209,null));};exports[_0x1ea8('0x57')]=function(_0x371fe8,_0x357b52){var _0x3a7de8=_0x371fe8['params']['id'];var _0x1192f5=[];return db['sequelize'][_0x1ea8('0x58')](function(_0x3fefa3){var _0x5e25a6='SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20'+_0x3a7de8;return db[_0x1ea8('0x59')]['query'](_0x5e25a6,{'type':db['Sequelize'][_0x1ea8('0x5a')][_0x1ea8('0x5b')],'raw':!![],'transaction':_0x3fefa3})[_0x1ea8('0x45')](function(_0x395822){_0x1192f5=_['map'](_0x395822,function(_0x24d7ef){return Number(_0x24d7ef['UserId']);});})[_0x1ea8('0x45')](function(){var _0x39fbea='SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20'+_0x3a7de8;return db['sequelize']['query'](_0x39fbea,{'type':db[_0x1ea8('0x5c')][_0x1ea8('0x5a')][_0x1ea8('0x5b')],'raw':!![],'transaction':_0x3fefa3});})[_0x1ea8('0x45')](function(_0x1c6943){var _0x4d2f42=_[_0x1ea8('0x2f')](_0x1c6943,function(_0x485902){return Number(_0x485902[_0x1ea8('0x5d')]);});return db[_0x1ea8('0x5e')][_0x1ea8('0x57')]({'where':{'UserId':{'$in':_0x1192f5},'VoiceQueueId':{'$in':_0x4d2f42}},'transaction':_0x3fefa3});})[_0x1ea8('0x45')](function(){var _0x51e802=_0x1ea8('0x5f')+_0x3a7de8;return db['sequelize'][_0x1ea8('0x35')](_0x51e802,{'type':db[_0x1ea8('0x5c')][_0x1ea8('0x5a')][_0x1ea8('0x5b')],'raw':!![],'transaction':_0x3fefa3});})[_0x1ea8('0x45')](function(_0x557f88){var _0x15c961=_[_0x1ea8('0x2f')](_0x557f88,function(_0x594230){return Number(_0x594230['MailQueueId']);});return db[_0x1ea8('0x60')][_0x1ea8('0x57')]({'where':{'UserId':{'$in':_0x1192f5},'MailQueueId':{'$in':_0x15c961}},'transaction':_0x3fefa3});})[_0x1ea8('0x45')](function(){var _0x72e624=_0x1ea8('0x61')+_0x3a7de8;return db[_0x1ea8('0x59')][_0x1ea8('0x35')](_0x72e624,{'type':db['Sequelize'][_0x1ea8('0x5a')]['SELECT'],'raw':!![],'transaction':_0x3fefa3});})[_0x1ea8('0x45')](function(_0x43063a){var _0x44f3ae=_[_0x1ea8('0x2f')](_0x43063a,function(_0x56f770){return Number(_0x56f770['SmsQueueId']);});return db[_0x1ea8('0x62')][_0x1ea8('0x57')]({'where':{'UserId':{'$in':_0x1192f5},'SmsQueueId':{'$in':_0x44f3ae}},'transaction':_0x3fefa3});})[_0x1ea8('0x45')](function(){var _0x456009=_0x1ea8('0x63')+_0x3a7de8;return db['sequelize'][_0x1ea8('0x35')](_0x456009,{'type':db[_0x1ea8('0x5c')][_0x1ea8('0x5a')][_0x1ea8('0x5b')],'raw':!![],'transaction':_0x3fefa3});})[_0x1ea8('0x45')](function(_0xeb6ed1){var _0xeba6f5=_['map'](_0xeb6ed1,function(_0x69888){return Number(_0x69888['ChatQueueId']);});return db[_0x1ea8('0x64')]['destroy']({'where':{'UserId':{'$in':_0x1192f5},'ChatQueueId':{'$in':_0xeba6f5}},'transaction':_0x3fefa3});})[_0x1ea8('0x45')](function(){var _0x475007=_0x1ea8('0x65')+_0x3a7de8;return db[_0x1ea8('0x59')][_0x1ea8('0x35')](_0x475007,{'type':db['Sequelize'][_0x1ea8('0x5a')]['SELECT'],'raw':!![],'transaction':_0x3fefa3});})[_0x1ea8('0x45')](function(_0x515103){var _0x4d3f77=_[_0x1ea8('0x2f')](_0x515103,function(_0x5408bb){return Number(_0x5408bb[_0x1ea8('0x66')]);});return db[_0x1ea8('0x67')]['destroy']({'where':{'UserId':{'$in':_0x1192f5},'FaxQueueId':{'$in':_0x4d3f77}},'transaction':_0x3fefa3});})[_0x1ea8('0x45')](function(){var _0x2a4c94='SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20'+_0x3a7de8;return db[_0x1ea8('0x59')][_0x1ea8('0x35')](_0x2a4c94,{'type':db[_0x1ea8('0x5c')][_0x1ea8('0x5a')][_0x1ea8('0x5b')],'raw':!![],'transaction':_0x3fefa3});})[_0x1ea8('0x45')](function(_0x3e6cd9){var _0x1515be=_[_0x1ea8('0x2f')](_0x3e6cd9,function(_0x10b264){return Number(_0x10b264[_0x1ea8('0x68')]);});return db[_0x1ea8('0x69')][_0x1ea8('0x57')]({'where':{'UserId':{'$in':_0x1192f5},'OpenchannelQueueId':{'$in':_0x1515be}},'transaction':_0x3fefa3});})[_0x1ea8('0x45')](function(){var _0x189412='SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20'+_0x3a7de8;return db[_0x1ea8('0x59')][_0x1ea8('0x35')](_0x189412,{'type':db[_0x1ea8('0x5c')][_0x1ea8('0x5a')][_0x1ea8('0x5b')],'raw':!![],'transaction':_0x3fefa3});})[_0x1ea8('0x45')](function(_0x4d0dfe){var _0x51ec77=_[_0x1ea8('0x2f')](_0x4d0dfe,function(_0x19010a){return Number(_0x19010a[_0x1ea8('0x6a')]);});return db[_0x1ea8('0x6b')][_0x1ea8('0x57')]({'where':{'UserId':{'$in':_0x1192f5},'WhatsappQueueId':{'$in':_0x51ec77}},'transaction':_0x3fefa3});})[_0x1ea8('0x45')](function(){return db['TeamVoicePrefix']['find']({'where':{'TeamId':_0x3a7de8}});})[_0x1ea8('0x45')](function(_0x31f310){if(_0x31f310===null){return;}return db[_0x1ea8('0x6c')]['destroy']({'where':{'UserId':{'$in':_0x1192f5},'VoicePrefixId':_0x31f310[_0x1ea8('0x6d')]},'transaction':_0x3fefa3});})['then'](function(){return db[_0x1ea8('0x30')][_0x1ea8('0x57')]({'where':{'id':_0x3a7de8},'cascade':!![],'transaction':_0x3fefa3});})['then'](function(_0xd8d788){if(_0xd8d788===0x0){_0x357b52[_0x1ea8('0x2a')](0x194);}else{return db[_0x1ea8('0x6e')][_0x1ea8('0x57')]({'where':{'type':_0x1ea8('0x6f'),'resourceId':_0x3a7de8},'cascade':!![],'transaction':_0x3fefa3})[_0x1ea8('0x45')](function(){_0x357b52[_0x1ea8('0x23')](0xcc)[_0x1ea8('0x1d')]();});}})[_0x1ea8('0x46')](function(_0x317d07){_0x357b52['status'](0x1f4)[_0x1ea8('0x2e')](_0x317d07);});});};exports['getQueues']=function(_0x2abf9d,_0x39a165,_0x2de601){return db[_0x1ea8('0x30')][_0x1ea8('0x70')]({'where':{'id':_0x2abf9d[_0x1ea8('0x48')]['id']}})[_0x1ea8('0x45')](handleEntityNotFound(_0x39a165,null))[_0x1ea8('0x45')](function(_0x864819){if(!_0x2abf9d['query'][_0x1ea8('0x71')]||!utils[_0x1ea8('0x72')](_0x2abf9d['query'][_0x1ea8('0x71')])){throw new db[(_0x1ea8('0x5c'))][(_0x1ea8('0x73'))](_0x1ea8('0x74'));}var _0xc9e586={};var _0x936272={};_0x936272[_0x1ea8('0x34')]=_[_0x1ea8('0x49')](db[_[_0x1ea8('0x75')](_0x2abf9d[_0x1ea8('0x35')]['channel'][_0x1ea8('0x76')]())+_0x1ea8('0x77')][_0x1ea8('0x31')]);_0x936272[_0x1ea8('0x35')]=_[_0x1ea8('0x49')](_0x2abf9d[_0x1ea8('0x35')]);_0x936272[_0x1ea8('0x36')]=_[_0x1ea8('0x37')](_0x936272[_0x1ea8('0x34')],_0x936272[_0x1ea8('0x35')]);_0xc9e586['attributes']=_[_0x1ea8('0x37')](_0x936272[_0x1ea8('0x34')],qs['fields'](_0x2abf9d[_0x1ea8('0x35')][_0x1ea8('0x39')]));_0xc9e586[_0x1ea8('0x38')]=_0xc9e586[_0x1ea8('0x38')][_0x1ea8('0x3a')]?_0xc9e586['attributes']:_0x936272[_0x1ea8('0x34')];_0xc9e586['limit']=qs[_0x1ea8('0x20')](_0x2abf9d[_0x1ea8('0x35')][_0x1ea8('0x20')]);_0xc9e586['offset']=qs['offset'](_0x2abf9d[_0x1ea8('0x35')][_0x1ea8('0x1f')]);_0xc9e586[_0x1ea8('0x3c')]=qs['sort'](_0x2abf9d['query'][_0x1ea8('0x3d')]);_0xc9e586[_0x1ea8('0x3e')]=qs[_0x1ea8('0x36')](_[_0x1ea8('0x3f')](_0x2abf9d['query'],_0x936272[_0x1ea8('0x36')]));_0xc9e586=_['merge']({},_0xc9e586,_0x2abf9d[_0x1ea8('0x4c')]);return _0x864819[_0x1ea8('0x51')+_[_0x1ea8('0x75')](_0x2abf9d['query'][_0x1ea8('0x71')][_0x1ea8('0x76')]())+_0x1ea8('0x78')](_0xc9e586);})[_0x1ea8('0x45')](respondWithResult(_0x39a165,null))['catch'](handleError(_0x39a165,null));};exports[_0x1ea8('0x79')]=function(_0x2a0a1b,_0x20fc15,_0x5a9d75){return db[_0x1ea8('0x30')][_0x1ea8('0x70')]({'where':{'id':_0x2a0a1b[_0x1ea8('0x48')]['id']}})[_0x1ea8('0x45')](function(_0x16f7e4){if(_0x16f7e4){if(!_0x2a0a1b[_0x1ea8('0x4f')]['channel']||!utils[_0x1ea8('0x72')](_0x2a0a1b['body'][_0x1ea8('0x71')])){throw new db[(_0x1ea8('0x5c'))][(_0x1ea8('0x73'))]('Unknown\x20channel');}return _0x16f7e4[_0x1ea8('0x7a')+_[_0x1ea8('0x75')](_0x2a0a1b[_0x1ea8('0x4f')][_0x1ea8('0x71')][_0x1ea8('0x76')]())+_0x1ea8('0x78')](_0x2a0a1b[_0x1ea8('0x4f')][_0x1ea8('0x7b')]);}return null;})[_0x1ea8('0x45')](handleEntityNotFound(_0x20fc15,null))['then'](respondWithStatusCode(_0x20fc15,null))['catch'](handleError(_0x20fc15,null));};exports[_0x1ea8('0x7c')]=function(_0x252d58,_0x687b07,_0x108eb5){return db[_0x1ea8('0x30')]['findOne']({'where':{'id':_0x252d58['params']['id']}})[_0x1ea8('0x45')](function(_0x310fdd){if(_0x310fdd){if(!_0x252d58[_0x1ea8('0x35')][_0x1ea8('0x71')]||!utils[_0x1ea8('0x72')](_0x252d58[_0x1ea8('0x35')][_0x1ea8('0x71')])){throw new db[(_0x1ea8('0x5c'))]['ValidationError'](_0x1ea8('0x74'));}return _0x310fdd[_0x1ea8('0x7d')+_['capitalize'](_0x252d58[_0x1ea8('0x35')][_0x1ea8('0x71')][_0x1ea8('0x76')]())+_0x1ea8('0x78')](_0x252d58[_0x1ea8('0x35')][_0x1ea8('0x7b')]);}return null;})[_0x1ea8('0x45')](handleEntityNotFound(_0x687b07,null))[_0x1ea8('0x45')](respondWithStatusCode(_0x687b07,null))[_0x1ea8('0x46')](handleError(_0x687b07,null));};exports[_0x1ea8('0x7e')]=function(_0x53f976,_0x5af7fe){var _0x27a020=_[_0x1ea8('0x7f')](_0x53f976[_0x1ea8('0x4f')][_0x1ea8('0x7b')])?_0x53f976[_0x1ea8('0x4f')][_0x1ea8('0x7b')]:[_0x53f976[_0x1ea8('0x4f')][_0x1ea8('0x7b')]];var _0x1e7508=_0x53f976[_0x1ea8('0x48')]['id'];return db[_0x1ea8('0x30')][_0x1ea8('0x4d')]({'where':{'id':_0x1e7508}})[_0x1ea8('0x45')](handleEntityNotFound(_0x5af7fe,null))[_0x1ea8('0x45')](function(_0x26b5a4){if(_0x26b5a4){var _0x1ae388=['Voice',_0x1ea8('0x80'),_0x1ea8('0x81'),'Sms',_0x1ea8('0x82'),'Openchannel',_0x1ea8('0x83')];return db['sequelize'][_0x1ea8('0x58')](function(_0x1f1a22){var _0x55a236=_[_0x1ea8('0x2f')](_0x1ae388,function(_0x35585c){var _0x192022={'attributes':['id','name']};if(_0x35585c===_0x1ea8('0x84')){_0x192022[_0x1ea8('0x85')]={'attributes':[_0x1ea8('0x86')]};}return _0x26b5a4['get'+_0x35585c+_0x1ea8('0x78')](_0x192022)[_0x1ea8('0x45')](function(_0x199711){var _0xed9af0=_[_0x1ea8('0x2f')](_0x199711,function(_0x6d9c6){var _0x39c276=_[_0x1ea8('0x2f')](_0x27a020,function(_0x11e2f5){var _0x2b192a={'where':{'UserId':_0x11e2f5,[_0x35585c+_0x1ea8('0x87')]:_0x6d9c6['id']},'transaction':_0x1f1a22};if(_0x35585c===_0x1ea8('0x84')){_0x2b192a[_0x1ea8('0x18')]={'penalty':_0x6d9c6['TeamVoiceQueue']['penalty']};}return db[_0x1ea8('0x88')+_0x35585c+_0x1ea8('0x77')][_0x1ea8('0x89')](_0x2b192a)[_0x1ea8('0x45')](function(){socket[_0x1ea8('0x8a')](_0x1ea8('0x50')+_0x35585c+_0x1ea8('0x8b'),{'UserId':_0x11e2f5,[_0x35585c+'QueueId']:_0x6d9c6['id']});if(_0x35585c!==_0x1ea8('0x84')){return;}return db[_0x1ea8('0x88')][_0x1ea8('0x43')]({'where':{'id':_0x27a020,'online':0x1},'attributes':['id',_0x1ea8('0x2d'),_0x1ea8('0x8c'),_0x1ea8('0x8d'),'interface'],'raw':!![]})['then'](function(_0x32b146){var _0x3bd6be=_['map'](_0x32b146,function(_0x7e3167){return db[_0x1ea8('0x8e')][_0x1ea8('0x8f')]({'membername':_0x7e3167[_0x1ea8('0x2d')],'UserId':_0x7e3167['id'],'queue_name':_0x6d9c6[_0x1ea8('0x2d')],'VoiceQueueId':_0x6d9c6['id'],'interface':_[_0x1ea8('0x90')](_0x7e3167['interface'])?util['format'](_0x1ea8('0x91'),_0x7e3167[_0x1ea8('0x2d')]):_0x7e3167['interface'],'paused':_0x7e3167['voicePause']||![],'penalty':_0x6d9c6['TeamVoiceQueue']['penalty']},{'transaction':_0x1f1a22});});return Promise[_0x1ea8('0x92')](_0x3bd6be);});});});return Promise['all'](_0x39c276);});return Promise[_0x1ea8('0x92')](_0xed9af0);})[_0x1ea8('0x45')](function(){return db[_0x1ea8('0x93')][_0x1ea8('0x70')]({'where':{'teamId':_0x1e7508}})[_0x1ea8('0x45')](function(_0x53c6a2){if(_0x53c6a2){var _0x3cb971=_[_0x1ea8('0x2f')](_0x27a020,function(_0x35d05d){db[_0x1ea8('0x6c')][_0x1ea8('0x8f')]({'UserId':_0x35d05d,'VoicePrefixId':_0x53c6a2[_0x1ea8('0x6d')]});});return Promise[_0x1ea8('0x92')](_0x3cb971);}});});});return Promise[_0x1ea8('0x92')](_0x55a236)[_0x1ea8('0x45')](function(){return _0x26b5a4['addAgents'](_0x27a020,{'transaction':_0x1f1a22})['spread'](function(_0x7f7386){return _0x7f7386;});});});}})[_0x1ea8('0x45')](respondWithResult(_0x5af7fe,null))[_0x1ea8('0x46')](handleError(_0x5af7fe,null));};exports[_0x1ea8('0x94')]=function(_0x379cec,_0x25f6dc){var _0x1583a3=_[_0x1ea8('0x7f')](_0x379cec[_0x1ea8('0x35')][_0x1ea8('0x7b')])?_0x379cec['query'][_0x1ea8('0x7b')]:[_0x379cec[_0x1ea8('0x35')][_0x1ea8('0x7b')]];var _0xaacad0=_0x379cec[_0x1ea8('0x48')]['id'];return db[_0x1ea8('0x30')]['find']({'where':{'id':_0xaacad0}})[_0x1ea8('0x45')](handleEntityNotFound(_0x25f6dc,null))['then'](function(_0xebd242){if(_0xebd242){var _0x471459=[_0x1ea8('0x84'),_0x1ea8('0x80'),'Mail','Sms','Fax',_0x1ea8('0x95'),_0x1ea8('0x83')];return db[_0x1ea8('0x59')][_0x1ea8('0x58')](function(_0x208fd7){var _0x52b23c=_[_0x1ea8('0x2f')](_0x471459,function(_0x4ebf7a){var _0x4b04d7={'attributes':['id','name']};return _0xebd242[_0x1ea8('0x51')+_0x4ebf7a+'Queues'](_0x4b04d7)[_0x1ea8('0x45')](function(_0x1e2ee2){var _0x440f94=_[_0x1ea8('0x2f')](_0x1e2ee2,function(_0x322496){return _0x322496[_0x1ea8('0x94')](_0x1583a3,{'transaction':_0x208fd7})['then'](function(){var _0x284460=_[_0x1ea8('0x2f')](_0x1583a3,function(_0x27355f){socket[_0x1ea8('0x8a')](_0x1ea8('0x50')+_0x4ebf7a+_0x1ea8('0x96'),{'UserId':Number(_0x27355f),[_0x4ebf7a+_0x1ea8('0x87')]:_0x322496['id']});if(_0x4ebf7a!==_0x1ea8('0x84')){return;}return db[_0x1ea8('0x8e')][_0x1ea8('0x57')]({'where':{'VoiceQueueId':_0x322496['id'],'UserId':_0x27355f},'transaction':_0x208fd7});});return Promise[_0x1ea8('0x92')](_0x284460);});});return Promise[_0x1ea8('0x92')](_0x440f94);});});return Promise[_0x1ea8('0x92')](_0x52b23c)[_0x1ea8('0x45')](function(){return _0xebd242[_0x1ea8('0x94')](_0x1583a3,{'transaction':_0x208fd7});})['then'](function(){return db[_0x1ea8('0x93')]['findOne']({'where':{'teamId':_0xaacad0}})['then'](function(_0x48babd){if(_0x48babd){var _0x23f49a=_[_0x1ea8('0x2f')](_0x1583a3,function(_0x94ab50){db[_0x1ea8('0x6c')][_0x1ea8('0x57')]({'where':{'UserId':_0x94ab50,'VoicePrefixId':_0x48babd['VoicePrefixId']}});});return Promise[_0x1ea8('0x92')](_0x23f49a);}});});});}})['then'](respondWithStatusCode(_0x25f6dc,null))[_0x1ea8('0x46')](handleError(_0x25f6dc,null));};exports['getAgents']=function(_0x573c6a,_0x52658b,_0x3598f9){var _0x1277c9={};var _0x42c03c={};var _0x1da673;var _0x1fc950;return db[_0x1ea8('0x30')][_0x1ea8('0x70')]({'where':{'id':_0x573c6a[_0x1ea8('0x48')]['id']}})[_0x1ea8('0x45')](handleEntityNotFound(_0x52658b,null))[_0x1ea8('0x45')](function(_0x1e81cc){if(_0x1e81cc){_0x1da673=_0x1e81cc;_0x42c03c[_0x1ea8('0x34')]=_['keys'](db[_0x1ea8('0x88')][_0x1ea8('0x31')]);_0x42c03c['query']=_[_0x1ea8('0x49')](_0x573c6a[_0x1ea8('0x35')]);_0x42c03c[_0x1ea8('0x36')]=_['intersection'](_0x42c03c['model'],_0x42c03c[_0x1ea8('0x35')]);_0x1277c9['attributes']=_[_0x1ea8('0x37')](_0x42c03c[_0x1ea8('0x34')],qs[_0x1ea8('0x39')](_0x573c6a['query'][_0x1ea8('0x39')]));_0x1277c9['attributes']=_0x1277c9[_0x1ea8('0x38')][_0x1ea8('0x3a')]?_0x1277c9['attributes']:_0x42c03c[_0x1ea8('0x34')];_0x1277c9['order']=qs[_0x1ea8('0x3d')](_0x573c6a[_0x1ea8('0x35')][_0x1ea8('0x3d')]);_0x1277c9[_0x1ea8('0x3e')]=qs[_0x1ea8('0x36')](_[_0x1ea8('0x3f')](_0x573c6a[_0x1ea8('0x35')],_0x42c03c[_0x1ea8('0x36')]));if(_0x573c6a[_0x1ea8('0x35')]['filter']){_0x1277c9[_0x1ea8('0x3e')]=_[_0x1ea8('0x41')](_0x1277c9['where'],{'$or':_[_0x1ea8('0x2f')](_0x1277c9['attributes'],function(_0x593028){var _0x55eea4={};_0x55eea4[_0x593028]={'$like':'%'+_0x573c6a['query']['filter']+'%'};return _0x55eea4;})});}_0x1277c9=_[_0x1ea8('0x41')]({},_0x1277c9,_0x573c6a[_0x1ea8('0x4c')]);return _0x1da673['getAgents'](_0x1277c9);}})['then'](function(_0x164e74){if(_0x164e74){_0x1fc950=_0x164e74[_0x1ea8('0x3a')];if(!_0x573c6a[_0x1ea8('0x35')]['hasOwnProperty'](_0x1ea8('0x3b'))){_0x1277c9[_0x1ea8('0x20')]=qs[_0x1ea8('0x20')](_0x573c6a[_0x1ea8('0x35')][_0x1ea8('0x20')]);_0x1277c9['offset']=qs[_0x1ea8('0x1f')](_0x573c6a[_0x1ea8('0x35')]['offset']);}return _0x1da673[_0x1ea8('0x97')](_0x1277c9);}})[_0x1ea8('0x45')](function(_0x2e7c91){if(_0x2e7c91){return _0x2e7c91?{'count':_0x1fc950,'rows':_0x2e7c91}:null;}})[_0x1ea8('0x45')](respondWithResult(_0x52658b,null))[_0x1ea8('0x46')](handleError(_0x52658b,null));}; \ No newline at end of file +var _0xbf75=['filter','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../mysqldb','redis','defaults','localhost','./team.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','error','send','index','map','rawAttributes','fieldName','type','key','model','name','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','options','Team','then','includeAll','include','findAll','rows','catch','params','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','VoiceQueueId','UserVoiceQueue','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','UserFaxQueue','OpenchannelQueueId','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','UserVoicePrefix','VoicePrefixId','Teams','getQueues','findOne','channel','isValidChannel','capitalize','Queue','toLowerCase','Queues','addQueues','Unknown\x20channel','add','removeQueues','ValidationError','remove','ids','addAgents','Chat','Mail','Sms','Fax','Openchannel','Whatsapp','transaction','through','penalty','QueueId','Voice','findOrCreate','emit','user','online','voicePause','interface','UserVoiceQueueRt','isNil','format','TeamVoiceQueue','all','TeamVoicePrefix','upsert','spread','removeAgents','isArray','getAgents','User'];(function(_0x2b49fb,_0xa3d5bb){var _0x41dd90=function(_0x49c3d6){while(--_0x49c3d6){_0x2b49fb['push'](_0x2b49fb['shift']());}};_0x41dd90(++_0xa3d5bb);}(_0xbf75,0x13b));var _0x5bf7=function(_0xdc37a1,_0x53ebb9){_0xdc37a1=_0xdc37a1-0x0;var _0x99b4fe=_0xbf75[_0xdc37a1];return _0x99b4fe;};'use strict';var emlformat=require(_0x5bf7('0x0'));var rimraf=require(_0x5bf7('0x1'));var zipdir=require(_0x5bf7('0x2'));var jsonpatch=require(_0x5bf7('0x3'));var rp=require(_0x5bf7('0x4'));var moment=require(_0x5bf7('0x5'));var BPromise=require(_0x5bf7('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x5bf7('0x7'));var csv=require(_0x5bf7('0x8'));var ejs=require(_0x5bf7('0x9'));var fs=require('fs');var fs_extra=require(_0x5bf7('0xa'));var _=require(_0x5bf7('0xb'));var squel=require(_0x5bf7('0xc'));var crypto=require(_0x5bf7('0xd'));var jsforce=require(_0x5bf7('0xe'));var deskjs=require(_0x5bf7('0xf'));var toCsv=require(_0x5bf7('0x8'));var querystring=require(_0x5bf7('0x10'));var Papa=require(_0x5bf7('0x11'));var Redis=require(_0x5bf7('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x5bf7('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5bf7('0x14'));var logger=require(_0x5bf7('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5bf7('0x16'))['db'];config[_0x5bf7('0x17')]=_[_0x5bf7('0x18')](config[_0x5bf7('0x17')],{'host':_0x5bf7('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x5bf7('0x1a'))[_0x5bf7('0x1b')](socket);function respondWithStatusCode(_0x9b0b0a,_0x3527fb){_0x3527fb=_0x3527fb||0xcc;return function(_0x578bbc){if(_0x578bbc){return _0x9b0b0a[_0x5bf7('0x1c')](_0x3527fb);}return _0x9b0b0a[_0x5bf7('0x1d')](_0x3527fb)[_0x5bf7('0x1e')]();};}function respondWithResult(_0x434891,_0x3e5e91){_0x3e5e91=_0x3e5e91||0xc8;return function(_0x2a67f9){if(_0x2a67f9){return _0x434891[_0x5bf7('0x1d')](_0x3e5e91)[_0x5bf7('0x1f')](_0x2a67f9);}};}function respondWithFilteredResult(_0x3902ee,_0x4ad0c9){return function(_0x379faa){if(_0x379faa){var _0x39e567=typeof _0x4ad0c9['offset']===_0x5bf7('0x20')&&typeof _0x4ad0c9[_0x5bf7('0x21')]===_0x5bf7('0x20');var _0x59fe48=_0x379faa[_0x5bf7('0x22')];var _0x4b0dcd=_0x39e567?0x0:_0x4ad0c9[_0x5bf7('0x23')];var _0x3cf84a=_0x39e567?_0x379faa[_0x5bf7('0x22')]:_0x4ad0c9[_0x5bf7('0x23')]+_0x4ad0c9[_0x5bf7('0x21')];var _0x11ea94;if(_0x3cf84a>=_0x59fe48){_0x3cf84a=_0x59fe48;_0x11ea94=0xc8;}else{_0x11ea94=0xce;}_0x3902ee[_0x5bf7('0x1d')](_0x11ea94);return _0x3902ee[_0x5bf7('0x24')]('Content-Range',_0x4b0dcd+'-'+_0x3cf84a+'/'+_0x59fe48)[_0x5bf7('0x1f')](_0x379faa);}return null;};}function patchUpdates(_0x179f28){return function(_0xb9cbdf){try{jsonpatch[_0x5bf7('0x25')](_0xb9cbdf,_0x179f28,!![]);}catch(_0x4fe50a){return BPromise[_0x5bf7('0x26')](_0x4fe50a);}return _0xb9cbdf[_0x5bf7('0x27')]();};}function saveUpdates(_0x41f475,_0x1602a5){return function(_0x4e5743){if(_0x4e5743){return _0x4e5743['update'](_0x41f475)['then'](function(_0x4b43f9){return _0x4b43f9;});}return null;};}function handleEntityNotFound(_0x8e1d35,_0x33c445){return function(_0x250976){if(!_0x250976){_0x8e1d35[_0x5bf7('0x1c')](0x194);}return _0x250976;};}function handleError(_0x2e76cf,_0x525f86){_0x525f86=_0x525f86||0x1f4;return function(_0x1ea8f9){logger[_0x5bf7('0x28')](_0x1ea8f9['stack']);if(_0x1ea8f9['name']){delete _0x1ea8f9['name'];}_0x2e76cf[_0x5bf7('0x1d')](_0x525f86)[_0x5bf7('0x29')](_0x1ea8f9);};}exports[_0x5bf7('0x2a')]=function(_0x2343dd,_0x25d989){var _0x155d7a={},_0x3c9a01={},_0xc71906={'count':0x0,'rows':[]};var _0x132eb9=_[_0x5bf7('0x2b')](db['Team'][_0x5bf7('0x2c')],function(_0x184cf9){return{'name':_0x184cf9[_0x5bf7('0x2d')],'type':_0x184cf9[_0x5bf7('0x2e')][_0x5bf7('0x2f')]};});_0x3c9a01[_0x5bf7('0x30')]=_[_0x5bf7('0x2b')](_0x132eb9,_0x5bf7('0x31'));_0x3c9a01['query']=_[_0x5bf7('0x32')](_0x2343dd[_0x5bf7('0x33')]);_0x3c9a01[_0x5bf7('0x34')]=_[_0x5bf7('0x35')](_0x3c9a01['model'],_0x3c9a01[_0x5bf7('0x33')]);_0x155d7a[_0x5bf7('0x36')]=_[_0x5bf7('0x35')](_0x3c9a01['model'],qs[_0x5bf7('0x37')](_0x2343dd[_0x5bf7('0x33')]['fields']));_0x155d7a['attributes']=_0x155d7a['attributes'][_0x5bf7('0x38')]?_0x155d7a[_0x5bf7('0x36')]:_0x3c9a01[_0x5bf7('0x30')];if(!_0x2343dd[_0x5bf7('0x33')]['hasOwnProperty'](_0x5bf7('0x39'))){_0x155d7a[_0x5bf7('0x21')]=qs['limit'](_0x2343dd[_0x5bf7('0x33')]['limit']);_0x155d7a[_0x5bf7('0x23')]=qs[_0x5bf7('0x23')](_0x2343dd[_0x5bf7('0x33')][_0x5bf7('0x23')]);}_0x155d7a[_0x5bf7('0x3a')]=qs['sort'](_0x2343dd[_0x5bf7('0x33')][_0x5bf7('0x3b')]);_0x155d7a[_0x5bf7('0x3c')]=qs[_0x5bf7('0x34')](_[_0x5bf7('0x3d')](_0x2343dd[_0x5bf7('0x33')],_0x3c9a01[_0x5bf7('0x34')]),_0x132eb9);if(_0x2343dd['query']['filter']){_0x155d7a[_0x5bf7('0x3c')]=_[_0x5bf7('0x3e')](_0x155d7a['where'],{'$or':_['map'](_0x132eb9,function(_0x47fcc0){if(_0x47fcc0['type']!==_0x5bf7('0x3f')){var _0x1b582a={};_0x1b582a[_0x47fcc0[_0x5bf7('0x31')]]={'$like':'%'+_0x2343dd[_0x5bf7('0x33')]['filter']+'%'};return _0x1b582a;}})});}_0x155d7a=_[_0x5bf7('0x3e')]({},_0x155d7a,_0x2343dd[_0x5bf7('0x40')]);var _0x474f86={'where':_0x155d7a[_0x5bf7('0x3c')]};return db[_0x5bf7('0x41')]['count'](_0x474f86)[_0x5bf7('0x42')](function(_0x1eb56a){_0xc71906[_0x5bf7('0x22')]=_0x1eb56a;if(_0x2343dd[_0x5bf7('0x33')][_0x5bf7('0x43')]){_0x155d7a[_0x5bf7('0x44')]=[{'all':!![]}];}return db[_0x5bf7('0x41')][_0x5bf7('0x45')](_0x155d7a);})[_0x5bf7('0x42')](function(_0x14e356){_0xc71906[_0x5bf7('0x46')]=_0x14e356;return _0xc71906;})[_0x5bf7('0x42')](respondWithFilteredResult(_0x25d989,_0x155d7a))[_0x5bf7('0x47')](handleError(_0x25d989,null));};exports['show']=function(_0x40a2c1,_0x545ccc){var _0x2663ab={'raw':![],'where':{'id':_0x40a2c1[_0x5bf7('0x48')]['id']}},_0x5d26b6={};_0x5d26b6[_0x5bf7('0x30')]=_[_0x5bf7('0x32')](db[_0x5bf7('0x41')][_0x5bf7('0x2c')]);_0x5d26b6['query']=_[_0x5bf7('0x32')](_0x40a2c1['query']);_0x5d26b6['filters']=_[_0x5bf7('0x35')](_0x5d26b6['model'],_0x5d26b6[_0x5bf7('0x33')]);_0x2663ab[_0x5bf7('0x36')]=_[_0x5bf7('0x35')](_0x5d26b6['model'],qs['fields'](_0x40a2c1['query'][_0x5bf7('0x37')]));_0x2663ab[_0x5bf7('0x36')]=_0x2663ab[_0x5bf7('0x36')][_0x5bf7('0x38')]?_0x2663ab[_0x5bf7('0x36')]:_0x5d26b6[_0x5bf7('0x30')];if(_0x40a2c1['query']['includeAll']){_0x2663ab[_0x5bf7('0x44')]=[{'all':!![]}];}_0x2663ab=_['merge']({},_0x2663ab,_0x40a2c1['options']);return db[_0x5bf7('0x41')]['find'](_0x2663ab)[_0x5bf7('0x42')](handleEntityNotFound(_0x545ccc,null))['then'](respondWithResult(_0x545ccc,null))['catch'](handleError(_0x545ccc,null));};exports[_0x5bf7('0x49')]=function(_0x5dc216,_0x56e8d9){return db['Team'][_0x5bf7('0x49')](_0x5dc216[_0x5bf7('0x4a')],{})[_0x5bf7('0x42')](function(_0x573c50){var _0x3301dc=_0x5dc216['user']['get']({'plain':!![]});if(!_0x3301dc)throw new Error(_0x5bf7('0x4b'));if(_0x3301dc[_0x5bf7('0x4c')]==='user'){var _0x1ac25d=_0x573c50[_0x5bf7('0x4d')]({'plain':!![]});var _0x5c3440='Teams';return db[_0x5bf7('0x4e')][_0x5bf7('0x4f')]({'where':{'name':_0x5c3440,'userProfileId':_0x3301dc[_0x5bf7('0x50')]},'raw':!![]})['then'](function(_0x205bd4){if(_0x205bd4&&_0x205bd4[_0x5bf7('0x51')]===0x0){return db[_0x5bf7('0x52')][_0x5bf7('0x49')]({'name':_0x1ac25d[_0x5bf7('0x31')],'resourceId':_0x1ac25d['id'],'type':_0x205bd4[_0x5bf7('0x31')],'sectionId':_0x205bd4['id']},{})[_0x5bf7('0x42')](function(){return _0x573c50;});}else{return _0x573c50;}})['catch'](function(_0x419f3e){logger[_0x5bf7('0x28')](_0x5bf7('0x53'),_0x419f3e);throw _0x419f3e;});}return _0x573c50;})[_0x5bf7('0x42')](respondWithResult(_0x56e8d9,0xc9))['catch'](handleError(_0x56e8d9,null));};exports['update']=function(_0x36f055,_0x515604){if(_0x36f055[_0x5bf7('0x4a')]['id']){delete _0x36f055[_0x5bf7('0x4a')]['id'];}return db['Team'][_0x5bf7('0x4f')]({'where':{'id':_0x36f055['params']['id']}})['then'](handleEntityNotFound(_0x515604,null))['then'](saveUpdates(_0x36f055['body'],null))[_0x5bf7('0x42')](respondWithResult(_0x515604,null))[_0x5bf7('0x47')](handleError(_0x515604,null));};exports[_0x5bf7('0x54')]=function(_0x462be6,_0x1ee7c9){var _0x490d08=_0x462be6[_0x5bf7('0x48')]['id'];var _0x40ba92=[];return db['sequelize']['transaction'](function(_0x248ec8){var _0x1f3007=_0x5bf7('0x55')+_0x490d08;return db[_0x5bf7('0x56')][_0x5bf7('0x33')](_0x1f3007,{'type':db[_0x5bf7('0x57')][_0x5bf7('0x58')][_0x5bf7('0x59')],'raw':!![],'transaction':_0x248ec8})['then'](function(_0x1ad263){_0x40ba92=_[_0x5bf7('0x2b')](_0x1ad263,function(_0x43c647){return Number(_0x43c647[_0x5bf7('0x5a')]);});})['then'](function(){var _0x551cdb=_0x5bf7('0x5b')+_0x490d08;return db['sequelize'][_0x5bf7('0x33')](_0x551cdb,{'type':db['Sequelize'][_0x5bf7('0x58')]['SELECT'],'raw':!![],'transaction':_0x248ec8});})['then'](function(_0x23f7b5){var _0x48ded7=_['map'](_0x23f7b5,function(_0x3c0f39){return Number(_0x3c0f39[_0x5bf7('0x5c')]);});return db[_0x5bf7('0x5d')][_0x5bf7('0x54')]({'where':{'UserId':{'$in':_0x40ba92},'VoiceQueueId':{'$in':_0x48ded7}},'transaction':_0x248ec8});})[_0x5bf7('0x42')](function(){var _0x3604f2=_0x5bf7('0x5e')+_0x490d08;return db[_0x5bf7('0x56')]['query'](_0x3604f2,{'type':db[_0x5bf7('0x57')][_0x5bf7('0x58')][_0x5bf7('0x59')],'raw':!![],'transaction':_0x248ec8});})[_0x5bf7('0x42')](function(_0x53cf38){var _0x546f81=_[_0x5bf7('0x2b')](_0x53cf38,function(_0x39981e){return Number(_0x39981e[_0x5bf7('0x5f')]);});return db['UserMailQueue'][_0x5bf7('0x54')]({'where':{'UserId':{'$in':_0x40ba92},'MailQueueId':{'$in':_0x546f81}},'transaction':_0x248ec8});})[_0x5bf7('0x42')](function(){var _0x56650c=_0x5bf7('0x60')+_0x490d08;return db['sequelize']['query'](_0x56650c,{'type':db[_0x5bf7('0x57')][_0x5bf7('0x58')]['SELECT'],'raw':!![],'transaction':_0x248ec8});})[_0x5bf7('0x42')](function(_0x6c23d9){var _0x3bf08f=_[_0x5bf7('0x2b')](_0x6c23d9,function(_0x38fe49){return Number(_0x38fe49[_0x5bf7('0x61')]);});return db[_0x5bf7('0x62')][_0x5bf7('0x54')]({'where':{'UserId':{'$in':_0x40ba92},'SmsQueueId':{'$in':_0x3bf08f}},'transaction':_0x248ec8});})[_0x5bf7('0x42')](function(){var _0x4ef193=_0x5bf7('0x63')+_0x490d08;return db[_0x5bf7('0x56')][_0x5bf7('0x33')](_0x4ef193,{'type':db[_0x5bf7('0x57')]['QueryTypes'][_0x5bf7('0x59')],'raw':!![],'transaction':_0x248ec8});})[_0x5bf7('0x42')](function(_0x4eb8c2){var _0x278b5f=_['map'](_0x4eb8c2,function(_0x13e313){return Number(_0x13e313['ChatQueueId']);});return db[_0x5bf7('0x64')][_0x5bf7('0x54')]({'where':{'UserId':{'$in':_0x40ba92},'ChatQueueId':{'$in':_0x278b5f}},'transaction':_0x248ec8});})[_0x5bf7('0x42')](function(){var _0x38b619=_0x5bf7('0x65')+_0x490d08;return db[_0x5bf7('0x56')]['query'](_0x38b619,{'type':db[_0x5bf7('0x57')][_0x5bf7('0x58')][_0x5bf7('0x59')],'raw':!![],'transaction':_0x248ec8});})['then'](function(_0x492693){var _0x2108a6=_[_0x5bf7('0x2b')](_0x492693,function(_0x4dac2d){return Number(_0x4dac2d[_0x5bf7('0x66')]);});return db[_0x5bf7('0x67')][_0x5bf7('0x54')]({'where':{'UserId':{'$in':_0x40ba92},'FaxQueueId':{'$in':_0x2108a6}},'transaction':_0x248ec8});})[_0x5bf7('0x42')](function(){var _0x10429c='SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20'+_0x490d08;return db['sequelize'][_0x5bf7('0x33')](_0x10429c,{'type':db[_0x5bf7('0x57')][_0x5bf7('0x58')][_0x5bf7('0x59')],'raw':!![],'transaction':_0x248ec8});})[_0x5bf7('0x42')](function(_0x1a85cd){var _0x19f8df=_[_0x5bf7('0x2b')](_0x1a85cd,function(_0x34aed3){return Number(_0x34aed3[_0x5bf7('0x68')]);});return db['UserOpenchannelQueue'][_0x5bf7('0x54')]({'where':{'UserId':{'$in':_0x40ba92},'OpenchannelQueueId':{'$in':_0x19f8df}},'transaction':_0x248ec8});})['then'](function(){var _0xdbf2b4=_0x5bf7('0x69')+_0x490d08;return db['sequelize']['query'](_0xdbf2b4,{'type':db[_0x5bf7('0x57')][_0x5bf7('0x58')][_0x5bf7('0x59')],'raw':!![],'transaction':_0x248ec8});})[_0x5bf7('0x42')](function(_0x4a412a){var _0x3ab2e2=_[_0x5bf7('0x2b')](_0x4a412a,function(_0x2e8c71){return Number(_0x2e8c71[_0x5bf7('0x6a')]);});return db[_0x5bf7('0x6b')]['destroy']({'where':{'UserId':{'$in':_0x40ba92},'WhatsappQueueId':{'$in':_0x3ab2e2}},'transaction':_0x248ec8});})[_0x5bf7('0x42')](function(){return db['TeamVoicePrefix'][_0x5bf7('0x4f')]({'where':{'TeamId':_0x490d08}});})[_0x5bf7('0x42')](function(_0x558bc6){if(_0x558bc6===null){return;}return db[_0x5bf7('0x6c')][_0x5bf7('0x54')]({'where':{'UserId':{'$in':_0x40ba92},'VoicePrefixId':_0x558bc6[_0x5bf7('0x6d')]},'transaction':_0x248ec8});})[_0x5bf7('0x42')](function(){return db[_0x5bf7('0x41')][_0x5bf7('0x54')]({'where':{'id':_0x490d08},'cascade':!![],'transaction':_0x248ec8});})['then'](function(_0x102408){if(_0x102408===0x0){_0x1ee7c9[_0x5bf7('0x1c')](0x194);}else{return db[_0x5bf7('0x52')]['destroy']({'where':{'type':_0x5bf7('0x6e'),'resourceId':_0x490d08},'cascade':!![],'transaction':_0x248ec8})['then'](function(){_0x1ee7c9['status'](0xcc)[_0x5bf7('0x1e')]();});}})[_0x5bf7('0x47')](function(_0x3a4853){_0x1ee7c9[_0x5bf7('0x1d')](0x1f4)[_0x5bf7('0x29')](_0x3a4853);});});};exports[_0x5bf7('0x6f')]=function(_0x1ffda8,_0x1fed93,_0x162256){return db[_0x5bf7('0x41')][_0x5bf7('0x70')]({'where':{'id':_0x1ffda8[_0x5bf7('0x48')]['id']}})['then'](handleEntityNotFound(_0x1fed93,null))[_0x5bf7('0x42')](function(_0x1f06d4){if(!_0x1ffda8[_0x5bf7('0x33')][_0x5bf7('0x71')]||!utils[_0x5bf7('0x72')](_0x1ffda8[_0x5bf7('0x33')][_0x5bf7('0x71')])){throw new db[(_0x5bf7('0x57'))]['ValidationError']('Unknown\x20channel');}var _0x4fd5e1={};var _0x18e956={};_0x18e956[_0x5bf7('0x30')]=_[_0x5bf7('0x32')](db[_[_0x5bf7('0x73')](_0x1ffda8[_0x5bf7('0x33')][_0x5bf7('0x71')]['toLowerCase']())+_0x5bf7('0x74')][_0x5bf7('0x2c')]);_0x18e956[_0x5bf7('0x33')]=_[_0x5bf7('0x32')](_0x1ffda8[_0x5bf7('0x33')]);_0x18e956['filters']=_[_0x5bf7('0x35')](_0x18e956[_0x5bf7('0x30')],_0x18e956[_0x5bf7('0x33')]);_0x4fd5e1[_0x5bf7('0x36')]=_[_0x5bf7('0x35')](_0x18e956[_0x5bf7('0x30')],qs[_0x5bf7('0x37')](_0x1ffda8['query']['fields']));_0x4fd5e1[_0x5bf7('0x36')]=_0x4fd5e1['attributes']['length']?_0x4fd5e1[_0x5bf7('0x36')]:_0x18e956[_0x5bf7('0x30')];_0x4fd5e1[_0x5bf7('0x21')]=qs[_0x5bf7('0x21')](_0x1ffda8[_0x5bf7('0x33')]['limit']);_0x4fd5e1[_0x5bf7('0x23')]=qs[_0x5bf7('0x23')](_0x1ffda8['query']['offset']);_0x4fd5e1[_0x5bf7('0x3a')]=qs[_0x5bf7('0x3b')](_0x1ffda8[_0x5bf7('0x33')][_0x5bf7('0x3b')]);_0x4fd5e1[_0x5bf7('0x3c')]=qs[_0x5bf7('0x34')](_[_0x5bf7('0x3d')](_0x1ffda8[_0x5bf7('0x33')],_0x18e956[_0x5bf7('0x34')]));_0x4fd5e1=_[_0x5bf7('0x3e')]({},_0x4fd5e1,_0x1ffda8[_0x5bf7('0x40')]);return _0x1f06d4[_0x5bf7('0x4d')+_['capitalize'](_0x1ffda8[_0x5bf7('0x33')][_0x5bf7('0x71')][_0x5bf7('0x75')]())+_0x5bf7('0x76')](_0x4fd5e1);})['then'](respondWithResult(_0x1fed93,null))['catch'](handleError(_0x1fed93,null));};exports[_0x5bf7('0x77')]=function(_0x3427ac,_0x371cbd,_0x8ffc73){return db[_0x5bf7('0x41')][_0x5bf7('0x70')]({'where':{'id':_0x3427ac[_0x5bf7('0x48')]['id']}})['then'](function(_0xada7b){if(_0xada7b){if(!_0x3427ac['body'][_0x5bf7('0x71')]||!utils[_0x5bf7('0x72')](_0x3427ac[_0x5bf7('0x4a')][_0x5bf7('0x71')])){throw new db[(_0x5bf7('0x57'))]['ValidationError'](_0x5bf7('0x78'));}return _0xada7b[_0x5bf7('0x79')+_['capitalize'](_0x3427ac[_0x5bf7('0x4a')][_0x5bf7('0x71')]['toLowerCase']())+'Queues'](_0x3427ac[_0x5bf7('0x4a')]['ids']);}return null;})[_0x5bf7('0x42')](handleEntityNotFound(_0x371cbd,null))[_0x5bf7('0x42')](respondWithStatusCode(_0x371cbd,null))[_0x5bf7('0x47')](handleError(_0x371cbd,null));};exports[_0x5bf7('0x7a')]=function(_0x5f5db4,_0x6eb7e9,_0x5175dd){return db['Team']['findOne']({'where':{'id':_0x5f5db4[_0x5bf7('0x48')]['id']}})[_0x5bf7('0x42')](function(_0x23a395){if(_0x23a395){if(!_0x5f5db4[_0x5bf7('0x33')][_0x5bf7('0x71')]||!utils[_0x5bf7('0x72')](_0x5f5db4[_0x5bf7('0x33')][_0x5bf7('0x71')])){throw new db[(_0x5bf7('0x57'))][(_0x5bf7('0x7b'))](_0x5bf7('0x78'));}return _0x23a395[_0x5bf7('0x7c')+_[_0x5bf7('0x73')](_0x5f5db4['query'][_0x5bf7('0x71')][_0x5bf7('0x75')]())+_0x5bf7('0x76')](_0x5f5db4['query'][_0x5bf7('0x7d')]);}return null;})[_0x5bf7('0x42')](handleEntityNotFound(_0x6eb7e9,null))[_0x5bf7('0x42')](respondWithStatusCode(_0x6eb7e9,null))[_0x5bf7('0x47')](handleError(_0x6eb7e9,null));};exports[_0x5bf7('0x7e')]=function(_0x3827a9,_0x341734){var _0x46b95a=_['isArray'](_0x3827a9[_0x5bf7('0x4a')][_0x5bf7('0x7d')])?_0x3827a9[_0x5bf7('0x4a')][_0x5bf7('0x7d')]:[_0x3827a9[_0x5bf7('0x4a')][_0x5bf7('0x7d')]];var _0x7c87=_0x3827a9[_0x5bf7('0x48')]['id'];return db[_0x5bf7('0x41')][_0x5bf7('0x4f')]({'where':{'id':_0x7c87}})[_0x5bf7('0x42')](handleEntityNotFound(_0x341734,null))[_0x5bf7('0x42')](function(_0x445a22){if(_0x445a22){var _0x49acf5=['Voice',_0x5bf7('0x7f'),_0x5bf7('0x80'),_0x5bf7('0x81'),_0x5bf7('0x82'),_0x5bf7('0x83'),_0x5bf7('0x84')];return db[_0x5bf7('0x56')][_0x5bf7('0x85')](function(_0x57d9e7){var _0x520afb=_['map'](_0x49acf5,function(_0x3584ce){var _0x343b9b={'attributes':['id',_0x5bf7('0x31')]};if(_0x3584ce==='Voice'){_0x343b9b[_0x5bf7('0x86')]={'attributes':[_0x5bf7('0x87')]};}return _0x445a22[_0x5bf7('0x4d')+_0x3584ce+'Queues'](_0x343b9b)[_0x5bf7('0x42')](function(_0x3677fe){var _0x103621=_[_0x5bf7('0x2b')](_0x3677fe,function(_0x5cc40b){var _0x576a2c=_['map'](_0x46b95a,function(_0x460abb){var _0x46f504={'where':{'UserId':_0x460abb,[_0x3584ce+_0x5bf7('0x88')]:_0x5cc40b['id']},'transaction':_0x57d9e7};if(_0x3584ce===_0x5bf7('0x89')){_0x46f504[_0x5bf7('0x18')]={'penalty':_0x5cc40b['TeamVoiceQueue'][_0x5bf7('0x87')]};}return db['User'+_0x3584ce+_0x5bf7('0x74')][_0x5bf7('0x8a')](_0x46f504)[_0x5bf7('0x42')](function(){socket[_0x5bf7('0x8b')](_0x5bf7('0x8c')+_0x3584ce+'Queue:save',{'UserId':_0x460abb,[_0x3584ce+_0x5bf7('0x88')]:_0x5cc40b['id']});if(_0x3584ce!==_0x5bf7('0x89')){return;}return db['User'][_0x5bf7('0x45')]({'where':{'id':_0x46b95a,'online':0x1},'attributes':['id',_0x5bf7('0x31'),_0x5bf7('0x8d'),_0x5bf7('0x8e'),_0x5bf7('0x8f')],'raw':!![]})['then'](function(_0x59c7c2){var _0x521330=_[_0x5bf7('0x2b')](_0x59c7c2,function(_0x45cd58){return db[_0x5bf7('0x90')]['upsert']({'membername':_0x45cd58['name'],'UserId':_0x45cd58['id'],'queue_name':_0x5cc40b[_0x5bf7('0x31')],'VoiceQueueId':_0x5cc40b['id'],'interface':_[_0x5bf7('0x91')](_0x45cd58[_0x5bf7('0x8f')])?util[_0x5bf7('0x92')]('SIP/%s',_0x45cd58[_0x5bf7('0x31')]):_0x45cd58[_0x5bf7('0x8f')],'paused':_0x45cd58[_0x5bf7('0x8e')]||![],'penalty':_0x5cc40b[_0x5bf7('0x93')]['penalty']},{'transaction':_0x57d9e7});});return Promise['all'](_0x521330);});});});return Promise[_0x5bf7('0x94')](_0x576a2c);});return Promise[_0x5bf7('0x94')](_0x103621);})[_0x5bf7('0x42')](function(){return db[_0x5bf7('0x95')][_0x5bf7('0x70')]({'where':{'teamId':_0x7c87}})['then'](function(_0x23c233){if(_0x23c233){var _0x2fc38f=_[_0x5bf7('0x2b')](_0x46b95a,function(_0x4147ac){db[_0x5bf7('0x6c')][_0x5bf7('0x96')]({'UserId':_0x4147ac,'VoicePrefixId':_0x23c233[_0x5bf7('0x6d')]});});return Promise['all'](_0x2fc38f);}});});});return Promise[_0x5bf7('0x94')](_0x520afb)[_0x5bf7('0x42')](function(){return _0x445a22[_0x5bf7('0x7e')](_0x46b95a,{'transaction':_0x57d9e7})[_0x5bf7('0x97')](function(_0x493aaf){return _0x493aaf;});});});}})['then'](respondWithResult(_0x341734,null))[_0x5bf7('0x47')](handleError(_0x341734,null));};exports[_0x5bf7('0x98')]=function(_0x1eda20,_0x3ff6f8){var _0x314386=_[_0x5bf7('0x99')](_0x1eda20['query'][_0x5bf7('0x7d')])?_0x1eda20[_0x5bf7('0x33')]['ids']:[_0x1eda20['query'][_0x5bf7('0x7d')]];var _0x514896=_0x1eda20['params']['id'];return db[_0x5bf7('0x41')][_0x5bf7('0x4f')]({'where':{'id':_0x514896}})['then'](handleEntityNotFound(_0x3ff6f8,null))[_0x5bf7('0x42')](function(_0x2d913b){if(_0x2d913b){var _0x54d56f=[_0x5bf7('0x89'),_0x5bf7('0x7f'),_0x5bf7('0x80'),_0x5bf7('0x81'),_0x5bf7('0x82'),_0x5bf7('0x83'),_0x5bf7('0x84')];return db[_0x5bf7('0x56')][_0x5bf7('0x85')](function(_0x50e7d1){var _0x43a57d=_[_0x5bf7('0x2b')](_0x54d56f,function(_0x36e490){var _0x36107e={'attributes':['id',_0x5bf7('0x31')]};return _0x2d913b['get'+_0x36e490+_0x5bf7('0x76')](_0x36107e)['then'](function(_0x5851a6){var _0x4538dd=_[_0x5bf7('0x2b')](_0x5851a6,function(_0x4345cd){return _0x4345cd[_0x5bf7('0x98')](_0x314386,{'transaction':_0x50e7d1})['then'](function(){var _0x334dc7=_[_0x5bf7('0x2b')](_0x314386,function(_0x3c967d){socket[_0x5bf7('0x8b')]('user'+_0x36e490+'Queue:remove',{'UserId':Number(_0x3c967d),[_0x36e490+_0x5bf7('0x88')]:_0x4345cd['id']});if(_0x36e490!==_0x5bf7('0x89')){return;}return db['UserVoiceQueueRt'][_0x5bf7('0x54')]({'where':{'VoiceQueueId':_0x4345cd['id'],'UserId':_0x3c967d},'transaction':_0x50e7d1});});return Promise[_0x5bf7('0x94')](_0x334dc7);});});return Promise[_0x5bf7('0x94')](_0x4538dd);});});return Promise['all'](_0x43a57d)['then'](function(){return _0x2d913b[_0x5bf7('0x98')](_0x314386,{'transaction':_0x50e7d1});})[_0x5bf7('0x42')](function(){return db['TeamVoicePrefix']['findOne']({'where':{'teamId':_0x514896}})[_0x5bf7('0x42')](function(_0x39fe13){if(_0x39fe13){var _0x1bb139=_[_0x5bf7('0x2b')](_0x314386,function(_0x34a6af){db[_0x5bf7('0x6c')][_0x5bf7('0x54')]({'where':{'UserId':_0x34a6af,'VoicePrefixId':_0x39fe13[_0x5bf7('0x6d')]}});});return Promise[_0x5bf7('0x94')](_0x1bb139);}});});});}})[_0x5bf7('0x42')](respondWithStatusCode(_0x3ff6f8,null))[_0x5bf7('0x47')](handleError(_0x3ff6f8,null));};exports[_0x5bf7('0x9a')]=function(_0x11b3a2,_0x1e64ef,_0x27dfc6){var _0x4330e9={};var _0x5b9d99={};var _0x3ba7cd;var _0x33f616;return db[_0x5bf7('0x41')][_0x5bf7('0x70')]({'where':{'id':_0x11b3a2['params']['id']}})[_0x5bf7('0x42')](handleEntityNotFound(_0x1e64ef,null))[_0x5bf7('0x42')](function(_0x7419a4){if(_0x7419a4){_0x3ba7cd=_0x7419a4;_0x5b9d99[_0x5bf7('0x30')]=_['keys'](db[_0x5bf7('0x9b')][_0x5bf7('0x2c')]);_0x5b9d99[_0x5bf7('0x33')]=_['keys'](_0x11b3a2['query']);_0x5b9d99[_0x5bf7('0x34')]=_[_0x5bf7('0x35')](_0x5b9d99[_0x5bf7('0x30')],_0x5b9d99[_0x5bf7('0x33')]);_0x4330e9[_0x5bf7('0x36')]=_[_0x5bf7('0x35')](_0x5b9d99[_0x5bf7('0x30')],qs['fields'](_0x11b3a2['query'][_0x5bf7('0x37')]));_0x4330e9['attributes']=_0x4330e9[_0x5bf7('0x36')]['length']?_0x4330e9[_0x5bf7('0x36')]:_0x5b9d99[_0x5bf7('0x30')];_0x4330e9[_0x5bf7('0x3a')]=qs[_0x5bf7('0x3b')](_0x11b3a2[_0x5bf7('0x33')][_0x5bf7('0x3b')]);_0x4330e9['where']=qs[_0x5bf7('0x34')](_[_0x5bf7('0x3d')](_0x11b3a2['query'],_0x5b9d99[_0x5bf7('0x34')]));if(_0x11b3a2[_0x5bf7('0x33')][_0x5bf7('0x9c')]){_0x4330e9[_0x5bf7('0x3c')]=_['merge'](_0x4330e9[_0x5bf7('0x3c')],{'$or':_[_0x5bf7('0x2b')](_0x4330e9[_0x5bf7('0x36')],function(_0x1421f5){var _0x266a7b={};_0x266a7b[_0x1421f5]={'$like':'%'+_0x11b3a2[_0x5bf7('0x33')][_0x5bf7('0x9c')]+'%'};return _0x266a7b;})});}_0x4330e9=_[_0x5bf7('0x3e')]({},_0x4330e9,_0x11b3a2[_0x5bf7('0x40')]);return _0x3ba7cd[_0x5bf7('0x9a')](_0x4330e9);}})['then'](function(_0x5a2483){if(_0x5a2483){_0x33f616=_0x5a2483[_0x5bf7('0x38')];if(!_0x11b3a2[_0x5bf7('0x33')]['hasOwnProperty']('nolimit')){_0x4330e9[_0x5bf7('0x21')]=qs[_0x5bf7('0x21')](_0x11b3a2['query']['limit']);_0x4330e9[_0x5bf7('0x23')]=qs['offset'](_0x11b3a2[_0x5bf7('0x33')]['offset']);}return _0x3ba7cd[_0x5bf7('0x9a')](_0x4330e9);}})[_0x5bf7('0x42')](function(_0x5a7567){if(_0x5a7567){return _0x5a7567?{'count':_0x33f616,'rows':_0x5a7567}:null;}})[_0x5bf7('0x42')](respondWithResult(_0x1e64ef,null))[_0x5bf7('0x47')](handleError(_0x1e64ef,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index 6f4e109..cd1f042 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 _0xfe98=['hasOwnProperty','hook','exports','../../mysqldb','Team','setMaxListeners','update','remove','emit'];(function(_0x320a26,_0x356a44){var _0x4ebc66=function(_0x50436e){while(--_0x50436e){_0x320a26['push'](_0x320a26['shift']());}};_0x4ebc66(++_0x356a44);}(_0xfe98,0x12c));var _0x8fe9=function(_0x187499,_0x5e416a){_0x187499=_0x187499-0x0;var _0x2965fe=_0xfe98[_0x187499];return _0x2965fe;};'use strict';var EventEmitter=require('events');var Team=require(_0x8fe9('0x0'))['db'][_0x8fe9('0x1')];var TeamEvents=new EventEmitter();TeamEvents[_0x8fe9('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8fe9('0x3'),'afterDestroy':_0x8fe9('0x4')};function emitEvent(_0x326709){return function(_0x4a7f61,_0x1c2a1c,_0x5b7e85){TeamEvents[_0x8fe9('0x5')](_0x326709+':'+_0x4a7f61['id'],_0x4a7f61);TeamEvents[_0x8fe9('0x5')](_0x326709,_0x4a7f61);_0x5b7e85(null);};}for(var e in events){if(events[_0x8fe9('0x6')](e)){var event=events[e];Team[_0x8fe9('0x7')](e,emitEvent(event));}}module[_0x8fe9('0x8')]=TeamEvents; \ No newline at end of file +var _0xc00d=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','Team'];(function(_0x4930da,_0x2f5b8c){var _0x44bbdb=function(_0x1e0e52){while(--_0x1e0e52){_0x4930da['push'](_0x4930da['shift']());}};_0x44bbdb(++_0x2f5b8c);}(_0xc00d,0x11d));var _0xdc00=function(_0x41e051,_0x19b802){_0x41e051=_0x41e051-0x0;var _0x29e55b=_0xc00d[_0x41e051];return _0x29e55b;};'use strict';var EventEmitter=require(_0xdc00('0x0'));var Team=require(_0xdc00('0x1'))['db'][_0xdc00('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0xdc00('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xdc00('0x4'),'afterDestroy':_0xdc00('0x5')};function emitEvent(_0x5a95d4){return function(_0x150b1d,_0xe0efe0,_0x214eae){TeamEvents[_0xdc00('0x6')](_0x5a95d4+':'+_0x150b1d['id'],_0x150b1d);TeamEvents[_0xdc00('0x6')](_0x5a95d4,_0x150b1d);_0x214eae(null);};}for(var e in events){if(events[_0xdc00('0x7')](e)){var event=events[e];Team[_0xdc00('0x8')](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 133ee8d..1527a67 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 _0xf501=['Queues','map','setDataValue','channel','exports','define','teams','Mail','Openchannel','Sms','Whatsapp','then','catch','lodash','./team.attributes','get'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xf501,0xed));var _0x1f50=function(_0x2c1a4e,_0x463f4b){_0x2c1a4e=_0x2c1a4e-0x0;var _0x45c844=_0xf501[_0x2c1a4e];return _0x45c844;};'use strict';var _=require(_0x1f50('0x0'));var attributes=require(_0x1f50('0x1'));function getQueuesByChannel(_0x3f5e85,_0x599809){var _0x4e7ad0=_0x1f50('0x2')+_0x599809+_0x1f50('0x3');return _0x3f5e85[_0x4e7ad0]()['then'](function(_0x553120){return _[_0x1f50('0x4')](_0x553120,function(_0x2b776d){_0x2b776d[_0x1f50('0x5')](_0x1f50('0x6'),_0x599809);return _0x2b776d;});})['catch'](function(_0x209c2a){throw _0x209c2a;});}module[_0x1f50('0x7')]=function(_0xbfdb8f){return _0xbfdb8f[_0x1f50('0x8')]('Team',attributes,{'tableName':_0x1f50('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x1962b2=this;var _0x336780=['Chat','Fax',_0x1f50('0xa'),_0x1f50('0xb'),_0x1f50('0xc'),'Voice',_0x1f50('0xd')];return Promise['resolve']()[_0x1f50('0xe')](function(){var _0x39f4bb=_[_0x1f50('0x4')](_0x336780,function(_0x2bb27e){return getQueuesByChannel(_0x1962b2,_0x2bb27e);});return Promise['all'](_0x39f4bb);})[_0x1f50('0xf')](function(_0x3fc2a9){throw _0x3fc2a9;});}}});}; \ No newline at end of file +var _0x2191=['setDataValue','channel','exports','define','Team','teams','Chat','Fax','Mail','Voice','Whatsapp','resolve','map','lodash','./team.attributes','get','then'];(function(_0x391a0a,_0x2e7f43){var _0x46ed44=function(_0xded700){while(--_0xded700){_0x391a0a['push'](_0x391a0a['shift']());}};_0x46ed44(++_0x2e7f43);}(_0x2191,0xb7));var _0x1219=function(_0x42d400,_0x42cce3){_0x42d400=_0x42d400-0x0;var _0x35b691=_0x2191[_0x42d400];return _0x35b691;};'use strict';var _=require(_0x1219('0x0'));var attributes=require(_0x1219('0x1'));function getQueuesByChannel(_0x33192e,_0x217b6a){var _0x52746a=_0x1219('0x2')+_0x217b6a+'Queues';return _0x33192e[_0x52746a]()[_0x1219('0x3')](function(_0x128b2a){return _['map'](_0x128b2a,function(_0x22aa0d){_0x22aa0d[_0x1219('0x4')](_0x1219('0x5'),_0x217b6a);return _0x22aa0d;});})['catch'](function(_0xc8e142){throw _0xc8e142;});}module[_0x1219('0x6')]=function(_0x404969){return _0x404969[_0x1219('0x7')](_0x1219('0x8'),attributes,{'tableName':_0x1219('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x5175e9=this;var _0x7f1109=[_0x1219('0xa'),_0x1219('0xb'),_0x1219('0xc'),'Openchannel','Sms',_0x1219('0xd'),_0x1219('0xe')];return Promise[_0x1219('0xf')]()[_0x1219('0x3')](function(){var _0x56b1b2=_[_0x1219('0x10')](_0x7f1109,function(_0x197300){return getQueuesByChannel(_0x5175e9,_0x197300);});return Promise['all'](_0x56b1b2);})['catch'](function(_0x5952b3){throw _0x5952b3;});}}});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index 9eae893..0731b72 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 _0xfb1c=['then','info','Team,\x20%s,\x20%s','debug','Team,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','redis','defaults','socket.io-emitter','./team.socket','request'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xfb1c,0xd2));var _0xcfb1=function(_0x3e1393,_0x14070e){_0x3e1393=_0x3e1393-0x0;var _0x43fb7b=_0xfb1c[_0x3e1393];return _0x43fb7b;};'use strict';var _=require(_0xcfb1('0x0'));var util=require(_0xcfb1('0x1'));var moment=require(_0xcfb1('0x2'));var BPromise=require(_0xcfb1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcfb1('0x4'));var db=require(_0xcfb1('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xcfb1('0x6'))(_0xcfb1('0x7'));var config=require('../../config/environment');var jayson=require(_0xcfb1('0x8'));var client=jayson['client'][_0xcfb1('0x9')]({'port':0x232a});config[_0xcfb1('0xa')]=_[_0xcfb1('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xcfb1('0xc'))(new Redis(config[_0xcfb1('0xa')]));require(_0xcfb1('0xd'))['register'](socket);function respondWithRpcPromise(_0x2e09b3,_0x2d1a8,_0x37ef5f){return new BPromise(function(_0x11788c,_0x5dc48f){return client[_0xcfb1('0xe')](_0x2e09b3,_0x37ef5f)[_0xcfb1('0xf')](function(_0xbdd0c8){logger[_0xcfb1('0x10')](_0xcfb1('0x11'),_0x2d1a8,'request\x20sent');logger[_0xcfb1('0x12')](_0xcfb1('0x13'),_0x2d1a8,_0xcfb1('0x14'),JSON['stringify'](_0xbdd0c8));if(_0xbdd0c8[_0xcfb1('0x15')]){if(_0xbdd0c8['error'][_0xcfb1('0x16')]===0x1f4){logger[_0xcfb1('0x15')](_0xcfb1('0x11'),_0x2d1a8,_0xbdd0c8[_0xcfb1('0x15')][_0xcfb1('0x17')]);return _0x5dc48f(_0xbdd0c8['error'][_0xcfb1('0x17')]);}logger[_0xcfb1('0x15')](_0xcfb1('0x11'),_0x2d1a8,_0xbdd0c8[_0xcfb1('0x15')]['message']);return _0x11788c(_0xbdd0c8[_0xcfb1('0x15')][_0xcfb1('0x17')]);}else{logger['info'](_0xcfb1('0x11'),_0x2d1a8,'request\x20sent');_0x11788c(_0xbdd0c8[_0xcfb1('0x18')]['message']);}})['catch'](function(_0x3f34e3){logger[_0xcfb1('0x15')](_0xcfb1('0x11'),_0x2d1a8,_0x3f34e3);_0x5dc48f(_0x3f34e3);});});} \ No newline at end of file +var _0x85f0=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','localhost','./team.socket','register','request','then','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','Team,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0x144128,_0x5164a1){var _0x3e39d7=function(_0x1eec7f){while(--_0x1eec7f){_0x144128['push'](_0x144128['shift']());}};_0x3e39d7(++_0x5164a1);}(_0x85f0,0x6f));var _0x085f=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0x85f0[_0x25bea7];return _0x175952;};'use strict';var _=require(_0x085f('0x0'));var util=require(_0x085f('0x1'));var moment=require(_0x085f('0x2'));var BPromise=require(_0x085f('0x3'));var rs=require(_0x085f('0x4'));var fs=require('fs');var Redis=require(_0x085f('0x5'));var db=require(_0x085f('0x6'))['db'];var utils=require(_0x085f('0x7'));var logger=require(_0x085f('0x8'))(_0x085f('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x085f('0xa')][_0x085f('0xb')]({'port':0x232a});config[_0x085f('0xc')]=_['defaults'](config['redis'],{'host':_0x085f('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x085f('0xc')]));require(_0x085f('0xe'))[_0x085f('0xf')](socket);function respondWithRpcPromise(_0x17dc5b,_0x3c058b,_0x5df8d){return new BPromise(function(_0x26dbdf,_0x3e16bc){return client[_0x085f('0x10')](_0x17dc5b,_0x5df8d)[_0x085f('0x11')](function(_0x1af5c3){logger['info']('Team,\x20%s,\x20%s',_0x3c058b,_0x085f('0x12'));logger[_0x085f('0x13')](_0x085f('0x14'),_0x3c058b,'request\x20sent',JSON[_0x085f('0x15')](_0x1af5c3));if(_0x1af5c3[_0x085f('0x16')]){if(_0x1af5c3[_0x085f('0x16')][_0x085f('0x17')]===0x1f4){logger[_0x085f('0x16')](_0x085f('0x18'),_0x3c058b,_0x1af5c3[_0x085f('0x16')]['message']);return _0x3e16bc(_0x1af5c3[_0x085f('0x16')][_0x085f('0x19')]);}logger[_0x085f('0x16')]('Team,\x20%s,\x20%s',_0x3c058b,_0x1af5c3[_0x085f('0x16')]['message']);return _0x26dbdf(_0x1af5c3[_0x085f('0x16')][_0x085f('0x19')]);}else{logger['info'](_0x085f('0x18'),_0x3c058b,_0x085f('0x12'));_0x26dbdf(_0x1af5c3[_0x085f('0x1a')][_0x085f('0x19')]);}})[_0x085f('0x1b')](function(_0x17016b){logger[_0x085f('0x16')](_0x085f('0x18'),_0x3c058b,_0x17016b);_0x3e16bc(_0x17016b);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index f698bbb..3c9f19e 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 _0x69e6=['save','remove','update','emit','removeListener','register','length','team:'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x69e6,0x1e0));var _0x669e=function(_0x34a935,_0x3c0942){_0x34a935=_0x34a935-0x0;var _0x2dec4d=_0x69e6[_0x34a935];return _0x2dec4d;};'use strict';var TeamEvents=require('./team.events');var events=[_0x669e('0x0'),_0x669e('0x1'),_0x669e('0x2')];function createListener(_0x38be30,_0x75b8aa){return function(_0x4b8ed0){_0x75b8aa[_0x669e('0x3')](_0x38be30,_0x4b8ed0);};}function removeListener(_0x315a24,_0x426446){return function(){TeamEvents[_0x669e('0x4')](_0x315a24,_0x426446);};}exports[_0x669e('0x5')]=function(_0x1be88f){for(var _0x28f1d9=0x0,_0x132e5e=events[_0x669e('0x6')];_0x28f1d9<_0x132e5e;_0x28f1d9++){var _0x3cf0cf=events[_0x28f1d9];var _0x17323c=createListener(_0x669e('0x7')+_0x3cf0cf,_0x1be88f);TeamEvents['on'](_0x3cf0cf,_0x17323c);}}; \ No newline at end of file +var _0xe7e8=['remove','update','removeListener','register','length','save'];(function(_0x26e149,_0x18bd28){var _0x237c3d=function(_0x235627){while(--_0x235627){_0x26e149['push'](_0x26e149['shift']());}};_0x237c3d(++_0x18bd28);}(_0xe7e8,0xe3));var _0x8e7e=function(_0x4358f5,_0x5b1ac6){_0x4358f5=_0x4358f5-0x0;var _0x4d8104=_0xe7e8[_0x4358f5];return _0x4d8104;};'use strict';var TeamEvents=require('./team.events');var events=[_0x8e7e('0x0'),_0x8e7e('0x1'),_0x8e7e('0x2')];function createListener(_0x4e5f9b,_0x484e89){return function(_0x41affe){_0x484e89['emit'](_0x4e5f9b,_0x41affe);};}function removeListener(_0x2313de,_0x22edb0){return function(){TeamEvents[_0x8e7e('0x3')](_0x2313de,_0x22edb0);};}exports[_0x8e7e('0x4')]=function(_0x2ff8db){for(var _0x11183f=0x0,_0x11cdd0=events[_0x8e7e('0x5')];_0x11183f<_0x11cdd0;_0x11183f++){var _0x505978=events[_0x11183f];var _0x2b134f=createListener('team:'+_0x505978,_0x2ff8db);TeamEvents['on'](_0x505978,_0x2b134f);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index 16094e7..22deee0 100644 --- a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js +++ b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9802=['sequelize','INTEGER'];(function(_0x5fc718,_0x1aa597){var _0x148190=function(_0x59e0a0){while(--_0x59e0a0){_0x5fc718['push'](_0x5fc718['shift']());}};_0x148190(++_0x1aa597);}(_0x9802,0x112));var _0x2980=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x9802[_0x5d2803];return _0xdcad2c;};'use strict';var Sequelize=require(_0x2980('0x0'));module['exports']={'TeamId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0x2980('0x1')]}}; \ No newline at end of file +var _0xe5fb=['exports','INTEGER','sequelize'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0xe5fb,0xce));var _0xbe5f=function(_0x80d733,_0x266211){_0x80d733=_0x80d733-0x0;var _0x435868=_0xe5fb[_0x80d733];return _0x435868;};'use strict';var Sequelize=require(_0xbe5f('0x0'));module[_0xbe5f('0x1')]={'TeamId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0xbe5f('0x2')]}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index e67a550..93a7a9d 100644 --- a/server/api/teamVoicePrefix/teamVoicePrefix.model.js +++ b/server/api/teamVoicePrefix/teamVoicePrefix.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x09dd=['moment','bluebird','request-promise','path','rimraf','./teamVoicePrefix.attributes','define','lodash','util','../../config/logger','api'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0x09dd,0xb7));var _0xd09d=function(_0x5a99db,_0x1cece5){_0x5a99db=_0x5a99db-0x0;var _0x3aad62=_0x09dd[_0x5a99db];return _0x3aad62;};'use strict';var _=require(_0xd09d('0x0'));var util=require(_0xd09d('0x1'));var logger=require(_0xd09d('0x2'))(_0xd09d('0x3'));var moment=require(_0xd09d('0x4'));var BPromise=require(_0xd09d('0x5'));var rp=require(_0xd09d('0x6'));var fs=require('fs');var path=require(_0xd09d('0x7'));var rimraf=require(_0xd09d('0x8'));var config=require('../../config/environment');var attributes=require(_0xd09d('0x9'));module['exports']=function(_0x274db5,_0x535080){return _0x274db5[_0xd09d('0xa')]('TeamVoicePrefix',attributes,{'tableName':'team_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4171=['api','moment','bluebird','request-promise','path','../../config/environment','exports','define','TeamVoicePrefix','team_has_voice_prefixes','util','../../config/logger'];(function(_0x372f85,_0x5873bb){var _0x207cca=function(_0xdec6be){while(--_0xdec6be){_0x372f85['push'](_0x372f85['shift']());}};_0x207cca(++_0x5873bb);}(_0x4171,0x6a));var _0x1417=function(_0x1bbcb0,_0x9efeb3){_0x1bbcb0=_0x1bbcb0-0x0;var _0x36aeff=_0x4171[_0x1bbcb0];return _0x36aeff;};'use strict';var _=require('lodash');var util=require(_0x1417('0x0'));var logger=require(_0x1417('0x1'))(_0x1417('0x2'));var moment=require(_0x1417('0x3'));var BPromise=require(_0x1417('0x4'));var rp=require(_0x1417('0x5'));var fs=require('fs');var path=require(_0x1417('0x6'));var rimraf=require('rimraf');var config=require(_0x1417('0x7'));var attributes=require('./teamVoicePrefix.attributes');module[_0x1417('0x8')]=function(_0x51c955,_0x1d24e){return _0x51c955[_0x1417('0x9')](_0x1417('0xa'),attributes,{'tableName':_0x1417('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index 080b828..07b175c 100644 --- a/server/api/teamVoiceQueue/index.js +++ b/server/api/teamVoiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x3d73ba,_0x356e23){var _0x47e406=function(_0x90df31){while(--_0x90df31){_0x3d73ba['push'](_0x3d73ba['shift']());}};_0x47e406(++_0x356e23);}(_0xa9e0,0x123));var _0x0a9e=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xa9e0[_0x54d4fe];return _0x1ab5bb;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x437820,_0x2c5c38){var _0x5efaa8=function(_0x5048c2){while(--_0x5048c2){_0x437820['push'](_0x437820['shift']());}};_0x5efaa8(++_0x2c5c38);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x27d8bc,_0x19e010){_0x27d8bc=_0x27d8bc-0x0;var _0x4b04cb=_0xcb91[_0x27d8bc];return _0x4b04cb;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index 0648ec9..ca72dd1 100644 --- a/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js +++ b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4011=['exports','INTEGER'];(function(_0x41cdd2,_0x8585e){var _0x5e3bc5=function(_0x491130){while(--_0x491130){_0x41cdd2['push'](_0x41cdd2['shift']());}};_0x5e3bc5(++_0x8585e);}(_0x4011,0x142));var _0x1401=function(_0x9cd148,_0x5982a9){_0x9cd148=_0x9cd148-0x0;var _0x76a87f=_0x4011[_0x9cd148];return _0x76a87f;};'use strict';var Sequelize=require('sequelize');module[_0x1401('0x0')]={'penalty':{'type':Sequelize[_0x1401('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x4cd9=['INTEGER','sequelize','exports'];(function(_0x1345a6,_0x330524){var _0x5709e6=function(_0x51639b){while(--_0x51639b){_0x1345a6['push'](_0x1345a6['shift']());}};_0x5709e6(++_0x330524);}(_0x4cd9,0x13c));var _0x94cd=function(_0x310b6f,_0x839ec3){_0x310b6f=_0x310b6f-0x0;var _0x36182d=_0x4cd9[_0x310b6f];return _0x36182d;};'use strict';var Sequelize=require(_0x94cd('0x0'));module[_0x94cd('0x1')]={'penalty':{'type':Sequelize[_0x94cd('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.model.js b/server/api/teamVoiceQueue/teamVoiceQueue.model.js index 40076a1..d61b9fd 100644 --- a/server/api/teamVoiceQueue/teamVoiceQueue.model.js +++ b/server/api/teamVoiceQueue/teamVoiceQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x25b0=['bluebird','request-promise','path','rimraf','../../config/environment','exports','TeamVoiceQueue','team_has_voice_queues','lodash','util','../../config/logger','api','moment'];(function(_0x55f402,_0x4d3ca7){var _0x3eaedf=function(_0x26bb84){while(--_0x26bb84){_0x55f402['push'](_0x55f402['shift']());}};_0x3eaedf(++_0x4d3ca7);}(_0x25b0,0x140));var _0x025b=function(_0x153faa,_0x75f2a){_0x153faa=_0x153faa-0x0;var _0x43c32a=_0x25b0[_0x153faa];return _0x43c32a;};'use strict';var _=require(_0x025b('0x0'));var util=require(_0x025b('0x1'));var logger=require(_0x025b('0x2'))(_0x025b('0x3'));var moment=require(_0x025b('0x4'));var BPromise=require(_0x025b('0x5'));var rp=require(_0x025b('0x6'));var fs=require('fs');var path=require(_0x025b('0x7'));var rimraf=require(_0x025b('0x8'));var config=require(_0x025b('0x9'));var attributes=require('./teamVoiceQueue.attributes');module[_0x025b('0xa')]=function(_0x41b88b,_0x41d8a4){return _0x41b88b['define'](_0x025b('0xb'),attributes,{'tableName':_0x025b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x99e9=['util','../../config/logger','api','moment','request-promise','path','rimraf','./teamVoiceQueue.attributes','define','TeamVoiceQueue'];(function(_0x5c568b,_0xaa5457){var _0x4b744e=function(_0x10facf){while(--_0x10facf){_0x5c568b['push'](_0x5c568b['shift']());}};_0x4b744e(++_0xaa5457);}(_0x99e9,0xb4));var _0x999e=function(_0x46d0c9,_0x526bfa){_0x46d0c9=_0x46d0c9-0x0;var _0x174506=_0x99e9[_0x46d0c9];return _0x174506;};'use strict';var _=require('lodash');var util=require(_0x999e('0x0'));var logger=require(_0x999e('0x1'))(_0x999e('0x2'));var moment=require(_0x999e('0x3'));var BPromise=require('bluebird');var rp=require(_0x999e('0x4'));var fs=require('fs');var path=require(_0x999e('0x5'));var rimraf=require(_0x999e('0x6'));var config=require('../../config/environment');var attributes=require(_0x999e('0x7'));module['exports']=function(_0x25421f,_0x1bda0a){return _0x25421f[_0x999e('0x8')](_0x999e('0x9'),attributes,{'tableName':'team_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js b/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js index 34dc7f6..bbef725 100644 --- a/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js +++ b/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6e67=['TeamVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','TeamVoiceQueue,\x20%s,\x20%s'];(function(_0x3c59fc,_0x10dbd2){var _0x2b78d4=function(_0x5f161a){while(--_0x5f161a){_0x3c59fc['push'](_0x3c59fc['shift']());}};_0x2b78d4(++_0x10dbd2);}(_0x6e67,0x1f3));var _0x76e6=function(_0x42fd67,_0x5dbdfd){_0x42fd67=_0x42fd67-0x0;var _0x3293f5=_0x6e67[_0x42fd67];return _0x3293f5;};'use strict';var _=require(_0x76e6('0x0'));var util=require(_0x76e6('0x1'));var moment=require('moment');var BPromise=require(_0x76e6('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x76e6('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x76e6('0x4'));var logger=require(_0x76e6('0x5'))(_0x76e6('0x6'));var config=require('../../config/environment');var jayson=require(_0x76e6('0x7'));var client=jayson[_0x76e6('0x8')][_0x76e6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xa7d3e3,_0x56b1cb,_0x286e7b){return new BPromise(function(_0x1e35e0,_0x2fb1e3){return client[_0x76e6('0xa')](_0xa7d3e3,_0x286e7b)[_0x76e6('0xb')](function(_0x1af919){logger[_0x76e6('0xc')](_0x76e6('0xd'),_0x56b1cb,'request\x20sent');logger['debug'](_0x76e6('0xe'),_0x56b1cb,_0x76e6('0xf'),JSON['stringify'](_0x1af919));if(_0x1af919[_0x76e6('0x10')]){if(_0x1af919[_0x76e6('0x10')]['code']===0x1f4){logger[_0x76e6('0x10')](_0x76e6('0xd'),_0x56b1cb,_0x1af919[_0x76e6('0x10')][_0x76e6('0x11')]);return _0x2fb1e3(_0x1af919['error']['message']);}logger['error'](_0x76e6('0xd'),_0x56b1cb,_0x1af919['error'][_0x76e6('0x11')]);return _0x1e35e0(_0x1af919[_0x76e6('0x10')]['message']);}else{logger['info'](_0x76e6('0xd'),_0x56b1cb,_0x76e6('0xf'));_0x1e35e0(_0x1af919[_0x76e6('0x12')][_0x76e6('0x11')]);}})['catch'](function(_0x28ef7d){logger[_0x76e6('0x10')]('TeamVoiceQueue,\x20%s,\x20%s',_0x56b1cb,_0x28ef7d);_0x2fb1e3(_0x28ef7d);});});} \ No newline at end of file +var _0xe062=['client','http','request','then','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','TeamVoiceQueue,\x20%s,\x20%s','message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/logger','rpc'];(function(_0x2555d0,_0x4150a6){var _0x3bb486=function(_0x1eb89f){while(--_0x1eb89f){_0x2555d0['push'](_0x2555d0['shift']());}};_0x3bb486(++_0x4150a6);}(_0xe062,0xd5));var _0x2e06=function(_0x59c5d2,_0x27d656){_0x59c5d2=_0x59c5d2-0x0;var _0x52aa6f=_0xe062[_0x59c5d2];return _0x52aa6f;};'use strict';var _=require(_0x2e06('0x0'));var util=require(_0x2e06('0x1'));var moment=require('moment');var BPromise=require(_0x2e06('0x2'));var rs=require(_0x2e06('0x3'));var fs=require('fs');var Redis=require(_0x2e06('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2e06('0x5'))(_0x2e06('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2e06('0x7')][_0x2e06('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x52bf0a,_0x5747de,_0x255317){return new BPromise(function(_0x31645b,_0x8ede0e){return client[_0x2e06('0x9')](_0x52bf0a,_0x255317)[_0x2e06('0xa')](function(_0x2a2ee4){logger['info']('TeamVoiceQueue,\x20%s,\x20%s',_0x5747de,_0x2e06('0xb'));logger[_0x2e06('0xc')](_0x2e06('0xd'),_0x5747de,'request\x20sent',JSON[_0x2e06('0xe')](_0x2a2ee4));if(_0x2a2ee4[_0x2e06('0xf')]){if(_0x2a2ee4[_0x2e06('0xf')][_0x2e06('0x10')]===0x1f4){logger['error'](_0x2e06('0x11'),_0x5747de,_0x2a2ee4[_0x2e06('0xf')]['message']);return _0x8ede0e(_0x2a2ee4[_0x2e06('0xf')][_0x2e06('0x12')]);}logger['error'](_0x2e06('0x11'),_0x5747de,_0x2a2ee4[_0x2e06('0xf')][_0x2e06('0x12')]);return _0x31645b(_0x2a2ee4[_0x2e06('0xf')][_0x2e06('0x12')]);}else{logger[_0x2e06('0x13')]('TeamVoiceQueue,\x20%s,\x20%s',_0x5747de,_0x2e06('0xb'));_0x31645b(_0x2a2ee4[_0x2e06('0x14')][_0x2e06('0x12')]);}})[_0x2e06('0x15')](function(_0x41d1fc){logger[_0x2e06('0xf')](_0x2e06('0x11'),_0x5747de,_0x41d1fc);_0x8ede0e(_0x41d1fc);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index d0019ef..f4ed551 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 _0xd2f5=['path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./template.controller','isAuthenticated','index','get','show','post','put','/:id','update','delete','destroy','exports','multer','util'];(function(_0x14335b,_0xfce02e){var _0x4acf04=function(_0x52089b){while(--_0x52089b){_0x14335b['push'](_0x14335b['shift']());}};_0x4acf04(++_0xfce02e);}(_0xd2f5,0x12e));var _0x5d2f=function(_0x4cd189,_0x2985cd){_0x4cd189=_0x4cd189-0x0;var _0x3c5c95=_0xd2f5[_0x4cd189];return _0x3c5c95;};'use strict';var multer=require(_0x5d2f('0x0'));var util=require(_0x5d2f('0x1'));var path=require(_0x5d2f('0x2'));var timeout=require(_0x5d2f('0x3'));var express=require('express');var router=express[_0x5d2f('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x5d2f('0x5'));var config=require(_0x5d2f('0x6'));var controller=require(_0x5d2f('0x7'));router['get']('/',auth[_0x5d2f('0x8')](),controller[_0x5d2f('0x9')]);router[_0x5d2f('0xa')]('/:id',auth[_0x5d2f('0x8')](),controller[_0x5d2f('0xb')]);router[_0x5d2f('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x5d2f('0xd')](_0x5d2f('0xe'),auth['isAuthenticated'](),controller[_0x5d2f('0xf')]);router[_0x5d2f('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x5d2f('0x11')]);module[_0x5d2f('0x12')]=router; \ No newline at end of file +var _0x2ff5=['/:id','show','post','create','put','update','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x3cb09b,_0x31c2a5){var _0x242048=function(_0x464aba){while(--_0x464aba){_0x3cb09b['push'](_0x3cb09b['shift']());}};_0x242048(++_0x31c2a5);}(_0x2ff5,0x1d5));var _0x52ff=function(_0x382eb3,_0x25c58){_0x382eb3=_0x382eb3-0x0;var _0x2ab29a=_0x2ff5[_0x382eb3];return _0x2ab29a;};'use strict';var multer=require('multer');var util=require(_0x52ff('0x0'));var path=require(_0x52ff('0x1'));var timeout=require('connect-timeout');var express=require(_0x52ff('0x2'));var router=express[_0x52ff('0x3')]();var fs_extra=require(_0x52ff('0x4'));var auth=require(_0x52ff('0x5'));var interaction=require(_0x52ff('0x6'));var config=require(_0x52ff('0x7'));var controller=require('./template.controller');router[_0x52ff('0x8')]('/',auth[_0x52ff('0x9')](),controller[_0x52ff('0xa')]);router['get'](_0x52ff('0xb'),auth[_0x52ff('0x9')](),controller[_0x52ff('0xc')]);router[_0x52ff('0xd')]('/',auth[_0x52ff('0x9')](),controller[_0x52ff('0xe')]);router[_0x52ff('0xf')](_0x52ff('0xb'),auth[_0x52ff('0x9')](),controller[_0x52ff('0x10')]);router[_0x52ff('0x11')](_0x52ff('0xb'),auth[_0x52ff('0x9')](),controller[_0x52ff('0x12')]);module[_0x52ff('0x13')]=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index fc4111c..8b970af 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 _0xd2de=['STRING','TEXT','sequelize','exports'];(function(_0x192d3d,_0x18dd72){var _0x27991f=function(_0x25516e){while(--_0x25516e){_0x192d3d['push'](_0x192d3d['shift']());}};_0x27991f(++_0x18dd72);}(_0xd2de,0x16a));var _0xed2d=function(_0x454b8a,_0x9b58e3){_0x454b8a=_0x454b8a-0x0;var _0x50bcef=_0xd2de[_0x454b8a];return _0x50bcef;};'use strict';var Sequelize=require(_0xed2d('0x0'));module[_0xed2d('0x1')]={'name':{'type':Sequelize[_0xed2d('0x2')]},'description':{'type':Sequelize[_0xed2d('0x2')]},'html':{'type':Sequelize[_0xed2d('0x3')]}}; \ No newline at end of file +var _0x77cf=['TEXT','STRING'];(function(_0x561292,_0xe75afb){var _0x5f30b1=function(_0x296f93){while(--_0x296f93){_0x561292['push'](_0x561292['shift']());}};_0x5f30b1(++_0xe75afb);}(_0x77cf,0xef));var _0xf77c=function(_0x204c3a,_0x5b0deb){_0x204c3a=_0x204c3a-0x0;var _0x126f27=_0x77cf[_0x204c3a];return _0x126f27;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xf77c('0x0')]},'description':{'type':Sequelize[_0xf77c('0x0')]},'html':{'type':Sequelize[_0xf77c('0x1')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 8d6eb8f..400df41 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 _0xd1ef=['sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Templates','UserProfileResource','sendStatus','error','stack','name','send','index','map','Template','rawAttributes','fieldName','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','params','options','create','body','user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x5d82b8,_0x16973b){var _0x567a00=function(_0x56fb47){while(--_0x56fb47){_0x5d82b8['push'](_0x5d82b8['shift']());}};_0x567a00(++_0x16973b);}(_0xd1ef,0xfd));var _0xfd1e=function(_0x40d7de,_0x8b98ab){_0x40d7de=_0x40d7de-0x0;var _0x4a74ce=_0xd1ef[_0x40d7de];return _0x4a74ce;};'use strict';var emlformat=require(_0xfd1e('0x0'));var rimraf=require(_0xfd1e('0x1'));var zipdir=require(_0xfd1e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfd1e('0x3'));var moment=require(_0xfd1e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xfd1e('0x5'));var util=require(_0xfd1e('0x6'));var path=require(_0xfd1e('0x7'));var sox=require(_0xfd1e('0x8'));var csv=require(_0xfd1e('0x9'));var ejs=require(_0xfd1e('0xa'));var fs=require('fs');var fs_extra=require(_0xfd1e('0xb'));var _=require(_0xfd1e('0xc'));var squel=require(_0xfd1e('0xd'));var crypto=require(_0xfd1e('0xe'));var jsforce=require(_0xfd1e('0xf'));var deskjs=require(_0xfd1e('0x10'));var toCsv=require('to-csv');var querystring=require(_0xfd1e('0x11'));var Papa=require(_0xfd1e('0x12'));var Redis=require('ioredis');var authService=require(_0xfd1e('0x13'));var qs=require(_0xfd1e('0x14'));var as=require(_0xfd1e('0x15'));var hardwareService=require(_0xfd1e('0x16'));var logger=require(_0xfd1e('0x17'))(_0xfd1e('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x8a6555,_0x2034e6){_0x2034e6=_0x2034e6||0xcc;return function(_0x5801b0){if(_0x5801b0){return _0x8a6555['sendStatus'](_0x2034e6);}return _0x8a6555[_0xfd1e('0x19')](_0x2034e6)[_0xfd1e('0x1a')]();};}function respondWithResult(_0x4cb06e,_0x51f51c){_0x51f51c=_0x51f51c||0xc8;return function(_0x342b2f){if(_0x342b2f){return _0x4cb06e[_0xfd1e('0x19')](_0x51f51c)[_0xfd1e('0x1b')](_0x342b2f);}};}function respondWithFilteredResult(_0x2958cc,_0x229c84){return function(_0x101ed1){if(_0x101ed1){var _0x33a33d=typeof _0x229c84[_0xfd1e('0x1c')]==='undefined'&&typeof _0x229c84[_0xfd1e('0x1d')]===_0xfd1e('0x1e');var _0x8a2dfa=_0x101ed1['count'];var _0x3d6203=_0x33a33d?0x0:_0x229c84[_0xfd1e('0x1c')];var _0x15ac85=_0x33a33d?_0x101ed1[_0xfd1e('0x1f')]:_0x229c84[_0xfd1e('0x1c')]+_0x229c84['limit'];var _0x3a2388;if(_0x15ac85>=_0x8a2dfa){_0x15ac85=_0x8a2dfa;_0x3a2388=0xc8;}else{_0x3a2388=0xce;}_0x2958cc[_0xfd1e('0x19')](_0x3a2388);return _0x2958cc[_0xfd1e('0x20')](_0xfd1e('0x21'),_0x3d6203+'-'+_0x15ac85+'/'+_0x8a2dfa)['json'](_0x101ed1);}return null;};}function patchUpdates(_0x5bf5a5){return function(_0x5e2c0d){try{jsonpatch[_0xfd1e('0x22')](_0x5e2c0d,_0x5bf5a5,!![]);}catch(_0x33ce70){return BPromise[_0xfd1e('0x23')](_0x33ce70);}return _0x5e2c0d[_0xfd1e('0x24')]();};}function saveUpdates(_0x4db1de,_0x1b4529){return function(_0x110cfa){if(_0x110cfa){return _0x110cfa[_0xfd1e('0x25')](_0x4db1de)[_0xfd1e('0x26')](function(_0x2a7006){return _0x2a7006;});}return null;};}function removeEntity(_0x2f5f67,_0xc4d11b){return function(_0x5a7eff){if(_0x5a7eff){return _0x5a7eff[_0xfd1e('0x27')]()[_0xfd1e('0x26')](function(){var _0x209702=_0x5a7eff[_0xfd1e('0x28')]({'plain':!![]});var _0x5baf8c=_0xfd1e('0x29');return db[_0xfd1e('0x2a')][_0xfd1e('0x27')]({'where':{'type':_0x5baf8c,'resourceId':_0x209702['id']}})[_0xfd1e('0x26')](function(){return _0x5a7eff;});})[_0xfd1e('0x26')](function(){_0x2f5f67['status'](0xcc)[_0xfd1e('0x1a')]();});}};}function handleEntityNotFound(_0x3f5e44,_0x1ce5f0){return function(_0x4ba707){if(!_0x4ba707){_0x3f5e44[_0xfd1e('0x2b')](0x194);}return _0x4ba707;};}function handleError(_0x1bf5e2,_0x334a82){_0x334a82=_0x334a82||0x1f4;return function(_0x86c154){logger[_0xfd1e('0x2c')](_0x86c154[_0xfd1e('0x2d')]);if(_0x86c154['name']){delete _0x86c154[_0xfd1e('0x2e')];}_0x1bf5e2[_0xfd1e('0x19')](_0x334a82)[_0xfd1e('0x2f')](_0x86c154);};}exports[_0xfd1e('0x30')]=function(_0x2494c0,_0x4356c9){var _0x10684a={},_0x479de7={},_0x3d79b8={'count':0x0,'rows':[]};var _0x2907c7=_[_0xfd1e('0x31')](db[_0xfd1e('0x32')][_0xfd1e('0x33')],function(_0x25bdab){return{'name':_0x25bdab[_0xfd1e('0x34')],'type':_0x25bdab['type'][_0xfd1e('0x35')]};});_0x479de7[_0xfd1e('0x36')]=_['map'](_0x2907c7,'name');_0x479de7['query']=_[_0xfd1e('0x37')](_0x2494c0[_0xfd1e('0x38')]);_0x479de7[_0xfd1e('0x39')]=_['intersection'](_0x479de7[_0xfd1e('0x36')],_0x479de7[_0xfd1e('0x38')]);_0x10684a[_0xfd1e('0x3a')]=_[_0xfd1e('0x3b')](_0x479de7[_0xfd1e('0x36')],qs[_0xfd1e('0x3c')](_0x2494c0[_0xfd1e('0x38')]['fields']));_0x10684a['attributes']=_0x10684a[_0xfd1e('0x3a')][_0xfd1e('0x3d')]?_0x10684a[_0xfd1e('0x3a')]:_0x479de7['model'];if(!_0x2494c0[_0xfd1e('0x38')][_0xfd1e('0x3e')](_0xfd1e('0x3f'))){_0x10684a[_0xfd1e('0x1d')]=qs[_0xfd1e('0x1d')](_0x2494c0[_0xfd1e('0x38')][_0xfd1e('0x1d')]);_0x10684a[_0xfd1e('0x1c')]=qs['offset'](_0x2494c0[_0xfd1e('0x38')]['offset']);}_0x10684a[_0xfd1e('0x40')]=qs[_0xfd1e('0x41')](_0x2494c0[_0xfd1e('0x38')]['sort']);_0x10684a['where']=qs['filters'](_[_0xfd1e('0x42')](_0x2494c0[_0xfd1e('0x38')],_0x479de7[_0xfd1e('0x39')]),_0x2907c7);if(_0x2494c0[_0xfd1e('0x38')][_0xfd1e('0x43')]){_0x10684a[_0xfd1e('0x44')]=_[_0xfd1e('0x45')](_0x10684a[_0xfd1e('0x44')],{'$or':_[_0xfd1e('0x31')](_0x2907c7,function(_0x11a781){if(_0x11a781[_0xfd1e('0x46')]!==_0xfd1e('0x47')){var _0x4ebc03={};_0x4ebc03[_0x11a781[_0xfd1e('0x2e')]]={'$like':'%'+_0x2494c0[_0xfd1e('0x38')][_0xfd1e('0x43')]+'%'};return _0x4ebc03;}})});}_0x10684a=_['merge']({},_0x10684a,_0x2494c0['options']);var _0x543bdc={'where':_0x10684a[_0xfd1e('0x44')]};return db[_0xfd1e('0x32')][_0xfd1e('0x1f')](_0x543bdc)[_0xfd1e('0x26')](function(_0x1adba1){_0x3d79b8[_0xfd1e('0x1f')]=_0x1adba1;if(_0x2494c0['query'][_0xfd1e('0x48')]){_0x10684a[_0xfd1e('0x49')]=[{'all':!![]}];}return db[_0xfd1e('0x32')][_0xfd1e('0x4a')](_0x10684a);})[_0xfd1e('0x26')](function(_0x5f0c58){_0x3d79b8[_0xfd1e('0x4b')]=_0x5f0c58;return _0x3d79b8;})[_0xfd1e('0x26')](respondWithFilteredResult(_0x4356c9,_0x10684a))[_0xfd1e('0x4c')](handleError(_0x4356c9,null));};exports['show']=function(_0x19f27a,_0xb44598){var _0x1f7feb={'raw':!![],'where':{'id':_0x19f27a[_0xfd1e('0x4d')]['id']}},_0x5a98ac={};_0x5a98ac[_0xfd1e('0x36')]=_['keys'](db[_0xfd1e('0x32')][_0xfd1e('0x33')]);_0x5a98ac[_0xfd1e('0x38')]=_[_0xfd1e('0x37')](_0x19f27a[_0xfd1e('0x38')]);_0x5a98ac['filters']=_[_0xfd1e('0x3b')](_0x5a98ac[_0xfd1e('0x36')],_0x5a98ac[_0xfd1e('0x38')]);_0x1f7feb['attributes']=_[_0xfd1e('0x3b')](_0x5a98ac[_0xfd1e('0x36')],qs[_0xfd1e('0x3c')](_0x19f27a['query']['fields']));_0x1f7feb[_0xfd1e('0x3a')]=_0x1f7feb[_0xfd1e('0x3a')]['length']?_0x1f7feb[_0xfd1e('0x3a')]:_0x5a98ac[_0xfd1e('0x36')];if(_0x19f27a['query'][_0xfd1e('0x48')]){_0x1f7feb[_0xfd1e('0x49')]=[{'all':!![]}];}_0x1f7feb=_[_0xfd1e('0x45')]({},_0x1f7feb,_0x19f27a[_0xfd1e('0x4e')]);return db[_0xfd1e('0x32')]['find'](_0x1f7feb)[_0xfd1e('0x26')](handleEntityNotFound(_0xb44598,null))[_0xfd1e('0x26')](respondWithResult(_0xb44598,null))[_0xfd1e('0x4c')](handleError(_0xb44598,null));};exports[_0xfd1e('0x4f')]=function(_0x544d23,_0x5bf189){return db[_0xfd1e('0x32')][_0xfd1e('0x4f')](_0x544d23[_0xfd1e('0x50')],{})['then'](function(_0x41b51e){var _0x51f27e=_0x544d23[_0xfd1e('0x51')][_0xfd1e('0x28')]({'plain':!![]});if(!_0x51f27e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x51f27e['role']===_0xfd1e('0x51')){var _0x21950c=_0x41b51e[_0xfd1e('0x28')]({'plain':!![]});var _0x3f1518='Templates';return db[_0xfd1e('0x52')][_0xfd1e('0x53')]({'where':{'name':_0x3f1518,'userProfileId':_0x51f27e[_0xfd1e('0x54')]},'raw':!![]})[_0xfd1e('0x26')](function(_0xd5d813){if(_0xd5d813&&_0xd5d813[_0xfd1e('0x55')]===0x0){return db[_0xfd1e('0x2a')][_0xfd1e('0x4f')]({'name':_0x21950c[_0xfd1e('0x2e')],'resourceId':_0x21950c['id'],'type':_0xd5d813[_0xfd1e('0x2e')],'sectionId':_0xd5d813['id']},{})['then'](function(){return _0x41b51e;});}else{return _0x41b51e;}})['catch'](function(_0x23b7d0){logger[_0xfd1e('0x2c')](_0xfd1e('0x56'),_0x23b7d0);throw _0x23b7d0;});}return _0x41b51e;})[_0xfd1e('0x26')](respondWithResult(_0x5bf189,0xc9))['catch'](handleError(_0x5bf189,null));};exports[_0xfd1e('0x25')]=function(_0x15a290,_0x1d51b1){if(_0x15a290[_0xfd1e('0x50')]['id']){delete _0x15a290[_0xfd1e('0x50')]['id'];}return db[_0xfd1e('0x32')][_0xfd1e('0x53')]({'where':{'id':_0x15a290['params']['id']}})[_0xfd1e('0x26')](handleEntityNotFound(_0x1d51b1,null))[_0xfd1e('0x26')](saveUpdates(_0x15a290[_0xfd1e('0x50')],null))[_0xfd1e('0x26')](respondWithResult(_0x1d51b1,null))['catch'](handleError(_0x1d51b1,null));};exports[_0xfd1e('0x27')]=function(_0x624794,_0x659fc2){return db['Template']['find']({'where':{'id':_0x624794[_0xfd1e('0x4d')]['id']}})['then'](handleEntityNotFound(_0x659fc2,null))[_0xfd1e('0x26')](removeEntity(_0x659fc2,null))['catch'](handleError(_0x659fc2,null));}; \ No newline at end of file +var _0xb776=['fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','includeAll','find','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','create','update','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','to-csv','ejs','fs-extra','squel','crypto','jsforce','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','count','limit','set','Content-Range','json','apply','destroy','then','Templates','end','sendStatus','error','name','send','map','Template','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb776,0xbe));var _0x6b77=function(_0x2b86e0,_0x1f63d4){_0x2b86e0=_0x2b86e0-0x0;var _0x57a252=_0xb776[_0x2b86e0];return _0x57a252;};'use strict';var emlformat=require(_0x6b77('0x0'));var rimraf=require(_0x6b77('0x1'));var zipdir=require(_0x6b77('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6b77('0x3'));var moment=require(_0x6b77('0x4'));var BPromise=require(_0x6b77('0x5'));var Mustache=require(_0x6b77('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x6b77('0x7'));var ejs=require(_0x6b77('0x8'));var fs=require('fs');var fs_extra=require(_0x6b77('0x9'));var _=require('lodash');var squel=require(_0x6b77('0xa'));var crypto=require(_0x6b77('0xb'));var jsforce=require(_0x6b77('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x6b77('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6b77('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x6b77('0xe'));var hardwareService=require(_0x6b77('0xf'));var logger=require(_0x6b77('0x10'))(_0x6b77('0x11'));var utils=require(_0x6b77('0x12'));var config=require(_0x6b77('0x13'));var licenseUtil=require(_0x6b77('0x14'));var db=require(_0x6b77('0x15'))['db'];function respondWithStatusCode(_0xc54cf7,_0x23b4b1){_0x23b4b1=_0x23b4b1||0xcc;return function(_0x257755){if(_0x257755){return _0xc54cf7['sendStatus'](_0x23b4b1);}return _0xc54cf7['status'](_0x23b4b1)['end']();};}function respondWithResult(_0x138877,_0x54f7ab){_0x54f7ab=_0x54f7ab||0xc8;return function(_0x1f775a){if(_0x1f775a){return _0x138877[_0x6b77('0x16')](_0x54f7ab)['json'](_0x1f775a);}};}function respondWithFilteredResult(_0x5e617b,_0x4d0799){return function(_0x94aa7f){if(_0x94aa7f){var _0x383818=typeof _0x4d0799[_0x6b77('0x17')]===_0x6b77('0x18')&&typeof _0x4d0799['limit']===_0x6b77('0x18');var _0x406209=_0x94aa7f[_0x6b77('0x19')];var _0x52e74d=_0x383818?0x0:_0x4d0799['offset'];var _0x3537db=_0x383818?_0x94aa7f[_0x6b77('0x19')]:_0x4d0799[_0x6b77('0x17')]+_0x4d0799[_0x6b77('0x1a')];var _0x9743c9;if(_0x3537db>=_0x406209){_0x3537db=_0x406209;_0x9743c9=0xc8;}else{_0x9743c9=0xce;}_0x5e617b[_0x6b77('0x16')](_0x9743c9);return _0x5e617b[_0x6b77('0x1b')](_0x6b77('0x1c'),_0x52e74d+'-'+_0x3537db+'/'+_0x406209)[_0x6b77('0x1d')](_0x94aa7f);}return null;};}function patchUpdates(_0x256572){return function(_0x175fa5){try{jsonpatch[_0x6b77('0x1e')](_0x175fa5,_0x256572,!![]);}catch(_0x1ef6cb){return BPromise['reject'](_0x1ef6cb);}return _0x175fa5['save']();};}function saveUpdates(_0x3c95da,_0x1f0dad){return function(_0x1f072a){if(_0x1f072a){return _0x1f072a['update'](_0x3c95da)['then'](function(_0x26d425){return _0x26d425;});}return null;};}function removeEntity(_0x25148d,_0x2a1b6e){return function(_0x3a9c4b){if(_0x3a9c4b){return _0x3a9c4b[_0x6b77('0x1f')]()[_0x6b77('0x20')](function(){var _0x2973c5=_0x3a9c4b['get']({'plain':!![]});var _0x3b52fc=_0x6b77('0x21');return db['UserProfileResource']['destroy']({'where':{'type':_0x3b52fc,'resourceId':_0x2973c5['id']}})[_0x6b77('0x20')](function(){return _0x3a9c4b;});})['then'](function(){_0x25148d[_0x6b77('0x16')](0xcc)[_0x6b77('0x22')]();});}};}function handleEntityNotFound(_0x3d9572,_0xb12c40){return function(_0x58df5e){if(!_0x58df5e){_0x3d9572[_0x6b77('0x23')](0x194);}return _0x58df5e;};}function handleError(_0x155e6b,_0x5f5b56){_0x5f5b56=_0x5f5b56||0x1f4;return function(_0x2b26b0){logger[_0x6b77('0x24')](_0x2b26b0['stack']);if(_0x2b26b0['name']){delete _0x2b26b0[_0x6b77('0x25')];}_0x155e6b[_0x6b77('0x16')](_0x5f5b56)[_0x6b77('0x26')](_0x2b26b0);};}exports['index']=function(_0xddb265,_0x5c1082){var _0x107bab={},_0x402446={},_0x373450={'count':0x0,'rows':[]};var _0x4db3d3=_[_0x6b77('0x27')](db[_0x6b77('0x28')][_0x6b77('0x29')],function(_0x5dee99){return{'name':_0x5dee99[_0x6b77('0x2a')],'type':_0x5dee99['type'][_0x6b77('0x2b')]};});_0x402446[_0x6b77('0x2c')]=_['map'](_0x4db3d3,_0x6b77('0x25'));_0x402446[_0x6b77('0x2d')]=_[_0x6b77('0x2e')](_0xddb265[_0x6b77('0x2d')]);_0x402446[_0x6b77('0x2f')]=_[_0x6b77('0x30')](_0x402446[_0x6b77('0x2c')],_0x402446[_0x6b77('0x2d')]);_0x107bab[_0x6b77('0x31')]=_[_0x6b77('0x30')](_0x402446[_0x6b77('0x2c')],qs[_0x6b77('0x32')](_0xddb265['query'][_0x6b77('0x32')]));_0x107bab[_0x6b77('0x31')]=_0x107bab['attributes'][_0x6b77('0x33')]?_0x107bab[_0x6b77('0x31')]:_0x402446[_0x6b77('0x2c')];if(!_0xddb265[_0x6b77('0x2d')][_0x6b77('0x34')](_0x6b77('0x35'))){_0x107bab['limit']=qs['limit'](_0xddb265[_0x6b77('0x2d')][_0x6b77('0x1a')]);_0x107bab['offset']=qs[_0x6b77('0x17')](_0xddb265[_0x6b77('0x2d')][_0x6b77('0x17')]);}_0x107bab[_0x6b77('0x36')]=qs[_0x6b77('0x37')](_0xddb265['query']['sort']);_0x107bab['where']=qs[_0x6b77('0x2f')](_[_0x6b77('0x38')](_0xddb265[_0x6b77('0x2d')],_0x402446[_0x6b77('0x2f')]),_0x4db3d3);if(_0xddb265[_0x6b77('0x2d')]['filter']){_0x107bab[_0x6b77('0x39')]=_[_0x6b77('0x3a')](_0x107bab[_0x6b77('0x39')],{'$or':_[_0x6b77('0x27')](_0x4db3d3,function(_0x346312){if(_0x346312['type']!==_0x6b77('0x3b')){var _0x15ddc9={};_0x15ddc9[_0x346312[_0x6b77('0x25')]]={'$like':'%'+_0xddb265[_0x6b77('0x2d')][_0x6b77('0x3c')]+'%'};return _0x15ddc9;}})});}_0x107bab=_['merge']({},_0x107bab,_0xddb265[_0x6b77('0x3d')]);var _0x3a42cf={'where':_0x107bab[_0x6b77('0x39')]};return db[_0x6b77('0x28')][_0x6b77('0x19')](_0x3a42cf)[_0x6b77('0x20')](function(_0x5b2b6e){_0x373450['count']=_0x5b2b6e;if(_0xddb265[_0x6b77('0x2d')]['includeAll']){_0x107bab[_0x6b77('0x3e')]=[{'all':!![]}];}return db[_0x6b77('0x28')][_0x6b77('0x3f')](_0x107bab);})[_0x6b77('0x20')](function(_0x3ecbc3){_0x373450[_0x6b77('0x40')]=_0x3ecbc3;return _0x373450;})[_0x6b77('0x20')](respondWithFilteredResult(_0x5c1082,_0x107bab))[_0x6b77('0x41')](handleError(_0x5c1082,null));};exports[_0x6b77('0x42')]=function(_0x108076,_0x589348){var _0x375077={'raw':!![],'where':{'id':_0x108076[_0x6b77('0x43')]['id']}},_0x211776={};_0x211776[_0x6b77('0x2c')]=_[_0x6b77('0x2e')](db[_0x6b77('0x28')][_0x6b77('0x29')]);_0x211776[_0x6b77('0x2d')]=_[_0x6b77('0x2e')](_0x108076['query']);_0x211776[_0x6b77('0x2f')]=_[_0x6b77('0x30')](_0x211776[_0x6b77('0x2c')],_0x211776[_0x6b77('0x2d')]);_0x375077[_0x6b77('0x31')]=_[_0x6b77('0x30')](_0x211776[_0x6b77('0x2c')],qs[_0x6b77('0x32')](_0x108076[_0x6b77('0x2d')][_0x6b77('0x32')]));_0x375077[_0x6b77('0x31')]=_0x375077[_0x6b77('0x31')][_0x6b77('0x33')]?_0x375077[_0x6b77('0x31')]:_0x211776[_0x6b77('0x2c')];if(_0x108076[_0x6b77('0x2d')][_0x6b77('0x44')]){_0x375077[_0x6b77('0x3e')]=[{'all':!![]}];}_0x375077=_[_0x6b77('0x3a')]({},_0x375077,_0x108076[_0x6b77('0x3d')]);return db[_0x6b77('0x28')][_0x6b77('0x45')](_0x375077)['then'](handleEntityNotFound(_0x589348,null))[_0x6b77('0x20')](respondWithResult(_0x589348,null))[_0x6b77('0x41')](handleError(_0x589348,null));};exports['create']=function(_0x450878,_0x5796f0){return db['Template']['create'](_0x450878[_0x6b77('0x46')],{})[_0x6b77('0x20')](function(_0x2292dc){var _0xf0f2d7=_0x450878[_0x6b77('0x47')][_0x6b77('0x48')]({'plain':!![]});if(!_0xf0f2d7)throw new Error(_0x6b77('0x49'));if(_0xf0f2d7[_0x6b77('0x4a')]==='user'){var _0x20960f=_0x2292dc[_0x6b77('0x48')]({'plain':!![]});var _0x2750c3='Templates';return db[_0x6b77('0x4b')][_0x6b77('0x45')]({'where':{'name':_0x2750c3,'userProfileId':_0xf0f2d7[_0x6b77('0x4c')]},'raw':!![]})[_0x6b77('0x20')](function(_0x10273b){if(_0x10273b&&_0x10273b['autoAssociation']===0x0){return db[_0x6b77('0x4d')][_0x6b77('0x4e')]({'name':_0x20960f['name'],'resourceId':_0x20960f['id'],'type':_0x10273b[_0x6b77('0x25')],'sectionId':_0x10273b['id']},{})[_0x6b77('0x20')](function(){return _0x2292dc;});}else{return _0x2292dc;}})[_0x6b77('0x41')](function(_0x2aa33e){logger[_0x6b77('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2aa33e);throw _0x2aa33e;});}return _0x2292dc;})[_0x6b77('0x20')](respondWithResult(_0x5796f0,0xc9))['catch'](handleError(_0x5796f0,null));};exports[_0x6b77('0x4f')]=function(_0xca0701,_0x2a5fad){if(_0xca0701['body']['id']){delete _0xca0701[_0x6b77('0x46')]['id'];}return db[_0x6b77('0x28')][_0x6b77('0x45')]({'where':{'id':_0xca0701[_0x6b77('0x43')]['id']}})[_0x6b77('0x20')](handleEntityNotFound(_0x2a5fad,null))['then'](saveUpdates(_0xca0701['body'],null))[_0x6b77('0x20')](respondWithResult(_0x2a5fad,null))[_0x6b77('0x41')](handleError(_0x2a5fad,null));};exports[_0x6b77('0x1f')]=function(_0x5afb93,_0x1edcbb){return db['Template'][_0x6b77('0x45')]({'where':{'id':_0x5afb93['params']['id']}})[_0x6b77('0x20')](handleEntityNotFound(_0x1edcbb,null))[_0x6b77('0x20')](removeEntity(_0x1edcbb,null))[_0x6b77('0x41')](handleError(_0x1edcbb,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index c83bfff..5242b03 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 _0x0e88=['../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./template.attributes','exports','tools_templates','util'];(function(_0xe71c9,_0x38f8b7){var _0x503e16=function(_0x5cf8da){while(--_0x5cf8da){_0xe71c9['push'](_0xe71c9['shift']());}};_0x503e16(++_0x38f8b7);}(_0x0e88,0x12b));var _0x80e8=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x0e88[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var util=require(_0x80e8('0x0'));var logger=require(_0x80e8('0x1'))(_0x80e8('0x2'));var moment=require(_0x80e8('0x3'));var BPromise=require(_0x80e8('0x4'));var rp=require(_0x80e8('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x80e8('0x6'));var attributes=require(_0x80e8('0x7'));module[_0x80e8('0x8')]=function(_0x264f34,_0x390778){return _0x264f34['define']('Template',attributes,{'tableName':_0x80e8('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7afd=['exports','define','Template','tools_templates','lodash','../../config/logger','api','moment','path','rimraf','../../config/environment','./template.attributes'];(function(_0x3c6b7d,_0x5f0d90){var _0x1d3ed2=function(_0x1a8f35){while(--_0x1a8f35){_0x3c6b7d['push'](_0x3c6b7d['shift']());}};_0x1d3ed2(++_0x5f0d90);}(_0x7afd,0x64));var _0xd7af=function(_0x333fc8,_0x2b292c){_0x333fc8=_0x333fc8-0x0;var _0x432439=_0x7afd[_0x333fc8];return _0x432439;};'use strict';var _=require(_0xd7af('0x0'));var util=require('util');var logger=require(_0xd7af('0x1'))(_0xd7af('0x2'));var moment=require(_0xd7af('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd7af('0x4'));var rimraf=require(_0xd7af('0x5'));var config=require(_0xd7af('0x6'));var attributes=require(_0xd7af('0x7'));module[_0xd7af('0x8')]=function(_0x3bd3c0,_0x4e9c63){return _0x3bd3c0[_0xd7af('0x9')](_0xd7af('0xa'),attributes,{'tableName':_0xd7af('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 5f010d6..163ab24 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 _0x5521=['findAll','options','where','attributes','include','map','model','catch','util','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Template,\x20%s,\x20%s','debug','Template,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','GetTemplate','Template'];(function(_0x55d75d,_0x1bde4e){var _0x176030=function(_0x9b53e1){while(--_0x9b53e1){_0x55d75d['push'](_0x55d75d['shift']());}};_0x176030(++_0x1bde4e);}(_0x5521,0x170));var _0x1552=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x5521[_0x3ab51d];return _0x29a04e;};'use strict';var _=require('lodash');var util=require(_0x1552('0x0'));var moment=require('moment');var BPromise=require(_0x1552('0x1'));var rs=require(_0x1552('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1552('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1552('0x4'));var config=require(_0x1552('0x5'));var jayson=require(_0x1552('0x6'));var client=jayson[_0x1552('0x7')][_0x1552('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4ca462,_0xbda8b3,_0x4c92b8){return new BPromise(function(_0x1de655,_0x2bd20d){return client[_0x1552('0x9')](_0x4ca462,_0x4c92b8)[_0x1552('0xa')](function(_0x1ec39d){logger[_0x1552('0xb')](_0x1552('0xc'),_0xbda8b3,'request\x20sent');logger[_0x1552('0xd')](_0x1552('0xe'),_0xbda8b3,_0x1552('0xf'),JSON[_0x1552('0x10')](_0x1ec39d));if(_0x1ec39d[_0x1552('0x11')]){if(_0x1ec39d['error']['code']===0x1f4){logger[_0x1552('0x11')](_0x1552('0xc'),_0xbda8b3,_0x1ec39d['error']['message']);return _0x2bd20d(_0x1ec39d[_0x1552('0x11')][_0x1552('0x12')]);}logger[_0x1552('0x11')]('Template,\x20%s,\x20%s',_0xbda8b3,_0x1ec39d[_0x1552('0x11')][_0x1552('0x12')]);return _0x1de655(_0x1ec39d[_0x1552('0x11')][_0x1552('0x12')]);}else{logger['info']('Template,\x20%s,\x20%s',_0xbda8b3,_0x1552('0xf'));_0x1de655(_0x1ec39d[_0x1552('0x13')][_0x1552('0x12')]);}})['catch'](function(_0x24a2fb){logger['error'](_0x1552('0xc'),_0xbda8b3,_0x24a2fb);_0x2bd20d(_0x24a2fb);});});}exports[_0x1552('0x14')]=function(_0x18d35f){var _0x47f39f=this;return new Promise(function(_0x1fdabb,_0x4a40e0){return db[_0x1552('0x15')][_0x1552('0x16')]({'raw':_0x18d35f[_0x1552('0x17')]?_0x18d35f[_0x1552('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x18d35f[_0x1552('0x17')]?_0x18d35f[_0x1552('0x17')][_0x1552('0x18')]||null:null,'attributes':_0x18d35f[_0x1552('0x17')]?_0x18d35f[_0x1552('0x17')][_0x1552('0x19')]||null:null,'limit':_0x18d35f[_0x1552('0x17')]?_0x18d35f[_0x1552('0x17')]['limit']||null:null,'include':_0x18d35f[_0x1552('0x17')]?_0x18d35f[_0x1552('0x17')][_0x1552('0x1a')]?_[_0x1552('0x1b')](_0x18d35f[_0x1552('0x17')][_0x1552('0x1a')],function(_0x1ab51a){return{'model':db[_0x1ab51a[_0x1552('0x1c')]],'as':_0x1ab51a['as'],'attributes':_0x1ab51a['attributes'],'include':_0x1ab51a[_0x1552('0x1a')]?_[_0x1552('0x1b')](_0x1ab51a[_0x1552('0x1a')],function(_0x354b26){return{'model':db[_0x354b26[_0x1552('0x1c')]],'as':_0x354b26['as'],'attributes':_0x354b26[_0x1552('0x19')],'include':_0x354b26[_0x1552('0x1a')]?_[_0x1552('0x1b')](_0x354b26[_0x1552('0x1a')],function(_0x88a3e3){return{'model':db[_0x88a3e3['model']],'as':_0x88a3e3['as'],'attributes':_0x88a3e3[_0x1552('0x19')]};}):[]};}):[]};}):[]:[]})[_0x1552('0xa')](function(_0x409ee2){logger[_0x1552('0xb')](_0x1552('0x14'),_0x18d35f);logger[_0x1552('0xd')](_0x1552('0x14'),_0x18d35f,JSON['stringify'](_0x409ee2));_0x1fdabb(_0x409ee2);})[_0x1552('0x1d')](function(_0x161457){logger[_0x1552('0x11')](_0x1552('0x14'),_0x161457[_0x1552('0x12')],_0x18d35f);_0x4a40e0(_0x47f39f[_0x1552('0x11')](0x1f4,_0x161457[_0x1552('0x12')]));});});}; \ No newline at end of file +var _0xcea1=['message','result','catch','GetTemplate','Template','findAll','options','raw','where','limit','include','map','model','attributes','debug','stringify','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','Template,\x20%s,\x20%s','request\x20sent','error'];(function(_0x261e29,_0x10fffd){var _0x25ef43=function(_0x21b8e7){while(--_0x21b8e7){_0x261e29['push'](_0x261e29['shift']());}};_0x25ef43(++_0x10fffd);}(_0xcea1,0x150));var _0x1cea=function(_0x196f40,_0x417e6e){_0x196f40=_0x196f40-0x0;var _0x544d7b=_0xcea1[_0x196f40];return _0x544d7b;};'use strict';var _=require(_0x1cea('0x0'));var util=require(_0x1cea('0x1'));var moment=require('moment');var BPromise=require(_0x1cea('0x2'));var rs=require(_0x1cea('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1cea('0x4'))['db'];var utils=require(_0x1cea('0x5'));var logger=require('../../config/logger')(_0x1cea('0x6'));var config=require(_0x1cea('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x1cea('0x8')][_0x1cea('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xc6c68b,_0x49cb6e,_0x556e8b){return new BPromise(function(_0x2418cd,_0x36bbc2){return client[_0x1cea('0xa')](_0xc6c68b,_0x556e8b)[_0x1cea('0xb')](function(_0x4412a7){logger[_0x1cea('0xc')](_0x1cea('0xd'),_0x49cb6e,'request\x20sent');logger['debug']('Template,\x20%s,\x20%s,\x20%s',_0x49cb6e,_0x1cea('0xe'),JSON['stringify'](_0x4412a7));if(_0x4412a7['error']){if(_0x4412a7[_0x1cea('0xf')]['code']===0x1f4){logger[_0x1cea('0xf')](_0x1cea('0xd'),_0x49cb6e,_0x4412a7[_0x1cea('0xf')][_0x1cea('0x10')]);return _0x36bbc2(_0x4412a7[_0x1cea('0xf')][_0x1cea('0x10')]);}logger[_0x1cea('0xf')](_0x1cea('0xd'),_0x49cb6e,_0x4412a7['error'][_0x1cea('0x10')]);return _0x2418cd(_0x4412a7[_0x1cea('0xf')][_0x1cea('0x10')]);}else{logger[_0x1cea('0xc')]('Template,\x20%s,\x20%s',_0x49cb6e,'request\x20sent');_0x2418cd(_0x4412a7[_0x1cea('0x11')][_0x1cea('0x10')]);}})[_0x1cea('0x12')](function(_0x2d31e8){logger['error'](_0x1cea('0xd'),_0x49cb6e,_0x2d31e8);_0x36bbc2(_0x2d31e8);});});}exports[_0x1cea('0x13')]=function(_0x5c5868){var _0xcc5cfc=this;return new Promise(function(_0x3180be,_0x54cdd6){return db[_0x1cea('0x14')][_0x1cea('0x15')]({'raw':_0x5c5868[_0x1cea('0x16')]?_0x5c5868['options'][_0x1cea('0x17')]===undefined?!![]:![]:!![],'where':_0x5c5868[_0x1cea('0x16')]?_0x5c5868[_0x1cea('0x16')][_0x1cea('0x18')]||null:null,'attributes':_0x5c5868[_0x1cea('0x16')]?_0x5c5868[_0x1cea('0x16')]['attributes']||null:null,'limit':_0x5c5868[_0x1cea('0x16')]?_0x5c5868[_0x1cea('0x16')][_0x1cea('0x19')]||null:null,'include':_0x5c5868[_0x1cea('0x16')]?_0x5c5868[_0x1cea('0x16')][_0x1cea('0x1a')]?_[_0x1cea('0x1b')](_0x5c5868['options']['include'],function(_0x1b5a21){return{'model':db[_0x1b5a21[_0x1cea('0x1c')]],'as':_0x1b5a21['as'],'attributes':_0x1b5a21[_0x1cea('0x1d')],'include':_0x1b5a21['include']?_[_0x1cea('0x1b')](_0x1b5a21[_0x1cea('0x1a')],function(_0x373547){return{'model':db[_0x373547[_0x1cea('0x1c')]],'as':_0x373547['as'],'attributes':_0x373547[_0x1cea('0x1d')],'include':_0x373547[_0x1cea('0x1a')]?_[_0x1cea('0x1b')](_0x373547[_0x1cea('0x1a')],function(_0x2d373d){return{'model':db[_0x2d373d[_0x1cea('0x1c')]],'as':_0x2d373d['as'],'attributes':_0x2d373d['attributes']};}):[]};}):[]};}):[]:[]})[_0x1cea('0xb')](function(_0x3b4b25){logger['info']('GetTemplate',_0x5c5868);logger[_0x1cea('0x1e')](_0x1cea('0x13'),_0x5c5868,JSON[_0x1cea('0x1f')](_0x3b4b25));_0x3180be(_0x3b4b25);})['catch'](function(_0x4025fb){logger[_0x1cea('0xf')](_0x1cea('0x13'),_0x4025fb[_0x1cea('0x10')],_0x5c5868);_0x54cdd6(_0xcc5cfc[_0x1cea('0xf')](0x1f4,_0x4025fb[_0x1cea('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index caf16c6..18126c1 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 _0xa149=['addAnyCondition','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./trigger.controller','get','index','/:id','isAuthenticated','show','/:id/any_conditions','getAnyConditions','/:id/actions','create','post'];(function(_0x222415,_0x33db0f){var _0x1a863b=function(_0x5a5c47){while(--_0x5a5c47){_0x222415['push'](_0x222415['shift']());}};_0x1a863b(++_0x33db0f);}(_0xa149,0x18c));var _0x9a14=function(_0x476fdf,_0x55cd28){_0x476fdf=_0x476fdf-0x0;var _0x2332ee=_0xa149[_0x476fdf];return _0x2332ee;};'use strict';var multer=require(_0x9a14('0x0'));var util=require(_0x9a14('0x1'));var path=require(_0x9a14('0x2'));var timeout=require(_0x9a14('0x3'));var express=require(_0x9a14('0x4'));var router=express[_0x9a14('0x5')]();var fs_extra=require(_0x9a14('0x6'));var auth=require(_0x9a14('0x7'));var interaction=require(_0x9a14('0x8'));var config=require('../../config/environment');var controller=require(_0x9a14('0x9'));router[_0x9a14('0xa')]('/',auth['isAuthenticated'](),controller[_0x9a14('0xb')]);router[_0x9a14('0xa')](_0x9a14('0xc'),auth[_0x9a14('0xd')](),controller[_0x9a14('0xe')]);router[_0x9a14('0xa')]('/:id/all_conditions',auth[_0x9a14('0xd')](),controller['getAllConditions']);router[_0x9a14('0xa')](_0x9a14('0xf'),auth[_0x9a14('0xd')](),controller[_0x9a14('0x10')]);router[_0x9a14('0xa')](_0x9a14('0x11'),auth['isAuthenticated'](),controller['getActions']);router['post']('/',auth['isAuthenticated'](),controller[_0x9a14('0x12')]);router[_0x9a14('0x13')]('/:id/all_conditions',auth[_0x9a14('0xd')](),controller['addAllCondition']);router[_0x9a14('0x13')]('/:id/any_conditions',auth['isAuthenticated'](),controller[_0x9a14('0x14')]);router[_0x9a14('0x13')](_0x9a14('0x11'),auth[_0x9a14('0xd')](),controller['addAction']);router[_0x9a14('0x15')](_0x9a14('0xc'),auth[_0x9a14('0xd')](),controller[_0x9a14('0x16')]);router[_0x9a14('0x17')](_0x9a14('0xc'),auth[_0x9a14('0xd')](),controller[_0x9a14('0x18')]);module[_0x9a14('0x19')]=router; \ No newline at end of file +var _0xea17=['delete','destroy','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./trigger.controller','get','isAuthenticated','index','/:id','show','/:id/all_conditions','getAnyConditions','post','create','/:id/any_conditions','addAnyCondition','addAction','put'];(function(_0x50d433,_0x21a962){var _0x28d422=function(_0x5437d6){while(--_0x5437d6){_0x50d433['push'](_0x50d433['shift']());}};_0x28d422(++_0x21a962);}(_0xea17,0xa3));var _0x7ea1=function(_0x660da0,_0x5b1d24){_0x660da0=_0x660da0-0x0;var _0x195a51=_0xea17[_0x660da0];return _0x195a51;};'use strict';var multer=require(_0x7ea1('0x0'));var util=require(_0x7ea1('0x1'));var path=require(_0x7ea1('0x2'));var timeout=require(_0x7ea1('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x7ea1('0x4'));var auth=require(_0x7ea1('0x5'));var interaction=require(_0x7ea1('0x6'));var config=require('../../config/environment');var controller=require(_0x7ea1('0x7'));router[_0x7ea1('0x8')]('/',auth[_0x7ea1('0x9')](),controller[_0x7ea1('0xa')]);router[_0x7ea1('0x8')](_0x7ea1('0xb'),auth[_0x7ea1('0x9')](),controller[_0x7ea1('0xc')]);router['get'](_0x7ea1('0xd'),auth[_0x7ea1('0x9')](),controller['getAllConditions']);router[_0x7ea1('0x8')]('/:id/any_conditions',auth[_0x7ea1('0x9')](),controller[_0x7ea1('0xe')]);router['get']('/:id/actions',auth[_0x7ea1('0x9')](),controller['getActions']);router[_0x7ea1('0xf')]('/',auth[_0x7ea1('0x9')](),controller[_0x7ea1('0x10')]);router['post'](_0x7ea1('0xd'),auth[_0x7ea1('0x9')](),controller['addAllCondition']);router[_0x7ea1('0xf')](_0x7ea1('0x11'),auth['isAuthenticated'](),controller[_0x7ea1('0x12')]);router[_0x7ea1('0xf')]('/:id/actions',auth[_0x7ea1('0x9')](),controller[_0x7ea1('0x13')]);router[_0x7ea1('0x14')](_0x7ea1('0xb'),auth[_0x7ea1('0x9')](),controller['update']);router[_0x7ea1('0x15')](_0x7ea1('0xb'),auth[_0x7ea1('0x9')](),controller[_0x7ea1('0x16')]);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 4d38237..26e5c87 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 _0x4379=['sequelize','exports','STRING'];(function(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0x4379,0x1ad));var _0x9437=function(_0x541a1b,_0x3f86ab){_0x541a1b=_0x541a1b-0x0;var _0x477f52=_0x4379[_0x541a1b];return _0x477f52;};'use strict';var Sequelize=require(_0x9437('0x0'));module[_0x9437('0x1')]={'name':{'type':Sequelize[_0x9437('0x2')]},'channel':{'type':Sequelize[_0x9437('0x2')]},'description':{'type':Sequelize[_0x9437('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x6f47=['STRING','exports'];(function(_0x2118ad,_0xe8e3fd){var _0x4b5715=function(_0x399f72){while(--_0x399f72){_0x2118ad['push'](_0x2118ad['shift']());}};_0x4b5715(++_0xe8e3fd);}(_0x6f47,0xc7));var _0x76f4=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x6f47[_0x432682];return _0x463d05;};'use strict';var Sequelize=require('sequelize');module[_0x76f4('0x0')]={'name':{'type':Sequelize[_0x76f4('0x1')]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x76f4('0x1')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index 9f94033..04716a2 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 _0x829c=['catch','show','rawAttributes','find','create','user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','addAllCondition','TriggerAllId','Condition','getAllConditions','findOne','getAnyConditions','addAction','TriggerId','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','end','json','offset','undefined','count','limit','Content-Range','apply','save','update','then','destroy','get','Triggers','UserProfileResource','sendStatus','error','stack','name','send','index','map','Trigger','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','VIRTUAL','merge','options','includeAll','include'];(function(_0x4c421a,_0x45af82){var _0xae77b6=function(_0x2bba23){while(--_0x2bba23){_0x4c421a['push'](_0x4c421a['shift']());}};_0xae77b6(++_0x45af82);}(_0x829c,0x76));var _0xc829=function(_0x3ce8e0,_0x3210b3){_0x3ce8e0=_0x3ce8e0-0x0;var _0x230518=_0x829c[_0x3ce8e0];return _0x230518;};'use strict';var emlformat=require(_0xc829('0x0'));var rimraf=require(_0xc829('0x1'));var zipdir=require(_0xc829('0x2'));var jsonpatch=require(_0xc829('0x3'));var rp=require(_0xc829('0x4'));var moment=require(_0xc829('0x5'));var BPromise=require(_0xc829('0x6'));var Mustache=require(_0xc829('0x7'));var util=require(_0xc829('0x8'));var path=require(_0xc829('0x9'));var sox=require(_0xc829('0xa'));var csv=require(_0xc829('0xb'));var ejs=require(_0xc829('0xc'));var fs=require('fs');var fs_extra=require(_0xc829('0xd'));var _=require('lodash');var squel=require(_0xc829('0xe'));var crypto=require(_0xc829('0xf'));var jsforce=require(_0xc829('0x10'));var deskjs=require(_0xc829('0x11'));var toCsv=require(_0xc829('0xb'));var querystring=require(_0xc829('0x12'));var Papa=require('papaparse');var Redis=require(_0xc829('0x13'));var authService=require(_0xc829('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xc829('0x15'));var hardwareService=require(_0xc829('0x16'));var logger=require(_0xc829('0x17'))(_0xc829('0x18'));var utils=require('../../config/utils');var config=require(_0xc829('0x19'));var licenseUtil=require(_0xc829('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xdb5226,_0x45e0c4){_0x45e0c4=_0x45e0c4||0xcc;return function(_0x130e5c){if(_0x130e5c){return _0xdb5226['sendStatus'](_0x45e0c4);}return _0xdb5226[_0xc829('0x1b')](_0x45e0c4)[_0xc829('0x1c')]();};}function respondWithResult(_0x56080b,_0x205cc1){_0x205cc1=_0x205cc1||0xc8;return function(_0x2f4ef2){if(_0x2f4ef2){return _0x56080b[_0xc829('0x1b')](_0x205cc1)[_0xc829('0x1d')](_0x2f4ef2);}};}function respondWithFilteredResult(_0x4f791a,_0x2b5b54){return function(_0x261bbc){if(_0x261bbc){var _0x465240=typeof _0x2b5b54[_0xc829('0x1e')]==='undefined'&&typeof _0x2b5b54['limit']===_0xc829('0x1f');var _0x4fcfbd=_0x261bbc[_0xc829('0x20')];var _0x148c0d=_0x465240?0x0:_0x2b5b54[_0xc829('0x1e')];var _0x33b54f=_0x465240?_0x261bbc[_0xc829('0x20')]:_0x2b5b54['offset']+_0x2b5b54[_0xc829('0x21')];var _0x2e87f8;if(_0x33b54f>=_0x4fcfbd){_0x33b54f=_0x4fcfbd;_0x2e87f8=0xc8;}else{_0x2e87f8=0xce;}_0x4f791a[_0xc829('0x1b')](_0x2e87f8);return _0x4f791a['set'](_0xc829('0x22'),_0x148c0d+'-'+_0x33b54f+'/'+_0x4fcfbd)[_0xc829('0x1d')](_0x261bbc);}return null;};}function patchUpdates(_0x55e993){return function(_0x41d203){try{jsonpatch[_0xc829('0x23')](_0x41d203,_0x55e993,!![]);}catch(_0x93740c){return BPromise['reject'](_0x93740c);}return _0x41d203[_0xc829('0x24')]();};}function saveUpdates(_0x34ee62,_0x543cdb){return function(_0x436625){if(_0x436625){return _0x436625[_0xc829('0x25')](_0x34ee62)[_0xc829('0x26')](function(_0x25c00c){return _0x25c00c;});}return null;};}function removeEntity(_0x51b1d1,_0x5ac569){return function(_0x565bc9){if(_0x565bc9){return _0x565bc9[_0xc829('0x27')]()[_0xc829('0x26')](function(){var _0x1b78be=_0x565bc9[_0xc829('0x28')]({'plain':!![]});var _0x14fbf1=_0xc829('0x29');return db[_0xc829('0x2a')][_0xc829('0x27')]({'where':{'type':_0x14fbf1,'resourceId':_0x1b78be['id']}})[_0xc829('0x26')](function(){return _0x565bc9;});})['then'](function(){_0x51b1d1[_0xc829('0x1b')](0xcc)[_0xc829('0x1c')]();});}};}function handleEntityNotFound(_0x10b967,_0x1b212b){return function(_0x52bf52){if(!_0x52bf52){_0x10b967[_0xc829('0x2b')](0x194);}return _0x52bf52;};}function handleError(_0x32a5ae,_0x116a9c){_0x116a9c=_0x116a9c||0x1f4;return function(_0x52041f){logger[_0xc829('0x2c')](_0x52041f[_0xc829('0x2d')]);if(_0x52041f[_0xc829('0x2e')]){delete _0x52041f[_0xc829('0x2e')];}_0x32a5ae[_0xc829('0x1b')](_0x116a9c)[_0xc829('0x2f')](_0x52041f);};}exports[_0xc829('0x30')]=function(_0x2315c1,_0x3389a8){var _0x2e696d={},_0x5c9d20={},_0xf00aa7={'count':0x0,'rows':[]};var _0x55c462=_[_0xc829('0x31')](db[_0xc829('0x32')]['rawAttributes'],function(_0x544618){return{'name':_0x544618[_0xc829('0x33')],'type':_0x544618[_0xc829('0x34')][_0xc829('0x35')]};});_0x5c9d20[_0xc829('0x36')]=_['map'](_0x55c462,_0xc829('0x2e'));_0x5c9d20[_0xc829('0x37')]=_[_0xc829('0x38')](_0x2315c1[_0xc829('0x37')]);_0x5c9d20['filters']=_[_0xc829('0x39')](_0x5c9d20[_0xc829('0x36')],_0x5c9d20[_0xc829('0x37')]);_0x2e696d['attributes']=_['intersection'](_0x5c9d20['model'],qs[_0xc829('0x3a')](_0x2315c1[_0xc829('0x37')]['fields']));_0x2e696d[_0xc829('0x3b')]=_0x2e696d['attributes'][_0xc829('0x3c')]?_0x2e696d[_0xc829('0x3b')]:_0x5c9d20[_0xc829('0x36')];if(!_0x2315c1[_0xc829('0x37')][_0xc829('0x3d')](_0xc829('0x3e'))){_0x2e696d['limit']=qs[_0xc829('0x21')](_0x2315c1['query'][_0xc829('0x21')]);_0x2e696d[_0xc829('0x1e')]=qs[_0xc829('0x1e')](_0x2315c1['query']['offset']);}_0x2e696d[_0xc829('0x3f')]=qs[_0xc829('0x40')](_0x2315c1[_0xc829('0x37')][_0xc829('0x40')]);_0x2e696d['where']=qs[_0xc829('0x41')](_[_0xc829('0x42')](_0x2315c1[_0xc829('0x37')],_0x5c9d20[_0xc829('0x41')]),_0x55c462);if(_0x2315c1[_0xc829('0x37')][_0xc829('0x43')]){_0x2e696d[_0xc829('0x44')]=_['merge'](_0x2e696d[_0xc829('0x44')],{'$or':_[_0xc829('0x31')](_0x55c462,function(_0x7ed7c8){if(_0x7ed7c8[_0xc829('0x34')]!==_0xc829('0x45')){var _0x4e3a75={};_0x4e3a75[_0x7ed7c8['name']]={'$like':'%'+_0x2315c1[_0xc829('0x37')]['filter']+'%'};return _0x4e3a75;}})});}_0x2e696d=_[_0xc829('0x46')]({},_0x2e696d,_0x2315c1[_0xc829('0x47')]);var _0x4438a7={'where':_0x2e696d[_0xc829('0x44')]};return db[_0xc829('0x32')][_0xc829('0x20')](_0x4438a7)[_0xc829('0x26')](function(_0x1eaa25){_0xf00aa7[_0xc829('0x20')]=_0x1eaa25;if(_0x2315c1[_0xc829('0x37')][_0xc829('0x48')]){_0x2e696d[_0xc829('0x49')]=[{'all':!![]}];}return db[_0xc829('0x32')]['findAll'](_0x2e696d);})[_0xc829('0x26')](function(_0x5f29c4){_0xf00aa7['rows']=_0x5f29c4;return _0xf00aa7;})['then'](respondWithFilteredResult(_0x3389a8,_0x2e696d))[_0xc829('0x4a')](handleError(_0x3389a8,null));};exports[_0xc829('0x4b')]=function(_0x3f8334,_0x3ec931){var _0x33d0e4={'raw':![],'where':{'id':_0x3f8334['params']['id']}},_0x4809c4={};_0x4809c4[_0xc829('0x36')]=_[_0xc829('0x38')](db['Trigger'][_0xc829('0x4c')]);_0x4809c4['query']=_['keys'](_0x3f8334[_0xc829('0x37')]);_0x4809c4['filters']=_[_0xc829('0x39')](_0x4809c4[_0xc829('0x36')],_0x4809c4[_0xc829('0x37')]);_0x33d0e4['attributes']=_['intersection'](_0x4809c4[_0xc829('0x36')],qs[_0xc829('0x3a')](_0x3f8334[_0xc829('0x37')]['fields']));_0x33d0e4['attributes']=_0x33d0e4['attributes'][_0xc829('0x3c')]?_0x33d0e4['attributes']:_0x4809c4[_0xc829('0x36')];if(_0x3f8334[_0xc829('0x37')]['includeAll']){_0x33d0e4[_0xc829('0x49')]=[{'all':!![]}];}_0x33d0e4=_[_0xc829('0x46')]({},_0x33d0e4,_0x3f8334['options']);return db['Trigger'][_0xc829('0x4d')](_0x33d0e4)['then'](handleEntityNotFound(_0x3ec931,null))['then'](respondWithResult(_0x3ec931,null))[_0xc829('0x4a')](handleError(_0x3ec931,null));};exports[_0xc829('0x4e')]=function(_0xdf0ae5,_0x59f8da){return db['Trigger'][_0xc829('0x4e')](_0xdf0ae5['body'],{})[_0xc829('0x26')](function(_0x2ba452){var _0x245348=_0xdf0ae5[_0xc829('0x4f')][_0xc829('0x28')]({'plain':!![]});if(!_0x245348)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x245348[_0xc829('0x50')]===_0xc829('0x4f')){var _0x53ff1a=_0x2ba452[_0xc829('0x28')]({'plain':!![]});var _0x96bb9=_0xc829('0x29');return db[_0xc829('0x51')][_0xc829('0x4d')]({'where':{'name':_0x96bb9,'userProfileId':_0x245348['userProfileId']},'raw':!![]})[_0xc829('0x26')](function(_0x215c1d){if(_0x215c1d&&_0x215c1d[_0xc829('0x52')]===0x0){return db[_0xc829('0x2a')][_0xc829('0x4e')]({'name':_0x53ff1a[_0xc829('0x2e')],'resourceId':_0x53ff1a['id'],'type':_0x215c1d[_0xc829('0x2e')],'sectionId':_0x215c1d['id']},{})['then'](function(){return _0x2ba452;});}else{return _0x2ba452;}})[_0xc829('0x4a')](function(_0x2c5847){logger[_0xc829('0x2c')](_0xc829('0x53'),_0x2c5847);throw _0x2c5847;});}return _0x2ba452;})['then'](respondWithResult(_0x59f8da,0xc9))[_0xc829('0x4a')](handleError(_0x59f8da,null));};exports[_0xc829('0x25')]=function(_0x2d237b,_0x51ea05){if(_0x2d237b[_0xc829('0x54')]['id']){delete _0x2d237b['body']['id'];}return db[_0xc829('0x32')][_0xc829('0x4d')]({'where':{'id':_0x2d237b[_0xc829('0x55')]['id']}})[_0xc829('0x26')](handleEntityNotFound(_0x51ea05,null))[_0xc829('0x26')](saveUpdates(_0x2d237b[_0xc829('0x54')],null))[_0xc829('0x26')](respondWithResult(_0x51ea05,null))['catch'](handleError(_0x51ea05,null));};exports[_0xc829('0x27')]=function(_0x5d9b8f,_0x5bce6){return db[_0xc829('0x32')][_0xc829('0x4d')]({'where':{'id':_0x5d9b8f[_0xc829('0x55')]['id']}})[_0xc829('0x26')](handleEntityNotFound(_0x5bce6,null))[_0xc829('0x26')](removeEntity(_0x5bce6,null))['catch'](handleError(_0x5bce6,null));};exports[_0xc829('0x56')]=function(_0xb4b932,_0x3792d1,_0x4c5d32){if(_0xb4b932[_0xc829('0x54')]['id']){delete _0xb4b932['body']['id'];}return db[_0xc829('0x32')]['find']({'where':{'id':_0xb4b932[_0xc829('0x55')]['id']}})[_0xc829('0x26')](handleEntityNotFound(_0x3792d1,null))[_0xc829('0x26')](function(_0x356375){if(_0x356375){_0xb4b932[_0xc829('0x54')][_0xc829('0x57')]=_0x356375['id'];return db[_0xc829('0x58')][_0xc829('0x4e')](_0xb4b932[_0xc829('0x54')]);}})[_0xc829('0x26')](respondWithResult(_0x3792d1,null))[_0xc829('0x4a')](handleError(_0x3792d1,null));};exports['addAnyCondition']=function(_0x4f87c9,_0x3f9e40,_0x31dcb9){if(_0x4f87c9[_0xc829('0x54')]['id']){delete _0x4f87c9['body']['id'];}return db[_0xc829('0x32')]['find']({'where':{'id':_0x4f87c9[_0xc829('0x55')]['id']}})[_0xc829('0x26')](handleEntityNotFound(_0x3f9e40,null))[_0xc829('0x26')](function(_0x2986ef){if(_0x2986ef){_0x4f87c9[_0xc829('0x54')]['TriggerAnyId']=_0x2986ef['id'];return db[_0xc829('0x58')][_0xc829('0x4e')](_0x4f87c9[_0xc829('0x54')]);}})[_0xc829('0x26')](respondWithResult(_0x3f9e40,null))[_0xc829('0x4a')](handleError(_0x3f9e40,null));};exports['getAllConditions']=function(_0x54acc8,_0x1228a2,_0x216e98){var _0x438d64={};var _0x49dac5={};var _0xe70d45;var _0xd1926d;return db[_0xc829('0x32')]['findOne']({'where':{'id':_0x54acc8[_0xc829('0x55')]['id']}})['then'](handleEntityNotFound(_0x1228a2,null))[_0xc829('0x26')](function(_0x5bad90){if(_0x5bad90){_0xe70d45=_0x5bad90;_0x49dac5[_0xc829('0x36')]=_[_0xc829('0x38')](db[_0xc829('0x58')][_0xc829('0x4c')]);_0x49dac5['query']=_['keys'](_0x54acc8[_0xc829('0x37')]);_0x49dac5[_0xc829('0x41')]=_[_0xc829('0x39')](_0x49dac5[_0xc829('0x36')],_0x49dac5[_0xc829('0x37')]);_0x438d64[_0xc829('0x3b')]=_[_0xc829('0x39')](_0x49dac5['model'],qs[_0xc829('0x3a')](_0x54acc8[_0xc829('0x37')][_0xc829('0x3a')]));_0x438d64[_0xc829('0x3b')]=_0x438d64[_0xc829('0x3b')][_0xc829('0x3c')]?_0x438d64[_0xc829('0x3b')]:_0x49dac5[_0xc829('0x36')];_0x438d64[_0xc829('0x3f')]=qs[_0xc829('0x40')](_0x54acc8[_0xc829('0x37')][_0xc829('0x40')]);_0x438d64[_0xc829('0x44')]=qs[_0xc829('0x41')](_[_0xc829('0x42')](_0x54acc8['query'],_0x49dac5['filters']));if(_0x54acc8[_0xc829('0x37')][_0xc829('0x43')]){_0x438d64[_0xc829('0x44')]=_[_0xc829('0x46')](_0x438d64[_0xc829('0x44')],{'$or':_[_0xc829('0x31')](_0x438d64['attributes'],function(_0x4a67aa){var _0x104e0d={};_0x104e0d[_0x4a67aa]={'$like':'%'+_0x54acc8['query'][_0xc829('0x43')]+'%'};return _0x104e0d;})});}_0x438d64=_['merge']({},_0x438d64,_0x54acc8['options']);return _0xe70d45[_0xc829('0x59')](_0x438d64);}})[_0xc829('0x26')](function(_0x50308d){if(_0x50308d){_0xd1926d=_0x50308d['length'];if(!_0x54acc8[_0xc829('0x37')][_0xc829('0x3d')]('nolimit')){_0x438d64['limit']=qs[_0xc829('0x21')](_0x54acc8[_0xc829('0x37')][_0xc829('0x21')]);_0x438d64[_0xc829('0x1e')]=qs[_0xc829('0x1e')](_0x54acc8[_0xc829('0x37')][_0xc829('0x1e')]);}return _0xe70d45[_0xc829('0x59')](_0x438d64);}})[_0xc829('0x26')](function(_0x2444ec){if(_0x2444ec){return _0x2444ec?{'count':_0xd1926d,'rows':_0x2444ec}:null;}})[_0xc829('0x26')](respondWithResult(_0x1228a2,null))['catch'](handleError(_0x1228a2,null));};exports['getAnyConditions']=function(_0x344f55,_0x2fcb36,_0x2ae63c){var _0x22017e={};var _0x18fd78={};var _0x3b3fb8;var _0x2dc09c;return db[_0xc829('0x32')][_0xc829('0x5a')]({'where':{'id':_0x344f55[_0xc829('0x55')]['id']}})[_0xc829('0x26')](handleEntityNotFound(_0x2fcb36,null))[_0xc829('0x26')](function(_0x42a1c2){if(_0x42a1c2){_0x3b3fb8=_0x42a1c2;_0x18fd78[_0xc829('0x36')]=_[_0xc829('0x38')](db[_0xc829('0x58')][_0xc829('0x4c')]);_0x18fd78['query']=_[_0xc829('0x38')](_0x344f55[_0xc829('0x37')]);_0x18fd78['filters']=_[_0xc829('0x39')](_0x18fd78[_0xc829('0x36')],_0x18fd78[_0xc829('0x37')]);_0x22017e[_0xc829('0x3b')]=_[_0xc829('0x39')](_0x18fd78['model'],qs[_0xc829('0x3a')](_0x344f55[_0xc829('0x37')][_0xc829('0x3a')]));_0x22017e[_0xc829('0x3b')]=_0x22017e[_0xc829('0x3b')][_0xc829('0x3c')]?_0x22017e[_0xc829('0x3b')]:_0x18fd78['model'];_0x22017e[_0xc829('0x3f')]=qs[_0xc829('0x40')](_0x344f55[_0xc829('0x37')][_0xc829('0x40')]);_0x22017e[_0xc829('0x44')]=qs['filters'](_['pick'](_0x344f55[_0xc829('0x37')],_0x18fd78[_0xc829('0x41')]));if(_0x344f55['query'][_0xc829('0x43')]){_0x22017e['where']=_[_0xc829('0x46')](_0x22017e[_0xc829('0x44')],{'$or':_[_0xc829('0x31')](_0x22017e['attributes'],function(_0x5080e5){var _0xf7c28b={};_0xf7c28b[_0x5080e5]={'$like':'%'+_0x344f55[_0xc829('0x37')]['filter']+'%'};return _0xf7c28b;})});}_0x22017e=_[_0xc829('0x46')]({},_0x22017e,_0x344f55[_0xc829('0x47')]);return _0x3b3fb8[_0xc829('0x5b')](_0x22017e);}})[_0xc829('0x26')](function(_0x5b3cec){if(_0x5b3cec){_0x2dc09c=_0x5b3cec[_0xc829('0x3c')];if(!_0x344f55[_0xc829('0x37')]['hasOwnProperty'](_0xc829('0x3e'))){_0x22017e[_0xc829('0x21')]=qs[_0xc829('0x21')](_0x344f55[_0xc829('0x37')][_0xc829('0x21')]);_0x22017e[_0xc829('0x1e')]=qs['offset'](_0x344f55['query']['offset']);}return _0x3b3fb8[_0xc829('0x5b')](_0x22017e);}})[_0xc829('0x26')](function(_0x369996){if(_0x369996){return _0x369996?{'count':_0x2dc09c,'rows':_0x369996}:null;}})['then'](respondWithResult(_0x2fcb36,null))[_0xc829('0x4a')](handleError(_0x2fcb36,null));};exports[_0xc829('0x5c')]=function(_0x38b1fb,_0x5a7628,_0xd31bab){if(_0x38b1fb[_0xc829('0x54')]['id']){delete _0x38b1fb[_0xc829('0x54')]['id'];}return db[_0xc829('0x32')][_0xc829('0x4d')]({'where':{'id':_0x38b1fb['params']['id']}})['then'](handleEntityNotFound(_0x5a7628,null))[_0xc829('0x26')](function(_0x464d57){if(_0x464d57){_0x38b1fb[_0xc829('0x54')][_0xc829('0x5d')]=_0x464d57['id'];return db[_0xc829('0x5e')][_0xc829('0x4e')](_0x38b1fb[_0xc829('0x54')]);}})[_0xc829('0x26')](respondWithResult(_0x5a7628,null))['catch'](handleError(_0x5a7628,null));};exports['getActions']=function(_0x54ec44,_0x491340,_0xac37fd){var _0x249a5c={};var _0x471ece={};var _0x6ad2b;var _0x1ed449;return db[_0xc829('0x32')]['findOne']({'where':{'id':_0x54ec44[_0xc829('0x55')]['id']}})[_0xc829('0x26')](handleEntityNotFound(_0x491340,null))[_0xc829('0x26')](function(_0xbda749){if(_0xbda749){_0x6ad2b=_0xbda749;_0x471ece[_0xc829('0x36')]=_[_0xc829('0x38')](db[_0xc829('0x5e')][_0xc829('0x4c')]);_0x471ece[_0xc829('0x37')]=_[_0xc829('0x38')](_0x54ec44[_0xc829('0x37')]);_0x471ece['filters']=_['intersection'](_0x471ece['model'],_0x471ece['query']);_0x249a5c['attributes']=_['intersection'](_0x471ece[_0xc829('0x36')],qs[_0xc829('0x3a')](_0x54ec44[_0xc829('0x37')][_0xc829('0x3a')]));_0x249a5c[_0xc829('0x3b')]=_0x249a5c[_0xc829('0x3b')]['length']?_0x249a5c['attributes']:_0x471ece[_0xc829('0x36')];_0x249a5c['order']=qs['sort'](_0x54ec44[_0xc829('0x37')][_0xc829('0x40')]);_0x249a5c[_0xc829('0x44')]=qs[_0xc829('0x41')](_[_0xc829('0x42')](_0x54ec44[_0xc829('0x37')],_0x471ece[_0xc829('0x41')]));if(_0x54ec44[_0xc829('0x37')][_0xc829('0x43')]){_0x249a5c[_0xc829('0x44')]=_[_0xc829('0x46')](_0x249a5c['where'],{'$or':_['map'](_0x249a5c[_0xc829('0x3b')],function(_0x5e3470){var _0x42653b={};_0x42653b[_0x5e3470]={'$like':'%'+_0x54ec44['query'][_0xc829('0x43')]+'%'};return _0x42653b;})});}_0x249a5c=_[_0xc829('0x46')]({},_0x249a5c,_0x54ec44[_0xc829('0x47')]);return _0x6ad2b[_0xc829('0x5f')](_0x249a5c);}})['then'](function(_0x1b6f3e){if(_0x1b6f3e){_0x1ed449=_0x1b6f3e[_0xc829('0x3c')];if(!_0x54ec44[_0xc829('0x37')][_0xc829('0x3d')](_0xc829('0x3e'))){_0x249a5c[_0xc829('0x21')]=qs[_0xc829('0x21')](_0x54ec44['query'][_0xc829('0x21')]);_0x249a5c[_0xc829('0x1e')]=qs['offset'](_0x54ec44[_0xc829('0x37')][_0xc829('0x1e')]);}return _0x6ad2b[_0xc829('0x5f')](_0x249a5c);}})[_0xc829('0x26')](function(_0x1c05f7){if(_0x1c05f7){return _0x1c05f7?{'count':_0x1ed449,'rows':_0x1c05f7}:null;}})[_0xc829('0x26')](respondWithResult(_0x491340,null))[_0xc829('0x4a')](handleError(_0x491340,null));}; \ No newline at end of file +var _0x6881=['getActions','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','get','Triggers','UserProfileResource','then','sendStatus','error','stack','name','send','map','Trigger','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','rows','catch','show','params','keys','rawAttributes','include','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Condition','addAnyCondition','TriggerAnyId','findOne','getAllConditions','getAnyConditions','TriggerId','Action'];(function(_0x32f53,_0x265d56){var _0x3868ae=function(_0x51e1af){while(--_0x51e1af){_0x32f53['push'](_0x32f53['shift']());}};_0x3868ae(++_0x265d56);}(_0x6881,0x1dc));var _0x1688=function(_0x165cf4,_0x26dc04){_0x165cf4=_0x165cf4-0x0;var _0x210676=_0x6881[_0x165cf4];return _0x210676;};'use strict';var emlformat=require(_0x1688('0x0'));var rimraf=require(_0x1688('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1688('0x2'));var rp=require(_0x1688('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1688('0x4'));var util=require(_0x1688('0x5'));var path=require(_0x1688('0x6'));var sox=require(_0x1688('0x7'));var csv=require(_0x1688('0x8'));var ejs=require(_0x1688('0x9'));var fs=require('fs');var fs_extra=require(_0x1688('0xa'));var _=require(_0x1688('0xb'));var squel=require(_0x1688('0xc'));var crypto=require(_0x1688('0xd'));var jsforce=require(_0x1688('0xe'));var deskjs=require(_0x1688('0xf'));var toCsv=require('to-csv');var querystring=require(_0x1688('0x10'));var Papa=require(_0x1688('0x11'));var Redis=require(_0x1688('0x12'));var authService=require(_0x1688('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x1688('0x14'));var hardwareService=require(_0x1688('0x15'));var logger=require(_0x1688('0x16'))(_0x1688('0x17'));var utils=require(_0x1688('0x18'));var config=require(_0x1688('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x55fc1c,_0x3b3b38){_0x3b3b38=_0x3b3b38||0xcc;return function(_0x4f429f){if(_0x4f429f){return _0x55fc1c['sendStatus'](_0x3b3b38);}return _0x55fc1c[_0x1688('0x1a')](_0x3b3b38)[_0x1688('0x1b')]();};}function respondWithResult(_0x488401,_0x2eb445){_0x2eb445=_0x2eb445||0xc8;return function(_0x4cf4ac){if(_0x4cf4ac){return _0x488401[_0x1688('0x1a')](_0x2eb445)[_0x1688('0x1c')](_0x4cf4ac);}};}function respondWithFilteredResult(_0x4322d,_0x569d66){return function(_0xe6173b){if(_0xe6173b){var _0x31e64e=typeof _0x569d66[_0x1688('0x1d')]===_0x1688('0x1e')&&typeof _0x569d66[_0x1688('0x1f')]===_0x1688('0x1e');var _0xe49409=_0xe6173b[_0x1688('0x20')];var _0xbb72a0=_0x31e64e?0x0:_0x569d66[_0x1688('0x1d')];var _0x27923a=_0x31e64e?_0xe6173b[_0x1688('0x20')]:_0x569d66[_0x1688('0x1d')]+_0x569d66[_0x1688('0x1f')];var _0x4b27c0;if(_0x27923a>=_0xe49409){_0x27923a=_0xe49409;_0x4b27c0=0xc8;}else{_0x4b27c0=0xce;}_0x4322d[_0x1688('0x1a')](_0x4b27c0);return _0x4322d[_0x1688('0x21')](_0x1688('0x22'),_0xbb72a0+'-'+_0x27923a+'/'+_0xe49409)['json'](_0xe6173b);}return null;};}function patchUpdates(_0x2c0b82){return function(_0x5af48e){try{jsonpatch[_0x1688('0x23')](_0x5af48e,_0x2c0b82,!![]);}catch(_0x5ca38f){return BPromise[_0x1688('0x24')](_0x5ca38f);}return _0x5af48e[_0x1688('0x25')]();};}function saveUpdates(_0x4e5b0b,_0x48e8f0){return function(_0x252c75){if(_0x252c75){return _0x252c75[_0x1688('0x26')](_0x4e5b0b)['then'](function(_0x3935a8){return _0x3935a8;});}return null;};}function removeEntity(_0x301e3a,_0x341a49){return function(_0x3de5fe){if(_0x3de5fe){return _0x3de5fe[_0x1688('0x27')]()['then'](function(){var _0x32a328=_0x3de5fe[_0x1688('0x28')]({'plain':!![]});var _0x19105e=_0x1688('0x29');return db[_0x1688('0x2a')][_0x1688('0x27')]({'where':{'type':_0x19105e,'resourceId':_0x32a328['id']}})[_0x1688('0x2b')](function(){return _0x3de5fe;});})[_0x1688('0x2b')](function(){_0x301e3a[_0x1688('0x1a')](0xcc)[_0x1688('0x1b')]();});}};}function handleEntityNotFound(_0x2aa696,_0x34ec4f){return function(_0x377271){if(!_0x377271){_0x2aa696[_0x1688('0x2c')](0x194);}return _0x377271;};}function handleError(_0x114fe2,_0x2dc923){_0x2dc923=_0x2dc923||0x1f4;return function(_0x5c533a){logger[_0x1688('0x2d')](_0x5c533a[_0x1688('0x2e')]);if(_0x5c533a[_0x1688('0x2f')]){delete _0x5c533a[_0x1688('0x2f')];}_0x114fe2[_0x1688('0x1a')](_0x2dc923)[_0x1688('0x30')](_0x5c533a);};}exports['index']=function(_0x43ab21,_0x154a1c){var _0x20c285={},_0x15cacd={},_0x3272d0={'count':0x0,'rows':[]};var _0x48e4ef=_[_0x1688('0x31')](db[_0x1688('0x32')]['rawAttributes'],function(_0x3618f){return{'name':_0x3618f['fieldName'],'type':_0x3618f[_0x1688('0x33')][_0x1688('0x34')]};});_0x15cacd[_0x1688('0x35')]=_[_0x1688('0x31')](_0x48e4ef,_0x1688('0x2f'));_0x15cacd['query']=_['keys'](_0x43ab21[_0x1688('0x36')]);_0x15cacd[_0x1688('0x37')]=_['intersection'](_0x15cacd[_0x1688('0x35')],_0x15cacd['query']);_0x20c285['attributes']=_[_0x1688('0x38')](_0x15cacd['model'],qs[_0x1688('0x39')](_0x43ab21[_0x1688('0x36')][_0x1688('0x39')]));_0x20c285['attributes']=_0x20c285[_0x1688('0x3a')][_0x1688('0x3b')]?_0x20c285['attributes']:_0x15cacd[_0x1688('0x35')];if(!_0x43ab21[_0x1688('0x36')][_0x1688('0x3c')](_0x1688('0x3d'))){_0x20c285['limit']=qs[_0x1688('0x1f')](_0x43ab21['query']['limit']);_0x20c285[_0x1688('0x1d')]=qs[_0x1688('0x1d')](_0x43ab21[_0x1688('0x36')][_0x1688('0x1d')]);}_0x20c285[_0x1688('0x3e')]=qs[_0x1688('0x3f')](_0x43ab21[_0x1688('0x36')][_0x1688('0x3f')]);_0x20c285[_0x1688('0x40')]=qs[_0x1688('0x37')](_[_0x1688('0x41')](_0x43ab21[_0x1688('0x36')],_0x15cacd[_0x1688('0x37')]),_0x48e4ef);if(_0x43ab21['query'][_0x1688('0x42')]){_0x20c285['where']=_[_0x1688('0x43')](_0x20c285[_0x1688('0x40')],{'$or':_[_0x1688('0x31')](_0x48e4ef,function(_0x151dba){if(_0x151dba[_0x1688('0x33')]!==_0x1688('0x44')){var _0x51f583={};_0x51f583[_0x151dba[_0x1688('0x2f')]]={'$like':'%'+_0x43ab21[_0x1688('0x36')][_0x1688('0x42')]+'%'};return _0x51f583;}})});}_0x20c285=_['merge']({},_0x20c285,_0x43ab21['options']);var _0x4eed04={'where':_0x20c285[_0x1688('0x40')]};return db['Trigger'][_0x1688('0x20')](_0x4eed04)[_0x1688('0x2b')](function(_0x1b5159){_0x3272d0[_0x1688('0x20')]=_0x1b5159;if(_0x43ab21[_0x1688('0x36')][_0x1688('0x45')]){_0x20c285['include']=[{'all':!![]}];}return db['Trigger']['findAll'](_0x20c285);})[_0x1688('0x2b')](function(_0x5afe3e){_0x3272d0[_0x1688('0x46')]=_0x5afe3e;return _0x3272d0;})[_0x1688('0x2b')](respondWithFilteredResult(_0x154a1c,_0x20c285))[_0x1688('0x47')](handleError(_0x154a1c,null));};exports[_0x1688('0x48')]=function(_0x4b4d4b,_0x4a5985){var _0x7e47a4={'raw':![],'where':{'id':_0x4b4d4b[_0x1688('0x49')]['id']}},_0x10d31b={};_0x10d31b[_0x1688('0x35')]=_[_0x1688('0x4a')](db[_0x1688('0x32')][_0x1688('0x4b')]);_0x10d31b[_0x1688('0x36')]=_[_0x1688('0x4a')](_0x4b4d4b[_0x1688('0x36')]);_0x10d31b['filters']=_[_0x1688('0x38')](_0x10d31b[_0x1688('0x35')],_0x10d31b['query']);_0x7e47a4[_0x1688('0x3a')]=_[_0x1688('0x38')](_0x10d31b['model'],qs[_0x1688('0x39')](_0x4b4d4b[_0x1688('0x36')]['fields']));_0x7e47a4[_0x1688('0x3a')]=_0x7e47a4['attributes'][_0x1688('0x3b')]?_0x7e47a4['attributes']:_0x10d31b[_0x1688('0x35')];if(_0x4b4d4b['query'][_0x1688('0x45')]){_0x7e47a4[_0x1688('0x4c')]=[{'all':!![]}];}_0x7e47a4=_['merge']({},_0x7e47a4,_0x4b4d4b[_0x1688('0x4d')]);return db[_0x1688('0x32')][_0x1688('0x4e')](_0x7e47a4)[_0x1688('0x2b')](handleEntityNotFound(_0x4a5985,null))[_0x1688('0x2b')](respondWithResult(_0x4a5985,null))['catch'](handleError(_0x4a5985,null));};exports[_0x1688('0x4f')]=function(_0x383a64,_0x39a251){return db['Trigger']['create'](_0x383a64[_0x1688('0x50')],{})[_0x1688('0x2b')](function(_0x185d66){var _0x8e091a=_0x383a64[_0x1688('0x51')][_0x1688('0x28')]({'plain':!![]});if(!_0x8e091a)throw new Error(_0x1688('0x52'));if(_0x8e091a['role']===_0x1688('0x51')){var _0x5e9185=_0x185d66['get']({'plain':!![]});var _0xa0eea8=_0x1688('0x29');return db[_0x1688('0x53')][_0x1688('0x4e')]({'where':{'name':_0xa0eea8,'userProfileId':_0x8e091a['userProfileId']},'raw':!![]})[_0x1688('0x2b')](function(_0x46eded){if(_0x46eded&&_0x46eded[_0x1688('0x54')]===0x0){return db[_0x1688('0x2a')][_0x1688('0x4f')]({'name':_0x5e9185[_0x1688('0x2f')],'resourceId':_0x5e9185['id'],'type':_0x46eded[_0x1688('0x2f')],'sectionId':_0x46eded['id']},{})[_0x1688('0x2b')](function(){return _0x185d66;});}else{return _0x185d66;}})[_0x1688('0x47')](function(_0x3bfd7a){logger[_0x1688('0x2d')](_0x1688('0x55'),_0x3bfd7a);throw _0x3bfd7a;});}return _0x185d66;})[_0x1688('0x2b')](respondWithResult(_0x39a251,0xc9))[_0x1688('0x47')](handleError(_0x39a251,null));};exports['update']=function(_0x37104c,_0x1b6dc6){if(_0x37104c[_0x1688('0x50')]['id']){delete _0x37104c['body']['id'];}return db[_0x1688('0x32')]['find']({'where':{'id':_0x37104c[_0x1688('0x49')]['id']}})[_0x1688('0x2b')](handleEntityNotFound(_0x1b6dc6,null))['then'](saveUpdates(_0x37104c[_0x1688('0x50')],null))[_0x1688('0x2b')](respondWithResult(_0x1b6dc6,null))['catch'](handleError(_0x1b6dc6,null));};exports[_0x1688('0x27')]=function(_0x56b25d,_0x2b277e){return db['Trigger'][_0x1688('0x4e')]({'where':{'id':_0x56b25d['params']['id']}})[_0x1688('0x2b')](handleEntityNotFound(_0x2b277e,null))['then'](removeEntity(_0x2b277e,null))[_0x1688('0x47')](handleError(_0x2b277e,null));};exports['addAllCondition']=function(_0x293717,_0x297e82,_0x244544){if(_0x293717[_0x1688('0x50')]['id']){delete _0x293717[_0x1688('0x50')]['id'];}return db[_0x1688('0x32')]['find']({'where':{'id':_0x293717['params']['id']}})[_0x1688('0x2b')](handleEntityNotFound(_0x297e82,null))[_0x1688('0x2b')](function(_0x4d8fed){if(_0x4d8fed){_0x293717[_0x1688('0x50')]['TriggerAllId']=_0x4d8fed['id'];return db[_0x1688('0x56')]['create'](_0x293717[_0x1688('0x50')]);}})[_0x1688('0x2b')](respondWithResult(_0x297e82,null))[_0x1688('0x47')](handleError(_0x297e82,null));};exports[_0x1688('0x57')]=function(_0x443adf,_0x112abc,_0x50e728){if(_0x443adf['body']['id']){delete _0x443adf[_0x1688('0x50')]['id'];}return db[_0x1688('0x32')][_0x1688('0x4e')]({'where':{'id':_0x443adf['params']['id']}})['then'](handleEntityNotFound(_0x112abc,null))[_0x1688('0x2b')](function(_0x5c9429){if(_0x5c9429){_0x443adf[_0x1688('0x50')][_0x1688('0x58')]=_0x5c9429['id'];return db[_0x1688('0x56')]['create'](_0x443adf['body']);}})[_0x1688('0x2b')](respondWithResult(_0x112abc,null))[_0x1688('0x47')](handleError(_0x112abc,null));};exports['getAllConditions']=function(_0x2803ea,_0x5dab82,_0x36089f){var _0x25eb2d={};var _0x433924={};var _0x41618e;var _0x56e9b3;return db['Trigger'][_0x1688('0x59')]({'where':{'id':_0x2803ea[_0x1688('0x49')]['id']}})[_0x1688('0x2b')](handleEntityNotFound(_0x5dab82,null))[_0x1688('0x2b')](function(_0x1e9e89){if(_0x1e9e89){_0x41618e=_0x1e9e89;_0x433924['model']=_[_0x1688('0x4a')](db[_0x1688('0x56')][_0x1688('0x4b')]);_0x433924[_0x1688('0x36')]=_['keys'](_0x2803ea[_0x1688('0x36')]);_0x433924['filters']=_[_0x1688('0x38')](_0x433924[_0x1688('0x35')],_0x433924[_0x1688('0x36')]);_0x25eb2d[_0x1688('0x3a')]=_[_0x1688('0x38')](_0x433924['model'],qs[_0x1688('0x39')](_0x2803ea['query'][_0x1688('0x39')]));_0x25eb2d[_0x1688('0x3a')]=_0x25eb2d['attributes'][_0x1688('0x3b')]?_0x25eb2d['attributes']:_0x433924[_0x1688('0x35')];_0x25eb2d['order']=qs[_0x1688('0x3f')](_0x2803ea['query'][_0x1688('0x3f')]);_0x25eb2d[_0x1688('0x40')]=qs[_0x1688('0x37')](_['pick'](_0x2803ea[_0x1688('0x36')],_0x433924[_0x1688('0x37')]));if(_0x2803ea['query'][_0x1688('0x42')]){_0x25eb2d[_0x1688('0x40')]=_[_0x1688('0x43')](_0x25eb2d['where'],{'$or':_[_0x1688('0x31')](_0x25eb2d[_0x1688('0x3a')],function(_0x943caa){var _0x3f15ef={};_0x3f15ef[_0x943caa]={'$like':'%'+_0x2803ea[_0x1688('0x36')][_0x1688('0x42')]+'%'};return _0x3f15ef;})});}_0x25eb2d=_[_0x1688('0x43')]({},_0x25eb2d,_0x2803ea['options']);return _0x41618e[_0x1688('0x5a')](_0x25eb2d);}})[_0x1688('0x2b')](function(_0x476614){if(_0x476614){_0x56e9b3=_0x476614[_0x1688('0x3b')];if(!_0x2803ea[_0x1688('0x36')][_0x1688('0x3c')](_0x1688('0x3d'))){_0x25eb2d[_0x1688('0x1f')]=qs['limit'](_0x2803ea[_0x1688('0x36')][_0x1688('0x1f')]);_0x25eb2d[_0x1688('0x1d')]=qs[_0x1688('0x1d')](_0x2803ea[_0x1688('0x36')][_0x1688('0x1d')]);}return _0x41618e[_0x1688('0x5a')](_0x25eb2d);}})['then'](function(_0x1a1c55){if(_0x1a1c55){return _0x1a1c55?{'count':_0x56e9b3,'rows':_0x1a1c55}:null;}})[_0x1688('0x2b')](respondWithResult(_0x5dab82,null))[_0x1688('0x47')](handleError(_0x5dab82,null));};exports[_0x1688('0x5b')]=function(_0x225b39,_0x3d6f5c,_0x2e7dd1){var _0x24d771={};var _0x25d67f={};var _0x2cfc53;var _0x1f1872;return db[_0x1688('0x32')]['findOne']({'where':{'id':_0x225b39['params']['id']}})[_0x1688('0x2b')](handleEntityNotFound(_0x3d6f5c,null))['then'](function(_0x49677a){if(_0x49677a){_0x2cfc53=_0x49677a;_0x25d67f[_0x1688('0x35')]=_[_0x1688('0x4a')](db[_0x1688('0x56')]['rawAttributes']);_0x25d67f['query']=_[_0x1688('0x4a')](_0x225b39['query']);_0x25d67f['filters']=_[_0x1688('0x38')](_0x25d67f[_0x1688('0x35')],_0x25d67f[_0x1688('0x36')]);_0x24d771[_0x1688('0x3a')]=_[_0x1688('0x38')](_0x25d67f[_0x1688('0x35')],qs[_0x1688('0x39')](_0x225b39[_0x1688('0x36')][_0x1688('0x39')]));_0x24d771[_0x1688('0x3a')]=_0x24d771[_0x1688('0x3a')][_0x1688('0x3b')]?_0x24d771[_0x1688('0x3a')]:_0x25d67f[_0x1688('0x35')];_0x24d771[_0x1688('0x3e')]=qs[_0x1688('0x3f')](_0x225b39[_0x1688('0x36')][_0x1688('0x3f')]);_0x24d771[_0x1688('0x40')]=qs[_0x1688('0x37')](_[_0x1688('0x41')](_0x225b39[_0x1688('0x36')],_0x25d67f[_0x1688('0x37')]));if(_0x225b39['query'][_0x1688('0x42')]){_0x24d771[_0x1688('0x40')]=_['merge'](_0x24d771['where'],{'$or':_[_0x1688('0x31')](_0x24d771[_0x1688('0x3a')],function(_0x43cd3f){var _0x3122b1={};_0x3122b1[_0x43cd3f]={'$like':'%'+_0x225b39[_0x1688('0x36')][_0x1688('0x42')]+'%'};return _0x3122b1;})});}_0x24d771=_['merge']({},_0x24d771,_0x225b39['options']);return _0x2cfc53[_0x1688('0x5b')](_0x24d771);}})[_0x1688('0x2b')](function(_0x1dca73){if(_0x1dca73){_0x1f1872=_0x1dca73[_0x1688('0x3b')];if(!_0x225b39[_0x1688('0x36')]['hasOwnProperty'](_0x1688('0x3d'))){_0x24d771[_0x1688('0x1f')]=qs[_0x1688('0x1f')](_0x225b39[_0x1688('0x36')][_0x1688('0x1f')]);_0x24d771[_0x1688('0x1d')]=qs[_0x1688('0x1d')](_0x225b39[_0x1688('0x36')]['offset']);}return _0x2cfc53[_0x1688('0x5b')](_0x24d771);}})[_0x1688('0x2b')](function(_0x5d87ce){if(_0x5d87ce){return _0x5d87ce?{'count':_0x1f1872,'rows':_0x5d87ce}:null;}})[_0x1688('0x2b')](respondWithResult(_0x3d6f5c,null))[_0x1688('0x47')](handleError(_0x3d6f5c,null));};exports['addAction']=function(_0x57f549,_0x21aa57,_0x1835d6){if(_0x57f549[_0x1688('0x50')]['id']){delete _0x57f549[_0x1688('0x50')]['id'];}return db[_0x1688('0x32')][_0x1688('0x4e')]({'where':{'id':_0x57f549[_0x1688('0x49')]['id']}})[_0x1688('0x2b')](handleEntityNotFound(_0x21aa57,null))[_0x1688('0x2b')](function(_0x4a20f0){if(_0x4a20f0){_0x57f549[_0x1688('0x50')][_0x1688('0x5c')]=_0x4a20f0['id'];return db['Action'][_0x1688('0x4f')](_0x57f549['body']);}})['then'](respondWithResult(_0x21aa57,null))[_0x1688('0x47')](handleError(_0x21aa57,null));};exports['getActions']=function(_0x4c7a74,_0xb5c9a2,_0x283646){var _0x109815={};var _0x1cb2ed={};var _0x5bb508;var _0x2fc382;return db[_0x1688('0x32')][_0x1688('0x59')]({'where':{'id':_0x4c7a74[_0x1688('0x49')]['id']}})['then'](handleEntityNotFound(_0xb5c9a2,null))[_0x1688('0x2b')](function(_0x55c03a){if(_0x55c03a){_0x5bb508=_0x55c03a;_0x1cb2ed[_0x1688('0x35')]=_[_0x1688('0x4a')](db[_0x1688('0x5d')][_0x1688('0x4b')]);_0x1cb2ed[_0x1688('0x36')]=_[_0x1688('0x4a')](_0x4c7a74['query']);_0x1cb2ed['filters']=_[_0x1688('0x38')](_0x1cb2ed[_0x1688('0x35')],_0x1cb2ed[_0x1688('0x36')]);_0x109815[_0x1688('0x3a')]=_[_0x1688('0x38')](_0x1cb2ed[_0x1688('0x35')],qs[_0x1688('0x39')](_0x4c7a74[_0x1688('0x36')]['fields']));_0x109815['attributes']=_0x109815[_0x1688('0x3a')][_0x1688('0x3b')]?_0x109815['attributes']:_0x1cb2ed[_0x1688('0x35')];_0x109815['order']=qs[_0x1688('0x3f')](_0x4c7a74['query'][_0x1688('0x3f')]);_0x109815[_0x1688('0x40')]=qs['filters'](_['pick'](_0x4c7a74[_0x1688('0x36')],_0x1cb2ed[_0x1688('0x37')]));if(_0x4c7a74[_0x1688('0x36')]['filter']){_0x109815['where']=_[_0x1688('0x43')](_0x109815[_0x1688('0x40')],{'$or':_['map'](_0x109815[_0x1688('0x3a')],function(_0x258a3f){var _0x19929b={};_0x19929b[_0x258a3f]={'$like':'%'+_0x4c7a74[_0x1688('0x36')]['filter']+'%'};return _0x19929b;})});}_0x109815=_[_0x1688('0x43')]({},_0x109815,_0x4c7a74[_0x1688('0x4d')]);return _0x5bb508[_0x1688('0x5e')](_0x109815);}})[_0x1688('0x2b')](function(_0x5a1a3e){if(_0x5a1a3e){_0x2fc382=_0x5a1a3e['length'];if(!_0x4c7a74['query'][_0x1688('0x3c')](_0x1688('0x3d'))){_0x109815[_0x1688('0x1f')]=qs[_0x1688('0x1f')](_0x4c7a74[_0x1688('0x36')][_0x1688('0x1f')]);_0x109815['offset']=qs[_0x1688('0x1d')](_0x4c7a74[_0x1688('0x36')][_0x1688('0x1d')]);}return _0x5bb508['getActions'](_0x109815);}})[_0x1688('0x2b')](function(_0x7801d1){if(_0x7801d1){return _0x7801d1?{'count':_0x2fc382,'rows':_0x7801d1}:null;}})[_0x1688('0x2b')](respondWithResult(_0xb5c9a2,null))['catch'](handleError(_0xb5c9a2,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 474e558..1dd05ba 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 _0x2494=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','./trigger.attributes','define','tools_triggers'];(function(_0xf45dbd,_0xa12f0){var _0x1dc148=function(_0x1c70bc){while(--_0x1c70bc){_0xf45dbd['push'](_0xf45dbd['shift']());}};_0x1dc148(++_0xa12f0);}(_0x2494,0x82));var _0x4249=function(_0x283c62,_0x53cd18){_0x283c62=_0x283c62-0x0;var _0xc02cb1=_0x2494[_0x283c62];return _0xc02cb1;};'use strict';var _=require(_0x4249('0x0'));var util=require('util');var logger=require(_0x4249('0x1'))(_0x4249('0x2'));var moment=require(_0x4249('0x3'));var BPromise=require(_0x4249('0x4'));var rp=require(_0x4249('0x5'));var fs=require('fs');var path=require(_0x4249('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4249('0x7'));module['exports']=function(_0x3c2d8d,_0x1d4ca8){return _0x3c2d8d[_0x4249('0x8')]('Trigger',attributes,{'tableName':_0x4249('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa990=['path','./trigger.attributes','exports','define','Trigger','tools_triggers','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x33ca83,_0x54f25c){var _0x175082=function(_0x1c44a9){while(--_0x1c44a9){_0x33ca83['push'](_0x33ca83['shift']());}};_0x175082(++_0x54f25c);}(_0xa990,0xc9));var _0x0a99=function(_0x37a0b4,_0x5adc7d){_0x37a0b4=_0x37a0b4-0x0;var _0x578168=_0xa990[_0x37a0b4];return _0x578168;};'use strict';var _=require(_0x0a99('0x0'));var util=require(_0x0a99('0x1'));var logger=require(_0x0a99('0x2'))(_0x0a99('0x3'));var moment=require(_0x0a99('0x4'));var BPromise=require(_0x0a99('0x5'));var rp=require(_0x0a99('0x6'));var fs=require('fs');var path=require(_0x0a99('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x0a99('0x8'));module[_0x0a99('0x9')]=function(_0xfdb594,_0x320560){return _0xfdb594[_0x0a99('0xa')](_0x0a99('0xb'),attributes,{'tableName':_0x0a99('0xc'),'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 b1dd5ec..d9dd1f2 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 _0x2127=['limit','map','include','model','ShowTrigger','Trigger','find','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','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','GetTrigger','findAll','options','where','attributes'];(function(_0x1ef9ae,_0x30381b){var _0xe34514=function(_0x2480c4){while(--_0x2480c4){_0x1ef9ae['push'](_0x1ef9ae['shift']());}};_0xe34514(++_0x30381b);}(_0x2127,0x1d0));var _0x7212=function(_0x28cd2a,_0x575da0){_0x28cd2a=_0x28cd2a-0x0;var _0x693332=_0x2127[_0x28cd2a];return _0x693332;};'use strict';var _=require(_0x7212('0x0'));var util=require(_0x7212('0x1'));var moment=require(_0x7212('0x2'));var BPromise=require(_0x7212('0x3'));var rs=require(_0x7212('0x4'));var fs=require('fs');var Redis=require(_0x7212('0x5'));var db=require(_0x7212('0x6'))['db'];var utils=require(_0x7212('0x7'));var logger=require(_0x7212('0x8'))(_0x7212('0x9'));var config=require('../../config/environment');var jayson=require(_0x7212('0xa'));var client=jayson[_0x7212('0xb')][_0x7212('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x48a4f0,_0x4bac7a,_0x430fe0){return new BPromise(function(_0x4878e8,_0x54de52){return client[_0x7212('0xd')](_0x48a4f0,_0x430fe0)[_0x7212('0xe')](function(_0x3d8402){logger[_0x7212('0xf')](_0x7212('0x10'),_0x4bac7a,'request\x20sent');logger[_0x7212('0x11')](_0x7212('0x12'),_0x4bac7a,'request\x20sent',JSON[_0x7212('0x13')](_0x3d8402));if(_0x3d8402[_0x7212('0x14')]){if(_0x3d8402[_0x7212('0x14')]['code']===0x1f4){logger[_0x7212('0x14')]('Trigger,\x20%s,\x20%s',_0x4bac7a,_0x3d8402[_0x7212('0x14')]['message']);return _0x54de52(_0x3d8402['error']['message']);}logger['error'](_0x7212('0x10'),_0x4bac7a,_0x3d8402[_0x7212('0x14')][_0x7212('0x15')]);return _0x4878e8(_0x3d8402[_0x7212('0x14')]['message']);}else{logger[_0x7212('0xf')](_0x7212('0x10'),_0x4bac7a,_0x7212('0x16'));_0x4878e8(_0x3d8402[_0x7212('0x17')][_0x7212('0x15')]);}})[_0x7212('0x18')](function(_0x511585){logger[_0x7212('0x14')]('Trigger,\x20%s,\x20%s',_0x4bac7a,_0x511585);_0x54de52(_0x511585);});});}exports[_0x7212('0x19')]=function(_0x3b74b6){var _0x484738=this;return new Promise(function(_0x18093d,_0x48d61b){return db['Trigger'][_0x7212('0x1a')]({'raw':_0x3b74b6['options']?_0x3b74b6[_0x7212('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x3b74b6[_0x7212('0x1b')]?_0x3b74b6[_0x7212('0x1b')][_0x7212('0x1c')]||null:null,'attributes':_0x3b74b6[_0x7212('0x1b')]?_0x3b74b6[_0x7212('0x1b')][_0x7212('0x1d')]||null:null,'limit':_0x3b74b6[_0x7212('0x1b')]?_0x3b74b6['options'][_0x7212('0x1e')]||null:null,'include':_0x3b74b6['options']?_0x3b74b6[_0x7212('0x1b')]['include']?_[_0x7212('0x1f')](_0x3b74b6['options'][_0x7212('0x20')],function(_0xc48891){return{'model':db[_0xc48891[_0x7212('0x21')]],'as':_0xc48891['as'],'attributes':_0xc48891['attributes'],'include':_0xc48891['include']?_[_0x7212('0x1f')](_0xc48891['include'],function(_0x34bf6f){return{'model':db[_0x34bf6f[_0x7212('0x21')]],'as':_0x34bf6f['as'],'attributes':_0x34bf6f[_0x7212('0x1d')],'include':_0x34bf6f['include']?_['map'](_0x34bf6f['include'],function(_0x6d5157){return{'model':db[_0x6d5157[_0x7212('0x21')]],'as':_0x6d5157['as'],'attributes':_0x6d5157[_0x7212('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x7212('0xe')](function(_0x2aba76){logger[_0x7212('0xf')](_0x7212('0x19'),_0x3b74b6);logger[_0x7212('0x11')](_0x7212('0x19'),_0x3b74b6,JSON[_0x7212('0x13')](_0x2aba76));_0x18093d(_0x2aba76);})[_0x7212('0x18')](function(_0x2f1920){logger[_0x7212('0x14')](_0x7212('0x19'),_0x2f1920[_0x7212('0x15')],_0x3b74b6);_0x48d61b(_0x484738[_0x7212('0x14')](0x1f4,_0x2f1920[_0x7212('0x15')]));});});};exports[_0x7212('0x22')]=function(_0xd32bd3){var _0x17f5de=this;return new Promise(function(_0x21cf98,_0x46c791){return db[_0x7212('0x23')][_0x7212('0x24')]({'raw':_0xd32bd3[_0x7212('0x1b')]?_0xd32bd3[_0x7212('0x1b')][_0x7212('0x25')]===undefined?!![]:![]:!![],'where':_0xd32bd3[_0x7212('0x1b')]?_0xd32bd3[_0x7212('0x1b')][_0x7212('0x1c')]||null:null,'attributes':_0xd32bd3['options']?_0xd32bd3[_0x7212('0x1b')][_0x7212('0x1d')]||null:null,'include':_0xd32bd3[_0x7212('0x1b')]?_0xd32bd3[_0x7212('0x1b')][_0x7212('0x20')]?_[_0x7212('0x1f')](_0xd32bd3[_0x7212('0x1b')][_0x7212('0x20')],function(_0x2cf958){return{'model':db[_0x2cf958[_0x7212('0x21')]],'as':_0x2cf958['as'],'attributes':_0x2cf958[_0x7212('0x1d')],'include':_0x2cf958['include']?_[_0x7212('0x1f')](_0x2cf958['include'],function(_0x45a511){return{'model':db[_0x45a511['model']],'as':_0x45a511['as'],'attributes':_0x45a511[_0x7212('0x1d')],'include':_0x45a511[_0x7212('0x20')]?_['map'](_0x45a511[_0x7212('0x20')],function(_0x52d003){return{'model':db[_0x52d003[_0x7212('0x21')]],'as':_0x52d003['as'],'attributes':_0x52d003[_0x7212('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x7212('0xe')](function(_0x59a5af){logger[_0x7212('0xf')](_0x7212('0x22'),_0xd32bd3);logger[_0x7212('0x11')](_0x7212('0x22'),_0xd32bd3,JSON['stringify'](_0x59a5af));_0x21cf98(_0x59a5af);})[_0x7212('0x18')](function(_0x171c22){logger[_0x7212('0x14')](_0x7212('0x22'),_0x171c22[_0x7212('0x15')],_0xd32bd3);_0x46c791(_0x17f5de[_0x7212('0x14')](0x1f4,_0x171c22['message']));});});}; \ No newline at end of file +var _0xade6=['attributes','limit','include','map','model','ShowTrigger','Trigger','then','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','debug','Trigger,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','Trigger,\x20%s,\x20%s','result','catch','GetTrigger','raw','options','where'];(function(_0xe20bfc,_0x31fc9b){var _0x5b6cd0=function(_0x15f408){while(--_0x15f408){_0xe20bfc['push'](_0xe20bfc['shift']());}};_0x5b6cd0(++_0x31fc9b);}(_0xade6,0x120));var _0x6ade=function(_0x19babd,_0x1d4ef7){_0x19babd=_0x19babd-0x0;var _0x314eaf=_0xade6[_0x19babd];return _0x314eaf;};'use strict';var _=require(_0x6ade('0x0'));var util=require(_0x6ade('0x1'));var moment=require(_0x6ade('0x2'));var BPromise=require('bluebird');var rs=require(_0x6ade('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6ade('0x4'))['db'];var utils=require(_0x6ade('0x5'));var logger=require(_0x6ade('0x6'))(_0x6ade('0x7'));var config=require(_0x6ade('0x8'));var jayson=require(_0x6ade('0x9'));var client=jayson[_0x6ade('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x274878,_0x2b0347,_0x2f6f13){return new BPromise(function(_0x5356eb,_0x4f8586){return client[_0x6ade('0xb')](_0x274878,_0x2f6f13)['then'](function(_0xaf7ff1){logger[_0x6ade('0xc')]('Trigger,\x20%s,\x20%s',_0x2b0347,'request\x20sent');logger[_0x6ade('0xd')](_0x6ade('0xe'),_0x2b0347,_0x6ade('0xf'),JSON[_0x6ade('0x10')](_0xaf7ff1));if(_0xaf7ff1[_0x6ade('0x11')]){if(_0xaf7ff1['error'][_0x6ade('0x12')]===0x1f4){logger['error']('Trigger,\x20%s,\x20%s',_0x2b0347,_0xaf7ff1[_0x6ade('0x11')][_0x6ade('0x13')]);return _0x4f8586(_0xaf7ff1[_0x6ade('0x11')][_0x6ade('0x13')]);}logger[_0x6ade('0x11')]('Trigger,\x20%s,\x20%s',_0x2b0347,_0xaf7ff1[_0x6ade('0x11')][_0x6ade('0x13')]);return _0x5356eb(_0xaf7ff1[_0x6ade('0x11')][_0x6ade('0x13')]);}else{logger['info'](_0x6ade('0x14'),_0x2b0347,_0x6ade('0xf'));_0x5356eb(_0xaf7ff1[_0x6ade('0x15')][_0x6ade('0x13')]);}})[_0x6ade('0x16')](function(_0x54e901){logger[_0x6ade('0x11')](_0x6ade('0x14'),_0x2b0347,_0x54e901);_0x4f8586(_0x54e901);});});}exports[_0x6ade('0x17')]=function(_0x52a3ca){var _0x4a5e92=this;return new Promise(function(_0x2e32b9,_0x45d9d5){return db['Trigger']['findAll']({'raw':_0x52a3ca['options']?_0x52a3ca['options'][_0x6ade('0x18')]===undefined?!![]:![]:!![],'where':_0x52a3ca[_0x6ade('0x19')]?_0x52a3ca['options'][_0x6ade('0x1a')]||null:null,'attributes':_0x52a3ca['options']?_0x52a3ca[_0x6ade('0x19')][_0x6ade('0x1b')]||null:null,'limit':_0x52a3ca[_0x6ade('0x19')]?_0x52a3ca[_0x6ade('0x19')][_0x6ade('0x1c')]||null:null,'include':_0x52a3ca['options']?_0x52a3ca[_0x6ade('0x19')][_0x6ade('0x1d')]?_[_0x6ade('0x1e')](_0x52a3ca['options'][_0x6ade('0x1d')],function(_0x4b4ea9){return{'model':db[_0x4b4ea9[_0x6ade('0x1f')]],'as':_0x4b4ea9['as'],'attributes':_0x4b4ea9['attributes'],'include':_0x4b4ea9[_0x6ade('0x1d')]?_[_0x6ade('0x1e')](_0x4b4ea9['include'],function(_0x57057d){return{'model':db[_0x57057d[_0x6ade('0x1f')]],'as':_0x57057d['as'],'attributes':_0x57057d[_0x6ade('0x1b')],'include':_0x57057d[_0x6ade('0x1d')]?_['map'](_0x57057d[_0x6ade('0x1d')],function(_0xa9c513){return{'model':db[_0xa9c513[_0x6ade('0x1f')]],'as':_0xa9c513['as'],'attributes':_0xa9c513[_0x6ade('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4902d8){logger[_0x6ade('0xc')](_0x6ade('0x17'),_0x52a3ca);logger[_0x6ade('0xd')](_0x6ade('0x17'),_0x52a3ca,JSON[_0x6ade('0x10')](_0x4902d8));_0x2e32b9(_0x4902d8);})[_0x6ade('0x16')](function(_0x5d0c12){logger[_0x6ade('0x11')](_0x6ade('0x17'),_0x5d0c12[_0x6ade('0x13')],_0x52a3ca);_0x45d9d5(_0x4a5e92[_0x6ade('0x11')](0x1f4,_0x5d0c12[_0x6ade('0x13')]));});});};exports[_0x6ade('0x20')]=function(_0x27c608){var _0x133030=this;return new Promise(function(_0x55d287,_0x44266d){return db[_0x6ade('0x21')]['find']({'raw':_0x27c608[_0x6ade('0x19')]?_0x27c608[_0x6ade('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x27c608['options']?_0x27c608[_0x6ade('0x19')]['where']||null:null,'attributes':_0x27c608[_0x6ade('0x19')]?_0x27c608['options'][_0x6ade('0x1b')]||null:null,'include':_0x27c608['options']?_0x27c608[_0x6ade('0x19')][_0x6ade('0x1d')]?_['map'](_0x27c608['options'][_0x6ade('0x1d')],function(_0x228e41){return{'model':db[_0x228e41['model']],'as':_0x228e41['as'],'attributes':_0x228e41[_0x6ade('0x1b')],'include':_0x228e41[_0x6ade('0x1d')]?_[_0x6ade('0x1e')](_0x228e41[_0x6ade('0x1d')],function(_0x5158dc){return{'model':db[_0x5158dc[_0x6ade('0x1f')]],'as':_0x5158dc['as'],'attributes':_0x5158dc[_0x6ade('0x1b')],'include':_0x5158dc['include']?_[_0x6ade('0x1e')](_0x5158dc[_0x6ade('0x1d')],function(_0x5e5b8d){return{'model':db[_0x5e5b8d['model']],'as':_0x5e5b8d['as'],'attributes':_0x5e5b8d['attributes']};}):[]};}):[]};}):[]:[]})[_0x6ade('0x22')](function(_0x21942c){logger['info'](_0x6ade('0x20'),_0x27c608);logger['debug'](_0x6ade('0x20'),_0x27c608,JSON[_0x6ade('0x10')](_0x21942c));_0x55d287(_0x21942c);})['catch'](function(_0x8b4ad8){logger[_0x6ade('0x11')](_0x6ade('0x20'),_0x8b4ad8['message'],_0x27c608);_0x44266d(_0x133030['error'](0x1f4,_0x8b4ad8[_0x6ade('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index 3e75732..d860ab7 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 _0x33cc=['connect-timeout','express','Router','../../components/auth/service','../../config/environment','./trunk.controller','index','isAuthenticated','show','post','/:id/clone','create','put','delete','/:id','destroy','exports','multer'];(function(_0x2d5d04,_0xef63bd){var _0x4e59b1=function(_0xe15c0b){while(--_0xe15c0b){_0x2d5d04['push'](_0x2d5d04['shift']());}};_0x4e59b1(++_0xef63bd);}(_0x33cc,0xd7));var _0xc33c=function(_0x46713f,_0x32bfd8){_0x46713f=_0x46713f-0x0;var _0x5d53d3=_0x33cc[_0x46713f];return _0x5d53d3;};'use strict';var multer=require(_0xc33c('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xc33c('0x1'));var express=require(_0xc33c('0x2'));var router=express[_0xc33c('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xc33c('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xc33c('0x5'));var controller=require(_0xc33c('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xc33c('0x7')]);router['get']('/:id',auth[_0xc33c('0x8')](),controller[_0xc33c('0x9')]);router[_0xc33c('0xa')](_0xc33c('0xb'),auth[_0xc33c('0x8')](),controller['clone']);router['post']('/',auth['isAuthenticated'](),controller[_0xc33c('0xc')]);router[_0xc33c('0xd')]('/:id',auth[_0xc33c('0x8')](),controller['update']);router[_0xc33c('0xe')](_0xc33c('0xf'),auth[_0xc33c('0x8')](),controller[_0xc33c('0x10')]);module[_0xc33c('0x11')]=router; \ No newline at end of file +var _0xfa42=['path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./trunk.controller','isAuthenticated','index','get','show','post','clone','create','put','/:id','update','delete','multer','util'];(function(_0x2b762d,_0x453a43){var _0x44b267=function(_0xdecc38){while(--_0xdecc38){_0x2b762d['push'](_0x2b762d['shift']());}};_0x44b267(++_0x453a43);}(_0xfa42,0x152));var _0x2fa4=function(_0x4f6d05,_0x351e5f){_0x4f6d05=_0x4f6d05-0x0;var _0x4fbfd0=_0xfa42[_0x4f6d05];return _0x4fbfd0;};'use strict';var multer=require(_0x2fa4('0x0'));var util=require(_0x2fa4('0x1'));var path=require(_0x2fa4('0x2'));var timeout=require(_0x2fa4('0x3'));var express=require(_0x2fa4('0x4'));var router=express['Router']();var fs_extra=require(_0x2fa4('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x2fa4('0x6'));var config=require(_0x2fa4('0x7'));var controller=require(_0x2fa4('0x8'));router['get']('/',auth[_0x2fa4('0x9')](),controller[_0x2fa4('0xa')]);router[_0x2fa4('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x2fa4('0xc')]);router[_0x2fa4('0xd')]('/:id/clone',auth[_0x2fa4('0x9')](),controller[_0x2fa4('0xe')]);router[_0x2fa4('0xd')]('/',auth['isAuthenticated'](),controller[_0x2fa4('0xf')]);router[_0x2fa4('0x10')](_0x2fa4('0x11'),auth[_0x2fa4('0x9')](),controller[_0x2fa4('0x12')]);router[_0x2fa4('0x13')]('/:id',auth[_0x2fa4('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index b2d882e..9f6db57 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 _0x0fb2=['update,nonat','BOOLEAN','sequelize','name','ENUM','friend','user','peer','STRING','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','PROHIB','udp','setDataValue','transport','join','getDataValue','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','update','outgoing','nat','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','always','refuse','originate','uac','uas','pai','fingerprint','certificate','active','passive','dynamic','nonat'];(function(_0x59361c,_0x587423){var _0x212ec9=function(_0x3da84e){while(--_0x3da84e){_0x59361c['push'](_0x59361c['shift']());}};_0x212ec9(++_0x587423);}(_0x0fb2,0x9e));var _0x20fb=function(_0x12833b,_0x26c1d2){_0x12833b=_0x12833b-0x0;var _0x3acad3=_0x0fb2[_0x12833b];return _0x3acad3;};'use strict';var Sequelize=require(_0x20fb('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x20fb('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x20fb('0x2')](_0x20fb('0x3'),_0x20fb('0x4'),_0x20fb('0x5')),'allowNull':![],'defaultValue':_0x20fb('0x3')},'context':{'type':Sequelize[_0x20fb('0x6')],'allowNull':![],'defaultValue':_0x20fb('0x7')},'callingpres':{'type':Sequelize[_0x20fb('0x2')](_0x20fb('0x8'),_0x20fb('0x9'),_0x20fb('0xa'),'ALLOWED',_0x20fb('0xb'),'PROHIB_PASSED_SCREEN',_0x20fb('0xc'),_0x20fb('0xd'))},'deny':{'type':Sequelize['STRING']},'permit':{'type':Sequelize[_0x20fb('0x6')]},'secret':{'type':Sequelize[_0x20fb('0x6')]},'md5secret':{'type':Sequelize[_0x20fb('0x6')]},'remotesecret':{'type':Sequelize[_0x20fb('0x6')]},'transport':{'type':Sequelize['STRING'],'defaultValue':_0x20fb('0xe'),'set':function(_0x2b4adb){this[_0x20fb('0xf')](_0x20fb('0x10'),_0x2b4adb?_0x2b4adb[_0x20fb('0x11')](','):null);},'get':function(){return this[_0x20fb('0x12')](_0x20fb('0x10'))?this['getDataValue'](_0x20fb('0x10'))['split'](','):null;},'comment':_0x20fb('0x13')},'dtmfmode':{'type':Sequelize[_0x20fb('0x2')](_0x20fb('0x14'),_0x20fb('0x15'),_0x20fb('0x16'),_0x20fb('0x17'),_0x20fb('0x18')),'defaultValue':_0x20fb('0x14')},'directmedia':{'type':Sequelize[_0x20fb('0x2')](_0x20fb('0x19'),'no','nonat',_0x20fb('0x1a'),_0x20fb('0x1b')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x20fb('0x2')](_0x20fb('0x19'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize[_0x20fb('0x6')],'defaultValue':'force_rport,comedia','set':function(_0xfe8652){this['setDataValue'](_0x20fb('0x1c'),_0xfe8652?_0xfe8652[_0x20fb('0x11')](','):null);},'get':function(){return this[_0x20fb('0x12')](_0x20fb('0x1c'))?this[_0x20fb('0x12')]('nat')[_0x20fb('0x1d')](','):null;},'comment':_0x20fb('0x1e')},'callgroup':{'type':Sequelize[_0x20fb('0x6')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x20fb('0x6')]},'namedpickupgroup':{'type':Sequelize[_0x20fb('0x6')]},'language':{'type':Sequelize[_0x20fb('0x6')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x20fb('0x6')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x20fb('0x6')],'defaultValue':_0x20fb('0x1f')},'allow':{'type':Sequelize[_0x20fb('0x6')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x3532f2){this[_0x20fb('0xf')]('allow',_0x3532f2?_0x3532f2[_0x20fb('0x11')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0x20fb('0x12')](_0x20fb('0x20'))?this[_0x20fb('0x12')](_0x20fb('0x20'))[_0x20fb('0x1d')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize[_0x20fb('0x2')](_0x20fb('0x19'),'no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':_0x20fb('0x21'),'set':function(_0x267c9){this[_0x20fb('0xf')](_0x20fb('0x22'),_0x267c9?_0x267c9[_0x20fb('0x11')](','):null);},'get':function(){return this[_0x20fb('0x12')](_0x20fb('0x22'))?this[_0x20fb('0x12')](_0x20fb('0x22'))[_0x20fb('0x1d')](','):null;},'comment':_0x20fb('0x23')},'trustrpid':{'type':Sequelize[_0x20fb('0x2')](_0x20fb('0x19'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x20fb('0x2')]('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x20fb('0x2')](_0x20fb('0x19'),'no',_0x20fb('0x24'))},'promiscredir':{'type':Sequelize['ENUM'](_0x20fb('0x19'),'no')},'useclientcode':{'type':Sequelize[_0x20fb('0x2')](_0x20fb('0x19'),'no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize[_0x20fb('0x6')]},'callerid':{'type':Sequelize['STRING'],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize[_0x20fb('0x2')](_0x20fb('0x19'),'no'),'defaultValue':_0x20fb('0x19')},'busylevel':{'type':Sequelize[_0x20fb('0x25')](0xb)},'allowoverlap':{'type':Sequelize[_0x20fb('0x2')](_0x20fb('0x19'),'no')},'allowsubscribe':{'type':Sequelize[_0x20fb('0x2')](_0x20fb('0x19'),'no')},'allowtransfer':{'type':Sequelize[_0x20fb('0x2')](_0x20fb('0x19'),'no')},'ignoresdpversion':{'type':Sequelize[_0x20fb('0x2')](_0x20fb('0x19'),'no')},'subscribecontext':{'type':Sequelize[_0x20fb('0x6')]},'template':{'type':Sequelize[_0x20fb('0x6')]},'videosupport':{'type':Sequelize['ENUM'](_0x20fb('0x19'),'no',_0x20fb('0x26')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb)},'rfc2833compensate':{'type':Sequelize['ENUM'](_0x20fb('0x19'),'no')},'mailbox':{'type':Sequelize[_0x20fb('0x6')]},'session_timers':{'type':Sequelize['ENUM']('accept',_0x20fb('0x27'),_0x20fb('0x28'))},'session_expires':{'type':Sequelize[_0x20fb('0x25')](0xb)},'session_minse':{'type':Sequelize['INTEGER'](0xb)},'session_refresher':{'type':Sequelize[_0x20fb('0x2')](_0x20fb('0x29'),_0x20fb('0x2a')),'defaultValue':_0x20fb('0x2a')},'t38pt_usertpsource':{'type':Sequelize['STRING']},'regexten':{'type':Sequelize[_0x20fb('0x6')]},'fromdomain':{'type':Sequelize['STRING']},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize['INTEGER'](0x5)},'qualify':{'type':Sequelize[_0x20fb('0x2')](_0x20fb('0x19'),'no'),'defaultValue':_0x20fb('0x19')},'keepalive':{'type':Sequelize[_0x20fb('0x25')](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize[_0x20fb('0x6')]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x20fb('0x25')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x20fb('0x25')](0xb)},'sendrpid':{'type':Sequelize[_0x20fb('0x2')](_0x20fb('0x19'),'no',_0x20fb('0x2b')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x20fb('0x6')]},'callbackextension':{'type':Sequelize[_0x20fb('0x6')]},'timert1':{'type':Sequelize[_0x20fb('0x25')](0xb)},'timerb':{'type':Sequelize[_0x20fb('0x25')](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize[_0x20fb('0x6')]},'contactdeny':{'type':Sequelize[_0x20fb('0x6')]},'contactacl':{'type':Sequelize[_0x20fb('0x6')]},'unsolicited_mailbox':{'type':Sequelize[_0x20fb('0x6')]},'use_q850_reason':{'type':Sequelize[_0x20fb('0x6')]},'maxforwards':{'type':Sequelize[_0x20fb('0x25')](0xb)},'encryption':{'type':Sequelize[_0x20fb('0x2')](_0x20fb('0x19'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x20fb('0x2')](_0x20fb('0x19'),'no')},'force_avp':{'type':Sequelize[_0x20fb('0x2')](_0x20fb('0x19'),'no')},'icesupport':{'type':Sequelize[_0x20fb('0x2')](_0x20fb('0x19'),'no')},'dtlsenable':{'type':Sequelize[_0x20fb('0x2')](_0x20fb('0x19'),'no')},'dtlsverify':{'type':Sequelize[_0x20fb('0x2')]('yes','no',_0x20fb('0x2c'),_0x20fb('0x2d'))},'dtlsrekey':{'type':Sequelize[_0x20fb('0x25')](0xb)},'dtlscertfile':{'type':Sequelize[_0x20fb('0x6')]},'dtlsprivatekey':{'type':Sequelize[_0x20fb('0x6')]},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize[_0x20fb('0x6')]},'dtlscapath':{'type':Sequelize[_0x20fb('0x6')]},'dtlssetup':{'type':Sequelize[_0x20fb('0x2')](_0x20fb('0x2e'),_0x20fb('0x2f'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING']},'usereqphone':{'type':Sequelize[_0x20fb('0x2')]('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize[_0x20fb('0x6')]},'call_limit':{'type':Sequelize[_0x20fb('0x25')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x20fb('0x2')](_0x20fb('0x19'),'no')},'subscribemwi':{'type':Sequelize[_0x20fb('0x2')](_0x20fb('0x19'),'no')},'vmexten':{'type':Sequelize[_0x20fb('0x6')]},'mohinterpret':{'type':Sequelize['STRING']},'mohsuggest':{'type':Sequelize[_0x20fb('0x6')]},'parkinglot':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x20fb('0x6')]},'host':{'type':Sequelize[_0x20fb('0x6')],'defaultValue':_0x20fb('0x30')},'canreinvite':{'type':Sequelize[_0x20fb('0x2')](_0x20fb('0x19'),'no',_0x20fb('0x31'),_0x20fb('0x1a'),_0x20fb('0x32')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x20fb('0x6')]},'otherFields':{'type':Sequelize[_0x20fb('0x6')]},'active':{'type':Sequelize[_0x20fb('0x33')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x20fb('0x6')],'defaultValue':'no'}}; \ No newline at end of file +var _0xc0f2=['all','ulaw;alaw;gsm','allow','port,invite','insecure','never','INTEGER','always','accept','refuse','originate','uas','pai','certificate','passive','nonat','update,nonat','BOOLEAN','sequelize','exports','STRING','ENUM','friend','user','peer','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','setDataValue','transport','getDataValue','split','rfc2833','auto','yes','update','force_rport,comedia','join','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'];(function(_0xbfc560,_0x311fba){var _0x47b022=function(_0x2cd37f){while(--_0x2cd37f){_0xbfc560['push'](_0xbfc560['shift']());}};_0x47b022(++_0x311fba);}(_0xc0f2,0x1b0));var _0x2c0f=function(_0x5e301d,_0x37628e){_0x5e301d=_0x5e301d-0x0;var _0x3b217f=_0xc0f2[_0x5e301d];return _0x3b217f;};'use strict';var Sequelize=require(_0x2c0f('0x0'));module[_0x2c0f('0x1')]={'name':{'type':Sequelize[_0x2c0f('0x2')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x2c0f('0x3')](_0x2c0f('0x4'),_0x2c0f('0x5'),_0x2c0f('0x6')),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize[_0x2c0f('0x2')],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize[_0x2c0f('0x3')](_0x2c0f('0x7'),_0x2c0f('0x8'),_0x2c0f('0x9'),_0x2c0f('0xa'),_0x2c0f('0xb'),_0x2c0f('0xc'),_0x2c0f('0xd'),_0x2c0f('0xe'))},'deny':{'type':Sequelize[_0x2c0f('0x2')]},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize[_0x2c0f('0x2')]},'md5secret':{'type':Sequelize['STRING']},'remotesecret':{'type':Sequelize[_0x2c0f('0x2')]},'transport':{'type':Sequelize['STRING'],'defaultValue':_0x2c0f('0xf'),'set':function(_0x3cd43f){this[_0x2c0f('0x10')](_0x2c0f('0x11'),_0x3cd43f?_0x3cd43f['join'](','):null);},'get':function(){return this[_0x2c0f('0x12')]('transport')?this['getDataValue']('transport')[_0x2c0f('0x13')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize['ENUM'](_0x2c0f('0x14'),'info','shortinfo','inband',_0x2c0f('0x15')),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0x2c0f('0x3')](_0x2c0f('0x16'),'no','nonat',_0x2c0f('0x17'),'outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x2c0f('0x3')](_0x2c0f('0x16'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x2c0f('0x2')]},'directmediadeny':{'type':Sequelize[_0x2c0f('0x2')]},'nat':{'type':Sequelize[_0x2c0f('0x2')],'defaultValue':_0x2c0f('0x18'),'set':function(_0x1cedd0){this[_0x2c0f('0x10')]('nat',_0x1cedd0?_0x1cedd0[_0x2c0f('0x19')](','):null);},'get':function(){return this['getDataValue'](_0x2c0f('0x1a'))?this[_0x2c0f('0x12')](_0x2c0f('0x1a'))[_0x2c0f('0x13')](','):null;},'comment':_0x2c0f('0x1b')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x2c0f('0x2')]},'pickupgroup':{'type':Sequelize[_0x2c0f('0x2')]},'namedpickupgroup':{'type':Sequelize[_0x2c0f('0x2')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x2c0f('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x2c0f('0x2')],'defaultValue':_0x2c0f('0x1c')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x2c0f('0x1d'),'set':function(_0x5be8b1){this[_0x2c0f('0x10')](_0x2c0f('0x1e'),_0x5be8b1?_0x5be8b1[_0x2c0f('0x19')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0x2c0f('0x12')](_0x2c0f('0x1e'))?this[_0x2c0f('0x12')](_0x2c0f('0x1e'))[_0x2c0f('0x13')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize[_0x2c0f('0x3')](_0x2c0f('0x16'),'no')},'insecure':{'type':Sequelize[_0x2c0f('0x2')],'defaultValue':_0x2c0f('0x1f'),'set':function(_0x32dbc5){this[_0x2c0f('0x10')](_0x2c0f('0x20'),_0x32dbc5?_0x32dbc5[_0x2c0f('0x19')](','):null);},'get':function(){return this[_0x2c0f('0x12')](_0x2c0f('0x20'))?this[_0x2c0f('0x12')](_0x2c0f('0x20'))[_0x2c0f('0x13')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x2c0f('0x3')](_0x2c0f('0x16'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x2c0f('0x3')]('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x2c0f('0x3')](_0x2c0f('0x16'),'no',_0x2c0f('0x21'))},'promiscredir':{'type':Sequelize[_0x2c0f('0x3')](_0x2c0f('0x16'),'no')},'useclientcode':{'type':Sequelize['ENUM']('yes','no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize[_0x2c0f('0x2')]},'callerid':{'type':Sequelize['STRING'],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0x2c0f('0x2')]},'callcounter':{'type':Sequelize[_0x2c0f('0x3')](_0x2c0f('0x16'),'no'),'defaultValue':_0x2c0f('0x16')},'busylevel':{'type':Sequelize[_0x2c0f('0x22')](0xb)},'allowoverlap':{'type':Sequelize[_0x2c0f('0x3')](_0x2c0f('0x16'),'no')},'allowsubscribe':{'type':Sequelize['ENUM'](_0x2c0f('0x16'),'no')},'allowtransfer':{'type':Sequelize['ENUM'](_0x2c0f('0x16'),'no')},'ignoresdpversion':{'type':Sequelize['ENUM']('yes','no')},'subscribecontext':{'type':Sequelize['STRING']},'template':{'type':Sequelize[_0x2c0f('0x2')]},'videosupport':{'type':Sequelize[_0x2c0f('0x3')](_0x2c0f('0x16'),'no',_0x2c0f('0x23')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x2c0f('0x22')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x2c0f('0x3')](_0x2c0f('0x16'),'no')},'mailbox':{'type':Sequelize[_0x2c0f('0x2')]},'session_timers':{'type':Sequelize[_0x2c0f('0x3')](_0x2c0f('0x24'),_0x2c0f('0x25'),_0x2c0f('0x26'))},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize[_0x2c0f('0x22')](0xb)},'session_refresher':{'type':Sequelize[_0x2c0f('0x3')]('uac','uas'),'defaultValue':_0x2c0f('0x27')},'t38pt_usertpsource':{'type':Sequelize[_0x2c0f('0x2')]},'regexten':{'type':Sequelize[_0x2c0f('0x2')]},'fromdomain':{'type':Sequelize[_0x2c0f('0x2')]},'fromuser':{'type':Sequelize[_0x2c0f('0x2')]},'port':{'type':Sequelize[_0x2c0f('0x22')](0x5)},'qualify':{'type':Sequelize[_0x2c0f('0x3')](_0x2c0f('0x16'),'no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x2c0f('0x22')](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize[_0x2c0f('0x2')]},'rtptimeout':{'type':Sequelize[_0x2c0f('0x22')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x2c0f('0x22')](0xb)},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb)},'sendrpid':{'type':Sequelize['ENUM'](_0x2c0f('0x16'),'no',_0x2c0f('0x28')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x2c0f('0x2')]},'callbackextension':{'type':Sequelize[_0x2c0f('0x2')]},'timert1':{'type':Sequelize[_0x2c0f('0x22')](0xb)},'timerb':{'type':Sequelize[_0x2c0f('0x22')](0xb)},'qualifyfreq':{'type':Sequelize[_0x2c0f('0x22')](0xb)},'contactpermit':{'type':Sequelize[_0x2c0f('0x2')]},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize[_0x2c0f('0x2')]},'unsolicited_mailbox':{'type':Sequelize[_0x2c0f('0x2')]},'use_q850_reason':{'type':Sequelize['STRING']},'maxforwards':{'type':Sequelize[_0x2c0f('0x22')](0xb)},'encryption':{'type':Sequelize[_0x2c0f('0x3')](_0x2c0f('0x16'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x2c0f('0x3')](_0x2c0f('0x16'),'no')},'force_avp':{'type':Sequelize[_0x2c0f('0x3')](_0x2c0f('0x16'),'no')},'icesupport':{'type':Sequelize['ENUM'](_0x2c0f('0x16'),'no')},'dtlsenable':{'type':Sequelize[_0x2c0f('0x3')]('yes','no')},'dtlsverify':{'type':Sequelize['ENUM'](_0x2c0f('0x16'),'no','fingerprint',_0x2c0f('0x29'))},'dtlsrekey':{'type':Sequelize[_0x2c0f('0x22')](0xb)},'dtlscertfile':{'type':Sequelize[_0x2c0f('0x2')]},'dtlsprivatekey':{'type':Sequelize[_0x2c0f('0x2')]},'dtlscipher':{'type':Sequelize[_0x2c0f('0x2')]},'dtlscafile':{'type':Sequelize[_0x2c0f('0x2')]},'dtlscapath':{'type':Sequelize[_0x2c0f('0x2')]},'dtlssetup':{'type':Sequelize[_0x2c0f('0x3')]('active',_0x2c0f('0x2a'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x2c0f('0x2')]},'usereqphone':{'type':Sequelize[_0x2c0f('0x3')](_0x2c0f('0x16'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize[_0x2c0f('0x2')]},'call_limit':{'type':Sequelize[_0x2c0f('0x22')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x2c0f('0x3')](_0x2c0f('0x16'),'no')},'subscribemwi':{'type':Sequelize[_0x2c0f('0x3')](_0x2c0f('0x16'),'no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize[_0x2c0f('0x2')]},'mohsuggest':{'type':Sequelize['STRING']},'parkinglot':{'type':Sequelize[_0x2c0f('0x2')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING'],'defaultValue':'dynamic'},'canreinvite':{'type':Sequelize[_0x2c0f('0x3')](_0x2c0f('0x16'),'no',_0x2c0f('0x2b'),'update',_0x2c0f('0x2c')),'defaultValue':'no'},'registry':{'type':Sequelize['STRING']},'otherFields':{'type':Sequelize[_0x2c0f('0x2')]},'active':{'type':Sequelize[_0x2c0f('0x2d')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x2c0f('0x2')],'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 c9659a2..16deba8 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 _0x98a8=['../../mysqldb','jayson/promise','client','request','Trunk,\x20%s,\x20%s','debug','request\x20sent','error','code','message','info','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','destroy','get','Trunks','UserProfileResource','stack','name','map','fieldName','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','Trunk','include','show','params','keys','rawAttributes','includeAll','clone','find','createdAt','updatedAt','body','omit','create','user','role','UserProfileSection','userProfileId','autoAssociation','findAll','readFileSync','root','server/files/templates/trunk.ejs','join','server/files/templates/registry.ejs','utf8','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment'];(function(_0x1c7cde,_0x14456f){var _0x465ddc=function(_0x285ff3){while(--_0x285ff3){_0x1c7cde['push'](_0x1c7cde['shift']());}};_0x465ddc(++_0x14456f);}(_0x98a8,0x12c));var _0x898a=function(_0x16f706,_0xa7be3){_0x16f706=_0x16f706-0x0;var _0x164451=_0x98a8[_0x16f706];return _0x164451;};'use strict';var emlformat=require(_0x898a('0x0'));var rimraf=require(_0x898a('0x1'));var zipdir=require(_0x898a('0x2'));var jsonpatch=require(_0x898a('0x3'));var rp=require(_0x898a('0x4'));var moment=require(_0x898a('0x5'));var BPromise=require(_0x898a('0x6'));var Mustache=require('mustache');var util=require(_0x898a('0x7'));var path=require(_0x898a('0x8'));var sox=require(_0x898a('0x9'));var csv=require(_0x898a('0xa'));var ejs=require(_0x898a('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x898a('0xc'));var squel=require('squel');var crypto=require(_0x898a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x898a('0xe'));var toCsv=require(_0x898a('0xa'));var querystring=require(_0x898a('0xf'));var Papa=require(_0x898a('0x10'));var Redis=require(_0x898a('0x11'));var authService=require(_0x898a('0x12'));var qs=require(_0x898a('0x13'));var as=require(_0x898a('0x14'));var hardwareService=require(_0x898a('0x15'));var logger=require('../../config/logger')(_0x898a('0x16'));var utils=require('../../config/utils');var config=require(_0x898a('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x898a('0x18'))['db'];var jayson=require(_0x898a('0x19'));var client=jayson[_0x898a('0x1a')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5bfded,_0x5b5c9c,_0x373d53,_0x1f5be4){return new BPromise(function(_0xb24335,_0x116fbe){var _0x1873e9=_0x1f5be4||client;return _0x1873e9[_0x898a('0x1b')](_0x5bfded,_0x373d53)['then'](function(_0x47033c){logger['info'](_0x898a('0x1c'),_0x5b5c9c,'request\x20sent');logger[_0x898a('0x1d')]('Trunk,\x20%s,\x20%s,\x20%s',_0x5b5c9c,_0x898a('0x1e'),JSON['stringify'](_0x47033c));if(_0x47033c[_0x898a('0x1f')]){if(_0x47033c[_0x898a('0x1f')][_0x898a('0x20')]===0x1f4){logger['error'](_0x898a('0x1c'),_0x5b5c9c,_0x47033c['error']['message']);return _0x116fbe(_0x47033c[_0x898a('0x1f')][_0x898a('0x21')]);}logger['error']('Trunk,\x20%s,\x20%s',_0x5b5c9c,_0x47033c[_0x898a('0x1f')][_0x898a('0x21')]);return _0xb24335(_0x47033c[_0x898a('0x1f')][_0x898a('0x21')]);}else{logger[_0x898a('0x22')](_0x898a('0x1c'),_0x5b5c9c,_0x898a('0x1e'));_0xb24335(_0x47033c['result'][_0x898a('0x21')]);}})[_0x898a('0x23')](function(_0x11cae2){logger[_0x898a('0x1f')](_0x898a('0x1c'),_0x5b5c9c,_0x11cae2);_0x116fbe(_0x11cae2);});});}function respondWithStatusCode(_0x310bfa,_0x4e254d){_0x4e254d=_0x4e254d||0xcc;return function(_0x274cdf){if(_0x274cdf){return _0x310bfa[_0x898a('0x24')](_0x4e254d);}return _0x310bfa[_0x898a('0x25')](_0x4e254d)[_0x898a('0x26')]();};}function respondWithResult(_0x3901ab,_0x1426e3){_0x1426e3=_0x1426e3||0xc8;return function(_0x5b7719){if(_0x5b7719){return _0x3901ab[_0x898a('0x25')](_0x1426e3)['json'](_0x5b7719);}};}function respondWithFilteredResult(_0x513c6b,_0x53ddb2){return function(_0x3678be){if(_0x3678be){var _0x1f4d86=typeof _0x53ddb2[_0x898a('0x27')]===_0x898a('0x28')&&typeof _0x53ddb2[_0x898a('0x29')]===_0x898a('0x28');var _0x398e98=_0x3678be[_0x898a('0x2a')];var _0xd31922=_0x1f4d86?0x0:_0x53ddb2['offset'];var _0x4b3e68=_0x1f4d86?_0x3678be['count']:_0x53ddb2[_0x898a('0x27')]+_0x53ddb2[_0x898a('0x29')];var _0x3b7704;if(_0x4b3e68>=_0x398e98){_0x4b3e68=_0x398e98;_0x3b7704=0xc8;}else{_0x3b7704=0xce;}_0x513c6b[_0x898a('0x25')](_0x3b7704);return _0x513c6b[_0x898a('0x2b')](_0x898a('0x2c'),_0xd31922+'-'+_0x4b3e68+'/'+_0x398e98)[_0x898a('0x2d')](_0x3678be);}return null;};}function patchUpdates(_0xf74645){return function(_0x18773a){try{jsonpatch[_0x898a('0x2e')](_0x18773a,_0xf74645,!![]);}catch(_0x44c5d2){return BPromise[_0x898a('0x2f')](_0x44c5d2);}return _0x18773a['save']();};}function saveUpdates(_0x7a1eb5,_0x17a5f3){return function(_0x26eead){if(_0x26eead){return _0x26eead[_0x898a('0x30')](_0x7a1eb5)[_0x898a('0x31')](function(_0x47af5b){return _0x47af5b;});}return null;};}function removeEntity(_0x48cefb,_0x20a3fe){return function(_0x1e2fd4){if(_0x1e2fd4){return _0x1e2fd4[_0x898a('0x32')]()['then'](function(){var _0x105477=_0x1e2fd4[_0x898a('0x33')]({'plain':!![]});var _0x5eafc7=_0x898a('0x34');return db[_0x898a('0x35')][_0x898a('0x32')]({'where':{'type':_0x5eafc7,'resourceId':_0x105477['id']}})[_0x898a('0x31')](function(){return _0x1e2fd4;});})[_0x898a('0x31')](function(){_0x48cefb['status'](0xcc)[_0x898a('0x26')]();});}};}function handleEntityNotFound(_0x5baf5b,_0x573eb3){return function(_0x14e2dc){if(!_0x14e2dc){_0x5baf5b['sendStatus'](0x194);}return _0x14e2dc;};}function handleError(_0x3c9588,_0x4b3aac){_0x4b3aac=_0x4b3aac||0x1f4;return function(_0x37cb11){logger['error'](_0x37cb11[_0x898a('0x36')]);if(_0x37cb11[_0x898a('0x37')]){delete _0x37cb11[_0x898a('0x37')];}_0x3c9588['status'](_0x4b3aac)['send'](_0x37cb11);};}exports['index']=function(_0x1575d2,_0x429c32){var _0x5a228f={},_0xdd019d={},_0x3d3463={'count':0x0,'rows':[]};var _0xe84f7e=_[_0x898a('0x38')](db['Trunk']['rawAttributes'],function(_0x3aed01){return{'name':_0x3aed01[_0x898a('0x39')],'type':_0x3aed01['type']['key']};});_0xdd019d[_0x898a('0x3a')]=_[_0x898a('0x38')](_0xe84f7e,_0x898a('0x37'));_0xdd019d[_0x898a('0x3b')]=_['keys'](_0x1575d2[_0x898a('0x3b')]);_0xdd019d[_0x898a('0x3c')]=_['intersection'](_0xdd019d['model'],_0xdd019d['query']);_0x5a228f[_0x898a('0x3d')]=_[_0x898a('0x3e')](_0xdd019d[_0x898a('0x3a')],qs[_0x898a('0x3f')](_0x1575d2[_0x898a('0x3b')][_0x898a('0x3f')]));_0x5a228f[_0x898a('0x3d')]=_0x5a228f[_0x898a('0x3d')][_0x898a('0x40')]?_0x5a228f[_0x898a('0x3d')]:_0xdd019d[_0x898a('0x3a')];if(!_0x1575d2[_0x898a('0x3b')][_0x898a('0x41')](_0x898a('0x42'))){_0x5a228f[_0x898a('0x29')]=qs['limit'](_0x1575d2[_0x898a('0x3b')][_0x898a('0x29')]);_0x5a228f[_0x898a('0x27')]=qs['offset'](_0x1575d2[_0x898a('0x3b')][_0x898a('0x27')]);}_0x5a228f[_0x898a('0x43')]=qs[_0x898a('0x44')](_0x1575d2[_0x898a('0x3b')][_0x898a('0x44')]);_0x5a228f[_0x898a('0x45')]=qs[_0x898a('0x3c')](_['pick'](_0x1575d2[_0x898a('0x3b')],_0xdd019d[_0x898a('0x3c')]),_0xe84f7e);if(_0x1575d2[_0x898a('0x3b')][_0x898a('0x46')]){_0x5a228f['where']=_[_0x898a('0x47')](_0x5a228f[_0x898a('0x45')],{'$or':_['map'](_0xe84f7e,function(_0x241677){if(_0x241677['type']!==_0x898a('0x48')){var _0x5137c4={};_0x5137c4[_0x241677['name']]={'$like':'%'+_0x1575d2[_0x898a('0x3b')]['filter']+'%'};return _0x5137c4;}})});}_0x5a228f=_[_0x898a('0x47')]({},_0x5a228f,_0x1575d2[_0x898a('0x49')]);var _0x4d6ac0={'where':_0x5a228f[_0x898a('0x45')]};return db[_0x898a('0x4a')]['count'](_0x4d6ac0)[_0x898a('0x31')](function(_0x199437){_0x3d3463[_0x898a('0x2a')]=_0x199437;if(_0x1575d2[_0x898a('0x3b')]['includeAll']){_0x5a228f[_0x898a('0x4b')]=[{'all':!![]}];}return db[_0x898a('0x4a')]['findAll'](_0x5a228f);})[_0x898a('0x31')](function(_0x1d8c16){_0x3d3463['rows']=_0x1d8c16;return _0x3d3463;})[_0x898a('0x31')](respondWithFilteredResult(_0x429c32,_0x5a228f))['catch'](handleError(_0x429c32,null));};exports[_0x898a('0x4c')]=function(_0x41f291,_0x32ccb9){var _0x50f9e3={'raw':![],'where':{'id':_0x41f291[_0x898a('0x4d')]['id']}},_0x2f6cb3={};_0x2f6cb3[_0x898a('0x3a')]=_[_0x898a('0x4e')](db['Trunk'][_0x898a('0x4f')]);_0x2f6cb3['query']=_[_0x898a('0x4e')](_0x41f291[_0x898a('0x3b')]);_0x2f6cb3[_0x898a('0x3c')]=_['intersection'](_0x2f6cb3[_0x898a('0x3a')],_0x2f6cb3[_0x898a('0x3b')]);_0x50f9e3[_0x898a('0x3d')]=_['intersection'](_0x2f6cb3['model'],qs[_0x898a('0x3f')](_0x41f291[_0x898a('0x3b')][_0x898a('0x3f')]));_0x50f9e3[_0x898a('0x3d')]=_0x50f9e3[_0x898a('0x3d')][_0x898a('0x40')]?_0x50f9e3[_0x898a('0x3d')]:_0x2f6cb3[_0x898a('0x3a')];if(_0x41f291[_0x898a('0x3b')][_0x898a('0x50')]){_0x50f9e3[_0x898a('0x4b')]=[{'all':!![]}];}_0x50f9e3=_['merge']({},_0x50f9e3,_0x41f291[_0x898a('0x49')]);return db[_0x898a('0x4a')]['find'](_0x50f9e3)[_0x898a('0x31')](handleEntityNotFound(_0x32ccb9,null))['then'](respondWithResult(_0x32ccb9,null))['catch'](handleError(_0x32ccb9,null));};exports[_0x898a('0x51')]=function(_0x124f9b,_0x209529){var _0x5bfd61={'where':{'id':_0x124f9b[_0x898a('0x4d')]['id']}},_0x556fd8={};_0x556fd8[_0x898a('0x3a')]=_['keys'](db[_0x898a('0x4a')][_0x898a('0x4f')]);_0x5bfd61['attributes']=_[_0x898a('0x3e')](_0x556fd8[_0x898a('0x3a')],qs[_0x898a('0x3f')](_0x124f9b['query'][_0x898a('0x3f')]));_0x5bfd61[_0x898a('0x3d')]=_0x5bfd61[_0x898a('0x3d')][_0x898a('0x40')]?_0x5bfd61[_0x898a('0x3d')]:_0x556fd8[_0x898a('0x3a')];if(_0x124f9b['query'][_0x898a('0x50')]){_0x5bfd61['include']=[{'all':!![]}];}_0x5bfd61=_[_0x898a('0x47')]({},_0x5bfd61,_0x124f9b[_0x898a('0x49')]);return db[_0x898a('0x4a')][_0x898a('0x52')](_0x5bfd61)[_0x898a('0x31')](handleEntityNotFound(_0x209529,null))[_0x898a('0x31')](function(_0x2486a5){if(_0x2486a5){var _0x75ff57=_0x2486a5[_0x898a('0x33')]({'plain':!![]});_0x75ff57=qs['omit'](_0x75ff57,['id',_0x898a('0x53'),_0x898a('0x54')]);_0x124f9b[_0x898a('0x55')]=_[_0x898a('0x56')](_0x124f9b[_0x898a('0x55')],['id',_0x898a('0x53'),_0x898a('0x54')]);return db[_0x898a('0x4a')][_0x898a('0x57')](_[_0x898a('0x47')](_0x75ff57,_0x124f9b[_0x898a('0x55')]),{'include':_0x124f9b[_0x898a('0x3b')][_0x898a('0x50')]?[{'all':!![]}]:undefined})[_0x898a('0x31')](function(_0x22f9ba){var _0x5f42ae=_0x124f9b[_0x898a('0x58')][_0x898a('0x33')]({'plain':!![]});if(!_0x5f42ae)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5f42ae[_0x898a('0x59')]===_0x898a('0x58')){var _0x5f0944=_0x22f9ba[_0x898a('0x33')]({'plain':!![]});var _0x1daecd=_0x898a('0x34');return db[_0x898a('0x5a')]['find']({'where':{'name':_0x1daecd,'userProfileId':_0x5f42ae[_0x898a('0x5b')]},'raw':!![]})[_0x898a('0x31')](function(_0x137935){if(_0x137935&&_0x137935[_0x898a('0x5c')]===0x0){return db['UserProfileResource'][_0x898a('0x57')]({'name':_0x5f0944[_0x898a('0x37')],'resourceId':_0x5f0944['id'],'type':_0x137935['name'],'sectionId':_0x137935['id']},{})[_0x898a('0x31')](function(){return _0x22f9ba;});}else{return _0x22f9ba;}})[_0x898a('0x23')](function(_0x5b7019){logger[_0x898a('0x1f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5b7019);throw _0x5b7019;});}return _0x22f9ba;});}})[_0x898a('0x31')](respondWithResult(_0x209529,0xc9))['catch'](handleError(_0x209529,null));};exports['create']=function(_0x5ed35e,_0xfdd6d8,_0x473f5c){var _0x3909c5;return db[_0x898a('0x4a')]['create'](_0x5ed35e['body'],{'raw':!![]})[_0x898a('0x31')](function(_0x232be0){_0x3909c5=_0x232be0;return db[_0x898a('0x4a')][_0x898a('0x5d')]({'raw':!![]});})[_0x898a('0x31')](function(_0x41cf94){var _0x30051d=fs[_0x898a('0x5e')](path['join'](config[_0x898a('0x5f')],_0x898a('0x60')),'utf8');var _0x42fda8=fs[_0x898a('0x5e')](path[_0x898a('0x61')](config[_0x898a('0x5f')],_0x898a('0x62')),_0x898a('0x63'));var _0x3bcc3d=ejs[_0x898a('0x64')](_0x30051d,{'trunks':_0x41cf94||[]});fs[_0x898a('0x65')](_0x898a('0x66'),_0x3bcc3d);if(_0x3909c5[_0x898a('0x67')]){var _0x307849=ejs[_0x898a('0x64')](_0x42fda8,{'trunks':_0x41cf94||[]});fs['writeFileSync'](_0x898a('0x68'),_0x307849);}})['then'](function(){return respondWithRpcPromise(_0x898a('0x69'),_0x898a('0x57'),{'module':_0x898a('0x6a')});})['then'](function(){var _0x31102d=_0x5ed35e[_0x898a('0x58')][_0x898a('0x33')]({'plain':!![]});if(!_0x31102d)throw new Error(_0x898a('0x6b'));if(_0x31102d[_0x898a('0x59')]==='user'){var _0x4b9487=_0x3909c5[_0x898a('0x33')]({'plain':!![]});return db[_0x898a('0x5a')][_0x898a('0x52')]({'where':{'name':_0x898a('0x34'),'userProfileId':_0x31102d['userProfileId']},'raw':!![]})[_0x898a('0x31')](function(_0x3d3451){if(_0x3d3451&&_0x3d3451[_0x898a('0x5c')]===0x0){return db[_0x898a('0x35')][_0x898a('0x57')]({'name':_0x4b9487[_0x898a('0x37')],'resourceId':_0x4b9487['id'],'type':_0x3d3451[_0x898a('0x37')],'sectionId':_0x3d3451['id']},{})[_0x898a('0x31')](function(){return _0x3909c5;});}else{return _0x3909c5;}})['catch'](function(_0x32a207){logger[_0x898a('0x1f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x32a207);throw _0x32a207;});}return _0x3909c5;})[_0x898a('0x31')](respondWithResult(_0xfdd6d8,0xc9))['catch'](handleError(_0xfdd6d8,null));};exports[_0x898a('0x30')]=function(_0x4b2575,_0x2471d8,_0x387f2c){var _0x3b07dc;return db[_0x898a('0x4a')][_0x898a('0x52')]({'where':{'id':_0x4b2575[_0x898a('0x4d')]['id']}})[_0x898a('0x31')](handleEntityNotFound(_0x2471d8,null))[_0x898a('0x31')](saveUpdates(_0x4b2575[_0x898a('0x55')],null))['then'](function(_0x3fe54b){if(_0x3fe54b){_0x3b07dc=_0x3fe54b;return db[_0x898a('0x4a')][_0x898a('0x5d')]({'raw':!![]});}})[_0x898a('0x31')](function(_0x290972){if(_0x290972){var _0x1d594b=fs[_0x898a('0x5e')](path[_0x898a('0x61')](config[_0x898a('0x5f')],_0x898a('0x60')),'utf8');var _0x4fad03=fs[_0x898a('0x5e')](path[_0x898a('0x61')](config['root'],'server/files/templates/registry.ejs'),_0x898a('0x63'));var _0x4a79a4=ejs[_0x898a('0x64')](_0x1d594b,{'trunks':_0x290972||[]});fs[_0x898a('0x65')]('/etc/asterisk/sip_xcally_trunks.conf',_0x4a79a4);var _0x3f6815=ejs[_0x898a('0x64')](_0x4fad03,{'trunks':_0x290972||[]});fs[_0x898a('0x65')](_0x898a('0x68'),_0x3f6815);return respondWithRpcPromise(_0x898a('0x69'),_0x898a('0x30'),{'module':_0x898a('0x6a')});}return null;})['then'](function(_0x3237e8){if(_0x3237e8){return _0x3b07dc;}})[_0x898a('0x31')](respondWithResult(_0x2471d8,null))[_0x898a('0x23')](handleError(_0x2471d8,null));};exports['destroy']=function(_0x27560f,_0x61247c,_0x5c6247){var _0x39e917;return db['Trunk']['find']({'where':{'id':_0x27560f['params']['id']}})[_0x898a('0x31')](handleEntityNotFound(_0x61247c,null))[_0x898a('0x31')](removeEntity(_0x61247c,null))[_0x898a('0x31')](function(){return db[_0x898a('0x4a')][_0x898a('0x5d')]({'raw':!![]});})[_0x898a('0x31')](function(_0x12e54b){var _0x50dd52=fs[_0x898a('0x5e')](path['join'](config[_0x898a('0x5f')],_0x898a('0x60')),'utf8');var _0x24670c=fs[_0x898a('0x5e')](path[_0x898a('0x61')](config[_0x898a('0x5f')],_0x898a('0x62')),'utf8');var _0x5847cb=ejs['render'](_0x50dd52,{'trunks':_0x12e54b});var _0x3b8fb5=ejs[_0x898a('0x64')](_0x24670c,{'trunks':_0x12e54b});fs[_0x898a('0x65')]('/etc/asterisk/sip_xcally_trunks.conf',_0x5847cb);fs[_0x898a('0x65')]('/etc/asterisk/sip_xcally_registers.conf',_0x3b8fb5);return respondWithRpcPromise('Reload',_0x898a('0x32'),{'module':_0x898a('0x6a')});})[_0x898a('0x23')](handleError(_0x61247c,null));}; \ No newline at end of file +var _0xbec5=['readFileSync','root','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_registers.conf','Reload','Unable\x20to\x20retrieve\x20the\x20current\x20user','update','/etc/asterisk/sip_xcally_trunks.conf','chan_sip.so','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http','request','then','info','Trunk,\x20%s,\x20%s','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','sendStatus','status','end','offset','limit','undefined','count','set','json','apply','reject','Trunks','UserProfileResource','destroy','stack','name','send','map','Trunk','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','length','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','attributes','find','clone','get','omit','updatedAt','body','createdAt','create','user','role','UserProfileSection','userProfileId','autoAssociation','join','server/files/templates/trunk.ejs','utf8'];(function(_0x14d1a2,_0x4c246a){var _0x46e47d=function(_0x9fc4ad){while(--_0x9fc4ad){_0x14d1a2['push'](_0x14d1a2['shift']());}};_0x46e47d(++_0x4c246a);}(_0xbec5,0xe5));var _0x5bec=function(_0x237546,_0xa81b26){_0x237546=_0x237546-0x0;var _0x233e29=_0xbec5[_0x237546];return _0x233e29;};'use strict';var emlformat=require(_0x5bec('0x0'));var rimraf=require(_0x5bec('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5bec('0x2'));var rp=require(_0x5bec('0x3'));var moment=require(_0x5bec('0x4'));var BPromise=require(_0x5bec('0x5'));var Mustache=require(_0x5bec('0x6'));var util=require('util');var path=require(_0x5bec('0x7'));var sox=require(_0x5bec('0x8'));var csv=require(_0x5bec('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5bec('0xa'));var _=require(_0x5bec('0xb'));var squel=require(_0x5bec('0xc'));var crypto=require(_0x5bec('0xd'));var jsforce=require(_0x5bec('0xe'));var deskjs=require(_0x5bec('0xf'));var toCsv=require(_0x5bec('0x9'));var querystring=require(_0x5bec('0x10'));var Papa=require('papaparse');var Redis=require(_0x5bec('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x5bec('0x12'));var as=require(_0x5bec('0x13'));var hardwareService=require(_0x5bec('0x14'));var logger=require('../../config/logger')(_0x5bec('0x15'));var utils=require(_0x5bec('0x16'));var config=require(_0x5bec('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x5bec('0x18'))['db'];var jayson=require(_0x5bec('0x19'));var client=jayson['client'][_0x5bec('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0xaa984d,_0x35393a,_0x6888a4,_0x3198e0){return new BPromise(function(_0xcd6d90,_0x24dcd6){var _0x43fd2a=_0x3198e0||client;return _0x43fd2a[_0x5bec('0x1b')](_0xaa984d,_0x6888a4)[_0x5bec('0x1c')](function(_0x31b9e4){logger[_0x5bec('0x1d')](_0x5bec('0x1e'),_0x35393a,'request\x20sent');logger['debug'](_0x5bec('0x1f'),_0x35393a,_0x5bec('0x20'),JSON[_0x5bec('0x21')](_0x31b9e4));if(_0x31b9e4[_0x5bec('0x22')]){if(_0x31b9e4['error']['code']===0x1f4){logger[_0x5bec('0x22')](_0x5bec('0x1e'),_0x35393a,_0x31b9e4['error'][_0x5bec('0x23')]);return _0x24dcd6(_0x31b9e4[_0x5bec('0x22')][_0x5bec('0x23')]);}logger[_0x5bec('0x22')]('Trunk,\x20%s,\x20%s',_0x35393a,_0x31b9e4[_0x5bec('0x22')]['message']);return _0xcd6d90(_0x31b9e4[_0x5bec('0x22')][_0x5bec('0x23')]);}else{logger[_0x5bec('0x1d')](_0x5bec('0x1e'),_0x35393a,_0x5bec('0x20'));_0xcd6d90(_0x31b9e4['result'][_0x5bec('0x23')]);}})['catch'](function(_0x2b2d26){logger[_0x5bec('0x22')]('Trunk,\x20%s,\x20%s',_0x35393a,_0x2b2d26);_0x24dcd6(_0x2b2d26);});});}function respondWithStatusCode(_0xa414f8,_0xbef70b){_0xbef70b=_0xbef70b||0xcc;return function(_0x4e0ca2){if(_0x4e0ca2){return _0xa414f8[_0x5bec('0x24')](_0xbef70b);}return _0xa414f8[_0x5bec('0x25')](_0xbef70b)[_0x5bec('0x26')]();};}function respondWithResult(_0x20da89,_0x226d55){_0x226d55=_0x226d55||0xc8;return function(_0x131143){if(_0x131143){return _0x20da89[_0x5bec('0x25')](_0x226d55)['json'](_0x131143);}};}function respondWithFilteredResult(_0x5b63ab,_0x5e44b3){return function(_0x2961bd){if(_0x2961bd){var _0x2cdd2f=typeof _0x5e44b3[_0x5bec('0x27')]==='undefined'&&typeof _0x5e44b3[_0x5bec('0x28')]===_0x5bec('0x29');var _0x57331b=_0x2961bd[_0x5bec('0x2a')];var _0x63ac8=_0x2cdd2f?0x0:_0x5e44b3['offset'];var _0x5336b3=_0x2cdd2f?_0x2961bd[_0x5bec('0x2a')]:_0x5e44b3[_0x5bec('0x27')]+_0x5e44b3[_0x5bec('0x28')];var _0x2c7a7b;if(_0x5336b3>=_0x57331b){_0x5336b3=_0x57331b;_0x2c7a7b=0xc8;}else{_0x2c7a7b=0xce;}_0x5b63ab[_0x5bec('0x25')](_0x2c7a7b);return _0x5b63ab[_0x5bec('0x2b')]('Content-Range',_0x63ac8+'-'+_0x5336b3+'/'+_0x57331b)[_0x5bec('0x2c')](_0x2961bd);}return null;};}function patchUpdates(_0x59b5b6){return function(_0x45863b){try{jsonpatch[_0x5bec('0x2d')](_0x45863b,_0x59b5b6,!![]);}catch(_0x3034c9){return BPromise[_0x5bec('0x2e')](_0x3034c9);}return _0x45863b['save']();};}function saveUpdates(_0x2b42c8,_0x1aba46){return function(_0xfc7d41){if(_0xfc7d41){return _0xfc7d41['update'](_0x2b42c8)[_0x5bec('0x1c')](function(_0x4cfb89){return _0x4cfb89;});}return null;};}function removeEntity(_0x14cdbf,_0x207192){return function(_0x29df14){if(_0x29df14){return _0x29df14['destroy']()[_0x5bec('0x1c')](function(){var _0x420ad4=_0x29df14['get']({'plain':!![]});var _0x34b441=_0x5bec('0x2f');return db[_0x5bec('0x30')][_0x5bec('0x31')]({'where':{'type':_0x34b441,'resourceId':_0x420ad4['id']}})[_0x5bec('0x1c')](function(){return _0x29df14;});})['then'](function(){_0x14cdbf[_0x5bec('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d3793,_0x384f04){return function(_0x182b86){if(!_0x182b86){_0x2d3793[_0x5bec('0x24')](0x194);}return _0x182b86;};}function handleError(_0x2e421e,_0x1923fc){_0x1923fc=_0x1923fc||0x1f4;return function(_0x49c8ef){logger[_0x5bec('0x22')](_0x49c8ef[_0x5bec('0x32')]);if(_0x49c8ef[_0x5bec('0x33')]){delete _0x49c8ef['name'];}_0x2e421e[_0x5bec('0x25')](_0x1923fc)[_0x5bec('0x34')](_0x49c8ef);};}exports['index']=function(_0xdb0430,_0x58c34e){var _0x400e22={},_0x2c0b08={},_0x402e5d={'count':0x0,'rows':[]};var _0x49cdfa=_[_0x5bec('0x35')](db[_0x5bec('0x36')][_0x5bec('0x37')],function(_0x139859){return{'name':_0x139859[_0x5bec('0x38')],'type':_0x139859[_0x5bec('0x39')][_0x5bec('0x3a')]};});_0x2c0b08['model']=_[_0x5bec('0x35')](_0x49cdfa,_0x5bec('0x33'));_0x2c0b08[_0x5bec('0x3b')]=_[_0x5bec('0x3c')](_0xdb0430['query']);_0x2c0b08[_0x5bec('0x3d')]=_[_0x5bec('0x3e')](_0x2c0b08[_0x5bec('0x3f')],_0x2c0b08['query']);_0x400e22['attributes']=_[_0x5bec('0x3e')](_0x2c0b08[_0x5bec('0x3f')],qs[_0x5bec('0x40')](_0xdb0430[_0x5bec('0x3b')][_0x5bec('0x40')]));_0x400e22['attributes']=_0x400e22['attributes'][_0x5bec('0x41')]?_0x400e22['attributes']:_0x2c0b08[_0x5bec('0x3f')];if(!_0xdb0430[_0x5bec('0x3b')][_0x5bec('0x42')]('nolimit')){_0x400e22[_0x5bec('0x28')]=qs[_0x5bec('0x28')](_0xdb0430['query'][_0x5bec('0x28')]);_0x400e22[_0x5bec('0x27')]=qs[_0x5bec('0x27')](_0xdb0430[_0x5bec('0x3b')][_0x5bec('0x27')]);}_0x400e22[_0x5bec('0x43')]=qs[_0x5bec('0x44')](_0xdb0430['query']['sort']);_0x400e22[_0x5bec('0x45')]=qs['filters'](_['pick'](_0xdb0430[_0x5bec('0x3b')],_0x2c0b08['filters']),_0x49cdfa);if(_0xdb0430['query']['filter']){_0x400e22[_0x5bec('0x45')]=_[_0x5bec('0x46')](_0x400e22[_0x5bec('0x45')],{'$or':_[_0x5bec('0x35')](_0x49cdfa,function(_0x48858a){if(_0x48858a[_0x5bec('0x39')]!==_0x5bec('0x47')){var _0xa4d32={};_0xa4d32[_0x48858a[_0x5bec('0x33')]]={'$like':'%'+_0xdb0430['query'][_0x5bec('0x48')]+'%'};return _0xa4d32;}})});}_0x400e22=_[_0x5bec('0x46')]({},_0x400e22,_0xdb0430[_0x5bec('0x49')]);var _0x51a3f9={'where':_0x400e22[_0x5bec('0x45')]};return db['Trunk'][_0x5bec('0x2a')](_0x51a3f9)[_0x5bec('0x1c')](function(_0x133d5c){_0x402e5d[_0x5bec('0x2a')]=_0x133d5c;if(_0xdb0430['query'][_0x5bec('0x4a')]){_0x400e22[_0x5bec('0x4b')]=[{'all':!![]}];}return db[_0x5bec('0x36')][_0x5bec('0x4c')](_0x400e22);})[_0x5bec('0x1c')](function(_0x123758){_0x402e5d[_0x5bec('0x4d')]=_0x123758;return _0x402e5d;})['then'](respondWithFilteredResult(_0x58c34e,_0x400e22))[_0x5bec('0x4e')](handleError(_0x58c34e,null));};exports[_0x5bec('0x4f')]=function(_0x5775ca,_0x273e09){var _0x3e6180={'raw':![],'where':{'id':_0x5775ca[_0x5bec('0x50')]['id']}},_0x34ee24={};_0x34ee24[_0x5bec('0x3f')]=_[_0x5bec('0x3c')](db[_0x5bec('0x36')]['rawAttributes']);_0x34ee24[_0x5bec('0x3b')]=_['keys'](_0x5775ca[_0x5bec('0x3b')]);_0x34ee24[_0x5bec('0x3d')]=_[_0x5bec('0x3e')](_0x34ee24[_0x5bec('0x3f')],_0x34ee24[_0x5bec('0x3b')]);_0x3e6180[_0x5bec('0x51')]=_[_0x5bec('0x3e')](_0x34ee24[_0x5bec('0x3f')],qs[_0x5bec('0x40')](_0x5775ca[_0x5bec('0x3b')]['fields']));_0x3e6180[_0x5bec('0x51')]=_0x3e6180['attributes']['length']?_0x3e6180[_0x5bec('0x51')]:_0x34ee24['model'];if(_0x5775ca['query'][_0x5bec('0x4a')]){_0x3e6180[_0x5bec('0x4b')]=[{'all':!![]}];}_0x3e6180=_[_0x5bec('0x46')]({},_0x3e6180,_0x5775ca['options']);return db[_0x5bec('0x36')][_0x5bec('0x52')](_0x3e6180)[_0x5bec('0x1c')](handleEntityNotFound(_0x273e09,null))[_0x5bec('0x1c')](respondWithResult(_0x273e09,null))['catch'](handleError(_0x273e09,null));};exports[_0x5bec('0x53')]=function(_0x209da3,_0x9cae50){var _0xc8563a={'where':{'id':_0x209da3[_0x5bec('0x50')]['id']}},_0x2f736c={};_0x2f736c[_0x5bec('0x3f')]=_['keys'](db['Trunk'][_0x5bec('0x37')]);_0xc8563a['attributes']=_[_0x5bec('0x3e')](_0x2f736c[_0x5bec('0x3f')],qs['fields'](_0x209da3[_0x5bec('0x3b')]['fields']));_0xc8563a[_0x5bec('0x51')]=_0xc8563a[_0x5bec('0x51')][_0x5bec('0x41')]?_0xc8563a[_0x5bec('0x51')]:_0x2f736c[_0x5bec('0x3f')];if(_0x209da3[_0x5bec('0x3b')][_0x5bec('0x4a')]){_0xc8563a[_0x5bec('0x4b')]=[{'all':!![]}];}_0xc8563a=_[_0x5bec('0x46')]({},_0xc8563a,_0x209da3[_0x5bec('0x49')]);return db[_0x5bec('0x36')][_0x5bec('0x52')](_0xc8563a)[_0x5bec('0x1c')](handleEntityNotFound(_0x9cae50,null))[_0x5bec('0x1c')](function(_0x51b25d){if(_0x51b25d){var _0x2e33a7=_0x51b25d[_0x5bec('0x54')]({'plain':!![]});_0x2e33a7=qs[_0x5bec('0x55')](_0x2e33a7,['id','createdAt',_0x5bec('0x56')]);_0x209da3[_0x5bec('0x57')]=_[_0x5bec('0x55')](_0x209da3[_0x5bec('0x57')],['id',_0x5bec('0x58'),'updatedAt']);return db[_0x5bec('0x36')][_0x5bec('0x59')](_[_0x5bec('0x46')](_0x2e33a7,_0x209da3[_0x5bec('0x57')]),{'include':_0x209da3['query'][_0x5bec('0x4a')]?[{'all':!![]}]:undefined})['then'](function(_0x2b701f){var _0x38deb0=_0x209da3[_0x5bec('0x5a')][_0x5bec('0x54')]({'plain':!![]});if(!_0x38deb0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x38deb0[_0x5bec('0x5b')]===_0x5bec('0x5a')){var _0x1b3c40=_0x2b701f[_0x5bec('0x54')]({'plain':!![]});var _0xc3e3df=_0x5bec('0x2f');return db[_0x5bec('0x5c')][_0x5bec('0x52')]({'where':{'name':_0xc3e3df,'userProfileId':_0x38deb0[_0x5bec('0x5d')]},'raw':!![]})[_0x5bec('0x1c')](function(_0xfa751f){if(_0xfa751f&&_0xfa751f[_0x5bec('0x5e')]===0x0){return db[_0x5bec('0x30')][_0x5bec('0x59')]({'name':_0x1b3c40[_0x5bec('0x33')],'resourceId':_0x1b3c40['id'],'type':_0xfa751f['name'],'sectionId':_0xfa751f['id']},{})[_0x5bec('0x1c')](function(){return _0x2b701f;});}else{return _0x2b701f;}})[_0x5bec('0x4e')](function(_0x4e899c){logger[_0x5bec('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4e899c);throw _0x4e899c;});}return _0x2b701f;});}})[_0x5bec('0x1c')](respondWithResult(_0x9cae50,0xc9))[_0x5bec('0x4e')](handleError(_0x9cae50,null));};exports['create']=function(_0x5a2a85,_0xd54be0,_0xcac51d){var _0xb6cf85;return db[_0x5bec('0x36')][_0x5bec('0x59')](_0x5a2a85['body'],{'raw':!![]})[_0x5bec('0x1c')](function(_0x39cb06){_0xb6cf85=_0x39cb06;return db['Trunk'][_0x5bec('0x4c')]({'raw':!![]});})[_0x5bec('0x1c')](function(_0x44a945){var _0x34f31c=fs['readFileSync'](path[_0x5bec('0x5f')](config['root'],_0x5bec('0x60')),_0x5bec('0x61'));var _0x3ede1d=fs[_0x5bec('0x62')](path[_0x5bec('0x5f')](config[_0x5bec('0x63')],_0x5bec('0x64')),_0x5bec('0x61'));var _0x1ee139=ejs[_0x5bec('0x65')](_0x34f31c,{'trunks':_0x44a945||[]});fs[_0x5bec('0x66')]('/etc/asterisk/sip_xcally_trunks.conf',_0x1ee139);if(_0xb6cf85['registry']){var _0x3c305e=ejs[_0x5bec('0x65')](_0x3ede1d,{'trunks':_0x44a945||[]});fs[_0x5bec('0x66')](_0x5bec('0x67'),_0x3c305e);}})[_0x5bec('0x1c')](function(){return respondWithRpcPromise(_0x5bec('0x68'),_0x5bec('0x59'),{'module':'chan_sip.so'});})['then'](function(){var _0xc81e8f=_0x5a2a85[_0x5bec('0x5a')][_0x5bec('0x54')]({'plain':!![]});if(!_0xc81e8f)throw new Error(_0x5bec('0x69'));if(_0xc81e8f[_0x5bec('0x5b')]===_0x5bec('0x5a')){var _0x17cd00=_0xb6cf85[_0x5bec('0x54')]({'plain':!![]});return db[_0x5bec('0x5c')][_0x5bec('0x52')]({'where':{'name':_0x5bec('0x2f'),'userProfileId':_0xc81e8f[_0x5bec('0x5d')]},'raw':!![]})[_0x5bec('0x1c')](function(_0x325044){if(_0x325044&&_0x325044[_0x5bec('0x5e')]===0x0){return db[_0x5bec('0x30')][_0x5bec('0x59')]({'name':_0x17cd00[_0x5bec('0x33')],'resourceId':_0x17cd00['id'],'type':_0x325044[_0x5bec('0x33')],'sectionId':_0x325044['id']},{})[_0x5bec('0x1c')](function(){return _0xb6cf85;});}else{return _0xb6cf85;}})['catch'](function(_0x2e76c0){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2e76c0);throw _0x2e76c0;});}return _0xb6cf85;})[_0x5bec('0x1c')](respondWithResult(_0xd54be0,0xc9))['catch'](handleError(_0xd54be0,null));};exports[_0x5bec('0x6a')]=function(_0x5d6af3,_0x5ca280,_0x2e849b){var _0x1b5ec0;return db['Trunk'][_0x5bec('0x52')]({'where':{'id':_0x5d6af3[_0x5bec('0x50')]['id']}})[_0x5bec('0x1c')](handleEntityNotFound(_0x5ca280,null))[_0x5bec('0x1c')](saveUpdates(_0x5d6af3[_0x5bec('0x57')],null))[_0x5bec('0x1c')](function(_0xb76af2){if(_0xb76af2){_0x1b5ec0=_0xb76af2;return db[_0x5bec('0x36')]['findAll']({'raw':!![]});}})['then'](function(_0x2e8cd3){if(_0x2e8cd3){var _0x122c7f=fs[_0x5bec('0x62')](path[_0x5bec('0x5f')](config['root'],_0x5bec('0x60')),'utf8');var _0x44ceec=fs[_0x5bec('0x62')](path[_0x5bec('0x5f')](config[_0x5bec('0x63')],_0x5bec('0x64')),_0x5bec('0x61'));var _0x38be2d=ejs[_0x5bec('0x65')](_0x122c7f,{'trunks':_0x2e8cd3||[]});fs['writeFileSync'](_0x5bec('0x6b'),_0x38be2d);var _0xe5f9e5=ejs[_0x5bec('0x65')](_0x44ceec,{'trunks':_0x2e8cd3||[]});fs[_0x5bec('0x66')](_0x5bec('0x67'),_0xe5f9e5);return respondWithRpcPromise('Reload',_0x5bec('0x6a'),{'module':_0x5bec('0x6c')});}return null;})['then'](function(_0x195c12){if(_0x195c12){return _0x1b5ec0;}})['then'](respondWithResult(_0x5ca280,null))[_0x5bec('0x4e')](handleError(_0x5ca280,null));};exports[_0x5bec('0x31')]=function(_0x4646a3,_0x313e1c,_0x437c3e){var _0x3d7600;return db[_0x5bec('0x36')][_0x5bec('0x52')]({'where':{'id':_0x4646a3[_0x5bec('0x50')]['id']}})[_0x5bec('0x1c')](handleEntityNotFound(_0x313e1c,null))[_0x5bec('0x1c')](removeEntity(_0x313e1c,null))[_0x5bec('0x1c')](function(){return db[_0x5bec('0x36')][_0x5bec('0x4c')]({'raw':!![]});})[_0x5bec('0x1c')](function(_0x1eaf2f){var _0x317e2a=fs[_0x5bec('0x62')](path['join'](config[_0x5bec('0x63')],'server/files/templates/trunk.ejs'),_0x5bec('0x61'));var _0xfcef92=fs['readFileSync'](path['join'](config[_0x5bec('0x63')],'server/files/templates/registry.ejs'),_0x5bec('0x61'));var _0x4b70df=ejs[_0x5bec('0x65')](_0x317e2a,{'trunks':_0x1eaf2f});var _0x27b40b=ejs['render'](_0xfcef92,{'trunks':_0x1eaf2f});fs[_0x5bec('0x66')]('/etc/asterisk/sip_xcally_trunks.conf',_0x4b70df);fs[_0x5bec('0x66')]('/etc/asterisk/sip_xcally_registers.conf',_0x27b40b);return respondWithRpcPromise(_0x5bec('0x68'),_0x5bec('0x31'),{'module':'chan_sip.so'});})[_0x5bec('0x4e')](handleError(_0x313e1c,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 9201742..0d66396 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 _0xdc1b=['path','rimraf','../../config/environment','./trunk.attributes','exports','Trunk','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x493468,_0x3027be){var _0x2ea81d=function(_0x4fe94e){while(--_0x4fe94e){_0x493468['push'](_0x493468['shift']());}};_0x2ea81d(++_0x3027be);}(_0xdc1b,0x17a));var _0xbdc1=function(_0x51bda1,_0x44f80d){_0x51bda1=_0x51bda1-0x0;var _0x1ce08c=_0xdc1b[_0x51bda1];return _0x1ce08c;};'use strict';var _=require(_0xbdc1('0x0'));var util=require(_0xbdc1('0x1'));var logger=require(_0xbdc1('0x2'))(_0xbdc1('0x3'));var moment=require(_0xbdc1('0x4'));var BPromise=require('bluebird');var rp=require(_0xbdc1('0x5'));var fs=require('fs');var path=require(_0xbdc1('0x6'));var rimraf=require(_0xbdc1('0x7'));var config=require(_0xbdc1('0x8'));var attributes=require(_0xbdc1('0x9'));module[_0xbdc1('0xa')]=function(_0x4a18c4,_0x1c39e6){return _0x4a18c4['define'](_0xbdc1('0xb'),attributes,{'tableName':'tools_trunks','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x746a=['moment','request-promise','rimraf','./trunk.attributes','lodash','../../config/logger','api'];(function(_0xbf09ab,_0x251a19){var _0x2a9aef=function(_0x22d793){while(--_0x22d793){_0xbf09ab['push'](_0xbf09ab['shift']());}};_0x2a9aef(++_0x251a19);}(_0x746a,0x1ee));var _0xa746=function(_0x584b76,_0x365e9b){_0x584b76=_0x584b76-0x0;var _0x3ad1d9=_0x746a[_0x584b76];return _0x3ad1d9;};'use strict';var _=require(_0xa746('0x0'));var util=require('util');var logger=require(_0xa746('0x1'))(_0xa746('0x2'));var moment=require(_0xa746('0x3'));var BPromise=require('bluebird');var rp=require(_0xa746('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa746('0x5'));var config=require('../../config/environment');var attributes=require(_0xa746('0x6'));module['exports']=function(_0x5b41bd,_0x5f493b){return _0x5b41bd['define']('Trunk',attributes,{'tableName':'tools_trunks','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trunk/trunk.rpc.js b/server/api/trunk/trunk.rpc.js index 736d7d6..2cfcc16 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 _0xaaf1=['then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','GetTrunk','Trunk','findAll','options','raw','where','attributes','limit','include','map','model','catch','ShowTrunk','find','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x574e9e,_0x5420ae){var _0x1bd83d=function(_0x1f340c){while(--_0x1f340c){_0x574e9e['push'](_0x574e9e['shift']());}};_0x1bd83d(++_0x5420ae);}(_0xaaf1,0x152));var _0x1aaf=function(_0x48588a,_0x16e318){_0x48588a=_0x48588a-0x0;var _0x467bbe=_0xaaf1[_0x48588a];return _0x467bbe;};'use strict';var _=require('lodash');var util=require(_0x1aaf('0x0'));var moment=require(_0x1aaf('0x1'));var BPromise=require(_0x1aaf('0x2'));var rs=require(_0x1aaf('0x3'));var fs=require('fs');var Redis=require(_0x1aaf('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1aaf('0x5'));var logger=require('../../config/logger')(_0x1aaf('0x6'));var config=require(_0x1aaf('0x7'));var jayson=require(_0x1aaf('0x8'));var client=jayson[_0x1aaf('0x9')][_0x1aaf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x189c7a,_0x490899,_0x4a0855){return new BPromise(function(_0x3c8460,_0x38447f){return client[_0x1aaf('0xb')](_0x189c7a,_0x4a0855)[_0x1aaf('0xc')](function(_0x47da95){logger[_0x1aaf('0xd')](_0x1aaf('0xe'),_0x490899,_0x1aaf('0xf'));logger[_0x1aaf('0x10')]('Trunk,\x20%s,\x20%s,\x20%s',_0x490899,'request\x20sent',JSON[_0x1aaf('0x11')](_0x47da95));if(_0x47da95[_0x1aaf('0x12')]){if(_0x47da95[_0x1aaf('0x12')]['code']===0x1f4){logger[_0x1aaf('0x12')](_0x1aaf('0xe'),_0x490899,_0x47da95[_0x1aaf('0x12')][_0x1aaf('0x13')]);return _0x38447f(_0x47da95[_0x1aaf('0x12')][_0x1aaf('0x13')]);}logger[_0x1aaf('0x12')](_0x1aaf('0xe'),_0x490899,_0x47da95[_0x1aaf('0x12')][_0x1aaf('0x13')]);return _0x3c8460(_0x47da95[_0x1aaf('0x12')][_0x1aaf('0x13')]);}else{logger[_0x1aaf('0xd')](_0x1aaf('0xe'),_0x490899,_0x1aaf('0xf'));_0x3c8460(_0x47da95[_0x1aaf('0x14')][_0x1aaf('0x13')]);}})['catch'](function(_0x5d6c95){logger['error'](_0x1aaf('0xe'),_0x490899,_0x5d6c95);_0x38447f(_0x5d6c95);});});}exports[_0x1aaf('0x15')]=function(_0x125c43){var _0x1a5781=this;return new Promise(function(_0x3587fd,_0x5e513c){return db[_0x1aaf('0x16')][_0x1aaf('0x17')]({'raw':_0x125c43[_0x1aaf('0x18')]?_0x125c43[_0x1aaf('0x18')][_0x1aaf('0x19')]===undefined?!![]:![]:!![],'where':_0x125c43[_0x1aaf('0x18')]?_0x125c43[_0x1aaf('0x18')][_0x1aaf('0x1a')]||null:null,'attributes':_0x125c43[_0x1aaf('0x18')]?_0x125c43[_0x1aaf('0x18')][_0x1aaf('0x1b')]||null:null,'limit':_0x125c43[_0x1aaf('0x18')]?_0x125c43['options'][_0x1aaf('0x1c')]||null:null,'include':_0x125c43['options']?_0x125c43[_0x1aaf('0x18')][_0x1aaf('0x1d')]?_[_0x1aaf('0x1e')](_0x125c43['options'][_0x1aaf('0x1d')],function(_0x48bc45){return{'model':db[_0x48bc45[_0x1aaf('0x1f')]],'as':_0x48bc45['as'],'attributes':_0x48bc45[_0x1aaf('0x1b')],'include':_0x48bc45[_0x1aaf('0x1d')]?_['map'](_0x48bc45[_0x1aaf('0x1d')],function(_0x5d191f){return{'model':db[_0x5d191f['model']],'as':_0x5d191f['as'],'attributes':_0x5d191f['attributes'],'include':_0x5d191f['include']?_[_0x1aaf('0x1e')](_0x5d191f[_0x1aaf('0x1d')],function(_0x61a8bb){return{'model':db[_0x61a8bb['model']],'as':_0x61a8bb['as'],'attributes':_0x61a8bb[_0x1aaf('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x43da30){logger['info']('GetTrunk',_0x125c43);logger[_0x1aaf('0x10')](_0x1aaf('0x15'),_0x125c43,JSON[_0x1aaf('0x11')](_0x43da30));_0x3587fd(_0x43da30);})[_0x1aaf('0x20')](function(_0xe40c08){logger[_0x1aaf('0x12')](_0x1aaf('0x15'),_0xe40c08['message'],_0x125c43);_0x5e513c(_0x1a5781[_0x1aaf('0x12')](0x1f4,_0xe40c08['message']));});});};exports[_0x1aaf('0x21')]=function(_0xe07da5){var _0x54d393=this;return new Promise(function(_0xe7d5cb,_0x36244b){return db[_0x1aaf('0x16')][_0x1aaf('0x22')]({'raw':_0xe07da5[_0x1aaf('0x18')]?_0xe07da5[_0x1aaf('0x18')][_0x1aaf('0x19')]===undefined?!![]:![]:!![],'where':_0xe07da5[_0x1aaf('0x18')]?_0xe07da5[_0x1aaf('0x18')]['where']||null:null,'attributes':_0xe07da5[_0x1aaf('0x18')]?_0xe07da5[_0x1aaf('0x18')][_0x1aaf('0x1b')]||null:null,'include':_0xe07da5['options']?_0xe07da5[_0x1aaf('0x18')][_0x1aaf('0x1d')]?_[_0x1aaf('0x1e')](_0xe07da5[_0x1aaf('0x18')][_0x1aaf('0x1d')],function(_0x5e0268){return{'model':db[_0x5e0268[_0x1aaf('0x1f')]],'as':_0x5e0268['as'],'attributes':_0x5e0268[_0x1aaf('0x1b')],'include':_0x5e0268['include']?_[_0x1aaf('0x1e')](_0x5e0268[_0x1aaf('0x1d')],function(_0x894822){return{'model':db[_0x894822[_0x1aaf('0x1f')]],'as':_0x894822['as'],'attributes':_0x894822['attributes'],'include':_0x894822[_0x1aaf('0x1d')]?_[_0x1aaf('0x1e')](_0x894822[_0x1aaf('0x1d')],function(_0x29ea9c){return{'model':db[_0x29ea9c['model']],'as':_0x29ea9c['as'],'attributes':_0x29ea9c['attributes']};}):[]};}):[]};}):[]:[]})[_0x1aaf('0xc')](function(_0x1a792f){logger[_0x1aaf('0xd')]('ShowTrunk',_0xe07da5);logger[_0x1aaf('0x10')]('ShowTrunk',_0xe07da5,JSON[_0x1aaf('0x11')](_0x1a792f));_0xe7d5cb(_0x1a792f);})[_0x1aaf('0x20')](function(_0x54d4aa){logger[_0x1aaf('0x12')](_0x1aaf('0x21'),_0x54d4aa[_0x1aaf('0x13')],_0xe07da5);_0x36244b(_0x54d393[_0x1aaf('0x12')](0x1f4,_0x54d4aa[_0x1aaf('0x13')]));});});}; \ No newline at end of file +var _0xedb4=['debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','Trunk','findAll','options','raw','attributes','limit','include','map','model','then','GetTrunk','ShowTrunk','find','where','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','Trunk,\x20%s,\x20%s'];(function(_0x5e7c51,_0x16e1ce){var _0x1480b8=function(_0x1eeb25){while(--_0x1eeb25){_0x5e7c51['push'](_0x5e7c51['shift']());}};_0x1480b8(++_0x16e1ce);}(_0xedb4,0x15b));var _0x4edb=function(_0x4e1a49,_0x4da738){_0x4e1a49=_0x4e1a49-0x0;var _0x136aae=_0xedb4[_0x4e1a49];return _0x136aae;};'use strict';var _=require(_0x4edb('0x0'));var util=require(_0x4edb('0x1'));var moment=require('moment');var BPromise=require(_0x4edb('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4edb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4edb('0x4'));var logger=require(_0x4edb('0x5'))(_0x4edb('0x6'));var config=require(_0x4edb('0x7'));var jayson=require(_0x4edb('0x8'));var client=jayson[_0x4edb('0x9')][_0x4edb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1e7e63,_0x2d9c75,_0x5a5313){return new BPromise(function(_0x2ef986,_0x1b688b){return client[_0x4edb('0xb')](_0x1e7e63,_0x5a5313)['then'](function(_0x568fdd){logger['info'](_0x4edb('0xc'),_0x2d9c75,'request\x20sent');logger[_0x4edb('0xd')](_0x4edb('0xe'),_0x2d9c75,_0x4edb('0xf'),JSON[_0x4edb('0x10')](_0x568fdd));if(_0x568fdd[_0x4edb('0x11')]){if(_0x568fdd['error'][_0x4edb('0x12')]===0x1f4){logger['error']('Trunk,\x20%s,\x20%s',_0x2d9c75,_0x568fdd[_0x4edb('0x11')][_0x4edb('0x13')]);return _0x1b688b(_0x568fdd[_0x4edb('0x11')][_0x4edb('0x13')]);}logger['error'](_0x4edb('0xc'),_0x2d9c75,_0x568fdd[_0x4edb('0x11')][_0x4edb('0x13')]);return _0x2ef986(_0x568fdd[_0x4edb('0x11')][_0x4edb('0x13')]);}else{logger[_0x4edb('0x14')](_0x4edb('0xc'),_0x2d9c75,_0x4edb('0xf'));_0x2ef986(_0x568fdd['result'][_0x4edb('0x13')]);}})[_0x4edb('0x15')](function(_0x1affb9){logger[_0x4edb('0x11')](_0x4edb('0xc'),_0x2d9c75,_0x1affb9);_0x1b688b(_0x1affb9);});});}exports['GetTrunk']=function(_0x49a8b6){var _0x5aca17=this;return new Promise(function(_0x2cc18b,_0x2cf6c3){return db[_0x4edb('0x16')][_0x4edb('0x17')]({'raw':_0x49a8b6[_0x4edb('0x18')]?_0x49a8b6[_0x4edb('0x18')][_0x4edb('0x19')]===undefined?!![]:![]:!![],'where':_0x49a8b6[_0x4edb('0x18')]?_0x49a8b6[_0x4edb('0x18')]['where']||null:null,'attributes':_0x49a8b6[_0x4edb('0x18')]?_0x49a8b6['options'][_0x4edb('0x1a')]||null:null,'limit':_0x49a8b6[_0x4edb('0x18')]?_0x49a8b6[_0x4edb('0x18')][_0x4edb('0x1b')]||null:null,'include':_0x49a8b6['options']?_0x49a8b6[_0x4edb('0x18')][_0x4edb('0x1c')]?_[_0x4edb('0x1d')](_0x49a8b6['options']['include'],function(_0xb3a03f){return{'model':db[_0xb3a03f[_0x4edb('0x1e')]],'as':_0xb3a03f['as'],'attributes':_0xb3a03f[_0x4edb('0x1a')],'include':_0xb3a03f[_0x4edb('0x1c')]?_[_0x4edb('0x1d')](_0xb3a03f[_0x4edb('0x1c')],function(_0x56e02d){return{'model':db[_0x56e02d[_0x4edb('0x1e')]],'as':_0x56e02d['as'],'attributes':_0x56e02d['attributes'],'include':_0x56e02d['include']?_['map'](_0x56e02d[_0x4edb('0x1c')],function(_0xd72ed9){return{'model':db[_0xd72ed9[_0x4edb('0x1e')]],'as':_0xd72ed9['as'],'attributes':_0xd72ed9[_0x4edb('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x4edb('0x1f')](function(_0x581453){logger['info'](_0x4edb('0x20'),_0x49a8b6);logger[_0x4edb('0xd')](_0x4edb('0x20'),_0x49a8b6,JSON[_0x4edb('0x10')](_0x581453));_0x2cc18b(_0x581453);})[_0x4edb('0x15')](function(_0x3c647f){logger['error'](_0x4edb('0x20'),_0x3c647f[_0x4edb('0x13')],_0x49a8b6);_0x2cf6c3(_0x5aca17[_0x4edb('0x11')](0x1f4,_0x3c647f[_0x4edb('0x13')]));});});};exports[_0x4edb('0x21')]=function(_0x1a3345){var _0x43e142=this;return new Promise(function(_0x4423c8,_0x53c428){return db[_0x4edb('0x16')][_0x4edb('0x22')]({'raw':_0x1a3345[_0x4edb('0x18')]?_0x1a3345[_0x4edb('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x1a3345[_0x4edb('0x18')]?_0x1a3345[_0x4edb('0x18')][_0x4edb('0x23')]||null:null,'attributes':_0x1a3345[_0x4edb('0x18')]?_0x1a3345['options'][_0x4edb('0x1a')]||null:null,'include':_0x1a3345[_0x4edb('0x18')]?_0x1a3345['options'][_0x4edb('0x1c')]?_[_0x4edb('0x1d')](_0x1a3345[_0x4edb('0x18')][_0x4edb('0x1c')],function(_0x2a3147){return{'model':db[_0x2a3147[_0x4edb('0x1e')]],'as':_0x2a3147['as'],'attributes':_0x2a3147[_0x4edb('0x1a')],'include':_0x2a3147['include']?_[_0x4edb('0x1d')](_0x2a3147[_0x4edb('0x1c')],function(_0x3f748a){return{'model':db[_0x3f748a[_0x4edb('0x1e')]],'as':_0x3f748a['as'],'attributes':_0x3f748a[_0x4edb('0x1a')],'include':_0x3f748a[_0x4edb('0x1c')]?_[_0x4edb('0x1d')](_0x3f748a[_0x4edb('0x1c')],function(_0xe81b4b){return{'model':db[_0xe81b4b[_0x4edb('0x1e')]],'as':_0xe81b4b['as'],'attributes':_0xe81b4b[_0x4edb('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x4edb('0x1f')](function(_0x2c6821){logger[_0x4edb('0x14')]('ShowTrunk',_0x1a3345);logger[_0x4edb('0xd')](_0x4edb('0x21'),_0x1a3345,JSON[_0x4edb('0x10')](_0x2c6821));_0x4423c8(_0x2c6821);})['catch'](function(_0x999808){logger[_0x4edb('0x11')](_0x4edb('0x21'),_0x999808['message'],_0x1a3345);_0x53c428(_0x43e142[_0x4edb('0x11')](0x1f4,_0x999808[_0x4edb('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/user-setting/index.js b/server/api/user-setting/index.js index 394819f..a9e1d31 100644 --- a/server/api/user-setting/index.js +++ b/server/api/user-setting/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9555=['../../components/auth/service','./user-setting.controller','/:id','isAuthenticated','exports','Router'];(function(_0x5de702,_0x54a1a9){var _0x3b1b3b=function(_0xca64de){while(--_0xca64de){_0x5de702['push'](_0x5de702['shift']());}};_0x3b1b3b(++_0x54a1a9);}(_0x9555,0x18b));var _0x5955=function(_0x55dffa,_0x1fdc14){_0x55dffa=_0x55dffa-0x0;var _0x2d41aa=_0x9555[_0x55dffa];return _0x2d41aa;};'use strict';var express=require('express');var router=express[_0x5955('0x0')]();var auth=require(_0x5955('0x1'));var controller=require(_0x5955('0x2'));router['put'](_0x5955('0x3'),auth[_0x5955('0x4')](),controller['update']);module[_0x5955('0x5')]=router; \ No newline at end of file +var _0x0164=['update','Router','put','/:id','isAuthenticated'];(function(_0x4a579f,_0x2971d5){var _0x207bf1=function(_0x3b62ac){while(--_0x3b62ac){_0x4a579f['push'](_0x4a579f['shift']());}};_0x207bf1(++_0x2971d5);}(_0x0164,0x92));var _0x4016=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0x0164[_0x521929];return _0x632436;};'use strict';var express=require('express');var router=express[_0x4016('0x0')]();var auth=require('../../components/auth/service');var controller=require('./user-setting.controller');router[_0x4016('0x1')](_0x4016('0x2'),auth[_0x4016('0x3')](),controller[_0x4016('0x4')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.attributes.js b/server/api/user-setting/user-setting.attributes.js index b51dedb..2865aed 100644 --- a/server/api/user-setting/user-setting.attributes.js +++ b/server/api/user-setting/user-setting.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfdba=['exports','BOOLEAN','TEXT','DATE','sequelize','error','info','debug'];(function(_0x4679a2,_0x3c884e){var _0x2b77a5=function(_0x43f69e){while(--_0x43f69e){_0x4679a2['push'](_0x4679a2['shift']());}};_0x2b77a5(++_0x3c884e);}(_0xfdba,0x12c));var _0xafdb=function(_0x538dab,_0x18d962){_0x538dab=_0x538dab-0x0;var _0x129274=_0xfdba[_0x538dab];return _0x129274;};'use strict';var Sequelize=require(_0xafdb('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0xafdb('0x1'),'warning',_0xafdb('0x2'),_0xafdb('0x3')];module[_0xafdb('0x4')]={'clientSideLoggingLevel':{'type':Sequelize['ENUM'](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0xafdb('0x1'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0xafdb('0x5')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0xafdb('0x6')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0xafdb('0x7')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize['INTEGER'],'unique':'UserId'}}; \ No newline at end of file +var _0x4747=['warning','info','debug','exports','ENUM','TEXT','DATE','INTEGER','UserId','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4747,0x15d));var _0x7474=function(_0x5f5be8,_0x56cc02){_0x5f5be8=_0x5f5be8-0x0;var _0x5a9a36=_0x4747[_0x5f5be8];return _0x5a9a36;};'use strict';var Sequelize=require('sequelize');const CLIENT_SIDE_LOG_LEVELS=[_0x7474('0x0'),_0x7474('0x1'),_0x7474('0x2'),_0x7474('0x3')];module[_0x7474('0x4')]={'clientSideLoggingLevel':{'type':Sequelize[_0x7474('0x5')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0x7474('0x0'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0x7474('0x6')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0x7474('0x7')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0x7474('0x8')],'unique':_0x7474('0x9')}}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.controller.js b/server/api/user-setting/user-setting.controller.js index a271c98..3b3e858 100644 --- a/server/api/user-setting/user-setting.controller.js +++ b/server/api/user-setting/user-setting.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9ff4=['../../mysqldb','socket.io-emitter','./user-setting.socket','register','redis','defaults','localhost','json','then','sendStatus','name','status','update','user','admin','Unauthorized','params','Invalid\x20user\x20setting\x20id','UserSetting','find','body','catch','api','../../config/environment'];(function(_0x30f6db,_0x12f42f){var _0x46ba2b=function(_0x3b9d67){while(--_0x3b9d67){_0x30f6db['push'](_0x30f6db['shift']());}};_0x46ba2b(++_0x12f42f);}(_0x9ff4,0x196));var _0x49ff=function(_0x687c0,_0x54db10){_0x687c0=_0x687c0-0x0;var _0x55e984=_0x9ff4[_0x687c0];return _0x55e984;};'use strict';var _=require('lodash');var Redis=require('ioredis');var logger=require('../../config/logger')(_0x49ff('0x0'));var config=require(_0x49ff('0x1'));var db=require(_0x49ff('0x2'))['db'];var socket=require(_0x49ff('0x3'))(new Redis(config['redis']));require(_0x49ff('0x4'))[_0x49ff('0x5')](socket);config[_0x49ff('0x6')]=_[_0x49ff('0x7')](config[_0x49ff('0x6')],{'host':_0x49ff('0x8'),'port':0x18eb});function respondWithResult(_0xe967d3,_0xd87903){_0xd87903=_0xd87903||0xc8;return function(_0x50f784){if(_0x50f784){return _0xe967d3['status'](_0xd87903)[_0x49ff('0x9')](_0x50f784);}};}function saveUpdates(_0x3a9da1){return function(_0x562cd1){if(_0x562cd1){return _0x562cd1['update'](_0x3a9da1)[_0x49ff('0xa')](function(_0xad4257){return _0xad4257;});}return null;};}function handleEntityNotFound(_0x471b2c){return function(_0x178f62){if(!_0x178f62){_0x471b2c[_0x49ff('0xb')](0x194);}return _0x178f62;};}function handleError(_0x419982,_0xedd4ed){_0xedd4ed=_0xedd4ed||0x1f4;return function(_0x32c80d){logger['error'](_0x32c80d['stack']);if(_0x32c80d['name']){delete _0x32c80d[_0x49ff('0xc')];}_0x419982[_0x49ff('0xd')](_0xedd4ed)['send'](_0x32c80d);};}exports[_0x49ff('0xe')]=function(_0x5714c7,_0x5055fe){if(_0x5714c7[_0x49ff('0xf')]['role']!==_0x49ff('0x10'))throw new Error(_0x49ff('0x11'));if(isNaN(Number(_0x5714c7[_0x49ff('0x12')]['id'])))throw new Error(_0x49ff('0x13'));return db[_0x49ff('0x14')][_0x49ff('0x15')]({'where':{'id':_0x5714c7[_0x49ff('0x12')]['id']}})[_0x49ff('0xa')](handleEntityNotFound(_0x5055fe,null))['then'](saveUpdates(_0x5714c7[_0x49ff('0x16')],null))['then'](respondWithResult(_0x5055fe,null))[_0x49ff('0x17')](handleError(_0x5055fe,null));}; \ No newline at end of file +var _0x83f1=['defaults','localhost','status','update','then','error','stack','name','send','user','role','admin','Unauthorized','Invalid\x20user\x20setting\x20id','find','params','body','catch','lodash','ioredis','../../config/logger','api','../../config/environment','redis','./user-setting.socket','register'];(function(_0x109371,_0x441c8e){var _0x4fd858=function(_0x13504f){while(--_0x13504f){_0x109371['push'](_0x109371['shift']());}};_0x4fd858(++_0x441c8e);}(_0x83f1,0x1cc));var _0x183f=function(_0x1ffddc,_0x5cbe4a){_0x1ffddc=_0x1ffddc-0x0;var _0x42bbb1=_0x83f1[_0x1ffddc];return _0x42bbb1;};'use strict';var _=require(_0x183f('0x0'));var Redis=require(_0x183f('0x1'));var logger=require(_0x183f('0x2'))(_0x183f('0x3'));var config=require(_0x183f('0x4'));var db=require('../../mysqldb')['db'];var socket=require('socket.io-emitter')(new Redis(config[_0x183f('0x5')]));require(_0x183f('0x6'))[_0x183f('0x7')](socket);config[_0x183f('0x5')]=_[_0x183f('0x8')](config['redis'],{'host':_0x183f('0x9'),'port':0x18eb});function respondWithResult(_0xf702f5,_0x364cc4){_0x364cc4=_0x364cc4||0xc8;return function(_0x5c75c3){if(_0x5c75c3){return _0xf702f5[_0x183f('0xa')](_0x364cc4)['json'](_0x5c75c3);}};}function saveUpdates(_0xf1140d){return function(_0x828173){if(_0x828173){return _0x828173[_0x183f('0xb')](_0xf1140d)[_0x183f('0xc')](function(_0x22bcd6){return _0x22bcd6;});}return null;};}function handleEntityNotFound(_0x1848a6){return function(_0x333813){if(!_0x333813){_0x1848a6['sendStatus'](0x194);}return _0x333813;};}function handleError(_0x1a1031,_0xa7889b){_0xa7889b=_0xa7889b||0x1f4;return function(_0x3a99ee){logger[_0x183f('0xd')](_0x3a99ee[_0x183f('0xe')]);if(_0x3a99ee[_0x183f('0xf')]){delete _0x3a99ee[_0x183f('0xf')];}_0x1a1031['status'](_0xa7889b)[_0x183f('0x10')](_0x3a99ee);};}exports['update']=function(_0x5619e8,_0xa71c57){if(_0x5619e8[_0x183f('0x11')][_0x183f('0x12')]!==_0x183f('0x13'))throw new Error(_0x183f('0x14'));if(isNaN(Number(_0x5619e8['params']['id'])))throw new Error(_0x183f('0x15'));return db['UserSetting'][_0x183f('0x16')]({'where':{'id':_0x5619e8[_0x183f('0x17')]['id']}})[_0x183f('0xc')](handleEntityNotFound(_0xa71c57,null))['then'](saveUpdates(_0x5619e8[_0x183f('0x18')],null))[_0x183f('0xc')](respondWithResult(_0xa71c57,null))[_0x183f('0x19')](handleError(_0xa71c57,null));}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.events.js b/server/api/user-setting/user-setting.events.js index 35104bf..1d3f312 100644 --- a/server/api/user-setting/user-setting.events.js +++ b/server/api/user-setting/user-setting.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x63e9=['emit','hasOwnProperty','hook','events','../../mysqldb','UserSetting','setMaxListeners','save','remove'];(function(_0x1ac6e5,_0x40f47f){var _0x5877dc=function(_0x99caea){while(--_0x99caea){_0x1ac6e5['push'](_0x1ac6e5['shift']());}};_0x5877dc(++_0x40f47f);}(_0x63e9,0x162));var _0x963e=function(_0x324fe8,_0x1ccb46){_0x324fe8=_0x324fe8-0x0;var _0x4a1cd9=_0x63e9[_0x324fe8];return _0x4a1cd9;};'use strict';var EventEmitter=require(_0x963e('0x0'));var UserSetting=require(_0x963e('0x1'))['db'][_0x963e('0x2')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0x963e('0x3')](0x0);var events={'afterCreate':_0x963e('0x4'),'afterUpdate':'update','afterDestroy':_0x963e('0x5')};function emitEvent(_0x444866){return function(_0x379ecc,_0x18289a,_0x3b0715){UserSettingEvents[_0x963e('0x6')](_0x444866+':'+_0x379ecc['id'],_0x379ecc);UserSettingEvents[_0x963e('0x6')](_0x444866,_0x379ecc);_0x3b0715(null);};}for(var e in events){if(events[_0x963e('0x7')](e)){var event=events[e];UserSetting[_0x963e('0x8')](e,emitEvent(event));}}module['exports']=UserSettingEvents; \ No newline at end of file +var _0xf62d=['hasOwnProperty','hook','UserSetting','save','update','remove','emit'];(function(_0x1fd988,_0xf7f376){var _0x9c37ab=function(_0x28528b){while(--_0x28528b){_0x1fd988['push'](_0x1fd988['shift']());}};_0x9c37ab(++_0xf7f376);}(_0xf62d,0x1ad));var _0xdf62=function(_0x43577a,_0xd9dc6e){_0x43577a=_0x43577a-0x0;var _0xb8d923=_0xf62d[_0x43577a];return _0xb8d923;};'use strict';var EventEmitter=require('events');var UserSetting=require('../../mysqldb')['db'][_0xdf62('0x0')];var UserSettingEvents=new EventEmitter();UserSettingEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xdf62('0x1'),'afterUpdate':_0xdf62('0x2'),'afterDestroy':_0xdf62('0x3')};function emitEvent(_0x1f18b4){return function(_0x50e60e,_0x13dc85,_0x193c30){UserSettingEvents[_0xdf62('0x4')](_0x1f18b4+':'+_0x50e60e['id'],_0x50e60e);UserSettingEvents[_0xdf62('0x4')](_0x1f18b4,_0x50e60e);_0x193c30(null);};}for(var e in events){if(events[_0xdf62('0x5')](e)){var event=events[e];UserSetting[_0xdf62('0x6')](e,emitEvent(event));}}module['exports']=UserSettingEvents; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.model.js b/server/api/user-setting/user-setting.model.js index 13f3f18..ccf6038 100644 --- a/server/api/user-setting/user-setting.model.js +++ b/server/api/user-setting/user-setting.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb7e7=['clientSideLoggingEnabledSince','./user-setting.attributes','UserSetting'];(function(_0x1d1b7c,_0x59b25e){var _0x5951b2=function(_0x43a71a){while(--_0x43a71a){_0x1d1b7c['push'](_0x1d1b7c['shift']());}};_0x5951b2(++_0x59b25e);}(_0xb7e7,0x121));var _0x7b7e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xb7e7[_0x2b4411];return _0x8e41ef;};'use strict';var attributes=require(_0x7b7e('0x0'));module['exports']=function(_0x40e269){return _0x40e269['define'](_0x7b7e('0x1'),attributes,{'tableName':'user_settings','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3f5804){if(!_0x3f5804['clientSideLoggingEnabled'])_0x3f5804[_0x7b7e('0x2')]=null;else if(_0x3f5804[_0x7b7e('0x2')]===null)_0x3f5804[_0x7b7e('0x2')]=new Date();}}});}; \ No newline at end of file +var _0x6e77=['UserSetting','user_settings','clientSideLoggingEnabled','clientSideLoggingEnabledSince','exports'];(function(_0x1faaa1,_0x1568dd){var _0x994ec=function(_0x298ef4){while(--_0x298ef4){_0x1faaa1['push'](_0x1faaa1['shift']());}};_0x994ec(++_0x1568dd);}(_0x6e77,0xef));var _0x76e7=function(_0x2f6541,_0x363cba){_0x2f6541=_0x2f6541-0x0;var _0x4d76d8=_0x6e77[_0x2f6541];return _0x4d76d8;};'use strict';var attributes=require('./user-setting.attributes');module[_0x76e7('0x0')]=function(_0x558eec){return _0x558eec['define'](_0x76e7('0x1'),attributes,{'tableName':_0x76e7('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x57a8b3){if(!_0x57a8b3[_0x76e7('0x3')])_0x57a8b3[_0x76e7('0x4')]=null;else if(_0x57a8b3[_0x76e7('0x4')]===null)_0x57a8b3['clientSideLoggingEnabledSince']=new Date();}}});}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.socket.js b/server/api/user-setting/user-setting.socket.js index 18a5519..adee2b0 100644 --- a/server/api/user-setting/user-setting.socket.js +++ b/server/api/user-setting/user-setting.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x235a=['emit','user-setting:update:user-','register','length','user-setting:','./user-setting.events','save','remove','update'];(function(_0x391f64,_0x45f63b){var _0x417de3=function(_0x295cc1){while(--_0x295cc1){_0x391f64['push'](_0x391f64['shift']());}};_0x417de3(++_0x45f63b);}(_0x235a,0xf8));var _0xa235=function(_0x2c0867,_0xbb2795){_0x2c0867=_0x2c0867-0x0;var _0x588f62=_0x235a[_0x2c0867];return _0x588f62;};'use strict';var UserSettingEvents=require(_0xa235('0x0'));var events=[_0xa235('0x1'),_0xa235('0x2'),_0xa235('0x3')];function createListener(_0x226a6b,_0x2c8deb){return function(_0x1405a0){_0x2c8deb[_0xa235('0x4')](_0x226a6b,_0x1405a0);if(_0x226a6b==='user-setting:update'){_0x2c8deb['emit'](_0xa235('0x5')+_0x1405a0['UserId'],_0x1405a0);}};}exports[_0xa235('0x6')]=function(_0x3161b5){for(var _0x41c318=0x0,_0x4c2213=events[_0xa235('0x7')];_0x41c318<_0x4c2213;_0x41c318++){var _0xc1482f=events[_0x41c318];var _0x572b07=createListener(_0xa235('0x8')+_0xc1482f,_0x3161b5);UserSettingEvents['on'](_0xc1482f,_0x572b07);}}; \ No newline at end of file +var _0xc448=['update','emit','user-setting:update','user-setting:update:user-','UserId','register','length','user-setting:','./user-setting.events','save','remove'];(function(_0x1e7935,_0x3bb652){var _0x3eb2aa=function(_0x665b78){while(--_0x665b78){_0x1e7935['push'](_0x1e7935['shift']());}};_0x3eb2aa(++_0x3bb652);}(_0xc448,0x8c));var _0x8c44=function(_0x50a330,_0x1533cf){_0x50a330=_0x50a330-0x0;var _0x3205ce=_0xc448[_0x50a330];return _0x3205ce;};'use strict';var UserSettingEvents=require(_0x8c44('0x0'));var events=[_0x8c44('0x1'),_0x8c44('0x2'),_0x8c44('0x3')];function createListener(_0x422417,_0x4b0d8b){return function(_0x468b93){_0x4b0d8b[_0x8c44('0x4')](_0x422417,_0x468b93);if(_0x422417===_0x8c44('0x5')){_0x4b0d8b[_0x8c44('0x4')](_0x8c44('0x6')+_0x468b93[_0x8c44('0x7')],_0x468b93);}};}exports[_0x8c44('0x8')]=function(_0x667b35){for(var _0x146ccf=0x0,_0x3ed469=events[_0x8c44('0x9')];_0x146ccf<_0x3ed469;_0x146ccf++){var _0x531f90=events[_0x146ccf];var _0xef5b9b=createListener(_0x8c44('0xa')+_0x531f90,_0x667b35);UserSettingEvents['on'](_0x531f90,_0xef5b9b);}}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index c33190f..b556d90 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 _0xf438=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','isAuthenticated','index','get','/describe','describe','whoami','/presence','getPresence','/:id','show','/:id/avatar','getAvatar','/:id/open_tabs','/:id/contacts','getContacts','/:id/queues','getQueues','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getFaxInteractions','/:id/teams','getTeams','/:id/lists','/:id/agents','getAgents','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','getMailAccounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','getWhatsappAccounts','getScheduledCalls','/:id/api_key','getApiKey','post','addContacts','create','/create_many','addQueues','diskStorage','join','root','format','now','single','file','addAvatar','/:id/login','login','/:id/logout','/:id/pause','pause','unpause','addTeams','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','/:id/mail_accounts','addMailAccounts','/:id/openchannel_accounts','addOpenchannelAccounts','addSmsAccounts','createApiKey','put','update','/:id/password','delete','removeQueues','removeTeams','destroy','removeChatInteractions','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','/:id/whatsapp_accounts','removeWhatsappAccounts','removeApiKey','/:id/messengerSoundNotification','messengerSoundNotification','exports','util','path','connect-timeout','express'];(function(_0xee3c05,_0x5c27c6){var _0x2b2f62=function(_0x1b0591){while(--_0x1b0591){_0xee3c05['push'](_0xee3c05['shift']());}};_0x2b2f62(++_0x5c27c6);}(_0xf438,0xe0));var _0x8f43=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0xf438[_0x53ccf2];return _0x5a2964;};'use strict';var multer=require('multer');var util=require(_0x8f43('0x0'));var path=require(_0x8f43('0x1'));var timeout=require(_0x8f43('0x2'));var express=require(_0x8f43('0x3'));var router=express['Router']();var fs_extra=require(_0x8f43('0x4'));var auth=require(_0x8f43('0x5'));var interaction=require(_0x8f43('0x6'));var config=require(_0x8f43('0x7'));var controller=require(_0x8f43('0x8'));router['get']('/',auth[_0x8f43('0x9')](),controller[_0x8f43('0xa')]);router[_0x8f43('0xb')](_0x8f43('0xc'),auth['isAuthenticated'](),controller[_0x8f43('0xd')]);router[_0x8f43('0xb')]('/whoami',auth[_0x8f43('0x9')](),controller[_0x8f43('0xe')]);router['get'](_0x8f43('0xf'),auth[_0x8f43('0x9')](),controller[_0x8f43('0x10')]);router[_0x8f43('0xb')](_0x8f43('0x11'),auth[_0x8f43('0x9')](),controller[_0x8f43('0x12')]);router[_0x8f43('0xb')](_0x8f43('0x13'),controller[_0x8f43('0x14')]);router[_0x8f43('0xb')](_0x8f43('0x15'),auth[_0x8f43('0x9')](),controller['getOpenTabs']);router[_0x8f43('0xb')](_0x8f43('0x16'),auth[_0x8f43('0x9')](),controller[_0x8f43('0x17')]);router[_0x8f43('0xb')](_0x8f43('0x18'),auth[_0x8f43('0x9')](),controller[_0x8f43('0x19')]);router['get']('/:id/queues_rt',auth[_0x8f43('0x9')](),controller[_0x8f43('0x1a')]);router[_0x8f43('0xb')](_0x8f43('0x1b'),auth[_0x8f43('0x9')](),controller[_0x8f43('0x1c')]);router['get'](_0x8f43('0x1d'),auth[_0x8f43('0x9')](),controller[_0x8f43('0x1e')]);router[_0x8f43('0xb')]('/:id/screen_recordings',auth['isAuthenticated'](),controller['getScreenRecordings']);router['get'](_0x8f43('0x1f'),auth[_0x8f43('0x9')](),controller[_0x8f43('0x20')]);router[_0x8f43('0xb')](_0x8f43('0x21'),auth['isAuthenticated'](),controller[_0x8f43('0x22')]);router[_0x8f43('0xb')](_0x8f43('0x23'),auth['isAuthenticated'](),controller[_0x8f43('0x24')]);router[_0x8f43('0xb')](_0x8f43('0x25'),auth[_0x8f43('0x9')](),controller['getSmsInteractions']);router[_0x8f43('0xb')]('/:id/fax/interactions',auth[_0x8f43('0x9')](),controller[_0x8f43('0x26')]);router[_0x8f43('0xb')]('/:id/whatsapp/interactions',auth[_0x8f43('0x9')](),controller['getWhatsappInteractions']);router[_0x8f43('0xb')](_0x8f43('0x27'),auth[_0x8f43('0x9')](),controller[_0x8f43('0x28')]);router[_0x8f43('0xb')](_0x8f43('0x29'),auth[_0x8f43('0x9')](),controller['getLists']);router[_0x8f43('0xb')](_0x8f43('0x2a'),auth[_0x8f43('0x9')](),controller[_0x8f43('0x2b')]);router[_0x8f43('0xb')]('/:id/prefixes',auth['isAuthenticated'](),controller[_0x8f43('0x2c')]);router[_0x8f43('0xb')](_0x8f43('0x2d'),auth['isAuthenticated'](),controller[_0x8f43('0x2e')]);router[_0x8f43('0xb')]('/:id/mail_accounts',auth['isAuthenticated'](),controller[_0x8f43('0x2f')]);router[_0x8f43('0xb')]('/:id/openchannel_accounts',auth[_0x8f43('0x9')](),controller[_0x8f43('0x30')]);router[_0x8f43('0xb')](_0x8f43('0x31'),auth[_0x8f43('0x9')](),controller[_0x8f43('0x32')]);router['get'](_0x8f43('0x33'),auth['isAuthenticated'](),controller[_0x8f43('0x34')]);router[_0x8f43('0xb')]('/:id/whatsapp_accounts',auth[_0x8f43('0x9')](),controller[_0x8f43('0x35')]);router['get']('/:id/scheduled_calls',auth['isAuthenticated'](),controller[_0x8f43('0x36')]);router[_0x8f43('0xb')](_0x8f43('0x37'),auth[_0x8f43('0x9')](),controller[_0x8f43('0x38')]);router[_0x8f43('0x39')](_0x8f43('0x16'),auth[_0x8f43('0x9')](),controller[_0x8f43('0x3a')]);router[_0x8f43('0x39')]('/',auth[_0x8f43('0x9')](),controller[_0x8f43('0x3b')]);router[_0x8f43('0x39')](_0x8f43('0x3c'),auth[_0x8f43('0x9')](),controller['bulkCreate']);router['post'](_0x8f43('0x18'),auth[_0x8f43('0x9')](),controller[_0x8f43('0x3d')]);var upload=multer({'storage':multer[_0x8f43('0x3e')]({'destination':function(_0x64ae7,_0x40463c,_0x3b9fb4){_0x3b9fb4(null,path[_0x8f43('0x3f')](config[_0x8f43('0x40')],'server/files/images/'));},'filename':function(_0x83d9a8,_0x361c51,_0x5075d4){_0x5075d4(null,util[_0x8f43('0x41')]('%s-%s',Date[_0x8f43('0x42')](),_0x361c51['originalname']));}})});router[_0x8f43('0x39')]('/:id/avatar',upload[_0x8f43('0x43')](_0x8f43('0x44')),controller[_0x8f43('0x45')]);router[_0x8f43('0x39')](_0x8f43('0x46'),auth[_0x8f43('0x9')](),controller[_0x8f43('0x47')]);router['post'](_0x8f43('0x48'),auth['isAuthenticated'](),controller['logout']);router['post'](_0x8f43('0x49'),auth['isAuthenticated'](),controller[_0x8f43('0x4a')]);router['post']('/:id/unpause',auth[_0x8f43('0x9')](),controller[_0x8f43('0x4b')]);router[_0x8f43('0x39')]('/:id/teams',auth[_0x8f43('0x9')](),controller[_0x8f43('0x4c')]);router[_0x8f43('0x39')]('/:id/chat_interactions',auth['isAuthenticated'](),controller[_0x8f43('0x4d')]);router['post'](_0x8f43('0x4e'),auth[_0x8f43('0x9')](),controller[_0x8f43('0x4f')]);router['post'](_0x8f43('0x50'),auth['isAuthenticated'](),controller['addFaxInteractions']);router['post'](_0x8f43('0x51'),auth['isAuthenticated'](),controller[_0x8f43('0x52')]);router[_0x8f43('0x39')](_0x8f43('0x53'),auth[_0x8f43('0x9')](),controller[_0x8f43('0x54')]);router[_0x8f43('0x39')](_0x8f43('0x55'),auth[_0x8f43('0x9')](),controller['addWhatsappInteractions']);router['post'](_0x8f43('0x2d'),auth['isAuthenticated'](),controller['addFaxAccounts']);router[_0x8f43('0x39')](_0x8f43('0x56'),auth['isAuthenticated'](),controller[_0x8f43('0x57')]);router[_0x8f43('0x39')](_0x8f43('0x58'),auth[_0x8f43('0x9')](),controller[_0x8f43('0x59')]);router[_0x8f43('0x39')](_0x8f43('0x31'),auth[_0x8f43('0x9')](),controller[_0x8f43('0x5a')]);router['post']('/:id/chat_websites',auth[_0x8f43('0x9')](),controller['addChatWebsites']);router[_0x8f43('0x39')]('/:id/whatsapp_accounts',auth[_0x8f43('0x9')](),controller['addWhatsappAccounts']);router[_0x8f43('0x39')](_0x8f43('0x37'),auth[_0x8f43('0x9')](),controller[_0x8f43('0x5b')]);router[_0x8f43('0x5c')](_0x8f43('0x11'),auth['isAuthenticated'](),controller[_0x8f43('0x5d')]);router[_0x8f43('0x5c')](_0x8f43('0x5e'),auth[_0x8f43('0x9')](),controller['changePassword']);router[_0x8f43('0x5f')]('/:id/queues',auth[_0x8f43('0x9')](),controller[_0x8f43('0x60')]);router[_0x8f43('0x5f')](_0x8f43('0x27'),auth[_0x8f43('0x9')](),controller[_0x8f43('0x61')]);router[_0x8f43('0x5f')](_0x8f43('0x11'),auth[_0x8f43('0x9')](),controller[_0x8f43('0x62')]);router['delete']('/:id/chat_interactions',auth[_0x8f43('0x9')](),controller[_0x8f43('0x63')]);router[_0x8f43('0x5f')](_0x8f43('0x4e'),auth['isAuthenticated'](),controller[_0x8f43('0x64')]);router['delete']('/:id/fax_interactions',auth['isAuthenticated'](),controller[_0x8f43('0x65')]);router['delete'](_0x8f43('0x51'),auth[_0x8f43('0x9')](),controller[_0x8f43('0x66')]);router[_0x8f43('0x5f')](_0x8f43('0x53'),auth[_0x8f43('0x9')](),controller[_0x8f43('0x67')]);router['delete'](_0x8f43('0x55'),auth[_0x8f43('0x9')](),controller[_0x8f43('0x68')]);router[_0x8f43('0x5f')]('/:id/fax_accounts',auth['isAuthenticated'](),controller[_0x8f43('0x69')]);router[_0x8f43('0x5f')](_0x8f43('0x56'),auth['isAuthenticated'](),controller[_0x8f43('0x6a')]);router[_0x8f43('0x5f')]('/:id/openchannel_accounts',auth[_0x8f43('0x9')](),controller[_0x8f43('0x6b')]);router[_0x8f43('0x5f')](_0x8f43('0x31'),auth[_0x8f43('0x9')](),controller['removeSmsAccounts']);router[_0x8f43('0x5f')](_0x8f43('0x33'),auth[_0x8f43('0x9')](),controller['removeChatWebsites']);router[_0x8f43('0x5f')](_0x8f43('0x6c'),auth[_0x8f43('0x9')](),controller[_0x8f43('0x6d')]);router[_0x8f43('0x5f')](_0x8f43('0x37'),auth[_0x8f43('0x9')](),controller[_0x8f43('0x6e')]);router[_0x8f43('0x39')](_0x8f43('0x6f'),auth[_0x8f43('0x9')](),controller[_0x8f43('0x70')]);module[_0x8f43('0x71')]=router; \ No newline at end of file +var _0xcd7a=['getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','getOpenchannelAccounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','getScheduledCalls','/:id/api_key','getApiKey','create','post','/create_many','bulkCreate','addQueues','diskStorage','join','root','%s-%s','now','originalname','/:id/avatar','file','/:id/login','login','/:id/logout','/:id/pause','addTeams','addChatInteractions','/:id/mail_interactions','addMailInteractions','addFaxInteractions','addSmsInteractions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','addOpenchannelAccounts','/:id/sms_accounts','addSmsAccounts','addWhatsappAccounts','createApiKey','put','update','changePassword','delete','/:id/chat_interactions','removeChatInteractions','removeMailInteractions','/:id/fax_interactions','removeSmsInteractions','/:id/openchannel_interactions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','/:id/openchannel_accounts','removeOpenchannelAccounts','removeSmsAccounts','messengerSoundNotification','exports','multer','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','get','isAuthenticated','index','/describe','describe','/whoami','/presence','getPresence','/:id','show','getAvatar','/:id/open_tabs','/:id/contacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','getSmsInteractions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getTeams','getLists','/:id/agents','getAgents'];(function(_0x24d676,_0x40fdbc){var _0x14f30e=function(_0x2a4a9f){while(--_0x2a4a9f){_0x24d676['push'](_0x24d676['shift']());}};_0x14f30e(++_0x40fdbc);}(_0xcd7a,0x115));var _0xacd7=function(_0x94eb04,_0x1d0870){_0x94eb04=_0x94eb04-0x0;var _0x4d5e86=_0xcd7a[_0x94eb04];return _0x4d5e86;};'use strict';var multer=require(_0xacd7('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xacd7('0x1'));var express=require(_0xacd7('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xacd7('0x3'));var interaction=require(_0xacd7('0x4'));var config=require(_0xacd7('0x5'));var controller=require(_0xacd7('0x6'));router[_0xacd7('0x7')]('/',auth[_0xacd7('0x8')](),controller[_0xacd7('0x9')]);router[_0xacd7('0x7')](_0xacd7('0xa'),auth[_0xacd7('0x8')](),controller[_0xacd7('0xb')]);router[_0xacd7('0x7')](_0xacd7('0xc'),auth[_0xacd7('0x8')](),controller['whoami']);router[_0xacd7('0x7')](_0xacd7('0xd'),auth[_0xacd7('0x8')](),controller[_0xacd7('0xe')]);router[_0xacd7('0x7')](_0xacd7('0xf'),auth['isAuthenticated'](),controller[_0xacd7('0x10')]);router[_0xacd7('0x7')]('/:id/avatar',controller[_0xacd7('0x11')]);router[_0xacd7('0x7')](_0xacd7('0x12'),auth['isAuthenticated'](),controller['getOpenTabs']);router[_0xacd7('0x7')](_0xacd7('0x13'),auth[_0xacd7('0x8')](),controller['getContacts']);router['get'](_0xacd7('0x14'),auth[_0xacd7('0x8')](),controller[_0xacd7('0x15')]);router[_0xacd7('0x7')](_0xacd7('0x16'),auth[_0xacd7('0x8')](),controller[_0xacd7('0x17')]);router[_0xacd7('0x7')](_0xacd7('0x18'),auth[_0xacd7('0x8')](),controller[_0xacd7('0x19')]);router[_0xacd7('0x7')](_0xacd7('0x1a'),auth[_0xacd7('0x8')](),controller[_0xacd7('0x1b')]);router[_0xacd7('0x7')](_0xacd7('0x1c'),auth['isAuthenticated'](),controller['getScreenRecordings']);router['get'](_0xacd7('0x1d'),auth[_0xacd7('0x8')](),controller[_0xacd7('0x1e')]);router[_0xacd7('0x7')](_0xacd7('0x1f'),auth['isAuthenticated'](),controller[_0xacd7('0x20')]);router[_0xacd7('0x7')](_0xacd7('0x21'),auth[_0xacd7('0x8')](),controller[_0xacd7('0x22')]);router[_0xacd7('0x7')]('/:id/sms/interactions',auth[_0xacd7('0x8')](),controller[_0xacd7('0x23')]);router['get']('/:id/fax/interactions',auth[_0xacd7('0x8')](),controller[_0xacd7('0x24')]);router['get'](_0xacd7('0x25'),auth[_0xacd7('0x8')](),controller[_0xacd7('0x26')]);router[_0xacd7('0x7')](_0xacd7('0x27'),auth[_0xacd7('0x8')](),controller[_0xacd7('0x28')]);router[_0xacd7('0x7')]('/:id/lists',auth[_0xacd7('0x8')](),controller[_0xacd7('0x29')]);router[_0xacd7('0x7')](_0xacd7('0x2a'),auth[_0xacd7('0x8')](),controller[_0xacd7('0x2b')]);router[_0xacd7('0x7')]('/:id/prefixes',auth[_0xacd7('0x8')](),controller[_0xacd7('0x2c')]);router[_0xacd7('0x7')](_0xacd7('0x2d'),auth[_0xacd7('0x8')](),controller[_0xacd7('0x2e')]);router[_0xacd7('0x7')](_0xacd7('0x2f'),auth[_0xacd7('0x8')](),controller[_0xacd7('0x30')]);router['get']('/:id/openchannel_accounts',auth[_0xacd7('0x8')](),controller[_0xacd7('0x31')]);router[_0xacd7('0x7')]('/:id/sms_accounts',auth[_0xacd7('0x8')](),controller['getSmsAccounts']);router[_0xacd7('0x7')](_0xacd7('0x32'),auth[_0xacd7('0x8')](),controller[_0xacd7('0x33')]);router['get'](_0xacd7('0x34'),auth[_0xacd7('0x8')](),controller[_0xacd7('0x35')]);router[_0xacd7('0x7')]('/:id/scheduled_calls',auth[_0xacd7('0x8')](),controller[_0xacd7('0x36')]);router['get'](_0xacd7('0x37'),auth[_0xacd7('0x8')](),controller[_0xacd7('0x38')]);router['post'](_0xacd7('0x13'),auth['isAuthenticated'](),controller['addContacts']);router['post']('/',auth[_0xacd7('0x8')](),controller[_0xacd7('0x39')]);router[_0xacd7('0x3a')](_0xacd7('0x3b'),auth[_0xacd7('0x8')](),controller[_0xacd7('0x3c')]);router['post'](_0xacd7('0x14'),auth[_0xacd7('0x8')](),controller[_0xacd7('0x3d')]);var upload=multer({'storage':multer[_0xacd7('0x3e')]({'destination':function(_0x4f7210,_0x47a09b,_0x54e064){_0x54e064(null,path[_0xacd7('0x3f')](config[_0xacd7('0x40')],'server/files/images/'));},'filename':function(_0x100cd3,_0x4b40e7,_0x17fa5a){_0x17fa5a(null,util['format'](_0xacd7('0x41'),Date[_0xacd7('0x42')](),_0x4b40e7[_0xacd7('0x43')]));}})});router['post'](_0xacd7('0x44'),upload['single'](_0xacd7('0x45')),controller['addAvatar']);router[_0xacd7('0x3a')](_0xacd7('0x46'),auth[_0xacd7('0x8')](),controller[_0xacd7('0x47')]);router[_0xacd7('0x3a')](_0xacd7('0x48'),auth[_0xacd7('0x8')](),controller['logout']);router['post'](_0xacd7('0x49'),auth[_0xacd7('0x8')](),controller['pause']);router[_0xacd7('0x3a')]('/:id/unpause',auth['isAuthenticated'](),controller['unpause']);router['post'](_0xacd7('0x27'),auth[_0xacd7('0x8')](),controller[_0xacd7('0x4a')]);router[_0xacd7('0x3a')]('/:id/chat_interactions',auth[_0xacd7('0x8')](),controller[_0xacd7('0x4b')]);router[_0xacd7('0x3a')](_0xacd7('0x4c'),auth['isAuthenticated'](),controller[_0xacd7('0x4d')]);router['post']('/:id/fax_interactions',auth[_0xacd7('0x8')](),controller[_0xacd7('0x4e')]);router['post']('/:id/sms_interactions',auth['isAuthenticated'](),controller[_0xacd7('0x4f')]);router[_0xacd7('0x3a')]('/:id/openchannel_interactions',auth[_0xacd7('0x8')](),controller[_0xacd7('0x50')]);router[_0xacd7('0x3a')](_0xacd7('0x51'),auth[_0xacd7('0x8')](),controller[_0xacd7('0x52')]);router[_0xacd7('0x3a')](_0xacd7('0x2d'),auth[_0xacd7('0x8')](),controller[_0xacd7('0x53')]);router[_0xacd7('0x3a')](_0xacd7('0x2f'),auth['isAuthenticated'](),controller['addMailAccounts']);router['post']('/:id/openchannel_accounts',auth[_0xacd7('0x8')](),controller[_0xacd7('0x54')]);router[_0xacd7('0x3a')](_0xacd7('0x55'),auth[_0xacd7('0x8')](),controller[_0xacd7('0x56')]);router['post']('/:id/chat_websites',auth['isAuthenticated'](),controller['addChatWebsites']);router[_0xacd7('0x3a')](_0xacd7('0x34'),auth[_0xacd7('0x8')](),controller[_0xacd7('0x57')]);router[_0xacd7('0x3a')]('/:id/api_key',auth[_0xacd7('0x8')](),controller[_0xacd7('0x58')]);router[_0xacd7('0x59')]('/:id',auth[_0xacd7('0x8')](),controller[_0xacd7('0x5a')]);router[_0xacd7('0x59')]('/:id/password',auth[_0xacd7('0x8')](),controller[_0xacd7('0x5b')]);router[_0xacd7('0x5c')](_0xacd7('0x14'),auth[_0xacd7('0x8')](),controller['removeQueues']);router[_0xacd7('0x5c')]('/:id/teams',auth['isAuthenticated'](),controller['removeTeams']);router[_0xacd7('0x5c')](_0xacd7('0xf'),auth[_0xacd7('0x8')](),controller['destroy']);router[_0xacd7('0x5c')](_0xacd7('0x5d'),auth[_0xacd7('0x8')](),controller[_0xacd7('0x5e')]);router[_0xacd7('0x5c')](_0xacd7('0x4c'),auth[_0xacd7('0x8')](),controller[_0xacd7('0x5f')]);router['delete'](_0xacd7('0x60'),auth['isAuthenticated'](),controller['removeFaxInteractions']);router[_0xacd7('0x5c')]('/:id/sms_interactions',auth[_0xacd7('0x8')](),controller[_0xacd7('0x61')]);router[_0xacd7('0x5c')](_0xacd7('0x62'),auth['isAuthenticated'](),controller['removeOpenchannelInteractions']);router[_0xacd7('0x5c')](_0xacd7('0x51'),auth[_0xacd7('0x8')](),controller[_0xacd7('0x63')]);router['delete'](_0xacd7('0x2d'),auth['isAuthenticated'](),controller[_0xacd7('0x64')]);router[_0xacd7('0x5c')]('/:id/mail_accounts',auth[_0xacd7('0x8')](),controller[_0xacd7('0x65')]);router[_0xacd7('0x5c')](_0xacd7('0x66'),auth[_0xacd7('0x8')](),controller[_0xacd7('0x67')]);router[_0xacd7('0x5c')](_0xacd7('0x55'),auth[_0xacd7('0x8')](),controller[_0xacd7('0x68')]);router[_0xacd7('0x5c')](_0xacd7('0x32'),auth[_0xacd7('0x8')](),controller['removeChatWebsites']);router[_0xacd7('0x5c')](_0xacd7('0x34'),auth[_0xacd7('0x8')](),controller['removeWhatsappAccounts']);router[_0xacd7('0x5c')]('/:id/api_key',auth[_0xacd7('0x8')](),controller['removeApiKey']);router[_0xacd7('0x3a')]('/:id/messengerSoundNotification',auth[_0xacd7('0x8')](),controller[_0xacd7('0x69')]);module[_0xacd7('0x6a')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index d36df82..e5b79a1 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 _0x54a4=['encryption','avpf','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','rtcp_mux','force_avp','icesupport','/etc/pki/tls/certs/motion.crt','dtlsprivatekey','/etc/pki/tls/private/motion.key','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blocked','UNSIGNED','sequelize','moment','util','lodash','exports','STRING','name','setDataValue','fullname','callerid','format','\x22%s\x22\x20<%s>','internal','email','toLowerCase','user','INTEGER','accountcode','getDataValue','DATE','BOOLEAN','dynamic','ENUM','friend','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','udp','transport','split','shortinfo','inband','auto','rfc2833','yes','outgoing','force_rport,comedia','join','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\x22gsm\x22]','insecure','\x22\x22\x20<>','always','accept','originate','uac','uas','fingerprint','certificate','active','passive','actpass','nonat','update','update,nonat','showWebBar','get','wss'];(function(_0x1a23e2,_0x16c7db){var _0x541ffd=function(_0x4ff316){while(--_0x4ff316){_0x1a23e2['push'](_0x1a23e2['shift']());}};_0x541ffd(++_0x16c7db);}(_0x54a4,0x118));var _0x454a=function(_0x11efcd,_0x43af40){_0x11efcd=_0x11efcd-0x0;var _0x548fbf=_0x54a4[_0x11efcd];return _0x548fbf;};'use strict';var Sequelize=require(_0x454a('0x0'));var moment=require(_0x454a('0x1'));var util=require(_0x454a('0x2'));var _=require(_0x454a('0x3'));module[_0x454a('0x4')]={'name':{'type':Sequelize[_0x454a('0x5')],'allowNull':![],'unique':_0x454a('0x6'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x557026){this[_0x454a('0x7')](_0x454a('0x6'),_0x557026);this[_0x454a('0x7')]('defaultuser',_0x557026);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0x454a('0x5')],'allowNull':![],'set':function(_0x29fe9b){this[_0x454a('0x7')](_0x454a('0x8'),_0x29fe9b);this['setDataValue'](_0x454a('0x9'),util[_0x454a('0xa')](_0x454a('0xb'),_0x29fe9b,this['getDataValue'](_0x454a('0xc'))));}},'alias':{'type':Sequelize[_0x454a('0x5')]},'email':{'type':Sequelize[_0x454a('0x5')],'allowNull':![],'unique':_0x454a('0xd'),'validate':{'isEmail':!![]},'set':function(_0x4c1aea){if(_0x4c1aea){this['setDataValue'](_0x454a('0xd'),_0x4c1aea[_0x454a('0xe')]());}}},'role':{'type':Sequelize['ENUM']('admin',_0x454a('0xf'),'agent','telephone'),'allowNull':![]},'password':{'type':Sequelize[_0x454a('0x5')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x454a('0x5')],'defaultValue':'local'},'internal':{'type':Sequelize[_0x454a('0x10')](0xb),'allowNull':![],'unique':'internal','set':function(_0x2b34cd){this[_0x454a('0x7')](_0x454a('0xc'),_0x2b34cd);this[_0x454a('0x7')](_0x454a('0x11'),_0x2b34cd);this[_0x454a('0x7')]('callerid',util['format'](_0x454a('0xb'),this[_0x454a('0x12')](_0x454a('0x8')),_0x2b34cd));}},'salt':{'type':Sequelize[_0x454a('0x5')]},'phone':{'type':Sequelize[_0x454a('0x5')]},'mobile':{'type':Sequelize[_0x454a('0x5')]},'address':{'type':Sequelize[_0x454a('0x5')]},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize[_0x454a('0x5')]},'city':{'type':Sequelize[_0x454a('0x5')]},'country':{'type':Sequelize['STRING']},'online':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x454a('0x13')]},'voicePause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x454a('0x14')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x454a('0x14')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x454a('0x14')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x454a('0x14')],'defaultValue':![]},'whatsappPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x454a('0x14')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x454a('0x5')],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize[_0x454a('0x13')]},'chatCapacity':{'type':Sequelize[_0x454a('0x10')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x454a('0x10')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x454a('0x10')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x454a('0x10')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x454a('0x10')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x454a('0x14')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x454a('0x14')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x454a('0x10')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x454a('0x10')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize['INTEGER'],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x454a('0x14')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x454a('0x14')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x454a('0x14')],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize[_0x454a('0x5')],'allowNull':!![],'defaultValue':_0x454a('0x15')},'ipaddr':{'type':Sequelize[_0x454a('0x5')],'allowNull':!![]},'port':{'type':Sequelize[_0x454a('0x10')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x454a('0x10')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize['STRING'],'allowNull':!![]},'regserver':{'type':Sequelize[_0x454a('0x5')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x454a('0x5')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x454a('0x10')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x454a('0x16')]('friend',_0x454a('0xf'),'peer'),'allowNull':!![],'defaultValue':_0x454a('0x17')},'context':{'type':Sequelize[_0x454a('0x5')],'allowNull':!![],'defaultValue':'from-sip'},'callingpres':{'type':Sequelize[_0x454a('0x16')](_0x454a('0x18'),_0x454a('0x19'),_0x454a('0x1a'),'ALLOWED',_0x454a('0x1b'),_0x454a('0x1c'),_0x454a('0x1d'),'PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize[_0x454a('0x5')],'allowNull':!![]},'permit':{'type':Sequelize[_0x454a('0x5')],'allowNull':!![]},'secret':{'type':Sequelize['STRING'],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x454a('0x5')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x454a('0x5')],'allowNull':!![]},'transport':{'type':Sequelize[_0x454a('0x5')],'allowNull':!![],'defaultValue':_0x454a('0x1e'),'set':function(_0x2465f3){this[_0x454a('0x7')]('transport',_0x2465f3?_0x2465f3['join'](','):null);},'get':function(){return this[_0x454a('0x12')](_0x454a('0x1f'))?this[_0x454a('0x12')](_0x454a('0x1f'))[_0x454a('0x20')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize['ENUM']('rfc2833','info',_0x454a('0x21'),_0x454a('0x22'),_0x454a('0x23')),'allowNull':!![],'defaultValue':_0x454a('0x24')},'directmedia':{'type':Sequelize[_0x454a('0x16')](_0x454a('0x25'),'no','nonat','update',_0x454a('0x26')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x454a('0x16')](_0x454a('0x25'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x454a('0x5')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x454a('0x5')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x454a('0x27'),'set':function(_0x290567){this[_0x454a('0x7')]('nat',_0x290567?_0x290567[_0x454a('0x28')](','):null);},'get':function(){return this[_0x454a('0x12')](_0x454a('0x29'))?this[_0x454a('0x12')]('nat')[_0x454a('0x20')](','):null;},'comment':_0x454a('0x2a')},'callgroup':{'type':Sequelize[_0x454a('0x5')]},'namedcallgroup':{'type':Sequelize[_0x454a('0x5')]},'pickupgroup':{'type':Sequelize[_0x454a('0x5')]},'namedpickupgroup':{'type':Sequelize[_0x454a('0x5')]},'language':{'type':Sequelize[_0x454a('0x5')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x454a('0x5')]},'disallow':{'type':Sequelize[_0x454a('0x5')],'allowNull':![],'defaultValue':_0x454a('0x2b')},'allow':{'type':Sequelize[_0x454a('0x5')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x518f6c){this[_0x454a('0x7')]('allow',_0x518f6c?_0x518f6c[_0x454a('0x28')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0x454a('0x12')](_0x454a('0x2c'))?this['getDataValue']('allow')[_0x454a('0x20')](';'):null;},'comment':_0x454a('0x2d')},'autoframing':{'type':Sequelize['ENUM'](_0x454a('0x25'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize['STRING'],'allowNull':!![],'set':function(_0xac616c){this[_0x454a('0x7')](_0x454a('0x2e'),_0xac616c?_0xac616c[_0x454a('0x28')](','):null);},'get':function(){return this[_0x454a('0x12')](_0x454a('0x2e'))?this[_0x454a('0x12')](_0x454a('0x2e'))[_0x454a('0x20')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x454a('0x16')](_0x454a('0x25'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0x454a('0x25'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x454a('0x16')]('yes','no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x454a('0x16')](_0x454a('0x25'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x454a('0x16')](_0x454a('0x25'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x454a('0x10')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize['STRING'],'allowNull':!![]},'callerid':{'type':Sequelize[_0x454a('0x5')],'allowNull':!![],'defaultValue':_0x454a('0x2f')},'amaflags':{'type':Sequelize['STRING'],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x454a('0x16')](_0x454a('0x25'),'no'),'allowNull':!![],'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0x454a('0x10')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize['ENUM'](_0x454a('0x25'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0x454a('0x25'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x454a('0x16')]('yes','no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize['ENUM'](_0x454a('0x25'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x454a('0x5')],'allowNull':!![]},'template':{'type':Sequelize[_0x454a('0x5')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x454a('0x16')](_0x454a('0x25'),'no',_0x454a('0x30')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x454a('0x10')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM'](_0x454a('0x25'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x454a('0x5')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x454a('0x16')](_0x454a('0x31'),'refuse',_0x454a('0x32')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x454a('0x10')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x454a('0x10')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x454a('0x16')](_0x454a('0x33'),'uas'),'allowNull':!![],'defaultValue':_0x454a('0x34')},'t38pt_usertpsource':{'type':Sequelize[_0x454a('0x5')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x454a('0x5')],'allowNull':!![]},'fromdomain':{'type':Sequelize['STRING'],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x454a('0x5')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x454a('0x16')](_0x454a('0x25'),'no'),'allowNull':!![],'defaultValue':_0x454a('0x25')},'keepalive':{'type':Sequelize[_0x454a('0x10')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x454a('0x5')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x454a('0x5')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x454a('0x10')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x454a('0x10')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x454a('0x10')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x454a('0x16')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING'],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x454a('0x5')],'allowNull':!![]},'timert1':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x454a('0x10')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize['STRING'],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x454a('0x5')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x454a('0x5')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x454a('0x5')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x454a('0x10')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x454a('0x16')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x454a('0x16')](_0x454a('0x25'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x454a('0x16')](_0x454a('0x25'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x454a('0x16')](_0x454a('0x25'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x454a('0x16')](_0x454a('0x25'),'no',_0x454a('0x35'),_0x454a('0x36')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x454a('0x10')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x454a('0x5')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x454a('0x5')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x454a('0x5')],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlssetup':{'type':Sequelize['ENUM'](_0x454a('0x37'),_0x454a('0x38'),_0x454a('0x39')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING'],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x454a('0x16')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x454a('0x5')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x454a('0x5')],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x454a('0x16')]('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize['ENUM'](_0x454a('0x25'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x454a('0x5')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x454a('0x5')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x454a('0x5')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x454a('0x5')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x454a('0x16')](_0x454a('0x25'),'no',_0x454a('0x3a'),_0x454a('0x3b'),_0x454a('0x3c')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x454a('0x14')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x454a('0x5')]},'resetPasswordExpires':{'type':Sequelize['DATE']},'passwordResetAt':{'type':Sequelize['DATE'],'defaultValue':null},'previousPasswords':{'type':Sequelize['TEXT']},'showWebBar':{'type':Sequelize[_0x454a('0x10')],'defaultValue':0x0,'set':function(_0xf8f19f){this['setDataValue'](_0x454a('0x3d'),_0xf8f19f);var _0x49ae42=this[_0x454a('0x3e')]({'plain':!![]});switch(_0xf8f19f){case 0x0:case 0x1:var _0x258bae=_0x49ae42[_0x454a('0x1f')]?_['isArray'](_0x49ae42[_0x454a('0x1f')])?_0x49ae42[_0x454a('0x1f')]['join']():_0x49ae42[_0x454a('0x1f')]:_0x454a('0x1e');if(_0x258bae===_0x454a('0x3f')){_0x258bae=_0x454a('0x1e');}this[_0x454a('0x7')](_0x454a('0x1f'),_0x258bae);this[_0x454a('0x7')](_0x454a('0x40'),'no');this[_0x454a('0x7')](_0x454a('0x41'),null);this['setDataValue']('force_avp',null);this[_0x454a('0x7')]('icesupport',null);this[_0x454a('0x7')](_0x454a('0x42'),null);this[_0x454a('0x7')](_0x454a('0x43'),null);this[_0x454a('0x7')](_0x454a('0x44'),null);this[_0x454a('0x7')](_0x454a('0x45'),null);this['setDataValue']('dtlsprivatekey',null);this[_0x454a('0x7')](_0x454a('0x46'),'no');break;case 0x2:this[_0x454a('0x7')]('transport','wss');this[_0x454a('0x7')](_0x454a('0x40'),_0x454a('0x25'));this[_0x454a('0x7')]('avpf',_0x454a('0x25'));this[_0x454a('0x7')](_0x454a('0x47'),'yes');this['setDataValue'](_0x454a('0x48'),'yes');this[_0x454a('0x7')](_0x454a('0x42'),'yes');this[_0x454a('0x7')](_0x454a('0x43'),'no');this[_0x454a('0x7')](_0x454a('0x44'),_0x454a('0x39'));this['setDataValue'](_0x454a('0x45'),_0x49ae42[_0x454a('0x45')]||_0x454a('0x49'));this[_0x454a('0x7')](_0x454a('0x4a'),_0x49ae42[_0x454a('0x4a')]||_0x454a('0x4b'));this[_0x454a('0x7')]('rtcp_mux','yes');break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x531ce7){this[_0x454a('0x7')](_0x454a('0x4c'),_0x531ce7?_0x531ce7['join'](','):[]);},'get':function(){return this[_0x454a('0x12')](_0x454a('0x4c'))?_[_0x454a('0x4d')](this[_0x454a('0x12')]('permissions')[_0x454a('0x20')](','),function(_0x4260dd){return parseInt(_0x4260dd,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x454a('0x5')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x454a('0x5')]},'phoneBarBusyNumber':{'type':Sequelize[_0x454a('0x5')]},'phoneBarUnconditional':{'type':Sequelize[_0x454a('0x14')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x454a('0x14')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x454a('0x14')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x454a('0x14')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x454a('0x14')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x454a('0x14')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x454a('0x10')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize['STRING'],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x454a('0x10')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x454a('0x16')](_0x454a('0x25'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x454a('0x14')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize['STRING']},'phoneBarEnableJaws':{'type':Sequelize[_0x454a('0x14')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x454a('0x4e')],'get':function(){return this[_0x454a('0x12')](_0x454a('0x4f'))?this[_0x454a('0x12')](_0x454a('0x4f')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x454a('0x14')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize[_0x454a('0x5')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x454a('0x14')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x454a('0x5')],'allowNull':!![]},'screenrecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x38b575){if(typeof _0x38b575===_0x454a('0x50')){var _0x65d16b=_0x38b575==='1'?!![]:_0x38b575==='0'?![]:_0x38b575===_0x454a('0x51')?!![]:_0x38b575===_0x454a('0x52')?![]:![];this[_0x454a('0x7')](_0x454a('0x53'),_0x65d16b);}else{this['setDataValue'](_0x454a('0x53'),_0x38b575);}}},'blocked':{'type':Sequelize[_0x454a('0x14')],'defaultValue':![],'set':function(_0x3ed37f){this[_0x454a('0x7')](_0x454a('0x54'),_0x3ed37f);if(_0x3ed37f===!![]){this[_0x454a('0x7')]('blockedAt',moment());this['setDataValue']('loginAttempts',0x0);}else{this[_0x454a('0x7')]('blockedAt',null);}}},'blockedAt':{'type':Sequelize[_0x454a('0x13')],'defaultValue':null},'loginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x454a('0x14')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x454a('0x14')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x454a('0x10')](0x5)[_0x454a('0x55')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x454a('0x14')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x454a('0x14')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x454a('0x14')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x454a('0x14')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0x454a('0x14')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x454a('0x14')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0x454a('0x10')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x454a('0x14')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x454a('0x10')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0x454a('0x14')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x454a('0x10')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x454a('0x14')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0x454a('0x10')],'defaultValue':0x0},'messengerSoundNotification':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xacdb=['ALLOWED_NOT_SCREENED','ALLOWED_FAILED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','join','transport','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','shortinfo','inband','rfc2833','yes','nonat','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','accept','refuse','originate','uac','uas','fingerprint','certificate','active','passive','actpass','update,nonat','TEXT','get','isArray','encryption','force_avp','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','dtlsprivatekey','rtcp_mux','wss','avpf','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','permissions','VIRTUAL','phoneBarEnableScreenRecordingByAgent','false','screenrecording','blocked','blockedAt','loginAttempts','UNSIGNED','moment','util','lodash','exports','STRING','name','setDataValue','defaultuser','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','toLowerCase','user','agent','telephone','BOOLEAN','DATE','INTEGER','ENUM','friend','peer','from-sip'];(function(_0x118733,_0x2bd820){var _0x4777af=function(_0x52886a){while(--_0x52886a){_0x118733['push'](_0x118733['shift']());}};_0x4777af(++_0x2bd820);}(_0xacdb,0xf7));var _0xbacd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xacdb[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xbacd('0x0'));var util=require(_0xbacd('0x1'));var _=require(_0xbacd('0x2'));module[_0xbacd('0x3')]={'name':{'type':Sequelize[_0xbacd('0x4')],'allowNull':![],'unique':_0xbacd('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0xee15c2){this['setDataValue'](_0xbacd('0x5'),_0xee15c2);this[_0xbacd('0x6')](_0xbacd('0x7'),_0xee15c2);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0xbacd('0x4')],'allowNull':![],'set':function(_0x20f401){this[_0xbacd('0x6')](_0xbacd('0x8'),_0x20f401);this[_0xbacd('0x6')](_0xbacd('0x9'),util[_0xbacd('0xa')](_0xbacd('0xb'),_0x20f401,this[_0xbacd('0xc')](_0xbacd('0xd'))));}},'alias':{'type':Sequelize[_0xbacd('0x4')]},'email':{'type':Sequelize[_0xbacd('0x4')],'allowNull':![],'unique':_0xbacd('0xe'),'validate':{'isEmail':!![]},'set':function(_0x5ba8af){if(_0x5ba8af){this['setDataValue'](_0xbacd('0xe'),_0x5ba8af[_0xbacd('0xf')]());}}},'role':{'type':Sequelize['ENUM']('admin',_0xbacd('0x10'),_0xbacd('0x11'),_0xbacd('0x12')),'allowNull':![]},'password':{'type':Sequelize[_0xbacd('0x4')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':'local'},'internal':{'type':Sequelize['INTEGER'](0xb),'allowNull':![],'unique':_0xbacd('0xd'),'set':function(_0x37fc35){this[_0xbacd('0x6')](_0xbacd('0xd'),_0x37fc35);this[_0xbacd('0x6')]('accountcode',_0x37fc35);this[_0xbacd('0x6')](_0xbacd('0x9'),util[_0xbacd('0xa')](_0xbacd('0xb'),this[_0xbacd('0xc')]('fullname'),_0x37fc35));}},'salt':{'type':Sequelize[_0xbacd('0x4')]},'phone':{'type':Sequelize[_0xbacd('0x4')]},'mobile':{'type':Sequelize[_0xbacd('0x4')]},'address':{'type':Sequelize[_0xbacd('0x4')]},'zipcode':{'type':Sequelize[_0xbacd('0x4')]},'userpic':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xbacd('0x4')]},'country':{'type':Sequelize[_0xbacd('0x4')]},'online':{'type':Sequelize[_0xbacd('0x13')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0xbacd('0x14')]},'voicePause':{'type':Sequelize[_0xbacd('0x13')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0xbacd('0x13')],'defaultValue':![]},'mailPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsPause':{'type':Sequelize[_0xbacd('0x13')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0xbacd('0x13')],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize[_0xbacd('0x4')],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize[_0xbacd('0x14')]},'chatCapacity':{'type':Sequelize[_0xbacd('0x15')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0xbacd('0x15')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0xbacd('0x15')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0xbacd('0x15')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0xbacd('0x15')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0xbacd('0x13')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0xbacd('0x13')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0xbacd('0x15')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0xbacd('0x15')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0xbacd('0x13')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0xbacd('0x15')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0xbacd('0x13')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0xbacd('0x13')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0xbacd('0x13')],'defaultValue':![]},'description':{'type':Sequelize[_0xbacd('0x4')],'allowNull':!![]},'host':{'type':Sequelize[_0xbacd('0x4')],'allowNull':!![],'defaultValue':'dynamic'},'ipaddr':{'type':Sequelize[_0xbacd('0x4')],'allowNull':!![]},'port':{'type':Sequelize[_0xbacd('0x15')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0xbacd('0x15')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0xbacd('0x4')],'allowNull':!![]},'regserver':{'type':Sequelize[_0xbacd('0x4')],'allowNull':!![]},'useragent':{'type':Sequelize[_0xbacd('0x4')],'allowNull':!![]},'lastms':{'type':Sequelize[_0xbacd('0x15')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0xbacd('0x16')](_0xbacd('0x17'),_0xbacd('0x10'),_0xbacd('0x18')),'allowNull':!![],'defaultValue':_0xbacd('0x17')},'context':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xbacd('0x19')},'callingpres':{'type':Sequelize[_0xbacd('0x16')](_0xbacd('0x1a'),'ALLOWED_PASSED_SCREEN',_0xbacd('0x1b'),'ALLOWED',_0xbacd('0x1c'),_0xbacd('0x1d'),_0xbacd('0x1e'),_0xbacd('0x1f')),'allowNull':!![]},'deny':{'type':Sequelize['STRING'],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize[_0xbacd('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0xbacd('0x4')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0xbacd('0x4')],'allowNull':!![]},'transport':{'type':Sequelize[_0xbacd('0x4')],'allowNull':!![],'defaultValue':_0xbacd('0x20'),'set':function(_0x26c3b9){this[_0xbacd('0x6')]('transport',_0x26c3b9?_0x26c3b9[_0xbacd('0x21')](','):null);},'get':function(){return this['getDataValue'](_0xbacd('0x22'))?this[_0xbacd('0xc')](_0xbacd('0x22'))['split'](','):null;},'comment':_0xbacd('0x23')},'dtmfmode':{'type':Sequelize[_0xbacd('0x16')]('rfc2833',_0xbacd('0x24'),_0xbacd('0x25'),_0xbacd('0x26'),'auto'),'allowNull':!![],'defaultValue':_0xbacd('0x27')},'directmedia':{'type':Sequelize[_0xbacd('0x16')](_0xbacd('0x28'),'no',_0xbacd('0x29'),_0xbacd('0x2a'),_0xbacd('0x2b')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xbacd('0x4')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0xbacd('0x4')],'allowNull':!![]},'nat':{'type':Sequelize[_0xbacd('0x4')],'allowNull':!![],'defaultValue':_0xbacd('0x2c'),'set':function(_0x1d383a){this['setDataValue'](_0xbacd('0x2d'),_0x1d383a?_0x1d383a[_0xbacd('0x21')](','):null);},'get':function(){return this[_0xbacd('0xc')](_0xbacd('0x2d'))?this[_0xbacd('0xc')](_0xbacd('0x2d'))['split'](','):null;},'comment':_0xbacd('0x2e')},'callgroup':{'type':Sequelize[_0xbacd('0x4')]},'namedcallgroup':{'type':Sequelize[_0xbacd('0x4')]},'pickupgroup':{'type':Sequelize[_0xbacd('0x4')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xbacd('0x4')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xbacd('0x4')]},'disallow':{'type':Sequelize[_0xbacd('0x4')],'allowNull':![],'defaultValue':_0xbacd('0x2f')},'allow':{'type':Sequelize[_0xbacd('0x4')],'allowNull':![],'defaultValue':_0xbacd('0x30'),'set':function(_0xb57083){this[_0xbacd('0x6')](_0xbacd('0x31'),_0xb57083?_0xb57083[_0xbacd('0x21')](';'):_0xbacd('0x30'));},'get':function(){return this['getDataValue']('allow')?this[_0xbacd('0xc')]('allow')[_0xbacd('0x32')](';'):null;},'comment':_0xbacd('0x33')},'autoframing':{'type':Sequelize[_0xbacd('0x16')]('yes','no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0xbacd('0x4')],'allowNull':!![],'set':function(_0x79b06){this['setDataValue'](_0xbacd('0x34'),_0x79b06?_0x79b06['join'](','):null);},'get':function(){return this[_0xbacd('0xc')](_0xbacd('0x34'))?this['getDataValue'](_0xbacd('0x34'))[_0xbacd('0x32')](','):null;},'comment':_0xbacd('0x35')},'trustrpid':{'type':Sequelize[_0xbacd('0x16')](_0xbacd('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xbacd('0x16')](_0xbacd('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xbacd('0x16')](_0xbacd('0x28'),'no',_0xbacd('0x36')),'allowNull':!![]},'promiscredir':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM'](_0xbacd('0x28'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0xbacd('0x15')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0xbacd('0x4')],'allowNull':!![]},'callerid':{'type':Sequelize[_0xbacd('0x4')],'allowNull':!![],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0xbacd('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0xbacd('0x16')](_0xbacd('0x28'),'no'),'allowNull':!![],'defaultValue':_0xbacd('0x28')},'busylevel':{'type':Sequelize[_0xbacd('0x15')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0xbacd('0x16')](_0xbacd('0x28'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0xbacd('0x16')](_0xbacd('0x28'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0xbacd('0x16')](_0xbacd('0x28'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0xbacd('0x16')]('yes','no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0xbacd('0x4')],'allowNull':!![]},'template':{'type':Sequelize[_0xbacd('0x4')],'allowNull':!![]},'videosupport':{'type':Sequelize['ENUM']('yes','no','always'),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM'](_0xbacd('0x28'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'session_timers':{'type':Sequelize[_0xbacd('0x16')](_0xbacd('0x37'),_0xbacd('0x38'),_0xbacd('0x39')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0xbacd('0x15')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0xbacd('0x15')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0xbacd('0x16')](_0xbacd('0x3a'),_0xbacd('0x3b')),'allowNull':!![],'defaultValue':_0xbacd('0x3b')},'t38pt_usertpsource':{'type':Sequelize[_0xbacd('0x4')],'allowNull':!![]},'regexten':{'type':Sequelize[_0xbacd('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0xbacd('0x4')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0xbacd('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize[_0xbacd('0x16')](_0xbacd('0x28'),'no'),'allowNull':!![],'defaultValue':_0xbacd('0x28')},'keepalive':{'type':Sequelize[_0xbacd('0x15')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0xbacd('0x4')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0xbacd('0x4')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0xbacd('0x15')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0xbacd('0x15')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0xbacd('0x16')](_0xbacd('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING'],'allowNull':!![]},'callbackextension':{'type':Sequelize['STRING'],'allowNull':!![]},'timert1':{'type':Sequelize[_0xbacd('0x15')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0xbacd('0x15')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0xbacd('0x4')],'allowNull':!![]},'contactdeny':{'type':Sequelize['STRING'],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0xbacd('0x4')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0xbacd('0x4')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0xbacd('0x15')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0xbacd('0x16')](_0xbacd('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0xbacd('0x16')](_0xbacd('0x28'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0xbacd('0x16')](_0xbacd('0x28'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0xbacd('0x16')]('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0xbacd('0x16')](_0xbacd('0x28'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0xbacd('0x16')]('yes','no',_0xbacd('0x3c'),_0xbacd('0x3d')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0xbacd('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0xbacd('0x4')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0xbacd('0x4')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0xbacd('0x4')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0xbacd('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0xbacd('0x16')](_0xbacd('0x3e'),_0xbacd('0x3f'),_0xbacd('0x40')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING'],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0xbacd('0x16')](_0xbacd('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xbacd('0x4')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0xbacd('0x4')],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0xbacd('0x16')](_0xbacd('0x28'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'vmexten':{'type':Sequelize['STRING'],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0xbacd('0x4')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0xbacd('0x4')],'allowNull':!![]},'parkinglot':{'type':Sequelize['STRING'],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0xbacd('0x16')](_0xbacd('0x28'),'no','nonat',_0xbacd('0x2a'),_0xbacd('0x41')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0xbacd('0x13')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0xbacd('0x4')]},'resetPasswordExpires':{'type':Sequelize[_0xbacd('0x14')]},'passwordResetAt':{'type':Sequelize['DATE'],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0xbacd('0x42')]},'showWebBar':{'type':Sequelize[_0xbacd('0x15')],'defaultValue':0x0,'set':function(_0x5a53b0){this['setDataValue']('showWebBar',_0x5a53b0);var _0x99e9d7=this[_0xbacd('0x43')]({'plain':!![]});switch(_0x5a53b0){case 0x0:case 0x1:var _0x3d8c0c=_0x99e9d7['transport']?_[_0xbacd('0x44')](_0x99e9d7[_0xbacd('0x22')])?_0x99e9d7[_0xbacd('0x22')][_0xbacd('0x21')]():_0x99e9d7[_0xbacd('0x22')]:_0xbacd('0x20');if(_0x3d8c0c==='wss'){_0x3d8c0c='udp';}this[_0xbacd('0x6')]('transport',_0x3d8c0c);this['setDataValue'](_0xbacd('0x45'),'no');this[_0xbacd('0x6')]('avpf',null);this[_0xbacd('0x6')](_0xbacd('0x46'),null);this[_0xbacd('0x6')](_0xbacd('0x47'),null);this[_0xbacd('0x6')](_0xbacd('0x48'),null);this['setDataValue'](_0xbacd('0x49'),null);this['setDataValue'](_0xbacd('0x4a'),null);this[_0xbacd('0x6')](_0xbacd('0x4b'),null);this[_0xbacd('0x6')](_0xbacd('0x4c'),null);this[_0xbacd('0x6')](_0xbacd('0x4d'),'no');break;case 0x2:this[_0xbacd('0x6')](_0xbacd('0x22'),_0xbacd('0x4e'));this[_0xbacd('0x6')]('encryption',_0xbacd('0x28'));this[_0xbacd('0x6')](_0xbacd('0x4f'),_0xbacd('0x28'));this[_0xbacd('0x6')](_0xbacd('0x46'),'yes');this[_0xbacd('0x6')](_0xbacd('0x47'),_0xbacd('0x28'));this[_0xbacd('0x6')]('dtlsenable',_0xbacd('0x28'));this[_0xbacd('0x6')](_0xbacd('0x49'),'no');this[_0xbacd('0x6')]('dtlssetup','actpass');this[_0xbacd('0x6')](_0xbacd('0x4b'),_0x99e9d7['dtlscertfile']||_0xbacd('0x50'));this[_0xbacd('0x6')](_0xbacd('0x4c'),_0x99e9d7[_0xbacd('0x4c')]||_0xbacd('0x51'));this[_0xbacd('0x6')](_0xbacd('0x4d'),_0xbacd('0x28'));break;default:}}},'permissions':{'type':Sequelize[_0xbacd('0x42')],'set':function(_0x49a7c1){this[_0xbacd('0x6')](_0xbacd('0x52'),_0x49a7c1?_0x49a7c1['join'](','):[]);},'get':function(){return this[_0xbacd('0xc')](_0xbacd('0x52'))?_['map'](this[_0xbacd('0xc')](_0xbacd('0x52'))['split'](','),function(_0x28418){return parseInt(_0x28418,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0xbacd('0x4')]},'phoneBarNoReplyNumber':{'type':Sequelize['STRING']},'phoneBarBusyNumber':{'type':Sequelize[_0xbacd('0x4')]},'phoneBarUnconditional':{'type':Sequelize[_0xbacd('0x13')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0xbacd('0x13')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0xbacd('0x13')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0xbacd('0x13')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0xbacd('0x13')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0xbacd('0x15')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0xbacd('0x4')],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0xbacd('0x16')](_0xbacd('0x28'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0xbacd('0x4')]},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0xbacd('0x13')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0xbacd('0x53')],'get':function(){return this['getDataValue'](_0xbacd('0x54'))?this['getDataValue'](_0xbacd('0x54')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0xbacd('0x13')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0xbacd('0x13')],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize[_0xbacd('0x4')],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0xbacd('0x4')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0xbacd('0x13')],'defaultValue':![],'set':function(_0x204015){if(typeof _0x204015==='string'){var _0x2a1f8c=_0x204015==='1'?!![]:_0x204015==='0'?![]:_0x204015==='true'?!![]:_0x204015===_0xbacd('0x55')?![]:![];this[_0xbacd('0x6')](_0xbacd('0x56'),_0x2a1f8c);}else{this[_0xbacd('0x6')](_0xbacd('0x56'),_0x204015);}}},'blocked':{'type':Sequelize[_0xbacd('0x13')],'defaultValue':![],'set':function(_0x5da9ac){this[_0xbacd('0x6')](_0xbacd('0x57'),_0x5da9ac);if(_0x5da9ac===!![]){this['setDataValue'](_0xbacd('0x58'),moment());this['setDataValue'](_0xbacd('0x59'),0x0);}else{this[_0xbacd('0x6')]('blockedAt',null);}}},'blockedAt':{'type':Sequelize[_0xbacd('0x14')],'defaultValue':null},'loginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disabled':{'type':Sequelize[_0xbacd('0x13')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0xbacd('0x13')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0xbacd('0x15')](0x5)[_0xbacd('0x5a')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0xbacd('0x13')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xbacd('0x13')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0xbacd('0x13')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0xbacd('0x13')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0xbacd('0x13')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0xbacd('0x13')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0xbacd('0x15')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0xbacd('0x13')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0xbacd('0x15')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0xbacd('0x13')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0xbacd('0x15')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0xbacd('0x13')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0xbacd('0x15')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0xbacd('0x13')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0xbacd('0x13')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0xbacd('0x15')],'defaultValue':0x0},'messengerSoundNotification':{'type':Sequelize[_0xbacd('0x13')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index 759974e..ffe5eb4 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 _0x659c=['slice','charAt','toUpperCase','select','field','ui.','InteractionId','ui.createdAt','user_has_','messengerSoundNotification','enabled','util','path','squel','ioredis','jayson/promise','../../components/parsers/qs','../../components/realtime/agents','api','../../config/license/util','../../errors/api','APIBadRequestError','APIForbiddenrror','handleError','../../mysqldb','socket.io-emitter','redis','register','defaults','client','http','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','then','info','User,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','update','role','agent','emit','userNotification:recalc:','destroy','get','admin','Users','user','Agents','Telephones','filter','ignore','map','value','find','UserProfileResource','stack','name','send','User','rawAttributes','type','password','salt','previousPasswords','resetPasswordExpires','md5secret','includes','index','getOptions','where','query','includeAll','include','true','UserSetting','userSetting','attributes','push','findAll','rows','openTabs','length','chat','dataValues','fax','mail','openchannel','whatsapp','all','show','params','merge','options','sms','body','describe','addContacts','omit','internal','Setting','findById','validatePasswordPattern','max','isNil','min_internal','sequelize','QueryTypes','SELECT','from','voicemail','mailbox','VoiceMail','email','permissions','101','102','103','113','110','104','105','106','107','100','114','115','create','Unauthorized','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','settingsEnabled','UserProfileSection','autoAssociation','bulkCreate','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','checkUserLimits','telephone','userProfileId','compact','newPassword','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','authenticate','Sequelize','Wrong\x20credentials','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','findOne','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordHistory','updatePasswordsHistory','addQueues','channel','online','voicePause','interface','isValidChannel','add','capitalize','toLowerCase','Queues','ids','penalty','spread','QueueId','Queue:save','VoiceQueue','voice','format','SIP/%s','UserVoiceQueueRt','Unknown\x20channel','remove','isArray','Queue:remove','addAvatar','userpic','filename','getAvatar','join','server/files/images/logos/default_profile.png','download','existsSync','root','server/files/images/','getOpenTabs','CHAT','createdAt','FaxOpenTabs','FAX','OpenchannelOpenTabs','OPENCHANNEL','SMS','WhatsappOpenTabs','WHATSAPP','concat','getContacts','User\x20with\x20id\x20%s\x20not\x20found','hasOwnProperty','CmList','List','Tags','color','tag','getQueues','model','keys','Queue','filters','intersection','fields','order','sort','pick','Unknown\x20role','getVoiceQueuesRt','nolimit','getGroups','ChatGroup','getRecordings','VoiceRecording','ScreenRecording','getChatInteractions','getOpenchannelInteractions','OpenchannelInteraction','MailInteraction','UserId','SmsInteraction','getSmsInteractions','getFaxInteractions','getWhatsappInteractions','WhatsappInteraction','login','phone','mobile','loginInPause','LOCAL/%s@from-sip/n','intrf','user:%s','user:forcelogout','x-forwarded-for','connection','remoteAddress','socket','getVoiceQueues','UserVoiceQueue.penalty','MemberReport','forEach','YYYY-MM-DD\x20HH:mm:ss','getChannels','LOGIN','device','LOGININPAUSE','isMiddleware','resolve','pause','QueuePause','PAUSE','DEFAULT\x20PAUSE','Channel\x20parameter\x20%s\x20is\x20invalid','mailPause','faxPause','openchannelPause','smsPause','whatsappPause','unpause','getTeams','Team','addTeams','Body\x20parameter\x20\x27ids\x27\x20is\x20required','getAssociatedQueues','flattenDeep','addAgent','Voice','upsert','TeamVoicePrefix','VoicePrefixId','getDataValue','transaction','removeTeams','removeAgent','getLists','getAgents','values','CmHopper','addChatInteractions','user_has_chat_interactions:save','removeChatInteractions','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','user_has_sms_interactions:save','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','getVoicePrefixes','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','addSmsAccounts','removeSmsAccounts','getChatWebsites','addChatWebsites','getWhatsappAccounts','addWhatsappAccounts','removeWhatsappAccounts','$and','$or','$gt','$gte','$lt','$lte','$eq','$not','$in','$notIn','$like','$notLike','$contains','$contained','$any','lastName','CmContact','Contact','dialActive','getApiKey','retrieveApiKey','token','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','iat','nonce','removeApiKey','apiKeyNonce','apiKeyIat','whoami','Unable\x20to\x20retrieve\x20the\x20current\x20user','getPresence','idle','unknown','teams','queues','inbound','flatten','lower','asc','desc','uniqBy','orderBy','getRealtimeAgents','offline','voiceStatus','unavailable','busy'];(function(_0x3708b8,_0xe389e0){var _0x4064f3=function(_0x4c5117){while(--_0x4c5117){_0x3708b8['push'](_0x3708b8['shift']());}};_0x4064f3(++_0xe389e0);}(_0x659c,0x192));var _0xc659=function(_0xb66f92,_0x301f99){_0xb66f92=_0xb66f92-0x0;var _0x344d2d=_0x659c[_0xb66f92];return _0x344d2d;};'use strict';var moment=require('moment');var util=require(_0xc659('0x0'));var path=require(_0xc659('0x1'));var fs=require('fs');var _=require('lodash');var squel=require(_0xc659('0x2'));var Redis=require(_0xc659('0x3'));var jayson=require(_0xc659('0x4'));var authService=require('../../components/auth/service');var contacts=require('../../components/contacts');var qs=require(_0xc659('0x5'));var rta=require(_0xc659('0x6'));var logger=require('../../config/logger')(_0xc659('0x7'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc659('0x8'));var APIBadRequestError=require(_0xc659('0x9'))[_0xc659('0xa')];var APINotFoundError=require(_0xc659('0x9'))['APINotFoundError'];var APIForbiddenError=require('../../errors/api')[_0xc659('0xb')];var APIHandleError=require('../../errors/api')[_0xc659('0xc')];var db=require(_0xc659('0xd'))['db'];var socket=require(_0xc659('0xe'))(new Redis(config[_0xc659('0xf')]));require('./user.socket')[_0xc659('0x10')](socket);config[_0xc659('0xf')]=_[_0xc659('0x11')](config[_0xc659('0xf')],{'host':'localhost','port':0x18eb});var amiClient=jayson[_0xc659('0x12')][_0xc659('0x13')]({'port':0x232a});var values;function respondWithStatusCode(_0x20c531,_0x109048){_0x109048=_0x109048||0xcc;return function(_0x256868){if(_0x256868){return _0x20c531[_0xc659('0x14')](_0x109048);}return _0x20c531[_0xc659('0x15')](_0x109048)[_0xc659('0x16')]();};}function respondWithResult(_0x50f4f7,_0x1c0233){_0x1c0233=_0x1c0233||0xc8;return function(_0x5f3592){if(_0x5f3592){return _0x50f4f7[_0xc659('0x15')](_0x1c0233)[_0xc659('0x17')](_0x5f3592);}};}function respondWithFilteredResult(_0xf10f9f,_0x3fc010){return function(_0x4a0867){if(_0x4a0867){var _0x5472d0=typeof _0x3fc010[_0xc659('0x18')]===_0xc659('0x19')&&typeof _0x3fc010[_0xc659('0x1a')]===_0xc659('0x19');var _0x324835=_0x4a0867[_0xc659('0x1b')];var _0x225c1b=_0x5472d0?0x0:_0x3fc010['offset'];var _0xfdcce6=_0x5472d0?_0x4a0867[_0xc659('0x1b')]:_0x3fc010[_0xc659('0x18')]+_0x3fc010['limit'];var _0x36ce38;if(_0xfdcce6>=_0x324835){_0xfdcce6=_0x324835;_0x36ce38=0xc8;}else{_0x36ce38=0xce;}_0xf10f9f[_0xc659('0x15')](_0x36ce38);return _0xf10f9f[_0xc659('0x1c')](_0xc659('0x1d'),_0x225c1b+'-'+_0xfdcce6+'/'+_0x324835)[_0xc659('0x17')](_0x4a0867);}return null;};}function respondWithRpcPromise(_0x417b97,_0x4510bf,_0x2177d2,_0x1dd841){return new Promise(function(_0x2b8658,_0x45a9aa){var _0x1b99c5=_0x1dd841||amiClient;return _0x1b99c5['request'](_0x417b97,_0x2177d2)[_0xc659('0x1e')](function(_0x22ef9b){logger[_0xc659('0x1f')](_0xc659('0x20'),_0x4510bf,_0xc659('0x21'));logger['debug']('User,\x20%s,\x20%s,\x20%s',_0x4510bf,_0xc659('0x21'),JSON[_0xc659('0x22')](_0x22ef9b));if(_0x22ef9b['error']){if(_0x22ef9b[_0xc659('0x23')][_0xc659('0x24')]===0x1f4){logger[_0xc659('0x23')](_0xc659('0x20'),_0x4510bf,_0x22ef9b[_0xc659('0x23')][_0xc659('0x25')]);return _0x45a9aa(_0x22ef9b['error'][_0xc659('0x25')]);}logger['error']('User,\x20%s,\x20%s',_0x4510bf,_0x22ef9b['error'][_0xc659('0x25')]);return _0x2b8658(_0x22ef9b[_0xc659('0x23')]['message']);}else{logger[_0xc659('0x1f')](_0xc659('0x20'),_0x4510bf,_0xc659('0x21'));_0x2b8658(_0x22ef9b[_0xc659('0x26')][_0xc659('0x25')]);}})[_0xc659('0x27')](function(_0x160582){logger[_0xc659('0x23')](_0xc659('0x20'),_0x4510bf,_0x160582);_0x45a9aa(_0x160582);});});}function saveUpdates(_0x257ae9){return function(_0x5d0f70){if(_0x5d0f70){return _0x5d0f70[_0xc659('0x28')](_0x257ae9)[_0xc659('0x1e')](function(_0x23d4ed){if(_0x23d4ed[_0xc659('0x29')]===_0xc659('0x2a')){socket[_0xc659('0x2b')](_0xc659('0x2c')+_0x23d4ed['id'],_0x23d4ed);}return _0x23d4ed;});}return null;};}function removeEntity(_0x5668f8,_0x168bd5){return function(_0x3bddd0){if(_0x3bddd0){return _0x3bddd0[_0xc659('0x2d')]({'transaction':_0x168bd5})[_0xc659('0x1e')](function(){var _0x10b58d=_0x3bddd0[_0xc659('0x2e')]({'plain':!![]});if(_0x10b58d[_0xc659('0x29')]===_0xc659('0x2f'))return;var _0x1e862b=[{'name':_0xc659('0x30'),'value':_0xc659('0x31'),'ignore':!![]},{'name':_0xc659('0x32'),'value':'agent','ignore':![]},{'name':_0xc659('0x33'),'value':'telephone','ignore':![]}];var _0x5f2fd7=_(_0x1e862b)[_0xc659('0x34')](_0xc659('0x35'))[_0xc659('0x36')](_0xc659('0x37'))[_0xc659('0x37')]();if(_['includes'](_0x5f2fd7,_0x10b58d[_0xc659('0x29')])){return;}var _0x5158fa=_[_0xc659('0x38')](_0x1e862b,[_0xc659('0x37'),_0x10b58d[_0xc659('0x29')]])['name'];return db[_0xc659('0x39')][_0xc659('0x2d')]({'where':{'type':_0x5158fa,'resourceId':_0x10b58d['id']},'transaction':_0x168bd5})[_0xc659('0x1e')](function(){return _0x3bddd0;});})[_0xc659('0x1e')](function(){_0x5668f8[_0xc659('0x15')](0xcc)[_0xc659('0x16')]();});}};}function handleEntityNotFound(_0x49845b){return function(_0x1fe263){if(!_0x1fe263){_0x49845b[_0xc659('0x14')](0x194);}return _0x1fe263;};}function handleError(_0x20aaf4,_0x4f5d1e){_0x4f5d1e=_0x4f5d1e||0x1f4;return function(_0x5c5db3){logger['error'](_0x5c5db3[_0xc659('0x3a')]);if(_0x5c5db3[_0xc659('0x3b')]){delete _0x5c5db3[_0xc659('0x3b')];}_0x20aaf4['status'](_0x4f5d1e)[_0xc659('0x3c')](_0x5c5db3);};}function getUserAttributes(){return _(db[_0xc659('0x3d')][_0xc659('0x3e')])['map'](function(_0x143e5d){return{'name':_0x143e5d['fieldName'],'type':_0x143e5d[_0xc659('0x3f')]['key']};})['filter'](function(_0x20efb7){return![_0xc659('0x40'),_0xc659('0x41'),_0xc659('0x42'),'resetPasswordToken',_0xc659('0x43'),_0xc659('0x44')][_0xc659('0x45')](_0x20efb7[_0xc659('0x3b')]);})[_0xc659('0x37')]();}exports[_0xc659('0x46')]=function(_0x1d94bb,_0x1087b2){var _0x36f21c={},_0x50c6fe={'count':0x0,'rows':[]};var _0x32ff6b=getUserAttributes();_0x36f21c=qs[_0xc659('0x47')](_0x32ff6b,_0x1d94bb);var _0x1936e0={'where':_0x36f21c[_0xc659('0x48')]};return db[_0xc659('0x3d')][_0xc659('0x1b')](_0x1936e0)[_0xc659('0x1e')](function(_0x2fee80){_0x50c6fe[_0xc659('0x1b')]=_0x2fee80;if(_0x1d94bb[_0xc659('0x49')][_0xc659('0x4a')]){_0x36f21c[_0xc659('0x4b')]=[{'all':!![]}];}if(_0x1d94bb[_0xc659('0x49')]['userSetting']===_0xc659('0x4c')){_0x36f21c[_0xc659('0x4b')]=[{'model':db[_0xc659('0x4d')],'as':_0xc659('0x4e')}];}if(!_[_0xc659('0x45')](_0x36f21c[_0xc659('0x4f')],'id')){_0x36f21c[_0xc659('0x4f')][_0xc659('0x50')]('id');}return db['User'][_0xc659('0x51')](_0x36f21c);})['then'](function(_0x3c9860){_0x50c6fe[_0xc659('0x52')]=_0x3c9860;if(_0x1d94bb[_0xc659('0x49')][_0xc659('0x53')]===_0xc659('0x4c')){var _0x4baa7f=[];for(var _0x3c7bb6=0x0;_0x3c7bb6<_0x50c6fe[_0xc659('0x52')][_0xc659('0x54')];_0x3c7bb6++){_0x4baa7f[_0xc659('0x50')](get_open_tabs(_0xc659('0x55'),_0x50c6fe[_0xc659('0x52')][_0x3c7bb6][_0xc659('0x56')]));_0x4baa7f[_0xc659('0x50')](get_open_tabs('sms',_0x50c6fe['rows'][_0x3c7bb6]['dataValues']));_0x4baa7f['push'](get_open_tabs(_0xc659('0x57'),_0x50c6fe[_0xc659('0x52')][_0x3c7bb6][_0xc659('0x56')]));_0x4baa7f[_0xc659('0x50')](get_open_tabs(_0xc659('0x58'),_0x50c6fe[_0xc659('0x52')][_0x3c7bb6][_0xc659('0x56')]));_0x4baa7f[_0xc659('0x50')](get_open_tabs(_0xc659('0x59'),_0x50c6fe[_0xc659('0x52')][_0x3c7bb6]['dataValues']));_0x4baa7f['push'](get_open_tabs(_0xc659('0x5a'),_0x50c6fe[_0xc659('0x52')][_0x3c7bb6][_0xc659('0x56')]));}return Promise[_0xc659('0x5b')](_0x4baa7f)[_0xc659('0x1e')](function(){return _0x50c6fe;});}else{return _0x50c6fe;}})['then'](respondWithFilteredResult(_0x1087b2,_0x36f21c))[_0xc659('0x27')](handleError(_0x1087b2,null));};exports[_0xc659('0x5c')]=function(_0x26bd9c,_0x1c10e8){var _0x11bf13=getUserAttributes();_0x26bd9c[_0xc659('0x49')]['id']=_0x26bd9c[_0xc659('0x5d')]['id'];var _0x8b7899=qs['getOptions'](_0x11bf13,_0x26bd9c);if(_0x26bd9c['query'][_0xc659('0x4a')]){_0x8b7899[_0xc659('0x4b')]=[{'all':!![]}];}if(_0x26bd9c['query'][_0xc659('0x4e')]===_0xc659('0x4c')){_0x8b7899['include']=[{'model':db[_0xc659('0x4d')],'as':_0xc659('0x4e')}];}_0x8b7899=_[_0xc659('0x5e')]({},_0x8b7899,_0x26bd9c[_0xc659('0x5f')]);if(!_[_0xc659('0x45')](_0x8b7899[_0xc659('0x4f')],'id')){_0x8b7899[_0xc659('0x4f')][_0xc659('0x50')]('id');}return db[_0xc659('0x3d')]['find'](_0x8b7899)[_0xc659('0x1e')](handleEntityNotFound(_0x1c10e8,null))[_0xc659('0x1e')](function(_0x273f4f){var _0x5cd3f1=[];values=_0x273f4f;if(_0x26bd9c[_0xc659('0x49')][_0xc659('0x53')]==='true'){_0x5cd3f1[_0xc659('0x50')](get_open_tabs('chat',_0x273f4f['dataValues']));_0x5cd3f1['push'](get_open_tabs(_0xc659('0x60'),_0x273f4f[_0xc659('0x56')]));_0x5cd3f1[_0xc659('0x50')](get_open_tabs(_0xc659('0x59'),_0x273f4f[_0xc659('0x56')]));_0x5cd3f1[_0xc659('0x50')](get_open_tabs(_0xc659('0x5a'),_0x273f4f[_0xc659('0x56')]));_0x5cd3f1['push'](get_open_tabs(_0xc659('0x57'),_0x273f4f[_0xc659('0x56')]));_0x5cd3f1[_0xc659('0x50')](get_open_tabs(_0xc659('0x58'),_0x273f4f[_0xc659('0x56')]));return Promise['all'](_0x5cd3f1);}else{return values;}})[_0xc659('0x1e')](function(){return values;})[_0xc659('0x1e')](respondWithResult(_0x1c10e8,null))[_0xc659('0x27')](handleError(_0x1c10e8,null));};exports[_0xc659('0x28')]=function(_0x383b97,_0x25af27){if(_0x383b97[_0xc659('0x61')]['id']){delete _0x383b97['body']['id'];}delete _0x383b97['body'][_0xc659('0x29')];return db[_0xc659('0x3d')][_0xc659('0x38')]({'where':{'id':_0x383b97[_0xc659('0x5d')]['id']}})[_0xc659('0x1e')](handleEntityNotFound(_0x25af27,null))[_0xc659('0x1e')](saveUpdates(_0x383b97[_0xc659('0x61')],null))[_0xc659('0x1e')](respondWithResult(_0x25af27,null))['catch'](handleError(_0x25af27,null));};exports[_0xc659('0x62')]=function(_0x5e89ff,_0x5a2260){return db[_0xc659('0x3d')][_0xc659('0x62')]()[_0xc659('0x1e')](respondWithResult(_0x5a2260,null))['catch'](handleError(_0x5a2260,null));};exports[_0xc659('0x63')]=function(_0x1ca79d,_0x2df924){return db['User'][_0xc659('0x38')]({'where':{'id':_0x1ca79d[_0xc659('0x5d')]['id']}})[_0xc659('0x1e')](handleEntityNotFound(_0x2df924,null))[_0xc659('0x1e')](function(_0x5c49e0){if(_0x5c49e0){return _0x5c49e0[_0xc659('0x63')](_0x1ca79d[_0xc659('0x61')]['ids'],_[_0xc659('0x64')](_0x1ca79d[_0xc659('0x61')],['ids','id'])||{});}})[_0xc659('0x1e')](respondWithResult(_0x2df924,null))[_0xc659('0x27')](handleError(_0x2df924,null));};function validateUser(_0x513527){return new Promise(function(_0x1ef0c5,_0x1f169e){if(_0x513527[_0xc659('0x65')])return _0x1ef0c5(_0x513527);return db[_0xc659('0x66')][_0xc659('0x67')](0x1)[_0xc659('0x1e')](function(_0x4b4b78){if(_0x4b4b78['securePassword'])authService[_0xc659('0x68')](_0x513527['password']);db[_0xc659('0x3d')][_0xc659('0x69')](_0xc659('0x65'))['then'](function(_0xe29d22){if(_[_0xc659('0x6a')](_0xe29d22)){_0x513527['internal']=_0x4b4b78[_0xc659('0x6b')]||0x1;return;}if(_[_0xc659('0x6a')](_0x4b4b78[_0xc659('0x6b')])||_0x4b4b78['min_internal']===_0xe29d22){_0x513527[_0xc659('0x65')]=_0xe29d22+0x1;return;}if(_0x4b4b78[_0xc659('0x6b')]>_0xe29d22){_0x513527[_0xc659('0x65')]=_0x4b4b78['min_internal'];return;}return db[_0xc659('0x6c')]['query']('select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)',{'type':db[_0xc659('0x6c')][_0xc659('0x6d')][_0xc659('0x6e')]})['then'](function(_0x493542){if(_0x493542&&_0x493542['length']){for(var _0x345ec6=0x0,_0x567c3a=_0x493542[_0xc659('0x54')];_0x345ec6<_0x567c3a&&_[_0xc659('0x6a')](_0x513527[_0xc659('0x65')]);_0x345ec6++){if(_0x4b4b78['min_internal']<=_0x493542[_0x345ec6][_0xc659('0x6f')]){_0x513527[_0xc659('0x65')]=_0x493542[_0x345ec6][_0xc659('0x6f')];}else if(_0x4b4b78['min_internal']>_0x493542[_0x345ec6]['from']&&_0x4b4b78['min_internal']<=_0x493542[_0x345ec6]['to']){_0x513527['internal']=_0x4b4b78[_0xc659('0x6b')];}}}if(_['isNil'](_0x513527['internal'])){_0x513527[_0xc659('0x65')]=_0xe29d22+0x1;}return _0x1ef0c5(_0x513527);});});})[_0xc659('0x27')](function(_0x49233f){_0x1f169e(_0x49233f);});});}function updateUser(_0x12602d){return new Promise(function(_0x4c1fff,_0x135281){try{if(_0x12602d[_0xc659('0x70')]){_0x12602d[_0xc659('0x71')]=_0x12602d[_0xc659('0x65')];_0x12602d[_0xc659('0x72')]={'mailbox':_0x12602d[_0xc659('0x65')],'password':_0x12602d[_0xc659('0x40')],'fullname':_0x12602d['fullname'],'email':_0x12602d[_0xc659('0x73')]};}if(_0x12602d[_0xc659('0x29')]===_0xc659('0x2a')){if(!_0x12602d['permissions'])_0x12602d[_0xc659('0x74')]=[_0xc659('0x75'),_0xc659('0x76'),_0xc659('0x77'),_0xc659('0x78'),_0xc659('0x79'),_0xc659('0x7a'),_0xc659('0x7b'),_0xc659('0x7c'),_0xc659('0x7d'),'108','109',_0xc659('0x7e'),'111',_0xc659('0x7f'),_0xc659('0x80')];}_0x4c1fff(_0x12602d);}catch(_0x22dff2){_0x135281(_0x22dff2);}});}exports[_0xc659('0x81')]=function(_0x43ceec,_0x238389){if(_0x43ceec[_0xc659('0x31')]['role']===_0xc659('0x2a'))throw new Error(_0xc659('0x82'));if(_0x43ceec['body'][_0xc659('0x29')]===_0xc659('0x31')&&_0x43ceec[_0xc659('0x31')][_0xc659('0x29')]!==_0xc659('0x2f')){throw new Error(_0xc659('0x83'));}if(_0x43ceec[_0xc659('0x61')][_0xc659('0x29')]===_0xc659('0x2f')&&_0x43ceec[_0xc659('0x31')][_0xc659('0x29')]!==_0xc659('0x2f')){throw new Error(_0xc659('0x84'));}return licenseUtil['checkUserLimits']([_0x43ceec[_0xc659('0x61')]])[_0xc659('0x1e')](function(){return validateUser(_0x43ceec[_0xc659('0x61')]);})[_0xc659('0x1e')](function(_0x30d36e){return updateUser(_0x30d36e)['then'](function(_0x1b5257){if(_0x1b5257['role']===_0xc659('0x2f')){_0x1b5257['settingsEnabled']=_0x43ceec[_0xc659('0x31')][_0xc659('0x85')];delete _0x1b5257['userProfileId'];}return _0x1b5257;});})[_0xc659('0x1e')](function(_0x72d223){return db['User'][_0xc659('0x81')](_0x72d223,{'include':[{'model':db[_0xc659('0x72')],'as':_0xc659('0x72')}]});})[_0xc659('0x1e')](function(_0x3801b4){if(_0x43ceec['body'][_0xc659('0x29')]===_0xc659('0x31'))return _0x3801b4;if(_0x43ceec[_0xc659('0x31')][_0xc659('0x29')]!==_0xc659('0x31'))return _0x3801b4;return db[_0xc659('0x86')]['find']({'where':{'name':_0x3801b4[_0xc659('0x29')]===_0xc659('0x2a')?_0xc659('0x32'):_0xc659('0x33'),'userProfileId':_0x43ceec['user']['userProfileId']},'raw':!![]})[_0xc659('0x1e')](function(_0x1284eb){if(!_0x1284eb||_0x1284eb[_0xc659('0x87')]!=0x0)return _0x3801b4;return db[_0xc659('0x39')][_0xc659('0x81')]({'name':_0x3801b4[_0xc659('0x3b')],'resourceId':_0x3801b4['id'],'type':_0x1284eb[_0xc659('0x3b')],'sectionId':_0x1284eb['id']},{})[_0xc659('0x1e')](function(){return _0x3801b4;});})['catch'](function(_0x333d38){logger[_0xc659('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x333d38);throw _0x333d38;});})[_0xc659('0x1e')](respondWithResult(_0x238389,0xc9))['catch'](handleError(_0x238389,null));};exports[_0xc659('0x88')]=function(_0x5f3565,_0x2c3ec2){var _0x4cd123=_0x5f3565[_0xc659('0x61')];var _0x31b3ae=[];if(_0x5f3565[_0xc659('0x31')][_0xc659('0x29')]===_0xc659('0x2a'))throw new Error('Unauthorized');if(_[_0xc659('0x89')](_0x4cd123,[_0xc659('0x29'),_0xc659('0x31')])&&_0x5f3565['user'][_0xc659('0x29')]!==_0xc659('0x2f')){throw new Error(_0xc659('0x83'));}if(_['some'](_0x4cd123,[_0xc659('0x29'),'admin'])&&_0x5f3565[_0xc659('0x31')][_0xc659('0x29')]!==_0xc659('0x2f')){throw new Error(_0xc659('0x8a'));}return licenseUtil[_0xc659('0x8b')](_0x4cd123)[_0xc659('0x1e')](function(){return validateUser(_0x4cd123[0x0]);})['then'](function(){for(var _0x1051fa=0x1;_0x1051fa<_0x4cd123[_0xc659('0x54')];_0x1051fa++){var _0x542d15=_0x4cd123[_0x1051fa-0x1][_0xc659('0x65')];if(!_0x4cd123[_0x1051fa][_0xc659('0x65')])_0x4cd123[_0x1051fa][_0xc659('0x65')]=_0x542d15+0x1;_0x31b3ae['push'](validateUser(_0x4cd123[_0x1051fa]));}return Promise[_0xc659('0x5b')](_0x31b3ae);})[_0xc659('0x1e')](function(){_0x31b3ae=[];for(var _0x6e0c3b=0x0;_0x6e0c3b<_0x4cd123['length'];_0x6e0c3b++){_0x31b3ae[_0xc659('0x50')](updateUser(_0x4cd123[_0x6e0c3b]));}return Promise[_0xc659('0x5b')](_0x31b3ae);})[_0xc659('0x1e')](function(){_0x31b3ae=_0x4cd123[_0xc659('0x36')](function(_0x5d65f2){return db[_0xc659('0x3d')][_0xc659('0x81')](_0x5d65f2,{'include':[{'model':db[_0xc659('0x72')],'as':_0xc659('0x72')}]})['then'](function(_0x3efbed){_0x5d65f2['id']=_0x3efbed['id'];return _0x5d65f2;});});return Promise['all'](_0x31b3ae);})[_0xc659('0x1e')](function(_0x5e7729){if(_0x5f3565[_0xc659('0x61')][_0xc659('0x29')]===_0xc659('0x31'))return _0x5e7729;if(_0x5f3565['user'][_0xc659('0x29')]!==_0xc659('0x31'))return _0x5e7729;var _0x1a8e7c=_[_0xc659('0x89')](_0x5e7729,function(_0x64ed4){return _0x64ed4[_0xc659('0x29')]===_0xc659('0x2a')||_0x64ed4['role']===_0xc659('0x8c');});if(!_0x1a8e7c)return _0x5e7729;return db[_0xc659('0x86')][_0xc659('0x51')]({'where':{'name':{'$or':[_0xc659('0x32'),'Telephones']},'userProfileId':_0x5f3565['user'][_0xc659('0x8d')]},'raw':!![]})['then'](function(_0x5a5630){if(_['isEmpty'](_0x5a5630)||!_['some'](_0x5a5630,[_0xc659('0x87'),0x0]))return _0x5e7729;_0x31b3ae=[];var _0x3097fe=_(_0x5a5630)[_0xc659('0x36')](function(_0x3bd53b){if(_0x3bd53b[_0xc659('0x87')]===0x1)return;return _0x3bd53b[_0xc659('0x3b')]===_0xc659('0x32')?_0xc659('0x2a'):'telephone';})[_0xc659('0x8e')]()[_0xc659('0x37')]();for(var _0x5a88ed=0x0;_0x5a88ed<_0x5e7729['length'];_0x5a88ed++){if(!_[_0xc659('0x45')](_0x3097fe,_0x5e7729[_0x5a88ed][_0xc659('0x29')]))return;var _0x4c7534=_0x5e7729[_0x5a88ed][_0xc659('0x29')]==='agent'?_0xc659('0x32'):_0xc659('0x33');_0x31b3ae[_0xc659('0x50')](db['UserProfileResource']['create']({'name':_0x5e7729[_0x5a88ed][_0xc659('0x3b')],'resourceId':_0x5e7729[_0x5a88ed]['id'],'type':_0x4c7534,'sectionId':_[_0xc659('0x38')](_0x5a5630,[_0xc659('0x3b'),_0x4c7534])['id']},{}));}return Promise[_0xc659('0x5b')](_0x31b3ae);});})[_0xc659('0x1e')](respondWithResult(_0x2c3ec2,0xc9))[_0xc659('0x27')](handleError(_0x2c3ec2,null));};exports['changePassword']=function(_0x5491ce,_0x5a81ef){if(_0x5491ce[_0xc659('0x61')]['id']){delete _0x5491ce[_0xc659('0x61')]['id'];}return db[_0xc659('0x3d')][_0xc659('0x38')]({'where':{'id':_0x5491ce['params']['id']}})[_0xc659('0x1e')](function(_0xfa0dec){if(!_0xfa0dec)return null;if(_0xfa0dec['id']===_0x5491ce[_0xc659('0x31')]['id']){if(!_0x5491ce[_0xc659('0x61')]['oldPassword']||!_0x5491ce[_0xc659('0x61')][_0xc659('0x8f')]){throw new db['Sequelize'][(_0xc659('0x90'))](_0xc659('0x91'));}if(!_0xfa0dec[_0xc659('0x92')](_0x5491ce[_0xc659('0x61')]['oldPassword'])){throw new db[(_0xc659('0x93'))][(_0xc659('0x90'))](_0xc659('0x94'));}if(_0x5491ce['body']['oldPassword']===_0x5491ce[_0xc659('0x61')][_0xc659('0x8f')]){throw new db[(_0xc659('0x93'))]['ValidationError'](_0xc659('0x95'));}}else if(_0x5491ce[_0xc659('0x31')][_0xc659('0x29')]===_0xc659('0x2f')){if(!_0x5491ce[_0xc659('0x61')]['newPassword']){throw new db[(_0xc659('0x93'))][(_0xc659('0x90'))](_0xc659('0x96'));}}else if(_0x5491ce['user']['role']===_0xc659('0x31')){if(!_0x5491ce[_0xc659('0x61')]['newPassword']){throw new db[(_0xc659('0x93'))]['ValidationError'](_0xc659('0x96'));}if(_0xfa0dec[_0xc659('0x29')]!==_0xc659('0x2a')){throw new db['Sequelize']['ValidationError']('Unauthorized');}}else{throw new db[(_0xc659('0x93'))]['ValidationError'](_0xc659('0x82'));}return _0xfa0dec;})[_0xc659('0x1e')](handleEntityNotFound(_0x5a81ef,null))['then'](function(_0x532c78){return db['Setting'][_0xc659('0x97')]({'attributes':['id',_0xc659('0x98'),_0xc659('0x99'),_0xc659('0x9a')]})['then'](function(_0x117799){if(_0x117799[_0xc659('0x98')])authService['validatePasswordPattern'](_0x5491ce[_0xc659('0x61')][_0xc659('0x8f')]);if(!_0x117799[_0xc659('0x99')]||!_0x532c78[_0xc659('0x42')])return _0x532c78;authService[_0xc659('0x9b')](_0x5491ce['body'][_0xc659('0x8f')],_0x532c78['previousPasswords'],_0x117799[_0xc659('0x9a')]);return _0x532c78;})[_0xc659('0x1e')](saveUpdates({'password':_0x5491ce[_0xc659('0x61')][_0xc659('0x8f')],'passwordResetAt':_0x5491ce['user']['id']==_0x5491ce['params']['id']?moment():null,'previousPasswords':authService[_0xc659('0x9c')](_0x5491ce[_0xc659('0x61')]['newPassword'],_0x532c78[_0xc659('0x42')])},null));})[_0xc659('0x1e')](respondWithResult(_0x5a81ef,null))[_0xc659('0x27')](handleError(_0x5a81ef,null));};exports[_0xc659('0x9d')]=function(_0x43d816,_0x1f8460){var _0x5d2687=_0x43d816[_0xc659('0x61')][_0xc659('0x9e')];return db[_0xc659('0x3d')][_0xc659('0x38')]({'where':{'id':_0x43d816[_0xc659('0x5d')]['id']},'attributes':['id',_0xc659('0x3b'),_0xc659('0x29'),_0xc659('0x9f'),'loginInPause',_0xc659('0xa0'),_0xc659('0xa1')]})[_0xc659('0x1e')](handleEntityNotFound(_0x1f8460,null))[_0xc659('0x1e')](function(_0x283f96){if(_0x283f96){if(!utils[_0xc659('0xa2')](_0x5d2687)){throw new db[(_0xc659('0x93'))]['ValidationError']('Unknown\x20channel');}return _0x283f96[_0xc659('0xa3')+_[_0xc659('0xa4')](_0x5d2687[_0xc659('0xa5')]())+_0xc659('0xa6')](_0x43d816[_0xc659('0x61')][_0xc659('0xa7')],{'penalty':_0x43d816[_0xc659('0x61')][_0xc659('0xa8')]||0x0})[_0xc659('0xa9')](function(_0x1b36d2){for(var _0x21511b=0x0;_0x21511b<_0x43d816[_0xc659('0x61')][_0xc659('0xa7')][_0xc659('0x54')];_0x21511b+=0x1){var _0x13cd74={'UserId':Number(_0x43d816[_0xc659('0x5d')]['id'])};_0x13cd74[_[_0xc659('0xa4')](_0x5d2687[_0xc659('0xa5')]())+_0xc659('0xaa')]=Number(_0x43d816[_0xc659('0x61')][_0xc659('0xa7')][_0x21511b]);socket[_0xc659('0x2b')](_0xc659('0x31')+_[_0xc659('0xa4')](_0x5d2687[_0xc659('0xa5')]())+_0xc659('0xab'),_0x13cd74);}return _0x1b36d2;})['then'](function(){if(_0x5d2687==='voice'){return db[_0xc659('0xac')][_0xc659('0x51')]({'where':{'id':_0x43d816['body'][_0xc659('0xa7')]||[]},'raw':!![],'attributes':['id',_0xc659('0x3b')]});}})[_0xc659('0x1e')](function(_0x34f56e){var _0xd56569=_0x283f96[_0xc659('0x2e')]({'plain':!![]});var _0x5e4991=[];if(_0x5d2687===_0xc659('0xad')&&_0xd56569[_0xc659('0x29')]===_0xc659('0x2a')&&_0xd56569['online']){for(let _0x4a65f5=0x0;_0x4a65f5<_0x34f56e[_0xc659('0x54')];_0x4a65f5+=0x1){_0x5e4991[_0xc659('0x50')]({'membername':_0xd56569['name'],'UserId':_0xd56569['id'],'queue_name':_0x34f56e[_0x4a65f5][_0xc659('0x3b')],'VoiceQueueId':_0x34f56e[_0x4a65f5]['id'],'interface':_[_0xc659('0x6a')](_0xd56569[_0xc659('0xa1')])?util[_0xc659('0xae')](_0xc659('0xaf'),_0xd56569[_0xc659('0x3b')]):_0xd56569['interface'],'paused':_0xd56569[_0xc659('0xa0')]||![],'penalty':_0x43d816[_0xc659('0x61')][_0xc659('0xa8')]||0x0});}return Promise['all'](_0x5e4991[_0xc659('0x36')](function(_0x16eac3){return db[_0xc659('0xb0')]['upsert'](_0x16eac3);}));}return _0x283f96;});}})['then'](respondWithStatusCode(_0x1f8460,null))[_0xc659('0x27')](handleError(_0x1f8460,null));};exports['removeQueues']=function(_0x14fb38,_0x4c1128){var _0x281336,_0x263004;return db['User']['find']({'where':{'id':_0x14fb38[_0xc659('0x5d')]['id']},'attributes':['id',_0xc659('0x3b'),_0xc659('0x29')]})[_0xc659('0x1e')](handleEntityNotFound(_0x4c1128,null))[_0xc659('0x1e')](function(_0x67c386){if(_0x67c386){_0x281336=_0x67c386;if(!_0x14fb38[_0xc659('0x49')][_0xc659('0x9e')]||!utils[_0xc659('0xa2')](_0x14fb38[_0xc659('0x49')]['channel'])){throw new db['Sequelize'][(_0xc659('0x90'))](_0xc659('0xb1'));}return _0x67c386[_0xc659('0xb2')+_[_0xc659('0xa4')](_0x14fb38[_0xc659('0x49')][_0xc659('0x9e')]['toLowerCase']())+'Queues'](_0x14fb38[_0xc659('0x49')][_0xc659('0xa7')]);}})[_0xc659('0x1e')](function(_0x105ca2){if(_[_0xc659('0xb3')](_0x14fb38[_0xc659('0x49')]['ids'])){for(var _0x1d5c18=0x0;_0x1d5c18<_0x14fb38[_0xc659('0x49')][_0xc659('0xa7')][_0xc659('0x54')];_0x1d5c18+=0x1){_0x263004={'UserId':Number(_0x14fb38[_0xc659('0x5d')]['id'])};_0x263004[_['capitalize'](_0x14fb38[_0xc659('0x49')][_0xc659('0x9e')][_0xc659('0xa5')]())+'QueueId']=Number(_0x14fb38['query']['ids'][_0x1d5c18]);socket['emit'](_0xc659('0x31')+_['capitalize'](_0x14fb38[_0xc659('0x49')]['channel'][_0xc659('0xa5')]())+_0xc659('0xb4'),_0x263004);}}else{_0x263004={'UserId':Number(_0x14fb38[_0xc659('0x5d')]['id'])};_0x263004[_['capitalize'](_0x14fb38[_0xc659('0x49')][_0xc659('0x9e')][_0xc659('0xa5')]())+_0xc659('0xaa')]=Number(_0x14fb38[_0xc659('0x49')]['ids']);socket[_0xc659('0x2b')](_0xc659('0x31')+_['capitalize'](_0x14fb38[_0xc659('0x49')][_0xc659('0x9e')]['toLowerCase']())+_0xc659('0xb4'),_0x263004);}return _0x105ca2;})[_0xc659('0x1e')](function(){if(_0x14fb38[_0xc659('0x49')]['channel']==='voice'){return db[_0xc659('0xb0')][_0xc659('0x2d')]({'where':{'UserId':_0x14fb38['params']['id'],'VoiceQueueId':_0x14fb38[_0xc659('0x49')][_0xc659('0xa7')]},'individualHooks':!![]})[_0xc659('0x1e')](function(){return _0x281336;});}return _0x281336;})[_0xc659('0x1e')](respondWithStatusCode(_0x4c1128,null))[_0xc659('0x27')](handleError(_0x4c1128,null));};exports[_0xc659('0xb5')]=function(_0x344da4,_0x32ba21){_0x344da4[_0xc659('0x61')][_0xc659('0xb6')]=_0x344da4['file'][_0xc659('0xb7')];return db[_0xc659('0x3d')][_0xc659('0x38')]({'where':{'id':_0x344da4['params']['id']}})[_0xc659('0x1e')](handleEntityNotFound(_0x32ba21,null))[_0xc659('0x1e')](saveUpdates(_0x344da4['body'],null))[_0xc659('0x1e')](respondWithResult(_0x32ba21,null))[_0xc659('0x27')](handleError(_0x32ba21,null));};exports[_0xc659('0xb8')]=function(_0x292eed,_0x7fd51b){var _0x8f8608=path[_0xc659('0xb9')](config['root'],_0xc659('0xba'));return db[_0xc659('0x3d')][_0xc659('0x38')]({'where':{'id':_0x292eed[_0xc659('0x5d')]['id']},'attributes':['id',_0xc659('0xb6')],'raw':!![]})[_0xc659('0x1e')](handleEntityNotFound(_0x7fd51b,null))[_0xc659('0x1e')](function(_0xe858dd){if(_0xe858dd){if(_[_0xc659('0x6a')](_0xe858dd[_0xc659('0xb6')])){return _0x7fd51b[_0xc659('0xbb')](_0x8f8608);}else{if(!fs[_0xc659('0xbc')](path[_0xc659('0xb9')](config[_0xc659('0xbd')],'server/files/images/',_0xe858dd[_0xc659('0xb6')]))){return _0x7fd51b['download'](_0x8f8608);}return _0x7fd51b['download'](path['join'](config[_0xc659('0xbd')],_0xc659('0xbe'),_0xe858dd[_0xc659('0xb6')]));}}})['catch'](handleError(_0x7fd51b,null));};exports[_0xc659('0xbf')]=function(_0x383793,_0x1410ba){return db[_0xc659('0x3d')][_0xc659('0x38')]({'where':{'id':_0x383793[_0xc659('0x5d')]['id']},'attributes':['id']})[_0xc659('0x1e')](handleEntityNotFound(_0x1410ba,null))[_0xc659('0x1e')](function(_0x249c57){var _0x30de1b=[];values=_0x249c57[_0xc659('0x56')];_0x30de1b['push'](get_open_tabs(_0xc659('0x55'),_0x249c57['dataValues']));_0x30de1b[_0xc659('0x50')](get_open_tabs('sms',_0x249c57[_0xc659('0x56')]));_0x30de1b[_0xc659('0x50')](get_open_tabs(_0xc659('0x59'),_0x249c57[_0xc659('0x56')]));_0x30de1b['push'](get_open_tabs(_0xc659('0x5a'),_0x249c57[_0xc659('0x56')]));_0x30de1b[_0xc659('0x50')](get_open_tabs('fax',_0x249c57[_0xc659('0x56')]));_0x30de1b[_0xc659('0x50')](get_open_tabs(_0xc659('0x58'),_0x249c57[_0xc659('0x56')]));return Promise[_0xc659('0x5b')](_0x30de1b);})[_0xc659('0x1e')](function(_0x9eb41){if(_0x9eb41){var _0xfa29bb=_[_0xc659('0x36')](values['ChatOpenTabs'],function(_0x577210){return{'channel':_0xc659('0xc0'),'id':_0x577210['id'],'createdAt':_0x577210[_0xc659('0xc1')]};});var _0xce7d4=_[_0xc659('0x36')](values[_0xc659('0xc2')],function(_0x48c078){return{'channel':_0xc659('0xc3'),'id':_0x48c078['id'],'createdAt':_0x48c078[_0xc659('0xc1')]};});var _0x190c3c=_[_0xc659('0x36')](values[_0xc659('0xc4')],function(_0x1a5205){return{'channel':_0xc659('0xc5'),'id':_0x1a5205['id'],'createdAt':_0x1a5205['createdAt']};});var _0x3d4d63=_['map'](values['MailOpenTabs'],function(_0x1ade5b){return{'channel':'MAIL','id':_0x1ade5b['id'],'createdAt':_0x1ade5b[_0xc659('0xc1')]};});var _0x243d89=_[_0xc659('0x36')](values['SmsOpenTabs'],function(_0x4934c7){return{'channel':_0xc659('0xc6'),'id':_0x4934c7['id'],'createdAt':_0x4934c7[_0xc659('0xc1')]};});var _0x4a3aa1=_[_0xc659('0x36')](values[_0xc659('0xc7')],function(_0x53e08b){return{'channel':_0xc659('0xc8'),'id':_0x53e08b['id'],'createdAt':_0x53e08b[_0xc659('0xc1')]};});var _0x4e087b=_[_0xc659('0xc9')](_0xfa29bb,_0xce7d4,_0x190c3c,_0x3d4d63,_0x243d89,_0x4a3aa1);var _0x2e134b={'count':_0x4e087b['length'],'rows':_0x4e087b};return _0x2e134b;}else return null;})[_0xc659('0x1e')](respondWithResult(_0x1410ba,null))[_0xc659('0x27')](handleError(_0x1410ba,null));};exports[_0xc659('0xca')]=function(_0x5850dc,_0xf87c62){var _0x4678d8={};return db[_0xc659('0x3d')][_0xc659('0x97')]({'where':{'id':_0x5850dc[_0xc659('0x5d')]['id']}})['then'](function(_0x50e638){if(!_0x50e638){throw new APINotFoundError(util[_0xc659('0xae')](_0xc659('0xcb'),_0x5850dc['params']['id']));}return contacts[_0xc659('0x62')]();})[_0xc659('0x1e')](function(_0x35c4bd){_0x5850dc[_0xc659('0x49')][_0xc659('0x3d')]=_0x5850dc[_0xc659('0x5d')]['id'];_0x4678d8=qs['getOptions'](_0x35c4bd,_0x5850dc);if(_0x5850dc[_0xc659('0x49')][_0xc659('0xcc')](_0xc659('0x4a'))){_0x4678d8['include']=[{'model':db[_0xc659('0xcd')],'as':_0xc659('0xce'),'required':![]},{'model':db['Tag'],'as':_0xc659('0xcf'),'attributes':['id','name',_0xc659('0xd0')],'where':_0x5850dc['query'][_0xc659('0xd1')]?{'id':_0x5850dc['query'][_0xc659('0xd1')]}:undefined,'required':_0x5850dc[_0xc659('0x49')][_0xc659('0xd1')]?!![]:![]}];}return contacts[_0xc659('0x51')](_0x5850dc[_0xc659('0x49')],_0x5850dc[_0xc659('0x31')],_0x4678d8,_0x35c4bd);})[_0xc659('0x1e')](respondWithFilteredResult(_0xf87c62,_0x4678d8))[_0xc659('0x27')](APIHandleError(_0xf87c62));};exports[_0xc659('0xd2')]=function(_0x16ea02,_0x17aa00){var _0x497c6b;var _0x2ae2be={};var _0x515a19;return db[_0xc659('0x3d')]['findOne']({'where':{'id':_0x16ea02[_0xc659('0x5d')]['id']},'attributes':['id',_0xc659('0x3b'),_0xc659('0x29')]})[_0xc659('0x1e')](handleEntityNotFound(_0x17aa00,null))[_0xc659('0x1e')](function(_0x4ab7dc){if(!utils[_0xc659('0xa2')](_0x16ea02[_0xc659('0x49')]['channel'])){throw new db['Sequelize']['ValidationError']('Unknown\x20channel');}_0x497c6b=_0x4ab7dc;var _0x20ade1={};_0x20ade1[_0xc659('0xd3')]=_[_0xc659('0xd4')](db[_[_0xc659('0xa4')](_0x16ea02[_0xc659('0x49')][_0xc659('0x9e')])+_0xc659('0xd5')][_0xc659('0x3e')]);_0x20ade1[_0xc659('0x49')]=_[_0xc659('0xd4')](_0x16ea02[_0xc659('0x49')]);_0x20ade1[_0xc659('0xd6')]=_[_0xc659('0xd7')](_0x20ade1[_0xc659('0xd3')],_0x20ade1[_0xc659('0x49')]);_0x2ae2be[_0xc659('0x4f')]=_['intersection'](_0x20ade1[_0xc659('0xd3')],qs[_0xc659('0xd8')](_0x16ea02[_0xc659('0x49')][_0xc659('0xd8')]));_0x2ae2be[_0xc659('0x4f')]=_0x2ae2be[_0xc659('0x4f')][_0xc659('0x54')]?_0x2ae2be[_0xc659('0x4f')]:_0x20ade1['model'];_0x2ae2be[_0xc659('0xd9')]=qs[_0xc659('0xda')](_0x16ea02[_0xc659('0x49')][_0xc659('0xda')]);_0x2ae2be['where']=qs[_0xc659('0xd6')](_[_0xc659('0xdb')](_0x16ea02[_0xc659('0x49')],_0x20ade1[_0xc659('0xd6')]));if(_0x16ea02[_0xc659('0x49')][_0xc659('0x34')]){_0x2ae2be[_0xc659('0x48')]=_['merge'](_0x2ae2be['where'],{'$or':_[_0xc659('0x36')](_0x2ae2be[_0xc659('0x4f')],function(_0x1c387c){var _0xf8c4f5={};_0xf8c4f5[_0x1c387c]={'$like':'%'+_0x16ea02[_0xc659('0x49')][_0xc659('0x34')]+'%'};return _0xf8c4f5;})});}_0x2ae2be=_[_0xc659('0x5e')]({},_0x2ae2be,_0x16ea02[_0xc659('0x5f')]);switch(_0x497c6b[_0xc659('0x29')]){case'admin':return db[_[_0xc659('0xa4')](_0x16ea02[_0xc659('0x49')][_0xc659('0x9e')])+_0xc659('0xd5')][_0xc659('0x51')](_0x2ae2be);case _0xc659('0x31'):case _0xc659('0x2a'):return _0x497c6b[_0xc659('0x2e')+_['capitalize'](_0x16ea02[_0xc659('0x49')][_0xc659('0x9e')])+_0xc659('0xa6')](_0x2ae2be);default:throw new db[(_0xc659('0x93'))][(_0xc659('0x90'))](_0xc659('0xdc'));}})[_0xc659('0x1e')](function(_0x4bf054){_0x515a19=_0x4bf054['length'];if(!_0x16ea02['query']['hasOwnProperty']('nolimit')){_0x2ae2be[_0xc659('0x1a')]=qs[_0xc659('0x1a')](_0x16ea02[_0xc659('0x49')]['limit']);_0x2ae2be[_0xc659('0x18')]=qs[_0xc659('0x18')](_0x16ea02[_0xc659('0x49')][_0xc659('0x18')]);}switch(_0x497c6b[_0xc659('0x29')]){case _0xc659('0x2f'):return db[_[_0xc659('0xa4')](_0x16ea02['query']['channel'])+_0xc659('0xd5')][_0xc659('0x51')](_0x2ae2be);case _0xc659('0x31'):case _0xc659('0x2a'):return _0x497c6b['get'+_[_0xc659('0xa4')](_0x16ea02[_0xc659('0x49')][_0xc659('0x9e')])+_0xc659('0xa6')](_0x2ae2be);}})[_0xc659('0x1e')](function(_0x58a3fd){return{'count':_0x515a19,'rows':_0x58a3fd};})[_0xc659('0x1e')](respondWithResult(_0x17aa00,null))[_0xc659('0x27')](handleError(_0x17aa00,null));};exports[_0xc659('0xdd')]=function(_0x48d05a,_0x3dbf2b){var _0x4ffe7a={};var _0x21a3f1={};var _0x5db1ce;var _0x44101a;return db[_0xc659('0x3d')][_0xc659('0x97')]({'where':{'id':_0x48d05a['params']['id']}})['then'](handleEntityNotFound(_0x3dbf2b,null))[_0xc659('0x1e')](function(_0xcf7f80){if(_0xcf7f80){_0x5db1ce=_0xcf7f80;_0x21a3f1[_0xc659('0xd3')]=_[_0xc659('0xd4')](db[_0xc659('0xb0')][_0xc659('0x3e')]);_0x21a3f1['query']=_[_0xc659('0xd4')](_0x48d05a['query']);_0x21a3f1[_0xc659('0xd6')]=_[_0xc659('0xd7')](_0x21a3f1[_0xc659('0xd3')],_0x21a3f1['query']);_0x4ffe7a[_0xc659('0x4f')]=_[_0xc659('0xd7')](_0x21a3f1['model'],qs[_0xc659('0xd8')](_0x48d05a[_0xc659('0x49')][_0xc659('0xd8')]));_0x4ffe7a['attributes']=_0x4ffe7a[_0xc659('0x4f')]['length']?_0x4ffe7a[_0xc659('0x4f')]:_0x21a3f1['model'];_0x4ffe7a[_0xc659('0xd9')]=qs[_0xc659('0xda')](_0x48d05a[_0xc659('0x49')]['sort']);_0x4ffe7a[_0xc659('0x48')]=qs['filters'](_[_0xc659('0xdb')](_0x48d05a[_0xc659('0x49')],_0x21a3f1[_0xc659('0xd6')]));if(_0x48d05a[_0xc659('0x49')][_0xc659('0x34')]){_0x4ffe7a[_0xc659('0x48')]=_[_0xc659('0x5e')](_0x4ffe7a[_0xc659('0x48')],{'$or':_[_0xc659('0x36')](_0x4ffe7a['attributes'],function(_0x28dd25){var _0x929245={};_0x929245[_0x28dd25]={'$like':'%'+_0x48d05a[_0xc659('0x49')][_0xc659('0x34')]+'%'};return _0x929245;})});}_0x4ffe7a=_[_0xc659('0x5e')]({},_0x4ffe7a,_0x48d05a['options']);return _0x5db1ce[_0xc659('0xdd')](_0x4ffe7a);}})[_0xc659('0x1e')](function(_0x37fd6f){if(_0x37fd6f){_0x44101a=_0x37fd6f[_0xc659('0x54')];if(!_0x48d05a['query'][_0xc659('0xcc')](_0xc659('0xde'))){_0x4ffe7a[_0xc659('0x1a')]=qs[_0xc659('0x1a')](_0x48d05a['query'][_0xc659('0x1a')]);_0x4ffe7a[_0xc659('0x18')]=qs[_0xc659('0x18')](_0x48d05a['query'][_0xc659('0x18')]);}return _0x5db1ce[_0xc659('0xdd')](_0x4ffe7a);}})[_0xc659('0x1e')](function(_0x48983b){if(_0x48983b){return _0x48983b?{'count':_0x44101a,'rows':_0x48983b}:null;}})['then'](respondWithResult(_0x3dbf2b,null))[_0xc659('0x27')](handleError(_0x3dbf2b,null));};exports[_0xc659('0xdf')]=function(_0x1f4d22,_0x23a8ab){var _0x4c3c99={};var _0x1f8046={};var _0x18bd98;var _0x4dc5d3;return db[_0xc659('0x3d')][_0xc659('0x97')]({'where':{'id':_0x1f4d22[_0xc659('0x5d')]['id']}})['then'](handleEntityNotFound(_0x23a8ab,null))[_0xc659('0x1e')](function(_0x4eb591){if(_0x4eb591){_0x18bd98=_0x4eb591;_0x1f8046[_0xc659('0xd3')]=_['keys'](db[_0xc659('0xe0')]['rawAttributes']);_0x1f8046[_0xc659('0x49')]=_['keys'](_0x1f4d22['query']);_0x1f8046[_0xc659('0xd6')]=_[_0xc659('0xd7')](_0x1f8046[_0xc659('0xd3')],_0x1f8046[_0xc659('0x49')]);_0x4c3c99[_0xc659('0x4f')]=_['intersection'](_0x1f8046['model'],qs[_0xc659('0xd8')](_0x1f4d22['query'][_0xc659('0xd8')]));_0x4c3c99[_0xc659('0x4f')]=_0x4c3c99['attributes'][_0xc659('0x54')]?_0x4c3c99[_0xc659('0x4f')]:_0x1f8046[_0xc659('0xd3')];_0x4c3c99[_0xc659('0xd9')]=qs[_0xc659('0xda')](_0x1f4d22['query'][_0xc659('0xda')]);_0x4c3c99[_0xc659('0x48')]=qs['filters'](_['pick'](_0x1f4d22[_0xc659('0x49')],_0x1f8046[_0xc659('0xd6')]));if(_0x1f4d22[_0xc659('0x49')][_0xc659('0x34')]){_0x4c3c99[_0xc659('0x48')]=_['merge'](_0x4c3c99[_0xc659('0x48')],{'$or':_[_0xc659('0x36')](_0x4c3c99[_0xc659('0x4f')],function(_0xc0600d){var _0x5f1b38={};_0x5f1b38[_0xc0600d]={'$like':'%'+_0x1f4d22['query']['filter']+'%'};return _0x5f1b38;})});}_0x4c3c99=_[_0xc659('0x5e')]({},_0x4c3c99,_0x1f4d22[_0xc659('0x5f')]);return _0x18bd98['getGroups'](_0x4c3c99);}})[_0xc659('0x1e')](function(_0x3de2e2){if(_0x3de2e2){_0x4dc5d3=_0x3de2e2['length'];if(!_0x1f4d22[_0xc659('0x49')][_0xc659('0xcc')](_0xc659('0xde'))){_0x4c3c99['limit']=qs['limit'](_0x1f4d22['query']['limit']);_0x4c3c99[_0xc659('0x18')]=qs[_0xc659('0x18')](_0x1f4d22[_0xc659('0x49')][_0xc659('0x18')]);}return _0x18bd98[_0xc659('0xdf')](_0x4c3c99);}})['then'](function(_0x5abfa0){if(_0x5abfa0){return _0x5abfa0?{'count':_0x4dc5d3,'rows':_0x5abfa0}:null;}})[_0xc659('0x1e')](respondWithResult(_0x23a8ab,null))[_0xc659('0x27')](handleError(_0x23a8ab,null));};exports[_0xc659('0xe1')]=function(_0x3fbcc8,_0x53be1b){var _0x25d719={'raw':!![],'where':{}};var _0x3be0eb={};var _0xac7243={'count':0x0,'rows':[]};return db[_0xc659('0x3d')][_0xc659('0x97')]({'where':{'id':_0x3fbcc8[_0xc659('0x5d')]['id']}})[_0xc659('0x1e')](handleEntityNotFound(_0x53be1b,null))[_0xc659('0x1e')](function(_0x197377){if(_0x197377){_0x3be0eb[_0xc659('0xd3')]=_[_0xc659('0xd4')](db['VoiceRecording'][_0xc659('0x3e')]);_0x3be0eb[_0xc659('0x49')]=_[_0xc659('0xd4')](_0x3fbcc8[_0xc659('0x49')]);_0x3be0eb[_0xc659('0xd6')]=_[_0xc659('0xd7')](_0x3be0eb[_0xc659('0xd3')],_0x3be0eb[_0xc659('0x49')]);_0x25d719[_0xc659('0x4f')]=_[_0xc659('0xd7')](_0x3be0eb['model'],qs[_0xc659('0xd8')](_0x3fbcc8[_0xc659('0x49')][_0xc659('0xd8')]));_0x25d719[_0xc659('0x4f')]=_0x25d719[_0xc659('0x4f')][_0xc659('0x54')]?_0x25d719['attributes']:_0x3be0eb[_0xc659('0xd3')];if(!_0x3fbcc8[_0xc659('0x49')][_0xc659('0xcc')](_0xc659('0xde'))){_0x25d719[_0xc659('0x1a')]=qs[_0xc659('0x1a')](_0x3fbcc8[_0xc659('0x49')][_0xc659('0x1a')]);_0x25d719[_0xc659('0x18')]=qs[_0xc659('0x18')](_0x3fbcc8[_0xc659('0x49')]['offset']);}_0x25d719['order']=qs[_0xc659('0xda')](_0x3fbcc8['query'][_0xc659('0xda')]);_0x25d719[_0xc659('0x48')]=qs[_0xc659('0xd6')](_[_0xc659('0xdb')](_0x3fbcc8[_0xc659('0x49')],_0x3be0eb[_0xc659('0xd6')]));_0x25d719[_0xc659('0x48')]['UserId']=_0x197377['id'];if(_0x3fbcc8[_0xc659('0x49')][_0xc659('0x34')]){_0x25d719[_0xc659('0x48')]=_['merge'](_0x25d719[_0xc659('0x48')],{'$or':_[_0xc659('0x36')](_0x25d719[_0xc659('0x4f')],function(_0x32052e){var _0x2e2ccf={};_0x2e2ccf[_0x32052e]={'$like':'%'+_0x3fbcc8[_0xc659('0x49')][_0xc659('0x34')]+'%'};return _0x2e2ccf;})});}_0x25d719=_[_0xc659('0x5e')]({},_0x25d719,_0x3fbcc8[_0xc659('0x5f')]);return db[_0xc659('0xe2')]['count']({'where':_0x25d719[_0xc659('0x48')]})[_0xc659('0x1e')](function(_0x581664){_0xac7243['count']=_0x581664;if(_0x3fbcc8['query'][_0xc659('0x4a')]){_0x25d719[_0xc659('0x4b')]=[{'all':!![]}];}return db[_0xc659('0xe2')][_0xc659('0x51')](_0x25d719);})[_0xc659('0x1e')](function(_0x330a33){_0xac7243[_0xc659('0x52')]=_0x330a33;return _0xac7243;});}})[_0xc659('0x1e')](respondWithFilteredResult(_0x53be1b,_0x25d719))['catch'](handleError(_0x53be1b,null));};exports['getScreenRecordings']=function(_0x423b2d,_0x11926f){var _0x799747={'raw':!![],'where':{}};var _0x1b96a8={};var _0x58003f={'count':0x0,'rows':[]};return db[_0xc659('0x3d')][_0xc659('0x97')]({'where':{'id':_0x423b2d[_0xc659('0x5d')]['id']}})[_0xc659('0x1e')](handleEntityNotFound(_0x11926f,null))['then'](function(_0x27995d){if(_0x27995d){_0x1b96a8[_0xc659('0xd3')]=_[_0xc659('0xd4')](db[_0xc659('0xe3')][_0xc659('0x3e')]);_0x1b96a8[_0xc659('0x49')]=_[_0xc659('0xd4')](_0x423b2d[_0xc659('0x49')]);_0x1b96a8[_0xc659('0xd6')]=_['intersection'](_0x1b96a8[_0xc659('0xd3')],_0x1b96a8[_0xc659('0x49')]);_0x799747[_0xc659('0x4f')]=_[_0xc659('0xd7')](_0x1b96a8[_0xc659('0xd3')],qs[_0xc659('0xd8')](_0x423b2d[_0xc659('0x49')][_0xc659('0xd8')]));_0x799747['attributes']=_0x799747[_0xc659('0x4f')]['length']?_0x799747[_0xc659('0x4f')]:_0x1b96a8[_0xc659('0xd3')];if(!_0x423b2d[_0xc659('0x49')]['hasOwnProperty'](_0xc659('0xde'))){_0x799747['limit']=qs[_0xc659('0x1a')](_0x423b2d[_0xc659('0x49')][_0xc659('0x1a')]);_0x799747['offset']=qs[_0xc659('0x18')](_0x423b2d['query']['offset']);}_0x799747[_0xc659('0xd9')]=qs[_0xc659('0xda')](_0x423b2d[_0xc659('0x49')]['sort']);_0x799747[_0xc659('0x48')]=qs[_0xc659('0xd6')](_[_0xc659('0xdb')](_0x423b2d[_0xc659('0x49')],_0x1b96a8['filters']));_0x799747['where']['UserId']=_0x27995d['id'];if(_0x423b2d[_0xc659('0x49')][_0xc659('0x34')]){_0x799747[_0xc659('0x48')]=_[_0xc659('0x5e')](_0x799747['where'],{'$or':_['map'](_0x799747[_0xc659('0x4f')],function(_0x106a1f){var _0x2bb7ea={};_0x2bb7ea[_0x106a1f]={'$like':'%'+_0x423b2d[_0xc659('0x49')]['filter']+'%'};return _0x2bb7ea;})});}_0x799747=_[_0xc659('0x5e')]({},_0x799747,_0x423b2d['options']);return db[_0xc659('0xe3')]['count']({'where':_0x799747[_0xc659('0x48')]})[_0xc659('0x1e')](function(_0xede1b4){_0x58003f[_0xc659('0x1b')]=_0xede1b4;if(_0x423b2d[_0xc659('0x49')][_0xc659('0x4a')]){_0x799747[_0xc659('0x4b')]=[{'all':!![]}];}return db['ScreenRecording'][_0xc659('0x51')](_0x799747);})[_0xc659('0x1e')](function(_0x2bf1fb){_0x58003f['rows']=_0x2bf1fb;return _0x58003f;});}})['then'](respondWithFilteredResult(_0x11926f,_0x799747))['catch'](handleError(_0x11926f,null));};exports[_0xc659('0xe4')]=function(_0x1228cc,_0x5dd496){var _0x9dc24c={};var _0x5a94cc={};var _0x20ce81;var _0x24ecfd;return db[_0xc659('0x3d')][_0xc659('0x97')]({'where':{'id':_0x1228cc[_0xc659('0x5d')]['id']}})[_0xc659('0x1e')](handleEntityNotFound(_0x5dd496,null))[_0xc659('0x1e')](function(_0x5e0ea7){if(_0x5e0ea7){_0x20ce81=_0x5e0ea7;_0x5a94cc[_0xc659('0xd3')]=_[_0xc659('0xd4')](db['ChatInteraction'][_0xc659('0x3e')]);_0x5a94cc[_0xc659('0x49')]=_['keys'](_0x1228cc['query']);_0x5a94cc[_0xc659('0xd6')]=_[_0xc659('0xd7')](_0x5a94cc['model'],_0x5a94cc[_0xc659('0x49')]);_0x9dc24c[_0xc659('0x4f')]=_[_0xc659('0xd7')](_0x5a94cc['model'],qs[_0xc659('0xd8')](_0x1228cc['query']['fields']));_0x9dc24c[_0xc659('0x4f')]=_0x9dc24c[_0xc659('0x4f')]['length']?_0x9dc24c[_0xc659('0x4f')]:_0x5a94cc[_0xc659('0xd3')];_0x9dc24c[_0xc659('0xd9')]=qs[_0xc659('0xda')](_0x1228cc[_0xc659('0x49')][_0xc659('0xda')]);_0x9dc24c[_0xc659('0x48')]=qs[_0xc659('0xd6')](_[_0xc659('0xdb')](_0x1228cc[_0xc659('0x49')],_0x5a94cc[_0xc659('0xd6')]));if(_0x1228cc[_0xc659('0x49')][_0xc659('0x34')]){_0x9dc24c[_0xc659('0x48')]=_[_0xc659('0x5e')](_0x9dc24c[_0xc659('0x48')],{'$or':_[_0xc659('0x36')](_0x9dc24c[_0xc659('0x4f')],function(_0x43c4ab){var _0xd88f3a={};_0xd88f3a[_0x43c4ab]={'$like':'%'+_0x1228cc[_0xc659('0x49')][_0xc659('0x34')]+'%'};return _0xd88f3a;})});}_0x9dc24c=_[_0xc659('0x5e')]({},_0x9dc24c,_0x1228cc[_0xc659('0x5f')]);return _0x20ce81[_0xc659('0xe4')](_0x9dc24c);}})['then'](function(_0x3fea7f){if(_0x3fea7f){_0x24ecfd=_0x3fea7f[_0xc659('0x54')];if(!_0x1228cc[_0xc659('0x49')][_0xc659('0xcc')](_0xc659('0xde'))){_0x9dc24c['limit']=qs[_0xc659('0x1a')](_0x1228cc['query']['limit']);_0x9dc24c[_0xc659('0x18')]=qs['offset'](_0x1228cc['query'][_0xc659('0x18')]);}return _0x20ce81[_0xc659('0xe4')](_0x9dc24c);}})[_0xc659('0x1e')](function(_0x5c1375){if(_0x5c1375){return _0x5c1375?{'count':_0x24ecfd,'rows':_0x5c1375}:null;}})[_0xc659('0x1e')](respondWithResult(_0x5dd496,null))['catch'](handleError(_0x5dd496,null));};exports[_0xc659('0xe5')]=function(_0x2f92f6,_0x17800c){var _0x3b38a5={};var _0x568f38={};var _0x1525a7;var _0x7ccd99;return db['User'][_0xc659('0x97')]({'where':{'id':_0x2f92f6[_0xc659('0x5d')]['id']}})[_0xc659('0x1e')](handleEntityNotFound(_0x17800c,null))[_0xc659('0x1e')](function(_0x561a60){if(_0x561a60){_0x1525a7=_0x561a60;_0x568f38[_0xc659('0xd3')]=_[_0xc659('0xd4')](db[_0xc659('0xe6')][_0xc659('0x3e')]);_0x568f38[_0xc659('0x49')]=_[_0xc659('0xd4')](_0x2f92f6[_0xc659('0x49')]);_0x568f38[_0xc659('0xd6')]=_[_0xc659('0xd7')](_0x568f38[_0xc659('0xd3')],_0x568f38['query']);_0x3b38a5[_0xc659('0x4f')]=_[_0xc659('0xd7')](_0x568f38['model'],qs[_0xc659('0xd8')](_0x2f92f6[_0xc659('0x49')]['fields']));_0x3b38a5[_0xc659('0x4f')]=_0x3b38a5[_0xc659('0x4f')]['length']?_0x3b38a5['attributes']:_0x568f38[_0xc659('0xd3')];_0x3b38a5[_0xc659('0xd9')]=qs['sort'](_0x2f92f6[_0xc659('0x49')]['sort']);_0x3b38a5[_0xc659('0x48')]=qs[_0xc659('0xd6')](_[_0xc659('0xdb')](_0x2f92f6[_0xc659('0x49')],_0x568f38[_0xc659('0xd6')]));if(_0x2f92f6[_0xc659('0x49')]['filter']){_0x3b38a5[_0xc659('0x48')]=_[_0xc659('0x5e')](_0x3b38a5['where'],{'$or':_[_0xc659('0x36')](_0x3b38a5[_0xc659('0x4f')],function(_0x3c3473){var _0x171d48={};_0x171d48[_0x3c3473]={'$like':'%'+_0x2f92f6[_0xc659('0x49')]['filter']+'%'};return _0x171d48;})});}_0x3b38a5=_[_0xc659('0x5e')]({},_0x3b38a5,_0x2f92f6[_0xc659('0x5f')]);return _0x1525a7[_0xc659('0xe5')](_0x3b38a5);}})[_0xc659('0x1e')](function(_0x3cd093){if(_0x3cd093){_0x7ccd99=_0x3cd093[_0xc659('0x54')];if(!_0x2f92f6['query'][_0xc659('0xcc')](_0xc659('0xde'))){_0x3b38a5[_0xc659('0x1a')]=qs[_0xc659('0x1a')](_0x2f92f6['query'][_0xc659('0x1a')]);_0x3b38a5['offset']=qs[_0xc659('0x18')](_0x2f92f6['query']['offset']);}return _0x1525a7[_0xc659('0xe5')](_0x3b38a5);}})[_0xc659('0x1e')](function(_0x54cc40){if(_0x54cc40){return _0x54cc40?{'count':_0x7ccd99,'rows':_0x54cc40}:null;}})[_0xc659('0x1e')](respondWithResult(_0x17800c,null))['catch'](handleError(_0x17800c,null));};exports['getMailInteractions']=function(_0x206b55,_0x32253f){var _0x82d686={'raw':!![],'where':{}};var _0x10dd75={};var _0x14c0f8={'count':0x0,'rows':[]};return db[_0xc659('0x3d')][_0xc659('0x97')]({'where':{'id':_0x206b55['params']['id']}})[_0xc659('0x1e')](handleEntityNotFound(_0x32253f,null))['then'](function(_0x154243){if(_0x154243){_0x10dd75[_0xc659('0xd3')]=_[_0xc659('0xd4')](db[_0xc659('0xe7')]['rawAttributes']);_0x10dd75[_0xc659('0x49')]=_[_0xc659('0xd4')](_0x206b55[_0xc659('0x49')]);_0x10dd75[_0xc659('0xd6')]=_[_0xc659('0xd7')](_0x10dd75['model'],_0x10dd75[_0xc659('0x49')]);_0x82d686[_0xc659('0x4f')]=_[_0xc659('0xd7')](_0x10dd75[_0xc659('0xd3')],qs['fields'](_0x206b55[_0xc659('0x49')]['fields']));_0x82d686['attributes']=_0x82d686[_0xc659('0x4f')]['length']?_0x82d686[_0xc659('0x4f')]:_0x10dd75[_0xc659('0xd3')];if(!_0x206b55[_0xc659('0x49')][_0xc659('0xcc')](_0xc659('0xde'))){_0x82d686['limit']=qs[_0xc659('0x1a')](_0x206b55['query'][_0xc659('0x1a')]);_0x82d686[_0xc659('0x18')]=qs['offset'](_0x206b55['query'][_0xc659('0x18')]);}_0x82d686[_0xc659('0xd9')]=qs[_0xc659('0xda')](_0x206b55[_0xc659('0x49')][_0xc659('0xda')]);_0x82d686['where']=qs[_0xc659('0xd6')](_['pick'](_0x206b55[_0xc659('0x49')],_0x10dd75[_0xc659('0xd6')]));_0x82d686[_0xc659('0x48')][_0xc659('0xe8')]=_0x154243['id'];if(_0x206b55['query'][_0xc659('0x34')]){_0x82d686[_0xc659('0x48')]=_['merge'](_0x82d686[_0xc659('0x48')],{'$or':_[_0xc659('0x36')](_0x82d686[_0xc659('0x4f')],function(_0x2d470c){var _0x53b624={};_0x53b624[_0x2d470c]={'$like':'%'+_0x206b55[_0xc659('0x49')][_0xc659('0x34')]+'%'};return _0x53b624;})});}_0x82d686=_[_0xc659('0x5e')]({},_0x82d686,_0x206b55[_0xc659('0x5f')]);return db[_0xc659('0xe7')][_0xc659('0x1b')]({'where':_0x82d686['where']})[_0xc659('0x1e')](function(_0xe91af6){_0x14c0f8['count']=_0xe91af6;if(_0x206b55['query'][_0xc659('0x4a')]){_0x82d686[_0xc659('0x4b')]=[{'all':!![]}];}return db[_0xc659('0xe7')][_0xc659('0x51')](_0x82d686);})['then'](function(_0x36a598){_0x14c0f8[_0xc659('0x52')]=_0x36a598;return _0x14c0f8;});}})[_0xc659('0x1e')](respondWithFilteredResult(_0x32253f,_0x82d686))['catch'](handleError(_0x32253f,null));};exports['getSmsInteractions']=function(_0x1c1e4d,_0x378f4e){var _0x169b38={};var _0x37880b={};var _0x4647ee;var _0x4d61b6;return db[_0xc659('0x3d')][_0xc659('0x97')]({'where':{'id':_0x1c1e4d[_0xc659('0x5d')]['id']}})['then'](handleEntityNotFound(_0x378f4e,null))[_0xc659('0x1e')](function(_0x18d1dc){if(_0x18d1dc){_0x4647ee=_0x18d1dc;_0x37880b[_0xc659('0xd3')]=_[_0xc659('0xd4')](db[_0xc659('0xe9')][_0xc659('0x3e')]);_0x37880b[_0xc659('0x49')]=_['keys'](_0x1c1e4d[_0xc659('0x49')]);_0x37880b['filters']=_[_0xc659('0xd7')](_0x37880b[_0xc659('0xd3')],_0x37880b[_0xc659('0x49')]);_0x169b38[_0xc659('0x4f')]=_[_0xc659('0xd7')](_0x37880b[_0xc659('0xd3')],qs[_0xc659('0xd8')](_0x1c1e4d[_0xc659('0x49')][_0xc659('0xd8')]));_0x169b38[_0xc659('0x4f')]=_0x169b38[_0xc659('0x4f')][_0xc659('0x54')]?_0x169b38[_0xc659('0x4f')]:_0x37880b[_0xc659('0xd3')];_0x169b38[_0xc659('0xd9')]=qs[_0xc659('0xda')](_0x1c1e4d[_0xc659('0x49')][_0xc659('0xda')]);_0x169b38[_0xc659('0x48')]=qs[_0xc659('0xd6')](_[_0xc659('0xdb')](_0x1c1e4d[_0xc659('0x49')],_0x37880b['filters']));if(_0x1c1e4d[_0xc659('0x49')]['filter']){_0x169b38[_0xc659('0x48')]=_['merge'](_0x169b38[_0xc659('0x48')],{'$or':_['map'](_0x169b38[_0xc659('0x4f')],function(_0x1cb5af){var _0x123226={};_0x123226[_0x1cb5af]={'$like':'%'+_0x1c1e4d[_0xc659('0x49')][_0xc659('0x34')]+'%'};return _0x123226;})});}_0x169b38=_[_0xc659('0x5e')]({},_0x169b38,_0x1c1e4d['options']);return _0x4647ee[_0xc659('0xea')](_0x169b38);}})[_0xc659('0x1e')](function(_0x130839){if(_0x130839){_0x4d61b6=_0x130839[_0xc659('0x54')];if(!_0x1c1e4d[_0xc659('0x49')]['hasOwnProperty']('nolimit')){_0x169b38[_0xc659('0x1a')]=qs[_0xc659('0x1a')](_0x1c1e4d[_0xc659('0x49')][_0xc659('0x1a')]);_0x169b38[_0xc659('0x18')]=qs[_0xc659('0x18')](_0x1c1e4d[_0xc659('0x49')][_0xc659('0x18')]);}return _0x4647ee['getSmsInteractions'](_0x169b38);}})[_0xc659('0x1e')](function(_0x251ec8){if(_0x251ec8){return _0x251ec8?{'count':_0x4d61b6,'rows':_0x251ec8}:null;}})[_0xc659('0x1e')](respondWithResult(_0x378f4e,null))[_0xc659('0x27')](handleError(_0x378f4e,null));};exports['getFaxInteractions']=function(_0x2fdeda,_0x40d135){var _0x469e5e={};var _0x51b525={};var _0x1ebf3a;var _0x1a25a5;return db[_0xc659('0x3d')][_0xc659('0x97')]({'where':{'id':_0x2fdeda[_0xc659('0x5d')]['id']}})[_0xc659('0x1e')](handleEntityNotFound(_0x40d135,null))[_0xc659('0x1e')](function(_0x33be99){if(_0x33be99){_0x1ebf3a=_0x33be99;_0x51b525[_0xc659('0xd3')]=_[_0xc659('0xd4')](db['FaxInteraction'][_0xc659('0x3e')]);_0x51b525[_0xc659('0x49')]=_[_0xc659('0xd4')](_0x2fdeda['query']);_0x51b525[_0xc659('0xd6')]=_[_0xc659('0xd7')](_0x51b525[_0xc659('0xd3')],_0x51b525['query']);_0x469e5e['attributes']=_[_0xc659('0xd7')](_0x51b525['model'],qs[_0xc659('0xd8')](_0x2fdeda['query']['fields']));_0x469e5e['attributes']=_0x469e5e[_0xc659('0x4f')][_0xc659('0x54')]?_0x469e5e[_0xc659('0x4f')]:_0x51b525[_0xc659('0xd3')];_0x469e5e[_0xc659('0xd9')]=qs['sort'](_0x2fdeda[_0xc659('0x49')]['sort']);_0x469e5e['where']=qs[_0xc659('0xd6')](_['pick'](_0x2fdeda[_0xc659('0x49')],_0x51b525[_0xc659('0xd6')]));if(_0x2fdeda['query']['filter']){_0x469e5e[_0xc659('0x48')]=_[_0xc659('0x5e')](_0x469e5e['where'],{'$or':_[_0xc659('0x36')](_0x469e5e[_0xc659('0x4f')],function(_0x5ce077){var _0x685a54={};_0x685a54[_0x5ce077]={'$like':'%'+_0x2fdeda[_0xc659('0x49')][_0xc659('0x34')]+'%'};return _0x685a54;})});}_0x469e5e=_['merge']({},_0x469e5e,_0x2fdeda['options']);return _0x1ebf3a[_0xc659('0xeb')](_0x469e5e);}})['then'](function(_0x5aa536){if(_0x5aa536){_0x1a25a5=_0x5aa536[_0xc659('0x54')];if(!_0x2fdeda[_0xc659('0x49')][_0xc659('0xcc')](_0xc659('0xde'))){_0x469e5e[_0xc659('0x1a')]=qs[_0xc659('0x1a')](_0x2fdeda['query'][_0xc659('0x1a')]);_0x469e5e[_0xc659('0x18')]=qs[_0xc659('0x18')](_0x2fdeda['query'][_0xc659('0x18')]);}return _0x1ebf3a[_0xc659('0xeb')](_0x469e5e);}})[_0xc659('0x1e')](function(_0x4fb49b){if(_0x4fb49b){return _0x4fb49b?{'count':_0x1a25a5,'rows':_0x4fb49b}:null;}})[_0xc659('0x1e')](respondWithResult(_0x40d135,null))[_0xc659('0x27')](handleError(_0x40d135,null));};exports[_0xc659('0xec')]=function(_0x29147c,_0x64683){var _0x92e907={};var _0x1bb03b={};var _0x4c0f39;var _0x38f880;return db[_0xc659('0x3d')]['findOne']({'where':{'id':_0x29147c[_0xc659('0x5d')]['id']}})[_0xc659('0x1e')](handleEntityNotFound(_0x64683,null))['then'](function(_0x3c2670){if(_0x3c2670){_0x4c0f39=_0x3c2670;_0x1bb03b[_0xc659('0xd3')]=_['keys'](db[_0xc659('0xed')][_0xc659('0x3e')]);_0x1bb03b[_0xc659('0x49')]=_[_0xc659('0xd4')](_0x29147c[_0xc659('0x49')]);_0x1bb03b[_0xc659('0xd6')]=_['intersection'](_0x1bb03b[_0xc659('0xd3')],_0x1bb03b[_0xc659('0x49')]);_0x92e907[_0xc659('0x4f')]=_['intersection'](_0x1bb03b[_0xc659('0xd3')],qs[_0xc659('0xd8')](_0x29147c[_0xc659('0x49')]['fields']));_0x92e907[_0xc659('0x4f')]=_0x92e907[_0xc659('0x4f')][_0xc659('0x54')]?_0x92e907[_0xc659('0x4f')]:_0x1bb03b[_0xc659('0xd3')];_0x92e907[_0xc659('0xd9')]=qs[_0xc659('0xda')](_0x29147c[_0xc659('0x49')][_0xc659('0xda')]);_0x92e907[_0xc659('0x48')]=qs['filters'](_['pick'](_0x29147c[_0xc659('0x49')],_0x1bb03b[_0xc659('0xd6')]));if(_0x29147c[_0xc659('0x49')][_0xc659('0x34')]){_0x92e907[_0xc659('0x48')]=_[_0xc659('0x5e')](_0x92e907[_0xc659('0x48')],{'$or':_[_0xc659('0x36')](_0x92e907[_0xc659('0x4f')],function(_0x367d4b){var _0x587a3f={};_0x587a3f[_0x367d4b]={'$like':'%'+_0x29147c[_0xc659('0x49')][_0xc659('0x34')]+'%'};return _0x587a3f;})});}_0x92e907=_[_0xc659('0x5e')]({},_0x92e907,_0x29147c[_0xc659('0x5f')]);return _0x4c0f39[_0xc659('0xec')](_0x92e907);}})[_0xc659('0x1e')](function(_0x564b84){if(_0x564b84){_0x38f880=_0x564b84[_0xc659('0x54')];if(!_0x29147c[_0xc659('0x49')]['hasOwnProperty']('nolimit')){_0x92e907[_0xc659('0x1a')]=qs[_0xc659('0x1a')](_0x29147c['query'][_0xc659('0x1a')]);_0x92e907[_0xc659('0x18')]=qs['offset'](_0x29147c[_0xc659('0x49')][_0xc659('0x18')]);}return _0x4c0f39['getWhatsappInteractions'](_0x92e907);}})[_0xc659('0x1e')](function(_0x2ded67){if(_0x2ded67){return _0x2ded67?{'count':_0x38f880,'rows':_0x2ded67}:null;}})[_0xc659('0x1e')](respondWithResult(_0x64683,null))[_0xc659('0x27')](handleError(_0x64683,null));};exports[_0xc659('0xee')]=function(_0x457122,_0x4a6e6c,_0xafe85f){var _0x17599e;var _0x2f0f3c;var _0x1407fc;var _0x1a9e77=!_['isNil'](_0x457122['params']['id'])?_0x457122[_0xc659('0x5d')]['id']:!_[_0xc659('0x6a')](_0x457122[_0xc659('0x31')]['id'])?_0x457122[_0xc659('0x31')]['id']:null;return db[_0xc659('0x3d')]['find']({'where':{'id':_0x1a9e77,'role':{'$or':[_0xc659('0x2f'),_0xc659('0x31'),_0xc659('0x2a')]}},'attributes':['id',_0xc659('0x3b'),_0xc659('0xef'),_0xc659('0xf0'),_0xc659('0x29'),_0xc659('0x65'),_0xc659('0xf1')]})['then'](function(_0x4e9b1e){if(_0x4e9b1e){if(_0x4e9b1e[_0xc659('0x29')]===_0xc659('0x2a')){_0x17599e=_0x4e9b1e;if(_0x457122[_0xc659('0x61')][_0xc659('0xa1')]){_0x1407fc=util[_0xc659('0xae')](_0xc659('0xf2'),_0x17599e[_0x457122[_0xc659('0x61')][_0xc659('0xa1')]]);}else if(_0x457122[_0xc659('0x61')][_0xc659('0xf3')]){_0x1407fc=util['format']('SIP/%s',_0x457122[_0xc659('0x61')][_0xc659('0xf3')]);}else{_0x1407fc=util['format'](_0xc659('0xaf'),_0x17599e['name']);}socket['to'](util[_0xc659('0xae')](_0xc659('0xf4'),_0x17599e[_0xc659('0x3b')]))[_0xc659('0x2b')](_0xc659('0xf5'),{'user':{'id':_0x17599e['id'],'name':_0x17599e[_0xc659('0x3b')]},'ip':_0x457122['headers'][_0xc659('0xf6')]||_0x457122[_0xc659('0xf7')][_0xc659('0xf8')]||_0x457122[_0xc659('0xf9')]['remoteAddress']||_0x457122[_0xc659('0xf7')]['socket'][_0xc659('0xf8')]});return db[_0xc659('0xb0')][_0xc659('0x2d')]({'where':{'membername':_0x17599e['name']},'individualHooks':!![]});}}else{throw new db[(_0xc659('0x93'))][(_0xc659('0x90'))]('User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method');}})[_0xc659('0x1e')](function(){if(_0x17599e){return _0x17599e[_0xc659('0xfa')]({'raw':!![]});}})[_0xc659('0x1e')](function(_0x3fbec2){if(_0x17599e){if(_0x3fbec2){_0x2f0f3c=_0x3fbec2;if(_0x2f0f3c[_0xc659('0x54')]){var _0x16dc37=_0x2f0f3c[_0xc659('0x36')](function(_0x1e3eb1){var _0x288eba={'membername':_0x17599e[_0xc659('0x3b')],'UserId':_0x17599e['id'],'queue_name':_0x1e3eb1['name'],'VoiceQueueId':_0x1e3eb1['id'],'interface':_0x1407fc,'paused':_0x17599e['loginInPause']||![],'penalty':_0x1e3eb1[_0xc659('0xfb')]||0x0};return db[_0xc659('0xb0')]['upsert'](_0x288eba);});return Promise[_0xc659('0x5b')](_0x16dc37);}}}})[_0xc659('0x1e')](function(){if(_0x17599e){return db[_0xc659('0xfc')]['findAll']({'where':{'membername':_0x17599e[_0xc659('0x3b')],'exitAt':null}});}})[_0xc659('0x1e')](function(_0x2dd09c){if(_0x17599e){var _0x8e8faf=[];_0x2dd09c[_0xc659('0xfd')](function(_0x2e1ac6){_0x8e8faf[_0xc659('0x50')](_0x2e1ac6[_0xc659('0x28')]({'exitAt':moment()['format'](_0xc659('0xfe'))}));});return Promise[_0xc659('0x5b')](_0x8e8faf);}})[_0xc659('0x1e')](function(){if(_0x17599e){var _0x45952e=[];var _0x1dfdd6=[];var _0x4e7b7c=utils[_0xc659('0xff')]();var _0xa481e9={'membername':_0x17599e[_0xc659('0x3b')],'interface':_0x1407fc,'enterAt':moment()['format'](_0xc659('0xfe')),'role':_0x17599e[_0xc659('0x29')],'internal':_0x17599e['internal']};_0x4e7b7c[_0xc659('0xfd')](function(_0x351258){_0x45952e[_0xc659('0x50')](_['merge']({'channel':_0x351258,'type':_0xc659('0x100'),'data1':_0x457122[_0xc659('0x61')][_0xc659('0x101')],'data2':_0x1407fc},_0xa481e9));if(_0x17599e[_0xc659('0xf1')]){_0x1dfdd6[_0xc659('0x50')](_[_0xc659('0x5e')]({'channel':_0x351258,'type':'PAUSE','data1':_0xc659('0x102')},_0xa481e9));}});return db[_0xc659('0xfc')][_0xc659('0x88')](_0x45952e[_0xc659('0xc9')](_0x1dfdd6),{'individualHooks':!![]});}})['then'](function(){if(_0x17599e){return _0x17599e[_0xc659('0x28')]({'online':!![],'lastLoginAt':moment()[_0xc659('0xae')](_0xc659('0xfe')),'voicePause':_0x17599e[_0xc659('0xf1')]||![],'mailPause':_0x17599e[_0xc659('0xf1')]||![],'chatPause':_0x17599e['loginInPause']||![],'faxPause':_0x17599e[_0xc659('0xf1')]||![],'smsPause':_0x17599e['loginInPause']||![],'openchannelPause':_0x17599e[_0xc659('0xf1')]||![],'whatsappPause':_0x17599e[_0xc659('0xf1')]||![],'pauseType':_0x17599e[_0xc659('0xf1')]?_0xc659('0x102'):null,'interface':_0x1407fc,'lastPauseAt':moment()[_0xc659('0xae')](_0xc659('0xfe'))});}})[_0xc659('0x1e')](function(_0x1cd2c4){if(_0x457122[_0xc659('0x103')]){return _0xafe85f();}else{return Promise[_0xc659('0x104')](_0x1cd2c4)[_0xc659('0x1e')](respondWithResult(_0x4a6e6c,null));}})[_0xc659('0x27')](handleError(_0x4a6e6c,null));};exports['logout']=function(_0xe6595,_0x1d9bc7){var _0x1734d0;return db[_0xc659('0x3d')][_0xc659('0x38')]({'where':{'id':_0xe6595[_0xc659('0x5d')]['id'],'role':_0xc659('0x2a')},'attributes':['id',_0xc659('0x3b'),_0xc659('0x29')]})[_0xc659('0x1e')](handleEntityNotFound(_0x1d9bc7,null))['then'](function(_0x1f01ca){if(_0x1f01ca){_0x1734d0=_0x1f01ca;return db[_0xc659('0xb0')][_0xc659('0x2d')]({'where':{'membername':_0x1734d0[_0xc659('0x3b')]},'individualHooks':!![]});}})[_0xc659('0x1e')](function(){return db[_0xc659('0xfc')][_0xc659('0x51')]({'where':{'membername':_0x1734d0['name'],'exitAt':null}});})[_0xc659('0x1e')](function(_0x5107dc){var _0x4de144=[];_0x5107dc[_0xc659('0xfd')](function(_0x22f561){_0x4de144[_0xc659('0x50')](_0x22f561['update']({'exitAt':moment()[_0xc659('0xae')]('YYYY-MM-DD\x20HH:mm:ss')}));});return Promise[_0xc659('0x5b')](_0x4de144);})[_0xc659('0x1e')](function(){return _0x1734d0[_0xc659('0x28')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0xc659('0x1e')](respondWithResult(_0x1d9bc7,null))['catch'](handleError(_0x1d9bc7,null));};exports[_0xc659('0x105')]=function(_0x1da0e5,_0x4cfa0b){var _0x2824fe;return db['UserVoiceQueueRt'][_0xc659('0x28')]({'paused':0x1},{'where':{'UserId':_0x1da0e5[_0xc659('0x5d')]['id']},'individualHooks':!![]})[_0xc659('0x1e')](function(){return db['User'][_0xc659('0x38')]({'where':{'id':_0x1da0e5['params']['id'],'role':'agent'},'attributes':['id',_0xc659('0x3b'),_0xc659('0x29'),_0xc659('0x65'),_0xc659('0xa1'),'online']});})[_0xc659('0x1e')](handleEntityNotFound(_0x4cfa0b,null))['then'](function(_0x50b087){if(_0x50b087){_0x2824fe=_0x50b087;return respondWithRpcPromise(_0xc659('0x106'),'pause',{'id':_0x2824fe['id'],'name':_0x2824fe[_0xc659('0x3b')],'pause':!![]});}})[_0xc659('0x1e')](function(){if(_0x2824fe){return db[_0xc659('0xfc')][_0xc659('0x51')]({'where':{'membername':_0x2824fe[_0xc659('0x3b')],'type':_0xc659('0x107'),'exitAt':null}});}})[_0xc659('0x1e')](function(_0x14ab8e){if(_0x14ab8e[_0xc659('0x54')]){var _0x152627=moment()[_0xc659('0xae')](_0xc659('0xfe'));for(var _0x2bbde8=0x0,_0x103e04=_0x14ab8e[_0xc659('0x54')];_0x2bbde8<_0x103e04;_0x2bbde8++){_0x14ab8e[_0x2bbde8]['updateAttributes']({'exitAt':_0x152627});}}})[_0xc659('0x1e')](function(){var _0x450e14=[];var _0x1ad948=utils[_0xc659('0xff')]();_0x1ad948[_0xc659('0xfd')](function(_0x14525e){_0x450e14[_0xc659('0x50')]({'channel':_0x14525e,'membername':_0x2824fe[_0xc659('0x3b')],'interface':_[_0xc659('0x6a')](_0x2824fe['interface'])?util['format'](_0xc659('0xaf'),_0x2824fe['name']):_0x2824fe[_0xc659('0xa1')],'type':_0xc659('0x107'),'enterAt':moment()[_0xc659('0xae')](_0xc659('0xfe')),'data1':_0x1da0e5[_0xc659('0x61')][_0xc659('0x3f')]||_0xc659('0x108'),'role':_0x2824fe[_0xc659('0x29')],'internal':_0x2824fe[_0xc659('0x65')]});});return db[_0xc659('0xfc')][_0xc659('0x88')](_0x450e14,{'individualHooks':!![]});})[_0xc659('0x1e')](function(){return _0x2824fe[_0xc659('0x28')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x1da0e5[_0xc659('0x61')][_0xc659('0x3f')]||_0xc659('0x108'),'lastPauseAt':moment()[_0xc659('0xae')](_0xc659('0xfe'))});})[_0xc659('0x1e')](respondWithResult(_0x4cfa0b,null))['catch'](handleError(_0x4cfa0b,null));};exports['unpause']=function(_0xe2e5c7,_0x23ec0d){if(_0xe2e5c7[_0xc659('0x61')][_0xc659('0x9e')]&&!utils['isValidChannel'](_0xe2e5c7[_0xc659('0x61')]['channel'])){throw new APIBadRequestError(util[_0xc659('0xae')](_0xc659('0x109'),_0xe2e5c7[_0xc659('0x61')][_0xc659('0x9e')]));}return db['User'][_0xc659('0x38')]({'where':{'id':_0xe2e5c7[_0xc659('0x5d')]['id']},'attributes':['id',_0xc659('0x3b'),_0xc659('0x29'),'internal',_0xc659('0xa1'),_0xc659('0x9f'),_0xc659('0xa0'),_0xc659('0x10a'),'chatPause',_0xc659('0x10b'),_0xc659('0x10c'),_0xc659('0x10d'),_0xc659('0x10e'),'pauseType','lastPauseAt']})['then'](function(_0x15a800){if(!_0x15a800){throw new APINotFoundError(util[_0xc659('0xae')]('User\x20with\x20id\x20%s\x20not\x20found',_0xe2e5c7[_0xc659('0x5d')]['id']));}return _0x15a800[_0xc659('0x10f')](_0xe2e5c7[_0xc659('0x61')][_0xc659('0x9e')]);})[_0xc659('0x1e')](respondWithResult(_0x23ec0d,null))[_0xc659('0x27')](APIHandleError(_0x23ec0d));};exports[_0xc659('0x110')]=function(_0x161ca4,_0x13d45a){var _0x29a654={};var _0xbb94a9={};var _0x10eaf1;var _0x44a2c1;return db[_0xc659('0x3d')]['findOne']({'where':{'id':_0x161ca4[_0xc659('0x5d')]['id']}})['then'](handleEntityNotFound(_0x13d45a,null))['then'](function(_0x2895ed){if(_0x2895ed){_0x10eaf1=_0x2895ed;_0xbb94a9['model']=_['keys'](db[_0xc659('0x111')][_0xc659('0x3e')]);_0xbb94a9[_0xc659('0x49')]=_['keys'](_0x161ca4['query']);_0xbb94a9[_0xc659('0xd6')]=_[_0xc659('0xd7')](_0xbb94a9[_0xc659('0xd3')],_0xbb94a9[_0xc659('0x49')]);_0x29a654[_0xc659('0x4f')]=_[_0xc659('0xd7')](_0xbb94a9[_0xc659('0xd3')],qs[_0xc659('0xd8')](_0x161ca4[_0xc659('0x49')]['fields']));_0x29a654[_0xc659('0x4f')]=_0x29a654[_0xc659('0x4f')][_0xc659('0x54')]?_0x29a654['attributes']:_0xbb94a9[_0xc659('0xd3')];_0x29a654[_0xc659('0xd9')]=qs[_0xc659('0xda')](_0x161ca4[_0xc659('0x49')][_0xc659('0xda')]);_0x29a654[_0xc659('0x48')]=qs[_0xc659('0xd6')](_[_0xc659('0xdb')](_0x161ca4[_0xc659('0x49')],_0xbb94a9['filters']));if(_0x161ca4[_0xc659('0x49')][_0xc659('0x34')]){_0x29a654[_0xc659('0x48')]=_[_0xc659('0x5e')](_0x29a654['where'],{'$or':_[_0xc659('0x36')](_0x29a654[_0xc659('0x4f')],function(_0x2029ef){var _0x589f1a={};_0x589f1a[_0x2029ef]={'$like':'%'+_0x161ca4[_0xc659('0x49')][_0xc659('0x34')]+'%'};return _0x589f1a;})});}_0x29a654=_[_0xc659('0x5e')]({},_0x29a654,_0x161ca4[_0xc659('0x5f')]);return _0x10eaf1[_0xc659('0x110')](_0x29a654);}})[_0xc659('0x1e')](function(_0x54912b){if(_0x54912b){_0x44a2c1=_0x54912b[_0xc659('0x54')];if(!_0x161ca4[_0xc659('0x49')][_0xc659('0xcc')](_0xc659('0xde'))){_0x29a654[_0xc659('0x1a')]=qs[_0xc659('0x1a')](_0x161ca4[_0xc659('0x49')][_0xc659('0x1a')]);_0x29a654[_0xc659('0x18')]=qs[_0xc659('0x18')](_0x161ca4[_0xc659('0x49')][_0xc659('0x18')]);}return _0x10eaf1['getTeams'](_0x29a654);}})[_0xc659('0x1e')](function(_0x1c9143){if(_0x1c9143){return _0x1c9143?{'count':_0x44a2c1,'rows':_0x1c9143}:null;}})['then'](respondWithResult(_0x13d45a,null))[_0xc659('0x27')](handleError(_0x13d45a,null));};exports[_0xc659('0x112')]=function(_0x5a7a00,_0x5d7936){var _0x3f355f=_0x5a7a00[_0xc659('0x5d')]['id'];var _0x49f294=_0x5a7a00[_0xc659('0x61')]?_0x5a7a00[_0xc659('0x61')][_0xc659('0xa7')]:null;var _0x50983a=[];return Promise[_0xc659('0x104')]()['then'](function(){if(!_0x49f294)throw new APIBadRequestError(_0xc659('0x113'));})[_0xc659('0x1e')](function(){return db[_0xc659('0x3d')][_0xc659('0x97')]({'where':{'id':_0x3f355f}});})[_0xc659('0x1e')](function(_0x19f4fc){if(!_0x19f4fc)throw new APINotFoundError(util['format']('User\x20with\x20id\x20%s\x20not\x20found',_0x5a7a00[_0xc659('0x5d')]['id']));return db[_0xc659('0x6c')]['transaction'](function(_0x1a744a){return _0x19f4fc[_0xc659('0x112')](_0x49f294,{'transaction':_0x1a744a})[_0xc659('0x1e')](function(){return db[_0xc659('0x111')][_0xc659('0x51')]({'where':{'id':{'$in':_0x49f294}}});})['then'](function(_0x2f2ab2){var _0x34ff74=_['map'](_0x2f2ab2,function(_0x3c15e5){return _0x3c15e5[_0xc659('0x114')]();});return Promise[_0xc659('0x5b')](_0x34ff74);})[_0xc659('0x1e')](function(_0x5b4f9c){_0x50983a=_[_0xc659('0x115')](_0x5b4f9c);var _0x1e105c=_[_0xc659('0x36')](_0x50983a,function(_0x357f29){return _0x357f29[_0xc659('0x116')](_0x19f4fc['id'],{'transaction':_0x1a744a});});return Promise[_0xc659('0x5b')](_0x1e105c);})[_0xc659('0x1e')](function(){if(!_0x19f4fc[_0xc659('0x9f')])return;var _0x355ea9=_[_0xc659('0x34')](_0x50983a,function(_0x5e2462){return _0x5e2462['getDataValue'](_0xc659('0x9e'))===_0xc659('0x117');});var _0x207f90=_[_0xc659('0x36')](_0x355ea9,function(_0x52ca73){return db[_0xc659('0xb0')][_0xc659('0x118')]({'membername':_0x19f4fc[_0xc659('0x3b')],'UserId':_0x19f4fc['id'],'queue_name':_0x52ca73[_0xc659('0x3b')],'VoiceQueueId':_0x52ca73['id'],'interface':_[_0xc659('0x6a')](_0x19f4fc[_0xc659('0xa1')])?util[_0xc659('0xae')](_0xc659('0xaf'),_0x19f4fc[_0xc659('0x3b')]):_0x19f4fc[_0xc659('0xa1')],'paused':_0x19f4fc[_0xc659('0xa0')]||![],'penalty':_0x19f4fc[_0xc659('0xa8')]},{'transaction':_0x1a744a});});return Promise[_0xc659('0x5b')](_0x207f90);})[_0xc659('0x1e')](function(){return db[_0xc659('0x119')][_0xc659('0x51')]({'where':{'teamId':{'$in':_0x49f294}}});})[_0xc659('0x1e')](function(_0x513630){var _0x2507f6=_['map'](_0x513630,function(_0x2710df){return db['UserVoicePrefix'][_0xc659('0x81')]({'UserId':_0x19f4fc['id'],'VoicePrefixId':_0x2710df[_0xc659('0x11a')]},{'transaction':_0x1a744a});});return Promise[_0xc659('0x5b')](_0x2507f6);});});})[_0xc659('0x1e')](function(){for(var _0x99f50a=0x0;_0x99f50a<_0x50983a[_0xc659('0x54')];_0x99f50a++){var _0x45496a=_0x50983a[_0x99f50a][_0xc659('0x11b')]('channel');var _0x30c57a=_0x45496a+_0xc659('0xaa');socket[_0xc659('0x2b')](_0xc659('0x31')+_0x45496a+_0xc659('0xab'),{'UserId':_0x3f355f,['queueField']:_0x50983a[_0x99f50a]['id']});}})[_0xc659('0x1e')](respondWithStatusCode(_0x5d7936,null))[_0xc659('0x27')](APIHandleError(_0x5d7936));};exports['removeTeams']=function(_0x3a54e8,_0x4bde50){var _0x19d0ef=_0x3a54e8[_0xc659('0x5d')]['id'];var _0x59cd6d=null;if(_0x3a54e8['query'][_0xc659('0xa7')]){_0x59cd6d=_[_0xc659('0xb3')](_0x3a54e8[_0xc659('0x49')][_0xc659('0xa7')])?_0x3a54e8['query'][_0xc659('0xa7')]:[_0x3a54e8[_0xc659('0x49')][_0xc659('0xa7')]];}var _0x4daa42=[];return Promise['resolve']()[_0xc659('0x1e')](function(){if(!_0x59cd6d)throw new APIBadRequestError('Query\x20parameter\x20\x27ids\x27\x20is\x20required');})[_0xc659('0x1e')](function(){return db[_0xc659('0x3d')][_0xc659('0x97')]({'where':{'id':_0x19d0ef}});})[_0xc659('0x1e')](function(_0xeafc11){if(!_0xeafc11)throw new APINotFoundError(util[_0xc659('0xae')]('User\x20with\x20id\x20%s\x20not\x20found',_0x3a54e8[_0xc659('0x5d')]['id']));return db[_0xc659('0x6c')][_0xc659('0x11c')](function(_0x378ccc){return _0xeafc11[_0xc659('0x11d')](_0x59cd6d,{'transaction':_0x378ccc})['then'](function(){return db[_0xc659('0x111')][_0xc659('0x51')]({'where':{'id':{'$in':_0x59cd6d}}});})[_0xc659('0x1e')](function(_0x37816b){var _0x4fc19c=_[_0xc659('0x36')](_0x37816b,function(_0x3e82bc){return _0x3e82bc['getAssociatedQueues']();});return Promise[_0xc659('0x5b')](_0x4fc19c);})['then'](function(_0x54ebbc){_0x4daa42=_[_0xc659('0x115')](_0x54ebbc);var _0x45a3f8=_[_0xc659('0x36')](_0x4daa42,function(_0x59c381){return _0x59c381[_0xc659('0x11e')](_0xeafc11['id'],{'transaction':_0x378ccc});});return Promise['all'](_0x45a3f8);})[_0xc659('0x1e')](function(){if(!_0xeafc11[_0xc659('0x9f')])return;var _0x34d196=_['filter'](_0x4daa42,function(_0x272068){return _0x272068[_0xc659('0x11b')](_0xc659('0x9e'))==='Voice';});var _0x481cc8=_[_0xc659('0x36')](_0x34d196,function(_0x80b2a7){return db['UserVoiceQueueRt'][_0xc659('0x2d')]({'where':{'VoiceQueueId':_0x80b2a7['id'],'UserId':_0xeafc11['id']},'transaction':_0x378ccc});});return Promise[_0xc659('0x5b')](_0x481cc8);})[_0xc659('0x1e')](function(){return db[_0xc659('0x119')][_0xc659('0x51')]({'where':{'teamId':{'$in':_0x59cd6d}}});})[_0xc659('0x1e')](function(_0x2417ec){var _0x41f8e2=_[_0xc659('0x36')](_0x2417ec,function(_0x56d76c){return db['UserVoicePrefix'][_0xc659('0x2d')]({'where':{'UserId':_0xeafc11['id'],'VoicePrefixId':_0x56d76c[_0xc659('0x11a')]}},{'transaction':_0x378ccc});});return Promise['all'](_0x41f8e2);});});})[_0xc659('0x1e')](function(){for(var _0x520932=0x0;_0x520932<_0x4daa42[_0xc659('0x54')];_0x520932++){var _0x1dea1f=_0x4daa42[_0x520932][_0xc659('0x11b')](_0xc659('0x9e'));var _0x54c6c4=_0x1dea1f+'QueueId';socket[_0xc659('0x2b')](_0xc659('0x31')+_0x1dea1f+'Queue:remove',{'UserId':_0x19d0ef,['queueField']:_0x4daa42[_0x520932]['id']});}})[_0xc659('0x1e')](respondWithStatusCode(_0x4bde50,null))[_0xc659('0x27')](APIHandleError(_0x4bde50));};exports[_0xc659('0x11f')]=function(_0x2314d5,_0x28f9a1){var _0x1da0f7={};var _0x4bfc4f={};var _0x480347;var _0x4c7760;return db[_0xc659('0x3d')][_0xc659('0x97')]({'where':{'id':_0x2314d5[_0xc659('0x5d')]['id']}})[_0xc659('0x1e')](handleEntityNotFound(_0x28f9a1,null))[_0xc659('0x1e')](function(_0x2f88f7){if(_0x2f88f7){_0x480347=_0x2f88f7;_0x4bfc4f[_0xc659('0xd3')]=_[_0xc659('0xd4')](db['CmList']['rawAttributes']);_0x4bfc4f[_0xc659('0x49')]=_['keys'](_0x2314d5[_0xc659('0x49')]);_0x4bfc4f[_0xc659('0xd6')]=_[_0xc659('0xd7')](_0x4bfc4f[_0xc659('0xd3')],_0x4bfc4f[_0xc659('0x49')]);_0x1da0f7[_0xc659('0x4f')]=_[_0xc659('0xd7')](_0x4bfc4f['model'],qs[_0xc659('0xd8')](_0x2314d5[_0xc659('0x49')]['fields']));_0x1da0f7[_0xc659('0x4f')]=_0x1da0f7[_0xc659('0x4f')][_0xc659('0x54')]?_0x1da0f7[_0xc659('0x4f')]:_0x4bfc4f[_0xc659('0xd3')];_0x1da0f7[_0xc659('0xd9')]=qs[_0xc659('0xda')](_0x2314d5[_0xc659('0x49')][_0xc659('0xda')]);_0x1da0f7[_0xc659('0x48')]=qs[_0xc659('0xd6')](_[_0xc659('0xdb')](_0x2314d5[_0xc659('0x49')],_0x4bfc4f[_0xc659('0xd6')]));if(_0x2314d5[_0xc659('0x49')][_0xc659('0x34')]){_0x1da0f7[_0xc659('0x48')]=_['merge'](_0x1da0f7['where'],{'$or':_[_0xc659('0x36')](_0x1da0f7[_0xc659('0x4f')],function(_0xcf954){var _0x405e39={};_0x405e39[_0xcf954]={'$like':'%'+_0x2314d5[_0xc659('0x49')][_0xc659('0x34')]+'%'};return _0x405e39;})});}_0x1da0f7=_[_0xc659('0x5e')]({},_0x1da0f7,_0x2314d5['options']);return _0x480347[_0xc659('0x11f')](_0x1da0f7);}})['then'](function(_0x3963ea){if(_0x3963ea){_0x4c7760=_0x3963ea[_0xc659('0x54')];if(!_0x2314d5['query']['hasOwnProperty']('nolimit')){_0x1da0f7['limit']=qs[_0xc659('0x1a')](_0x2314d5[_0xc659('0x49')][_0xc659('0x1a')]);_0x1da0f7['offset']=qs[_0xc659('0x18')](_0x2314d5[_0xc659('0x49')][_0xc659('0x18')]);}return _0x480347[_0xc659('0x11f')](_0x1da0f7);}})[_0xc659('0x1e')](function(_0x3b6d53){if(_0x3b6d53){return _0x3b6d53?{'count':_0x4c7760,'rows':_0x3b6d53}:null;}})[_0xc659('0x1e')](respondWithResult(_0x28f9a1,null))[_0xc659('0x27')](handleError(_0x28f9a1,null));};exports[_0xc659('0x120')]=function(_0x12df1c,_0x4c01f7){var _0x5c7cbe={};var _0x4c537f={};var _0x1e6b5d;return db[_0xc659('0x3d')][_0xc659('0x97')]({'where':{'id':_0x12df1c[_0xc659('0x5d')]['id']}})[_0xc659('0x1e')](handleEntityNotFound(_0x4c01f7,null))['then'](function(_0x42df22){if(_0x42df22){_0x1e6b5d=_0x42df22;_0x4c537f[_0xc659('0xd3')]=_[_0xc659('0xd4')](db['User'][_0xc659('0x3e')]);_0x4c537f['query']=_[_0xc659('0xd4')](_0x12df1c[_0xc659('0x49')]);_0x4c537f[_0xc659('0xd6')]=_['intersection'](_0x4c537f[_0xc659('0xd3')],_0x4c537f['query']);_0x5c7cbe[_0xc659('0x4f')]=_[_0xc659('0xd7')](_0x4c537f[_0xc659('0xd3')],qs[_0xc659('0xd8')](_0x12df1c[_0xc659('0x49')][_0xc659('0xd8')]));_0x5c7cbe[_0xc659('0x4f')]=_0x5c7cbe['attributes']['length']?_0x5c7cbe['attributes']:_0x4c537f[_0xc659('0xd3')];_0x5c7cbe[_0xc659('0xd9')]=qs[_0xc659('0xda')](_0x12df1c[_0xc659('0x49')]['sort']);_0x5c7cbe[_0xc659('0x48')]=qs[_0xc659('0xd6')](_[_0xc659('0xdb')](_0x12df1c['query'],_0x4c537f[_0xc659('0xd6')]));if(_0x12df1c[_0xc659('0x49')][_0xc659('0x34')]){_0x5c7cbe[_0xc659('0x48')]=_['merge'](_0x5c7cbe[_0xc659('0x48')],{'$or':_[_0xc659('0x36')](_0x5c7cbe[_0xc659('0x4f')],function(_0xcd591a){var _0x5c17de={};_0x5c17de[_0xcd591a]={'$like':'%'+_0x12df1c[_0xc659('0x49')][_0xc659('0x34')]+'%'};return _0x5c17de;})});}_0x5c7cbe[_0xc659('0xd3')]=db[_0xc659('0x3d')];_0x5c7cbe['as']=_0xc659('0x32');_0x5c7cbe=_['merge']({},_0x5c7cbe,_0x12df1c['options']);return _0x1e6b5d[_0xc659('0xfa')]({'include':[_0x5c7cbe]});}})['then'](function(_0x3541c6){if(_0x3541c6){var _0x17cd04={},_0x15ad3b=[];for(var _0x334050=0x0;_0x334050<_0x3541c6[_0xc659('0x54')];_0x334050+=0x1){for(var _0x29430e=0x0,_0x9ce512;_0x29430e<_0x3541c6[_0x334050][_0xc659('0x32')][_0xc659('0x54')];_0x29430e+=0x1){_0x9ce512=_0x3541c6[_0x334050]['Agents'][_0x29430e]['get']({'plain':!![]});_0x17cd04[_0x9ce512['id']]=_0x9ce512;}}_0x17cd04=_[_0xc659('0x121')](_0x17cd04);for(var _0xc5daef=qs[_0xc659('0x18')](_0x12df1c[_0xc659('0x49')][_0xc659('0x18')]);_0xc5daef<_0x17cd04[_0xc659('0x54')]&&_0x15ad3b[_0xc659('0x54')]=_0x23a851){_0x22fb1f=_0x23a851;_0xdba2e0=0xc8;}else{_0xdba2e0=0xce;}_0x3c178d[_0x9f18('0x1c')](_0xdba2e0);return _0x3c178d[_0x9f18('0x21')]('Content-Range',_0x185937+'-'+_0x22fb1f+'/'+_0x23a851)[_0x9f18('0x22')](_0x247d15);}return null;};}function respondWithRpcPromise(_0x193427,_0x1a2acf,_0x56b761,_0x1ea2a5){return new Promise(function(_0x3fd283,_0x2f5377){var _0x287058=_0x1ea2a5||amiClient;return _0x287058[_0x9f18('0x23')](_0x193427,_0x56b761)['then'](function(_0x30a5d5){logger[_0x9f18('0x24')](_0x9f18('0x25'),_0x1a2acf,_0x9f18('0x26'));logger['debug'](_0x9f18('0x27'),_0x1a2acf,_0x9f18('0x26'),JSON[_0x9f18('0x28')](_0x30a5d5));if(_0x30a5d5[_0x9f18('0x29')]){if(_0x30a5d5[_0x9f18('0x29')][_0x9f18('0x2a')]===0x1f4){logger[_0x9f18('0x29')](_0x9f18('0x25'),_0x1a2acf,_0x30a5d5['error'][_0x9f18('0x2b')]);return _0x2f5377(_0x30a5d5['error']['message']);}logger['error']('User,\x20%s,\x20%s',_0x1a2acf,_0x30a5d5[_0x9f18('0x29')]['message']);return _0x3fd283(_0x30a5d5[_0x9f18('0x29')]['message']);}else{logger[_0x9f18('0x24')](_0x9f18('0x25'),_0x1a2acf,_0x9f18('0x26'));_0x3fd283(_0x30a5d5[_0x9f18('0x2c')][_0x9f18('0x2b')]);}})['catch'](function(_0x41e508){logger[_0x9f18('0x29')]('User,\x20%s,\x20%s',_0x1a2acf,_0x41e508);_0x2f5377(_0x41e508);});});}function saveUpdates(_0x127604){return function(_0x166bec){if(_0x166bec){return _0x166bec[_0x9f18('0x2d')](_0x127604)['then'](function(_0x35c79a){if(_0x35c79a[_0x9f18('0x2e')]===_0x9f18('0x2f')){socket[_0x9f18('0x30')](_0x9f18('0x31')+_0x35c79a['id'],_0x35c79a);}return _0x35c79a;});}return null;};}function removeEntity(_0x2b4d10,_0x3c229e){return function(_0x2b8500){if(_0x2b8500){return _0x2b8500[_0x9f18('0x32')]({'transaction':_0x3c229e})['then'](function(){var _0x2535d5=_0x2b8500[_0x9f18('0x33')]({'plain':!![]});if(_0x2535d5['role']===_0x9f18('0x34'))return;var _0x2d350a=[{'name':_0x9f18('0x35'),'value':_0x9f18('0x36'),'ignore':!![]},{'name':_0x9f18('0x37'),'value':_0x9f18('0x2f'),'ignore':![]},{'name':_0x9f18('0x38'),'value':'telephone','ignore':![]}];var _0x28f58f=_(_0x2d350a)[_0x9f18('0x39')](_0x9f18('0x3a'))[_0x9f18('0x3b')](_0x9f18('0x3c'))[_0x9f18('0x3c')]();if(_[_0x9f18('0x3d')](_0x28f58f,_0x2535d5[_0x9f18('0x2e')])){return;}var _0x333f7c=_[_0x9f18('0x3e')](_0x2d350a,['value',_0x2535d5[_0x9f18('0x2e')]])['name'];return db[_0x9f18('0x3f')]['destroy']({'where':{'type':_0x333f7c,'resourceId':_0x2535d5['id']},'transaction':_0x3c229e})['then'](function(){return _0x2b8500;});})[_0x9f18('0x40')](function(){_0x2b4d10[_0x9f18('0x1c')](0xcc)[_0x9f18('0x1b')]();});}};}function handleEntityNotFound(_0x1c5790){return function(_0x4d2596){if(!_0x4d2596){_0x1c5790['sendStatus'](0x194);}return _0x4d2596;};}function handleError(_0x340c6b,_0x3bb90e){_0x3bb90e=_0x3bb90e||0x1f4;return function(_0x530d9c){logger['error'](_0x530d9c[_0x9f18('0x41')]);if(_0x530d9c[_0x9f18('0x42')]){delete _0x530d9c[_0x9f18('0x42')];}_0x340c6b['status'](_0x3bb90e)['send'](_0x530d9c);};}function getUserAttributes(){return _(db[_0x9f18('0x43')][_0x9f18('0x44')])['map'](function(_0x2ba124){return{'name':_0x2ba124[_0x9f18('0x45')],'type':_0x2ba124[_0x9f18('0x46')][_0x9f18('0x47')]};})[_0x9f18('0x39')](function(_0x1dc33e){return![_0x9f18('0x48'),_0x9f18('0x49'),_0x9f18('0x4a'),'resetPasswordToken',_0x9f18('0x4b'),_0x9f18('0x4c')]['includes'](_0x1dc33e[_0x9f18('0x42')]);})[_0x9f18('0x3c')]();}exports[_0x9f18('0x4d')]=function(_0x16b441,_0x49ffbe){var _0xa95968={},_0x21825f={'count':0x0,'rows':[]};var _0x103c3e=getUserAttributes();_0xa95968=qs[_0x9f18('0x4e')](_0x103c3e,_0x16b441);var _0x4ca263={'where':_0xa95968[_0x9f18('0x4f')]};return db['User'][_0x9f18('0x1f')](_0x4ca263)[_0x9f18('0x40')](function(_0x275112){_0x21825f[_0x9f18('0x1f')]=_0x275112;if(_0x16b441[_0x9f18('0x50')]['includeAll']){_0xa95968[_0x9f18('0x51')]=[{'all':!![]}];}if(_0x16b441[_0x9f18('0x50')][_0x9f18('0x52')]===_0x9f18('0x53')){_0xa95968[_0x9f18('0x51')]=[{'model':db[_0x9f18('0x54')],'as':_0x9f18('0x52')}];}if(!_[_0x9f18('0x3d')](_0xa95968['attributes'],'id')){_0xa95968[_0x9f18('0x55')][_0x9f18('0x56')]('id');}return db['User'][_0x9f18('0x57')](_0xa95968);})[_0x9f18('0x40')](function(_0x158736){_0x21825f[_0x9f18('0x58')]=_0x158736;if(_0x16b441[_0x9f18('0x50')][_0x9f18('0x59')]===_0x9f18('0x53')){var _0x4f80d5=[];for(var _0x17cdf0=0x0;_0x17cdf0<_0x21825f[_0x9f18('0x58')][_0x9f18('0x5a')];_0x17cdf0++){_0x4f80d5['push'](get_open_tabs(_0x9f18('0x5b'),_0x21825f[_0x9f18('0x58')][_0x17cdf0][_0x9f18('0x5c')]));_0x4f80d5[_0x9f18('0x56')](get_open_tabs('sms',_0x21825f[_0x9f18('0x58')][_0x17cdf0][_0x9f18('0x5c')]));_0x4f80d5[_0x9f18('0x56')](get_open_tabs(_0x9f18('0x5d'),_0x21825f[_0x9f18('0x58')][_0x17cdf0]['dataValues']));_0x4f80d5['push'](get_open_tabs(_0x9f18('0x5e'),_0x21825f[_0x9f18('0x58')][_0x17cdf0][_0x9f18('0x5c')]));_0x4f80d5[_0x9f18('0x56')](get_open_tabs(_0x9f18('0x5f'),_0x21825f['rows'][_0x17cdf0][_0x9f18('0x5c')]));_0x4f80d5['push'](get_open_tabs(_0x9f18('0x60'),_0x21825f['rows'][_0x17cdf0]['dataValues']));}return Promise['all'](_0x4f80d5)[_0x9f18('0x40')](function(){return _0x21825f;});}else{return _0x21825f;}})['then'](respondWithFilteredResult(_0x49ffbe,_0xa95968))['catch'](handleError(_0x49ffbe,null));};exports['show']=function(_0xcf5dc5,_0x50c33f){var _0x2c0424=getUserAttributes();_0xcf5dc5['query']['id']=_0xcf5dc5[_0x9f18('0x61')]['id'];var _0x4691e9=qs[_0x9f18('0x4e')](_0x2c0424,_0xcf5dc5);if(_0xcf5dc5[_0x9f18('0x50')][_0x9f18('0x62')]){_0x4691e9[_0x9f18('0x51')]=[{'all':!![]}];}if(_0xcf5dc5[_0x9f18('0x50')][_0x9f18('0x52')]===_0x9f18('0x53')){_0x4691e9['include']=[{'model':db[_0x9f18('0x54')],'as':'userSetting'}];}_0x4691e9=_[_0x9f18('0x63')]({},_0x4691e9,_0xcf5dc5[_0x9f18('0x64')]);if(!_[_0x9f18('0x3d')](_0x4691e9['attributes'],'id')){_0x4691e9[_0x9f18('0x55')][_0x9f18('0x56')]('id');}return db['User'][_0x9f18('0x3e')](_0x4691e9)[_0x9f18('0x40')](handleEntityNotFound(_0x50c33f,null))[_0x9f18('0x40')](function(_0x35d1ed){var _0x4e3102=[];values=_0x35d1ed;if(_0xcf5dc5['query'][_0x9f18('0x59')]===_0x9f18('0x53')){_0x4e3102['push'](get_open_tabs(_0x9f18('0x5b'),_0x35d1ed[_0x9f18('0x5c')]));_0x4e3102[_0x9f18('0x56')](get_open_tabs('sms',_0x35d1ed[_0x9f18('0x5c')]));_0x4e3102[_0x9f18('0x56')](get_open_tabs(_0x9f18('0x5f'),_0x35d1ed[_0x9f18('0x5c')]));_0x4e3102[_0x9f18('0x56')](get_open_tabs(_0x9f18('0x60'),_0x35d1ed[_0x9f18('0x5c')]));_0x4e3102[_0x9f18('0x56')](get_open_tabs('fax',_0x35d1ed[_0x9f18('0x5c')]));_0x4e3102[_0x9f18('0x56')](get_open_tabs(_0x9f18('0x5e'),_0x35d1ed[_0x9f18('0x5c')]));return Promise['all'](_0x4e3102);}else{return values;}})[_0x9f18('0x40')](function(){return values;})[_0x9f18('0x40')](respondWithResult(_0x50c33f,null))[_0x9f18('0x65')](handleError(_0x50c33f,null));};exports[_0x9f18('0x2d')]=function(_0x309df6,_0x1f6b25){if(_0x309df6[_0x9f18('0x66')]['id']){delete _0x309df6['body']['id'];}delete _0x309df6['body'][_0x9f18('0x2e')];return db[_0x9f18('0x43')][_0x9f18('0x3e')]({'where':{'id':_0x309df6['params']['id']}})[_0x9f18('0x40')](handleEntityNotFound(_0x1f6b25,null))[_0x9f18('0x40')](saveUpdates(_0x309df6['body'],null))['then'](respondWithResult(_0x1f6b25,null))['catch'](handleError(_0x1f6b25,null));};exports[_0x9f18('0x67')]=function(_0x4d094b,_0x5186ea){return db[_0x9f18('0x43')][_0x9f18('0x67')]()[_0x9f18('0x40')](respondWithResult(_0x5186ea,null))['catch'](handleError(_0x5186ea,null));};exports[_0x9f18('0x68')]=function(_0x32ccf0,_0x4a4173){return db[_0x9f18('0x43')]['find']({'where':{'id':_0x32ccf0['params']['id']}})[_0x9f18('0x40')](handleEntityNotFound(_0x4a4173,null))[_0x9f18('0x40')](function(_0x4eb48d){if(_0x4eb48d){return _0x4eb48d[_0x9f18('0x68')](_0x32ccf0['body'][_0x9f18('0x69')],_[_0x9f18('0x6a')](_0x32ccf0['body'],[_0x9f18('0x69'),'id'])||{});}})[_0x9f18('0x40')](respondWithResult(_0x4a4173,null))['catch'](handleError(_0x4a4173,null));};function validateUser(_0x300830){return new Promise(function(_0x166063,_0x251a4b){if(_0x300830[_0x9f18('0x6b')])return _0x166063(_0x300830);return db['Setting'][_0x9f18('0x6c')](0x1)['then'](function(_0x2691c0){if(_0x2691c0[_0x9f18('0x6d')])authService[_0x9f18('0x6e')](_0x300830[_0x9f18('0x48')]);db[_0x9f18('0x43')][_0x9f18('0x6f')](_0x9f18('0x6b'))[_0x9f18('0x40')](function(_0x5e6532){if(_['isNil'](_0x5e6532)){_0x300830[_0x9f18('0x6b')]=_0x2691c0['min_internal']||0x1;return;}if(_[_0x9f18('0x70')](_0x2691c0[_0x9f18('0x71')])||_0x2691c0['min_internal']===_0x5e6532){_0x300830[_0x9f18('0x6b')]=_0x5e6532+0x1;return;}if(_0x2691c0[_0x9f18('0x71')]>_0x5e6532){_0x300830[_0x9f18('0x6b')]=_0x2691c0['min_internal'];return;}return db['sequelize']['query']('select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)',{'type':db['sequelize']['QueryTypes'][_0x9f18('0x72')]})[_0x9f18('0x40')](function(_0x58984c){if(_0x58984c&&_0x58984c[_0x9f18('0x5a')]){for(var _0x286abd=0x0,_0x2e0678=_0x58984c[_0x9f18('0x5a')];_0x286abd<_0x2e0678&&_[_0x9f18('0x70')](_0x300830['internal']);_0x286abd++){if(_0x2691c0[_0x9f18('0x71')]<=_0x58984c[_0x286abd][_0x9f18('0x73')]){_0x300830['internal']=_0x58984c[_0x286abd][_0x9f18('0x73')];}else if(_0x2691c0[_0x9f18('0x71')]>_0x58984c[_0x286abd]['from']&&_0x2691c0[_0x9f18('0x71')]<=_0x58984c[_0x286abd]['to']){_0x300830[_0x9f18('0x6b')]=_0x2691c0[_0x9f18('0x71')];}}}if(_[_0x9f18('0x70')](_0x300830[_0x9f18('0x6b')])){_0x300830[_0x9f18('0x6b')]=_0x5e6532+0x1;}return _0x166063(_0x300830);});});})[_0x9f18('0x65')](function(_0x12b8c){_0x251a4b(_0x12b8c);});});}function updateUser(_0xdce6ef){return new Promise(function(_0x27046e,_0x531196){try{if(_0xdce6ef[_0x9f18('0x74')]){_0xdce6ef[_0x9f18('0x75')]=_0xdce6ef[_0x9f18('0x6b')];_0xdce6ef['VoiceMail']={'mailbox':_0xdce6ef[_0x9f18('0x6b')],'password':_0xdce6ef[_0x9f18('0x48')],'fullname':_0xdce6ef[_0x9f18('0x76')],'email':_0xdce6ef[_0x9f18('0x77')]};}if(_0xdce6ef['role']===_0x9f18('0x2f')){if(!_0xdce6ef['permissions'])_0xdce6ef[_0x9f18('0x78')]=['101',_0x9f18('0x79'),_0x9f18('0x7a'),_0x9f18('0x7b'),'110',_0x9f18('0x7c'),_0x9f18('0x7d'),_0x9f18('0x7e'),_0x9f18('0x7f'),_0x9f18('0x80'),_0x9f18('0x81'),'100','111',_0x9f18('0x82'),_0x9f18('0x83')];}_0x27046e(_0xdce6ef);}catch(_0x2e6e3e){_0x531196(_0x2e6e3e);}});}exports['create']=function(_0x372312,_0x465053){if(_0x372312[_0x9f18('0x36')][_0x9f18('0x2e')]==='agent')throw new Error(_0x9f18('0x84'));if(_0x372312[_0x9f18('0x66')][_0x9f18('0x2e')]===_0x9f18('0x36')&&_0x372312[_0x9f18('0x36')][_0x9f18('0x2e')]!==_0x9f18('0x34')){throw new Error(_0x9f18('0x85'));}if(_0x372312[_0x9f18('0x66')][_0x9f18('0x2e')]===_0x9f18('0x34')&&_0x372312[_0x9f18('0x36')][_0x9f18('0x2e')]!==_0x9f18('0x34')){throw new Error(_0x9f18('0x86'));}return licenseUtil[_0x9f18('0x87')]([_0x372312[_0x9f18('0x66')]])['then'](function(){return validateUser(_0x372312['body']);})['then'](function(_0x389cf1){return updateUser(_0x389cf1)[_0x9f18('0x40')](function(_0x1f1344){if(_0x1f1344[_0x9f18('0x2e')]==='admin'){_0x1f1344[_0x9f18('0x88')]=_0x372312[_0x9f18('0x36')][_0x9f18('0x88')];delete _0x1f1344['userProfileId'];}return _0x1f1344;});})['then'](function(_0x190b06){return db['User'][_0x9f18('0x89')](_0x190b06,{'include':[{'model':db['VoiceMail'],'as':_0x9f18('0x8a')}]});})[_0x9f18('0x40')](function(_0x448c7f){if(_0x372312[_0x9f18('0x66')][_0x9f18('0x2e')]===_0x9f18('0x36'))return _0x448c7f;if(_0x372312['user']['role']!==_0x9f18('0x36'))return _0x448c7f;return db[_0x9f18('0x8b')][_0x9f18('0x3e')]({'where':{'name':_0x448c7f[_0x9f18('0x2e')]===_0x9f18('0x2f')?_0x9f18('0x37'):_0x9f18('0x38'),'userProfileId':_0x372312[_0x9f18('0x36')][_0x9f18('0x8c')]},'raw':!![]})[_0x9f18('0x40')](function(_0x170ead){if(!_0x170ead||_0x170ead[_0x9f18('0x8d')]!=0x0)return _0x448c7f;return db[_0x9f18('0x3f')][_0x9f18('0x89')]({'name':_0x448c7f['name'],'resourceId':_0x448c7f['id'],'type':_0x170ead[_0x9f18('0x42')],'sectionId':_0x170ead['id']},{})[_0x9f18('0x40')](function(){return _0x448c7f;});})[_0x9f18('0x65')](function(_0x4aaaa6){logger['error'](_0x9f18('0x8e'),_0x4aaaa6);throw _0x4aaaa6;});})[_0x9f18('0x40')](respondWithResult(_0x465053,0xc9))[_0x9f18('0x65')](handleError(_0x465053,null));};exports[_0x9f18('0x8f')]=function(_0x2f4425,_0xdc8c7c){var _0x2fe72a=_0x2f4425[_0x9f18('0x66')];var _0x59cc30=[];if(_0x2f4425[_0x9f18('0x36')]['role']==='agent')throw new Error(_0x9f18('0x84'));if(_['some'](_0x2fe72a,[_0x9f18('0x2e'),'user'])&&_0x2f4425['user'][_0x9f18('0x2e')]!==_0x9f18('0x34')){throw new Error(_0x9f18('0x85'));}if(_[_0x9f18('0x90')](_0x2fe72a,['role',_0x9f18('0x34')])&&_0x2f4425[_0x9f18('0x36')][_0x9f18('0x2e')]!==_0x9f18('0x34')){throw new Error(_0x9f18('0x91'));}return licenseUtil[_0x9f18('0x87')](_0x2fe72a)[_0x9f18('0x40')](function(){return validateUser(_0x2fe72a[0x0]);})[_0x9f18('0x40')](function(){for(var _0x149062=0x1;_0x149062<_0x2fe72a[_0x9f18('0x5a')];_0x149062++){var _0x1bc075=_0x2fe72a[_0x149062-0x1]['internal'];if(!_0x2fe72a[_0x149062][_0x9f18('0x6b')])_0x2fe72a[_0x149062][_0x9f18('0x6b')]=_0x1bc075+0x1;_0x59cc30[_0x9f18('0x56')](validateUser(_0x2fe72a[_0x149062]));}return Promise[_0x9f18('0x92')](_0x59cc30);})[_0x9f18('0x40')](function(){_0x59cc30=[];for(var _0x2b78a6=0x0;_0x2b78a6<_0x2fe72a[_0x9f18('0x5a')];_0x2b78a6++){_0x59cc30[_0x9f18('0x56')](updateUser(_0x2fe72a[_0x2b78a6]));}return Promise['all'](_0x59cc30);})['then'](function(){_0x59cc30=_0x2fe72a[_0x9f18('0x3b')](function(_0x346ece){return db['User'][_0x9f18('0x89')](_0x346ece,{'include':[{'model':db[_0x9f18('0x8a')],'as':'VoiceMail'}]})[_0x9f18('0x40')](function(_0x5f2040){_0x346ece['id']=_0x5f2040['id'];return _0x346ece;});});return Promise[_0x9f18('0x92')](_0x59cc30);})['then'](function(_0x5448fa){if(_0x2f4425[_0x9f18('0x66')][_0x9f18('0x2e')]==='user')return _0x5448fa;if(_0x2f4425[_0x9f18('0x36')][_0x9f18('0x2e')]!=='user')return _0x5448fa;var _0xf4888b=_['some'](_0x5448fa,function(_0x2449b3){return _0x2449b3[_0x9f18('0x2e')]===_0x9f18('0x2f')||_0x2449b3[_0x9f18('0x2e')]==='telephone';});if(!_0xf4888b)return _0x5448fa;return db[_0x9f18('0x8b')][_0x9f18('0x57')]({'where':{'name':{'$or':[_0x9f18('0x37'),_0x9f18('0x38')]},'userProfileId':_0x2f4425[_0x9f18('0x36')][_0x9f18('0x8c')]},'raw':!![]})['then'](function(_0x1832f8){if(_[_0x9f18('0x93')](_0x1832f8)||!_['some'](_0x1832f8,[_0x9f18('0x8d'),0x0]))return _0x5448fa;_0x59cc30=[];var _0x4a9081=_(_0x1832f8)[_0x9f18('0x3b')](function(_0x47a001){if(_0x47a001['autoAssociation']===0x1)return;return _0x47a001[_0x9f18('0x42')]===_0x9f18('0x37')?'agent':'telephone';})[_0x9f18('0x94')]()[_0x9f18('0x3c')]();for(var _0x43eb81=0x0;_0x43eb81<_0x5448fa[_0x9f18('0x5a')];_0x43eb81++){if(!_[_0x9f18('0x3d')](_0x4a9081,_0x5448fa[_0x43eb81]['role']))return;var _0x6375c7=_0x5448fa[_0x43eb81][_0x9f18('0x2e')]===_0x9f18('0x2f')?_0x9f18('0x37'):_0x9f18('0x38');_0x59cc30[_0x9f18('0x56')](db[_0x9f18('0x3f')]['create']({'name':_0x5448fa[_0x43eb81][_0x9f18('0x42')],'resourceId':_0x5448fa[_0x43eb81]['id'],'type':_0x6375c7,'sectionId':_[_0x9f18('0x3e')](_0x1832f8,[_0x9f18('0x42'),_0x6375c7])['id']},{}));}return Promise[_0x9f18('0x92')](_0x59cc30);});})[_0x9f18('0x40')](respondWithResult(_0xdc8c7c,0xc9))[_0x9f18('0x65')](handleError(_0xdc8c7c,null));};exports['changePassword']=function(_0x160f70,_0x7570fc){if(_0x160f70['body']['id']){delete _0x160f70['body']['id'];}return db[_0x9f18('0x43')][_0x9f18('0x3e')]({'where':{'id':_0x160f70[_0x9f18('0x61')]['id']}})[_0x9f18('0x40')](function(_0x37afc6){if(!_0x37afc6)return null;if(_0x37afc6['id']===_0x160f70[_0x9f18('0x36')]['id']){if(!_0x160f70['body'][_0x9f18('0x95')]||!_0x160f70[_0x9f18('0x66')][_0x9f18('0x96')]){throw new db[(_0x9f18('0x97'))]['ValidationError'](_0x9f18('0x98'));}if(!_0x37afc6[_0x9f18('0x99')](_0x160f70['body'][_0x9f18('0x95')])){throw new db[(_0x9f18('0x97'))]['ValidationError'](_0x9f18('0x9a'));}if(_0x160f70[_0x9f18('0x66')][_0x9f18('0x95')]===_0x160f70[_0x9f18('0x66')][_0x9f18('0x96')]){throw new db['Sequelize'][(_0x9f18('0x9b'))](_0x9f18('0x9c'));}}else if(_0x160f70[_0x9f18('0x36')][_0x9f18('0x2e')]===_0x9f18('0x34')){if(!_0x160f70[_0x9f18('0x66')][_0x9f18('0x96')]){throw new db[(_0x9f18('0x97'))][(_0x9f18('0x9b'))](_0x9f18('0x9d'));}}else if(_0x160f70['user'][_0x9f18('0x2e')]==='user'){if(!_0x160f70[_0x9f18('0x66')][_0x9f18('0x96')]){throw new db[(_0x9f18('0x97'))]['ValidationError'](_0x9f18('0x9d'));}if(_0x37afc6['role']!==_0x9f18('0x2f')){throw new db[(_0x9f18('0x97'))][(_0x9f18('0x9b'))](_0x9f18('0x84'));}}else{throw new db[(_0x9f18('0x97'))][(_0x9f18('0x9b'))](_0x9f18('0x84'));}return _0x37afc6;})[_0x9f18('0x40')](handleEntityNotFound(_0x7570fc,null))[_0x9f18('0x40')](function(_0x4167bb){return db[_0x9f18('0x9e')][_0x9f18('0x9f')]({'attributes':['id',_0x9f18('0x6d'),_0x9f18('0xa0'),_0x9f18('0xa1')]})[_0x9f18('0x40')](function(_0x102341){if(_0x102341[_0x9f18('0x6d')])authService['validatePasswordPattern'](_0x160f70[_0x9f18('0x66')][_0x9f18('0x96')]);if(!_0x102341[_0x9f18('0xa0')]||!_0x4167bb['previousPasswords'])return _0x4167bb;authService[_0x9f18('0xa2')](_0x160f70[_0x9f18('0x66')][_0x9f18('0x96')],_0x4167bb[_0x9f18('0x4a')],_0x102341[_0x9f18('0xa1')]);return _0x4167bb;})['then'](saveUpdates({'password':_0x160f70[_0x9f18('0x66')]['newPassword'],'passwordResetAt':_0x160f70[_0x9f18('0x36')]['id']==_0x160f70['params']['id']?moment():null,'previousPasswords':authService['updatePasswordsHistory'](_0x160f70[_0x9f18('0x66')][_0x9f18('0x96')],_0x4167bb[_0x9f18('0x4a')])},null));})['then'](respondWithResult(_0x7570fc,null))['catch'](handleError(_0x7570fc,null));};exports[_0x9f18('0xa3')]=function(_0x357438,_0x433ac2){var _0x47b9e5=_0x357438[_0x9f18('0x66')][_0x9f18('0xa4')];return db[_0x9f18('0x43')][_0x9f18('0x3e')]({'where':{'id':_0x357438[_0x9f18('0x61')]['id']},'attributes':['id',_0x9f18('0x42'),_0x9f18('0x2e'),_0x9f18('0xa5'),_0x9f18('0xa6'),'voicePause','interface']})[_0x9f18('0x40')](handleEntityNotFound(_0x433ac2,null))[_0x9f18('0x40')](function(_0x318e78){if(_0x318e78){if(!utils[_0x9f18('0xa7')](_0x47b9e5)){throw new db[(_0x9f18('0x97'))]['ValidationError'](_0x9f18('0xa8'));}return _0x318e78[_0x9f18('0xa9')+_['capitalize'](_0x47b9e5['toLowerCase']())+_0x9f18('0xaa')](_0x357438['body']['ids'],{'penalty':_0x357438[_0x9f18('0x66')][_0x9f18('0xab')]||0x0})[_0x9f18('0xac')](function(_0x22cd19){for(var _0x2a134d=0x0;_0x2a134d<_0x357438[_0x9f18('0x66')][_0x9f18('0x69')][_0x9f18('0x5a')];_0x2a134d+=0x1){var _0xd32c04={'UserId':Number(_0x357438['params']['id'])};_0xd32c04[_['capitalize'](_0x47b9e5['toLowerCase']())+_0x9f18('0xad')]=Number(_0x357438['body'][_0x9f18('0x69')][_0x2a134d]);socket['emit'](_0x9f18('0x36')+_[_0x9f18('0xae')](_0x47b9e5[_0x9f18('0xaf')]())+_0x9f18('0xb0'),_0xd32c04);}return _0x22cd19;})[_0x9f18('0x40')](function(){if(_0x47b9e5===_0x9f18('0xb1')){return db[_0x9f18('0xb2')][_0x9f18('0x57')]({'where':{'id':_0x357438['body']['ids']||[]},'raw':!![],'attributes':['id','name']});}})[_0x9f18('0x40')](function(_0x3df71c){var _0xf44bdc=_0x318e78[_0x9f18('0x33')]({'plain':!![]});var _0x4bc306=[];if(_0x47b9e5===_0x9f18('0xb1')&&_0xf44bdc[_0x9f18('0x2e')]==='agent'&&_0xf44bdc['online']){for(let _0x3db786=0x0;_0x3db786<_0x3df71c[_0x9f18('0x5a')];_0x3db786+=0x1){_0x4bc306[_0x9f18('0x56')]({'membername':_0xf44bdc[_0x9f18('0x42')],'UserId':_0xf44bdc['id'],'queue_name':_0x3df71c[_0x3db786][_0x9f18('0x42')],'VoiceQueueId':_0x3df71c[_0x3db786]['id'],'interface':_['isNil'](_0xf44bdc[_0x9f18('0xb3')])?util[_0x9f18('0xb4')](_0x9f18('0xb5'),_0xf44bdc[_0x9f18('0x42')]):_0xf44bdc['interface'],'paused':_0xf44bdc['voicePause']||![],'penalty':_0x357438['body'][_0x9f18('0xab')]||0x0});}return Promise[_0x9f18('0x92')](_0x4bc306[_0x9f18('0x3b')](function(_0x16d0cc){return db[_0x9f18('0xb6')]['upsert'](_0x16d0cc);}));}return _0x318e78;});}})['then'](respondWithStatusCode(_0x433ac2,null))[_0x9f18('0x65')](handleError(_0x433ac2,null));};exports[_0x9f18('0xb7')]=function(_0x4c08df,_0x24732c){var _0x42133f,_0x416441;return db['User'][_0x9f18('0x3e')]({'where':{'id':_0x4c08df[_0x9f18('0x61')]['id']},'attributes':['id',_0x9f18('0x42'),_0x9f18('0x2e')]})[_0x9f18('0x40')](handleEntityNotFound(_0x24732c,null))[_0x9f18('0x40')](function(_0x268472){if(_0x268472){_0x42133f=_0x268472;if(!_0x4c08df[_0x9f18('0x50')][_0x9f18('0xa4')]||!utils['isValidChannel'](_0x4c08df[_0x9f18('0x50')]['channel'])){throw new db[(_0x9f18('0x97'))]['ValidationError'](_0x9f18('0xa8'));}return _0x268472[_0x9f18('0xb8')+_[_0x9f18('0xae')](_0x4c08df[_0x9f18('0x50')][_0x9f18('0xa4')]['toLowerCase']())+'Queues'](_0x4c08df[_0x9f18('0x50')][_0x9f18('0x69')]);}})['then'](function(_0x3a265d){if(_[_0x9f18('0xb9')](_0x4c08df[_0x9f18('0x50')]['ids'])){for(var _0x37c314=0x0;_0x37c314<_0x4c08df['query']['ids'][_0x9f18('0x5a')];_0x37c314+=0x1){_0x416441={'UserId':Number(_0x4c08df[_0x9f18('0x61')]['id'])};_0x416441[_['capitalize'](_0x4c08df[_0x9f18('0x50')][_0x9f18('0xa4')][_0x9f18('0xaf')]())+_0x9f18('0xad')]=Number(_0x4c08df[_0x9f18('0x50')][_0x9f18('0x69')][_0x37c314]);socket[_0x9f18('0x30')](_0x9f18('0x36')+_['capitalize'](_0x4c08df[_0x9f18('0x50')][_0x9f18('0xa4')][_0x9f18('0xaf')]())+_0x9f18('0xba'),_0x416441);}}else{_0x416441={'UserId':Number(_0x4c08df[_0x9f18('0x61')]['id'])};_0x416441[_[_0x9f18('0xae')](_0x4c08df[_0x9f18('0x50')]['channel'][_0x9f18('0xaf')]())+_0x9f18('0xad')]=Number(_0x4c08df[_0x9f18('0x50')][_0x9f18('0x69')]);socket[_0x9f18('0x30')](_0x9f18('0x36')+_[_0x9f18('0xae')](_0x4c08df[_0x9f18('0x50')][_0x9f18('0xa4')][_0x9f18('0xaf')]())+_0x9f18('0xba'),_0x416441);}return _0x3a265d;})[_0x9f18('0x40')](function(){if(_0x4c08df['query'][_0x9f18('0xa4')]===_0x9f18('0xb1')){return db['UserVoiceQueueRt']['destroy']({'where':{'UserId':_0x4c08df[_0x9f18('0x61')]['id'],'VoiceQueueId':_0x4c08df[_0x9f18('0x50')][_0x9f18('0x69')]},'individualHooks':!![]})['then'](function(){return _0x42133f;});}return _0x42133f;})['then'](respondWithStatusCode(_0x24732c,null))[_0x9f18('0x65')](handleError(_0x24732c,null));};exports[_0x9f18('0xbb')]=function(_0x5ddf4b,_0x293329){_0x5ddf4b['body'][_0x9f18('0xbc')]=_0x5ddf4b[_0x9f18('0xbd')]['filename'];return db[_0x9f18('0x43')][_0x9f18('0x3e')]({'where':{'id':_0x5ddf4b['params']['id']}})[_0x9f18('0x40')](handleEntityNotFound(_0x293329,null))[_0x9f18('0x40')](saveUpdates(_0x5ddf4b[_0x9f18('0x66')],null))[_0x9f18('0x40')](respondWithResult(_0x293329,null))[_0x9f18('0x65')](handleError(_0x293329,null));};exports['getAvatar']=function(_0x18ade5,_0x34f2f0){var _0x415fdb=path['join'](config[_0x9f18('0xbe')],_0x9f18('0xbf'));return db[_0x9f18('0x43')][_0x9f18('0x3e')]({'where':{'id':_0x18ade5[_0x9f18('0x61')]['id']},'attributes':['id','userpic'],'raw':!![]})['then'](handleEntityNotFound(_0x34f2f0,null))[_0x9f18('0x40')](function(_0x37e41d){if(_0x37e41d){if(_[_0x9f18('0x70')](_0x37e41d['userpic'])){return _0x34f2f0[_0x9f18('0xc0')](_0x415fdb);}else{if(!fs[_0x9f18('0xc1')](path[_0x9f18('0xc2')](config[_0x9f18('0xbe')],_0x9f18('0xc3'),_0x37e41d['userpic']))){return _0x34f2f0[_0x9f18('0xc0')](_0x415fdb);}return _0x34f2f0['download'](path[_0x9f18('0xc2')](config[_0x9f18('0xbe')],_0x9f18('0xc3'),_0x37e41d[_0x9f18('0xbc')]));}}})[_0x9f18('0x65')](handleError(_0x34f2f0,null));};exports[_0x9f18('0xc4')]=function(_0x450a29,_0x24b9e1){return db[_0x9f18('0x43')]['find']({'where':{'id':_0x450a29[_0x9f18('0x61')]['id']},'attributes':['id']})[_0x9f18('0x40')](handleEntityNotFound(_0x24b9e1,null))[_0x9f18('0x40')](function(_0xb8263){var _0x290eee=[];values=_0xb8263[_0x9f18('0x5c')];_0x290eee[_0x9f18('0x56')](get_open_tabs('chat',_0xb8263[_0x9f18('0x5c')]));_0x290eee[_0x9f18('0x56')](get_open_tabs(_0x9f18('0xc5'),_0xb8263[_0x9f18('0x5c')]));_0x290eee['push'](get_open_tabs(_0x9f18('0x5f'),_0xb8263[_0x9f18('0x5c')]));_0x290eee[_0x9f18('0x56')](get_open_tabs(_0x9f18('0x60'),_0xb8263['dataValues']));_0x290eee[_0x9f18('0x56')](get_open_tabs('fax',_0xb8263['dataValues']));_0x290eee[_0x9f18('0x56')](get_open_tabs(_0x9f18('0x5e'),_0xb8263[_0x9f18('0x5c')]));return Promise[_0x9f18('0x92')](_0x290eee);})['then'](function(_0x20a7b2){if(_0x20a7b2){var _0x281d60=_[_0x9f18('0x3b')](values[_0x9f18('0xc6')],function(_0xd33deb){return{'channel':'CHAT','id':_0xd33deb['id'],'createdAt':_0xd33deb[_0x9f18('0xc7')]};});var _0x4b1dc5=_['map'](values['FaxOpenTabs'],function(_0x4b72cf){return{'channel':_0x9f18('0xc8'),'id':_0x4b72cf['id'],'createdAt':_0x4b72cf[_0x9f18('0xc7')]};});var _0x749788=_[_0x9f18('0x3b')](values[_0x9f18('0xc9')],function(_0x536498){return{'channel':_0x9f18('0xca'),'id':_0x536498['id'],'createdAt':_0x536498[_0x9f18('0xc7')]};});var _0x13b2a7=_[_0x9f18('0x3b')](values[_0x9f18('0xcb')],function(_0xe2beba){return{'channel':_0x9f18('0xcc'),'id':_0xe2beba['id'],'createdAt':_0xe2beba[_0x9f18('0xc7')]};});var _0x523f80=_[_0x9f18('0x3b')](values[_0x9f18('0xcd')],function(_0x6afca6){return{'channel':_0x9f18('0xce'),'id':_0x6afca6['id'],'createdAt':_0x6afca6[_0x9f18('0xc7')]};});var _0x51d71f=_[_0x9f18('0x3b')](values[_0x9f18('0xcf')],function(_0x408644){return{'channel':_0x9f18('0xd0'),'id':_0x408644['id'],'createdAt':_0x408644['createdAt']};});var _0x2c19c7=_[_0x9f18('0xd1')](_0x281d60,_0x4b1dc5,_0x749788,_0x13b2a7,_0x523f80,_0x51d71f);var _0x18be42={'count':_0x2c19c7[_0x9f18('0x5a')],'rows':_0x2c19c7};return _0x18be42;}else return null;})[_0x9f18('0x40')](respondWithResult(_0x24b9e1,null))[_0x9f18('0x65')](handleError(_0x24b9e1,null));};exports[_0x9f18('0xd2')]=function(_0x2dc088,_0x2ffe4a){var _0x313924={};return db[_0x9f18('0x43')][_0x9f18('0x9f')]({'where':{'id':_0x2dc088['params']['id']}})[_0x9f18('0x40')](function(_0x501d05){if(!_0x501d05){throw new APINotFoundError(util[_0x9f18('0xb4')]('User\x20with\x20id\x20%s\x20not\x20found',_0x2dc088[_0x9f18('0x61')]['id']));}return contacts[_0x9f18('0x67')]();})['then'](function(_0x3e0c9d){_0x2dc088[_0x9f18('0x50')][_0x9f18('0x43')]=_0x2dc088[_0x9f18('0x61')]['id'];_0x313924=qs[_0x9f18('0x4e')](_0x3e0c9d,_0x2dc088);if(_0x2dc088['query'][_0x9f18('0xd3')]('includeAll')){_0x313924[_0x9f18('0x51')]=[{'model':db[_0x9f18('0xd4')],'as':'List','required':![]},{'model':db[_0x9f18('0xd5')],'as':_0x9f18('0xd6'),'attributes':['id',_0x9f18('0x42'),_0x9f18('0xd7')],'where':_0x2dc088[_0x9f18('0x50')][_0x9f18('0xd8')]?{'id':_0x2dc088[_0x9f18('0x50')][_0x9f18('0xd8')]}:undefined,'required':_0x2dc088[_0x9f18('0x50')][_0x9f18('0xd8')]?!![]:![]}];}return contacts[_0x9f18('0x57')](_0x2dc088[_0x9f18('0x50')],_0x2dc088[_0x9f18('0x36')],_0x313924,_0x3e0c9d);})[_0x9f18('0x40')](respondWithFilteredResult(_0x2ffe4a,_0x313924))[_0x9f18('0x65')](APIHandleError(_0x2ffe4a));};exports[_0x9f18('0xd9')]=function(_0x1f6d94,_0x14d99b){var _0x4252d4;var _0x1a2b33={};var _0x47496b;return db['User']['findOne']({'where':{'id':_0x1f6d94[_0x9f18('0x61')]['id']},'attributes':['id',_0x9f18('0x42'),'role']})[_0x9f18('0x40')](handleEntityNotFound(_0x14d99b,null))['then'](function(_0x16b064){if(!utils[_0x9f18('0xa7')](_0x1f6d94[_0x9f18('0x50')]['channel'])){throw new db['Sequelize']['ValidationError']('Unknown\x20channel');}_0x4252d4=_0x16b064;var _0x112a87={};_0x112a87[_0x9f18('0xda')]=_[_0x9f18('0xdb')](db[_[_0x9f18('0xae')](_0x1f6d94[_0x9f18('0x50')][_0x9f18('0xa4')])+_0x9f18('0xdc')][_0x9f18('0x44')]);_0x112a87[_0x9f18('0x50')]=_['keys'](_0x1f6d94['query']);_0x112a87[_0x9f18('0xdd')]=_[_0x9f18('0xde')](_0x112a87['model'],_0x112a87[_0x9f18('0x50')]);_0x1a2b33['attributes']=_['intersection'](_0x112a87[_0x9f18('0xda')],qs[_0x9f18('0xdf')](_0x1f6d94[_0x9f18('0x50')][_0x9f18('0xdf')]));_0x1a2b33[_0x9f18('0x55')]=_0x1a2b33[_0x9f18('0x55')][_0x9f18('0x5a')]?_0x1a2b33['attributes']:_0x112a87['model'];_0x1a2b33[_0x9f18('0xe0')]=qs[_0x9f18('0xe1')](_0x1f6d94[_0x9f18('0x50')]['sort']);_0x1a2b33[_0x9f18('0x4f')]=qs[_0x9f18('0xdd')](_[_0x9f18('0xe2')](_0x1f6d94[_0x9f18('0x50')],_0x112a87[_0x9f18('0xdd')]));if(_0x1f6d94[_0x9f18('0x50')]['filter']){_0x1a2b33[_0x9f18('0x4f')]=_['merge'](_0x1a2b33['where'],{'$or':_[_0x9f18('0x3b')](_0x1a2b33['attributes'],function(_0x446920){var _0x1e3e85={};_0x1e3e85[_0x446920]={'$like':'%'+_0x1f6d94[_0x9f18('0x50')][_0x9f18('0x39')]+'%'};return _0x1e3e85;})});}_0x1a2b33=_['merge']({},_0x1a2b33,_0x1f6d94[_0x9f18('0x64')]);switch(_0x4252d4[_0x9f18('0x2e')]){case'admin':return db[_['capitalize'](_0x1f6d94[_0x9f18('0x50')][_0x9f18('0xa4')])+'Queue'][_0x9f18('0x57')](_0x1a2b33);case _0x9f18('0x36'):case _0x9f18('0x2f'):return _0x4252d4['get'+_[_0x9f18('0xae')](_0x1f6d94[_0x9f18('0x50')][_0x9f18('0xa4')])+'Queues'](_0x1a2b33);default:throw new db[(_0x9f18('0x97'))]['ValidationError'](_0x9f18('0xe3'));}})[_0x9f18('0x40')](function(_0xcd28f1){_0x47496b=_0xcd28f1[_0x9f18('0x5a')];if(!_0x1f6d94[_0x9f18('0x50')][_0x9f18('0xd3')]('nolimit')){_0x1a2b33[_0x9f18('0x20')]=qs[_0x9f18('0x20')](_0x1f6d94[_0x9f18('0x50')][_0x9f18('0x20')]);_0x1a2b33['offset']=qs[_0x9f18('0x1d')](_0x1f6d94[_0x9f18('0x50')][_0x9f18('0x1d')]);}switch(_0x4252d4[_0x9f18('0x2e')]){case'admin':return db[_['capitalize'](_0x1f6d94[_0x9f18('0x50')][_0x9f18('0xa4')])+_0x9f18('0xdc')][_0x9f18('0x57')](_0x1a2b33);case _0x9f18('0x36'):case'agent':return _0x4252d4[_0x9f18('0x33')+_[_0x9f18('0xae')](_0x1f6d94['query'][_0x9f18('0xa4')])+_0x9f18('0xaa')](_0x1a2b33);}})[_0x9f18('0x40')](function(_0x364431){return{'count':_0x47496b,'rows':_0x364431};})[_0x9f18('0x40')](respondWithResult(_0x14d99b,null))['catch'](handleError(_0x14d99b,null));};exports['getVoiceQueuesRt']=function(_0x1ade0f,_0x5bad29){var _0x484cbf={};var _0x34d85b={};var _0x2d5b04;var _0x1c0621;return db['User']['findOne']({'where':{'id':_0x1ade0f[_0x9f18('0x61')]['id']}})[_0x9f18('0x40')](handleEntityNotFound(_0x5bad29,null))[_0x9f18('0x40')](function(_0x2066c6){if(_0x2066c6){_0x2d5b04=_0x2066c6;_0x34d85b['model']=_['keys'](db[_0x9f18('0xb6')][_0x9f18('0x44')]);_0x34d85b[_0x9f18('0x50')]=_[_0x9f18('0xdb')](_0x1ade0f[_0x9f18('0x50')]);_0x34d85b[_0x9f18('0xdd')]=_[_0x9f18('0xde')](_0x34d85b[_0x9f18('0xda')],_0x34d85b['query']);_0x484cbf[_0x9f18('0x55')]=_[_0x9f18('0xde')](_0x34d85b[_0x9f18('0xda')],qs[_0x9f18('0xdf')](_0x1ade0f[_0x9f18('0x50')][_0x9f18('0xdf')]));_0x484cbf[_0x9f18('0x55')]=_0x484cbf[_0x9f18('0x55')][_0x9f18('0x5a')]?_0x484cbf[_0x9f18('0x55')]:_0x34d85b[_0x9f18('0xda')];_0x484cbf['order']=qs[_0x9f18('0xe1')](_0x1ade0f[_0x9f18('0x50')][_0x9f18('0xe1')]);_0x484cbf[_0x9f18('0x4f')]=qs[_0x9f18('0xdd')](_[_0x9f18('0xe2')](_0x1ade0f[_0x9f18('0x50')],_0x34d85b['filters']));if(_0x1ade0f['query'][_0x9f18('0x39')]){_0x484cbf[_0x9f18('0x4f')]=_[_0x9f18('0x63')](_0x484cbf[_0x9f18('0x4f')],{'$or':_[_0x9f18('0x3b')](_0x484cbf[_0x9f18('0x55')],function(_0x587046){var _0x5c5716={};_0x5c5716[_0x587046]={'$like':'%'+_0x1ade0f[_0x9f18('0x50')][_0x9f18('0x39')]+'%'};return _0x5c5716;})});}_0x484cbf=_['merge']({},_0x484cbf,_0x1ade0f[_0x9f18('0x64')]);return _0x2d5b04[_0x9f18('0xe4')](_0x484cbf);}})[_0x9f18('0x40')](function(_0x1f36cd){if(_0x1f36cd){_0x1c0621=_0x1f36cd['length'];if(!_0x1ade0f['query'][_0x9f18('0xd3')](_0x9f18('0xe5'))){_0x484cbf['limit']=qs['limit'](_0x1ade0f[_0x9f18('0x50')][_0x9f18('0x20')]);_0x484cbf[_0x9f18('0x1d')]=qs[_0x9f18('0x1d')](_0x1ade0f[_0x9f18('0x50')][_0x9f18('0x1d')]);}return _0x2d5b04[_0x9f18('0xe4')](_0x484cbf);}})[_0x9f18('0x40')](function(_0x544b86){if(_0x544b86){return _0x544b86?{'count':_0x1c0621,'rows':_0x544b86}:null;}})[_0x9f18('0x40')](respondWithResult(_0x5bad29,null))[_0x9f18('0x65')](handleError(_0x5bad29,null));};exports['getGroups']=function(_0x6d0b7c,_0x2d08b4){var _0x33f802={};var _0xbd7896={};var _0x2e4c0b;var _0x4aa889;return db['User'][_0x9f18('0x9f')]({'where':{'id':_0x6d0b7c['params']['id']}})['then'](handleEntityNotFound(_0x2d08b4,null))[_0x9f18('0x40')](function(_0x1c9212){if(_0x1c9212){_0x2e4c0b=_0x1c9212;_0xbd7896['model']=_[_0x9f18('0xdb')](db[_0x9f18('0xe6')][_0x9f18('0x44')]);_0xbd7896[_0x9f18('0x50')]=_[_0x9f18('0xdb')](_0x6d0b7c[_0x9f18('0x50')]);_0xbd7896[_0x9f18('0xdd')]=_[_0x9f18('0xde')](_0xbd7896[_0x9f18('0xda')],_0xbd7896['query']);_0x33f802['attributes']=_[_0x9f18('0xde')](_0xbd7896[_0x9f18('0xda')],qs[_0x9f18('0xdf')](_0x6d0b7c[_0x9f18('0x50')][_0x9f18('0xdf')]));_0x33f802['attributes']=_0x33f802['attributes'][_0x9f18('0x5a')]?_0x33f802[_0x9f18('0x55')]:_0xbd7896[_0x9f18('0xda')];_0x33f802[_0x9f18('0xe0')]=qs[_0x9f18('0xe1')](_0x6d0b7c[_0x9f18('0x50')]['sort']);_0x33f802[_0x9f18('0x4f')]=qs[_0x9f18('0xdd')](_['pick'](_0x6d0b7c['query'],_0xbd7896[_0x9f18('0xdd')]));if(_0x6d0b7c['query']['filter']){_0x33f802[_0x9f18('0x4f')]=_[_0x9f18('0x63')](_0x33f802[_0x9f18('0x4f')],{'$or':_[_0x9f18('0x3b')](_0x33f802['attributes'],function(_0x2e5a5d){var _0x140178={};_0x140178[_0x2e5a5d]={'$like':'%'+_0x6d0b7c[_0x9f18('0x50')][_0x9f18('0x39')]+'%'};return _0x140178;})});}_0x33f802=_['merge']({},_0x33f802,_0x6d0b7c[_0x9f18('0x64')]);return _0x2e4c0b[_0x9f18('0xe7')](_0x33f802);}})[_0x9f18('0x40')](function(_0xa384d7){if(_0xa384d7){_0x4aa889=_0xa384d7[_0x9f18('0x5a')];if(!_0x6d0b7c[_0x9f18('0x50')][_0x9f18('0xd3')](_0x9f18('0xe5'))){_0x33f802[_0x9f18('0x20')]=qs[_0x9f18('0x20')](_0x6d0b7c[_0x9f18('0x50')][_0x9f18('0x20')]);_0x33f802[_0x9f18('0x1d')]=qs[_0x9f18('0x1d')](_0x6d0b7c['query'][_0x9f18('0x1d')]);}return _0x2e4c0b['getGroups'](_0x33f802);}})[_0x9f18('0x40')](function(_0x476aa9){if(_0x476aa9){return _0x476aa9?{'count':_0x4aa889,'rows':_0x476aa9}:null;}})[_0x9f18('0x40')](respondWithResult(_0x2d08b4,null))['catch'](handleError(_0x2d08b4,null));};exports[_0x9f18('0xe8')]=function(_0x1d11c1,_0x46e062){var _0x31e26d={'raw':!![],'where':{}};var _0x23a78b={};var _0x32253e={'count':0x0,'rows':[]};return db[_0x9f18('0x43')][_0x9f18('0x9f')]({'where':{'id':_0x1d11c1[_0x9f18('0x61')]['id']}})[_0x9f18('0x40')](handleEntityNotFound(_0x46e062,null))[_0x9f18('0x40')](function(_0x3308a4){if(_0x3308a4){_0x23a78b[_0x9f18('0xda')]=_['keys'](db[_0x9f18('0xe9')]['rawAttributes']);_0x23a78b[_0x9f18('0x50')]=_[_0x9f18('0xdb')](_0x1d11c1[_0x9f18('0x50')]);_0x23a78b['filters']=_[_0x9f18('0xde')](_0x23a78b[_0x9f18('0xda')],_0x23a78b[_0x9f18('0x50')]);_0x31e26d[_0x9f18('0x55')]=_['intersection'](_0x23a78b['model'],qs[_0x9f18('0xdf')](_0x1d11c1[_0x9f18('0x50')][_0x9f18('0xdf')]));_0x31e26d['attributes']=_0x31e26d['attributes'][_0x9f18('0x5a')]?_0x31e26d[_0x9f18('0x55')]:_0x23a78b[_0x9f18('0xda')];if(!_0x1d11c1[_0x9f18('0x50')]['hasOwnProperty'](_0x9f18('0xe5'))){_0x31e26d['limit']=qs['limit'](_0x1d11c1[_0x9f18('0x50')][_0x9f18('0x20')]);_0x31e26d['offset']=qs['offset'](_0x1d11c1[_0x9f18('0x50')][_0x9f18('0x1d')]);}_0x31e26d[_0x9f18('0xe0')]=qs[_0x9f18('0xe1')](_0x1d11c1['query'][_0x9f18('0xe1')]);_0x31e26d[_0x9f18('0x4f')]=qs[_0x9f18('0xdd')](_[_0x9f18('0xe2')](_0x1d11c1[_0x9f18('0x50')],_0x23a78b['filters']));_0x31e26d['where']['UserId']=_0x3308a4['id'];if(_0x1d11c1['query'][_0x9f18('0x39')]){_0x31e26d[_0x9f18('0x4f')]=_[_0x9f18('0x63')](_0x31e26d[_0x9f18('0x4f')],{'$or':_[_0x9f18('0x3b')](_0x31e26d['attributes'],function(_0x33a055){var _0x5b8e05={};_0x5b8e05[_0x33a055]={'$like':'%'+_0x1d11c1[_0x9f18('0x50')][_0x9f18('0x39')]+'%'};return _0x5b8e05;})});}_0x31e26d=_[_0x9f18('0x63')]({},_0x31e26d,_0x1d11c1[_0x9f18('0x64')]);return db[_0x9f18('0xe9')][_0x9f18('0x1f')]({'where':_0x31e26d['where']})[_0x9f18('0x40')](function(_0x22027b){_0x32253e[_0x9f18('0x1f')]=_0x22027b;if(_0x1d11c1[_0x9f18('0x50')][_0x9f18('0x62')]){_0x31e26d[_0x9f18('0x51')]=[{'all':!![]}];}return db[_0x9f18('0xe9')]['findAll'](_0x31e26d);})[_0x9f18('0x40')](function(_0x47c896){_0x32253e['rows']=_0x47c896;return _0x32253e;});}})[_0x9f18('0x40')](respondWithFilteredResult(_0x46e062,_0x31e26d))['catch'](handleError(_0x46e062,null));};exports[_0x9f18('0xea')]=function(_0x187faa,_0x4695bf){var _0x485458={'raw':!![],'where':{}};var _0x5152b7={};var _0xaab2bb={'count':0x0,'rows':[]};return db['User'][_0x9f18('0x9f')]({'where':{'id':_0x187faa[_0x9f18('0x61')]['id']}})[_0x9f18('0x40')](handleEntityNotFound(_0x4695bf,null))[_0x9f18('0x40')](function(_0x5e379f){if(_0x5e379f){_0x5152b7['model']=_[_0x9f18('0xdb')](db[_0x9f18('0xeb')][_0x9f18('0x44')]);_0x5152b7[_0x9f18('0x50')]=_[_0x9f18('0xdb')](_0x187faa[_0x9f18('0x50')]);_0x5152b7[_0x9f18('0xdd')]=_['intersection'](_0x5152b7['model'],_0x5152b7[_0x9f18('0x50')]);_0x485458[_0x9f18('0x55')]=_[_0x9f18('0xde')](_0x5152b7[_0x9f18('0xda')],qs[_0x9f18('0xdf')](_0x187faa[_0x9f18('0x50')][_0x9f18('0xdf')]));_0x485458[_0x9f18('0x55')]=_0x485458[_0x9f18('0x55')][_0x9f18('0x5a')]?_0x485458[_0x9f18('0x55')]:_0x5152b7[_0x9f18('0xda')];if(!_0x187faa['query'][_0x9f18('0xd3')](_0x9f18('0xe5'))){_0x485458['limit']=qs[_0x9f18('0x20')](_0x187faa[_0x9f18('0x50')]['limit']);_0x485458[_0x9f18('0x1d')]=qs[_0x9f18('0x1d')](_0x187faa['query'][_0x9f18('0x1d')]);}_0x485458[_0x9f18('0xe0')]=qs[_0x9f18('0xe1')](_0x187faa['query'][_0x9f18('0xe1')]);_0x485458[_0x9f18('0x4f')]=qs[_0x9f18('0xdd')](_[_0x9f18('0xe2')](_0x187faa[_0x9f18('0x50')],_0x5152b7[_0x9f18('0xdd')]));_0x485458[_0x9f18('0x4f')]['UserId']=_0x5e379f['id'];if(_0x187faa[_0x9f18('0x50')][_0x9f18('0x39')]){_0x485458[_0x9f18('0x4f')]=_[_0x9f18('0x63')](_0x485458[_0x9f18('0x4f')],{'$or':_[_0x9f18('0x3b')](_0x485458[_0x9f18('0x55')],function(_0x5296cc){var _0x4aedfc={};_0x4aedfc[_0x5296cc]={'$like':'%'+_0x187faa[_0x9f18('0x50')][_0x9f18('0x39')]+'%'};return _0x4aedfc;})});}_0x485458=_['merge']({},_0x485458,_0x187faa[_0x9f18('0x64')]);return db[_0x9f18('0xeb')][_0x9f18('0x1f')]({'where':_0x485458[_0x9f18('0x4f')]})[_0x9f18('0x40')](function(_0x19088a){_0xaab2bb[_0x9f18('0x1f')]=_0x19088a;if(_0x187faa[_0x9f18('0x50')]['includeAll']){_0x485458[_0x9f18('0x51')]=[{'all':!![]}];}return db['ScreenRecording'][_0x9f18('0x57')](_0x485458);})[_0x9f18('0x40')](function(_0x32027e){_0xaab2bb[_0x9f18('0x58')]=_0x32027e;return _0xaab2bb;});}})[_0x9f18('0x40')](respondWithFilteredResult(_0x4695bf,_0x485458))['catch'](handleError(_0x4695bf,null));};exports[_0x9f18('0xec')]=function(_0x51c0aa,_0x2e16cc){var _0x5b9f32={};var _0x5b71af={};var _0x45afff;var _0x5ca3d4;return db[_0x9f18('0x43')][_0x9f18('0x9f')]({'where':{'id':_0x51c0aa['params']['id']}})[_0x9f18('0x40')](handleEntityNotFound(_0x2e16cc,null))[_0x9f18('0x40')](function(_0x105832){if(_0x105832){_0x45afff=_0x105832;_0x5b71af[_0x9f18('0xda')]=_[_0x9f18('0xdb')](db[_0x9f18('0xed')][_0x9f18('0x44')]);_0x5b71af[_0x9f18('0x50')]=_[_0x9f18('0xdb')](_0x51c0aa['query']);_0x5b71af['filters']=_['intersection'](_0x5b71af[_0x9f18('0xda')],_0x5b71af[_0x9f18('0x50')]);_0x5b9f32['attributes']=_[_0x9f18('0xde')](_0x5b71af[_0x9f18('0xda')],qs['fields'](_0x51c0aa[_0x9f18('0x50')][_0x9f18('0xdf')]));_0x5b9f32[_0x9f18('0x55')]=_0x5b9f32[_0x9f18('0x55')]['length']?_0x5b9f32[_0x9f18('0x55')]:_0x5b71af[_0x9f18('0xda')];_0x5b9f32[_0x9f18('0xe0')]=qs['sort'](_0x51c0aa[_0x9f18('0x50')][_0x9f18('0xe1')]);_0x5b9f32[_0x9f18('0x4f')]=qs['filters'](_[_0x9f18('0xe2')](_0x51c0aa[_0x9f18('0x50')],_0x5b71af[_0x9f18('0xdd')]));if(_0x51c0aa[_0x9f18('0x50')][_0x9f18('0x39')]){_0x5b9f32[_0x9f18('0x4f')]=_[_0x9f18('0x63')](_0x5b9f32[_0x9f18('0x4f')],{'$or':_[_0x9f18('0x3b')](_0x5b9f32[_0x9f18('0x55')],function(_0x3e5f76){var _0x44c96c={};_0x44c96c[_0x3e5f76]={'$like':'%'+_0x51c0aa[_0x9f18('0x50')][_0x9f18('0x39')]+'%'};return _0x44c96c;})});}_0x5b9f32=_[_0x9f18('0x63')]({},_0x5b9f32,_0x51c0aa[_0x9f18('0x64')]);return _0x45afff[_0x9f18('0xec')](_0x5b9f32);}})[_0x9f18('0x40')](function(_0xaeca7d){if(_0xaeca7d){_0x5ca3d4=_0xaeca7d[_0x9f18('0x5a')];if(!_0x51c0aa[_0x9f18('0x50')][_0x9f18('0xd3')](_0x9f18('0xe5'))){_0x5b9f32['limit']=qs[_0x9f18('0x20')](_0x51c0aa['query']['limit']);_0x5b9f32[_0x9f18('0x1d')]=qs[_0x9f18('0x1d')](_0x51c0aa['query'][_0x9f18('0x1d')]);}return _0x45afff[_0x9f18('0xec')](_0x5b9f32);}})['then'](function(_0x1b0a52){if(_0x1b0a52){return _0x1b0a52?{'count':_0x5ca3d4,'rows':_0x1b0a52}:null;}})['then'](respondWithResult(_0x2e16cc,null))[_0x9f18('0x65')](handleError(_0x2e16cc,null));};exports[_0x9f18('0xee')]=function(_0x5caeab,_0x49664c){var _0x4dbb90={};var _0x92c50a={};var _0x2d2a96;var _0x528b69;return db[_0x9f18('0x43')][_0x9f18('0x9f')]({'where':{'id':_0x5caeab[_0x9f18('0x61')]['id']}})[_0x9f18('0x40')](handleEntityNotFound(_0x49664c,null))['then'](function(_0x1c5457){if(_0x1c5457){_0x2d2a96=_0x1c5457;_0x92c50a[_0x9f18('0xda')]=_['keys'](db['OpenchannelInteraction'][_0x9f18('0x44')]);_0x92c50a[_0x9f18('0x50')]=_[_0x9f18('0xdb')](_0x5caeab[_0x9f18('0x50')]);_0x92c50a['filters']=_[_0x9f18('0xde')](_0x92c50a[_0x9f18('0xda')],_0x92c50a[_0x9f18('0x50')]);_0x4dbb90[_0x9f18('0x55')]=_[_0x9f18('0xde')](_0x92c50a[_0x9f18('0xda')],qs['fields'](_0x5caeab['query'][_0x9f18('0xdf')]));_0x4dbb90['attributes']=_0x4dbb90['attributes']['length']?_0x4dbb90[_0x9f18('0x55')]:_0x92c50a[_0x9f18('0xda')];_0x4dbb90[_0x9f18('0xe0')]=qs[_0x9f18('0xe1')](_0x5caeab[_0x9f18('0x50')][_0x9f18('0xe1')]);_0x4dbb90[_0x9f18('0x4f')]=qs[_0x9f18('0xdd')](_[_0x9f18('0xe2')](_0x5caeab[_0x9f18('0x50')],_0x92c50a[_0x9f18('0xdd')]));if(_0x5caeab[_0x9f18('0x50')]['filter']){_0x4dbb90[_0x9f18('0x4f')]=_[_0x9f18('0x63')](_0x4dbb90[_0x9f18('0x4f')],{'$or':_[_0x9f18('0x3b')](_0x4dbb90[_0x9f18('0x55')],function(_0x392450){var _0x402ada={};_0x402ada[_0x392450]={'$like':'%'+_0x5caeab[_0x9f18('0x50')][_0x9f18('0x39')]+'%'};return _0x402ada;})});}_0x4dbb90=_[_0x9f18('0x63')]({},_0x4dbb90,_0x5caeab[_0x9f18('0x64')]);return _0x2d2a96[_0x9f18('0xee')](_0x4dbb90);}})[_0x9f18('0x40')](function(_0x49406){if(_0x49406){_0x528b69=_0x49406[_0x9f18('0x5a')];if(!_0x5caeab[_0x9f18('0x50')][_0x9f18('0xd3')](_0x9f18('0xe5'))){_0x4dbb90[_0x9f18('0x20')]=qs[_0x9f18('0x20')](_0x5caeab[_0x9f18('0x50')]['limit']);_0x4dbb90[_0x9f18('0x1d')]=qs[_0x9f18('0x1d')](_0x5caeab[_0x9f18('0x50')]['offset']);}return _0x2d2a96[_0x9f18('0xee')](_0x4dbb90);}})[_0x9f18('0x40')](function(_0x23e322){if(_0x23e322){return _0x23e322?{'count':_0x528b69,'rows':_0x23e322}:null;}})[_0x9f18('0x40')](respondWithResult(_0x49664c,null))[_0x9f18('0x65')](handleError(_0x49664c,null));};exports[_0x9f18('0xef')]=function(_0xac4823,_0x3364fc){var _0x950b82={'raw':!![],'where':{}};var _0x1898ea={};var _0x5bb663={'count':0x0,'rows':[]};return db[_0x9f18('0x43')]['findOne']({'where':{'id':_0xac4823[_0x9f18('0x61')]['id']}})[_0x9f18('0x40')](handleEntityNotFound(_0x3364fc,null))[_0x9f18('0x40')](function(_0x3ed2bc){if(_0x3ed2bc){_0x1898ea[_0x9f18('0xda')]=_[_0x9f18('0xdb')](db[_0x9f18('0xf0')][_0x9f18('0x44')]);_0x1898ea[_0x9f18('0x50')]=_[_0x9f18('0xdb')](_0xac4823['query']);_0x1898ea[_0x9f18('0xdd')]=_[_0x9f18('0xde')](_0x1898ea[_0x9f18('0xda')],_0x1898ea[_0x9f18('0x50')]);_0x950b82[_0x9f18('0x55')]=_[_0x9f18('0xde')](_0x1898ea[_0x9f18('0xda')],qs[_0x9f18('0xdf')](_0xac4823[_0x9f18('0x50')][_0x9f18('0xdf')]));_0x950b82[_0x9f18('0x55')]=_0x950b82[_0x9f18('0x55')][_0x9f18('0x5a')]?_0x950b82[_0x9f18('0x55')]:_0x1898ea[_0x9f18('0xda')];if(!_0xac4823[_0x9f18('0x50')][_0x9f18('0xd3')]('nolimit')){_0x950b82[_0x9f18('0x20')]=qs[_0x9f18('0x20')](_0xac4823['query'][_0x9f18('0x20')]);_0x950b82[_0x9f18('0x1d')]=qs[_0x9f18('0x1d')](_0xac4823[_0x9f18('0x50')][_0x9f18('0x1d')]);}_0x950b82[_0x9f18('0xe0')]=qs[_0x9f18('0xe1')](_0xac4823[_0x9f18('0x50')]['sort']);_0x950b82['where']=qs[_0x9f18('0xdd')](_[_0x9f18('0xe2')](_0xac4823[_0x9f18('0x50')],_0x1898ea[_0x9f18('0xdd')]));_0x950b82[_0x9f18('0x4f')][_0x9f18('0xf1')]=_0x3ed2bc['id'];if(_0xac4823[_0x9f18('0x50')][_0x9f18('0x39')]){_0x950b82[_0x9f18('0x4f')]=_[_0x9f18('0x63')](_0x950b82[_0x9f18('0x4f')],{'$or':_['map'](_0x950b82[_0x9f18('0x55')],function(_0x1c09fb){var _0x5e4ca9={};_0x5e4ca9[_0x1c09fb]={'$like':'%'+_0xac4823[_0x9f18('0x50')][_0x9f18('0x39')]+'%'};return _0x5e4ca9;})});}_0x950b82=_[_0x9f18('0x63')]({},_0x950b82,_0xac4823['options']);return db[_0x9f18('0xf0')][_0x9f18('0x1f')]({'where':_0x950b82[_0x9f18('0x4f')]})[_0x9f18('0x40')](function(_0x253a2a){_0x5bb663[_0x9f18('0x1f')]=_0x253a2a;if(_0xac4823[_0x9f18('0x50')][_0x9f18('0x62')]){_0x950b82[_0x9f18('0x51')]=[{'all':!![]}];}return db[_0x9f18('0xf0')][_0x9f18('0x57')](_0x950b82);})[_0x9f18('0x40')](function(_0xd8158c){_0x5bb663[_0x9f18('0x58')]=_0xd8158c;return _0x5bb663;});}})[_0x9f18('0x40')](respondWithFilteredResult(_0x3364fc,_0x950b82))[_0x9f18('0x65')](handleError(_0x3364fc,null));};exports[_0x9f18('0xf2')]=function(_0x5dad15,_0xe882fa){var _0x29f099={};var _0x3b6674={};var _0x55e077;var _0x5e891b;return db[_0x9f18('0x43')]['findOne']({'where':{'id':_0x5dad15[_0x9f18('0x61')]['id']}})[_0x9f18('0x40')](handleEntityNotFound(_0xe882fa,null))[_0x9f18('0x40')](function(_0x513dee){if(_0x513dee){_0x55e077=_0x513dee;_0x3b6674[_0x9f18('0xda')]=_[_0x9f18('0xdb')](db[_0x9f18('0xf3')]['rawAttributes']);_0x3b6674['query']=_['keys'](_0x5dad15[_0x9f18('0x50')]);_0x3b6674[_0x9f18('0xdd')]=_[_0x9f18('0xde')](_0x3b6674[_0x9f18('0xda')],_0x3b6674[_0x9f18('0x50')]);_0x29f099[_0x9f18('0x55')]=_['intersection'](_0x3b6674[_0x9f18('0xda')],qs[_0x9f18('0xdf')](_0x5dad15[_0x9f18('0x50')][_0x9f18('0xdf')]));_0x29f099[_0x9f18('0x55')]=_0x29f099[_0x9f18('0x55')]['length']?_0x29f099[_0x9f18('0x55')]:_0x3b6674['model'];_0x29f099[_0x9f18('0xe0')]=qs[_0x9f18('0xe1')](_0x5dad15[_0x9f18('0x50')][_0x9f18('0xe1')]);_0x29f099[_0x9f18('0x4f')]=qs[_0x9f18('0xdd')](_[_0x9f18('0xe2')](_0x5dad15[_0x9f18('0x50')],_0x3b6674['filters']));if(_0x5dad15[_0x9f18('0x50')]['filter']){_0x29f099[_0x9f18('0x4f')]=_[_0x9f18('0x63')](_0x29f099['where'],{'$or':_['map'](_0x29f099['attributes'],function(_0x4b6290){var _0x294ca4={};_0x294ca4[_0x4b6290]={'$like':'%'+_0x5dad15[_0x9f18('0x50')][_0x9f18('0x39')]+'%'};return _0x294ca4;})});}_0x29f099=_['merge']({},_0x29f099,_0x5dad15['options']);return _0x55e077['getSmsInteractions'](_0x29f099);}})[_0x9f18('0x40')](function(_0x42a9ef){if(_0x42a9ef){_0x5e891b=_0x42a9ef[_0x9f18('0x5a')];if(!_0x5dad15[_0x9f18('0x50')]['hasOwnProperty']('nolimit')){_0x29f099[_0x9f18('0x20')]=qs['limit'](_0x5dad15[_0x9f18('0x50')]['limit']);_0x29f099[_0x9f18('0x1d')]=qs[_0x9f18('0x1d')](_0x5dad15[_0x9f18('0x50')][_0x9f18('0x1d')]);}return _0x55e077[_0x9f18('0xf2')](_0x29f099);}})[_0x9f18('0x40')](function(_0x9f43ae){if(_0x9f43ae){return _0x9f43ae?{'count':_0x5e891b,'rows':_0x9f43ae}:null;}})[_0x9f18('0x40')](respondWithResult(_0xe882fa,null))[_0x9f18('0x65')](handleError(_0xe882fa,null));};exports[_0x9f18('0xf4')]=function(_0x4349f0,_0x362aa6){var _0x25bd84={};var _0xf439fa={};var _0x22841f;var _0x1b6da2;return db[_0x9f18('0x43')]['findOne']({'where':{'id':_0x4349f0[_0x9f18('0x61')]['id']}})['then'](handleEntityNotFound(_0x362aa6,null))[_0x9f18('0x40')](function(_0x9d4882){if(_0x9d4882){_0x22841f=_0x9d4882;_0xf439fa[_0x9f18('0xda')]=_[_0x9f18('0xdb')](db[_0x9f18('0xf5')][_0x9f18('0x44')]);_0xf439fa[_0x9f18('0x50')]=_['keys'](_0x4349f0[_0x9f18('0x50')]);_0xf439fa['filters']=_[_0x9f18('0xde')](_0xf439fa[_0x9f18('0xda')],_0xf439fa[_0x9f18('0x50')]);_0x25bd84[_0x9f18('0x55')]=_['intersection'](_0xf439fa[_0x9f18('0xda')],qs['fields'](_0x4349f0[_0x9f18('0x50')][_0x9f18('0xdf')]));_0x25bd84['attributes']=_0x25bd84[_0x9f18('0x55')]['length']?_0x25bd84[_0x9f18('0x55')]:_0xf439fa[_0x9f18('0xda')];_0x25bd84[_0x9f18('0xe0')]=qs[_0x9f18('0xe1')](_0x4349f0[_0x9f18('0x50')][_0x9f18('0xe1')]);_0x25bd84[_0x9f18('0x4f')]=qs[_0x9f18('0xdd')](_['pick'](_0x4349f0[_0x9f18('0x50')],_0xf439fa[_0x9f18('0xdd')]));if(_0x4349f0['query'][_0x9f18('0x39')]){_0x25bd84[_0x9f18('0x4f')]=_[_0x9f18('0x63')](_0x25bd84[_0x9f18('0x4f')],{'$or':_[_0x9f18('0x3b')](_0x25bd84[_0x9f18('0x55')],function(_0x4894d5){var _0xa96376={};_0xa96376[_0x4894d5]={'$like':'%'+_0x4349f0[_0x9f18('0x50')][_0x9f18('0x39')]+'%'};return _0xa96376;})});}_0x25bd84=_[_0x9f18('0x63')]({},_0x25bd84,_0x4349f0[_0x9f18('0x64')]);return _0x22841f[_0x9f18('0xf4')](_0x25bd84);}})['then'](function(_0x502f00){if(_0x502f00){_0x1b6da2=_0x502f00['length'];if(!_0x4349f0[_0x9f18('0x50')][_0x9f18('0xd3')]('nolimit')){_0x25bd84['limit']=qs[_0x9f18('0x20')](_0x4349f0[_0x9f18('0x50')]['limit']);_0x25bd84[_0x9f18('0x1d')]=qs[_0x9f18('0x1d')](_0x4349f0[_0x9f18('0x50')]['offset']);}return _0x22841f[_0x9f18('0xf4')](_0x25bd84);}})[_0x9f18('0x40')](function(_0x5eae14){if(_0x5eae14){return _0x5eae14?{'count':_0x1b6da2,'rows':_0x5eae14}:null;}})[_0x9f18('0x40')](respondWithResult(_0x362aa6,null))[_0x9f18('0x65')](handleError(_0x362aa6,null));};exports[_0x9f18('0xf6')]=function(_0x57d946,_0x217b83){var _0x34734e={};var _0x3ac8a3={};var _0x1ee3ef;var _0x2ccc70;return db[_0x9f18('0x43')][_0x9f18('0x9f')]({'where':{'id':_0x57d946[_0x9f18('0x61')]['id']}})['then'](handleEntityNotFound(_0x217b83,null))[_0x9f18('0x40')](function(_0x26cbd0){if(_0x26cbd0){_0x1ee3ef=_0x26cbd0;_0x3ac8a3[_0x9f18('0xda')]=_[_0x9f18('0xdb')](db[_0x9f18('0xf7')][_0x9f18('0x44')]);_0x3ac8a3['query']=_[_0x9f18('0xdb')](_0x57d946[_0x9f18('0x50')]);_0x3ac8a3['filters']=_[_0x9f18('0xde')](_0x3ac8a3[_0x9f18('0xda')],_0x3ac8a3['query']);_0x34734e[_0x9f18('0x55')]=_['intersection'](_0x3ac8a3[_0x9f18('0xda')],qs['fields'](_0x57d946[_0x9f18('0x50')]['fields']));_0x34734e[_0x9f18('0x55')]=_0x34734e[_0x9f18('0x55')]['length']?_0x34734e[_0x9f18('0x55')]:_0x3ac8a3[_0x9f18('0xda')];_0x34734e[_0x9f18('0xe0')]=qs[_0x9f18('0xe1')](_0x57d946[_0x9f18('0x50')][_0x9f18('0xe1')]);_0x34734e[_0x9f18('0x4f')]=qs[_0x9f18('0xdd')](_[_0x9f18('0xe2')](_0x57d946[_0x9f18('0x50')],_0x3ac8a3[_0x9f18('0xdd')]));if(_0x57d946[_0x9f18('0x50')][_0x9f18('0x39')]){_0x34734e[_0x9f18('0x4f')]=_[_0x9f18('0x63')](_0x34734e[_0x9f18('0x4f')],{'$or':_[_0x9f18('0x3b')](_0x34734e['attributes'],function(_0x40d0ae){var _0xe26b92={};_0xe26b92[_0x40d0ae]={'$like':'%'+_0x57d946['query'][_0x9f18('0x39')]+'%'};return _0xe26b92;})});}_0x34734e=_['merge']({},_0x34734e,_0x57d946[_0x9f18('0x64')]);return _0x1ee3ef[_0x9f18('0xf6')](_0x34734e);}})[_0x9f18('0x40')](function(_0x414b24){if(_0x414b24){_0x2ccc70=_0x414b24[_0x9f18('0x5a')];if(!_0x57d946[_0x9f18('0x50')][_0x9f18('0xd3')](_0x9f18('0xe5'))){_0x34734e['limit']=qs['limit'](_0x57d946[_0x9f18('0x50')]['limit']);_0x34734e['offset']=qs[_0x9f18('0x1d')](_0x57d946[_0x9f18('0x50')]['offset']);}return _0x1ee3ef[_0x9f18('0xf6')](_0x34734e);}})[_0x9f18('0x40')](function(_0x1b160c){if(_0x1b160c){return _0x1b160c?{'count':_0x2ccc70,'rows':_0x1b160c}:null;}})[_0x9f18('0x40')](respondWithResult(_0x217b83,null))[_0x9f18('0x65')](handleError(_0x217b83,null));};exports[_0x9f18('0xf8')]=function(_0x562854,_0x323b19,_0x200ab6){var _0x5d17c7;var _0x4bb2fa;var _0x44d284;var _0x22b065=!_['isNil'](_0x562854[_0x9f18('0x61')]['id'])?_0x562854['params']['id']:!_[_0x9f18('0x70')](_0x562854[_0x9f18('0x36')]['id'])?_0x562854[_0x9f18('0x36')]['id']:null;return db[_0x9f18('0x43')][_0x9f18('0x3e')]({'where':{'id':_0x22b065,'role':{'$or':[_0x9f18('0x34'),_0x9f18('0x36'),_0x9f18('0x2f')]}},'attributes':['id',_0x9f18('0x42'),_0x9f18('0xf9'),_0x9f18('0xfa'),_0x9f18('0x2e'),_0x9f18('0x6b'),_0x9f18('0xa6')]})['then'](function(_0xcb584f){if(_0xcb584f){if(_0xcb584f['role']==='agent'){_0x5d17c7=_0xcb584f;if(_0x562854[_0x9f18('0x66')][_0x9f18('0xb3')]){_0x44d284=util['format'](_0x9f18('0xfb'),_0x5d17c7[_0x562854[_0x9f18('0x66')][_0x9f18('0xb3')]]);}else if(_0x562854[_0x9f18('0x66')][_0x9f18('0xfc')]){_0x44d284=util[_0x9f18('0xb4')](_0x9f18('0xb5'),_0x562854[_0x9f18('0x66')][_0x9f18('0xfc')]);}else{_0x44d284=util[_0x9f18('0xb4')]('SIP/%s',_0x5d17c7[_0x9f18('0x42')]);}socket['to'](util[_0x9f18('0xb4')](_0x9f18('0xfd'),_0x5d17c7[_0x9f18('0x42')]))[_0x9f18('0x30')](_0x9f18('0xfe'),{'user':{'id':_0x5d17c7['id'],'name':_0x5d17c7[_0x9f18('0x42')]},'ip':_0x562854[_0x9f18('0xff')][_0x9f18('0x100')]||_0x562854[_0x9f18('0x101')][_0x9f18('0x102')]||_0x562854['socket']['remoteAddress']||_0x562854[_0x9f18('0x101')][_0x9f18('0x103')][_0x9f18('0x102')]});return db[_0x9f18('0xb6')][_0x9f18('0x32')]({'where':{'membername':_0x5d17c7[_0x9f18('0x42')]},'individualHooks':!![]});}}else{throw new db[(_0x9f18('0x97'))][(_0x9f18('0x9b'))](_0x9f18('0x104'));}})[_0x9f18('0x40')](function(){if(_0x5d17c7){return _0x5d17c7[_0x9f18('0x105')]({'raw':!![]});}})['then'](function(_0x3858a9){if(_0x5d17c7){if(_0x3858a9){_0x4bb2fa=_0x3858a9;if(_0x4bb2fa[_0x9f18('0x5a')]){var _0x3d1f95=_0x4bb2fa[_0x9f18('0x3b')](function(_0x11fe2a){var _0xbec7ee={'membername':_0x5d17c7['name'],'UserId':_0x5d17c7['id'],'queue_name':_0x11fe2a[_0x9f18('0x42')],'VoiceQueueId':_0x11fe2a['id'],'interface':_0x44d284,'paused':_0x5d17c7[_0x9f18('0xa6')]||![],'penalty':_0x11fe2a[_0x9f18('0x106')]||0x0};return db[_0x9f18('0xb6')]['upsert'](_0xbec7ee);});return Promise['all'](_0x3d1f95);}}}})[_0x9f18('0x40')](function(){if(_0x5d17c7){return db[_0x9f18('0x107')][_0x9f18('0x57')]({'where':{'membername':_0x5d17c7[_0x9f18('0x42')],'exitAt':null}});}})[_0x9f18('0x40')](function(_0x42537f){if(_0x5d17c7){var _0x14df00=[];_0x42537f[_0x9f18('0x108')](function(_0x565079){_0x14df00[_0x9f18('0x56')](_0x565079['update']({'exitAt':moment()[_0x9f18('0xb4')](_0x9f18('0x109'))}));});return Promise[_0x9f18('0x92')](_0x14df00);}})['then'](function(){if(_0x5d17c7){var _0x187535=[];var _0x105cbc=[];var _0x5aae2a=utils[_0x9f18('0x10a')]();var _0x326125={'membername':_0x5d17c7['name'],'interface':_0x44d284,'enterAt':moment()[_0x9f18('0xb4')](_0x9f18('0x109')),'role':_0x5d17c7[_0x9f18('0x2e')],'internal':_0x5d17c7[_0x9f18('0x6b')]};_0x5aae2a['forEach'](function(_0x49d093){_0x187535[_0x9f18('0x56')](_['merge']({'channel':_0x49d093,'type':_0x9f18('0x10b'),'data1':_0x562854[_0x9f18('0x66')][_0x9f18('0x10c')],'data2':_0x44d284},_0x326125));if(_0x5d17c7[_0x9f18('0xa6')]){_0x105cbc[_0x9f18('0x56')](_['merge']({'channel':_0x49d093,'type':'PAUSE','data1':'LOGININPAUSE'},_0x326125));}});return db['MemberReport']['bulkCreate'](_0x187535[_0x9f18('0xd1')](_0x105cbc),{'individualHooks':!![]});}})[_0x9f18('0x40')](function(){if(_0x5d17c7){return _0x5d17c7['update']({'online':!![],'lastLoginAt':moment()[_0x9f18('0xb4')](_0x9f18('0x109')),'voicePause':_0x5d17c7['loginInPause']||![],'mailPause':_0x5d17c7[_0x9f18('0xa6')]||![],'chatPause':_0x5d17c7[_0x9f18('0xa6')]||![],'faxPause':_0x5d17c7[_0x9f18('0xa6')]||![],'smsPause':_0x5d17c7[_0x9f18('0xa6')]||![],'openchannelPause':_0x5d17c7[_0x9f18('0xa6')]||![],'whatsappPause':_0x5d17c7[_0x9f18('0xa6')]||![],'pauseType':_0x5d17c7[_0x9f18('0xa6')]?'LOGININPAUSE':null,'interface':_0x44d284,'lastPauseAt':moment()[_0x9f18('0xb4')]('YYYY-MM-DD\x20HH:mm:ss')});}})[_0x9f18('0x40')](function(_0x495a6d){if(_0x562854['isMiddleware']){return _0x200ab6();}else{return Promise[_0x9f18('0x10d')](_0x495a6d)[_0x9f18('0x40')](respondWithResult(_0x323b19,null));}})[_0x9f18('0x65')](handleError(_0x323b19,null));};exports[_0x9f18('0x10e')]=function(_0x20c55e,_0x4e486){var _0x415d72;return db[_0x9f18('0x43')][_0x9f18('0x3e')]({'where':{'id':_0x20c55e[_0x9f18('0x61')]['id'],'role':_0x9f18('0x2f')},'attributes':['id','name',_0x9f18('0x2e')]})['then'](handleEntityNotFound(_0x4e486,null))[_0x9f18('0x40')](function(_0x1a04f0){if(_0x1a04f0){_0x415d72=_0x1a04f0;return db['UserVoiceQueueRt'][_0x9f18('0x32')]({'where':{'membername':_0x415d72[_0x9f18('0x42')]},'individualHooks':!![]});}})[_0x9f18('0x40')](function(){return db[_0x9f18('0x107')][_0x9f18('0x57')]({'where':{'membername':_0x415d72[_0x9f18('0x42')],'exitAt':null}});})[_0x9f18('0x40')](function(_0x9ed86d){var _0x182659=[];_0x9ed86d[_0x9f18('0x108')](function(_0x52f8fb){_0x182659[_0x9f18('0x56')](_0x52f8fb['update']({'exitAt':moment()[_0x9f18('0xb4')]('YYYY-MM-DD\x20HH:mm:ss')}));});return Promise[_0x9f18('0x92')](_0x182659);})[_0x9f18('0x40')](function(){return _0x415d72[_0x9f18('0x2d')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})['then'](respondWithResult(_0x4e486,null))[_0x9f18('0x65')](handleError(_0x4e486,null));};exports[_0x9f18('0x10f')]=function(_0x898d39,_0x27d614){var _0x3c80bc;return db[_0x9f18('0xb6')][_0x9f18('0x2d')]({'paused':0x1},{'where':{'UserId':_0x898d39[_0x9f18('0x61')]['id']},'individualHooks':!![]})[_0x9f18('0x40')](function(){return db[_0x9f18('0x43')][_0x9f18('0x3e')]({'where':{'id':_0x898d39[_0x9f18('0x61')]['id'],'role':_0x9f18('0x2f')},'attributes':['id','name',_0x9f18('0x2e'),'internal',_0x9f18('0xb3'),'online']});})['then'](handleEntityNotFound(_0x27d614,null))[_0x9f18('0x40')](function(_0x5ecc93){if(_0x5ecc93){_0x3c80bc=_0x5ecc93;return respondWithRpcPromise('QueuePause','pause',{'id':_0x3c80bc['id'],'name':_0x3c80bc[_0x9f18('0x42')],'pause':!![]});}})[_0x9f18('0x40')](function(){if(_0x3c80bc){return db[_0x9f18('0x107')]['findAll']({'where':{'membername':_0x3c80bc[_0x9f18('0x42')],'type':_0x9f18('0x110'),'exitAt':null}});}})[_0x9f18('0x40')](function(_0x3a14ec){if(_0x3a14ec[_0x9f18('0x5a')]){var _0x1f7641=moment()[_0x9f18('0xb4')](_0x9f18('0x109'));for(var _0x5dabae=0x0,_0x3df9ec=_0x3a14ec[_0x9f18('0x5a')];_0x5dabae<_0x3df9ec;_0x5dabae++){_0x3a14ec[_0x5dabae][_0x9f18('0x111')]({'exitAt':_0x1f7641});}}})['then'](function(){var _0x178609=[];var _0x103884=utils[_0x9f18('0x10a')]();_0x103884[_0x9f18('0x108')](function(_0x3fc709){_0x178609[_0x9f18('0x56')]({'channel':_0x3fc709,'membername':_0x3c80bc['name'],'interface':_[_0x9f18('0x70')](_0x3c80bc[_0x9f18('0xb3')])?util[_0x9f18('0xb4')]('SIP/%s',_0x3c80bc['name']):_0x3c80bc[_0x9f18('0xb3')],'type':_0x9f18('0x110'),'enterAt':moment()[_0x9f18('0xb4')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x898d39[_0x9f18('0x66')][_0x9f18('0x46')]||_0x9f18('0x112'),'role':_0x3c80bc['role'],'internal':_0x3c80bc[_0x9f18('0x6b')]});});return db[_0x9f18('0x107')]['bulkCreate'](_0x178609,{'individualHooks':!![]});})['then'](function(){return _0x3c80bc[_0x9f18('0x2d')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x898d39[_0x9f18('0x66')][_0x9f18('0x46')]||_0x9f18('0x112'),'lastPauseAt':moment()[_0x9f18('0xb4')](_0x9f18('0x109'))});})[_0x9f18('0x40')](respondWithResult(_0x27d614,null))['catch'](handleError(_0x27d614,null));};exports[_0x9f18('0x113')]=function(_0x52f90d,_0x55fcb5){if(_0x52f90d[_0x9f18('0x66')][_0x9f18('0xa4')]&&!utils['isValidChannel'](_0x52f90d[_0x9f18('0x66')]['channel'])){throw new APIBadRequestError(util[_0x9f18('0xb4')]('Channel\x20parameter\x20%s\x20is\x20invalid',_0x52f90d[_0x9f18('0x66')][_0x9f18('0xa4')]));}return db[_0x9f18('0x43')][_0x9f18('0x3e')]({'where':{'id':_0x52f90d[_0x9f18('0x61')]['id']},'attributes':['id','name',_0x9f18('0x2e'),'internal','interface',_0x9f18('0xa5'),_0x9f18('0x114'),_0x9f18('0x115'),_0x9f18('0x116'),'faxPause',_0x9f18('0x117'),_0x9f18('0x118'),_0x9f18('0x119'),_0x9f18('0x11a'),_0x9f18('0x11b')]})['then'](function(_0x37d8d8){if(!_0x37d8d8){throw new APINotFoundError(util[_0x9f18('0xb4')](_0x9f18('0x11c'),_0x52f90d[_0x9f18('0x61')]['id']));}return _0x37d8d8['unpause'](_0x52f90d[_0x9f18('0x66')]['channel']);})[_0x9f18('0x40')](respondWithResult(_0x55fcb5,null))[_0x9f18('0x65')](APIHandleError(_0x55fcb5));};exports[_0x9f18('0x11d')]=function(_0x5cd55a,_0x29318e){var _0xb63fe5={};var _0x52bbb2={};var _0x5bd9c9;var _0xd340c4;return db[_0x9f18('0x43')][_0x9f18('0x9f')]({'where':{'id':_0x5cd55a[_0x9f18('0x61')]['id']}})[_0x9f18('0x40')](handleEntityNotFound(_0x29318e,null))[_0x9f18('0x40')](function(_0x32530d){if(_0x32530d){_0x5bd9c9=_0x32530d;_0x52bbb2[_0x9f18('0xda')]=_['keys'](db['Team'][_0x9f18('0x44')]);_0x52bbb2['query']=_['keys'](_0x5cd55a['query']);_0x52bbb2[_0x9f18('0xdd')]=_['intersection'](_0x52bbb2[_0x9f18('0xda')],_0x52bbb2[_0x9f18('0x50')]);_0xb63fe5[_0x9f18('0x55')]=_['intersection'](_0x52bbb2[_0x9f18('0xda')],qs[_0x9f18('0xdf')](_0x5cd55a[_0x9f18('0x50')][_0x9f18('0xdf')]));_0xb63fe5['attributes']=_0xb63fe5[_0x9f18('0x55')][_0x9f18('0x5a')]?_0xb63fe5[_0x9f18('0x55')]:_0x52bbb2[_0x9f18('0xda')];_0xb63fe5[_0x9f18('0xe0')]=qs[_0x9f18('0xe1')](_0x5cd55a[_0x9f18('0x50')][_0x9f18('0xe1')]);_0xb63fe5[_0x9f18('0x4f')]=qs[_0x9f18('0xdd')](_[_0x9f18('0xe2')](_0x5cd55a[_0x9f18('0x50')],_0x52bbb2[_0x9f18('0xdd')]));if(_0x5cd55a['query'][_0x9f18('0x39')]){_0xb63fe5['where']=_[_0x9f18('0x63')](_0xb63fe5[_0x9f18('0x4f')],{'$or':_[_0x9f18('0x3b')](_0xb63fe5[_0x9f18('0x55')],function(_0x26720e){var _0x10e096={};_0x10e096[_0x26720e]={'$like':'%'+_0x5cd55a[_0x9f18('0x50')]['filter']+'%'};return _0x10e096;})});}_0xb63fe5=_[_0x9f18('0x63')]({},_0xb63fe5,_0x5cd55a[_0x9f18('0x64')]);return _0x5bd9c9['getTeams'](_0xb63fe5);}})[_0x9f18('0x40')](function(_0x516ea6){if(_0x516ea6){_0xd340c4=_0x516ea6['length'];if(!_0x5cd55a[_0x9f18('0x50')][_0x9f18('0xd3')](_0x9f18('0xe5'))){_0xb63fe5[_0x9f18('0x20')]=qs['limit'](_0x5cd55a[_0x9f18('0x50')][_0x9f18('0x20')]);_0xb63fe5[_0x9f18('0x1d')]=qs['offset'](_0x5cd55a['query'][_0x9f18('0x1d')]);}return _0x5bd9c9[_0x9f18('0x11d')](_0xb63fe5);}})[_0x9f18('0x40')](function(_0x2520ad){if(_0x2520ad){return _0x2520ad?{'count':_0xd340c4,'rows':_0x2520ad}:null;}})[_0x9f18('0x40')](respondWithResult(_0x29318e,null))['catch'](handleError(_0x29318e,null));};exports[_0x9f18('0x11e')]=function(_0xc977f6,_0x40bc5c){var _0x4ca238=_0xc977f6[_0x9f18('0x61')]['id'];var _0x20d6d6=_0xc977f6['body']?_0xc977f6[_0x9f18('0x66')][_0x9f18('0x69')]:null;var _0x70f0bb=[];return Promise[_0x9f18('0x10d')]()[_0x9f18('0x40')](function(){if(!_0x20d6d6)throw new APIBadRequestError(_0x9f18('0x11f'));})[_0x9f18('0x40')](function(){return db[_0x9f18('0x43')][_0x9f18('0x9f')]({'where':{'id':_0x4ca238}});})['then'](function(_0x3ef9ec){if(!_0x3ef9ec)throw new APINotFoundError(util[_0x9f18('0xb4')]('User\x20with\x20id\x20%s\x20not\x20found',_0xc977f6['params']['id']));return db[_0x9f18('0x120')][_0x9f18('0x121')](function(_0x3a489a){return _0x3ef9ec[_0x9f18('0x11e')](_0x20d6d6,{'transaction':_0x3a489a})[_0x9f18('0x40')](function(){return db[_0x9f18('0x122')][_0x9f18('0x57')]({'where':{'id':{'$in':_0x20d6d6}}});})[_0x9f18('0x40')](function(_0x41e465){var _0x1f3f97=_[_0x9f18('0x3b')](_0x41e465,function(_0x260537){return _0x260537[_0x9f18('0x123')]();});return Promise[_0x9f18('0x92')](_0x1f3f97);})[_0x9f18('0x40')](function(_0x534681){_0x70f0bb=_[_0x9f18('0x124')](_0x534681);var _0x408799=_[_0x9f18('0x3b')](_0x70f0bb,function(_0x7036cb){return _0x7036cb[_0x9f18('0x125')](_0x3ef9ec['id'],{'transaction':_0x3a489a});});return Promise['all'](_0x408799);})['then'](function(){if(!_0x3ef9ec[_0x9f18('0xa5')])return;var _0xa112d8=_[_0x9f18('0x39')](_0x70f0bb,function(_0x446359){return _0x446359[_0x9f18('0x126')](_0x9f18('0xa4'))===_0x9f18('0x127');});var _0x1a95de=_['map'](_0xa112d8,function(_0xbccab3){return db['UserVoiceQueueRt'][_0x9f18('0x128')]({'membername':_0x3ef9ec[_0x9f18('0x42')],'UserId':_0x3ef9ec['id'],'queue_name':_0xbccab3[_0x9f18('0x42')],'VoiceQueueId':_0xbccab3['id'],'interface':_[_0x9f18('0x70')](_0x3ef9ec['interface'])?util[_0x9f18('0xb4')](_0x9f18('0xb5'),_0x3ef9ec[_0x9f18('0x42')]):_0x3ef9ec[_0x9f18('0xb3')],'paused':_0x3ef9ec[_0x9f18('0x114')]||![],'penalty':_0x3ef9ec[_0x9f18('0xab')]},{'transaction':_0x3a489a});});return Promise['all'](_0x1a95de);})['then'](function(){return db[_0x9f18('0x129')][_0x9f18('0x57')]({'where':{'teamId':{'$in':_0x20d6d6}}});})[_0x9f18('0x40')](function(_0x3db6c5){var _0x257d64=_[_0x9f18('0x3b')](_0x3db6c5,function(_0xc6fd5){return db[_0x9f18('0x12a')][_0x9f18('0x89')]({'UserId':_0x3ef9ec['id'],'VoicePrefixId':_0xc6fd5[_0x9f18('0x12b')]},{'transaction':_0x3a489a});});return Promise[_0x9f18('0x92')](_0x257d64);});});})[_0x9f18('0x40')](function(){for(var _0x16844d=0x0;_0x16844d<_0x70f0bb[_0x9f18('0x5a')];_0x16844d++){var _0x4479a3=_0x70f0bb[_0x16844d][_0x9f18('0x126')](_0x9f18('0xa4'));var _0x25b322=_0x4479a3+_0x9f18('0xad');socket[_0x9f18('0x30')]('user'+_0x4479a3+_0x9f18('0xb0'),{'UserId':_0x4ca238,['queueField']:_0x70f0bb[_0x16844d]['id']});}})[_0x9f18('0x40')](respondWithStatusCode(_0x40bc5c,null))[_0x9f18('0x65')](APIHandleError(_0x40bc5c));};exports[_0x9f18('0x12c')]=function(_0xa0999b,_0x748457){var _0x3549b7=_0xa0999b['params']['id'];var _0x3d42f5=null;if(_0xa0999b[_0x9f18('0x50')][_0x9f18('0x69')]){_0x3d42f5=_[_0x9f18('0xb9')](_0xa0999b[_0x9f18('0x50')][_0x9f18('0x69')])?_0xa0999b['query'][_0x9f18('0x69')]:[_0xa0999b[_0x9f18('0x50')]['ids']];}var _0x14adc0=[];return Promise['resolve']()[_0x9f18('0x40')](function(){if(!_0x3d42f5)throw new APIBadRequestError(_0x9f18('0x12d'));})[_0x9f18('0x40')](function(){return db[_0x9f18('0x43')][_0x9f18('0x9f')]({'where':{'id':_0x3549b7}});})[_0x9f18('0x40')](function(_0x52e58a){if(!_0x52e58a)throw new APINotFoundError(util[_0x9f18('0xb4')](_0x9f18('0x11c'),_0xa0999b[_0x9f18('0x61')]['id']));return db[_0x9f18('0x120')]['transaction'](function(_0x8ff892){return _0x52e58a['removeTeams'](_0x3d42f5,{'transaction':_0x8ff892})[_0x9f18('0x40')](function(){return db[_0x9f18('0x122')][_0x9f18('0x57')]({'where':{'id':{'$in':_0x3d42f5}}});})[_0x9f18('0x40')](function(_0x2822bf){var _0x47ad0f=_[_0x9f18('0x3b')](_0x2822bf,function(_0x41dd2a){return _0x41dd2a['getAssociatedQueues']();});return Promise[_0x9f18('0x92')](_0x47ad0f);})[_0x9f18('0x40')](function(_0x121f5d){_0x14adc0=_[_0x9f18('0x124')](_0x121f5d);var _0x3c0269=_[_0x9f18('0x3b')](_0x14adc0,function(_0x3923de){return _0x3923de['removeAgent'](_0x52e58a['id'],{'transaction':_0x8ff892});});return Promise[_0x9f18('0x92')](_0x3c0269);})['then'](function(){if(!_0x52e58a[_0x9f18('0xa5')])return;var _0x1effaf=_['filter'](_0x14adc0,function(_0x5b931b){return _0x5b931b[_0x9f18('0x126')](_0x9f18('0xa4'))==='Voice';});var _0x5f21b2=_['map'](_0x1effaf,function(_0x344302){return db[_0x9f18('0xb6')][_0x9f18('0x32')]({'where':{'VoiceQueueId':_0x344302['id'],'UserId':_0x52e58a['id']},'transaction':_0x8ff892});});return Promise[_0x9f18('0x92')](_0x5f21b2);})[_0x9f18('0x40')](function(){return db[_0x9f18('0x129')]['findAll']({'where':{'teamId':{'$in':_0x3d42f5}}});})['then'](function(_0xa10e5a){var _0xbb3f6a=_['map'](_0xa10e5a,function(_0x27154a){return db[_0x9f18('0x12a')]['destroy']({'where':{'UserId':_0x52e58a['id'],'VoicePrefixId':_0x27154a['VoicePrefixId']}},{'transaction':_0x8ff892});});return Promise[_0x9f18('0x92')](_0xbb3f6a);});});})['then'](function(){for(var _0x275d10=0x0;_0x275d10<_0x14adc0[_0x9f18('0x5a')];_0x275d10++){var _0x27760d=_0x14adc0[_0x275d10][_0x9f18('0x126')](_0x9f18('0xa4'));var _0x5894b0=_0x27760d+_0x9f18('0xad');socket[_0x9f18('0x30')]('user'+_0x27760d+_0x9f18('0xba'),{'UserId':_0x3549b7,['queueField']:_0x14adc0[_0x275d10]['id']});}})[_0x9f18('0x40')](respondWithStatusCode(_0x748457,null))['catch'](APIHandleError(_0x748457));};exports[_0x9f18('0x12e')]=function(_0x5ae3d3,_0x1496c2){var _0x114dae={};var _0x32aa6b={};var _0x10c152;var _0xd3a92e;return db['User'][_0x9f18('0x9f')]({'where':{'id':_0x5ae3d3['params']['id']}})[_0x9f18('0x40')](handleEntityNotFound(_0x1496c2,null))['then'](function(_0x5a480f){if(_0x5a480f){_0x10c152=_0x5a480f;_0x32aa6b[_0x9f18('0xda')]=_[_0x9f18('0xdb')](db[_0x9f18('0xd4')][_0x9f18('0x44')]);_0x32aa6b[_0x9f18('0x50')]=_[_0x9f18('0xdb')](_0x5ae3d3[_0x9f18('0x50')]);_0x32aa6b['filters']=_[_0x9f18('0xde')](_0x32aa6b['model'],_0x32aa6b[_0x9f18('0x50')]);_0x114dae[_0x9f18('0x55')]=_[_0x9f18('0xde')](_0x32aa6b[_0x9f18('0xda')],qs[_0x9f18('0xdf')](_0x5ae3d3['query'][_0x9f18('0xdf')]));_0x114dae[_0x9f18('0x55')]=_0x114dae[_0x9f18('0x55')][_0x9f18('0x5a')]?_0x114dae[_0x9f18('0x55')]:_0x32aa6b[_0x9f18('0xda')];_0x114dae[_0x9f18('0xe0')]=qs[_0x9f18('0xe1')](_0x5ae3d3[_0x9f18('0x50')][_0x9f18('0xe1')]);_0x114dae[_0x9f18('0x4f')]=qs[_0x9f18('0xdd')](_[_0x9f18('0xe2')](_0x5ae3d3['query'],_0x32aa6b[_0x9f18('0xdd')]));if(_0x5ae3d3[_0x9f18('0x50')][_0x9f18('0x39')]){_0x114dae[_0x9f18('0x4f')]=_['merge'](_0x114dae[_0x9f18('0x4f')],{'$or':_[_0x9f18('0x3b')](_0x114dae[_0x9f18('0x55')],function(_0x481cf9){var _0x1dff32={};_0x1dff32[_0x481cf9]={'$like':'%'+_0x5ae3d3['query'][_0x9f18('0x39')]+'%'};return _0x1dff32;})});}_0x114dae=_[_0x9f18('0x63')]({},_0x114dae,_0x5ae3d3['options']);return _0x10c152['getLists'](_0x114dae);}})[_0x9f18('0x40')](function(_0x2876ef){if(_0x2876ef){_0xd3a92e=_0x2876ef['length'];if(!_0x5ae3d3['query'][_0x9f18('0xd3')](_0x9f18('0xe5'))){_0x114dae[_0x9f18('0x20')]=qs[_0x9f18('0x20')](_0x5ae3d3['query'][_0x9f18('0x20')]);_0x114dae[_0x9f18('0x1d')]=qs[_0x9f18('0x1d')](_0x5ae3d3[_0x9f18('0x50')][_0x9f18('0x1d')]);}return _0x10c152[_0x9f18('0x12e')](_0x114dae);}})['then'](function(_0xccbdd0){if(_0xccbdd0){return _0xccbdd0?{'count':_0xd3a92e,'rows':_0xccbdd0}:null;}})[_0x9f18('0x40')](respondWithResult(_0x1496c2,null))['catch'](handleError(_0x1496c2,null));};exports['getAgents']=function(_0x5f24a0,_0x200359){var _0x1ee95f={};var _0xa9e86b={};var _0x442d58;return db[_0x9f18('0x43')]['findOne']({'where':{'id':_0x5f24a0[_0x9f18('0x61')]['id']}})[_0x9f18('0x40')](handleEntityNotFound(_0x200359,null))[_0x9f18('0x40')](function(_0x5f3e96){if(_0x5f3e96){_0x442d58=_0x5f3e96;_0xa9e86b[_0x9f18('0xda')]=_[_0x9f18('0xdb')](db[_0x9f18('0x43')][_0x9f18('0x44')]);_0xa9e86b['query']=_[_0x9f18('0xdb')](_0x5f24a0['query']);_0xa9e86b['filters']=_['intersection'](_0xa9e86b[_0x9f18('0xda')],_0xa9e86b['query']);_0x1ee95f[_0x9f18('0x55')]=_['intersection'](_0xa9e86b[_0x9f18('0xda')],qs[_0x9f18('0xdf')](_0x5f24a0[_0x9f18('0x50')][_0x9f18('0xdf')]));_0x1ee95f[_0x9f18('0x55')]=_0x1ee95f['attributes']['length']?_0x1ee95f[_0x9f18('0x55')]:_0xa9e86b['model'];_0x1ee95f[_0x9f18('0xe0')]=qs[_0x9f18('0xe1')](_0x5f24a0['query'][_0x9f18('0xe1')]);_0x1ee95f[_0x9f18('0x4f')]=qs[_0x9f18('0xdd')](_[_0x9f18('0xe2')](_0x5f24a0[_0x9f18('0x50')],_0xa9e86b[_0x9f18('0xdd')]));if(_0x5f24a0[_0x9f18('0x50')]['filter']){_0x1ee95f[_0x9f18('0x4f')]=_['merge'](_0x1ee95f[_0x9f18('0x4f')],{'$or':_[_0x9f18('0x3b')](_0x1ee95f[_0x9f18('0x55')],function(_0x3707fc){var _0x48da79={};_0x48da79[_0x3707fc]={'$like':'%'+_0x5f24a0[_0x9f18('0x50')][_0x9f18('0x39')]+'%'};return _0x48da79;})});}_0x1ee95f[_0x9f18('0xda')]=db[_0x9f18('0x43')];_0x1ee95f['as']=_0x9f18('0x37');_0x1ee95f=_['merge']({},_0x1ee95f,_0x5f24a0[_0x9f18('0x64')]);return _0x442d58['getVoiceQueues']({'include':[_0x1ee95f]});}})[_0x9f18('0x40')](function(_0x32aee9){if(_0x32aee9){var _0x3ea597={},_0x3cb16b=[];for(var _0x58f517=0x0;_0x58f517<_0x32aee9[_0x9f18('0x5a')];_0x58f517+=0x1){for(var _0x3747c8=0x0,_0xefeb0d;_0x3747c8<_0x32aee9[_0x58f517][_0x9f18('0x37')][_0x9f18('0x5a')];_0x3747c8+=0x1){_0xefeb0d=_0x32aee9[_0x58f517][_0x9f18('0x37')][_0x3747c8][_0x9f18('0x33')]({'plain':!![]});_0x3ea597[_0xefeb0d['id']]=_0xefeb0d;}}_0x3ea597=_[_0x9f18('0x12f')](_0x3ea597);for(var _0x1eaa04=qs[_0x9f18('0x1d')](_0x5f24a0[_0x9f18('0x50')][_0x9f18('0x1d')]);_0x1eaa04<_0x3ea597['length']&&_0x3cb16b[_0x9f18('0x5a')]=_0x49e7c4[_0xa43a('0x4e')]){throw new Error(_0xa43a('0x4f'));}})['then'](function(){if(_0x406986){return db[_0xa43a('0x26')]['destroy']({'where':{'membername':_0x406986['name']},'individualHooks':!![]});}})[_0xa43a('0x16')](function(){if(_0x406986){return _0x406986[_0xa43a('0x50')]({'raw':!![]});}})[_0xa43a('0x16')](function(_0x56e648){if(_0x406986){if(_0x56e648){var _0x5abb04=[];_0x4c9c18=_0x56e648;if(_0x4c9c18[_0xa43a('0x2b')]){for(var _0x280092=0x0;_0x280092<_0x4c9c18['length'];_0x280092++){_0x5abb04['push'](db[_0xa43a('0x26')][_0xa43a('0x51')]({'membername':_0x406986['name'],'UserId':_0x406986['id'],'queue_name':_0x4c9c18[_0x280092]['name'],'VoiceQueueId':_0x4c9c18[_0x280092]['id'],'interface':_0xbee732,'paused':_0x406986[_0xa43a('0x49')]||![],'penalty':_0x4c9c18[_0x280092]['UserVoiceQueue.penalty']||0x0}));}return BPromise[_0xa43a('0x46')](_0x5abb04);}}}})[_0xa43a('0x16')](function(){if(_0x406986){return db[_0xa43a('0x28')][_0xa43a('0x29')]({'where':{'membername':_0x406986['name'],'exitAt':null}});}})[_0xa43a('0x16')](function(_0xb6a4b8){if(_0x406986){if(_0xb6a4b8&&_0xb6a4b8[_0xa43a('0x2b')]){var _0x37807c=[];_0xb6a4b8[_0xa43a('0x2f')](function(_0x173e3c){_0x37807c[_0xa43a('0x30')](_0x173e3c[_0xa43a('0x27')]({'exitAt':moment()[_0xa43a('0x23')](_0xa43a('0x2c'))}));});return BPromise['all'](_0x37807c);}}})[_0xa43a('0x16')](function(){if(_0x406986){var _0xbbdbfb=[];var _0x1b80be=[];var _0x186e27=utils[_0xa43a('0x2e')]();var _0x24865c={'membername':_0x406986['name'],'interface':_0xbee732,'enterAt':moment()[_0xa43a('0x23')](_0xa43a('0x2c')),'role':_0x406986[_0xa43a('0x20')],'internal':_0x406986['internal']};_0x186e27['forEach'](function(_0x227399){_0xbbdbfb[_0xa43a('0x30')](_[_0xa43a('0x52')]({'channel':_0x227399,'type':_0xa43a('0x53'),'data1':'callysquare','data2':_0xbee732},_0x24865c));if(_0x406986[_0xa43a('0x49')]){_0x1b80be[_0xa43a('0x30')](_[_0xa43a('0x52')]({'channel':_0x227399,'type':_0xa43a('0x2a'),'data1':_0xa43a('0x54')},_0x24865c));}});return db['MemberReport'][_0xa43a('0x37')](_0xbbdbfb[_0xa43a('0x55')](_0x1b80be),{'individualHooks':!![]});}})[_0xa43a('0x16')](function(){if(_0x406986){return _0x406986[_0xa43a('0x27')]({'online':!![],'lastLoginAt':moment()[_0xa43a('0x23')](_0xa43a('0x2c')),'voicePause':_0x406986[_0xa43a('0x49')]||![],'mailPause':_0x406986[_0xa43a('0x49')]||![],'chatPause':_0x406986[_0xa43a('0x49')]||![],'faxPause':_0x406986[_0xa43a('0x49')]||![],'smsPause':_0x406986[_0xa43a('0x49')]||![],'openchannelPause':_0x406986['loginInPause']||![],'pauseType':_0x406986[_0xa43a('0x49')]?_0xa43a('0x54'):null,'lastPauseAt':moment()[_0xa43a('0x23')](_0xa43a('0x2c')),'interface':_0xbee732});}})['then'](function(_0x223278){_0x3be0a8(_0x223278);})[_0xa43a('0x19')](function(_0x150311){_0x2f07df(_0xdb39a2[_0xa43a('0x1b')](0x1f4,_0x150311['message']));});});}; \ No newline at end of file +var _0xa4de=['interface','format','User\x20with\x20id\x20%s\x20not\x20found','params','UserVoiceQueueRt','update','MemberReport','PAUSE','length','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','getChannels','forEach','push','body','type','DEFAULT\x20PAUSE','uniqueid','bulkCreate','UnpauseUser','resolve','channel','isValidChannel','Channel\x20parameter\x20%s\x20is\x20invalid','findOne','voicePause','mailPause','chatPause','smsPause','whatsappPause','pauseType','lastPauseAt','unpause','LogoutUser','all','phone','loginInPause','SIP/%s','count','../../config/license/util','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','destroy','getVoiceQueues','upsert','merge','callysquare','LOGININPAUSE','concat','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','redis','localhost','register','GetUser','User','findAll','options','raw','attributes','limit','include','map','model','then','info','debug','catch','error','message','ShowUser','find','where','PauseUser','name','role','internal'];(function(_0x398828,_0x52119b){var _0x399ce8=function(_0x38ffa0){while(--_0x38ffa0){_0x398828['push'](_0x398828['shift']());}};_0x399ce8(++_0x52119b);}(_0xa4de,0x86));var _0xea4d=function(_0x5ce407,_0x4a50f6){_0x5ce407=_0x5ce407-0x0;var _0x261d6a=_0xa4de[_0x5ce407];return _0x261d6a;};'use strict';var _=require(_0xea4d('0x0'));var util=require(_0xea4d('0x1'));var moment=require(_0xea4d('0x2'));var BPromise=require(_0xea4d('0x3'));var Redis=require('ioredis');var db=require(_0xea4d('0x4'))['db'];var utils=require(_0xea4d('0x5'));var logger=require(_0xea4d('0x6'))('rpc');var config=require(_0xea4d('0x7'));config['redis']=_['defaults'](config[_0xea4d('0x8')],{'host':_0xea4d('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xea4d('0x8')]));require('./user.socket')[_0xea4d('0xa')](socket);exports[_0xea4d('0xb')]=function(_0x4c1535){var _0x53892c=this;return new Promise(function(_0x1fc987,_0x594849){return db[_0xea4d('0xc')][_0xea4d('0xd')]({'raw':_0x4c1535[_0xea4d('0xe')]?_0x4c1535[_0xea4d('0xe')][_0xea4d('0xf')]===undefined?!![]:![]:!![],'where':_0x4c1535['options']?_0x4c1535[_0xea4d('0xe')]['where']||null:null,'attributes':_0x4c1535[_0xea4d('0xe')]?_0x4c1535[_0xea4d('0xe')][_0xea4d('0x10')]||null:null,'limit':_0x4c1535[_0xea4d('0xe')]?_0x4c1535[_0xea4d('0xe')][_0xea4d('0x11')]||null:null,'include':_0x4c1535['options']?_0x4c1535[_0xea4d('0xe')][_0xea4d('0x12')]?_[_0xea4d('0x13')](_0x4c1535['options'][_0xea4d('0x12')],function(_0x5f3c25){return{'model':db[_0x5f3c25[_0xea4d('0x14')]],'as':_0x5f3c25['as'],'attributes':_0x5f3c25['attributes'],'include':_0x5f3c25[_0xea4d('0x12')]?_[_0xea4d('0x13')](_0x5f3c25[_0xea4d('0x12')],function(_0x5d08dc){return{'model':db[_0x5d08dc['model']],'as':_0x5d08dc['as'],'attributes':_0x5d08dc[_0xea4d('0x10')],'include':_0x5d08dc[_0xea4d('0x12')]?_[_0xea4d('0x13')](_0x5d08dc['include'],function(_0x5894a3){return{'model':db[_0x5894a3[_0xea4d('0x14')]],'as':_0x5894a3['as'],'attributes':_0x5894a3[_0xea4d('0x10')]};}):[]};}):[]};}):[]:[]})[_0xea4d('0x15')](function(_0x4ca6d7){logger[_0xea4d('0x16')](_0xea4d('0xb'),_0x4c1535);logger[_0xea4d('0x17')](_0xea4d('0xb'),_0x4c1535,JSON['stringify'](_0x4ca6d7));_0x1fc987(_0x4ca6d7);})[_0xea4d('0x18')](function(_0x31371d){logger[_0xea4d('0x19')](_0xea4d('0xb'),_0x31371d[_0xea4d('0x1a')],_0x4c1535);_0x594849(_0x53892c[_0xea4d('0x19')](0x1f4,_0x31371d[_0xea4d('0x1a')]));});});};exports[_0xea4d('0x1b')]=function(_0x5ee77d){var _0x748774=this;return new Promise(function(_0x4a8959,_0x48ee91){return db['User'][_0xea4d('0x1c')]({'raw':_0x5ee77d[_0xea4d('0xe')]?_0x5ee77d[_0xea4d('0xe')][_0xea4d('0xf')]===undefined?!![]:![]:!![],'where':_0x5ee77d[_0xea4d('0xe')]?_0x5ee77d['options'][_0xea4d('0x1d')]||null:null,'attributes':_0x5ee77d['options']?_0x5ee77d['options']['attributes']||null:null,'include':_0x5ee77d[_0xea4d('0xe')]?_0x5ee77d['options'][_0xea4d('0x12')]?_[_0xea4d('0x13')](_0x5ee77d[_0xea4d('0xe')][_0xea4d('0x12')],function(_0x14d06a){return{'model':db[_0x14d06a[_0xea4d('0x14')]],'as':_0x14d06a['as'],'attributes':_0x14d06a[_0xea4d('0x10')],'include':_0x14d06a[_0xea4d('0x12')]?_[_0xea4d('0x13')](_0x14d06a['include'],function(_0x48eb72){return{'model':db[_0x48eb72['model']],'as':_0x48eb72['as'],'attributes':_0x48eb72[_0xea4d('0x10')],'include':_0x48eb72[_0xea4d('0x12')]?_[_0xea4d('0x13')](_0x48eb72[_0xea4d('0x12')],function(_0xcf882a){return{'model':db[_0xcf882a['model']],'as':_0xcf882a['as'],'attributes':_0xcf882a[_0xea4d('0x10')]};}):[]};}):[]};}):[]:[]})[_0xea4d('0x15')](function(_0x377983){logger[_0xea4d('0x16')]('ShowUser',_0x5ee77d);logger[_0xea4d('0x17')](_0xea4d('0x1b'),_0x5ee77d,JSON['stringify'](_0x377983));_0x4a8959(_0x377983);})[_0xea4d('0x18')](function(_0x4f6c14){logger[_0xea4d('0x19')](_0xea4d('0x1b'),_0x4f6c14[_0xea4d('0x1a')],_0x5ee77d);_0x48ee91(_0x748774['error'](0x1f4,_0x4f6c14[_0xea4d('0x1a')]));});});};exports[_0xea4d('0x1e')]=function(_0x41b955){var _0x298576;return db[_0xea4d('0xc')][_0xea4d('0x1c')]({'where':_0x41b955[_0xea4d('0xe')][_0xea4d('0x1d')]||{},'attributes':['id',_0xea4d('0x1f'),_0xea4d('0x20'),_0xea4d('0x21'),_0xea4d('0x22')]})['then'](function(_0x4f3a7c){if(!_0x4f3a7c){throw new Error(util[_0xea4d('0x23')](_0xea4d('0x24'),_0x41b955[_0xea4d('0x25')]['id']));}_0x298576=_0x4f3a7c;return db[_0xea4d('0x26')][_0xea4d('0x27')]({'paused':0x1},{'where':{'UserId':_0x298576['id']},'individualHooks':!![]});})[_0xea4d('0x15')](function(){return db[_0xea4d('0x28')][_0xea4d('0xd')]({'where':{'membername':_0x298576[_0xea4d('0x1f')],'type':_0xea4d('0x29'),'exitAt':null}});})[_0xea4d('0x15')](function(_0x4f8bf7){if(_0x4f8bf7&&_0x4f8bf7[_0xea4d('0x2a')]){var _0x519eab=moment()[_0xea4d('0x23')](_0xea4d('0x2b'));for(var _0x56a5c7=0x0,_0x2a8297=_0x4f8bf7[_0xea4d('0x2a')];_0x56a5c7<_0x2a8297;_0x56a5c7++){_0x4f8bf7[_0x56a5c7][_0xea4d('0x2c')]({'exitAt':_0x519eab});}}})['then'](function(){var _0x146e6b=[];var _0x31f2c7=utils[_0xea4d('0x2d')]();_0x31f2c7[_0xea4d('0x2e')](function(_0x25bcfe){_0x146e6b[_0xea4d('0x2f')]({'channel':_0x25bcfe,'membername':_0x298576[_0xea4d('0x1f')],'interface':_['isNil'](_0x298576[_0xea4d('0x22')])?util[_0xea4d('0x23')]('SIP/%s',_0x298576[_0xea4d('0x1f')]):_0x298576[_0xea4d('0x22')],'type':_0xea4d('0x29'),'enterAt':moment()[_0xea4d('0x23')](_0xea4d('0x2b')),'data1':_0x41b955[_0xea4d('0x30')][_0xea4d('0x31')]||_0xea4d('0x32'),'role':_0x298576[_0xea4d('0x20')],'internal':_0x298576[_0xea4d('0x21')],'uniqueid':_0x41b955[_0xea4d('0x30')][_0xea4d('0x33')]||null});});return db[_0xea4d('0x28')][_0xea4d('0x34')](_0x146e6b,{'individualHooks':!![]});})[_0xea4d('0x15')](function(){return _0x298576[_0xea4d('0x27')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x41b955['body']['type']||_0xea4d('0x32'),'lastPauseAt':moment()[_0xea4d('0x23')](_0xea4d('0x2b'))});})['catch'](function(_0x595c9d){throw _0x595c9d;});};exports[_0xea4d('0x35')]=function(_0x814d0a){return Promise[_0xea4d('0x36')]()['then'](function(){if(_0x814d0a[_0xea4d('0x30')][_0xea4d('0x37')]&&!utils[_0xea4d('0x38')](_0x814d0a[_0xea4d('0x30')]['channel'])){throw new Error(util[_0xea4d('0x23')](_0xea4d('0x39'),_0x814d0a[_0xea4d('0x30')]['channel']));}return db[_0xea4d('0xc')][_0xea4d('0x3a')]({'where':_0x814d0a[_0xea4d('0xe')][_0xea4d('0x1d')]||{},'attributes':['id',_0xea4d('0x1f'),'role',_0xea4d('0x21'),_0xea4d('0x22'),'online',_0xea4d('0x3b'),_0xea4d('0x3c'),_0xea4d('0x3d'),'faxPause','openchannelPause',_0xea4d('0x3e'),_0xea4d('0x3f'),_0xea4d('0x40'),_0xea4d('0x41')]});})[_0xea4d('0x15')](function(_0x295c00){if(!_0x295c00){throw new Error(util[_0xea4d('0x23')](_0xea4d('0x24'),_0x814d0a[_0xea4d('0x25')]['id']));}return _0x295c00[_0xea4d('0x42')](_0x814d0a[_0xea4d('0x30')][_0xea4d('0x37')],'system');})[_0xea4d('0x18')](function(_0x1dbe65){throw _0x1dbe65;});};exports[_0xea4d('0x43')]=function(_0x559311){var _0x443168=this;return new Promise(function(_0x1b14c6,_0x501b2c){var _0x5d775c;return db[_0xea4d('0xc')]['findOne']({'where':_0x559311[_0xea4d('0xe')][_0xea4d('0x1d')]||{},'attributes':['id','name']})[_0xea4d('0x15')](function(_0x264ab7){if(_0x264ab7){_0x5d775c=_0x264ab7;return db['UserVoiceQueueRt']['destroy']({'where':{'membername':_0x5d775c[_0xea4d('0x1f')]},'individualHooks':!![]});}})['then'](function(){if(_0x5d775c){return db['MemberReport'][_0xea4d('0xd')]({'where':{'membername':_0x5d775c['name'],'exitAt':null}});}})[_0xea4d('0x15')](function(_0x28a032){if(_0x5d775c){if(_0x28a032&&_0x28a032[_0xea4d('0x2a')]){var _0x25007d=[];_0x28a032[_0xea4d('0x2e')](function(_0x389a8c){_0x25007d[_0xea4d('0x2f')](_0x389a8c['update']({'exitAt':moment()[_0xea4d('0x23')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0xea4d('0x44')](_0x25007d);}}})[_0xea4d('0x15')](function(){if(_0x5d775c){return _0x5d775c[_0xea4d('0x27')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0xea4d('0x15')](function(_0x46cf1e){_0x1b14c6(_0x46cf1e);})['catch'](function(_0xb0f85a){_0x501b2c(_0x443168[_0xea4d('0x19')](0x1f4,_0xb0f85a[_0xea4d('0x1a')]));});});};exports['LoginUser']=function(_0x20910e){var _0xa1b376=this;return new Promise(function(_0x32feb6,_0x269173){var _0x582b18;var _0x372b71;var _0x49638f;var _0x12def6;return db[_0xea4d('0xc')]['findOne']({'where':_0x20910e['options'][_0xea4d('0x1d')]||{},'attributes':['id',_0xea4d('0x1f'),_0xea4d('0x20'),'mobile',_0xea4d('0x45'),'internal',_0xea4d('0x46'),_0xea4d('0x22')]})['then'](function(_0x42f3a3){if(_0x42f3a3){_0x582b18=_0x42f3a3;_0x12def6=_0x20910e[_0xea4d('0x30')][_0xea4d('0x22')]?_0x20910e[_0xea4d('0x30')][_0xea4d('0x22')]:util[_0xea4d('0x23')](_0xea4d('0x47'),_0x582b18[_0xea4d('0x1f')]);return db[_0xea4d('0xc')][_0xea4d('0x48')]({'where':{'role':'agent','online':!![],'id':{'$ne':_0x582b18['id']}}});}})[_0xea4d('0x15')](function(_0x4e7a93){if(_0x4e7a93){_0x49638f=_0x4e7a93;return require(_0xea4d('0x49'))[_0xea4d('0x4a')]();}})[_0xea4d('0x15')](function(_0x20c8d5){if(_0x20c8d5&&_0x20c8d5[_0xea4d('0x4b')]&&_0x49638f>=_0x20c8d5['agents']){throw new Error(_0xea4d('0x4c'));}})['then'](function(){if(_0x582b18){return db['UserVoiceQueueRt'][_0xea4d('0x4d')]({'where':{'membername':_0x582b18['name']},'individualHooks':!![]});}})['then'](function(){if(_0x582b18){return _0x582b18[_0xea4d('0x4e')]({'raw':!![]});}})[_0xea4d('0x15')](function(_0x53d3b7){if(_0x582b18){if(_0x53d3b7){var _0x129da8=[];_0x372b71=_0x53d3b7;if(_0x372b71[_0xea4d('0x2a')]){for(var _0x48e31d=0x0;_0x48e31d<_0x372b71['length'];_0x48e31d++){_0x129da8[_0xea4d('0x2f')](db[_0xea4d('0x26')][_0xea4d('0x4f')]({'membername':_0x582b18[_0xea4d('0x1f')],'UserId':_0x582b18['id'],'queue_name':_0x372b71[_0x48e31d]['name'],'VoiceQueueId':_0x372b71[_0x48e31d]['id'],'interface':_0x12def6,'paused':_0x582b18['loginInPause']||![],'penalty':_0x372b71[_0x48e31d]['UserVoiceQueue.penalty']||0x0}));}return BPromise['all'](_0x129da8);}}}})[_0xea4d('0x15')](function(){if(_0x582b18){return db[_0xea4d('0x28')][_0xea4d('0xd')]({'where':{'membername':_0x582b18[_0xea4d('0x1f')],'exitAt':null}});}})[_0xea4d('0x15')](function(_0x5bda46){if(_0x582b18){if(_0x5bda46&&_0x5bda46[_0xea4d('0x2a')]){var _0x388759=[];_0x5bda46['forEach'](function(_0x4faf88){_0x388759[_0xea4d('0x2f')](_0x4faf88['update']({'exitAt':moment()[_0xea4d('0x23')](_0xea4d('0x2b'))}));});return BPromise['all'](_0x388759);}}})[_0xea4d('0x15')](function(){if(_0x582b18){var _0xf64b37=[];var _0x3f37db=[];var _0x427c70=utils['getChannels']();var _0x22fd29={'membername':_0x582b18['name'],'interface':_0x12def6,'enterAt':moment()[_0xea4d('0x23')](_0xea4d('0x2b')),'role':_0x582b18[_0xea4d('0x20')],'internal':_0x582b18[_0xea4d('0x21')]};_0x427c70[_0xea4d('0x2e')](function(_0x29cd46){_0xf64b37[_0xea4d('0x2f')](_[_0xea4d('0x50')]({'channel':_0x29cd46,'type':'LOGIN','data1':_0xea4d('0x51'),'data2':_0x12def6},_0x22fd29));if(_0x582b18[_0xea4d('0x46')]){_0x3f37db[_0xea4d('0x2f')](_[_0xea4d('0x50')]({'channel':_0x29cd46,'type':_0xea4d('0x29'),'data1':_0xea4d('0x52')},_0x22fd29));}});return db[_0xea4d('0x28')]['bulkCreate'](_0xf64b37[_0xea4d('0x53')](_0x3f37db),{'individualHooks':!![]});}})['then'](function(){if(_0x582b18){return _0x582b18[_0xea4d('0x27')]({'online':!![],'lastLoginAt':moment()['format'](_0xea4d('0x2b')),'voicePause':_0x582b18[_0xea4d('0x46')]||![],'mailPause':_0x582b18[_0xea4d('0x46')]||![],'chatPause':_0x582b18[_0xea4d('0x46')]||![],'faxPause':_0x582b18[_0xea4d('0x46')]||![],'smsPause':_0x582b18[_0xea4d('0x46')]||![],'openchannelPause':_0x582b18['loginInPause']||![],'pauseType':_0x582b18['loginInPause']?'LOGININPAUSE':null,'lastPauseAt':moment()[_0xea4d('0x23')](_0xea4d('0x2b')),'interface':_0x12def6});}})[_0xea4d('0x15')](function(_0x19dbf8){_0x32feb6(_0x19dbf8);})[_0xea4d('0x18')](function(_0x2d56a9){_0x269173(_0xa1b376[_0xea4d('0x19')](0x1f4,_0x2d56a9[_0xea4d('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 6fba56a..b54c625 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 _0x8c45=['update','removeListener','register','length','user:','./user.events','save','remove'];(function(_0x1bb739,_0x3c6879){var _0x375990=function(_0x4e9bea){while(--_0x4e9bea){_0x1bb739['push'](_0x1bb739['shift']());}};_0x375990(++_0x3c6879);}(_0x8c45,0xa5));var _0x58c4=function(_0x1880f5,_0xe42290){_0x1880f5=_0x1880f5-0x0;var _0x167858=_0x8c45[_0x1880f5];return _0x167858;};'use strict';var UserEvents=require(_0x58c4('0x0'));var events=[_0x58c4('0x1'),_0x58c4('0x2'),_0x58c4('0x3')];function createListener(_0x281694,_0x4114c3){return function(_0x3a3c7d){_0x4114c3['emit'](_0x281694,_0x3a3c7d);};}function removeListener(_0x1a688e,_0x4e4f10){return function(){UserEvents[_0x58c4('0x4')](_0x1a688e,_0x4e4f10);};}exports[_0x58c4('0x5')]=function(_0x7c8eb4){for(var _0x5a13e4=0x0,_0x471c31=events[_0x58c4('0x6')];_0x5a13e4<_0x471c31;_0x5a13e4++){var _0x4714db=events[_0x5a13e4];var _0x4282d0=createListener(_0x58c4('0x7')+_0x4714db,_0x7c8eb4);UserEvents['on'](_0x4714db,_0x4282d0);}}; \ No newline at end of file +var _0x3045=['save','remove','removeListener','register','length','user:','./user.events'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x3045,0xfb));var _0x5304=function(_0x1c2248,_0x28f775){_0x1c2248=_0x1c2248-0x0;var _0x3d4061=_0x3045[_0x1c2248];return _0x3d4061;};'use strict';var UserEvents=require(_0x5304('0x0'));var events=[_0x5304('0x1'),_0x5304('0x2'),'update'];function createListener(_0x13bb91,_0x1abfcb){return function(_0x363f2b){_0x1abfcb['emit'](_0x13bb91,_0x363f2b);};}function removeListener(_0x41c57e,_0x1dea90){return function(){UserEvents[_0x5304('0x3')](_0x41c57e,_0x1dea90);};}exports[_0x5304('0x4')]=function(_0x45e739){for(var _0x541b2f=0x0,_0x251c5b=events[_0x5304('0x5')];_0x541b2f<_0x251c5b;_0x541b2f++){var _0x2af98f=events[_0x541b2f];var _0x2e088f=createListener(_0x5304('0x6')+_0x2af98f,_0x45e739);UserEvents['on'](_0x2af98f,_0x2e088f);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 4cdb611..9f5cb2e 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x44abd2,_0x2d34c8){var _0x4938dc=function(_0x437fdb){while(--_0x437fdb){_0x44abd2['push'](_0x44abd2['shift']());}};_0x4938dc(++_0x2d34c8);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x4c8544,_0x44266a){var _0x41983a=function(_0xc02f9d){while(--_0xc02f9d){_0x4c8544['push'](_0x4c8544['shift']());}};_0x41983a(++_0x44266a);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x381379,_0x3f3b86){_0x381379=_0x381379-0x0;var _0x3e1063=_0xcb91[_0x381379];return _0x3e1063;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index 79884d5..7600a9a 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 _0x499f=['sequelize','exports','INTEGER'];(function(_0x8b33aa,_0x5c3960){var _0x1eab35=function(_0x390b73){while(--_0x390b73){_0x8b33aa['push'](_0x8b33aa['shift']());}};_0x1eab35(++_0x5c3960);}(_0x499f,0x99));var _0xf499=function(_0x412e27,_0x20a978){_0x412e27=_0x412e27-0x0;var _0x53da42=_0x499f[_0x412e27];return _0x53da42;};'use strict';var Sequelize=require(_0xf499('0x0'));module[_0xf499('0x1')]={'penalty':{'type':Sequelize[_0xf499('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x77aa=['sequelize','exports','INTEGER'];(function(_0x50dd23,_0x2882a4){var _0x42598c=function(_0x438c5b){while(--_0x438c5b){_0x50dd23['push'](_0x50dd23['shift']());}};_0x42598c(++_0x2882a4);}(_0x77aa,0x126));var _0xa77a=function(_0x182f4d,_0x219691){_0x182f4d=_0x182f4d-0x0;var _0x557d88=_0x77aa[_0x182f4d];return _0x557d88;};'use strict';var Sequelize=require(_0xa77a('0x0'));module[_0xa77a('0x1')]={'penalty':{'type':Sequelize[_0xa77a('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 b929501..7c0adae 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 _0x8cc4=['rimraf','../../config/environment','exports','define','UserChatQueue','user_has_chat_queues','util','../../config/logger','api','moment','request-promise'];(function(_0x1731a3,_0x3443b2){var _0x38b4fc=function(_0x496afe){while(--_0x496afe){_0x1731a3['push'](_0x1731a3['shift']());}};_0x38b4fc(++_0x3443b2);}(_0x8cc4,0xd7));var _0x48cc=function(_0x1e7aff,_0x1c843b){_0x1e7aff=_0x1e7aff-0x0;var _0x2a16bf=_0x8cc4[_0x1e7aff];return _0x2a16bf;};'use strict';var _=require('lodash');var util=require(_0x48cc('0x0'));var logger=require(_0x48cc('0x1'))(_0x48cc('0x2'));var moment=require(_0x48cc('0x3'));var BPromise=require('bluebird');var rp=require(_0x48cc('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x48cc('0x5'));var config=require(_0x48cc('0x6'));var attributes=require('./userChatQueue.attributes');module[_0x48cc('0x7')]=function(_0x2678d4,_0x16d9ce){return _0x2678d4[_0x48cc('0x8')](_0x48cc('0x9'),attributes,{'tableName':_0x48cc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2ec2=['rimraf','../../config/environment','./userChatQueue.attributes','exports','define','user_has_chat_queues','lodash','../../config/logger','moment','bluebird','path'];(function(_0xdd827a,_0x482ad2){var _0x2f46f1=function(_0x221046){while(--_0x221046){_0xdd827a['push'](_0xdd827a['shift']());}};_0x2f46f1(++_0x482ad2);}(_0x2ec2,0x1a8));var _0x22ec=function(_0x413b4d,_0xa3459c){_0x413b4d=_0x413b4d-0x0;var _0x8b810a=_0x2ec2[_0x413b4d];return _0x8b810a;};'use strict';var _=require(_0x22ec('0x0'));var util=require('util');var logger=require(_0x22ec('0x1'))('api');var moment=require(_0x22ec('0x2'));var BPromise=require(_0x22ec('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x22ec('0x4'));var rimraf=require(_0x22ec('0x5'));var config=require(_0x22ec('0x6'));var attributes=require(_0x22ec('0x7'));module[_0x22ec('0x8')]=function(_0x141097,_0x88aa46){return _0x141097[_0x22ec('0x9')]('UserChatQueue',attributes,{'tableName':_0x22ec('0xa'),'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 e910e86..77c446c 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 _0xe492=['then','UserChatQueue,\x20%s,\x20%s','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http'];(function(_0x598f06,_0x24b96e){var _0x245105=function(_0x37fe16){while(--_0x37fe16){_0x598f06['push'](_0x598f06['shift']());}};_0x245105(++_0x24b96e);}(_0xe492,0x1be));var _0x2e49=function(_0x20f39f,_0x1b6b7a){_0x20f39f=_0x20f39f-0x0;var _0x1f65cd=_0xe492[_0x20f39f];return _0x1f65cd;};'use strict';var _=require(_0x2e49('0x0'));var util=require(_0x2e49('0x1'));var moment=require(_0x2e49('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2e49('0x3'));var db=require(_0x2e49('0x4'))['db'];var utils=require(_0x2e49('0x5'));var logger=require(_0x2e49('0x6'))('rpc');var config=require(_0x2e49('0x7'));var jayson=require(_0x2e49('0x8'));var client=jayson['client'][_0x2e49('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xa7983,_0xa72269,_0x1c40b4){return new BPromise(function(_0x472527,_0x48027d){return client['request'](_0xa7983,_0x1c40b4)[_0x2e49('0xa')](function(_0x46e6ef){logger['info'](_0x2e49('0xb'),_0xa72269,'request\x20sent');logger[_0x2e49('0xc')](_0x2e49('0xd'),_0xa72269,_0x2e49('0xe'),JSON['stringify'](_0x46e6ef));if(_0x46e6ef['error']){if(_0x46e6ef[_0x2e49('0xf')][_0x2e49('0x10')]===0x1f4){logger[_0x2e49('0xf')](_0x2e49('0xb'),_0xa72269,_0x46e6ef[_0x2e49('0xf')]['message']);return _0x48027d(_0x46e6ef[_0x2e49('0xf')]['message']);}logger[_0x2e49('0xf')](_0x2e49('0xb'),_0xa72269,_0x46e6ef[_0x2e49('0xf')]['message']);return _0x472527(_0x46e6ef[_0x2e49('0xf')]['message']);}else{logger['info'](_0x2e49('0xb'),_0xa72269,_0x2e49('0xe'));_0x472527(_0x46e6ef['result'][_0x2e49('0x11')]);}})[_0x2e49('0x12')](function(_0x23a1d7){logger['error'](_0x2e49('0xb'),_0xa72269,_0x23a1d7);_0x48027d(_0x23a1d7);});});} \ No newline at end of file +var _0x6aeb=['moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','http','then','info','UserChatQueue,\x20%s,\x20%s','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util'];(function(_0x426fd7,_0x4ccbc3){var _0x1f920f=function(_0x49532d){while(--_0x49532d){_0x426fd7['push'](_0x426fd7['shift']());}};_0x1f920f(++_0x4ccbc3);}(_0x6aeb,0x124));var _0xb6ae=function(_0xd09668,_0x1435b2){_0xd09668=_0xd09668-0x0;var _0x68726=_0x6aeb[_0xd09668];return _0x68726;};'use strict';var _=require(_0xb6ae('0x0'));var util=require(_0xb6ae('0x1'));var moment=require(_0xb6ae('0x2'));var BPromise=require(_0xb6ae('0x3'));var rs=require(_0xb6ae('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb6ae('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb6ae('0x6'))(_0xb6ae('0x7'));var config=require('../../config/environment');var jayson=require(_0xb6ae('0x8'));var client=jayson['client'][_0xb6ae('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x61cdc,_0x37ab03,_0x4c7a2b){return new BPromise(function(_0x2589d7,_0x59b277){return client['request'](_0x61cdc,_0x4c7a2b)[_0xb6ae('0xa')](function(_0x303e58){logger[_0xb6ae('0xb')](_0xb6ae('0xc'),_0x37ab03,'request\x20sent');logger[_0xb6ae('0xd')](_0xb6ae('0xe'),_0x37ab03,_0xb6ae('0xf'),JSON[_0xb6ae('0x10')](_0x303e58));if(_0x303e58[_0xb6ae('0x11')]){if(_0x303e58[_0xb6ae('0x11')]['code']===0x1f4){logger[_0xb6ae('0x11')](_0xb6ae('0xc'),_0x37ab03,_0x303e58['error'][_0xb6ae('0x12')]);return _0x59b277(_0x303e58['error'][_0xb6ae('0x12')]);}logger[_0xb6ae('0x11')](_0xb6ae('0xc'),_0x37ab03,_0x303e58[_0xb6ae('0x11')][_0xb6ae('0x12')]);return _0x2589d7(_0x303e58[_0xb6ae('0x11')]['message']);}else{logger['info'](_0xb6ae('0xc'),_0x37ab03,_0xb6ae('0xf'));_0x2589d7(_0x303e58[_0xb6ae('0x13')][_0xb6ae('0x12')]);}})[_0xb6ae('0x14')](function(_0x3ff1fb){logger['error'](_0xb6ae('0xc'),_0x37ab03,_0x3ff1fb);_0x59b277(_0x3ff1fb);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 9231b51..af328c1 100644 --- a/server/api/userFaxQueue/index.js +++ b/server/api/userFaxQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x10af85,_0x4893e9){var _0x5cbc21=function(_0x3bdb58){while(--_0x3bdb58){_0x10af85['push'](_0x10af85['shift']());}};_0x5cbc21(++_0x4893e9);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x32ff1d,_0x3e29bb){var _0x50489e=function(_0x588ff3){while(--_0x588ff3){_0x32ff1d['push'](_0x32ff1d['shift']());}};_0x50489e(++_0x3e29bb);}(_0x9c44,0x178));var _0x49c4=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x9c44[_0x53ccf2];return _0x5a2964;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index 803e893..d67bd87 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 _0x5756=['sequelize','exports','INTEGER','STRING'];(function(_0x2fc194,_0x5a6371){var _0x1cfa54=function(_0x2e3e0a){while(--_0x2e3e0a){_0x2fc194['push'](_0x2fc194['shift']());}};_0x1cfa54(++_0x5a6371);}(_0x5756,0xa8));var _0x6575=function(_0x4f666c,_0xddfc4a){_0x4f666c=_0x4f666c-0x0;var _0x40fdc4=_0x5756[_0x4f666c];return _0x40fdc4;};'use strict';var Sequelize=require(_0x6575('0x0'));module[_0x6575('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x6575('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x6575('0x3')]}}; \ No newline at end of file +var _0x0e6a=['sequelize','exports','INTEGER','STRING'];(function(_0x827e20,_0x7ea620){var _0x403c34=function(_0x3cd458){while(--_0x3cd458){_0x827e20['push'](_0x827e20['shift']());}};_0x403c34(++_0x7ea620);}(_0x0e6a,0x7c));var _0xa0e6=function(_0x874cf1,_0x2a4954){_0x874cf1=_0x874cf1-0x0;var _0x233579=_0x0e6a[_0x874cf1];return _0x233579;};'use strict';var Sequelize=require(_0xa0e6('0x0'));module[_0xa0e6('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xa0e6('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0xa0e6('0x3')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index fcb631f..3d3568f 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 _0x568a=['./userFaxQueue.attributes','exports','define','UserFaxQueue','user_has_fax_queues','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x568a,0x144));var _0xa568=function(_0x1fc122,_0x5e2c17){_0x1fc122=_0x1fc122-0x0;var _0xa2cb13=_0x568a[_0x1fc122];return _0xa2cb13;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa568('0x0'))(_0xa568('0x1'));var moment=require(_0xa568('0x2'));var BPromise=require(_0xa568('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa568('0x4'));var rimraf=require(_0xa568('0x5'));var config=require('../../config/environment');var attributes=require(_0xa568('0x6'));module[_0xa568('0x7')]=function(_0x2145b3,_0x279f65){return _0x2145b3[_0xa568('0x8')](_0xa568('0x9'),attributes,{'tableName':_0xa568('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x256e=['path','rimraf','./userFaxQueue.attributes','exports','UserFaxQueue','user_has_fax_queues','util','api','moment','bluebird','request-promise'];(function(_0x47a6b7,_0x33d26e){var _0x29395a=function(_0x1f6221){while(--_0x1f6221){_0x47a6b7['push'](_0x47a6b7['shift']());}};_0x29395a(++_0x33d26e);}(_0x256e,0x12f));var _0xe256=function(_0x1dae31,_0xb467ef){_0x1dae31=_0x1dae31-0x0;var _0x3827f4=_0x256e[_0x1dae31];return _0x3827f4;};'use strict';var _=require('lodash');var util=require(_0xe256('0x0'));var logger=require('../../config/logger')(_0xe256('0x1'));var moment=require(_0xe256('0x2'));var BPromise=require(_0xe256('0x3'));var rp=require(_0xe256('0x4'));var fs=require('fs');var path=require(_0xe256('0x5'));var rimraf=require(_0xe256('0x6'));var config=require('../../config/environment');var attributes=require(_0xe256('0x7'));module[_0xe256('0x8')]=function(_0x5a397c,_0x41070b){return _0x5a397c['define'](_0xe256('0x9'),attributes,{'tableName':_0xe256('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.rpc.js b/server/api/userFaxQueue/userFaxQueue.rpc.js index 68ff84a..e04b8c1 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 _0x0b29=['http','request','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x4631bc,_0x33ecc7){var _0x15aa5c=function(_0x138339){while(--_0x138339){_0x4631bc['push'](_0x4631bc['shift']());}};_0x15aa5c(++_0x33ecc7);}(_0x0b29,0x17c));var _0x90b2=function(_0x6afa2d,_0x8c0e0f){_0x6afa2d=_0x6afa2d-0x0;var _0x1698ee=_0x0b29[_0x6afa2d];return _0x1698ee;};'use strict';var _=require(_0x90b2('0x0'));var util=require(_0x90b2('0x1'));var moment=require(_0x90b2('0x2'));var BPromise=require('bluebird');var rs=require(_0x90b2('0x3'));var fs=require('fs');var Redis=require(_0x90b2('0x4'));var db=require(_0x90b2('0x5'))['db'];var utils=require(_0x90b2('0x6'));var logger=require(_0x90b2('0x7'))(_0x90b2('0x8'));var config=require(_0x90b2('0x9'));var jayson=require(_0x90b2('0xa'));var client=jayson['client'][_0x90b2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4131b1,_0x5f0e2e,_0x3b25a1){return new BPromise(function(_0x1d76f1,_0x46f827){return client[_0x90b2('0xc')](_0x4131b1,_0x3b25a1)['then'](function(_0x30ce4d){logger[_0x90b2('0xd')](_0x90b2('0xe'),_0x5f0e2e,_0x90b2('0xf'));logger['debug'](_0x90b2('0x10'),_0x5f0e2e,_0x90b2('0xf'),JSON[_0x90b2('0x11')](_0x30ce4d));if(_0x30ce4d[_0x90b2('0x12')]){if(_0x30ce4d[_0x90b2('0x12')][_0x90b2('0x13')]===0x1f4){logger[_0x90b2('0x12')](_0x90b2('0xe'),_0x5f0e2e,_0x30ce4d[_0x90b2('0x12')][_0x90b2('0x14')]);return _0x46f827(_0x30ce4d[_0x90b2('0x12')][_0x90b2('0x14')]);}logger[_0x90b2('0x12')](_0x90b2('0xe'),_0x5f0e2e,_0x30ce4d['error'][_0x90b2('0x14')]);return _0x1d76f1(_0x30ce4d[_0x90b2('0x12')][_0x90b2('0x14')]);}else{logger[_0x90b2('0xd')](_0x90b2('0xe'),_0x5f0e2e,_0x90b2('0xf'));_0x1d76f1(_0x30ce4d[_0x90b2('0x15')]['message']);}})[_0x90b2('0x16')](function(_0x4d1e73){logger[_0x90b2('0x12')](_0x90b2('0xe'),_0x5f0e2e,_0x4d1e73);_0x46f827(_0x4d1e73);});});} \ No newline at end of file +var _0xd46e=['UserFaxQueue,\x20%s,\x20%s','request\x20sent','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','client','http','request'];(function(_0x18e1ae,_0x1b6789){var _0x3acf76=function(_0x53c107){while(--_0x53c107){_0x18e1ae['push'](_0x18e1ae['shift']());}};_0x3acf76(++_0x1b6789);}(_0xd46e,0x104));var _0xed46=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0xd46e[_0x88cd7b];return _0x56fcc8;};'use strict';var _=require(_0xed46('0x0'));var util=require(_0xed46('0x1'));var moment=require(_0xed46('0x2'));var BPromise=require('bluebird');var rs=require(_0xed46('0x3'));var fs=require('fs');var Redis=require(_0xed46('0x4'));var db=require(_0xed46('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xed46('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xed46('0x7')][_0xed46('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xca8848,_0x92683c,_0x20d4df){return new BPromise(function(_0x2d3a1d,_0x453817){return client[_0xed46('0x9')](_0xca8848,_0x20d4df)['then'](function(_0x5e054d){logger['info'](_0xed46('0xa'),_0x92683c,_0xed46('0xb'));logger['debug'](_0xed46('0xc'),_0x92683c,'request\x20sent',JSON[_0xed46('0xd')](_0x5e054d));if(_0x5e054d['error']){if(_0x5e054d[_0xed46('0xe')]['code']===0x1f4){logger[_0xed46('0xe')](_0xed46('0xa'),_0x92683c,_0x5e054d[_0xed46('0xe')][_0xed46('0xf')]);return _0x453817(_0x5e054d[_0xed46('0xe')][_0xed46('0xf')]);}logger['error']('UserFaxQueue,\x20%s,\x20%s',_0x92683c,_0x5e054d[_0xed46('0xe')]['message']);return _0x2d3a1d(_0x5e054d[_0xed46('0xe')][_0xed46('0xf')]);}else{logger['info'](_0xed46('0xa'),_0x92683c,_0xed46('0xb'));_0x2d3a1d(_0x5e054d[_0xed46('0x10')][_0xed46('0xf')]);}})[_0xed46('0x11')](function(_0x1cd83a){logger[_0xed46('0xe')](_0xed46('0xa'),_0x92683c,_0x1cd83a);_0x453817(_0x1cd83a);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index dbe1d6e..f05883d 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x4fbdf4,_0x2719b1){var _0x186fce=function(_0x1b3fb8){while(--_0x1b3fb8){_0x4fbdf4['push'](_0x4fbdf4['shift']());}};_0x186fce(++_0x2719b1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0xa9e0[_0x521929];return _0x632436;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x418d84,_0xecaca0){var _0x3077f1=function(_0x99f53e){while(--_0x99f53e){_0x418d84['push'](_0x418d84['shift']());}};_0x3077f1(++_0xecaca0);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index 50fecb5..890edf6 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 _0x9e5c=['INTEGER','sequelize'];(function(_0x5b4183,_0x2184db){var _0x9a3b8f=function(_0x2cd562){while(--_0x2cd562){_0x5b4183['push'](_0x5b4183['shift']());}};_0x9a3b8f(++_0x2184db);}(_0x9e5c,0x17f));var _0xc9e5=function(_0x10fb94,_0x50d7b3){_0x10fb94=_0x10fb94-0x0;var _0x36a9eb=_0x9e5c[_0x10fb94];return _0x36a9eb;};'use strict';var Sequelize=require(_0xc9e5('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xc9e5('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x7ad9=['exports','sequelize'];(function(_0x1ba1e4,_0x4505e6){var _0x27ae54=function(_0x47bdb5){while(--_0x47bdb5){_0x1ba1e4['push'](_0x1ba1e4['shift']());}};_0x27ae54(++_0x4505e6);}(_0x7ad9,0x16f));var _0x97ad=function(_0x4b1d61,_0x1586d1){_0x4b1d61=_0x4b1d61-0x0;var _0x1a0e11=_0x7ad9[_0x4b1d61];return _0x1a0e11;};'use strict';var Sequelize=require(_0x97ad('0x0'));module[_0x97ad('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.model.js b/server/api/userMailQueue/userMailQueue.model.js index 458a5ed..e7241c3 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 _0xa4be=['bluebird','request-promise','path','rimraf','../../config/environment','./userMailQueue.attributes','exports','define','UserMailQueue','user_has_mail_queues','util','api','moment'];(function(_0x4bc4c8,_0x3139d3){var _0x3bb121=function(_0x95ad12){while(--_0x95ad12){_0x4bc4c8['push'](_0x4bc4c8['shift']());}};_0x3bb121(++_0x3139d3);}(_0xa4be,0x183));var _0xea4b=function(_0x17764f,_0x51e641){_0x17764f=_0x17764f-0x0;var _0x53d622=_0xa4be[_0x17764f];return _0x53d622;};'use strict';var _=require('lodash');var util=require(_0xea4b('0x0'));var logger=require('../../config/logger')(_0xea4b('0x1'));var moment=require(_0xea4b('0x2'));var BPromise=require(_0xea4b('0x3'));var rp=require(_0xea4b('0x4'));var fs=require('fs');var path=require(_0xea4b('0x5'));var rimraf=require(_0xea4b('0x6'));var config=require(_0xea4b('0x7'));var attributes=require(_0xea4b('0x8'));module[_0xea4b('0x9')]=function(_0x36ec39,_0x2869e1){return _0x36ec39[_0xea4b('0xa')](_0xea4b('0xb'),attributes,{'tableName':_0xea4b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x85d3=['moment','request-promise','path','../../config/environment','./userMailQueue.attributes','exports','define','UserMailQueue','user_has_mail_queues','util','../../config/logger'];(function(_0x837259,_0x3adb94){var _0x4d2be3=function(_0x58901d){while(--_0x58901d){_0x837259['push'](_0x837259['shift']());}};_0x4d2be3(++_0x3adb94);}(_0x85d3,0x1e2));var _0x385d=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x85d3[_0x6131cd];return _0x47e916;};'use strict';var _=require('lodash');var util=require(_0x385d('0x0'));var logger=require(_0x385d('0x1'))('api');var moment=require(_0x385d('0x2'));var BPromise=require('bluebird');var rp=require(_0x385d('0x3'));var fs=require('fs');var path=require(_0x385d('0x4'));var rimraf=require('rimraf');var config=require(_0x385d('0x5'));var attributes=require(_0x385d('0x6'));module[_0x385d('0x7')]=function(_0x4a1c2d,_0x4bda2e){return _0x4a1c2d[_0x385d('0x8')](_0x385d('0x9'),attributes,{'tableName':_0x385d('0xa'),'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 c7b4aed..42fa682 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 _0x6aa7=['result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','request','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x2d51c,_0x1ede00){var _0x168af9=function(_0x57a1bc){while(--_0x57a1bc){_0x2d51c['push'](_0x2d51c['shift']());}};_0x168af9(++_0x1ede00);}(_0x6aa7,0x178));var _0x76aa=function(_0x417249,_0x4c0da5){_0x417249=_0x417249-0x0;var _0x31ae9a=_0x6aa7[_0x417249];return _0x31ae9a;};'use strict';var _=require(_0x76aa('0x0'));var util=require('util');var moment=require(_0x76aa('0x1'));var BPromise=require(_0x76aa('0x2'));var rs=require(_0x76aa('0x3'));var fs=require('fs');var Redis=require(_0x76aa('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x76aa('0x5'));var logger=require(_0x76aa('0x6'))(_0x76aa('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x76aa('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x32dee5,_0x36d12b,_0xa9b695){return new BPromise(function(_0x56d6bc,_0x3dae33){return client[_0x76aa('0x9')](_0x32dee5,_0xa9b695)[_0x76aa('0xa')](function(_0x557d69){logger[_0x76aa('0xb')](_0x76aa('0xc'),_0x36d12b,_0x76aa('0xd'));logger[_0x76aa('0xe')](_0x76aa('0xf'),_0x36d12b,_0x76aa('0xd'),JSON[_0x76aa('0x10')](_0x557d69));if(_0x557d69[_0x76aa('0x11')]){if(_0x557d69[_0x76aa('0x11')][_0x76aa('0x12')]===0x1f4){logger['error'](_0x76aa('0xc'),_0x36d12b,_0x557d69['error'][_0x76aa('0x13')]);return _0x3dae33(_0x557d69[_0x76aa('0x11')][_0x76aa('0x13')]);}logger[_0x76aa('0x11')](_0x76aa('0xc'),_0x36d12b,_0x557d69['error']['message']);return _0x56d6bc(_0x557d69[_0x76aa('0x11')]['message']);}else{logger[_0x76aa('0xb')](_0x76aa('0xc'),_0x36d12b,'request\x20sent');_0x56d6bc(_0x557d69[_0x76aa('0x14')]['message']);}})[_0x76aa('0x15')](function(_0x5181d2){logger[_0x76aa('0x11')](_0x76aa('0xc'),_0x36d12b,_0x5181d2);_0x3dae33(_0x5181d2);});});} \ No newline at end of file +var _0x7217=['stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserMailQueue,\x20%s,\x20%s','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0x7217,0x19e));var _0x7721=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0x7217[_0x12d033];return _0x3b4e80;};'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')]('UserMailQueue,\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']('UserMailQueue,\x20%s,\x20%s',_0x18ab6b,'request\x20sent');_0x225610(_0xfa8835[_0x7721('0x16')][_0x7721('0x15')]);}})[_0x7721('0x17')](function(_0x32550d){logger['error'](_0x7721('0xe'),_0x18ab6b,_0x32550d);_0x2f99ed(_0x32550d);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index 83bade8..92537f0 100644 --- a/server/api/userNotification/index.js +++ b/server/api/userNotification/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8912=['isAuthenticated','multer','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x55a76a,_0x2d0203){var _0x45885a=function(_0x4348d5){while(--_0x4348d5){_0x55a76a['push'](_0x55a76a['shift']());}};_0x45885a(++_0x2d0203);}(_0x8912,0x1e9));var _0x2891=function(_0x361ffa,_0x185d90){_0x361ffa=_0x361ffa-0x0;var _0x151653=_0x8912[_0x361ffa];return _0x151653;};'use strict';var multer=require(_0x2891('0x0'));var util=require('util');var path=require(_0x2891('0x1'));var timeout=require('connect-timeout');var express=require(_0x2891('0x2'));var router=express[_0x2891('0x3')]();var fs_extra=require(_0x2891('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2891('0x5'));var config=require(_0x2891('0x6'));var controller=require('./userNotification.controller');router['post']('/',auth[_0x2891('0x7')](),controller['sendUserNotification']);module['exports']=router; \ No newline at end of file +var _0x373b=['util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','post','isAuthenticated','sendUserNotification','exports','multer'];(function(_0x5a0451,_0x2376b7){var _0x332372=function(_0x2ee813){while(--_0x2ee813){_0x5a0451['push'](_0x5a0451['shift']());}};_0x332372(++_0x2376b7);}(_0x373b,0x83));var _0xb373=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x373b[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0xb373('0x0'));var util=require(_0xb373('0x1'));var path=require(_0xb373('0x2'));var timeout=require(_0xb373('0x3'));var express=require('express');var router=express[_0xb373('0x4')]();var fs_extra=require(_0xb373('0x5'));var auth=require(_0xb373('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xb373('0x7'));var controller=require('./userNotification.controller');router[_0xb373('0x8')]('/',auth[_0xb373('0x9')](),controller[_0xb373('0xa')]);module[_0xb373('0xb')]=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index 93c8a4d..7014074 100644 --- a/server/api/userNotification/userNotification.attributes.js +++ b/server/api/userNotification/userNotification.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdd1b=['STRING','BOOLEAN','sequelize','exports','TEXT'];(function(_0x10df1e,_0xf56f85){var _0x3e24fb=function(_0x5cdb59){while(--_0x5cdb59){_0x10df1e['push'](_0x10df1e['shift']());}};_0x3e24fb(++_0xf56f85);}(_0xdd1b,0xd9));var _0xbdd1=function(_0x4e4519,_0x392ae){_0x4e4519=_0x4e4519-0x0;var _0x340044=_0xdd1b[_0x4e4519];return _0x340044;};'use strict';var Sequelize=require(_0xbdd1('0x0'));module[_0xbdd1('0x1')]={'body':{'type':Sequelize[_0xbdd1('0x2')]},'senderName':{'type':Sequelize[_0xbdd1('0x3')]},'recipientsId':{'type':Sequelize[_0xbdd1('0x2')]},'recipientsDescription':{'type':Sequelize[_0xbdd1('0x3')]},'beep':{'type':Sequelize[_0xbdd1('0x4')]}}; \ No newline at end of file +var _0xe358=['sequelize','exports','TEXT','STRING','BOOLEAN'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xe358,0x1f4));var _0x8e35=function(_0x19c5f2,_0x44ed13){_0x19c5f2=_0x19c5f2-0x0;var _0xb94caf=_0xe358[_0x19c5f2];return _0xb94caf;};'use strict';var Sequelize=require(_0x8e35('0x0'));module[_0x8e35('0x1')]={'body':{'type':Sequelize[_0x8e35('0x2')]},'senderName':{'type':Sequelize[_0x8e35('0x3')]},'recipientsId':{'type':Sequelize['TEXT']},'recipientsDescription':{'type':Sequelize[_0x8e35('0x3')]},'beep':{'type':Sequelize[_0x8e35('0x4')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index 8188fe1..5d8f232 100644 --- a/server/api/userNotification/userNotification.controller.js +++ b/server/api/userNotification/userNotification.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x58ff=['hasOwnProperty','TemplateId','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','Sequelize','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue','openchannelqueue','voicequeue','whatsappqueue','team','user','some','includes','model','toLowerCase','senderName','recipientsDescription','isEmpty','beep','SenderId','recipientsId','sortBy','join','sequelize','transaction','create','forEach','recipient','userNotification:send','catch','text','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','union','ids','queue','replace','push','all','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','error','stack','name','send','sendUserNotification','body'];(function(_0x3fba9f,_0x3b7b9b){var _0x192cf1=function(_0x557290){while(--_0x557290){_0x3fba9f['push'](_0x3fba9f['shift']());}};_0x192cf1(++_0x3b7b9b);}(_0x58ff,0x16d));var _0xf58f=function(_0x14fcba,_0x50c100){_0x14fcba=_0x14fcba-0x0;var _0x574d8e=_0x58ff[_0x14fcba];return _0x574d8e;};'use strict';var emlformat=require(_0xf58f('0x0'));var rimraf=require(_0xf58f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf58f('0x2'));var rp=require(_0xf58f('0x3'));var moment=require(_0xf58f('0x4'));var BPromise=require(_0xf58f('0x5'));var Mustache=require(_0xf58f('0x6'));var util=require(_0xf58f('0x7'));var path=require(_0xf58f('0x8'));var sox=require(_0xf58f('0x9'));var csv=require(_0xf58f('0xa'));var ejs=require(_0xf58f('0xb'));var fs=require('fs');var fs_extra=require(_0xf58f('0xc'));var _=require(_0xf58f('0xd'));var squel=require(_0xf58f('0xe'));var crypto=require(_0xf58f('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xf58f('0x10'));var toCsv=require(_0xf58f('0xa'));var querystring=require(_0xf58f('0x11'));var Papa=require(_0xf58f('0x12'));var Redis=require(_0xf58f('0x13'));var authService=require(_0xf58f('0x14'));var qs=require(_0xf58f('0x15'));var as=require(_0xf58f('0x16'));var hardwareService=require(_0xf58f('0x17'));var logger=require(_0xf58f('0x18'))('api');var utils=require(_0xf58f('0x19'));var config=require(_0xf58f('0x1a'));var licenseUtil=require(_0xf58f('0x1b'));var db=require(_0xf58f('0x1c'))['db'];config[_0xf58f('0x1d')]=_[_0xf58f('0x1e')](config[_0xf58f('0x1d')],{'host':_0xf58f('0x1f'),'port':0x18eb});var socket=require(_0xf58f('0x20'))(new Redis(config[_0xf58f('0x1d')]));require(_0xf58f('0x21'))[_0xf58f('0x22')](socket);function respondWithStatusCode(_0x31290b,_0x55870e){_0x55870e=_0x55870e||0xcc;return function(_0x172b76){if(_0x172b76){return _0x31290b[_0xf58f('0x23')](_0x55870e);}return _0x31290b[_0xf58f('0x24')](_0x55870e)[_0xf58f('0x25')]();};}function respondWithResult(_0x466fa7,_0x161fd1){_0x161fd1=_0x161fd1||0xc8;return function(_0x16f45e){if(_0x16f45e){return _0x466fa7['status'](_0x161fd1)[_0xf58f('0x26')](_0x16f45e);}};}function respondWithFilteredResult(_0x3ec987,_0x29b029){return function(_0x5a8152){if(_0x5a8152){var _0x1c6d9f=typeof _0x29b029[_0xf58f('0x27')]===_0xf58f('0x28')&&typeof _0x29b029[_0xf58f('0x29')]===_0xf58f('0x28');var _0x176bf8=_0x5a8152['count'];var _0x5aeea6=_0x1c6d9f?0x0:_0x29b029[_0xf58f('0x27')];var _0x8adf13=_0x1c6d9f?_0x5a8152[_0xf58f('0x2a')]:_0x29b029[_0xf58f('0x27')]+_0x29b029[_0xf58f('0x29')];var _0x1f23b3;if(_0x8adf13>=_0x176bf8){_0x8adf13=_0x176bf8;_0x1f23b3=0xc8;}else{_0x1f23b3=0xce;}_0x3ec987[_0xf58f('0x24')](_0x1f23b3);return _0x3ec987[_0xf58f('0x2b')]('Content-Range',_0x5aeea6+'-'+_0x8adf13+'/'+_0x176bf8)[_0xf58f('0x26')](_0x5a8152);}return null;};}function patchUpdates(_0x186a2e){return function(_0x2e334d){try{jsonpatch[_0xf58f('0x2c')](_0x2e334d,_0x186a2e,!![]);}catch(_0x561b8b){return BPromise[_0xf58f('0x2d')](_0x561b8b);}return _0x2e334d[_0xf58f('0x2e')]();};}function saveUpdates(_0x403f9f,_0x4a2df3){return function(_0x19fb82){if(_0x19fb82){return _0x19fb82[_0xf58f('0x2f')](_0x403f9f)[_0xf58f('0x30')](function(_0x534ed0){return _0x534ed0;});}return null;};}function removeEntity(_0x28282a,_0x180231){return function(_0x1a24f7){if(_0x1a24f7){return _0x1a24f7['destroy']()['then'](function(){_0x28282a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1a9da4,_0x30fbe1){return function(_0x34cae7){if(!_0x34cae7){_0x1a9da4[_0xf58f('0x23')](0x194);}return _0x34cae7;};}function handleError(_0x5af6c5,_0xfd2779){_0xfd2779=_0xfd2779||0x1f4;return function(_0x1cdcd5){logger[_0xf58f('0x31')](_0x1cdcd5[_0xf58f('0x32')]);if(_0x1cdcd5[_0xf58f('0x33')]){delete _0x1cdcd5[_0xf58f('0x33')];}_0x5af6c5[_0xf58f('0x24')](_0xfd2779)[_0xf58f('0x34')](_0x1cdcd5);};}exports[_0xf58f('0x35')]=function(_0x2d3043,_0x1c4ba8,_0x558270){if(!_0x2d3043[_0xf58f('0x36')][_0xf58f('0x37')]('text')&&!_0x2d3043[_0xf58f('0x36')][_0xf58f('0x37')](_0xf58f('0x38'))){throw new db['Sequelize'][(_0xf58f('0x39'))](_0xf58f('0x3a'));}else{if(_0x2d3043[_0xf58f('0x36')][_0xf58f('0x37')]('TemplateId')&&!_0x2d3043[_0xf58f('0x36')][_0xf58f('0x37')](_0xf58f('0x3b'))){throw new db[(_0xf58f('0x3c'))][(_0xf58f('0x39'))](_0xf58f('0x3d'));}if(!_0x2d3043['body']['hasOwnProperty'](_0xf58f('0x3e'))){throw new db[(_0xf58f('0x3c'))][(_0xf58f('0x39'))](_0xf58f('0x3f'));}else{try{var _0x45aa94=JSON[_0xf58f('0x40')](_0x2d3043[_0xf58f('0x36')]['recipients']);}catch(_0x3472eb){logger[_0xf58f('0x31')](_0x3472eb);throw new db[(_0xf58f('0x3c'))]['ValidationError'](_0xf58f('0x41'));}var _0x42d76d=[_0xf58f('0x42'),_0xf58f('0x43'),_0xf58f('0x44'),_0xf58f('0x45'),'smsqueue',_0xf58f('0x46'),_0xf58f('0x47'),_0xf58f('0x48'),_0xf58f('0x49')];if(_[_0xf58f('0x4a')](_0x45aa94,function(_0x397927){return!_[_0xf58f('0x4b')](_0x42d76d,_0x397927[_0xf58f('0x4c')][_0xf58f('0x4d')]());})){throw new db[(_0xf58f('0x3c'))][(_0xf58f('0x39'))]('Invalid\x20model\x20in\x20\x27recipients\x27\x20object');}}}var _0x25ce2d={};_0x25ce2d[_0xf58f('0x4e')]=_0x2d3043[_0xf58f('0x36')][_0xf58f('0x37')]('senderName')?_0x2d3043[_0xf58f('0x36')][_0xf58f('0x4e')]:_0x2d3043['user']['fullname'];_0x25ce2d[_0xf58f('0x4f')]=_[_0xf58f('0x50')](_0x2d3043['body'][_0xf58f('0x4f')])?null:_0x2d3043['body'][_0xf58f('0x4f')];_0x25ce2d['beep']=_0x2d3043[_0xf58f('0x36')][_0xf58f('0x51')]||![];_0x25ce2d[_0xf58f('0x52')]=_0x2d3043[_0xf58f('0x49')]['id'];return getContent(_0x2d3043[_0xf58f('0x36')])['then'](function(_0x3dd9a7){_0x25ce2d[_0xf58f('0x36')]=_0x3dd9a7;return getRecipients(_0x45aa94);})[_0xf58f('0x30')](function(_0x339cad){_0x25ce2d[_0xf58f('0x53')]=_[_0xf58f('0x54')](_0x339cad)[_0xf58f('0x55')](',');return db[_0xf58f('0x56')][_0xf58f('0x57')](function(_0x14ded2){return db['UserNotification'][_0xf58f('0x58')](_0x25ce2d,{'raw':!![],'transaction':_0x14ded2})[_0xf58f('0x30')](function(_0x32fd72){var _0xfa99a5={'sender':_0x25ce2d['senderName'],'description':_0x25ce2d[_0xf58f('0x4f')],'content':_0x25ce2d[_0xf58f('0x36')],'beep':_0x25ce2d[_0xf58f('0x51')]};_0x339cad[_0xf58f('0x59')](function(_0x49d238){_0xfa99a5[_0xf58f('0x5a')]=_0x49d238;socket['emit'](_0xf58f('0x5b'),_0xfa99a5);});return _0x32fd72;});});})[_0xf58f('0x30')](respondWithResult(_0x1c4ba8,0xc9))[_0xf58f('0x5c')](handleError(_0x1c4ba8,null));};function getContent(_0x369f8d){return new BPromise(function(_0x606291,_0x4dd502){if(_0x369f8d['text']){_0x606291(_0x369f8d[_0xf58f('0x5d')]);return;}return db['Template'][_0xf58f('0x5e')]({'attributes':[_0xf58f('0x5f')],'where':{'id':_0x369f8d[_0xf58f('0x38')]},'raw':!![]})['then'](function(_0x3cd05e){if(!_0x3cd05e)throw new db[(_0xf58f('0x3c'))]['ValidationError'](_0xf58f('0x60'));var _0x26928f=Mustache[_0xf58f('0x61')](_0x3cd05e[_0xf58f('0x5f')],_0x369f8d['view']);_0x606291(_0x26928f);})[_0xf58f('0x5c')](function(_0x300edb){_0x4dd502(_0x300edb);});});}function getRecipients(_0x523e69){return new BPromise(function(_0x390498,_0x4a3590){var _0x3e752b=[];var _0x367501=[];_0x523e69[_0xf58f('0x59')](function(_0xce85b4){var _0x182652=_['startCase'](_0xce85b4['model'][_0xf58f('0x4d')]());if(_0x182652==='User'){_0x3e752b=_[_0xf58f('0x62')](_0x3e752b,_0xce85b4[_0xf58f('0x63')]);}else{if(_[_0xf58f('0x4b')](_0x182652,_0xf58f('0x64')))_0x182652=_0x182652[_0xf58f('0x65')](_0xf58f('0x64'),'Queue');_0xce85b4[_0xf58f('0x63')][_0xf58f('0x59')](function(_0x1b7607){_0x367501[_0xf58f('0x66')](getAgents(_0x182652,_0x1b7607));});}});return BPromise[_0xf58f('0x67')](_0x367501)[_0xf58f('0x30')](function(_0x9b54c3){_0x3e752b=_[_0xf58f('0x62')](_0x3e752b,_['flatten'](_0x9b54c3));_0x390498(_0x3e752b);})[_0xf58f('0x5c')](function(_0x3ef5a1){_0x4a3590(_0x3ef5a1);});});}function getAgents(_0x3be88f,_0x25d13f){return new BPromise(function(_0x294e23,_0x1edfb7){return db[_0x3be88f][_0xf58f('0x5e')]({'where':{'id':_0x25d13f}})[_0xf58f('0x30')](function(_0x388ee7){return _0x388ee7[_0xf58f('0x68')]({'attributes':['id'],'raw':!![]})['then'](function(_0x22dab6){var _0xe3705=_['map'](_0x22dab6,'id');_0x294e23(_0xe3705);});})[_0xf58f('0x5c')](function(_0x5e3d80){_0x1edfb7(_0x5e3d80);});});} \ No newline at end of file +var _0x8433=['zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','ejs','fs-extra','lodash','squel','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./userNotification.socket','sendStatus','status','json','undefined','count','offset','limit','Content-Range','reject','save','update','then','destroy','end','error','stack','name','send','body','hasOwnProperty','text','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','TemplateId','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','Invalid\x20\x27recipients\x27\x20object','faxqueue','openchannelqueue','voicequeue','whatsappqueue','team','user','some','includes','model','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','isEmpty','recipientsDescription','beep','recipientsId','sortBy','sequelize','transaction','create','forEach','recipient','userNotification:send','catch','Template','Invalid\x20\x27TemplateId\x27\x20parameter','render','html','toLowerCase','User','union','ids','queue','Queue','push','flatten','findOne','getAgents','map','eml-format','rimraf'];(function(_0x2a8276,_0x20f185){var _0x13d2d1=function(_0x232d04){while(--_0x232d04){_0x2a8276['push'](_0x2a8276['shift']());}};_0x13d2d1(++_0x20f185);}(_0x8433,0x186));var _0x3843=function(_0x1c0f3d,_0x55a9e2){_0x1c0f3d=_0x1c0f3d-0x0;var _0x4d71a8=_0x8433[_0x1c0f3d];return _0x4d71a8;};'use strict';var emlformat=require(_0x3843('0x0'));var rimraf=require(_0x3843('0x1'));var zipdir=require(_0x3843('0x2'));var jsonpatch=require(_0x3843('0x3'));var rp=require(_0x3843('0x4'));var moment=require(_0x3843('0x5'));var BPromise=require(_0x3843('0x6'));var Mustache=require('mustache');var util=require(_0x3843('0x7'));var path=require('path');var sox=require(_0x3843('0x8'));var csv=require('to-csv');var ejs=require(_0x3843('0x9'));var fs=require('fs');var fs_extra=require(_0x3843('0xa'));var _=require(_0x3843('0xb'));var squel=require(_0x3843('0xc'));var crypto=require('crypto');var jsforce=require(_0x3843('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x3843('0xe'));var querystring=require(_0x3843('0xf'));var Papa=require(_0x3843('0x10'));var Redis=require('ioredis');var authService=require(_0x3843('0x11'));var qs=require(_0x3843('0x12'));var as=require(_0x3843('0x13'));var hardwareService=require(_0x3843('0x14'));var logger=require('../../config/logger')(_0x3843('0x15'));var utils=require(_0x3843('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x3843('0x17'));var db=require(_0x3843('0x18'))['db'];config['redis']=_[_0x3843('0x19')](config[_0x3843('0x1a')],{'host':_0x3843('0x1b'),'port':0x18eb});var socket=require(_0x3843('0x1c'))(new Redis(config[_0x3843('0x1a')]));require(_0x3843('0x1d'))['register'](socket);function respondWithStatusCode(_0x21fdf4,_0x4f2fb7){_0x4f2fb7=_0x4f2fb7||0xcc;return function(_0x185ebd){if(_0x185ebd){return _0x21fdf4[_0x3843('0x1e')](_0x4f2fb7);}return _0x21fdf4[_0x3843('0x1f')](_0x4f2fb7)['end']();};}function respondWithResult(_0xff6967,_0x22468e){_0x22468e=_0x22468e||0xc8;return function(_0x2fcd4d){if(_0x2fcd4d){return _0xff6967['status'](_0x22468e)[_0x3843('0x20')](_0x2fcd4d);}};}function respondWithFilteredResult(_0x46775b,_0x126796){return function(_0x92383e){if(_0x92383e){var _0x32cd98=typeof _0x126796['offset']===_0x3843('0x21')&&typeof _0x126796['limit']==='undefined';var _0x250b7d=_0x92383e[_0x3843('0x22')];var _0x4538e7=_0x32cd98?0x0:_0x126796['offset'];var _0x1c9c28=_0x32cd98?_0x92383e[_0x3843('0x22')]:_0x126796[_0x3843('0x23')]+_0x126796[_0x3843('0x24')];var _0x210ee6;if(_0x1c9c28>=_0x250b7d){_0x1c9c28=_0x250b7d;_0x210ee6=0xc8;}else{_0x210ee6=0xce;}_0x46775b[_0x3843('0x1f')](_0x210ee6);return _0x46775b['set'](_0x3843('0x25'),_0x4538e7+'-'+_0x1c9c28+'/'+_0x250b7d)[_0x3843('0x20')](_0x92383e);}return null;};}function patchUpdates(_0x393886){return function(_0x271de7){try{jsonpatch['apply'](_0x271de7,_0x393886,!![]);}catch(_0xfa19c4){return BPromise[_0x3843('0x26')](_0xfa19c4);}return _0x271de7[_0x3843('0x27')]();};}function saveUpdates(_0x18dcea,_0x2da0a2){return function(_0x4cc597){if(_0x4cc597){return _0x4cc597[_0x3843('0x28')](_0x18dcea)[_0x3843('0x29')](function(_0x269123){return _0x269123;});}return null;};}function removeEntity(_0x4c8694,_0x197487){return function(_0x1dbe16){if(_0x1dbe16){return _0x1dbe16[_0x3843('0x2a')]()['then'](function(){_0x4c8694[_0x3843('0x1f')](0xcc)[_0x3843('0x2b')]();});}};}function handleEntityNotFound(_0x351395,_0x12da37){return function(_0xfe4624){if(!_0xfe4624){_0x351395[_0x3843('0x1e')](0x194);}return _0xfe4624;};}function handleError(_0x37abee,_0x2469bb){_0x2469bb=_0x2469bb||0x1f4;return function(_0x3d1790){logger[_0x3843('0x2c')](_0x3d1790[_0x3843('0x2d')]);if(_0x3d1790[_0x3843('0x2e')]){delete _0x3d1790[_0x3843('0x2e')];}_0x37abee[_0x3843('0x1f')](_0x2469bb)[_0x3843('0x2f')](_0x3d1790);};}exports['sendUserNotification']=function(_0x5917d6,_0x32632a,_0x31065e){if(!_0x5917d6[_0x3843('0x30')][_0x3843('0x31')](_0x3843('0x32'))&&!_0x5917d6['body'][_0x3843('0x31')]('TemplateId')){throw new db[(_0x3843('0x33'))][(_0x3843('0x34'))](_0x3843('0x35'));}else{if(_0x5917d6[_0x3843('0x30')][_0x3843('0x31')](_0x3843('0x36'))&&!_0x5917d6['body'][_0x3843('0x31')]('view')){throw new db[(_0x3843('0x33'))]['ValidationError'](_0x3843('0x37'));}if(!_0x5917d6['body'][_0x3843('0x31')](_0x3843('0x38'))){throw new db[(_0x3843('0x33'))][(_0x3843('0x34'))](_0x3843('0x39'));}else{try{var _0x3f3df4=JSON['parse'](_0x5917d6['body'][_0x3843('0x38')]);}catch(_0x5e6314){logger[_0x3843('0x2c')](_0x5e6314);throw new db[(_0x3843('0x33'))]['ValidationError'](_0x3843('0x3a'));}var _0x13d185=['chatqueue',_0x3843('0x3b'),'mailqueue',_0x3843('0x3c'),'smsqueue',_0x3843('0x3d'),_0x3843('0x3e'),_0x3843('0x3f'),_0x3843('0x40')];if(_[_0x3843('0x41')](_0x3f3df4,function(_0x324ef0){return!_[_0x3843('0x42')](_0x13d185,_0x324ef0[_0x3843('0x43')]['toLowerCase']());})){throw new db['Sequelize']['ValidationError'](_0x3843('0x44'));}}}var _0x4b128d={};_0x4b128d[_0x3843('0x45')]=_0x5917d6['body'][_0x3843('0x31')](_0x3843('0x45'))?_0x5917d6[_0x3843('0x30')]['senderName']:_0x5917d6[_0x3843('0x40')][_0x3843('0x46')];_0x4b128d['recipientsDescription']=_[_0x3843('0x47')](_0x5917d6['body']['recipientsDescription'])?null:_0x5917d6[_0x3843('0x30')][_0x3843('0x48')];_0x4b128d[_0x3843('0x49')]=_0x5917d6[_0x3843('0x30')][_0x3843('0x49')]||![];_0x4b128d['SenderId']=_0x5917d6[_0x3843('0x40')]['id'];return getContent(_0x5917d6[_0x3843('0x30')])[_0x3843('0x29')](function(_0xf01197){_0x4b128d[_0x3843('0x30')]=_0xf01197;return getRecipients(_0x3f3df4);})[_0x3843('0x29')](function(_0x1ecfd0){_0x4b128d[_0x3843('0x4a')]=_[_0x3843('0x4b')](_0x1ecfd0)['join'](',');return db[_0x3843('0x4c')][_0x3843('0x4d')](function(_0x25d0f8){return db['UserNotification'][_0x3843('0x4e')](_0x4b128d,{'raw':!![],'transaction':_0x25d0f8})[_0x3843('0x29')](function(_0x433f6e){var _0x55976a={'sender':_0x4b128d[_0x3843('0x45')],'description':_0x4b128d['recipientsDescription'],'content':_0x4b128d['body'],'beep':_0x4b128d[_0x3843('0x49')]};_0x1ecfd0[_0x3843('0x4f')](function(_0x51daa3){_0x55976a[_0x3843('0x50')]=_0x51daa3;socket['emit'](_0x3843('0x51'),_0x55976a);});return _0x433f6e;});});})['then'](respondWithResult(_0x32632a,0xc9))[_0x3843('0x52')](handleError(_0x32632a,null));};function getContent(_0x1b1722){return new BPromise(function(_0x3e5cf7,_0x4d05e9){if(_0x1b1722[_0x3843('0x32')]){_0x3e5cf7(_0x1b1722[_0x3843('0x32')]);return;}return db[_0x3843('0x53')]['findOne']({'attributes':['html'],'where':{'id':_0x1b1722[_0x3843('0x36')]},'raw':!![]})[_0x3843('0x29')](function(_0x2a0937){if(!_0x2a0937)throw new db[(_0x3843('0x33'))][(_0x3843('0x34'))](_0x3843('0x54'));var _0x2b0360=Mustache[_0x3843('0x55')](_0x2a0937[_0x3843('0x56')],_0x1b1722['view']);_0x3e5cf7(_0x2b0360);})[_0x3843('0x52')](function(_0x96e0ec){_0x4d05e9(_0x96e0ec);});});}function getRecipients(_0x1610d9){return new BPromise(function(_0x55744d,_0x4d666e){var _0x4df8ab=[];var _0x15cd04=[];_0x1610d9[_0x3843('0x4f')](function(_0x191b83){var _0x40aaa7=_['startCase'](_0x191b83[_0x3843('0x43')][_0x3843('0x57')]());if(_0x40aaa7===_0x3843('0x58')){_0x4df8ab=_[_0x3843('0x59')](_0x4df8ab,_0x191b83[_0x3843('0x5a')]);}else{if(_[_0x3843('0x42')](_0x40aaa7,'queue'))_0x40aaa7=_0x40aaa7['replace'](_0x3843('0x5b'),_0x3843('0x5c'));_0x191b83['ids'][_0x3843('0x4f')](function(_0x5ebd08){_0x15cd04[_0x3843('0x5d')](getAgents(_0x40aaa7,_0x5ebd08));});}});return BPromise['all'](_0x15cd04)[_0x3843('0x29')](function(_0x1912d6){_0x4df8ab=_[_0x3843('0x59')](_0x4df8ab,_[_0x3843('0x5e')](_0x1912d6));_0x55744d(_0x4df8ab);})['catch'](function(_0x4bc866){_0x4d666e(_0x4bc866);});});}function getAgents(_0x1457fc,_0x2d497a){return new BPromise(function(_0x67444f,_0x56f0c7){return db[_0x1457fc][_0x3843('0x5f')]({'where':{'id':_0x2d497a}})[_0x3843('0x29')](function(_0x2a1ec6){return _0x2a1ec6[_0x3843('0x60')]({'attributes':['id'],'raw':!![]})[_0x3843('0x29')](function(_0x1bfbe6){var _0x436d40=_[_0x3843('0x61')](_0x1bfbe6,'id');_0x67444f(_0x436d40);});})[_0x3843('0x52')](function(_0x200ec8){_0x56f0c7(_0x200ec8);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index 3a09ab9..8e4993c 100644 --- a/server/api/userNotification/userNotification.events.js +++ b/server/api/userNotification/userNotification.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ad9=['save','update','emit','hook','exports','events','setMaxListeners'];(function(_0x3fcceb,_0x42f8a8){var _0x2f136d=function(_0x33fa28){while(--_0x33fa28){_0x3fcceb['push'](_0x3fcceb['shift']());}};_0x2f136d(++_0x42f8a8);}(_0x2ad9,0x83));var _0x92ad=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x2ad9[_0x2dafbe];return _0x58a45a;};'use strict';var EventEmitter=require(_0x92ad('0x0'));var UserNotification=require('../../mysqldb')['db']['UserNotification'];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x92ad('0x1')](0x0);var events={'afterCreate':_0x92ad('0x2'),'afterUpdate':_0x92ad('0x3'),'afterDestroy':'remove'};function emitEvent(_0x45e26c){return function(_0x17193f,_0x517ebd,_0x11718c){UserNotificationEvents[_0x92ad('0x4')](_0x45e26c+':'+_0x17193f['id'],_0x17193f);UserNotificationEvents[_0x92ad('0x4')](_0x45e26c,_0x17193f);_0x11718c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserNotification[_0x92ad('0x5')](e,emitEvent(event));}}module[_0x92ad('0x6')]=UserNotificationEvents; \ No newline at end of file +var _0x9293=['update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','UserNotification','setMaxListeners'];(function(_0x9b0881,_0x1a4fcb){var _0x53b16e=function(_0xd6748){while(--_0xd6748){_0x9b0881['push'](_0x9b0881['shift']());}};_0x53b16e(++_0x1a4fcb);}(_0x9293,0xf8));var _0x3929=function(_0x13188a,_0x2f635f){_0x13188a=_0x13188a-0x0;var _0x2f5716=_0x9293[_0x13188a];return _0x2f5716;};'use strict';var EventEmitter=require(_0x3929('0x0'));var UserNotification=require(_0x3929('0x1'))['db'][_0x3929('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x3929('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x3929('0x4'),'afterDestroy':_0x3929('0x5')};function emitEvent(_0x279262){return function(_0x143d51,_0x27460f,_0x170bc9){UserNotificationEvents['emit'](_0x279262+':'+_0x143d51['id'],_0x143d51);UserNotificationEvents[_0x3929('0x6')](_0x279262,_0x143d51);_0x170bc9(null);};}for(var e in events){if(events[_0x3929('0x7')](e)){var event=events[e];UserNotification[_0x3929('0x8')](e,emitEvent(event));}}module['exports']=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index 3dd1906..5e493bf 100644 --- a/server/api/userNotification/userNotification.model.js +++ b/server/api/userNotification/userNotification.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2315=['utf8mb4_unicode_ci','lodash','../../config/logger','moment','request-promise','path','rimraf','./userNotification.attributes','exports','define','userNotifications','utf8mb4'];(function(_0x25a4e3,_0x1f4303){var _0x5748f7=function(_0x3d19c){while(--_0x3d19c){_0x25a4e3['push'](_0x25a4e3['shift']());}};_0x5748f7(++_0x1f4303);}(_0x2315,0xfd));var _0x5231=function(_0x2fc4d2,_0xae00f0){_0x2fc4d2=_0x2fc4d2-0x0;var _0x3628cf=_0x2315[_0x2fc4d2];return _0x3628cf;};'use strict';var _=require(_0x5231('0x0'));var util=require('util');var logger=require(_0x5231('0x1'))('api');var moment=require(_0x5231('0x2'));var BPromise=require('bluebird');var rp=require(_0x5231('0x3'));var fs=require('fs');var path=require(_0x5231('0x4'));var rimraf=require(_0x5231('0x5'));var config=require('../../config/environment');var attributes=require(_0x5231('0x6'));module[_0x5231('0x7')]=function(_0x5b3e33,_0x50141c){return _0x5b3e33[_0x5231('0x8')]('UserNotification',attributes,{'tableName':_0x5231('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5231('0xa'),'collate':_0x5231('0xb')});}; \ No newline at end of file +var _0xf6c0=['../../config/logger','bluebird','path','rimraf','../../config/environment','UserNotification','userNotifications','utf8mb4_unicode_ci','lodash'];(function(_0x6b5424,_0xf43bec){var _0xacaccf=function(_0x11f76e){while(--_0x11f76e){_0x6b5424['push'](_0x6b5424['shift']());}};_0xacaccf(++_0xf43bec);}(_0xf6c0,0x194));var _0x0f6c=function(_0x2bac06,_0xe7cc4c){_0x2bac06=_0x2bac06-0x0;var _0xde9d11=_0xf6c0[_0x2bac06];return _0xde9d11;};'use strict';var _=require(_0x0f6c('0x0'));var util=require('util');var logger=require(_0x0f6c('0x1'))('api');var moment=require('moment');var BPromise=require(_0x0f6c('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0f6c('0x3'));var rimraf=require(_0x0f6c('0x4'));var config=require(_0x0f6c('0x5'));var attributes=require('./userNotification.attributes');module['exports']=function(_0x5baf53,_0x161454){return _0x5baf53['define'](_0x0f6c('0x6'),attributes,{'tableName':_0x0f6c('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0f6c('0x8')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index 1910ffc..bdea0c7 100644 --- a/server/api/userNotification/userNotification.rpc.js +++ b/server/api/userNotification/userNotification.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x397d=['then','info','UserNotification,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./userNotification.socket','register','request'];(function(_0x35f47b,_0xaaaa11){var _0x3a48f3=function(_0x56b254){while(--_0x56b254){_0x35f47b['push'](_0x35f47b['shift']());}};_0x3a48f3(++_0xaaaa11);}(_0x397d,0x121));var _0xd397=function(_0xa47071,_0x478008){_0xa47071=_0xa47071-0x0;var _0x131553=_0x397d[_0xa47071];return _0x131553;};'use strict';var _=require(_0xd397('0x0'));var util=require(_0xd397('0x1'));var moment=require(_0xd397('0x2'));var BPromise=require(_0xd397('0x3'));var rs=require(_0xd397('0x4'));var fs=require('fs');var Redis=require(_0xd397('0x5'));var db=require(_0xd397('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xd397('0x7'))(_0xd397('0x8'));var config=require(_0xd397('0x9'));var jayson=require(_0xd397('0xa'));var client=jayson[_0xd397('0xb')][_0xd397('0xc')]({'port':0x232a});config[_0xd397('0xd')]=_[_0xd397('0xe')](config[_0xd397('0xd')],{'host':_0xd397('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd397('0xd')]));require(_0xd397('0x10'))[_0xd397('0x11')](socket);function respondWithRpcPromise(_0x1de43c,_0x402494,_0x24c69d){return new BPromise(function(_0x238a4d,_0xb216b3){return client[_0xd397('0x12')](_0x1de43c,_0x24c69d)[_0xd397('0x13')](function(_0x5f3f1c){logger[_0xd397('0x14')](_0xd397('0x15'),_0x402494,'request\x20sent');logger[_0xd397('0x16')]('UserNotification,\x20%s,\x20%s,\x20%s',_0x402494,_0xd397('0x17'),JSON['stringify'](_0x5f3f1c));if(_0x5f3f1c[_0xd397('0x18')]){if(_0x5f3f1c[_0xd397('0x18')][_0xd397('0x19')]===0x1f4){logger[_0xd397('0x18')](_0xd397('0x15'),_0x402494,_0x5f3f1c[_0xd397('0x18')][_0xd397('0x1a')]);return _0xb216b3(_0x5f3f1c['error'][_0xd397('0x1a')]);}logger[_0xd397('0x18')](_0xd397('0x15'),_0x402494,_0x5f3f1c[_0xd397('0x18')][_0xd397('0x1a')]);return _0x238a4d(_0x5f3f1c['error'][_0xd397('0x1a')]);}else{logger[_0xd397('0x14')](_0xd397('0x15'),_0x402494,_0xd397('0x17'));_0x238a4d(_0x5f3f1c[_0xd397('0x1b')]['message']);}})['catch'](function(_0x9a19d3){logger[_0xd397('0x18')](_0xd397('0x15'),_0x402494,_0x9a19d3);_0xb216b3(_0x9a19d3);});});} \ No newline at end of file +var _0x00af=['result','catch','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./userNotification.socket','request','then','info','UserNotification,\x20%s,\x20%s','request\x20sent','debug','error','message'];(function(_0x5b02d6,_0x508ffe){var _0x2a0f6e=function(_0xf4bb4f){while(--_0xf4bb4f){_0x5b02d6['push'](_0x5b02d6['shift']());}};_0x2a0f6e(++_0x508ffe);}(_0x00af,0x182));var _0xf00a=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x00af[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0xf00a('0x0'));var util=require(_0xf00a('0x1'));var moment=require(_0xf00a('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf00a('0x3'))['db'];var utils=require(_0xf00a('0x4'));var logger=require(_0xf00a('0x5'))(_0xf00a('0x6'));var config=require(_0xf00a('0x7'));var jayson=require(_0xf00a('0x8'));var client=jayson[_0xf00a('0x9')][_0xf00a('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0xf00a('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xf00a('0xc'))(new Redis(config['redis']));require(_0xf00a('0xd'))['register'](socket);function respondWithRpcPromise(_0x3f9ade,_0x1dc18c,_0x5c01e5){return new BPromise(function(_0x31f5af,_0x56b63b){return client[_0xf00a('0xe')](_0x3f9ade,_0x5c01e5)[_0xf00a('0xf')](function(_0x436cfd){logger[_0xf00a('0x10')](_0xf00a('0x11'),_0x1dc18c,_0xf00a('0x12'));logger[_0xf00a('0x13')]('UserNotification,\x20%s,\x20%s,\x20%s',_0x1dc18c,'request\x20sent',JSON['stringify'](_0x436cfd));if(_0x436cfd[_0xf00a('0x14')]){if(_0x436cfd[_0xf00a('0x14')]['code']===0x1f4){logger['error'](_0xf00a('0x11'),_0x1dc18c,_0x436cfd[_0xf00a('0x14')][_0xf00a('0x15')]);return _0x56b63b(_0x436cfd[_0xf00a('0x14')][_0xf00a('0x15')]);}logger[_0xf00a('0x14')](_0xf00a('0x11'),_0x1dc18c,_0x436cfd[_0xf00a('0x14')][_0xf00a('0x15')]);return _0x31f5af(_0x436cfd[_0xf00a('0x14')]['message']);}else{logger[_0xf00a('0x10')](_0xf00a('0x11'),_0x1dc18c,_0xf00a('0x12'));_0x31f5af(_0x436cfd[_0xf00a('0x16')][_0xf00a('0x15')]);}})[_0xf00a('0x17')](function(_0x225585){logger[_0xf00a('0x14')](_0xf00a('0x11'),_0x1dc18c,_0x225585);_0x56b63b(_0x225585);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index 31184fa..4ec1ef3 100644 --- a/server/api/userNotification/userNotification.socket.js +++ b/server/api/userNotification/userNotification.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8a93=['./userNotification.events','save','remove','update','emit','register','userNotification:'];(function(_0x38be7d,_0x599724){var _0x8aa922=function(_0x5a0d01){while(--_0x5a0d01){_0x38be7d['push'](_0x38be7d['shift']());}};_0x8aa922(++_0x599724);}(_0x8a93,0x150));var _0x38a9=function(_0x597834,_0x159bb6){_0x597834=_0x597834-0x0;var _0x12da6c=_0x8a93[_0x597834];return _0x12da6c;};'use strict';var UserNotificationEvents=require(_0x38a9('0x0'));var events=[_0x38a9('0x1'),_0x38a9('0x2'),_0x38a9('0x3')];function createListener(_0x2b3418,_0x250503){return function(_0x42ae84){_0x250503[_0x38a9('0x4')](_0x2b3418,_0x42ae84);};}function removeListener(_0x806525,_0x5292f0){return function(){UserNotificationEvents['removeListener'](_0x806525,_0x5292f0);};}exports[_0x38a9('0x5')]=function(_0x2ee51e){for(var _0x41c81d=0x0,_0x3ff179=events['length'];_0x41c81d<_0x3ff179;_0x41c81d++){var _0x1a959b=events[_0x41c81d];var _0x1229a8=createListener(_0x38a9('0x6')+_0x1a959b,_0x2ee51e);UserNotificationEvents['on'](_0x1a959b,_0x1229a8);}}; \ No newline at end of file +var _0xe29f=['emit','removeListener','register','length','userNotification:','./userNotification.events','save','remove'];(function(_0x5d9d73,_0x4e566b){var _0x29ee78=function(_0x2e7365){while(--_0x2e7365){_0x5d9d73['push'](_0x5d9d73['shift']());}};_0x29ee78(++_0x4e566b);}(_0xe29f,0x125));var _0xfe29=function(_0x1773bb,_0x27c0b7){_0x1773bb=_0x1773bb-0x0;var _0x1a9f9b=_0xe29f[_0x1773bb];return _0x1a9f9b;};'use strict';var UserNotificationEvents=require(_0xfe29('0x0'));var events=[_0xfe29('0x1'),_0xfe29('0x2'),'update'];function createListener(_0x3f6d74,_0x10d710){return function(_0x5dad41){_0x10d710[_0xfe29('0x3')](_0x3f6d74,_0x5dad41);};}function removeListener(_0x2d5be5,_0xb066ec){return function(){UserNotificationEvents[_0xfe29('0x4')](_0x2d5be5,_0xb066ec);};}exports[_0xfe29('0x5')]=function(_0xa2c19e){for(var _0x3b3590=0x0,_0x5d3505=events[_0xfe29('0x6')];_0x3b3590<_0x5d3505;_0x3b3590++){var _0xaa0847=events[_0x3b3590];var _0xeeed9b=createListener(_0xfe29('0x7')+_0xaa0847,_0xa2c19e);UserNotificationEvents['on'](_0xaa0847,_0xeeed9b);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 68244e2..c3795fa 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x54e333,_0x4ba478){var _0x47279e=function(_0x8e4f0b){while(--_0x8e4f0b){_0x54e333['push'](_0x54e333['shift']());}};_0x47279e(++_0x4ba478);}(_0x9c44,0x178));var _0x49c4=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x9c44[_0x4b369d];return _0x571a98;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x4659b1,_0x341ed5){var _0x2bf57b=function(_0x1da10f){while(--_0x1da10f){_0x4659b1['push'](_0x4659b1['shift']());}};_0x2bf57b(++_0x341ed5);}(_0xe706,0xa3));var _0x6e70=function(_0x288478,_0x23303e){_0x288478=_0x288478-0x0;var _0x234c05=_0xe706[_0x288478];return _0x234c05;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index 582282b..2c334f5 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 _0xd1b5=['exports','sequelize'];(function(_0x362b94,_0x2e73bd){var _0x1565a6=function(_0x150936){while(--_0x150936){_0x362b94['push'](_0x362b94['shift']());}};_0x1565a6(++_0x2e73bd);}(_0xd1b5,0x67));var _0x5d1b=function(_0x200235,_0x2f731a){_0x200235=_0x200235-0x0;var _0x41e94a=_0xd1b5[_0x200235];return _0x41e94a;};'use strict';var Sequelize=require(_0x5d1b('0x0'));module[_0x5d1b('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xf59f=['exports','INTEGER'];(function(_0x37178f,_0x294c89){var _0x58c310=function(_0x4bd0b3){while(--_0x4bd0b3){_0x37178f['push'](_0x37178f['shift']());}};_0x58c310(++_0x294c89);}(_0xf59f,0xb4));var _0xff59=function(_0x2440ec,_0x24981a){_0x2440ec=_0x2440ec-0x0;var _0xcdfe8=_0xf59f[_0x2440ec];return _0xcdfe8;};'use strict';var Sequelize=require('sequelize');module[_0xff59('0x0')]={'penalty':{'type':Sequelize[_0xff59('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 6d098fd..a86aead 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 _0xdf6f=['bluebird','request-promise','path','../../config/environment','./userOpenchannelQueue.attributes','UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','../../config/logger','api','moment'];(function(_0x4b899f,_0x35022d){var _0xec8d86=function(_0x10f8a4){while(--_0x10f8a4){_0x4b899f['push'](_0x4b899f['shift']());}};_0xec8d86(++_0x35022d);}(_0xdf6f,0x1c3));var _0xfdf6=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xdf6f[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0xfdf6('0x0'));var util=require(_0xfdf6('0x1'));var logger=require(_0xfdf6('0x2'))(_0xfdf6('0x3'));var moment=require(_0xfdf6('0x4'));var BPromise=require(_0xfdf6('0x5'));var rp=require(_0xfdf6('0x6'));var fs=require('fs');var path=require(_0xfdf6('0x7'));var rimraf=require('rimraf');var config=require(_0xfdf6('0x8'));var attributes=require(_0xfdf6('0x9'));module['exports']=function(_0x108284,_0x59365c){return _0x108284['define'](_0xfdf6('0xa'),attributes,{'tableName':_0xfdf6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x438e=['user_has_openchannel_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports','define','UserOpenchannelQueue'];(function(_0x5eef05,_0x1be989){var _0x56d4b8=function(_0x57993d){while(--_0x57993d){_0x5eef05['push'](_0x5eef05['shift']());}};_0x56d4b8(++_0x1be989);}(_0x438e,0x196));var _0xe438=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0x438e[_0x21aec3];return _0x288bbc;};'use strict';var _=require(_0xe438('0x0'));var util=require(_0xe438('0x1'));var logger=require(_0xe438('0x2'))(_0xe438('0x3'));var moment=require(_0xe438('0x4'));var BPromise=require(_0xe438('0x5'));var rp=require(_0xe438('0x6'));var fs=require('fs');var path=require(_0xe438('0x7'));var rimraf=require(_0xe438('0x8'));var config=require(_0xe438('0x9'));var attributes=require(_0xe438('0xa'));module[_0xe438('0xb')]=function(_0x1db4a0,_0x178b2c){return _0x1db4a0[_0xe438('0xc')](_0xe438('0xd'),attributes,{'tableName':_0xe438('0xe'),'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 b38301a..12eb6b7 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 _0x7edc=['client','http','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x598be1,_0x3ce173){var _0x2386dc=function(_0x2517e5){while(--_0x2517e5){_0x598be1['push'](_0x598be1['shift']());}};_0x2386dc(++_0x3ce173);}(_0x7edc,0x1d9));var _0xc7ed=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0x7edc[_0x4ae6ef];return _0x3cbb4e;};'use strict';var _=require(_0xc7ed('0x0'));var util=require(_0xc7ed('0x1'));var moment=require(_0xc7ed('0x2'));var BPromise=require(_0xc7ed('0x3'));var rs=require(_0xc7ed('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc7ed('0x5'))['db'];var utils=require(_0xc7ed('0x6'));var logger=require('../../config/logger')(_0xc7ed('0x7'));var config=require(_0xc7ed('0x8'));var jayson=require(_0xc7ed('0x9'));var client=jayson[_0xc7ed('0xa')][_0xc7ed('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x194e5e,_0xb1ca8e,_0x61098){return new BPromise(function(_0x53c292,_0x4f7141){return client[_0xc7ed('0xc')](_0x194e5e,_0x61098)[_0xc7ed('0xd')](function(_0x13266e){logger[_0xc7ed('0xe')](_0xc7ed('0xf'),_0xb1ca8e,_0xc7ed('0x10'));logger['debug'](_0xc7ed('0x11'),_0xb1ca8e,_0xc7ed('0x10'),JSON['stringify'](_0x13266e));if(_0x13266e[_0xc7ed('0x12')]){if(_0x13266e[_0xc7ed('0x12')][_0xc7ed('0x13')]===0x1f4){logger[_0xc7ed('0x12')]('UserOpenchannelQueue,\x20%s,\x20%s',_0xb1ca8e,_0x13266e['error'][_0xc7ed('0x14')]);return _0x4f7141(_0x13266e['error'][_0xc7ed('0x14')]);}logger['error'](_0xc7ed('0xf'),_0xb1ca8e,_0x13266e['error'][_0xc7ed('0x14')]);return _0x53c292(_0x13266e[_0xc7ed('0x12')][_0xc7ed('0x14')]);}else{logger[_0xc7ed('0xe')](_0xc7ed('0xf'),_0xb1ca8e,_0xc7ed('0x10'));_0x53c292(_0x13266e[_0xc7ed('0x15')][_0xc7ed('0x14')]);}})[_0xc7ed('0x16')](function(_0x14a6ce){logger[_0xc7ed('0x12')](_0xc7ed('0xf'),_0xb1ca8e,_0x14a6ce);_0x4f7141(_0x14a6ce);});});} \ No newline at end of file +var _0xc6ef=['code','error','message','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x53bd7a,_0x252889){var _0x5e0b75=function(_0x56a6df){while(--_0x56a6df){_0x53bd7a['push'](_0x53bd7a['shift']());}};_0x5e0b75(++_0x252889);}(_0xc6ef,0x81));var _0xfc6e=function(_0x43d402,_0x55abeb){_0x43d402=_0x43d402-0x0;var _0x360d06=_0xc6ef[_0x43d402];return _0x360d06;};'use strict';var _=require(_0xfc6e('0x0'));var util=require(_0xfc6e('0x1'));var moment=require(_0xfc6e('0x2'));var BPromise=require(_0xfc6e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfc6e('0x4'));var db=require(_0xfc6e('0x5'))['db'];var utils=require(_0xfc6e('0x6'));var logger=require(_0xfc6e('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xfc6e('0x8'));var client=jayson[_0xfc6e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x23e70c,_0x4e71ca,_0xca5df8){return new BPromise(function(_0x2ca9a9,_0xfb4504){return client[_0xfc6e('0xa')](_0x23e70c,_0xca5df8)[_0xfc6e('0xb')](function(_0x497069){logger[_0xfc6e('0xc')](_0xfc6e('0xd'),_0x4e71ca,_0xfc6e('0xe'));logger[_0xfc6e('0xf')](_0xfc6e('0x10'),_0x4e71ca,_0xfc6e('0xe'),JSON[_0xfc6e('0x11')](_0x497069));if(_0x497069['error']){if(_0x497069['error'][_0xfc6e('0x12')]===0x1f4){logger[_0xfc6e('0x13')](_0xfc6e('0xd'),_0x4e71ca,_0x497069['error'][_0xfc6e('0x14')]);return _0xfb4504(_0x497069[_0xfc6e('0x13')][_0xfc6e('0x14')]);}logger[_0xfc6e('0x13')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x4e71ca,_0x497069[_0xfc6e('0x13')][_0xfc6e('0x14')]);return _0x2ca9a9(_0x497069[_0xfc6e('0x13')][_0xfc6e('0x14')]);}else{logger[_0xfc6e('0xc')](_0xfc6e('0xd'),_0x4e71ca,_0xfc6e('0xe'));_0x2ca9a9(_0x497069['result'][_0xfc6e('0x14')]);}})['catch'](function(_0x5e6e4d){logger['error'](_0xfc6e('0xd'),_0x4e71ca,_0x5e6e4d);_0xfb4504(_0x5e6e4d);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 62fecce..22ccfd9 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 _0x9513=['exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id/sections','getSections','/:id/resources','getResources','post','create','/:id/clone','clone','addSections','put','/:id','update','delete','destroy','removeResources'];(function(_0x64f6a0,_0x206ade){var _0x304384=function(_0x49d419){while(--_0x49d419){_0x64f6a0['push'](_0x64f6a0['shift']());}};_0x304384(++_0x206ade);}(_0x9513,0x1ee));var _0x3951=function(_0x379701,_0x67670c){_0x379701=_0x379701-0x0;var _0x5d7470=_0x9513[_0x379701];return _0x5d7470;};'use strict';var multer=require('multer');var util=require(_0x3951('0x0'));var path=require(_0x3951('0x1'));var timeout=require(_0x3951('0x2'));var express=require(_0x3951('0x3'));var router=express[_0x3951('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3951('0x5'));var interaction=require(_0x3951('0x6'));var config=require(_0x3951('0x7'));var controller=require('./userProfile.controller');router[_0x3951('0x8')]('/',auth[_0x3951('0x9')](),controller[_0x3951('0xa')]);router[_0x3951('0x8')](_0x3951('0xb'),auth['isAuthenticated'](),controller[_0x3951('0xc')]);router[_0x3951('0x8')]('/:id',auth[_0x3951('0x9')](),controller['show']);router['get'](_0x3951('0xd'),auth[_0x3951('0x9')](),controller[_0x3951('0xe')]);router[_0x3951('0x8')](_0x3951('0xf'),auth[_0x3951('0x9')](),controller[_0x3951('0x10')]);router[_0x3951('0x11')]('/',auth[_0x3951('0x9')](),controller[_0x3951('0x12')]);router['post'](_0x3951('0x13'),auth['isAuthenticated'](),controller[_0x3951('0x14')]);router[_0x3951('0x11')](_0x3951('0xd'),auth[_0x3951('0x9')](),controller[_0x3951('0x15')]);router['post'](_0x3951('0xf'),auth[_0x3951('0x9')](),controller['addResources']);router[_0x3951('0x16')](_0x3951('0x17'),auth[_0x3951('0x9')](),controller[_0x3951('0x18')]);router[_0x3951('0x19')](_0x3951('0x17'),auth['isAuthenticated'](),controller[_0x3951('0x1a')]);router[_0x3951('0x19')](_0x3951('0xd'),auth[_0x3951('0x9')](),controller['removeSections']);router[_0x3951('0x19')](_0x3951('0xf'),auth[_0x3951('0x9')](),controller[_0x3951('0x1b')]);module[_0x3951('0x1c')]=router; \ No newline at end of file +var _0xd2fa=['../../config/environment','./userProfile.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/sections','getSections','/:id/resources','getResources','post','create','clone','addSections','addResources','put','update','delete','destroy','removeSections','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x2c63b7,_0xd673d){var _0x38a828=function(_0x576e5a){while(--_0x576e5a){_0x2c63b7['push'](_0x2c63b7['shift']());}};_0x38a828(++_0xd673d);}(_0xd2fa,0x1ad));var _0xad2f=function(_0x4813ff,_0xa66ac7){_0x4813ff=_0x4813ff-0x0;var _0x1807aa=_0xd2fa[_0x4813ff];return _0x1807aa;};'use strict';var multer=require('multer');var util=require(_0xad2f('0x0'));var path=require(_0xad2f('0x1'));var timeout=require(_0xad2f('0x2'));var express=require('express');var router=express[_0xad2f('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xad2f('0x4'));var interaction=require(_0xad2f('0x5'));var config=require(_0xad2f('0x6'));var controller=require(_0xad2f('0x7'));router[_0xad2f('0x8')]('/',auth[_0xad2f('0x9')](),controller[_0xad2f('0xa')]);router['get'](_0xad2f('0xb'),auth[_0xad2f('0x9')](),controller[_0xad2f('0xc')]);router[_0xad2f('0x8')](_0xad2f('0xd'),auth['isAuthenticated'](),controller['show']);router[_0xad2f('0x8')](_0xad2f('0xe'),auth[_0xad2f('0x9')](),controller[_0xad2f('0xf')]);router[_0xad2f('0x8')](_0xad2f('0x10'),auth['isAuthenticated'](),controller[_0xad2f('0x11')]);router[_0xad2f('0x12')]('/',auth[_0xad2f('0x9')](),controller[_0xad2f('0x13')]);router['post']('/:id/clone',auth[_0xad2f('0x9')](),controller[_0xad2f('0x14')]);router[_0xad2f('0x12')]('/:id/sections',auth['isAuthenticated'](),controller[_0xad2f('0x15')]);router['post'](_0xad2f('0x10'),auth[_0xad2f('0x9')](),controller[_0xad2f('0x16')]);router[_0xad2f('0x17')](_0xad2f('0xd'),auth['isAuthenticated'](),controller[_0xad2f('0x18')]);router[_0xad2f('0x19')](_0xad2f('0xd'),auth['isAuthenticated'](),controller[_0xad2f('0x1a')]);router[_0xad2f('0x19')](_0xad2f('0xe'),auth[_0xad2f('0x9')](),controller[_0xad2f('0x1b')]);router[_0xad2f('0x19')](_0xad2f('0x10'),auth[_0xad2f('0x9')](),controller['removeResources']);module[_0xad2f('0x1c')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index f8926e4..0ffce4f 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 _0xca24=['join','getDataValue','split','BOOLEAN','sequelize','exports','STRING','crudPermissions'];(function(_0xf60e39,_0x5e008c){var _0x4cacb7=function(_0x5f4ec1){while(--_0x5f4ec1){_0xf60e39['push'](_0xf60e39['shift']());}};_0x4cacb7(++_0x5e008c);}(_0xca24,0x1e4));var _0x4ca2=function(_0x287052,_0x54fb11){_0x287052=_0x287052-0x0;var _0x97a085=_0xca24[_0x287052];return _0x97a085;};'use strict';var Sequelize=require(_0x4ca2('0x0'));module[_0x4ca2('0x1')]={'name':{'type':Sequelize[_0x4ca2('0x2')],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0xb792c0){this['setDataValue'](_0x4ca2('0x3'),_0xb792c0?_0xb792c0[_0x4ca2('0x4')](''):[]);},'get':function(){return this[_0x4ca2('0x5')](_0x4ca2('0x3'))?this[_0x4ca2('0x5')](_0x4ca2('0x3'))[_0x4ca2('0x6')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x4ca2('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x4ca2('0x7')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x4ca2('0x7')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x4ca2('0x7')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x4ca2('0x7')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x4ca2('0x7')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x4ca2('0x7')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x4ca2('0x7')],'defaultValue':!![]}}; \ No newline at end of file +var _0x5368=['exports','STRING','name','crudPermissions','split','BOOLEAN','sequelize'];(function(_0x249e96,_0x3ea39d){var _0x17444c=function(_0x1221d0){while(--_0x1221d0){_0x249e96['push'](_0x249e96['shift']());}};_0x17444c(++_0x3ea39d);}(_0x5368,0x110));var _0x8536=function(_0xeb19b8,_0xddc9f7){_0xeb19b8=_0xeb19b8-0x0;var _0x30c823=_0x5368[_0xeb19b8];return _0x30c823;};'use strict';var Sequelize=require(_0x8536('0x0'));module[_0x8536('0x1')]={'name':{'type':Sequelize[_0x8536('0x2')],'allowNull':![],'unique':_0x8536('0x3')},'crudPermissions':{'type':Sequelize[_0x8536('0x2')],'set':function(_0xc8c98a){this['setDataValue'](_0x8536('0x4'),_0xc8c98a?_0xc8c98a['join'](''):[]);},'get':function(){return this['getDataValue'](_0x8536('0x4'))?this['getDataValue']('crudPermissions')[_0x8536('0x5')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x8536('0x6')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x8536('0x6')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x8536('0x6')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x8536('0x6')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x8536('0x6')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x8536('0x6')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index d6ca035..03e0556 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 _0xda51=['removeSections','ids','getSections','enabled','includes','isEmpty','subsections','concat','findOne','Dashboard','forEach','resourceId','Plugin','addResources','bulkCreate','removeResources','getResources','section','No\x20User\x20Profile\x20found\x20for\x20id\x20','rimraf','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','update','then','destroy','error','stack','name','index','map','UserProfile','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','length','hasOwnProperty','sort','where','filters','pick','filter','merge','includeAll','include','catch','show','params','fields','options','find','create','body','clone','createdAt','omit','sequelize','get','each','autoAssociation','UserProfileResource','findAll','updatedAt','userProfileId','Resources','describe','addSections','transaction','UserProfileSection','sectionId','push'];(function(_0x1bcf9d,_0xacff73){var _0x36a845=function(_0x5b2e6e){while(--_0x5b2e6e){_0x1bcf9d['push'](_0x1bcf9d['shift']());}};_0x36a845(++_0xacff73);}(_0xda51,0x7f));var _0x1da5=function(_0xb66df,_0x4fb5ce){_0xb66df=_0xb66df-0x0;var _0x42a702=_0xda51[_0xb66df];return _0x42a702;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1da5('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1da5('0x1'));var Mustache=require(_0x1da5('0x2'));var util=require(_0x1da5('0x3'));var path=require(_0x1da5('0x4'));var sox=require(_0x1da5('0x5'));var csv=require(_0x1da5('0x6'));var ejs=require(_0x1da5('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1da5('0x8'));var squel=require('squel');var crypto=require(_0x1da5('0x9'));var jsforce=require(_0x1da5('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x1da5('0x6'));var querystring=require(_0x1da5('0xb'));var Papa=require(_0x1da5('0xc'));var Redis=require(_0x1da5('0xd'));var authService=require(_0x1da5('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x1da5('0xf'));var hardwareService=require(_0x1da5('0x10'));var logger=require(_0x1da5('0x11'))(_0x1da5('0x12'));var utils=require(_0x1da5('0x13'));var config=require(_0x1da5('0x14'));var licenseUtil=require(_0x1da5('0x15'));var db=require(_0x1da5('0x16'))['db'];config[_0x1da5('0x17')]=_['defaults'](config[_0x1da5('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x1da5('0x18'))(new Redis(config['redis']));require('./userProfile.socket')[_0x1da5('0x19')](socket);function respondWithStatusCode(_0xaa1495,_0x2f52ee){_0x2f52ee=_0x2f52ee||0xcc;return function(_0x4acd07){if(_0x4acd07){return _0xaa1495[_0x1da5('0x1a')](_0x2f52ee);}return _0xaa1495[_0x1da5('0x1b')](_0x2f52ee)[_0x1da5('0x1c')]();};}function respondWithResult(_0x260f60,_0x4e84b4){_0x4e84b4=_0x4e84b4||0xc8;return function(_0x1419d9){if(_0x1419d9){return _0x260f60[_0x1da5('0x1b')](_0x4e84b4)[_0x1da5('0x1d')](_0x1419d9);}};}function respondWithFilteredResult(_0x21921d,_0x525805){return function(_0x4a675c){if(_0x4a675c){var _0x58b088=typeof _0x525805[_0x1da5('0x1e')]===_0x1da5('0x1f')&&typeof _0x525805[_0x1da5('0x20')]===_0x1da5('0x1f');var _0x438ef9=_0x4a675c[_0x1da5('0x21')];var _0x5a96eb=_0x58b088?0x0:_0x525805['offset'];var _0x3b20cd=_0x58b088?_0x4a675c[_0x1da5('0x21')]:_0x525805[_0x1da5('0x1e')]+_0x525805[_0x1da5('0x20')];var _0x2c3edb;if(_0x3b20cd>=_0x438ef9){_0x3b20cd=_0x438ef9;_0x2c3edb=0xc8;}else{_0x2c3edb=0xce;}_0x21921d['status'](_0x2c3edb);return _0x21921d[_0x1da5('0x22')]('Content-Range',_0x5a96eb+'-'+_0x3b20cd+'/'+_0x438ef9)[_0x1da5('0x1d')](_0x4a675c);}return null;};}function patchUpdates(_0x4209b0){return function(_0x5dbb00){try{jsonpatch['apply'](_0x5dbb00,_0x4209b0,!![]);}catch(_0x1ed2b5){return BPromise['reject'](_0x1ed2b5);}return _0x5dbb00['save']();};}function saveUpdates(_0x4a7580,_0x4e64cd){return function(_0x3f5002){if(_0x3f5002){return _0x3f5002[_0x1da5('0x23')](_0x4a7580)[_0x1da5('0x24')](function(_0x3eb546){return _0x3eb546;});}return null;};}function removeEntity(_0x85ad64,_0xa6934f){return function(_0x590a52){if(_0x590a52){return _0x590a52[_0x1da5('0x25')]()[_0x1da5('0x24')](function(){_0x85ad64[_0x1da5('0x1b')](0xcc)[_0x1da5('0x1c')]();});}};}function handleEntityNotFound(_0x276143,_0x1d130e){return function(_0x3002c6){if(!_0x3002c6){_0x276143[_0x1da5('0x1a')](0x194);}return _0x3002c6;};}function handleError(_0x436992,_0x27f166){_0x27f166=_0x27f166||0x1f4;return function(_0x2034a0){logger[_0x1da5('0x26')](_0x2034a0[_0x1da5('0x27')]);if(_0x2034a0[_0x1da5('0x28')]){delete _0x2034a0[_0x1da5('0x28')];}_0x436992[_0x1da5('0x1b')](_0x27f166)['send'](_0x2034a0);};}exports[_0x1da5('0x29')]=function(_0x3895da,_0x1bb39e){var _0x253759={},_0x388a9c={},_0xf20962={'count':0x0,'rows':[]};var _0xe03aae=_[_0x1da5('0x2a')](db[_0x1da5('0x2b')][_0x1da5('0x2c')],function(_0x1e8e51){return{'name':_0x1e8e51[_0x1da5('0x2d')],'type':_0x1e8e51[_0x1da5('0x2e')][_0x1da5('0x2f')]};});_0x388a9c[_0x1da5('0x30')]=_['map'](_0xe03aae,'name');_0x388a9c[_0x1da5('0x31')]=_[_0x1da5('0x32')](_0x3895da['query']);_0x388a9c['filters']=_[_0x1da5('0x33')](_0x388a9c[_0x1da5('0x30')],_0x388a9c[_0x1da5('0x31')]);_0x253759['attributes']=_[_0x1da5('0x33')](_0x388a9c[_0x1da5('0x30')],qs['fields'](_0x3895da['query']['fields']));_0x253759[_0x1da5('0x34')]=_0x253759[_0x1da5('0x34')][_0x1da5('0x35')]?_0x253759[_0x1da5('0x34')]:_0x388a9c[_0x1da5('0x30')];if(!_0x3895da[_0x1da5('0x31')][_0x1da5('0x36')]('nolimit')){_0x253759[_0x1da5('0x20')]=qs[_0x1da5('0x20')](_0x3895da[_0x1da5('0x31')]['limit']);_0x253759[_0x1da5('0x1e')]=qs[_0x1da5('0x1e')](_0x3895da[_0x1da5('0x31')][_0x1da5('0x1e')]);}_0x253759['order']=qs[_0x1da5('0x37')](_0x3895da[_0x1da5('0x31')][_0x1da5('0x37')]);_0x253759[_0x1da5('0x38')]=qs[_0x1da5('0x39')](_[_0x1da5('0x3a')](_0x3895da[_0x1da5('0x31')],_0x388a9c[_0x1da5('0x39')]),_0xe03aae);if(_0x3895da[_0x1da5('0x31')][_0x1da5('0x3b')]){_0x253759['where']=_['merge'](_0x253759[_0x1da5('0x38')],{'$or':_[_0x1da5('0x2a')](_0xe03aae,function(_0x519c4c){if(_0x519c4c[_0x1da5('0x2e')]!=='VIRTUAL'){var _0x21bade={};_0x21bade[_0x519c4c['name']]={'$like':'%'+_0x3895da[_0x1da5('0x31')][_0x1da5('0x3b')]+'%'};return _0x21bade;}})});}_0x253759=_[_0x1da5('0x3c')]({},_0x253759,_0x3895da['options']);var _0x4f3e21={'where':_0x253759[_0x1da5('0x38')]};return db[_0x1da5('0x2b')]['count'](_0x4f3e21)[_0x1da5('0x24')](function(_0x2795f7){_0xf20962[_0x1da5('0x21')]=_0x2795f7;if(_0x3895da['query'][_0x1da5('0x3d')]){_0x253759[_0x1da5('0x3e')]=[{'all':!![]}];}return db['UserProfile']['findAll'](_0x253759);})[_0x1da5('0x24')](function(_0x496242){_0xf20962['rows']=_0x496242;return _0xf20962;})[_0x1da5('0x24')](respondWithFilteredResult(_0x1bb39e,_0x253759))[_0x1da5('0x3f')](handleError(_0x1bb39e,null));};exports[_0x1da5('0x40')]=function(_0x3abb78,_0x18f58c){var _0x334288={'raw':![],'where':{'id':_0x3abb78[_0x1da5('0x41')]['id']}},_0x4f4ee9={};_0x4f4ee9[_0x1da5('0x30')]=_[_0x1da5('0x32')](db[_0x1da5('0x2b')]['rawAttributes']);_0x4f4ee9[_0x1da5('0x31')]=_[_0x1da5('0x32')](_0x3abb78['query']);_0x4f4ee9['filters']=_['intersection'](_0x4f4ee9[_0x1da5('0x30')],_0x4f4ee9[_0x1da5('0x31')]);_0x334288['attributes']=_['intersection'](_0x4f4ee9['model'],qs[_0x1da5('0x42')](_0x3abb78[_0x1da5('0x31')][_0x1da5('0x42')]));_0x334288[_0x1da5('0x34')]=_0x334288[_0x1da5('0x34')]['length']?_0x334288[_0x1da5('0x34')]:_0x4f4ee9[_0x1da5('0x30')];if(_0x3abb78['query'][_0x1da5('0x3d')]){_0x334288[_0x1da5('0x3e')]=[{'all':!![]}];}_0x334288=_[_0x1da5('0x3c')]({},_0x334288,_0x3abb78[_0x1da5('0x43')]);return db[_0x1da5('0x2b')][_0x1da5('0x44')](_0x334288)['then'](handleEntityNotFound(_0x18f58c,null))['then'](respondWithResult(_0x18f58c,null))[_0x1da5('0x3f')](handleError(_0x18f58c,null));};exports['create']=function(_0x28c4bc,_0x5cb158){return db['UserProfile'][_0x1da5('0x45')](_0x28c4bc[_0x1da5('0x46')],{})[_0x1da5('0x24')](respondWithResult(_0x5cb158,0xc9))[_0x1da5('0x3f')](handleError(_0x5cb158,null));};exports[_0x1da5('0x47')]=function(_0x2754d2,_0x3bddb5){var _0x5d5991={'where':{'id':_0x2754d2['params']['id']}},_0x21c2f1={};_0x21c2f1[_0x1da5('0x30')]=_[_0x1da5('0x32')](db[_0x1da5('0x2b')][_0x1da5('0x2c')]);_0x5d5991[_0x1da5('0x34')]=_[_0x1da5('0x33')](_0x21c2f1[_0x1da5('0x30')],qs[_0x1da5('0x42')](_0x2754d2[_0x1da5('0x31')][_0x1da5('0x42')]));_0x5d5991[_0x1da5('0x34')]=_0x5d5991[_0x1da5('0x34')][_0x1da5('0x35')]?_0x5d5991[_0x1da5('0x34')]:_0x21c2f1['model'];if(_0x2754d2['query'][_0x1da5('0x3d')]){_0x5d5991[_0x1da5('0x3e')]=[{'all':!![]}];}_0x5d5991=_['merge']({},_0x5d5991,_0x2754d2[_0x1da5('0x43')]);return db[_0x1da5('0x2b')][_0x1da5('0x44')](_0x5d5991)['then'](handleEntityNotFound(_0x3bddb5,null))[_0x1da5('0x24')](function(_0xa720f1){if(_0xa720f1){var _0x463b72=_0xa720f1['get']({'plain':!![]});_0x463b72=qs['omit'](_0x463b72,['id',_0x1da5('0x48'),'updatedAt','crudPermissions']);_0x2754d2[_0x1da5('0x46')]=_[_0x1da5('0x49')](_0x2754d2[_0x1da5('0x46')],['id',_0x1da5('0x48'),'updatedAt']);return db[_0x1da5('0x4a')]['transaction'](function(_0x306386){return db[_0x1da5('0x2b')]['create'](_[_0x1da5('0x3c')](_0x463b72,_0x2754d2[_0x1da5('0x46')]),{'include':_0x2754d2[_0x1da5('0x31')][_0x1da5('0x3d')]?[{'all':!![]}]:undefined,'transaction':_0x306386})[_0x1da5('0x24')](function(_0x8de4ff){var _0x3d48ff=_0x8de4ff[_0x1da5('0x4b')]({'plain':!![]});return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x2754d2[_0x1da5('0x41')]['id']},'raw':!![]})[_0x1da5('0x24')](function(_0x11ee6d){if(_0x11ee6d){return BPromise[_0x1da5('0x4c')](_0x11ee6d,function(_0x551c4a){return new BPromise(function(_0x6cef5f,_0x88d4a9){if(_0x551c4a[_0x1da5('0x4d')]===null||_0x551c4a['autoAssociation']===0x1)_0x6cef5f(null);return db[_0x1da5('0x4e')][_0x1da5('0x4f')]({'where':{'sectionId':_0x551c4a['id']},'raw':!![]})[_0x1da5('0x24')](function(_0x59beb3){var _0x506f6c=_['map'](_0x59beb3,function(_0x5a127e){return qs[_0x1da5('0x49')](_0x5a127e,['id','createdAt',_0x1da5('0x50'),'sectionId']);});_0x6cef5f(_0x506f6c);})[_0x1da5('0x3f')](function(_0x4694ba){_0x88d4a9(_0x4694ba);});})[_0x1da5('0x24')](function(_0x516d53){var _0x5dde36=qs[_0x1da5('0x49')](_0x551c4a,['id','createdAt',_0x1da5('0x50')]);_0x5dde36[_0x1da5('0x51')]=_0x3d48ff['id'];if(_0x516d53)_0x5dde36[_0x1da5('0x52')]=_0x516d53;return _0x5dde36;})[_0x1da5('0x24')](function(_0x5a7836){return db['UserProfileSection'][_0x1da5('0x45')](_0x5a7836,{'include':[{'model':db['UserProfileResource'],'as':'Resources'}],'raw':!![],'transaction':_0x306386});});})['then'](function(){return _0x3d48ff;});}});});});}})[_0x1da5('0x24')](respondWithResult(_0x3bddb5,0xc9))[_0x1da5('0x3f')](handleError(_0x3bddb5,null));};exports[_0x1da5('0x23')]=function(_0x3f57a7,_0x50330c){if(_0x3f57a7[_0x1da5('0x46')]['id']){delete _0x3f57a7[_0x1da5('0x46')]['id'];}return db[_0x1da5('0x2b')][_0x1da5('0x44')]({'where':{'id':_0x3f57a7[_0x1da5('0x41')]['id']}})[_0x1da5('0x24')](handleEntityNotFound(_0x50330c,null))[_0x1da5('0x24')](saveUpdates(_0x3f57a7[_0x1da5('0x46')],null))['then'](respondWithResult(_0x50330c,null))[_0x1da5('0x3f')](handleError(_0x50330c,null));};exports[_0x1da5('0x25')]=function(_0x5cc106,_0x44cfce){return db[_0x1da5('0x2b')][_0x1da5('0x44')]({'where':{'id':_0x5cc106['params']['id']}})[_0x1da5('0x24')](handleEntityNotFound(_0x44cfce,null))['then'](removeEntity(_0x44cfce,null))[_0x1da5('0x3f')](handleError(_0x44cfce,null));};exports[_0x1da5('0x53')]=function(_0x321841,_0x3c9b80){return db[_0x1da5('0x2b')][_0x1da5('0x53')]()['then'](respondWithResult(_0x3c9b80,null))[_0x1da5('0x3f')](handleError(_0x3c9b80,null));};exports[_0x1da5('0x54')]=function(_0x2f8a5a,_0x4df954){var _0x5a1bbb=_0x2f8a5a[_0x1da5('0x46')];return db[_0x1da5('0x2b')][_0x1da5('0x44')]({'where':{'id':_0x2f8a5a[_0x1da5('0x41')]['id']}})[_0x1da5('0x24')](handleEntityNotFound(_0x4df954,null))[_0x1da5('0x24')](function(_0x2570e4){if(_0x2570e4){return db[_0x1da5('0x4a')][_0x1da5('0x55')](function(_0xb763d){return db[_0x1da5('0x56')][_0x1da5('0x25')]({'where':{'userProfileId':_0x2f8a5a['params']['id'],'sectionId':_[_0x1da5('0x2a')](_0x5a1bbb,function(_0x17efde){return _0x17efde[_0x1da5('0x57')];})},'transaction':_0xb763d})[_0x1da5('0x24')](function(){var _0x493ed1=_[_0x1da5('0x2a')](_0x5a1bbb,function(_0x73c8fc){_0x73c8fc[_0x1da5('0x51')]=_0x2f8a5a['params']['id'];return _0x73c8fc;});var _0x1086e1=[];return BPromise[_0x1da5('0x4c')](_0x493ed1,function(_0x3f13fe){return db[_0x1da5('0x56')][_0x1da5('0x45')](_0x3f13fe,{'include':[{'model':db['UserProfileResource'],'as':_0x1da5('0x52')}],'raw':!![],'transaction':_0xb763d})['then'](function(_0x15cf51){_0x1086e1[_0x1da5('0x58')](_0x15cf51['get']({'plain':!![]}));});})['then'](function(){return _0x1086e1;});});});}})[_0x1da5('0x24')](function(_0x484dbb){return _0x484dbb;})[_0x1da5('0x24')](respondWithResult(_0x4df954,null))[_0x1da5('0x3f')](handleError(_0x4df954,null));};exports[_0x1da5('0x59')]=function(_0x3cf594,_0x461965){var _0x39b345;return db[_0x1da5('0x2b')]['find']({'where':{'id':_0x3cf594[_0x1da5('0x41')]['id']},'attributes':['id',_0x1da5('0x28')]})[_0x1da5('0x24')](handleEntityNotFound(_0x461965,null))[_0x1da5('0x24')](function(_0x28fb48){if(_0x28fb48){_0x39b345=_0x28fb48;return db[_0x1da5('0x56')][_0x1da5('0x25')]({'where':{'userProfileId':_0x3cf594['params']['id'],'sectionId':_0x3cf594[_0x1da5('0x31')][_0x1da5('0x5a')]}});}})[_0x1da5('0x24')](function(){return _0x39b345;})[_0x1da5('0x24')](respondWithStatusCode(_0x461965,null))[_0x1da5('0x3f')](handleError(_0x461965,null));};exports[_0x1da5('0x5b')]=function(_0x2c4778,_0x4516c5){var _0x2ecfa0=[];var _0x20a8fc=[];return db[_0x1da5('0x56')]['findAll']({'where':{'userProfileId':_0x2c4778[_0x1da5('0x41')]['id']},'raw':!![]})[_0x1da5('0x24')](function(_0x443503){_0x2ecfa0=_[_0x1da5('0x3b')](_0x443503,function(_0x44840d){return _0x44840d[_0x1da5('0x5c')]===0x1||_[_0x1da5('0x5d')]([0x3eb,0x709],_0x44840d[_0x1da5('0x57')]);});if(!_[_0x1da5('0x5e')](_0x2ecfa0)){return _['map'](_0x2ecfa0,function(_0x478bae){return _0x478bae['sectionId'];});}else{return;}})[_0x1da5('0x24')](function(_0x899343){if(_0x899343)_0x20a8fc=_0x899343;if(_['includes'](_0x20a8fc,0x64)){var _0x5c9be7=_[_0x1da5('0x44')](_0x2ecfa0,{'sectionId':0x64});return hasDefaultDashboard(_0x5c9be7)[_0x1da5('0x24')](function(_0x30109e){return _[_0x1da5('0x2a')](_0x2ecfa0,function(_0x103a25){if(_0x103a25[_0x1da5('0x57')]===0x64){_0x103a25['subsections']=_0x30109e;}return _0x103a25;});});}else{return;}})[_0x1da5('0x24')](function(_0x181951){if(_0x181951)_0x2ecfa0=_0x181951;if(_[_0x1da5('0x5d')](_0x20a8fc,0x3eb)){var _0x292ca8=_['find'](_0x2ecfa0,{'sectionId':0x3eb});return getCustomDashboards(_0x292ca8)[_0x1da5('0x24')](function(_0x16c3c2){return _[_0x1da5('0x2a')](_0x2ecfa0,function(_0x4dc02b){if(_0x292ca8[_0x1da5('0x5c')]){if(_0x4dc02b[_0x1da5('0x57')]===0x3eb){_0x4dc02b[_0x1da5('0x5f')]=_0x16c3c2;}}else{if(_0x4dc02b['sectionId']===0x64){if(!_0x4dc02b['subsections']){_0x4dc02b[_0x1da5('0x5f')]=[];}_0x4dc02b[_0x1da5('0x5f')]=_0x4dc02b[_0x1da5('0x5f')][_0x1da5('0x60')](_0x16c3c2);}}return _0x4dc02b;});});}else{return;}})['then'](function(_0x1b230b){if(_0x1b230b)_0x2ecfa0=_0x1b230b;if(_[_0x1da5('0x5d')](_0x20a8fc,0x709)){var _0xe73608=_[_0x1da5('0x44')](_0x2ecfa0,{'sectionId':0x709});return getPlugins(_0xe73608)['then'](function(_0xa81323){if(_0xe73608[_0x1da5('0x5c')]){return _[_0x1da5('0x2a')](_0x2ecfa0,function(_0xb00d1b){if(_0xb00d1b[_0x1da5('0x57')]===0x709){_0xb00d1b[_0x1da5('0x5f')]=_0xa81323;}return _0xb00d1b;});}else{var _0x12a4cb={'sectionId':0x76c,'enabled':0x1,'subsections':_0xa81323};var _0x11f9d0=_[_0x1da5('0x2a')](_0x2ecfa0);_0x11f9d0[_0x1da5('0x58')](_0x12a4cb);return _0x11f9d0;}});}else{return;}})[_0x1da5('0x24')](function(_0x1aa414){if(_0x1aa414)_0x2ecfa0=_0x1aa414;return _[_0x1da5('0x3b')](_0x2ecfa0,['enabled',0x1]);})['then'](respondWithResult(_0x4516c5,null))[_0x1da5('0x3f')](handleError(_0x4516c5,null));};function hasDefaultDashboard(_0x3c0b77){var _0xefc4d3=[0x65];return new BPromise(function(_0x568912,_0x4d93da){try{if(_0x3c0b77['autoAssociation']){_0x568912(_0xefc4d3);}else{return db[_0x1da5('0x4e')][_0x1da5('0x61')]({'where':{'sectionId':_0x3c0b77['id']},'raw':!![]})[_0x1da5('0x24')](function(_0x25b42a){_0x25b42a?_0x568912(_0xefc4d3):_0x568912();});}}catch(_0x523c94){_0x4d93da(_0x523c94);}});}function getCustomDashboards(_0x14bc15){var _0x47d1ba=[];return new BPromise(function(_0xd9b98b,_0x46848d){try{if(_0x14bc15[_0x1da5('0x4d')]){return db[_0x1da5('0x62')]['findAll']({'raw':!![]})['then'](function(_0x443a78){_0x443a78['forEach'](function(_0x45fbef){_0x47d1ba[_0x1da5('0x58')](_0x45fbef['id']+0x1869f);});_0xd9b98b(_0x47d1ba);});}else{return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x14bc15['id']},'raw':!![]})[_0x1da5('0x24')](function(_0x261790){_0x261790[_0x1da5('0x63')](function(_0x5de2ae){_0x47d1ba['push'](_0x5de2ae[_0x1da5('0x64')]+0x1869f);});_0xd9b98b(_0x47d1ba);});}}catch(_0x1618f9){_0x46848d(_0x1618f9);}});}function getPlugins(_0xca73ef){var _0x545a36=[];return new BPromise(function(_0x2d8192,_0xe22008){try{if(_0xca73ef[_0x1da5('0x4d')]){return db[_0x1da5('0x65')][_0x1da5('0x4f')]({'raw':!![]})[_0x1da5('0x24')](function(_0x208ea8){_0x208ea8[_0x1da5('0x63')](function(_0x58686f){_0x545a36[_0x1da5('0x58')](_0x58686f['id']+0x15b38);});_0x2d8192(_0x545a36);});}else{return db[_0x1da5('0x4e')][_0x1da5('0x4f')]({'where':{'sectionId':_0xca73ef['id']},'raw':!![]})[_0x1da5('0x24')](function(_0x50d48d){_0x50d48d[_0x1da5('0x63')](function(_0x46e140){_0x545a36[_0x1da5('0x58')](_0x46e140['resourceId']+0x15b38);});_0x2d8192(_0x545a36);});}}catch(_0x1fd4b0){_0xe22008(_0x1fd4b0);}});}exports[_0x1da5('0x66')]=function(_0x453fed,_0x35a999){return db[_0x1da5('0x2b')]['find']({'where':{'id':_0x453fed['params']['id']}})[_0x1da5('0x24')](handleEntityNotFound(_0x35a999,null))[_0x1da5('0x24')](function(_0x418834){if(_0x418834){return db[_0x1da5('0x4a')]['transaction'](function(_0x38fdf1){return db[_0x1da5('0x56')][_0x1da5('0x4f')]({'where':{'userProfileId':_0x453fed['params']['id']},'attributes':['id'],'raw':!![]})['then'](function(_0x504850){if(_0x504850){return db['UserProfileSection'][_0x1da5('0x25')]({'where':{'userProfileId':_0x453fed['params']['id'],'id':_[_0x1da5('0x2a')](_0x504850,function(_0x11bcd7){return _0x11bcd7['id'];})},'transaction':_0x38fdf1});}})['then'](function(_0x41181a){var _0x3863bb=_['map'](_0x453fed[_0x1da5('0x46')],function(_0x3c6dbf){_0x3c6dbf[_0x1da5('0x51')]=_0x453fed[_0x1da5('0x41')]['id'];return _0x3c6dbf;});return db[_0x1da5('0x56')][_0x1da5('0x67')](_0x3863bb,{'raw':!![],'transaction':_0x38fdf1});})[_0x1da5('0x24')](function(_0x17ecca){var _0x1a315c=_[_0x1da5('0x3b')](_[_0x1da5('0x2a')](_0x17ecca,function(_0x52dbcc){return _0x52dbcc[_0x1da5('0x4b')]({'plain':!![]});}),{'includeAll':![]});if(_0x1a315c){return db['UserProfileSection'][_0x1da5('0x4f')]({'where':{'userProfileId':_0x453fed[_0x1da5('0x41')]['id'],'sectionId':_[_0x1da5('0x2a')](_0x1a315c,function(_0x154b2b){return _0x154b2b[_0x1da5('0x57')];})},'attributes':['id',_0x1da5('0x57')],'raw':!![]})[_0x1da5('0x24')](function(_0x4fdf67){var _0x2e5c51=_[_0x1da5('0x2a')](_0x453fed[_0x1da5('0x46')],function(_0xf90eb3){_0xf90eb3[_0x1da5('0x51')]=_0x453fed[_0x1da5('0x41')]['id'];return _0xf90eb3;});return db[_0x1da5('0x4e')][_0x1da5('0x67')](_0x2e5c51,{'raw':!![],'transaction':_0x38fdf1});});}})['catch'](handleError(_0x35a999,null));});}})[_0x1da5('0x24')](function(_0x4f53cb){var _0x11175a=_[_0x1da5('0x2a')](_0x4f53cb,function(_0x217835){return _0x217835[_0x1da5('0x4b')]({'plain':!![]});});})[_0x1da5('0x24')](respondWithResult(_0x35a999,null))[_0x1da5('0x3f')](handleError(_0x35a999,null));};exports[_0x1da5('0x68')]=function(_0x54e33a,_0x48ee58,_0x529a60){return db['UserProfile'][_0x1da5('0x44')]({'where':{'id':_0x54e33a[_0x1da5('0x41')]['id']}})[_0x1da5('0x24')](handleEntityNotFound(_0x48ee58,null))[_0x1da5('0x24')](function(_0x365c0e){if(_0x365c0e){return _0x365c0e[_0x1da5('0x68')](_0x54e33a['query'][_0x1da5('0x5a')]);}})[_0x1da5('0x24')](respondWithStatusCode(_0x48ee58,null))[_0x1da5('0x3f')](handleError(_0x48ee58,null));};exports[_0x1da5('0x69')]=function(_0x15d31b,_0x1c9914){var _0xbb3456={};if(!_0x15d31b[_0x1da5('0x31')][_0x1da5('0x6a')])throw new Error('Missing\x20section\x20parameter');if(!_0x15d31b['query'][_0x1da5('0x36')]('nolimit')){_0xbb3456[_0x1da5('0x20')]=qs[_0x1da5('0x20')](_0x15d31b[_0x1da5('0x31')][_0x1da5('0x20')]);_0xbb3456[_0x1da5('0x1e')]=qs[_0x1da5('0x1e')](_0x15d31b[_0x1da5('0x31')][_0x1da5('0x1e')]);}return db['UserProfile'][_0x1da5('0x44')]({'where':{'id':_0x15d31b[_0x1da5('0x41')]['id']}})[_0x1da5('0x24')](function(_0x434c46){if(!_0x434c46)throw new Error(_0x1da5('0x6b')+_0x15d31b['params']['id']);return db['UserProfile'][_0x1da5('0x69')](_0x15d31b);})[_0x1da5('0x24')](respondWithFilteredResult(_0x1c9914,_0xbb3456))[_0x1da5('0x3f')](handleError(_0x1c9914,null));}; \ No newline at end of file +var _0x4d56=['body','createdAt','sequelize','transaction','get','each','autoAssociation','UserProfileResource','sectionId','userProfileId','Resources','UserProfileSection','describe','addSections','push','removeSections','ids','getSections','enabled','includes','isEmpty','subsections','concat','findOne','Dashboard','forEach','resourceId','Plugin','bulkCreate','removeResources','section','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','sendStatus','status','offset','undefined','count','limit','json','apply','reject','save','update','then','destroy','end','error','stack','name','map','UserProfile','rawAttributes','fieldName','type','key','query','intersection','model','attributes','fields','hasOwnProperty','nolimit','where','filters','filter','merge','VIRTUAL','options','include','findAll','catch','show','params','keys','length','includeAll','find','create','clone','omit','updatedAt'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x4d56,0x16a));var _0x64d5=function(_0x555e06,_0x599194){_0x555e06=_0x555e06-0x0;var _0x5944a8=_0x4d56[_0x555e06];return _0x5944a8;};'use strict';var emlformat=require(_0x64d5('0x0'));var rimraf=require(_0x64d5('0x1'));var zipdir=require(_0x64d5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x64d5('0x3'));var moment=require(_0x64d5('0x4'));var BPromise=require(_0x64d5('0x5'));var Mustache=require(_0x64d5('0x6'));var util=require(_0x64d5('0x7'));var path=require(_0x64d5('0x8'));var sox=require('sox');var csv=require(_0x64d5('0x9'));var ejs=require(_0x64d5('0xa'));var fs=require('fs');var fs_extra=require(_0x64d5('0xb'));var _=require('lodash');var squel=require(_0x64d5('0xc'));var crypto=require(_0x64d5('0xd'));var jsforce=require(_0x64d5('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x64d5('0x9'));var querystring=require(_0x64d5('0xf'));var Papa=require(_0x64d5('0x10'));var Redis=require(_0x64d5('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x64d5('0x12'));var as=require(_0x64d5('0x13'));var hardwareService=require(_0x64d5('0x14'));var logger=require(_0x64d5('0x15'))(_0x64d5('0x16'));var utils=require(_0x64d5('0x17'));var config=require(_0x64d5('0x18'));var licenseUtil=require(_0x64d5('0x19'));var db=require(_0x64d5('0x1a'))['db'];config[_0x64d5('0x1b')]=_['defaults'](config[_0x64d5('0x1b')],{'host':_0x64d5('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x64d5('0x1b')]));require('./userProfile.socket')['register'](socket);function respondWithStatusCode(_0x3d1286,_0x4fe764){_0x4fe764=_0x4fe764||0xcc;return function(_0x15cdf4){if(_0x15cdf4){return _0x3d1286[_0x64d5('0x1d')](_0x4fe764);}return _0x3d1286[_0x64d5('0x1e')](_0x4fe764)['end']();};}function respondWithResult(_0x31c9ba,_0x3ef206){_0x3ef206=_0x3ef206||0xc8;return function(_0x1dc9d2){if(_0x1dc9d2){return _0x31c9ba['status'](_0x3ef206)['json'](_0x1dc9d2);}};}function respondWithFilteredResult(_0x2f4f8c,_0x103025){return function(_0x1aeb8b){if(_0x1aeb8b){var _0xd3e206=typeof _0x103025[_0x64d5('0x1f')]===_0x64d5('0x20')&&typeof _0x103025['limit']==='undefined';var _0x2084c3=_0x1aeb8b['count'];var _0x1b22a3=_0xd3e206?0x0:_0x103025[_0x64d5('0x1f')];var _0x114125=_0xd3e206?_0x1aeb8b[_0x64d5('0x21')]:_0x103025[_0x64d5('0x1f')]+_0x103025[_0x64d5('0x22')];var _0x4961cc;if(_0x114125>=_0x2084c3){_0x114125=_0x2084c3;_0x4961cc=0xc8;}else{_0x4961cc=0xce;}_0x2f4f8c['status'](_0x4961cc);return _0x2f4f8c['set']('Content-Range',_0x1b22a3+'-'+_0x114125+'/'+_0x2084c3)[_0x64d5('0x23')](_0x1aeb8b);}return null;};}function patchUpdates(_0x1480b2){return function(_0x454c26){try{jsonpatch[_0x64d5('0x24')](_0x454c26,_0x1480b2,!![]);}catch(_0x30dcf7){return BPromise[_0x64d5('0x25')](_0x30dcf7);}return _0x454c26[_0x64d5('0x26')]();};}function saveUpdates(_0x1444ec,_0x36014b){return function(_0x128f53){if(_0x128f53){return _0x128f53[_0x64d5('0x27')](_0x1444ec)[_0x64d5('0x28')](function(_0x57f8ee){return _0x57f8ee;});}return null;};}function removeEntity(_0x312cf3,_0x4f8466){return function(_0x12da86){if(_0x12da86){return _0x12da86[_0x64d5('0x29')]()[_0x64d5('0x28')](function(){_0x312cf3[_0x64d5('0x1e')](0xcc)[_0x64d5('0x2a')]();});}};}function handleEntityNotFound(_0x276aeb,_0x28451b){return function(_0x945232){if(!_0x945232){_0x276aeb[_0x64d5('0x1d')](0x194);}return _0x945232;};}function handleError(_0x4c6be0,_0x517361){_0x517361=_0x517361||0x1f4;return function(_0x389532){logger[_0x64d5('0x2b')](_0x389532[_0x64d5('0x2c')]);if(_0x389532[_0x64d5('0x2d')]){delete _0x389532[_0x64d5('0x2d')];}_0x4c6be0[_0x64d5('0x1e')](_0x517361)['send'](_0x389532);};}exports['index']=function(_0x3b6dda,_0x30a851){var _0x142ff4={},_0x20f02d={},_0x2d4752={'count':0x0,'rows':[]};var _0x2645fb=_[_0x64d5('0x2e')](db[_0x64d5('0x2f')][_0x64d5('0x30')],function(_0x3ac4b6){return{'name':_0x3ac4b6[_0x64d5('0x31')],'type':_0x3ac4b6[_0x64d5('0x32')][_0x64d5('0x33')]};});_0x20f02d['model']=_['map'](_0x2645fb,_0x64d5('0x2d'));_0x20f02d['query']=_['keys'](_0x3b6dda[_0x64d5('0x34')]);_0x20f02d['filters']=_[_0x64d5('0x35')](_0x20f02d[_0x64d5('0x36')],_0x20f02d[_0x64d5('0x34')]);_0x142ff4[_0x64d5('0x37')]=_[_0x64d5('0x35')](_0x20f02d['model'],qs[_0x64d5('0x38')](_0x3b6dda[_0x64d5('0x34')][_0x64d5('0x38')]));_0x142ff4[_0x64d5('0x37')]=_0x142ff4[_0x64d5('0x37')]['length']?_0x142ff4[_0x64d5('0x37')]:_0x20f02d[_0x64d5('0x36')];if(!_0x3b6dda[_0x64d5('0x34')][_0x64d5('0x39')](_0x64d5('0x3a'))){_0x142ff4[_0x64d5('0x22')]=qs[_0x64d5('0x22')](_0x3b6dda[_0x64d5('0x34')][_0x64d5('0x22')]);_0x142ff4[_0x64d5('0x1f')]=qs['offset'](_0x3b6dda[_0x64d5('0x34')][_0x64d5('0x1f')]);}_0x142ff4['order']=qs['sort'](_0x3b6dda[_0x64d5('0x34')]['sort']);_0x142ff4[_0x64d5('0x3b')]=qs[_0x64d5('0x3c')](_['pick'](_0x3b6dda['query'],_0x20f02d[_0x64d5('0x3c')]),_0x2645fb);if(_0x3b6dda[_0x64d5('0x34')][_0x64d5('0x3d')]){_0x142ff4['where']=_[_0x64d5('0x3e')](_0x142ff4[_0x64d5('0x3b')],{'$or':_[_0x64d5('0x2e')](_0x2645fb,function(_0x4d8a71){if(_0x4d8a71[_0x64d5('0x32')]!==_0x64d5('0x3f')){var _0x4d8da1={};_0x4d8da1[_0x4d8a71[_0x64d5('0x2d')]]={'$like':'%'+_0x3b6dda[_0x64d5('0x34')][_0x64d5('0x3d')]+'%'};return _0x4d8da1;}})});}_0x142ff4=_[_0x64d5('0x3e')]({},_0x142ff4,_0x3b6dda[_0x64d5('0x40')]);var _0x226057={'where':_0x142ff4['where']};return db[_0x64d5('0x2f')][_0x64d5('0x21')](_0x226057)[_0x64d5('0x28')](function(_0xfec161){_0x2d4752[_0x64d5('0x21')]=_0xfec161;if(_0x3b6dda[_0x64d5('0x34')]['includeAll']){_0x142ff4[_0x64d5('0x41')]=[{'all':!![]}];}return db['UserProfile'][_0x64d5('0x42')](_0x142ff4);})[_0x64d5('0x28')](function(_0x233a54){_0x2d4752['rows']=_0x233a54;return _0x2d4752;})[_0x64d5('0x28')](respondWithFilteredResult(_0x30a851,_0x142ff4))[_0x64d5('0x43')](handleError(_0x30a851,null));};exports[_0x64d5('0x44')]=function(_0x3908e4,_0x18f731){var _0x202a1a={'raw':![],'where':{'id':_0x3908e4[_0x64d5('0x45')]['id']}},_0x265b33={};_0x265b33['model']=_[_0x64d5('0x46')](db[_0x64d5('0x2f')][_0x64d5('0x30')]);_0x265b33[_0x64d5('0x34')]=_[_0x64d5('0x46')](_0x3908e4['query']);_0x265b33[_0x64d5('0x3c')]=_[_0x64d5('0x35')](_0x265b33[_0x64d5('0x36')],_0x265b33[_0x64d5('0x34')]);_0x202a1a[_0x64d5('0x37')]=_[_0x64d5('0x35')](_0x265b33[_0x64d5('0x36')],qs[_0x64d5('0x38')](_0x3908e4[_0x64d5('0x34')]['fields']));_0x202a1a[_0x64d5('0x37')]=_0x202a1a[_0x64d5('0x37')][_0x64d5('0x47')]?_0x202a1a[_0x64d5('0x37')]:_0x265b33[_0x64d5('0x36')];if(_0x3908e4[_0x64d5('0x34')][_0x64d5('0x48')]){_0x202a1a[_0x64d5('0x41')]=[{'all':!![]}];}_0x202a1a=_[_0x64d5('0x3e')]({},_0x202a1a,_0x3908e4[_0x64d5('0x40')]);return db[_0x64d5('0x2f')][_0x64d5('0x49')](_0x202a1a)[_0x64d5('0x28')](handleEntityNotFound(_0x18f731,null))['then'](respondWithResult(_0x18f731,null))[_0x64d5('0x43')](handleError(_0x18f731,null));};exports[_0x64d5('0x4a')]=function(_0x2f0732,_0x36703d){return db['UserProfile']['create'](_0x2f0732['body'],{})[_0x64d5('0x28')](respondWithResult(_0x36703d,0xc9))[_0x64d5('0x43')](handleError(_0x36703d,null));};exports[_0x64d5('0x4b')]=function(_0x1834eb,_0xba3898){var _0x132c19={'where':{'id':_0x1834eb[_0x64d5('0x45')]['id']}},_0x3820cf={};_0x3820cf[_0x64d5('0x36')]=_[_0x64d5('0x46')](db['UserProfile'][_0x64d5('0x30')]);_0x132c19[_0x64d5('0x37')]=_[_0x64d5('0x35')](_0x3820cf[_0x64d5('0x36')],qs[_0x64d5('0x38')](_0x1834eb[_0x64d5('0x34')][_0x64d5('0x38')]));_0x132c19[_0x64d5('0x37')]=_0x132c19[_0x64d5('0x37')][_0x64d5('0x47')]?_0x132c19[_0x64d5('0x37')]:_0x3820cf['model'];if(_0x1834eb[_0x64d5('0x34')][_0x64d5('0x48')]){_0x132c19[_0x64d5('0x41')]=[{'all':!![]}];}_0x132c19=_['merge']({},_0x132c19,_0x1834eb[_0x64d5('0x40')]);return db['UserProfile']['find'](_0x132c19)[_0x64d5('0x28')](handleEntityNotFound(_0xba3898,null))[_0x64d5('0x28')](function(_0x24a11f){if(_0x24a11f){var _0x482452=_0x24a11f['get']({'plain':!![]});_0x482452=qs[_0x64d5('0x4c')](_0x482452,['id','createdAt',_0x64d5('0x4d'),'crudPermissions']);_0x1834eb[_0x64d5('0x4e')]=_[_0x64d5('0x4c')](_0x1834eb[_0x64d5('0x4e')],['id',_0x64d5('0x4f'),_0x64d5('0x4d')]);return db[_0x64d5('0x50')][_0x64d5('0x51')](function(_0x5ba306){return db[_0x64d5('0x2f')][_0x64d5('0x4a')](_['merge'](_0x482452,_0x1834eb[_0x64d5('0x4e')]),{'include':_0x1834eb[_0x64d5('0x34')][_0x64d5('0x48')]?[{'all':!![]}]:undefined,'transaction':_0x5ba306})[_0x64d5('0x28')](function(_0x1947d0){var _0x5c5a34=_0x1947d0[_0x64d5('0x52')]({'plain':!![]});return db['UserProfileSection'][_0x64d5('0x42')]({'where':{'userProfileId':_0x1834eb[_0x64d5('0x45')]['id']},'raw':!![]})['then'](function(_0x5d2100){if(_0x5d2100){return BPromise[_0x64d5('0x53')](_0x5d2100,function(_0x6e8816){return new BPromise(function(_0x2019d5,_0x40d726){if(_0x6e8816[_0x64d5('0x54')]===null||_0x6e8816[_0x64d5('0x54')]===0x1)_0x2019d5(null);return db[_0x64d5('0x55')][_0x64d5('0x42')]({'where':{'sectionId':_0x6e8816['id']},'raw':!![]})[_0x64d5('0x28')](function(_0x5c1e1d){var _0x4ea107=_['map'](_0x5c1e1d,function(_0x15c6e9){return qs['omit'](_0x15c6e9,['id',_0x64d5('0x4f'),'updatedAt',_0x64d5('0x56')]);});_0x2019d5(_0x4ea107);})[_0x64d5('0x43')](function(_0x24a76a){_0x40d726(_0x24a76a);});})[_0x64d5('0x28')](function(_0x5d9510){var _0x833bc2=qs[_0x64d5('0x4c')](_0x6e8816,['id',_0x64d5('0x4f'),_0x64d5('0x4d')]);_0x833bc2[_0x64d5('0x57')]=_0x5c5a34['id'];if(_0x5d9510)_0x833bc2[_0x64d5('0x58')]=_0x5d9510;return _0x833bc2;})[_0x64d5('0x28')](function(_0x16faf3){return db[_0x64d5('0x59')][_0x64d5('0x4a')](_0x16faf3,{'include':[{'model':db[_0x64d5('0x55')],'as':_0x64d5('0x58')}],'raw':!![],'transaction':_0x5ba306});});})[_0x64d5('0x28')](function(){return _0x5c5a34;});}});});});}})[_0x64d5('0x28')](respondWithResult(_0xba3898,0xc9))['catch'](handleError(_0xba3898,null));};exports[_0x64d5('0x27')]=function(_0x150c98,_0x4911c0){if(_0x150c98['body']['id']){delete _0x150c98[_0x64d5('0x4e')]['id'];}return db['UserProfile'][_0x64d5('0x49')]({'where':{'id':_0x150c98[_0x64d5('0x45')]['id']}})[_0x64d5('0x28')](handleEntityNotFound(_0x4911c0,null))['then'](saveUpdates(_0x150c98[_0x64d5('0x4e')],null))[_0x64d5('0x28')](respondWithResult(_0x4911c0,null))['catch'](handleError(_0x4911c0,null));};exports[_0x64d5('0x29')]=function(_0x4f6c23,_0x2b0d13){return db[_0x64d5('0x2f')][_0x64d5('0x49')]({'where':{'id':_0x4f6c23[_0x64d5('0x45')]['id']}})[_0x64d5('0x28')](handleEntityNotFound(_0x2b0d13,null))['then'](removeEntity(_0x2b0d13,null))[_0x64d5('0x43')](handleError(_0x2b0d13,null));};exports['describe']=function(_0xaf3ca5,_0x190330){return db[_0x64d5('0x2f')][_0x64d5('0x5a')]()[_0x64d5('0x28')](respondWithResult(_0x190330,null))[_0x64d5('0x43')](handleError(_0x190330,null));};exports[_0x64d5('0x5b')]=function(_0x304e46,_0x5bc41e){var _0x3bbfaa=_0x304e46[_0x64d5('0x4e')];return db[_0x64d5('0x2f')]['find']({'where':{'id':_0x304e46['params']['id']}})[_0x64d5('0x28')](handleEntityNotFound(_0x5bc41e,null))['then'](function(_0x25ed1d){if(_0x25ed1d){return db[_0x64d5('0x50')][_0x64d5('0x51')](function(_0x5baae4){return db[_0x64d5('0x59')][_0x64d5('0x29')]({'where':{'userProfileId':_0x304e46[_0x64d5('0x45')]['id'],'sectionId':_[_0x64d5('0x2e')](_0x3bbfaa,function(_0x11c45d){return _0x11c45d[_0x64d5('0x56')];})},'transaction':_0x5baae4})[_0x64d5('0x28')](function(){var _0x3f16a1=_[_0x64d5('0x2e')](_0x3bbfaa,function(_0x4a3fab){_0x4a3fab[_0x64d5('0x57')]=_0x304e46['params']['id'];return _0x4a3fab;});var _0x1f262b=[];return BPromise[_0x64d5('0x53')](_0x3f16a1,function(_0x56282f){return db[_0x64d5('0x59')]['create'](_0x56282f,{'include':[{'model':db[_0x64d5('0x55')],'as':_0x64d5('0x58')}],'raw':!![],'transaction':_0x5baae4})[_0x64d5('0x28')](function(_0x4e31d4){_0x1f262b[_0x64d5('0x5c')](_0x4e31d4['get']({'plain':!![]}));});})[_0x64d5('0x28')](function(){return _0x1f262b;});});});}})[_0x64d5('0x28')](function(_0x5a073c){return _0x5a073c;})['then'](respondWithResult(_0x5bc41e,null))[_0x64d5('0x43')](handleError(_0x5bc41e,null));};exports[_0x64d5('0x5d')]=function(_0x48a09f,_0x1b371a){var _0x5c9aab;return db[_0x64d5('0x2f')][_0x64d5('0x49')]({'where':{'id':_0x48a09f[_0x64d5('0x45')]['id']},'attributes':['id',_0x64d5('0x2d')]})['then'](handleEntityNotFound(_0x1b371a,null))['then'](function(_0x3912a7){if(_0x3912a7){_0x5c9aab=_0x3912a7;return db['UserProfileSection'][_0x64d5('0x29')]({'where':{'userProfileId':_0x48a09f[_0x64d5('0x45')]['id'],'sectionId':_0x48a09f[_0x64d5('0x34')][_0x64d5('0x5e')]}});}})[_0x64d5('0x28')](function(){return _0x5c9aab;})['then'](respondWithStatusCode(_0x1b371a,null))[_0x64d5('0x43')](handleError(_0x1b371a,null));};exports[_0x64d5('0x5f')]=function(_0x2a3b72,_0x6a44c3){var _0x33f4b5=[];var _0x4f6fc7=[];return db[_0x64d5('0x59')][_0x64d5('0x42')]({'where':{'userProfileId':_0x2a3b72[_0x64d5('0x45')]['id']},'raw':!![]})['then'](function(_0x2a137f){_0x33f4b5=_[_0x64d5('0x3d')](_0x2a137f,function(_0x47b8b6){return _0x47b8b6[_0x64d5('0x60')]===0x1||_[_0x64d5('0x61')]([0x3eb,0x709],_0x47b8b6['sectionId']);});if(!_[_0x64d5('0x62')](_0x33f4b5)){return _['map'](_0x33f4b5,function(_0x5b3054){return _0x5b3054[_0x64d5('0x56')];});}else{return;}})[_0x64d5('0x28')](function(_0x3aa394){if(_0x3aa394)_0x4f6fc7=_0x3aa394;if(_['includes'](_0x4f6fc7,0x64)){var _0x3694f7=_[_0x64d5('0x49')](_0x33f4b5,{'sectionId':0x64});return hasDefaultDashboard(_0x3694f7)[_0x64d5('0x28')](function(_0x3f0b89){return _[_0x64d5('0x2e')](_0x33f4b5,function(_0x5c4591){if(_0x5c4591[_0x64d5('0x56')]===0x64){_0x5c4591[_0x64d5('0x63')]=_0x3f0b89;}return _0x5c4591;});});}else{return;}})[_0x64d5('0x28')](function(_0x36851b){if(_0x36851b)_0x33f4b5=_0x36851b;if(_[_0x64d5('0x61')](_0x4f6fc7,0x3eb)){var _0x3cf0ad=_[_0x64d5('0x49')](_0x33f4b5,{'sectionId':0x3eb});return getCustomDashboards(_0x3cf0ad)[_0x64d5('0x28')](function(_0x3d7130){return _[_0x64d5('0x2e')](_0x33f4b5,function(_0x1038fe){if(_0x3cf0ad[_0x64d5('0x60')]){if(_0x1038fe['sectionId']===0x3eb){_0x1038fe['subsections']=_0x3d7130;}}else{if(_0x1038fe['sectionId']===0x64){if(!_0x1038fe['subsections']){_0x1038fe[_0x64d5('0x63')]=[];}_0x1038fe[_0x64d5('0x63')]=_0x1038fe[_0x64d5('0x63')][_0x64d5('0x64')](_0x3d7130);}}return _0x1038fe;});});}else{return;}})['then'](function(_0x39d572){if(_0x39d572)_0x33f4b5=_0x39d572;if(_[_0x64d5('0x61')](_0x4f6fc7,0x709)){var _0x2d26a3=_['find'](_0x33f4b5,{'sectionId':0x709});return getPlugins(_0x2d26a3)[_0x64d5('0x28')](function(_0x1fd9f2){if(_0x2d26a3[_0x64d5('0x60')]){return _[_0x64d5('0x2e')](_0x33f4b5,function(_0x32db98){if(_0x32db98[_0x64d5('0x56')]===0x709){_0x32db98[_0x64d5('0x63')]=_0x1fd9f2;}return _0x32db98;});}else{var _0x4dc57d={'sectionId':0x76c,'enabled':0x1,'subsections':_0x1fd9f2};var _0x3d50d9=_[_0x64d5('0x2e')](_0x33f4b5);_0x3d50d9['push'](_0x4dc57d);return _0x3d50d9;}});}else{return;}})[_0x64d5('0x28')](function(_0x550e16){if(_0x550e16)_0x33f4b5=_0x550e16;return _[_0x64d5('0x3d')](_0x33f4b5,['enabled',0x1]);})[_0x64d5('0x28')](respondWithResult(_0x6a44c3,null))[_0x64d5('0x43')](handleError(_0x6a44c3,null));};function hasDefaultDashboard(_0x413eaa){var _0x1a4b45=[0x65];return new BPromise(function(_0x1e495a,_0x38052f){try{if(_0x413eaa[_0x64d5('0x54')]){_0x1e495a(_0x1a4b45);}else{return db[_0x64d5('0x55')][_0x64d5('0x65')]({'where':{'sectionId':_0x413eaa['id']},'raw':!![]})['then'](function(_0x492029){_0x492029?_0x1e495a(_0x1a4b45):_0x1e495a();});}}catch(_0xb3d402){_0x38052f(_0xb3d402);}});}function getCustomDashboards(_0x380ad9){var _0x5cc4d9=[];return new BPromise(function(_0x31170a,_0x4509d2){try{if(_0x380ad9['autoAssociation']){return db[_0x64d5('0x66')]['findAll']({'raw':!![]})[_0x64d5('0x28')](function(_0x120262){_0x120262[_0x64d5('0x67')](function(_0x2c1935){_0x5cc4d9['push'](_0x2c1935['id']+0x1869f);});_0x31170a(_0x5cc4d9);});}else{return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x380ad9['id']},'raw':!![]})[_0x64d5('0x28')](function(_0x280ca0){_0x280ca0[_0x64d5('0x67')](function(_0x249ab1){_0x5cc4d9['push'](_0x249ab1[_0x64d5('0x68')]+0x1869f);});_0x31170a(_0x5cc4d9);});}}catch(_0x4ce255){_0x4509d2(_0x4ce255);}});}function getPlugins(_0x9320ff){var _0x48f258=[];return new BPromise(function(_0x5d7e15,_0x3ae764){try{if(_0x9320ff[_0x64d5('0x54')]){return db[_0x64d5('0x69')][_0x64d5('0x42')]({'raw':!![]})[_0x64d5('0x28')](function(_0xb574fe){_0xb574fe[_0x64d5('0x67')](function(_0x4a514d){_0x48f258[_0x64d5('0x5c')](_0x4a514d['id']+0x15b38);});_0x5d7e15(_0x48f258);});}else{return db['UserProfileResource'][_0x64d5('0x42')]({'where':{'sectionId':_0x9320ff['id']},'raw':!![]})['then'](function(_0x2feb55){_0x2feb55[_0x64d5('0x67')](function(_0x5d12f1){_0x48f258[_0x64d5('0x5c')](_0x5d12f1[_0x64d5('0x68')]+0x15b38);});_0x5d7e15(_0x48f258);});}}catch(_0x1805e7){_0x3ae764(_0x1805e7);}});}exports['addResources']=function(_0x5c570d,_0x2d9137){return db['UserProfile']['find']({'where':{'id':_0x5c570d[_0x64d5('0x45')]['id']}})[_0x64d5('0x28')](handleEntityNotFound(_0x2d9137,null))[_0x64d5('0x28')](function(_0x26f70d){if(_0x26f70d){return db[_0x64d5('0x50')][_0x64d5('0x51')](function(_0x4ed0c0){return db['UserProfileSection'][_0x64d5('0x42')]({'where':{'userProfileId':_0x5c570d['params']['id']},'attributes':['id'],'raw':!![]})[_0x64d5('0x28')](function(_0x1e2e06){if(_0x1e2e06){return db[_0x64d5('0x59')][_0x64d5('0x29')]({'where':{'userProfileId':_0x5c570d[_0x64d5('0x45')]['id'],'id':_[_0x64d5('0x2e')](_0x1e2e06,function(_0x4c6989){return _0x4c6989['id'];})},'transaction':_0x4ed0c0});}})[_0x64d5('0x28')](function(_0x1d299d){var _0x3ec3f6=_['map'](_0x5c570d[_0x64d5('0x4e')],function(_0x4bd684){_0x4bd684[_0x64d5('0x57')]=_0x5c570d[_0x64d5('0x45')]['id'];return _0x4bd684;});return db['UserProfileSection'][_0x64d5('0x6a')](_0x3ec3f6,{'raw':!![],'transaction':_0x4ed0c0});})['then'](function(_0x5d0aa9){var _0x3fc976=_['filter'](_['map'](_0x5d0aa9,function(_0x93843b){return _0x93843b[_0x64d5('0x52')]({'plain':!![]});}),{'includeAll':![]});if(_0x3fc976){return db[_0x64d5('0x59')]['findAll']({'where':{'userProfileId':_0x5c570d[_0x64d5('0x45')]['id'],'sectionId':_[_0x64d5('0x2e')](_0x3fc976,function(_0x3d44e1){return _0x3d44e1['sectionId'];})},'attributes':['id','sectionId'],'raw':!![]})['then'](function(_0x3e0860){var _0x342d04=_[_0x64d5('0x2e')](_0x5c570d[_0x64d5('0x4e')],function(_0x618376){_0x618376[_0x64d5('0x57')]=_0x5c570d[_0x64d5('0x45')]['id'];return _0x618376;});return db[_0x64d5('0x55')][_0x64d5('0x6a')](_0x342d04,{'raw':!![],'transaction':_0x4ed0c0});});}})['catch'](handleError(_0x2d9137,null));});}})[_0x64d5('0x28')](function(_0x574f61){var _0x2ff276=_[_0x64d5('0x2e')](_0x574f61,function(_0xea2594){return _0xea2594[_0x64d5('0x52')]({'plain':!![]});});})['then'](respondWithResult(_0x2d9137,null))[_0x64d5('0x43')](handleError(_0x2d9137,null));};exports['removeResources']=function(_0x3b2682,_0x46d3fc,_0x5bf719){return db[_0x64d5('0x2f')][_0x64d5('0x49')]({'where':{'id':_0x3b2682[_0x64d5('0x45')]['id']}})['then'](handleEntityNotFound(_0x46d3fc,null))[_0x64d5('0x28')](function(_0x5a1997){if(_0x5a1997){return _0x5a1997[_0x64d5('0x6b')](_0x3b2682[_0x64d5('0x34')][_0x64d5('0x5e')]);}})[_0x64d5('0x28')](respondWithStatusCode(_0x46d3fc,null))[_0x64d5('0x43')](handleError(_0x46d3fc,null));};exports['getResources']=function(_0x4d0408,_0x92a408){var _0x3eac64={};if(!_0x4d0408[_0x64d5('0x34')][_0x64d5('0x6c')])throw new Error('Missing\x20section\x20parameter');if(!_0x4d0408['query'][_0x64d5('0x39')](_0x64d5('0x3a'))){_0x3eac64[_0x64d5('0x22')]=qs[_0x64d5('0x22')](_0x4d0408[_0x64d5('0x34')][_0x64d5('0x22')]);_0x3eac64[_0x64d5('0x1f')]=qs['offset'](_0x4d0408[_0x64d5('0x34')][_0x64d5('0x1f')]);}return db[_0x64d5('0x2f')][_0x64d5('0x49')]({'where':{'id':_0x4d0408['params']['id']}})[_0x64d5('0x28')](function(_0x1fff50){if(!_0x1fff50)throw new Error(_0x64d5('0x6d')+_0x4d0408[_0x64d5('0x45')]['id']);return db[_0x64d5('0x2f')]['getResources'](_0x4d0408);})[_0x64d5('0x28')](respondWithFilteredResult(_0x92a408,_0x3eac64))[_0x64d5('0x43')](handleError(_0x92a408,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 53abd71..06caeb5 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 _0x38b2=['UserProfile','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x5a311c,_0x48c818){var _0x358985=function(_0x36e70f){while(--_0x36e70f){_0x5a311c['push'](_0x5a311c['shift']());}};_0x358985(++_0x48c818);}(_0x38b2,0xf6));var _0x238b=function(_0x184654,_0x4a64d1){_0x184654=_0x184654-0x0;var _0x18b5ce=_0x38b2[_0x184654];return _0x18b5ce;};'use strict';var EventEmitter=require(_0x238b('0x0'));var UserProfile=require(_0x238b('0x1'))['db'][_0x238b('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x238b('0x3'),'afterDestroy':_0x238b('0x4')};function emitEvent(_0x4df021){return function(_0x44251b,_0x4c4f0e,_0x44ddd2){UserProfileEvents[_0x238b('0x5')](_0x4df021+':'+_0x44251b['id'],_0x44251b);UserProfileEvents[_0x238b('0x5')](_0x4df021,_0x44251b);_0x44ddd2(null);};}for(var e in events){if(events[_0x238b('0x6')](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module[_0x238b('0x7')]=UserProfileEvents; \ No newline at end of file +var _0x8f9d=['hasOwnProperty','hook','exports','events','UserProfile','save','update','remove','emit'];(function(_0x218994,_0x2cf487){var _0x3f350b=function(_0x2e2065){while(--_0x2e2065){_0x218994['push'](_0x218994['shift']());}};_0x3f350b(++_0x2cf487);}(_0x8f9d,0x93));var _0xd8f9=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x8f9d[_0x42cae2];return _0x5f256f;};'use strict';var EventEmitter=require(_0xd8f9('0x0'));var UserProfile=require('../../mysqldb')['db'][_0xd8f9('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd8f9('0x2'),'afterUpdate':_0xd8f9('0x3'),'afterDestroy':_0xd8f9('0x4')};function emitEvent(_0x354c26){return function(_0x1f9331,_0x1b82b8,_0x1d6420){UserProfileEvents['emit'](_0x354c26+':'+_0x1f9331['id'],_0x1f9331);UserProfileEvents[_0xd8f9('0x5')](_0x354c26,_0x1f9331);_0x1d6420(null);};}for(var e in events){if(events[_0xd8f9('0x6')](e)){var event=events[e];UserProfile[_0xd8f9('0x7')](e,emitEvent(event));}}module[_0xd8f9('0x8')]=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index 1b351d6..3fae916 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 _0x2ecc=['Tag','Template','triggers','Trigger','trunks','variables','plugins','extractedreports','Reports','charAt','toUpperCase','slice','Sequelize','SELECT','select','ui.','InteractionId','ui.createdAt','user_has_','sequelize','query','toString','OpenTabs','define','UserProfile','user_profiles','../../components/parsers/qs','raw','section','mergeResources','isEmpty','length','push','UserProfileSection','params','all','union','find','ignore','rawAttributes','keys','filters','intersection','attributes','fields','nolimit','limit','offset','order','sort','where','merge','key','VIRTUAL','forEach','autoAssociation','includeAll','include','reportType','default','reportId','custom','CustomReports','count','ids','customSorting','extraQueryConditions','Tags','tag','ThroughTags','rows','openTabs','true','dataValues','sms','fax','mail','openchannel','lodash','./userProfile.attributes','squel','exports','models','filter','field','associatedResources','map','catch','value','model','findAll','then','UserProfileResource','AnalyticExtractedReport','resourceId','squareprojects','childModel','squarerecordings','SquareRecording','SquareProjects','name','projects','JscriptyProject','CmContact','parentSections','Lists','ListId','lists','CmList','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxqueues','FaxQueue','faxaccounts','FaxAccount','inboundroutes','internalroutes','outboundroutes','VoiceExtension','contexts','voicemails','VoiceMail','membername','User','agent','Telephones','role','telephone','queue','VoiceQueue','type','inbound','QueueCampaigns','outbound','musiconholds','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','Campaign','mailqueues','MailQueue','mailaccounts','MailAccount','openchannelqueues','OpenchannelQueue','openchannelaccounts','smsqueues','SmsQueue','smsaccounts','SmsAccount','whatsappqueues','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','Team','voicequeues','queuecampaigns','VoiceQueues','users','agents','telephones','Users','admin','user','Agents','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Disposition','customdashboards','Dashboard','Interval','sounds','Sound','tags'];(function(_0x485901,_0x23af6c){var _0x6d6637=function(_0x5a3615){while(--_0x5a3615){_0x485901['push'](_0x485901['shift']());}};_0x6d6637(++_0x23af6c);}(_0x2ecc,0x1ce));var _0xc2ec=function(_0x472cb6,_0x55025d){_0x472cb6=_0x472cb6-0x0;var _0x37b417=_0x2ecc[_0x472cb6];return _0x37b417;};'use strict';var _=require(_0xc2ec('0x0'));var attributes=require(_0xc2ec('0x1'));var squel=require(_0xc2ec('0x2'));module[_0xc2ec('0x3')]=function(_0x292587){var _0x2c0fec=_0x292587[_0xc2ec('0x4')];function _0x440873(_0x409c78,_0x3074b4){return new Promise(function(_0x426b57,_0x30222a){if(!_0x3074b4)return _0x426b57(null);var _0x440fd2=_0x3074b4[_0xc2ec('0x5')]?{[_0x3074b4[_0xc2ec('0x5')][_0xc2ec('0x6')]]:_0x3074b4['filter']['value']}:undefined;return _0x2c0fec[_0x409c78]['findAll']({'where':_0x440fd2,'raw':!![]})['then'](function(_0x1d70de){_0x3074b4[_0xc2ec('0x7')]=_[_0xc2ec('0x8')](_0x1d70de,'id');_0x426b57(_0x3074b4);})[_0xc2ec('0x9')](function(_0x34f396){_0x30222a(_0x34f396);});});}function _0x5b73eb(_0x59e81a,_0x2c55bb){return new Promise(function(_0x547ed5,_0x2647e6){var _0x9fad04=_0x59e81a['filter']?{[_0x59e81a[_0xc2ec('0x5')][_0xc2ec('0x6')]]:_0x59e81a[_0xc2ec('0x5')][_0xc2ec('0xa')]}:undefined;return _0x2c0fec[_0x59e81a[_0xc2ec('0xb')]][_0xc2ec('0xc')]({'where':_0x9fad04,'raw':!![]})[_0xc2ec('0xd')](function(_0x2f0284){_0x2c55bb[_0xc2ec('0x7')]=_['map'](_0x2f0284,function(_0x29052c){return _0x29052c['name'];});_0x547ed5(_0x2c55bb);})[_0xc2ec('0x9')](function(_0x89669a){_0x2647e6(_0x89669a);});});}function _0x178da9(_0x58c3d6,_0x3f22c6,_0x515eb4){if(!_0x3f22c6)return Promise['resolve'](null);return new Promise(function(_0x320dea,_0x53da3f){return _0x2c0fec[_0xc2ec('0xe')]['findAll']({'where':{'sectionId':_0x3f22c6['id']},'raw':!![]})[_0xc2ec('0xd')](function(_0x566e37){if(_0x58c3d6[_0xc2ec('0x6')]&&_0x58c3d6[_0xc2ec('0x6')]!=='id'){_0x3f22c6[_0xc2ec('0x7')]=_[_0xc2ec('0x8')](_0x566e37,function(_0x5983d7){return _0x5983d7[_0x58c3d6[_0xc2ec('0x6')]];});}else{if(_0x515eb4===_0xc2ec('0xf')){_0x3f22c6[_0xc2ec('0x7')]=_['map'](_0x566e37,function(_0x583062){return{'id':_0x583062[_0xc2ec('0x10')],'type':_0x583062['type']};});}else{_0x3f22c6['associatedResources']=_['map'](_0x566e37,function(_0x39761f){return _0x39761f['resourceId'];});}}_0x320dea(_0x3f22c6);})[_0xc2ec('0x9')](function(_0x52d4ee){_0x53da3f(_0x52d4ee);});});}function _0x4a552b(_0x37f6a4,_0x25cea0){var _0xd34028={'parentSections':[]};switch(_0x37f6a4['toLowerCase']()){case _0xc2ec('0x11'):_0xd34028[_0xc2ec('0x12')]='SquareProject';break;case'odbc':_0xd34028[_0xc2ec('0x12')]='SquareOdbc';break;case _0xc2ec('0x13'):_0xd34028[_0xc2ec('0x12')]=_0xc2ec('0x14');_0xd34028['parentSections']=[{'name':_0xc2ec('0x15'),'field':_0xc2ec('0x16'),'foreignKey':'projectName'}];break;case _0xc2ec('0x17'):_0xd34028['childModel']=_0xc2ec('0x18');break;case'contacts':_0xd34028['childModel']=_0xc2ec('0x19');_0xd34028[_0xc2ec('0x1a')]=[{'name':_0xc2ec('0x1b'),'field':'id','foreignKey':_0xc2ec('0x1c')}];break;case _0xc2ec('0x1d'):_0xd34028[_0xc2ec('0x12')]=_0xc2ec('0x1e');break;case'companies':_0xd34028[_0xc2ec('0x12')]='CmCompany';break;case _0xc2ec('0x1f'):_0xd34028[_0xc2ec('0x12')]=_0xc2ec('0x20');break;case _0xc2ec('0x21'):_0xd34028[_0xc2ec('0x12')]=_0xc2ec('0x22');break;case _0xc2ec('0x23'):_0xd34028['childModel']=_0xc2ec('0x24');break;case _0xc2ec('0x25'):_0xd34028['childModel']=_0xc2ec('0x26');break;case _0xc2ec('0x27'):_0xd34028['childModel']=_0xc2ec('0x28');break;case _0xc2ec('0x29'):case _0xc2ec('0x2a'):case _0xc2ec('0x2b'):_0xd34028[_0xc2ec('0x12')]=_0xc2ec('0x2c');break;case _0xc2ec('0x2d'):_0xd34028[_0xc2ec('0x12')]='VoiceContext';break;case _0xc2ec('0x2e'):_0xd34028[_0xc2ec('0x12')]=_0xc2ec('0x2f');break;case'voicerecordings':_0xd34028[_0xc2ec('0x12')]='VoiceRecording';_0xd34028['parentSections']=[{'name':'Agents','field':_0xc2ec('0x16'),'foreignKey':_0xc2ec('0x30'),'model':_0xc2ec('0x31'),'filter':{'field':'role','value':[_0xc2ec('0x32')]}},{'name':_0xc2ec('0x33'),'field':_0xc2ec('0x16'),'foreignKey':'membername','model':_0xc2ec('0x31'),'filter':{'field':_0xc2ec('0x34'),'value':[_0xc2ec('0x35')]}},{'name':'VoiceQueues','field':_0xc2ec('0x16'),'foreignKey':_0xc2ec('0x36'),'model':_0xc2ec('0x37'),'filter':{'field':_0xc2ec('0x38'),'value':[_0xc2ec('0x39')]}},{'name':_0xc2ec('0x3a'),'field':_0xc2ec('0x16'),'foreignKey':_0xc2ec('0x36'),'model':_0xc2ec('0x37'),'filter':{'field':_0xc2ec('0x38'),'value':[_0xc2ec('0x3b')]}}];break;case _0xc2ec('0x3c'):_0xd34028[_0xc2ec('0x12')]='VoiceMusicOnHold';break;case _0xc2ec('0x3d'):_0xd34028[_0xc2ec('0x12')]=_0xc2ec('0x3e');break;case _0xc2ec('0x3f'):_0xd34028['childModel']=_0xc2ec('0x40');break;case'ivrcampaigns':_0xd34028[_0xc2ec('0x12')]=_0xc2ec('0x41');break;case _0xc2ec('0x42'):_0xd34028[_0xc2ec('0x12')]=_0xc2ec('0x43');break;case _0xc2ec('0x44'):_0xd34028[_0xc2ec('0x12')]=_0xc2ec('0x45');break;case'mailsubstatuses':_0xd34028[_0xc2ec('0x12')]='MailSubstatus';break;case _0xc2ec('0x46'):_0xd34028[_0xc2ec('0x12')]=_0xc2ec('0x47');break;case _0xc2ec('0x48'):_0xd34028[_0xc2ec('0x12')]='OpenchannelAccount';break;case _0xc2ec('0x49'):_0xd34028[_0xc2ec('0x12')]=_0xc2ec('0x4a');break;case _0xc2ec('0x4b'):_0xd34028[_0xc2ec('0x12')]=_0xc2ec('0x4c');break;case _0xc2ec('0x4d'):_0xd34028[_0xc2ec('0x12')]=_0xc2ec('0x4e');break;case _0xc2ec('0x4f'):_0xd34028['childModel']=_0xc2ec('0x50');break;case _0xc2ec('0x51'):_0xd34028[_0xc2ec('0x12')]=_0xc2ec('0x52');break;case _0xc2ec('0x53'):case _0xc2ec('0x54'):_0xd34028[_0xc2ec('0x12')]=_0xc2ec('0x37');if(_0x25cea0){_0xd34028[_0xc2ec('0x1a')]=[{'name':_0xc2ec('0x55')},{'name':'QueueCampaigns'}];}break;case _0xc2ec('0x56'):case _0xc2ec('0x57'):case _0xc2ec('0x58'):_0xd34028[_0xc2ec('0x12')]=_0xc2ec('0x31');if(_0x25cea0){_0xd34028['parentSections']=[{'name':_0xc2ec('0x59'),'filter':{'field':_0xc2ec('0x34'),'value':[_0xc2ec('0x5a'),_0xc2ec('0x5b')]},'ignore':!![]},{'name':_0xc2ec('0x5c')},{'name':_0xc2ec('0x33')}];}break;case _0xc2ec('0x5d'):_0xd34028[_0xc2ec('0x12')]=_0xc2ec('0x5e');break;case _0xc2ec('0x5f'):_0xd34028[_0xc2ec('0x12')]=_0xc2ec('0x60');break;case'freshdeskaccounts':_0xd34028[_0xc2ec('0x12')]='FreshdeskAccount';break;case _0xc2ec('0x61'):_0xd34028[_0xc2ec('0x12')]=_0xc2ec('0x62');break;case _0xc2ec('0x63'):_0xd34028[_0xc2ec('0x12')]=_0xc2ec('0x64');break;case _0xc2ec('0x65'):_0xd34028['childModel']=_0xc2ec('0x66');break;case _0xc2ec('0x67'):_0xd34028['childModel']=_0xc2ec('0x31');break;case _0xc2ec('0x68'):_0xd34028[_0xc2ec('0x12')]=_0xc2ec('0x69');break;case _0xc2ec('0x6a'):_0xd34028['childModel']=_0xc2ec('0x6b');break;case _0xc2ec('0x6c'):_0xd34028[_0xc2ec('0x12')]=_0xc2ec('0x6d');break;case'intervals':_0xd34028[_0xc2ec('0x12')]=_0xc2ec('0x6e');break;case'pauses':_0xd34028[_0xc2ec('0x12')]='Pause';break;case'scheduler':_0xd34028['childModel']='Schedule';break;case _0xc2ec('0x6f'):_0xd34028[_0xc2ec('0x12')]=_0xc2ec('0x70');break;case _0xc2ec('0x71'):_0xd34028[_0xc2ec('0x12')]=_0xc2ec('0x72');break;case'templates':_0xd34028[_0xc2ec('0x12')]=_0xc2ec('0x73');break;case _0xc2ec('0x74'):_0xd34028[_0xc2ec('0x12')]=_0xc2ec('0x75');break;case _0xc2ec('0x76'):_0xd34028['childModel']='Trunk';break;case _0xc2ec('0x77'):_0xd34028[_0xc2ec('0x12')]='Variable';break;case _0xc2ec('0x78'):_0xd34028[_0xc2ec('0x12')]='Plugin';break;case _0xc2ec('0x79'):_0xd34028[_0xc2ec('0x12')]=_0xc2ec('0xf');_0xd34028['parentSections']=[{'name':_0xc2ec('0x7a'),'field':'id','foreignKey':'reportId'}];break;case'metrics':_0xd34028['childModel']='AnalyticMetric';break;}return _0xd34028;}function _0x2a50e4(_0x6c6d73,_0x234560){var _0x5cff92=_0x6c6d73[_0xc2ec('0x7b')](0x0)[_0xc2ec('0x7c')]()+_0x6c6d73[_0xc2ec('0x7d')](0x1);var _0x506599={'type':_0x2c0fec[_0xc2ec('0x7e')]['QueryTypes'][_0xc2ec('0x7f')],'raw':!![]};return new Promise(function(_0x5dee06,_0x2dd56d){var _0x14cd45=squel[_0xc2ec('0x80')]()[_0xc2ec('0x6')](_0xc2ec('0x81')+_0x5cff92+_0xc2ec('0x82'),'id')[_0xc2ec('0x6')](_0xc2ec('0x83'))['from'](_0xc2ec('0x84')+_0x6c6d73+'_interactions','ui')['where']('ui.UserId\x20=\x20?',_0x234560['id']);return _0x2c0fec[_0xc2ec('0x85')][_0xc2ec('0x86')](_0x14cd45[_0xc2ec('0x87')](),_0x506599)['then'](function(_0x426295){_0x234560[_0x5cff92+_0xc2ec('0x88')]=_0x426295;_0x5dee06(_0x426295);})[_0xc2ec('0x9')](function(_0x4be3ad){_0x2dd56d(_0x4be3ad);});});}return _0x292587[_0xc2ec('0x89')](_0xc2ec('0x8a'),attributes,{'tableName':_0xc2ec('0x8b'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x37d5fb){var _0x47ccf2=require(_0xc2ec('0x8c'));var _0x2983da={'raw':_0x37d5fb[_0xc2ec('0x86')][_0xc2ec('0x8d')],'where':{}};var _0x1c4941={};var _0x1f2dc6={'count':0x0,'rows':[]};var _0x4f4a55=_0x37d5fb[_0xc2ec('0x86')][_0xc2ec('0x8e')];var _0x4bbfa8=_0x37d5fb[_0xc2ec('0x86')][_0xc2ec('0x8f')]||![];var _0x278bbb=_0x4a552b(_0x4f4a55,_0x4bbfa8);if(!_0x278bbb[_0xc2ec('0x12')])throw new Error('Invalid\x20section\x20\x27'+_0x4f4a55+'\x27');var _0x3e6b77=[{'name':_0x4f4a55}];if(!_[_0xc2ec('0x90')](_0x278bbb[_0xc2ec('0x1a')]))_0x3e6b77=_0x278bbb['parentSections'];var _0x604445=[];for(var _0x2fb045=0x0;_0x2fb045<_0x3e6b77[_0xc2ec('0x91')];_0x2fb045++){_0x604445[_0xc2ec('0x92')](_0x2c0fec[_0xc2ec('0x93')]['find']({'where':{'userProfileId':_0x37d5fb[_0xc2ec('0x94')]['id'],'name':_0x3e6b77[_0x2fb045][_0xc2ec('0x16')]},'raw':!![]}));}return Promise[_0xc2ec('0x95')](_0x604445)[_0xc2ec('0xd')](function(_0x36fc9a){var _0x505008=_[_0xc2ec('0x5')](_0x36fc9a,function(_0x20e3bf){return _0x20e3bf?_0x20e3bf:undefined;});var _0x2fa2c1=_[_0xc2ec('0x5')](_0x3e6b77,['ignore',!![]]);var _0x16a290=_['isEmpty'](_0x505008)&&_[_0xc2ec('0x90')](_0x2fa2c1)?null:_[_0xc2ec('0x96')](_0x2fa2c1,_0x505008);if(!_0x16a290)return null;var _0x5237e8=[];for(var _0x5dbb67=0x0;_0x5dbb67<_0x16a290[_0xc2ec('0x91')];_0x5dbb67++){var _0x40e656=_[_0xc2ec('0x97')](_0x3e6b77,function(_0x568897){return _0x16a290[_0x5dbb67]?_0x568897['name']===_0x16a290[_0x5dbb67][_0xc2ec('0x16')]:null;});if(_0x40e656){if(_0x16a290[_0x5dbb67][_0xc2ec('0x98')]){_0x5237e8[_0xc2ec('0x92')](_0x440873(_0x278bbb[_0xc2ec('0x12')],_0x16a290[_0x5dbb67]));}else{if(!_0x16a290[_0x5dbb67]['autoAssociation']){_0x5237e8['push'](_0x178da9(_0x40e656,_0x16a290[_0x5dbb67],_0x278bbb[_0xc2ec('0x12')]));}else{if(_0x40e656[_0xc2ec('0xb')]){_0x5237e8[_0xc2ec('0x92')](_0x5b73eb(_0x40e656,_0x16a290[_0x5dbb67]));}}}}}return Promise[_0xc2ec('0x95')](_0x5237e8);})[_0xc2ec('0xd')](function(_0x3aa964){var _0x4f5e93=_0x3aa964;var _0x5514f4=null;if(_0x4f5e93){_0x5514f4=_0x4f5e93['length']===0x1?_0x4f5e93[0x0]:null;}if(!_0x5514f4&&!_0x4f5e93)return _0x1f2dc6;var _0x157ffb=_0x2c0fec[_0x278bbb[_0xc2ec('0x12')]][_0xc2ec('0x99')];_0x1c4941['model']=_[_0xc2ec('0x9a')](_0x157ffb);_0x1c4941['query']=_[_0xc2ec('0x9a')](_0x37d5fb[_0xc2ec('0x86')]);_0x1c4941[_0xc2ec('0x9b')]=_[_0xc2ec('0x9c')](_0x1c4941[_0xc2ec('0xb')],_0x1c4941['query']);_0x2983da[_0xc2ec('0x9d')]=_['intersection'](_0x1c4941[_0xc2ec('0xb')],_0x47ccf2['fields'](_0x37d5fb[_0xc2ec('0x86')][_0xc2ec('0x9e')]));_0x2983da[_0xc2ec('0x9d')]=_0x2983da[_0xc2ec('0x9d')][_0xc2ec('0x91')]?_0x2983da['attributes']:_0x1c4941['model'];if(!_0x37d5fb['query']['hasOwnProperty'](_0xc2ec('0x9f'))){_0x2983da['limit']=_0x47ccf2[_0xc2ec('0xa0')](_0x37d5fb[_0xc2ec('0x86')][_0xc2ec('0xa0')]);_0x2983da['offset']=_0x47ccf2[_0xc2ec('0xa1')](_0x37d5fb[_0xc2ec('0x86')][_0xc2ec('0xa1')]);}_0x2983da[_0xc2ec('0xa2')]=_0x47ccf2[_0xc2ec('0xa3')](_0x37d5fb['query'][_0xc2ec('0xa3')]);_0x2983da[_0xc2ec('0xa4')]=_0x47ccf2[_0xc2ec('0x9b')](_['pick'](_0x37d5fb['query'],_0x1c4941[_0xc2ec('0x9b')]));if(_0x37d5fb['query']['filter']){_0x2983da['where']=_[_0xc2ec('0xa5')](_0x2983da['where'],{'$or':_[_0xc2ec('0x8')](_0x157ffb,function(_0x1f81b7){if(_0x1f81b7['type'][_0xc2ec('0xa6')]!==_0xc2ec('0xa7')){var _0x1325aa={};_0x1325aa[_0x1f81b7['field']]={'$like':'%'+_0x37d5fb[_0xc2ec('0x86')][_0xc2ec('0x5')]+'%'};return _0x1325aa;}})});}var _0x71e62b=[];var _0x459a94=null;var _0x3090aa={};if(_0x5514f4){_0x459a94=_[_0xc2ec('0x97')](_0x3e6b77,['name',_0x5514f4['name']]);if(_0x459a94[_0xc2ec('0x6')]){_0x3090aa={};if(_0x278bbb[_0xc2ec('0x12')]===_0xc2ec('0xf')){_0x3090aa[_0x459a94['foreignKey']]=_[_0xc2ec('0x8')](_0x5514f4[_0xc2ec('0x7')],'id');}else{_0x3090aa[_0x459a94['foreignKey']]=_0x5514f4[_0xc2ec('0x7')];}_0x71e62b['push'](_0x3090aa);}else{_0x2983da[_0xc2ec('0xa4')]['id']=_0x5514f4[_0xc2ec('0x7')];}}else{for(var _0x50dfe1=0x0;_0x50dfe1<_0x4f5e93[_0xc2ec('0x91')];_0x50dfe1++){_0x459a94=_[_0xc2ec('0x97')](_0x3e6b77,['name',_0x4f5e93[_0x50dfe1][_0xc2ec('0x16')]]);if(_0x459a94['field']){_0x3090aa={};_0x3090aa[_0x459a94['foreignKey']]=_0x4f5e93[_0x50dfe1][_0xc2ec('0x7')];_0x71e62b[_0xc2ec('0x92')](_0x3090aa);}else{if(!_0x2983da[_0xc2ec('0xa4')]['id'])_0x2983da[_0xc2ec('0xa4')]['id']=[];_0x4f5e93[_0x50dfe1]['associatedResources'][_0xc2ec('0xa8')](function(_0x4a4f23){_0x2983da[_0xc2ec('0xa4')]['id'][_0xc2ec('0x92')](_0x4a4f23);});}}}if(!_[_0xc2ec('0x90')](_0x71e62b)){_0x2983da[_0xc2ec('0xa4')]=_[_0xc2ec('0xa5')](_0x2983da[_0xc2ec('0xa4')],{'$and':{'$or':_0x71e62b}});}_0x2983da=_[_0xc2ec('0xa5')]({},_0x2983da,_0x37d5fb['options']);if(_0x5514f4&&!_0x5514f4[_0xc2ec('0xa9')]&&_0x278bbb['childModel']===_0xc2ec('0xf')){if(_0x37d5fb['query'][_0xc2ec('0xaa')]){_0x2983da[_0xc2ec('0xab')]=[{'all':!![]}];}return _0x2c0fec[_0x278bbb['childModel']][_0xc2ec('0xc')](_0x2983da)['then'](function(_0x5f5186){var _0x1258ea=[];_0x5f5186[_0xc2ec('0xa8')](function(_0x4ffd93){var _0x469755;switch(_0x4ffd93[_0xc2ec('0xac')]){case _0xc2ec('0xad'):_0x469755=_[_0xc2ec('0x97')](_0x5514f4[_0xc2ec('0x7')],function(_0x2b45b1){return _0x2b45b1['id']===_0x4ffd93[_0xc2ec('0xae')]&&_0x2b45b1[_0xc2ec('0x38')]==='DefaultReports';});break;case _0xc2ec('0xaf'):_0x469755=_[_0xc2ec('0x97')](_0x5514f4['associatedResources'],function(_0x516de3){return _0x516de3['id']===_0x4ffd93[_0xc2ec('0xae')]&&_0x516de3[_0xc2ec('0x38')]===_0xc2ec('0xb0');});break;}if(_0x469755)_0x1258ea[_0xc2ec('0x92')](_0x4ffd93);});_0x1f2dc6[_0xc2ec('0xb1')]=_0x1258ea['length'];_0x1f2dc6['rows']=_0x1258ea;return _0x1f2dc6;});}else{if(!_[_0xc2ec('0x90')](_0x37d5fb[_0xc2ec('0x86')]['ids'])){_0x2983da[_0xc2ec('0xa4')]['id']=_0x2983da[_0xc2ec('0xa4')]['id']?_[_0xc2ec('0x9c')](_0x2983da['where']['id'],_0x37d5fb[_0xc2ec('0x86')]['ids']):_0x37d5fb[_0xc2ec('0x86')][_0xc2ec('0xb2')];if(_0x37d5fb['query']['customSorting']){_0x2983da[_0xc2ec('0xa2')]=_0x37d5fb[_0xc2ec('0x86')][_0xc2ec('0xb3')];}}if(_0x37d5fb[_0xc2ec('0x86')][_0xc2ec('0xb4')]){_0x2983da[_0xc2ec('0xa4')]=_[_0xc2ec('0xa5')](_0x2983da[_0xc2ec('0xa4')],{'$and':_0x37d5fb[_0xc2ec('0x86')]['extraQueryConditions']});}return _0x2c0fec[_0x278bbb['childModel']][_0xc2ec('0xb1')]({'where':_0x2983da[_0xc2ec('0xa4')]})[_0xc2ec('0xd')](function(_0x3fff18){_0x1f2dc6[_0xc2ec('0xb1')]=_0x3fff18;if(_0x37d5fb['query'][_0xc2ec('0xaa')]){if(_0x278bbb['childModel']==='CmContact'){_0x2983da['include']=[{'model':_0x2c0fec[_0xc2ec('0x72')],'as':_0xc2ec('0xb5'),'attributes':['id',_0xc2ec('0x16'),'color'],'required':_0x37d5fb[_0xc2ec('0x86')][_0xc2ec('0xb6')]?!![]:![]},{'model':_0x2c0fec['Tag'],'as':_0xc2ec('0xb7'),'attributes':['id',_0xc2ec('0x16'),'color'],'through':_0x37d5fb[_0xc2ec('0x86')][_0xc2ec('0xb6')]?{'attributes':[],'where':{'TagId':_0x37d5fb[_0xc2ec('0x86')][_0xc2ec('0xb6')]||undefined}}:{},'required':_0x37d5fb[_0xc2ec('0x86')]['tag']?!![]:![]}];}else{_0x2983da[_0xc2ec('0xab')]=[{'all':!![]}];}}return _0x2c0fec[_0x278bbb[_0xc2ec('0x12')]][_0xc2ec('0xc')](_0x2983da);})[_0xc2ec('0xd')](function(_0x48bcc5){_0x1f2dc6[_0xc2ec('0xb8')]=_0x48bcc5;if(_0x4f4a55===_0xc2ec('0x5c')&&_0x37d5fb[_0xc2ec('0x86')][_0xc2ec('0xb9')]===_0xc2ec('0xba')){var _0x3d7354=[];for(var _0x463212=0x0;_0x463212<_0x1f2dc6[_0xc2ec('0xb8')][_0xc2ec('0x91')];_0x463212++){_0x3d7354[_0xc2ec('0x92')](_0x2a50e4('chat',_0x1f2dc6['rows'][_0x463212][_0xc2ec('0xbb')]));_0x3d7354[_0xc2ec('0x92')](_0x2a50e4(_0xc2ec('0xbc'),_0x1f2dc6[_0xc2ec('0xb8')][_0x463212]['dataValues']));_0x3d7354['push'](_0x2a50e4(_0xc2ec('0xbd'),_0x1f2dc6[_0xc2ec('0xb8')][_0x463212][_0xc2ec('0xbb')]));_0x3d7354['push'](_0x2a50e4(_0xc2ec('0xbe'),_0x1f2dc6[_0xc2ec('0xb8')][_0x463212][_0xc2ec('0xbb')]));_0x3d7354[_0xc2ec('0x92')](_0x2a50e4(_0xc2ec('0xbf'),_0x1f2dc6['rows'][_0x463212][_0xc2ec('0xbb')]));_0x3d7354[_0xc2ec('0x92')](_0x2a50e4('whatsapp',_0x1f2dc6[_0xc2ec('0xb8')][_0x463212][_0xc2ec('0xbb')]));}return Promise['all'](_0x3d7354)[_0xc2ec('0xd')](function(){return _0x1f2dc6;});}return _0x1f2dc6;});}});}}});}; \ No newline at end of file +var _0xbb21=['Variable','plugins','Plugin','extractedreports','Reports','AnalyticMetric','toUpperCase','slice','Sequelize','QueryTypes','SELECT','select','ui.','InteractionId','from','_interactions','where','ui.UserId\x20=\x20?','query','OpenTabs','UserProfile','user_profiles','../../components/parsers/qs','raw','section','isEmpty','length','push','find','params','all','ignore','union','autoAssociation','rawAttributes','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','offset','order','sort','merge','key','VIRTUAL','foreignKey','forEach','options','reportType','default','DefaultReports','custom','CustomReports','rows','ids','customSorting','extraQueryConditions','count','includeAll','include','Tags','color','ThroughTags','tag','openTabs','true','chat','dataValues','fax','mail','whatsapp','lodash','./userProfile.attributes','squel','exports','filter','field','value','findAll','then','associatedResources','map','model','name','AnalyticExtractedReport','resourceId','catch','toLowerCase','childModel','SquareProject','SquareOdbc','squarerecordings','SquareRecording','SquareProjects','projectName','projects','JscriptyProject','CmContact','parentSections','Lists','ListId','lists','CmList','CmCompany','CmCustomField','chatqueues','chatwebsites','ChatWebsite','faxqueues','FaxQueue','faxaccounts','FaxAccount','inboundroutes','internalroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','voicerecordings','VoiceRecording','Agents','membername','User','agent','role','telephone','VoiceQueues','queue','VoiceQueue','type','QueueCampaigns','outbound','VoiceMusicOnHold','chanspies','VoiceChanSpy','ivrcampaigns','Campaign','mailqueues','MailQueue','mailaccounts','MailAccount','mailsubstatuses','openchannelqueues','OpenchannelQueue','openchannelaccounts','SmsQueue','smsaccounts','SmsAccount','whatsappqueues','WhatsappQueue','teams','voicequeues','queuecampaigns','users','telephones','Users','admin','user','Telephones','zendeskaccounts','ZendeskAccount','freshdeskaccounts','sugarcrmaccounts','DeskAccount','zohoaccounts','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Disposition','customdashboards','Dashboard','intervals','Interval','pauses','scheduler','Schedule','sounds','Sound','tags','Tag','templates','Template','triggers','Trigger','trunks','Trunk','variables'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0xbb21,0x1cb));var _0x1bb2=function(_0x279f58,_0xb27c39){_0x279f58=_0x279f58-0x0;var _0x4eb37c=_0xbb21[_0x279f58];return _0x4eb37c;};'use strict';var _=require(_0x1bb2('0x0'));var attributes=require(_0x1bb2('0x1'));var squel=require(_0x1bb2('0x2'));module[_0x1bb2('0x3')]=function(_0x1dfeec){var _0x270be3=_0x1dfeec['models'];function _0x46a416(_0x587a24,_0xd49714){return new Promise(function(_0x5ec34a,_0x102b20){if(!_0xd49714)return _0x5ec34a(null);var _0x4f18ae=_0xd49714[_0x1bb2('0x4')]?{[_0xd49714[_0x1bb2('0x4')][_0x1bb2('0x5')]]:_0xd49714[_0x1bb2('0x4')][_0x1bb2('0x6')]}:undefined;return _0x270be3[_0x587a24][_0x1bb2('0x7')]({'where':_0x4f18ae,'raw':!![]})[_0x1bb2('0x8')](function(_0x456186){_0xd49714[_0x1bb2('0x9')]=_[_0x1bb2('0xa')](_0x456186,'id');_0x5ec34a(_0xd49714);})['catch'](function(_0x4ebcb6){_0x102b20(_0x4ebcb6);});});}function _0x39f19a(_0x11aacb,_0x40b4a9){return new Promise(function(_0x33cae5,_0x255ef2){var _0x1438a2=_0x11aacb[_0x1bb2('0x4')]?{[_0x11aacb[_0x1bb2('0x4')]['field']]:_0x11aacb[_0x1bb2('0x4')][_0x1bb2('0x6')]}:undefined;return _0x270be3[_0x11aacb[_0x1bb2('0xb')]][_0x1bb2('0x7')]({'where':_0x1438a2,'raw':!![]})[_0x1bb2('0x8')](function(_0x42d0c6){_0x40b4a9[_0x1bb2('0x9')]=_[_0x1bb2('0xa')](_0x42d0c6,function(_0x56dd4b){return _0x56dd4b[_0x1bb2('0xc')];});_0x33cae5(_0x40b4a9);})['catch'](function(_0x288af9){_0x255ef2(_0x288af9);});});}function _0x51b0f9(_0x185ee8,_0x290cfc,_0x254bf4){if(!_0x290cfc)return Promise['resolve'](null);return new Promise(function(_0x550bb9,_0x512640){return _0x270be3['UserProfileResource'][_0x1bb2('0x7')]({'where':{'sectionId':_0x290cfc['id']},'raw':!![]})[_0x1bb2('0x8')](function(_0x55019e){if(_0x185ee8[_0x1bb2('0x5')]&&_0x185ee8['field']!=='id'){_0x290cfc[_0x1bb2('0x9')]=_['map'](_0x55019e,function(_0x46c9b8){return _0x46c9b8[_0x185ee8[_0x1bb2('0x5')]];});}else{if(_0x254bf4===_0x1bb2('0xd')){_0x290cfc[_0x1bb2('0x9')]=_[_0x1bb2('0xa')](_0x55019e,function(_0xeecab2){return{'id':_0xeecab2[_0x1bb2('0xe')],'type':_0xeecab2['type']};});}else{_0x290cfc[_0x1bb2('0x9')]=_[_0x1bb2('0xa')](_0x55019e,function(_0x414e64){return _0x414e64[_0x1bb2('0xe')];});}}_0x550bb9(_0x290cfc);})[_0x1bb2('0xf')](function(_0x2bbfc9){_0x512640(_0x2bbfc9);});});}function _0x55e41f(_0x328600,_0x191b6c){var _0x191b6a={'parentSections':[]};switch(_0x328600[_0x1bb2('0x10')]()){case'squareprojects':_0x191b6a[_0x1bb2('0x11')]=_0x1bb2('0x12');break;case'odbc':_0x191b6a[_0x1bb2('0x11')]=_0x1bb2('0x13');break;case _0x1bb2('0x14'):_0x191b6a[_0x1bb2('0x11')]=_0x1bb2('0x15');_0x191b6a['parentSections']=[{'name':_0x1bb2('0x16'),'field':_0x1bb2('0xc'),'foreignKey':_0x1bb2('0x17')}];break;case _0x1bb2('0x18'):_0x191b6a[_0x1bb2('0x11')]=_0x1bb2('0x19');break;case'contacts':_0x191b6a['childModel']=_0x1bb2('0x1a');_0x191b6a[_0x1bb2('0x1b')]=[{'name':_0x1bb2('0x1c'),'field':'id','foreignKey':_0x1bb2('0x1d')}];break;case _0x1bb2('0x1e'):_0x191b6a['childModel']=_0x1bb2('0x1f');break;case'companies':_0x191b6a[_0x1bb2('0x11')]=_0x1bb2('0x20');break;case'globalcustomfields':_0x191b6a[_0x1bb2('0x11')]=_0x1bb2('0x21');break;case _0x1bb2('0x22'):_0x191b6a['childModel']='ChatQueue';break;case _0x1bb2('0x23'):_0x191b6a['childModel']=_0x1bb2('0x24');break;case _0x1bb2('0x25'):_0x191b6a[_0x1bb2('0x11')]=_0x1bb2('0x26');break;case _0x1bb2('0x27'):_0x191b6a[_0x1bb2('0x11')]=_0x1bb2('0x28');break;case _0x1bb2('0x29'):case _0x1bb2('0x2a'):case _0x1bb2('0x2b'):_0x191b6a['childModel']=_0x1bb2('0x2c');break;case _0x1bb2('0x2d'):_0x191b6a['childModel']=_0x1bb2('0x2e');break;case'voicemails':_0x191b6a[_0x1bb2('0x11')]='VoiceMail';break;case _0x1bb2('0x2f'):_0x191b6a[_0x1bb2('0x11')]=_0x1bb2('0x30');_0x191b6a['parentSections']=[{'name':_0x1bb2('0x31'),'field':_0x1bb2('0xc'),'foreignKey':_0x1bb2('0x32'),'model':_0x1bb2('0x33'),'filter':{'field':'role','value':[_0x1bb2('0x34')]}},{'name':'Telephones','field':'name','foreignKey':_0x1bb2('0x32'),'model':_0x1bb2('0x33'),'filter':{'field':_0x1bb2('0x35'),'value':[_0x1bb2('0x36')]}},{'name':_0x1bb2('0x37'),'field':_0x1bb2('0xc'),'foreignKey':_0x1bb2('0x38'),'model':_0x1bb2('0x39'),'filter':{'field':_0x1bb2('0x3a'),'value':['inbound']}},{'name':_0x1bb2('0x3b'),'field':_0x1bb2('0xc'),'foreignKey':_0x1bb2('0x38'),'model':_0x1bb2('0x39'),'filter':{'field':_0x1bb2('0x3a'),'value':[_0x1bb2('0x3c')]}}];break;case'musiconholds':_0x191b6a['childModel']=_0x1bb2('0x3d');break;case _0x1bb2('0x3e'):_0x191b6a['childModel']=_0x1bb2('0x3f');break;case'voiceprefixes':_0x191b6a['childModel']='VoicePrefix';break;case _0x1bb2('0x40'):_0x191b6a['childModel']=_0x1bb2('0x41');break;case _0x1bb2('0x42'):_0x191b6a[_0x1bb2('0x11')]=_0x1bb2('0x43');break;case _0x1bb2('0x44'):_0x191b6a[_0x1bb2('0x11')]=_0x1bb2('0x45');break;case _0x1bb2('0x46'):_0x191b6a[_0x1bb2('0x11')]='MailSubstatus';break;case _0x1bb2('0x47'):_0x191b6a[_0x1bb2('0x11')]=_0x1bb2('0x48');break;case _0x1bb2('0x49'):_0x191b6a['childModel']='OpenchannelAccount';break;case'smsqueues':_0x191b6a[_0x1bb2('0x11')]=_0x1bb2('0x4a');break;case _0x1bb2('0x4b'):_0x191b6a['childModel']=_0x1bb2('0x4c');break;case _0x1bb2('0x4d'):_0x191b6a[_0x1bb2('0x11')]=_0x1bb2('0x4e');break;case'whatsappaccounts':_0x191b6a[_0x1bb2('0x11')]='WhatsappAccount';break;case _0x1bb2('0x4f'):_0x191b6a[_0x1bb2('0x11')]='Team';break;case _0x1bb2('0x50'):case _0x1bb2('0x51'):_0x191b6a[_0x1bb2('0x11')]=_0x1bb2('0x39');if(_0x191b6c){_0x191b6a[_0x1bb2('0x1b')]=[{'name':_0x1bb2('0x37')},{'name':_0x1bb2('0x3b')}];}break;case _0x1bb2('0x52'):case'agents':case _0x1bb2('0x53'):_0x191b6a[_0x1bb2('0x11')]='User';if(_0x191b6c){_0x191b6a[_0x1bb2('0x1b')]=[{'name':_0x1bb2('0x54'),'filter':{'field':_0x1bb2('0x35'),'value':[_0x1bb2('0x55'),_0x1bb2('0x56')]},'ignore':!![]},{'name':'Agents'},{'name':_0x1bb2('0x57')}];}break;case _0x1bb2('0x58'):_0x191b6a[_0x1bb2('0x11')]=_0x1bb2('0x59');break;case'salesforceaccounts':_0x191b6a[_0x1bb2('0x11')]='SalesforceAccount';break;case _0x1bb2('0x5a'):_0x191b6a[_0x1bb2('0x11')]='FreshdeskAccount';break;case _0x1bb2('0x5b'):_0x191b6a[_0x1bb2('0x11')]='SugarcrmAccount';break;case'deskaccounts':_0x191b6a[_0x1bb2('0x11')]=_0x1bb2('0x5c');break;case _0x1bb2('0x5d'):_0x191b6a[_0x1bb2('0x11')]='ZohoAccount';break;case _0x1bb2('0x5e'):_0x191b6a['childModel']=_0x1bb2('0x33');break;case _0x1bb2('0x5f'):_0x191b6a['childModel']=_0x1bb2('0x60');break;case _0x1bb2('0x61'):_0x191b6a[_0x1bb2('0x11')]=_0x1bb2('0x62');break;case _0x1bb2('0x63'):_0x191b6a[_0x1bb2('0x11')]=_0x1bb2('0x64');break;case _0x1bb2('0x65'):_0x191b6a[_0x1bb2('0x11')]=_0x1bb2('0x66');break;case _0x1bb2('0x67'):_0x191b6a['childModel']='Pause';break;case _0x1bb2('0x68'):_0x191b6a[_0x1bb2('0x11')]=_0x1bb2('0x69');break;case _0x1bb2('0x6a'):_0x191b6a['childModel']=_0x1bb2('0x6b');break;case _0x1bb2('0x6c'):_0x191b6a[_0x1bb2('0x11')]=_0x1bb2('0x6d');break;case _0x1bb2('0x6e'):_0x191b6a[_0x1bb2('0x11')]=_0x1bb2('0x6f');break;case _0x1bb2('0x70'):_0x191b6a['childModel']=_0x1bb2('0x71');break;case _0x1bb2('0x72'):_0x191b6a['childModel']=_0x1bb2('0x73');break;case _0x1bb2('0x74'):_0x191b6a[_0x1bb2('0x11')]=_0x1bb2('0x75');break;case _0x1bb2('0x76'):_0x191b6a[_0x1bb2('0x11')]=_0x1bb2('0x77');break;case _0x1bb2('0x78'):_0x191b6a['childModel']='AnalyticExtractedReport';_0x191b6a['parentSections']=[{'name':_0x1bb2('0x79'),'field':'id','foreignKey':'reportId'}];break;case'metrics':_0x191b6a[_0x1bb2('0x11')]=_0x1bb2('0x7a');break;}return _0x191b6a;}function _0x4c6afd(_0x4d073b,_0x3ebbfc){var _0x9cf70c=_0x4d073b['charAt'](0x0)[_0x1bb2('0x7b')]()+_0x4d073b[_0x1bb2('0x7c')](0x1);var _0x29ea18={'type':_0x270be3[_0x1bb2('0x7d')][_0x1bb2('0x7e')][_0x1bb2('0x7f')],'raw':!![]};return new Promise(function(_0x1e500e,_0x1c96f1){var _0x332dc4=squel[_0x1bb2('0x80')]()[_0x1bb2('0x5')](_0x1bb2('0x81')+_0x9cf70c+_0x1bb2('0x82'),'id')[_0x1bb2('0x5')]('ui.createdAt')[_0x1bb2('0x83')]('user_has_'+_0x4d073b+_0x1bb2('0x84'),'ui')[_0x1bb2('0x85')](_0x1bb2('0x86'),_0x3ebbfc['id']);return _0x270be3['sequelize'][_0x1bb2('0x87')](_0x332dc4['toString'](),_0x29ea18)[_0x1bb2('0x8')](function(_0x574977){_0x3ebbfc[_0x9cf70c+_0x1bb2('0x88')]=_0x574977;_0x1e500e(_0x574977);})[_0x1bb2('0xf')](function(_0x1dfae7){_0x1c96f1(_0x1dfae7);});});}return _0x1dfeec['define'](_0x1bb2('0x89'),attributes,{'tableName':_0x1bb2('0x8a'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x220bd1){var _0x2a0e65=require(_0x1bb2('0x8b'));var _0xc9cb51={'raw':_0x220bd1['query'][_0x1bb2('0x8c')],'where':{}};var _0x244f94={};var _0x24ec13={'count':0x0,'rows':[]};var _0x4d1bc3=_0x220bd1[_0x1bb2('0x87')][_0x1bb2('0x8d')];var _0x3daac9=_0x220bd1[_0x1bb2('0x87')]['mergeResources']||![];var _0x1e62ed=_0x55e41f(_0x4d1bc3,_0x3daac9);if(!_0x1e62ed[_0x1bb2('0x11')])throw new Error('Invalid\x20section\x20\x27'+_0x4d1bc3+'\x27');var _0x58b301=[{'name':_0x4d1bc3}];if(!_[_0x1bb2('0x8e')](_0x1e62ed[_0x1bb2('0x1b')]))_0x58b301=_0x1e62ed[_0x1bb2('0x1b')];var _0x5207ee=[];for(var _0x130837=0x0;_0x130837<_0x58b301[_0x1bb2('0x8f')];_0x130837++){_0x5207ee[_0x1bb2('0x90')](_0x270be3['UserProfileSection'][_0x1bb2('0x91')]({'where':{'userProfileId':_0x220bd1[_0x1bb2('0x92')]['id'],'name':_0x58b301[_0x130837][_0x1bb2('0xc')]},'raw':!![]}));}return Promise[_0x1bb2('0x93')](_0x5207ee)[_0x1bb2('0x8')](function(_0x11c616){var _0x118126=_[_0x1bb2('0x4')](_0x11c616,function(_0x20e775){return _0x20e775?_0x20e775:undefined;});var _0x2586fe=_[_0x1bb2('0x4')](_0x58b301,[_0x1bb2('0x94'),!![]]);var _0x1c3d09=_[_0x1bb2('0x8e')](_0x118126)&&_[_0x1bb2('0x8e')](_0x2586fe)?null:_[_0x1bb2('0x95')](_0x2586fe,_0x118126);if(!_0x1c3d09)return null;var _0x489128=[];for(var _0x3d43d0=0x0;_0x3d43d0<_0x1c3d09['length'];_0x3d43d0++){var _0x398cf3=_[_0x1bb2('0x91')](_0x58b301,function(_0x2e1a04){return _0x1c3d09[_0x3d43d0]?_0x2e1a04[_0x1bb2('0xc')]===_0x1c3d09[_0x3d43d0][_0x1bb2('0xc')]:null;});if(_0x398cf3){if(_0x1c3d09[_0x3d43d0][_0x1bb2('0x94')]){_0x489128[_0x1bb2('0x90')](_0x46a416(_0x1e62ed[_0x1bb2('0x11')],_0x1c3d09[_0x3d43d0]));}else{if(!_0x1c3d09[_0x3d43d0][_0x1bb2('0x96')]){_0x489128[_0x1bb2('0x90')](_0x51b0f9(_0x398cf3,_0x1c3d09[_0x3d43d0],_0x1e62ed['childModel']));}else{if(_0x398cf3[_0x1bb2('0xb')]){_0x489128[_0x1bb2('0x90')](_0x39f19a(_0x398cf3,_0x1c3d09[_0x3d43d0]));}}}}}return Promise[_0x1bb2('0x93')](_0x489128);})['then'](function(_0x1a4a64){var _0x3084ad=_0x1a4a64;var _0x3fca5b=null;if(_0x3084ad){_0x3fca5b=_0x3084ad[_0x1bb2('0x8f')]===0x1?_0x3084ad[0x0]:null;}if(!_0x3fca5b&&!_0x3084ad)return _0x24ec13;var _0x3924c8=_0x270be3[_0x1e62ed[_0x1bb2('0x11')]][_0x1bb2('0x97')];_0x244f94[_0x1bb2('0xb')]=_[_0x1bb2('0x98')](_0x3924c8);_0x244f94[_0x1bb2('0x87')]=_[_0x1bb2('0x98')](_0x220bd1[_0x1bb2('0x87')]);_0x244f94[_0x1bb2('0x99')]=_[_0x1bb2('0x9a')](_0x244f94[_0x1bb2('0xb')],_0x244f94[_0x1bb2('0x87')]);_0xc9cb51['attributes']=_['intersection'](_0x244f94[_0x1bb2('0xb')],_0x2a0e65[_0x1bb2('0x9b')](_0x220bd1[_0x1bb2('0x87')][_0x1bb2('0x9b')]));_0xc9cb51[_0x1bb2('0x9c')]=_0xc9cb51['attributes'][_0x1bb2('0x8f')]?_0xc9cb51[_0x1bb2('0x9c')]:_0x244f94[_0x1bb2('0xb')];if(!_0x220bd1['query'][_0x1bb2('0x9d')](_0x1bb2('0x9e'))){_0xc9cb51[_0x1bb2('0x9f')]=_0x2a0e65[_0x1bb2('0x9f')](_0x220bd1[_0x1bb2('0x87')]['limit']);_0xc9cb51[_0x1bb2('0xa0')]=_0x2a0e65[_0x1bb2('0xa0')](_0x220bd1[_0x1bb2('0x87')][_0x1bb2('0xa0')]);}_0xc9cb51[_0x1bb2('0xa1')]=_0x2a0e65[_0x1bb2('0xa2')](_0x220bd1[_0x1bb2('0x87')][_0x1bb2('0xa2')]);_0xc9cb51[_0x1bb2('0x85')]=_0x2a0e65[_0x1bb2('0x99')](_['pick'](_0x220bd1['query'],_0x244f94[_0x1bb2('0x99')]));if(_0x220bd1[_0x1bb2('0x87')][_0x1bb2('0x4')]){_0xc9cb51[_0x1bb2('0x85')]=_[_0x1bb2('0xa3')](_0xc9cb51['where'],{'$or':_['map'](_0x3924c8,function(_0x1212e4){if(_0x1212e4[_0x1bb2('0x3a')][_0x1bb2('0xa4')]!==_0x1bb2('0xa5')){var _0x140274={};_0x140274[_0x1212e4[_0x1bb2('0x5')]]={'$like':'%'+_0x220bd1['query'][_0x1bb2('0x4')]+'%'};return _0x140274;}})});}var _0x18d53b=[];var _0x423400=null;var _0x3647aa={};if(_0x3fca5b){_0x423400=_['find'](_0x58b301,[_0x1bb2('0xc'),_0x3fca5b[_0x1bb2('0xc')]]);if(_0x423400['field']){_0x3647aa={};if(_0x1e62ed['childModel']===_0x1bb2('0xd')){_0x3647aa[_0x423400[_0x1bb2('0xa6')]]=_[_0x1bb2('0xa')](_0x3fca5b['associatedResources'],'id');}else{_0x3647aa[_0x423400['foreignKey']]=_0x3fca5b[_0x1bb2('0x9')];}_0x18d53b[_0x1bb2('0x90')](_0x3647aa);}else{_0xc9cb51[_0x1bb2('0x85')]['id']=_0x3fca5b[_0x1bb2('0x9')];}}else{for(var _0x124d26=0x0;_0x124d26<_0x3084ad[_0x1bb2('0x8f')];_0x124d26++){_0x423400=_['find'](_0x58b301,[_0x1bb2('0xc'),_0x3084ad[_0x124d26][_0x1bb2('0xc')]]);if(_0x423400[_0x1bb2('0x5')]){_0x3647aa={};_0x3647aa[_0x423400[_0x1bb2('0xa6')]]=_0x3084ad[_0x124d26][_0x1bb2('0x9')];_0x18d53b['push'](_0x3647aa);}else{if(!_0xc9cb51[_0x1bb2('0x85')]['id'])_0xc9cb51[_0x1bb2('0x85')]['id']=[];_0x3084ad[_0x124d26]['associatedResources'][_0x1bb2('0xa7')](function(_0x2724da){_0xc9cb51[_0x1bb2('0x85')]['id']['push'](_0x2724da);});}}}if(!_[_0x1bb2('0x8e')](_0x18d53b)){_0xc9cb51[_0x1bb2('0x85')]=_[_0x1bb2('0xa3')](_0xc9cb51[_0x1bb2('0x85')],{'$and':{'$or':_0x18d53b}});}_0xc9cb51=_['merge']({},_0xc9cb51,_0x220bd1[_0x1bb2('0xa8')]);if(_0x3fca5b&&!_0x3fca5b[_0x1bb2('0x96')]&&_0x1e62ed['childModel']===_0x1bb2('0xd')){if(_0x220bd1[_0x1bb2('0x87')]['includeAll']){_0xc9cb51['include']=[{'all':!![]}];}return _0x270be3[_0x1e62ed['childModel']]['findAll'](_0xc9cb51)[_0x1bb2('0x8')](function(_0x19758d){var _0x25a448=[];_0x19758d[_0x1bb2('0xa7')](function(_0x245219){var _0x484bd6;switch(_0x245219[_0x1bb2('0xa9')]){case _0x1bb2('0xaa'):_0x484bd6=_[_0x1bb2('0x91')](_0x3fca5b['associatedResources'],function(_0x50ff7b){return _0x50ff7b['id']===_0x245219['reportId']&&_0x50ff7b[_0x1bb2('0x3a')]===_0x1bb2('0xab');});break;case _0x1bb2('0xac'):_0x484bd6=_[_0x1bb2('0x91')](_0x3fca5b[_0x1bb2('0x9')],function(_0x2a9729){return _0x2a9729['id']===_0x245219['reportId']&&_0x2a9729[_0x1bb2('0x3a')]===_0x1bb2('0xad');});break;}if(_0x484bd6)_0x25a448[_0x1bb2('0x90')](_0x245219);});_0x24ec13['count']=_0x25a448[_0x1bb2('0x8f')];_0x24ec13[_0x1bb2('0xae')]=_0x25a448;return _0x24ec13;});}else{if(!_[_0x1bb2('0x8e')](_0x220bd1['query'][_0x1bb2('0xaf')])){_0xc9cb51[_0x1bb2('0x85')]['id']=_0xc9cb51['where']['id']?_[_0x1bb2('0x9a')](_0xc9cb51[_0x1bb2('0x85')]['id'],_0x220bd1[_0x1bb2('0x87')][_0x1bb2('0xaf')]):_0x220bd1[_0x1bb2('0x87')][_0x1bb2('0xaf')];if(_0x220bd1['query'][_0x1bb2('0xb0')]){_0xc9cb51['order']=_0x220bd1[_0x1bb2('0x87')][_0x1bb2('0xb0')];}}if(_0x220bd1['query'][_0x1bb2('0xb1')]){_0xc9cb51[_0x1bb2('0x85')]=_['merge'](_0xc9cb51['where'],{'$and':_0x220bd1[_0x1bb2('0x87')][_0x1bb2('0xb1')]});}return _0x270be3[_0x1e62ed['childModel']][_0x1bb2('0xb2')]({'where':_0xc9cb51[_0x1bb2('0x85')]})[_0x1bb2('0x8')](function(_0xb733bc){_0x24ec13[_0x1bb2('0xb2')]=_0xb733bc;if(_0x220bd1['query'][_0x1bb2('0xb3')]){if(_0x1e62ed[_0x1bb2('0x11')]==='CmContact'){_0xc9cb51[_0x1bb2('0xb4')]=[{'model':_0x270be3[_0x1bb2('0x6d')],'as':_0x1bb2('0xb5'),'attributes':['id','name',_0x1bb2('0xb6')],'required':_0x220bd1['query']['tag']?!![]:![]},{'model':_0x270be3['Tag'],'as':_0x1bb2('0xb7'),'attributes':['id','name','color'],'through':_0x220bd1[_0x1bb2('0x87')][_0x1bb2('0xb8')]?{'attributes':[],'where':{'TagId':_0x220bd1[_0x1bb2('0x87')][_0x1bb2('0xb8')]||undefined}}:{},'required':_0x220bd1['query']['tag']?!![]:![]}];}else{_0xc9cb51[_0x1bb2('0xb4')]=[{'all':!![]}];}}return _0x270be3[_0x1e62ed[_0x1bb2('0x11')]][_0x1bb2('0x7')](_0xc9cb51);})[_0x1bb2('0x8')](function(_0x2808ac){_0x24ec13['rows']=_0x2808ac;if(_0x4d1bc3===_0x1bb2('0x31')&&_0x220bd1[_0x1bb2('0x87')][_0x1bb2('0xb9')]===_0x1bb2('0xba')){var _0x12817c=[];for(var _0x28d834=0x0;_0x28d834<_0x24ec13[_0x1bb2('0xae')][_0x1bb2('0x8f')];_0x28d834++){_0x12817c[_0x1bb2('0x90')](_0x4c6afd(_0x1bb2('0xbb'),_0x24ec13['rows'][_0x28d834][_0x1bb2('0xbc')]));_0x12817c[_0x1bb2('0x90')](_0x4c6afd('sms',_0x24ec13[_0x1bb2('0xae')][_0x28d834]['dataValues']));_0x12817c[_0x1bb2('0x90')](_0x4c6afd(_0x1bb2('0xbd'),_0x24ec13['rows'][_0x28d834][_0x1bb2('0xbc')]));_0x12817c[_0x1bb2('0x90')](_0x4c6afd(_0x1bb2('0xbe'),_0x24ec13['rows'][_0x28d834][_0x1bb2('0xbc')]));_0x12817c[_0x1bb2('0x90')](_0x4c6afd('openchannel',_0x24ec13[_0x1bb2('0xae')][_0x28d834][_0x1bb2('0xbc')]));_0x12817c['push'](_0x4c6afd(_0x1bb2('0xbf'),_0x24ec13[_0x1bb2('0xae')][_0x28d834][_0x1bb2('0xbc')]));}return Promise[_0x1bb2('0x93')](_0x12817c)['then'](function(){return _0x24ec13;});}return _0x24ec13;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index 8872ceb..6b3a6b8 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 _0xa899=['error','message','UserProfile,\x20%s,\x20%s','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','./userProfile.socket','request','then','info','debug','UserProfile,\x20%s,\x20%s,\x20%s','request\x20sent','code'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0xa899,0x155));var _0x9a89=function(_0x225f50,_0x48a77d){_0x225f50=_0x225f50-0x0;var _0x19d003=_0xa899[_0x225f50];return _0x19d003;};'use strict';var _=require(_0x9a89('0x0'));var util=require(_0x9a89('0x1'));var moment=require(_0x9a89('0x2'));var BPromise=require('bluebird');var rs=require(_0x9a89('0x3'));var fs=require('fs');var Redis=require(_0x9a89('0x4'));var db=require(_0x9a89('0x5'))['db'];var utils=require(_0x9a89('0x6'));var logger=require(_0x9a89('0x7'))(_0x9a89('0x8'));var config=require(_0x9a89('0x9'));var jayson=require(_0x9a89('0xa'));var client=jayson[_0x9a89('0xb')][_0x9a89('0xc')]({'port':0x232a});config[_0x9a89('0xd')]=_[_0x9a89('0xe')](config[_0x9a89('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9a89('0xd')]));require(_0x9a89('0xf'))['register'](socket);function respondWithRpcPromise(_0xccf078,_0x4f487d,_0x111d99){return new BPromise(function(_0x2a9e30,_0x401680){return client[_0x9a89('0x10')](_0xccf078,_0x111d99)[_0x9a89('0x11')](function(_0xc61526){logger[_0x9a89('0x12')]('UserProfile,\x20%s,\x20%s',_0x4f487d,'request\x20sent');logger[_0x9a89('0x13')](_0x9a89('0x14'),_0x4f487d,_0x9a89('0x15'),JSON['stringify'](_0xc61526));if(_0xc61526['error']){if(_0xc61526['error'][_0x9a89('0x16')]===0x1f4){logger[_0x9a89('0x17')]('UserProfile,\x20%s,\x20%s',_0x4f487d,_0xc61526[_0x9a89('0x17')][_0x9a89('0x18')]);return _0x401680(_0xc61526[_0x9a89('0x17')][_0x9a89('0x18')]);}logger['error'](_0x9a89('0x19'),_0x4f487d,_0xc61526[_0x9a89('0x17')]['message']);return _0x2a9e30(_0xc61526['error'][_0x9a89('0x18')]);}else{logger['info'](_0x9a89('0x19'),_0x4f487d,_0x9a89('0x15'));_0x2a9e30(_0xc61526['result'][_0x9a89('0x18')]);}})['catch'](function(_0x2d648f){logger[_0x9a89('0x17')]('UserProfile,\x20%s,\x20%s',_0x4f487d,_0x2d648f);_0x401680(_0x2d648f);});});} \ No newline at end of file +var _0x3b74=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request','info','UserProfile,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','lodash','util'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0x3b74,0x80));var _0x43b7=function(_0x923452,_0x1540ca){_0x923452=_0x923452-0x0;var _0x66a740=_0x3b74[_0x923452];return _0x66a740;};'use strict';var _=require(_0x43b7('0x0'));var util=require(_0x43b7('0x1'));var moment=require(_0x43b7('0x2'));var BPromise=require(_0x43b7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x43b7('0x4'));var db=require(_0x43b7('0x5'))['db'];var utils=require(_0x43b7('0x6'));var logger=require(_0x43b7('0x7'))('rpc');var config=require(_0x43b7('0x8'));var jayson=require(_0x43b7('0x9'));var client=jayson[_0x43b7('0xa')][_0x43b7('0xb')]({'port':0x232a});config[_0x43b7('0xc')]=_[_0x43b7('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x43b7('0xe'))(new Redis(config[_0x43b7('0xc')]));require('./userProfile.socket')[_0x43b7('0xf')](socket);function respondWithRpcPromise(_0xfd03bc,_0x55ce4a,_0x446822){return new BPromise(function(_0x49bf6e,_0x446913){return client[_0x43b7('0x10')](_0xfd03bc,_0x446822)['then'](function(_0x536a25){logger[_0x43b7('0x11')](_0x43b7('0x12'),_0x55ce4a,'request\x20sent');logger[_0x43b7('0x13')]('UserProfile,\x20%s,\x20%s,\x20%s',_0x55ce4a,_0x43b7('0x14'),JSON[_0x43b7('0x15')](_0x536a25));if(_0x536a25[_0x43b7('0x16')]){if(_0x536a25['error'][_0x43b7('0x17')]===0x1f4){logger[_0x43b7('0x16')](_0x43b7('0x12'),_0x55ce4a,_0x536a25[_0x43b7('0x16')][_0x43b7('0x18')]);return _0x446913(_0x536a25[_0x43b7('0x16')][_0x43b7('0x18')]);}logger[_0x43b7('0x16')]('UserProfile,\x20%s,\x20%s',_0x55ce4a,_0x536a25[_0x43b7('0x16')]['message']);return _0x49bf6e(_0x536a25[_0x43b7('0x16')][_0x43b7('0x18')]);}else{logger['info'](_0x43b7('0x12'),_0x55ce4a,_0x43b7('0x14'));_0x49bf6e(_0x536a25[_0x43b7('0x19')][_0x43b7('0x18')]);}})['catch'](function(_0x1c7385){logger[_0x43b7('0x16')](_0x43b7('0x12'),_0x55ce4a,_0x1c7385);_0x446913(_0x1c7385);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 50b071b..fa6d30f 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 _0x8e85=['userProfile:','./userProfile.events','save','remove','update','emit','removeListener','register','length'];(function(_0x44799d,_0x26c23a){var _0x4f4a20=function(_0x298a71){while(--_0x298a71){_0x44799d['push'](_0x44799d['shift']());}};_0x4f4a20(++_0x26c23a);}(_0x8e85,0x7f));var _0x58e8=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x8e85[_0x5ddb1c];return _0x354adc;};'use strict';var UserProfileEvents=require(_0x58e8('0x0'));var events=[_0x58e8('0x1'),_0x58e8('0x2'),_0x58e8('0x3')];function createListener(_0x1b6ccb,_0x13dffd){return function(_0x5bf68b){_0x13dffd[_0x58e8('0x4')](_0x1b6ccb,_0x5bf68b);};}function removeListener(_0x2e7026,_0x26c829){return function(){UserProfileEvents[_0x58e8('0x5')](_0x2e7026,_0x26c829);};}exports[_0x58e8('0x6')]=function(_0x33a4f1){for(var _0x598bf1=0x0,_0x1954a6=events[_0x58e8('0x7')];_0x598bf1<_0x1954a6;_0x598bf1++){var _0x4404cf=events[_0x598bf1];var _0xdeeb9d=createListener(_0x58e8('0x8')+_0x4404cf,_0x33a4f1);UserProfileEvents['on'](_0x4404cf,_0xdeeb9d);}}; \ No newline at end of file +var _0xc3c2=['remove','update','length','userProfile:','save'];(function(_0x27da9d,_0x39293a){var _0x21a7ab=function(_0xd243a1){while(--_0xd243a1){_0x27da9d['push'](_0x27da9d['shift']());}};_0x21a7ab(++_0x39293a);}(_0xc3c2,0x13f));var _0x2c3c=function(_0xa419b1,_0x263eb6){_0xa419b1=_0xa419b1-0x0;var _0x4b9756=_0xc3c2[_0xa419b1];return _0x4b9756;};'use strict';var UserProfileEvents=require('./userProfile.events');var events=[_0x2c3c('0x0'),_0x2c3c('0x1'),_0x2c3c('0x2')];function createListener(_0x31774d,_0x5d8cbe){return function(_0x355ab3){_0x5d8cbe['emit'](_0x31774d,_0x355ab3);};}function removeListener(_0x529f68,_0x1120e3){return function(){UserProfileEvents['removeListener'](_0x529f68,_0x1120e3);};}exports['register']=function(_0xdc4aaa){for(var _0xbae52=0x0,_0x342630=events[_0x2c3c('0x3')];_0xbae52<_0x342630;_0xbae52++){var _0x428e58=events[_0xbae52];var _0x25f2b8=createListener(_0x2c3c('0x4')+_0x428e58,_0xdc4aaa);UserProfileEvents['on'](_0x428e58,_0x25f2b8);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 0781422..0c57b9a 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 _0x539e=['Router','fs-extra','../../components/auth/service','../../config/environment','./userProfileResource.controller','get','isAuthenticated','describe','/:id','show','post','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x107fd4,_0x2748ff){var _0x46490e=function(_0x10b832){while(--_0x10b832){_0x107fd4['push'](_0x107fd4['shift']());}};_0x46490e(++_0x2748ff);}(_0x539e,0x127));var _0xe539=function(_0x3362aa,_0x42eb98){_0x3362aa=_0x3362aa-0x0;var _0x4cc91b=_0x539e[_0x3362aa];return _0x4cc91b;};'use strict';var multer=require(_0xe539('0x0'));var util=require(_0xe539('0x1'));var path=require(_0xe539('0x2'));var timeout=require(_0xe539('0x3'));var express=require(_0xe539('0x4'));var router=express[_0xe539('0x5')]();var fs_extra=require(_0xe539('0x6'));var auth=require(_0xe539('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xe539('0x8'));var controller=require(_0xe539('0x9'));router[_0xe539('0xa')]('/',auth[_0xe539('0xb')](),controller['index']);router[_0xe539('0xa')]('/describe',auth['isAuthenticated'](),controller[_0xe539('0xc')]);router[_0xe539('0xa')](_0xe539('0xd'),auth['isAuthenticated'](),controller[_0xe539('0xe')]);router[_0xe539('0xf')]('/',auth[_0xe539('0xb')](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0xe539('0x10')]);router[_0xe539('0x11')](_0xe539('0xd'),auth[_0xe539('0xb')](),controller[_0xe539('0x12')]);module[_0xe539('0x13')]=router; \ No newline at end of file +var _0x12b1=['put','update','/:id','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','post','create'];(function(_0x404dc8,_0x3245a5){var _0x4b1a99=function(_0x11e6a1){while(--_0x11e6a1){_0x404dc8['push'](_0x404dc8['shift']());}};_0x4b1a99(++_0x3245a5);}(_0x12b1,0x90));var _0x112b=function(_0x4cd226,_0x489a22){_0x4cd226=_0x4cd226-0x0;var _0x19c008=_0x12b1[_0x4cd226];return _0x19c008;};'use strict';var multer=require(_0x112b('0x0'));var util=require(_0x112b('0x1'));var path=require(_0x112b('0x2'));var timeout=require(_0x112b('0x3'));var express=require('express');var router=express[_0x112b('0x4')]();var fs_extra=require(_0x112b('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x112b('0x6'));var config=require(_0x112b('0x7'));var controller=require('./userProfileResource.controller');router[_0x112b('0x8')]('/',auth[_0x112b('0x9')](),controller[_0x112b('0xa')]);router[_0x112b('0x8')](_0x112b('0xb'),auth[_0x112b('0x9')](),controller[_0x112b('0xc')]);router[_0x112b('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x112b('0xd')]);router[_0x112b('0xe')]('/',auth['isAuthenticated'](),controller[_0x112b('0xf')]);router[_0x112b('0x10')]('/:id',auth[_0x112b('0x9')](),controller[_0x112b('0x11')]);router['delete'](_0x112b('0x12'),auth[_0x112b('0x9')](),controller['destroy']);module[_0x112b('0x13')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index 5927917..100c5d5 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 _0x22f0=['INTEGER','STRING'];(function(_0x246193,_0x384bed){var _0x4cf25c=function(_0x535b33){while(--_0x535b33){_0x246193['push'](_0x246193['shift']());}};_0x4cf25c(++_0x384bed);}(_0x22f0,0x187));var _0x022f=function(_0x188a50,_0x593551){_0x188a50=_0x188a50-0x0;var _0x10942c=_0x22f0[_0x188a50];return _0x10942c;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x022f('0x0')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x022f('0x1')],'allowNull':![]},'type':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x73f3=['STRING','INTEGER','sequelize','exports'];(function(_0x70e004,_0x47aaf2){var _0x2a034b=function(_0x120667){while(--_0x120667){_0x70e004['push'](_0x70e004['shift']());}};_0x2a034b(++_0x47aaf2);}(_0x73f3,0x66));var _0x373f=function(_0x234c23,_0x2b89f1){_0x234c23=_0x234c23-0x0;var _0x515db7=_0x73f3[_0x234c23];return _0x515db7;};'use strict';var Sequelize=require(_0x373f('0x0'));module[_0x373f('0x1')]={'name':{'type':Sequelize[_0x373f('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x373f('0x3')],'allowNull':![]},'type':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index 2a4218d..a72d5f7 100644 --- a/server/api/userProfileResource/userProfileResource.controller.js +++ b/server/api/userProfileResource/userProfileResource.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1261=['end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','error','stack','send','UserProfileResource','model','map','name','keys','query','intersection','attributes','fields','length','hasOwnProperty','sort','pick','filters','where','type','VIRTUAL','filter','merge','options','findAll','rows','params','include','find','create','catch','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0xcb72ce,_0x2c9f20){var _0x20bde1=function(_0x1d730b){while(--_0x1d730b){_0xcb72ce['push'](_0xcb72ce['shift']());}};_0x20bde1(++_0x2c9f20);}(_0x1261,0x144));var _0x1126=function(_0x4702ee,_0xaf6a45){_0x4702ee=_0x4702ee-0x0;var _0x62ca7d=_0x1261[_0x4702ee];return _0x62ca7d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1126('0x0'));var zipdir=require(_0x1126('0x1'));var jsonpatch=require(_0x1126('0x2'));var rp=require(_0x1126('0x3'));var moment=require(_0x1126('0x4'));var BPromise=require(_0x1126('0x5'));var Mustache=require(_0x1126('0x6'));var util=require(_0x1126('0x7'));var path=require(_0x1126('0x8'));var sox=require(_0x1126('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1126('0xa'));var _=require(_0x1126('0xb'));var squel=require('squel');var crypto=require(_0x1126('0xc'));var jsforce=require(_0x1126('0xd'));var deskjs=require(_0x1126('0xe'));var toCsv=require(_0x1126('0xf'));var querystring=require(_0x1126('0x10'));var Papa=require('papaparse');var Redis=require(_0x1126('0x11'));var authService=require(_0x1126('0x12'));var qs=require(_0x1126('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1126('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x1126('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x1126('0x16'));var db=require(_0x1126('0x17'))['db'];function respondWithStatusCode(_0xd26a32,_0x273896){_0x273896=_0x273896||0xcc;return function(_0xca0355){if(_0xca0355){return _0xd26a32[_0x1126('0x18')](_0x273896);}return _0xd26a32[_0x1126('0x19')](_0x273896)[_0x1126('0x1a')]();};}function respondWithResult(_0x43850b,_0x53a8f0){_0x53a8f0=_0x53a8f0||0xc8;return function(_0x5de9a7){if(_0x5de9a7){return _0x43850b[_0x1126('0x19')](_0x53a8f0)[_0x1126('0x1b')](_0x5de9a7);}};}function respondWithFilteredResult(_0x279455,_0x4be0c6){return function(_0x45149c){if(_0x45149c){var _0x4794a7=typeof _0x4be0c6[_0x1126('0x1c')]===_0x1126('0x1d')&&typeof _0x4be0c6[_0x1126('0x1e')]==='undefined';var _0x245cd7=_0x45149c[_0x1126('0x1f')];var _0x4a7b49=_0x4794a7?0x0:_0x4be0c6['offset'];var _0x22ae0b=_0x4794a7?_0x45149c[_0x1126('0x1f')]:_0x4be0c6['offset']+_0x4be0c6['limit'];var _0x4564c0;if(_0x22ae0b>=_0x245cd7){_0x22ae0b=_0x245cd7;_0x4564c0=0xc8;}else{_0x4564c0=0xce;}_0x279455['status'](_0x4564c0);return _0x279455[_0x1126('0x20')](_0x1126('0x21'),_0x4a7b49+'-'+_0x22ae0b+'/'+_0x245cd7)[_0x1126('0x1b')](_0x45149c);}return null;};}function patchUpdates(_0x54400a){return function(_0x2a08ba){try{jsonpatch['apply'](_0x2a08ba,_0x54400a,!![]);}catch(_0x56efeb){return BPromise[_0x1126('0x22')](_0x56efeb);}return _0x2a08ba[_0x1126('0x23')]();};}function saveUpdates(_0x25b24b,_0x36d254){return function(_0x526ca1){if(_0x526ca1){return _0x526ca1[_0x1126('0x24')](_0x25b24b)[_0x1126('0x25')](function(_0x48a08d){return _0x48a08d;});}return null;};}function removeEntity(_0x2175fa,_0x59cd8e){return function(_0x529dd9){if(_0x529dd9){return _0x529dd9['destroy']()[_0x1126('0x25')](function(){_0x2175fa[_0x1126('0x19')](0xcc)[_0x1126('0x1a')]();});}};}function handleEntityNotFound(_0x34bcf1,_0x566c09){return function(_0x1b07a7){if(!_0x1b07a7){_0x34bcf1[_0x1126('0x18')](0x194);}return _0x1b07a7;};}function handleError(_0x38119d,_0x589725){_0x589725=_0x589725||0x1f4;return function(_0x35eec3){logger[_0x1126('0x26')](_0x35eec3[_0x1126('0x27')]);if(_0x35eec3['name']){delete _0x35eec3['name'];}_0x38119d[_0x1126('0x19')](_0x589725)[_0x1126('0x28')](_0x35eec3);};}exports['index']=function(_0x2fb797,_0x23d2bc){var _0x4a334a={},_0x3fa694={},_0x4bf807={'count':0x0,'rows':[]};var _0xc62460=_['map'](db[_0x1126('0x29')]['rawAttributes'],function(_0x378f4d){return{'name':_0x378f4d['fieldName'],'type':_0x378f4d['type']['key']};});_0x3fa694[_0x1126('0x2a')]=_[_0x1126('0x2b')](_0xc62460,_0x1126('0x2c'));_0x3fa694['query']=_[_0x1126('0x2d')](_0x2fb797[_0x1126('0x2e')]);_0x3fa694['filters']=_[_0x1126('0x2f')](_0x3fa694[_0x1126('0x2a')],_0x3fa694[_0x1126('0x2e')]);_0x4a334a[_0x1126('0x30')]=_['intersection'](_0x3fa694['model'],qs[_0x1126('0x31')](_0x2fb797[_0x1126('0x2e')][_0x1126('0x31')]));_0x4a334a[_0x1126('0x30')]=_0x4a334a['attributes'][_0x1126('0x32')]?_0x4a334a[_0x1126('0x30')]:_0x3fa694[_0x1126('0x2a')];if(!_0x2fb797[_0x1126('0x2e')][_0x1126('0x33')]('nolimit')){_0x4a334a[_0x1126('0x1e')]=qs[_0x1126('0x1e')](_0x2fb797[_0x1126('0x2e')][_0x1126('0x1e')]);_0x4a334a['offset']=qs['offset'](_0x2fb797[_0x1126('0x2e')][_0x1126('0x1c')]);}_0x4a334a['order']=qs[_0x1126('0x34')](_0x2fb797[_0x1126('0x2e')][_0x1126('0x34')]);_0x4a334a['where']=qs['filters'](_[_0x1126('0x35')](_0x2fb797[_0x1126('0x2e')],_0x3fa694[_0x1126('0x36')]),_0xc62460);if(_0x2fb797[_0x1126('0x2e')]['filter']){_0x4a334a[_0x1126('0x37')]=_['merge'](_0x4a334a[_0x1126('0x37')],{'$or':_[_0x1126('0x2b')](_0xc62460,function(_0xfa96e0){if(_0xfa96e0[_0x1126('0x38')]!==_0x1126('0x39')){var _0x5746f6={};_0x5746f6[_0xfa96e0[_0x1126('0x2c')]]={'$like':'%'+_0x2fb797[_0x1126('0x2e')][_0x1126('0x3a')]+'%'};return _0x5746f6;}})});}_0x4a334a=_[_0x1126('0x3b')]({},_0x4a334a,_0x2fb797[_0x1126('0x3c')]);var _0x3442b8={'where':_0x4a334a[_0x1126('0x37')]};return db['UserProfileResource'][_0x1126('0x1f')](_0x3442b8)[_0x1126('0x25')](function(_0x227a6b){_0x4bf807[_0x1126('0x1f')]=_0x227a6b;if(_0x2fb797[_0x1126('0x2e')]['includeAll']){_0x4a334a['include']=[{'all':!![]}];}return db[_0x1126('0x29')][_0x1126('0x3d')](_0x4a334a);})[_0x1126('0x25')](function(_0x21c38e){_0x4bf807[_0x1126('0x3e')]=_0x21c38e;return _0x4bf807;})[_0x1126('0x25')](respondWithFilteredResult(_0x23d2bc,_0x4a334a))['catch'](handleError(_0x23d2bc,null));};exports['show']=function(_0x4cb1db,_0xb8054e){var _0x5d4194={'raw':![],'where':{'id':_0x4cb1db[_0x1126('0x3f')]['id']}},_0xf84005={};_0xf84005[_0x1126('0x2a')]=_[_0x1126('0x2d')](db['UserProfileResource']['rawAttributes']);_0xf84005[_0x1126('0x2e')]=_[_0x1126('0x2d')](_0x4cb1db[_0x1126('0x2e')]);_0xf84005['filters']=_[_0x1126('0x2f')](_0xf84005['model'],_0xf84005[_0x1126('0x2e')]);_0x5d4194['attributes']=_[_0x1126('0x2f')](_0xf84005[_0x1126('0x2a')],qs[_0x1126('0x31')](_0x4cb1db['query'][_0x1126('0x31')]));_0x5d4194[_0x1126('0x30')]=_0x5d4194[_0x1126('0x30')]['length']?_0x5d4194['attributes']:_0xf84005['model'];if(_0x4cb1db[_0x1126('0x2e')]['includeAll']){_0x5d4194[_0x1126('0x40')]=[{'all':!![]}];}_0x5d4194=_['merge']({},_0x5d4194,_0x4cb1db[_0x1126('0x3c')]);return db[_0x1126('0x29')][_0x1126('0x41')](_0x5d4194)[_0x1126('0x25')](handleEntityNotFound(_0xb8054e,null))[_0x1126('0x25')](respondWithResult(_0xb8054e,null))['catch'](handleError(_0xb8054e,null));};exports[_0x1126('0x42')]=function(_0x512f60,_0x5111d3){return db[_0x1126('0x29')][_0x1126('0x42')](_0x512f60['body'],{})[_0x1126('0x25')](respondWithResult(_0x5111d3,0xc9))[_0x1126('0x43')](handleError(_0x5111d3,null));};exports['update']=function(_0x3e4eeb,_0xbdde58){if(_0x3e4eeb[_0x1126('0x44')]['id']){delete _0x3e4eeb['body']['id'];}return db[_0x1126('0x29')][_0x1126('0x41')]({'where':{'id':_0x3e4eeb[_0x1126('0x3f')]['id']}})[_0x1126('0x25')](handleEntityNotFound(_0xbdde58,null))[_0x1126('0x25')](saveUpdates(_0x3e4eeb[_0x1126('0x44')],null))[_0x1126('0x25')](respondWithResult(_0xbdde58,null))[_0x1126('0x43')](handleError(_0xbdde58,null));};exports['destroy']=function(_0x1b8b83,_0x5a2287){return db[_0x1126('0x29')][_0x1126('0x41')]({'where':{'id':_0x1b8b83['params']['id']}})['then'](handleEntityNotFound(_0x5a2287,null))[_0x1126('0x25')](removeEntity(_0x5a2287,null))[_0x1126('0x43')](handleError(_0x5a2287,null));};exports[_0x1126('0x45')]=function(_0x52a9a4,_0x3cb44c){return db[_0x1126('0x29')][_0x1126('0x45')]()[_0x1126('0x25')](respondWithResult(_0x3cb44c,null))['catch'](handleError(_0x3cb44c,null));}; \ No newline at end of file +var _0x7096=['Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','name','send','map','rawAttributes','fieldName','type','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','limit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','params','UserProfileResource','find','catch','create','body','describe','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','count','set'];(function(_0x36960d,_0x4ae00b){var _0x3bbcc3=function(_0xa166b8){while(--_0xa166b8){_0x36960d['push'](_0x36960d['shift']());}};_0x3bbcc3(++_0x4ae00b);}(_0x7096,0x10c));var _0x6709=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0x7096[_0xae7c2f];return _0x5d7001;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6709('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6709('0x1'));var rp=require('request-promise');var moment=require(_0x6709('0x2'));var BPromise=require(_0x6709('0x3'));var Mustache=require(_0x6709('0x4'));var util=require(_0x6709('0x5'));var path=require(_0x6709('0x6'));var sox=require(_0x6709('0x7'));var csv=require(_0x6709('0x8'));var ejs=require(_0x6709('0x9'));var fs=require('fs');var fs_extra=require(_0x6709('0xa'));var _=require(_0x6709('0xb'));var squel=require(_0x6709('0xc'));var crypto=require(_0x6709('0xd'));var jsforce=require(_0x6709('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6709('0xf'));var Papa=require(_0x6709('0x10'));var Redis=require(_0x6709('0x11'));var authService=require(_0x6709('0x12'));var qs=require(_0x6709('0x13'));var as=require(_0x6709('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6709('0x15'));var utils=require(_0x6709('0x16'));var config=require(_0x6709('0x17'));var licenseUtil=require(_0x6709('0x18'));var db=require(_0x6709('0x19'))['db'];function respondWithStatusCode(_0x288f51,_0x1d56a5){_0x1d56a5=_0x1d56a5||0xcc;return function(_0x1ac547){if(_0x1ac547){return _0x288f51['sendStatus'](_0x1d56a5);}return _0x288f51[_0x6709('0x1a')](_0x1d56a5)[_0x6709('0x1b')]();};}function respondWithResult(_0x4d5255,_0x3706e1){_0x3706e1=_0x3706e1||0xc8;return function(_0x4e4587){if(_0x4e4587){return _0x4d5255[_0x6709('0x1a')](_0x3706e1)['json'](_0x4e4587);}};}function respondWithFilteredResult(_0x41af1f,_0x4bc059){return function(_0x149233){if(_0x149233){var _0x28866a=typeof _0x4bc059[_0x6709('0x1c')]===_0x6709('0x1d')&&typeof _0x4bc059['limit']==='undefined';var _0x5c4f94=_0x149233[_0x6709('0x1e')];var _0x235a54=_0x28866a?0x0:_0x4bc059['offset'];var _0x9c1fd8=_0x28866a?_0x149233[_0x6709('0x1e')]:_0x4bc059[_0x6709('0x1c')]+_0x4bc059['limit'];var _0x13cf04;if(_0x9c1fd8>=_0x5c4f94){_0x9c1fd8=_0x5c4f94;_0x13cf04=0xc8;}else{_0x13cf04=0xce;}_0x41af1f[_0x6709('0x1a')](_0x13cf04);return _0x41af1f[_0x6709('0x1f')](_0x6709('0x20'),_0x235a54+'-'+_0x9c1fd8+'/'+_0x5c4f94)['json'](_0x149233);}return null;};}function patchUpdates(_0x3c4971){return function(_0x1edac3){try{jsonpatch[_0x6709('0x21')](_0x1edac3,_0x3c4971,!![]);}catch(_0x3cf882){return BPromise[_0x6709('0x22')](_0x3cf882);}return _0x1edac3[_0x6709('0x23')]();};}function saveUpdates(_0x45921e,_0x17763d){return function(_0x386224){if(_0x386224){return _0x386224[_0x6709('0x24')](_0x45921e)[_0x6709('0x25')](function(_0xa36371){return _0xa36371;});}return null;};}function removeEntity(_0x5cf48b,_0x29f25f){return function(_0x81138e){if(_0x81138e){return _0x81138e[_0x6709('0x26')]()['then'](function(){_0x5cf48b[_0x6709('0x1a')](0xcc)[_0x6709('0x1b')]();});}};}function handleEntityNotFound(_0x20a347,_0x44b465){return function(_0x588e00){if(!_0x588e00){_0x20a347[_0x6709('0x27')](0x194);}return _0x588e00;};}function handleError(_0x3076fe,_0x50f7d6){_0x50f7d6=_0x50f7d6||0x1f4;return function(_0x585073){logger[_0x6709('0x28')](_0x585073['stack']);if(_0x585073[_0x6709('0x29')]){delete _0x585073[_0x6709('0x29')];}_0x3076fe['status'](_0x50f7d6)[_0x6709('0x2a')](_0x585073);};}exports['index']=function(_0x46a325,_0x3cd555){var _0x5b6906={},_0x137137={},_0x4e6989={'count':0x0,'rows':[]};var _0xe066d8=_[_0x6709('0x2b')](db['UserProfileResource'][_0x6709('0x2c')],function(_0x5deff5){return{'name':_0x5deff5[_0x6709('0x2d')],'type':_0x5deff5[_0x6709('0x2e')]['key']};});_0x137137['model']=_[_0x6709('0x2b')](_0xe066d8,_0x6709('0x29'));_0x137137[_0x6709('0x2f')]=_[_0x6709('0x30')](_0x46a325[_0x6709('0x2f')]);_0x137137[_0x6709('0x31')]=_[_0x6709('0x32')](_0x137137[_0x6709('0x33')],_0x137137[_0x6709('0x2f')]);_0x5b6906['attributes']=_[_0x6709('0x32')](_0x137137[_0x6709('0x33')],qs[_0x6709('0x34')](_0x46a325[_0x6709('0x2f')]['fields']));_0x5b6906[_0x6709('0x35')]=_0x5b6906[_0x6709('0x35')][_0x6709('0x36')]?_0x5b6906[_0x6709('0x35')]:_0x137137['model'];if(!_0x46a325[_0x6709('0x2f')][_0x6709('0x37')]('nolimit')){_0x5b6906[_0x6709('0x38')]=qs[_0x6709('0x38')](_0x46a325['query'][_0x6709('0x38')]);_0x5b6906[_0x6709('0x1c')]=qs[_0x6709('0x1c')](_0x46a325[_0x6709('0x2f')][_0x6709('0x1c')]);}_0x5b6906[_0x6709('0x39')]=qs[_0x6709('0x3a')](_0x46a325['query'][_0x6709('0x3a')]);_0x5b6906[_0x6709('0x3b')]=qs['filters'](_[_0x6709('0x3c')](_0x46a325[_0x6709('0x2f')],_0x137137[_0x6709('0x31')]),_0xe066d8);if(_0x46a325[_0x6709('0x2f')][_0x6709('0x3d')]){_0x5b6906[_0x6709('0x3b')]=_['merge'](_0x5b6906[_0x6709('0x3b')],{'$or':_['map'](_0xe066d8,function(_0x31e05a){if(_0x31e05a[_0x6709('0x2e')]!==_0x6709('0x3e')){var _0x48492f={};_0x48492f[_0x31e05a[_0x6709('0x29')]]={'$like':'%'+_0x46a325[_0x6709('0x2f')][_0x6709('0x3d')]+'%'};return _0x48492f;}})});}_0x5b6906=_[_0x6709('0x3f')]({},_0x5b6906,_0x46a325[_0x6709('0x40')]);var _0x1030ee={'where':_0x5b6906[_0x6709('0x3b')]};return db['UserProfileResource'][_0x6709('0x1e')](_0x1030ee)[_0x6709('0x25')](function(_0x50fbcd){_0x4e6989[_0x6709('0x1e')]=_0x50fbcd;if(_0x46a325[_0x6709('0x2f')][_0x6709('0x41')]){_0x5b6906[_0x6709('0x42')]=[{'all':!![]}];}return db['UserProfileResource']['findAll'](_0x5b6906);})[_0x6709('0x25')](function(_0x3f0da1){_0x4e6989[_0x6709('0x43')]=_0x3f0da1;return _0x4e6989;})[_0x6709('0x25')](respondWithFilteredResult(_0x3cd555,_0x5b6906))['catch'](handleError(_0x3cd555,null));};exports['show']=function(_0x5af1fb,_0x3d4237){var _0x293577={'raw':![],'where':{'id':_0x5af1fb[_0x6709('0x44')]['id']}},_0x54f74e={};_0x54f74e[_0x6709('0x33')]=_['keys'](db['UserProfileResource'][_0x6709('0x2c')]);_0x54f74e[_0x6709('0x2f')]=_[_0x6709('0x30')](_0x5af1fb[_0x6709('0x2f')]);_0x54f74e[_0x6709('0x31')]=_['intersection'](_0x54f74e[_0x6709('0x33')],_0x54f74e['query']);_0x293577[_0x6709('0x35')]=_[_0x6709('0x32')](_0x54f74e[_0x6709('0x33')],qs['fields'](_0x5af1fb[_0x6709('0x2f')]['fields']));_0x293577['attributes']=_0x293577[_0x6709('0x35')][_0x6709('0x36')]?_0x293577[_0x6709('0x35')]:_0x54f74e[_0x6709('0x33')];if(_0x5af1fb[_0x6709('0x2f')][_0x6709('0x41')]){_0x293577[_0x6709('0x42')]=[{'all':!![]}];}_0x293577=_[_0x6709('0x3f')]({},_0x293577,_0x5af1fb[_0x6709('0x40')]);return db[_0x6709('0x45')][_0x6709('0x46')](_0x293577)[_0x6709('0x25')](handleEntityNotFound(_0x3d4237,null))[_0x6709('0x25')](respondWithResult(_0x3d4237,null))[_0x6709('0x47')](handleError(_0x3d4237,null));};exports[_0x6709('0x48')]=function(_0x4f82a0,_0xfbb810){return db['UserProfileResource']['create'](_0x4f82a0[_0x6709('0x49')],{})[_0x6709('0x25')](respondWithResult(_0xfbb810,0xc9))[_0x6709('0x47')](handleError(_0xfbb810,null));};exports[_0x6709('0x24')]=function(_0x22363b,_0x2b05dc){if(_0x22363b[_0x6709('0x49')]['id']){delete _0x22363b[_0x6709('0x49')]['id'];}return db['UserProfileResource'][_0x6709('0x46')]({'where':{'id':_0x22363b[_0x6709('0x44')]['id']}})[_0x6709('0x25')](handleEntityNotFound(_0x2b05dc,null))[_0x6709('0x25')](saveUpdates(_0x22363b['body'],null))[_0x6709('0x25')](respondWithResult(_0x2b05dc,null))['catch'](handleError(_0x2b05dc,null));};exports[_0x6709('0x26')]=function(_0x34a950,_0x2a563b){return db[_0x6709('0x45')][_0x6709('0x46')]({'where':{'id':_0x34a950['params']['id']}})[_0x6709('0x25')](handleEntityNotFound(_0x2a563b,null))[_0x6709('0x25')](removeEntity(_0x2a563b,null))[_0x6709('0x47')](handleError(_0x2a563b,null));};exports[_0x6709('0x4a')]=function(_0x1015e0,_0x55188c){return db['UserProfileResource'][_0x6709('0x4a')]()['then'](respondWithResult(_0x55188c,null))['catch'](handleError(_0x55188c,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index b1abae5..b542b70 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 _0xf89a=['api','bluebird','request-promise','rimraf','../../config/environment','./userProfileResource.attributes','define','UserProfileResource','user_profile_has_resources','compositeIndex','resourceId','sectionId','util','../../config/logger'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0xf89a,0x186));var _0xaf89=function(_0x2acb75,_0x3b7776){_0x2acb75=_0x2acb75-0x0;var _0xffbc59=_0xf89a[_0x2acb75];return _0xffbc59;};'use strict';var _=require('lodash');var util=require(_0xaf89('0x0'));var logger=require(_0xaf89('0x1'))(_0xaf89('0x2'));var moment=require('moment');var BPromise=require(_0xaf89('0x3'));var rp=require(_0xaf89('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xaf89('0x5'));var config=require(_0xaf89('0x6'));var attributes=require(_0xaf89('0x7'));module['exports']=function(_0x143312,_0x43bb5a){return _0x143312[_0xaf89('0x8')](_0xaf89('0x9'),attributes,{'tableName':_0xaf89('0xa'),'paranoid':![],'indexes':[{'name':_0xaf89('0xb'),'fields':[_0xaf89('0xc'),_0xaf89('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xff4e=['api','bluebird','path','rimraf','./userProfileResource.attributes','define','UserProfileResource','compositeIndex','sectionId','lodash','util','../../config/logger'];(function(_0xa2c0a3,_0x5bbac0){var _0x52c618=function(_0x20f7fd){while(--_0x20f7fd){_0xa2c0a3['push'](_0xa2c0a3['shift']());}};_0x52c618(++_0x5bbac0);}(_0xff4e,0x1b9));var _0xeff4=function(_0x29d87d,_0x23dc31){_0x29d87d=_0x29d87d-0x0;var _0x1fd84b=_0xff4e[_0x29d87d];return _0x1fd84b;};'use strict';var _=require(_0xeff4('0x0'));var util=require(_0xeff4('0x1'));var logger=require(_0xeff4('0x2'))(_0xeff4('0x3'));var moment=require('moment');var BPromise=require(_0xeff4('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xeff4('0x5'));var rimraf=require(_0xeff4('0x6'));var config=require('../../config/environment');var attributes=require(_0xeff4('0x7'));module['exports']=function(_0x8c7774,_0x53095b){return _0x8c7774[_0xeff4('0x8')](_0xeff4('0x9'),attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':_0xeff4('0xa'),'fields':['resourceId',_0xeff4('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index ef7aea3..755c01e 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 _0x5795=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','client','http','request','then','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x23ab70,_0xb83367){var _0x2baa36=function(_0x43229e){while(--_0x43229e){_0x23ab70['push'](_0x23ab70['shift']());}};_0x2baa36(++_0xb83367);}(_0x5795,0xd1));var _0x5579=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0x5795[_0x4fde08];return _0x12e725;};'use strict';var _=require(_0x5579('0x0'));var util=require(_0x5579('0x1'));var moment=require(_0x5579('0x2'));var BPromise=require(_0x5579('0x3'));var rs=require(_0x5579('0x4'));var fs=require('fs');var Redis=require(_0x5579('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5579('0x6'));var config=require(_0x5579('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5579('0x8')][_0x5579('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3eee07,_0x93bedd,_0x16b184){return new BPromise(function(_0x47984b,_0x51c579){return client[_0x5579('0xa')](_0x3eee07,_0x16b184)[_0x5579('0xb')](function(_0x502e86){logger['info'](_0x5579('0xc'),_0x93bedd,_0x5579('0xd'));logger[_0x5579('0xe')](_0x5579('0xf'),_0x93bedd,'request\x20sent',JSON[_0x5579('0x10')](_0x502e86));if(_0x502e86['error']){if(_0x502e86[_0x5579('0x11')][_0x5579('0x12')]===0x1f4){logger[_0x5579('0x11')]('UserProfileResource,\x20%s,\x20%s',_0x93bedd,_0x502e86[_0x5579('0x11')][_0x5579('0x13')]);return _0x51c579(_0x502e86['error']['message']);}logger[_0x5579('0x11')](_0x5579('0xc'),_0x93bedd,_0x502e86[_0x5579('0x11')][_0x5579('0x13')]);return _0x47984b(_0x502e86[_0x5579('0x11')][_0x5579('0x13')]);}else{logger[_0x5579('0x14')](_0x5579('0xc'),_0x93bedd,_0x5579('0xd'));_0x47984b(_0x502e86[_0x5579('0x15')][_0x5579('0x13')]);}})[_0x5579('0x16')](function(_0x45f200){logger['error']('UserProfileResource,\x20%s,\x20%s',_0x93bedd,_0x45f200);_0x51c579(_0x45f200);});});} \ No newline at end of file +var _0xca02=['../../config/logger','rpc','../../config/environment','client','http','request','then','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x1e668a,_0x3ee7ed){var _0xc5dbb1=function(_0x116bef){while(--_0x116bef){_0x1e668a['push'](_0x1e668a['shift']());}};_0xc5dbb1(++_0x3ee7ed);}(_0xca02,0x1a9));var _0x2ca0=function(_0x4f7460,_0x363c2a){_0x4f7460=_0x4f7460-0x0;var _0x55b1a1=_0xca02[_0x4f7460];return _0x55b1a1;};'use strict';var _=require(_0x2ca0('0x0'));var util=require(_0x2ca0('0x1'));var moment=require(_0x2ca0('0x2'));var BPromise=require(_0x2ca0('0x3'));var rs=require(_0x2ca0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2ca0('0x5'))['db'];var utils=require(_0x2ca0('0x6'));var logger=require(_0x2ca0('0x7'))(_0x2ca0('0x8'));var config=require(_0x2ca0('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x2ca0('0xa')][_0x2ca0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x16c1e5,_0xc0b716,_0x53fe8c){return new BPromise(function(_0x1423ac,_0x10386d){return client[_0x2ca0('0xc')](_0x16c1e5,_0x53fe8c)[_0x2ca0('0xd')](function(_0x15dd57){logger['info'](_0x2ca0('0xe'),_0xc0b716,_0x2ca0('0xf'));logger[_0x2ca0('0x10')](_0x2ca0('0x11'),_0xc0b716,'request\x20sent',JSON[_0x2ca0('0x12')](_0x15dd57));if(_0x15dd57[_0x2ca0('0x13')]){if(_0x15dd57['error']['code']===0x1f4){logger['error']('UserProfileResource,\x20%s,\x20%s',_0xc0b716,_0x15dd57[_0x2ca0('0x13')][_0x2ca0('0x14')]);return _0x10386d(_0x15dd57['error'][_0x2ca0('0x14')]);}logger['error'](_0x2ca0('0xe'),_0xc0b716,_0x15dd57['error'][_0x2ca0('0x14')]);return _0x1423ac(_0x15dd57[_0x2ca0('0x13')]['message']);}else{logger[_0x2ca0('0x15')](_0x2ca0('0xe'),_0xc0b716,_0x2ca0('0xf'));_0x1423ac(_0x15dd57[_0x2ca0('0x16')][_0x2ca0('0x14')]);}})[_0x2ca0('0x17')](function(_0x28bdfb){logger['error'](_0x2ca0('0xe'),_0xc0b716,_0x28bdfb);_0x10386d(_0x28bdfb);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index 1b1e349..99d9469 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 _0x965a=['./userProfileSection.controller','get','/describe','describe','/:id','isAuthenticated','show','post','create','put','update','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x965a,0x175));var _0xa965=function(_0x17b6a7,_0x320d7a){_0x17b6a7=_0x17b6a7-0x0;var _0x343e68=_0x965a[_0x17b6a7];return _0x343e68;};'use strict';var multer=require(_0xa965('0x0'));var util=require('util');var path=require(_0xa965('0x1'));var timeout=require('connect-timeout');var express=require(_0xa965('0x2'));var router=express[_0xa965('0x3')]();var fs_extra=require(_0xa965('0x4'));var auth=require(_0xa965('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa965('0x6'));var controller=require(_0xa965('0x7'));router[_0xa965('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xa965('0x8')](_0xa965('0x9'),auth['isAuthenticated'](),controller[_0xa965('0xa')]);router[_0xa965('0x8')](_0xa965('0xb'),auth[_0xa965('0xc')](),controller[_0xa965('0xd')]);router[_0xa965('0xe')]('/',auth[_0xa965('0xc')](),controller[_0xa965('0xf')]);router[_0xa965('0x10')](_0xa965('0xb'),auth[_0xa965('0xc')](),controller[_0xa965('0x11')]);router['delete'](_0xa965('0xb'),auth[_0xa965('0xc')](),controller[_0xa965('0x12')]);module[_0xa965('0x13')]=router; \ No newline at end of file +var _0x6f62=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./userProfileSection.controller','get','index','/describe','describe','isAuthenticated','show'];(function(_0x2d2ca2,_0x51873f){var _0x48489d=function(_0x1a2cf7){while(--_0x1a2cf7){_0x2d2ca2['push'](_0x2d2ca2['shift']());}};_0x48489d(++_0x51873f);}(_0x6f62,0x1cc));var _0x26f6=function(_0xce6f11,_0x3c3137){_0xce6f11=_0xce6f11-0x0;var _0x35b709=_0x6f62[_0xce6f11];return _0x35b709;};'use strict';var multer=require(_0x26f6('0x0'));var util=require(_0x26f6('0x1'));var path=require(_0x26f6('0x2'));var timeout=require(_0x26f6('0x3'));var express=require(_0x26f6('0x4'));var router=express[_0x26f6('0x5')]();var fs_extra=require(_0x26f6('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x26f6('0x7'));var controller=require(_0x26f6('0x8'));router[_0x26f6('0x9')]('/',auth['isAuthenticated'](),controller[_0x26f6('0xa')]);router[_0x26f6('0x9')](_0x26f6('0xb'),auth['isAuthenticated'](),controller[_0x26f6('0xc')]);router[_0x26f6('0x9')]('/:id',auth[_0x26f6('0xd')](),controller[_0x26f6('0xe')]);router['post']('/',auth[_0x26f6('0xd')](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x26f6('0xf')]);router[_0x26f6('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x26f6('0x11')]);module[_0x26f6('0x12')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index dfbcdd1..a052d83 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 _0x4b17=['STRING','INTEGER','BOOLEAN','crudPermissions','join','getDataValue','split','sequelize'];(function(_0x16310a,_0x43bafb){var _0x4d0bf1=function(_0x380601){while(--_0x380601){_0x16310a['push'](_0x16310a['shift']());}};_0x4d0bf1(++_0x43bafb);}(_0x4b17,0x10f));var _0x74b1=function(_0x59145a,_0x1f60f1){_0x59145a=_0x59145a-0x0;var _0xf04d7=_0x4b17[_0x59145a];return _0xf04d7;};'use strict';var Sequelize=require(_0x74b1('0x0'));module['exports']={'name':{'type':Sequelize[_0x74b1('0x1')],'allowNull':![]},'category':{'type':Sequelize['STRING'],'allowNull':![]},'sectionId':{'type':Sequelize[_0x74b1('0x2')],'allowNull':![]},'enabled':{'type':Sequelize[_0x74b1('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x74b1('0x1')],'set':function(_0x4f206f){this['setDataValue'](_0x74b1('0x4'),_0x4f206f?_0x4f206f[_0x74b1('0x5')](''):[]);},'get':function(){return this[_0x74b1('0x6')](_0x74b1('0x4'))?this[_0x74b1('0x6')](_0x74b1('0x4'))[_0x74b1('0x7')](''):[];}}}; \ No newline at end of file +var _0x58a4=['split','sequelize','exports','STRING','INTEGER','BOOLEAN','setDataValue','crudPermissions','join','getDataValue'];(function(_0x4db473,_0x31dcd5){var _0x24c5db=function(_0xdd9d7f){while(--_0xdd9d7f){_0x4db473['push'](_0x4db473['shift']());}};_0x24c5db(++_0x31dcd5);}(_0x58a4,0xbf));var _0x458a=function(_0x3452a8,_0x4bfaa4){_0x3452a8=_0x3452a8-0x0;var _0x233814=_0x58a4[_0x3452a8];return _0x233814;};'use strict';var Sequelize=require(_0x458a('0x0'));module[_0x458a('0x1')]={'name':{'type':Sequelize[_0x458a('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0x458a('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x458a('0x3')],'allowNull':![]},'enabled':{'type':Sequelize[_0x458a('0x4')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x458a('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x458a('0x2')],'set':function(_0x362079){this[_0x458a('0x5')](_0x458a('0x6'),_0x362079?_0x362079[_0x458a('0x7')](''):[]);},'get':function(){return this[_0x458a('0x8')]('crudPermissions')?this['getDataValue'](_0x458a('0x6'))[_0x458a('0x9')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index 90b0313..fbc3766 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 _0x248b=['type','VIRTUAL','includeAll','include','findAll','rows','catch','params','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','end','undefined','limit','count','offset','json','apply','reject','save','update','then','sendStatus','error','stack','name','index','map','UserProfileSection','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','pick','filter','where','merge'];(function(_0x2c94a5,_0x128193){var _0x472eac=function(_0x4ab9af){while(--_0x4ab9af){_0x2c94a5['push'](_0x2c94a5['shift']());}};_0x472eac(++_0x128193);}(_0x248b,0x17f));var _0xb248=function(_0x2061d2,_0x255598){_0x2061d2=_0x2061d2-0x0;var _0x5dc73f=_0x248b[_0x2061d2];return _0x5dc73f;};'use strict';var emlformat=require(_0xb248('0x0'));var rimraf=require(_0xb248('0x1'));var zipdir=require(_0xb248('0x2'));var jsonpatch=require(_0xb248('0x3'));var rp=require(_0xb248('0x4'));var moment=require(_0xb248('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xb248('0x6'));var ejs=require(_0xb248('0x7'));var fs=require('fs');var fs_extra=require(_0xb248('0x8'));var _=require(_0xb248('0x9'));var squel=require(_0xb248('0xa'));var crypto=require('crypto');var jsforce=require(_0xb248('0xb'));var deskjs=require(_0xb248('0xc'));var toCsv=require(_0xb248('0x6'));var querystring=require(_0xb248('0xd'));var Papa=require(_0xb248('0xe'));var Redis=require(_0xb248('0xf'));var authService=require(_0xb248('0x10'));var qs=require(_0xb248('0x11'));var as=require(_0xb248('0x12'));var hardwareService=require(_0xb248('0x13'));var logger=require(_0xb248('0x14'))(_0xb248('0x15'));var utils=require(_0xb248('0x16'));var config=require(_0xb248('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5464cf,_0x5dfbdd){_0x5dfbdd=_0x5dfbdd||0xcc;return function(_0x381085){if(_0x381085){return _0x5464cf['sendStatus'](_0x5dfbdd);}return _0x5464cf[_0xb248('0x18')](_0x5dfbdd)[_0xb248('0x19')]();};}function respondWithResult(_0x2a5f95,_0x5e5671){_0x5e5671=_0x5e5671||0xc8;return function(_0x304ac0){if(_0x304ac0){return _0x2a5f95[_0xb248('0x18')](_0x5e5671)['json'](_0x304ac0);}};}function respondWithFilteredResult(_0x414b21,_0x3bd374){return function(_0x2ade4a){if(_0x2ade4a){var _0x379adc=typeof _0x3bd374['offset']===_0xb248('0x1a')&&typeof _0x3bd374[_0xb248('0x1b')]==='undefined';var _0x5dd2ac=_0x2ade4a[_0xb248('0x1c')];var _0x5c9d5f=_0x379adc?0x0:_0x3bd374[_0xb248('0x1d')];var _0x60c8ba=_0x379adc?_0x2ade4a['count']:_0x3bd374['offset']+_0x3bd374['limit'];var _0x3ff030;if(_0x60c8ba>=_0x5dd2ac){_0x60c8ba=_0x5dd2ac;_0x3ff030=0xc8;}else{_0x3ff030=0xce;}_0x414b21[_0xb248('0x18')](_0x3ff030);return _0x414b21['set']('Content-Range',_0x5c9d5f+'-'+_0x60c8ba+'/'+_0x5dd2ac)[_0xb248('0x1e')](_0x2ade4a);}return null;};}function patchUpdates(_0x1a32f8){return function(_0x158270){try{jsonpatch[_0xb248('0x1f')](_0x158270,_0x1a32f8,!![]);}catch(_0x1a0d39){return BPromise[_0xb248('0x20')](_0x1a0d39);}return _0x158270[_0xb248('0x21')]();};}function saveUpdates(_0x59359d,_0x4fb941){return function(_0x193243){if(_0x193243){return _0x193243[_0xb248('0x22')](_0x59359d)[_0xb248('0x23')](function(_0x354acf){return _0x354acf;});}return null;};}function removeEntity(_0x50bd22,_0x47a6c4){return function(_0x2e54cb){if(_0x2e54cb){return _0x2e54cb['destroy']()[_0xb248('0x23')](function(){_0x50bd22[_0xb248('0x18')](0xcc)[_0xb248('0x19')]();});}};}function handleEntityNotFound(_0x519a3d,_0x3bd647){return function(_0x2df34d){if(!_0x2df34d){_0x519a3d[_0xb248('0x24')](0x194);}return _0x2df34d;};}function handleError(_0x49f61c,_0x17f382){_0x17f382=_0x17f382||0x1f4;return function(_0x2f4833){logger[_0xb248('0x25')](_0x2f4833[_0xb248('0x26')]);if(_0x2f4833[_0xb248('0x27')]){delete _0x2f4833[_0xb248('0x27')];}_0x49f61c[_0xb248('0x18')](_0x17f382)['send'](_0x2f4833);};}exports[_0xb248('0x28')]=function(_0x4a6dd3,_0x99be8e){var _0x32c91d={},_0x348716={},_0x112513={'count':0x0,'rows':[]};var _0x1f3755=_[_0xb248('0x29')](db[_0xb248('0x2a')][_0xb248('0x2b')],function(_0x4bbd20){return{'name':_0x4bbd20[_0xb248('0x2c')],'type':_0x4bbd20['type'][_0xb248('0x2d')]};});_0x348716[_0xb248('0x2e')]=_[_0xb248('0x29')](_0x1f3755,_0xb248('0x27'));_0x348716[_0xb248('0x2f')]=_[_0xb248('0x30')](_0x4a6dd3['query']);_0x348716['filters']=_[_0xb248('0x31')](_0x348716[_0xb248('0x2e')],_0x348716['query']);_0x32c91d[_0xb248('0x32')]=_[_0xb248('0x31')](_0x348716[_0xb248('0x2e')],qs[_0xb248('0x33')](_0x4a6dd3['query'][_0xb248('0x33')]));_0x32c91d['attributes']=_0x32c91d[_0xb248('0x32')][_0xb248('0x34')]?_0x32c91d[_0xb248('0x32')]:_0x348716[_0xb248('0x2e')];if(!_0x4a6dd3[_0xb248('0x2f')][_0xb248('0x35')]('nolimit')){_0x32c91d[_0xb248('0x1b')]=qs['limit'](_0x4a6dd3[_0xb248('0x2f')][_0xb248('0x1b')]);_0x32c91d['offset']=qs[_0xb248('0x1d')](_0x4a6dd3[_0xb248('0x2f')][_0xb248('0x1d')]);}_0x32c91d[_0xb248('0x36')]=qs[_0xb248('0x37')](_0x4a6dd3[_0xb248('0x2f')][_0xb248('0x37')]);_0x32c91d['where']=qs[_0xb248('0x38')](_[_0xb248('0x39')](_0x4a6dd3[_0xb248('0x2f')],_0x348716[_0xb248('0x38')]),_0x1f3755);if(_0x4a6dd3[_0xb248('0x2f')][_0xb248('0x3a')]){_0x32c91d[_0xb248('0x3b')]=_[_0xb248('0x3c')](_0x32c91d['where'],{'$or':_[_0xb248('0x29')](_0x1f3755,function(_0x1c34fe){if(_0x1c34fe[_0xb248('0x3d')]!==_0xb248('0x3e')){var _0x3e1e70={};_0x3e1e70[_0x1c34fe[_0xb248('0x27')]]={'$like':'%'+_0x4a6dd3[_0xb248('0x2f')][_0xb248('0x3a')]+'%'};return _0x3e1e70;}})});}_0x32c91d=_[_0xb248('0x3c')]({},_0x32c91d,_0x4a6dd3['options']);var _0xfb5949={'where':_0x32c91d['where']};return db[_0xb248('0x2a')]['count'](_0xfb5949)[_0xb248('0x23')](function(_0x47b72c){_0x112513[_0xb248('0x1c')]=_0x47b72c;if(_0x4a6dd3[_0xb248('0x2f')][_0xb248('0x3f')]){_0x32c91d[_0xb248('0x40')]=[{'all':!![]}];}return db[_0xb248('0x2a')][_0xb248('0x41')](_0x32c91d);})[_0xb248('0x23')](function(_0x7d6402){_0x112513[_0xb248('0x42')]=_0x7d6402;return _0x112513;})[_0xb248('0x23')](respondWithFilteredResult(_0x99be8e,_0x32c91d))[_0xb248('0x43')](handleError(_0x99be8e,null));};exports['show']=function(_0x1b51fb,_0x149627){var _0x3d3d54={'raw':![],'where':{'id':_0x1b51fb[_0xb248('0x44')]['id']}},_0xd37da2={};_0xd37da2[_0xb248('0x2e')]=_[_0xb248('0x30')](db[_0xb248('0x2a')]['rawAttributes']);_0xd37da2[_0xb248('0x2f')]=_[_0xb248('0x30')](_0x1b51fb[_0xb248('0x2f')]);_0xd37da2['filters']=_[_0xb248('0x31')](_0xd37da2[_0xb248('0x2e')],_0xd37da2[_0xb248('0x2f')]);_0x3d3d54[_0xb248('0x32')]=_[_0xb248('0x31')](_0xd37da2[_0xb248('0x2e')],qs[_0xb248('0x33')](_0x1b51fb[_0xb248('0x2f')][_0xb248('0x33')]));_0x3d3d54[_0xb248('0x32')]=_0x3d3d54[_0xb248('0x32')][_0xb248('0x34')]?_0x3d3d54[_0xb248('0x32')]:_0xd37da2['model'];if(_0x1b51fb[_0xb248('0x2f')][_0xb248('0x3f')]){_0x3d3d54['include']=[{'all':!![]}];}_0x3d3d54=_['merge']({},_0x3d3d54,_0x1b51fb[_0xb248('0x45')]);return db[_0xb248('0x2a')][_0xb248('0x46')](_0x3d3d54)[_0xb248('0x23')](handleEntityNotFound(_0x149627,null))[_0xb248('0x23')](respondWithResult(_0x149627,null))[_0xb248('0x43')](handleError(_0x149627,null));};exports['create']=function(_0x5edd0d,_0x3516e8){return db[_0xb248('0x2a')][_0xb248('0x47')](_0x5edd0d[_0xb248('0x48')],{})[_0xb248('0x23')](respondWithResult(_0x3516e8,0xc9))[_0xb248('0x43')](handleError(_0x3516e8,null));};exports[_0xb248('0x22')]=function(_0x52835c,_0x513374){if(_0x52835c[_0xb248('0x48')]['id']){delete _0x52835c[_0xb248('0x48')]['id'];}return db['UserProfileSection'][_0xb248('0x46')]({'where':{'id':_0x52835c['params']['id']}})[_0xb248('0x23')](handleEntityNotFound(_0x513374,null))[_0xb248('0x23')](saveUpdates(_0x52835c['body'],null))['then'](respondWithResult(_0x513374,null))['catch'](handleError(_0x513374,null));};exports['destroy']=function(_0x4771a7,_0x16f0d4){return db[_0xb248('0x2a')]['find']({'where':{'id':_0x4771a7[_0xb248('0x44')]['id']}})[_0xb248('0x23')](handleEntityNotFound(_0x16f0d4,null))[_0xb248('0x23')](removeEntity(_0x16f0d4,null))[_0xb248('0x43')](handleError(_0x16f0d4,null));};exports[_0xb248('0x49')]=function(_0x5b8af1,_0x13d799){return db[_0xb248('0x2a')][_0xb248('0x49')]()[_0xb248('0x23')](respondWithResult(_0x13d799,null))[_0xb248('0x43')](handleError(_0x13d799,null));}; \ No newline at end of file +var _0x05d0=['../../mysqldb','sendStatus','end','status','json','undefined','offset','count','limit','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','map','UserProfileSection','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','catch','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/environment','../../config/license/util'];(function(_0x444661,_0x1a5cf9){var _0x57f25e=function(_0x3a28e5){while(--_0x3a28e5){_0x444661['push'](_0x444661['shift']());}};_0x57f25e(++_0x1a5cf9);}(_0x05d0,0x1ee));var _0x005d=function(_0x450e85,_0x4e8804){_0x450e85=_0x450e85-0x0;var _0x3c63f5=_0x05d0[_0x450e85];return _0x3c63f5;};'use strict';var emlformat=require(_0x005d('0x0'));var rimraf=require(_0x005d('0x1'));var zipdir=require(_0x005d('0x2'));var jsonpatch=require(_0x005d('0x3'));var rp=require(_0x005d('0x4'));var moment=require('moment');var BPromise=require(_0x005d('0x5'));var Mustache=require(_0x005d('0x6'));var util=require('util');var path=require(_0x005d('0x7'));var sox=require(_0x005d('0x8'));var csv=require(_0x005d('0x9'));var ejs=require(_0x005d('0xa'));var fs=require('fs');var fs_extra=require(_0x005d('0xb'));var _=require(_0x005d('0xc'));var squel=require(_0x005d('0xd'));var crypto=require(_0x005d('0xe'));var jsforce=require(_0x005d('0xf'));var deskjs=require(_0x005d('0x10'));var toCsv=require('to-csv');var querystring=require(_0x005d('0x11'));var Papa=require(_0x005d('0x12'));var Redis=require(_0x005d('0x13'));var authService=require(_0x005d('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x005d('0x15'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x005d('0x16'));var licenseUtil=require(_0x005d('0x17'));var db=require(_0x005d('0x18'))['db'];function respondWithStatusCode(_0x5408e0,_0x3c99d7){_0x3c99d7=_0x3c99d7||0xcc;return function(_0x3eaeb9){if(_0x3eaeb9){return _0x5408e0[_0x005d('0x19')](_0x3c99d7);}return _0x5408e0['status'](_0x3c99d7)[_0x005d('0x1a')]();};}function respondWithResult(_0x26af8b,_0x421d82){_0x421d82=_0x421d82||0xc8;return function(_0x103110){if(_0x103110){return _0x26af8b[_0x005d('0x1b')](_0x421d82)[_0x005d('0x1c')](_0x103110);}};}function respondWithFilteredResult(_0x1232c7,_0x2a07ba){return function(_0x5a5fde){if(_0x5a5fde){var _0x285d54=typeof _0x2a07ba['offset']===_0x005d('0x1d')&&typeof _0x2a07ba['limit']===_0x005d('0x1d');var _0x4dcec2=_0x5a5fde['count'];var _0xf3777a=_0x285d54?0x0:_0x2a07ba[_0x005d('0x1e')];var _0x88a557=_0x285d54?_0x5a5fde[_0x005d('0x1f')]:_0x2a07ba[_0x005d('0x1e')]+_0x2a07ba[_0x005d('0x20')];var _0x5e1ef3;if(_0x88a557>=_0x4dcec2){_0x88a557=_0x4dcec2;_0x5e1ef3=0xc8;}else{_0x5e1ef3=0xce;}_0x1232c7[_0x005d('0x1b')](_0x5e1ef3);return _0x1232c7['set'](_0x005d('0x21'),_0xf3777a+'-'+_0x88a557+'/'+_0x4dcec2)[_0x005d('0x1c')](_0x5a5fde);}return null;};}function patchUpdates(_0x4ca9b5){return function(_0x72d1f){try{jsonpatch[_0x005d('0x22')](_0x72d1f,_0x4ca9b5,!![]);}catch(_0x4b0d0b){return BPromise[_0x005d('0x23')](_0x4b0d0b);}return _0x72d1f['save']();};}function saveUpdates(_0x53b37d,_0xcd27a9){return function(_0x44d62c){if(_0x44d62c){return _0x44d62c[_0x005d('0x24')](_0x53b37d)[_0x005d('0x25')](function(_0x3da1d4){return _0x3da1d4;});}return null;};}function removeEntity(_0x32a419,_0x50ba39){return function(_0x28071e){if(_0x28071e){return _0x28071e[_0x005d('0x26')]()['then'](function(){_0x32a419[_0x005d('0x1b')](0xcc)[_0x005d('0x1a')]();});}};}function handleEntityNotFound(_0x357ba4,_0x3a56b2){return function(_0x3a09ca){if(!_0x3a09ca){_0x357ba4[_0x005d('0x19')](0x194);}return _0x3a09ca;};}function handleError(_0x48d666,_0x11906e){_0x11906e=_0x11906e||0x1f4;return function(_0x377d98){logger[_0x005d('0x27')](_0x377d98[_0x005d('0x28')]);if(_0x377d98[_0x005d('0x29')]){delete _0x377d98[_0x005d('0x29')];}_0x48d666[_0x005d('0x1b')](_0x11906e)[_0x005d('0x2a')](_0x377d98);};}exports['index']=function(_0x431c62,_0x446cc1){var _0x120094={},_0x596fa8={},_0x3aeaa9={'count':0x0,'rows':[]};var _0x4d1b19=_[_0x005d('0x2b')](db[_0x005d('0x2c')][_0x005d('0x2d')],function(_0x5eb8e1){return{'name':_0x5eb8e1[_0x005d('0x2e')],'type':_0x5eb8e1[_0x005d('0x2f')][_0x005d('0x30')]};});_0x596fa8[_0x005d('0x31')]=_[_0x005d('0x2b')](_0x4d1b19,'name');_0x596fa8[_0x005d('0x32')]=_[_0x005d('0x33')](_0x431c62[_0x005d('0x32')]);_0x596fa8['filters']=_[_0x005d('0x34')](_0x596fa8[_0x005d('0x31')],_0x596fa8[_0x005d('0x32')]);_0x120094[_0x005d('0x35')]=_['intersection'](_0x596fa8[_0x005d('0x31')],qs[_0x005d('0x36')](_0x431c62[_0x005d('0x32')][_0x005d('0x36')]));_0x120094[_0x005d('0x35')]=_0x120094['attributes'][_0x005d('0x37')]?_0x120094['attributes']:_0x596fa8['model'];if(!_0x431c62[_0x005d('0x32')]['hasOwnProperty'](_0x005d('0x38'))){_0x120094['limit']=qs[_0x005d('0x20')](_0x431c62['query'][_0x005d('0x20')]);_0x120094[_0x005d('0x1e')]=qs[_0x005d('0x1e')](_0x431c62[_0x005d('0x32')][_0x005d('0x1e')]);}_0x120094[_0x005d('0x39')]=qs['sort'](_0x431c62[_0x005d('0x32')][_0x005d('0x3a')]);_0x120094[_0x005d('0x3b')]=qs[_0x005d('0x3c')](_[_0x005d('0x3d')](_0x431c62[_0x005d('0x32')],_0x596fa8[_0x005d('0x3c')]),_0x4d1b19);if(_0x431c62['query'][_0x005d('0x3e')]){_0x120094['where']=_[_0x005d('0x3f')](_0x120094['where'],{'$or':_[_0x005d('0x2b')](_0x4d1b19,function(_0x463d2d){if(_0x463d2d[_0x005d('0x2f')]!=='VIRTUAL'){var _0x258781={};_0x258781[_0x463d2d[_0x005d('0x29')]]={'$like':'%'+_0x431c62['query']['filter']+'%'};return _0x258781;}})});}_0x120094=_[_0x005d('0x3f')]({},_0x120094,_0x431c62[_0x005d('0x40')]);var _0x23da7f={'where':_0x120094[_0x005d('0x3b')]};return db[_0x005d('0x2c')][_0x005d('0x1f')](_0x23da7f)[_0x005d('0x25')](function(_0x1173cb){_0x3aeaa9[_0x005d('0x1f')]=_0x1173cb;if(_0x431c62[_0x005d('0x32')][_0x005d('0x41')]){_0x120094[_0x005d('0x42')]=[{'all':!![]}];}return db[_0x005d('0x2c')][_0x005d('0x43')](_0x120094);})[_0x005d('0x25')](function(_0x40f955){_0x3aeaa9['rows']=_0x40f955;return _0x3aeaa9;})[_0x005d('0x25')](respondWithFilteredResult(_0x446cc1,_0x120094))[_0x005d('0x44')](handleError(_0x446cc1,null));};exports['show']=function(_0x2a6e72,_0x1ac69a){var _0x5aad03={'raw':![],'where':{'id':_0x2a6e72[_0x005d('0x45')]['id']}},_0x57b376={};_0x57b376[_0x005d('0x31')]=_[_0x005d('0x33')](db[_0x005d('0x2c')][_0x005d('0x2d')]);_0x57b376[_0x005d('0x32')]=_[_0x005d('0x33')](_0x2a6e72[_0x005d('0x32')]);_0x57b376[_0x005d('0x3c')]=_[_0x005d('0x34')](_0x57b376[_0x005d('0x31')],_0x57b376[_0x005d('0x32')]);_0x5aad03[_0x005d('0x35')]=_[_0x005d('0x34')](_0x57b376[_0x005d('0x31')],qs['fields'](_0x2a6e72[_0x005d('0x32')][_0x005d('0x36')]));_0x5aad03[_0x005d('0x35')]=_0x5aad03[_0x005d('0x35')][_0x005d('0x37')]?_0x5aad03['attributes']:_0x57b376['model'];if(_0x2a6e72[_0x005d('0x32')][_0x005d('0x41')]){_0x5aad03[_0x005d('0x42')]=[{'all':!![]}];}_0x5aad03=_[_0x005d('0x3f')]({},_0x5aad03,_0x2a6e72[_0x005d('0x40')]);return db['UserProfileSection'][_0x005d('0x46')](_0x5aad03)['then'](handleEntityNotFound(_0x1ac69a,null))['then'](respondWithResult(_0x1ac69a,null))[_0x005d('0x44')](handleError(_0x1ac69a,null));};exports[_0x005d('0x47')]=function(_0x2d30da,_0x52e159){return db[_0x005d('0x2c')][_0x005d('0x47')](_0x2d30da[_0x005d('0x48')],{})[_0x005d('0x25')](respondWithResult(_0x52e159,0xc9))[_0x005d('0x44')](handleError(_0x52e159,null));};exports['update']=function(_0x33de6b,_0x5bb851){if(_0x33de6b[_0x005d('0x48')]['id']){delete _0x33de6b[_0x005d('0x48')]['id'];}return db[_0x005d('0x2c')][_0x005d('0x46')]({'where':{'id':_0x33de6b[_0x005d('0x45')]['id']}})[_0x005d('0x25')](handleEntityNotFound(_0x5bb851,null))[_0x005d('0x25')](saveUpdates(_0x33de6b[_0x005d('0x48')],null))['then'](respondWithResult(_0x5bb851,null))[_0x005d('0x44')](handleError(_0x5bb851,null));};exports[_0x005d('0x26')]=function(_0x4e37c7,_0x48f89c){return db[_0x005d('0x2c')]['find']({'where':{'id':_0x4e37c7[_0x005d('0x45')]['id']}})['then'](handleEntityNotFound(_0x48f89c,null))['then'](removeEntity(_0x48f89c,null))[_0x005d('0x44')](handleError(_0x48f89c,null));};exports[_0x005d('0x49')]=function(_0x205edd,_0x55dd8e){return db[_0x005d('0x2c')]['describe']()[_0x005d('0x25')](respondWithResult(_0x55dd8e,null))['catch'](handleError(_0x55dd8e,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index 7aaf621..66c2c7a 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 _0x3af7=['moment','bluebird','path','../../config/environment','./userProfileSection.attributes','define','UserProfileSection','user_profile_has_sections','compositeIndex','sectionId','userProfileId','util','../../config/logger','api'];(function(_0x16ce30,_0x3a957b){var _0x2de58b=function(_0x18fb4b){while(--_0x18fb4b){_0x16ce30['push'](_0x16ce30['shift']());}};_0x2de58b(++_0x3a957b);}(_0x3af7,0xb3));var _0x73af=function(_0x1fefb2,_0x2b447e){_0x1fefb2=_0x1fefb2-0x0;var _0x18e4d7=_0x3af7[_0x1fefb2];return _0x18e4d7;};'use strict';var _=require('lodash');var util=require(_0x73af('0x0'));var logger=require(_0x73af('0x1'))(_0x73af('0x2'));var moment=require(_0x73af('0x3'));var BPromise=require(_0x73af('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x73af('0x5'));var rimraf=require('rimraf');var config=require(_0x73af('0x6'));var attributes=require(_0x73af('0x7'));module['exports']=function(_0xfcd217,_0x70f98){return _0xfcd217[_0x73af('0x8')](_0x73af('0x9'),attributes,{'tableName':_0x73af('0xa'),'paranoid':![],'indexes':[{'name':_0x73af('0xb'),'fields':[_0x73af('0xc'),_0x73af('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5746=['UserProfileSection','user_profile_has_sections','sectionId','userProfileId','lodash','api','moment','request-promise','path','rimraf','../../config/environment','./userProfileSection.attributes','exports'];(function(_0x5cd3c1,_0x1b629a){var _0x53874d=function(_0x40a4cd){while(--_0x40a4cd){_0x5cd3c1['push'](_0x5cd3c1['shift']());}};_0x53874d(++_0x1b629a);}(_0x5746,0x1f2));var _0x6574=function(_0x40c884,_0x352bd8){_0x40c884=_0x40c884-0x0;var _0x40e0f5=_0x5746[_0x40c884];return _0x40e0f5;};'use strict';var _=require(_0x6574('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x6574('0x1'));var moment=require(_0x6574('0x2'));var BPromise=require('bluebird');var rp=require(_0x6574('0x3'));var fs=require('fs');var path=require(_0x6574('0x4'));var rimraf=require(_0x6574('0x5'));var config=require(_0x6574('0x6'));var attributes=require(_0x6574('0x7'));module[_0x6574('0x8')]=function(_0x3b6ba1,_0x31ab50){return _0x3b6ba1['define'](_0x6574('0x9'),attributes,{'tableName':_0x6574('0xa'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0x6574('0xb'),_0x6574('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index cfceabb..411ec83 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 _0x9fc3=['request','then','UserProfileSection,\x20%s,\x20%s','request\x20sent','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x50b07f,_0x1dee5b){var _0x19b62c=function(_0x257bb3){while(--_0x257bb3){_0x50b07f['push'](_0x50b07f['shift']());}};_0x19b62c(++_0x1dee5b);}(_0x9fc3,0x199));var _0x39fc=function(_0x1a62c8,_0x1477c4){_0x1a62c8=_0x1a62c8-0x0;var _0x7cd03f=_0x9fc3[_0x1a62c8];return _0x7cd03f;};'use strict';var _=require(_0x39fc('0x0'));var util=require('util');var moment=require(_0x39fc('0x1'));var BPromise=require(_0x39fc('0x2'));var rs=require(_0x39fc('0x3'));var fs=require('fs');var Redis=require(_0x39fc('0x4'));var db=require(_0x39fc('0x5'))['db'];var utils=require(_0x39fc('0x6'));var logger=require(_0x39fc('0x7'))('rpc');var config=require(_0x39fc('0x8'));var jayson=require(_0x39fc('0x9'));var client=jayson[_0x39fc('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e1262,_0x2a976c,_0x410f33){return new BPromise(function(_0x524674,_0x28538f){return client[_0x39fc('0xb')](_0x4e1262,_0x410f33)[_0x39fc('0xc')](function(_0x23275b){logger['info'](_0x39fc('0xd'),_0x2a976c,_0x39fc('0xe'));logger['debug'](_0x39fc('0xf'),_0x2a976c,'request\x20sent',JSON[_0x39fc('0x10')](_0x23275b));if(_0x23275b['error']){if(_0x23275b[_0x39fc('0x11')][_0x39fc('0x12')]===0x1f4){logger[_0x39fc('0x11')](_0x39fc('0xd'),_0x2a976c,_0x23275b[_0x39fc('0x11')]['message']);return _0x28538f(_0x23275b[_0x39fc('0x11')]['message']);}logger[_0x39fc('0x11')](_0x39fc('0xd'),_0x2a976c,_0x23275b[_0x39fc('0x11')]['message']);return _0x524674(_0x23275b['error'][_0x39fc('0x13')]);}else{logger['info']('UserProfileSection,\x20%s,\x20%s',_0x2a976c,_0x39fc('0xe'));_0x524674(_0x23275b[_0x39fc('0x14')][_0x39fc('0x13')]);}})['catch'](function(_0x7d455c){logger[_0x39fc('0x11')](_0x39fc('0xd'),_0x2a976c,_0x7d455c);_0x28538f(_0x7d455c);});});} \ No newline at end of file +var _0x2c70=['../../config/logger','rpc','jayson/promise','client','http','request','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','moment','ioredis'];(function(_0x48fe34,_0x126a26){var _0x298e35=function(_0x5a7c87){while(--_0x5a7c87){_0x48fe34['push'](_0x48fe34['shift']());}};_0x298e35(++_0x126a26);}(_0x2c70,0x19f));var _0x02c7=function(_0x51d5c6,_0xba25f1){_0x51d5c6=_0x51d5c6-0x0;var _0x199158=_0x2c70[_0x51d5c6];return _0x199158;};'use strict';var _=require(_0x02c7('0x0'));var util=require('util');var moment=require(_0x02c7('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x02c7('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x02c7('0x3'))(_0x02c7('0x4'));var config=require('../../config/environment');var jayson=require(_0x02c7('0x5'));var client=jayson[_0x02c7('0x6')][_0x02c7('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2dc1e3,_0x1c124e,_0x44ffca){return new BPromise(function(_0x1b2139,_0x5a11bb){return client[_0x02c7('0x8')](_0x2dc1e3,_0x44ffca)['then'](function(_0x289007){logger[_0x02c7('0x9')](_0x02c7('0xa'),_0x1c124e,_0x02c7('0xb'));logger[_0x02c7('0xc')]('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x1c124e,'request\x20sent',JSON[_0x02c7('0xd')](_0x289007));if(_0x289007[_0x02c7('0xe')]){if(_0x289007[_0x02c7('0xe')][_0x02c7('0xf')]===0x1f4){logger[_0x02c7('0xe')](_0x02c7('0xa'),_0x1c124e,_0x289007[_0x02c7('0xe')][_0x02c7('0x10')]);return _0x5a11bb(_0x289007[_0x02c7('0xe')][_0x02c7('0x10')]);}logger[_0x02c7('0xe')](_0x02c7('0xa'),_0x1c124e,_0x289007[_0x02c7('0xe')][_0x02c7('0x10')]);return _0x1b2139(_0x289007['error'][_0x02c7('0x10')]);}else{logger[_0x02c7('0x9')](_0x02c7('0xa'),_0x1c124e,_0x02c7('0xb'));_0x1b2139(_0x289007[_0x02c7('0x11')][_0x02c7('0x10')]);}})[_0x02c7('0x12')](function(_0x508994){logger['error'](_0x02c7('0xa'),_0x1c124e,_0x508994);_0x5a11bb(_0x508994);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index 803fdde..4914024 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x143a91,_0x235332){var _0x1906f5=function(_0xd27eeb){while(--_0xd27eeb){_0x143a91['push'](_0x143a91['shift']());}};_0x1906f5(++_0x235332);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xa9e0[_0x47e7cb];return _0x2a8874;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x36fa51,_0x55ad58){var _0x337877=function(_0xfde693){while(--_0xfde693){_0x36fa51['push'](_0x36fa51['shift']());}};_0x337877(++_0x55ad58);}(_0xa9e0,0x123));var _0x0a9e=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0xa9e0[_0x138f59];return _0x3d114d;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index 048d10d..4fba7f8 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 _0xc122=['exports','INTEGER','sequelize'];(function(_0x233ac3,_0x5b049b){var _0x3d1f4d=function(_0x3418bc){while(--_0x3418bc){_0x233ac3['push'](_0x233ac3['shift']());}};_0x3d1f4d(++_0x5b049b);}(_0xc122,0x149));var _0x2c12=function(_0x1e6bd0,_0x4f4368){_0x1e6bd0=_0x1e6bd0-0x0;var _0x146e2f=_0xc122[_0x1e6bd0];return _0x146e2f;};'use strict';var Sequelize=require(_0x2c12('0x0'));module[_0x2c12('0x1')]={'penalty':{'type':Sequelize[_0x2c12('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x0631=['INTEGER','sequelize'];(function(_0x30cc9c,_0x168f6b){var _0x4d9280=function(_0x3e2f63){while(--_0x3e2f63){_0x30cc9c['push'](_0x30cc9c['shift']());}};_0x4d9280(++_0x168f6b);}(_0x0631,0xcd));var _0x1063=function(_0x266ad8,_0x45346d){_0x266ad8=_0x266ad8-0x0;var _0x45b7de=_0x0631[_0x266ad8];return _0x45b7de;};'use strict';var Sequelize=require(_0x1063('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x1063('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 95fe5b3..f4ef8ec 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 _0xeda8=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userSmsQueue.attributes','exports','define','user_has_sms_queues'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xeda8,0x104));var _0x8eda=function(_0x5d9e9b,_0x3e03ec){_0x5d9e9b=_0x5d9e9b-0x0;var _0x422afa=_0xeda8[_0x5d9e9b];return _0x422afa;};'use strict';var _=require(_0x8eda('0x0'));var util=require(_0x8eda('0x1'));var logger=require('../../config/logger')(_0x8eda('0x2'));var moment=require(_0x8eda('0x3'));var BPromise=require(_0x8eda('0x4'));var rp=require(_0x8eda('0x5'));var fs=require('fs');var path=require(_0x8eda('0x6'));var rimraf=require(_0x8eda('0x7'));var config=require(_0x8eda('0x8'));var attributes=require(_0x8eda('0x9'));module[_0x8eda('0xa')]=function(_0x1f3556,_0x349361){return _0x1f3556[_0x8eda('0xb')]('UserSmsQueue',attributes,{'tableName':_0x8eda('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9a5a=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./userSmsQueue.attributes','exports','define','UserSmsQueue','user_has_sms_queues','lodash','util'];(function(_0xa6cc5c,_0x239c99){var _0x44803d=function(_0x515b6e){while(--_0x515b6e){_0xa6cc5c['push'](_0xa6cc5c['shift']());}};_0x44803d(++_0x239c99);}(_0x9a5a,0x194));var _0xa9a5=function(_0x117c26,_0x1479cc){_0x117c26=_0x117c26-0x0;var _0x137b87=_0x9a5a[_0x117c26];return _0x137b87;};'use strict';var _=require(_0xa9a5('0x0'));var util=require(_0xa9a5('0x1'));var logger=require(_0xa9a5('0x2'))(_0xa9a5('0x3'));var moment=require(_0xa9a5('0x4'));var BPromise=require('bluebird');var rp=require(_0xa9a5('0x5'));var fs=require('fs');var path=require(_0xa9a5('0x6'));var rimraf=require(_0xa9a5('0x7'));var config=require(_0xa9a5('0x8'));var attributes=require(_0xa9a5('0x9'));module[_0xa9a5('0xa')]=function(_0x4a73f4,_0xb0ccd9){return _0x4a73f4[_0xa9a5('0xb')](_0xa9a5('0xc'),attributes,{'tableName':_0xa9a5('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 776c8c5..121bc80 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 _0xb4df=['error','code','UserSmsQueue,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x10c40c,_0x516c09){var _0x182b8c=function(_0x1a9fab){while(--_0x1a9fab){_0x10c40c['push'](_0x10c40c['shift']());}};_0x182b8c(++_0x516c09);}(_0xb4df,0x79));var _0xfb4d=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0xb4df[_0x1b828b];return _0x98da1a;};'use strict';var _=require(_0xfb4d('0x0'));var util=require(_0xfb4d('0x1'));var moment=require(_0xfb4d('0x2'));var BPromise=require(_0xfb4d('0x3'));var rs=require(_0xfb4d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfb4d('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xfb4d('0x6'));var config=require(_0xfb4d('0x7'));var jayson=require(_0xfb4d('0x8'));var client=jayson[_0xfb4d('0x9')][_0xfb4d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x21db41,_0x254d8d,_0x2ebfa7){return new BPromise(function(_0x106b43,_0x320336){return client['request'](_0x21db41,_0x2ebfa7)[_0xfb4d('0xb')](function(_0x5284f9){logger[_0xfb4d('0xc')]('UserSmsQueue,\x20%s,\x20%s',_0x254d8d,_0xfb4d('0xd'));logger[_0xfb4d('0xe')](_0xfb4d('0xf'),_0x254d8d,_0xfb4d('0xd'),JSON[_0xfb4d('0x10')](_0x5284f9));if(_0x5284f9[_0xfb4d('0x11')]){if(_0x5284f9[_0xfb4d('0x11')][_0xfb4d('0x12')]===0x1f4){logger[_0xfb4d('0x11')](_0xfb4d('0x13'),_0x254d8d,_0x5284f9[_0xfb4d('0x11')]['message']);return _0x320336(_0x5284f9[_0xfb4d('0x11')][_0xfb4d('0x14')]);}logger['error'](_0xfb4d('0x13'),_0x254d8d,_0x5284f9['error'][_0xfb4d('0x14')]);return _0x106b43(_0x5284f9[_0xfb4d('0x11')][_0xfb4d('0x14')]);}else{logger['info'](_0xfb4d('0x13'),_0x254d8d,_0xfb4d('0xd'));_0x106b43(_0x5284f9[_0xfb4d('0x15')][_0xfb4d('0x14')]);}})[_0xfb4d('0x16')](function(_0x5dcc88){logger[_0xfb4d('0x11')](_0xfb4d('0x13'),_0x254d8d,_0x5dcc88);_0x320336(_0x5dcc88);});});} \ No newline at end of file +var _0xbe7c=['code','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x49778a,_0x2a0b51){var _0x5daa0f=function(_0x26c47a){while(--_0x26c47a){_0x49778a['push'](_0x49778a['shift']());}};_0x5daa0f(++_0x2a0b51);}(_0xbe7c,0x18c));var _0xcbe7=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xbe7c[_0x4b369d];return _0x571a98;};'use strict';var _=require('lodash');var util=require(_0xcbe7('0x0'));var moment=require(_0xcbe7('0x1'));var BPromise=require(_0xcbe7('0x2'));var rs=require(_0xcbe7('0x3'));var fs=require('fs');var Redis=require(_0xcbe7('0x4'));var db=require(_0xcbe7('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xcbe7('0x6'))(_0xcbe7('0x7'));var config=require(_0xcbe7('0x8'));var jayson=require(_0xcbe7('0x9'));var client=jayson[_0xcbe7('0xa')][_0xcbe7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xa28467,_0x28be8c,_0x25b1d6){return new BPromise(function(_0x2575d2,_0x3c8223){return client['request'](_0xa28467,_0x25b1d6)[_0xcbe7('0xc')](function(_0x3e8357){logger['info'](_0xcbe7('0xd'),_0x28be8c,_0xcbe7('0xe'));logger[_0xcbe7('0xf')]('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x28be8c,'request\x20sent',JSON[_0xcbe7('0x10')](_0x3e8357));if(_0x3e8357[_0xcbe7('0x11')]){if(_0x3e8357['error'][_0xcbe7('0x12')]===0x1f4){logger['error'](_0xcbe7('0xd'),_0x28be8c,_0x3e8357['error'][_0xcbe7('0x13')]);return _0x3c8223(_0x3e8357['error'][_0xcbe7('0x13')]);}logger['error'](_0xcbe7('0xd'),_0x28be8c,_0x3e8357[_0xcbe7('0x11')][_0xcbe7('0x13')]);return _0x2575d2(_0x3e8357['error'][_0xcbe7('0x13')]);}else{logger[_0xcbe7('0x14')]('UserSmsQueue,\x20%s,\x20%s',_0x28be8c,_0xcbe7('0xe'));_0x2575d2(_0x3e8357[_0xcbe7('0x15')][_0xcbe7('0x13')]);}})[_0xcbe7('0x16')](function(_0x58dd37){logger[_0xcbe7('0x11')](_0xcbe7('0xd'),_0x28be8c,_0x58dd37);_0x3c8223(_0x58dd37);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index ede253c..72a6110 100644 --- a/server/api/userVoicePrefix/userVoicePrefix.attributes.js +++ b/server/api/userVoicePrefix/userVoicePrefix.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2862=['sequelize','INTEGER'];(function(_0x540bc4,_0x2c95be){var _0x31bdb2=function(_0x5ea813){while(--_0x5ea813){_0x540bc4['push'](_0x540bc4['shift']());}};_0x31bdb2(++_0x2c95be);}(_0x2862,0x13a));var _0x2286=function(_0x51f644,_0x5bf98e){_0x51f644=_0x51f644-0x0;var _0x3b6c47=_0x2862[_0x51f644];return _0x3b6c47;};'use strict';var Sequelize=require(_0x2286('0x0'));module['exports']={'UserId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0x2286('0x1')]}}; \ No newline at end of file +var _0x25ed=['sequelize','exports','INTEGER'];(function(_0x365170,_0x3d7a5d){var _0x18bac3=function(_0x1f19d8){while(--_0x1f19d8){_0x365170['push'](_0x365170['shift']());}};_0x18bac3(++_0x3d7a5d);}(_0x25ed,0x14a));var _0xd25e=function(_0x4eb0b1,_0x1621ac){_0x4eb0b1=_0x4eb0b1-0x0;var _0x1b58bd=_0x25ed[_0x4eb0b1];return _0x1b58bd;};'use strict';var Sequelize=require(_0xd25e('0x0'));module[_0xd25e('0x1')]={'UserId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0xd25e('0x2')]}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index 19b3b45..3c29eec 100644 --- a/server/api/userVoicePrefix/userVoicePrefix.model.js +++ b/server/api/userVoicePrefix/userVoicePrefix.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../config/environment','./userVoicePrefix.attributes','exports','define','UserVoicePrefix','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x14b6f4,_0x2b410e){var _0x4ec509=function(_0x46c536){while(--_0x46c536){_0x14b6f4['push'](_0x14b6f4['shift']());}};_0x4ec509(++_0x2b410e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xa9e0[_0x2763f2];return _0x3ef471;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'user_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['../../config/environment','./userVoicePrefix.attributes','exports','define','UserVoicePrefix','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x3a4143,_0x111446){var _0x368420=function(_0xd49847){while(--_0xd49847){_0x3a4143['push'](_0x3a4143['shift']());}};_0x368420(++_0x111446);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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':'user_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/index.js b/server/api/userVoiceQueue/index.js index 6858a8d..20d6c7e 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x415524,_0x1ed0a0){var _0x4ea111=function(_0x1c89d9){while(--_0x1c89d9){_0x415524['push'](_0x415524['shift']());}};_0x4ea111(++_0x1ed0a0);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x573f69,_0x2129c7){var _0x54b9a7=function(_0x76dfdc){while(--_0x76dfdc){_0x573f69['push'](_0x573f69['shift']());}};_0x54b9a7(++_0x2129c7);}(_0x70e0,0x17b));var _0x070e=function(_0x5cbe38,_0x5badcb){_0x5cbe38=_0x5cbe38-0x0;var _0x4cc3d8=_0x70e0[_0x5cbe38];return _0x4cc3d8;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index ebd8ab5..c8efb18 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 _0x6a94=['sequelize','exports','INTEGER'];(function(_0x47a063,_0x25903f){var _0x207c45=function(_0x559445){while(--_0x559445){_0x47a063['push'](_0x47a063['shift']());}};_0x207c45(++_0x25903f);}(_0x6a94,0xbd));var _0x46a9=function(_0x98c162,_0x44cb4b){_0x98c162=_0x98c162-0x0;var _0x44eb9a=_0x6a94[_0x98c162];return _0x44eb9a;};'use strict';var Sequelize=require(_0x46a9('0x0'));module[_0x46a9('0x1')]={'penalty':{'type':Sequelize[_0x46a9('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xd928=['exports'];(function(_0x275d85,_0x5a883e){var _0x3cd754=function(_0x209dee){while(--_0x209dee){_0x275d85['push'](_0x275d85['shift']());}};_0x3cd754(++_0x5a883e);}(_0xd928,0x85));var _0x8d92=function(_0x398bd9,_0x2a8369){_0x398bd9=_0x398bd9-0x0;var _0x1ac39c=_0xd928[_0x398bd9];return _0x1ac39c;};'use strict';var Sequelize=require('sequelize');module[_0x8d92('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'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 10e56c4..35898c9 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 _0xc884=['rimraf','../../config/environment','define','user_has_voice_queues','lodash','bluebird','request-promise','path'];(function(_0x2b4fde,_0x6599e0){var _0x1dcc8c=function(_0x5ddf64){while(--_0x5ddf64){_0x2b4fde['push'](_0x2b4fde['shift']());}};_0x1dcc8c(++_0x6599e0);}(_0xc884,0x1ec));var _0x4c88=function(_0x6348eb,_0x19080d){_0x6348eb=_0x6348eb-0x0;var _0x54f7a2=_0xc884[_0x6348eb];return _0x54f7a2;};'use strict';var _=require(_0x4c88('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x4c88('0x1'));var rp=require(_0x4c88('0x2'));var fs=require('fs');var path=require(_0x4c88('0x3'));var rimraf=require(_0x4c88('0x4'));var config=require(_0x4c88('0x5'));var attributes=require('./userVoiceQueue.attributes');module['exports']=function(_0xabe2da,_0xb97d64){return _0xabe2da[_0x4c88('0x6')]('UserVoiceQueue',attributes,{'tableName':_0x4c88('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1771=['../../config/logger','api','bluebird','request-promise','./userVoiceQueue.attributes','exports','UserVoiceQueue','user_has_voice_queues','lodash','util'];(function(_0x1fef62,_0x2e27b9){var _0x54362e=function(_0x4af409){while(--_0x4af409){_0x1fef62['push'](_0x1fef62['shift']());}};_0x54362e(++_0x2e27b9);}(_0x1771,0x166));var _0x1177=function(_0x7756ab,_0x9d1050){_0x7756ab=_0x7756ab-0x0;var _0x405c4d=_0x1771[_0x7756ab];return _0x405c4d;};'use strict';var _=require(_0x1177('0x0'));var util=require(_0x1177('0x1'));var logger=require(_0x1177('0x2'))(_0x1177('0x3'));var moment=require('moment');var BPromise=require(_0x1177('0x4'));var rp=require(_0x1177('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1177('0x6'));module[_0x1177('0x7')]=function(_0x5629fe,_0x16f20a){return _0x5629fe['define'](_0x1177('0x8'),attributes,{'tableName':_0x1177('0x9'),'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 69fad6c..8364a89 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 _0x0959=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','UserVoiceQueue,\x20%s,\x20%s,\x20%s','error','message','info','catch','lodash','util','moment','ioredis'];(function(_0x471f1a,_0x18415d){var _0x72566b=function(_0x110643){while(--_0x110643){_0x471f1a['push'](_0x471f1a['shift']());}};_0x72566b(++_0x18415d);}(_0x0959,0xd8));var _0x9095=function(_0x2ce463,_0x31f1b1){_0x2ce463=_0x2ce463-0x0;var _0x4c7002=_0x0959[_0x2ce463];return _0x4c7002;};'use strict';var _=require(_0x9095('0x0'));var util=require(_0x9095('0x1'));var moment=require(_0x9095('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9095('0x3'));var db=require(_0x9095('0x4'))['db'];var utils=require(_0x9095('0x5'));var logger=require('../../config/logger')(_0x9095('0x6'));var config=require(_0x9095('0x7'));var jayson=require(_0x9095('0x8'));var client=jayson[_0x9095('0x9')][_0x9095('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1b4606,_0x6e85cf,_0x1708d2){return new BPromise(function(_0x2744a8,_0x12fa5c){return client[_0x9095('0xb')](_0x1b4606,_0x1708d2)[_0x9095('0xc')](function(_0x567026){logger['info'](_0x9095('0xd'),_0x6e85cf,_0x9095('0xe'));logger['debug'](_0x9095('0xf'),_0x6e85cf,'request\x20sent',JSON['stringify'](_0x567026));if(_0x567026[_0x9095('0x10')]){if(_0x567026['error']['code']===0x1f4){logger[_0x9095('0x10')](_0x9095('0xd'),_0x6e85cf,_0x567026[_0x9095('0x10')]['message']);return _0x12fa5c(_0x567026[_0x9095('0x10')]['message']);}logger[_0x9095('0x10')](_0x9095('0xd'),_0x6e85cf,_0x567026[_0x9095('0x10')]['message']);return _0x2744a8(_0x567026[_0x9095('0x10')][_0x9095('0x11')]);}else{logger[_0x9095('0x12')]('UserVoiceQueue,\x20%s,\x20%s',_0x6e85cf,_0x9095('0xe'));_0x2744a8(_0x567026['result'][_0x9095('0x11')]);}})[_0x9095('0x13')](function(_0x97557b){logger['error'](_0x9095('0xd'),_0x6e85cf,_0x97557b);_0x12fa5c(_0x97557b);});});} \ No newline at end of file +var _0x5e22=['http','request','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client'];(function(_0x3dbbb7,_0x9f32b8){var _0x1cf503=function(_0x3e4605){while(--_0x3e4605){_0x3dbbb7['push'](_0x3dbbb7['shift']());}};_0x1cf503(++_0x9f32b8);}(_0x5e22,0x1b0));var _0x25e2=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0x5e22[_0x82129b];return _0x2ae5dc;};'use strict';var _=require(_0x25e2('0x0'));var util=require(_0x25e2('0x1'));var moment=require(_0x25e2('0x2'));var BPromise=require('bluebird');var rs=require(_0x25e2('0x3'));var fs=require('fs');var Redis=require(_0x25e2('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x25e2('0x5'));var logger=require(_0x25e2('0x6'))(_0x25e2('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x25e2('0x8')][_0x25e2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x120b0b,_0x1d840a,_0x58d1c8){return new BPromise(function(_0x3ecd00,_0x5f0de2){return client[_0x25e2('0xa')](_0x120b0b,_0x58d1c8)['then'](function(_0x1acf58){logger['info'](_0x25e2('0xb'),_0x1d840a,_0x25e2('0xc'));logger[_0x25e2('0xd')](_0x25e2('0xe'),_0x1d840a,_0x25e2('0xc'),JSON[_0x25e2('0xf')](_0x1acf58));if(_0x1acf58[_0x25e2('0x10')]){if(_0x1acf58[_0x25e2('0x10')][_0x25e2('0x11')]===0x1f4){logger[_0x25e2('0x10')](_0x25e2('0xb'),_0x1d840a,_0x1acf58[_0x25e2('0x10')][_0x25e2('0x12')]);return _0x5f0de2(_0x1acf58[_0x25e2('0x10')][_0x25e2('0x12')]);}logger[_0x25e2('0x10')]('UserVoiceQueue,\x20%s,\x20%s',_0x1d840a,_0x1acf58[_0x25e2('0x10')][_0x25e2('0x12')]);return _0x3ecd00(_0x1acf58[_0x25e2('0x10')][_0x25e2('0x12')]);}else{logger['info'](_0x25e2('0xb'),_0x1d840a,_0x25e2('0xc'));_0x3ecd00(_0x1acf58[_0x25e2('0x13')][_0x25e2('0x12')]);}})[_0x25e2('0x14')](function(_0x59c52e){logger[_0x25e2('0x10')](_0x25e2('0xb'),_0x1d840a,_0x59c52e);_0x5f0de2(_0x59c52e);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index f84e375..4342281 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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x59ef6b,_0x2bd071){var _0x2b2314=function(_0x3c6acf){while(--_0x3c6acf){_0x59ef6b['push'](_0x59ef6b['shift']());}};_0x2b2314(++_0x2bd071);}(_0xedd9,0xfc));var _0x9edd=function(_0x473ed7,_0xe6b2c8){_0x473ed7=_0x473ed7-0x0;var _0x38427b=_0xedd9[_0x473ed7];return _0x38427b;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x4f62c2,_0x3a089d){var _0x1e0e37=function(_0x4ce49d){while(--_0x4ce49d){_0x4f62c2['push'](_0x4f62c2['shift']());}};_0x1e0e37(++_0x3a089d);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index 9ca36bb..27e6c8e 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 _0x5c46=['sequelize','INTEGER','STRING','Required\x20by\x20Asterisk','queue_interface'];(function(_0x591da2,_0x23155f){var _0x45c580=function(_0x2da57d){while(--_0x2da57d){_0x591da2['push'](_0x591da2['shift']());}};_0x45c580(++_0x23155f);}(_0x5c46,0x1ef));var _0x65c4=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5c46[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x65c4('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x65c4('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':'Required\x20by\x20Asterisk'},'membername':{'type':Sequelize[_0x65c4('0x2')],'allowNull':![],'comment':_0x65c4('0x3')},'UserId':{'type':Sequelize[_0x65c4('0x1')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x65c4('0x2')],'allowNull':![],'unique':_0x65c4('0x4'),'comment':_0x65c4('0x3')},'VoiceQueueId':{'type':Sequelize[_0x65c4('0x1')],'allowNull':![]},'interface':{'type':Sequelize[_0x65c4('0x2')],'allowNull':![],'unique':'queue_interface','comment':_0x65c4('0x3')},'penalty':{'type':Sequelize[_0x65c4('0x1')](0xb),'defaultValue':0x0,'comment':_0x65c4('0x3')},'paused':{'type':Sequelize[_0x65c4('0x1')](0xb),'defaultValue':0x0,'comment':_0x65c4('0x3')}}; \ No newline at end of file +var _0x1c6d=['exports','INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface'];(function(_0x588466,_0x1b1bfa){var _0x596ec0=function(_0x495acf){while(--_0x495acf){_0x588466['push'](_0x588466['shift']());}};_0x596ec0(++_0x1b1bfa);}(_0x1c6d,0xff));var _0xd1c6=function(_0x45be52,_0x46d496){_0x45be52=_0x45be52-0x0;var _0x15294f=_0x1c6d[_0x45be52];return _0x15294f;};'use strict';var Sequelize=require('sequelize');module[_0xd1c6('0x0')]={'uniqueid':{'type':Sequelize[_0xd1c6('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':_0xd1c6('0x2')},'membername':{'type':Sequelize[_0xd1c6('0x3')],'allowNull':![],'comment':_0xd1c6('0x2')},'UserId':{'type':Sequelize[_0xd1c6('0x1')],'allowNull':![]},'queue_name':{'type':Sequelize[_0xd1c6('0x3')],'allowNull':![],'unique':_0xd1c6('0x4'),'comment':_0xd1c6('0x2')},'VoiceQueueId':{'type':Sequelize[_0xd1c6('0x1')],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':'queue_interface','comment':_0xd1c6('0x2')},'penalty':{'type':Sequelize[_0xd1c6('0x1')](0xb),'defaultValue':0x0,'comment':_0xd1c6('0x2')},'paused':{'type':Sequelize[_0xd1c6('0x1')](0xb),'defaultValue':0x0,'comment':_0xd1c6('0x2')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 37e7623..d9daa52 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 _0x2531=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','UserVoiceQueueRt','setMaxListeners','save','remove'];(function(_0xdc37a1,_0x53ebb9){var _0x99b4fe=function(_0x2811e3){while(--_0x2811e3){_0xdc37a1['push'](_0xdc37a1['shift']());}};_0x99b4fe(++_0x53ebb9);}(_0x2531,0x1bc));var _0x1253=function(_0x537476,_0x35bdd1){_0x537476=_0x537476-0x0;var _0x2bc433=_0x2531[_0x537476];return _0x2bc433;};'use strict';var EventEmitter=require(_0x1253('0x0'));var UserVoiceQueueRt=require(_0x1253('0x1'))['db'][_0x1253('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x1253('0x3')](0x0);var events={'afterCreate':_0x1253('0x4'),'afterUpdate':'update','afterDestroy':_0x1253('0x5')};function emitEvent(_0x393b03){return function(_0xd48a3f,_0x401eef,_0x58f820){UserVoiceQueueRtEvents[_0x1253('0x6')](_0x393b03+':'+_0xd48a3f['id'],_0xd48a3f);UserVoiceQueueRtEvents[_0x1253('0x6')](_0x393b03,_0xd48a3f);_0x58f820(null);};}for(var e in events){if(events[_0x1253('0x7')](e)){var event=events[e];UserVoiceQueueRt[_0x1253('0x8')](e,emitEvent(event));}}module[_0x1253('0x9')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0xc709=['save','update','emit','hook','exports','events','../../mysqldb','UserVoiceQueueRt','setMaxListeners'];(function(_0x40782f,_0x3be4e0){var _0x48542b=function(_0x51042e){while(--_0x51042e){_0x40782f['push'](_0x40782f['shift']());}};_0x48542b(++_0x3be4e0);}(_0xc709,0x1e2));var _0x9c70=function(_0x2181b1,_0x569637){_0x2181b1=_0x2181b1-0x0;var _0x530548=_0xc709[_0x2181b1];return _0x530548;};'use strict';var EventEmitter=require(_0x9c70('0x0'));var UserVoiceQueueRt=require(_0x9c70('0x1'))['db'][_0x9c70('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x9c70('0x3')](0x0);var events={'afterCreate':_0x9c70('0x4'),'afterUpdate':_0x9c70('0x5'),'afterDestroy':'remove'};function emitEvent(_0x4fcc1c){return function(_0x595b31,_0x3654c6,_0x41b3f6){UserVoiceQueueRtEvents[_0x9c70('0x6')](_0x4fcc1c+':'+_0x595b31['id'],_0x595b31);UserVoiceQueueRtEvents[_0x9c70('0x6')](_0x4fcc1c,_0x595b31);_0x41b3f6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt[_0x9c70('0x7')](e,emitEvent(event));}}module[_0x9c70('0x8')]=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index c1f0e8a..3e7c0a4 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 _0x8809=['UserVoiceQueueRt','user_has_voice_queues_rt','lodash','../../config/logger','moment','bluebird','request-promise','rimraf'];(function(_0x17f46b,_0x3f2196){var _0xf07726=function(_0x1e6736){while(--_0x1e6736){_0x17f46b['push'](_0x17f46b['shift']());}};_0xf07726(++_0x3f2196);}(_0x8809,0x172));var _0x9880=function(_0xdc3575,_0x592e0a){_0xdc3575=_0xdc3575-0x0;var _0x4e1b84=_0x8809[_0xdc3575];return _0x4e1b84;};'use strict';var _=require(_0x9880('0x0'));var util=require('util');var logger=require(_0x9880('0x1'))('api');var moment=require(_0x9880('0x2'));var BPromise=require(_0x9880('0x3'));var rp=require(_0x9880('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9880('0x5'));var config=require('../../config/environment');var attributes=require('./userVoiceQueueRt.attributes');module['exports']=function(_0x164e90,_0x4b8d7a){return _0x164e90['define'](_0x9880('0x6'),attributes,{'tableName':_0x9880('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x21c7=['../../config/environment','./userVoiceQueueRt.attributes','exports','define','UserVoiceQueueRt','user_has_voice_queues_rt','util','../../config/logger','api','moment','bluebird','path'];(function(_0x4dbaad,_0x730318){var _0x226c72=function(_0x501972){while(--_0x501972){_0x4dbaad['push'](_0x4dbaad['shift']());}};_0x226c72(++_0x730318);}(_0x21c7,0x17a));var _0x721c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x21c7[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x721c('0x0'));var logger=require(_0x721c('0x1'))(_0x721c('0x2'));var moment=require(_0x721c('0x3'));var BPromise=require(_0x721c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x721c('0x5'));var rimraf=require('rimraf');var config=require(_0x721c('0x6'));var attributes=require(_0x721c('0x7'));module[_0x721c('0x8')]=function(_0x395477,_0x523768){return _0x395477[_0x721c('0x9')](_0x721c('0xa'),attributes,{'tableName':_0x721c('0xb'),'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 ceb9bdd..e5786e2 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 _0xa44f=['../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','request','then','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetVoiceQueueRtPauses','findAll','options','raw','where','literal','`paused`\x20=\x201,\x201,\x20null','ioredis'];(function(_0x322a07,_0x38b340){var _0x1b320e=function(_0x1ef169){while(--_0x1ef169){_0x322a07['push'](_0x322a07['shift']());}};_0x1b320e(++_0x38b340);}(_0xa44f,0x15b));var _0xfa44=function(_0x16e5b1,_0xe11346){_0x16e5b1=_0x16e5b1-0x0;var _0x4294d5=_0xa44f[_0x16e5b1];return _0x4294d5;};'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(_0xfa44('0x0'));var db=require(_0xfa44('0x1'))['db'];var utils=require(_0xfa44('0x2'));var logger=require('../../config/logger')('rpc');var config=require(_0xfa44('0x3'));var jayson=require(_0xfa44('0x4'));var client=jayson['client'][_0xfa44('0x5')]({'port':0x232a});config[_0xfa44('0x6')]=_[_0xfa44('0x7')](config[_0xfa44('0x6')],{'host':'localhost','port':0x18eb});var socket=require(_0xfa44('0x8'))(new Redis(config['redis']));require('./userVoiceQueueRt.socket')['register'](socket);function respondWithRpcPromise(_0x13f2a6,_0x4e2ecf,_0x104cf5){return new BPromise(function(_0x2ec05d,_0x403469){return client[_0xfa44('0x9')](_0x13f2a6,_0x104cf5)[_0xfa44('0xa')](function(_0x1d6ff0){logger['info'](_0xfa44('0xb'),_0x4e2ecf,_0xfa44('0xc'));logger[_0xfa44('0xd')](_0xfa44('0xe'),_0x4e2ecf,_0xfa44('0xc'),JSON[_0xfa44('0xf')](_0x1d6ff0));if(_0x1d6ff0['error']){if(_0x1d6ff0[_0xfa44('0x10')][_0xfa44('0x11')]===0x1f4){logger[_0xfa44('0x10')](_0xfa44('0xb'),_0x4e2ecf,_0x1d6ff0[_0xfa44('0x10')][_0xfa44('0x12')]);return _0x403469(_0x1d6ff0[_0xfa44('0x10')][_0xfa44('0x12')]);}logger[_0xfa44('0x10')](_0xfa44('0xb'),_0x4e2ecf,_0x1d6ff0['error'][_0xfa44('0x12')]);return _0x2ec05d(_0x1d6ff0['error']['message']);}else{logger[_0xfa44('0x13')](_0xfa44('0xb'),_0x4e2ecf,_0xfa44('0xc'));_0x2ec05d(_0x1d6ff0[_0xfa44('0x14')][_0xfa44('0x12')]);}})[_0xfa44('0x15')](function(_0x481e01){logger[_0xfa44('0x10')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x4e2ecf,_0x481e01);_0x403469(_0x481e01);});});}exports[_0xfa44('0x16')]=function(_0x1b4753){var _0x1b4e54=this;return new Promise(function(_0x47e318,_0x102ee2){return db['UserVoiceQueueRt'][_0xfa44('0x17')]({'raw':_0x1b4753[_0xfa44('0x18')]?_0x1b4753[_0xfa44('0x18')][_0xfa44('0x19')]===undefined?!![]:![]:!![],'where':_0x1b4753[_0xfa44('0x18')]?_0x1b4753[_0xfa44('0x18')][_0xfa44('0x1a')]||null:null,'attributes':[[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0xfa44('0x1b')](_0xfa44('0x1c')))),'outboundQueuePauses']]})[_0xfa44('0xa')](function(_0x46b77c){logger[_0xfa44('0x13')](_0xfa44('0x16'),_0x1b4753);logger[_0xfa44('0xd')](_0xfa44('0x16'),_0x1b4753,JSON['stringify'](_0x46b77c));_0x47e318(_0x46b77c);})[_0xfa44('0x15')](function(_0x314c3b){logger[_0xfa44('0x10')]('GetVoiceQueueRtPauses',_0x314c3b['message'],_0x1b4753);_0x102ee2(_0x1b4e54[_0xfa44('0x10')](0x1f4,_0x314c3b[_0xfa44('0x12')]));});});}; \ No newline at end of file +var _0x0923=['`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','redis','defaults','localhost','socket.io-emitter','./userVoiceQueueRt.socket','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','where','sequelize'];(function(_0x48b5e0,_0xb3826){var _0x4287ea=function(_0x14519e){while(--_0x14519e){_0x48b5e0['push'](_0x48b5e0['shift']());}};_0x4287ea(++_0xb3826);}(_0x0923,0x1bf));var _0x3092=function(_0xe91089,_0x387f2c){_0xe91089=_0xe91089-0x0;var _0x103491=_0x0923[_0xe91089];return _0x103491;};'use strict';var _=require(_0x3092('0x0'));var util=require(_0x3092('0x1'));var moment=require(_0x3092('0x2'));var BPromise=require(_0x3092('0x3'));var rs=require(_0x3092('0x4'));var fs=require('fs');var Redis=require(_0x3092('0x5'));var db=require(_0x3092('0x6'))['db'];var utils=require(_0x3092('0x7'));var logger=require(_0x3092('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x3092('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x3092('0xa')]=_[_0x3092('0xb')](config[_0x3092('0xa')],{'host':_0x3092('0xc'),'port':0x18eb});var socket=require(_0x3092('0xd'))(new Redis(config['redis']));require(_0x3092('0xe'))['register'](socket);function respondWithRpcPromise(_0x3744eb,_0x358e9f,_0x70fd44){return new BPromise(function(_0x172e1e,_0x2a2956){return client[_0x3092('0xf')](_0x3744eb,_0x70fd44)[_0x3092('0x10')](function(_0x20ab70){logger[_0x3092('0x11')](_0x3092('0x12'),_0x358e9f,_0x3092('0x13'));logger['debug'](_0x3092('0x14'),_0x358e9f,_0x3092('0x13'),JSON[_0x3092('0x15')](_0x20ab70));if(_0x20ab70[_0x3092('0x16')]){if(_0x20ab70['error'][_0x3092('0x17')]===0x1f4){logger[_0x3092('0x16')](_0x3092('0x12'),_0x358e9f,_0x20ab70['error'][_0x3092('0x18')]);return _0x2a2956(_0x20ab70['error']['message']);}logger[_0x3092('0x16')](_0x3092('0x12'),_0x358e9f,_0x20ab70[_0x3092('0x16')][_0x3092('0x18')]);return _0x172e1e(_0x20ab70['error'][_0x3092('0x18')]);}else{logger[_0x3092('0x11')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x358e9f,_0x3092('0x13'));_0x172e1e(_0x20ab70[_0x3092('0x19')][_0x3092('0x18')]);}})[_0x3092('0x1a')](function(_0xcaa4f2){logger['error'](_0x3092('0x12'),_0x358e9f,_0xcaa4f2);_0x2a2956(_0xcaa4f2);});});}exports[_0x3092('0x1b')]=function(_0x14a699){var _0x554f7d=this;return new Promise(function(_0x21b24f,_0xe9631f){return db[_0x3092('0x1c')][_0x3092('0x1d')]({'raw':_0x14a699[_0x3092('0x1e')]?_0x14a699[_0x3092('0x1e')][_0x3092('0x1f')]===undefined?!![]:![]:!![],'where':_0x14a699['options']?_0x14a699['options'][_0x3092('0x20')]||null:null,'attributes':[[db[_0x3092('0x21')]['fn']('COUNT',db[_0x3092('0x21')]['fn']('IF',db[_0x3092('0x21')]['literal'](_0x3092('0x22')))),_0x3092('0x23')]]})[_0x3092('0x10')](function(_0x59b395){logger[_0x3092('0x11')](_0x3092('0x1b'),_0x14a699);logger[_0x3092('0x24')](_0x3092('0x1b'),_0x14a699,JSON[_0x3092('0x15')](_0x59b395));_0x21b24f(_0x59b395);})[_0x3092('0x1a')](function(_0xd15cea){logger[_0x3092('0x16')](_0x3092('0x1b'),_0xd15cea[_0x3092('0x18')],_0x14a699);_0xe9631f(_0x554f7d[_0x3092('0x16')](0x1f4,_0xd15cea[_0x3092('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index c81bcf1..fbe0970 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 _0xc7b3=['update','emit','removeListener','register','length','userVoiceQueueRt:','./userVoiceQueueRt.events','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc7b3,0x1c6));var _0x3c7b=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0xc7b3[_0x209941];return _0x1e8729;};'use strict';var UserVoiceQueueRtEvents=require(_0x3c7b('0x0'));var events=[_0x3c7b('0x1'),'remove',_0x3c7b('0x2')];function createListener(_0x3715e2,_0xb36be3){return function(_0x46ed4b){_0xb36be3[_0x3c7b('0x3')](_0x3715e2,_0x46ed4b);};}function removeListener(_0x8cbc50,_0x48ad4b){return function(){UserVoiceQueueRtEvents[_0x3c7b('0x4')](_0x8cbc50,_0x48ad4b);};}exports[_0x3c7b('0x5')]=function(_0x1fa371){for(var _0x55975f=0x0,_0x314af1=events[_0x3c7b('0x6')];_0x55975f<_0x314af1;_0x55975f++){var _0x536df8=events[_0x55975f];var _0x2777d9=createListener(_0x3c7b('0x7')+_0x536df8,_0x1fa371);UserVoiceQueueRtEvents['on'](_0x536df8,_0x2777d9);}}; \ No newline at end of file +var _0x0d4d=['remove','update','emit','removeListener','userVoiceQueueRt:','./userVoiceQueueRt.events','save'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x0d4d,0x132));var _0xd0d4=function(_0xc5d594,_0x237dd2){_0xc5d594=_0xc5d594-0x0;var _0x3e408a=_0x0d4d[_0xc5d594];return _0x3e408a;};'use strict';var UserVoiceQueueRtEvents=require(_0xd0d4('0x0'));var events=[_0xd0d4('0x1'),_0xd0d4('0x2'),_0xd0d4('0x3')];function createListener(_0x1f74ab,_0x1515e0){return function(_0x4d5c19){_0x1515e0[_0xd0d4('0x4')](_0x1f74ab,_0x4d5c19);};}function removeListener(_0x58909f,_0x2e99ee){return function(){UserVoiceQueueRtEvents[_0xd0d4('0x5')](_0x58909f,_0x2e99ee);};}exports['register']=function(_0x34d93b){for(var _0x3db5ab=0x0,_0x1c5d01=events['length'];_0x3db5ab<_0x1c5d01;_0x3db5ab++){var _0x5bfae8=events[_0x3db5ab];var _0x5403c0=createListener(_0xd0d4('0x6')+_0x5bfae8,_0x34d93b);UserVoiceQueueRtEvents['on'](_0x5bfae8,_0x5403c0);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index 3c94292..efdc37d 100644 --- a/server/api/userWhatsappQueue/index.js +++ b/server/api/userWhatsappQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x4e12f3,_0x235119){var _0x19c01e=function(_0x4366e7){while(--_0x4366e7){_0x4e12f3['push'](_0x4e12f3['shift']());}};_0x19c01e(++_0x235119);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x2fd9e5,_0x43f94d){var _0x4f6c5a=function(_0x120afd){while(--_0x120afd){_0x2fd9e5['push'](_0x2fd9e5['shift']());}};_0x4f6c5a(++_0x43f94d);}(_0xe706,0xa3));var _0x6e70=function(_0x3a4c07,_0x18440c){_0x3a4c07=_0x3a4c07-0x0;var _0x5a4943=_0xe706[_0x3a4c07];return _0x5a4943;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index 22a7911..11ae20e 100644 --- a/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js +++ b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x364f=['sequelize','INTEGER'];(function(_0x220dbb,_0x99328d){var _0x2b77de=function(_0x15e966){while(--_0x15e966){_0x220dbb['push'](_0x220dbb['shift']());}};_0x2b77de(++_0x99328d);}(_0x364f,0x16e));var _0xf364=function(_0x271060,_0x3f86b1){_0x271060=_0x271060-0x0;var _0x40540b=_0x364f[_0x271060];return _0x40540b;};'use strict';var Sequelize=require(_0xf364('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xf364('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x6068=['exports','INTEGER'];(function(_0x4bf565,_0x420d33){var _0x30e15f=function(_0x91a47f){while(--_0x91a47f){_0x4bf565['push'](_0x4bf565['shift']());}};_0x30e15f(++_0x420d33);}(_0x6068,0x134));var _0x8606=function(_0x2a3f50,_0x3bcfb8){_0x2a3f50=_0x2a3f50-0x0;var _0x5d44bd=_0x6068[_0x2a3f50];return _0x5d44bd;};'use strict';var Sequelize=require('sequelize');module[_0x8606('0x0')]={'penalty':{'type':Sequelize[_0x8606('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.model.js b/server/api/userWhatsappQueue/userWhatsappQueue.model.js index 8b761ba..3854cb8 100644 --- a/server/api/userWhatsappQueue/userWhatsappQueue.model.js +++ b/server/api/userWhatsappQueue/userWhatsappQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5371=['UserWhatsappQueue','user_has_whatsapp_queues','lodash','util','api','bluebird','rimraf','../../config/environment','./userWhatsappQueue.attributes','exports','define'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0x5371,0x162));var _0x1537=function(_0x8a99e8,_0x4d03a6){_0x8a99e8=_0x8a99e8-0x0;var _0x5c78ad=_0x5371[_0x8a99e8];return _0x5c78ad;};'use strict';var _=require(_0x1537('0x0'));var util=require(_0x1537('0x1'));var logger=require('../../config/logger')(_0x1537('0x2'));var moment=require('moment');var BPromise=require(_0x1537('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x1537('0x4'));var config=require(_0x1537('0x5'));var attributes=require(_0x1537('0x6'));module[_0x1537('0x7')]=function(_0x3ade7d,_0x1b43c1){return _0x3ade7d[_0x1537('0x8')](_0x1537('0x9'),attributes,{'tableName':_0x1537('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf176=['user_has_whatsapp_queues','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','exports','define','UserWhatsappQueue'];(function(_0x25df80,_0xa2aec5){var _0x17b6d0=function(_0x446155){while(--_0x446155){_0x25df80['push'](_0x25df80['shift']());}};_0x17b6d0(++_0xa2aec5);}(_0xf176,0x1a3));var _0x6f17=function(_0x35e540,_0x12673f){_0x35e540=_0x35e540-0x0;var _0xb61c64=_0xf176[_0x35e540];return _0xb61c64;};'use strict';var _=require('lodash');var util=require(_0x6f17('0x0'));var logger=require(_0x6f17('0x1'))('api');var moment=require(_0x6f17('0x2'));var BPromise=require(_0x6f17('0x3'));var rp=require(_0x6f17('0x4'));var fs=require('fs');var path=require(_0x6f17('0x5'));var rimraf=require('rimraf');var config=require(_0x6f17('0x6'));var attributes=require('./userWhatsappQueue.attributes');module[_0x6f17('0x7')]=function(_0x4d693f,_0x1e5301){return _0x4d693f[_0x6f17('0x8')](_0x6f17('0x9'),attributes,{'tableName':_0x6f17('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js b/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js index 5f6e296..8bf09d4 100644 --- a/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js +++ b/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x61b2=['message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x3770a8,_0x180b59){var _0xa01bca=function(_0x258492){while(--_0x258492){_0x3770a8['push'](_0x3770a8['shift']());}};_0xa01bca(++_0x180b59);}(_0x61b2,0xa3));var _0x261b=function(_0x222d08,_0x543b4e){_0x222d08=_0x222d08-0x0;var _0x272c03=_0x61b2[_0x222d08];return _0x272c03;};'use strict';var _=require(_0x261b('0x0'));var util=require(_0x261b('0x1'));var moment=require('moment');var BPromise=require(_0x261b('0x2'));var rs=require(_0x261b('0x3'));var fs=require('fs');var Redis=require(_0x261b('0x4'));var db=require(_0x261b('0x5'))['db'];var utils=require(_0x261b('0x6'));var logger=require(_0x261b('0x7'))(_0x261b('0x8'));var config=require(_0x261b('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x261b('0xa')][_0x261b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1c1d5e,_0x161235,_0x2e3983){return new BPromise(function(_0x10e630,_0x3e74a6){return client['request'](_0x1c1d5e,_0x2e3983)[_0x261b('0xc')](function(_0x307b75){logger[_0x261b('0xd')](_0x261b('0xe'),_0x161235,_0x261b('0xf'));logger[_0x261b('0x10')](_0x261b('0x11'),_0x161235,_0x261b('0xf'),JSON[_0x261b('0x12')](_0x307b75));if(_0x307b75[_0x261b('0x13')]){if(_0x307b75['error'][_0x261b('0x14')]===0x1f4){logger[_0x261b('0x13')]('UserWhatsappQueue,\x20%s,\x20%s',_0x161235,_0x307b75['error']['message']);return _0x3e74a6(_0x307b75[_0x261b('0x13')][_0x261b('0x15')]);}logger['error'](_0x261b('0xe'),_0x161235,_0x307b75[_0x261b('0x13')][_0x261b('0x15')]);return _0x10e630(_0x307b75[_0x261b('0x13')]['message']);}else{logger['info'](_0x261b('0xe'),_0x161235,'request\x20sent');_0x10e630(_0x307b75['result'][_0x261b('0x15')]);}})[_0x261b('0x16')](function(_0x318782){logger[_0x261b('0x13')](_0x261b('0xe'),_0x161235,_0x318782);_0x3e74a6(_0x318782);});});} \ No newline at end of file +var _0x2858=['moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','request','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash'];(function(_0x41264c,_0x1cb166){var _0x16d0cd=function(_0x2bfb9c){while(--_0x2bfb9c){_0x41264c['push'](_0x41264c['shift']());}};_0x16d0cd(++_0x1cb166);}(_0x2858,0x18e));var _0x8285=function(_0x2a96a3,_0x30383b){_0x2a96a3=_0x2a96a3-0x0;var _0x3df29c=_0x2858[_0x2a96a3];return _0x3df29c;};'use strict';var _=require(_0x8285('0x0'));var util=require('util');var moment=require(_0x8285('0x1'));var BPromise=require(_0x8285('0x2'));var rs=require(_0x8285('0x3'));var fs=require('fs');var Redis=require(_0x8285('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8285('0x5'))(_0x8285('0x6'));var config=require(_0x8285('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x38848f,_0x4db90a,_0x29b7d4){return new BPromise(function(_0x278bc0,_0x4d44a9){return client[_0x8285('0x8')](_0x38848f,_0x29b7d4)['then'](function(_0xbff153){logger[_0x8285('0x9')](_0x8285('0xa'),_0x4db90a,_0x8285('0xb'));logger[_0x8285('0xc')](_0x8285('0xd'),_0x4db90a,_0x8285('0xb'),JSON['stringify'](_0xbff153));if(_0xbff153[_0x8285('0xe')]){if(_0xbff153[_0x8285('0xe')][_0x8285('0xf')]===0x1f4){logger['error']('UserWhatsappQueue,\x20%s,\x20%s',_0x4db90a,_0xbff153[_0x8285('0xe')][_0x8285('0x10')]);return _0x4d44a9(_0xbff153[_0x8285('0xe')][_0x8285('0x10')]);}logger[_0x8285('0xe')](_0x8285('0xa'),_0x4db90a,_0xbff153[_0x8285('0xe')][_0x8285('0x10')]);return _0x278bc0(_0xbff153[_0x8285('0xe')]['message']);}else{logger['info'](_0x8285('0xa'),_0x4db90a,_0x8285('0xb'));_0x278bc0(_0xbff153[_0x8285('0x11')]['message']);}})[_0x8285('0x12')](function(_0x442d61){logger[_0x8285('0xe')]('UserWhatsappQueue,\x20%s,\x20%s',_0x4db90a,_0x442d61);_0x4d44a9(_0x442d61);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 682e0aa..2a24123 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 _0x9f62=['show','exports','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./variable.controller','get','index','/:id','isAuthenticated'];(function(_0x557c34,_0x2356b9){var _0x17e2f7=function(_0x2ca4a1){while(--_0x2ca4a1){_0x557c34['push'](_0x557c34['shift']());}};_0x17e2f7(++_0x2356b9);}(_0x9f62,0x154));var _0x29f6=function(_0x84ffe9,_0x50bc1e){_0x84ffe9=_0x84ffe9-0x0;var _0x2f7707=_0x9f62[_0x84ffe9];return _0x2f7707;};'use strict';var multer=require('multer');var util=require(_0x29f6('0x0'));var path=require('path');var timeout=require(_0x29f6('0x1'));var express=require(_0x29f6('0x2'));var router=express[_0x29f6('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x29f6('0x4'));var config=require(_0x29f6('0x5'));var controller=require(_0x29f6('0x6'));router[_0x29f6('0x7')]('/',auth['isAuthenticated'](),controller[_0x29f6('0x8')]);router[_0x29f6('0x7')](_0x29f6('0x9'),auth[_0x29f6('0xa')](),controller[_0x29f6('0xb')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x29f6('0x9'),auth[_0x29f6('0xa')](),controller['update']);router['delete'](_0x29f6('0x9'),auth[_0x29f6('0xa')](),controller['destroy']);module[_0x29f6('0xc')]=router; \ No newline at end of file +var _0x26bc=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./variable.controller','isAuthenticated','index','get','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','path'];(function(_0x4bab60,_0x168a38){var _0x2b9881=function(_0x2ffbd4){while(--_0x2ffbd4){_0x4bab60['push'](_0x4bab60['shift']());}};_0x2b9881(++_0x168a38);}(_0x26bc,0x162));var _0xc26b=function(_0x596092,_0x5af25a){_0x596092=_0x596092-0x0;var _0x2e4f0c=_0x26bc[_0x596092];return _0x2e4f0c;};'use strict';var multer=require(_0xc26b('0x0'));var util=require(_0xc26b('0x1'));var path=require(_0xc26b('0x2'));var timeout=require(_0xc26b('0x3'));var express=require(_0xc26b('0x4'));var router=express['Router']();var fs_extra=require(_0xc26b('0x5'));var auth=require(_0xc26b('0x6'));var interaction=require(_0xc26b('0x7'));var config=require('../../config/environment');var controller=require(_0xc26b('0x8'));router['get']('/',auth[_0xc26b('0x9')](),controller[_0xc26b('0xa')]);router[_0xc26b('0xb')]('/:id',auth[_0xc26b('0x9')](),controller[_0xc26b('0xc')]);router[_0xc26b('0xd')]('/',auth[_0xc26b('0x9')](),controller[_0xc26b('0xe')]);router[_0xc26b('0xf')](_0xc26b('0x10'),auth[_0xc26b('0x9')](),controller[_0xc26b('0x11')]);router[_0xc26b('0x12')]('/:id',auth[_0xc26b('0x9')](),controller[_0xc26b('0x13')]);module[_0xc26b('0x14')]=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index d0139f4..13d9629 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 _0x810c=['STRING','sequelize','exports','name'];(function(_0x3a7949,_0x5ff89){var _0x56df57=function(_0x35c6f8){while(--_0x35c6f8){_0x3a7949['push'](_0x3a7949['shift']());}};_0x56df57(++_0x5ff89);}(_0x810c,0x1a5));var _0xc810=function(_0xd6b1af,_0xe08a3d){_0xd6b1af=_0xd6b1af-0x0;var _0x11432c=_0x810c[_0xd6b1af];return _0x11432c;};'use strict';var Sequelize=require(_0xc810('0x0'));module[_0xc810('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xc810('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xc810('0x3')]}}; \ No newline at end of file +var _0x52e1=['STRING'];(function(_0x408098,_0x1808d8){var _0x1cb2bf=function(_0x95584){while(--_0x95584){_0x408098['push'](_0x408098['shift']());}};_0x1cb2bf(++_0x1808d8);}(_0x52e1,0xb9));var _0x152e=function(_0x1a13b1,_0x4d1d25){_0x1a13b1=_0x1a13b1-0x0;var _0x395e05=_0x52e1[_0x1a13b1];return _0x395e05;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x152e('0x0')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x152e('0x0')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index 55ce0d1..0cd3712 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 _0x2dc3=['merge','VIRTUAL','filter','options','rows','params','length','includeAll','include','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','json','offset','limit','count','apply','reject','save','update','then','destroy','Variables','UserProfileResource','error','stack','name','send','index','map','Variable','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x153049,_0x3b9df4){var _0x39c783=function(_0x7641d0){while(--_0x7641d0){_0x153049['push'](_0x153049['shift']());}};_0x39c783(++_0x3b9df4);}(_0x2dc3,0xb8));var _0x32dc=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x2dc3[_0x1facfa];return _0x9ec701;};'use strict';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('mustache');var util=require('util');var path=require(_0x32dc('0x7'));var sox=require('sox');var csv=require(_0x32dc('0x8'));var ejs=require(_0x32dc('0x9'));var fs=require('fs');var fs_extra=require(_0x32dc('0xa'));var _=require(_0x32dc('0xb'));var squel=require(_0x32dc('0xc'));var crypto=require(_0x32dc('0xd'));var jsforce=require(_0x32dc('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x32dc('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x32dc('0xf'));var authService=require(_0x32dc('0x10'));var qs=require(_0x32dc('0x11'));var as=require(_0x32dc('0x12'));var hardwareService=require(_0x32dc('0x13'));var logger=require(_0x32dc('0x14'))(_0x32dc('0x15'));var utils=require('../../config/utils');var config=require(_0x32dc('0x16'));var licenseUtil=require(_0x32dc('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x7b548d,_0xdf003c){_0xdf003c=_0xdf003c||0xcc;return function(_0x4e3c03){if(_0x4e3c03){return _0x7b548d[_0x32dc('0x18')](_0xdf003c);}return _0x7b548d[_0x32dc('0x19')](_0xdf003c)['end']();};}function respondWithResult(_0x3982b2,_0x582b31){_0x582b31=_0x582b31||0xc8;return function(_0x3cce68){if(_0x3cce68){return _0x3982b2[_0x32dc('0x19')](_0x582b31)[_0x32dc('0x1a')](_0x3cce68);}};}function respondWithFilteredResult(_0x48a61a,_0x58f947){return function(_0x15e487){if(_0x15e487){var _0x108fb2=typeof _0x58f947[_0x32dc('0x1b')]==='undefined'&&typeof _0x58f947[_0x32dc('0x1c')]==='undefined';var _0x54b3b8=_0x15e487[_0x32dc('0x1d')];var _0x5426e5=_0x108fb2?0x0:_0x58f947[_0x32dc('0x1b')];var _0x1af156=_0x108fb2?_0x15e487[_0x32dc('0x1d')]:_0x58f947['offset']+_0x58f947[_0x32dc('0x1c')];var _0x38f056;if(_0x1af156>=_0x54b3b8){_0x1af156=_0x54b3b8;_0x38f056=0xc8;}else{_0x38f056=0xce;}_0x48a61a[_0x32dc('0x19')](_0x38f056);return _0x48a61a['set']('Content-Range',_0x5426e5+'-'+_0x1af156+'/'+_0x54b3b8)[_0x32dc('0x1a')](_0x15e487);}return null;};}function patchUpdates(_0x5bbd8){return function(_0x2ad2d9){try{jsonpatch[_0x32dc('0x1e')](_0x2ad2d9,_0x5bbd8,!![]);}catch(_0x36318f){return BPromise[_0x32dc('0x1f')](_0x36318f);}return _0x2ad2d9[_0x32dc('0x20')]();};}function saveUpdates(_0x51dfe1,_0xd150a7){return function(_0x5421dd){if(_0x5421dd){return _0x5421dd[_0x32dc('0x21')](_0x51dfe1)[_0x32dc('0x22')](function(_0x2f6097){return _0x2f6097;});}return null;};}function removeEntity(_0x81c30b,_0x18734d){return function(_0x5df6ba){if(_0x5df6ba){return _0x5df6ba[_0x32dc('0x23')]()[_0x32dc('0x22')](function(){var _0x160bb1=_0x5df6ba['get']({'plain':!![]});var _0x34da32=_0x32dc('0x24');return db[_0x32dc('0x25')][_0x32dc('0x23')]({'where':{'type':_0x34da32,'resourceId':_0x160bb1['id']}})[_0x32dc('0x22')](function(){return _0x5df6ba;});})['then'](function(){_0x81c30b[_0x32dc('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2315ef,_0x2a6123){return function(_0x628a80){if(!_0x628a80){_0x2315ef[_0x32dc('0x18')](0x194);}return _0x628a80;};}function handleError(_0xde1943,_0x5ee10f){_0x5ee10f=_0x5ee10f||0x1f4;return function(_0x26c5ac){logger[_0x32dc('0x26')](_0x26c5ac[_0x32dc('0x27')]);if(_0x26c5ac[_0x32dc('0x28')]){delete _0x26c5ac[_0x32dc('0x28')];}_0xde1943[_0x32dc('0x19')](_0x5ee10f)[_0x32dc('0x29')](_0x26c5ac);};}exports[_0x32dc('0x2a')]=function(_0x52f602,_0x184430){var _0x3f9800={},_0x25328c={},_0x51b52c={'count':0x0,'rows':[]};var _0x19d18f=_[_0x32dc('0x2b')](db[_0x32dc('0x2c')][_0x32dc('0x2d')],function(_0x59538c){return{'name':_0x59538c[_0x32dc('0x2e')],'type':_0x59538c[_0x32dc('0x2f')][_0x32dc('0x30')]};});_0x25328c[_0x32dc('0x31')]=_['map'](_0x19d18f,_0x32dc('0x28'));_0x25328c[_0x32dc('0x32')]=_[_0x32dc('0x33')](_0x52f602[_0x32dc('0x32')]);_0x25328c[_0x32dc('0x34')]=_['intersection'](_0x25328c[_0x32dc('0x31')],_0x25328c['query']);_0x3f9800['attributes']=_[_0x32dc('0x35')](_0x25328c[_0x32dc('0x31')],qs[_0x32dc('0x36')](_0x52f602[_0x32dc('0x32')][_0x32dc('0x36')]));_0x3f9800['attributes']=_0x3f9800[_0x32dc('0x37')]['length']?_0x3f9800[_0x32dc('0x37')]:_0x25328c[_0x32dc('0x31')];if(!_0x52f602[_0x32dc('0x32')][_0x32dc('0x38')](_0x32dc('0x39'))){_0x3f9800[_0x32dc('0x1c')]=qs['limit'](_0x52f602[_0x32dc('0x32')][_0x32dc('0x1c')]);_0x3f9800[_0x32dc('0x1b')]=qs[_0x32dc('0x1b')](_0x52f602[_0x32dc('0x32')]['offset']);}_0x3f9800[_0x32dc('0x3a')]=qs['sort'](_0x52f602[_0x32dc('0x32')][_0x32dc('0x3b')]);_0x3f9800[_0x32dc('0x3c')]=qs[_0x32dc('0x34')](_[_0x32dc('0x3d')](_0x52f602['query'],_0x25328c[_0x32dc('0x34')]),_0x19d18f);if(_0x52f602[_0x32dc('0x32')]['filter']){_0x3f9800[_0x32dc('0x3c')]=_[_0x32dc('0x3e')](_0x3f9800[_0x32dc('0x3c')],{'$or':_[_0x32dc('0x2b')](_0x19d18f,function(_0x509b6d){if(_0x509b6d['type']!==_0x32dc('0x3f')){var _0x46ae98={};_0x46ae98[_0x509b6d[_0x32dc('0x28')]]={'$like':'%'+_0x52f602['query'][_0x32dc('0x40')]+'%'};return _0x46ae98;}})});}_0x3f9800=_[_0x32dc('0x3e')]({},_0x3f9800,_0x52f602[_0x32dc('0x41')]);var _0x5c5f19={'where':_0x3f9800['where']};return db[_0x32dc('0x2c')][_0x32dc('0x1d')](_0x5c5f19)[_0x32dc('0x22')](function(_0x26466e){_0x51b52c['count']=_0x26466e;if(_0x52f602[_0x32dc('0x32')]['includeAll']){_0x3f9800['include']=[{'all':!![]}];}return db[_0x32dc('0x2c')]['findAll'](_0x3f9800);})[_0x32dc('0x22')](function(_0x77742a){_0x51b52c[_0x32dc('0x42')]=_0x77742a;return _0x51b52c;})[_0x32dc('0x22')](respondWithFilteredResult(_0x184430,_0x3f9800))['catch'](handleError(_0x184430,null));};exports['show']=function(_0x36c694,_0x582719){var _0x9d2f8a={'raw':!![],'where':{'id':_0x36c694[_0x32dc('0x43')]['id']}},_0x371094={};_0x371094[_0x32dc('0x31')]=_[_0x32dc('0x33')](db['Variable'][_0x32dc('0x2d')]);_0x371094[_0x32dc('0x32')]=_[_0x32dc('0x33')](_0x36c694[_0x32dc('0x32')]);_0x371094[_0x32dc('0x34')]=_[_0x32dc('0x35')](_0x371094[_0x32dc('0x31')],_0x371094[_0x32dc('0x32')]);_0x9d2f8a[_0x32dc('0x37')]=_[_0x32dc('0x35')](_0x371094[_0x32dc('0x31')],qs[_0x32dc('0x36')](_0x36c694[_0x32dc('0x32')]['fields']));_0x9d2f8a[_0x32dc('0x37')]=_0x9d2f8a['attributes'][_0x32dc('0x44')]?_0x9d2f8a[_0x32dc('0x37')]:_0x371094[_0x32dc('0x31')];if(_0x36c694[_0x32dc('0x32')][_0x32dc('0x45')]){_0x9d2f8a[_0x32dc('0x46')]=[{'all':!![]}];}_0x9d2f8a=_[_0x32dc('0x3e')]({},_0x9d2f8a,_0x36c694[_0x32dc('0x41')]);return db[_0x32dc('0x2c')][_0x32dc('0x47')](_0x9d2f8a)['then'](handleEntityNotFound(_0x582719,null))[_0x32dc('0x22')](respondWithResult(_0x582719,null))[_0x32dc('0x48')](handleError(_0x582719,null));};exports[_0x32dc('0x49')]=function(_0xf0bf5e,_0x1ac706){return db[_0x32dc('0x2c')][_0x32dc('0x49')](_0xf0bf5e[_0x32dc('0x4a')],{})['then'](function(_0x5f42d3){var _0x49790d=_0xf0bf5e[_0x32dc('0x4b')][_0x32dc('0x4c')]({'plain':!![]});if(!_0x49790d)throw new Error(_0x32dc('0x4d'));if(_0x49790d['role']===_0x32dc('0x4b')){var _0x149c5a=_0x5f42d3[_0x32dc('0x4c')]({'plain':!![]});var _0x1e5b11=_0x32dc('0x24');return db[_0x32dc('0x4e')]['find']({'where':{'name':_0x1e5b11,'userProfileId':_0x49790d[_0x32dc('0x4f')]},'raw':!![]})[_0x32dc('0x22')](function(_0x5930f3){if(_0x5930f3&&_0x5930f3[_0x32dc('0x50')]===0x0){return db[_0x32dc('0x25')][_0x32dc('0x49')]({'name':_0x149c5a[_0x32dc('0x28')],'resourceId':_0x149c5a['id'],'type':_0x5930f3[_0x32dc('0x28')],'sectionId':_0x5930f3['id']},{})[_0x32dc('0x22')](function(){return _0x5f42d3;});}else{return _0x5f42d3;}})[_0x32dc('0x48')](function(_0x2884df){logger[_0x32dc('0x26')](_0x32dc('0x51'),_0x2884df);throw _0x2884df;});}return _0x5f42d3;})['then'](respondWithResult(_0x1ac706,0xc9))[_0x32dc('0x48')](handleError(_0x1ac706,null));};exports[_0x32dc('0x21')]=function(_0x2159e7,_0x53ce69){if(_0x2159e7[_0x32dc('0x4a')]['id']){delete _0x2159e7[_0x32dc('0x4a')]['id'];}return db[_0x32dc('0x2c')][_0x32dc('0x47')]({'where':{'id':_0x2159e7[_0x32dc('0x43')]['id']}})[_0x32dc('0x22')](handleEntityNotFound(_0x53ce69,null))[_0x32dc('0x22')](saveUpdates(_0x2159e7[_0x32dc('0x4a')],null))['then'](respondWithResult(_0x53ce69,null))[_0x32dc('0x48')](handleError(_0x53ce69,null));};exports[_0x32dc('0x23')]=function(_0x14ad22,_0x6733e6){return db[_0x32dc('0x2c')][_0x32dc('0x47')]({'where':{'id':_0x14ad22['params']['id']}})[_0x32dc('0x22')](handleEntityNotFound(_0x6733e6,null))[_0x32dc('0x22')](removeEntity(_0x6733e6,null))[_0x32dc('0x48')](handleError(_0x6733e6,null));}; \ No newline at end of file +var _0x2775=['save','update','then','destroy','Variables','UserProfileResource','sendStatus','error','stack','name','send','index','map','Variable','rawAttributes','type','key','model','query','attributes','fields','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','include','findAll','catch','show','params','keys','intersection','length','includeAll','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','end','status','json','offset','undefined','limit','count','Content-Range','reject'];(function(_0x55ba9a,_0x363d77){var _0x334b35=function(_0x1548a0){while(--_0x1548a0){_0x55ba9a['push'](_0x55ba9a['shift']());}};_0x334b35(++_0x363d77);}(_0x2775,0x113));var _0x5277=function(_0x30c649,_0x2ebbac){_0x30c649=_0x30c649-0x0;var _0x3edfb9=_0x2775[_0x30c649];return _0x3edfb9;};'use strict';var emlformat=require(_0x5277('0x0'));var rimraf=require(_0x5277('0x1'));var zipdir=require(_0x5277('0x2'));var jsonpatch=require(_0x5277('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5277('0x4'));var Mustache=require(_0x5277('0x5'));var util=require(_0x5277('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x5277('0x7'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5277('0x8'));var Papa=require(_0x5277('0x9'));var Redis=require(_0x5277('0xa'));var authService=require(_0x5277('0xb'));var qs=require(_0x5277('0xc'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5277('0xd'));var logger=require('../../config/logger')(_0x5277('0xe'));var utils=require('../../config/utils');var config=require(_0x5277('0xf'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5806dc,_0x56171c){_0x56171c=_0x56171c||0xcc;return function(_0x2dc4fe){if(_0x2dc4fe){return _0x5806dc['sendStatus'](_0x56171c);}return _0x5806dc['status'](_0x56171c)[_0x5277('0x10')]();};}function respondWithResult(_0x48fb1b,_0x4bc03f){_0x4bc03f=_0x4bc03f||0xc8;return function(_0x2a35a9){if(_0x2a35a9){return _0x48fb1b[_0x5277('0x11')](_0x4bc03f)[_0x5277('0x12')](_0x2a35a9);}};}function respondWithFilteredResult(_0x28f714,_0x475b89){return function(_0x4802e2){if(_0x4802e2){var _0x23f1c4=typeof _0x475b89[_0x5277('0x13')]===_0x5277('0x14')&&typeof _0x475b89[_0x5277('0x15')]===_0x5277('0x14');var _0x1917c8=_0x4802e2[_0x5277('0x16')];var _0x498f68=_0x23f1c4?0x0:_0x475b89[_0x5277('0x13')];var _0x12acf6=_0x23f1c4?_0x4802e2[_0x5277('0x16')]:_0x475b89[_0x5277('0x13')]+_0x475b89[_0x5277('0x15')];var _0x9a1278;if(_0x12acf6>=_0x1917c8){_0x12acf6=_0x1917c8;_0x9a1278=0xc8;}else{_0x9a1278=0xce;}_0x28f714['status'](_0x9a1278);return _0x28f714['set'](_0x5277('0x17'),_0x498f68+'-'+_0x12acf6+'/'+_0x1917c8)['json'](_0x4802e2);}return null;};}function patchUpdates(_0x31fedc){return function(_0x2751c6){try{jsonpatch['apply'](_0x2751c6,_0x31fedc,!![]);}catch(_0xf649d5){return BPromise[_0x5277('0x18')](_0xf649d5);}return _0x2751c6[_0x5277('0x19')]();};}function saveUpdates(_0x5dd51c,_0x31889a){return function(_0x38a204){if(_0x38a204){return _0x38a204[_0x5277('0x1a')](_0x5dd51c)[_0x5277('0x1b')](function(_0x583525){return _0x583525;});}return null;};}function removeEntity(_0x19d35b,_0x560911){return function(_0x1cfe34){if(_0x1cfe34){return _0x1cfe34[_0x5277('0x1c')]()[_0x5277('0x1b')](function(){var _0x3c99cd=_0x1cfe34['get']({'plain':!![]});var _0x52191a=_0x5277('0x1d');return db[_0x5277('0x1e')][_0x5277('0x1c')]({'where':{'type':_0x52191a,'resourceId':_0x3c99cd['id']}})[_0x5277('0x1b')](function(){return _0x1cfe34;});})[_0x5277('0x1b')](function(){_0x19d35b[_0x5277('0x11')](0xcc)[_0x5277('0x10')]();});}};}function handleEntityNotFound(_0x4e4237,_0x745305){return function(_0x5441d2){if(!_0x5441d2){_0x4e4237[_0x5277('0x1f')](0x194);}return _0x5441d2;};}function handleError(_0x3d8f31,_0x5cc81f){_0x5cc81f=_0x5cc81f||0x1f4;return function(_0x3e7b7e){logger[_0x5277('0x20')](_0x3e7b7e[_0x5277('0x21')]);if(_0x3e7b7e[_0x5277('0x22')]){delete _0x3e7b7e[_0x5277('0x22')];}_0x3d8f31[_0x5277('0x11')](_0x5cc81f)[_0x5277('0x23')](_0x3e7b7e);};}exports[_0x5277('0x24')]=function(_0x539345,_0x391d7c){var _0x15a426={},_0x389a55={},_0x4caeee={'count':0x0,'rows':[]};var _0x439ba7=_[_0x5277('0x25')](db[_0x5277('0x26')][_0x5277('0x27')],function(_0x2818e4){return{'name':_0x2818e4['fieldName'],'type':_0x2818e4[_0x5277('0x28')][_0x5277('0x29')]};});_0x389a55[_0x5277('0x2a')]=_[_0x5277('0x25')](_0x439ba7,_0x5277('0x22'));_0x389a55[_0x5277('0x2b')]=_['keys'](_0x539345[_0x5277('0x2b')]);_0x389a55['filters']=_['intersection'](_0x389a55[_0x5277('0x2a')],_0x389a55[_0x5277('0x2b')]);_0x15a426[_0x5277('0x2c')]=_['intersection'](_0x389a55[_0x5277('0x2a')],qs[_0x5277('0x2d')](_0x539345[_0x5277('0x2b')][_0x5277('0x2d')]));_0x15a426[_0x5277('0x2c')]=_0x15a426[_0x5277('0x2c')]['length']?_0x15a426['attributes']:_0x389a55[_0x5277('0x2a')];if(!_0x539345[_0x5277('0x2b')]['hasOwnProperty'](_0x5277('0x2e'))){_0x15a426['limit']=qs[_0x5277('0x15')](_0x539345[_0x5277('0x2b')][_0x5277('0x15')]);_0x15a426['offset']=qs[_0x5277('0x13')](_0x539345[_0x5277('0x2b')]['offset']);}_0x15a426[_0x5277('0x2f')]=qs['sort'](_0x539345[_0x5277('0x2b')][_0x5277('0x30')]);_0x15a426[_0x5277('0x31')]=qs[_0x5277('0x32')](_[_0x5277('0x33')](_0x539345[_0x5277('0x2b')],_0x389a55['filters']),_0x439ba7);if(_0x539345[_0x5277('0x2b')]['filter']){_0x15a426[_0x5277('0x31')]=_[_0x5277('0x34')](_0x15a426['where'],{'$or':_[_0x5277('0x25')](_0x439ba7,function(_0x3127a7){if(_0x3127a7[_0x5277('0x28')]!==_0x5277('0x35')){var _0x2221df={};_0x2221df[_0x3127a7[_0x5277('0x22')]]={'$like':'%'+_0x539345[_0x5277('0x2b')][_0x5277('0x36')]+'%'};return _0x2221df;}})});}_0x15a426=_[_0x5277('0x34')]({},_0x15a426,_0x539345[_0x5277('0x37')]);var _0x4ea794={'where':_0x15a426[_0x5277('0x31')]};return db[_0x5277('0x26')][_0x5277('0x16')](_0x4ea794)['then'](function(_0x5d63d9){_0x4caeee[_0x5277('0x16')]=_0x5d63d9;if(_0x539345[_0x5277('0x2b')]['includeAll']){_0x15a426[_0x5277('0x38')]=[{'all':!![]}];}return db[_0x5277('0x26')][_0x5277('0x39')](_0x15a426);})[_0x5277('0x1b')](function(_0x55ed45){_0x4caeee['rows']=_0x55ed45;return _0x4caeee;})['then'](respondWithFilteredResult(_0x391d7c,_0x15a426))[_0x5277('0x3a')](handleError(_0x391d7c,null));};exports[_0x5277('0x3b')]=function(_0x1f5f88,_0x2c4e44){var _0x594029={'raw':!![],'where':{'id':_0x1f5f88[_0x5277('0x3c')]['id']}},_0xdd850e={};_0xdd850e[_0x5277('0x2a')]=_[_0x5277('0x3d')](db['Variable'][_0x5277('0x27')]);_0xdd850e[_0x5277('0x2b')]=_['keys'](_0x1f5f88['query']);_0xdd850e[_0x5277('0x32')]=_[_0x5277('0x3e')](_0xdd850e[_0x5277('0x2a')],_0xdd850e[_0x5277('0x2b')]);_0x594029[_0x5277('0x2c')]=_[_0x5277('0x3e')](_0xdd850e[_0x5277('0x2a')],qs['fields'](_0x1f5f88[_0x5277('0x2b')][_0x5277('0x2d')]));_0x594029[_0x5277('0x2c')]=_0x594029[_0x5277('0x2c')][_0x5277('0x3f')]?_0x594029[_0x5277('0x2c')]:_0xdd850e['model'];if(_0x1f5f88['query'][_0x5277('0x40')]){_0x594029[_0x5277('0x38')]=[{'all':!![]}];}_0x594029=_[_0x5277('0x34')]({},_0x594029,_0x1f5f88['options']);return db[_0x5277('0x26')][_0x5277('0x41')](_0x594029)[_0x5277('0x1b')](handleEntityNotFound(_0x2c4e44,null))['then'](respondWithResult(_0x2c4e44,null))[_0x5277('0x3a')](handleError(_0x2c4e44,null));};exports[_0x5277('0x42')]=function(_0x446543,_0x1e8618){return db[_0x5277('0x26')][_0x5277('0x42')](_0x446543[_0x5277('0x43')],{})[_0x5277('0x1b')](function(_0x52a9ea){var _0x47b96b=_0x446543['user'][_0x5277('0x44')]({'plain':!![]});if(!_0x47b96b)throw new Error(_0x5277('0x45'));if(_0x47b96b[_0x5277('0x46')]===_0x5277('0x47')){var _0x2363cc=_0x52a9ea[_0x5277('0x44')]({'plain':!![]});var _0xca51d3=_0x5277('0x1d');return db[_0x5277('0x48')][_0x5277('0x41')]({'where':{'name':_0xca51d3,'userProfileId':_0x47b96b[_0x5277('0x49')]},'raw':!![]})[_0x5277('0x1b')](function(_0x5750c7){if(_0x5750c7&&_0x5750c7[_0x5277('0x4a')]===0x0){return db[_0x5277('0x1e')]['create']({'name':_0x2363cc[_0x5277('0x22')],'resourceId':_0x2363cc['id'],'type':_0x5750c7[_0x5277('0x22')],'sectionId':_0x5750c7['id']},{})[_0x5277('0x1b')](function(){return _0x52a9ea;});}else{return _0x52a9ea;}})[_0x5277('0x3a')](function(_0x35dc93){logger[_0x5277('0x20')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x35dc93);throw _0x35dc93;});}return _0x52a9ea;})[_0x5277('0x1b')](respondWithResult(_0x1e8618,0xc9))['catch'](handleError(_0x1e8618,null));};exports[_0x5277('0x1a')]=function(_0x19cdad,_0x3c5cef){if(_0x19cdad['body']['id']){delete _0x19cdad[_0x5277('0x43')]['id'];}return db[_0x5277('0x26')]['find']({'where':{'id':_0x19cdad['params']['id']}})[_0x5277('0x1b')](handleEntityNotFound(_0x3c5cef,null))[_0x5277('0x1b')](saveUpdates(_0x19cdad[_0x5277('0x43')],null))['then'](respondWithResult(_0x3c5cef,null))[_0x5277('0x3a')](handleError(_0x3c5cef,null));};exports[_0x5277('0x1c')]=function(_0x2e92ce,_0x5aeb0a){return db[_0x5277('0x26')][_0x5277('0x41')]({'where':{'id':_0x2e92ce[_0x5277('0x3c')]['id']}})['then'](handleEntityNotFound(_0x5aeb0a,null))['then'](removeEntity(_0x5aeb0a,null))['catch'](handleError(_0x5aeb0a,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index eb809bb..f419d8e 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 _0x4cba=['../../config/environment','./variable.attributes','exports','define','Variable','lodash','util','../../config/logger','api','moment','bluebird','rimraf'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x4cba,0x13d));var _0xa4cb=function(_0x2fced0,_0x454743){_0x2fced0=_0x2fced0-0x0;var _0x25b3af=_0x4cba[_0x2fced0];return _0x25b3af;};'use strict';var _=require(_0xa4cb('0x0'));var util=require(_0xa4cb('0x1'));var logger=require(_0xa4cb('0x2'))(_0xa4cb('0x3'));var moment=require(_0xa4cb('0x4'));var BPromise=require(_0xa4cb('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xa4cb('0x6'));var config=require(_0xa4cb('0x7'));var attributes=require(_0xa4cb('0x8'));module[_0xa4cb('0x9')]=function(_0x1f7d08,_0xffe61f){return _0x1f7d08[_0xa4cb('0xa')](_0xa4cb('0xb'),attributes,{'tableName':'tools_variables','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5174=['../../config/environment','exports','define','Variable','lodash','api','moment','bluebird','request-promise','path'];(function(_0x185860,_0x5b276e){var _0x15bf16=function(_0x21751b){while(--_0x21751b){_0x185860['push'](_0x185860['shift']());}};_0x15bf16(++_0x5b276e);}(_0x5174,0x13a));var _0x4517=function(_0x4731b9,_0xa9cf5d){_0x4731b9=_0x4731b9-0x0;var _0x2a1b7e=_0x5174[_0x4731b9];return _0x2a1b7e;};'use strict';var _=require(_0x4517('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x4517('0x1'));var moment=require(_0x4517('0x2'));var BPromise=require(_0x4517('0x3'));var rp=require(_0x4517('0x4'));var fs=require('fs');var path=require(_0x4517('0x5'));var rimraf=require('rimraf');var config=require(_0x4517('0x6'));var attributes=require('./variable.attributes');module[_0x4517('0x7')]=function(_0xf96ee5,_0x54a509){return _0xf96ee5[_0x4517('0x8')](_0x4517('0x9'),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 21990ac..c005e95 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 _0xabce=['moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','ShowVariable','Variable','find','options','attributes','map','include','model','catch','lodash','util'];(function(_0x1e8955,_0x29eec3){var _0x4df160=function(_0x1171a6){while(--_0x1171a6){_0x1e8955['push'](_0x1e8955['shift']());}};_0x4df160(++_0x29eec3);}(_0xabce,0x103));var _0xeabc=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0xabce[_0x5608a3];return _0x1ed50a;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var moment=require(_0xeabc('0x2'));var BPromise=require(_0xeabc('0x3'));var rs=require(_0xeabc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xeabc('0x5'));var logger=require(_0xeabc('0x6'))(_0xeabc('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xeabc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x229ba4,_0x52ede8,_0x3bdc29){return new BPromise(function(_0x9417af,_0x8434c5){return client['request'](_0x229ba4,_0x3bdc29)[_0xeabc('0x9')](function(_0x341f16){logger[_0xeabc('0xa')](_0xeabc('0xb'),_0x52ede8,_0xeabc('0xc'));logger[_0xeabc('0xd')](_0xeabc('0xe'),_0x52ede8,_0xeabc('0xc'),JSON[_0xeabc('0xf')](_0x341f16));if(_0x341f16[_0xeabc('0x10')]){if(_0x341f16[_0xeabc('0x10')][_0xeabc('0x11')]===0x1f4){logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);return _0x8434c5(_0x341f16['error'][_0xeabc('0x12')]);}logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16['error']['message']);return _0x9417af(_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);}else{logger[_0xeabc('0xa')]('Variable,\x20%s,\x20%s',_0x52ede8,_0xeabc('0xc'));_0x9417af(_0x341f16[_0xeabc('0x13')]['message']);}})['catch'](function(_0x10fa8e){logger['error'](_0xeabc('0xb'),_0x52ede8,_0x10fa8e);_0x8434c5(_0x10fa8e);});});}exports[_0xeabc('0x14')]=function(_0x58a3c0){var _0x16f08b=this;return new Promise(function(_0x31dd53,_0x31f52a){return db[_0xeabc('0x15')][_0xeabc('0x16')]({'raw':_0x58a3c0['options']?_0x58a3c0[_0xeabc('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x58a3c0[_0xeabc('0x17')]?_0x58a3c0[_0xeabc('0x17')]['where']||null:null,'attributes':_0x58a3c0[_0xeabc('0x17')]?_0x58a3c0[_0xeabc('0x17')][_0xeabc('0x18')]||null:null,'include':_0x58a3c0[_0xeabc('0x17')]?_0x58a3c0[_0xeabc('0x17')]['include']?_[_0xeabc('0x19')](_0x58a3c0[_0xeabc('0x17')][_0xeabc('0x1a')],function(_0x5bdd57){return{'model':db[_0x5bdd57[_0xeabc('0x1b')]],'as':_0x5bdd57['as'],'attributes':_0x5bdd57[_0xeabc('0x18')],'include':_0x5bdd57[_0xeabc('0x1a')]?_[_0xeabc('0x19')](_0x5bdd57['include'],function(_0x109e1d){return{'model':db[_0x109e1d['model']],'as':_0x109e1d['as'],'attributes':_0x109e1d[_0xeabc('0x18')],'include':_0x109e1d['include']?_[_0xeabc('0x19')](_0x109e1d[_0xeabc('0x1a')],function(_0x269621){return{'model':db[_0x269621[_0xeabc('0x1b')]],'as':_0x269621['as'],'attributes':_0x269621[_0xeabc('0x18')]};}):[]};}):[]};}):[]:[]})[_0xeabc('0x9')](function(_0x131722){logger['info']('ShowVariable',_0x58a3c0);logger[_0xeabc('0xd')]('ShowVariable',_0x58a3c0,JSON[_0xeabc('0xf')](_0x131722));_0x31dd53(_0x131722);})[_0xeabc('0x1c')](function(_0x48fb52){logger[_0xeabc('0x10')](_0xeabc('0x14'),_0x48fb52[_0xeabc('0x12')],_0x58a3c0);_0x31f52a(_0x16f08b[_0xeabc('0x10')](0x1f4,_0x48fb52[_0xeabc('0x12')]));});});}; \ No newline at end of file +var _0x814b=['model','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','ShowVariable','options','where','include','map','attributes'];(function(_0x3ed5fe,_0x4ccc75){var _0xe9656=function(_0x2c5463){while(--_0x2c5463){_0x3ed5fe['push'](_0x3ed5fe['shift']());}};_0xe9656(++_0x4ccc75);}(_0x814b,0x1a2));var _0xb814=function(_0x556927,_0x34b53f){_0x556927=_0x556927-0x0;var _0x5f1235=_0x814b[_0x556927];return _0x5f1235;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var moment=require(_0xb814('0x2'));var BPromise=require(_0xb814('0x3'));var rs=require(_0xb814('0x4'));var fs=require('fs');var Redis=require(_0xb814('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb814('0x6'));var logger=require(_0xb814('0x7'))(_0xb814('0x8'));var config=require(_0xb814('0x9'));var jayson=require(_0xb814('0xa'));var client=jayson[_0xb814('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b0829,_0x2e6272,_0x5c8539){return new BPromise(function(_0x271af9,_0x2913a6){return client[_0xb814('0xc')](_0x3b0829,_0x5c8539)[_0xb814('0xd')](function(_0x1fea33){logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));logger[_0xb814('0x11')](_0xb814('0x12'),_0x2e6272,_0xb814('0x10'),JSON['stringify'](_0x1fea33));if(_0x1fea33[_0xb814('0x13')]){if(_0x1fea33['error'][_0xb814('0x14')]===0x1f4){logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x2913a6(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x271af9(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}else{logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));_0x271af9(_0x1fea33[_0xb814('0x16')][_0xb814('0x15')]);}})[_0xb814('0x17')](function(_0x21b73f){logger[_0xb814('0x13')]('Variable,\x20%s,\x20%s',_0x2e6272,_0x21b73f);_0x2913a6(_0x21b73f);});});}exports[_0xb814('0x18')]=function(_0x55ba16){var _0x270598=this;return new Promise(function(_0xfac75b,_0x4c3007){return db['Variable']['find']({'raw':_0x55ba16[_0xb814('0x19')]?_0x55ba16['options']['raw']===undefined?!![]:![]:!![],'where':_0x55ba16[_0xb814('0x19')]?_0x55ba16[_0xb814('0x19')][_0xb814('0x1a')]||null:null,'attributes':_0x55ba16['options']?_0x55ba16[_0xb814('0x19')]['attributes']||null:null,'include':_0x55ba16[_0xb814('0x19')]?_0x55ba16[_0xb814('0x19')][_0xb814('0x1b')]?_[_0xb814('0x1c')](_0x55ba16[_0xb814('0x19')][_0xb814('0x1b')],function(_0x1f5d40){return{'model':db[_0x1f5d40['model']],'as':_0x1f5d40['as'],'attributes':_0x1f5d40[_0xb814('0x1d')],'include':_0x1f5d40['include']?_[_0xb814('0x1c')](_0x1f5d40[_0xb814('0x1b')],function(_0x31c7ec){return{'model':db[_0x31c7ec[_0xb814('0x1e')]],'as':_0x31c7ec['as'],'attributes':_0x31c7ec[_0xb814('0x1d')],'include':_0x31c7ec[_0xb814('0x1b')]?_[_0xb814('0x1c')](_0x31c7ec['include'],function(_0x392222){return{'model':db[_0x392222[_0xb814('0x1e')]],'as':_0x392222['as'],'attributes':_0x392222[_0xb814('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xb814('0xd')](function(_0x32ed56){logger[_0xb814('0xe')](_0xb814('0x18'),_0x55ba16);logger[_0xb814('0x11')]('ShowVariable',_0x55ba16,JSON[_0xb814('0x1f')](_0x32ed56));_0xfac75b(_0x32ed56);})[_0xb814('0x17')](function(_0x52ed64){logger[_0xb814('0x13')](_0xb814('0x18'),_0x52ed64[_0xb814('0x15')],_0x55ba16);_0x4c3007(_0x270598['error'](0x1f4,_0x52ed64[_0xb814('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index 46fd3be..77b15be 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 _0xa28b=['canUpdate','isAuthenticated','reset','/pull','/restart','restart','exports','Router','../../components/auth/service','get','index'];(function(_0x389e63,_0x3e86de){var _0x2e6bf6=function(_0x439389){while(--_0x439389){_0x389e63['push'](_0x389e63['shift']());}};_0x2e6bf6(++_0x3e86de);}(_0xa28b,0x96));var _0xba28=function(_0x41cf46,_0x28f112){_0x41cf46=_0x41cf46-0x0;var _0x5da203=_0xa28b[_0x41cf46];return _0x5da203;};'use strict';var express=require('express');var router=express[_0xba28('0x0')]();var auth=require(_0xba28('0x1'));var controller=require('./version.controller');router[_0xba28('0x2')]('/',controller[_0xba28('0x3')]);router[_0xba28('0x2')]('/fetch',auth['isAuthenticated'](),auth[_0xba28('0x4')](),controller['fetch']);router[_0xba28('0x2')]('/reset',auth[_0xba28('0x5')](),auth[_0xba28('0x4')](),controller[_0xba28('0x6')]);router[_0xba28('0x2')](_0xba28('0x7'),auth[_0xba28('0x5')](),auth[_0xba28('0x4')](),controller['pull']);router[_0xba28('0x2')](_0xba28('0x8'),auth[_0xba28('0x5')](),controller[_0xba28('0x9')]);router[_0xba28('0x2')]('/migrations',controller['migrations']);module[_0xba28('0xa')]=router; \ No newline at end of file +var _0xde16=['index','/fetch','isAuthenticated','canUpdate','fetch','/reset','/pull','pull','/restart','/migrations','exports','Router','../../components/auth/service','./version.controller','get'];(function(_0x2389c8,_0x39d57a){var _0x57493d=function(_0x539b83){while(--_0x539b83){_0x2389c8['push'](_0x2389c8['shift']());}};_0x57493d(++_0x39d57a);}(_0xde16,0x83));var _0x6de1=function(_0x285957,_0x2190f4){_0x285957=_0x285957-0x0;var _0x4c6d56=_0xde16[_0x285957];return _0x4c6d56;};'use strict';var express=require('express');var router=express[_0x6de1('0x0')]();var auth=require(_0x6de1('0x1'));var controller=require(_0x6de1('0x2'));router[_0x6de1('0x3')]('/',controller[_0x6de1('0x4')]);router[_0x6de1('0x3')](_0x6de1('0x5'),auth[_0x6de1('0x6')](),auth[_0x6de1('0x7')](),controller[_0x6de1('0x8')]);router[_0x6de1('0x3')](_0x6de1('0x9'),auth[_0x6de1('0x6')](),auth[_0x6de1('0x7')](),controller['reset']);router[_0x6de1('0x3')](_0x6de1('0xa'),auth[_0x6de1('0x6')](),auth[_0x6de1('0x7')](),controller[_0x6de1('0xb')]);router[_0x6de1('0x3')](_0x6de1('0xc'),auth[_0x6de1('0x6')](),controller['restart']);router['get'](_0x6de1('0xd'),controller['migrations']);module[_0x6de1('0xe')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index 2080213..9e091d7 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 _0xe686=['version','compare-versions','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','update','simple-git','root','index','exports','query','fetch','tags','latest','2.0.0','status','origin','error','json','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','motion2','then','pm2\x20restart\x20motion\x20%s','catch','migrations','readdirSync','join','replace','.js','length','sort','sequelize','Migration','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','server','map','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','Database\x20already\x20up-to-date','umzug','path','pkginfo'];(function(_0x28d225,_0x43be18){var _0x1f79e1=function(_0x362c23){while(--_0x362c23){_0x28d225['push'](_0x28d225['shift']());}};_0x1f79e1(++_0x43be18);}(_0xe686,0x13b));var _0x6e68=function(_0xa77e1c,_0x3dbabe){_0xa77e1c=_0xa77e1c-0x0;var _0x290406=_0xe686[_0xa77e1c];return _0x290406;};'use strict';var Umzug=require(_0x6e68('0x0'));var path=require(_0x6e68('0x1'));var fs=require('fs');var _=require('lodash');var pkginfo=require(_0x6e68('0x2'))(module,_0x6e68('0x3'));var compareVersions=require(_0x6e68('0x4'));var exec=require('child_process')['exec'];var db=require(_0x6e68('0x5'))['db'];var config=require(_0x6e68('0x6'));var pm2=require(_0x6e68('0x7'));var logger=require(_0x6e68('0x8'))(_0x6e68('0x9'));var git=require(_0x6e68('0xa'))(config[_0x6e68('0xb')]);exports[_0x6e68('0xc')]=function(_0x342630,_0x4c8a6b){var _0x4f7cab={'current':module[_0x6e68('0xd')][_0x6e68('0x3')],'phonebar':0x2};if(_0x342630['query']&&_0x342630[_0x6e68('0xe')]['latest']){return git[_0x6e68('0xf')]()[_0x6e68('0x10')](function(_0x5ebcd2,_0x1c8e8c){_0x4f7cab[_0x6e68('0x11')]=(_0x5ebcd2?module[_0x6e68('0xd')][_0x6e68('0x3')]:_0x1c8e8c['latest'])||_0x6e68('0x12');return _0x4c8a6b[_0x6e68('0x13')](0xc8)['json'](_0x4f7cab);});}else{return _0x4c8a6b[_0x6e68('0x13')](0xc8)['json'](_0x4f7cab);}};exports[_0x6e68('0xf')]=function(_0x28ddb7,_0x12f0ef){return git['fetch']([_0x6e68('0x14'),'master'],function(_0x2fd681){if(_0x2fd681){logger[_0x6e68('0x15')](_0x2fd681);return _0x12f0ef[_0x6e68('0x13')](0x1f4)[_0x6e68('0x16')](_0x2fd681);}logger[_0x6e68('0x17')](_0x6e68('0x18'));return _0x12f0ef[_0x6e68('0x13')](0xc8)[_0x6e68('0x16')]({'output':_0x6e68('0x19')});});};exports['reset']=function(_0x12e1e8,_0x36eeba){return git[_0x6e68('0x1a')]([_0x6e68('0x1b'),'FETCH_HEAD'],function(_0x22657d){if(_0x22657d){logger['error'](_0x22657d);return _0x36eeba[_0x6e68('0x13')](0x1f4)[_0x6e68('0x16')](_0x22657d);}logger[_0x6e68('0x17')](_0x6e68('0x1c'));return _0x36eeba['status'](0xc8)[_0x6e68('0x16')]({'output':_0x6e68('0x1d')});});};exports[_0x6e68('0x1e')]=function(_0x208c33,_0x5e380a){exec('npm\x20install\x20--production',function(_0x5396cc,_0x4349d3,_0x505f8f){logger[_0x6e68('0x17')](_0x4349d3);logger[_0x6e68('0x17')](_0x505f8f);if(_0x5396cc){logger[_0x6e68('0x15')](_0x5396cc);return _0x5e380a[_0x6e68('0x13')](0x1f4)['json'](_0x5396cc);}return _0x5e380a[_0x6e68('0x13')](0xc8)[_0x6e68('0x16')]({'output':_0x4349d3});});};exports['restart']=function(_0x19c4f6,_0xce7dfb){return pm2['restart'](_0x6e68('0x1f'))[_0x6e68('0x20')](function(_0x5493d0){logger[_0x6e68('0x17')](_0x6e68('0x21'),_0x5493d0);return _0xce7dfb['status'](0xc8)[_0x6e68('0x16')]({'output':'Your\x20system\x20has\x20been\x20restart\x20successfully'});})[_0x6e68('0x22')](function(_0x303417){logger[_0x6e68('0x15')](_0x303417);return _0xce7dfb[_0x6e68('0x13')](0x1f4)[_0x6e68('0x16')](_0x303417);});};exports[_0x6e68('0x23')]=function(_0x52c95d,_0x207c07){var _0x577fc5=fs[_0x6e68('0x24')](path[_0x6e68('0x25')](config['root'],'server','migrations'));var _0x175493=[];for(var _0x989f67=0x0;_0x989f67<_0x577fc5['length'];_0x989f67++){var _0xdd35fe=_0x577fc5[_0x989f67][_0x6e68('0x26')](_0x6e68('0x27'),'');if(compareVersions(module[_0x6e68('0xd')][_0x6e68('0x3')],_0xdd35fe)===-0x1){_0x175493['push'](_0xdd35fe);}}if(_0x175493[_0x6e68('0x28')]){var _0x597b1f=_0x175493[_0x6e68('0x29')](compareVersions);var _0x43b21b=new Umzug({'storage':_0x6e68('0x2a'),'storageOptions':{'model':db['Migration'],'modelName':_0x6e68('0x2b'),'columnName':_0x6e68('0x3')},'migrations':{'params':[db['sequelize'][_0x6e68('0x2c')](),db[_0x6e68('0x2a')][_0x6e68('0x2d')],function(){throw new Error(_0x6e68('0x2e'));}],'path':path[_0x6e68('0x25')](config['root'],_0x6e68('0x2f'),_0x6e68('0x23')),'pattern':/\.js$/}});_0x43b21b['up']({'migrations':_[_0x6e68('0x30')](_0x597b1f,function(_0x42a4a5){return _0x42a4a5+'.js';})})[_0x6e68('0x20')](function(){return _0x207c07[_0x6e68('0x13')](0xc8)[_0x6e68('0x16')]({'output':_0x6e68('0x31')+module[_0x6e68('0xd')][_0x6e68('0x3')]+_0x6e68('0x32')+_[_0x6e68('0x33')](_0x597b1f),'migrations':_[_0x6e68('0x25')](_0x597b1f)});})['catch'](function(_0x33e752){if(_0x33e752 instanceof db[_0x6e68('0x2a')]['UniqueConstraintError']){return _0x207c07['status'](0xc8)[_0x6e68('0x16')]({'output':_0x6e68('0x34')});}else{return _0x207c07[_0x6e68('0x13')](0x1f4)['json'](_0x33e752);}});}else{return _0x207c07[_0x6e68('0x13')](0xc8)['json']({'output':_0x6e68('0x34')});}}; \ No newline at end of file +var _0xc5af=['Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','UniqueConstraintError','Database\x20already\x20up-to-date','pkginfo','version','compare-versions','exec','../../config/environment','simple-git','root','index','exports','query','latest','fetch','2.0.0','status','json','origin','master','info','reset','--hard','FETCH_HEAD','error','git\x20reset\x20--hard\x20FETCH_HEAD','pull','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','join','length','replace','.js','push','sort','sequelize','Migration','getQueryInterface','server','map'];(function(_0x20598e,_0x559fa9){var _0x484c79=function(_0x286be0){while(--_0x286be0){_0x20598e['push'](_0x20598e['shift']());}};_0x484c79(++_0x559fa9);}(_0xc5af,0x146));var _0xfc5a=function(_0x3f4507,_0x2262c9){_0x3f4507=_0x3f4507-0x0;var _0x23a228=_0xc5af[_0x3f4507];return _0x23a228;};'use strict';var Umzug=require('umzug');var path=require('path');var fs=require('fs');var _=require('lodash');var pkginfo=require(_0xfc5a('0x0'))(module,_0xfc5a('0x1'));var compareVersions=require(_0xfc5a('0x2'));var exec=require('child_process')[_0xfc5a('0x3')];var db=require('../../mysqldb')['db'];var config=require(_0xfc5a('0x4'));var pm2=require('../../config/pm2');var logger=require('../../config/logger')('update');var git=require(_0xfc5a('0x5'))(config[_0xfc5a('0x6')]);exports[_0xfc5a('0x7')]=function(_0x1e9cc5,_0x229530){var _0x29bd1e={'current':module[_0xfc5a('0x8')][_0xfc5a('0x1')],'phonebar':0x2};if(_0x1e9cc5['query']&&_0x1e9cc5[_0xfc5a('0x9')][_0xfc5a('0xa')]){return git[_0xfc5a('0xb')]()['tags'](function(_0x2bad30,_0x24fbd1){_0x29bd1e[_0xfc5a('0xa')]=(_0x2bad30?module[_0xfc5a('0x8')]['version']:_0x24fbd1[_0xfc5a('0xa')])||_0xfc5a('0xc');return _0x229530[_0xfc5a('0xd')](0xc8)[_0xfc5a('0xe')](_0x29bd1e);});}else{return _0x229530[_0xfc5a('0xd')](0xc8)[_0xfc5a('0xe')](_0x29bd1e);}};exports[_0xfc5a('0xb')]=function(_0x268c5a,_0x4f2b61){return git[_0xfc5a('0xb')]([_0xfc5a('0xf'),_0xfc5a('0x10')],function(_0x52ecbb){if(_0x52ecbb){logger['error'](_0x52ecbb);return _0x4f2b61[_0xfc5a('0xd')](0x1f4)[_0xfc5a('0xe')](_0x52ecbb);}logger[_0xfc5a('0x11')]('git\x20fetch');return _0x4f2b61[_0xfc5a('0xd')](0xc8)['json']({'output':'git\x20fetch\x20origin\x20master'});});};exports[_0xfc5a('0x12')]=function(_0x159aca,_0x38a68b){return git['reset']([_0xfc5a('0x13'),_0xfc5a('0x14')],function(_0x2ea4b3){if(_0x2ea4b3){logger[_0xfc5a('0x15')](_0x2ea4b3);return _0x38a68b[_0xfc5a('0xd')](0x1f4)[_0xfc5a('0xe')](_0x2ea4b3);}logger[_0xfc5a('0x11')](_0xfc5a('0x16'));return _0x38a68b[_0xfc5a('0xd')](0xc8)['json']({'output':'git\x20reset\x20--hard'});});};exports[_0xfc5a('0x17')]=function(_0x18dfec,_0x50b66a){exec('npm\x20install\x20--production',function(_0x48acab,_0x28f5fd,_0xa97d4e){logger[_0xfc5a('0x11')](_0x28f5fd);logger[_0xfc5a('0x11')](_0xa97d4e);if(_0x48acab){logger[_0xfc5a('0x15')](_0x48acab);return _0x50b66a[_0xfc5a('0xd')](0x1f4)[_0xfc5a('0xe')](_0x48acab);}return _0x50b66a['status'](0xc8)[_0xfc5a('0xe')]({'output':_0x28f5fd});});};exports['restart']=function(_0x10e0cf,_0x2a258c){return pm2['restart'](_0xfc5a('0x18'))[_0xfc5a('0x19')](function(_0x30cb13){logger[_0xfc5a('0x11')](_0xfc5a('0x1a'),_0x30cb13);return _0x2a258c[_0xfc5a('0xd')](0xc8)[_0xfc5a('0xe')]({'output':_0xfc5a('0x1b')});})[_0xfc5a('0x1c')](function(_0x2871cf){logger['error'](_0x2871cf);return _0x2a258c[_0xfc5a('0xd')](0x1f4)[_0xfc5a('0xe')](_0x2871cf);});};exports[_0xfc5a('0x1d')]=function(_0x129898,_0x2b0885){var _0x3ed714=fs[_0xfc5a('0x1e')](path[_0xfc5a('0x1f')](config[_0xfc5a('0x6')],'server',_0xfc5a('0x1d')));var _0x195a6e=[];for(var _0x23bd95=0x0;_0x23bd95<_0x3ed714[_0xfc5a('0x20')];_0x23bd95++){var _0x5defc1=_0x3ed714[_0x23bd95][_0xfc5a('0x21')](_0xfc5a('0x22'),'');if(compareVersions(module['exports'][_0xfc5a('0x1')],_0x5defc1)===-0x1){_0x195a6e[_0xfc5a('0x23')](_0x5defc1);}}if(_0x195a6e['length']){var _0x3d6797=_0x195a6e[_0xfc5a('0x24')](compareVersions);var _0x51336d=new Umzug({'storage':_0xfc5a('0x25'),'storageOptions':{'model':db[_0xfc5a('0x26')],'modelName':_0xfc5a('0x26'),'columnName':_0xfc5a('0x1')},'migrations':{'params':[db[_0xfc5a('0x25')][_0xfc5a('0x27')](),db[_0xfc5a('0x25')]['constructor'],function(){throw new Error('Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.');}],'path':path[_0xfc5a('0x1f')](config['root'],_0xfc5a('0x28'),_0xfc5a('0x1d')),'pattern':/\.js$/}});_0x51336d['up']({'migrations':_[_0xfc5a('0x29')](_0x3d6797,function(_0x3023cf){return _0x3023cf+_0xfc5a('0x22');})})[_0xfc5a('0x19')](function(){return _0x2b0885[_0xfc5a('0xd')](0xc8)[_0xfc5a('0xe')]({'output':_0xfc5a('0x2a')+module['exports']['version']+_0xfc5a('0x2b')+_['last'](_0x3d6797),'migrations':_[_0xfc5a('0x1f')](_0x3d6797)});})[_0xfc5a('0x1c')](function(_0x4d3810){if(_0x4d3810 instanceof db[_0xfc5a('0x25')][_0xfc5a('0x2c')]){return _0x2b0885[_0xfc5a('0xd')](0xc8)[_0xfc5a('0xe')]({'output':_0xfc5a('0x2d')});}else{return _0x2b0885[_0xfc5a('0xd')](0x1f4)[_0xfc5a('0xe')](_0x4d3810);}});}else{return _0x2b0885[_0xfc5a('0xd')](0xc8)[_0xfc5a('0xe')]({'output':_0xfc5a('0x2d')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index aeaa0a7..04c0b6d 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 _0x0a13=['isAuthenticated','post','update','delete','exports','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','describe','/:id'];(function(_0x34843e,_0x4c4224){var _0x598f7f=function(_0x12a44c){while(--_0x12a44c){_0x34843e['push'](_0x34843e['shift']());}};_0x598f7f(++_0x4c4224);}(_0x0a13,0x18c));var _0x30a1=function(_0x24a737,_0x3ff299){_0x24a737=_0x24a737-0x0;var _0x37b618=_0x0a13[_0x24a737];return _0x37b618;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x30a1('0x0'));var timeout=require(_0x30a1('0x1'));var express=require(_0x30a1('0x2'));var router=express['Router']();var fs_extra=require(_0x30a1('0x3'));var auth=require(_0x30a1('0x4'));var interaction=require(_0x30a1('0x5'));var config=require(_0x30a1('0x6'));var controller=require('./voiceAgentReport.controller');router[_0x30a1('0x7')]('/',auth['isAuthenticated'](),controller[_0x30a1('0x8')]);router[_0x30a1('0x7')](_0x30a1('0x9'),auth['isAuthenticated'](),controller[_0x30a1('0xa')]);router[_0x30a1('0x7')](_0x30a1('0xb'),auth[_0x30a1('0xc')](),controller['show']);router[_0x30a1('0xd')]('/',auth[_0x30a1('0xc')](),controller['create']);router['put'](_0x30a1('0xb'),auth[_0x30a1('0xc')](),controller[_0x30a1('0xe')]);router[_0x30a1('0xf')]('/:id',auth[_0x30a1('0xc')](),controller['destroy']);module[_0x30a1('0x10')]=router; \ No newline at end of file +var _0x4a87=['../../components/auth/service','../../components/interaction/service','get','/describe','isAuthenticated','describe','create','/:id','delete','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x2b1612,_0x1d52ef){var _0x5ad967=function(_0x38fa64){while(--_0x38fa64){_0x2b1612['push'](_0x2b1612['shift']());}};_0x5ad967(++_0x1d52ef);}(_0x4a87,0x7a));var _0x74a8=function(_0x480fc0,_0x1e22b1){_0x480fc0=_0x480fc0-0x0;var _0x7eba29=_0x4a87[_0x480fc0];return _0x7eba29;};'use strict';var multer=require(_0x74a8('0x0'));var util=require(_0x74a8('0x1'));var path=require(_0x74a8('0x2'));var timeout=require(_0x74a8('0x3'));var express=require(_0x74a8('0x4'));var router=express[_0x74a8('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x74a8('0x6'));var interaction=require(_0x74a8('0x7'));var config=require('../../config/environment');var controller=require('./voiceAgentReport.controller');router[_0x74a8('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x74a8('0x8')](_0x74a8('0x9'),auth[_0x74a8('0xa')](),controller[_0x74a8('0xb')]);router['get']('/:id',auth[_0x74a8('0xa')](),controller['show']);router['post']('/',auth[_0x74a8('0xa')](),controller[_0x74a8('0xc')]);router['put'](_0x74a8('0xd'),auth[_0x74a8('0xa')](),controller['update']);router[_0x74a8('0xe')](_0x74a8('0xd'),auth[_0x74a8('0xa')](),controller['destroy']);module[_0x74a8('0xf')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index 331b0e1..6d1db28 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 _0x1b0e=['sequelize','exports','STRING','DATE','BOOLEAN','INTEGER'];(function(_0x1ab4c9,_0x3705a8){var _0x11c5f6=function(_0x23accc){while(--_0x23accc){_0x1ab4c9['push'](_0x1ab4c9['shift']());}};_0x11c5f6(++_0x3705a8);}(_0x1b0e,0x132));var _0xe1b0=function(_0x1d2c3c,_0x3a54c3){_0x1d2c3c=_0x1d2c3c-0x0;var _0x356ff2=_0x1b0e[_0x1d2c3c];return _0x356ff2;};'use strict';var Sequelize=require(_0xe1b0('0x0'));module[_0xe1b0('0x1')]={'type':{'type':Sequelize[_0xe1b0('0x2')]},'uniqueid':{'type':Sequelize[_0xe1b0('0x2')]},'calleridnum':{'type':Sequelize[_0xe1b0('0x2')]},'calleridname':{'type':Sequelize[_0xe1b0('0x2')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xe1b0('0x2')]},'agentcalledAt':{'type':Sequelize[_0xe1b0('0x3')]},'agentconnectAt':{'type':Sequelize['DATE']},'agentcompleteAt':{'type':Sequelize[_0xe1b0('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0xe1b0('0x3')]},'agentdumpAt':{'type':Sequelize[_0xe1b0('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0xe1b0('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xe1b0('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize[_0xe1b0('0x5')]},'agentacw':{'type':Sequelize[_0xe1b0('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xe1b0('0x5')]},'reason':{'type':Sequelize[_0xe1b0('0x2')]},'lastevent':{'type':Sequelize[_0xe1b0('0x2')]},'channel':{'type':Sequelize[_0xe1b0('0x2')]},'channelstate':{'type':Sequelize[_0xe1b0('0x5')]},'channelstatedesc':{'type':Sequelize[_0xe1b0('0x2')]},'connectedlinenum':{'type':Sequelize[_0xe1b0('0x2')]},'connectedlinename':{'type':Sequelize[_0xe1b0('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xe1b0('0x2')]},'context':{'type':Sequelize[_0xe1b0('0x2')]},'exten':{'type':Sequelize[_0xe1b0('0x2')]},'priority':{'type':Sequelize[_0xe1b0('0x2')]},'destchannel':{'type':Sequelize[_0xe1b0('0x2')]},'destchannelstate':{'type':Sequelize[_0xe1b0('0x5')]},'destchannelstatedesc':{'type':Sequelize[_0xe1b0('0x2')]},'destcalleridnum':{'type':Sequelize[_0xe1b0('0x2')]},'destcalleridname':{'type':Sequelize[_0xe1b0('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0xe1b0('0x2')]},'destlanguage':{'type':Sequelize[_0xe1b0('0x2')]},'destaccountcode':{'type':Sequelize[_0xe1b0('0x2')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0xe1b0('0x2')]},'destuniqueid':{'type':Sequelize[_0xe1b0('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xe1b0('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0xe1b0('0x2')]},'transfer':{'type':Sequelize[_0xe1b0('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xe1b0('0x2')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0xe1b0('0x2')]},'transferuniqueid':{'type':Sequelize[_0xe1b0('0x2')]},'agententerreason':{'type':Sequelize[_0xe1b0('0x5')],'defaultValue':0x0}}; \ No newline at end of file +var _0xd237=['exports','STRING','DATE','BOOLEAN','INTEGER','FORWARD,\x20BLIND,\x20ATTENDED','sequelize'];(function(_0x4448cf,_0x42cbcc){var _0x306054=function(_0x549181){while(--_0x549181){_0x4448cf['push'](_0x4448cf['shift']());}};_0x306054(++_0x42cbcc);}(_0xd237,0x14f));var _0x7d23=function(_0x475923,_0x25d9ec){_0x475923=_0x475923-0x0;var _0x374030=_0xd237[_0x475923];return _0x374030;};'use strict';var Sequelize=require(_0x7d23('0x0'));module[_0x7d23('0x1')]={'type':{'type':Sequelize[_0x7d23('0x2')]},'uniqueid':{'type':Sequelize[_0x7d23('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x7d23('0x2')]},'queue':{'type':Sequelize[_0x7d23('0x2')]},'interface':{'type':Sequelize[_0x7d23('0x2')]},'membername':{'type':Sequelize[_0x7d23('0x2')]},'agentcalledAt':{'type':Sequelize[_0x7d23('0x3')]},'agentconnectAt':{'type':Sequelize[_0x7d23('0x3')]},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize[_0x7d23('0x3')]},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x7d23('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x7d23('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x7d23('0x5')]},'agentacw':{'type':Sequelize[_0x7d23('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x7d23('0x5')]},'reason':{'type':Sequelize[_0x7d23('0x2')]},'lastevent':{'type':Sequelize[_0x7d23('0x2')]},'channel':{'type':Sequelize[_0x7d23('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x7d23('0x2')]},'connectedlinenum':{'type':Sequelize[_0x7d23('0x2')]},'connectedlinename':{'type':Sequelize[_0x7d23('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x7d23('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x7d23('0x2')]},'priority':{'type':Sequelize[_0x7d23('0x2')]},'destchannel':{'type':Sequelize[_0x7d23('0x2')]},'destchannelstate':{'type':Sequelize[_0x7d23('0x5')]},'destchannelstatedesc':{'type':Sequelize[_0x7d23('0x2')]},'destcalleridnum':{'type':Sequelize[_0x7d23('0x2')]},'destcalleridname':{'type':Sequelize[_0x7d23('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x7d23('0x2')]},'destaccountcode':{'type':Sequelize[_0x7d23('0x2')]},'destcontext':{'type':Sequelize[_0x7d23('0x2')]},'destexten':{'type':Sequelize[_0x7d23('0x2')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x7d23('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize['STRING']},'answeredelsewheremembername':{'type':Sequelize[_0x7d23('0x2')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x7d23('0x2')],'comment':_0x7d23('0x6')},'transferexten':{'type':Sequelize[_0x7d23('0x2')]},'transferuniqueid':{'type':Sequelize[_0x7d23('0x2')]},'agententerreason':{'type':Sequelize[_0x7d23('0x5')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.controller.js b/server/api/voiceAgentReport/voiceAgentReport.controller.js index ca9bcf8..8a8047b 100644 --- a/server/api/voiceAgentReport/voiceAgentReport.controller.js +++ b/server/api/voiceAgentReport/voiceAgentReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['type','options','includeAll','include','findAll','catch','show','params','find','body','describe','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','VoiceAgentReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge'];(function(_0x31a371,_0x50828e){var _0x2a5bd6=function(_0x2fb481){while(--_0x2fb481){_0x31a371['push'](_0x31a371['shift']());}};_0x2a5bd6(++_0x50828e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xa9e0[_0x5c3c0b];return _0x52ecd2;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];function respondWithStatusCode(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xcc;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0x15')](_0x26d672);}return _0xd5b662['status'](_0x26d672)[_0x0a9e('0x16')]();};}function respondWithResult(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xc8;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x17')](_0x2b4227)[_0x0a9e('0x18')](_0x281129);}};}function respondWithFilteredResult(_0x52a03d,_0x22dccb){return function(_0x5d0880){if(_0x5d0880){var _0x1985b6=typeof _0x22dccb['offset']===_0x0a9e('0x19')&&typeof _0x22dccb[_0x0a9e('0x1a')]==='undefined';var _0x225616=_0x5d0880['count'];var _0x459eb1=_0x1985b6?0x0:_0x22dccb[_0x0a9e('0x1b')];var _0x106033=_0x1985b6?_0x5d0880[_0x0a9e('0x1c')]:_0x22dccb[_0x0a9e('0x1b')]+_0x22dccb[_0x0a9e('0x1a')];var _0x530eb7;if(_0x106033>=_0x225616){_0x106033=_0x225616;_0x530eb7=0xc8;}else{_0x530eb7=0xce;}_0x52a03d[_0x0a9e('0x17')](_0x530eb7);return _0x52a03d[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x459eb1+'-'+_0x106033+'/'+_0x225616)[_0x0a9e('0x18')](_0x5d0880);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x1f')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x20')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x21')](_0x5a09ef)[_0x0a9e('0x22')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x23')]()[_0x0a9e('0x22')](function(){_0x4abc77[_0x0a9e('0x17')](0xcc)[_0x0a9e('0x16')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x15')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x24')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x25')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x26')](_0x33161b);};}exports[_0x0a9e('0x27')]=function(_0x25fba9,_0x14433c){var _0x140511={},_0x1538a4={},_0x11c3b6={'count':0x0,'rows':[]};var _0x14de77=_['map'](db[_0x0a9e('0x28')][_0x0a9e('0x29')],function(_0x2b1f27){return{'name':_0x2b1f27[_0x0a9e('0x2a')],'type':_0x2b1f27['type'][_0x0a9e('0x2b')]};});_0x1538a4[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x14de77,_0x0a9e('0x25'));_0x1538a4[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x25fba9[_0x0a9e('0x2e')]);_0x1538a4[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](_0x1538a4['model'],_0x1538a4[_0x0a9e('0x2e')]);_0x140511['attributes']=_[_0x0a9e('0x31')](_0x1538a4[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0x140511['attributes']=_0x140511[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0x140511[_0x0a9e('0x33')]:_0x1538a4[_0x0a9e('0x2c')];if(!_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x35')](_0x0a9e('0x36'))){_0x140511[_0x0a9e('0x1a')]=qs['limit'](_0x25fba9[_0x0a9e('0x2e')]['limit']);_0x140511[_0x0a9e('0x1b')]=qs[_0x0a9e('0x1b')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x1b')]);}_0x140511['order']=qs[_0x0a9e('0x37')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x37')]);_0x140511[_0x0a9e('0x38')]=qs['filters'](_['pick'](_0x25fba9[_0x0a9e('0x2e')],_0x1538a4['filters']),_0x14de77);if(_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x39')]){_0x140511[_0x0a9e('0x38')]=_[_0x0a9e('0x3a')](_0x140511['where'],{'$or':_[_0x0a9e('0x2d')](_0x14de77,function(_0x3bfce8){if(_0x3bfce8[_0x0a9e('0x3b')]!=='VIRTUAL'){var _0x1dbf74={};_0x1dbf74[_0x3bfce8[_0x0a9e('0x25')]]={'$like':'%'+_0x25fba9[_0x0a9e('0x2e')]['filter']+'%'};return _0x1dbf74;}})});}_0x140511=_['merge']({},_0x140511,_0x25fba9[_0x0a9e('0x3c')]);var _0x40d766={'where':_0x140511['where']};return db[_0x0a9e('0x28')][_0x0a9e('0x1c')](_0x40d766)[_0x0a9e('0x22')](function(_0x148f55){_0x11c3b6['count']=_0x148f55;if(_0x25fba9['query'][_0x0a9e('0x3d')]){_0x140511[_0x0a9e('0x3e')]=[{'all':!![]}];}return db['VoiceAgentReport'][_0x0a9e('0x3f')](_0x140511);})[_0x0a9e('0x22')](function(_0x1459bb){_0x11c3b6['rows']=_0x1459bb;return _0x11c3b6;})[_0x0a9e('0x22')](respondWithFilteredResult(_0x14433c,_0x140511))[_0x0a9e('0x40')](handleError(_0x14433c,null));};exports[_0x0a9e('0x41')]=function(_0x43dd5b,_0x13cb1f){var _0xeaa5e5={'raw':![],'where':{'id':_0x43dd5b[_0x0a9e('0x42')]['id']}},_0x2881b3={};_0x2881b3[_0x0a9e('0x2c')]=_[_0x0a9e('0x2f')](db[_0x0a9e('0x28')][_0x0a9e('0x29')]);_0x2881b3[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x43dd5b[_0x0a9e('0x2e')]);_0x2881b3['filters']=_['intersection'](_0x2881b3[_0x0a9e('0x2c')],_0x2881b3[_0x0a9e('0x2e')]);_0xeaa5e5[_0x0a9e('0x33')]=_[_0x0a9e('0x31')](_0x2881b3[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0xeaa5e5[_0x0a9e('0x33')]=_0xeaa5e5[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0xeaa5e5[_0x0a9e('0x33')]:_0x2881b3['model'];if(_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x3d')]){_0xeaa5e5[_0x0a9e('0x3e')]=[{'all':!![]}];}_0xeaa5e5=_[_0x0a9e('0x3a')]({},_0xeaa5e5,_0x43dd5b[_0x0a9e('0x3c')]);return db[_0x0a9e('0x28')][_0x0a9e('0x43')](_0xeaa5e5)[_0x0a9e('0x22')](handleEntityNotFound(_0x13cb1f,null))['then'](respondWithResult(_0x13cb1f,null))[_0x0a9e('0x40')](handleError(_0x13cb1f,null));};exports['create']=function(_0x473dc8,_0x476688){return db[_0x0a9e('0x28')]['create'](_0x473dc8[_0x0a9e('0x44')],{})[_0x0a9e('0x22')](respondWithResult(_0x476688,0xc9))[_0x0a9e('0x40')](handleError(_0x476688,null));};exports[_0x0a9e('0x21')]=function(_0x45c845,_0x37be73){if(_0x45c845[_0x0a9e('0x44')]['id']){delete _0x45c845['body']['id'];}return db[_0x0a9e('0x28')][_0x0a9e('0x43')]({'where':{'id':_0x45c845[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x37be73,null))[_0x0a9e('0x22')](saveUpdates(_0x45c845[_0x0a9e('0x44')],null))[_0x0a9e('0x22')](respondWithResult(_0x37be73,null))[_0x0a9e('0x40')](handleError(_0x37be73,null));};exports[_0x0a9e('0x23')]=function(_0x58a5c2,_0xe401a){return db[_0x0a9e('0x28')]['find']({'where':{'id':_0x58a5c2['params']['id']}})['then'](handleEntityNotFound(_0xe401a,null))[_0x0a9e('0x22')](removeEntity(_0xe401a,null))[_0x0a9e('0x40')](handleError(_0xe401a,null));};exports[_0x0a9e('0x45')]=function(_0x11545a,_0x61bb17){return db[_0x0a9e('0x28')][_0x0a9e('0x45')]()[_0x0a9e('0x22')](respondWithResult(_0x61bb17,null))['catch'](handleError(_0x61bb17,null));}; \ No newline at end of file +var _0xa9e0=['type','options','includeAll','include','findAll','catch','show','params','find','body','describe','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','VoiceAgentReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge'];(function(_0x9c2427,_0x17c865){var _0x51984f=function(_0x177af6){while(--_0x177af6){_0x9c2427['push'](_0x9c2427['shift']());}};_0x51984f(++_0x17c865);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xa9e0[_0x6c993a];return _0x27f547;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];function respondWithStatusCode(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xcc;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0x15')](_0x26d672);}return _0xd5b662['status'](_0x26d672)[_0x0a9e('0x16')]();};}function respondWithResult(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xc8;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x17')](_0x2b4227)[_0x0a9e('0x18')](_0x281129);}};}function respondWithFilteredResult(_0x52a03d,_0x22dccb){return function(_0x5d0880){if(_0x5d0880){var _0x1985b6=typeof _0x22dccb['offset']===_0x0a9e('0x19')&&typeof _0x22dccb[_0x0a9e('0x1a')]==='undefined';var _0x225616=_0x5d0880['count'];var _0x459eb1=_0x1985b6?0x0:_0x22dccb[_0x0a9e('0x1b')];var _0x106033=_0x1985b6?_0x5d0880[_0x0a9e('0x1c')]:_0x22dccb[_0x0a9e('0x1b')]+_0x22dccb[_0x0a9e('0x1a')];var _0x530eb7;if(_0x106033>=_0x225616){_0x106033=_0x225616;_0x530eb7=0xc8;}else{_0x530eb7=0xce;}_0x52a03d[_0x0a9e('0x17')](_0x530eb7);return _0x52a03d[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x459eb1+'-'+_0x106033+'/'+_0x225616)[_0x0a9e('0x18')](_0x5d0880);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x1f')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x20')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x21')](_0x5a09ef)[_0x0a9e('0x22')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x23')]()[_0x0a9e('0x22')](function(){_0x4abc77[_0x0a9e('0x17')](0xcc)[_0x0a9e('0x16')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x15')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x24')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x25')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x26')](_0x33161b);};}exports[_0x0a9e('0x27')]=function(_0x25fba9,_0x14433c){var _0x140511={},_0x1538a4={},_0x11c3b6={'count':0x0,'rows':[]};var _0x14de77=_['map'](db[_0x0a9e('0x28')][_0x0a9e('0x29')],function(_0x2b1f27){return{'name':_0x2b1f27[_0x0a9e('0x2a')],'type':_0x2b1f27['type'][_0x0a9e('0x2b')]};});_0x1538a4[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x14de77,_0x0a9e('0x25'));_0x1538a4[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x25fba9[_0x0a9e('0x2e')]);_0x1538a4[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](_0x1538a4['model'],_0x1538a4[_0x0a9e('0x2e')]);_0x140511['attributes']=_[_0x0a9e('0x31')](_0x1538a4[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0x140511['attributes']=_0x140511[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0x140511[_0x0a9e('0x33')]:_0x1538a4[_0x0a9e('0x2c')];if(!_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x35')](_0x0a9e('0x36'))){_0x140511[_0x0a9e('0x1a')]=qs['limit'](_0x25fba9[_0x0a9e('0x2e')]['limit']);_0x140511[_0x0a9e('0x1b')]=qs[_0x0a9e('0x1b')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x1b')]);}_0x140511['order']=qs[_0x0a9e('0x37')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x37')]);_0x140511[_0x0a9e('0x38')]=qs['filters'](_['pick'](_0x25fba9[_0x0a9e('0x2e')],_0x1538a4['filters']),_0x14de77);if(_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x39')]){_0x140511[_0x0a9e('0x38')]=_[_0x0a9e('0x3a')](_0x140511['where'],{'$or':_[_0x0a9e('0x2d')](_0x14de77,function(_0x3bfce8){if(_0x3bfce8[_0x0a9e('0x3b')]!=='VIRTUAL'){var _0x1dbf74={};_0x1dbf74[_0x3bfce8[_0x0a9e('0x25')]]={'$like':'%'+_0x25fba9[_0x0a9e('0x2e')]['filter']+'%'};return _0x1dbf74;}})});}_0x140511=_['merge']({},_0x140511,_0x25fba9[_0x0a9e('0x3c')]);var _0x40d766={'where':_0x140511['where']};return db[_0x0a9e('0x28')][_0x0a9e('0x1c')](_0x40d766)[_0x0a9e('0x22')](function(_0x148f55){_0x11c3b6['count']=_0x148f55;if(_0x25fba9['query'][_0x0a9e('0x3d')]){_0x140511[_0x0a9e('0x3e')]=[{'all':!![]}];}return db['VoiceAgentReport'][_0x0a9e('0x3f')](_0x140511);})[_0x0a9e('0x22')](function(_0x1459bb){_0x11c3b6['rows']=_0x1459bb;return _0x11c3b6;})[_0x0a9e('0x22')](respondWithFilteredResult(_0x14433c,_0x140511))[_0x0a9e('0x40')](handleError(_0x14433c,null));};exports[_0x0a9e('0x41')]=function(_0x43dd5b,_0x13cb1f){var _0xeaa5e5={'raw':![],'where':{'id':_0x43dd5b[_0x0a9e('0x42')]['id']}},_0x2881b3={};_0x2881b3[_0x0a9e('0x2c')]=_[_0x0a9e('0x2f')](db[_0x0a9e('0x28')][_0x0a9e('0x29')]);_0x2881b3[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x43dd5b[_0x0a9e('0x2e')]);_0x2881b3['filters']=_['intersection'](_0x2881b3[_0x0a9e('0x2c')],_0x2881b3[_0x0a9e('0x2e')]);_0xeaa5e5[_0x0a9e('0x33')]=_[_0x0a9e('0x31')](_0x2881b3[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0xeaa5e5[_0x0a9e('0x33')]=_0xeaa5e5[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0xeaa5e5[_0x0a9e('0x33')]:_0x2881b3['model'];if(_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x3d')]){_0xeaa5e5[_0x0a9e('0x3e')]=[{'all':!![]}];}_0xeaa5e5=_[_0x0a9e('0x3a')]({},_0xeaa5e5,_0x43dd5b[_0x0a9e('0x3c')]);return db[_0x0a9e('0x28')][_0x0a9e('0x43')](_0xeaa5e5)[_0x0a9e('0x22')](handleEntityNotFound(_0x13cb1f,null))['then'](respondWithResult(_0x13cb1f,null))[_0x0a9e('0x40')](handleError(_0x13cb1f,null));};exports['create']=function(_0x473dc8,_0x476688){return db[_0x0a9e('0x28')]['create'](_0x473dc8[_0x0a9e('0x44')],{})[_0x0a9e('0x22')](respondWithResult(_0x476688,0xc9))[_0x0a9e('0x40')](handleError(_0x476688,null));};exports[_0x0a9e('0x21')]=function(_0x45c845,_0x37be73){if(_0x45c845[_0x0a9e('0x44')]['id']){delete _0x45c845['body']['id'];}return db[_0x0a9e('0x28')][_0x0a9e('0x43')]({'where':{'id':_0x45c845[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x37be73,null))[_0x0a9e('0x22')](saveUpdates(_0x45c845[_0x0a9e('0x44')],null))[_0x0a9e('0x22')](respondWithResult(_0x37be73,null))[_0x0a9e('0x40')](handleError(_0x37be73,null));};exports[_0x0a9e('0x23')]=function(_0x58a5c2,_0xe401a){return db[_0x0a9e('0x28')]['find']({'where':{'id':_0x58a5c2['params']['id']}})['then'](handleEntityNotFound(_0xe401a,null))[_0x0a9e('0x22')](removeEntity(_0xe401a,null))[_0x0a9e('0x40')](handleError(_0xe401a,null));};exports[_0x0a9e('0x45')]=function(_0x11545a,_0x61bb17){return db[_0x0a9e('0x28')][_0x0a9e('0x45')]()[_0x0a9e('0x22')](respondWithResult(_0x61bb17,null))['catch'](handleError(_0x61bb17,null));}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.model.js b/server/api/voiceAgentReport/voiceAgentReport.model.js index f3a18b6..058ad1f 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 _0xbd51=['VoiceAgentReport','report_agent','uniqueid','destuniqueid','lodash','../../config/logger','api','moment','bluebird','./voiceAgentReport.attributes','exports','define'];(function(_0x54cb2b,_0x149af0){var _0x3af609=function(_0x4a59fb){while(--_0x4a59fb){_0x54cb2b['push'](_0x54cb2b['shift']());}};_0x3af609(++_0x149af0);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x755fe4,_0x4ee052){_0x755fe4=_0x755fe4-0x0;var _0x530717=_0xbd51[_0x755fe4];return _0x530717;};'use strict';var _=require(_0x1bd5('0x0'));var util=require('util');var logger=require(_0x1bd5('0x1'))(_0x1bd5('0x2'));var moment=require(_0x1bd5('0x3'));var BPromise=require(_0x1bd5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1bd5('0x5'));module[_0x1bd5('0x6')]=function(_0x43e6b6,_0x59ddfb){return _0x43e6b6[_0x1bd5('0x7')](_0x1bd5('0x8'),attributes,{'tableName':_0x1bd5('0x9'),'paranoid':![],'indexes':[{'fields':[_0x1bd5('0xa'),_0x1bd5('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1d25=['exports','define','report_agent','destuniqueid','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./voiceAgentReport.attributes'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0x1d25,0xba));var _0x51d2=function(_0x249e96,_0x3ea39d){_0x249e96=_0x249e96-0x0;var _0x17444c=_0x1d25[_0x249e96];return _0x17444c;};'use strict';var _=require(_0x51d2('0x0'));var util=require(_0x51d2('0x1'));var logger=require(_0x51d2('0x2'))(_0x51d2('0x3'));var moment=require(_0x51d2('0x4'));var BPromise=require('bluebird');var rp=require(_0x51d2('0x5'));var fs=require('fs');var path=require(_0x51d2('0x6'));var rimraf=require('rimraf');var config=require(_0x51d2('0x7'));var attributes=require(_0x51d2('0x8'));module[_0x51d2('0x9')]=function(_0x407091,_0x449fec){return _0x407091[_0x51d2('0xa')]('VoiceAgentReport',attributes,{'tableName':_0x51d2('0xb'),'paranoid':![],'indexes':[{'fields':['uniqueid',_0x51d2('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index cf80583..93fe333 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 _0x9857=['../../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','CreateVoiceAgentReport','VoiceAgentReport','create','options','raw','debug','catch','UpdateVoiceAgentReport','update','body','where','attributes','limit','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x49c046,_0xb09fbe){var _0x1aa16d=function(_0x503c4a){while(--_0x503c4a){_0x49c046['push'](_0x49c046['shift']());}};_0x1aa16d(++_0xb09fbe);}(_0x9857,0x117));var _0x7985=function(_0xd5ab22,_0xbd8d99){_0xd5ab22=_0xd5ab22-0x0;var _0xe2967d=_0x9857[_0xd5ab22];return _0xe2967d;};'use strict';var _=require(_0x7985('0x0'));var util=require('util');var moment=require(_0x7985('0x1'));var BPromise=require(_0x7985('0x2'));var rs=require(_0x7985('0x3'));var fs=require('fs');var Redis=require(_0x7985('0x4'));var db=require(_0x7985('0x5'))['db'];var utils=require(_0x7985('0x6'));var logger=require(_0x7985('0x7'))(_0x7985('0x8'));var config=require(_0x7985('0x9'));var jayson=require(_0x7985('0xa'));var client=jayson[_0x7985('0xb')][_0x7985('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2ba83d,_0x529c1c,_0x109e54){return new BPromise(function(_0x208d44,_0x34fd10){return client[_0x7985('0xd')](_0x2ba83d,_0x109e54)[_0x7985('0xe')](function(_0x11e6ff){logger[_0x7985('0xf')](_0x7985('0x10'),_0x529c1c,_0x7985('0x11'));logger['debug'](_0x7985('0x12'),_0x529c1c,_0x7985('0x11'),JSON[_0x7985('0x13')](_0x11e6ff));if(_0x11e6ff['error']){if(_0x11e6ff[_0x7985('0x14')]['code']===0x1f4){logger[_0x7985('0x14')](_0x7985('0x10'),_0x529c1c,_0x11e6ff[_0x7985('0x14')][_0x7985('0x15')]);return _0x34fd10(_0x11e6ff[_0x7985('0x14')][_0x7985('0x15')]);}logger[_0x7985('0x14')](_0x7985('0x10'),_0x529c1c,_0x11e6ff[_0x7985('0x14')][_0x7985('0x15')]);return _0x208d44(_0x11e6ff[_0x7985('0x14')][_0x7985('0x15')]);}else{logger['info']('VoiceAgentReport,\x20%s,\x20%s',_0x529c1c,'request\x20sent');_0x208d44(_0x11e6ff[_0x7985('0x16')][_0x7985('0x15')]);}})['catch'](function(_0xae5abf){logger[_0x7985('0x14')]('VoiceAgentReport,\x20%s,\x20%s',_0x529c1c,_0xae5abf);_0x34fd10(_0xae5abf);});});}exports[_0x7985('0x17')]=function(_0x2bdce3){var _0x12f6d9=this;return new Promise(function(_0x481c5c,_0x466e3b){return db[_0x7985('0x18')][_0x7985('0x19')](_0x2bdce3['body'],{'raw':_0x2bdce3[_0x7985('0x1a')]?_0x2bdce3['options'][_0x7985('0x1b')]===undefined?!![]:![]:!![]})[_0x7985('0xe')](function(_0x4b24ab){logger['info'](_0x7985('0x17'),_0x2bdce3);logger[_0x7985('0x1c')](_0x7985('0x17'),_0x2bdce3,JSON[_0x7985('0x13')](_0x4b24ab));_0x481c5c(_0x4b24ab);})[_0x7985('0x1d')](function(_0x2e79bb){logger['error'](_0x7985('0x17'),_0x2e79bb[_0x7985('0x15')],_0x2bdce3);_0x466e3b(_0x12f6d9[_0x7985('0x14')](0x1f4,_0x2e79bb['message']));});});};exports[_0x7985('0x1e')]=function(_0x5ecca6){var _0x8e7232=this;return new Promise(function(_0x5023e6,_0x352278){return db['VoiceAgentReport'][_0x7985('0x1f')](_0x5ecca6[_0x7985('0x20')],{'raw':_0x5ecca6[_0x7985('0x1a')]?_0x5ecca6['options'][_0x7985('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5ecca6[_0x7985('0x1a')]?_0x5ecca6[_0x7985('0x1a')][_0x7985('0x21')]||null:null,'attributes':_0x5ecca6[_0x7985('0x1a')]?_0x5ecca6[_0x7985('0x1a')][_0x7985('0x22')]||null:null,'limit':_0x5ecca6['options']?_0x5ecca6[_0x7985('0x1a')][_0x7985('0x23')]||null:null})['then'](function(_0xb16db6){logger[_0x7985('0xf')](_0x7985('0x1e'),_0x5ecca6);logger[_0x7985('0x1c')](_0x7985('0x1e'),_0x5ecca6,JSON[_0x7985('0x13')](_0xb16db6));_0x5023e6(_0xb16db6);})[_0x7985('0x1d')](function(_0x58af95){logger['error'](_0x7985('0x1e'),_0x58af95[_0x7985('0x15')],_0x5ecca6);_0x352278(_0x8e7232[_0x7985('0x14')](0x1f4,_0x58af95[_0x7985('0x15')]));});});}; \ No newline at end of file +var _0x3952=['message','result','catch','CreateVoiceAgentReport','body','options','raw','debug','stringify','UpdateVoiceAgentReport','VoiceAgentReport','update','where','attributes','limit','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','VoiceAgentReport,\x20%s,\x20%s','VoiceAgentReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code'];(function(_0x8a19a4,_0x62ebbb){var _0x1492ee=function(_0x1528ae){while(--_0x1528ae){_0x8a19a4['push'](_0x8a19a4['shift']());}};_0x1492ee(++_0x62ebbb);}(_0x3952,0x97));var _0x2395=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0x3952[_0x5f3f88];return _0xd08119;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2395('0x0'));var BPromise=require(_0x2395('0x1'));var rs=require(_0x2395('0x2'));var fs=require('fs');var Redis=require(_0x2395('0x3'));var db=require(_0x2395('0x4'))['db'];var utils=require(_0x2395('0x5'));var logger=require(_0x2395('0x6'))(_0x2395('0x7'));var config=require(_0x2395('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x2395('0x9')][_0x2395('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x586367,_0x3897c1,_0x345055){return new BPromise(function(_0x1f8ffe,_0x97fdad){return client[_0x2395('0xb')](_0x586367,_0x345055)[_0x2395('0xc')](function(_0x43da98){logger[_0x2395('0xd')](_0x2395('0xe'),_0x3897c1,'request\x20sent');logger['debug'](_0x2395('0xf'),_0x3897c1,_0x2395('0x10'),JSON['stringify'](_0x43da98));if(_0x43da98[_0x2395('0x11')]){if(_0x43da98[_0x2395('0x11')][_0x2395('0x12')]===0x1f4){logger[_0x2395('0x11')]('VoiceAgentReport,\x20%s,\x20%s',_0x3897c1,_0x43da98[_0x2395('0x11')][_0x2395('0x13')]);return _0x97fdad(_0x43da98[_0x2395('0x11')][_0x2395('0x13')]);}logger[_0x2395('0x11')](_0x2395('0xe'),_0x3897c1,_0x43da98['error'][_0x2395('0x13')]);return _0x1f8ffe(_0x43da98[_0x2395('0x11')][_0x2395('0x13')]);}else{logger[_0x2395('0xd')](_0x2395('0xe'),_0x3897c1,_0x2395('0x10'));_0x1f8ffe(_0x43da98[_0x2395('0x14')]['message']);}})[_0x2395('0x15')](function(_0x13cce2){logger[_0x2395('0x11')](_0x2395('0xe'),_0x3897c1,_0x13cce2);_0x97fdad(_0x13cce2);});});}exports[_0x2395('0x16')]=function(_0x4ba1a9){var _0x538279=this;return new Promise(function(_0x20fb23,_0x158eda){return db['VoiceAgentReport']['create'](_0x4ba1a9[_0x2395('0x17')],{'raw':_0x4ba1a9[_0x2395('0x18')]?_0x4ba1a9[_0x2395('0x18')][_0x2395('0x19')]===undefined?!![]:![]:!![]})[_0x2395('0xc')](function(_0x790c5a){logger[_0x2395('0xd')](_0x2395('0x16'),_0x4ba1a9);logger[_0x2395('0x1a')](_0x2395('0x16'),_0x4ba1a9,JSON[_0x2395('0x1b')](_0x790c5a));_0x20fb23(_0x790c5a);})[_0x2395('0x15')](function(_0x16f7e7){logger[_0x2395('0x11')](_0x2395('0x16'),_0x16f7e7['message'],_0x4ba1a9);_0x158eda(_0x538279[_0x2395('0x11')](0x1f4,_0x16f7e7[_0x2395('0x13')]));});});};exports[_0x2395('0x1c')]=function(_0x36cbd1){var _0x49b285=this;return new Promise(function(_0x19745e,_0x351a5e){return db[_0x2395('0x1d')][_0x2395('0x1e')](_0x36cbd1[_0x2395('0x17')],{'raw':_0x36cbd1[_0x2395('0x18')]?_0x36cbd1[_0x2395('0x18')][_0x2395('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x36cbd1['options']?_0x36cbd1[_0x2395('0x18')][_0x2395('0x1f')]||null:null,'attributes':_0x36cbd1[_0x2395('0x18')]?_0x36cbd1['options'][_0x2395('0x20')]||null:null,'limit':_0x36cbd1['options']?_0x36cbd1[_0x2395('0x18')][_0x2395('0x21')]||null:null})[_0x2395('0xc')](function(_0x507ddf){logger[_0x2395('0xd')](_0x2395('0x1c'),_0x36cbd1);logger[_0x2395('0x1a')](_0x2395('0x1c'),_0x36cbd1,JSON['stringify'](_0x507ddf));_0x19745e(_0x507ddf);})[_0x2395('0x15')](function(_0x532038){logger['error']('UpdateVoiceAgentReport',_0x532038[_0x2395('0x13')],_0x36cbd1);_0x351a5e(_0x49b285[_0x2395('0x11')](0x1f4,_0x532038[_0x2395('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index ef4b751..fc24741 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 _0xda46=['express','../../components/auth/service','./voiceCallReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','put','/with-retry/:id','updateWithRetry','delete','destroy','exports'];(function(_0xa3fadc,_0xd1e16){var _0x23ecb8=function(_0x2c71f7){while(--_0x2c71f7){_0xa3fadc['push'](_0xa3fadc['shift']());}};_0x23ecb8(++_0xd1e16);}(_0xda46,0x1db));var _0x6da4=function(_0x347c6b,_0x15f0ed){_0x347c6b=_0x347c6b-0x0;var _0x2b98c8=_0xda46[_0x347c6b];return _0x2b98c8;};'use strict';var express=require(_0x6da4('0x0'));var router=express['Router']();var auth=require(_0x6da4('0x1'));var controller=require(_0x6da4('0x2'));router[_0x6da4('0x3')]('/',auth[_0x6da4('0x4')](),controller[_0x6da4('0x5')]);router[_0x6da4('0x3')](_0x6da4('0x6'),auth[_0x6da4('0x4')](),controller[_0x6da4('0x7')]);router[_0x6da4('0x3')](_0x6da4('0x8'),auth['isAuthenticated'](),controller[_0x6da4('0x9')]);router[_0x6da4('0xa')]('/',auth['isAuthenticated'](),controller[_0x6da4('0xb')]);router['put'](_0x6da4('0x8'),auth[_0x6da4('0x4')](),controller[_0x6da4('0xc')]);router[_0x6da4('0xd')](_0x6da4('0xe'),auth[_0x6da4('0x4')](),controller[_0x6da4('0xf')]);router[_0x6da4('0x10')](_0x6da4('0x8'),auth[_0x6da4('0x4')](),controller[_0x6da4('0x11')]);module[_0x6da4('0x12')]=router; \ No newline at end of file +var _0x1e0f=['../../components/auth/service','get','isAuthenticated','index','/describe','show','post','put','/:id','update','/with-retry/:id','updateWithRetry','delete','destroy','exports','express','Router'];(function(_0x13a5e2,_0x4e2d46){var _0x42c586=function(_0x935b12){while(--_0x935b12){_0x13a5e2['push'](_0x13a5e2['shift']());}};_0x42c586(++_0x4e2d46);}(_0x1e0f,0x174));var _0xf1e0=function(_0x3cd546,_0x2f0f3f){_0x3cd546=_0x3cd546-0x0;var _0x14d27f=_0x1e0f[_0x3cd546];return _0x14d27f;};'use strict';var express=require(_0xf1e0('0x0'));var router=express[_0xf1e0('0x1')]();var auth=require(_0xf1e0('0x2'));var controller=require('./voiceCallReport.controller');router[_0xf1e0('0x3')]('/',auth[_0xf1e0('0x4')](),controller[_0xf1e0('0x5')]);router[_0xf1e0('0x3')](_0xf1e0('0x6'),auth['isAuthenticated'](),controller['describe']);router[_0xf1e0('0x3')]('/:id',auth[_0xf1e0('0x4')](),controller[_0xf1e0('0x7')]);router[_0xf1e0('0x8')]('/',auth[_0xf1e0('0x4')](),controller['create']);router[_0xf1e0('0x9')](_0xf1e0('0xa'),auth['isAuthenticated'](),controller[_0xf1e0('0xb')]);router[_0xf1e0('0x9')](_0xf1e0('0xc'),auth[_0xf1e0('0x4')](),controller[_0xf1e0('0xd')]);router[_0xf1e0('0xe')](_0xf1e0('0xa'),auth[_0xf1e0('0x4')](),controller[_0xf1e0('0xf')]);module[_0xf1e0('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index 8d8aaae..e0ee606 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 _0xa936=['DATE','INTEGER','STRING','ENUM','inbound','outbound','inbound-fax','outbound-fax','TEXT'];(function(_0x463f5b,_0x3f85e8){var _0x49e652=function(_0x1ff26d){while(--_0x1ff26d){_0x463f5b['push'](_0x463f5b['shift']());}};_0x49e652(++_0x3f85e8);}(_0xa936,0x107));var _0x6a93=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0xa936[_0x1e4360];return _0x31e6b4;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x6a93('0x0')]},'type':{'type':Sequelize[_0x6a93('0x1')](_0x6a93('0x2'),'internal',_0x6a93('0x3'),_0x6a93('0x4'),_0x6a93('0x5'),'dialer')},'tag':{'type':Sequelize[_0x6a93('0x0')]},'accountcode':{'type':Sequelize['STRING']},'source':{'type':Sequelize[_0x6a93('0x0')]},'destination':{'type':Sequelize[_0x6a93('0x0')]},'destinationcontext':{'type':Sequelize[_0x6a93('0x0')]},'callerid':{'type':Sequelize[_0x6a93('0x0')]},'channel':{'type':Sequelize[_0x6a93('0x0')]},'destinationchannel':{'type':Sequelize[_0x6a93('0x0')]},'lastapplication':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x6a93('0x6')]},'starttime':{'type':Sequelize[_0x6a93('0x7')]},'systemanswertime':{'type':Sequelize[_0x6a93('0x7')]},'answertime':{'type':Sequelize[_0x6a93('0x7')]},'endtime':{'type':Sequelize[_0x6a93('0x7')]},'duration':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0x6a93('0x8')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x6a93('0x0')]},'amaflags':{'type':Sequelize[_0x6a93('0x0')]},'userfield':{'type':Sequelize[_0x6a93('0x0')]},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x6a93('0x0')]},'userThirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x6a93('0x0')]},'prefix':{'type':Sequelize[_0x6a93('0x0')]},'routeid':{'type':Sequelize[_0x6a93('0x8')]},'sipcallid':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x5c3c=['STRING','ENUM','internal','outbound','inbound-fax','outbound-fax','dialer','DATE','INTEGER','sequelize','exports'];(function(_0x552dee,_0x1e45b0){var _0x30072e=function(_0x151eca){while(--_0x151eca){_0x552dee['push'](_0x552dee['shift']());}};_0x30072e(++_0x1e45b0);}(_0x5c3c,0x132));var _0xc5c3=function(_0x513aa5,_0x1fba79){_0x513aa5=_0x513aa5-0x0;var _0x1a1a7c=_0x5c3c[_0x513aa5];return _0x1a1a7c;};'use strict';var Sequelize=require(_0xc5c3('0x0'));module[_0xc5c3('0x1')]={'uniqueid':{'type':Sequelize[_0xc5c3('0x2')]},'type':{'type':Sequelize[_0xc5c3('0x3')]('inbound',_0xc5c3('0x4'),_0xc5c3('0x5'),_0xc5c3('0x6'),_0xc5c3('0x7'),_0xc5c3('0x8'))},'tag':{'type':Sequelize[_0xc5c3('0x2')]},'accountcode':{'type':Sequelize[_0xc5c3('0x2')]},'source':{'type':Sequelize[_0xc5c3('0x2')]},'destination':{'type':Sequelize[_0xc5c3('0x2')]},'destinationcontext':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize[_0xc5c3('0x2')]},'lastapplication':{'type':Sequelize[_0xc5c3('0x2')]},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize[_0xc5c3('0x9')]},'systemanswertime':{'type':Sequelize[_0xc5c3('0x9')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xc5c3('0x9')]},'duration':{'type':Sequelize[_0xc5c3('0xa')]},'billableseconds':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0xc5c3('0xa')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xc5c3('0x2')]},'amaflags':{'type':Sequelize[_0xc5c3('0x2')]},'userfield':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize[_0xc5c3('0x2')]},'userSecondDisposition':{'type':Sequelize[_0xc5c3('0x2')]},'userThirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xc5c3('0x2')]},'prefix':{'type':Sequelize[_0xc5c3('0x2')]},'routeid':{'type':Sequelize[_0xc5c3('0xa')]},'sipcallid':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index 92fd6ba..9ee64a6 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 _0x432d=['nolimit','sort','pick','filter','where','merge','VIRTUAL','VoiceCallReport','include','fullname','alias','User','rows','show','params','includeAll','options','find','catch','create','body','user','uniqueid','No\x20such\x20report','lodash','../../components/parsers/qs','../../config/logger','api','../../mysqldb','promise-retry','status','json','offset','undefined','count','limit','set','update','then','destroy','end','error','name','index','map','rawAttributes','fieldName','type','key','query','keys','filters','attributes','intersection','model','fields','length','hasOwnProperty'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x432d,0x8c));var _0xd432=function(_0x5d5ea8,_0x24952a){_0x5d5ea8=_0x5d5ea8-0x0;var _0x553c87=_0x432d[_0x5d5ea8];return _0x553c87;};'use strict';var _=require(_0xd432('0x0'));var qs=require(_0xd432('0x1'));var logger=require(_0xd432('0x2'))(_0xd432('0x3'));var db=require(_0xd432('0x4'))['db'];const promiseRetry=require(_0xd432('0x5'));function respondWithResult(_0x2b5754,_0x4d57a7){_0x4d57a7=_0x4d57a7||0xc8;return function(_0x3ef546){if(_0x3ef546){return _0x2b5754[_0xd432('0x6')](_0x4d57a7)[_0xd432('0x7')](_0x3ef546);}};}function respondWithFilteredResult(_0x41941b,_0x44af94){return function(_0x148fa9){if(_0x148fa9){var _0x16d8f5=typeof _0x44af94[_0xd432('0x8')]===_0xd432('0x9')&&typeof _0x44af94['limit']===_0xd432('0x9');var _0x1ab1de=_0x148fa9[_0xd432('0xa')];var _0xad1c54=_0x16d8f5?0x0:_0x44af94['offset'];var _0x1f3869=_0x16d8f5?_0x148fa9['count']:_0x44af94[_0xd432('0x8')]+_0x44af94[_0xd432('0xb')];var _0x32f17f;if(_0x1f3869>=_0x1ab1de){_0x1f3869=_0x1ab1de;_0x32f17f=0xc8;}else{_0x32f17f=0xce;}_0x41941b[_0xd432('0x6')](_0x32f17f);return _0x41941b[_0xd432('0xc')]('Content-Range',_0xad1c54+'-'+_0x1f3869+'/'+_0x1ab1de)['json'](_0x148fa9);}return null;};}function saveUpdates(_0x215859){return function(_0x1e835d){if(_0x1e835d){return _0x1e835d[_0xd432('0xd')](_0x215859)[_0xd432('0xe')](function(_0x48e48e){return _0x48e48e;});}return null;};}function removeEntity(_0x529d24){return function(_0x816dc5){if(_0x816dc5){return _0x816dc5[_0xd432('0xf')]()[_0xd432('0xe')](function(){_0x529d24[_0xd432('0x6')](0xcc)[_0xd432('0x10')]();});}};}function handleEntityNotFound(_0x242873){return function(_0x51c334){if(!_0x51c334){_0x242873['sendStatus'](0x194);}return _0x51c334;};}function handleError(_0x38cfda,_0x1ea07f){_0x1ea07f=_0x1ea07f||0x1f4;return function(_0x46fe09){logger[_0xd432('0x11')](_0x46fe09['stack']);if(_0x46fe09['name']){delete _0x46fe09[_0xd432('0x12')];}_0x38cfda[_0xd432('0x6')](_0x1ea07f)['send'](_0x46fe09);};}exports[_0xd432('0x13')]=function(_0x19dc46,_0x34bb63){var _0x2e9c40={},_0x8805e1={},_0x503760={'count':0x0,'rows':[]};var _0x12f801=_[_0xd432('0x14')](db['VoiceCallReport'][_0xd432('0x15')],function(_0x577340){return{'name':_0x577340[_0xd432('0x16')],'type':_0x577340[_0xd432('0x17')][_0xd432('0x18')]};});_0x8805e1['model']=_[_0xd432('0x14')](_0x12f801,_0xd432('0x12'));_0x8805e1[_0xd432('0x19')]=_[_0xd432('0x1a')](_0x19dc46[_0xd432('0x19')]);_0x8805e1[_0xd432('0x1b')]=_['intersection'](_0x8805e1['model'],_0x8805e1[_0xd432('0x19')]);_0x2e9c40[_0xd432('0x1c')]=_[_0xd432('0x1d')](_0x8805e1[_0xd432('0x1e')],qs[_0xd432('0x1f')](_0x19dc46[_0xd432('0x19')]['fields']));_0x2e9c40[_0xd432('0x1c')]=_0x2e9c40[_0xd432('0x1c')][_0xd432('0x20')]?_0x2e9c40[_0xd432('0x1c')]:_0x8805e1[_0xd432('0x1e')];if(!_0x19dc46[_0xd432('0x19')][_0xd432('0x21')](_0xd432('0x22'))){_0x2e9c40['limit']=qs[_0xd432('0xb')](_0x19dc46[_0xd432('0x19')][_0xd432('0xb')]);_0x2e9c40[_0xd432('0x8')]=qs[_0xd432('0x8')](_0x19dc46[_0xd432('0x19')][_0xd432('0x8')]);}_0x2e9c40['order']=qs[_0xd432('0x23')](_0x19dc46[_0xd432('0x19')]['sort']);_0x2e9c40['where']=qs[_0xd432('0x1b')](_[_0xd432('0x24')](_0x19dc46[_0xd432('0x19')],_0x8805e1[_0xd432('0x1b')]),_0x12f801);if(_0x19dc46[_0xd432('0x19')][_0xd432('0x25')]){_0x2e9c40[_0xd432('0x26')]=_[_0xd432('0x27')](_0x2e9c40[_0xd432('0x26')],{'$or':_[_0xd432('0x14')](_0x12f801,function(_0x419295){if(_0x419295[_0xd432('0x17')]!==_0xd432('0x28')){var _0x851a0d={};_0x851a0d[_0x419295[_0xd432('0x12')]]={'$like':'%'+_0x19dc46[_0xd432('0x19')]['filter']+'%'};return _0x851a0d;}})});}_0x2e9c40=_[_0xd432('0x27')]({},_0x2e9c40,_0x19dc46['options']);var _0x3898d3={'where':_0x2e9c40[_0xd432('0x26')]};return db[_0xd432('0x29')][_0xd432('0xa')](_0x3898d3)[_0xd432('0xe')](function(_0x4d4638){_0x503760[_0xd432('0xa')]=_0x4d4638;if(_0x19dc46['query']['includeAll']){_0x2e9c40[_0xd432('0x2a')]=[{'attributes':['id',_0xd432('0x12'),_0xd432('0x2b'),_0xd432('0x2c')],'model':db[_0xd432('0x2d')],'as':_0xd432('0x2d')}];}return db[_0xd432('0x29')]['findAll'](_0x2e9c40);})['then'](function(_0x26fea1){_0x503760[_0xd432('0x2e')]=_0x26fea1;return _0x503760;})[_0xd432('0xe')](respondWithFilteredResult(_0x34bb63,_0x2e9c40))['catch'](handleError(_0x34bb63,null));};exports[_0xd432('0x2f')]=function(_0x1a7926,_0x34c17b){var _0x4e0e8e={'raw':!![],'where':{'id':_0x1a7926[_0xd432('0x30')]['id']}},_0x57e2cd={};_0x57e2cd[_0xd432('0x1e')]=_[_0xd432('0x1a')](db[_0xd432('0x29')][_0xd432('0x15')]);_0x57e2cd[_0xd432('0x19')]=_[_0xd432('0x1a')](_0x1a7926[_0xd432('0x19')]);_0x57e2cd['filters']=_['intersection'](_0x57e2cd[_0xd432('0x1e')],_0x57e2cd[_0xd432('0x19')]);_0x4e0e8e[_0xd432('0x1c')]=_['intersection'](_0x57e2cd[_0xd432('0x1e')],qs[_0xd432('0x1f')](_0x1a7926[_0xd432('0x19')][_0xd432('0x1f')]));_0x4e0e8e[_0xd432('0x1c')]=_0x4e0e8e['attributes'][_0xd432('0x20')]?_0x4e0e8e[_0xd432('0x1c')]:_0x57e2cd['model'];if(_0x1a7926[_0xd432('0x19')][_0xd432('0x31')]){_0x4e0e8e[_0xd432('0x2a')]=[{'all':!![]}];}_0x4e0e8e=_[_0xd432('0x27')]({},_0x4e0e8e,_0x1a7926[_0xd432('0x32')]);return db[_0xd432('0x29')][_0xd432('0x33')](_0x4e0e8e)[_0xd432('0xe')](handleEntityNotFound(_0x34c17b,null))[_0xd432('0xe')](respondWithResult(_0x34c17b,null))[_0xd432('0x34')](handleError(_0x34c17b,null));};exports[_0xd432('0x35')]=function(_0x34299b,_0x1a0371){return db[_0xd432('0x29')][_0xd432('0x35')](_0x34299b[_0xd432('0x36')],{})[_0xd432('0xe')](respondWithResult(_0x1a0371,0xc9))[_0xd432('0x34')](handleError(_0x1a0371,null));};exports[_0xd432('0xf')]=function(_0x39b8d7,_0x1fda15){return db[_0xd432('0x29')][_0xd432('0x33')]({'where':{'id':_0x39b8d7[_0xd432('0x30')]['id']}})['then'](handleEntityNotFound(_0x1fda15,null))['then'](removeEntity(_0x1fda15,null))['catch'](handleError(_0x1fda15,null));};exports['describe']=function(_0x4ffac7,_0x31ed16){return db[_0xd432('0x29')]['describe']()[_0xd432('0xe')](respondWithResult(_0x31ed16,null))[_0xd432('0x34')](handleError(_0x31ed16,null));};function findForUpdate(_0x55fbcb){return db[_0xd432('0x29')][_0xd432('0x33')]({'where':{'uniqueid':_0x55fbcb[_0xd432('0x30')]['id'],'UserId':{'$or':[null,_0x55fbcb[_0xd432('0x37')]['id']]}}});}exports['update']=function(_0xd752c9,_0x222311){if(_0xd752c9[_0xd432('0x36')][_0xd432('0x38')]){delete _0xd752c9[_0xd432('0x36')][_0xd432('0x38')];}return findForUpdate(_0xd752c9)['then'](handleEntityNotFound(_0x222311,null))[_0xd432('0xe')](saveUpdates(_0xd752c9['body'],null))[_0xd432('0xe')](respondWithResult(_0x222311,null))[_0xd432('0x34')](handleError(_0x222311,null));};exports['updateWithRetry']=function(_0x1363b1,_0x8d0bd8,_0x3ece60){if(_0x1363b1['body'][_0xd432('0x38')]){delete _0x1363b1[_0xd432('0x36')][_0xd432('0x38')];}promiseRetry(function(){return findForUpdate(_0x1363b1)[_0xd432('0xe')](_0x20fa1f=>{if(_0x20fa1f){return _0x20fa1f;}else throw new Error(_0xd432('0x39'));});},{'retries':0x6,'minTimeout':0xfa})[_0xd432('0xe')](function(_0x253e75){if(!_0x253e75){return new Promise(function(_0x49fec0){_0x49fec0(handleEntityNotFound(_0x8d0bd8)());});}else{return _0x253e75[_0xd432('0xd')](_0x1363b1[_0xd432('0x36')])[_0xd432('0xe')](function(_0x132128){return respondWithResult(_0x8d0bd8)(_0x132128);});}},function(){handleEntityNotFound(_0x8d0bd8)();});}; \ No newline at end of file +var _0x757a=['undefined','limit','count','then','destroy','end','sendStatus','error','stack','name','send','index','VoiceCallReport','rawAttributes','fieldName','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','include','fullname','alias','User','findAll','rows','show','params','includeAll','create','catch','find','describe','user','body','uniqueid','No\x20such\x20report','update','../../components/parsers/qs','../../config/logger','promise-retry','bluebird','status','offset'];(function(_0x43d11d,_0xccff91){var _0x38cd08=function(_0x131ae2){while(--_0x131ae2){_0x43d11d['push'](_0x43d11d['shift']());}};_0x38cd08(++_0xccff91);}(_0x757a,0xde));var _0xa757=function(_0x4f3313,_0x464020){_0x4f3313=_0x4f3313-0x0;var _0x30a4ee=_0x757a[_0x4f3313];return _0x30a4ee;};'use strict';var _=require('lodash');var qs=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var db=require('../../mysqldb')['db'];var Promise=require('bluebird');const promiseRetry=require(_0xa757('0x2'));const {resolve}=require(_0xa757('0x3'));function respondWithResult(_0x1c2932,_0x453d07){_0x453d07=_0x453d07||0xc8;return function(_0x32630d){if(_0x32630d){return _0x1c2932[_0xa757('0x4')](_0x453d07)['json'](_0x32630d);}};}function respondWithFilteredResult(_0xae0e7c,_0x4343b6){return function(_0x53be0e){if(_0x53be0e){var _0x2930fa=typeof _0x4343b6[_0xa757('0x5')]===_0xa757('0x6')&&typeof _0x4343b6[_0xa757('0x7')]===_0xa757('0x6');var _0x5aef8a=_0x53be0e[_0xa757('0x8')];var _0x2ca96f=_0x2930fa?0x0:_0x4343b6[_0xa757('0x5')];var _0x3e2c9a=_0x2930fa?_0x53be0e[_0xa757('0x8')]:_0x4343b6[_0xa757('0x5')]+_0x4343b6[_0xa757('0x7')];var _0x483d77;if(_0x3e2c9a>=_0x5aef8a){_0x3e2c9a=_0x5aef8a;_0x483d77=0xc8;}else{_0x483d77=0xce;}_0xae0e7c['status'](_0x483d77);return _0xae0e7c['set']('Content-Range',_0x2ca96f+'-'+_0x3e2c9a+'/'+_0x5aef8a)['json'](_0x53be0e);}return null;};}function saveUpdates(_0x421040){return function(_0x544b45){if(_0x544b45){return _0x544b45['update'](_0x421040)[_0xa757('0x9')](function(_0x513b1f){return _0x513b1f;});}return null;};}function removeEntity(_0x481508){return function(_0x32112b){if(_0x32112b){return _0x32112b[_0xa757('0xa')]()[_0xa757('0x9')](function(){_0x481508[_0xa757('0x4')](0xcc)[_0xa757('0xb')]();});}};}function handleEntityNotFound(_0x31cfd2){return function(_0xf12b68){if(!_0xf12b68){_0x31cfd2[_0xa757('0xc')](0x194);}return _0xf12b68;};}function handleError(_0x185011,_0x3df1f9){_0x3df1f9=_0x3df1f9||0x1f4;return function(_0x50aac1){logger[_0xa757('0xd')](_0x50aac1[_0xa757('0xe')]);if(_0x50aac1[_0xa757('0xf')]){delete _0x50aac1['name'];}_0x185011['status'](_0x3df1f9)[_0xa757('0x10')](_0x50aac1);};}exports[_0xa757('0x11')]=function(_0x1bd14c,_0x340599){var _0x27f4ba={},_0xe2d567={},_0x4bd137={'count':0x0,'rows':[]};var _0x58954=_['map'](db[_0xa757('0x12')][_0xa757('0x13')],function(_0x14014c){return{'name':_0x14014c[_0xa757('0x14')],'type':_0x14014c['type']['key']};});_0xe2d567[_0xa757('0x15')]=_[_0xa757('0x16')](_0x58954,_0xa757('0xf'));_0xe2d567[_0xa757('0x17')]=_[_0xa757('0x18')](_0x1bd14c[_0xa757('0x17')]);_0xe2d567[_0xa757('0x19')]=_[_0xa757('0x1a')](_0xe2d567[_0xa757('0x15')],_0xe2d567['query']);_0x27f4ba[_0xa757('0x1b')]=_['intersection'](_0xe2d567[_0xa757('0x15')],qs['fields'](_0x1bd14c[_0xa757('0x17')][_0xa757('0x1c')]));_0x27f4ba[_0xa757('0x1b')]=_0x27f4ba['attributes'][_0xa757('0x1d')]?_0x27f4ba[_0xa757('0x1b')]:_0xe2d567[_0xa757('0x15')];if(!_0x1bd14c[_0xa757('0x17')]['hasOwnProperty'](_0xa757('0x1e'))){_0x27f4ba['limit']=qs['limit'](_0x1bd14c['query']['limit']);_0x27f4ba[_0xa757('0x5')]=qs['offset'](_0x1bd14c[_0xa757('0x17')][_0xa757('0x5')]);}_0x27f4ba['order']=qs[_0xa757('0x1f')](_0x1bd14c['query'][_0xa757('0x1f')]);_0x27f4ba[_0xa757('0x20')]=qs['filters'](_[_0xa757('0x21')](_0x1bd14c['query'],_0xe2d567[_0xa757('0x19')]),_0x58954);if(_0x1bd14c[_0xa757('0x17')][_0xa757('0x22')]){_0x27f4ba[_0xa757('0x20')]=_[_0xa757('0x23')](_0x27f4ba[_0xa757('0x20')],{'$or':_[_0xa757('0x16')](_0x58954,function(_0x2220df){if(_0x2220df[_0xa757('0x24')]!==_0xa757('0x25')){var _0x1f5d5a={};_0x1f5d5a[_0x2220df[_0xa757('0xf')]]={'$like':'%'+_0x1bd14c[_0xa757('0x17')][_0xa757('0x22')]+'%'};return _0x1f5d5a;}})});}_0x27f4ba=_[_0xa757('0x23')]({},_0x27f4ba,_0x1bd14c[_0xa757('0x26')]);var _0x3e64b7={'where':_0x27f4ba[_0xa757('0x20')]};return db[_0xa757('0x12')][_0xa757('0x8')](_0x3e64b7)[_0xa757('0x9')](function(_0x170aa9){_0x4bd137[_0xa757('0x8')]=_0x170aa9;if(_0x1bd14c[_0xa757('0x17')]['includeAll']){_0x27f4ba[_0xa757('0x27')]=[{'attributes':['id',_0xa757('0xf'),_0xa757('0x28'),_0xa757('0x29')],'model':db[_0xa757('0x2a')],'as':'User'}];}return db[_0xa757('0x12')][_0xa757('0x2b')](_0x27f4ba);})[_0xa757('0x9')](function(_0x2c34b1){_0x4bd137[_0xa757('0x2c')]=_0x2c34b1;return _0x4bd137;})[_0xa757('0x9')](respondWithFilteredResult(_0x340599,_0x27f4ba))['catch'](handleError(_0x340599,null));};exports[_0xa757('0x2d')]=function(_0x444639,_0x2cade7){var _0xc34409={'raw':!![],'where':{'id':_0x444639[_0xa757('0x2e')]['id']}},_0x3b5104={};_0x3b5104[_0xa757('0x15')]=_[_0xa757('0x18')](db[_0xa757('0x12')]['rawAttributes']);_0x3b5104[_0xa757('0x17')]=_[_0xa757('0x18')](_0x444639[_0xa757('0x17')]);_0x3b5104[_0xa757('0x19')]=_[_0xa757('0x1a')](_0x3b5104[_0xa757('0x15')],_0x3b5104['query']);_0xc34409[_0xa757('0x1b')]=_[_0xa757('0x1a')](_0x3b5104['model'],qs['fields'](_0x444639[_0xa757('0x17')][_0xa757('0x1c')]));_0xc34409['attributes']=_0xc34409['attributes'][_0xa757('0x1d')]?_0xc34409[_0xa757('0x1b')]:_0x3b5104[_0xa757('0x15')];if(_0x444639['query'][_0xa757('0x2f')]){_0xc34409[_0xa757('0x27')]=[{'all':!![]}];}_0xc34409=_[_0xa757('0x23')]({},_0xc34409,_0x444639[_0xa757('0x26')]);return db[_0xa757('0x12')]['find'](_0xc34409)[_0xa757('0x9')](handleEntityNotFound(_0x2cade7,null))['then'](respondWithResult(_0x2cade7,null))['catch'](handleError(_0x2cade7,null));};exports[_0xa757('0x30')]=function(_0x57298b,_0x373747){return db[_0xa757('0x12')][_0xa757('0x30')](_0x57298b['body'],{})['then'](respondWithResult(_0x373747,0xc9))[_0xa757('0x31')](handleError(_0x373747,null));};exports[_0xa757('0xa')]=function(_0x2b171c,_0xe03a3c){return db[_0xa757('0x12')][_0xa757('0x32')]({'where':{'id':_0x2b171c['params']['id']}})[_0xa757('0x9')](handleEntityNotFound(_0xe03a3c,null))[_0xa757('0x9')](removeEntity(_0xe03a3c,null))['catch'](handleError(_0xe03a3c,null));};exports[_0xa757('0x33')]=function(_0x515123,_0x2d111e){return db[_0xa757('0x12')]['describe']()[_0xa757('0x9')](respondWithResult(_0x2d111e,null))[_0xa757('0x31')](handleError(_0x2d111e,null));};function findForUpdate(_0x4bee69){return db[_0xa757('0x12')][_0xa757('0x32')]({'where':{'uniqueid':_0x4bee69[_0xa757('0x2e')]['id'],'UserId':{'$or':[null,_0x4bee69[_0xa757('0x34')]['id']]}}});}exports['update']=function(_0x199dc9,_0x1be3bb){if(_0x199dc9[_0xa757('0x35')][_0xa757('0x36')]){delete _0x199dc9['body'][_0xa757('0x36')];}return findForUpdate(_0x199dc9)['then'](handleEntityNotFound(_0x1be3bb,null))['then'](saveUpdates(_0x199dc9[_0xa757('0x35')],null))[_0xa757('0x9')](respondWithResult(_0x1be3bb,null))[_0xa757('0x31')](handleError(_0x1be3bb,null));};exports['updateWithRetry']=function(_0x421c65,_0x560c6c,_0x2ed63f){if(_0x421c65[_0xa757('0x35')][_0xa757('0x36')]){delete _0x421c65[_0xa757('0x35')][_0xa757('0x36')];}promiseRetry(function(){return new Promise(function(_0x1f21c0,_0x57bf73){findForUpdate(_0x421c65)[_0xa757('0x9')](function(_0x581e95){if(_0x581e95){_0x1f21c0(_0x581e95);}else _0x57bf73(_0xa757('0x37'));});});},{'retries':0x6,'minTimeout':0xfa})[_0xa757('0x9')](function(_0x33347a){if(!_0x33347a){return new Promise(function(_0x29434d){_0x29434d(handleEntityNotFound(_0x560c6c)());});}else{return _0x33347a[_0xa757('0x38')](_0x421c65[_0xa757('0x35')])[_0xa757('0x9')](function(_0x2c5b3c){return respondWithResult(_0x560c6c)(_0x2c5b3c);});}},function(){handleEntityNotFound(_0x560c6c)();});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index 9305e2a..1a27571 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 _0x900e=['VoiceCallReport','report_call','uniqueid','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceCallReport.attributes','exports','define'];(function(_0x207f0d,_0xe6dac2){var _0x2355e8=function(_0x76f06b){while(--_0x76f06b){_0x207f0d['push'](_0x207f0d['shift']());}};_0x2355e8(++_0xe6dac2);}(_0x900e,0x1b6));var _0xe900=function(_0x5510a6,_0x4975b9){_0x5510a6=_0x5510a6-0x0;var _0x962a10=_0x900e[_0x5510a6];return _0x962a10;};'use strict';var _=require(_0xe900('0x0'));var util=require(_0xe900('0x1'));var logger=require('../../config/logger')(_0xe900('0x2'));var moment=require(_0xe900('0x3'));var BPromise=require(_0xe900('0x4'));var rp=require(_0xe900('0x5'));var fs=require('fs');var path=require(_0xe900('0x6'));var rimraf=require(_0xe900('0x7'));var config=require(_0xe900('0x8'));var attributes=require(_0xe900('0x9'));module[_0xe900('0xa')]=function(_0x32560a,_0x4a9f04){return _0x32560a[_0xe900('0xb')](_0xe900('0xc'),attributes,{'tableName':_0xe900('0xd'),'paranoid':![],'indexes':[{'fields':[_0xe900('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x793b=['../../config/logger','api','request-promise','rimraf','./voiceCallReport.attributes','VoiceCallReport','report_call','uniqueid','lodash','util'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0x793b,0x1f2));var _0xb793=function(_0x51a9cb,_0x21e94b){_0x51a9cb=_0x51a9cb-0x0;var _0x80089c=_0x793b[_0x51a9cb];return _0x80089c;};'use strict';var _=require(_0xb793('0x0'));var util=require(_0xb793('0x1'));var logger=require(_0xb793('0x2'))(_0xb793('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb793('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb793('0x5'));var config=require('../../config/environment');var attributes=require(_0xb793('0x6'));module['exports']=function(_0x4ce4cd,_0x410084){return _0x4ce4cd['define'](_0xb793('0x7'),attributes,{'tableName':_0xb793('0x8'),'paranoid':![],'indexes':[{'fields':[_0xb793('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index 1292e87..602de01 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 _0xc690=['jayson/promise','client','http','request','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','attributes','limit','include','model','map','CreateVoiceCallReport','raw','UpdateVoiceCallReport','update','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x1b3f4c,_0x46ad7b){var _0x2b55aa=function(_0xfd13e6){while(--_0xfd13e6){_0x1b3f4c['push'](_0x1b3f4c['shift']());}};_0x2b55aa(++_0x46ad7b);}(_0xc690,0x198));var _0x0c69=function(_0x31c619,_0x3014b0){_0x31c619=_0x31c619-0x0;var _0x4e6db5=_0xc690[_0x31c619];return _0x4e6db5;};'use strict';var _=require(_0x0c69('0x0'));var util=require(_0x0c69('0x1'));var moment=require(_0x0c69('0x2'));var BPromise=require('bluebird');var rs=require(_0x0c69('0x3'));var fs=require('fs');var Redis=require(_0x0c69('0x4'));var db=require(_0x0c69('0x5'))['db'];var utils=require(_0x0c69('0x6'));var logger=require(_0x0c69('0x7'))(_0x0c69('0x8'));var config=require(_0x0c69('0x9'));var jayson=require(_0x0c69('0xa'));var client=jayson[_0x0c69('0xb')][_0x0c69('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xfa0401,_0x498dd5,_0x46fbb9){return new BPromise(function(_0x1dc24f,_0x24c516){return client[_0x0c69('0xd')](_0xfa0401,_0x46fbb9)[_0x0c69('0xe')](function(_0x3c794f){logger[_0x0c69('0xf')](_0x0c69('0x10'),_0x498dd5,_0x0c69('0x11'));logger[_0x0c69('0x12')](_0x0c69('0x13'),_0x498dd5,_0x0c69('0x11'),JSON[_0x0c69('0x14')](_0x3c794f));if(_0x3c794f[_0x0c69('0x15')]){if(_0x3c794f['error']['code']===0x1f4){logger['error'](_0x0c69('0x10'),_0x498dd5,_0x3c794f[_0x0c69('0x15')][_0x0c69('0x16')]);return _0x24c516(_0x3c794f[_0x0c69('0x15')][_0x0c69('0x16')]);}logger[_0x0c69('0x15')]('VoiceCallReport,\x20%s,\x20%s',_0x498dd5,_0x3c794f['error'][_0x0c69('0x16')]);return _0x1dc24f(_0x3c794f[_0x0c69('0x15')][_0x0c69('0x16')]);}else{logger[_0x0c69('0xf')]('VoiceCallReport,\x20%s,\x20%s',_0x498dd5,_0x0c69('0x11'));_0x1dc24f(_0x3c794f[_0x0c69('0x17')][_0x0c69('0x16')]);}})[_0x0c69('0x18')](function(_0x285a9c){logger[_0x0c69('0x15')](_0x0c69('0x10'),_0x498dd5,_0x285a9c);_0x24c516(_0x285a9c);});});}exports[_0x0c69('0x19')]=function(_0x39e459){var _0x5dcebf=this;return new Promise(function(_0xb84b34,_0x410e44){return db[_0x0c69('0x1a')][_0x0c69('0x1b')]({'raw':_0x39e459['options']?_0x39e459[_0x0c69('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x39e459[_0x0c69('0x1c')]?_0x39e459['options']['where']||null:null,'attributes':_0x39e459['options']?_0x39e459['options'][_0x0c69('0x1d')]||null:null,'limit':_0x39e459[_0x0c69('0x1c')]?_0x39e459[_0x0c69('0x1c')][_0x0c69('0x1e')]||null:null,'include':_0x39e459[_0x0c69('0x1c')]?_0x39e459[_0x0c69('0x1c')][_0x0c69('0x1f')]?_['map'](_0x39e459[_0x0c69('0x1c')][_0x0c69('0x1f')],function(_0x2bc887){return{'model':db[_0x2bc887[_0x0c69('0x20')]],'as':_0x2bc887['as'],'attributes':_0x2bc887[_0x0c69('0x1d')],'include':_0x2bc887[_0x0c69('0x1f')]?_[_0x0c69('0x21')](_0x2bc887['include'],function(_0x4669cb){return{'model':db[_0x4669cb[_0x0c69('0x20')]],'as':_0x4669cb['as'],'attributes':_0x4669cb[_0x0c69('0x1d')],'include':_0x4669cb[_0x0c69('0x1f')]?_['map'](_0x4669cb[_0x0c69('0x1f')],function(_0x5c2f02){return{'model':db[_0x5c2f02[_0x0c69('0x20')]],'as':_0x5c2f02['as'],'attributes':_0x5c2f02[_0x0c69('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x0c69('0xe')](function(_0x5012bc){logger['info'](_0x0c69('0x19'),_0x39e459);logger[_0x0c69('0x12')](_0x0c69('0x19'),_0x39e459,JSON[_0x0c69('0x14')](_0x5012bc));_0xb84b34(_0x5012bc);})[_0x0c69('0x18')](function(_0x2803a9){logger[_0x0c69('0x15')](_0x0c69('0x19'),_0x2803a9[_0x0c69('0x16')],_0x39e459);_0x410e44(_0x5dcebf[_0x0c69('0x15')](0x1f4,_0x2803a9[_0x0c69('0x16')]));});});};exports[_0x0c69('0x22')]=function(_0x252d1b){var _0x3ff505=this;return new Promise(function(_0x28d751,_0x258f79){return db[_0x0c69('0x1a')]['create'](_0x252d1b['body'],{'raw':_0x252d1b[_0x0c69('0x1c')]?_0x252d1b[_0x0c69('0x1c')][_0x0c69('0x23')]===undefined?!![]:![]:!![]})['then'](function(_0x39b2e){logger[_0x0c69('0xf')](_0x0c69('0x22'),_0x252d1b);logger[_0x0c69('0x12')]('CreateVoiceCallReport',_0x252d1b,JSON[_0x0c69('0x14')](_0x39b2e));_0x28d751(_0x39b2e);})['catch'](function(_0x1fdf3f){logger[_0x0c69('0x15')]('CreateVoiceCallReport',_0x1fdf3f[_0x0c69('0x16')],_0x252d1b);_0x258f79(_0x3ff505[_0x0c69('0x15')](0x1f4,_0x1fdf3f[_0x0c69('0x16')]));});});};exports[_0x0c69('0x24')]=function(_0x2e437b){var _0x4963e0=this;return new Promise(function(_0x1c5ca9,_0x4d290f){return db[_0x0c69('0x1a')][_0x0c69('0x25')](_0x2e437b['body'],{'raw':_0x2e437b['options']?_0x2e437b['options'][_0x0c69('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2e437b[_0x0c69('0x1c')]?_0x2e437b['options']['where']||null:null,'attributes':_0x2e437b[_0x0c69('0x1c')]?_0x2e437b[_0x0c69('0x1c')][_0x0c69('0x1d')]||null:null,'limit':_0x2e437b['options']?_0x2e437b['options']['limit']||null:null})[_0x0c69('0xe')](function(_0x255dfa){logger[_0x0c69('0xf')]('UpdateVoiceCallReport',_0x2e437b);logger[_0x0c69('0x12')](_0x0c69('0x24'),_0x2e437b,JSON[_0x0c69('0x14')](_0x255dfa));_0x1c5ca9(_0x255dfa);})[_0x0c69('0x18')](function(_0x255f70){logger[_0x0c69('0x15')](_0x0c69('0x24'),_0x255f70[_0x0c69('0x16')],_0x2e437b);_0x4d290f(_0x4963e0[_0x0c69('0x15')](0x1f4,_0x255f70[_0x0c69('0x16')]));});});}; \ No newline at end of file +var _0x438a=['ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','request','then','info','VoiceCallReport,\x20%s,\x20%s','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetVoiceCallReport','VoiceCallReport','findAll','raw','options','where','attributes','limit','include','map','model','create','body','CreateVoiceCallReport','UpdateVoiceCallReport','lodash','util','bluebird'];(function(_0x2bafdc,_0x3e5c3b){var _0x50ed6b=function(_0xb57f54){while(--_0xb57f54){_0x2bafdc['push'](_0x2bafdc['shift']());}};_0x50ed6b(++_0x3e5c3b);}(_0x438a,0x141));var _0xa438=function(_0x188408,_0x1b1ec5){_0x188408=_0x188408-0x0;var _0x4e6e3a=_0x438a[_0x188408];return _0x4e6e3a;};'use strict';var _=require(_0xa438('0x0'));var util=require(_0xa438('0x1'));var moment=require('moment');var BPromise=require(_0xa438('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa438('0x3'));var db=require(_0xa438('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa438('0x5'))(_0xa438('0x6'));var config=require('../../config/environment');var jayson=require(_0xa438('0x7'));var client=jayson['client'][_0xa438('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x23223b,_0x357ac7,_0xd7b2bf){return new BPromise(function(_0x20a931,_0x277138){return client[_0xa438('0x9')](_0x23223b,_0xd7b2bf)[_0xa438('0xa')](function(_0x550ede){logger[_0xa438('0xb')](_0xa438('0xc'),_0x357ac7,'request\x20sent');logger[_0xa438('0xd')](_0xa438('0xe'),_0x357ac7,_0xa438('0xf'),JSON[_0xa438('0x10')](_0x550ede));if(_0x550ede[_0xa438('0x11')]){if(_0x550ede[_0xa438('0x11')]['code']===0x1f4){logger[_0xa438('0x11')](_0xa438('0xc'),_0x357ac7,_0x550ede['error'][_0xa438('0x12')]);return _0x277138(_0x550ede[_0xa438('0x11')][_0xa438('0x12')]);}logger['error']('VoiceCallReport,\x20%s,\x20%s',_0x357ac7,_0x550ede[_0xa438('0x11')][_0xa438('0x12')]);return _0x20a931(_0x550ede[_0xa438('0x11')][_0xa438('0x12')]);}else{logger[_0xa438('0xb')](_0xa438('0xc'),_0x357ac7,_0xa438('0xf'));_0x20a931(_0x550ede[_0xa438('0x13')][_0xa438('0x12')]);}})[_0xa438('0x14')](function(_0xb345c1){logger[_0xa438('0x11')](_0xa438('0xc'),_0x357ac7,_0xb345c1);_0x277138(_0xb345c1);});});}exports[_0xa438('0x15')]=function(_0x296db1){var _0xe138b2=this;return new Promise(function(_0x2417fa,_0x161455){return db[_0xa438('0x16')][_0xa438('0x17')]({'raw':_0x296db1['options']?_0x296db1['options'][_0xa438('0x18')]===undefined?!![]:![]:!![],'where':_0x296db1[_0xa438('0x19')]?_0x296db1[_0xa438('0x19')][_0xa438('0x1a')]||null:null,'attributes':_0x296db1[_0xa438('0x19')]?_0x296db1[_0xa438('0x19')][_0xa438('0x1b')]||null:null,'limit':_0x296db1[_0xa438('0x19')]?_0x296db1[_0xa438('0x19')][_0xa438('0x1c')]||null:null,'include':_0x296db1[_0xa438('0x19')]?_0x296db1[_0xa438('0x19')][_0xa438('0x1d')]?_[_0xa438('0x1e')](_0x296db1[_0xa438('0x19')]['include'],function(_0x59de68){return{'model':db[_0x59de68[_0xa438('0x1f')]],'as':_0x59de68['as'],'attributes':_0x59de68[_0xa438('0x1b')],'include':_0x59de68['include']?_[_0xa438('0x1e')](_0x59de68[_0xa438('0x1d')],function(_0x579fb9){return{'model':db[_0x579fb9[_0xa438('0x1f')]],'as':_0x579fb9['as'],'attributes':_0x579fb9[_0xa438('0x1b')],'include':_0x579fb9[_0xa438('0x1d')]?_[_0xa438('0x1e')](_0x579fb9['include'],function(_0x2ff0bc){return{'model':db[_0x2ff0bc[_0xa438('0x1f')]],'as':_0x2ff0bc['as'],'attributes':_0x2ff0bc[_0xa438('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xa438('0xa')](function(_0x2d3d8f){logger[_0xa438('0xb')]('GetVoiceCallReport',_0x296db1);logger[_0xa438('0xd')](_0xa438('0x15'),_0x296db1,JSON[_0xa438('0x10')](_0x2d3d8f));_0x2417fa(_0x2d3d8f);})['catch'](function(_0x3bb73e){logger['error'](_0xa438('0x15'),_0x3bb73e['message'],_0x296db1);_0x161455(_0xe138b2[_0xa438('0x11')](0x1f4,_0x3bb73e[_0xa438('0x12')]));});});};exports['CreateVoiceCallReport']=function(_0x20f64e){var _0x343785=this;return new Promise(function(_0xb861ab,_0x569236){return db['VoiceCallReport'][_0xa438('0x20')](_0x20f64e[_0xa438('0x21')],{'raw':_0x20f64e['options']?_0x20f64e[_0xa438('0x19')][_0xa438('0x18')]===undefined?!![]:![]:!![]})[_0xa438('0xa')](function(_0x39dc2e){logger['info'](_0xa438('0x22'),_0x20f64e);logger[_0xa438('0xd')](_0xa438('0x22'),_0x20f64e,JSON[_0xa438('0x10')](_0x39dc2e));_0xb861ab(_0x39dc2e);})[_0xa438('0x14')](function(_0x4b3046){logger[_0xa438('0x11')](_0xa438('0x22'),_0x4b3046['message'],_0x20f64e);_0x569236(_0x343785[_0xa438('0x11')](0x1f4,_0x4b3046['message']));});});};exports[_0xa438('0x23')]=function(_0x5c1d00){var _0x31ad20=this;return new Promise(function(_0x45119a,_0x3cac13){return db[_0xa438('0x16')]['update'](_0x5c1d00[_0xa438('0x21')],{'raw':_0x5c1d00[_0xa438('0x19')]?_0x5c1d00[_0xa438('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5c1d00['options']?_0x5c1d00[_0xa438('0x19')][_0xa438('0x1a')]||null:null,'attributes':_0x5c1d00['options']?_0x5c1d00['options'][_0xa438('0x1b')]||null:null,'limit':_0x5c1d00['options']?_0x5c1d00[_0xa438('0x19')][_0xa438('0x1c')]||null:null})[_0xa438('0xa')](function(_0x34c39b){logger['info']('UpdateVoiceCallReport',_0x5c1d00);logger['debug'](_0xa438('0x23'),_0x5c1d00,JSON[_0xa438('0x10')](_0x34c39b));_0x45119a(_0x34c39b);})['catch'](function(_0x40c8ea){logger[_0xa438('0x11')](_0xa438('0x23'),_0x40c8ea[_0xa438('0x12')],_0x5c1d00);_0x3cac13(_0x31ad20[_0xa438('0x11')](0x1f4,_0x40c8ea[_0xa438('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 9cae74d..0d60990 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 _0x9d5f=['create','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get','index','/:id','isAuthenticated','show'];(function(_0x1fe7c3,_0x2f7c6e){var _0x490542=function(_0x1f9859){while(--_0x1f9859){_0x1fe7c3['push'](_0x1fe7c3['shift']());}};_0x490542(++_0x2f7c6e);}(_0x9d5f,0xcd));var _0xf9d5=function(_0x3a7973,_0x153c8c){_0x3a7973=_0x3a7973-0x0;var _0x16db86=_0x9d5f[_0x3a7973];return _0x16db86;};'use strict';var multer=require(_0xf9d5('0x0'));var util=require(_0xf9d5('0x1'));var path=require(_0xf9d5('0x2'));var timeout=require(_0xf9d5('0x3'));var express=require('express');var router=express[_0xf9d5('0x4')]();var fs_extra=require(_0xf9d5('0x5'));var auth=require(_0xf9d5('0x6'));var interaction=require(_0xf9d5('0x7'));var config=require(_0xf9d5('0x8'));var controller=require(_0xf9d5('0x9'));router[_0xf9d5('0xa')]('/',auth['isAuthenticated'](),controller[_0xf9d5('0xb')]);router[_0xf9d5('0xa')](_0xf9d5('0xc'),auth[_0xf9d5('0xd')](),controller[_0xf9d5('0xe')]);router['post']('/',auth[_0xf9d5('0xd')](),controller[_0xf9d5('0xf')]);router['put'](_0xf9d5('0xc'),auth[_0xf9d5('0xd')](),controller[_0xf9d5('0x10')]);router[_0xf9d5('0x11')](_0xf9d5('0xc'),auth['isAuthenticated'](),controller[_0xf9d5('0x12')]);module[_0xf9d5('0x13')]=router; \ No newline at end of file +var _0xee37=['./voiceChanSpy.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x5c47f6,_0x8fb731){var _0x92dd97=function(_0x34ac00){while(--_0x34ac00){_0x5c47f6['push'](_0x5c47f6['shift']());}};_0x92dd97(++_0x8fb731);}(_0xee37,0x174));var _0x7ee3=function(_0x4c7935,_0x4a53fb){_0x4c7935=_0x4c7935-0x0;var _0x30651d=_0xee37[_0x4c7935];return _0x30651d;};'use strict';var multer=require('multer');var util=require(_0x7ee3('0x0'));var path=require(_0x7ee3('0x1'));var timeout=require('connect-timeout');var express=require(_0x7ee3('0x2'));var router=express[_0x7ee3('0x3')]();var fs_extra=require(_0x7ee3('0x4'));var auth=require(_0x7ee3('0x5'));var interaction=require(_0x7ee3('0x6'));var config=require(_0x7ee3('0x7'));var controller=require(_0x7ee3('0x8'));router[_0x7ee3('0x9')]('/',auth[_0x7ee3('0xa')](),controller[_0x7ee3('0xb')]);router[_0x7ee3('0x9')](_0x7ee3('0xc'),auth[_0x7ee3('0xa')](),controller[_0x7ee3('0xd')]);router[_0x7ee3('0xe')]('/',auth[_0x7ee3('0xa')](),controller[_0x7ee3('0xf')]);router[_0x7ee3('0x10')](_0x7ee3('0xc'),auth[_0x7ee3('0xa')](),controller['update']);router[_0x7ee3('0x11')]('/:id',auth[_0x7ee3('0xa')](),controller[_0x7ee3('0x12')]);module[_0x7ee3('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index 244790f..3f5ac3c 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 _0x32dc=['split','BOOLEAN','sequelize','exports','STRING','name','options','getDataValue'];(function(_0x111909,_0x1d2cd9){var _0x418930=function(_0x285ec6){while(--_0x285ec6){_0x111909['push'](_0x111909['shift']());}};_0x418930(++_0x1d2cd9);}(_0x32dc,0x16a));var _0xc32d=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x32dc[_0x3ab51d];return _0x29a04e;};'use strict';var Sequelize=require(_0xc32d('0x0'));module[_0xc32d('0x1')]={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0xc32d('0x2')],'unique':_0xc32d('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0xc32d('0x2')],'set':function(_0x286774){this['setDataValue'](_0xc32d('0x4'),_0x286774?_0x286774['join'](''):[]);},'get':function(){return this[_0xc32d('0x5')](_0xc32d('0x4'))?this[_0xc32d('0x5')](_0xc32d('0x4'))[_0xc32d('0x6')](''):[];}},'auth':{'type':Sequelize[_0xc32d('0x7')],'defaultValue':![]},'password':{'type':Sequelize[_0xc32d('0x2')]},'record':{'type':Sequelize[_0xc32d('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xc32d('0x2')]}}; \ No newline at end of file +var _0x22ee=['setDataValue','options','join','getDataValue','split','BOOLEAN','STRING','name'];(function(_0x2f5f64,_0x4fabef){var _0x391069=function(_0x5497ce){while(--_0x5497ce){_0x2f5f64['push'](_0x2f5f64['shift']());}};_0x391069(++_0x4fabef);}(_0x22ee,0xbe));var _0xe22e=function(_0x212b03,_0x1f1b50){_0x212b03=_0x212b03-0x0;var _0x423115=_0x22ee[_0x212b03];return _0x423115;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xe22e('0x0')]},'prefix':{'type':Sequelize[_0xe22e('0x0')],'unique':_0xe22e('0x1'),'allowNull':![]},'options':{'type':Sequelize[_0xe22e('0x0')],'set':function(_0x5b7ebd){this[_0xe22e('0x2')](_0xe22e('0x3'),_0x5b7ebd?_0x5b7ebd[_0xe22e('0x4')](''):[]);},'get':function(){return this[_0xe22e('0x5')](_0xe22e('0x3'))?this[_0xe22e('0x5')](_0xe22e('0x3'))[_0xe22e('0x6')](''):[];}},'auth':{'type':Sequelize[_0xe22e('0x7')],'defaultValue':![]},'password':{'type':Sequelize['STRING']},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xe22e('0x0')]},'description':{'type':Sequelize[_0xe22e('0x0')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 3192f7a..5ab56a0 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 _0x03ce=['autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','Content-Range','apply','reject','save','update','then','destroy','get','ChanSpies','UserProfileResource','sendStatus','error','name','send','index','map','VoiceChanSpy','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','where','filter','merge','VIRTUAL','count','include','rows','show','params','options','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x03ce,0x1a1));var _0xe03c=function(_0x114f84,_0x1a136){_0x114f84=_0x114f84-0x0;var _0x4e9373=_0x03ce[_0x114f84];return _0x4e9373;};'use strict';var emlformat=require(_0xe03c('0x0'));var rimraf=require(_0xe03c('0x1'));var zipdir=require(_0xe03c('0x2'));var jsonpatch=require(_0xe03c('0x3'));var rp=require('request-promise');var moment=require(_0xe03c('0x4'));var BPromise=require(_0xe03c('0x5'));var Mustache=require(_0xe03c('0x6'));var util=require('util');var path=require(_0xe03c('0x7'));var sox=require(_0xe03c('0x8'));var csv=require(_0xe03c('0x9'));var ejs=require(_0xe03c('0xa'));var fs=require('fs');var fs_extra=require(_0xe03c('0xb'));var _=require(_0xe03c('0xc'));var squel=require(_0xe03c('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xe03c('0xe'));var toCsv=require(_0xe03c('0x9'));var querystring=require(_0xe03c('0xf'));var Papa=require(_0xe03c('0x10'));var Redis=require(_0xe03c('0x11'));var authService=require(_0xe03c('0x12'));var qs=require(_0xe03c('0x13'));var as=require(_0xe03c('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe03c('0x15'))(_0xe03c('0x16'));var utils=require(_0xe03c('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xe03c('0x18'));var db=require(_0xe03c('0x19'))['db'];function respondWithStatusCode(_0x4d8249,_0x27838b){_0x27838b=_0x27838b||0xcc;return function(_0x476349){if(_0x476349){return _0x4d8249['sendStatus'](_0x27838b);}return _0x4d8249[_0xe03c('0x1a')](_0x27838b)[_0xe03c('0x1b')]();};}function respondWithResult(_0x25a5e9,_0x4f7139){_0x4f7139=_0x4f7139||0xc8;return function(_0x2ffd1f){if(_0x2ffd1f){return _0x25a5e9[_0xe03c('0x1a')](_0x4f7139)[_0xe03c('0x1c')](_0x2ffd1f);}};}function respondWithFilteredResult(_0x408a8f,_0x417a9e){return function(_0x54b705){if(_0x54b705){var _0x3d6287=typeof _0x417a9e[_0xe03c('0x1d')]==='undefined'&&typeof _0x417a9e[_0xe03c('0x1e')]===_0xe03c('0x1f');var _0x3b3ecc=_0x54b705['count'];var _0x56ec58=_0x3d6287?0x0:_0x417a9e[_0xe03c('0x1d')];var _0x386cb7=_0x3d6287?_0x54b705['count']:_0x417a9e[_0xe03c('0x1d')]+_0x417a9e[_0xe03c('0x1e')];var _0x157882;if(_0x386cb7>=_0x3b3ecc){_0x386cb7=_0x3b3ecc;_0x157882=0xc8;}else{_0x157882=0xce;}_0x408a8f['status'](_0x157882);return _0x408a8f['set'](_0xe03c('0x20'),_0x56ec58+'-'+_0x386cb7+'/'+_0x3b3ecc)[_0xe03c('0x1c')](_0x54b705);}return null;};}function patchUpdates(_0x3bf505){return function(_0x4741ed){try{jsonpatch[_0xe03c('0x21')](_0x4741ed,_0x3bf505,!![]);}catch(_0x3f8564){return BPromise[_0xe03c('0x22')](_0x3f8564);}return _0x4741ed[_0xe03c('0x23')]();};}function saveUpdates(_0x4c9597,_0x1cbf9f){return function(_0x4d5c40){if(_0x4d5c40){return _0x4d5c40[_0xe03c('0x24')](_0x4c9597)[_0xe03c('0x25')](function(_0x3ae889){return _0x3ae889;});}return null;};}function removeEntity(_0x28ac91,_0x3afdea){return function(_0x95a4b3){if(_0x95a4b3){return _0x95a4b3[_0xe03c('0x26')]()['then'](function(){var _0x37c3cb=_0x95a4b3[_0xe03c('0x27')]({'plain':!![]});var _0x353def=_0xe03c('0x28');return db[_0xe03c('0x29')][_0xe03c('0x26')]({'where':{'type':_0x353def,'resourceId':_0x37c3cb['id']}})[_0xe03c('0x25')](function(){return _0x95a4b3;});})[_0xe03c('0x25')](function(){_0x28ac91[_0xe03c('0x1a')](0xcc)[_0xe03c('0x1b')]();});}};}function handleEntityNotFound(_0xc8aecb,_0x234d64){return function(_0x208e0e){if(!_0x208e0e){_0xc8aecb[_0xe03c('0x2a')](0x194);}return _0x208e0e;};}function handleError(_0xbfb6bb,_0x23ad8e){_0x23ad8e=_0x23ad8e||0x1f4;return function(_0x4f475b){logger[_0xe03c('0x2b')](_0x4f475b['stack']);if(_0x4f475b[_0xe03c('0x2c')]){delete _0x4f475b[_0xe03c('0x2c')];}_0xbfb6bb[_0xe03c('0x1a')](_0x23ad8e)[_0xe03c('0x2d')](_0x4f475b);};}exports[_0xe03c('0x2e')]=function(_0x46fb63,_0x136f23){var _0x1a4700={},_0x4d678c={},_0x318197={'count':0x0,'rows':[]};var _0x27e3c8=_[_0xe03c('0x2f')](db[_0xe03c('0x30')][_0xe03c('0x31')],function(_0x4fbabc){return{'name':_0x4fbabc[_0xe03c('0x32')],'type':_0x4fbabc[_0xe03c('0x33')][_0xe03c('0x34')]};});_0x4d678c[_0xe03c('0x35')]=_[_0xe03c('0x2f')](_0x27e3c8,_0xe03c('0x2c'));_0x4d678c[_0xe03c('0x36')]=_[_0xe03c('0x37')](_0x46fb63[_0xe03c('0x36')]);_0x4d678c[_0xe03c('0x38')]=_[_0xe03c('0x39')](_0x4d678c[_0xe03c('0x35')],_0x4d678c[_0xe03c('0x36')]);_0x1a4700[_0xe03c('0x3a')]=_[_0xe03c('0x39')](_0x4d678c[_0xe03c('0x35')],qs[_0xe03c('0x3b')](_0x46fb63['query'][_0xe03c('0x3b')]));_0x1a4700[_0xe03c('0x3a')]=_0x1a4700[_0xe03c('0x3a')][_0xe03c('0x3c')]?_0x1a4700['attributes']:_0x4d678c[_0xe03c('0x35')];if(!_0x46fb63['query']['hasOwnProperty'](_0xe03c('0x3d'))){_0x1a4700[_0xe03c('0x1e')]=qs[_0xe03c('0x1e')](_0x46fb63[_0xe03c('0x36')]['limit']);_0x1a4700[_0xe03c('0x1d')]=qs[_0xe03c('0x1d')](_0x46fb63['query']['offset']);}_0x1a4700['order']=qs['sort'](_0x46fb63[_0xe03c('0x36')]['sort']);_0x1a4700[_0xe03c('0x3e')]=qs['filters'](_['pick'](_0x46fb63[_0xe03c('0x36')],_0x4d678c[_0xe03c('0x38')]),_0x27e3c8);if(_0x46fb63[_0xe03c('0x36')][_0xe03c('0x3f')]){_0x1a4700['where']=_[_0xe03c('0x40')](_0x1a4700['where'],{'$or':_[_0xe03c('0x2f')](_0x27e3c8,function(_0x1d86d7){if(_0x1d86d7[_0xe03c('0x33')]!==_0xe03c('0x41')){var _0x458747={};_0x458747[_0x1d86d7[_0xe03c('0x2c')]]={'$like':'%'+_0x46fb63[_0xe03c('0x36')]['filter']+'%'};return _0x458747;}})});}_0x1a4700=_[_0xe03c('0x40')]({},_0x1a4700,_0x46fb63['options']);var _0x3e8def={'where':_0x1a4700[_0xe03c('0x3e')]};return db[_0xe03c('0x30')][_0xe03c('0x42')](_0x3e8def)[_0xe03c('0x25')](function(_0x1fa14d){_0x318197['count']=_0x1fa14d;if(_0x46fb63['query']['includeAll']){_0x1a4700[_0xe03c('0x43')]=[{'all':!![]}];}return db[_0xe03c('0x30')]['findAll'](_0x1a4700);})[_0xe03c('0x25')](function(_0x43dc4f){_0x318197[_0xe03c('0x44')]=_0x43dc4f;return _0x318197;})[_0xe03c('0x25')](respondWithFilteredResult(_0x136f23,_0x1a4700))['catch'](handleError(_0x136f23,null));};exports[_0xe03c('0x45')]=function(_0x14ed57,_0x34f672){var _0x1a860e={'raw':![],'where':{'id':_0x14ed57[_0xe03c('0x46')]['id']}},_0x40c726={};_0x40c726['model']=_[_0xe03c('0x37')](db[_0xe03c('0x30')][_0xe03c('0x31')]);_0x40c726['query']=_['keys'](_0x14ed57[_0xe03c('0x36')]);_0x40c726['filters']=_['intersection'](_0x40c726[_0xe03c('0x35')],_0x40c726[_0xe03c('0x36')]);_0x1a860e['attributes']=_[_0xe03c('0x39')](_0x40c726[_0xe03c('0x35')],qs[_0xe03c('0x3b')](_0x14ed57[_0xe03c('0x36')]['fields']));_0x1a860e[_0xe03c('0x3a')]=_0x1a860e['attributes'][_0xe03c('0x3c')]?_0x1a860e[_0xe03c('0x3a')]:_0x40c726[_0xe03c('0x35')];if(_0x14ed57[_0xe03c('0x36')]['includeAll']){_0x1a860e[_0xe03c('0x43')]=[{'all':!![]}];}_0x1a860e=_['merge']({},_0x1a860e,_0x14ed57[_0xe03c('0x47')]);return db[_0xe03c('0x30')]['find'](_0x1a860e)[_0xe03c('0x25')](handleEntityNotFound(_0x34f672,null))[_0xe03c('0x25')](respondWithResult(_0x34f672,null))[_0xe03c('0x48')](handleError(_0x34f672,null));};exports[_0xe03c('0x49')]=function(_0x1a5e16,_0x2dfa79){return db[_0xe03c('0x30')][_0xe03c('0x49')](_0x1a5e16[_0xe03c('0x4a')],{})[_0xe03c('0x25')](function(_0x14fa31){var _0x246ae4=_0x1a5e16[_0xe03c('0x4b')][_0xe03c('0x27')]({'plain':!![]});if(!_0x246ae4)throw new Error(_0xe03c('0x4c'));if(_0x246ae4[_0xe03c('0x4d')]==='user'){var _0x14a025=_0x14fa31[_0xe03c('0x27')]({'plain':!![]});var _0x3d73b0=_0xe03c('0x28');return db[_0xe03c('0x4e')][_0xe03c('0x4f')]({'where':{'name':_0x3d73b0,'userProfileId':_0x246ae4[_0xe03c('0x50')]},'raw':!![]})[_0xe03c('0x25')](function(_0x5182ef){if(_0x5182ef&&_0x5182ef[_0xe03c('0x51')]===0x0){return db[_0xe03c('0x29')][_0xe03c('0x49')]({'name':_0x14a025[_0xe03c('0x2c')],'resourceId':_0x14a025['id'],'type':_0x5182ef['name'],'sectionId':_0x5182ef['id']},{})['then'](function(){return _0x14fa31;});}else{return _0x14fa31;}})[_0xe03c('0x48')](function(_0x11c739){logger[_0xe03c('0x2b')](_0xe03c('0x52'),_0x11c739);throw _0x11c739;});}return _0x14fa31;})[_0xe03c('0x25')](respondWithResult(_0x2dfa79,0xc9))[_0xe03c('0x48')](handleError(_0x2dfa79,null));};exports[_0xe03c('0x24')]=function(_0x14fa77,_0x49449c){if(_0x14fa77[_0xe03c('0x4a')]['id']){delete _0x14fa77[_0xe03c('0x4a')]['id'];}return db['VoiceChanSpy']['find']({'where':{'id':_0x14fa77[_0xe03c('0x46')]['id']}})[_0xe03c('0x25')](handleEntityNotFound(_0x49449c,null))['then'](saveUpdates(_0x14fa77['body'],null))[_0xe03c('0x25')](respondWithResult(_0x49449c,null))[_0xe03c('0x48')](handleError(_0x49449c,null));};exports['destroy']=function(_0x50bd51,_0xfc70b1){return db[_0xe03c('0x30')]['find']({'where':{'id':_0x50bd51['params']['id']}})['then'](handleEntityNotFound(_0xfc70b1,null))[_0xe03c('0x25')](removeEntity(_0xfc70b1,null))[_0xe03c('0x48')](handleError(_0xfc70b1,null));}; \ No newline at end of file +var _0x2cbd=['fields','length','hasOwnProperty','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','role','user','UserProfileSection','find','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','reject','save','update','then','destroy','get','ChanSpies','error','stack','name','send','index','map','VoiceChanSpy','fieldName','type','key','model','query','keys','filters','intersection','attributes'];(function(_0x2f269e,_0x59468c){var _0x1a1db0=function(_0xb7be84){while(--_0xb7be84){_0x2f269e['push'](_0x2f269e['shift']());}};_0x1a1db0(++_0x59468c);}(_0x2cbd,0x19e));var _0xd2cb=function(_0x37cc52,_0x459a9b){_0x37cc52=_0x37cc52-0x0;var _0x2b4a90=_0x2cbd[_0x37cc52];return _0x2b4a90;};'use strict';var emlformat=require(_0xd2cb('0x0'));var rimraf=require(_0xd2cb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd2cb('0x2'));var rp=require(_0xd2cb('0x3'));var moment=require(_0xd2cb('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd2cb('0x5'));var util=require(_0xd2cb('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xd2cb('0x7'));var ejs=require(_0xd2cb('0x8'));var fs=require('fs');var fs_extra=require(_0xd2cb('0x9'));var _=require(_0xd2cb('0xa'));var squel=require('squel');var crypto=require(_0xd2cb('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xd2cb('0xc'));var toCsv=require('to-csv');var querystring=require(_0xd2cb('0xd'));var Papa=require(_0xd2cb('0xe'));var Redis=require('ioredis');var authService=require(_0xd2cb('0xf'));var qs=require(_0xd2cb('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd2cb('0x11'));var logger=require(_0xd2cb('0x12'))(_0xd2cb('0x13'));var utils=require(_0xd2cb('0x14'));var config=require(_0xd2cb('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xd2cb('0x16'))['db'];function respondWithStatusCode(_0x3f6903,_0x62c951){_0x62c951=_0x62c951||0xcc;return function(_0x1ae36a){if(_0x1ae36a){return _0x3f6903[_0xd2cb('0x17')](_0x62c951);}return _0x3f6903['status'](_0x62c951)[_0xd2cb('0x18')]();};}function respondWithResult(_0xd25e16,_0x1e1ad5){_0x1e1ad5=_0x1e1ad5||0xc8;return function(_0x57e0c9){if(_0x57e0c9){return _0xd25e16[_0xd2cb('0x19')](_0x1e1ad5)[_0xd2cb('0x1a')](_0x57e0c9);}};}function respondWithFilteredResult(_0x501e19,_0x33538d){return function(_0x4ef741){if(_0x4ef741){var _0x4e02f7=typeof _0x33538d[_0xd2cb('0x1b')]===_0xd2cb('0x1c')&&typeof _0x33538d[_0xd2cb('0x1d')]===_0xd2cb('0x1c');var _0x498e27=_0x4ef741['count'];var _0x2f41d1=_0x4e02f7?0x0:_0x33538d[_0xd2cb('0x1b')];var _0x5871e5=_0x4e02f7?_0x4ef741[_0xd2cb('0x1e')]:_0x33538d[_0xd2cb('0x1b')]+_0x33538d[_0xd2cb('0x1d')];var _0x5d385a;if(_0x5871e5>=_0x498e27){_0x5871e5=_0x498e27;_0x5d385a=0xc8;}else{_0x5d385a=0xce;}_0x501e19[_0xd2cb('0x19')](_0x5d385a);return _0x501e19['set']('Content-Range',_0x2f41d1+'-'+_0x5871e5+'/'+_0x498e27)[_0xd2cb('0x1a')](_0x4ef741);}return null;};}function patchUpdates(_0x190cbb){return function(_0x4643a0){try{jsonpatch['apply'](_0x4643a0,_0x190cbb,!![]);}catch(_0x34c00a){return BPromise[_0xd2cb('0x1f')](_0x34c00a);}return _0x4643a0[_0xd2cb('0x20')]();};}function saveUpdates(_0x4618f1,_0x27badc){return function(_0x43154a){if(_0x43154a){return _0x43154a[_0xd2cb('0x21')](_0x4618f1)[_0xd2cb('0x22')](function(_0x5d1499){return _0x5d1499;});}return null;};}function removeEntity(_0x37333a,_0x29f8f0){return function(_0x5dfca2){if(_0x5dfca2){return _0x5dfca2[_0xd2cb('0x23')]()[_0xd2cb('0x22')](function(){var _0x138498=_0x5dfca2[_0xd2cb('0x24')]({'plain':!![]});var _0x46a378=_0xd2cb('0x25');return db['UserProfileResource'][_0xd2cb('0x23')]({'where':{'type':_0x46a378,'resourceId':_0x138498['id']}})['then'](function(){return _0x5dfca2;});})['then'](function(){_0x37333a['status'](0xcc)[_0xd2cb('0x18')]();});}};}function handleEntityNotFound(_0x37cb5e,_0x35ac19){return function(_0x9b502c){if(!_0x9b502c){_0x37cb5e['sendStatus'](0x194);}return _0x9b502c;};}function handleError(_0x30214e,_0x45f762){_0x45f762=_0x45f762||0x1f4;return function(_0xd28ae7){logger[_0xd2cb('0x26')](_0xd28ae7[_0xd2cb('0x27')]);if(_0xd28ae7[_0xd2cb('0x28')]){delete _0xd28ae7[_0xd2cb('0x28')];}_0x30214e[_0xd2cb('0x19')](_0x45f762)[_0xd2cb('0x29')](_0xd28ae7);};}exports[_0xd2cb('0x2a')]=function(_0x568340,_0x3b4b77){var _0x2b6b77={},_0x58e894={},_0x1c3486={'count':0x0,'rows':[]};var _0xfe4dc3=_[_0xd2cb('0x2b')](db[_0xd2cb('0x2c')]['rawAttributes'],function(_0x5af5c8){return{'name':_0x5af5c8[_0xd2cb('0x2d')],'type':_0x5af5c8[_0xd2cb('0x2e')][_0xd2cb('0x2f')]};});_0x58e894[_0xd2cb('0x30')]=_[_0xd2cb('0x2b')](_0xfe4dc3,'name');_0x58e894[_0xd2cb('0x31')]=_[_0xd2cb('0x32')](_0x568340[_0xd2cb('0x31')]);_0x58e894[_0xd2cb('0x33')]=_[_0xd2cb('0x34')](_0x58e894[_0xd2cb('0x30')],_0x58e894[_0xd2cb('0x31')]);_0x2b6b77[_0xd2cb('0x35')]=_['intersection'](_0x58e894[_0xd2cb('0x30')],qs['fields'](_0x568340[_0xd2cb('0x31')][_0xd2cb('0x36')]));_0x2b6b77[_0xd2cb('0x35')]=_0x2b6b77[_0xd2cb('0x35')][_0xd2cb('0x37')]?_0x2b6b77[_0xd2cb('0x35')]:_0x58e894[_0xd2cb('0x30')];if(!_0x568340['query'][_0xd2cb('0x38')]('nolimit')){_0x2b6b77['limit']=qs[_0xd2cb('0x1d')](_0x568340[_0xd2cb('0x31')][_0xd2cb('0x1d')]);_0x2b6b77['offset']=qs[_0xd2cb('0x1b')](_0x568340['query'][_0xd2cb('0x1b')]);}_0x2b6b77['order']=qs['sort'](_0x568340[_0xd2cb('0x31')][_0xd2cb('0x39')]);_0x2b6b77[_0xd2cb('0x3a')]=qs[_0xd2cb('0x33')](_[_0xd2cb('0x3b')](_0x568340[_0xd2cb('0x31')],_0x58e894[_0xd2cb('0x33')]),_0xfe4dc3);if(_0x568340['query']['filter']){_0x2b6b77[_0xd2cb('0x3a')]=_[_0xd2cb('0x3c')](_0x2b6b77[_0xd2cb('0x3a')],{'$or':_[_0xd2cb('0x2b')](_0xfe4dc3,function(_0x3d6077){if(_0x3d6077['type']!==_0xd2cb('0x3d')){var _0x58bdbb={};_0x58bdbb[_0x3d6077['name']]={'$like':'%'+_0x568340[_0xd2cb('0x31')]['filter']+'%'};return _0x58bdbb;}})});}_0x2b6b77=_[_0xd2cb('0x3c')]({},_0x2b6b77,_0x568340[_0xd2cb('0x3e')]);var _0x5647b8={'where':_0x2b6b77[_0xd2cb('0x3a')]};return db[_0xd2cb('0x2c')][_0xd2cb('0x1e')](_0x5647b8)[_0xd2cb('0x22')](function(_0x260450){_0x1c3486['count']=_0x260450;if(_0x568340[_0xd2cb('0x31')][_0xd2cb('0x3f')]){_0x2b6b77[_0xd2cb('0x40')]=[{'all':!![]}];}return db[_0xd2cb('0x2c')][_0xd2cb('0x41')](_0x2b6b77);})[_0xd2cb('0x22')](function(_0x26e204){_0x1c3486[_0xd2cb('0x42')]=_0x26e204;return _0x1c3486;})['then'](respondWithFilteredResult(_0x3b4b77,_0x2b6b77))[_0xd2cb('0x43')](handleError(_0x3b4b77,null));};exports[_0xd2cb('0x44')]=function(_0x1f5621,_0x38733c){var _0x6a3c8d={'raw':![],'where':{'id':_0x1f5621[_0xd2cb('0x45')]['id']}},_0x11ccc5={};_0x11ccc5[_0xd2cb('0x30')]=_[_0xd2cb('0x32')](db['VoiceChanSpy'][_0xd2cb('0x46')]);_0x11ccc5[_0xd2cb('0x31')]=_[_0xd2cb('0x32')](_0x1f5621[_0xd2cb('0x31')]);_0x11ccc5[_0xd2cb('0x33')]=_['intersection'](_0x11ccc5[_0xd2cb('0x30')],_0x11ccc5[_0xd2cb('0x31')]);_0x6a3c8d[_0xd2cb('0x35')]=_[_0xd2cb('0x34')](_0x11ccc5['model'],qs[_0xd2cb('0x36')](_0x1f5621[_0xd2cb('0x31')][_0xd2cb('0x36')]));_0x6a3c8d['attributes']=_0x6a3c8d[_0xd2cb('0x35')][_0xd2cb('0x37')]?_0x6a3c8d[_0xd2cb('0x35')]:_0x11ccc5[_0xd2cb('0x30')];if(_0x1f5621[_0xd2cb('0x31')]['includeAll']){_0x6a3c8d[_0xd2cb('0x40')]=[{'all':!![]}];}_0x6a3c8d=_[_0xd2cb('0x3c')]({},_0x6a3c8d,_0x1f5621['options']);return db[_0xd2cb('0x2c')]['find'](_0x6a3c8d)[_0xd2cb('0x22')](handleEntityNotFound(_0x38733c,null))[_0xd2cb('0x22')](respondWithResult(_0x38733c,null))[_0xd2cb('0x43')](handleError(_0x38733c,null));};exports[_0xd2cb('0x47')]=function(_0x1e716b,_0x3d6d4d){return db[_0xd2cb('0x2c')]['create'](_0x1e716b['body'],{})['then'](function(_0x57bd98){var _0x1a57f0=_0x1e716b['user'][_0xd2cb('0x24')]({'plain':!![]});if(!_0x1a57f0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1a57f0[_0xd2cb('0x48')]===_0xd2cb('0x49')){var _0x2eea67=_0x57bd98[_0xd2cb('0x24')]({'plain':!![]});var _0x4bc134='ChanSpies';return db[_0xd2cb('0x4a')][_0xd2cb('0x4b')]({'where':{'name':_0x4bc134,'userProfileId':_0x1a57f0['userProfileId']},'raw':!![]})['then'](function(_0x3ec8a7){if(_0x3ec8a7&&_0x3ec8a7['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x2eea67[_0xd2cb('0x28')],'resourceId':_0x2eea67['id'],'type':_0x3ec8a7[_0xd2cb('0x28')],'sectionId':_0x3ec8a7['id']},{})[_0xd2cb('0x22')](function(){return _0x57bd98;});}else{return _0x57bd98;}})[_0xd2cb('0x43')](function(_0xee02d4){logger[_0xd2cb('0x26')](_0xd2cb('0x4c'),_0xee02d4);throw _0xee02d4;});}return _0x57bd98;})[_0xd2cb('0x22')](respondWithResult(_0x3d6d4d,0xc9))[_0xd2cb('0x43')](handleError(_0x3d6d4d,null));};exports[_0xd2cb('0x21')]=function(_0x14dced,_0xd7af1f){if(_0x14dced['body']['id']){delete _0x14dced[_0xd2cb('0x4d')]['id'];}return db[_0xd2cb('0x2c')][_0xd2cb('0x4b')]({'where':{'id':_0x14dced[_0xd2cb('0x45')]['id']}})[_0xd2cb('0x22')](handleEntityNotFound(_0xd7af1f,null))[_0xd2cb('0x22')](saveUpdates(_0x14dced[_0xd2cb('0x4d')],null))['then'](respondWithResult(_0xd7af1f,null))[_0xd2cb('0x43')](handleError(_0xd7af1f,null));};exports[_0xd2cb('0x23')]=function(_0x280678,_0x47bad8){return db['VoiceChanSpy'][_0xd2cb('0x4b')]({'where':{'id':_0x280678[_0xd2cb('0x45')]['id']}})[_0xd2cb('0x22')](handleEntityNotFound(_0x47bad8,null))[_0xd2cb('0x22')](removeEntity(_0x47bad8,null))[_0xd2cb('0x43')](handleError(_0x47bad8,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 84fc273..3ed4b63 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 _0xbf21=['merge','Set','CDR(type)=%s','chanspy','record','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','auth','Authenticate','ChanSpy','format','name','options','StopMixMonitor','length','concat','internal','User','agent','then','catch','exports','models','voice_chanspy','VoiceExtension','destroy','bulkCreate','lodash','context','from-sip','%s%s','push'];(function(_0x45931b,_0x118392){var _0x36ca13=function(_0x1d9c37){while(--_0x1d9c37){_0x45931b['push'](_0x45931b['shift']());}};_0x36ca13(++_0x118392);}(_0xbf21,0xc1));var _0x1bf2=function(_0x1324a3,_0x2fdebd){_0x1324a3=_0x1324a3-0x0;var _0x57dfea=_0xbf21[_0x1324a3];return _0x57dfea;};'use strict';var _=require(_0x1bf2('0x0'));var util=require('util');var BPromise=require('bluebird');var attributes=require('./voiceChanSpy.attributes');var getUserApplications=function(_0xd52226,_0x240745,_0x2d612a){var _0x14c485=0x1;var _0x2d48ad=[];var _0x22fc3a={'context':_0x240745[_0x1bf2('0x1')]||_0x1bf2('0x2'),'exten':util['format'](_0x1bf2('0x3'),_0xd52226['prefix'],_0x2d612a),'type':'system','isApp':![],'ChanSpyId':_0xd52226['id'],'UserId':_0x240745['id']};_0x2d48ad[_0x1bf2('0x4')](_[_0x1bf2('0x5')]({'app':_0x1bf2('0x6'),'appdata':util['format'](_0x1bf2('0x7'),_0x1bf2('0x8')),'priority':_0x14c485++},_0x22fc3a));if(_0xd52226[_0x1bf2('0x9')]){_0x2d48ad[_0x1bf2('0x4')](_['merge']({'app':_0x1bf2('0xa'),'appdata':util['format'](_0x1bf2('0xb'),_0xd52226[_0x1bf2('0xc')]),'priority':_0x14c485++},_0x22fc3a));}if(_0xd52226[_0x1bf2('0xd')]){_0x2d48ad[_0x1bf2('0x4')](_[_0x1bf2('0x5')]({'app':_0x1bf2('0xe'),'appdata':_0xd52226['password'],'priority':_0x14c485++},_0x22fc3a));}_0x2d48ad[_0x1bf2('0x4')](_['merge']({'app':_0x1bf2('0xf'),'appdata':util[_0x1bf2('0x10')]('SIP/%s,%s',_0x240745[_0x1bf2('0x11')],_0xd52226[_0x1bf2('0x12')]?_0xd52226[_0x1bf2('0x12')]['join'](''):''),'priority':_0x14c485++},_0x22fc3a));if(_0xd52226['record']){_0x2d48ad['push'](_[_0x1bf2('0x5')]({'app':_0x1bf2('0x13'),'priority':_0x14c485++},_0x22fc3a));}return _0x2d48ad;};var getChanSpyApplications=function(_0x509f1f,_0x49a4a5){var _0xb2c089=[];for(var _0x34829d=0x0,_0x4917c0=0x1;_0x34829d<_0x49a4a5[_0x1bf2('0x14')];_0x34829d++,_0x4917c0=0x1){_0xb2c089=_0xb2c089[_0x1bf2('0x15')](getUserApplications(_0x509f1f,_0x49a4a5[_0x34829d],_0x49a4a5[_0x34829d][_0x1bf2('0x16')]));if(_0x49a4a5[_0x34829d][_0x1bf2('0x16')]!=_0x49a4a5[_0x34829d][_0x1bf2('0x11')]){_0xb2c089=_0xb2c089[_0x1bf2('0x15')](getUserApplications(_0x509f1f,_0x49a4a5[_0x34829d],_0x49a4a5[_0x34829d]['name']));}}return _0xb2c089;};var getChanSpyPromise=function(_0x2159f0,_0x1d12f3){return new BPromise(function(_0x39288d,_0x58fc8f){return _0x2159f0[_0x1bf2('0x17')]['findAll']({'attributes':['id','name',_0x1bf2('0x16')],'where':{'role':_0x1bf2('0x18'),'chanspy':!![]},'raw':!![]})[_0x1bf2('0x19')](function(_0xc13895){if(_0xc13895){return _0x39288d(getChanSpyApplications(_0x1d12f3,_0xc13895));}return _0x39288d([]);})[_0x1bf2('0x1a')](function(_0x576e0d){_0x58fc8f(_0x576e0d);});});};module[_0x1bf2('0x1b')]=function(_0x26a089,_0x2d453){var _0xd95690=_0x26a089[_0x1bf2('0x1c')];return _0x26a089['define']('VoiceChanSpy',attributes,{'tableName':_0x1bf2('0x1d'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x1a20eb,_0x46e827,_0x4d70bc){return getChanSpyPromise(_0xd95690,_0x1a20eb)['then'](function(_0x530a44){if(_0x530a44&&_0x530a44[_0x1bf2('0x14')]){return _0xd95690[_0x1bf2('0x1e')]['bulkCreate'](_0x530a44);}})[_0x1bf2('0x19')](function(){_0x4d70bc();})[_0x1bf2('0x1a')](function(_0x15436b){_0x4d70bc(_0x15436b);});},'afterUpdate':function(_0x301df6,_0x282804,_0x1a52dc){return _0xd95690[_0x1bf2('0x1e')][_0x1bf2('0x1f')]({'where':{'ChanSpyId':_0x301df6['id']}})[_0x1bf2('0x19')](function(){return getChanSpyPromise(_0xd95690,_0x301df6);})['then'](function(_0x3cf3bf){if(_0x3cf3bf&&_0x3cf3bf[_0x1bf2('0x14')]){return _0xd95690[_0x1bf2('0x1e')][_0x1bf2('0x20')](_0x3cf3bf);}})[_0x1bf2('0x19')](function(){_0x1a52dc();})[_0x1bf2('0x1a')](function(_0xb71541){_0x1a52dc(_0xb71541);});},'afterDestroy':function(_0x2e4580,_0x332eda,_0x26ab35){return _0xd95690[_0x1bf2('0x1e')][_0x1bf2('0x1f')]({'where':{'ChanSpyId':_0x2e4580['id']}})[_0x1bf2('0x19')](function(){_0x26ab35();})['catch'](function(_0x29aec0){_0x26ab35(_0x29aec0);});}}});}; \ No newline at end of file +var _0xa0a3=['MixMonitor','${UNIQUEID}.%s,a','recordingFormat','auth','Authenticate','password','ChanSpy','name','options','join','StopMixMonitor','length','concat','internal','agent','then','catch','define','VoiceChanSpy','voice_chanspy','VoiceExtension','bulkCreate','destroy','lodash','util','bluebird','./voiceChanSpy.attributes','from-sip','%s%s','prefix','push','merge','Set','format','CDR(type)=%s','chanspy','record'];(function(_0x1fc034,_0x56fd41){var _0xfbc45e=function(_0x103036){while(--_0x103036){_0x1fc034['push'](_0x1fc034['shift']());}};_0xfbc45e(++_0x56fd41);}(_0xa0a3,0x11a));var _0x3a0a=function(_0x5d0491,_0x102187){_0x5d0491=_0x5d0491-0x0;var _0x363aa9=_0xa0a3[_0x5d0491];return _0x363aa9;};'use strict';var _=require(_0x3a0a('0x0'));var util=require(_0x3a0a('0x1'));var BPromise=require(_0x3a0a('0x2'));var attributes=require(_0x3a0a('0x3'));var getUserApplications=function(_0x1167b9,_0x519ac0,_0x435561){var _0x5856f8=0x1;var _0x992af8=[];var _0x171e71={'context':_0x519ac0['context']||_0x3a0a('0x4'),'exten':util['format'](_0x3a0a('0x5'),_0x1167b9[_0x3a0a('0x6')],_0x435561),'type':'system','isApp':![],'ChanSpyId':_0x1167b9['id'],'UserId':_0x519ac0['id']};_0x992af8[_0x3a0a('0x7')](_[_0x3a0a('0x8')]({'app':_0x3a0a('0x9'),'appdata':util[_0x3a0a('0xa')](_0x3a0a('0xb'),_0x3a0a('0xc')),'priority':_0x5856f8++},_0x171e71));if(_0x1167b9[_0x3a0a('0xd')]){_0x992af8[_0x3a0a('0x7')](_[_0x3a0a('0x8')]({'app':_0x3a0a('0xe'),'appdata':util[_0x3a0a('0xa')](_0x3a0a('0xf'),_0x1167b9[_0x3a0a('0x10')]),'priority':_0x5856f8++},_0x171e71));}if(_0x1167b9[_0x3a0a('0x11')]){_0x992af8['push'](_[_0x3a0a('0x8')]({'app':_0x3a0a('0x12'),'appdata':_0x1167b9[_0x3a0a('0x13')],'priority':_0x5856f8++},_0x171e71));}_0x992af8[_0x3a0a('0x7')](_[_0x3a0a('0x8')]({'app':_0x3a0a('0x14'),'appdata':util[_0x3a0a('0xa')]('SIP/%s,%s',_0x519ac0[_0x3a0a('0x15')],_0x1167b9[_0x3a0a('0x16')]?_0x1167b9['options'][_0x3a0a('0x17')](''):''),'priority':_0x5856f8++},_0x171e71));if(_0x1167b9[_0x3a0a('0xd')]){_0x992af8[_0x3a0a('0x7')](_['merge']({'app':_0x3a0a('0x18'),'priority':_0x5856f8++},_0x171e71));}return _0x992af8;};var getChanSpyApplications=function(_0x359ba8,_0x4a69f7){var _0x20db10=[];for(var _0xd02082=0x0,_0x181be1=0x1;_0xd02082<_0x4a69f7[_0x3a0a('0x19')];_0xd02082++,_0x181be1=0x1){_0x20db10=_0x20db10[_0x3a0a('0x1a')](getUserApplications(_0x359ba8,_0x4a69f7[_0xd02082],_0x4a69f7[_0xd02082][_0x3a0a('0x1b')]));if(_0x4a69f7[_0xd02082][_0x3a0a('0x1b')]!=_0x4a69f7[_0xd02082][_0x3a0a('0x15')]){_0x20db10=_0x20db10[_0x3a0a('0x1a')](getUserApplications(_0x359ba8,_0x4a69f7[_0xd02082],_0x4a69f7[_0xd02082]['name']));}}return _0x20db10;};var getChanSpyPromise=function(_0xd15e78,_0x166a0c){return new BPromise(function(_0x3995ac,_0xfc295b){return _0xd15e78['User']['findAll']({'attributes':['id',_0x3a0a('0x15'),_0x3a0a('0x1b')],'where':{'role':_0x3a0a('0x1c'),'chanspy':!![]},'raw':!![]})[_0x3a0a('0x1d')](function(_0x76f423){if(_0x76f423){return _0x3995ac(getChanSpyApplications(_0x166a0c,_0x76f423));}return _0x3995ac([]);})[_0x3a0a('0x1e')](function(_0x50da79){_0xfc295b(_0x50da79);});});};module['exports']=function(_0x282b82,_0x376dd5){var _0x4af68c=_0x282b82['models'];return _0x282b82[_0x3a0a('0x1f')](_0x3a0a('0x20'),attributes,{'tableName':_0x3a0a('0x21'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x5b58cd,_0x2410ce,_0x380525){return getChanSpyPromise(_0x4af68c,_0x5b58cd)[_0x3a0a('0x1d')](function(_0x502024){if(_0x502024&&_0x502024[_0x3a0a('0x19')]){return _0x4af68c[_0x3a0a('0x22')][_0x3a0a('0x23')](_0x502024);}})['then'](function(){_0x380525();})[_0x3a0a('0x1e')](function(_0x27dd26){_0x380525(_0x27dd26);});},'afterUpdate':function(_0x8178a3,_0x3b73dc,_0x3db9ea){return _0x4af68c['VoiceExtension']['destroy']({'where':{'ChanSpyId':_0x8178a3['id']}})[_0x3a0a('0x1d')](function(){return getChanSpyPromise(_0x4af68c,_0x8178a3);})[_0x3a0a('0x1d')](function(_0x584bb3){if(_0x584bb3&&_0x584bb3['length']){return _0x4af68c[_0x3a0a('0x22')]['bulkCreate'](_0x584bb3);}})[_0x3a0a('0x1d')](function(){_0x3db9ea();})[_0x3a0a('0x1e')](function(_0x5c6c25){_0x3db9ea(_0x5c6c25);});},'afterDestroy':function(_0x18a22d,_0x41bcb8,_0x61a00a){return _0x4af68c[_0x3a0a('0x22')][_0x3a0a('0x24')]({'where':{'ChanSpyId':_0x18a22d['id']}})['then'](function(){_0x61a00a();})['catch'](function(_0x2d61a9){_0x61a00a(_0x2d61a9);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 4033463..7b45698 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 _0x3a25=['then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x4a607c,_0x276f02){var _0x31e8eb=function(_0x1f26df){while(--_0x1f26df){_0x4a607c['push'](_0x4a607c['shift']());}};_0x31e8eb(++_0x276f02);}(_0x3a25,0x15d));var _0x53a2=function(_0x4c6024,_0x3da456){_0x4c6024=_0x4c6024-0x0;var _0x38c201=_0x3a25[_0x4c6024];return _0x38c201;};'use strict';var _=require(_0x53a2('0x0'));var util=require(_0x53a2('0x1'));var moment=require(_0x53a2('0x2'));var BPromise=require(_0x53a2('0x3'));var rs=require(_0x53a2('0x4'));var fs=require('fs');var Redis=require(_0x53a2('0x5'));var db=require(_0x53a2('0x6'))['db'];var utils=require(_0x53a2('0x7'));var logger=require(_0x53a2('0x8'))(_0x53a2('0x9'));var config=require(_0x53a2('0xa'));var jayson=require(_0x53a2('0xb'));var client=jayson[_0x53a2('0xc')][_0x53a2('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x409fff,_0x4d53b8,_0x3ee956){return new BPromise(function(_0x5dc70e,_0x17aa09){return client[_0x53a2('0xe')](_0x409fff,_0x3ee956)[_0x53a2('0xf')](function(_0x42bf42){logger[_0x53a2('0x10')](_0x53a2('0x11'),_0x4d53b8,_0x53a2('0x12'));logger[_0x53a2('0x13')](_0x53a2('0x14'),_0x4d53b8,_0x53a2('0x12'),JSON['stringify'](_0x42bf42));if(_0x42bf42['error']){if(_0x42bf42[_0x53a2('0x15')][_0x53a2('0x16')]===0x1f4){logger['error']('VoiceChanSpy,\x20%s,\x20%s',_0x4d53b8,_0x42bf42['error'][_0x53a2('0x17')]);return _0x17aa09(_0x42bf42[_0x53a2('0x15')][_0x53a2('0x17')]);}logger['error']('VoiceChanSpy,\x20%s,\x20%s',_0x4d53b8,_0x42bf42['error'][_0x53a2('0x17')]);return _0x5dc70e(_0x42bf42[_0x53a2('0x15')][_0x53a2('0x17')]);}else{logger[_0x53a2('0x10')]('VoiceChanSpy,\x20%s,\x20%s',_0x4d53b8,_0x53a2('0x12'));_0x5dc70e(_0x42bf42[_0x53a2('0x18')][_0x53a2('0x17')]);}})[_0x53a2('0x19')](function(_0x34c7de){logger['error']('VoiceChanSpy,\x20%s,\x20%s',_0x4d53b8,_0x34c7de);_0x17aa09(_0x34c7de);});});} \ No newline at end of file +var _0x2504=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','error','code','VoiceChanSpy,\x20%s,\x20%s','message','result','catch','lodash','util'];(function(_0x532268,_0x91703){var _0x5c8ef4=function(_0x4926aa){while(--_0x4926aa){_0x532268['push'](_0x532268['shift']());}};_0x5c8ef4(++_0x91703);}(_0x2504,0xee));var _0x4250=function(_0x165d12,_0x48ef85){_0x165d12=_0x165d12-0x0;var _0x5b2694=_0x2504[_0x165d12];return _0x5b2694;};'use strict';var _=require(_0x4250('0x0'));var util=require(_0x4250('0x1'));var moment=require(_0x4250('0x2'));var BPromise=require(_0x4250('0x3'));var rs=require(_0x4250('0x4'));var fs=require('fs');var Redis=require(_0x4250('0x5'));var db=require(_0x4250('0x6'))['db'];var utils=require(_0x4250('0x7'));var logger=require(_0x4250('0x8'))(_0x4250('0x9'));var config=require(_0x4250('0xa'));var jayson=require(_0x4250('0xb'));var client=jayson['client'][_0x4250('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4e177e,_0x5a5286,_0x370998){return new BPromise(function(_0x477312,_0x1a3b57){return client[_0x4250('0xd')](_0x4e177e,_0x370998)[_0x4250('0xe')](function(_0x51ea6f){logger[_0x4250('0xf')]('VoiceChanSpy,\x20%s,\x20%s',_0x5a5286,_0x4250('0x10'));logger[_0x4250('0x11')]('VoiceChanSpy,\x20%s,\x20%s,\x20%s',_0x5a5286,_0x4250('0x10'),JSON['stringify'](_0x51ea6f));if(_0x51ea6f['error']){if(_0x51ea6f[_0x4250('0x12')][_0x4250('0x13')]===0x1f4){logger[_0x4250('0x12')](_0x4250('0x14'),_0x5a5286,_0x51ea6f[_0x4250('0x12')]['message']);return _0x1a3b57(_0x51ea6f[_0x4250('0x12')][_0x4250('0x15')]);}logger[_0x4250('0x12')](_0x4250('0x14'),_0x5a5286,_0x51ea6f[_0x4250('0x12')][_0x4250('0x15')]);return _0x477312(_0x51ea6f['error'][_0x4250('0x15')]);}else{logger[_0x4250('0xf')](_0x4250('0x14'),_0x5a5286,_0x4250('0x10'));_0x477312(_0x51ea6f[_0x4250('0x16')][_0x4250('0x15')]);}})[_0x4250('0x17')](function(_0x4e70fc){logger[_0x4250('0x12')](_0x4250('0x14'),_0x5a5286,_0x4e70fc);_0x1a3b57(_0x4e70fc);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index a30f8bd..0ffe5ac 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 _0xd5ed=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceContext.controller','isAuthenticated','index','get','/:id','show','create','put','update','delete','destroy','exports'];(function(_0xe88157,_0x965589){var _0xa9cf33=function(_0x222d32){while(--_0x222d32){_0xe88157['push'](_0xe88157['shift']());}};_0xa9cf33(++_0x965589);}(_0xd5ed,0x165));var _0xdd5e=function(_0x56a42c,_0x398d98){_0x56a42c=_0x56a42c-0x0;var _0x900d77=_0xd5ed[_0x56a42c];return _0x900d77;};'use strict';var multer=require('multer');var util=require(_0xdd5e('0x0'));var path=require(_0xdd5e('0x1'));var timeout=require(_0xdd5e('0x2'));var express=require(_0xdd5e('0x3'));var router=express[_0xdd5e('0x4')]();var fs_extra=require(_0xdd5e('0x5'));var auth=require(_0xdd5e('0x6'));var interaction=require(_0xdd5e('0x7'));var config=require(_0xdd5e('0x8'));var controller=require(_0xdd5e('0x9'));router['get']('/',auth[_0xdd5e('0xa')](),controller[_0xdd5e('0xb')]);router[_0xdd5e('0xc')](_0xdd5e('0xd'),auth['isAuthenticated'](),controller[_0xdd5e('0xe')]);router['post']('/',auth[_0xdd5e('0xa')](),controller[_0xdd5e('0xf')]);router[_0xdd5e('0x10')]('/:id',auth[_0xdd5e('0xa')](),controller[_0xdd5e('0x11')]);router[_0xdd5e('0x12')](_0xdd5e('0xd'),auth[_0xdd5e('0xa')](),controller[_0xdd5e('0x13')]);module[_0xdd5e('0x14')]=router; \ No newline at end of file +var _0x7dd5=['create','/:id','update','delete','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceContext.controller','get','isAuthenticated','show','post'];(function(_0x182454,_0x4c25dd){var _0x262191=function(_0x492c19){while(--_0x492c19){_0x182454['push'](_0x182454['shift']());}};_0x262191(++_0x4c25dd);}(_0x7dd5,0x1f2));var _0x57dd=function(_0x368550,_0x3a68e3){_0x368550=_0x368550-0x0;var _0xa32093=_0x7dd5[_0x368550];return _0xa32093;};'use strict';var multer=require(_0x57dd('0x0'));var util=require(_0x57dd('0x1'));var path=require(_0x57dd('0x2'));var timeout=require(_0x57dd('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x57dd('0x4'));var auth=require(_0x57dd('0x5'));var interaction=require(_0x57dd('0x6'));var config=require('../../config/environment');var controller=require(_0x57dd('0x7'));router[_0x57dd('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x57dd('0x8')]('/:id',auth[_0x57dd('0x9')](),controller[_0x57dd('0xa')]);router[_0x57dd('0xb')]('/',auth['isAuthenticated'](),controller[_0x57dd('0xc')]);router['put'](_0x57dd('0xd'),auth[_0x57dd('0x9')](),controller[_0x57dd('0xe')]);router[_0x57dd('0xf')](_0x57dd('0xd'),auth[_0x57dd('0x9')](),controller['destroy']);module[_0x57dd('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 533dc91..93dc2be 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 _0xa3a9=['sequelize','exports','STRING','BOOLEAN'];(function(_0x571ec1,_0x45684b){var _0xb02e0=function(_0x2d7cc1){while(--_0x2d7cc1){_0x571ec1['push'](_0x571ec1['shift']());}};_0xb02e0(++_0x45684b);}(_0xa3a9,0xfc));var _0x9a3a=function(_0x13bee8,_0x396be1){_0x13bee8=_0x13bee8-0x0;var _0x2488c2=_0xa3a9[_0x13bee8];return _0x2488c2;};'use strict';var Sequelize=require(_0x9a3a('0x0'));module[_0x9a3a('0x1')]={'name':{'type':Sequelize[_0x9a3a('0x2')],'unique':'name'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x9a3a('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0xa9cd=['sequelize','STRING','BOOLEAN'];(function(_0x49d7ca,_0x514fc4){var _0x12422f=function(_0x2bc407){while(--_0x2bc407){_0x49d7ca['push'](_0x49d7ca['shift']());}};_0x12422f(++_0x514fc4);}(_0xa9cd,0x171));var _0xda9c=function(_0x52f213,_0x12c342){_0x52f213=_0x52f213-0x0;var _0x3a555b=_0xa9cd[_0x52f213];return _0x3a555b;};'use strict';var Sequelize=require(_0xda9c('0x0'));module['exports']={'name':{'type':Sequelize[_0xda9c('0x1')],'unique':'name'},'description':{'type':Sequelize[_0xda9c('0x1')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xda9c('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.controller.js b/server/api/voiceContext/voiceContext.controller.js index 0e3a0f0..0f21e32 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 _0x855e=['attributes','fields','length','nolimit','order','where','filters','merge','filter','options','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','join','utf8','render','writeFileSync','Reload','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','/etc/asterisk/extensions_xcally_contexts.conf','readFileSync','root','server/files/templates/context.ejs','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','http','request','then','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','update','get','Contexts','UserProfileResource','destroy','end','stack','name','send','index','map','VoiceContext','fieldName','type','key','model','query','keys','intersection'];(function(_0x2c5e89,_0x27d432){var _0x3850d7=function(_0x4e89ce){while(--_0x4e89ce){_0x2c5e89['push'](_0x2c5e89['shift']());}};_0x3850d7(++_0x27d432);}(_0x855e,0xf1));var _0xe855=function(_0x323c4b,_0x281826){_0x323c4b=_0x323c4b-0x0;var _0x5264dd=_0x855e[_0x323c4b];return _0x5264dd;};'use strict';var emlformat=require(_0xe855('0x0'));var rimraf=require(_0xe855('0x1'));var zipdir=require(_0xe855('0x2'));var jsonpatch=require(_0xe855('0x3'));var rp=require(_0xe855('0x4'));var moment=require(_0xe855('0x5'));var BPromise=require(_0xe855('0x6'));var Mustache=require('mustache');var util=require(_0xe855('0x7'));var path=require(_0xe855('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xe855('0x9'));var fs=require('fs');var fs_extra=require(_0xe855('0xa'));var _=require(_0xe855('0xb'));var squel=require(_0xe855('0xc'));var crypto=require(_0xe855('0xd'));var jsforce=require(_0xe855('0xe'));var deskjs=require(_0xe855('0xf'));var toCsv=require(_0xe855('0x10'));var querystring=require(_0xe855('0x11'));var Papa=require(_0xe855('0x12'));var Redis=require(_0xe855('0x13'));var authService=require(_0xe855('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xe855('0x15'));var hardwareService=require(_0xe855('0x16'));var logger=require(_0xe855('0x17'))('api');var utils=require(_0xe855('0x18'));var config=require(_0xe855('0x19'));var licenseUtil=require(_0xe855('0x1a'));var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0xe855('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x1d947b,_0x58dcc9,_0x1d8d8c,_0x159190){return new BPromise(function(_0x15cd7f,_0x1cd1d6){var _0x57739d=_0x159190||client;return _0x57739d[_0xe855('0x1c')](_0x1d947b,_0x1d8d8c)[_0xe855('0x1d')](function(_0x2d33a4){logger['info'](_0xe855('0x1e'),_0x58dcc9,_0xe855('0x1f'));logger[_0xe855('0x20')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x58dcc9,'request\x20sent',JSON[_0xe855('0x21')](_0x2d33a4));if(_0x2d33a4[_0xe855('0x22')]){if(_0x2d33a4[_0xe855('0x22')][_0xe855('0x23')]===0x1f4){logger[_0xe855('0x22')](_0xe855('0x1e'),_0x58dcc9,_0x2d33a4['error'][_0xe855('0x24')]);return _0x1cd1d6(_0x2d33a4['error'][_0xe855('0x24')]);}logger[_0xe855('0x22')](_0xe855('0x1e'),_0x58dcc9,_0x2d33a4[_0xe855('0x22')]['message']);return _0x15cd7f(_0x2d33a4[_0xe855('0x22')][_0xe855('0x24')]);}else{logger['info'](_0xe855('0x1e'),_0x58dcc9,_0xe855('0x1f'));_0x15cd7f(_0x2d33a4[_0xe855('0x25')]['message']);}})['catch'](function(_0x3bbf29){logger[_0xe855('0x22')]('VoiceContext,\x20%s,\x20%s',_0x58dcc9,_0x3bbf29);_0x1cd1d6(_0x3bbf29);});});}function respondWithStatusCode(_0x7b3b31,_0x27bfbf){_0x27bfbf=_0x27bfbf||0xcc;return function(_0x3c8d57){if(_0x3c8d57){return _0x7b3b31[_0xe855('0x26')](_0x27bfbf);}return _0x7b3b31[_0xe855('0x27')](_0x27bfbf)['end']();};}function respondWithResult(_0x42606d,_0x336046){_0x336046=_0x336046||0xc8;return function(_0x447531){if(_0x447531){return _0x42606d[_0xe855('0x27')](_0x336046)[_0xe855('0x28')](_0x447531);}};}function respondWithFilteredResult(_0x1b8ffa,_0x58a7a7){return function(_0x13db5d){if(_0x13db5d){var _0x51dea6=typeof _0x58a7a7[_0xe855('0x29')]===_0xe855('0x2a')&&typeof _0x58a7a7[_0xe855('0x2b')]===_0xe855('0x2a');var _0x3794db=_0x13db5d[_0xe855('0x2c')];var _0x37cc4f=_0x51dea6?0x0:_0x58a7a7[_0xe855('0x29')];var _0x67708c=_0x51dea6?_0x13db5d[_0xe855('0x2c')]:_0x58a7a7[_0xe855('0x29')]+_0x58a7a7[_0xe855('0x2b')];var _0x5cb654;if(_0x67708c>=_0x3794db){_0x67708c=_0x3794db;_0x5cb654=0xc8;}else{_0x5cb654=0xce;}_0x1b8ffa[_0xe855('0x27')](_0x5cb654);return _0x1b8ffa[_0xe855('0x2d')]('Content-Range',_0x37cc4f+'-'+_0x67708c+'/'+_0x3794db)[_0xe855('0x28')](_0x13db5d);}return null;};}function patchUpdates(_0xcbd1e3){return function(_0x3d7810){try{jsonpatch[_0xe855('0x2e')](_0x3d7810,_0xcbd1e3,!![]);}catch(_0x2c61bb){return BPromise[_0xe855('0x2f')](_0x2c61bb);}return _0x3d7810[_0xe855('0x30')]();};}function saveUpdates(_0x1489bc,_0x44116f){return function(_0x522657){if(_0x522657){return _0x522657[_0xe855('0x31')](_0x1489bc)[_0xe855('0x1d')](function(_0xd87826){return _0xd87826;});}return null;};}function removeEntity(_0x40bf65,_0x48b456){return function(_0x5f2ad8){if(_0x5f2ad8){return _0x5f2ad8['destroy']()[_0xe855('0x1d')](function(){var _0x5b8b7f=_0x5f2ad8[_0xe855('0x32')]({'plain':!![]});var _0x5cb935=_0xe855('0x33');return db[_0xe855('0x34')][_0xe855('0x35')]({'where':{'type':_0x5cb935,'resourceId':_0x5b8b7f['id']}})[_0xe855('0x1d')](function(){return _0x5f2ad8;});})[_0xe855('0x1d')](function(){_0x40bf65[_0xe855('0x27')](0xcc)[_0xe855('0x36')]();});}};}function handleEntityNotFound(_0x17292c,_0x30c0c7){return function(_0x187bc7){if(!_0x187bc7){_0x17292c[_0xe855('0x26')](0x194);}return _0x187bc7;};}function handleError(_0x48db82,_0x445e4b){_0x445e4b=_0x445e4b||0x1f4;return function(_0x1d9370){logger['error'](_0x1d9370[_0xe855('0x37')]);if(_0x1d9370[_0xe855('0x38')]){delete _0x1d9370['name'];}_0x48db82[_0xe855('0x27')](_0x445e4b)[_0xe855('0x39')](_0x1d9370);};}exports[_0xe855('0x3a')]=function(_0x3ccf59,_0x397ff8){var _0x3680fd={},_0x59a63c={},_0x4040de={'count':0x0,'rows':[]};var _0x1b746c=_[_0xe855('0x3b')](db[_0xe855('0x3c')]['rawAttributes'],function(_0x5ade88){return{'name':_0x5ade88[_0xe855('0x3d')],'type':_0x5ade88[_0xe855('0x3e')][_0xe855('0x3f')]};});_0x59a63c[_0xe855('0x40')]=_['map'](_0x1b746c,_0xe855('0x38'));_0x59a63c[_0xe855('0x41')]=_[_0xe855('0x42')](_0x3ccf59[_0xe855('0x41')]);_0x59a63c['filters']=_[_0xe855('0x43')](_0x59a63c[_0xe855('0x40')],_0x59a63c['query']);_0x3680fd[_0xe855('0x44')]=_[_0xe855('0x43')](_0x59a63c[_0xe855('0x40')],qs[_0xe855('0x45')](_0x3ccf59['query'][_0xe855('0x45')]));_0x3680fd[_0xe855('0x44')]=_0x3680fd['attributes'][_0xe855('0x46')]?_0x3680fd['attributes']:_0x59a63c['model'];if(!_0x3ccf59[_0xe855('0x41')]['hasOwnProperty'](_0xe855('0x47'))){_0x3680fd[_0xe855('0x2b')]=qs[_0xe855('0x2b')](_0x3ccf59[_0xe855('0x41')][_0xe855('0x2b')]);_0x3680fd[_0xe855('0x29')]=qs[_0xe855('0x29')](_0x3ccf59[_0xe855('0x41')][_0xe855('0x29')]);}_0x3680fd[_0xe855('0x48')]=qs['sort'](_0x3ccf59[_0xe855('0x41')]['sort']);_0x3680fd[_0xe855('0x49')]=qs['filters'](_['pick'](_0x3ccf59['query'],_0x59a63c[_0xe855('0x4a')]),_0x1b746c);if(_0x3ccf59[_0xe855('0x41')]['filter']){_0x3680fd['where']=_[_0xe855('0x4b')](_0x3680fd[_0xe855('0x49')],{'$or':_[_0xe855('0x3b')](_0x1b746c,function(_0x57aa51){if(_0x57aa51[_0xe855('0x3e')]!=='VIRTUAL'){var _0xbd158f={};_0xbd158f[_0x57aa51[_0xe855('0x38')]]={'$like':'%'+_0x3ccf59[_0xe855('0x41')][_0xe855('0x4c')]+'%'};return _0xbd158f;}})});}_0x3680fd=_['merge']({},_0x3680fd,_0x3ccf59[_0xe855('0x4d')]);var _0x2bf43d={'where':_0x3680fd['where']};return db['VoiceContext'][_0xe855('0x2c')](_0x2bf43d)['then'](function(_0x2107f7){_0x4040de[_0xe855('0x2c')]=_0x2107f7;if(_0x3ccf59[_0xe855('0x41')]['includeAll']){_0x3680fd[_0xe855('0x4e')]=[{'all':!![]}];}return db[_0xe855('0x3c')][_0xe855('0x4f')](_0x3680fd);})['then'](function(_0xf51894){_0x4040de[_0xe855('0x50')]=_0xf51894;return _0x4040de;})[_0xe855('0x1d')](respondWithFilteredResult(_0x397ff8,_0x3680fd))[_0xe855('0x51')](handleError(_0x397ff8,null));};exports[_0xe855('0x52')]=function(_0x31fcf8,_0x553265){var _0x1527b9={'raw':![],'where':{'id':_0x31fcf8[_0xe855('0x53')]['id']}},_0x5f47ad={};_0x5f47ad[_0xe855('0x40')]=_[_0xe855('0x42')](db[_0xe855('0x3c')][_0xe855('0x54')]);_0x5f47ad[_0xe855('0x41')]=_[_0xe855('0x42')](_0x31fcf8[_0xe855('0x41')]);_0x5f47ad[_0xe855('0x4a')]=_[_0xe855('0x43')](_0x5f47ad[_0xe855('0x40')],_0x5f47ad[_0xe855('0x41')]);_0x1527b9['attributes']=_['intersection'](_0x5f47ad['model'],qs['fields'](_0x31fcf8[_0xe855('0x41')][_0xe855('0x45')]));_0x1527b9['attributes']=_0x1527b9[_0xe855('0x44')][_0xe855('0x46')]?_0x1527b9['attributes']:_0x5f47ad['model'];if(_0x31fcf8[_0xe855('0x41')]['includeAll']){_0x1527b9[_0xe855('0x4e')]=[{'all':!![]}];}_0x1527b9=_['merge']({},_0x1527b9,_0x31fcf8[_0xe855('0x4d')]);return db[_0xe855('0x3c')][_0xe855('0x55')](_0x1527b9)['then'](handleEntityNotFound(_0x553265,null))[_0xe855('0x1d')](respondWithResult(_0x553265,null))[_0xe855('0x51')](handleError(_0x553265,null));};exports[_0xe855('0x56')]=function(_0x3c9841,_0x8ee87d,_0x344a8c){var _0x150f66;return db['VoiceContext'][_0xe855('0x56')](_0x3c9841[_0xe855('0x57')],{'raw':!![]})[_0xe855('0x1d')](function(_0x418106){_0x150f66=_0x418106;return db[_0xe855('0x3c')][_0xe855('0x4f')]({'raw':!![]});})[_0xe855('0x1d')](function(_0x2ae3b8){var _0x3bc3f9=fs['readFileSync'](path[_0xe855('0x58')](config['root'],'server/files/templates/context.ejs'),_0xe855('0x59'));var _0x87f9ea=ejs[_0xe855('0x5a')](_0x3bc3f9,{'contexts':_0x2ae3b8||[]});fs[_0xe855('0x5b')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x87f9ea);})[_0xe855('0x1d')](function(){return respondWithRpcPromise(_0xe855('0x5c'),_0xe855('0x56'),{'module':_0xe855('0x5d')});})[_0xe855('0x1d')](function(){var _0x1ffa4c=_0x3c9841[_0xe855('0x5e')][_0xe855('0x32')]({'plain':!![]});if(!_0x1ffa4c)throw new Error(_0xe855('0x5f'));if(_0x1ffa4c[_0xe855('0x60')]==='user'){var _0x319a13=_0x150f66[_0xe855('0x32')]({'plain':!![]});return db['UserProfileSection'][_0xe855('0x55')]({'where':{'name':_0xe855('0x33'),'userProfileId':_0x1ffa4c['userProfileId']},'raw':!![]})[_0xe855('0x1d')](function(_0x1340b7){if(_0x1340b7&&_0x1340b7[_0xe855('0x61')]===0x0){return db[_0xe855('0x34')][_0xe855('0x56')]({'name':_0x319a13[_0xe855('0x38')],'resourceId':_0x319a13['id'],'type':_0x1340b7[_0xe855('0x38')],'sectionId':_0x1340b7['id']},{})['then'](function(){return _0x150f66;});}else{return _0x150f66;}})[_0xe855('0x51')](function(_0xcf81a6){logger['error'](_0xe855('0x62'),_0xcf81a6);throw _0xcf81a6;});}return _0x150f66;})[_0xe855('0x1d')](respondWithResult(_0x8ee87d,0xc9))[_0xe855('0x51')](handleError(_0x8ee87d,null));};exports['update']=function(_0x488dc4,_0x4a12ff,_0x1ddb72){var _0x36a19b;return db['VoiceContext'][_0xe855('0x55')]({'where':{'id':_0x488dc4[_0xe855('0x53')]['id']}})[_0xe855('0x1d')](handleEntityNotFound(_0x4a12ff,null))['then'](saveUpdates(_0x488dc4[_0xe855('0x57')],null))['then'](function(_0x1bba80){if(_0x1bba80){_0x36a19b=_0x1bba80;return db[_0xe855('0x3c')][_0xe855('0x4f')]({'raw':!![]});}})[_0xe855('0x1d')](function(_0x331c6b){var _0x17ee90=fs['readFileSync'](path[_0xe855('0x58')](config['root'],'server/files/templates/context.ejs'),_0xe855('0x59'));var _0x5246e6=ejs['render'](_0x17ee90,{'contexts':_0x331c6b||[]});fs[_0xe855('0x5b')](_0xe855('0x63'),_0x5246e6);})[_0xe855('0x1d')](function(){return respondWithRpcPromise('Reload',_0xe855('0x31'),{'module':_0xe855('0x5d')});})[_0xe855('0x1d')](function(){return _0x36a19b;})['then'](respondWithResult(_0x4a12ff,null))[_0xe855('0x51')](handleError(_0x4a12ff,null));};exports[_0xe855('0x35')]=function(_0x36d3f8,_0x44d8c9,_0x3698e4){var _0x11305d;return db[_0xe855('0x3c')][_0xe855('0x55')]({'where':{'id':_0x36d3f8[_0xe855('0x53')]['id']}})['then'](handleEntityNotFound(_0x44d8c9,null))['then'](removeEntity(_0x44d8c9,null))[_0xe855('0x1d')](function(){return db[_0xe855('0x3c')][_0xe855('0x4f')]({'raw':!![]});})[_0xe855('0x1d')](function(_0x5e6953){var _0x422676=fs[_0xe855('0x64')](path[_0xe855('0x58')](config[_0xe855('0x65')],_0xe855('0x66')),_0xe855('0x59'));var _0x5d4648=ejs['render'](_0x422676,{'contexts':_0x5e6953});fs[_0xe855('0x5b')](_0xe855('0x63'),_0x5d4648);return respondWithRpcPromise(_0xe855('0x5c'),'destroy',{'module':'chan_sip.so'});})[_0xe855('0x51')](handleError(_0x44d8c9,null));}; \ No newline at end of file +var _0xc440=['sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','destroy','get','Contexts','UserProfileResource','then','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','filter','merge','VIRTUAL','options','VoiceContext','includeAll','rows','params','include','find','create','body','readFileSync','join','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','root','server/files/templates/context.ejs','render','Reload','utf8','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','request','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','error','code','message','catch'];(function(_0x490001,_0x383b57){var _0x1c5590=function(_0x152dca){while(--_0x152dca){_0x490001['push'](_0x490001['shift']());}};_0x1c5590(++_0x383b57);}(_0xc440,0xab));var _0x0c44=function(_0x13c86b,_0x31593a){_0x13c86b=_0x13c86b-0x0;var _0x48deac=_0xc440[_0x13c86b];return _0x48deac;};'use strict';var emlformat=require(_0x0c44('0x0'));var rimraf=require(_0x0c44('0x1'));var zipdir=require(_0x0c44('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0c44('0x3'));var moment=require(_0x0c44('0x4'));var BPromise=require(_0x0c44('0x5'));var Mustache=require(_0x0c44('0x6'));var util=require(_0x0c44('0x7'));var path=require(_0x0c44('0x8'));var sox=require(_0x0c44('0x9'));var csv=require(_0x0c44('0xa'));var ejs=require(_0x0c44('0xb'));var fs=require('fs');var fs_extra=require(_0x0c44('0xc'));var _=require(_0x0c44('0xd'));var squel=require(_0x0c44('0xe'));var crypto=require(_0x0c44('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0c44('0xa'));var querystring=require('querystring');var Papa=require(_0x0c44('0x10'));var Redis=require(_0x0c44('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x0c44('0x12'));var as=require(_0x0c44('0x13'));var hardwareService=require(_0x0c44('0x14'));var logger=require(_0x0c44('0x15'))(_0x0c44('0x16'));var utils=require(_0x0c44('0x17'));var config=require(_0x0c44('0x18'));var licenseUtil=require(_0x0c44('0x19'));var db=require(_0x0c44('0x1a'))['db'];var jayson=require(_0x0c44('0x1b'));var client=jayson[_0x0c44('0x1c')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3fef0f,_0x31ffb8,_0x1411d9,_0x16d2d4){return new BPromise(function(_0x26f28a,_0x4f0cca){var _0x431107=_0x16d2d4||client;return _0x431107[_0x0c44('0x1d')](_0x3fef0f,_0x1411d9)['then'](function(_0x9f4db5){logger[_0x0c44('0x1e')](_0x0c44('0x1f'),_0x31ffb8,_0x0c44('0x20'));logger[_0x0c44('0x21')](_0x0c44('0x22'),_0x31ffb8,_0x0c44('0x20'),JSON['stringify'](_0x9f4db5));if(_0x9f4db5[_0x0c44('0x23')]){if(_0x9f4db5[_0x0c44('0x23')][_0x0c44('0x24')]===0x1f4){logger['error'](_0x0c44('0x1f'),_0x31ffb8,_0x9f4db5[_0x0c44('0x23')]['message']);return _0x4f0cca(_0x9f4db5[_0x0c44('0x23')]['message']);}logger[_0x0c44('0x23')]('VoiceContext,\x20%s,\x20%s',_0x31ffb8,_0x9f4db5['error']['message']);return _0x26f28a(_0x9f4db5['error']['message']);}else{logger['info'](_0x0c44('0x1f'),_0x31ffb8,_0x0c44('0x20'));_0x26f28a(_0x9f4db5['result'][_0x0c44('0x25')]);}})[_0x0c44('0x26')](function(_0x27584f){logger[_0x0c44('0x23')](_0x0c44('0x1f'),_0x31ffb8,_0x27584f);_0x4f0cca(_0x27584f);});});}function respondWithStatusCode(_0x17c9fe,_0x292105){_0x292105=_0x292105||0xcc;return function(_0xdc865a){if(_0xdc865a){return _0x17c9fe[_0x0c44('0x27')](_0x292105);}return _0x17c9fe[_0x0c44('0x28')](_0x292105)[_0x0c44('0x29')]();};}function respondWithResult(_0x53c74f,_0x23cb0a){_0x23cb0a=_0x23cb0a||0xc8;return function(_0x376d4d){if(_0x376d4d){return _0x53c74f[_0x0c44('0x28')](_0x23cb0a)[_0x0c44('0x2a')](_0x376d4d);}};}function respondWithFilteredResult(_0x3cea78,_0x3f65db){return function(_0xf58eb8){if(_0xf58eb8){var _0x4cd6b1=typeof _0x3f65db['offset']==='undefined'&&typeof _0x3f65db['limit']==='undefined';var _0x190ef0=_0xf58eb8[_0x0c44('0x2b')];var _0x527b7c=_0x4cd6b1?0x0:_0x3f65db[_0x0c44('0x2c')];var _0xbd0dbd=_0x4cd6b1?_0xf58eb8[_0x0c44('0x2b')]:_0x3f65db[_0x0c44('0x2c')]+_0x3f65db[_0x0c44('0x2d')];var _0x4fc6cb;if(_0xbd0dbd>=_0x190ef0){_0xbd0dbd=_0x190ef0;_0x4fc6cb=0xc8;}else{_0x4fc6cb=0xce;}_0x3cea78['status'](_0x4fc6cb);return _0x3cea78[_0x0c44('0x2e')]('Content-Range',_0x527b7c+'-'+_0xbd0dbd+'/'+_0x190ef0)[_0x0c44('0x2a')](_0xf58eb8);}return null;};}function patchUpdates(_0x137ab2){return function(_0x3010c4){try{jsonpatch[_0x0c44('0x2f')](_0x3010c4,_0x137ab2,!![]);}catch(_0x4fce6d){return BPromise[_0x0c44('0x30')](_0x4fce6d);}return _0x3010c4[_0x0c44('0x31')]();};}function saveUpdates(_0x16edba,_0x500fad){return function(_0x144d54){if(_0x144d54){return _0x144d54[_0x0c44('0x32')](_0x16edba)['then'](function(_0x578f7f){return _0x578f7f;});}return null;};}function removeEntity(_0x82400d,_0x422cf0){return function(_0x492547){if(_0x492547){return _0x492547[_0x0c44('0x33')]()['then'](function(){var _0x4182b1=_0x492547[_0x0c44('0x34')]({'plain':!![]});var _0x4d52f9=_0x0c44('0x35');return db[_0x0c44('0x36')][_0x0c44('0x33')]({'where':{'type':_0x4d52f9,'resourceId':_0x4182b1['id']}})[_0x0c44('0x37')](function(){return _0x492547;});})[_0x0c44('0x37')](function(){_0x82400d['status'](0xcc)[_0x0c44('0x29')]();});}};}function handleEntityNotFound(_0x26a05c,_0x130d60){return function(_0x477976){if(!_0x477976){_0x26a05c[_0x0c44('0x27')](0x194);}return _0x477976;};}function handleError(_0x3bf9ed,_0x353de9){_0x353de9=_0x353de9||0x1f4;return function(_0x33e484){logger[_0x0c44('0x23')](_0x33e484[_0x0c44('0x38')]);if(_0x33e484[_0x0c44('0x39')]){delete _0x33e484['name'];}_0x3bf9ed['status'](_0x353de9)['send'](_0x33e484);};}exports[_0x0c44('0x3a')]=function(_0x1a894f,_0x2dff3a){var _0x587e02={},_0x219e9c={},_0x1a0241={'count':0x0,'rows':[]};var _0x4df0e0=_[_0x0c44('0x3b')](db['VoiceContext'][_0x0c44('0x3c')],function(_0x53e0ac){return{'name':_0x53e0ac[_0x0c44('0x3d')],'type':_0x53e0ac[_0x0c44('0x3e')][_0x0c44('0x3f')]};});_0x219e9c[_0x0c44('0x40')]=_[_0x0c44('0x3b')](_0x4df0e0,'name');_0x219e9c[_0x0c44('0x41')]=_[_0x0c44('0x42')](_0x1a894f[_0x0c44('0x41')]);_0x219e9c[_0x0c44('0x43')]=_[_0x0c44('0x44')](_0x219e9c['model'],_0x219e9c[_0x0c44('0x41')]);_0x587e02['attributes']=_[_0x0c44('0x44')](_0x219e9c[_0x0c44('0x40')],qs[_0x0c44('0x45')](_0x1a894f[_0x0c44('0x41')][_0x0c44('0x45')]));_0x587e02[_0x0c44('0x46')]=_0x587e02[_0x0c44('0x46')][_0x0c44('0x47')]?_0x587e02[_0x0c44('0x46')]:_0x219e9c[_0x0c44('0x40')];if(!_0x1a894f[_0x0c44('0x41')][_0x0c44('0x48')](_0x0c44('0x49'))){_0x587e02[_0x0c44('0x2d')]=qs[_0x0c44('0x2d')](_0x1a894f['query'][_0x0c44('0x2d')]);_0x587e02[_0x0c44('0x2c')]=qs['offset'](_0x1a894f['query'][_0x0c44('0x2c')]);}_0x587e02[_0x0c44('0x4a')]=qs['sort'](_0x1a894f['query']['sort']);_0x587e02[_0x0c44('0x4b')]=qs[_0x0c44('0x43')](_['pick'](_0x1a894f[_0x0c44('0x41')],_0x219e9c['filters']),_0x4df0e0);if(_0x1a894f[_0x0c44('0x41')][_0x0c44('0x4c')]){_0x587e02[_0x0c44('0x4b')]=_[_0x0c44('0x4d')](_0x587e02[_0x0c44('0x4b')],{'$or':_[_0x0c44('0x3b')](_0x4df0e0,function(_0x4b7f99){if(_0x4b7f99['type']!==_0x0c44('0x4e')){var _0x4ce352={};_0x4ce352[_0x4b7f99[_0x0c44('0x39')]]={'$like':'%'+_0x1a894f[_0x0c44('0x41')][_0x0c44('0x4c')]+'%'};return _0x4ce352;}})});}_0x587e02=_[_0x0c44('0x4d')]({},_0x587e02,_0x1a894f[_0x0c44('0x4f')]);var _0x40de5c={'where':_0x587e02[_0x0c44('0x4b')]};return db[_0x0c44('0x50')][_0x0c44('0x2b')](_0x40de5c)[_0x0c44('0x37')](function(_0x234b7f){_0x1a0241[_0x0c44('0x2b')]=_0x234b7f;if(_0x1a894f['query'][_0x0c44('0x51')]){_0x587e02['include']=[{'all':!![]}];}return db['VoiceContext']['findAll'](_0x587e02);})[_0x0c44('0x37')](function(_0x5df018){_0x1a0241[_0x0c44('0x52')]=_0x5df018;return _0x1a0241;})['then'](respondWithFilteredResult(_0x2dff3a,_0x587e02))[_0x0c44('0x26')](handleError(_0x2dff3a,null));};exports['show']=function(_0x2b8263,_0x32b4c2){var _0x39eb6c={'raw':![],'where':{'id':_0x2b8263[_0x0c44('0x53')]['id']}},_0x2c1fb8={};_0x2c1fb8['model']=_['keys'](db[_0x0c44('0x50')][_0x0c44('0x3c')]);_0x2c1fb8[_0x0c44('0x41')]=_['keys'](_0x2b8263[_0x0c44('0x41')]);_0x2c1fb8['filters']=_[_0x0c44('0x44')](_0x2c1fb8[_0x0c44('0x40')],_0x2c1fb8[_0x0c44('0x41')]);_0x39eb6c[_0x0c44('0x46')]=_[_0x0c44('0x44')](_0x2c1fb8['model'],qs[_0x0c44('0x45')](_0x2b8263['query'][_0x0c44('0x45')]));_0x39eb6c['attributes']=_0x39eb6c[_0x0c44('0x46')][_0x0c44('0x47')]?_0x39eb6c[_0x0c44('0x46')]:_0x2c1fb8[_0x0c44('0x40')];if(_0x2b8263['query'][_0x0c44('0x51')]){_0x39eb6c[_0x0c44('0x54')]=[{'all':!![]}];}_0x39eb6c=_[_0x0c44('0x4d')]({},_0x39eb6c,_0x2b8263[_0x0c44('0x4f')]);return db[_0x0c44('0x50')][_0x0c44('0x55')](_0x39eb6c)[_0x0c44('0x37')](handleEntityNotFound(_0x32b4c2,null))[_0x0c44('0x37')](respondWithResult(_0x32b4c2,null))[_0x0c44('0x26')](handleError(_0x32b4c2,null));};exports[_0x0c44('0x56')]=function(_0x5ec6f4,_0x12c3e6,_0x16d5e9){var _0x36300b;return db[_0x0c44('0x50')][_0x0c44('0x56')](_0x5ec6f4[_0x0c44('0x57')],{'raw':!![]})[_0x0c44('0x37')](function(_0x5b4dbb){_0x36300b=_0x5b4dbb;return db[_0x0c44('0x50')]['findAll']({'raw':!![]});})[_0x0c44('0x37')](function(_0x1c40e1){var _0x20f7f7=fs[_0x0c44('0x58')](path[_0x0c44('0x59')](config['root'],'server/files/templates/context.ejs'),'utf8');var _0x5109a9=ejs['render'](_0x20f7f7,{'contexts':_0x1c40e1||[]});fs[_0x0c44('0x5a')](_0x0c44('0x5b'),_0x5109a9);})[_0x0c44('0x37')](function(){return respondWithRpcPromise('Reload',_0x0c44('0x56'),{'module':_0x0c44('0x5c')});})[_0x0c44('0x37')](function(){var _0x56cee6=_0x5ec6f4[_0x0c44('0x5d')][_0x0c44('0x34')]({'plain':!![]});if(!_0x56cee6)throw new Error(_0x0c44('0x5e'));if(_0x56cee6[_0x0c44('0x5f')]==='user'){var _0xaf29fe=_0x36300b[_0x0c44('0x34')]({'plain':!![]});return db[_0x0c44('0x60')][_0x0c44('0x55')]({'where':{'name':_0x0c44('0x35'),'userProfileId':_0x56cee6[_0x0c44('0x61')]},'raw':!![]})[_0x0c44('0x37')](function(_0x23395f){if(_0x23395f&&_0x23395f[_0x0c44('0x62')]===0x0){return db['UserProfileResource'][_0x0c44('0x56')]({'name':_0xaf29fe['name'],'resourceId':_0xaf29fe['id'],'type':_0x23395f[_0x0c44('0x39')],'sectionId':_0x23395f['id']},{})['then'](function(){return _0x36300b;});}else{return _0x36300b;}})['catch'](function(_0x650a19){logger[_0x0c44('0x23')](_0x0c44('0x63'),_0x650a19);throw _0x650a19;});}return _0x36300b;})[_0x0c44('0x37')](respondWithResult(_0x12c3e6,0xc9))[_0x0c44('0x26')](handleError(_0x12c3e6,null));};exports[_0x0c44('0x32')]=function(_0x3f6ed0,_0x4c74c7,_0x57cd17){var _0x5a1e38;return db['VoiceContext'][_0x0c44('0x55')]({'where':{'id':_0x3f6ed0[_0x0c44('0x53')]['id']}})['then'](handleEntityNotFound(_0x4c74c7,null))[_0x0c44('0x37')](saveUpdates(_0x3f6ed0[_0x0c44('0x57')],null))[_0x0c44('0x37')](function(_0x4d2399){if(_0x4d2399){_0x5a1e38=_0x4d2399;return db[_0x0c44('0x50')]['findAll']({'raw':!![]});}})[_0x0c44('0x37')](function(_0x1da713){var _0x12a870=fs[_0x0c44('0x58')](path['join'](config[_0x0c44('0x64')],_0x0c44('0x65')),'utf8');var _0x38cea2=ejs[_0x0c44('0x66')](_0x12a870,{'contexts':_0x1da713||[]});fs['writeFileSync']('/etc/asterisk/extensions_xcally_contexts.conf',_0x38cea2);})[_0x0c44('0x37')](function(){return respondWithRpcPromise(_0x0c44('0x67'),_0x0c44('0x32'),{'module':_0x0c44('0x5c')});})[_0x0c44('0x37')](function(){return _0x5a1e38;})[_0x0c44('0x37')](respondWithResult(_0x4c74c7,null))[_0x0c44('0x26')](handleError(_0x4c74c7,null));};exports[_0x0c44('0x33')]=function(_0x3c231d,_0x16d9c9,_0x3d2bbe){var _0x2902cf;return db[_0x0c44('0x50')][_0x0c44('0x55')]({'where':{'id':_0x3c231d[_0x0c44('0x53')]['id']}})['then'](handleEntityNotFound(_0x16d9c9,null))[_0x0c44('0x37')](removeEntity(_0x16d9c9,null))['then'](function(){return db[_0x0c44('0x50')]['findAll']({'raw':!![]});})[_0x0c44('0x37')](function(_0x49e4e2){var _0xfbddce=fs[_0x0c44('0x58')](path[_0x0c44('0x59')](config[_0x0c44('0x64')],_0x0c44('0x65')),_0x0c44('0x68'));var _0xe9a3c1=ejs[_0x0c44('0x66')](_0xfbddce,{'contexts':_0x49e4e2});fs[_0x0c44('0x5a')](_0x0c44('0x5b'),_0xe9a3c1);return respondWithRpcPromise(_0x0c44('0x67'),_0x0c44('0x33'),{'module':_0x0c44('0x5c')});})[_0x0c44('0x26')](handleError(_0x16d9c9,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 3c06a82..2238058 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 _0x4978=['moment','request-promise','path','rimraf','define','VoiceContext','voice_contexts','util','../../config/logger','api'];(function(_0x9faff7,_0x59a564){var _0x4f8043=function(_0x5f060d){while(--_0x5f060d){_0x9faff7['push'](_0x9faff7['shift']());}};_0x4f8043(++_0x59a564);}(_0x4978,0xe3));var _0x8497=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0x4978[_0xefd519];return _0x4bb882;};'use strict';var _=require('lodash');var util=require(_0x8497('0x0'));var logger=require(_0x8497('0x1'))(_0x8497('0x2'));var moment=require(_0x8497('0x3'));var BPromise=require('bluebird');var rp=require(_0x8497('0x4'));var fs=require('fs');var path=require(_0x8497('0x5'));var rimraf=require(_0x8497('0x6'));var config=require('../../config/environment');var attributes=require('./voiceContext.attributes');module['exports']=function(_0x5e7304,_0x14b94c){return _0x5e7304[_0x8497('0x7')](_0x8497('0x8'),attributes,{'tableName':_0x8497('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1bb5=['VoiceContext','voice_contexts','util','../../config/logger','api','path','./voiceContext.attributes','define'];(function(_0x2bf5c0,_0x56b69a){var _0x115185=function(_0x3e6c29){while(--_0x3e6c29){_0x2bf5c0['push'](_0x2bf5c0['shift']());}};_0x115185(++_0x56b69a);}(_0x1bb5,0x82));var _0x51bb=function(_0x486f4a,_0x478dc7){_0x486f4a=_0x486f4a-0x0;var _0x135d99=_0x1bb5[_0x486f4a];return _0x135d99;};'use strict';var _=require('lodash');var util=require(_0x51bb('0x0'));var logger=require(_0x51bb('0x1'))(_0x51bb('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x51bb('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x51bb('0x4'));module['exports']=function(_0x118704,_0x12b8c6){return _0x118704[_0x51bb('0x5')](_0x51bb('0x6'),attributes,{'tableName':_0x51bb('0x7'),'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 7999d54..dc873b0 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 _0x5630=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x1611b4,_0x556188){var _0x30e81d=function(_0x4a21e0){while(--_0x4a21e0){_0x1611b4['push'](_0x1611b4['shift']());}};_0x30e81d(++_0x556188);}(_0x5630,0xc3));var _0x0563=function(_0xb1737a,_0x12d7d4){_0xb1737a=_0xb1737a-0x0;var _0x4469d4=_0x5630[_0xb1737a];return _0x4469d4;};'use strict';var _=require(_0x0563('0x0'));var util=require(_0x0563('0x1'));var moment=require(_0x0563('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0563('0x3'))['db'];var utils=require(_0x0563('0x4'));var logger=require(_0x0563('0x5'))(_0x0563('0x6'));var config=require(_0x0563('0x7'));var jayson=require(_0x0563('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3661bb,_0x32180f,_0x31159c){return new BPromise(function(_0x85e3ed,_0x521fb7){return client[_0x0563('0x9')](_0x3661bb,_0x31159c)[_0x0563('0xa')](function(_0x6746b7){logger[_0x0563('0xb')](_0x0563('0xc'),_0x32180f,_0x0563('0xd'));logger[_0x0563('0xe')](_0x0563('0xf'),_0x32180f,'request\x20sent',JSON[_0x0563('0x10')](_0x6746b7));if(_0x6746b7[_0x0563('0x11')]){if(_0x6746b7[_0x0563('0x11')][_0x0563('0x12')]===0x1f4){logger[_0x0563('0x11')](_0x0563('0xc'),_0x32180f,_0x6746b7[_0x0563('0x11')][_0x0563('0x13')]);return _0x521fb7(_0x6746b7[_0x0563('0x11')][_0x0563('0x13')]);}logger[_0x0563('0x11')](_0x0563('0xc'),_0x32180f,_0x6746b7['error'][_0x0563('0x13')]);return _0x85e3ed(_0x6746b7[_0x0563('0x11')][_0x0563('0x13')]);}else{logger[_0x0563('0xb')]('VoiceContext,\x20%s,\x20%s',_0x32180f,'request\x20sent');_0x85e3ed(_0x6746b7[_0x0563('0x14')]['message']);}})[_0x0563('0x15')](function(_0x1746e4){logger['error'](_0x0563('0xc'),_0x32180f,_0x1746e4);_0x521fb7(_0x1746e4);});});} \ No newline at end of file +var _0x87a2=['../../config/utils','../../config/logger','rpc','http','then','info','request\x20sent','debug','stringify','code','error','VoiceContext,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x25e947,_0x5ef1a5){var _0x25184=function(_0xa32a2a){while(--_0xa32a2a){_0x25e947['push'](_0x25e947['shift']());}};_0x25184(++_0x5ef1a5);}(_0x87a2,0x14a));var _0x287a=function(_0xa98302,_0x844f27){_0xa98302=_0xa98302-0x0;var _0x1ad8e3=_0x87a2[_0xa98302];return _0x1ad8e3;};'use strict';var _=require(_0x287a('0x0'));var util=require(_0x287a('0x1'));var moment=require(_0x287a('0x2'));var BPromise=require('bluebird');var rs=require(_0x287a('0x3'));var fs=require('fs');var Redis=require(_0x287a('0x4'));var db=require(_0x287a('0x5'))['db'];var utils=require(_0x287a('0x6'));var logger=require(_0x287a('0x7'))(_0x287a('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x287a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x24d941,_0x268463,_0x1a7bc5){return new BPromise(function(_0x4e1235,_0x585723){return client['request'](_0x24d941,_0x1a7bc5)[_0x287a('0xa')](function(_0x225cc0){logger[_0x287a('0xb')]('VoiceContext,\x20%s,\x20%s',_0x268463,_0x287a('0xc'));logger[_0x287a('0xd')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x268463,_0x287a('0xc'),JSON[_0x287a('0xe')](_0x225cc0));if(_0x225cc0['error']){if(_0x225cc0['error'][_0x287a('0xf')]===0x1f4){logger[_0x287a('0x10')](_0x287a('0x11'),_0x268463,_0x225cc0['error']['message']);return _0x585723(_0x225cc0['error'][_0x287a('0x12')]);}logger[_0x287a('0x10')](_0x287a('0x11'),_0x268463,_0x225cc0[_0x287a('0x10')]['message']);return _0x4e1235(_0x225cc0[_0x287a('0x10')][_0x287a('0x12')]);}else{logger[_0x287a('0xb')](_0x287a('0x11'),_0x268463,_0x287a('0xc'));_0x4e1235(_0x225cc0[_0x287a('0x13')]['message']);}})[_0x287a('0x14')](function(_0x3aa35f){logger[_0x287a('0x10')](_0x287a('0x11'),_0x268463,_0x3aa35f);_0x585723(_0x3aa35f);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index fec655a..d6e8f2e 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 _0x89c4=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','isAuthenticated','/describe','describe','post','create','put','/:id','update','delete','exports','multer','util','connect-timeout'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0x89c4,0x82));var _0x489c=function(_0x4c994b,_0x1694fc){_0x4c994b=_0x4c994b-0x0;var _0x5b2b16=_0x89c4[_0x4c994b];return _0x5b2b16;};'use strict';var multer=require(_0x489c('0x0'));var util=require(_0x489c('0x1'));var path=require('path');var timeout=require(_0x489c('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x489c('0x3'));var auth=require(_0x489c('0x4'));var interaction=require(_0x489c('0x5'));var config=require(_0x489c('0x6'));var controller=require(_0x489c('0x7'));router[_0x489c('0x8')]('/',auth[_0x489c('0x9')](),controller['index']);router[_0x489c('0x8')](_0x489c('0xa'),auth[_0x489c('0x9')](),controller[_0x489c('0xb')]);router['get']('/:id',auth[_0x489c('0x9')](),controller['show']);router[_0x489c('0xc')]('/',auth[_0x489c('0x9')](),controller[_0x489c('0xd')]);router[_0x489c('0xe')](_0x489c('0xf'),auth[_0x489c('0x9')](),controller[_0x489c('0x10')]);router[_0x489c('0x11')]('/:id',auth[_0x489c('0x9')](),controller['destroy']);module[_0x489c('0x12')]=router; \ No newline at end of file +var _0x7216=['/describe','describe','/:id','show','post','create','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceDialReport.controller','get','isAuthenticated','index'];(function(_0x56a602,_0x11e8ed){var _0x2e9df3=function(_0xb9c0f2){while(--_0xb9c0f2){_0x56a602['push'](_0x56a602['shift']());}};_0x2e9df3(++_0x11e8ed);}(_0x7216,0xa3));var _0x6721=function(_0x4777d2,_0x13ddef){_0x4777d2=_0x4777d2-0x0;var _0x41195c=_0x7216[_0x4777d2];return _0x41195c;};'use strict';var multer=require(_0x6721('0x0'));var util=require(_0x6721('0x1'));var path=require(_0x6721('0x2'));var timeout=require(_0x6721('0x3'));var express=require(_0x6721('0x4'));var router=express[_0x6721('0x5')]();var fs_extra=require(_0x6721('0x6'));var auth=require(_0x6721('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x6721('0x8'));var controller=require(_0x6721('0x9'));router[_0x6721('0xa')]('/',auth[_0x6721('0xb')](),controller[_0x6721('0xc')]);router['get'](_0x6721('0xd'),auth['isAuthenticated'](),controller[_0x6721('0xe')]);router['get'](_0x6721('0xf'),auth[_0x6721('0xb')](),controller[_0x6721('0x10')]);router[_0x6721('0x11')]('/',auth['isAuthenticated'](),controller[_0x6721('0x12')]);router['put'](_0x6721('0xf'),auth['isAuthenticated'](),controller['update']);router[_0x6721('0x13')](_0x6721('0xf'),auth[_0x6721('0xb')](),controller[_0x6721('0x14')]);module[_0x6721('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index 62e69c3..00965c9 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 _0x008c=['INTEGER','DATE','sequelize','exports','STRING'];(function(_0x999542,_0x56e283){var _0x384d9b=function(_0x28d08b){while(--_0x28d08b){_0x999542['push'](_0x999542['shift']());}};_0x384d9b(++_0x56e283);}(_0x008c,0x188));var _0xc008=function(_0x32b312,_0x4e3f0f){_0x32b312=_0x32b312-0x0;var _0x313368=_0x008c[_0x32b312];return _0x313368;};'use strict';var Sequelize=require(_0xc008('0x0'));module[_0xc008('0x1')]={'privilege':{'type':Sequelize[_0xc008('0x2')]},'channel':{'type':Sequelize[_0xc008('0x2')]},'channelstate':{'type':Sequelize[_0xc008('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xc008('0x2')]},'calleridname':{'type':Sequelize[_0xc008('0x2')]},'connectedlinenum':{'type':Sequelize[_0xc008('0x2')]},'connectedlinename':{'type':Sequelize[_0xc008('0x2')]},'language':{'type':Sequelize[_0xc008('0x2')]},'accountcode':{'type':Sequelize[_0xc008('0x2')]},'context':{'type':Sequelize[_0xc008('0x2')]},'exten':{'type':Sequelize[_0xc008('0x2')]},'priority':{'type':Sequelize[_0xc008('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xc008('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xc008('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0xc008('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xc008('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0xc008('0x2')]},'destexten':{'type':Sequelize[_0xc008('0x2')]},'destpriority':{'type':Sequelize['INTEGER']},'destuniqueid':{'type':Sequelize[_0xc008('0x2')]},'destlinkedid':{'type':Sequelize[_0xc008('0x2')]},'dialstring':{'type':Sequelize[_0xc008('0x2')]},'dialstatus':{'type':Sequelize[_0xc008('0x2')]},'starttime':{'type':Sequelize[_0xc008('0x4')]},'answertime':{'type':Sequelize[_0xc008('0x4')]},'endtime':{'type':Sequelize[_0xc008('0x4')]},'lastevent':{'type':Sequelize['STRING'],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0xc008('0x3')]},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize[_0xc008('0x3')]},'billableseconds':{'type':Sequelize[_0xc008('0x3')]}}; \ No newline at end of file +var _0x3e74=['DATE','sequelize','STRING','INTEGER'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x3e74,0x175));var _0x43e7=function(_0x1b9307,_0x2d78f0){_0x1b9307=_0x1b9307-0x0;var _0x1b903b=_0x3e74[_0x1b9307];return _0x1b903b;};'use strict';var Sequelize=require(_0x43e7('0x0'));module['exports']={'privilege':{'type':Sequelize[_0x43e7('0x1')]},'channel':{'type':Sequelize[_0x43e7('0x1')]},'channelstate':{'type':Sequelize[_0x43e7('0x2')]},'channelstatedesc':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x43e7('0x1')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x43e7('0x1')]},'language':{'type':Sequelize[_0x43e7('0x1')]},'accountcode':{'type':Sequelize[_0x43e7('0x1')]},'context':{'type':Sequelize[_0x43e7('0x1')]},'exten':{'type':Sequelize[_0x43e7('0x1')]},'priority':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x43e7('0x1')]},'linkedid':{'type':Sequelize[_0x43e7('0x1')]},'destchannel':{'type':Sequelize[_0x43e7('0x1')]},'destchannelstate':{'type':Sequelize[_0x43e7('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x43e7('0x1')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x43e7('0x1')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x43e7('0x1')]},'destaccountcode':{'type':Sequelize[_0x43e7('0x1')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x43e7('0x1')]},'destpriority':{'type':Sequelize['INTEGER']},'destuniqueid':{'type':Sequelize[_0x43e7('0x1')]},'destlinkedid':{'type':Sequelize[_0x43e7('0x1')]},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize[_0x43e7('0x1')]},'starttime':{'type':Sequelize[_0x43e7('0x3')]},'answertime':{'type':Sequelize[_0x43e7('0x3')]},'endtime':{'type':Sequelize[_0x43e7('0x3')]},'lastevent':{'type':Sequelize['STRING'],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0x43e7('0x2')]},'duration':{'type':Sequelize[_0x43e7('0x2')]},'holdtime':{'type':Sequelize[_0x43e7('0x2')]},'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 4569b94..910bca0 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 _0x06a8=['create','body','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','error','stack','name','index','map','rawAttributes','type','model','query','keys','attributes','fields','length','sort','where','filters','pick','filter','merge','VIRTUAL','options','VoiceDialReport','includeAll','include','findAll','rows','show','params','intersection','find','catch'];(function(_0x551be4,_0x19bfe3){var _0x46e805=function(_0xb23a16){while(--_0xb23a16){_0x551be4['push'](_0x551be4['shift']());}};_0x46e805(++_0x19bfe3);}(_0x06a8,0x1f4));var _0x806a=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x06a8[_0x4a9fb1];return _0x348672;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x806a('0x0'));var zipdir=require(_0x806a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x806a('0x2'));var moment=require(_0x806a('0x3'));var BPromise=require(_0x806a('0x4'));var Mustache=require(_0x806a('0x5'));var util=require(_0x806a('0x6'));var path=require(_0x806a('0x7'));var sox=require(_0x806a('0x8'));var csv=require(_0x806a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x806a('0xa'));var _=require(_0x806a('0xb'));var squel=require(_0x806a('0xc'));var crypto=require('crypto');var jsforce=require(_0x806a('0xd'));var deskjs=require(_0x806a('0xe'));var toCsv=require(_0x806a('0x9'));var querystring=require(_0x806a('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x806a('0x10'));var qs=require(_0x806a('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x806a('0x12'));var logger=require(_0x806a('0x13'))('api');var utils=require(_0x806a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x806a('0x15'));var db=require(_0x806a('0x16'))['db'];function respondWithStatusCode(_0x3b2fcb,_0x31a580){_0x31a580=_0x31a580||0xcc;return function(_0x34229c){if(_0x34229c){return _0x3b2fcb[_0x806a('0x17')](_0x31a580);}return _0x3b2fcb[_0x806a('0x18')](_0x31a580)[_0x806a('0x19')]();};}function respondWithResult(_0x74c00c,_0x1512be){_0x1512be=_0x1512be||0xc8;return function(_0x40c473){if(_0x40c473){return _0x74c00c[_0x806a('0x18')](_0x1512be)[_0x806a('0x1a')](_0x40c473);}};}function respondWithFilteredResult(_0x3e3531,_0x552534){return function(_0x198325){if(_0x198325){var _0x5e8c5d=typeof _0x552534[_0x806a('0x1b')]===_0x806a('0x1c')&&typeof _0x552534[_0x806a('0x1d')]===_0x806a('0x1c');var _0x1a60f6=_0x198325[_0x806a('0x1e')];var _0x1532b8=_0x5e8c5d?0x0:_0x552534[_0x806a('0x1b')];var _0x428dbd=_0x5e8c5d?_0x198325[_0x806a('0x1e')]:_0x552534[_0x806a('0x1b')]+_0x552534[_0x806a('0x1d')];var _0x3467a1;if(_0x428dbd>=_0x1a60f6){_0x428dbd=_0x1a60f6;_0x3467a1=0xc8;}else{_0x3467a1=0xce;}_0x3e3531[_0x806a('0x18')](_0x3467a1);return _0x3e3531[_0x806a('0x1f')](_0x806a('0x20'),_0x1532b8+'-'+_0x428dbd+'/'+_0x1a60f6)[_0x806a('0x1a')](_0x198325);}return null;};}function patchUpdates(_0x56042a){return function(_0x1b3f3d){try{jsonpatch[_0x806a('0x21')](_0x1b3f3d,_0x56042a,!![]);}catch(_0x56a677){return BPromise['reject'](_0x56a677);}return _0x1b3f3d[_0x806a('0x22')]();};}function saveUpdates(_0x2ca8b9,_0x2af342){return function(_0x1f1e5d){if(_0x1f1e5d){return _0x1f1e5d[_0x806a('0x23')](_0x2ca8b9)[_0x806a('0x24')](function(_0x4877be){return _0x4877be;});}return null;};}function removeEntity(_0x3b5cf6,_0xb3d16){return function(_0x18366f){if(_0x18366f){return _0x18366f['destroy']()[_0x806a('0x24')](function(){_0x3b5cf6[_0x806a('0x18')](0xcc)[_0x806a('0x19')]();});}};}function handleEntityNotFound(_0x22f8e3,_0x378f69){return function(_0x30bea4){if(!_0x30bea4){_0x22f8e3[_0x806a('0x17')](0x194);}return _0x30bea4;};}function handleError(_0x56f982,_0xd00619){_0xd00619=_0xd00619||0x1f4;return function(_0x71ad71){logger[_0x806a('0x25')](_0x71ad71[_0x806a('0x26')]);if(_0x71ad71[_0x806a('0x27')]){delete _0x71ad71[_0x806a('0x27')];}_0x56f982[_0x806a('0x18')](_0xd00619)['send'](_0x71ad71);};}exports[_0x806a('0x28')]=function(_0x3faf81,_0x4898b7){var _0x4a4994={},_0x5bff35={},_0x5859ba={'count':0x0,'rows':[]};var _0x497c78=_[_0x806a('0x29')](db['VoiceDialReport'][_0x806a('0x2a')],function(_0x1f6670){return{'name':_0x1f6670['fieldName'],'type':_0x1f6670[_0x806a('0x2b')]['key']};});_0x5bff35[_0x806a('0x2c')]=_[_0x806a('0x29')](_0x497c78,_0x806a('0x27'));_0x5bff35[_0x806a('0x2d')]=_[_0x806a('0x2e')](_0x3faf81[_0x806a('0x2d')]);_0x5bff35['filters']=_['intersection'](_0x5bff35['model'],_0x5bff35[_0x806a('0x2d')]);_0x4a4994[_0x806a('0x2f')]=_['intersection'](_0x5bff35[_0x806a('0x2c')],qs[_0x806a('0x30')](_0x3faf81['query'][_0x806a('0x30')]));_0x4a4994['attributes']=_0x4a4994[_0x806a('0x2f')][_0x806a('0x31')]?_0x4a4994['attributes']:_0x5bff35[_0x806a('0x2c')];if(!_0x3faf81[_0x806a('0x2d')]['hasOwnProperty']('nolimit')){_0x4a4994['limit']=qs[_0x806a('0x1d')](_0x3faf81['query'][_0x806a('0x1d')]);_0x4a4994[_0x806a('0x1b')]=qs[_0x806a('0x1b')](_0x3faf81[_0x806a('0x2d')][_0x806a('0x1b')]);}_0x4a4994['order']=qs[_0x806a('0x32')](_0x3faf81[_0x806a('0x2d')][_0x806a('0x32')]);_0x4a4994[_0x806a('0x33')]=qs[_0x806a('0x34')](_[_0x806a('0x35')](_0x3faf81['query'],_0x5bff35[_0x806a('0x34')]),_0x497c78);if(_0x3faf81[_0x806a('0x2d')][_0x806a('0x36')]){_0x4a4994['where']=_[_0x806a('0x37')](_0x4a4994[_0x806a('0x33')],{'$or':_[_0x806a('0x29')](_0x497c78,function(_0x21bad7){if(_0x21bad7[_0x806a('0x2b')]!==_0x806a('0x38')){var _0x4110b0={};_0x4110b0[_0x21bad7['name']]={'$like':'%'+_0x3faf81[_0x806a('0x2d')][_0x806a('0x36')]+'%'};return _0x4110b0;}})});}_0x4a4994=_[_0x806a('0x37')]({},_0x4a4994,_0x3faf81[_0x806a('0x39')]);var _0x4ea84e={'where':_0x4a4994[_0x806a('0x33')]};return db[_0x806a('0x3a')][_0x806a('0x1e')](_0x4ea84e)['then'](function(_0x32e35a){_0x5859ba['count']=_0x32e35a;if(_0x3faf81[_0x806a('0x2d')][_0x806a('0x3b')]){_0x4a4994[_0x806a('0x3c')]=[{'all':!![]}];}return db[_0x806a('0x3a')][_0x806a('0x3d')](_0x4a4994);})[_0x806a('0x24')](function(_0x57ec53){_0x5859ba[_0x806a('0x3e')]=_0x57ec53;return _0x5859ba;})[_0x806a('0x24')](respondWithFilteredResult(_0x4898b7,_0x4a4994))['catch'](handleError(_0x4898b7,null));};exports[_0x806a('0x3f')]=function(_0x354eb8,_0x4798cf){var _0x58205c={'raw':!![],'where':{'id':_0x354eb8[_0x806a('0x40')]['id']}},_0x1928c0={};_0x1928c0[_0x806a('0x2c')]=_[_0x806a('0x2e')](db[_0x806a('0x3a')][_0x806a('0x2a')]);_0x1928c0[_0x806a('0x2d')]=_['keys'](_0x354eb8[_0x806a('0x2d')]);_0x1928c0[_0x806a('0x34')]=_[_0x806a('0x41')](_0x1928c0[_0x806a('0x2c')],_0x1928c0['query']);_0x58205c[_0x806a('0x2f')]=_[_0x806a('0x41')](_0x1928c0[_0x806a('0x2c')],qs[_0x806a('0x30')](_0x354eb8[_0x806a('0x2d')][_0x806a('0x30')]));_0x58205c['attributes']=_0x58205c[_0x806a('0x2f')]['length']?_0x58205c['attributes']:_0x1928c0['model'];if(_0x354eb8[_0x806a('0x2d')]['includeAll']){_0x58205c['include']=[{'all':!![]}];}_0x58205c=_['merge']({},_0x58205c,_0x354eb8['options']);return db[_0x806a('0x3a')][_0x806a('0x42')](_0x58205c)['then'](handleEntityNotFound(_0x4798cf,null))[_0x806a('0x24')](respondWithResult(_0x4798cf,null))[_0x806a('0x43')](handleError(_0x4798cf,null));};exports[_0x806a('0x44')]=function(_0x264a44,_0x5f2bf0){return db[_0x806a('0x3a')]['create'](_0x264a44[_0x806a('0x45')],{})['then'](respondWithResult(_0x5f2bf0,0xc9))[_0x806a('0x43')](handleError(_0x5f2bf0,null));};exports['update']=function(_0x808a01,_0x10da72){if(_0x808a01[_0x806a('0x45')]['id']){delete _0x808a01[_0x806a('0x45')]['id'];}return db[_0x806a('0x3a')][_0x806a('0x42')]({'where':{'id':_0x808a01[_0x806a('0x40')]['id']}})[_0x806a('0x24')](handleEntityNotFound(_0x10da72,null))[_0x806a('0x24')](saveUpdates(_0x808a01[_0x806a('0x45')],null))[_0x806a('0x24')](respondWithResult(_0x10da72,null))[_0x806a('0x43')](handleError(_0x10da72,null));};exports['destroy']=function(_0x3ee284,_0x24a589){return db['VoiceDialReport'][_0x806a('0x42')]({'where':{'id':_0x3ee284[_0x806a('0x40')]['id']}})['then'](handleEntityNotFound(_0x24a589,null))['then'](removeEntity(_0x24a589,null))[_0x806a('0x43')](handleError(_0x24a589,null));};exports[_0x806a('0x46')]=function(_0x387f25,_0x37250d){return db[_0x806a('0x3a')][_0x806a('0x46')]()[_0x806a('0x24')](respondWithResult(_0x37250d,null))[_0x806a('0x43')](handleError(_0x37250d,null));}; \ No newline at end of file +var _0xd7ff=['type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','length','find','create','body','update','params','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','then','destroy','error','stack','send','index','map','VoiceDialReport','rawAttributes','key','name','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','pick','filter'];(function(_0x3c68ac,_0x38b406){var _0x35d849=function(_0x1fb2e0){while(--_0x1fb2e0){_0x3c68ac['push'](_0x3c68ac['shift']());}};_0x35d849(++_0x38b406);}(_0xd7ff,0xee));var _0xfd7f=function(_0x584886,_0x4828ec){_0x584886=_0x584886-0x0;var _0x41e334=_0xd7ff[_0x584886];return _0x41e334;};'use strict';var emlformat=require(_0xfd7f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfd7f('0x1'));var jsonpatch=require(_0xfd7f('0x2'));var rp=require('request-promise');var moment=require(_0xfd7f('0x3'));var BPromise=require(_0xfd7f('0x4'));var Mustache=require(_0xfd7f('0x5'));var util=require(_0xfd7f('0x6'));var path=require(_0xfd7f('0x7'));var sox=require(_0xfd7f('0x8'));var csv=require('to-csv');var ejs=require(_0xfd7f('0x9'));var fs=require('fs');var fs_extra=require(_0xfd7f('0xa'));var _=require(_0xfd7f('0xb'));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(_0xfd7f('0xc'));var Papa=require(_0xfd7f('0xd'));var Redis=require(_0xfd7f('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xfd7f('0xf'));var as=require(_0xfd7f('0x10'));var hardwareService=require(_0xfd7f('0x11'));var logger=require(_0xfd7f('0x12'))('api');var utils=require(_0xfd7f('0x13'));var config=require(_0xfd7f('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xfd7f('0x15'))['db'];function respondWithStatusCode(_0x4a962d,_0x3dc064){_0x3dc064=_0x3dc064||0xcc;return function(_0xb7437d){if(_0xb7437d){return _0x4a962d[_0xfd7f('0x16')](_0x3dc064);}return _0x4a962d[_0xfd7f('0x17')](_0x3dc064)[_0xfd7f('0x18')]();};}function respondWithResult(_0x388172,_0x591c81){_0x591c81=_0x591c81||0xc8;return function(_0x21e2e9){if(_0x21e2e9){return _0x388172[_0xfd7f('0x17')](_0x591c81)[_0xfd7f('0x19')](_0x21e2e9);}};}function respondWithFilteredResult(_0x59ae7a,_0x3f8ba5){return function(_0x480bcd){if(_0x480bcd){var _0x5e5803=typeof _0x3f8ba5[_0xfd7f('0x1a')]==='undefined'&&typeof _0x3f8ba5[_0xfd7f('0x1b')]===_0xfd7f('0x1c');var _0xd2e35e=_0x480bcd[_0xfd7f('0x1d')];var _0x46b329=_0x5e5803?0x0:_0x3f8ba5[_0xfd7f('0x1a')];var _0x1b6201=_0x5e5803?_0x480bcd[_0xfd7f('0x1d')]:_0x3f8ba5[_0xfd7f('0x1a')]+_0x3f8ba5[_0xfd7f('0x1b')];var _0x295aac;if(_0x1b6201>=_0xd2e35e){_0x1b6201=_0xd2e35e;_0x295aac=0xc8;}else{_0x295aac=0xce;}_0x59ae7a[_0xfd7f('0x17')](_0x295aac);return _0x59ae7a[_0xfd7f('0x1e')]('Content-Range',_0x46b329+'-'+_0x1b6201+'/'+_0xd2e35e)[_0xfd7f('0x19')](_0x480bcd);}return null;};}function patchUpdates(_0x2d555a){return function(_0x11f791){try{jsonpatch[_0xfd7f('0x1f')](_0x11f791,_0x2d555a,!![]);}catch(_0x30afa6){return BPromise[_0xfd7f('0x20')](_0x30afa6);}return _0x11f791[_0xfd7f('0x21')]();};}function saveUpdates(_0xfa8b0c,_0x229db2){return function(_0x1ba93a){if(_0x1ba93a){return _0x1ba93a['update'](_0xfa8b0c)[_0xfd7f('0x22')](function(_0x113bba){return _0x113bba;});}return null;};}function removeEntity(_0x25f687,_0x2078dc){return function(_0x53f16e){if(_0x53f16e){return _0x53f16e[_0xfd7f('0x23')]()[_0xfd7f('0x22')](function(){_0x25f687[_0xfd7f('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4da99b,_0x422f5e){return function(_0x17c290){if(!_0x17c290){_0x4da99b[_0xfd7f('0x16')](0x194);}return _0x17c290;};}function handleError(_0x5ca371,_0x61aab3){_0x61aab3=_0x61aab3||0x1f4;return function(_0x1e57df){logger[_0xfd7f('0x24')](_0x1e57df[_0xfd7f('0x25')]);if(_0x1e57df['name']){delete _0x1e57df['name'];}_0x5ca371['status'](_0x61aab3)[_0xfd7f('0x26')](_0x1e57df);};}exports[_0xfd7f('0x27')]=function(_0x9ffe40,_0x2fb7bd){var _0x4b35d5={},_0x43cccb={},_0x364365={'count':0x0,'rows':[]};var _0x23d484=_[_0xfd7f('0x28')](db[_0xfd7f('0x29')][_0xfd7f('0x2a')],function(_0x54373c){return{'name':_0x54373c['fieldName'],'type':_0x54373c['type'][_0xfd7f('0x2b')]};});_0x43cccb['model']=_[_0xfd7f('0x28')](_0x23d484,_0xfd7f('0x2c'));_0x43cccb[_0xfd7f('0x2d')]=_[_0xfd7f('0x2e')](_0x9ffe40[_0xfd7f('0x2d')]);_0x43cccb[_0xfd7f('0x2f')]=_[_0xfd7f('0x30')](_0x43cccb[_0xfd7f('0x31')],_0x43cccb['query']);_0x4b35d5[_0xfd7f('0x32')]=_[_0xfd7f('0x30')](_0x43cccb['model'],qs[_0xfd7f('0x33')](_0x9ffe40[_0xfd7f('0x2d')]['fields']));_0x4b35d5[_0xfd7f('0x32')]=_0x4b35d5[_0xfd7f('0x32')]['length']?_0x4b35d5[_0xfd7f('0x32')]:_0x43cccb[_0xfd7f('0x31')];if(!_0x9ffe40['query'][_0xfd7f('0x34')]('nolimit')){_0x4b35d5[_0xfd7f('0x1b')]=qs[_0xfd7f('0x1b')](_0x9ffe40['query'][_0xfd7f('0x1b')]);_0x4b35d5['offset']=qs['offset'](_0x9ffe40[_0xfd7f('0x2d')][_0xfd7f('0x1a')]);}_0x4b35d5[_0xfd7f('0x35')]=qs[_0xfd7f('0x36')](_0x9ffe40[_0xfd7f('0x2d')]['sort']);_0x4b35d5[_0xfd7f('0x37')]=qs[_0xfd7f('0x2f')](_[_0xfd7f('0x38')](_0x9ffe40['query'],_0x43cccb['filters']),_0x23d484);if(_0x9ffe40[_0xfd7f('0x2d')][_0xfd7f('0x39')]){_0x4b35d5[_0xfd7f('0x37')]=_['merge'](_0x4b35d5[_0xfd7f('0x37')],{'$or':_['map'](_0x23d484,function(_0x4b870d){if(_0x4b870d[_0xfd7f('0x3a')]!==_0xfd7f('0x3b')){var _0x431588={};_0x431588[_0x4b870d['name']]={'$like':'%'+_0x9ffe40['query']['filter']+'%'};return _0x431588;}})});}_0x4b35d5=_[_0xfd7f('0x3c')]({},_0x4b35d5,_0x9ffe40[_0xfd7f('0x3d')]);var _0x594e22={'where':_0x4b35d5[_0xfd7f('0x37')]};return db[_0xfd7f('0x29')][_0xfd7f('0x1d')](_0x594e22)[_0xfd7f('0x22')](function(_0x3292f0){_0x364365[_0xfd7f('0x1d')]=_0x3292f0;if(_0x9ffe40['query'][_0xfd7f('0x3e')]){_0x4b35d5[_0xfd7f('0x3f')]=[{'all':!![]}];}return db[_0xfd7f('0x29')][_0xfd7f('0x40')](_0x4b35d5);})[_0xfd7f('0x22')](function(_0x1b9855){_0x364365[_0xfd7f('0x41')]=_0x1b9855;return _0x364365;})[_0xfd7f('0x22')](respondWithFilteredResult(_0x2fb7bd,_0x4b35d5))[_0xfd7f('0x42')](handleError(_0x2fb7bd,null));};exports['show']=function(_0xda0c7b,_0x196ab0){var _0x34f3db={'raw':!![],'where':{'id':_0xda0c7b['params']['id']}},_0x37823f={};_0x37823f[_0xfd7f('0x31')]=_[_0xfd7f('0x2e')](db[_0xfd7f('0x29')][_0xfd7f('0x2a')]);_0x37823f[_0xfd7f('0x2d')]=_['keys'](_0xda0c7b[_0xfd7f('0x2d')]);_0x37823f[_0xfd7f('0x2f')]=_[_0xfd7f('0x30')](_0x37823f[_0xfd7f('0x31')],_0x37823f[_0xfd7f('0x2d')]);_0x34f3db[_0xfd7f('0x32')]=_['intersection'](_0x37823f[_0xfd7f('0x31')],qs[_0xfd7f('0x33')](_0xda0c7b[_0xfd7f('0x2d')]['fields']));_0x34f3db[_0xfd7f('0x32')]=_0x34f3db[_0xfd7f('0x32')][_0xfd7f('0x43')]?_0x34f3db[_0xfd7f('0x32')]:_0x37823f[_0xfd7f('0x31')];if(_0xda0c7b[_0xfd7f('0x2d')][_0xfd7f('0x3e')]){_0x34f3db[_0xfd7f('0x3f')]=[{'all':!![]}];}_0x34f3db=_[_0xfd7f('0x3c')]({},_0x34f3db,_0xda0c7b['options']);return db[_0xfd7f('0x29')][_0xfd7f('0x44')](_0x34f3db)[_0xfd7f('0x22')](handleEntityNotFound(_0x196ab0,null))['then'](respondWithResult(_0x196ab0,null))[_0xfd7f('0x42')](handleError(_0x196ab0,null));};exports[_0xfd7f('0x45')]=function(_0x422e11,_0x51baf0){return db[_0xfd7f('0x29')][_0xfd7f('0x45')](_0x422e11[_0xfd7f('0x46')],{})[_0xfd7f('0x22')](respondWithResult(_0x51baf0,0xc9))[_0xfd7f('0x42')](handleError(_0x51baf0,null));};exports[_0xfd7f('0x47')]=function(_0x377717,_0x2c86de){if(_0x377717[_0xfd7f('0x46')]['id']){delete _0x377717[_0xfd7f('0x46')]['id'];}return db[_0xfd7f('0x29')][_0xfd7f('0x44')]({'where':{'id':_0x377717[_0xfd7f('0x48')]['id']}})[_0xfd7f('0x22')](handleEntityNotFound(_0x2c86de,null))[_0xfd7f('0x22')](saveUpdates(_0x377717[_0xfd7f('0x46')],null))[_0xfd7f('0x22')](respondWithResult(_0x2c86de,null))['catch'](handleError(_0x2c86de,null));};exports[_0xfd7f('0x23')]=function(_0x5c2aea,_0x4f0b58){return db['VoiceDialReport'][_0xfd7f('0x44')]({'where':{'id':_0x5c2aea[_0xfd7f('0x48')]['id']}})['then'](handleEntityNotFound(_0x4f0b58,null))['then'](removeEntity(_0x4f0b58,null))[_0xfd7f('0x42')](handleError(_0x4f0b58,null));};exports['describe']=function(_0x152ea9,_0x34b406){return db[_0xfd7f('0x29')][_0xfd7f('0x49')]()[_0xfd7f('0x22')](respondWithResult(_0x34b406,null))[_0xfd7f('0x42')](handleError(_0x34b406,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index ba44455..4deb643 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 _0xdcee=['path','../../config/environment','./voiceDialReport.attributes','exports','define','VoiceDialReport','uniqueid','util','../../config/logger','moment','bluebird'];(function(_0x522dde,_0x2c80f1){var _0x5697f8=function(_0x1a9a13){while(--_0x1a9a13){_0x522dde['push'](_0x522dde['shift']());}};_0x5697f8(++_0x2c80f1);}(_0xdcee,0xb7));var _0xedce=function(_0x4b33ff,_0x34193c){_0x4b33ff=_0x4b33ff-0x0;var _0x24c2f7=_0xdcee[_0x4b33ff];return _0x24c2f7;};'use strict';var _=require('lodash');var util=require(_0xedce('0x0'));var logger=require(_0xedce('0x1'))('api');var moment=require(_0xedce('0x2'));var BPromise=require(_0xedce('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xedce('0x4'));var rimraf=require('rimraf');var config=require(_0xedce('0x5'));var attributes=require(_0xedce('0x6'));module[_0xedce('0x7')]=function(_0x2d88a1,_0x144a55){return _0x2d88a1[_0xedce('0x8')](_0xedce('0x9'),attributes,{'tableName':'report_dial','paranoid':![],'indexes':[{'fields':[_0xedce('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x196e=['path','rimraf','../../config/environment','./voiceDialReport.attributes','exports','define','report_dial','uniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x1a0d05,_0x5b4629){var _0x455f3f=function(_0x573aa4){while(--_0x573aa4){_0x1a0d05['push'](_0x1a0d05['shift']());}};_0x455f3f(++_0x5b4629);}(_0x196e,0xcc));var _0xe196=function(_0x210603,_0x4adbac){_0x210603=_0x210603-0x0;var _0x1bcb7d=_0x196e[_0x210603];return _0x1bcb7d;};'use strict';var _=require(_0xe196('0x0'));var util=require(_0xe196('0x1'));var logger=require(_0xe196('0x2'))(_0xe196('0x3'));var moment=require(_0xe196('0x4'));var BPromise=require(_0xe196('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe196('0x6'));var rimraf=require(_0xe196('0x7'));var config=require(_0xe196('0x8'));var attributes=require(_0xe196('0x9'));module[_0xe196('0xa')]=function(_0x38bb23,_0x1e464b){return _0x38bb23[_0xe196('0xb')]('VoiceDialReport',attributes,{'tableName':_0xe196('0xc'),'paranoid':![],'indexes':[{'fields':[_0xe196('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index ac1eb09..9396b6a 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 _0xcdd3=['jayson/promise','client','http','then','info','VoiceDialReport,\x20%s,\x20%s','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','create','options','raw','CreateVoiceDialReport','UpdateVoiceDialReport','VoiceDialReport','update','where','attributes','limit','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0xcdd3,0x98));var _0x3cdd=function(_0x1ff958,_0x467fb9){_0x1ff958=_0x1ff958-0x0;var _0x508d10=_0xcdd3[_0x1ff958];return _0x508d10;};'use strict';var _=require(_0x3cdd('0x0'));var util=require(_0x3cdd('0x1'));var moment=require('moment');var BPromise=require(_0x3cdd('0x2'));var rs=require(_0x3cdd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3cdd('0x4'))['db'];var utils=require(_0x3cdd('0x5'));var logger=require(_0x3cdd('0x6'))(_0x3cdd('0x7'));var config=require('../../config/environment');var jayson=require(_0x3cdd('0x8'));var client=jayson[_0x3cdd('0x9')][_0x3cdd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5bdbfc,_0x41848c,_0x47f473){return new BPromise(function(_0x11f05c,_0x2d8980){return client['request'](_0x5bdbfc,_0x47f473)[_0x3cdd('0xb')](function(_0x4ced3a){logger[_0x3cdd('0xc')](_0x3cdd('0xd'),_0x41848c,'request\x20sent');logger[_0x3cdd('0xe')](_0x3cdd('0xf'),_0x41848c,_0x3cdd('0x10'),JSON[_0x3cdd('0x11')](_0x4ced3a));if(_0x4ced3a['error']){if(_0x4ced3a[_0x3cdd('0x12')]['code']===0x1f4){logger['error'](_0x3cdd('0xd'),_0x41848c,_0x4ced3a[_0x3cdd('0x12')][_0x3cdd('0x13')]);return _0x2d8980(_0x4ced3a[_0x3cdd('0x12')]['message']);}logger[_0x3cdd('0x12')](_0x3cdd('0xd'),_0x41848c,_0x4ced3a[_0x3cdd('0x12')][_0x3cdd('0x13')]);return _0x11f05c(_0x4ced3a[_0x3cdd('0x12')]['message']);}else{logger[_0x3cdd('0xc')]('VoiceDialReport,\x20%s,\x20%s',_0x41848c,'request\x20sent');_0x11f05c(_0x4ced3a[_0x3cdd('0x14')][_0x3cdd('0x13')]);}})[_0x3cdd('0x15')](function(_0x26421a){logger[_0x3cdd('0x12')](_0x3cdd('0xd'),_0x41848c,_0x26421a);_0x2d8980(_0x26421a);});});}exports['CreateVoiceDialReport']=function(_0x1f3b8d){var _0x5cfbb3=this;return new Promise(function(_0x440f08,_0x3e9b3b){return db['VoiceDialReport'][_0x3cdd('0x16')](_0x1f3b8d['body'],{'raw':_0x1f3b8d[_0x3cdd('0x17')]?_0x1f3b8d[_0x3cdd('0x17')][_0x3cdd('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x3e8b2d){logger[_0x3cdd('0xc')](_0x3cdd('0x19'),_0x1f3b8d);logger[_0x3cdd('0xe')](_0x3cdd('0x19'),_0x1f3b8d,JSON[_0x3cdd('0x11')](_0x3e8b2d));_0x440f08(_0x3e8b2d);})[_0x3cdd('0x15')](function(_0x4dd641){logger['error']('CreateVoiceDialReport',_0x4dd641[_0x3cdd('0x13')],_0x1f3b8d);_0x3e9b3b(_0x5cfbb3[_0x3cdd('0x12')](0x1f4,_0x4dd641[_0x3cdd('0x13')]));});});};exports[_0x3cdd('0x1a')]=function(_0x17965e){var _0x3a1453=this;return new Promise(function(_0x369985,_0x545d3e){return db[_0x3cdd('0x1b')][_0x3cdd('0x1c')](_0x17965e['body'],{'raw':_0x17965e[_0x3cdd('0x17')]?_0x17965e[_0x3cdd('0x17')][_0x3cdd('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x17965e[_0x3cdd('0x17')]?_0x17965e[_0x3cdd('0x17')][_0x3cdd('0x1d')]||null:null,'attributes':_0x17965e[_0x3cdd('0x17')]?_0x17965e[_0x3cdd('0x17')][_0x3cdd('0x1e')]||null:null,'limit':_0x17965e['options']?_0x17965e[_0x3cdd('0x17')][_0x3cdd('0x1f')]||null:null})[_0x3cdd('0xb')](function(_0xa74846){logger[_0x3cdd('0xc')](_0x3cdd('0x1a'),_0x17965e);logger[_0x3cdd('0xe')]('UpdateVoiceDialReport',_0x17965e,JSON[_0x3cdd('0x11')](_0xa74846));_0x369985(_0xa74846);})[_0x3cdd('0x15')](function(_0x3fcb5b){logger[_0x3cdd('0x12')](_0x3cdd('0x1a'),_0x3fcb5b['message'],_0x17965e);_0x545d3e(_0x3a1453[_0x3cdd('0x12')](0x1f4,_0x3fcb5b[_0x3cdd('0x13')]));});});}; \ No newline at end of file +var _0xe95d=['message','request\x20sent','result','catch','CreateVoiceDialReport','create','body','options','raw','UpdateVoiceDialReport','update','where','attributes','limit','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','request','then','info','VoiceDialReport,\x20%s,\x20%s','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x8ed2fe,_0x19ca78){var _0x23a751=function(_0x412f75){while(--_0x412f75){_0x8ed2fe['push'](_0x8ed2fe['shift']());}};_0x23a751(++_0x19ca78);}(_0xe95d,0x1a1));var _0xde95=function(_0x526fb1,_0x1d0359){_0x526fb1=_0x526fb1-0x0;var _0x33582f=_0xe95d[_0x526fb1];return _0x33582f;};'use strict';var _=require(_0xde95('0x0'));var util=require('util');var moment=require(_0xde95('0x1'));var BPromise=require(_0xde95('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xde95('0x3'));var db=require(_0xde95('0x4'))['db'];var utils=require(_0xde95('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xde95('0x6'));var client=jayson[_0xde95('0x7')][_0xde95('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3c6a53,_0x534ddd,_0x38c970){return new BPromise(function(_0x3d1017,_0x4b802a){return client[_0xde95('0x9')](_0x3c6a53,_0x38c970)[_0xde95('0xa')](function(_0x167df9){logger[_0xde95('0xb')](_0xde95('0xc'),_0x534ddd,'request\x20sent');logger[_0xde95('0xd')](_0xde95('0xe'),_0x534ddd,'request\x20sent',JSON[_0xde95('0xf')](_0x167df9));if(_0x167df9['error']){if(_0x167df9['error']['code']===0x1f4){logger['error'](_0xde95('0xc'),_0x534ddd,_0x167df9[_0xde95('0x10')]['message']);return _0x4b802a(_0x167df9[_0xde95('0x10')][_0xde95('0x11')]);}logger[_0xde95('0x10')](_0xde95('0xc'),_0x534ddd,_0x167df9['error']['message']);return _0x3d1017(_0x167df9[_0xde95('0x10')]['message']);}else{logger[_0xde95('0xb')](_0xde95('0xc'),_0x534ddd,_0xde95('0x12'));_0x3d1017(_0x167df9[_0xde95('0x13')]['message']);}})[_0xde95('0x14')](function(_0xc833b){logger[_0xde95('0x10')](_0xde95('0xc'),_0x534ddd,_0xc833b);_0x4b802a(_0xc833b);});});}exports[_0xde95('0x15')]=function(_0x42abeb){var _0x53c9d4=this;return new Promise(function(_0x19ea11,_0x30ec41){return db['VoiceDialReport'][_0xde95('0x16')](_0x42abeb[_0xde95('0x17')],{'raw':_0x42abeb[_0xde95('0x18')]?_0x42abeb[_0xde95('0x18')][_0xde95('0x19')]===undefined?!![]:![]:!![]})[_0xde95('0xa')](function(_0x1c5e46){logger['info'](_0xde95('0x15'),_0x42abeb);logger[_0xde95('0xd')](_0xde95('0x15'),_0x42abeb,JSON[_0xde95('0xf')](_0x1c5e46));_0x19ea11(_0x1c5e46);})['catch'](function(_0xb2682d){logger[_0xde95('0x10')](_0xde95('0x15'),_0xb2682d[_0xde95('0x11')],_0x42abeb);_0x30ec41(_0x53c9d4[_0xde95('0x10')](0x1f4,_0xb2682d[_0xde95('0x11')]));});});};exports[_0xde95('0x1a')]=function(_0x714377){var _0x2c01d9=this;return new Promise(function(_0xc91f66,_0x4dbf7c){return db['VoiceDialReport'][_0xde95('0x1b')](_0x714377['body'],{'raw':_0x714377[_0xde95('0x18')]?_0x714377[_0xde95('0x18')][_0xde95('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x714377[_0xde95('0x18')]?_0x714377[_0xde95('0x18')][_0xde95('0x1c')]||null:null,'attributes':_0x714377[_0xde95('0x18')]?_0x714377[_0xde95('0x18')][_0xde95('0x1d')]||null:null,'limit':_0x714377[_0xde95('0x18')]?_0x714377[_0xde95('0x18')][_0xde95('0x1e')]||null:null})[_0xde95('0xa')](function(_0x2173ad){logger[_0xde95('0xb')](_0xde95('0x1a'),_0x714377);logger['debug'](_0xde95('0x1a'),_0x714377,JSON[_0xde95('0xf')](_0x2173ad));_0xc91f66(_0x2173ad);})['catch'](function(_0x5a8953){logger[_0xde95('0x10')]('UpdateVoiceDialReport',_0x5a8953[_0xde95('0x11')],_0x714377);_0x4dbf7c(_0x2c01d9[_0xde95('0x10')](0x1f4,_0x5a8953[_0xde95('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index 294b18a..ea15457 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 _0x4926=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated','/:id','show','post','/:id/applications','addApplications','put','update','delete','destroy','exports','multer','util','path'];(function(_0x5fff96,_0x49b8c8){var _0x5532bc=function(_0x283752){while(--_0x283752){_0x5fff96['push'](_0x5fff96['shift']());}};_0x5532bc(++_0x49b8c8);}(_0x4926,0x97));var _0x6492=function(_0x160248,_0x2a57e6){_0x160248=_0x160248-0x0;var _0x4e589d=_0x4926[_0x160248];return _0x4e589d;};'use strict';var multer=require(_0x6492('0x0'));var util=require(_0x6492('0x1'));var path=require(_0x6492('0x2'));var timeout=require(_0x6492('0x3'));var express=require('express');var router=express[_0x6492('0x4')]();var fs_extra=require(_0x6492('0x5'));var auth=require(_0x6492('0x6'));var interaction=require(_0x6492('0x7'));var config=require(_0x6492('0x8'));var controller=require(_0x6492('0x9'));router[_0x6492('0xa')]('/',auth[_0x6492('0xb')](),controller['index']);router['get'](_0x6492('0xc'),auth['isAuthenticated'](),controller[_0x6492('0xd')]);router[_0x6492('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x6492('0xe')](_0x6492('0xf'),auth['isAuthenticated'](),controller[_0x6492('0x10')]);router[_0x6492('0x11')](_0x6492('0xc'),auth[_0x6492('0xb')](),controller[_0x6492('0x12')]);router[_0x6492('0x13')](_0x6492('0xc'),auth[_0x6492('0xb')](),controller[_0x6492('0x14')]);module[_0x6492('0x15')]=router; \ No newline at end of file +var _0x7e8c=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceExtension.controller','get','isAuthenticated','index','create','post','/:id/applications','addApplications','put','/:id','update','destroy','util','path'];(function(_0x39d90c,_0x1b7ea0){var _0x504875=function(_0x589909){while(--_0x589909){_0x39d90c['push'](_0x39d90c['shift']());}};_0x504875(++_0x1b7ea0);}(_0x7e8c,0x1f2));var _0xc7e8=function(_0x3abf76,_0x10cae0){_0x3abf76=_0x3abf76-0x0;var _0x1133cc=_0x7e8c[_0x3abf76];return _0x1133cc;};'use strict';var multer=require('multer');var util=require(_0xc7e8('0x0'));var path=require(_0xc7e8('0x1'));var timeout=require(_0xc7e8('0x2'));var express=require(_0xc7e8('0x3'));var router=express[_0xc7e8('0x4')]();var fs_extra=require(_0xc7e8('0x5'));var auth=require(_0xc7e8('0x6'));var interaction=require(_0xc7e8('0x7'));var config=require('../../config/environment');var controller=require(_0xc7e8('0x8'));router[_0xc7e8('0x9')]('/',auth[_0xc7e8('0xa')](),controller[_0xc7e8('0xb')]);router['get']('/:id',auth[_0xc7e8('0xa')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xc7e8('0xc')]);router[_0xc7e8('0xd')](_0xc7e8('0xe'),auth[_0xc7e8('0xa')](),controller[_0xc7e8('0xf')]);router[_0xc7e8('0x10')](_0xc7e8('0x11'),auth[_0xc7e8('0xa')](),controller[_0xc7e8('0x12')]);router['delete'](_0xc7e8('0x11'),auth['isAuthenticated'](),controller[_0xc7e8('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index 5c12ee0..59e7391 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(_0x440f7a,_0x4368eb){var _0x5325e1=function(_0x1324a7){while(--_0x1324a7){_0x440f7a['push'](_0x440f7a['shift']());}};_0x5325e1(++_0x4368eb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xa9e0[_0x1ddedd];return _0xa3e1ac;};'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(){return this[_0x0a9e('0xd')](_0x0a9e('0xe'));}}}; \ No newline at end of file +var _0xcb91=['outbound','inbound-fax','outbound-fax','any','*,*,*,*','INTEGER','BOOLEAN','wav','VIRTUAL','STRING','compositeIndex','NoOp','inbound'];(function(_0x1a3212,_0x221431){var _0x53654e=function(_0x114f39){while(--_0x114f39){_0x1a3212['push'](_0x1a3212['shift']());}};_0x53654e(++_0x221431);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x38c652,_0x1ea1b7){_0x38c652=_0x38c652-0x0;var _0x218a37=_0xcb91[_0x38c652];return _0x218a37;};'use strict';var Sequelize=require('sequelize');module['exports']={'context':{'type':Sequelize[_0x1cb9('0x0')],'allowNull':![],'unique':_0x1cb9('0x1'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x1cb9('0x0')],'allowNull':![],'unique':_0x1cb9('0x1')},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':_0x1cb9('0x1')},'tag':{'type':Sequelize[_0x1cb9('0x0')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x1cb9('0x2')},'appdata':{'type':Sequelize[_0x1cb9('0x0')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM'](_0x1cb9('0x3'),_0x1cb9('0x4'),'internal',_0x1cb9('0x5'),_0x1cb9('0x6'),'system',_0x1cb9('0x7')),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x1cb9('0x8')},'IntervalId':{'type':Sequelize[_0x1cb9('0x9')]},'isApp':{'type':Sequelize[_0x1cb9('0xa')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x1cb9('0x0')],'defaultValue':null},'callerID':{'type':Sequelize[_0x1cb9('0x0')],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x1cb9('0x9')]},'recordingFormat':{'type':Sequelize[_0x1cb9('0x0')],'defaultValue':_0x1cb9('0xb')},'answer':{'type':Sequelize[_0x1cb9('0xa')],'defaultValue':!![]},'name':{'type':Sequelize[_0x1cb9('0xc')],'get':function(){return this['getDataValue']('exten');}}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index 63b5fec..ca80cfe 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 _0x1ea5=['map','VoiceExtension','rawAttributes','fieldName','key','model','query','keys','filters','fields','attributes','length','order','sort','merge','where','VIRTUAL','options','rows','show','params','intersection','includeAll','include','find','catch','destroy','create','outbound','startsWith','exten','body','concat','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','description','recordingFormat','cutdigits','mandatoryDisposition','alias','context','sequelize','transaction','Transaction','READ_COMMITTED','findOne','isApp','createRouting','findAndCountAll','cast(priority\x20as\x20unsigned)','stack','finally','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','get','InboundRoutes','inbound','OutboundRoutes','InternalRoutes','internal','filter','value','includes','type','UserProfileResource','then','error','name','send','index'];(function(_0x4c1778,_0xdbab01){var _0x5421ce=function(_0x565434){while(--_0x565434){_0x4c1778['push'](_0x4c1778['shift']());}};_0x5421ce(++_0xdbab01);}(_0x1ea5,0x1ba));var _0x51ea=function(_0x458363,_0x1675db){_0x458363=_0x458363-0x0;var _0x4d0290=_0x1ea5[_0x458363];return _0x4d0290;};'use strict';var _=require(_0x51ea('0x0'));var Redis=require(_0x51ea('0x1'));var qs=require(_0x51ea('0x2'));var logger=require(_0x51ea('0x3'))(_0x51ea('0x4'));var config=require(_0x51ea('0x5'));var db=require(_0x51ea('0x6'))['db'];config[_0x51ea('0x7')]=_[_0x51ea('0x8')](config[_0x51ea('0x7')],{'host':_0x51ea('0x9'),'port':0x18eb});var socket=require(_0x51ea('0xa'))(new Redis(config['redis']));require(_0x51ea('0xb'))[_0x51ea('0xc')](socket);function respondWithStatusCode(_0x273208,_0x7a4e6){_0x7a4e6=_0x7a4e6||0xcc;return function(_0x20e158){if(_0x20e158){return _0x273208[_0x51ea('0xd')](_0x7a4e6);}return _0x273208[_0x51ea('0xe')](_0x7a4e6)[_0x51ea('0xf')]();};}function respondWithResult(_0xd7fa37,_0x1460a8){_0x1460a8=_0x1460a8||0xc8;return function(_0x542ed3){if(_0x542ed3){return _0xd7fa37[_0x51ea('0xe')](_0x1460a8)[_0x51ea('0x10')](_0x542ed3);}};}function respondWithFilteredResult(_0x24c7cd,_0x1efcf1){return function(_0x57f391){if(_0x57f391){var _0x68cf31=typeof _0x1efcf1[_0x51ea('0x11')]===_0x51ea('0x12')&&typeof _0x1efcf1[_0x51ea('0x13')]==='undefined';var _0x7b8aab=_0x57f391['count'];var _0x4b0490=_0x68cf31?0x0:_0x1efcf1['offset'];var _0x1399e7=_0x68cf31?_0x57f391[_0x51ea('0x14')]:_0x1efcf1['offset']+_0x1efcf1['limit'];var _0xff3064;if(_0x1399e7>=_0x7b8aab){_0x1399e7=_0x7b8aab;_0xff3064=0xc8;}else{_0xff3064=0xce;}_0x24c7cd[_0x51ea('0xe')](_0xff3064);return _0x24c7cd['set'](_0x51ea('0x15'),_0x4b0490+'-'+_0x1399e7+'/'+_0x7b8aab)[_0x51ea('0x10')](_0x57f391);}return null;};}function removeEntity(_0xd2e324){return function(_0x5e9971){if(_0x5e9971){return _0x5e9971['destroy']()['then'](function(){var _0x20c235=_0x5e9971[_0x51ea('0x16')]({'plain':!![]});var _0x104d09=[{'name':_0x51ea('0x17'),'value':_0x51ea('0x18'),'ignore':![]},{'name':_0x51ea('0x19'),'value':'outbound','ignore':![]},{'name':_0x51ea('0x1a'),'value':_0x51ea('0x1b'),'ignore':![]}];var _0x5b5c8d=_(_0x104d09)[_0x51ea('0x1c')]('ignore')['map'](_0x51ea('0x1d'))[_0x51ea('0x1d')]();if(_[_0x51ea('0x1e')](_0x5b5c8d,_0x20c235['type'])){return;}var _0x430b8b=_['find'](_0x104d09,[_0x51ea('0x1d'),_0x20c235[_0x51ea('0x1f')]])['name'];return db[_0x51ea('0x20')]['destroy']({'where':{'type':_0x430b8b,'resourceId':_0x20c235['id']}})['then'](function(){return _0x5e9971;});})[_0x51ea('0x21')](function(){_0xd2e324[_0x51ea('0xe')](0xcc)['end']();});}};}function handleEntityNotFound(_0x99cb99){return function(_0xe2b0b5){if(!_0xe2b0b5){_0x99cb99[_0x51ea('0xd')](0x194);}return _0xe2b0b5;};}function handleError(_0x37d602,_0x3158e4){_0x3158e4=_0x3158e4||0x1f4;return function(_0x1f07c2){logger[_0x51ea('0x22')](_0x1f07c2['stack']);if(_0x1f07c2[_0x51ea('0x23')]){delete _0x1f07c2['name'];}_0x37d602[_0x51ea('0xe')](_0x3158e4)[_0x51ea('0x24')](_0x1f07c2);};}exports[_0x51ea('0x25')]=function(_0x5e8266,_0x45e5b8){var _0xb9d4d9={},_0x28735e={},_0x56592b={'count':0x0,'rows':[]};var _0x10005f=_[_0x51ea('0x26')](db[_0x51ea('0x27')][_0x51ea('0x28')],function(_0x4e3bd5){return{'name':_0x4e3bd5[_0x51ea('0x29')],'type':_0x4e3bd5['type'][_0x51ea('0x2a')]};});_0x28735e[_0x51ea('0x2b')]=_[_0x51ea('0x26')](_0x10005f,_0x51ea('0x23'));_0x28735e[_0x51ea('0x2c')]=_[_0x51ea('0x2d')](_0x5e8266[_0x51ea('0x2c')]);_0x28735e[_0x51ea('0x2e')]=_['intersection'](_0x28735e[_0x51ea('0x2b')],_0x28735e[_0x51ea('0x2c')]);_0xb9d4d9['attributes']=_['intersection'](_0x28735e['model'],qs['fields'](_0x5e8266[_0x51ea('0x2c')][_0x51ea('0x2f')]));_0xb9d4d9[_0x51ea('0x30')]=_0xb9d4d9[_0x51ea('0x30')][_0x51ea('0x31')]?_0xb9d4d9[_0x51ea('0x30')]:_0x28735e[_0x51ea('0x2b')];if(!_0x5e8266[_0x51ea('0x2c')]['hasOwnProperty']('nolimit')){_0xb9d4d9[_0x51ea('0x13')]=qs[_0x51ea('0x13')](_0x5e8266[_0x51ea('0x2c')][_0x51ea('0x13')]);_0xb9d4d9[_0x51ea('0x11')]=qs[_0x51ea('0x11')](_0x5e8266['query']['offset']);}_0xb9d4d9[_0x51ea('0x32')]=qs[_0x51ea('0x33')](_0x5e8266[_0x51ea('0x2c')][_0x51ea('0x33')]);_0xb9d4d9['where']=qs[_0x51ea('0x2e')](_['pick'](_0x5e8266[_0x51ea('0x2c')],_0x28735e[_0x51ea('0x2e')]),_0x10005f);if(_0x5e8266[_0x51ea('0x2c')][_0x51ea('0x1c')]){_0xb9d4d9['where']=_[_0x51ea('0x34')](_0xb9d4d9[_0x51ea('0x35')],{'$or':_['map'](_0x10005f,function(_0x56ef40){if(_0x56ef40[_0x51ea('0x1f')]!==_0x51ea('0x36')){var _0x481ca0={};_0x481ca0[_0x56ef40[_0x51ea('0x23')]]={'$like':'%'+_0x5e8266['query'][_0x51ea('0x1c')]+'%'};return _0x481ca0;}})});}_0xb9d4d9=_[_0x51ea('0x34')]({},_0xb9d4d9,_0x5e8266[_0x51ea('0x37')]);var _0x552ad5={'where':_0xb9d4d9['where']};return db[_0x51ea('0x27')][_0x51ea('0x14')](_0x552ad5)['then'](function(_0x1cb4d7){_0x56592b[_0x51ea('0x14')]=_0x1cb4d7;if(_0x5e8266[_0x51ea('0x2c')]['includeAll']){_0xb9d4d9['include']=[{'all':!![]}];}return db[_0x51ea('0x27')]['findAll'](_0xb9d4d9);})[_0x51ea('0x21')](function(_0x2ce30a){_0x56592b[_0x51ea('0x38')]=_0x2ce30a;return _0x56592b;})[_0x51ea('0x21')](respondWithFilteredResult(_0x45e5b8,_0xb9d4d9))['catch'](handleError(_0x45e5b8,null));};exports[_0x51ea('0x39')]=function(_0x4e1e40,_0x1c6385){var _0x12725b={'raw':![],'where':{'id':_0x4e1e40[_0x51ea('0x3a')]['id']}},_0x2e7183={};_0x2e7183[_0x51ea('0x2b')]=_[_0x51ea('0x2d')](db[_0x51ea('0x27')][_0x51ea('0x28')]);_0x2e7183[_0x51ea('0x2c')]=_[_0x51ea('0x2d')](_0x4e1e40[_0x51ea('0x2c')]);_0x2e7183['filters']=_[_0x51ea('0x3b')](_0x2e7183['model'],_0x2e7183[_0x51ea('0x2c')]);_0x12725b[_0x51ea('0x30')]=_[_0x51ea('0x3b')](_0x2e7183[_0x51ea('0x2b')],qs[_0x51ea('0x2f')](_0x4e1e40[_0x51ea('0x2c')]['fields']));_0x12725b[_0x51ea('0x30')]=_0x12725b[_0x51ea('0x30')][_0x51ea('0x31')]?_0x12725b[_0x51ea('0x30')]:_0x2e7183['model'];if(_0x4e1e40[_0x51ea('0x2c')][_0x51ea('0x3c')]){_0x12725b[_0x51ea('0x3d')]=[{'all':!![]}];}_0x12725b=_[_0x51ea('0x34')]({},_0x12725b,_0x4e1e40['options']);return db[_0x51ea('0x27')][_0x51ea('0x3e')](_0x12725b)['then'](handleEntityNotFound(_0x1c6385,null))[_0x51ea('0x21')](respondWithResult(_0x1c6385,null))[_0x51ea('0x3f')](handleError(_0x1c6385,null));};exports[_0x51ea('0x40')]=function(_0x39c5d8,_0x4200f6){return db[_0x51ea('0x27')]['find']({'where':{'id':_0x39c5d8[_0x51ea('0x3a')]['id']}})[_0x51ea('0x21')](handleEntityNotFound(_0x4200f6,null))['then'](removeEntity(_0x4200f6,null))['catch'](handleError(_0x4200f6,null));};exports[_0x51ea('0x41')]=function(_0x32d515,_0x492e39){if(_0x32d515['body']['type']===_0x51ea('0x42')&&!_[_0x51ea('0x43')](_0x32d515['body'][_0x51ea('0x44')],'_')){_0x32d515[_0x51ea('0x45')][_0x51ea('0x44')]='_'[_0x51ea('0x46')](_0x32d515[_0x51ea('0x45')][_0x51ea('0x44')]);}return db['VoiceExtension'][_0x51ea('0x41')](_0x32d515['body'],{'raw':![]})[_0x51ea('0x21')](function(_0x58c213){var _0x3574f2=_0x32d515[_0x51ea('0x47')][_0x51ea('0x16')]({'plain':!![]});if(!_0x3574f2)throw new Error(_0x51ea('0x48'));if(_0x3574f2[_0x51ea('0x49')]===_0x51ea('0x47')){var _0x126ea1=_0x58c213[_0x51ea('0x16')]({'plain':!![]});var _0x56ab84=[{'name':_0x51ea('0x17'),'value':_0x51ea('0x18')},{'name':_0x51ea('0x19'),'value':'outbound'},{'name':_0x51ea('0x1a'),'value':_0x51ea('0x1b')}];var _0x566cc7=_[_0x51ea('0x3e')](_0x56ab84,['value',_0x126ea1['type']])[_0x51ea('0x23')];return db[_0x51ea('0x4a')]['find']({'where':{'name':_0x566cc7,'userProfileId':_0x3574f2[_0x51ea('0x4b')]},'raw':!![]})[_0x51ea('0x21')](function(_0x379cde){if(_0x379cde&&_0x379cde[_0x51ea('0x4c')]===0x0){return db[_0x51ea('0x20')][_0x51ea('0x41')]({'name':_0x126ea1['name'],'resourceId':_0x126ea1['id'],'type':_0x379cde[_0x51ea('0x23')],'sectionId':_0x379cde['id']},{})['then'](function(){return _0x58c213;});}else{return _0x58c213;}})[_0x51ea('0x3f')](function(_0x32c306){logger[_0x51ea('0x22')](_0x51ea('0x4d'),_0x32c306);throw _0x32c306;});}return _0x58c213;})[_0x51ea('0x21')](respondWithResult(_0x492e39,0xc9))[_0x51ea('0x3f')](handleError(_0x492e39,null));};exports[_0x51ea('0x4e')]=function(_0x4011e8,_0x53c72a){if(_0x4011e8[_0x51ea('0x45')]['id']){delete _0x4011e8['body']['id'];}return db[_0x51ea('0x27')]['find']({'where':{'id':_0x4011e8[_0x51ea('0x3a')]['id']}})[_0x51ea('0x21')](handleEntityNotFound(_0x53c72a,null))[_0x51ea('0x21')](function(_0x69b43b){if(_0x69b43b){return db[_0x51ea('0x27')][_0x51ea('0x4e')](_['pick'](_0x4011e8[_0x51ea('0x45')],[_0x51ea('0x44'),'context',_0x51ea('0x4f'),_0x51ea('0x50'),_0x51ea('0x51'),_0x51ea('0x52'),_0x51ea('0x53')]),{'where':{'context':_0x69b43b[_0x51ea('0x54')],'exten':_0x69b43b[_0x51ea('0x44')]},'individualHooks':!![]})[_0x51ea('0x21')](function(_0x2e203d){return _0x2e203d;});}return null;})[_0x51ea('0x21')](respondWithStatusCode(_0x53c72a,null))[_0x51ea('0x3f')](handleError(_0x53c72a,null));};exports['addApplications']=function(_0x1f1488,_0x4e43f3){var _0x1bc5b9=_0x1f1488['params']['id'];var _0x5059ab=_0x1f1488[_0x51ea('0x45')];var _0x40b0f8=0xc8;var _0x6fbdd8=null;return db[_0x51ea('0x55')][_0x51ea('0x56')]({'isolationLevel':db[_0x51ea('0x55')][_0x51ea('0x57')]['ISOLATION_LEVELS'][_0x51ea('0x58')]},function(_0x58cd93){return db[_0x51ea('0x27')][_0x51ea('0x59')]({'where':{'id':_0x1bc5b9},'transaction':_0x58cd93})[_0x51ea('0x21')](function(_0x488213){if(_0x488213){return db['VoiceExtension']['destroy']({'where':{'VoiceExtensionId':_0x1bc5b9},'transaction':_0x58cd93})[_0x51ea('0x21')](function(){var _0x4ee169=_[_0x51ea('0x26')](_0x5059ab,function(_0x376278){_0x376278['VoiceExtensionId']=_0x1bc5b9;_0x376278[_0x51ea('0x5a')]=!![];return _0x376278;});return _0x488213[_0x51ea('0x5b')](_0x4ee169);})['then'](function(_0x4b3312){return db['VoiceExtension']['bulkCreate'](_0x4b3312,{'transaction':_0x58cd93});});}else{_0x40b0f8=0x194;_0x6fbdd8=[];}});})[_0x51ea('0x21')](function(){if(_0x40b0f8!==0x194){return db['VoiceExtension'][_0x51ea('0x5c')]({'where':{'isApp':!![],'VoiceExtensionId':_0x1bc5b9},'order':_0x51ea('0x5d')})[_0x51ea('0x21')](function(_0x1345df){_0x6fbdd8=_0x1345df;});}})['catch'](function(_0x46e38e){_0x40b0f8=0x1f4;logger[_0x51ea('0x22')](_0x46e38e[_0x51ea('0x5e')]);if(_0x46e38e['name']){delete _0x46e38e[_0x51ea('0x23')];}_0x6fbdd8=_0x46e38e;})[_0x51ea('0x5f')](function(){if(_0x6fbdd8===null){_0x4e43f3[_0x51ea('0xd')](_0x40b0f8);}else{if(_0x40b0f8===0x1f4){_0x4e43f3[_0x51ea('0xe')](_0x40b0f8)[_0x51ea('0x24')](_0x6fbdd8);}else{_0x4e43f3['status'](_0x40b0f8)[_0x51ea('0x10')](_0x6fbdd8);}}});}; \ No newline at end of file +var _0x8249=['merge','options','includeAll','include','VoiceExtension','rows','catch','show','params','keys','rawAttributes','intersection','create','body','exten','concat','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','outbound','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','description','recordingFormat','cutdigits','mandatoryDisposition','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','VoiceExtensionId','isApp','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','finally','lodash','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./voiceExtension.socket','register','status','json','offset','undefined','count','limit','set','Content-Range','destroy','then','get','InboundRoutes','inbound','OutboundRoutes','InternalRoutes','internal','ignore','value','includes','type','find','name','UserProfileResource','end','sendStatus','error','stack','send','index','map','fieldName','model','query','filters','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8249,0xe7));var _0x9824=function(_0xc434e4,_0x470cae){_0xc434e4=_0xc434e4-0x0;var _0x21b400=_0x8249[_0xc434e4];return _0x21b400;};'use strict';var _=require(_0x9824('0x0'));var Redis=require('ioredis');var qs=require(_0x9824('0x1'));var logger=require(_0x9824('0x2'))('api');var config=require(_0x9824('0x3'));var db=require(_0x9824('0x4'))['db'];config[_0x9824('0x5')]=_[_0x9824('0x6')](config[_0x9824('0x5')],{'host':'localhost','port':0x18eb});var socket=require(_0x9824('0x7'))(new Redis(config[_0x9824('0x5')]));require(_0x9824('0x8'))[_0x9824('0x9')](socket);function respondWithStatusCode(_0x26595a,_0x509887){_0x509887=_0x509887||0xcc;return function(_0x2f148c){if(_0x2f148c){return _0x26595a['sendStatus'](_0x509887);}return _0x26595a[_0x9824('0xa')](_0x509887)['end']();};}function respondWithResult(_0x55c610,_0x3fc2ce){_0x3fc2ce=_0x3fc2ce||0xc8;return function(_0xff2964){if(_0xff2964){return _0x55c610['status'](_0x3fc2ce)[_0x9824('0xb')](_0xff2964);}};}function respondWithFilteredResult(_0x5e4147,_0x5aaacf){return function(_0x16e068){if(_0x16e068){var _0x462848=typeof _0x5aaacf[_0x9824('0xc')]==='undefined'&&typeof _0x5aaacf['limit']===_0x9824('0xd');var _0x557129=_0x16e068[_0x9824('0xe')];var _0x248dd2=_0x462848?0x0:_0x5aaacf[_0x9824('0xc')];var _0x1cb21f=_0x462848?_0x16e068[_0x9824('0xe')]:_0x5aaacf[_0x9824('0xc')]+_0x5aaacf[_0x9824('0xf')];var _0x5c6f4c;if(_0x1cb21f>=_0x557129){_0x1cb21f=_0x557129;_0x5c6f4c=0xc8;}else{_0x5c6f4c=0xce;}_0x5e4147[_0x9824('0xa')](_0x5c6f4c);return _0x5e4147[_0x9824('0x10')](_0x9824('0x11'),_0x248dd2+'-'+_0x1cb21f+'/'+_0x557129)[_0x9824('0xb')](_0x16e068);}return null;};}function removeEntity(_0x3c6d2b){return function(_0x3b111b){if(_0x3b111b){return _0x3b111b[_0x9824('0x12')]()[_0x9824('0x13')](function(){var _0x3b88c2=_0x3b111b[_0x9824('0x14')]({'plain':!![]});var _0x59ee89=[{'name':_0x9824('0x15'),'value':_0x9824('0x16'),'ignore':![]},{'name':_0x9824('0x17'),'value':'outbound','ignore':![]},{'name':_0x9824('0x18'),'value':_0x9824('0x19'),'ignore':![]}];var _0x37d8d9=_(_0x59ee89)['filter'](_0x9824('0x1a'))['map'](_0x9824('0x1b'))[_0x9824('0x1b')]();if(_[_0x9824('0x1c')](_0x37d8d9,_0x3b88c2[_0x9824('0x1d')])){return;}var _0xcd3b25=_[_0x9824('0x1e')](_0x59ee89,['value',_0x3b88c2[_0x9824('0x1d')]])[_0x9824('0x1f')];return db[_0x9824('0x20')][_0x9824('0x12')]({'where':{'type':_0xcd3b25,'resourceId':_0x3b88c2['id']}})[_0x9824('0x13')](function(){return _0x3b111b;});})['then'](function(){_0x3c6d2b[_0x9824('0xa')](0xcc)[_0x9824('0x21')]();});}};}function handleEntityNotFound(_0x36ecdb){return function(_0x37e095){if(!_0x37e095){_0x36ecdb[_0x9824('0x22')](0x194);}return _0x37e095;};}function handleError(_0x18a2d4,_0x6c7602){_0x6c7602=_0x6c7602||0x1f4;return function(_0x402cb3){logger[_0x9824('0x23')](_0x402cb3[_0x9824('0x24')]);if(_0x402cb3[_0x9824('0x1f')]){delete _0x402cb3['name'];}_0x18a2d4[_0x9824('0xa')](_0x6c7602)[_0x9824('0x25')](_0x402cb3);};}exports[_0x9824('0x26')]=function(_0x1d0e8e,_0x4ea9a3){var _0xca93c1={},_0x51bd20={},_0x4e7029={'count':0x0,'rows':[]};var _0x214572=_[_0x9824('0x27')](db['VoiceExtension']['rawAttributes'],function(_0x480fd2){return{'name':_0x480fd2[_0x9824('0x28')],'type':_0x480fd2[_0x9824('0x1d')]['key']};});_0x51bd20[_0x9824('0x29')]=_['map'](_0x214572,_0x9824('0x1f'));_0x51bd20[_0x9824('0x2a')]=_['keys'](_0x1d0e8e[_0x9824('0x2a')]);_0x51bd20[_0x9824('0x2b')]=_['intersection'](_0x51bd20['model'],_0x51bd20[_0x9824('0x2a')]);_0xca93c1[_0x9824('0x2c')]=_['intersection'](_0x51bd20[_0x9824('0x29')],qs[_0x9824('0x2d')](_0x1d0e8e[_0x9824('0x2a')][_0x9824('0x2d')]));_0xca93c1[_0x9824('0x2c')]=_0xca93c1['attributes'][_0x9824('0x2e')]?_0xca93c1[_0x9824('0x2c')]:_0x51bd20[_0x9824('0x29')];if(!_0x1d0e8e[_0x9824('0x2a')][_0x9824('0x2f')]('nolimit')){_0xca93c1[_0x9824('0xf')]=qs['limit'](_0x1d0e8e[_0x9824('0x2a')][_0x9824('0xf')]);_0xca93c1[_0x9824('0xc')]=qs[_0x9824('0xc')](_0x1d0e8e['query'][_0x9824('0xc')]);}_0xca93c1[_0x9824('0x30')]=qs[_0x9824('0x31')](_0x1d0e8e[_0x9824('0x2a')][_0x9824('0x31')]);_0xca93c1[_0x9824('0x32')]=qs['filters'](_[_0x9824('0x33')](_0x1d0e8e[_0x9824('0x2a')],_0x51bd20[_0x9824('0x2b')]),_0x214572);if(_0x1d0e8e['query'][_0x9824('0x34')]){_0xca93c1[_0x9824('0x32')]=_['merge'](_0xca93c1[_0x9824('0x32')],{'$or':_[_0x9824('0x27')](_0x214572,function(_0x3d8d06){if(_0x3d8d06[_0x9824('0x1d')]!==_0x9824('0x35')){var _0xcada11={};_0xcada11[_0x3d8d06['name']]={'$like':'%'+_0x1d0e8e['query'][_0x9824('0x34')]+'%'};return _0xcada11;}})});}_0xca93c1=_[_0x9824('0x36')]({},_0xca93c1,_0x1d0e8e[_0x9824('0x37')]);var _0x10ef73={'where':_0xca93c1[_0x9824('0x32')]};return db['VoiceExtension'][_0x9824('0xe')](_0x10ef73)[_0x9824('0x13')](function(_0x37057f){_0x4e7029[_0x9824('0xe')]=_0x37057f;if(_0x1d0e8e[_0x9824('0x2a')][_0x9824('0x38')]){_0xca93c1[_0x9824('0x39')]=[{'all':!![]}];}return db[_0x9824('0x3a')]['findAll'](_0xca93c1);})['then'](function(_0x279343){_0x4e7029[_0x9824('0x3b')]=_0x279343;return _0x4e7029;})['then'](respondWithFilteredResult(_0x4ea9a3,_0xca93c1))[_0x9824('0x3c')](handleError(_0x4ea9a3,null));};exports[_0x9824('0x3d')]=function(_0x52ce4d,_0x15d1c0){var _0x49af6c={'raw':![],'where':{'id':_0x52ce4d[_0x9824('0x3e')]['id']}},_0x50431d={};_0x50431d[_0x9824('0x29')]=_[_0x9824('0x3f')](db[_0x9824('0x3a')][_0x9824('0x40')]);_0x50431d[_0x9824('0x2a')]=_[_0x9824('0x3f')](_0x52ce4d[_0x9824('0x2a')]);_0x50431d[_0x9824('0x2b')]=_['intersection'](_0x50431d[_0x9824('0x29')],_0x50431d[_0x9824('0x2a')]);_0x49af6c[_0x9824('0x2c')]=_[_0x9824('0x41')](_0x50431d['model'],qs[_0x9824('0x2d')](_0x52ce4d['query']['fields']));_0x49af6c[_0x9824('0x2c')]=_0x49af6c['attributes']['length']?_0x49af6c[_0x9824('0x2c')]:_0x50431d['model'];if(_0x52ce4d[_0x9824('0x2a')]['includeAll']){_0x49af6c[_0x9824('0x39')]=[{'all':!![]}];}_0x49af6c=_[_0x9824('0x36')]({},_0x49af6c,_0x52ce4d['options']);return db[_0x9824('0x3a')][_0x9824('0x1e')](_0x49af6c)['then'](handleEntityNotFound(_0x15d1c0,null))['then'](respondWithResult(_0x15d1c0,null))[_0x9824('0x3c')](handleError(_0x15d1c0,null));};exports[_0x9824('0x12')]=function(_0x2db5ea,_0x209a60){return db[_0x9824('0x3a')]['find']({'where':{'id':_0x2db5ea[_0x9824('0x3e')]['id']}})['then'](handleEntityNotFound(_0x209a60,null))[_0x9824('0x13')](removeEntity(_0x209a60,null))[_0x9824('0x3c')](handleError(_0x209a60,null));};exports[_0x9824('0x42')]=function(_0x3166b4,_0xff7eb0){if(_0x3166b4[_0x9824('0x43')][_0x9824('0x1d')]==='outbound'&&!_['startsWith'](_0x3166b4['body'][_0x9824('0x44')],'_')){_0x3166b4[_0x9824('0x43')][_0x9824('0x44')]='_'[_0x9824('0x45')](_0x3166b4[_0x9824('0x43')][_0x9824('0x44')]);}return db[_0x9824('0x3a')]['create'](_0x3166b4[_0x9824('0x43')],{'raw':![]})[_0x9824('0x13')](function(_0x301c0d){var _0x6764eb=_0x3166b4['user'][_0x9824('0x14')]({'plain':!![]});if(!_0x6764eb)throw new Error(_0x9824('0x46'));if(_0x6764eb['role']===_0x9824('0x47')){var _0xce5413=_0x301c0d[_0x9824('0x14')]({'plain':!![]});var _0x41aaab=[{'name':'InboundRoutes','value':_0x9824('0x16')},{'name':_0x9824('0x17'),'value':_0x9824('0x48')},{'name':_0x9824('0x18'),'value':'internal'}];var _0x464c30=_[_0x9824('0x1e')](_0x41aaab,['value',_0xce5413[_0x9824('0x1d')]])[_0x9824('0x1f')];return db[_0x9824('0x49')][_0x9824('0x1e')]({'where':{'name':_0x464c30,'userProfileId':_0x6764eb[_0x9824('0x4a')]},'raw':!![]})['then'](function(_0x5677b2){if(_0x5677b2&&_0x5677b2[_0x9824('0x4b')]===0x0){return db['UserProfileResource'][_0x9824('0x42')]({'name':_0xce5413[_0x9824('0x1f')],'resourceId':_0xce5413['id'],'type':_0x5677b2[_0x9824('0x1f')],'sectionId':_0x5677b2['id']},{})[_0x9824('0x13')](function(){return _0x301c0d;});}else{return _0x301c0d;}})[_0x9824('0x3c')](function(_0x1ceb5b){logger['error'](_0x9824('0x4c'),_0x1ceb5b);throw _0x1ceb5b;});}return _0x301c0d;})[_0x9824('0x13')](respondWithResult(_0xff7eb0,0xc9))[_0x9824('0x3c')](handleError(_0xff7eb0,null));};exports['update']=function(_0x1b7e6f,_0x204a80){if(_0x1b7e6f[_0x9824('0x43')]['id']){delete _0x1b7e6f['body']['id'];}return db[_0x9824('0x3a')][_0x9824('0x1e')]({'where':{'id':_0x1b7e6f['params']['id']}})[_0x9824('0x13')](handleEntityNotFound(_0x204a80,null))[_0x9824('0x13')](function(_0x44b543){if(_0x44b543){return db['VoiceExtension']['update'](_['pick'](_0x1b7e6f['body'],[_0x9824('0x44'),_0x9824('0x4d'),_0x9824('0x4e'),_0x9824('0x4f'),_0x9824('0x50'),_0x9824('0x51'),'alias']),{'where':{'context':_0x44b543[_0x9824('0x4d')],'exten':_0x44b543[_0x9824('0x44')]},'individualHooks':!![]})['then'](function(_0x33a1b3){return _0x33a1b3;});}return null;})['then'](respondWithStatusCode(_0x204a80,null))[_0x9824('0x3c')](handleError(_0x204a80,null));};exports[_0x9824('0x52')]=function(_0x3c5e07,_0x4eb7f1){var _0x467d25=_0x3c5e07[_0x9824('0x3e')]['id'];var _0x1b5540=_0x3c5e07[_0x9824('0x43')];var _0x950a89=0xc8;var _0x530fab=null;return db[_0x9824('0x53')][_0x9824('0x54')]({'isolationLevel':db[_0x9824('0x53')][_0x9824('0x55')][_0x9824('0x56')][_0x9824('0x57')]},function(_0x5bb046){return db['VoiceExtension'][_0x9824('0x58')]({'where':{'id':_0x467d25},'transaction':_0x5bb046})[_0x9824('0x13')](function(_0x10cd1f){if(_0x10cd1f){return db[_0x9824('0x3a')][_0x9824('0x12')]({'where':{'VoiceExtensionId':_0x467d25},'transaction':_0x5bb046})[_0x9824('0x13')](function(){var _0xd6aa09=_[_0x9824('0x27')](_0x1b5540,function(_0x1ecb9f){_0x1ecb9f[_0x9824('0x59')]=_0x467d25;_0x1ecb9f[_0x9824('0x5a')]=!![];return _0x1ecb9f;});return _0x10cd1f['createRouting'](_0xd6aa09);})[_0x9824('0x13')](function(_0x32d4f0){return db[_0x9824('0x3a')][_0x9824('0x5b')](_0x32d4f0,{'transaction':_0x5bb046});});}else{_0x950a89=0x194;_0x530fab=[];}});})[_0x9824('0x13')](function(){if(_0x950a89!==0x194){return db[_0x9824('0x3a')][_0x9824('0x5c')]({'where':{'isApp':!![],'VoiceExtensionId':_0x467d25},'order':_0x9824('0x5d')})[_0x9824('0x13')](function(_0x3310d1){_0x530fab=_0x3310d1;});}})[_0x9824('0x3c')](function(_0x51d687){_0x950a89=0x1f4;logger['error'](_0x51d687[_0x9824('0x24')]);if(_0x51d687[_0x9824('0x1f')]){delete _0x51d687[_0x9824('0x1f')];}_0x530fab=_0x51d687;})[_0x9824('0x5e')](function(){if(_0x530fab===null){_0x4eb7f1[_0x9824('0x22')](_0x950a89);}else{if(_0x950a89===0x1f4){_0x4eb7f1[_0x9824('0xa')](_0x950a89)['send'](_0x530fab);}else{_0x4eb7f1['status'](_0x950a89)[_0x9824('0xb')](_0x530fab);}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 935c5ae..a072bc0 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 _0xd1b5=['hook','exports','events','../../mysqldb','VoiceExtension','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0xd1b5,0x192));var _0x5d1b=function(_0x28b4fe,_0x5e719f){_0x28b4fe=_0x28b4fe-0x0;var _0x2e463f=_0xd1b5[_0x28b4fe];return _0x2e463f;};'use strict';var EventEmitter=require(_0x5d1b('0x0'));var VoiceExtension=require(_0x5d1b('0x1'))['db'][_0x5d1b('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x5d1b('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x5d1b('0x4'),'afterDestroy':_0x5d1b('0x5')};function emitEvent(_0x4692b3){return function(_0x2b1dc7,_0x4e7d2e,_0x3cec5b){VoiceExtensionEvents[_0x5d1b('0x6')](_0x4692b3+':'+_0x2b1dc7['id'],_0x2b1dc7);VoiceExtensionEvents[_0x5d1b('0x6')](_0x4692b3,_0x2b1dc7);_0x3cec5b(null);};}for(var e in events){if(events[_0x5d1b('0x7')](e)){var event=events[e];VoiceExtension[_0x5d1b('0x8')](e,emitEvent(event));}}module[_0x5d1b('0x9')]=VoiceExtensionEvents; \ No newline at end of file +var _0xaae3=['VoiceExtension','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events'];(function(_0x3f2f70,_0x4958e5){var _0x37b99=function(_0x1677e0){while(--_0x1677e0){_0x3f2f70['push'](_0x3f2f70['shift']());}};_0x37b99(++_0x4958e5);}(_0xaae3,0xaa));var _0x3aae=function(_0x4d04d6,_0x38ae19){_0x4d04d6=_0x4d04d6-0x0;var _0x2e937a=_0xaae3[_0x4d04d6];return _0x2e937a;};'use strict';var EventEmitter=require(_0x3aae('0x0'));var VoiceExtension=require('../../mysqldb')['db'][_0x3aae('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x3aae('0x2')](0x0);var events={'afterCreate':_0x3aae('0x3'),'afterUpdate':_0x3aae('0x4'),'afterDestroy':_0x3aae('0x5')};function emitEvent(_0x5d06ba){return function(_0x48de29,_0x361ab7,_0x56bc0d){VoiceExtensionEvents[_0x3aae('0x6')](_0x5d06ba+':'+_0x48de29['id'],_0x48de29);VoiceExtensionEvents[_0x3aae('0x6')](_0x5d06ba,_0x48de29);_0x56bc0d(null);};}for(var e in events){if(events[_0x3aae('0x7')](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module[_0x3aae('0x8')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index 1af3941..93a0ce9 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 _0x5c3e=['name','trunk','param','phone','prefix','SIP','join','U(xcally-mixmonitor-context)','isEmpty','Interval','findAll','interval','IntervalId','then','*,*,*,*','intervals','map','toLowerCase','tag','CDR(tag)=','ExecIf','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','answer','queue','playback','includes','app','appType','$[${XCALLY-MOTION-ANSWER}=0]?Answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','appdata','priority','last','concat','define','VoiceExtension','voice_extensions','get','Hangup','lodash','./voiceExtension.attributes','exports','models','CDR(type)=','type','context','exten','inbound','push','Set','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','cutdigits','${EXTEN:','${EXTEN}','CDR(routeid)=','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','XCALLY-MOTION-PROGRESS=0','outboundrouteid=','hasOwnProperty','recordingFormat','none','options','split','length'];(function(_0x4d3078,_0x448284){var _0x432ffa=function(_0x163ef0){while(--_0x163ef0){_0x4d3078['push'](_0x4d3078['shift']());}};_0x432ffa(++_0x448284);}(_0x5c3e,0x10e));var _0xe5c3=function(_0x791f1d,_0xa9730c){_0x791f1d=_0x791f1d-0x0;var _0x6c199b=_0x5c3e[_0x791f1d];return _0x6c199b;};'use strict';var _=require(_0xe5c3('0x0'));var attributes=require(_0xe5c3('0x1'));module[_0xe5c3('0x2')]=function(_0xe08db){var _0x170f85=_0xe08db[_0xe5c3('0x3')];function _0x12e0ac(_0x52d566){var _0x4a01ee=0x2;var _0x52f33b=[{'type':_0x52d566['type'],'app':'Set','appdata':_0xe5c3('0x4')+_0x52d566[_0xe5c3('0x5')],'context':_0x52d566[_0xe5c3('0x6')],'exten':_0x52d566[_0xe5c3('0x7')],'priority':_0x4a01ee++,'VoiceExtensionId':_0x52d566['id']}];if(_0x52d566[_0xe5c3('0x5')]===_0xe5c3('0x8')){_0x52f33b[_0xe5c3('0x9')]({'type':_0xe5c3('0x8'),'app':_0xe5c3('0xa'),'appdata':'CDR(routeid)='+_0x52d566['id'],'context':_0x52d566[_0xe5c3('0x6')],'exten':_0x52d566[_0xe5c3('0x7')],'priority':_0x4a01ee++,'VoiceExtensionId':_0x52d566['id']});}_0x52f33b['push']({'type':_0x52d566[_0xe5c3('0x5')],'app':_0xe5c3('0xa'),'appdata':_0xe5c3('0xb'),'context':_0x52d566[_0xe5c3('0x6')],'exten':_0x52d566[_0xe5c3('0x7')],'priority':_0x4a01ee++,'VoiceExtensionId':_0x52d566['id']},{'type':_0x52d566[_0xe5c3('0x5')],'app':'Set','appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x52d566[_0xe5c3('0x6')],'exten':_0x52d566['exten'],'priority':_0x4a01ee++,'VoiceExtensionId':_0x52d566['id']},{'type':_0x52d566[_0xe5c3('0x5')],'app':_0xe5c3('0xa'),'appdata':_0xe5c3('0xc'),'context':_0x52d566[_0xe5c3('0x6')],'exten':_0x52d566[_0xe5c3('0x7')],'priority':_0x4a01ee++,'VoiceExtensionId':_0x52d566['id']});return _0x52f33b;}function _0x1fd16(_0xa8f2fb){var _0x2548b4=0x2;var _0x5042a3=[{'type':_0xe5c3('0xd'),'app':'Set','appdata':_0xe5c3('0xe'),'context':_0xa8f2fb['context'],'exten':_0xa8f2fb['exten'],'priority':_0x2548b4++,'VoiceExtensionId':_0xa8f2fb['id']},{'type':'outbound','app':'Set','appdata':'CDR(destination)='+(_0xa8f2fb[_0xe5c3('0xf')]?_0xe5c3('0x10')+_0xa8f2fb['cutdigits']+'}':_0xe5c3('0x11')),'context':_0xa8f2fb[_0xe5c3('0x6')],'exten':_0xa8f2fb[_0xe5c3('0x7')],'priority':_0x2548b4++,'VoiceExtensionId':_0xa8f2fb['id']},{'type':'outbound','app':_0xe5c3('0xa'),'appdata':_0xe5c3('0x12')+_0xa8f2fb['id'],'context':_0xa8f2fb[_0xe5c3('0x6')],'exten':_0xa8f2fb[_0xe5c3('0x7')],'priority':_0x2548b4++,'VoiceExtensionId':_0xa8f2fb['id']},{'type':_0xe5c3('0xd'),'app':'ExecIf','appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x2548b4+0x2)+_0xe5c3('0x13')+(_0x2548b4+0x1)+')','context':_0xa8f2fb[_0xe5c3('0x6')],'exten':_0xa8f2fb[_0xe5c3('0x7')],'priority':_0x2548b4++,'VoiceExtensionId':_0xa8f2fb['id']},{'type':_0xe5c3('0xd'),'app':_0xe5c3('0xa'),'appdata':_0xa8f2fb['cutdigits']?_0xe5c3('0x14')+_0xa8f2fb[_0xe5c3('0xf')]+'}':_0xe5c3('0x15'),'context':_0xa8f2fb[_0xe5c3('0x6')],'exten':_0xa8f2fb[_0xe5c3('0x7')],'priority':_0x2548b4++,'VoiceExtensionId':_0xa8f2fb['id']},{'type':_0xe5c3('0xd'),'app':_0xe5c3('0xa'),'appdata':_0xe5c3('0xb'),'context':_0xa8f2fb[_0xe5c3('0x6')],'exten':_0xa8f2fb[_0xe5c3('0x7')],'priority':_0x2548b4++,'VoiceExtensionId':_0xa8f2fb['id']},{'type':'outbound','app':_0xe5c3('0xa'),'appdata':_0xe5c3('0x16'),'context':_0xa8f2fb[_0xe5c3('0x6')],'exten':_0xa8f2fb[_0xe5c3('0x7')],'priority':_0x2548b4++,'VoiceExtensionId':_0xa8f2fb['id']},{'type':'outbound','app':_0xe5c3('0xa'),'appdata':'MONITOR_OPTIONS=ab','context':_0xa8f2fb[_0xe5c3('0x6')],'exten':_0xa8f2fb[_0xe5c3('0x7')],'priority':_0x2548b4++,'VoiceExtensionId':_0xa8f2fb['id']},{'type':'outbound','app':_0xe5c3('0xa'),'appdata':_0xe5c3('0x17')+_0xa8f2fb['id'],'context':_0xa8f2fb[_0xe5c3('0x6')],'exten':_0xa8f2fb[_0xe5c3('0x7')],'priority':_0x2548b4++,'VoiceExtensionId':_0xa8f2fb['id']}];if(_0xa8f2fb[_0xe5c3('0x18')]('recordingFormat')&&_0xa8f2fb[_0xe5c3('0x19')]!==_0xe5c3('0x1a')){_0x5042a3['push']({'type':'outbound','app':'Set','appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0xa8f2fb[_0xe5c3('0x6')],'exten':_0xa8f2fb[_0xe5c3('0x7')],'priority':_0x2548b4++,'VoiceExtensionId':_0xa8f2fb['id']},{'type':'outbound','app':_0xe5c3('0xa'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0xa8f2fb[_0xe5c3('0x19')]||'wav','context':_0xa8f2fb[_0xe5c3('0x6')],'exten':_0xa8f2fb[_0xe5c3('0x7')],'priority':_0x2548b4++,'VoiceExtensionId':_0xa8f2fb['id']});}return _0x5042a3;}function _0x1dce47(_0x1ff4dc,_0x150f94){var _0x4e9f1f=[{'name':'trunk','param':0x0},{'name':'timeout','param':0x1},{'name':_0xe5c3('0x1b'),'param':0x2},{'name':'url','param':0x3}];var _0x14816e={};var _0x16f8d8=_0x150f94[_0xe5c3('0x1c')](',');var _0x4fc51f=[];for(var _0x1af1a3=0x0;_0x1af1a3<_0x4e9f1f[_0xe5c3('0x1d')];_0x1af1a3++){switch(_0x4e9f1f[_0x1af1a3][_0xe5c3('0x1e')]){case _0xe5c3('0x1f'):_0x14816e[_0xe5c3('0x1f')]=_0x16f8d8[_0x4e9f1f[_0x1af1a3][_0xe5c3('0x20')]][_0xe5c3('0x1c')]('/')[0x1];_0x14816e['phone']=_0x16f8d8[_0x4e9f1f[_0x1af1a3][_0xe5c3('0x20')]][_0xe5c3('0x1c')]('/')[0x2];_0x14816e['prefix']=_0x14816e['phone']?_0x14816e['phone'][_0xe5c3('0x1c')]('$')[0x0]:undefined;_0x14816e[_0xe5c3('0x21')]=_0x1ff4dc['cutdigits']?(_0x14816e[_0xe5c3('0x22')]||'')+_0xe5c3('0x10')+_0x1ff4dc[_0xe5c3('0xf')]+'}':(_0x14816e[_0xe5c3('0x22')]||'')+'${EXTEN}';_0x4fc51f[_0x4e9f1f[_0x1af1a3][_0xe5c3('0x20')]]=[_0xe5c3('0x23'),_0x14816e[_0xe5c3('0x1f')],_0x14816e[_0xe5c3('0x21')]][_0xe5c3('0x24')]('/');break;case _0xe5c3('0x1b'):_0x14816e['options']=_0x16f8d8[_0x4e9f1f[_0x1af1a3][_0xe5c3('0x20')]];if(_0x1ff4dc[_0xe5c3('0x19')]!==_0xe5c3('0x1a')){if(_0x14816e[_0xe5c3('0x1b')]['indexOf'](_0xe5c3('0x25'))<0x0){_0x14816e[_0xe5c3('0x1b')]+=_0xe5c3('0x25');}}else{_0x14816e['options']=_0x14816e['options']['replace'](_0xe5c3('0x25'),'');}_0x4fc51f[_0x4e9f1f[_0x1af1a3]['param']]=_0x14816e[_0xe5c3('0x1b')];break;default:_0x4fc51f[_0x4e9f1f[_0x1af1a3][_0xe5c3('0x20')]]=_0x16f8d8[_0x4e9f1f[_0x1af1a3][_0xe5c3('0x20')]];}}return _0x4fc51f[_0xe5c3('0x24')](',');}function _0x2fce60(_0x42c4a3,_0x4c3a16,_0x55a866){return new Promise(function(_0x512c4d,_0xbe428d){var _0x343a4b=[];if(_[_0xe5c3('0x26')](_0x4c3a16))return _0x512c4d(_0x343a4b);_0x170f85[_0xe5c3('0x27')][_0xe5c3('0x28')]({'attributes':['id',_0xe5c3('0x29'),_0xe5c3('0x2a')],'raw':!![]})[_0xe5c3('0x2b')](function(_0x2dee27){for(var _0x3dbae8=0x0,_0x554b00=0x0;_0x3dbae8<_0x4c3a16[_0xe5c3('0x1d')];_0x3dbae8++,_0x554b00=0x0){var _0x545a9a=_0x4c3a16[_0x3dbae8];var _0x44c8a4=[];var _0x423b62=[];delete _0x545a9a['id'];if(_0x545a9a[_0xe5c3('0x29')]!==_0xe5c3('0x2c')){_0x545a9a[_0xe5c3('0x2d')]=[_0x545a9a[_0xe5c3('0x29')]];}else{_0x545a9a[_0xe5c3('0x2d')]=_0x545a9a['IntervalId']?_[_0xe5c3('0x2e')](_['filter'](_0x2dee27,{'IntervalId':_0x545a9a['IntervalId']}),'interval'):[];}_0x545a9a[_0xe5c3('0x6')]=_0x42c4a3[_0xe5c3('0x6')];_0x545a9a[_0xe5c3('0x7')]=_0x42c4a3[_0xe5c3('0x7')];if(_0x545a9a[_0xe5c3('0x5')])_0x545a9a['type']=_0x545a9a[_0xe5c3('0x5')][_0xe5c3('0x2f')]();if(_0x42c4a3[_0xe5c3('0x5')]===_0xe5c3('0xd')){if(_0x545a9a[_0xe5c3('0x18')](_0xe5c3('0x30'))&&_0x545a9a[_0xe5c3('0x30')]&&_0x545a9a[_0xe5c3('0x30')]!=='--'){_0x44c8a4[_0xe5c3('0x9')]({'type':_0x545a9a['type']['toLowerCase'](),'app':'Set','appdata':_0xe5c3('0x31')+_0x545a9a[_0xe5c3('0x30')],'context':_0x42c4a3[_0xe5c3('0x6')],'exten':_0x42c4a3[_0xe5c3('0x7')],'priority':_0x545a9a[_0xe5c3('0x2d')][_0xe5c3('0x1d')]+_0x55a866+_0x554b00++,'VoiceExtensionId':_0x42c4a3['id']});}_0x44c8a4[_0xe5c3('0x9')]({'type':_0x545a9a[_0xe5c3('0x5')][_0xe5c3('0x2f')](),'app':_0xe5c3('0x32'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):'+(_0x545a9a[_0xe5c3('0x33')]?_0xe5c3('0x34')+_0x545a9a[_0xe5c3('0x33')]+')':_0xe5c3('0x35')),'context':_0x42c4a3[_0xe5c3('0x6')],'exten':_0x42c4a3[_0xe5c3('0x7')],'priority':_0x545a9a[_0xe5c3('0x2d')][_0xe5c3('0x1d')]+_0x55a866+_0x554b00++,'VoiceExtensionId':_0x42c4a3['id']});}else{if(_0x545a9a[_0xe5c3('0x18')](_0xe5c3('0x36'))){if([_0xe5c3('0x37'),_0xe5c3('0x38')][_0xe5c3('0x39')](_0x545a9a[_0xe5c3('0x3a')]['toLowerCase']())&&_0x545a9a[_0xe5c3('0x3b')]!=='custom'){if(_0x545a9a[_0xe5c3('0x36')]){_0x44c8a4[_0xe5c3('0x9')]({'type':_0x545a9a[_0xe5c3('0x5')]['toLowerCase'](),'app':_0xe5c3('0x32'),'appdata':_0xe5c3('0x3c'),'context':_0x42c4a3[_0xe5c3('0x6')],'exten':_0x42c4a3['exten'],'priority':_0x545a9a[_0xe5c3('0x2d')][_0xe5c3('0x1d')]+_0x55a866+_0x554b00++,'VoiceExtensionId':_0x42c4a3['id']});_0x44c8a4['push']({'type':_0x545a9a[_0xe5c3('0x5')][_0xe5c3('0x2f')](),'app':_0xe5c3('0xa'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x42c4a3[_0xe5c3('0x6')],'exten':_0x42c4a3['exten'],'priority':_0x545a9a[_0xe5c3('0x2d')]['length']+_0x55a866+_0x554b00++,'VoiceExtensionId':_0x42c4a3['id']});}else{_0x44c8a4[_0xe5c3('0x9')]({'type':_0x545a9a['type'][_0xe5c3('0x2f')](),'app':_0xe5c3('0x32'),'appdata':_0xe5c3('0x3d'),'context':_0x42c4a3[_0xe5c3('0x6')],'exten':_0x42c4a3[_0xe5c3('0x7')],'priority':_0x545a9a[_0xe5c3('0x2d')][_0xe5c3('0x1d')]+_0x55a866+_0x554b00++,'VoiceExtensionId':_0x42c4a3['id']});_0x44c8a4[_0xe5c3('0x9')]({'type':_0x545a9a[_0xe5c3('0x5')]['toLowerCase'](),'app':_0xe5c3('0xa'),'appdata':_0xe5c3('0x3e'),'context':_0x42c4a3[_0xe5c3('0x6')],'exten':_0x42c4a3[_0xe5c3('0x7')],'priority':_0x545a9a[_0xe5c3('0x2d')][_0xe5c3('0x1d')]+_0x55a866+_0x554b00++,'VoiceExtensionId':_0x42c4a3['id']});}}}}for(var _0x29a270=0x0;_0x29a270<_0x545a9a['intervals'][_0xe5c3('0x1d')];_0x29a270++){var _0x380077=_0x55a866+_0x545a9a[_0xe5c3('0x2d')]['length'];var _0x3add69=_0x29a270===_0x545a9a[_0xe5c3('0x2d')][_0xe5c3('0x1d')]-0x1?_0x55a866+_0x44c8a4[_0xe5c3('0x1d')]+_0x423b62[_0xe5c3('0x1d')]+0x2:_0x55a866+_0x29a270+0x1;_0x44c8a4[_0xe5c3('0x3f')](_0x29a270,0x0,{'type':_0x42c4a3[_0xe5c3('0x5')],'app':_0xe5c3('0x40'),'appdata':_0x545a9a['intervals'][_0x29a270]+'?'+_0x42c4a3['context']+_0xe5c3('0x41')+_0x380077+':'+_0x42c4a3[_0xe5c3('0x6')]+_0xe5c3('0x41')+_0x3add69,'exten':_0x42c4a3[_0xe5c3('0x7')],'context':_0x42c4a3[_0xe5c3('0x6')],'priority':_0x55a866+_0x29a270,'VoiceExtensionId':_0x42c4a3['id']});}if(_0x545a9a[_0xe5c3('0x3b')]==='outboundDial'){_0x545a9a[_0xe5c3('0x42')]=_0x1dce47(_0x42c4a3,_0x545a9a[_0xe5c3('0x42')]);}if(_0x545a9a['appType']==='agi'){_0x44c8a4['push']({'type':_0x545a9a[_0xe5c3('0x5')][_0xe5c3('0x2f')](),'app':_0xe5c3('0xa'),'appdata':'XMCS-UNIQUEID=${CHANNEL(LINKEDID)}','context':_0x42c4a3[_0xe5c3('0x6')],'exten':_0x42c4a3[_0xe5c3('0x7')],'priority':_0x545a9a[_0xe5c3('0x2d')]['length']+_0x55a866+_0x554b00++,'VoiceExtensionId':_0x42c4a3['id']});}_0x545a9a[_0xe5c3('0x43')]=_0x44c8a4[_0xe5c3('0x1d')]?_[_0xe5c3('0x44')](_0x44c8a4)[_0xe5c3('0x43')]+0x1:_0x55a866;_0x343a4b=_[_0xe5c3('0x45')](_0x343a4b,_0x44c8a4,[_0x545a9a],_0x423b62);_0x55a866=_[_0xe5c3('0x44')](_0x343a4b)[_0xe5c3('0x43')]+0x1;}return _0x512c4d(_0x343a4b);})['catch'](function(_0x46902b){_0xbe428d(_0x46902b);});});}return _0xe08db[_0xe5c3('0x46')](_0xe5c3('0x47'),attributes,{'tableName':_0xe5c3('0x48'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x271f30){var _0x58582c=this[_0xe5c3('0x49')]({'plain':!![]});var _0x383dd2=_0x58582c[_0xe5c3('0x5')]===_0xe5c3('0xd')?_0x1fd16(_0x58582c):_0x12e0ac(_0x58582c);return _0x2fce60(_0x58582c,_0x271f30,_['last'](_0x383dd2)[_0xe5c3('0x43')]+0x1)[_0xe5c3('0x2b')](function(_0x4b9b48){var _0x49728a=_[_0xe5c3('0x45')](_0x383dd2,_0x4b9b48);_0x49728a[_0xe5c3('0x9')]({'type':_0x58582c['type'],'app':_0xe5c3('0x4a'),'exten':_0x58582c[_0xe5c3('0x7')],'context':_0x58582c[_0xe5c3('0x6')],'priority':_[_0xe5c3('0x44')](_0x49728a)[_0xe5c3('0x43')]+0x1,'VoiceExtensionId':_0x58582c['id']});return _0x49728a;});}}});}; \ No newline at end of file +var _0xe9c2=['priority','concat','last','catch','define','VoiceExtension','lodash','./voiceExtension.attributes','models','type','Set','CDR(type)=','context','exten','inbound','push','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','CDR(type)=outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','outbound','CDR(routeid)=','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','options','url','split','length','name','param','phone','prefix','join','indexOf','U(xcally-mixmonitor-context)','replace','isEmpty','Interval','findAll','interval','then','*,*,*,*','intervals','IntervalId','map','filter','toLowerCase','hasOwnProperty','tag','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','queue','includes','app','appType','answer','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice',',${EXTEN},','outboundDial','appdata','agi','XMCS-UNIQUEID=${CHANNEL(LINKEDID)}'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe9c2,0x14e));var _0x2e9c=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xe9c2[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0x2e9c('0x0'));var attributes=require(_0x2e9c('0x1'));module['exports']=function(_0x1b5446){var _0x40109d=_0x1b5446[_0x2e9c('0x2')];function _0x116ab3(_0x1acb35){var _0x3b121a=0x2;var _0x38300c=[{'type':_0x1acb35[_0x2e9c('0x3')],'app':_0x2e9c('0x4'),'appdata':_0x2e9c('0x5')+_0x1acb35[_0x2e9c('0x3')],'context':_0x1acb35[_0x2e9c('0x6')],'exten':_0x1acb35[_0x2e9c('0x7')],'priority':_0x3b121a++,'VoiceExtensionId':_0x1acb35['id']}];if(_0x1acb35[_0x2e9c('0x3')]===_0x2e9c('0x8')){_0x38300c['push']({'type':'inbound','app':'Set','appdata':'CDR(routeid)='+_0x1acb35['id'],'context':_0x1acb35[_0x2e9c('0x6')],'exten':_0x1acb35[_0x2e9c('0x7')],'priority':_0x3b121a++,'VoiceExtensionId':_0x1acb35['id']});}_0x38300c[_0x2e9c('0x9')]({'type':_0x1acb35[_0x2e9c('0x3')],'app':_0x2e9c('0x4'),'appdata':_0x2e9c('0xa'),'context':_0x1acb35[_0x2e9c('0x6')],'exten':_0x1acb35[_0x2e9c('0x7')],'priority':_0x3b121a++,'VoiceExtensionId':_0x1acb35['id']},{'type':_0x1acb35['type'],'app':_0x2e9c('0x4'),'appdata':_0x2e9c('0xb'),'context':_0x1acb35[_0x2e9c('0x6')],'exten':_0x1acb35[_0x2e9c('0x7')],'priority':_0x3b121a++,'VoiceExtensionId':_0x1acb35['id']},{'type':_0x1acb35[_0x2e9c('0x3')],'app':'Set','appdata':_0x2e9c('0xc'),'context':_0x1acb35[_0x2e9c('0x6')],'exten':_0x1acb35['exten'],'priority':_0x3b121a++,'VoiceExtensionId':_0x1acb35['id']});return _0x38300c;}function _0x14d386(_0x5ca6ab){var _0x515299=0x2;var _0x32d579=[{'type':'outbound','app':_0x2e9c('0x4'),'appdata':_0x2e9c('0xd'),'context':_0x5ca6ab[_0x2e9c('0x6')],'exten':_0x5ca6ab[_0x2e9c('0x7')],'priority':_0x515299++,'VoiceExtensionId':_0x5ca6ab['id']},{'type':'outbound','app':_0x2e9c('0x4'),'appdata':_0x2e9c('0xe')+(_0x5ca6ab[_0x2e9c('0xf')]?_0x2e9c('0x10')+_0x5ca6ab[_0x2e9c('0xf')]+'}':_0x2e9c('0x11')),'context':_0x5ca6ab[_0x2e9c('0x6')],'exten':_0x5ca6ab['exten'],'priority':_0x515299++,'VoiceExtensionId':_0x5ca6ab['id']},{'type':_0x2e9c('0x12'),'app':_0x2e9c('0x4'),'appdata':_0x2e9c('0x13')+_0x5ca6ab['id'],'context':_0x5ca6ab[_0x2e9c('0x6')],'exten':_0x5ca6ab['exten'],'priority':_0x515299++,'VoiceExtensionId':_0x5ca6ab['id']},{'type':_0x2e9c('0x12'),'app':_0x2e9c('0x14'),'appdata':_0x2e9c('0x15')+(_0x515299+0x2)+_0x2e9c('0x16')+(_0x515299+0x1)+')','context':_0x5ca6ab['context'],'exten':_0x5ca6ab[_0x2e9c('0x7')],'priority':_0x515299++,'VoiceExtensionId':_0x5ca6ab['id']},{'type':'outbound','app':_0x2e9c('0x4'),'appdata':_0x5ca6ab[_0x2e9c('0xf')]?_0x2e9c('0x17')+_0x5ca6ab[_0x2e9c('0xf')]+'}':_0x2e9c('0x18'),'context':_0x5ca6ab['context'],'exten':_0x5ca6ab[_0x2e9c('0x7')],'priority':_0x515299++,'VoiceExtensionId':_0x5ca6ab['id']},{'type':'outbound','app':_0x2e9c('0x4'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x5ca6ab[_0x2e9c('0x6')],'exten':_0x5ca6ab[_0x2e9c('0x7')],'priority':_0x515299++,'VoiceExtensionId':_0x5ca6ab['id']},{'type':_0x2e9c('0x12'),'app':_0x2e9c('0x4'),'appdata':_0x2e9c('0xb'),'context':_0x5ca6ab[_0x2e9c('0x6')],'exten':_0x5ca6ab[_0x2e9c('0x7')],'priority':_0x515299++,'VoiceExtensionId':_0x5ca6ab['id']},{'type':_0x2e9c('0x12'),'app':_0x2e9c('0x4'),'appdata':_0x2e9c('0xc'),'context':_0x5ca6ab['context'],'exten':_0x5ca6ab[_0x2e9c('0x7')],'priority':_0x515299++,'VoiceExtensionId':_0x5ca6ab['id']},{'type':_0x2e9c('0x12'),'app':_0x2e9c('0x4'),'appdata':_0x2e9c('0x19')+_0x5ca6ab['id'],'context':_0x5ca6ab[_0x2e9c('0x6')],'exten':_0x5ca6ab[_0x2e9c('0x7')],'priority':_0x515299++,'VoiceExtensionId':_0x5ca6ab['id']}];if(_0x5ca6ab['hasOwnProperty'](_0x2e9c('0x1a'))&&_0x5ca6ab['recordingFormat']!==_0x2e9c('0x1b')){_0x32d579[_0x2e9c('0x9')]({'type':_0x2e9c('0x12'),'app':_0x2e9c('0x4'),'appdata':_0x2e9c('0x1c'),'context':_0x5ca6ab[_0x2e9c('0x6')],'exten':_0x5ca6ab[_0x2e9c('0x7')],'priority':_0x515299++,'VoiceExtensionId':_0x5ca6ab['id']},{'type':'outbound','app':_0x2e9c('0x4'),'appdata':_0x2e9c('0x1d')+_0x5ca6ab[_0x2e9c('0x1a')]||_0x2e9c('0x1e'),'context':_0x5ca6ab[_0x2e9c('0x6')],'exten':_0x5ca6ab['exten'],'priority':_0x515299++,'VoiceExtensionId':_0x5ca6ab['id']});}return _0x32d579;}function _0x46845d(_0x5f591e,_0x411170){var _0x2f8547=[{'name':_0x2e9c('0x1f'),'param':0x0},{'name':'timeout','param':0x1},{'name':_0x2e9c('0x20'),'param':0x2},{'name':_0x2e9c('0x21'),'param':0x3}];var _0x4e5ea7={};var _0x1b9d16=_0x411170[_0x2e9c('0x22')](',');var _0x150247=[];for(var _0x2d4e0e=0x0;_0x2d4e0e<_0x2f8547[_0x2e9c('0x23')];_0x2d4e0e++){switch(_0x2f8547[_0x2d4e0e][_0x2e9c('0x24')]){case _0x2e9c('0x1f'):_0x4e5ea7[_0x2e9c('0x1f')]=_0x1b9d16[_0x2f8547[_0x2d4e0e][_0x2e9c('0x25')]][_0x2e9c('0x22')]('/')[0x1];_0x4e5ea7[_0x2e9c('0x26')]=_0x1b9d16[_0x2f8547[_0x2d4e0e][_0x2e9c('0x25')]][_0x2e9c('0x22')]('/')[0x2];_0x4e5ea7[_0x2e9c('0x27')]=_0x4e5ea7['phone']?_0x4e5ea7[_0x2e9c('0x26')][_0x2e9c('0x22')]('$')[0x0]:undefined;_0x4e5ea7[_0x2e9c('0x26')]=_0x5f591e[_0x2e9c('0xf')]?(_0x4e5ea7[_0x2e9c('0x27')]||'')+_0x2e9c('0x10')+_0x5f591e['cutdigits']+'}':(_0x4e5ea7['prefix']||'')+_0x2e9c('0x11');_0x150247[_0x2f8547[_0x2d4e0e]['param']]=['SIP',_0x4e5ea7['trunk'],_0x4e5ea7[_0x2e9c('0x26')]][_0x2e9c('0x28')]('/');break;case _0x2e9c('0x20'):_0x4e5ea7[_0x2e9c('0x20')]=_0x1b9d16[_0x2f8547[_0x2d4e0e][_0x2e9c('0x25')]];if(_0x5f591e[_0x2e9c('0x1a')]!==_0x2e9c('0x1b')){if(_0x4e5ea7[_0x2e9c('0x20')][_0x2e9c('0x29')](_0x2e9c('0x2a'))<0x0){_0x4e5ea7[_0x2e9c('0x20')]+=_0x2e9c('0x2a');}}else{_0x4e5ea7[_0x2e9c('0x20')]=_0x4e5ea7['options'][_0x2e9c('0x2b')]('U(xcally-mixmonitor-context)','');}_0x150247[_0x2f8547[_0x2d4e0e][_0x2e9c('0x25')]]=_0x4e5ea7[_0x2e9c('0x20')];break;default:_0x150247[_0x2f8547[_0x2d4e0e][_0x2e9c('0x25')]]=_0x1b9d16[_0x2f8547[_0x2d4e0e]['param']];}}return _0x150247[_0x2e9c('0x28')](',');}function _0x33b715(_0x29b367,_0x58fbb3,_0x2424f3){return new Promise(function(_0x4940c6,_0x9d0415){var _0x632d89=[];if(_[_0x2e9c('0x2c')](_0x58fbb3))return _0x4940c6(_0x632d89);_0x40109d[_0x2e9c('0x2d')][_0x2e9c('0x2e')]({'attributes':['id',_0x2e9c('0x2f'),'IntervalId'],'raw':!![]})[_0x2e9c('0x30')](function(_0x4bdf1e){for(var _0x1670bb=0x0,_0x46931d=0x0;_0x1670bb<_0x58fbb3[_0x2e9c('0x23')];_0x1670bb++,_0x46931d=0x0){var _0xa71056=_0x58fbb3[_0x1670bb];var _0x277ae1=[];var _0x54db0d=[];delete _0xa71056['id'];if(_0xa71056[_0x2e9c('0x2f')]!==_0x2e9c('0x31')){_0xa71056[_0x2e9c('0x32')]=[_0xa71056[_0x2e9c('0x2f')]];}else{_0xa71056[_0x2e9c('0x32')]=_0xa71056[_0x2e9c('0x33')]?_[_0x2e9c('0x34')](_[_0x2e9c('0x35')](_0x4bdf1e,{'IntervalId':_0xa71056[_0x2e9c('0x33')]}),'interval'):[];}_0xa71056['context']=_0x29b367[_0x2e9c('0x6')];_0xa71056[_0x2e9c('0x7')]=_0x29b367[_0x2e9c('0x7')];if(_0xa71056[_0x2e9c('0x3')])_0xa71056[_0x2e9c('0x3')]=_0xa71056[_0x2e9c('0x3')][_0x2e9c('0x36')]();if(_0x29b367[_0x2e9c('0x3')]===_0x2e9c('0x12')){if(_0xa71056[_0x2e9c('0x37')](_0x2e9c('0x38'))&&_0xa71056[_0x2e9c('0x38')]&&_0xa71056[_0x2e9c('0x38')]!=='--'){_0x277ae1[_0x2e9c('0x9')]({'type':_0xa71056['type'][_0x2e9c('0x36')](),'app':'Set','appdata':_0x2e9c('0x39')+_0xa71056[_0x2e9c('0x38')],'context':_0x29b367[_0x2e9c('0x6')],'exten':_0x29b367[_0x2e9c('0x7')],'priority':_0xa71056[_0x2e9c('0x32')][_0x2e9c('0x23')]+_0x2424f3+_0x46931d++,'VoiceExtensionId':_0x29b367['id']});}_0x277ae1[_0x2e9c('0x9')]({'type':_0xa71056[_0x2e9c('0x3')][_0x2e9c('0x36')](),'app':_0x2e9c('0x14'),'appdata':_0x2e9c('0x3a')+(_0xa71056[_0x2e9c('0x3b')]?_0x2e9c('0x3c')+_0xa71056[_0x2e9c('0x3b')]+')':'NoOp(No\x20number\x20available)'),'context':_0x29b367[_0x2e9c('0x6')],'exten':_0x29b367['exten'],'priority':_0xa71056[_0x2e9c('0x32')][_0x2e9c('0x23')]+_0x2424f3+_0x46931d++,'VoiceExtensionId':_0x29b367['id']});}else{if(_0xa71056[_0x2e9c('0x37')]('answer')){if([_0x2e9c('0x3d'),'playback'][_0x2e9c('0x3e')](_0xa71056[_0x2e9c('0x3f')][_0x2e9c('0x36')]())&&_0xa71056[_0x2e9c('0x40')]!=='custom'){if(_0xa71056[_0x2e9c('0x41')]){_0x277ae1[_0x2e9c('0x9')]({'type':_0xa71056['type']['toLowerCase'](),'app':_0x2e9c('0x14'),'appdata':_0x2e9c('0x42'),'context':_0x29b367[_0x2e9c('0x6')],'exten':_0x29b367[_0x2e9c('0x7')],'priority':_0xa71056['intervals'][_0x2e9c('0x23')]+_0x2424f3+_0x46931d++,'VoiceExtensionId':_0x29b367['id']});_0x277ae1['push']({'type':_0xa71056['type'][_0x2e9c('0x36')](),'app':_0x2e9c('0x4'),'appdata':_0x2e9c('0x43'),'context':_0x29b367['context'],'exten':_0x29b367[_0x2e9c('0x7')],'priority':_0xa71056[_0x2e9c('0x32')][_0x2e9c('0x23')]+_0x2424f3+_0x46931d++,'VoiceExtensionId':_0x29b367['id']});}else{_0x277ae1[_0x2e9c('0x9')]({'type':_0xa71056[_0x2e9c('0x3')][_0x2e9c('0x36')](),'app':_0x2e9c('0x14'),'appdata':_0x2e9c('0x44'),'context':_0x29b367[_0x2e9c('0x6')],'exten':_0x29b367[_0x2e9c('0x7')],'priority':_0xa71056[_0x2e9c('0x32')]['length']+_0x2424f3+_0x46931d++,'VoiceExtensionId':_0x29b367['id']});_0x277ae1[_0x2e9c('0x9')]({'type':_0xa71056[_0x2e9c('0x3')][_0x2e9c('0x36')](),'app':_0x2e9c('0x4'),'appdata':_0x2e9c('0x45'),'context':_0x29b367[_0x2e9c('0x6')],'exten':_0x29b367[_0x2e9c('0x7')],'priority':_0xa71056['intervals'][_0x2e9c('0x23')]+_0x2424f3+_0x46931d++,'VoiceExtensionId':_0x29b367['id']});}}}}for(var _0x16d84d=0x0;_0x16d84d<_0xa71056[_0x2e9c('0x32')][_0x2e9c('0x23')];_0x16d84d++){var _0x392e4f=_0x2424f3+_0xa71056['intervals'][_0x2e9c('0x23')];var _0x477a49=_0x16d84d===_0xa71056['intervals'][_0x2e9c('0x23')]-0x1?_0x2424f3+_0x277ae1[_0x2e9c('0x23')]+_0x54db0d[_0x2e9c('0x23')]+0x2:_0x2424f3+_0x16d84d+0x1;_0x277ae1[_0x2e9c('0x46')](_0x16d84d,0x0,{'type':_0x29b367['type'],'app':'GotoIfTime','appdata':_0xa71056[_0x2e9c('0x32')][_0x16d84d]+'?'+_0x29b367[_0x2e9c('0x6')]+_0x2e9c('0x47')+_0x392e4f+':'+_0x29b367[_0x2e9c('0x6')]+',${EXTEN},'+_0x477a49,'exten':_0x29b367[_0x2e9c('0x7')],'context':_0x29b367[_0x2e9c('0x6')],'priority':_0x2424f3+_0x16d84d,'VoiceExtensionId':_0x29b367['id']});}if(_0xa71056['appType']===_0x2e9c('0x48')){_0xa71056[_0x2e9c('0x49')]=_0x46845d(_0x29b367,_0xa71056[_0x2e9c('0x49')]);}if(_0xa71056[_0x2e9c('0x40')]===_0x2e9c('0x4a')){_0x277ae1[_0x2e9c('0x9')]({'type':_0xa71056[_0x2e9c('0x3')]['toLowerCase'](),'app':_0x2e9c('0x4'),'appdata':_0x2e9c('0x4b'),'context':_0x29b367['context'],'exten':_0x29b367[_0x2e9c('0x7')],'priority':_0xa71056[_0x2e9c('0x32')][_0x2e9c('0x23')]+_0x2424f3+_0x46931d++,'VoiceExtensionId':_0x29b367['id']});}_0xa71056['priority']=_0x277ae1[_0x2e9c('0x23')]?_['last'](_0x277ae1)[_0x2e9c('0x4c')]+0x1:_0x2424f3;_0x632d89=_[_0x2e9c('0x4d')](_0x632d89,_0x277ae1,[_0xa71056],_0x54db0d);_0x2424f3=_[_0x2e9c('0x4e')](_0x632d89)[_0x2e9c('0x4c')]+0x1;}return _0x4940c6(_0x632d89);})[_0x2e9c('0x4f')](function(_0x4c62d3){_0x9d0415(_0x4c62d3);});});}return _0x1b5446[_0x2e9c('0x50')](_0x2e9c('0x51'),attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x5ad069){var _0x164ab9=this['get']({'plain':!![]});var _0xd3569f=_0x164ab9[_0x2e9c('0x3')]===_0x2e9c('0x12')?_0x14d386(_0x164ab9):_0x116ab3(_0x164ab9);return _0x33b715(_0x164ab9,_0x5ad069,_[_0x2e9c('0x4e')](_0xd3569f)[_0x2e9c('0x4c')]+0x1)[_0x2e9c('0x30')](function(_0x4d1c9b){var _0x20f5b7=_[_0x2e9c('0x4d')](_0xd3569f,_0x4d1c9b);_0x20f5b7[_0x2e9c('0x9')]({'type':_0x164ab9[_0x2e9c('0x3')],'app':'Hangup','exten':_0x164ab9[_0x2e9c('0x7')],'context':_0x164ab9['context'],'priority':_[_0x2e9c('0x4e')](_0x20f5b7)['priority']+0x1,'VoiceExtensionId':_0x164ab9['id']});return _0x20f5b7;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index 2a580e0..218f1d5 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 _0xfafd=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','request','then','info','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceExtension,\x20%s,\x20%s','message','result','catch','GetVoiceExtension','VoiceExtension','findAll','options','where','attributes','limit','include','map','model','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x5c619e,_0x1bccdf){var _0x445cf8=function(_0x2eaa64){while(--_0x2eaa64){_0x5c619e['push'](_0x5c619e['shift']());}};_0x445cf8(++_0x1bccdf);}(_0xfafd,0xcc));var _0xdfaf=function(_0x206240,_0x2e20ac){_0x206240=_0x206240-0x0;var _0x16b84c=_0xfafd[_0x206240];return _0x16b84c;};'use strict';var _=require('lodash');var util=require(_0xdfaf('0x0'));var moment=require(_0xdfaf('0x1'));var BPromise=require(_0xdfaf('0x2'));var rs=require(_0xdfaf('0x3'));var fs=require('fs');var Redis=require(_0xdfaf('0x4'));var db=require(_0xdfaf('0x5'))['db'];var utils=require(_0xdfaf('0x6'));var logger=require(_0xdfaf('0x7'))(_0xdfaf('0x8'));var config=require(_0xdfaf('0x9'));var jayson=require(_0xdfaf('0xa'));var client=jayson[_0xdfaf('0xb')][_0xdfaf('0xc')]({'port':0x232a});config[_0xdfaf('0xd')]=_[_0xdfaf('0xe')](config['redis'],{'host':_0xdfaf('0xf'),'port':0x18eb});var socket=require(_0xdfaf('0x10'))(new Redis(config[_0xdfaf('0xd')]));require(_0xdfaf('0x11'))[_0xdfaf('0x12')](socket);function respondWithRpcPromise(_0x23712a,_0x466923,_0x26fd47){return new BPromise(function(_0x5092d6,_0x3747ce){return client[_0xdfaf('0x13')](_0x23712a,_0x26fd47)[_0xdfaf('0x14')](function(_0x42ea9f){logger[_0xdfaf('0x15')]('VoiceExtension,\x20%s,\x20%s',_0x466923,_0xdfaf('0x16'));logger[_0xdfaf('0x17')](_0xdfaf('0x18'),_0x466923,_0xdfaf('0x16'),JSON[_0xdfaf('0x19')](_0x42ea9f));if(_0x42ea9f[_0xdfaf('0x1a')]){if(_0x42ea9f[_0xdfaf('0x1a')][_0xdfaf('0x1b')]===0x1f4){logger[_0xdfaf('0x1a')](_0xdfaf('0x1c'),_0x466923,_0x42ea9f['error'][_0xdfaf('0x1d')]);return _0x3747ce(_0x42ea9f[_0xdfaf('0x1a')][_0xdfaf('0x1d')]);}logger['error'](_0xdfaf('0x1c'),_0x466923,_0x42ea9f[_0xdfaf('0x1a')][_0xdfaf('0x1d')]);return _0x5092d6(_0x42ea9f['error']['message']);}else{logger[_0xdfaf('0x15')]('VoiceExtension,\x20%s,\x20%s',_0x466923,'request\x20sent');_0x5092d6(_0x42ea9f[_0xdfaf('0x1e')][_0xdfaf('0x1d')]);}})[_0xdfaf('0x1f')](function(_0x120e5d){logger[_0xdfaf('0x1a')](_0xdfaf('0x1c'),_0x466923,_0x120e5d);_0x3747ce(_0x120e5d);});});}exports[_0xdfaf('0x20')]=function(_0x1a5f5f){var _0x133918=this;return new Promise(function(_0x15987e,_0x58b3a8){return db[_0xdfaf('0x21')][_0xdfaf('0x22')]({'raw':_0x1a5f5f[_0xdfaf('0x23')]?_0x1a5f5f['options']['raw']===undefined?!![]:![]:!![],'where':_0x1a5f5f[_0xdfaf('0x23')]?_0x1a5f5f[_0xdfaf('0x23')][_0xdfaf('0x24')]||null:null,'attributes':_0x1a5f5f['options']?_0x1a5f5f[_0xdfaf('0x23')][_0xdfaf('0x25')]||null:null,'limit':_0x1a5f5f[_0xdfaf('0x23')]?_0x1a5f5f['options'][_0xdfaf('0x26')]||null:null,'include':_0x1a5f5f['options']?_0x1a5f5f[_0xdfaf('0x23')][_0xdfaf('0x27')]?_[_0xdfaf('0x28')](_0x1a5f5f[_0xdfaf('0x23')]['include'],function(_0x215f06){return{'model':db[_0x215f06[_0xdfaf('0x29')]],'as':_0x215f06['as'],'attributes':_0x215f06['attributes'],'include':_0x215f06[_0xdfaf('0x27')]?_['map'](_0x215f06[_0xdfaf('0x27')],function(_0xc87a12){return{'model':db[_0xc87a12[_0xdfaf('0x29')]],'as':_0xc87a12['as'],'attributes':_0xc87a12['attributes'],'include':_0xc87a12[_0xdfaf('0x27')]?_[_0xdfaf('0x28')](_0xc87a12[_0xdfaf('0x27')],function(_0x30f1ec){return{'model':db[_0x30f1ec[_0xdfaf('0x29')]],'as':_0x30f1ec['as'],'attributes':_0x30f1ec[_0xdfaf('0x25')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3404e1){logger[_0xdfaf('0x15')](_0xdfaf('0x20'),_0x1a5f5f);logger[_0xdfaf('0x17')]('GetVoiceExtension',_0x1a5f5f,JSON[_0xdfaf('0x19')](_0x3404e1));_0x15987e(_0x3404e1);})[_0xdfaf('0x1f')](function(_0x531fb4){logger[_0xdfaf('0x1a')](_0xdfaf('0x20'),_0x531fb4['message'],_0x1a5f5f);_0x58b3a8(_0x133918[_0xdfaf('0x1a')](0x1f4,_0x531fb4[_0xdfaf('0x1d')]));});});}; \ No newline at end of file +var _0xa751=['model','map','stringify','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','register','request','then','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','error','code','VoiceExtension,\x20%s,\x20%s','message','info','result','catch','GetVoiceExtension','VoiceExtension','findAll','options','raw','attributes','include'];(function(_0x616290,_0x280b7f){var _0x453879=function(_0x27bda7){while(--_0x27bda7){_0x616290['push'](_0x616290['shift']());}};_0x453879(++_0x280b7f);}(_0xa751,0x175));var _0x1a75=function(_0x5c1a85,_0x2685dd){_0x5c1a85=_0x5c1a85-0x0;var _0x761e71=_0xa751[_0x5c1a85];return _0x761e71;};'use strict';var _=require(_0x1a75('0x0'));var util=require(_0x1a75('0x1'));var moment=require(_0x1a75('0x2'));var BPromise=require(_0x1a75('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1a75('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1a75('0x5'));var logger=require(_0x1a75('0x6'))(_0x1a75('0x7'));var config=require('../../config/environment');var jayson=require(_0x1a75('0x8'));var client=jayson[_0x1a75('0x9')][_0x1a75('0xa')]({'port':0x232a});config[_0x1a75('0xb')]=_[_0x1a75('0xc')](config[_0x1a75('0xb')],{'host':_0x1a75('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./voiceExtension.socket')[_0x1a75('0xe')](socket);function respondWithRpcPromise(_0x377b3b,_0x1d7819,_0x271286){return new BPromise(function(_0x15b4cc,_0xd150fc){return client[_0x1a75('0xf')](_0x377b3b,_0x271286)[_0x1a75('0x10')](function(_0x5b615f){logger['info']('VoiceExtension,\x20%s,\x20%s',_0x1d7819,_0x1a75('0x11'));logger[_0x1a75('0x12')](_0x1a75('0x13'),_0x1d7819,_0x1a75('0x11'),JSON['stringify'](_0x5b615f));if(_0x5b615f['error']){if(_0x5b615f[_0x1a75('0x14')][_0x1a75('0x15')]===0x1f4){logger['error'](_0x1a75('0x16'),_0x1d7819,_0x5b615f[_0x1a75('0x14')]['message']);return _0xd150fc(_0x5b615f[_0x1a75('0x14')][_0x1a75('0x17')]);}logger[_0x1a75('0x14')]('VoiceExtension,\x20%s,\x20%s',_0x1d7819,_0x5b615f['error']['message']);return _0x15b4cc(_0x5b615f[_0x1a75('0x14')][_0x1a75('0x17')]);}else{logger[_0x1a75('0x18')](_0x1a75('0x16'),_0x1d7819,_0x1a75('0x11'));_0x15b4cc(_0x5b615f[_0x1a75('0x19')]['message']);}})[_0x1a75('0x1a')](function(_0x490e1f){logger['error'](_0x1a75('0x16'),_0x1d7819,_0x490e1f);_0xd150fc(_0x490e1f);});});}exports[_0x1a75('0x1b')]=function(_0x5ae0f4){var _0x42d283=this;return new Promise(function(_0x4d877c,_0x4699c9){return db[_0x1a75('0x1c')][_0x1a75('0x1d')]({'raw':_0x5ae0f4[_0x1a75('0x1e')]?_0x5ae0f4[_0x1a75('0x1e')][_0x1a75('0x1f')]===undefined?!![]:![]:!![],'where':_0x5ae0f4['options']?_0x5ae0f4[_0x1a75('0x1e')]['where']||null:null,'attributes':_0x5ae0f4[_0x1a75('0x1e')]?_0x5ae0f4[_0x1a75('0x1e')][_0x1a75('0x20')]||null:null,'limit':_0x5ae0f4['options']?_0x5ae0f4[_0x1a75('0x1e')]['limit']||null:null,'include':_0x5ae0f4[_0x1a75('0x1e')]?_0x5ae0f4[_0x1a75('0x1e')][_0x1a75('0x21')]?_['map'](_0x5ae0f4[_0x1a75('0x1e')][_0x1a75('0x21')],function(_0x4dec82){return{'model':db[_0x4dec82[_0x1a75('0x22')]],'as':_0x4dec82['as'],'attributes':_0x4dec82[_0x1a75('0x20')],'include':_0x4dec82['include']?_[_0x1a75('0x23')](_0x4dec82[_0x1a75('0x21')],function(_0x34c106){return{'model':db[_0x34c106[_0x1a75('0x22')]],'as':_0x34c106['as'],'attributes':_0x34c106['attributes'],'include':_0x34c106[_0x1a75('0x21')]?_[_0x1a75('0x23')](_0x34c106[_0x1a75('0x21')],function(_0x2f5ac9){return{'model':db[_0x2f5ac9[_0x1a75('0x22')]],'as':_0x2f5ac9['as'],'attributes':_0x2f5ac9[_0x1a75('0x20')]};}):[]};}):[]};}):[]:[]})[_0x1a75('0x10')](function(_0x38e885){logger['info']('GetVoiceExtension',_0x5ae0f4);logger[_0x1a75('0x12')](_0x1a75('0x1b'),_0x5ae0f4,JSON[_0x1a75('0x24')](_0x38e885));_0x4d877c(_0x38e885);})[_0x1a75('0x1a')](function(_0x6f02dc){logger[_0x1a75('0x14')](_0x1a75('0x1b'),_0x6f02dc[_0x1a75('0x17')],_0x5ae0f4);_0x4699c9(_0x42d283['error'](0x1f4,_0x6f02dc['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index facb9d5..a9ee0db 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 _0x7a54=['remove','emit','removeListener','register','length','voiceExtension:','./voiceExtension.events','save'];(function(_0x5be19c,_0x3cbced){var _0x287e7d=function(_0x310f65){while(--_0x310f65){_0x5be19c['push'](_0x5be19c['shift']());}};_0x287e7d(++_0x3cbced);}(_0x7a54,0x106));var _0x47a5=function(_0x173825,_0x8dd6ae){_0x173825=_0x173825-0x0;var _0x1ed925=_0x7a54[_0x173825];return _0x1ed925;};'use strict';var VoiceExtensionEvents=require(_0x47a5('0x0'));var events=[_0x47a5('0x1'),_0x47a5('0x2'),'update'];function createListener(_0x1d33e,_0x4086cd){return function(_0x4880bf){_0x4086cd[_0x47a5('0x3')](_0x1d33e,_0x4880bf);};}function removeListener(_0x11bf85,_0x2a1a7e){return function(){VoiceExtensionEvents[_0x47a5('0x4')](_0x11bf85,_0x2a1a7e);};}exports[_0x47a5('0x5')]=function(_0x545a97){for(var _0x3d5629=0x0,_0x59199c=events[_0x47a5('0x6')];_0x3d5629<_0x59199c;_0x3d5629++){var _0x30e405=events[_0x3d5629];var _0x506eda=createListener(_0x47a5('0x7')+_0x30e405,_0x545a97);VoiceExtensionEvents['on'](_0x30e405,_0x506eda);}}; \ No newline at end of file +var _0x1cb9=['update','emit','removeListener','register','length','./voiceExtension.events','remove'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0x1cb9,0x14e));var _0x91cb=function(_0x2af0f7,_0x3d31f7){_0x2af0f7=_0x2af0f7-0x0;var _0x4c48ca=_0x1cb9[_0x2af0f7];return _0x4c48ca;};'use strict';var VoiceExtensionEvents=require(_0x91cb('0x0'));var events=['save',_0x91cb('0x1'),_0x91cb('0x2')];function createListener(_0x2b1894,_0x351bdb){return function(_0x57ea48){_0x351bdb[_0x91cb('0x3')](_0x2b1894,_0x57ea48);};}function removeListener(_0x2b7314,_0x5652cd){return function(){VoiceExtensionEvents[_0x91cb('0x4')](_0x2b7314,_0x5652cd);};}exports[_0x91cb('0x5')]=function(_0x186dc3){for(var _0x28543e=0x0,_0x3b9d98=events[_0x91cb('0x6')];_0x28543e<_0x3b9d98;_0x28543e++){var _0x4c1f56=events[_0x28543e];var _0x15c517=createListener('voiceExtension:'+_0x4c1f56,_0x186dc3);VoiceExtensionEvents['on'](_0x4c1f56,_0x15c517);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index f7a4e19..796f892 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 _0xcaf2=['create','put','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/interaction/service','./voiceMail.controller','get','isAuthenticated','/:id','show','/:id/messages','getMessages','post'];(function(_0x326643,_0x1b91b9){var _0x1fc74c=function(_0xf1a8d7){while(--_0xf1a8d7){_0x326643['push'](_0x326643['shift']());}};_0x1fc74c(++_0x1b91b9);}(_0xcaf2,0x8a));var _0x2caf=function(_0x2d719c,_0x59b346){_0x2d719c=_0x2d719c-0x0;var _0x16c7e8=_0xcaf2[_0x2d719c];return _0x16c7e8;};'use strict';var multer=require(_0x2caf('0x0'));var util=require('util');var path=require(_0x2caf('0x1'));var timeout=require(_0x2caf('0x2'));var express=require('express');var router=express[_0x2caf('0x3')]();var fs_extra=require(_0x2caf('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2caf('0x5'));var config=require('../../config/environment');var controller=require(_0x2caf('0x6'));router[_0x2caf('0x7')]('/',auth[_0x2caf('0x8')](),controller['index']);router[_0x2caf('0x7')](_0x2caf('0x9'),auth[_0x2caf('0x8')](),controller[_0x2caf('0xa')]);router['get'](_0x2caf('0xb'),auth[_0x2caf('0x8')](),controller[_0x2caf('0xc')]);router[_0x2caf('0xd')]('/',auth[_0x2caf('0x8')](),controller[_0x2caf('0xe')]);router[_0x2caf('0xf')](_0x2caf('0x9'),auth[_0x2caf('0x8')](),controller['update']);router[_0x2caf('0x10')](_0x2caf('0x9'),auth[_0x2caf('0x8')](),controller[_0x2caf('0x11')]);module[_0x2caf('0x12')]=router; \ No newline at end of file +var _0x7bd0=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceMail.controller','get','isAuthenticated','index','/:id','show','/:id/messages','getMessages','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x2b5526,_0x2fd2e0){var _0xb05466=function(_0x5e7afe){while(--_0x5e7afe){_0x2b5526['push'](_0x2b5526['shift']());}};_0xb05466(++_0x2fd2e0);}(_0x7bd0,0x111));var _0x07bd=function(_0x29d915,_0x54a040){_0x29d915=_0x29d915-0x0;var _0x160f86=_0x7bd0[_0x29d915];return _0x160f86;};'use strict';var multer=require(_0x07bd('0x0'));var util=require(_0x07bd('0x1'));var path=require(_0x07bd('0x2'));var timeout=require(_0x07bd('0x3'));var express=require(_0x07bd('0x4'));var router=express[_0x07bd('0x5')]();var fs_extra=require(_0x07bd('0x6'));var auth=require(_0x07bd('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x07bd('0x8'));var controller=require(_0x07bd('0x9'));router[_0x07bd('0xa')]('/',auth[_0x07bd('0xb')](),controller[_0x07bd('0xc')]);router[_0x07bd('0xa')](_0x07bd('0xd'),auth['isAuthenticated'](),controller[_0x07bd('0xe')]);router['get'](_0x07bd('0xf'),auth[_0x07bd('0xb')](),controller[_0x07bd('0x10')]);router['post']('/',auth[_0x07bd('0xb')](),controller[_0x07bd('0x11')]);router[_0x07bd('0x12')](_0x07bd('0xd'),auth['isAuthenticated'](),controller[_0x07bd('0x13')]);router[_0x07bd('0x14')](_0x07bd('0xd'),auth[_0x07bd('0xb')](),controller[_0x07bd('0x15')]);module[_0x07bd('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index 250c6f6..273d43f 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 _0x0f97=['setDataValue','email','string','trim','central','ENUM','yes','TINYINT(4)','TIMESTAMP','VIRTUAL','getDataValue','fullname','\x20-\x20','mailbox','sequelize','STRING','from-voicemail','contest_mailbox'];(function(_0x50e7e5,_0x545880){var _0x2f46d8=function(_0x326371){while(--_0x326371){_0x50e7e5['push'](_0x50e7e5['shift']());}};_0x2f46d8(++_0x545880);}(_0x0f97,0x8c));var _0x70f9=function(_0x4c32f5,_0x3dbbf1){_0x4c32f5=_0x4c32f5-0x0;var _0x19cae9=_0x0f97[_0x4c32f5];return _0x19cae9;};'use strict';var Sequelize=require(_0x70f9('0x0'));module['exports']={'customer_id':{'type':Sequelize[_0x70f9('0x1')]},'context':{'type':Sequelize[_0x70f9('0x1')],'defaultValue':_0x70f9('0x2'),'unique':_0x70f9('0x3')},'mailbox':{'type':Sequelize[_0x70f9('0x1')],'defaultValue':'','allowNull':![],'unique':_0x70f9('0x3')},'password':{'type':Sequelize[_0x70f9('0x1')]},'fullname':{'type':Sequelize[_0x70f9('0x1')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]},'set':function(_0x208656){this[_0x70f9('0x4')](_0x70f9('0x5'),typeof _0x208656===_0x70f9('0x6')&&_0x208656[_0x70f9('0x7')]()?_0x208656[_0x70f9('0x7')]():null);}},'pager':{'type':Sequelize[_0x70f9('0x1')]},'tz':{'type':Sequelize[_0x70f9('0x1')],'defaultValue':_0x70f9('0x8')},'attach':{'type':Sequelize[_0x70f9('0x9')](_0x70f9('0xa'),'no'),'defaultValue':_0x70f9('0xa'),'allowNull':![]},'saycid':{'type':Sequelize[_0x70f9('0x9')]('yes','no'),'defaultValue':_0x70f9('0xa'),'allowNull':![]},'dialout':{'type':Sequelize[_0x70f9('0x1')]},'callback':{'type':Sequelize[_0x70f9('0x1')]},'review':{'type':Sequelize['ENUM'](_0x70f9('0xa'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x70f9('0x9')](_0x70f9('0xa'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM'](_0x70f9('0xa'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x70f9('0x9')](_0x70f9('0xa'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x70f9('0xb'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x70f9('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x70f9('0x9')](_0x70f9('0xa'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x70f9('0x9')](_0x70f9('0xa'),'no'),'defaultValue':_0x70f9('0xa'),'allowNull':![]},'forcename':{'type':Sequelize[_0x70f9('0x9')](_0x70f9('0xa'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x70f9('0x9')](_0x70f9('0xa'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x70f9('0x9')]('yes','no'),'defaultValue':_0x70f9('0xa'),'allowNull':![]},'stamp':{'type':_0x70f9('0xc')},'emailsubject':{'type':Sequelize['STRING']},'emailbody':{'type':Sequelize['STRING']},'maxsecs':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x70f9('0xd')],'get':function(){return this[_0x70f9('0xe')](_0x70f9('0xf'))+_0x70f9('0x10')+this[_0x70f9('0xe')](_0x70f9('0x11'));}}}; \ No newline at end of file +var _0x7162=['sequelize','exports','STRING','from-voicemail','contest_mailbox','setDataValue','email','string','trim','central','yes','ENUM','TINYINT(4)','INTEGER','VIRTUAL','getDataValue','\x20-\x20','mailbox'];(function(_0x25ee21,_0x2039f8){var _0x15b7cd=function(_0x56b849){while(--_0x56b849){_0x25ee21['push'](_0x25ee21['shift']());}};_0x15b7cd(++_0x2039f8);}(_0x7162,0x7e));var _0x2716=function(_0x31a7b5,_0x307d8a){_0x31a7b5=_0x31a7b5-0x0;var _0x3ed7c5=_0x7162[_0x31a7b5];return _0x3ed7c5;};'use strict';var Sequelize=require(_0x2716('0x0'));module[_0x2716('0x1')]={'customer_id':{'type':Sequelize[_0x2716('0x2')]},'context':{'type':Sequelize[_0x2716('0x2')],'defaultValue':_0x2716('0x3'),'unique':_0x2716('0x4')},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'','allowNull':![],'unique':_0x2716('0x4')},'password':{'type':Sequelize[_0x2716('0x2')]},'fullname':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]},'set':function(_0x171526){this[_0x2716('0x5')](_0x2716('0x6'),typeof _0x171526===_0x2716('0x7')&&_0x171526[_0x2716('0x8')]()?_0x171526[_0x2716('0x8')]():null);}},'pager':{'type':Sequelize['STRING']},'tz':{'type':Sequelize[_0x2716('0x2')],'defaultValue':_0x2716('0x9')},'attach':{'type':Sequelize['ENUM'](_0x2716('0xa'),'no'),'defaultValue':_0x2716('0xa'),'allowNull':![]},'saycid':{'type':Sequelize[_0x2716('0xb')](_0x2716('0xa'),'no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize[_0x2716('0x2')]},'callback':{'type':Sequelize[_0x2716('0x2')]},'review':{'type':Sequelize[_0x2716('0xb')](_0x2716('0xa'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x2716('0xb')](_0x2716('0xa'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x2716('0xb')](_0x2716('0xa'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize['ENUM'](_0x2716('0xa'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x2716('0xc'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x2716('0xb')](_0x2716('0xa'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x2716('0xb')](_0x2716('0xa'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x2716('0xb')]('yes','no'),'defaultValue':_0x2716('0xa'),'allowNull':![]},'forcename':{'type':Sequelize['ENUM'](_0x2716('0xa'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize['ENUM'](_0x2716('0xa'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x2716('0xb')](_0x2716('0xa'),'no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':'TIMESTAMP'},'emailsubject':{'type':Sequelize['STRING']},'emailbody':{'type':Sequelize[_0x2716('0x2')]},'maxsecs':{'type':Sequelize[_0x2716('0xd')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x2716('0xd')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x2716('0xe')],'get':function(){return this[_0x2716('0xf')]('fullname')+_0x2716('0x10')+this[_0x2716('0xf')](_0x2716('0x11'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index f250c05..4fb2220 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 _0x4cf8=['UserProfileResource','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','filters','pick','filter','where','merge','VIRTUAL','VoiceMail','include','findAll','catch','find','create','body','user','UserProfileSection','userProfileId','params','getMessages','findOne','VoiceMailMessage','mailbox','options','findAndCountAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Voicemails'];(function(_0x4d45c1,_0x2beda1){var _0x244478=function(_0x11304c){while(--_0x11304c){_0x4d45c1['push'](_0x4d45c1['shift']());}};_0x244478(++_0x2beda1);}(_0x4cf8,0x1e1));var _0x84cf=function(_0x21e034,_0x59fc14){_0x21e034=_0x21e034-0x0;var _0x1faab3=_0x4cf8[_0x21e034];return _0x1faab3;};'use strict';var emlformat=require(_0x84cf('0x0'));var rimraf=require(_0x84cf('0x1'));var zipdir=require(_0x84cf('0x2'));var jsonpatch=require(_0x84cf('0x3'));var rp=require(_0x84cf('0x4'));var moment=require(_0x84cf('0x5'));var BPromise=require(_0x84cf('0x6'));var Mustache=require(_0x84cf('0x7'));var util=require(_0x84cf('0x8'));var path=require(_0x84cf('0x9'));var sox=require(_0x84cf('0xa'));var csv=require(_0x84cf('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x84cf('0xc'));var squel=require('squel');var crypto=require(_0x84cf('0xd'));var jsforce=require(_0x84cf('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x84cf('0xb'));var querystring=require(_0x84cf('0xf'));var Papa=require('papaparse');var Redis=require(_0x84cf('0x10'));var authService=require(_0x84cf('0x11'));var qs=require(_0x84cf('0x12'));var as=require(_0x84cf('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x84cf('0x14'))(_0x84cf('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x84cf('0x16'));var db=require(_0x84cf('0x17'))['db'];function respondWithStatusCode(_0x35f852,_0x33f83e){_0x33f83e=_0x33f83e||0xcc;return function(_0x172d04){if(_0x172d04){return _0x35f852[_0x84cf('0x18')](_0x33f83e);}return _0x35f852[_0x84cf('0x19')](_0x33f83e)[_0x84cf('0x1a')]();};}function respondWithResult(_0xced48,_0x250a19){_0x250a19=_0x250a19||0xc8;return function(_0x2fc41f){if(_0x2fc41f){return _0xced48[_0x84cf('0x19')](_0x250a19)[_0x84cf('0x1b')](_0x2fc41f);}};}function respondWithFilteredResult(_0x20e79c,_0x27261b){return function(_0x167c3e){if(_0x167c3e){var _0x464e70=typeof _0x27261b[_0x84cf('0x1c')]===_0x84cf('0x1d')&&typeof _0x27261b['limit']===_0x84cf('0x1d');var _0x5d6a93=_0x167c3e[_0x84cf('0x1e')];var _0x1abe2d=_0x464e70?0x0:_0x27261b[_0x84cf('0x1c')];var _0x13ba16=_0x464e70?_0x167c3e[_0x84cf('0x1e')]:_0x27261b['offset']+_0x27261b['limit'];var _0x42d6d4;if(_0x13ba16>=_0x5d6a93){_0x13ba16=_0x5d6a93;_0x42d6d4=0xc8;}else{_0x42d6d4=0xce;}_0x20e79c[_0x84cf('0x19')](_0x42d6d4);return _0x20e79c[_0x84cf('0x1f')](_0x84cf('0x20'),_0x1abe2d+'-'+_0x13ba16+'/'+_0x5d6a93)[_0x84cf('0x1b')](_0x167c3e);}return null;};}function patchUpdates(_0x5dda3f){return function(_0x39a37b){try{jsonpatch[_0x84cf('0x21')](_0x39a37b,_0x5dda3f,!![]);}catch(_0x3ca1be){return BPromise[_0x84cf('0x22')](_0x3ca1be);}return _0x39a37b[_0x84cf('0x23')]();};}function saveUpdates(_0x54405a,_0x42fa45){return function(_0x160f86){if(_0x160f86){return _0x160f86[_0x84cf('0x24')](_0x54405a)[_0x84cf('0x25')](function(_0x3e5e94){return _0x3e5e94;});}return null;};}function removeEntity(_0x29e9e1,_0x7feb4){return function(_0x4c9d1c){if(_0x4c9d1c){return _0x4c9d1c[_0x84cf('0x26')]()[_0x84cf('0x25')](function(){var _0x1c7747=_0x4c9d1c[_0x84cf('0x27')]({'plain':!![]});var _0x1d220a=_0x84cf('0x28');return db[_0x84cf('0x29')][_0x84cf('0x26')]({'where':{'type':_0x1d220a,'resourceId':_0x1c7747['id']}})[_0x84cf('0x25')](function(){return _0x4c9d1c;});})[_0x84cf('0x25')](function(){_0x29e9e1['status'](0xcc)[_0x84cf('0x1a')]();});}};}function handleEntityNotFound(_0x17bc92,_0x2a4973){return function(_0x41a5db){if(!_0x41a5db){_0x17bc92['sendStatus'](0x194);}return _0x41a5db;};}function handleError(_0x1595dd,_0x5a428c){_0x5a428c=_0x5a428c||0x1f4;return function(_0x29455e){logger[_0x84cf('0x2a')](_0x29455e[_0x84cf('0x2b')]);if(_0x29455e[_0x84cf('0x2c')]){delete _0x29455e[_0x84cf('0x2c')];}_0x1595dd[_0x84cf('0x19')](_0x5a428c)[_0x84cf('0x2d')](_0x29455e);};}exports[_0x84cf('0x2e')]=function(_0x1bfa56,_0xb4fc5a){var _0x31dbf5={},_0x308f8f={},_0x18243d={'count':0x0,'rows':[]};var _0x44f16e=_['map'](db['VoiceMail'][_0x84cf('0x2f')],function(_0x25de3a){return{'name':_0x25de3a[_0x84cf('0x30')],'type':_0x25de3a[_0x84cf('0x31')][_0x84cf('0x32')]};});_0x308f8f[_0x84cf('0x33')]=_[_0x84cf('0x34')](_0x44f16e,_0x84cf('0x2c'));_0x308f8f['query']=_[_0x84cf('0x35')](_0x1bfa56[_0x84cf('0x36')]);_0x308f8f['filters']=_[_0x84cf('0x37')](_0x308f8f['model'],_0x308f8f[_0x84cf('0x36')]);_0x31dbf5[_0x84cf('0x38')]=_[_0x84cf('0x37')](_0x308f8f[_0x84cf('0x33')],qs[_0x84cf('0x39')](_0x1bfa56['query'][_0x84cf('0x39')]));_0x31dbf5['attributes']=_0x31dbf5['attributes'][_0x84cf('0x3a')]?_0x31dbf5[_0x84cf('0x38')]:_0x308f8f['model'];if(!_0x1bfa56[_0x84cf('0x36')][_0x84cf('0x3b')](_0x84cf('0x3c'))){_0x31dbf5[_0x84cf('0x3d')]=qs[_0x84cf('0x3d')](_0x1bfa56[_0x84cf('0x36')]['limit']);_0x31dbf5[_0x84cf('0x1c')]=qs[_0x84cf('0x1c')](_0x1bfa56[_0x84cf('0x36')][_0x84cf('0x1c')]);}_0x31dbf5[_0x84cf('0x3e')]=qs[_0x84cf('0x3f')](_0x1bfa56['query'][_0x84cf('0x3f')]);_0x31dbf5['where']=qs[_0x84cf('0x40')](_[_0x84cf('0x41')](_0x1bfa56[_0x84cf('0x36')],_0x308f8f[_0x84cf('0x40')]),_0x44f16e);if(_0x1bfa56[_0x84cf('0x36')][_0x84cf('0x42')]){_0x31dbf5[_0x84cf('0x43')]=_[_0x84cf('0x44')](_0x31dbf5[_0x84cf('0x43')],{'$or':_['map'](_0x44f16e,function(_0x44e6f0){if(_0x44e6f0['type']!==_0x84cf('0x45')){var _0xc75386={};_0xc75386[_0x44e6f0['name']]={'$like':'%'+_0x1bfa56[_0x84cf('0x36')]['filter']+'%'};return _0xc75386;}})});}_0x31dbf5=_[_0x84cf('0x44')]({},_0x31dbf5,_0x1bfa56['options']);var _0x3fc160={'where':_0x31dbf5['where']};return db[_0x84cf('0x46')][_0x84cf('0x1e')](_0x3fc160)['then'](function(_0x847ce9){_0x18243d[_0x84cf('0x1e')]=_0x847ce9;if(_0x1bfa56[_0x84cf('0x36')]['includeAll']){_0x31dbf5[_0x84cf('0x47')]=[{'all':!![]}];}return db['VoiceMail'][_0x84cf('0x48')](_0x31dbf5);})['then'](function(_0x56b0e5){_0x18243d['rows']=_0x56b0e5;return _0x18243d;})[_0x84cf('0x25')](respondWithFilteredResult(_0xb4fc5a,_0x31dbf5))[_0x84cf('0x49')](handleError(_0xb4fc5a,null));};exports['show']=function(_0x2b737e,_0x56b623){var _0x191ad8={'raw':!![],'where':{'id':_0x2b737e['params']['id']}},_0x3fe8c1={};_0x3fe8c1[_0x84cf('0x33')]=_['keys'](db[_0x84cf('0x46')]['rawAttributes']);_0x3fe8c1['query']=_['keys'](_0x2b737e['query']);_0x3fe8c1['filters']=_['intersection'](_0x3fe8c1['model'],_0x3fe8c1[_0x84cf('0x36')]);_0x191ad8[_0x84cf('0x38')]=_[_0x84cf('0x37')](_0x3fe8c1[_0x84cf('0x33')],qs['fields'](_0x2b737e[_0x84cf('0x36')]['fields']));_0x191ad8[_0x84cf('0x38')]=_0x191ad8[_0x84cf('0x38')][_0x84cf('0x3a')]?_0x191ad8[_0x84cf('0x38')]:_0x3fe8c1[_0x84cf('0x33')];if(_0x2b737e[_0x84cf('0x36')]['includeAll']){_0x191ad8[_0x84cf('0x47')]=[{'all':!![]}];}_0x191ad8=_[_0x84cf('0x44')]({},_0x191ad8,_0x2b737e['options']);return db[_0x84cf('0x46')][_0x84cf('0x4a')](_0x191ad8)[_0x84cf('0x25')](handleEntityNotFound(_0x56b623,null))['then'](respondWithResult(_0x56b623,null))['catch'](handleError(_0x56b623,null));};exports['create']=function(_0x1cf3f6,_0x104421){return db[_0x84cf('0x46')][_0x84cf('0x4b')](_0x1cf3f6[_0x84cf('0x4c')],{})[_0x84cf('0x25')](function(_0x51d725){var _0x350985=_0x1cf3f6['user'][_0x84cf('0x27')]({'plain':!![]});if(!_0x350985)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x350985['role']===_0x84cf('0x4d')){var _0xb1c3a8=_0x51d725[_0x84cf('0x27')]({'plain':!![]});var _0x55e24e='Voicemails';return db[_0x84cf('0x4e')][_0x84cf('0x4a')]({'where':{'name':_0x55e24e,'userProfileId':_0x350985[_0x84cf('0x4f')]},'raw':!![]})[_0x84cf('0x25')](function(_0x401ced){if(_0x401ced&&_0x401ced['autoAssociation']===0x0){return db[_0x84cf('0x29')][_0x84cf('0x4b')]({'name':_0xb1c3a8['name'],'resourceId':_0xb1c3a8['id'],'type':_0x401ced[_0x84cf('0x2c')],'sectionId':_0x401ced['id']},{})['then'](function(){return _0x51d725;});}else{return _0x51d725;}})['catch'](function(_0x147194){logger[_0x84cf('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x147194);throw _0x147194;});}return _0x51d725;})['then'](respondWithResult(_0x104421,0xc9))[_0x84cf('0x49')](handleError(_0x104421,null));};exports[_0x84cf('0x24')]=function(_0x2f739a,_0x1e2676){if(_0x2f739a[_0x84cf('0x4c')]['id']){delete _0x2f739a[_0x84cf('0x4c')]['id'];}return db[_0x84cf('0x46')][_0x84cf('0x4a')]({'where':{'id':_0x2f739a['params']['id']}})[_0x84cf('0x25')](handleEntityNotFound(_0x1e2676,null))[_0x84cf('0x25')](saveUpdates(_0x2f739a['body'],null))['then'](respondWithResult(_0x1e2676,null))[_0x84cf('0x49')](handleError(_0x1e2676,null));};exports[_0x84cf('0x26')]=function(_0x3912cb,_0x2a4f20){return db[_0x84cf('0x46')][_0x84cf('0x4a')]({'where':{'id':_0x3912cb[_0x84cf('0x50')]['id']}})['then'](handleEntityNotFound(_0x2a4f20,null))[_0x84cf('0x25')](removeEntity(_0x2a4f20,null))['catch'](handleError(_0x2a4f20,null));};exports[_0x84cf('0x51')]=function(_0x5c0122,_0x2a60bc,_0x1c2f1b){return db['VoiceMail'][_0x84cf('0x52')]({'where':{'id':_0x5c0122[_0x84cf('0x50')]['id']}})['then'](handleEntityNotFound(_0x2a60bc,null))[_0x84cf('0x25')](function(_0x53bfb8){var _0x577d55;var _0x5cc371={},_0x50cde2={};_0x50cde2[_0x84cf('0x33')]=_[_0x84cf('0x35')](db[_0x84cf('0x53')][_0x84cf('0x2f')]);_0x50cde2['query']=_[_0x84cf('0x35')](_0x5c0122[_0x84cf('0x36')]);_0x50cde2['filters']=_[_0x84cf('0x37')](_0x50cde2[_0x84cf('0x33')],_0x50cde2[_0x84cf('0x36')]);_0x5cc371[_0x84cf('0x38')]=_[_0x84cf('0x37')](_0x50cde2[_0x84cf('0x33')],qs[_0x84cf('0x39')](_0x5c0122[_0x84cf('0x36')]['fields']));_0x5cc371[_0x84cf('0x38')]=_0x5cc371['attributes'][_0x84cf('0x3a')]?_0x5cc371[_0x84cf('0x38')]:_0x50cde2[_0x84cf('0x33')];if(!_0x5c0122[_0x84cf('0x36')][_0x84cf('0x3b')]('nolimit')){_0x5cc371[_0x84cf('0x3d')]=qs[_0x84cf('0x3d')](_0x5c0122[_0x84cf('0x36')]['limit']);_0x5cc371[_0x84cf('0x1c')]=qs[_0x84cf('0x1c')](_0x5c0122['query'][_0x84cf('0x1c')]);}_0x5cc371['order']=qs[_0x84cf('0x3f')](_0x5c0122[_0x84cf('0x36')]['sort']);_0x5cc371[_0x84cf('0x43')]=qs[_0x84cf('0x40')](_['pick'](_0x5c0122[_0x84cf('0x36')],_0x50cde2[_0x84cf('0x40')]));if(_0x5c0122[_0x84cf('0x36')][_0x84cf('0x42')]){_0x5cc371['where']=_[_0x84cf('0x44')](_0x5cc371[_0x84cf('0x43')],{'$or':_['map'](_0x5cc371['attributes'],function(_0x4d40e2){var _0x1b000c={};_0x1b000c[_0x4d40e2]={'$like':'%'+_0x5c0122[_0x84cf('0x36')][_0x84cf('0x42')]+'%'};return _0x1b000c;})});}_0x5cc371['where']=_['merge'](_0x5cc371[_0x84cf('0x43')],{'mailboxuser':_0x53bfb8[_0x84cf('0x54')]});_0x5cc371=_[_0x84cf('0x44')]({},_0x5cc371,_0x5c0122[_0x84cf('0x55')]);return db[_0x84cf('0x53')][_0x84cf('0x56')](_0x5cc371)[_0x84cf('0x25')](respondWithFilteredResult(_0x2a60bc,_0x5cc371));})[_0x84cf('0x49')](handleError(_0x2a60bc,null));}; \ No newline at end of file +var _0x16d2=['sort','pick','filter','where','merge','options','findAll','rows','show','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','Voicemails','UserProfileSection','userProfileId','UserProfileResource','catch','update','destroy','params','getMessages','findOne','VoiceMailMessage','nolimit','findAndCountAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','save','then','get','error','stack','name','send','index','map','VoiceMail','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','order'];(function(_0x630bc3,_0x4f80c1){var _0x439f75=function(_0x3ba8a3){while(--_0x3ba8a3){_0x630bc3['push'](_0x630bc3['shift']());}};_0x439f75(++_0x4f80c1);}(_0x16d2,0x123));var _0x216d=function(_0x57eb22,_0x2544f5){_0x57eb22=_0x57eb22-0x0;var _0x182cdc=_0x16d2[_0x57eb22];return _0x182cdc;};'use strict';var emlformat=require(_0x216d('0x0'));var rimraf=require(_0x216d('0x1'));var zipdir=require(_0x216d('0x2'));var jsonpatch=require(_0x216d('0x3'));var rp=require(_0x216d('0x4'));var moment=require(_0x216d('0x5'));var BPromise=require(_0x216d('0x6'));var Mustache=require(_0x216d('0x7'));var util=require(_0x216d('0x8'));var path=require('path');var sox=require(_0x216d('0x9'));var csv=require(_0x216d('0xa'));var ejs=require(_0x216d('0xb'));var fs=require('fs');var fs_extra=require(_0x216d('0xc'));var _=require(_0x216d('0xd'));var squel=require(_0x216d('0xe'));var crypto=require(_0x216d('0xf'));var jsforce=require(_0x216d('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x216d('0xa'));var querystring=require(_0x216d('0x11'));var Papa=require(_0x216d('0x12'));var Redis=require(_0x216d('0x13'));var authService=require(_0x216d('0x14'));var qs=require(_0x216d('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x216d('0x16'));var logger=require('../../config/logger')(_0x216d('0x17'));var utils=require(_0x216d('0x18'));var config=require(_0x216d('0x19'));var licenseUtil=require(_0x216d('0x1a'));var db=require(_0x216d('0x1b'))['db'];function respondWithStatusCode(_0x23ecf9,_0x4c92d9){_0x4c92d9=_0x4c92d9||0xcc;return function(_0xb36a43){if(_0xb36a43){return _0x23ecf9['sendStatus'](_0x4c92d9);}return _0x23ecf9[_0x216d('0x1c')](_0x4c92d9)[_0x216d('0x1d')]();};}function respondWithResult(_0x4dc2a2,_0x165c19){_0x165c19=_0x165c19||0xc8;return function(_0x322e4b){if(_0x322e4b){return _0x4dc2a2['status'](_0x165c19)[_0x216d('0x1e')](_0x322e4b);}};}function respondWithFilteredResult(_0x494e92,_0x448c0d){return function(_0xf571a4){if(_0xf571a4){var _0x4631b0=typeof _0x448c0d[_0x216d('0x1f')]===_0x216d('0x20')&&typeof _0x448c0d[_0x216d('0x21')]===_0x216d('0x20');var _0x1496fe=_0xf571a4[_0x216d('0x22')];var _0x53d464=_0x4631b0?0x0:_0x448c0d[_0x216d('0x1f')];var _0x5124ab=_0x4631b0?_0xf571a4['count']:_0x448c0d[_0x216d('0x1f')]+_0x448c0d[_0x216d('0x21')];var _0x574758;if(_0x5124ab>=_0x1496fe){_0x5124ab=_0x1496fe;_0x574758=0xc8;}else{_0x574758=0xce;}_0x494e92[_0x216d('0x1c')](_0x574758);return _0x494e92[_0x216d('0x23')]('Content-Range',_0x53d464+'-'+_0x5124ab+'/'+_0x1496fe)[_0x216d('0x1e')](_0xf571a4);}return null;};}function patchUpdates(_0x13b8e0){return function(_0x430e81){try{jsonpatch[_0x216d('0x24')](_0x430e81,_0x13b8e0,!![]);}catch(_0x5c3e03){return BPromise[_0x216d('0x25')](_0x5c3e03);}return _0x430e81[_0x216d('0x26')]();};}function saveUpdates(_0x10f299,_0x438981){return function(_0x206782){if(_0x206782){return _0x206782['update'](_0x10f299)[_0x216d('0x27')](function(_0x1bd4db){return _0x1bd4db;});}return null;};}function removeEntity(_0x188494,_0x2880c6){return function(_0x6fa4b3){if(_0x6fa4b3){return _0x6fa4b3['destroy']()[_0x216d('0x27')](function(){var _0xab672=_0x6fa4b3[_0x216d('0x28')]({'plain':!![]});var _0x5998a1='Voicemails';return db['UserProfileResource']['destroy']({'where':{'type':_0x5998a1,'resourceId':_0xab672['id']}})['then'](function(){return _0x6fa4b3;});})[_0x216d('0x27')](function(){_0x188494[_0x216d('0x1c')](0xcc)[_0x216d('0x1d')]();});}};}function handleEntityNotFound(_0x73b509,_0x46d0ef){return function(_0x47fa6d){if(!_0x47fa6d){_0x73b509['sendStatus'](0x194);}return _0x47fa6d;};}function handleError(_0xa7624a,_0x51b2bd){_0x51b2bd=_0x51b2bd||0x1f4;return function(_0x23d1c3){logger[_0x216d('0x29')](_0x23d1c3[_0x216d('0x2a')]);if(_0x23d1c3[_0x216d('0x2b')]){delete _0x23d1c3[_0x216d('0x2b')];}_0xa7624a[_0x216d('0x1c')](_0x51b2bd)[_0x216d('0x2c')](_0x23d1c3);};}exports[_0x216d('0x2d')]=function(_0x169cfa,_0x28f56a){var _0x11be90={},_0x260134={},_0x4537fd={'count':0x0,'rows':[]};var _0x483324=_[_0x216d('0x2e')](db[_0x216d('0x2f')][_0x216d('0x30')],function(_0x510ad9){return{'name':_0x510ad9[_0x216d('0x31')],'type':_0x510ad9[_0x216d('0x32')][_0x216d('0x33')]};});_0x260134[_0x216d('0x34')]=_['map'](_0x483324,_0x216d('0x2b'));_0x260134[_0x216d('0x35')]=_[_0x216d('0x36')](_0x169cfa[_0x216d('0x35')]);_0x260134[_0x216d('0x37')]=_[_0x216d('0x38')](_0x260134[_0x216d('0x34')],_0x260134[_0x216d('0x35')]);_0x11be90[_0x216d('0x39')]=_[_0x216d('0x38')](_0x260134[_0x216d('0x34')],qs['fields'](_0x169cfa[_0x216d('0x35')][_0x216d('0x3a')]));_0x11be90[_0x216d('0x39')]=_0x11be90['attributes'][_0x216d('0x3b')]?_0x11be90[_0x216d('0x39')]:_0x260134['model'];if(!_0x169cfa[_0x216d('0x35')]['hasOwnProperty']('nolimit')){_0x11be90[_0x216d('0x21')]=qs[_0x216d('0x21')](_0x169cfa[_0x216d('0x35')][_0x216d('0x21')]);_0x11be90['offset']=qs['offset'](_0x169cfa['query'][_0x216d('0x1f')]);}_0x11be90[_0x216d('0x3c')]=qs['sort'](_0x169cfa[_0x216d('0x35')][_0x216d('0x3d')]);_0x11be90['where']=qs[_0x216d('0x37')](_[_0x216d('0x3e')](_0x169cfa[_0x216d('0x35')],_0x260134[_0x216d('0x37')]),_0x483324);if(_0x169cfa[_0x216d('0x35')][_0x216d('0x3f')]){_0x11be90[_0x216d('0x40')]=_[_0x216d('0x41')](_0x11be90['where'],{'$or':_['map'](_0x483324,function(_0x281a88){if(_0x281a88[_0x216d('0x32')]!=='VIRTUAL'){var _0xf33f9c={};_0xf33f9c[_0x281a88[_0x216d('0x2b')]]={'$like':'%'+_0x169cfa[_0x216d('0x35')]['filter']+'%'};return _0xf33f9c;}})});}_0x11be90=_[_0x216d('0x41')]({},_0x11be90,_0x169cfa[_0x216d('0x42')]);var _0x13d787={'where':_0x11be90[_0x216d('0x40')]};return db['VoiceMail'][_0x216d('0x22')](_0x13d787)[_0x216d('0x27')](function(_0x5665d7){_0x4537fd[_0x216d('0x22')]=_0x5665d7;if(_0x169cfa[_0x216d('0x35')]['includeAll']){_0x11be90['include']=[{'all':!![]}];}return db[_0x216d('0x2f')][_0x216d('0x43')](_0x11be90);})[_0x216d('0x27')](function(_0x498efe){_0x4537fd[_0x216d('0x44')]=_0x498efe;return _0x4537fd;})['then'](respondWithFilteredResult(_0x28f56a,_0x11be90))['catch'](handleError(_0x28f56a,null));};exports[_0x216d('0x45')]=function(_0x43336e,_0xac81f){var _0x5ddaeb={'raw':!![],'where':{'id':_0x43336e['params']['id']}},_0xaccf45={};_0xaccf45[_0x216d('0x34')]=_[_0x216d('0x36')](db[_0x216d('0x2f')]['rawAttributes']);_0xaccf45[_0x216d('0x35')]=_[_0x216d('0x36')](_0x43336e[_0x216d('0x35')]);_0xaccf45[_0x216d('0x37')]=_['intersection'](_0xaccf45['model'],_0xaccf45['query']);_0x5ddaeb[_0x216d('0x39')]=_[_0x216d('0x38')](_0xaccf45[_0x216d('0x34')],qs[_0x216d('0x3a')](_0x43336e[_0x216d('0x35')][_0x216d('0x3a')]));_0x5ddaeb[_0x216d('0x39')]=_0x5ddaeb[_0x216d('0x39')]['length']?_0x5ddaeb[_0x216d('0x39')]:_0xaccf45[_0x216d('0x34')];if(_0x43336e[_0x216d('0x35')][_0x216d('0x46')]){_0x5ddaeb['include']=[{'all':!![]}];}_0x5ddaeb=_[_0x216d('0x41')]({},_0x5ddaeb,_0x43336e['options']);return db[_0x216d('0x2f')][_0x216d('0x47')](_0x5ddaeb)[_0x216d('0x27')](handleEntityNotFound(_0xac81f,null))['then'](respondWithResult(_0xac81f,null))['catch'](handleError(_0xac81f,null));};exports[_0x216d('0x48')]=function(_0x32d499,_0x3932a3){return db[_0x216d('0x2f')][_0x216d('0x48')](_0x32d499[_0x216d('0x49')],{})['then'](function(_0x4f9274){var _0x26209c=_0x32d499['user'][_0x216d('0x28')]({'plain':!![]});if(!_0x26209c)throw new Error(_0x216d('0x4a'));if(_0x26209c['role']==='user'){var _0x5f37e3=_0x4f9274['get']({'plain':!![]});var _0x1ae9b7=_0x216d('0x4b');return db[_0x216d('0x4c')][_0x216d('0x47')]({'where':{'name':_0x1ae9b7,'userProfileId':_0x26209c[_0x216d('0x4d')]},'raw':!![]})[_0x216d('0x27')](function(_0x29efa8){if(_0x29efa8&&_0x29efa8['autoAssociation']===0x0){return db[_0x216d('0x4e')][_0x216d('0x48')]({'name':_0x5f37e3[_0x216d('0x2b')],'resourceId':_0x5f37e3['id'],'type':_0x29efa8['name'],'sectionId':_0x29efa8['id']},{})[_0x216d('0x27')](function(){return _0x4f9274;});}else{return _0x4f9274;}})[_0x216d('0x4f')](function(_0x2c7c67){logger[_0x216d('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2c7c67);throw _0x2c7c67;});}return _0x4f9274;})[_0x216d('0x27')](respondWithResult(_0x3932a3,0xc9))[_0x216d('0x4f')](handleError(_0x3932a3,null));};exports[_0x216d('0x50')]=function(_0x1a4761,_0x4d7705){if(_0x1a4761[_0x216d('0x49')]['id']){delete _0x1a4761[_0x216d('0x49')]['id'];}return db['VoiceMail'][_0x216d('0x47')]({'where':{'id':_0x1a4761['params']['id']}})[_0x216d('0x27')](handleEntityNotFound(_0x4d7705,null))[_0x216d('0x27')](saveUpdates(_0x1a4761[_0x216d('0x49')],null))[_0x216d('0x27')](respondWithResult(_0x4d7705,null))[_0x216d('0x4f')](handleError(_0x4d7705,null));};exports[_0x216d('0x51')]=function(_0x24297f,_0x2c6cb6){return db[_0x216d('0x2f')]['find']({'where':{'id':_0x24297f[_0x216d('0x52')]['id']}})[_0x216d('0x27')](handleEntityNotFound(_0x2c6cb6,null))['then'](removeEntity(_0x2c6cb6,null))[_0x216d('0x4f')](handleError(_0x2c6cb6,null));};exports[_0x216d('0x53')]=function(_0x59fa28,_0x4edf77,_0x3a0ee7){return db['VoiceMail'][_0x216d('0x54')]({'where':{'id':_0x59fa28[_0x216d('0x52')]['id']}})[_0x216d('0x27')](handleEntityNotFound(_0x4edf77,null))['then'](function(_0x3acd4b){var _0x5112ea;var _0x5d96b3={},_0x462225={};_0x462225[_0x216d('0x34')]=_['keys'](db[_0x216d('0x55')][_0x216d('0x30')]);_0x462225[_0x216d('0x35')]=_[_0x216d('0x36')](_0x59fa28[_0x216d('0x35')]);_0x462225[_0x216d('0x37')]=_['intersection'](_0x462225['model'],_0x462225[_0x216d('0x35')]);_0x5d96b3[_0x216d('0x39')]=_[_0x216d('0x38')](_0x462225[_0x216d('0x34')],qs[_0x216d('0x3a')](_0x59fa28[_0x216d('0x35')][_0x216d('0x3a')]));_0x5d96b3[_0x216d('0x39')]=_0x5d96b3[_0x216d('0x39')][_0x216d('0x3b')]?_0x5d96b3[_0x216d('0x39')]:_0x462225[_0x216d('0x34')];if(!_0x59fa28['query']['hasOwnProperty'](_0x216d('0x56'))){_0x5d96b3[_0x216d('0x21')]=qs['limit'](_0x59fa28[_0x216d('0x35')]['limit']);_0x5d96b3['offset']=qs[_0x216d('0x1f')](_0x59fa28[_0x216d('0x35')][_0x216d('0x1f')]);}_0x5d96b3[_0x216d('0x3c')]=qs[_0x216d('0x3d')](_0x59fa28[_0x216d('0x35')][_0x216d('0x3d')]);_0x5d96b3[_0x216d('0x40')]=qs[_0x216d('0x37')](_[_0x216d('0x3e')](_0x59fa28[_0x216d('0x35')],_0x462225[_0x216d('0x37')]));if(_0x59fa28[_0x216d('0x35')][_0x216d('0x3f')]){_0x5d96b3[_0x216d('0x40')]=_[_0x216d('0x41')](_0x5d96b3[_0x216d('0x40')],{'$or':_[_0x216d('0x2e')](_0x5d96b3[_0x216d('0x39')],function(_0x34540e){var _0xb9302={};_0xb9302[_0x34540e]={'$like':'%'+_0x59fa28[_0x216d('0x35')]['filter']+'%'};return _0xb9302;})});}_0x5d96b3[_0x216d('0x40')]=_['merge'](_0x5d96b3[_0x216d('0x40')],{'mailboxuser':_0x3acd4b['mailbox']});_0x5d96b3=_[_0x216d('0x41')]({},_0x5d96b3,_0x59fa28[_0x216d('0x42')]);return db['VoiceMailMessage'][_0x216d('0x57')](_0x5d96b3)[_0x216d('0x27')](respondWithFilteredResult(_0x4edf77,_0x5d96b3));})[_0x216d('0x4f')](handleError(_0x4edf77,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index f0528c9..8dd6542 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 _0x9b9c=['context','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMail.attributes','exports','define','VoiceMail','voice_voicemail','mailbox_context','mailbox'];(function(_0x3111b6,_0x2362ba){var _0x313129=function(_0x3b38c0){while(--_0x3b38c0){_0x3111b6['push'](_0x3111b6['shift']());}};_0x313129(++_0x2362ba);}(_0x9b9c,0x1cc));var _0xc9b9=function(_0x1f504a,_0x2684ce){_0x1f504a=_0x1f504a-0x0;var _0x343376=_0x9b9c[_0x1f504a];return _0x343376;};'use strict';var _=require(_0xc9b9('0x0'));var util=require(_0xc9b9('0x1'));var logger=require(_0xc9b9('0x2'))('api');var moment=require(_0xc9b9('0x3'));var BPromise=require(_0xc9b9('0x4'));var rp=require(_0xc9b9('0x5'));var fs=require('fs');var path=require(_0xc9b9('0x6'));var rimraf=require(_0xc9b9('0x7'));var config=require(_0xc9b9('0x8'));var attributes=require(_0xc9b9('0x9'));module[_0xc9b9('0xa')]=function(_0x8d2f2e,_0x12c124){return _0x8d2f2e[_0xc9b9('0xb')](_0xc9b9('0xc'),attributes,{'tableName':_0xc9b9('0xd'),'paranoid':![],'indexes':[{'name':_0xc9b9('0xe'),'fields':[_0xc9b9('0xf'),_0xc9b9('0x10')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x86ac=['rimraf','../../config/environment','./voiceMail.attributes','exports','define','voice_voicemail','mailbox_context','mailbox','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x2577f7,_0x4e4781){var _0x55d372=function(_0x59b397){while(--_0x59b397){_0x2577f7['push'](_0x2577f7['shift']());}};_0x55d372(++_0x4e4781);}(_0x86ac,0x71));var _0xc86a=function(_0x45a978,_0x50385c){_0x45a978=_0x45a978-0x0;var _0x284685=_0x86ac[_0x45a978];return _0x284685;};'use strict';var _=require(_0xc86a('0x0'));var util=require(_0xc86a('0x1'));var logger=require(_0xc86a('0x2'))(_0xc86a('0x3'));var moment=require('moment');var BPromise=require(_0xc86a('0x4'));var rp=require(_0xc86a('0x5'));var fs=require('fs');var path=require(_0xc86a('0x6'));var rimraf=require(_0xc86a('0x7'));var config=require(_0xc86a('0x8'));var attributes=require(_0xc86a('0x9'));module[_0xc86a('0xa')]=function(_0x1d62cb,_0x41e334){return _0x1d62cb[_0xc86a('0xb')]('VoiceMail',attributes,{'tableName':_0xc86a('0xc'),'paranoid':![],'indexes':[{'name':_0xc86a('0xd'),'fields':[_0xc86a('0xe'),'context']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index dd85b38..b9f1c6d 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 _0xdeb2=['rpc','jayson/promise','request','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x31b820,_0x2c9b6a){var _0x5712bd=function(_0x343239){while(--_0x343239){_0x31b820['push'](_0x31b820['shift']());}};_0x5712bd(++_0x2c9b6a);}(_0xdeb2,0x1db));var _0x2deb=function(_0x1b254d,_0x237166){_0x1b254d=_0x1b254d-0x0;var _0x1bd5fa=_0xdeb2[_0x1b254d];return _0x1bd5fa;};'use strict';var _=require('lodash');var util=require(_0x2deb('0x0'));var moment=require('moment');var BPromise=require(_0x2deb('0x1'));var rs=require(_0x2deb('0x2'));var fs=require('fs');var Redis=require(_0x2deb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x2deb('0x4'));var logger=require('../../config/logger')(_0x2deb('0x5'));var config=require('../../config/environment');var jayson=require(_0x2deb('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x18b598,_0x2ee839,_0x281ab4){return new BPromise(function(_0x4f3409,_0x3776a8){return client[_0x2deb('0x7')](_0x18b598,_0x281ab4)[_0x2deb('0x8')](function(_0x42e5c0){logger[_0x2deb('0x9')](_0x2deb('0xa'),_0x2ee839,_0x2deb('0xb'));logger[_0x2deb('0xc')](_0x2deb('0xd'),_0x2ee839,_0x2deb('0xb'),JSON[_0x2deb('0xe')](_0x42e5c0));if(_0x42e5c0['error']){if(_0x42e5c0[_0x2deb('0xf')][_0x2deb('0x10')]===0x1f4){logger[_0x2deb('0xf')](_0x2deb('0xa'),_0x2ee839,_0x42e5c0[_0x2deb('0xf')][_0x2deb('0x11')]);return _0x3776a8(_0x42e5c0[_0x2deb('0xf')][_0x2deb('0x11')]);}logger[_0x2deb('0xf')](_0x2deb('0xa'),_0x2ee839,_0x42e5c0[_0x2deb('0xf')][_0x2deb('0x11')]);return _0x4f3409(_0x42e5c0['error'][_0x2deb('0x11')]);}else{logger[_0x2deb('0x9')](_0x2deb('0xa'),_0x2ee839,_0x2deb('0xb'));_0x4f3409(_0x42e5c0[_0x2deb('0x12')]['message']);}})[_0x2deb('0x13')](function(_0x242e46){logger[_0x2deb('0xf')](_0x2deb('0xa'),_0x2ee839,_0x242e46);_0x3776a8(_0x242e46);});});} \ No newline at end of file +var _0x191f=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','util','moment','bluebird'];(function(_0x30faec,_0x18940b){var _0x29484f=function(_0x169ae8){while(--_0x169ae8){_0x30faec['push'](_0x30faec['shift']());}};_0x29484f(++_0x18940b);}(_0x191f,0x147));var _0xf191=function(_0x37db91,_0x50c092){_0x37db91=_0x37db91-0x0;var _0xe060d2=_0x191f[_0x37db91];return _0xe060d2;};'use strict';var _=require('lodash');var util=require(_0xf191('0x0'));var moment=require(_0xf191('0x1'));var BPromise=require(_0xf191('0x2'));var rs=require(_0xf191('0x3'));var fs=require('fs');var Redis=require(_0xf191('0x4'));var db=require(_0xf191('0x5'))['db'];var utils=require(_0xf191('0x6'));var logger=require(_0xf191('0x7'))(_0xf191('0x8'));var config=require(_0xf191('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf191('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xfdc2f9,_0x413232,_0x4bef0f){return new BPromise(function(_0x3d9c89,_0x33f9fb){return client[_0xf191('0xb')](_0xfdc2f9,_0x4bef0f)[_0xf191('0xc')](function(_0x43e114){logger[_0xf191('0xd')](_0xf191('0xe'),_0x413232,_0xf191('0xf'));logger[_0xf191('0x10')](_0xf191('0x11'),_0x413232,_0xf191('0xf'),JSON[_0xf191('0x12')](_0x43e114));if(_0x43e114[_0xf191('0x13')]){if(_0x43e114[_0xf191('0x13')]['code']===0x1f4){logger['error'](_0xf191('0xe'),_0x413232,_0x43e114[_0xf191('0x13')]['message']);return _0x33f9fb(_0x43e114[_0xf191('0x13')][_0xf191('0x14')]);}logger[_0xf191('0x13')](_0xf191('0xe'),_0x413232,_0x43e114['error'][_0xf191('0x14')]);return _0x3d9c89(_0x43e114[_0xf191('0x13')][_0xf191('0x14')]);}else{logger[_0xf191('0xd')](_0xf191('0xe'),_0x413232,'request\x20sent');_0x3d9c89(_0x43e114['result'][_0xf191('0x14')]);}})[_0xf191('0x15')](function(_0x509e8e){logger[_0xf191('0x13')](_0xf191('0xe'),_0x413232,_0x509e8e);_0x33f9fb(_0x509e8e);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index f024520..9ac3a0d 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 _0xcf2e=['../../config/environment','./voiceMailMessage.controller','isAuthenticated','index','/:id','get','/:id/download','download','put','destroy','util','path','connect-timeout','express','../../components/auth/service'];(function(_0x243b59,_0x3f9495){var _0x3e1676=function(_0x354052){while(--_0x354052){_0x243b59['push'](_0x243b59['shift']());}};_0x3e1676(++_0x3f9495);}(_0xcf2e,0x154));var _0xecf2=function(_0x2014e7,_0x2bd284){_0x2014e7=_0x2014e7-0x0;var _0x29452d=_0xcf2e[_0x2014e7];return _0x29452d;};'use strict';var multer=require('multer');var util=require(_0xecf2('0x0'));var path=require(_0xecf2('0x1'));var timeout=require(_0xecf2('0x2'));var express=require(_0xecf2('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xecf2('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xecf2('0x5'));var controller=require(_0xecf2('0x6'));router['get']('/',auth[_0xecf2('0x7')](),controller[_0xecf2('0x8')]);router['get'](_0xecf2('0x9'),auth[_0xecf2('0x7')](),controller['show']);router[_0xecf2('0xa')](_0xecf2('0xb'),auth[_0xecf2('0x7')](),controller[_0xecf2('0xc')]);router['post']('/',auth[_0xecf2('0x7')](),controller['create']);router[_0xecf2('0xd')](_0xecf2('0x9'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xecf2('0xe')]);module['exports']=router; \ No newline at end of file +var _0xc405=['download','post','create','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/:id','show','/:id/download'];(function(_0x44606e,_0x2bf244){var _0xe68388=function(_0x488a30){while(--_0x488a30){_0x44606e['push'](_0x44606e['shift']());}};_0xe68388(++_0x2bf244);}(_0xc405,0x1d6));var _0x5c40=function(_0x8956db,_0x565a5f){_0x8956db=_0x8956db-0x0;var _0x175a41=_0xc405[_0x8956db];return _0x175a41;};'use strict';var multer=require(_0x5c40('0x0'));var util=require(_0x5c40('0x1'));var path=require(_0x5c40('0x2'));var timeout=require('connect-timeout');var express=require(_0x5c40('0x3'));var router=express[_0x5c40('0x4')]();var fs_extra=require(_0x5c40('0x5'));var auth=require(_0x5c40('0x6'));var interaction=require(_0x5c40('0x7'));var config=require(_0x5c40('0x8'));var controller=require('./voiceMailMessage.controller');router['get']('/',auth[_0x5c40('0x9')](),controller[_0x5c40('0xa')]);router['get'](_0x5c40('0xb'),auth[_0x5c40('0x9')](),controller[_0x5c40('0xc')]);router['get'](_0x5c40('0xd'),auth[_0x5c40('0x9')](),controller[_0x5c40('0xe')]);router[_0x5c40('0xf')]('/',auth['isAuthenticated'](),controller[_0x5c40('0x10')]);router[_0x5c40('0x11')](_0x5c40('0xb'),auth['isAuthenticated'](),controller[_0x5c40('0x12')]);router[_0x5c40('0x13')](_0x5c40('0xb'),auth['isAuthenticated'](),controller[_0x5c40('0x14')]);module[_0x5c40('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index a868c1b..6813e21 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 _0xe8c7=['CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','VIRTUAL','getDataValue','INTEGER','STRING','BLOB','literal'];(function(_0xc039d3,_0x58b44b){var _0x29a3c0=function(_0x1f4374){while(--_0x1f4374){_0xc039d3['push'](_0xc039d3['shift']());}};_0x29a3c0(++_0x58b44b);}(_0xe8c7,0x91));var _0x7e8c=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xe8c7[_0xc6be3a];return _0x56a310;};'use strict';var Sequelize=require(_0x7e8c('0x0'));module['exports']={'name':{'type':Sequelize[_0x7e8c('0x1')],'get':function(_0x251640){return this[_0x7e8c('0x2')]('id');}},'msgnum':{'type':Sequelize[_0x7e8c('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x7e8c('0x4')],'defaultValue':''},'context':{'type':Sequelize[_0x7e8c('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x7e8c('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0x7e8c('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0x7e8c('0x4')],'defaultValue':''},'duration':{'type':Sequelize[_0x7e8c('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x7e8c('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x7e8c('0x4')],'defaultValue':''},'recording':{'type':Sequelize[_0x7e8c('0x5')]('long'),'defaultValue':null},'flag':{'type':Sequelize[_0x7e8c('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize['STRING'],'defaultValue':''},'stamp':{'type':'TIMESTAMP','defaultValue':Sequelize[_0x7e8c('0x6')](_0x7e8c('0x7'))}}; \ No newline at end of file +var _0x2bd4=['TIMESTAMP','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','VIRTUAL','getDataValue','INTEGER','STRING','BLOB','long'];(function(_0xfedc72,_0x292f02){var _0x2c7c78=function(_0x12fbf1){while(--_0x12fbf1){_0xfedc72['push'](_0xfedc72['shift']());}};_0x2c7c78(++_0x292f02);}(_0x2bd4,0xda));var _0x42bd=function(_0x5d1be4,_0x11bf0a){_0x5d1be4=_0x5d1be4-0x0;var _0x30732a=_0x2bd4[_0x5d1be4];return _0x30732a;};'use strict';var Sequelize=require(_0x42bd('0x0'));module['exports']={'name':{'type':Sequelize[_0x42bd('0x1')],'get':function(_0x44883a){return this[_0x42bd('0x2')]('id');}},'msgnum':{'type':Sequelize[_0x42bd('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize[_0x42bd('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0x42bd('0x4')],'defaultValue':''},'duration':{'type':Sequelize[_0x42bd('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x42bd('0x4')],'defaultValue':''},'recording':{'type':Sequelize[_0x42bd('0x5')](_0x42bd('0x6')),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize[_0x42bd('0x4')],'defaultValue':''},'stamp':{'type':_0x42bd('0x7'),'defaultValue':Sequelize['literal'](_0x42bd('0x8'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index 23a768a..ffbbc0b 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 _0xcb4b=['../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','end','error','stack','name','send','index','VoiceMailMessage','rawAttributes','fieldName','type','key','model','differenceBy','map','keys','query','filters','attributes','fields','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','rows','params','intersection','length','include','find','catch','create','body','download','recording','msg_id','Sequelize','ValidationError','audio/wav','attachment','Content-Disposition','attachment;\x20filename=\x22','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x171f33,_0x4d13d1){var _0x3ccd4b=function(_0x1e6b3d){while(--_0x1e6b3d){_0x171f33['push'](_0x171f33['shift']());}};_0x3ccd4b(++_0x4d13d1);}(_0xcb4b,0x1f1));var _0xbcb4=function(_0x44671c,_0x2a7436){_0x44671c=_0x44671c-0x0;var _0x5a61bc=_0xcb4b[_0x44671c];return _0x5a61bc;};'use strict';var emlformat=require(_0xbcb4('0x0'));var rimraf=require(_0xbcb4('0x1'));var zipdir=require(_0xbcb4('0x2'));var jsonpatch=require(_0xbcb4('0x3'));var rp=require('request-promise');var moment=require(_0xbcb4('0x4'));var BPromise=require(_0xbcb4('0x5'));var Mustache=require(_0xbcb4('0x6'));var util=require('util');var path=require(_0xbcb4('0x7'));var sox=require(_0xbcb4('0x8'));var csv=require(_0xbcb4('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbcb4('0xa'));var _=require(_0xbcb4('0xb'));var squel=require(_0xbcb4('0xc'));var crypto=require(_0xbcb4('0xd'));var jsforce=require(_0xbcb4('0xe'));var deskjs=require(_0xbcb4('0xf'));var toCsv=require(_0xbcb4('0x9'));var querystring=require('querystring');var Papa=require(_0xbcb4('0x10'));var Redis=require(_0xbcb4('0x11'));var authService=require(_0xbcb4('0x12'));var qs=require(_0xbcb4('0x13'));var as=require(_0xbcb4('0x14'));var hardwareService=require(_0xbcb4('0x15'));var logger=require(_0xbcb4('0x16'))(_0xbcb4('0x17'));var utils=require(_0xbcb4('0x18'));var config=require(_0xbcb4('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xbcb4('0x1a'))['db'];function respondWithStatusCode(_0x3906fd,_0x4c34db){_0x4c34db=_0x4c34db||0xcc;return function(_0x52de70){if(_0x52de70){return _0x3906fd[_0xbcb4('0x1b')](_0x4c34db);}return _0x3906fd[_0xbcb4('0x1c')](_0x4c34db)['end']();};}function respondWithResult(_0x20cf18,_0x39b5b3){_0x39b5b3=_0x39b5b3||0xc8;return function(_0x171999){if(_0x171999){return _0x20cf18[_0xbcb4('0x1c')](_0x39b5b3)[_0xbcb4('0x1d')](_0x171999);}};}function respondWithFilteredResult(_0x385eee,_0x2991a0){return function(_0x57156f){if(_0x57156f){var _0x2f1234=typeof _0x2991a0[_0xbcb4('0x1e')]===_0xbcb4('0x1f')&&typeof _0x2991a0[_0xbcb4('0x20')]===_0xbcb4('0x1f');var _0x5150b0=_0x57156f[_0xbcb4('0x21')];var _0x15d081=_0x2f1234?0x0:_0x2991a0[_0xbcb4('0x1e')];var _0xa85857=_0x2f1234?_0x57156f[_0xbcb4('0x21')]:_0x2991a0[_0xbcb4('0x1e')]+_0x2991a0[_0xbcb4('0x20')];var _0x3a9839;if(_0xa85857>=_0x5150b0){_0xa85857=_0x5150b0;_0x3a9839=0xc8;}else{_0x3a9839=0xce;}_0x385eee[_0xbcb4('0x1c')](_0x3a9839);return _0x385eee[_0xbcb4('0x22')](_0xbcb4('0x23'),_0x15d081+'-'+_0xa85857+'/'+_0x5150b0)[_0xbcb4('0x1d')](_0x57156f);}return null;};}function patchUpdates(_0x59c941){return function(_0x59f9f5){try{jsonpatch[_0xbcb4('0x24')](_0x59f9f5,_0x59c941,!![]);}catch(_0x208314){return BPromise['reject'](_0x208314);}return _0x59f9f5[_0xbcb4('0x25')]();};}function saveUpdates(_0x9215d4,_0x39d243){return function(_0x43977b){if(_0x43977b){return _0x43977b[_0xbcb4('0x26')](_0x9215d4)[_0xbcb4('0x27')](function(_0x359143){return _0x359143;});}return null;};}function removeEntity(_0x5712d0,_0x9e77b0){return function(_0x161a18){if(_0x161a18){return _0x161a18['destroy']()[_0xbcb4('0x27')](function(){_0x5712d0[_0xbcb4('0x1c')](0xcc)[_0xbcb4('0x28')]();});}};}function handleEntityNotFound(_0x2d5990,_0x2f6e30){return function(_0x5cac04){if(!_0x5cac04){_0x2d5990[_0xbcb4('0x1b')](0x194);}return _0x5cac04;};}function handleError(_0x174def,_0x1d7f0a){_0x1d7f0a=_0x1d7f0a||0x1f4;return function(_0x198c69){logger[_0xbcb4('0x29')](_0x198c69[_0xbcb4('0x2a')]);if(_0x198c69['name']){delete _0x198c69[_0xbcb4('0x2b')];}_0x174def[_0xbcb4('0x1c')](_0x1d7f0a)[_0xbcb4('0x2c')](_0x198c69);};}exports[_0xbcb4('0x2d')]=function(_0x535968,_0x2cea32){var _0x2ebef0={},_0x385d06={},_0x26f7f5={'count':0x0,'rows':[]};var _0x15ff26=_['map'](db[_0xbcb4('0x2e')][_0xbcb4('0x2f')],function(_0x4e697f){return{'name':_0x4e697f[_0xbcb4('0x30')],'type':_0x4e697f[_0xbcb4('0x31')][_0xbcb4('0x32')]};});_0x385d06[_0xbcb4('0x33')]=_[_0xbcb4('0x34')](_[_0xbcb4('0x35')](_0x15ff26,'name'),[_0xbcb4('0x2b')]);_0x385d06['query']=_[_0xbcb4('0x36')](_0x535968[_0xbcb4('0x37')]);_0x385d06[_0xbcb4('0x38')]=_['intersection'](_0x385d06[_0xbcb4('0x33')],_0x385d06[_0xbcb4('0x37')]);_0x2ebef0[_0xbcb4('0x39')]=_['intersection'](_0x385d06[_0xbcb4('0x33')],qs[_0xbcb4('0x3a')](_0x535968[_0xbcb4('0x37')]['fields']));_0x2ebef0['attributes']=_0x2ebef0[_0xbcb4('0x39')]['length']?_0x2ebef0['attributes']:_0x385d06[_0xbcb4('0x33')];if(!_0x535968[_0xbcb4('0x37')]['hasOwnProperty'](_0xbcb4('0x3b'))){_0x2ebef0[_0xbcb4('0x20')]=qs['limit'](_0x535968['query'][_0xbcb4('0x20')]);_0x2ebef0[_0xbcb4('0x1e')]=qs[_0xbcb4('0x1e')](_0x535968['query'][_0xbcb4('0x1e')]);}_0x2ebef0[_0xbcb4('0x3c')]=qs[_0xbcb4('0x3d')](_0x535968[_0xbcb4('0x37')][_0xbcb4('0x3d')]);_0x2ebef0[_0xbcb4('0x3e')]=qs[_0xbcb4('0x38')](_[_0xbcb4('0x3f')](_0x535968[_0xbcb4('0x37')],_0x385d06[_0xbcb4('0x38')]),_0x15ff26);if(_0x535968[_0xbcb4('0x37')]['filter']){_0x2ebef0[_0xbcb4('0x3e')]=_['merge'](_0x2ebef0[_0xbcb4('0x3e')],{'$or':_[_0xbcb4('0x35')](_0x15ff26,function(_0x5ca1f0){if(_0x5ca1f0[_0xbcb4('0x31')]!==_0xbcb4('0x40')){var _0x4d6870={};_0x4d6870[_0x5ca1f0['name']]={'$like':'%'+_0x535968[_0xbcb4('0x37')][_0xbcb4('0x41')]+'%'};return _0x4d6870;}})});}_0x2ebef0=_[_0xbcb4('0x42')]({},_0x2ebef0,_0x535968[_0xbcb4('0x43')]);var _0x451987={'where':_0x2ebef0[_0xbcb4('0x3e')]};return db[_0xbcb4('0x2e')]['count'](_0x451987)[_0xbcb4('0x27')](function(_0x3b58ca){_0x26f7f5[_0xbcb4('0x21')]=_0x3b58ca;if(_0x535968['query'][_0xbcb4('0x44')]){_0x2ebef0['include']=[{'all':!![]}];}return db[_0xbcb4('0x2e')]['findAll'](_0x2ebef0);})['then'](function(_0x17b804){_0x26f7f5[_0xbcb4('0x45')]=_0x17b804;return _0x26f7f5;})[_0xbcb4('0x27')](respondWithFilteredResult(_0x2cea32,_0x2ebef0))['catch'](handleError(_0x2cea32,null));};exports['show']=function(_0x2cc5f4,_0x24497a){var _0x179d0e={'raw':!![],'where':{'id':_0x2cc5f4[_0xbcb4('0x46')]['id']}},_0x1efea5={};_0x1efea5[_0xbcb4('0x33')]=_[_0xbcb4('0x36')](db[_0xbcb4('0x2e')]['rawAttributes']);_0x1efea5[_0xbcb4('0x37')]=_[_0xbcb4('0x36')](_0x2cc5f4[_0xbcb4('0x37')]);_0x1efea5[_0xbcb4('0x38')]=_['intersection'](_0x1efea5[_0xbcb4('0x33')],_0x1efea5['query']);_0x179d0e['attributes']=_[_0xbcb4('0x47')](_0x1efea5['model'],qs[_0xbcb4('0x3a')](_0x2cc5f4[_0xbcb4('0x37')][_0xbcb4('0x3a')]));_0x179d0e[_0xbcb4('0x39')]=_0x179d0e[_0xbcb4('0x39')][_0xbcb4('0x48')]?_0x179d0e[_0xbcb4('0x39')]:_0x1efea5[_0xbcb4('0x33')];if(_0x2cc5f4[_0xbcb4('0x37')]['includeAll']){_0x179d0e[_0xbcb4('0x49')]=[{'all':!![]}];}_0x179d0e=_[_0xbcb4('0x42')]({},_0x179d0e,_0x2cc5f4[_0xbcb4('0x43')]);return db['VoiceMailMessage'][_0xbcb4('0x4a')](_0x179d0e)[_0xbcb4('0x27')](handleEntityNotFound(_0x24497a,null))[_0xbcb4('0x27')](respondWithResult(_0x24497a,null))[_0xbcb4('0x4b')](handleError(_0x24497a,null));};exports[_0xbcb4('0x4c')]=function(_0x59e06e,_0x44d597){return db['VoiceMailMessage'][_0xbcb4('0x4c')](_0x59e06e[_0xbcb4('0x4d')],{})[_0xbcb4('0x27')](respondWithResult(_0x44d597,0xc9))[_0xbcb4('0x4b')](handleError(_0x44d597,null));};exports['update']=function(_0x43ad2e,_0x39fbd1){if(_0x43ad2e[_0xbcb4('0x4d')]['id']){delete _0x43ad2e['body']['id'];}return db[_0xbcb4('0x2e')]['find']({'where':{'id':_0x43ad2e[_0xbcb4('0x46')]['id']}})['then'](handleEntityNotFound(_0x39fbd1,null))['then'](saveUpdates(_0x43ad2e[_0xbcb4('0x4d')],null))[_0xbcb4('0x27')](respondWithResult(_0x39fbd1,null))[_0xbcb4('0x4b')](handleError(_0x39fbd1,null));};exports['destroy']=function(_0x48c781,_0x1a58ed){return db[_0xbcb4('0x2e')][_0xbcb4('0x4a')]({'where':{'id':_0x48c781[_0xbcb4('0x46')]['id']}})['then'](handleEntityNotFound(_0x1a58ed,null))[_0xbcb4('0x27')](removeEntity(_0x1a58ed,null))[_0xbcb4('0x4b')](handleError(_0x1a58ed,null));};exports[_0xbcb4('0x4e')]=function(_0x379469,_0x1d5dfd,_0x57ac84){return db[_0xbcb4('0x2e')][_0xbcb4('0x4a')]({'where':{'id':_0x379469[_0xbcb4('0x46')]['id']},'attributes':['id',_0xbcb4('0x4f'),_0xbcb4('0x50')]})[_0xbcb4('0x27')](handleEntityNotFound(_0x1d5dfd,null))['then'](function(_0x1e8f25){if(_0x1e8f25){if(!_0x1e8f25[_0xbcb4('0x4f')]){throw new db[(_0xbcb4('0x51'))][(_0xbcb4('0x52'))]('VoiceMailMessage\x20not\x20found');}var _0x27840d={'Content-Type':_0xbcb4('0x53'),'Content-Disposition':_0xbcb4('0x54')};if(_0x1e8f25['msg_id']){_0x27840d[_0xbcb4('0x55')]=_0xbcb4('0x56')+_0x1e8f25['msg_id']+'.wav\x22';}_0x1d5dfd[_0xbcb4('0x22')](_0x27840d);return _0x1d5dfd[_0xbcb4('0x2c')](new Buffer(_0x1e8f25[_0xbcb4('0x4f')]));}})[_0xbcb4('0x4b')](handleError(_0x1d5dfd,null));}; \ No newline at end of file +var _0x4b70=['index','VoiceMailMessage','rawAttributes','fieldName','type','key','differenceBy','map','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','offset','sort','where','filter','merge','VIRTUAL','include','findAll','rows','show','params','length','options','find','catch','body','update','destroy','download','recording','msg_id','Sequelize','VoiceMailMessage\x20not\x20found','audio/wav','attachment','attachment;\x20filename=\x22','.wav\x22','send','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','undefined','limit','count','Content-Range','json','apply','reject','then','error','name'];(function(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0x4b70,0x83));var _0x04b7=function(_0x255384,_0x558d2b){_0x255384=_0x255384-0x0;var _0x1500fd=_0x4b70[_0x255384];return _0x1500fd;};'use strict';var emlformat=require(_0x04b7('0x0'));var rimraf=require(_0x04b7('0x1'));var zipdir=require(_0x04b7('0x2'));var jsonpatch=require(_0x04b7('0x3'));var rp=require(_0x04b7('0x4'));var moment=require(_0x04b7('0x5'));var BPromise=require(_0x04b7('0x6'));var Mustache=require(_0x04b7('0x7'));var util=require('util');var path=require(_0x04b7('0x8'));var sox=require(_0x04b7('0x9'));var csv=require('to-csv');var ejs=require(_0x04b7('0xa'));var fs=require('fs');var fs_extra=require(_0x04b7('0xb'));var _=require(_0x04b7('0xc'));var squel=require(_0x04b7('0xd'));var crypto=require(_0x04b7('0xe'));var jsforce=require(_0x04b7('0xf'));var deskjs=require(_0x04b7('0x10'));var toCsv=require(_0x04b7('0x11'));var querystring=require(_0x04b7('0x12'));var Papa=require('papaparse');var Redis=require(_0x04b7('0x13'));var authService=require(_0x04b7('0x14'));var qs=require(_0x04b7('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x04b7('0x16'));var logger=require(_0x04b7('0x17'))(_0x04b7('0x18'));var utils=require(_0x04b7('0x19'));var config=require(_0x04b7('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x04b7('0x1b'))['db'];function respondWithStatusCode(_0x25c993,_0x32c6d8){_0x32c6d8=_0x32c6d8||0xcc;return function(_0x29558f){if(_0x29558f){return _0x25c993[_0x04b7('0x1c')](_0x32c6d8);}return _0x25c993[_0x04b7('0x1d')](_0x32c6d8)[_0x04b7('0x1e')]();};}function respondWithResult(_0x19c537,_0x54188c){_0x54188c=_0x54188c||0xc8;return function(_0x34b67d){if(_0x34b67d){return _0x19c537[_0x04b7('0x1d')](_0x54188c)['json'](_0x34b67d);}};}function respondWithFilteredResult(_0x3b681c,_0x541164){return function(_0x3d3bde){if(_0x3d3bde){var _0x42e0b5=typeof _0x541164['offset']===_0x04b7('0x1f')&&typeof _0x541164[_0x04b7('0x20')]==='undefined';var _0x54c052=_0x3d3bde[_0x04b7('0x21')];var _0x57ffe5=_0x42e0b5?0x0:_0x541164['offset'];var _0xc91c3f=_0x42e0b5?_0x3d3bde[_0x04b7('0x21')]:_0x541164['offset']+_0x541164[_0x04b7('0x20')];var _0x300802;if(_0xc91c3f>=_0x54c052){_0xc91c3f=_0x54c052;_0x300802=0xc8;}else{_0x300802=0xce;}_0x3b681c[_0x04b7('0x1d')](_0x300802);return _0x3b681c['set'](_0x04b7('0x22'),_0x57ffe5+'-'+_0xc91c3f+'/'+_0x54c052)[_0x04b7('0x23')](_0x3d3bde);}return null;};}function patchUpdates(_0x5a59b5){return function(_0x4306a9){try{jsonpatch[_0x04b7('0x24')](_0x4306a9,_0x5a59b5,!![]);}catch(_0x1bc61d){return BPromise[_0x04b7('0x25')](_0x1bc61d);}return _0x4306a9['save']();};}function saveUpdates(_0xf79739,_0xbfe00f){return function(_0xc183c1){if(_0xc183c1){return _0xc183c1['update'](_0xf79739)[_0x04b7('0x26')](function(_0x2349fd){return _0x2349fd;});}return null;};}function removeEntity(_0x5d3910,_0x19f873){return function(_0x3911ae){if(_0x3911ae){return _0x3911ae['destroy']()['then'](function(){_0x5d3910[_0x04b7('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47daea,_0x45331c){return function(_0x50ae63){if(!_0x50ae63){_0x47daea[_0x04b7('0x1c')](0x194);}return _0x50ae63;};}function handleError(_0x36a5ba,_0x3d8824){_0x3d8824=_0x3d8824||0x1f4;return function(_0x4130c5){logger[_0x04b7('0x27')](_0x4130c5['stack']);if(_0x4130c5['name']){delete _0x4130c5[_0x04b7('0x28')];}_0x36a5ba['status'](_0x3d8824)['send'](_0x4130c5);};}exports[_0x04b7('0x29')]=function(_0x2a252b,_0x3feae4){var _0x73b9a5={},_0x3c072e={},_0x514a3a={'count':0x0,'rows':[]};var _0x556da0=_['map'](db[_0x04b7('0x2a')][_0x04b7('0x2b')],function(_0x26e776){return{'name':_0x26e776[_0x04b7('0x2c')],'type':_0x26e776[_0x04b7('0x2d')][_0x04b7('0x2e')]};});_0x3c072e['model']=_[_0x04b7('0x2f')](_[_0x04b7('0x30')](_0x556da0,'name'),[_0x04b7('0x28')]);_0x3c072e[_0x04b7('0x31')]=_[_0x04b7('0x32')](_0x2a252b['query']);_0x3c072e[_0x04b7('0x33')]=_[_0x04b7('0x34')](_0x3c072e[_0x04b7('0x35')],_0x3c072e[_0x04b7('0x31')]);_0x73b9a5[_0x04b7('0x36')]=_[_0x04b7('0x34')](_0x3c072e[_0x04b7('0x35')],qs[_0x04b7('0x37')](_0x2a252b[_0x04b7('0x31')][_0x04b7('0x37')]));_0x73b9a5[_0x04b7('0x36')]=_0x73b9a5[_0x04b7('0x36')]['length']?_0x73b9a5['attributes']:_0x3c072e[_0x04b7('0x35')];if(!_0x2a252b[_0x04b7('0x31')][_0x04b7('0x38')](_0x04b7('0x39'))){_0x73b9a5['limit']=qs[_0x04b7('0x20')](_0x2a252b[_0x04b7('0x31')]['limit']);_0x73b9a5[_0x04b7('0x3a')]=qs[_0x04b7('0x3a')](_0x2a252b['query'][_0x04b7('0x3a')]);}_0x73b9a5['order']=qs[_0x04b7('0x3b')](_0x2a252b['query'][_0x04b7('0x3b')]);_0x73b9a5[_0x04b7('0x3c')]=qs[_0x04b7('0x33')](_['pick'](_0x2a252b[_0x04b7('0x31')],_0x3c072e['filters']),_0x556da0);if(_0x2a252b['query'][_0x04b7('0x3d')]){_0x73b9a5[_0x04b7('0x3c')]=_[_0x04b7('0x3e')](_0x73b9a5[_0x04b7('0x3c')],{'$or':_[_0x04b7('0x30')](_0x556da0,function(_0x5d79f4){if(_0x5d79f4[_0x04b7('0x2d')]!==_0x04b7('0x3f')){var _0x19adf8={};_0x19adf8[_0x5d79f4[_0x04b7('0x28')]]={'$like':'%'+_0x2a252b[_0x04b7('0x31')][_0x04b7('0x3d')]+'%'};return _0x19adf8;}})});}_0x73b9a5=_[_0x04b7('0x3e')]({},_0x73b9a5,_0x2a252b['options']);var _0x4e85d7={'where':_0x73b9a5[_0x04b7('0x3c')]};return db[_0x04b7('0x2a')][_0x04b7('0x21')](_0x4e85d7)[_0x04b7('0x26')](function(_0x155db7){_0x514a3a[_0x04b7('0x21')]=_0x155db7;if(_0x2a252b[_0x04b7('0x31')]['includeAll']){_0x73b9a5[_0x04b7('0x40')]=[{'all':!![]}];}return db[_0x04b7('0x2a')][_0x04b7('0x41')](_0x73b9a5);})[_0x04b7('0x26')](function(_0x3703dc){_0x514a3a[_0x04b7('0x42')]=_0x3703dc;return _0x514a3a;})['then'](respondWithFilteredResult(_0x3feae4,_0x73b9a5))['catch'](handleError(_0x3feae4,null));};exports[_0x04b7('0x43')]=function(_0x2c620f,_0x2790e6){var _0x51694d={'raw':!![],'where':{'id':_0x2c620f[_0x04b7('0x44')]['id']}},_0x38a526={};_0x38a526[_0x04b7('0x35')]=_[_0x04b7('0x32')](db[_0x04b7('0x2a')][_0x04b7('0x2b')]);_0x38a526[_0x04b7('0x31')]=_[_0x04b7('0x32')](_0x2c620f['query']);_0x38a526[_0x04b7('0x33')]=_['intersection'](_0x38a526[_0x04b7('0x35')],_0x38a526[_0x04b7('0x31')]);_0x51694d[_0x04b7('0x36')]=_[_0x04b7('0x34')](_0x38a526[_0x04b7('0x35')],qs['fields'](_0x2c620f[_0x04b7('0x31')][_0x04b7('0x37')]));_0x51694d[_0x04b7('0x36')]=_0x51694d[_0x04b7('0x36')][_0x04b7('0x45')]?_0x51694d[_0x04b7('0x36')]:_0x38a526[_0x04b7('0x35')];if(_0x2c620f['query']['includeAll']){_0x51694d[_0x04b7('0x40')]=[{'all':!![]}];}_0x51694d=_[_0x04b7('0x3e')]({},_0x51694d,_0x2c620f[_0x04b7('0x46')]);return db['VoiceMailMessage'][_0x04b7('0x47')](_0x51694d)[_0x04b7('0x26')](handleEntityNotFound(_0x2790e6,null))[_0x04b7('0x26')](respondWithResult(_0x2790e6,null))[_0x04b7('0x48')](handleError(_0x2790e6,null));};exports['create']=function(_0x5f20c0,_0x20cc6c){return db['VoiceMailMessage']['create'](_0x5f20c0[_0x04b7('0x49')],{})[_0x04b7('0x26')](respondWithResult(_0x20cc6c,0xc9))[_0x04b7('0x48')](handleError(_0x20cc6c,null));};exports[_0x04b7('0x4a')]=function(_0x4664ee,_0x3b7695){if(_0x4664ee['body']['id']){delete _0x4664ee[_0x04b7('0x49')]['id'];}return db[_0x04b7('0x2a')][_0x04b7('0x47')]({'where':{'id':_0x4664ee[_0x04b7('0x44')]['id']}})[_0x04b7('0x26')](handleEntityNotFound(_0x3b7695,null))['then'](saveUpdates(_0x4664ee['body'],null))[_0x04b7('0x26')](respondWithResult(_0x3b7695,null))[_0x04b7('0x48')](handleError(_0x3b7695,null));};exports[_0x04b7('0x4b')]=function(_0x40e90c,_0x14f38c){return db[_0x04b7('0x2a')][_0x04b7('0x47')]({'where':{'id':_0x40e90c['params']['id']}})[_0x04b7('0x26')](handleEntityNotFound(_0x14f38c,null))['then'](removeEntity(_0x14f38c,null))['catch'](handleError(_0x14f38c,null));};exports[_0x04b7('0x4c')]=function(_0x406238,_0x328ab0,_0x1580e9){return db[_0x04b7('0x2a')][_0x04b7('0x47')]({'where':{'id':_0x406238[_0x04b7('0x44')]['id']},'attributes':['id',_0x04b7('0x4d'),_0x04b7('0x4e')]})[_0x04b7('0x26')](handleEntityNotFound(_0x328ab0,null))[_0x04b7('0x26')](function(_0x1db0f0){if(_0x1db0f0){if(!_0x1db0f0[_0x04b7('0x4d')]){throw new db[(_0x04b7('0x4f'))]['ValidationError'](_0x04b7('0x50'));}var _0x3ff243={'Content-Type':_0x04b7('0x51'),'Content-Disposition':_0x04b7('0x52')};if(_0x1db0f0[_0x04b7('0x4e')]){_0x3ff243['Content-Disposition']=_0x04b7('0x53')+_0x1db0f0[_0x04b7('0x4e')]+_0x04b7('0x54');}_0x328ab0['set'](_0x3ff243);return _0x328ab0[_0x04b7('0x55')](new Buffer(_0x1db0f0['recording']));}})[_0x04b7('0x48')](handleError(_0x328ab0,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index a845016..25317de 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 _0xe17b=['voice_voicemail_messages','dir','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceMailMessage.attributes','define','VoiceMailMessage'];(function(_0x3c067d,_0x56f911){var _0x30b105=function(_0x56d214){while(--_0x56d214){_0x3c067d['push'](_0x3c067d['shift']());}};_0x30b105(++_0x56f911);}(_0xe17b,0x1f0));var _0xbe17=function(_0x382c73,_0x199cab){_0x382c73=_0x382c73-0x0;var _0x1dd0bf=_0xe17b[_0x382c73];return _0x1dd0bf;};'use strict';var _=require(_0xbe17('0x0'));var util=require(_0xbe17('0x1'));var logger=require('../../config/logger')(_0xbe17('0x2'));var moment=require(_0xbe17('0x3'));var BPromise=require(_0xbe17('0x4'));var rp=require(_0xbe17('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbe17('0x6'));var config=require(_0xbe17('0x7'));var attributes=require(_0xbe17('0x8'));module['exports']=function(_0x3e0b83,_0xb7b19c){return _0x3e0b83[_0xbe17('0x9')](_0xbe17('0xa'),attributes,{'tableName':_0xbe17('0xb'),'paranoid':![],'indexes':[{'name':_0xbe17('0xc'),'fields':[_0xbe17('0xc')]}],'timestamps':![]});}; \ No newline at end of file +var _0x8092=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMailMessage.attributes','exports','voice_voicemail_messages','dir'];(function(_0x4ce028,_0x526d4b){var _0x583d0c=function(_0x874178){while(--_0x874178){_0x4ce028['push'](_0x4ce028['shift']());}};_0x583d0c(++_0x526d4b);}(_0x8092,0xa9));var _0x2809=function(_0x57572c,_0x4a67ec){_0x57572c=_0x57572c-0x0;var _0x22b79e=_0x8092[_0x57572c];return _0x22b79e;};'use strict';var _=require(_0x2809('0x0'));var util=require(_0x2809('0x1'));var logger=require(_0x2809('0x2'))(_0x2809('0x3'));var moment=require('moment');var BPromise=require(_0x2809('0x4'));var rp=require(_0x2809('0x5'));var fs=require('fs');var path=require(_0x2809('0x6'));var rimraf=require(_0x2809('0x7'));var config=require(_0x2809('0x8'));var attributes=require(_0x2809('0x9'));module[_0x2809('0xa')]=function(_0x490ea3,_0x27d5d7){return _0x490ea3['define']('VoiceMailMessage',attributes,{'tableName':_0x2809('0xb'),'paranoid':![],'indexes':[{'name':_0x2809('0xc'),'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 835c21a..7ac4d06 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 _0xd10d=['stringify','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','VoiceMailMessage,\x20%s,\x20%s','VoiceMailMessage,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x3aff81,_0x2d5008){var _0x23e8fa=function(_0x14153e){while(--_0x14153e){_0x3aff81['push'](_0x3aff81['shift']());}};_0x23e8fa(++_0x2d5008);}(_0xd10d,0x108));var _0xdd10=function(_0x37b2ce,_0x5a6096){_0x37b2ce=_0x37b2ce-0x0;var _0x18e96a=_0xd10d[_0x37b2ce];return _0x18e96a;};'use strict';var _=require(_0xdd10('0x0'));var util=require(_0xdd10('0x1'));var moment=require(_0xdd10('0x2'));var BPromise=require(_0xdd10('0x3'));var rs=require(_0xdd10('0x4'));var fs=require('fs');var Redis=require(_0xdd10('0x5'));var db=require(_0xdd10('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xdd10('0x7'))(_0xdd10('0x8'));var config=require(_0xdd10('0x9'));var jayson=require(_0xdd10('0xa'));var client=jayson[_0xdd10('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4842c6,_0x4ea918,_0x35e74b){return new BPromise(function(_0x20f93d,_0x51387c){return client['request'](_0x4842c6,_0x35e74b)['then'](function(_0x4ee440){logger[_0xdd10('0xc')](_0xdd10('0xd'),_0x4ea918,'request\x20sent');logger['debug'](_0xdd10('0xe'),_0x4ea918,_0xdd10('0xf'),JSON[_0xdd10('0x10')](_0x4ee440));if(_0x4ee440[_0xdd10('0x11')]){if(_0x4ee440['error']['code']===0x1f4){logger[_0xdd10('0x11')]('VoiceMailMessage,\x20%s,\x20%s',_0x4ea918,_0x4ee440[_0xdd10('0x11')][_0xdd10('0x12')]);return _0x51387c(_0x4ee440[_0xdd10('0x11')][_0xdd10('0x12')]);}logger[_0xdd10('0x11')](_0xdd10('0xd'),_0x4ea918,_0x4ee440[_0xdd10('0x11')][_0xdd10('0x12')]);return _0x20f93d(_0x4ee440[_0xdd10('0x11')][_0xdd10('0x12')]);}else{logger[_0xdd10('0xc')](_0xdd10('0xd'),_0x4ea918,_0xdd10('0xf'));_0x20f93d(_0x4ee440[_0xdd10('0x13')][_0xdd10('0x12')]);}})['catch'](function(_0x160ef8){logger[_0xdd10('0x11')](_0xdd10('0xd'),_0x4ea918,_0x160ef8);_0x51387c(_0x160ef8);});});} \ No newline at end of file +var _0x5afd=['VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x5afd,0x7f));var _0xd5af=function(_0x442dbf,_0x117087){_0x442dbf=_0x442dbf-0x0;var _0x294658=_0x5afd[_0x442dbf];return _0x294658;};'use strict';var _=require('lodash');var util=require(_0xd5af('0x0'));var moment=require(_0xd5af('0x1'));var BPromise=require(_0xd5af('0x2'));var rs=require(_0xd5af('0x3'));var fs=require('fs');var Redis=require(_0xd5af('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd5af('0x5'));var logger=require(_0xd5af('0x6'))(_0xd5af('0x7'));var config=require(_0xd5af('0x8'));var jayson=require(_0xd5af('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1b43bf,_0x5ddd89,_0x104a1d){return new BPromise(function(_0x2a5ac6,_0x80e1cd){return client[_0xd5af('0xa')](_0x1b43bf,_0x104a1d)[_0xd5af('0xb')](function(_0x2db494){logger[_0xd5af('0xc')](_0xd5af('0xd'),_0x5ddd89,_0xd5af('0xe'));logger[_0xd5af('0xf')]('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x5ddd89,_0xd5af('0xe'),JSON[_0xd5af('0x10')](_0x2db494));if(_0x2db494['error']){if(_0x2db494[_0xd5af('0x11')]['code']===0x1f4){logger[_0xd5af('0x11')](_0xd5af('0xd'),_0x5ddd89,_0x2db494[_0xd5af('0x11')][_0xd5af('0x12')]);return _0x80e1cd(_0x2db494[_0xd5af('0x11')][_0xd5af('0x12')]);}logger[_0xd5af('0x11')]('VoiceMailMessage,\x20%s,\x20%s',_0x5ddd89,_0x2db494['error'][_0xd5af('0x12')]);return _0x2a5ac6(_0x2db494[_0xd5af('0x11')]['message']);}else{logger[_0xd5af('0xc')](_0xd5af('0xd'),_0x5ddd89,'request\x20sent');_0x2a5ac6(_0x2db494['result']['message']);}})[_0xd5af('0x13')](function(_0x25306e){logger[_0xd5af('0x11')](_0xd5af('0xd'),_0x5ddd89,_0x25306e);_0x80e1cd(_0x25306e);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 1cfd81a..dd95d52 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 _0xca14=['get','index','/:id','isAuthenticated','show','/:id/sounds','getSounds','post','create','update','delete','/:id/sounds/:id2','removeSound','exports','util','connect-timeout','express','Router','../../components/auth/service','./voiceMusicOnHold.controller'];(function(_0x2c21fa,_0x5f0a10){var _0x5aafc6=function(_0x1eb171){while(--_0x1eb171){_0x2c21fa['push'](_0x2c21fa['shift']());}};_0x5aafc6(++_0x5f0a10);}(_0xca14,0x1da));var _0x4ca1=function(_0x12f688,_0x585c25){_0x12f688=_0x12f688-0x0;var _0x59c3de=_0xca14[_0x12f688];return _0x59c3de;};'use strict';var multer=require('multer');var util=require(_0x4ca1('0x0'));var path=require('path');var timeout=require(_0x4ca1('0x1'));var express=require(_0x4ca1('0x2'));var router=express[_0x4ca1('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x4ca1('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4ca1('0x5'));router[_0x4ca1('0x6')]('/',auth['isAuthenticated'](),controller[_0x4ca1('0x7')]);router[_0x4ca1('0x6')](_0x4ca1('0x8'),auth[_0x4ca1('0x9')](),controller[_0x4ca1('0xa')]);router[_0x4ca1('0x6')](_0x4ca1('0xb'),auth['isAuthenticated'](),controller[_0x4ca1('0xc')]);router[_0x4ca1('0xd')]('/',auth[_0x4ca1('0x9')](),controller[_0x4ca1('0xe')]);router[_0x4ca1('0xd')](_0x4ca1('0xb'),auth[_0x4ca1('0x9')](),controller['addSound']);router['put']('/:id',auth[_0x4ca1('0x9')](),controller[_0x4ca1('0xf')]);router[_0x4ca1('0x10')](_0x4ca1('0x8'),auth[_0x4ca1('0x9')](),controller['destroy']);router['delete'](_0x4ca1('0x11'),auth[_0x4ca1('0x9')](),controller[_0x4ca1('0x12')]);module[_0x4ca1('0x13')]=router; \ No newline at end of file +var _0xd2a1=['../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated','index','/:id','show','getSounds','post','/:id/sounds','addSound','put','destroy','delete','/:id/sounds/:id2','removeSound','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service'];(function(_0x5908d8,_0x2b839a){var _0x150f7c=function(_0x3a0756){while(--_0x3a0756){_0x5908d8['push'](_0x5908d8['shift']());}};_0x150f7c(++_0x2b839a);}(_0xd2a1,0xa1));var _0x1d2a=function(_0x18546c,_0x4daf94){_0x18546c=_0x18546c-0x0;var _0x46ef43=_0xd2a1[_0x18546c];return _0x46ef43;};'use strict';var multer=require(_0x1d2a('0x0'));var util=require(_0x1d2a('0x1'));var path=require(_0x1d2a('0x2'));var timeout=require(_0x1d2a('0x3'));var express=require(_0x1d2a('0x4'));var router=express['Router']();var fs_extra=require(_0x1d2a('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x1d2a('0x6'));var config=require(_0x1d2a('0x7'));var controller=require(_0x1d2a('0x8'));router[_0x1d2a('0x9')]('/',auth[_0x1d2a('0xa')](),controller[_0x1d2a('0xb')]);router['get'](_0x1d2a('0xc'),auth[_0x1d2a('0xa')](),controller[_0x1d2a('0xd')]);router[_0x1d2a('0x9')]('/:id/sounds',auth[_0x1d2a('0xa')](),controller[_0x1d2a('0xe')]);router[_0x1d2a('0xf')]('/',auth[_0x1d2a('0xa')](),controller['create']);router[_0x1d2a('0xf')](_0x1d2a('0x10'),auth[_0x1d2a('0xa')](),controller[_0x1d2a('0x11')]);router[_0x1d2a('0x12')]('/:id',auth[_0x1d2a('0xa')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x1d2a('0x13')]);router[_0x1d2a('0x14')](_0x1d2a('0x15'),auth[_0x1d2a('0xa')](),controller[_0x1d2a('0x16')]);module[_0x1d2a('0x17')]=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index f4c38d7..cd1054a 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 _0x7d8d=['STRING','name','ENUM','custom','files','mp3nb','quietmp3','mp3','TIMESTAMP','BOOLEAN','sequelize','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7d8d,0x166));var _0xd7d8=function(_0x3f51d7,_0x79e66a){_0x3f51d7=_0x3f51d7-0x0;var _0x3aaf8e=_0x7d8d[_0x3f51d7];return _0x3aaf8e;};'use strict';var Sequelize=require(_0xd7d8('0x0'));module[_0xd7d8('0x1')]={'name':{'type':Sequelize[_0xd7d8('0x2')],'allowNull':![],'unique':_0xd7d8('0x3')},'mode':{'type':Sequelize[_0xd7d8('0x4')](_0xd7d8('0x5'),_0xd7d8('0x6'),_0xd7d8('0x7'),'quietmp3nb',_0xd7d8('0x8'),_0xd7d8('0x9')),'allowNull':!![],'defaultValue':_0xd7d8('0x6')},'directory':{'type':Sequelize[_0xd7d8('0x2')],'allowNull':!![]},'application':{'type':Sequelize[_0xd7d8('0x2')],'allowNull':!![]},'digit':{'type':Sequelize['STRING'],'allowNull':!![]},'sort':{'type':Sequelize[_0xd7d8('0x2')],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize[_0xd7d8('0x2')],'allowNull':!![]},'stamp':{'type':_0xd7d8('0xa')},'defaultEntry':{'type':Sequelize[_0xd7d8('0xb')],'defaultValue':0x0}}; \ No newline at end of file +var _0x8408=['name','custom','files','mp3nb','quietmp3nb','quietmp3','alpha','TIMESTAMP','BOOLEAN','sequelize','exports','STRING'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x8408,0xc9));var _0x8840=function(_0x2f3794,_0x3c3bec){_0x2f3794=_0x2f3794-0x0;var _0x1c9fbe=_0x8408[_0x2f3794];return _0x1c9fbe;};'use strict';var Sequelize=require(_0x8840('0x0'));module[_0x8840('0x1')]={'name':{'type':Sequelize[_0x8840('0x2')],'allowNull':![],'unique':_0x8840('0x3')},'mode':{'type':Sequelize['ENUM'](_0x8840('0x4'),_0x8840('0x5'),_0x8840('0x6'),_0x8840('0x7'),_0x8840('0x8'),'mp3'),'allowNull':!![],'defaultValue':_0x8840('0x5')},'directory':{'type':Sequelize[_0x8840('0x2')],'allowNull':!![]},'application':{'type':Sequelize['STRING'],'allowNull':!![]},'digit':{'type':Sequelize[_0x8840('0x2')],'allowNull':!![]},'sort':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x8840('0x9')},'format':{'type':Sequelize[_0x8840('0x2')],'allowNull':!![]},'stamp':{'type':_0x8840('0xa')},'defaultEntry':{'type':Sequelize[_0x8840('0xb')],'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 a1e8d69..90e9c25 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 _0xe347=['%s.%s','basename','extname','server/files/moh','format','symlinkSync','ValidationError','findOne','id2','unlinkSync','getSounds','eml-format','rimraf','request-promise','moment','mustache','util','to-csv','ejs','lodash','crypto','jsforce','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','get','MusicOnHolds','stack','name','send','index','map','VoiceMusicOnHold','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','find','body','create','transaction','mode','directory','join','root','files','mkdirSync','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','sequelize','rmdirSync','Sequelize','message','addSound','Sound','save_name','converted_format','createdAt','server/files/sounds/converted'];(function(_0x45a4a0,_0x2ed137){var _0xcf3cca=function(_0x56c28a){while(--_0x56c28a){_0x45a4a0['push'](_0x45a4a0['shift']());}};_0xcf3cca(++_0x2ed137);}(_0xe347,0xe7));var _0x7e34=function(_0x4da356,_0x5235e1){_0x4da356=_0x4da356-0x0;var _0x321b07=_0xe347[_0x4da356];return _0x321b07;};'use strict';var emlformat=require(_0x7e34('0x0'));var rimraf=require(_0x7e34('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x7e34('0x2'));var moment=require(_0x7e34('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x7e34('0x4'));var util=require(_0x7e34('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x7e34('0x6'));var ejs=require(_0x7e34('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7e34('0x8'));var squel=require('squel');var crypto=require(_0x7e34('0x9'));var jsforce=require(_0x7e34('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x7e34('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x7e34('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x7e34('0xc'));var as=require(_0x7e34('0xd'));var hardwareService=require(_0x7e34('0xe'));var logger=require(_0x7e34('0xf'))(_0x7e34('0x10'));var utils=require('../../config/utils');var config=require(_0x7e34('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0x7e34('0x12'))['db'];function respondWithStatusCode(_0x1a530c,_0x31c620){_0x31c620=_0x31c620||0xcc;return function(_0x5d3894){if(_0x5d3894){return _0x1a530c[_0x7e34('0x13')](_0x31c620);}return _0x1a530c[_0x7e34('0x14')](_0x31c620)[_0x7e34('0x15')]();};}function respondWithResult(_0x320901,_0x2fdb54){_0x2fdb54=_0x2fdb54||0xc8;return function(_0x1efdda){if(_0x1efdda){return _0x320901[_0x7e34('0x14')](_0x2fdb54)[_0x7e34('0x16')](_0x1efdda);}};}function respondWithFilteredResult(_0x5155fb,_0xe4fd7d){return function(_0x539d5b){if(_0x539d5b){var _0x1bfc2b=typeof _0xe4fd7d[_0x7e34('0x17')]===_0x7e34('0x18')&&typeof _0xe4fd7d[_0x7e34('0x19')]===_0x7e34('0x18');var _0x15c3a6=_0x539d5b[_0x7e34('0x1a')];var _0x20b4d0=_0x1bfc2b?0x0:_0xe4fd7d['offset'];var _0x159f68=_0x1bfc2b?_0x539d5b[_0x7e34('0x1a')]:_0xe4fd7d[_0x7e34('0x17')]+_0xe4fd7d['limit'];var _0x4f6245;if(_0x159f68>=_0x15c3a6){_0x159f68=_0x15c3a6;_0x4f6245=0xc8;}else{_0x4f6245=0xce;}_0x5155fb[_0x7e34('0x14')](_0x4f6245);return _0x5155fb['set'](_0x7e34('0x1b'),_0x20b4d0+'-'+_0x159f68+'/'+_0x15c3a6)[_0x7e34('0x16')](_0x539d5b);}return null;};}function patchUpdates(_0x36eb18){return function(_0x94743b){try{jsonpatch[_0x7e34('0x1c')](_0x94743b,_0x36eb18,!![]);}catch(_0x123584){return BPromise[_0x7e34('0x1d')](_0x123584);}return _0x94743b[_0x7e34('0x1e')]();};}function saveUpdates(_0x1d06cf,_0x6b13d9){return function(_0x254dd1){if(_0x254dd1){return _0x254dd1[_0x7e34('0x1f')](_0x1d06cf)[_0x7e34('0x20')](function(_0x6ba402){return _0x6ba402;});}return null;};}function removeEntity(_0x56d722,_0x118410){return function(_0x49b891){if(_0x49b891){return _0x49b891[_0x7e34('0x21')]()[_0x7e34('0x20')](function(){var _0x56a03b=_0x49b891[_0x7e34('0x22')]({'plain':!![]});var _0x53c177=_0x7e34('0x23');return db['UserProfileResource'][_0x7e34('0x21')]({'where':{'type':_0x53c177,'resourceId':_0x56a03b['id']}})[_0x7e34('0x20')](function(){return _0x49b891;});})[_0x7e34('0x20')](function(){_0x56d722[_0x7e34('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3daf63,_0x1bc164){return function(_0x4c7262){if(!_0x4c7262){_0x3daf63[_0x7e34('0x13')](0x194);}return _0x4c7262;};}function handleError(_0x396309,_0x5dbbfa){_0x5dbbfa=_0x5dbbfa||0x1f4;return function(_0x1d5264){logger['error'](_0x1d5264[_0x7e34('0x24')]);if(_0x1d5264[_0x7e34('0x25')]){delete _0x1d5264['name'];}_0x396309['status'](_0x5dbbfa)[_0x7e34('0x26')](_0x1d5264);};}exports[_0x7e34('0x27')]=function(_0x5c8777,_0x31006b){var _0x3dc6d9={},_0x4b55ca={},_0x4f1fdd={'count':0x0,'rows':[]};var _0x24f139=_[_0x7e34('0x28')](db[_0x7e34('0x29')][_0x7e34('0x2a')],function(_0x36c8f8){return{'name':_0x36c8f8[_0x7e34('0x2b')],'type':_0x36c8f8[_0x7e34('0x2c')][_0x7e34('0x2d')]};});_0x4b55ca[_0x7e34('0x2e')]=_[_0x7e34('0x28')](_0x24f139,'name');_0x4b55ca[_0x7e34('0x2f')]=_['keys'](_0x5c8777['query']);_0x4b55ca[_0x7e34('0x30')]=_[_0x7e34('0x31')](_0x4b55ca[_0x7e34('0x2e')],_0x4b55ca[_0x7e34('0x2f')]);_0x3dc6d9[_0x7e34('0x32')]=_['intersection'](_0x4b55ca[_0x7e34('0x2e')],qs[_0x7e34('0x33')](_0x5c8777[_0x7e34('0x2f')][_0x7e34('0x33')]));_0x3dc6d9[_0x7e34('0x32')]=_0x3dc6d9[_0x7e34('0x32')][_0x7e34('0x34')]?_0x3dc6d9[_0x7e34('0x32')]:_0x4b55ca['model'];if(!_0x5c8777[_0x7e34('0x2f')][_0x7e34('0x35')](_0x7e34('0x36'))){_0x3dc6d9['limit']=qs['limit'](_0x5c8777[_0x7e34('0x2f')][_0x7e34('0x19')]);_0x3dc6d9[_0x7e34('0x17')]=qs[_0x7e34('0x17')](_0x5c8777[_0x7e34('0x2f')][_0x7e34('0x17')]);}_0x3dc6d9[_0x7e34('0x37')]=qs[_0x7e34('0x38')](_0x5c8777[_0x7e34('0x2f')][_0x7e34('0x38')]);delete _0x5c8777[_0x7e34('0x2f')]['sort'];_0x3dc6d9['where']=qs[_0x7e34('0x30')](_[_0x7e34('0x39')](_0x5c8777['query'],_0x4b55ca[_0x7e34('0x30')]),_0x24f139);if(_0x5c8777['query'][_0x7e34('0x3a')]){_0x3dc6d9[_0x7e34('0x3b')]=_['merge'](_0x3dc6d9[_0x7e34('0x3b')],{'$or':_[_0x7e34('0x28')](_0x24f139,function(_0x29bf2f){if(_0x29bf2f[_0x7e34('0x2c')]!==_0x7e34('0x3c')){var _0x125e58={};_0x125e58[_0x29bf2f[_0x7e34('0x25')]]={'$like':'%'+_0x5c8777['query']['filter']+'%'};return _0x125e58;}})});}_0x3dc6d9=_[_0x7e34('0x3d')]({},_0x3dc6d9,_0x5c8777[_0x7e34('0x3e')]);var _0x5c2e5e={'where':_0x3dc6d9[_0x7e34('0x3b')]};return db[_0x7e34('0x29')][_0x7e34('0x1a')](_0x5c2e5e)[_0x7e34('0x20')](function(_0x5ebc32){_0x4f1fdd['count']=_0x5ebc32;if(_0x5c8777[_0x7e34('0x2f')][_0x7e34('0x3f')]){_0x3dc6d9[_0x7e34('0x40')]=[{'all':!![]}];}return db['VoiceMusicOnHold'][_0x7e34('0x41')](_0x3dc6d9);})[_0x7e34('0x20')](function(_0x84dc0b){_0x4f1fdd[_0x7e34('0x42')]=_0x84dc0b;return _0x4f1fdd;})['then'](respondWithFilteredResult(_0x31006b,_0x3dc6d9))[_0x7e34('0x43')](handleError(_0x31006b,null));};exports[_0x7e34('0x44')]=function(_0x48e725,_0x280d6a){var _0x247834={'raw':![],'where':{'id':_0x48e725[_0x7e34('0x45')]['id']}},_0x225c94={};_0x225c94[_0x7e34('0x2e')]=_['keys'](db['VoiceMusicOnHold'][_0x7e34('0x2a')]);_0x225c94[_0x7e34('0x2f')]=_[_0x7e34('0x46')](_0x48e725[_0x7e34('0x2f')]);_0x225c94[_0x7e34('0x30')]=_[_0x7e34('0x31')](_0x225c94[_0x7e34('0x2e')],_0x225c94[_0x7e34('0x2f')]);_0x247834[_0x7e34('0x32')]=_['intersection'](_0x225c94[_0x7e34('0x2e')],qs['fields'](_0x48e725[_0x7e34('0x2f')][_0x7e34('0x33')]));_0x247834[_0x7e34('0x32')]=_0x247834['attributes'][_0x7e34('0x34')]?_0x247834[_0x7e34('0x32')]:_0x225c94[_0x7e34('0x2e')];if(_0x48e725[_0x7e34('0x2f')][_0x7e34('0x3f')]){_0x247834[_0x7e34('0x40')]=[{'all':!![]}];}_0x247834=_[_0x7e34('0x3d')]({},_0x247834,_0x48e725[_0x7e34('0x3e')]);return db[_0x7e34('0x29')][_0x7e34('0x47')](_0x247834)[_0x7e34('0x20')](handleEntityNotFound(_0x280d6a,null))[_0x7e34('0x20')](respondWithResult(_0x280d6a,null))['catch'](handleError(_0x280d6a,null));};exports[_0x7e34('0x1f')]=function(_0xca7323,_0x4a8c1f){if(_0xca7323[_0x7e34('0x48')]['id']){delete _0xca7323['body']['id'];}return db[_0x7e34('0x29')][_0x7e34('0x47')]({'where':{'id':_0xca7323[_0x7e34('0x45')]['id']}})[_0x7e34('0x20')](handleEntityNotFound(_0x4a8c1f,null))[_0x7e34('0x20')](saveUpdates(_0xca7323['body'],null))['then'](respondWithResult(_0x4a8c1f,null))['catch'](handleError(_0x4a8c1f,null));};exports[_0x7e34('0x49')]=function(_0x29c802,_0x5d3d23,_0x48f937){return db['sequelize'][_0x7e34('0x4a')](function(_0xb628a9){if(_0x29c802['body'][_0x7e34('0x4b')]==='files'){_0x29c802[_0x7e34('0x48')][_0x7e34('0x4c')]=path[_0x7e34('0x4d')](config[_0x7e34('0x4e')],'server/files/moh',_0x29c802[_0x7e34('0x48')][_0x7e34('0x25')]);}return db[_0x7e34('0x29')]['create'](_0x29c802[_0x7e34('0x48')],{'transaction':_0xb628a9})[_0x7e34('0x20')](function(_0x245c83){if(_0x29c802[_0x7e34('0x48')]['mode']===_0x7e34('0x4f')){fs[_0x7e34('0x50')](_0x245c83[_0x7e34('0x4c')],parseInt('0777',0x8));}var _0x527554=_0x29c802[_0x7e34('0x51')]['get']({'plain':!![]});if(!_0x527554)throw new Error(_0x7e34('0x52'));if(_0x527554[_0x7e34('0x53')]===_0x7e34('0x51')){var _0xdaea98=_0x245c83[_0x7e34('0x22')]({'plain':!![]});return db[_0x7e34('0x54')][_0x7e34('0x47')]({'where':{'name':'MusicOnHolds','userProfileId':_0x527554[_0x7e34('0x55')]},'raw':!![]})[_0x7e34('0x20')](function(_0x5c07d1){if(_0x5c07d1&&_0x5c07d1['autoAssociation']===0x0){return db[_0x7e34('0x56')]['create']({'name':_0xdaea98['name'],'resourceId':_0xdaea98['id'],'type':_0x5c07d1[_0x7e34('0x25')],'sectionId':_0x5c07d1['id']},{})['then'](function(){return _0x245c83;});}else{return _0x245c83;}})['catch'](function(_0x3b9895){logger[_0x7e34('0x57')](_0x7e34('0x58'),_0x3b9895);});}return _0x245c83;});})[_0x7e34('0x20')](respondWithResult(_0x5d3d23,0xc9))[_0x7e34('0x43')](handleError(_0x5d3d23,null));};exports[_0x7e34('0x21')]=function(_0x50c9cc,_0x2979d2,_0x274acc){var _0x3261de;return db['VoiceMusicOnHold'][_0x7e34('0x47')]({'where':{'id':_0x50c9cc['params']['id']}})[_0x7e34('0x20')](function(_0xc1d70b){if(_0xc1d70b){return db[_0x7e34('0x59')][_0x7e34('0x4a')](function(_0x3abb45){return _0xc1d70b[_0x7e34('0x21')]({'transaction':_0x3abb45,'raw':!![]})[_0x7e34('0x20')](function(_0x255928){if(_0x255928[_0x7e34('0x4c')]){fs['readdirSync'](_0x255928[_0x7e34('0x4c')])['forEach'](function(_0x272a6d){fs['unlinkSync'](path['join'](_0x255928[_0x7e34('0x4c')],_0x272a6d));});fs[_0x7e34('0x5a')](_0x255928[_0x7e34('0x4c')]);}return _0x255928;});})[_0x7e34('0x43')](function(_0x1069c8){throw new db[(_0x7e34('0x5b'))]['ValidationError'](_0x1069c8[_0x7e34('0x5c')]);});}})[_0x7e34('0x20')](handleEntityNotFound(_0x2979d2,null))[_0x7e34('0x20')](removeEntity(_0x2979d2,null))[_0x7e34('0x43')](handleError(_0x2979d2,null));};exports['addSound']=function(_0x588e09,_0x32a3c9,_0xedd755){return db['sequelize'][_0x7e34('0x4a')](function(_0x5d2211){var _0x2a0afb;return db['VoiceMusicOnHold'][_0x7e34('0x47')]({'where':{'id':_0x588e09['params']['id']}})[_0x7e34('0x20')](function(_0xf2f49c){if(_0xf2f49c){_0x2a0afb=_0xf2f49c;return _0xf2f49c[_0x7e34('0x5d')](_0x588e09['body']['id'],{'transaction':_0x5d2211});}})['then'](function(_0x5aec27){if(_0x5aec27){return db[_0x7e34('0x5e')]['findOne']({'where':{'id':_0x588e09[_0x7e34('0x48')]['id']},'attributes':['id',_0x7e34('0x25'),_0x7e34('0x5f'),_0x7e34('0x60'),_0x7e34('0x61')],'raw':!![]});}})[_0x7e34('0x20')](function(_0x1780b5){if(_0x1780b5){var _0x150ed8=path[_0x7e34('0x4d')](config[_0x7e34('0x4e')],_0x7e34('0x62'),util['format'](_0x7e34('0x63'),path[_0x7e34('0x64')](_0x1780b5[_0x7e34('0x5f')],path[_0x7e34('0x65')](_0x1780b5[_0x7e34('0x5f')])),_0x1780b5[_0x7e34('0x60')]));var _0x326689=path[_0x7e34('0x4d')](config[_0x7e34('0x4e')],_0x7e34('0x66'),_0x2a0afb[_0x7e34('0x25')],util[_0x7e34('0x67')](_0x7e34('0x63'),_0x1780b5[_0x7e34('0x25')],_0x1780b5[_0x7e34('0x60')]));fs[_0x7e34('0x68')](_0x150ed8,_0x326689);return _0x1780b5;}})[_0x7e34('0x43')](function(_0x6b81a8){throw new db[(_0x7e34('0x5b'))][(_0x7e34('0x69'))](_0x6b81a8['message']);});})['then'](handleEntityNotFound(_0x32a3c9,null))[_0x7e34('0x20')](respondWithResult(_0x32a3c9,0xc9))[_0x7e34('0x43')](handleError(_0x32a3c9,null));};exports['removeSound']=function(_0x2b880b,_0x2f67d7,_0x1683e6){return db[_0x7e34('0x59')][_0x7e34('0x4a')](function(_0x38efd9){var _0xb2ab23;return db[_0x7e34('0x29')][_0x7e34('0x6a')]({'where':{'id':_0x2b880b[_0x7e34('0x45')]['id']}})[_0x7e34('0x20')](handleEntityNotFound(_0x2f67d7,null))['then'](function(_0xdd65f4){if(_0xdd65f4){_0xb2ab23=_0xdd65f4;return _0xdd65f4['removeSound'](_0x2b880b[_0x7e34('0x45')][_0x7e34('0x6b')]);}})[_0x7e34('0x20')](function(_0x332ff3){if(_0x332ff3){return db['Sound'][_0x7e34('0x6a')]({'where':{'id':_0x2b880b[_0x7e34('0x45')]['id2']},'attributes':['id',_0x7e34('0x25'),'save_name',_0x7e34('0x60'),_0x7e34('0x61')],'raw':!![]});}})[_0x7e34('0x20')](function(_0x4fe1be){if(_0x4fe1be){fs[_0x7e34('0x6c')](path[_0x7e34('0x4d')](_0xb2ab23[_0x7e34('0x4c')],util['format'](_0x7e34('0x63'),_0x4fe1be[_0x7e34('0x25')],_0x4fe1be[_0x7e34('0x60')])));return _0x4fe1be;}})[_0x7e34('0x43')](function(_0x38e9c4){throw new db[(_0x7e34('0x5b'))][(_0x7e34('0x69'))](_0x38e9c4[_0x7e34('0x5c')]);});})['then'](handleEntityNotFound(_0x2f67d7,null))[_0x7e34('0x20')](respondWithStatusCode(_0x2f67d7,0xcc))['catch'](handleError(_0x2f67d7,null));};exports[_0x7e34('0x6d')]=function(_0x3a26e5,_0x38d088,_0x52e165){var _0x3089ab={};var _0x326d33={};var _0x26e661;var _0x22ebac;return db['VoiceMusicOnHold']['findOne']({'where':{'id':_0x3a26e5[_0x7e34('0x45')]['id']}})[_0x7e34('0x20')](handleEntityNotFound(_0x38d088,null))[_0x7e34('0x20')](function(_0x1a38e5){if(_0x1a38e5){_0x26e661=_0x1a38e5;_0x326d33[_0x7e34('0x2e')]=_['keys'](db[_0x7e34('0x5e')]['rawAttributes']);_0x326d33[_0x7e34('0x2f')]=_[_0x7e34('0x46')](_0x3a26e5[_0x7e34('0x2f')]);_0x326d33[_0x7e34('0x30')]=_[_0x7e34('0x31')](_0x326d33[_0x7e34('0x2e')],_0x326d33[_0x7e34('0x2f')]);_0x3089ab[_0x7e34('0x32')]=_[_0x7e34('0x31')](_0x326d33[_0x7e34('0x2e')],qs['fields'](_0x3a26e5[_0x7e34('0x2f')][_0x7e34('0x33')]));_0x3089ab[_0x7e34('0x32')]=_0x3089ab[_0x7e34('0x32')]['length']?_0x3089ab[_0x7e34('0x32')]:_0x326d33[_0x7e34('0x2e')];_0x3089ab[_0x7e34('0x37')]=qs['sort'](_0x3a26e5[_0x7e34('0x2f')]['sort']);_0x3089ab[_0x7e34('0x3b')]=qs[_0x7e34('0x30')](_[_0x7e34('0x39')](_0x3a26e5[_0x7e34('0x2f')],_0x326d33[_0x7e34('0x30')]));if(_0x3a26e5[_0x7e34('0x2f')][_0x7e34('0x3a')]){_0x3089ab[_0x7e34('0x3b')]=_[_0x7e34('0x3d')](_0x3089ab[_0x7e34('0x3b')],{'$or':_[_0x7e34('0x28')](_0x3089ab[_0x7e34('0x32')],function(_0x6fd191){var _0x125764={};_0x125764[_0x6fd191]={'$like':'%'+_0x3a26e5[_0x7e34('0x2f')][_0x7e34('0x3a')]+'%'};return _0x125764;})});}_0x3089ab=_[_0x7e34('0x3d')]({},_0x3089ab,_0x3a26e5[_0x7e34('0x3e')]);return _0x26e661[_0x7e34('0x6d')](_0x3089ab);}})[_0x7e34('0x20')](function(_0x51b657){if(_0x51b657){_0x22ebac=_0x51b657[_0x7e34('0x34')];if(!_0x3a26e5[_0x7e34('0x2f')][_0x7e34('0x35')](_0x7e34('0x36'))){_0x3089ab['limit']=qs['limit'](_0x3a26e5['query'][_0x7e34('0x19')]);_0x3089ab[_0x7e34('0x17')]=qs[_0x7e34('0x17')](_0x3a26e5[_0x7e34('0x2f')][_0x7e34('0x17')]);}return _0x26e661[_0x7e34('0x6d')](_0x3089ab);}})[_0x7e34('0x20')](function(_0x531c84){if(_0x531c84){return _0x531c84?{'count':_0x22ebac,'rows':_0x531c84}:null;}})[_0x7e34('0x20')](respondWithResult(_0x38d088,null))[_0x7e34('0x43')](handleError(_0x38d088,null));}; \ No newline at end of file +var _0xaef3=['role','userProfileId','autoAssociation','sequelize','readdirSync','unlinkSync','Sequelize','message','Sound','save_name','format','%s.%s','basename','extname','converted_format','symlinkSync','ValidationError','removeSound','findOne','id2','createdAt','pick','getSounds','hasOwnProperty','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','then','destroy','get','MusicOnHolds','UserProfileResource','error','stack','name','send','index','map','VoiceMusicOnHold','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','catch','update','body','transaction','mode','files','directory','join','root','server/files/moh','create','mkdirSync','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0xff9111,_0x289f3d){var _0x3fd55a=function(_0x145f0c){while(--_0x145f0c){_0xff9111['push'](_0xff9111['shift']());}};_0x3fd55a(++_0x289f3d);}(_0xaef3,0x1f4));var _0x3aef=function(_0x3dfeb9,_0x1cc6e4){_0x3dfeb9=_0x3dfeb9-0x0;var _0x412314=_0xaef3[_0x3dfeb9];return _0x412314;};'use strict';var emlformat=require(_0x3aef('0x0'));var rimraf=require(_0x3aef('0x1'));var zipdir=require(_0x3aef('0x2'));var jsonpatch=require(_0x3aef('0x3'));var rp=require('request-promise');var moment=require(_0x3aef('0x4'));var BPromise=require(_0x3aef('0x5'));var Mustache=require(_0x3aef('0x6'));var util=require('util');var path=require(_0x3aef('0x7'));var sox=require(_0x3aef('0x8'));var csv=require('to-csv');var ejs=require(_0x3aef('0x9'));var fs=require('fs');var fs_extra=require(_0x3aef('0xa'));var _=require(_0x3aef('0xb'));var squel=require(_0x3aef('0xc'));var crypto=require(_0x3aef('0xd'));var jsforce=require(_0x3aef('0xe'));var deskjs=require(_0x3aef('0xf'));var toCsv=require(_0x3aef('0x10'));var querystring=require(_0x3aef('0x11'));var Papa=require(_0x3aef('0x12'));var Redis=require(_0x3aef('0x13'));var authService=require(_0x3aef('0x14'));var qs=require(_0x3aef('0x15'));var as=require(_0x3aef('0x16'));var hardwareService=require(_0x3aef('0x17'));var logger=require(_0x3aef('0x18'))(_0x3aef('0x19'));var utils=require(_0x3aef('0x1a'));var config=require(_0x3aef('0x1b'));var licenseUtil=require(_0x3aef('0x1c'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x409ffd,_0x16c72f){_0x16c72f=_0x16c72f||0xcc;return function(_0x5ecaa5){if(_0x5ecaa5){return _0x409ffd[_0x3aef('0x1d')](_0x16c72f);}return _0x409ffd[_0x3aef('0x1e')](_0x16c72f)[_0x3aef('0x1f')]();};}function respondWithResult(_0xd6c179,_0x5c5ef9){_0x5c5ef9=_0x5c5ef9||0xc8;return function(_0x5cc42f){if(_0x5cc42f){return _0xd6c179[_0x3aef('0x1e')](_0x5c5ef9)[_0x3aef('0x20')](_0x5cc42f);}};}function respondWithFilteredResult(_0x322447,_0x5148ca){return function(_0x32aaa4){if(_0x32aaa4){var _0x5550e7=typeof _0x5148ca[_0x3aef('0x21')]==='undefined'&&typeof _0x5148ca[_0x3aef('0x22')]===_0x3aef('0x23');var _0x57760d=_0x32aaa4[_0x3aef('0x24')];var _0x56040b=_0x5550e7?0x0:_0x5148ca['offset'];var _0x1f99ce=_0x5550e7?_0x32aaa4[_0x3aef('0x24')]:_0x5148ca[_0x3aef('0x21')]+_0x5148ca[_0x3aef('0x22')];var _0x1b22d1;if(_0x1f99ce>=_0x57760d){_0x1f99ce=_0x57760d;_0x1b22d1=0xc8;}else{_0x1b22d1=0xce;}_0x322447['status'](_0x1b22d1);return _0x322447['set'](_0x3aef('0x25'),_0x56040b+'-'+_0x1f99ce+'/'+_0x57760d)['json'](_0x32aaa4);}return null;};}function patchUpdates(_0x361123){return function(_0x1f331f){try{jsonpatch[_0x3aef('0x26')](_0x1f331f,_0x361123,!![]);}catch(_0x2cc1c4){return BPromise[_0x3aef('0x27')](_0x2cc1c4);}return _0x1f331f[_0x3aef('0x28')]();};}function saveUpdates(_0x2567dc,_0x2a2bce){return function(_0x3f6a4a){if(_0x3f6a4a){return _0x3f6a4a['update'](_0x2567dc)[_0x3aef('0x29')](function(_0x171e58){return _0x171e58;});}return null;};}function removeEntity(_0xb786aa,_0x39b2ff){return function(_0xd021cd){if(_0xd021cd){return _0xd021cd[_0x3aef('0x2a')]()['then'](function(){var _0x5331eb=_0xd021cd[_0x3aef('0x2b')]({'plain':!![]});var _0x1b9cb7=_0x3aef('0x2c');return db[_0x3aef('0x2d')][_0x3aef('0x2a')]({'where':{'type':_0x1b9cb7,'resourceId':_0x5331eb['id']}})[_0x3aef('0x29')](function(){return _0xd021cd;});})[_0x3aef('0x29')](function(){_0xb786aa[_0x3aef('0x1e')](0xcc)[_0x3aef('0x1f')]();});}};}function handleEntityNotFound(_0x5094c6,_0xdbdb3f){return function(_0x3a86d8){if(!_0x3a86d8){_0x5094c6['sendStatus'](0x194);}return _0x3a86d8;};}function handleError(_0x517e91,_0x40787d){_0x40787d=_0x40787d||0x1f4;return function(_0x28ed76){logger[_0x3aef('0x2e')](_0x28ed76[_0x3aef('0x2f')]);if(_0x28ed76[_0x3aef('0x30')]){delete _0x28ed76[_0x3aef('0x30')];}_0x517e91[_0x3aef('0x1e')](_0x40787d)[_0x3aef('0x31')](_0x28ed76);};}exports[_0x3aef('0x32')]=function(_0x167d44,_0x32d8ba){var _0x9676a6={},_0x57e7d8={},_0x5130d4={'count':0x0,'rows':[]};var _0x41dc68=_[_0x3aef('0x33')](db[_0x3aef('0x34')][_0x3aef('0x35')],function(_0xc61a2e){return{'name':_0xc61a2e[_0x3aef('0x36')],'type':_0xc61a2e[_0x3aef('0x37')][_0x3aef('0x38')]};});_0x57e7d8['model']=_['map'](_0x41dc68,_0x3aef('0x30'));_0x57e7d8[_0x3aef('0x39')]=_[_0x3aef('0x3a')](_0x167d44[_0x3aef('0x39')]);_0x57e7d8['filters']=_[_0x3aef('0x3b')](_0x57e7d8[_0x3aef('0x3c')],_0x57e7d8['query']);_0x9676a6[_0x3aef('0x3d')]=_[_0x3aef('0x3b')](_0x57e7d8['model'],qs[_0x3aef('0x3e')](_0x167d44[_0x3aef('0x39')]['fields']));_0x9676a6[_0x3aef('0x3d')]=_0x9676a6['attributes'][_0x3aef('0x3f')]?_0x9676a6[_0x3aef('0x3d')]:_0x57e7d8[_0x3aef('0x3c')];if(!_0x167d44[_0x3aef('0x39')]['hasOwnProperty'](_0x3aef('0x40'))){_0x9676a6[_0x3aef('0x22')]=qs[_0x3aef('0x22')](_0x167d44['query'][_0x3aef('0x22')]);_0x9676a6[_0x3aef('0x21')]=qs[_0x3aef('0x21')](_0x167d44[_0x3aef('0x39')]['offset']);}_0x9676a6[_0x3aef('0x41')]=qs['sort'](_0x167d44['query'][_0x3aef('0x42')]);delete _0x167d44[_0x3aef('0x39')][_0x3aef('0x42')];_0x9676a6[_0x3aef('0x43')]=qs[_0x3aef('0x44')](_['pick'](_0x167d44['query'],_0x57e7d8[_0x3aef('0x44')]),_0x41dc68);if(_0x167d44[_0x3aef('0x39')][_0x3aef('0x45')]){_0x9676a6[_0x3aef('0x43')]=_[_0x3aef('0x46')](_0x9676a6[_0x3aef('0x43')],{'$or':_['map'](_0x41dc68,function(_0xf5b014){if(_0xf5b014[_0x3aef('0x37')]!==_0x3aef('0x47')){var _0x414cad={};_0x414cad[_0xf5b014[_0x3aef('0x30')]]={'$like':'%'+_0x167d44[_0x3aef('0x39')][_0x3aef('0x45')]+'%'};return _0x414cad;}})});}_0x9676a6=_['merge']({},_0x9676a6,_0x167d44[_0x3aef('0x48')]);var _0x4a7bff={'where':_0x9676a6[_0x3aef('0x43')]};return db['VoiceMusicOnHold'][_0x3aef('0x24')](_0x4a7bff)[_0x3aef('0x29')](function(_0x44957b){_0x5130d4[_0x3aef('0x24')]=_0x44957b;if(_0x167d44[_0x3aef('0x39')][_0x3aef('0x49')]){_0x9676a6[_0x3aef('0x4a')]=[{'all':!![]}];}return db[_0x3aef('0x34')][_0x3aef('0x4b')](_0x9676a6);})[_0x3aef('0x29')](function(_0x221fbf){_0x5130d4[_0x3aef('0x4c')]=_0x221fbf;return _0x5130d4;})[_0x3aef('0x29')](respondWithFilteredResult(_0x32d8ba,_0x9676a6))['catch'](handleError(_0x32d8ba,null));};exports[_0x3aef('0x4d')]=function(_0x3295e6,_0x4b9905){var _0x5abebb={'raw':![],'where':{'id':_0x3295e6[_0x3aef('0x4e')]['id']}},_0x3c6e2c={};_0x3c6e2c[_0x3aef('0x3c')]=_['keys'](db['VoiceMusicOnHold'][_0x3aef('0x35')]);_0x3c6e2c[_0x3aef('0x39')]=_['keys'](_0x3295e6[_0x3aef('0x39')]);_0x3c6e2c[_0x3aef('0x44')]=_[_0x3aef('0x3b')](_0x3c6e2c['model'],_0x3c6e2c[_0x3aef('0x39')]);_0x5abebb[_0x3aef('0x3d')]=_[_0x3aef('0x3b')](_0x3c6e2c['model'],qs[_0x3aef('0x3e')](_0x3295e6[_0x3aef('0x39')]['fields']));_0x5abebb[_0x3aef('0x3d')]=_0x5abebb[_0x3aef('0x3d')][_0x3aef('0x3f')]?_0x5abebb[_0x3aef('0x3d')]:_0x3c6e2c[_0x3aef('0x3c')];if(_0x3295e6[_0x3aef('0x39')][_0x3aef('0x49')]){_0x5abebb[_0x3aef('0x4a')]=[{'all':!![]}];}_0x5abebb=_[_0x3aef('0x46')]({},_0x5abebb,_0x3295e6[_0x3aef('0x48')]);return db[_0x3aef('0x34')][_0x3aef('0x4f')](_0x5abebb)[_0x3aef('0x29')](handleEntityNotFound(_0x4b9905,null))['then'](respondWithResult(_0x4b9905,null))[_0x3aef('0x50')](handleError(_0x4b9905,null));};exports[_0x3aef('0x51')]=function(_0x46283,_0x211016){if(_0x46283[_0x3aef('0x52')]['id']){delete _0x46283[_0x3aef('0x52')]['id'];}return db['VoiceMusicOnHold'][_0x3aef('0x4f')]({'where':{'id':_0x46283[_0x3aef('0x4e')]['id']}})['then'](handleEntityNotFound(_0x211016,null))['then'](saveUpdates(_0x46283[_0x3aef('0x52')],null))[_0x3aef('0x29')](respondWithResult(_0x211016,null))[_0x3aef('0x50')](handleError(_0x211016,null));};exports['create']=function(_0x3716c6,_0x156e79,_0x512934){return db['sequelize'][_0x3aef('0x53')](function(_0xeb8ac){if(_0x3716c6[_0x3aef('0x52')][_0x3aef('0x54')]===_0x3aef('0x55')){_0x3716c6['body'][_0x3aef('0x56')]=path[_0x3aef('0x57')](config[_0x3aef('0x58')],_0x3aef('0x59'),_0x3716c6[_0x3aef('0x52')]['name']);}return db['VoiceMusicOnHold'][_0x3aef('0x5a')](_0x3716c6[_0x3aef('0x52')],{'transaction':_0xeb8ac})[_0x3aef('0x29')](function(_0x582e57){if(_0x3716c6['body']['mode']==='files'){fs[_0x3aef('0x5b')](_0x582e57['directory'],parseInt(_0x3aef('0x5c'),0x8));}var _0x4c8258=_0x3716c6[_0x3aef('0x5d')]['get']({'plain':!![]});if(!_0x4c8258)throw new Error(_0x3aef('0x5e'));if(_0x4c8258[_0x3aef('0x5f')]==='user'){var _0x21773a=_0x582e57['get']({'plain':!![]});return db['UserProfileSection'][_0x3aef('0x4f')]({'where':{'name':_0x3aef('0x2c'),'userProfileId':_0x4c8258[_0x3aef('0x60')]},'raw':!![]})[_0x3aef('0x29')](function(_0x3fe20b){if(_0x3fe20b&&_0x3fe20b[_0x3aef('0x61')]===0x0){return db[_0x3aef('0x2d')]['create']({'name':_0x21773a[_0x3aef('0x30')],'resourceId':_0x21773a['id'],'type':_0x3fe20b[_0x3aef('0x30')],'sectionId':_0x3fe20b['id']},{})['then'](function(){return _0x582e57;});}else{return _0x582e57;}})[_0x3aef('0x50')](function(_0x301017){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x301017);});}return _0x582e57;});})[_0x3aef('0x29')](respondWithResult(_0x156e79,0xc9))[_0x3aef('0x50')](handleError(_0x156e79,null));};exports[_0x3aef('0x2a')]=function(_0x46d29f,_0x4e62bc,_0x295b9d){var _0x1e90b7;return db['VoiceMusicOnHold']['find']({'where':{'id':_0x46d29f[_0x3aef('0x4e')]['id']}})[_0x3aef('0x29')](function(_0x2b7be0){if(_0x2b7be0){return db[_0x3aef('0x62')][_0x3aef('0x53')](function(_0x4a0aee){return _0x2b7be0[_0x3aef('0x2a')]({'transaction':_0x4a0aee,'raw':!![]})[_0x3aef('0x29')](function(_0x2b73e1){if(_0x2b73e1['directory']){fs[_0x3aef('0x63')](_0x2b73e1[_0x3aef('0x56')])['forEach'](function(_0x26f6c1){fs[_0x3aef('0x64')](path[_0x3aef('0x57')](_0x2b73e1[_0x3aef('0x56')],_0x26f6c1));});fs['rmdirSync'](_0x2b73e1[_0x3aef('0x56')]);}return _0x2b73e1;});})['catch'](function(_0x52b1d7){throw new db[(_0x3aef('0x65'))]['ValidationError'](_0x52b1d7[_0x3aef('0x66')]);});}})['then'](handleEntityNotFound(_0x4e62bc,null))[_0x3aef('0x29')](removeEntity(_0x4e62bc,null))[_0x3aef('0x50')](handleError(_0x4e62bc,null));};exports['addSound']=function(_0x48b59e,_0x44b90e,_0x3cac35){return db[_0x3aef('0x62')][_0x3aef('0x53')](function(_0x5ce101){var _0x16160e;return db[_0x3aef('0x34')][_0x3aef('0x4f')]({'where':{'id':_0x48b59e[_0x3aef('0x4e')]['id']}})[_0x3aef('0x29')](function(_0x59ff8c){if(_0x59ff8c){_0x16160e=_0x59ff8c;return _0x59ff8c['addSound'](_0x48b59e[_0x3aef('0x52')]['id'],{'transaction':_0x5ce101});}})['then'](function(_0x33b663){if(_0x33b663){return db[_0x3aef('0x67')]['findOne']({'where':{'id':_0x48b59e[_0x3aef('0x52')]['id']},'attributes':['id',_0x3aef('0x30'),_0x3aef('0x68'),'converted_format','createdAt'],'raw':!![]});}})[_0x3aef('0x29')](function(_0x3d12e5){if(_0x3d12e5){var _0x40db01=path['join'](config[_0x3aef('0x58')],'server/files/sounds/converted',util[_0x3aef('0x69')](_0x3aef('0x6a'),path[_0x3aef('0x6b')](_0x3d12e5[_0x3aef('0x68')],path[_0x3aef('0x6c')](_0x3d12e5[_0x3aef('0x68')])),_0x3d12e5[_0x3aef('0x6d')]));var _0x2c97b5=path[_0x3aef('0x57')](config[_0x3aef('0x58')],_0x3aef('0x59'),_0x16160e[_0x3aef('0x30')],util['format'](_0x3aef('0x6a'),_0x3d12e5[_0x3aef('0x30')],_0x3d12e5[_0x3aef('0x6d')]));fs[_0x3aef('0x6e')](_0x40db01,_0x2c97b5);return _0x3d12e5;}})['catch'](function(_0x32531a){throw new db['Sequelize'][(_0x3aef('0x6f'))](_0x32531a[_0x3aef('0x66')]);});})[_0x3aef('0x29')](handleEntityNotFound(_0x44b90e,null))[_0x3aef('0x29')](respondWithResult(_0x44b90e,0xc9))['catch'](handleError(_0x44b90e,null));};exports[_0x3aef('0x70')]=function(_0x439a4d,_0x5f45fe,_0x373563){return db['sequelize'][_0x3aef('0x53')](function(_0xf8d79a){var _0x539a8c;return db['VoiceMusicOnHold'][_0x3aef('0x71')]({'where':{'id':_0x439a4d['params']['id']}})[_0x3aef('0x29')](handleEntityNotFound(_0x5f45fe,null))['then'](function(_0x3b84a2){if(_0x3b84a2){_0x539a8c=_0x3b84a2;return _0x3b84a2[_0x3aef('0x70')](_0x439a4d[_0x3aef('0x4e')][_0x3aef('0x72')]);}})[_0x3aef('0x29')](function(_0x57ffc5){if(_0x57ffc5){return db['Sound']['findOne']({'where':{'id':_0x439a4d[_0x3aef('0x4e')][_0x3aef('0x72')]},'attributes':['id',_0x3aef('0x30'),_0x3aef('0x68'),_0x3aef('0x6d'),_0x3aef('0x73')],'raw':!![]});}})['then'](function(_0x42526e){if(_0x42526e){fs['unlinkSync'](path[_0x3aef('0x57')](_0x539a8c[_0x3aef('0x56')],util[_0x3aef('0x69')](_0x3aef('0x6a'),_0x42526e['name'],_0x42526e[_0x3aef('0x6d')])));return _0x42526e;}})['catch'](function(_0x57a0f4){throw new db['Sequelize'][(_0x3aef('0x6f'))](_0x57a0f4['message']);});})[_0x3aef('0x29')](handleEntityNotFound(_0x5f45fe,null))[_0x3aef('0x29')](respondWithStatusCode(_0x5f45fe,0xcc))[_0x3aef('0x50')](handleError(_0x5f45fe,null));};exports['getSounds']=function(_0x6686a4,_0x2b4fa7,_0x17b66a){var _0x12e89a={};var _0x248bba={};var _0x1ac48c;var _0x4a9081;return db[_0x3aef('0x34')][_0x3aef('0x71')]({'where':{'id':_0x6686a4[_0x3aef('0x4e')]['id']}})[_0x3aef('0x29')](handleEntityNotFound(_0x2b4fa7,null))['then'](function(_0x458178){if(_0x458178){_0x1ac48c=_0x458178;_0x248bba[_0x3aef('0x3c')]=_[_0x3aef('0x3a')](db[_0x3aef('0x67')][_0x3aef('0x35')]);_0x248bba[_0x3aef('0x39')]=_['keys'](_0x6686a4[_0x3aef('0x39')]);_0x248bba['filters']=_['intersection'](_0x248bba[_0x3aef('0x3c')],_0x248bba[_0x3aef('0x39')]);_0x12e89a['attributes']=_[_0x3aef('0x3b')](_0x248bba[_0x3aef('0x3c')],qs[_0x3aef('0x3e')](_0x6686a4[_0x3aef('0x39')][_0x3aef('0x3e')]));_0x12e89a[_0x3aef('0x3d')]=_0x12e89a[_0x3aef('0x3d')][_0x3aef('0x3f')]?_0x12e89a[_0x3aef('0x3d')]:_0x248bba[_0x3aef('0x3c')];_0x12e89a[_0x3aef('0x41')]=qs[_0x3aef('0x42')](_0x6686a4['query'][_0x3aef('0x42')]);_0x12e89a['where']=qs[_0x3aef('0x44')](_[_0x3aef('0x74')](_0x6686a4[_0x3aef('0x39')],_0x248bba[_0x3aef('0x44')]));if(_0x6686a4[_0x3aef('0x39')][_0x3aef('0x45')]){_0x12e89a['where']=_[_0x3aef('0x46')](_0x12e89a[_0x3aef('0x43')],{'$or':_[_0x3aef('0x33')](_0x12e89a['attributes'],function(_0x4f10ae){var _0xd8bfa5={};_0xd8bfa5[_0x4f10ae]={'$like':'%'+_0x6686a4[_0x3aef('0x39')]['filter']+'%'};return _0xd8bfa5;})});}_0x12e89a=_['merge']({},_0x12e89a,_0x6686a4[_0x3aef('0x48')]);return _0x1ac48c[_0x3aef('0x75')](_0x12e89a);}})['then'](function(_0x398686){if(_0x398686){_0x4a9081=_0x398686['length'];if(!_0x6686a4[_0x3aef('0x39')][_0x3aef('0x76')](_0x3aef('0x40'))){_0x12e89a[_0x3aef('0x22')]=qs[_0x3aef('0x22')](_0x6686a4[_0x3aef('0x39')][_0x3aef('0x22')]);_0x12e89a[_0x3aef('0x21')]=qs[_0x3aef('0x21')](_0x6686a4[_0x3aef('0x39')][_0x3aef('0x21')]);}return _0x1ac48c[_0x3aef('0x75')](_0x12e89a);}})['then'](function(_0x5686b7){if(_0x5686b7){return _0x5686b7?{'count':_0x4a9081,'rows':_0x5686b7}:null;}})[_0x3aef('0x29')](respondWithResult(_0x2b4fa7,null))['catch'](handleError(_0x2b4fa7,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 41fe386..51aa3fa 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 _0x0e19=['exports','define','VoiceMusicOnHold','voice_musiconhold','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./voiceMusicOnHold.attributes'];(function(_0x27b1fd,_0x111639){var _0x3a9b91=function(_0x40458f){while(--_0x40458f){_0x27b1fd['push'](_0x27b1fd['shift']());}};_0x3a9b91(++_0x111639);}(_0x0e19,0x64));var _0x90e1=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x0e19[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require('lodash');var util=require(_0x90e1('0x0'));var logger=require(_0x90e1('0x1'))(_0x90e1('0x2'));var moment=require(_0x90e1('0x3'));var BPromise=require(_0x90e1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x90e1('0x5'));var config=require(_0x90e1('0x6'));var attributes=require(_0x90e1('0x7'));module[_0x90e1('0x8')]=function(_0x1cf696,_0x2c0e7b){return _0x1cf696[_0x90e1('0x9')](_0x90e1('0xa'),attributes,{'tableName':_0x90e1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xba3c=['./voiceMusicOnHold.attributes','exports','VoiceMusicOnHold','lodash','util','api','moment','path','../../config/environment'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0xba3c,0xae));var _0xcba3=function(_0x158928,_0x5e50af){_0x158928=_0x158928-0x0;var _0xaaeaa1=_0xba3c[_0x158928];return _0xaaeaa1;};'use strict';var _=require(_0xcba3('0x0'));var util=require(_0xcba3('0x1'));var logger=require('../../config/logger')(_0xcba3('0x2'));var moment=require(_0xcba3('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xcba3('0x4'));var rimraf=require('rimraf');var config=require(_0xcba3('0x5'));var attributes=require(_0xcba3('0x6'));module[_0xcba3('0x7')]=function(_0x17fe3c,_0x2ea9e9){return _0x17fe3c['define'](_0xcba3('0x8'),attributes,{'tableName':'voice_musiconhold','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js index cde75ef..9b9bade 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 _0xedd9=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','VoiceMusicOnHold,\x20%s,\x20%s','message','catch','util'];(function(_0x158be4,_0x12998e){var _0x13fd2c=function(_0xd2bdd7){while(--_0xd2bdd7){_0x158be4['push'](_0x158be4['shift']());}};_0x13fd2c(++_0x12998e);}(_0xedd9,0xfc));var _0x9edd=function(_0x5a7adc,_0x2eed70){_0x5a7adc=_0x5a7adc-0x0;var _0x406580=_0xedd9[_0x5a7adc];return _0x406580;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var moment=require(_0x9edd('0x1'));var BPromise=require(_0x9edd('0x2'));var rs=require(_0x9edd('0x3'));var fs=require('fs');var Redis=require(_0x9edd('0x4'));var db=require(_0x9edd('0x5'))['db'];var utils=require(_0x9edd('0x6'));var logger=require(_0x9edd('0x7'))('rpc');var config=require(_0x9edd('0x8'));var jayson=require(_0x9edd('0x9'));var client=jayson[_0x9edd('0xa')][_0x9edd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5319f7,_0xf0b2d8,_0x571af9){return new BPromise(function(_0x172522,_0x190185){return client[_0x9edd('0xc')](_0x5319f7,_0x571af9)[_0x9edd('0xd')](function(_0x49d5e3){logger[_0x9edd('0xe')]('VoiceMusicOnHold,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'));logger[_0x9edd('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'),JSON[_0x9edd('0x11')](_0x49d5e3));if(_0x49d5e3['error']){if(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x13')]===0x1f4){logger[_0x9edd('0x12')](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x190185(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x172522(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}else{logger[_0x9edd('0xe')](_0x9edd('0x14'),_0xf0b2d8,_0x9edd('0xf'));_0x172522(_0x49d5e3['result'][_0x9edd('0x15')]);}})[_0x9edd('0x16')](function(_0x449cee){logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x449cee);_0x190185(_0x449cee);});});} \ No newline at end of file +var _0xa9e0=['http','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\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(_0x1da97f,_0x5c73c8){var _0x444d51=function(_0x547987){while(--_0x547987){_0x1da97f['push'](_0x1da97f['shift']());}};_0x444d51(++_0x5c73c8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'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/voicePrefix/index.js b/server/api/voicePrefix/index.js index bc8360a..f9ba2f9 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 _0xd73c=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated','index','describe','/:id/users','/:id/teams','post','create','addTeams','put','/:id','update','delete','destroy','removeAgents','removeTeams','exports'];(function(_0x320a88,_0x253710){var _0x6fd7c8=function(_0x1fae1f){while(--_0x1fae1f){_0x320a88['push'](_0x320a88['shift']());}};_0x6fd7c8(++_0x253710);}(_0xd73c,0x134));var _0xcd73=function(_0x169634,_0x1bc085){_0x169634=_0x169634-0x0;var _0x2b9e31=_0xd73c[_0x169634];return _0x2b9e31;};'use strict';var multer=require(_0xcd73('0x0'));var util=require(_0xcd73('0x1'));var path=require(_0xcd73('0x2'));var timeout=require(_0xcd73('0x3'));var express=require(_0xcd73('0x4'));var router=express[_0xcd73('0x5')]();var fs_extra=require(_0xcd73('0x6'));var auth=require(_0xcd73('0x7'));var interaction=require(_0xcd73('0x8'));var config=require(_0xcd73('0x9'));var controller=require(_0xcd73('0xa'));router[_0xcd73('0xb')]('/',auth[_0xcd73('0xc')](),controller[_0xcd73('0xd')]);router[_0xcd73('0xb')]('/describe',auth[_0xcd73('0xc')](),controller[_0xcd73('0xe')]);router[_0xcd73('0xb')]('/:id',auth[_0xcd73('0xc')](),controller['show']);router[_0xcd73('0xb')](_0xcd73('0xf'),auth[_0xcd73('0xc')](),controller['getAgents']);router[_0xcd73('0xb')](_0xcd73('0x10'),auth[_0xcd73('0xc')](),controller['getTeams']);router[_0xcd73('0x11')]('/',auth[_0xcd73('0xc')](),controller[_0xcd73('0x12')]);router[_0xcd73('0x11')](_0xcd73('0xf'),auth[_0xcd73('0xc')](),controller['addAgents']);router[_0xcd73('0x11')](_0xcd73('0x10'),auth[_0xcd73('0xc')](),controller[_0xcd73('0x13')]);router[_0xcd73('0x14')](_0xcd73('0x15'),auth[_0xcd73('0xc')](),controller[_0xcd73('0x16')]);router[_0xcd73('0x17')](_0xcd73('0x15'),auth[_0xcd73('0xc')](),controller[_0xcd73('0x18')]);router['delete']('/:id/users',auth[_0xcd73('0xc')](),controller[_0xcd73('0x19')]);router[_0xcd73('0x17')](_0xcd73('0x10'),auth[_0xcd73('0xc')](),controller[_0xcd73('0x1a')]);module[_0xcd73('0x1b')]=router; \ No newline at end of file +var _0xab33=['put','update','delete','destroy','removeTeams','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','describe','/:id','show','/:id/users','getAgents','/:id/teams','getTeams','post','create','addAgents'];(function(_0x51979e,_0x239714){var _0x327356=function(_0x2fff28){while(--_0x2fff28){_0x51979e['push'](_0x51979e['shift']());}};_0x327356(++_0x239714);}(_0xab33,0x1a3));var _0x3ab3=function(_0x41aab8,_0x2c74fe){_0x41aab8=_0x41aab8-0x0;var _0x5d9077=_0xab33[_0x41aab8];return _0x5d9077;};'use strict';var multer=require('multer');var util=require(_0x3ab3('0x0'));var path=require(_0x3ab3('0x1'));var timeout=require('connect-timeout');var express=require(_0x3ab3('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x3ab3('0x3'));var interaction=require(_0x3ab3('0x4'));var config=require(_0x3ab3('0x5'));var controller=require('./voicePrefix.controller');router['get']('/',auth[_0x3ab3('0x6')](),controller['index']);router[_0x3ab3('0x7')]('/describe',auth['isAuthenticated'](),controller[_0x3ab3('0x8')]);router[_0x3ab3('0x7')](_0x3ab3('0x9'),auth[_0x3ab3('0x6')](),controller[_0x3ab3('0xa')]);router[_0x3ab3('0x7')](_0x3ab3('0xb'),auth['isAuthenticated'](),controller[_0x3ab3('0xc')]);router[_0x3ab3('0x7')](_0x3ab3('0xd'),auth[_0x3ab3('0x6')](),controller[_0x3ab3('0xe')]);router[_0x3ab3('0xf')]('/',auth['isAuthenticated'](),controller[_0x3ab3('0x10')]);router[_0x3ab3('0xf')](_0x3ab3('0xb'),auth[_0x3ab3('0x6')](),controller[_0x3ab3('0x11')]);router[_0x3ab3('0xf')](_0x3ab3('0xd'),auth[_0x3ab3('0x6')](),controller['addTeams']);router[_0x3ab3('0x12')](_0x3ab3('0x9'),auth['isAuthenticated'](),controller[_0x3ab3('0x13')]);router[_0x3ab3('0x14')](_0x3ab3('0x9'),auth[_0x3ab3('0x6')](),controller[_0x3ab3('0x15')]);router[_0x3ab3('0x14')](_0x3ab3('0xb'),auth[_0x3ab3('0x6')](),controller['removeAgents']);router[_0x3ab3('0x14')](_0x3ab3('0xd'),auth[_0x3ab3('0x6')](),controller[_0x3ab3('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index 01b6fbb..d495c42 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 _0xf492=['name','VIRTUAL','system-','getDataValue','sequelize','STRING'];(function(_0x4a5635,_0x443b90){var _0x18d602=function(_0x1ddd38){while(--_0x1ddd38){_0x4a5635['push'](_0x4a5635['shift']());}};_0x18d602(++_0x443b90);}(_0xf492,0x14e));var _0x2f49=function(_0x25c065,_0x437059){_0x25c065=_0x25c065-0x0;var _0x34fd3e=_0xf492[_0x25c065];return _0x34fd3e;};'use strict';var Sequelize=require(_0x2f49('0x0'));module['exports']={'name':{'type':Sequelize[_0x2f49('0x1')],'allowNull':![],'unique':_0x2f49('0x2')},'prefix':{'type':Sequelize[_0x2f49('0x3')],'get':function(_0x3db8db){return _0x2f49('0x4')+this[_0x2f49('0x5')](_0x2f49('0x2'))+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize[_0x2f49('0x1')]},'VoiceExtensionId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x0b8d=['STRING','name','VIRTUAL','system-','getDataValue','INTEGER','sequelize'];(function(_0x20f27f,_0x2e9c80){var _0xd40638=function(_0x498958){while(--_0x498958){_0x20f27f['push'](_0x20f27f['shift']());}};_0xd40638(++_0x2e9c80);}(_0x0b8d,0x1e2));var _0xd0b8=function(_0x5a79e2,_0x319b1a){_0x5a79e2=_0x5a79e2-0x0;var _0x266c45=_0x0b8d[_0x5a79e2];return _0x266c45;};'use strict';var Sequelize=require(_0xd0b8('0x0'));module['exports']={'name':{'type':Sequelize[_0xd0b8('0x1')],'allowNull':![],'unique':_0xd0b8('0x2')},'prefix':{'type':Sequelize[_0xd0b8('0x3')],'get':function(_0x1a77da){return _0xd0b8('0x4')+this[_0xd0b8('0x5')](_0xd0b8('0x2'))+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize[_0xd0b8('0x6')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index e725b4a..77fd3db 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 _0x583c=['fast-json-patch','moment','bluebird','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','sendStatus','status','json','offset','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','UserProfileResource','end','error','stack','name','send','map','VoicePrefix','fieldName','type','model','query','keys','filters','attributes','fields','nolimit','order','sort','pick','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','rawAttributes','intersection','length','include','find','describe','create','sequelize','transaction','body','VoiceExtensionId','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','VoicePrefixes','userProfileId','autoAssociation','exten','app','system','Voice\x20Prefix\x20Extension','priority','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','push','Set','PREFIX-CALLERIDALL=','callerIdAll','No\x20callerid\x20available','context','${EXTEN:','charAt','system-','VoiceExtension','findById','addAgents','ids','omit','spread','emit','userVoicePrefix:save','removeAgents','userVoicePrefix:remove','getAgents','findOne','User','filter','Team','hasOwnProperty','getTeams','addTeams','Agents','online','voicePause','flatMap','each','UserVoicePrefix','removeTeams','select','tq.TeamId','from','team_has_voice_prefixes','join','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','ut.UserId\x20=\x20?','toString','QueryTypes','every','all','union','compact','value','isEmpty','forEach','eml-format','rimraf','zip-dir'];(function(_0x4ecae3,_0x449baa){var _0x25d43f=function(_0x2d5cc2){while(--_0x2d5cc2){_0x4ecae3['push'](_0x4ecae3['shift']());}};_0x25d43f(++_0x449baa);}(_0x583c,0x12b));var _0xc583=function(_0x3238ea,_0x91809d){_0x3238ea=_0x3238ea-0x0;var _0x4aaac2=_0x583c[_0x3238ea];return _0x4aaac2;};'use strict';var emlformat=require(_0xc583('0x0'));var rimraf=require(_0xc583('0x1'));var zipdir=require(_0xc583('0x2'));var jsonpatch=require(_0xc583('0x3'));var rp=require('request-promise');var moment=require(_0xc583('0x4'));var BPromise=require(_0xc583('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xc583('0x6'));var sox=require(_0xc583('0x7'));var csv=require('to-csv');var ejs=require(_0xc583('0x8'));var fs=require('fs');var fs_extra=require(_0xc583('0x9'));var _=require(_0xc583('0xa'));var squel=require(_0xc583('0xb'));var crypto=require('crypto');var jsforce=require(_0xc583('0xc'));var deskjs=require(_0xc583('0xd'));var toCsv=require('to-csv');var querystring=require(_0xc583('0xe'));var Papa=require(_0xc583('0xf'));var Redis=require(_0xc583('0x10'));var authService=require(_0xc583('0x11'));var qs=require(_0xc583('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc583('0x13'));var logger=require(_0xc583('0x14'))('api');var utils=require(_0xc583('0x15'));var config=require(_0xc583('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xc583('0x17'))['db'];config[_0xc583('0x18')]=_[_0xc583('0x19')](config[_0xc583('0x18')],{'host':_0xc583('0x1a'),'port':0x18eb});var socket=require(_0xc583('0x1b'))(new Redis(config[_0xc583('0x18')]));require(_0xc583('0x1c'))[_0xc583('0x1d')](socket);function respondWithStatusCode(_0x5403a3,_0x21cf25){_0x21cf25=_0x21cf25||0xcc;return function(_0x51ecd7){if(_0x51ecd7){return _0x5403a3[_0xc583('0x1e')](_0x21cf25);}return _0x5403a3[_0xc583('0x1f')](_0x21cf25)['end']();};}function respondWithResult(_0x263552,_0x311ad5){_0x311ad5=_0x311ad5||0xc8;return function(_0x5b1871){if(_0x5b1871){return _0x263552[_0xc583('0x1f')](_0x311ad5)[_0xc583('0x20')](_0x5b1871);}};}function respondWithFilteredResult(_0x5127fa,_0x21cf22){return function(_0x8a2d84){if(_0x8a2d84){var _0x12aac2=typeof _0x21cf22[_0xc583('0x21')]==='undefined'&&typeof _0x21cf22[_0xc583('0x22')]==='undefined';var _0x227ec2=_0x8a2d84[_0xc583('0x23')];var _0xfd9a60=_0x12aac2?0x0:_0x21cf22[_0xc583('0x21')];var _0x1052b5=_0x12aac2?_0x8a2d84[_0xc583('0x23')]:_0x21cf22[_0xc583('0x21')]+_0x21cf22[_0xc583('0x22')];var _0x37fcd4;if(_0x1052b5>=_0x227ec2){_0x1052b5=_0x227ec2;_0x37fcd4=0xc8;}else{_0x37fcd4=0xce;}_0x5127fa[_0xc583('0x1f')](_0x37fcd4);return _0x5127fa[_0xc583('0x24')](_0xc583('0x25'),_0xfd9a60+'-'+_0x1052b5+'/'+_0x227ec2)[_0xc583('0x20')](_0x8a2d84);}return null;};}function patchUpdates(_0x478ee1){return function(_0x542256){try{jsonpatch[_0xc583('0x26')](_0x542256,_0x478ee1,!![]);}catch(_0x3e075c){return BPromise[_0xc583('0x27')](_0x3e075c);}return _0x542256['save']();};}function saveUpdates(_0x1521e2,_0x959500){return function(_0x37f156){if(_0x37f156){return _0x37f156[_0xc583('0x28')](_0x1521e2)[_0xc583('0x29')](function(_0x48c95e){return _0x48c95e;});}return null;};}function removeEntity(_0x4cad36,_0x45871c){return function(_0x4f366b){if(_0x4f366b){return _0x4f366b[_0xc583('0x2a')]()[_0xc583('0x29')](function(){var _0xbabf24=_0x4f366b[_0xc583('0x2b')]({'plain':!![]});var _0x24aab5='VoicePrefixes';return db[_0xc583('0x2c')][_0xc583('0x2a')]({'where':{'type':_0x24aab5,'resourceId':_0xbabf24['id']}})['then'](function(){return _0x4f366b;});})[_0xc583('0x29')](function(){_0x4cad36['status'](0xcc)[_0xc583('0x2d')]();});}};}function handleEntityNotFound(_0x8d4ecb,_0x1c80b1){return function(_0x3ed083){if(!_0x3ed083){_0x8d4ecb[_0xc583('0x1e')](0x194);}return _0x3ed083;};}function handleError(_0x19079b,_0x113b39){_0x113b39=_0x113b39||0x1f4;return function(_0x4a87b5){logger[_0xc583('0x2e')](_0x4a87b5[_0xc583('0x2f')]);if(_0x4a87b5[_0xc583('0x30')]){delete _0x4a87b5[_0xc583('0x30')];}_0x19079b[_0xc583('0x1f')](_0x113b39)[_0xc583('0x31')](_0x4a87b5);};}exports['index']=function(_0x2246dd,_0x58d97f){var _0x510931={},_0x299551={},_0x2df18d={'count':0x0,'rows':[]};var _0x20bbce=_[_0xc583('0x32')](db[_0xc583('0x33')]['rawAttributes'],function(_0x3e41c0){return{'name':_0x3e41c0[_0xc583('0x34')],'type':_0x3e41c0[_0xc583('0x35')]['key']};});_0x299551[_0xc583('0x36')]=_['map'](_0x20bbce,_0xc583('0x30'));_0x299551[_0xc583('0x37')]=_[_0xc583('0x38')](_0x2246dd[_0xc583('0x37')]);_0x299551[_0xc583('0x39')]=_['intersection'](_0x299551[_0xc583('0x36')],_0x299551['query']);_0x510931[_0xc583('0x3a')]=_['intersection'](_0x299551[_0xc583('0x36')],qs[_0xc583('0x3b')](_0x2246dd[_0xc583('0x37')][_0xc583('0x3b')]));_0x510931[_0xc583('0x3a')]=_0x510931[_0xc583('0x3a')]['length']?_0x510931['attributes']:_0x299551[_0xc583('0x36')];if(!_0x2246dd[_0xc583('0x37')]['hasOwnProperty'](_0xc583('0x3c'))){_0x510931[_0xc583('0x22')]=qs[_0xc583('0x22')](_0x2246dd[_0xc583('0x37')][_0xc583('0x22')]);_0x510931[_0xc583('0x21')]=qs['offset'](_0x2246dd[_0xc583('0x37')]['offset']);}_0x510931[_0xc583('0x3d')]=qs[_0xc583('0x3e')](_0x2246dd[_0xc583('0x37')]['sort']);_0x510931['where']=qs['filters'](_[_0xc583('0x3f')](_0x2246dd[_0xc583('0x37')],_0x299551[_0xc583('0x39')]),_0x20bbce);if(_0x2246dd[_0xc583('0x37')]['filter']){_0x510931[_0xc583('0x40')]=_[_0xc583('0x41')](_0x510931['where'],{'$or':_['map'](_0x20bbce,function(_0x1ea5da){if(_0x1ea5da['type']!==_0xc583('0x42')){var _0x1ec6f9={};_0x1ec6f9[_0x1ea5da[_0xc583('0x30')]]={'$like':'%'+_0x2246dd[_0xc583('0x37')]['filter']+'%'};return _0x1ec6f9;}})});}_0x510931=_[_0xc583('0x41')]({},_0x510931,_0x2246dd[_0xc583('0x43')]);var _0x39c5ab={'where':_0x510931[_0xc583('0x40')]};return db[_0xc583('0x33')]['count'](_0x39c5ab)[_0xc583('0x29')](function(_0x5f5a97){_0x2df18d['count']=_0x5f5a97;if(_0x2246dd[_0xc583('0x37')][_0xc583('0x44')]){_0x510931['include']=[{'all':!![]}];}return db['VoicePrefix'][_0xc583('0x45')](_0x510931);})[_0xc583('0x29')](function(_0x7d1b29){_0x2df18d[_0xc583('0x46')]=_0x7d1b29;return _0x2df18d;})['then'](respondWithFilteredResult(_0x58d97f,_0x510931))[_0xc583('0x47')](handleError(_0x58d97f,null));};exports['show']=function(_0x8c8209,_0x4edac2){var _0x28ab1a={'raw':![],'where':{'id':_0x8c8209[_0xc583('0x48')]['id']}},_0x14e9ad={};_0x14e9ad[_0xc583('0x36')]=_[_0xc583('0x38')](db['VoicePrefix'][_0xc583('0x49')]);_0x14e9ad[_0xc583('0x37')]=_[_0xc583('0x38')](_0x8c8209['query']);_0x14e9ad['filters']=_['intersection'](_0x14e9ad[_0xc583('0x36')],_0x14e9ad['query']);_0x28ab1a[_0xc583('0x3a')]=_[_0xc583('0x4a')](_0x14e9ad[_0xc583('0x36')],qs[_0xc583('0x3b')](_0x8c8209[_0xc583('0x37')][_0xc583('0x3b')]));_0x28ab1a[_0xc583('0x3a')]=_0x28ab1a[_0xc583('0x3a')][_0xc583('0x4b')]?_0x28ab1a[_0xc583('0x3a')]:_0x14e9ad[_0xc583('0x36')];if(_0x8c8209['query'][_0xc583('0x44')]){_0x28ab1a[_0xc583('0x4c')]=[{'all':!![]}];}_0x28ab1a=_[_0xc583('0x41')]({},_0x28ab1a,_0x8c8209[_0xc583('0x43')]);return db['VoicePrefix'][_0xc583('0x4d')](_0x28ab1a)[_0xc583('0x29')](handleEntityNotFound(_0x4edac2,null))[_0xc583('0x29')](respondWithResult(_0x4edac2,null))[_0xc583('0x47')](handleError(_0x4edac2,null));};exports[_0xc583('0x2a')]=function(_0x22da88,_0x3f60ae){return db[_0xc583('0x33')][_0xc583('0x4d')]({'where':{'id':_0x22da88['params']['id']}})[_0xc583('0x29')](handleEntityNotFound(_0x3f60ae,null))[_0xc583('0x29')](removeEntity(_0x3f60ae,null))[_0xc583('0x47')](handleError(_0x3f60ae,null));};exports[_0xc583('0x4e')]=function(_0x3c442e,_0xc42b2a){return db[_0xc583('0x33')][_0xc583('0x4e')]()[_0xc583('0x29')](respondWithResult(_0xc42b2a,null))[_0xc583('0x47')](handleError(_0xc42b2a,null));};exports[_0xc583('0x4f')]=function(_0x7be0b3,_0x305239){var _0x4c486b;return db[_0xc583('0x50')][_0xc583('0x51')](function(_0x44413e){return db[_0xc583('0x33')][_0xc583('0x4f')](_0x7be0b3[_0xc583('0x52')],{'transaction':_0x44413e})[_0xc583('0x29')](function(_0x1aff76){_0x4c486b=_0x1aff76[_0xc583('0x2b')]({'plain':!![]});return db['VoiceExtension'][_0xc583('0x4d')]({'where':{'id':_0x4c486b[_0xc583('0x53')]},'raw':!![]})[_0xc583('0x29')](function(_0x59ce34){return createVoicePrefixExtensions(_0x4c486b,_0x59ce34,_0x44413e);});});})['then'](function(){var _0x2bb764=_0x7be0b3['user'][_0xc583('0x2b')]({'plain':!![]});if(!_0x2bb764)throw new Error(_0xc583('0x54'));if(_0x2bb764['role']==='user'){var _0x282290=_0x4c486b;return db[_0xc583('0x55')][_0xc583('0x4d')]({'where':{'name':_0xc583('0x56'),'userProfileId':_0x2bb764[_0xc583('0x57')]},'raw':!![]})[_0xc583('0x29')](function(_0x3e2758){if(_0x3e2758&&_0x3e2758[_0xc583('0x58')]===0x0){return db['UserProfileResource'][_0xc583('0x4f')]({'name':_0x282290[_0xc583('0x30')],'resourceId':_0x282290['id'],'type':_0x3e2758[_0xc583('0x30')],'sectionId':_0x3e2758['id']},{})[_0xc583('0x29')](function(){return _0x4c486b;});}else{return _0x4c486b;}})['catch'](function(_0x43fda1){logger[_0xc583('0x2e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x43fda1);throw _0x43fda1;});}return _0x4c486b;})['then'](respondWithResult(_0x305239,null))[_0xc583('0x47')](handleError(_0x305239,null));};function Extension(_0x5ccfe7,_0x30b1e0,_0x1ba5cc,_0x40e8a6){this['context']='from-sip';this[_0xc583('0x59')]=_0x5ccfe7;this[_0xc583('0x5a')]=_0x1ba5cc;this[_0xc583('0x35')]=_0xc583('0x5b');this['description']=_0xc583('0x5c');this[_0xc583('0x5d')]=_0x30b1e0;this['appdata']=_0x40e8a6;}function createVoicePrefixExtensions(_0x508f4b,_0x28013a,_0x579c62){return new BPromise(function(_0x5df37d,_0x507f18){var _0x415b0f=new Extension(formatPrefixName(_0x508f4b[_0xc583('0x5e')]),0x1,_0xc583('0x5f'),_0xc583('0x60'));_0x415b0f['VoicePrefixId']=_0x508f4b['id'];return db['VoiceExtension'][_0xc583('0x4f')](_0x415b0f,{'transaction':_0x579c62})[_0xc583('0x29')](function(_0x599663){var _0x52cd21=_0x599663[_0xc583('0x2b')]({'plain':!![]});var _0x48f217=_[_0xc583('0x32')](addVoicePrefixExtensions(_0x508f4b,_0x28013a),function(_0x43f208){_0x43f208['VoiceExtensionId']=_0x52cd21['id'];_0x43f208[_0xc583('0x61')]=_0x508f4b['id'];return _0x43f208;});return db['VoiceExtension'][_0xc583('0x62')](_0x48f217,{'transaction':_0x579c62})[_0xc583('0x29')](function(_0x4b3f49){if(!_0x4b3f49){return _0x507f18(_0xc583('0x63'));}else{return _0x5df37d(_0x4b3f49);}})[_0xc583('0x47')](function(_0x20783b){return _0x507f18(_0x20783b);});});;});};function addVoicePrefixExtensions(_0xf4bc67,_0x1b5003){var _0x330a8e=[];var _0x37613c=formatPrefixName(_0xf4bc67[_0xc583('0x5e')]);_0x330a8e['push'](new Extension(_0x37613c,0x2,'Set','CDR(prefix)='+_0xf4bc67[_0xc583('0x30')]));if(_0xf4bc67['callerIdAll']){_0x330a8e[_0xc583('0x64')](new Extension(_0x37613c,0x3,_0xc583('0x65'),_0xc583('0x66')+_0xf4bc67[_0xc583('0x67')]));}else{_0x330a8e[_0xc583('0x64')](new Extension(_0x37613c,0x3,_0xc583('0x5f'),_0xc583('0x68')));}_0x330a8e[_0xc583('0x64')](new Extension(_0x37613c,0x4,'goto',_0x1b5003[_0xc583('0x69')]+','+_0xc583('0x6a')+(0x8+_0xf4bc67[_0xc583('0x30')][_0xc583('0x4b')])+'}'+','+0x1));return _0x330a8e;}function formatPrefixName(_0x41a064){var _0xb243ac='_';for(var _0x548f1c=0x0;_0x548f1c<_0x41a064[_0xc583('0x4b')];_0x548f1c++){if(_0x41a064[_0xc583('0x6b')](_0x548f1c)=='-'){_0xb243ac+=_0x41a064[_0xc583('0x6b')](_0x548f1c);}else{_0xb243ac+='['+_0x41a064[_0xc583('0x6b')](_0x548f1c)+']';}}_0xb243ac+='.';return _0xb243ac;}exports[_0xc583('0x28')]=function(_0x2b719f,_0x547d2f,_0x3e4616){var _0x1b6948=_0x2b719f[_0xc583('0x52')];_0x1b6948['prefix']=_0xc583('0x6c')+_0x1b6948['name']+'-';return db[_0xc583('0x50')][_0xc583('0x51')](function(_0x240174){return db[_0xc583('0x33')][_0xc583('0x28')](_0x1b6948,{'where':{'id':_0x1b6948['id']},'transaction':_0x240174})[_0xc583('0x29')](function(){return db[_0xc583('0x6d')]['destroy']({'where':{'VoicePrefixId':_0x1b6948['id']},'transaction':_0x240174})['then'](function(){return db['VoiceExtension']['find']({'where':{'id':_0x1b6948[_0xc583('0x53')]},'raw':!![]})[_0xc583('0x29')](function(_0x3a2a5c){return createVoicePrefixExtensions(_0x1b6948,_0x3a2a5c,_0x240174);});});});})[_0xc583('0x29')](function(){return db[_0xc583('0x33')][_0xc583('0x6e')](_0x1b6948['id']);})[_0xc583('0x29')](respondWithResult(_0x547d2f,null))[_0xc583('0x47')](handleError(_0x547d2f,null));};exports[_0xc583('0x6f')]=function(_0x1b8304,_0x4c9516,_0x22b75d){return db[_0xc583('0x33')]['find']({'where':{'id':_0x1b8304['params']['id']}})['then'](handleEntityNotFound(_0x4c9516,null))[_0xc583('0x29')](function(_0x10037e){if(_0x10037e){return _0x10037e[_0xc583('0x6f')](_0x1b8304[_0xc583('0x52')][_0xc583('0x70')],_[_0xc583('0x71')](_0x1b8304[_0xc583('0x52')],[_0xc583('0x70'),'id'])||{})[_0xc583('0x72')](function(_0x516fcb){for(var _0x442844=0x0;_0x442844<_0x1b8304[_0xc583('0x52')]['ids'][_0xc583('0x4b')];_0x442844+=0x1){socket[_0xc583('0x73')](_0xc583('0x74'),{'UserId':Number(_0x1b8304[_0xc583('0x52')][_0xc583('0x70')][_0x442844]),'VoicePrefixId':Number(_0x1b8304['params']['id'])});}return _0x516fcb;});}})[_0xc583('0x29')](respondWithResult(_0x4c9516,null))[_0xc583('0x47')](handleError(_0x4c9516,null));};exports[_0xc583('0x75')]=function(_0x2f0aa9,_0x50ef13,_0x4d6582){return db['VoicePrefix'][_0xc583('0x4d')]({'where':{'id':_0x2f0aa9['params']['id']}})['then'](handleEntityNotFound(_0x50ef13,null))['then'](function(_0x1c7323){if(_0x1c7323){return _0x1c7323[_0xc583('0x75')](_0x2f0aa9[_0xc583('0x37')][_0xc583('0x70')])[_0xc583('0x29')](function(){if(_['isArray'](_0x2f0aa9[_0xc583('0x37')][_0xc583('0x70')])){for(var _0x9a09b0=0x0;_0x9a09b0<_0x2f0aa9['query'][_0xc583('0x70')][_0xc583('0x4b')];_0x9a09b0+=0x1){socket['emit']('userVoicePrefix:remove',{'UserId':Number(_0x2f0aa9[_0xc583('0x37')][_0xc583('0x70')][_0x9a09b0]),'VoicePrefixId':Number(_0x2f0aa9[_0xc583('0x48')]['id'])});}}else{socket[_0xc583('0x73')](_0xc583('0x76'),{'UserId':Number(_0x2f0aa9[_0xc583('0x37')][_0xc583('0x70')]),'VoicePrefixId':Number(_0x2f0aa9[_0xc583('0x48')]['id'])});}});}})['then'](respondWithStatusCode(_0x50ef13,null))[_0xc583('0x47')](handleError(_0x50ef13,null));};exports[_0xc583('0x77')]=function(_0x3ea593,_0x3eabb9,_0x674d99){var _0x2b98b7={};var _0x20c4e6={};var _0x149051;var _0x1f0ab4;return db[_0xc583('0x33')][_0xc583('0x78')]({'where':{'id':_0x3ea593[_0xc583('0x48')]['id']}})[_0xc583('0x29')](handleEntityNotFound(_0x3eabb9,null))[_0xc583('0x29')](function(_0x42ff52){if(_0x42ff52){_0x149051=_0x42ff52;_0x20c4e6[_0xc583('0x36')]=_[_0xc583('0x38')](db[_0xc583('0x79')][_0xc583('0x49')]);_0x20c4e6[_0xc583('0x37')]=_[_0xc583('0x38')](_0x3ea593[_0xc583('0x37')]);_0x20c4e6[_0xc583('0x39')]=_[_0xc583('0x4a')](_0x20c4e6['model'],_0x20c4e6['query']);_0x2b98b7[_0xc583('0x3a')]=_[_0xc583('0x4a')](_0x20c4e6['model'],qs['fields'](_0x3ea593[_0xc583('0x37')][_0xc583('0x3b')]));_0x2b98b7['attributes']=_0x2b98b7['attributes'][_0xc583('0x4b')]?_0x2b98b7[_0xc583('0x3a')]:_0x20c4e6[_0xc583('0x36')];_0x2b98b7['order']=qs['sort'](_0x3ea593[_0xc583('0x37')][_0xc583('0x3e')]);_0x2b98b7[_0xc583('0x40')]=qs['filters'](_[_0xc583('0x3f')](_0x3ea593[_0xc583('0x37')],_0x20c4e6['filters']));if(_0x3ea593[_0xc583('0x37')][_0xc583('0x7a')]){_0x2b98b7[_0xc583('0x40')]=_[_0xc583('0x41')](_0x2b98b7[_0xc583('0x40')],{'$or':_[_0xc583('0x32')](_0x2b98b7[_0xc583('0x3a')],function(_0x47e7f8){var _0x4a2671={};_0x4a2671[_0x47e7f8]={'$like':'%'+_0x3ea593['query'][_0xc583('0x7a')]+'%'};return _0x4a2671;})});}_0x2b98b7=_[_0xc583('0x41')]({},_0x2b98b7,_0x3ea593[_0xc583('0x43')]);return _0x149051[_0xc583('0x77')](_0x2b98b7);}})[_0xc583('0x29')](function(_0x3ab1a1){if(_0x3ab1a1){_0x1f0ab4=_0x3ab1a1[_0xc583('0x4b')];if(!_0x3ea593[_0xc583('0x37')]['hasOwnProperty'](_0xc583('0x3c'))){_0x2b98b7[_0xc583('0x22')]=qs[_0xc583('0x22')](_0x3ea593[_0xc583('0x37')]['limit']);_0x2b98b7['offset']=qs['offset'](_0x3ea593[_0xc583('0x37')][_0xc583('0x21')]);}return _0x149051[_0xc583('0x77')](_0x2b98b7);}})[_0xc583('0x29')](function(_0x3a04a6){if(_0x3a04a6){return _0x3a04a6?{'count':_0x1f0ab4,'rows':_0x3a04a6}:null;}})[_0xc583('0x29')](respondWithResult(_0x3eabb9,null))['catch'](handleError(_0x3eabb9,null));};exports['getTeams']=function(_0x1907ff,_0x422848,_0x492e13){var _0xc11b2e={};var _0x1a2a0d={};var _0x2f6ea4;var _0x3e4c37;return db[_0xc583('0x33')][_0xc583('0x78')]({'where':{'id':_0x1907ff['params']['id']}})[_0xc583('0x29')](handleEntityNotFound(_0x422848,null))[_0xc583('0x29')](function(_0x3eb4a8){if(_0x3eb4a8){_0x2f6ea4=_0x3eb4a8;_0x1a2a0d[_0xc583('0x36')]=_[_0xc583('0x38')](db[_0xc583('0x7b')][_0xc583('0x49')]);_0x1a2a0d[_0xc583('0x37')]=_[_0xc583('0x38')](_0x1907ff[_0xc583('0x37')]);_0x1a2a0d['filters']=_[_0xc583('0x4a')](_0x1a2a0d[_0xc583('0x36')],_0x1a2a0d[_0xc583('0x37')]);_0xc11b2e['attributes']=_[_0xc583('0x4a')](_0x1a2a0d['model'],qs[_0xc583('0x3b')](_0x1907ff[_0xc583('0x37')][_0xc583('0x3b')]));_0xc11b2e[_0xc583('0x3a')]=_0xc11b2e[_0xc583('0x3a')][_0xc583('0x4b')]?_0xc11b2e[_0xc583('0x3a')]:_0x1a2a0d['model'];_0xc11b2e[_0xc583('0x3d')]=qs['sort'](_0x1907ff[_0xc583('0x37')]['sort']);_0xc11b2e[_0xc583('0x40')]=qs[_0xc583('0x39')](_[_0xc583('0x3f')](_0x1907ff[_0xc583('0x37')],_0x1a2a0d[_0xc583('0x39')]));if(_0x1907ff[_0xc583('0x37')][_0xc583('0x7a')]){_0xc11b2e[_0xc583('0x40')]=_['merge'](_0xc11b2e[_0xc583('0x40')],{'$or':_[_0xc583('0x32')](_0xc11b2e[_0xc583('0x3a')],function(_0x3ae684){var _0x424cd7={};_0x424cd7[_0x3ae684]={'$like':'%'+_0x1907ff['query'][_0xc583('0x7a')]+'%'};return _0x424cd7;})});}_0xc11b2e=_[_0xc583('0x41')]({},_0xc11b2e,_0x1907ff[_0xc583('0x43')]);return _0x2f6ea4['getTeams'](_0xc11b2e);}})['then'](function(_0xbbdcc4){if(_0xbbdcc4){_0x3e4c37=_0xbbdcc4[_0xc583('0x4b')];if(!_0x1907ff[_0xc583('0x37')][_0xc583('0x7c')](_0xc583('0x3c'))){_0xc11b2e[_0xc583('0x22')]=qs['limit'](_0x1907ff[_0xc583('0x37')][_0xc583('0x22')]);_0xc11b2e[_0xc583('0x21')]=qs[_0xc583('0x21')](_0x1907ff[_0xc583('0x37')]['offset']);}return _0x2f6ea4[_0xc583('0x7d')](_0xc11b2e);}})['then'](function(_0x1371a2){if(_0x1371a2){return _0x1371a2?{'count':_0x3e4c37,'rows':_0x1371a2}:null;}})['then'](respondWithResult(_0x422848,null))[_0xc583('0x47')](handleError(_0x422848,null));};exports[_0xc583('0x7e')]=function(_0x5b9b20,_0x5ebdb6,_0x1f1dfc){var _0x3f8a4e=_0x5b9b20[_0xc583('0x52')][_0xc583('0x70')];var _0x43e533;return db['Team'][_0xc583('0x45')]({'where':{'id':_0x3f8a4e},'attributes':['id'],'include':[{'model':db['User'],'as':_0xc583('0x7f'),'attributes':['id',_0xc583('0x30'),_0xc583('0x80'),_0xc583('0x81'),'interface'],'raw':!![]}]})['then'](function(_0x54f43b){if(_0x54f43b){_0x43e533=_0x54f43b;var _0x1cbdea=_[_0xc583('0x82')](_0x54f43b,function(_0x2afb8c){var _0x5252a8=_0x2afb8c[_0xc583('0x2b')]({'plain':!![]});return _0x5252a8[_0xc583('0x7f')];});return db['VoicePrefix'][_0xc583('0x4d')]({'where':{'id':_0x5b9b20['params']['id']}})[_0xc583('0x29')](function(_0x3d1570){return db[_0xc583('0x50')][_0xc583('0x51')](function(_0x48e574){return _0x3d1570[_0xc583('0x7e')](_0x3f8a4e,{'transaction':_0x48e574})[_0xc583('0x29')](function(){return BPromise[_0xc583('0x83')](_0x43e533,function(_0x499821){return db['TeamVoicePrefix']['upsert']({'TeamId':_0x499821['id'],'VoicePrefixId':_0x5b9b20[_0xc583('0x48')]['id']},{'transaction':_0x48e574});});})[_0xc583('0x29')](function(){return BPromise['each'](_0x1cbdea,function(_0x363a8e){return db[_0xc583('0x84')]['findOrCreate']({'where':{'UserId':_0x363a8e['id'],'VoicePrefixId':_0x5b9b20['params']['id']},'transaction':_0x48e574});});})[_0xc583('0x29')](function(){_0x1cbdea['forEach'](function(_0x790cd1){socket[_0xc583('0x73')](_0xc583('0x74'),{'UserId':_0x790cd1['id'],'VoicePrefixId':_0x3d1570['id']});});});});});}})[_0xc583('0x29')](respondWithStatusCode(_0x5ebdb6,null))[_0xc583('0x47')](handleError(_0x5ebdb6,null));};exports[_0xc583('0x85')]=function(_0x59781d,_0x3bcbce,_0x1628f4){return db[_0xc583('0x7b')][_0xc583('0x45')]({'where':{'id':_0x59781d[_0xc583('0x37')][_0xc583('0x70')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xc583('0x7f'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x3bcbce,null))[_0xc583('0x29')](function(_0x146b9c){var _0x4a6c7c=_['map'](_0x146b9c,'id');var _0x42b5a5=[];var _0x583588=[];var _0x564e57=squel[_0xc583('0x86')]();_0x564e57['field'](_0xc583('0x87'))[_0xc583('0x88')](_0xc583('0x89'),'tq')[_0xc583('0x8a')]('user_has_teams','ut',_0xc583('0x8b'))[_0xc583('0x40')](_0xc583('0x8c'),_0x59781d[_0xc583('0x48')]['id']);for(var _0x162607=0x0;_0x162607<_0x146b9c[_0xc583('0x4b')];_0x162607+=0x1){let _0x39a000=_0x146b9c[_0x162607];for(var _0x63eee8=0x0;_0x63eee8<_0x39a000[_0xc583('0x7f')][_0xc583('0x4b')];_0x63eee8+=0x1){let _0x459caf=_0x39a000[_0xc583('0x7f')][_0x63eee8];var _0x4075bd=_0x564e57['clone']();_0x4075bd[_0xc583('0x40')](_0xc583('0x8d'),_0x459caf['id']);_0x583588[_0xc583('0x64')](db[_0xc583('0x50')][_0xc583('0x37')](_0x4075bd[_0xc583('0x8e')](),{'type':db[_0xc583('0x50')][_0xc583('0x8f')]['SELECT']})[_0xc583('0x29')](function(_0x7ac229){if(_0x7ac229['length']===0x1){return _0x459caf['id'];}else{var _0x56cc96=_[_0xc583('0x90')](_[_0xc583('0x32')](_0x7ac229,'TeamId'),function(_0x25dde6){return _['includes'](_0x4a6c7c,_0x25dde6);});if(_0x56cc96){return _0x459caf['id'];}}}));}}return BPromise[_0xc583('0x91')](_0x583588)[_0xc583('0x29')](function(_0x1de88f){_0x42b5a5=_(_0x42b5a5)[_0xc583('0x92')](_0x1de88f)[_0xc583('0x93')]()[_0xc583('0x94')]();return db[_0xc583('0x33')]['find']({'where':{'id':_0x59781d['params']['id']}})[_0xc583('0x29')](function(_0x592b63){return db[_0xc583('0x50')]['transaction'](function(_0x440079){return _0x592b63[_0xc583('0x85')](_0x59781d['query'][_0xc583('0x70')],{'transaction':_0x440079})[_0xc583('0x29')](function(){if(!_[_0xc583('0x95')](_0x42b5a5)){return _0x592b63[_0xc583('0x75')](_0x42b5a5,{'transaction':_0x440079});}})['then'](function(){_0x42b5a5[_0xc583('0x96')](function(_0x182c40){socket[_0xc583('0x73')]('userVoicePrefix:remove',{'UserId':_0x182c40,'VoicePrefixId':_0x592b63['id']});});});});});});})[_0xc583('0x29')](respondWithStatusCode(_0x3bcbce,null))[_0xc583('0x47')](handleError(_0x3bcbce,null));}; \ No newline at end of file +var _0x5b12=['QueryTypes','SELECT','TeamId','includes','all','union','compact','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','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','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','sendStatus','status','end','json','offset','undefined','limit','count','reject','save','update','then','get','VoicePrefixes','UserProfileResource','destroy','error','stack','name','index','map','rawAttributes','fieldName','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','type','VIRTUAL','filter','options','VoicePrefix','includeAll','include','findAll','rows','catch','show','fields','find','params','describe','create','sequelize','transaction','body','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','context','from-sip','exten','app','description','priority','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','Set','CDR(prefix)=','PREFIX-CALLERIDALL=','callerIdAll','push','No\x20callerid\x20available','goto','${EXTEN:','charAt','system-','findById','addAgents','ids','spread','emit','userVoicePrefix:save','removeAgents','userVoicePrefix:remove','findOne','merge','getTeams','Team','User','online','flatMap','Agents','addTeams','each','TeamVoicePrefix','upsert','UserVoicePrefix','findOrCreate','forEach','removeTeams','select','field','tq.TeamId','from','team_has_voice_prefixes','user_has_teams','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5b12,0xa3));var _0x25b1=function(_0x9229ce,_0x14842b){_0x9229ce=_0x9229ce-0x0;var _0x4b9343=_0x5b12[_0x9229ce];return _0x4b9343;};'use strict';var emlformat=require(_0x25b1('0x0'));var rimraf=require(_0x25b1('0x1'));var zipdir=require(_0x25b1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x25b1('0x3'));var moment=require('moment');var BPromise=require(_0x25b1('0x4'));var Mustache=require(_0x25b1('0x5'));var util=require('util');var path=require(_0x25b1('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x25b1('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x25b1('0x8'));var crypto=require(_0x25b1('0x9'));var jsforce=require(_0x25b1('0xa'));var deskjs=require(_0x25b1('0xb'));var toCsv=require(_0x25b1('0xc'));var querystring=require(_0x25b1('0xd'));var Papa=require(_0x25b1('0xe'));var Redis=require(_0x25b1('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x25b1('0x10'));var as=require(_0x25b1('0x11'));var hardwareService=require(_0x25b1('0x12'));var logger=require(_0x25b1('0x13'))(_0x25b1('0x14'));var utils=require(_0x25b1('0x15'));var config=require(_0x25b1('0x16'));var licenseUtil=require(_0x25b1('0x17'));var db=require(_0x25b1('0x18'))['db'];config[_0x25b1('0x19')]=_[_0x25b1('0x1a')](config[_0x25b1('0x19')],{'host':_0x25b1('0x1b'),'port':0x18eb});var socket=require(_0x25b1('0x1c'))(new Redis(config[_0x25b1('0x19')]));require(_0x25b1('0x1d'))['register'](socket);function respondWithStatusCode(_0x2c337a,_0x2559a1){_0x2559a1=_0x2559a1||0xcc;return function(_0x4de13f){if(_0x4de13f){return _0x2c337a[_0x25b1('0x1e')](_0x2559a1);}return _0x2c337a[_0x25b1('0x1f')](_0x2559a1)[_0x25b1('0x20')]();};}function respondWithResult(_0x4a5a58,_0x593165){_0x593165=_0x593165||0xc8;return function(_0x7b50ab){if(_0x7b50ab){return _0x4a5a58['status'](_0x593165)[_0x25b1('0x21')](_0x7b50ab);}};}function respondWithFilteredResult(_0x2ca567,_0x1be2d8){return function(_0x27ccc9){if(_0x27ccc9){var _0x1f78c2=typeof _0x1be2d8[_0x25b1('0x22')]===_0x25b1('0x23')&&typeof _0x1be2d8[_0x25b1('0x24')]==='undefined';var _0x4ecff1=_0x27ccc9[_0x25b1('0x25')];var _0x501dc8=_0x1f78c2?0x0:_0x1be2d8[_0x25b1('0x22')];var _0x50ae0f=_0x1f78c2?_0x27ccc9[_0x25b1('0x25')]:_0x1be2d8['offset']+_0x1be2d8[_0x25b1('0x24')];var _0x529310;if(_0x50ae0f>=_0x4ecff1){_0x50ae0f=_0x4ecff1;_0x529310=0xc8;}else{_0x529310=0xce;}_0x2ca567[_0x25b1('0x1f')](_0x529310);return _0x2ca567['set']('Content-Range',_0x501dc8+'-'+_0x50ae0f+'/'+_0x4ecff1)['json'](_0x27ccc9);}return null;};}function patchUpdates(_0x3bca9f){return function(_0x150436){try{jsonpatch['apply'](_0x150436,_0x3bca9f,!![]);}catch(_0x19bab8){return BPromise[_0x25b1('0x26')](_0x19bab8);}return _0x150436[_0x25b1('0x27')]();};}function saveUpdates(_0x246acd,_0x1aabbb){return function(_0x5e6b6b){if(_0x5e6b6b){return _0x5e6b6b[_0x25b1('0x28')](_0x246acd)[_0x25b1('0x29')](function(_0xd22469){return _0xd22469;});}return null;};}function removeEntity(_0x282187,_0x1f37ed){return function(_0x1292bf){if(_0x1292bf){return _0x1292bf['destroy']()[_0x25b1('0x29')](function(){var _0x27dd68=_0x1292bf[_0x25b1('0x2a')]({'plain':!![]});var _0x5bc8fc=_0x25b1('0x2b');return db[_0x25b1('0x2c')][_0x25b1('0x2d')]({'where':{'type':_0x5bc8fc,'resourceId':_0x27dd68['id']}})['then'](function(){return _0x1292bf;});})[_0x25b1('0x29')](function(){_0x282187['status'](0xcc)[_0x25b1('0x20')]();});}};}function handleEntityNotFound(_0x3febb8,_0x3a4475){return function(_0x293413){if(!_0x293413){_0x3febb8[_0x25b1('0x1e')](0x194);}return _0x293413;};}function handleError(_0x300a14,_0x46e429){_0x46e429=_0x46e429||0x1f4;return function(_0x4cd825){logger[_0x25b1('0x2e')](_0x4cd825[_0x25b1('0x2f')]);if(_0x4cd825[_0x25b1('0x30')]){delete _0x4cd825[_0x25b1('0x30')];}_0x300a14[_0x25b1('0x1f')](_0x46e429)['send'](_0x4cd825);};}exports[_0x25b1('0x31')]=function(_0x548dd0,_0x42441d){var _0x1622e8={},_0x1e1796={},_0x5a4234={'count':0x0,'rows':[]};var _0x5cbde5=_[_0x25b1('0x32')](db['VoicePrefix'][_0x25b1('0x33')],function(_0x391713){return{'name':_0x391713[_0x25b1('0x34')],'type':_0x391713['type']['key']};});_0x1e1796[_0x25b1('0x35')]=_[_0x25b1('0x32')](_0x5cbde5,_0x25b1('0x30'));_0x1e1796['query']=_[_0x25b1('0x36')](_0x548dd0[_0x25b1('0x37')]);_0x1e1796[_0x25b1('0x38')]=_[_0x25b1('0x39')](_0x1e1796['model'],_0x1e1796[_0x25b1('0x37')]);_0x1622e8[_0x25b1('0x3a')]=_[_0x25b1('0x39')](_0x1e1796['model'],qs['fields'](_0x548dd0[_0x25b1('0x37')]['fields']));_0x1622e8[_0x25b1('0x3a')]=_0x1622e8[_0x25b1('0x3a')][_0x25b1('0x3b')]?_0x1622e8[_0x25b1('0x3a')]:_0x1e1796[_0x25b1('0x35')];if(!_0x548dd0[_0x25b1('0x37')][_0x25b1('0x3c')](_0x25b1('0x3d'))){_0x1622e8[_0x25b1('0x24')]=qs[_0x25b1('0x24')](_0x548dd0[_0x25b1('0x37')][_0x25b1('0x24')]);_0x1622e8[_0x25b1('0x22')]=qs[_0x25b1('0x22')](_0x548dd0[_0x25b1('0x37')]['offset']);}_0x1622e8[_0x25b1('0x3e')]=qs[_0x25b1('0x3f')](_0x548dd0['query'][_0x25b1('0x3f')]);_0x1622e8[_0x25b1('0x40')]=qs[_0x25b1('0x38')](_[_0x25b1('0x41')](_0x548dd0[_0x25b1('0x37')],_0x1e1796['filters']),_0x5cbde5);if(_0x548dd0[_0x25b1('0x37')]['filter']){_0x1622e8[_0x25b1('0x40')]=_['merge'](_0x1622e8[_0x25b1('0x40')],{'$or':_[_0x25b1('0x32')](_0x5cbde5,function(_0x1b354e){if(_0x1b354e[_0x25b1('0x42')]!==_0x25b1('0x43')){var _0x45713f={};_0x45713f[_0x1b354e[_0x25b1('0x30')]]={'$like':'%'+_0x548dd0[_0x25b1('0x37')][_0x25b1('0x44')]+'%'};return _0x45713f;}})});}_0x1622e8=_['merge']({},_0x1622e8,_0x548dd0[_0x25b1('0x45')]);var _0x585c37={'where':_0x1622e8[_0x25b1('0x40')]};return db[_0x25b1('0x46')]['count'](_0x585c37)[_0x25b1('0x29')](function(_0x39b4c7){_0x5a4234[_0x25b1('0x25')]=_0x39b4c7;if(_0x548dd0[_0x25b1('0x37')][_0x25b1('0x47')]){_0x1622e8[_0x25b1('0x48')]=[{'all':!![]}];}return db[_0x25b1('0x46')][_0x25b1('0x49')](_0x1622e8);})[_0x25b1('0x29')](function(_0x453352){_0x5a4234[_0x25b1('0x4a')]=_0x453352;return _0x5a4234;})[_0x25b1('0x29')](respondWithFilteredResult(_0x42441d,_0x1622e8))[_0x25b1('0x4b')](handleError(_0x42441d,null));};exports[_0x25b1('0x4c')]=function(_0x21242a,_0x210cef){var _0x103953={'raw':![],'where':{'id':_0x21242a['params']['id']}},_0x210a13={};_0x210a13['model']=_['keys'](db[_0x25b1('0x46')]['rawAttributes']);_0x210a13[_0x25b1('0x37')]=_['keys'](_0x21242a[_0x25b1('0x37')]);_0x210a13[_0x25b1('0x38')]=_[_0x25b1('0x39')](_0x210a13[_0x25b1('0x35')],_0x210a13[_0x25b1('0x37')]);_0x103953[_0x25b1('0x3a')]=_['intersection'](_0x210a13[_0x25b1('0x35')],qs[_0x25b1('0x4d')](_0x21242a[_0x25b1('0x37')][_0x25b1('0x4d')]));_0x103953['attributes']=_0x103953[_0x25b1('0x3a')][_0x25b1('0x3b')]?_0x103953[_0x25b1('0x3a')]:_0x210a13['model'];if(_0x21242a[_0x25b1('0x37')]['includeAll']){_0x103953[_0x25b1('0x48')]=[{'all':!![]}];}_0x103953=_['merge']({},_0x103953,_0x21242a['options']);return db[_0x25b1('0x46')][_0x25b1('0x4e')](_0x103953)[_0x25b1('0x29')](handleEntityNotFound(_0x210cef,null))[_0x25b1('0x29')](respondWithResult(_0x210cef,null))['catch'](handleError(_0x210cef,null));};exports[_0x25b1('0x2d')]=function(_0x58e612,_0x7c30da){return db['VoicePrefix'][_0x25b1('0x4e')]({'where':{'id':_0x58e612[_0x25b1('0x4f')]['id']}})[_0x25b1('0x29')](handleEntityNotFound(_0x7c30da,null))['then'](removeEntity(_0x7c30da,null))[_0x25b1('0x4b')](handleError(_0x7c30da,null));};exports[_0x25b1('0x50')]=function(_0x354294,_0xf38a9e){return db[_0x25b1('0x46')][_0x25b1('0x50')]()['then'](respondWithResult(_0xf38a9e,null))[_0x25b1('0x4b')](handleError(_0xf38a9e,null));};exports[_0x25b1('0x51')]=function(_0x168931,_0x2311da){var _0x5e367;return db[_0x25b1('0x52')][_0x25b1('0x53')](function(_0x40d574){return db[_0x25b1('0x46')][_0x25b1('0x51')](_0x168931[_0x25b1('0x54')],{'transaction':_0x40d574})[_0x25b1('0x29')](function(_0x4190a1){_0x5e367=_0x4190a1[_0x25b1('0x2a')]({'plain':!![]});return db[_0x25b1('0x55')][_0x25b1('0x4e')]({'where':{'id':_0x5e367[_0x25b1('0x56')]},'raw':!![]})[_0x25b1('0x29')](function(_0x5732a1){return createVoicePrefixExtensions(_0x5e367,_0x5732a1,_0x40d574);});});})[_0x25b1('0x29')](function(){var _0x16e61e=_0x168931[_0x25b1('0x57')][_0x25b1('0x2a')]({'plain':!![]});if(!_0x16e61e)throw new Error(_0x25b1('0x58'));if(_0x16e61e[_0x25b1('0x59')]==='user'){var _0x105587=_0x5e367;return db[_0x25b1('0x5a')][_0x25b1('0x4e')]({'where':{'name':'VoicePrefixes','userProfileId':_0x16e61e[_0x25b1('0x5b')]},'raw':!![]})['then'](function(_0x5bd36b){if(_0x5bd36b&&_0x5bd36b['autoAssociation']===0x0){return db['UserProfileResource'][_0x25b1('0x51')]({'name':_0x105587['name'],'resourceId':_0x105587['id'],'type':_0x5bd36b[_0x25b1('0x30')],'sectionId':_0x5bd36b['id']},{})[_0x25b1('0x29')](function(){return _0x5e367;});}else{return _0x5e367;}})[_0x25b1('0x4b')](function(_0x439bab){logger[_0x25b1('0x2e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x439bab);throw _0x439bab;});}return _0x5e367;})[_0x25b1('0x29')](respondWithResult(_0x2311da,null))[_0x25b1('0x4b')](handleError(_0x2311da,null));};function Extension(_0x37b58d,_0x400ec9,_0x5ecc36,_0xcca343){this[_0x25b1('0x5c')]=_0x25b1('0x5d');this[_0x25b1('0x5e')]=_0x37b58d;this[_0x25b1('0x5f')]=_0x5ecc36;this[_0x25b1('0x42')]='system';this[_0x25b1('0x60')]='Voice\x20Prefix\x20Extension';this[_0x25b1('0x61')]=_0x400ec9;this[_0x25b1('0x62')]=_0xcca343;}function createVoicePrefixExtensions(_0x49052b,_0x42a81f,_0x3d8d33){return new BPromise(function(_0x551bed,_0x1351ea){var _0x303049=new Extension(formatPrefixName(_0x49052b[_0x25b1('0x63')]),0x1,_0x25b1('0x64'),_0x25b1('0x65'));_0x303049[_0x25b1('0x66')]=_0x49052b['id'];return db[_0x25b1('0x55')][_0x25b1('0x51')](_0x303049,{'transaction':_0x3d8d33})['then'](function(_0x6f1b1f){var _0x1e2dcb=_0x6f1b1f[_0x25b1('0x2a')]({'plain':!![]});var _0x1da588=_[_0x25b1('0x32')](addVoicePrefixExtensions(_0x49052b,_0x42a81f),function(_0x2b9223){_0x2b9223[_0x25b1('0x56')]=_0x1e2dcb['id'];_0x2b9223[_0x25b1('0x66')]=_0x49052b['id'];return _0x2b9223;});return db['VoiceExtension'][_0x25b1('0x67')](_0x1da588,{'transaction':_0x3d8d33})[_0x25b1('0x29')](function(_0x51f922){if(!_0x51f922){return _0x1351ea(_0x25b1('0x68'));}else{return _0x551bed(_0x51f922);}})[_0x25b1('0x4b')](function(_0x5b71e5){return _0x1351ea(_0x5b71e5);});});;});};function addVoicePrefixExtensions(_0x26e90c,_0x498aca){var _0x44aa87=[];var _0x4e62b5=formatPrefixName(_0x26e90c[_0x25b1('0x63')]);_0x44aa87['push'](new Extension(_0x4e62b5,0x2,_0x25b1('0x69'),_0x25b1('0x6a')+_0x26e90c[_0x25b1('0x30')]));if(_0x26e90c['callerIdAll']){_0x44aa87['push'](new Extension(_0x4e62b5,0x3,_0x25b1('0x69'),_0x25b1('0x6b')+_0x26e90c[_0x25b1('0x6c')]));}else{_0x44aa87[_0x25b1('0x6d')](new Extension(_0x4e62b5,0x3,_0x25b1('0x64'),_0x25b1('0x6e')));}_0x44aa87[_0x25b1('0x6d')](new Extension(_0x4e62b5,0x4,_0x25b1('0x6f'),_0x498aca[_0x25b1('0x5c')]+','+_0x25b1('0x70')+(0x8+_0x26e90c[_0x25b1('0x30')][_0x25b1('0x3b')])+'}'+','+0x1));return _0x44aa87;}function formatPrefixName(_0x3d06ab){var _0x975b85='_';for(var _0x1c22c4=0x0;_0x1c22c4<_0x3d06ab[_0x25b1('0x3b')];_0x1c22c4++){if(_0x3d06ab[_0x25b1('0x71')](_0x1c22c4)=='-'){_0x975b85+=_0x3d06ab[_0x25b1('0x71')](_0x1c22c4);}else{_0x975b85+='['+_0x3d06ab[_0x25b1('0x71')](_0x1c22c4)+']';}}_0x975b85+='.';return _0x975b85;}exports[_0x25b1('0x28')]=function(_0x15272b,_0x2fe4a5,_0x584499){var _0x1a3368=_0x15272b['body'];_0x1a3368[_0x25b1('0x63')]=_0x25b1('0x72')+_0x1a3368[_0x25b1('0x30')]+'-';return db['sequelize']['transaction'](function(_0x3f9ca7){return db[_0x25b1('0x46')]['update'](_0x1a3368,{'where':{'id':_0x1a3368['id']},'transaction':_0x3f9ca7})[_0x25b1('0x29')](function(){return db[_0x25b1('0x55')][_0x25b1('0x2d')]({'where':{'VoicePrefixId':_0x1a3368['id']},'transaction':_0x3f9ca7})['then'](function(){return db[_0x25b1('0x55')][_0x25b1('0x4e')]({'where':{'id':_0x1a3368[_0x25b1('0x56')]},'raw':!![]})[_0x25b1('0x29')](function(_0x5f1fef){return createVoicePrefixExtensions(_0x1a3368,_0x5f1fef,_0x3f9ca7);});});});})[_0x25b1('0x29')](function(){return db[_0x25b1('0x46')][_0x25b1('0x73')](_0x1a3368['id']);})[_0x25b1('0x29')](respondWithResult(_0x2fe4a5,null))[_0x25b1('0x4b')](handleError(_0x2fe4a5,null));};exports[_0x25b1('0x74')]=function(_0x4a9fbf,_0x40400e,_0x3f77e0){return db['VoicePrefix']['find']({'where':{'id':_0x4a9fbf[_0x25b1('0x4f')]['id']}})[_0x25b1('0x29')](handleEntityNotFound(_0x40400e,null))[_0x25b1('0x29')](function(_0x3ff99d){if(_0x3ff99d){return _0x3ff99d[_0x25b1('0x74')](_0x4a9fbf[_0x25b1('0x54')][_0x25b1('0x75')],_['omit'](_0x4a9fbf[_0x25b1('0x54')],[_0x25b1('0x75'),'id'])||{})[_0x25b1('0x76')](function(_0x49fac2){for(var _0x1bbb9b=0x0;_0x1bbb9b<_0x4a9fbf[_0x25b1('0x54')][_0x25b1('0x75')]['length'];_0x1bbb9b+=0x1){socket[_0x25b1('0x77')](_0x25b1('0x78'),{'UserId':Number(_0x4a9fbf[_0x25b1('0x54')][_0x25b1('0x75')][_0x1bbb9b]),'VoicePrefixId':Number(_0x4a9fbf[_0x25b1('0x4f')]['id'])});}return _0x49fac2;});}})[_0x25b1('0x29')](respondWithResult(_0x40400e,null))[_0x25b1('0x4b')](handleError(_0x40400e,null));};exports[_0x25b1('0x79')]=function(_0x1a07cb,_0x18021f,_0x20b43f){return db['VoicePrefix'][_0x25b1('0x4e')]({'where':{'id':_0x1a07cb[_0x25b1('0x4f')]['id']}})['then'](handleEntityNotFound(_0x18021f,null))[_0x25b1('0x29')](function(_0x45804b){if(_0x45804b){return _0x45804b[_0x25b1('0x79')](_0x1a07cb[_0x25b1('0x37')][_0x25b1('0x75')])['then'](function(){if(_['isArray'](_0x1a07cb[_0x25b1('0x37')]['ids'])){for(var _0x3e7f2b=0x0;_0x3e7f2b<_0x1a07cb[_0x25b1('0x37')][_0x25b1('0x75')][_0x25b1('0x3b')];_0x3e7f2b+=0x1){socket[_0x25b1('0x77')](_0x25b1('0x7a'),{'UserId':Number(_0x1a07cb['query'][_0x25b1('0x75')][_0x3e7f2b]),'VoicePrefixId':Number(_0x1a07cb[_0x25b1('0x4f')]['id'])});}}else{socket[_0x25b1('0x77')](_0x25b1('0x7a'),{'UserId':Number(_0x1a07cb['query']['ids']),'VoicePrefixId':Number(_0x1a07cb['params']['id'])});}});}})[_0x25b1('0x29')](respondWithStatusCode(_0x18021f,null))[_0x25b1('0x4b')](handleError(_0x18021f,null));};exports['getAgents']=function(_0x49c2d3,_0x271837,_0x102b85){var _0x6bbd44={};var _0x67a4b7={};var _0x54e1a6;var _0x10409f;return db[_0x25b1('0x46')][_0x25b1('0x7b')]({'where':{'id':_0x49c2d3[_0x25b1('0x4f')]['id']}})[_0x25b1('0x29')](handleEntityNotFound(_0x271837,null))[_0x25b1('0x29')](function(_0x175c72){if(_0x175c72){_0x54e1a6=_0x175c72;_0x67a4b7[_0x25b1('0x35')]=_['keys'](db['User'][_0x25b1('0x33')]);_0x67a4b7[_0x25b1('0x37')]=_['keys'](_0x49c2d3['query']);_0x67a4b7[_0x25b1('0x38')]=_[_0x25b1('0x39')](_0x67a4b7['model'],_0x67a4b7[_0x25b1('0x37')]);_0x6bbd44[_0x25b1('0x3a')]=_[_0x25b1('0x39')](_0x67a4b7[_0x25b1('0x35')],qs[_0x25b1('0x4d')](_0x49c2d3[_0x25b1('0x37')][_0x25b1('0x4d')]));_0x6bbd44['attributes']=_0x6bbd44[_0x25b1('0x3a')][_0x25b1('0x3b')]?_0x6bbd44[_0x25b1('0x3a')]:_0x67a4b7['model'];_0x6bbd44['order']=qs['sort'](_0x49c2d3[_0x25b1('0x37')][_0x25b1('0x3f')]);_0x6bbd44[_0x25b1('0x40')]=qs['filters'](_['pick'](_0x49c2d3[_0x25b1('0x37')],_0x67a4b7[_0x25b1('0x38')]));if(_0x49c2d3[_0x25b1('0x37')][_0x25b1('0x44')]){_0x6bbd44[_0x25b1('0x40')]=_[_0x25b1('0x7c')](_0x6bbd44[_0x25b1('0x40')],{'$or':_[_0x25b1('0x32')](_0x6bbd44[_0x25b1('0x3a')],function(_0x4c74f8){var _0xb7494b={};_0xb7494b[_0x4c74f8]={'$like':'%'+_0x49c2d3[_0x25b1('0x37')]['filter']+'%'};return _0xb7494b;})});}_0x6bbd44=_['merge']({},_0x6bbd44,_0x49c2d3[_0x25b1('0x45')]);return _0x54e1a6['getAgents'](_0x6bbd44);}})[_0x25b1('0x29')](function(_0x133a5d){if(_0x133a5d){_0x10409f=_0x133a5d[_0x25b1('0x3b')];if(!_0x49c2d3['query']['hasOwnProperty']('nolimit')){_0x6bbd44[_0x25b1('0x24')]=qs[_0x25b1('0x24')](_0x49c2d3['query'][_0x25b1('0x24')]);_0x6bbd44[_0x25b1('0x22')]=qs[_0x25b1('0x22')](_0x49c2d3[_0x25b1('0x37')][_0x25b1('0x22')]);}return _0x54e1a6['getAgents'](_0x6bbd44);}})[_0x25b1('0x29')](function(_0x954de5){if(_0x954de5){return _0x954de5?{'count':_0x10409f,'rows':_0x954de5}:null;}})['then'](respondWithResult(_0x271837,null))[_0x25b1('0x4b')](handleError(_0x271837,null));};exports['getTeams']=function(_0x198561,_0x4c2b9f,_0x5c7849){var _0x92b5d6={};var _0x1958c0={};var _0x4428d2;var _0x12e63d;return db[_0x25b1('0x46')]['findOne']({'where':{'id':_0x198561['params']['id']}})[_0x25b1('0x29')](handleEntityNotFound(_0x4c2b9f,null))['then'](function(_0x2890c1){if(_0x2890c1){_0x4428d2=_0x2890c1;_0x1958c0[_0x25b1('0x35')]=_[_0x25b1('0x36')](db['Team'][_0x25b1('0x33')]);_0x1958c0['query']=_['keys'](_0x198561['query']);_0x1958c0[_0x25b1('0x38')]=_['intersection'](_0x1958c0[_0x25b1('0x35')],_0x1958c0[_0x25b1('0x37')]);_0x92b5d6[_0x25b1('0x3a')]=_[_0x25b1('0x39')](_0x1958c0[_0x25b1('0x35')],qs[_0x25b1('0x4d')](_0x198561[_0x25b1('0x37')][_0x25b1('0x4d')]));_0x92b5d6[_0x25b1('0x3a')]=_0x92b5d6[_0x25b1('0x3a')][_0x25b1('0x3b')]?_0x92b5d6[_0x25b1('0x3a')]:_0x1958c0[_0x25b1('0x35')];_0x92b5d6[_0x25b1('0x3e')]=qs[_0x25b1('0x3f')](_0x198561[_0x25b1('0x37')][_0x25b1('0x3f')]);_0x92b5d6['where']=qs[_0x25b1('0x38')](_['pick'](_0x198561[_0x25b1('0x37')],_0x1958c0[_0x25b1('0x38')]));if(_0x198561[_0x25b1('0x37')][_0x25b1('0x44')]){_0x92b5d6[_0x25b1('0x40')]=_['merge'](_0x92b5d6[_0x25b1('0x40')],{'$or':_[_0x25b1('0x32')](_0x92b5d6[_0x25b1('0x3a')],function(_0x5af2b6){var _0x339e82={};_0x339e82[_0x5af2b6]={'$like':'%'+_0x198561[_0x25b1('0x37')][_0x25b1('0x44')]+'%'};return _0x339e82;})});}_0x92b5d6=_[_0x25b1('0x7c')]({},_0x92b5d6,_0x198561['options']);return _0x4428d2[_0x25b1('0x7d')](_0x92b5d6);}})[_0x25b1('0x29')](function(_0x270f00){if(_0x270f00){_0x12e63d=_0x270f00['length'];if(!_0x198561[_0x25b1('0x37')][_0x25b1('0x3c')](_0x25b1('0x3d'))){_0x92b5d6['limit']=qs[_0x25b1('0x24')](_0x198561[_0x25b1('0x37')]['limit']);_0x92b5d6[_0x25b1('0x22')]=qs[_0x25b1('0x22')](_0x198561['query'][_0x25b1('0x22')]);}return _0x4428d2[_0x25b1('0x7d')](_0x92b5d6);}})[_0x25b1('0x29')](function(_0x14b909){if(_0x14b909){return _0x14b909?{'count':_0x12e63d,'rows':_0x14b909}:null;}})[_0x25b1('0x29')](respondWithResult(_0x4c2b9f,null))[_0x25b1('0x4b')](handleError(_0x4c2b9f,null));};exports['addTeams']=function(_0x3496a9,_0x30f1e9,_0x18211a){var _0x3038be=_0x3496a9[_0x25b1('0x54')][_0x25b1('0x75')];var _0x310a32;return db[_0x25b1('0x7e')][_0x25b1('0x49')]({'where':{'id':_0x3038be},'attributes':['id'],'include':[{'model':db[_0x25b1('0x7f')],'as':'Agents','attributes':['id',_0x25b1('0x30'),_0x25b1('0x80'),'voicePause','interface'],'raw':!![]}]})[_0x25b1('0x29')](function(_0x96a1b0){if(_0x96a1b0){_0x310a32=_0x96a1b0;var _0x2db4a9=_[_0x25b1('0x81')](_0x96a1b0,function(_0x58e166){var _0x4c6181=_0x58e166['get']({'plain':!![]});return _0x4c6181[_0x25b1('0x82')];});return db[_0x25b1('0x46')][_0x25b1('0x4e')]({'where':{'id':_0x3496a9['params']['id']}})['then'](function(_0x16702d){return db[_0x25b1('0x52')][_0x25b1('0x53')](function(_0x55f740){return _0x16702d[_0x25b1('0x83')](_0x3038be,{'transaction':_0x55f740})[_0x25b1('0x29')](function(){return BPromise[_0x25b1('0x84')](_0x310a32,function(_0x2da0d9){return db[_0x25b1('0x85')][_0x25b1('0x86')]({'TeamId':_0x2da0d9['id'],'VoicePrefixId':_0x3496a9[_0x25b1('0x4f')]['id']},{'transaction':_0x55f740});});})[_0x25b1('0x29')](function(){return BPromise[_0x25b1('0x84')](_0x2db4a9,function(_0x5c515b){return db[_0x25b1('0x87')][_0x25b1('0x88')]({'where':{'UserId':_0x5c515b['id'],'VoicePrefixId':_0x3496a9[_0x25b1('0x4f')]['id']},'transaction':_0x55f740});});})[_0x25b1('0x29')](function(){_0x2db4a9[_0x25b1('0x89')](function(_0x3c8c4e){socket[_0x25b1('0x77')]('userVoicePrefix:save',{'UserId':_0x3c8c4e['id'],'VoicePrefixId':_0x16702d['id']});});});});});}})[_0x25b1('0x29')](respondWithStatusCode(_0x30f1e9,null))['catch'](handleError(_0x30f1e9,null));};exports[_0x25b1('0x8a')]=function(_0x469405,_0x1010c4,_0x22d3e4){return db['Team']['findAll']({'where':{'id':_0x469405[_0x25b1('0x37')][_0x25b1('0x75')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x1010c4,null))[_0x25b1('0x29')](function(_0xd05872){var _0x25c07f=_[_0x25b1('0x32')](_0xd05872,'id');var _0x1041d1=[];var _0x1f1160=[];var _0x29d8fe=squel[_0x25b1('0x8b')]();_0x29d8fe[_0x25b1('0x8c')](_0x25b1('0x8d'))[_0x25b1('0x8e')](_0x25b1('0x8f'),'tq')['join'](_0x25b1('0x90'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x25b1('0x40')](_0x25b1('0x91'),_0x469405[_0x25b1('0x4f')]['id']);for(var _0x1354c3=0x0;_0x1354c3<_0xd05872[_0x25b1('0x3b')];_0x1354c3+=0x1){let _0x3ccdab=_0xd05872[_0x1354c3];for(var _0x381a62=0x0;_0x381a62<_0x3ccdab[_0x25b1('0x82')]['length'];_0x381a62+=0x1){let _0x330ae7=_0x3ccdab[_0x25b1('0x82')][_0x381a62];var _0xbe6572=_0x29d8fe[_0x25b1('0x92')]();_0xbe6572[_0x25b1('0x40')](_0x25b1('0x93'),_0x330ae7['id']);_0x1f1160[_0x25b1('0x6d')](db['sequelize'][_0x25b1('0x37')](_0xbe6572[_0x25b1('0x94')](),{'type':db[_0x25b1('0x52')][_0x25b1('0x95')][_0x25b1('0x96')]})['then'](function(_0x4edb48){if(_0x4edb48[_0x25b1('0x3b')]===0x1){return _0x330ae7['id'];}else{var _0x2e924b=_['every'](_['map'](_0x4edb48,_0x25b1('0x97')),function(_0x16d969){return _[_0x25b1('0x98')](_0x25c07f,_0x16d969);});if(_0x2e924b){return _0x330ae7['id'];}}}));}}return BPromise[_0x25b1('0x99')](_0x1f1160)[_0x25b1('0x29')](function(_0x3128bd){_0x1041d1=_(_0x1041d1)[_0x25b1('0x9a')](_0x3128bd)[_0x25b1('0x9b')]()['value']();return db[_0x25b1('0x46')]['find']({'where':{'id':_0x469405['params']['id']}})[_0x25b1('0x29')](function(_0x4cf3e6){return db[_0x25b1('0x52')][_0x25b1('0x53')](function(_0x2c0147){return _0x4cf3e6[_0x25b1('0x8a')](_0x469405[_0x25b1('0x37')][_0x25b1('0x75')],{'transaction':_0x2c0147})[_0x25b1('0x29')](function(){if(!_['isEmpty'](_0x1041d1)){return _0x4cf3e6[_0x25b1('0x79')](_0x1041d1,{'transaction':_0x2c0147});}})[_0x25b1('0x29')](function(){_0x1041d1[_0x25b1('0x89')](function(_0x220f92){socket[_0x25b1('0x77')](_0x25b1('0x7a'),{'UserId':_0x220f92,'VoicePrefixId':_0x4cf3e6['id']});});});});});});})[_0x25b1('0x29')](respondWithStatusCode(_0x1010c4,null))[_0x25b1('0x4b')](handleError(_0x1010c4,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index c7c5808..7f1016d 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 _0x4a25=['events','../../mysqldb','VoicePrefix','setMaxListeners','save','emit','hasOwnProperty','hook'];(function(_0x252699,_0x134b4e){var _0x56d0c6=function(_0x5551a8){while(--_0x5551a8){_0x252699['push'](_0x252699['shift']());}};_0x56d0c6(++_0x134b4e);}(_0x4a25,0x1c8));var _0x54a2=function(_0x26462c,_0xd20a35){_0x26462c=_0x26462c-0x0;var _0x509a42=_0x4a25[_0x26462c];return _0x509a42;};'use strict';var EventEmitter=require(_0x54a2('0x0'));var VoicePrefix=require(_0x54a2('0x1'))['db'][_0x54a2('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x54a2('0x3')](0x0);var events={'afterCreate':_0x54a2('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x5aef78){return function(_0xf65d70,_0x2ff502,_0x54a64e){VoicePrefixEvents[_0x54a2('0x5')](_0x5aef78+':'+_0xf65d70['id'],_0xf65d70);VoicePrefixEvents[_0x54a2('0x5')](_0x5aef78,_0xf65d70);_0x54a64e(null);};}for(var e in events){if(events[_0x54a2('0x6')](e)){var event=events[e];VoicePrefix[_0x54a2('0x7')](e,emitEvent(event));}}module['exports']=VoicePrefixEvents; \ No newline at end of file +var _0xaee8=['../../mysqldb','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events'];(function(_0x5715a4,_0x33f690){var _0x24d5fd=function(_0x2a3119){while(--_0x2a3119){_0x5715a4['push'](_0x5715a4['shift']());}};_0x24d5fd(++_0x33f690);}(_0xaee8,0x1af));var _0x8aee=function(_0x4e1857,_0x2a6ccc){_0x4e1857=_0x4e1857-0x0;var _0x2ddd26=_0xaee8[_0x4e1857];return _0x2ddd26;};'use strict';var EventEmitter=require(_0x8aee('0x0'));var VoicePrefix=require(_0x8aee('0x1'))['db']['VoicePrefix'];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x8aee('0x2')](0x0);var events={'afterCreate':_0x8aee('0x3'),'afterUpdate':_0x8aee('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1cf4d5){return function(_0x41051f,_0x260be7,_0x1a04cb){VoicePrefixEvents[_0x8aee('0x5')](_0x1cf4d5+':'+_0x41051f['id'],_0x41051f);VoicePrefixEvents[_0x8aee('0x5')](_0x1cf4d5,_0x41051f);_0x1a04cb(null);};}for(var e in events){if(events[_0x8aee('0x6')](e)){var event=events[e];VoicePrefix[_0x8aee('0x7')](e,emitEvent(event));}}module[_0x8aee('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 c5f76dc..a16f6c4 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 _0xc684=['bluebird','request-promise','path','rimraf','../../config/environment','./voicePrefix.attributes','exports','lodash','api','moment'];(function(_0x4e4f0e,_0x1c3892){var _0x1a7219=function(_0x3821ad){while(--_0x3821ad){_0x4e4f0e['push'](_0x4e4f0e['shift']());}};_0x1a7219(++_0x1c3892);}(_0xc684,0x1dd));var _0x4c68=function(_0x187d4c,_0x43d282){_0x187d4c=_0x187d4c-0x0;var _0x14e999=_0xc684[_0x187d4c];return _0x14e999;};'use strict';var _=require(_0x4c68('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x4c68('0x1'));var moment=require(_0x4c68('0x2'));var BPromise=require(_0x4c68('0x3'));var rp=require(_0x4c68('0x4'));var fs=require('fs');var path=require(_0x4c68('0x5'));var rimraf=require(_0x4c68('0x6'));var config=require(_0x4c68('0x7'));var attributes=require(_0x4c68('0x8'));module[_0x4c68('0x9')]=function(_0x462c28,_0x126659){return _0x462c28['define']('VoicePrefix',attributes,{'tableName':'voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf572=['request-promise','../../config/environment','exports','define','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x303e55,_0x309d5e){var _0xf8a2b9=function(_0x3e7f90){while(--_0x3e7f90){_0x303e55['push'](_0x303e55['shift']());}};_0xf8a2b9(++_0x309d5e);}(_0xf572,0x9a));var _0x2f57=function(_0x5dcf1d,_0x3ae4c1){_0x5dcf1d=_0x5dcf1d-0x0;var _0x54cb5f=_0xf572[_0x5dcf1d];return _0x54cb5f;};'use strict';var _=require(_0x2f57('0x0'));var util=require(_0x2f57('0x1'));var logger=require(_0x2f57('0x2'))(_0x2f57('0x3'));var moment=require(_0x2f57('0x4'));var BPromise=require(_0x2f57('0x5'));var rp=require(_0x2f57('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2f57('0x7'));var attributes=require('./voicePrefix.attributes');module[_0x2f57('0x8')]=function(_0x599028,_0xbdadf5){return _0x599028[_0x2f57('0x9')]('VoicePrefix',attributes,{'tableName':'voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.rpc.js b/server/api/voicePrefix/voicePrefix.rpc.js index e66fef1..2d07519 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 _0x7b77=['localhost','socket.io-emitter','./voicePrefix.socket','request','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0x7b77,0x179));var _0x77b7=function(_0x48b810,_0x173a5e){_0x48b810=_0x48b810-0x0;var _0x23c17d=_0x7b77[_0x48b810];return _0x23c17d;};'use strict';var _=require(_0x77b7('0x0'));var util=require(_0x77b7('0x1'));var moment=require(_0x77b7('0x2'));var BPromise=require(_0x77b7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x77b7('0x4'));var db=require(_0x77b7('0x5'))['db'];var utils=require(_0x77b7('0x6'));var logger=require('../../config/logger')(_0x77b7('0x7'));var config=require(_0x77b7('0x8'));var jayson=require(_0x77b7('0x9'));var client=jayson[_0x77b7('0xa')][_0x77b7('0xb')]({'port':0x232a});config[_0x77b7('0xc')]=_['defaults'](config[_0x77b7('0xc')],{'host':_0x77b7('0xd'),'port':0x18eb});var socket=require(_0x77b7('0xe'))(new Redis(config['redis']));require(_0x77b7('0xf'))['register'](socket);function respondWithRpcPromise(_0x4a628c,_0x5aaacf,_0x2d820d){return new BPromise(function(_0x2bf69a,_0x5e7f6a){return client[_0x77b7('0x10')](_0x4a628c,_0x2d820d)[_0x77b7('0x11')](function(_0xde9906){logger[_0x77b7('0x12')](_0x77b7('0x13'),_0x5aaacf,_0x77b7('0x14'));logger[_0x77b7('0x15')]('VoicePrefix,\x20%s,\x20%s,\x20%s',_0x5aaacf,_0x77b7('0x14'),JSON[_0x77b7('0x16')](_0xde9906));if(_0xde9906['error']){if(_0xde9906['error']['code']===0x1f4){logger[_0x77b7('0x17')](_0x77b7('0x13'),_0x5aaacf,_0xde9906[_0x77b7('0x17')][_0x77b7('0x18')]);return _0x5e7f6a(_0xde9906[_0x77b7('0x17')][_0x77b7('0x18')]);}logger['error'](_0x77b7('0x13'),_0x5aaacf,_0xde9906[_0x77b7('0x17')][_0x77b7('0x18')]);return _0x2bf69a(_0xde9906[_0x77b7('0x17')][_0x77b7('0x18')]);}else{logger[_0x77b7('0x12')](_0x77b7('0x13'),_0x5aaacf,_0x77b7('0x14'));_0x2bf69a(_0xde9906[_0x77b7('0x19')]['message']);}})['catch'](function(_0x5f391d){logger[_0x77b7('0x17')]('VoicePrefix,\x20%s,\x20%s',_0x5aaacf,_0x5f391d);_0x5e7f6a(_0x5f391d);});});} \ No newline at end of file +var _0x0a05=['randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','redis','localhost','socket.io-emitter','register','request','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','VoicePrefix,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0x0a05,0x9e));var _0x50a0=function(_0x21233e,_0x2d39c1){_0x21233e=_0x21233e-0x0;var _0x3752c9=_0x0a05[_0x21233e];return _0x3752c9;};'use strict';var _=require(_0x50a0('0x0'));var util=require(_0x50a0('0x1'));var moment=require(_0x50a0('0x2'));var BPromise=require(_0x50a0('0x3'));var rs=require(_0x50a0('0x4'));var fs=require('fs');var Redis=require(_0x50a0('0x5'));var db=require(_0x50a0('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x50a0('0x7'))('rpc');var config=require(_0x50a0('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x50a0('0x9')][_0x50a0('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x50a0('0xb')],{'host':_0x50a0('0xc'),'port':0x18eb});var socket=require(_0x50a0('0xd'))(new Redis(config[_0x50a0('0xb')]));require('./voicePrefix.socket')[_0x50a0('0xe')](socket);function respondWithRpcPromise(_0x4bdc66,_0x41bd7b,_0x136e4b){return new BPromise(function(_0x39a17e,_0x4efc6b){return client[_0x50a0('0xf')](_0x4bdc66,_0x136e4b)['then'](function(_0x58080b){logger['info']('VoicePrefix,\x20%s,\x20%s',_0x41bd7b,_0x50a0('0x10'));logger[_0x50a0('0x11')](_0x50a0('0x12'),_0x41bd7b,_0x50a0('0x10'),JSON[_0x50a0('0x13')](_0x58080b));if(_0x58080b['error']){if(_0x58080b[_0x50a0('0x14')][_0x50a0('0x15')]===0x1f4){logger[_0x50a0('0x14')](_0x50a0('0x16'),_0x41bd7b,_0x58080b[_0x50a0('0x14')]['message']);return _0x4efc6b(_0x58080b['error']['message']);}logger['error'](_0x50a0('0x16'),_0x41bd7b,_0x58080b[_0x50a0('0x14')][_0x50a0('0x17')]);return _0x39a17e(_0x58080b[_0x50a0('0x14')][_0x50a0('0x17')]);}else{logger[_0x50a0('0x18')]('VoicePrefix,\x20%s,\x20%s',_0x41bd7b,'request\x20sent');_0x39a17e(_0x58080b[_0x50a0('0x19')][_0x50a0('0x17')]);}})[_0x50a0('0x1a')](function(_0x19bff7){logger[_0x50a0('0x14')]('VoicePrefix,\x20%s,\x20%s',_0x41bd7b,_0x19bff7);_0x4efc6b(_0x19bff7);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index dec494b..e9fca90 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 _0x2504=['remove','update','emit','removeListener','register','voicePrefix:','./voicePrefix.events','save'];(function(_0x166e33,_0x127e77){var _0x1a2409=function(_0x48edd3){while(--_0x48edd3){_0x166e33['push'](_0x166e33['shift']());}};_0x1a2409(++_0x127e77);}(_0x2504,0xee));var _0x4250=function(_0x14ccbf,_0x8f1672){_0x14ccbf=_0x14ccbf-0x0;var _0x3f7c7c=_0x2504[_0x14ccbf];return _0x3f7c7c;};'use strict';var VoicePrefixEvents=require(_0x4250('0x0'));var events=[_0x4250('0x1'),_0x4250('0x2'),_0x4250('0x3')];function createListener(_0x307ca9,_0x67c47b){return function(_0x41d71d){_0x67c47b[_0x4250('0x4')](_0x307ca9,_0x41d71d);};}function removeListener(_0x17d2d8,_0xc31f3a){return function(){VoicePrefixEvents[_0x4250('0x5')](_0x17d2d8,_0xc31f3a);};}exports[_0x4250('0x6')]=function(_0x493da9){for(var _0x473cb8=0x0,_0x4e177e=events['length'];_0x473cb8<_0x4e177e;_0x473cb8++){var _0x370998=events[_0x473cb8];var _0x477312=createListener(_0x4250('0x7')+_0x370998,_0x493da9);VoicePrefixEvents['on'](_0x370998,_0x477312);}}; \ No newline at end of file +var _0xab26=['./voicePrefix.events','save','remove','removeListener','register','length','voicePrefix:'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xab26,0xd2));var _0x6ab2=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xab26[_0x4565bf];return _0x5610ba;};'use strict';var VoicePrefixEvents=require(_0x6ab2('0x0'));var events=[_0x6ab2('0x1'),_0x6ab2('0x2'),'update'];function createListener(_0x2dfe5c,_0x2a9ffe){return function(_0x5ac05e){_0x2a9ffe['emit'](_0x2dfe5c,_0x5ac05e);};}function removeListener(_0x4c8cf,_0x51bdcd){return function(){VoicePrefixEvents[_0x6ab2('0x3')](_0x4c8cf,_0x51bdcd);};}exports[_0x6ab2('0x4')]=function(_0x31c9f1){for(var _0x56dc80=0x0,_0x41643a=events[_0x6ab2('0x5')];_0x56dc80<_0x41643a;_0x56dc80++){var _0x54bf93=events[_0x56dc80];var _0x140cc1=createListener(_0x6ab2('0x6')+_0x54bf93,_0x31c9f1);VoicePrefixEvents['on'](_0x54bf93,_0x140cc1);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index efda1db..75ba977 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 _0xa9e0=['addAgents','/:id/blacklists','addBlackLists','update','delete','destroy','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','/:id','getHoppers','/:id/hopper_histories','isAuthenticated','getHopperHistories','/:id/hopper_black','getHopperBlacks','/:id/teams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','getLists','post','create','/:id/clone','clone','addTeams'];(function(_0x3054b2,_0x458160){var _0x3b97aa=function(_0x2e2c43){while(--_0x2e2c43){_0x3054b2['push'](_0x3054b2['shift']());}};_0x3b97aa(++_0x458160);}(_0xa9e0,0x123));var _0x0a9e=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xa9e0[_0x21aec3];return _0x288bbc;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/hoppers',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/hopper_finals',auth['isAuthenticated'](),controller['getHopperFinals']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getTeams']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x8')]('/:id/blacklists',auth[_0x0a9e('0xd')](),controller['getBlackLists']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/users',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller['addLists']);router[_0x0a9e('0x18')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x22')]);router['delete']('/:id/teams',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router[_0x0a9e('0x21')](_0x0a9e('0x12'),auth['isAuthenticated'](),controller[_0x0a9e('0x24')]);router['delete'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x25')]);router[_0x0a9e('0x21')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x26')]);module[_0x0a9e('0x27')]=router; \ No newline at end of file +var _0xa9e0=['addAgents','/:id/blacklists','addBlackLists','update','delete','destroy','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','/:id','getHoppers','/:id/hopper_histories','isAuthenticated','getHopperHistories','/:id/hopper_black','getHopperBlacks','/:id/teams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','getLists','post','create','/:id/clone','clone','addTeams'];(function(_0x55e088,_0x334a90){var _0x3065d4=function(_0x27e222){while(--_0x27e222){_0x55e088['push'](_0x55e088['shift']());}};_0x3065d4(++_0x334a90);}(_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 fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/hoppers',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/hopper_finals',auth['isAuthenticated'](),controller['getHopperFinals']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getTeams']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x8')]('/:id/blacklists',auth[_0x0a9e('0xd')](),controller['getBlackLists']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/users',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller['addLists']);router[_0x0a9e('0x18')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x22')]);router['delete']('/:id/teams',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router[_0x0a9e('0x21')](_0x0a9e('0x12'),auth['isAuthenticated'](),controller[_0x0a9e('0x24')]);router['delete'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x25')]);router[_0x0a9e('0x21')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x26')]);module[_0x0a9e('0x27')]=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index 521352e..e8fed57 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 _0x3a06=['roundrobin','INTEGER','yes','all','once','TEXT','periodic_announce','join','split','joinempty','leavewhenempty','BOOLEAN','wrapuptime','progressive','power','Dial\x20Method.','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','UNSIGNED','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\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\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','Active/Disactive\x20Recall\x20In\x20Queue','DESC','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','name','ENUM','inbound','default','ringall','leastrecent','fewestcalls','random','rrmemory','wrandom','rrordered','setDataValue','strategy','getDataValue','type','dialMethod','outbound','preview','booked'];(function(_0x1fb598,_0x50289f){var _0x2ad0c9=function(_0x34f1e0){while(--_0x34f1e0){_0x1fb598['push'](_0x1fb598['shift']());}};_0x2ad0c9(++_0x50289f);}(_0x3a06,0x136));var _0x63a0=function(_0x334d5b,_0x33d99c){_0x334d5b=_0x334d5b-0x0;var _0x46a4a0=_0x3a06[_0x334d5b];return _0x46a4a0;};'use strict';var Sequelize=require(_0x63a0('0x0'));module[_0x63a0('0x1')]={'name':{'type':Sequelize[_0x63a0('0x2')],'allowNull':![],'unique':_0x63a0('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x63a0('0x4')](_0x63a0('0x5'),'outbound'),'allowNull':![],'defaultValue':_0x63a0('0x5')},'musiconhold':{'type':Sequelize['STRING'],'defaultValue':_0x63a0('0x6')},'announce':{'type':Sequelize['STRING'],'defaultValue':''},'strategy':{'type':Sequelize[_0x63a0('0x4')]('rr',_0x63a0('0x7'),_0x63a0('0x8'),_0x63a0('0x9'),_0x63a0('0xa'),_0x63a0('0xb'),'linear',_0x63a0('0xc'),_0x63a0('0xd')),'allowNull':![],'defaultValue':_0x63a0('0x7'),'set':function(_0xd073c3){this[_0x63a0('0xe')](_0x63a0('0xf'),_0xd073c3?_0xd073c3:'rrmemory');},'get':function(){var _0x26b7fb=this[_0x63a0('0x10')](_0x63a0('0x11'));var _0x1e8406=this[_0x63a0('0x10')](_0x63a0('0x12'));var _0x4916e8=this['getDataValue'](_0x63a0('0xf'));if(_0x26b7fb===_0x63a0('0x13')){if(_0x1e8406===_0x63a0('0x14')){return null;}if(_0x1e8406===_0x63a0('0x15')&&!['rrmemory',_0x63a0('0x16')]['includes'](_0x4916e8)){this[_0x63a0('0xe')](_0x63a0('0xf'),_0x63a0('0xb'));}}return _0x4916e8;}},'servicelevel':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x63a0('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x63a0('0x17')](0xb)},'timeout':{'type':Sequelize[_0x63a0('0x17')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x63a0('0x17')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x63a0('0x2')]},'weight':{'type':Sequelize[_0x63a0('0x17')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x63a0('0x17')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x63a0('0x4')](_0x63a0('0x18'),'no'),'defaultValue':'yes'},'autopause':{'type':Sequelize['ENUM']('yes','no',_0x63a0('0x19')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x63a0('0x17')](0xb)},'autopausebusy':{'type':Sequelize[_0x63a0('0x4')](_0x63a0('0x18'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x63a0('0x4')](_0x63a0('0x18'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x63a0('0x17')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x63a0('0x4')](_0x63a0('0x18'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x63a0('0x4')]('yes','no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x63a0('0x4')]('yes','no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x63a0('0x4')]('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x63a0('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x63a0('0x17')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x63a0('0x17')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x63a0('0x4')](_0x63a0('0x18'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x63a0('0x4')](_0x63a0('0x18'),'no'),'defaultValue':_0x63a0('0x18')},'announce_holdtime':{'type':Sequelize['ENUM']('yes','no',_0x63a0('0x1a')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x63a0('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM'](_0x63a0('0x18'),'no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize[_0x63a0('0x4')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x63a0('0x2')]},'queue_youarenext':{'type':Sequelize[_0x63a0('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x63a0('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x63a0('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize['STRING'],'defaultValue':null},'queue_minute':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x63a0('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thankyou':{'type':Sequelize['STRING'],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x63a0('0x2')]},'queue_quantity1':{'type':Sequelize[_0x63a0('0x2')]},'queue_quantity2':{'type':Sequelize[_0x63a0('0x2')]},'queue_periodic_announce':{'type':Sequelize['STRING']},'queue_less_than':{'type':Sequelize[_0x63a0('0x2')]},'periodic_announce':{'type':Sequelize[_0x63a0('0x1b')],'set':function(_0x287be4){this[_0x63a0('0xe')](_0x63a0('0x1c'),_0x287be4?_0x287be4[_0x63a0('0x1d')](','):[]);},'get':function(){return this[_0x63a0('0x10')]('periodic_announce')?this[_0x63a0('0x10')](_0x63a0('0x1c'))[_0x63a0('0x1e')](','):[];}},'joinempty':{'type':Sequelize[_0x63a0('0x2')],'defaultValue':_0x63a0('0x18'),'set':function(_0x26c953){this[_0x63a0('0xe')](_0x63a0('0x1f'),_0x26c953?_0x26c953[_0x63a0('0x1d')](','):undefined);},'get':function(){return this[_0x63a0('0x10')](_0x63a0('0x1f'))?this[_0x63a0('0x10')]('joinempty')[_0x63a0('0x1e')](','):undefined;}},'leavewhenempty':{'type':Sequelize['STRING'],'defaultValue':'no','set':function(_0x30d49a){this[_0x63a0('0xe')](_0x63a0('0x20'),_0x30d49a?_0x30d49a[_0x63a0('0x1d')](','):undefined);},'get':function(){return this[_0x63a0('0x10')](_0x63a0('0x20'))?this[_0x63a0('0x10')](_0x63a0('0x20'))['split'](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x63a0('0x4')](_0x63a0('0x18'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM'](_0x63a0('0x18'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x63a0('0x17')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x63a0('0x4')](_0x63a0('0x18'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x63a0('0x2')]},'description':{'type':Sequelize[_0x63a0('0x2')]},'acw':{'type':Sequelize[_0x63a0('0x21')],'defaultValue':0x0,'set':function(_0x5b30af){this[_0x63a0('0xe')]('acw',_0x5b30af);if(_0x5b30af){if(this[_0x63a0('0x10')](_0x63a0('0x22'))<0x2){this[_0x63a0('0xe')](_0x63a0('0x22'),0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize['ENUM'](_0x63a0('0x14'),_0x63a0('0x23'),_0x63a0('0x24'),'predictive',_0x63a0('0x15')),'defaultValue':_0x63a0('0x23'),'comment':_0x63a0('0x25')},'dialLimitChannel':{'type':Sequelize[_0x63a0('0x17')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x63a0('0x26')},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x63a0('0x27')},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)[_0x63a0('0x28')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x63a0('0x29')},'dialPredictiveOptimization':{'type':Sequelize[_0x63a0('0x4')](_0x63a0('0x2a'),'dropRate'),'defaultValue':'dropRate','comment':_0x63a0('0x2b')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x63a0('0x2c')](0x2)[_0x63a0('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x63a0('0x2d')},'dialPredictiveInterval':{'type':Sequelize[_0x63a0('0x17')](0x3)[_0x63a0('0x28')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x63a0('0x2e')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x63a0('0x17')](0x3)[_0x63a0('0x28')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x63a0('0x2f')},'dialQueueOptions':{'type':Sequelize[_0x63a0('0x2')],'defaultValue':_0x63a0('0x30'),'comment':_0x63a0('0x31')},'dialQueueTimeout':{'type':Sequelize[_0x63a0('0x17')](0x3)[_0x63a0('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x63a0('0x32')},'dialQueueProject':{'type':Sequelize['STRING'],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x63a0('0x17')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x63a0('0x17')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x63a0('0x33')},'dialBusyMaxRetry':{'type':Sequelize[_0x63a0('0x17')](0x3)[_0x63a0('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x63a0('0x34')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x63a0('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x63a0('0x17')](0x3)[_0x63a0('0x28')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x63a0('0x17')](0x5)[_0x63a0('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x63a0('0x17')](0x3)[_0x63a0('0x28')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x63a0('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x63a0('0x2')],'defaultValue':_0x63a0('0x35')},'dialPrefix':{'type':Sequelize[_0x63a0('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x63a0('0x4')](_0x63a0('0x36'),_0x63a0('0x37'),_0x63a0('0x38')),'defaultValue':_0x63a0('0x36')},'dialAMDActive':{'type':Sequelize[_0x63a0('0x21')],'defaultValue':0x0,'comment':_0x63a0('0x39')},'dialAMDInitialSilence':{'type':Sequelize[_0x63a0('0x17')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x63a0('0x17')](0x9)[_0x63a0('0x28')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x63a0('0x3a')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x63a0('0x17')](0x9)[_0x63a0('0x28')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x63a0('0x3b')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x63a0('0x17')](0x9)[_0x63a0('0x28')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x63a0('0x3c')},'dialAMDMinWordLength':{'type':Sequelize[_0x63a0('0x17')](0x9)[_0x63a0('0x28')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x63a0('0x17')](0x9)[_0x63a0('0x28')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x63a0('0x17')](0x9)[_0x63a0('0x28')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x63a0('0x3d')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x63a0('0x17')](0x5)[_0x63a0('0x28')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x63a0('0x3e')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x63a0('0x28')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x63a0('0x3f')},'dialRecallMeTimeout':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1},'defaultValue':0x1e,'comment':'#RecallMe\x20Timeout\x20(min:1)'},'dialRecallInQueue':{'type':Sequelize[_0x63a0('0x21')],'defaultValue':0x0,'comment':_0x63a0('0x40')},'dialOrderByScheduledAt':{'type':Sequelize[_0x63a0('0x4')](_0x63a0('0x41'),'ASC'),'defaultValue':_0x63a0('0x41')},'dialQueueProject2':{'type':Sequelize[_0x63a0('0x2')],'comment':_0x63a0('0x42')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x63a0('0x21')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x63a0('0x21')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x63a0('0x17')](0x3)[_0x63a0('0x28')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x63a0('0x43')},'dialCutDigit':{'type':Sequelize[_0x63a0('0x17')](0x3)[_0x63a0('0x28')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x63a0('0x44')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x63a0('0x17')](0x3)[_0x63a0('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x63a0('0x45')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x63a0('0x17')](0x5)[_0x63a0('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x63a0('0x46')},'dialDropMaxRetry':{'type':Sequelize[_0x63a0('0x17')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x63a0('0x47')},'dialDropRetryFrequency':{'type':Sequelize[_0x63a0('0x17')](0x5)[_0x63a0('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x63a0('0x48')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x63a0('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x63a0('0x49')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x63a0('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x63a0('0x4a')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x63a0('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x63a0('0x4b')},'dialMachineRetryFrequency':{'type':Sequelize[_0x63a0('0x17')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x63a0('0x4c')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x63a0('0x17')](0x3)[_0x63a0('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x63a0('0x4d')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x63a0('0x17')](0x5)[_0x63a0('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x63a0('0x4e')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x63a0('0x17')],'allowNull':!![],'comment':_0x63a0('0x4f')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x63a0('0x50'),'set':function(_0x2c6305){if(!_0x2c6305)this['setDataValue'](_0x63a0('0x51'),null);this['setDataValue'](_0x63a0('0x52'),_0x2c6305);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x63a0('0x17')](0x3)[_0x63a0('0x28')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x63a0('0x17')](0x3)[_0x63a0('0x28')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x63a0('0x21')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0x63a0('0x17')](0x3)[_0x63a0('0x28')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0x63a0('0x21')],'defaultValue':![]}}; \ No newline at end of file +var _0x48ce=['outbound','preview','includes','INTEGER','yes','TEXT','periodic_announce','split','joinempty','join','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','progressive','power','predictive','booked','Dial\x20Method.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','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','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','never','Active/Disactive\x20AMD','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','Active/Disactive\x20Recall\x20In\x20Queue','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','exports','STRING','ENUM','inbound','default','ringall','leastrecent','fewestcalls','random','rrmemory','linear','wrandom','setDataValue','getDataValue','type','dialMethod','strategy'];(function(_0x5b5b0a,_0x3c9aa6){var _0x53ddbc=function(_0x3eec5b){while(--_0x3eec5b){_0x5b5b0a['push'](_0x5b5b0a['shift']());}};_0x53ddbc(++_0x3c9aa6);}(_0x48ce,0xd3));var _0xe48c=function(_0x10699a,_0x3ba4b3){_0x10699a=_0x10699a-0x0;var _0x107477=_0x48ce[_0x10699a];return _0x107477;};'use strict';var Sequelize=require('sequelize');module[_0xe48c('0x0')]={'name':{'type':Sequelize[_0xe48c('0x1')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xe48c('0x2')](_0xe48c('0x3'),'outbound'),'allowNull':![],'defaultValue':_0xe48c('0x3')},'musiconhold':{'type':Sequelize[_0xe48c('0x1')],'defaultValue':_0xe48c('0x4')},'announce':{'type':Sequelize[_0xe48c('0x1')],'defaultValue':''},'strategy':{'type':Sequelize[_0xe48c('0x2')]('rr',_0xe48c('0x5'),_0xe48c('0x6'),_0xe48c('0x7'),_0xe48c('0x8'),_0xe48c('0x9'),_0xe48c('0xa'),_0xe48c('0xb'),'rrordered'),'allowNull':![],'defaultValue':'ringall','set':function(_0x3e6fa4){this[_0xe48c('0xc')]('strategy',_0x3e6fa4?_0x3e6fa4:_0xe48c('0x9'));},'get':function(){var _0x2566f0=this[_0xe48c('0xd')](_0xe48c('0xe'));var _0x5c9ac7=this[_0xe48c('0xd')](_0xe48c('0xf'));var _0x1a8f25=this['getDataValue'](_0xe48c('0x10'));if(_0x2566f0===_0xe48c('0x11')){if(_0x5c9ac7===_0xe48c('0x12')){return null;}if(_0x5c9ac7==='booked'&&!['rrmemory','roundrobin'][_0xe48c('0x13')](_0x1a8f25)){this[_0xe48c('0xc')](_0xe48c('0x10'),_0xe48c('0x9'));}}return _0x1a8f25;}},'servicelevel':{'type':Sequelize[_0xe48c('0x14')](0xb),'defaultValue':0x0},'context':{'type':Sequelize['STRING'],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0xe48c('0x14')](0xb)},'timeout':{'type':Sequelize[_0xe48c('0x14')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0xe48c('0x14')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize['STRING']},'weight':{'type':Sequelize[_0xe48c('0x14')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0xe48c('0x14')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0xe48c('0x15')},'autopause':{'type':Sequelize[_0xe48c('0x2')]('yes','no','all'),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0xe48c('0x14')](0xb)},'autopausebusy':{'type':Sequelize['ENUM'](_0xe48c('0x15'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0xe48c('0x2')]('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0xe48c('0x14')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0xe48c('0x2')](_0xe48c('0x15'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0xe48c('0x2')]('yes','no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0xe48c('0x2')](_0xe48c('0x15'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0xe48c('0x2')](_0xe48c('0x15'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0xe48c('0x1')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0xe48c('0x1')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0xe48c('0x14')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0xe48c('0x14')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0xe48c('0x2')](_0xe48c('0x15'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0xe48c('0x2')](_0xe48c('0x15'),'no'),'defaultValue':'yes'},'announce_holdtime':{'type':Sequelize[_0xe48c('0x2')](_0xe48c('0x15'),'no','once'),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0xe48c('0x1')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM'](_0xe48c('0x15'),'no')},'announce_position_limit':{'type':Sequelize[_0xe48c('0x14')](0xb)},'announce_round_seconds':{'type':Sequelize[_0xe48c('0x2')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0xe48c('0x1')],'defaultValue':''},'monitor_type':{'type':Sequelize['STRING']},'queue_youarenext':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0xe48c('0x1')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0xe48c('0x1')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0xe48c('0x1')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0xe48c('0x1')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0xe48c('0x1')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0xe48c('0x1')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0xe48c('0x1')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0xe48c('0x1')]},'queue_quantity1':{'type':Sequelize[_0xe48c('0x1')]},'queue_quantity2':{'type':Sequelize[_0xe48c('0x1')]},'queue_periodic_announce':{'type':Sequelize[_0xe48c('0x1')]},'queue_less_than':{'type':Sequelize[_0xe48c('0x1')]},'periodic_announce':{'type':Sequelize[_0xe48c('0x16')],'set':function(_0x4e633f){this[_0xe48c('0xc')]('periodic_announce',_0x4e633f?_0x4e633f['join'](','):[]);},'get':function(){return this[_0xe48c('0xd')](_0xe48c('0x17'))?this[_0xe48c('0xd')](_0xe48c('0x17'))[_0xe48c('0x18')](','):[];}},'joinempty':{'type':Sequelize[_0xe48c('0x1')],'defaultValue':_0xe48c('0x15'),'set':function(_0x3a1fa6){this[_0xe48c('0xc')](_0xe48c('0x19'),_0x3a1fa6?_0x3a1fa6[_0xe48c('0x1a')](','):undefined);},'get':function(){return this[_0xe48c('0xd')](_0xe48c('0x19'))?this[_0xe48c('0xd')](_0xe48c('0x19'))['split'](','):undefined;}},'leavewhenempty':{'type':Sequelize['STRING'],'defaultValue':'no','set':function(_0x5c025e){this[_0xe48c('0xc')](_0xe48c('0x1b'),_0x5c025e?_0x5c025e['join'](','):undefined);},'get':function(){return this[_0xe48c('0xd')](_0xe48c('0x1b'))?this[_0xe48c('0xd')]('leavewhenempty')[_0xe48c('0x18')](','):undefined;}},'reportholdtime':{'type':Sequelize['ENUM'](_0xe48c('0x15'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0xe48c('0x2')](_0xe48c('0x15'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize['ENUM'](_0xe48c('0x15'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0xe48c('0x1')]},'description':{'type':Sequelize[_0xe48c('0x1')]},'acw':{'type':Sequelize[_0xe48c('0x1c')],'defaultValue':0x0,'set':function(_0x4133cb){this[_0xe48c('0xc')](_0xe48c('0x1d'),_0x4133cb);if(_0x4133cb){if(this[_0xe48c('0xd')](_0xe48c('0x1e'))<0x2){this['setDataValue'](_0xe48c('0x1e'),0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xe48c('0x1f')},'dialMethod':{'type':Sequelize[_0xe48c('0x2')]('preview',_0xe48c('0x20'),_0xe48c('0x21'),_0xe48c('0x22'),_0xe48c('0x23')),'defaultValue':_0xe48c('0x20'),'comment':_0xe48c('0x24')},'dialLimitChannel':{'type':Sequelize[_0xe48c('0x14')](0x4)[_0xe48c('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize[_0xe48c('0x14')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xe48c('0x26')},'dialPowerLevel':{'type':Sequelize[_0xe48c('0x27')](0x2)[_0xe48c('0x25')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0xe48c('0x28')},'dialPredictiveOptimization':{'type':Sequelize[_0xe48c('0x2')](_0xe48c('0x29'),'dropRate'),'defaultValue':_0xe48c('0x2a'),'comment':_0xe48c('0x2b')},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)[_0xe48c('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0xe48c('0x2c')},'dialPredictiveInterval':{'type':Sequelize['INTEGER'](0x3)[_0xe48c('0x25')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0xe48c('0x2d')},'dialOriginateCallerIdName':{'type':Sequelize[_0xe48c('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xe48c('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0xe48c('0x14')](0x3)[_0xe48c('0x25')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe48c('0x2e')},'dialQueueOptions':{'type':Sequelize[_0xe48c('0x1')],'defaultValue':_0xe48c('0x2f'),'comment':_0xe48c('0x30')},'dialQueueTimeout':{'type':Sequelize[_0xe48c('0x14')](0x3)[_0xe48c('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe48c('0x31')},'dialQueueProject':{'type':Sequelize['STRING'],'comment':_0xe48c('0x32')},'dialCongestionMaxRetry':{'type':Sequelize[_0xe48c('0x14')](0x3)[_0xe48c('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe48c('0x33')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xe48c('0x14')](0x5)[_0xe48c('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0xe48c('0x14')](0x3)[_0xe48c('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xe48c('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe48c('0x34')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xe48c('0x25')],'defaultValue':0x3,'comment':_0xe48c('0x35')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xe48c('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xe48c('0x25')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xe48c('0x36')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xe48c('0x1')],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize[_0xe48c('0x1')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0xe48c('0x2')]('always',_0xe48c('0x37'),'onlyIfOpen'),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0xe48c('0x1c')],'defaultValue':0x0,'comment':_0xe48c('0x38')},'dialAMDInitialSilence':{'type':Sequelize[_0xe48c('0x14')](0x9)[_0xe48c('0x25')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0xe48c('0x25')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xe48c('0x14')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xe48c('0x39')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xe48c('0x14')](0x9)[_0xe48c('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0xe48c('0x14')](0x9)[_0xe48c('0x25')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xe48c('0x3a')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xe48c('0x14')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xe48c('0x3b')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xe48c('0x14')](0x9)[_0xe48c('0x25')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xe48c('0x14')](0x5)[_0xe48c('0x25')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xe48c('0x3c')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xe48c('0x14')](0x9)[_0xe48c('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xe48c('0x3d')},'dialRecallMeTimeout':{'type':Sequelize[_0xe48c('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1},'defaultValue':0x1e,'comment':'#RecallMe\x20Timeout\x20(min:1)'},'dialRecallInQueue':{'type':Sequelize[_0xe48c('0x1c')],'defaultValue':0x0,'comment':_0xe48c('0x3e')},'dialOrderByScheduledAt':{'type':Sequelize[_0xe48c('0x2')](_0xe48c('0x3f'),'ASC'),'defaultValue':_0xe48c('0x3f')},'dialQueueProject2':{'type':Sequelize[_0xe48c('0x1')],'comment':_0xe48c('0x32')},'dialAgiAfterHangupClient':{'type':Sequelize[_0xe48c('0x1c')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0xe48c('0x1c')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xe48c('0x14')](0x3)[_0xe48c('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xe48c('0x40')},'dialCutDigit':{'type':Sequelize[_0xe48c('0x14')](0x3)[_0xe48c('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xe48c('0x41')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xe48c('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe48c('0x42')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xe48c('0x14')](0x5)[_0xe48c('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe48c('0x43')},'dialDropMaxRetry':{'type':Sequelize[_0xe48c('0x14')](0x3)[_0xe48c('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe48c('0x44')},'dialDropRetryFrequency':{'type':Sequelize[_0xe48c('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0xe48c('0x14')](0x3)[_0xe48c('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xe48c('0x14')](0x5)[_0xe48c('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe48c('0x45')},'dialMachineMaxRetry':{'type':Sequelize[_0xe48c('0x14')](0x3)[_0xe48c('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe48c('0x46')},'dialMachineRetryFrequency':{'type':Sequelize[_0xe48c('0x14')](0x5)[_0xe48c('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe48c('0x47')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe48c('0x48')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xe48c('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe48c('0x49')},'mandatoryDispositionPauseId':{'type':Sequelize[_0xe48c('0x14')],'allowNull':!![],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xe48c('0x1c')],'defaultValue':![],'comment':_0xe48c('0x4a'),'set':function(_0x1f12ce){if(!_0x1f12ce)this[_0xe48c('0xc')](_0xe48c('0x4b'),null);this[_0xe48c('0xc')]('mandatoryDisposition',_0x1f12ce);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0xe48c('0x14')](0x3)[_0xe48c('0x25')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0xe48c('0x14')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0xe48c('0x14')](0x3)[_0xe48c('0x25')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0xe48c('0x1c')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index 928a9d4..33f9f28 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 _0x9957=['includes','find','type','name','UserProfileResource','destroy','stack','send','fieldName','key','getOptions','include','query','findAll','catch','show','params','model','rawAttributes','filters','attributes','intersection','fields','includeAll','merge','VoiceQueue','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','inbound','UserProfileSection','userProfileId','autoAssociation','error','clone','length','options','omit','updatedAt','user','role','outbound','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','findOne','keys','order','sort','where','pick','CmHopper','rows','getHopperHistories','CmHopperHistory','hasOwnProperty','VoiceQueueId','getHopperFinals','CmHopperFinal','nolimit','getHopperBlacks','CmHopperBlack','getTeams','addTeams','Team','Agents','voicePause','interface','penalty','transaction','each','upsert','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','isNil','format','forEach','emit','userVoiceQueue:save','ids','User','field','tq.TeamId','team_has_voice_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','toString','sequelize','QueryTypes','every','all','union','compact','removeTeams','isEmpty','userVoiceQueue:remove','addAgents','online','SIP/%s','removeAgents','isArray','getAgents','getMembers','getLists','addLists','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','createdAt','select','ContactId','CmListId','ListId','from','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','VoiceQueueId\x20=\x20?','onlyIfOpen','cm_contacts','deletedAt\x20IS\x20NULL','COALESCE(phone,\x27\x27)','OrderBy','h.id','ci.item','ci.OrderBy+1','cm_contact_has_items','join','h.scheduledat=?','ci.ItemClass=?','PHONE','removeLists','getBlackLists','CmList','addBlackLists','cm_hopper_black','removeBlackLists','moment','bluebird','util','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','update','then','VoiceQueues','QueueCampaigns','filter','ignore','map','value'];(function(_0x39ec63,_0x47b0ed){var _0x47afdb=function(_0x18019a){while(--_0x18019a){_0x39ec63['push'](_0x39ec63['shift']());}};_0x47afdb(++_0x47b0ed);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var moment=require(_0x7995('0x0'));var BPromise=require(_0x7995('0x1'));var util=require(_0x7995('0x2'));var _=require(_0x7995('0x3'));var squel=require('squel');var Redis=require(_0x7995('0x4'));var qs=require(_0x7995('0x5'));var logger=require(_0x7995('0x6'))(_0x7995('0x7'));var config=require('../../config/environment');var db=require(_0x7995('0x8'))['db'];config[_0x7995('0x9')]=_[_0x7995('0xa')](config[_0x7995('0x9')],{'host':_0x7995('0xb'),'port':0x18eb});var socket=require(_0x7995('0xc'))(new Redis(config['redis']));require(_0x7995('0xd'))[_0x7995('0xe')](socket);function respondWithStatusCode(_0x4a64f7,_0xa2e5f0){_0xa2e5f0=_0xa2e5f0||0xcc;return function(_0x3116fb){if(_0x3116fb){return _0x4a64f7[_0x7995('0xf')](_0xa2e5f0);}return _0x4a64f7[_0x7995('0x10')](_0xa2e5f0)[_0x7995('0x11')]();};}function respondWithResult(_0x1e400a,_0x341672){_0x341672=_0x341672||0xc8;return function(_0x524f7b){if(_0x524f7b){return _0x1e400a[_0x7995('0x10')](_0x341672)[_0x7995('0x12')](_0x524f7b);}};}function respondWithFilteredResult(_0x581f22,_0xb0c872){return function(_0x2cb37a){if(_0x2cb37a){var _0x19a27e=typeof _0xb0c872[_0x7995('0x13')]===_0x7995('0x14')&&typeof _0xb0c872[_0x7995('0x15')]===_0x7995('0x14');var _0x4cc004=_0x2cb37a['count'];var _0x2b4e94=_0x19a27e?0x0:_0xb0c872[_0x7995('0x13')];var _0x24b5bb=_0x19a27e?_0x2cb37a[_0x7995('0x16')]:_0xb0c872[_0x7995('0x13')]+_0xb0c872[_0x7995('0x15')];var _0x2202ce;if(_0x24b5bb>=_0x4cc004){_0x24b5bb=_0x4cc004;_0x2202ce=0xc8;}else{_0x2202ce=0xce;}_0x581f22[_0x7995('0x10')](_0x2202ce);return _0x581f22['set'](_0x7995('0x17'),_0x2b4e94+'-'+_0x24b5bb+'/'+_0x4cc004)['json'](_0x2cb37a);}return null;};}function saveUpdates(_0x2f832e){return function(_0x37f297){if(_0x37f297){return _0x37f297[_0x7995('0x18')](_0x2f832e)[_0x7995('0x19')](function(_0x1e1415){return _0x1e1415;});}return null;};}function removeEntity(_0x37a7d4){return function(_0x4faa60){if(_0x4faa60){return _0x4faa60['destroy']()[_0x7995('0x19')](function(){var _0x5e6f90=_0x4faa60['get']({'plain':!![]});var _0x3ec178=[{'name':_0x7995('0x1a'),'value':'inbound','ignore':![]},{'name':_0x7995('0x1b'),'value':'outbound','ignore':![]}];var _0x4b1a8e=_(_0x3ec178)[_0x7995('0x1c')](_0x7995('0x1d'))[_0x7995('0x1e')](_0x7995('0x1f'))[_0x7995('0x1f')]();if(_[_0x7995('0x20')](_0x4b1a8e,_0x5e6f90['type'])){return;}var _0x32a09a=_[_0x7995('0x21')](_0x3ec178,[_0x7995('0x1f'),_0x5e6f90[_0x7995('0x22')]])[_0x7995('0x23')];return db[_0x7995('0x24')][_0x7995('0x25')]({'where':{'type':_0x32a09a,'resourceId':_0x5e6f90['id']}})[_0x7995('0x19')](function(){return _0x4faa60;});})['then'](function(){_0x37a7d4[_0x7995('0x10')](0xcc)[_0x7995('0x11')]();});}};}function handleEntityNotFound(_0x401dc3){return function(_0x268ce7){if(!_0x268ce7){_0x401dc3[_0x7995('0xf')](0x194);}return _0x268ce7;};}function handleError(_0x2a307e,_0x56691a){_0x56691a=_0x56691a||0x1f4;return function(_0x47625f){logger['error'](_0x47625f[_0x7995('0x26')]);if(_0x47625f[_0x7995('0x23')]){delete _0x47625f[_0x7995('0x23')];}_0x2a307e[_0x7995('0x10')](_0x56691a)[_0x7995('0x27')](_0x47625f);};}exports['index']=function(_0x9b2a15,_0x514445){var _0x456a28={};var _0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['VoiceQueue']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x28')],'type':_0x3573be[_0x7995('0x22')][_0x7995('0x29')]};});_0x456a28=qs[_0x7995('0x2a')](_0x4253e5,_0x9b2a15);var _0x1ca460={'where':_0x456a28['where']};return db['VoiceQueue'][_0x7995('0x16')](_0x1ca460)['then'](function(_0x553671){_0x3250e0[_0x7995('0x16')]=_0x553671;_0x456a28[_0x7995('0x2b')]=qs[_0x7995('0x2b')](_0x9b2a15[_0x7995('0x2c')]);return db['VoiceQueue'][_0x7995('0x2d')](_0x456a28);})[_0x7995('0x19')](function(_0x5dd802){_0x3250e0['rows']=_0x5dd802;return _0x3250e0;})['then'](respondWithFilteredResult(_0x514445,_0x456a28))[_0x7995('0x2e')](handleError(_0x514445,null));};exports[_0x7995('0x2f')]=function(_0x4a176f,_0x3e7020){var _0x51b95d={'raw':![],'where':{'id':_0x4a176f[_0x7995('0x30')]['id']}},_0x37917b={};_0x37917b[_0x7995('0x31')]=_['keys'](db['VoiceQueue'][_0x7995('0x32')]);_0x37917b['query']=_['keys'](_0x4a176f[_0x7995('0x2c')]);_0x37917b[_0x7995('0x33')]=_['intersection'](_0x37917b[_0x7995('0x31')],_0x37917b[_0x7995('0x2c')]);_0x51b95d[_0x7995('0x34')]=_[_0x7995('0x35')](_0x37917b[_0x7995('0x31')],qs['fields'](_0x4a176f[_0x7995('0x2c')][_0x7995('0x36')]));_0x51b95d[_0x7995('0x34')]=_0x51b95d[_0x7995('0x34')]['length']?_0x51b95d[_0x7995('0x34')]:_0x37917b[_0x7995('0x31')];if(_0x4a176f[_0x7995('0x2c')][_0x7995('0x37')]){_0x51b95d[_0x7995('0x2b')]=[{'all':!![]}];}_0x51b95d=_[_0x7995('0x38')]({},_0x51b95d,_0x4a176f['options']);return db[_0x7995('0x39')][_0x7995('0x21')](_0x51b95d)[_0x7995('0x19')](handleEntityNotFound(_0x3e7020,null))[_0x7995('0x19')](respondWithResult(_0x3e7020,null))[_0x7995('0x2e')](handleError(_0x3e7020,null));};exports[_0x7995('0x3a')]=function(_0x14d638,_0x270c0e){return db[_0x7995('0x39')][_0x7995('0x3a')](_0x14d638[_0x7995('0x3b')],{})[_0x7995('0x19')](function(_0x7b4e67){var _0x53cda2=_0x14d638['user'][_0x7995('0x3c')]({'plain':!![]});if(!_0x53cda2)throw new Error(_0x7995('0x3d'));if(_0x53cda2['role']==='user'){var _0x3f8522=_0x7b4e67['get']({'plain':!![]});var _0x504a33=[{'name':_0x7995('0x1a'),'value':_0x7995('0x3e')},{'name':_0x7995('0x1b'),'value':'outbound'}];var _0x46ac4f=_['find'](_0x504a33,[_0x7995('0x1f'),_0x3f8522['type']])['name'];return db[_0x7995('0x3f')][_0x7995('0x21')]({'where':{'name':_0x46ac4f,'userProfileId':_0x53cda2[_0x7995('0x40')]},'raw':!![]})[_0x7995('0x19')](function(_0x599ecb){if(_0x599ecb&&_0x599ecb[_0x7995('0x41')]===0x0){return db[_0x7995('0x24')][_0x7995('0x3a')]({'name':_0x3f8522[_0x7995('0x23')],'resourceId':_0x3f8522['id'],'type':_0x599ecb['name'],'sectionId':_0x599ecb['id']},{})['then'](function(){return _0x7b4e67;});}else{return _0x7b4e67;}})[_0x7995('0x2e')](function(_0x55791b){logger[_0x7995('0x42')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x55791b);throw _0x55791b;});}return _0x7b4e67;})[_0x7995('0x19')](respondWithResult(_0x270c0e,0xc9))['catch'](handleError(_0x270c0e,null));};exports[_0x7995('0x43')]=function(_0x1b0373,_0x4d9245){var _0x3e9e62={'where':{'id':_0x1b0373[_0x7995('0x30')]['id']}},_0x336ff2={};_0x336ff2[_0x7995('0x31')]=_['keys'](db[_0x7995('0x39')][_0x7995('0x32')]);_0x3e9e62[_0x7995('0x34')]=_['intersection'](_0x336ff2[_0x7995('0x31')],qs[_0x7995('0x36')](_0x1b0373[_0x7995('0x2c')][_0x7995('0x36')]));_0x3e9e62[_0x7995('0x34')]=_0x3e9e62['attributes'][_0x7995('0x44')]?_0x3e9e62[_0x7995('0x34')]:_0x336ff2['model'];if(_0x1b0373[_0x7995('0x2c')]['includeAll']){_0x3e9e62[_0x7995('0x2b')]=[{'all':!![]}];}_0x3e9e62=_[_0x7995('0x38')]({},_0x3e9e62,_0x1b0373[_0x7995('0x45')]);return db[_0x7995('0x39')][_0x7995('0x21')](_0x3e9e62)[_0x7995('0x19')](handleEntityNotFound(_0x4d9245,null))[_0x7995('0x19')](function(_0x4d46bc){if(_0x4d46bc){var _0x427dcf=_0x4d46bc[_0x7995('0x3c')]({'plain':!![]});_0x427dcf=qs[_0x7995('0x46')](_0x427dcf,['id','createdAt',_0x7995('0x47')]);_0x1b0373[_0x7995('0x3b')]=_[_0x7995('0x46')](_0x1b0373['body'],['id','createdAt','updatedAt']);return db[_0x7995('0x39')][_0x7995('0x3a')](_['merge'](_0x427dcf,_0x1b0373[_0x7995('0x3b')]),{'include':_0x1b0373[_0x7995('0x2c')][_0x7995('0x37')]?[{'all':!![]}]:undefined})[_0x7995('0x19')](function(_0xc04004){var _0x528c8e=_0x1b0373[_0x7995('0x48')]['get']({'plain':!![]});if(!_0x528c8e)throw new Error(_0x7995('0x3d'));if(_0x528c8e[_0x7995('0x49')]===_0x7995('0x48')){var _0x50c7b5=_0xc04004['get']({'plain':!![]});var _0x54e2b1=[{'name':'VoiceQueues','value':_0x7995('0x3e')},{'name':_0x7995('0x1b'),'value':_0x7995('0x4a')}];var _0x150261=_[_0x7995('0x21')](_0x54e2b1,[_0x7995('0x1f'),_0x50c7b5[_0x7995('0x22')]])[_0x7995('0x23')];return db[_0x7995('0x3f')][_0x7995('0x21')]({'where':{'name':_0x150261,'userProfileId':_0x528c8e[_0x7995('0x40')]},'raw':!![]})[_0x7995('0x19')](function(_0x3da72b){if(_0x3da72b&&_0x3da72b[_0x7995('0x41')]===0x0){return db[_0x7995('0x24')][_0x7995('0x3a')]({'name':_0x50c7b5[_0x7995('0x23')],'resourceId':_0x50c7b5['id'],'type':_0x3da72b[_0x7995('0x23')],'sectionId':_0x3da72b['id']},{})[_0x7995('0x19')](function(){return _0xc04004;});}else{return _0xc04004;}})['catch'](function(_0x56a374){logger[_0x7995('0x42')](_0x7995('0x4b'),_0x56a374);throw _0x56a374;});}return _0xc04004;});}})[_0x7995('0x19')](respondWithResult(_0x4d9245,0xc9))['catch'](handleError(_0x4d9245,null));};exports['update']=function(_0x402fa0,_0x197b52){if(_0x402fa0[_0x7995('0x3b')]['id']){delete _0x402fa0[_0x7995('0x3b')]['id'];}return db['VoiceQueue'][_0x7995('0x21')]({'where':{'id':_0x402fa0[_0x7995('0x30')]['id']}})[_0x7995('0x19')](handleEntityNotFound(_0x197b52,null))[_0x7995('0x19')](saveUpdates(_0x402fa0['body'],null))['then'](respondWithResult(_0x197b52,null))[_0x7995('0x2e')](handleError(_0x197b52,null));};exports[_0x7995('0x25')]=function(_0x6c0221,_0x1d69ce){return db[_0x7995('0x39')][_0x7995('0x21')]({'where':{'id':_0x6c0221[_0x7995('0x30')]['id']}})[_0x7995('0x19')](handleEntityNotFound(_0x1d69ce,null))[_0x7995('0x19')](removeEntity(_0x1d69ce,null))['catch'](handleError(_0x1d69ce,null));};exports[_0x7995('0x4c')]=function(_0x3ec5a8,_0xdf9e38){var _0x1ecfdb={'raw':![],'where':{}};var _0x59c5aa={};var _0x51bf6a={'count':0x0,'rows':[]};return db[_0x7995('0x39')][_0x7995('0x4d')]({'where':{'id':_0x3ec5a8['params']['id']}})[_0x7995('0x19')](handleEntityNotFound(_0xdf9e38,null))[_0x7995('0x19')](function(_0x2e3421){if(_0x2e3421){_0x59c5aa[_0x7995('0x31')]=_[_0x7995('0x4e')](db['CmHopper'][_0x7995('0x32')]);_0x59c5aa['query']=_[_0x7995('0x4e')](_0x3ec5a8[_0x7995('0x2c')]);_0x59c5aa[_0x7995('0x33')]=_[_0x7995('0x35')](_0x59c5aa[_0x7995('0x31')],_0x59c5aa[_0x7995('0x2c')]);_0x1ecfdb[_0x7995('0x34')]=_[_0x7995('0x35')](_0x59c5aa[_0x7995('0x31')],qs[_0x7995('0x36')](_0x3ec5a8[_0x7995('0x2c')][_0x7995('0x36')]));_0x1ecfdb['attributes']=_0x1ecfdb[_0x7995('0x34')][_0x7995('0x44')]?_0x1ecfdb[_0x7995('0x34')]:_0x59c5aa[_0x7995('0x31')];if(!_0x3ec5a8[_0x7995('0x2c')]['hasOwnProperty']('nolimit')){_0x1ecfdb[_0x7995('0x15')]=qs[_0x7995('0x15')](_0x3ec5a8[_0x7995('0x2c')][_0x7995('0x15')]);_0x1ecfdb['offset']=qs[_0x7995('0x13')](_0x3ec5a8['query']['offset']);}_0x1ecfdb[_0x7995('0x4f')]=qs[_0x7995('0x50')](_0x3ec5a8[_0x7995('0x2c')][_0x7995('0x50')]);_0x1ecfdb[_0x7995('0x51')]=qs[_0x7995('0x33')](_[_0x7995('0x52')](_0x3ec5a8[_0x7995('0x2c')],_0x59c5aa[_0x7995('0x33')]));_0x1ecfdb[_0x7995('0x51')]['VoiceQueueId']=_0x2e3421['id'];if(_0x3ec5a8[_0x7995('0x2c')][_0x7995('0x1c')]){_0x1ecfdb[_0x7995('0x51')]=_['merge'](_0x1ecfdb[_0x7995('0x51')],{'$or':_[_0x7995('0x1e')](_0x1ecfdb[_0x7995('0x34')],function(_0x3a7d9d){var _0x3b0d30={};_0x3b0d30[_0x3a7d9d]={'$like':'%'+_0x3ec5a8[_0x7995('0x2c')][_0x7995('0x1c')]+'%'};return _0x3b0d30;})});}_0x1ecfdb=_[_0x7995('0x38')]({},_0x1ecfdb,_0x3ec5a8[_0x7995('0x45')]);return db[_0x7995('0x53')][_0x7995('0x16')]({'where':_0x1ecfdb['where']})['then'](function(_0xd07c1c){_0x51bf6a[_0x7995('0x16')]=_0xd07c1c;if(_0x3ec5a8[_0x7995('0x2c')][_0x7995('0x37')]){_0x1ecfdb['include']=[{'all':!![]}];}return db[_0x7995('0x53')][_0x7995('0x2d')](_0x1ecfdb);})['then'](function(_0x480fdb){_0x51bf6a[_0x7995('0x54')]=_0x480fdb;return _0x51bf6a;});}})[_0x7995('0x19')](respondWithFilteredResult(_0xdf9e38,_0x1ecfdb))['catch'](handleError(_0xdf9e38,null));};exports[_0x7995('0x55')]=function(_0x5b1cba,_0x3758f9){var _0xea9aba={'raw':!![],'where':{}};var _0x4ff9ff={};var _0x5d9d33={'count':0x0,'rows':[]};return db[_0x7995('0x39')]['findOne']({'where':{'id':_0x5b1cba[_0x7995('0x30')]['id']}})[_0x7995('0x19')](handleEntityNotFound(_0x3758f9,null))[_0x7995('0x19')](function(_0x45bd8a){if(_0x45bd8a){_0x4ff9ff[_0x7995('0x31')]=_[_0x7995('0x4e')](db[_0x7995('0x56')][_0x7995('0x32')]);_0x4ff9ff[_0x7995('0x2c')]=_[_0x7995('0x4e')](_0x5b1cba[_0x7995('0x2c')]);_0x4ff9ff[_0x7995('0x33')]=_[_0x7995('0x35')](_0x4ff9ff[_0x7995('0x31')],_0x4ff9ff[_0x7995('0x2c')]);_0xea9aba[_0x7995('0x34')]=_[_0x7995('0x35')](_0x4ff9ff[_0x7995('0x31')],qs[_0x7995('0x36')](_0x5b1cba[_0x7995('0x2c')][_0x7995('0x36')]));_0xea9aba[_0x7995('0x34')]=_0xea9aba[_0x7995('0x34')][_0x7995('0x44')]?_0xea9aba[_0x7995('0x34')]:_0x4ff9ff[_0x7995('0x31')];if(!_0x5b1cba[_0x7995('0x2c')][_0x7995('0x57')]('nolimit')){_0xea9aba[_0x7995('0x15')]=qs[_0x7995('0x15')](_0x5b1cba['query']['limit']);_0xea9aba[_0x7995('0x13')]=qs[_0x7995('0x13')](_0x5b1cba[_0x7995('0x2c')][_0x7995('0x13')]);}_0xea9aba[_0x7995('0x4f')]=qs[_0x7995('0x50')](_0x5b1cba['query'][_0x7995('0x50')]);_0xea9aba[_0x7995('0x51')]=qs[_0x7995('0x33')](_[_0x7995('0x52')](_0x5b1cba[_0x7995('0x2c')],_0x4ff9ff[_0x7995('0x33')]));_0xea9aba[_0x7995('0x51')][_0x7995('0x58')]=_0x45bd8a['id'];if(_0x5b1cba['query'][_0x7995('0x1c')]){_0xea9aba[_0x7995('0x51')]=_['merge'](_0xea9aba['where'],{'$or':_[_0x7995('0x1e')](_0xea9aba[_0x7995('0x34')],function(_0x18e1a2){var _0x3db7a9={};_0x3db7a9[_0x18e1a2]={'$like':'%'+_0x5b1cba[_0x7995('0x2c')]['filter']+'%'};return _0x3db7a9;})});}_0xea9aba=_[_0x7995('0x38')]({},_0xea9aba,_0x5b1cba[_0x7995('0x45')]);return db['CmHopperHistory'][_0x7995('0x16')]({'where':_0xea9aba[_0x7995('0x51')]})['then'](function(_0x1535a3){_0x5d9d33['count']=_0x1535a3;if(_0x5b1cba[_0x7995('0x2c')][_0x7995('0x37')]){_0xea9aba[_0x7995('0x2b')]=[{'all':!![]}];}return db[_0x7995('0x56')][_0x7995('0x2d')](_0xea9aba);})['then'](function(_0x1f0506){_0x5d9d33[_0x7995('0x54')]=_0x1f0506;return _0x5d9d33;});}})[_0x7995('0x19')](respondWithFilteredResult(_0x3758f9,_0xea9aba))['catch'](handleError(_0x3758f9,null));};exports[_0x7995('0x59')]=function(_0x3f3434,_0x350ed3){var _0x308a26={'raw':!![],'where':{}};var _0x5d7018={};var _0x3356fd={'count':0x0,'rows':[]};return db[_0x7995('0x39')][_0x7995('0x4d')]({'where':{'id':_0x3f3434['params']['id']}})['then'](handleEntityNotFound(_0x350ed3,null))[_0x7995('0x19')](function(_0x333379){if(_0x333379){_0x5d7018['model']=_['keys'](db[_0x7995('0x5a')][_0x7995('0x32')]);_0x5d7018[_0x7995('0x2c')]=_[_0x7995('0x4e')](_0x3f3434[_0x7995('0x2c')]);_0x5d7018['filters']=_['intersection'](_0x5d7018[_0x7995('0x31')],_0x5d7018['query']);_0x308a26['attributes']=_[_0x7995('0x35')](_0x5d7018[_0x7995('0x31')],qs[_0x7995('0x36')](_0x3f3434['query'][_0x7995('0x36')]));_0x308a26[_0x7995('0x34')]=_0x308a26[_0x7995('0x34')][_0x7995('0x44')]?_0x308a26[_0x7995('0x34')]:_0x5d7018['model'];if(!_0x3f3434[_0x7995('0x2c')][_0x7995('0x57')](_0x7995('0x5b'))){_0x308a26[_0x7995('0x15')]=qs['limit'](_0x3f3434[_0x7995('0x2c')][_0x7995('0x15')]);_0x308a26['offset']=qs[_0x7995('0x13')](_0x3f3434[_0x7995('0x2c')]['offset']);}_0x308a26[_0x7995('0x4f')]=qs['sort'](_0x3f3434[_0x7995('0x2c')]['sort']);_0x308a26[_0x7995('0x51')]=qs['filters'](_[_0x7995('0x52')](_0x3f3434[_0x7995('0x2c')],_0x5d7018['filters']));_0x308a26[_0x7995('0x51')]['VoiceQueueId']=_0x333379['id'];if(_0x3f3434['query'][_0x7995('0x1c')]){_0x308a26[_0x7995('0x51')]=_[_0x7995('0x38')](_0x308a26[_0x7995('0x51')],{'$or':_['map'](_0x308a26[_0x7995('0x34')],function(_0x35044a){var _0x4bd29f={};_0x4bd29f[_0x35044a]={'$like':'%'+_0x3f3434['query'][_0x7995('0x1c')]+'%'};return _0x4bd29f;})});}_0x308a26=_['merge']({},_0x308a26,_0x3f3434[_0x7995('0x45')]);return db[_0x7995('0x5a')][_0x7995('0x16')]({'where':_0x308a26['where']})['then'](function(_0x2b7852){_0x3356fd['count']=_0x2b7852;if(_0x3f3434[_0x7995('0x2c')][_0x7995('0x37')]){_0x308a26[_0x7995('0x2b')]=[{'all':!![]}];}return db[_0x7995('0x5a')]['findAll'](_0x308a26);})['then'](function(_0x50f880){_0x3356fd[_0x7995('0x54')]=_0x50f880;return _0x3356fd;});}})[_0x7995('0x19')](respondWithFilteredResult(_0x350ed3,_0x308a26))[_0x7995('0x2e')](handleError(_0x350ed3,null));};exports[_0x7995('0x5c')]=function(_0x265f07,_0x168e7f){var _0x59a793={'raw':!![],'where':{}};var _0x53cbec={};var _0x1a2902={'count':0x0,'rows':[]};return db['VoiceQueue']['findOne']({'where':{'id':_0x265f07[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x168e7f,null))['then'](function(_0x35c3f3){if(_0x35c3f3){_0x53cbec[_0x7995('0x31')]=_[_0x7995('0x4e')](db['CmHopperBlack'][_0x7995('0x32')]);_0x53cbec[_0x7995('0x2c')]=_[_0x7995('0x4e')](_0x265f07[_0x7995('0x2c')]);_0x53cbec[_0x7995('0x33')]=_[_0x7995('0x35')](_0x53cbec[_0x7995('0x31')],_0x53cbec[_0x7995('0x2c')]);_0x59a793[_0x7995('0x34')]=_['intersection'](_0x53cbec[_0x7995('0x31')],qs[_0x7995('0x36')](_0x265f07[_0x7995('0x2c')][_0x7995('0x36')]));_0x59a793[_0x7995('0x34')]=_0x59a793['attributes'][_0x7995('0x44')]?_0x59a793[_0x7995('0x34')]:_0x53cbec[_0x7995('0x31')];if(!_0x265f07['query']['hasOwnProperty']('nolimit')){_0x59a793[_0x7995('0x15')]=qs[_0x7995('0x15')](_0x265f07[_0x7995('0x2c')][_0x7995('0x15')]);_0x59a793[_0x7995('0x13')]=qs[_0x7995('0x13')](_0x265f07['query'][_0x7995('0x13')]);}_0x59a793['order']=qs[_0x7995('0x50')](_0x265f07[_0x7995('0x2c')][_0x7995('0x50')]);_0x59a793[_0x7995('0x51')]=qs[_0x7995('0x33')](_[_0x7995('0x52')](_0x265f07[_0x7995('0x2c')],_0x53cbec[_0x7995('0x33')]));_0x59a793[_0x7995('0x51')][_0x7995('0x58')]=_0x35c3f3['id'];if(_0x265f07[_0x7995('0x2c')]['filter']){_0x59a793[_0x7995('0x51')]=_['merge'](_0x59a793[_0x7995('0x51')],{'$or':_[_0x7995('0x1e')](_0x59a793['attributes'],function(_0x493e74){var _0x2a25eb={};_0x2a25eb[_0x493e74]={'$like':'%'+_0x265f07[_0x7995('0x2c')][_0x7995('0x1c')]+'%'};return _0x2a25eb;})});}_0x59a793=_[_0x7995('0x38')]({},_0x59a793,_0x265f07[_0x7995('0x45')]);return db[_0x7995('0x5d')][_0x7995('0x16')]({'where':_0x59a793[_0x7995('0x51')]})[_0x7995('0x19')](function(_0x3c9b3c){_0x1a2902[_0x7995('0x16')]=_0x3c9b3c;if(_0x265f07[_0x7995('0x2c')]['includeAll']){_0x59a793['include']=[{'all':!![]}];}return db[_0x7995('0x5d')][_0x7995('0x2d')](_0x59a793);})[_0x7995('0x19')](function(_0x1531a9){_0x1a2902[_0x7995('0x54')]=_0x1531a9;return _0x1a2902;});}})['then'](respondWithFilteredResult(_0x168e7f,_0x59a793))[_0x7995('0x2e')](handleError(_0x168e7f,null));};exports[_0x7995('0x5e')]=function(_0x5ebf5e,_0x46fc1c){var _0x53d693={};var _0x37416c={};var _0x30cda5;var _0x234a40;return db['VoiceQueue'][_0x7995('0x4d')]({'where':{'id':_0x5ebf5e[_0x7995('0x30')]['id']}})[_0x7995('0x19')](handleEntityNotFound(_0x46fc1c,null))[_0x7995('0x19')](function(_0x11f9fb){if(_0x11f9fb){_0x30cda5=_0x11f9fb;_0x37416c[_0x7995('0x31')]=_[_0x7995('0x4e')](db['Team']['rawAttributes']);_0x37416c['query']=_[_0x7995('0x4e')](_0x5ebf5e[_0x7995('0x2c')]);_0x37416c['filters']=_['intersection'](_0x37416c[_0x7995('0x31')],_0x37416c[_0x7995('0x2c')]);_0x53d693['attributes']=_['intersection'](_0x37416c['model'],qs['fields'](_0x5ebf5e[_0x7995('0x2c')][_0x7995('0x36')]));_0x53d693[_0x7995('0x34')]=_0x53d693[_0x7995('0x34')]['length']?_0x53d693[_0x7995('0x34')]:_0x37416c[_0x7995('0x31')];_0x53d693['order']=qs[_0x7995('0x50')](_0x5ebf5e[_0x7995('0x2c')][_0x7995('0x50')]);_0x53d693['where']=qs[_0x7995('0x33')](_[_0x7995('0x52')](_0x5ebf5e['query'],_0x37416c[_0x7995('0x33')]));if(_0x5ebf5e[_0x7995('0x2c')][_0x7995('0x1c')]){_0x53d693[_0x7995('0x51')]=_[_0x7995('0x38')](_0x53d693[_0x7995('0x51')],{'$or':_[_0x7995('0x1e')](_0x53d693[_0x7995('0x34')],function(_0x4254de){var _0x278004={};_0x278004[_0x4254de]={'$like':'%'+_0x5ebf5e[_0x7995('0x2c')][_0x7995('0x1c')]+'%'};return _0x278004;})});}_0x53d693=_[_0x7995('0x38')]({},_0x53d693,_0x5ebf5e['options']);return _0x30cda5[_0x7995('0x5e')](_0x53d693);}})[_0x7995('0x19')](function(_0x3603e8){if(_0x3603e8){_0x234a40=_0x3603e8[_0x7995('0x44')];if(!_0x5ebf5e['query'][_0x7995('0x57')](_0x7995('0x5b'))){_0x53d693[_0x7995('0x15')]=qs['limit'](_0x5ebf5e[_0x7995('0x2c')][_0x7995('0x15')]);_0x53d693[_0x7995('0x13')]=qs[_0x7995('0x13')](_0x5ebf5e[_0x7995('0x2c')][_0x7995('0x13')]);}return _0x30cda5[_0x7995('0x5e')](_0x53d693);}})['then'](function(_0x35dbd7){if(_0x35dbd7){return _0x35dbd7?{'count':_0x234a40,'rows':_0x35dbd7}:null;}})['then'](respondWithResult(_0x46fc1c,null))[_0x7995('0x2e')](handleError(_0x46fc1c,null));};exports[_0x7995('0x5f')]=function(_0x2190d1,_0x4cae1c){var _0xd012b9=_0x2190d1['body']['teams'];var _0x4ee5ee=_['map'](_0xd012b9,'id');return db[_0x7995('0x60')][_0x7995('0x2d')]({'where':{'id':_0x4ee5ee},'attributes':['id'],'include':[{'model':db['User'],'as':_0x7995('0x61'),'attributes':['id',_0x7995('0x23'),'online',_0x7995('0x62'),_0x7995('0x63')],'raw':!![]}]})[_0x7995('0x19')](function(_0x45a479){if(_0x45a479){var _0x443863=_['flatMap'](_0x45a479,function(_0x38ea3e){var _0x1df81d=_0x38ea3e[_0x7995('0x3c')]({'plain':!![]});_0x1df81d[_0x7995('0x61')]['forEach'](function(_0x428d5a){_0x428d5a[_0x7995('0x64')]=_[_0x7995('0x21')](_0xd012b9,{'id':_0x1df81d['id']})[_0x7995('0x64')];});return _0x1df81d[_0x7995('0x61')];});return db[_0x7995('0x39')][_0x7995('0x21')]({'where':{'id':_0x2190d1[_0x7995('0x30')]['id']}})[_0x7995('0x19')](function(_0x1fda95){return db['sequelize'][_0x7995('0x65')](function(_0x521712){return _0x1fda95[_0x7995('0x5f')](_0x4ee5ee,{'transaction':_0x521712})[_0x7995('0x19')](function(){return BPromise[_0x7995('0x66')](_0xd012b9,function(_0x50eb5e){return db['TeamVoiceQueue'][_0x7995('0x67')]({'TeamId':_0x50eb5e['id'],'VoiceQueueId':_0x2190d1[_0x7995('0x30')]['id'],'penalty':_0x50eb5e['penalty']},{'transaction':_0x521712});});})[_0x7995('0x19')](function(){return BPromise['each'](_0x443863,function(_0x43de18){return db[_0x7995('0x68')][_0x7995('0x69')]({'where':{'UserId':_0x43de18['id'],'VoiceQueueId':_0x2190d1[_0x7995('0x30')]['id']},'defaults':{'penalty':_0x43de18['penalty']},'transaction':_0x521712});});})['then'](function(){return BPromise[_0x7995('0x66')](_[_0x7995('0x1c')](_0x443863,{'online':!![]}),function(_0x365318){return db[_0x7995('0x6a')]['upsert']({'membername':_0x365318[_0x7995('0x23')],'UserId':_0x365318['id'],'queue_name':_0x1fda95[_0x7995('0x23')],'VoiceQueueId':_0x1fda95['id'],'interface':_[_0x7995('0x6b')](_0x365318[_0x7995('0x63')])?util[_0x7995('0x6c')]('SIP/%s',_0x365318['name']):_0x365318['interface'],'paused':_0x365318[_0x7995('0x62')]||![],'penalty':_0x365318[_0x7995('0x64')]},{'transaction':_0x521712});});})['then'](function(){_0x443863[_0x7995('0x6d')](function(_0x5635d6){socket[_0x7995('0x6e')](_0x7995('0x6f'),{'UserId':_0x5635d6['id'],'VoiceQueueId':_0x1fda95['id']});});});});});}})[_0x7995('0x19')](respondWithStatusCode(_0x4cae1c,null))[_0x7995('0x2e')](handleError(_0x4cae1c,null));};exports['removeTeams']=function(_0x3fbafb,_0x2caacd){return db[_0x7995('0x60')][_0x7995('0x2d')]({'where':{'id':_0x3fbafb[_0x7995('0x2c')][_0x7995('0x70')]},'attributes':['id'],'include':[{'model':db[_0x7995('0x71')],'as':_0x7995('0x61'),'attributes':['id'],'raw':!![]}]})[_0x7995('0x19')](handleEntityNotFound(_0x2caacd,null))[_0x7995('0x19')](function(_0x30893a){var _0x2b8d90=_[_0x7995('0x1e')](_0x30893a,'id');var _0x2122af=[];var _0x4ff0b6=[];var _0x764245=squel['select']();_0x764245[_0x7995('0x72')](_0x7995('0x73'))['from'](_0x7995('0x74'),'tq')['join'](_0x7995('0x75'),'ut',_0x7995('0x76'))['where']('VoiceQueueId\x20=\x20?',_0x3fbafb['params']['id']);for(var _0x8f5ecd=0x0;_0x8f5ecd<_0x30893a[_0x7995('0x44')];_0x8f5ecd+=0x1){let _0x139f76=_0x30893a[_0x8f5ecd];for(var _0x2b7bc2=0x0;_0x2b7bc2<_0x139f76['Agents'][_0x7995('0x44')];_0x2b7bc2+=0x1){let _0x2b2814=_0x139f76[_0x7995('0x61')][_0x2b7bc2];var _0x2de960=_0x764245[_0x7995('0x43')]();_0x2de960[_0x7995('0x51')](_0x7995('0x77'),_0x2b2814['id']);_0x4ff0b6[_0x7995('0x78')](db['sequelize'][_0x7995('0x2c')](_0x2de960[_0x7995('0x79')](),{'type':db[_0x7995('0x7a')][_0x7995('0x7b')]['SELECT']})[_0x7995('0x19')](function(_0x3a2958){if(_0x3a2958[_0x7995('0x44')]===0x1){return _0x2b2814['id'];}else{var _0x339e6b=_[_0x7995('0x7c')](_[_0x7995('0x1e')](_0x3a2958,'TeamId'),function(_0x1bc617){return _[_0x7995('0x20')](_0x2b8d90,_0x1bc617);});if(_0x339e6b){return _0x2b2814['id'];}}}));}}return BPromise[_0x7995('0x7d')](_0x4ff0b6)[_0x7995('0x19')](function(_0x3fcc49){_0x2122af=_(_0x2122af)[_0x7995('0x7e')](_0x3fcc49)[_0x7995('0x7f')]()[_0x7995('0x1f')]();return db[_0x7995('0x39')][_0x7995('0x21')]({'where':{'id':_0x3fbafb[_0x7995('0x30')]['id']}})[_0x7995('0x19')](function(_0x64a62d){return db[_0x7995('0x7a')][_0x7995('0x65')](function(_0x370984){return _0x64a62d[_0x7995('0x80')](_0x3fbafb[_0x7995('0x2c')][_0x7995('0x70')],{'transaction':_0x370984})[_0x7995('0x19')](function(){if(!_[_0x7995('0x81')](_0x2122af)){return _0x64a62d['removeAgents'](_0x2122af,{'transaction':_0x370984})['then'](function(){return db[_0x7995('0x6a')][_0x7995('0x25')]({'where':{'VoiceQueueId':_0x3fbafb['params']['id'],'UserId':_0x2122af},'transaction':_0x370984});});}})[_0x7995('0x19')](function(){_0x2122af['forEach'](function(_0x2ce103){socket['emit'](_0x7995('0x82'),{'UserId':_0x2ce103,'VoiceQueueId':_0x64a62d['id']});});});});});});})[_0x7995('0x19')](respondWithStatusCode(_0x2caacd,null))[_0x7995('0x2e')](handleError(_0x2caacd,null));};exports[_0x7995('0x83')]=function(_0x3aa676,_0x1df2a2){var _0xd82313,_0x1fa59d;return db[_0x7995('0x39')][_0x7995('0x21')]({'where':{'id':_0x3aa676['params']['id']}})[_0x7995('0x19')](handleEntityNotFound(_0x1df2a2,null))[_0x7995('0x19')](function(_0x1d0481){if(_0x1d0481){_0x1fa59d=_0x1d0481;return _0x1d0481[_0x7995('0x83')](_0x3aa676['body'][_0x7995('0x70')],_[_0x7995('0x46')](_0x3aa676[_0x7995('0x3b')],[_0x7995('0x70'),'id'])||{})['spread'](function(_0x32c550){for(var _0x37e647=0x0;_0x37e647<_0x3aa676[_0x7995('0x3b')][_0x7995('0x70')][_0x7995('0x44')];_0x37e647+=0x1){socket[_0x7995('0x6e')](_0x7995('0x6f'),{'UserId':Number(_0x3aa676[_0x7995('0x3b')][_0x7995('0x70')][_0x37e647]),'VoiceQueueId':Number(_0x3aa676['params']['id'])});}return _0x32c550;});}})[_0x7995('0x19')](function(_0x5f5496){_0xd82313=_0x5f5496||[];if(_0x1fa59d){return db[_0x7995('0x71')][_0x7995('0x2d')]({'where':{'id':_0x3aa676[_0x7995('0x3b')][_0x7995('0x70')]},'attributes':['id','name',_0x7995('0x84'),_0x7995('0x62'),_0x7995('0x63')],'raw':!![]});}})[_0x7995('0x19')](function(_0x2c715){if(!_[_0x7995('0x81')](_0x2c715)){var _0x3661ab=[];for(var _0x408692=0x0;_0x408692<_0x2c715[_0x7995('0x44')];_0x408692++){if(_0x2c715[_0x408692][_0x7995('0x84')]){_0x3661ab[_0x7995('0x78')](db[_0x7995('0x6a')][_0x7995('0x67')]({'membername':_0x2c715[_0x408692][_0x7995('0x23')],'UserId':_0x2c715[_0x408692]['id'],'queue_name':_0x1fa59d['name'],'VoiceQueueId':_0x1fa59d['id'],'interface':_['isNil'](_0x2c715[_0x408692][_0x7995('0x63')])?util[_0x7995('0x6c')](_0x7995('0x85'),_0x2c715[_0x408692]['name']):_0x2c715[_0x408692][_0x7995('0x63')],'paused':_0x2c715[_0x408692][_0x7995('0x62')]||![],'penalty':_0x3aa676[_0x7995('0x3b')]['penalty']||0x0}));}}return BPromise[_0x7995('0x7d')](_0x3661ab);}})[_0x7995('0x19')](function(){return _0xd82313;})[_0x7995('0x19')](respondWithResult(_0x1df2a2,null))[_0x7995('0x2e')](handleError(_0x1df2a2,null));};exports[_0x7995('0x86')]=function(_0x3d42a3,_0x29fb77){return db[_0x7995('0x39')][_0x7995('0x21')]({'where':{'id':_0x3d42a3[_0x7995('0x30')]['id']}})[_0x7995('0x19')](handleEntityNotFound(_0x29fb77,null))['then'](function(_0x580571){if(_0x580571){return _0x580571[_0x7995('0x86')](_0x3d42a3['query'][_0x7995('0x70')])[_0x7995('0x19')](function(){if(_[_0x7995('0x87')](_0x3d42a3[_0x7995('0x2c')][_0x7995('0x70')])){for(var _0x4eebf4=0x0;_0x4eebf4<_0x3d42a3['query'][_0x7995('0x70')][_0x7995('0x44')];_0x4eebf4+=0x1){socket[_0x7995('0x6e')](_0x7995('0x82'),{'UserId':Number(_0x3d42a3[_0x7995('0x2c')][_0x7995('0x70')][_0x4eebf4]),'VoiceQueueId':Number(_0x3d42a3[_0x7995('0x30')]['id'])});}}else{socket[_0x7995('0x6e')](_0x7995('0x82'),{'UserId':Number(_0x3d42a3[_0x7995('0x2c')]['ids']),'VoiceQueueId':Number(_0x3d42a3[_0x7995('0x30')]['id'])});}});}})[_0x7995('0x19')](function(_0x38e67a){return db[_0x7995('0x6a')]['destroy']({'where':{'VoiceQueueId':_0x3d42a3['params']['id'],'UserId':_0x3d42a3['query']['ids']}})['then'](function(){return _0x38e67a;});})[_0x7995('0x19')](respondWithStatusCode(_0x29fb77,null))['catch'](handleError(_0x29fb77,null));};exports['getAgents']=function(_0x32f19d,_0x44dbb8){var _0x181ed6={};var _0x48b807={};var _0xba00af;var _0x4f008a;return db[_0x7995('0x39')][_0x7995('0x4d')]({'where':{'id':_0x32f19d[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x44dbb8,null))[_0x7995('0x19')](function(_0x14be06){if(_0x14be06){_0xba00af=_0x14be06;_0x48b807[_0x7995('0x31')]=_['keys'](db[_0x7995('0x71')][_0x7995('0x32')]);_0x48b807[_0x7995('0x2c')]=_[_0x7995('0x4e')](_0x32f19d[_0x7995('0x2c')]);_0x48b807['filters']=_[_0x7995('0x35')](_0x48b807[_0x7995('0x31')],_0x48b807[_0x7995('0x2c')]);_0x181ed6['attributes']=_[_0x7995('0x35')](_0x48b807[_0x7995('0x31')],qs[_0x7995('0x36')](_0x32f19d[_0x7995('0x2c')][_0x7995('0x36')]));_0x181ed6['attributes']=_0x181ed6[_0x7995('0x34')][_0x7995('0x44')]?_0x181ed6[_0x7995('0x34')]:_0x48b807[_0x7995('0x31')];_0x181ed6[_0x7995('0x4f')]=qs[_0x7995('0x50')](_0x32f19d[_0x7995('0x2c')]['sort']);_0x181ed6['where']=qs[_0x7995('0x33')](_[_0x7995('0x52')](_0x32f19d['query'],_0x48b807['filters']));if(_0x32f19d[_0x7995('0x2c')][_0x7995('0x1c')]){_0x181ed6[_0x7995('0x51')]=_[_0x7995('0x38')](_0x181ed6[_0x7995('0x51')],{'$or':_[_0x7995('0x1e')](_0x181ed6[_0x7995('0x34')],function(_0x4dca11){var _0xf90cd8={};_0xf90cd8[_0x4dca11]={'$like':'%'+_0x32f19d[_0x7995('0x2c')][_0x7995('0x1c')]+'%'};return _0xf90cd8;})});}_0x181ed6=_[_0x7995('0x38')]({},_0x181ed6,_0x32f19d[_0x7995('0x45')]);return _0xba00af[_0x7995('0x88')](_0x181ed6);}})['then'](function(_0x1d7c33){if(_0x1d7c33){_0x4f008a=_0x1d7c33[_0x7995('0x44')];if(!_0x32f19d[_0x7995('0x2c')][_0x7995('0x57')](_0x7995('0x5b'))){_0x181ed6[_0x7995('0x15')]=qs[_0x7995('0x15')](_0x32f19d['query'][_0x7995('0x15')]);_0x181ed6[_0x7995('0x13')]=qs[_0x7995('0x13')](_0x32f19d[_0x7995('0x2c')]['offset']);}return _0xba00af[_0x7995('0x88')](_0x181ed6);}})['then'](function(_0x21ba9b){if(_0x21ba9b){return _0x21ba9b?{'count':_0x4f008a,'rows':_0x21ba9b}:null;}})[_0x7995('0x19')](respondWithResult(_0x44dbb8,null))['catch'](handleError(_0x44dbb8,null));};exports['getMembers']=function(_0x478c12,_0x3b22ec){var _0xf503d5={};var _0x7d2ccf={};var _0x18a3dc;var _0x503b32;return db[_0x7995('0x39')][_0x7995('0x4d')]({'where':{'id':_0x478c12[_0x7995('0x30')]['id']}})[_0x7995('0x19')](handleEntityNotFound(_0x3b22ec,null))[_0x7995('0x19')](function(_0x1fa484){if(_0x1fa484){_0x18a3dc=_0x1fa484;_0x7d2ccf[_0x7995('0x31')]=_['keys'](db['UserVoiceQueueRt'][_0x7995('0x32')]);_0x7d2ccf['query']=_['keys'](_0x478c12[_0x7995('0x2c')]);_0x7d2ccf[_0x7995('0x33')]=_[_0x7995('0x35')](_0x7d2ccf[_0x7995('0x31')],_0x7d2ccf[_0x7995('0x2c')]);_0xf503d5[_0x7995('0x34')]=_[_0x7995('0x35')](_0x7d2ccf[_0x7995('0x31')],qs[_0x7995('0x36')](_0x478c12[_0x7995('0x2c')][_0x7995('0x36')]));_0xf503d5[_0x7995('0x34')]=_0xf503d5['attributes'][_0x7995('0x44')]?_0xf503d5[_0x7995('0x34')]:_0x7d2ccf[_0x7995('0x31')];_0xf503d5[_0x7995('0x4f')]=qs[_0x7995('0x50')](_0x478c12[_0x7995('0x2c')][_0x7995('0x50')]);_0xf503d5['where']=qs[_0x7995('0x33')](_[_0x7995('0x52')](_0x478c12[_0x7995('0x2c')],_0x7d2ccf[_0x7995('0x33')]));if(_0x478c12[_0x7995('0x2c')]['filter']){_0xf503d5[_0x7995('0x51')]=_['merge'](_0xf503d5[_0x7995('0x51')],{'$or':_[_0x7995('0x1e')](_0xf503d5[_0x7995('0x34')],function(_0x5150aa){var _0x260e84={};_0x260e84[_0x5150aa]={'$like':'%'+_0x478c12[_0x7995('0x2c')][_0x7995('0x1c')]+'%'};return _0x260e84;})});}_0xf503d5=_[_0x7995('0x38')]({},_0xf503d5,_0x478c12[_0x7995('0x45')]);return _0x18a3dc[_0x7995('0x89')](_0xf503d5);}})[_0x7995('0x19')](function(_0x4fb899){if(_0x4fb899){_0x503b32=_0x4fb899['length'];if(!_0x478c12[_0x7995('0x2c')][_0x7995('0x57')](_0x7995('0x5b'))){_0xf503d5[_0x7995('0x15')]=qs[_0x7995('0x15')](_0x478c12[_0x7995('0x2c')]['limit']);_0xf503d5[_0x7995('0x13')]=qs[_0x7995('0x13')](_0x478c12[_0x7995('0x2c')][_0x7995('0x13')]);}return _0x18a3dc['getMembers'](_0xf503d5);}})['then'](function(_0x5b93e6){return _0x5b93e6?{'count':_0x503b32,'rows':_0x5b93e6}:null;})[_0x7995('0x19')](respondWithResult(_0x3b22ec,null))['catch'](handleError(_0x3b22ec,null));};exports[_0x7995('0x8a')]=function(_0x1b6411,_0x54e348){var _0x390bd3={};var _0x3f0a01={};var _0x45d8a2;var _0x26ab59;return db[_0x7995('0x39')]['findOne']({'where':{'id':_0x1b6411['params']['id']}})[_0x7995('0x19')](handleEntityNotFound(_0x54e348,null))[_0x7995('0x19')](function(_0x2cfa1d){if(_0x2cfa1d){_0x45d8a2=_0x2cfa1d;_0x3f0a01[_0x7995('0x31')]=_[_0x7995('0x4e')](db['CmList'][_0x7995('0x32')]);_0x3f0a01[_0x7995('0x2c')]=_[_0x7995('0x4e')](_0x1b6411[_0x7995('0x2c')]);_0x3f0a01[_0x7995('0x33')]=_['intersection'](_0x3f0a01['model'],_0x3f0a01['query']);_0x390bd3['attributes']=_[_0x7995('0x35')](_0x3f0a01[_0x7995('0x31')],qs['fields'](_0x1b6411[_0x7995('0x2c')][_0x7995('0x36')]));_0x390bd3['attributes']=_0x390bd3['attributes'][_0x7995('0x44')]?_0x390bd3[_0x7995('0x34')]:_0x3f0a01[_0x7995('0x31')];_0x390bd3[_0x7995('0x4f')]=qs[_0x7995('0x50')](_0x1b6411[_0x7995('0x2c')][_0x7995('0x50')]);_0x390bd3['where']=qs['filters'](_[_0x7995('0x52')](_0x1b6411[_0x7995('0x2c')],_0x3f0a01[_0x7995('0x33')]));if(_0x1b6411['query'][_0x7995('0x1c')]){_0x390bd3[_0x7995('0x51')]=_[_0x7995('0x38')](_0x390bd3[_0x7995('0x51')],{'$or':_[_0x7995('0x1e')](_0x390bd3[_0x7995('0x34')],function(_0x28ac7c){var _0x1b4cab={};_0x1b4cab[_0x28ac7c]={'$like':'%'+_0x1b6411[_0x7995('0x2c')]['filter']+'%'};return _0x1b4cab;})});}_0x390bd3=_['merge']({},_0x390bd3,_0x1b6411[_0x7995('0x45')]);return _0x45d8a2['getLists'](_0x390bd3);}})[_0x7995('0x19')](function(_0x5953d1){if(_0x5953d1){_0x26ab59=_0x5953d1[_0x7995('0x44')];if(!_0x1b6411[_0x7995('0x2c')][_0x7995('0x57')]('nolimit')){_0x390bd3['limit']=qs[_0x7995('0x15')](_0x1b6411[_0x7995('0x2c')][_0x7995('0x15')]);_0x390bd3[_0x7995('0x13')]=qs[_0x7995('0x13')](_0x1b6411[_0x7995('0x2c')][_0x7995('0x13')]);}return _0x45d8a2[_0x7995('0x8a')](_0x390bd3);}})[_0x7995('0x19')](function(_0x35403c){if(_0x35403c){return _0x35403c?{'count':_0x26ab59,'rows':_0x35403c}:null;}})[_0x7995('0x19')](respondWithResult(_0x54e348,null))['catch'](handleError(_0x54e348,null));};exports[_0x7995('0x8b')]=function(_0xe43c99,_0x1b7e44){var _0x442c6d=moment()[_0x7995('0x6c')]('YYYY-MM-DD\x20HH:mm:ss');var _0x3b5edf,_0x44068f;return db[_0x7995('0x39')][_0x7995('0x21')]({'where':{'id':_0xe43c99[_0x7995('0x30')]['id']}})[_0x7995('0x19')](handleEntityNotFound(_0x1b7e44,null))[_0x7995('0x19')](function(_0x2b812f){if(_0x2b812f){_0x44068f=_0x2b812f;return _0x2b812f[_0x7995('0x8b')](_0xe43c99['body']['ids'],_[_0x7995('0x46')](_0xe43c99[_0x7995('0x3b')],[_0x7995('0x70'),'id'])||{});}return null;})[_0x7995('0x8c')](function(_0x17fd98){var _0x498d7c;_0x3b5edf=_0x17fd98||[];var _0x341024=[];if(_0x17fd98){for(var _0x2bcbc6=0x0;_0x2bcbc6<_0x17fd98[_0x7995('0x44')];_0x2bcbc6+=0x1){var _0x2dd6c7=_0x17fd98[_0x2bcbc6][_0x7995('0x3c')]({'plain':!![]});_0x44068f[_0x7995('0x8d')]=_0xe43c99[_0x7995('0x3b')][_0x7995('0x8d')]?_0xe43c99[_0x7995('0x3b')]['dialCheckDuplicateType']:_0x44068f['dialCheckDuplicateType'];switch(_0x44068f[_0x7995('0x8d')]){case _0x7995('0x8e'):_0x498d7c=squel[_0x7995('0x8f')]()[_0x7995('0x90')](_0x7995('0x91'))[_0x7995('0x92')]([_0x7995('0x93'),_0x7995('0x94'),'ContactId','ListId',_0x7995('0x58'),_0x7995('0x95'),_0x7995('0x47')],squel[_0x7995('0x96')]()['field']('phone',_0x7995('0x93'))[_0x7995('0x72')]('\x27'+_0x442c6d+'\x27',_0x7995('0x94'))[_0x7995('0x72')]('id',_0x7995('0x97'))[_0x7995('0x72')](_0x2dd6c7[_0x7995('0x98')][_0x7995('0x79')](),_0x7995('0x99'))[_0x7995('0x72')](_0xe43c99[_0x7995('0x30')]['id'][_0x7995('0x79')](),'VoiceQueueId')['field']('\x27'+_0x442c6d+'\x27',_0x7995('0x95'))[_0x7995('0x72')]('\x27'+_0x442c6d+'\x27',_0x7995('0x47'))[_0x7995('0x9a')]('cm_contacts')[_0x7995('0x51')]('deletedAt\x20IS\x20NULL')[_0x7995('0x51')](_0x7995('0x9b'),_0x2dd6c7[_0x7995('0x98')][_0x7995('0x79')]())[_0x7995('0x51')](_0x7995('0x9c'))['where'](_0x7995('0x9d'),squel[_0x7995('0x96')]()[_0x7995('0x72')](_0x7995('0x9e'))['from']('cm_hopper_final')[_0x7995('0x51')](_0x7995('0x9f'),_0xe43c99[_0x7995('0x30')]['id'][_0x7995('0x79')]()))['where'](_0x7995('0x9d'),squel[_0x7995('0x96')]()[_0x7995('0x72')]('COALESCE(phone,\x27\x27)')[_0x7995('0x9a')](_0x7995('0x91'))[_0x7995('0x51')]('VoiceQueueId\x20=\x20?',_0xe43c99[_0x7995('0x30')]['id'][_0x7995('0x79')]())))[_0x7995('0x79')]();break;case _0x7995('0xa0'):_0x498d7c=squel[_0x7995('0x8f')]()[_0x7995('0x90')](_0x7995('0x91'))[_0x7995('0x92')]([_0x7995('0x93'),'scheduledAt',_0x7995('0x97'),_0x7995('0x99'),_0x7995('0x58'),_0x7995('0x95'),'updatedAt'],squel[_0x7995('0x96')]()[_0x7995('0x72')](_0x7995('0x93'),_0x7995('0x93'))['field']('\x27'+_0x442c6d+'\x27',_0x7995('0x94'))[_0x7995('0x72')]('id',_0x7995('0x97'))[_0x7995('0x72')](_0x2dd6c7[_0x7995('0x98')][_0x7995('0x79')](),_0x7995('0x99'))['field'](_0xe43c99[_0x7995('0x30')]['id'][_0x7995('0x79')](),_0x7995('0x58'))[_0x7995('0x72')]('\x27'+_0x442c6d+'\x27',_0x7995('0x95'))['field']('\x27'+_0x442c6d+'\x27',_0x7995('0x47'))['from'](_0x7995('0xa1'))[_0x7995('0x51')](_0x7995('0xa2'))['where']('ListId\x20=\x20?',_0x2dd6c7['CmListId'][_0x7995('0x79')]())[_0x7995('0x51')](_0x7995('0x9c'))[_0x7995('0x51')](_0x7995('0x9d'),squel[_0x7995('0x96')]()['field'](_0x7995('0xa3'))[_0x7995('0x9a')](_0x7995('0x91'))[_0x7995('0x51')]('VoiceQueueId\x20=\x20?',_0xe43c99[_0x7995('0x30')]['id'][_0x7995('0x79')]())))['toString']();break;default:_0x498d7c=squel[_0x7995('0x8f')]()['into'](_0x7995('0x91'))[_0x7995('0x92')]([_0x7995('0x93'),'scheduledAt','ContactId',_0x7995('0x99'),_0x7995('0x58'),_0x7995('0x95'),_0x7995('0x47')],squel[_0x7995('0x96')]()[_0x7995('0x72')](_0x7995('0x93'),_0x7995('0x93'))[_0x7995('0x72')]('\x27'+_0x442c6d+'\x27',_0x7995('0x94'))[_0x7995('0x72')]('id','ContactId')['field'](_0x2dd6c7[_0x7995('0x98')][_0x7995('0x79')](),_0x7995('0x99'))[_0x7995('0x72')](_0xe43c99['params']['id']['toString'](),_0x7995('0x58'))[_0x7995('0x72')]('\x27'+_0x442c6d+'\x27','createdAt')['field']('\x27'+_0x442c6d+'\x27',_0x7995('0x47'))[_0x7995('0x9a')](_0x7995('0xa1'))[_0x7995('0x51')](_0x7995('0xa2'))['where'](_0x7995('0x9b'),_0x2dd6c7[_0x7995('0x98')]['toString']())[_0x7995('0x51')](_0x7995('0x9c')))[_0x7995('0x79')]();}_0x341024['push'](db[_0x7995('0x7a')][_0x7995('0x2c')](_0x498d7c));}return BPromise[_0x7995('0x7d')](_0x341024);}})[_0x7995('0x19')](function(){var _0x113e03=[];var _0x5348b1=squel['insert']()[_0x7995('0x90')]('cm_hopper_additional_phones')[_0x7995('0x92')](['CmHopperId',_0x7995('0x93'),_0x7995('0xa4'),_0x7995('0x95'),'updatedAt'],squel['select']()['field'](_0x7995('0xa5'))[_0x7995('0x72')](_0x7995('0xa6'))['field'](_0x7995('0xa7'))[_0x7995('0x72')]('\x27'+_0x442c6d+'\x27','createdAt')[_0x7995('0x72')]('\x27'+_0x442c6d+'\x27',_0x7995('0x47'))[_0x7995('0x9a')](_0x7995('0xa8'),'ci')[_0x7995('0xa9')]('cm_hopper','h','h.ContactId=ci.CmContactId')[_0x7995('0x51')](_0x7995('0xaa'),_0x442c6d)[_0x7995('0x51')](_0x7995('0xab'),_0x7995('0xac')))[_0x7995('0x79')]();_0x113e03[_0x7995('0x78')](db[_0x7995('0x7a')][_0x7995('0x2c')](_0x5348b1));return BPromise[_0x7995('0x7d')](_0x113e03);})['then'](function(){return _0x3b5edf;})[_0x7995('0x19')](respondWithResult(_0x1b7e44,null))[_0x7995('0x2e')](handleError(_0x1b7e44,null));};exports[_0x7995('0xad')]=function(_0xff759b,_0x39ee00){return db[_0x7995('0x39')][_0x7995('0x21')]({'where':{'id':_0xff759b['params']['id']}})['then'](handleEntityNotFound(_0x39ee00,null))[_0x7995('0x19')](function(_0x2aec8d){if(_0x2aec8d){return _0x2aec8d[_0x7995('0xad')](_0xff759b[_0x7995('0x2c')]['ids']);}})['then'](function(_0x4b477a){if(_0x4b477a){return db[_0x7995('0x53')][_0x7995('0x25')]({'where':{'ListId':_0xff759b['query'][_0x7995('0x70')],'VoiceQueueId':_0xff759b[_0x7995('0x30')]['id']}})[_0x7995('0x19')](function(){return _0x4b477a;});}})[_0x7995('0x19')](respondWithStatusCode(_0x39ee00,null))[_0x7995('0x2e')](handleError(_0x39ee00,null));};exports[_0x7995('0xae')]=function(_0x35229d,_0x22d392){var _0x57438e={};var _0x463c25={};var _0x13d525;var _0x37b7e7;return db['VoiceQueue'][_0x7995('0x4d')]({'where':{'id':_0x35229d['params']['id']}})['then'](handleEntityNotFound(_0x22d392,null))['then'](function(_0x507bf3){if(_0x507bf3){_0x13d525=_0x507bf3;_0x463c25[_0x7995('0x31')]=_['keys'](db[_0x7995('0xaf')][_0x7995('0x32')]);_0x463c25['query']=_[_0x7995('0x4e')](_0x35229d[_0x7995('0x2c')]);_0x463c25[_0x7995('0x33')]=_[_0x7995('0x35')](_0x463c25['model'],_0x463c25[_0x7995('0x2c')]);_0x57438e['attributes']=_[_0x7995('0x35')](_0x463c25[_0x7995('0x31')],qs[_0x7995('0x36')](_0x35229d[_0x7995('0x2c')][_0x7995('0x36')]));_0x57438e[_0x7995('0x34')]=_0x57438e[_0x7995('0x34')][_0x7995('0x44')]?_0x57438e[_0x7995('0x34')]:_0x463c25[_0x7995('0x31')];_0x57438e['order']=qs[_0x7995('0x50')](_0x35229d[_0x7995('0x2c')]['sort']);_0x57438e[_0x7995('0x51')]=qs[_0x7995('0x33')](_[_0x7995('0x52')](_0x35229d[_0x7995('0x2c')],_0x463c25[_0x7995('0x33')]));if(_0x35229d[_0x7995('0x2c')]['filter']){_0x57438e[_0x7995('0x51')]=_['merge'](_0x57438e[_0x7995('0x51')],{'$or':_[_0x7995('0x1e')](_0x57438e[_0x7995('0x34')],function(_0xb79b0b){var _0x259bf2={};_0x259bf2[_0xb79b0b]={'$like':'%'+_0x35229d[_0x7995('0x2c')]['filter']+'%'};return _0x259bf2;})});}_0x57438e=_[_0x7995('0x38')]({},_0x57438e,_0x35229d[_0x7995('0x45')]);return _0x13d525[_0x7995('0xae')](_0x57438e);}})['then'](function(_0x1176cd){if(_0x1176cd){_0x37b7e7=_0x1176cd[_0x7995('0x44')];if(!_0x35229d[_0x7995('0x2c')][_0x7995('0x57')](_0x7995('0x5b'))){_0x57438e[_0x7995('0x15')]=qs[_0x7995('0x15')](_0x35229d[_0x7995('0x2c')][_0x7995('0x15')]);_0x57438e[_0x7995('0x13')]=qs[_0x7995('0x13')](_0x35229d['query'][_0x7995('0x13')]);}return _0x13d525[_0x7995('0xae')](_0x57438e);}})['then'](function(_0x3098ef){if(_0x3098ef){return _0x3098ef?{'count':_0x37b7e7,'rows':_0x3098ef}:null;}})[_0x7995('0x19')](respondWithResult(_0x22d392,null))[_0x7995('0x2e')](handleError(_0x22d392,null));};exports[_0x7995('0xb0')]=function(_0x258f87,_0x5a5cc4){var _0x37af6b;return db[_0x7995('0x39')][_0x7995('0x21')]({'where':{'id':_0x258f87[_0x7995('0x30')]['id']}})[_0x7995('0x19')](handleEntityNotFound(_0x5a5cc4,null))[_0x7995('0x19')](function(_0x120bef){if(_0x120bef){return _0x120bef[_0x7995('0xb0')](_0x258f87[_0x7995('0x3b')][_0x7995('0x70')],_[_0x7995('0x46')](_0x258f87[_0x7995('0x3b')],[_0x7995('0x70'),'id'])||{});}return null;})['spread'](function(_0x247b71){var _0x1ecb6f;_0x37af6b=_0x247b71||[];var _0x225a37=[];if(_0x247b71){for(var _0x1a9f59=0x0;_0x1a9f59<_0x247b71['length'];_0x1a9f59+=0x1){var _0x92a561=_0x247b71[_0x1a9f59][_0x7995('0x3c')]({'plain':!![]});_0x1ecb6f=squel[_0x7995('0x8f')]()[_0x7995('0x90')](_0x7995('0xb1'))[_0x7995('0x92')]([_0x7995('0x93'),'ContactId',_0x7995('0x99'),'VoiceQueueId',_0x7995('0x95'),_0x7995('0x47')],squel[_0x7995('0x96')]()['field']('phone',_0x7995('0x93'))[_0x7995('0x72')]('id',_0x7995('0x97'))['field'](_0x92a561[_0x7995('0x98')]['toString'](),_0x7995('0x99'))[_0x7995('0x72')](_0x258f87[_0x7995('0x30')]['id'][_0x7995('0x79')](),_0x7995('0x58'))[_0x7995('0x72')]('NOW()',_0x7995('0x95'))[_0x7995('0x72')]('NOW()',_0x7995('0x47'))[_0x7995('0x9a')](_0x7995('0xa1'))[_0x7995('0x51')](_0x7995('0xa2'))[_0x7995('0x51')](_0x7995('0x9b'),_0x92a561[_0x7995('0x98')][_0x7995('0x79')]())[_0x7995('0x51')](_0x7995('0x9c')))[_0x7995('0x79')]();_0x225a37[_0x7995('0x78')](db[_0x7995('0x7a')][_0x7995('0x2c')](_0x1ecb6f));}return BPromise[_0x7995('0x7d')](_0x225a37);}})[_0x7995('0x19')](function(){return _0x37af6b;})['then'](respondWithResult(_0x5a5cc4,null))['catch'](handleError(_0x5a5cc4,null));};exports[_0x7995('0xb2')]=function(_0x2f3c17,_0x4fe5eb){return db[_0x7995('0x39')][_0x7995('0x21')]({'where':{'id':_0x2f3c17['params']['id']}})['then'](handleEntityNotFound(_0x4fe5eb,null))[_0x7995('0x19')](function(_0x31a3d6){if(_0x31a3d6){return _0x31a3d6[_0x7995('0xb2')](_0x2f3c17[_0x7995('0x2c')][_0x7995('0x70')]);}})[_0x7995('0x19')](function(_0x1b3920){if(_0x1b3920){return db[_0x7995('0x5d')][_0x7995('0x25')]({'where':{'ListId':_0x2f3c17[_0x7995('0x2c')]['ids'],'VoiceQueueId':_0x2f3c17[_0x7995('0x30')]['id']}})[_0x7995('0x19')](function(){return _0x1b3920;});}})[_0x7995('0x19')](respondWithStatusCode(_0x4fe5eb,null))[_0x7995('0x2e')](handleError(_0x4fe5eb,null));}; \ No newline at end of file +var _0x55ca=['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','merge','omit','createdAt','updatedAt','VoiceQueues','UserProfileResource','findOne','CmHopper','hasOwnProperty','nolimit','limit','order','sort','where','rows','getHopperHistories','CmHopperHistory','pick','VoiceQueueId','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','teams','User','Agents','online','voicePause','flatMap','penalty','sequelize','each','TeamVoiceQueue','upsert','findOrCreate','UserVoiceQueueRt','isNil','interface','format','SIP/%s','forEach','emit','userVoiceQueue:save','removeTeams','select','tq.TeamId','join','user_has_teams','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','toString','QueryTypes','every','TeamId','all','union','transaction','isEmpty','userVoiceQueue:remove','addAgents','ids','spread','removeAgents','isArray','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ListId','field','ContactId','CmListId','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','onlyIfOpen','COALESCE(phone,\x27\x27)','push','cm_hopper_additional_phones','CmHopperId','h.id','cm_contact_has_items','h.ContactId=ci.CmContactId','h.scheduledat=?','ci.ItemClass=?','removeLists','getBlackLists','addBlackLists','cm_hopper_black','NOW()','phone\x20IS\x20NOT\x20NULL','removeBlackLists','moment','bluebird','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./voiceQueue.socket','status','end','json','undefined','count','offset','set','Content-Range','update','then','destroy','get','inbound','QueueCampaigns','outbound','filter','ignore','value','includes','type','sendStatus','error','stack','name','send','index','map','VoiceQueue','key','getOptions','include','query','findAll','catch','params','model','keys','rawAttributes','filters','intersection','attributes','fields','length','includeAll','options'];(function(_0x2185fd,_0x1a7450){var _0x1e5e58=function(_0x2470e9){while(--_0x2470e9){_0x2185fd['push'](_0x2185fd['shift']());}};_0x1e5e58(++_0x1a7450);}(_0x55ca,0x126));var _0xa55c=function(_0x24b53b,_0x57c20d){_0x24b53b=_0x24b53b-0x0;var _0x3b5c00=_0x55ca[_0x24b53b];return _0x3b5c00;};'use strict';var moment=require(_0xa55c('0x0'));var BPromise=require(_0xa55c('0x1'));var util=require('util');var _=require('lodash');var squel=require('squel');var Redis=require(_0xa55c('0x2'));var qs=require(_0xa55c('0x3'));var logger=require('../../config/logger')(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var db=require(_0xa55c('0x6'))['db'];config[_0xa55c('0x7')]=_[_0xa55c('0x8')](config[_0xa55c('0x7')],{'host':_0xa55c('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa55c('0x7')]));require(_0xa55c('0xa'))['register'](socket);function respondWithStatusCode(_0x291996,_0x290d28){_0x290d28=_0x290d28||0xcc;return function(_0x52a3bc){if(_0x52a3bc){return _0x291996['sendStatus'](_0x290d28);}return _0x291996[_0xa55c('0xb')](_0x290d28)[_0xa55c('0xc')]();};}function respondWithResult(_0x381d07,_0x5d8e5a){_0x5d8e5a=_0x5d8e5a||0xc8;return function(_0x31646d){if(_0x31646d){return _0x381d07[_0xa55c('0xb')](_0x5d8e5a)[_0xa55c('0xd')](_0x31646d);}};}function respondWithFilteredResult(_0x70c2de,_0x3998f7){return function(_0x15eec8){if(_0x15eec8){var _0x5d47ff=typeof _0x3998f7['offset']===_0xa55c('0xe')&&typeof _0x3998f7['limit']==='undefined';var _0x59ea8d=_0x15eec8[_0xa55c('0xf')];var _0x3930e4=_0x5d47ff?0x0:_0x3998f7[_0xa55c('0x10')];var _0x938bd6=_0x5d47ff?_0x15eec8[_0xa55c('0xf')]:_0x3998f7[_0xa55c('0x10')]+_0x3998f7['limit'];var _0x3ccf65;if(_0x938bd6>=_0x59ea8d){_0x938bd6=_0x59ea8d;_0x3ccf65=0xc8;}else{_0x3ccf65=0xce;}_0x70c2de[_0xa55c('0xb')](_0x3ccf65);return _0x70c2de[_0xa55c('0x11')](_0xa55c('0x12'),_0x3930e4+'-'+_0x938bd6+'/'+_0x59ea8d)[_0xa55c('0xd')](_0x15eec8);}return null;};}function saveUpdates(_0x3ae86b){return function(_0x51590e){if(_0x51590e){return _0x51590e[_0xa55c('0x13')](_0x3ae86b)[_0xa55c('0x14')](function(_0x4cee3c){return _0x4cee3c;});}return null;};}function removeEntity(_0x3d4c9e){return function(_0x104a99){if(_0x104a99){return _0x104a99[_0xa55c('0x15')]()[_0xa55c('0x14')](function(){var _0x23a1ae=_0x104a99[_0xa55c('0x16')]({'plain':!![]});var _0x4c0daf=[{'name':'VoiceQueues','value':_0xa55c('0x17'),'ignore':![]},{'name':_0xa55c('0x18'),'value':_0xa55c('0x19'),'ignore':![]}];var _0x4cfe10=_(_0x4c0daf)[_0xa55c('0x1a')](_0xa55c('0x1b'))['map'](_0xa55c('0x1c'))[_0xa55c('0x1c')]();if(_[_0xa55c('0x1d')](_0x4cfe10,_0x23a1ae[_0xa55c('0x1e')])){return;}var _0x234372=_['find'](_0x4c0daf,[_0xa55c('0x1c'),_0x23a1ae['type']])['name'];return db['UserProfileResource'][_0xa55c('0x15')]({'where':{'type':_0x234372,'resourceId':_0x23a1ae['id']}})['then'](function(){return _0x104a99;});})[_0xa55c('0x14')](function(){_0x3d4c9e[_0xa55c('0xb')](0xcc)[_0xa55c('0xc')]();});}};}function handleEntityNotFound(_0xf0e574){return function(_0x2313a9){if(!_0x2313a9){_0xf0e574[_0xa55c('0x1f')](0x194);}return _0x2313a9;};}function handleError(_0x1da633,_0x11e7f7){_0x11e7f7=_0x11e7f7||0x1f4;return function(_0x192df2){logger[_0xa55c('0x20')](_0x192df2[_0xa55c('0x21')]);if(_0x192df2['name']){delete _0x192df2[_0xa55c('0x22')];}_0x1da633[_0xa55c('0xb')](_0x11e7f7)[_0xa55c('0x23')](_0x192df2);};}exports[_0xa55c('0x24')]=function(_0x5d940d,_0x1377b0){var _0x22f6b6={};var _0x1b8388={'count':0x0,'rows':[]};var _0x201941=_[_0xa55c('0x25')](db[_0xa55c('0x26')]['rawAttributes'],function(_0x23e698){return{'name':_0x23e698['fieldName'],'type':_0x23e698[_0xa55c('0x1e')][_0xa55c('0x27')]};});_0x22f6b6=qs[_0xa55c('0x28')](_0x201941,_0x5d940d);var _0x223813={'where':_0x22f6b6['where']};return db[_0xa55c('0x26')][_0xa55c('0xf')](_0x223813)[_0xa55c('0x14')](function(_0x20da31){_0x1b8388[_0xa55c('0xf')]=_0x20da31;_0x22f6b6[_0xa55c('0x29')]=qs[_0xa55c('0x29')](_0x5d940d[_0xa55c('0x2a')]);return db[_0xa55c('0x26')][_0xa55c('0x2b')](_0x22f6b6);})[_0xa55c('0x14')](function(_0x4eb7c4){_0x1b8388['rows']=_0x4eb7c4;return _0x1b8388;})[_0xa55c('0x14')](respondWithFilteredResult(_0x1377b0,_0x22f6b6))[_0xa55c('0x2c')](handleError(_0x1377b0,null));};exports['show']=function(_0x30fadd,_0x2f0110){var _0x2e9623={'raw':![],'where':{'id':_0x30fadd[_0xa55c('0x2d')]['id']}},_0x1839ac={};_0x1839ac[_0xa55c('0x2e')]=_[_0xa55c('0x2f')](db[_0xa55c('0x26')][_0xa55c('0x30')]);_0x1839ac['query']=_['keys'](_0x30fadd['query']);_0x1839ac[_0xa55c('0x31')]=_[_0xa55c('0x32')](_0x1839ac[_0xa55c('0x2e')],_0x1839ac['query']);_0x2e9623[_0xa55c('0x33')]=_['intersection'](_0x1839ac[_0xa55c('0x2e')],qs['fields'](_0x30fadd[_0xa55c('0x2a')][_0xa55c('0x34')]));_0x2e9623[_0xa55c('0x33')]=_0x2e9623['attributes'][_0xa55c('0x35')]?_0x2e9623[_0xa55c('0x33')]:_0x1839ac['model'];if(_0x30fadd[_0xa55c('0x2a')][_0xa55c('0x36')]){_0x2e9623['include']=[{'all':!![]}];}_0x2e9623=_['merge']({},_0x2e9623,_0x30fadd[_0xa55c('0x37')]);return db['VoiceQueue'][_0xa55c('0x38')](_0x2e9623)[_0xa55c('0x14')](handleEntityNotFound(_0x2f0110,null))['then'](respondWithResult(_0x2f0110,null))['catch'](handleError(_0x2f0110,null));};exports['create']=function(_0x4de781,_0x3b3308){return db[_0xa55c('0x26')][_0xa55c('0x39')](_0x4de781[_0xa55c('0x3a')],{})[_0xa55c('0x14')](function(_0x56d17c){var _0x3d52d8=_0x4de781[_0xa55c('0x3b')][_0xa55c('0x16')]({'plain':!![]});if(!_0x3d52d8)throw new Error(_0xa55c('0x3c'));if(_0x3d52d8[_0xa55c('0x3d')]===_0xa55c('0x3b')){var _0x554620=_0x56d17c[_0xa55c('0x16')]({'plain':!![]});var _0x5ee63d=[{'name':'VoiceQueues','value':_0xa55c('0x17')},{'name':_0xa55c('0x18'),'value':'outbound'}];var _0x2bd98b=_['find'](_0x5ee63d,['value',_0x554620[_0xa55c('0x1e')]])[_0xa55c('0x22')];return db[_0xa55c('0x3e')]['find']({'where':{'name':_0x2bd98b,'userProfileId':_0x3d52d8[_0xa55c('0x3f')]},'raw':!![]})[_0xa55c('0x14')](function(_0x5d9d5d){if(_0x5d9d5d&&_0x5d9d5d[_0xa55c('0x40')]===0x0){return db['UserProfileResource'][_0xa55c('0x39')]({'name':_0x554620[_0xa55c('0x22')],'resourceId':_0x554620['id'],'type':_0x5d9d5d['name'],'sectionId':_0x5d9d5d['id']},{})[_0xa55c('0x14')](function(){return _0x56d17c;});}else{return _0x56d17c;}})[_0xa55c('0x2c')](function(_0x5d834d){logger[_0xa55c('0x20')](_0xa55c('0x41'),_0x5d834d);throw _0x5d834d;});}return _0x56d17c;})[_0xa55c('0x14')](respondWithResult(_0x3b3308,0xc9))['catch'](handleError(_0x3b3308,null));};exports[_0xa55c('0x42')]=function(_0x582901,_0x2f9717){var _0x3a8af4={'where':{'id':_0x582901['params']['id']}},_0x451269={};_0x451269[_0xa55c('0x2e')]=_[_0xa55c('0x2f')](db['VoiceQueue'][_0xa55c('0x30')]);_0x3a8af4[_0xa55c('0x33')]=_['intersection'](_0x451269[_0xa55c('0x2e')],qs[_0xa55c('0x34')](_0x582901['query'][_0xa55c('0x34')]));_0x3a8af4[_0xa55c('0x33')]=_0x3a8af4[_0xa55c('0x33')][_0xa55c('0x35')]?_0x3a8af4['attributes']:_0x451269[_0xa55c('0x2e')];if(_0x582901['query'][_0xa55c('0x36')]){_0x3a8af4[_0xa55c('0x29')]=[{'all':!![]}];}_0x3a8af4=_[_0xa55c('0x43')]({},_0x3a8af4,_0x582901['options']);return db[_0xa55c('0x26')][_0xa55c('0x38')](_0x3a8af4)['then'](handleEntityNotFound(_0x2f9717,null))[_0xa55c('0x14')](function(_0x34de95){if(_0x34de95){var _0x3822b7=_0x34de95[_0xa55c('0x16')]({'plain':!![]});_0x3822b7=qs[_0xa55c('0x44')](_0x3822b7,['id',_0xa55c('0x45'),_0xa55c('0x46')]);_0x582901[_0xa55c('0x3a')]=_[_0xa55c('0x44')](_0x582901[_0xa55c('0x3a')],['id','createdAt',_0xa55c('0x46')]);return db[_0xa55c('0x26')][_0xa55c('0x39')](_['merge'](_0x3822b7,_0x582901[_0xa55c('0x3a')]),{'include':_0x582901[_0xa55c('0x2a')]['includeAll']?[{'all':!![]}]:undefined})[_0xa55c('0x14')](function(_0x4fa412){var _0x2b6a0e=_0x582901[_0xa55c('0x3b')][_0xa55c('0x16')]({'plain':!![]});if(!_0x2b6a0e)throw new Error(_0xa55c('0x3c'));if(_0x2b6a0e[_0xa55c('0x3d')]==='user'){var _0x44b7c1=_0x4fa412[_0xa55c('0x16')]({'plain':!![]});var _0x4b85cc=[{'name':_0xa55c('0x47'),'value':_0xa55c('0x17')},{'name':_0xa55c('0x18'),'value':_0xa55c('0x19')}];var _0x50176b=_['find'](_0x4b85cc,[_0xa55c('0x1c'),_0x44b7c1[_0xa55c('0x1e')]])[_0xa55c('0x22')];return db[_0xa55c('0x3e')]['find']({'where':{'name':_0x50176b,'userProfileId':_0x2b6a0e[_0xa55c('0x3f')]},'raw':!![]})['then'](function(_0x2742e4){if(_0x2742e4&&_0x2742e4[_0xa55c('0x40')]===0x0){return db[_0xa55c('0x48')][_0xa55c('0x39')]({'name':_0x44b7c1[_0xa55c('0x22')],'resourceId':_0x44b7c1['id'],'type':_0x2742e4['name'],'sectionId':_0x2742e4['id']},{})[_0xa55c('0x14')](function(){return _0x4fa412;});}else{return _0x4fa412;}})['catch'](function(_0x23f67f){logger[_0xa55c('0x20')](_0xa55c('0x41'),_0x23f67f);throw _0x23f67f;});}return _0x4fa412;});}})[_0xa55c('0x14')](respondWithResult(_0x2f9717,0xc9))[_0xa55c('0x2c')](handleError(_0x2f9717,null));};exports[_0xa55c('0x13')]=function(_0x5d14e0,_0x53e2be){if(_0x5d14e0[_0xa55c('0x3a')]['id']){delete _0x5d14e0[_0xa55c('0x3a')]['id'];}return db[_0xa55c('0x26')][_0xa55c('0x38')]({'where':{'id':_0x5d14e0[_0xa55c('0x2d')]['id']}})['then'](handleEntityNotFound(_0x53e2be,null))[_0xa55c('0x14')](saveUpdates(_0x5d14e0[_0xa55c('0x3a')],null))[_0xa55c('0x14')](respondWithResult(_0x53e2be,null))[_0xa55c('0x2c')](handleError(_0x53e2be,null));};exports[_0xa55c('0x15')]=function(_0x493f51,_0xdd92c1){return db[_0xa55c('0x26')][_0xa55c('0x38')]({'where':{'id':_0x493f51[_0xa55c('0x2d')]['id']}})[_0xa55c('0x14')](handleEntityNotFound(_0xdd92c1,null))['then'](removeEntity(_0xdd92c1,null))[_0xa55c('0x2c')](handleError(_0xdd92c1,null));};exports['getHoppers']=function(_0x2e482a,_0x5e3a28){var _0x3495a7={'raw':![],'where':{}};var _0x5a8897={};var _0x34edc5={'count':0x0,'rows':[]};return db[_0xa55c('0x26')][_0xa55c('0x49')]({'where':{'id':_0x2e482a[_0xa55c('0x2d')]['id']}})[_0xa55c('0x14')](handleEntityNotFound(_0x5e3a28,null))[_0xa55c('0x14')](function(_0xafaf8c){if(_0xafaf8c){_0x5a8897[_0xa55c('0x2e')]=_[_0xa55c('0x2f')](db[_0xa55c('0x4a')]['rawAttributes']);_0x5a8897[_0xa55c('0x2a')]=_[_0xa55c('0x2f')](_0x2e482a['query']);_0x5a8897[_0xa55c('0x31')]=_[_0xa55c('0x32')](_0x5a8897[_0xa55c('0x2e')],_0x5a8897[_0xa55c('0x2a')]);_0x3495a7[_0xa55c('0x33')]=_[_0xa55c('0x32')](_0x5a8897[_0xa55c('0x2e')],qs[_0xa55c('0x34')](_0x2e482a['query'][_0xa55c('0x34')]));_0x3495a7[_0xa55c('0x33')]=_0x3495a7[_0xa55c('0x33')][_0xa55c('0x35')]?_0x3495a7[_0xa55c('0x33')]:_0x5a8897[_0xa55c('0x2e')];if(!_0x2e482a[_0xa55c('0x2a')][_0xa55c('0x4b')](_0xa55c('0x4c'))){_0x3495a7['limit']=qs[_0xa55c('0x4d')](_0x2e482a[_0xa55c('0x2a')][_0xa55c('0x4d')]);_0x3495a7[_0xa55c('0x10')]=qs[_0xa55c('0x10')](_0x2e482a[_0xa55c('0x2a')][_0xa55c('0x10')]);}_0x3495a7[_0xa55c('0x4e')]=qs[_0xa55c('0x4f')](_0x2e482a[_0xa55c('0x2a')][_0xa55c('0x4f')]);_0x3495a7['where']=qs[_0xa55c('0x31')](_['pick'](_0x2e482a[_0xa55c('0x2a')],_0x5a8897[_0xa55c('0x31')]));_0x3495a7[_0xa55c('0x50')]['VoiceQueueId']=_0xafaf8c['id'];if(_0x2e482a['query'][_0xa55c('0x1a')]){_0x3495a7[_0xa55c('0x50')]=_[_0xa55c('0x43')](_0x3495a7[_0xa55c('0x50')],{'$or':_['map'](_0x3495a7[_0xa55c('0x33')],function(_0xd02251){var _0x8ea1c6={};_0x8ea1c6[_0xd02251]={'$like':'%'+_0x2e482a[_0xa55c('0x2a')][_0xa55c('0x1a')]+'%'};return _0x8ea1c6;})});}_0x3495a7=_['merge']({},_0x3495a7,_0x2e482a['options']);return db[_0xa55c('0x4a')][_0xa55c('0xf')]({'where':_0x3495a7[_0xa55c('0x50')]})[_0xa55c('0x14')](function(_0x1af9d5){_0x34edc5['count']=_0x1af9d5;if(_0x2e482a[_0xa55c('0x2a')][_0xa55c('0x36')]){_0x3495a7['include']=[{'all':!![]}];}return db[_0xa55c('0x4a')][_0xa55c('0x2b')](_0x3495a7);})[_0xa55c('0x14')](function(_0x4dcb93){_0x34edc5[_0xa55c('0x51')]=_0x4dcb93;return _0x34edc5;});}})[_0xa55c('0x14')](respondWithFilteredResult(_0x5e3a28,_0x3495a7))[_0xa55c('0x2c')](handleError(_0x5e3a28,null));};exports[_0xa55c('0x52')]=function(_0x232143,_0x506f74){var _0x25bd5b={'raw':!![],'where':{}};var _0x2e2cf6={};var _0x4bf233={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xa55c('0x49')]({'where':{'id':_0x232143['params']['id']}})[_0xa55c('0x14')](handleEntityNotFound(_0x506f74,null))[_0xa55c('0x14')](function(_0x2f13db){if(_0x2f13db){_0x2e2cf6[_0xa55c('0x2e')]=_[_0xa55c('0x2f')](db[_0xa55c('0x53')][_0xa55c('0x30')]);_0x2e2cf6[_0xa55c('0x2a')]=_[_0xa55c('0x2f')](_0x232143['query']);_0x2e2cf6[_0xa55c('0x31')]=_[_0xa55c('0x32')](_0x2e2cf6[_0xa55c('0x2e')],_0x2e2cf6[_0xa55c('0x2a')]);_0x25bd5b['attributes']=_[_0xa55c('0x32')](_0x2e2cf6[_0xa55c('0x2e')],qs[_0xa55c('0x34')](_0x232143[_0xa55c('0x2a')]['fields']));_0x25bd5b['attributes']=_0x25bd5b[_0xa55c('0x33')][_0xa55c('0x35')]?_0x25bd5b[_0xa55c('0x33')]:_0x2e2cf6[_0xa55c('0x2e')];if(!_0x232143['query']['hasOwnProperty'](_0xa55c('0x4c'))){_0x25bd5b[_0xa55c('0x4d')]=qs[_0xa55c('0x4d')](_0x232143[_0xa55c('0x2a')][_0xa55c('0x4d')]);_0x25bd5b[_0xa55c('0x10')]=qs[_0xa55c('0x10')](_0x232143['query'][_0xa55c('0x10')]);}_0x25bd5b['order']=qs[_0xa55c('0x4f')](_0x232143['query'][_0xa55c('0x4f')]);_0x25bd5b[_0xa55c('0x50')]=qs[_0xa55c('0x31')](_[_0xa55c('0x54')](_0x232143[_0xa55c('0x2a')],_0x2e2cf6[_0xa55c('0x31')]));_0x25bd5b[_0xa55c('0x50')][_0xa55c('0x55')]=_0x2f13db['id'];if(_0x232143['query']['filter']){_0x25bd5b[_0xa55c('0x50')]=_[_0xa55c('0x43')](_0x25bd5b[_0xa55c('0x50')],{'$or':_[_0xa55c('0x25')](_0x25bd5b[_0xa55c('0x33')],function(_0x137728){var _0x47e8e2={};_0x47e8e2[_0x137728]={'$like':'%'+_0x232143[_0xa55c('0x2a')][_0xa55c('0x1a')]+'%'};return _0x47e8e2;})});}_0x25bd5b=_[_0xa55c('0x43')]({},_0x25bd5b,_0x232143[_0xa55c('0x37')]);return db[_0xa55c('0x53')][_0xa55c('0xf')]({'where':_0x25bd5b[_0xa55c('0x50')]})[_0xa55c('0x14')](function(_0x58b670){_0x4bf233[_0xa55c('0xf')]=_0x58b670;if(_0x232143[_0xa55c('0x2a')][_0xa55c('0x36')]){_0x25bd5b[_0xa55c('0x29')]=[{'all':!![]}];}return db[_0xa55c('0x53')]['findAll'](_0x25bd5b);})[_0xa55c('0x14')](function(_0x2ab1f2){_0x4bf233['rows']=_0x2ab1f2;return _0x4bf233;});}})['then'](respondWithFilteredResult(_0x506f74,_0x25bd5b))[_0xa55c('0x2c')](handleError(_0x506f74,null));};exports[_0xa55c('0x56')]=function(_0x5c2229,_0x559e71){var _0x579726={'raw':!![],'where':{}};var _0x5ab79e={};var _0xf8e295={'count':0x0,'rows':[]};return db[_0xa55c('0x26')][_0xa55c('0x49')]({'where':{'id':_0x5c2229[_0xa55c('0x2d')]['id']}})[_0xa55c('0x14')](handleEntityNotFound(_0x559e71,null))[_0xa55c('0x14')](function(_0x568a5b){if(_0x568a5b){_0x5ab79e[_0xa55c('0x2e')]=_[_0xa55c('0x2f')](db[_0xa55c('0x57')][_0xa55c('0x30')]);_0x5ab79e['query']=_[_0xa55c('0x2f')](_0x5c2229[_0xa55c('0x2a')]);_0x5ab79e[_0xa55c('0x31')]=_['intersection'](_0x5ab79e[_0xa55c('0x2e')],_0x5ab79e['query']);_0x579726['attributes']=_[_0xa55c('0x32')](_0x5ab79e[_0xa55c('0x2e')],qs[_0xa55c('0x34')](_0x5c2229[_0xa55c('0x2a')][_0xa55c('0x34')]));_0x579726[_0xa55c('0x33')]=_0x579726[_0xa55c('0x33')]['length']?_0x579726['attributes']:_0x5ab79e[_0xa55c('0x2e')];if(!_0x5c2229[_0xa55c('0x2a')][_0xa55c('0x4b')](_0xa55c('0x4c'))){_0x579726[_0xa55c('0x4d')]=qs[_0xa55c('0x4d')](_0x5c2229[_0xa55c('0x2a')][_0xa55c('0x4d')]);_0x579726[_0xa55c('0x10')]=qs[_0xa55c('0x10')](_0x5c2229['query'][_0xa55c('0x10')]);}_0x579726[_0xa55c('0x4e')]=qs['sort'](_0x5c2229[_0xa55c('0x2a')]['sort']);_0x579726[_0xa55c('0x50')]=qs[_0xa55c('0x31')](_[_0xa55c('0x54')](_0x5c2229[_0xa55c('0x2a')],_0x5ab79e[_0xa55c('0x31')]));_0x579726['where'][_0xa55c('0x55')]=_0x568a5b['id'];if(_0x5c2229[_0xa55c('0x2a')][_0xa55c('0x1a')]){_0x579726[_0xa55c('0x50')]=_[_0xa55c('0x43')](_0x579726[_0xa55c('0x50')],{'$or':_[_0xa55c('0x25')](_0x579726['attributes'],function(_0x49a307){var _0x5c08e5={};_0x5c08e5[_0x49a307]={'$like':'%'+_0x5c2229[_0xa55c('0x2a')]['filter']+'%'};return _0x5c08e5;})});}_0x579726=_[_0xa55c('0x43')]({},_0x579726,_0x5c2229[_0xa55c('0x37')]);return db[_0xa55c('0x57')][_0xa55c('0xf')]({'where':_0x579726[_0xa55c('0x50')]})['then'](function(_0x253d7a){_0xf8e295['count']=_0x253d7a;if(_0x5c2229[_0xa55c('0x2a')][_0xa55c('0x36')]){_0x579726[_0xa55c('0x29')]=[{'all':!![]}];}return db[_0xa55c('0x57')]['findAll'](_0x579726);})[_0xa55c('0x14')](function(_0x46f8ab){_0xf8e295[_0xa55c('0x51')]=_0x46f8ab;return _0xf8e295;});}})[_0xa55c('0x14')](respondWithFilteredResult(_0x559e71,_0x579726))[_0xa55c('0x2c')](handleError(_0x559e71,null));};exports[_0xa55c('0x58')]=function(_0x270bd0,_0x472c73){var _0x5bae40={'raw':!![],'where':{}};var _0x147962={};var _0x1538dc={'count':0x0,'rows':[]};return db[_0xa55c('0x26')][_0xa55c('0x49')]({'where':{'id':_0x270bd0[_0xa55c('0x2d')]['id']}})[_0xa55c('0x14')](handleEntityNotFound(_0x472c73,null))['then'](function(_0x46124b){if(_0x46124b){_0x147962['model']=_[_0xa55c('0x2f')](db['CmHopperBlack'][_0xa55c('0x30')]);_0x147962[_0xa55c('0x2a')]=_[_0xa55c('0x2f')](_0x270bd0['query']);_0x147962[_0xa55c('0x31')]=_[_0xa55c('0x32')](_0x147962[_0xa55c('0x2e')],_0x147962['query']);_0x5bae40[_0xa55c('0x33')]=_['intersection'](_0x147962[_0xa55c('0x2e')],qs[_0xa55c('0x34')](_0x270bd0['query'][_0xa55c('0x34')]));_0x5bae40['attributes']=_0x5bae40[_0xa55c('0x33')][_0xa55c('0x35')]?_0x5bae40['attributes']:_0x147962[_0xa55c('0x2e')];if(!_0x270bd0[_0xa55c('0x2a')]['hasOwnProperty'](_0xa55c('0x4c'))){_0x5bae40[_0xa55c('0x4d')]=qs['limit'](_0x270bd0[_0xa55c('0x2a')]['limit']);_0x5bae40['offset']=qs[_0xa55c('0x10')](_0x270bd0[_0xa55c('0x2a')][_0xa55c('0x10')]);}_0x5bae40[_0xa55c('0x4e')]=qs['sort'](_0x270bd0[_0xa55c('0x2a')]['sort']);_0x5bae40[_0xa55c('0x50')]=qs['filters'](_['pick'](_0x270bd0['query'],_0x147962[_0xa55c('0x31')]));_0x5bae40['where']['VoiceQueueId']=_0x46124b['id'];if(_0x270bd0[_0xa55c('0x2a')][_0xa55c('0x1a')]){_0x5bae40[_0xa55c('0x50')]=_[_0xa55c('0x43')](_0x5bae40[_0xa55c('0x50')],{'$or':_[_0xa55c('0x25')](_0x5bae40[_0xa55c('0x33')],function(_0x9225d9){var _0x465801={};_0x465801[_0x9225d9]={'$like':'%'+_0x270bd0[_0xa55c('0x2a')][_0xa55c('0x1a')]+'%'};return _0x465801;})});}_0x5bae40=_[_0xa55c('0x43')]({},_0x5bae40,_0x270bd0[_0xa55c('0x37')]);return db['CmHopperBlack'][_0xa55c('0xf')]({'where':_0x5bae40['where']})['then'](function(_0x5c8003){_0x1538dc[_0xa55c('0xf')]=_0x5c8003;if(_0x270bd0['query'][_0xa55c('0x36')]){_0x5bae40['include']=[{'all':!![]}];}return db[_0xa55c('0x59')]['findAll'](_0x5bae40);})['then'](function(_0xfb1954){_0x1538dc['rows']=_0xfb1954;return _0x1538dc;});}})['then'](respondWithFilteredResult(_0x472c73,_0x5bae40))[_0xa55c('0x2c')](handleError(_0x472c73,null));};exports[_0xa55c('0x5a')]=function(_0x4ba496,_0x11349d){var _0x55caeb={};var _0x294e54={};var _0x403dff;var _0x1dcd8a;return db['VoiceQueue']['findOne']({'where':{'id':_0x4ba496[_0xa55c('0x2d')]['id']}})[_0xa55c('0x14')](handleEntityNotFound(_0x11349d,null))[_0xa55c('0x14')](function(_0xfda07f){if(_0xfda07f){_0x403dff=_0xfda07f;_0x294e54[_0xa55c('0x2e')]=_[_0xa55c('0x2f')](db[_0xa55c('0x5b')][_0xa55c('0x30')]);_0x294e54['query']=_[_0xa55c('0x2f')](_0x4ba496[_0xa55c('0x2a')]);_0x294e54[_0xa55c('0x31')]=_[_0xa55c('0x32')](_0x294e54[_0xa55c('0x2e')],_0x294e54[_0xa55c('0x2a')]);_0x55caeb[_0xa55c('0x33')]=_[_0xa55c('0x32')](_0x294e54[_0xa55c('0x2e')],qs['fields'](_0x4ba496[_0xa55c('0x2a')][_0xa55c('0x34')]));_0x55caeb[_0xa55c('0x33')]=_0x55caeb['attributes']['length']?_0x55caeb['attributes']:_0x294e54[_0xa55c('0x2e')];_0x55caeb['order']=qs[_0xa55c('0x4f')](_0x4ba496[_0xa55c('0x2a')][_0xa55c('0x4f')]);_0x55caeb[_0xa55c('0x50')]=qs[_0xa55c('0x31')](_[_0xa55c('0x54')](_0x4ba496[_0xa55c('0x2a')],_0x294e54[_0xa55c('0x31')]));if(_0x4ba496[_0xa55c('0x2a')][_0xa55c('0x1a')]){_0x55caeb[_0xa55c('0x50')]=_[_0xa55c('0x43')](_0x55caeb[_0xa55c('0x50')],{'$or':_[_0xa55c('0x25')](_0x55caeb[_0xa55c('0x33')],function(_0x1c7aec){var _0xf0bcac={};_0xf0bcac[_0x1c7aec]={'$like':'%'+_0x4ba496[_0xa55c('0x2a')][_0xa55c('0x1a')]+'%'};return _0xf0bcac;})});}_0x55caeb=_[_0xa55c('0x43')]({},_0x55caeb,_0x4ba496[_0xa55c('0x37')]);return _0x403dff[_0xa55c('0x5a')](_0x55caeb);}})[_0xa55c('0x14')](function(_0x168b3f){if(_0x168b3f){_0x1dcd8a=_0x168b3f['length'];if(!_0x4ba496[_0xa55c('0x2a')][_0xa55c('0x4b')]('nolimit')){_0x55caeb[_0xa55c('0x4d')]=qs[_0xa55c('0x4d')](_0x4ba496[_0xa55c('0x2a')][_0xa55c('0x4d')]);_0x55caeb[_0xa55c('0x10')]=qs['offset'](_0x4ba496[_0xa55c('0x2a')]['offset']);}return _0x403dff['getTeams'](_0x55caeb);}})[_0xa55c('0x14')](function(_0x1c9903){if(_0x1c9903){return _0x1c9903?{'count':_0x1dcd8a,'rows':_0x1c9903}:null;}})[_0xa55c('0x14')](respondWithResult(_0x11349d,null))[_0xa55c('0x2c')](handleError(_0x11349d,null));};exports[_0xa55c('0x5c')]=function(_0x23b513,_0x1e4464){var _0xd9f634=_0x23b513[_0xa55c('0x3a')][_0xa55c('0x5d')];var _0x1036b3=_[_0xa55c('0x25')](_0xd9f634,'id');return db[_0xa55c('0x5b')][_0xa55c('0x2b')]({'where':{'id':_0x1036b3},'attributes':['id'],'include':[{'model':db[_0xa55c('0x5e')],'as':_0xa55c('0x5f'),'attributes':['id',_0xa55c('0x22'),_0xa55c('0x60'),_0xa55c('0x61'),'interface'],'raw':!![]}]})['then'](function(_0x55a98d){if(_0x55a98d){var _0x200c28=_[_0xa55c('0x62')](_0x55a98d,function(_0x5e41b3){var _0x45b329=_0x5e41b3['get']({'plain':!![]});_0x45b329[_0xa55c('0x5f')]['forEach'](function(_0x3060f2){_0x3060f2[_0xa55c('0x63')]=_[_0xa55c('0x38')](_0xd9f634,{'id':_0x45b329['id']})[_0xa55c('0x63')];});return _0x45b329[_0xa55c('0x5f')];});return db[_0xa55c('0x26')][_0xa55c('0x38')]({'where':{'id':_0x23b513[_0xa55c('0x2d')]['id']}})[_0xa55c('0x14')](function(_0x665054){return db[_0xa55c('0x64')]['transaction'](function(_0x59f3a4){return _0x665054[_0xa55c('0x5c')](_0x1036b3,{'transaction':_0x59f3a4})['then'](function(){return BPromise[_0xa55c('0x65')](_0xd9f634,function(_0x5447a4){return db[_0xa55c('0x66')][_0xa55c('0x67')]({'TeamId':_0x5447a4['id'],'VoiceQueueId':_0x23b513[_0xa55c('0x2d')]['id'],'penalty':_0x5447a4['penalty']},{'transaction':_0x59f3a4});});})[_0xa55c('0x14')](function(){return BPromise[_0xa55c('0x65')](_0x200c28,function(_0x130c5f){return db['UserVoiceQueue'][_0xa55c('0x68')]({'where':{'UserId':_0x130c5f['id'],'VoiceQueueId':_0x23b513['params']['id']},'defaults':{'penalty':_0x130c5f[_0xa55c('0x63')]},'transaction':_0x59f3a4});});})['then'](function(){return BPromise['each'](_[_0xa55c('0x1a')](_0x200c28,{'online':!![]}),function(_0x40e121){return db[_0xa55c('0x69')]['upsert']({'membername':_0x40e121[_0xa55c('0x22')],'UserId':_0x40e121['id'],'queue_name':_0x665054[_0xa55c('0x22')],'VoiceQueueId':_0x665054['id'],'interface':_[_0xa55c('0x6a')](_0x40e121[_0xa55c('0x6b')])?util[_0xa55c('0x6c')](_0xa55c('0x6d'),_0x40e121[_0xa55c('0x22')]):_0x40e121[_0xa55c('0x6b')],'paused':_0x40e121['voicePause']||![],'penalty':_0x40e121[_0xa55c('0x63')]},{'transaction':_0x59f3a4});});})[_0xa55c('0x14')](function(){_0x200c28[_0xa55c('0x6e')](function(_0x151533){socket[_0xa55c('0x6f')](_0xa55c('0x70'),{'UserId':_0x151533['id'],'VoiceQueueId':_0x665054['id']});});});});});}})[_0xa55c('0x14')](respondWithStatusCode(_0x1e4464,null))[_0xa55c('0x2c')](handleError(_0x1e4464,null));};exports[_0xa55c('0x71')]=function(_0x261087,_0x2ef9dd){return db['Team'][_0xa55c('0x2b')]({'where':{'id':_0x261087['query']['ids']},'attributes':['id'],'include':[{'model':db[_0xa55c('0x5e')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xa55c('0x14')](handleEntityNotFound(_0x2ef9dd,null))['then'](function(_0x302284){var _0x231499=_[_0xa55c('0x25')](_0x302284,'id');var _0x2d3e42=[];var _0x97275b=[];var _0x5c7c60=squel[_0xa55c('0x72')]();_0x5c7c60['field'](_0xa55c('0x73'))['from']('team_has_voice_queues','tq')[_0xa55c('0x74')](_0xa55c('0x75'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xa55c('0x50')](_0xa55c('0x76'),_0x261087[_0xa55c('0x2d')]['id']);for(var _0x485652=0x0;_0x485652<_0x302284['length'];_0x485652+=0x1){let _0x57a1fc=_0x302284[_0x485652];for(var _0x50018c=0x0;_0x50018c<_0x57a1fc[_0xa55c('0x5f')][_0xa55c('0x35')];_0x50018c+=0x1){let _0x4c77c4=_0x57a1fc[_0xa55c('0x5f')][_0x50018c];var _0x1322a0=_0x5c7c60[_0xa55c('0x42')]();_0x1322a0['where'](_0xa55c('0x77'),_0x4c77c4['id']);_0x97275b['push'](db['sequelize']['query'](_0x1322a0[_0xa55c('0x78')](),{'type':db['sequelize'][_0xa55c('0x79')]['SELECT']})[_0xa55c('0x14')](function(_0x21e529){if(_0x21e529[_0xa55c('0x35')]===0x1){return _0x4c77c4['id'];}else{var _0x5063e7=_[_0xa55c('0x7a')](_[_0xa55c('0x25')](_0x21e529,_0xa55c('0x7b')),function(_0x16401f){return _[_0xa55c('0x1d')](_0x231499,_0x16401f);});if(_0x5063e7){return _0x4c77c4['id'];}}}));}}return BPromise[_0xa55c('0x7c')](_0x97275b)[_0xa55c('0x14')](function(_0x34d755){_0x2d3e42=_(_0x2d3e42)[_0xa55c('0x7d')](_0x34d755)['compact']()[_0xa55c('0x1c')]();return db[_0xa55c('0x26')][_0xa55c('0x38')]({'where':{'id':_0x261087[_0xa55c('0x2d')]['id']}})[_0xa55c('0x14')](function(_0x2c0b71){return db['sequelize'][_0xa55c('0x7e')](function(_0x5bae58){return _0x2c0b71[_0xa55c('0x71')](_0x261087[_0xa55c('0x2a')]['ids'],{'transaction':_0x5bae58})[_0xa55c('0x14')](function(){if(!_[_0xa55c('0x7f')](_0x2d3e42)){return _0x2c0b71['removeAgents'](_0x2d3e42,{'transaction':_0x5bae58})['then'](function(){return db[_0xa55c('0x69')][_0xa55c('0x15')]({'where':{'VoiceQueueId':_0x261087[_0xa55c('0x2d')]['id'],'UserId':_0x2d3e42},'transaction':_0x5bae58});});}})[_0xa55c('0x14')](function(){_0x2d3e42[_0xa55c('0x6e')](function(_0x1a335b){socket[_0xa55c('0x6f')](_0xa55c('0x80'),{'UserId':_0x1a335b,'VoiceQueueId':_0x2c0b71['id']});});});});});});})['then'](respondWithStatusCode(_0x2ef9dd,null))[_0xa55c('0x2c')](handleError(_0x2ef9dd,null));};exports[_0xa55c('0x81')]=function(_0xc8cd97,_0x21a206){var _0x29469d,_0x59a69d;return db[_0xa55c('0x26')]['find']({'where':{'id':_0xc8cd97['params']['id']}})[_0xa55c('0x14')](handleEntityNotFound(_0x21a206,null))[_0xa55c('0x14')](function(_0x6fcc){if(_0x6fcc){_0x59a69d=_0x6fcc;return _0x6fcc[_0xa55c('0x81')](_0xc8cd97['body'][_0xa55c('0x82')],_[_0xa55c('0x44')](_0xc8cd97[_0xa55c('0x3a')],[_0xa55c('0x82'),'id'])||{})[_0xa55c('0x83')](function(_0x4295c1){for(var _0x37f242=0x0;_0x37f242<_0xc8cd97[_0xa55c('0x3a')]['ids'][_0xa55c('0x35')];_0x37f242+=0x1){socket[_0xa55c('0x6f')](_0xa55c('0x70'),{'UserId':Number(_0xc8cd97[_0xa55c('0x3a')]['ids'][_0x37f242]),'VoiceQueueId':Number(_0xc8cd97[_0xa55c('0x2d')]['id'])});}return _0x4295c1;});}})[_0xa55c('0x14')](function(_0x65c752){_0x29469d=_0x65c752||[];if(_0x59a69d){return db['User'][_0xa55c('0x2b')]({'where':{'id':_0xc8cd97[_0xa55c('0x3a')][_0xa55c('0x82')]},'attributes':['id',_0xa55c('0x22'),_0xa55c('0x60'),_0xa55c('0x61'),_0xa55c('0x6b')],'raw':!![]});}})['then'](function(_0xcd4f3a){if(!_[_0xa55c('0x7f')](_0xcd4f3a)){var _0x496e8c=[];for(var _0x1c930b=0x0;_0x1c930b<_0xcd4f3a[_0xa55c('0x35')];_0x1c930b++){if(_0xcd4f3a[_0x1c930b][_0xa55c('0x60')]){_0x496e8c['push'](db['UserVoiceQueueRt']['upsert']({'membername':_0xcd4f3a[_0x1c930b][_0xa55c('0x22')],'UserId':_0xcd4f3a[_0x1c930b]['id'],'queue_name':_0x59a69d[_0xa55c('0x22')],'VoiceQueueId':_0x59a69d['id'],'interface':_['isNil'](_0xcd4f3a[_0x1c930b]['interface'])?util[_0xa55c('0x6c')](_0xa55c('0x6d'),_0xcd4f3a[_0x1c930b]['name']):_0xcd4f3a[_0x1c930b]['interface'],'paused':_0xcd4f3a[_0x1c930b][_0xa55c('0x61')]||![],'penalty':_0xc8cd97[_0xa55c('0x3a')][_0xa55c('0x63')]||0x0}));}}return BPromise['all'](_0x496e8c);}})['then'](function(){return _0x29469d;})[_0xa55c('0x14')](respondWithResult(_0x21a206,null))['catch'](handleError(_0x21a206,null));};exports[_0xa55c('0x84')]=function(_0xe0a356,_0x5a4e69){return db[_0xa55c('0x26')]['find']({'where':{'id':_0xe0a356['params']['id']}})['then'](handleEntityNotFound(_0x5a4e69,null))['then'](function(_0x527669){if(_0x527669){return _0x527669[_0xa55c('0x84')](_0xe0a356['query'][_0xa55c('0x82')])[_0xa55c('0x14')](function(){if(_[_0xa55c('0x85')](_0xe0a356['query'][_0xa55c('0x82')])){for(var _0x111ff8=0x0;_0x111ff8<_0xe0a356[_0xa55c('0x2a')][_0xa55c('0x82')][_0xa55c('0x35')];_0x111ff8+=0x1){socket[_0xa55c('0x6f')](_0xa55c('0x80'),{'UserId':Number(_0xe0a356[_0xa55c('0x2a')][_0xa55c('0x82')][_0x111ff8]),'VoiceQueueId':Number(_0xe0a356[_0xa55c('0x2d')]['id'])});}}else{socket['emit'](_0xa55c('0x80'),{'UserId':Number(_0xe0a356[_0xa55c('0x2a')]['ids']),'VoiceQueueId':Number(_0xe0a356[_0xa55c('0x2d')]['id'])});}});}})[_0xa55c('0x14')](function(_0x940871){return db[_0xa55c('0x69')][_0xa55c('0x15')]({'where':{'VoiceQueueId':_0xe0a356[_0xa55c('0x2d')]['id'],'UserId':_0xe0a356[_0xa55c('0x2a')][_0xa55c('0x82')]}})[_0xa55c('0x14')](function(){return _0x940871;});})[_0xa55c('0x14')](respondWithStatusCode(_0x5a4e69,null))[_0xa55c('0x2c')](handleError(_0x5a4e69,null));};exports[_0xa55c('0x86')]=function(_0x262d72,_0x228d12){var _0x16e229={};var _0x5c8713={};var _0x2d03b2;var _0x4b2e75;return db[_0xa55c('0x26')][_0xa55c('0x49')]({'where':{'id':_0x262d72[_0xa55c('0x2d')]['id']}})[_0xa55c('0x14')](handleEntityNotFound(_0x228d12,null))['then'](function(_0x537011){if(_0x537011){_0x2d03b2=_0x537011;_0x5c8713[_0xa55c('0x2e')]=_[_0xa55c('0x2f')](db['User'][_0xa55c('0x30')]);_0x5c8713[_0xa55c('0x2a')]=_[_0xa55c('0x2f')](_0x262d72['query']);_0x5c8713[_0xa55c('0x31')]=_[_0xa55c('0x32')](_0x5c8713[_0xa55c('0x2e')],_0x5c8713['query']);_0x16e229[_0xa55c('0x33')]=_['intersection'](_0x5c8713[_0xa55c('0x2e')],qs[_0xa55c('0x34')](_0x262d72[_0xa55c('0x2a')][_0xa55c('0x34')]));_0x16e229[_0xa55c('0x33')]=_0x16e229['attributes'][_0xa55c('0x35')]?_0x16e229[_0xa55c('0x33')]:_0x5c8713[_0xa55c('0x2e')];_0x16e229['order']=qs[_0xa55c('0x4f')](_0x262d72[_0xa55c('0x2a')][_0xa55c('0x4f')]);_0x16e229['where']=qs[_0xa55c('0x31')](_[_0xa55c('0x54')](_0x262d72[_0xa55c('0x2a')],_0x5c8713[_0xa55c('0x31')]));if(_0x262d72[_0xa55c('0x2a')][_0xa55c('0x1a')]){_0x16e229[_0xa55c('0x50')]=_['merge'](_0x16e229[_0xa55c('0x50')],{'$or':_[_0xa55c('0x25')](_0x16e229[_0xa55c('0x33')],function(_0x100ccb){var _0x531e60={};_0x531e60[_0x100ccb]={'$like':'%'+_0x262d72[_0xa55c('0x2a')][_0xa55c('0x1a')]+'%'};return _0x531e60;})});}_0x16e229=_[_0xa55c('0x43')]({},_0x16e229,_0x262d72[_0xa55c('0x37')]);return _0x2d03b2[_0xa55c('0x86')](_0x16e229);}})[_0xa55c('0x14')](function(_0x243cf3){if(_0x243cf3){_0x4b2e75=_0x243cf3['length'];if(!_0x262d72[_0xa55c('0x2a')][_0xa55c('0x4b')](_0xa55c('0x4c'))){_0x16e229[_0xa55c('0x4d')]=qs[_0xa55c('0x4d')](_0x262d72['query']['limit']);_0x16e229['offset']=qs[_0xa55c('0x10')](_0x262d72[_0xa55c('0x2a')][_0xa55c('0x10')]);}return _0x2d03b2[_0xa55c('0x86')](_0x16e229);}})[_0xa55c('0x14')](function(_0xb22076){if(_0xb22076){return _0xb22076?{'count':_0x4b2e75,'rows':_0xb22076}:null;}})[_0xa55c('0x14')](respondWithResult(_0x228d12,null))[_0xa55c('0x2c')](handleError(_0x228d12,null));};exports['getMembers']=function(_0x35c42c,_0x3b2174){var _0x35375e={};var _0x19a5f1={};var _0x3e7cfa;var _0xd511c0;return db['VoiceQueue'][_0xa55c('0x49')]({'where':{'id':_0x35c42c['params']['id']}})['then'](handleEntityNotFound(_0x3b2174,null))['then'](function(_0x58831d){if(_0x58831d){_0x3e7cfa=_0x58831d;_0x19a5f1[_0xa55c('0x2e')]=_[_0xa55c('0x2f')](db[_0xa55c('0x69')][_0xa55c('0x30')]);_0x19a5f1[_0xa55c('0x2a')]=_[_0xa55c('0x2f')](_0x35c42c[_0xa55c('0x2a')]);_0x19a5f1[_0xa55c('0x31')]=_[_0xa55c('0x32')](_0x19a5f1[_0xa55c('0x2e')],_0x19a5f1[_0xa55c('0x2a')]);_0x35375e['attributes']=_['intersection'](_0x19a5f1[_0xa55c('0x2e')],qs['fields'](_0x35c42c[_0xa55c('0x2a')][_0xa55c('0x34')]));_0x35375e[_0xa55c('0x33')]=_0x35375e[_0xa55c('0x33')][_0xa55c('0x35')]?_0x35375e[_0xa55c('0x33')]:_0x19a5f1[_0xa55c('0x2e')];_0x35375e[_0xa55c('0x4e')]=qs[_0xa55c('0x4f')](_0x35c42c['query'][_0xa55c('0x4f')]);_0x35375e[_0xa55c('0x50')]=qs['filters'](_['pick'](_0x35c42c[_0xa55c('0x2a')],_0x19a5f1[_0xa55c('0x31')]));if(_0x35c42c[_0xa55c('0x2a')]['filter']){_0x35375e[_0xa55c('0x50')]=_[_0xa55c('0x43')](_0x35375e[_0xa55c('0x50')],{'$or':_[_0xa55c('0x25')](_0x35375e['attributes'],function(_0x55459c){var _0x33d58c={};_0x33d58c[_0x55459c]={'$like':'%'+_0x35c42c['query']['filter']+'%'};return _0x33d58c;})});}_0x35375e=_[_0xa55c('0x43')]({},_0x35375e,_0x35c42c[_0xa55c('0x37')]);return _0x3e7cfa[_0xa55c('0x87')](_0x35375e);}})[_0xa55c('0x14')](function(_0x5184ea){if(_0x5184ea){_0xd511c0=_0x5184ea[_0xa55c('0x35')];if(!_0x35c42c[_0xa55c('0x2a')][_0xa55c('0x4b')](_0xa55c('0x4c'))){_0x35375e[_0xa55c('0x4d')]=qs['limit'](_0x35c42c[_0xa55c('0x2a')][_0xa55c('0x4d')]);_0x35375e[_0xa55c('0x10')]=qs[_0xa55c('0x10')](_0x35c42c[_0xa55c('0x2a')][_0xa55c('0x10')]);}return _0x3e7cfa[_0xa55c('0x87')](_0x35375e);}})['then'](function(_0x2d5e0e){return _0x2d5e0e?{'count':_0xd511c0,'rows':_0x2d5e0e}:null;})['then'](respondWithResult(_0x3b2174,null))[_0xa55c('0x2c')](handleError(_0x3b2174,null));};exports[_0xa55c('0x88')]=function(_0x3755a7,_0x50663f){var _0x50b42f={};var _0x307b39={};var _0x1319c6;var _0x536e1d;return db['VoiceQueue'][_0xa55c('0x49')]({'where':{'id':_0x3755a7[_0xa55c('0x2d')]['id']}})['then'](handleEntityNotFound(_0x50663f,null))[_0xa55c('0x14')](function(_0x568a42){if(_0x568a42){_0x1319c6=_0x568a42;_0x307b39[_0xa55c('0x2e')]=_[_0xa55c('0x2f')](db[_0xa55c('0x89')][_0xa55c('0x30')]);_0x307b39['query']=_[_0xa55c('0x2f')](_0x3755a7[_0xa55c('0x2a')]);_0x307b39[_0xa55c('0x31')]=_['intersection'](_0x307b39['model'],_0x307b39[_0xa55c('0x2a')]);_0x50b42f['attributes']=_['intersection'](_0x307b39[_0xa55c('0x2e')],qs[_0xa55c('0x34')](_0x3755a7[_0xa55c('0x2a')][_0xa55c('0x34')]));_0x50b42f[_0xa55c('0x33')]=_0x50b42f[_0xa55c('0x33')][_0xa55c('0x35')]?_0x50b42f[_0xa55c('0x33')]:_0x307b39[_0xa55c('0x2e')];_0x50b42f[_0xa55c('0x4e')]=qs['sort'](_0x3755a7['query'][_0xa55c('0x4f')]);_0x50b42f[_0xa55c('0x50')]=qs[_0xa55c('0x31')](_[_0xa55c('0x54')](_0x3755a7['query'],_0x307b39[_0xa55c('0x31')]));if(_0x3755a7[_0xa55c('0x2a')][_0xa55c('0x1a')]){_0x50b42f[_0xa55c('0x50')]=_['merge'](_0x50b42f[_0xa55c('0x50')],{'$or':_['map'](_0x50b42f['attributes'],function(_0x545806){var _0x4fbb59={};_0x4fbb59[_0x545806]={'$like':'%'+_0x3755a7[_0xa55c('0x2a')][_0xa55c('0x1a')]+'%'};return _0x4fbb59;})});}_0x50b42f=_['merge']({},_0x50b42f,_0x3755a7[_0xa55c('0x37')]);return _0x1319c6[_0xa55c('0x88')](_0x50b42f);}})[_0xa55c('0x14')](function(_0x3899bd){if(_0x3899bd){_0x536e1d=_0x3899bd[_0xa55c('0x35')];if(!_0x3755a7[_0xa55c('0x2a')]['hasOwnProperty'](_0xa55c('0x4c'))){_0x50b42f[_0xa55c('0x4d')]=qs[_0xa55c('0x4d')](_0x3755a7[_0xa55c('0x2a')]['limit']);_0x50b42f['offset']=qs['offset'](_0x3755a7[_0xa55c('0x2a')][_0xa55c('0x10')]);}return _0x1319c6[_0xa55c('0x88')](_0x50b42f);}})[_0xa55c('0x14')](function(_0x1205cb){if(_0x1205cb){return _0x1205cb?{'count':_0x536e1d,'rows':_0x1205cb}:null;}})[_0xa55c('0x14')](respondWithResult(_0x50663f,null))[_0xa55c('0x2c')](handleError(_0x50663f,null));};exports[_0xa55c('0x8a')]=function(_0x499008,_0x4ef239){var _0x3e3208=moment()[_0xa55c('0x6c')]('YYYY-MM-DD\x20HH:mm:ss');var _0x1e19d6,_0x286b33;return db['VoiceQueue']['find']({'where':{'id':_0x499008[_0xa55c('0x2d')]['id']}})[_0xa55c('0x14')](handleEntityNotFound(_0x4ef239,null))[_0xa55c('0x14')](function(_0x236015){if(_0x236015){_0x286b33=_0x236015;return _0x236015['addLists'](_0x499008['body'][_0xa55c('0x82')],_[_0xa55c('0x44')](_0x499008[_0xa55c('0x3a')],[_0xa55c('0x82'),'id'])||{});}return null;})[_0xa55c('0x83')](function(_0x18e4fd){var _0x185c5b;_0x1e19d6=_0x18e4fd||[];var _0x2511fe=[];if(_0x18e4fd){for(var _0x3ba948=0x0;_0x3ba948<_0x18e4fd[_0xa55c('0x35')];_0x3ba948+=0x1){var _0x5e83e9=_0x18e4fd[_0x3ba948][_0xa55c('0x16')]({'plain':!![]});_0x286b33['dialCheckDuplicateType']=_0x499008[_0xa55c('0x3a')][_0xa55c('0x8b')]?_0x499008[_0xa55c('0x3a')][_0xa55c('0x8b')]:_0x286b33[_0xa55c('0x8b')];switch(_0x286b33[_0xa55c('0x8b')]){case _0xa55c('0x8c'):_0x185c5b=squel[_0xa55c('0x8d')]()[_0xa55c('0x8e')](_0xa55c('0x8f'))[_0xa55c('0x90')]([_0xa55c('0x91'),_0xa55c('0x92'),'ContactId',_0xa55c('0x93'),_0xa55c('0x55'),'createdAt',_0xa55c('0x46')],squel[_0xa55c('0x72')]()[_0xa55c('0x94')]('phone',_0xa55c('0x91'))[_0xa55c('0x94')]('\x27'+_0x3e3208+'\x27','scheduledAt')[_0xa55c('0x94')]('id',_0xa55c('0x95'))['field'](_0x5e83e9[_0xa55c('0x96')]['toString'](),_0xa55c('0x93'))[_0xa55c('0x94')](_0x499008[_0xa55c('0x2d')]['id'][_0xa55c('0x78')](),_0xa55c('0x55'))[_0xa55c('0x94')]('\x27'+_0x3e3208+'\x27',_0xa55c('0x45'))[_0xa55c('0x94')]('\x27'+_0x3e3208+'\x27',_0xa55c('0x46'))[_0xa55c('0x97')](_0xa55c('0x98'))[_0xa55c('0x50')](_0xa55c('0x99'))[_0xa55c('0x50')](_0xa55c('0x9a'),_0x5e83e9[_0xa55c('0x96')]['toString']())[_0xa55c('0x50')]('phone\x20IS\x20NOT\x20NULL')[_0xa55c('0x50')](_0xa55c('0x9b'),squel[_0xa55c('0x72')]()['field'](_0xa55c('0x9c'))[_0xa55c('0x97')](_0xa55c('0x9d'))[_0xa55c('0x50')]('VoiceQueueId\x20=\x20?',_0x499008['params']['id'][_0xa55c('0x78')]()))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0xa55c('0x72')]()[_0xa55c('0x94')]('COALESCE(phone,\x27\x27)')['from']('cm_hopper')[_0xa55c('0x50')](_0xa55c('0x76'),_0x499008['params']['id'][_0xa55c('0x78')]())))[_0xa55c('0x78')]();break;case _0xa55c('0x9e'):_0x185c5b=squel[_0xa55c('0x8d')]()[_0xa55c('0x8e')](_0xa55c('0x8f'))[_0xa55c('0x90')]([_0xa55c('0x91'),_0xa55c('0x92'),_0xa55c('0x95'),_0xa55c('0x93'),_0xa55c('0x55'),'createdAt',_0xa55c('0x46')],squel[_0xa55c('0x72')]()[_0xa55c('0x94')](_0xa55c('0x91'),_0xa55c('0x91'))[_0xa55c('0x94')]('\x27'+_0x3e3208+'\x27',_0xa55c('0x92'))[_0xa55c('0x94')]('id',_0xa55c('0x95'))[_0xa55c('0x94')](_0x5e83e9['CmListId']['toString'](),_0xa55c('0x93'))[_0xa55c('0x94')](_0x499008[_0xa55c('0x2d')]['id'][_0xa55c('0x78')](),_0xa55c('0x55'))['field']('\x27'+_0x3e3208+'\x27',_0xa55c('0x45'))['field']('\x27'+_0x3e3208+'\x27','updatedAt')[_0xa55c('0x97')](_0xa55c('0x98'))[_0xa55c('0x50')](_0xa55c('0x99'))['where'](_0xa55c('0x9a'),_0x5e83e9[_0xa55c('0x96')][_0xa55c('0x78')]())[_0xa55c('0x50')]('phone\x20IS\x20NOT\x20NULL')[_0xa55c('0x50')](_0xa55c('0x9b'),squel[_0xa55c('0x72')]()[_0xa55c('0x94')](_0xa55c('0x9f'))[_0xa55c('0x97')](_0xa55c('0x8f'))[_0xa55c('0x50')](_0xa55c('0x76'),_0x499008[_0xa55c('0x2d')]['id']['toString']())))[_0xa55c('0x78')]();break;default:_0x185c5b=squel[_0xa55c('0x8d')]()[_0xa55c('0x8e')](_0xa55c('0x8f'))[_0xa55c('0x90')]([_0xa55c('0x91'),_0xa55c('0x92'),_0xa55c('0x95'),_0xa55c('0x93'),'VoiceQueueId',_0xa55c('0x45'),'updatedAt'],squel[_0xa55c('0x72')]()[_0xa55c('0x94')](_0xa55c('0x91'),_0xa55c('0x91'))[_0xa55c('0x94')]('\x27'+_0x3e3208+'\x27',_0xa55c('0x92'))[_0xa55c('0x94')]('id',_0xa55c('0x95'))[_0xa55c('0x94')](_0x5e83e9['CmListId']['toString'](),_0xa55c('0x93'))['field'](_0x499008[_0xa55c('0x2d')]['id'][_0xa55c('0x78')](),_0xa55c('0x55'))[_0xa55c('0x94')]('\x27'+_0x3e3208+'\x27','createdAt')[_0xa55c('0x94')]('\x27'+_0x3e3208+'\x27','updatedAt')[_0xa55c('0x97')](_0xa55c('0x98'))[_0xa55c('0x50')](_0xa55c('0x99'))[_0xa55c('0x50')](_0xa55c('0x9a'),_0x5e83e9[_0xa55c('0x96')][_0xa55c('0x78')]())[_0xa55c('0x50')]('phone\x20IS\x20NOT\x20NULL'))[_0xa55c('0x78')]();}_0x2511fe[_0xa55c('0xa0')](db[_0xa55c('0x64')]['query'](_0x185c5b));}return BPromise[_0xa55c('0x7c')](_0x2511fe);}})[_0xa55c('0x14')](function(){var _0x4457e9=[];var _0x456cb9=squel[_0xa55c('0x8d')]()[_0xa55c('0x8e')](_0xa55c('0xa1'))[_0xa55c('0x90')]([_0xa55c('0xa2'),_0xa55c('0x91'),'OrderBy',_0xa55c('0x45'),_0xa55c('0x46')],squel[_0xa55c('0x72')]()[_0xa55c('0x94')](_0xa55c('0xa3'))['field']('ci.item')['field']('ci.OrderBy+1')[_0xa55c('0x94')]('\x27'+_0x3e3208+'\x27','createdAt')[_0xa55c('0x94')]('\x27'+_0x3e3208+'\x27',_0xa55c('0x46'))[_0xa55c('0x97')](_0xa55c('0xa4'),'ci')[_0xa55c('0x74')](_0xa55c('0x8f'),'h',_0xa55c('0xa5'))[_0xa55c('0x50')](_0xa55c('0xa6'),_0x3e3208)[_0xa55c('0x50')](_0xa55c('0xa7'),'PHONE'))[_0xa55c('0x78')]();_0x4457e9[_0xa55c('0xa0')](db[_0xa55c('0x64')]['query'](_0x456cb9));return BPromise['all'](_0x4457e9);})['then'](function(){return _0x1e19d6;})[_0xa55c('0x14')](respondWithResult(_0x4ef239,null))[_0xa55c('0x2c')](handleError(_0x4ef239,null));};exports[_0xa55c('0xa8')]=function(_0x27cd1b,_0x3ed3a5){return db[_0xa55c('0x26')][_0xa55c('0x38')]({'where':{'id':_0x27cd1b[_0xa55c('0x2d')]['id']}})[_0xa55c('0x14')](handleEntityNotFound(_0x3ed3a5,null))[_0xa55c('0x14')](function(_0x3def57){if(_0x3def57){return _0x3def57[_0xa55c('0xa8')](_0x27cd1b[_0xa55c('0x2a')][_0xa55c('0x82')]);}})[_0xa55c('0x14')](function(_0x4f5f1a){if(_0x4f5f1a){return db[_0xa55c('0x4a')]['destroy']({'where':{'ListId':_0x27cd1b[_0xa55c('0x2a')][_0xa55c('0x82')],'VoiceQueueId':_0x27cd1b[_0xa55c('0x2d')]['id']}})['then'](function(){return _0x4f5f1a;});}})['then'](respondWithStatusCode(_0x3ed3a5,null))[_0xa55c('0x2c')](handleError(_0x3ed3a5,null));};exports[_0xa55c('0xa9')]=function(_0x30af02,_0x5ebd8a){var _0x2420da={};var _0x2a4b78={};var _0x1e4c2d;var _0x2bf777;return db[_0xa55c('0x26')][_0xa55c('0x49')]({'where':{'id':_0x30af02[_0xa55c('0x2d')]['id']}})['then'](handleEntityNotFound(_0x5ebd8a,null))[_0xa55c('0x14')](function(_0x266b12){if(_0x266b12){_0x1e4c2d=_0x266b12;_0x2a4b78[_0xa55c('0x2e')]=_['keys'](db[_0xa55c('0x89')]['rawAttributes']);_0x2a4b78[_0xa55c('0x2a')]=_[_0xa55c('0x2f')](_0x30af02['query']);_0x2a4b78[_0xa55c('0x31')]=_[_0xa55c('0x32')](_0x2a4b78[_0xa55c('0x2e')],_0x2a4b78['query']);_0x2420da[_0xa55c('0x33')]=_[_0xa55c('0x32')](_0x2a4b78['model'],qs['fields'](_0x30af02[_0xa55c('0x2a')][_0xa55c('0x34')]));_0x2420da[_0xa55c('0x33')]=_0x2420da[_0xa55c('0x33')][_0xa55c('0x35')]?_0x2420da['attributes']:_0x2a4b78[_0xa55c('0x2e')];_0x2420da['order']=qs['sort'](_0x30af02[_0xa55c('0x2a')][_0xa55c('0x4f')]);_0x2420da['where']=qs[_0xa55c('0x31')](_['pick'](_0x30af02[_0xa55c('0x2a')],_0x2a4b78[_0xa55c('0x31')]));if(_0x30af02['query'][_0xa55c('0x1a')]){_0x2420da[_0xa55c('0x50')]=_['merge'](_0x2420da[_0xa55c('0x50')],{'$or':_['map'](_0x2420da['attributes'],function(_0x37273b){var _0x1cd529={};_0x1cd529[_0x37273b]={'$like':'%'+_0x30af02[_0xa55c('0x2a')][_0xa55c('0x1a')]+'%'};return _0x1cd529;})});}_0x2420da=_[_0xa55c('0x43')]({},_0x2420da,_0x30af02[_0xa55c('0x37')]);return _0x1e4c2d[_0xa55c('0xa9')](_0x2420da);}})['then'](function(_0x27e791){if(_0x27e791){_0x2bf777=_0x27e791[_0xa55c('0x35')];if(!_0x30af02['query'][_0xa55c('0x4b')](_0xa55c('0x4c'))){_0x2420da['limit']=qs[_0xa55c('0x4d')](_0x30af02[_0xa55c('0x2a')][_0xa55c('0x4d')]);_0x2420da[_0xa55c('0x10')]=qs['offset'](_0x30af02[_0xa55c('0x2a')][_0xa55c('0x10')]);}return _0x1e4c2d[_0xa55c('0xa9')](_0x2420da);}})[_0xa55c('0x14')](function(_0x365331){if(_0x365331){return _0x365331?{'count':_0x2bf777,'rows':_0x365331}:null;}})[_0xa55c('0x14')](respondWithResult(_0x5ebd8a,null))['catch'](handleError(_0x5ebd8a,null));};exports[_0xa55c('0xaa')]=function(_0x4d7cd6,_0x1ca9bd){var _0x2bf932;return db['VoiceQueue']['find']({'where':{'id':_0x4d7cd6[_0xa55c('0x2d')]['id']}})[_0xa55c('0x14')](handleEntityNotFound(_0x1ca9bd,null))[_0xa55c('0x14')](function(_0x3c9d2b){if(_0x3c9d2b){return _0x3c9d2b[_0xa55c('0xaa')](_0x4d7cd6[_0xa55c('0x3a')][_0xa55c('0x82')],_['omit'](_0x4d7cd6[_0xa55c('0x3a')],[_0xa55c('0x82'),'id'])||{});}return null;})[_0xa55c('0x83')](function(_0x158b01){var _0x19f576;_0x2bf932=_0x158b01||[];var _0x10da4b=[];if(_0x158b01){for(var _0x3320ab=0x0;_0x3320ab<_0x158b01[_0xa55c('0x35')];_0x3320ab+=0x1){var _0x298cf5=_0x158b01[_0x3320ab][_0xa55c('0x16')]({'plain':!![]});_0x19f576=squel[_0xa55c('0x8d')]()[_0xa55c('0x8e')](_0xa55c('0xab'))['fromQuery']([_0xa55c('0x91'),'ContactId',_0xa55c('0x93'),_0xa55c('0x55'),'createdAt',_0xa55c('0x46')],squel[_0xa55c('0x72')]()[_0xa55c('0x94')](_0xa55c('0x91'),_0xa55c('0x91'))['field']('id',_0xa55c('0x95'))[_0xa55c('0x94')](_0x298cf5[_0xa55c('0x96')]['toString'](),'ListId')['field'](_0x4d7cd6[_0xa55c('0x2d')]['id'][_0xa55c('0x78')](),'VoiceQueueId')[_0xa55c('0x94')](_0xa55c('0xac'),_0xa55c('0x45'))[_0xa55c('0x94')](_0xa55c('0xac'),'updatedAt')[_0xa55c('0x97')](_0xa55c('0x98'))[_0xa55c('0x50')](_0xa55c('0x99'))[_0xa55c('0x50')]('ListId\x20=\x20?',_0x298cf5['CmListId'][_0xa55c('0x78')]())[_0xa55c('0x50')](_0xa55c('0xad')))['toString']();_0x10da4b[_0xa55c('0xa0')](db[_0xa55c('0x64')][_0xa55c('0x2a')](_0x19f576));}return BPromise[_0xa55c('0x7c')](_0x10da4b);}})[_0xa55c('0x14')](function(){return _0x2bf932;})[_0xa55c('0x14')](respondWithResult(_0x1ca9bd,null))[_0xa55c('0x2c')](handleError(_0x1ca9bd,null));};exports[_0xa55c('0xae')]=function(_0x23862a,_0xb432d1){return db['VoiceQueue'][_0xa55c('0x38')]({'where':{'id':_0x23862a[_0xa55c('0x2d')]['id']}})['then'](handleEntityNotFound(_0xb432d1,null))[_0xa55c('0x14')](function(_0x5bc270){if(_0x5bc270){return _0x5bc270[_0xa55c('0xae')](_0x23862a[_0xa55c('0x2a')][_0xa55c('0x82')]);}})[_0xa55c('0x14')](function(_0x543b4a){if(_0x543b4a){return db[_0xa55c('0x59')]['destroy']({'where':{'ListId':_0x23862a[_0xa55c('0x2a')][_0xa55c('0x82')],'VoiceQueueId':_0x23862a[_0xa55c('0x2d')]['id']}})[_0xa55c('0x14')](function(){return _0x543b4a;});}})[_0xa55c('0x14')](respondWithStatusCode(_0xb432d1,null))['catch'](handleError(_0xb432d1,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index e554f58..13138c8 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 _0x37a6=['emit','hasOwnProperty','exports','events','../../mysqldb','VoiceQueue','setMaxListeners','save','remove'];(function(_0x5254ea,_0x1af3fd){var _0x192890=function(_0x33bd22){while(--_0x33bd22){_0x5254ea['push'](_0x5254ea['shift']());}};_0x192890(++_0x1af3fd);}(_0x37a6,0x147));var _0x637a=function(_0x1b9996,_0x4cb75b){_0x1b9996=_0x1b9996-0x0;var _0x49ff1f=_0x37a6[_0x1b9996];return _0x49ff1f;};'use strict';var EventEmitter=require(_0x637a('0x0'));var VoiceQueue=require(_0x637a('0x1'))['db'][_0x637a('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x637a('0x3')](0x0);var events={'afterCreate':_0x637a('0x4'),'afterUpdate':'update','afterDestroy':_0x637a('0x5')};function emitEvent(_0xfc041d){return function(_0x3154ee,_0x41bf59,_0x4dc070){VoiceQueueEvents[_0x637a('0x6')](_0xfc041d+':'+_0x3154ee['id'],_0x3154ee);VoiceQueueEvents[_0x637a('0x6')](_0xfc041d,_0x3154ee);_0x4dc070(null);};}for(var e in events){if(events[_0x637a('0x7')](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module[_0x637a('0x8')]=VoiceQueueEvents; \ No newline at end of file +var _0x1f82=['exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x3fc21a,_0x2f8657){var _0x1bcc00=function(_0x1b6212){while(--_0x1b6212){_0x3fc21a['push'](_0x3fc21a['shift']());}};_0x1bcc00(++_0x2f8657);}(_0x1f82,0x12d));var _0x21f8=function(_0x5d2f39,_0x11e2f4){_0x5d2f39=_0x5d2f39-0x0;var _0x3df8f6=_0x1f82[_0x5d2f39];return _0x3df8f6;};'use strict';var EventEmitter=require(_0x21f8('0x0'));var VoiceQueue=require(_0x21f8('0x1'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x21f8('0x2')](0x0);var events={'afterCreate':_0x21f8('0x3'),'afterUpdate':_0x21f8('0x4'),'afterDestroy':_0x21f8('0x5')};function emitEvent(_0x4b88f5){return function(_0x501fdc,_0x430520,_0x42cef4){VoiceQueueEvents[_0x21f8('0x6')](_0x4b88f5+':'+_0x501fdc['id'],_0x501fdc);VoiceQueueEvents[_0x21f8('0x6')](_0x4b88f5,_0x501fdc);_0x42cef4(null);};}for(var e in events){if(events[_0x21f8('0x7')](e)){var event=events[e];VoiceQueue[_0x21f8('0x8')](e,emitEvent(event));}}module[_0x21f8('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 5d0532f..f490ffb 100644 --- a/server/api/voiceQueue/voiceQueue.model.js +++ b/server/api/voiceQueue/voiceQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x55ca=['./voiceQueue.attributes','exports','define','voice_queues','lodash','util','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x1f5143,_0x5e31e6){var _0x383a38=function(_0x2c123c){while(--_0x2c123c){_0x1f5143['push'](_0x1f5143['shift']());}};_0x383a38(++_0x5e31e6);}(_0x55ca,0x126));var _0xa55c=function(_0x24487f,_0x9b3ea0){_0x24487f=_0x24487f-0x0;var _0x456456=_0x55ca[_0x24487f];return _0x456456;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xa55c('0x2'));var rp=require(_0xa55c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var attributes=require(_0xa55c('0x6'));module[_0xa55c('0x7')]=function(_0x3c97c8,_0x279caa){return _0x3c97c8[_0xa55c('0x8')]('VoiceQueue',attributes,{'tableName':_0xa55c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x34e8=['voice_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueue.attributes','exports','VoiceQueue'];(function(_0x34dccc,_0x169ee1){var _0x41158d=function(_0x541ddc){while(--_0x541ddc){_0x34dccc['push'](_0x34dccc['shift']());}};_0x41158d(++_0x169ee1);}(_0x34e8,0x12c));var _0x834e=function(_0x565e8a,_0x5198b3){_0x565e8a=_0x565e8a-0x0;var _0x57063d=_0x34e8[_0x565e8a];return _0x57063d;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var logger=require(_0x834e('0x2'))(_0x834e('0x3'));var moment=require('moment');var BPromise=require(_0x834e('0x4'));var rp=require(_0x834e('0x5'));var fs=require('fs');var path=require(_0x834e('0x6'));var rimraf=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var attributes=require(_0x834e('0x9'));module[_0x834e('0xa')]=function(_0x4a2018,_0x858aa1){return _0x4a2018['define'](_0x834e('0xb'),attributes,{'tableName':_0x834e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index dc665c0..3cd37e1 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 _0x3f93=['find','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','./voiceQueue.socket','register','request','then','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','VoiceQueue','findAll','options','raw','where','limit','include','model','attributes','map','GetVoiceQueue','ShowVoiceQueue'];(function(_0x59b0f8,_0x52a8b4){var _0x171c4a=function(_0xd5dbf){while(--_0xd5dbf){_0x59b0f8['push'](_0x59b0f8['shift']());}};_0x171c4a(++_0x52a8b4);}(_0x3f93,0x19b));var _0x33f9=function(_0x4c0273,_0x3a03d5){_0x4c0273=_0x4c0273-0x0;var _0x4b7d2c=_0x3f93[_0x4c0273];return _0x4b7d2c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x33f9('0x0'));var BPromise=require(_0x33f9('0x1'));var rs=require(_0x33f9('0x2'));var fs=require('fs');var Redis=require(_0x33f9('0x3'));var db=require(_0x33f9('0x4'))['db'];var utils=require(_0x33f9('0x5'));var logger=require(_0x33f9('0x6'))(_0x33f9('0x7'));var config=require('../../config/environment');var jayson=require(_0x33f9('0x8'));var client=jayson[_0x33f9('0x9')][_0x33f9('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x33f9('0xb')],{'host':_0x33f9('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x33f9('0xd'))[_0x33f9('0xe')](socket);function respondWithRpcPromise(_0x3db106,_0x167699,_0x4df26a){return new BPromise(function(_0x4cce39,_0x4e87cb){return client[_0x33f9('0xf')](_0x3db106,_0x4df26a)[_0x33f9('0x10')](function(_0x36c1e3){logger['info'](_0x33f9('0x11'),_0x167699,_0x33f9('0x12'));logger[_0x33f9('0x13')](_0x33f9('0x14'),_0x167699,'request\x20sent',JSON[_0x33f9('0x15')](_0x36c1e3));if(_0x36c1e3['error']){if(_0x36c1e3[_0x33f9('0x16')][_0x33f9('0x17')]===0x1f4){logger['error'](_0x33f9('0x11'),_0x167699,_0x36c1e3['error'][_0x33f9('0x18')]);return _0x4e87cb(_0x36c1e3['error'][_0x33f9('0x18')]);}logger[_0x33f9('0x16')](_0x33f9('0x11'),_0x167699,_0x36c1e3[_0x33f9('0x16')]['message']);return _0x4cce39(_0x36c1e3[_0x33f9('0x16')][_0x33f9('0x18')]);}else{logger[_0x33f9('0x19')](_0x33f9('0x11'),_0x167699,_0x33f9('0x12'));_0x4cce39(_0x36c1e3[_0x33f9('0x1a')]['message']);}})[_0x33f9('0x1b')](function(_0x24b4ff){logger[_0x33f9('0x16')]('VoiceQueue,\x20%s,\x20%s',_0x167699,_0x24b4ff);_0x4e87cb(_0x24b4ff);});});}exports['GetVoiceQueue']=function(_0x4c57df){var _0x2df8c0=this;return new Promise(function(_0xf4d67e,_0x5f5b59){return db[_0x33f9('0x1c')][_0x33f9('0x1d')]({'raw':_0x4c57df[_0x33f9('0x1e')]?_0x4c57df['options'][_0x33f9('0x1f')]===undefined?!![]:![]:!![],'where':_0x4c57df[_0x33f9('0x1e')]?_0x4c57df[_0x33f9('0x1e')][_0x33f9('0x20')]||null:null,'attributes':_0x4c57df[_0x33f9('0x1e')]?_0x4c57df[_0x33f9('0x1e')]['attributes']||null:null,'limit':_0x4c57df[_0x33f9('0x1e')]?_0x4c57df['options'][_0x33f9('0x21')]||null:null,'include':_0x4c57df[_0x33f9('0x1e')]?_0x4c57df['options'][_0x33f9('0x22')]?_['map'](_0x4c57df['options'][_0x33f9('0x22')],function(_0x51ecab){return{'model':db[_0x51ecab[_0x33f9('0x23')]],'as':_0x51ecab['as'],'attributes':_0x51ecab[_0x33f9('0x24')],'include':_0x51ecab[_0x33f9('0x22')]?_[_0x33f9('0x25')](_0x51ecab[_0x33f9('0x22')],function(_0x47307e){return{'model':db[_0x47307e['model']],'as':_0x47307e['as'],'attributes':_0x47307e[_0x33f9('0x24')],'include':_0x47307e[_0x33f9('0x22')]?_['map'](_0x47307e['include'],function(_0x3a2edc){return{'model':db[_0x3a2edc[_0x33f9('0x23')]],'as':_0x3a2edc['as'],'attributes':_0x3a2edc['attributes']};}):[]};}):[]};}):[]:[]})[_0x33f9('0x10')](function(_0x5b2380){logger[_0x33f9('0x19')](_0x33f9('0x26'),_0x4c57df);logger[_0x33f9('0x13')](_0x33f9('0x26'),_0x4c57df,JSON[_0x33f9('0x15')](_0x5b2380));_0xf4d67e(_0x5b2380);})[_0x33f9('0x1b')](function(_0x591974){logger[_0x33f9('0x16')]('GetVoiceQueue',_0x591974[_0x33f9('0x18')],_0x4c57df);_0x5f5b59(_0x2df8c0['error'](0x1f4,_0x591974[_0x33f9('0x18')]));});});};exports[_0x33f9('0x27')]=function(_0x4d141d){var _0x10fdee=this;return new Promise(function(_0x4c5c42,_0x286f76){return db[_0x33f9('0x1c')][_0x33f9('0x28')]({'raw':_0x4d141d[_0x33f9('0x1e')]?_0x4d141d[_0x33f9('0x1e')][_0x33f9('0x1f')]===undefined?!![]:![]:!![],'where':_0x4d141d[_0x33f9('0x1e')]?_0x4d141d[_0x33f9('0x1e')]['where']||null:null,'attributes':_0x4d141d['options']?_0x4d141d[_0x33f9('0x1e')]['attributes']||null:null,'include':_0x4d141d[_0x33f9('0x1e')]?_0x4d141d[_0x33f9('0x1e')][_0x33f9('0x22')]?_[_0x33f9('0x25')](_0x4d141d['options'][_0x33f9('0x22')],function(_0x467c1d){return{'model':db[_0x467c1d['model']],'as':_0x467c1d['as'],'attributes':_0x467c1d[_0x33f9('0x24')],'include':_0x467c1d[_0x33f9('0x22')]?_[_0x33f9('0x25')](_0x467c1d[_0x33f9('0x22')],function(_0xca97a5){return{'model':db[_0xca97a5[_0x33f9('0x23')]],'as':_0xca97a5['as'],'attributes':_0xca97a5[_0x33f9('0x24')],'include':_0xca97a5[_0x33f9('0x22')]?_[_0x33f9('0x25')](_0xca97a5[_0x33f9('0x22')],function(_0x4a0c7d){return{'model':db[_0x4a0c7d['model']],'as':_0x4a0c7d['as'],'attributes':_0x4a0c7d[_0x33f9('0x24')]};}):[]};}):[]};}):[]:[]})[_0x33f9('0x10')](function(_0x20a327){logger['info'](_0x33f9('0x27'),_0x4d141d);logger['debug'](_0x33f9('0x27'),_0x4d141d,JSON[_0x33f9('0x15')](_0x20a327));_0x4c5c42(_0x20a327);})['catch'](function(_0x4b224f){logger[_0x33f9('0x16')](_0x33f9('0x27'),_0x4b224f['message'],_0x4d141d);_0x286f76(_0x10fdee[_0x33f9('0x16')](0x1f4,_0x4b224f[_0x33f9('0x18')]));});});}; \ No newline at end of file +var _0xda98=['register','request','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','VoiceQueue','findAll','options','raw','where','attributes','include','model','map','GetVoiceQueue','ShowVoiceQueue','find','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','./voiceQueue.socket'];(function(_0x3c485c,_0x308577){var _0xe47499=function(_0x297a31){while(--_0x297a31){_0x3c485c['push'](_0x3c485c['shift']());}};_0xe47499(++_0x308577);}(_0xda98,0xdc));var _0x8da9=function(_0x5cb367,_0x27ec9d){_0x5cb367=_0x5cb367-0x0;var _0x279365=_0xda98[_0x5cb367];return _0x279365;};'use strict';var _=require(_0x8da9('0x0'));var util=require('util');var moment=require(_0x8da9('0x1'));var BPromise=require(_0x8da9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8da9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x8da9('0x4'));var logger=require(_0x8da9('0x5'))(_0x8da9('0x6'));var config=require(_0x8da9('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x8da9('0x8')][_0x8da9('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0x8da9('0xa')],{'host':_0x8da9('0xb'),'port':0x18eb});var socket=require(_0x8da9('0xc'))(new Redis(config[_0x8da9('0xa')]));require(_0x8da9('0xd'))[_0x8da9('0xe')](socket);function respondWithRpcPromise(_0x7fbb7,_0x18d083,_0x24a8b1){return new BPromise(function(_0x2fc782,_0x35d3b6){return client[_0x8da9('0xf')](_0x7fbb7,_0x24a8b1)[_0x8da9('0x10')](function(_0x3455d0){logger[_0x8da9('0x11')](_0x8da9('0x12'),_0x18d083,_0x8da9('0x13'));logger[_0x8da9('0x14')](_0x8da9('0x15'),_0x18d083,_0x8da9('0x13'),JSON[_0x8da9('0x16')](_0x3455d0));if(_0x3455d0[_0x8da9('0x17')]){if(_0x3455d0[_0x8da9('0x17')][_0x8da9('0x18')]===0x1f4){logger['error'](_0x8da9('0x12'),_0x18d083,_0x3455d0[_0x8da9('0x17')][_0x8da9('0x19')]);return _0x35d3b6(_0x3455d0[_0x8da9('0x17')][_0x8da9('0x19')]);}logger[_0x8da9('0x17')](_0x8da9('0x12'),_0x18d083,_0x3455d0['error'][_0x8da9('0x19')]);return _0x2fc782(_0x3455d0['error']['message']);}else{logger[_0x8da9('0x11')](_0x8da9('0x12'),_0x18d083,_0x8da9('0x13'));_0x2fc782(_0x3455d0['result']['message']);}})[_0x8da9('0x1a')](function(_0x970c62){logger['error'](_0x8da9('0x12'),_0x18d083,_0x970c62);_0x35d3b6(_0x970c62);});});}exports['GetVoiceQueue']=function(_0x33e440){var _0x4305e9=this;return new Promise(function(_0x26d922,_0x193ce4){return db[_0x8da9('0x1b')][_0x8da9('0x1c')]({'raw':_0x33e440[_0x8da9('0x1d')]?_0x33e440[_0x8da9('0x1d')][_0x8da9('0x1e')]===undefined?!![]:![]:!![],'where':_0x33e440[_0x8da9('0x1d')]?_0x33e440[_0x8da9('0x1d')][_0x8da9('0x1f')]||null:null,'attributes':_0x33e440[_0x8da9('0x1d')]?_0x33e440[_0x8da9('0x1d')][_0x8da9('0x20')]||null:null,'limit':_0x33e440[_0x8da9('0x1d')]?_0x33e440['options']['limit']||null:null,'include':_0x33e440[_0x8da9('0x1d')]?_0x33e440[_0x8da9('0x1d')][_0x8da9('0x21')]?_['map'](_0x33e440[_0x8da9('0x1d')][_0x8da9('0x21')],function(_0x2886a3){return{'model':db[_0x2886a3[_0x8da9('0x22')]],'as':_0x2886a3['as'],'attributes':_0x2886a3[_0x8da9('0x20')],'include':_0x2886a3['include']?_[_0x8da9('0x23')](_0x2886a3[_0x8da9('0x21')],function(_0x4e6c25){return{'model':db[_0x4e6c25[_0x8da9('0x22')]],'as':_0x4e6c25['as'],'attributes':_0x4e6c25[_0x8da9('0x20')],'include':_0x4e6c25[_0x8da9('0x21')]?_[_0x8da9('0x23')](_0x4e6c25['include'],function(_0x2d7caa){return{'model':db[_0x2d7caa[_0x8da9('0x22')]],'as':_0x2d7caa['as'],'attributes':_0x2d7caa[_0x8da9('0x20')]};}):[]};}):[]};}):[]:[]})[_0x8da9('0x10')](function(_0x1bc8f7){logger[_0x8da9('0x11')](_0x8da9('0x24'),_0x33e440);logger['debug'](_0x8da9('0x24'),_0x33e440,JSON[_0x8da9('0x16')](_0x1bc8f7));_0x26d922(_0x1bc8f7);})[_0x8da9('0x1a')](function(_0x35a7d4){logger[_0x8da9('0x17')](_0x8da9('0x24'),_0x35a7d4[_0x8da9('0x19')],_0x33e440);_0x193ce4(_0x4305e9[_0x8da9('0x17')](0x1f4,_0x35a7d4['message']));});});};exports[_0x8da9('0x25')]=function(_0x3f9749){var _0x357944=this;return new Promise(function(_0x433261,_0x3d2103){return db[_0x8da9('0x1b')][_0x8da9('0x26')]({'raw':_0x3f9749[_0x8da9('0x1d')]?_0x3f9749['options'][_0x8da9('0x1e')]===undefined?!![]:![]:!![],'where':_0x3f9749[_0x8da9('0x1d')]?_0x3f9749['options'][_0x8da9('0x1f')]||null:null,'attributes':_0x3f9749[_0x8da9('0x1d')]?_0x3f9749[_0x8da9('0x1d')][_0x8da9('0x20')]||null:null,'include':_0x3f9749[_0x8da9('0x1d')]?_0x3f9749[_0x8da9('0x1d')][_0x8da9('0x21')]?_[_0x8da9('0x23')](_0x3f9749[_0x8da9('0x1d')]['include'],function(_0x343e52){return{'model':db[_0x343e52['model']],'as':_0x343e52['as'],'attributes':_0x343e52[_0x8da9('0x20')],'include':_0x343e52['include']?_[_0x8da9('0x23')](_0x343e52[_0x8da9('0x21')],function(_0x27ed61){return{'model':db[_0x27ed61[_0x8da9('0x22')]],'as':_0x27ed61['as'],'attributes':_0x27ed61[_0x8da9('0x20')],'include':_0x27ed61[_0x8da9('0x21')]?_[_0x8da9('0x23')](_0x27ed61[_0x8da9('0x21')],function(_0x1785b2){return{'model':db[_0x1785b2[_0x8da9('0x22')]],'as':_0x1785b2['as'],'attributes':_0x1785b2[_0x8da9('0x20')]};}):[]};}):[]};}):[]:[]})[_0x8da9('0x10')](function(_0x264986){logger[_0x8da9('0x11')]('ShowVoiceQueue',_0x3f9749);logger[_0x8da9('0x14')](_0x8da9('0x25'),_0x3f9749,JSON[_0x8da9('0x16')](_0x264986));_0x433261(_0x264986);})[_0x8da9('0x1a')](function(_0x48f231){logger[_0x8da9('0x17')]('ShowVoiceQueue',_0x48f231[_0x8da9('0x19')],_0x3f9749);_0x3d2103(_0x357944[_0x8da9('0x17')](0x1f4,_0x48f231['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index aba4010..9806904 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 _0xf029=['emit','removeListener','length','voiceQueue:','save','remove'];(function(_0x3825a8,_0x2ce1a2){var _0xabc9bc=function(_0x101073){while(--_0x101073){_0x3825a8['push'](_0x3825a8['shift']());}};_0xabc9bc(++_0x2ce1a2);}(_0xf029,0x1ea));var _0x9f02=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0xf029[_0x49b207];return _0x2dc8fa;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=[_0x9f02('0x0'),_0x9f02('0x1'),'update'];function createListener(_0x5dea3d,_0x1d1b4d){return function(_0x1762a3){_0x1d1b4d[_0x9f02('0x2')](_0x5dea3d,_0x1762a3);};}function removeListener(_0x3d3152,_0x1d7a22){return function(){VoiceQueueEvents[_0x9f02('0x3')](_0x3d3152,_0x1d7a22);};}exports['register']=function(_0x39e9e8){for(var _0x530526=0x0,_0x5c5726=events[_0x9f02('0x4')];_0x530526<_0x5c5726;_0x530526++){var _0x2a57d9=events[_0x530526];var _0x74ee0c=createListener(_0x9f02('0x5')+_0x2a57d9,_0x39e9e8);VoiceQueueEvents['on'](_0x2a57d9,_0x74ee0c);}}; \ No newline at end of file +var _0x27e9=['./voiceQueue.events','save','remove','emit','register','voiceQueue:'];(function(_0x538929,_0x1fde6e){var _0x17bd8d=function(_0x4087e9){while(--_0x4087e9){_0x538929['push'](_0x538929['shift']());}};_0x17bd8d(++_0x1fde6e);}(_0x27e9,0x10e));var _0x927e=function(_0x5c2389,_0x4e6faa){_0x5c2389=_0x5c2389-0x0;var _0x2e31e4=_0x27e9[_0x5c2389];return _0x2e31e4;};'use strict';var VoiceQueueEvents=require(_0x927e('0x0'));var events=[_0x927e('0x1'),_0x927e('0x2'),'update'];function createListener(_0x316860,_0x182955){return function(_0x599f0b){_0x182955[_0x927e('0x3')](_0x316860,_0x599f0b);};}function removeListener(_0x190bdc,_0x1b6c5d){return function(){VoiceQueueEvents['removeListener'](_0x190bdc,_0x1b6c5d);};}exports[_0x927e('0x4')]=function(_0x5e45e9){for(var _0xa5cd21=0x0,_0x37a6d7=events['length'];_0xa5cd21<_0x37a6d7;_0xa5cd21++){var _0x3ee226=events[_0xa5cd21];var _0x563604=createListener(_0x927e('0x5')+_0x3ee226,_0x5e45e9);VoiceQueueEvents['on'](_0x3ee226,_0x563604);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 71aa6b7..4c38272 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 _0x6ed0=['update','delete','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put'];(function(_0x298875,_0xd4ba5c){var _0x37c97e=function(_0x484ada){while(--_0x484ada){_0x298875['push'](_0x298875['shift']());}};_0x37c97e(++_0xd4ba5c);}(_0x6ed0,0xb3));var _0x06ed=function(_0x2ca773,_0x52ec7a){_0x2ca773=_0x2ca773-0x0;var _0x4784b6=_0x6ed0[_0x2ca773];return _0x4784b6;};'use strict';var multer=require('multer');var util=require(_0x06ed('0x0'));var path=require(_0x06ed('0x1'));var timeout=require('connect-timeout');var express=require(_0x06ed('0x2'));var router=express[_0x06ed('0x3')]();var fs_extra=require(_0x06ed('0x4'));var auth=require(_0x06ed('0x5'));var interaction=require(_0x06ed('0x6'));var config=require(_0x06ed('0x7'));var controller=require(_0x06ed('0x8'));router[_0x06ed('0x9')]('/',auth[_0x06ed('0xa')](),controller[_0x06ed('0xb')]);router[_0x06ed('0x9')](_0x06ed('0xc'),auth[_0x06ed('0xa')](),controller[_0x06ed('0xd')]);router[_0x06ed('0x9')]('/index',auth[_0x06ed('0xa')](),controller['getVoiceQueuesReport']);router['get'](_0x06ed('0xe'),auth[_0x06ed('0xa')](),controller[_0x06ed('0xf')]);router[_0x06ed('0x10')]('/',auth[_0x06ed('0xa')](),controller[_0x06ed('0x11')]);router[_0x06ed('0x12')](_0x06ed('0xe'),auth[_0x06ed('0xa')](),controller[_0x06ed('0x13')]);router[_0x06ed('0x14')]('/:id',auth[_0x06ed('0xa')](),controller['destroy']);module[_0x06ed('0x15')]=router; \ No newline at end of file +var _0xa668=['/:id','post','create','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','index','/describe','/index','getVoiceQueuesReport'];(function(_0x5acaaf,_0xbbf334){var _0x47b05c=function(_0xa669ba){while(--_0xa669ba){_0x5acaaf['push'](_0x5acaaf['shift']());}};_0x47b05c(++_0xbbf334);}(_0xa668,0x188));var _0x8a66=function(_0x2cec39,_0x1893aa){_0x2cec39=_0x2cec39-0x0;var _0x3a4ea6=_0xa668[_0x2cec39];return _0x3a4ea6;};'use strict';var multer=require(_0x8a66('0x0'));var util=require(_0x8a66('0x1'));var path=require(_0x8a66('0x2'));var timeout=require('connect-timeout');var express=require(_0x8a66('0x3'));var router=express[_0x8a66('0x4')]();var fs_extra=require(_0x8a66('0x5'));var auth=require(_0x8a66('0x6'));var interaction=require(_0x8a66('0x7'));var config=require(_0x8a66('0x8'));var controller=require(_0x8a66('0x9'));router[_0x8a66('0xa')]('/',auth[_0x8a66('0xb')](),controller[_0x8a66('0xc')]);router[_0x8a66('0xa')](_0x8a66('0xd'),auth[_0x8a66('0xb')](),controller['describe']);router[_0x8a66('0xa')](_0x8a66('0xe'),auth[_0x8a66('0xb')](),controller[_0x8a66('0xf')]);router[_0x8a66('0xa')](_0x8a66('0x10'),auth['isAuthenticated'](),controller['show']);router[_0x8a66('0x11')]('/',auth[_0x8a66('0xb')](),controller[_0x8a66('0x12')]);router[_0x8a66('0x13')](_0x8a66('0x10'),auth[_0x8a66('0xb')](),controller[_0x8a66('0x14')]);router[_0x8a66('0x15')](_0x8a66('0x10'),auth['isAuthenticated'](),controller[_0x8a66('0x16')]);module[_0x8a66('0x17')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index e69002e..62c27a0 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 _0xd1a8=['COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports','STRING','DATE','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','queuecallerleaveAt','INTEGER','BOOLEAN'];(function(_0xb02766,_0xa37d90){var _0x560e6c=function(_0x1ea675){while(--_0x1ea675){_0xb02766['push'](_0xb02766['shift']());}};_0x560e6c(++_0xa37d90);}(_0xd1a8,0xe2));var _0x8d1a=function(_0x23ddbf,_0x4e58d9){_0x23ddbf=_0x23ddbf-0x0;var _0x330e0b=_0xd1a8[_0x23ddbf];return _0x330e0b;};'use strict';var Sequelize=require(_0x8d1a('0x0'));var moment=require(_0x8d1a('0x1'));module[_0x8d1a('0x2')]={'type':{'type':Sequelize[_0x8d1a('0x3')]},'uniqueid':{'type':Sequelize[_0x8d1a('0x3')]},'calleridnum':{'type':Sequelize[_0x8d1a('0x3')]},'calleridname':{'type':Sequelize[_0x8d1a('0x3')]},'queue':{'type':Sequelize[_0x8d1a('0x3')]},'queuecallerjoinAt':{'type':Sequelize[_0x8d1a('0x4')]},'queuecallerleaveAt':{'type':Sequelize[_0x8d1a('0x4')],'set':function(_0x1d7d70){var _0x13bc2d=moment(_0x1d7d70);var _0x51f37b=moment(this['getDataValue'](_0x8d1a('0x5')))[_0x8d1a('0x6')](_0x8d1a('0x7'));var _0x2e4b32=_0x13bc2d[_0x8d1a('0x8')](_0x51f37b,_0x8d1a('0x9'));this[_0x8d1a('0xa')](_0x8d1a('0xb'),_0x1d7d70);this[_0x8d1a('0xa')]('holdtime',_0x2e4b32||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize[_0x8d1a('0xc')]},'queuecallerabandon':{'type':Sequelize[_0x8d1a('0xd')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x8d1a('0x4')]},'queuecallercomplete':{'type':Sequelize[_0x8d1a('0xd')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize['DATE']},'queuecallerexit':{'type':Sequelize[_0x8d1a('0xd')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize['STRING'],'comment':_0x8d1a('0xe')},'originalposition':{'type':Sequelize[_0x8d1a('0xc')]},'channel':{'type':Sequelize[_0x8d1a('0x3')]},'connectedlinenum':{'type':Sequelize[_0x8d1a('0x3')]},'connectedlinename':{'type':Sequelize[_0x8d1a('0x3')]},'accountcode':{'type':Sequelize[_0x8d1a('0x3')]},'context':{'type':Sequelize[_0x8d1a('0x3')]},'exten':{'type':Sequelize[_0x8d1a('0x3')]},'priority':{'type':Sequelize[_0x8d1a('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0x8d1a('0xc')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x8d1a('0xd')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x8d1a('0x3')]},'transfer':{'type':Sequelize[_0x8d1a('0xd')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x8d1a('0x3')],'comment':_0x8d1a('0xf')},'transferexten':{'type':Sequelize[_0x8d1a('0x3')]},'transferuniqueid':{'type':Sequelize[_0x8d1a('0x3')]},'disposition':{'type':Sequelize[_0x8d1a('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x8d1a('0x3')]},'queuecallerenterreason':{'type':Sequelize[_0x8d1a('0xc')],'defaultValue':0x0},'note':{'type':Sequelize[_0x8d1a('0x3')]}}; \ No newline at end of file +var _0x914c=['FORWARD,\x20BLIND,\x20ATTENDED','exports','STRING','getDataValue','format','YYYY-MM-DD\x20HH:mm:ss','diff','queuecallerleaveAt','setDataValue','holdtime','INTEGER','BOOLEAN','DATE','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'];(function(_0x290df5,_0x2cc0cb){var _0x27c215=function(_0x39645a){while(--_0x39645a){_0x290df5['push'](_0x290df5['shift']());}};_0x27c215(++_0x2cc0cb);}(_0x914c,0x151));var _0xc914=function(_0x5e8c7c,_0x3429c6){_0x5e8c7c=_0x5e8c7c-0x0;var _0x48f7bd=_0x914c[_0x5e8c7c];return _0x48f7bd;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0xc914('0x0')]={'type':{'type':Sequelize[_0xc914('0x1')]},'uniqueid':{'type':Sequelize[_0xc914('0x1')]},'calleridnum':{'type':Sequelize[_0xc914('0x1')]},'calleridname':{'type':Sequelize[_0xc914('0x1')]},'queue':{'type':Sequelize[_0xc914('0x1')]},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x1fd40c){var _0x5908fa=moment(_0x1fd40c);var _0x513059=moment(this[_0xc914('0x2')]('queuecallerjoinAt'))[_0xc914('0x3')](_0xc914('0x4'));var _0x32c021=_0x5908fa[_0xc914('0x5')](_0x513059,'seconds');this['setDataValue'](_0xc914('0x6'),_0x1fd40c);this[_0xc914('0x7')](_0xc914('0x8'),_0x32c021||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize[_0xc914('0x9')]},'queuecallerabandon':{'type':Sequelize[_0xc914('0xa')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xc914('0xb')]},'queuecallercomplete':{'type':Sequelize[_0xc914('0xa')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize['DATE']},'queuecallerexit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xc914('0xb')]},'queuecallerexitreason':{'type':Sequelize[_0xc914('0x1')],'comment':_0xc914('0xc')},'originalposition':{'type':Sequelize[_0xc914('0x9')]},'channel':{'type':Sequelize[_0xc914('0x1')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xc914('0x1')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xc914('0x1')]},'exten':{'type':Sequelize[_0xc914('0x1')]},'priority':{'type':Sequelize[_0xc914('0x1')]},'holdtime':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xc914('0xa')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xc914('0x1')]},'transfer':{'type':Sequelize[_0xc914('0xa')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xc914('0x1')],'comment':_0xc914('0xd')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0xc914('0x1')]},'disposition':{'type':Sequelize[_0xc914('0x1')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xc914('0x1')]},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'note':{'type':Sequelize[_0xc914('0x1')]}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index e99667a..45f8476 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 _0xf571=['filter','merge','VIRTUAL','options','include','findAll','rows','show','params','includeAll','find','body','catch','describe','getVoiceQueuesReport','hasOwnProperty','order','eml-format','rimraf','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','./voiceQueueReport.socket','register','status','end','json','offset','limit','undefined','count','Content-Range','reject','save','update','then','destroy','sendStatus','error','name','send','map','VoiceQueueReport','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick'];(function(_0xfb0cfd,_0x500179){var _0x2fd8aa=function(_0xccb501){while(--_0xccb501){_0xfb0cfd['push'](_0xfb0cfd['shift']());}};_0x2fd8aa(++_0x500179);}(_0xf571,0x149));var _0x1f57=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf571[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x1f57('0x0'));var rimraf=require(_0x1f57('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1f57('0x2'));var BPromise=require(_0x1f57('0x3'));var Mustache=require(_0x1f57('0x4'));var util=require(_0x1f57('0x5'));var path=require(_0x1f57('0x6'));var sox=require('sox');var csv=require(_0x1f57('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1f57('0x8'));var _=require(_0x1f57('0x9'));var squel=require(_0x1f57('0xa'));var crypto=require(_0x1f57('0xb'));var jsforce=require(_0x1f57('0xc'));var deskjs=require(_0x1f57('0xd'));var toCsv=require('to-csv');var querystring=require(_0x1f57('0xe'));var Papa=require('papaparse');var Redis=require(_0x1f57('0xf'));var authService=require(_0x1f57('0x10'));var qs=require(_0x1f57('0x11'));var as=require(_0x1f57('0x12'));var hardwareService=require(_0x1f57('0x13'));var logger=require('../../config/logger')(_0x1f57('0x14'));var utils=require(_0x1f57('0x15'));var config=require(_0x1f57('0x16'));var licenseUtil=require(_0x1f57('0x17'));var db=require('../../mysqldb')['db'];config[_0x1f57('0x18')]=_['defaults'](config[_0x1f57('0x18')],{'host':_0x1f57('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x1f57('0x1a'))[_0x1f57('0x1b')](socket);function respondWithStatusCode(_0x33f490,_0x39cd8a){_0x39cd8a=_0x39cd8a||0xcc;return function(_0x5b9119){if(_0x5b9119){return _0x33f490['sendStatus'](_0x39cd8a);}return _0x33f490[_0x1f57('0x1c')](_0x39cd8a)[_0x1f57('0x1d')]();};}function respondWithResult(_0x31ab97,_0x321768){_0x321768=_0x321768||0xc8;return function(_0x489c68){if(_0x489c68){return _0x31ab97[_0x1f57('0x1c')](_0x321768)[_0x1f57('0x1e')](_0x489c68);}};}function respondWithFilteredResult(_0x1cfaeb,_0x481683){return function(_0x24f3c8){if(_0x24f3c8){var _0x21b89a=typeof _0x481683[_0x1f57('0x1f')]==='undefined'&&typeof _0x481683[_0x1f57('0x20')]===_0x1f57('0x21');var _0x43e780=_0x24f3c8[_0x1f57('0x22')];var _0x9874ff=_0x21b89a?0x0:_0x481683[_0x1f57('0x1f')];var _0x406874=_0x21b89a?_0x24f3c8['count']:_0x481683[_0x1f57('0x1f')]+_0x481683[_0x1f57('0x20')];var _0x2859f4;if(_0x406874>=_0x43e780){_0x406874=_0x43e780;_0x2859f4=0xc8;}else{_0x2859f4=0xce;}_0x1cfaeb['status'](_0x2859f4);return _0x1cfaeb['set'](_0x1f57('0x23'),_0x9874ff+'-'+_0x406874+'/'+_0x43e780)[_0x1f57('0x1e')](_0x24f3c8);}return null;};}function patchUpdates(_0x31d8a7){return function(_0x2e10b2){try{jsonpatch['apply'](_0x2e10b2,_0x31d8a7,!![]);}catch(_0x390adf){return BPromise[_0x1f57('0x24')](_0x390adf);}return _0x2e10b2[_0x1f57('0x25')]();};}function saveUpdates(_0x222b27,_0x14c0f3){return function(_0x1f08e4){if(_0x1f08e4){return _0x1f08e4[_0x1f57('0x26')](_0x222b27)[_0x1f57('0x27')](function(_0x319d07){return _0x319d07;});}return null;};}function removeEntity(_0x49a535,_0x3f9727){return function(_0x5aedaf){if(_0x5aedaf){return _0x5aedaf[_0x1f57('0x28')]()[_0x1f57('0x27')](function(){_0x49a535[_0x1f57('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x298c76,_0x49ee30){return function(_0x3af66a){if(!_0x3af66a){_0x298c76[_0x1f57('0x29')](0x194);}return _0x3af66a;};}function handleError(_0x440e3b,_0x33896a){_0x33896a=_0x33896a||0x1f4;return function(_0x3a58fe){logger[_0x1f57('0x2a')](_0x3a58fe['stack']);if(_0x3a58fe[_0x1f57('0x2b')]){delete _0x3a58fe['name'];}_0x440e3b['status'](_0x33896a)[_0x1f57('0x2c')](_0x3a58fe);};}exports['index']=function(_0x17be8a,_0x220e81){var _0xc3c82a={},_0x18a8d8={},_0x17261f={'count':0x0,'rows':[]};var _0x4d1f6e=_[_0x1f57('0x2d')](db[_0x1f57('0x2e')][_0x1f57('0x2f')],function(_0x5627c5){return{'name':_0x5627c5['fieldName'],'type':_0x5627c5['type'][_0x1f57('0x30')]};});_0x18a8d8[_0x1f57('0x31')]=_[_0x1f57('0x2d')](_0x4d1f6e,_0x1f57('0x2b'));_0x18a8d8[_0x1f57('0x32')]=_[_0x1f57('0x33')](_0x17be8a['query']);_0x18a8d8[_0x1f57('0x34')]=_[_0x1f57('0x35')](_0x18a8d8[_0x1f57('0x31')],_0x18a8d8[_0x1f57('0x32')]);_0xc3c82a[_0x1f57('0x36')]=_[_0x1f57('0x35')](_0x18a8d8[_0x1f57('0x31')],qs[_0x1f57('0x37')](_0x17be8a[_0x1f57('0x32')][_0x1f57('0x37')]));_0xc3c82a[_0x1f57('0x36')]=_0xc3c82a[_0x1f57('0x36')][_0x1f57('0x38')]?_0xc3c82a['attributes']:_0x18a8d8['model'];if(!_0x17be8a['query']['hasOwnProperty'](_0x1f57('0x39'))){_0xc3c82a[_0x1f57('0x20')]=qs[_0x1f57('0x20')](_0x17be8a[_0x1f57('0x32')][_0x1f57('0x20')]);_0xc3c82a[_0x1f57('0x1f')]=qs['offset'](_0x17be8a[_0x1f57('0x32')][_0x1f57('0x1f')]);}_0xc3c82a['order']=qs[_0x1f57('0x3a')](_0x17be8a['query'][_0x1f57('0x3a')]);_0xc3c82a[_0x1f57('0x3b')]=qs[_0x1f57('0x34')](_[_0x1f57('0x3c')](_0x17be8a[_0x1f57('0x32')],_0x18a8d8['filters']),_0x4d1f6e);if(_0x17be8a[_0x1f57('0x32')][_0x1f57('0x3d')]){_0xc3c82a['where']=_[_0x1f57('0x3e')](_0xc3c82a[_0x1f57('0x3b')],{'$or':_[_0x1f57('0x2d')](_0x4d1f6e,function(_0x1c7f8d){if(_0x1c7f8d['type']!==_0x1f57('0x3f')){var _0x3203c1={};_0x3203c1[_0x1c7f8d[_0x1f57('0x2b')]]={'$like':'%'+_0x17be8a['query'][_0x1f57('0x3d')]+'%'};return _0x3203c1;}})});}_0xc3c82a=_['merge']({},_0xc3c82a,_0x17be8a[_0x1f57('0x40')]);var _0x234e00={'where':_0xc3c82a[_0x1f57('0x3b')]};return db[_0x1f57('0x2e')]['count'](_0x234e00)[_0x1f57('0x27')](function(_0x13760e){_0x17261f[_0x1f57('0x22')]=_0x13760e;if(_0x17be8a[_0x1f57('0x32')]['includeAll']){_0xc3c82a[_0x1f57('0x41')]=[{'all':!![]}];}return db[_0x1f57('0x2e')][_0x1f57('0x42')](_0xc3c82a);})[_0x1f57('0x27')](function(_0x3302ad){_0x17261f[_0x1f57('0x43')]=_0x3302ad;return _0x17261f;})[_0x1f57('0x27')](respondWithFilteredResult(_0x220e81,_0xc3c82a))['catch'](handleError(_0x220e81,null));};exports[_0x1f57('0x44')]=function(_0x5fa8e0,_0xba039c){var _0x537c52={'raw':![],'where':{'id':_0x5fa8e0[_0x1f57('0x45')]['id']}},_0x3c1804={};_0x3c1804[_0x1f57('0x31')]=_['keys'](db[_0x1f57('0x2e')][_0x1f57('0x2f')]);_0x3c1804[_0x1f57('0x32')]=_[_0x1f57('0x33')](_0x5fa8e0[_0x1f57('0x32')]);_0x3c1804[_0x1f57('0x34')]=_['intersection'](_0x3c1804[_0x1f57('0x31')],_0x3c1804['query']);_0x537c52['attributes']=_[_0x1f57('0x35')](_0x3c1804[_0x1f57('0x31')],qs['fields'](_0x5fa8e0[_0x1f57('0x32')]['fields']));_0x537c52[_0x1f57('0x36')]=_0x537c52[_0x1f57('0x36')][_0x1f57('0x38')]?_0x537c52[_0x1f57('0x36')]:_0x3c1804['model'];if(_0x5fa8e0[_0x1f57('0x32')][_0x1f57('0x46')]){_0x537c52[_0x1f57('0x41')]=[{'all':!![]}];}_0x537c52=_[_0x1f57('0x3e')]({},_0x537c52,_0x5fa8e0['options']);return db['VoiceQueueReport'][_0x1f57('0x47')](_0x537c52)[_0x1f57('0x27')](handleEntityNotFound(_0xba039c,null))[_0x1f57('0x27')](respondWithResult(_0xba039c,null))['catch'](handleError(_0xba039c,null));};exports['create']=function(_0x24b312,_0xe3971c){return db[_0x1f57('0x2e')]['create'](_0x24b312[_0x1f57('0x48')],{})['then'](respondWithResult(_0xe3971c,0xc9))[_0x1f57('0x49')](handleError(_0xe3971c,null));};exports[_0x1f57('0x26')]=function(_0x34129d,_0x3bf3e2){if(_0x34129d[_0x1f57('0x48')]['id']){delete _0x34129d[_0x1f57('0x48')]['id'];}return db[_0x1f57('0x2e')]['find']({'where':{'id':_0x34129d[_0x1f57('0x45')]['id']}})[_0x1f57('0x27')](handleEntityNotFound(_0x3bf3e2,null))['then'](saveUpdates(_0x34129d[_0x1f57('0x48')],null))['then'](respondWithResult(_0x3bf3e2,null))[_0x1f57('0x49')](handleError(_0x3bf3e2,null));};exports[_0x1f57('0x28')]=function(_0x585f19,_0x4e7874){return db['VoiceQueueReport'][_0x1f57('0x47')]({'where':{'id':_0x585f19[_0x1f57('0x45')]['id']}})['then'](handleEntityNotFound(_0x4e7874,null))[_0x1f57('0x27')](removeEntity(_0x4e7874,null))[_0x1f57('0x49')](handleError(_0x4e7874,null));};exports[_0x1f57('0x4a')]=function(_0x3eb10f,_0x8baff0){return db[_0x1f57('0x2e')]['describe']()[_0x1f57('0x27')](respondWithResult(_0x8baff0,null))[_0x1f57('0x49')](handleError(_0x8baff0,null));};exports[_0x1f57('0x4b')]=function(_0x302bd4,_0x2e94f5){var _0x17c3d3={},_0x4dcdb1={},_0x13cd4a={'count':0x0,'rows':[]};_0x4dcdb1['model']=_[_0x1f57('0x33')](db[_0x1f57('0x2e')][_0x1f57('0x2f')]);_0x4dcdb1[_0x1f57('0x32')]=_['keys'](_0x302bd4[_0x1f57('0x32')]);_0x4dcdb1[_0x1f57('0x34')]=_[_0x1f57('0x35')](_0x4dcdb1[_0x1f57('0x31')],_0x4dcdb1[_0x1f57('0x32')]);_0x17c3d3['attributes']=_[_0x1f57('0x35')](_0x4dcdb1[_0x1f57('0x31')],qs[_0x1f57('0x37')](_0x302bd4[_0x1f57('0x32')][_0x1f57('0x37')]));_0x17c3d3[_0x1f57('0x36')]=_0x17c3d3['attributes'][_0x1f57('0x38')]?_0x17c3d3['attributes']:_0x4dcdb1['model'];if(!_0x302bd4[_0x1f57('0x32')][_0x1f57('0x4c')]('nolimit')){_0x17c3d3[_0x1f57('0x20')]=qs[_0x1f57('0x20')](_0x302bd4[_0x1f57('0x32')]['limit']);_0x17c3d3[_0x1f57('0x1f')]=qs[_0x1f57('0x1f')](_0x302bd4[_0x1f57('0x32')]['offset']);}_0x17c3d3[_0x1f57('0x4d')]=qs['sort'](_0x302bd4['query'][_0x1f57('0x3a')]);_0x17c3d3[_0x1f57('0x3b')]=qs[_0x1f57('0x34')](_['pick'](_0x302bd4[_0x1f57('0x32')],_0x4dcdb1['filters']));if(_0x302bd4[_0x1f57('0x32')]['filter']){_0x17c3d3['where']=_['merge'](_0x17c3d3[_0x1f57('0x3b')],{'$or':_[_0x1f57('0x2d')](_0x17c3d3[_0x1f57('0x36')],function(_0x222f6a){var _0x58f739={};_0x58f739[_0x222f6a]={'$like':'%'+_0x302bd4[_0x1f57('0x32')]['filter']+'%'};return _0x58f739;})});}_0x17c3d3=_[_0x1f57('0x3e')]({},_0x17c3d3,_0x302bd4['options']);var _0x20e837={'where':_0x17c3d3[_0x1f57('0x3b')]};return db['VoiceQueueReport'][_0x1f57('0x22')](_0x20e837)[_0x1f57('0x27')](function(_0xc5dd0d){_0x13cd4a['count']=_0xc5dd0d;if(_0x302bd4['query'][_0x1f57('0x46')]){_0x17c3d3[_0x1f57('0x41')]=[{'all':!![]}];}return db[_0x1f57('0x2e')][_0x1f57('0x42')](_0x17c3d3);})[_0x1f57('0x27')](function(_0x1c574a){_0x13cd4a[_0x1f57('0x43')]=_0x1c574a;return _0x13cd4a;})[_0x1f57('0x27')](respondWithFilteredResult(_0x2e94f5,_0x17c3d3,_0x1f57('0x4b')))[_0x1f57('0x49')](handleError(_0x2e94f5,null,_0x1f57('0x4b')));}; \ No newline at end of file +var _0x9b11=['attributes','fields','length','nolimit','order','sort','filters','pick','filter','merge','where','VIRTUAL','includeAll','include','findAll','show','params','options','create','catch','update','body','find','describe','hasOwnProperty','rows','getVoiceQueuesReport','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','reject','save','then','destroy','error','stack','name','send','index','map','VoiceQueueReport','rawAttributes','key','model','keys','query','intersection'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9b11,0x1b5));var _0x19b1=function(_0x5d31f3,_0x4239b0){_0x5d31f3=_0x5d31f3-0x0;var _0x1cc88c=_0x9b11[_0x5d31f3];return _0x1cc88c;};'use strict';var emlformat=require(_0x19b1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x19b1('0x1'));var jsonpatch=require(_0x19b1('0x2'));var rp=require(_0x19b1('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x19b1('0x4'));var util=require(_0x19b1('0x5'));var path=require(_0x19b1('0x6'));var sox=require(_0x19b1('0x7'));var csv=require(_0x19b1('0x8'));var ejs=require(_0x19b1('0x9'));var fs=require('fs');var fs_extra=require(_0x19b1('0xa'));var _=require(_0x19b1('0xb'));var squel=require(_0x19b1('0xc'));var crypto=require(_0x19b1('0xd'));var jsforce=require(_0x19b1('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x19b1('0xf'));var authService=require(_0x19b1('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x19b1('0x11'));var hardwareService=require(_0x19b1('0x12'));var logger=require(_0x19b1('0x13'))(_0x19b1('0x14'));var utils=require(_0x19b1('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x19b1('0x16'));var db=require('../../mysqldb')['db'];config[_0x19b1('0x17')]=_[_0x19b1('0x18')](config[_0x19b1('0x17')],{'host':_0x19b1('0x19'),'port':0x18eb});var socket=require(_0x19b1('0x1a'))(new Redis(config[_0x19b1('0x17')]));require(_0x19b1('0x1b'))[_0x19b1('0x1c')](socket);function respondWithStatusCode(_0x20ce15,_0x32ea54){_0x32ea54=_0x32ea54||0xcc;return function(_0x4918e2){if(_0x4918e2){return _0x20ce15[_0x19b1('0x1d')](_0x32ea54);}return _0x20ce15[_0x19b1('0x1e')](_0x32ea54)[_0x19b1('0x1f')]();};}function respondWithResult(_0x16eaf4,_0x3b7af8){_0x3b7af8=_0x3b7af8||0xc8;return function(_0x2e28b3){if(_0x2e28b3){return _0x16eaf4[_0x19b1('0x1e')](_0x3b7af8)[_0x19b1('0x20')](_0x2e28b3);}};}function respondWithFilteredResult(_0x152f68,_0x4beb59){return function(_0x580d0f){if(_0x580d0f){var _0x2c9e86=typeof _0x4beb59[_0x19b1('0x21')]==='undefined'&&typeof _0x4beb59[_0x19b1('0x22')]===_0x19b1('0x23');var _0x55ff46=_0x580d0f[_0x19b1('0x24')];var _0x329848=_0x2c9e86?0x0:_0x4beb59[_0x19b1('0x21')];var _0x373b7c=_0x2c9e86?_0x580d0f[_0x19b1('0x24')]:_0x4beb59[_0x19b1('0x21')]+_0x4beb59[_0x19b1('0x22')];var _0x126b12;if(_0x373b7c>=_0x55ff46){_0x373b7c=_0x55ff46;_0x126b12=0xc8;}else{_0x126b12=0xce;}_0x152f68[_0x19b1('0x1e')](_0x126b12);return _0x152f68[_0x19b1('0x25')]('Content-Range',_0x329848+'-'+_0x373b7c+'/'+_0x55ff46)['json'](_0x580d0f);}return null;};}function patchUpdates(_0x374fc1){return function(_0x29a98e){try{jsonpatch['apply'](_0x29a98e,_0x374fc1,!![]);}catch(_0x19bff4){return BPromise[_0x19b1('0x26')](_0x19bff4);}return _0x29a98e[_0x19b1('0x27')]();};}function saveUpdates(_0x38fc1e,_0x59e796){return function(_0x9d65aa){if(_0x9d65aa){return _0x9d65aa['update'](_0x38fc1e)[_0x19b1('0x28')](function(_0x38390a){return _0x38390a;});}return null;};}function removeEntity(_0x22fb0d,_0x3719b1){return function(_0x443a0b){if(_0x443a0b){return _0x443a0b[_0x19b1('0x29')]()[_0x19b1('0x28')](function(){_0x22fb0d[_0x19b1('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24662f,_0x52bdfe){return function(_0x37ce18){if(!_0x37ce18){_0x24662f[_0x19b1('0x1d')](0x194);}return _0x37ce18;};}function handleError(_0x4fed7b,_0xe2776e){_0xe2776e=_0xe2776e||0x1f4;return function(_0x29004f){logger[_0x19b1('0x2a')](_0x29004f[_0x19b1('0x2b')]);if(_0x29004f['name']){delete _0x29004f[_0x19b1('0x2c')];}_0x4fed7b[_0x19b1('0x1e')](_0xe2776e)[_0x19b1('0x2d')](_0x29004f);};}exports[_0x19b1('0x2e')]=function(_0x2cc466,_0x1bf92c){var _0x61ebb0={},_0x765343={},_0x2f8cf2={'count':0x0,'rows':[]};var _0x15ad54=_[_0x19b1('0x2f')](db[_0x19b1('0x30')][_0x19b1('0x31')],function(_0x1d13d8){return{'name':_0x1d13d8['fieldName'],'type':_0x1d13d8['type'][_0x19b1('0x32')]};});_0x765343[_0x19b1('0x33')]=_[_0x19b1('0x2f')](_0x15ad54,'name');_0x765343['query']=_[_0x19b1('0x34')](_0x2cc466[_0x19b1('0x35')]);_0x765343['filters']=_[_0x19b1('0x36')](_0x765343['model'],_0x765343[_0x19b1('0x35')]);_0x61ebb0[_0x19b1('0x37')]=_[_0x19b1('0x36')](_0x765343[_0x19b1('0x33')],qs[_0x19b1('0x38')](_0x2cc466[_0x19b1('0x35')][_0x19b1('0x38')]));_0x61ebb0[_0x19b1('0x37')]=_0x61ebb0['attributes'][_0x19b1('0x39')]?_0x61ebb0['attributes']:_0x765343['model'];if(!_0x2cc466['query']['hasOwnProperty'](_0x19b1('0x3a'))){_0x61ebb0[_0x19b1('0x22')]=qs[_0x19b1('0x22')](_0x2cc466[_0x19b1('0x35')][_0x19b1('0x22')]);_0x61ebb0['offset']=qs[_0x19b1('0x21')](_0x2cc466[_0x19b1('0x35')][_0x19b1('0x21')]);}_0x61ebb0[_0x19b1('0x3b')]=qs[_0x19b1('0x3c')](_0x2cc466[_0x19b1('0x35')][_0x19b1('0x3c')]);_0x61ebb0['where']=qs[_0x19b1('0x3d')](_[_0x19b1('0x3e')](_0x2cc466[_0x19b1('0x35')],_0x765343[_0x19b1('0x3d')]),_0x15ad54);if(_0x2cc466[_0x19b1('0x35')][_0x19b1('0x3f')]){_0x61ebb0['where']=_[_0x19b1('0x40')](_0x61ebb0[_0x19b1('0x41')],{'$or':_[_0x19b1('0x2f')](_0x15ad54,function(_0x331278){if(_0x331278['type']!==_0x19b1('0x42')){var _0x2066fb={};_0x2066fb[_0x331278[_0x19b1('0x2c')]]={'$like':'%'+_0x2cc466[_0x19b1('0x35')][_0x19b1('0x3f')]+'%'};return _0x2066fb;}})});}_0x61ebb0=_['merge']({},_0x61ebb0,_0x2cc466['options']);var _0x2bac36={'where':_0x61ebb0[_0x19b1('0x41')]};return db['VoiceQueueReport']['count'](_0x2bac36)['then'](function(_0x4e41e3){_0x2f8cf2['count']=_0x4e41e3;if(_0x2cc466[_0x19b1('0x35')][_0x19b1('0x43')]){_0x61ebb0[_0x19b1('0x44')]=[{'all':!![]}];}return db[_0x19b1('0x30')][_0x19b1('0x45')](_0x61ebb0);})['then'](function(_0x343dce){_0x2f8cf2['rows']=_0x343dce;return _0x2f8cf2;})[_0x19b1('0x28')](respondWithFilteredResult(_0x1bf92c,_0x61ebb0))['catch'](handleError(_0x1bf92c,null));};exports[_0x19b1('0x46')]=function(_0x128037,_0x4d11d6){var _0x1c7a5f={'raw':![],'where':{'id':_0x128037[_0x19b1('0x47')]['id']}},_0x59c389={};_0x59c389[_0x19b1('0x33')]=_['keys'](db['VoiceQueueReport'][_0x19b1('0x31')]);_0x59c389[_0x19b1('0x35')]=_[_0x19b1('0x34')](_0x128037[_0x19b1('0x35')]);_0x59c389[_0x19b1('0x3d')]=_[_0x19b1('0x36')](_0x59c389[_0x19b1('0x33')],_0x59c389[_0x19b1('0x35')]);_0x1c7a5f[_0x19b1('0x37')]=_['intersection'](_0x59c389[_0x19b1('0x33')],qs[_0x19b1('0x38')](_0x128037[_0x19b1('0x35')][_0x19b1('0x38')]));_0x1c7a5f[_0x19b1('0x37')]=_0x1c7a5f[_0x19b1('0x37')][_0x19b1('0x39')]?_0x1c7a5f['attributes']:_0x59c389[_0x19b1('0x33')];if(_0x128037['query'][_0x19b1('0x43')]){_0x1c7a5f[_0x19b1('0x44')]=[{'all':!![]}];}_0x1c7a5f=_[_0x19b1('0x40')]({},_0x1c7a5f,_0x128037[_0x19b1('0x48')]);return db[_0x19b1('0x30')]['find'](_0x1c7a5f)['then'](handleEntityNotFound(_0x4d11d6,null))[_0x19b1('0x28')](respondWithResult(_0x4d11d6,null))['catch'](handleError(_0x4d11d6,null));};exports[_0x19b1('0x49')]=function(_0x1cc1dd,_0x288d95){return db['VoiceQueueReport'][_0x19b1('0x49')](_0x1cc1dd['body'],{})['then'](respondWithResult(_0x288d95,0xc9))[_0x19b1('0x4a')](handleError(_0x288d95,null));};exports[_0x19b1('0x4b')]=function(_0x1e8a4e,_0x399108){if(_0x1e8a4e[_0x19b1('0x4c')]['id']){delete _0x1e8a4e[_0x19b1('0x4c')]['id'];}return db[_0x19b1('0x30')][_0x19b1('0x4d')]({'where':{'id':_0x1e8a4e[_0x19b1('0x47')]['id']}})[_0x19b1('0x28')](handleEntityNotFound(_0x399108,null))[_0x19b1('0x28')](saveUpdates(_0x1e8a4e['body'],null))[_0x19b1('0x28')](respondWithResult(_0x399108,null))[_0x19b1('0x4a')](handleError(_0x399108,null));};exports[_0x19b1('0x29')]=function(_0x1dc47d,_0x2ec8bf){return db[_0x19b1('0x30')]['find']({'where':{'id':_0x1dc47d['params']['id']}})['then'](handleEntityNotFound(_0x2ec8bf,null))[_0x19b1('0x28')](removeEntity(_0x2ec8bf,null))[_0x19b1('0x4a')](handleError(_0x2ec8bf,null));};exports[_0x19b1('0x4e')]=function(_0x211493,_0x21bb83){return db[_0x19b1('0x30')][_0x19b1('0x4e')]()[_0x19b1('0x28')](respondWithResult(_0x21bb83,null))[_0x19b1('0x4a')](handleError(_0x21bb83,null));};exports['getVoiceQueuesReport']=function(_0x26e8ce,_0x203409){var _0x4b934c={},_0x481c1a={},_0x3fa164={'count':0x0,'rows':[]};_0x481c1a[_0x19b1('0x33')]=_[_0x19b1('0x34')](db[_0x19b1('0x30')][_0x19b1('0x31')]);_0x481c1a['query']=_[_0x19b1('0x34')](_0x26e8ce[_0x19b1('0x35')]);_0x481c1a[_0x19b1('0x3d')]=_[_0x19b1('0x36')](_0x481c1a[_0x19b1('0x33')],_0x481c1a[_0x19b1('0x35')]);_0x4b934c[_0x19b1('0x37')]=_[_0x19b1('0x36')](_0x481c1a[_0x19b1('0x33')],qs[_0x19b1('0x38')](_0x26e8ce[_0x19b1('0x35')][_0x19b1('0x38')]));_0x4b934c[_0x19b1('0x37')]=_0x4b934c[_0x19b1('0x37')][_0x19b1('0x39')]?_0x4b934c[_0x19b1('0x37')]:_0x481c1a[_0x19b1('0x33')];if(!_0x26e8ce['query'][_0x19b1('0x4f')](_0x19b1('0x3a'))){_0x4b934c[_0x19b1('0x22')]=qs[_0x19b1('0x22')](_0x26e8ce[_0x19b1('0x35')][_0x19b1('0x22')]);_0x4b934c[_0x19b1('0x21')]=qs[_0x19b1('0x21')](_0x26e8ce[_0x19b1('0x35')][_0x19b1('0x21')]);}_0x4b934c[_0x19b1('0x3b')]=qs[_0x19b1('0x3c')](_0x26e8ce[_0x19b1('0x35')]['sort']);_0x4b934c[_0x19b1('0x41')]=qs['filters'](_['pick'](_0x26e8ce['query'],_0x481c1a[_0x19b1('0x3d')]));if(_0x26e8ce['query']['filter']){_0x4b934c['where']=_[_0x19b1('0x40')](_0x4b934c[_0x19b1('0x41')],{'$or':_['map'](_0x4b934c['attributes'],function(_0x135a86){var _0x50049c={};_0x50049c[_0x135a86]={'$like':'%'+_0x26e8ce[_0x19b1('0x35')][_0x19b1('0x3f')]+'%'};return _0x50049c;})});}_0x4b934c=_[_0x19b1('0x40')]({},_0x4b934c,_0x26e8ce[_0x19b1('0x48')]);var _0x440af6={'where':_0x4b934c['where']};return db[_0x19b1('0x30')][_0x19b1('0x24')](_0x440af6)[_0x19b1('0x28')](function(_0x56212e){_0x3fa164[_0x19b1('0x24')]=_0x56212e;if(_0x26e8ce[_0x19b1('0x35')][_0x19b1('0x43')]){_0x4b934c['include']=[{'all':!![]}];}return db[_0x19b1('0x30')]['findAll'](_0x4b934c);})['then'](function(_0x541930){_0x3fa164[_0x19b1('0x50')]=_0x541930;return _0x3fa164;})[_0x19b1('0x28')](respondWithFilteredResult(_0x203409,_0x4b934c,_0x19b1('0x51')))[_0x19b1('0x4a')](handleError(_0x203409,null,'getVoiceQueuesReport'));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index ee3db62..5e15e62 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 _0x2e99=['remove','emit','hasOwnProperty','hook','exports','events','setMaxListeners','save'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x2e99,0x195));var _0x92e9=function(_0x42a8bd,_0x4594c4){_0x42a8bd=_0x42a8bd-0x0;var _0x3d5453=_0x2e99[_0x42a8bd];return _0x3d5453;};'use strict';var EventEmitter=require(_0x92e9('0x0'));var VoiceQueueReport=require('../../mysqldb')['db']['VoiceQueueReport'];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x92e9('0x1')](0x0);var events={'afterCreate':_0x92e9('0x2'),'afterUpdate':'update','afterDestroy':_0x92e9('0x3')};function emitEvent(_0x28eed5){return function(_0x3cba67,_0x14287a,_0x26dbdf){VoiceQueueReportEvents[_0x92e9('0x4')](_0x28eed5+':'+_0x3cba67['id'],_0x3cba67);VoiceQueueReportEvents[_0x92e9('0x4')](_0x28eed5,_0x3cba67);_0x26dbdf(null);};}for(var e in events){if(events[_0x92e9('0x5')](e)){var event=events[e];VoiceQueueReport[_0x92e9('0x6')](e,emitEvent(event));}}module[_0x92e9('0x7')]=VoiceQueueReportEvents; \ No newline at end of file +var _0xae95=['../../mysqldb','VoiceQueueReport','setMaxListeners','save','emit','hook','exports','events'];(function(_0xa4f075,_0x1c15db){var _0x42b259=function(_0x3c8d6f){while(--_0x3c8d6f){_0xa4f075['push'](_0xa4f075['shift']());}};_0x42b259(++_0x1c15db);}(_0xae95,0x8f));var _0x5ae9=function(_0x2ff298,_0x3532b5){_0x2ff298=_0x2ff298-0x0;var _0xd99565=_0xae95[_0x2ff298];return _0xd99565;};'use strict';var EventEmitter=require(_0x5ae9('0x0'));var VoiceQueueReport=require(_0x5ae9('0x1'))['db'][_0x5ae9('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x5ae9('0x3')](0x0);var events={'afterCreate':_0x5ae9('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x2a6003){return function(_0x213bb8,_0x12daa2,_0xf8c75c){VoiceQueueReportEvents['emit'](_0x2a6003+':'+_0x213bb8['id'],_0x213bb8);VoiceQueueReportEvents[_0x5ae9('0x5')](_0x2a6003,_0x213bb8);_0xf8c75c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport[_0x5ae9('0x6')](e,emitEvent(event));}}module[_0x5ae9('0x7')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index ad27d8a..f1c020a 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 _0x0dca=['rimraf','./voiceQueueReport.attributes','define','VoiceQueueReport','report_queue','uniqueid','calleridnum','lodash','util','../../config/logger','api','path'];(function(_0x3b467d,_0x1925bb){var _0x4a5b8b=function(_0x10de01){while(--_0x10de01){_0x3b467d['push'](_0x3b467d['shift']());}};_0x4a5b8b(++_0x1925bb);}(_0x0dca,0xdf));var _0xa0dc=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0dca[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xa0dc('0x0'));var util=require(_0xa0dc('0x1'));var logger=require(_0xa0dc('0x2'))(_0xa0dc('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa0dc('0x4'));var rimraf=require(_0xa0dc('0x5'));var config=require('../../config/environment');var attributes=require(_0xa0dc('0x6'));module['exports']=function(_0x844958,_0x38301e){return _0x844958[_0xa0dc('0x7')](_0xa0dc('0x8'),attributes,{'tableName':_0xa0dc('0x9'),'paranoid':![],'indexes':[{'fields':[_0xa0dc('0xa')]},{'fields':[_0xa0dc('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7edb=['exports','define','VoiceQueueReport','report_queue','uniqueid','calleridnum','util','../../config/logger','api','moment','bluebird','path','./voiceQueueReport.attributes'];(function(_0x2b15b5,_0x5ded20){var _0x50a223=function(_0x47cd96){while(--_0x47cd96){_0x2b15b5['push'](_0x2b15b5['shift']());}};_0x50a223(++_0x5ded20);}(_0x7edb,0x158));var _0xb7ed=function(_0x1a424d,_0x25282f){_0x1a424d=_0x1a424d-0x0;var _0x13bde7=_0x7edb[_0x1a424d];return _0x13bde7;};'use strict';var _=require('lodash');var util=require(_0xb7ed('0x0'));var logger=require(_0xb7ed('0x1'))(_0xb7ed('0x2'));var moment=require(_0xb7ed('0x3'));var BPromise=require(_0xb7ed('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb7ed('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb7ed('0x6'));module[_0xb7ed('0x7')]=function(_0x2aa67d,_0x246cfa){return _0x2aa67d[_0xb7ed('0x8')](_0xb7ed('0x9'),attributes,{'tableName':_0xb7ed('0xa'),'paranoid':![],'indexes':[{'fields':[_0xb7ed('0xb')]},{'fields':[_0xb7ed('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index 129570a..69199db 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 _0x2cca=['./voiceQueueReport.socket','register','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','limit','map','include','model','attributes','debug','CreateVoiceQueueReport','create','body','where','UpdateVoiceQueueReport','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter'];(function(_0x41d25,_0x5dd964){var _0x780f27=function(_0x571272){while(--_0x571272){_0x41d25['push'](_0x41d25['shift']());}};_0x780f27(++_0x5dd964);}(_0x2cca,0xfe));var _0xa2cc=function(_0x3c762c,_0x174f49){_0x3c762c=_0x3c762c-0x0;var _0x16ae8c=_0x2cca[_0x3c762c];return _0x16ae8c;};'use strict';var _=require(_0xa2cc('0x0'));var util=require(_0xa2cc('0x1'));var moment=require(_0xa2cc('0x2'));var BPromise=require('bluebird');var rs=require(_0xa2cc('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa2cc('0x4'))['db'];var utils=require(_0xa2cc('0x5'));var logger=require(_0xa2cc('0x6'))(_0xa2cc('0x7'));var config=require(_0xa2cc('0x8'));var jayson=require(_0xa2cc('0x9'));var client=jayson[_0xa2cc('0xa')][_0xa2cc('0xb')]({'port':0x232a});config['redis']=_[_0xa2cc('0xc')](config[_0xa2cc('0xd')],{'host':_0xa2cc('0xe'),'port':0x18eb});var socket=require(_0xa2cc('0xf'))(new Redis(config[_0xa2cc('0xd')]));require(_0xa2cc('0x10'))[_0xa2cc('0x11')](socket);function respondWithRpcPromise(_0x3a9501,_0x5d904c,_0x378f18){return new BPromise(function(_0x15ee96,_0x16f13b){return client['request'](_0x3a9501,_0x378f18)[_0xa2cc('0x12')](function(_0x2a7f50){logger[_0xa2cc('0x13')](_0xa2cc('0x14'),_0x5d904c,_0xa2cc('0x15'));logger['debug'](_0xa2cc('0x16'),_0x5d904c,_0xa2cc('0x15'),JSON[_0xa2cc('0x17')](_0x2a7f50));if(_0x2a7f50[_0xa2cc('0x18')]){if(_0x2a7f50[_0xa2cc('0x18')][_0xa2cc('0x19')]===0x1f4){logger[_0xa2cc('0x18')](_0xa2cc('0x14'),_0x5d904c,_0x2a7f50['error'][_0xa2cc('0x1a')]);return _0x16f13b(_0x2a7f50[_0xa2cc('0x18')][_0xa2cc('0x1a')]);}logger['error'](_0xa2cc('0x14'),_0x5d904c,_0x2a7f50[_0xa2cc('0x18')][_0xa2cc('0x1a')]);return _0x15ee96(_0x2a7f50[_0xa2cc('0x18')][_0xa2cc('0x1a')]);}else{logger[_0xa2cc('0x13')](_0xa2cc('0x14'),_0x5d904c,_0xa2cc('0x15'));_0x15ee96(_0x2a7f50[_0xa2cc('0x1b')]['message']);}})[_0xa2cc('0x1c')](function(_0x1aba09){logger[_0xa2cc('0x18')](_0xa2cc('0x14'),_0x5d904c,_0x1aba09);_0x16f13b(_0x1aba09);});});}exports[_0xa2cc('0x1d')]=function(_0x3bf453){var _0x346b22=this;return new Promise(function(_0x11228b,_0x22a507){return db[_0xa2cc('0x1e')][_0xa2cc('0x1f')]({'raw':_0x3bf453[_0xa2cc('0x20')]?_0x3bf453['options'][_0xa2cc('0x21')]===undefined?!![]:![]:!![],'where':_0x3bf453[_0xa2cc('0x20')]?_0x3bf453['options']['where']||null:null,'attributes':_0x3bf453['options']?_0x3bf453['options']['attributes']||null:null,'limit':_0x3bf453[_0xa2cc('0x20')]?_0x3bf453[_0xa2cc('0x20')][_0xa2cc('0x22')]||null:null,'include':_0x3bf453[_0xa2cc('0x20')]?_0x3bf453[_0xa2cc('0x20')]['include']?_[_0xa2cc('0x23')](_0x3bf453[_0xa2cc('0x20')][_0xa2cc('0x24')],function(_0x2c9515){return{'model':db[_0x2c9515[_0xa2cc('0x25')]],'as':_0x2c9515['as'],'attributes':_0x2c9515['attributes'],'include':_0x2c9515[_0xa2cc('0x24')]?_[_0xa2cc('0x23')](_0x2c9515['include'],function(_0x31ffe9){return{'model':db[_0x31ffe9[_0xa2cc('0x25')]],'as':_0x31ffe9['as'],'attributes':_0x31ffe9[_0xa2cc('0x26')],'include':_0x31ffe9[_0xa2cc('0x24')]?_[_0xa2cc('0x23')](_0x31ffe9['include'],function(_0x9d0aa8){return{'model':db[_0x9d0aa8[_0xa2cc('0x25')]],'as':_0x9d0aa8['as'],'attributes':_0x9d0aa8[_0xa2cc('0x26')]};}):[]};}):[]};}):[]:[]})[_0xa2cc('0x12')](function(_0x33170d){logger[_0xa2cc('0x13')](_0xa2cc('0x1d'),_0x3bf453);logger[_0xa2cc('0x27')](_0xa2cc('0x1d'),_0x3bf453,JSON['stringify'](_0x33170d));_0x11228b(_0x33170d);})['catch'](function(_0x3c57c6){logger[_0xa2cc('0x18')](_0xa2cc('0x1d'),_0x3c57c6['message'],_0x3bf453);_0x22a507(_0x346b22[_0xa2cc('0x18')](0x1f4,_0x3c57c6[_0xa2cc('0x1a')]));});});};exports[_0xa2cc('0x28')]=function(_0x35d527){var _0x220058=this;return new Promise(function(_0x469a45,_0x153c1){return db['VoiceQueueReport'][_0xa2cc('0x29')](_0x35d527['body'],{'raw':_0x35d527[_0xa2cc('0x20')]?_0x35d527[_0xa2cc('0x20')][_0xa2cc('0x21')]===undefined?!![]:![]:!![]})['then'](function(_0x28e09c){logger[_0xa2cc('0x13')](_0xa2cc('0x28'),_0x35d527);logger[_0xa2cc('0x27')]('CreateVoiceQueueReport',_0x35d527,JSON['stringify'](_0x28e09c));_0x469a45(_0x28e09c);})[_0xa2cc('0x1c')](function(_0xd28ef5){logger[_0xa2cc('0x18')]('CreateVoiceQueueReport',_0xd28ef5['message'],_0x35d527);_0x153c1(_0x220058[_0xa2cc('0x18')](0x1f4,_0xd28ef5[_0xa2cc('0x1a')]));});});};exports['UpdateVoiceQueueReport']=function(_0x417b8e){var _0x203439=this;return new Promise(function(_0x3ffe22,_0x4663d3){return db[_0xa2cc('0x1e')]['update'](_0x417b8e[_0xa2cc('0x2a')],{'raw':_0x417b8e[_0xa2cc('0x20')]?_0x417b8e[_0xa2cc('0x20')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x417b8e[_0xa2cc('0x20')]?_0x417b8e['options'][_0xa2cc('0x2b')]||null:null,'attributes':_0x417b8e[_0xa2cc('0x20')]?_0x417b8e[_0xa2cc('0x20')][_0xa2cc('0x26')]||null:null,'limit':_0x417b8e['options']?_0x417b8e['options'][_0xa2cc('0x22')]||null:null})[_0xa2cc('0x12')](function(_0x4bad7e){logger[_0xa2cc('0x13')](_0xa2cc('0x2c'),_0x417b8e);logger[_0xa2cc('0x27')]('UpdateVoiceQueueReport',_0x417b8e,JSON[_0xa2cc('0x17')](_0x4bad7e));_0x3ffe22(_0x4bad7e);})[_0xa2cc('0x1c')](function(_0x119190){logger[_0xa2cc('0x18')](_0xa2cc('0x2c'),_0x119190[_0xa2cc('0x1a')],_0x417b8e);_0x4663d3(_0x203439[_0xa2cc('0x18')](0x1f4,_0x119190[_0xa2cc('0x1a')]));});});}; \ No newline at end of file +var _0xa358=['then','debug','CreateVoiceQueueReport','create','body','UpdateVoiceQueueReport','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','./voiceQueueReport.socket','request','info','request\x20sent','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VoiceQueueReport,\x20%s,\x20%s','result','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','where','attributes','limit','include','model','map'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa358,0xdd));var _0x8a35=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa358[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x8a35('0x0'));var util=require(_0x8a35('0x1'));var moment=require(_0x8a35('0x2'));var BPromise=require(_0x8a35('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8a35('0x4'));var db=require(_0x8a35('0x5'))['db'];var utils=require(_0x8a35('0x6'));var logger=require(_0x8a35('0x7'))('rpc');var config=require(_0x8a35('0x8'));var jayson=require(_0x8a35('0x9'));var client=jayson['client'][_0x8a35('0xa')]({'port':0x232a});config[_0x8a35('0xb')]=_[_0x8a35('0xc')](config[_0x8a35('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x8a35('0xd'))(new Redis(config[_0x8a35('0xb')]));require(_0x8a35('0xe'))['register'](socket);function respondWithRpcPromise(_0x18095f,_0x344f62,_0x5dba9b){return new BPromise(function(_0x699e7f,_0x4e1019){return client[_0x8a35('0xf')](_0x18095f,_0x5dba9b)['then'](function(_0x1d5bbd){logger[_0x8a35('0x10')]('VoiceQueueReport,\x20%s,\x20%s',_0x344f62,_0x8a35('0x11'));logger['debug'](_0x8a35('0x12'),_0x344f62,_0x8a35('0x11'),JSON[_0x8a35('0x13')](_0x1d5bbd));if(_0x1d5bbd[_0x8a35('0x14')]){if(_0x1d5bbd[_0x8a35('0x14')][_0x8a35('0x15')]===0x1f4){logger[_0x8a35('0x14')]('VoiceQueueReport,\x20%s,\x20%s',_0x344f62,_0x1d5bbd[_0x8a35('0x14')][_0x8a35('0x16')]);return _0x4e1019(_0x1d5bbd[_0x8a35('0x14')]['message']);}logger['error'](_0x8a35('0x17'),_0x344f62,_0x1d5bbd['error'][_0x8a35('0x16')]);return _0x699e7f(_0x1d5bbd[_0x8a35('0x14')][_0x8a35('0x16')]);}else{logger['info'](_0x8a35('0x17'),_0x344f62,'request\x20sent');_0x699e7f(_0x1d5bbd[_0x8a35('0x18')][_0x8a35('0x16')]);}})[_0x8a35('0x19')](function(_0x9e5400){logger[_0x8a35('0x14')]('VoiceQueueReport,\x20%s,\x20%s',_0x344f62,_0x9e5400);_0x4e1019(_0x9e5400);});});}exports[_0x8a35('0x1a')]=function(_0x10d205){var _0x41a35d=this;return new Promise(function(_0x270de0,_0x14d007){return db[_0x8a35('0x1b')][_0x8a35('0x1c')]({'raw':_0x10d205[_0x8a35('0x1d')]?_0x10d205[_0x8a35('0x1d')][_0x8a35('0x1e')]===undefined?!![]:![]:!![],'where':_0x10d205['options']?_0x10d205['options'][_0x8a35('0x1f')]||null:null,'attributes':_0x10d205[_0x8a35('0x1d')]?_0x10d205['options'][_0x8a35('0x20')]||null:null,'limit':_0x10d205[_0x8a35('0x1d')]?_0x10d205['options'][_0x8a35('0x21')]||null:null,'include':_0x10d205['options']?_0x10d205[_0x8a35('0x1d')]['include']?_['map'](_0x10d205[_0x8a35('0x1d')][_0x8a35('0x22')],function(_0x19b46c){return{'model':db[_0x19b46c[_0x8a35('0x23')]],'as':_0x19b46c['as'],'attributes':_0x19b46c[_0x8a35('0x20')],'include':_0x19b46c[_0x8a35('0x22')]?_[_0x8a35('0x24')](_0x19b46c['include'],function(_0x37e4e3){return{'model':db[_0x37e4e3[_0x8a35('0x23')]],'as':_0x37e4e3['as'],'attributes':_0x37e4e3['attributes'],'include':_0x37e4e3[_0x8a35('0x22')]?_['map'](_0x37e4e3[_0x8a35('0x22')],function(_0x4321fb){return{'model':db[_0x4321fb[_0x8a35('0x23')]],'as':_0x4321fb['as'],'attributes':_0x4321fb[_0x8a35('0x20')]};}):[]};}):[]};}):[]:[]})[_0x8a35('0x25')](function(_0x287193){logger[_0x8a35('0x10')]('GetVoiceQueueReport',_0x10d205);logger[_0x8a35('0x26')]('GetVoiceQueueReport',_0x10d205,JSON[_0x8a35('0x13')](_0x287193));_0x270de0(_0x287193);})['catch'](function(_0x1e7273){logger['error'](_0x8a35('0x1a'),_0x1e7273['message'],_0x10d205);_0x14d007(_0x41a35d[_0x8a35('0x14')](0x1f4,_0x1e7273[_0x8a35('0x16')]));});});};exports[_0x8a35('0x27')]=function(_0x39c049){var _0x3da02f=this;return new Promise(function(_0x2f2e66,_0x174c0e){return db['VoiceQueueReport'][_0x8a35('0x28')](_0x39c049[_0x8a35('0x29')],{'raw':_0x39c049[_0x8a35('0x1d')]?_0x39c049[_0x8a35('0x1d')][_0x8a35('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x52319c){logger[_0x8a35('0x10')](_0x8a35('0x27'),_0x39c049);logger['debug']('CreateVoiceQueueReport',_0x39c049,JSON[_0x8a35('0x13')](_0x52319c));_0x2f2e66(_0x52319c);})[_0x8a35('0x19')](function(_0x5eac09){logger[_0x8a35('0x14')](_0x8a35('0x27'),_0x5eac09[_0x8a35('0x16')],_0x39c049);_0x174c0e(_0x3da02f['error'](0x1f4,_0x5eac09['message']));});});};exports[_0x8a35('0x2a')]=function(_0xeb2f7f){var _0x1924c9=this;return new Promise(function(_0x53688c,_0x5b7489){return db[_0x8a35('0x1b')]['update'](_0xeb2f7f[_0x8a35('0x29')],{'raw':_0xeb2f7f[_0x8a35('0x1d')]?_0xeb2f7f[_0x8a35('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xeb2f7f[_0x8a35('0x1d')]?_0xeb2f7f['options'][_0x8a35('0x1f')]||null:null,'attributes':_0xeb2f7f[_0x8a35('0x1d')]?_0xeb2f7f[_0x8a35('0x1d')][_0x8a35('0x20')]||null:null,'limit':_0xeb2f7f[_0x8a35('0x1d')]?_0xeb2f7f[_0x8a35('0x1d')][_0x8a35('0x21')]||null:null})[_0x8a35('0x25')](function(_0x495099){logger[_0x8a35('0x10')]('UpdateVoiceQueueReport',_0xeb2f7f);logger[_0x8a35('0x26')](_0x8a35('0x2a'),_0xeb2f7f,JSON[_0x8a35('0x13')](_0x495099));_0x53688c(_0x495099);})[_0x8a35('0x19')](function(_0x534b4a){logger[_0x8a35('0x14')](_0x8a35('0x2a'),_0x534b4a[_0x8a35('0x16')],_0xeb2f7f);_0x5b7489(_0x1924c9['error'](0x1f4,_0x534b4a[_0x8a35('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 4c133da..92d9b52 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 _0x7d9f=['./voiceQueueReport.events','save','remove','update','emit','removeListener'];(function(_0x394238,_0x1b492a){var _0xa444ae=function(_0x40f05b){while(--_0x40f05b){_0x394238['push'](_0x394238['shift']());}};_0xa444ae(++_0x1b492a);}(_0x7d9f,0x15c));var _0xf7d9=function(_0x5e6ebe,_0x373752){_0x5e6ebe=_0x5e6ebe-0x0;var _0x5d80a0=_0x7d9f[_0x5e6ebe];return _0x5d80a0;};'use strict';var VoiceQueueReportEvents=require(_0xf7d9('0x0'));var events=[_0xf7d9('0x1'),_0xf7d9('0x2'),_0xf7d9('0x3')];function createListener(_0x265b56,_0x538e69){return function(_0x15a23b){_0x538e69[_0xf7d9('0x4')](_0x265b56,_0x15a23b);};}function removeListener(_0xd43b74,_0x159e95){return function(){VoiceQueueReportEvents[_0xf7d9('0x5')](_0xd43b74,_0x159e95);};}exports['register']=function(_0x4b50c7){for(var _0x2eb0f1=0x0,_0x250675=events['length'];_0x2eb0f1<_0x250675;_0x2eb0f1++){var _0x21c654=events[_0x2eb0f1];var _0x1685a6=createListener('voiceQueueReport:'+_0x21c654,_0x4b50c7);VoiceQueueReportEvents['on'](_0x21c654,_0x1685a6);}}; \ No newline at end of file +var _0xe06f=['removeListener','length','voiceQueueReport:','./voiceQueueReport.events','save','update','emit'];(function(_0x47f1cd,_0x387d6a){var _0x9ed116=function(_0x4f79cd){while(--_0x4f79cd){_0x47f1cd['push'](_0x47f1cd['shift']());}};_0x9ed116(++_0x387d6a);}(_0xe06f,0x65));var _0xfe06=function(_0x38b982,_0x2075b8){_0x38b982=_0x38b982-0x0;var _0x10ae6f=_0xe06f[_0x38b982];return _0x10ae6f;};'use strict';var VoiceQueueReportEvents=require(_0xfe06('0x0'));var events=[_0xfe06('0x1'),'remove',_0xfe06('0x2')];function createListener(_0x5d1104,_0x36858d){return function(_0x1a1da0){_0x36858d[_0xfe06('0x3')](_0x5d1104,_0x1a1da0);};}function removeListener(_0x1f0dec,_0x3a07cc){return function(){VoiceQueueReportEvents[_0xfe06('0x4')](_0x1f0dec,_0x3a07cc);};}exports['register']=function(_0x4b4be6){for(var _0x530973=0x0,_0x4446e9=events[_0xfe06('0x5')];_0x530973<_0x4446e9;_0x530973++){var _0x408027=events[_0x530973];var _0xb4d67a=createListener(_0xfe06('0x6')+_0x408027,_0x4b4be6);VoiceQueueReportEvents['on'](_0x408027,_0xb4d67a);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 91c180f..0a998b2 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 _0x12c0=['./voiceQueuesLog.controller','get','index','/:id','isAuthenticated','show','post','create','update','delete','exports','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x45ec28,_0x5a1f98){var _0x886180=function(_0x24614d){while(--_0x24614d){_0x45ec28['push'](_0x45ec28['shift']());}};_0x886180(++_0x5a1f98);}(_0x12c0,0x197));var _0x012c=function(_0x445ff3,_0x3bd1a9){_0x445ff3=_0x445ff3-0x0;var _0x315f17=_0x12c0[_0x445ff3];return _0x315f17;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x012c('0x0'));var timeout=require(_0x012c('0x1'));var express=require(_0x012c('0x2'));var router=express['Router']();var fs_extra=require(_0x012c('0x3'));var auth=require(_0x012c('0x4'));var interaction=require(_0x012c('0x5'));var config=require(_0x012c('0x6'));var controller=require(_0x012c('0x7'));router[_0x012c('0x8')]('/',auth['isAuthenticated'](),controller[_0x012c('0x9')]);router['get'](_0x012c('0xa'),auth[_0x012c('0xb')](),controller[_0x012c('0xc')]);router[_0x012c('0xd')]('/',auth[_0x012c('0xb')](),controller[_0x012c('0xe')]);router['put']('/:id',auth[_0x012c('0xb')](),controller[_0x012c('0xf')]);router[_0x012c('0x10')](_0x012c('0xa'),auth[_0x012c('0xb')](),controller['destroy']);module[_0x012c('0x11')]=router; \ No newline at end of file +var _0xe528=['Router','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','get','index','/:id','isAuthenticated','show','post','create','delete','destroy','path','connect-timeout','express'];(function(_0x38be,_0x2edf24){var _0x49c1ac=function(_0xb9ff24){while(--_0xb9ff24){_0x38be['push'](_0x38be['shift']());}};_0x49c1ac(++_0x2edf24);}(_0xe528,0x9d));var _0x8e52=function(_0x211b7a,_0x864ee2){_0x211b7a=_0x211b7a-0x0;var _0x22d5f5=_0xe528[_0x211b7a];return _0x22d5f5;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8e52('0x0'));var timeout=require(_0x8e52('0x1'));var express=require(_0x8e52('0x2'));var router=express[_0x8e52('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8e52('0x4'));var config=require(_0x8e52('0x5'));var controller=require(_0x8e52('0x6'));router[_0x8e52('0x7')]('/',auth['isAuthenticated'](),controller[_0x8e52('0x8')]);router[_0x8e52('0x7')](_0x8e52('0x9'),auth[_0x8e52('0xa')](),controller[_0x8e52('0xb')]);router[_0x8e52('0xc')]('/',auth[_0x8e52('0xa')](),controller[_0x8e52('0xd')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x8e52('0xe')](_0x8e52('0x9'),auth[_0x8e52('0xa')](),controller[_0x8e52('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 71d2326..97d4b17 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 _0xabaa=['moment','exports','STRING','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP'];(function(_0xa9e549,_0x1a0593){var _0x29f77c=function(_0x1bc5f3){while(--_0x1bc5f3){_0xa9e549['push'](_0xa9e549['shift']());}};_0x29f77c(++_0x1a0593);}(_0xabaa,0xfa));var _0xaaba=function(_0x71671a,_0x3e45b5){_0x71671a=_0x71671a-0x0;var _0x2ffd6e=_0xabaa[_0x71671a];return _0x2ffd6e;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xaaba('0x0'));module[_0xaaba('0x1')]={'time':{'type':Sequelize[_0xaaba('0x2')]},'callid':{'type':Sequelize[_0xaaba('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xaaba('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xaaba('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xaaba('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xaaba('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xaaba('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xaaba('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xaaba('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0xaaba('0x3')](_0xaaba('0x4'))}}; \ No newline at end of file +var _0xcd95=['DATE','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','moment','exports','STRING'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xcd95,0x13e));var _0x5cd9=function(_0x551bc1,_0x47cff3){_0x551bc1=_0x551bc1-0x0;var _0x12ea5e=_0xcd95[_0x551bc1];return _0x12ea5e;};'use strict';var Sequelize=require(_0x5cd9('0x0'));var moment=require(_0x5cd9('0x1'));module[_0x5cd9('0x2')]={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize[_0x5cd9('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x5cd9('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x5cd9('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x5cd9('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x5cd9('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x5cd9('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x5cd9('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x5cd9('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x5cd9('0x4')],'allowNull':![],'defaultValue':Sequelize[_0x5cd9('0x5')](_0x5cd9('0x6'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index 71b7b18..952948c 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 _0x09e1=['key','model','query','keys','filters','attributes','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','VoiceQueuesLog','findAll','rows','params','rawAttributes','intersection','fields','find','create','body','catch','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','limit','count','Content-Range','json','apply','reject','update','then','end','sendStatus','name','send','index','map','fieldName','type'];(function(_0xd1fed5,_0x3352ac){var _0x1b03b5=function(_0x3917d4){while(--_0x3917d4){_0xd1fed5['push'](_0xd1fed5['shift']());}};_0x1b03b5(++_0x3352ac);}(_0x09e1,0x69));var _0x109e=function(_0x586676,_0x287616){_0x586676=_0x586676-0x0;var _0x18acaa=_0x09e1[_0x586676];return _0x18acaa;};'use strict';var emlformat=require(_0x109e('0x0'));var rimraf=require(_0x109e('0x1'));var zipdir=require(_0x109e('0x2'));var jsonpatch=require(_0x109e('0x3'));var rp=require(_0x109e('0x4'));var moment=require(_0x109e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x109e('0x6'));var util=require(_0x109e('0x7'));var path=require(_0x109e('0x8'));var sox=require(_0x109e('0x9'));var csv=require('to-csv');var ejs=require(_0x109e('0xa'));var fs=require('fs');var fs_extra=require(_0x109e('0xb'));var _=require('lodash');var squel=require(_0x109e('0xc'));var crypto=require(_0x109e('0xd'));var jsforce=require(_0x109e('0xe'));var deskjs=require(_0x109e('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x109e('0x10'));var Redis=require(_0x109e('0x11'));var authService=require(_0x109e('0x12'));var qs=require(_0x109e('0x13'));var as=require(_0x109e('0x14'));var hardwareService=require(_0x109e('0x15'));var logger=require(_0x109e('0x16'))(_0x109e('0x17'));var utils=require(_0x109e('0x18'));var config=require(_0x109e('0x19'));var licenseUtil=require(_0x109e('0x1a'));var db=require(_0x109e('0x1b'))['db'];function respondWithStatusCode(_0x1d3da9,_0x1337a2){_0x1337a2=_0x1337a2||0xcc;return function(_0x113e53){if(_0x113e53){return _0x1d3da9['sendStatus'](_0x1337a2);}return _0x1d3da9['status'](_0x1337a2)['end']();};}function respondWithResult(_0x4c289e,_0x5e5d0d){_0x5e5d0d=_0x5e5d0d||0xc8;return function(_0x560380){if(_0x560380){return _0x4c289e[_0x109e('0x1c')](_0x5e5d0d)['json'](_0x560380);}};}function respondWithFilteredResult(_0x14cea1,_0x4efada){return function(_0x24701f){if(_0x24701f){var _0x4d929b=typeof _0x4efada[_0x109e('0x1d')]===_0x109e('0x1e')&&typeof _0x4efada[_0x109e('0x1f')]===_0x109e('0x1e');var _0x253c12=_0x24701f['count'];var _0xcd08a9=_0x4d929b?0x0:_0x4efada['offset'];var _0x4bbca9=_0x4d929b?_0x24701f[_0x109e('0x20')]:_0x4efada['offset']+_0x4efada[_0x109e('0x1f')];var _0x5f1a29;if(_0x4bbca9>=_0x253c12){_0x4bbca9=_0x253c12;_0x5f1a29=0xc8;}else{_0x5f1a29=0xce;}_0x14cea1[_0x109e('0x1c')](_0x5f1a29);return _0x14cea1['set'](_0x109e('0x21'),_0xcd08a9+'-'+_0x4bbca9+'/'+_0x253c12)[_0x109e('0x22')](_0x24701f);}return null;};}function patchUpdates(_0x533e78){return function(_0x12faca){try{jsonpatch[_0x109e('0x23')](_0x12faca,_0x533e78,!![]);}catch(_0x5279b2){return BPromise[_0x109e('0x24')](_0x5279b2);}return _0x12faca['save']();};}function saveUpdates(_0x32c95c,_0x2d7802){return function(_0xa15116){if(_0xa15116){return _0xa15116[_0x109e('0x25')](_0x32c95c)[_0x109e('0x26')](function(_0x269a76){return _0x269a76;});}return null;};}function removeEntity(_0x21bfd6,_0x816c59){return function(_0x3df679){if(_0x3df679){return _0x3df679['destroy']()[_0x109e('0x26')](function(){_0x21bfd6[_0x109e('0x1c')](0xcc)[_0x109e('0x27')]();});}};}function handleEntityNotFound(_0x9772ec,_0x551662){return function(_0x3b6843){if(!_0x3b6843){_0x9772ec[_0x109e('0x28')](0x194);}return _0x3b6843;};}function handleError(_0x54e28a,_0xde3d1c){_0xde3d1c=_0xde3d1c||0x1f4;return function(_0x38aa08){logger['error'](_0x38aa08['stack']);if(_0x38aa08[_0x109e('0x29')]){delete _0x38aa08[_0x109e('0x29')];}_0x54e28a[_0x109e('0x1c')](_0xde3d1c)[_0x109e('0x2a')](_0x38aa08);};}exports[_0x109e('0x2b')]=function(_0x2bb046,_0x5851be){var _0x16dfdc={},_0x535702={},_0x61eb7b={'count':0x0,'rows':[]};var _0x4a5d58=_[_0x109e('0x2c')](db['VoiceQueuesLog']['rawAttributes'],function(_0x2cc278){return{'name':_0x2cc278[_0x109e('0x2d')],'type':_0x2cc278[_0x109e('0x2e')][_0x109e('0x2f')]};});_0x535702[_0x109e('0x30')]=_[_0x109e('0x2c')](_0x4a5d58,_0x109e('0x29'));_0x535702[_0x109e('0x31')]=_[_0x109e('0x32')](_0x2bb046['query']);_0x535702[_0x109e('0x33')]=_['intersection'](_0x535702[_0x109e('0x30')],_0x535702['query']);_0x16dfdc[_0x109e('0x34')]=_['intersection'](_0x535702[_0x109e('0x30')],qs['fields'](_0x2bb046[_0x109e('0x31')]['fields']));_0x16dfdc[_0x109e('0x34')]=_0x16dfdc[_0x109e('0x34')][_0x109e('0x35')]?_0x16dfdc[_0x109e('0x34')]:_0x535702[_0x109e('0x30')];if(!_0x2bb046[_0x109e('0x31')]['hasOwnProperty'](_0x109e('0x36'))){_0x16dfdc[_0x109e('0x1f')]=qs[_0x109e('0x1f')](_0x2bb046[_0x109e('0x31')][_0x109e('0x1f')]);_0x16dfdc['offset']=qs[_0x109e('0x1d')](_0x2bb046[_0x109e('0x31')][_0x109e('0x1d')]);}_0x16dfdc['order']=qs[_0x109e('0x37')](_0x2bb046[_0x109e('0x31')]['sort']);_0x16dfdc[_0x109e('0x38')]=qs['filters'](_[_0x109e('0x39')](_0x2bb046[_0x109e('0x31')],_0x535702[_0x109e('0x33')]),_0x4a5d58);if(_0x2bb046[_0x109e('0x31')][_0x109e('0x3a')]){_0x16dfdc[_0x109e('0x38')]=_[_0x109e('0x3b')](_0x16dfdc[_0x109e('0x38')],{'$or':_[_0x109e('0x2c')](_0x4a5d58,function(_0x4ea9c9){if(_0x4ea9c9[_0x109e('0x2e')]!==_0x109e('0x3c')){var _0x451477={};_0x451477[_0x4ea9c9['name']]={'$like':'%'+_0x2bb046[_0x109e('0x31')][_0x109e('0x3a')]+'%'};return _0x451477;}})});}_0x16dfdc=_['merge']({},_0x16dfdc,_0x2bb046[_0x109e('0x3d')]);var _0x5e08b6={'where':_0x16dfdc[_0x109e('0x38')]};return db['VoiceQueuesLog'][_0x109e('0x20')](_0x5e08b6)[_0x109e('0x26')](function(_0x4a5715){_0x61eb7b[_0x109e('0x20')]=_0x4a5715;if(_0x2bb046[_0x109e('0x31')][_0x109e('0x3e')]){_0x16dfdc[_0x109e('0x3f')]=[{'all':!![]}];}return db[_0x109e('0x40')][_0x109e('0x41')](_0x16dfdc);})[_0x109e('0x26')](function(_0x16834d){_0x61eb7b[_0x109e('0x42')]=_0x16834d;return _0x61eb7b;})['then'](respondWithFilteredResult(_0x5851be,_0x16dfdc))['catch'](handleError(_0x5851be,null));};exports['show']=function(_0x1c5d3b,_0x21e588){var _0x1fd26c={'raw':!![],'where':{'id':_0x1c5d3b[_0x109e('0x43')]['id']}},_0x5408ed={};_0x5408ed['model']=_[_0x109e('0x32')](db[_0x109e('0x40')][_0x109e('0x44')]);_0x5408ed[_0x109e('0x31')]=_[_0x109e('0x32')](_0x1c5d3b[_0x109e('0x31')]);_0x5408ed[_0x109e('0x33')]=_['intersection'](_0x5408ed[_0x109e('0x30')],_0x5408ed[_0x109e('0x31')]);_0x1fd26c['attributes']=_[_0x109e('0x45')](_0x5408ed[_0x109e('0x30')],qs[_0x109e('0x46')](_0x1c5d3b[_0x109e('0x31')]['fields']));_0x1fd26c['attributes']=_0x1fd26c[_0x109e('0x34')]['length']?_0x1fd26c[_0x109e('0x34')]:_0x5408ed[_0x109e('0x30')];if(_0x1c5d3b[_0x109e('0x31')][_0x109e('0x3e')]){_0x1fd26c['include']=[{'all':!![]}];}_0x1fd26c=_[_0x109e('0x3b')]({},_0x1fd26c,_0x1c5d3b[_0x109e('0x3d')]);return db[_0x109e('0x40')][_0x109e('0x47')](_0x1fd26c)[_0x109e('0x26')](handleEntityNotFound(_0x21e588,null))['then'](respondWithResult(_0x21e588,null))['catch'](handleError(_0x21e588,null));};exports[_0x109e('0x48')]=function(_0x1ff074,_0xb74f73){return db[_0x109e('0x40')][_0x109e('0x48')](_0x1ff074[_0x109e('0x49')],{})[_0x109e('0x26')](respondWithResult(_0xb74f73,0xc9))[_0x109e('0x4a')](handleError(_0xb74f73,null));};exports[_0x109e('0x25')]=function(_0x58ac1b,_0x559d3b){if(_0x58ac1b['body']['id']){delete _0x58ac1b['body']['id'];}return db[_0x109e('0x40')][_0x109e('0x47')]({'where':{'id':_0x58ac1b[_0x109e('0x43')]['id']}})[_0x109e('0x26')](handleEntityNotFound(_0x559d3b,null))[_0x109e('0x26')](saveUpdates(_0x58ac1b[_0x109e('0x49')],null))['then'](respondWithResult(_0x559d3b,null))['catch'](handleError(_0x559d3b,null));};exports[_0x109e('0x4b')]=function(_0x142b9a,_0x414ea5){return db[_0x109e('0x40')][_0x109e('0x47')]({'where':{'id':_0x142b9a['params']['id']}})['then'](handleEntityNotFound(_0x414ea5,null))['then'](removeEntity(_0x414ea5,null))['catch'](handleError(_0x414ea5,null));}; \ No newline at end of file +var _0x6cd7=['reject','save','update','then','destroy','end','sendStatus','stack','name','send','VoiceQueuesLog','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','include','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','fs-extra','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','offset','undefined','limit','count','set','Content-Range','apply'];(function(_0x10f3f2,_0x3b6b94){var _0x4cb63b=function(_0x4f3ec2){while(--_0x4f3ec2){_0x10f3f2['push'](_0x10f3f2['shift']());}};_0x4cb63b(++_0x3b6b94);}(_0x6cd7,0xbf));var _0x76cd=function(_0x3a1dec,_0x1f943f){_0x3a1dec=_0x3a1dec-0x0;var _0x60ede0=_0x6cd7[_0x3a1dec];return _0x60ede0;};'use strict';var emlformat=require(_0x76cd('0x0'));var rimraf=require(_0x76cd('0x1'));var zipdir=require(_0x76cd('0x2'));var jsonpatch=require(_0x76cd('0x3'));var rp=require('request-promise');var moment=require(_0x76cd('0x4'));var BPromise=require(_0x76cd('0x5'));var Mustache=require('mustache');var util=require(_0x76cd('0x6'));var path=require(_0x76cd('0x7'));var sox=require('sox');var csv=require(_0x76cd('0x8'));var ejs=require(_0x76cd('0x9'));var fs=require('fs');var fs_extra=require(_0x76cd('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x76cd('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x76cd('0xc'));var toCsv=require(_0x76cd('0x8'));var querystring=require(_0x76cd('0xd'));var Papa=require('papaparse');var Redis=require(_0x76cd('0xe'));var authService=require(_0x76cd('0xf'));var qs=require(_0x76cd('0x10'));var as=require(_0x76cd('0x11'));var hardwareService=require(_0x76cd('0x12'));var logger=require(_0x76cd('0x13'))(_0x76cd('0x14'));var utils=require(_0x76cd('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x76cd('0x16'))['db'];function respondWithStatusCode(_0x49895d,_0x3f743a){_0x3f743a=_0x3f743a||0xcc;return function(_0x2d7b12){if(_0x2d7b12){return _0x49895d['sendStatus'](_0x3f743a);}return _0x49895d[_0x76cd('0x17')](_0x3f743a)['end']();};}function respondWithResult(_0x1cd628,_0x1bc85c){_0x1bc85c=_0x1bc85c||0xc8;return function(_0x54090d){if(_0x54090d){return _0x1cd628['status'](_0x1bc85c)['json'](_0x54090d);}};}function respondWithFilteredResult(_0x36ef3b,_0x213a96){return function(_0x4f3a95){if(_0x4f3a95){var _0x58f3b4=typeof _0x213a96[_0x76cd('0x18')]===_0x76cd('0x19')&&typeof _0x213a96[_0x76cd('0x1a')]===_0x76cd('0x19');var _0x4636fb=_0x4f3a95[_0x76cd('0x1b')];var _0x3decc6=_0x58f3b4?0x0:_0x213a96[_0x76cd('0x18')];var _0x12071a=_0x58f3b4?_0x4f3a95[_0x76cd('0x1b')]:_0x213a96['offset']+_0x213a96['limit'];var _0x55f5b5;if(_0x12071a>=_0x4636fb){_0x12071a=_0x4636fb;_0x55f5b5=0xc8;}else{_0x55f5b5=0xce;}_0x36ef3b[_0x76cd('0x17')](_0x55f5b5);return _0x36ef3b[_0x76cd('0x1c')](_0x76cd('0x1d'),_0x3decc6+'-'+_0x12071a+'/'+_0x4636fb)['json'](_0x4f3a95);}return null;};}function patchUpdates(_0x252852){return function(_0x24c6bd){try{jsonpatch[_0x76cd('0x1e')](_0x24c6bd,_0x252852,!![]);}catch(_0x30eee8){return BPromise[_0x76cd('0x1f')](_0x30eee8);}return _0x24c6bd[_0x76cd('0x20')]();};}function saveUpdates(_0x52e8d4,_0x5fa0e7){return function(_0x2100e1){if(_0x2100e1){return _0x2100e1[_0x76cd('0x21')](_0x52e8d4)[_0x76cd('0x22')](function(_0x9e1afa){return _0x9e1afa;});}return null;};}function removeEntity(_0x37d283,_0x3b1395){return function(_0x8f5c8e){if(_0x8f5c8e){return _0x8f5c8e[_0x76cd('0x23')]()[_0x76cd('0x22')](function(){_0x37d283[_0x76cd('0x17')](0xcc)[_0x76cd('0x24')]();});}};}function handleEntityNotFound(_0x50d580,_0x1f88cd){return function(_0x49d335){if(!_0x49d335){_0x50d580[_0x76cd('0x25')](0x194);}return _0x49d335;};}function handleError(_0x12c529,_0xfc0cc0){_0xfc0cc0=_0xfc0cc0||0x1f4;return function(_0x3b5ff3){logger['error'](_0x3b5ff3[_0x76cd('0x26')]);if(_0x3b5ff3['name']){delete _0x3b5ff3[_0x76cd('0x27')];}_0x12c529[_0x76cd('0x17')](_0xfc0cc0)[_0x76cd('0x28')](_0x3b5ff3);};}exports['index']=function(_0x58847e,_0x1561fc){var _0x315ff1={},_0x446ab1={},_0x1a36f3={'count':0x0,'rows':[]};var _0x27bd6d=_['map'](db[_0x76cd('0x29')][_0x76cd('0x2a')],function(_0x45feca){return{'name':_0x45feca[_0x76cd('0x2b')],'type':_0x45feca[_0x76cd('0x2c')][_0x76cd('0x2d')]};});_0x446ab1[_0x76cd('0x2e')]=_[_0x76cd('0x2f')](_0x27bd6d,'name');_0x446ab1[_0x76cd('0x30')]=_[_0x76cd('0x31')](_0x58847e[_0x76cd('0x30')]);_0x446ab1['filters']=_[_0x76cd('0x32')](_0x446ab1[_0x76cd('0x2e')],_0x446ab1[_0x76cd('0x30')]);_0x315ff1[_0x76cd('0x33')]=_[_0x76cd('0x32')](_0x446ab1[_0x76cd('0x2e')],qs['fields'](_0x58847e[_0x76cd('0x30')][_0x76cd('0x34')]));_0x315ff1[_0x76cd('0x33')]=_0x315ff1['attributes'][_0x76cd('0x35')]?_0x315ff1[_0x76cd('0x33')]:_0x446ab1[_0x76cd('0x2e')];if(!_0x58847e[_0x76cd('0x30')][_0x76cd('0x36')](_0x76cd('0x37'))){_0x315ff1[_0x76cd('0x1a')]=qs[_0x76cd('0x1a')](_0x58847e[_0x76cd('0x30')][_0x76cd('0x1a')]);_0x315ff1[_0x76cd('0x18')]=qs[_0x76cd('0x18')](_0x58847e['query'][_0x76cd('0x18')]);}_0x315ff1[_0x76cd('0x38')]=qs[_0x76cd('0x39')](_0x58847e[_0x76cd('0x30')][_0x76cd('0x39')]);_0x315ff1['where']=qs[_0x76cd('0x3a')](_['pick'](_0x58847e[_0x76cd('0x30')],_0x446ab1[_0x76cd('0x3a')]),_0x27bd6d);if(_0x58847e[_0x76cd('0x30')][_0x76cd('0x3b')]){_0x315ff1[_0x76cd('0x3c')]=_['merge'](_0x315ff1[_0x76cd('0x3c')],{'$or':_['map'](_0x27bd6d,function(_0x3d58f3){if(_0x3d58f3['type']!==_0x76cd('0x3d')){var _0x19e8fe={};_0x19e8fe[_0x3d58f3[_0x76cd('0x27')]]={'$like':'%'+_0x58847e[_0x76cd('0x30')][_0x76cd('0x3b')]+'%'};return _0x19e8fe;}})});}_0x315ff1=_[_0x76cd('0x3e')]({},_0x315ff1,_0x58847e[_0x76cd('0x3f')]);var _0x45f568={'where':_0x315ff1['where']};return db[_0x76cd('0x29')]['count'](_0x45f568)[_0x76cd('0x22')](function(_0x2873f1){_0x1a36f3['count']=_0x2873f1;if(_0x58847e['query'][_0x76cd('0x40')]){_0x315ff1['include']=[{'all':!![]}];}return db[_0x76cd('0x29')][_0x76cd('0x41')](_0x315ff1);})[_0x76cd('0x22')](function(_0x18ea69){_0x1a36f3[_0x76cd('0x42')]=_0x18ea69;return _0x1a36f3;})[_0x76cd('0x22')](respondWithFilteredResult(_0x1561fc,_0x315ff1))[_0x76cd('0x43')](handleError(_0x1561fc,null));};exports[_0x76cd('0x44')]=function(_0x100620,_0x3d2a73){var _0x4393b5={'raw':!![],'where':{'id':_0x100620['params']['id']}},_0x3dfacf={};_0x3dfacf[_0x76cd('0x2e')]=_[_0x76cd('0x31')](db['VoiceQueuesLog']['rawAttributes']);_0x3dfacf[_0x76cd('0x30')]=_['keys'](_0x100620[_0x76cd('0x30')]);_0x3dfacf[_0x76cd('0x3a')]=_['intersection'](_0x3dfacf[_0x76cd('0x2e')],_0x3dfacf['query']);_0x4393b5['attributes']=_[_0x76cd('0x32')](_0x3dfacf[_0x76cd('0x2e')],qs['fields'](_0x100620[_0x76cd('0x30')]['fields']));_0x4393b5[_0x76cd('0x33')]=_0x4393b5[_0x76cd('0x33')][_0x76cd('0x35')]?_0x4393b5[_0x76cd('0x33')]:_0x3dfacf[_0x76cd('0x2e')];if(_0x100620[_0x76cd('0x30')][_0x76cd('0x40')]){_0x4393b5[_0x76cd('0x45')]=[{'all':!![]}];}_0x4393b5=_[_0x76cd('0x3e')]({},_0x4393b5,_0x100620[_0x76cd('0x3f')]);return db[_0x76cd('0x29')][_0x76cd('0x46')](_0x4393b5)[_0x76cd('0x22')](handleEntityNotFound(_0x3d2a73,null))[_0x76cd('0x22')](respondWithResult(_0x3d2a73,null))[_0x76cd('0x43')](handleError(_0x3d2a73,null));};exports['create']=function(_0x286a66,_0xdea6c1){return db['VoiceQueuesLog'][_0x76cd('0x47')](_0x286a66[_0x76cd('0x48')],{})[_0x76cd('0x22')](respondWithResult(_0xdea6c1,0xc9))[_0x76cd('0x43')](handleError(_0xdea6c1,null));};exports['update']=function(_0x3ca7ef,_0x392593){if(_0x3ca7ef['body']['id']){delete _0x3ca7ef[_0x76cd('0x48')]['id'];}return db[_0x76cd('0x29')]['find']({'where':{'id':_0x3ca7ef[_0x76cd('0x49')]['id']}})[_0x76cd('0x22')](handleEntityNotFound(_0x392593,null))[_0x76cd('0x22')](saveUpdates(_0x3ca7ef[_0x76cd('0x48')],null))['then'](respondWithResult(_0x392593,null))['catch'](handleError(_0x392593,null));};exports['destroy']=function(_0x21fdb4,_0x484e55){return db[_0x76cd('0x29')][_0x76cd('0x46')]({'where':{'id':_0x21fdb4['params']['id']}})['then'](handleEntityNotFound(_0x484e55,null))[_0x76cd('0x22')](removeEntity(_0x484e55,null))['catch'](handleError(_0x484e55,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 71644f1..fd82752 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 _0xd59a=['api','bluebird','path','rimraf','exports','define','VoiceQueuesLog','voice_queues_log','event_dtm','lodash','util','../../config/logger'];(function(_0x314a8c,_0x1c2e8d){var _0x1d4607=function(_0x3df20c){while(--_0x3df20c){_0x314a8c['push'](_0x314a8c['shift']());}};_0x1d4607(++_0x1c2e8d);}(_0xd59a,0x17d));var _0xad59=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xd59a[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xad59('0x0'));var util=require(_0xad59('0x1'));var logger=require(_0xad59('0x2'))(_0xad59('0x3'));var moment=require('moment');var BPromise=require(_0xad59('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xad59('0x5'));var rimraf=require(_0xad59('0x6'));var config=require('../../config/environment');var attributes=require('./voiceQueuesLog.attributes');module[_0xad59('0x7')]=function(_0x3cf16f,_0x50f1bf){return _0x3cf16f[_0xad59('0x8')](_0xad59('0x9'),attributes,{'tableName':_0xad59('0xa'),'paranoid':![],'indexes':[{'name':_0xad59('0xb'),'fields':['event','dtm']}],'timestamps':![]});}; \ No newline at end of file +var _0xb622=['./voiceQueuesLog.attributes','exports','define','VoiceQueuesLog','voice_queues_log','event_dtm','dtm','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb622,0x1e7));var _0x2b62=function(_0x5eabbf,_0x3542c6){_0x5eabbf=_0x5eabbf-0x0;var _0x35d418=_0xb622[_0x5eabbf];return _0x35d418;};'use strict';var _=require('lodash');var util=require(_0x2b62('0x0'));var logger=require(_0x2b62('0x1'))(_0x2b62('0x2'));var moment=require(_0x2b62('0x3'));var BPromise=require(_0x2b62('0x4'));var rp=require(_0x2b62('0x5'));var fs=require('fs');var path=require(_0x2b62('0x6'));var rimraf=require(_0x2b62('0x7'));var config=require(_0x2b62('0x8'));var attributes=require(_0x2b62('0x9'));module[_0x2b62('0xa')]=function(_0x23a401,_0x467837){return _0x23a401[_0x2b62('0xb')](_0x2b62('0xc'),attributes,{'tableName':_0x2b62('0xd'),'paranoid':![],'indexes':[{'name':_0x2b62('0xe'),'fields':['event',_0x2b62('0xf')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index cb75072..b571bb1 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 _0x1596=['then','info','VoiceQueuesLog,\x20%s,\x20%s','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http'];(function(_0x31c3be,_0x5e540f){var _0x48314d=function(_0x65134b){while(--_0x65134b){_0x31c3be['push'](_0x31c3be['shift']());}};_0x48314d(++_0x5e540f);}(_0x1596,0x16f));var _0x6159=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x1596[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0x6159('0x0'));var util=require(_0x6159('0x1'));var moment=require(_0x6159('0x2'));var BPromise=require(_0x6159('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6159('0x4'));var db=require(_0x6159('0x5'))['db'];var utils=require(_0x6159('0x6'));var logger=require('../../config/logger')(_0x6159('0x7'));var config=require(_0x6159('0x8'));var jayson=require(_0x6159('0x9'));var client=jayson['client'][_0x6159('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x28f030,_0xa325fe,_0x2d530e){return new BPromise(function(_0x1784b6,_0x2bf835){return client['request'](_0x28f030,_0x2d530e)[_0x6159('0xb')](function(_0x4e6cf6){logger[_0x6159('0xc')](_0x6159('0xd'),_0xa325fe,'request\x20sent');logger[_0x6159('0xe')](_0x6159('0xf'),_0xa325fe,_0x6159('0x10'),JSON['stringify'](_0x4e6cf6));if(_0x4e6cf6['error']){if(_0x4e6cf6[_0x6159('0x11')][_0x6159('0x12')]===0x1f4){logger[_0x6159('0x11')](_0x6159('0xd'),_0xa325fe,_0x4e6cf6[_0x6159('0x11')][_0x6159('0x13')]);return _0x2bf835(_0x4e6cf6[_0x6159('0x11')][_0x6159('0x13')]);}logger[_0x6159('0x11')](_0x6159('0xd'),_0xa325fe,_0x4e6cf6[_0x6159('0x11')][_0x6159('0x13')]);return _0x1784b6(_0x4e6cf6[_0x6159('0x11')][_0x6159('0x13')]);}else{logger[_0x6159('0xc')](_0x6159('0xd'),_0xa325fe,_0x6159('0x10'));_0x1784b6(_0x4e6cf6[_0x6159('0x14')]['message']);}})['catch'](function(_0x316630){logger[_0x6159('0x11')](_0x6159('0xd'),_0xa325fe,_0x316630);_0x2bf835(_0x316630);});});} \ No newline at end of file +var _0x2948=['then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request'];(function(_0x2dab94,_0x30caba){var _0x5bd5fe=function(_0xbf09ab){while(--_0xbf09ab){_0x2dab94['push'](_0x2dab94['shift']());}};_0x5bd5fe(++_0x30caba);}(_0x2948,0xcb));var _0x8294=function(_0x581ec8,_0x5584f6){_0x581ec8=_0x581ec8-0x0;var _0x5974bd=_0x2948[_0x581ec8];return _0x5974bd;};'use strict';var _=require(_0x8294('0x0'));var util=require(_0x8294('0x1'));var moment=require(_0x8294('0x2'));var BPromise=require(_0x8294('0x3'));var rs=require(_0x8294('0x4'));var fs=require('fs');var Redis=require(_0x8294('0x5'));var db=require(_0x8294('0x6'))['db'];var utils=require(_0x8294('0x7'));var logger=require(_0x8294('0x8'))('rpc');var config=require(_0x8294('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x8294('0xa')][_0x8294('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x39aa65,_0x514609,_0x5a7135){return new BPromise(function(_0x56f7c8,_0x530786){return client[_0x8294('0xc')](_0x39aa65,_0x5a7135)[_0x8294('0xd')](function(_0x545613){logger[_0x8294('0xe')](_0x8294('0xf'),_0x514609,_0x8294('0x10'));logger[_0x8294('0x11')](_0x8294('0x12'),_0x514609,_0x8294('0x10'),JSON['stringify'](_0x545613));if(_0x545613[_0x8294('0x13')]){if(_0x545613[_0x8294('0x13')][_0x8294('0x14')]===0x1f4){logger[_0x8294('0x13')](_0x8294('0xf'),_0x514609,_0x545613[_0x8294('0x13')][_0x8294('0x15')]);return _0x530786(_0x545613[_0x8294('0x13')]['message']);}logger[_0x8294('0x13')](_0x8294('0xf'),_0x514609,_0x545613[_0x8294('0x13')]['message']);return _0x56f7c8(_0x545613['error']['message']);}else{logger[_0x8294('0xe')](_0x8294('0xf'),_0x514609,_0x8294('0x10'));_0x56f7c8(_0x545613[_0x8294('0x16')][_0x8294('0x15')]);}})[_0x8294('0x17')](function(_0x2a501a){logger[_0x8294('0x13')](_0x8294('0xf'),_0x514609,_0x2a501a);_0x530786(_0x2a501a);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 3029ac2..4f7ae0b 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 _0x2dea=['connect-timeout','express','fs-extra','../../components/interaction/service','./voiceRecording.controller','get','isAuthenticated','index','describe','/:id','show','/:id/download','download','/:id/downloads','downloads','/:id/transcribe','downloadTranscribe','post','create','runTranscribe','put','update','delete','destroy','exports','multer'];(function(_0x408456,_0x30c351){var _0x36c47b=function(_0xa32976){while(--_0xa32976){_0x408456['push'](_0x408456['shift']());}};_0x36c47b(++_0x30c351);}(_0x2dea,0x1d3));var _0xa2de=function(_0x30e941,_0x24a9ef){_0x30e941=_0x30e941-0x0;var _0x45f43f=_0x2dea[_0x30e941];return _0x45f43f;};'use strict';var multer=require(_0xa2de('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xa2de('0x1'));var express=require(_0xa2de('0x2'));var router=express['Router']();var fs_extra=require(_0xa2de('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa2de('0x4'));var config=require('../../config/environment');var controller=require(_0xa2de('0x5'));router[_0xa2de('0x6')]('/',auth[_0xa2de('0x7')](),controller[_0xa2de('0x8')]);router[_0xa2de('0x6')]('/describe',auth[_0xa2de('0x7')](),controller[_0xa2de('0x9')]);router[_0xa2de('0x6')](_0xa2de('0xa'),auth['isAuthenticated'](),controller[_0xa2de('0xb')]);router[_0xa2de('0x6')](_0xa2de('0xc'),auth[_0xa2de('0x7')](),controller[_0xa2de('0xd')]);router[_0xa2de('0x6')](_0xa2de('0xe'),controller[_0xa2de('0xf')]);router[_0xa2de('0x6')](_0xa2de('0x10'),auth[_0xa2de('0x7')](),controller[_0xa2de('0x11')]);router[_0xa2de('0x12')]('/',auth[_0xa2de('0x7')](),controller[_0xa2de('0x13')]);router[_0xa2de('0x12')](_0xa2de('0x10'),auth['isAuthenticated'](),controller[_0xa2de('0x14')]);router[_0xa2de('0x15')]('/:id',auth[_0xa2de('0x7')](),controller[_0xa2de('0x16')]);router[_0xa2de('0x17')]('/:id',auth['isAuthenticated'](),controller[_0xa2de('0x18')]);module[_0xa2de('0x19')]=router; \ No newline at end of file +var _0x9c1a=['fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','describe','/:id','show','/:id/download','download','/:id/downloads','/:id/transcribe','downloadTranscribe','post','create','runTranscribe','put','update','delete','destroy','exports','multer','util','path','express','Router'];(function(_0x2620e1,_0x155788){var _0x12e4d4=function(_0x3dd78f){while(--_0x3dd78f){_0x2620e1['push'](_0x2620e1['shift']());}};_0x12e4d4(++_0x155788);}(_0x9c1a,0xee));var _0xa9c1=function(_0x173c92,_0x1215b7){_0x173c92=_0x173c92-0x0;var _0x5b1687=_0x9c1a[_0x173c92];return _0x5b1687;};'use strict';var multer=require(_0xa9c1('0x0'));var util=require(_0xa9c1('0x1'));var path=require(_0xa9c1('0x2'));var timeout=require('connect-timeout');var express=require(_0xa9c1('0x3'));var router=express[_0xa9c1('0x4')]();var fs_extra=require(_0xa9c1('0x5'));var auth=require(_0xa9c1('0x6'));var interaction=require(_0xa9c1('0x7'));var config=require('../../config/environment');var controller=require('./voiceRecording.controller');router[_0xa9c1('0x8')]('/',auth[_0xa9c1('0x9')](),controller[_0xa9c1('0xa')]);router[_0xa9c1('0x8')]('/describe',auth[_0xa9c1('0x9')](),controller[_0xa9c1('0xb')]);router[_0xa9c1('0x8')](_0xa9c1('0xc'),auth[_0xa9c1('0x9')](),controller[_0xa9c1('0xd')]);router[_0xa9c1('0x8')](_0xa9c1('0xe'),auth['isAuthenticated'](),controller[_0xa9c1('0xf')]);router[_0xa9c1('0x8')](_0xa9c1('0x10'),controller['downloads']);router[_0xa9c1('0x8')](_0xa9c1('0x11'),auth['isAuthenticated'](),controller[_0xa9c1('0x12')]);router[_0xa9c1('0x13')]('/',auth[_0xa9c1('0x9')](),controller[_0xa9c1('0x14')]);router[_0xa9c1('0x13')](_0xa9c1('0x11'),auth[_0xa9c1('0x9')](),controller[_0xa9c1('0x15')]);router[_0xa9c1('0x16')](_0xa9c1('0xc'),auth[_0xa9c1('0x9')](),controller[_0xa9c1('0x17')]);router[_0xa9c1('0x18')]('/:id',auth[_0xa9c1('0x9')](),controller[_0xa9c1('0x19')]);module[_0xa9c1('0x1a')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index 1826d4d..8affed2 100644 --- a/server/api/voiceRecording/voiceRecording.attributes.js +++ b/server/api/voiceRecording/voiceRecording.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['DATE','updatedAt','toString','sequelize','moment','path','getDataValue','extname','value','STRING','setDataValue','channel','TEXT','NEW','FLOAT','BOOLEAN','format','MM-DD-YYYY\x20HH:mm'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0xa9e0[_0x1cfa0d];return _0xe33279;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0a9e('0x3')]('value')?path[_0x0a9e('0x4')](this[_0x0a9e('0x3')](_0x0a9e('0x5'))):undefined;}},'uniqueid':{'type':Sequelize[_0x0a9e('0x6')]},'channel':{'type':Sequelize[_0x0a9e('0x6')],'set':function(_0x57b080){if(_0x57b080){this[_0x0a9e('0x7')](_0x0a9e('0x8'),_0x57b080);this[_0x0a9e('0x7')]('membername',_0x57b080['split'](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x0a9e('0x6')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x0a9e('0x6')]},'connectedlinename':{'type':Sequelize[_0x0a9e('0x6')]},'accountcode':{'type':Sequelize[_0x0a9e('0x6')]},'context':{'type':Sequelize[_0x0a9e('0x6')]},'exten':{'type':Sequelize[_0x0a9e('0x6')]},'value':{'type':Sequelize[_0x0a9e('0x6')]},'type':{'type':Sequelize['STRING']},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'userThirdDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'location':{'type':Sequelize[_0x0a9e('0x9')]},'transcribeName':{'type':Sequelize[_0x0a9e('0x6')]},'transcribeStatus':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':_0x0a9e('0xa')},'fileUri':{'type':Sequelize['TEXT']},'fileText':{'type':Sequelize[_0x0a9e('0x9')]},'failureReason':{'type':Sequelize[_0x0a9e('0x9')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')]},'sPositive':{'type':Sequelize[_0x0a9e('0xb')]},'sNegative':{'type':Sequelize[_0x0a9e('0xb')]},'sNeutral':{'type':Sequelize[_0x0a9e('0xb')]},'sMixed':{'type':Sequelize['FLOAT']},'tempSentiment':{'type':Sequelize[_0x0a9e('0xc')],'defaultValue':![]},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x0a9e('0x3')]('createdAt'))[_0x0a9e('0xd')](_0x0a9e('0xe'))['toString']();}},'updatedAt':{'type':Sequelize[_0x0a9e('0xf')],'get':function(){return moment(this['getDataValue'](_0x0a9e('0x10')))[_0x0a9e('0xd')](_0x0a9e('0xe'))[_0x0a9e('0x11')]();}}}; \ No newline at end of file +var _0xa9e0=['DATE','updatedAt','toString','sequelize','moment','path','getDataValue','extname','value','STRING','setDataValue','channel','TEXT','NEW','FLOAT','BOOLEAN','format','MM-DD-YYYY\x20HH:mm'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xa9e0[_0xbe200f];return _0x192597;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0a9e('0x3')]('value')?path[_0x0a9e('0x4')](this[_0x0a9e('0x3')](_0x0a9e('0x5'))):undefined;}},'uniqueid':{'type':Sequelize[_0x0a9e('0x6')]},'channel':{'type':Sequelize[_0x0a9e('0x6')],'set':function(_0x57b080){if(_0x57b080){this[_0x0a9e('0x7')](_0x0a9e('0x8'),_0x57b080);this[_0x0a9e('0x7')]('membername',_0x57b080['split'](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x0a9e('0x6')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x0a9e('0x6')]},'connectedlinename':{'type':Sequelize[_0x0a9e('0x6')]},'accountcode':{'type':Sequelize[_0x0a9e('0x6')]},'context':{'type':Sequelize[_0x0a9e('0x6')]},'exten':{'type':Sequelize[_0x0a9e('0x6')]},'value':{'type':Sequelize[_0x0a9e('0x6')]},'type':{'type':Sequelize['STRING']},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'userThirdDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'location':{'type':Sequelize[_0x0a9e('0x9')]},'transcribeName':{'type':Sequelize[_0x0a9e('0x6')]},'transcribeStatus':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':_0x0a9e('0xa')},'fileUri':{'type':Sequelize['TEXT']},'fileText':{'type':Sequelize[_0x0a9e('0x9')]},'failureReason':{'type':Sequelize[_0x0a9e('0x9')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')]},'sPositive':{'type':Sequelize[_0x0a9e('0xb')]},'sNegative':{'type':Sequelize[_0x0a9e('0xb')]},'sNeutral':{'type':Sequelize[_0x0a9e('0xb')]},'sMixed':{'type':Sequelize['FLOAT']},'tempSentiment':{'type':Sequelize[_0x0a9e('0xc')],'defaultValue':![]},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x0a9e('0x3')]('createdAt'))[_0x0a9e('0xd')](_0x0a9e('0xe'))['toString']();}},'updatedAt':{'type':Sequelize[_0x0a9e('0xf')],'get':function(){return moment(this['getDataValue'](_0x0a9e('0x10')))[_0x0a9e('0xd')](_0x0a9e('0xe'))[_0x0a9e('0x11')]();}}}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.controller.js b/server/api/voiceRecording/voiceRecording.controller.js index 6c9dd2e..cd57007 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 _0x5f58=['sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','data2','Cloud\x20Provider\x20not\x20configured','data1','Buckets','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','aws-sdk','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','sendStatus','error','stack','name','send','index','map','fieldName','type','model','differenceBy','format','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','show','params','VoiceRecording','rawAttributes','fields','includeAll','find','catch','create','body','describe','download','uniqueid','value','%s.cypher','existsSync','decryptFile','secrets','recording','VoiceRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','downloads','sequelize','MD5','col','token','push','$and','Sequelize','ValidationError','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','listBuckets','createBucket','TranscribeService','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','Bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeName','transcribeStatus','TranscriptionJobStatus','runTranscribe','../../components/encryptor','Voice\x20Recording\x20not\x20found','Setting','findOne','transcribeAccountId','transcribeRegion','language','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentAccountId'];(function(_0x581af1,_0x4f02c5){var _0x54c22e=function(_0x5a7a5a){while(--_0x5a7a5a){_0x581af1['push'](_0x581af1['shift']());}};_0x54c22e(++_0x4f02c5);}(_0x5f58,0x1f0));var _0x85f5=function(_0x5d23be,_0x3b4f3c){_0x5d23be=_0x5d23be-0x0;var _0x4d60a9=_0x5f58[_0x5d23be];return _0x4d60a9;};'use strict';var emlformat=require(_0x85f5('0x0'));var rimraf=require(_0x85f5('0x1'));var zipdir=require(_0x85f5('0x2'));var jsonpatch=require(_0x85f5('0x3'));var rp=require(_0x85f5('0x4'));var moment=require(_0x85f5('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x85f5('0x6'));var path=require(_0x85f5('0x7'));var sox=require(_0x85f5('0x8'));var csv=require(_0x85f5('0x9'));var ejs=require(_0x85f5('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x85f5('0xb'));var crypto=require(_0x85f5('0xc'));var jsforce=require(_0x85f5('0xd'));var deskjs=require(_0x85f5('0xe'));var toCsv=require(_0x85f5('0x9'));var querystring=require(_0x85f5('0xf'));var Papa=require(_0x85f5('0x10'));var AWS=require(_0x85f5('0x11'));var uuidv4=require(_0x85f5('0x12'));var Redis=require(_0x85f5('0x13'));var authService=require(_0x85f5('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x85f5('0x15'));var hardwareService=require(_0x85f5('0x16'));var logger=require(_0x85f5('0x17'))(_0x85f5('0x18'));var utils=require('../../config/utils');var config=require(_0x85f5('0x19'));var licenseUtil=require(_0x85f5('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x59acd,_0x42d3a5){_0x42d3a5=_0x42d3a5||0xcc;return function(_0xeaa270){if(_0xeaa270){return _0x59acd['sendStatus'](_0x42d3a5);}return _0x59acd[_0x85f5('0x1b')](_0x42d3a5)[_0x85f5('0x1c')]();};}function respondWithResult(_0x2fc4c7,_0x1a5696){_0x1a5696=_0x1a5696||0xc8;return function(_0x3618d4){if(_0x3618d4){return _0x2fc4c7['status'](_0x1a5696)[_0x85f5('0x1d')](_0x3618d4);}};}function respondWithFilteredResult(_0x1bcf07,_0x40b0f0){return function(_0x685edc){if(_0x685edc){var _0x56c5b2=typeof _0x40b0f0[_0x85f5('0x1e')]===_0x85f5('0x1f')&&typeof _0x40b0f0[_0x85f5('0x20')]===_0x85f5('0x1f');var _0x33de60=_0x685edc[_0x85f5('0x21')];var _0x4709db=_0x56c5b2?0x0:_0x40b0f0[_0x85f5('0x1e')];var _0x2d9056=_0x56c5b2?_0x685edc[_0x85f5('0x21')]:_0x40b0f0['offset']+_0x40b0f0[_0x85f5('0x20')];var _0x596da3;if(_0x2d9056>=_0x33de60){_0x2d9056=_0x33de60;_0x596da3=0xc8;}else{_0x596da3=0xce;}_0x1bcf07[_0x85f5('0x1b')](_0x596da3);return _0x1bcf07[_0x85f5('0x22')](_0x85f5('0x23'),_0x4709db+'-'+_0x2d9056+'/'+_0x33de60)[_0x85f5('0x1d')](_0x685edc);}return null;};}function patchUpdates(_0x529ed1){return function(_0x1c221b){try{jsonpatch[_0x85f5('0x24')](_0x1c221b,_0x529ed1,!![]);}catch(_0x19ab45){return BPromise['reject'](_0x19ab45);}return _0x1c221b['save']();};}function saveUpdates(_0x3d7774,_0x549a4d){return function(_0x480930){if(_0x480930){return _0x480930[_0x85f5('0x25')](_0x3d7774)[_0x85f5('0x26')](function(_0x511634){return _0x511634;});}return null;};}function removeEntity(_0xd12e20,_0x404416){return function(_0x203442){if(_0x203442){return _0x203442[_0x85f5('0x27')]()[_0x85f5('0x26')](function(){_0xd12e20['status'](0xcc)[_0x85f5('0x1c')]();});}};}function handleEntityNotFound(_0x119b54,_0x4f0303){return function(_0x3f72f9){if(!_0x3f72f9){_0x119b54[_0x85f5('0x28')](0x194);}return _0x3f72f9;};}function handleError(_0x586f57,_0x316ee2){_0x316ee2=_0x316ee2||0x1f4;return function(_0x517350){logger[_0x85f5('0x29')](_0x517350[_0x85f5('0x2a')]);if(_0x517350['name']){delete _0x517350[_0x85f5('0x2b')];}_0x586f57[_0x85f5('0x1b')](_0x316ee2)[_0x85f5('0x2c')](_0x517350);};}exports[_0x85f5('0x2d')]=function(_0x4aeef3,_0x582f41){var _0x527d20={},_0x3b8e95={},_0x1a5040={'count':0x0,'rows':[]};var _0x2caf69=_[_0x85f5('0x2e')](db['VoiceRecording']['rawAttributes'],function(_0x4fcbf7){return{'name':_0x4fcbf7[_0x85f5('0x2f')],'type':_0x4fcbf7[_0x85f5('0x30')]['key']};});_0x3b8e95[_0x85f5('0x31')]=_[_0x85f5('0x32')](_['map'](_0x2caf69,_0x85f5('0x2b')),[_0x85f5('0x33')]);_0x3b8e95[_0x85f5('0x34')]=_[_0x85f5('0x35')](_0x4aeef3[_0x85f5('0x34')]);_0x3b8e95[_0x85f5('0x36')]=_[_0x85f5('0x37')](_0x3b8e95['model'],_0x3b8e95[_0x85f5('0x34')]);_0x527d20[_0x85f5('0x38')]=_[_0x85f5('0x37')](_0x3b8e95[_0x85f5('0x31')],qs['fields'](_0x4aeef3[_0x85f5('0x34')]['fields']));_0x527d20[_0x85f5('0x38')]=_0x527d20[_0x85f5('0x38')][_0x85f5('0x39')]?_0x527d20[_0x85f5('0x38')]:_0x3b8e95[_0x85f5('0x31')];if(!_0x4aeef3[_0x85f5('0x34')][_0x85f5('0x3a')](_0x85f5('0x3b'))){_0x527d20[_0x85f5('0x20')]=qs[_0x85f5('0x20')](_0x4aeef3[_0x85f5('0x34')][_0x85f5('0x20')]);_0x527d20[_0x85f5('0x1e')]=qs[_0x85f5('0x1e')](_0x4aeef3[_0x85f5('0x34')]['offset']);}_0x527d20[_0x85f5('0x3c')]=qs[_0x85f5('0x3d')](_0x4aeef3[_0x85f5('0x34')][_0x85f5('0x3d')]);_0x527d20[_0x85f5('0x3e')]=qs['filters'](_[_0x85f5('0x3f')](_0x4aeef3[_0x85f5('0x34')],_0x3b8e95[_0x85f5('0x36')]),_0x2caf69);if(_0x4aeef3[_0x85f5('0x34')][_0x85f5('0x40')]){_0x527d20[_0x85f5('0x3e')]=_[_0x85f5('0x41')](_0x527d20[_0x85f5('0x3e')],{'$or':_[_0x85f5('0x2e')](_0x2caf69,function(_0x613d7e){if(_0x613d7e['type']!=='VIRTUAL'){var _0x1b8e4c={};_0x1b8e4c[_0x613d7e[_0x85f5('0x2b')]]={'$like':'%'+_0x4aeef3[_0x85f5('0x34')][_0x85f5('0x40')]+'%'};return _0x1b8e4c;}})});}_0x527d20=_[_0x85f5('0x41')]({},_0x527d20,_0x4aeef3[_0x85f5('0x42')]);var _0x59c8f4={'where':_0x527d20[_0x85f5('0x3e')]};return db['VoiceRecording'][_0x85f5('0x21')](_0x59c8f4)[_0x85f5('0x26')](function(_0x49cdaa){_0x1a5040[_0x85f5('0x21')]=_0x49cdaa;if(_0x4aeef3[_0x85f5('0x34')]['includeAll']){_0x527d20[_0x85f5('0x43')]=[{'all':!![]}];}return db['VoiceRecording'][_0x85f5('0x44')](_0x527d20);})['then'](function(_0x4c3c11){_0x1a5040['rows']=_0x4c3c11;return _0x1a5040;})['then'](respondWithFilteredResult(_0x582f41,_0x527d20))['catch'](handleError(_0x582f41,null));};exports[_0x85f5('0x45')]=function(_0x524f1e,_0x33cd9d){var _0x18c673={'raw':![],'where':{'id':_0x524f1e[_0x85f5('0x46')]['id']}},_0x2bf297={};_0x2bf297[_0x85f5('0x31')]=_[_0x85f5('0x35')](db[_0x85f5('0x47')][_0x85f5('0x48')]);_0x2bf297['query']=_[_0x85f5('0x35')](_0x524f1e[_0x85f5('0x34')]);_0x2bf297[_0x85f5('0x36')]=_['intersection'](_0x2bf297['model'],_0x2bf297[_0x85f5('0x34')]);_0x18c673['attributes']=_[_0x85f5('0x37')](_0x2bf297[_0x85f5('0x31')],qs[_0x85f5('0x49')](_0x524f1e[_0x85f5('0x34')]['fields']));_0x18c673[_0x85f5('0x38')]=_0x18c673[_0x85f5('0x38')][_0x85f5('0x39')]?_0x18c673[_0x85f5('0x38')]:_0x2bf297[_0x85f5('0x31')];if(_0x524f1e[_0x85f5('0x34')][_0x85f5('0x4a')]){_0x18c673[_0x85f5('0x43')]=[{'all':!![]}];}_0x18c673=_['merge']({},_0x18c673,_0x524f1e[_0x85f5('0x42')]);return db['VoiceRecording'][_0x85f5('0x4b')](_0x18c673)[_0x85f5('0x26')](handleEntityNotFound(_0x33cd9d,null))['then'](respondWithResult(_0x33cd9d,null))[_0x85f5('0x4c')](handleError(_0x33cd9d,null));};exports[_0x85f5('0x4d')]=function(_0x5b0b4c,_0x3998a8){return db[_0x85f5('0x47')]['create'](_0x5b0b4c['body'],{})[_0x85f5('0x26')](respondWithResult(_0x3998a8,0xc9))['catch'](handleError(_0x3998a8,null));};exports[_0x85f5('0x25')]=function(_0x41aba8,_0x18affd){if(_0x41aba8[_0x85f5('0x4e')]['id']){delete _0x41aba8[_0x85f5('0x4e')]['id'];}return db[_0x85f5('0x47')][_0x85f5('0x4b')]({'where':{'id':_0x41aba8[_0x85f5('0x46')]['id']}})[_0x85f5('0x26')](handleEntityNotFound(_0x18affd,null))['then'](saveUpdates(_0x41aba8[_0x85f5('0x4e')],null))[_0x85f5('0x26')](respondWithResult(_0x18affd,null))[_0x85f5('0x4c')](handleError(_0x18affd,null));};exports[_0x85f5('0x4f')]=function(_0x5a983c,_0x215b40){return db[_0x85f5('0x47')][_0x85f5('0x4f')]()[_0x85f5('0x26')](respondWithResult(_0x215b40,null))[_0x85f5('0x4c')](handleError(_0x215b40,null));};exports[_0x85f5('0x50')]=function(_0x15d802,_0x3e1b71,_0x5b2200){var _0x3a451f=require('../../components/encryptor');var _0x1a65fe=![];var _0x40c172={};if(_0x15d802[_0x85f5('0x34')][_0x85f5('0x30')]&&_0x15d802['query']['type']===_0x85f5('0x51')){_0x40c172[_0x85f5('0x51')]=_0x15d802[_0x85f5('0x46')]['id'];}else{_0x40c172['id']=_0x15d802[_0x85f5('0x46')]['id'];}return db[_0x85f5('0x47')][_0x85f5('0x4b')]({'where':_0x40c172,'attributes':['id',_0x85f5('0x52')],'raw':!![]})[_0x85f5('0x26')](handleEntityNotFound(_0x3e1b71,null))['then'](function(_0x506532){if(_0x506532){var _0xcc2174=_0x506532[_0x85f5('0x52')];var _0xe14a31=util[_0x85f5('0x33')](_0x85f5('0x53'),_0xcc2174);if(fs[_0x85f5('0x54')](_0xe14a31)){_0x1a65fe=!![];return _0x3a451f[_0x85f5('0x55')](_0xe14a31,_0xcc2174,config[_0x85f5('0x56')][_0x85f5('0x57')])[_0x85f5('0x26')](function(){return _0x506532;});}return _0x506532;}})['then'](function(_0x33b281){if(_0x33b281){var _0x1ae0f0=_0x33b281[_0x85f5('0x52')];if(!fs[_0x85f5('0x54')](_0x1ae0f0)){throw new db['Sequelize']['ValidationError'](_0x85f5('0x58'));}if(_0x33b281['filename']){return _0x3e1b71[_0x85f5('0x50')](_0x1ae0f0,_0x33b281[_0x85f5('0x59')]+path[_0x85f5('0x5a')](_0x1ae0f0),function(){if(_0x1a65fe){fs[_0x85f5('0x5b')](_0x1ae0f0);}});}else{return _0x3e1b71[_0x85f5('0x50')](_0x1ae0f0,function(_0x5dd3b4){if(_0x1a65fe){fs[_0x85f5('0x5b')](_0x1ae0f0);}});}}})[_0x85f5('0x4c')](function(_0x559629){if(_0x559629[_0x85f5('0x5c')]===_0x85f5('0x58')){_0x3e1b71[_0x85f5('0x1b')](0x194)[_0x85f5('0x2c')](_0x85f5('0x5d'));}else{return handleError(_0x3e1b71,null);}});};exports[_0x85f5('0x5e')]=function(_0x38b536,_0x2fd509,_0x42b882){var _0x4b8946=require('../../components/encryptor');var _0x2693ad=![];var _0x2b126a={'$and':[db['sequelize'][_0x85f5('0x3e')](db[_0x85f5('0x5f')]['fn'](_0x85f5('0x60'),db[_0x85f5('0x5f')][_0x85f5('0x61')](_0x85f5('0x51'))),_0x38b536[_0x85f5('0x34')][_0x85f5('0x62')])]};if(_0x38b536['query'][_0x85f5('0x30')]&&_0x38b536[_0x85f5('0x34')][_0x85f5('0x30')]===_0x85f5('0x51')){_0x2b126a['$and'][_0x85f5('0x63')]({'uniqueid':_0x38b536[_0x85f5('0x46')]['id']});}else{_0x2b126a[_0x85f5('0x64')][_0x85f5('0x63')]({'id':_0x38b536[_0x85f5('0x46')]['id']});}return db['VoiceRecording']['find']({'where':_0x2b126a,'attributes':['id',_0x85f5('0x52')],'raw':!![]})[_0x85f5('0x26')](handleEntityNotFound(_0x2fd509,null))[_0x85f5('0x26')](function(_0x5b5017){if(_0x5b5017){var _0x2d280f=util[_0x85f5('0x33')](_0x85f5('0x53'),_0x5b5017[_0x85f5('0x52')]);if(fs[_0x85f5('0x54')](_0x2d280f)){_0x2693ad=!![];return _0x4b8946['decryptFile'](_0x2d280f,_0x5b5017[_0x85f5('0x52')],config[_0x85f5('0x56')]['recording'])['then'](function(){return _0x5b5017;});}return _0x5b5017;}})[_0x85f5('0x26')](function(_0xacf020){if(_0xacf020){if(!fs[_0x85f5('0x54')](_0xacf020[_0x85f5('0x52')])){throw new db[(_0x85f5('0x65'))][(_0x85f5('0x66'))](_0x85f5('0x58'));}if(_0xacf020[_0x85f5('0x59')]){return _0x2fd509[_0x85f5('0x50')](_0xacf020[_0x85f5('0x52')],_0xacf020['filename']+path[_0x85f5('0x5a')](_0xacf020[_0x85f5('0x52')]),function(){if(_0x2693ad){fs[_0x85f5('0x5b')](_0xacf020[_0x85f5('0x52')]);}});}else{return _0x2fd509[_0x85f5('0x50')](_0xacf020[_0x85f5('0x52')],function(_0x32671f){if(_0x2693ad){fs['unlink'](_0xacf020[_0x85f5('0x52')]);}});}}})['catch'](handleError(_0x2fd509,null));};exports[_0x85f5('0x27')]=function(_0x3e9c0e,_0x26c03b){return db[_0x85f5('0x47')][_0x85f5('0x4b')]({'where':{'id':_0x3e9c0e[_0x85f5('0x46')]['id']}})[_0x85f5('0x26')](function(_0x6b34c9){if(_[_0x85f5('0x67')](_0x6b34c9)){throw new ReferenceError(_0x85f5('0x68'));}return _0x6b34c9;})[_0x85f5('0x26')](function(_0x205150){var _0x4c8ae0=_0x205150[_0x85f5('0x52')];logger[_0x85f5('0x69')](_0x85f5('0x6a'),_0x4c8ae0);if(!_[_0x85f5('0x67')](_0x205150[_0x85f5('0x52')])&&fs[_0x85f5('0x54')](_0x4c8ae0)){logger[_0x85f5('0x69')](_0x85f5('0x6b')+_0x4c8ae0+_0x85f5('0x6c'));fs[_0x85f5('0x6d')](_0x4c8ae0);}_0x4c8ae0=_0x4c8ae0+'.cypher';if(!_['isNil'](_0x205150[_0x85f5('0x52')])&&fs[_0x85f5('0x54')](_0x4c8ae0)){logger[_0x85f5('0x69')](_0x85f5('0x6b')+_0x4c8ae0+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x85f5('0x6d')](_0x4c8ae0);}return _0x205150;})['then'](function(_0x2aee0b){if(!_0x2aee0b)throw new InternalError();return _0x2aee0b[_0x85f5('0x27')]();})[_0x85f5('0x26')](function(){_0x26c03b[_0x85f5('0x1b')](0xcc)[_0x85f5('0x1c')]();})[_0x85f5('0x4c')](handleError(_0x26c03b,null));};function getBucketslist(_0x38a100,_0x2143d1,_0x541c16){return new Promise(function(_0x1cbfbe,_0x6a5e34){var _0x4e6aba=new AWS['S3']({'accessKeyId':_0x2143d1,'secretAccessKey':_0x38a100,'region':_0x541c16});_0x4e6aba[_0x85f5('0x6e')]({},function(_0x40f8ae,_0x592b5a){if(_0x40f8ae){return _0x6a5e34(_0x40f8ae);}else{return _0x1cbfbe(_0x592b5a);}});});}function createBucket(_0x18c73f,_0x28ff7d,_0x516648,_0x2ca3f4){return new Promise(function(_0x18c12e,_0x4f79e0){var _0x54867e=new AWS['S3']({'accessKeyId':_0x28ff7d,'secretAccessKey':_0x18c73f,'region':_0x516648});_0x54867e[_0x85f5('0x6f')]({'Bucket':_0x2ca3f4},function(_0x526a31,_0x578320){if(_0x526a31){return _0x4f79e0(_0x526a31);}else{return _0x18c12e(_0x578320);}});});}function uploadFile(_0x3c93df,_0xc841b2,_0x1e5976,_0x297220,_0x4c3a18,_0x4b6ad8){return new Promise(function(_0x5232a0,_0x25d480){var _0x33478d=new AWS['S3']({'accessKeyId':_0xc841b2,'secretAccessKey':_0x3c93df,'region':_0x1e5976});_0x33478d['upload']({'Bucket':_0x297220,'Key':_0x4c3a18,'Body':_0x4b6ad8},function(_0x14a892,_0x2b428f){if(_0x14a892){return _0x25d480(_0x14a892);}else{return _0x5232a0(_0x2b428f);}});});}function startTranscribe(_0xb124c2,_0x24b9ec,_0x42cdea,_0x86f6ad,_0x796aa6,_0x135fa0){return new Promise(function(_0x275c08,_0x24692b){var _0x4c0607=new AWS[(_0x85f5('0x70'))]({'accessKeyId':_0x24b9ec,'secretAccessKey':_0xb124c2,'region':_0x42cdea});_0x4c0607['startTranscriptionJob']({'TranscriptionJobName':_0x86f6ad,'LanguageCode':_0x796aa6,'Media':{'MediaFileUri':_0x135fa0}},function(_0xd73023,_0xa79c24){if(_0xd73023){return _0x24692b(_0xd73023);}else{return _0x275c08(_0xa79c24);}});});}function transcribe(_0x335c77,_0x11d987,_0x56c309,_0x3e0afc,_0x2334ff,_0x50871e,_0x57a1b2){return new Promise(function(_0x3bce50,_0x794d69){var _0x4871a1={};logger['info'](util[_0x85f5('0x33')](_0x85f5('0x71'),_0x335c77,_0x2334ff));return uploadFile(_0x11d987,_0x56c309,_0x3e0afc,_0x2334ff,path[_0x85f5('0x72')](_0x50871e),fs[_0x85f5('0x73')](_0x50871e))[_0x85f5('0x26')](function(_0x484cbc){logger['info'](util[_0x85f5('0x33')](_0x85f5('0x74'),_0x335c77,_0x2334ff,_0x484cbc[_0x85f5('0x75')]));_0x4871a1[_0x85f5('0x76')]=_0x484cbc[_0x85f5('0x77')];_0x4871a1[_0x85f5('0x78')]=_0x484cbc[_0x85f5('0x75')];logger[_0x85f5('0x69')](util[_0x85f5('0x33')](_0x85f5('0x79'),_0x335c77));return startTranscribe(_0x11d987,_0x56c309,_0x3e0afc,uuidv4(),_0x57a1b2,_0x484cbc[_0x85f5('0x75')]);})[_0x85f5('0x26')](function(_0x1f755d){logger['info'](util['format'](_0x85f5('0x7a'),_0x335c77,_0x1f755d[_0x85f5('0x7b')][_0x85f5('0x7c')]));_0x4871a1[_0x85f5('0x7d')]=_0x1f755d[_0x85f5('0x7b')][_0x85f5('0x7c')];_0x4871a1[_0x85f5('0x7e')]=_0x1f755d['TranscriptionJob'][_0x85f5('0x7f')];return _0x3bce50(_0x4871a1);})['catch'](function(_0x176b24){return _0x794d69(_0x176b24);});});}exports[_0x85f5('0x80')]=function(_0x14a9a5,_0x1ce4ca,_0x5472d4){var _0x40f0f4;var _0x335691;var _0x151e03;var _0x287568=require(_0x85f5('0x81'));return db[_0x85f5('0x47')]['findOne']({'where':{'id':_0x14a9a5[_0x85f5('0x46')]['id']}})['then'](function(_0x49ccbb){if(_0x49ccbb){var _0x735e8c=util[_0x85f5('0x33')](_0x85f5('0x53'),_0x49ccbb['value']);if(fs[_0x85f5('0x54')](_0x735e8c)){cypher=!![];return _0x287568[_0x85f5('0x55')](_0x735e8c,_0x49ccbb[_0x85f5('0x52')],config['secrets'][_0x85f5('0x57')])[_0x85f5('0x26')](function(){return _0x49ccbb;});}return _0x49ccbb;}})[_0x85f5('0x26')](function(_0x303730){if(!_0x303730){throw new db['Sequelize'][(_0x85f5('0x66'))](_0x85f5('0x82'));}_0x335691=_0x303730;return db[_0x85f5('0x83')][_0x85f5('0x84')]({'where':{'id':0x1}});})['then'](handleEntityNotFound(_0x1ce4ca,null))['then'](function(_0x33c175){if(_0x33c175){_0x40f0f4=_0x33c175;if(!_0x40f0f4['transcribe']||!_0x40f0f4[_0x85f5('0x85')]||!_0x40f0f4[_0x85f5('0x86')]||!_0x40f0f4[_0x85f5('0x87')]||!_0x40f0f4[_0x85f5('0x76')]){throw new db[(_0x85f5('0x65'))][(_0x85f5('0x66'))](_0x85f5('0x88'));}if(_0x14a9a5['body'][_0x85f5('0x89')]&&(!_0x40f0f4[_0x85f5('0x8a')]||!_0x40f0f4[_0x85f5('0x8b')]||!_0x40f0f4[_0x85f5('0x8c')]||!_0x40f0f4['language']||!_0x40f0f4[_0x85f5('0x76')])){throw new db[(_0x85f5('0x65'))][(_0x85f5('0x66'))](_0x85f5('0x8d'));}return db[_0x85f5('0x8e')]['findOne']({'where':{'id':_0x40f0f4[_0x85f5('0x85')]}});}})['then'](function(_0x186515){if(!_0x186515){throw new db[(_0x85f5('0x65'))][(_0x85f5('0x66'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x186515['data1']||!_0x186515[_0x85f5('0x8f')]){throw new db['Sequelize']['ValidationError'](_0x85f5('0x90'));}_0x151e03=_0x186515;return getBucketslist(_0x151e03[_0x85f5('0x91')],_0x151e03['data2'],_0x40f0f4[_0x85f5('0x86')]);})[_0x85f5('0x26')](function(_0x5d9a5e){if(_0x5d9a5e&&_0x5d9a5e[_0x85f5('0x92')]){var _0x92dd28=_[_0x85f5('0x4b')](_0x5d9a5e[_0x85f5('0x92')],function(_0x308774){return _0x308774['Name']===_0x40f0f4['bucket'];});if(!_0x92dd28){logger[_0x85f5('0x69')](util[_0x85f5('0x33')](_0x85f5('0x93'),_0x14a9a5[_0x85f5('0x46')]['id'],_0x40f0f4[_0x85f5('0x76')]));return createBucket(_0x151e03[_0x85f5('0x91')],_0x151e03[_0x85f5('0x8f')],_0x40f0f4[_0x85f5('0x86')],_0x40f0f4[_0x85f5('0x76')]);}logger[_0x85f5('0x69')](util[_0x85f5('0x33')](_0x85f5('0x94'),_0x14a9a5[_0x85f5('0x46')]['id'],_0x40f0f4['bucket']));return;}})[_0x85f5('0x26')](function(_0x220fe9){if(_0x335691[_0x85f5('0x7e')]===_0x85f5('0x95')){return transcribe(_0x14a9a5['params']['id'],_0x151e03['data1'],_0x151e03['data2'],_0x40f0f4[_0x85f5('0x86')],_0x40f0f4['bucket'],_0x335691[_0x85f5('0x52')],_0x40f0f4[_0x85f5('0x87')]);}else{logger['info'](util['format'](_0x85f5('0x96'),_0x14a9a5[_0x85f5('0x46')]['id']));return{'transcribeStatus':_0x85f5('0x97')};}})[_0x85f5('0x26')](function(_0x24f314){if(_0x24f314){_0x24f314['tempSentiment']=_0x14a9a5['body'][_0x85f5('0x89')];return _0x335691['updateAttributes'](_0x24f314);}})['then'](respondWithResult(_0x1ce4ca,null))[_0x85f5('0x4c')](handleError(_0x1ce4ca,null));};function writeFile(_0x4cac18,_0x549eaf){return new Promise(function(_0x5ba948,_0x50b85e){fs[_0x85f5('0x98')](_0x549eaf,_0x4cac18,function(_0x3a8adc,_0x244302){if(_0x3a8adc){return _0x50b85e(_0x3a8adc);}else{return _0x5ba948(_0x244302);}});});}exports[_0x85f5('0x99')]=function(_0x51a69c,_0x247099,_0x1d9223){return db[_0x85f5('0x47')]['findOne']({'where':{'id':_0x51a69c[_0x85f5('0x46')]['id']}})[_0x85f5('0x26')](handleEntityNotFound(_0x247099))['then'](function(_0x5c0a4d){if(_0x5c0a4d&&_0x5c0a4d[_0x85f5('0x9a')]){var _0x5131fd=_0x5c0a4d[_0x85f5('0x9a')];var _0x2c3451=config[_0x85f5('0x9b')]+_0x85f5('0x9c')+_0x5c0a4d['id']+_0x85f5('0x9d');if(fs[_0x85f5('0x54')](_0x2c3451)){return _0x2c3451;}return writeFile(_0x5131fd,_0x2c3451)['then'](function(){return _0x2c3451;});}else{throw new db['Sequelize'][(_0x85f5('0x66'))](_0x85f5('0x9e'));}})[_0x85f5('0x26')](function(_0x9fc9c9){return _0x247099[_0x85f5('0x50')](_0x9fc9c9);})[_0x85f5('0x4c')](handleError(_0x247099));}; \ No newline at end of file +var _0x0920=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','sendStatus','error','stack','name','map','VoiceRecording','rawAttributes','fieldName','type','key','model','differenceBy','format','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','options','include','findAll','rows','params','find','catch','create','body','describe','download','uniqueid','value','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','VoiceRecording\x20not\x20found','filename','unlink','message','send','Not\x20found','downloads','sequelize','MD5','col','token','$and','push','ValidationError','destroy','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','listBuckets','createBucket','upload','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','Bucket','location','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','transcribeName','TranscriptionJobName','transcribeStatus','TranscriptionJobStatus','runTranscribe','../../components/encryptor','Voice\x20Recording\x20not\x20found','Setting','findOne','transcribe','transcribeAccountId','language','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','transcribeRegion','Buckets','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','updateAttributes','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','jsforce','querystring'];(function(_0x4641a1,_0x4e9f45){var _0xc92e1a=function(_0x3e91a8){while(--_0x3e91a8){_0x4641a1['push'](_0x4641a1['shift']());}};_0xc92e1a(++_0x4e9f45);}(_0x0920,0x1c3));var _0x0092=function(_0x3c4dad,_0x25ffd5){_0x3c4dad=_0x3c4dad-0x0;var _0x1a4f49=_0x0920[_0x3c4dad];return _0x1a4f49;};'use strict';var emlformat=require(_0x0092('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0092('0x1'));var jsonpatch=require(_0x0092('0x2'));var rp=require(_0x0092('0x3'));var moment=require(_0x0092('0x4'));var BPromise=require(_0x0092('0x5'));var Mustache=require(_0x0092('0x6'));var util=require(_0x0092('0x7'));var path=require(_0x0092('0x8'));var sox=require(_0x0092('0x9'));var csv=require(_0x0092('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0092('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0092('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x0092('0xd'));var Papa=require(_0x0092('0xe'));var AWS=require('aws-sdk');var uuidv4=require('uuid/v4');var Redis=require(_0x0092('0xf'));var authService=require(_0x0092('0x10'));var qs=require(_0x0092('0x11'));var as=require(_0x0092('0x12'));var hardwareService=require(_0x0092('0x13'));var logger=require(_0x0092('0x14'))(_0x0092('0x15'));var utils=require('../../config/utils');var config=require(_0x0092('0x16'));var licenseUtil=require(_0x0092('0x17'));var db=require(_0x0092('0x18'))['db'];function respondWithStatusCode(_0xed9d00,_0x22c16c){_0x22c16c=_0x22c16c||0xcc;return function(_0x323473){if(_0x323473){return _0xed9d00['sendStatus'](_0x22c16c);}return _0xed9d00[_0x0092('0x19')](_0x22c16c)[_0x0092('0x1a')]();};}function respondWithResult(_0x3936f4,_0x552a4b){_0x552a4b=_0x552a4b||0xc8;return function(_0x184874){if(_0x184874){return _0x3936f4[_0x0092('0x19')](_0x552a4b)[_0x0092('0x1b')](_0x184874);}};}function respondWithFilteredResult(_0x16f43b,_0x4213c5){return function(_0x43b1a8){if(_0x43b1a8){var _0x2aceb5=typeof _0x4213c5[_0x0092('0x1c')]===_0x0092('0x1d')&&typeof _0x4213c5[_0x0092('0x1e')]==='undefined';var _0x2681a9=_0x43b1a8[_0x0092('0x1f')];var _0x20ef94=_0x2aceb5?0x0:_0x4213c5[_0x0092('0x1c')];var _0xc448b6=_0x2aceb5?_0x43b1a8[_0x0092('0x1f')]:_0x4213c5[_0x0092('0x1c')]+_0x4213c5['limit'];var _0x151eda;if(_0xc448b6>=_0x2681a9){_0xc448b6=_0x2681a9;_0x151eda=0xc8;}else{_0x151eda=0xce;}_0x16f43b[_0x0092('0x19')](_0x151eda);return _0x16f43b[_0x0092('0x20')](_0x0092('0x21'),_0x20ef94+'-'+_0xc448b6+'/'+_0x2681a9)[_0x0092('0x1b')](_0x43b1a8);}return null;};}function patchUpdates(_0x23cb01){return function(_0x4723ad){try{jsonpatch['apply'](_0x4723ad,_0x23cb01,!![]);}catch(_0x5d25eb){return BPromise[_0x0092('0x22')](_0x5d25eb);}return _0x4723ad[_0x0092('0x23')]();};}function saveUpdates(_0x2fbe37,_0x3fe297){return function(_0x5d663d){if(_0x5d663d){return _0x5d663d['update'](_0x2fbe37)[_0x0092('0x24')](function(_0x54686){return _0x54686;});}return null;};}function removeEntity(_0x204cd9,_0x59013d){return function(_0x39aa14){if(_0x39aa14){return _0x39aa14['destroy']()[_0x0092('0x24')](function(){_0x204cd9[_0x0092('0x19')](0xcc)[_0x0092('0x1a')]();});}};}function handleEntityNotFound(_0x34097d,_0x300fef){return function(_0x1911b1){if(!_0x1911b1){_0x34097d[_0x0092('0x25')](0x194);}return _0x1911b1;};}function handleError(_0x57742d,_0x440167){_0x440167=_0x440167||0x1f4;return function(_0x56f1c0){logger[_0x0092('0x26')](_0x56f1c0[_0x0092('0x27')]);if(_0x56f1c0[_0x0092('0x28')]){delete _0x56f1c0[_0x0092('0x28')];}_0x57742d[_0x0092('0x19')](_0x440167)['send'](_0x56f1c0);};}exports['index']=function(_0x577df1,_0x5a6ca5){var _0x462387={},_0x2d5310={},_0x131e75={'count':0x0,'rows':[]};var _0x740006=_[_0x0092('0x29')](db[_0x0092('0x2a')][_0x0092('0x2b')],function(_0x524db9){return{'name':_0x524db9[_0x0092('0x2c')],'type':_0x524db9[_0x0092('0x2d')][_0x0092('0x2e')]};});_0x2d5310[_0x0092('0x2f')]=_[_0x0092('0x30')](_['map'](_0x740006,_0x0092('0x28')),[_0x0092('0x31')]);_0x2d5310[_0x0092('0x32')]=_[_0x0092('0x33')](_0x577df1[_0x0092('0x32')]);_0x2d5310[_0x0092('0x34')]=_[_0x0092('0x35')](_0x2d5310[_0x0092('0x2f')],_0x2d5310[_0x0092('0x32')]);_0x462387[_0x0092('0x36')]=_['intersection'](_0x2d5310['model'],qs['fields'](_0x577df1['query'][_0x0092('0x37')]));_0x462387[_0x0092('0x36')]=_0x462387[_0x0092('0x36')][_0x0092('0x38')]?_0x462387[_0x0092('0x36')]:_0x2d5310[_0x0092('0x2f')];if(!_0x577df1[_0x0092('0x32')]['hasOwnProperty']('nolimit')){_0x462387[_0x0092('0x1e')]=qs[_0x0092('0x1e')](_0x577df1['query']['limit']);_0x462387['offset']=qs[_0x0092('0x1c')](_0x577df1[_0x0092('0x32')][_0x0092('0x1c')]);}_0x462387[_0x0092('0x39')]=qs[_0x0092('0x3a')](_0x577df1[_0x0092('0x32')]['sort']);_0x462387[_0x0092('0x3b')]=qs[_0x0092('0x34')](_[_0x0092('0x3c')](_0x577df1[_0x0092('0x32')],_0x2d5310[_0x0092('0x34')]),_0x740006);if(_0x577df1[_0x0092('0x32')][_0x0092('0x3d')]){_0x462387['where']=_[_0x0092('0x3e')](_0x462387[_0x0092('0x3b')],{'$or':_[_0x0092('0x29')](_0x740006,function(_0x40bca4){if(_0x40bca4[_0x0092('0x2d')]!=='VIRTUAL'){var _0x57dc5a={};_0x57dc5a[_0x40bca4[_0x0092('0x28')]]={'$like':'%'+_0x577df1['query'][_0x0092('0x3d')]+'%'};return _0x57dc5a;}})});}_0x462387=_['merge']({},_0x462387,_0x577df1[_0x0092('0x3f')]);var _0x204787={'where':_0x462387[_0x0092('0x3b')]};return db[_0x0092('0x2a')][_0x0092('0x1f')](_0x204787)[_0x0092('0x24')](function(_0x478151){_0x131e75[_0x0092('0x1f')]=_0x478151;if(_0x577df1[_0x0092('0x32')]['includeAll']){_0x462387[_0x0092('0x40')]=[{'all':!![]}];}return db[_0x0092('0x2a')][_0x0092('0x41')](_0x462387);})[_0x0092('0x24')](function(_0x4934e8){_0x131e75[_0x0092('0x42')]=_0x4934e8;return _0x131e75;})[_0x0092('0x24')](respondWithFilteredResult(_0x5a6ca5,_0x462387))['catch'](handleError(_0x5a6ca5,null));};exports['show']=function(_0x96f1a1,_0x63fe21){var _0x5adb82={'raw':![],'where':{'id':_0x96f1a1[_0x0092('0x43')]['id']}},_0x2f1355={};_0x2f1355[_0x0092('0x2f')]=_[_0x0092('0x33')](db['VoiceRecording']['rawAttributes']);_0x2f1355[_0x0092('0x32')]=_[_0x0092('0x33')](_0x96f1a1[_0x0092('0x32')]);_0x2f1355['filters']=_[_0x0092('0x35')](_0x2f1355[_0x0092('0x2f')],_0x2f1355[_0x0092('0x32')]);_0x5adb82[_0x0092('0x36')]=_[_0x0092('0x35')](_0x2f1355[_0x0092('0x2f')],qs[_0x0092('0x37')](_0x96f1a1[_0x0092('0x32')]['fields']));_0x5adb82[_0x0092('0x36')]=_0x5adb82[_0x0092('0x36')][_0x0092('0x38')]?_0x5adb82[_0x0092('0x36')]:_0x2f1355[_0x0092('0x2f')];if(_0x96f1a1[_0x0092('0x32')]['includeAll']){_0x5adb82[_0x0092('0x40')]=[{'all':!![]}];}_0x5adb82=_[_0x0092('0x3e')]({},_0x5adb82,_0x96f1a1['options']);return db[_0x0092('0x2a')][_0x0092('0x44')](_0x5adb82)[_0x0092('0x24')](handleEntityNotFound(_0x63fe21,null))['then'](respondWithResult(_0x63fe21,null))[_0x0092('0x45')](handleError(_0x63fe21,null));};exports[_0x0092('0x46')]=function(_0x19fa98,_0x914a64){return db['VoiceRecording'][_0x0092('0x46')](_0x19fa98[_0x0092('0x47')],{})[_0x0092('0x24')](respondWithResult(_0x914a64,0xc9))['catch'](handleError(_0x914a64,null));};exports['update']=function(_0xa6fbc1,_0x56540c){if(_0xa6fbc1['body']['id']){delete _0xa6fbc1[_0x0092('0x47')]['id'];}return db[_0x0092('0x2a')][_0x0092('0x44')]({'where':{'id':_0xa6fbc1[_0x0092('0x43')]['id']}})['then'](handleEntityNotFound(_0x56540c,null))['then'](saveUpdates(_0xa6fbc1[_0x0092('0x47')],null))[_0x0092('0x24')](respondWithResult(_0x56540c,null))[_0x0092('0x45')](handleError(_0x56540c,null));};exports['describe']=function(_0x5127ce,_0x1c30e1){return db['VoiceRecording'][_0x0092('0x48')]()[_0x0092('0x24')](respondWithResult(_0x1c30e1,null))['catch'](handleError(_0x1c30e1,null));};exports[_0x0092('0x49')]=function(_0x5c7e36,_0x5c2707,_0x3da631){var _0x175c0b=require('../../components/encryptor');var _0xc7a54c=![];var _0x26eb06={};if(_0x5c7e36[_0x0092('0x32')][_0x0092('0x2d')]&&_0x5c7e36['query'][_0x0092('0x2d')]===_0x0092('0x4a')){_0x26eb06['uniqueid']=_0x5c7e36[_0x0092('0x43')]['id'];}else{_0x26eb06['id']=_0x5c7e36[_0x0092('0x43')]['id'];}return db[_0x0092('0x2a')][_0x0092('0x44')]({'where':_0x26eb06,'attributes':['id',_0x0092('0x4b')],'raw':!![]})['then'](handleEntityNotFound(_0x5c2707,null))[_0x0092('0x24')](function(_0x38a9cc){if(_0x38a9cc){var _0x5c17e6=_0x38a9cc[_0x0092('0x4b')];var _0x4c99cd=util[_0x0092('0x31')](_0x0092('0x4c'),_0x5c17e6);if(fs[_0x0092('0x4d')](_0x4c99cd)){_0xc7a54c=!![];return _0x175c0b[_0x0092('0x4e')](_0x4c99cd,_0x5c17e6,config[_0x0092('0x4f')][_0x0092('0x50')])[_0x0092('0x24')](function(){return _0x38a9cc;});}return _0x38a9cc;}})['then'](function(_0x4e7c30){if(_0x4e7c30){var _0xde9e1a=_0x4e7c30[_0x0092('0x4b')];if(!fs[_0x0092('0x4d')](_0xde9e1a)){throw new db[(_0x0092('0x51'))]['ValidationError'](_0x0092('0x52'));}if(_0x4e7c30[_0x0092('0x53')]){return _0x5c2707['download'](_0xde9e1a,_0x4e7c30[_0x0092('0x53')]+path['extname'](_0xde9e1a),function(){if(_0xc7a54c){fs[_0x0092('0x54')](_0xde9e1a);}});}else{return _0x5c2707[_0x0092('0x49')](_0xde9e1a,function(_0x44f3b8){if(_0xc7a54c){fs['unlink'](_0xde9e1a);}});}}})[_0x0092('0x45')](function(_0x45a2c2){if(_0x45a2c2[_0x0092('0x55')]==='VoiceRecording\x20not\x20found'){_0x5c2707['status'](0x194)[_0x0092('0x56')](_0x0092('0x57'));}else{return handleError(_0x5c2707,null);}});};exports[_0x0092('0x58')]=function(_0x5a37e5,_0x132ec8,_0xa8c00b){var _0x1b24c7=require('../../components/encryptor');var _0x6d1b65=![];var _0x30184d={'$and':[db[_0x0092('0x59')][_0x0092('0x3b')](db['sequelize']['fn'](_0x0092('0x5a'),db['sequelize'][_0x0092('0x5b')](_0x0092('0x4a'))),_0x5a37e5['query'][_0x0092('0x5c')])]};if(_0x5a37e5[_0x0092('0x32')]['type']&&_0x5a37e5[_0x0092('0x32')][_0x0092('0x2d')]===_0x0092('0x4a')){_0x30184d[_0x0092('0x5d')][_0x0092('0x5e')]({'uniqueid':_0x5a37e5[_0x0092('0x43')]['id']});}else{_0x30184d[_0x0092('0x5d')][_0x0092('0x5e')]({'id':_0x5a37e5[_0x0092('0x43')]['id']});}return db[_0x0092('0x2a')][_0x0092('0x44')]({'where':_0x30184d,'attributes':['id','value'],'raw':!![]})[_0x0092('0x24')](handleEntityNotFound(_0x132ec8,null))[_0x0092('0x24')](function(_0x7efe13){if(_0x7efe13){var _0x3f7a4d=util[_0x0092('0x31')](_0x0092('0x4c'),_0x7efe13[_0x0092('0x4b')]);if(fs[_0x0092('0x4d')](_0x3f7a4d)){_0x6d1b65=!![];return _0x1b24c7[_0x0092('0x4e')](_0x3f7a4d,_0x7efe13[_0x0092('0x4b')],config[_0x0092('0x4f')]['recording'])[_0x0092('0x24')](function(){return _0x7efe13;});}return _0x7efe13;}})[_0x0092('0x24')](function(_0x5ac5f6){if(_0x5ac5f6){if(!fs[_0x0092('0x4d')](_0x5ac5f6[_0x0092('0x4b')])){throw new db[(_0x0092('0x51'))][(_0x0092('0x5f'))](_0x0092('0x52'));}if(_0x5ac5f6[_0x0092('0x53')]){return _0x132ec8[_0x0092('0x49')](_0x5ac5f6[_0x0092('0x4b')],_0x5ac5f6[_0x0092('0x53')]+path['extname'](_0x5ac5f6[_0x0092('0x4b')]),function(){if(_0x6d1b65){fs['unlink'](_0x5ac5f6[_0x0092('0x4b')]);}});}else{return _0x132ec8['download'](_0x5ac5f6['value'],function(_0xd15ecc){if(_0x6d1b65){fs['unlink'](_0x5ac5f6[_0x0092('0x4b')]);}});}}})[_0x0092('0x45')](handleError(_0x132ec8,null));};exports[_0x0092('0x60')]=function(_0x5456fc,_0x18d3ce){return db[_0x0092('0x2a')]['find']({'where':{'id':_0x5456fc[_0x0092('0x43')]['id']}})[_0x0092('0x24')](function(_0x5f3c45){if(_['isNil'](_0x5f3c45)){throw new ReferenceError(_0x0092('0x61'));}return _0x5f3c45;})['then'](function(_0xed0995){var _0x353570=_0xed0995[_0x0092('0x4b')];logger[_0x0092('0x62')](_0x0092('0x63'),_0x353570);if(!_[_0x0092('0x64')](_0xed0995[_0x0092('0x4b')])&&fs['existsSync'](_0x353570)){logger[_0x0092('0x62')](_0x0092('0x65')+_0x353570+_0x0092('0x66'));fs[_0x0092('0x67')](_0x353570);}_0x353570=_0x353570+'.cypher';if(!_[_0x0092('0x64')](_0xed0995['value'])&&fs['existsSync'](_0x353570)){logger[_0x0092('0x62')](_0x0092('0x65')+_0x353570+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x353570);}return _0xed0995;})[_0x0092('0x24')](function(_0x4bda79){if(!_0x4bda79)throw new InternalError();return _0x4bda79[_0x0092('0x60')]();})['then'](function(){_0x18d3ce[_0x0092('0x19')](0xcc)['end']();})[_0x0092('0x45')](handleError(_0x18d3ce,null));};function getBucketslist(_0x44f9d5,_0x21835e,_0x3defd4){return new Promise(function(_0x18b7a4,_0x2673ed){var _0x5c9ea7=new AWS['S3']({'accessKeyId':_0x21835e,'secretAccessKey':_0x44f9d5,'region':_0x3defd4});_0x5c9ea7[_0x0092('0x68')]({},function(_0x107102,_0x54a0be){if(_0x107102){return _0x2673ed(_0x107102);}else{return _0x18b7a4(_0x54a0be);}});});}function createBucket(_0x20ea4f,_0x32f747,_0x5d1460,_0x251f3a){return new Promise(function(_0x3fd654,_0x5114a5){var _0x63412e=new AWS['S3']({'accessKeyId':_0x32f747,'secretAccessKey':_0x20ea4f,'region':_0x5d1460});_0x63412e[_0x0092('0x69')]({'Bucket':_0x251f3a},function(_0x55826f,_0x4a8809){if(_0x55826f){return _0x5114a5(_0x55826f);}else{return _0x3fd654(_0x4a8809);}});});}function uploadFile(_0x6bfdde,_0x16db63,_0x2c6a8a,_0x38132c,_0x478fd6,_0x65401b){return new Promise(function(_0x5c9e37,_0x1388c5){var _0x9914ec=new AWS['S3']({'accessKeyId':_0x16db63,'secretAccessKey':_0x6bfdde,'region':_0x2c6a8a});_0x9914ec[_0x0092('0x6a')]({'Bucket':_0x38132c,'Key':_0x478fd6,'Body':_0x65401b},function(_0x41ab8b,_0x214657){if(_0x41ab8b){return _0x1388c5(_0x41ab8b);}else{return _0x5c9e37(_0x214657);}});});}function startTranscribe(_0xa90841,_0x37df9c,_0x2b279f,_0x2601ad,_0x269698,_0x5eca18){return new Promise(function(_0x96737a,_0x36a914){var _0x16a17a=new AWS['TranscribeService']({'accessKeyId':_0x37df9c,'secretAccessKey':_0xa90841,'region':_0x2b279f});_0x16a17a[_0x0092('0x6b')]({'TranscriptionJobName':_0x2601ad,'LanguageCode':_0x269698,'Media':{'MediaFileUri':_0x5eca18}},function(_0x4abb43,_0x8a53fe){if(_0x4abb43){return _0x36a914(_0x4abb43);}else{return _0x96737a(_0x8a53fe);}});});}function transcribe(_0x4efeca,_0x25ed77,_0x19e3cf,_0x24d6bf,_0x1a41de,_0x358d40,_0x33a4ce){return new Promise(function(_0x28170f,_0x4b025e){var _0x23961c={};logger['info'](util[_0x0092('0x31')](_0x0092('0x6c'),_0x4efeca,_0x1a41de));return uploadFile(_0x25ed77,_0x19e3cf,_0x24d6bf,_0x1a41de,path['basename'](_0x358d40),fs[_0x0092('0x6d')](_0x358d40))[_0x0092('0x24')](function(_0x5528f4){logger[_0x0092('0x62')](util[_0x0092('0x31')](_0x0092('0x6e'),_0x4efeca,_0x1a41de,_0x5528f4[_0x0092('0x6f')]));_0x23961c[_0x0092('0x70')]=_0x5528f4[_0x0092('0x71')];_0x23961c[_0x0092('0x72')]=_0x5528f4[_0x0092('0x6f')];logger[_0x0092('0x62')](util[_0x0092('0x31')]('[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request',_0x4efeca));return startTranscribe(_0x25ed77,_0x19e3cf,_0x24d6bf,uuidv4(),_0x33a4ce,_0x5528f4[_0x0092('0x6f')]);})[_0x0092('0x24')](function(_0x50bc94){logger[_0x0092('0x62')](util[_0x0092('0x31')](_0x0092('0x73'),_0x4efeca,_0x50bc94[_0x0092('0x74')]['TranscriptionJobName']));_0x23961c[_0x0092('0x75')]=_0x50bc94[_0x0092('0x74')][_0x0092('0x76')];_0x23961c[_0x0092('0x77')]=_0x50bc94['TranscriptionJob'][_0x0092('0x78')];return _0x28170f(_0x23961c);})[_0x0092('0x45')](function(_0x5ac7e0){return _0x4b025e(_0x5ac7e0);});});}exports[_0x0092('0x79')]=function(_0x5827a9,_0x28c4ca,_0x251766){var _0x470c7a;var _0x202345;var _0x1a2803;var _0x4d5fae=require(_0x0092('0x7a'));return db[_0x0092('0x2a')]['findOne']({'where':{'id':_0x5827a9['params']['id']}})[_0x0092('0x24')](function(_0x1c9e4e){if(_0x1c9e4e){var _0x3bbf3a=util[_0x0092('0x31')](_0x0092('0x4c'),_0x1c9e4e[_0x0092('0x4b')]);if(fs[_0x0092('0x4d')](_0x3bbf3a)){cypher=!![];return _0x4d5fae[_0x0092('0x4e')](_0x3bbf3a,_0x1c9e4e[_0x0092('0x4b')],config['secrets']['recording'])['then'](function(){return _0x1c9e4e;});}return _0x1c9e4e;}})[_0x0092('0x24')](function(_0x2a74e3){if(!_0x2a74e3){throw new db[(_0x0092('0x51'))]['ValidationError'](_0x0092('0x7b'));}_0x202345=_0x2a74e3;return db[_0x0092('0x7c')][_0x0092('0x7d')]({'where':{'id':0x1}});})[_0x0092('0x24')](handleEntityNotFound(_0x28c4ca,null))[_0x0092('0x24')](function(_0x565478){if(_0x565478){_0x470c7a=_0x565478;if(!_0x470c7a[_0x0092('0x7e')]||!_0x470c7a[_0x0092('0x7f')]||!_0x470c7a['transcribeRegion']||!_0x470c7a[_0x0092('0x80')]||!_0x470c7a[_0x0092('0x70')]){throw new db[(_0x0092('0x51'))][(_0x0092('0x5f'))](_0x0092('0x81'));}if(_0x5827a9['body'][_0x0092('0x82')]&&(!_0x470c7a[_0x0092('0x83')]||!_0x470c7a[_0x0092('0x84')]||!_0x470c7a[_0x0092('0x85')]||!_0x470c7a[_0x0092('0x80')]||!_0x470c7a[_0x0092('0x70')])){throw new db[(_0x0092('0x51'))][(_0x0092('0x5f'))](_0x0092('0x86'));}return db['CloudProvider'][_0x0092('0x7d')]({'where':{'id':_0x470c7a['transcribeAccountId']}});}})[_0x0092('0x24')](function(_0x1646fe){if(!_0x1646fe){throw new db[(_0x0092('0x51'))][(_0x0092('0x5f'))](_0x0092('0x87'));}if(!_0x1646fe[_0x0092('0x88')]||!_0x1646fe[_0x0092('0x89')]){throw new db[(_0x0092('0x51'))]['ValidationError'](_0x0092('0x8a'));}_0x1a2803=_0x1646fe;return getBucketslist(_0x1a2803[_0x0092('0x88')],_0x1a2803[_0x0092('0x89')],_0x470c7a[_0x0092('0x8b')]);})['then'](function(_0x4d6873){if(_0x4d6873&&_0x4d6873['Buckets']){var _0x4bed88=_['find'](_0x4d6873[_0x0092('0x8c')],function(_0x2ca7df){return _0x2ca7df['Name']===_0x470c7a[_0x0092('0x70')];});if(!_0x4bed88){logger[_0x0092('0x62')](util[_0x0092('0x31')](_0x0092('0x8d'),_0x5827a9[_0x0092('0x43')]['id'],_0x470c7a[_0x0092('0x70')]));return createBucket(_0x1a2803[_0x0092('0x88')],_0x1a2803['data2'],_0x470c7a[_0x0092('0x8b')],_0x470c7a[_0x0092('0x70')]);}logger[_0x0092('0x62')](util['format'](_0x0092('0x8e'),_0x5827a9['params']['id'],_0x470c7a[_0x0092('0x70')]));return;}})['then'](function(_0x314412){if(_0x202345[_0x0092('0x77')]===_0x0092('0x8f')){return transcribe(_0x5827a9[_0x0092('0x43')]['id'],_0x1a2803['data1'],_0x1a2803['data2'],_0x470c7a['transcribeRegion'],_0x470c7a[_0x0092('0x70')],_0x202345[_0x0092('0x4b')],_0x470c7a['language']);}else{logger[_0x0092('0x62')](util[_0x0092('0x31')](_0x0092('0x90'),_0x5827a9[_0x0092('0x43')]['id']));return{'transcribeStatus':_0x0092('0x91')};}})[_0x0092('0x24')](function(_0x4075f7){if(_0x4075f7){_0x4075f7[_0x0092('0x92')]=_0x5827a9[_0x0092('0x47')][_0x0092('0x82')];return _0x202345[_0x0092('0x93')](_0x4075f7);}})[_0x0092('0x24')](respondWithResult(_0x28c4ca,null))['catch'](handleError(_0x28c4ca,null));};function writeFile(_0x2414fc,_0x1c0db4){return new Promise(function(_0x192663,_0x15ce97){fs[_0x0092('0x94')](_0x1c0db4,_0x2414fc,function(_0x2da39b,_0x252010){if(_0x2da39b){return _0x15ce97(_0x2da39b);}else{return _0x192663(_0x252010);}});});}exports[_0x0092('0x95')]=function(_0x143583,_0x48e4bf,_0x2a6b5e){return db[_0x0092('0x2a')][_0x0092('0x7d')]({'where':{'id':_0x143583[_0x0092('0x43')]['id']}})[_0x0092('0x24')](handleEntityNotFound(_0x48e4bf))['then'](function(_0x21ba98){if(_0x21ba98&&_0x21ba98[_0x0092('0x96')]){var _0x1e482e=_0x21ba98[_0x0092('0x96')];var _0x70231e=config[_0x0092('0x97')]+_0x0092('0x98')+_0x21ba98['id']+_0x0092('0x99');if(fs[_0x0092('0x4d')](_0x70231e)){return _0x70231e;}return writeFile(_0x1e482e,_0x70231e)[_0x0092('0x24')](function(){return _0x70231e;});}else{throw new db[(_0x0092('0x51'))][(_0x0092('0x5f'))](_0x0092('0x9a'));}})['then'](function(_0x173bb8){return _0x48e4bf[_0x0092('0x49')](_0x173bb8);})[_0x0092('0x45')](handleError(_0x48e4bf));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index f90a219..e4beba3 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 _0x847d=['uniqueid','transcribeStatus','exports','VoiceRecording'];(function(_0x354745,_0x28df69){var _0x3e14c5=function(_0x21dbe1){while(--_0x21dbe1){_0x354745['push'](_0x354745['shift']());}};_0x3e14c5(++_0x28df69);}(_0x847d,0x14a));var _0xd847=function(_0x45d3f0,_0x4be53f){_0x45d3f0=_0x45d3f0-0x0;var _0x314b79=_0x847d[_0x45d3f0];return _0x314b79;};'use strict';var attributes=require('./voiceRecording.attributes');module[_0xd847('0x0')]=function(_0x3465bf,_0x239d20){return _0x3465bf['define'](_0xd847('0x1'),attributes,{'tableName':'voice_recordings','paranoid':![],'indexes':[{'name':_0xd847('0x2'),'fields':[_0xd847('0x2')]},{'name':'transcribeStatus','fields':[_0xd847('0x3')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9585=['uniqueid','transcribeStatus','exports','define','VoiceRecording','voice_recordings'];(function(_0x568528,_0x7dbd5){var _0x503dd6=function(_0x5f8f8d){while(--_0x5f8f8d){_0x568528['push'](_0x568528['shift']());}};_0x503dd6(++_0x7dbd5);}(_0x9585,0x15e));var _0x5958=function(_0x53d473,_0x5dc4a2){_0x53d473=_0x53d473-0x0;var _0x4a3bbe=_0x9585[_0x53d473];return _0x4a3bbe;};'use strict';var attributes=require('./voiceRecording.attributes');module[_0x5958('0x0')]=function(_0x57d84d,_0x35702f){return _0x57d84d[_0x5958('0x1')](_0x5958('0x2'),attributes,{'tableName':_0x5958('0x3'),'paranoid':![],'indexes':[{'name':_0x5958('0x4'),'fields':[_0x5958('0x4')]},{'name':_0x5958('0x5'),'fields':[_0x5958('0x5')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index 7dfb0d0..1902d10 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 _0xa46e=['then','request\x20sent','debug','stringify','error','code','message','VoiceRecording,\x20%s,\x20%s','info','result','catch','VoiceRecording','update','options','raw','where','attributes','findOne','callRecordingEncryption','create','value','format','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','CreateVoiceRecording','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','http','request'];(function(_0x57966a,_0x477964){var _0x191765=function(_0x106a01){while(--_0x106a01){_0x57966a['push'](_0x57966a['shift']());}};_0x191765(++_0x477964);}(_0xa46e,0x8a));var _0xea46=function(_0x3cc9d9,_0x69ed38){_0x3cc9d9=_0x3cc9d9-0x0;var _0x1a425d=_0xa46e[_0x3cc9d9];return _0x1a425d;};'use strict';var _=require(_0xea46('0x0'));var util=require(_0xea46('0x1'));var moment=require('moment');var BPromise=require(_0xea46('0x2'));var rs=require(_0xea46('0x3'));var fs=require('fs');var Redis=require(_0xea46('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xea46('0x5'));var logger=require('../../config/logger')(_0xea46('0x6'));var config=require('../../config/environment');var jayson=require(_0xea46('0x7'));var client=jayson['client'][_0xea46('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3dc26f,_0x5f1cd1,_0x2d1b30){return new BPromise(function(_0x42771a,_0xe7d428){return client[_0xea46('0x9')](_0x3dc26f,_0x2d1b30)[_0xea46('0xa')](function(_0x4cf206){logger['info']('VoiceRecording,\x20%s,\x20%s',_0x5f1cd1,_0xea46('0xb'));logger[_0xea46('0xc')]('VoiceRecording,\x20%s,\x20%s,\x20%s',_0x5f1cd1,_0xea46('0xb'),JSON[_0xea46('0xd')](_0x4cf206));if(_0x4cf206[_0xea46('0xe')]){if(_0x4cf206['error'][_0xea46('0xf')]===0x1f4){logger[_0xea46('0xe')]('VoiceRecording,\x20%s,\x20%s',_0x5f1cd1,_0x4cf206[_0xea46('0xe')][_0xea46('0x10')]);return _0xe7d428(_0x4cf206['error'][_0xea46('0x10')]);}logger['error'](_0xea46('0x11'),_0x5f1cd1,_0x4cf206[_0xea46('0xe')][_0xea46('0x10')]);return _0x42771a(_0x4cf206[_0xea46('0xe')][_0xea46('0x10')]);}else{logger[_0xea46('0x12')](_0xea46('0x11'),_0x5f1cd1,_0xea46('0xb'));_0x42771a(_0x4cf206[_0xea46('0x13')]['message']);}})[_0xea46('0x14')](function(_0xbf225e){logger[_0xea46('0xe')]('VoiceRecording,\x20%s,\x20%s',_0x5f1cd1,_0xbf225e);_0xe7d428(_0xbf225e);});});}exports['UpdateVoiceRecording']=function(_0x19d5c1){var _0x3f463d=this;return new Promise(function(_0x5cf5dd,_0x4b6745){return db[_0xea46('0x15')][_0xea46('0x16')](_0x19d5c1['body'],{'raw':_0x19d5c1[_0xea46('0x17')]?_0x19d5c1[_0xea46('0x17')][_0xea46('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x19d5c1[_0xea46('0x17')]?_0x19d5c1['options'][_0xea46('0x19')]||null:null,'attributes':_0x19d5c1['options']?_0x19d5c1['options'][_0xea46('0x1a')]||null:null,'limit':_0x19d5c1['options']?_0x19d5c1['options']['limit']||null:null})[_0xea46('0xa')](function(_0x36f982){logger[_0xea46('0x12')]('UpdateVoiceRecording',_0x19d5c1);logger[_0xea46('0xc')]('UpdateVoiceRecording',_0x19d5c1,JSON[_0xea46('0xd')](_0x36f982));_0x5cf5dd(_0x36f982);})[_0xea46('0x14')](function(_0x528eae){logger[_0xea46('0xe')]('UpdateVoiceRecording',_0x528eae[_0xea46('0x10')],_0x19d5c1);_0x4b6745(_0x3f463d[_0xea46('0xe')](0x1f4,_0x528eae[_0xea46('0x10')]));});});};exports['CreateVoiceRecording']=function(_0x5d2de1){var _0x44e797=this;return new Promise(function(_0x38ac07,_0x4b369c){var _0x3b3928=require('../../components/encryptor');var _0x11129d;return db['Setting'][_0xea46('0x1b')]({'attributes':['id',_0xea46('0x1c')],'where':{'id':0x1},'raw':!![]})[_0xea46('0xa')](function(_0x44517d){_0x11129d=_0x44517d;return db[_0xea46('0x15')][_0xea46('0x1d')](_0x5d2de1['body']);})[_0xea46('0xa')](function(_0x338e96){if(_0x11129d[_0xea46('0x1c')]&&fs['existsSync'](_0x338e96[_0xea46('0x1e')])){var _0x3cdf96=util[_0xea46('0x1f')]('%s.cypher',_0x338e96['value']);return _0x3b3928['encryptFile'](_0x338e96[_0xea46('0x1e')],_0x3cdf96,config[_0xea46('0x20')][_0xea46('0x21')])[_0xea46('0xa')](function(){fs[_0xea46('0x22')](_0x338e96[_0xea46('0x1e')]);logger[_0xea46('0x12')](_0xea46('0x23'));return _0x338e96;});}return _0x338e96;})[_0xea46('0xa')](function(_0x1c7201){logger[_0xea46('0x12')]('CreateVoiceRecording',_0x5d2de1);logger[_0xea46('0xc')](_0xea46('0x24'),_0x5d2de1,JSON[_0xea46('0xd')](_0x1c7201));_0x38ac07(_0x1c7201);})[_0xea46('0x14')](function(_0x1472c0){logger[_0xea46('0xe')](_0xea46('0x24'),_0x1472c0['message'],_0x5d2de1);_0x4b369c(_0x44e797[_0xea46('0xe')](0x1f4,_0x1472c0[_0xea46('0x10')]));});});}; \ No newline at end of file +var _0x32f4=['unlink','CreateVoiceRecording\x20file\x20encrypted','CreateVoiceRecording','debug','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateVoiceRecording','VoiceRecording','body','options','raw','where','attributes','../../components/encryptor','findOne','callRecordingEncryption','existsSync','format','encryptFile','value','secrets','recording'];(function(_0x4a747d,_0x3b747f){var _0x3a5b5c=function(_0x4b3e81){while(--_0x4b3e81){_0x4a747d['push'](_0x4a747d['shift']());}};_0x3a5b5c(++_0x3b747f);}(_0x32f4,0x154));var _0x432f=function(_0x33621f,_0x4abb3c){_0x33621f=_0x33621f-0x0;var _0x49013f=_0x32f4[_0x33621f];return _0x49013f;};'use strict';var _=require(_0x432f('0x0'));var util=require(_0x432f('0x1'));var moment=require(_0x432f('0x2'));var BPromise=require(_0x432f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x432f('0x4'));var db=require(_0x432f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x432f('0x6'))(_0x432f('0x7'));var config=require(_0x432f('0x8'));var jayson=require(_0x432f('0x9'));var client=jayson[_0x432f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5b5f08,_0x2f66fd,_0x32b062){return new BPromise(function(_0x4a5b56,_0x2a2ef6){return client['request'](_0x5b5f08,_0x32b062)[_0x432f('0xb')](function(_0x340fe9){logger[_0x432f('0xc')](_0x432f('0xd'),_0x2f66fd,_0x432f('0xe'));logger['debug'](_0x432f('0xf'),_0x2f66fd,'request\x20sent',JSON[_0x432f('0x10')](_0x340fe9));if(_0x340fe9['error']){if(_0x340fe9[_0x432f('0x11')][_0x432f('0x12')]===0x1f4){logger['error'](_0x432f('0xd'),_0x2f66fd,_0x340fe9[_0x432f('0x11')]['message']);return _0x2a2ef6(_0x340fe9[_0x432f('0x11')][_0x432f('0x13')]);}logger['error']('VoiceRecording,\x20%s,\x20%s',_0x2f66fd,_0x340fe9[_0x432f('0x11')][_0x432f('0x13')]);return _0x4a5b56(_0x340fe9[_0x432f('0x11')][_0x432f('0x13')]);}else{logger[_0x432f('0xc')]('VoiceRecording,\x20%s,\x20%s',_0x2f66fd,_0x432f('0xe'));_0x4a5b56(_0x340fe9[_0x432f('0x14')][_0x432f('0x13')]);}})[_0x432f('0x15')](function(_0x5bae29){logger[_0x432f('0x11')](_0x432f('0xd'),_0x2f66fd,_0x5bae29);_0x2a2ef6(_0x5bae29);});});}exports[_0x432f('0x16')]=function(_0x243cf){var _0x3cd5da=this;return new Promise(function(_0x129582,_0x5ae24e){return db[_0x432f('0x17')]['update'](_0x243cf[_0x432f('0x18')],{'raw':_0x243cf[_0x432f('0x19')]?_0x243cf[_0x432f('0x19')][_0x432f('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x243cf[_0x432f('0x19')]?_0x243cf[_0x432f('0x19')][_0x432f('0x1b')]||null:null,'attributes':_0x243cf[_0x432f('0x19')]?_0x243cf[_0x432f('0x19')][_0x432f('0x1c')]||null:null,'limit':_0x243cf[_0x432f('0x19')]?_0x243cf[_0x432f('0x19')]['limit']||null:null})['then'](function(_0x343d13){logger['info'](_0x432f('0x16'),_0x243cf);logger['debug'](_0x432f('0x16'),_0x243cf,JSON[_0x432f('0x10')](_0x343d13));_0x129582(_0x343d13);})[_0x432f('0x15')](function(_0x89ea50){logger[_0x432f('0x11')](_0x432f('0x16'),_0x89ea50['message'],_0x243cf);_0x5ae24e(_0x3cd5da[_0x432f('0x11')](0x1f4,_0x89ea50[_0x432f('0x13')]));});});};exports['CreateVoiceRecording']=function(_0x2cbde9){var _0x3e37ec=this;return new Promise(function(_0x2bcbb4,_0x23347e){var _0x44839=require(_0x432f('0x1d'));var _0x138a6a;return db['Setting'][_0x432f('0x1e')]({'attributes':['id','callRecordingEncryption'],'where':{'id':0x1},'raw':!![]})[_0x432f('0xb')](function(_0x573cc5){_0x138a6a=_0x573cc5;return db[_0x432f('0x17')]['create'](_0x2cbde9[_0x432f('0x18')]);})['then'](function(_0x325a9c){if(_0x138a6a[_0x432f('0x1f')]&&fs[_0x432f('0x20')](_0x325a9c['value'])){var _0x6a116e=util[_0x432f('0x21')]('%s.cypher',_0x325a9c['value']);return _0x44839[_0x432f('0x22')](_0x325a9c[_0x432f('0x23')],_0x6a116e,config[_0x432f('0x24')][_0x432f('0x25')])[_0x432f('0xb')](function(){fs[_0x432f('0x26')](_0x325a9c['value']);logger['info'](_0x432f('0x27'));return _0x325a9c;});}return _0x325a9c;})[_0x432f('0xb')](function(_0x184203){logger['info'](_0x432f('0x28'),_0x2cbde9);logger[_0x432f('0x29')](_0x432f('0x28'),_0x2cbde9,JSON[_0x432f('0x10')](_0x184203));_0x2bcbb4(_0x184203);})[_0x432f('0x15')](function(_0x3ad632){logger[_0x432f('0x11')](_0x432f('0x28'),_0x3ad632['message'],_0x2cbde9);_0x23347e(_0x3e37ec['error'](0x1f4,_0x3ad632[_0x432f('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 8a2bd5a..f3aca77 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 _0xc4a7=['multer','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','post','create','put','/:id','update','destroy','exports'];(function(_0x5376dd,_0x45b635){var _0x588dac=function(_0x5c434d){while(--_0x5c434d){_0x5376dd['push'](_0x5376dd['shift']());}};_0x588dac(++_0x45b635);}(_0xc4a7,0x6c));var _0x7c4a=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xc4a7[_0x3b380d];return _0x54502b;};'use strict';var multer=require(_0x7c4a('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x7c4a('0x1'));var express=require(_0x7c4a('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x7c4a('0x3'));var interaction=require(_0x7c4a('0x4'));var config=require(_0x7c4a('0x5'));var controller=require('./voiceTransferReport.controller');router[_0x7c4a('0x6')]('/',auth[_0x7c4a('0x7')](),controller[_0x7c4a('0x8')]);router[_0x7c4a('0x6')](_0x7c4a('0x9'),auth[_0x7c4a('0x7')](),controller[_0x7c4a('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0x7c4a('0xb')]('/',auth[_0x7c4a('0x7')](),controller[_0x7c4a('0xc')]);router[_0x7c4a('0xd')](_0x7c4a('0xe'),auth[_0x7c4a('0x7')](),controller[_0x7c4a('0xf')]);router['delete'](_0x7c4a('0xe'),auth['isAuthenticated'](),controller[_0x7c4a('0x10')]);module[_0x7c4a('0x11')]=router; \ No newline at end of file +var _0x709f=['../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','index','describe','/:id','show','post','create','put','destroy','exports','multer','path','connect-timeout','fs-extra'];(function(_0x591680,_0x262c13){var _0x1d62bd=function(_0x7b1fd3){while(--_0x7b1fd3){_0x591680['push'](_0x591680['shift']());}};_0x1d62bd(++_0x262c13);}(_0x709f,0x152));var _0xf709=function(_0x565c4e,_0x1e77f9){_0x565c4e=_0x565c4e-0x0;var _0x4a167f=_0x709f[_0x565c4e];return _0x4a167f;};'use strict';var multer=require(_0xf709('0x0'));var util=require('util');var path=require(_0xf709('0x1'));var timeout=require(_0xf709('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xf709('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xf709('0x4'));var config=require(_0xf709('0x5'));var controller=require(_0xf709('0x6'));router[_0xf709('0x7')]('/',auth[_0xf709('0x8')](),controller[_0xf709('0x9')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0xf709('0xa')]);router['get'](_0xf709('0xb'),auth[_0xf709('0x8')](),controller[_0xf709('0xc')]);router[_0xf709('0xd')]('/',auth[_0xf709('0x8')](),controller[_0xf709('0xe')]);router[_0xf709('0xf')]('/:id',auth[_0xf709('0x8')](),controller['update']);router['delete'](_0xf709('0xb'),auth[_0xf709('0x8')](),controller[_0xf709('0x10')]);module[_0xf709('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 7539a40..b112490 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 _0x29c3=['blind','attended','STRING','Yes','sequelize','moment','exports','ENUM'];(function(_0x5ddc1e,_0x13985a){var _0x6164d1=function(_0xc0a69d){while(--_0xc0a69d){_0x5ddc1e['push'](_0x5ddc1e['shift']());}};_0x6164d1(++_0x13985a);}(_0x29c3,0x12c));var _0x329c=function(_0x3184f8,_0x4fb8bf){_0x3184f8=_0x3184f8-0x0;var _0x42b21f=_0x29c3[_0x3184f8];return _0x42b21f;};'use strict';var Sequelize=require(_0x329c('0x0'));var moment=require(_0x329c('0x1'));module[_0x329c('0x2')]={'type':{'type':Sequelize[_0x329c('0x3')](_0x329c('0x4'),_0x329c('0x5'))},'result':{'type':Sequelize[_0x329c('0x6')]},'transfererchannel':{'type':Sequelize['STRING']},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize[_0x329c('0x6')]},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize[_0x329c('0x6')]},'transfereraccountcode':{'type':Sequelize[_0x329c('0x6')]},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize[_0x329c('0x6')]},'transfererlinkedid':{'type':Sequelize[_0x329c('0x6')]},'transfereechannel':{'type':Sequelize[_0x329c('0x6')]},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize[_0x329c('0x6')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x329c('0x6')]},'transfereeconnectedlinename':{'type':Sequelize[_0x329c('0x6')]},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize[_0x329c('0x6')]},'transfereeexten':{'type':Sequelize[_0x329c('0x6')]},'transfereelinkedid':{'type':Sequelize[_0x329c('0x6')]},'isexternal':{'type':Sequelize[_0x329c('0x3')](_0x329c('0x7'),'No')},'context':{'type':Sequelize[_0x329c('0x6')]},'extension':{'type':Sequelize[_0x329c('0x6')]}}; \ No newline at end of file +var _0x8aac=['sequelize','moment','exports','blind','attended','STRING','ENUM'];(function(_0x6f984c,_0x70b507){var _0x44f6f2=function(_0xb7c35a){while(--_0xb7c35a){_0x6f984c['push'](_0x6f984c['shift']());}};_0x44f6f2(++_0x70b507);}(_0x8aac,0x1b2));var _0xc8aa=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8aac[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xc8aa('0x0'));var moment=require(_0xc8aa('0x1'));module[_0xc8aa('0x2')]={'type':{'type':Sequelize['ENUM'](_0xc8aa('0x3'),_0xc8aa('0x4'))},'result':{'type':Sequelize[_0xc8aa('0x5')]},'transfererchannel':{'type':Sequelize[_0xc8aa('0x5')]},'transferercalleridnum':{'type':Sequelize[_0xc8aa('0x5')]},'transferercalleridname':{'type':Sequelize[_0xc8aa('0x5')]},'transfererconnectedlinenum':{'type':Sequelize[_0xc8aa('0x5')]},'transfererconnectedlinename':{'type':Sequelize[_0xc8aa('0x5')]},'transfereraccountcode':{'type':Sequelize[_0xc8aa('0x5')]},'transferercontext':{'type':Sequelize[_0xc8aa('0x5')]},'transfererexten':{'type':Sequelize[_0xc8aa('0x5')]},'transfererlinkedid':{'type':Sequelize['STRING']},'transfereechannel':{'type':Sequelize[_0xc8aa('0x5')]},'transfereecalleridnum':{'type':Sequelize[_0xc8aa('0x5')]},'transfereecalleridname':{'type':Sequelize[_0xc8aa('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize[_0xc8aa('0x5')]},'transfereeconnectedlinename':{'type':Sequelize[_0xc8aa('0x5')]},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize[_0xc8aa('0x5')]},'transfereeexten':{'type':Sequelize[_0xc8aa('0x5')]},'transfereelinkedid':{'type':Sequelize[_0xc8aa('0x5')]},'isexternal':{'type':Sequelize[_0xc8aa('0x6')]('Yes','No')},'context':{'type':Sequelize[_0xc8aa('0x5')]},'extension':{'type':Sequelize[_0xc8aa('0x5')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index fdf85b3..f8ac393 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 _0xd8a1=['sendStatus','status','offset','limit','undefined','count','set','Content-Range','json','apply','save','update','then','stack','name','send','index','map','VoiceTransferReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','sort','filter','where','merge','options','includeAll','include','catch','show','params','keys','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x3a9320,_0x3831a4){var _0x1180a8=function(_0x4a4b43){while(--_0x4a4b43){_0x3a9320['push'](_0x3a9320['shift']());}};_0x1180a8(++_0x3831a4);}(_0xd8a1,0x191));var _0x1d8a=function(_0x12e8ac,_0x2cd409){_0x12e8ac=_0x12e8ac-0x0;var _0x26a16c=_0xd8a1[_0x12e8ac];return _0x26a16c;};'use strict';var emlformat=require(_0x1d8a('0x0'));var rimraf=require(_0x1d8a('0x1'));var zipdir=require(_0x1d8a('0x2'));var jsonpatch=require(_0x1d8a('0x3'));var rp=require(_0x1d8a('0x4'));var moment=require(_0x1d8a('0x5'));var BPromise=require(_0x1d8a('0x6'));var Mustache=require(_0x1d8a('0x7'));var util=require(_0x1d8a('0x8'));var path=require(_0x1d8a('0x9'));var sox=require('sox');var csv=require(_0x1d8a('0xa'));var ejs=require(_0x1d8a('0xb'));var fs=require('fs');var fs_extra=require(_0x1d8a('0xc'));var _=require(_0x1d8a('0xd'));var squel=require('squel');var crypto=require(_0x1d8a('0xe'));var jsforce=require(_0x1d8a('0xf'));var deskjs=require(_0x1d8a('0x10'));var toCsv=require(_0x1d8a('0xa'));var querystring=require(_0x1d8a('0x11'));var Papa=require('papaparse');var Redis=require(_0x1d8a('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x1d8a('0x13'));var as=require(_0x1d8a('0x14'));var hardwareService=require(_0x1d8a('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x1d8a('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x1d8a('0x17'));var db=require(_0x1d8a('0x18'))['db'];function respondWithStatusCode(_0x5ba685,_0x4e4eff){_0x4e4eff=_0x4e4eff||0xcc;return function(_0x593016){if(_0x593016){return _0x5ba685[_0x1d8a('0x19')](_0x4e4eff);}return _0x5ba685[_0x1d8a('0x1a')](_0x4e4eff)['end']();};}function respondWithResult(_0x4d433f,_0x9f06fb){_0x9f06fb=_0x9f06fb||0xc8;return function(_0x5b2b55){if(_0x5b2b55){return _0x4d433f['status'](_0x9f06fb)['json'](_0x5b2b55);}};}function respondWithFilteredResult(_0x36b142,_0x1d015a){return function(_0x4a97a6){if(_0x4a97a6){var _0x1d8b7c=typeof _0x1d015a[_0x1d8a('0x1b')]==='undefined'&&typeof _0x1d015a[_0x1d8a('0x1c')]===_0x1d8a('0x1d');var _0x323da3=_0x4a97a6[_0x1d8a('0x1e')];var _0x158817=_0x1d8b7c?0x0:_0x1d015a[_0x1d8a('0x1b')];var _0x1cf3e6=_0x1d8b7c?_0x4a97a6[_0x1d8a('0x1e')]:_0x1d015a[_0x1d8a('0x1b')]+_0x1d015a[_0x1d8a('0x1c')];var _0xcec367;if(_0x1cf3e6>=_0x323da3){_0x1cf3e6=_0x323da3;_0xcec367=0xc8;}else{_0xcec367=0xce;}_0x36b142['status'](_0xcec367);return _0x36b142[_0x1d8a('0x1f')](_0x1d8a('0x20'),_0x158817+'-'+_0x1cf3e6+'/'+_0x323da3)[_0x1d8a('0x21')](_0x4a97a6);}return null;};}function patchUpdates(_0x595d2c){return function(_0x482fe5){try{jsonpatch[_0x1d8a('0x22')](_0x482fe5,_0x595d2c,!![]);}catch(_0x196ce2){return BPromise['reject'](_0x196ce2);}return _0x482fe5[_0x1d8a('0x23')]();};}function saveUpdates(_0x152b56,_0x43c0d9){return function(_0x28c9d4){if(_0x28c9d4){return _0x28c9d4[_0x1d8a('0x24')](_0x152b56)[_0x1d8a('0x25')](function(_0x3066e7){return _0x3066e7;});}return null;};}function removeEntity(_0x2c60d7,_0x17cde4){return function(_0x513cec){if(_0x513cec){return _0x513cec['destroy']()['then'](function(){_0x2c60d7['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x6f712,_0x1c7655){return function(_0x1df294){if(!_0x1df294){_0x6f712['sendStatus'](0x194);}return _0x1df294;};}function handleError(_0x528e51,_0x31feb2){_0x31feb2=_0x31feb2||0x1f4;return function(_0x591e67){logger['error'](_0x591e67[_0x1d8a('0x26')]);if(_0x591e67[_0x1d8a('0x27')]){delete _0x591e67[_0x1d8a('0x27')];}_0x528e51[_0x1d8a('0x1a')](_0x31feb2)[_0x1d8a('0x28')](_0x591e67);};}exports[_0x1d8a('0x29')]=function(_0x40fca1,_0x295a99){var _0x406ff5={},_0x326531={},_0x36a3c3={'count':0x0,'rows':[]};var _0x25de29=_[_0x1d8a('0x2a')](db[_0x1d8a('0x2b')][_0x1d8a('0x2c')],function(_0x5bde2e){return{'name':_0x5bde2e[_0x1d8a('0x2d')],'type':_0x5bde2e[_0x1d8a('0x2e')][_0x1d8a('0x2f')]};});_0x326531[_0x1d8a('0x30')]=_[_0x1d8a('0x2a')](_0x25de29,'name');_0x326531[_0x1d8a('0x31')]=_['keys'](_0x40fca1[_0x1d8a('0x31')]);_0x326531[_0x1d8a('0x32')]=_[_0x1d8a('0x33')](_0x326531[_0x1d8a('0x30')],_0x326531['query']);_0x406ff5['attributes']=_[_0x1d8a('0x33')](_0x326531['model'],qs[_0x1d8a('0x34')](_0x40fca1[_0x1d8a('0x31')][_0x1d8a('0x34')]));_0x406ff5[_0x1d8a('0x35')]=_0x406ff5[_0x1d8a('0x35')][_0x1d8a('0x36')]?_0x406ff5['attributes']:_0x326531['model'];if(!_0x40fca1[_0x1d8a('0x31')][_0x1d8a('0x37')]('nolimit')){_0x406ff5['limit']=qs['limit'](_0x40fca1[_0x1d8a('0x31')][_0x1d8a('0x1c')]);_0x406ff5[_0x1d8a('0x1b')]=qs[_0x1d8a('0x1b')](_0x40fca1[_0x1d8a('0x31')][_0x1d8a('0x1b')]);}_0x406ff5['order']=qs['sort'](_0x40fca1[_0x1d8a('0x31')][_0x1d8a('0x38')]);_0x406ff5['where']=qs[_0x1d8a('0x32')](_['pick'](_0x40fca1[_0x1d8a('0x31')],_0x326531[_0x1d8a('0x32')]),_0x25de29);if(_0x40fca1[_0x1d8a('0x31')][_0x1d8a('0x39')]){_0x406ff5[_0x1d8a('0x3a')]=_[_0x1d8a('0x3b')](_0x406ff5[_0x1d8a('0x3a')],{'$or':_['map'](_0x25de29,function(_0x14680c){if(_0x14680c[_0x1d8a('0x2e')]!=='VIRTUAL'){var _0x337f5b={};_0x337f5b[_0x14680c[_0x1d8a('0x27')]]={'$like':'%'+_0x40fca1[_0x1d8a('0x31')]['filter']+'%'};return _0x337f5b;}})});}_0x406ff5=_[_0x1d8a('0x3b')]({},_0x406ff5,_0x40fca1[_0x1d8a('0x3c')]);var _0x466dc5={'where':_0x406ff5[_0x1d8a('0x3a')]};return db[_0x1d8a('0x2b')][_0x1d8a('0x1e')](_0x466dc5)[_0x1d8a('0x25')](function(_0x13523c){_0x36a3c3[_0x1d8a('0x1e')]=_0x13523c;if(_0x40fca1['query'][_0x1d8a('0x3d')]){_0x406ff5[_0x1d8a('0x3e')]=[{'all':!![]}];}return db['VoiceTransferReport']['findAll'](_0x406ff5);})['then'](function(_0x1b3efa){_0x36a3c3['rows']=_0x1b3efa;return _0x36a3c3;})[_0x1d8a('0x25')](respondWithFilteredResult(_0x295a99,_0x406ff5))[_0x1d8a('0x3f')](handleError(_0x295a99,null));};exports[_0x1d8a('0x40')]=function(_0x1f783c,_0x1e9ba6){var _0x1000f2={'raw':!![],'where':{'id':_0x1f783c[_0x1d8a('0x41')]['id']}},_0x7c7b47={};_0x7c7b47[_0x1d8a('0x30')]=_[_0x1d8a('0x42')](db[_0x1d8a('0x2b')][_0x1d8a('0x2c')]);_0x7c7b47[_0x1d8a('0x31')]=_[_0x1d8a('0x42')](_0x1f783c['query']);_0x7c7b47[_0x1d8a('0x32')]=_['intersection'](_0x7c7b47[_0x1d8a('0x30')],_0x7c7b47[_0x1d8a('0x31')]);_0x1000f2['attributes']=_[_0x1d8a('0x33')](_0x7c7b47[_0x1d8a('0x30')],qs[_0x1d8a('0x34')](_0x1f783c[_0x1d8a('0x31')][_0x1d8a('0x34')]));_0x1000f2['attributes']=_0x1000f2['attributes'][_0x1d8a('0x36')]?_0x1000f2[_0x1d8a('0x35')]:_0x7c7b47['model'];if(_0x1f783c[_0x1d8a('0x31')][_0x1d8a('0x3d')]){_0x1000f2[_0x1d8a('0x3e')]=[{'all':!![]}];}_0x1000f2=_[_0x1d8a('0x3b')]({},_0x1000f2,_0x1f783c[_0x1d8a('0x3c')]);return db['VoiceTransferReport']['find'](_0x1000f2)['then'](handleEntityNotFound(_0x1e9ba6,null))['then'](respondWithResult(_0x1e9ba6,null))[_0x1d8a('0x3f')](handleError(_0x1e9ba6,null));};exports[_0x1d8a('0x43')]=function(_0x3cf1c9,_0x1153cb){return db[_0x1d8a('0x2b')][_0x1d8a('0x43')](_0x3cf1c9[_0x1d8a('0x44')],{})['then'](respondWithResult(_0x1153cb,0xc9))[_0x1d8a('0x3f')](handleError(_0x1153cb,null));};exports[_0x1d8a('0x24')]=function(_0x598314,_0x5c0c9e){if(_0x598314[_0x1d8a('0x44')]['id']){delete _0x598314[_0x1d8a('0x44')]['id'];}return db[_0x1d8a('0x2b')][_0x1d8a('0x45')]({'where':{'id':_0x598314['params']['id']}})['then'](handleEntityNotFound(_0x5c0c9e,null))[_0x1d8a('0x25')](saveUpdates(_0x598314[_0x1d8a('0x44')],null))[_0x1d8a('0x25')](respondWithResult(_0x5c0c9e,null))['catch'](handleError(_0x5c0c9e,null));};exports['destroy']=function(_0x557bde,_0x57ef7f){return db[_0x1d8a('0x2b')][_0x1d8a('0x45')]({'where':{'id':_0x557bde[_0x1d8a('0x41')]['id']}})[_0x1d8a('0x25')](handleEntityNotFound(_0x57ef7f,null))[_0x1d8a('0x25')](removeEntity(_0x57ef7f,null))[_0x1d8a('0x3f')](handleError(_0x57ef7f,null));};exports[_0x1d8a('0x46')]=function(_0x46a88e,_0x2d8404){return db[_0x1d8a('0x2b')]['describe']()['then'](respondWithResult(_0x2d8404,null))[_0x1d8a('0x3f')](handleError(_0x2d8404,null));}; \ No newline at end of file +var _0x5bba=['pick','filter','where','VIRTUAL','merge','options','VoiceTransferReport','includeAll','include','rows','catch','show','params','create','body','update','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','end','stack','name','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort'];(function(_0x737a1f,_0x235fef){var _0x16eba1=function(_0x292aa8){while(--_0x292aa8){_0x737a1f['push'](_0x737a1f['shift']());}};_0x16eba1(++_0x235fef);}(_0x5bba,0x1d4));var _0xa5bb=function(_0x340199,_0x1028b0){_0x340199=_0x340199-0x0;var _0x40c7cc=_0x5bba[_0x340199];return _0x40c7cc;};'use strict';var emlformat=require(_0xa5bb('0x0'));var rimraf=require(_0xa5bb('0x1'));var zipdir=require(_0xa5bb('0x2'));var jsonpatch=require(_0xa5bb('0x3'));var rp=require(_0xa5bb('0x4'));var moment=require('moment');var BPromise=require(_0xa5bb('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xa5bb('0x6'));var csv=require('to-csv');var ejs=require(_0xa5bb('0x7'));var fs=require('fs');var fs_extra=require(_0xa5bb('0x8'));var _=require(_0xa5bb('0x9'));var squel=require(_0xa5bb('0xa'));var crypto=require(_0xa5bb('0xb'));var jsforce=require(_0xa5bb('0xc'));var deskjs=require(_0xa5bb('0xd'));var toCsv=require(_0xa5bb('0xe'));var querystring=require(_0xa5bb('0xf'));var Papa=require(_0xa5bb('0x10'));var Redis=require(_0xa5bb('0x11'));var authService=require(_0xa5bb('0x12'));var qs=require(_0xa5bb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa5bb('0x14'))(_0xa5bb('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xa5bb('0x16'));var db=require(_0xa5bb('0x17'))['db'];function respondWithStatusCode(_0x1daf07,_0x4f8986){_0x4f8986=_0x4f8986||0xcc;return function(_0x53600e){if(_0x53600e){return _0x1daf07[_0xa5bb('0x18')](_0x4f8986);}return _0x1daf07[_0xa5bb('0x19')](_0x4f8986)['end']();};}function respondWithResult(_0x47bfc6,_0x505c22){_0x505c22=_0x505c22||0xc8;return function(_0x1faa31){if(_0x1faa31){return _0x47bfc6[_0xa5bb('0x19')](_0x505c22)[_0xa5bb('0x1a')](_0x1faa31);}};}function respondWithFilteredResult(_0x3dfaef,_0x376355){return function(_0x4cc8bb){if(_0x4cc8bb){var _0x13693e=typeof _0x376355[_0xa5bb('0x1b')]===_0xa5bb('0x1c')&&typeof _0x376355[_0xa5bb('0x1d')]==='undefined';var _0x35267b=_0x4cc8bb[_0xa5bb('0x1e')];var _0x509190=_0x13693e?0x0:_0x376355[_0xa5bb('0x1b')];var _0xa273e1=_0x13693e?_0x4cc8bb[_0xa5bb('0x1e')]:_0x376355['offset']+_0x376355[_0xa5bb('0x1d')];var _0x18af72;if(_0xa273e1>=_0x35267b){_0xa273e1=_0x35267b;_0x18af72=0xc8;}else{_0x18af72=0xce;}_0x3dfaef['status'](_0x18af72);return _0x3dfaef[_0xa5bb('0x1f')](_0xa5bb('0x20'),_0x509190+'-'+_0xa273e1+'/'+_0x35267b)['json'](_0x4cc8bb);}return null;};}function patchUpdates(_0x4893c7){return function(_0xd5732f){try{jsonpatch['apply'](_0xd5732f,_0x4893c7,!![]);}catch(_0x37a4e6){return BPromise[_0xa5bb('0x21')](_0x37a4e6);}return _0xd5732f[_0xa5bb('0x22')]();};}function saveUpdates(_0x32dc28,_0x2dcab9){return function(_0x4a17cb){if(_0x4a17cb){return _0x4a17cb['update'](_0x32dc28)[_0xa5bb('0x23')](function(_0x25ce13){return _0x25ce13;});}return null;};}function removeEntity(_0x400690,_0x10c22c){return function(_0x37bf1e){if(_0x37bf1e){return _0x37bf1e[_0xa5bb('0x24')]()[_0xa5bb('0x23')](function(){_0x400690[_0xa5bb('0x19')](0xcc)[_0xa5bb('0x25')]();});}};}function handleEntityNotFound(_0x250057,_0x27cf4e){return function(_0x3724cc){if(!_0x3724cc){_0x250057[_0xa5bb('0x18')](0x194);}return _0x3724cc;};}function handleError(_0x5e334e,_0x3e777f){_0x3e777f=_0x3e777f||0x1f4;return function(_0x5e170a){logger['error'](_0x5e170a[_0xa5bb('0x26')]);if(_0x5e170a['name']){delete _0x5e170a[_0xa5bb('0x27')];}_0x5e334e[_0xa5bb('0x19')](_0x3e777f)['send'](_0x5e170a);};}exports[_0xa5bb('0x28')]=function(_0x126fdb,_0x2f546f){var _0x5d450a={},_0x317311={},_0x124aa8={'count':0x0,'rows':[]};var _0x41003b=_[_0xa5bb('0x29')](db['VoiceTransferReport'][_0xa5bb('0x2a')],function(_0x53edf4){return{'name':_0x53edf4[_0xa5bb('0x2b')],'type':_0x53edf4[_0xa5bb('0x2c')][_0xa5bb('0x2d')]};});_0x317311['model']=_['map'](_0x41003b,_0xa5bb('0x27'));_0x317311[_0xa5bb('0x2e')]=_[_0xa5bb('0x2f')](_0x126fdb[_0xa5bb('0x2e')]);_0x317311[_0xa5bb('0x30')]=_[_0xa5bb('0x31')](_0x317311[_0xa5bb('0x32')],_0x317311[_0xa5bb('0x2e')]);_0x5d450a[_0xa5bb('0x33')]=_[_0xa5bb('0x31')](_0x317311[_0xa5bb('0x32')],qs[_0xa5bb('0x34')](_0x126fdb[_0xa5bb('0x2e')][_0xa5bb('0x34')]));_0x5d450a[_0xa5bb('0x33')]=_0x5d450a[_0xa5bb('0x33')][_0xa5bb('0x35')]?_0x5d450a[_0xa5bb('0x33')]:_0x317311['model'];if(!_0x126fdb[_0xa5bb('0x2e')][_0xa5bb('0x36')]('nolimit')){_0x5d450a[_0xa5bb('0x1d')]=qs[_0xa5bb('0x1d')](_0x126fdb[_0xa5bb('0x2e')]['limit']);_0x5d450a['offset']=qs[_0xa5bb('0x1b')](_0x126fdb[_0xa5bb('0x2e')][_0xa5bb('0x1b')]);}_0x5d450a[_0xa5bb('0x37')]=qs[_0xa5bb('0x38')](_0x126fdb[_0xa5bb('0x2e')][_0xa5bb('0x38')]);_0x5d450a['where']=qs[_0xa5bb('0x30')](_[_0xa5bb('0x39')](_0x126fdb[_0xa5bb('0x2e')],_0x317311['filters']),_0x41003b);if(_0x126fdb[_0xa5bb('0x2e')][_0xa5bb('0x3a')]){_0x5d450a[_0xa5bb('0x3b')]=_['merge'](_0x5d450a[_0xa5bb('0x3b')],{'$or':_[_0xa5bb('0x29')](_0x41003b,function(_0x3974eb){if(_0x3974eb['type']!==_0xa5bb('0x3c')){var _0x9a05b2={};_0x9a05b2[_0x3974eb['name']]={'$like':'%'+_0x126fdb[_0xa5bb('0x2e')][_0xa5bb('0x3a')]+'%'};return _0x9a05b2;}})});}_0x5d450a=_[_0xa5bb('0x3d')]({},_0x5d450a,_0x126fdb[_0xa5bb('0x3e')]);var _0x1ca7d4={'where':_0x5d450a[_0xa5bb('0x3b')]};return db[_0xa5bb('0x3f')][_0xa5bb('0x1e')](_0x1ca7d4)['then'](function(_0xea9a24){_0x124aa8[_0xa5bb('0x1e')]=_0xea9a24;if(_0x126fdb[_0xa5bb('0x2e')][_0xa5bb('0x40')]){_0x5d450a[_0xa5bb('0x41')]=[{'all':!![]}];}return db[_0xa5bb('0x3f')]['findAll'](_0x5d450a);})['then'](function(_0x51c53e){_0x124aa8[_0xa5bb('0x42')]=_0x51c53e;return _0x124aa8;})[_0xa5bb('0x23')](respondWithFilteredResult(_0x2f546f,_0x5d450a))[_0xa5bb('0x43')](handleError(_0x2f546f,null));};exports[_0xa5bb('0x44')]=function(_0x5fd942,_0x152ab5){var _0xf9e077={'raw':!![],'where':{'id':_0x5fd942[_0xa5bb('0x45')]['id']}},_0xef0f5f={};_0xef0f5f[_0xa5bb('0x32')]=_[_0xa5bb('0x2f')](db[_0xa5bb('0x3f')][_0xa5bb('0x2a')]);_0xef0f5f[_0xa5bb('0x2e')]=_[_0xa5bb('0x2f')](_0x5fd942[_0xa5bb('0x2e')]);_0xef0f5f[_0xa5bb('0x30')]=_[_0xa5bb('0x31')](_0xef0f5f[_0xa5bb('0x32')],_0xef0f5f[_0xa5bb('0x2e')]);_0xf9e077[_0xa5bb('0x33')]=_['intersection'](_0xef0f5f[_0xa5bb('0x32')],qs[_0xa5bb('0x34')](_0x5fd942[_0xa5bb('0x2e')]['fields']));_0xf9e077[_0xa5bb('0x33')]=_0xf9e077['attributes'][_0xa5bb('0x35')]?_0xf9e077[_0xa5bb('0x33')]:_0xef0f5f['model'];if(_0x5fd942[_0xa5bb('0x2e')][_0xa5bb('0x40')]){_0xf9e077['include']=[{'all':!![]}];}_0xf9e077=_['merge']({},_0xf9e077,_0x5fd942[_0xa5bb('0x3e')]);return db[_0xa5bb('0x3f')]['find'](_0xf9e077)[_0xa5bb('0x23')](handleEntityNotFound(_0x152ab5,null))['then'](respondWithResult(_0x152ab5,null))[_0xa5bb('0x43')](handleError(_0x152ab5,null));};exports[_0xa5bb('0x46')]=function(_0x402c05,_0x319064){return db[_0xa5bb('0x3f')][_0xa5bb('0x46')](_0x402c05[_0xa5bb('0x47')],{})[_0xa5bb('0x23')](respondWithResult(_0x319064,0xc9))[_0xa5bb('0x43')](handleError(_0x319064,null));};exports[_0xa5bb('0x48')]=function(_0x1e3f5e,_0x59b5a5){if(_0x1e3f5e['body']['id']){delete _0x1e3f5e[_0xa5bb('0x47')]['id'];}return db[_0xa5bb('0x3f')][_0xa5bb('0x49')]({'where':{'id':_0x1e3f5e[_0xa5bb('0x45')]['id']}})[_0xa5bb('0x23')](handleEntityNotFound(_0x59b5a5,null))['then'](saveUpdates(_0x1e3f5e[_0xa5bb('0x47')],null))[_0xa5bb('0x23')](respondWithResult(_0x59b5a5,null))['catch'](handleError(_0x59b5a5,null));};exports['destroy']=function(_0x1499cd,_0x3a588){return db[_0xa5bb('0x3f')][_0xa5bb('0x49')]({'where':{'id':_0x1499cd[_0xa5bb('0x45')]['id']}})[_0xa5bb('0x23')](handleEntityNotFound(_0x3a588,null))[_0xa5bb('0x23')](removeEntity(_0x3a588,null))[_0xa5bb('0x43')](handleError(_0x3a588,null));};exports[_0xa5bb('0x4a')]=function(_0x46a811,_0x3aadf3){return db[_0xa5bb('0x3f')][_0xa5bb('0x4a')]()[_0xa5bb('0x23')](respondWithResult(_0x3aadf3,null))[_0xa5bb('0x43')](handleError(_0x3aadf3,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index d6ff413..1dc6e7f 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 _0x7e97=['bluebird','request-promise','path','rimraf','../../config/environment','./voiceTransferReport.attributes','exports','define','VoiceTransferReport','report_call_transfer','lodash','../../config/logger','api','moment'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x7e97,0x1e6));var _0x77e9=function(_0x4dd540,_0x43e734){_0x4dd540=_0x4dd540-0x0;var _0x961ce3=_0x7e97[_0x4dd540];return _0x961ce3;};'use strict';var _=require(_0x77e9('0x0'));var util=require('util');var logger=require(_0x77e9('0x1'))(_0x77e9('0x2'));var moment=require(_0x77e9('0x3'));var BPromise=require(_0x77e9('0x4'));var rp=require(_0x77e9('0x5'));var fs=require('fs');var path=require(_0x77e9('0x6'));var rimraf=require(_0x77e9('0x7'));var config=require(_0x77e9('0x8'));var attributes=require(_0x77e9('0x9'));module[_0x77e9('0xa')]=function(_0x335796,_0x5f448a){return _0x335796[_0x77e9('0xb')](_0x77e9('0xc'),attributes,{'tableName':_0x77e9('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa781=['bluebird','path','../../config/environment','exports','VoiceTransferReport','report_call_transfer','lodash','util','../../config/logger','api','moment'];(function(_0x159846,_0x4c0673){var _0x55f12b=function(_0x1f500e){while(--_0x1f500e){_0x159846['push'](_0x159846['shift']());}};_0x55f12b(++_0x4c0673);}(_0xa781,0x1b3));var _0x1a78=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa781[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1a78('0x0'));var util=require(_0x1a78('0x1'));var logger=require(_0x1a78('0x2'))(_0x1a78('0x3'));var moment=require(_0x1a78('0x4'));var BPromise=require(_0x1a78('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1a78('0x6'));var rimraf=require('rimraf');var config=require(_0x1a78('0x7'));var attributes=require('./voiceTransferReport.attributes');module[_0x1a78('0x8')]=function(_0xb6dd0,_0x28b9c4){return _0xb6dd0['define'](_0x1a78('0x9'),attributes,{'tableName':_0x1a78('0xa'),'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 e6ca28f..f439582 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 _0x8b7c=['request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','error','VoiceTransferReport,\x20%s,\x20%s','message','info','result','catch','VoiceTransferReport','create','body','options','CreateVoiceTransferReport','stringify','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then'];(function(_0x4aac5a,_0x15b04c){var _0x42e7bc=function(_0x1da766){while(--_0x1da766){_0x4aac5a['push'](_0x4aac5a['shift']());}};_0x42e7bc(++_0x15b04c);}(_0x8b7c,0x153));var _0xc8b7=function(_0x50c00a,_0x2afdb8){_0x50c00a=_0x50c00a-0x0;var _0x37e299=_0x8b7c[_0x50c00a];return _0x37e299;};'use strict';var _=require(_0xc8b7('0x0'));var util=require('util');var moment=require(_0xc8b7('0x1'));var BPromise=require(_0xc8b7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc8b7('0x3'));var db=require(_0xc8b7('0x4'))['db'];var utils=require(_0xc8b7('0x5'));var logger=require(_0xc8b7('0x6'))('rpc');var config=require(_0xc8b7('0x7'));var jayson=require(_0xc8b7('0x8'));var client=jayson[_0xc8b7('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4586ec,_0x437fc1,_0x14b7ff){return new BPromise(function(_0x244dea,_0x5f1ad5){return client[_0xc8b7('0xa')](_0x4586ec,_0x14b7ff)[_0xc8b7('0xb')](function(_0x445a8c){logger['info']('VoiceTransferReport,\x20%s,\x20%s',_0x437fc1,_0xc8b7('0xc'));logger[_0xc8b7('0xd')](_0xc8b7('0xe'),_0x437fc1,_0xc8b7('0xc'),JSON['stringify'](_0x445a8c));if(_0x445a8c[_0xc8b7('0xf')]){if(_0x445a8c[_0xc8b7('0xf')]['code']===0x1f4){logger[_0xc8b7('0xf')](_0xc8b7('0x10'),_0x437fc1,_0x445a8c['error'][_0xc8b7('0x11')]);return _0x5f1ad5(_0x445a8c['error'][_0xc8b7('0x11')]);}logger[_0xc8b7('0xf')]('VoiceTransferReport,\x20%s,\x20%s',_0x437fc1,_0x445a8c[_0xc8b7('0xf')][_0xc8b7('0x11')]);return _0x244dea(_0x445a8c['error'][_0xc8b7('0x11')]);}else{logger[_0xc8b7('0x12')](_0xc8b7('0x10'),_0x437fc1,'request\x20sent');_0x244dea(_0x445a8c[_0xc8b7('0x13')]['message']);}})[_0xc8b7('0x14')](function(_0x20c1a7){logger[_0xc8b7('0xf')](_0xc8b7('0x10'),_0x437fc1,_0x20c1a7);_0x5f1ad5(_0x20c1a7);});});}exports['CreateVoiceTransferReport']=function(_0x15d2db){var _0x1f9b85=this;return new Promise(function(_0x516fd3,_0x4618b4){return db[_0xc8b7('0x15')][_0xc8b7('0x16')](_0x15d2db[_0xc8b7('0x17')],{'raw':_0x15d2db[_0xc8b7('0x18')]?_0x15d2db[_0xc8b7('0x18')]['raw']===undefined?!![]:![]:!![]})[_0xc8b7('0xb')](function(_0x33f39c){logger[_0xc8b7('0x12')](_0xc8b7('0x19'),_0x15d2db);logger['debug'](_0xc8b7('0x19'),_0x15d2db,JSON[_0xc8b7('0x1a')](_0x33f39c));_0x516fd3(_0x33f39c);})[_0xc8b7('0x14')](function(_0x3f0662){logger['error'](_0xc8b7('0x19'),_0x3f0662['message'],_0x15d2db);_0x4618b4(_0x1f9b85[_0xc8b7('0xf')](0x1f4,_0x3f0662[_0xc8b7('0x11')]));});});}; \ No newline at end of file +var _0xfe8f=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','http','request','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','raw','then','lodash','util','moment','bluebird'];(function(_0x241424,_0x25eb5d){var _0x3da798=function(_0x415153){while(--_0x415153){_0x241424['push'](_0x241424['shift']());}};_0x3da798(++_0x25eb5d);}(_0xfe8f,0x11e));var _0xffe8=function(_0x5b5b05,_0x1c52b6){_0x5b5b05=_0x5b5b05-0x0;var _0x31363d=_0xfe8f[_0x5b5b05];return _0x31363d;};'use strict';var _=require(_0xffe8('0x0'));var util=require(_0xffe8('0x1'));var moment=require(_0xffe8('0x2'));var BPromise=require(_0xffe8('0x3'));var rs=require(_0xffe8('0x4'));var fs=require('fs');var Redis=require(_0xffe8('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xffe8('0x6'));var logger=require(_0xffe8('0x7'))(_0xffe8('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xffe8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1b03ae,_0x17fcdb,_0x37bc41){return new BPromise(function(_0x1b99f4,_0x3719fe){return client[_0xffe8('0xa')](_0x1b03ae,_0x37bc41)['then'](function(_0x523076){logger['info'](_0xffe8('0xb'),_0x17fcdb,_0xffe8('0xc'));logger[_0xffe8('0xd')](_0xffe8('0xe'),_0x17fcdb,_0xffe8('0xc'),JSON[_0xffe8('0xf')](_0x523076));if(_0x523076[_0xffe8('0x10')]){if(_0x523076[_0xffe8('0x10')][_0xffe8('0x11')]===0x1f4){logger[_0xffe8('0x10')]('VoiceTransferReport,\x20%s,\x20%s',_0x17fcdb,_0x523076[_0xffe8('0x10')][_0xffe8('0x12')]);return _0x3719fe(_0x523076[_0xffe8('0x10')][_0xffe8('0x12')]);}logger['error'](_0xffe8('0xb'),_0x17fcdb,_0x523076[_0xffe8('0x10')][_0xffe8('0x12')]);return _0x1b99f4(_0x523076[_0xffe8('0x10')][_0xffe8('0x12')]);}else{logger[_0xffe8('0x13')](_0xffe8('0xb'),_0x17fcdb,'request\x20sent');_0x1b99f4(_0x523076[_0xffe8('0x14')][_0xffe8('0x12')]);}})[_0xffe8('0x15')](function(_0x4f1e14){logger[_0xffe8('0x10')](_0xffe8('0xb'),_0x17fcdb,_0x4f1e14);_0x3719fe(_0x4f1e14);});});}exports[_0xffe8('0x16')]=function(_0x2510c8){var _0x5cb7a4=this;return new Promise(function(_0xbef534,_0x3daab7){return db[_0xffe8('0x17')][_0xffe8('0x18')](_0x2510c8[_0xffe8('0x19')],{'raw':_0x2510c8[_0xffe8('0x1a')]?_0x2510c8['options'][_0xffe8('0x1b')]===undefined?!![]:![]:!![]})[_0xffe8('0x1c')](function(_0x200988){logger['info'](_0xffe8('0x16'),_0x2510c8);logger[_0xffe8('0xd')](_0xffe8('0x16'),_0x2510c8,JSON['stringify'](_0x200988));_0xbef534(_0x200988);})[_0xffe8('0x15')](function(_0x22b219){logger[_0xffe8('0x10')](_0xffe8('0x16'),_0x22b219[_0xffe8('0x12')],_0x2510c8);_0x3daab7(_0x5cb7a4[_0xffe8('0x10')](0x1f4,_0x22b219[_0xffe8('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index c88847e..7041099 100644 --- a/server/api/webbar/index.js +++ b/server/api/webbar/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x00bb=['answer','hold','/unhold','unhold','calls','/transfer','exports','express','Router','../../components/auth/service','post','isAuthenticated','isWebrtcLicence','/hangup','/answer'];(function(_0x1cad51,_0x27ff4d){var _0x2ef33e=function(_0x48cfd6){while(--_0x48cfd6){_0x1cad51['push'](_0x1cad51['shift']());}};_0x2ef33e(++_0x27ff4d);}(_0x00bb,0x1d8));var _0xb00b=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x00bb[_0xa1e3e3];return _0xc980e9;};'use strict';var express=require(_0xb00b('0x0'));var router=express[_0xb00b('0x1')]();var auth=require(_0xb00b('0x2'));var controller=require('./webbar.controller');router[_0xb00b('0x3')]('/originate',auth[_0xb00b('0x4')](),auth[_0xb00b('0x5')](),controller['originate']);router[_0xb00b('0x3')](_0xb00b('0x6'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller['hangup']);router[_0xb00b('0x3')](_0xb00b('0x7'),auth[_0xb00b('0x4')](),auth[_0xb00b('0x5')](),controller[_0xb00b('0x8')]);router[_0xb00b('0x3')]('/hold',auth['isAuthenticated'](),auth[_0xb00b('0x5')](),controller[_0xb00b('0x9')]);router[_0xb00b('0x3')](_0xb00b('0xa'),auth[_0xb00b('0x4')](),auth['isWebrtcLicence'](),controller[_0xb00b('0xb')]);router['post']('/calls',auth['isAuthenticated'](),auth[_0xb00b('0x5')](),controller[_0xb00b('0xc')]);router[_0xb00b('0x3')](_0xb00b('0xd'),auth[_0xb00b('0x4')](),auth[_0xb00b('0x5')](),controller['transfer']);module[_0xb00b('0xe')]=router; \ No newline at end of file +var _0x70e0=['unhold','/calls','calls','/transfer','transfer','express','Router','../../components/auth/service','/originate','isAuthenticated','isWebrtcLicence','originate','/hangup','answer','post','/hold','/unhold'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0x70e0,0x17b));var _0x070e=function(_0x448615,_0x4b48f7){_0x448615=_0x448615-0x0;var _0x271bc1=_0x70e0[_0x448615];return _0x271bc1;};'use strict';var express=require(_0x070e('0x0'));var router=express[_0x070e('0x1')]();var auth=require(_0x070e('0x2'));var controller=require('./webbar.controller');router['post'](_0x070e('0x3'),auth[_0x070e('0x4')](),auth[_0x070e('0x5')](),controller[_0x070e('0x6')]);router['post'](_0x070e('0x7'),auth['isAuthenticated'](),auth[_0x070e('0x5')](),controller['hangup']);router['post']('/answer',auth[_0x070e('0x4')](),auth[_0x070e('0x5')](),controller[_0x070e('0x8')]);router[_0x070e('0x9')](_0x070e('0xa'),auth[_0x070e('0x4')](),auth[_0x070e('0x5')](),controller['hold']);router['post'](_0x070e('0xb'),auth[_0x070e('0x4')](),auth[_0x070e('0x5')](),controller[_0x070e('0xc')]);router[_0x070e('0x9')](_0x070e('0xd'),auth[_0x070e('0x4')](),auth[_0x070e('0x5')](),controller[_0x070e('0xe')]);router[_0x070e('0x9')](_0x070e('0xf'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller[_0x070e('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index 7208312..c9d201d 100644 --- a/server/api/webbar/webbar.controller.js +++ b/server/api/webbar/webbar.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x663a=['conference\x20fired:','webbar:conference','transfer\x20fired:','transferNumber','transfer\x20executed!','path','lodash','../../mysqldb','../../config/environment','jayson/promise','ioredis','defaults','socket.io-emitter','validate','number','userId\x20is\x20required','string','callNumber\x20is\x20required','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','emit','log','handleError:','error','stack','name','send','NotFound','then','code','catch','User','findOne','agent','VoiceChannels','all','filter','rows','UserId','sessionId','length','\x20not\x20found!','originate','originate\x20fired:','body','status','userId','callerId','callbackUrl','entityFound:','format','user:%s','webbar:originate','json','hangup','hangup\x20fired:','webbar:hangup','answer','answer\x20fired:','webbar:answer','answer\x20executed!','hold','hold\x20fired:','unhold','webbar:unhold','unhold\x20executed!','calls\x20fired:','conference'];(function(_0x29670b,_0x491833){var _0x3b27bb=function(_0x5156ad){while(--_0x5156ad){_0x29670b['push'](_0x29670b['shift']());}};_0x3b27bb(++_0x491833);}(_0x663a,0x119));var _0xa663=function(_0x29030d,_0x1f9bfa){_0x29030d=_0x29030d-0x0;var _0x267652=_0x663a[_0x29030d];return _0x267652;};'use strict';var path=require(_0xa663('0x0'));var fs=require('fs');var _=require(_0xa663('0x1'));var db=require(_0xa663('0x2'))['db'];var config=require(_0xa663('0x3'));var util=require('util');var BPromise=require('bluebird');var jayson=require(_0xa663('0x4'));var amiClient=jayson['client']['http']({'port':0x232a});var logger=require('../../config/logger')('webbarapi');var Redis=require(_0xa663('0x5'));config['redis']=_[_0xa663('0x6')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xa663('0x7'))(new Redis(config['redis']));var Schema=require(_0xa663('0x8'));var originateValidation=new Schema({'userId':{'type':_0xa663('0x9'),'required':[!![],_0xa663('0xa')]},'callNumber':{'type':_0xa663('0xb'),'required':[!![],_0xa663('0xc')]},'callerId':{'type':_0xa663('0xb')},'callbackUrl':{'type':'string'}});var hangupValidation=new Schema({'userId':{'type':_0xa663('0x9'),'required':[!![],_0xa663('0xa')]},'sessionId':{'type':'string','required':![]}});var answerValidation=new Schema({'userId':{'type':_0xa663('0x9'),'required':[!![],_0xa663('0xa')]},'sessionId':{'type':_0xa663('0xb'),'required':![]}});var transferValidation=new Schema({'userId':{'type':'number','required':[!![],_0xa663('0xa')]},'sessionId':{'type':'string','required':[!![],_0xa663('0xd')]},'transferNumber':{'type':_0xa663('0xb'),'required':[!![],_0xa663('0xe')]}});var holdValidation=new Schema({'userId':{'type':_0xa663('0x9'),'required':[!![],_0xa663('0xa')]},'sessionId':{'type':_0xa663('0xb'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':'number','required':[!![],_0xa663('0xa')]},'sessionId':{'type':_0xa663('0xb'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0xa663('0x9'),'required':[!![],_0xa663('0xa')]}});var conferenceValidation=new Schema({'userId':{'type':_0xa663('0x9'),'required':[!![],'userId\x20is\x20required']}});function emit(_0x8e45d7,_0x32fac7,_0x16b531){logger[_0xa663('0xf')](_0x8e45d7,_0x32fac7,JSON['stringify'](_0x16b531));io['to'](_0x8e45d7)[_0xa663('0x10')](_0x32fac7,_0x16b531);}function handleError(_0x32722a){return function(_0x5abb3d){console[_0xa663('0x11')](_0xa663('0x12'),_0x5abb3d,_0x5abb3d instanceof RangeError);logger[_0xa663('0x13')](_0x5abb3d[_0xa663('0x14')]);if(_0x5abb3d instanceof RangeError){if(_0x5abb3d[_0xa663('0x15')]){delete _0x5abb3d[_0xa663('0x15')];}_0x32722a['status'](0x194)[_0xa663('0x16')](_0x5abb3d);}else{if(_0x5abb3d[_0xa663('0x15')]){delete _0x5abb3d[_0xa663('0x15')];}_0x32722a['status'](0x1f4)[_0xa663('0x16')](_0x5abb3d);}};}function checkError(){return function(_0x5d17e6){if(!_0x5d17e6){throw new RangeError(_0xa663('0x17'));}return _0x5d17e6;};}function respondWithRpcPromise(_0x3b7593,_0x2aeddd){return new BPromise(function(_0x34d63c,_0x1abd78){var _0x4800d5=amiClient;return _0x4800d5['request'](_0x3b7593,_0x2aeddd)[_0xa663('0x18')](function(_0x5b37d9){if(_0x5b37d9[_0xa663('0x13')]){if(_0x5b37d9['error'][_0xa663('0x19')]===0x1f4){return _0x1abd78(_0x5b37d9[_0xa663('0x13')]['message']);}return _0x34d63c(_0x5b37d9[_0xa663('0x13')]['message']);}else{_0x34d63c(_0x5b37d9['result']);}})[_0xa663('0x1a')](function(_0x3f039f){_0x1abd78(_0x3f039f);});});}function getAgent(_0x26ba4e){return db[_0xa663('0x1b')][_0xa663('0x1c')]({'where':{'id':_0x26ba4e,'role':_0xa663('0x1d')}})[_0xa663('0x18')](checkError());}function getAgentCheckSession(_0x38e7da,_0x3136d7){return new BPromise(function(_0x5a7c6d,_0x2d66b8){var _0x360f26=respondWithRpcPromise(_0xa663('0x1e'));var _0x1807e5=getAgent(_0x38e7da);Promise[_0xa663('0x1f')]([_0x360f26,_0x1807e5])['then'](function(_0x500ab2){var _0x294791=_0x500ab2[0x0];var _0x26095b=_0x500ab2[0x1];var _0x18179c=_[_0xa663('0x20')](_0x294791[_0xa663('0x21')],function(_0x429260){return _0x429260[_0xa663('0x22')]==_0x26095b['id']&&_0x429260[_0xa663('0x23')]==_0x3136d7;});if(_0x18179c[_0xa663('0x24')]==0x1){_0x5a7c6d(_0x26095b);}else{_0x2d66b8(new RangeError('sessionId\x20'+_0x3136d7+_0xa663('0x25')));}});});}exports[_0xa663('0x26')]=function(_0x23163d,_0x5c81a5){logger[_0xa663('0xf')](_0xa663('0x27'),_0x23163d['body']);var _0x37bcd1=originateValidation[_0xa663('0x8')](_0x23163d[_0xa663('0x28')]);if(_0x37bcd1[_0xa663('0x24')]>0x0){return _0x5c81a5[_0xa663('0x29')](0x190)['json'](_0x37bcd1);}var _0x1ec9df=_0x23163d[_0xa663('0x28')][_0xa663('0x2a')];var _0x410077=_0x23163d[_0xa663('0x28')]['callNumber'];var _0x124b83=_0x23163d['body'][_0xa663('0x2b')];var _0x9d7145=_0x23163d['body'][_0xa663('0x2c')];return getAgent(_0x1ec9df)[_0xa663('0x18')](function(_0x548bf4){logger[_0xa663('0xf')](_0xa663('0x2d'),_0x548bf4['name']);emit(util[_0xa663('0x2e')](_0xa663('0x2f'),_0x548bf4['name']),_0xa663('0x30'),{'callNumber':_0x410077,'callerId':_0x124b83,'callbackUrl':_0x9d7145});return _0x5c81a5[_0xa663('0x29')](0xc8)[_0xa663('0x31')]({'error':![],'message':'originate\x20executed!'});})['catch'](handleError(_0x5c81a5));};exports[_0xa663('0x32')]=function(_0x153052,_0x8d8bf9){logger[_0xa663('0xf')](_0xa663('0x33'),_0x153052[_0xa663('0x28')]);var _0x22c672=hangupValidation[_0xa663('0x8')](_0x153052['body']);if(_0x22c672['length']>0x0){return _0x8d8bf9['status'](0x190)[_0xa663('0x31')](_0x22c672);}var _0x1c7abe=_0x153052[_0xa663('0x28')]['userId'];var _0x59cfa5=_0x153052['body'][_0xa663('0x23')];return getAgent(_0x1c7abe)[_0xa663('0x18')](function(_0x2c58ce){logger['info'](_0xa663('0x2d'),_0x2c58ce['name']);emit(util[_0xa663('0x2e')](_0xa663('0x2f'),_0x2c58ce[_0xa663('0x15')]),_0xa663('0x34'),{'sessionId':_0x59cfa5});return _0x8d8bf9[_0xa663('0x29')](0xc8)[_0xa663('0x31')]({'error':![],'message':'hangup\x20executed!'});})[_0xa663('0x1a')](handleError(_0x8d8bf9));};exports[_0xa663('0x35')]=function(_0x46cab2,_0xd46578){logger[_0xa663('0xf')](_0xa663('0x36'),_0x46cab2[_0xa663('0x28')]);var _0x54d6b4=answerValidation[_0xa663('0x8')](_0x46cab2[_0xa663('0x28')]);if(_0x54d6b4[_0xa663('0x24')]>0x0){return _0xd46578[_0xa663('0x29')](0x190)['json'](_0x54d6b4);}var _0x462f24=_0x46cab2[_0xa663('0x28')]['userId'];var _0x2bd889=_0x46cab2[_0xa663('0x28')][_0xa663('0x23')];return getAgent(_0x462f24)[_0xa663('0x18')](function(_0x5b3d82){logger[_0xa663('0xf')]('entityFound:',_0x5b3d82[_0xa663('0x15')]);emit(util[_0xa663('0x2e')]('user:%s',_0x5b3d82['name']),_0xa663('0x37'),{'sessionId':_0x2bd889});return _0xd46578[_0xa663('0x29')](0xc8)[_0xa663('0x31')]({'error':![],'message':_0xa663('0x38')});})[_0xa663('0x1a')](handleError(_0xd46578));};exports[_0xa663('0x39')]=function(_0x520804,_0x194605){logger[_0xa663('0xf')](_0xa663('0x3a'),_0x520804[_0xa663('0x28')]);var _0xf1163a=holdValidation[_0xa663('0x8')](_0x520804[_0xa663('0x28')]);if(_0xf1163a[_0xa663('0x24')]>0x0){return _0x194605[_0xa663('0x29')](0x190)[_0xa663('0x31')](_0xf1163a);}var _0x1b5fdd=_0x520804['body'][_0xa663('0x2a')];var _0x45c567=_0x520804[_0xa663('0x28')][_0xa663('0x23')];return getAgent(_0x1b5fdd)[_0xa663('0x18')](function(_0x5d2d0a){logger[_0xa663('0xf')](_0xa663('0x2d'),_0x5d2d0a[_0xa663('0x15')]);emit(util[_0xa663('0x2e')](_0xa663('0x2f'),_0x5d2d0a['name']),'webbar:hold',{'sessionId':_0x45c567});return _0x194605['status'](0xc8)['json']({'error':![],'message':'hold\x20executed!'});})[_0xa663('0x1a')](handleError(_0x194605));};exports[_0xa663('0x3b')]=function(_0x37857d,_0x1f0312){logger['info']('unhold\x20fired:',_0x37857d[_0xa663('0x28')]);var _0x396d6b=unholdValidation[_0xa663('0x8')](_0x37857d[_0xa663('0x28')]);if(_0x396d6b[_0xa663('0x24')]>0x0){return _0x1f0312[_0xa663('0x29')](0x190)[_0xa663('0x31')](_0x396d6b);}var _0x3ad8d0=_0x37857d[_0xa663('0x28')][_0xa663('0x2a')];var _0x1a5288=_0x37857d[_0xa663('0x28')][_0xa663('0x23')];return getAgent(_0x3ad8d0)[_0xa663('0x18')](function(_0x4f07f5){logger[_0xa663('0xf')](_0xa663('0x2d'),_0x4f07f5[_0xa663('0x15')]);emit(util[_0xa663('0x2e')]('user:%s',_0x4f07f5[_0xa663('0x15')]),_0xa663('0x3c'),{'sessionId':_0x1a5288});return _0x1f0312[_0xa663('0x29')](0xc8)['json']({'error':![],'message':_0xa663('0x3d')});})['catch'](handleError(_0x1f0312));};exports['calls']=function(_0x5346a0,_0x42d20){logger['info'](_0xa663('0x3e'),_0x42d20[_0xa663('0x28')]);var _0x2a8b91=callsValidation[_0xa663('0x8')](_0x5346a0[_0xa663('0x28')]);if(_0x2a8b91[_0xa663('0x24')]>0x0){return _0x42d20[_0xa663('0x29')](0x190)[_0xa663('0x31')](_0x2a8b91);}var _0xa4052=_0x5346a0[_0xa663('0x28')][_0xa663('0x2a')];var _0x10c424=respondWithRpcPromise(_0xa663('0x1e'));var _0x4e3a58=getAgent(_0xa4052);return Promise[_0xa663('0x1f')]([_0x10c424,_0x4e3a58])[_0xa663('0x18')](function(_0x5848c5){var _0x54b50c=_0x5848c5[0x0];var _0x3ba5b5=_0x5848c5[0x1];var _0x2944b1=_['filter'](_0x54b50c[_0xa663('0x21')],function(_0x498b81){return _0x498b81[_0xa663('0x22')]==_0x3ba5b5['id'];});return _0x42d20[_0xa663('0x29')](0xc8)[_0xa663('0x31')]({'count':_0x2944b1[_0xa663('0x24')],'rows':_0x2944b1});})[_0xa663('0x1a')](handleError(_0x42d20));};exports[_0xa663('0x3f')]=function(_0x3cd87d,_0x5824f3){logger[_0xa663('0xf')](_0xa663('0x40'),_0x3cd87d[_0xa663('0x28')]);var _0x365617=conferenceValidation[_0xa663('0x8')](_0x3cd87d[_0xa663('0x28')]);if(_0x365617[_0xa663('0x24')]>0x0){return _0x5824f3[_0xa663('0x29')](0x190)[_0xa663('0x31')](_0x365617);}var _0x3ebdd5=_0x3cd87d[_0xa663('0x28')][_0xa663('0x2a')];return getAgent(_0x3ebdd5)[_0xa663('0x18')](function(_0x29b88b){logger[_0xa663('0xf')](_0xa663('0x2d'),_0x29b88b[_0xa663('0x15')]);emit(util[_0xa663('0x2e')](_0xa663('0x2f'),_0x29b88b[_0xa663('0x15')]),_0xa663('0x41'));return _0x5824f3[_0xa663('0x29')](0xc8)[_0xa663('0x31')]({'error':![],'message':'conference\x20executed!'});})[_0xa663('0x1a')](handleError(_0x5824f3));};exports['transfer']=function(_0x379c3b,_0x759696){logger[_0xa663('0xf')](_0xa663('0x42'),_0x379c3b['body']);var _0x2d7311=transferValidation[_0xa663('0x8')](_0x379c3b[_0xa663('0x28')]);if(_0x2d7311[_0xa663('0x24')]>0x0){return _0x759696['status'](0x190)[_0xa663('0x31')](_0x2d7311);}var _0x18ef31=_0x379c3b[_0xa663('0x28')]['userId'];var _0x831574=_0x379c3b['body'][_0xa663('0x23')];var _0x150c91=_0x379c3b[_0xa663('0x28')][_0xa663('0x43')];return getAgent(_0x18ef31)['then'](function(_0x1783c7){logger['info']('entityFound:',_0x1783c7[_0xa663('0x15')]);emit(util['format']('user:%s',_0x1783c7[_0xa663('0x15')]),'webbar:transfer',{'sessionId':_0x831574,'transferNumber':_0x150c91});return _0x759696[_0xa663('0x29')](0xc8)['json']({'error':![],'message':_0xa663('0x44')});})[_0xa663('0x1a')](handleError(_0x759696));}; \ No newline at end of file +var _0x2e3e=['error','name','status','send','NotFound','request','then','code','message','result','catch','findOne','agent','all','rows','UserId','sessionId','length','sessionId\x20','\x20not\x20found!','body','json','userId','callNumber','callerId','callbackUrl','entityFound:','format','user:%s','originate\x20executed!','hangup','hangup\x20fired:','webbar:hangup','hangup\x20executed!','webbar:answer','answer\x20executed!','hold','hold\x20fired:','webbar:hold','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','filter','conference\x20fired:','webbar:conference','conference\x20executed!','transfer','transfer\x20fired:','transferNumber','transfer\x20executed!','path','lodash','../../config/environment','util','bluebird','jayson/promise','client','http','../../config/logger','ioredis','redis','defaults','localhost','socket.io-emitter','validate','number','string','callNumber\x20is\x20required','userId\x20is\x20required','sessionId\x20is\x20required','info','stringify','log','handleError:'];(function(_0x16ff0e,_0x4e7dc6){var _0x95bd68=function(_0x2b39ba){while(--_0x2b39ba){_0x16ff0e['push'](_0x16ff0e['shift']());}};_0x95bd68(++_0x4e7dc6);}(_0x2e3e,0x1b0));var _0xe2e3=function(_0x5b1aa0,_0xed786a){_0x5b1aa0=_0x5b1aa0-0x0;var _0x111084=_0x2e3e[_0x5b1aa0];return _0x111084;};'use strict';var path=require(_0xe2e3('0x0'));var fs=require('fs');var _=require(_0xe2e3('0x1'));var db=require('../../mysqldb')['db'];var config=require(_0xe2e3('0x2'));var util=require(_0xe2e3('0x3'));var BPromise=require(_0xe2e3('0x4'));var jayson=require(_0xe2e3('0x5'));var amiClient=jayson[_0xe2e3('0x6')][_0xe2e3('0x7')]({'port':0x232a});var logger=require(_0xe2e3('0x8'))('webbarapi');var Redis=require(_0xe2e3('0x9'));config[_0xe2e3('0xa')]=_[_0xe2e3('0xb')](config['redis'],{'host':_0xe2e3('0xc'),'port':0x18eb});var io=require(_0xe2e3('0xd'))(new Redis(config[_0xe2e3('0xa')]));var Schema=require(_0xe2e3('0xe'));var originateValidation=new Schema({'userId':{'type':_0xe2e3('0xf'),'required':[!![],'userId\x20is\x20required']},'callNumber':{'type':_0xe2e3('0x10'),'required':[!![],_0xe2e3('0x11')]},'callerId':{'type':_0xe2e3('0x10')},'callbackUrl':{'type':'string'}});var hangupValidation=new Schema({'userId':{'type':_0xe2e3('0xf'),'required':[!![],_0xe2e3('0x12')]},'sessionId':{'type':_0xe2e3('0x10'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0xe2e3('0xf'),'required':[!![],_0xe2e3('0x12')]},'sessionId':{'type':_0xe2e3('0x10'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0xe2e3('0xf'),'required':[!![],_0xe2e3('0x12')]},'sessionId':{'type':_0xe2e3('0x10'),'required':[!![],_0xe2e3('0x13')]},'transferNumber':{'type':'string','required':[!![],'transferNumber\x20is\x20required']}});var holdValidation=new Schema({'userId':{'type':_0xe2e3('0xf'),'required':[!![],_0xe2e3('0x12')]},'sessionId':{'type':_0xe2e3('0x10'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xe2e3('0xf'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xe2e3('0x10'),'required':![]}});var callsValidation=new Schema({'userId':{'type':'number','required':[!![],_0xe2e3('0x12')]}});var conferenceValidation=new Schema({'userId':{'type':_0xe2e3('0xf'),'required':[!![],_0xe2e3('0x12')]}});function emit(_0x54a830,_0x31dd25,_0x2e40a3){logger[_0xe2e3('0x14')](_0x54a830,_0x31dd25,JSON[_0xe2e3('0x15')](_0x2e40a3));io['to'](_0x54a830)['emit'](_0x31dd25,_0x2e40a3);}function handleError(_0x5904af){return function(_0x51d87d){console[_0xe2e3('0x16')](_0xe2e3('0x17'),_0x51d87d,_0x51d87d instanceof RangeError);logger[_0xe2e3('0x18')](_0x51d87d['stack']);if(_0x51d87d instanceof RangeError){if(_0x51d87d[_0xe2e3('0x19')]){delete _0x51d87d[_0xe2e3('0x19')];}_0x5904af[_0xe2e3('0x1a')](0x194)[_0xe2e3('0x1b')](_0x51d87d);}else{if(_0x51d87d[_0xe2e3('0x19')]){delete _0x51d87d[_0xe2e3('0x19')];}_0x5904af[_0xe2e3('0x1a')](0x1f4)[_0xe2e3('0x1b')](_0x51d87d);}};}function checkError(){return function(_0x242ace){if(!_0x242ace){throw new RangeError(_0xe2e3('0x1c'));}return _0x242ace;};}function respondWithRpcPromise(_0x261e9f,_0x976fb3){return new BPromise(function(_0x266d05,_0x412483){var _0x451f84=amiClient;return _0x451f84[_0xe2e3('0x1d')](_0x261e9f,_0x976fb3)[_0xe2e3('0x1e')](function(_0x104342){if(_0x104342['error']){if(_0x104342[_0xe2e3('0x18')][_0xe2e3('0x1f')]===0x1f4){return _0x412483(_0x104342[_0xe2e3('0x18')][_0xe2e3('0x20')]);}return _0x266d05(_0x104342[_0xe2e3('0x18')][_0xe2e3('0x20')]);}else{_0x266d05(_0x104342[_0xe2e3('0x21')]);}})[_0xe2e3('0x22')](function(_0x112ec3){_0x412483(_0x112ec3);});});}function getAgent(_0x1966f1){return db['User'][_0xe2e3('0x23')]({'where':{'id':_0x1966f1,'role':_0xe2e3('0x24')}})[_0xe2e3('0x1e')](checkError());}function getAgentCheckSession(_0x4736a5,_0x2d0a5c){return new BPromise(function(_0x147ca5,_0x7c77a2){var _0x2979fe=respondWithRpcPromise('VoiceChannels');var _0x1bbb5e=getAgent(_0x4736a5);Promise[_0xe2e3('0x25')]([_0x2979fe,_0x1bbb5e])[_0xe2e3('0x1e')](function(_0x578bd8){var _0x14fa29=_0x578bd8[0x0];var _0x12cca4=_0x578bd8[0x1];var _0x5076a6=_['filter'](_0x14fa29[_0xe2e3('0x26')],function(_0x45e2db){return _0x45e2db[_0xe2e3('0x27')]==_0x12cca4['id']&&_0x45e2db[_0xe2e3('0x28')]==_0x2d0a5c;});if(_0x5076a6[_0xe2e3('0x29')]==0x1){_0x147ca5(_0x12cca4);}else{_0x7c77a2(new RangeError(_0xe2e3('0x2a')+_0x2d0a5c+_0xe2e3('0x2b')));}});});}exports['originate']=function(_0x56e6e8,_0x67a9e3){logger['info']('originate\x20fired:',_0x56e6e8[_0xe2e3('0x2c')]);var _0x537453=originateValidation[_0xe2e3('0xe')](_0x56e6e8[_0xe2e3('0x2c')]);if(_0x537453[_0xe2e3('0x29')]>0x0){return _0x67a9e3[_0xe2e3('0x1a')](0x190)[_0xe2e3('0x2d')](_0x537453);}var _0x2e9001=_0x56e6e8[_0xe2e3('0x2c')][_0xe2e3('0x2e')];var _0x118137=_0x56e6e8[_0xe2e3('0x2c')][_0xe2e3('0x2f')];var _0x26b4b9=_0x56e6e8[_0xe2e3('0x2c')][_0xe2e3('0x30')];var _0x41ad56=_0x56e6e8[_0xe2e3('0x2c')][_0xe2e3('0x31')];return getAgent(_0x2e9001)[_0xe2e3('0x1e')](function(_0x2a1baa){logger[_0xe2e3('0x14')](_0xe2e3('0x32'),_0x2a1baa[_0xe2e3('0x19')]);emit(util[_0xe2e3('0x33')](_0xe2e3('0x34'),_0x2a1baa[_0xe2e3('0x19')]),'webbar:originate',{'callNumber':_0x118137,'callerId':_0x26b4b9,'callbackUrl':_0x41ad56});return _0x67a9e3['status'](0xc8)[_0xe2e3('0x2d')]({'error':![],'message':_0xe2e3('0x35')});})[_0xe2e3('0x22')](handleError(_0x67a9e3));};exports[_0xe2e3('0x36')]=function(_0x1e57f2,_0x1a823e){logger['info'](_0xe2e3('0x37'),_0x1e57f2[_0xe2e3('0x2c')]);var _0x5bd17b=hangupValidation[_0xe2e3('0xe')](_0x1e57f2[_0xe2e3('0x2c')]);if(_0x5bd17b['length']>0x0){return _0x1a823e[_0xe2e3('0x1a')](0x190)[_0xe2e3('0x2d')](_0x5bd17b);}var _0x450ee9=_0x1e57f2[_0xe2e3('0x2c')]['userId'];var _0x436b63=_0x1e57f2[_0xe2e3('0x2c')][_0xe2e3('0x28')];return getAgent(_0x450ee9)[_0xe2e3('0x1e')](function(_0x2c4120){logger['info']('entityFound:',_0x2c4120[_0xe2e3('0x19')]);emit(util[_0xe2e3('0x33')](_0xe2e3('0x34'),_0x2c4120[_0xe2e3('0x19')]),_0xe2e3('0x38'),{'sessionId':_0x436b63});return _0x1a823e[_0xe2e3('0x1a')](0xc8)[_0xe2e3('0x2d')]({'error':![],'message':_0xe2e3('0x39')});})[_0xe2e3('0x22')](handleError(_0x1a823e));};exports['answer']=function(_0x33e7d3,_0x2df7d5){logger[_0xe2e3('0x14')]('answer\x20fired:',_0x33e7d3[_0xe2e3('0x2c')]);var _0x27781e=answerValidation[_0xe2e3('0xe')](_0x33e7d3['body']);if(_0x27781e['length']>0x0){return _0x2df7d5[_0xe2e3('0x1a')](0x190)['json'](_0x27781e);}var _0x5e8298=_0x33e7d3[_0xe2e3('0x2c')][_0xe2e3('0x2e')];var _0x39cd14=_0x33e7d3[_0xe2e3('0x2c')][_0xe2e3('0x28')];return getAgent(_0x5e8298)[_0xe2e3('0x1e')](function(_0x5696d9){logger[_0xe2e3('0x14')](_0xe2e3('0x32'),_0x5696d9[_0xe2e3('0x19')]);emit(util[_0xe2e3('0x33')](_0xe2e3('0x34'),_0x5696d9[_0xe2e3('0x19')]),_0xe2e3('0x3a'),{'sessionId':_0x39cd14});return _0x2df7d5[_0xe2e3('0x1a')](0xc8)['json']({'error':![],'message':_0xe2e3('0x3b')});})[_0xe2e3('0x22')](handleError(_0x2df7d5));};exports[_0xe2e3('0x3c')]=function(_0x13d73d,_0x573d07){logger[_0xe2e3('0x14')](_0xe2e3('0x3d'),_0x13d73d[_0xe2e3('0x2c')]);var _0xa3371f=holdValidation[_0xe2e3('0xe')](_0x13d73d[_0xe2e3('0x2c')]);if(_0xa3371f[_0xe2e3('0x29')]>0x0){return _0x573d07[_0xe2e3('0x1a')](0x190)['json'](_0xa3371f);}var _0x677ae0=_0x13d73d[_0xe2e3('0x2c')]['userId'];var _0x3ee08f=_0x13d73d['body'][_0xe2e3('0x28')];return getAgent(_0x677ae0)[_0xe2e3('0x1e')](function(_0x2b4ddd){logger[_0xe2e3('0x14')](_0xe2e3('0x32'),_0x2b4ddd[_0xe2e3('0x19')]);emit(util[_0xe2e3('0x33')](_0xe2e3('0x34'),_0x2b4ddd[_0xe2e3('0x19')]),_0xe2e3('0x3e'),{'sessionId':_0x3ee08f});return _0x573d07[_0xe2e3('0x1a')](0xc8)[_0xe2e3('0x2d')]({'error':![],'message':'hold\x20executed!'});})[_0xe2e3('0x22')](handleError(_0x573d07));};exports['unhold']=function(_0x485bb3,_0x46d994){logger[_0xe2e3('0x14')](_0xe2e3('0x3f'),_0x485bb3[_0xe2e3('0x2c')]);var _0x38802b=unholdValidation[_0xe2e3('0xe')](_0x485bb3['body']);if(_0x38802b[_0xe2e3('0x29')]>0x0){return _0x46d994[_0xe2e3('0x1a')](0x190)[_0xe2e3('0x2d')](_0x38802b);}var _0x13dc06=_0x485bb3[_0xe2e3('0x2c')]['userId'];var _0x1eb1b5=_0x485bb3[_0xe2e3('0x2c')][_0xe2e3('0x28')];return getAgent(_0x13dc06)['then'](function(_0x70144){logger[_0xe2e3('0x14')](_0xe2e3('0x32'),_0x70144['name']);emit(util['format']('user:%s',_0x70144[_0xe2e3('0x19')]),_0xe2e3('0x40'),{'sessionId':_0x1eb1b5});return _0x46d994[_0xe2e3('0x1a')](0xc8)[_0xe2e3('0x2d')]({'error':![],'message':_0xe2e3('0x41')});})[_0xe2e3('0x22')](handleError(_0x46d994));};exports[_0xe2e3('0x42')]=function(_0xfbc148,_0x5342e4){logger['info'](_0xe2e3('0x43'),_0x5342e4['body']);var _0x240cb1=callsValidation['validate'](_0xfbc148['body']);if(_0x240cb1[_0xe2e3('0x29')]>0x0){return _0x5342e4['status'](0x190)[_0xe2e3('0x2d')](_0x240cb1);}var _0x199465=_0xfbc148[_0xe2e3('0x2c')][_0xe2e3('0x2e')];var _0x1f9221=respondWithRpcPromise('VoiceChannels');var _0x2777d3=getAgent(_0x199465);return Promise[_0xe2e3('0x25')]([_0x1f9221,_0x2777d3])[_0xe2e3('0x1e')](function(_0x20712b){var _0x43d4ce=_0x20712b[0x0];var _0x1592d1=_0x20712b[0x1];var _0x29dabd=_[_0xe2e3('0x44')](_0x43d4ce[_0xe2e3('0x26')],function(_0x3833bc){return _0x3833bc[_0xe2e3('0x27')]==_0x1592d1['id'];});return _0x5342e4['status'](0xc8)['json']({'count':_0x29dabd[_0xe2e3('0x29')],'rows':_0x29dabd});})[_0xe2e3('0x22')](handleError(_0x5342e4));};exports['conference']=function(_0x564b55,_0x53dffe){logger[_0xe2e3('0x14')](_0xe2e3('0x45'),_0x564b55['body']);var _0x517f2b=conferenceValidation[_0xe2e3('0xe')](_0x564b55[_0xe2e3('0x2c')]);if(_0x517f2b[_0xe2e3('0x29')]>0x0){return _0x53dffe[_0xe2e3('0x1a')](0x190)[_0xe2e3('0x2d')](_0x517f2b);}var _0x1d3673=_0x564b55['body']['userId'];return getAgent(_0x1d3673)['then'](function(_0x28b858){logger[_0xe2e3('0x14')](_0xe2e3('0x32'),_0x28b858[_0xe2e3('0x19')]);emit(util[_0xe2e3('0x33')](_0xe2e3('0x34'),_0x28b858[_0xe2e3('0x19')]),_0xe2e3('0x46'));return _0x53dffe[_0xe2e3('0x1a')](0xc8)[_0xe2e3('0x2d')]({'error':![],'message':_0xe2e3('0x47')});})['catch'](handleError(_0x53dffe));};exports[_0xe2e3('0x48')]=function(_0x25ae98,_0x36f86e){logger['info'](_0xe2e3('0x49'),_0x25ae98[_0xe2e3('0x2c')]);var _0x17616f=transferValidation[_0xe2e3('0xe')](_0x25ae98[_0xe2e3('0x2c')]);if(_0x17616f[_0xe2e3('0x29')]>0x0){return _0x36f86e[_0xe2e3('0x1a')](0x190)[_0xe2e3('0x2d')](_0x17616f);}var _0x1aa8ea=_0x25ae98['body']['userId'];var _0x6b783f=_0x25ae98[_0xe2e3('0x2c')]['sessionId'];var _0x3036ef=_0x25ae98[_0xe2e3('0x2c')][_0xe2e3('0x4a')];return getAgent(_0x1aa8ea)['then'](function(_0x2ecab9){logger[_0xe2e3('0x14')](_0xe2e3('0x32'),_0x2ecab9[_0xe2e3('0x19')]);emit(util[_0xe2e3('0x33')](_0xe2e3('0x34'),_0x2ecab9[_0xe2e3('0x19')]),'webbar:transfer',{'sessionId':_0x6b783f,'transferNumber':_0x3036ef});return _0x36f86e[_0xe2e3('0x1a')](0xc8)[_0xe2e3('0x2d')]({'error':![],'message':_0xe2e3('0x4b')});})['catch'](handleError(_0x36f86e));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index 7b6c1d6..89fdaba 100644 --- a/server/api/whatsappAccount/index.js +++ b/server/api/whatsappAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2233=['/:id/canned_answers','/:id/users','/:id/applications','getApplications','post','create','addDisposition','addAnswer','addAgents','addApplications','/:id/notify','/:id/send','send','delete','removeDispositions','removeAgents','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','describe','/:id','show','/:id/dispositions','getDispositions'];(function(_0x49ba74,_0x4cce71){var _0x879e70=function(_0x3b1ba5){while(--_0x3b1ba5){_0x49ba74['push'](_0x49ba74['shift']());}};_0x879e70(++_0x4cce71);}(_0x2233,0x111));var _0x3223=function(_0x5ccdd5,_0x137596){_0x5ccdd5=_0x5ccdd5-0x0;var _0x2bb303=_0x2233[_0x5ccdd5];return _0x2bb303;};'use strict';var multer=require('multer');var util=require(_0x3223('0x0'));var path=require(_0x3223('0x1'));var timeout=require('connect-timeout');var express=require(_0x3223('0x2'));var router=express[_0x3223('0x3')]();var fs_extra=require(_0x3223('0x4'));var auth=require(_0x3223('0x5'));var interaction=require(_0x3223('0x6'));var config=require(_0x3223('0x7'));var controller=require('./whatsappAccount.controller');router['get']('/',auth[_0x3223('0x8')](),controller['index']);router[_0x3223('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x3223('0xa')]);router[_0x3223('0x9')](_0x3223('0xb'),auth['isAuthenticated'](),controller[_0x3223('0xc')]);router[_0x3223('0x9')](_0x3223('0xd'),auth[_0x3223('0x8')](),controller[_0x3223('0xe')]);router[_0x3223('0x9')](_0x3223('0xf'),auth[_0x3223('0x8')](),controller['getAnswers']);router[_0x3223('0x9')](_0x3223('0x10'),auth[_0x3223('0x8')](),controller['getAgents']);router[_0x3223('0x9')](_0x3223('0x11'),auth['isAuthenticated'](),controller[_0x3223('0x12')]);router[_0x3223('0x13')]('/',auth[_0x3223('0x8')](),controller[_0x3223('0x14')]);router[_0x3223('0x13')](_0x3223('0xd'),auth[_0x3223('0x8')](),controller[_0x3223('0x15')]);router[_0x3223('0x13')]('/:id/canned_answers',auth[_0x3223('0x8')](),controller[_0x3223('0x16')]);router[_0x3223('0x13')](_0x3223('0x10'),auth[_0x3223('0x8')](),controller[_0x3223('0x17')]);router['post'](_0x3223('0x11'),auth['isAuthenticated'](),controller[_0x3223('0x18')]);router['post'](_0x3223('0x19'),controller['notify']);router[_0x3223('0x13')](_0x3223('0x1a'),auth['isAuthenticated'](),controller[_0x3223('0x1b')]);router['put']('/:id',auth[_0x3223('0x8')](),controller['update']);router[_0x3223('0x1c')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x3223('0x1c')](_0x3223('0xd'),auth[_0x3223('0x8')](),controller[_0x3223('0x1d')]);router[_0x3223('0x1c')](_0x3223('0xf'),auth[_0x3223('0x8')](),controller['removeAnswers']);router[_0x3223('0x1c')](_0x3223('0x10'),auth[_0x3223('0x8')](),controller[_0x3223('0x1e')]);module[_0x3223('0x1f')]=router; \ No newline at end of file +var _0xd4f3=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','getAnswers','/:id/users','getAgents','/:id/applications','getApplications','post','create','addDisposition','/:id/canned_answers','addAnswer','addAgents','addApplications','/:id/notify','/:id/send','send','put','delete','destroy','removeAnswers','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd4f3,0x1c8));var _0x3d4f=function(_0x3b55f1,_0x2ba8dc){_0x3b55f1=_0x3b55f1-0x0;var _0x4510e3=_0xd4f3[_0x3b55f1];return _0x4510e3;};'use strict';var multer=require(_0x3d4f('0x0'));var util=require(_0x3d4f('0x1'));var path=require(_0x3d4f('0x2'));var timeout=require(_0x3d4f('0x3'));var express=require(_0x3d4f('0x4'));var router=express[_0x3d4f('0x5')]();var fs_extra=require(_0x3d4f('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x3d4f('0x7'));var config=require(_0x3d4f('0x8'));var controller=require('./whatsappAccount.controller');router[_0x3d4f('0x9')]('/',auth[_0x3d4f('0xa')](),controller[_0x3d4f('0xb')]);router['get'](_0x3d4f('0xc'),auth[_0x3d4f('0xa')](),controller[_0x3d4f('0xd')]);router[_0x3d4f('0x9')](_0x3d4f('0xe'),auth['isAuthenticated'](),controller[_0x3d4f('0xf')]);router[_0x3d4f('0x9')](_0x3d4f('0x10'),auth[_0x3d4f('0xa')](),controller[_0x3d4f('0x11')]);router[_0x3d4f('0x9')]('/:id/canned_answers',auth[_0x3d4f('0xa')](),controller[_0x3d4f('0x12')]);router[_0x3d4f('0x9')](_0x3d4f('0x13'),auth[_0x3d4f('0xa')](),controller[_0x3d4f('0x14')]);router['get'](_0x3d4f('0x15'),auth[_0x3d4f('0xa')](),controller[_0x3d4f('0x16')]);router[_0x3d4f('0x17')]('/',auth[_0x3d4f('0xa')](),controller[_0x3d4f('0x18')]);router[_0x3d4f('0x17')](_0x3d4f('0x10'),auth[_0x3d4f('0xa')](),controller[_0x3d4f('0x19')]);router[_0x3d4f('0x17')](_0x3d4f('0x1a'),auth[_0x3d4f('0xa')](),controller[_0x3d4f('0x1b')]);router[_0x3d4f('0x17')](_0x3d4f('0x13'),auth[_0x3d4f('0xa')](),controller[_0x3d4f('0x1c')]);router[_0x3d4f('0x17')]('/:id/applications',auth[_0x3d4f('0xa')](),controller[_0x3d4f('0x1d')]);router[_0x3d4f('0x17')](_0x3d4f('0x1e'),controller['notify']);router[_0x3d4f('0x17')](_0x3d4f('0x1f'),auth[_0x3d4f('0xa')](),controller[_0x3d4f('0x20')]);router[_0x3d4f('0x21')](_0x3d4f('0xe'),auth[_0x3d4f('0xa')](),controller['update']);router[_0x3d4f('0x22')](_0x3d4f('0xe'),auth[_0x3d4f('0xa')](),controller[_0x3d4f('0x23')]);router['delete'](_0x3d4f('0x10'),auth[_0x3d4f('0xa')](),controller['removeDispositions']);router[_0x3d4f('0x22')](_0x3d4f('0x1a'),auth[_0x3d4f('0xa')](),controller[_0x3d4f('0x24')]);router['delete'](_0x3d4f('0x13'),auth[_0x3d4f('0xa')](),controller['removeAgents']);module[_0x3d4f('0x25')]=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index 73aa6ed..d8ad02f 100644 --- a/server/api/whatsappAccount/whatsappAccount.attributes.js +++ b/server/api/whatsappAccount/whatsappAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3d74=['name','generate','ENUM','twilio','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING'];(function(_0x1aeb97,_0x27c6d9){var _0x501901=function(_0x2918eb){while(--_0x2918eb){_0x1aeb97['push'](_0x1aeb97['shift']());}};_0x501901(++_0x27c6d9);}(_0x3d74,0x6c));var _0x43d7=function(_0x4098a5,_0xfe2d79){_0x4098a5=_0x4098a5-0x0;var _0xc582aa=_0x3d74[_0x4098a5];return _0xc582aa;};'use strict';var Sequelize=require(_0x43d7('0x0'));var rs=require(_0x43d7('0x1'));module[_0x43d7('0x2')]={'name':{'type':Sequelize[_0x43d7('0x3')],'unique':_0x43d7('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0x43d7('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x43d7('0x3')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x43d7('0x5')]();}},'phone':{'type':Sequelize[_0x43d7('0x3')]},'type':{'type':Sequelize[_0x43d7('0x6')](_0x43d7('0x7'),'sinch')},'accountSid':{'type':Sequelize[_0x43d7('0x3')]},'baseUrl':{'type':Sequelize[_0x43d7('0x3')]},'authToken':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x43d7('0x8')],'defaultValue':function(){return _0x43d7('0x9');}},'notificationSound':{'type':Sequelize[_0x43d7('0xa')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x43d7('0xa')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x43d7('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x43d7('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x43d7('0xa')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x43d7('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x43d7('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x43d7('0xb')],'comment':_0x43d7('0xc')},'mandatoryDisposition':{'type':Sequelize[_0x43d7('0xa')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x2606a5){if(!_0x2606a5){this[_0x43d7('0xd')](_0x43d7('0xe'),null);}this[_0x43d7('0xd')](_0x43d7('0xf'),_0x2606a5);}},'description':{'type':Sequelize[_0x43d7('0x3')]}}; \ No newline at end of file +var _0xaa88=['TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','sequelize','randomstring','exports','STRING','name','generate','twilio','sinch'];(function(_0x2976ce,_0x25343f){var _0x1a5dc4=function(_0x1df787){while(--_0x1df787){_0x2976ce['push'](_0x2976ce['shift']());}};_0x1a5dc4(++_0x25343f);}(_0xaa88,0x124));var _0x8aa8=function(_0x3f2228,_0x3b27d5){_0x3f2228=_0x3f2228-0x0;var _0x285ae4=_0xaa88[_0x3f2228];return _0x285ae4;};'use strict';var Sequelize=require(_0x8aa8('0x0'));var rs=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'name':{'type':Sequelize[_0x8aa8('0x3')],'unique':_0x8aa8('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x8aa8('0x5')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0x8aa8('0x6'),_0x8aa8('0x7'))},'accountSid':{'type':Sequelize[_0x8aa8('0x3')]},'baseUrl':{'type':Sequelize[_0x8aa8('0x3')]},'authToken':{'type':Sequelize[_0x8aa8('0x3')]},'notificationTemplate':{'type':Sequelize[_0x8aa8('0x8')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x8aa8('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x8aa8('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x8aa8('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x8aa8('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x8aa8('0xa')],'comment':_0x8aa8('0xb')},'mandatoryDisposition':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':![],'comment':_0x8aa8('0xc'),'set':function(_0x4ac3eb){if(!_0x4ac3eb){this[_0x8aa8('0xd')](_0x8aa8('0xe'),null);}this['setDataValue']('mandatoryDisposition',_0x4ac3eb);}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index 4bbc8e1..71450ad 100644 --- a/server/api/whatsappAccount/whatsappAccount.controller.js +++ b/server/api/whatsappAccount/whatsappAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe530=['difference','ListId','mobile','twilio','from','From','replace','whatsapp:','Body','messageId','MessageSid','notifications','isNil','Sequelize','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','Contacts','DESC','list','contact','WhatsappInteraction','spread','interaction','created','autoclose','*,*,*,*','ContactId','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','queueId','WhatsappQueue','queue','waitForTheAssignedQueue','Start','startRouting','receiveMessage','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','text/xml','\x0a','List','out','dataValues','Messages','push','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','jayson/promise','client','http','request','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','get','UserProfileResource','stack','name','send','index','Pause','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','WhatsappAccount','include','findAll','rows','show','mandatoryDispositionPause','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','WhatsappAccounts','userProfileId','params','describe','addDisposition','WhatsappAccountId','getDispositions','findOne','Disposition','order','includeAll','removeDispositions','addAnswer','CannedAnswer','getAnswers','hasOwnProperty','removeAnswers','ids','addAgents','omit','userWhatsappAccount:save','removeAgents','isArray','emit','userWhatsappAccount:remove','getAgents','User','sequelize','transaction','Transaction','ISOLATION_LEVELS','bulkCreate','findAndCountAll','priority','getApplications','WhatsappApplication','notify','whatsapp','Applications','account','sinch','statuses','state','read','WhatsappMessage','message_id','applications','orderBy','asc','CmContact','ValidationError','no\x20available\x20attributes','createdAt','updatedAt'];(function(_0x39e462,_0x2533ac){var _0x26aa30=function(_0x99d654){while(--_0x99d654){_0x39e462['push'](_0x39e462['shift']());}};_0x26aa30(++_0x2533ac);}(_0xe530,0x1ca));var _0x0e53=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0xe530[_0x164eca];return _0x2ce562;};'use strict';var emlformat=require(_0x0e53('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0e53('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0e53('0x2'));var moment=require(_0x0e53('0x3'));var BPromise=require(_0x0e53('0x4'));var Mustache=require(_0x0e53('0x5'));var util=require(_0x0e53('0x6'));var path=require(_0x0e53('0x7'));var sox=require(_0x0e53('0x8'));var csv=require(_0x0e53('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0e53('0xa'));var squel=require(_0x0e53('0xb'));var crypto=require(_0x0e53('0xc'));var jsforce=require(_0x0e53('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x0e53('0x9'));var querystring=require(_0x0e53('0xe'));var Papa=require(_0x0e53('0xf'));var Redis=require(_0x0e53('0x10'));var authService=require(_0x0e53('0x11'));var qs=require(_0x0e53('0x12'));var as=require(_0x0e53('0x13'));var hardwareService=require(_0x0e53('0x14'));var logger=require('../../config/logger')(_0x0e53('0x15'));var utils=require(_0x0e53('0x16'));var config=require(_0x0e53('0x17'));var licenseUtil=require(_0x0e53('0x18'));var db=require('../../mysqldb')['db'];config[_0x0e53('0x19')]=_[_0x0e53('0x1a')](config[_0x0e53('0x19')],{'host':_0x0e53('0x1b'),'port':0x18eb});var socket=require(_0x0e53('0x1c'))(new Redis(config[_0x0e53('0x19')]));require(_0x0e53('0x1d'))[_0x0e53('0x1e')](socket);var jayson=require(_0x0e53('0x1f'));var client=jayson[_0x0e53('0x20')][_0x0e53('0x21')]({'port':0x232c});function respondWithRpcPromise(_0x99d401,_0x30945a,_0x429359,_0x3c2886){return new BPromise(function(_0x4df1e3,_0x390922){var _0x350b9d=_0x3c2886||client;return _0x350b9d[_0x0e53('0x22')](_0x99d401,_0x429359)['then'](function(_0x56be0e){logger[_0x0e53('0x23')](_0x0e53('0x24'),_0x30945a,_0x0e53('0x25'));logger[_0x0e53('0x26')](_0x0e53('0x27'),_0x30945a,'request\x20sent',JSON[_0x0e53('0x28')](_0x56be0e));if(_0x56be0e[_0x0e53('0x29')]){if(_0x56be0e[_0x0e53('0x29')][_0x0e53('0x2a')]===0x1f4){logger[_0x0e53('0x29')](_0x0e53('0x24'),_0x30945a,_0x56be0e[_0x0e53('0x29')][_0x0e53('0x2b')]);return _0x390922(_0x56be0e['error'][_0x0e53('0x2b')]);}logger['error'](_0x0e53('0x24'),_0x30945a,_0x56be0e[_0x0e53('0x29')]['message']);return _0x4df1e3(_0x56be0e[_0x0e53('0x29')][_0x0e53('0x2b')]);}else{logger[_0x0e53('0x23')](_0x0e53('0x24'),_0x30945a,_0x0e53('0x25'));_0x4df1e3(_0x56be0e[_0x0e53('0x2c')]['message']);}})[_0x0e53('0x2d')](function(_0x25846c){logger['error'](_0x0e53('0x24'),_0x30945a,_0x25846c);_0x390922(_0x25846c);});});}function respondWithStatusCode(_0x29a9ba,_0x13ad42){_0x13ad42=_0x13ad42||0xcc;return function(_0x3efe04){if(_0x3efe04){return _0x29a9ba[_0x0e53('0x2e')](_0x13ad42);}return _0x29a9ba[_0x0e53('0x2f')](_0x13ad42)[_0x0e53('0x30')]();};}function respondWithResult(_0x2b2cb1,_0x254b4c){_0x254b4c=_0x254b4c||0xc8;return function(_0x5c9d5c){if(_0x5c9d5c){return _0x2b2cb1[_0x0e53('0x2f')](_0x254b4c)[_0x0e53('0x31')](_0x5c9d5c);}};}function respondWithFilteredResult(_0x505cd6,_0x20184b){return function(_0x301dc5){if(_0x301dc5){var _0xd4f4b=typeof _0x20184b[_0x0e53('0x32')]===_0x0e53('0x33')&&typeof _0x20184b[_0x0e53('0x34')]===_0x0e53('0x33');var _0x4c9d21=_0x301dc5[_0x0e53('0x35')];var _0x250af9=_0xd4f4b?0x0:_0x20184b['offset'];var _0x21964e=_0xd4f4b?_0x301dc5[_0x0e53('0x35')]:_0x20184b[_0x0e53('0x32')]+_0x20184b['limit'];var _0x2a49a4;if(_0x21964e>=_0x4c9d21){_0x21964e=_0x4c9d21;_0x2a49a4=0xc8;}else{_0x2a49a4=0xce;}_0x505cd6[_0x0e53('0x2f')](_0x2a49a4);return _0x505cd6[_0x0e53('0x36')](_0x0e53('0x37'),_0x250af9+'-'+_0x21964e+'/'+_0x4c9d21)[_0x0e53('0x31')](_0x301dc5);}return null;};}function patchUpdates(_0x26244f){return function(_0x2897ac){try{jsonpatch['apply'](_0x2897ac,_0x26244f,!![]);}catch(_0x42767c){return BPromise[_0x0e53('0x38')](_0x42767c);}return _0x2897ac['save']();};}function saveUpdates(_0x1a074a,_0x3d3267){return function(_0x143fce){if(_0x143fce){return _0x143fce[_0x0e53('0x39')](_0x1a074a)[_0x0e53('0x3a')](function(_0x33ff07){return _0x33ff07;});}return null;};}function removeEntity(_0x29d3d9,_0x17b84e){return function(_0x32f93a){if(_0x32f93a){return _0x32f93a[_0x0e53('0x3b')]()[_0x0e53('0x3a')](function(){var _0x124053=_0x32f93a[_0x0e53('0x3c')]({'plain':!![]});var _0x1f6a02='WhatsappAccounts';return db[_0x0e53('0x3d')][_0x0e53('0x3b')]({'where':{'type':_0x1f6a02,'resourceId':_0x124053['id']}})[_0x0e53('0x3a')](function(){return _0x32f93a;});})['then'](function(){_0x29d3d9[_0x0e53('0x2f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3aa888,_0x2a7622){return function(_0x10ce6f){if(!_0x10ce6f){_0x3aa888[_0x0e53('0x2e')](0x194);}return _0x10ce6f;};}function handleError(_0x4eafa8,_0x1823ea){_0x1823ea=_0x1823ea||0x1f4;return function(_0x556eee){logger[_0x0e53('0x29')](_0x556eee[_0x0e53('0x3e')]);if(_0x556eee[_0x0e53('0x3f')]){delete _0x556eee[_0x0e53('0x3f')];}_0x4eafa8[_0x0e53('0x2f')](_0x1823ea)[_0x0e53('0x40')](_0x556eee);};}exports[_0x0e53('0x41')]=function(_0x545d20,_0x172792){var _0x31e4e4={'include':[{'model':db[_0x0e53('0x42')],'as':'mandatoryDispositionPause'}]},_0x5891a2={},_0xc8823f={'count':0x0,'rows':[]};var _0x66f812=_[_0x0e53('0x43')](db['WhatsappAccount'][_0x0e53('0x44')],function(_0x47246d){return{'name':_0x47246d[_0x0e53('0x45')],'type':_0x47246d[_0x0e53('0x46')][_0x0e53('0x47')]};});_0x5891a2[_0x0e53('0x48')]=_['map'](_0x66f812,_0x0e53('0x3f'));_0x5891a2['query']=_[_0x0e53('0x49')](_0x545d20[_0x0e53('0x4a')]);_0x5891a2[_0x0e53('0x4b')]=_[_0x0e53('0x4c')](_0x5891a2[_0x0e53('0x48')],_0x5891a2['query']);_0x31e4e4['attributes']=_[_0x0e53('0x4c')](_0x5891a2[_0x0e53('0x48')],qs[_0x0e53('0x4d')](_0x545d20[_0x0e53('0x4a')][_0x0e53('0x4d')]));_0x31e4e4[_0x0e53('0x4e')]=_0x31e4e4['attributes'][_0x0e53('0x4f')]?_0x31e4e4[_0x0e53('0x4e')]:_0x5891a2[_0x0e53('0x48')];if(!_0x545d20[_0x0e53('0x4a')]['hasOwnProperty'](_0x0e53('0x50'))){_0x31e4e4[_0x0e53('0x34')]=qs[_0x0e53('0x34')](_0x545d20['query'][_0x0e53('0x34')]);_0x31e4e4[_0x0e53('0x32')]=qs['offset'](_0x545d20['query'][_0x0e53('0x32')]);}_0x31e4e4['order']=qs['sort'](_0x545d20[_0x0e53('0x4a')][_0x0e53('0x51')]);_0x31e4e4[_0x0e53('0x52')]=qs[_0x0e53('0x4b')](_[_0x0e53('0x53')](_0x545d20[_0x0e53('0x4a')],_0x5891a2[_0x0e53('0x4b')]),_0x66f812);if(_0x545d20[_0x0e53('0x4a')][_0x0e53('0x54')]){_0x31e4e4[_0x0e53('0x52')]=_[_0x0e53('0x55')](_0x31e4e4[_0x0e53('0x52')],{'$or':_[_0x0e53('0x43')](_0x66f812,function(_0x3e7369){if(_0x3e7369[_0x0e53('0x46')]!==_0x0e53('0x56')){var _0x177215={};_0x177215[_0x3e7369[_0x0e53('0x3f')]]={'$like':'%'+_0x545d20[_0x0e53('0x4a')][_0x0e53('0x54')]+'%'};return _0x177215;}})});}_0x31e4e4=_['merge']({},_0x31e4e4,_0x545d20[_0x0e53('0x57')]);var _0x2a9b12={'where':_0x31e4e4[_0x0e53('0x52')]};return db[_0x0e53('0x58')][_0x0e53('0x35')](_0x2a9b12)[_0x0e53('0x3a')](function(_0x71b9fc){_0xc8823f['count']=_0x71b9fc;if(_0x545d20['query']['includeAll']){_0x31e4e4[_0x0e53('0x59')]=[{'all':!![]}];}return db[_0x0e53('0x58')][_0x0e53('0x5a')](_0x31e4e4);})[_0x0e53('0x3a')](function(_0x4e243f){_0xc8823f[_0x0e53('0x5b')]=_0x4e243f;return _0xc8823f;})[_0x0e53('0x3a')](respondWithFilteredResult(_0x172792,_0x31e4e4))['catch'](handleError(_0x172792,null));};exports[_0x0e53('0x5c')]=function(_0x2f985e,_0x1f990d){var _0x496fe0={'raw':![],'where':{'id':_0x2f985e['params']['id']},'include':[{'model':db['Pause'],'as':_0x0e53('0x5d')}]},_0x4ff181={};_0x4ff181[_0x0e53('0x48')]=_[_0x0e53('0x49')](db[_0x0e53('0x58')][_0x0e53('0x44')]);_0x4ff181[_0x0e53('0x4a')]=_[_0x0e53('0x49')](_0x2f985e[_0x0e53('0x4a')]);_0x4ff181[_0x0e53('0x4b')]=_[_0x0e53('0x4c')](_0x4ff181[_0x0e53('0x48')],_0x4ff181[_0x0e53('0x4a')]);_0x496fe0[_0x0e53('0x4e')]=_[_0x0e53('0x4c')](_0x4ff181[_0x0e53('0x48')],qs[_0x0e53('0x4d')](_0x2f985e['query'][_0x0e53('0x4d')]));_0x496fe0[_0x0e53('0x4e')]=_0x496fe0[_0x0e53('0x4e')][_0x0e53('0x4f')]?_0x496fe0[_0x0e53('0x4e')]:_0x4ff181[_0x0e53('0x48')];if(_0x2f985e[_0x0e53('0x4a')]['includeAll']){_0x496fe0['include']=[{'all':!![]}];}_0x496fe0=_[_0x0e53('0x55')]({},_0x496fe0,_0x2f985e['options']);return db['WhatsappAccount'][_0x0e53('0x5e')](_0x496fe0)[_0x0e53('0x3a')](handleEntityNotFound(_0x1f990d,null))[_0x0e53('0x3a')](respondWithResult(_0x1f990d,null))['catch'](handleError(_0x1f990d,null));};exports[_0x0e53('0x5f')]=function(_0x33bd6f,_0x12a0bd){return db[_0x0e53('0x58')]['create'](_0x33bd6f[_0x0e53('0x60')],{})[_0x0e53('0x3a')](function(_0xb9ee27){var _0x1a8e10=_0x33bd6f[_0x0e53('0x61')][_0x0e53('0x3c')]({'plain':!![]});if(!_0x1a8e10)throw new Error(_0x0e53('0x62'));if(_0x1a8e10[_0x0e53('0x63')]===_0x0e53('0x61')){var _0x188a81=_0xb9ee27[_0x0e53('0x3c')]({'plain':!![]});var _0x30f529=_0x0e53('0x64');return db['UserProfileSection']['find']({'where':{'name':_0x30f529,'userProfileId':_0x1a8e10[_0x0e53('0x65')]},'raw':!![]})[_0x0e53('0x3a')](function(_0x2c29ba){if(_0x2c29ba&&_0x2c29ba['autoAssociation']===0x0){return db[_0x0e53('0x3d')][_0x0e53('0x5f')]({'name':_0x188a81[_0x0e53('0x3f')],'resourceId':_0x188a81['id'],'type':_0x2c29ba[_0x0e53('0x3f')],'sectionId':_0x2c29ba['id']},{})[_0x0e53('0x3a')](function(){return _0xb9ee27;});}else{return _0xb9ee27;}})[_0x0e53('0x2d')](function(_0x1d0d9a){logger[_0x0e53('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1d0d9a);throw _0x1d0d9a;});}return _0xb9ee27;})[_0x0e53('0x3a')](respondWithResult(_0x12a0bd,0xc9))[_0x0e53('0x2d')](handleError(_0x12a0bd,null));};exports[_0x0e53('0x39')]=function(_0x1b2ae9,_0x39cd46){if(_0x1b2ae9[_0x0e53('0x60')]['id']){delete _0x1b2ae9[_0x0e53('0x60')]['id'];}return db[_0x0e53('0x58')]['find']({'where':{'id':_0x1b2ae9[_0x0e53('0x66')]['id']},'include':[{'model':db[_0x0e53('0x42')],'as':_0x0e53('0x5d')}]})['then'](handleEntityNotFound(_0x39cd46,null))[_0x0e53('0x3a')](saveUpdates(_0x1b2ae9[_0x0e53('0x60')],null))['then'](respondWithResult(_0x39cd46,null))[_0x0e53('0x2d')](handleError(_0x39cd46,null));};exports[_0x0e53('0x3b')]=function(_0x45bac8,_0x16dcf7){return db[_0x0e53('0x58')][_0x0e53('0x5e')]({'where':{'id':_0x45bac8[_0x0e53('0x66')]['id']}})[_0x0e53('0x3a')](handleEntityNotFound(_0x16dcf7,null))[_0x0e53('0x3a')](removeEntity(_0x16dcf7,null))[_0x0e53('0x2d')](handleError(_0x16dcf7,null));};exports['describe']=function(_0x31a398,_0x28f324){return db[_0x0e53('0x58')][_0x0e53('0x67')]()[_0x0e53('0x3a')](respondWithResult(_0x28f324,null))[_0x0e53('0x2d')](handleError(_0x28f324,null));};exports[_0x0e53('0x68')]=function(_0x2922a2,_0xda98,_0x15269d){if(_0x2922a2[_0x0e53('0x60')]['id']){delete _0x2922a2[_0x0e53('0x60')]['id'];}return db[_0x0e53('0x58')]['find']({'where':{'id':_0x2922a2[_0x0e53('0x66')]['id']}})['then'](handleEntityNotFound(_0xda98,null))[_0x0e53('0x3a')](function(_0x5d4ee5){if(_0x5d4ee5){_0x2922a2[_0x0e53('0x60')][_0x0e53('0x69')]=_0x5d4ee5['id'];return db['Disposition']['create'](_0x2922a2[_0x0e53('0x60')]);}})[_0x0e53('0x3a')](respondWithResult(_0xda98,null))[_0x0e53('0x2d')](handleError(_0xda98,null));};exports[_0x0e53('0x6a')]=function(_0x506882,_0x2f8b2e,_0x333505){var _0x1897ec={'raw':![],'where':{}};var _0x5622b3={};var _0x54623b={'count':0x0,'rows':[]};return db[_0x0e53('0x58')][_0x0e53('0x6b')]({'where':{'id':_0x506882['params']['id']}})['then'](handleEntityNotFound(_0x2f8b2e,null))[_0x0e53('0x3a')](function(_0x33e1ae){if(_0x33e1ae){_0x5622b3['model']=_[_0x0e53('0x49')](db[_0x0e53('0x6c')][_0x0e53('0x44')]);_0x5622b3[_0x0e53('0x4a')]=_[_0x0e53('0x49')](_0x506882[_0x0e53('0x4a')]);_0x5622b3['filters']=_['intersection'](_0x5622b3[_0x0e53('0x48')],_0x5622b3[_0x0e53('0x4a')]);_0x1897ec[_0x0e53('0x4e')]=_[_0x0e53('0x4c')](_0x5622b3[_0x0e53('0x48')],qs[_0x0e53('0x4d')](_0x506882[_0x0e53('0x4a')][_0x0e53('0x4d')]));_0x1897ec[_0x0e53('0x4e')]=_0x1897ec[_0x0e53('0x4e')][_0x0e53('0x4f')]?_0x1897ec[_0x0e53('0x4e')]:_0x5622b3[_0x0e53('0x48')];if(!_0x506882[_0x0e53('0x4a')]['hasOwnProperty']('nolimit')){_0x1897ec[_0x0e53('0x34')]=qs[_0x0e53('0x34')](_0x506882[_0x0e53('0x4a')][_0x0e53('0x34')]);_0x1897ec[_0x0e53('0x32')]=qs['offset'](_0x506882[_0x0e53('0x4a')][_0x0e53('0x32')]);}_0x1897ec[_0x0e53('0x6d')]=qs['sort'](_0x506882[_0x0e53('0x4a')][_0x0e53('0x51')]);_0x1897ec['where']=qs['filters'](_[_0x0e53('0x53')](_0x506882[_0x0e53('0x4a')],_0x5622b3['filters']));_0x1897ec['where'][_0x0e53('0x69')]=_0x33e1ae['id'];if(_0x506882[_0x0e53('0x4a')]['filter']){_0x1897ec['where']=_[_0x0e53('0x55')](_0x1897ec[_0x0e53('0x52')],{'$or':_[_0x0e53('0x43')](_0x1897ec[_0x0e53('0x4e')],function(_0x5a0846){var _0x34f06f={};_0x34f06f[_0x5a0846]={'$like':'%'+_0x506882[_0x0e53('0x4a')][_0x0e53('0x54')]+'%'};return _0x34f06f;})});}_0x1897ec=_[_0x0e53('0x55')]({},_0x1897ec,_0x506882[_0x0e53('0x57')]);return db[_0x0e53('0x6c')]['count']({'where':_0x1897ec[_0x0e53('0x52')]})[_0x0e53('0x3a')](function(_0x4327ad){_0x54623b[_0x0e53('0x35')]=_0x4327ad;if(_0x506882[_0x0e53('0x4a')][_0x0e53('0x6e')]){_0x1897ec[_0x0e53('0x59')]=[{'all':!![]}];}return db['Disposition'][_0x0e53('0x5a')](_0x1897ec);})['then'](function(_0x30e854){_0x54623b[_0x0e53('0x5b')]=_0x30e854;return _0x54623b;});}})[_0x0e53('0x3a')](respondWithFilteredResult(_0x2f8b2e,_0x1897ec))[_0x0e53('0x2d')](handleError(_0x2f8b2e,null));};exports[_0x0e53('0x6f')]=function(_0x22ccb2,_0xf5442,_0x1647d0){return db[_0x0e53('0x58')][_0x0e53('0x5e')]({'where':{'id':_0x22ccb2[_0x0e53('0x66')]['id']}})[_0x0e53('0x3a')](handleEntityNotFound(_0xf5442,null))[_0x0e53('0x3a')](function(_0x2342d9){if(_0x2342d9){return _0x2342d9[_0x0e53('0x6f')](_0x22ccb2[_0x0e53('0x4a')]['ids']);}})[_0x0e53('0x3a')](respondWithStatusCode(_0xf5442,null))[_0x0e53('0x2d')](handleError(_0xf5442,null));};exports[_0x0e53('0x70')]=function(_0xcb0158,_0x540a78,_0x420923){if(_0xcb0158[_0x0e53('0x60')]['id']){delete _0xcb0158[_0x0e53('0x60')]['id'];}return db['WhatsappAccount'][_0x0e53('0x5e')]({'where':{'id':_0xcb0158[_0x0e53('0x66')]['id']}})['then'](handleEntityNotFound(_0x540a78,null))[_0x0e53('0x3a')](function(_0x527cfc){if(_0x527cfc){_0xcb0158[_0x0e53('0x60')]['WhatsappAccountId']=_0x527cfc['id'];return db[_0x0e53('0x71')]['create'](_0xcb0158[_0x0e53('0x60')]);}})[_0x0e53('0x3a')](respondWithResult(_0x540a78,null))[_0x0e53('0x2d')](handleError(_0x540a78,null));};exports[_0x0e53('0x72')]=function(_0x1d7335,_0x3a957e,_0x5d4c7d){var _0x19e5c4={'raw':![],'where':{}};var _0x146cd1={};var _0x1b50a8={'count':0x0,'rows':[]};return db[_0x0e53('0x58')][_0x0e53('0x6b')]({'where':{'id':_0x1d7335['params']['id']}})['then'](handleEntityNotFound(_0x3a957e,null))[_0x0e53('0x3a')](function(_0x500d7d){if(_0x500d7d){_0x146cd1[_0x0e53('0x48')]=_[_0x0e53('0x49')](db[_0x0e53('0x71')][_0x0e53('0x44')]);_0x146cd1[_0x0e53('0x4a')]=_[_0x0e53('0x49')](_0x1d7335[_0x0e53('0x4a')]);_0x146cd1[_0x0e53('0x4b')]=_[_0x0e53('0x4c')](_0x146cd1[_0x0e53('0x48')],_0x146cd1[_0x0e53('0x4a')]);_0x19e5c4['attributes']=_['intersection'](_0x146cd1[_0x0e53('0x48')],qs[_0x0e53('0x4d')](_0x1d7335[_0x0e53('0x4a')][_0x0e53('0x4d')]));_0x19e5c4['attributes']=_0x19e5c4[_0x0e53('0x4e')][_0x0e53('0x4f')]?_0x19e5c4[_0x0e53('0x4e')]:_0x146cd1[_0x0e53('0x48')];if(!_0x1d7335[_0x0e53('0x4a')][_0x0e53('0x73')](_0x0e53('0x50'))){_0x19e5c4[_0x0e53('0x34')]=qs[_0x0e53('0x34')](_0x1d7335[_0x0e53('0x4a')][_0x0e53('0x34')]);_0x19e5c4[_0x0e53('0x32')]=qs['offset'](_0x1d7335[_0x0e53('0x4a')][_0x0e53('0x32')]);}_0x19e5c4[_0x0e53('0x6d')]=qs[_0x0e53('0x51')](_0x1d7335[_0x0e53('0x4a')][_0x0e53('0x51')]);_0x19e5c4['where']=qs[_0x0e53('0x4b')](_[_0x0e53('0x53')](_0x1d7335[_0x0e53('0x4a')],_0x146cd1[_0x0e53('0x4b')]));_0x19e5c4[_0x0e53('0x52')][_0x0e53('0x69')]=_0x500d7d['id'];if(_0x1d7335['query'][_0x0e53('0x54')]){_0x19e5c4['where']=_[_0x0e53('0x55')](_0x19e5c4[_0x0e53('0x52')],{'$or':_[_0x0e53('0x43')](_0x19e5c4[_0x0e53('0x4e')],function(_0x394e7f){var _0x1e90f9={};_0x1e90f9[_0x394e7f]={'$like':'%'+_0x1d7335[_0x0e53('0x4a')][_0x0e53('0x54')]+'%'};return _0x1e90f9;})});}_0x19e5c4=_[_0x0e53('0x55')]({},_0x19e5c4,_0x1d7335[_0x0e53('0x57')]);return db[_0x0e53('0x71')][_0x0e53('0x35')]({'where':_0x19e5c4[_0x0e53('0x52')]})[_0x0e53('0x3a')](function(_0x2285d7){_0x1b50a8[_0x0e53('0x35')]=_0x2285d7;if(_0x1d7335[_0x0e53('0x4a')]['includeAll']){_0x19e5c4[_0x0e53('0x59')]=[{'all':!![]}];}return db[_0x0e53('0x71')]['findAll'](_0x19e5c4);})[_0x0e53('0x3a')](function(_0x211f35){_0x1b50a8[_0x0e53('0x5b')]=_0x211f35;return _0x1b50a8;});}})[_0x0e53('0x3a')](respondWithFilteredResult(_0x3a957e,_0x19e5c4))[_0x0e53('0x2d')](handleError(_0x3a957e,null));};exports[_0x0e53('0x74')]=function(_0x5c795e,_0x179738,_0x52f3ac){return db['WhatsappAccount'][_0x0e53('0x5e')]({'where':{'id':_0x5c795e[_0x0e53('0x66')]['id']}})[_0x0e53('0x3a')](handleEntityNotFound(_0x179738,null))[_0x0e53('0x3a')](function(_0x55160a){if(_0x55160a){return _0x55160a[_0x0e53('0x74')](_0x5c795e[_0x0e53('0x4a')][_0x0e53('0x75')]);}})['then'](respondWithStatusCode(_0x179738,null))['catch'](handleError(_0x179738,null));};exports[_0x0e53('0x76')]=function(_0x216f61,_0x4c21ff,_0x3b245f){return db[_0x0e53('0x58')][_0x0e53('0x5e')]({'where':{'id':_0x216f61[_0x0e53('0x66')]['id']}})[_0x0e53('0x3a')](handleEntityNotFound(_0x4c21ff,null))[_0x0e53('0x3a')](function(_0x115c08){if(_0x115c08){return _0x115c08[_0x0e53('0x76')](_0x216f61[_0x0e53('0x60')][_0x0e53('0x75')],_[_0x0e53('0x77')](_0x216f61[_0x0e53('0x60')],[_0x0e53('0x75'),'id'])||{})['spread'](function(_0x4b331c){for(var _0x851129=0x0;_0x851129<_0x216f61[_0x0e53('0x60')][_0x0e53('0x75')][_0x0e53('0x4f')];_0x851129+=0x1){socket['emit'](_0x0e53('0x78'),{'UserId':Number(_0x216f61['body'][_0x0e53('0x75')][_0x851129]),'WhatsappAccountId':Number(_0x216f61[_0x0e53('0x66')]['id'])});}return _0x4b331c;});}})['then'](respondWithResult(_0x4c21ff,null))['catch'](handleError(_0x4c21ff,null));};exports[_0x0e53('0x79')]=function(_0x281b4f,_0x4e5162,_0x53150d){return db[_0x0e53('0x58')][_0x0e53('0x5e')]({'where':{'id':_0x281b4f[_0x0e53('0x66')]['id']}})[_0x0e53('0x3a')](handleEntityNotFound(_0x4e5162,null))[_0x0e53('0x3a')](function(_0x3623f4){if(_0x3623f4){return _0x3623f4[_0x0e53('0x79')](_0x281b4f[_0x0e53('0x4a')][_0x0e53('0x75')])['then'](function(){if(_[_0x0e53('0x7a')](_0x281b4f['query'][_0x0e53('0x75')])){for(var _0x3c29d3=0x0;_0x3c29d3<_0x281b4f[_0x0e53('0x4a')][_0x0e53('0x75')][_0x0e53('0x4f')];_0x3c29d3+=0x1){socket[_0x0e53('0x7b')]('userWhatsappAccount:remove',{'UserId':Number(_0x281b4f[_0x0e53('0x4a')][_0x0e53('0x75')][_0x3c29d3]),'WhatsappAccountId':Number(_0x281b4f[_0x0e53('0x66')]['id'])});}}else{socket[_0x0e53('0x7b')](_0x0e53('0x7c'),{'UserId':Number(_0x281b4f[_0x0e53('0x4a')][_0x0e53('0x75')]),'WhatsappAccountId':Number(_0x281b4f[_0x0e53('0x66')]['id'])});}});}})[_0x0e53('0x3a')](respondWithStatusCode(_0x4e5162,null))[_0x0e53('0x2d')](handleError(_0x4e5162,null));};exports[_0x0e53('0x7d')]=function(_0x5582c0,_0x2538c8,_0xbbc7ec){var _0x3fc6b1={};var _0x349442={};var _0x17c05e;var _0x6664ca;return db[_0x0e53('0x58')][_0x0e53('0x6b')]({'where':{'id':_0x5582c0[_0x0e53('0x66')]['id']}})[_0x0e53('0x3a')](handleEntityNotFound(_0x2538c8,null))[_0x0e53('0x3a')](function(_0x2e1bce){if(_0x2e1bce){_0x17c05e=_0x2e1bce;_0x349442['model']=_[_0x0e53('0x49')](db[_0x0e53('0x7e')][_0x0e53('0x44')]);_0x349442[_0x0e53('0x4a')]=_['keys'](_0x5582c0[_0x0e53('0x4a')]);_0x349442[_0x0e53('0x4b')]=_['intersection'](_0x349442[_0x0e53('0x48')],_0x349442[_0x0e53('0x4a')]);_0x3fc6b1['attributes']=_[_0x0e53('0x4c')](_0x349442[_0x0e53('0x48')],qs[_0x0e53('0x4d')](_0x5582c0[_0x0e53('0x4a')][_0x0e53('0x4d')]));_0x3fc6b1['attributes']=_0x3fc6b1['attributes'][_0x0e53('0x4f')]?_0x3fc6b1[_0x0e53('0x4e')]:_0x349442[_0x0e53('0x48')];_0x3fc6b1[_0x0e53('0x6d')]=qs[_0x0e53('0x51')](_0x5582c0['query'][_0x0e53('0x51')]);_0x3fc6b1[_0x0e53('0x52')]=qs[_0x0e53('0x4b')](_['pick'](_0x5582c0[_0x0e53('0x4a')],_0x349442['filters']));if(_0x5582c0[_0x0e53('0x4a')]['filter']){_0x3fc6b1[_0x0e53('0x52')]=_[_0x0e53('0x55')](_0x3fc6b1[_0x0e53('0x52')],{'$or':_['map'](_0x3fc6b1[_0x0e53('0x4e')],function(_0x13e7db){var _0x58babc={};_0x58babc[_0x13e7db]={'$like':'%'+_0x5582c0[_0x0e53('0x4a')][_0x0e53('0x54')]+'%'};return _0x58babc;})});}_0x3fc6b1=_[_0x0e53('0x55')]({},_0x3fc6b1,_0x5582c0['options']);return _0x17c05e[_0x0e53('0x7d')](_0x3fc6b1);}})[_0x0e53('0x3a')](function(_0x2daab7){if(_0x2daab7){_0x6664ca=_0x2daab7[_0x0e53('0x4f')];if(!_0x5582c0[_0x0e53('0x4a')][_0x0e53('0x73')](_0x0e53('0x50'))){_0x3fc6b1['limit']=qs[_0x0e53('0x34')](_0x5582c0[_0x0e53('0x4a')][_0x0e53('0x34')]);_0x3fc6b1[_0x0e53('0x32')]=qs[_0x0e53('0x32')](_0x5582c0['query'][_0x0e53('0x32')]);}return _0x17c05e[_0x0e53('0x7d')](_0x3fc6b1);}})['then'](function(_0x7183c2){if(_0x7183c2){return _0x7183c2?{'count':_0x6664ca,'rows':_0x7183c2}:null;}})[_0x0e53('0x3a')](respondWithResult(_0x2538c8,null))[_0x0e53('0x2d')](handleError(_0x2538c8,null));};exports['addApplications']=function(_0x5a33a5,_0x55babf){var _0x502f5b=_0x5a33a5[_0x0e53('0x66')]['id'];var _0x36bb98=_0x5a33a5[_0x0e53('0x60')];var _0x1cd2e2=0xc8;var _0x4fbdb5=null;return db[_0x0e53('0x7f')][_0x0e53('0x80')]({'isolationLevel':db['sequelize'][_0x0e53('0x81')][_0x0e53('0x82')]['READ_COMMITTED']},function(_0x1ecccc){return db[_0x0e53('0x58')][_0x0e53('0x6b')]({'where':{'id':_0x502f5b},'transaction':_0x1ecccc})['then'](function(_0x1d116d){if(_0x1d116d){return db['WhatsappApplication'][_0x0e53('0x3b')]({'where':{'WhatsappAccountId':_0x502f5b},'transaction':_0x1ecccc})[_0x0e53('0x3a')](function(){var _0x55eb17=_['map'](_0x36bb98,function(_0x2f9db9){_0x2f9db9['WhatsappAccountId']=_0x502f5b;return _0x2f9db9;});return db['WhatsappApplication'][_0x0e53('0x83')](_0x55eb17,{'transaction':_0x1ecccc});});}else{_0x1cd2e2=0x194;_0x4fbdb5=[];}});})[_0x0e53('0x3a')](function(){if(_0x1cd2e2!==0x194){return db['WhatsappApplication'][_0x0e53('0x84')]({'where':{'WhatsappAccountId':_0x502f5b},'order':_0x0e53('0x85')})[_0x0e53('0x3a')](function(_0x17b405){_0x4fbdb5=_0x17b405;});}})[_0x0e53('0x2d')](function(_0x52d3a5){_0x1cd2e2=0x1f4;logger[_0x0e53('0x29')](_0x52d3a5[_0x0e53('0x3e')]);if(_0x52d3a5['name']){delete _0x52d3a5[_0x0e53('0x3f')];}_0x4fbdb5=_0x52d3a5;})['finally'](function(){if(_0x4fbdb5===null){_0x55babf['sendStatus'](_0x1cd2e2);}else{if(_0x1cd2e2===0x1f4){_0x55babf[_0x0e53('0x2f')](_0x1cd2e2)[_0x0e53('0x40')](_0x4fbdb5);}else{_0x55babf[_0x0e53('0x2f')](_0x1cd2e2)[_0x0e53('0x31')](_0x4fbdb5);}}});};exports[_0x0e53('0x86')]=function(_0x452b96,_0x2c12a2,_0x395749){var _0x2b5098={};var _0x2faa32={};var _0x5ee526;var _0x20430e;return db['WhatsappAccount']['findOne']({'where':{'id':_0x452b96[_0x0e53('0x66')]['id']}})[_0x0e53('0x3a')](handleEntityNotFound(_0x2c12a2,null))[_0x0e53('0x3a')](function(_0x4f5dc2){if(_0x4f5dc2){_0x5ee526=_0x4f5dc2;_0x2faa32['model']=_[_0x0e53('0x49')](db[_0x0e53('0x87')][_0x0e53('0x44')]);_0x2faa32[_0x0e53('0x4a')]=_[_0x0e53('0x49')](_0x452b96['query']);_0x2faa32['filters']=_['intersection'](_0x2faa32[_0x0e53('0x48')],_0x2faa32[_0x0e53('0x4a')]);_0x2b5098[_0x0e53('0x4e')]=_[_0x0e53('0x4c')](_0x2faa32[_0x0e53('0x48')],qs['fields'](_0x452b96[_0x0e53('0x4a')]['fields']));_0x2b5098[_0x0e53('0x4e')]=_0x2b5098[_0x0e53('0x4e')][_0x0e53('0x4f')]?_0x2b5098[_0x0e53('0x4e')]:_0x2faa32[_0x0e53('0x48')];_0x2b5098[_0x0e53('0x6d')]=qs[_0x0e53('0x51')](_0x452b96[_0x0e53('0x4a')][_0x0e53('0x51')]);_0x2b5098[_0x0e53('0x52')]=qs['filters'](_[_0x0e53('0x53')](_0x452b96[_0x0e53('0x4a')],_0x2faa32[_0x0e53('0x4b')]));if(_0x452b96[_0x0e53('0x4a')]['filter']){_0x2b5098[_0x0e53('0x52')]=_[_0x0e53('0x55')](_0x2b5098[_0x0e53('0x52')],{'$or':_['map'](_0x2b5098['attributes'],function(_0x16867b){var _0x214038={};_0x214038[_0x16867b]={'$like':'%'+_0x452b96[_0x0e53('0x4a')][_0x0e53('0x54')]+'%'};return _0x214038;})});}_0x2b5098=_[_0x0e53('0x55')]({},_0x2b5098,_0x452b96['options']);return _0x5ee526[_0x0e53('0x86')](_0x2b5098);}})[_0x0e53('0x3a')](function(_0x353330){if(_0x353330){_0x20430e=_0x353330[_0x0e53('0x4f')];if(!_0x452b96[_0x0e53('0x4a')][_0x0e53('0x73')](_0x0e53('0x50'))){_0x2b5098[_0x0e53('0x34')]=qs[_0x0e53('0x34')](_0x452b96['query'][_0x0e53('0x34')]);_0x2b5098[_0x0e53('0x32')]=qs[_0x0e53('0x32')](_0x452b96['query'][_0x0e53('0x32')]);}return _0x5ee526[_0x0e53('0x86')](_0x2b5098);}})['then'](function(_0xca8ce7){if(_0xca8ce7){return _0xca8ce7?{'count':_0x20430e,'rows':_0xca8ce7}:null;}})['then'](respondWithResult(_0x2c12a2,null))[_0x0e53('0x2d')](handleError(_0x2c12a2,null));};exports[_0x0e53('0x88')]=function(_0xfcd1b4,_0x4a98dd,_0x5162c1){var _0x26fc91={'channel':_0x0e53('0x89')};var _0x576395=[];var _0x32a998=[];var _0x557bb1={};return db[_0x0e53('0x58')]['find']({'where':{'id':_0xfcd1b4[_0x0e53('0x66')]['id']},'include':[{'model':db[_0x0e53('0x87')],'as':_0x0e53('0x8a')}]})[_0x0e53('0x3a')](handleEntityNotFound(_0x4a98dd,null))[_0x0e53('0x3a')](function(_0x1ebb2c){_0x26fc91[_0x0e53('0x8b')]=_0x1ebb2c;if(_0x26fc91[_0x0e53('0x8b')]&&_0x26fc91[_0x0e53('0x8b')]['type']===_0x0e53('0x8c')&&_0xfcd1b4['body'][_0x0e53('0x8d')]){if(_0xfcd1b4[_0x0e53('0x60')][_0x0e53('0x8d')][_0x0e53('0x4f')]===0x0)return;if(_0xfcd1b4[_0x0e53('0x60')]['statuses'][0x0][_0x0e53('0x8e')]!==_0x0e53('0x8f'))return;return db[_0x0e53('0x90')][_0x0e53('0x39')]({'read':!![],'readAt':_0xfcd1b4[_0x0e53('0x60')][_0x0e53('0x8d')][0x0]['timestamp']},{'where':{'messageId':_0xfcd1b4[_0x0e53('0x60')]['statuses'][0x0][_0x0e53('0x91')]},'individualHooks':!![]})['then'](function(_0x34c109){return _0x4a98dd['status'](0xc8)[_0x0e53('0x31')](_0x34c109);});}_0x26fc91[_0x0e53('0x92')]=_[_0x0e53('0x93')](_0x1ebb2c['Applications'],[_0x0e53('0x85')],[_0x0e53('0x94')]);if(_0x26fc91[_0x0e53('0x8b')][_0x0e53('0x8a')]){delete _0x26fc91[_0x0e53('0x8b')][_0x0e53('0x8a')];}return db[_0x0e53('0x95')][_0x0e53('0x67')]()[_0x0e53('0x3a')](function(_0x694a8b){if(!_0x694a8b){throw new db['Sequelize'][(_0x0e53('0x96'))](_0x0e53('0x97'));}_0x576395=_['difference'](_[_0x0e53('0x49')](_0x694a8b),[_0x0e53('0x98'),_0x0e53('0x99')]);_0x32a998=_[_0x0e53('0x9a')](_[_0x0e53('0x49')](_0x694a8b),[_0x0e53('0x98'),_0x0e53('0x99'),'CompanyId',_0x0e53('0x9b')]);_0x26fc91[_0x0e53('0x60')]={'mapKey':_0x0e53('0x9c')};if(_0x26fc91[_0x0e53('0x8b')]&&_0x26fc91[_0x0e53('0x8b')][_0x0e53('0x46')]===_0x0e53('0x9d')){_0x26fc91[_0x0e53('0x60')][_0x0e53('0x9e')]=_0xfcd1b4[_0x0e53('0x60')][_0x0e53('0x9f')][_0x0e53('0xa0')](_0x0e53('0xa1'),'');_0x26fc91[_0x0e53('0x60')]['body']=_0xfcd1b4[_0x0e53('0x60')][_0x0e53('0xa2')];_0x26fc91[_0x0e53('0x60')][_0x0e53('0xa3')]=_0xfcd1b4[_0x0e53('0x60')][_0x0e53('0xa4')];}if(_0x26fc91['account']&&_0x26fc91[_0x0e53('0x8b')][_0x0e53('0x46')]==='sinch'){_0x26fc91[_0x0e53('0x60')][_0x0e53('0x9e')]=_0xfcd1b4['body'][_0x0e53('0xa5')][0x0][_0x0e53('0x9e')];_0x26fc91[_0x0e53('0x60')]['body']=_0xfcd1b4[_0x0e53('0x60')][_0x0e53('0xa5')][0x0]['message'][_0x0e53('0x60')];_0x26fc91[_0x0e53('0x60')][_0x0e53('0xa3')]=_0xfcd1b4['body'][_0x0e53('0xa5')][0x0]['message_id'];}if(_0x26fc91[_0x0e53('0x60')]['id']){delete _0x26fc91[_0x0e53('0x60')]['id'];}if(_[_0x0e53('0xa6')](_0x26fc91[_0x0e53('0x60')][_0x0e53('0x9e')])){throw new db['Sequelize'][(_0x0e53('0x96'))]('from\x20is\x20mandatory');}if(_['isNil'](_0x26fc91[_0x0e53('0x60')][_0x0e53('0x60')])||_0x26fc91[_0x0e53('0x60')][_0x0e53('0x60')]===''){throw new db[(_0x0e53('0xa7'))][(_0x0e53('0x96'))](_0x0e53('0xa8'));}if(_['isNil'](_0x26fc91[_0x0e53('0x60')][_0x0e53('0xa9')])){throw new db['Sequelize'][(_0x0e53('0x96'))](_0x0e53('0xaa')+_0x32a998);}if(!_['includes'](_0x32a998,_0x26fc91['body'][_0x0e53('0xa9')])){throw new db['Sequelize'][(_0x0e53('0x96'))](_0x0e53('0xab')+_0x32a998);}_0x557bb1[_0x26fc91[_0x0e53('0x60')][_0x0e53('0xa9')]]=_0x26fc91[_0x0e53('0x60')][_0x0e53('0x9e')];return db[_0x0e53('0xac')]['find']({'where':{'id':_0x26fc91['account']['ListId']},'include':[{'model':db[_0x0e53('0x95')],'as':_0x0e53('0xad'),'where':_0x557bb1,'limit':0x1,'order':[[_0x0e53('0x99'),_0x0e53('0xae')]]}]});})[_0x0e53('0x3a')](handleEntityNotFound(_0x4a98dd,null))[_0x0e53('0x3a')](function(_0xf4fa98){if(_0xf4fa98){_0x26fc91[_0x0e53('0xaf')]=_[_0x0e53('0x77')](_0xf4fa98,[_0x0e53('0xad')]);if(_0xf4fa98[_0x0e53('0xad')][_0x0e53('0x4f')]){return _0xf4fa98[_0x0e53('0xad')][0x0];}var _0x5a6a04=_[_0x0e53('0x1a')](_0x26fc91[_0x0e53('0x60')],{'firstName':_0x26fc91[_0x0e53('0x60')][_0x0e53('0x9e')],'ListId':_0xf4fa98['id']});_0x5a6a04[_0x26fc91[_0x0e53('0x60')]['mapKey']]=_0x26fc91[_0x0e53('0x60')][_0x0e53('0x9e')];return db['CmContact']['create'](_0x5a6a04,{'fields':_0x576395,'raw':!![]});}})[_0x0e53('0x3a')](handleEntityNotFound(_0x4a98dd,null))[_0x0e53('0x3a')](function(_0x116225){if(_0x116225){_0x26fc91[_0x0e53('0xb0')]=_0x116225;var _0x43b7ca={'ContactId':_0x116225['id'],'phone':_0x26fc91['body'][_0x0e53('0x9e')],'WhatsappAccountId':_0xfcd1b4[_0x0e53('0x66')]['id']};var _0x252cce={'ContactId':_0x116225['id'],'WhatsappAccountId':_0xfcd1b4[_0x0e53('0x66')]['id'],'closed':![]};return db['WhatsappInteraction']['find']({'where':_0x252cce})[_0x0e53('0x3a')](function(_0xbad93b){if(_0xbad93b){return[_0xbad93b,![]];}return db[_0x0e53('0xb1')][_0x0e53('0x5f')](_0x43b7ca)[_0x0e53('0x3a')](function(_0x1ef0c8){return[_0x1ef0c8,!![]];});});}})[_0x0e53('0xb2')](function(_0x45dcec,_0x9a1862){_0x26fc91['interaction']=_0x45dcec[_0x0e53('0x3c')]({'plain':!![]});_0x26fc91[_0x0e53('0xb3')][_0x0e53('0xb4')]=![];if(_0x9a1862){if(_0x26fc91[_0x0e53('0x8b')][_0x0e53('0xb5')]){_0x26fc91[_0x0e53('0x92')]['push']({'id':0x0,'priority':_0x26fc91[_0x0e53('0x92')]['length']+0x1,'app':'close','appdata':'unmanaged','interval':_0x0e53('0xb6')});}_0x26fc91['interaction'][_0x0e53('0xb4')]=!![];}return db[_0x0e53('0x90')][_0x0e53('0x5f')]({'phone':_0x26fc91['body']['from'],'messageId':_0x26fc91[_0x0e53('0x60')][_0x0e53('0xa3')],'body':_0x26fc91['body'][_0x0e53('0x60')],'WhatsappAccountId':_0xfcd1b4['params']['id'],'WhatsappInteractionId':_0x45dcec['id'],'direction':'in','ContactId':_0x45dcec[_0x0e53('0xb7')],'AttachmentId':_0x26fc91[_0x0e53('0x60')][_0x0e53('0xb8')]});})[_0x0e53('0x3a')](function(_0x6a21ba){_0x26fc91[_0x0e53('0x2b')]=_0x6a21ba;if(!_0x26fc91[_0x0e53('0xb3')][_0x0e53('0xb9')])return;return db[_0x0e53('0x7e')][_0x0e53('0x5e')]({'attributes':['id','name'],'where':{'id':_0x26fc91[_0x0e53('0xb3')][_0x0e53('0xb9')]}});})[_0x0e53('0x3a')](function(_0x49e65){if(_0x49e65){_0x26fc91[_0x0e53('0x92')][_0x0e53('0xba')]({'id':0x0,'priority':0x0,'app':_0x0e53('0xbb'),'appdata':_0x49e65[_0x0e53('0x3f')]+','+(_0x26fc91[_0x0e53('0x8b')][_0x0e53('0xbc')]||0xa),'interval':_0x0e53('0xb6')});}if(!_0x26fc91[_0x0e53('0xb3')][_0x0e53('0xbd')])return;return db[_0x0e53('0xbe')][_0x0e53('0x5e')]({'attributes':['id',_0x0e53('0x3f')],'where':{'id':_0x26fc91[_0x0e53('0xb3')][_0x0e53('0xbd')]}});})[_0x0e53('0x3a')](function(_0x5f5396){if(_0x5f5396){_0x26fc91[_0x0e53('0x92')]['unshift']({'id':0x0,'priority':0x1,'app':_0x0e53('0xbf'),'appdata':_0x5f5396[_0x0e53('0x3f')]+','+(_0x26fc91[_0x0e53('0x8b')][_0x0e53('0xc0')]||0x12c),'interval':_0x0e53('0xb6')});}return respondWithRpcPromise(_0x0e53('0xc1'),_0x0e53('0xc2'),_0x26fc91);})[_0x0e53('0x3a')](function(_0x4ddfdf){if(_0x4ddfdf){var _0x44dc1d=0xc8;var _0x54dc23=_0x0e53('0xc3');logger[_0x0e53('0x23')](_0x0e53('0x27'),_0x54dc23,_0x44dc1d,'entity\x20found');logger[_0x0e53('0x26')](_0x0e53('0xc4'),_0x54dc23,_0x44dc1d,'entity\x20found',JSON['stringify'](_0x4ddfdf));if(_0x26fc91[_0x0e53('0x8b')][_0x0e53('0x46')]===_0x0e53('0x9d')){return _0x4a98dd[_0x0e53('0x2f')](_0x44dc1d)['set']('Content-Type',_0x0e53('0xc5'))[_0x0e53('0x40')](_0x0e53('0xc6'));}else{return _0x4a98dd[_0x0e53('0x2f')](_0x44dc1d)[_0x0e53('0x31')](_0x4ddfdf);}}});})['catch'](handleError(_0x4a98dd,null));};exports[_0x0e53('0x40')]=function(_0x323273,_0x3f0a17,_0x48927b){var _0x5e08f7,_0x3c191b,_0xf8510d;if(_['isNil'](_0x323273[_0x0e53('0x60')][_0x0e53('0x60')])||_0x323273[_0x0e53('0x60')][_0x0e53('0x60')]===''){throw new db[(_0x0e53('0xa7'))][(_0x0e53('0x96'))](_0x0e53('0xa8'));}if(_['isNil'](_0x323273[_0x0e53('0x60')]['to'])){throw new db[(_0x0e53('0xa7'))][(_0x0e53('0x96'))]('to\x20is\x20mandatory');}_0x5e08f7=_0x323273['body']['to'];return db[_0x0e53('0x58')][_0x0e53('0x5e')]({'where':{'id':_0x323273[_0x0e53('0x66')]['id']},'include':[{'model':db[_0x0e53('0xac')],'as':_0x0e53('0xc7'),'include':[{'model':db[_0x0e53('0x95')],'as':_0x0e53('0xad'),'where':{'mobile':_0x5e08f7},'limit':0x1,'order':[[_0x0e53('0x99'),'DESC']]}]}]})[_0x0e53('0x3a')](handleEntityNotFound(_0x3f0a17,null))['then'](function(_0x45eea6){if(_0x45eea6&&_0x45eea6[_0x0e53('0xc7')]){_0x3c191b=_0x45eea6[_0x0e53('0x3c')]({'plain':!![]});if(_0x3c191b[_0x0e53('0xc7')]&&_0x3c191b[_0x0e53('0xc7')]['Contacts'][_0x0e53('0x4f')]){return _0x3c191b[_0x0e53('0xc7')][_0x0e53('0xad')][0x0];}return db[_0x0e53('0x95')]['create'](_[_0x0e53('0x1a')](_0x323273[_0x0e53('0x60')],{'firstName':_0x5e08f7,'mobile':_0x5e08f7,'phone':_0x5e08f7,'ListId':_0x3c191b['ListId']}));}})[_0x0e53('0x3a')](handleEntityNotFound(_0x3f0a17,null))[_0x0e53('0x3a')](function(_0x389546){if(_0x389546){_0xf8510d=_0x389546;return db['WhatsappInteraction'][_0x0e53('0x5e')]({'where':{'ContactId':_0xf8510d['id'],'closed':![],'WhatsappAccountId':_0x3c191b['id']}})[_0x0e53('0x3a')](function(_0x2a6048){if(_0x2a6048){return[_0x2a6048,![]];}return db['WhatsappInteraction'][_0x0e53('0x5f')]({'UserId':_0x323273['user']['id'],'ContactId':_0xf8510d['id'],'WhatsappAccountId':_0x3c191b['id'],'phone':_0x5e08f7,'firstMsgDirection':_0x0e53('0xc8'),'Messages':[_[_0x0e53('0x55')](_0x323273[_0x0e53('0x60')],{'read':![],'body':_0x323273[_0x0e53('0x60')][_0x0e53('0x60')],'phone':_0x5e08f7,'WhatsappAccountId':_0x3c191b['id'],'UserId':_0x323273[_0x0e53('0x61')]['id'],'ContactId':_0xf8510d['id']})]},{'include':[{'model':db[_0x0e53('0x90')],'as':'Messages'}]})[_0x0e53('0x3a')](function(_0x38f006){return[_0x38f006,!![]];});});}})[_0x0e53('0xb2')](function(_0x49ed80,_0x558a73){if(_0x558a73){return _0x49ed80;}return db['WhatsappMessage'][_0x0e53('0x5f')](_[_0x0e53('0x55')](_0x323273[_0x0e53('0x60')],{'read':![],'body':_0x323273[_0x0e53('0x60')]['body'],'phone':_0x5e08f7,'WhatsappAccountId':_0x3c191b['id'],'WhatsappInteractionId':_0x49ed80['id'],'UserId':_0x323273[_0x0e53('0x61')]['id'],'ContactId':_0xf8510d['id']}))[_0x0e53('0x3a')](function(_0x46cb1d){_0x49ed80[_0x0e53('0xc9')][_0x0e53('0xca')]=[];_0x49ed80[_0x0e53('0xc9')][_0x0e53('0xca')][_0x0e53('0xcb')](_0x46cb1d['dataValues']);return _0x49ed80;});})[_0x0e53('0x3a')](respondWithResult(_0x3f0a17,null))[_0x0e53('0x2d')](handleError(_0x3f0a17,null));}; \ No newline at end of file +var _0xca79=['CmList','DESC','Contacts','contact','WhatsappInteraction','interaction','autoclose','push','close','unmanaged','*,*,*,*','created','WhatsappMessage','ContactId','AttachmentId','UserId','agent','waitForTheAssignedAgent','queueId','WhatsappQueue','waitForTheAssignedQueue','startRouting','receiveMessage','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','set','Content-Type','text/xml','\x0a','to\x20is\x20mandatory','List','ListId','out','Messages','dataValues','eml-format','zip-dir','request-promise','bluebird','mustache','util','path','ejs','fs-extra','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./whatsappAccount.socket','jayson/promise','client','http','request','then','info','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','WhatsappAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','update','destroy','get','WhatsappAccounts','UserProfileResource','stack','name','send','index','Pause','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','WhatsappAccount','includeAll','include','findAll','rows','params','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','mandatoryDispositionPause','body','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','findOne','pick','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addAgents','omit','emit','removeAgents','isArray','userWhatsappAccount:remove','User','getAgents','addApplications','transaction','Transaction','WhatsappApplication','findAndCountAll','priority','finally','getApplications','notify','Applications','account','sinch','statuses','read','applications','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','mobile','twilio','from','Body','messageId','MessageSid','notifications','message_id','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'];(function(_0x13e230,_0x4135ce){var _0x20ef25=function(_0x2004eb){while(--_0x2004eb){_0x13e230['push'](_0x13e230['shift']());}};_0x20ef25(++_0x4135ce);}(_0xca79,0xe4));var _0x9ca7=function(_0x4670c6,_0x11721d){_0x4670c6=_0x4670c6-0x0;var _0x37be44=_0xca79[_0x4670c6];return _0x37be44;};'use strict';var emlformat=require(_0x9ca7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9ca7('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9ca7('0x2'));var moment=require('moment');var BPromise=require(_0x9ca7('0x3'));var Mustache=require(_0x9ca7('0x4'));var util=require(_0x9ca7('0x5'));var path=require(_0x9ca7('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x9ca7('0x7'));var fs=require('fs');var fs_extra=require(_0x9ca7('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x9ca7('0x9'));var jsforce=require(_0x9ca7('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x9ca7('0xb'));var querystring=require(_0x9ca7('0xc'));var Papa=require('papaparse');var Redis=require(_0x9ca7('0xd'));var authService=require(_0x9ca7('0xe'));var qs=require(_0x9ca7('0xf'));var as=require(_0x9ca7('0x10'));var hardwareService=require(_0x9ca7('0x11'));var logger=require(_0x9ca7('0x12'))(_0x9ca7('0x13'));var utils=require(_0x9ca7('0x14'));var config=require(_0x9ca7('0x15'));var licenseUtil=require(_0x9ca7('0x16'));var db=require('../../mysqldb')['db'];config[_0x9ca7('0x17')]=_[_0x9ca7('0x18')](config[_0x9ca7('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x9ca7('0x19'))(new Redis(config[_0x9ca7('0x17')]));require(_0x9ca7('0x1a'))['register'](socket);var jayson=require(_0x9ca7('0x1b'));var client=jayson[_0x9ca7('0x1c')][_0x9ca7('0x1d')]({'port':0x232c});function respondWithRpcPromise(_0x150043,_0x1ba420,_0x14ac06,_0x432738){return new BPromise(function(_0x2d0518,_0x5de2d7){var _0x3b4c26=_0x432738||client;return _0x3b4c26[_0x9ca7('0x1e')](_0x150043,_0x14ac06)[_0x9ca7('0x1f')](function(_0x149f1b){logger[_0x9ca7('0x20')]('WhatsappAccount,\x20%s,\x20%s',_0x1ba420,'request\x20sent');logger[_0x9ca7('0x21')](_0x9ca7('0x22'),_0x1ba420,_0x9ca7('0x23'),JSON['stringify'](_0x149f1b));if(_0x149f1b[_0x9ca7('0x24')]){if(_0x149f1b[_0x9ca7('0x24')]['code']===0x1f4){logger['error'](_0x9ca7('0x25'),_0x1ba420,_0x149f1b[_0x9ca7('0x24')][_0x9ca7('0x26')]);return _0x5de2d7(_0x149f1b[_0x9ca7('0x24')][_0x9ca7('0x26')]);}logger[_0x9ca7('0x24')]('WhatsappAccount,\x20%s,\x20%s',_0x1ba420,_0x149f1b[_0x9ca7('0x24')]['message']);return _0x2d0518(_0x149f1b[_0x9ca7('0x24')][_0x9ca7('0x26')]);}else{logger[_0x9ca7('0x20')]('WhatsappAccount,\x20%s,\x20%s',_0x1ba420,_0x9ca7('0x23'));_0x2d0518(_0x149f1b[_0x9ca7('0x27')][_0x9ca7('0x26')]);}})[_0x9ca7('0x28')](function(_0xeaf484){logger[_0x9ca7('0x24')](_0x9ca7('0x25'),_0x1ba420,_0xeaf484);_0x5de2d7(_0xeaf484);});});}function respondWithStatusCode(_0x149c48,_0x32cb7c){_0x32cb7c=_0x32cb7c||0xcc;return function(_0x3b7135){if(_0x3b7135){return _0x149c48[_0x9ca7('0x29')](_0x32cb7c);}return _0x149c48[_0x9ca7('0x2a')](_0x32cb7c)[_0x9ca7('0x2b')]();};}function respondWithResult(_0x2581d9,_0x1806e9){_0x1806e9=_0x1806e9||0xc8;return function(_0x316ebb){if(_0x316ebb){return _0x2581d9[_0x9ca7('0x2a')](_0x1806e9)[_0x9ca7('0x2c')](_0x316ebb);}};}function respondWithFilteredResult(_0x4842e4,_0x4676bb){return function(_0x5ea6d0){if(_0x5ea6d0){var _0x2b18f9=typeof _0x4676bb[_0x9ca7('0x2d')]===_0x9ca7('0x2e')&&typeof _0x4676bb[_0x9ca7('0x2f')]===_0x9ca7('0x2e');var _0x4a01f5=_0x5ea6d0[_0x9ca7('0x30')];var _0x233ceb=_0x2b18f9?0x0:_0x4676bb[_0x9ca7('0x2d')];var _0x64e5f4=_0x2b18f9?_0x5ea6d0[_0x9ca7('0x30')]:_0x4676bb[_0x9ca7('0x2d')]+_0x4676bb[_0x9ca7('0x2f')];var _0x3f6d63;if(_0x64e5f4>=_0x4a01f5){_0x64e5f4=_0x4a01f5;_0x3f6d63=0xc8;}else{_0x3f6d63=0xce;}_0x4842e4[_0x9ca7('0x2a')](_0x3f6d63);return _0x4842e4['set'](_0x9ca7('0x31'),_0x233ceb+'-'+_0x64e5f4+'/'+_0x4a01f5)['json'](_0x5ea6d0);}return null;};}function patchUpdates(_0x527a1f){return function(_0x3e58e1){try{jsonpatch[_0x9ca7('0x32')](_0x3e58e1,_0x527a1f,!![]);}catch(_0x2c04b8){return BPromise['reject'](_0x2c04b8);}return _0x3e58e1['save']();};}function saveUpdates(_0x24f627,_0x30ab11){return function(_0x594670){if(_0x594670){return _0x594670[_0x9ca7('0x33')](_0x24f627)['then'](function(_0x58c3fd){return _0x58c3fd;});}return null;};}function removeEntity(_0x2aaf17,_0x189aec){return function(_0x1a2ad2){if(_0x1a2ad2){return _0x1a2ad2[_0x9ca7('0x34')]()[_0x9ca7('0x1f')](function(){var _0x3a9699=_0x1a2ad2[_0x9ca7('0x35')]({'plain':!![]});var _0x448dbc=_0x9ca7('0x36');return db[_0x9ca7('0x37')][_0x9ca7('0x34')]({'where':{'type':_0x448dbc,'resourceId':_0x3a9699['id']}})[_0x9ca7('0x1f')](function(){return _0x1a2ad2;});})[_0x9ca7('0x1f')](function(){_0x2aaf17[_0x9ca7('0x2a')](0xcc)[_0x9ca7('0x2b')]();});}};}function handleEntityNotFound(_0x2e26df,_0x3a323c){return function(_0x43eaa4){if(!_0x43eaa4){_0x2e26df['sendStatus'](0x194);}return _0x43eaa4;};}function handleError(_0x9064bf,_0x134ba2){_0x134ba2=_0x134ba2||0x1f4;return function(_0x438c8a){logger[_0x9ca7('0x24')](_0x438c8a[_0x9ca7('0x38')]);if(_0x438c8a['name']){delete _0x438c8a[_0x9ca7('0x39')];}_0x9064bf[_0x9ca7('0x2a')](_0x134ba2)[_0x9ca7('0x3a')](_0x438c8a);};}exports[_0x9ca7('0x3b')]=function(_0x16a4e2,_0x207d43){var _0x3aebf0={'include':[{'model':db[_0x9ca7('0x3c')],'as':'mandatoryDispositionPause'}]},_0x53b255={},_0x1e8a27={'count':0x0,'rows':[]};var _0x4cea8f=_[_0x9ca7('0x3d')](db['WhatsappAccount'][_0x9ca7('0x3e')],function(_0x3eff42){return{'name':_0x3eff42[_0x9ca7('0x3f')],'type':_0x3eff42[_0x9ca7('0x40')][_0x9ca7('0x41')]};});_0x53b255[_0x9ca7('0x42')]=_[_0x9ca7('0x3d')](_0x4cea8f,_0x9ca7('0x39'));_0x53b255[_0x9ca7('0x43')]=_[_0x9ca7('0x44')](_0x16a4e2[_0x9ca7('0x43')]);_0x53b255[_0x9ca7('0x45')]=_[_0x9ca7('0x46')](_0x53b255[_0x9ca7('0x42')],_0x53b255[_0x9ca7('0x43')]);_0x3aebf0['attributes']=_[_0x9ca7('0x46')](_0x53b255['model'],qs[_0x9ca7('0x47')](_0x16a4e2[_0x9ca7('0x43')][_0x9ca7('0x47')]));_0x3aebf0[_0x9ca7('0x48')]=_0x3aebf0[_0x9ca7('0x48')][_0x9ca7('0x49')]?_0x3aebf0['attributes']:_0x53b255[_0x9ca7('0x42')];if(!_0x16a4e2[_0x9ca7('0x43')][_0x9ca7('0x4a')](_0x9ca7('0x4b'))){_0x3aebf0[_0x9ca7('0x2f')]=qs[_0x9ca7('0x2f')](_0x16a4e2[_0x9ca7('0x43')][_0x9ca7('0x2f')]);_0x3aebf0[_0x9ca7('0x2d')]=qs[_0x9ca7('0x2d')](_0x16a4e2[_0x9ca7('0x43')][_0x9ca7('0x2d')]);}_0x3aebf0[_0x9ca7('0x4c')]=qs[_0x9ca7('0x4d')](_0x16a4e2[_0x9ca7('0x43')][_0x9ca7('0x4d')]);_0x3aebf0[_0x9ca7('0x4e')]=qs['filters'](_['pick'](_0x16a4e2[_0x9ca7('0x43')],_0x53b255['filters']),_0x4cea8f);if(_0x16a4e2[_0x9ca7('0x43')][_0x9ca7('0x4f')]){_0x3aebf0[_0x9ca7('0x4e')]=_[_0x9ca7('0x50')](_0x3aebf0[_0x9ca7('0x4e')],{'$or':_[_0x9ca7('0x3d')](_0x4cea8f,function(_0x52ba65){if(_0x52ba65[_0x9ca7('0x40')]!=='VIRTUAL'){var _0xa9c9a={};_0xa9c9a[_0x52ba65[_0x9ca7('0x39')]]={'$like':'%'+_0x16a4e2[_0x9ca7('0x43')][_0x9ca7('0x4f')]+'%'};return _0xa9c9a;}})});}_0x3aebf0=_[_0x9ca7('0x50')]({},_0x3aebf0,_0x16a4e2[_0x9ca7('0x51')]);var _0x9cf980={'where':_0x3aebf0['where']};return db[_0x9ca7('0x52')]['count'](_0x9cf980)[_0x9ca7('0x1f')](function(_0x18efb7){_0x1e8a27[_0x9ca7('0x30')]=_0x18efb7;if(_0x16a4e2[_0x9ca7('0x43')][_0x9ca7('0x53')]){_0x3aebf0[_0x9ca7('0x54')]=[{'all':!![]}];}return db[_0x9ca7('0x52')][_0x9ca7('0x55')](_0x3aebf0);})[_0x9ca7('0x1f')](function(_0x59df3e){_0x1e8a27[_0x9ca7('0x56')]=_0x59df3e;return _0x1e8a27;})[_0x9ca7('0x1f')](respondWithFilteredResult(_0x207d43,_0x3aebf0))[_0x9ca7('0x28')](handleError(_0x207d43,null));};exports['show']=function(_0x5e42bd,_0x579f94){var _0x423ea2={'raw':![],'where':{'id':_0x5e42bd[_0x9ca7('0x57')]['id']},'include':[{'model':db[_0x9ca7('0x3c')],'as':'mandatoryDispositionPause'}]},_0x2493f3={};_0x2493f3[_0x9ca7('0x42')]=_[_0x9ca7('0x44')](db[_0x9ca7('0x52')][_0x9ca7('0x3e')]);_0x2493f3[_0x9ca7('0x43')]=_[_0x9ca7('0x44')](_0x5e42bd[_0x9ca7('0x43')]);_0x2493f3[_0x9ca7('0x45')]=_[_0x9ca7('0x46')](_0x2493f3[_0x9ca7('0x42')],_0x2493f3[_0x9ca7('0x43')]);_0x423ea2[_0x9ca7('0x48')]=_['intersection'](_0x2493f3['model'],qs[_0x9ca7('0x47')](_0x5e42bd['query'][_0x9ca7('0x47')]));_0x423ea2[_0x9ca7('0x48')]=_0x423ea2[_0x9ca7('0x48')][_0x9ca7('0x49')]?_0x423ea2[_0x9ca7('0x48')]:_0x2493f3['model'];if(_0x5e42bd['query'][_0x9ca7('0x53')]){_0x423ea2[_0x9ca7('0x54')]=[{'all':!![]}];}_0x423ea2=_[_0x9ca7('0x50')]({},_0x423ea2,_0x5e42bd[_0x9ca7('0x51')]);return db[_0x9ca7('0x52')][_0x9ca7('0x58')](_0x423ea2)[_0x9ca7('0x1f')](handleEntityNotFound(_0x579f94,null))[_0x9ca7('0x1f')](respondWithResult(_0x579f94,null))[_0x9ca7('0x28')](handleError(_0x579f94,null));};exports[_0x9ca7('0x59')]=function(_0x3caf17,_0x35df13){return db[_0x9ca7('0x52')][_0x9ca7('0x59')](_0x3caf17['body'],{})[_0x9ca7('0x1f')](function(_0x4cb09f){var _0x5e720b=_0x3caf17['user'][_0x9ca7('0x35')]({'plain':!![]});if(!_0x5e720b)throw new Error(_0x9ca7('0x5a'));if(_0x5e720b[_0x9ca7('0x5b')]===_0x9ca7('0x5c')){var _0x1c301d=_0x4cb09f[_0x9ca7('0x35')]({'plain':!![]});var _0xaf810a=_0x9ca7('0x36');return db[_0x9ca7('0x5d')][_0x9ca7('0x58')]({'where':{'name':_0xaf810a,'userProfileId':_0x5e720b['userProfileId']},'raw':!![]})[_0x9ca7('0x1f')](function(_0x58cb65){if(_0x58cb65&&_0x58cb65[_0x9ca7('0x5e')]===0x0){return db['UserProfileResource'][_0x9ca7('0x59')]({'name':_0x1c301d['name'],'resourceId':_0x1c301d['id'],'type':_0x58cb65['name'],'sectionId':_0x58cb65['id']},{})[_0x9ca7('0x1f')](function(){return _0x4cb09f;});}else{return _0x4cb09f;}})[_0x9ca7('0x28')](function(_0x408551){logger[_0x9ca7('0x24')](_0x9ca7('0x5f'),_0x408551);throw _0x408551;});}return _0x4cb09f;})['then'](respondWithResult(_0x35df13,0xc9))['catch'](handleError(_0x35df13,null));};exports['update']=function(_0x144683,_0x29d6b9){if(_0x144683['body']['id']){delete _0x144683['body']['id'];}return db[_0x9ca7('0x52')]['find']({'where':{'id':_0x144683[_0x9ca7('0x57')]['id']},'include':[{'model':db[_0x9ca7('0x3c')],'as':_0x9ca7('0x60')}]})[_0x9ca7('0x1f')](handleEntityNotFound(_0x29d6b9,null))[_0x9ca7('0x1f')](saveUpdates(_0x144683[_0x9ca7('0x61')],null))[_0x9ca7('0x1f')](respondWithResult(_0x29d6b9,null))['catch'](handleError(_0x29d6b9,null));};exports[_0x9ca7('0x34')]=function(_0x4d2aac,_0x1e0a0f){return db[_0x9ca7('0x52')][_0x9ca7('0x58')]({'where':{'id':_0x4d2aac[_0x9ca7('0x57')]['id']}})[_0x9ca7('0x1f')](handleEntityNotFound(_0x1e0a0f,null))[_0x9ca7('0x1f')](removeEntity(_0x1e0a0f,null))['catch'](handleError(_0x1e0a0f,null));};exports[_0x9ca7('0x62')]=function(_0x131096,_0x457ab5){return db[_0x9ca7('0x52')]['describe']()[_0x9ca7('0x1f')](respondWithResult(_0x457ab5,null))[_0x9ca7('0x28')](handleError(_0x457ab5,null));};exports[_0x9ca7('0x63')]=function(_0x43a370,_0x441ffd,_0x524198){if(_0x43a370['body']['id']){delete _0x43a370[_0x9ca7('0x61')]['id'];}return db[_0x9ca7('0x52')][_0x9ca7('0x58')]({'where':{'id':_0x43a370[_0x9ca7('0x57')]['id']}})[_0x9ca7('0x1f')](handleEntityNotFound(_0x441ffd,null))[_0x9ca7('0x1f')](function(_0x3c4344){if(_0x3c4344){_0x43a370[_0x9ca7('0x61')][_0x9ca7('0x64')]=_0x3c4344['id'];return db[_0x9ca7('0x65')][_0x9ca7('0x59')](_0x43a370[_0x9ca7('0x61')]);}})[_0x9ca7('0x1f')](respondWithResult(_0x441ffd,null))['catch'](handleError(_0x441ffd,null));};exports[_0x9ca7('0x66')]=function(_0x540ac9,_0x3f4938,_0x5a2f3b){var _0x7a5ea={'raw':![],'where':{}};var _0x1b7641={};var _0x5a0ffc={'count':0x0,'rows':[]};return db[_0x9ca7('0x52')][_0x9ca7('0x67')]({'where':{'id':_0x540ac9[_0x9ca7('0x57')]['id']}})[_0x9ca7('0x1f')](handleEntityNotFound(_0x3f4938,null))[_0x9ca7('0x1f')](function(_0xf1e5c6){if(_0xf1e5c6){_0x1b7641[_0x9ca7('0x42')]=_[_0x9ca7('0x44')](db['Disposition']['rawAttributes']);_0x1b7641[_0x9ca7('0x43')]=_['keys'](_0x540ac9['query']);_0x1b7641[_0x9ca7('0x45')]=_[_0x9ca7('0x46')](_0x1b7641[_0x9ca7('0x42')],_0x1b7641['query']);_0x7a5ea[_0x9ca7('0x48')]=_[_0x9ca7('0x46')](_0x1b7641[_0x9ca7('0x42')],qs[_0x9ca7('0x47')](_0x540ac9['query']['fields']));_0x7a5ea[_0x9ca7('0x48')]=_0x7a5ea['attributes'][_0x9ca7('0x49')]?_0x7a5ea[_0x9ca7('0x48')]:_0x1b7641[_0x9ca7('0x42')];if(!_0x540ac9[_0x9ca7('0x43')]['hasOwnProperty'](_0x9ca7('0x4b'))){_0x7a5ea['limit']=qs['limit'](_0x540ac9[_0x9ca7('0x43')][_0x9ca7('0x2f')]);_0x7a5ea[_0x9ca7('0x2d')]=qs[_0x9ca7('0x2d')](_0x540ac9[_0x9ca7('0x43')][_0x9ca7('0x2d')]);}_0x7a5ea['order']=qs[_0x9ca7('0x4d')](_0x540ac9[_0x9ca7('0x43')]['sort']);_0x7a5ea[_0x9ca7('0x4e')]=qs[_0x9ca7('0x45')](_[_0x9ca7('0x68')](_0x540ac9[_0x9ca7('0x43')],_0x1b7641[_0x9ca7('0x45')]));_0x7a5ea[_0x9ca7('0x4e')]['WhatsappAccountId']=_0xf1e5c6['id'];if(_0x540ac9['query'][_0x9ca7('0x4f')]){_0x7a5ea[_0x9ca7('0x4e')]=_['merge'](_0x7a5ea[_0x9ca7('0x4e')],{'$or':_[_0x9ca7('0x3d')](_0x7a5ea[_0x9ca7('0x48')],function(_0x5c2dab){var _0xf23af4={};_0xf23af4[_0x5c2dab]={'$like':'%'+_0x540ac9[_0x9ca7('0x43')][_0x9ca7('0x4f')]+'%'};return _0xf23af4;})});}_0x7a5ea=_[_0x9ca7('0x50')]({},_0x7a5ea,_0x540ac9['options']);return db[_0x9ca7('0x65')][_0x9ca7('0x30')]({'where':_0x7a5ea[_0x9ca7('0x4e')]})[_0x9ca7('0x1f')](function(_0x5c3de2){_0x5a0ffc['count']=_0x5c3de2;if(_0x540ac9[_0x9ca7('0x43')]['includeAll']){_0x7a5ea[_0x9ca7('0x54')]=[{'all':!![]}];}return db[_0x9ca7('0x65')]['findAll'](_0x7a5ea);})[_0x9ca7('0x1f')](function(_0x16336a){_0x5a0ffc[_0x9ca7('0x56')]=_0x16336a;return _0x5a0ffc;});}})[_0x9ca7('0x1f')](respondWithFilteredResult(_0x3f4938,_0x7a5ea))[_0x9ca7('0x28')](handleError(_0x3f4938,null));};exports[_0x9ca7('0x69')]=function(_0x3c198e,_0x468711,_0x449849){return db[_0x9ca7('0x52')][_0x9ca7('0x58')]({'where':{'id':_0x3c198e['params']['id']}})[_0x9ca7('0x1f')](handleEntityNotFound(_0x468711,null))[_0x9ca7('0x1f')](function(_0x3df678){if(_0x3df678){return _0x3df678[_0x9ca7('0x69')](_0x3c198e[_0x9ca7('0x43')][_0x9ca7('0x6a')]);}})['then'](respondWithStatusCode(_0x468711,null))[_0x9ca7('0x28')](handleError(_0x468711,null));};exports[_0x9ca7('0x6b')]=function(_0x51e894,_0x345a90,_0x1ba1fa){if(_0x51e894[_0x9ca7('0x61')]['id']){delete _0x51e894['body']['id'];}return db[_0x9ca7('0x52')][_0x9ca7('0x58')]({'where':{'id':_0x51e894[_0x9ca7('0x57')]['id']}})[_0x9ca7('0x1f')](handleEntityNotFound(_0x345a90,null))[_0x9ca7('0x1f')](function(_0x5aafb0){if(_0x5aafb0){_0x51e894[_0x9ca7('0x61')][_0x9ca7('0x64')]=_0x5aafb0['id'];return db[_0x9ca7('0x6c')][_0x9ca7('0x59')](_0x51e894[_0x9ca7('0x61')]);}})[_0x9ca7('0x1f')](respondWithResult(_0x345a90,null))[_0x9ca7('0x28')](handleError(_0x345a90,null));};exports[_0x9ca7('0x6d')]=function(_0x3b3795,_0x523c08,_0x43ea5f){var _0x22df56={'raw':![],'where':{}};var _0xeac2bb={};var _0x6852ab={'count':0x0,'rows':[]};return db[_0x9ca7('0x52')][_0x9ca7('0x67')]({'where':{'id':_0x3b3795['params']['id']}})[_0x9ca7('0x1f')](handleEntityNotFound(_0x523c08,null))[_0x9ca7('0x1f')](function(_0x566e8b){if(_0x566e8b){_0xeac2bb[_0x9ca7('0x42')]=_[_0x9ca7('0x44')](db['CannedAnswer'][_0x9ca7('0x3e')]);_0xeac2bb['query']=_[_0x9ca7('0x44')](_0x3b3795[_0x9ca7('0x43')]);_0xeac2bb[_0x9ca7('0x45')]=_[_0x9ca7('0x46')](_0xeac2bb[_0x9ca7('0x42')],_0xeac2bb['query']);_0x22df56[_0x9ca7('0x48')]=_['intersection'](_0xeac2bb[_0x9ca7('0x42')],qs[_0x9ca7('0x47')](_0x3b3795[_0x9ca7('0x43')][_0x9ca7('0x47')]));_0x22df56['attributes']=_0x22df56[_0x9ca7('0x48')]['length']?_0x22df56[_0x9ca7('0x48')]:_0xeac2bb[_0x9ca7('0x42')];if(!_0x3b3795[_0x9ca7('0x43')][_0x9ca7('0x4a')](_0x9ca7('0x4b'))){_0x22df56['limit']=qs[_0x9ca7('0x2f')](_0x3b3795[_0x9ca7('0x43')][_0x9ca7('0x2f')]);_0x22df56[_0x9ca7('0x2d')]=qs[_0x9ca7('0x2d')](_0x3b3795[_0x9ca7('0x43')][_0x9ca7('0x2d')]);}_0x22df56[_0x9ca7('0x4c')]=qs[_0x9ca7('0x4d')](_0x3b3795['query'][_0x9ca7('0x4d')]);_0x22df56[_0x9ca7('0x4e')]=qs[_0x9ca7('0x45')](_[_0x9ca7('0x68')](_0x3b3795[_0x9ca7('0x43')],_0xeac2bb[_0x9ca7('0x45')]));_0x22df56[_0x9ca7('0x4e')][_0x9ca7('0x64')]=_0x566e8b['id'];if(_0x3b3795[_0x9ca7('0x43')]['filter']){_0x22df56[_0x9ca7('0x4e')]=_[_0x9ca7('0x50')](_0x22df56[_0x9ca7('0x4e')],{'$or':_[_0x9ca7('0x3d')](_0x22df56[_0x9ca7('0x48')],function(_0x41eecd){var _0x47bb7f={};_0x47bb7f[_0x41eecd]={'$like':'%'+_0x3b3795[_0x9ca7('0x43')]['filter']+'%'};return _0x47bb7f;})});}_0x22df56=_[_0x9ca7('0x50')]({},_0x22df56,_0x3b3795[_0x9ca7('0x51')]);return db[_0x9ca7('0x6c')][_0x9ca7('0x30')]({'where':_0x22df56[_0x9ca7('0x4e')]})[_0x9ca7('0x1f')](function(_0x15b5a9){_0x6852ab[_0x9ca7('0x30')]=_0x15b5a9;if(_0x3b3795['query'][_0x9ca7('0x53')]){_0x22df56[_0x9ca7('0x54')]=[{'all':!![]}];}return db[_0x9ca7('0x6c')][_0x9ca7('0x55')](_0x22df56);})[_0x9ca7('0x1f')](function(_0x57cec6){_0x6852ab[_0x9ca7('0x56')]=_0x57cec6;return _0x6852ab;});}})[_0x9ca7('0x1f')](respondWithFilteredResult(_0x523c08,_0x22df56))[_0x9ca7('0x28')](handleError(_0x523c08,null));};exports[_0x9ca7('0x6e')]=function(_0x45c22b,_0x5e11e8,_0x279a2b){return db[_0x9ca7('0x52')][_0x9ca7('0x58')]({'where':{'id':_0x45c22b[_0x9ca7('0x57')]['id']}})['then'](handleEntityNotFound(_0x5e11e8,null))[_0x9ca7('0x1f')](function(_0x247801){if(_0x247801){return _0x247801[_0x9ca7('0x6e')](_0x45c22b[_0x9ca7('0x43')]['ids']);}})['then'](respondWithStatusCode(_0x5e11e8,null))[_0x9ca7('0x28')](handleError(_0x5e11e8,null));};exports['addAgents']=function(_0x1651c4,_0x5394c7,_0x306293){return db[_0x9ca7('0x52')]['find']({'where':{'id':_0x1651c4[_0x9ca7('0x57')]['id']}})[_0x9ca7('0x1f')](handleEntityNotFound(_0x5394c7,null))[_0x9ca7('0x1f')](function(_0x3c84d7){if(_0x3c84d7){return _0x3c84d7[_0x9ca7('0x6f')](_0x1651c4[_0x9ca7('0x61')]['ids'],_[_0x9ca7('0x70')](_0x1651c4['body'],[_0x9ca7('0x6a'),'id'])||{})['spread'](function(_0x7cf4ac){for(var _0x15f619=0x0;_0x15f619<_0x1651c4[_0x9ca7('0x61')][_0x9ca7('0x6a')][_0x9ca7('0x49')];_0x15f619+=0x1){socket[_0x9ca7('0x71')]('userWhatsappAccount:save',{'UserId':Number(_0x1651c4[_0x9ca7('0x61')][_0x9ca7('0x6a')][_0x15f619]),'WhatsappAccountId':Number(_0x1651c4[_0x9ca7('0x57')]['id'])});}return _0x7cf4ac;});}})[_0x9ca7('0x1f')](respondWithResult(_0x5394c7,null))[_0x9ca7('0x28')](handleError(_0x5394c7,null));};exports[_0x9ca7('0x72')]=function(_0x2b85ce,_0x79fee3,_0x400c30){return db[_0x9ca7('0x52')][_0x9ca7('0x58')]({'where':{'id':_0x2b85ce['params']['id']}})['then'](handleEntityNotFound(_0x79fee3,null))[_0x9ca7('0x1f')](function(_0x545369){if(_0x545369){return _0x545369[_0x9ca7('0x72')](_0x2b85ce[_0x9ca7('0x43')][_0x9ca7('0x6a')])[_0x9ca7('0x1f')](function(){if(_[_0x9ca7('0x73')](_0x2b85ce[_0x9ca7('0x43')][_0x9ca7('0x6a')])){for(var _0x1241d1=0x0;_0x1241d1<_0x2b85ce[_0x9ca7('0x43')][_0x9ca7('0x6a')][_0x9ca7('0x49')];_0x1241d1+=0x1){socket[_0x9ca7('0x71')](_0x9ca7('0x74'),{'UserId':Number(_0x2b85ce[_0x9ca7('0x43')][_0x9ca7('0x6a')][_0x1241d1]),'WhatsappAccountId':Number(_0x2b85ce['params']['id'])});}}else{socket['emit'](_0x9ca7('0x74'),{'UserId':Number(_0x2b85ce[_0x9ca7('0x43')][_0x9ca7('0x6a')]),'WhatsappAccountId':Number(_0x2b85ce['params']['id'])});}});}})[_0x9ca7('0x1f')](respondWithStatusCode(_0x79fee3,null))[_0x9ca7('0x28')](handleError(_0x79fee3,null));};exports['getAgents']=function(_0x29571d,_0x512de6,_0x3c137b){var _0x350137={};var _0x2da659={};var _0x4fbaad;var _0x425afe;return db[_0x9ca7('0x52')][_0x9ca7('0x67')]({'where':{'id':_0x29571d[_0x9ca7('0x57')]['id']}})['then'](handleEntityNotFound(_0x512de6,null))['then'](function(_0x4465c9){if(_0x4465c9){_0x4fbaad=_0x4465c9;_0x2da659[_0x9ca7('0x42')]=_[_0x9ca7('0x44')](db[_0x9ca7('0x75')]['rawAttributes']);_0x2da659[_0x9ca7('0x43')]=_[_0x9ca7('0x44')](_0x29571d[_0x9ca7('0x43')]);_0x2da659[_0x9ca7('0x45')]=_['intersection'](_0x2da659[_0x9ca7('0x42')],_0x2da659['query']);_0x350137[_0x9ca7('0x48')]=_[_0x9ca7('0x46')](_0x2da659[_0x9ca7('0x42')],qs[_0x9ca7('0x47')](_0x29571d[_0x9ca7('0x43')][_0x9ca7('0x47')]));_0x350137[_0x9ca7('0x48')]=_0x350137['attributes'][_0x9ca7('0x49')]?_0x350137[_0x9ca7('0x48')]:_0x2da659['model'];_0x350137[_0x9ca7('0x4c')]=qs[_0x9ca7('0x4d')](_0x29571d[_0x9ca7('0x43')][_0x9ca7('0x4d')]);_0x350137['where']=qs[_0x9ca7('0x45')](_[_0x9ca7('0x68')](_0x29571d[_0x9ca7('0x43')],_0x2da659['filters']));if(_0x29571d['query'][_0x9ca7('0x4f')]){_0x350137[_0x9ca7('0x4e')]=_[_0x9ca7('0x50')](_0x350137[_0x9ca7('0x4e')],{'$or':_[_0x9ca7('0x3d')](_0x350137[_0x9ca7('0x48')],function(_0x14a8f8){var _0x3c660b={};_0x3c660b[_0x14a8f8]={'$like':'%'+_0x29571d[_0x9ca7('0x43')][_0x9ca7('0x4f')]+'%'};return _0x3c660b;})});}_0x350137=_[_0x9ca7('0x50')]({},_0x350137,_0x29571d[_0x9ca7('0x51')]);return _0x4fbaad[_0x9ca7('0x76')](_0x350137);}})['then'](function(_0x4989d7){if(_0x4989d7){_0x425afe=_0x4989d7[_0x9ca7('0x49')];if(!_0x29571d[_0x9ca7('0x43')][_0x9ca7('0x4a')](_0x9ca7('0x4b'))){_0x350137[_0x9ca7('0x2f')]=qs['limit'](_0x29571d[_0x9ca7('0x43')][_0x9ca7('0x2f')]);_0x350137[_0x9ca7('0x2d')]=qs[_0x9ca7('0x2d')](_0x29571d[_0x9ca7('0x43')][_0x9ca7('0x2d')]);}return _0x4fbaad[_0x9ca7('0x76')](_0x350137);}})[_0x9ca7('0x1f')](function(_0xd6e84){if(_0xd6e84){return _0xd6e84?{'count':_0x425afe,'rows':_0xd6e84}:null;}})['then'](respondWithResult(_0x512de6,null))[_0x9ca7('0x28')](handleError(_0x512de6,null));};exports[_0x9ca7('0x77')]=function(_0x3a3976,_0x1417fd){var _0x4b618e=_0x3a3976['params']['id'];var _0x44868d=_0x3a3976[_0x9ca7('0x61')];var _0x5ab5e3=0xc8;var _0x4aa75d=null;return db['sequelize'][_0x9ca7('0x78')]({'isolationLevel':db['sequelize'][_0x9ca7('0x79')]['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x220cc5){return db[_0x9ca7('0x52')]['findOne']({'where':{'id':_0x4b618e},'transaction':_0x220cc5})[_0x9ca7('0x1f')](function(_0x5069b4){if(_0x5069b4){return db['WhatsappApplication']['destroy']({'where':{'WhatsappAccountId':_0x4b618e},'transaction':_0x220cc5})[_0x9ca7('0x1f')](function(){var _0x1878af=_['map'](_0x44868d,function(_0x463a96){_0x463a96[_0x9ca7('0x64')]=_0x4b618e;return _0x463a96;});return db[_0x9ca7('0x7a')]['bulkCreate'](_0x1878af,{'transaction':_0x220cc5});});}else{_0x5ab5e3=0x194;_0x4aa75d=[];}});})[_0x9ca7('0x1f')](function(){if(_0x5ab5e3!==0x194){return db[_0x9ca7('0x7a')][_0x9ca7('0x7b')]({'where':{'WhatsappAccountId':_0x4b618e},'order':_0x9ca7('0x7c')})[_0x9ca7('0x1f')](function(_0x185bc0){_0x4aa75d=_0x185bc0;});}})[_0x9ca7('0x28')](function(_0x17e0c1){_0x5ab5e3=0x1f4;logger[_0x9ca7('0x24')](_0x17e0c1[_0x9ca7('0x38')]);if(_0x17e0c1[_0x9ca7('0x39')]){delete _0x17e0c1[_0x9ca7('0x39')];}_0x4aa75d=_0x17e0c1;})[_0x9ca7('0x7d')](function(){if(_0x4aa75d===null){_0x1417fd[_0x9ca7('0x29')](_0x5ab5e3);}else{if(_0x5ab5e3===0x1f4){_0x1417fd[_0x9ca7('0x2a')](_0x5ab5e3)[_0x9ca7('0x3a')](_0x4aa75d);}else{_0x1417fd[_0x9ca7('0x2a')](_0x5ab5e3)[_0x9ca7('0x2c')](_0x4aa75d);}}});};exports[_0x9ca7('0x7e')]=function(_0x5a9013,_0x426c32,_0x1113ba){var _0x1284e2={};var _0x3371a9={};var _0x2ad2b1;var _0x3f6159;return db[_0x9ca7('0x52')][_0x9ca7('0x67')]({'where':{'id':_0x5a9013['params']['id']}})[_0x9ca7('0x1f')](handleEntityNotFound(_0x426c32,null))[_0x9ca7('0x1f')](function(_0x71fe9c){if(_0x71fe9c){_0x2ad2b1=_0x71fe9c;_0x3371a9['model']=_[_0x9ca7('0x44')](db['WhatsappApplication']['rawAttributes']);_0x3371a9[_0x9ca7('0x43')]=_[_0x9ca7('0x44')](_0x5a9013[_0x9ca7('0x43')]);_0x3371a9[_0x9ca7('0x45')]=_[_0x9ca7('0x46')](_0x3371a9[_0x9ca7('0x42')],_0x3371a9[_0x9ca7('0x43')]);_0x1284e2[_0x9ca7('0x48')]=_[_0x9ca7('0x46')](_0x3371a9[_0x9ca7('0x42')],qs['fields'](_0x5a9013[_0x9ca7('0x43')]['fields']));_0x1284e2[_0x9ca7('0x48')]=_0x1284e2[_0x9ca7('0x48')][_0x9ca7('0x49')]?_0x1284e2['attributes']:_0x3371a9[_0x9ca7('0x42')];_0x1284e2['order']=qs[_0x9ca7('0x4d')](_0x5a9013[_0x9ca7('0x43')][_0x9ca7('0x4d')]);_0x1284e2[_0x9ca7('0x4e')]=qs[_0x9ca7('0x45')](_[_0x9ca7('0x68')](_0x5a9013[_0x9ca7('0x43')],_0x3371a9[_0x9ca7('0x45')]));if(_0x5a9013['query']['filter']){_0x1284e2[_0x9ca7('0x4e')]=_[_0x9ca7('0x50')](_0x1284e2[_0x9ca7('0x4e')],{'$or':_[_0x9ca7('0x3d')](_0x1284e2[_0x9ca7('0x48')],function(_0x2454b5){var _0x110bde={};_0x110bde[_0x2454b5]={'$like':'%'+_0x5a9013[_0x9ca7('0x43')][_0x9ca7('0x4f')]+'%'};return _0x110bde;})});}_0x1284e2=_[_0x9ca7('0x50')]({},_0x1284e2,_0x5a9013[_0x9ca7('0x51')]);return _0x2ad2b1[_0x9ca7('0x7e')](_0x1284e2);}})[_0x9ca7('0x1f')](function(_0x518805){if(_0x518805){_0x3f6159=_0x518805[_0x9ca7('0x49')];if(!_0x5a9013[_0x9ca7('0x43')][_0x9ca7('0x4a')](_0x9ca7('0x4b'))){_0x1284e2[_0x9ca7('0x2f')]=qs[_0x9ca7('0x2f')](_0x5a9013[_0x9ca7('0x43')][_0x9ca7('0x2f')]);_0x1284e2[_0x9ca7('0x2d')]=qs[_0x9ca7('0x2d')](_0x5a9013['query'][_0x9ca7('0x2d')]);}return _0x2ad2b1[_0x9ca7('0x7e')](_0x1284e2);}})[_0x9ca7('0x1f')](function(_0x438a9f){if(_0x438a9f){return _0x438a9f?{'count':_0x3f6159,'rows':_0x438a9f}:null;}})[_0x9ca7('0x1f')](respondWithResult(_0x426c32,null))[_0x9ca7('0x28')](handleError(_0x426c32,null));};exports[_0x9ca7('0x7f')]=function(_0x3d741f,_0x16da25,_0x803430){var _0xafbb0c={'channel':'whatsapp'};var _0x4134c7=[];var _0x464e67=[];var _0x1e195b={};return db[_0x9ca7('0x52')][_0x9ca7('0x58')]({'where':{'id':_0x3d741f[_0x9ca7('0x57')]['id']},'include':[{'model':db[_0x9ca7('0x7a')],'as':_0x9ca7('0x80')}]})[_0x9ca7('0x1f')](handleEntityNotFound(_0x16da25,null))[_0x9ca7('0x1f')](function(_0x36d3d6){_0xafbb0c[_0x9ca7('0x81')]=_0x36d3d6;if(_0xafbb0c[_0x9ca7('0x81')]&&_0xafbb0c[_0x9ca7('0x81')][_0x9ca7('0x40')]===_0x9ca7('0x82')&&_0x3d741f[_0x9ca7('0x61')][_0x9ca7('0x83')]){if(_0x3d741f[_0x9ca7('0x61')][_0x9ca7('0x83')][_0x9ca7('0x49')]===0x0)return;if(_0x3d741f[_0x9ca7('0x61')]['statuses'][0x0]['state']!==_0x9ca7('0x84'))return;return db['WhatsappMessage'][_0x9ca7('0x33')]({'read':!![],'readAt':_0x3d741f[_0x9ca7('0x61')][_0x9ca7('0x83')][0x0]['timestamp']},{'where':{'messageId':_0x3d741f[_0x9ca7('0x61')]['statuses'][0x0]['message_id']},'individualHooks':!![]})[_0x9ca7('0x1f')](function(_0x56b93d){return _0x16da25[_0x9ca7('0x2a')](0xc8)[_0x9ca7('0x2c')](_0x56b93d);});}_0xafbb0c[_0x9ca7('0x85')]=_['orderBy'](_0x36d3d6[_0x9ca7('0x80')],[_0x9ca7('0x7c')],[_0x9ca7('0x86')]);if(_0xafbb0c[_0x9ca7('0x81')]['Applications']){delete _0xafbb0c[_0x9ca7('0x81')][_0x9ca7('0x80')];}return db[_0x9ca7('0x87')]['describe']()[_0x9ca7('0x1f')](function(_0x24a7d0){if(!_0x24a7d0){throw new db[(_0x9ca7('0x88'))][(_0x9ca7('0x89'))](_0x9ca7('0x8a'));}_0x4134c7=_[_0x9ca7('0x8b')](_[_0x9ca7('0x44')](_0x24a7d0),[_0x9ca7('0x8c'),_0x9ca7('0x8d')]);_0x464e67=_[_0x9ca7('0x8b')](_[_0x9ca7('0x44')](_0x24a7d0),[_0x9ca7('0x8c'),_0x9ca7('0x8d'),_0x9ca7('0x8e'),'ListId']);_0xafbb0c[_0x9ca7('0x61')]={'mapKey':_0x9ca7('0x8f')};if(_0xafbb0c[_0x9ca7('0x81')]&&_0xafbb0c['account'][_0x9ca7('0x40')]===_0x9ca7('0x90')){_0xafbb0c[_0x9ca7('0x61')][_0x9ca7('0x91')]=_0x3d741f[_0x9ca7('0x61')]['From']['replace']('whatsapp:','');_0xafbb0c['body'][_0x9ca7('0x61')]=_0x3d741f[_0x9ca7('0x61')][_0x9ca7('0x92')];_0xafbb0c[_0x9ca7('0x61')][_0x9ca7('0x93')]=_0x3d741f[_0x9ca7('0x61')][_0x9ca7('0x94')];}if(_0xafbb0c[_0x9ca7('0x81')]&&_0xafbb0c[_0x9ca7('0x81')][_0x9ca7('0x40')]===_0x9ca7('0x82')){_0xafbb0c[_0x9ca7('0x61')][_0x9ca7('0x91')]=_0x3d741f[_0x9ca7('0x61')][_0x9ca7('0x95')][0x0][_0x9ca7('0x91')];_0xafbb0c[_0x9ca7('0x61')][_0x9ca7('0x61')]=_0x3d741f[_0x9ca7('0x61')]['notifications'][0x0]['message']['body'];_0xafbb0c['body'][_0x9ca7('0x93')]=_0x3d741f[_0x9ca7('0x61')][_0x9ca7('0x95')][0x0][_0x9ca7('0x96')];}if(_0xafbb0c['body']['id']){delete _0xafbb0c[_0x9ca7('0x61')]['id'];}if(_[_0x9ca7('0x97')](_0xafbb0c[_0x9ca7('0x61')][_0x9ca7('0x91')])){throw new db[(_0x9ca7('0x88'))][(_0x9ca7('0x89'))](_0x9ca7('0x98'));}if(_[_0x9ca7('0x97')](_0xafbb0c[_0x9ca7('0x61')]['body'])||_0xafbb0c[_0x9ca7('0x61')]['body']===''){throw new db[(_0x9ca7('0x88'))][(_0x9ca7('0x89'))](_0x9ca7('0x99'));}if(_[_0x9ca7('0x97')](_0xafbb0c[_0x9ca7('0x61')][_0x9ca7('0x9a')])){throw new db[(_0x9ca7('0x88'))][(_0x9ca7('0x89'))](_0x9ca7('0x9b')+_0x464e67);}if(!_[_0x9ca7('0x9c')](_0x464e67,_0xafbb0c[_0x9ca7('0x61')][_0x9ca7('0x9a')])){throw new db[(_0x9ca7('0x88'))][(_0x9ca7('0x89'))](_0x9ca7('0x9d')+_0x464e67);}_0x1e195b[_0xafbb0c[_0x9ca7('0x61')]['mapKey']]=_0xafbb0c[_0x9ca7('0x61')]['from'];return db[_0x9ca7('0x9e')][_0x9ca7('0x58')]({'where':{'id':_0xafbb0c[_0x9ca7('0x81')]['ListId']},'include':[{'model':db[_0x9ca7('0x87')],'as':'Contacts','where':_0x1e195b,'limit':0x1,'order':[['updatedAt',_0x9ca7('0x9f')]]}]});})[_0x9ca7('0x1f')](handleEntityNotFound(_0x16da25,null))[_0x9ca7('0x1f')](function(_0x4d86d2){if(_0x4d86d2){_0xafbb0c['list']=_[_0x9ca7('0x70')](_0x4d86d2,['Contacts']);if(_0x4d86d2[_0x9ca7('0xa0')]['length']){return _0x4d86d2[_0x9ca7('0xa0')][0x0];}var _0x15a165=_[_0x9ca7('0x18')](_0xafbb0c[_0x9ca7('0x61')],{'firstName':_0xafbb0c[_0x9ca7('0x61')][_0x9ca7('0x91')],'ListId':_0x4d86d2['id']});_0x15a165[_0xafbb0c[_0x9ca7('0x61')][_0x9ca7('0x9a')]]=_0xafbb0c['body']['from'];return db[_0x9ca7('0x87')][_0x9ca7('0x59')](_0x15a165,{'fields':_0x4134c7,'raw':!![]});}})[_0x9ca7('0x1f')](handleEntityNotFound(_0x16da25,null))[_0x9ca7('0x1f')](function(_0x3cc35e){if(_0x3cc35e){_0xafbb0c[_0x9ca7('0xa1')]=_0x3cc35e;var _0x4f3e0c={'ContactId':_0x3cc35e['id'],'phone':_0xafbb0c['body'][_0x9ca7('0x91')],'WhatsappAccountId':_0x3d741f[_0x9ca7('0x57')]['id']};var _0x2cd740={'ContactId':_0x3cc35e['id'],'WhatsappAccountId':_0x3d741f['params']['id'],'closed':![]};return db['WhatsappInteraction'][_0x9ca7('0x58')]({'where':_0x2cd740})[_0x9ca7('0x1f')](function(_0x4143fa){if(_0x4143fa){return[_0x4143fa,![]];}return db[_0x9ca7('0xa2')][_0x9ca7('0x59')](_0x4f3e0c)[_0x9ca7('0x1f')](function(_0x77e6d5){return[_0x77e6d5,!![]];});});}})['spread'](function(_0x225935,_0x52dcc8){_0xafbb0c[_0x9ca7('0xa3')]=_0x225935[_0x9ca7('0x35')]({'plain':!![]});_0xafbb0c['interaction']['created']=![];if(_0x52dcc8){if(_0xafbb0c[_0x9ca7('0x81')][_0x9ca7('0xa4')]){_0xafbb0c[_0x9ca7('0x85')][_0x9ca7('0xa5')]({'id':0x0,'priority':_0xafbb0c['applications'][_0x9ca7('0x49')]+0x1,'app':_0x9ca7('0xa6'),'appdata':_0x9ca7('0xa7'),'interval':_0x9ca7('0xa8')});}_0xafbb0c['interaction'][_0x9ca7('0xa9')]=!![];}return db[_0x9ca7('0xaa')][_0x9ca7('0x59')]({'phone':_0xafbb0c[_0x9ca7('0x61')][_0x9ca7('0x91')],'messageId':_0xafbb0c['body'][_0x9ca7('0x93')],'body':_0xafbb0c[_0x9ca7('0x61')][_0x9ca7('0x61')],'WhatsappAccountId':_0x3d741f[_0x9ca7('0x57')]['id'],'WhatsappInteractionId':_0x225935['id'],'direction':'in','ContactId':_0x225935[_0x9ca7('0xab')],'AttachmentId':_0xafbb0c[_0x9ca7('0x61')][_0x9ca7('0xac')]});})[_0x9ca7('0x1f')](function(_0x18324e){_0xafbb0c[_0x9ca7('0x26')]=_0x18324e;if(!_0xafbb0c[_0x9ca7('0xa3')][_0x9ca7('0xad')])return;return db[_0x9ca7('0x75')][_0x9ca7('0x58')]({'attributes':['id',_0x9ca7('0x39')],'where':{'id':_0xafbb0c[_0x9ca7('0xa3')][_0x9ca7('0xad')]}});})[_0x9ca7('0x1f')](function(_0x365779){if(_0x365779){_0xafbb0c[_0x9ca7('0x85')]['unshift']({'id':0x0,'priority':0x0,'app':_0x9ca7('0xae'),'appdata':_0x365779['name']+','+(_0xafbb0c[_0x9ca7('0x81')][_0x9ca7('0xaf')]||0xa),'interval':_0x9ca7('0xa8')});}if(!_0xafbb0c['interaction'][_0x9ca7('0xb0')])return;return db[_0x9ca7('0xb1')][_0x9ca7('0x58')]({'attributes':['id',_0x9ca7('0x39')],'where':{'id':_0xafbb0c[_0x9ca7('0xa3')][_0x9ca7('0xb0')]}});})[_0x9ca7('0x1f')](function(_0x1ccaaa){if(_0x1ccaaa){_0xafbb0c[_0x9ca7('0x85')]['unshift']({'id':0x0,'priority':0x1,'app':'queue','appdata':_0x1ccaaa[_0x9ca7('0x39')]+','+(_0xafbb0c[_0x9ca7('0x81')][_0x9ca7('0xb2')]||0x12c),'interval':_0x9ca7('0xa8')});}return respondWithRpcPromise('Start',_0x9ca7('0xb3'),_0xafbb0c);})[_0x9ca7('0x1f')](function(_0x2f7e2c){if(_0x2f7e2c){var _0x36bd70=0xc8;var _0x43c2d4=_0x9ca7('0xb4');logger[_0x9ca7('0x20')](_0x9ca7('0x22'),_0x43c2d4,_0x36bd70,_0x9ca7('0xb5'));logger['debug'](_0x9ca7('0xb6'),_0x43c2d4,_0x36bd70,_0x9ca7('0xb5'),JSON['stringify'](_0x2f7e2c));if(_0xafbb0c[_0x9ca7('0x81')]['type']===_0x9ca7('0x90')){return _0x16da25[_0x9ca7('0x2a')](_0x36bd70)[_0x9ca7('0xb7')](_0x9ca7('0xb8'),_0x9ca7('0xb9'))[_0x9ca7('0x3a')](_0x9ca7('0xba'));}else{return _0x16da25[_0x9ca7('0x2a')](_0x36bd70)[_0x9ca7('0x2c')](_0x2f7e2c);}}});})[_0x9ca7('0x28')](handleError(_0x16da25,null));};exports[_0x9ca7('0x3a')]=function(_0x20f0a8,_0x4f3516,_0x28d9af){var _0xbb3579,_0x3d98db,_0x49cfe9;if(_['isNil'](_0x20f0a8[_0x9ca7('0x61')][_0x9ca7('0x61')])||_0x20f0a8['body'][_0x9ca7('0x61')]===''){throw new db['Sequelize'][(_0x9ca7('0x89'))](_0x9ca7('0x99'));}if(_[_0x9ca7('0x97')](_0x20f0a8[_0x9ca7('0x61')]['to'])){throw new db[(_0x9ca7('0x88'))][(_0x9ca7('0x89'))](_0x9ca7('0xbb'));}_0xbb3579=_0x20f0a8[_0x9ca7('0x61')]['to'];return db['WhatsappAccount'][_0x9ca7('0x58')]({'where':{'id':_0x20f0a8[_0x9ca7('0x57')]['id']},'include':[{'model':db[_0x9ca7('0x9e')],'as':_0x9ca7('0xbc'),'include':[{'model':db[_0x9ca7('0x87')],'as':_0x9ca7('0xa0'),'where':{'mobile':_0xbb3579},'limit':0x1,'order':[[_0x9ca7('0x8d'),'DESC']]}]}]})[_0x9ca7('0x1f')](handleEntityNotFound(_0x4f3516,null))['then'](function(_0x1ee35b){if(_0x1ee35b&&_0x1ee35b[_0x9ca7('0xbc')]){_0x3d98db=_0x1ee35b[_0x9ca7('0x35')]({'plain':!![]});if(_0x3d98db[_0x9ca7('0xbc')]&&_0x3d98db['List'][_0x9ca7('0xa0')][_0x9ca7('0x49')]){return _0x3d98db['List']['Contacts'][0x0];}return db['CmContact'][_0x9ca7('0x59')](_[_0x9ca7('0x18')](_0x20f0a8[_0x9ca7('0x61')],{'firstName':_0xbb3579,'mobile':_0xbb3579,'phone':_0xbb3579,'ListId':_0x3d98db[_0x9ca7('0xbd')]}));}})[_0x9ca7('0x1f')](handleEntityNotFound(_0x4f3516,null))[_0x9ca7('0x1f')](function(_0x2b5812){if(_0x2b5812){_0x49cfe9=_0x2b5812;return db[_0x9ca7('0xa2')]['find']({'where':{'ContactId':_0x49cfe9['id'],'closed':![],'WhatsappAccountId':_0x3d98db['id']}})[_0x9ca7('0x1f')](function(_0x1e1fbc){if(_0x1e1fbc){return[_0x1e1fbc,![]];}return db[_0x9ca7('0xa2')][_0x9ca7('0x59')]({'UserId':_0x20f0a8['user']['id'],'ContactId':_0x49cfe9['id'],'WhatsappAccountId':_0x3d98db['id'],'phone':_0xbb3579,'firstMsgDirection':_0x9ca7('0xbe'),'Messages':[_[_0x9ca7('0x50')](_0x20f0a8[_0x9ca7('0x61')],{'read':![],'body':_0x20f0a8[_0x9ca7('0x61')][_0x9ca7('0x61')],'phone':_0xbb3579,'WhatsappAccountId':_0x3d98db['id'],'UserId':_0x20f0a8[_0x9ca7('0x5c')]['id'],'ContactId':_0x49cfe9['id']})]},{'include':[{'model':db[_0x9ca7('0xaa')],'as':_0x9ca7('0xbf')}]})[_0x9ca7('0x1f')](function(_0xecd670){return[_0xecd670,!![]];});});}})['spread'](function(_0x37c6ce,_0x2669b7){if(_0x2669b7){return _0x37c6ce;}return db['WhatsappMessage'][_0x9ca7('0x59')](_[_0x9ca7('0x50')](_0x20f0a8[_0x9ca7('0x61')],{'read':![],'body':_0x20f0a8[_0x9ca7('0x61')][_0x9ca7('0x61')],'phone':_0xbb3579,'WhatsappAccountId':_0x3d98db['id'],'WhatsappInteractionId':_0x37c6ce['id'],'UserId':_0x20f0a8[_0x9ca7('0x5c')]['id'],'ContactId':_0x49cfe9['id']}))[_0x9ca7('0x1f')](function(_0x3788e1){_0x37c6ce[_0x9ca7('0xc0')][_0x9ca7('0xbf')]=[];_0x37c6ce['dataValues']['Messages'][_0x9ca7('0xa5')](_0x3788e1[_0x9ca7('0xc0')]);return _0x37c6ce;});})['then'](respondWithResult(_0x4f3516,null))[_0x9ca7('0x28')](handleError(_0x4f3516,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index e46e539..57333e6 100644 --- a/server/api/whatsappAccount/whatsappAccount.events.js +++ b/server/api/whatsappAccount/whatsappAccount.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf051=['WhatsappAccount','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x1db481,_0x1627b2){var _0x3db95b=function(_0x2d54e4){while(--_0x2d54e4){_0x1db481['push'](_0x1db481['shift']());}};_0x3db95b(++_0x1627b2);}(_0xf051,0x148));var _0x1f05=function(_0x1f500c,_0x1ea5d5){_0x1f500c=_0x1f500c-0x0;var _0x2402d7=_0xf051[_0x1f500c];return _0x2402d7;};'use strict';var EventEmitter=require(_0x1f05('0x0'));var WhatsappAccount=require(_0x1f05('0x1'))['db'][_0x1f05('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x1f05('0x3')](0x0);var events={'afterCreate':_0x1f05('0x4'),'afterUpdate':_0x1f05('0x5'),'afterDestroy':_0x1f05('0x6')};function emitEvent(_0x48b9ff){return function(_0x3f81d8,_0x10565b,_0x3384a6){WhatsappAccountEvents[_0x1f05('0x7')](_0x48b9ff+':'+_0x3f81d8['id'],_0x3f81d8);WhatsappAccountEvents[_0x1f05('0x7')](_0x48b9ff,_0x3f81d8);_0x3384a6(null);};}for(var e in events){if(events[_0x1f05('0x8')](e)){var event=events[e];WhatsappAccount[_0x1f05('0x9')](e,emitEvent(event));}}module['exports']=WhatsappAccountEvents; \ No newline at end of file +var _0x3df5=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0x50a189,_0x1688c0){var _0x4f6779=function(_0x420b5d){while(--_0x420b5d){_0x50a189['push'](_0x50a189['shift']());}};_0x4f6779(++_0x1688c0);}(_0x3df5,0x72));var _0x53df=function(_0x2c6f84,_0x2d6ffe){_0x2c6f84=_0x2c6f84-0x0;var _0x4862d5=_0x3df5[_0x2c6f84];return _0x4862d5;};'use strict';var EventEmitter=require(_0x53df('0x0'));var WhatsappAccount=require(_0x53df('0x1'))['db']['WhatsappAccount'];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x53df('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x53df('0x3'),'afterDestroy':_0x53df('0x4')};function emitEvent(_0x49298b){return function(_0x595c9c,_0xf7bddf,_0x5e9669){WhatsappAccountEvents['emit'](_0x49298b+':'+_0x595c9c['id'],_0x595c9c);WhatsappAccountEvents[_0x53df('0x5')](_0x49298b,_0x595c9c);_0x5e9669(null);};}for(var e in events){if(events[_0x53df('0x6')](e)){var event=events[e];WhatsappAccount[_0x53df('0x7')](e,emitEvent(event));}}module[_0x53df('0x8')]=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index fbaa56e..623d04d 100644 --- a/server/api/whatsappAccount/whatsappAccount.model.js +++ b/server/api/whatsappAccount/whatsappAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8bb7=['WhatsappAccount','whatsapp_accounts','lodash','../../config/logger','bluebird','request-promise','path','rimraf','define'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0x8bb7,0x1a0));var _0x78bb=function(_0x1ca06d,_0xc9854a){_0x1ca06d=_0x1ca06d-0x0;var _0x74befb=_0x8bb7[_0x1ca06d];return _0x74befb;};'use strict';var _=require(_0x78bb('0x0'));var util=require('util');var logger=require(_0x78bb('0x1'))('api');var moment=require('moment');var BPromise=require(_0x78bb('0x2'));var rp=require(_0x78bb('0x3'));var fs=require('fs');var path=require(_0x78bb('0x4'));var rimraf=require(_0x78bb('0x5'));var config=require('../../config/environment');var attributes=require('./whatsappAccount.attributes');module['exports']=function(_0x120df2,_0x33f99e){return _0x120df2[_0x78bb('0x6')](_0x78bb('0x7'),attributes,{'tableName':_0x78bb('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8046=['bluebird','request-promise','rimraf','../../config/environment','./whatsappAccount.attributes','exports','define','WhatsappAccount','lodash','api'];(function(_0x316816,_0x53a2c4){var _0x1419df=function(_0x4e54f8){while(--_0x4e54f8){_0x316816['push'](_0x316816['shift']());}};_0x1419df(++_0x53a2c4);}(_0x8046,0x148));var _0x6804=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0x8046[_0x525c7b];return _0x27b33e;};'use strict';var _=require(_0x6804('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x6804('0x1'));var moment=require('moment');var BPromise=require(_0x6804('0x2'));var rp=require(_0x6804('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6804('0x4'));var config=require(_0x6804('0x5'));var attributes=require(_0x6804('0x6'));module[_0x6804('0x7')]=function(_0x1f5e89,_0x168b5f){return _0x1f5e89[_0x6804('0x8')](_0x6804('0x9'),attributes,{'tableName':'whatsapp_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.rpc.js b/server/api/whatsappAccount/whatsappAccount.rpc.js index 67f4458..3483d3c 100644 --- a/server/api/whatsappAccount/whatsappAccount.rpc.js +++ b/server/api/whatsappAccount/whatsappAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x13d6=['redis','defaults','socket.io-emitter','./whatsappAccount.socket','register','then','info','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','WhatsappAccount,\x20%s,\x20%s','result','catch','ShowWhatsappAccount','WhatsappAccount','options','raw','where','attributes','include','map','model','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x2b2e8c,_0x54f172){var _0x4e8fac=function(_0x31dfce){while(--_0x31dfce){_0x2b2e8c['push'](_0x2b2e8c['shift']());}};_0x4e8fac(++_0x54f172);}(_0x13d6,0x196));var _0x613d=function(_0x80ab9e,_0x32c636){_0x80ab9e=_0x80ab9e-0x0;var _0x7605e6=_0x13d6[_0x80ab9e];return _0x7605e6;};'use strict';var _=require(_0x613d('0x0'));var util=require(_0x613d('0x1'));var moment=require(_0x613d('0x2'));var BPromise=require(_0x613d('0x3'));var rs=require(_0x613d('0x4'));var fs=require('fs');var Redis=require(_0x613d('0x5'));var db=require(_0x613d('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x613d('0x7'));var config=require(_0x613d('0x8'));var jayson=require(_0x613d('0x9'));var client=jayson[_0x613d('0xa')][_0x613d('0xb')]({'port':0x232a});config[_0x613d('0xc')]=_[_0x613d('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x613d('0xe'))(new Redis(config[_0x613d('0xc')]));require(_0x613d('0xf'))[_0x613d('0x10')](socket);function respondWithRpcPromise(_0x4d754a,_0x213624,_0x215b76){return new BPromise(function(_0x6a528a,_0x16e0b7){return client['request'](_0x4d754a,_0x215b76)[_0x613d('0x11')](function(_0x204d3d){logger[_0x613d('0x12')]('WhatsappAccount,\x20%s,\x20%s',_0x213624,_0x613d('0x13'));logger[_0x613d('0x14')](_0x613d('0x15'),_0x213624,'request\x20sent',JSON[_0x613d('0x16')](_0x204d3d));if(_0x204d3d[_0x613d('0x17')]){if(_0x204d3d[_0x613d('0x17')][_0x613d('0x18')]===0x1f4){logger[_0x613d('0x17')]('WhatsappAccount,\x20%s,\x20%s',_0x213624,_0x204d3d[_0x613d('0x17')][_0x613d('0x19')]);return _0x16e0b7(_0x204d3d['error'][_0x613d('0x19')]);}logger[_0x613d('0x17')]('WhatsappAccount,\x20%s,\x20%s',_0x213624,_0x204d3d['error'][_0x613d('0x19')]);return _0x6a528a(_0x204d3d[_0x613d('0x17')][_0x613d('0x19')]);}else{logger[_0x613d('0x12')](_0x613d('0x1a'),_0x213624,_0x613d('0x13'));_0x6a528a(_0x204d3d[_0x613d('0x1b')][_0x613d('0x19')]);}})[_0x613d('0x1c')](function(_0x52f4b2){logger['error'](_0x613d('0x1a'),_0x213624,_0x52f4b2);_0x16e0b7(_0x52f4b2);});});}exports[_0x613d('0x1d')]=function(_0x48c98d){var _0x5a11aa=this;return new Promise(function(_0x540571,_0x34191e){return db[_0x613d('0x1e')]['find']({'raw':_0x48c98d[_0x613d('0x1f')]?_0x48c98d[_0x613d('0x1f')][_0x613d('0x20')]===undefined?!![]:![]:!![],'where':_0x48c98d[_0x613d('0x1f')]?_0x48c98d[_0x613d('0x1f')][_0x613d('0x21')]||null:null,'attributes':_0x48c98d['options']?_0x48c98d[_0x613d('0x1f')][_0x613d('0x22')]||null:null,'include':_0x48c98d['options']?_0x48c98d[_0x613d('0x1f')][_0x613d('0x23')]?_[_0x613d('0x24')](_0x48c98d['options']['include'],function(_0x1e3e30){return{'model':db[_0x1e3e30['model']],'as':_0x1e3e30['as'],'attributes':_0x1e3e30[_0x613d('0x22')],'include':_0x1e3e30['include']?_[_0x613d('0x24')](_0x1e3e30['include'],function(_0x41d3cf){return{'model':db[_0x41d3cf[_0x613d('0x25')]],'as':_0x41d3cf['as'],'attributes':_0x41d3cf[_0x613d('0x22')],'include':_0x41d3cf['include']?_['map'](_0x41d3cf[_0x613d('0x23')],function(_0x32baf4){return{'model':db[_0x32baf4['model']],'as':_0x32baf4['as'],'attributes':_0x32baf4[_0x613d('0x22')]};}):[]};}):[]};}):[]:[]})[_0x613d('0x11')](function(_0x3fb0fd){logger['info'](_0x613d('0x1d'),_0x48c98d);logger[_0x613d('0x14')](_0x613d('0x1d'),_0x48c98d,JSON[_0x613d('0x16')](_0x3fb0fd));_0x540571(_0x3fb0fd);})[_0x613d('0x1c')](function(_0x50de3e){logger['error'](_0x613d('0x1d'),_0x50de3e[_0x613d('0x19')],_0x48c98d);_0x34191e(_0x5a11aa[_0x613d('0x17')](0x1f4,_0x50de3e[_0x613d('0x19')]));});});}; \ No newline at end of file +var _0x457b=['result','catch','ShowWhatsappAccount','WhatsappAccount','options','raw','where','map','include','attributes','model','debug','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','./whatsappAccount.socket','register','request','then','info','WhatsappAccount,\x20%s,\x20%s','WhatsappAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message'];(function(_0x303d08,_0x55b25b){var _0x23ba8f=function(_0x9af715){while(--_0x9af715){_0x303d08['push'](_0x303d08['shift']());}};_0x23ba8f(++_0x55b25b);}(_0x457b,0xca));var _0xb457=function(_0x3cb300,_0x4d7a99){_0x3cb300=_0x3cb300-0x0;var _0x3e0cd9=_0x457b[_0x3cb300];return _0x3e0cd9;};'use strict';var _=require(_0xb457('0x0'));var util=require(_0xb457('0x1'));var moment=require('moment');var BPromise=require(_0xb457('0x2'));var rs=require(_0xb457('0x3'));var fs=require('fs');var Redis=require(_0xb457('0x4'));var db=require(_0xb457('0x5'))['db'];var utils=require(_0xb457('0x6'));var logger=require('../../config/logger')(_0xb457('0x7'));var config=require(_0xb457('0x8'));var jayson=require(_0xb457('0x9'));var client=jayson[_0xb457('0xa')][_0xb457('0xb')]({'port':0x232a});config['redis']=_[_0xb457('0xc')](config[_0xb457('0xd')],{'host':_0xb457('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xb457('0xf'))[_0xb457('0x10')](socket);function respondWithRpcPromise(_0x537ec4,_0x19afe8,_0x1cc258){return new BPromise(function(_0x810aed,_0x485de2){return client[_0xb457('0x11')](_0x537ec4,_0x1cc258)[_0xb457('0x12')](function(_0x3c9eb3){logger[_0xb457('0x13')](_0xb457('0x14'),_0x19afe8,'request\x20sent');logger['debug'](_0xb457('0x15'),_0x19afe8,_0xb457('0x16'),JSON[_0xb457('0x17')](_0x3c9eb3));if(_0x3c9eb3[_0xb457('0x18')]){if(_0x3c9eb3[_0xb457('0x18')]['code']===0x1f4){logger['error'](_0xb457('0x14'),_0x19afe8,_0x3c9eb3[_0xb457('0x18')][_0xb457('0x19')]);return _0x485de2(_0x3c9eb3[_0xb457('0x18')]['message']);}logger[_0xb457('0x18')](_0xb457('0x14'),_0x19afe8,_0x3c9eb3[_0xb457('0x18')][_0xb457('0x19')]);return _0x810aed(_0x3c9eb3[_0xb457('0x18')][_0xb457('0x19')]);}else{logger[_0xb457('0x13')](_0xb457('0x14'),_0x19afe8,'request\x20sent');_0x810aed(_0x3c9eb3[_0xb457('0x1a')][_0xb457('0x19')]);}})[_0xb457('0x1b')](function(_0x554c8a){logger['error'](_0xb457('0x14'),_0x19afe8,_0x554c8a);_0x485de2(_0x554c8a);});});}exports[_0xb457('0x1c')]=function(_0x2745d7){var _0x32e825=this;return new Promise(function(_0xd73923,_0x383706){return db[_0xb457('0x1d')]['find']({'raw':_0x2745d7['options']?_0x2745d7[_0xb457('0x1e')][_0xb457('0x1f')]===undefined?!![]:![]:!![],'where':_0x2745d7[_0xb457('0x1e')]?_0x2745d7['options'][_0xb457('0x20')]||null:null,'attributes':_0x2745d7[_0xb457('0x1e')]?_0x2745d7[_0xb457('0x1e')]['attributes']||null:null,'include':_0x2745d7['options']?_0x2745d7[_0xb457('0x1e')]['include']?_[_0xb457('0x21')](_0x2745d7[_0xb457('0x1e')][_0xb457('0x22')],function(_0x1990c2){return{'model':db[_0x1990c2['model']],'as':_0x1990c2['as'],'attributes':_0x1990c2[_0xb457('0x23')],'include':_0x1990c2[_0xb457('0x22')]?_['map'](_0x1990c2[_0xb457('0x22')],function(_0x7ebca){return{'model':db[_0x7ebca[_0xb457('0x24')]],'as':_0x7ebca['as'],'attributes':_0x7ebca[_0xb457('0x23')],'include':_0x7ebca[_0xb457('0x22')]?_[_0xb457('0x21')](_0x7ebca[_0xb457('0x22')],function(_0x51041b){return{'model':db[_0x51041b[_0xb457('0x24')]],'as':_0x51041b['as'],'attributes':_0x51041b[_0xb457('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xaaf240){logger[_0xb457('0x13')](_0xb457('0x1c'),_0x2745d7);logger[_0xb457('0x25')](_0xb457('0x1c'),_0x2745d7,JSON['stringify'](_0xaaf240));_0xd73923(_0xaaf240);})[_0xb457('0x1b')](function(_0x518ff0){logger[_0xb457('0x18')](_0xb457('0x1c'),_0x518ff0['message'],_0x2745d7);_0x383706(_0x32e825[_0xb457('0x18')](0x1f4,_0x518ff0[_0xb457('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index 66e835e..19b4f94 100644 --- a/server/api/whatsappAccount/whatsappAccount.socket.js +++ b/server/api/whatsappAccount/whatsappAccount.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa8ba=['register','length','./whatsappAccount.events','save','remove','update','emit','removeListener'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xa8ba,0x10a));var _0xaa8b=function(_0x369975,_0x2351fd){_0x369975=_0x369975-0x0;var _0x31f3fc=_0xa8ba[_0x369975];return _0x31f3fc;};'use strict';var WhatsappAccountEvents=require(_0xaa8b('0x0'));var events=[_0xaa8b('0x1'),_0xaa8b('0x2'),_0xaa8b('0x3')];function createListener(_0x266601,_0x306167){return function(_0x4ef579){_0x306167[_0xaa8b('0x4')](_0x266601,_0x4ef579);};}function removeListener(_0x22ce5b,_0x1f533b){return function(){WhatsappAccountEvents[_0xaa8b('0x5')](_0x22ce5b,_0x1f533b);};}exports[_0xaa8b('0x6')]=function(_0x314041){for(var _0x50f39d=0x0,_0x309a7e=events[_0xaa8b('0x7')];_0x50f39d<_0x309a7e;_0x50f39d++){var _0xb712b9=events[_0x50f39d];var _0xe3298f=createListener('whatsappAccount:'+_0xb712b9,_0x314041);WhatsappAccountEvents['on'](_0xb712b9,_0xe3298f);}}; \ No newline at end of file +var _0x458a=['register','length','whatsappAccount:','./whatsappAccount.events','save','remove','update','emit','removeListener'];(function(_0x53781f,_0xa86c3c){var _0x45ab83=function(_0x3a557a){while(--_0x3a557a){_0x53781f['push'](_0x53781f['shift']());}};_0x45ab83(++_0xa86c3c);}(_0x458a,0x108));var _0xa458=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x458a[_0x3dd15e];return _0x231fd0;};'use strict';var WhatsappAccountEvents=require(_0xa458('0x0'));var events=[_0xa458('0x1'),_0xa458('0x2'),_0xa458('0x3')];function createListener(_0x2fd1b2,_0x8fca31){return function(_0xb4d968){_0x8fca31[_0xa458('0x4')](_0x2fd1b2,_0xb4d968);};}function removeListener(_0x5d9d83,_0x552a74){return function(){WhatsappAccountEvents[_0xa458('0x5')](_0x5d9d83,_0x552a74);};}exports[_0xa458('0x6')]=function(_0x33518c){for(var _0x1ddbeb=0x0,_0x511d=events[_0xa458('0x7')];_0x1ddbeb<_0x511d;_0x1ddbeb++){var _0x1c22a3=events[_0x1ddbeb];var _0x46305b=createListener(_0xa458('0x8')+_0x1c22a3,_0x33518c);WhatsappAccountEvents['on'](_0x1c22a3,_0x46305b);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index 86b9a8d..bdc721d 100644 --- a/server/api/whatsappApplication/index.js +++ b/server/api/whatsappApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3dad=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappApplication.controller','index','get','/:id','isAuthenticated','show','post','create'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x3dad,0x9f));var _0xd3da=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x3dad[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0xd3da('0x0'));var util=require(_0xd3da('0x1'));var path=require(_0xd3da('0x2'));var timeout=require(_0xd3da('0x3'));var express=require(_0xd3da('0x4'));var router=express[_0xd3da('0x5')]();var fs_extra=require(_0xd3da('0x6'));var auth=require(_0xd3da('0x7'));var interaction=require(_0xd3da('0x8'));var config=require('../../config/environment');var controller=require(_0xd3da('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xd3da('0xa')]);router[_0xd3da('0xb')](_0xd3da('0xc'),auth[_0xd3da('0xd')](),controller[_0xd3da('0xe')]);router[_0xd3da('0xf')]('/',auth[_0xd3da('0xd')](),controller[_0xd3da('0x10')]);router[_0xd3da('0x11')]('/:id',auth[_0xd3da('0xd')](),controller[_0xd3da('0x12')]);router[_0xd3da('0x13')](_0xd3da('0xc'),auth[_0xd3da('0xd')](),controller[_0xd3da('0x14')]);module[_0xd3da('0x15')]=router; \ No newline at end of file +var _0x6f22=['post','create','put','update','destroy','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./whatsappApplication.controller','isAuthenticated','index','get','/:id','show'];(function(_0x3cdc51,_0x123911){var _0x132c33=function(_0x5a017b){while(--_0x5a017b){_0x3cdc51['push'](_0x3cdc51['shift']());}};_0x132c33(++_0x123911);}(_0x6f22,0x159));var _0x26f2=function(_0x13cab2,_0x148058){_0x13cab2=_0x13cab2-0x0;var _0x292c90=_0x6f22[_0x13cab2];return _0x292c90;};'use strict';var multer=require('multer');var util=require(_0x26f2('0x0'));var path=require(_0x26f2('0x1'));var timeout=require('connect-timeout');var express=require(_0x26f2('0x2'));var router=express[_0x26f2('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x26f2('0x4'));var interaction=require(_0x26f2('0x5'));var config=require('../../config/environment');var controller=require(_0x26f2('0x6'));router['get']('/',auth[_0x26f2('0x7')](),controller[_0x26f2('0x8')]);router[_0x26f2('0x9')](_0x26f2('0xa'),auth[_0x26f2('0x7')](),controller[_0x26f2('0xb')]);router[_0x26f2('0xc')]('/',auth[_0x26f2('0x7')](),controller[_0x26f2('0xd')]);router[_0x26f2('0xe')](_0x26f2('0xa'),auth[_0x26f2('0x7')](),controller[_0x26f2('0xf')]);router['delete'](_0x26f2('0xa'),auth[_0x26f2('0x7')](),controller[_0x26f2('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index bdea456..7f543db 100644 --- a/server/api/whatsappApplication/whatsappApplication.attributes.js +++ b/server/api/whatsappApplication/whatsappApplication.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x63ef=['STRING','*,*,*,*','sequelize'];(function(_0x2a44c1,_0x566259){var _0x54fba9=function(_0x2de658){while(--_0x2de658){_0x2a44c1['push'](_0x2a44c1['shift']());}};_0x54fba9(++_0x566259);}(_0x63ef,0xfe));var _0xf63e=function(_0x3be7ff,_0x12e714){_0x3be7ff=_0x3be7ff-0x0;var _0x186721=_0x63ef[_0x3be7ff];return _0x186721;};'use strict';var Sequelize=require(_0xf63e('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xf63e('0x1')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xf63e('0x1')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xf63e('0x2')}}; \ No newline at end of file +var _0xd137=['exports','INTEGER','STRING','noop','TEXT','sequelize'];(function(_0x391154,_0x40fb12){var _0x4b7767=function(_0x3b1573){while(--_0x3b1573){_0x391154['push'](_0x391154['shift']());}};_0x4b7767(++_0x40fb12);}(_0xd137,0x1f1));var _0x7d13=function(_0x343ac5,_0x305ee3){_0x343ac5=_0x343ac5-0x0;var _0x50e0d6=_0xd137[_0x343ac5];return _0x50e0d6;};'use strict';var Sequelize=require(_0x7d13('0x0'));module[_0x7d13('0x1')]={'priority':{'type':Sequelize[_0x7d13('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x7d13('0x3')],'allowNull':![],'defaultValue':_0x7d13('0x4')},'appdata':{'type':Sequelize[_0x7d13('0x5')]()},'description':{'type':Sequelize[_0x7d13('0x3')]},'interval':{'type':Sequelize[_0x7d13('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index d189b51..8f8cecb 100644 --- a/server/api/whatsappApplication/whatsappApplication.controller.js +++ b/server/api/whatsappApplication/whatsappApplication.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a2f=['create','body','find','eml-format','rimraf','fast-json-patch','request-promise','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','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','rawAttributes','fieldName','type','key','map','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','pick','where','merge','VIRTUAL','options','WhatsappApplication','includeAll','include','findAll','rows','catch','params'];(function(_0x42bd55,_0x452a2f){var _0x5b8693=function(_0x10762d){while(--_0x10762d){_0x42bd55['push'](_0x42bd55['shift']());}};_0x5b8693(++_0x452a2f);}(_0x7a2f,0x99));var _0xf7a2=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x7a2f[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require(_0xf7a2('0x0'));var rimraf=require(_0xf7a2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf7a2('0x2'));var rp=require(_0xf7a2('0x3'));var moment=require(_0xf7a2('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf7a2('0x5'));var util=require(_0xf7a2('0x6'));var path=require(_0xf7a2('0x7'));var sox=require(_0xf7a2('0x8'));var csv=require(_0xf7a2('0x9'));var ejs=require(_0xf7a2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf7a2('0xb'));var squel=require(_0xf7a2('0xc'));var crypto=require(_0xf7a2('0xd'));var jsforce=require(_0xf7a2('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xf7a2('0x9'));var querystring=require(_0xf7a2('0xf'));var Papa=require(_0xf7a2('0x10'));var Redis=require(_0xf7a2('0x11'));var authService=require(_0xf7a2('0x12'));var qs=require(_0xf7a2('0x13'));var as=require(_0xf7a2('0x14'));var hardwareService=require(_0xf7a2('0x15'));var logger=require('../../config/logger')(_0xf7a2('0x16'));var utils=require(_0xf7a2('0x17'));var config=require(_0xf7a2('0x18'));var licenseUtil=require(_0xf7a2('0x19'));var db=require(_0xf7a2('0x1a'))['db'];function respondWithStatusCode(_0x4f960f,_0x4bf293){_0x4bf293=_0x4bf293||0xcc;return function(_0x4d01db){if(_0x4d01db){return _0x4f960f[_0xf7a2('0x1b')](_0x4bf293);}return _0x4f960f[_0xf7a2('0x1c')](_0x4bf293)[_0xf7a2('0x1d')]();};}function respondWithResult(_0x35a006,_0x3b46f1){_0x3b46f1=_0x3b46f1||0xc8;return function(_0x1de4ef){if(_0x1de4ef){return _0x35a006[_0xf7a2('0x1c')](_0x3b46f1)['json'](_0x1de4ef);}};}function respondWithFilteredResult(_0x4eedb3,_0x53c32e){return function(_0x16b0dc){if(_0x16b0dc){var _0x5ef0aa=typeof _0x53c32e['offset']===_0xf7a2('0x1e')&&typeof _0x53c32e[_0xf7a2('0x1f')]===_0xf7a2('0x1e');var _0x3147b2=_0x16b0dc[_0xf7a2('0x20')];var _0x5f2147=_0x5ef0aa?0x0:_0x53c32e['offset'];var _0x5de0f1=_0x5ef0aa?_0x16b0dc[_0xf7a2('0x20')]:_0x53c32e[_0xf7a2('0x21')]+_0x53c32e[_0xf7a2('0x1f')];var _0x2a3fef;if(_0x5de0f1>=_0x3147b2){_0x5de0f1=_0x3147b2;_0x2a3fef=0xc8;}else{_0x2a3fef=0xce;}_0x4eedb3[_0xf7a2('0x1c')](_0x2a3fef);return _0x4eedb3['set'](_0xf7a2('0x22'),_0x5f2147+'-'+_0x5de0f1+'/'+_0x3147b2)['json'](_0x16b0dc);}return null;};}function patchUpdates(_0x1f2b26){return function(_0x3a0334){try{jsonpatch[_0xf7a2('0x23')](_0x3a0334,_0x1f2b26,!![]);}catch(_0x1ade67){return BPromise[_0xf7a2('0x24')](_0x1ade67);}return _0x3a0334[_0xf7a2('0x25')]();};}function saveUpdates(_0x39c941,_0x5265e0){return function(_0x4b1a06){if(_0x4b1a06){return _0x4b1a06[_0xf7a2('0x26')](_0x39c941)[_0xf7a2('0x27')](function(_0x59217f){return _0x59217f;});}return null;};}function removeEntity(_0x31349c,_0x2bbffd){return function(_0x3592ba){if(_0x3592ba){return _0x3592ba[_0xf7a2('0x28')]()[_0xf7a2('0x27')](function(){_0x31349c['status'](0xcc)[_0xf7a2('0x1d')]();});}};}function handleEntityNotFound(_0x484874,_0x30ec1e){return function(_0x143895){if(!_0x143895){_0x484874[_0xf7a2('0x1b')](0x194);}return _0x143895;};}function handleError(_0x48a4d8,_0x34af9b){_0x34af9b=_0x34af9b||0x1f4;return function(_0x5c53fb){logger[_0xf7a2('0x29')](_0x5c53fb['stack']);if(_0x5c53fb[_0xf7a2('0x2a')]){delete _0x5c53fb[_0xf7a2('0x2a')];}_0x48a4d8[_0xf7a2('0x1c')](_0x34af9b)[_0xf7a2('0x2b')](_0x5c53fb);};}exports[_0xf7a2('0x2c')]=function(_0x234359,_0xe7d318){var _0x5d64d1={},_0x1c764b={},_0x154ee5={'count':0x0,'rows':[]};var _0x481007=_['map'](db['WhatsappApplication'][_0xf7a2('0x2d')],function(_0x25551f){return{'name':_0x25551f[_0xf7a2('0x2e')],'type':_0x25551f[_0xf7a2('0x2f')][_0xf7a2('0x30')]};});_0x1c764b['model']=_[_0xf7a2('0x31')](_0x481007,_0xf7a2('0x2a'));_0x1c764b['query']=_['keys'](_0x234359[_0xf7a2('0x32')]);_0x1c764b[_0xf7a2('0x33')]=_[_0xf7a2('0x34')](_0x1c764b['model'],_0x1c764b[_0xf7a2('0x32')]);_0x5d64d1[_0xf7a2('0x35')]=_[_0xf7a2('0x34')](_0x1c764b[_0xf7a2('0x36')],qs[_0xf7a2('0x37')](_0x234359[_0xf7a2('0x32')][_0xf7a2('0x37')]));_0x5d64d1[_0xf7a2('0x35')]=_0x5d64d1[_0xf7a2('0x35')][_0xf7a2('0x38')]?_0x5d64d1[_0xf7a2('0x35')]:_0x1c764b[_0xf7a2('0x36')];if(!_0x234359[_0xf7a2('0x32')][_0xf7a2('0x39')](_0xf7a2('0x3a'))){_0x5d64d1[_0xf7a2('0x1f')]=qs[_0xf7a2('0x1f')](_0x234359['query']['limit']);_0x5d64d1[_0xf7a2('0x21')]=qs[_0xf7a2('0x21')](_0x234359[_0xf7a2('0x32')][_0xf7a2('0x21')]);}_0x5d64d1['order']=qs[_0xf7a2('0x3b')](_0x234359[_0xf7a2('0x32')][_0xf7a2('0x3b')]);_0x5d64d1['where']=qs[_0xf7a2('0x33')](_[_0xf7a2('0x3c')](_0x234359['query'],_0x1c764b['filters']),_0x481007);if(_0x234359[_0xf7a2('0x32')]['filter']){_0x5d64d1[_0xf7a2('0x3d')]=_[_0xf7a2('0x3e')](_0x5d64d1['where'],{'$or':_['map'](_0x481007,function(_0x1a220d){if(_0x1a220d['type']!==_0xf7a2('0x3f')){var _0x211f29={};_0x211f29[_0x1a220d[_0xf7a2('0x2a')]]={'$like':'%'+_0x234359['query']['filter']+'%'};return _0x211f29;}})});}_0x5d64d1=_[_0xf7a2('0x3e')]({},_0x5d64d1,_0x234359[_0xf7a2('0x40')]);var _0x46b06c={'where':_0x5d64d1['where']};return db[_0xf7a2('0x41')]['count'](_0x46b06c)['then'](function(_0x4a42d3){_0x154ee5[_0xf7a2('0x20')]=_0x4a42d3;if(_0x234359['query'][_0xf7a2('0x42')]){_0x5d64d1[_0xf7a2('0x43')]=[{'all':!![]}];}return db[_0xf7a2('0x41')][_0xf7a2('0x44')](_0x5d64d1);})[_0xf7a2('0x27')](function(_0xca3996){_0x154ee5[_0xf7a2('0x45')]=_0xca3996;return _0x154ee5;})[_0xf7a2('0x27')](respondWithFilteredResult(_0xe7d318,_0x5d64d1))[_0xf7a2('0x46')](handleError(_0xe7d318,null));};exports['show']=function(_0x499a01,_0x46f0f9){var _0x12c562={'raw':!![],'where':{'id':_0x499a01[_0xf7a2('0x47')]['id']}},_0x12f13e={};_0x12f13e['model']=_['keys'](db['WhatsappApplication']['rawAttributes']);_0x12f13e['query']=_['keys'](_0x499a01[_0xf7a2('0x32')]);_0x12f13e[_0xf7a2('0x33')]=_[_0xf7a2('0x34')](_0x12f13e[_0xf7a2('0x36')],_0x12f13e[_0xf7a2('0x32')]);_0x12c562['attributes']=_[_0xf7a2('0x34')](_0x12f13e['model'],qs[_0xf7a2('0x37')](_0x499a01[_0xf7a2('0x32')][_0xf7a2('0x37')]));_0x12c562[_0xf7a2('0x35')]=_0x12c562['attributes'][_0xf7a2('0x38')]?_0x12c562[_0xf7a2('0x35')]:_0x12f13e[_0xf7a2('0x36')];if(_0x499a01[_0xf7a2('0x32')][_0xf7a2('0x42')]){_0x12c562[_0xf7a2('0x43')]=[{'all':!![]}];}_0x12c562=_[_0xf7a2('0x3e')]({},_0x12c562,_0x499a01[_0xf7a2('0x40')]);return db[_0xf7a2('0x41')]['find'](_0x12c562)['then'](handleEntityNotFound(_0x46f0f9,null))['then'](respondWithResult(_0x46f0f9,null))[_0xf7a2('0x46')](handleError(_0x46f0f9,null));};exports[_0xf7a2('0x48')]=function(_0x1b8ce0,_0x2e4dac){return db[_0xf7a2('0x41')]['create'](_0x1b8ce0[_0xf7a2('0x49')],{})['then'](respondWithResult(_0x2e4dac,0xc9))[_0xf7a2('0x46')](handleError(_0x2e4dac,null));};exports[_0xf7a2('0x26')]=function(_0x401948,_0x4d40ba){if(_0x401948['body']['id']){delete _0x401948[_0xf7a2('0x49')]['id'];}return db[_0xf7a2('0x41')][_0xf7a2('0x4a')]({'where':{'id':_0x401948[_0xf7a2('0x47')]['id']}})[_0xf7a2('0x27')](handleEntityNotFound(_0x4d40ba,null))[_0xf7a2('0x27')](saveUpdates(_0x401948[_0xf7a2('0x49')],null))[_0xf7a2('0x27')](respondWithResult(_0x4d40ba,null))[_0xf7a2('0x46')](handleError(_0x4d40ba,null));};exports[_0xf7a2('0x28')]=function(_0x588d30,_0x3e8cbe){return db['WhatsappApplication'][_0xf7a2('0x4a')]({'where':{'id':_0x588d30[_0xf7a2('0x47')]['id']}})[_0xf7a2('0x27')](handleEntityNotFound(_0x3e8cbe,null))[_0xf7a2('0x27')](removeEntity(_0x3e8cbe,null))[_0xf7a2('0x46')](handleError(_0x3e8cbe,null));}; \ No newline at end of file +var _0xd991=['limit','count','json','apply','save','update','then','destroy','error','stack','name','send','index','map','WhatsappApplication','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','intersection','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined'];(function(_0x25d0d6,_0x3a724f){var _0x2342af=function(_0x792fe9){while(--_0x792fe9){_0x25d0d6['push'](_0x25d0d6['shift']());}};_0x2342af(++_0x3a724f);}(_0xd991,0x115));var _0x1d99=function(_0x101f4a,_0x4ec352){_0x101f4a=_0x101f4a-0x0;var _0xc9c822=_0xd991[_0x101f4a];return _0xc9c822;};'use strict';var emlformat=require(_0x1d99('0x0'));var rimraf=require(_0x1d99('0x1'));var zipdir=require(_0x1d99('0x2'));var jsonpatch=require(_0x1d99('0x3'));var rp=require(_0x1d99('0x4'));var moment=require('moment');var BPromise=require(_0x1d99('0x5'));var Mustache=require(_0x1d99('0x6'));var util=require(_0x1d99('0x7'));var path=require(_0x1d99('0x8'));var sox=require(_0x1d99('0x9'));var csv=require(_0x1d99('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1d99('0xb'));var _=require(_0x1d99('0xc'));var squel=require('squel');var crypto=require(_0x1d99('0xd'));var jsforce=require(_0x1d99('0xe'));var deskjs=require(_0x1d99('0xf'));var toCsv=require(_0x1d99('0xa'));var querystring=require(_0x1d99('0x10'));var Papa=require(_0x1d99('0x11'));var Redis=require(_0x1d99('0x12'));var authService=require(_0x1d99('0x13'));var qs=require(_0x1d99('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1d99('0x15'));var logger=require(_0x1d99('0x16'))('api');var utils=require(_0x1d99('0x17'));var config=require(_0x1d99('0x18'));var licenseUtil=require(_0x1d99('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x442843,_0xf7b799){_0xf7b799=_0xf7b799||0xcc;return function(_0x3c87e3){if(_0x3c87e3){return _0x442843[_0x1d99('0x1a')](_0xf7b799);}return _0x442843[_0x1d99('0x1b')](_0xf7b799)[_0x1d99('0x1c')]();};}function respondWithResult(_0x5f57a8,_0x35dd66){_0x35dd66=_0x35dd66||0xc8;return function(_0x5ad75d){if(_0x5ad75d){return _0x5f57a8[_0x1d99('0x1b')](_0x35dd66)['json'](_0x5ad75d);}};}function respondWithFilteredResult(_0x2f8738,_0x1b2c78){return function(_0x3ac89a){if(_0x3ac89a){var _0x8903f2=typeof _0x1b2c78[_0x1d99('0x1d')]===_0x1d99('0x1e')&&typeof _0x1b2c78[_0x1d99('0x1f')]===_0x1d99('0x1e');var _0x5c31c3=_0x3ac89a[_0x1d99('0x20')];var _0x4da463=_0x8903f2?0x0:_0x1b2c78[_0x1d99('0x1d')];var _0x1a51a4=_0x8903f2?_0x3ac89a[_0x1d99('0x20')]:_0x1b2c78[_0x1d99('0x1d')]+_0x1b2c78[_0x1d99('0x1f')];var _0x5044a7;if(_0x1a51a4>=_0x5c31c3){_0x1a51a4=_0x5c31c3;_0x5044a7=0xc8;}else{_0x5044a7=0xce;}_0x2f8738['status'](_0x5044a7);return _0x2f8738['set']('Content-Range',_0x4da463+'-'+_0x1a51a4+'/'+_0x5c31c3)[_0x1d99('0x21')](_0x3ac89a);}return null;};}function patchUpdates(_0x20af77){return function(_0x234b4b){try{jsonpatch[_0x1d99('0x22')](_0x234b4b,_0x20af77,!![]);}catch(_0x1863c0){return BPromise['reject'](_0x1863c0);}return _0x234b4b[_0x1d99('0x23')]();};}function saveUpdates(_0x2e6c35,_0x4a72ac){return function(_0x25bd22){if(_0x25bd22){return _0x25bd22[_0x1d99('0x24')](_0x2e6c35)[_0x1d99('0x25')](function(_0x3e7160){return _0x3e7160;});}return null;};}function removeEntity(_0x42e482,_0x8273bb){return function(_0x54a295){if(_0x54a295){return _0x54a295[_0x1d99('0x26')]()[_0x1d99('0x25')](function(){_0x42e482['status'](0xcc)[_0x1d99('0x1c')]();});}};}function handleEntityNotFound(_0x31e70e,_0x5b5fd){return function(_0x30a1ef){if(!_0x30a1ef){_0x31e70e['sendStatus'](0x194);}return _0x30a1ef;};}function handleError(_0x27d9d9,_0x50c51e){_0x50c51e=_0x50c51e||0x1f4;return function(_0x150569){logger[_0x1d99('0x27')](_0x150569[_0x1d99('0x28')]);if(_0x150569[_0x1d99('0x29')]){delete _0x150569['name'];}_0x27d9d9[_0x1d99('0x1b')](_0x50c51e)[_0x1d99('0x2a')](_0x150569);};}exports[_0x1d99('0x2b')]=function(_0x37f7b1,_0x11bff3){var _0x1aaf2b={},_0x5c0c0a={},_0x273f41={'count':0x0,'rows':[]};var _0x16cc9f=_[_0x1d99('0x2c')](db[_0x1d99('0x2d')][_0x1d99('0x2e')],function(_0x4b5c90){return{'name':_0x4b5c90[_0x1d99('0x2f')],'type':_0x4b5c90[_0x1d99('0x30')][_0x1d99('0x31')]};});_0x5c0c0a[_0x1d99('0x32')]=_[_0x1d99('0x2c')](_0x16cc9f,_0x1d99('0x29'));_0x5c0c0a[_0x1d99('0x33')]=_[_0x1d99('0x34')](_0x37f7b1[_0x1d99('0x33')]);_0x5c0c0a[_0x1d99('0x35')]=_['intersection'](_0x5c0c0a[_0x1d99('0x32')],_0x5c0c0a[_0x1d99('0x33')]);_0x1aaf2b[_0x1d99('0x36')]=_['intersection'](_0x5c0c0a[_0x1d99('0x32')],qs[_0x1d99('0x37')](_0x37f7b1['query'][_0x1d99('0x37')]));_0x1aaf2b[_0x1d99('0x36')]=_0x1aaf2b[_0x1d99('0x36')][_0x1d99('0x38')]?_0x1aaf2b[_0x1d99('0x36')]:_0x5c0c0a['model'];if(!_0x37f7b1[_0x1d99('0x33')][_0x1d99('0x39')](_0x1d99('0x3a'))){_0x1aaf2b[_0x1d99('0x1f')]=qs[_0x1d99('0x1f')](_0x37f7b1[_0x1d99('0x33')][_0x1d99('0x1f')]);_0x1aaf2b['offset']=qs['offset'](_0x37f7b1[_0x1d99('0x33')][_0x1d99('0x1d')]);}_0x1aaf2b[_0x1d99('0x3b')]=qs[_0x1d99('0x3c')](_0x37f7b1[_0x1d99('0x33')]['sort']);_0x1aaf2b[_0x1d99('0x3d')]=qs[_0x1d99('0x35')](_[_0x1d99('0x3e')](_0x37f7b1[_0x1d99('0x33')],_0x5c0c0a[_0x1d99('0x35')]),_0x16cc9f);if(_0x37f7b1[_0x1d99('0x33')][_0x1d99('0x3f')]){_0x1aaf2b[_0x1d99('0x3d')]=_['merge'](_0x1aaf2b[_0x1d99('0x3d')],{'$or':_[_0x1d99('0x2c')](_0x16cc9f,function(_0x43b5cb){if(_0x43b5cb['type']!==_0x1d99('0x40')){var _0x478624={};_0x478624[_0x43b5cb['name']]={'$like':'%'+_0x37f7b1[_0x1d99('0x33')][_0x1d99('0x3f')]+'%'};return _0x478624;}})});}_0x1aaf2b=_[_0x1d99('0x41')]({},_0x1aaf2b,_0x37f7b1[_0x1d99('0x42')]);var _0x59c119={'where':_0x1aaf2b[_0x1d99('0x3d')]};return db[_0x1d99('0x2d')][_0x1d99('0x20')](_0x59c119)[_0x1d99('0x25')](function(_0x17d969){_0x273f41['count']=_0x17d969;if(_0x37f7b1[_0x1d99('0x33')][_0x1d99('0x43')]){_0x1aaf2b[_0x1d99('0x44')]=[{'all':!![]}];}return db[_0x1d99('0x2d')][_0x1d99('0x45')](_0x1aaf2b);})[_0x1d99('0x25')](function(_0x107f3c){_0x273f41['rows']=_0x107f3c;return _0x273f41;})[_0x1d99('0x25')](respondWithFilteredResult(_0x11bff3,_0x1aaf2b))[_0x1d99('0x46')](handleError(_0x11bff3,null));};exports[_0x1d99('0x47')]=function(_0x41dc0e,_0x16a423){var _0x3b6b66={'raw':!![],'where':{'id':_0x41dc0e[_0x1d99('0x48')]['id']}},_0x280937={};_0x280937[_0x1d99('0x32')]=_[_0x1d99('0x34')](db[_0x1d99('0x2d')]['rawAttributes']);_0x280937['query']=_[_0x1d99('0x34')](_0x41dc0e['query']);_0x280937[_0x1d99('0x35')]=_[_0x1d99('0x49')](_0x280937[_0x1d99('0x32')],_0x280937[_0x1d99('0x33')]);_0x3b6b66[_0x1d99('0x36')]=_[_0x1d99('0x49')](_0x280937[_0x1d99('0x32')],qs['fields'](_0x41dc0e['query']['fields']));_0x3b6b66[_0x1d99('0x36')]=_0x3b6b66[_0x1d99('0x36')][_0x1d99('0x38')]?_0x3b6b66[_0x1d99('0x36')]:_0x280937[_0x1d99('0x32')];if(_0x41dc0e['query'][_0x1d99('0x43')]){_0x3b6b66[_0x1d99('0x44')]=[{'all':!![]}];}_0x3b6b66=_[_0x1d99('0x41')]({},_0x3b6b66,_0x41dc0e['options']);return db[_0x1d99('0x2d')]['find'](_0x3b6b66)[_0x1d99('0x25')](handleEntityNotFound(_0x16a423,null))[_0x1d99('0x25')](respondWithResult(_0x16a423,null))[_0x1d99('0x46')](handleError(_0x16a423,null));};exports[_0x1d99('0x4a')]=function(_0x9e43b6,_0x437f13){return db['WhatsappApplication'][_0x1d99('0x4a')](_0x9e43b6[_0x1d99('0x4b')],{})[_0x1d99('0x25')](respondWithResult(_0x437f13,0xc9))[_0x1d99('0x46')](handleError(_0x437f13,null));};exports[_0x1d99('0x24')]=function(_0x5e458b,_0x48affc){if(_0x5e458b['body']['id']){delete _0x5e458b[_0x1d99('0x4b')]['id'];}return db[_0x1d99('0x2d')]['find']({'where':{'id':_0x5e458b['params']['id']}})[_0x1d99('0x25')](handleEntityNotFound(_0x48affc,null))[_0x1d99('0x25')](saveUpdates(_0x5e458b[_0x1d99('0x4b')],null))[_0x1d99('0x25')](respondWithResult(_0x48affc,null))[_0x1d99('0x46')](handleError(_0x48affc,null));};exports[_0x1d99('0x26')]=function(_0x10d644,_0x184f0e){return db[_0x1d99('0x2d')][_0x1d99('0x4c')]({'where':{'id':_0x10d644[_0x1d99('0x48')]['id']}})[_0x1d99('0x25')](handleEntityNotFound(_0x184f0e,null))[_0x1d99('0x25')](removeEntity(_0x184f0e,null))[_0x1d99('0x46')](handleError(_0x184f0e,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index ac267eb..7a70886 100644 --- a/server/api/whatsappApplication/whatsappApplication.model.js +++ b/server/api/whatsappApplication/whatsappApplication.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8d0e=['./whatsappApplication.attributes','define','WhatsappApplication','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x2f50ab,_0x4dfe90){var _0x1e9b19=function(_0x4c4ab3){while(--_0x4c4ab3){_0x2f50ab['push'](_0x2f50ab['shift']());}};_0x1e9b19(++_0x4dfe90);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0xb01db,_0x4f5e43){_0xb01db=_0xb01db-0x0;var _0x36946f=_0x8d0e[_0xb01db];return _0x36946f;};'use strict';var _=require(_0xe8d0('0x0'));var util=require(_0xe8d0('0x1'));var logger=require(_0xe8d0('0x2'))(_0xe8d0('0x3'));var moment=require(_0xe8d0('0x4'));var BPromise=require(_0xe8d0('0x5'));var rp=require(_0xe8d0('0x6'));var fs=require('fs');var path=require(_0xe8d0('0x7'));var rimraf=require(_0xe8d0('0x8'));var config=require('../../config/environment');var attributes=require(_0xe8d0('0x9'));module['exports']=function(_0x560dab,_0x2e2985){return _0x560dab[_0xe8d0('0xa')](_0xe8d0('0xb'),attributes,{'tableName':_0xe8d0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe8d0('0xd'),'collate':_0xe8d0('0xe')});}; \ No newline at end of file +var _0x20ce=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappApplication.attributes','exports','define','WhatsappApplication','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0xce93c,_0x555be5){var _0x230720=function(_0x6d5428){while(--_0x6d5428){_0xce93c['push'](_0xce93c['shift']());}};_0x230720(++_0x555be5);}(_0x20ce,0x10d));var _0xe20c=function(_0x4fd12d,_0x407c88){_0x4fd12d=_0x4fd12d-0x0;var _0x1a97e2=_0x20ce[_0x4fd12d];return _0x1a97e2;};'use strict';var _=require(_0xe20c('0x0'));var util=require(_0xe20c('0x1'));var logger=require(_0xe20c('0x2'))('api');var moment=require(_0xe20c('0x3'));var BPromise=require(_0xe20c('0x4'));var rp=require(_0xe20c('0x5'));var fs=require('fs');var path=require(_0xe20c('0x6'));var rimraf=require(_0xe20c('0x7'));var config=require(_0xe20c('0x8'));var attributes=require(_0xe20c('0x9'));module[_0xe20c('0xa')]=function(_0x373f9f,_0x2c9e6a){return _0x373f9f[_0xe20c('0xb')](_0xe20c('0xc'),attributes,{'tableName':_0xe20c('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe20c('0xe'),'collate':_0xe20c('0xf')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index f5c2607..bbd6e68 100644 --- a/server/api/whatsappApplication/whatsappApplication.rpc.js +++ b/server/api/whatsappApplication/whatsappApplication.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['code','WhatsappApplication,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x4359d8,_0x566e23){var _0x2dcf4e=function(_0x185bd6){while(--_0x185bd6){_0x4359d8['push'](_0x4359d8['shift']());}};_0x2dcf4e(++_0x566e23);}(_0x70e0,0x17b));var _0x070e=function(_0x42c019,_0xd80ed3){_0x42c019=_0x42c019-0x0;var _0x1387f8=_0x70e0[_0x42c019];return _0x1387f8;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x070e('0x3'));var db=require(_0x070e('0x4'))['db'];var utils=require(_0x070e('0x5'));var logger=require(_0x070e('0x6'))('rpc');var config=require(_0x070e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x070e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56e420,_0x5032e5,_0x35ab0c){return new BPromise(function(_0x1e11f0,_0x604664){return client[_0x070e('0x9')](_0x56e420,_0x35ab0c)[_0x070e('0xa')](function(_0x68a09e){logger[_0x070e('0xb')]('WhatsappApplication,\x20%s,\x20%s',_0x5032e5,'request\x20sent');logger[_0x070e('0xc')](_0x070e('0xd'),_0x5032e5,_0x070e('0xe'),JSON[_0x070e('0xf')](_0x68a09e));if(_0x68a09e[_0x070e('0x10')]){if(_0x68a09e[_0x070e('0x10')][_0x070e('0x11')]===0x1f4){logger[_0x070e('0x10')](_0x070e('0x12'),_0x5032e5,_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);return _0x604664(_0x68a09e['error']['message']);}logger[_0x070e('0x10')]('WhatsappApplication,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('WhatsappApplication,\x20%s,\x20%s',_0x5032e5,_0x070e('0xe'));_0x1e11f0(_0x68a09e[_0x070e('0x14')][_0x070e('0x13')]);}})[_0x070e('0x15')](function(_0x5bc71e){logger['error'](_0x070e('0x12'),_0x5032e5,_0x5bc71e);_0x604664(_0x5bc71e);});});} \ No newline at end of file +var _0x5636=['code','WhatsappApplication,\x20%s,\x20%s','message','info','result','catch','lodash','util','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','error'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5636,0x102));var _0x6563=function(_0x419cdc,_0x15c1ff){_0x419cdc=_0x419cdc-0x0;var _0x59113a=_0x5636[_0x419cdc];return _0x59113a;};'use strict';var _=require(_0x6563('0x0'));var util=require(_0x6563('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6563('0x2'));var db=require(_0x6563('0x3'))['db'];var utils=require(_0x6563('0x4'));var logger=require('../../config/logger')(_0x6563('0x5'));var config=require(_0x6563('0x6'));var jayson=require(_0x6563('0x7'));var client=jayson[_0x6563('0x8')][_0x6563('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x193942,_0x9884a9,_0x2d57d5){return new BPromise(function(_0x2d0d5b,_0x98fcd4){return client[_0x6563('0xa')](_0x193942,_0x2d57d5)[_0x6563('0xb')](function(_0x3ccb4e){logger['info']('WhatsappApplication,\x20%s,\x20%s',_0x9884a9,_0x6563('0xc'));logger[_0x6563('0xd')]('WhatsappApplication,\x20%s,\x20%s,\x20%s',_0x9884a9,'request\x20sent',JSON['stringify'](_0x3ccb4e));if(_0x3ccb4e[_0x6563('0xe')]){if(_0x3ccb4e[_0x6563('0xe')][_0x6563('0xf')]===0x1f4){logger[_0x6563('0xe')](_0x6563('0x10'),_0x9884a9,_0x3ccb4e[_0x6563('0xe')][_0x6563('0x11')]);return _0x98fcd4(_0x3ccb4e[_0x6563('0xe')][_0x6563('0x11')]);}logger['error'](_0x6563('0x10'),_0x9884a9,_0x3ccb4e['error'][_0x6563('0x11')]);return _0x2d0d5b(_0x3ccb4e[_0x6563('0xe')][_0x6563('0x11')]);}else{logger[_0x6563('0x12')]('WhatsappApplication,\x20%s,\x20%s',_0x9884a9,_0x6563('0xc'));_0x2d0d5b(_0x3ccb4e[_0x6563('0x13')][_0x6563('0x11')]);}})[_0x6563('0x14')](function(_0x4e7282){logger[_0x6563('0xe')]('WhatsappApplication,\x20%s,\x20%s',_0x9884a9,_0x4e7282);_0x98fcd4(_0x4e7282);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index b027163..4d5e2c9 100644 --- a/server/api/whatsappInteraction/index.js +++ b/server/api/whatsappInteraction/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x038b=['/:id','/:id/messages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','put','whatsappinteraction:update','delete','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./whatsappInteraction.controller','get','/describe','isAuthenticated'];(function(_0x38f86b,_0x45b662){var _0x10832f=function(_0x35f66a){while(--_0x35f66a){_0x38f86b['push'](_0x38f86b['shift']());}};_0x10832f(++_0x45b662);}(_0x038b,0x114));var _0xb038=function(_0x375b21,_0x3d7ec0){_0x375b21=_0x375b21-0x0;var _0x5d0cee=_0x038b[_0x375b21];return _0x5d0cee;};'use strict';var multer=require('multer');var util=require(_0xb038('0x0'));var path=require(_0xb038('0x1'));var timeout=require(_0xb038('0x2'));var express=require('express');var router=express[_0xb038('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xb038('0x4'));var interaction=require(_0xb038('0x5'));var config=require('../../config/environment');var controller=require(_0xb038('0x6'));router[_0xb038('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xb038('0x7')](_0xb038('0x8'),auth[_0xb038('0x9')](),controller['describe']);router['get'](_0xb038('0xa'),auth[_0xb038('0x9')](),controller['show']);router['get'](_0xb038('0xb'),auth[_0xb038('0x9')](),controller['getMessages']);router[_0xb038('0x7')](_0xb038('0xc'),auth[_0xb038('0x9')](),controller[_0xb038('0xd')]);router[_0xb038('0xe')]('/',auth[_0xb038('0x9')](),controller[_0xb038('0xf')]);router[_0xb038('0xe')](_0xb038('0xb'),auth[_0xb038('0x9')](),controller[_0xb038('0x10')]);router[_0xb038('0xe')](_0xb038('0x11'),auth[_0xb038('0x9')](),interaction[_0xb038('0x12')](_0xb038('0x13'),_0xb038('0x14')),controller['addTags']);router[_0xb038('0x15')](_0xb038('0xa'),auth[_0xb038('0x9')](),interaction[_0xb038('0x12')](_0xb038('0x13'),_0xb038('0x16')),controller['update']);router[_0xb038('0x17')](_0xb038('0xa'),auth[_0xb038('0x9')](),interaction[_0xb038('0x12')]('whatsapp','whatsappinteraction:destroy'),controller[_0xb038('0x18')]);router[_0xb038('0x17')](_0xb038('0x11'),auth[_0xb038('0x9')](),controller['removeTags']);module[_0xb038('0x19')]=router; \ No newline at end of file +var _0xbff5=['addTags','put','tracked','whatsapp','update','delete','whatsappinteraction:destroy','destroy','removeTags','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','post','addMessage','/:id/tags','whatsappinteraction:addtags'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xbff5,0x1bc));var _0x5bff=function(_0x4884e3,_0xad95a){_0x4884e3=_0x4884e3-0x0;var _0x693c7=_0xbff5[_0x4884e3];return _0x693c7;};'use strict';var multer=require(_0x5bff('0x0'));var util=require(_0x5bff('0x1'));var path=require(_0x5bff('0x2'));var timeout=require(_0x5bff('0x3'));var express=require(_0x5bff('0x4'));var router=express[_0x5bff('0x5')]();var fs_extra=require(_0x5bff('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x5bff('0x7'));var config=require('../../config/environment');var controller=require('./whatsappInteraction.controller');router[_0x5bff('0x8')]('/',auth[_0x5bff('0x9')](),controller[_0x5bff('0xa')]);router[_0x5bff('0x8')](_0x5bff('0xb'),auth[_0x5bff('0x9')](),controller[_0x5bff('0xc')]);router[_0x5bff('0x8')](_0x5bff('0xd'),auth['isAuthenticated'](),controller[_0x5bff('0xe')]);router['get'](_0x5bff('0xf'),auth[_0x5bff('0x9')](),controller['getMessages']);router[_0x5bff('0x8')]('/:id/download',auth[_0x5bff('0x9')](),controller['download']);router[_0x5bff('0x10')]('/',auth[_0x5bff('0x9')](),controller['create']);router[_0x5bff('0x10')]('/:id/messages',auth[_0x5bff('0x9')](),controller[_0x5bff('0x11')]);router['post'](_0x5bff('0x12'),auth[_0x5bff('0x9')](),interaction['tracked']('whatsapp',_0x5bff('0x13')),controller[_0x5bff('0x14')]);router[_0x5bff('0x15')]('/:id',auth[_0x5bff('0x9')](),interaction[_0x5bff('0x16')](_0x5bff('0x17'),'whatsappinteraction:update'),controller[_0x5bff('0x18')]);router[_0x5bff('0x19')](_0x5bff('0xd'),auth['isAuthenticated'](),interaction[_0x5bff('0x16')](_0x5bff('0x17'),_0x5bff('0x1a')),controller[_0x5bff('0x1b')]);router['delete'](_0x5bff('0x12'),auth['isAuthenticated'](),controller[_0x5bff('0x1c')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index 1cbd8c6..81b5576 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.attributes.js +++ b/server/api/whatsappInteraction/whatsappInteraction.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8ed7=['exports','BOOLEAN','STRING','DATE','ENUM','out','moment'];(function(_0x3f1230,_0x3da84c){var _0x4f06c9=function(_0x1091a1){while(--_0x1091a1){_0x3f1230['push'](_0x3f1230['shift']());}};_0x4f06c9(++_0x3da84c);}(_0x8ed7,0x8b));var _0x78ed=function(_0x1a023c,_0x39ada1){_0x1a023c=_0x1a023c-0x0;var _0x27e79d=_0x8ed7[_0x1a023c];return _0x27e79d;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x78ed('0x0'));module[_0x78ed('0x1')]={'closed':{'type':Sequelize[_0x78ed('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x78ed('0x3')]},'thirdDisposition':{'type':Sequelize[_0x78ed('0x3')]},'note':{'type':Sequelize[_0x78ed('0x3')]},'phone':{'type':Sequelize[_0x78ed('0x3')]},'read1stAt':{'type':Sequelize[_0x78ed('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x78ed('0x5')]('in',_0x78ed('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x78ed('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x78ed('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x78ed('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xfa94=['BOOLEAN','sequelize','exports','DATE','STRING','ENUM','out'];(function(_0x18cac4,_0x57a4d5){var _0x2227c6=function(_0x72934d){while(--_0x72934d){_0x18cac4['push'](_0x18cac4['shift']());}};_0x2227c6(++_0x57a4d5);}(_0xfa94,0xef));var _0x4fa9=function(_0x287528,_0x2fbba7){_0x287528=_0x287528-0x0;var _0xc05e28=_0xfa94[_0x287528];return _0xc05e28;};'use strict';var Sequelize=require(_0x4fa9('0x0'));var moment=require('moment');module[_0x4fa9('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x4fa9('0x2')]},'disposition':{'type':Sequelize[_0x4fa9('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x4fa9('0x3')]},'note':{'type':Sequelize[_0x4fa9('0x3')]},'phone':{'type':Sequelize[_0x4fa9('0x3')]},'read1stAt':{'type':Sequelize[_0x4fa9('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x4fa9('0x4')]('in',_0x4fa9('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x4fa9('0x2')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x4fa9('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x4fa9('0x6')],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index 0705742..24c6e7c 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.controller.js +++ b/server/api/whatsappInteraction/whatsappInteraction.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5100=['whatsappInteractionTags:save','removeTags','download','unix','toString','join','root','server','files','tmp','attachments','format','transcript-%d-%s.zip','push','User','fullname','CmContact','Contact','lastName','Attachment','direction','secret','read','WhatsappAccount','Account','Owner','mkdirSync','N.A.','YYYY-MM-DD\x20HH:mm:ss','closed','disposition','Messages','map','basename','existsSync','createReadStream','pipe','createWriteStream','createdAt','System','firstName','out','value','renderFile','downloadInteraction.ejs','.pdf','Whatsapp','log','err','unlinkSync','rimraf','zip-dir','moment','bluebird','util','path','lodash','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','register','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','update','then','error','stack','name','index','WhatsappInteraction','rawAttributes','fieldName','key','getOptions','findAll','whatsapp','query','user','catch','show','params','model','keys','filters','intersection','attributes','fields','length','includeAll','merge','options','find','create','body','destroy','describe','ids','omit','findOne','WhatsappMessage','hasOwnProperty','nolimit','order','sort','where','pick','WhatsappInteractionId','filter','$gte','split','rows','addTags','setTags','spread','Tag'];(function(_0x1646fa,_0x4e5bd7){var _0x5a47a5=function(_0x2db820){while(--_0x2db820){_0x1646fa['push'](_0x1646fa['shift']());}};_0x5a47a5(++_0x4e5bd7);}(_0x5100,0x132));var _0x0510=function(_0x3e81d9,_0x488e01){_0x3e81d9=_0x3e81d9-0x0;var _0x311823=_0x5100[_0x3e81d9];return _0x311823;};'use strict';var rimraf=require(_0x0510('0x0'));var zipdir=require(_0x0510('0x1'));var moment=require(_0x0510('0x2'));var BPromise=require(_0x0510('0x3'));var util=require(_0x0510('0x4'));var path=require(_0x0510('0x5'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x0510('0x6'));var Redis=require('ioredis');var interaction=require(_0x0510('0x7'));var qs=require(_0x0510('0x8'));var pdf=require('../../components/export/pdf');var logger=require(_0x0510('0x9'))(_0x0510('0xa'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x0510('0xb')]=_['defaults'](config[_0x0510('0xb')],{'host':_0x0510('0xc'),'port':0x18eb});var socket=require(_0x0510('0xd'))(new Redis(config[_0x0510('0xb')]));require(_0x0510('0xe'))[_0x0510('0xf')](socket);function respondWithStatusCode(_0x158cb4,_0x41d924){_0x41d924=_0x41d924||0xcc;return function(_0x329d7f){if(_0x329d7f){return _0x158cb4[_0x0510('0x10')](_0x41d924);}return _0x158cb4[_0x0510('0x11')](_0x41d924)[_0x0510('0x12')]();};}function respondWithResult(_0x3832e8,_0x3e567e){_0x3e567e=_0x3e567e||0xc8;return function(_0x302e15){if(_0x302e15){return _0x3832e8[_0x0510('0x11')](_0x3e567e)[_0x0510('0x13')](_0x302e15);}};}function respondWithFilteredResult(_0x1651a6,_0x4a76ee){return function(_0xc3aecf){if(_0xc3aecf){var _0x46391b=typeof _0x4a76ee['offset']===_0x0510('0x14')&&typeof _0x4a76ee['limit']===_0x0510('0x14');var _0x1ba2b2=_0xc3aecf[_0x0510('0x15')];var _0x4629d4=_0x46391b?0x0:_0x4a76ee[_0x0510('0x16')];var _0x5a2952=_0x46391b?_0xc3aecf[_0x0510('0x15')]:_0x4a76ee['offset']+_0x4a76ee[_0x0510('0x17')];var _0x5574b1;if(_0x5a2952>=_0x1ba2b2){_0x5a2952=_0x1ba2b2;_0x5574b1=0xc8;}else{_0x5574b1=0xce;}_0x1651a6[_0x0510('0x11')](_0x5574b1);return _0x1651a6[_0x0510('0x18')](_0x0510('0x19'),_0x4629d4+'-'+_0x5a2952+'/'+_0x1ba2b2)['json'](_0xc3aecf);}return null;};}function saveUpdates(_0x10ef12){return function(_0x2713ab){if(_0x2713ab){return _0x2713ab[_0x0510('0x1a')](_0x10ef12)['then'](function(_0x3ff29f){return _0x3ff29f;});}return null;};}function removeEntity(_0x3573dd){return function(_0x2682c5){if(_0x2682c5){return _0x2682c5['destroy']()[_0x0510('0x1b')](function(){_0x3573dd[_0x0510('0x11')](0xcc)[_0x0510('0x12')]();});}};}function handleEntityNotFound(_0x2a7d9c){return function(_0x1119c1){if(!_0x1119c1){_0x2a7d9c['sendStatus'](0x194);}return _0x1119c1;};}function handleError(_0x1262e0,_0x335877){_0x335877=_0x335877||0x1f4;return function(_0x2e1436){logger[_0x0510('0x1c')](_0x2e1436[_0x0510('0x1d')]);if(_0x2e1436['name']){delete _0x2e1436[_0x0510('0x1e')];}_0x1262e0[_0x0510('0x11')](_0x335877)['send'](_0x2e1436);};}exports[_0x0510('0x1f')]=function(_0x17788c,_0x253834){var _0x277b1d={};var _0x2ab8f0=_['map'](db[_0x0510('0x20')][_0x0510('0x21')],function(_0x19b003){return{'name':_0x19b003[_0x0510('0x22')],'type':_0x19b003['type'][_0x0510('0x23')]};});_0x277b1d=qs[_0x0510('0x24')](_0x2ab8f0,_0x17788c);return interaction[_0x0510('0x25')](_0x0510('0x26'),_0x17788c[_0x0510('0x27')],_0x17788c[_0x0510('0x28')],_0x277b1d,_0x2ab8f0)[_0x0510('0x1b')](respondWithFilteredResult(_0x253834,_0x277b1d))[_0x0510('0x29')](handleError(_0x253834,null));};exports[_0x0510('0x2a')]=function(_0x158b94,_0x37e79b){var _0x498e72={'raw':![],'where':{'id':_0x158b94[_0x0510('0x2b')]['id']}},_0x437adb={};_0x437adb[_0x0510('0x2c')]=_[_0x0510('0x2d')](db[_0x0510('0x20')][_0x0510('0x21')]);_0x437adb['query']=_['keys'](_0x158b94['query']);_0x437adb[_0x0510('0x2e')]=_[_0x0510('0x2f')](_0x437adb[_0x0510('0x2c')],_0x437adb['query']);_0x498e72[_0x0510('0x30')]=_[_0x0510('0x2f')](_0x437adb[_0x0510('0x2c')],qs['fields'](_0x158b94[_0x0510('0x27')][_0x0510('0x31')]));_0x498e72[_0x0510('0x30')]=_0x498e72[_0x0510('0x30')][_0x0510('0x32')]?_0x498e72[_0x0510('0x30')]:_0x437adb[_0x0510('0x2c')];if(_0x158b94[_0x0510('0x27')][_0x0510('0x33')]){_0x498e72['include']=[{'all':!![]}];}_0x498e72=_[_0x0510('0x34')]({},_0x498e72,_0x158b94[_0x0510('0x35')]);return db[_0x0510('0x20')][_0x0510('0x36')](_0x498e72)[_0x0510('0x1b')](handleEntityNotFound(_0x37e79b,null))[_0x0510('0x1b')](respondWithResult(_0x37e79b,null))[_0x0510('0x29')](handleError(_0x37e79b,null));};exports[_0x0510('0x37')]=function(_0x4a2100,_0xf86e9e){return db['WhatsappInteraction'][_0x0510('0x37')](_0x4a2100[_0x0510('0x38')],{})[_0x0510('0x1b')](respondWithResult(_0xf86e9e,0xc9))['catch'](handleError(_0xf86e9e,null));};exports['update']=function(_0x549f33,_0x1b5249){if(_0x549f33[_0x0510('0x38')]['id']){delete _0x549f33[_0x0510('0x38')]['id'];}return db['WhatsappInteraction']['find']({'where':{'id':_0x549f33[_0x0510('0x2b')]['id']}})['then'](handleEntityNotFound(_0x1b5249,null))[_0x0510('0x1b')](saveUpdates(_0x549f33[_0x0510('0x38')],null))['then'](respondWithResult(_0x1b5249,null))['catch'](handleError(_0x1b5249,null));};exports[_0x0510('0x39')]=function(_0x4d5205,_0x12f29f){return db[_0x0510('0x20')]['find']({'where':{'id':_0x4d5205['params']['id']}})[_0x0510('0x1b')](handleEntityNotFound(_0x12f29f,null))[_0x0510('0x1b')](removeEntity(_0x12f29f,null))[_0x0510('0x29')](handleError(_0x12f29f,null));};exports[_0x0510('0x3a')]=function(_0x49d334,_0x5a935f){return db[_0x0510('0x20')][_0x0510('0x3a')]()[_0x0510('0x1b')](respondWithResult(_0x5a935f,null))[_0x0510('0x29')](handleError(_0x5a935f,null));};exports['addMessage']=function(_0x41dac7,_0x290662){return db['WhatsappMessage']['find']({'where':{'id':_0x41dac7['params']['id']}})[_0x0510('0x1b')](handleEntityNotFound(_0x290662,null))['then'](function(_0x351a5d){if(_0x351a5d){return _0x351a5d['addMessage'](_0x41dac7[_0x0510('0x38')][_0x0510('0x3b')],_[_0x0510('0x3c')](_0x41dac7['body'],[_0x0510('0x3b'),'id'])||{});}})['then'](respondWithResult(_0x290662,null))[_0x0510('0x29')](handleError(_0x290662,null));};exports['getMessages']=function(_0x5d9a09,_0x5303b8){var _0x344cd1={'raw':![],'where':{}};var _0x1f481b={};var _0x28c7ff={'count':0x0,'rows':[]};return db[_0x0510('0x20')][_0x0510('0x3d')]({'where':{'id':_0x5d9a09[_0x0510('0x2b')]['id']}})[_0x0510('0x1b')](handleEntityNotFound(_0x5303b8,null))[_0x0510('0x1b')](function(_0xc542e8){if(_0xc542e8){_0x1f481b['model']=_['keys'](db[_0x0510('0x3e')]['rawAttributes']);_0x1f481b[_0x0510('0x27')]=_[_0x0510('0x2d')](_0x5d9a09[_0x0510('0x27')]);_0x1f481b[_0x0510('0x2e')]=_[_0x0510('0x2f')](_0x1f481b[_0x0510('0x2c')],_0x1f481b['query']);_0x344cd1['attributes']=_[_0x0510('0x2f')](_0x1f481b['model'],qs['fields'](_0x5d9a09[_0x0510('0x27')][_0x0510('0x31')]));_0x344cd1[_0x0510('0x30')]=_0x344cd1[_0x0510('0x30')]['length']?_0x344cd1[_0x0510('0x30')]:_0x1f481b[_0x0510('0x2c')];if(!_0x5d9a09[_0x0510('0x27')][_0x0510('0x3f')](_0x0510('0x40'))){_0x344cd1[_0x0510('0x17')]=qs['limit'](_0x5d9a09['query'][_0x0510('0x17')]);_0x344cd1[_0x0510('0x16')]=qs[_0x0510('0x16')](_0x5d9a09[_0x0510('0x27')]['offset']);}_0x344cd1[_0x0510('0x41')]=qs['sort'](_0x5d9a09['query'][_0x0510('0x42')]);_0x344cd1[_0x0510('0x43')]=qs[_0x0510('0x2e')](_[_0x0510('0x44')](_0x5d9a09[_0x0510('0x27')],_0x1f481b['filters']));_0x344cd1[_0x0510('0x43')][_0x0510('0x45')]=_0xc542e8['id'];if(_0x5d9a09['query']['filter']){_0x344cd1[_0x0510('0x43')]=_[_0x0510('0x34')](_0x344cd1[_0x0510('0x43')],{'$or':_['map'](_0x344cd1[_0x0510('0x30')],function(_0x535a32){var _0x3e579c={};_0x3e579c[_0x535a32]={'$like':'%'+_0x5d9a09[_0x0510('0x27')][_0x0510('0x46')]+'%'};return _0x3e579c;})});}if(_0x5d9a09['query'][_0x0510('0x47')]){var _0x2af47f=_0x5d9a09[_0x0510('0x27')][_0x0510('0x47')][_0x0510('0x48')](',');var _0x3a0dee={};_0x3a0dee[_0x2af47f[0x0]]={'$gte':moment(_0x2af47f[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x344cd1['where']=_['merge'](_0x344cd1['where'],_0x3a0dee);}_0x344cd1=_[_0x0510('0x34')]({},_0x344cd1,_0x5d9a09['options']);return db[_0x0510('0x3e')][_0x0510('0x15')]({'where':_0x344cd1[_0x0510('0x43')]})[_0x0510('0x1b')](function(_0x39b239){_0x28c7ff[_0x0510('0x15')]=_0x39b239;if(_0x5d9a09[_0x0510('0x27')]['includeAll']){_0x344cd1['include']=[{'all':!![]}];}return db['WhatsappMessage'][_0x0510('0x25')](_0x344cd1);})[_0x0510('0x1b')](function(_0x528cbd){_0x28c7ff[_0x0510('0x49')]=_0x528cbd;return _0x28c7ff;});}})[_0x0510('0x1b')](respondWithFilteredResult(_0x5303b8,_0x344cd1))['catch'](handleError(_0x5303b8,null));};exports[_0x0510('0x4a')]=function(_0x306d44,_0x2a952){return db['WhatsappInteraction'][_0x0510('0x36')]({'where':{'id':_0x306d44['params']['id']}})[_0x0510('0x1b')](handleEntityNotFound(_0x2a952,null))[_0x0510('0x1b')](function(_0x57c97b){if(_0x57c97b){return _0x57c97b[_0x0510('0x4b')](_0x306d44[_0x0510('0x38')][_0x0510('0x3b')],_[_0x0510('0x3c')](_0x306d44['body'],[_0x0510('0x3b'),'id'])||{})[_0x0510('0x4c')](function(){return db[_0x0510('0x4d')]['findAll']({'attributes':['id','name','color'],'where':{'id':_0x306d44[_0x0510('0x38')][_0x0510('0x3b')]}});})[_0x0510('0x1b')](function(_0x3baef0){socket['emit'](_0x0510('0x4e'),{'id':Number(_0x306d44[_0x0510('0x2b')]['id']),'tags':_0x3baef0||[]});return{'id':Number(_0x306d44['params']['id']),'tags':_0x3baef0||[]};});}})['then'](respondWithResult(_0x2a952,null))[_0x0510('0x29')](handleError(_0x2a952,null));};exports[_0x0510('0x4f')]=function(_0x816325,_0x3d54c6){return db[_0x0510('0x20')][_0x0510('0x36')]({'where':{'id':_0x816325[_0x0510('0x2b')]['id']}})['then'](handleEntityNotFound(_0x3d54c6,null))['then'](function(_0x13f2b){if(_0x13f2b){return _0x13f2b[_0x0510('0x4f')](_0x816325[_0x0510('0x27')][_0x0510('0x3b')]);}})[_0x0510('0x1b')](respondWithStatusCode(_0x3d54c6,null))[_0x0510('0x29')](handleError(_0x3d54c6,null));};exports[_0x0510('0x50')]=function(_0x18018b,_0x4d4968){var _0x12247b=moment()[_0x0510('0x51')]()[_0x0510('0x52')]();var _0x591362=path[_0x0510('0x53')](config[_0x0510('0x54')],_0x0510('0x55'),_0x0510('0x56'),_0x0510('0x57'));var _0x4a7bc0=path[_0x0510('0x53')](config['root'],_0x0510('0x55'),_0x0510('0x56'),_0x0510('0x58'));var _0x2049f3=path[_0x0510('0x53')](_0x591362,_0x12247b);var _0x1fa12e=util[_0x0510('0x59')](_0x0510('0x5a'),_0x18018b['params']['id'],_0x12247b);var _0x3ce82e=path[_0x0510('0x53')](_0x591362,_0x1fa12e);var _0x1246af=[];_0x1246af[_0x0510('0x5b')]({'model':db['User'],'as':_0x0510('0x5c'),'attributes':['id',_0x0510('0x5d')],'raw':!![]});_0x1246af[_0x0510('0x5b')]({'model':db[_0x0510('0x5e')],'as':_0x0510('0x5f'),'attributes':['id','firstName',_0x0510('0x60')],'raw':!![]});if(_0x18018b[_0x0510('0x27')][_0x0510('0x58')]){_0x1246af[_0x0510('0x5b')]({'model':db[_0x0510('0x61')],'as':_0x0510('0x61'),'raw':!![]});}var _0x40db5d=[{'model':db[_0x0510('0x3e')],'as':'Messages','attributes':['id',_0x0510('0x38'),'createdAt',_0x0510('0x62'),_0x0510('0x63'),_0x0510('0x64')],'include':_0x1246af}];_0x40db5d[_0x0510('0x5b')]({'model':db[_0x0510('0x65')],'as':_0x0510('0x66'),'attributes':['id','name']});_0x40db5d['push']({'model':db[_0x0510('0x5c')],'as':_0x0510('0x67'),'attributes':['id',_0x0510('0x5d')]});return db[_0x0510('0x20')]['find']({'where':{'id':_0x18018b[_0x0510('0x2b')]['id']},'include':_0x40db5d})[_0x0510('0x1b')](handleEntityNotFound(_0x4d4968,null))[_0x0510('0x1b')](function(_0x574298){if(_0x574298){var _0xae9848=_0x574298['get']({'plain':!![]});fs[_0x0510('0x68')](_0x2049f3);var _0x4b972a={'channel':'Whatsapp','account':_0xae9848['Account'][_0x0510('0x1e')],'agent':_0xae9848['Owner']?_0xae9848[_0x0510('0x67')][_0x0510('0x5d')]:_0x0510('0x69'),'createdAt':moment(_0xae9848['createdAt'])[_0x0510('0x59')](_0x0510('0x6a'))[_0x0510('0x52')](),'closedAt':_0xae9848[_0x0510('0x6b')]?moment(_0xae9848['closedAt'])[_0x0510('0x59')](_0x0510('0x6a'))['toString']():'','disposition':_0xae9848[_0x0510('0x6c')],'messages':_(_0xae9848[_0x0510('0x6d')])[_0x0510('0x46')]({'secret':![]})[_0x0510('0x6e')](function(_0x2eec9a){if(_0x2eec9a[_0x0510('0x61')]){var _0x2af9b1=path[_0x0510('0x53')](_0x4a7bc0,_0x2eec9a[_0x0510('0x61')][_0x0510('0x6f')]);if(fs[_0x0510('0x70')](_0x2af9b1)){fs[_0x0510('0x71')](_0x2af9b1)[_0x0510('0x72')](fs[_0x0510('0x73')](path[_0x0510('0x53')](_0x2049f3,_0x2eec9a[_0x0510('0x61')][_0x0510('0x6f')])));}}return{'date':moment(_0x2eec9a[_0x0510('0x74')])[_0x0510('0x59')](_0x0510('0x6a'))[_0x0510('0x52')](),'sender':_0x2eec9a[_0x0510('0x62')]==='out'?_0x2eec9a[_0x0510('0x5c')]?_0x2eec9a[_0x0510('0x5c')][_0x0510('0x5d')]:_0x0510('0x75'):_0x2eec9a[_0x0510('0x5f')][_0x0510('0x76')]+(_0x2eec9a[_0x0510('0x5f')][_0x0510('0x60')]?'\x20'+_0x2eec9a[_0x0510('0x5f')][_0x0510('0x60')]:''),'body':_0x2eec9a[_0x0510('0x61')]?_0x2eec9a[_0x0510('0x61')][_0x0510('0x6f')]:_0x2eec9a[_0x0510('0x38')],'direction':_0x2eec9a[_0x0510('0x62')]===_0x0510('0x77')?'A':'C','secret':_0x2eec9a['secret'],'read':_0x2eec9a[_0x0510('0x64')],'attachment':_0x2eec9a['Attachment']};})[_0x0510('0x78')]()};return ejs[_0x0510('0x79')](path[_0x0510('0x53')](config[_0x0510('0x54')],'server','views',_0x0510('0x7a')),{'interaction':_0x4b972a})[_0x0510('0x1b')](function(_0x412d88){var _0x525fba=path[_0x0510('0x53')](_0x2049f3,'transcript-'+_0xae9848['id']+'-'+_0x12247b+_0x0510('0x7b'));var _0x31280f={'path':_0x525fba,'channel':_0x0510('0x7c'),'interactionId':_0xae9848['id']};return pdf['createPdfFromHTML'](_0x412d88,_0x31280f);})['then'](function(){return new BPromise(function(_0x5ab548,_0x362b4e){zipdir(_0x2049f3,{'saveTo':_0x3ce82e},function(_0x54686d,_0x581d6f){if(_0x54686d)return _0x362b4e(_0x54686d);return _0x5ab548(_0x581d6f);});})[_0x0510('0x1b')](function(){return new BPromise(function(_0x64cc,_0x2874df){rimraf(_0x2049f3,function(_0x16c8dc){if(_0x16c8dc)_0x2874df(_0x16c8dc);return _0x64cc();});});})[_0x0510('0x1b')](function(){return _0x4d4968[_0x0510('0x50')](_0x3ce82e,_0x1fa12e,function(_0x12ff77){if(_0x12ff77){console[_0x0510('0x7d')](_0x0510('0x7e'),_0x12ff77);}else{fs[_0x0510('0x7f')](_0x3ce82e);}});});});}else{return _0x4d4968[_0x0510('0x10')](0xc8);}})[_0x0510('0x29')](handleError(_0x4d4968,null));}; \ No newline at end of file +var _0x1387=['moment','bluebird','util','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','whatsapp','query','user','catch','show','params','model','keys','filters','intersection','attributes','fields','length','includeAll','merge','options','WhatsappInteraction','find','create','body','describe','addMessage','WhatsappMessage','ids','omit','findOne','hasOwnProperty','nolimit','order','where','pick','WhatsappInteractionId','filter','$gte','format','YYYY-MM-DD\x20HH:mm:ss','include','findAll','rows','setTags','spread','Tag','color','emit','whatsappInteractionTags:save','removeTags','unix','toString','server','files','tmp','join','root','attachments','push','User','fullname','CmContact','Contact','firstName','lastName','Attachment','Messages','createdAt','secret','read','WhatsappAccount','Account','Owner','get','mkdirSync','Whatsapp','closedAt','disposition','basename','createReadStream','out','System','direction','renderFile','views','downloadInteraction.ejs','.pdf','log','err','unlinkSync','rimraf','zip-dir'];(function(_0x5b9e83,_0x53f77c){var _0x5c1cba=function(_0x48de96){while(--_0x48de96){_0x5b9e83['push'](_0x5b9e83['shift']());}};_0x5c1cba(++_0x53f77c);}(_0x1387,0x7c));var _0x7138=function(_0x15b6fb,_0x226c53){_0x15b6fb=_0x15b6fb-0x0;var _0xb94054=_0x1387[_0x15b6fb];return _0xb94054;};'use strict';var rimraf=require(_0x7138('0x0'));var zipdir=require(_0x7138('0x1'));var moment=require(_0x7138('0x2'));var BPromise=require(_0x7138('0x3'));var util=require(_0x7138('0x4'));var path=require('path');var ejs=require(_0x7138('0x5'));var fs=require('fs');var _=require(_0x7138('0x6'));var Redis=require(_0x7138('0x7'));var interaction=require(_0x7138('0x8'));var qs=require(_0x7138('0x9'));var pdf=require('../../components/export/pdf');var logger=require('../../config/logger')('api');var config=require(_0x7138('0xa'));var db=require(_0x7138('0xb'))['db'];config[_0x7138('0xc')]=_[_0x7138('0xd')](config['redis'],{'host':_0x7138('0xe'),'port':0x18eb});var socket=require(_0x7138('0xf'))(new Redis(config[_0x7138('0xc')]));require(_0x7138('0x10'))[_0x7138('0x11')](socket);function respondWithStatusCode(_0x425af3,_0x3cedb6){_0x3cedb6=_0x3cedb6||0xcc;return function(_0x1ee846){if(_0x1ee846){return _0x425af3[_0x7138('0x12')](_0x3cedb6);}return _0x425af3[_0x7138('0x13')](_0x3cedb6)[_0x7138('0x14')]();};}function respondWithResult(_0x3b3851,_0x12877f){_0x12877f=_0x12877f||0xc8;return function(_0x796bb4){if(_0x796bb4){return _0x3b3851[_0x7138('0x13')](_0x12877f)[_0x7138('0x15')](_0x796bb4);}};}function respondWithFilteredResult(_0x4156ea,_0x39d798){return function(_0x337db9){if(_0x337db9){var _0x39707b=typeof _0x39d798[_0x7138('0x16')]===_0x7138('0x17')&&typeof _0x39d798[_0x7138('0x18')]===_0x7138('0x17');var _0x55c506=_0x337db9[_0x7138('0x19')];var _0xfc6962=_0x39707b?0x0:_0x39d798[_0x7138('0x16')];var _0x52be73=_0x39707b?_0x337db9[_0x7138('0x19')]:_0x39d798['offset']+_0x39d798[_0x7138('0x18')];var _0x14d4f2;if(_0x52be73>=_0x55c506){_0x52be73=_0x55c506;_0x14d4f2=0xc8;}else{_0x14d4f2=0xce;}_0x4156ea[_0x7138('0x13')](_0x14d4f2);return _0x4156ea['set'](_0x7138('0x1a'),_0xfc6962+'-'+_0x52be73+'/'+_0x55c506)['json'](_0x337db9);}return null;};}function saveUpdates(_0x1f8085){return function(_0x24ba84){if(_0x24ba84){return _0x24ba84[_0x7138('0x1b')](_0x1f8085)[_0x7138('0x1c')](function(_0x4f6a24){return _0x4f6a24;});}return null;};}function removeEntity(_0x2aa959){return function(_0x58fd78){if(_0x58fd78){return _0x58fd78[_0x7138('0x1d')]()['then'](function(){_0x2aa959['status'](0xcc)[_0x7138('0x14')]();});}};}function handleEntityNotFound(_0x33c23a){return function(_0x43bc59){if(!_0x43bc59){_0x33c23a[_0x7138('0x12')](0x194);}return _0x43bc59;};}function handleError(_0x201a59,_0x4dcc42){_0x4dcc42=_0x4dcc42||0x1f4;return function(_0x8a1c65){logger[_0x7138('0x1e')](_0x8a1c65[_0x7138('0x1f')]);if(_0x8a1c65[_0x7138('0x20')]){delete _0x8a1c65['name'];}_0x201a59['status'](_0x4dcc42)[_0x7138('0x21')](_0x8a1c65);};}exports[_0x7138('0x22')]=function(_0x3ba8fe,_0x213709){var _0x4ef358={};var _0x30e8d2=_[_0x7138('0x23')](db['WhatsappInteraction'][_0x7138('0x24')],function(_0x3ed920){return{'name':_0x3ed920[_0x7138('0x25')],'type':_0x3ed920[_0x7138('0x26')][_0x7138('0x27')]};});_0x4ef358=qs['getOptions'](_0x30e8d2,_0x3ba8fe);return interaction['findAll'](_0x7138('0x28'),_0x3ba8fe[_0x7138('0x29')],_0x3ba8fe[_0x7138('0x2a')],_0x4ef358,_0x30e8d2)['then'](respondWithFilteredResult(_0x213709,_0x4ef358))[_0x7138('0x2b')](handleError(_0x213709,null));};exports[_0x7138('0x2c')]=function(_0x18d7f4,_0x1c3510){var _0x3234c6={'raw':![],'where':{'id':_0x18d7f4[_0x7138('0x2d')]['id']}},_0x21bae1={};_0x21bae1[_0x7138('0x2e')]=_[_0x7138('0x2f')](db['WhatsappInteraction'][_0x7138('0x24')]);_0x21bae1[_0x7138('0x29')]=_['keys'](_0x18d7f4[_0x7138('0x29')]);_0x21bae1[_0x7138('0x30')]=_[_0x7138('0x31')](_0x21bae1[_0x7138('0x2e')],_0x21bae1[_0x7138('0x29')]);_0x3234c6[_0x7138('0x32')]=_[_0x7138('0x31')](_0x21bae1[_0x7138('0x2e')],qs[_0x7138('0x33')](_0x18d7f4['query'][_0x7138('0x33')]));_0x3234c6[_0x7138('0x32')]=_0x3234c6[_0x7138('0x32')][_0x7138('0x34')]?_0x3234c6[_0x7138('0x32')]:_0x21bae1['model'];if(_0x18d7f4[_0x7138('0x29')][_0x7138('0x35')]){_0x3234c6['include']=[{'all':!![]}];}_0x3234c6=_[_0x7138('0x36')]({},_0x3234c6,_0x18d7f4[_0x7138('0x37')]);return db[_0x7138('0x38')][_0x7138('0x39')](_0x3234c6)[_0x7138('0x1c')](handleEntityNotFound(_0x1c3510,null))[_0x7138('0x1c')](respondWithResult(_0x1c3510,null))[_0x7138('0x2b')](handleError(_0x1c3510,null));};exports[_0x7138('0x3a')]=function(_0xd34574,_0x443fd8){return db[_0x7138('0x38')][_0x7138('0x3a')](_0xd34574[_0x7138('0x3b')],{})['then'](respondWithResult(_0x443fd8,0xc9))[_0x7138('0x2b')](handleError(_0x443fd8,null));};exports[_0x7138('0x1b')]=function(_0x2bf2ec,_0x510a46){if(_0x2bf2ec[_0x7138('0x3b')]['id']){delete _0x2bf2ec[_0x7138('0x3b')]['id'];}return db[_0x7138('0x38')][_0x7138('0x39')]({'where':{'id':_0x2bf2ec[_0x7138('0x2d')]['id']}})[_0x7138('0x1c')](handleEntityNotFound(_0x510a46,null))[_0x7138('0x1c')](saveUpdates(_0x2bf2ec[_0x7138('0x3b')],null))[_0x7138('0x1c')](respondWithResult(_0x510a46,null))[_0x7138('0x2b')](handleError(_0x510a46,null));};exports['destroy']=function(_0x1ef7d5,_0x48e950){return db[_0x7138('0x38')][_0x7138('0x39')]({'where':{'id':_0x1ef7d5[_0x7138('0x2d')]['id']}})[_0x7138('0x1c')](handleEntityNotFound(_0x48e950,null))[_0x7138('0x1c')](removeEntity(_0x48e950,null))[_0x7138('0x2b')](handleError(_0x48e950,null));};exports[_0x7138('0x3c')]=function(_0xf3ed29,_0x462173){return db[_0x7138('0x38')][_0x7138('0x3c')]()[_0x7138('0x1c')](respondWithResult(_0x462173,null))['catch'](handleError(_0x462173,null));};exports[_0x7138('0x3d')]=function(_0x14fff0,_0x481124){return db[_0x7138('0x3e')][_0x7138('0x39')]({'where':{'id':_0x14fff0[_0x7138('0x2d')]['id']}})[_0x7138('0x1c')](handleEntityNotFound(_0x481124,null))[_0x7138('0x1c')](function(_0x3f77f4){if(_0x3f77f4){return _0x3f77f4[_0x7138('0x3d')](_0x14fff0['body'][_0x7138('0x3f')],_[_0x7138('0x40')](_0x14fff0[_0x7138('0x3b')],[_0x7138('0x3f'),'id'])||{});}})[_0x7138('0x1c')](respondWithResult(_0x481124,null))['catch'](handleError(_0x481124,null));};exports['getMessages']=function(_0x136ad4,_0x52de68){var _0x292938={'raw':![],'where':{}};var _0x15045b={};var _0x4a4ad8={'count':0x0,'rows':[]};return db['WhatsappInteraction'][_0x7138('0x41')]({'where':{'id':_0x136ad4[_0x7138('0x2d')]['id']}})[_0x7138('0x1c')](handleEntityNotFound(_0x52de68,null))[_0x7138('0x1c')](function(_0x58de21){if(_0x58de21){_0x15045b[_0x7138('0x2e')]=_[_0x7138('0x2f')](db[_0x7138('0x3e')][_0x7138('0x24')]);_0x15045b[_0x7138('0x29')]=_[_0x7138('0x2f')](_0x136ad4[_0x7138('0x29')]);_0x15045b['filters']=_[_0x7138('0x31')](_0x15045b['model'],_0x15045b[_0x7138('0x29')]);_0x292938[_0x7138('0x32')]=_[_0x7138('0x31')](_0x15045b[_0x7138('0x2e')],qs[_0x7138('0x33')](_0x136ad4[_0x7138('0x29')]['fields']));_0x292938[_0x7138('0x32')]=_0x292938['attributes'][_0x7138('0x34')]?_0x292938[_0x7138('0x32')]:_0x15045b['model'];if(!_0x136ad4[_0x7138('0x29')][_0x7138('0x42')](_0x7138('0x43'))){_0x292938[_0x7138('0x18')]=qs[_0x7138('0x18')](_0x136ad4[_0x7138('0x29')]['limit']);_0x292938[_0x7138('0x16')]=qs[_0x7138('0x16')](_0x136ad4['query'][_0x7138('0x16')]);}_0x292938[_0x7138('0x44')]=qs['sort'](_0x136ad4[_0x7138('0x29')]['sort']);_0x292938[_0x7138('0x45')]=qs['filters'](_[_0x7138('0x46')](_0x136ad4[_0x7138('0x29')],_0x15045b[_0x7138('0x30')]));_0x292938[_0x7138('0x45')][_0x7138('0x47')]=_0x58de21['id'];if(_0x136ad4[_0x7138('0x29')][_0x7138('0x48')]){_0x292938[_0x7138('0x45')]=_[_0x7138('0x36')](_0x292938[_0x7138('0x45')],{'$or':_[_0x7138('0x23')](_0x292938['attributes'],function(_0x19b58b){var _0x369edf={};_0x369edf[_0x19b58b]={'$like':'%'+_0x136ad4['query']['filter']+'%'};return _0x369edf;})});}if(_0x136ad4[_0x7138('0x29')][_0x7138('0x49')]){var _0x24cf08=_0x136ad4[_0x7138('0x29')][_0x7138('0x49')]['split'](',');var _0x1da0dd={};_0x1da0dd[_0x24cf08[0x0]]={'$gte':moment(_0x24cf08[0x1])[_0x7138('0x4a')](_0x7138('0x4b'))};_0x292938[_0x7138('0x45')]=_[_0x7138('0x36')](_0x292938[_0x7138('0x45')],_0x1da0dd);}_0x292938=_[_0x7138('0x36')]({},_0x292938,_0x136ad4[_0x7138('0x37')]);return db[_0x7138('0x3e')][_0x7138('0x19')]({'where':_0x292938['where']})[_0x7138('0x1c')](function(_0x5f47b5){_0x4a4ad8['count']=_0x5f47b5;if(_0x136ad4[_0x7138('0x29')][_0x7138('0x35')]){_0x292938[_0x7138('0x4c')]=[{'all':!![]}];}return db[_0x7138('0x3e')][_0x7138('0x4d')](_0x292938);})[_0x7138('0x1c')](function(_0x29abf){_0x4a4ad8[_0x7138('0x4e')]=_0x29abf;return _0x4a4ad8;});}})['then'](respondWithFilteredResult(_0x52de68,_0x292938))['catch'](handleError(_0x52de68,null));};exports['addTags']=function(_0x3768d9,_0x13ae96){return db[_0x7138('0x38')][_0x7138('0x39')]({'where':{'id':_0x3768d9[_0x7138('0x2d')]['id']}})[_0x7138('0x1c')](handleEntityNotFound(_0x13ae96,null))[_0x7138('0x1c')](function(_0x45add0){if(_0x45add0){return _0x45add0[_0x7138('0x4f')](_0x3768d9[_0x7138('0x3b')]['ids'],_[_0x7138('0x40')](_0x3768d9['body'],[_0x7138('0x3f'),'id'])||{})[_0x7138('0x50')](function(){return db[_0x7138('0x51')]['findAll']({'attributes':['id','name',_0x7138('0x52')],'where':{'id':_0x3768d9[_0x7138('0x3b')][_0x7138('0x3f')]}});})[_0x7138('0x1c')](function(_0x1be48e){socket[_0x7138('0x53')](_0x7138('0x54'),{'id':Number(_0x3768d9['params']['id']),'tags':_0x1be48e||[]});return{'id':Number(_0x3768d9[_0x7138('0x2d')]['id']),'tags':_0x1be48e||[]};});}})['then'](respondWithResult(_0x13ae96,null))[_0x7138('0x2b')](handleError(_0x13ae96,null));};exports[_0x7138('0x55')]=function(_0x258dbb,_0x544c4f){return db['WhatsappInteraction']['find']({'where':{'id':_0x258dbb[_0x7138('0x2d')]['id']}})[_0x7138('0x1c')](handleEntityNotFound(_0x544c4f,null))[_0x7138('0x1c')](function(_0x5ebca1){if(_0x5ebca1){return _0x5ebca1['removeTags'](_0x258dbb[_0x7138('0x29')][_0x7138('0x3f')]);}})['then'](respondWithStatusCode(_0x544c4f,null))[_0x7138('0x2b')](handleError(_0x544c4f,null));};exports['download']=function(_0x57a9ab,_0x26e41f){var _0xdec74e=moment()[_0x7138('0x56')]()[_0x7138('0x57')]();var _0x20c597=path['join'](config['root'],_0x7138('0x58'),_0x7138('0x59'),_0x7138('0x5a'));var _0xbc861c=path[_0x7138('0x5b')](config[_0x7138('0x5c')],_0x7138('0x58'),'files',_0x7138('0x5d'));var _0xf9a924=path[_0x7138('0x5b')](_0x20c597,_0xdec74e);var _0xdd4bf8=util[_0x7138('0x4a')]('transcript-%d-%s.zip',_0x57a9ab[_0x7138('0x2d')]['id'],_0xdec74e);var _0x5123a5=path[_0x7138('0x5b')](_0x20c597,_0xdd4bf8);var _0x2152c8=[];_0x2152c8[_0x7138('0x5e')]({'model':db[_0x7138('0x5f')],'as':_0x7138('0x5f'),'attributes':['id',_0x7138('0x60')],'raw':!![]});_0x2152c8[_0x7138('0x5e')]({'model':db[_0x7138('0x61')],'as':_0x7138('0x62'),'attributes':['id',_0x7138('0x63'),_0x7138('0x64')],'raw':!![]});if(_0x57a9ab['query'][_0x7138('0x5d')]){_0x2152c8['push']({'model':db[_0x7138('0x65')],'as':_0x7138('0x65'),'raw':!![]});}var _0x1fe59b=[{'model':db[_0x7138('0x3e')],'as':_0x7138('0x66'),'attributes':['id',_0x7138('0x3b'),_0x7138('0x67'),'direction',_0x7138('0x68'),_0x7138('0x69')],'include':_0x2152c8}];_0x1fe59b[_0x7138('0x5e')]({'model':db[_0x7138('0x6a')],'as':_0x7138('0x6b'),'attributes':['id',_0x7138('0x20')]});_0x1fe59b[_0x7138('0x5e')]({'model':db[_0x7138('0x5f')],'as':_0x7138('0x6c'),'attributes':['id',_0x7138('0x60')]});return db[_0x7138('0x38')][_0x7138('0x39')]({'where':{'id':_0x57a9ab[_0x7138('0x2d')]['id']},'include':_0x1fe59b})['then'](handleEntityNotFound(_0x26e41f,null))[_0x7138('0x1c')](function(_0x5abd7d){if(_0x5abd7d){var _0x4d8ad7=_0x5abd7d[_0x7138('0x6d')]({'plain':!![]});fs[_0x7138('0x6e')](_0xf9a924);var _0x3a1ec6={'channel':_0x7138('0x6f'),'account':_0x4d8ad7[_0x7138('0x6b')][_0x7138('0x20')],'agent':_0x4d8ad7[_0x7138('0x6c')]?_0x4d8ad7[_0x7138('0x6c')][_0x7138('0x60')]:'N.A.','createdAt':moment(_0x4d8ad7[_0x7138('0x67')])[_0x7138('0x4a')](_0x7138('0x4b'))[_0x7138('0x57')](),'closedAt':_0x4d8ad7['closed']?moment(_0x4d8ad7[_0x7138('0x70')])['format'](_0x7138('0x4b'))[_0x7138('0x57')]():'','disposition':_0x4d8ad7[_0x7138('0x71')],'messages':_(_0x4d8ad7[_0x7138('0x66')])['filter']({'secret':![]})[_0x7138('0x23')](function(_0x3d9c2f){if(_0x3d9c2f[_0x7138('0x65')]){var _0x31922f=path['join'](_0xbc861c,_0x3d9c2f[_0x7138('0x65')][_0x7138('0x72')]);if(fs['existsSync'](_0x31922f)){fs[_0x7138('0x73')](_0x31922f)['pipe'](fs['createWriteStream'](path[_0x7138('0x5b')](_0xf9a924,_0x3d9c2f[_0x7138('0x65')][_0x7138('0x72')])));}}return{'date':moment(_0x3d9c2f[_0x7138('0x67')])[_0x7138('0x4a')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0x3d9c2f['direction']===_0x7138('0x74')?_0x3d9c2f['User']?_0x3d9c2f['User'][_0x7138('0x60')]:_0x7138('0x75'):_0x3d9c2f['Contact'][_0x7138('0x63')]+(_0x3d9c2f['Contact'][_0x7138('0x64')]?'\x20'+_0x3d9c2f['Contact'][_0x7138('0x64')]:''),'body':_0x3d9c2f[_0x7138('0x65')]?_0x3d9c2f[_0x7138('0x65')][_0x7138('0x72')]:_0x3d9c2f[_0x7138('0x3b')],'direction':_0x3d9c2f[_0x7138('0x76')]===_0x7138('0x74')?'A':'C','secret':_0x3d9c2f[_0x7138('0x68')],'read':_0x3d9c2f[_0x7138('0x69')],'attachment':_0x3d9c2f[_0x7138('0x65')]};})['value']()};return ejs[_0x7138('0x77')](path[_0x7138('0x5b')](config[_0x7138('0x5c')],_0x7138('0x58'),_0x7138('0x78'),_0x7138('0x79')),{'interaction':_0x3a1ec6})[_0x7138('0x1c')](function(_0x4d6c2c){var _0x5650a2=path[_0x7138('0x5b')](_0xf9a924,'transcript-'+_0x4d8ad7['id']+'-'+_0xdec74e+_0x7138('0x7a'));var _0x5694d5={'path':_0x5650a2,'channel':_0x7138('0x6f'),'interactionId':_0x4d8ad7['id']};return pdf['createPdfFromHTML'](_0x4d6c2c,_0x5694d5);})[_0x7138('0x1c')](function(){return new BPromise(function(_0x3d7466,_0x3fc176){zipdir(_0xf9a924,{'saveTo':_0x5123a5},function(_0x390a4f,_0x481cde){if(_0x390a4f)return _0x3fc176(_0x390a4f);return _0x3d7466(_0x481cde);});})['then'](function(){return new BPromise(function(_0x115580,_0x5d0714){rimraf(_0xf9a924,function(_0x231a06){if(_0x231a06)_0x5d0714(_0x231a06);return _0x115580();});});})[_0x7138('0x1c')](function(){return _0x26e41f['download'](_0x5123a5,_0xdd4bf8,function(_0x5ab82c){if(_0x5ab82c){console[_0x7138('0x7b')](_0x7138('0x7c'),_0x5ab82c);}else{fs[_0x7138('0x7d')](_0x5123a5);}});});});}else{return _0x26e41f['sendStatus'](0xc8);}})[_0x7138('0x2b')](handleError(_0x26e41f,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index 4d8c8c2..e95264d 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.events.js +++ b/server/api/whatsappInteraction/whatsappInteraction.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb32d=['../../mysqldb','WhatsappInteraction','WhatsappMessage','update','remove','getUsers','then','Users','map','findAll','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events'];(function(_0x239daa,_0x521634){var _0x1d4c57=function(_0x3b9c1a){while(--_0x3b9c1a){_0x239daa['push'](_0x239daa['shift']());}};_0x1d4c57(++_0x521634);}(_0xb32d,0x1da));var _0xdb32=function(_0x21c2c8,_0x44257e){_0x21c2c8=_0x21c2c8-0x0;var _0x4dd745=_0xb32d[_0x21c2c8];return _0x4dd745;};'use strict';var EventEmitter=require(_0xdb32('0x0'));var WhatsappInteraction=require(_0xdb32('0x1'))['db'][_0xdb32('0x2')];var WhatsappMessage=require(_0xdb32('0x1'))['db'][_0xdb32('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xdb32('0x4'),'afterDestroy':_0xdb32('0x5')};function emitEvent(_0x581ceb){return function(_0x25b6aa,_0x3d13ba,_0x8d7bf4){_0x25b6aa[_0xdb32('0x6')]({'attributes':['id'],'raw':!![]})[_0xdb32('0x7')](function(_0x386309){_0x25b6aa['setDataValue'](_0xdb32('0x8'),_0x386309[_0xdb32('0x9')](function(_0xbe779d){return{'id':_0xbe779d['id']};}));return WhatsappMessage[_0xdb32('0xa')]({'where':{'WhatsappInteractionId':_0x25b6aa['id'],'direction':'in','read':![]},'raw':!![]});})[_0xdb32('0x7')](function(_0x5583ae){_0x25b6aa[_0xdb32('0xb')](_0xdb32('0xc'),_0x5583ae[_0xdb32('0xd')]);WhatsappInteractionEvents[_0xdb32('0xe')](_0x581ceb+':'+_0x25b6aa['id'],_0x25b6aa);WhatsappInteractionEvents[_0xdb32('0xe')](_0x581ceb,_0x25b6aa);_0x8d7bf4(null);})[_0xdb32('0xf')](_0x8d7bf4(null));};}for(var e in events){if(events[_0xdb32('0x10')](e)){var event=events[e];WhatsappInteraction[_0xdb32('0x11')](e,emitEvent(event));}}module[_0xdb32('0x12')]=WhatsappInteractionEvents; \ No newline at end of file +var _0xee4f=['length','emit','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappMessage','setMaxListeners','update','setDataValue','Users','findAll','then'];(function(_0xcf02ce,_0x30e982){var _0x1d8b7c=function(_0x401af3){while(--_0x401af3){_0xcf02ce['push'](_0xcf02ce['shift']());}};_0x1d8b7c(++_0x30e982);}(_0xee4f,0xad));var _0xfee4=function(_0x4bf497,_0x30f242){_0x4bf497=_0x4bf497-0x0;var _0xb5f818=_0xee4f[_0x4bf497];return _0xb5f818;};'use strict';var EventEmitter=require(_0xfee4('0x0'));var WhatsappInteraction=require('../../mysqldb')['db']['WhatsappInteraction'];var WhatsappMessage=require(_0xfee4('0x1'))['db'][_0xfee4('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0xfee4('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xfee4('0x4'),'afterDestroy':'remove'};function emitEvent(_0x27874a){return function(_0x505b55,_0x4da9b6,_0x1c39b1){_0x505b55['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x2fb1b3){_0x505b55[_0xfee4('0x5')](_0xfee4('0x6'),_0x2fb1b3['map'](function(_0x52fc6e){return{'id':_0x52fc6e['id']};}));return WhatsappMessage[_0xfee4('0x7')]({'where':{'WhatsappInteractionId':_0x505b55['id'],'direction':'in','read':![]},'raw':!![]});})[_0xfee4('0x8')](function(_0xa77876){_0x505b55['setDataValue']('unreadMessages',_0xa77876[_0xfee4('0x9')]);WhatsappInteractionEvents[_0xfee4('0xa')](_0x27874a+':'+_0x505b55['id'],_0x505b55);WhatsappInteractionEvents[_0xfee4('0xa')](_0x27874a,_0x505b55);_0x1c39b1(null);})['catch'](_0x1c39b1(null));};}for(var e in events){if(events[_0xfee4('0xb')](e)){var event=events[e];WhatsappInteraction[_0xfee4('0xc')](e,emitEvent(event));}}module[_0xfee4('0xd')]=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index 360871d..25dd97a 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.model.js +++ b/server/api/whatsappInteraction/whatsappInteraction.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x58a3=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappInteraction.attributes','exports','define','whatsapp_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x487b0c,_0x14ff74){var _0x1adbdc=function(_0x2e7b9d){while(--_0x2e7b9d){_0x487b0c['push'](_0x487b0c['shift']());}};_0x1adbdc(++_0x14ff74);}(_0x58a3,0xfc));var _0x358a=function(_0x1795df,_0xcb261e){_0x1795df=_0x1795df-0x0;var _0x3f13c0=_0x58a3[_0x1795df];return _0x3f13c0;};'use strict';var _=require(_0x358a('0x0'));var util=require(_0x358a('0x1'));var logger=require('../../config/logger')(_0x358a('0x2'));var moment=require(_0x358a('0x3'));var BPromise=require(_0x358a('0x4'));var rp=require(_0x358a('0x5'));var fs=require('fs');var path=require(_0x358a('0x6'));var rimraf=require(_0x358a('0x7'));var config=require(_0x358a('0x8'));var attributes=require(_0x358a('0x9'));module[_0x358a('0xa')]=function(_0x2ee987,_0x5c7643){return _0x2ee987[_0x358a('0xb')]('WhatsappInteraction',attributes,{'tableName':_0x358a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xe28770,_0x4d97b5,_0x29719c){if(_0xe28770[_0x358a('0xd')](_0x358a('0xe'))){_0xe28770[_0x358a('0xf')]=moment()[_0x358a('0x10')](_0x358a('0x11'));}_0x29719c(null,_0xe28770);}}});}; \ No newline at end of file +var _0x9c87=['define','WhatsappInteraction','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports'];(function(_0x27c24e,_0x5db1c7){var _0x39004a=function(_0x44286d){while(--_0x44286d){_0x27c24e['push'](_0x27c24e['shift']());}};_0x39004a(++_0x5db1c7);}(_0x9c87,0x86));var _0x79c8=function(_0x616290,_0x280b7f){_0x616290=_0x616290-0x0;var _0x453879=_0x9c87[_0x616290];return _0x453879;};'use strict';var _=require(_0x79c8('0x0'));var util=require(_0x79c8('0x1'));var logger=require(_0x79c8('0x2'))(_0x79c8('0x3'));var moment=require(_0x79c8('0x4'));var BPromise=require(_0x79c8('0x5'));var rp=require(_0x79c8('0x6'));var fs=require('fs');var path=require(_0x79c8('0x7'));var rimraf=require('rimraf');var config=require(_0x79c8('0x8'));var attributes=require('./whatsappInteraction.attributes');module[_0x79c8('0x9')]=function(_0x1b0ec7,_0x606086){return _0x1b0ec7[_0x79c8('0xa')](_0x79c8('0xb'),attributes,{'tableName':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5eae1e,_0xa413fb,_0x4ef00c){if(_0x5eae1e[_0x79c8('0xc')]('closed')){_0x5eae1e[_0x79c8('0xd')]=moment()[_0x79c8('0xe')](_0x79c8('0xf'));}_0x4ef00c(null,_0x5eae1e);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index 6d6681c..98bd5a5 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.rpc.js +++ b/server/api/whatsappInteraction/whatsappInteraction.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9f3c=['where','ids','omit','spread','AddTags','lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','request','info','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','WhatsappInteraction,\x20%s,\x20%s','result','catch','UpdateWhatsappInteraction','WhatsappInteraction','body','options','raw','attributes','limit','then','AddTagsToWhatsappInteraction','find'];(function(_0xd241fc,_0x4ddd78){var _0x8e4412=function(_0x26531f){while(--_0x26531f){_0xd241fc['push'](_0xd241fc['shift']());}};_0x8e4412(++_0x4ddd78);}(_0x9f3c,0x165));var _0xc9f3=function(_0x234a6c,_0x2bfa94){_0x234a6c=_0x234a6c-0x0;var _0x10945b=_0x9f3c[_0x234a6c];return _0x10945b;};'use strict';var _=require(_0xc9f3('0x0'));var util=require(_0xc9f3('0x1'));var moment=require(_0xc9f3('0x2'));var BPromise=require('bluebird');var rs=require(_0xc9f3('0x3'));var fs=require('fs');var Redis=require(_0xc9f3('0x4'));var db=require(_0xc9f3('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc9f3('0x6'));var config=require(_0xc9f3('0x7'));var jayson=require(_0xc9f3('0x8'));var client=jayson[_0xc9f3('0x9')][_0xc9f3('0xa')]({'port':0x232a});config[_0xc9f3('0xb')]=_[_0xc9f3('0xc')](config[_0xc9f3('0xb')],{'host':_0xc9f3('0xd'),'port':0x18eb});var socket=require(_0xc9f3('0xe'))(new Redis(config[_0xc9f3('0xb')]));require(_0xc9f3('0xf'))[_0xc9f3('0x10')](socket);function respondWithRpcPromise(_0x24af1e,_0x3d698a,_0xb97428){return new BPromise(function(_0x4290ce,_0x4a042e){return client[_0xc9f3('0x11')](_0x24af1e,_0xb97428)['then'](function(_0x46bc01){logger[_0xc9f3('0x12')]('WhatsappInteraction,\x20%s,\x20%s',_0x3d698a,'request\x20sent');logger[_0xc9f3('0x13')](_0xc9f3('0x14'),_0x3d698a,_0xc9f3('0x15'),JSON[_0xc9f3('0x16')](_0x46bc01));if(_0x46bc01[_0xc9f3('0x17')]){if(_0x46bc01['error'][_0xc9f3('0x18')]===0x1f4){logger[_0xc9f3('0x17')]('WhatsappInteraction,\x20%s,\x20%s',_0x3d698a,_0x46bc01['error'][_0xc9f3('0x19')]);return _0x4a042e(_0x46bc01[_0xc9f3('0x17')][_0xc9f3('0x19')]);}logger['error'](_0xc9f3('0x1a'),_0x3d698a,_0x46bc01['error']['message']);return _0x4290ce(_0x46bc01[_0xc9f3('0x17')][_0xc9f3('0x19')]);}else{logger[_0xc9f3('0x12')](_0xc9f3('0x1a'),_0x3d698a,_0xc9f3('0x15'));_0x4290ce(_0x46bc01[_0xc9f3('0x1b')]['message']);}})[_0xc9f3('0x1c')](function(_0x4f6f89){logger[_0xc9f3('0x17')]('WhatsappInteraction,\x20%s,\x20%s',_0x3d698a,_0x4f6f89);_0x4a042e(_0x4f6f89);});});}exports[_0xc9f3('0x1d')]=function(_0x45669c){var _0x9d179d=this;return new Promise(function(_0x5c3969,_0xe63e50){return db[_0xc9f3('0x1e')]['update'](_0x45669c[_0xc9f3('0x1f')],{'raw':_0x45669c[_0xc9f3('0x20')]?_0x45669c['options'][_0xc9f3('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x45669c[_0xc9f3('0x20')]?_0x45669c['options']['where']||null:null,'attributes':_0x45669c['options']?_0x45669c[_0xc9f3('0x20')][_0xc9f3('0x22')]||null:null,'limit':_0x45669c['options']?_0x45669c['options'][_0xc9f3('0x23')]||null:null})[_0xc9f3('0x24')](function(_0x181bd0){logger[_0xc9f3('0x12')](_0xc9f3('0x1d'),_0x45669c);logger['debug'](_0xc9f3('0x1d'),_0x45669c,JSON[_0xc9f3('0x16')](_0x181bd0));_0x5c3969(_0x181bd0);})[_0xc9f3('0x1c')](function(_0x3387bb){logger[_0xc9f3('0x17')](_0xc9f3('0x1d'),_0x3387bb[_0xc9f3('0x19')],_0x45669c);_0xe63e50(_0x9d179d[_0xc9f3('0x17')](0x1f4,_0x3387bb[_0xc9f3('0x19')]));});});};exports[_0xc9f3('0x25')]=function(_0x379d34){return new Promise(function(_0x2fbe5e,_0x50b52a){return db[_0xc9f3('0x1e')][_0xc9f3('0x26')]({'where':_0x379d34[_0xc9f3('0x20')]?_0x379d34[_0xc9f3('0x20')][_0xc9f3('0x27')]||null:null})[_0xc9f3('0x24')](function(_0x490bd3){if(_0x490bd3){return _0x490bd3['addTags'](_0x379d34[_0xc9f3('0x1f')][_0xc9f3('0x28')],_[_0xc9f3('0x29')](_0x379d34[_0xc9f3('0x1f')],['ids','id'])||{});}})[_0xc9f3('0x2a')](function(_0x4d1907){logger[_0xc9f3('0x12')](_0xc9f3('0x2b'),_0x379d34);logger[_0xc9f3('0x13')](_0xc9f3('0x2b'),_0x379d34,JSON[_0xc9f3('0x16')](_0x4d1907));_0x2fbe5e(_0x4d1907);})['catch'](function(_0x596f41){logger[_0xc9f3('0x17')](_0xc9f3('0x2b'),_0x596f41['message'],_0x379d34);_0x50b52a(_this['error'](0x1f4,_0x596f41[_0xc9f3('0x19')]));});});}; \ No newline at end of file +var _0xff25=['defaults','redis','socket.io-emitter','./whatsappInteraction.socket','register','then','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','error','message','info','result','WhatsappInteraction','update','body','options','raw','where','limit','UpdateWhatsappInteraction','AddTagsToWhatsappInteraction','find','ids','omit','spread','AddTags','stringify','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x50da74,_0x5286e8){var _0x3b8327=function(_0x51c62e){while(--_0x51c62e){_0x50da74['push'](_0x50da74['shift']());}};_0x3b8327(++_0x5286e8);}(_0xff25,0xe6));var _0x5ff2=function(_0x5e7c2b,_0x1b0a26){_0x5e7c2b=_0x5e7c2b-0x0;var _0xd7c8cf=_0xff25[_0x5e7c2b];return _0xd7c8cf;};'use strict';var _=require(_0x5ff2('0x0'));var util=require('util');var moment=require(_0x5ff2('0x1'));var BPromise=require(_0x5ff2('0x2'));var rs=require(_0x5ff2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5ff2('0x4'))['db'];var utils=require(_0x5ff2('0x5'));var logger=require('../../config/logger')(_0x5ff2('0x6'));var config=require(_0x5ff2('0x7'));var jayson=require(_0x5ff2('0x8'));var client=jayson[_0x5ff2('0x9')]['http']({'port':0x232a});config['redis']=_[_0x5ff2('0xa')](config[_0x5ff2('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x5ff2('0xc'))(new Redis(config[_0x5ff2('0xb')]));require(_0x5ff2('0xd'))[_0x5ff2('0xe')](socket);function respondWithRpcPromise(_0x2d16b8,_0x208d2e,_0x54b8fe){return new BPromise(function(_0x574601,_0x4b6808){return client['request'](_0x2d16b8,_0x54b8fe)[_0x5ff2('0xf')](function(_0x9f9f33){logger['info'](_0x5ff2('0x10'),_0x208d2e,_0x5ff2('0x11'));logger[_0x5ff2('0x12')](_0x5ff2('0x13'),_0x208d2e,_0x5ff2('0x11'),JSON['stringify'](_0x9f9f33));if(_0x9f9f33[_0x5ff2('0x14')]){if(_0x9f9f33[_0x5ff2('0x14')]['code']===0x1f4){logger[_0x5ff2('0x14')](_0x5ff2('0x10'),_0x208d2e,_0x9f9f33[_0x5ff2('0x14')][_0x5ff2('0x15')]);return _0x4b6808(_0x9f9f33[_0x5ff2('0x14')][_0x5ff2('0x15')]);}logger['error']('WhatsappInteraction,\x20%s,\x20%s',_0x208d2e,_0x9f9f33[_0x5ff2('0x14')]['message']);return _0x574601(_0x9f9f33[_0x5ff2('0x14')][_0x5ff2('0x15')]);}else{logger[_0x5ff2('0x16')](_0x5ff2('0x10'),_0x208d2e,_0x5ff2('0x11'));_0x574601(_0x9f9f33[_0x5ff2('0x17')][_0x5ff2('0x15')]);}})['catch'](function(_0x40fe58){logger['error'](_0x5ff2('0x10'),_0x208d2e,_0x40fe58);_0x4b6808(_0x40fe58);});});}exports['UpdateWhatsappInteraction']=function(_0x28bc91){var _0x4fff98=this;return new Promise(function(_0x304a54,_0x4fd331){return db[_0x5ff2('0x18')][_0x5ff2('0x19')](_0x28bc91[_0x5ff2('0x1a')],{'raw':_0x28bc91['options']?_0x28bc91[_0x5ff2('0x1b')][_0x5ff2('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x28bc91[_0x5ff2('0x1b')]?_0x28bc91[_0x5ff2('0x1b')][_0x5ff2('0x1d')]||null:null,'attributes':_0x28bc91[_0x5ff2('0x1b')]?_0x28bc91['options']['attributes']||null:null,'limit':_0x28bc91[_0x5ff2('0x1b')]?_0x28bc91[_0x5ff2('0x1b')][_0x5ff2('0x1e')]||null:null})[_0x5ff2('0xf')](function(_0x4878a0){logger['info'](_0x5ff2('0x1f'),_0x28bc91);logger[_0x5ff2('0x12')](_0x5ff2('0x1f'),_0x28bc91,JSON['stringify'](_0x4878a0));_0x304a54(_0x4878a0);})['catch'](function(_0x58a570){logger[_0x5ff2('0x14')](_0x5ff2('0x1f'),_0x58a570[_0x5ff2('0x15')],_0x28bc91);_0x4fd331(_0x4fff98[_0x5ff2('0x14')](0x1f4,_0x58a570[_0x5ff2('0x15')]));});});};exports[_0x5ff2('0x20')]=function(_0x60122e){return new Promise(function(_0x1aae3f,_0x3ff3a7){return db[_0x5ff2('0x18')][_0x5ff2('0x21')]({'where':_0x60122e['options']?_0x60122e[_0x5ff2('0x1b')][_0x5ff2('0x1d')]||null:null})['then'](function(_0x17590f){if(_0x17590f){return _0x17590f['addTags'](_0x60122e[_0x5ff2('0x1a')][_0x5ff2('0x22')],_[_0x5ff2('0x23')](_0x60122e[_0x5ff2('0x1a')],[_0x5ff2('0x22'),'id'])||{});}})[_0x5ff2('0x24')](function(_0x230382){logger[_0x5ff2('0x16')](_0x5ff2('0x25'),_0x60122e);logger[_0x5ff2('0x12')]('AddTags',_0x60122e,JSON[_0x5ff2('0x26')](_0x230382));_0x1aae3f(_0x230382);})[_0x5ff2('0x27')](function(_0x1f9275){logger[_0x5ff2('0x14')](_0x5ff2('0x25'),_0x1f9275[_0x5ff2('0x15')],_0x60122e);_0x3ff3a7(_this[_0x5ff2('0x14')](0x1f4,_0x1f9275[_0x5ff2('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index 635e152..bf04d77 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.socket.js +++ b/server/api/whatsappInteraction/whatsappInteraction.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x28cf=['remove','update','removeListener','length','save'];(function(_0x36c36d,_0xdcef61){var _0x4d3996=function(_0x522a51){while(--_0x522a51){_0x36c36d['push'](_0x36c36d['shift']());}};_0x4d3996(++_0xdcef61);}(_0x28cf,0x90));var _0xf28c=function(_0x33db5c,_0x20caba){_0x33db5c=_0x33db5c-0x0;var _0x2222b0=_0x28cf[_0x33db5c];return _0x2222b0;};'use strict';var WhatsappInteractionEvents=require('./whatsappInteraction.events');var events=[_0xf28c('0x0'),_0xf28c('0x1'),_0xf28c('0x2')];function createListener(_0x39163e,_0x27d26b){return function(_0x7b10e0){_0x27d26b['emit'](_0x39163e,_0x7b10e0);};}function removeListener(_0x3549f1,_0x1727a0){return function(){WhatsappInteractionEvents[_0xf28c('0x3')](_0x3549f1,_0x1727a0);};}exports['register']=function(_0x52395d){for(var _0x3b2054=0x0,_0x7c3c0=events[_0xf28c('0x4')];_0x3b2054<_0x7c3c0;_0x3b2054++){var _0x368f11=events[_0x3b2054];var _0xd12b4f=createListener('whatsappInteraction:'+_0x368f11,_0x52395d);WhatsappInteractionEvents['on'](_0x368f11,_0xd12b4f);}}; \ No newline at end of file +var _0xf70f=['length','whatsappInteraction:','./whatsappInteraction.events','save','remove','update','emit','removeListener'];(function(_0x4e4a68,_0x193c05){var _0x4e2ff3=function(_0x44b73f){while(--_0x44b73f){_0x4e4a68['push'](_0x4e4a68['shift']());}};_0x4e2ff3(++_0x193c05);}(_0xf70f,0xaa));var _0xff70=function(_0x3c989b,_0x53999a){_0x3c989b=_0x3c989b-0x0;var _0x1c68d2=_0xf70f[_0x3c989b];return _0x1c68d2;};'use strict';var WhatsappInteractionEvents=require(_0xff70('0x0'));var events=[_0xff70('0x1'),_0xff70('0x2'),_0xff70('0x3')];function createListener(_0x1e8eed,_0x17bc5f){return function(_0x49b7e0){_0x17bc5f[_0xff70('0x4')](_0x1e8eed,_0x49b7e0);};}function removeListener(_0xd2aa7d,_0x10cc40){return function(){WhatsappInteractionEvents[_0xff70('0x5')](_0xd2aa7d,_0x10cc40);};}exports['register']=function(_0x5e2115){for(var _0x2c87a6=0x0,_0x30e1aa=events[_0xff70('0x6')];_0x2c87a6<_0x30e1aa;_0x2c87a6++){var _0xa07c6c=events[_0x2c87a6];var _0x48e3cb=createListener(_0xff70('0x7')+_0xa07c6c,_0x5e2115);WhatsappInteractionEvents['on'](_0xa07c6c,_0x48e3cb);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index 0b96d0d..301b41a 100644 --- a/server/api/whatsappMessage/index.js +++ b/server/api/whatsappMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1e6f=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','get','isAuthenticated','/describe','describe','/:id','show','post','tracked','whatsapp','whatsappmessage:create','/:id/status','put','/:id/accept','accept','delete','destroy','exports','util','path'];(function(_0x915fba,_0x428e11){var _0x4463d9=function(_0x7c6d15){while(--_0x7c6d15){_0x915fba['push'](_0x915fba['shift']());}};_0x4463d9(++_0x428e11);}(_0x1e6f,0xf1));var _0xf1e6=function(_0x53f543,_0x24553e){_0x53f543=_0x53f543-0x0;var _0xd7dab0=_0x1e6f[_0x53f543];return _0xd7dab0;};'use strict';var multer=require('multer');var util=require(_0xf1e6('0x0'));var path=require(_0xf1e6('0x1'));var timeout=require(_0xf1e6('0x2'));var express=require(_0xf1e6('0x3'));var router=express[_0xf1e6('0x4')]();var fs_extra=require(_0xf1e6('0x5'));var auth=require(_0xf1e6('0x6'));var interaction=require(_0xf1e6('0x7'));var config=require(_0xf1e6('0x8'));var controller=require(_0xf1e6('0x9'));router[_0xf1e6('0xa')]('/',auth[_0xf1e6('0xb')](),controller['index']);router['get'](_0xf1e6('0xc'),auth[_0xf1e6('0xb')](),controller[_0xf1e6('0xd')]);router['get'](_0xf1e6('0xe'),auth[_0xf1e6('0xb')](),controller[_0xf1e6('0xf')]);router[_0xf1e6('0x10')]('/',auth[_0xf1e6('0xb')](),interaction[_0xf1e6('0x11')](_0xf1e6('0x12'),_0xf1e6('0x13')),controller['create']);router[_0xf1e6('0x10')](_0xf1e6('0x14'),controller['status']);router[_0xf1e6('0x15')](_0xf1e6('0xe'),auth[_0xf1e6('0xb')](),controller['update']);router[_0xf1e6('0x15')](_0xf1e6('0x16'),auth[_0xf1e6('0xb')](),controller[_0xf1e6('0x17')]);router['put']('/:id/reject',auth[_0xf1e6('0xb')](),controller['reject']);router[_0xf1e6('0x18')](_0xf1e6('0xe'),auth[_0xf1e6('0xb')](),controller[_0xf1e6('0x19')]);module[_0xf1e6('0x1a')]=router; \ No newline at end of file +var _0xd1ab=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','get','isAuthenticated','index','/describe','describe','show','post','whatsapp','/:id/status','status','put','/:id','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','util','path'];(function(_0x4b4777,_0x1d952e){var _0x2b9427=function(_0x408dbb){while(--_0x408dbb){_0x4b4777['push'](_0x4b4777['shift']());}};_0x2b9427(++_0x1d952e);}(_0xd1ab,0x71));var _0xbd1a=function(_0x4ac99f,_0x3a20d3){_0x4ac99f=_0x4ac99f-0x0;var _0x271bda=_0xd1ab[_0x4ac99f];return _0x271bda;};'use strict';var multer=require(_0xbd1a('0x0'));var util=require(_0xbd1a('0x1'));var path=require(_0xbd1a('0x2'));var timeout=require(_0xbd1a('0x3'));var express=require(_0xbd1a('0x4'));var router=express[_0xbd1a('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xbd1a('0x6'));var interaction=require(_0xbd1a('0x7'));var config=require(_0xbd1a('0x8'));var controller=require(_0xbd1a('0x9'));router[_0xbd1a('0xa')]('/',auth[_0xbd1a('0xb')](),controller[_0xbd1a('0xc')]);router[_0xbd1a('0xa')](_0xbd1a('0xd'),auth[_0xbd1a('0xb')](),controller[_0xbd1a('0xe')]);router[_0xbd1a('0xa')]('/:id',auth[_0xbd1a('0xb')](),controller[_0xbd1a('0xf')]);router[_0xbd1a('0x10')]('/',auth[_0xbd1a('0xb')](),interaction['tracked'](_0xbd1a('0x11'),'whatsappmessage:create'),controller['create']);router[_0xbd1a('0x10')](_0xbd1a('0x12'),controller[_0xbd1a('0x13')]);router[_0xbd1a('0x14')](_0xbd1a('0x15'),auth['isAuthenticated'](),controller['update']);router[_0xbd1a('0x14')](_0xbd1a('0x16'),auth[_0xbd1a('0xb')](),controller[_0xbd1a('0x17')]);router[_0xbd1a('0x14')](_0xbd1a('0x18'),auth[_0xbd1a('0xb')](),controller[_0xbd1a('0x19')]);router[_0xbd1a('0x1a')](_0xbd1a('0x15'),auth[_0xbd1a('0xb')](),controller[_0xbd1a('0x1b')]);module[_0xbd1a('0x1c')]=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index 8919ffe..58776de 100644 --- a/server/api/whatsappMessage/whatsappMessage.attributes.js +++ b/server/api/whatsappMessage/whatsappMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb5a2=['TEXT','medium','BOOLEAN','ENUM','out','STRING','DATE','sequelize','exports'];(function(_0x5e8399,_0x53e88d){var _0x55e6f7=function(_0x34b9df){while(--_0x34b9df){_0x5e8399['push'](_0x5e8399['shift']());}};_0x55e6f7(++_0x53e88d);}(_0xb5a2,0x73));var _0x2b5a=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xb5a2[_0x21a9d9];return _0x46adce;};'use strict';var Sequelize=require(_0x2b5a('0x0'));module[_0x2b5a('0x1')]={'body':{'type':Sequelize[_0x2b5a('0x2')](_0x2b5a('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x2b5a('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x2b5a('0x5')]('in','out'),'defaultValue':_0x2b5a('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0x2b5a('0x7')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0x2b5a('0x8')]},'secret':{'type':Sequelize[_0x2b5a('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x2b5a('0x7')]},'providerResponse':{'type':Sequelize[_0x2b5a('0x2')]}}; \ No newline at end of file +var _0x64c4=['ENUM','out','STRING','DATE','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x3d85ac,_0x382718){var _0x365e04=function(_0x4e8d27){while(--_0x4e8d27){_0x3d85ac['push'](_0x3d85ac['shift']());}};_0x365e04(++_0x382718);}(_0x64c4,0x11b));var _0x464c=function(_0x42ec59,_0x14c6e9){_0x42ec59=_0x42ec59-0x0;var _0x348275=_0x64c4[_0x42ec59];return _0x348275;};'use strict';var Sequelize=require(_0x464c('0x0'));module[_0x464c('0x1')]={'body':{'type':Sequelize[_0x464c('0x2')](_0x464c('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x464c('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x464c('0x5')]('in',_0x464c('0x6')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x464c('0x7')](0xbe)},'phone':{'type':Sequelize[_0x464c('0x7')]},'readAt':{'type':Sequelize[_0x464c('0x8')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x464c('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index a63e1fa..abfa98d 100644 --- a/server/api/whatsappMessage/whatsappMessage.controller.js +++ b/server/api/whatsappMessage/whatsappMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x710f=['internal','manual','interface','SIP/%s','channel','motionChannel','event','acceptmessage','whatsapp-interactions','get','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','SELECT','EventManager','WhatsppMessage,\x20%s,\x20%s,\x20%s','inspect','twilio','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','redis','defaults','localhost','http','client','request','then','info','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','error','code','message','WhatsappMessage,\x20%s,\x20%s','result','sendStatus','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','destroy','end','stack','name','index','map','WhatsappMessage','fieldName','type','key','query','filters','model','intersection','fields','attributes','nolimit','order','sort','where','pick','filter','merge','options','findAll','rows','catch','params','keys','length','includeAll','include','find','create','body','describe','accept','whatsapp','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','WhatsappInteraction','WhatsappInteractionId','read1stAt','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','AcceptMessage','acceptMessage','ContactId','Sequelize','QueryTypes','contact','User','agent','fullname','email'];(function(_0x5641dd,_0x3560b5){var _0x5767ba=function(_0x2bfa18){while(--_0x2bfa18){_0x5641dd['push'](_0x5641dd['shift']());}};_0x5767ba(++_0x3560b5);}(_0x710f,0x9d));var _0xf710=function(_0x54a6c3,_0x623fce){_0x54a6c3=_0x54a6c3-0x0;var _0x59f179=_0x710f[_0x54a6c3];return _0x59f179;};'use strict';var emlformat=require(_0xf710('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf710('0x1'));var jsonpatch=require(_0xf710('0x2'));var rp=require(_0xf710('0x3'));var moment=require(_0xf710('0x4'));var BPromise=require(_0xf710('0x5'));var Mustache=require(_0xf710('0x6'));var util=require('util');var path=require(_0xf710('0x7'));var sox=require(_0xf710('0x8'));var csv=require(_0xf710('0x9'));var ejs=require(_0xf710('0xa'));var fs=require('fs');var fs_extra=require(_0xf710('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xf710('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xf710('0xd'));var toCsv=require('to-csv');var querystring=require(_0xf710('0xe'));var Papa=require('papaparse');var Redis=require(_0xf710('0xf'));var authService=require(_0xf710('0x10'));var qs=require(_0xf710('0x11'));var as=require(_0xf710('0x12'));var hardwareService=require(_0xf710('0x13'));var logger=require(_0xf710('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf710('0x15'));var db=require(_0xf710('0x16'))['db'];config[_0xf710('0x17')]=_[_0xf710('0x18')](config['redis'],{'host':_0xf710('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf710('0x17')]));require('./whatsappMessage.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xf710('0x1a')]({'port':0x232c});var client9002=jayson[_0xf710('0x1b')][_0xf710('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x530a7b,_0x15aa4e,_0x78b3,_0x55ee38){return new BPromise(function(_0xcfe1cb,_0x1dfc7a){var _0x3aca71=_0x55ee38||client;return _0x3aca71[_0xf710('0x1c')](_0x530a7b,_0x78b3)[_0xf710('0x1d')](function(_0x38c798){logger[_0xf710('0x1e')]('WhatsappMessage,\x20%s,\x20%s',_0x15aa4e,_0xf710('0x1f'));logger[_0xf710('0x20')](_0xf710('0x21'),_0x15aa4e,_0xf710('0x1f'),JSON['stringify'](_0x38c798));if(_0x38c798[_0xf710('0x22')]){if(_0x38c798[_0xf710('0x22')][_0xf710('0x23')]===0x1f4){logger[_0xf710('0x22')]('WhatsappMessage,\x20%s,\x20%s',_0x15aa4e,_0x38c798['error'][_0xf710('0x24')]);return _0x1dfc7a(_0x38c798['error'][_0xf710('0x24')]);}logger['error'](_0xf710('0x25'),_0x15aa4e,_0x38c798[_0xf710('0x22')]['message']);return _0xcfe1cb(_0x38c798[_0xf710('0x22')]['message']);}else{logger[_0xf710('0x1e')](_0xf710('0x25'),_0x15aa4e,_0xf710('0x1f'));_0xcfe1cb(_0x38c798[_0xf710('0x26')][_0xf710('0x24')]);}})['catch'](function(_0x3f9005){logger['error'](_0xf710('0x25'),_0x15aa4e,_0x3f9005);_0x1dfc7a(_0x3f9005);});});}function respondWithStatusCode(_0x464e0e,_0x467925){_0x467925=_0x467925||0xcc;return function(_0x42b35f){if(_0x42b35f){return _0x464e0e[_0xf710('0x27')](_0x467925);}return _0x464e0e[_0xf710('0x28')](_0x467925)['end']();};}function respondWithResult(_0x41fa6f,_0x36e81f){_0x36e81f=_0x36e81f||0xc8;return function(_0x1ac6a9){if(_0x1ac6a9){return _0x41fa6f[_0xf710('0x28')](_0x36e81f)['json'](_0x1ac6a9);}};}function respondWithFilteredResult(_0x2db55f,_0x3e1182){return function(_0x5bb7a2){if(_0x5bb7a2){var _0x1a2d2a=typeof _0x3e1182['offset']===_0xf710('0x29')&&typeof _0x3e1182[_0xf710('0x2a')]===_0xf710('0x29');var _0x2375ff=_0x5bb7a2[_0xf710('0x2b')];var _0x380272=_0x1a2d2a?0x0:_0x3e1182[_0xf710('0x2c')];var _0x3a1717=_0x1a2d2a?_0x5bb7a2[_0xf710('0x2b')]:_0x3e1182[_0xf710('0x2c')]+_0x3e1182[_0xf710('0x2a')];var _0x4e444b;if(_0x3a1717>=_0x2375ff){_0x3a1717=_0x2375ff;_0x4e444b=0xc8;}else{_0x4e444b=0xce;}_0x2db55f[_0xf710('0x28')](_0x4e444b);return _0x2db55f[_0xf710('0x2d')](_0xf710('0x2e'),_0x380272+'-'+_0x3a1717+'/'+_0x2375ff)[_0xf710('0x2f')](_0x5bb7a2);}return null;};}function patchUpdates(_0xa10e81){return function(_0xd3c0e2){try{jsonpatch[_0xf710('0x30')](_0xd3c0e2,_0xa10e81,!![]);}catch(_0x1c927c){return BPromise[_0xf710('0x31')](_0x1c927c);}return _0xd3c0e2[_0xf710('0x32')]();};}function saveUpdates(_0x39cb38,_0x303bee){return function(_0x121c2b){if(_0x121c2b){return _0x121c2b[_0xf710('0x33')](_0x39cb38)[_0xf710('0x1d')](function(_0x286ef0){return _0x286ef0;});}return null;};}function removeEntity(_0xc632ac,_0x1c1093){return function(_0x1e594b){if(_0x1e594b){return _0x1e594b[_0xf710('0x34')]()[_0xf710('0x1d')](function(){_0xc632ac['status'](0xcc)[_0xf710('0x35')]();});}};}function handleEntityNotFound(_0x3a6db7,_0x4b2a8f){return function(_0x647efc){if(!_0x647efc){_0x3a6db7[_0xf710('0x27')](0x194);}return _0x647efc;};}function handleError(_0x372ebe,_0x41f6a6){_0x41f6a6=_0x41f6a6||0x1f4;return function(_0xa09456){logger[_0xf710('0x22')](_0xa09456[_0xf710('0x36')]);if(_0xa09456[_0xf710('0x37')]){delete _0xa09456[_0xf710('0x37')];}_0x372ebe['status'](_0x41f6a6)['send'](_0xa09456);};}exports[_0xf710('0x38')]=function(_0x206e4d,_0x36743c){var _0xca2272={},_0x25cd20={},_0x4580ae={'count':0x0,'rows':[]};var _0x3aec01=_[_0xf710('0x39')](db[_0xf710('0x3a')]['rawAttributes'],function(_0x51233f){return{'name':_0x51233f[_0xf710('0x3b')],'type':_0x51233f[_0xf710('0x3c')][_0xf710('0x3d')]};});_0x25cd20['model']=_['map'](_0x3aec01,_0xf710('0x37'));_0x25cd20[_0xf710('0x3e')]=_['keys'](_0x206e4d['query']);_0x25cd20[_0xf710('0x3f')]=_['intersection'](_0x25cd20[_0xf710('0x40')],_0x25cd20[_0xf710('0x3e')]);_0xca2272['attributes']=_[_0xf710('0x41')](_0x25cd20['model'],qs[_0xf710('0x42')](_0x206e4d['query'][_0xf710('0x42')]));_0xca2272[_0xf710('0x43')]=_0xca2272[_0xf710('0x43')]['length']?_0xca2272[_0xf710('0x43')]:_0x25cd20[_0xf710('0x40')];if(!_0x206e4d[_0xf710('0x3e')]['hasOwnProperty'](_0xf710('0x44'))){_0xca2272[_0xf710('0x2a')]=qs['limit'](_0x206e4d[_0xf710('0x3e')][_0xf710('0x2a')]);_0xca2272[_0xf710('0x2c')]=qs[_0xf710('0x2c')](_0x206e4d[_0xf710('0x3e')][_0xf710('0x2c')]);}_0xca2272[_0xf710('0x45')]=qs[_0xf710('0x46')](_0x206e4d[_0xf710('0x3e')]['sort']);_0xca2272[_0xf710('0x47')]=qs['filters'](_[_0xf710('0x48')](_0x206e4d[_0xf710('0x3e')],_0x25cd20['filters']),_0x3aec01);if(_0x206e4d[_0xf710('0x3e')][_0xf710('0x49')]){_0xca2272[_0xf710('0x47')]=_['merge'](_0xca2272[_0xf710('0x47')],{'$or':_[_0xf710('0x39')](_0x3aec01,function(_0x90a341){if(_0x90a341[_0xf710('0x3c')]!=='VIRTUAL'){var _0x20464b={};_0x20464b[_0x90a341[_0xf710('0x37')]]={'$like':'%'+_0x206e4d[_0xf710('0x3e')][_0xf710('0x49')]+'%'};return _0x20464b;}})});}_0xca2272=_[_0xf710('0x4a')]({},_0xca2272,_0x206e4d[_0xf710('0x4b')]);var _0x3e7457={'where':_0xca2272['where']};return db[_0xf710('0x3a')][_0xf710('0x2b')](_0x3e7457)[_0xf710('0x1d')](function(_0x2dc9ec){_0x4580ae[_0xf710('0x2b')]=_0x2dc9ec;if(_0x206e4d[_0xf710('0x3e')]['includeAll']){_0xca2272['include']=[{'all':!![]}];}return db[_0xf710('0x3a')][_0xf710('0x4c')](_0xca2272);})['then'](function(_0x2f3931){_0x4580ae[_0xf710('0x4d')]=_0x2f3931;return _0x4580ae;})['then'](respondWithFilteredResult(_0x36743c,_0xca2272))[_0xf710('0x4e')](handleError(_0x36743c,null));};exports['show']=function(_0x5ae2c7,_0x1c7ba1){var _0x5bf71b={'raw':!![],'where':{'id':_0x5ae2c7[_0xf710('0x4f')]['id']}},_0x533975={};_0x533975['model']=_[_0xf710('0x50')](db['WhatsappMessage']['rawAttributes']);_0x533975[_0xf710('0x3e')]=_['keys'](_0x5ae2c7[_0xf710('0x3e')]);_0x533975[_0xf710('0x3f')]=_[_0xf710('0x41')](_0x533975['model'],_0x533975['query']);_0x5bf71b[_0xf710('0x43')]=_[_0xf710('0x41')](_0x533975[_0xf710('0x40')],qs['fields'](_0x5ae2c7[_0xf710('0x3e')][_0xf710('0x42')]));_0x5bf71b[_0xf710('0x43')]=_0x5bf71b['attributes'][_0xf710('0x51')]?_0x5bf71b[_0xf710('0x43')]:_0x533975['model'];if(_0x5ae2c7[_0xf710('0x3e')][_0xf710('0x52')]){_0x5bf71b[_0xf710('0x53')]=[{'all':!![]}];}_0x5bf71b=_[_0xf710('0x4a')]({},_0x5bf71b,_0x5ae2c7[_0xf710('0x4b')]);return db[_0xf710('0x3a')][_0xf710('0x54')](_0x5bf71b)[_0xf710('0x1d')](handleEntityNotFound(_0x1c7ba1,null))['then'](respondWithResult(_0x1c7ba1,null))[_0xf710('0x4e')](handleError(_0x1c7ba1,null));};exports[_0xf710('0x55')]=function(_0x2101f2,_0x1d27d2){return db['WhatsappMessage'][_0xf710('0x55')](_0x2101f2[_0xf710('0x56')],{})[_0xf710('0x1d')](respondWithResult(_0x1d27d2,0xc9))[_0xf710('0x4e')](handleError(_0x1d27d2,null));};exports['update']=function(_0x1aa89b,_0x895cca){if(_0x1aa89b[_0xf710('0x56')]['id']){delete _0x1aa89b[_0xf710('0x56')]['id'];}return db[_0xf710('0x3a')][_0xf710('0x54')]({'where':{'id':_0x1aa89b['params']['id']}})[_0xf710('0x1d')](handleEntityNotFound(_0x895cca,null))[_0xf710('0x1d')](saveUpdates(_0x1aa89b['body'],null))[_0xf710('0x1d')](respondWithResult(_0x895cca,null))[_0xf710('0x4e')](handleError(_0x895cca,null));};exports[_0xf710('0x34')]=function(_0x4a62e7,_0xc590ad){return db[_0xf710('0x3a')][_0xf710('0x54')]({'where':{'id':_0x4a62e7[_0xf710('0x4f')]['id']}})[_0xf710('0x1d')](handleEntityNotFound(_0xc590ad,null))['then'](removeEntity(_0xc590ad,null))[_0xf710('0x4e')](handleError(_0xc590ad,null));};exports[_0xf710('0x57')]=function(_0x36b015,_0x4fc810){return db['WhatsappMessage'][_0xf710('0x57')]()[_0xf710('0x1d')](respondWithResult(_0x4fc810,null))['catch'](handleError(_0x4fc810,null));};var interaction_log=require(_0xf710('0x14'))('whatsapp-interactions');exports[_0xf710('0x58')]=function(_0x7ce383,_0x4ada1a,_0x5068ca){var _0x5d8eaa={'agent':{},'channel':_0xf710('0x59')};if(_0x7ce383['body']['id']){delete _0x7ce383[_0xf710('0x56')]['id'];}_0x7ce383[_0xf710('0x56')]['read']=!![];_0x7ce383[_0xf710('0x56')][_0xf710('0x5a')]=moment()[_0xf710('0x5b')](_0xf710('0x5c'));_0x7ce383[_0xf710('0x56')][_0xf710('0x5d')]=_0x7ce383['body'][_0xf710('0x5d')]||_0x7ce383['user']['id'];_0x5d8eaa['agent']['id']=_0x7ce383['body'][_0xf710('0x5d')];return db[_0xf710('0x3a')][_0xf710('0x54')]({'where':{'id':_0x7ce383[_0xf710('0x4f')]['id'],'UserId':null}})[_0xf710('0x1d')](handleEntityNotFound(_0x4ada1a,null))[_0xf710('0x1d')](saveUpdates(_0x7ce383['body'],null))[_0xf710('0x1d')](function(_0x3738ac){if(_0x3738ac){_0x5d8eaa[_0xf710('0x24')]=_0x3738ac['get']({'plain':!![]});return db[_0xf710('0x5e')]['find']({'where':{'id':_0x3738ac[_0xf710('0x5f')]}});}return null;})['then'](handleEntityNotFound(_0x4ada1a,null))[_0xf710('0x1d')](function(_0x44a89){if(_0x44a89){return _0x44a89[_0xf710('0x33')]({'UserId':_0x7ce383[_0xf710('0x56')]['UserId'],'read1stAt':_['isNil'](_0x44a89[_0xf710('0x60')])?moment()[_0xf710('0x5b')](_0xf710('0x5c')):undefined});}return null;})[_0xf710('0x1d')](function(_0x1246a6){if(_0x1246a6){_0x5d8eaa[_0xf710('0x61')]=_0x1246a6['get']({'plain':!![]});interaction_log['info'](_0xf710('0x62'),_0x7ce383[_0xf710('0x63')]['id'],_0x7ce383[_0xf710('0x63')][_0xf710('0x37')],_0x7ce383[_0xf710('0x63')][_0xf710('0x64')],_0x5d8eaa[_0xf710('0x61')]['id'],_0x7ce383[_0xf710('0x56')]?JSON['stringify'](_0x7ce383[_0xf710('0x56')]):'null');return respondWithRpcPromise(_0xf710('0x65'),_0xf710('0x66'),_0x5d8eaa);}return null;})[_0xf710('0x1d')](function(_0x1b84e0){var _0x4e0f9f='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x1b84e0[_0xf710('0x24')][_0xf710('0x67')];return db['sequelize'][_0xf710('0x3e')](_0x4e0f9f,{'type':db[_0xf710('0x68')][_0xf710('0x69')]['SELECT'],'raw':!![]})[_0xf710('0x1d')](function(_0x49d2a2){return _0x49d2a2;});})[_0xf710('0x1d')](function(_0x4453e0){if(_0x4453e0){_0x5d8eaa[_0xf710('0x24')][_0xf710('0x6a')]=_0x4453e0[0x0];if(!_0x7ce383[_0xf710('0x56')][_0xf710('0x5d')])return;return db[_0xf710('0x6b')][_0xf710('0x54')]({'where':{'id':_0x7ce383[_0xf710('0x56')]['UserId'],'role':_0xf710('0x6c')},'attributes':['id',_0xf710('0x37'),_0xf710('0x6d'),_0xf710('0x6e'),_0xf710('0x6f')],'raw':!![]});}return null;})[_0xf710('0x1d')](function(_0x4ac97b){if(!_0x4ac97b)return null;_0x5d8eaa['message'][_0xf710('0x6c')]=_0x4ac97b;return _0x5d8eaa;})[_0xf710('0x1d')](function(_0x49083d){if(_0x49083d){if(_0x7ce383[_0xf710('0x56')][_0xf710('0x70')]){_0x5d8eaa[_0xf710('0x24')][_0xf710('0x71')]=util[_0xf710('0x5b')](_0xf710('0x72'),_0x7ce383['user']['name']);_0x5d8eaa['message'][_0xf710('0x73')]=_0x5d8eaa[_0xf710('0x73')];_0x5d8eaa[_0xf710('0x24')][_0xf710('0x74')]=_0x5d8eaa[_0xf710('0x73')];_0x5d8eaa[_0xf710('0x24')][_0xf710('0x75')]=_0xf710('0x58');return respondWithRpcPromise('EventManager','EventManager',{'event':_0xf710('0x76'),'message':_0x5d8eaa[_0xf710('0x24')]},client9002)['then'](function(){return _0x5d8eaa;});}return _0x5d8eaa;}return null;})[_0xf710('0x1d')](respondWithResult(_0x4ada1a,null))[_0xf710('0x4e')](handleError(_0x4ada1a,null));};var interaction_log=require('../../config/logger')(_0xf710('0x77'));exports[_0xf710('0x31')]=function(_0x1ff1a1,_0x6c0770,_0x4b9061){var _0x2bfc9e={'agent':{},'channel':_0xf710('0x59')};if(_0x1ff1a1[_0xf710('0x56')]['id']){delete _0x1ff1a1[_0xf710('0x56')]['id'];}_0x1ff1a1[_0xf710('0x56')][_0xf710('0x5d')]=_0x1ff1a1[_0xf710('0x56')][_0xf710('0x5d')]||_0x1ff1a1[_0xf710('0x63')]['id'];_0x2bfc9e[_0xf710('0x6c')]['id']=_0x1ff1a1['body']['UserId'];return db[_0xf710('0x3a')][_0xf710('0x54')]({'where':{'id':_0x1ff1a1[_0xf710('0x4f')]['id'],'UserId':null}})[_0xf710('0x1d')](handleEntityNotFound(_0x6c0770,null))['then'](function(_0x4729b6){if(_0x4729b6){_0x2bfc9e[_0xf710('0x24')]=_0x4729b6[_0xf710('0x78')]({'plain':!![]});return db[_0xf710('0x5e')][_0xf710('0x54')]({'where':{'id':_0x4729b6[_0xf710('0x5f')]}});}return null;})[_0xf710('0x1d')](handleEntityNotFound(_0x6c0770,null))[_0xf710('0x1d')](function(_0x3e00cd){if(_0x3e00cd){_0x2bfc9e['interaction']=_0x3e00cd[_0xf710('0x78')]({'plain':!![]});interaction_log[_0xf710('0x1e')](_0xf710('0x79'),_0x1ff1a1[_0xf710('0x63')]['id'],_0x1ff1a1[_0xf710('0x63')][_0xf710('0x37')],_0x1ff1a1['user']['role'],_0x2bfc9e[_0xf710('0x61')]['id'],_0x1ff1a1[_0xf710('0x56')]?JSON['stringify'](_0x1ff1a1[_0xf710('0x56')]):'null');return respondWithRpcPromise(_0xf710('0x7a'),'rejectMessage',_0x2bfc9e);}return null;})[_0xf710('0x1d')](function(_0x470c45){var _0x3abe63=_0xf710('0x7b')+_0x470c45[_0xf710('0x24')]['ContactId'];return db[_0xf710('0x7c')]['query'](_0x3abe63,{'type':db[_0xf710('0x68')][_0xf710('0x69')][_0xf710('0x7d')],'raw':!![]})[_0xf710('0x1d')](function(_0x3cdbd5){return _0x3cdbd5;});})['then'](function(_0x33f9c6){if(_0x33f9c6){_0x2bfc9e[_0xf710('0x24')][_0xf710('0x6a')]=_0x33f9c6[0x0];if(!_0x1ff1a1[_0xf710('0x56')]['UserId'])return;return db[_0xf710('0x6b')][_0xf710('0x54')]({'where':{'id':_0x1ff1a1[_0xf710('0x56')][_0xf710('0x5d')],'role':_0xf710('0x6c')},'attributes':['id','name',_0xf710('0x6d'),_0xf710('0x6e'),_0xf710('0x6f')],'raw':!![]});}return null;})[_0xf710('0x1d')](function(_0x5cef31){if(!_0x5cef31)return null;_0x2bfc9e[_0xf710('0x24')]['agent']=_0x5cef31;return _0x2bfc9e;})[_0xf710('0x1d')](function(_0x3fb285){if(_0x3fb285){_0x3fb285[_0xf710('0x24')][_0xf710('0x71')]=util[_0xf710('0x5b')](_0xf710('0x72'),_0x1ff1a1['user'][_0xf710('0x37')]);_0x3fb285[_0xf710('0x24')][_0xf710('0x73')]=_0x2bfc9e[_0xf710('0x73')];_0x3fb285[_0xf710('0x24')]['motionChannel']=_0x2bfc9e[_0xf710('0x73')];_0x3fb285[_0xf710('0x24')]['event']=_0xf710('0x31');respondWithRpcPromise(_0xf710('0x7e'),_0xf710('0x7e'),{'event':'rejectmessage','message':_0x3fb285[_0xf710('0x24')]},client9002);return _0x2bfc9e;}return null;})[_0xf710('0x1d')](respondWithResult(_0x6c0770,null))[_0xf710('0x4e')](handleError(_0x6c0770,null));};exports[_0xf710('0x28')]=function(_0x217e85,_0x48a042,_0x525c77){if(_0x217e85[_0xf710('0x56')]['id']){delete _0x217e85[_0xf710('0x56')]['id'];}var _0x42aa19;return db[_0xf710('0x3a')][_0xf710('0x54')]({'where':{'id':_0x217e85[_0xf710('0x4f')]['id']}})[_0xf710('0x1d')](handleEntityNotFound(_0x48a042,null))[_0xf710('0x1d')](function(_0x59a029){if(_0x59a029){_0x42aa19=_0x59a029;return db['WhatsappAccount']['find']({'where':{'id':_0x59a029['WhatsappAccountId']}});}})[_0xf710('0x1d')](handleEntityNotFound(_0x48a042,null))[_0xf710('0x1d')](function(_0x113999){if(_0x113999){logger[_0xf710('0x20')](_0xf710('0x7f'),_0xf710('0x28'),'received\x20delivery\x20report\x20from',_0x113999[_0xf710('0x3c')],util[_0xf710('0x80')](_0x217e85[_0xf710('0x56')],{'showHidden':![],'depth':null}));switch(_0x113999[_0xf710('0x3c')]){case _0xf710('0x81'):if(_0x217e85['body']['MessageSid']&&_0x217e85['body'][_0xf710('0x82')]===_0x42aa19[_0xf710('0x83')]&&_0x217e85[_0xf710('0x56')]['MessageStatus']&&_0x217e85[_0xf710('0x56')][_0xf710('0x84')]==='read'){return _0x42aa19[_0xf710('0x33')]({'read':!![]});}else{logger[_0xf710('0x22')](_0xf710('0x85'),_0xf710('0x28'),_0xf710('0x81'),util[_0xf710('0x80')](_0x217e85[_0xf710('0x56')],{'showHidden':![],'depth':null}));}break;}return _0x42aa19;}})['then'](respondWithResult(_0x48a042,null))[_0xf710('0x4e')](handleError(_0x48a042,null));}; \ No newline at end of file +var _0x8407=['WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','inspect','MessageStatus','twilio','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','debug','request\x20sent','stringify','error','code','message','WhatsappMessage,\x20%s,\x20%s','result','catch','sendStatus','status','end','json','offset','undefined','count','Content-Range','apply','reject','save','update','name','map','WhatsappMessage','fieldName','type','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','VIRTUAL','merge','includeAll','findAll','rows','show','keys','rawAttributes','fields','create','body','find','destroy','params','describe','whatsapp-interactions','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','get','WhatsappInteractionId','isNil','interaction','role','null','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','QueryTypes','SELECT','contact','User','agent','fullname','email','manual','interface','SIP/%s','user','channel','event','EventManager','acceptmessage','whatsapp','WhatsappInteraction','ContactId','Sequelize','internal','motionChannel','rejectmessage'];(function(_0x14a120,_0x342cc3){var _0x198999=function(_0x1a4cf0){while(--_0x1a4cf0){_0x14a120['push'](_0x14a120['shift']());}};_0x198999(++_0x342cc3);}(_0x8407,0x10d));var _0x7840=function(_0x1ee990,_0x3d42c2){_0x1ee990=_0x1ee990-0x0;var _0x5adb49=_0x8407[_0x1ee990];return _0x5adb49;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7840('0x0'));var jsonpatch=require(_0x7840('0x1'));var rp=require(_0x7840('0x2'));var moment=require(_0x7840('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7840('0x4'));var path=require(_0x7840('0x5'));var sox=require(_0x7840('0x6'));var csv=require('to-csv');var ejs=require(_0x7840('0x7'));var fs=require('fs');var fs_extra=require(_0x7840('0x8'));var _=require(_0x7840('0x9'));var squel=require(_0x7840('0xa'));var crypto=require(_0x7840('0xb'));var jsforce=require(_0x7840('0xc'));var deskjs=require(_0x7840('0xd'));var toCsv=require('to-csv');var querystring=require(_0x7840('0xe'));var Papa=require(_0x7840('0xf'));var Redis=require(_0x7840('0x10'));var authService=require(_0x7840('0x11'));var qs=require(_0x7840('0x12'));var as=require(_0x7840('0x13'));var hardwareService=require(_0x7840('0x14'));var logger=require(_0x7840('0x15'))(_0x7840('0x16'));var utils=require('../../config/utils');var config=require(_0x7840('0x17'));var licenseUtil=require(_0x7840('0x18'));var db=require(_0x7840('0x19'))['db'];config['redis']=_[_0x7840('0x1a')](config[_0x7840('0x1b')],{'host':_0x7840('0x1c'),'port':0x18eb});var socket=require(_0x7840('0x1d'))(new Redis(config[_0x7840('0x1b')]));require('./whatsappMessage.socket')[_0x7840('0x1e')](socket);var jayson=require(_0x7840('0x1f'));var client=jayson[_0x7840('0x20')][_0x7840('0x21')]({'port':0x232c});var client9002=jayson['client'][_0x7840('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x132a79,_0x1892ef,_0x3a127c,_0x5ece03){return new BPromise(function(_0x135dc6,_0x5984a6){var _0x428351=_0x5ece03||client;return _0x428351[_0x7840('0x22')](_0x132a79,_0x3a127c)[_0x7840('0x23')](function(_0x19dbbe){logger[_0x7840('0x24')]('WhatsappMessage,\x20%s,\x20%s',_0x1892ef,'request\x20sent');logger[_0x7840('0x25')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x1892ef,_0x7840('0x26'),JSON[_0x7840('0x27')](_0x19dbbe));if(_0x19dbbe[_0x7840('0x28')]){if(_0x19dbbe['error'][_0x7840('0x29')]===0x1f4){logger['error']('WhatsappMessage,\x20%s,\x20%s',_0x1892ef,_0x19dbbe[_0x7840('0x28')][_0x7840('0x2a')]);return _0x5984a6(_0x19dbbe[_0x7840('0x28')][_0x7840('0x2a')]);}logger[_0x7840('0x28')](_0x7840('0x2b'),_0x1892ef,_0x19dbbe['error'][_0x7840('0x2a')]);return _0x135dc6(_0x19dbbe[_0x7840('0x28')]['message']);}else{logger[_0x7840('0x24')](_0x7840('0x2b'),_0x1892ef,_0x7840('0x26'));_0x135dc6(_0x19dbbe[_0x7840('0x2c')][_0x7840('0x2a')]);}})[_0x7840('0x2d')](function(_0x27870b){logger[_0x7840('0x28')](_0x7840('0x2b'),_0x1892ef,_0x27870b);_0x5984a6(_0x27870b);});});}function respondWithStatusCode(_0x24e16c,_0x1a1e2e){_0x1a1e2e=_0x1a1e2e||0xcc;return function(_0x262744){if(_0x262744){return _0x24e16c[_0x7840('0x2e')](_0x1a1e2e);}return _0x24e16c[_0x7840('0x2f')](_0x1a1e2e)[_0x7840('0x30')]();};}function respondWithResult(_0x360079,_0x412f15){_0x412f15=_0x412f15||0xc8;return function(_0x1b82c9){if(_0x1b82c9){return _0x360079[_0x7840('0x2f')](_0x412f15)[_0x7840('0x31')](_0x1b82c9);}};}function respondWithFilteredResult(_0x373b24,_0x3f76f7){return function(_0x474d2d){if(_0x474d2d){var _0x261504=typeof _0x3f76f7[_0x7840('0x32')]===_0x7840('0x33')&&typeof _0x3f76f7['limit']===_0x7840('0x33');var _0x2b3a21=_0x474d2d['count'];var _0x547420=_0x261504?0x0:_0x3f76f7[_0x7840('0x32')];var _0x3cc536=_0x261504?_0x474d2d[_0x7840('0x34')]:_0x3f76f7[_0x7840('0x32')]+_0x3f76f7['limit'];var _0x21ded3;if(_0x3cc536>=_0x2b3a21){_0x3cc536=_0x2b3a21;_0x21ded3=0xc8;}else{_0x21ded3=0xce;}_0x373b24['status'](_0x21ded3);return _0x373b24['set'](_0x7840('0x35'),_0x547420+'-'+_0x3cc536+'/'+_0x2b3a21)[_0x7840('0x31')](_0x474d2d);}return null;};}function patchUpdates(_0x33a826){return function(_0x116ed9){try{jsonpatch[_0x7840('0x36')](_0x116ed9,_0x33a826,!![]);}catch(_0x55cc5a){return BPromise[_0x7840('0x37')](_0x55cc5a);}return _0x116ed9[_0x7840('0x38')]();};}function saveUpdates(_0xd363b4,_0x4f132d){return function(_0x44f834){if(_0x44f834){return _0x44f834[_0x7840('0x39')](_0xd363b4)[_0x7840('0x23')](function(_0x5786ce){return _0x5786ce;});}return null;};}function removeEntity(_0x18515a,_0x3d2f44){return function(_0x546c40){if(_0x546c40){return _0x546c40['destroy']()['then'](function(){_0x18515a['status'](0xcc)[_0x7840('0x30')]();});}};}function handleEntityNotFound(_0x18c3d9,_0x387b26){return function(_0xbbf11c){if(!_0xbbf11c){_0x18c3d9[_0x7840('0x2e')](0x194);}return _0xbbf11c;};}function handleError(_0x39c7e0,_0x351f90){_0x351f90=_0x351f90||0x1f4;return function(_0xfac70f){logger[_0x7840('0x28')](_0xfac70f['stack']);if(_0xfac70f[_0x7840('0x3a')]){delete _0xfac70f[_0x7840('0x3a')];}_0x39c7e0[_0x7840('0x2f')](_0x351f90)['send'](_0xfac70f);};}exports['index']=function(_0x3d225d,_0x24d71d){var _0xc8f3f2={},_0x571924={},_0x18b7bd={'count':0x0,'rows':[]};var _0x1d437a=_[_0x7840('0x3b')](db[_0x7840('0x3c')]['rawAttributes'],function(_0x5df1ea){return{'name':_0x5df1ea[_0x7840('0x3d')],'type':_0x5df1ea[_0x7840('0x3e')]['key']};});_0x571924[_0x7840('0x3f')]=_[_0x7840('0x3b')](_0x1d437a,_0x7840('0x3a'));_0x571924[_0x7840('0x40')]=_['keys'](_0x3d225d[_0x7840('0x40')]);_0x571924[_0x7840('0x41')]=_[_0x7840('0x42')](_0x571924['model'],_0x571924[_0x7840('0x40')]);_0xc8f3f2[_0x7840('0x43')]=_['intersection'](_0x571924[_0x7840('0x3f')],qs['fields'](_0x3d225d[_0x7840('0x40')]['fields']));_0xc8f3f2['attributes']=_0xc8f3f2[_0x7840('0x43')][_0x7840('0x44')]?_0xc8f3f2['attributes']:_0x571924[_0x7840('0x3f')];if(!_0x3d225d[_0x7840('0x40')][_0x7840('0x45')](_0x7840('0x46'))){_0xc8f3f2[_0x7840('0x47')]=qs[_0x7840('0x47')](_0x3d225d[_0x7840('0x40')][_0x7840('0x47')]);_0xc8f3f2[_0x7840('0x32')]=qs[_0x7840('0x32')](_0x3d225d[_0x7840('0x40')][_0x7840('0x32')]);}_0xc8f3f2[_0x7840('0x48')]=qs[_0x7840('0x49')](_0x3d225d[_0x7840('0x40')][_0x7840('0x49')]);_0xc8f3f2[_0x7840('0x4a')]=qs[_0x7840('0x41')](_[_0x7840('0x4b')](_0x3d225d[_0x7840('0x40')],_0x571924[_0x7840('0x41')]),_0x1d437a);if(_0x3d225d[_0x7840('0x40')]['filter']){_0xc8f3f2[_0x7840('0x4a')]=_['merge'](_0xc8f3f2[_0x7840('0x4a')],{'$or':_[_0x7840('0x3b')](_0x1d437a,function(_0x12fdd5){if(_0x12fdd5[_0x7840('0x3e')]!==_0x7840('0x4c')){var _0x53c6b7={};_0x53c6b7[_0x12fdd5[_0x7840('0x3a')]]={'$like':'%'+_0x3d225d['query']['filter']+'%'};return _0x53c6b7;}})});}_0xc8f3f2=_[_0x7840('0x4d')]({},_0xc8f3f2,_0x3d225d['options']);var _0x26c012={'where':_0xc8f3f2[_0x7840('0x4a')]};return db[_0x7840('0x3c')]['count'](_0x26c012)[_0x7840('0x23')](function(_0x169e7e){_0x18b7bd['count']=_0x169e7e;if(_0x3d225d['query'][_0x7840('0x4e')]){_0xc8f3f2['include']=[{'all':!![]}];}return db['WhatsappMessage'][_0x7840('0x4f')](_0xc8f3f2);})['then'](function(_0x33a95){_0x18b7bd[_0x7840('0x50')]=_0x33a95;return _0x18b7bd;})['then'](respondWithFilteredResult(_0x24d71d,_0xc8f3f2))[_0x7840('0x2d')](handleError(_0x24d71d,null));};exports[_0x7840('0x51')]=function(_0x571aa1,_0x232090){var _0x5eac0f={'raw':!![],'where':{'id':_0x571aa1['params']['id']}},_0x426c04={};_0x426c04[_0x7840('0x3f')]=_[_0x7840('0x52')](db[_0x7840('0x3c')][_0x7840('0x53')]);_0x426c04[_0x7840('0x40')]=_['keys'](_0x571aa1['query']);_0x426c04[_0x7840('0x41')]=_[_0x7840('0x42')](_0x426c04[_0x7840('0x3f')],_0x426c04[_0x7840('0x40')]);_0x5eac0f['attributes']=_[_0x7840('0x42')](_0x426c04[_0x7840('0x3f')],qs[_0x7840('0x54')](_0x571aa1[_0x7840('0x40')][_0x7840('0x54')]));_0x5eac0f[_0x7840('0x43')]=_0x5eac0f['attributes'][_0x7840('0x44')]?_0x5eac0f[_0x7840('0x43')]:_0x426c04[_0x7840('0x3f')];if(_0x571aa1[_0x7840('0x40')]['includeAll']){_0x5eac0f['include']=[{'all':!![]}];}_0x5eac0f=_['merge']({},_0x5eac0f,_0x571aa1['options']);return db[_0x7840('0x3c')]['find'](_0x5eac0f)['then'](handleEntityNotFound(_0x232090,null))[_0x7840('0x23')](respondWithResult(_0x232090,null))[_0x7840('0x2d')](handleError(_0x232090,null));};exports[_0x7840('0x55')]=function(_0xc23627,_0x3b3051){return db[_0x7840('0x3c')][_0x7840('0x55')](_0xc23627['body'],{})[_0x7840('0x23')](respondWithResult(_0x3b3051,0xc9))[_0x7840('0x2d')](handleError(_0x3b3051,null));};exports['update']=function(_0x3562e4,_0x51df87){if(_0x3562e4[_0x7840('0x56')]['id']){delete _0x3562e4[_0x7840('0x56')]['id'];}return db[_0x7840('0x3c')][_0x7840('0x57')]({'where':{'id':_0x3562e4['params']['id']}})[_0x7840('0x23')](handleEntityNotFound(_0x51df87,null))[_0x7840('0x23')](saveUpdates(_0x3562e4[_0x7840('0x56')],null))[_0x7840('0x23')](respondWithResult(_0x51df87,null))[_0x7840('0x2d')](handleError(_0x51df87,null));};exports[_0x7840('0x58')]=function(_0x6eb77f,_0x460269){return db[_0x7840('0x3c')][_0x7840('0x57')]({'where':{'id':_0x6eb77f[_0x7840('0x59')]['id']}})[_0x7840('0x23')](handleEntityNotFound(_0x460269,null))[_0x7840('0x23')](removeEntity(_0x460269,null))[_0x7840('0x2d')](handleError(_0x460269,null));};exports[_0x7840('0x5a')]=function(_0x2ff0a7,_0x84a981){return db['WhatsappMessage']['describe']()[_0x7840('0x23')](respondWithResult(_0x84a981,null))[_0x7840('0x2d')](handleError(_0x84a981,null));};var interaction_log=require(_0x7840('0x15'))(_0x7840('0x5b'));exports[_0x7840('0x5c')]=function(_0x453bd5,_0x4aad03,_0x2fa497){var _0x5396d8={'agent':{},'channel':'whatsapp'};if(_0x453bd5[_0x7840('0x56')]['id']){delete _0x453bd5[_0x7840('0x56')]['id'];}_0x453bd5['body'][_0x7840('0x5d')]=!![];_0x453bd5['body'][_0x7840('0x5e')]=moment()[_0x7840('0x5f')](_0x7840('0x60'));_0x453bd5[_0x7840('0x56')][_0x7840('0x61')]=_0x453bd5['body']['UserId']||_0x453bd5['user']['id'];_0x5396d8['agent']['id']=_0x453bd5[_0x7840('0x56')][_0x7840('0x61')];return db['WhatsappMessage']['find']({'where':{'id':_0x453bd5[_0x7840('0x59')]['id'],'UserId':null}})[_0x7840('0x23')](handleEntityNotFound(_0x4aad03,null))[_0x7840('0x23')](saveUpdates(_0x453bd5['body'],null))['then'](function(_0xaff311){if(_0xaff311){_0x5396d8[_0x7840('0x2a')]=_0xaff311[_0x7840('0x62')]({'plain':!![]});return db['WhatsappInteraction'][_0x7840('0x57')]({'where':{'id':_0xaff311[_0x7840('0x63')]}});}return null;})['then'](handleEntityNotFound(_0x4aad03,null))[_0x7840('0x23')](function(_0x503db1){if(_0x503db1){return _0x503db1[_0x7840('0x39')]({'UserId':_0x453bd5[_0x7840('0x56')][_0x7840('0x61')],'read1stAt':_[_0x7840('0x64')](_0x503db1['read1stAt'])?moment()[_0x7840('0x5f')](_0x7840('0x60')):undefined});}return null;})[_0x7840('0x23')](function(_0x182dc1){if(_0x182dc1){_0x5396d8[_0x7840('0x65')]=_0x182dc1['get']({'plain':!![]});interaction_log[_0x7840('0x24')]('[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x453bd5['user']['id'],_0x453bd5['user'][_0x7840('0x3a')],_0x453bd5['user'][_0x7840('0x66')],_0x5396d8[_0x7840('0x65')]['id'],_0x453bd5[_0x7840('0x56')]?JSON[_0x7840('0x27')](_0x453bd5[_0x7840('0x56')]):_0x7840('0x67'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x5396d8);}return null;})[_0x7840('0x23')](function(_0x16e8e1){var _0x4c7137=_0x7840('0x68')+_0x16e8e1[_0x7840('0x2a')]['ContactId'];return db['sequelize'][_0x7840('0x40')](_0x4c7137,{'type':db['Sequelize'][_0x7840('0x69')][_0x7840('0x6a')],'raw':!![]})[_0x7840('0x23')](function(_0x5bfeeb){return _0x5bfeeb;});})[_0x7840('0x23')](function(_0x49b346){if(_0x49b346){_0x5396d8['message'][_0x7840('0x6b')]=_0x49b346[0x0];if(!_0x453bd5[_0x7840('0x56')][_0x7840('0x61')])return;return db[_0x7840('0x6c')][_0x7840('0x57')]({'where':{'id':_0x453bd5[_0x7840('0x56')][_0x7840('0x61')],'role':_0x7840('0x6d')},'attributes':['id',_0x7840('0x3a'),_0x7840('0x6e'),_0x7840('0x6f'),'internal'],'raw':!![]});}return null;})[_0x7840('0x23')](function(_0x481c5f){if(!_0x481c5f)return null;_0x5396d8[_0x7840('0x2a')]['agent']=_0x481c5f;return _0x5396d8;})['then'](function(_0x1abb17){if(_0x1abb17){if(_0x453bd5[_0x7840('0x56')][_0x7840('0x70')]){_0x5396d8[_0x7840('0x2a')][_0x7840('0x71')]=util['format'](_0x7840('0x72'),_0x453bd5[_0x7840('0x73')]['name']);_0x5396d8[_0x7840('0x2a')][_0x7840('0x74')]=_0x5396d8[_0x7840('0x74')];_0x5396d8[_0x7840('0x2a')]['motionChannel']=_0x5396d8[_0x7840('0x74')];_0x5396d8[_0x7840('0x2a')][_0x7840('0x75')]='accept';return respondWithRpcPromise(_0x7840('0x76'),'EventManager',{'event':_0x7840('0x77'),'message':_0x5396d8[_0x7840('0x2a')]},client9002)[_0x7840('0x23')](function(){return _0x5396d8;});}return _0x5396d8;}return null;})[_0x7840('0x23')](respondWithResult(_0x4aad03,null))[_0x7840('0x2d')](handleError(_0x4aad03,null));};var interaction_log=require(_0x7840('0x15'))(_0x7840('0x5b'));exports[_0x7840('0x37')]=function(_0x422194,_0x3a1af8,_0x339a6a){var _0x4cd963={'agent':{},'channel':_0x7840('0x78')};if(_0x422194['body']['id']){delete _0x422194[_0x7840('0x56')]['id'];}_0x422194[_0x7840('0x56')][_0x7840('0x61')]=_0x422194['body'][_0x7840('0x61')]||_0x422194['user']['id'];_0x4cd963[_0x7840('0x6d')]['id']=_0x422194[_0x7840('0x56')][_0x7840('0x61')];return db[_0x7840('0x3c')][_0x7840('0x57')]({'where':{'id':_0x422194[_0x7840('0x59')]['id'],'UserId':null}})[_0x7840('0x23')](handleEntityNotFound(_0x3a1af8,null))[_0x7840('0x23')](function(_0x329b70){if(_0x329b70){_0x4cd963[_0x7840('0x2a')]=_0x329b70[_0x7840('0x62')]({'plain':!![]});return db[_0x7840('0x79')]['find']({'where':{'id':_0x329b70[_0x7840('0x63')]}});}return null;})['then'](handleEntityNotFound(_0x3a1af8,null))[_0x7840('0x23')](function(_0x1b8b99){if(_0x1b8b99){_0x4cd963[_0x7840('0x65')]=_0x1b8b99[_0x7840('0x62')]({'plain':!![]});interaction_log['info']('[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x422194[_0x7840('0x73')]['id'],_0x422194[_0x7840('0x73')]['name'],_0x422194[_0x7840('0x73')][_0x7840('0x66')],_0x4cd963[_0x7840('0x65')]['id'],_0x422194[_0x7840('0x56')]?JSON['stringify'](_0x422194[_0x7840('0x56')]):_0x7840('0x67'));return respondWithRpcPromise('RejectMessage','rejectMessage',_0x4cd963);}return null;})[_0x7840('0x23')](function(_0x20835f){var _0xea4742='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x20835f[_0x7840('0x2a')][_0x7840('0x7a')];return db['sequelize'][_0x7840('0x40')](_0xea4742,{'type':db[_0x7840('0x7b')][_0x7840('0x69')]['SELECT'],'raw':!![]})[_0x7840('0x23')](function(_0x583100){return _0x583100;});})[_0x7840('0x23')](function(_0x3fb6a6){if(_0x3fb6a6){_0x4cd963['message']['contact']=_0x3fb6a6[0x0];if(!_0x422194[_0x7840('0x56')][_0x7840('0x61')])return;return db[_0x7840('0x6c')][_0x7840('0x57')]({'where':{'id':_0x422194[_0x7840('0x56')][_0x7840('0x61')],'role':_0x7840('0x6d')},'attributes':['id',_0x7840('0x3a'),_0x7840('0x6e'),_0x7840('0x6f'),_0x7840('0x7c')],'raw':!![]});}return null;})[_0x7840('0x23')](function(_0xd98b05){if(!_0xd98b05)return null;_0x4cd963[_0x7840('0x2a')][_0x7840('0x6d')]=_0xd98b05;return _0x4cd963;})[_0x7840('0x23')](function(_0x1a31bc){if(_0x1a31bc){_0x1a31bc['message'][_0x7840('0x71')]=util[_0x7840('0x5f')](_0x7840('0x72'),_0x422194[_0x7840('0x73')][_0x7840('0x3a')]);_0x1a31bc['message'][_0x7840('0x74')]=_0x4cd963[_0x7840('0x74')];_0x1a31bc[_0x7840('0x2a')][_0x7840('0x7d')]=_0x4cd963[_0x7840('0x74')];_0x1a31bc[_0x7840('0x2a')][_0x7840('0x75')]=_0x7840('0x37');respondWithRpcPromise(_0x7840('0x76'),'EventManager',{'event':_0x7840('0x7e'),'message':_0x1a31bc['message']},client9002);return _0x4cd963;}return null;})[_0x7840('0x23')](respondWithResult(_0x3a1af8,null))['catch'](handleError(_0x3a1af8,null));};exports['status']=function(_0x459d91,_0x8bef4f,_0x59fbdb){if(_0x459d91[_0x7840('0x56')]['id']){delete _0x459d91[_0x7840('0x56')]['id'];}var _0x3c0082;return db['WhatsappMessage'][_0x7840('0x57')]({'where':{'id':_0x459d91['params']['id']}})[_0x7840('0x23')](handleEntityNotFound(_0x8bef4f,null))[_0x7840('0x23')](function(_0x467b39){if(_0x467b39){_0x3c0082=_0x467b39;return db['WhatsappAccount']['find']({'where':{'id':_0x467b39[_0x7840('0x7f')]}});}})[_0x7840('0x23')](handleEntityNotFound(_0x8bef4f,null))[_0x7840('0x23')](function(_0x255356){if(_0x255356){logger[_0x7840('0x25')](_0x7840('0x80'),'status','received\x20delivery\x20report\x20from',_0x255356[_0x7840('0x3e')],util[_0x7840('0x81')](_0x459d91['body'],{'showHidden':![],'depth':null}));switch(_0x255356[_0x7840('0x3e')]){case'twilio':if(_0x459d91[_0x7840('0x56')]['MessageSid']&&_0x459d91['body']['MessageSid']===_0x3c0082['messageId']&&_0x459d91['body']['MessageStatus']&&_0x459d91[_0x7840('0x56')][_0x7840('0x82')]==='read'){return _0x3c0082[_0x7840('0x39')]({'read':!![]});}else{logger[_0x7840('0x28')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x7840('0x2f'),_0x7840('0x83'),util[_0x7840('0x81')](_0x459d91[_0x7840('0x56')],{'showHidden':![],'depth':null}));}break;}return _0x3c0082;}})[_0x7840('0x23')](respondWithResult(_0x8bef4f,null))[_0x7840('0x2d')](handleError(_0x8bef4f,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index 4bd0a6e..15e0043 100644 --- a/server/api/whatsappMessage/whatsappMessage.events.js +++ b/server/api/whatsappMessage/whatsappMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa25c=['WhatsappMessage','setMaxListeners','save','update','remove','hasOwnProperty','exports','../../mysqldb'];(function(_0x15fe14,_0x4de9be){var _0x755a98=function(_0x357222){while(--_0x357222){_0x15fe14['push'](_0x15fe14['shift']());}};_0x755a98(++_0x4de9be);}(_0xa25c,0x13f));var _0xca25=function(_0x510508,_0x30b4d2){_0x510508=_0x510508-0x0;var _0x486a65=_0xa25c[_0x510508];return _0x486a65;};'use strict';var EventEmitter=require('events');var WhatsappMessage=require(_0xca25('0x0'))['db'][_0xca25('0x1')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0xca25('0x2')](0x0);var events={'afterCreate':_0xca25('0x3'),'afterUpdate':_0xca25('0x4'),'afterDestroy':_0xca25('0x5')};function emitEvent(_0x2cc2d6){return function(_0x336741,_0x498b8e,_0x41d208){WhatsappMessageEvents['emit'](_0x2cc2d6+':'+_0x336741['id'],_0x336741);WhatsappMessageEvents['emit'](_0x2cc2d6,_0x336741);_0x41d208(null);};}for(var e in events){if(events[_0xca25('0x6')](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module[_0xca25('0x7')]=WhatsappMessageEvents; \ No newline at end of file +var _0x5423=['hook','exports','events','../../mysqldb','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5423,0xe3));var _0x3542=function(_0x7d3e40,_0x2e6e6){_0x7d3e40=_0x7d3e40-0x0;var _0x5b011a=_0x5423[_0x7d3e40];return _0x5b011a;};'use strict';var EventEmitter=require(_0x3542('0x0'));var WhatsappMessage=require(_0x3542('0x1'))['db']['WhatsappMessage'];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x3542('0x2')](0x0);var events={'afterCreate':_0x3542('0x3'),'afterUpdate':'update','afterDestroy':_0x3542('0x4')};function emitEvent(_0x1202d5){return function(_0xf0835,_0x2a1864,_0x54ea2f){WhatsappMessageEvents[_0x3542('0x5')](_0x1202d5+':'+_0xf0835['id'],_0xf0835);WhatsappMessageEvents[_0x3542('0x5')](_0x1202d5,_0xf0835);_0x54ea2f(null);};}for(var e in events){if(events[_0x3542('0x6')](e)){var event=events[e];WhatsappMessage[_0x3542('0x7')](e,emitEvent(event));}}module[_0x3542('0x8')]=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index b0e2c8f..7eb6e16 100644 --- a/server/api/whatsappMessage/whatsappMessage.model.js +++ b/server/api/whatsappMessage/whatsappMessage.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x48fc=['whatsapp:','remote','/api/whatsapp/messages/','/status?token=','token','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','inspect','afterCreate','sinch','/whatsapp/v1/','text','POST','statuses','message_id','WhatsappMessage,\x20%s','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','node-fetch','path','rimraf','../../config/environment','./whatsappMessage.attributes','exports','define','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','body','models','get','toLowerCase','direction','out','secret','isNil','UserId','WhatsappInteraction','findOne','WhatsappInteractionId','then','update','createdAt','catch','find','WhatsappAccountId','type','twilio','accountSid','authToken','phone','create'];(function(_0x3715e5,_0x2fb489){var _0x3a3f82=function(_0x36ae3c){while(--_0x36ae3c){_0x3715e5['push'](_0x3715e5['shift']());}};_0x3a3f82(++_0x2fb489);}(_0x48fc,0x103));var _0xc48f=function(_0x9025d5,_0x963f72){_0x9025d5=_0x9025d5-0x0;var _0x27a4dc=_0x48fc[_0x9025d5];return _0x27a4dc;};'use strict';var _=require(_0xc48f('0x0'));var util=require(_0xc48f('0x1'));var logger=require('../../config/logger')(_0xc48f('0x2'));var moment=require(_0xc48f('0x3'));var BPromise=require(_0xc48f('0x4'));var rp=require(_0xc48f('0x5'));var fetch=require(_0xc48f('0x6'));var fs=require('fs');var path=require(_0xc48f('0x7'));var rimraf=require(_0xc48f('0x8'));var config=require(_0xc48f('0x9'));var attributes=require(_0xc48f('0xa'));module[_0xc48f('0xb')]=function(_0x1a4980,_0x3767bb){return _0x1a4980[_0xc48f('0xc')](_0xc48f('0xd'),attributes,{'tableName':_0xc48f('0xe'),'paranoid':![],'indexes':[{'name':_0xc48f('0xf'),'fields':['messageId']},{'name':_0xc48f('0x10'),'fields':[_0xc48f('0x11')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x38b366,_0x1322ee,_0x45de9b){var _0x197315=_0x1a4980[_0xc48f('0x12')];var _0x316651=_0x38b366[_0xc48f('0x13')]({'plain':!![]});if(_0x316651['direction'][_0xc48f('0x14')]()==='in'||_0x316651[_0xc48f('0x15')][_0xc48f('0x14')]()===_0xc48f('0x16')&&!_0x316651[_0xc48f('0x17')]&&!_[_0xc48f('0x18')](_0x316651[_0xc48f('0x19')])){_0x197315[_0xc48f('0x1a')][_0xc48f('0x1b')]({'where':{'id':_0x316651[_0xc48f('0x1c')]}})[_0xc48f('0x1d')](function(_0x57bd06){if(_0x57bd06){_0x57bd06[_0xc48f('0x1e')]({'lastMsgAt':_0x316651[_0xc48f('0x1f')],'lastMsgDirection':_0x316651['direction'][_0xc48f('0x14')]()});}})[_0xc48f('0x20')](function(_0x201d2d){console['error'](_0x201d2d);});}if(_0x316651[_0xc48f('0x15')]===_0xc48f('0x16')&&!_0x316651[_0xc48f('0x17')]){var _0x28b4a8;_0x197315['WhatsappAccount'][_0xc48f('0x21')]({'where':{'id':_0x316651[_0xc48f('0x22')]},'raw':!![]})[_0xc48f('0x1d')](function(_0x1a6057){_0x28b4a8=_0x1a6057;if(_0x28b4a8&&_0x28b4a8[_0xc48f('0x23')]){switch(_0x28b4a8[_0xc48f('0x23')]){case _0xc48f('0x24'):var _0x530935=require(_0xc48f('0x24'));if(_0x28b4a8[_0xc48f('0x25')]&&_0x28b4a8[_0xc48f('0x26')]&&_0x28b4a8[_0xc48f('0x27')]){var _0x3edc90=new _0x530935(_0x28b4a8[_0xc48f('0x25')],_0x28b4a8['authToken']);_0x3edc90['messages'][_0xc48f('0x28')]({'body':_0x316651[_0xc48f('0x11')],'to':_0xc48f('0x29')+_0x316651[_0xc48f('0x27')],'from':_0xc48f('0x29')+_0x28b4a8[_0xc48f('0x27')],'statusCallback':_0x28b4a8[_0xc48f('0x2a')]+_0xc48f('0x2b')+_0x316651['id']+_0xc48f('0x2c')+_0x28b4a8[_0xc48f('0x2d')]})[_0xc48f('0x1d')](function(_0x2f133b){if(_0x2f133b['sid']){return _0x38b366[_0xc48f('0x1e')]({'messageId':_0x2f133b[_0xc48f('0x2e')]});}})['catch'](function(_0x1dfddc){logger['error'](_0xc48f('0x2f'),'afterCreate',_0xc48f('0x24'),util[_0xc48f('0x30')](_0x1dfddc,{'showHidden':![],'depth':null}));});}else{logger['error']('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0xc48f('0x31'),'twilio','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0xc48f('0x32'):var _0x3f78cc=_0x28b4a8[_0xc48f('0x25')];var _0x956d3b=_0x28b4a8[_0xc48f('0x26')];var _0x24cf25=_0x28b4a8['baseUrl']+_0xc48f('0x33')+_0x3f78cc+'/messages/';var _0x5c011c={'to':[_0x316651[_0xc48f('0x27')]],'message':{'type':_0xc48f('0x34'),'text':_0x316651[_0xc48f('0x11')]}};var _0x3a3cd3={'method':_0xc48f('0x35'),'uri':_0x24cf25,'headers':{'Authorization':'Bearer\x20'+_0x956d3b,'Content-Type':'application/json'},'body':_0x5c011c,'json':!![]};rp(_0x3a3cd3)['then'](function(_0x5791d7){if(_0x5791d7[_0xc48f('0x36')][0x0][_0xc48f('0x37')]){return _0x38b366[_0xc48f('0x1e')]({'messageId':_0x5791d7[_0xc48f('0x36')][0x0]['message_id']});}})[_0xc48f('0x20')](function(_0x357d14){logger['err'](_0xc48f('0x38'),_0x357d14);});break;}}})[_0xc48f('0x39')](function(){_0x45de9b();});}else{_0x45de9b();}}},'charset':_0xc48f('0x3a'),'collate':_0xc48f('0x3b')});}; \ No newline at end of file +var _0xd467=['path','rimraf','./whatsappMessage.attributes','exports','define','fti_whatsapp_messages','FULLTEXT','get','direction','toLowerCase','out','secret','isNil','UserId','WhatsappInteraction','WhatsappInteractionId','update','createdAt','catch','error','find','WhatsappAccountId','then','type','twilio','accountSid','authToken','phone','create','body','whatsapp:','remote','/api/whatsapp/messages/','token','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','baseUrl','/whatsapp/v1/','/messages/','text','POST','Bearer\x20','statuses','message_id','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0xcd5a3d,_0x3c5b33){var _0xd43207=function(_0x17d976){while(--_0x17d976){_0xcd5a3d['push'](_0xcd5a3d['shift']());}};_0xd43207(++_0x3c5b33);}(_0xd467,0x13e));var _0x7d46=function(_0x1fa849,_0x335135){_0x1fa849=_0x1fa849-0x0;var _0x497726=_0xd467[_0x1fa849];return _0x497726;};'use strict';var _=require(_0x7d46('0x0'));var util=require(_0x7d46('0x1'));var logger=require(_0x7d46('0x2'))(_0x7d46('0x3'));var moment=require(_0x7d46('0x4'));var BPromise=require('bluebird');var rp=require(_0x7d46('0x5'));var fetch=require('node-fetch');var fs=require('fs');var path=require(_0x7d46('0x6'));var rimraf=require(_0x7d46('0x7'));var config=require('../../config/environment');var attributes=require(_0x7d46('0x8'));module[_0x7d46('0x9')]=function(_0x53f639,_0x4800bb){return _0x53f639[_0x7d46('0xa')]('WhatsappMessage',attributes,{'tableName':'whatsapp_messages','paranoid':![],'indexes':[{'name':'messageId','fields':['messageId']},{'name':_0x7d46('0xb'),'fields':['body'],'type':_0x7d46('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x435483,_0x58f1e2,_0x55f907){var _0x403fb7=_0x53f639['models'];var _0x1fa290=_0x435483[_0x7d46('0xd')]({'plain':!![]});if(_0x1fa290[_0x7d46('0xe')][_0x7d46('0xf')]()==='in'||_0x1fa290['direction'][_0x7d46('0xf')]()===_0x7d46('0x10')&&!_0x1fa290[_0x7d46('0x11')]&&!_[_0x7d46('0x12')](_0x1fa290[_0x7d46('0x13')])){_0x403fb7[_0x7d46('0x14')]['findOne']({'where':{'id':_0x1fa290[_0x7d46('0x15')]}})['then'](function(_0x3d3783){if(_0x3d3783){_0x3d3783[_0x7d46('0x16')]({'lastMsgAt':_0x1fa290[_0x7d46('0x17')],'lastMsgDirection':_0x1fa290['direction'][_0x7d46('0xf')]()});}})[_0x7d46('0x18')](function(_0x558247){console[_0x7d46('0x19')](_0x558247);});}if(_0x1fa290[_0x7d46('0xe')]===_0x7d46('0x10')&&!_0x1fa290[_0x7d46('0x11')]){var _0x45cff0;_0x403fb7['WhatsappAccount'][_0x7d46('0x1a')]({'where':{'id':_0x1fa290[_0x7d46('0x1b')]},'raw':!![]})[_0x7d46('0x1c')](function(_0x19abe4){_0x45cff0=_0x19abe4;if(_0x45cff0&&_0x45cff0['type']){switch(_0x45cff0[_0x7d46('0x1d')]){case _0x7d46('0x1e'):var _0xa86da7=require('twilio');if(_0x45cff0[_0x7d46('0x1f')]&&_0x45cff0[_0x7d46('0x20')]&&_0x45cff0[_0x7d46('0x21')]){var _0xab1b88=new _0xa86da7(_0x45cff0[_0x7d46('0x1f')],_0x45cff0['authToken']);_0xab1b88['messages'][_0x7d46('0x22')]({'body':_0x1fa290[_0x7d46('0x23')],'to':'whatsapp:'+_0x1fa290[_0x7d46('0x21')],'from':_0x7d46('0x24')+_0x45cff0[_0x7d46('0x21')],'statusCallback':_0x45cff0[_0x7d46('0x25')]+_0x7d46('0x26')+_0x1fa290['id']+'/status?token='+_0x45cff0[_0x7d46('0x27')]})['then'](function(_0x326d3d){if(_0x326d3d[_0x7d46('0x28')]){return _0x435483['update']({'messageId':_0x326d3d[_0x7d46('0x28')]});}})[_0x7d46('0x18')](function(_0x382253){logger[_0x7d46('0x19')](_0x7d46('0x29'),_0x7d46('0x2a'),_0x7d46('0x1e'),util[_0x7d46('0x2b')](_0x382253,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x7d46('0x29'),_0x7d46('0x2a'),_0x7d46('0x1e'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case'sinch':var _0x225ae6=_0x45cff0[_0x7d46('0x1f')];var _0xceffd1=_0x45cff0[_0x7d46('0x20')];var _0x45f934=_0x45cff0[_0x7d46('0x2c')]+_0x7d46('0x2d')+_0x225ae6+_0x7d46('0x2e');var _0x1e3f9c={'to':[_0x1fa290['phone']],'message':{'type':_0x7d46('0x2f'),'text':_0x1fa290['body']}};var _0x319906={'method':_0x7d46('0x30'),'uri':_0x45f934,'headers':{'Authorization':_0x7d46('0x31')+_0xceffd1,'Content-Type':'application/json'},'body':_0x1e3f9c,'json':!![]};rp(_0x319906)['then'](function(_0x2e756f){if(_0x2e756f[_0x7d46('0x32')][0x0][_0x7d46('0x33')]){return _0x435483[_0x7d46('0x16')]({'messageId':_0x2e756f[_0x7d46('0x32')][0x0][_0x7d46('0x33')]});}})[_0x7d46('0x18')](function(_0x3b922c){logger['err']('WhatsappMessage,\x20%s',_0x3b922c);});break;}}})['finally'](function(){_0x55f907();});}else{_0x55f907();}}},'charset':_0x7d46('0x34'),'collate':_0x7d46('0x35')});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index 8456eae..0e8caaa 100644 --- a/server/api/whatsappMessage/whatsappMessage.rpc.js +++ b/server/api/whatsappMessage/whatsappMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9b27=['options','raw','util','moment','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','request','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateWhatsappMessage','WhatsappMessage','create','body'];(function(_0x19ae40,_0x3af8d2){var _0x1fa68e=function(_0x34bbb4){while(--_0x34bbb4){_0x19ae40['push'](_0x19ae40['shift']());}};_0x1fa68e(++_0x3af8d2);}(_0x9b27,0x1a2));var _0x79b2=function(_0x3c2d87,_0x623ad){_0x3c2d87=_0x3c2d87-0x0;var _0x142d3c=_0x9b27[_0x3c2d87];return _0x142d3c;};'use strict';var _=require('lodash');var util=require(_0x79b2('0x0'));var moment=require(_0x79b2('0x1'));var BPromise=require('bluebird');var rs=require(_0x79b2('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x79b2('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x79b2('0x4'))('rpc');var config=require(_0x79b2('0x5'));var jayson=require(_0x79b2('0x6'));var client=jayson[_0x79b2('0x7')]['http']({'port':0x232a});config[_0x79b2('0x8')]=_[_0x79b2('0x9')](config[_0x79b2('0x8')],{'host':_0x79b2('0xa'),'port':0x18eb});var socket=require(_0x79b2('0xb'))(new Redis(config[_0x79b2('0x8')]));require(_0x79b2('0xc'))[_0x79b2('0xd')](socket);function respondWithRpcPromise(_0x410aec,_0x11834d,_0x3d9d9c){return new BPromise(function(_0x20d741,_0x167879){return client[_0x79b2('0xe')](_0x410aec,_0x3d9d9c)['then'](function(_0x3da8bf){logger[_0x79b2('0xf')](_0x79b2('0x10'),_0x11834d,_0x79b2('0x11'));logger[_0x79b2('0x12')](_0x79b2('0x13'),_0x11834d,'request\x20sent',JSON[_0x79b2('0x14')](_0x3da8bf));if(_0x3da8bf['error']){if(_0x3da8bf[_0x79b2('0x15')][_0x79b2('0x16')]===0x1f4){logger[_0x79b2('0x15')](_0x79b2('0x10'),_0x11834d,_0x3da8bf[_0x79b2('0x15')][_0x79b2('0x17')]);return _0x167879(_0x3da8bf[_0x79b2('0x15')][_0x79b2('0x17')]);}logger[_0x79b2('0x15')](_0x79b2('0x10'),_0x11834d,_0x3da8bf[_0x79b2('0x15')][_0x79b2('0x17')]);return _0x20d741(_0x3da8bf['error'][_0x79b2('0x17')]);}else{logger[_0x79b2('0xf')](_0x79b2('0x10'),_0x11834d,_0x79b2('0x11'));_0x20d741(_0x3da8bf[_0x79b2('0x18')][_0x79b2('0x17')]);}})[_0x79b2('0x19')](function(_0x56b8e4){logger[_0x79b2('0x15')]('WhatsappMessage,\x20%s,\x20%s',_0x11834d,_0x56b8e4);_0x167879(_0x56b8e4);});});}exports[_0x79b2('0x1a')]=function(_0x3d8ef0){var _0x2eb50b=this;return new Promise(function(_0xeded67,_0x49050c){return db[_0x79b2('0x1b')][_0x79b2('0x1c')](_0x3d8ef0[_0x79b2('0x1d')],{'raw':_0x3d8ef0['options']?_0x3d8ef0[_0x79b2('0x1e')][_0x79b2('0x1f')]===undefined?!![]:![]:!![]})['then'](function(_0x28c9a4){logger[_0x79b2('0xf')](_0x79b2('0x1a'),_0x3d8ef0);logger['debug'](_0x79b2('0x1a'),_0x3d8ef0,JSON['stringify'](_0x28c9a4));_0xeded67(_0x28c9a4);})[_0x79b2('0x19')](function(_0x2f26e3){logger[_0x79b2('0x15')](_0x79b2('0x1a'),_0x2f26e3[_0x79b2('0x17')],_0x3d8ef0);_0x49050c(_0x2eb50b[_0x79b2('0x15')](0x1f4,_0x2f26e3['message']));});});}; \ No newline at end of file +var _0x06a5=['error','code','message','result','catch','CreateWhatsappMessage','WhatsappMessage','create','body','options','raw','info','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','then','WhatsappMessage,\x20%s,\x20%s','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x06a5,0xfa));var _0x506a=function(_0x36f688,_0x136a34){_0x36f688=_0x36f688-0x0;var _0x5483e4=_0x06a5[_0x36f688];return _0x5483e4;};'use strict';var _=require(_0x506a('0x0'));var util=require(_0x506a('0x1'));var moment=require(_0x506a('0x2'));var BPromise=require(_0x506a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x506a('0x4'))['db'];var utils=require(_0x506a('0x5'));var logger=require(_0x506a('0x6'))(_0x506a('0x7'));var config=require(_0x506a('0x8'));var jayson=require(_0x506a('0x9'));var client=jayson[_0x506a('0xa')]['http']({'port':0x232a});config[_0x506a('0xb')]=_[_0x506a('0xc')](config['redis'],{'host':_0x506a('0xd'),'port':0x18eb});var socket=require(_0x506a('0xe'))(new Redis(config[_0x506a('0xb')]));require('./whatsappMessage.socket')[_0x506a('0xf')](socket);function respondWithRpcPromise(_0x3e3bda,_0x22e7fe,_0x55a041){return new BPromise(function(_0x1c5d0d,_0x13777b){return client['request'](_0x3e3bda,_0x55a041)[_0x506a('0x10')](function(_0x460e4e){logger['info'](_0x506a('0x11'),_0x22e7fe,'request\x20sent');logger[_0x506a('0x12')](_0x506a('0x13'),_0x22e7fe,_0x506a('0x14'),JSON[_0x506a('0x15')](_0x460e4e));if(_0x460e4e[_0x506a('0x16')]){if(_0x460e4e[_0x506a('0x16')][_0x506a('0x17')]===0x1f4){logger['error'](_0x506a('0x11'),_0x22e7fe,_0x460e4e['error'][_0x506a('0x18')]);return _0x13777b(_0x460e4e['error'][_0x506a('0x18')]);}logger[_0x506a('0x16')](_0x506a('0x11'),_0x22e7fe,_0x460e4e[_0x506a('0x16')][_0x506a('0x18')]);return _0x1c5d0d(_0x460e4e[_0x506a('0x16')]['message']);}else{logger['info'](_0x506a('0x11'),_0x22e7fe,_0x506a('0x14'));_0x1c5d0d(_0x460e4e[_0x506a('0x19')][_0x506a('0x18')]);}})[_0x506a('0x1a')](function(_0x44f002){logger[_0x506a('0x16')](_0x506a('0x11'),_0x22e7fe,_0x44f002);_0x13777b(_0x44f002);});});}exports[_0x506a('0x1b')]=function(_0x18ea7d){var _0x4d498b=this;return new Promise(function(_0x307bb5,_0x4b91f3){return db[_0x506a('0x1c')][_0x506a('0x1d')](_0x18ea7d[_0x506a('0x1e')],{'raw':_0x18ea7d[_0x506a('0x1f')]?_0x18ea7d[_0x506a('0x1f')][_0x506a('0x20')]===undefined?!![]:![]:!![]})[_0x506a('0x10')](function(_0x341704){logger[_0x506a('0x21')](_0x506a('0x1b'),_0x18ea7d);logger[_0x506a('0x12')](_0x506a('0x1b'),_0x18ea7d,JSON['stringify'](_0x341704));_0x307bb5(_0x341704);})[_0x506a('0x1a')](function(_0x389e1c){logger[_0x506a('0x16')](_0x506a('0x1b'),_0x389e1c[_0x506a('0x18')],_0x18ea7d);_0x4b91f3(_0x4d498b[_0x506a('0x16')](0x1f4,_0x389e1c[_0x506a('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index e70621d..7d8dd22 100644 --- a/server/api/whatsappMessage/whatsappMessage.socket.js +++ b/server/api/whatsappMessage/whatsappMessage.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x361a=['update','emit','removeListener','register','length','./whatsappMessage.events','remove'];(function(_0xce03f2,_0x305b52){var _0x4437ca=function(_0x89181e){while(--_0x89181e){_0xce03f2['push'](_0xce03f2['shift']());}};_0x4437ca(++_0x305b52);}(_0x361a,0x1e1));var _0xa361=function(_0x412257,_0x4ac9c7){_0x412257=_0x412257-0x0;var _0x444718=_0x361a[_0x412257];return _0x444718;};'use strict';var WhatsappMessageEvents=require(_0xa361('0x0'));var events=['save',_0xa361('0x1'),_0xa361('0x2')];function createListener(_0x286ee6,_0x4d5e35){return function(_0x21515f){_0x4d5e35[_0xa361('0x3')](_0x286ee6,_0x21515f);};}function removeListener(_0x1f5b5a,_0x3bb898){return function(){WhatsappMessageEvents[_0xa361('0x4')](_0x1f5b5a,_0x3bb898);};}exports[_0xa361('0x5')]=function(_0x31bda5){for(var _0x28bd46=0x0,_0x42ab7a=events[_0xa361('0x6')];_0x28bd46<_0x42ab7a;_0x28bd46++){var _0x566f63=events[_0x28bd46];var _0x40e272=createListener('whatsappMessage:'+_0x566f63,_0x31bda5);WhatsappMessageEvents['on'](_0x566f63,_0x40e272);}}; \ No newline at end of file +var _0x8342=['save','emit','removeListener','register','length','whatsappMessage:','./whatsappMessage.events'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x8342,0x1e2));var _0x2834=function(_0x2e14f2,_0x377d0d){_0x2e14f2=_0x2e14f2-0x0;var _0x12cc03=_0x8342[_0x2e14f2];return _0x12cc03;};'use strict';var WhatsappMessageEvents=require(_0x2834('0x0'));var events=[_0x2834('0x1'),'remove','update'];function createListener(_0x36af0c,_0x266bee){return function(_0x1d20e1){_0x266bee[_0x2834('0x2')](_0x36af0c,_0x1d20e1);};}function removeListener(_0x2bccdf,_0x435013){return function(){WhatsappMessageEvents[_0x2834('0x3')](_0x2bccdf,_0x435013);};}exports[_0x2834('0x4')]=function(_0x7ac971){for(var _0x24ea1f=0x0,_0x3a7e07=events[_0x2834('0x5')];_0x24ea1f<_0x3a7e07;_0x24ea1f++){var _0x46ba75=events[_0x24ea1f];var _0x153e4c=createListener(_0x2834('0x6')+_0x46ba75,_0x7ac971);WhatsappMessageEvents['on'](_0x46ba75,_0x153e4c);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index dc4228a..b664d74 100644 --- a/server/api/whatsappQueue/index.js +++ b/server/api/whatsappQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6fb7=['put','update','delete','destroy','removeTeams','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','create','post','addTeams'];(function(_0x5b7788,_0x309ae5){var _0x573871=function(_0x5c79fd){while(--_0x5c79fd){_0x5b7788['push'](_0x5b7788['shift']());}};_0x573871(++_0x309ae5);}(_0x6fb7,0x13c));var _0x76fb=function(_0x220a02,_0x779949){_0x220a02=_0x220a02-0x0;var _0x540d3f=_0x6fb7[_0x220a02];return _0x540d3f;};'use strict';var multer=require(_0x76fb('0x0'));var util=require('util');var path=require(_0x76fb('0x1'));var timeout=require(_0x76fb('0x2'));var express=require(_0x76fb('0x3'));var router=express[_0x76fb('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x76fb('0x5'));var interaction=require(_0x76fb('0x6'));var config=require(_0x76fb('0x7'));var controller=require(_0x76fb('0x8'));router[_0x76fb('0x9')]('/',auth[_0x76fb('0xa')](),controller[_0x76fb('0xb')]);router['get'](_0x76fb('0xc'),auth[_0x76fb('0xa')](),controller[_0x76fb('0xd')]);router['get'](_0x76fb('0xe'),auth[_0x76fb('0xa')](),controller[_0x76fb('0xf')]);router['get'](_0x76fb('0x10'),auth[_0x76fb('0xa')](),controller[_0x76fb('0x11')]);router[_0x76fb('0x9')](_0x76fb('0x12'),auth['isAuthenticated'](),controller[_0x76fb('0x13')]);router['get'](_0x76fb('0x14'),auth['isAuthenticated'](),controller[_0x76fb('0x15')]);router['post']('/',auth[_0x76fb('0xa')](),controller[_0x76fb('0x16')]);router[_0x76fb('0x17')](_0x76fb('0x12'),auth['isAuthenticated'](),controller[_0x76fb('0x18')]);router[_0x76fb('0x17')](_0x76fb('0x14'),auth[_0x76fb('0xa')](),controller['addAgents']);router[_0x76fb('0x19')]('/:id',auth[_0x76fb('0xa')](),controller[_0x76fb('0x1a')]);router[_0x76fb('0x1b')]('/:id',auth[_0x76fb('0xa')](),controller[_0x76fb('0x1c')]);router['delete']('/:id/teams',auth[_0x76fb('0xa')](),controller[_0x76fb('0x1d')]);router[_0x76fb('0x1b')](_0x76fb('0x14'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x76fb('0x1e')]=router; \ No newline at end of file +var _0x8b4c=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','get','isAuthenticated','index','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','create','addAgents','put','update','delete','destroy','removeTeams','multer','util','path','connect-timeout','express'];(function(_0x2a3c4d,_0x9c6b37){var _0x55c390=function(_0x4871cf){while(--_0x4871cf){_0x2a3c4d['push'](_0x2a3c4d['shift']());}};_0x55c390(++_0x9c6b37);}(_0x8b4c,0x87));var _0xc8b4=function(_0x1b3c43,_0x2fcc2c){_0x1b3c43=_0x1b3c43-0x0;var _0x31cf0b=_0x8b4c[_0x1b3c43];return _0x31cf0b;};'use strict';var multer=require(_0xc8b4('0x0'));var util=require(_0xc8b4('0x1'));var path=require(_0xc8b4('0x2'));var timeout=require(_0xc8b4('0x3'));var express=require(_0xc8b4('0x4'));var router=express[_0xc8b4('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc8b4('0x6'));var interaction=require(_0xc8b4('0x7'));var config=require(_0xc8b4('0x8'));var controller=require(_0xc8b4('0x9'));router[_0xc8b4('0xa')]('/',auth[_0xc8b4('0xb')](),controller[_0xc8b4('0xc')]);router[_0xc8b4('0xa')]('/describe',auth[_0xc8b4('0xb')](),controller['describe']);router['get'](_0xc8b4('0xd'),auth[_0xc8b4('0xb')](),controller[_0xc8b4('0xe')]);router[_0xc8b4('0xa')](_0xc8b4('0xf'),auth['isAuthenticated'](),controller[_0xc8b4('0x10')]);router[_0xc8b4('0xa')](_0xc8b4('0x11'),auth['isAuthenticated'](),controller[_0xc8b4('0x12')]);router[_0xc8b4('0xa')](_0xc8b4('0x13'),auth[_0xc8b4('0xb')](),controller['getAgents']);router[_0xc8b4('0x14')]('/',auth['isAuthenticated'](),controller[_0xc8b4('0x15')]);router['post'](_0xc8b4('0x11'),auth['isAuthenticated'](),controller['addTeams']);router['post'](_0xc8b4('0x13'),auth[_0xc8b4('0xb')](),controller[_0xc8b4('0x16')]);router[_0xc8b4('0x17')](_0xc8b4('0xd'),auth['isAuthenticated'](),controller[_0xc8b4('0x18')]);router[_0xc8b4('0x19')](_0xc8b4('0xd'),auth[_0xc8b4('0xb')](),controller[_0xc8b4('0x1a')]);router[_0xc8b4('0x19')](_0xc8b4('0x11'),auth['isAuthenticated'](),controller[_0xc8b4('0x1b')]);router[_0xc8b4('0x19')]('/:id/users',auth[_0xc8b4('0xb')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index ad49569..0a4fca5 100644 --- a/server/api/whatsappQueue/whatsappQueue.attributes.js +++ b/server/api/whatsappQueue/whatsappQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0bb5=['sequelize','exports','INTEGER','ENUM','rrmemory','beepall','roundrobin','STRING'];(function(_0x44bcb0,_0x235aa9){var _0xfaf881=function(_0x25d81d){while(--_0x25d81d){_0x44bcb0['push'](_0x44bcb0['shift']());}};_0xfaf881(++_0x235aa9);}(_0x0bb5,0x148));var _0x50bb=function(_0x29e462,_0x4d99df){_0x29e462=_0x29e462-0x0;var _0x2d4571=_0x0bb5[_0x29e462];return _0x2d4571;};'use strict';var Sequelize=require(_0x50bb('0x0'));module[_0x50bb('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x50bb('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x50bb('0x3')](_0x50bb('0x4'),_0x50bb('0x5'),_0x50bb('0x6'))},'description':{'type':Sequelize[_0x50bb('0x7')]}}; \ No newline at end of file +var _0x25b5=['sequelize','exports','STRING','name','INTEGER','rrmemory','beepall','roundrobin'];(function(_0x3187b0,_0x4cee2a){var _0x12c691=function(_0x25f27c){while(--_0x25f27c){_0x3187b0['push'](_0x3187b0['shift']());}};_0x12c691(++_0x4cee2a);}(_0x25b5,0x198));var _0x525b=function(_0x426018,_0x5001bc){_0x426018=_0x426018-0x0;var _0x589e07=_0x25b5[_0x426018];return _0x589e07;};'use strict';var Sequelize=require(_0x525b('0x0'));module[_0x525b('0x1')]={'name':{'type':Sequelize[_0x525b('0x2')],'unique':_0x525b('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x525b('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x525b('0x5'),_0x525b('0x6'),_0x525b('0x7'))},'description':{'type':Sequelize[_0x525b('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index a9798b6..54bcc2e 100644 --- a/server/api/whatsappQueue/whatsappQueue.controller.js +++ b/server/api/whatsappQueue/whatsappQueue.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x61d4=['get','destroy','sendStatus','error','stack','name','status','send','map','WhatsappQueue','rawAttributes','type','getOptions','where','count','include','query','findAll','rows','catch','show','params','model','keys','filters','intersection','attributes','fields','length','includeAll','merge','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','WhatsappQueues','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserWhatsappQueue','hasOwnProperty','nolimit','order','sort','pick','WhatsappQueueId','filter','findAndCountAll','UserId','agent','whatsappPause','updatedAt','createdAt','format','SIP','getTeams','Team','addTeams','ids','User','Agents','flatMap','sequelize','each','findOrCreate','forEach','emit','userWhatsappQueue:save','select','tq.TeamId','from','team_has_whatsapp_queues','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','TeamId','includes','all','union','value','removeTeams','isEmpty','userWhatsappQueue:remove','addAgents','omit','spread','removeAgents','getAgents','bluebird','util','squel','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','end','json','offset','undefined','limit','Content-Range','update','then'];(function(_0x458ed6,_0x504646){var _0xa5dfd9=function(_0x504e7b){while(--_0x504e7b){_0x458ed6['push'](_0x458ed6['shift']());}};_0xa5dfd9(++_0x504646);}(_0x61d4,0x1c4));var _0x461d=function(_0x486f1d,_0x90c2b5){_0x486f1d=_0x486f1d-0x0;var _0x5a2c2d=_0x61d4[_0x486f1d];return _0x5a2c2d;};'use strict';var BPromise=require(_0x461d('0x0'));var util=require(_0x461d('0x1'));var _=require('lodash');var squel=require(_0x461d('0x2'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0x461d('0x3'))('api');var config=require(_0x461d('0x4'));var db=require(_0x461d('0x5'))['db'];config[_0x461d('0x6')]=_[_0x461d('0x7')](config[_0x461d('0x6')],{'host':_0x461d('0x8'),'port':0x18eb});var socket=require(_0x461d('0x9'))(new Redis(config[_0x461d('0x6')]));require(_0x461d('0xa'))[_0x461d('0xb')](socket);function respondWithStatusCode(_0x2a2bcd,_0x5dc9d6){_0x5dc9d6=_0x5dc9d6||0xcc;return function(_0x5a33b7){if(_0x5a33b7){return _0x2a2bcd['sendStatus'](_0x5dc9d6);}return _0x2a2bcd['status'](_0x5dc9d6)[_0x461d('0xc')]();};}function respondWithResult(_0x29bfbf,_0x489647){_0x489647=_0x489647||0xc8;return function(_0x19b7b9){if(_0x19b7b9){return _0x29bfbf['status'](_0x489647)[_0x461d('0xd')](_0x19b7b9);}};}function respondWithFilteredResult(_0x49af27,_0x5cc98b){return function(_0x30f832){if(_0x30f832){var _0x4eee58=typeof _0x5cc98b[_0x461d('0xe')]===_0x461d('0xf')&&typeof _0x5cc98b[_0x461d('0x10')]===_0x461d('0xf');var _0x5c694d=_0x30f832['count'];var _0x4be16b=_0x4eee58?0x0:_0x5cc98b[_0x461d('0xe')];var _0x5afaeb=_0x4eee58?_0x30f832['count']:_0x5cc98b[_0x461d('0xe')]+_0x5cc98b[_0x461d('0x10')];var _0x3736a2;if(_0x5afaeb>=_0x5c694d){_0x5afaeb=_0x5c694d;_0x3736a2=0xc8;}else{_0x3736a2=0xce;}_0x49af27['status'](_0x3736a2);return _0x49af27['set'](_0x461d('0x11'),_0x4be16b+'-'+_0x5afaeb+'/'+_0x5c694d)['json'](_0x30f832);}return null;};}function saveUpdates(_0x179d42){return function(_0x434855){if(_0x434855){return _0x434855[_0x461d('0x12')](_0x179d42)[_0x461d('0x13')](function(_0x27b70a){return _0x27b70a;});}return null;};}function removeEntity(_0x4ab9e6){return function(_0x4d42cc){if(_0x4d42cc){return _0x4d42cc['destroy']()[_0x461d('0x13')](function(){var _0x1143a8=_0x4d42cc[_0x461d('0x14')]({'plain':!![]});var _0x54a398='WhatsappQueues';return db['UserProfileResource'][_0x461d('0x15')]({'where':{'type':_0x54a398,'resourceId':_0x1143a8['id']}})[_0x461d('0x13')](function(){return _0x4d42cc;});})[_0x461d('0x13')](function(){_0x4ab9e6['status'](0xcc)[_0x461d('0xc')]();});}};}function handleEntityNotFound(_0x49903b){return function(_0x148389){if(!_0x148389){_0x49903b[_0x461d('0x16')](0x194);}return _0x148389;};}function handleError(_0x3fb4d0,_0x1f9e73){_0x1f9e73=_0x1f9e73||0x1f4;return function(_0x5a6b9d){logger[_0x461d('0x17')](_0x5a6b9d[_0x461d('0x18')]);if(_0x5a6b9d[_0x461d('0x19')]){delete _0x5a6b9d[_0x461d('0x19')];}_0x3fb4d0[_0x461d('0x1a')](_0x1f9e73)[_0x461d('0x1b')](_0x5a6b9d);};}exports['index']=function(_0x2705e3,_0x6579dc){var _0x1ebf7a={};var _0x42316a={'count':0x0,'rows':[]};var _0x4f54ac=_[_0x461d('0x1c')](db[_0x461d('0x1d')][_0x461d('0x1e')],function(_0x4cec70){return{'name':_0x4cec70['fieldName'],'type':_0x4cec70[_0x461d('0x1f')]['key']};});_0x1ebf7a=qs[_0x461d('0x20')](_0x4f54ac,_0x2705e3);var _0x4313cb={'where':_0x1ebf7a[_0x461d('0x21')]};return db[_0x461d('0x1d')][_0x461d('0x22')](_0x4313cb)[_0x461d('0x13')](function(_0x2c93ca){_0x42316a['count']=_0x2c93ca;_0x1ebf7a[_0x461d('0x23')]=qs['include'](_0x2705e3[_0x461d('0x24')]);return db['WhatsappQueue'][_0x461d('0x25')](_0x1ebf7a);})[_0x461d('0x13')](function(_0x548d2d){_0x42316a[_0x461d('0x26')]=_0x548d2d;return _0x42316a;})['then'](respondWithFilteredResult(_0x6579dc,_0x1ebf7a))[_0x461d('0x27')](handleError(_0x6579dc,null));};exports[_0x461d('0x28')]=function(_0x185837,_0x1c3c28){var _0x76a133={'raw':!![],'where':{'id':_0x185837[_0x461d('0x29')]['id']}},_0x3b56dd={};_0x3b56dd[_0x461d('0x2a')]=_[_0x461d('0x2b')](db['WhatsappQueue']['rawAttributes']);_0x3b56dd[_0x461d('0x24')]=_[_0x461d('0x2b')](_0x185837[_0x461d('0x24')]);_0x3b56dd[_0x461d('0x2c')]=_[_0x461d('0x2d')](_0x3b56dd[_0x461d('0x2a')],_0x3b56dd[_0x461d('0x24')]);_0x76a133[_0x461d('0x2e')]=_[_0x461d('0x2d')](_0x3b56dd[_0x461d('0x2a')],qs['fields'](_0x185837[_0x461d('0x24')][_0x461d('0x2f')]));_0x76a133['attributes']=_0x76a133[_0x461d('0x2e')][_0x461d('0x30')]?_0x76a133[_0x461d('0x2e')]:_0x3b56dd[_0x461d('0x2a')];if(_0x185837['query'][_0x461d('0x31')]){_0x76a133[_0x461d('0x23')]=[{'all':!![]}];}_0x76a133=_[_0x461d('0x32')]({},_0x76a133,_0x185837[_0x461d('0x33')]);return db[_0x461d('0x1d')][_0x461d('0x34')](_0x76a133)[_0x461d('0x13')](handleEntityNotFound(_0x1c3c28,null))[_0x461d('0x13')](respondWithResult(_0x1c3c28,null))['catch'](handleError(_0x1c3c28,null));};exports[_0x461d('0x35')]=function(_0x1f495b,_0x59102b){return db[_0x461d('0x1d')][_0x461d('0x35')](_0x1f495b[_0x461d('0x36')],{})[_0x461d('0x13')](function(_0x544861){var _0x1a0eb2=_0x1f495b[_0x461d('0x37')][_0x461d('0x14')]({'plain':!![]});if(!_0x1a0eb2)throw new Error(_0x461d('0x38'));if(_0x1a0eb2[_0x461d('0x39')]==='user'){var _0x41b604=_0x544861[_0x461d('0x14')]({'plain':!![]});var _0x3ca90e=_0x461d('0x3a');return db['UserProfileSection'][_0x461d('0x34')]({'where':{'name':_0x3ca90e,'userProfileId':_0x1a0eb2[_0x461d('0x3b')]},'raw':!![]})['then'](function(_0xab0232){if(_0xab0232&&_0xab0232[_0x461d('0x3c')]===0x0){return db[_0x461d('0x3d')][_0x461d('0x35')]({'name':_0x41b604[_0x461d('0x19')],'resourceId':_0x41b604['id'],'type':_0xab0232[_0x461d('0x19')],'sectionId':_0xab0232['id']},{})[_0x461d('0x13')](function(){return _0x544861;});}else{return _0x544861;}})[_0x461d('0x27')](function(_0x2972ae){logger[_0x461d('0x17')](_0x461d('0x3e'),_0x2972ae);throw _0x2972ae;});}return _0x544861;})[_0x461d('0x13')](respondWithResult(_0x59102b,0xc9))[_0x461d('0x27')](handleError(_0x59102b,null));};exports[_0x461d('0x12')]=function(_0x2f97c0,_0xf5bf3d){if(_0x2f97c0[_0x461d('0x36')]['id']){delete _0x2f97c0['body']['id'];}return db[_0x461d('0x1d')][_0x461d('0x34')]({'where':{'id':_0x2f97c0[_0x461d('0x29')]['id']}})[_0x461d('0x13')](handleEntityNotFound(_0xf5bf3d,null))[_0x461d('0x13')](saveUpdates(_0x2f97c0[_0x461d('0x36')],null))[_0x461d('0x13')](respondWithResult(_0xf5bf3d,null))[_0x461d('0x27')](handleError(_0xf5bf3d,null));};exports[_0x461d('0x15')]=function(_0x588282,_0x5e8b9a){return db['WhatsappQueue'][_0x461d('0x34')]({'where':{'id':_0x588282['params']['id']}})[_0x461d('0x13')](handleEntityNotFound(_0x5e8b9a,null))[_0x461d('0x13')](removeEntity(_0x5e8b9a,null))[_0x461d('0x27')](handleError(_0x5e8b9a,null));};exports[_0x461d('0x3f')]=function(_0x36fb0f,_0xd8923c){return db[_0x461d('0x1d')][_0x461d('0x3f')]()[_0x461d('0x13')](respondWithResult(_0xd8923c,null))[_0x461d('0x27')](handleError(_0xd8923c,null));};exports[_0x461d('0x40')]=function(_0x1c4121,_0x55f64d){var _0x54532c={'raw':!![],'where':{}},_0x122cd9={},_0x251dfe;return db['WhatsappQueue'][_0x461d('0x41')]({'where':{'id':_0x1c4121[_0x461d('0x29')]['id']}})['then'](handleEntityNotFound(_0x55f64d,null))[_0x461d('0x13')](function(_0x380477){if(_0x380477){_0x251dfe=_0x380477[_0x461d('0x14')]({'plain':!![]});_0x122cd9[_0x461d('0x2a')]=_[_0x461d('0x2b')](db[_0x461d('0x42')]['rawAttributes']);_0x122cd9['query']=_[_0x461d('0x2b')](_0x1c4121['query']);_0x122cd9[_0x461d('0x2c')]=_[_0x461d('0x2d')](_0x122cd9['model'],_0x122cd9[_0x461d('0x24')]);_0x54532c[_0x461d('0x2e')]=_[_0x461d('0x2d')](_0x122cd9[_0x461d('0x2a')],qs[_0x461d('0x2f')](_0x1c4121[_0x461d('0x24')][_0x461d('0x2f')]));_0x54532c[_0x461d('0x2e')]=_0x54532c[_0x461d('0x2e')][_0x461d('0x30')]?_0x54532c[_0x461d('0x2e')]:_0x122cd9['model'];if(!_0x1c4121[_0x461d('0x24')][_0x461d('0x43')](_0x461d('0x44'))){_0x54532c[_0x461d('0x10')]=qs[_0x461d('0x10')](_0x1c4121['query'][_0x461d('0x10')]);_0x54532c[_0x461d('0xe')]=qs[_0x461d('0xe')](_0x1c4121[_0x461d('0x24')][_0x461d('0xe')]);}_0x54532c[_0x461d('0x45')]=qs[_0x461d('0x46')](_0x1c4121[_0x461d('0x24')][_0x461d('0x46')]);_0x54532c[_0x461d('0x21')]=qs[_0x461d('0x2c')](_[_0x461d('0x47')](_0x1c4121[_0x461d('0x24')],_0x122cd9['filters']));_0x54532c[_0x461d('0x21')][_0x461d('0x48')]=_0x380477['id'];if(_0x1c4121[_0x461d('0x24')][_0x461d('0x49')]){_0x54532c[_0x461d('0x21')]=_[_0x461d('0x32')](_0x54532c[_0x461d('0x21')],{'$or':_[_0x461d('0x1c')](_0x54532c['attributes'],function(_0x3326c3){var _0x4c5000={};_0x4c5000[_0x3326c3]={'$like':'%'+_0x1c4121[_0x461d('0x24')][_0x461d('0x49')]+'%'};return _0x4c5000;})});}_0x54532c=_[_0x461d('0x32')]({},_0x54532c,_0x1c4121['options']);return db[_0x461d('0x42')][_0x461d('0x25')](_0x54532c);}})[_0x461d('0x13')](function(_0x1ab2da){if(_0x1ab2da){return db['User'][_0x461d('0x4a')]({'where':{'id':_['map'](_0x1ab2da,_0x461d('0x4b')),'role':_0x461d('0x4c')},'attributes':['id',_0x461d('0x19'),_0x461d('0x4d'),_0x461d('0x4e'),_0x461d('0x4f')]});}})['then'](function(_0x5b7e83){if(_0x5b7e83){return{'count':_0x5b7e83['count'],'rows':_['map'](_0x5b7e83[_0x461d('0x26')],function(_0x10d3cc){return{'membername':_0x10d3cc[_0x461d('0x19')],'UserId':_0x10d3cc['id'],'queue_name':_0x251dfe[_0x461d('0x19')],'WhatsappQueueId':_0x251dfe['id'],'interface':util[_0x461d('0x50')]('%s/%s',_0x461d('0x51'),_0x10d3cc[_0x461d('0x19')]),'penalty':0x0,'paused':_0x10d3cc['whatsappPause'],'createdAt':_0x10d3cc[_0x461d('0x4f')],'updatedAt':_0x10d3cc[_0x461d('0x4e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x461d('0x13')](respondWithFilteredResult(_0x55f64d,_0x54532c))[_0x461d('0x27')](handleError(_0x55f64d,null));};exports[_0x461d('0x52')]=function(_0x49583b,_0x4e8c78){var _0xd26aba={};var _0x33f414={};var _0x4109a5;var _0x5a3684;return db[_0x461d('0x1d')][_0x461d('0x41')]({'where':{'id':_0x49583b[_0x461d('0x29')]['id']}})[_0x461d('0x13')](handleEntityNotFound(_0x4e8c78,null))['then'](function(_0x342ef1){if(_0x342ef1){_0x4109a5=_0x342ef1;_0x33f414['model']=_['keys'](db[_0x461d('0x53')]['rawAttributes']);_0x33f414[_0x461d('0x24')]=_[_0x461d('0x2b')](_0x49583b['query']);_0x33f414[_0x461d('0x2c')]=_[_0x461d('0x2d')](_0x33f414[_0x461d('0x2a')],_0x33f414[_0x461d('0x24')]);_0xd26aba[_0x461d('0x2e')]=_[_0x461d('0x2d')](_0x33f414[_0x461d('0x2a')],qs[_0x461d('0x2f')](_0x49583b['query'][_0x461d('0x2f')]));_0xd26aba[_0x461d('0x2e')]=_0xd26aba[_0x461d('0x2e')]['length']?_0xd26aba[_0x461d('0x2e')]:_0x33f414[_0x461d('0x2a')];_0xd26aba[_0x461d('0x45')]=qs[_0x461d('0x46')](_0x49583b['query'][_0x461d('0x46')]);_0xd26aba['where']=qs[_0x461d('0x2c')](_['pick'](_0x49583b['query'],_0x33f414['filters']));if(_0x49583b[_0x461d('0x24')]['filter']){_0xd26aba[_0x461d('0x21')]=_['merge'](_0xd26aba[_0x461d('0x21')],{'$or':_[_0x461d('0x1c')](_0xd26aba[_0x461d('0x2e')],function(_0x1bb2d6){var _0x1487c1={};_0x1487c1[_0x1bb2d6]={'$like':'%'+_0x49583b[_0x461d('0x24')]['filter']+'%'};return _0x1487c1;})});}_0xd26aba=_[_0x461d('0x32')]({},_0xd26aba,_0x49583b[_0x461d('0x33')]);return _0x4109a5['getTeams'](_0xd26aba);}})[_0x461d('0x13')](function(_0x551760){if(_0x551760){_0x5a3684=_0x551760['length'];if(!_0x49583b[_0x461d('0x24')]['hasOwnProperty'](_0x461d('0x44'))){_0xd26aba['limit']=qs[_0x461d('0x10')](_0x49583b[_0x461d('0x24')]['limit']);_0xd26aba[_0x461d('0xe')]=qs[_0x461d('0xe')](_0x49583b[_0x461d('0x24')][_0x461d('0xe')]);}return _0x4109a5[_0x461d('0x52')](_0xd26aba);}})[_0x461d('0x13')](function(_0x385075){if(_0x385075){return _0x385075?{'count':_0x5a3684,'rows':_0x385075}:null;}})['then'](respondWithResult(_0x4e8c78,null))[_0x461d('0x27')](handleError(_0x4e8c78,null));};exports[_0x461d('0x54')]=function(_0x3e9a0e,_0x1d4cc9){var _0x4f0ad2=_0x3e9a0e[_0x461d('0x36')][_0x461d('0x55')];return db[_0x461d('0x53')][_0x461d('0x25')]({'where':{'id':_0x4f0ad2},'attributes':['id'],'include':[{'model':db[_0x461d('0x56')],'as':_0x461d('0x57'),'attributes':['id',_0x461d('0x19'),'online','voicePause','interface'],'raw':!![]}]})[_0x461d('0x13')](function(_0x33021c){if(_0x33021c){var _0x323d9b=_[_0x461d('0x58')](_0x33021c,function(_0x32d48e){var _0x5d3ab0=_0x32d48e[_0x461d('0x14')]({'plain':!![]});return _0x5d3ab0['Agents'];});return db[_0x461d('0x1d')][_0x461d('0x34')]({'where':{'id':_0x3e9a0e[_0x461d('0x29')]['id']}})[_0x461d('0x13')](function(_0x31c4f9){return db[_0x461d('0x59')]['transaction'](function(_0x4f0873){return _0x31c4f9[_0x461d('0x54')](_0x4f0ad2,{'transaction':_0x4f0873})['then'](function(){return BPromise[_0x461d('0x5a')](_0x323d9b,function(_0x4ffcf3){return db['UserWhatsappQueue'][_0x461d('0x5b')]({'where':{'UserId':_0x4ffcf3['id'],'WhatsappQueueId':_0x3e9a0e[_0x461d('0x29')]['id']},'transaction':_0x4f0873});});})[_0x461d('0x13')](function(){_0x323d9b[_0x461d('0x5c')](function(_0x16b4d8){socket[_0x461d('0x5d')](_0x461d('0x5e'),{'UserId':_0x16b4d8['id'],'WhatsappQueueId':_0x31c4f9['id']});});});});});}})[_0x461d('0x13')](respondWithStatusCode(_0x1d4cc9,null))['catch'](handleError(_0x1d4cc9,null));};exports['removeTeams']=function(_0x2aa364,_0x567e7a){return db['Team'][_0x461d('0x25')]({'where':{'id':_0x2aa364[_0x461d('0x24')][_0x461d('0x55')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x567e7a,null))[_0x461d('0x13')](function(_0x38e3ef){var _0x25d4a0=_[_0x461d('0x1c')](_0x38e3ef,'id');var _0x1c006f=[];var _0x401ced=[];var _0x367cda=squel[_0x461d('0x5f')]();_0x367cda['field'](_0x461d('0x60'))[_0x461d('0x61')](_0x461d('0x62'),'tq')['join']('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x461d('0x21')](_0x461d('0x63'),_0x2aa364['params']['id']);for(var _0x5d87fb=0x0;_0x5d87fb<_0x38e3ef[_0x461d('0x30')];_0x5d87fb+=0x1){let _0x54491e=_0x38e3ef[_0x5d87fb];for(var _0x26bf3d=0x0;_0x26bf3d<_0x54491e[_0x461d('0x57')][_0x461d('0x30')];_0x26bf3d+=0x1){let _0x125fbd=_0x54491e[_0x461d('0x57')][_0x26bf3d];var _0x3d0c54=_0x367cda[_0x461d('0x64')]();_0x3d0c54[_0x461d('0x21')](_0x461d('0x65'),_0x125fbd['id']);_0x401ced[_0x461d('0x66')](db[_0x461d('0x59')][_0x461d('0x24')](_0x3d0c54[_0x461d('0x67')](),{'type':db['sequelize'][_0x461d('0x68')]['SELECT']})['then'](function(_0x4f2c4b){if(_0x4f2c4b[_0x461d('0x30')]===0x1){return _0x125fbd['id'];}else{var _0xba9f9e=_['every'](_[_0x461d('0x1c')](_0x4f2c4b,_0x461d('0x69')),function(_0x34d431){return _[_0x461d('0x6a')](_0x25d4a0,_0x34d431);});if(_0xba9f9e){return _0x125fbd['id'];}}}));}}return BPromise[_0x461d('0x6b')](_0x401ced)[_0x461d('0x13')](function(_0x2b573e){_0x1c006f=_(_0x1c006f)[_0x461d('0x6c')](_0x2b573e)['compact']()[_0x461d('0x6d')]();return db[_0x461d('0x1d')][_0x461d('0x34')]({'where':{'id':_0x2aa364['params']['id']}})[_0x461d('0x13')](function(_0x1c2b21){return db[_0x461d('0x59')]['transaction'](function(_0x175cde){return _0x1c2b21[_0x461d('0x6e')](_0x2aa364[_0x461d('0x24')][_0x461d('0x55')],{'transaction':_0x175cde})[_0x461d('0x13')](function(){if(!_[_0x461d('0x6f')](_0x1c006f)){return _0x1c2b21['removeAgents'](_0x1c006f,{'transaction':_0x175cde});}})['then'](function(){_0x1c006f[_0x461d('0x5c')](function(_0x5ea754){socket[_0x461d('0x5d')](_0x461d('0x70'),{'UserId':_0x5ea754,'WhatsappQueueId':_0x1c2b21['id']});});});});});});})[_0x461d('0x13')](respondWithStatusCode(_0x567e7a,null))['catch'](handleError(_0x567e7a,null));};exports[_0x461d('0x71')]=function(_0x5f3041,_0x568947){return db['WhatsappQueue'][_0x461d('0x34')]({'where':{'id':_0x5f3041[_0x461d('0x29')]['id']}})['then'](handleEntityNotFound(_0x568947,null))[_0x461d('0x13')](function(_0x46e707){if(_0x46e707){return _0x46e707[_0x461d('0x71')](_0x5f3041[_0x461d('0x36')][_0x461d('0x55')],_[_0x461d('0x72')](_0x5f3041[_0x461d('0x36')],[_0x461d('0x55'),'id'])||{})[_0x461d('0x73')](function(_0x320198){for(var _0x373126=0x0;_0x373126<_0x5f3041['body'][_0x461d('0x55')]['length'];_0x373126+=0x1){socket[_0x461d('0x5d')](_0x461d('0x5e'),{'UserId':Number(_0x5f3041['body']['ids'][_0x373126]),'WhatsappQueueId':Number(_0x5f3041['params']['id'])});}return _0x320198;});}})['then'](respondWithResult(_0x568947,null))[_0x461d('0x27')](handleError(_0x568947,null));};exports[_0x461d('0x74')]=function(_0x57d222,_0x29d891){return db[_0x461d('0x1d')][_0x461d('0x34')]({'where':{'id':_0x57d222[_0x461d('0x29')]['id']}})[_0x461d('0x13')](handleEntityNotFound(_0x29d891,null))[_0x461d('0x13')](function(_0x197151){if(_0x197151){return _0x197151[_0x461d('0x74')](_0x57d222[_0x461d('0x24')]['ids'])['then'](function(){if(_['isArray'](_0x57d222[_0x461d('0x24')][_0x461d('0x55')])){for(var _0x507d20=0x0;_0x507d20<_0x57d222[_0x461d('0x24')][_0x461d('0x55')][_0x461d('0x30')];_0x507d20+=0x1){socket[_0x461d('0x5d')](_0x461d('0x70'),{'UserId':Number(_0x57d222[_0x461d('0x24')][_0x461d('0x55')][_0x507d20]),'WhatsappQueueId':Number(_0x57d222[_0x461d('0x29')]['id'])});}}else{socket[_0x461d('0x5d')](_0x461d('0x70'),{'UserId':Number(_0x57d222[_0x461d('0x24')][_0x461d('0x55')]),'WhatsappQueueId':Number(_0x57d222['params']['id'])});}});}})[_0x461d('0x13')](respondWithStatusCode(_0x29d891,null))[_0x461d('0x27')](handleError(_0x29d891,null));};exports[_0x461d('0x75')]=function(_0xd65ef7,_0x392683){var _0x3825fb={};var _0xa352a7={};var _0x25ec67;var _0x82a9e6;return db[_0x461d('0x1d')]['findOne']({'where':{'id':_0xd65ef7['params']['id']}})['then'](handleEntityNotFound(_0x392683,null))[_0x461d('0x13')](function(_0x24c87f){if(_0x24c87f){_0x25ec67=_0x24c87f;_0xa352a7[_0x461d('0x2a')]=_['keys'](db[_0x461d('0x56')]['rawAttributes']);_0xa352a7[_0x461d('0x24')]=_['keys'](_0xd65ef7[_0x461d('0x24')]);_0xa352a7[_0x461d('0x2c')]=_['intersection'](_0xa352a7[_0x461d('0x2a')],_0xa352a7['query']);_0x3825fb['attributes']=_[_0x461d('0x2d')](_0xa352a7[_0x461d('0x2a')],qs[_0x461d('0x2f')](_0xd65ef7[_0x461d('0x24')][_0x461d('0x2f')]));_0x3825fb[_0x461d('0x2e')]=_0x3825fb[_0x461d('0x2e')][_0x461d('0x30')]?_0x3825fb['attributes']:_0xa352a7['model'];_0x3825fb[_0x461d('0x45')]=qs[_0x461d('0x46')](_0xd65ef7[_0x461d('0x24')][_0x461d('0x46')]);_0x3825fb[_0x461d('0x21')]=qs['filters'](_[_0x461d('0x47')](_0xd65ef7[_0x461d('0x24')],_0xa352a7[_0x461d('0x2c')]));if(_0xd65ef7[_0x461d('0x24')][_0x461d('0x49')]){_0x3825fb[_0x461d('0x21')]=_[_0x461d('0x32')](_0x3825fb[_0x461d('0x21')],{'$or':_[_0x461d('0x1c')](_0x3825fb['attributes'],function(_0x1cf3f8){var _0x4ce11a={};_0x4ce11a[_0x1cf3f8]={'$like':'%'+_0xd65ef7['query']['filter']+'%'};return _0x4ce11a;})});}_0x3825fb=_[_0x461d('0x32')]({},_0x3825fb,_0xd65ef7[_0x461d('0x33')]);return _0x25ec67['getAgents'](_0x3825fb);}})[_0x461d('0x13')](function(_0x438f19){if(_0x438f19){_0x82a9e6=_0x438f19[_0x461d('0x30')];if(!_0xd65ef7[_0x461d('0x24')][_0x461d('0x43')](_0x461d('0x44'))){_0x3825fb[_0x461d('0x10')]=qs[_0x461d('0x10')](_0xd65ef7['query'][_0x461d('0x10')]);_0x3825fb[_0x461d('0xe')]=qs[_0x461d('0xe')](_0xd65ef7[_0x461d('0x24')][_0x461d('0xe')]);}return _0x25ec67['getAgents'](_0x3825fb);}})[_0x461d('0x13')](function(_0x23876f){if(_0x23876f){return _0x23876f?{'count':_0x82a9e6,'rows':_0x23876f}:null;}})[_0x461d('0x13')](respondWithResult(_0x392683,null))[_0x461d('0x27')](handleError(_0x392683,null));}; \ No newline at end of file +var _0x9850=['getAgents','bluebird','util','lodash','squel','../../config/logger','api','../../config/environment','../../mysqldb','redis','socket.io-emitter','./whatsappQueue.socket','register','status','end','json','offset','undefined','count','limit','set','Content-Range','then','destroy','get','WhatsappQueues','sendStatus','error','name','send','map','WhatsappQueue','rawAttributes','fieldName','key','getOptions','where','include','findAll','catch','model','keys','query','filters','intersection','attributes','fields','merge','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','UserProfileResource','params','describe','length','hasOwnProperty','order','sort','pick','WhatsappQueueId','filter','UserWhatsappQueue','User','findAndCountAll','UserId','agent','whatsappPause','createdAt','format','updatedAt','findOne','Team','nolimit','getTeams','addTeams','ids','online','voicePause','interface','flatMap','Agents','sequelize','each','findOrCreate','forEach','emit','removeTeams','select','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','SELECT','every','TeamId','includes','all','union','compact','value','transaction','isEmpty','removeAgents','userWhatsappQueue:remove','addAgents','omit'];(function(_0x1525b4,_0x40eabb){var _0x5ca076=function(_0x83beaa){while(--_0x83beaa){_0x1525b4['push'](_0x1525b4['shift']());}};_0x5ca076(++_0x40eabb);}(_0x9850,0x160));var _0x0985=function(_0x193875,_0x2e81c2){_0x193875=_0x193875-0x0;var _0x2a0f4e=_0x9850[_0x193875];return _0x2a0f4e;};'use strict';var BPromise=require(_0x0985('0x0'));var util=require(_0x0985('0x1'));var _=require(_0x0985('0x2'));var squel=require(_0x0985('0x3'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0x0985('0x4'))(_0x0985('0x5'));var config=require(_0x0985('0x6'));var db=require(_0x0985('0x7'))['db'];config[_0x0985('0x8')]=_['defaults'](config[_0x0985('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x0985('0x9'))(new Redis(config[_0x0985('0x8')]));require(_0x0985('0xa'))[_0x0985('0xb')](socket);function respondWithStatusCode(_0x418fef,_0x583bc0){_0x583bc0=_0x583bc0||0xcc;return function(_0x2208d5){if(_0x2208d5){return _0x418fef['sendStatus'](_0x583bc0);}return _0x418fef[_0x0985('0xc')](_0x583bc0)[_0x0985('0xd')]();};}function respondWithResult(_0x33450c,_0xb0082f){_0xb0082f=_0xb0082f||0xc8;return function(_0x2d679f){if(_0x2d679f){return _0x33450c['status'](_0xb0082f)[_0x0985('0xe')](_0x2d679f);}};}function respondWithFilteredResult(_0x55ae10,_0x3ab91e){return function(_0x874fb1){if(_0x874fb1){var _0x441968=typeof _0x3ab91e[_0x0985('0xf')]===_0x0985('0x10')&&typeof _0x3ab91e['limit']===_0x0985('0x10');var _0x633e15=_0x874fb1[_0x0985('0x11')];var _0xeb8e2e=_0x441968?0x0:_0x3ab91e[_0x0985('0xf')];var _0x58eadc=_0x441968?_0x874fb1['count']:_0x3ab91e[_0x0985('0xf')]+_0x3ab91e[_0x0985('0x12')];var _0x4604e8;if(_0x58eadc>=_0x633e15){_0x58eadc=_0x633e15;_0x4604e8=0xc8;}else{_0x4604e8=0xce;}_0x55ae10['status'](_0x4604e8);return _0x55ae10[_0x0985('0x13')](_0x0985('0x14'),_0xeb8e2e+'-'+_0x58eadc+'/'+_0x633e15)['json'](_0x874fb1);}return null;};}function saveUpdates(_0x3d3208){return function(_0x143ed3){if(_0x143ed3){return _0x143ed3['update'](_0x3d3208)[_0x0985('0x15')](function(_0x196dae){return _0x196dae;});}return null;};}function removeEntity(_0x27ad66){return function(_0x40e053){if(_0x40e053){return _0x40e053[_0x0985('0x16')]()['then'](function(){var _0x13066b=_0x40e053[_0x0985('0x17')]({'plain':!![]});var _0x732f5b=_0x0985('0x18');return db['UserProfileResource']['destroy']({'where':{'type':_0x732f5b,'resourceId':_0x13066b['id']}})['then'](function(){return _0x40e053;});})[_0x0985('0x15')](function(){_0x27ad66[_0x0985('0xc')](0xcc)[_0x0985('0xd')]();});}};}function handleEntityNotFound(_0x44c111){return function(_0x182a31){if(!_0x182a31){_0x44c111[_0x0985('0x19')](0x194);}return _0x182a31;};}function handleError(_0x1e03a7,_0x1ae8e5){_0x1ae8e5=_0x1ae8e5||0x1f4;return function(_0x441f34){logger[_0x0985('0x1a')](_0x441f34['stack']);if(_0x441f34[_0x0985('0x1b')]){delete _0x441f34['name'];}_0x1e03a7[_0x0985('0xc')](_0x1ae8e5)[_0x0985('0x1c')](_0x441f34);};}exports['index']=function(_0x5cf27d,_0x210707){var _0x17c839={};var _0x531b89={'count':0x0,'rows':[]};var _0x5e6525=_[_0x0985('0x1d')](db[_0x0985('0x1e')][_0x0985('0x1f')],function(_0x23fcc9){return{'name':_0x23fcc9[_0x0985('0x20')],'type':_0x23fcc9['type'][_0x0985('0x21')]};});_0x17c839=qs[_0x0985('0x22')](_0x5e6525,_0x5cf27d);var _0x126077={'where':_0x17c839[_0x0985('0x23')]};return db[_0x0985('0x1e')]['count'](_0x126077)['then'](function(_0x5b5527){_0x531b89[_0x0985('0x11')]=_0x5b5527;_0x17c839['include']=qs[_0x0985('0x24')](_0x5cf27d['query']);return db[_0x0985('0x1e')][_0x0985('0x25')](_0x17c839);})[_0x0985('0x15')](function(_0x347ccb){_0x531b89['rows']=_0x347ccb;return _0x531b89;})['then'](respondWithFilteredResult(_0x210707,_0x17c839))[_0x0985('0x26')](handleError(_0x210707,null));};exports['show']=function(_0x2cfd65,_0x5ddd28){var _0x24f935={'raw':!![],'where':{'id':_0x2cfd65['params']['id']}},_0x1d3b2d={};_0x1d3b2d[_0x0985('0x27')]=_[_0x0985('0x28')](db[_0x0985('0x1e')]['rawAttributes']);_0x1d3b2d[_0x0985('0x29')]=_[_0x0985('0x28')](_0x2cfd65['query']);_0x1d3b2d[_0x0985('0x2a')]=_[_0x0985('0x2b')](_0x1d3b2d[_0x0985('0x27')],_0x1d3b2d[_0x0985('0x29')]);_0x24f935[_0x0985('0x2c')]=_[_0x0985('0x2b')](_0x1d3b2d[_0x0985('0x27')],qs[_0x0985('0x2d')](_0x2cfd65[_0x0985('0x29')][_0x0985('0x2d')]));_0x24f935['attributes']=_0x24f935[_0x0985('0x2c')]['length']?_0x24f935[_0x0985('0x2c')]:_0x1d3b2d[_0x0985('0x27')];if(_0x2cfd65[_0x0985('0x29')]['includeAll']){_0x24f935['include']=[{'all':!![]}];}_0x24f935=_[_0x0985('0x2e')]({},_0x24f935,_0x2cfd65[_0x0985('0x2f')]);return db[_0x0985('0x1e')][_0x0985('0x30')](_0x24f935)['then'](handleEntityNotFound(_0x5ddd28,null))[_0x0985('0x15')](respondWithResult(_0x5ddd28,null))[_0x0985('0x26')](handleError(_0x5ddd28,null));};exports[_0x0985('0x31')]=function(_0x258d41,_0x2140b0){return db[_0x0985('0x1e')][_0x0985('0x31')](_0x258d41[_0x0985('0x32')],{})[_0x0985('0x15')](function(_0x560d28){var _0x1ffcdb=_0x258d41['user'][_0x0985('0x17')]({'plain':!![]});if(!_0x1ffcdb)throw new Error(_0x0985('0x33'));if(_0x1ffcdb['role']===_0x0985('0x34')){var _0x3e5061=_0x560d28[_0x0985('0x17')]({'plain':!![]});var _0x345e0a=_0x0985('0x18');return db[_0x0985('0x35')][_0x0985('0x30')]({'where':{'name':_0x345e0a,'userProfileId':_0x1ffcdb['userProfileId']},'raw':!![]})[_0x0985('0x15')](function(_0x2a2b09){if(_0x2a2b09&&_0x2a2b09[_0x0985('0x36')]===0x0){return db[_0x0985('0x37')]['create']({'name':_0x3e5061[_0x0985('0x1b')],'resourceId':_0x3e5061['id'],'type':_0x2a2b09[_0x0985('0x1b')],'sectionId':_0x2a2b09['id']},{})[_0x0985('0x15')](function(){return _0x560d28;});}else{return _0x560d28;}})[_0x0985('0x26')](function(_0x4e59d2){logger[_0x0985('0x1a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4e59d2);throw _0x4e59d2;});}return _0x560d28;})[_0x0985('0x15')](respondWithResult(_0x2140b0,0xc9))[_0x0985('0x26')](handleError(_0x2140b0,null));};exports['update']=function(_0x58aeb9,_0x585c64){if(_0x58aeb9['body']['id']){delete _0x58aeb9[_0x0985('0x32')]['id'];}return db[_0x0985('0x1e')][_0x0985('0x30')]({'where':{'id':_0x58aeb9[_0x0985('0x38')]['id']}})[_0x0985('0x15')](handleEntityNotFound(_0x585c64,null))[_0x0985('0x15')](saveUpdates(_0x58aeb9['body'],null))[_0x0985('0x15')](respondWithResult(_0x585c64,null))[_0x0985('0x26')](handleError(_0x585c64,null));};exports[_0x0985('0x16')]=function(_0x428fac,_0x2a14cf){return db[_0x0985('0x1e')][_0x0985('0x30')]({'where':{'id':_0x428fac['params']['id']}})[_0x0985('0x15')](handleEntityNotFound(_0x2a14cf,null))[_0x0985('0x15')](removeEntity(_0x2a14cf,null))[_0x0985('0x26')](handleError(_0x2a14cf,null));};exports['describe']=function(_0xb8d158,_0x7eedd4){return db[_0x0985('0x1e')][_0x0985('0x39')]()[_0x0985('0x15')](respondWithResult(_0x7eedd4,null))[_0x0985('0x26')](handleError(_0x7eedd4,null));};exports['getMembers']=function(_0x3f09fe,_0x5f0988){var _0x61f11c={'raw':!![],'where':{}},_0x5de111={},_0x4cc6a8;return db[_0x0985('0x1e')]['findOne']({'where':{'id':_0x3f09fe['params']['id']}})[_0x0985('0x15')](handleEntityNotFound(_0x5f0988,null))[_0x0985('0x15')](function(_0x8b1f6a){if(_0x8b1f6a){_0x4cc6a8=_0x8b1f6a[_0x0985('0x17')]({'plain':!![]});_0x5de111[_0x0985('0x27')]=_['keys'](db['UserWhatsappQueue']['rawAttributes']);_0x5de111[_0x0985('0x29')]=_['keys'](_0x3f09fe['query']);_0x5de111[_0x0985('0x2a')]=_[_0x0985('0x2b')](_0x5de111[_0x0985('0x27')],_0x5de111[_0x0985('0x29')]);_0x61f11c['attributes']=_['intersection'](_0x5de111[_0x0985('0x27')],qs[_0x0985('0x2d')](_0x3f09fe[_0x0985('0x29')][_0x0985('0x2d')]));_0x61f11c[_0x0985('0x2c')]=_0x61f11c[_0x0985('0x2c')][_0x0985('0x3a')]?_0x61f11c[_0x0985('0x2c')]:_0x5de111['model'];if(!_0x3f09fe['query'][_0x0985('0x3b')]('nolimit')){_0x61f11c[_0x0985('0x12')]=qs[_0x0985('0x12')](_0x3f09fe[_0x0985('0x29')][_0x0985('0x12')]);_0x61f11c[_0x0985('0xf')]=qs[_0x0985('0xf')](_0x3f09fe[_0x0985('0x29')][_0x0985('0xf')]);}_0x61f11c[_0x0985('0x3c')]=qs[_0x0985('0x3d')](_0x3f09fe['query']['sort']);_0x61f11c[_0x0985('0x23')]=qs[_0x0985('0x2a')](_[_0x0985('0x3e')](_0x3f09fe[_0x0985('0x29')],_0x5de111['filters']));_0x61f11c[_0x0985('0x23')][_0x0985('0x3f')]=_0x8b1f6a['id'];if(_0x3f09fe[_0x0985('0x29')][_0x0985('0x40')]){_0x61f11c[_0x0985('0x23')]=_[_0x0985('0x2e')](_0x61f11c[_0x0985('0x23')],{'$or':_[_0x0985('0x1d')](_0x61f11c['attributes'],function(_0x136239){var _0xb145bc={};_0xb145bc[_0x136239]={'$like':'%'+_0x3f09fe[_0x0985('0x29')][_0x0985('0x40')]+'%'};return _0xb145bc;})});}_0x61f11c=_[_0x0985('0x2e')]({},_0x61f11c,_0x3f09fe[_0x0985('0x2f')]);return db[_0x0985('0x41')][_0x0985('0x25')](_0x61f11c);}})[_0x0985('0x15')](function(_0x538af0){if(_0x538af0){return db[_0x0985('0x42')][_0x0985('0x43')]({'where':{'id':_[_0x0985('0x1d')](_0x538af0,_0x0985('0x44')),'role':_0x0985('0x45')},'attributes':['id',_0x0985('0x1b'),_0x0985('0x46'),'updatedAt',_0x0985('0x47')]});}})[_0x0985('0x15')](function(_0x4b804f){if(_0x4b804f){return{'count':_0x4b804f['count'],'rows':_['map'](_0x4b804f['rows'],function(_0xe8cb63){return{'membername':_0xe8cb63[_0x0985('0x1b')],'UserId':_0xe8cb63['id'],'queue_name':_0x4cc6a8[_0x0985('0x1b')],'WhatsappQueueId':_0x4cc6a8['id'],'interface':util[_0x0985('0x48')]('%s/%s','SIP',_0xe8cb63[_0x0985('0x1b')]),'penalty':0x0,'paused':_0xe8cb63[_0x0985('0x46')],'createdAt':_0xe8cb63[_0x0985('0x47')],'updatedAt':_0xe8cb63[_0x0985('0x49')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x5f0988,_0x61f11c))[_0x0985('0x26')](handleError(_0x5f0988,null));};exports['getTeams']=function(_0x5bd4df,_0x163700){var _0x2a8834={};var _0x145569={};var _0x53a560;var _0x54e13a;return db[_0x0985('0x1e')][_0x0985('0x4a')]({'where':{'id':_0x5bd4df[_0x0985('0x38')]['id']}})[_0x0985('0x15')](handleEntityNotFound(_0x163700,null))[_0x0985('0x15')](function(_0x5dab30){if(_0x5dab30){_0x53a560=_0x5dab30;_0x145569['model']=_['keys'](db[_0x0985('0x4b')]['rawAttributes']);_0x145569[_0x0985('0x29')]=_['keys'](_0x5bd4df[_0x0985('0x29')]);_0x145569[_0x0985('0x2a')]=_['intersection'](_0x145569['model'],_0x145569[_0x0985('0x29')]);_0x2a8834['attributes']=_[_0x0985('0x2b')](_0x145569['model'],qs[_0x0985('0x2d')](_0x5bd4df[_0x0985('0x29')][_0x0985('0x2d')]));_0x2a8834['attributes']=_0x2a8834[_0x0985('0x2c')][_0x0985('0x3a')]?_0x2a8834[_0x0985('0x2c')]:_0x145569[_0x0985('0x27')];_0x2a8834[_0x0985('0x3c')]=qs[_0x0985('0x3d')](_0x5bd4df[_0x0985('0x29')][_0x0985('0x3d')]);_0x2a8834[_0x0985('0x23')]=qs['filters'](_['pick'](_0x5bd4df['query'],_0x145569[_0x0985('0x2a')]));if(_0x5bd4df['query']['filter']){_0x2a8834[_0x0985('0x23')]=_[_0x0985('0x2e')](_0x2a8834[_0x0985('0x23')],{'$or':_[_0x0985('0x1d')](_0x2a8834[_0x0985('0x2c')],function(_0x118067){var _0x229082={};_0x229082[_0x118067]={'$like':'%'+_0x5bd4df[_0x0985('0x29')][_0x0985('0x40')]+'%'};return _0x229082;})});}_0x2a8834=_[_0x0985('0x2e')]({},_0x2a8834,_0x5bd4df['options']);return _0x53a560['getTeams'](_0x2a8834);}})[_0x0985('0x15')](function(_0xb91037){if(_0xb91037){_0x54e13a=_0xb91037[_0x0985('0x3a')];if(!_0x5bd4df[_0x0985('0x29')][_0x0985('0x3b')](_0x0985('0x4c'))){_0x2a8834['limit']=qs[_0x0985('0x12')](_0x5bd4df['query']['limit']);_0x2a8834[_0x0985('0xf')]=qs['offset'](_0x5bd4df[_0x0985('0x29')]['offset']);}return _0x53a560[_0x0985('0x4d')](_0x2a8834);}})['then'](function(_0x43d91c){if(_0x43d91c){return _0x43d91c?{'count':_0x54e13a,'rows':_0x43d91c}:null;}})[_0x0985('0x15')](respondWithResult(_0x163700,null))[_0x0985('0x26')](handleError(_0x163700,null));};exports[_0x0985('0x4e')]=function(_0x4ad54a,_0xdf9295){var _0x1ce5e7=_0x4ad54a[_0x0985('0x32')][_0x0985('0x4f')];return db['Team'][_0x0985('0x25')]({'where':{'id':_0x1ce5e7},'attributes':['id'],'include':[{'model':db[_0x0985('0x42')],'as':'Agents','attributes':['id',_0x0985('0x1b'),_0x0985('0x50'),_0x0985('0x51'),_0x0985('0x52')],'raw':!![]}]})[_0x0985('0x15')](function(_0x273f9e){if(_0x273f9e){var _0x19b532=_[_0x0985('0x53')](_0x273f9e,function(_0x274cea){var _0x5540cc=_0x274cea[_0x0985('0x17')]({'plain':!![]});return _0x5540cc[_0x0985('0x54')];});return db[_0x0985('0x1e')][_0x0985('0x30')]({'where':{'id':_0x4ad54a['params']['id']}})[_0x0985('0x15')](function(_0x2f6903){return db[_0x0985('0x55')]['transaction'](function(_0x51467b){return _0x2f6903[_0x0985('0x4e')](_0x1ce5e7,{'transaction':_0x51467b})[_0x0985('0x15')](function(){return BPromise[_0x0985('0x56')](_0x19b532,function(_0x10ec6c){return db[_0x0985('0x41')][_0x0985('0x57')]({'where':{'UserId':_0x10ec6c['id'],'WhatsappQueueId':_0x4ad54a[_0x0985('0x38')]['id']},'transaction':_0x51467b});});})[_0x0985('0x15')](function(){_0x19b532[_0x0985('0x58')](function(_0x4089e9){socket[_0x0985('0x59')]('userWhatsappQueue:save',{'UserId':_0x4089e9['id'],'WhatsappQueueId':_0x2f6903['id']});});});});});}})[_0x0985('0x15')](respondWithStatusCode(_0xdf9295,null))['catch'](handleError(_0xdf9295,null));};exports[_0x0985('0x5a')]=function(_0x478b8a,_0x4f4e71){return db[_0x0985('0x4b')][_0x0985('0x25')]({'where':{'id':_0x478b8a[_0x0985('0x29')][_0x0985('0x4f')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x0985('0x15')](handleEntityNotFound(_0x4f4e71,null))[_0x0985('0x15')](function(_0x25f555){var _0x45d204=_[_0x0985('0x1d')](_0x25f555,'id');var _0x3707db=[];var _0x52f7be=[];var _0x41dfb0=squel[_0x0985('0x5b')]();_0x41dfb0[_0x0985('0x5c')](_0x0985('0x5d'))[_0x0985('0x5e')]('team_has_whatsapp_queues','tq')[_0x0985('0x5f')](_0x0985('0x60'),'ut',_0x0985('0x61'))[_0x0985('0x23')](_0x0985('0x62'),_0x478b8a[_0x0985('0x38')]['id']);for(var _0x23552a=0x0;_0x23552a<_0x25f555['length'];_0x23552a+=0x1){let _0x1ae661=_0x25f555[_0x23552a];for(var _0x2f0ccd=0x0;_0x2f0ccd<_0x1ae661[_0x0985('0x54')][_0x0985('0x3a')];_0x2f0ccd+=0x1){let _0x284516=_0x1ae661[_0x0985('0x54')][_0x2f0ccd];var _0x32e60a=_0x41dfb0[_0x0985('0x63')]();_0x32e60a[_0x0985('0x23')](_0x0985('0x64'),_0x284516['id']);_0x52f7be['push'](db['sequelize'][_0x0985('0x29')](_0x32e60a[_0x0985('0x65')](),{'type':db[_0x0985('0x55')]['QueryTypes'][_0x0985('0x66')]})[_0x0985('0x15')](function(_0x1f626a){if(_0x1f626a[_0x0985('0x3a')]===0x1){return _0x284516['id'];}else{var _0x24d417=_[_0x0985('0x67')](_[_0x0985('0x1d')](_0x1f626a,_0x0985('0x68')),function(_0x31b9d4){return _[_0x0985('0x69')](_0x45d204,_0x31b9d4);});if(_0x24d417){return _0x284516['id'];}}}));}}return BPromise[_0x0985('0x6a')](_0x52f7be)[_0x0985('0x15')](function(_0x5b955f){_0x3707db=_(_0x3707db)[_0x0985('0x6b')](_0x5b955f)[_0x0985('0x6c')]()[_0x0985('0x6d')]();return db[_0x0985('0x1e')][_0x0985('0x30')]({'where':{'id':_0x478b8a[_0x0985('0x38')]['id']}})[_0x0985('0x15')](function(_0x7aa633){return db[_0x0985('0x55')][_0x0985('0x6e')](function(_0x13e56e){return _0x7aa633['removeTeams'](_0x478b8a['query']['ids'],{'transaction':_0x13e56e})['then'](function(){if(!_[_0x0985('0x6f')](_0x3707db)){return _0x7aa633[_0x0985('0x70')](_0x3707db,{'transaction':_0x13e56e});}})[_0x0985('0x15')](function(){_0x3707db[_0x0985('0x58')](function(_0x5d0a4f){socket[_0x0985('0x59')](_0x0985('0x71'),{'UserId':_0x5d0a4f,'WhatsappQueueId':_0x7aa633['id']});});});});});});})['then'](respondWithStatusCode(_0x4f4e71,null))['catch'](handleError(_0x4f4e71,null));};exports[_0x0985('0x72')]=function(_0x5b32fc,_0xf88253){return db[_0x0985('0x1e')][_0x0985('0x30')]({'where':{'id':_0x5b32fc[_0x0985('0x38')]['id']}})[_0x0985('0x15')](handleEntityNotFound(_0xf88253,null))[_0x0985('0x15')](function(_0x2e89cc){if(_0x2e89cc){return _0x2e89cc[_0x0985('0x72')](_0x5b32fc[_0x0985('0x32')][_0x0985('0x4f')],_[_0x0985('0x73')](_0x5b32fc['body'],['ids','id'])||{})['spread'](function(_0x3861dc){for(var _0x55d3cc=0x0;_0x55d3cc<_0x5b32fc[_0x0985('0x32')][_0x0985('0x4f')][_0x0985('0x3a')];_0x55d3cc+=0x1){socket[_0x0985('0x59')]('userWhatsappQueue:save',{'UserId':Number(_0x5b32fc[_0x0985('0x32')][_0x0985('0x4f')][_0x55d3cc]),'WhatsappQueueId':Number(_0x5b32fc[_0x0985('0x38')]['id'])});}return _0x3861dc;});}})[_0x0985('0x15')](respondWithResult(_0xf88253,null))['catch'](handleError(_0xf88253,null));};exports[_0x0985('0x70')]=function(_0x356a73,_0x3b6a13){return db[_0x0985('0x1e')]['find']({'where':{'id':_0x356a73['params']['id']}})[_0x0985('0x15')](handleEntityNotFound(_0x3b6a13,null))['then'](function(_0x3cf94f){if(_0x3cf94f){return _0x3cf94f[_0x0985('0x70')](_0x356a73['query']['ids'])['then'](function(){if(_['isArray'](_0x356a73[_0x0985('0x29')][_0x0985('0x4f')])){for(var _0xb03a61=0x0;_0xb03a61<_0x356a73[_0x0985('0x29')][_0x0985('0x4f')]['length'];_0xb03a61+=0x1){socket[_0x0985('0x59')]('userWhatsappQueue:remove',{'UserId':Number(_0x356a73[_0x0985('0x29')][_0x0985('0x4f')][_0xb03a61]),'WhatsappQueueId':Number(_0x356a73[_0x0985('0x38')]['id'])});}}else{socket['emit'](_0x0985('0x71'),{'UserId':Number(_0x356a73[_0x0985('0x29')][_0x0985('0x4f')]),'WhatsappQueueId':Number(_0x356a73[_0x0985('0x38')]['id'])});}});}})[_0x0985('0x15')](respondWithStatusCode(_0x3b6a13,null))['catch'](handleError(_0x3b6a13,null));};exports[_0x0985('0x74')]=function(_0x39dfd,_0x58c711){var _0x292bc0={};var _0x12d37a={};var _0x572a99;var _0x1de813;return db[_0x0985('0x1e')][_0x0985('0x4a')]({'where':{'id':_0x39dfd[_0x0985('0x38')]['id']}})[_0x0985('0x15')](handleEntityNotFound(_0x58c711,null))[_0x0985('0x15')](function(_0x4aae8e){if(_0x4aae8e){_0x572a99=_0x4aae8e;_0x12d37a[_0x0985('0x27')]=_[_0x0985('0x28')](db[_0x0985('0x42')][_0x0985('0x1f')]);_0x12d37a[_0x0985('0x29')]=_['keys'](_0x39dfd['query']);_0x12d37a[_0x0985('0x2a')]=_[_0x0985('0x2b')](_0x12d37a[_0x0985('0x27')],_0x12d37a[_0x0985('0x29')]);_0x292bc0[_0x0985('0x2c')]=_[_0x0985('0x2b')](_0x12d37a['model'],qs[_0x0985('0x2d')](_0x39dfd[_0x0985('0x29')][_0x0985('0x2d')]));_0x292bc0[_0x0985('0x2c')]=_0x292bc0['attributes'][_0x0985('0x3a')]?_0x292bc0['attributes']:_0x12d37a[_0x0985('0x27')];_0x292bc0[_0x0985('0x3c')]=qs[_0x0985('0x3d')](_0x39dfd[_0x0985('0x29')][_0x0985('0x3d')]);_0x292bc0[_0x0985('0x23')]=qs[_0x0985('0x2a')](_[_0x0985('0x3e')](_0x39dfd[_0x0985('0x29')],_0x12d37a[_0x0985('0x2a')]));if(_0x39dfd[_0x0985('0x29')][_0x0985('0x40')]){_0x292bc0[_0x0985('0x23')]=_['merge'](_0x292bc0[_0x0985('0x23')],{'$or':_['map'](_0x292bc0['attributes'],function(_0x47b28c){var _0x4c5888={};_0x4c5888[_0x47b28c]={'$like':'%'+_0x39dfd[_0x0985('0x29')][_0x0985('0x40')]+'%'};return _0x4c5888;})});}_0x292bc0=_['merge']({},_0x292bc0,_0x39dfd[_0x0985('0x2f')]);return _0x572a99[_0x0985('0x74')](_0x292bc0);}})[_0x0985('0x15')](function(_0x56e0eb){if(_0x56e0eb){_0x1de813=_0x56e0eb[_0x0985('0x3a')];if(!_0x39dfd[_0x0985('0x29')][_0x0985('0x3b')](_0x0985('0x4c'))){_0x292bc0[_0x0985('0x12')]=qs['limit'](_0x39dfd[_0x0985('0x29')][_0x0985('0x12')]);_0x292bc0[_0x0985('0xf')]=qs[_0x0985('0xf')](_0x39dfd['query'][_0x0985('0xf')]);}return _0x572a99[_0x0985('0x74')](_0x292bc0);}})[_0x0985('0x15')](function(_0x2f4be9){if(_0x2f4be9){return _0x2f4be9?{'count':_0x1de813,'rows':_0x2f4be9}:null;}})['then'](respondWithResult(_0x58c711,null))[_0x0985('0x26')](handleError(_0x58c711,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index 82f2d36..7b7b0cb 100644 --- a/server/api/whatsappQueue/whatsappQueue.events.js +++ b/server/api/whatsappQueue/whatsappQueue.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfc63=['../../mysqldb','WhatsappQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x3c8e9a,_0x384306){var _0x2d4c57=function(_0x43d408){while(--_0x43d408){_0x3c8e9a['push'](_0x3c8e9a['shift']());}};_0x2d4c57(++_0x384306);}(_0xfc63,0x180));var _0x3fc6=function(_0x12e1ea,_0x2d5bf1){_0x12e1ea=_0x12e1ea-0x0;var _0x718ea1=_0xfc63[_0x12e1ea];return _0x718ea1;};'use strict';var EventEmitter=require(_0x3fc6('0x0'));var WhatsappQueue=require(_0x3fc6('0x1'))['db'][_0x3fc6('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x3fc6('0x3')](0x0);var events={'afterCreate':_0x3fc6('0x4'),'afterUpdate':_0x3fc6('0x5'),'afterDestroy':_0x3fc6('0x6')};function emitEvent(_0x2877cb){return function(_0xe409b0,_0x2f0dc5,_0x241c71){WhatsappQueueEvents[_0x3fc6('0x7')](_0x2877cb+':'+_0xe409b0['id'],_0xe409b0);WhatsappQueueEvents['emit'](_0x2877cb,_0xe409b0);_0x241c71(null);};}for(var e in events){if(events[_0x3fc6('0x8')](e)){var event=events[e];WhatsappQueue[_0x3fc6('0x9')](e,emitEvent(event));}}module[_0x3fc6('0xa')]=WhatsappQueueEvents; \ No newline at end of file +var _0x3c53=['hasOwnProperty','hook','exports','events','WhatsappQueue','setMaxListeners','update','emit'];(function(_0x5b8dea,_0x289a9e){var _0x88c89=function(_0x4ade6e){while(--_0x4ade6e){_0x5b8dea['push'](_0x5b8dea['shift']());}};_0x88c89(++_0x289a9e);}(_0x3c53,0x163));var _0x33c5=function(_0x316297,_0x348e82){_0x316297=_0x316297-0x0;var _0x1dcc78=_0x3c53[_0x316297];return _0x1dcc78;};'use strict';var EventEmitter=require(_0x33c5('0x0'));var WhatsappQueue=require('../../mysqldb')['db'][_0x33c5('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x33c5('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x33c5('0x3'),'afterDestroy':'remove'};function emitEvent(_0x38b84b){return function(_0x1b8742,_0x4df7d9,_0x4e3ce6){WhatsappQueueEvents[_0x33c5('0x4')](_0x38b84b+':'+_0x1b8742['id'],_0x1b8742);WhatsappQueueEvents['emit'](_0x38b84b,_0x1b8742);_0x4e3ce6(null);};}for(var e in events){if(events[_0x33c5('0x5')](e)){var event=events[e];WhatsappQueue[_0x33c5('0x6')](e,emitEvent(event));}}module[_0x33c5('0x7')]=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index a7f7924..1637a5f 100644 --- a/server/api/whatsappQueue/whatsappQueue.model.js +++ b/server/api/whatsappQueue/whatsappQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8816=['WhatsappQueue','lodash','api','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappQueue.attributes','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8816,0x191));var _0x6881=function(_0x3a8acd,_0x463c24){_0x3a8acd=_0x3a8acd-0x0;var _0x59a5fc=_0x8816[_0x3a8acd];return _0x59a5fc;};'use strict';var _=require(_0x6881('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x6881('0x1'));var moment=require('moment');var BPromise=require(_0x6881('0x2'));var rp=require(_0x6881('0x3'));var fs=require('fs');var path=require(_0x6881('0x4'));var rimraf=require(_0x6881('0x5'));var config=require(_0x6881('0x6'));var attributes=require(_0x6881('0x7'));module[_0x6881('0x8')]=function(_0x25b28c,_0x35dbe5){return _0x25b28c['define'](_0x6881('0x9'),attributes,{'tableName':'whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb7b4=['api','moment','request-promise','path','rimraf','../../config/environment','./whatsappQueue.attributes','exports','define','WhatsappQueue','whatsapp_queues','lodash','../../config/logger'];(function(_0x36c87d,_0x2ab247){var _0x54dc55=function(_0x2b4112){while(--_0x2b4112){_0x36c87d['push'](_0x36c87d['shift']());}};_0x54dc55(++_0x2ab247);}(_0xb7b4,0x150));var _0x4b7b=function(_0x10971c,_0x4286dd){_0x10971c=_0x10971c-0x0;var _0x3e579f=_0xb7b4[_0x10971c];return _0x3e579f;};'use strict';var _=require(_0x4b7b('0x0'));var util=require('util');var logger=require(_0x4b7b('0x1'))(_0x4b7b('0x2'));var moment=require(_0x4b7b('0x3'));var BPromise=require('bluebird');var rp=require(_0x4b7b('0x4'));var fs=require('fs');var path=require(_0x4b7b('0x5'));var rimraf=require(_0x4b7b('0x6'));var config=require(_0x4b7b('0x7'));var attributes=require(_0x4b7b('0x8'));module[_0x4b7b('0x9')]=function(_0x38bbd9,_0x4b8df9){return _0x38bbd9[_0x4b7b('0xa')](_0x4b7b('0xb'),attributes,{'tableName':_0x4b7b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.rpc.js b/server/api/whatsappQueue/whatsappQueue.rpc.js index 2cb1768..e9429d0 100644 --- a/server/api/whatsappQueue/whatsappQueue.rpc.js +++ b/server/api/whatsappQueue/whatsappQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbbe8=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','localhost','socket.io-emitter','redis','./whatsappQueue.socket','request','then','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetWhatsappQueue','WhatsappQueue','options','raw','where','attributes','include','map','model','ShowWhatsappQueue','find','lodash','util','moment','ioredis','../../mysqldb'];(function(_0x173113,_0x316a7c){var _0x3bea89=function(_0xd33ac1){while(--_0xd33ac1){_0x173113['push'](_0x173113['shift']());}};_0x3bea89(++_0x316a7c);}(_0xbbe8,0x1cf));var _0x8bbe=function(_0x8ef83d,_0x520c3d){_0x8ef83d=_0x8ef83d-0x0;var _0x4a4a19=_0xbbe8[_0x8ef83d];return _0x4a4a19;};'use strict';var _=require(_0x8bbe('0x0'));var util=require(_0x8bbe('0x1'));var moment=require(_0x8bbe('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8bbe('0x3'));var db=require(_0x8bbe('0x4'))['db'];var utils=require(_0x8bbe('0x5'));var logger=require(_0x8bbe('0x6'))(_0x8bbe('0x7'));var config=require(_0x8bbe('0x8'));var jayson=require(_0x8bbe('0x9'));var client=jayson['client'][_0x8bbe('0xa')]({'port':0x232a});config['redis']=_[_0x8bbe('0xb')](config['redis'],{'host':_0x8bbe('0xc'),'port':0x18eb});var socket=require(_0x8bbe('0xd'))(new Redis(config[_0x8bbe('0xe')]));require(_0x8bbe('0xf'))['register'](socket);function respondWithRpcPromise(_0x16c8c8,_0x45c92c,_0x96857c){return new BPromise(function(_0xc17a0c,_0xe869e2){return client[_0x8bbe('0x10')](_0x16c8c8,_0x96857c)[_0x8bbe('0x11')](function(_0x175e2e){logger[_0x8bbe('0x12')](_0x8bbe('0x13'),_0x45c92c,_0x8bbe('0x14'));logger[_0x8bbe('0x15')]('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x45c92c,_0x8bbe('0x14'),JSON[_0x8bbe('0x16')](_0x175e2e));if(_0x175e2e[_0x8bbe('0x17')]){if(_0x175e2e['error'][_0x8bbe('0x18')]===0x1f4){logger['error']('WhatsappQueue,\x20%s,\x20%s',_0x45c92c,_0x175e2e['error']['message']);return _0xe869e2(_0x175e2e['error']['message']);}logger[_0x8bbe('0x17')](_0x8bbe('0x13'),_0x45c92c,_0x175e2e[_0x8bbe('0x17')]['message']);return _0xc17a0c(_0x175e2e['error'][_0x8bbe('0x19')]);}else{logger[_0x8bbe('0x12')](_0x8bbe('0x13'),_0x45c92c,_0x8bbe('0x14'));_0xc17a0c(_0x175e2e[_0x8bbe('0x1a')]['message']);}})[_0x8bbe('0x1b')](function(_0x10e4ed){logger[_0x8bbe('0x17')](_0x8bbe('0x13'),_0x45c92c,_0x10e4ed);_0xe869e2(_0x10e4ed);});});}exports[_0x8bbe('0x1c')]=function(_0x5a6d9b){var _0x2afd40=this;return new Promise(function(_0xf0de2,_0x542964){return db[_0x8bbe('0x1d')]['findAll']({'raw':_0x5a6d9b[_0x8bbe('0x1e')]?_0x5a6d9b[_0x8bbe('0x1e')][_0x8bbe('0x1f')]===undefined?!![]:![]:!![],'where':_0x5a6d9b[_0x8bbe('0x1e')]?_0x5a6d9b[_0x8bbe('0x1e')][_0x8bbe('0x20')]||null:null,'attributes':_0x5a6d9b[_0x8bbe('0x1e')]?_0x5a6d9b['options'][_0x8bbe('0x21')]||null:null,'limit':_0x5a6d9b[_0x8bbe('0x1e')]?_0x5a6d9b[_0x8bbe('0x1e')]['limit']||null:null,'include':_0x5a6d9b[_0x8bbe('0x1e')]?_0x5a6d9b[_0x8bbe('0x1e')][_0x8bbe('0x22')]?_[_0x8bbe('0x23')](_0x5a6d9b[_0x8bbe('0x1e')][_0x8bbe('0x22')],function(_0x26d4f1){return{'model':db[_0x26d4f1['model']],'as':_0x26d4f1['as'],'attributes':_0x26d4f1['attributes'],'include':_0x26d4f1[_0x8bbe('0x22')]?_[_0x8bbe('0x23')](_0x26d4f1[_0x8bbe('0x22')],function(_0x308f82){return{'model':db[_0x308f82[_0x8bbe('0x24')]],'as':_0x308f82['as'],'attributes':_0x308f82[_0x8bbe('0x21')],'include':_0x308f82[_0x8bbe('0x22')]?_['map'](_0x308f82[_0x8bbe('0x22')],function(_0x4d5cf9){return{'model':db[_0x4d5cf9[_0x8bbe('0x24')]],'as':_0x4d5cf9['as'],'attributes':_0x4d5cf9['attributes']};}):[]};}):[]};}):[]:[]})[_0x8bbe('0x11')](function(_0x3a103d){logger['info'](_0x8bbe('0x1c'),_0x5a6d9b);logger[_0x8bbe('0x15')](_0x8bbe('0x1c'),_0x5a6d9b,JSON[_0x8bbe('0x16')](_0x3a103d));_0xf0de2(_0x3a103d);})[_0x8bbe('0x1b')](function(_0x14ad5c){logger['error']('GetWhatsappQueue',_0x14ad5c['message'],_0x5a6d9b);_0x542964(_0x2afd40['error'](0x1f4,_0x14ad5c[_0x8bbe('0x19')]));});});};exports[_0x8bbe('0x25')]=function(_0x5d5d6b){var _0x19c562=this;return new Promise(function(_0x1efaf8,_0x1215e5){return db[_0x8bbe('0x1d')][_0x8bbe('0x26')]({'raw':_0x5d5d6b['options']?_0x5d5d6b['options'][_0x8bbe('0x1f')]===undefined?!![]:![]:!![],'where':_0x5d5d6b[_0x8bbe('0x1e')]?_0x5d5d6b[_0x8bbe('0x1e')][_0x8bbe('0x20')]||null:null,'attributes':_0x5d5d6b[_0x8bbe('0x1e')]?_0x5d5d6b[_0x8bbe('0x1e')][_0x8bbe('0x21')]||null:null,'include':_0x5d5d6b[_0x8bbe('0x1e')]?_0x5d5d6b[_0x8bbe('0x1e')][_0x8bbe('0x22')]?_[_0x8bbe('0x23')](_0x5d5d6b[_0x8bbe('0x1e')][_0x8bbe('0x22')],function(_0x395b46){return{'model':db[_0x395b46[_0x8bbe('0x24')]],'as':_0x395b46['as'],'attributes':_0x395b46[_0x8bbe('0x21')],'include':_0x395b46[_0x8bbe('0x22')]?_['map'](_0x395b46[_0x8bbe('0x22')],function(_0x5e6f25){return{'model':db[_0x5e6f25[_0x8bbe('0x24')]],'as':_0x5e6f25['as'],'attributes':_0x5e6f25[_0x8bbe('0x21')],'include':_0x5e6f25['include']?_['map'](_0x5e6f25[_0x8bbe('0x22')],function(_0x52c0e7){return{'model':db[_0x52c0e7[_0x8bbe('0x24')]],'as':_0x52c0e7['as'],'attributes':_0x52c0e7[_0x8bbe('0x21')]};}):[]};}):[]};}):[]:[]})[_0x8bbe('0x11')](function(_0x1b77f3){logger[_0x8bbe('0x12')]('ShowWhatsappQueue',_0x5d5d6b);logger[_0x8bbe('0x15')](_0x8bbe('0x25'),_0x5d5d6b,JSON[_0x8bbe('0x16')](_0x1b77f3));_0x1efaf8(_0x1b77f3);})[_0x8bbe('0x1b')](function(_0x222431){logger[_0x8bbe('0x17')](_0x8bbe('0x25'),_0x222431[_0x8bbe('0x19')],_0x5d5d6b);_0x1215e5(_0x19c562[_0x8bbe('0x17')](0x1f4,_0x222431[_0x8bbe('0x19')]));});});}; \ No newline at end of file +var _0x72bc=['limit','include','map','model','attributes','then','catch','ShowWhatsappQueue','find','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./whatsappQueue.socket','register','request','info','WhatsappQueue,\x20%s,\x20%s','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','GetWhatsappQueue','WhatsappQueue','findAll','options','raw','where'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x72bc,0xa5));var _0xc72b=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x72bc[_0xa1e3e3];return _0xc980e9;};'use strict';var _=require('lodash');var util=require(_0xc72b('0x0'));var moment=require(_0xc72b('0x1'));var BPromise=require('bluebird');var rs=require(_0xc72b('0x2'));var fs=require('fs');var Redis=require(_0xc72b('0x3'));var db=require(_0xc72b('0x4'))['db'];var utils=require(_0xc72b('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xc72b('0x6'));var jayson=require(_0xc72b('0x7'));var client=jayson[_0xc72b('0x8')]['http']({'port':0x232a});config[_0xc72b('0x9')]=_[_0xc72b('0xa')](config[_0xc72b('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xc72b('0xb'))(new Redis(config[_0xc72b('0x9')]));require(_0xc72b('0xc'))[_0xc72b('0xd')](socket);function respondWithRpcPromise(_0xd6ff4b,_0x3ac496,_0x119120){return new BPromise(function(_0x2ad75e,_0x140e3a){return client[_0xc72b('0xe')](_0xd6ff4b,_0x119120)['then'](function(_0x3295eb){logger[_0xc72b('0xf')](_0xc72b('0x10'),_0x3ac496,'request\x20sent');logger[_0xc72b('0x11')](_0xc72b('0x12'),_0x3ac496,_0xc72b('0x13'),JSON[_0xc72b('0x14')](_0x3295eb));if(_0x3295eb[_0xc72b('0x15')]){if(_0x3295eb[_0xc72b('0x15')][_0xc72b('0x16')]===0x1f4){logger['error'](_0xc72b('0x10'),_0x3ac496,_0x3295eb['error'][_0xc72b('0x17')]);return _0x140e3a(_0x3295eb[_0xc72b('0x15')][_0xc72b('0x17')]);}logger['error'](_0xc72b('0x10'),_0x3ac496,_0x3295eb['error'][_0xc72b('0x17')]);return _0x2ad75e(_0x3295eb[_0xc72b('0x15')][_0xc72b('0x17')]);}else{logger[_0xc72b('0xf')](_0xc72b('0x10'),_0x3ac496,_0xc72b('0x13'));_0x2ad75e(_0x3295eb['result'][_0xc72b('0x17')]);}})['catch'](function(_0x95376d){logger[_0xc72b('0x15')](_0xc72b('0x10'),_0x3ac496,_0x95376d);_0x140e3a(_0x95376d);});});}exports[_0xc72b('0x18')]=function(_0x462cdd){var _0x46bd9a=this;return new Promise(function(_0x2299e2,_0x54d538){return db[_0xc72b('0x19')][_0xc72b('0x1a')]({'raw':_0x462cdd[_0xc72b('0x1b')]?_0x462cdd[_0xc72b('0x1b')][_0xc72b('0x1c')]===undefined?!![]:![]:!![],'where':_0x462cdd[_0xc72b('0x1b')]?_0x462cdd[_0xc72b('0x1b')][_0xc72b('0x1d')]||null:null,'attributes':_0x462cdd['options']?_0x462cdd[_0xc72b('0x1b')]['attributes']||null:null,'limit':_0x462cdd[_0xc72b('0x1b')]?_0x462cdd[_0xc72b('0x1b')][_0xc72b('0x1e')]||null:null,'include':_0x462cdd[_0xc72b('0x1b')]?_0x462cdd[_0xc72b('0x1b')][_0xc72b('0x1f')]?_[_0xc72b('0x20')](_0x462cdd[_0xc72b('0x1b')][_0xc72b('0x1f')],function(_0x3ed069){return{'model':db[_0x3ed069[_0xc72b('0x21')]],'as':_0x3ed069['as'],'attributes':_0x3ed069[_0xc72b('0x22')],'include':_0x3ed069[_0xc72b('0x1f')]?_[_0xc72b('0x20')](_0x3ed069[_0xc72b('0x1f')],function(_0x3cf1f4){return{'model':db[_0x3cf1f4[_0xc72b('0x21')]],'as':_0x3cf1f4['as'],'attributes':_0x3cf1f4[_0xc72b('0x22')],'include':_0x3cf1f4[_0xc72b('0x1f')]?_['map'](_0x3cf1f4[_0xc72b('0x1f')],function(_0x2b3034){return{'model':db[_0x2b3034['model']],'as':_0x2b3034['as'],'attributes':_0x2b3034[_0xc72b('0x22')]};}):[]};}):[]};}):[]:[]})[_0xc72b('0x23')](function(_0x572908){logger[_0xc72b('0xf')](_0xc72b('0x18'),_0x462cdd);logger['debug'](_0xc72b('0x18'),_0x462cdd,JSON['stringify'](_0x572908));_0x2299e2(_0x572908);})[_0xc72b('0x24')](function(_0x4d1bf5){logger[_0xc72b('0x15')](_0xc72b('0x18'),_0x4d1bf5[_0xc72b('0x17')],_0x462cdd);_0x54d538(_0x46bd9a[_0xc72b('0x15')](0x1f4,_0x4d1bf5[_0xc72b('0x17')]));});});};exports[_0xc72b('0x25')]=function(_0x32f43e){var _0x6772b3=this;return new Promise(function(_0x3ad9db,_0x45a6d7){return db[_0xc72b('0x19')][_0xc72b('0x26')]({'raw':_0x32f43e[_0xc72b('0x1b')]?_0x32f43e[_0xc72b('0x1b')][_0xc72b('0x1c')]===undefined?!![]:![]:!![],'where':_0x32f43e['options']?_0x32f43e[_0xc72b('0x1b')][_0xc72b('0x1d')]||null:null,'attributes':_0x32f43e[_0xc72b('0x1b')]?_0x32f43e[_0xc72b('0x1b')][_0xc72b('0x22')]||null:null,'include':_0x32f43e[_0xc72b('0x1b')]?_0x32f43e['options'][_0xc72b('0x1f')]?_['map'](_0x32f43e['options'][_0xc72b('0x1f')],function(_0x58cf39){return{'model':db[_0x58cf39[_0xc72b('0x21')]],'as':_0x58cf39['as'],'attributes':_0x58cf39[_0xc72b('0x22')],'include':_0x58cf39[_0xc72b('0x1f')]?_[_0xc72b('0x20')](_0x58cf39[_0xc72b('0x1f')],function(_0x82f142){return{'model':db[_0x82f142['model']],'as':_0x82f142['as'],'attributes':_0x82f142[_0xc72b('0x22')],'include':_0x82f142['include']?_[_0xc72b('0x20')](_0x82f142['include'],function(_0x301ad3){return{'model':db[_0x301ad3[_0xc72b('0x21')]],'as':_0x301ad3['as'],'attributes':_0x301ad3[_0xc72b('0x22')]};}):[]};}):[]};}):[]:[]})[_0xc72b('0x23')](function(_0x44bff7){logger[_0xc72b('0xf')](_0xc72b('0x25'),_0x32f43e);logger[_0xc72b('0x11')](_0xc72b('0x25'),_0x32f43e,JSON['stringify'](_0x44bff7));_0x3ad9db(_0x44bff7);})['catch'](function(_0x22b820){logger[_0xc72b('0x15')]('ShowWhatsappQueue',_0x22b820['message'],_0x32f43e);_0x45a6d7(_0x6772b3[_0xc72b('0x15')](0x1f4,_0x22b820[_0xc72b('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index 92eae53..c473e21 100644 --- a/server/api/whatsappQueue/whatsappQueue.socket.js +++ b/server/api/whatsappQueue/whatsappQueue.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5ad6=['update','emit','removeListener','register','length','./whatsappQueue.events','save','remove'];(function(_0x1a8f86,_0x5ed9c4){var _0x20d876=function(_0x596e1b){while(--_0x596e1b){_0x1a8f86['push'](_0x1a8f86['shift']());}};_0x20d876(++_0x5ed9c4);}(_0x5ad6,0x1b5));var _0x65ad=function(_0x47408e,_0x481428){_0x47408e=_0x47408e-0x0;var _0x1636bc=_0x5ad6[_0x47408e];return _0x1636bc;};'use strict';var WhatsappQueueEvents=require(_0x65ad('0x0'));var events=[_0x65ad('0x1'),_0x65ad('0x2'),_0x65ad('0x3')];function createListener(_0x3d420f,_0x2ecfd1){return function(_0x445d40){_0x2ecfd1[_0x65ad('0x4')](_0x3d420f,_0x445d40);};}function removeListener(_0x1a6b24,_0x2651a5){return function(){WhatsappQueueEvents[_0x65ad('0x5')](_0x1a6b24,_0x2651a5);};}exports[_0x65ad('0x6')]=function(_0x214dba){for(var _0x5af26b=0x0,_0x54abec=events[_0x65ad('0x7')];_0x5af26b<_0x54abec;_0x5af26b++){var _0x1050f9=events[_0x5af26b];var _0x10431a=createListener('whatsappQueue:'+_0x1050f9,_0x214dba);WhatsappQueueEvents['on'](_0x1050f9,_0x10431a);}}; \ No newline at end of file +var _0xfcfb=['remove','update','emit','removeListener','register','./whatsappQueue.events'];(function(_0x293490,_0x389352){var _0x240e5f=function(_0x33805d){while(--_0x33805d){_0x293490['push'](_0x293490['shift']());}};_0x240e5f(++_0x389352);}(_0xfcfb,0x173));var _0xbfcf=function(_0x2ab5d7,_0x1243d9){_0x2ab5d7=_0x2ab5d7-0x0;var _0x516388=_0xfcfb[_0x2ab5d7];return _0x516388;};'use strict';var WhatsappQueueEvents=require(_0xbfcf('0x0'));var events=['save',_0xbfcf('0x1'),_0xbfcf('0x2')];function createListener(_0x234ed9,_0x383bd1){return function(_0x7d30f){_0x383bd1[_0xbfcf('0x3')](_0x234ed9,_0x7d30f);};}function removeListener(_0x1a16ed,_0x4c3e3c){return function(){WhatsappQueueEvents[_0xbfcf('0x4')](_0x1a16ed,_0x4c3e3c);};}exports[_0xbfcf('0x5')]=function(_0x46676f){for(var _0x4846ad=0x0,_0x2dc8eb=events['length'];_0x4846ad<_0x2dc8eb;_0x4846ad++){var _0x7fdd9a=events[_0x4846ad];var _0x85f47e=createListener('whatsappQueue:'+_0x7fdd9a,_0x46676f);WhatsappQueueEvents['on'](_0x7fdd9a,_0x85f47e);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index 779a54c..2367193 100644 --- a/server/api/whatsappQueueReport/index.js +++ b/server/api/whatsappQueueReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0af6=['destroy','exports','multer','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','get','isAuthenticated','index','describe','/:id','show','post','create','put','update','delete'];(function(_0x1418bb,_0xe1fcf0){var _0x4fdcf8=function(_0x4c8b8b){while(--_0x4c8b8b){_0x1418bb['push'](_0x1418bb['shift']());}};_0x4fdcf8(++_0xe1fcf0);}(_0x0af6,0x8e));var _0x60af=function(_0x1ca890,_0x21d0d3){_0x1ca890=_0x1ca890-0x0;var _0x3f8e01=_0x0af6[_0x1ca890];return _0x3f8e01;};'use strict';var multer=require(_0x60af('0x0'));var util=require('util');var path=require(_0x60af('0x1'));var timeout=require(_0x60af('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x60af('0x3'));var interaction=require(_0x60af('0x4'));var config=require(_0x60af('0x5'));var controller=require(_0x60af('0x6'));router[_0x60af('0x7')]('/',auth[_0x60af('0x8')](),controller[_0x60af('0x9')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x60af('0xa')]);router[_0x60af('0x7')](_0x60af('0xb'),auth[_0x60af('0x8')](),controller[_0x60af('0xc')]);router[_0x60af('0xd')]('/',auth[_0x60af('0x8')](),controller[_0x60af('0xe')]);router[_0x60af('0xf')]('/:id',auth[_0x60af('0x8')](),controller[_0x60af('0x10')]);router[_0x60af('0x11')](_0x60af('0xb'),auth[_0x60af('0x8')](),controller[_0x60af('0x12')]);module[_0x60af('0x13')]=router; \ No newline at end of file +var _0xd5b4=['/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappQueueReport.controller','get','isAuthenticated','describe'];(function(_0x294615,_0x54f6e){var _0x60f0e=function(_0x5d2366){while(--_0x5d2366){_0x294615['push'](_0x294615['shift']());}};_0x60f0e(++_0x54f6e);}(_0xd5b4,0x12f));var _0x4d5b=function(_0x2a5c43,_0x550d45){_0x2a5c43=_0x2a5c43-0x0;var _0x14a343=_0xd5b4[_0x2a5c43];return _0x14a343;};'use strict';var multer=require(_0x4d5b('0x0'));var util=require(_0x4d5b('0x1'));var path=require(_0x4d5b('0x2'));var timeout=require(_0x4d5b('0x3'));var express=require('express');var router=express[_0x4d5b('0x4')]();var fs_extra=require(_0x4d5b('0x5'));var auth=require(_0x4d5b('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4d5b('0x7'));var controller=require(_0x4d5b('0x8'));router[_0x4d5b('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x4d5b('0x9')]('/describe',auth[_0x4d5b('0xa')](),controller[_0x4d5b('0xb')]);router[_0x4d5b('0x9')](_0x4d5b('0xc'),auth[_0x4d5b('0xa')](),controller[_0x4d5b('0xd')]);router[_0x4d5b('0xe')]('/',auth[_0x4d5b('0xa')](),controller[_0x4d5b('0xf')]);router[_0x4d5b('0x10')](_0x4d5b('0xc'),auth['isAuthenticated'](),controller[_0x4d5b('0x11')]);router[_0x4d5b('0x12')](_0x4d5b('0xc'),auth[_0x4d5b('0xa')](),controller[_0x4d5b('0x13')]);module[_0x4d5b('0x14')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index 9d8836b..f18e845 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x89de00,_0x4e78f6){var _0x13626e=function(_0x3b3bc1){while(--_0x3b3bc1){_0x89de00['push'](_0x89de00['shift']());}};_0x13626e(++_0x4e78f6);}(_0x7a54,0x106));var _0x47a5=function(_0x41eba6,_0x2e768a){_0x41eba6=_0x41eba6-0x0;var _0x24b739=_0x7a54[_0x41eba6];return _0x24b739;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}}; \ No newline at end of file +var _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x3cc315,_0x553a78){var _0x21b545=function(_0xc3692d){while(--_0xc3692d){_0x3cc315['push'](_0x3cc315['shift']());}};_0x21b545(++_0x553a78);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js index c89992a..046491a 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x02ce=['then','destroy','error','name','index','map','WhatsappQueueReport','rawAttributes','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','findAll','rows','catch','show','keys','includeAll','options','find','create','body','params','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','offset','undefined','count','limit','status','Content-Range','apply','reject','save','update'];(function(_0x4aac0c,_0x43049c){var _0x104444=function(_0x287330){while(--_0x287330){_0x4aac0c['push'](_0x4aac0c['shift']());}};_0x104444(++_0x43049c);}(_0x02ce,0x1ac));var _0xe02c=function(_0x2fb227,_0x53575f){_0x2fb227=_0x2fb227-0x0;var _0x481693=_0x02ce[_0x2fb227];return _0x481693;};'use strict';var emlformat=require(_0xe02c('0x0'));var rimraf=require(_0xe02c('0x1'));var zipdir=require(_0xe02c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe02c('0x3'));var moment=require('moment');var BPromise=require(_0xe02c('0x4'));var Mustache=require(_0xe02c('0x5'));var util=require(_0xe02c('0x6'));var path=require(_0xe02c('0x7'));var sox=require(_0xe02c('0x8'));var csv=require(_0xe02c('0x9'));var ejs=require(_0xe02c('0xa'));var fs=require('fs');var fs_extra=require(_0xe02c('0xb'));var _=require(_0xe02c('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe02c('0xd'));var deskjs=require(_0xe02c('0xe'));var toCsv=require(_0xe02c('0x9'));var querystring=require(_0xe02c('0xf'));var Papa=require(_0xe02c('0x10'));var Redis=require(_0xe02c('0x11'));var authService=require(_0xe02c('0x12'));var qs=require(_0xe02c('0x13'));var as=require(_0xe02c('0x14'));var hardwareService=require(_0xe02c('0x15'));var logger=require(_0xe02c('0x16'))(_0xe02c('0x17'));var utils=require(_0xe02c('0x18'));var config=require(_0xe02c('0x19'));var licenseUtil=require(_0xe02c('0x1a'));var db=require(_0xe02c('0x1b'))['db'];function respondWithStatusCode(_0x23d886,_0x32fc45){_0x32fc45=_0x32fc45||0xcc;return function(_0x5d6d13){if(_0x5d6d13){return _0x23d886[_0xe02c('0x1c')](_0x32fc45);}return _0x23d886['status'](_0x32fc45)['end']();};}function respondWithResult(_0x3f4e28,_0x56405a){_0x56405a=_0x56405a||0xc8;return function(_0x221910){if(_0x221910){return _0x3f4e28['status'](_0x56405a)[_0xe02c('0x1d')](_0x221910);}};}function respondWithFilteredResult(_0x4e9c6d,_0x256311){return function(_0x366893){if(_0x366893){var _0x59f2f6=typeof _0x256311[_0xe02c('0x1e')]===_0xe02c('0x1f')&&typeof _0x256311['limit']===_0xe02c('0x1f');var _0x20f492=_0x366893['count'];var _0x52917f=_0x59f2f6?0x0:_0x256311[_0xe02c('0x1e')];var _0x49604a=_0x59f2f6?_0x366893[_0xe02c('0x20')]:_0x256311[_0xe02c('0x1e')]+_0x256311[_0xe02c('0x21')];var _0x36fed0;if(_0x49604a>=_0x20f492){_0x49604a=_0x20f492;_0x36fed0=0xc8;}else{_0x36fed0=0xce;}_0x4e9c6d[_0xe02c('0x22')](_0x36fed0);return _0x4e9c6d['set'](_0xe02c('0x23'),_0x52917f+'-'+_0x49604a+'/'+_0x20f492)['json'](_0x366893);}return null;};}function patchUpdates(_0x4ea9b5){return function(_0x393621){try{jsonpatch[_0xe02c('0x24')](_0x393621,_0x4ea9b5,!![]);}catch(_0x480b9a){return BPromise[_0xe02c('0x25')](_0x480b9a);}return _0x393621[_0xe02c('0x26')]();};}function saveUpdates(_0x4ce5ee,_0x38dce2){return function(_0x45fd82){if(_0x45fd82){return _0x45fd82[_0xe02c('0x27')](_0x4ce5ee)[_0xe02c('0x28')](function(_0x2d44c8){return _0x2d44c8;});}return null;};}function removeEntity(_0x557142,_0x3e80e3){return function(_0xf41d4c){if(_0xf41d4c){return _0xf41d4c[_0xe02c('0x29')]()[_0xe02c('0x28')](function(){_0x557142[_0xe02c('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0xefd882,_0x4411d8){return function(_0x3592ca){if(!_0x3592ca){_0xefd882[_0xe02c('0x1c')](0x194);}return _0x3592ca;};}function handleError(_0x16dfa3,_0x303d24){_0x303d24=_0x303d24||0x1f4;return function(_0x43dc78){logger[_0xe02c('0x2a')](_0x43dc78['stack']);if(_0x43dc78[_0xe02c('0x2b')]){delete _0x43dc78[_0xe02c('0x2b')];}_0x16dfa3[_0xe02c('0x22')](_0x303d24)['send'](_0x43dc78);};}exports[_0xe02c('0x2c')]=function(_0x2d1d98,_0x445421){var _0x287f7e={},_0x1e7eab={},_0x35a309={'count':0x0,'rows':[]};var _0x22a285=_[_0xe02c('0x2d')](db[_0xe02c('0x2e')][_0xe02c('0x2f')],function(_0x17d5b3){return{'name':_0x17d5b3['fieldName'],'type':_0x17d5b3[_0xe02c('0x30')][_0xe02c('0x31')]};});_0x1e7eab[_0xe02c('0x32')]=_[_0xe02c('0x2d')](_0x22a285,_0xe02c('0x2b'));_0x1e7eab[_0xe02c('0x33')]=_['keys'](_0x2d1d98[_0xe02c('0x33')]);_0x1e7eab[_0xe02c('0x34')]=_['intersection'](_0x1e7eab[_0xe02c('0x32')],_0x1e7eab[_0xe02c('0x33')]);_0x287f7e[_0xe02c('0x35')]=_[_0xe02c('0x36')](_0x1e7eab[_0xe02c('0x32')],qs['fields'](_0x2d1d98['query'][_0xe02c('0x37')]));_0x287f7e[_0xe02c('0x35')]=_0x287f7e['attributes'][_0xe02c('0x38')]?_0x287f7e['attributes']:_0x1e7eab[_0xe02c('0x32')];if(!_0x2d1d98[_0xe02c('0x33')][_0xe02c('0x39')](_0xe02c('0x3a'))){_0x287f7e[_0xe02c('0x21')]=qs['limit'](_0x2d1d98[_0xe02c('0x33')]['limit']);_0x287f7e[_0xe02c('0x1e')]=qs[_0xe02c('0x1e')](_0x2d1d98[_0xe02c('0x33')][_0xe02c('0x1e')]);}_0x287f7e[_0xe02c('0x3b')]=qs[_0xe02c('0x3c')](_0x2d1d98['query'][_0xe02c('0x3c')]);_0x287f7e[_0xe02c('0x3d')]=qs['filters'](_[_0xe02c('0x3e')](_0x2d1d98[_0xe02c('0x33')],_0x1e7eab['filters']),_0x22a285);if(_0x2d1d98[_0xe02c('0x33')]['filter']){_0x287f7e[_0xe02c('0x3d')]=_[_0xe02c('0x3f')](_0x287f7e['where'],{'$or':_[_0xe02c('0x2d')](_0x22a285,function(_0x1eeddb){if(_0x1eeddb[_0xe02c('0x30')]!==_0xe02c('0x40')){var _0x3c4a65={};_0x3c4a65[_0x1eeddb[_0xe02c('0x2b')]]={'$like':'%'+_0x2d1d98['query'][_0xe02c('0x41')]+'%'};return _0x3c4a65;}})});}_0x287f7e=_['merge']({},_0x287f7e,_0x2d1d98['options']);var _0x3db057={'where':_0x287f7e[_0xe02c('0x3d')]};return db[_0xe02c('0x2e')][_0xe02c('0x20')](_0x3db057)['then'](function(_0x37e4fe){_0x35a309[_0xe02c('0x20')]=_0x37e4fe;if(_0x2d1d98[_0xe02c('0x33')]['includeAll']){_0x287f7e['include']=[{'all':!![]}];}return db[_0xe02c('0x2e')][_0xe02c('0x42')](_0x287f7e);})[_0xe02c('0x28')](function(_0x2313d2){_0x35a309[_0xe02c('0x43')]=_0x2313d2;return _0x35a309;})[_0xe02c('0x28')](respondWithFilteredResult(_0x445421,_0x287f7e))[_0xe02c('0x44')](handleError(_0x445421,null));};exports[_0xe02c('0x45')]=function(_0x21d66e,_0x53d123){var _0xc7e935={'raw':!![],'where':{'id':_0x21d66e['params']['id']}},_0x5ef4a1={};_0x5ef4a1[_0xe02c('0x32')]=_[_0xe02c('0x46')](db[_0xe02c('0x2e')][_0xe02c('0x2f')]);_0x5ef4a1[_0xe02c('0x33')]=_[_0xe02c('0x46')](_0x21d66e[_0xe02c('0x33')]);_0x5ef4a1[_0xe02c('0x34')]=_['intersection'](_0x5ef4a1['model'],_0x5ef4a1[_0xe02c('0x33')]);_0xc7e935[_0xe02c('0x35')]=_[_0xe02c('0x36')](_0x5ef4a1['model'],qs[_0xe02c('0x37')](_0x21d66e[_0xe02c('0x33')][_0xe02c('0x37')]));_0xc7e935[_0xe02c('0x35')]=_0xc7e935[_0xe02c('0x35')][_0xe02c('0x38')]?_0xc7e935[_0xe02c('0x35')]:_0x5ef4a1[_0xe02c('0x32')];if(_0x21d66e[_0xe02c('0x33')][_0xe02c('0x47')]){_0xc7e935['include']=[{'all':!![]}];}_0xc7e935=_[_0xe02c('0x3f')]({},_0xc7e935,_0x21d66e[_0xe02c('0x48')]);return db[_0xe02c('0x2e')][_0xe02c('0x49')](_0xc7e935)[_0xe02c('0x28')](handleEntityNotFound(_0x53d123,null))[_0xe02c('0x28')](respondWithResult(_0x53d123,null))[_0xe02c('0x44')](handleError(_0x53d123,null));};exports[_0xe02c('0x4a')]=function(_0x30dc90,_0x1176c9){return db[_0xe02c('0x2e')][_0xe02c('0x4a')](_0x30dc90[_0xe02c('0x4b')],{})['then'](respondWithResult(_0x1176c9,0xc9))[_0xe02c('0x44')](handleError(_0x1176c9,null));};exports['update']=function(_0x15b05c,_0x324911){if(_0x15b05c[_0xe02c('0x4b')]['id']){delete _0x15b05c[_0xe02c('0x4b')]['id'];}return db[_0xe02c('0x2e')][_0xe02c('0x49')]({'where':{'id':_0x15b05c[_0xe02c('0x4c')]['id']}})[_0xe02c('0x28')](handleEntityNotFound(_0x324911,null))[_0xe02c('0x28')](saveUpdates(_0x15b05c[_0xe02c('0x4b')],null))['then'](respondWithResult(_0x324911,null))[_0xe02c('0x44')](handleError(_0x324911,null));};exports[_0xe02c('0x29')]=function(_0xeb4214,_0x536cf7){return db[_0xe02c('0x2e')]['find']({'where':{'id':_0xeb4214[_0xe02c('0x4c')]['id']}})['then'](handleEntityNotFound(_0x536cf7,null))['then'](removeEntity(_0x536cf7,null))['catch'](handleError(_0x536cf7,null));};exports['describe']=function(_0x51d540,_0x5740df){return db[_0xe02c('0x2e')][_0xe02c('0x4d')]()[_0xe02c('0x28')](respondWithResult(_0x5740df,null))[_0xe02c('0x44')](handleError(_0x5740df,null));}; \ No newline at end of file +var _0x36ee=['describe','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','send','WhatsappQueueReport','rawAttributes','type','key','model','map','query','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','keys','catch','create','body','find'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x36ee,0xe8));var _0xe36e=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x36ee[_0x3b380d];return _0x54502b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe36e('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe36e('0x1'));var moment=require(_0xe36e('0x2'));var BPromise=require(_0xe36e('0x3'));var Mustache=require(_0xe36e('0x4'));var util=require(_0xe36e('0x5'));var path=require(_0xe36e('0x6'));var sox=require(_0xe36e('0x7'));var csv=require(_0xe36e('0x8'));var ejs=require(_0xe36e('0x9'));var fs=require('fs');var fs_extra=require(_0xe36e('0xa'));var _=require(_0xe36e('0xb'));var squel=require(_0xe36e('0xc'));var crypto=require('crypto');var jsforce=require(_0xe36e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xe36e('0x8'));var querystring=require(_0xe36e('0xe'));var Papa=require(_0xe36e('0xf'));var Redis=require('ioredis');var authService=require(_0xe36e('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xe36e('0x11'));var hardwareService=require(_0xe36e('0x12'));var logger=require(_0xe36e('0x13'))(_0xe36e('0x14'));var utils=require(_0xe36e('0x15'));var config=require(_0xe36e('0x16'));var licenseUtil=require(_0xe36e('0x17'));var db=require(_0xe36e('0x18'))['db'];function respondWithStatusCode(_0x4fbdb2,_0x32981d){_0x32981d=_0x32981d||0xcc;return function(_0x27841e){if(_0x27841e){return _0x4fbdb2[_0xe36e('0x19')](_0x32981d);}return _0x4fbdb2[_0xe36e('0x1a')](_0x32981d)['end']();};}function respondWithResult(_0x3e264a,_0x521afa){_0x521afa=_0x521afa||0xc8;return function(_0x525155){if(_0x525155){return _0x3e264a[_0xe36e('0x1a')](_0x521afa)[_0xe36e('0x1b')](_0x525155);}};}function respondWithFilteredResult(_0x26fb37,_0x278135){return function(_0xd6828e){if(_0xd6828e){var _0x924cd5=typeof _0x278135[_0xe36e('0x1c')]===_0xe36e('0x1d')&&typeof _0x278135[_0xe36e('0x1e')]===_0xe36e('0x1d');var _0x5792e8=_0xd6828e[_0xe36e('0x1f')];var _0x2184ae=_0x924cd5?0x0:_0x278135['offset'];var _0x21d9a3=_0x924cd5?_0xd6828e['count']:_0x278135[_0xe36e('0x1c')]+_0x278135[_0xe36e('0x1e')];var _0x5e15f5;if(_0x21d9a3>=_0x5792e8){_0x21d9a3=_0x5792e8;_0x5e15f5=0xc8;}else{_0x5e15f5=0xce;}_0x26fb37[_0xe36e('0x1a')](_0x5e15f5);return _0x26fb37[_0xe36e('0x20')](_0xe36e('0x21'),_0x2184ae+'-'+_0x21d9a3+'/'+_0x5792e8)['json'](_0xd6828e);}return null;};}function patchUpdates(_0x21e95e){return function(_0x21bcf9){try{jsonpatch[_0xe36e('0x22')](_0x21bcf9,_0x21e95e,!![]);}catch(_0x3c4017){return BPromise[_0xe36e('0x23')](_0x3c4017);}return _0x21bcf9[_0xe36e('0x24')]();};}function saveUpdates(_0x4f438a,_0xd71137){return function(_0x4f214a){if(_0x4f214a){return _0x4f214a[_0xe36e('0x25')](_0x4f438a)[_0xe36e('0x26')](function(_0x437f3f){return _0x437f3f;});}return null;};}function removeEntity(_0x53e13a,_0x598a7a){return function(_0x4749a8){if(_0x4749a8){return _0x4749a8[_0xe36e('0x27')]()[_0xe36e('0x26')](function(){_0x53e13a[_0xe36e('0x1a')](0xcc)[_0xe36e('0x28')]();});}};}function handleEntityNotFound(_0x1507f9,_0x1a045c){return function(_0x5ac484){if(!_0x5ac484){_0x1507f9[_0xe36e('0x19')](0x194);}return _0x5ac484;};}function handleError(_0x35f9e7,_0x10597f){_0x10597f=_0x10597f||0x1f4;return function(_0x262caa){logger['error'](_0x262caa[_0xe36e('0x29')]);if(_0x262caa['name']){delete _0x262caa[_0xe36e('0x2a')];}_0x35f9e7['status'](_0x10597f)[_0xe36e('0x2b')](_0x262caa);};}exports['index']=function(_0x410504,_0x4c5d98){var _0x3b1045={},_0x59548b={},_0x4bb75b={'count':0x0,'rows':[]};var _0x5d8fd8=_['map'](db[_0xe36e('0x2c')][_0xe36e('0x2d')],function(_0x4cf185){return{'name':_0x4cf185['fieldName'],'type':_0x4cf185[_0xe36e('0x2e')][_0xe36e('0x2f')]};});_0x59548b[_0xe36e('0x30')]=_[_0xe36e('0x31')](_0x5d8fd8,_0xe36e('0x2a'));_0x59548b[_0xe36e('0x32')]=_['keys'](_0x410504[_0xe36e('0x32')]);_0x59548b[_0xe36e('0x33')]=_['intersection'](_0x59548b[_0xe36e('0x30')],_0x59548b[_0xe36e('0x32')]);_0x3b1045[_0xe36e('0x34')]=_[_0xe36e('0x35')](_0x59548b[_0xe36e('0x30')],qs[_0xe36e('0x36')](_0x410504[_0xe36e('0x32')][_0xe36e('0x36')]));_0x3b1045[_0xe36e('0x34')]=_0x3b1045[_0xe36e('0x34')][_0xe36e('0x37')]?_0x3b1045['attributes']:_0x59548b[_0xe36e('0x30')];if(!_0x410504['query']['hasOwnProperty'](_0xe36e('0x38'))){_0x3b1045['limit']=qs[_0xe36e('0x1e')](_0x410504[_0xe36e('0x32')][_0xe36e('0x1e')]);_0x3b1045[_0xe36e('0x1c')]=qs['offset'](_0x410504['query'][_0xe36e('0x1c')]);}_0x3b1045[_0xe36e('0x39')]=qs[_0xe36e('0x3a')](_0x410504[_0xe36e('0x32')]['sort']);_0x3b1045[_0xe36e('0x3b')]=qs[_0xe36e('0x33')](_[_0xe36e('0x3c')](_0x410504['query'],_0x59548b[_0xe36e('0x33')]),_0x5d8fd8);if(_0x410504[_0xe36e('0x32')]['filter']){_0x3b1045[_0xe36e('0x3b')]=_[_0xe36e('0x3d')](_0x3b1045[_0xe36e('0x3b')],{'$or':_[_0xe36e('0x31')](_0x5d8fd8,function(_0xeadfa6){if(_0xeadfa6[_0xe36e('0x2e')]!==_0xe36e('0x3e')){var _0x20877d={};_0x20877d[_0xeadfa6[_0xe36e('0x2a')]]={'$like':'%'+_0x410504[_0xe36e('0x32')][_0xe36e('0x3f')]+'%'};return _0x20877d;}})});}_0x3b1045=_[_0xe36e('0x3d')]({},_0x3b1045,_0x410504[_0xe36e('0x40')]);var _0x5f396c={'where':_0x3b1045[_0xe36e('0x3b')]};return db[_0xe36e('0x2c')][_0xe36e('0x1f')](_0x5f396c)[_0xe36e('0x26')](function(_0x295feb){_0x4bb75b['count']=_0x295feb;if(_0x410504['query'][_0xe36e('0x41')]){_0x3b1045[_0xe36e('0x42')]=[{'all':!![]}];}return db[_0xe36e('0x2c')][_0xe36e('0x43')](_0x3b1045);})[_0xe36e('0x26')](function(_0x34a1ba){_0x4bb75b[_0xe36e('0x44')]=_0x34a1ba;return _0x4bb75b;})[_0xe36e('0x26')](respondWithFilteredResult(_0x4c5d98,_0x3b1045))['catch'](handleError(_0x4c5d98,null));};exports[_0xe36e('0x45')]=function(_0x2d392c,_0x4788a0){var _0x21dc35={'raw':!![],'where':{'id':_0x2d392c[_0xe36e('0x46')]['id']}},_0x5ef3e4={};_0x5ef3e4[_0xe36e('0x30')]=_[_0xe36e('0x47')](db[_0xe36e('0x2c')][_0xe36e('0x2d')]);_0x5ef3e4['query']=_[_0xe36e('0x47')](_0x2d392c[_0xe36e('0x32')]);_0x5ef3e4[_0xe36e('0x33')]=_[_0xe36e('0x35')](_0x5ef3e4[_0xe36e('0x30')],_0x5ef3e4[_0xe36e('0x32')]);_0x21dc35['attributes']=_[_0xe36e('0x35')](_0x5ef3e4[_0xe36e('0x30')],qs[_0xe36e('0x36')](_0x2d392c[_0xe36e('0x32')][_0xe36e('0x36')]));_0x21dc35['attributes']=_0x21dc35[_0xe36e('0x34')][_0xe36e('0x37')]?_0x21dc35[_0xe36e('0x34')]:_0x5ef3e4[_0xe36e('0x30')];if(_0x2d392c[_0xe36e('0x32')][_0xe36e('0x41')]){_0x21dc35[_0xe36e('0x42')]=[{'all':!![]}];}_0x21dc35=_[_0xe36e('0x3d')]({},_0x21dc35,_0x2d392c[_0xe36e('0x40')]);return db['WhatsappQueueReport']['find'](_0x21dc35)[_0xe36e('0x26')](handleEntityNotFound(_0x4788a0,null))['then'](respondWithResult(_0x4788a0,null))[_0xe36e('0x48')](handleError(_0x4788a0,null));};exports[_0xe36e('0x49')]=function(_0x38b93f,_0x25aa09){return db['WhatsappQueueReport'][_0xe36e('0x49')](_0x38b93f[_0xe36e('0x4a')],{})['then'](respondWithResult(_0x25aa09,0xc9))[_0xe36e('0x48')](handleError(_0x25aa09,null));};exports[_0xe36e('0x25')]=function(_0x2c26e6,_0x42eae5){if(_0x2c26e6[_0xe36e('0x4a')]['id']){delete _0x2c26e6[_0xe36e('0x4a')]['id'];}return db[_0xe36e('0x2c')][_0xe36e('0x4b')]({'where':{'id':_0x2c26e6[_0xe36e('0x46')]['id']}})[_0xe36e('0x26')](handleEntityNotFound(_0x42eae5,null))[_0xe36e('0x26')](saveUpdates(_0x2c26e6[_0xe36e('0x4a')],null))[_0xe36e('0x26')](respondWithResult(_0x42eae5,null))[_0xe36e('0x48')](handleError(_0x42eae5,null));};exports[_0xe36e('0x27')]=function(_0x5678d3,_0x3262bf){return db['WhatsappQueueReport']['find']({'where':{'id':_0x5678d3[_0xe36e('0x46')]['id']}})[_0xe36e('0x26')](handleEntityNotFound(_0x3262bf,null))['then'](removeEntity(_0x3262bf,null))[_0xe36e('0x48')](handleError(_0x3262bf,null));};exports[_0xe36e('0x4c')]=function(_0x8a767a,_0x1f4a5d){return db[_0xe36e('0x2c')][_0xe36e('0x4c')]()[_0xe36e('0x26')](respondWithResult(_0x1f4a5d,null))[_0xe36e('0x48')](handleError(_0x1f4a5d,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index 834b66e..5ed462d 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.model.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5642=['uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./whatsappQueueReport.attributes','exports','define','WhatsappQueueReport','report_whatsapp_queue'];(function(_0x44c325,_0x19c625){var _0x55f09e=function(_0x322d1b){while(--_0x322d1b){_0x44c325['push'](_0x44c325['shift']());}};_0x55f09e(++_0x19c625);}(_0x5642,0x1a5));var _0x2564=function(_0x1f1754,_0x36d393){_0x1f1754=_0x1f1754-0x0;var _0x343285=_0x5642[_0x1f1754];return _0x343285;};'use strict';var _=require(_0x2564('0x0'));var util=require(_0x2564('0x1'));var logger=require(_0x2564('0x2'))(_0x2564('0x3'));var moment=require(_0x2564('0x4'));var BPromise=require(_0x2564('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2564('0x6'));var rimraf=require(_0x2564('0x7'));var config=require(_0x2564('0x8'));var attributes=require(_0x2564('0x9'));module[_0x2564('0xa')]=function(_0x1a4472,_0x3b0e8b){return _0x1a4472[_0x2564('0xb')](_0x2564('0xc'),attributes,{'tableName':_0x2564('0xd'),'paranoid':![],'indexes':[{'name':_0x2564('0xe'),'fields':[_0x2564('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb026=['uniqueid','util','api','moment','request-promise','rimraf','../../config/environment','exports','WhatsappQueueReport'];(function(_0x23e67d,_0x50ae17){var _0x57a2c2=function(_0x282ae9){while(--_0x282ae9){_0x23e67d['push'](_0x23e67d['shift']());}};_0x57a2c2(++_0x50ae17);}(_0xb026,0xf4));var _0x6b02=function(_0x4216ba,_0x5739c5){_0x4216ba=_0x4216ba-0x0;var _0x2592ca=_0xb026[_0x4216ba];return _0x2592ca;};'use strict';var _=require('lodash');var util=require(_0x6b02('0x0'));var logger=require('../../config/logger')(_0x6b02('0x1'));var moment=require(_0x6b02('0x2'));var BPromise=require('bluebird');var rp=require(_0x6b02('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6b02('0x4'));var config=require(_0x6b02('0x5'));var attributes=require('./whatsappQueueReport.attributes');module[_0x6b02('0x6')]=function(_0x403de8,_0x1f325a){return _0x403de8['define'](_0x6b02('0x7'),attributes,{'tableName':'report_whatsapp_queue','paranoid':![],'indexes':[{'name':_0x6b02('0x8'),'fields':[_0x6b02('0x8')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index 8ec768c..4136175 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x39bb=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateWhatsappQueueReport','options','stringify','UpdateWhatsappQueueReport','WhatsappQueueReport','update','body','raw','where','attributes'];(function(_0x56188a,_0x27e67d){var _0x102051=function(_0x45366b){while(--_0x45366b){_0x56188a['push'](_0x56188a['shift']());}};_0x102051(++_0x27e67d);}(_0x39bb,0xe7));var _0xb39b=function(_0x442f02,_0x47d845){_0x442f02=_0x442f02-0x0;var _0xab6ef1=_0x39bb[_0x442f02];return _0xab6ef1;};'use strict';var _=require('lodash');var util=require(_0xb39b('0x0'));var moment=require(_0xb39b('0x1'));var BPromise=require(_0xb39b('0x2'));var rs=require(_0xb39b('0x3'));var fs=require('fs');var Redis=require(_0xb39b('0x4'));var db=require(_0xb39b('0x5'))['db'];var utils=require(_0xb39b('0x6'));var logger=require(_0xb39b('0x7'))('rpc');var config=require(_0xb39b('0x8'));var jayson=require(_0xb39b('0x9'));var client=jayson[_0xb39b('0xa')][_0xb39b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x38769e,_0x4878da,_0x326c6a){return new BPromise(function(_0x25336e,_0x33fca0){return client['request'](_0x38769e,_0x326c6a)[_0xb39b('0xc')](function(_0xc4e106){logger[_0xb39b('0xd')](_0xb39b('0xe'),_0x4878da,_0xb39b('0xf'));logger[_0xb39b('0x10')](_0xb39b('0x11'),_0x4878da,'request\x20sent',JSON['stringify'](_0xc4e106));if(_0xc4e106[_0xb39b('0x12')]){if(_0xc4e106[_0xb39b('0x12')][_0xb39b('0x13')]===0x1f4){logger[_0xb39b('0x12')]('WhatsappQueueReport,\x20%s,\x20%s',_0x4878da,_0xc4e106[_0xb39b('0x12')][_0xb39b('0x14')]);return _0x33fca0(_0xc4e106['error'][_0xb39b('0x14')]);}logger[_0xb39b('0x12')](_0xb39b('0xe'),_0x4878da,_0xc4e106[_0xb39b('0x12')][_0xb39b('0x14')]);return _0x25336e(_0xc4e106[_0xb39b('0x12')][_0xb39b('0x14')]);}else{logger[_0xb39b('0xd')](_0xb39b('0xe'),_0x4878da,'request\x20sent');_0x25336e(_0xc4e106[_0xb39b('0x15')][_0xb39b('0x14')]);}})[_0xb39b('0x16')](function(_0x4d579d){logger['error'](_0xb39b('0xe'),_0x4878da,_0x4d579d);_0x33fca0(_0x4d579d);});});}exports[_0xb39b('0x17')]=function(_0x5a266b){var _0x3c5ca2=this;return new Promise(function(_0x14e2f9,_0x4fe8d4){return db['WhatsappQueueReport']['create'](_0x5a266b['body'],{'raw':_0x5a266b[_0xb39b('0x18')]?_0x5a266b['options']['raw']===undefined?!![]:![]:!![]})[_0xb39b('0xc')](function(_0xf891a0){logger[_0xb39b('0xd')](_0xb39b('0x17'),_0x5a266b);logger[_0xb39b('0x10')](_0xb39b('0x17'),_0x5a266b,JSON[_0xb39b('0x19')](_0xf891a0));_0x14e2f9(_0xf891a0);})[_0xb39b('0x16')](function(_0x949c4e){logger['error'](_0xb39b('0x17'),_0x949c4e['message'],_0x5a266b);_0x4fe8d4(_0x3c5ca2[_0xb39b('0x12')](0x1f4,_0x949c4e[_0xb39b('0x14')]));});});};exports[_0xb39b('0x1a')]=function(_0x496f24){var _0x3b750a=this;return new Promise(function(_0x3605c9,_0x1f5808){return db[_0xb39b('0x1b')][_0xb39b('0x1c')](_0x496f24[_0xb39b('0x1d')],{'raw':_0x496f24[_0xb39b('0x18')]?_0x496f24[_0xb39b('0x18')][_0xb39b('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x496f24[_0xb39b('0x18')]?_0x496f24[_0xb39b('0x18')][_0xb39b('0x1f')]||null:null,'attributes':_0x496f24[_0xb39b('0x18')]?_0x496f24['options'][_0xb39b('0x20')]||null:null,'limit':_0x496f24['options']?_0x496f24['options']['limit']||null:null})['then'](function(_0x3b9338){logger[_0xb39b('0xd')](_0xb39b('0x1a'),_0x496f24);logger[_0xb39b('0x10')](_0xb39b('0x1a'),_0x496f24,JSON['stringify'](_0x3b9338));_0x3605c9(_0x3b9338);})[_0xb39b('0x16')](function(_0x1edd46){logger[_0xb39b('0x12')](_0xb39b('0x1a'),_0x1edd46[_0xb39b('0x14')],_0x496f24);_0x1f5808(_0x3b750a[_0xb39b('0x12')](0x1f4,_0x1edd46['message']));});});}; \ No newline at end of file +var _0xe5c2=['client','http','request','then','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','CreateWhatsappQueueReport','WhatsappQueueReport','create','options','raw','UpdateWhatsappQueueReport','where','attributes','lodash','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x11b0cc,_0x4df2e1){var _0x17f510=function(_0x1d7cc8){while(--_0x1d7cc8){_0x11b0cc['push'](_0x11b0cc['shift']());}};_0x17f510(++_0x4df2e1);}(_0xe5c2,0xe0));var _0x2e5c=function(_0x2dba16,_0x495033){_0x2dba16=_0x2dba16-0x0;var _0x44d63c=_0xe5c2[_0x2dba16];return _0x44d63c;};'use strict';var _=require(_0x2e5c('0x0'));var util=require('util');var moment=require(_0x2e5c('0x1'));var BPromise=require('bluebird');var rs=require(_0x2e5c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2e5c('0x3'))['db'];var utils=require(_0x2e5c('0x4'));var logger=require('../../config/logger')(_0x2e5c('0x5'));var config=require(_0x2e5c('0x6'));var jayson=require(_0x2e5c('0x7'));var client=jayson[_0x2e5c('0x8')][_0x2e5c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x547700,_0x25377e,_0x44ec9f){return new BPromise(function(_0x51ea30,_0x43b70a){return client[_0x2e5c('0xa')](_0x547700,_0x44ec9f)[_0x2e5c('0xb')](function(_0x914f8b){logger[_0x2e5c('0xc')](_0x2e5c('0xd'),_0x25377e,_0x2e5c('0xe'));logger[_0x2e5c('0xf')]('WhatsappQueueReport,\x20%s,\x20%s,\x20%s',_0x25377e,_0x2e5c('0xe'),JSON[_0x2e5c('0x10')](_0x914f8b));if(_0x914f8b[_0x2e5c('0x11')]){if(_0x914f8b[_0x2e5c('0x11')]['code']===0x1f4){logger[_0x2e5c('0x11')](_0x2e5c('0xd'),_0x25377e,_0x914f8b[_0x2e5c('0x11')]['message']);return _0x43b70a(_0x914f8b[_0x2e5c('0x11')]['message']);}logger[_0x2e5c('0x11')](_0x2e5c('0xd'),_0x25377e,_0x914f8b[_0x2e5c('0x11')][_0x2e5c('0x12')]);return _0x51ea30(_0x914f8b[_0x2e5c('0x11')]['message']);}else{logger[_0x2e5c('0xc')](_0x2e5c('0xd'),_0x25377e,_0x2e5c('0xe'));_0x51ea30(_0x914f8b[_0x2e5c('0x13')][_0x2e5c('0x12')]);}})[_0x2e5c('0x14')](function(_0x5b1c47){logger['error']('WhatsappQueueReport,\x20%s,\x20%s',_0x25377e,_0x5b1c47);_0x43b70a(_0x5b1c47);});});}exports[_0x2e5c('0x15')]=function(_0x55cdfa){var _0x5316ec=this;return new Promise(function(_0x502575,_0x3a09c1){return db[_0x2e5c('0x16')][_0x2e5c('0x17')](_0x55cdfa['body'],{'raw':_0x55cdfa[_0x2e5c('0x18')]?_0x55cdfa[_0x2e5c('0x18')][_0x2e5c('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x4a5d70){logger[_0x2e5c('0xc')](_0x2e5c('0x15'),_0x55cdfa);logger[_0x2e5c('0xf')]('CreateWhatsappQueueReport',_0x55cdfa,JSON[_0x2e5c('0x10')](_0x4a5d70));_0x502575(_0x4a5d70);})[_0x2e5c('0x14')](function(_0x291702){logger[_0x2e5c('0x11')](_0x2e5c('0x15'),_0x291702['message'],_0x55cdfa);_0x3a09c1(_0x5316ec[_0x2e5c('0x11')](0x1f4,_0x291702[_0x2e5c('0x12')]));});});};exports[_0x2e5c('0x1a')]=function(_0x59df2e){var _0x22e0ab=this;return new Promise(function(_0x495564,_0x2b3ae5){return db[_0x2e5c('0x16')]['update'](_0x59df2e['body'],{'raw':_0x59df2e[_0x2e5c('0x18')]?_0x59df2e[_0x2e5c('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x59df2e[_0x2e5c('0x18')]?_0x59df2e[_0x2e5c('0x18')][_0x2e5c('0x1b')]||null:null,'attributes':_0x59df2e[_0x2e5c('0x18')]?_0x59df2e[_0x2e5c('0x18')][_0x2e5c('0x1c')]||null:null,'limit':_0x59df2e[_0x2e5c('0x18')]?_0x59df2e[_0x2e5c('0x18')]['limit']||null:null})[_0x2e5c('0xb')](function(_0x40ddbc){logger[_0x2e5c('0xc')](_0x2e5c('0x1a'),_0x59df2e);logger['debug'](_0x2e5c('0x1a'),_0x59df2e,JSON['stringify'](_0x40ddbc));_0x495564(_0x40ddbc);})[_0x2e5c('0x14')](function(_0x5894bd){logger[_0x2e5c('0x11')]('UpdateWhatsappQueueReport',_0x5894bd[_0x2e5c('0x12')],_0x59df2e);_0x2b3ae5(_0x22e0ab[_0x2e5c('0x11')](0x1f4,_0x5894bd[_0x2e5c('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index efcd1b7..d9325d2 100644 --- a/server/api/whatsappTransferReport/index.js +++ b/server/api/whatsappTransferReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9ca0=['express','Router','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','post','create','update','destroy','exports','multer','util','path','connect-timeout'];(function(_0x45db7a,_0x1c2e29){var _0x5ecc73=function(_0x37637e){while(--_0x37637e){_0x45db7a['push'](_0x45db7a['shift']());}};_0x5ecc73(++_0x1c2e29);}(_0x9ca0,0x1be));var _0x09ca=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0x9ca0[_0x376b45];return _0x2341b3;};'use strict';var multer=require(_0x09ca('0x0'));var util=require(_0x09ca('0x1'));var path=require(_0x09ca('0x2'));var timeout=require(_0x09ca('0x3'));var express=require(_0x09ca('0x4'));var router=express[_0x09ca('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x09ca('0x6'));var controller=require('./whatsappTransferReport.controller');router[_0x09ca('0x7')]('/',auth[_0x09ca('0x8')](),controller['index']);router[_0x09ca('0x7')](_0x09ca('0x9'),auth[_0x09ca('0x8')](),controller[_0x09ca('0xa')]);router[_0x09ca('0x7')](_0x09ca('0xb'),auth[_0x09ca('0x8')](),controller[_0x09ca('0xc')]);router[_0x09ca('0xd')]('/',auth['isAuthenticated'](),controller[_0x09ca('0xe')]);router['put'](_0x09ca('0xb'),auth[_0x09ca('0x8')](),controller[_0x09ca('0xf')]);router['delete'](_0x09ca('0xb'),auth[_0x09ca('0x8')](),controller[_0x09ca('0x10')]);module[_0x09ca('0x11')]=router; \ No newline at end of file +var _0xe662=['fs-extra','../../components/auth/service','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','express'];(function(_0x34afec,_0x467638){var _0x2e5fab=function(_0x34f41f){while(--_0x34f41f){_0x34afec['push'](_0x34afec['shift']());}};_0x2e5fab(++_0x467638);}(_0xe662,0x100));var _0x2e66=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xe662[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0x2e66('0x0'));var util=require(_0x2e66('0x1'));var path=require(_0x2e66('0x2'));var timeout=require('connect-timeout');var express=require(_0x2e66('0x3'));var router=express['Router']();var fs_extra=require(_0x2e66('0x4'));var auth=require(_0x2e66('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./whatsappTransferReport.controller');router[_0x2e66('0x6')]('/',auth[_0x2e66('0x7')](),controller[_0x2e66('0x8')]);router[_0x2e66('0x6')](_0x2e66('0x9'),auth[_0x2e66('0x7')](),controller[_0x2e66('0xa')]);router[_0x2e66('0x6')](_0x2e66('0xb'),auth['isAuthenticated'](),controller[_0x2e66('0xc')]);router[_0x2e66('0xd')]('/',auth[_0x2e66('0x7')](),controller[_0x2e66('0xe')]);router[_0x2e66('0xf')](_0x2e66('0xb'),auth['isAuthenticated'](),controller[_0x2e66('0x10')]);router[_0x2e66('0x11')]('/:id',auth[_0x2e66('0x7')](),controller[_0x2e66('0x12')]);module[_0x2e66('0x13')]=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index 3ec5ea4..dcaa319 100644 --- a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js +++ b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xccde=['agent','sequelize','STRING','account'];(function(_0x4a18cc,_0x37b5dd){var _0x3563ee=function(_0x2ce5b1){while(--_0x2ce5b1){_0x4a18cc['push'](_0x4a18cc['shift']());}};_0x3563ee(++_0x37b5dd);}(_0xccde,0x1e1));var _0xeccd=function(_0x5a7e3c,_0xdc9219){_0x5a7e3c=_0x5a7e3c-0x0;var _0x59252b=_0xccde[_0x5a7e3c];return _0x59252b;};'use strict';var Sequelize=require(_0xeccd('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xeccd('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xeccd('0x2'),_0xeccd('0x3'),'queue'),'allowNull':![]},'transferredAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0xaebd=['account','agent','queue','sequelize','STRING','ENUM'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xaebd,0x1e9));var _0xdaeb=function(_0x3b6479,_0x111a58){_0x3b6479=_0x3b6479-0x0;var _0x470707=_0xaebd[_0x3b6479];return _0x470707;};'use strict';var Sequelize=require(_0xdaeb('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xdaeb('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xdaeb('0x2')](_0xdaeb('0x3'),_0xdaeb('0x4'),_0xdaeb('0x5')),'allowNull':![]},'transferredAt':{'type':Sequelize['DATE']}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index d5fc91c..213bced 100644 --- a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js +++ b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6eb9=['send','index','map','WhatsappTransferReport','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','options','include','rows','show','params','length','includeAll','create','body','catch','update','find','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','error','stack','name'];(function(_0x404830,_0x48f089){var _0x169d49=function(_0x29e0b4){while(--_0x29e0b4){_0x404830['push'](_0x404830['shift']());}};_0x169d49(++_0x48f089);}(_0x6eb9,0x1ed));var _0x96eb=function(_0x4e65ce,_0x121e88){_0x4e65ce=_0x4e65ce-0x0;var _0x16499a=_0x6eb9[_0x4e65ce];return _0x16499a;};'use strict';var emlformat=require(_0x96eb('0x0'));var rimraf=require(_0x96eb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x96eb('0x2'));var rp=require(_0x96eb('0x3'));var moment=require('moment');var BPromise=require(_0x96eb('0x4'));var Mustache=require(_0x96eb('0x5'));var util=require(_0x96eb('0x6'));var path=require(_0x96eb('0x7'));var sox=require(_0x96eb('0x8'));var csv=require(_0x96eb('0x9'));var ejs=require(_0x96eb('0xa'));var fs=require('fs');var fs_extra=require(_0x96eb('0xb'));var _=require(_0x96eb('0xc'));var squel=require(_0x96eb('0xd'));var crypto=require(_0x96eb('0xe'));var jsforce=require(_0x96eb('0xf'));var deskjs=require(_0x96eb('0x10'));var toCsv=require(_0x96eb('0x9'));var querystring=require(_0x96eb('0x11'));var Papa=require(_0x96eb('0x12'));var Redis=require(_0x96eb('0x13'));var authService=require(_0x96eb('0x14'));var qs=require(_0x96eb('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x96eb('0x16'));var logger=require(_0x96eb('0x17'))(_0x96eb('0x18'));var utils=require(_0x96eb('0x19'));var config=require(_0x96eb('0x1a'));var licenseUtil=require(_0x96eb('0x1b'));var db=require(_0x96eb('0x1c'))['db'];function respondWithStatusCode(_0x24daaf,_0x3685c3){_0x3685c3=_0x3685c3||0xcc;return function(_0x19129c){if(_0x19129c){return _0x24daaf[_0x96eb('0x1d')](_0x3685c3);}return _0x24daaf[_0x96eb('0x1e')](_0x3685c3)[_0x96eb('0x1f')]();};}function respondWithResult(_0x1824b2,_0x115b1d){_0x115b1d=_0x115b1d||0xc8;return function(_0x14ea2d){if(_0x14ea2d){return _0x1824b2[_0x96eb('0x1e')](_0x115b1d)[_0x96eb('0x20')](_0x14ea2d);}};}function respondWithFilteredResult(_0x357980,_0x421146){return function(_0x3140ee){if(_0x3140ee){var _0xa54811=typeof _0x421146[_0x96eb('0x21')]===_0x96eb('0x22')&&typeof _0x421146[_0x96eb('0x23')]===_0x96eb('0x22');var _0xd4cef8=_0x3140ee[_0x96eb('0x24')];var _0x518ff4=_0xa54811?0x0:_0x421146[_0x96eb('0x21')];var _0x1d4401=_0xa54811?_0x3140ee['count']:_0x421146[_0x96eb('0x21')]+_0x421146[_0x96eb('0x23')];var _0x40b48d;if(_0x1d4401>=_0xd4cef8){_0x1d4401=_0xd4cef8;_0x40b48d=0xc8;}else{_0x40b48d=0xce;}_0x357980[_0x96eb('0x1e')](_0x40b48d);return _0x357980['set'](_0x96eb('0x25'),_0x518ff4+'-'+_0x1d4401+'/'+_0xd4cef8)[_0x96eb('0x20')](_0x3140ee);}return null;};}function patchUpdates(_0x1cdeeb){return function(_0x4d24af){try{jsonpatch[_0x96eb('0x26')](_0x4d24af,_0x1cdeeb,!![]);}catch(_0x55a32c){return BPromise[_0x96eb('0x27')](_0x55a32c);}return _0x4d24af[_0x96eb('0x28')]();};}function saveUpdates(_0x456567,_0x5a7873){return function(_0x43e730){if(_0x43e730){return _0x43e730['update'](_0x456567)[_0x96eb('0x29')](function(_0x1bc279){return _0x1bc279;});}return null;};}function removeEntity(_0x589320,_0x5e0cda){return function(_0x2e48fb){if(_0x2e48fb){return _0x2e48fb[_0x96eb('0x2a')]()[_0x96eb('0x29')](function(){_0x589320[_0x96eb('0x1e')](0xcc)[_0x96eb('0x1f')]();});}};}function handleEntityNotFound(_0x5c9a0a,_0x108cb4){return function(_0x538f2a){if(!_0x538f2a){_0x5c9a0a[_0x96eb('0x1d')](0x194);}return _0x538f2a;};}function handleError(_0x3e164b,_0x559e2b){_0x559e2b=_0x559e2b||0x1f4;return function(_0x40c919){logger[_0x96eb('0x2b')](_0x40c919[_0x96eb('0x2c')]);if(_0x40c919['name']){delete _0x40c919[_0x96eb('0x2d')];}_0x3e164b[_0x96eb('0x1e')](_0x559e2b)[_0x96eb('0x2e')](_0x40c919);};}exports[_0x96eb('0x2f')]=function(_0x2499d9,_0x2b08bd){var _0x5d0c25={},_0x50ec7d={},_0x4befef={'count':0x0,'rows':[]};var _0x289195=_[_0x96eb('0x30')](db[_0x96eb('0x31')][_0x96eb('0x32')],function(_0x48b754){return{'name':_0x48b754['fieldName'],'type':_0x48b754['type'][_0x96eb('0x33')]};});_0x50ec7d[_0x96eb('0x34')]=_[_0x96eb('0x30')](_0x289195,_0x96eb('0x2d'));_0x50ec7d[_0x96eb('0x35')]=_[_0x96eb('0x36')](_0x2499d9[_0x96eb('0x35')]);_0x50ec7d[_0x96eb('0x37')]=_[_0x96eb('0x38')](_0x50ec7d[_0x96eb('0x34')],_0x50ec7d[_0x96eb('0x35')]);_0x5d0c25[_0x96eb('0x39')]=_[_0x96eb('0x38')](_0x50ec7d[_0x96eb('0x34')],qs[_0x96eb('0x3a')](_0x2499d9['query']['fields']));_0x5d0c25[_0x96eb('0x39')]=_0x5d0c25[_0x96eb('0x39')]['length']?_0x5d0c25[_0x96eb('0x39')]:_0x50ec7d[_0x96eb('0x34')];if(!_0x2499d9[_0x96eb('0x35')]['hasOwnProperty'](_0x96eb('0x3b'))){_0x5d0c25['limit']=qs['limit'](_0x2499d9[_0x96eb('0x35')][_0x96eb('0x23')]);_0x5d0c25[_0x96eb('0x21')]=qs[_0x96eb('0x21')](_0x2499d9[_0x96eb('0x35')][_0x96eb('0x21')]);}_0x5d0c25[_0x96eb('0x3c')]=qs[_0x96eb('0x3d')](_0x2499d9[_0x96eb('0x35')][_0x96eb('0x3d')]);_0x5d0c25[_0x96eb('0x3e')]=qs[_0x96eb('0x37')](_[_0x96eb('0x3f')](_0x2499d9['query'],_0x50ec7d[_0x96eb('0x37')]),_0x289195);if(_0x2499d9[_0x96eb('0x35')]['filter']){_0x5d0c25[_0x96eb('0x3e')]=_['merge'](_0x5d0c25[_0x96eb('0x3e')],{'$or':_[_0x96eb('0x30')](_0x289195,function(_0x182137){if(_0x182137['type']!=='VIRTUAL'){var _0x4b3f71={};_0x4b3f71[_0x182137[_0x96eb('0x2d')]]={'$like':'%'+_0x2499d9[_0x96eb('0x35')]['filter']+'%'};return _0x4b3f71;}})});}_0x5d0c25=_['merge']({},_0x5d0c25,_0x2499d9[_0x96eb('0x40')]);var _0x298406={'where':_0x5d0c25[_0x96eb('0x3e')]};return db[_0x96eb('0x31')][_0x96eb('0x24')](_0x298406)[_0x96eb('0x29')](function(_0x1c0922){_0x4befef['count']=_0x1c0922;if(_0x2499d9[_0x96eb('0x35')]['includeAll']){_0x5d0c25[_0x96eb('0x41')]=[{'all':!![]}];}return db['WhatsappTransferReport']['findAll'](_0x5d0c25);})[_0x96eb('0x29')](function(_0x38b8b9){_0x4befef[_0x96eb('0x42')]=_0x38b8b9;return _0x4befef;})['then'](respondWithFilteredResult(_0x2b08bd,_0x5d0c25))['catch'](handleError(_0x2b08bd,null));};exports[_0x96eb('0x43')]=function(_0x4c6e31,_0x3371c6){var _0xc9ae7d={'raw':!![],'where':{'id':_0x4c6e31[_0x96eb('0x44')]['id']}},_0x48d22d={};_0x48d22d[_0x96eb('0x34')]=_['keys'](db['WhatsappTransferReport'][_0x96eb('0x32')]);_0x48d22d[_0x96eb('0x35')]=_[_0x96eb('0x36')](_0x4c6e31[_0x96eb('0x35')]);_0x48d22d['filters']=_[_0x96eb('0x38')](_0x48d22d[_0x96eb('0x34')],_0x48d22d['query']);_0xc9ae7d['attributes']=_['intersection'](_0x48d22d[_0x96eb('0x34')],qs[_0x96eb('0x3a')](_0x4c6e31[_0x96eb('0x35')][_0x96eb('0x3a')]));_0xc9ae7d[_0x96eb('0x39')]=_0xc9ae7d[_0x96eb('0x39')][_0x96eb('0x45')]?_0xc9ae7d[_0x96eb('0x39')]:_0x48d22d[_0x96eb('0x34')];if(_0x4c6e31[_0x96eb('0x35')][_0x96eb('0x46')]){_0xc9ae7d['include']=[{'all':!![]}];}_0xc9ae7d=_['merge']({},_0xc9ae7d,_0x4c6e31[_0x96eb('0x40')]);return db[_0x96eb('0x31')]['find'](_0xc9ae7d)[_0x96eb('0x29')](handleEntityNotFound(_0x3371c6,null))['then'](respondWithResult(_0x3371c6,null))['catch'](handleError(_0x3371c6,null));};exports[_0x96eb('0x47')]=function(_0x34bbed,_0x293619){return db['WhatsappTransferReport'][_0x96eb('0x47')](_0x34bbed[_0x96eb('0x48')],{})['then'](respondWithResult(_0x293619,0xc9))[_0x96eb('0x49')](handleError(_0x293619,null));};exports[_0x96eb('0x4a')]=function(_0x5d354a,_0x190330){if(_0x5d354a['body']['id']){delete _0x5d354a[_0x96eb('0x48')]['id'];}return db[_0x96eb('0x31')][_0x96eb('0x4b')]({'where':{'id':_0x5d354a[_0x96eb('0x44')]['id']}})[_0x96eb('0x29')](handleEntityNotFound(_0x190330,null))[_0x96eb('0x29')](saveUpdates(_0x5d354a[_0x96eb('0x48')],null))[_0x96eb('0x29')](respondWithResult(_0x190330,null))['catch'](handleError(_0x190330,null));};exports[_0x96eb('0x2a')]=function(_0x1e687e,_0x47449f){return db[_0x96eb('0x31')][_0x96eb('0x4b')]({'where':{'id':_0x1e687e[_0x96eb('0x44')]['id']}})[_0x96eb('0x29')](handleEntityNotFound(_0x47449f,null))[_0x96eb('0x29')](removeEntity(_0x47449f,null))['catch'](handleError(_0x47449f,null));};exports[_0x96eb('0x4c')]=function(_0x1f6bb9,_0x17e9b0){return db[_0x96eb('0x31')][_0x96eb('0x4c')]()[_0x96eb('0x29')](respondWithResult(_0x17e9b0,null))['catch'](handleError(_0x17e9b0,null));}; \ No newline at end of file +var _0x9e42=['squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','send','map','WhatsappTransferReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','filter','where','VIRTUAL','merge','options','include','findAll','rows','catch','show','params','length','includeAll','create','body','find','describe','rimraf','request-promise','moment','bluebird','util','to-csv','ejs','fs-extra','lodash'];(function(_0x312371,_0x168bca){var _0x11e3d1=function(_0x68c10e){while(--_0x68c10e){_0x312371['push'](_0x312371['shift']());}};_0x11e3d1(++_0x168bca);}(_0x9e42,0x169));var _0x29e4=function(_0x3c22e0,_0x1dc6ea){_0x3c22e0=_0x3c22e0-0x0;var _0x215811=_0x9e42[_0x3c22e0];return _0x215811;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x29e4('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x29e4('0x1'));var moment=require(_0x29e4('0x2'));var BPromise=require(_0x29e4('0x3'));var Mustache=require('mustache');var util=require(_0x29e4('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0x29e4('0x5'));var ejs=require(_0x29e4('0x6'));var fs=require('fs');var fs_extra=require(_0x29e4('0x7'));var _=require(_0x29e4('0x8'));var squel=require(_0x29e4('0x9'));var crypto=require(_0x29e4('0xa'));var jsforce=require(_0x29e4('0xb'));var deskjs=require(_0x29e4('0xc'));var toCsv=require(_0x29e4('0x5'));var querystring=require(_0x29e4('0xd'));var Papa=require(_0x29e4('0xe'));var Redis=require(_0x29e4('0xf'));var authService=require(_0x29e4('0x10'));var qs=require(_0x29e4('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x29e4('0x12'))(_0x29e4('0x13'));var utils=require(_0x29e4('0x14'));var config=require(_0x29e4('0x15'));var licenseUtil=require(_0x29e4('0x16'));var db=require(_0x29e4('0x17'))['db'];function respondWithStatusCode(_0x24038a,_0x557c57){_0x557c57=_0x557c57||0xcc;return function(_0x3307d0){if(_0x3307d0){return _0x24038a[_0x29e4('0x18')](_0x557c57);}return _0x24038a[_0x29e4('0x19')](_0x557c57)['end']();};}function respondWithResult(_0x3df4ed,_0x5c22b9){_0x5c22b9=_0x5c22b9||0xc8;return function(_0xaa0701){if(_0xaa0701){return _0x3df4ed['status'](_0x5c22b9)[_0x29e4('0x1a')](_0xaa0701);}};}function respondWithFilteredResult(_0xe60b94,_0x168d03){return function(_0x3de48a){if(_0x3de48a){var _0x7627=typeof _0x168d03[_0x29e4('0x1b')]===_0x29e4('0x1c')&&typeof _0x168d03[_0x29e4('0x1d')]===_0x29e4('0x1c');var _0x3295c1=_0x3de48a['count'];var _0x109268=_0x7627?0x0:_0x168d03['offset'];var _0xf4e150=_0x7627?_0x3de48a[_0x29e4('0x1e')]:_0x168d03[_0x29e4('0x1b')]+_0x168d03['limit'];var _0x36c143;if(_0xf4e150>=_0x3295c1){_0xf4e150=_0x3295c1;_0x36c143=0xc8;}else{_0x36c143=0xce;}_0xe60b94[_0x29e4('0x19')](_0x36c143);return _0xe60b94['set'](_0x29e4('0x1f'),_0x109268+'-'+_0xf4e150+'/'+_0x3295c1)[_0x29e4('0x1a')](_0x3de48a);}return null;};}function patchUpdates(_0x5106a1){return function(_0x295512){try{jsonpatch[_0x29e4('0x20')](_0x295512,_0x5106a1,!![]);}catch(_0x3df096){return BPromise[_0x29e4('0x21')](_0x3df096);}return _0x295512[_0x29e4('0x22')]();};}function saveUpdates(_0x17a6ed,_0x1fc3d1){return function(_0x177cce){if(_0x177cce){return _0x177cce[_0x29e4('0x23')](_0x17a6ed)[_0x29e4('0x24')](function(_0x4c45a2){return _0x4c45a2;});}return null;};}function removeEntity(_0x44a50c,_0x1cbf5f){return function(_0x4f801a){if(_0x4f801a){return _0x4f801a[_0x29e4('0x25')]()[_0x29e4('0x24')](function(){_0x44a50c[_0x29e4('0x19')](0xcc)[_0x29e4('0x26')]();});}};}function handleEntityNotFound(_0x2a0838,_0x4ce082){return function(_0x49ea72){if(!_0x49ea72){_0x2a0838[_0x29e4('0x18')](0x194);}return _0x49ea72;};}function handleError(_0x28923b,_0x15eeb9){_0x15eeb9=_0x15eeb9||0x1f4;return function(_0x532d8c){logger['error'](_0x532d8c[_0x29e4('0x27')]);if(_0x532d8c[_0x29e4('0x28')]){delete _0x532d8c[_0x29e4('0x28')];}_0x28923b[_0x29e4('0x19')](_0x15eeb9)[_0x29e4('0x29')](_0x532d8c);};}exports['index']=function(_0x37ccbf,_0x1be8e5){var _0x5e3597={},_0x56d3e4={},_0x1b8f6e={'count':0x0,'rows':[]};var _0x83e599=_[_0x29e4('0x2a')](db[_0x29e4('0x2b')][_0x29e4('0x2c')],function(_0x2daf09){return{'name':_0x2daf09[_0x29e4('0x2d')],'type':_0x2daf09[_0x29e4('0x2e')]['key']};});_0x56d3e4[_0x29e4('0x2f')]=_['map'](_0x83e599,'name');_0x56d3e4[_0x29e4('0x30')]=_[_0x29e4('0x31')](_0x37ccbf['query']);_0x56d3e4[_0x29e4('0x32')]=_[_0x29e4('0x33')](_0x56d3e4[_0x29e4('0x2f')],_0x56d3e4['query']);_0x5e3597[_0x29e4('0x34')]=_['intersection'](_0x56d3e4[_0x29e4('0x2f')],qs['fields'](_0x37ccbf[_0x29e4('0x30')][_0x29e4('0x35')]));_0x5e3597[_0x29e4('0x34')]=_0x5e3597[_0x29e4('0x34')]['length']?_0x5e3597[_0x29e4('0x34')]:_0x56d3e4[_0x29e4('0x2f')];if(!_0x37ccbf['query']['hasOwnProperty'](_0x29e4('0x36'))){_0x5e3597['limit']=qs[_0x29e4('0x1d')](_0x37ccbf[_0x29e4('0x30')][_0x29e4('0x1d')]);_0x5e3597[_0x29e4('0x1b')]=qs[_0x29e4('0x1b')](_0x37ccbf[_0x29e4('0x30')][_0x29e4('0x1b')]);}_0x5e3597[_0x29e4('0x37')]=qs[_0x29e4('0x38')](_0x37ccbf['query'][_0x29e4('0x38')]);_0x5e3597['where']=qs[_0x29e4('0x32')](_['pick'](_0x37ccbf[_0x29e4('0x30')],_0x56d3e4[_0x29e4('0x32')]),_0x83e599);if(_0x37ccbf[_0x29e4('0x30')][_0x29e4('0x39')]){_0x5e3597[_0x29e4('0x3a')]=_['merge'](_0x5e3597['where'],{'$or':_['map'](_0x83e599,function(_0x1e1608){if(_0x1e1608[_0x29e4('0x2e')]!==_0x29e4('0x3b')){var _0x630ed={};_0x630ed[_0x1e1608[_0x29e4('0x28')]]={'$like':'%'+_0x37ccbf[_0x29e4('0x30')][_0x29e4('0x39')]+'%'};return _0x630ed;}})});}_0x5e3597=_[_0x29e4('0x3c')]({},_0x5e3597,_0x37ccbf[_0x29e4('0x3d')]);var _0x5c8fd0={'where':_0x5e3597[_0x29e4('0x3a')]};return db[_0x29e4('0x2b')][_0x29e4('0x1e')](_0x5c8fd0)[_0x29e4('0x24')](function(_0x1153f9){_0x1b8f6e[_0x29e4('0x1e')]=_0x1153f9;if(_0x37ccbf[_0x29e4('0x30')]['includeAll']){_0x5e3597[_0x29e4('0x3e')]=[{'all':!![]}];}return db[_0x29e4('0x2b')][_0x29e4('0x3f')](_0x5e3597);})[_0x29e4('0x24')](function(_0x33b813){_0x1b8f6e[_0x29e4('0x40')]=_0x33b813;return _0x1b8f6e;})[_0x29e4('0x24')](respondWithFilteredResult(_0x1be8e5,_0x5e3597))[_0x29e4('0x41')](handleError(_0x1be8e5,null));};exports[_0x29e4('0x42')]=function(_0xba2345,_0x342fec){var _0x2415a9={'raw':!![],'where':{'id':_0xba2345[_0x29e4('0x43')]['id']}},_0x189f28={};_0x189f28[_0x29e4('0x2f')]=_[_0x29e4('0x31')](db['WhatsappTransferReport']['rawAttributes']);_0x189f28[_0x29e4('0x30')]=_[_0x29e4('0x31')](_0xba2345[_0x29e4('0x30')]);_0x189f28['filters']=_[_0x29e4('0x33')](_0x189f28[_0x29e4('0x2f')],_0x189f28[_0x29e4('0x30')]);_0x2415a9[_0x29e4('0x34')]=_[_0x29e4('0x33')](_0x189f28[_0x29e4('0x2f')],qs['fields'](_0xba2345[_0x29e4('0x30')][_0x29e4('0x35')]));_0x2415a9[_0x29e4('0x34')]=_0x2415a9[_0x29e4('0x34')][_0x29e4('0x44')]?_0x2415a9[_0x29e4('0x34')]:_0x189f28[_0x29e4('0x2f')];if(_0xba2345[_0x29e4('0x30')][_0x29e4('0x45')]){_0x2415a9[_0x29e4('0x3e')]=[{'all':!![]}];}_0x2415a9=_['merge']({},_0x2415a9,_0xba2345[_0x29e4('0x3d')]);return db['WhatsappTransferReport']['find'](_0x2415a9)[_0x29e4('0x24')](handleEntityNotFound(_0x342fec,null))[_0x29e4('0x24')](respondWithResult(_0x342fec,null))[_0x29e4('0x41')](handleError(_0x342fec,null));};exports[_0x29e4('0x46')]=function(_0x5011fa,_0x465623){return db[_0x29e4('0x2b')][_0x29e4('0x46')](_0x5011fa['body'],{})[_0x29e4('0x24')](respondWithResult(_0x465623,0xc9))[_0x29e4('0x41')](handleError(_0x465623,null));};exports[_0x29e4('0x23')]=function(_0x30698a,_0x269244){if(_0x30698a['body']['id']){delete _0x30698a[_0x29e4('0x47')]['id'];}return db[_0x29e4('0x2b')][_0x29e4('0x48')]({'where':{'id':_0x30698a['params']['id']}})[_0x29e4('0x24')](handleEntityNotFound(_0x269244,null))[_0x29e4('0x24')](saveUpdates(_0x30698a['body'],null))['then'](respondWithResult(_0x269244,null))[_0x29e4('0x41')](handleError(_0x269244,null));};exports[_0x29e4('0x25')]=function(_0x44540c,_0x4ce21b){return db[_0x29e4('0x2b')]['find']({'where':{'id':_0x44540c[_0x29e4('0x43')]['id']}})[_0x29e4('0x24')](handleEntityNotFound(_0x4ce21b,null))[_0x29e4('0x24')](removeEntity(_0x4ce21b,null))[_0x29e4('0x41')](handleError(_0x4ce21b,null));};exports[_0x29e4('0x49')]=function(_0x3fba3e,_0x5d193a){return db[_0x29e4('0x2b')][_0x29e4('0x49')]()[_0x29e4('0x24')](respondWithResult(_0x5d193a,null))[_0x29e4('0x41')](handleError(_0x5d193a,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index 3acb098..ab0bbec 100644 --- a/server/api/whatsappTransferReport/whatsappTransferReport.model.js +++ b/server/api/whatsappTransferReport/whatsappTransferReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x97cd=['rimraf','../../config/environment','./whatsappTransferReport.attributes','exports','define','report_whatsapp_transfer','uniqueid','lodash','util','../../config/logger','api','bluebird','path'];(function(_0x1dad92,_0x2f948c){var _0x90a9f6=function(_0x5644db){while(--_0x5644db){_0x1dad92['push'](_0x1dad92['shift']());}};_0x90a9f6(++_0x2f948c);}(_0x97cd,0x6f));var _0xd97c=function(_0xe4518a,_0x2aaa7b){_0xe4518a=_0xe4518a-0x0;var _0x280949=_0x97cd[_0xe4518a];return _0x280949;};'use strict';var _=require(_0xd97c('0x0'));var util=require(_0xd97c('0x1'));var logger=require(_0xd97c('0x2'))(_0xd97c('0x3'));var moment=require('moment');var BPromise=require(_0xd97c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd97c('0x5'));var rimraf=require(_0xd97c('0x6'));var config=require(_0xd97c('0x7'));var attributes=require(_0xd97c('0x8'));module[_0xd97c('0x9')]=function(_0x112258,_0xb06a82){return _0x112258[_0xd97c('0xa')]('WhatsappTransferReport',attributes,{'tableName':_0xd97c('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xd97c('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd7cc=['api','moment','request-promise','rimraf','./whatsappTransferReport.attributes','exports','define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','util','../../config/logger'];(function(_0xc86474,_0x57941c){var _0x3f5927=function(_0x3e7666){while(--_0x3e7666){_0xc86474['push'](_0xc86474['shift']());}};_0x3f5927(++_0x57941c);}(_0xd7cc,0x8c));var _0xcd7c=function(_0x400082,_0x46e27f){_0x400082=_0x400082-0x0;var _0xac278e=_0xd7cc[_0x400082];return _0xac278e;};'use strict';var _=require(_0xcd7c('0x0'));var util=require(_0xcd7c('0x1'));var logger=require(_0xcd7c('0x2'))(_0xcd7c('0x3'));var moment=require(_0xcd7c('0x4'));var BPromise=require('bluebird');var rp=require(_0xcd7c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcd7c('0x6'));var config=require('../../config/environment');var attributes=require(_0xcd7c('0x7'));module[_0xcd7c('0x8')]=function(_0x425267,_0xf3f8ff){return _0x425267[_0xcd7c('0x9')](_0xcd7c('0xa'),attributes,{'tableName':_0xcd7c('0xb'),'paranoid':![],'indexes':[{'name':_0xcd7c('0xc'),'fields':[_0xcd7c('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index 120f819..fb2b965 100644 --- a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js +++ b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb4fd=['info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x49eb44,_0x724f7f){var _0x3ba34a=function(_0x1d15e4){while(--_0x1d15e4){_0x49eb44['push'](_0x49eb44['shift']());}};_0x3ba34a(++_0x724f7f);}(_0xb4fd,0x1b8));var _0xdb4f=function(_0x2373f8,_0x58cc65){_0x2373f8=_0x2373f8-0x0;var _0x1030a6=_0xb4fd[_0x2373f8];return _0x1030a6;};'use strict';var _=require(_0xdb4f('0x0'));var util=require(_0xdb4f('0x1'));var moment=require(_0xdb4f('0x2'));var BPromise=require(_0xdb4f('0x3'));var rs=require(_0xdb4f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdb4f('0x5'))['db'];var utils=require(_0xdb4f('0x6'));var logger=require(_0xdb4f('0x7'))(_0xdb4f('0x8'));var config=require('../../config/environment');var jayson=require(_0xdb4f('0x9'));var client=jayson[_0xdb4f('0xa')][_0xdb4f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x20c8a2,_0x3d3302,_0x4b0c9a){return new BPromise(function(_0x413e68,_0x9d5a21){return client[_0xdb4f('0xc')](_0x20c8a2,_0x4b0c9a)['then'](function(_0x33d437){logger['info'](_0xdb4f('0xd'),_0x3d3302,_0xdb4f('0xe'));logger[_0xdb4f('0xf')](_0xdb4f('0x10'),_0x3d3302,_0xdb4f('0xe'),JSON[_0xdb4f('0x11')](_0x33d437));if(_0x33d437[_0xdb4f('0x12')]){if(_0x33d437['error']['code']===0x1f4){logger[_0xdb4f('0x12')](_0xdb4f('0xd'),_0x3d3302,_0x33d437[_0xdb4f('0x12')]['message']);return _0x9d5a21(_0x33d437[_0xdb4f('0x12')][_0xdb4f('0x13')]);}logger[_0xdb4f('0x12')]('WhatsappTransferReport,\x20%s,\x20%s',_0x3d3302,_0x33d437[_0xdb4f('0x12')][_0xdb4f('0x13')]);return _0x413e68(_0x33d437[_0xdb4f('0x12')][_0xdb4f('0x13')]);}else{logger[_0xdb4f('0x14')]('WhatsappTransferReport,\x20%s,\x20%s',_0x3d3302,_0xdb4f('0xe'));_0x413e68(_0x33d437[_0xdb4f('0x15')][_0xdb4f('0x13')]);}})[_0xdb4f('0x16')](function(_0x33d723){logger[_0xdb4f('0x12')](_0xdb4f('0xd'),_0x3d3302,_0x33d723);_0x9d5a21(_0x33d723);});});} \ No newline at end of file +var _0x2a4c=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','http','request','info','WhatsappTransferReport,\x20%s,\x20%s','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','lodash'];(function(_0x14fad0,_0x278d75){var _0x5c665f=function(_0xe43a83){while(--_0xe43a83){_0x14fad0['push'](_0x14fad0['shift']());}};_0x5c665f(++_0x278d75);}(_0x2a4c,0x1b4));var _0xc2a4=function(_0x4f9d6f,_0x23ffda){_0x4f9d6f=_0x4f9d6f-0x0;var _0x550084=_0x2a4c[_0x4f9d6f];return _0x550084;};'use strict';var _=require(_0xc2a4('0x0'));var util=require(_0xc2a4('0x1'));var moment=require(_0xc2a4('0x2'));var BPromise=require(_0xc2a4('0x3'));var rs=require(_0xc2a4('0x4'));var fs=require('fs');var Redis=require(_0xc2a4('0x5'));var db=require(_0xc2a4('0x6'))['db'];var utils=require(_0xc2a4('0x7'));var logger=require('../../config/logger')(_0xc2a4('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc2a4('0x9')][_0xc2a4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x172388,_0x559021,_0x18792e){return new BPromise(function(_0x2d67d8,_0x510a30){return client[_0xc2a4('0xb')](_0x172388,_0x18792e)['then'](function(_0x1063d4){logger[_0xc2a4('0xc')](_0xc2a4('0xd'),_0x559021,'request\x20sent');logger[_0xc2a4('0xe')](_0xc2a4('0xf'),_0x559021,_0xc2a4('0x10'),JSON['stringify'](_0x1063d4));if(_0x1063d4[_0xc2a4('0x11')]){if(_0x1063d4[_0xc2a4('0x11')]['code']===0x1f4){logger[_0xc2a4('0x11')](_0xc2a4('0xd'),_0x559021,_0x1063d4[_0xc2a4('0x11')][_0xc2a4('0x12')]);return _0x510a30(_0x1063d4['error'][_0xc2a4('0x12')]);}logger['error'](_0xc2a4('0xd'),_0x559021,_0x1063d4[_0xc2a4('0x11')][_0xc2a4('0x12')]);return _0x2d67d8(_0x1063d4['error'][_0xc2a4('0x12')]);}else{logger[_0xc2a4('0xc')]('WhatsappTransferReport,\x20%s,\x20%s',_0x559021,_0xc2a4('0x10'));_0x2d67d8(_0x1063d4['result']['message']);}})['catch'](function(_0x35ecec){logger['error'](_0xc2a4('0xd'),_0x559021,_0x35ecec);_0x510a30(_0x35ecec);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index 13d0218..e1143c1 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb138=['info','start','filter','exitCode','number','length','\x20processes\x20failed\x20at\x20startup:\x20','map','pm2_env','name','online','join','Offline\x20apps:','status','None','App\x20Ready!','catch','log','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./config/seedDB','./config/license','./rpc','./config/environment','./config/logger','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/whatsapp','./config/schedule/transcribe','sequelize','sync','then','default','listen'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0xb138,0x1dd));var _0x8b13=function(_0x54c7ec,_0x4dcacc){_0x54c7ec=_0x54c7ec-0x0;var _0x4ac41e=_0xb138[_0x54c7ec];return _0x4ac41e;};'use strict';var _=require(_0x8b13('0x0'));var db=require(_0x8b13('0x1'))['db'];var seedDb=require(_0x8b13('0x2'));var checkLicense=require(_0x8b13('0x3'));var rpc=require(_0x8b13('0x4'));var config=require(_0x8b13('0x5'));var logger=require(_0x8b13('0x6'))('app');var pm2=require(_0x8b13('0x7'));var pm2Config=require(_0x8b13('0x8'));var schedule=require(_0x8b13('0x9'));var chat=require('./config/schedule/chat');var whatsapp=require(_0x8b13('0xa'));var transcribe=require(_0x8b13('0xb'));var provider=require('./config/schedule/cloud-provider');function main(){return db[_0x8b13('0xc')][_0x8b13('0xd')]()[_0x8b13('0xe')](function(){if(config['seedDB']){return seedDb[_0x8b13('0xf')]();}})[_0x8b13('0xe')](function(){return checkLicense['default']();})['then'](function(){return rpc[_0x8b13('0x10')]();})[_0x8b13('0xe')](function(_0x13fbd1){logger[_0x8b13('0x11')](_0x13fbd1);return chat[_0x8b13('0x12')]();})['then'](function(){return whatsapp[_0x8b13('0x12')]();})[_0x8b13('0xe')](function(){return schedule[_0x8b13('0x12')]();})[_0x8b13('0xe')](function(){return transcribe[_0x8b13('0x12')]();})[_0x8b13('0xe')](function(){return provider['start']();})['then'](function(_0x3dcde6){logger[_0x8b13('0x11')](_0x3dcde6);return pm2['start'](pm2Config);})['then'](function(_0x479773){var _0x272cb0=_0x479773[_0x8b13('0x13')](function(_0xf29086){return typeof _0xf29086[_0x8b13('0x14')]===_0x8b13('0x15')&&_0xf29086['exitCode']>=0x0;});if(_0x272cb0[_0x8b13('0x16')]>0x0){throw new Error(_0x272cb0[_0x8b13('0x16')]+_0x8b13('0x17')+_[_0x8b13('0x18')](_0x272cb0,function(_0x3eed21){return'\x22'+_0x3eed21[_0x8b13('0x19')][_0x8b13('0x1a')]+'\x22';}));}logger[_0x8b13('0x11')]('Online\x20apps:',_['map'](_[_0x8b13('0x13')](_0x479773,{'status':_0x8b13('0x1b')}),_0x8b13('0x1a'))[_0x8b13('0x1c')]());logger[_0x8b13('0x11')](_0x8b13('0x1d'),_['map'](_[_0x8b13('0x13')](_0x479773,function(_0x3c4d4f){return _0x3c4d4f[_0x8b13('0x1e')]!=='online';}),'name')[_0x8b13('0x1c')]()||_0x8b13('0x1f'));console['log'](_0x8b13('0x20'));})[_0x8b13('0x21')](function(_0x37ca5f){console[_0x8b13('0x22')](_0x8b13('0x23'),_0x37ca5f);logger['error'](_0x8b13('0x24'),_0x37ca5f);process[_0x8b13('0x25')](0x1);});}main(); \ No newline at end of file +var _0x09f4=['join','map','status','online','None','App\x20Ready!','catch','log','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','./config/seedDB','./config/license','./rpc','./config/environment','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','sequelize','sync','then','seedDB','default','start','info','filter','exitCode','number','length','name','Online\x20apps:'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x09f4,0xe4));var _0x409f=function(_0x1ae585,_0x5ea5b5){_0x1ae585=_0x1ae585-0x0;var _0x209a9b=_0x09f4[_0x1ae585];return _0x209a9b;};'use strict';var _=require('lodash');var db=require('./mysqldb')['db'];var seedDb=require(_0x409f('0x0'));var checkLicense=require(_0x409f('0x1'));var rpc=require(_0x409f('0x2'));var config=require(_0x409f('0x3'));var logger=require(_0x409f('0x4'))(_0x409f('0x5'));var pm2=require(_0x409f('0x6'));var pm2Config=require(_0x409f('0x7'));var schedule=require(_0x409f('0x8'));var chat=require(_0x409f('0x9'));var whatsapp=require(_0x409f('0xa'));var transcribe=require('./config/schedule/transcribe');var provider=require('./config/schedule/cloud-provider');function main(){return db[_0x409f('0xb')][_0x409f('0xc')]()[_0x409f('0xd')](function(){if(config[_0x409f('0xe')]){return seedDb[_0x409f('0xf')]();}})[_0x409f('0xd')](function(){return checkLicense[_0x409f('0xf')]();})[_0x409f('0xd')](function(){return rpc['listen']();})[_0x409f('0xd')](function(_0x4a8658){logger['info'](_0x4a8658);return chat[_0x409f('0x10')]();})[_0x409f('0xd')](function(){return whatsapp[_0x409f('0x10')]();})['then'](function(){return schedule['start']();})[_0x409f('0xd')](function(){return transcribe[_0x409f('0x10')]();})[_0x409f('0xd')](function(){return provider[_0x409f('0x10')]();})[_0x409f('0xd')](function(_0x3234c3){logger[_0x409f('0x11')](_0x3234c3);return pm2['start'](pm2Config);})[_0x409f('0xd')](function(_0x55e557){var _0x3ec157=_0x55e557[_0x409f('0x12')](function(_0x5edeaf){return typeof _0x5edeaf[_0x409f('0x13')]===_0x409f('0x14')&&_0x5edeaf[_0x409f('0x13')]>=0x0;});if(_0x3ec157[_0x409f('0x15')]>0x0){throw new Error(_0x3ec157[_0x409f('0x15')]+'\x20processes\x20failed\x20at\x20startup:\x20'+_['map'](_0x3ec157,function(_0x54b98a){return'\x22'+_0x54b98a['pm2_env'][_0x409f('0x16')]+'\x22';}));}logger[_0x409f('0x11')](_0x409f('0x17'),_['map'](_[_0x409f('0x12')](_0x55e557,{'status':'online'}),_0x409f('0x16'))[_0x409f('0x18')]());logger['info']('Offline\x20apps:',_[_0x409f('0x19')](_['filter'](_0x55e557,function(_0x4098f3){return _0x4098f3[_0x409f('0x1a')]!==_0x409f('0x1b');}),'name')[_0x409f('0x18')]()||_0x409f('0x1c'));console['log'](_0x409f('0x1d'));})[_0x409f('0x1e')](function(_0x477c97){console[_0x409f('0x1f')](_0x409f('0x20'),_0x477c97);logger[_0x409f('0x21')](_0x409f('0x22'),_0x477c97);process[_0x409f('0x23')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index ac71f64..9c0753c 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 _0xcdde=['smsPause','openchannelPause','showWebBar','lastPauseAt','crudPermissions','allowmessenger','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControlPort','hotdesk','interface','privacyEnabled','settingsEnabled','downloadVoiceRecordings','downloadOmnichannelInteractions','ignorePauseForPreviewCalls','selectRecallMeCampaign','smsAutoanswer','openchannelAutoanswer','openchannelAutoanswerDelay','faxAutoanswer','faxAutoanswerDelay','whatsappAutoanswer','whatsappAutoanswerDelay','messengerSoundNotification','isChatInteractionAuthorized','isAuthenticated','use','ChatInteraction','params','closed','disposition','then','query','forceDownload','status','unmanaged','json','Unmanaged.','catch','headers','authorization','startsWith','Basic','User','authenticate','pass','Wrong\x20credentials.','user','Unknown\x20authorization\x20format','getUuid','apikey','find','findOne','blockDuration','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blocked','add','minutes','User\x20not\x20found.','User\x20object\x20not\x20found.','isWebrtcLicence','getLicense','webrtc','Forbidden','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','redirect','/dashboards/general','retrieveApiKey','isNil','apiKeyIat','generateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','decryptString','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','Sequelize','updatePasswordsHistory','split','length','unshift','encryptString','join','promisify','sign','payload','options','verify','hex','floor','now','HS512','toString','../../mysqldb','../../config/environment','../../config/license/hardware','../../config/license/util','lodash','jsonwebtoken','express-jwt','basic-auth','crypto','bluebird','util','moment','secrets','session','role','fullname','name','email','permissions','md5secret','voicePause','chatPause','faxPause'];(function(_0xd14ee9,_0x395763){var _0x50ebcc=function(_0x4c5d5c){while(--_0x4c5d5c){_0xd14ee9['push'](_0xd14ee9['shift']());}};_0x50ebcc(++_0x395763);}(_0xcdde,0x17e));var _0xecdd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcdde[_0x3dd15e];return _0x231fd0;};'use strict';var db=require(_0xecdd('0x0'))['db'];var config=require(_0xecdd('0x1'));var hardwareConf=require(_0xecdd('0x2'));var licenseUtil=require(_0xecdd('0x3'));var encryptor=require('../encryptor');var _=require(_0xecdd('0x4'));var jwt=require(_0xecdd('0x5'));var expressJwt=require(_0xecdd('0x6'));var compose=require('composable-middleware');var basicAuth=require(_0xecdd('0x7'));var crypto=require(_0xecdd('0x8'));var BPromise=require(_0xecdd('0x9'));var util=require(_0xecdd('0xa'));var moment=require(_0xecdd('0xb'));var validateJwt=expressJwt({'secret':config[_0xecdd('0xc')][_0xecdd('0xd')]});var userAttributes=['id',_0xecdd('0xe'),_0xecdd('0xf'),_0xecdd('0x10'),'internal',_0xecdd('0x11'),'userpic',_0xecdd('0x12'),_0xecdd('0x13'),_0xecdd('0x14'),_0xecdd('0x15'),'mailPause',_0xecdd('0x16'),_0xecdd('0x17'),_0xecdd('0x18'),'pauseType',_0xecdd('0x19'),'lastLoginAt',_0xecdd('0x1a'),_0xecdd('0x1b'),_0xecdd('0x1c'),'passwordResetAt','alias',_0xecdd('0x1d'),_0xecdd('0x1e'),_0xecdd('0x1f'),'phoneBarEnableRecording',_0xecdd('0x20'),_0xecdd('0x21'),_0xecdd('0x22'),_0xecdd('0x23'),'phoneBarRemoteControl',_0xecdd('0x24'),_0xecdd('0x25'),_0xecdd('0x26'),'userProfileId',_0xecdd('0x27'),_0xecdd('0x28'),'wssPort',_0xecdd('0x29'),_0xecdd('0x2a'),'downloadAttachments',_0xecdd('0x2b'),_0xecdd('0x2c'),'chatAutoanswer','chatAutoanswerDelay','emailAutoanswer','emailAutoanswerDelay',_0xecdd('0x2d'),'smsAutoanswerDelay',_0xecdd('0x2e'),_0xecdd('0x2f'),_0xecdd('0x30'),_0xecdd('0x31'),_0xecdd('0x32'),_0xecdd('0x33'),_0xecdd('0x34')];exports[_0xecdd('0x35')]=function(){return this[_0xecdd('0x36')](!![])[_0xecdd('0x37')](function(_0x357519,_0x113c3f,_0x5f5248){if(_0x357519['user']){_0x5f5248();}else{return db[_0xecdd('0x38')]['findOne']({'where':{'id':_0x357519[_0xecdd('0x39')]['id']},'attributes':['id',_0xecdd('0x3a'),_0xecdd('0x3b')],'raw':!![]})[_0xecdd('0x3c')](function(_0x595f61){if(_0x595f61&&_0x595f61['closed']&&!_0x357519[_0xecdd('0x3d')][_0xecdd('0x3e')]){return _0x113c3f[_0xecdd('0x3f')](_0x595f61[_0xecdd('0x3b')]===_0xecdd('0x40')?0x195:0x193)[_0xecdd('0x41')]({'message':_0x595f61['disposition']==='unmanaged'?_0xecdd('0x42'):'Forbidden.'});}else{_0x5f5248();}})[_0xecdd('0x43')](function(_0x3c1884){_0x5f5248(_0x3c1884);});}});};exports[_0xecdd('0x36')]=function isAuthenticated(_0x2b8119){return compose()[_0xecdd('0x37')](function(_0x2c1419,_0x10f4dc,_0xf4fcdb){var _0xf9c4fd;if(_0x2c1419[_0xecdd('0x44')][_0xecdd('0x45')]){if(_[_0xecdd('0x46')](_0x2c1419['headers'][_0xecdd('0x45')],_0xecdd('0x47'))){var _0x9d21fc=basicAuth(_0x2c1419);db[_0xecdd('0x48')]['find']({'where':{'name':_0x9d21fc['name']}})[_0xecdd('0x3c')](function(_0x1f10d4){if(!_0x1f10d4||!_0x1f10d4[_0xecdd('0x49')](_0x9d21fc[_0xecdd('0x4a')])){return _0x10f4dc[_0xecdd('0x3f')](0x191)['json']({'message':_0xecdd('0x4b')});}_0x2c1419[_0xecdd('0x4c')]={'id':_0x1f10d4['id']};_0xf4fcdb();})[_0xecdd('0x43')](function(_0x1074bc){_0xf4fcdb(_0x1074bc);});}else if(_[_0xecdd('0x46')](_0x2c1419[_0xecdd('0x44')][_0xecdd('0x45')],'Bearer')){validateJwt(_0x2c1419,_0x10f4dc,_0xf4fcdb);}else{if(_0x2b8119){_0xf4fcdb();}else{return _0x10f4dc[_0xecdd('0x3f')](0x193)[_0xecdd('0x41')]({'message':_0xecdd('0x4d')});}}}else if(_0x2c1419[_0xecdd('0x3d')]['apikey']){try{var _0x3c0096={'audience':hardwareConf[_0xecdd('0x4e')](),'issuer':hardwareConf[_0xecdd('0x4e')]()};verifyJwt(_0x2c1419[_0xecdd('0x3d')][_0xecdd('0x4f')],_0x3c0096)['then'](function(_0x3d1242){return db[_0xecdd('0x48')][_0xecdd('0x50')]({'where':{'id':_0x3d1242['sub']}})['then'](function(_0x11234b){_0xf9c4fd=_0x11234b;return db['Setting'][_0xecdd('0x51')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xecdd('0x52')],'raw':!![]});})['then'](function(_0x47b53b){if(!_0xf9c4fd||!_['isEqual'](_0xf9c4fd[_0xecdd('0x53')],_0x3d1242[_0xecdd('0x54')])){return _0x10f4dc[_0xecdd('0x3f')](0x191)[_0xecdd('0x41')]({'message':_0xecdd('0x55')});}if(_0xf9c4fd[_0xecdd('0x56')]){return _0x10f4dc[_0xecdd('0x3f')](0x191)[_0xecdd('0x41')]({'message':_0xecdd('0x57')});}if(_0xf9c4fd[_0xecdd('0x58')]){if(_0x47b53b['blockDuration']>0x0){if(moment(_0xf9c4fd['blockedAt'])[_0xecdd('0x59')](_0x47b53b[_0xecdd('0x52')],_0xecdd('0x5a'))>moment()){return _0x10f4dc['status'](0x191)[_0xecdd('0x41')]({'message':_0xecdd('0x57')});}}else{return _0x10f4dc[_0xecdd('0x3f')](0x191)[_0xecdd('0x41')]({'message':'Invalid\x20API\x20access\x20key'});}}_0x2c1419[_0xecdd('0x4c')]={'id':_0xf9c4fd['id']};_0xf4fcdb();});})[_0xecdd('0x43')](function(){return _0x10f4dc[_0xecdd('0x3f')](0x191)['json']({'message':_0xecdd('0x57')});});}catch(_0x212820){_0xf4fcdb(_0x212820);}}else if(_0x2b8119){_0xf4fcdb();}else{return _0x10f4dc[_0xecdd('0x3f')](0x193)[_0xecdd('0x41')]({'message':'Unknown\x20authorization\x20format'});}})[_0xecdd('0x37')](function(_0x751ac,_0x88db41,_0x147dc6){if(_0x751ac['user']){db[_0xecdd('0x48')]['find']({'where':{'id':_0x751ac['user']['id']},'attributes':userAttributes})[_0xecdd('0x3c')](function(_0x3c547e){if(!_0x3c547e){return _0x88db41[_0xecdd('0x3f')](0x194)[_0xecdd('0x41')]({'message':_0xecdd('0x5b')});}_0x751ac[_0xecdd('0x4c')]=_0x3c547e;_0x147dc6();})[_0xecdd('0x43')](function(_0x34e95e){_0x147dc6(_0x34e95e);});}else if(_0x2b8119){_0x147dc6();}else{return _0x88db41[_0xecdd('0x3f')](0x194)[_0xecdd('0x41')]({'message':_0xecdd('0x5c')});}});};exports['canUpdate']=function canUpdate(){return compose()['use'](function(_0x596c12,_0x194ed9,_0x221a7b){return licenseUtil['getLicense']()[_0xecdd('0x3c')](function(_0x535398){if(_0x535398['update']){_0x221a7b();}else{return _0x194ed9[_0xecdd('0x3f')](0x193)[_0xecdd('0x41')]({'message':'Forbidden'});}})[_0xecdd('0x43')](function(_0x103283){_0x221a7b(_0x103283);});});};exports[_0xecdd('0x5d')]=function isWebrtcLicence(){return compose()[_0xecdd('0x37')](function(_0x4acf3b,_0x2cb3f6,_0x2e9915){return licenseUtil[_0xecdd('0x5e')]()['then'](function(_0x4a54c7){if(_0x4a54c7[_0xecdd('0x5f')]){_0x2e9915();}else{return _0x2cb3f6['status'](0x193)[_0xecdd('0x41')]({'message':_0xecdd('0x60')});}})[_0xecdd('0x43')](function(_0x180ca0){_0x2e9915(_0x180ca0);});});};exports['isMiddleware']=function(_0x11c285,_0x5b8bef,_0x123f52){_0x11c285[_0xecdd('0x61')]=!![];return _0x123f52();};exports[_0xecdd('0x62')]=function signToken(_0x358f83){return signJwt(_0x358f83);};exports[_0xecdd('0x63')]=function(_0x3595d2,_0xb25adb){if(!_0x3595d2[_0xecdd('0x4c')]){return _0xb25adb['status'](0x194)[_0xecdd('0x41')]({'message':_0xecdd('0x64')});}var _0x370e59={'payload':{'id':_0x3595d2[_0xecdd('0x4c')]['id'],'role':_0x3595d2[_0xecdd('0x4c')][_0xecdd('0xe')]},'options':{'expiresIn':0x15180}};return signJwt(_0x370e59)[_0xecdd('0x3c')](function(_0x265457){_0xb25adb[_0xecdd('0x65')](_0xecdd('0x66'),_0x265457);_0xb25adb[_0xecdd('0x67')](_0xecdd('0x68'));})[_0xecdd('0x43')](function(_0x34a87a){return _0xb25adb['status'](0x1f4)['send'](_0x34a87a);});};exports[_0xecdd('0x69')]=function(_0x3e86e8){if(_[_0xecdd('0x6a')](_0x3e86e8[_0xecdd('0x53')])||_['isNil'](_0x3e86e8[_0xecdd('0x6b')])){return null;}else{return createJwt(_0x3e86e8);}};exports[_0xecdd('0x6c')]=function(_0x56fc6d){_0x56fc6d[_0xecdd('0x53')]=generateNonce();_0x56fc6d[_0xecdd('0x6b')]=generateIssuedAt();return createJwt(_0x56fc6d);};exports['regenerateApiKey']=function(_0x3fb48e,_0x39d91e){var _0x24cc4d=_0x3fb48e[_0xecdd('0x3d')]['apikey'];if(_0x24cc4d){var _0x16ae74={'nonce':_0x39d91e[_0xecdd('0x53')],'iat':_0x39d91e['apiKeyIat'],'audience':hardwareConf[_0xecdd('0x4e')](),'issuer':hardwareConf['getUuid']()};return verifyJwt(_0x24cc4d,_0x16ae74)['then'](function(){return generateApiKey(_0x39d91e);});}else{throw{'message':_0xecdd('0x6d')};}};exports[_0xecdd('0x6e')]=function(_0x47279f){var _0x147c39=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x147c39[_0xecdd('0x6f')](_0x47279f))throw new db['Sequelize'][(_0xecdd('0x70'))](_0xecdd('0x71'));return;};exports['validatePasswordHistory']=function(_0x2c6b11,_0x39d60e,_0x57d2b6){var _0x40eb8e=encryptor[_0xecdd('0x72')](_0x39d60e)['split'](',');for(var _0x576acd=0x0;_0x576acd<_0x57d2b6;_0x576acd++){if(!_0x40eb8e[_0x576acd])break;if(_0x2c6b11[_0xecdd('0x73')]()===_0x40eb8e[_0x576acd][_0xecdd('0x73')]()){var _0x24d62c=util[_0xecdd('0x74')]('The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.',_0x57d2b6);if(_0x57d2b6===0x1){_0x24d62c=_0xecdd('0x75');}throw new db[(_0xecdd('0x76'))][(_0xecdd('0x70'))](_0x24d62c);}}return;};exports[_0xecdd('0x77')]=function(_0xce9bf8,_0x3a7f94){var _0x24666a=_0x3a7f94?encryptor[_0xecdd('0x72')](_0x3a7f94)[_0xecdd('0x78')](','):[];if(_0x24666a[_0xecdd('0x79')]===0x5){_0x24666a['splice'](-0x1,0x1);}_0x24666a[_0xecdd('0x7a')](_0xce9bf8);return encryptor[_0xecdd('0x7b')](_0x24666a[_0xecdd('0x7c')](','));};function signJwt(_0x545b61){var _0x2ff1d2=BPromise[_0xecdd('0x7d')](jwt[_0xecdd('0x7e')],{'context':jwt});var _0x40c40e=_0x545b61['secret']||config[_0xecdd('0xc')]['session'];return new BPromise(function(_0x59f074,_0x11452f){_0x2ff1d2(_0x545b61[_0xecdd('0x7f')],_0x40c40e,_0x545b61[_0xecdd('0x80')])[_0xecdd('0x3c')](function(_0x2fa8a2){_0x59f074(_0x2fa8a2);})[_0xecdd('0x43')](function(_0x19de48){_0x11452f(_0x19de48);});});}function verifyJwt(_0x285e21,_0x15a790,_0x5d38f8){var _0xf241e4=BPromise[_0xecdd('0x7d')](jwt[_0xecdd('0x81')],{'context':jwt});var _0x3b4769=_0x5d38f8||config[_0xecdd('0xc')]['session'];return new BPromise(function(_0x5457b7,_0x9e57c1){_0xf241e4(_0x285e21,_0x3b4769,_0x15a790)[_0xecdd('0x3c')](function(_0x2eb6f1){_0x5457b7(_0x2eb6f1);})[_0xecdd('0x43')](function(_0x1d1ce3){_0x9e57c1(_0x1d1ce3);});});}function generateNonce(){return crypto['randomBytes'](0x10)['toString'](_0xecdd('0x82'));}function generateIssuedAt(){return Math[_0xecdd('0x83')](Date[_0xecdd('0x84')]()/0x3e8)['toString']();}function createJwt(_0x19bbdd){var _0xde0416={'payload':{'iat':_0x19bbdd[_0xecdd('0x6b')],'nonce':_0x19bbdd[_0xecdd('0x53')]},'options':{'algorithm':_0xecdd('0x85'),'subject':_0x19bbdd['id'][_0xecdd('0x86')](),'issuer':hardwareConf[_0xecdd('0x4e')](),'audience':hardwareConf['getUuid']()}};return signJwt(_0xde0416)[_0xecdd('0x3c')](function(_0x10d808){return{'iat':_0x19bbdd[_0xecdd('0x6b')],'nonce':_0x19bbdd[_0xecdd('0x53')],'token':_0x10d808};});} \ No newline at end of file +var _0xa724=['split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','length','unshift','encryptString','join','promisify','secret','payload','options','verify','randomBytes','hex','floor','now','toString','HS512','../../mysqldb','../../config/environment','../../config/license/hardware','../../config/license/util','lodash','jsonwebtoken','express-jwt','basic-auth','crypto','util','moment','secrets','session','role','internal','userpic','permissions','voicePause','chatPause','mailPause','smsPause','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','alias','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','hotdesk','interface','settingsEnabled','downloadVoiceRecordings','downloadOmnichannelInteractions','ignorePauseForPreviewCalls','chatAutoanswer','chatAutoanswerDelay','emailAutoanswer','emailAutoanswerDelay','smsAutoanswer','smsAutoanswerDelay','whatsappAutoanswerDelay','messengerSoundNotification','isChatInteractionAuthorized','isAuthenticated','use','user','ChatInteraction','findOne','closed','disposition','query','forceDownload','status','unmanaged','json','Unmanaged.','Forbidden.','catch','headers','startsWith','authorization','Basic','find','name','then','authenticate','Wrong\x20credentials.','Bearer','Unknown\x20authorization\x20format','apikey','getUuid','allowedLoginAttempts','isEqual','apiKeyNonce','disabled','Invalid\x20API\x20access\x20key','blockDuration','blockedAt','User','User\x20not\x20found.','User\x20object\x20not\x20found.','Forbidden','isWebrtcLicence','getLicense','webrtc','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','motion.token','redirect','/dashboards/general','send','isNil','apiKeyIat','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','decryptString'];(function(_0x5e7a1c,_0x55a07d){var _0x30da92=function(_0x30f4fd){while(--_0x30f4fd){_0x5e7a1c['push'](_0x5e7a1c['shift']());}};_0x30da92(++_0x55a07d);}(_0xa724,0x19a));var _0x4a72=function(_0x4c1cea,_0x3716e8){_0x4c1cea=_0x4c1cea-0x0;var _0x314b86=_0xa724[_0x4c1cea];return _0x314b86;};'use strict';var db=require(_0x4a72('0x0'))['db'];var config=require(_0x4a72('0x1'));var hardwareConf=require(_0x4a72('0x2'));var licenseUtil=require(_0x4a72('0x3'));var encryptor=require('../encryptor');var _=require(_0x4a72('0x4'));var jwt=require(_0x4a72('0x5'));var expressJwt=require(_0x4a72('0x6'));var compose=require('composable-middleware');var basicAuth=require(_0x4a72('0x7'));var crypto=require(_0x4a72('0x8'));var BPromise=require('bluebird');var util=require(_0x4a72('0x9'));var moment=require(_0x4a72('0xa'));var validateJwt=expressJwt({'secret':config[_0x4a72('0xb')][_0x4a72('0xc')]});var userAttributes=['id',_0x4a72('0xd'),'fullname','name',_0x4a72('0xe'),'email',_0x4a72('0xf'),_0x4a72('0x10'),'md5secret',_0x4a72('0x11'),_0x4a72('0x12'),_0x4a72('0x13'),'faxPause',_0x4a72('0x14'),'openchannelPause','pauseType',_0x4a72('0x15'),_0x4a72('0x16'),_0x4a72('0x17'),_0x4a72('0x18'),_0x4a72('0x19'),_0x4a72('0x1a'),_0x4a72('0x1b'),'phoneBarAutoAnswer','phoneBarAutoAnswerDelay',_0x4a72('0x1c'),_0x4a72('0x1d'),_0x4a72('0x1e'),'phoneBarEnableSettings',_0x4a72('0x1f'),_0x4a72('0x20'),_0x4a72('0x21'),'phoneBarRemoteControlPort',_0x4a72('0x22'),_0x4a72('0x23'),'userProfileId','privacyEnabled',_0x4a72('0x24'),'wssPort',_0x4a72('0x25'),_0x4a72('0x26'),'downloadAttachments',_0x4a72('0x27'),'selectRecallMeCampaign',_0x4a72('0x28'),_0x4a72('0x29'),_0x4a72('0x2a'),_0x4a72('0x2b'),_0x4a72('0x2c'),_0x4a72('0x2d'),'openchannelAutoanswer','openchannelAutoanswerDelay','faxAutoanswer','faxAutoanswerDelay','whatsappAutoanswer',_0x4a72('0x2e'),_0x4a72('0x2f')];exports[_0x4a72('0x30')]=function(){return this[_0x4a72('0x31')](!![])[_0x4a72('0x32')](function(_0x1742e4,_0x335670,_0x532214){if(_0x1742e4[_0x4a72('0x33')]){_0x532214();}else{return db[_0x4a72('0x34')][_0x4a72('0x35')]({'where':{'id':_0x1742e4['params']['id']},'attributes':['id',_0x4a72('0x36'),_0x4a72('0x37')],'raw':!![]})['then'](function(_0x1b48a4){if(_0x1b48a4&&_0x1b48a4['closed']&&!_0x1742e4[_0x4a72('0x38')][_0x4a72('0x39')]){return _0x335670[_0x4a72('0x3a')](_0x1b48a4[_0x4a72('0x37')]===_0x4a72('0x3b')?0x195:0x193)[_0x4a72('0x3c')]({'message':_0x1b48a4['disposition']===_0x4a72('0x3b')?_0x4a72('0x3d'):_0x4a72('0x3e')});}else{_0x532214();}})[_0x4a72('0x3f')](function(_0x4978cc){_0x532214(_0x4978cc);});}});};exports[_0x4a72('0x31')]=function isAuthenticated(_0x2fa329){return compose()[_0x4a72('0x32')](function(_0x583c15,_0xcf8828,_0x1ca088){var _0x27f241;if(_0x583c15[_0x4a72('0x40')]['authorization']){if(_[_0x4a72('0x41')](_0x583c15[_0x4a72('0x40')][_0x4a72('0x42')],_0x4a72('0x43'))){var _0x12266c=basicAuth(_0x583c15);db['User'][_0x4a72('0x44')]({'where':{'name':_0x12266c[_0x4a72('0x45')]}})[_0x4a72('0x46')](function(_0x1ff7b4){if(!_0x1ff7b4||!_0x1ff7b4[_0x4a72('0x47')](_0x12266c['pass'])){return _0xcf8828[_0x4a72('0x3a')](0x191)[_0x4a72('0x3c')]({'message':_0x4a72('0x48')});}_0x583c15['user']={'id':_0x1ff7b4['id']};_0x1ca088();})[_0x4a72('0x3f')](function(_0x3ee605){_0x1ca088(_0x3ee605);});}else if(_[_0x4a72('0x41')](_0x583c15[_0x4a72('0x40')][_0x4a72('0x42')],_0x4a72('0x49'))){validateJwt(_0x583c15,_0xcf8828,_0x1ca088);}else{if(_0x2fa329){_0x1ca088();}else{return _0xcf8828['status'](0x193)[_0x4a72('0x3c')]({'message':_0x4a72('0x4a')});}}}else if(_0x583c15[_0x4a72('0x38')][_0x4a72('0x4b')]){try{var _0x553557={'audience':hardwareConf[_0x4a72('0x4c')](),'issuer':hardwareConf['getUuid']()};verifyJwt(_0x583c15[_0x4a72('0x38')][_0x4a72('0x4b')],_0x553557)[_0x4a72('0x46')](function(_0x376f2c){return db['User'][_0x4a72('0x44')]({'where':{'id':_0x376f2c['sub']}})[_0x4a72('0x46')](function(_0x5f7c56){_0x27f241=_0x5f7c56;return db['Setting']['findOne']({'where':{'id':0x1},'attributes':[_0x4a72('0x4d'),'blockDuration'],'raw':!![]});})[_0x4a72('0x46')](function(_0xf27b98){if(!_0x27f241||!_[_0x4a72('0x4e')](_0x27f241[_0x4a72('0x4f')],_0x376f2c['nonce'])){return _0xcf8828[_0x4a72('0x3a')](0x191)['json']({'message':'API\x20access\x20key\x20is\x20not\x20valid\x20anymore'});}if(_0x27f241[_0x4a72('0x50')]){return _0xcf8828['status'](0x191)[_0x4a72('0x3c')]({'message':_0x4a72('0x51')});}if(_0x27f241['blocked']){if(_0xf27b98[_0x4a72('0x52')]>0x0){if(moment(_0x27f241[_0x4a72('0x53')])['add'](_0xf27b98[_0x4a72('0x52')],'minutes')>moment()){return _0xcf8828[_0x4a72('0x3a')](0x191)[_0x4a72('0x3c')]({'message':_0x4a72('0x51')});}}else{return _0xcf8828[_0x4a72('0x3a')](0x191)[_0x4a72('0x3c')]({'message':_0x4a72('0x51')});}}_0x583c15['user']={'id':_0x27f241['id']};_0x1ca088();});})[_0x4a72('0x3f')](function(){return _0xcf8828['status'](0x191)['json']({'message':_0x4a72('0x51')});});}catch(_0x47a674){_0x1ca088(_0x47a674);}}else if(_0x2fa329){_0x1ca088();}else{return _0xcf8828[_0x4a72('0x3a')](0x193)[_0x4a72('0x3c')]({'message':'Unknown\x20authorization\x20format'});}})[_0x4a72('0x32')](function(_0xe94b10,_0x1ba4ba,_0x211ff7){if(_0xe94b10['user']){db[_0x4a72('0x54')]['find']({'where':{'id':_0xe94b10[_0x4a72('0x33')]['id']},'attributes':userAttributes})[_0x4a72('0x46')](function(_0x91606e){if(!_0x91606e){return _0x1ba4ba[_0x4a72('0x3a')](0x194)[_0x4a72('0x3c')]({'message':_0x4a72('0x55')});}_0xe94b10[_0x4a72('0x33')]=_0x91606e;_0x211ff7();})[_0x4a72('0x3f')](function(_0x346e0d){_0x211ff7(_0x346e0d);});}else if(_0x2fa329){_0x211ff7();}else{return _0x1ba4ba[_0x4a72('0x3a')](0x194)['json']({'message':_0x4a72('0x56')});}});};exports['canUpdate']=function canUpdate(){return compose()['use'](function(_0x58fb6d,_0x2a1147,_0x2208f1){return licenseUtil['getLicense']()[_0x4a72('0x46')](function(_0x366b59){if(_0x366b59['update']){_0x2208f1();}else{return _0x2a1147[_0x4a72('0x3a')](0x193)['json']({'message':_0x4a72('0x57')});}})[_0x4a72('0x3f')](function(_0x300223){_0x2208f1(_0x300223);});});};exports[_0x4a72('0x58')]=function isWebrtcLicence(){return compose()[_0x4a72('0x32')](function(_0x41b357,_0x3da5ee,_0x2a13fb){return licenseUtil[_0x4a72('0x59')]()[_0x4a72('0x46')](function(_0x4270e4){if(_0x4270e4[_0x4a72('0x5a')]){_0x2a13fb();}else{return _0x3da5ee[_0x4a72('0x3a')](0x193)['json']({'message':_0x4a72('0x57')});}})[_0x4a72('0x3f')](function(_0x2bc1cf){_0x2a13fb(_0x2bc1cf);});});};exports[_0x4a72('0x5b')]=function(_0x263733,_0x3eaf80,_0x2f6e47){_0x263733[_0x4a72('0x5b')]=!![];return _0x2f6e47();};exports[_0x4a72('0x5c')]=function signToken(_0x6536b8){return signJwt(_0x6536b8);};exports[_0x4a72('0x5d')]=function(_0x3c39bd,_0x5c7c76){if(!_0x3c39bd[_0x4a72('0x33')]){return _0x5c7c76[_0x4a72('0x3a')](0x194)[_0x4a72('0x3c')]({'message':_0x4a72('0x5e')});}var _0x29c529={'payload':{'id':_0x3c39bd[_0x4a72('0x33')]['id'],'role':_0x3c39bd['user'][_0x4a72('0xd')]},'options':{'expiresIn':0x15180}};return signJwt(_0x29c529)[_0x4a72('0x46')](function(_0xec1204){_0x5c7c76['cookie'](_0x4a72('0x5f'),_0xec1204);_0x5c7c76[_0x4a72('0x60')](_0x4a72('0x61'));})['catch'](function(_0x49d7a4){return _0x5c7c76[_0x4a72('0x3a')](0x1f4)[_0x4a72('0x62')](_0x49d7a4);});};exports['retrieveApiKey']=function(_0x8bc530){if(_[_0x4a72('0x63')](_0x8bc530[_0x4a72('0x4f')])||_['isNil'](_0x8bc530[_0x4a72('0x64')])){return null;}else{return createJwt(_0x8bc530);}};exports['generateApiKey']=function(_0xa643fb){_0xa643fb['apiKeyNonce']=generateNonce();_0xa643fb[_0x4a72('0x64')]=generateIssuedAt();return createJwt(_0xa643fb);};exports[_0x4a72('0x65')]=function(_0x1df0ce,_0x4a8989){var _0x33340c=_0x1df0ce[_0x4a72('0x38')][_0x4a72('0x4b')];if(_0x33340c){var _0x53e3e4={'nonce':_0x4a8989['apiKeyNonce'],'iat':_0x4a8989['apiKeyIat'],'audience':hardwareConf[_0x4a72('0x4c')](),'issuer':hardwareConf[_0x4a72('0x4c')]()};return verifyJwt(_0x33340c,_0x53e3e4)[_0x4a72('0x46')](function(){return generateApiKey(_0x4a8989);});}else{throw{'message':_0x4a72('0x66')};}};exports[_0x4a72('0x67')]=function(_0x41a4a9){var _0x1ba8b2=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x1ba8b2[_0x4a72('0x68')](_0x41a4a9))throw new db[(_0x4a72('0x69'))][(_0x4a72('0x6a'))](_0x4a72('0x6b'));return;};exports[_0x4a72('0x6c')]=function(_0x472cfd,_0x28fad9,_0x41d20a){var _0x3db261=encryptor[_0x4a72('0x6d')](_0x28fad9)[_0x4a72('0x6e')](',');for(var _0x2872b1=0x0;_0x2872b1<_0x41d20a;_0x2872b1++){if(!_0x3db261[_0x2872b1])break;if(_0x472cfd['toLowerCase']()===_0x3db261[_0x2872b1][_0x4a72('0x6f')]()){var _0x41cae4=util[_0x4a72('0x70')](_0x4a72('0x71'),_0x41d20a);if(_0x41d20a===0x1){_0x41cae4='The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.';}throw new db['Sequelize'][(_0x4a72('0x6a'))](_0x41cae4);}}return;};exports[_0x4a72('0x72')]=function(_0x2af177,_0x3c191a){var _0x466c69=_0x3c191a?encryptor[_0x4a72('0x6d')](_0x3c191a)[_0x4a72('0x6e')](','):[];if(_0x466c69[_0x4a72('0x73')]===0x5){_0x466c69['splice'](-0x1,0x1);}_0x466c69[_0x4a72('0x74')](_0x2af177);return encryptor[_0x4a72('0x75')](_0x466c69[_0x4a72('0x76')](','));};function signJwt(_0x27bc00){var _0x3548ab=BPromise[_0x4a72('0x77')](jwt['sign'],{'context':jwt});var _0x12a861=_0x27bc00[_0x4a72('0x78')]||config[_0x4a72('0xb')][_0x4a72('0xc')];return new BPromise(function(_0x110b2f,_0x4403db){_0x3548ab(_0x27bc00[_0x4a72('0x79')],_0x12a861,_0x27bc00[_0x4a72('0x7a')])[_0x4a72('0x46')](function(_0x1b72e5){_0x110b2f(_0x1b72e5);})[_0x4a72('0x3f')](function(_0x4a78e1){_0x4403db(_0x4a78e1);});});}function verifyJwt(_0x24fbc4,_0x6ebedb,_0x45d558){var _0x27d34e=BPromise['promisify'](jwt[_0x4a72('0x7b')],{'context':jwt});var _0x20d32e=_0x45d558||config[_0x4a72('0xb')][_0x4a72('0xc')];return new BPromise(function(_0x32ba86,_0x18f0ab){_0x27d34e(_0x24fbc4,_0x20d32e,_0x6ebedb)['then'](function(_0x5bcf20){_0x32ba86(_0x5bcf20);})['catch'](function(_0x49bb86){_0x18f0ab(_0x49bb86);});});}function generateNonce(){return crypto[_0x4a72('0x7c')](0x10)['toString'](_0x4a72('0x7d'));}function generateIssuedAt(){return Math[_0x4a72('0x7e')](Date[_0x4a72('0x7f')]()/0x3e8)[_0x4a72('0x80')]();}function createJwt(_0x48d67c){var _0x4c6cc2={'payload':{'iat':_0x48d67c[_0x4a72('0x64')],'nonce':_0x48d67c[_0x4a72('0x4f')]},'options':{'algorithm':_0x4a72('0x81'),'subject':_0x48d67c['id'][_0x4a72('0x80')](),'issuer':hardwareConf[_0x4a72('0x4c')](),'audience':hardwareConf[_0x4a72('0x4c')]()}};return signJwt(_0x4c6cc2)[_0x4a72('0x46')](function(_0x19ca33){return{'iat':_0x48d67c[_0x4a72('0x64')],'nonce':_0x48d67c[_0x4a72('0x4f')],'token':_0x19ca33};});} \ No newline at end of file diff --git a/server/components/contacts/index.js b/server/components/contacts/index.js index 5d5dd8f..d0bf6fa 100644 --- a/server/components/contacts/index.js +++ b/server/components/contacts/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x95d2=['fieldType','type','lodash','./sql-utils','../../mysqldb','findAll','skipContactsQuery','resolve','getContactsSubquery','search','parseQueryParameters','where','filter','user','clause','tags','skip','checkListsRestrictions','then','ids','tag','countFilteredContacts','count','buildContactsQuery','fields','rows','catch','describe','CmContact','keys','startsWith','cf_','map','findOne','slice','all','length'];(function(_0x3f619d,_0x4762c5){var _0x1eb364=function(_0x407268){while(--_0x407268){_0x3f619d['push'](_0x3f619d['shift']());}};_0x1eb364(++_0x4762c5);}(_0x95d2,0x96));var _0x295d=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x95d2[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x295d('0x0'));var sqlUtils=require(_0x295d('0x1'));var db=require(_0x295d('0x2'))['db'];exports[_0x295d('0x3')]=function(_0x146650,_0x359359,_0x55f620,_0x2d7730){var _0x38ebc6={'count':0x0,'rows':[]};var _0x48af04=sqlUtils[_0x295d('0x4')](_0x359359,_0x146650);if(_0x48af04){return Promise[_0x295d('0x5')](_0x38ebc6);}var _0x2d94ba=sqlUtils[_0x295d('0x6')]();var _0x46f1b0={};var _0x6a680f=![];var _0x2ef737=![];return Promise['resolve']()['then'](function(){if(_0x146650[_0x295d('0x7')]){return sqlUtils['parseAdvancedSearchFilter'](_0x146650[_0x295d('0x7')],_0x2d7730);}else{return sqlUtils[_0x295d('0x8')](_0x146650,_0x2d7730);}})['then'](function(_0x12b130){_0x2d94ba[_0x295d('0x9')](_0x12b130['default']);_0x2d94ba[_0x295d('0x9')](_0x12b130['fields']);_0x2d94ba[_0x295d('0x9')](_0x12b130[_0x295d('0xa')]);_0x2d94ba[_0x295d('0x9')](_0x12b130[_0x295d('0xb')][_0x295d('0xc')]);_0x46f1b0=_0x12b130[_0x295d('0xd')];_0x2ef737=_0x12b130[_0x295d('0xb')][_0x295d('0xe')];return sqlUtils[_0x295d('0xf')](_0x359359,_0x146650,_0x2ef737);})[_0x295d('0x10')](function(_0x514096){_0x2d94ba[_0x295d('0x9')](_0x514096);var _0x251756=_0x146650['search']?_0x46f1b0[_0x295d('0x11')]:_0x146650[_0x295d('0x12')];_0x6a680f=_0x251756?!![]:![];return sqlUtils[_0x295d('0x13')](_0x2d94ba,_0x251756);})[_0x295d('0x10')](function(_0x5c9221){_0x38ebc6[_0x295d('0x14')]=_0x5c9221;if(_0x38ebc6[_0x295d('0x14')]===0x0){return;}if(_0x146650['User']){_0x2ef737=!![];}return sqlUtils[_0x295d('0x15')](_0x2d94ba,_0x146650[_0x295d('0x16')],_0x55f620,_0x6a680f,_0x46f1b0[_0x295d('0xc')],_0x2ef737);})[_0x295d('0x10')](function(_0x456d87){if(!_0x456d87){return[];}return sqlUtils['getFilteredContacts'](_0x456d87,_0x146650,_0x55f620);})[_0x295d('0x10')](function(_0x107e80){_0x38ebc6[_0x295d('0x17')]=_0x107e80;return _0x38ebc6;})[_0x295d('0x18')](function(_0x56454b){throw _0x56454b;});};exports[_0x295d('0x19')]=function(){var _0xad0376={};var _0x2a1835=[];return db[_0x295d('0x1a')][_0x295d('0x19')]()[_0x295d('0x10')](function(_0x42244c){_0xad0376=_0x42244c;var _0x5e2063=Object[_0x295d('0x1b')](_0xad0376)['filter'](function(_0x15566d){return _[_0x295d('0x1c')](_0x15566d,_0x295d('0x1d'))?_0x15566d:undefined;});var _0x1b4431=_0x5e2063[_0x295d('0x1e')](function(_0x2a19c0){return db['CmCustomField'][_0x295d('0x1f')]({'where':{'id':_0x2a19c0[_0x295d('0x20')](0x3)},'raw':!![]});});return Promise[_0x295d('0x21')](_0x1b4431);})['then'](function(_0x351d6d){for(var _0x1b5733=0x0;_0x1b5733<_0x351d6d[_0x295d('0x22')];_0x1b5733++){if(_0x351d6d[_0x1b5733]){var _0x53e310=_0x295d('0x1d')+_0x351d6d[_0x1b5733]['id'];_0xad0376[_0x53e310][_0x295d('0x23')]=_0x351d6d[_0x1b5733]['type'];}}_0x2a1835=_[_0x295d('0x1e')](Object[_0x295d('0x1b')](_0xad0376),function(_0xd769a8){return{'name':_0xd769a8,'type':_0xad0376[_0xd769a8][_0x295d('0x24')]};});return _0x2a1835;})[_0x295d('0x18')](function(_0x5351fe){throw _0x5351fe;});}; \ No newline at end of file +var _0x47ed=['catch','lodash','./sql-utils','../../mysqldb','findAll','skipContactsQuery','resolve','getContactsSubquery','then','search','parseAdvancedSearchFilter','parseQueryParameters','where','default','filter','user','skip','checkListsRestrictions','ids','tag','countFilteredContacts','User','buildContactsQuery','fields','clause','getFilteredContacts','describe','CmContact','cf_','map','CmCustomField','slice','all','length','fieldType','type','keys'];(function(_0x5e9913,_0x4552cc){var _0x4ac3f2=function(_0x4cdfcb){while(--_0x4cdfcb){_0x5e9913['push'](_0x5e9913['shift']());}};_0x4ac3f2(++_0x4552cc);}(_0x47ed,0x1e2));var _0xd47e=function(_0x1ab21c,_0x446e99){_0x1ab21c=_0x1ab21c-0x0;var _0x53dcb1=_0x47ed[_0x1ab21c];return _0x53dcb1;};'use strict';var _=require(_0xd47e('0x0'));var sqlUtils=require(_0xd47e('0x1'));var db=require(_0xd47e('0x2'))['db'];exports[_0xd47e('0x3')]=function(_0x40f67a,_0x1734f1,_0x33d320,_0xeeb84e){var _0x266da5={'count':0x0,'rows':[]};var _0x2ac598=sqlUtils[_0xd47e('0x4')](_0x1734f1,_0x40f67a);if(_0x2ac598){return Promise[_0xd47e('0x5')](_0x266da5);}var _0x4be455=sqlUtils[_0xd47e('0x6')]();var _0x154cdb={};var _0x28a96c=![];var _0x574edb=![];return Promise[_0xd47e('0x5')]()[_0xd47e('0x7')](function(){if(_0x40f67a[_0xd47e('0x8')]){return sqlUtils[_0xd47e('0x9')](_0x40f67a[_0xd47e('0x8')],_0xeeb84e);}else{return sqlUtils[_0xd47e('0xa')](_0x40f67a,_0xeeb84e);}})[_0xd47e('0x7')](function(_0x6a0755){_0x4be455[_0xd47e('0xb')](_0x6a0755[_0xd47e('0xc')]);_0x4be455[_0xd47e('0xb')](_0x6a0755['fields']);_0x4be455['where'](_0x6a0755[_0xd47e('0xd')]);_0x4be455[_0xd47e('0xb')](_0x6a0755[_0xd47e('0xe')]['clause']);_0x154cdb=_0x6a0755['tags'];_0x574edb=_0x6a0755[_0xd47e('0xe')][_0xd47e('0xf')];return sqlUtils[_0xd47e('0x10')](_0x1734f1,_0x40f67a,_0x574edb);})[_0xd47e('0x7')](function(_0x55ff51){_0x4be455[_0xd47e('0xb')](_0x55ff51);var _0x370a75=_0x40f67a[_0xd47e('0x8')]?_0x154cdb[_0xd47e('0x11')]:_0x40f67a[_0xd47e('0x12')];_0x28a96c=_0x370a75?!![]:![];return sqlUtils[_0xd47e('0x13')](_0x4be455,_0x370a75);})[_0xd47e('0x7')](function(_0x13e0e6){_0x266da5['count']=_0x13e0e6;if(_0x266da5['count']===0x0){return;}if(_0x40f67a[_0xd47e('0x14')]){_0x574edb=!![];}return sqlUtils[_0xd47e('0x15')](_0x4be455,_0x40f67a[_0xd47e('0x16')],_0x33d320,_0x28a96c,_0x154cdb[_0xd47e('0x17')],_0x574edb);})['then'](function(_0xfc8223){if(!_0xfc8223){return[];}return sqlUtils[_0xd47e('0x18')](_0xfc8223,_0x40f67a,_0x33d320);})['then'](function(_0x1230fd){_0x266da5['rows']=_0x1230fd;return _0x266da5;})['catch'](function(_0x3c0647){throw _0x3c0647;});};exports[_0xd47e('0x19')]=function(){var _0x252991={};var _0x381306=[];return db[_0xd47e('0x1a')][_0xd47e('0x19')]()[_0xd47e('0x7')](function(_0x1c762b){_0x252991=_0x1c762b;var _0x45ce8f=Object['keys'](_0x252991)[_0xd47e('0xd')](function(_0x5d1c55){return _['startsWith'](_0x5d1c55,_0xd47e('0x1b'))?_0x5d1c55:undefined;});var _0x51e90d=_0x45ce8f[_0xd47e('0x1c')](function(_0x2b0ace){return db[_0xd47e('0x1d')]['findOne']({'where':{'id':_0x2b0ace[_0xd47e('0x1e')](0x3)},'raw':!![]});});return Promise[_0xd47e('0x1f')](_0x51e90d);})[_0xd47e('0x7')](function(_0x2591ea){for(var _0x4644a4=0x0;_0x4644a4<_0x2591ea[_0xd47e('0x20')];_0x4644a4++){if(_0x2591ea[_0x4644a4]){var _0x560018=_0xd47e('0x1b')+_0x2591ea[_0x4644a4]['id'];_0x252991[_0x560018][_0xd47e('0x21')]=_0x2591ea[_0x4644a4][_0xd47e('0x22')];}}_0x381306=_['map'](Object[_0xd47e('0x23')](_0x252991),function(_0x2670e0){return{'name':_0x2670e0,'type':_0x252991[_0x2670e0][_0xd47e('0x22')]};});return _0x381306;})[_0xd47e('0x24')](function(_0x2c766c){throw _0x2c766c;});}; \ No newline at end of file diff --git a/server/components/contacts/sql-utils.js b/server/components/contacts/sql-utils.js index b9705c4..b193f14 100644 --- a/server/components/contacts/sql-utils.js +++ b/server/components/contacts/sql-utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x659a=['color','keyBy','Sequelize','QueryTypes','SELECT','CmContact','sequelize','query','toString','split','Tags','clone','COUNT(*)','isEmpty','t.id\x20IN\x20?','exports','lodash','squel','../parsers/advancedSearch','../parsers/qs','../interaction/utils','agent','search','ListId','cm_contacts','where','subqry','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20','cm_contact_has_tags','.id','tools_tags','t.id\x20=\x20ct.TagId','firstName','phone','mobile','fax','email','CompanyId','updatedAt','deletedAt','TagIds','includes','push','field','GROUP_CONCAT(DISTINCT\x20t.id)','expr','getSelectedTags','forEach','replace','length','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.lastName\x20LIKE\x20?','parseSearch','sqlOperator','conditions','name','dateOfBirth','castTo','DATE','buildExpression','type','default','value','start','end','Tag','tags','and','ids','User','user','clause','uc.UserId\x20=\x20?','compact','Contact','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','resolve','then','fields','tag','filter','role','getLists','c.ListId\x20IS\x20NULL','map','attributes','select','group','c.id','limit','offset','order','DESC','from','findAll'];(function(_0x35cf42,_0x7ce1e0){var _0x19d6d2=function(_0x192c5b){while(--_0x192c5b){_0x35cf42['push'](_0x35cf42['shift']());}};_0x19d6d2(++_0x7ce1e0);}(_0x659a,0x1b8));var _0xa659=function(_0x2136a6,_0x35af63){_0x2136a6=_0x2136a6-0x0;var _0x55b948=_0x659a[_0x2136a6];return _0x55b948;};'use strict';var _=require(_0xa659('0x0'));var squel=require(_0xa659('0x1'));var as=require(_0xa659('0x2'));var qs=require(_0xa659('0x3'));var utils=require(_0xa659('0x4'));var db=require('../../mysqldb')['db'];function skipContactsQuery(_0x29d0d6,_0x3e34be){var _0x538427=![];if(_0x29d0d6['role']===_0xa659('0x5')&&!_0x3e34be[_0xa659('0x6')]&&!_0x3e34be[_0xa659('0x7')]&&_0x3e34be['autocomplete']!=='true'){_0x538427=!![];}return _0x538427;}function getContactsSubquery(){return squel['select']()['from'](_0xa659('0x8'),'c')[_0xa659('0x9')]('c.deletedAt\x20IS\x20NULL');}function applyJoinClauses(_0x1bf9e8,_0x1e9fcb){var _0x484127=_0x1e9fcb?'c':_0xa659('0xa');_0x1bf9e8[_0xa659('0xb')](_0xa659('0xc'),'uc',_0xa659('0xd')+_0x484127+'.id')[_0xa659('0xb')](_0xa659('0xe'),'ct','ct.CmContactId\x20=\x20'+_0x484127+_0xa659('0xf'))['left_join'](_0xa659('0x10'),'t',_0xa659('0x11'));return _0x1bf9e8;}function addFieldsToQuery(_0x4160d8,_0x16473e,_0x1fa208,_0x33ba21,_0x37164e){var _0x3c8981=_0x37164e?'c':_0xa659('0xa');if(!_0x16473e){_0x16473e=['id',_0xa659('0x12'),'lastName',_0xa659('0x13'),_0xa659('0x14'),_0xa659('0x15'),_0xa659('0x16'),_0xa659('0x7'),_0xa659('0x17'),'createdAt',_0xa659('0x18'),_0xa659('0x19'),_0xa659('0x1a')];}else if(!_0x16473e[_0xa659('0x1b')]('id')){_0x16473e[_0xa659('0x1c')]('id');}var _0x3dd50c=_0x1fa208&&_0x37164e||!_0x1fa208&&!_0x37164e;if(_0x33ba21){_0x3dd50c=_0x33ba21&&_0x37164e||!_0x33ba21&&!_0x37164e;}_0x16473e['forEach'](function(_0x53d166){if(_0x53d166==='TagIds'){if(_0x3dd50c){_0x4160d8[_0xa659('0x1d')](_0xa659('0x1e'),_0x53d166);}else if(_0x1fa208||_0x33ba21){_0x4160d8[_0xa659('0x1d')](_0x3c8981+'.'+_0x53d166);}}else{_0x4160d8[_0xa659('0x1d')](_0x3c8981+'.'+_0x53d166);}});return _0x4160d8;}function getSqlClauses(){var _0x19c07c={'default':squel['expr'](),'fields':squel[_0xa659('0x1f')](),'filter':squel[_0xa659('0x1f')](),'tags':{'clause':squel[_0xa659('0x1f')](),'ids':null},'user':{'clause':squel[_0xa659('0x1f')](),'skip':![]}};return _0x19c07c;}function parseTagParameter(_0x5aa413){var _0x538d8a=squel[_0xa659('0x1f')]();if(_0x5aa413){var _0x32a0dd=utils[_0xa659('0x20')](_0x5aa413);_0x32a0dd[_0xa659('0x21')](function(_0x4469d3){_0x538d8a['or']('CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x4469d3+',%');});}return _0x538d8a;}function parseSearchFilter(_0x336a25){var _0xaf115a=squel['expr']();if(_0x336a25){var _0x35987a=_0x336a25[_0xa659('0x22')]('\x5c','\x5c\x5c')[_0xa659('0x22')](/'/g,'\x27\x27');if(_0x35987a['split']('\x20')[_0xa659('0x23')]>0x1){_0xaf115a['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xa659('0x24')](_0x35987a,!![]),null);}else{if(qs[_0xa659('0x25')](_0x35987a)){_0xaf115a['or'](_0xa659('0x26'),_0x35987a+'%');_0xaf115a['or'](_0xa659('0x27'),_0x35987a+'%');_0xaf115a['or'](_0xa659('0x28'),_0x35987a+'%');_0xaf115a['or']('c.fax\x20LIKE\x20?',_0x35987a+'%');}else if(qs[_0xa659('0x29')](_0x35987a)){_0xaf115a['or'](_0xa659('0x2a'),_0x35987a+'%');}else{_0xaf115a['or']('c.firstName\x20LIKE\x20?','%'+_0x35987a+'%');_0xaf115a['or'](_0xa659('0x2b'),'%'+_0x35987a+'%');_0xaf115a['or'](_0xa659('0x2a'),'%'+_0x35987a+'%');}}}return _0xaf115a;}function parseAdvancedSearchFilter(_0x577c0e,_0xe42f1a){var _0x4cf817=getSqlClauses();var _0x1f48ee=as[_0xa659('0x2c')](_0x577c0e);var _0x1c4547=_0x1f48ee[_0xa659('0x2d')];for(var _0x267914=0x0;_0x267914<_0x1f48ee['conditions'][_0xa659('0x23')];_0x267914++){var _0x5f3e07=_0x1f48ee[_0xa659('0x2e')][_0x267914];var _0x536303='c';var _0x389072=_['find'](_0xe42f1a,[_0xa659('0x2f'),_0x5f3e07['field']]);if(_0x389072){if(_0x5f3e07[_0xa659('0x1d')]===_0xa659('0x30')||_0x389072['fieldType']==='datetime'){_0x5f3e07[_0xa659('0x31')]=_0xa659('0x32');}var _0x375a65=as[_0xa659('0x33')](_0x536303,_0x389072[_0xa659('0x34')],_0x5f3e07);_0x4cf817[_0xa659('0x35')][_0x1c4547](_0x375a65['text'],_0x375a65[_0xa659('0x36')][_0xa659('0x37')],_0x375a65[_0xa659('0x36')][_0xa659('0x38')]);}else{if(_0x5f3e07[_0xa659('0x1d')]===_0xa659('0x39')){var _0x2f9d93=_0x5f3e07['value']['split'](',')['map'](function(_0x2fc20c){return Number(_0x2fc20c);});var _0x2ce625=parseTagParameter(_0x2f9d93);_0x4cf817[_0xa659('0x3a')]['clause'][_0xa659('0x3b')](_0x2ce625);_0x4cf817[_0xa659('0x3a')][_0xa659('0x3c')]=_0x2f9d93;}else if(_0x5f3e07[_0xa659('0x1d')]===_0xa659('0x3d')){_0x4cf817[_0xa659('0x3e')][_0xa659('0x3f')][_0xa659('0x3b')](_0xa659('0x40'),_0x5f3e07[_0xa659('0x36')]);_0x4cf817[_0xa659('0x3e')]['skip']=!![];}}}return _0x4cf817;}function parseModelFields(_0x10ccd4,_0x439be1){var _0x44be72=squel[_0xa659('0x1f')]();var _0x1f5236=_(_0x10ccd4)['keys']()['map'](function(_0x2748da){return _['some'](_0x439be1,[_0xa659('0x2f'),_0x2748da])?_0x2748da:undefined;})[_0xa659('0x41')]()['value']();if(_0x10ccd4[_0xa659('0x42')]){_0x1f5236[_0xa659('0x1c')](_0xa659('0x42'));}if(_0x10ccd4['User']){_0x1f5236['push'](_0xa659('0x3d'));}if(_0x1f5236[_0xa659('0x23')]>0x0){_0x1f5236['forEach'](function(_0x3edacb){if(_0x3edacb===_0xa659('0x7')){_0x44be72['and'](_0xa659('0x43'),[][_0xa659('0x44')](_0x10ccd4[_0x3edacb]));}else if(_0x3edacb===_0xa659('0x42')){var _0x928c07='%'+_0x10ccd4[_0x3edacb]+'%';_0x44be72[_0xa659('0x3b')](_0xa659('0x45'),_0x928c07);}else if(_0x3edacb===_0xa659('0x3d')){_0x44be72[_0xa659('0x3b')](_0xa659('0x40'),_0x10ccd4[_0x3edacb]);}else{_0x44be72[_0xa659('0x3b')]('c.'+_0x3edacb+_0xa659('0x46'),_0x10ccd4[_0x3edacb]);}});}return _0x44be72;}function parseQueryParameters(_0x4fb7a4,_0x46185d){var _0x4825d4=getSqlClauses();return Promise[_0xa659('0x47')]()[_0xa659('0x48')](function(){return parseModelFields(_0x4fb7a4,_0x46185d);})[_0xa659('0x48')](function(_0x2fc305){_0x4825d4[_0xa659('0x49')][_0xa659('0x3b')](_0x2fc305);return parseTagParameter(_0x4fb7a4[_0xa659('0x4a')]);})[_0xa659('0x48')](function(_0x1ab536){_0x4825d4[_0xa659('0x3a')][_0xa659('0x3f')][_0xa659('0x3b')](_0x1ab536);return parseSearchFilter(_0x4fb7a4[_0xa659('0x4b')]);})[_0xa659('0x48')](function(_0x274497){_0x4825d4[_0xa659('0x4b')]=_0x274497;return _0x4825d4;});}function checkListsRestrictions(_0x47a092,_0x40cc21,_0x322670){var _0x40b4ce=squel[_0xa659('0x1f')]();return Promise['resolve']()['then'](function(){if(_0x40cc21[_0xa659('0x6')]&&_0x47a092[_0xa659('0x4c')]===_0xa659('0x5')&&!_0x322670){return _0x47a092[_0xa659('0x4d')]({'attributes':['id'],'raw':!![]});}})[_0xa659('0x48')](function(_0x18d762){if(_0x18d762){if(_0x18d762[_0xa659('0x23')]===0x0){_0x40b4ce['and'](_0xa659('0x4e'));}else{_0x40b4ce[_0xa659('0x3b')](_0xa659('0x43'),_[_0xa659('0x4f')](_0x18d762,'id'));}}})['then'](function(){return _0x40b4ce;});}function buildContactsQuery(_0x4289ed,_0x14da7a,_0x4c60a1,_0x374ae5,_0x494cb0,_0x420745){if(_0x14da7a){_0x14da7a=_0x4c60a1[_0xa659('0x50')];}_0x4289ed=addFieldsToQuery(_0x4289ed,_0x14da7a,_0x374ae5,_0x420745,!![]);var _0x30ea8c=squel[_0xa659('0x51')]();_0x30ea8c=addFieldsToQuery(_0x30ea8c,_0x14da7a,_0x374ae5,_0x420745,![]);if(_0x374ae5||_0x420745){_0x4289ed=applyJoinClauses(_0x4289ed,!![]);_0x4289ed[_0xa659('0x52')](_0xa659('0x53'));if(_0x4c60a1['limit']){_0x30ea8c[_0xa659('0x54')](_0x4c60a1[_0xa659('0x54')]);}if(_0x4c60a1['offset']){_0x30ea8c[_0xa659('0x55')](_0x4c60a1[_0xa659('0x55')]);}}else{_0x30ea8c=applyJoinClauses(_0x30ea8c,![]);_0x30ea8c[_0xa659('0x52')]('subqry.id');if(_0x4c60a1['limit']){_0x4289ed['limit'](_0x4c60a1[_0xa659('0x54')]);}if(_0x4c60a1[_0xa659('0x55')]){_0x4289ed['offset'](_0x4c60a1[_0xa659('0x55')]);}}_0x30ea8c['having'](_0x494cb0);if(_0x4c60a1[_0xa659('0x56')]){_0x4c60a1[_0xa659('0x56')][_0xa659('0x21')](function(_0x1632e0){_0x4289ed[_0xa659('0x56')]('c.'+_0x1632e0[0x0],_0x1632e0[0x1]===_0xa659('0x57')?![]:!![]);_0x30ea8c[_0xa659('0x56')]('subqry.'+_0x1632e0[0x0],_0x1632e0[0x1]===_0xa659('0x57')?![]:!![]);});}_0x30ea8c[_0xa659('0x58')](_0x4289ed,'subqry');return _0x30ea8c;}function getFilteredContacts(_0x41278c){var _0x330966=[];return db[_0xa659('0x39')][_0xa659('0x59')]({'attributes':['id',_0xa659('0x2f'),_0xa659('0x5a')],'raw':!![]})[_0xa659('0x48')](function(_0x35efe2){_0x330966=_[_0xa659('0x5b')](_0x35efe2,'id');var _0x5928b4={'type':db[_0xa659('0x5c')][_0xa659('0x5d')][_0xa659('0x5e')],'model':db[_0xa659('0x5f')],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0xa659('0x60')][_0xa659('0x61')](_0x41278c[_0xa659('0x62')](),_0x5928b4);})[_0xa659('0x48')](function(_0x3014b9){_0x3014b9['forEach'](function(_0x3e5e4e){if(_0x3e5e4e[_0xa659('0x1a')]){_0x3e5e4e['Tags']=[];_0x3e5e4e[_0xa659('0x1a')][_0xa659('0x63')](',')['forEach'](function(_0x2d3dca){_0x3e5e4e[_0xa659('0x64')][_0xa659('0x1c')](_0x330966[_0x2d3dca]);});}delete _0x3e5e4e[_0xa659('0x1a')];});return _0x3014b9;});}function countFilteredContacts(_0x29466c,_0x3b99db){var _0x38949d=_0x29466c[_0xa659('0x65')]();_0x38949d['field'](_0xa659('0x66'));_0x38949d=applyJoinClauses(_0x38949d,!![]);_0x29466c['group'](_0xa659('0x53'));var _0x29e7cc=utils[_0xa659('0x20')](_0x3b99db);if(!_[_0xa659('0x67')](_0x29e7cc)){_0x38949d['where'](_0xa659('0x68'),_0x29e7cc);}var _0x18453d={'type':db[_0xa659('0x5c')]['QueryTypes']['SELECT'],'raw':!![]};return db[_0xa659('0x60')]['query'](_0x38949d[_0xa659('0x62')](),_0x18453d)[_0xa659('0x48')](function(_0x36e5a4){return _0x36e5a4[0x0][_0xa659('0x66')];});}module[_0xa659('0x69')]={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery}; \ No newline at end of file +var _0x10b5=['group','c.id','limit','offset','subqry.id','having','order','DESC','subqry.','findAll','color','Sequelize','QueryTypes','query','toString','Tags','clone','where','t.id\x20IN\x20?','sequelize','exports','lodash','squel','../parsers/qs','role','agent','ListId','autocomplete','select','from','cm_contacts','c.deletedAt\x20IS\x20NULL','subqry','cm_user_has_contacts','uc.CmContactId\x20=\x20','.id','left_join','cm_contact_has_tags','ct.CmContactId\x20=\x20','fax','email','CompanyId','createdAt','updatedAt','deletedAt','includes','push','TagIds','field','expr','getSelectedTags','forEach','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','replace','getFullTextValue','c.id\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.lastName\x20LIKE\x20?','c.email\x20LIKE\x20?','parseSearch','sqlOperator','conditions','length','find','name','dateOfBirth','fieldType','datetime','castTo','DATE','buildExpression','text','value','start','end','Tag','split','tags','clause','ids','User','user','and','uc.UserId\x20=\x20?','skip','keys','map','some','compact','Contact','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','resolve','then','fields','filter','search'];(function(_0xd28d86,_0x3aa4af){var _0x2da14d=function(_0x282981){while(--_0x282981){_0xd28d86['push'](_0xd28d86['shift']());}};_0x2da14d(++_0x3aa4af);}(_0x10b5,0x79));var _0x510b=function(_0x3ed110,_0x2708e6){_0x3ed110=_0x3ed110-0x0;var _0x43acfa=_0x10b5[_0x3ed110];return _0x43acfa;};'use strict';var _=require(_0x510b('0x0'));var squel=require(_0x510b('0x1'));var as=require('../parsers/advancedSearch');var qs=require(_0x510b('0x2'));var utils=require('../interaction/utils');var db=require('../../mysqldb')['db'];function skipContactsQuery(_0x48b0ef,_0x42dde5){var _0x384071=![];if(_0x48b0ef[_0x510b('0x3')]===_0x510b('0x4')&&!_0x42dde5['search']&&!_0x42dde5[_0x510b('0x5')]&&_0x42dde5[_0x510b('0x6')]!=='true'){_0x384071=!![];}return _0x384071;}function getContactsSubquery(){return squel[_0x510b('0x7')]()[_0x510b('0x8')](_0x510b('0x9'),'c')['where'](_0x510b('0xa'));}function applyJoinClauses(_0x1e937d,_0x82e006){var _0x2ec2bd=_0x82e006?'c':_0x510b('0xb');_0x1e937d['left_join'](_0x510b('0xc'),'uc',_0x510b('0xd')+_0x2ec2bd+_0x510b('0xe'))[_0x510b('0xf')](_0x510b('0x10'),'ct',_0x510b('0x11')+_0x2ec2bd+_0x510b('0xe'))[_0x510b('0xf')]('tools_tags','t','t.id\x20=\x20ct.TagId');return _0x1e937d;}function addFieldsToQuery(_0x2a3029,_0x592a92,_0x107978,_0x4d1c68,_0x3c5e2e){var _0x2f408f=_0x3c5e2e?'c':_0x510b('0xb');if(!_0x592a92){_0x592a92=['id','firstName','lastName','phone','mobile',_0x510b('0x12'),_0x510b('0x13'),_0x510b('0x5'),_0x510b('0x14'),_0x510b('0x15'),_0x510b('0x16'),_0x510b('0x17'),'TagIds'];}else if(!_0x592a92[_0x510b('0x18')]('id')){_0x592a92[_0x510b('0x19')]('id');}var _0x4538bf=_0x107978&&_0x3c5e2e||!_0x107978&&!_0x3c5e2e;if(_0x4d1c68){_0x4538bf=_0x4d1c68&&_0x3c5e2e||!_0x4d1c68&&!_0x3c5e2e;}_0x592a92['forEach'](function(_0x2df70c){if(_0x2df70c===_0x510b('0x1a')){if(_0x4538bf){_0x2a3029[_0x510b('0x1b')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x2df70c);}else if(_0x107978||_0x4d1c68){_0x2a3029['field'](_0x2f408f+'.'+_0x2df70c);}}else{_0x2a3029[_0x510b('0x1b')](_0x2f408f+'.'+_0x2df70c);}});return _0x2a3029;}function getSqlClauses(){var _0x4a47ba={'default':squel[_0x510b('0x1c')](),'fields':squel[_0x510b('0x1c')](),'filter':squel['expr'](),'tags':{'clause':squel[_0x510b('0x1c')](),'ids':null},'user':{'clause':squel[_0x510b('0x1c')](),'skip':![]}};return _0x4a47ba;}function parseTagParameter(_0xc8b7bf){var _0x536ac0=squel[_0x510b('0x1c')]();if(_0xc8b7bf){var _0x57e8aa=utils[_0x510b('0x1d')](_0xc8b7bf);_0x57e8aa[_0x510b('0x1e')](function(_0x36065b){_0x536ac0['or'](_0x510b('0x1f'),'%,'+_0x36065b+',%');});}return _0x536ac0;}function parseSearchFilter(_0x584ac9){var _0x4c1312=squel[_0x510b('0x1c')]();if(_0x584ac9){var _0x18a795=_0x584ac9['replace']('\x5c','\x5c\x5c')[_0x510b('0x20')](/'/g,'\x27\x27');if(_0x18a795['split']('\x20')['length']>0x1){_0x4c1312['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x510b('0x21')](_0x18a795,!![]),null);}else{if(qs['isNumeric'](_0x18a795)){_0x4c1312['or'](_0x510b('0x22'),_0x18a795+'%');_0x4c1312['or']('c.phone\x20LIKE\x20?',_0x18a795+'%');_0x4c1312['or']('c.mobile\x20LIKE\x20?',_0x18a795+'%');_0x4c1312['or'](_0x510b('0x23'),_0x18a795+'%');}else if(qs[_0x510b('0x24')](_0x18a795)){_0x4c1312['or']('c.email\x20LIKE\x20?',_0x18a795+'%');}else{_0x4c1312['or']('c.firstName\x20LIKE\x20?','%'+_0x18a795+'%');_0x4c1312['or'](_0x510b('0x25'),'%'+_0x18a795+'%');_0x4c1312['or'](_0x510b('0x26'),'%'+_0x18a795+'%');}}}return _0x4c1312;}function parseAdvancedSearchFilter(_0x289369,_0x564588){var _0x329f96=getSqlClauses();var _0x3a7334=as[_0x510b('0x27')](_0x289369);var _0x51d582=_0x3a7334[_0x510b('0x28')];for(var _0x19921c=0x0;_0x19921c<_0x3a7334[_0x510b('0x29')][_0x510b('0x2a')];_0x19921c++){var _0x3e82c6=_0x3a7334[_0x510b('0x29')][_0x19921c];var _0x5510e1='c';var _0x3da683=_[_0x510b('0x2b')](_0x564588,[_0x510b('0x2c'),_0x3e82c6[_0x510b('0x1b')]]);if(_0x3da683){if(_0x3e82c6[_0x510b('0x1b')]===_0x510b('0x2d')||_0x3da683[_0x510b('0x2e')]===_0x510b('0x2f')){_0x3e82c6[_0x510b('0x30')]=_0x510b('0x31');}var _0x10bf20=as[_0x510b('0x32')](_0x5510e1,_0x3da683['type'],_0x3e82c6);_0x329f96['default'][_0x51d582](_0x10bf20[_0x510b('0x33')],_0x10bf20[_0x510b('0x34')][_0x510b('0x35')],_0x10bf20[_0x510b('0x34')][_0x510b('0x36')]);}else{if(_0x3e82c6[_0x510b('0x1b')]===_0x510b('0x37')){var _0x99bb37=_0x3e82c6[_0x510b('0x34')][_0x510b('0x38')](',')['map'](function(_0x354276){return Number(_0x354276);});var _0x5e6744=parseTagParameter(_0x99bb37);_0x329f96[_0x510b('0x39')][_0x510b('0x3a')]['and'](_0x5e6744);_0x329f96[_0x510b('0x39')][_0x510b('0x3b')]=_0x99bb37;}else if(_0x3e82c6[_0x510b('0x1b')]===_0x510b('0x3c')){_0x329f96[_0x510b('0x3d')][_0x510b('0x3a')][_0x510b('0x3e')](_0x510b('0x3f'),_0x3e82c6[_0x510b('0x34')]);_0x329f96[_0x510b('0x3d')][_0x510b('0x40')]=!![];}}}return _0x329f96;}function parseModelFields(_0x30bea7,_0x5b282b){var _0x63e7b7=squel[_0x510b('0x1c')]();var _0x55bbb3=_(_0x30bea7)[_0x510b('0x41')]()[_0x510b('0x42')](function(_0x3eb679){return _[_0x510b('0x43')](_0x5b282b,['name',_0x3eb679])?_0x3eb679:undefined;})[_0x510b('0x44')]()['value']();if(_0x30bea7[_0x510b('0x45')]){_0x55bbb3[_0x510b('0x19')]('Contact');}if(_0x30bea7[_0x510b('0x3c')]){_0x55bbb3['push'](_0x510b('0x3c'));}if(_0x55bbb3['length']>0x0){_0x55bbb3[_0x510b('0x1e')](function(_0x4fbe1e){if(_0x4fbe1e===_0x510b('0x5')){_0x63e7b7[_0x510b('0x3e')](_0x510b('0x46'),[][_0x510b('0x47')](_0x30bea7[_0x4fbe1e]));}else if(_0x4fbe1e==='Contact'){var _0x18b5ad='%'+_0x30bea7[_0x4fbe1e]+'%';_0x63e7b7[_0x510b('0x3e')](_0x510b('0x48'),_0x18b5ad);}else if(_0x4fbe1e===_0x510b('0x3c')){_0x63e7b7[_0x510b('0x3e')]('uc.UserId\x20=\x20?',_0x30bea7[_0x4fbe1e]);}else{_0x63e7b7[_0x510b('0x3e')]('c.'+_0x4fbe1e+_0x510b('0x49'),_0x30bea7[_0x4fbe1e]);}});}return _0x63e7b7;}function parseQueryParameters(_0x405787,_0x5b7a4f){var _0x2dcc91=getSqlClauses();return Promise[_0x510b('0x4a')]()[_0x510b('0x4b')](function(){return parseModelFields(_0x405787,_0x5b7a4f);})[_0x510b('0x4b')](function(_0x1ab7b6){_0x2dcc91[_0x510b('0x4c')][_0x510b('0x3e')](_0x1ab7b6);return parseTagParameter(_0x405787['tag']);})['then'](function(_0x2e4cde){_0x2dcc91[_0x510b('0x39')][_0x510b('0x3a')][_0x510b('0x3e')](_0x2e4cde);return parseSearchFilter(_0x405787[_0x510b('0x4d')]);})[_0x510b('0x4b')](function(_0x375496){_0x2dcc91[_0x510b('0x4d')]=_0x375496;return _0x2dcc91;});}function checkListsRestrictions(_0x1ba3de,_0x479bcc,_0x49f625){var _0x2cbbaa=squel[_0x510b('0x1c')]();return Promise[_0x510b('0x4a')]()['then'](function(){if(_0x479bcc[_0x510b('0x4e')]&&_0x1ba3de['role']==='agent'&&!_0x49f625){return _0x1ba3de['getLists']({'attributes':['id'],'raw':!![]});}})[_0x510b('0x4b')](function(_0x5a6b73){if(_0x5a6b73){if(_0x5a6b73[_0x510b('0x2a')]===0x0){_0x2cbbaa[_0x510b('0x3e')]('c.ListId\x20IS\x20NULL');}else{_0x2cbbaa[_0x510b('0x3e')](_0x510b('0x46'),_[_0x510b('0x42')](_0x5a6b73,'id'));}}})[_0x510b('0x4b')](function(){return _0x2cbbaa;});}function buildContactsQuery(_0x157107,_0xfbf116,_0x51588b,_0x28fa1a,_0x452e57,_0x58042a){if(_0xfbf116){_0xfbf116=_0x51588b['attributes'];}_0x157107=addFieldsToQuery(_0x157107,_0xfbf116,_0x28fa1a,_0x58042a,!![]);var _0x4f4e1d=squel[_0x510b('0x7')]();_0x4f4e1d=addFieldsToQuery(_0x4f4e1d,_0xfbf116,_0x28fa1a,_0x58042a,![]);if(_0x28fa1a||_0x58042a){_0x157107=applyJoinClauses(_0x157107,!![]);_0x157107[_0x510b('0x4f')](_0x510b('0x50'));if(_0x51588b[_0x510b('0x51')]){_0x4f4e1d[_0x510b('0x51')](_0x51588b[_0x510b('0x51')]);}if(_0x51588b[_0x510b('0x52')]){_0x4f4e1d[_0x510b('0x52')](_0x51588b[_0x510b('0x52')]);}}else{_0x4f4e1d=applyJoinClauses(_0x4f4e1d,![]);_0x4f4e1d['group'](_0x510b('0x53'));if(_0x51588b[_0x510b('0x51')]){_0x157107['limit'](_0x51588b[_0x510b('0x51')]);}if(_0x51588b[_0x510b('0x52')]){_0x157107['offset'](_0x51588b[_0x510b('0x52')]);}}_0x4f4e1d[_0x510b('0x54')](_0x452e57);if(_0x51588b[_0x510b('0x55')]){_0x51588b[_0x510b('0x55')][_0x510b('0x1e')](function(_0x56f52b){_0x157107['order']('c.'+_0x56f52b[0x0],_0x56f52b[0x1]===_0x510b('0x56')?![]:!![]);_0x4f4e1d[_0x510b('0x55')](_0x510b('0x57')+_0x56f52b[0x0],_0x56f52b[0x1]===_0x510b('0x56')?![]:!![]);});}_0x4f4e1d['from'](_0x157107,'subqry');return _0x4f4e1d;}function getFilteredContacts(_0x1f98eb){var _0x4c9f69=[];return db['Tag'][_0x510b('0x58')]({'attributes':['id',_0x510b('0x2c'),_0x510b('0x59')],'raw':!![]})[_0x510b('0x4b')](function(_0x58c5b){_0x4c9f69=_['keyBy'](_0x58c5b,'id');var _0x165f31={'type':db[_0x510b('0x5a')][_0x510b('0x5b')]['SELECT'],'model':db['CmContact'],'mapToModel':!![],'nest':!![],'raw':!![]};return db['sequelize'][_0x510b('0x5c')](_0x1f98eb[_0x510b('0x5d')](),_0x165f31);})[_0x510b('0x4b')](function(_0x331ee2){_0x331ee2[_0x510b('0x1e')](function(_0x432168){if(_0x432168[_0x510b('0x1a')]){_0x432168[_0x510b('0x5e')]=[];_0x432168['TagIds'][_0x510b('0x38')](',')[_0x510b('0x1e')](function(_0x501afe){_0x432168[_0x510b('0x5e')][_0x510b('0x19')](_0x4c9f69[_0x501afe]);});}delete _0x432168[_0x510b('0x1a')];});return _0x331ee2;});}function countFilteredContacts(_0x8f935c,_0x36c7ae){var _0x4a17dc=_0x8f935c[_0x510b('0x5f')]();_0x4a17dc[_0x510b('0x1b')]('COUNT(*)');_0x4a17dc=applyJoinClauses(_0x4a17dc,!![]);_0x8f935c[_0x510b('0x4f')](_0x510b('0x50'));var _0xa7ef7=utils[_0x510b('0x1d')](_0x36c7ae);if(!_['isEmpty'](_0xa7ef7)){_0x4a17dc[_0x510b('0x60')](_0x510b('0x61'),_0xa7ef7);}var _0x348949={'type':db[_0x510b('0x5a')][_0x510b('0x5b')]['SELECT'],'raw':!![]};return db[_0x510b('0x62')]['query'](_0x4a17dc[_0x510b('0x5d')](),_0x348949)[_0x510b('0x4b')](function(_0x19c73a){return _0x19c73a[0x0]['COUNT(*)'];});}module[_0x510b('0x63')]={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery}; \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index a3ad00b..1f0d32d 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 _0xc894=['utf8','base64','decryptString','createDecipher','crypto','bluebird','lodash','../../config/environment','../../config/logger','app','secrets','session','aes-256-ctr','aes192','encrypt','algorithm','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','filter','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','data','binary','end','final','close','unlink','decryptFile','write','encryptString','secret','update'];(function(_0x56ad8b,_0x468fe6){var _0x1f1478=function(_0xefc2a7){while(--_0xefc2a7){_0x56ad8b['push'](_0x56ad8b['shift']());}};_0x1f1478(++_0x468fe6);}(_0xc894,0x100));var _0x4c89=function(_0x3a2586,_0xce7f0e){_0x3a2586=_0x3a2586-0x0;var _0x40671d=_0xc894[_0x3a2586];return _0x40671d;};'use strict';var crypto=require(_0x4c89('0x0'));var fs=require('fs');var BPromise=require(_0x4c89('0x1'));var _=require(_0x4c89('0x2'));var config=require(_0x4c89('0x3'));var logger=require(_0x4c89('0x4'))(_0x4c89('0x5'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x4c89('0x6')][_0x4c89('0x7')],'algorithm':_0x4c89('0x8')};const fileOptions={'algorithm':_0x4c89('0x9')};if(config[_0x4c89('0xa')]&&config['encrypt'][_0x4c89('0xb')]){var isSupported=isAlgorithmSupported(config[_0x4c89('0xa')][_0x4c89('0xb')]);if(isSupported){fileOptions[_0x4c89('0xb')]=config['encrypt']['algorithm'];}else{var supportedAlgorithms=getSupportedCiphers()['join'](',\x20');logger['error'](config[_0x4c89('0xa')][_0x4c89('0xb')],_0x4c89('0xc'),supportedAlgorithms);}}function isASupportedCipher(_0x449fb0){return AES_SUPPORTED_RX[_0x4c89('0xd')](_0x449fb0);}function getSupportedCiphers(){return crypto[_0x4c89('0xe')]()[_0x4c89('0xf')](isASupportedCipher);}function isAlgorithmSupported(_0x11d40d){return getSupportedCiphers()['indexOf'](_0x11d40d)>-0x1;}function combineOptions(_0x44c833){var _0x2d089c={};for(var _0x4118f1 in fileOptions){if(fileOptions[_0x4c89('0x10')](_0x4118f1)){_0x2d089c[_0x4118f1]=fileOptions[_0x4118f1];}}if(_0x44c833){for(var _0x33b9bf in _0x44c833){if(_0x44c833[_0x4c89('0x10')](_0x33b9bf)){_0x2d089c[_0x33b9bf]=_0x44c833[_0x33b9bf];}}}return _0x2d089c;}exports[_0x4c89('0x11')]=function(_0x393d51,_0x31d839,_0x4e2002,_0x3c1c45){return new BPromise(function(_0x5e5a22,_0x1d26bb){_0x3c1c45=combineOptions(_0x3c1c45);var _0x1ea3e9=new Buffer(_0x4e2002);var _0xcfb15c=fs[_0x4c89('0x12')](_0x393d51);var _0x45d869=fs[_0x4c89('0x13')](_0x31d839);var _0x5b496a=crypto[_0x4c89('0x14')](_0x3c1c45[_0x4c89('0xb')],_0x1ea3e9);_0xcfb15c['on'](_0x4c89('0x15'),function(_0x50a1e6){var _0x41e644=new Buffer(_0x5b496a['update'](_0x50a1e6),_0x4c89('0x16'));_0x45d869['write'](_0x41e644);});_0xcfb15c['on'](_0x4c89('0x17'),function(){try{var _0x3020d6=new Buffer(_0x5b496a[_0x4c89('0x18')](_0x4c89('0x16')),_0x4c89('0x16'));_0x45d869['write'](_0x3020d6);_0x45d869[_0x4c89('0x17')]();_0x45d869['on'](_0x4c89('0x19'),function(){return _0x5e5a22(_0x31d839);});}catch(_0x344f13){fs[_0x4c89('0x1a')](_0x31d839);return _0x1d26bb(_0x344f13);}});});};exports[_0x4c89('0x1b')]=function(_0xeb8836,_0x77415,_0x16eb0a,_0x23f10b){return new BPromise(function(_0x1c8913,_0x2a1be3){_0x23f10b=combineOptions(_0x23f10b);var _0x553e98=new Buffer(_0x16eb0a);var _0x3e0572=fs[_0x4c89('0x12')](_0xeb8836);var _0x20c305=fs[_0x4c89('0x13')](_0x77415);var _0x375faa=crypto['createDecipher'](_0x23f10b[_0x4c89('0xb')],_0x553e98);_0x3e0572['on'](_0x4c89('0x15'),function(_0x32dbed){var _0x16467c=new Buffer(_0x375faa['update'](_0x32dbed),_0x4c89('0x16'));_0x20c305[_0x4c89('0x1c')](_0x16467c);});_0x3e0572['on'](_0x4c89('0x17'),function(){try{var _0x11307f=new Buffer(_0x375faa[_0x4c89('0x18')](_0x4c89('0x16')),_0x4c89('0x16'));_0x20c305[_0x4c89('0x1c')](_0x11307f);_0x20c305[_0x4c89('0x17')]();_0x20c305['on'](_0x4c89('0x19'),function(){return _0x1c8913(_0x77415);});}catch(_0xc68038){fs[_0x4c89('0x1a')](_0x77415);return _0x2a1be3(_0xc68038);}});});};exports[_0x4c89('0x1d')]=function(_0xa62de8,_0x1403e1,_0x146e8a){var _0x49764d=_0x146e8a||stringOptions['algorithm'];var _0x5ab75f=_0x1403e1||stringOptions[_0x4c89('0x1e')];var _0x123843=crypto[_0x4c89('0x14')](_0x49764d,_0x5ab75f);var _0x2acbdb=_0x123843[_0x4c89('0x1f')](_0xa62de8,_0x4c89('0x20'),_0x4c89('0x21'));_0x2acbdb+=_0x123843[_0x4c89('0x18')](_0x4c89('0x21'));return _0x2acbdb;};exports[_0x4c89('0x22')]=function(_0x4e3818,_0x290ac7,_0x84f774){var _0x4eeca7=_0x84f774||stringOptions[_0x4c89('0xb')];var _0x2fb6e5=_0x290ac7||stringOptions[_0x4c89('0x1e')];var _0x12b133=crypto[_0x4c89('0x23')](_0x4eeca7,_0x2fb6e5);var _0x5078ca=_0x12b133[_0x4c89('0x1f')](_0x4e3818,_0x4c89('0x21'),'utf8');_0x5078ca+=_0x12b133[_0x4c89('0x18')]('utf8');return _0x5078ca;}; \ No newline at end of file +var _0xa754=['binary','write','final','end','unlink','decryptFile','createWriteStream','createDecipher','close','encryptString','secret','createCipher','utf8','base64','decryptString','crypto','lodash','../../config/environment','app','secrets','session','aes-256-ctr','aes192','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','filter','indexOf','hasOwnProperty','encryptFile','createReadStream','data','update'];(function(_0x25a49d,_0x173409){var _0x412009=function(_0x3f63c7){while(--_0x3f63c7){_0x25a49d['push'](_0x25a49d['shift']());}};_0x412009(++_0x173409);}(_0xa754,0x7e));var _0x4a75=function(_0x188379,_0x7fa345){_0x188379=_0x188379-0x0;var _0x3d8a8f=_0xa754[_0x188379];return _0x3d8a8f;};'use strict';var crypto=require(_0x4a75('0x0'));var fs=require('fs');var BPromise=require('bluebird');var _=require(_0x4a75('0x1'));var config=require(_0x4a75('0x2'));var logger=require('../../config/logger')(_0x4a75('0x3'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x4a75('0x4')][_0x4a75('0x5')],'algorithm':_0x4a75('0x6')};const fileOptions={'algorithm':_0x4a75('0x7')};if(config[_0x4a75('0x8')]&&config[_0x4a75('0x8')]['algorithm']){var isSupported=isAlgorithmSupported(config['encrypt'][_0x4a75('0x9')]);if(isSupported){fileOptions[_0x4a75('0x9')]=config[_0x4a75('0x8')][_0x4a75('0x9')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x4a75('0xa')](',\x20');logger[_0x4a75('0xb')](config[_0x4a75('0x8')][_0x4a75('0x9')],_0x4a75('0xc'),supportedAlgorithms);}}function isASupportedCipher(_0xcd3cdc){return AES_SUPPORTED_RX[_0x4a75('0xd')](_0xcd3cdc);}function getSupportedCiphers(){return crypto[_0x4a75('0xe')]()[_0x4a75('0xf')](isASupportedCipher);}function isAlgorithmSupported(_0x30a84d){return getSupportedCiphers()[_0x4a75('0x10')](_0x30a84d)>-0x1;}function combineOptions(_0x4735c8){var _0x250150={};for(var _0x239727 in fileOptions){if(fileOptions[_0x4a75('0x11')](_0x239727)){_0x250150[_0x239727]=fileOptions[_0x239727];}}if(_0x4735c8){for(var _0x2a3798 in _0x4735c8){if(_0x4735c8[_0x4a75('0x11')](_0x2a3798)){_0x250150[_0x2a3798]=_0x4735c8[_0x2a3798];}}}return _0x250150;}exports[_0x4a75('0x12')]=function(_0x4ad6f0,_0x29172c,_0x4a5c06,_0x4bac4e){return new BPromise(function(_0x4e516b,_0x5ea47c){_0x4bac4e=combineOptions(_0x4bac4e);var _0x409770=new Buffer(_0x4a5c06);var _0x1cdc14=fs[_0x4a75('0x13')](_0x4ad6f0);var _0x3e8998=fs['createWriteStream'](_0x29172c);var _0xc6dbf3=crypto['createCipher'](_0x4bac4e[_0x4a75('0x9')],_0x409770);_0x1cdc14['on'](_0x4a75('0x14'),function(_0x3b8eef){var _0x52f20b=new Buffer(_0xc6dbf3[_0x4a75('0x15')](_0x3b8eef),_0x4a75('0x16'));_0x3e8998[_0x4a75('0x17')](_0x52f20b);});_0x1cdc14['on']('end',function(){try{var _0x692b83=new Buffer(_0xc6dbf3[_0x4a75('0x18')](_0x4a75('0x16')),_0x4a75('0x16'));_0x3e8998[_0x4a75('0x17')](_0x692b83);_0x3e8998[_0x4a75('0x19')]();_0x3e8998['on']('close',function(){return _0x4e516b(_0x29172c);});}catch(_0x43b8a3){fs[_0x4a75('0x1a')](_0x29172c);return _0x5ea47c(_0x43b8a3);}});});};exports[_0x4a75('0x1b')]=function(_0x2a50b8,_0x13ce8c,_0x153f6e,_0x485258){return new BPromise(function(_0x31d810,_0x481c7d){_0x485258=combineOptions(_0x485258);var _0x2ed9dd=new Buffer(_0x153f6e);var _0x1a6092=fs[_0x4a75('0x13')](_0x2a50b8);var _0x6e8d06=fs[_0x4a75('0x1c')](_0x13ce8c);var _0x4619ed=crypto[_0x4a75('0x1d')](_0x485258[_0x4a75('0x9')],_0x2ed9dd);_0x1a6092['on'](_0x4a75('0x14'),function(_0x202a24){var _0x320d92=new Buffer(_0x4619ed['update'](_0x202a24),'binary');_0x6e8d06[_0x4a75('0x17')](_0x320d92);});_0x1a6092['on']('end',function(){try{var _0x3e0de4=new Buffer(_0x4619ed[_0x4a75('0x18')]('binary'),_0x4a75('0x16'));_0x6e8d06[_0x4a75('0x17')](_0x3e0de4);_0x6e8d06[_0x4a75('0x19')]();_0x6e8d06['on'](_0x4a75('0x1e'),function(){return _0x31d810(_0x13ce8c);});}catch(_0x155add){fs['unlink'](_0x13ce8c);return _0x481c7d(_0x155add);}});});};exports[_0x4a75('0x1f')]=function(_0x18576b,_0x4a4805,_0x5ef29){var _0x18a5e9=_0x5ef29||stringOptions['algorithm'];var _0x349b60=_0x4a4805||stringOptions[_0x4a75('0x20')];var _0x37aaf8=crypto[_0x4a75('0x21')](_0x18a5e9,_0x349b60);var _0x4de633=_0x37aaf8[_0x4a75('0x15')](_0x18576b,_0x4a75('0x22'),_0x4a75('0x23'));_0x4de633+=_0x37aaf8[_0x4a75('0x18')](_0x4a75('0x23'));return _0x4de633;};exports[_0x4a75('0x24')]=function(_0x5e9eb4,_0x10303d,_0x92e822){var _0x40a338=_0x92e822||stringOptions[_0x4a75('0x9')];var _0x7304d7=_0x10303d||stringOptions[_0x4a75('0x20')];var _0x233c4c=crypto[_0x4a75('0x1d')](_0x40a338,_0x7304d7);var _0x40a5c6=_0x233c4c[_0x4a75('0x15')](_0x5e9eb4,_0x4a75('0x23'),_0x4a75('0x22'));_0x40a5c6+=_0x233c4c[_0x4a75('0x18')](_0x4a75('0x22'));return _0x40a5c6;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 00d433a..29c165b 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 _0x4681=['basename','.csv','existsSync','join','%s%d.%s','csv','%s.%s','writeFileSync','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','exit','util','path','lodash','to-csv','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','update','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','split','splitSizeCsv','then','sequelize','format','QueryTypes','num','range','isInteger','forEach','push','query','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','dirname'];(function(_0x2d5f1c,_0x4860c0){var _0x32387a=function(_0x51a64a){while(--_0x51a64a){_0x2d5f1c['push'](_0x2d5f1c['shift']());}};_0x32387a(++_0x4860c0);}(_0x4681,0x1ef));var _0x1468=function(_0x4a85f0,_0x2e02fb){_0x4a85f0=_0x4a85f0-0x0;var _0x5edb89=_0x4681[_0x4a85f0];return _0x5edb89;};'use strict';var util=require(_0x1468('0x0'));var path=require(_0x1468('0x1'));var _=require(_0x1468('0x2'));var csv=require(_0x1468('0x3'));var fs=require('fs');var BPromise=require(_0x1468('0x4'));var zipdir=require(_0x1468('0x5'));var rimraf=require(_0x1468('0x6'));var db=require(_0x1468('0x7'))['db'];var dbH=require('../../mysqldb')[_0x1468('0x8')];var logger=require(_0x1468('0x9'))(_0x1468('0xa'));var EXTRACTED_REPORT_ID=Number(process[_0x1468('0xb')][0x2]);var QUERY=process[_0x1468('0xb')][0x3];var PATH=process[_0x1468('0xb')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x4d8c68,_0x6421de){var _0xbbfe9b={'status':_0x4d8c68};var _0x467c48={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x6421de){_0xbbfe9b['savename']=_0x6421de;}return db['AnalyticExtractedReport'][_0x1468('0xc')](_0xbbfe9b,_0x467c48);}function main(){var _0x3252a8=0x1388;var _0xa29ec;logger[_0x1468('0xd')](util['format'](_0x1468('0xe'),EXTRACTED_REPORT_ID,_0x1468('0xf')));return db[_0x1468('0x10')][_0x1468('0x11')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x1468('0x12'),_0x1468('0x13')]})['then'](function(_0x53f624){if(_0x53f624){_0xa29ec=_0x53f624;_0x3252a8=_0xa29ec[_0x1468('0x13')]||0x1388;}})[_0x1468('0x14')](function(){return dbH[_0x1468('0x15')]['query'](util[_0x1468('0x16')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x1468('0x15')][_0x1468('0x17')]['SELECT']});})[_0x1468('0x14')](function(_0x59a35e){if(!_0x59a35e[0x0][_0x1468('0x18')]){return analyticExtractedReport('Empty');}var _0x407104=[];var _0x519bfe=0x0;if(_0xa29ec[_0x1468('0x12')]){if(_0x59a35e&&_0x59a35e['length']){var _0x13c384=_[_0x1468('0x19')](_0x59a35e[0x0][_0x1468('0x18')]/_0x3252a8);var _0x206f94=Number[_0x1468('0x1a')](_0x59a35e[0x0][_0x1468('0x18')]/_0x3252a8)?_0x59a35e[0x0][_0x1468('0x18')]%_0x3252a8:0x0;_0x13c384[_0x1468('0x1b')](function(_0x1d6e6b){if(_0x1d6e6b>0x0){_0x519bfe+=_0x3252a8;}_0x407104[_0x1468('0x1c')](dbH[_0x1468('0x15')][_0x1468('0x1d')](util[_0x1468('0x16')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x3252a8,_0x519bfe),{'type':dbH[_0x1468('0x15')]['QueryTypes']['SELECT']}));});if(_0x206f94>0x0){_0x519bfe+=_0x3252a8;_0x407104[_0x1468('0x1c')](dbH[_0x1468('0x15')]['query'](util[_0x1468('0x16')](_0x1468('0x1e'),QUERY,_0x206f94,_0x519bfe),{'type':dbH[_0x1468('0x15')][_0x1468('0x17')][_0x1468('0x1f')]}));}}}else{_0x407104[_0x1468('0x1c')](dbH[_0x1468('0x15')][_0x1468('0x1d')](QUERY,{'type':dbH[_0x1468('0x15')][_0x1468('0x17')][_0x1468('0x1f')]}));}var _0x33e6dc=path[_0x1468('0x20')](PATH);var _0x27eab3=path[_0x1468('0x21')](PATH,_0x1468('0x22'));var _0x33cace=_0xa29ec['split']&&_0x407104['length']>0x1;var _0x598a32=[];if(!fs[_0x1468('0x23')](path[_0x1468('0x24')](_0x33e6dc,_0x27eab3))&&_0x33cace){fs['mkdirSync'](path[_0x1468('0x24')](_0x33e6dc,_0x27eab3));}return BPromise['each'](_0x407104,function(_0x49bea8){_0x598a32[_0x1468('0x1c')](_0x49bea8);})[_0x1468('0x14')](function(){for(var _0x4bc606=0x0;_0x4bc606<_0x598a32['length'];_0x4bc606+=0x1){var _0x54d602;var _0xba7b4a=_0x598a32[_0x4bc606];if(_0x33cace){_0x54d602=path[_0x1468('0x24')](_0x33e6dc,_0x27eab3,util[_0x1468('0x16')](_0x1468('0x25'),_0x27eab3,_0x4bc606,_0x1468('0x26')));}else{_0x54d602=path['join'](_0x33e6dc,util['format'](_0x1468('0x27'),_0x27eab3,'csv'));}fs[_0x1468('0x28')](_0x54d602,csv(_0xba7b4a));}})[_0x1468('0x14')](function(){if(_0x33cace){return new Promise(function(_0x243baa){zipdir(path[_0x1468('0x24')](_0x33e6dc,_0x27eab3),{'saveTo':path['join'](_0x33e6dc,util[_0x1468('0x16')](_0x1468('0x27'),_0x27eab3,_0x1468('0x29')))},function(_0x1878e5,_0xd2e581){rimraf(path[_0x1468('0x24')](_0x33e6dc,_0x27eab3),function(){});_0x243baa('zip\x20finished');});});}})[_0x1468('0x14')](function(){logger[_0x1468('0xd')](util['format'](_0x1468('0x2a'),EXTRACTED_REPORT_ID,_0x1468('0xf')));return analyticExtractedReport(_0x1468('0x2b'),_0x33cace?util[_0x1468('0x16')](_0x1468('0x27'),_0x27eab3,_0x33cace?_0x1468('0x29'):_0x1468('0x26')):null);});})[_0x1468('0x2c')](function(_0x5890e4){logger[_0x1468('0xd')](util['format'](_0x1468('0x2d'),EXTRACTED_REPORT_ID,_0x1468('0xf')),util['inspect'](_0x5890e4,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x1468('0x2e'));})['finally'](function(){process[_0x1468('0x2f')](EXIT_CODE);});}main(); \ No newline at end of file +var _0xbcc7=['length','range','push','QueryTypes','%s\x20limit\x20%d\x20OFFSET\x20%d','.csv','existsSync','join','each','%s%d.%s','%s.%s','csv','writeFileSync','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','Completed','zip','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','util','lodash','bluebird','zip-dir','rimraf','../../mysqldb','argv','savename','AnalyticExtractedReport','info','format','Setting','find','split','splitSizeCsv','then','sequelize','query','SELECT','num'];(function(_0x304bbf,_0x3aa159){var _0x4a01a8=function(_0x1c1b2e){while(--_0x1c1b2e){_0x304bbf['push'](_0x304bbf['shift']());}};_0x4a01a8(++_0x3aa159);}(_0xbcc7,0x6a));var _0x7bcc=function(_0x5abe93,_0x12e222){_0x5abe93=_0x5abe93-0x0;var _0x1e6598=_0xbcc7[_0x5abe93];return _0x1e6598;};'use strict';var util=require(_0x7bcc('0x0'));var path=require('path');var _=require(_0x7bcc('0x1'));var csv=require('to-csv');var fs=require('fs');var BPromise=require(_0x7bcc('0x2'));var zipdir=require(_0x7bcc('0x3'));var rimraf=require(_0x7bcc('0x4'));var db=require(_0x7bcc('0x5'))['db'];var dbH=require('../../mysqldb')['dbH'];var logger=require('../../config/logger')('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x7bcc('0x6')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x7bcc('0x6')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0xad1f6b,_0x3485f4){var _0x103cbb={'status':_0xad1f6b};var _0x12a1ad={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3485f4){_0x103cbb[_0x7bcc('0x7')]=_0x3485f4;}return db[_0x7bcc('0x8')]['update'](_0x103cbb,_0x12a1ad);}function main(){var _0x546108=0x1388;var _0xc6f6d9;logger[_0x7bcc('0x9')](util[_0x7bcc('0xa')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'CSV'));return db[_0x7bcc('0xb')][_0x7bcc('0xc')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x7bcc('0xd'),_0x7bcc('0xe')]})[_0x7bcc('0xf')](function(_0x2e8829){if(_0x2e8829){_0xc6f6d9=_0x2e8829;_0x546108=_0xc6f6d9[_0x7bcc('0xe')]||0x1388;}})['then'](function(){return dbH[_0x7bcc('0x10')][_0x7bcc('0x11')](util[_0x7bcc('0xa')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x7bcc('0x10')]['QueryTypes'][_0x7bcc('0x12')]});})[_0x7bcc('0xf')](function(_0x5ef6b4){if(!_0x5ef6b4[0x0][_0x7bcc('0x13')]){return analyticExtractedReport('Empty');}var _0x350ed8=[];var _0x40c52b=0x0;if(_0xc6f6d9['split']){if(_0x5ef6b4&&_0x5ef6b4[_0x7bcc('0x14')]){var _0x55e3ce=_[_0x7bcc('0x15')](_0x5ef6b4[0x0]['num']/_0x546108);var _0x1f34c7=Number['isInteger'](_0x5ef6b4[0x0][_0x7bcc('0x13')]/_0x546108)?_0x5ef6b4[0x0][_0x7bcc('0x13')]%_0x546108:0x0;_0x55e3ce['forEach'](function(_0x4cadb6){if(_0x4cadb6>0x0){_0x40c52b+=_0x546108;}_0x350ed8[_0x7bcc('0x16')](dbH['sequelize'][_0x7bcc('0x11')](util[_0x7bcc('0xa')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x546108,_0x40c52b),{'type':dbH[_0x7bcc('0x10')][_0x7bcc('0x17')][_0x7bcc('0x12')]}));});if(_0x1f34c7>0x0){_0x40c52b+=_0x546108;_0x350ed8['push'](dbH[_0x7bcc('0x10')]['query'](util[_0x7bcc('0xa')](_0x7bcc('0x18'),QUERY,_0x1f34c7,_0x40c52b),{'type':dbH[_0x7bcc('0x10')][_0x7bcc('0x17')][_0x7bcc('0x12')]}));}}}else{_0x350ed8['push'](dbH[_0x7bcc('0x10')]['query'](QUERY,{'type':dbH[_0x7bcc('0x10')]['QueryTypes'][_0x7bcc('0x12')]}));}var _0x859b99=path['dirname'](PATH);var _0x41bc81=path['basename'](PATH,_0x7bcc('0x19'));var _0x17fb32=_0xc6f6d9['split']&&_0x350ed8[_0x7bcc('0x14')]>0x1;var _0x40e090=[];if(!fs[_0x7bcc('0x1a')](path[_0x7bcc('0x1b')](_0x859b99,_0x41bc81))&&_0x17fb32){fs['mkdirSync'](path[_0x7bcc('0x1b')](_0x859b99,_0x41bc81));}return BPromise[_0x7bcc('0x1c')](_0x350ed8,function(_0x276175){_0x40e090['push'](_0x276175);})[_0x7bcc('0xf')](function(){for(var _0x1977c3=0x0;_0x1977c3<_0x40e090['length'];_0x1977c3+=0x1){var _0x2934f3;var _0x117af3=_0x40e090[_0x1977c3];if(_0x17fb32){_0x2934f3=path['join'](_0x859b99,_0x41bc81,util[_0x7bcc('0xa')](_0x7bcc('0x1d'),_0x41bc81,_0x1977c3,'csv'));}else{_0x2934f3=path[_0x7bcc('0x1b')](_0x859b99,util[_0x7bcc('0xa')](_0x7bcc('0x1e'),_0x41bc81,_0x7bcc('0x1f')));}fs[_0x7bcc('0x20')](_0x2934f3,csv(_0x117af3));}})[_0x7bcc('0xf')](function(){if(_0x17fb32){return new Promise(function(_0x11e66a){zipdir(path['join'](_0x859b99,_0x41bc81),{'saveTo':path[_0x7bcc('0x1b')](_0x859b99,util[_0x7bcc('0xa')](_0x7bcc('0x1e'),_0x41bc81,'zip'))},function(_0x5058ec,_0x11ac93){rimraf(path[_0x7bcc('0x1b')](_0x859b99,_0x41bc81),function(){});_0x11e66a('zip\x20finished');});});}})[_0x7bcc('0xf')](function(){logger[_0x7bcc('0x9')](util[_0x7bcc('0xa')](_0x7bcc('0x21'),EXTRACTED_REPORT_ID,_0x7bcc('0x22')));return analyticExtractedReport(_0x7bcc('0x23'),_0x17fb32?util[_0x7bcc('0xa')](_0x7bcc('0x1e'),_0x41bc81,_0x17fb32?_0x7bcc('0x24'):_0x7bcc('0x1f')):null);});})[_0x7bcc('0x25')](function(_0x438da4){logger[_0x7bcc('0x9')](util[_0x7bcc('0xa')](_0x7bcc('0x26'),EXTRACTED_REPORT_ID,'CSV'),util[_0x7bcc('0x27')](_0x438da4,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x7bcc('0x28'));})[_0x7bcc('0x29')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index ac7c237..99bcd91 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 _0x61ed=['pdf','all','%s.%s','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed','zip','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','%s\x20#%d','channel','interactionId','YYYY-MM-DD','center','Interaction\x20Transcript','pipe','createWriteStream','finish','end','createPdfFromHTML','lodash','util','path','moment','html-to-pdfmake','pdfmake/src/printer','zip-dir','rimraf','window','bluebird','../../mysqldb','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','map','tableHeader','pick','toString','fill','auto','body','push','concat','keys','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','length','header','before','\x20/\x20','footer','Arial','black','right','Empty','find','split','splitSizePdf','then','range','num','isInteger','forEach','sequelize','SELECT','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','query','dirname','basename','existsSync','join','mkdirSync','flatten','createPdfKitDocument'];(function(_0x21c23e,_0x1d33e3){var _0xa7b7e2=function(_0x6ac2a8){while(--_0x6ac2a8){_0x21c23e['push'](_0x21c23e['shift']());}};_0xa7b7e2(++_0x1d33e3);}(_0x61ed,0x1df));var _0xd61e=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x61ed[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0xd61e('0x0'));var fs=require('fs');var util=require(_0xd61e('0x1'));var path=require(_0xd61e('0x2'));var moment=require(_0xd61e('0x3'));var htmlToPdfmake=require(_0xd61e('0x4'));var PdfPrinter=require(_0xd61e('0x5'));var zipdir=require(_0xd61e('0x6'));var rimraf=require(_0xd61e('0x7'));var JSDOM=require('jsdom')['JSDOM'];var window=new JSDOM('')[_0xd61e('0x8')];var BPromise=require(_0xd61e('0x9'));var db=require('../../mysqldb')['db'];var dbH=require(_0xd61e('0xa'))[_0xd61e('0xb')];var logger=require(_0xd61e('0xc'))(_0xd61e('0xd'));var EXTRACTED_REPORT_ID=Number(process[_0xd61e('0xe')][0x2]);var QUERY=process['argv'][0x3];var PATH=process['argv'][0x4];var NAME=process[_0xd61e('0xe')][0x5];var FORMAT=_0xd61e('0xf');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x26bb32,_0x45eb38){var _0x3db239={'status':_0x26bb32};var _0x3f5694={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x45eb38){_0x3db239[_0xd61e('0x10')]=_0x45eb38;}return db[_0xd61e('0x11')]['update'](_0x3db239,_0x3f5694);}function getHeaders(_0x17b09c){return _[_0xd61e('0x12')](_0x17b09c,function(_0x1b8cdb){return{'text':_0x1b8cdb,'style':_0xd61e('0x13')};});}function getRows(_0x493885,_0x21f02f){return _[_0xd61e('0x12')](_0x21f02f,function(_0x2c225b){return _(_0x2c225b)[_0xd61e('0x14')](_0x493885)['map'](function(_0x55b53a){return _0x55b53a?_[_0xd61e('0x15')](_0x55b53a):'';})['value']();});}function createTable(_0x14351c,_0x1194b3){var _0x4c9d7f={'widths':_[_0xd61e('0x16')](Array(_0x14351c['length']),0x91),'heights':function(_0x3e668e){return _0x3e668e===0x0?_0xd61e('0x17'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x4036b8=getHeaders(_0x14351c);_0x4c9d7f[_0xd61e('0x18')][_0xd61e('0x19')](_0x4036b8);var _0xc4ade2=getRows(_0x14351c,_0x1194b3);_0x4c9d7f[_0xd61e('0x18')]=_0x4c9d7f[_0xd61e('0x18')][_0xd61e('0x1a')](_0xc4ade2);return _0x4c9d7f;}function createTables(_0x41a1e5){var _0x16590c=[];var _0x1ba652=_['chunk'](Object[_0xd61e('0x1b')](_0x41a1e5[0x0]),0x5);_0x1ba652['forEach'](function(_0x57f699){_0x16590c[_0xd61e('0x19')](createTable(_0x57f699,_0x41a1e5));});return _0x16590c;}function getPDFDocDefinition(_0x1a6b9d){var _0x195932=util[_0xd61e('0x1c')](_0xd61e('0x1d'),NAME,EXTRACTED_REPORT[_0xd61e('0x1e')],moment(EXTRACTED_REPORT[_0xd61e('0x1f')])['format'](FORMAT),moment(EXTRACTED_REPORT['endDate'])[_0xd61e('0x1c')](FORMAT));var _0x1e4a8e=[];for(var _0x4aa645=0x0;_0x4aa645<_0x1a6b9d[_0xd61e('0x20')];_0x4aa645++){var _0x3823b8=[];if(_0x4aa645===0x0){_0x3823b8[_0xd61e('0x19')]({'text':_0x195932,'style':_0xd61e('0x21')});}var _0x24cf6b={'table':_0x1a6b9d[_0x4aa645]};if(_0x4aa645>0x0){_0x24cf6b['pageBreak']=_0xd61e('0x22');_0x24cf6b['margin']=[0x0,0x46,0x0,0x0];}_0x3823b8[_0xd61e('0x19')](_0x24cf6b);_0x1e4a8e[_0xd61e('0x19')](_0x3823b8);}return{'pageSize':'A4','pageOrientation':'landscape','content':_0x1e4a8e,'footer':function(_0x3f8b04,_0xac1dcd){return{'text':_0x3f8b04[_0xd61e('0x15')]()+_0xd61e('0x23')+_0xac1dcd,'style':_0xd61e('0x24')};},'defaultStyle':{'font':_0xd61e('0x25')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xd61e('0x26')},'footer':{'alignment':_0xd61e('0x27'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x211101){var _0x511cac=0x1388;var _0xe3c22a;if(!_0x211101[0x0]['num']){return analyticExtractedReport(_0xd61e('0x28'));}return db['Setting'][_0xd61e('0x29')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xd61e('0x2a'),_0xd61e('0x2b')]})[_0xd61e('0x2c')](function(_0x35e932){if(_0x35e932){_0xe3c22a=_0x35e932;_0x511cac=_0xe3c22a[_0xd61e('0x2b')]||0x3e8;}})[_0xd61e('0x2c')](function(){var _0x192172=[];var _0x42baf4=0x0;if(_0xe3c22a[_0xd61e('0x2a')]){if(_0x211101&&_0x211101[_0xd61e('0x20')]){var _0x3b24fe=_[_0xd61e('0x2d')](_0x211101[0x0][_0xd61e('0x2e')]/_0x511cac);var _0x30c99a=Number[_0xd61e('0x2f')](_0x211101[0x0][_0xd61e('0x2e')]/_0x511cac)?_0x211101[0x0][_0xd61e('0x2e')]%_0x511cac:0x0;_0x3b24fe[_0xd61e('0x30')](function(_0x23806d){if(_0x23806d>0x0){_0x42baf4+=_0x511cac;}_0x192172[_0xd61e('0x19')](dbH[_0xd61e('0x31')]['query'](util[_0xd61e('0x1c')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x511cac,_0x42baf4),{'type':dbH[_0xd61e('0x31')]['QueryTypes'][_0xd61e('0x32')]}));});if(_0x30c99a>0x0){_0x42baf4+=_0x511cac;_0x192172[_0xd61e('0x19')](dbH[_0xd61e('0x31')]['query'](util['format'](_0xd61e('0x33'),QUERY,_0x30c99a,_0x42baf4),{'type':dbH[_0xd61e('0x31')][_0xd61e('0x34')][_0xd61e('0x32')]}));}}}else{_0x192172[_0xd61e('0x19')](dbH['sequelize'][_0xd61e('0x35')](QUERY,{'type':dbH[_0xd61e('0x31')]['QueryTypes']['SELECT']}));}var _0x5ea7e5=path[_0xd61e('0x36')](PATH);var _0x21652c=path[_0xd61e('0x37')](PATH,'.pdf');var _0x5b8411=_0xe3c22a[_0xd61e('0x2a')]&&_0x192172[_0xd61e('0x20')]>0x1;var _0x4ce3e2=[];if(!fs[_0xd61e('0x38')](path[_0xd61e('0x39')](_0x5ea7e5,_0x21652c))&&_0x5b8411){fs[_0xd61e('0x3a')](path[_0xd61e('0x39')](_0x5ea7e5,_0x21652c));}return BPromise['each'](_0x192172,function(_0x3071df){_0x4ce3e2[_0xd61e('0x19')](_0x3071df);})[_0xd61e('0x2c')](function(){var _0x1fca9f=[];for(var _0x39adfd=0x0;_0x39adfd<_0x4ce3e2[_0xd61e('0x20')];_0x39adfd+=0x1){var _0x59483b=_0x4ce3e2[_0x39adfd];var _0x429570=createTables(_[_0xd61e('0x3b')](_0x59483b));var _0x23b5d0;var _0x5c47bd=getPDFDocDefinition(_0x429570);var _0x114195=getPDFPrinter();var _0x465253=_0x114195[_0xd61e('0x3c')](_0x5c47bd);if(_0x5b8411){_0x23b5d0=path[_0xd61e('0x39')](_0x5ea7e5,_0x21652c,util['format']('%s%d.%s',_0x21652c,_0x39adfd,_0xd61e('0x3d')));}else{_0x23b5d0=path[_0xd61e('0x39')](_0x5ea7e5,util['format']('%s.%s',_0x21652c,_0xd61e('0x3d')));}_0x1fca9f[_0xd61e('0x19')](writePDFDocument(_0x465253,_0x23b5d0));}return Promise[_0xd61e('0x3e')](_0x1fca9f);})[_0xd61e('0x2c')](function(){if(_0x5b8411){return new Promise(function(_0x2e840c){zipdir(path[_0xd61e('0x39')](_0x5ea7e5,_0x21652c),{'saveTo':path['join'](_0x5ea7e5,util['format'](_0xd61e('0x3f'),_0x21652c,'zip'))},function(){rimraf(path[_0xd61e('0x39')](_0x5ea7e5,_0x21652c),function(){});_0x2e840c(_0xd61e('0x40'));});});}})['then'](function(){if(!_0x5b8411)return;rimraf(path[_0xd61e('0x39')](_0x5ea7e5,_0x21652c),function(){});})['then'](function(){logger[_0xd61e('0x41')](util['format'](_0xd61e('0x42'),EXTRACTED_REPORT_ID,_0xd61e('0x43')));return analyticExtractedReport(_0xd61e('0x44'),_0x5b8411?util[_0xd61e('0x1c')](_0xd61e('0x3f'),_0x21652c,_0x5b8411?_0xd61e('0x45'):_0xd61e('0x3d')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xd61e('0x41')](util['format']('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xd61e('0x43')));return db[_0xd61e('0x11')][_0xd61e('0x46')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xd61e('0x2c')](function(_0x490553){EXTRACTED_REPORT=_0x490553;return dbH[_0xd61e('0x31')]['query'](util[_0xd61e('0x1c')](_0xd61e('0x47'),QUERY),{'type':dbH[_0xd61e('0x31')][_0xd61e('0x34')][_0xd61e('0x32')]});})[_0xd61e('0x2c')](extractReport)[_0xd61e('0x48')](function(_0x1ab61a){logger[_0xd61e('0x41')](util[_0xd61e('0x1c')](_0xd61e('0x49'),EXTRACTED_REPORT_ID,_0xd61e('0x43')),util[_0xd61e('0x4a')](_0x1ab61a,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})['finally'](function(){process[_0xd61e('0x4b')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x34b20e=new PdfPrinter({'Arial':{'normal':__dirname+_0xd61e('0x4c'),'bold':__dirname+_0xd61e('0x4d'),'italics':__dirname+_0xd61e('0x4e'),'bolditalics':__dirname+'/fonts/arial-bold-italic.ttf'}});return _0x34b20e;}function getPDFDocDefinitionFromHTML(_0x503e6c,_0x11b154){var _0x29d035=util[_0xd61e('0x1c')](_0xd61e('0x4f'),_0x11b154[_0xd61e('0x50')],_0x11b154[_0xd61e('0x51')]);var _0x1ebebb=moment()[_0xd61e('0x1c')](_0xd61e('0x52'))[_0xd61e('0x15')]();var _0x515b69=htmlToPdfmake(_0x503e6c,{'window':window,'tableAutoSize':!![]});return{'content':[_0x515b69],'defaultStyle':{'font':_0xd61e('0x25')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xd61e('0x53'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':'center','margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0xd61e('0x53')}},'header':function(){return[{'text':_0xd61e('0x54'),'style':_0xd61e('0x21')}];},'footer':function(_0x21c71f,_0x466b58){return[{'text':util[_0xd61e('0x1c')]('\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s',_0x29d035,_0x21c71f,_0x466b58,_0x1ebebb),'style':_0xd61e('0x24')}];}};}function writePDFDocument(_0x1dbd2c,_0x380f29){return new Promise(function(_0x4b2302,_0x1c1434){var _0x244381=_0x1dbd2c[_0xd61e('0x55')](fs[_0xd61e('0x56')](_0x380f29));_0x244381['on']('finish',function(){_0x4b2302(_0xd61e('0x57'));});_0x244381['on']('error',function(_0x1783f8){_0x1c1434(_0x1783f8);});_0x1dbd2c[_0xd61e('0x58')]();});}exports[_0xd61e('0x59')]=function(_0x4e5494,_0x367011){var _0x5f4727=getPDFPrinter();var _0x4258f0=getPDFDocDefinitionFromHTML(_0x4e5494,_0x367011);var _0xbf5131=_0x5f4727[_0xd61e('0x3c')](_0x4258f0);return writePDFDocument(_0xbf5131,_0x367011[_0xd61e('0x2')])[_0xd61e('0x48')](function(_0x29fa65){throw _0x29fa65;});}; \ No newline at end of file +var _0x1b99=['tableHeader','map','pick','toString','value','length','body','push','concat','chunk','keys','forEach','format','name','startDate','endDate','pageBreak','before','landscape','\x20/\x20','footer','Arial','right','num','Empty','Setting','find','splitSizePdf','then','split','range','isInteger','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','basename','.pdf','existsSync','mkdirSync','join','each','createPdfKitDocument','%s%d.%s','pdf','%s.%s','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed','zip','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','AnalyticExtractedReport','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','interactionId','center','header','pipe','createWriteStream','finish','error','end','createPdfFromHTML','lodash','util','path','moment','pdfmake/src/printer','zip-dir','rimraf','jsdom','JSDOM','window','../../mysqldb','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','update'];(function(_0x5473a5,_0x38fc6b){var _0x58be1f=function(_0x554385){while(--_0x554385){_0x5473a5['push'](_0x5473a5['shift']());}};_0x58be1f(++_0x38fc6b);}(_0x1b99,0x1c9));var _0x91b9=function(_0x434783,_0xff395d){_0x434783=_0x434783-0x0;var _0x13efcf=_0x1b99[_0x434783];return _0x13efcf;};'use strict';var _=require(_0x91b9('0x0'));var fs=require('fs');var util=require(_0x91b9('0x1'));var path=require(_0x91b9('0x2'));var moment=require(_0x91b9('0x3'));var htmlToPdfmake=require('html-to-pdfmake');var PdfPrinter=require(_0x91b9('0x4'));var zipdir=require(_0x91b9('0x5'));var rimraf=require(_0x91b9('0x6'));var JSDOM=require(_0x91b9('0x7'))[_0x91b9('0x8')];var window=new JSDOM('')[_0x91b9('0x9')];var BPromise=require('bluebird');var db=require('../../mysqldb')['db'];var dbH=require(_0x91b9('0xa'))[_0x91b9('0xb')];var logger=require(_0x91b9('0xc'))(_0x91b9('0xd'));var EXTRACTED_REPORT_ID=Number(process[_0x91b9('0xe')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x91b9('0xe')][0x4];var NAME=process['argv'][0x5];var FORMAT=_0x91b9('0xf');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x1143bd,_0x429530){var _0x1ef85e={'status':_0x1143bd};var _0x53138c={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x429530){_0x1ef85e[_0x91b9('0x10')]=_0x429530;}return db['AnalyticExtractedReport'][_0x91b9('0x11')](_0x1ef85e,_0x53138c);}function getHeaders(_0x186ec7){return _['map'](_0x186ec7,function(_0x26e0aa){return{'text':_0x26e0aa,'style':_0x91b9('0x12')};});}function getRows(_0x4d6dbf,_0x39c391){return _[_0x91b9('0x13')](_0x39c391,function(_0x330423){return _(_0x330423)[_0x91b9('0x14')](_0x4d6dbf)[_0x91b9('0x13')](function(_0x54db66){return _0x54db66?_[_0x91b9('0x15')](_0x54db66):'';})[_0x91b9('0x16')]();});}function createTable(_0x3ce0fc,_0x4f4019){var _0x50d009={'widths':_['fill'](Array(_0x3ce0fc[_0x91b9('0x17')]),0x91),'heights':function(_0x38c4b2){return _0x38c4b2===0x0?'auto':0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x238f4a=getHeaders(_0x3ce0fc);_0x50d009[_0x91b9('0x18')][_0x91b9('0x19')](_0x238f4a);var _0x54d1a5=getRows(_0x3ce0fc,_0x4f4019);_0x50d009[_0x91b9('0x18')]=_0x50d009[_0x91b9('0x18')][_0x91b9('0x1a')](_0x54d1a5);return _0x50d009;}function createTables(_0x466ee5){var _0x6566bf=[];var _0x5dbd48=_[_0x91b9('0x1b')](Object[_0x91b9('0x1c')](_0x466ee5[0x0]),0x5);_0x5dbd48[_0x91b9('0x1d')](function(_0x13b601){_0x6566bf[_0x91b9('0x19')](createTable(_0x13b601,_0x466ee5));});return _0x6566bf;}function getPDFDocDefinition(_0x2c6ceb){var _0x2feb4d=util[_0x91b9('0x1e')]('Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s',NAME,EXTRACTED_REPORT[_0x91b9('0x1f')],moment(EXTRACTED_REPORT[_0x91b9('0x20')])[_0x91b9('0x1e')](FORMAT),moment(EXTRACTED_REPORT[_0x91b9('0x21')])[_0x91b9('0x1e')](FORMAT));var _0x6824c7=[];for(var _0x382e8b=0x0;_0x382e8b<_0x2c6ceb[_0x91b9('0x17')];_0x382e8b++){var _0x51d269=[];if(_0x382e8b===0x0){_0x51d269['push']({'text':_0x2feb4d,'style':'header'});}var _0x1ef8dc={'table':_0x2c6ceb[_0x382e8b]};if(_0x382e8b>0x0){_0x1ef8dc[_0x91b9('0x22')]=_0x91b9('0x23');_0x1ef8dc['margin']=[0x0,0x46,0x0,0x0];}_0x51d269[_0x91b9('0x19')](_0x1ef8dc);_0x6824c7['push'](_0x51d269);}return{'pageSize':'A4','pageOrientation':_0x91b9('0x24'),'content':_0x6824c7,'footer':function(_0xbb9d4f,_0x31f21f){return{'text':_0xbb9d4f[_0x91b9('0x15')]()+_0x91b9('0x25')+_0x31f21f,'style':_0x91b9('0x26')};},'defaultStyle':{'font':_0x91b9('0x27')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'},'footer':{'alignment':_0x91b9('0x28'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x1b352b){var _0x208356=0x1388;var _0x3c0369;if(!_0x1b352b[0x0][_0x91b9('0x29')]){return analyticExtractedReport(_0x91b9('0x2a'));}return db[_0x91b9('0x2b')][_0x91b9('0x2c')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split','splitSizePdf']})['then'](function(_0x1bac17){if(_0x1bac17){_0x3c0369=_0x1bac17;_0x208356=_0x3c0369[_0x91b9('0x2d')]||0x3e8;}})[_0x91b9('0x2e')](function(){var _0x3a4f7e=[];var _0x55afba=0x0;if(_0x3c0369[_0x91b9('0x2f')]){if(_0x1b352b&&_0x1b352b['length']){var _0x5ba50e=_[_0x91b9('0x30')](_0x1b352b[0x0][_0x91b9('0x29')]/_0x208356);var _0x17f9f8=Number[_0x91b9('0x31')](_0x1b352b[0x0]['num']/_0x208356)?_0x1b352b[0x0][_0x91b9('0x29')]%_0x208356:0x0;_0x5ba50e[_0x91b9('0x1d')](function(_0x32f9f5){if(_0x32f9f5>0x0){_0x55afba+=_0x208356;}_0x3a4f7e['push'](dbH[_0x91b9('0x32')][_0x91b9('0x33')](util[_0x91b9('0x1e')](_0x91b9('0x34'),QUERY,_0x208356,_0x55afba),{'type':dbH[_0x91b9('0x32')][_0x91b9('0x35')][_0x91b9('0x36')]}));});if(_0x17f9f8>0x0){_0x55afba+=_0x208356;_0x3a4f7e[_0x91b9('0x19')](dbH[_0x91b9('0x32')][_0x91b9('0x33')](util[_0x91b9('0x1e')](_0x91b9('0x34'),QUERY,_0x17f9f8,_0x55afba),{'type':dbH['sequelize']['QueryTypes']['SELECT']}));}}}else{_0x3a4f7e[_0x91b9('0x19')](dbH['sequelize'][_0x91b9('0x33')](QUERY,{'type':dbH[_0x91b9('0x32')][_0x91b9('0x35')][_0x91b9('0x36')]}));}var _0x5b2ad3=path['dirname'](PATH);var _0x268156=path[_0x91b9('0x37')](PATH,_0x91b9('0x38'));var _0x50d616=_0x3c0369['split']&&_0x3a4f7e[_0x91b9('0x17')]>0x1;var _0x36a077=[];if(!fs[_0x91b9('0x39')](path['join'](_0x5b2ad3,_0x268156))&&_0x50d616){fs[_0x91b9('0x3a')](path[_0x91b9('0x3b')](_0x5b2ad3,_0x268156));}return BPromise[_0x91b9('0x3c')](_0x3a4f7e,function(_0x323859){_0x36a077[_0x91b9('0x19')](_0x323859);})[_0x91b9('0x2e')](function(){var _0x54e353=[];for(var _0x212a9a=0x0;_0x212a9a<_0x36a077[_0x91b9('0x17')];_0x212a9a+=0x1){var _0x47ac8a=_0x36a077[_0x212a9a];var _0x3cceec=createTables(_['flatten'](_0x47ac8a));var _0xa94569;var _0x3feb08=getPDFDocDefinition(_0x3cceec);var _0x5c2ef1=getPDFPrinter();var _0xc7c00=_0x5c2ef1[_0x91b9('0x3d')](_0x3feb08);if(_0x50d616){_0xa94569=path[_0x91b9('0x3b')](_0x5b2ad3,_0x268156,util[_0x91b9('0x1e')](_0x91b9('0x3e'),_0x268156,_0x212a9a,_0x91b9('0x3f')));}else{_0xa94569=path[_0x91b9('0x3b')](_0x5b2ad3,util['format'](_0x91b9('0x40'),_0x268156,_0x91b9('0x3f')));}_0x54e353[_0x91b9('0x19')](writePDFDocument(_0xc7c00,_0xa94569));}return Promise['all'](_0x54e353);})['then'](function(){if(_0x50d616){return new Promise(function(_0xc59f1d){zipdir(path[_0x91b9('0x3b')](_0x5b2ad3,_0x268156),{'saveTo':path['join'](_0x5b2ad3,util[_0x91b9('0x1e')]('%s.%s',_0x268156,'zip'))},function(){rimraf(path[_0x91b9('0x3b')](_0x5b2ad3,_0x268156),function(){});_0xc59f1d(_0x91b9('0x41'));});});}})[_0x91b9('0x2e')](function(){if(!_0x50d616)return;rimraf(path[_0x91b9('0x3b')](_0x5b2ad3,_0x268156),function(){});})[_0x91b9('0x2e')](function(){logger[_0x91b9('0x42')](util[_0x91b9('0x1e')](_0x91b9('0x43'),EXTRACTED_REPORT_ID,_0x91b9('0x44')));return analyticExtractedReport(_0x91b9('0x45'),_0x50d616?util[_0x91b9('0x1e')](_0x91b9('0x40'),_0x268156,_0x50d616?_0x91b9('0x46'):_0x91b9('0x3f')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x91b9('0x42')](util[_0x91b9('0x1e')](_0x91b9('0x47'),EXTRACTED_REPORT_ID,_0x91b9('0x44')));return db[_0x91b9('0x48')]['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})[_0x91b9('0x2e')](function(_0x28e991){EXTRACTED_REPORT=_0x28e991;return dbH[_0x91b9('0x32')][_0x91b9('0x33')](util[_0x91b9('0x1e')](_0x91b9('0x49'),QUERY),{'type':dbH[_0x91b9('0x32')][_0x91b9('0x35')][_0x91b9('0x36')]});})[_0x91b9('0x2e')](extractReport)[_0x91b9('0x4a')](function(_0x36cb09){logger[_0x91b9('0x42')](util['format'](_0x91b9('0x4b'),EXTRACTED_REPORT_ID,_0x91b9('0x44')),util[_0x91b9('0x4c')](_0x36cb09,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x91b9('0x4d'));})[_0x91b9('0x4e')](function(){process[_0x91b9('0x4f')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x3342cc=new PdfPrinter({'Arial':{'normal':__dirname+_0x91b9('0x50'),'bold':__dirname+_0x91b9('0x51'),'italics':__dirname+_0x91b9('0x52'),'bolditalics':__dirname+_0x91b9('0x53')}});return _0x3342cc;}function getPDFDocDefinitionFromHTML(_0x4f7cfe,_0x360ad3){var _0x5f5979=util['format'](_0x91b9('0x54'),_0x360ad3[_0x91b9('0x55')],_0x360ad3[_0x91b9('0x56')]);var _0x1a8943=moment()[_0x91b9('0x1e')]('YYYY-MM-DD')[_0x91b9('0x15')]();var _0x5ccf6e=htmlToPdfmake(_0x4f7cfe,{'window':window,'tableAutoSize':!![]});return{'content':[_0x5ccf6e],'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x91b9('0x57'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':'center','margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x91b9('0x57')}},'header':function(){return[{'text':'Interaction\x20Transcript','style':_0x91b9('0x58')}];},'footer':function(_0x227220,_0x291b42){return[{'text':util[_0x91b9('0x1e')]('\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s',_0x5f5979,_0x227220,_0x291b42,_0x1a8943),'style':_0x91b9('0x26')}];}};}function writePDFDocument(_0x519782,_0x345812){return new Promise(function(_0x356cb3,_0x1371ae){var _0x54e1c4=_0x519782[_0x91b9('0x59')](fs[_0x91b9('0x5a')](_0x345812));_0x54e1c4['on'](_0x91b9('0x5b'),function(){_0x356cb3(_0x91b9('0x5b'));});_0x54e1c4['on'](_0x91b9('0x5c'),function(_0x3323b4){_0x1371ae(_0x3323b4);});_0x519782[_0x91b9('0x5d')]();});}exports[_0x91b9('0x5e')]=function(_0x24cb55,_0x170d77){var _0x3e354d=getPDFPrinter();var _0x15c88f=getPDFDocDefinitionFromHTML(_0x24cb55,_0x170d77);var _0x15dc0b=_0x3e354d[_0x91b9('0x3d')](_0x15c88f);return writePDFDocument(_0x15dc0b,_0x170d77[_0x91b9('0x2')])[_0x91b9('0x4a')](function(_0x46f784){throw _0x46f784;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index a7c973f..d9ece03 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 _0xc306=['rimraf','../../mysqldb','dbH','../../config/logger','argv','savename','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','find','split','splitSizeXlsx','then','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','num','Empty','length','forEach','push','sequelize','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','dirname','.xlsx','existsSync','join','mkdirSync','each','%s%d.%s','xlsx','%s.%s','writeFileSync','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','lodash','json2xls','bluebird'];(function(_0x4709c0,_0x3396c7){var _0x13348b=function(_0x426235){while(--_0x426235){_0x4709c0['push'](_0x4709c0['shift']());}};_0x13348b(++_0x3396c7);}(_0xc306,0x1b6));var _0x6c30=function(_0x352d86,_0x3d5c2a){_0x352d86=_0x352d86-0x0;var _0x199312=_0xc306[_0x352d86];return _0x199312;};'use strict';var util=require('util');var path=require('path');var _=require(_0x6c30('0x0'));var fs=require('fs');var json2xls=require(_0x6c30('0x1'));var BPromise=require(_0x6c30('0x2'));var zipdir=require('zip-dir');var rimraf=require(_0x6c30('0x3'));var db=require(_0x6c30('0x4'))['db'];var dbH=require(_0x6c30('0x4'))[_0x6c30('0x5')];var logger=require(_0x6c30('0x6'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x6c30('0x7')][0x2]);var QUERY=process[_0x6c30('0x7')][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x55ab91,_0x3a1e90){var _0x56eff4={'status':_0x55ab91};var _0x55c92f={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3a1e90){_0x56eff4[_0x6c30('0x8')]=_0x3a1e90;}return db[_0x6c30('0x9')][_0x6c30('0xa')](_0x56eff4,_0x55c92f);}function main(){var _0x22ac6f=0x1388;var _0x56db10;logger[_0x6c30('0xb')](util[_0x6c30('0xc')](_0x6c30('0xd'),EXTRACTED_REPORT_ID,_0x6c30('0xe')));return db['Setting'][_0x6c30('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x6c30('0x10'),_0x6c30('0x11')]})[_0x6c30('0x12')](function(_0x184d0f){if(_0x184d0f){_0x56db10=_0x184d0f;_0x22ac6f=_0x56db10[_0x6c30('0x11')]||0x1388;}})[_0x6c30('0x12')](function(){return dbH['sequelize'][_0x6c30('0x13')](util['format'](_0x6c30('0x14'),QUERY),{'type':dbH['sequelize']['QueryTypes']['SELECT']});})['then'](function(_0x1aad3a){if(!_0x1aad3a[0x0][_0x6c30('0x15')]){return analyticExtractedReport(_0x6c30('0x16'));}var _0x3b6aa7=[];var _0x3e44ab=0x0;if(_0x56db10[_0x6c30('0x10')]){if(_0x1aad3a&&_0x1aad3a[_0x6c30('0x17')]){var _0x89c97b=_['range'](_0x1aad3a[0x0][_0x6c30('0x15')]/_0x22ac6f);var _0x3f6b66=Number['isInteger'](_0x1aad3a[0x0][_0x6c30('0x15')]/_0x22ac6f)?_0x1aad3a[0x0][_0x6c30('0x15')]%_0x22ac6f:0x0;_0x89c97b[_0x6c30('0x18')](function(_0x4e3bb3){if(_0x4e3bb3>0x0){_0x3e44ab+=_0x22ac6f;}_0x3b6aa7[_0x6c30('0x19')](dbH[_0x6c30('0x1a')]['query'](util[_0x6c30('0xc')](_0x6c30('0x1b'),QUERY,_0x22ac6f,_0x3e44ab),{'type':dbH[_0x6c30('0x1a')][_0x6c30('0x1c')][_0x6c30('0x1d')]}));});if(_0x3f6b66>0x0){_0x3e44ab+=_0x22ac6f;_0x3b6aa7[_0x6c30('0x19')](dbH[_0x6c30('0x1a')]['query'](util[_0x6c30('0xc')](_0x6c30('0x1b'),QUERY,_0x3f6b66,_0x3e44ab),{'type':dbH['sequelize'][_0x6c30('0x1c')]['SELECT']}));}}}else{_0x3b6aa7[_0x6c30('0x19')](dbH[_0x6c30('0x1a')][_0x6c30('0x13')](QUERY,{'type':dbH[_0x6c30('0x1a')][_0x6c30('0x1c')][_0x6c30('0x1d')]}));}var _0x1b564d=path[_0x6c30('0x1e')](PATH);var _0x49f8f5=path['basename'](PATH,_0x6c30('0x1f'));var _0x1e13d4=_0x56db10[_0x6c30('0x10')]&&_0x3b6aa7[_0x6c30('0x17')]>0x1;var _0x1f968f=[];if(!fs[_0x6c30('0x20')](path[_0x6c30('0x21')](_0x1b564d,_0x49f8f5))&&_0x1e13d4){fs[_0x6c30('0x22')](path[_0x6c30('0x21')](_0x1b564d,_0x49f8f5));}return BPromise[_0x6c30('0x23')](_0x3b6aa7,function(_0x439335){_0x1f968f[_0x6c30('0x19')](_0x439335);})[_0x6c30('0x12')](function(){for(var _0x81d709=0x0;_0x81d709<_0x1f968f[_0x6c30('0x17')];_0x81d709+=0x1){var _0x41f6cc;var _0xa00e23=_0x1f968f[_0x81d709];if(_0x1e13d4){_0x41f6cc=path[_0x6c30('0x21')](_0x1b564d,_0x49f8f5,util[_0x6c30('0xc')](_0x6c30('0x24'),_0x49f8f5,_0x81d709,_0x6c30('0x25')));}else{_0x41f6cc=path[_0x6c30('0x21')](_0x1b564d,util['format'](_0x6c30('0x26'),_0x49f8f5,'xlsx'));}fs[_0x6c30('0x27')](_0x41f6cc,json2xls(_0xa00e23),'binary');}})[_0x6c30('0x12')](function(){if(_0x1e13d4){return new Promise(function(_0x5bb941){zipdir(path['join'](_0x1b564d,_0x49f8f5),{'saveTo':path['join'](_0x1b564d,util[_0x6c30('0xc')]('%s.%s',_0x49f8f5,_0x6c30('0x28')))},function(_0x3b8be7,_0x4da9e0){rimraf(path['join'](_0x1b564d,_0x49f8f5),function(){});_0x5bb941(_0x6c30('0x29'));});});}})[_0x6c30('0x12')](function(){logger[_0x6c30('0xb')](util[_0x6c30('0xc')](_0x6c30('0x2a'),EXTRACTED_REPORT_ID,_0x6c30('0xe')));return analyticExtractedReport(_0x6c30('0x2b'),_0x1e13d4?util['format'](_0x6c30('0x26'),_0x49f8f5,_0x1e13d4?_0x6c30('0x28'):_0x6c30('0x25')):null);});})[_0x6c30('0x2c')](function(_0x51e895){logger['info'](util[_0x6c30('0xc')](_0x6c30('0x2d'),EXTRACTED_REPORT_ID,_0x6c30('0xe')),util[_0x6c30('0x2e')](_0x51e895,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x6c30('0x2f'));})[_0x6c30('0x30')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file +var _0x7e83=['SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','length','range','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','basename','.xlsx','existsSync','join','mkdirSync','each','%s%d.%s','xlsx','%s.%s','writeFileSync','binary','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','finally','util','path','lodash','json2xls','bluebird','../../mysqldb','dbH','analytics','argv','savename','AnalyticExtractedReport','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','find','split','then','sequelize','query'];(function(_0x17a0a0,_0x1befaa){var _0x4da752=function(_0x429829){while(--_0x429829){_0x17a0a0['push'](_0x17a0a0['shift']());}};_0x4da752(++_0x1befaa);}(_0x7e83,0x7c));var _0x37e8=function(_0x5c52a3,_0x13c8d5){_0x5c52a3=_0x5c52a3-0x0;var _0x5537b9=_0x7e83[_0x5c52a3];return _0x5537b9;};'use strict';var util=require(_0x37e8('0x0'));var path=require(_0x37e8('0x1'));var _=require(_0x37e8('0x2'));var fs=require('fs');var json2xls=require(_0x37e8('0x3'));var BPromise=require(_0x37e8('0x4'));var zipdir=require('zip-dir');var rimraf=require('rimraf');var db=require(_0x37e8('0x5'))['db'];var dbH=require(_0x37e8('0x5'))[_0x37e8('0x6')];var logger=require('../../config/logger')(_0x37e8('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0x37e8('0x8')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x37e8('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x2d4f25,_0x4a669c){var _0x18c5ed={'status':_0x2d4f25};var _0x396fdf={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x4a669c){_0x18c5ed[_0x37e8('0x9')]=_0x4a669c;}return db[_0x37e8('0xa')]['update'](_0x18c5ed,_0x396fdf);}function main(){var _0x789f38=0x1388;var _0x5659a6;logger[_0x37e8('0xb')](util[_0x37e8('0xc')](_0x37e8('0xd'),EXTRACTED_REPORT_ID,_0x37e8('0xe')));return db['Setting'][_0x37e8('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x37e8('0x10'),'splitSizeXlsx']})[_0x37e8('0x11')](function(_0x4ed71b){if(_0x4ed71b){_0x5659a6=_0x4ed71b;_0x789f38=_0x5659a6['splitSizeXlsx']||0x1388;}})[_0x37e8('0x11')](function(){return dbH[_0x37e8('0x12')][_0x37e8('0x13')](util[_0x37e8('0xc')](_0x37e8('0x14'),QUERY),{'type':dbH['sequelize'][_0x37e8('0x15')][_0x37e8('0x16')]});})['then'](function(_0x585078){if(!_0x585078[0x0][_0x37e8('0x17')]){return analyticExtractedReport(_0x37e8('0x18'));}var _0x28c189=[];var _0xe5a147=0x0;if(_0x5659a6[_0x37e8('0x10')]){if(_0x585078&&_0x585078[_0x37e8('0x19')]){var _0xe8fd43=_[_0x37e8('0x1a')](_0x585078[0x0][_0x37e8('0x17')]/_0x789f38);var _0x51b772=Number['isInteger'](_0x585078[0x0][_0x37e8('0x17')]/_0x789f38)?_0x585078[0x0][_0x37e8('0x17')]%_0x789f38:0x0;_0xe8fd43[_0x37e8('0x1b')](function(_0x17a335){if(_0x17a335>0x0){_0xe5a147+=_0x789f38;}_0x28c189[_0x37e8('0x1c')](dbH[_0x37e8('0x12')][_0x37e8('0x13')](util[_0x37e8('0xc')](_0x37e8('0x1d'),QUERY,_0x789f38,_0xe5a147),{'type':dbH[_0x37e8('0x12')]['QueryTypes']['SELECT']}));});if(_0x51b772>0x0){_0xe5a147+=_0x789f38;_0x28c189[_0x37e8('0x1c')](dbH[_0x37e8('0x12')][_0x37e8('0x13')](util[_0x37e8('0xc')](_0x37e8('0x1d'),QUERY,_0x51b772,_0xe5a147),{'type':dbH[_0x37e8('0x12')]['QueryTypes'][_0x37e8('0x16')]}));}}}else{_0x28c189[_0x37e8('0x1c')](dbH[_0x37e8('0x12')][_0x37e8('0x13')](QUERY,{'type':dbH[_0x37e8('0x12')][_0x37e8('0x15')][_0x37e8('0x16')]}));}var _0x3cc5ae=path['dirname'](PATH);var _0x3e117c=path[_0x37e8('0x1e')](PATH,_0x37e8('0x1f'));var _0x448d8a=_0x5659a6['split']&&_0x28c189[_0x37e8('0x19')]>0x1;var _0x5d2e34=[];if(!fs[_0x37e8('0x20')](path[_0x37e8('0x21')](_0x3cc5ae,_0x3e117c))&&_0x448d8a){fs[_0x37e8('0x22')](path[_0x37e8('0x21')](_0x3cc5ae,_0x3e117c));}return BPromise[_0x37e8('0x23')](_0x28c189,function(_0x388cbc){_0x5d2e34['push'](_0x388cbc);})['then'](function(){for(var _0x151e6d=0x0;_0x151e6d<_0x5d2e34[_0x37e8('0x19')];_0x151e6d+=0x1){var _0x432e1e;var _0x2445f2=_0x5d2e34[_0x151e6d];if(_0x448d8a){_0x432e1e=path[_0x37e8('0x21')](_0x3cc5ae,_0x3e117c,util['format'](_0x37e8('0x24'),_0x3e117c,_0x151e6d,_0x37e8('0x25')));}else{_0x432e1e=path[_0x37e8('0x21')](_0x3cc5ae,util['format'](_0x37e8('0x26'),_0x3e117c,'xlsx'));}fs[_0x37e8('0x27')](_0x432e1e,json2xls(_0x2445f2),_0x37e8('0x28'));}})[_0x37e8('0x11')](function(){if(_0x448d8a){return new Promise(function(_0x4b7fae){zipdir(path[_0x37e8('0x21')](_0x3cc5ae,_0x3e117c),{'saveTo':path[_0x37e8('0x21')](_0x3cc5ae,util[_0x37e8('0xc')](_0x37e8('0x26'),_0x3e117c,_0x37e8('0x29')))},function(_0x4fc5d5,_0x2676dd){rimraf(path[_0x37e8('0x21')](_0x3cc5ae,_0x3e117c),function(){});_0x4b7fae('zip\x20finished');});});}})[_0x37e8('0x11')](function(){logger[_0x37e8('0xb')](util['format'](_0x37e8('0x2a'),EXTRACTED_REPORT_ID,_0x37e8('0xe')));return analyticExtractedReport(_0x37e8('0x2b'),_0x448d8a?util[_0x37e8('0xc')]('%s.%s',_0x3e117c,_0x448d8a?_0x37e8('0x29'):'xlsx'):null);});})[_0x37e8('0x2c')](function(_0xd5f29){logger[_0x37e8('0xb')](util[_0x37e8('0xc')](_0x37e8('0x2d'),EXTRACTED_REPORT_ID,_0x37e8('0xe')),util['inspect'](_0xd5f29,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x37e8('0x2e'));})[_0x37e8('0x2f')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index 74643ad..b093953 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 _0x099a=['CDR(destination)=','cutdigits','${EXTEN:','ExecIf','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','length','toLowerCase','createdAt','updatedAt','interval','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','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','transaction','destroy','bulkCreate','sortBy','lodash','util','models','Interval','findAll','then','intervals','IntervalId','VoiceExtension','uniq','map','exten','filter','queue','playback','hasOwnProperty','priority','extension','extensions','push','Set','format','CDR(type)=%s','type','context','inbound','CDR(routeid)=','VoiceExtensionId','outbound'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x099a,0xb2));var _0xa099=function(_0x33c70e,_0xd8cb0b){_0x33c70e=_0x33c70e-0x0;var _0x5a33e5=_0x099a[_0x33c70e];return _0x5a33e5;};'use strict';var _=require(_0xa099('0x0'));var util=require(_0xa099('0x1'));function rewrite(_0x3246ea,_0x5cb8c6){var _0x78bcc4=this;return _0x3246ea[_0xa099('0x2')][_0xa099('0x3')][_0xa099('0x4')]({'raw':!![]})[_0xa099('0x5')](function(_0x392c90){_0x78bcc4[_0xa099('0x6')]=_0x392c90;return _0x3246ea[_0xa099('0x2')]['VoiceExtension'][_0xa099('0x4')]({'where':{'IntervalId':_0x5cb8c6[_0xa099('0x7')]},'raw':!![]});})['then'](function(_0x782077){return _0x3246ea['models'][_0xa099('0x8')]['findAll']({'where':{'exten':{'$in':_[_0xa099('0x9')](_[_0xa099('0xa')](_0x782077,_0xa099('0xb')))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})[_0xa099('0x5')](function(_0x525787){var _0x2cd789=_[_0xa099('0xc')](_0x525787,{'priority':'1'});var _0x60c227=_[_0xa099('0xc')](_0x525787,{'isApp':0x1});var _0x4b0200=_['groupBy'](_0x60c227,_0xa099('0xb'));var _0x5302cf=[_0xa099('0xd'),_0xa099('0xe')];var _0x432f49=[];var _0x6ac2fd=[];for(var _0xa33133 in _0x4b0200){if(_0x4b0200[_0xa099('0xf')](_0xa33133)){_0x78bcc4[_0xa099('0x10')]=0x2;_0x78bcc4['extensions']=[];_0x78bcc4[_0xa099('0x11')]=_['find'](_0x2cd789,{'exten':_0x4b0200[_0xa33133][0x0][_0xa099('0xb')]});_0x78bcc4[_0xa099('0x12')][_0xa099('0x13')]({'type':_0x4b0200[_0xa33133][0x0]['type'],'app':_0xa099('0x14'),'appdata':util[_0xa099('0x15')](_0xa099('0x16'),_0x4b0200[_0xa33133][0x0][_0xa099('0x17')]),'context':_0x4b0200[_0xa33133][0x0][_0xa099('0x18')],'exten':_0x4b0200[_0xa33133][0x0][_0xa099('0xb')],'priority':_0x78bcc4[_0xa099('0x10')]++,'VoiceExtensionId':_0x4b0200[_0xa33133][0x0]['VoiceExtensionId']});if(_0x4b0200[_0xa33133][0x0][_0xa099('0x17')]===_0xa099('0x19')){_0x78bcc4['extensions'][_0xa099('0x13')]({'type':_0x4b0200[_0xa33133][0x0][_0xa099('0x17')],'app':_0xa099('0x14'),'appdata':_0xa099('0x1a')+_0x4b0200[_0xa33133][0x0][_0xa099('0x1b')],'context':_0x4b0200[_0xa33133][0x0][_0xa099('0x18')],'exten':_0x4b0200[_0xa33133][0x0][_0xa099('0xb')],'priority':_0x78bcc4[_0xa099('0x10')]++,'VoiceExtensionId':_0x4b0200[_0xa33133][0x0]['VoiceExtensionId']});}else if(_0x4b0200[_0xa33133][0x0][_0xa099('0x17')]===_0xa099('0x1c')){if(_0x78bcc4[_0xa099('0x11')]){_0x78bcc4[_0xa099('0x12')]['push']({'type':_0x4b0200[_0xa33133][0x0]['type'],'app':_0xa099('0x14'),'appdata':_0xa099('0x1d')+(_0x78bcc4[_0xa099('0x11')][_0xa099('0x1e')]?_0xa099('0x1f')+_0x78bcc4[_0xa099('0x11')]['cutdigits']+'}':'${EXTEN}'),'context':_0x4b0200[_0xa33133][0x0][_0xa099('0x18')],'exten':_0x4b0200[_0xa33133][0x0][_0xa099('0xb')],'priority':_0x78bcc4['priority']++,'VoiceExtensionId':_0x4b0200[_0xa33133][0x0][_0xa099('0x1b')]});}_0x78bcc4[_0xa099('0x12')]['push']({'type':_0x4b0200[_0xa33133][0x0][_0xa099('0x17')],'app':_0xa099('0x14'),'appdata':_0xa099('0x1a')+_0x4b0200[_0xa33133][0x0]['VoiceExtensionId'],'context':_0x4b0200[_0xa33133][0x0][_0xa099('0x18')],'exten':_0x4b0200[_0xa33133][0x0][_0xa099('0xb')],'priority':_0x78bcc4['priority']++,'VoiceExtensionId':_0x4b0200[_0xa33133][0x0][_0xa099('0x1b')]});var _0xddf896=_0x78bcc4[_0xa099('0x10')]++;_0x78bcc4[_0xa099('0x12')][_0xa099('0x13')]({'type':_0x4b0200[_0xa33133][0x0][_0xa099('0x17')],'app':_0xa099('0x20'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0xddf896+0x2)+_0xa099('0x21')+(_0xddf896+0x1)+')','context':_0x4b0200[_0xa33133][0x0][_0xa099('0x18')],'exten':_0x4b0200[_0xa33133][0x0]['exten'],'priority':_0xddf896,'VoiceExtensionId':_0x4b0200[_0xa33133][0x0]['VoiceExtensionId']});if(_0x78bcc4[_0xa099('0x11')]){_0x78bcc4[_0xa099('0x12')]['push']({'type':_0x4b0200[_0xa33133][0x0][_0xa099('0x17')],'app':'Set','appdata':_0x78bcc4[_0xa099('0x11')][_0xa099('0x1e')]?_0xa099('0x22')+_0x78bcc4['extension'][_0xa099('0x1e')]+'}':_0xa099('0x23'),'context':_0x4b0200[_0xa33133][0x0]['context'],'exten':_0x4b0200[_0xa33133][0x0]['exten'],'priority':_0x78bcc4[_0xa099('0x10')]++,'VoiceExtensionId':_0x4b0200[_0xa33133][0x0]['VoiceExtensionId']});}_0x78bcc4[_0xa099('0x12')][_0xa099('0x13')]({'type':_0x4b0200[_0xa33133][0x0][_0xa099('0x17')],'app':_0xa099('0x14'),'appdata':_0xa099('0x24')+_0x4b0200[_0xa33133][0x0]['VoiceExtensionId'],'context':_0x4b0200[_0xa33133][0x0][_0xa099('0x18')],'exten':_0x4b0200[_0xa33133][0x0][_0xa099('0xb')],'priority':_0x78bcc4['priority']++,'VoiceExtensionId':_0x4b0200[_0xa33133][0x0][_0xa099('0x1b')]});if(_0x78bcc4[_0xa099('0x11')]&&_0x78bcc4[_0xa099('0x11')][_0xa099('0xf')](_0xa099('0x25'))&&_0x78bcc4[_0xa099('0x11')]['recordingFormat']!=='none'){_0x78bcc4[_0xa099('0x12')][_0xa099('0x13')]({'type':_0x4b0200[_0xa33133][0x0][_0xa099('0x17')],'app':_0xa099('0x14'),'appdata':_0xa099('0x26'),'context':_0x4b0200[_0xa33133][0x0][_0xa099('0x18')],'exten':_0x4b0200[_0xa33133][0x0]['exten'],'priority':_0x78bcc4[_0xa099('0x10')]++,'VoiceExtensionId':_0x4b0200[_0xa33133][0x0][_0xa099('0x1b')]});_0x78bcc4[_0xa099('0x12')][_0xa099('0x13')]({'type':_0x4b0200[_0xa33133][0x0][_0xa099('0x17')],'app':'Set','appdata':_0xa099('0x27')+_0x78bcc4[_0xa099('0x11')][_0xa099('0x25')]||_0xa099('0x28'),'context':_0x4b0200[_0xa33133][0x0][_0xa099('0x18')],'exten':_0x4b0200[_0xa33133][0x0]['exten'],'priority':_0x78bcc4['priority']++,'VoiceExtensionId':_0x4b0200[_0xa33133][0x0][_0xa099('0x1b')]});}}_0x78bcc4[_0xa099('0x12')][_0xa099('0x13')]({'type':_0x4b0200[_0xa33133][0x0][_0xa099('0x17')],'app':_0xa099('0x14'),'appdata':_0xa099('0x29'),'context':_0x4b0200[_0xa33133][0x0][_0xa099('0x18')],'exten':_0x4b0200[_0xa33133][0x0][_0xa099('0xb')],'priority':_0x78bcc4[_0xa099('0x10')]++,'VoiceExtensionId':_0x4b0200[_0xa33133][0x0][_0xa099('0x1b')]});_0x78bcc4[_0xa099('0x12')][_0xa099('0x13')]({'type':_0x4b0200[_0xa33133][0x0]['type'],'app':_0xa099('0x14'),'appdata':_0xa099('0x2a'),'context':_0x4b0200[_0xa33133][0x0][_0xa099('0x18')],'exten':_0x4b0200[_0xa33133][0x0][_0xa099('0xb')],'priority':_0x78bcc4[_0xa099('0x10')]++,'VoiceExtensionId':_0x4b0200[_0xa33133][0x0][_0xa099('0x1b')]});_0x78bcc4[_0xa099('0x12')]['push']({'type':_0x4b0200[_0xa33133][0x0][_0xa099('0x17')],'app':_0xa099('0x14'),'appdata':'MONITOR_OPTIONS=ab','context':_0x4b0200[_0xa33133][0x0][_0xa099('0x18')],'exten':_0x4b0200[_0xa33133][0x0][_0xa099('0xb')],'priority':_0x78bcc4[_0xa099('0x10')]++,'VoiceExtensionId':_0x4b0200[_0xa33133][0x0][_0xa099('0x1b')]});for(var _0xd68159=0x0,_0x2576f0=0x0;_0xd68159<_0x4b0200[_0xa33133][_0xa099('0x2b')];_0xd68159+=0x1,_0x2576f0=0x0){var _0x4c1bbc=_0x4b0200[_0xa33133][_0xd68159];if(_0x4c1bbc[_0xa099('0x17')]){_0x4c1bbc[_0xa099('0x17')]=_0x4c1bbc['type'][_0xa099('0x2c')]();}var _0x4238ac=[];var _0x559c86=[];delete _0x4c1bbc['id'];delete _0x4c1bbc[_0xa099('0x2d')];delete _0x4c1bbc[_0xa099('0x2e')];var _0x18792e=_0x4c1bbc[_0xa099('0x2f')]!=='*,*,*,*'?[_0x4c1bbc[_0xa099('0x2f')]]:_0x4c1bbc['IntervalId']?_[_0xa099('0xa')](_[_0xa099('0xc')](_0x78bcc4[_0xa099('0x6')],{'IntervalId':_0x4c1bbc['IntervalId']}),_0xa099('0x2f')):[];if(_0x4c1bbc[_0xa099('0xf')]('tag')){if(_0x4c1bbc['tag']&&_0x4c1bbc['tag']!=='--'){_0x4238ac[_0xa099('0x13')]({'type':_0x4c1bbc['type'],'app':'Set','appdata':'CDR(tag)='+_0x4c1bbc[_0xa099('0x30')],'context':_0x4c1bbc[_0xa099('0x18')],'exten':_0x4c1bbc[_0xa099('0xb')],'priority':_0x18792e['length']+_0x78bcc4[_0xa099('0x10')]+_0x2576f0++,'VoiceExtensionId':_0x4c1bbc[_0xa099('0x1b')]});}}if(_0x4c1bbc[_0xa099('0x17')]===_0xa099('0x1c')&&_0x4c1bbc[_0xa099('0xf')](_0xa099('0x31'))){if(_0x4c1bbc[_0xa099('0x31')]){_0x4238ac[_0xa099('0x13')]({'type':_0x4c1bbc['type'],'app':'ExecIf','appdata':_0xa099('0x32')+_0x4c1bbc['callerID']+')','context':_0x4c1bbc[_0xa099('0x18')],'exten':_0x4c1bbc[_0xa099('0xb')],'priority':_0x18792e[_0xa099('0x2b')]+_0x78bcc4[_0xa099('0x10')]+_0x2576f0++,'VoiceExtensionId':_0x4c1bbc[_0xa099('0x1b')]});}else{_0x4238ac[_0xa099('0x13')]({'type':_0x4c1bbc[_0xa099('0x17')],'app':_0xa099('0x20'),'appdata':_0xa099('0x33'),'context':_0x4c1bbc[_0xa099('0x18')],'exten':_0x4c1bbc[_0xa099('0xb')],'priority':_0x18792e[_0xa099('0x2b')]+_0x78bcc4[_0xa099('0x10')]+_0x2576f0++,'VoiceExtensionId':_0x4c1bbc[_0xa099('0x1b')]});}}if(_0x4c1bbc[_0xa099('0xf')](_0xa099('0x34'))){if(_0x5302cf['indexOf'](_0x4c1bbc[_0xa099('0x35')][_0xa099('0x2c')]())>=0x0&&_0x4c1bbc[_0xa099('0x36')]!==_0xa099('0x37')){if(_0x4c1bbc['answer']){_0x4238ac['push']({'type':_0x4c1bbc[_0xa099('0x17')],'app':_0xa099('0x20'),'appdata':_0xa099('0x38'),'context':_0x4c1bbc[_0xa099('0x18')],'exten':_0x4c1bbc['exten'],'priority':_0x18792e[_0xa099('0x2b')]+_0x78bcc4[_0xa099('0x10')]+_0x2576f0++,'VoiceExtensionId':_0x4c1bbc['VoiceExtensionId']});_0x4238ac[_0xa099('0x13')]({'type':_0x4c1bbc['type'],'app':_0xa099('0x14'),'appdata':_0xa099('0x39'),'context':_0x4c1bbc['context'],'exten':_0x4c1bbc[_0xa099('0xb')],'priority':_0x18792e[_0xa099('0x2b')]+_0x78bcc4[_0xa099('0x10')]+_0x2576f0++,'VoiceExtensionId':_0x4c1bbc[_0xa099('0x1b')]});}else{_0x4238ac[_0xa099('0x13')]({'type':_0x4c1bbc[_0xa099('0x17')],'app':_0xa099('0x20'),'appdata':_0xa099('0x3a'),'context':_0x4c1bbc[_0xa099('0x18')],'exten':_0x4c1bbc['exten'],'priority':_0x18792e[_0xa099('0x2b')]+_0x78bcc4[_0xa099('0x10')]+_0x2576f0++,'VoiceExtensionId':_0x4c1bbc['VoiceExtensionId']});_0x4238ac[_0xa099('0x13')]({'type':_0x4c1bbc[_0xa099('0x17')],'app':_0xa099('0x14'),'appdata':_0xa099('0x3b'),'context':_0x4c1bbc[_0xa099('0x18')],'exten':_0x4c1bbc[_0xa099('0xb')],'priority':_0x18792e[_0xa099('0x2b')]+_0x78bcc4[_0xa099('0x10')]+_0x2576f0++,'VoiceExtensionId':_0x4c1bbc[_0xa099('0x1b')]});}}}for(var _0x321b4e=0x0;_0x321b4e<_0x18792e[_0xa099('0x2b')];_0x321b4e+=0x1){var _0x20aa4d=_0x78bcc4[_0xa099('0x10')]+_0x18792e[_0xa099('0x2b')];var _0x22e098=_0x321b4e===_0x18792e[_0xa099('0x2b')]-0x1?_0x78bcc4[_0xa099('0x10')]+_0x4238ac['length']+_0x559c86[_0xa099('0x2b')]+0x2:_0x78bcc4[_0xa099('0x10')]+_0x321b4e+0x1;_0x4238ac[_0xa099('0x3c')](_0x321b4e,0x0,{'type':_0x4c1bbc[_0xa099('0x17')],'app':_0xa099('0x3d'),'appdata':_0x18792e[_0x321b4e]+'?'+_0x4c1bbc[_0xa099('0x18')]+_0xa099('0x3e')+_0x20aa4d+':'+_0x4c1bbc[_0xa099('0x18')]+_0xa099('0x3e')+_0x22e098,'exten':_0x4c1bbc[_0xa099('0xb')],'context':_0x4c1bbc[_0xa099('0x18')],'priority':_0x78bcc4[_0xa099('0x10')]+_0x321b4e,'VoiceExtensionId':_0x4b0200[_0xa33133][0x0]['VoiceExtensionId']});}_0x4c1bbc[_0xa099('0x10')]=_0x4238ac[_0xa099('0x2b')]?_[_0xa099('0x3f')](_0x4238ac)[_0xa099('0x10')]+0x1:_0x78bcc4[_0xa099('0x10')];_0x78bcc4[_0xa099('0x10')]=(_0x559c86['length']?_[_0xa099('0x3f')](_0x559c86)['priority']:_0x4c1bbc[_0xa099('0x10')])+0x1;_0x78bcc4[_0xa099('0x12')]=_[_0xa099('0x40')](_0x78bcc4[_0xa099('0x12')],_0x4238ac,[_0x4c1bbc],_0x559c86);}_0x78bcc4['extensions']['push']({'type':_0x4b0200[_0xa33133][0x0]['type'],'app':'Hangup','exten':_0x4b0200[_0xa33133][0x0][_0xa099('0xb')],'context':_0x4b0200[_0xa33133][0x0][_0xa099('0x18')],'priority':_0x78bcc4[_0xa099('0x10')],'VoiceExtensionId':_0x4b0200[_0xa33133][0x0][_0xa099('0x1b')]});_0x432f49['push'](_0x4b0200[_0xa33133][0x0][_0xa099('0x1b')]);_0x6ac2fd=_[_0xa099('0x40')](_0x6ac2fd,_0x78bcc4[_0xa099('0x12')]);}}return _0x3246ea[_0xa099('0x41')](function(_0x324092){return _0x3246ea[_0xa099('0x2')][_0xa099('0x8')][_0xa099('0x42')]({'where':{'VoiceExtensionId':{'$in':_0x432f49}},'transaction':_0x324092})[_0xa099('0x5')](function(_0x343743){return _0x3246ea['models'][_0xa099('0x8')][_0xa099('0x43')](_[_0xa099('0x44')](_0x6ac2fd,_0xa099('0x10')),{'transaction':_0x324092});});});})['catch'](function(_0x4eeac9){console['error'](_0x4eeac9);});}exports['rewrite']=rewrite; \ No newline at end of file +var _0xec27=['lodash','util','models','Interval','findAll','then','intervals','VoiceExtension','IntervalId','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','playback','hasOwnProperty','extension','extensions','push','type','Set','format','CDR(type)=%s','context','priority','VoiceExtensionId','inbound','CDR(routeid)=','outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=${EXTEN:0:','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','updatedAt','interval','*,*,*,*','tag','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','indexOf','appType','custom','answer','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','GotoIfTime',',${EXTEN},','last','concat','Hangup','destroy','bulkCreate','sortBy','catch','error','rewrite'];(function(_0x5c66c3,_0xeff750){var _0x186410=function(_0x216e8e){while(--_0x216e8e){_0x5c66c3['push'](_0x5c66c3['shift']());}};_0x186410(++_0xeff750);}(_0xec27,0x92));var _0x7ec2=function(_0x4d4c6d,_0xa9e7fb){_0x4d4c6d=_0x4d4c6d-0x0;var _0x53b539=_0xec27[_0x4d4c6d];return _0x53b539;};'use strict';var _=require(_0x7ec2('0x0'));var util=require(_0x7ec2('0x1'));function rewrite(_0x2acaf5,_0x2c1765){var _0x14be94=this;return _0x2acaf5[_0x7ec2('0x2')][_0x7ec2('0x3')][_0x7ec2('0x4')]({'raw':!![]})[_0x7ec2('0x5')](function(_0x4561db){_0x14be94[_0x7ec2('0x6')]=_0x4561db;return _0x2acaf5['models'][_0x7ec2('0x7')][_0x7ec2('0x4')]({'where':{'IntervalId':_0x2c1765[_0x7ec2('0x8')]},'raw':!![]});})[_0x7ec2('0x5')](function(_0x17961f){return _0x2acaf5[_0x7ec2('0x2')]['VoiceExtension'][_0x7ec2('0x4')]({'where':{'exten':{'$in':_[_0x7ec2('0x9')](_[_0x7ec2('0xa')](_0x17961f,_0x7ec2('0xb')))}},'order':[{'raw':_0x7ec2('0xc')}],'raw':!![]});})[_0x7ec2('0x5')](function(_0x25dc64){var _0x139abb=_[_0x7ec2('0xd')](_0x25dc64,{'priority':'1'});var _0x21be48=_[_0x7ec2('0xd')](_0x25dc64,{'isApp':0x1});var _0x2dac45=_[_0x7ec2('0xe')](_0x21be48,'exten');var _0x1ed400=[_0x7ec2('0xf'),_0x7ec2('0x10')];var _0x355b45=[];var _0x4231e4=[];for(var _0x905cc1 in _0x2dac45){if(_0x2dac45[_0x7ec2('0x11')](_0x905cc1)){_0x14be94['priority']=0x2;_0x14be94['extensions']=[];_0x14be94[_0x7ec2('0x12')]=_['find'](_0x139abb,{'exten':_0x2dac45[_0x905cc1][0x0]['exten']});_0x14be94[_0x7ec2('0x13')][_0x7ec2('0x14')]({'type':_0x2dac45[_0x905cc1][0x0][_0x7ec2('0x15')],'app':_0x7ec2('0x16'),'appdata':util[_0x7ec2('0x17')](_0x7ec2('0x18'),_0x2dac45[_0x905cc1][0x0][_0x7ec2('0x15')]),'context':_0x2dac45[_0x905cc1][0x0][_0x7ec2('0x19')],'exten':_0x2dac45[_0x905cc1][0x0]['exten'],'priority':_0x14be94[_0x7ec2('0x1a')]++,'VoiceExtensionId':_0x2dac45[_0x905cc1][0x0][_0x7ec2('0x1b')]});if(_0x2dac45[_0x905cc1][0x0][_0x7ec2('0x15')]===_0x7ec2('0x1c')){_0x14be94[_0x7ec2('0x13')]['push']({'type':_0x2dac45[_0x905cc1][0x0][_0x7ec2('0x15')],'app':'Set','appdata':_0x7ec2('0x1d')+_0x2dac45[_0x905cc1][0x0][_0x7ec2('0x1b')],'context':_0x2dac45[_0x905cc1][0x0][_0x7ec2('0x19')],'exten':_0x2dac45[_0x905cc1][0x0][_0x7ec2('0xb')],'priority':_0x14be94[_0x7ec2('0x1a')]++,'VoiceExtensionId':_0x2dac45[_0x905cc1][0x0][_0x7ec2('0x1b')]});}else if(_0x2dac45[_0x905cc1][0x0][_0x7ec2('0x15')]===_0x7ec2('0x1e')){if(_0x14be94[_0x7ec2('0x12')]){_0x14be94['extensions'][_0x7ec2('0x14')]({'type':_0x2dac45[_0x905cc1][0x0][_0x7ec2('0x15')],'app':_0x7ec2('0x16'),'appdata':_0x7ec2('0x1f')+(_0x14be94[_0x7ec2('0x12')][_0x7ec2('0x20')]?_0x7ec2('0x21')+_0x14be94[_0x7ec2('0x12')][_0x7ec2('0x20')]+'}':_0x7ec2('0x22')),'context':_0x2dac45[_0x905cc1][0x0][_0x7ec2('0x19')],'exten':_0x2dac45[_0x905cc1][0x0][_0x7ec2('0xb')],'priority':_0x14be94['priority']++,'VoiceExtensionId':_0x2dac45[_0x905cc1][0x0][_0x7ec2('0x1b')]});}_0x14be94[_0x7ec2('0x13')][_0x7ec2('0x14')]({'type':_0x2dac45[_0x905cc1][0x0][_0x7ec2('0x15')],'app':_0x7ec2('0x16'),'appdata':_0x7ec2('0x1d')+_0x2dac45[_0x905cc1][0x0][_0x7ec2('0x1b')],'context':_0x2dac45[_0x905cc1][0x0][_0x7ec2('0x19')],'exten':_0x2dac45[_0x905cc1][0x0][_0x7ec2('0xb')],'priority':_0x14be94['priority']++,'VoiceExtensionId':_0x2dac45[_0x905cc1][0x0][_0x7ec2('0x1b')]});var _0x3cee8a=_0x14be94[_0x7ec2('0x1a')]++;_0x14be94[_0x7ec2('0x13')][_0x7ec2('0x14')]({'type':_0x2dac45[_0x905cc1][0x0][_0x7ec2('0x15')],'app':_0x7ec2('0x23'),'appdata':_0x7ec2('0x24')+(_0x3cee8a+0x2)+'):Goto('+(_0x3cee8a+0x1)+')','context':_0x2dac45[_0x905cc1][0x0][_0x7ec2('0x19')],'exten':_0x2dac45[_0x905cc1][0x0][_0x7ec2('0xb')],'priority':_0x3cee8a,'VoiceExtensionId':_0x2dac45[_0x905cc1][0x0][_0x7ec2('0x1b')]});if(_0x14be94[_0x7ec2('0x12')]){_0x14be94['extensions'][_0x7ec2('0x14')]({'type':_0x2dac45[_0x905cc1][0x0]['type'],'app':_0x7ec2('0x16'),'appdata':_0x14be94[_0x7ec2('0x12')][_0x7ec2('0x20')]?_0x7ec2('0x25')+_0x14be94[_0x7ec2('0x12')][_0x7ec2('0x20')]+'}':'CDR(prefix)=noprefix','context':_0x2dac45[_0x905cc1][0x0][_0x7ec2('0x19')],'exten':_0x2dac45[_0x905cc1][0x0][_0x7ec2('0xb')],'priority':_0x14be94[_0x7ec2('0x1a')]++,'VoiceExtensionId':_0x2dac45[_0x905cc1][0x0][_0x7ec2('0x1b')]});}_0x14be94['extensions'][_0x7ec2('0x14')]({'type':_0x2dac45[_0x905cc1][0x0]['type'],'app':_0x7ec2('0x16'),'appdata':'outboundrouteid='+_0x2dac45[_0x905cc1][0x0]['VoiceExtensionId'],'context':_0x2dac45[_0x905cc1][0x0]['context'],'exten':_0x2dac45[_0x905cc1][0x0][_0x7ec2('0xb')],'priority':_0x14be94[_0x7ec2('0x1a')]++,'VoiceExtensionId':_0x2dac45[_0x905cc1][0x0][_0x7ec2('0x1b')]});if(_0x14be94[_0x7ec2('0x12')]&&_0x14be94[_0x7ec2('0x12')]['hasOwnProperty'](_0x7ec2('0x26'))&&_0x14be94[_0x7ec2('0x12')][_0x7ec2('0x26')]!==_0x7ec2('0x27')){_0x14be94[_0x7ec2('0x13')][_0x7ec2('0x14')]({'type':_0x2dac45[_0x905cc1][0x0][_0x7ec2('0x15')],'app':_0x7ec2('0x16'),'appdata':_0x7ec2('0x28'),'context':_0x2dac45[_0x905cc1][0x0][_0x7ec2('0x19')],'exten':_0x2dac45[_0x905cc1][0x0]['exten'],'priority':_0x14be94[_0x7ec2('0x1a')]++,'VoiceExtensionId':_0x2dac45[_0x905cc1][0x0]['VoiceExtensionId']});_0x14be94[_0x7ec2('0x13')][_0x7ec2('0x14')]({'type':_0x2dac45[_0x905cc1][0x0][_0x7ec2('0x15')],'app':'Set','appdata':_0x7ec2('0x29')+_0x14be94[_0x7ec2('0x12')][_0x7ec2('0x26')]||_0x7ec2('0x2a'),'context':_0x2dac45[_0x905cc1][0x0]['context'],'exten':_0x2dac45[_0x905cc1][0x0][_0x7ec2('0xb')],'priority':_0x14be94['priority']++,'VoiceExtensionId':_0x2dac45[_0x905cc1][0x0]['VoiceExtensionId']});}}_0x14be94[_0x7ec2('0x13')]['push']({'type':_0x2dac45[_0x905cc1][0x0][_0x7ec2('0x15')],'app':'Set','appdata':_0x7ec2('0x2b'),'context':_0x2dac45[_0x905cc1][0x0][_0x7ec2('0x19')],'exten':_0x2dac45[_0x905cc1][0x0]['exten'],'priority':_0x14be94[_0x7ec2('0x1a')]++,'VoiceExtensionId':_0x2dac45[_0x905cc1][0x0][_0x7ec2('0x1b')]});_0x14be94[_0x7ec2('0x13')][_0x7ec2('0x14')]({'type':_0x2dac45[_0x905cc1][0x0]['type'],'app':'Set','appdata':_0x7ec2('0x2c'),'context':_0x2dac45[_0x905cc1][0x0][_0x7ec2('0x19')],'exten':_0x2dac45[_0x905cc1][0x0][_0x7ec2('0xb')],'priority':_0x14be94['priority']++,'VoiceExtensionId':_0x2dac45[_0x905cc1][0x0]['VoiceExtensionId']});_0x14be94[_0x7ec2('0x13')][_0x7ec2('0x14')]({'type':_0x2dac45[_0x905cc1][0x0][_0x7ec2('0x15')],'app':'Set','appdata':_0x7ec2('0x2d'),'context':_0x2dac45[_0x905cc1][0x0][_0x7ec2('0x19')],'exten':_0x2dac45[_0x905cc1][0x0][_0x7ec2('0xb')],'priority':_0x14be94[_0x7ec2('0x1a')]++,'VoiceExtensionId':_0x2dac45[_0x905cc1][0x0][_0x7ec2('0x1b')]});for(var _0x14295f=0x0,_0x404db8=0x0;_0x14295f<_0x2dac45[_0x905cc1][_0x7ec2('0x2e')];_0x14295f+=0x1,_0x404db8=0x0){var _0x1f1e2b=_0x2dac45[_0x905cc1][_0x14295f];if(_0x1f1e2b[_0x7ec2('0x15')]){_0x1f1e2b['type']=_0x1f1e2b['type'][_0x7ec2('0x2f')]();}var _0x4373f2=[];var _0x3322a6=[];delete _0x1f1e2b['id'];delete _0x1f1e2b['createdAt'];delete _0x1f1e2b[_0x7ec2('0x30')];var _0x201820=_0x1f1e2b[_0x7ec2('0x31')]!==_0x7ec2('0x32')?[_0x1f1e2b['interval']]:_0x1f1e2b[_0x7ec2('0x8')]?_[_0x7ec2('0xa')](_[_0x7ec2('0xd')](_0x14be94[_0x7ec2('0x6')],{'IntervalId':_0x1f1e2b[_0x7ec2('0x8')]}),'interval'):[];if(_0x1f1e2b[_0x7ec2('0x11')](_0x7ec2('0x33'))){if(_0x1f1e2b[_0x7ec2('0x33')]&&_0x1f1e2b['tag']!=='--'){_0x4373f2['push']({'type':_0x1f1e2b['type'],'app':_0x7ec2('0x16'),'appdata':'CDR(tag)='+_0x1f1e2b[_0x7ec2('0x33')],'context':_0x1f1e2b[_0x7ec2('0x19')],'exten':_0x1f1e2b[_0x7ec2('0xb')],'priority':_0x201820[_0x7ec2('0x2e')]+_0x14be94[_0x7ec2('0x1a')]+_0x404db8++,'VoiceExtensionId':_0x1f1e2b[_0x7ec2('0x1b')]});}}if(_0x1f1e2b[_0x7ec2('0x15')]===_0x7ec2('0x1e')&&_0x1f1e2b[_0x7ec2('0x11')]('callerID')){if(_0x1f1e2b[_0x7ec2('0x34')]){_0x4373f2['push']({'type':_0x1f1e2b[_0x7ec2('0x15')],'app':_0x7ec2('0x23'),'appdata':_0x7ec2('0x35')+_0x1f1e2b[_0x7ec2('0x34')]+')','context':_0x1f1e2b[_0x7ec2('0x19')],'exten':_0x1f1e2b[_0x7ec2('0xb')],'priority':_0x201820[_0x7ec2('0x2e')]+_0x14be94[_0x7ec2('0x1a')]+_0x404db8++,'VoiceExtensionId':_0x1f1e2b[_0x7ec2('0x1b')]});}else{_0x4373f2[_0x7ec2('0x14')]({'type':_0x1f1e2b[_0x7ec2('0x15')],'app':_0x7ec2('0x23'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','context':_0x1f1e2b[_0x7ec2('0x19')],'exten':_0x1f1e2b['exten'],'priority':_0x201820[_0x7ec2('0x2e')]+_0x14be94[_0x7ec2('0x1a')]+_0x404db8++,'VoiceExtensionId':_0x1f1e2b[_0x7ec2('0x1b')]});}}if(_0x1f1e2b[_0x7ec2('0x11')]('answer')){if(_0x1ed400[_0x7ec2('0x36')](_0x1f1e2b['app'][_0x7ec2('0x2f')]())>=0x0&&_0x1f1e2b[_0x7ec2('0x37')]!==_0x7ec2('0x38')){if(_0x1f1e2b[_0x7ec2('0x39')]){_0x4373f2[_0x7ec2('0x14')]({'type':_0x1f1e2b[_0x7ec2('0x15')],'app':_0x7ec2('0x23'),'appdata':_0x7ec2('0x3a'),'context':_0x1f1e2b[_0x7ec2('0x19')],'exten':_0x1f1e2b[_0x7ec2('0xb')],'priority':_0x201820[_0x7ec2('0x2e')]+_0x14be94[_0x7ec2('0x1a')]+_0x404db8++,'VoiceExtensionId':_0x1f1e2b[_0x7ec2('0x1b')]});_0x4373f2[_0x7ec2('0x14')]({'type':_0x1f1e2b['type'],'app':'Set','appdata':_0x7ec2('0x3b'),'context':_0x1f1e2b[_0x7ec2('0x19')],'exten':_0x1f1e2b[_0x7ec2('0xb')],'priority':_0x201820['length']+_0x14be94[_0x7ec2('0x1a')]+_0x404db8++,'VoiceExtensionId':_0x1f1e2b[_0x7ec2('0x1b')]});}else{_0x4373f2[_0x7ec2('0x14')]({'type':_0x1f1e2b['type'],'app':_0x7ec2('0x23'),'appdata':_0x7ec2('0x3c'),'context':_0x1f1e2b[_0x7ec2('0x19')],'exten':_0x1f1e2b['exten'],'priority':_0x201820[_0x7ec2('0x2e')]+_0x14be94[_0x7ec2('0x1a')]+_0x404db8++,'VoiceExtensionId':_0x1f1e2b[_0x7ec2('0x1b')]});_0x4373f2[_0x7ec2('0x14')]({'type':_0x1f1e2b[_0x7ec2('0x15')],'app':_0x7ec2('0x16'),'appdata':_0x7ec2('0x3d'),'context':_0x1f1e2b[_0x7ec2('0x19')],'exten':_0x1f1e2b[_0x7ec2('0xb')],'priority':_0x201820['length']+_0x14be94['priority']+_0x404db8++,'VoiceExtensionId':_0x1f1e2b['VoiceExtensionId']});}}}for(var _0x3b2fe5=0x0;_0x3b2fe5<_0x201820['length'];_0x3b2fe5+=0x1){var _0x4812ec=_0x14be94[_0x7ec2('0x1a')]+_0x201820[_0x7ec2('0x2e')];var _0x2f4e05=_0x3b2fe5===_0x201820['length']-0x1?_0x14be94['priority']+_0x4373f2[_0x7ec2('0x2e')]+_0x3322a6[_0x7ec2('0x2e')]+0x2:_0x14be94['priority']+_0x3b2fe5+0x1;_0x4373f2['splice'](_0x3b2fe5,0x0,{'type':_0x1f1e2b[_0x7ec2('0x15')],'app':_0x7ec2('0x3e'),'appdata':_0x201820[_0x3b2fe5]+'?'+_0x1f1e2b[_0x7ec2('0x19')]+',${EXTEN},'+_0x4812ec+':'+_0x1f1e2b[_0x7ec2('0x19')]+_0x7ec2('0x3f')+_0x2f4e05,'exten':_0x1f1e2b[_0x7ec2('0xb')],'context':_0x1f1e2b[_0x7ec2('0x19')],'priority':_0x14be94['priority']+_0x3b2fe5,'VoiceExtensionId':_0x2dac45[_0x905cc1][0x0][_0x7ec2('0x1b')]});}_0x1f1e2b[_0x7ec2('0x1a')]=_0x4373f2[_0x7ec2('0x2e')]?_['last'](_0x4373f2)[_0x7ec2('0x1a')]+0x1:_0x14be94[_0x7ec2('0x1a')];_0x14be94['priority']=(_0x3322a6['length']?_[_0x7ec2('0x40')](_0x3322a6)[_0x7ec2('0x1a')]:_0x1f1e2b[_0x7ec2('0x1a')])+0x1;_0x14be94[_0x7ec2('0x13')]=_[_0x7ec2('0x41')](_0x14be94[_0x7ec2('0x13')],_0x4373f2,[_0x1f1e2b],_0x3322a6);}_0x14be94[_0x7ec2('0x13')][_0x7ec2('0x14')]({'type':_0x2dac45[_0x905cc1][0x0][_0x7ec2('0x15')],'app':_0x7ec2('0x42'),'exten':_0x2dac45[_0x905cc1][0x0]['exten'],'context':_0x2dac45[_0x905cc1][0x0][_0x7ec2('0x19')],'priority':_0x14be94['priority'],'VoiceExtensionId':_0x2dac45[_0x905cc1][0x0][_0x7ec2('0x1b')]});_0x355b45[_0x7ec2('0x14')](_0x2dac45[_0x905cc1][0x0][_0x7ec2('0x1b')]);_0x4231e4=_['concat'](_0x4231e4,_0x14be94[_0x7ec2('0x13')]);}}return _0x2acaf5['transaction'](function(_0x1f29c9){return _0x2acaf5[_0x7ec2('0x2')][_0x7ec2('0x7')][_0x7ec2('0x43')]({'where':{'VoiceExtensionId':{'$in':_0x355b45}},'transaction':_0x1f29c9})['then'](function(_0x4d712e){return _0x2acaf5[_0x7ec2('0x2')][_0x7ec2('0x7')][_0x7ec2('0x44')](_[_0x7ec2('0x45')](_0x4231e4,_0x7ec2('0x1a')),{'transaction':_0x1f29c9});});});})[_0x7ec2('0x46')](function(_0x3fd955){console[_0x7ec2('0x47')](_0x3fd955);});}exports[_0x7ec2('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 9e293c5..4f17331 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 _0xe89e=['exit','SIGINT','CSV\x20import\x20process\x20stopped!','createReadStream','parse','duplicate','info','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','squel','papaparse','../../../mysqldb','../../../config/logger','api','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','index','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','join','data','firstName','phone','birthDate','YYYY-MM-DD','isValid','email','email\x20format\x20is\x20not\x20valid!','CompanyId','find','CmContact','create','keys','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','checkHopper','inspect','insert','into','fromQuery','scheduledAt','ListId','updatedAt','select','field','ContactId','toString','createdAt','NOW()','from','where','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper','\x20=\x20?','ListId\x20=\x20?','id\x20IN\x20?','calleridnum','cm_hopper_final','cm_contacts','str','cm_hopper_black','findAll','dialCheckDuplicateType','CmList','Lists','always','sequelize','query','then','onlyIfOpen','VoiceQueueId','all','outbound','BlackLists','get','CampaignId','Campaign','Error\x20processing\x20rows\x20block:','finally','contact:csv_','resume','resolve','Unable\x20to\x20delete\x20temp\x20file:'];(function(_0x3410f9,_0x41a4a8){var _0x48bdaf=function(_0x4bf89f){while(--_0x4bf89f){_0x3410f9['push'](_0x3410f9['shift']());}};_0x48bdaf(++_0x41a4a8);}(_0xe89e,0x1b5));var _0xee89=function(_0x1fc21a,_0x333ea5){_0x1fc21a=_0x1fc21a-0x0;var _0x2f8b20=_0xe89e[_0x1fc21a];return _0x2f8b20;};'use strict';var BPromise=require(_0xee89('0x0'));var util=require(_0xee89('0x1'));var _=require('lodash');var fs=require('fs');var squel=require(_0xee89('0x2'));var Papa=require(_0xee89('0x3'));var Redis=require('ioredis');var db=require(_0xee89('0x4'))['db'];var config=require('../../../config/environment');var logger=require(_0xee89('0x5'))(_0xee89('0x6'));config[_0xee89('0x7')]=_[_0xee89('0x8')](config['redis'],{'host':_0xee89('0x9'),'port':0x18eb});var socket=require(_0xee89('0xa'))(new Redis(config[_0xee89('0x7')]));require(_0xee89('0xb'))['register'](socket);try{if(!process[_0xee89('0xc')][0x2]||process[_0xee89('0xc')][0x2]===_0xee89('0xd')||process['argv'][0x2]===_0xee89('0xe')){throw new Error(_0xee89('0xf'));}var FILEPATH=process[_0xee89('0xc')][0x2];if(!process['argv'][0x3]||process[_0xee89('0xc')][0x3]==='undefined'||process['argv'][0x3]===_0xee89('0xe')||!process[_0xee89('0xc')][0x4]||process[_0xee89('0xc')][0x4]===_0xee89('0xd')||process[_0xee89('0xc')][0x4]===_0xee89('0xe')){throw new Error(_0xee89('0x10'));}var FIELDS=_['zipObject'](process[_0xee89('0xc')][0x3][_0xee89('0x11')](','),process[_0xee89('0xc')][0x4][_0xee89('0x11')](','));if(!process[_0xee89('0xc')][0x5]||process['argv'][0x5]===_0xee89('0xd')||process[_0xee89('0xc')][0x5]===_0xee89('0xe')){throw new Error(_0xee89('0x12'));}var LISTID=process[_0xee89('0xc')][0x5];var COMPANYID=process[_0xee89('0xc')][0x6]&&process[_0xee89('0xc')][0x6]!=='undefined'&&process['argv'][0x6]!==_0xee89('0xe')?process[_0xee89('0xc')][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process[_0xee89('0xc')][0x7]!==_0xee89('0xd')&&process['argv'][0x7]!==_0xee89('0xe')?process[_0xee89('0xc')][0x7]:null;if(!process[_0xee89('0xc')][0x8]||process[_0xee89('0xc')][0x8]===_0xee89('0xd')||process[_0xee89('0xc')][0x8]===_0xee89('0xe')){throw new Error(_0xee89('0x13'));}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0x5d6755){logger[_0xee89('0x14')](_0x5d6755);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(_0x4b5b44,_0x109498,_0x3ba1dc,_0x40f25e){var _0x3d518c={'message':_0x109498};_0x3d518c[_0x4b5b44]=!![];if(_0x3ba1dc){_0x3d518c[_0xee89('0x15')]=_0x3ba1dc;}if(_0x40f25e){_0x3d518c[_0xee89('0x16')]=_0x40f25e;}return _0x3d518c;}function isEmail(_0x4005c7){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'](_0x4005c7);}function checkRow(_0x54bec4,_0x371227,_0x336e76){return new BPromise(function(_0xe16d83,_0x2722dd){if(_['isNil'](_0x54bec4)){return _0x2722dd(handleCheckRowError('error',_0xee89('0x17'),null,_0x336e76));}if(_0x54bec4[_0xee89('0x18')]&&_0x54bec4[_0xee89('0x18')][_0xee89('0x19')]){var _0x45c71f=_[_0xee89('0x1a')](_0x54bec4[_0xee89('0x18')],_0xee89('0x1b'))[_0xee89('0x1c')](';');return _0x2722dd(handleCheckRowError(_0xee89('0x14'),_0x45c71f,null,_0x336e76));}var _0x2faae1={};for(var _0x44bcbf in FIELDS){if(FIELDS['hasOwnProperty'](_0x44bcbf)&&FIELDS[_0x44bcbf]){_0x2faae1[_0x44bcbf]=_0x54bec4[_0xee89('0x1d')][0x0][FIELDS[_0x44bcbf]]||_0x54bec4[_0xee89('0x1d')][0x0]['\ufeff'+FIELDS[_0x44bcbf]];}}if(!_0x2faae1[_0xee89('0x1e')]){return _0x2722dd(handleCheckRowError(_0xee89('0x14'),'firstName\x20not\x20specified!',null,_0x336e76));}if(!_0x2faae1[_0xee89('0x1f')]){return _0x2722dd(handleCheckRowError(_0xee89('0x14'),'phone\x20not\x20specified!',null,_0x336e76));}if(_0x2faae1[_0xee89('0x20')]){var _0x5bf555=moment(_0x2faae1[_0xee89('0x20')],_0xee89('0x21'));if(!_0x5bf555[_0xee89('0x22')]()){return _0x2722dd(handleCheckRowError(_0xee89('0x14'),'birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0x336e76));}}if(_0x2faae1['email']){if(!isEmail(_0x2faae1[_0xee89('0x23')])){return _0x2722dd(handleCheckRowError(_0xee89('0x14'),_0xee89('0x24'),null,_0x336e76));}}_0x2faae1['ListId']=LISTID;_0x2faae1[_0xee89('0x25')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES['length']&&_0x371227){var _0x185b47={};for(var _0x2aedd8=0x0,_0x20c901=DUPLICATES[_0xee89('0x19')];_0x2aedd8<_0x20c901;_0x2aedd8+=0x1){_0x185b47[DUPLICATES[_0x2aedd8]]=_0x2faae1[DUPLICATES[_0x2aedd8]];}var _0x2fd6b7=_[_0xee89('0x26')](_0x371227,_0x185b47);if(_0x2fd6b7){return _0x2722dd(handleCheckRowError('duplicate','Duplicate\x20Contact',_0x2fd6b7,_0x336e76));}}return db[_0xee89('0x27')][_0xee89('0x28')](_0x2faae1,{'raw':!![],'hooks':![],'fields':_[_0xee89('0x29')](_0x2faae1)})['then'](function(_0x103395){if(DUPLICATES&&DUPLICATES[_0xee89('0x19')]&&_0x371227){_0x371227[_0xee89('0x2a')](_[_0xee89('0x2b')](_0x2faae1,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x103395['id'];return _0xe16d83();})[_0xee89('0x2c')](function(_0x4be08d){return _0x2722dd(handleCheckRowError(_0xee89('0x14'),_0xee89('0x2d')+(_0x4be08d[_0xee89('0x1b')]||JSON[_0xee89('0x2e')](_0x4be08d)),null,_0x336e76));});});}function checkHopper(){function _0x503dc5(){return function(_0x5e0738){logger['error'](_0xee89('0x2f'),_0xee89('0x30'),util[_0xee89('0x31')](_0x5e0738,{'showHidden':![],'depth':null}));};}var _0x1983bd=function(_0x366986,_0x35692b){var _0x546e85=squel[_0xee89('0x32')]()[_0xee89('0x33')]('cm_hopper')[_0xee89('0x34')]([_0xee89('0x1f'),_0xee89('0x35'),'ContactId',_0xee89('0x36'),_0x35692b,'createdAt',_0xee89('0x37')],squel[_0xee89('0x38')]()['field']('phone',_0xee89('0x1f'))[_0xee89('0x39')]('NOW()','scheduledAt')[_0xee89('0x39')]('id',_0xee89('0x3a'))['field'](LISTID['toString'](),_0xee89('0x36'))[_0xee89('0x39')](_0x366986['id'][_0xee89('0x3b')](),_0x35692b)['field']('NOW()',_0xee89('0x3c'))[_0xee89('0x39')](_0xee89('0x3d'),'updatedAt')[_0xee89('0x3e')]('cm_contacts')[_0xee89('0x3f')](_0xee89('0x40'))['where']('ListId\x20=\x20?',LISTID['toString']())[_0xee89('0x3f')](_0xee89('0x41'))['where'](_0xee89('0x42'),squel[_0xee89('0x38')]()['field'](_0xee89('0x1f'))[_0xee89('0x3e')](_0xee89('0x43'))[_0xee89('0x3f')](_0x35692b+_0xee89('0x44'),_0x366986['id'][_0xee89('0x3b')]())))[_0xee89('0x3b')]();return _0x546e85;};var _0x1a49ad=function(_0x322dbe,_0x150166){var _0x53e021=squel[_0xee89('0x32')]()['into'](_0xee89('0x43'))[_0xee89('0x34')]([_0xee89('0x1f'),_0xee89('0x35'),_0xee89('0x3a'),_0xee89('0x36'),_0x150166,_0xee89('0x3c'),_0xee89('0x37')],squel[_0xee89('0x38')]()[_0xee89('0x39')](_0xee89('0x1f'),_0xee89('0x1f'))[_0xee89('0x39')](_0xee89('0x3d'),_0xee89('0x35'))[_0xee89('0x39')]('id',_0xee89('0x3a'))['field'](LISTID[_0xee89('0x3b')](),'ListId')[_0xee89('0x39')](_0x322dbe['id'][_0xee89('0x3b')](),_0x150166)[_0xee89('0x39')](_0xee89('0x3d'),_0xee89('0x3c'))[_0xee89('0x39')]('NOW()',_0xee89('0x37'))['from']('cm_contacts')[_0xee89('0x3f')](_0xee89('0x40'))[_0xee89('0x3f')](_0xee89('0x45'),LISTID[_0xee89('0x3b')]())['where'](_0xee89('0x46'),squel['str'](hopperContacts))[_0xee89('0x3f')](_0xee89('0x41'))[_0xee89('0x3f')](_0xee89('0x42'),squel['select']()[_0xee89('0x39')](_0xee89('0x47'))[_0xee89('0x3e')](_0xee89('0x48'))[_0xee89('0x3f')](_0x150166+'\x20=\x20?',_0x322dbe['id'][_0xee89('0x3b')]()))[_0xee89('0x3f')](_0xee89('0x42'),squel['select']()['field']('phone')['from'](_0xee89('0x43'))[_0xee89('0x3f')](_0x150166+_0xee89('0x44'),_0x322dbe['id'][_0xee89('0x3b')]())))[_0xee89('0x3b')]();return _0x53e021;};function _0x42b756(_0x1ce449,_0x11f0da){var _0x499b8a=squel['insert']()['into']('cm_hopper')['fromQuery']([_0xee89('0x1f'),'scheduledAt',_0xee89('0x3a'),'ListId',_0x11f0da,_0xee89('0x3c'),'updatedAt'],squel[_0xee89('0x38')]()[_0xee89('0x39')](_0xee89('0x1f'),_0xee89('0x1f'))['field'](_0xee89('0x3d'),_0xee89('0x35'))[_0xee89('0x39')]('id',_0xee89('0x3a'))['field'](LISTID[_0xee89('0x3b')](),'ListId')[_0xee89('0x39')](_0x1ce449['id'][_0xee89('0x3b')](),_0x11f0da)[_0xee89('0x39')](_0xee89('0x3d'),'createdAt')['field'](_0xee89('0x3d'),_0xee89('0x37'))['from'](_0xee89('0x49'))[_0xee89('0x3f')](_0xee89('0x40'))['where'](_0xee89('0x45'),LISTID['toString']())['where']('id\x20IN\x20?',squel[_0xee89('0x4a')](hopperContacts))['where'](_0xee89('0x41')))[_0xee89('0x3b')]();return _0x499b8a;}function _0x392d94(_0x4c8228,_0x1f9d7e){var _0x3f1796=squel['insert']()['into'](_0xee89('0x4b'))[_0xee89('0x34')]([_0xee89('0x1f'),'ContactId',_0xee89('0x36'),_0x1f9d7e,_0xee89('0x3c'),_0xee89('0x37')],squel['select']()['field']('phone','phone')[_0xee89('0x39')]('id',_0xee89('0x3a'))['field'](LISTID[_0xee89('0x3b')](),_0xee89('0x36'))[_0xee89('0x39')](_0x4c8228['id']['toString'](),_0x1f9d7e)[_0xee89('0x39')]('NOW()',_0xee89('0x3c'))[_0xee89('0x39')](_0xee89('0x3d'),_0xee89('0x37'))[_0xee89('0x3e')](_0xee89('0x49'))[_0xee89('0x3f')](_0xee89('0x40'))[_0xee89('0x3f')]('ListId\x20=\x20?',LISTID[_0xee89('0x3b')]())[_0xee89('0x3f')](_0xee89('0x46'),squel[_0xee89('0x4a')](hopperContacts))['where'](_0xee89('0x41')))[_0xee89('0x3b')]();return _0x3f1796;}return db['VoiceQueue'][_0xee89('0x4c')]({'where':{'type':'outbound'},'attributes':['id',_0xee89('0x4d')],'include':[{'model':db[_0xee89('0x4e')],'as':_0xee89('0x4f'),'where':{'id':LISTID}}]})['then'](function(_0x3b8630){var _0x4e2217=[];if(_0x3b8630){var _0x62e620;for(var _0x5993c7=0x0,_0x38b121;_0x5993c7<_0x3b8630['length'];_0x5993c7+=0x1){_0x38b121=_0x3b8630[_0x5993c7]['get']({'plain':!![]});switch(_0x38b121[_0xee89('0x4d')]){case _0xee89('0x50'):_0x4e2217['push'](db[_0xee89('0x51')][_0xee89('0x52')](_0x1a49ad(_0x38b121,'VoiceQueueId'))[_0xee89('0x53')](function(){})[_0xee89('0x2c')](_0x503dc5()));break;case _0xee89('0x54'):_0x4e2217[_0xee89('0x2a')](db[_0xee89('0x51')][_0xee89('0x52')](_0x1983bd(_0x38b121,_0xee89('0x55')))['then'](function(){})[_0xee89('0x2c')](_0x503dc5()));break;default:_0x4e2217['push'](db[_0xee89('0x51')]['query'](_0x42b756(_0x38b121,_0xee89('0x55')))[_0xee89('0x53')](function(){})[_0xee89('0x2c')](_0x503dc5()));}}}return _0x4e2217;})[_0xee89('0x56')]()[_0xee89('0x53')](function(){return db['VoiceQueue'][_0xee89('0x4c')]({'where':{'type':_0xee89('0x57')},'attributes':['id'],'include':[{'model':db[_0xee89('0x4e')],'as':_0xee89('0x58'),'where':{'id':LISTID}}]})[_0xee89('0x53')](function(_0x5490af){var _0x3d82d5=[];if(_0x5490af){var _0x1edae9;for(var _0x63c2f2=0x0,_0x4b1c3e;_0x63c2f2<_0x5490af[_0xee89('0x19')];_0x63c2f2+=0x1){_0x4b1c3e=_0x5490af[_0x63c2f2][_0xee89('0x59')]({'plain':!![]});_0x3d82d5['push'](db[_0xee89('0x51')][_0xee89('0x52')](_0x392d94(_0x4b1c3e,'VoiceQueueId'))[_0xee89('0x53')](function(){})[_0xee89('0x2c')](_0x503dc5()));}}return _0x3d82d5;})['all']();})[_0xee89('0x53')](function(){return db['Campaign']['findAll']({'attributes':['id',_0xee89('0x4d')],'include':[{'model':db[_0xee89('0x4e')],'as':_0xee89('0x4f'),'where':{'id':LISTID}}]})[_0xee89('0x53')](function(_0x32c4a7){var _0x5bd37e=[];if(_0x32c4a7){for(var _0x5554ad=0x0,_0x28abc8;_0x5554ad<_0x32c4a7[_0xee89('0x19')];_0x5554ad+=0x1){_0x28abc8=_0x32c4a7[_0x5554ad][_0xee89('0x59')]({'plain':!![]});switch(_0x28abc8[_0xee89('0x4d')]){case _0xee89('0x50'):_0x5bd37e[_0xee89('0x2a')](db[_0xee89('0x51')][_0xee89('0x52')](_0x1a49ad(_0x28abc8,_0xee89('0x5a')))[_0xee89('0x53')](function(){})[_0xee89('0x2c')](_0x503dc5()));break;case _0xee89('0x54'):_0x5bd37e['push'](db[_0xee89('0x51')][_0xee89('0x52')](_0x1983bd(_0x28abc8,_0xee89('0x5a')))['then'](function(){})[_0xee89('0x2c')](_0x503dc5()));break;default:_0x5bd37e['push'](db[_0xee89('0x51')][_0xee89('0x52')](_0x42b756(_0x28abc8,_0xee89('0x5a')))[_0xee89('0x53')](function(){})[_0xee89('0x2c')](_0x503dc5()));}}}return _0x5bd37e;})[_0xee89('0x56')]();})['then'](function(){return db[_0xee89('0x5b')][_0xee89('0x4c')]({'attributes':['id'],'include':[{'model':db['CmList'],'as':'BlackLists','where':{'id':LISTID}}]})[_0xee89('0x53')](function(_0x444fa6){var _0x428408=[];if(_0x444fa6){for(var _0x1f494d=0x0,_0xc3a204;_0x1f494d<_0x444fa6['length'];_0x1f494d+=0x1){_0xc3a204=_0x444fa6[_0x1f494d][_0xee89('0x59')]({'plain':!![]});_0x428408[_0xee89('0x2a')](db[_0xee89('0x51')][_0xee89('0x52')](_0x392d94(_0xc3a204,_0xee89('0x5a')))['then'](function(){})[_0xee89('0x2c')](_0x503dc5()));}}return _0x428408;})[_0xee89('0x56')]();})[_0xee89('0x2c')](function(_0x4af50e){logger[_0xee89('0x14')]('cmContact,\x20%s,\x20%s','generalCheckHopper',_0x4af50e[_0xee89('0x1b')]);});}var processPromises=function(_0x13ecc6){return BPromise[_0xee89('0x56')](promises)[_0xee89('0x53')](function(_0x207df5){})[_0xee89('0x2c')](function(_0x1ddbec){logger['error'](_0xee89('0x5c'),JSON[_0xee89('0x2e')](_0x1ddbec));})[_0xee89('0x5d')](function(){socket['emit'](_0xee89('0x5e')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x13ecc6){return _0x13ecc6[_0xee89('0x5f')]();}});};var endCsv=function(){return BPromise[_0xee89('0x60')]()['then'](function(){if(hopperContacts){return checkHopper();}})[_0xee89('0x53')](function(){socket['emit'](_0xee89('0x5e')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs['unlinkSync'](FILEPATH);}catch(_0x47028c){logger[_0xee89('0x14')](_0xee89('0x61'),JSON[_0xee89('0x2e')](_0x47028c));}finally{process[_0xee89('0x62')](0x0);}});};process['on'](_0xee89('0x63'),function(){logger['info'](_0xee89('0x64'));endCsv();});function main(){return BPromise[_0xee89('0x60')]()[_0xee89('0x53')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xee89('0x11')](',');return db[_0xee89('0x27')]['findAll']({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0xee89('0x53')](function(_0x1cefdc){var _0x37a237=fs[_0xee89('0x65')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xee89('0x66')](_0x37a237,{'header':!![],'skipEmptyLines':!![],'step':function(_0xe5a873,_0x3fa7d8){total+=0x1;var _0x5e9ae5=total;promises[_0xee89('0x2a')](checkRow(_0xe5a873,_0x1cefdc,_0x5e9ae5)[_0xee89('0x53')](function(){success+=0x1;})[_0xee89('0x2c')](function(_0x576b4f){if(_0x576b4f[_0xee89('0x14')]){errors+=0x1;delete _0x576b4f[_0xee89('0x14')];}else if(_0x576b4f[_0xee89('0x67')]){duplicates+=0x1;delete _0x576b4f[_0xee89('0x67')];}rows[_0xee89('0x2a')](_0x576b4f);}));if(total%0xc8===0x0){_0x3fa7d8['pause']();return processPromises(_0x3fa7d8);}},'complete':function(){return processPromises()[_0xee89('0x53')](function(){logger[_0xee89('0x68')]('CSV\x20parsed\x20correctly!');endCsv();});},'error':function(_0xdcdcc7,_0x3ac8e5){logger[_0xee89('0x68')](_0xee89('0x69'),JSON[_0xee89('0x2e')](_0xdcdcc7));endCsv();}});})['catch'](function(_0xf1957f){logger['error'](_0xee89('0x6a'),JSON[_0xee89('0x2e')](_0xf1957f));});}main(); \ No newline at end of file +var _0x6b5e=['redis','defaults','localhost','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','contact','index','isNil','error','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','message','data','firstName','phone','birthDate','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','find','duplicate','create','keys','then','pick','catch','stringify','cmContact','checkHopper','inspect','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','createdAt','updatedAt','select','field','NOW()','toString','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','from','\x20=\x20?','id\x20IN\x20?','str','phone\x20IS\x20NOT\x20NULL','cm_hopper_final','phone\x20NOT\x20IN\x20(?)','cm_hopper_black','outbound','CmList','Lists','get','dialCheckDuplicateType','always','sequelize','query','VoiceQueueId','onlyIfOpen','push','all','findAll','BlackLists','Campaign','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','resume','resolve','emit','contact:csv_','Unable\x20to\x20delete\x20temp\x20file:','info','CSV\x20import\x20process\x20stopped!','split','CmContact','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','squel','papaparse','../../../mysqldb','../../../config/environment','../../../config/logger','api'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6b5e,0x19f));var _0xe6b5=function(_0x28cf4f,_0x3394c0){_0x28cf4f=_0x28cf4f-0x0;var _0xe29521=_0x6b5e[_0x28cf4f];return _0xe29521;};'use strict';var BPromise=require(_0xe6b5('0x0'));var util=require(_0xe6b5('0x1'));var _=require(_0xe6b5('0x2'));var fs=require('fs');var squel=require(_0xe6b5('0x3'));var Papa=require(_0xe6b5('0x4'));var Redis=require('ioredis');var db=require(_0xe6b5('0x5'))['db'];var config=require(_0xe6b5('0x6'));var logger=require(_0xe6b5('0x7'))(_0xe6b5('0x8'));config[_0xe6b5('0x9')]=_[_0xe6b5('0xa')](config[_0xe6b5('0x9')],{'host':_0xe6b5('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe6b5('0x9')]));require(_0xe6b5('0xc'))[_0xe6b5('0xd')](socket);try{if(!process[_0xe6b5('0xe')][0x2]||process[_0xe6b5('0xe')][0x2]===_0xe6b5('0xf')||process[_0xe6b5('0xe')][0x2]===_0xe6b5('0x10')){throw new Error(_0xe6b5('0x11'));}var FILEPATH=process[_0xe6b5('0xe')][0x2];if(!process[_0xe6b5('0xe')][0x3]||process[_0xe6b5('0xe')][0x3]===_0xe6b5('0xf')||process[_0xe6b5('0xe')][0x3]===_0xe6b5('0x10')||!process[_0xe6b5('0xe')][0x4]||process[_0xe6b5('0xe')][0x4]===_0xe6b5('0xf')||process[_0xe6b5('0xe')][0x4]==='null'){throw new Error(_0xe6b5('0x12'));}var FIELDS=_[_0xe6b5('0x13')](process[_0xe6b5('0xe')][0x3]['split'](','),process[_0xe6b5('0xe')][0x4]['split'](','));if(!process['argv'][0x5]||process[_0xe6b5('0xe')][0x5]===_0xe6b5('0xf')||process[_0xe6b5('0xe')][0x5]===_0xe6b5('0x10')){throw new Error(_0xe6b5('0x14'));}var LISTID=process[_0xe6b5('0xe')][0x5];var COMPANYID=process[_0xe6b5('0xe')][0x6]&&process[_0xe6b5('0xe')][0x6]!==_0xe6b5('0xf')&&process['argv'][0x6]!==_0xe6b5('0x10')?process[_0xe6b5('0xe')][0x6]:null;var DUPLICATES=process[_0xe6b5('0xe')][0x7]&&process[_0xe6b5('0xe')][0x7]!==_0xe6b5('0xf')&&process[_0xe6b5('0xe')][0x7]!==_0xe6b5('0x10')?process[_0xe6b5('0xe')][0x7]:null;if(!process[_0xe6b5('0xe')][0x8]||process[_0xe6b5('0xe')][0x8]===_0xe6b5('0xf')||process[_0xe6b5('0xe')][0x8]===_0xe6b5('0x10')){throw new Error(_0xe6b5('0x15'));}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0x42333c){logger['error'](_0x42333c);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(_0xf7f9cc,_0x11d3a1,_0x4129da,_0x5342a4){var _0x4dcc8d={'message':_0x11d3a1};_0x4dcc8d[_0xf7f9cc]=!![];if(_0x4129da){_0x4dcc8d[_0xe6b5('0x16')]=_0x4129da;}if(_0x5342a4){_0x4dcc8d[_0xe6b5('0x17')]=_0x5342a4;}return _0x4dcc8d;}function isEmail(_0x4e9016){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'](_0x4e9016);}function checkRow(_0x18206c,_0x8b10c5,_0x1a937e){return new BPromise(function(_0x52fed9,_0x4872cf){if(_[_0xe6b5('0x18')](_0x18206c)){return _0x4872cf(handleCheckRowError(_0xe6b5('0x19'),_0xe6b5('0x1a'),null,_0x1a937e));}if(_0x18206c[_0xe6b5('0x1b')]&&_0x18206c[_0xe6b5('0x1b')][_0xe6b5('0x1c')]){var _0x3709c8=_['map'](_0x18206c[_0xe6b5('0x1b')],_0xe6b5('0x1d'))['join'](';');return _0x4872cf(handleCheckRowError(_0xe6b5('0x19'),_0x3709c8,null,_0x1a937e));}var _0x3d1be2={};for(var _0x2f6373 in FIELDS){if(FIELDS['hasOwnProperty'](_0x2f6373)&&FIELDS[_0x2f6373]){_0x3d1be2[_0x2f6373]=_0x18206c['data'][0x0][FIELDS[_0x2f6373]]||_0x18206c[_0xe6b5('0x1e')][0x0]['\ufeff'+FIELDS[_0x2f6373]];}}if(!_0x3d1be2[_0xe6b5('0x1f')]){return _0x4872cf(handleCheckRowError('error','firstName\x20not\x20specified!',null,_0x1a937e));}if(!_0x3d1be2[_0xe6b5('0x20')]){return _0x4872cf(handleCheckRowError(_0xe6b5('0x19'),'phone\x20not\x20specified!',null,_0x1a937e));}if(_0x3d1be2['birthDate']){var _0x9bbced=moment(_0x3d1be2[_0xe6b5('0x21')],'YYYY-MM-DD');if(!_0x9bbced['isValid']()){return _0x4872cf(handleCheckRowError(_0xe6b5('0x19'),_0xe6b5('0x22'),null,_0x1a937e));}}if(_0x3d1be2[_0xe6b5('0x23')]){if(!isEmail(_0x3d1be2[_0xe6b5('0x23')])){return _0x4872cf(handleCheckRowError(_0xe6b5('0x19'),_0xe6b5('0x24'),null,_0x1a937e));}}_0x3d1be2[_0xe6b5('0x25')]=LISTID;_0x3d1be2[_0xe6b5('0x26')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xe6b5('0x1c')]&&_0x8b10c5){var _0x471821={};for(var _0x56864b=0x0,_0x5693c3=DUPLICATES[_0xe6b5('0x1c')];_0x56864b<_0x5693c3;_0x56864b+=0x1){_0x471821[DUPLICATES[_0x56864b]]=_0x3d1be2[DUPLICATES[_0x56864b]];}var _0x48040b=_[_0xe6b5('0x27')](_0x8b10c5,_0x471821);if(_0x48040b){return _0x4872cf(handleCheckRowError(_0xe6b5('0x28'),'Duplicate\x20Contact',_0x48040b,_0x1a937e));}}return db['CmContact'][_0xe6b5('0x29')](_0x3d1be2,{'raw':!![],'hooks':![],'fields':_[_0xe6b5('0x2a')](_0x3d1be2)})[_0xe6b5('0x2b')](function(_0x106508){if(DUPLICATES&&DUPLICATES['length']&&_0x8b10c5){_0x8b10c5['push'](_[_0xe6b5('0x2c')](_0x3d1be2,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x106508['id'];return _0x52fed9();})[_0xe6b5('0x2d')](function(_0xb6c7cb){return _0x4872cf(handleCheckRowError(_0xe6b5('0x19'),'Error\x20while\x20creating\x20contact:\x20'+(_0xb6c7cb['message']||JSON[_0xe6b5('0x2e')](_0xb6c7cb)),null,_0x1a937e));});});}function checkHopper(){function _0x3e795c(){return function(_0x26bf16){logger['error'](_0xe6b5('0x2f'),_0xe6b5('0x30'),util[_0xe6b5('0x31')](_0x26bf16,{'showHidden':![],'depth':null}));};}var _0x27b55d=function(_0x16b666,_0x588394){var _0x1dd935=squel[_0xe6b5('0x32')]()[_0xe6b5('0x33')](_0xe6b5('0x34'))[_0xe6b5('0x35')]([_0xe6b5('0x20'),_0xe6b5('0x36'),_0xe6b5('0x37'),_0xe6b5('0x25'),_0x588394,_0xe6b5('0x38'),_0xe6b5('0x39')],squel[_0xe6b5('0x3a')]()[_0xe6b5('0x3b')](_0xe6b5('0x20'),_0xe6b5('0x20'))[_0xe6b5('0x3b')](_0xe6b5('0x3c'),'scheduledAt')[_0xe6b5('0x3b')]('id','ContactId')[_0xe6b5('0x3b')](LISTID[_0xe6b5('0x3d')](),'ListId')[_0xe6b5('0x3b')](_0x16b666['id'][_0xe6b5('0x3d')](),_0x588394)[_0xe6b5('0x3b')](_0xe6b5('0x3c'),_0xe6b5('0x38'))[_0xe6b5('0x3b')](_0xe6b5('0x3c'),_0xe6b5('0x39'))['from'](_0xe6b5('0x3e'))[_0xe6b5('0x3f')](_0xe6b5('0x40'))[_0xe6b5('0x3f')](_0xe6b5('0x41'),LISTID['toString']())[_0xe6b5('0x3f')]('phone\x20IS\x20NOT\x20NULL')[_0xe6b5('0x3f')]('phone\x20NOT\x20IN\x20(?)',squel[_0xe6b5('0x3a')]()['field'](_0xe6b5('0x20'))[_0xe6b5('0x42')](_0xe6b5('0x34'))[_0xe6b5('0x3f')](_0x588394+_0xe6b5('0x43'),_0x16b666['id']['toString']())))['toString']();return _0x1dd935;};var _0x201a13=function(_0x516f0a,_0x1d3bcb){var _0x32209e=squel[_0xe6b5('0x32')]()['into'](_0xe6b5('0x34'))[_0xe6b5('0x35')]([_0xe6b5('0x20'),_0xe6b5('0x36'),'ContactId','ListId',_0x1d3bcb,_0xe6b5('0x38'),_0xe6b5('0x39')],squel[_0xe6b5('0x3a')]()['field'](_0xe6b5('0x20'),_0xe6b5('0x20'))['field'](_0xe6b5('0x3c'),_0xe6b5('0x36'))['field']('id',_0xe6b5('0x37'))[_0xe6b5('0x3b')](LISTID[_0xe6b5('0x3d')](),'ListId')['field'](_0x516f0a['id'][_0xe6b5('0x3d')](),_0x1d3bcb)[_0xe6b5('0x3b')](_0xe6b5('0x3c'),_0xe6b5('0x38'))[_0xe6b5('0x3b')](_0xe6b5('0x3c'),_0xe6b5('0x39'))[_0xe6b5('0x42')]('cm_contacts')['where'](_0xe6b5('0x40'))['where'](_0xe6b5('0x41'),LISTID[_0xe6b5('0x3d')]())[_0xe6b5('0x3f')](_0xe6b5('0x44'),squel[_0xe6b5('0x45')](hopperContacts))[_0xe6b5('0x3f')](_0xe6b5('0x46'))[_0xe6b5('0x3f')]('phone\x20NOT\x20IN\x20(?)',squel[_0xe6b5('0x3a')]()[_0xe6b5('0x3b')]('calleridnum')[_0xe6b5('0x42')](_0xe6b5('0x47'))[_0xe6b5('0x3f')](_0x1d3bcb+'\x20=\x20?',_0x516f0a['id']['toString']()))['where'](_0xe6b5('0x48'),squel['select']()['field'](_0xe6b5('0x20'))[_0xe6b5('0x42')](_0xe6b5('0x34'))[_0xe6b5('0x3f')](_0x1d3bcb+_0xe6b5('0x43'),_0x516f0a['id'][_0xe6b5('0x3d')]())))[_0xe6b5('0x3d')]();return _0x32209e;};function _0x57d3b6(_0x3b9608,_0x120ec0){var _0x4ca592=squel['insert']()[_0xe6b5('0x33')](_0xe6b5('0x34'))['fromQuery'](['phone',_0xe6b5('0x36'),'ContactId',_0xe6b5('0x25'),_0x120ec0,_0xe6b5('0x38'),_0xe6b5('0x39')],squel[_0xe6b5('0x3a')]()[_0xe6b5('0x3b')](_0xe6b5('0x20'),_0xe6b5('0x20'))[_0xe6b5('0x3b')]('NOW()',_0xe6b5('0x36'))[_0xe6b5('0x3b')]('id',_0xe6b5('0x37'))[_0xe6b5('0x3b')](LISTID['toString'](),_0xe6b5('0x25'))[_0xe6b5('0x3b')](_0x3b9608['id'][_0xe6b5('0x3d')](),_0x120ec0)[_0xe6b5('0x3b')](_0xe6b5('0x3c'),_0xe6b5('0x38'))['field'](_0xe6b5('0x3c'),_0xe6b5('0x39'))[_0xe6b5('0x42')]('cm_contacts')['where'](_0xe6b5('0x40'))[_0xe6b5('0x3f')](_0xe6b5('0x41'),LISTID['toString']())[_0xe6b5('0x3f')](_0xe6b5('0x44'),squel['str'](hopperContacts))['where']('phone\x20IS\x20NOT\x20NULL'))[_0xe6b5('0x3d')]();return _0x4ca592;}function _0x53894f(_0x3a75c4,_0x149fd9){var _0xcc313e=squel[_0xe6b5('0x32')]()[_0xe6b5('0x33')](_0xe6b5('0x49'))[_0xe6b5('0x35')]([_0xe6b5('0x20'),_0xe6b5('0x37'),'ListId',_0x149fd9,_0xe6b5('0x38'),'updatedAt'],squel[_0xe6b5('0x3a')]()['field'](_0xe6b5('0x20'),'phone')[_0xe6b5('0x3b')]('id',_0xe6b5('0x37'))[_0xe6b5('0x3b')](LISTID[_0xe6b5('0x3d')](),_0xe6b5('0x25'))[_0xe6b5('0x3b')](_0x3a75c4['id'][_0xe6b5('0x3d')](),_0x149fd9)[_0xe6b5('0x3b')](_0xe6b5('0x3c'),'createdAt')[_0xe6b5('0x3b')](_0xe6b5('0x3c'),_0xe6b5('0x39'))[_0xe6b5('0x42')]('cm_contacts')['where'](_0xe6b5('0x40'))[_0xe6b5('0x3f')](_0xe6b5('0x41'),LISTID[_0xe6b5('0x3d')]())[_0xe6b5('0x3f')](_0xe6b5('0x44'),squel[_0xe6b5('0x45')](hopperContacts))[_0xe6b5('0x3f')](_0xe6b5('0x46')))[_0xe6b5('0x3d')]();return _0xcc313e;}return db['VoiceQueue']['findAll']({'where':{'type':_0xe6b5('0x4a')},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0xe6b5('0x4b')],'as':_0xe6b5('0x4c'),'where':{'id':LISTID}}]})['then'](function(_0x5b6dbe){var _0x2d5493=[];if(_0x5b6dbe){var _0x3d2dd8;for(var _0x4429b3=0x0,_0x1e6062;_0x4429b3<_0x5b6dbe['length'];_0x4429b3+=0x1){_0x1e6062=_0x5b6dbe[_0x4429b3][_0xe6b5('0x4d')]({'plain':!![]});switch(_0x1e6062[_0xe6b5('0x4e')]){case _0xe6b5('0x4f'):_0x2d5493['push'](db[_0xe6b5('0x50')][_0xe6b5('0x51')](_0x201a13(_0x1e6062,_0xe6b5('0x52')))[_0xe6b5('0x2b')](function(){})[_0xe6b5('0x2d')](_0x3e795c()));break;case _0xe6b5('0x53'):_0x2d5493[_0xe6b5('0x54')](db[_0xe6b5('0x50')]['query'](_0x27b55d(_0x1e6062,'VoiceQueueId'))['then'](function(){})['catch'](_0x3e795c()));break;default:_0x2d5493[_0xe6b5('0x54')](db[_0xe6b5('0x50')][_0xe6b5('0x51')](_0x57d3b6(_0x1e6062,_0xe6b5('0x52')))['then'](function(){})['catch'](_0x3e795c()));}}}return _0x2d5493;})[_0xe6b5('0x55')]()[_0xe6b5('0x2b')](function(){return db['VoiceQueue'][_0xe6b5('0x56')]({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':db[_0xe6b5('0x4b')],'as':_0xe6b5('0x57'),'where':{'id':LISTID}}]})[_0xe6b5('0x2b')](function(_0x36815d){var _0x23682c=[];if(_0x36815d){var _0x2570da;for(var _0x353846=0x0,_0x4b4425;_0x353846<_0x36815d[_0xe6b5('0x1c')];_0x353846+=0x1){_0x4b4425=_0x36815d[_0x353846][_0xe6b5('0x4d')]({'plain':!![]});_0x23682c['push'](db['sequelize'][_0xe6b5('0x51')](_0x53894f(_0x4b4425,_0xe6b5('0x52')))[_0xe6b5('0x2b')](function(){})[_0xe6b5('0x2d')](_0x3e795c()));}}return _0x23682c;})[_0xe6b5('0x55')]();})[_0xe6b5('0x2b')](function(){return db[_0xe6b5('0x58')]['findAll']({'attributes':['id',_0xe6b5('0x4e')],'include':[{'model':db[_0xe6b5('0x4b')],'as':'Lists','where':{'id':LISTID}}]})[_0xe6b5('0x2b')](function(_0x4ce3be){var _0x4a3e6f=[];if(_0x4ce3be){for(var _0x3586d8=0x0,_0x228b33;_0x3586d8<_0x4ce3be[_0xe6b5('0x1c')];_0x3586d8+=0x1){_0x228b33=_0x4ce3be[_0x3586d8][_0xe6b5('0x4d')]({'plain':!![]});switch(_0x228b33[_0xe6b5('0x4e')]){case _0xe6b5('0x4f'):_0x4a3e6f[_0xe6b5('0x54')](db[_0xe6b5('0x50')][_0xe6b5('0x51')](_0x201a13(_0x228b33,'CampaignId'))[_0xe6b5('0x2b')](function(){})[_0xe6b5('0x2d')](_0x3e795c()));break;case _0xe6b5('0x53'):_0x4a3e6f[_0xe6b5('0x54')](db[_0xe6b5('0x50')][_0xe6b5('0x51')](_0x27b55d(_0x228b33,'CampaignId'))['then'](function(){})[_0xe6b5('0x2d')](_0x3e795c()));break;default:_0x4a3e6f[_0xe6b5('0x54')](db[_0xe6b5('0x50')][_0xe6b5('0x51')](_0x57d3b6(_0x228b33,'CampaignId'))['then'](function(){})[_0xe6b5('0x2d')](_0x3e795c()));}}}return _0x4a3e6f;})[_0xe6b5('0x55')]();})[_0xe6b5('0x2b')](function(){return db[_0xe6b5('0x58')][_0xe6b5('0x56')]({'attributes':['id'],'include':[{'model':db[_0xe6b5('0x4b')],'as':_0xe6b5('0x57'),'where':{'id':LISTID}}]})[_0xe6b5('0x2b')](function(_0x50473b){var _0x311e4f=[];if(_0x50473b){for(var _0x319f19=0x0,_0x524029;_0x319f19<_0x50473b['length'];_0x319f19+=0x1){_0x524029=_0x50473b[_0x319f19][_0xe6b5('0x4d')]({'plain':!![]});_0x311e4f[_0xe6b5('0x54')](db['sequelize'][_0xe6b5('0x51')](_0x53894f(_0x524029,_0xe6b5('0x59')))[_0xe6b5('0x2b')](function(){})[_0xe6b5('0x2d')](_0x3e795c()));}}return _0x311e4f;})['all']();})[_0xe6b5('0x2d')](function(_0xe203a4){logger[_0xe6b5('0x19')](_0xe6b5('0x5a'),_0xe6b5('0x5b'),_0xe203a4[_0xe6b5('0x1d')]);});}var processPromises=function(_0x565225){return BPromise[_0xe6b5('0x55')](promises)[_0xe6b5('0x2b')](function(_0x12dbbb){})[_0xe6b5('0x2d')](function(_0x4e9442){logger['error'](_0xe6b5('0x5c'),JSON[_0xe6b5('0x2e')](_0x4e9442));})[_0xe6b5('0x5d')](function(){socket['emit']('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x565225){return _0x565225[_0xe6b5('0x5e')]();}});};var endCsv=function(){return BPromise[_0xe6b5('0x5f')]()['then'](function(){if(hopperContacts){return checkHopper();}})[_0xe6b5('0x2b')](function(){socket[_0xe6b5('0x60')](_0xe6b5('0x61')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs['unlinkSync'](FILEPATH);}catch(_0x34e6ea){logger[_0xe6b5('0x19')](_0xe6b5('0x62'),JSON[_0xe6b5('0x2e')](_0x34e6ea));}finally{process['exit'](0x0);}});};process['on']('SIGINT',function(){logger[_0xe6b5('0x63')](_0xe6b5('0x64'));endCsv();});function main(){return BPromise[_0xe6b5('0x5f')]()[_0xe6b5('0x2b')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xe6b5('0x65')](',');return db[_0xe6b5('0x66')][_0xe6b5('0x56')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0x3428a1){var _0x55a934=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa['parse'](_0x55a934,{'header':!![],'skipEmptyLines':!![],'step':function(_0x13c1e0,_0x3355dc){total+=0x1;var _0x54b601=total;promises[_0xe6b5('0x54')](checkRow(_0x13c1e0,_0x3428a1,_0x54b601)[_0xe6b5('0x2b')](function(){success+=0x1;})[_0xe6b5('0x2d')](function(_0xbe6819){if(_0xbe6819[_0xe6b5('0x19')]){errors+=0x1;delete _0xbe6819['error'];}else if(_0xbe6819['duplicate']){duplicates+=0x1;delete _0xbe6819[_0xe6b5('0x28')];}rows[_0xe6b5('0x54')](_0xbe6819);}));if(total%0xc8===0x0){_0x3355dc['pause']();return processPromises(_0x3355dc);}},'complete':function(){return processPromises()['then'](function(){logger[_0xe6b5('0x63')](_0xe6b5('0x67'));endCsv();});},'error':function(_0x30fb63,_0x2c8e2c){logger[_0xe6b5('0x63')](_0xe6b5('0x68'),JSON[_0xe6b5('0x2e')](_0x30fb63));endCsv();}});})[_0xe6b5('0x2d')](function(_0x82b128){logger[_0xe6b5('0x19')](_0xe6b5('0x69'),JSON[_0xe6b5('0x2e')](_0x82b128));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 4cedeea..123a74d 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 _0xd602=['rows','find','hasOwnProperty','trim','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','agent\x20not\x20exists','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','timezones','firstName','itemTypeId','description','SystemRow','appendFileSync','emit','Abort\x20parser','abort','SystemError','step','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','campaigns_','voice_queues_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','dialTimezone,utcOffset',',\x20scheduledAt\x20=\x20NOW()','duplicates','DROP\x20TABLE\x20','each','contactId','contactTypeId','orderBy','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns_has_cm_lists','CampaignId','finish','affectedRows','contact:import:','unlink','complete','argv','existsSync','file\x20doesn\x27t\x20exists','parse','binding','binding\x20doesn\x27t\x20exists','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','papaparse','util','moment','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/environment/shared','import','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','CmContact','findAll','AdditionalPhones','then','push','all','length','split','isNil','CmContactHasItem','findOne','update','create','PHONE','inserted','cm_contacts.phone','cm_contacts.id','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','phone','scheduledat','ContactId','createdAt','updatedAt','priority','UserId','recallme','fields','cm_contacts.ListId\x20=\x20','.CmListId','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22onlyIfOpen\x22','toString','cm_contacts.ListId','cm_hopper_black','ListId','cm_contacts','.CmListId\x20=\x20?','ListId\x20=\x20?','.offset-cm_contacts.utcOffset\x20minute)','cm_contacts.priority','\x22always\x22','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','concat','CompanyId','scheduledAt',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','min_id','group','info','Received\x20SIGINT','error','message','exit','errors','code','query','spread','catch','campaigns.dialTimezone','campaigns','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','campaigns_has_cm_lists.CmListId=','voice_queues.id','voice_queues.dialTimezone','voice_queues','voice_queues_has_cm_lists','voice_queues_has_cm_lists.CmListId=','sequelize','utcOffset','set','offset','dialTimezone','main','stringify','start','socket_timestamp','root','server/files/tmp','.csv','keys','includes','header','name','_description','data'];(function(_0x27c174,_0x2374e5){var _0x1d7cb6=function(_0x313324){while(--_0x313324){_0x27c174['push'](_0x27c174['shift']());}};_0x1d7cb6(++_0x2374e5);}(_0xd602,0xf5));var _0x2d60=function(_0x574409,_0x3e630b){_0x574409=_0x574409-0x0;var _0x107548=_0xd602[_0x574409];return _0x107548;};'use strict';var fs=require('fs');var path=require('path');var _=require('lodash');var Papa=require(_0x2d60('0x0'));var util=require(_0x2d60('0x1'));var BPromise=require('bluebird');var moment=require(_0x2d60('0x2'));var squel=require(_0x2d60('0x3'));var Redis=require(_0x2d60('0x4'));var db=require(_0x2d60('0x5'))['db'];var config=require(_0x2d60('0x6'));var shared=require(_0x2d60('0x7'));var logger=require('../../../config/logger')(_0x2d60('0x8'));config[_0x2d60('0x9')]=_[_0x2d60('0xa')](config[_0x2d60('0x9')],{'host':_0x2d60('0xb'),'port':0x18eb});var socket=require(_0x2d60('0xc'))(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0x2d60('0xd')](_0x2d60('0xe'));function isEmail(_0x329654){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))*$/[_0x2d60('0xf')](_0x329654);}function selectNotIn(_0x9fe8bd,_0x4dd69d,_0x20432d,_0x2540a0,_0x29b7f7){return squel[_0x2d60('0x10')]()[_0x2d60('0x11')]('phone')[_0x2d60('0x12')](_0x2540a0)[_0x2d60('0x13')](_0x4dd69d,null,_0x4dd69d+_0x2d60('0x14')+_0x2540a0+'.'+_0x20432d)[_0x2d60('0x15')](_0x2540a0+'.'+_0x20432d+_0x2d60('0x16')+_0x9fe8bd+'.'+_0x20432d)[_0x2d60('0x15')](_0x4dd69d+_0x2d60('0x17')+_0x29b7f7[_0x2d60('0x13')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x218c1f,_0x20a7af){promisesAdditionalPhones=[];return db[_0x2d60('0x18')][_0x2d60('0x19')]({'raw':!![],'attributes':['id',_0x2d60('0x1a')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0x2d60('0x1b')](function(_0x15dc58){if(_0x15dc58!==null){var _0x693bc9=[];for(var _0x401eec=0x0;_0x401eec<_0x15dc58['length'];_0x401eec++){var _0x458f0e=_0x15dc58[_0x401eec];_0x693bc9[_0x2d60('0x1c')](insertAdditionalPhones(_0x458f0e));}}Promise[_0x2d60('0x1d')](_0x693bc9)[_0x2d60('0x1b')](function(){_0x218c1f({'val':0x1});});});});}function insertAdditionalPhones(_0x32e756){return new Promise(function(_0x5322b2,_0x490a09){var _0x735f7=_0x32e756[_0x2d60('0x1a')];var _0x1e1d89=_0x735f7['split'](';');var _0xca4053=[];orderBy=0x0;for(var _0x201a0f=0x0;_0x201a0f<_0x1e1d89[_0x2d60('0x1e')];_0x201a0f++){_0xca4053[_0x2d60('0x1c')](splitAdditionalPhone(_0x32e756['id'],_0x1e1d89[_0x201a0f]));}Promise[_0x2d60('0x1d')](_0xca4053)['then'](function(){_0x5322b2({'val':_0x1e1d89['length']});});});}function splitAdditionalPhone(_0xb5112b,_0x2f9f73){return new Promise(function(_0x4fae9e,_0x2d2308){var _0x194c44=_0x2f9f73[_0x2d60('0x1f')](':');var _0x20b35a=_0x194c44[0x0];var _0x26fed0=_0x194c44[0x1];if(!_[_0x2d60('0x20')](_0x26fed0)){var _0xf995ba=_0x26fed0[_0x2d60('0x1f')]('|');var _0xc03afa=[];for(var _0x2bd2c9=0x0;_0x2bd2c9<_0xf995ba['length'];_0x2bd2c9++){if(_0xf995ba[_0x2bd2c9]!==''){var _0x2c682c=_['filter'](promisesAdditionalPhones,{'contactId':_0xb5112b,'phone':_0xf995ba[_0x2bd2c9]});if(_0x2c682c[_0x2d60('0x1e')]==0x0){orderBy++;promisesAdditionalPhones[_0x2d60('0x1c')]({'contactId':_0xb5112b,'contactTypeId':_0x20b35a,'phone':_0xf995ba[_0x2bd2c9],'orderBy':orderBy});}}}_0x4fae9e({'ok':0x1});}else _0x4fae9e({'res':0x0});});}function createAdditionalPhone(_0x51605b,_0x2590b2,_0x51b7f2,_0x4e6683){var _0x304d25='';var _0x7d7eab='';var _0x3215db=_0x51b7f2[_0x2d60('0x1f')]('§');_0x304d25=_0x3215db[0x0];if(_0x3215db[_0x2d60('0x1e')]==0x2)_0x7d7eab=_0x3215db[0x1];return new Promise(function(_0x3fe7e7,_0x4afc6a){return db[_0x2d60('0x21')][_0x2d60('0x22')]({'where':{'CmContactId':_0x51605b,'item':_0x304d25}})[_0x2d60('0x1b')](function(_0x3b47de){if(_0x3b47de){return db[_0x2d60('0x21')][_0x2d60('0x23')]({'ItemTypeId':_0x2590b2,'description':_0x7d7eab,'OrderBy':_0x4e6683},{'where':{'CmContactId':_0x51605b,'item':_0x304d25}})[_0x2d60('0x1b')](function(_0x32ae0e){_0x3fe7e7({'res':'updated'});});}else{return db[_0x2d60('0x21')][_0x2d60('0x24')]({'CmContactId':_0x51605b,'item':_0x304d25,'description':_0x7d7eab,'ItemTypeId':_0x2590b2,'OrderBy':_0x4e6683,'ItemClass':_0x2d60('0x25')})[_0x2d60('0x1b')](function(_0x1650a2){_0x3fe7e7({'res':_0x2d60('0x26')});});}});});}function insertCmHopper(_0x2344e5,_0x1e2d64,_0x270ed4,_0xda0bc2,_0x45dee1){var _0xcbcac5=[_0x2d60('0x27'),'cm_contacts.scheduledat',_0x2d60('0x28'),'cm_contacts.ListId',_0x1e2d64+'.'+_0xda0bc2,_0x2d60('0x29'),_0x2d60('0x2a'),'cm_contacts.priority',_0x2d60('0x2b'),'\x22'+_0x45dee1+'\x22'];return squel[_0x2d60('0x2c')]()[_0x2d60('0x2d')](_0x2d60('0x2e'))[_0x2d60('0x2f')]([_0x2d60('0x30'),_0x2d60('0x31'),_0x2d60('0x32'),'ListId',_0xda0bc2,_0x2d60('0x33'),_0x2d60('0x34'),_0x2d60('0x35'),_0x2d60('0x36'),_0x2d60('0x37')],squel['select']()[_0x2d60('0x38')](_0xcbcac5)[_0x2d60('0x12')](_0x1e2d64)['join']('cm_contacts',null,_0x2d60('0x39')+_0x1e2d64+_0x2d60('0x3a'))['join'](_0x270ed4,null,_0x270ed4+_0x2d60('0x14')+_0x1e2d64+'.'+_0xda0bc2)[_0x2d60('0x15')](_0x1e2d64+'.CmListId\x20=\x20?',_0x2344e5)[_0x2d60('0x15')](_0x2d60('0x3b'),NOW)[_0x2d60('0x15')](_0x2d60('0x3c'),selectNotIn(_0x1e2d64,_0x270ed4,_0xda0bc2,_0x2d60('0x2e'),['\x22always\x22',_0x2d60('0x3d')]))['where'](_0x2d60('0x3c'),selectNotIn(_0x1e2d64,_0x270ed4,_0xda0bc2,_0x2d60('0x2e'),['\x22always\x22'])))[_0x2d60('0x3e')]();}function insertCmHopperBlack(_0x1f45be,_0x29efa5,_0x2afb40,_0x280e22){var _0x35bf57=[_0x2d60('0x27'),_0x2d60('0x28'),_0x2d60('0x3f'),_0x29efa5+'.'+_0x280e22,_0x2d60('0x29'),_0x2d60('0x2a')];return squel[_0x2d60('0x2c')]()[_0x2d60('0x2d')](_0x2d60('0x40'))['fromQuery']([_0x2d60('0x30'),'ContactId',_0x2d60('0x41'),_0x280e22,_0x2d60('0x33'),_0x2d60('0x34')],squel[_0x2d60('0x10')]()[_0x2d60('0x38')](_0x35bf57)[_0x2d60('0x12')](_0x29efa5)[_0x2d60('0x13')](_0x2d60('0x42'),null,'cm_contacts.ListId\x20=\x20'+_0x29efa5+'.CmListId')[_0x2d60('0x13')](_0x2afb40,null,_0x2afb40+_0x2d60('0x14')+_0x29efa5+'.'+_0x280e22)[_0x2d60('0x15')](_0x29efa5+_0x2d60('0x43'),_0x1f45be)['where'](_0x2d60('0x3b'),NOW)[_0x2d60('0x15')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0x2d60('0x10')]()[_0x2d60('0x11')](_0x2d60('0x30'))['from'](_0x2d60('0x40'))[_0x2d60('0x15')](_0x2d60('0x44'),_0x1f45be)[_0x2d60('0x15')](_0x280e22+_0x2d60('0x16')+_0x29efa5+'.'+_0x280e22)))[_0x2d60('0x3e')]();}function insertTzCmHopper(_0x113e2b,_0x433396,_0x1f6638,_0x43e1b8,_0x1bf4ca,_0x2a765b){var _0x1f1f0c=[_0x2d60('0x27'),'date_add(cm_contacts.scheduledat,interval\x20'+_0x2a765b+_0x2d60('0x45'),_0x2d60('0x28'),_0x2d60('0x3f'),_0x433396+'.'+_0x43e1b8,_0x2d60('0x29'),_0x2d60('0x2a'),_0x2d60('0x46'),_0x2d60('0x2b'),'\x22'+_0x1bf4ca+'\x22'];var _0x1f4ce1=squel[_0x2d60('0x2c')]()[_0x2d60('0x2d')](_0x2d60('0x2e'))[_0x2d60('0x2f')]([_0x2d60('0x30'),_0x2d60('0x31'),_0x2d60('0x32'),'ListId',_0x43e1b8,'createdAt',_0x2d60('0x34'),_0x2d60('0x35'),_0x2d60('0x36'),'recallme'],squel[_0x2d60('0x10')]()['fields'](_0x1f1f0c)[_0x2d60('0x12')](_0x433396)[_0x2d60('0x13')](_0x2d60('0x42'),null,_0x2d60('0x39')+_0x433396+_0x2d60('0x3a'))[_0x2d60('0x13')](_0x1f6638,null,_0x1f6638+_0x2d60('0x14')+_0x433396+'.'+_0x43e1b8)[_0x2d60('0x13')](_0x2a765b,null,_0x2a765b+_0x2d60('0x14')+_0x433396+'.'+_0x43e1b8)['where'](_0x433396+_0x2d60('0x43'),_0x113e2b)[_0x2d60('0x15')](_0x2d60('0x3b'),NOW)['where'](_0x2d60('0x3c'),selectNotIn(_0x433396,_0x1f6638,_0x43e1b8,_0x2d60('0x2e'),[_0x2d60('0x47'),_0x2d60('0x3d')]))['where'](_0x2d60('0x3c'),selectNotIn(_0x433396,_0x1f6638,_0x43e1b8,_0x2d60('0x2e'),[_0x2d60('0x47')])))[_0x2d60('0x3e')]();return _0x1f4ce1;}function insertTzCmHopperBlack(_0x3ae83c,_0x3f6631,_0x5777d3,_0x639ec8){var _0x1b6043=[_0x2d60('0x27'),_0x2d60('0x28'),_0x2d60('0x3f'),_0x3f6631+'.'+_0x639ec8,_0x2d60('0x29'),_0x2d60('0x2a')];return squel[_0x2d60('0x2c')]()[_0x2d60('0x2d')](_0x2d60('0x40'))[_0x2d60('0x2f')]([_0x2d60('0x30'),_0x2d60('0x32'),_0x2d60('0x41'),_0x639ec8,_0x2d60('0x33'),_0x2d60('0x34')],squel[_0x2d60('0x10')]()[_0x2d60('0x38')](_0x1b6043)[_0x2d60('0x12')](_0x3f6631)[_0x2d60('0x13')](_0x2d60('0x42'),null,_0x2d60('0x39')+_0x3f6631+'.CmListId')['join'](_0x5777d3,null,_0x5777d3+'.id\x20=\x20'+_0x3f6631+'.'+_0x639ec8)[_0x2d60('0x15')](_0x3f6631+_0x2d60('0x43'),_0x3ae83c)[_0x2d60('0x15')](_0x2d60('0x3b'),NOW)[_0x2d60('0x15')](_0x2d60('0x3c'),squel[_0x2d60('0x10')]()[_0x2d60('0x11')](_0x2d60('0x30'))[_0x2d60('0x12')](_0x2d60('0x40'))[_0x2d60('0x15')](_0x2d60('0x44'),_0x3ae83c)[_0x2d60('0x15')](_0x639ec8+'\x20=\x20'+_0x3f6631+'.'+_0x639ec8)))[_0x2d60('0x3e')]();}function insertCmHopperAdditionalPhones(_0x3bd76e){var _0x5bd71d=[_0x2d60('0x48'),_0x2d60('0x49'),_0x2d60('0x4a'),'cm_contact_has_items.createdAt',_0x2d60('0x4b')];return squel[_0x2d60('0x2c')]()[_0x2d60('0x2d')](_0x2d60('0x4c'))[_0x2d60('0x2f')](['CmHopperId','phone',_0x2d60('0x4d'),_0x2d60('0x33'),_0x2d60('0x34')],squel['select']()[_0x2d60('0x38')](_0x5bd71d)['from'](_0x2d60('0x2e'))[_0x2d60('0x13')]('cm_contacts',null,_0x2d60('0x4e'))[_0x2d60('0x13')]('cm_contact_has_items',null,_0x2d60('0x4f'))[_0x2d60('0x15')]('cm_hopper.ListId\x20=\x20?',_0x3bd76e)[_0x2d60('0x15')](_0x2d60('0x3b'),NOW))[_0x2d60('0x3e')]();}function insertCmContact(_0x2a264b,_0x573b3e,_0x31a5ff,_0x526fd5){var _0x58f58d=_[_0x2d60('0x50')](_['keys'](_0x526fd5),[_0x2d60('0x41'),_0x2d60('0x51'),_0x2d60('0x33'),_0x2d60('0x34'),_0x2d60('0x52')]);return squel[_0x2d60('0x2c')]()['into']('cm_contacts')[_0x2d60('0x2f')](_0x58f58d,squel['select']()[_0x2d60('0x38')](_0x58f58d)['from'](_0x573b3e)[_0x2d60('0x15')]('('+_0x31a5ff['join'](',')+_0x2d60('0x53'),squel[_0x2d60('0x10')]()[_0x2d60('0x38')](_0x31a5ff)[_0x2d60('0x12')](_0x2d60('0x42'))[_0x2d60('0x15')](_0x2d60('0x44'),_0x2a264b)[_0x2d60('0x15')](_0x2d60('0x54')))['where'](_0x2d60('0x55'),squel['select']()[_0x2d60('0x11')]('MIN(id)',_0x2d60('0x56'))[_0x2d60('0x12')](_0x573b3e)[_0x2d60('0x57')](_0x31a5ff[_0x2d60('0x13')](','))))[_0x2d60('0x3e')]();}function handleStop(){logger[_0x2d60('0x58')](_0x2d60('0x59'));stopped=!![];}function handleUncaughtException(_0x252d71){logger[_0x2d60('0x5a')](_0x252d71[_0x2d60('0x5b')]);process[_0x2d60('0x5c')](0x1);}function handleError(_0x200a65,_0x38de30){stats[_0x2d60('0x5d')][_0x2d60('0x1c')]({'name':_0x38de30[_0x2d60('0x5e')],'message':_0x38de30[_0x2d60('0x5b')],'row':_0x200a65});}function handleQuery(_0x9d1c0d){logger[_0x2d60('0x58')](_0x9d1c0d);return db['sequelize'][_0x2d60('0x5f')](_0x9d1c0d)[_0x2d60('0x60')](function(_0xcc3549){results['push'](_0xcc3549);})[_0x2d60('0x61')](function(_0x1dd447){logger[_0x2d60('0x5a')](_0x1dd447[_0x2d60('0x5b')]);});}function updateTzCampaigns(_0x299e7d){return new Promise(function(_0x3ef989,_0x4c055c){var _0x2eacdc=squel[_0x2d60('0x10')]()['fields'](['campaigns.id',_0x2d60('0x62')])['from'](_0x2d60('0x63'))[_0x2d60('0x13')]('campaigns_has_cm_lists',null,_0x2d60('0x64'))['where'](_0x2d60('0x65')+_0x299e7d);db['sequelize'][_0x2d60('0x5f')](_0x2eacdc[_0x2d60('0x3e')]())[_0x2d60('0x60')](function(_0xa4d96e){var _0x20b6c3=[];for(var _0x66d831=0x0;_0x66d831<_0xa4d96e[_0x2d60('0x1e')];_0x66d831++){_0x20b6c3[_0x2d60('0x1c')](getTimezoneData(_0xa4d96e[_0x66d831],tmp_campaigns));}BPromise[_0x2d60('0x1d')](_0x20b6c3)[_0x2d60('0x1b')](function(){_0x3ef989({'val':0x1});});})[_0x2d60('0x61')](function(_0x2dd8a0){logger[_0x2d60('0x5a')](_0x2dd8a0[_0x2d60('0x5b')]);_0x3ef989({'val':0x0});});});}function updateTzVoiceQueues(_0x569a97){return new Promise(function(_0x1d9ad2,_0x12deac){var _0x717945=squel[_0x2d60('0x10')]()[_0x2d60('0x38')]([_0x2d60('0x66'),_0x2d60('0x67')])[_0x2d60('0x12')](_0x2d60('0x68'))['join'](_0x2d60('0x69'),null,'voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId')[_0x2d60('0x15')](_0x2d60('0x6a')+_0x569a97);db[_0x2d60('0x6b')][_0x2d60('0x5f')](_0x717945['toString']())[_0x2d60('0x60')](function(_0x1c5f08){var _0x157b43=[];for(var _0xe5cbd7=0x0;_0xe5cbd7<_0x1c5f08[_0x2d60('0x1e')];_0xe5cbd7++){_0x157b43[_0x2d60('0x1c')](getTimezoneData(_0x1c5f08[_0xe5cbd7],tmp_voice_queues));}BPromise[_0x2d60('0x1d')](_0x157b43)['then'](function(){_0x1d9ad2({'val':0x1});});})[_0x2d60('0x61')](function(_0xef3507){logger['error'](_0xef3507['message']);_0x1d9ad2({'val':0x0});});});}function getTimezoneData(_0xfb9176,_0x3618b8){return new Promise(function(_0x2683bb,_0x24bd79){var _0x515223=shared['timezones'];var _0x4d4cec=_0x515223[_0xfb9176['dialTimezone']];if(_[_0x2d60('0x20')](_0x4d4cec)){_0x2683bb({'ret':0x1});}else{var _0x376a82=_0x4d4cec[_0x2d60('0x6c')];var _0x37c212=squel['insert']()['into'](_0x3618b8)['set']('id',_0xfb9176['id'])[_0x2d60('0x6d')](_0x2d60('0x6e'),_0x376a82)[_0x2d60('0x6d')](_0x2d60('0x6f'),_0xfb9176[_0x2d60('0x6f')])[_0x2d60('0x3e')]();return db[_0x2d60('0x6b')][_0x2d60('0x5f')](_0x37c212)[_0x2d60('0x60')](function(_0x3c14ec){_0x2683bb({'ret':0x1});})[_0x2d60('0x61')](function(_0x1de48f){logger[_0x2d60('0x5a')](_0x1de48f['message']);_0x24bd79({'ret':0x1});});}});}function handleTZQuery(_0x4c611d){logger[_0x2d60('0x58')](_0x4c611d);return db['sequelize'][_0x2d60('0x5f')](_0x4c611d)[_0x2d60('0x60')](function(_0x7954fc){})[_0x2d60('0x61')](function(_0x548b8e){logger['error'](_0x548b8e[_0x2d60('0x5b')]);});}function main(_0xe04693,_0x56eecf,_0x17095f,_0x1223de){logger[_0x2d60('0x58')](_0x2d60('0x70'),_0xe04693,JSON[_0x2d60('0x71')](_0x56eecf));process['send'](_0x2d60('0x72'));var _0x30243f=_0x56eecf['binding'];var _0x51d4bd=_['clone'](_0x30243f);var _0x5a7dca=_0x56eecf[_0x2d60('0x73')];var _0x39d1d6=path[_0x2d60('0x13')](config[_0x2d60('0x74')],_0x2d60('0x75'),_0x5a7dca+_0x2d60('0x76'));hasTZ=_[_0x2d60('0x77')](_0x30243f)[_0x2d60('0x78')]('dialTimezone');var _0x13289c=_['keys'](_0x30243f)[_0x2d60('0x13')]();logger[_0x2d60('0x58')](_0x2d60('0x79'),_0x13289c);db['ContactItemType'][_0x2d60('0x19')]({'raw':!![],'attributes':['id','name']})[_0x2d60('0x1b')](function(_0x2aeb92){for(var _0x141d21=0x0;_0x141d21<_0x2aeb92[_0x2d60('0x1e')];_0x141d21++){if(_0x2aeb92[_0x141d21]['name']in _0x30243f){contactItemTypes['push'](_0x2aeb92[_0x141d21]);delete _0x51d4bd[_0x2aeb92[_0x141d21]['name']];hasAdditionalPhones=!![];}for(var _0xa2bfb9 in _0x30243f){if(_0x2aeb92[_0x141d21][_0x2d60('0x7a')]+_0x2d60('0x7b')===_0xa2bfb9){phoneDescriptions[_0x2d60('0x1c')]({'itemTypeId':_0x2aeb92[_0x141d21]['id'],'description':_0xa2bfb9});delete _0x51d4bd[_0xa2bfb9];}}}if(hasAdditionalPhones)_0x51d4bd['AdditionalPhones']='';var _0x3360b9=_['keys'](_0x51d4bd)[_0x2d60('0x13')]();logger[_0x2d60('0x58')](_0x2d60('0x79'),_0x3360b9);fs['writeFileSync'](_0x39d1d6,_0x3360b9+'\x0a');Papa['parse'](fs['createReadStream'](_0xe04693),{'header':!![],'skipEmptyLines':!![],'step':function(_0x4a9434,_0x3cab07){try{for(var _0x12b31a=0x0,_0x3ec725=[];_0x12b31a<_0x4a9434[_0x2d60('0x7c')][_0x2d60('0x1e')];_0x12b31a++){stats[_0x2d60('0x7d')]+=0x1;if(_0x4a9434['errors'][_0x12b31a]){handleError(_0x4a9434[_0x2d60('0x7c')][_0x12b31a],_0x4a9434[_0x2d60('0x5d')][_0x12b31a]);}else{var _0x4c3a18=[];var _0x34df14=[];var _0x5ce43b={};for(var _0x4a5a1a in _0x30243f){let _0x4d968c=contactItemTypes[_0x2d60('0x7e')](_0x5affdd=>_0x5affdd['name']===_0x4a5a1a);let _0x341121=contactItemTypes[_0x2d60('0x7e')](_0x48f710=>_0x48f710['name']+_0x2d60('0x7b')===_0x4a5a1a);if(_[_0x2d60('0x20')](_0x4d968c)&&_['isNil'](_0x341121)){if(_0x30243f[_0x2d60('0x7f')](_0x4a5a1a)){if(_0x4a9434[_0x2d60('0x7c')][_0x12b31a][_0x30243f[_0x4a5a1a]]){var _0x3d50b3=_[_0x2d60('0x80')](_0x4a9434[_0x2d60('0x7c')][_0x12b31a][_0x30243f[_0x4a5a1a]][_0x2d60('0x81')](/"/g,'\x27'));switch(_0x4a5a1a){case'scheduledat':var _0x187d5d=moment(_0x3d50b3,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x187d5d[_0x2d60('0x82')]()){_0x3ec725[_0x2d60('0x1c')]('\x22'+_0x3d50b3+'\x22');}else{_0x4c3a18[_0x2d60('0x1c')](_0x2d60('0x83'));}break;case _0x2d60('0x35'):var _0x27cb0c=parseInt(_0x3d50b3);_0x3d50b3=_[_0x2d60('0x84')](_0x27cb0c)||_0x27cb0c<0x0||_0x27cb0c>0x4?_0x1223de?0x3:0x2:_0x27cb0c;_0x3ec725['push']('\x22'+_0x3d50b3+'\x22');break;case _0x2d60('0x36'):var _0x3631ff=parseInt(_0x3d50b3);if(_[_0x2d60('0x85')](_0x3631ff)&&_[_0x2d60('0x78')](_0x17095f,_0x3631ff)){_0x3ec725[_0x2d60('0x1c')]('\x22'+_0x3631ff+'\x22');}else{_0x4c3a18[_0x2d60('0x1c')](_0x2d60('0x86'));}break;case'email':if(isEmail(_0x3d50b3)){_0x3ec725[_0x2d60('0x1c')]('\x22'+_0x3d50b3+'\x22');}else{_0x4c3a18['push'](_0x2d60('0x87'));}break;case _0x2d60('0x88'):var _0x5bb912=moment(_0x3d50b3,_0x2d60('0x89'),!![]);if(_0x5bb912[_0x2d60('0x82')]()){_0x3ec725[_0x2d60('0x1c')]('\x22'+_0x3d50b3+'\x22');}else{_0x4c3a18[_0x2d60('0x1c')](_0x2d60('0x8a'));}break;case _0x2d60('0x6f'):var _0x20d8bb=shared[_0x2d60('0x8b')];var _0x1c1035=_0x20d8bb[_0x3d50b3];if(!_[_0x2d60('0x20')](_0x1c1035)){var _0x2d34d3=_0x1c1035[_0x2d60('0x6c')];_0x3ec725[_0x2d60('0x1c')]('\x22'+_0x3d50b3+'\x22');_0x3ec725[_0x2d60('0x1c')]('\x22'+_0x2d34d3+'\x22');}break;default:_0x3ec725[_0x2d60('0x1c')]('\x22'+_0x3d50b3+'\x22');}}else{switch(_0x4a5a1a){case _0x2d60('0x8c'):case _0x2d60('0x30'):_0x4c3a18[_0x2d60('0x1c')](_0x4a5a1a+'\x20not\x20specified');break;default:_0x3ec725[_0x2d60('0x1c')]('\x22\x22');}}}}else{var _0x587a69='';if(!_['isNil'](_0x4d968c)){if(!_0x5ce43b[_0x2d60('0x7f')](_0x4d968c['id'])){if(!_[_0x2d60('0x20')](_0x4a9434['data'][_0x12b31a][_0x30243f[_0x4a5a1a]])){var _0x3d50b3=_[_0x2d60('0x80')](_0x4a9434['data'][_0x12b31a][_0x30243f[_0x4a5a1a]][_0x2d60('0x81')](/"/g,'\x27'));var _0x223287=phoneDescriptions[_0x2d60('0x7e')](_0x28c580=>_0x28c580[_0x2d60('0x8d')]===_0x4d968c['id']);if(!_['isNil'](_0x223287)){var _0x51d096=_[_0x2d60('0x80')](_0x4a9434[_0x2d60('0x7c')][_0x12b31a][_0x30243f[_0x223287[_0x2d60('0x8e')]]][_0x2d60('0x81')](/"/g,'\x27'));if(!_[_0x2d60('0x20')](_0x51d096))_0x3d50b3=_0x3d50b3+'§'+_0x51d096;}if(_0x587a69=='')_0x587a69=_0x3d50b3;else _0x587a69+='|'+_0x3d50b3;}_0x34df14[_0x2d60('0x1c')](_0x4d968c['id']+':'+_0x587a69);_0x5ce43b[_0x4d968c['id']]=0x1;}}}}if(hasAdditionalPhones){_0x3ec725['push']('\x22'+_0x34df14[_0x2d60('0x13')](';')+'\x22');}if(_0x4c3a18[_0x2d60('0x1e')]){handleError(_0x4a9434['data'][_0x12b31a],{'code':_0x2d60('0x8f'),'message':_0x4c3a18[_0x2d60('0x13')]()});}else{fs[_0x2d60('0x90')](_0x39d1d6,_0x3ec725[_0x2d60('0x13')]()+'\x0a');}_0x3ec725=[];}if(!(stats[_0x2d60('0x7d')]%0xc8)){socket[_0x2d60('0x91')]('contact:import:'+_0x5a7dca,stats);stats[_0x2d60('0x5d')]=[];}}if(stopped){logger['info'](_0x2d60('0x92'));_0x3cab07[_0x2d60('0x93')]();}}catch(_0x13d71c){handleError(_0x4a9434['data'][_0x12b31a],{'code':_0x2d60('0x94'),'message':_0x13d71c[_0x2d60('0x5b')]});logger[_0x2d60('0x5a')](_0x2d60('0x95'),_0x13d71c[_0x2d60('0x5b')]);}},'complete':function(){try{var _0x4fa550=[];var _0x4f657c=[];var _0xfece95=_0x2d60('0x42');if(_0x56eecf['duplicates']&&_0x56eecf['duplicates']['length']){_0xfece95=_0x2d60('0x96')+_0x5a7dca;_0x4fa550[_0x2d60('0x1c')](_0x2d60('0x97')+_0xfece95+_0x2d60('0x98'));}tmp_campaigns=_0x2d60('0x99')+_0x5a7dca;tmp_voice_queues=_0x2d60('0x9a')+_0x5a7dca;_0x4f657c[_0x2d60('0x1c')](_0x2d60('0x97')+tmp_campaigns+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');_0x4f657c['push'](_0x2d60('0x97')+tmp_voice_queues+_0x2d60('0x9b'));BPromise['each'](_0x4f657c,handleTZQuery)[_0x2d60('0x1b')](function(_0x37736f){updateTzCampaigns(_0x56eecf[_0x2d60('0x41')])[_0x2d60('0x1b')](function(_0x1f6a34){updateTzVoiceQueues(_0x56eecf[_0x2d60('0x41')])[_0x2d60('0x1b')](function(_0xa1ee25){if(hasTZ)_0x3360b9=_0x3360b9['replace'](_0x2d60('0x6f'),_0x2d60('0x9c'));var _0xf6c56=util['format']('LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',_0x39d1d6,_0xfece95,_0x3360b9,_0x56eecf[_0x2d60('0x41')],_0x56eecf[_0x2d60('0x51')]||null,NOW,NOW);if(_[_0x2d60('0x20')](_0x30243f[_0x2d60('0x31')])){_0xf6c56+=_0x2d60('0x9d');}_0x4fa550[_0x2d60('0x1c')](_0xf6c56);if(_0x56eecf[_0x2d60('0x9e')]&&_0x56eecf['duplicates']['length']){_0x4fa550[_0x2d60('0x1c')](insertCmContact(_0x56eecf[_0x2d60('0x41')],_0xfece95,_0x56eecf[_0x2d60('0x9e')],_0x30243f));_0x4fa550[_0x2d60('0x1c')](_0x2d60('0x9f')+_0xfece95+';');}BPromise[_0x2d60('0xa0')](_0x4fa550,handleQuery)[_0x2d60('0x1b')](function(_0x1b57a1){BPromise[_0x2d60('0x1d')]([handleAdditionalPhones()])[_0x2d60('0x1b')](function(){_0x4fa550=[];for(var _0x54d424=0x0;_0x54d424\x20\x20');}var _0x461948=path[_0x2d60('0x13')](config['root'],_0x2d60('0x75'),process['argv'][0x2]);if(!fs[_0x2d60('0xae')](_0x461948)){throw new Error(_0x2d60('0xaf'));}var _0x20a70b={};try{_0x20a70b=JSON[_0x2d60('0xb0')](process[_0x2d60('0xad')][0x3]);if(!_0x20a70b[_0x2d60('0xb1')]){throw new Error(_0x2d60('0xb2'));}if(!_0x20a70b[_0x2d60('0xb1')][_0x2d60('0x30')]){throw new Error('phone\x20is\x20mandatory');}if(!_0x20a70b['binding'][_0x2d60('0x8c')]){throw new Error(_0x2d60('0xb3'));}var _0x4e1532=0x0;if(_0x20a70b[_0x2d60('0xb1')][_0x2d60('0x36')]){_0x4e1532=0x1;}if(!_0x20a70b[_0x2d60('0x41')]){throw new Error(_0x2d60('0xb4'));}}catch(_0x19c321){throw new Error('body\x20id\x20mandatory');}var _0x1e0b94=[];try{_0x1e0b94=_[_0x2d60('0xb5')](JSON[_0x2d60('0xb0')](process['argv'][0x4]),'id');}catch(_0x42b501){logger[_0x2d60('0x58')](_0x2d60('0xb6'));}main(_0x461948,_0x20a70b,_0x1e0b94,_0x4e1532);}validate();process['on'](_0x2d60('0xb7'),handleStop);process['on'](_0x2d60('0xb8'),handleUncaughtException); \ No newline at end of file +var _0xc015=['trim','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','includes','agent\x20not\x20exists','email\x20wrong\x20format','YYYY-MM-DD','timezones','\x20not\x20specified','hasOwnProperty','itemTypeId','description','SystemRow','rows','contact:import:','abort','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','campaigns_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','dialTimezone,utcOffset','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','CompanyId',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','each','contactId','orderBy','voice_queues_has_cm_blacklists','VoiceQueueId','CampaignId','campaigns_has_cm_blacklists','campaigns_has_cm_lists','finish','affectedRows','emit','unlink','complete','argv','arguments\x20\x20\x20','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName','firstName\x20is\x20mandatory','body\x20id\x20mandatory','No\x20agent\x20available','SIGINT','path','lodash','papaparse','moment','squel','ioredis','../../../config/environment','../../../config/environment/shared','../../../config/logger','import','redis','defaults','localhost','format','YYYY-MM-DD\x20HH:mm:ss','field','phone','from','.id\x20=\x20','where','\x20=\x20','join','CmContact','findAll','AdditionalPhones','then','length','push','all','split','isNil','CmContactHasItem','update','PHONE','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.UserId','insert','fromQuery','scheduledat','ContactId','ListId','createdAt','updatedAt','priority','UserId','recallme','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_hopper','cm_contacts.phone\x20NOT\x20IN\x20(?)','toString','into','cm_hopper_black','ListId\x20=\x20?','date_add(cm_contacts.scheduledat,interval\x20','.offset-cm_contacts.utcOffset\x20minute)','cm_contacts.priority','select','\x22onlyIfOpen\x22','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?',')\x20NOT\x20IN\x20?','id\x20IN\x20?','MIN(id)','min_id','group','info','error','exit','errors','code','message','sequelize','query','spread','catch','campaigns.id','campaigns.dialTimezone','campaigns','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','campaigns_has_cm_lists.CmListId=','voice_queues.id','voice_queues.dialTimezone','voice_queues','voice_queues_has_cm_lists','dialTimezone','set','offset','stringify','send','start','binding','clone','root','server/files/tmp','.csv','keys','name','_description','header','parse','createReadStream','data','find'];(function(_0x44c38e,_0x467161){var _0x16b05b=function(_0x5717f0){while(--_0x5717f0){_0x44c38e['push'](_0x44c38e['shift']());}};_0x16b05b(++_0x467161);}(_0xc015,0xe6));var _0x5c01=function(_0xe6e78c,_0x582369){_0xe6e78c=_0xe6e78c-0x0;var _0x2a09c8=_0xc015[_0xe6e78c];return _0x2a09c8;};'use strict';var fs=require('fs');var path=require(_0x5c01('0x0'));var _=require(_0x5c01('0x1'));var Papa=require(_0x5c01('0x2'));var util=require('util');var BPromise=require('bluebird');var moment=require(_0x5c01('0x3'));var squel=require(_0x5c01('0x4'));var Redis=require(_0x5c01('0x5'));var db=require('../../../mysqldb')['db'];var config=require(_0x5c01('0x6'));var shared=require(_0x5c01('0x7'));var logger=require(_0x5c01('0x8'))(_0x5c01('0x9'));config[_0x5c01('0xa')]=_[_0x5c01('0xb')](config[_0x5c01('0xa')],{'host':_0x5c01('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5c01('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0x5c01('0xd')](_0x5c01('0xe'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0x5c01('0xd')](_0x5c01('0xe'));function isEmail(_0x3daf3e){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'](_0x3daf3e);}function selectNotIn(_0x2f02ee,_0xd1886d,_0x46b077,_0xe8d921,_0x4efedb){return squel['select']()[_0x5c01('0xf')](_0x5c01('0x10'))[_0x5c01('0x11')](_0xe8d921)['join'](_0xd1886d,null,_0xd1886d+_0x5c01('0x12')+_0xe8d921+'.'+_0x46b077)[_0x5c01('0x13')](_0xe8d921+'.'+_0x46b077+_0x5c01('0x14')+_0x2f02ee+'.'+_0x46b077)[_0x5c01('0x13')](_0xd1886d+'.dialCheckDuplicateType\x20IN\x20('+_0x4efedb[_0x5c01('0x15')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x1b534a,_0xb0711c){promisesAdditionalPhones=[];return db[_0x5c01('0x16')][_0x5c01('0x17')]({'raw':!![],'attributes':['id',_0x5c01('0x18')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0x5c01('0x19')](function(_0xc8b6b2){if(_0xc8b6b2!==null){var _0x77914=[];for(var _0xeac742=0x0;_0xeac742<_0xc8b6b2[_0x5c01('0x1a')];_0xeac742++){var _0x3e1a11=_0xc8b6b2[_0xeac742];_0x77914[_0x5c01('0x1b')](insertAdditionalPhones(_0x3e1a11));}}Promise[_0x5c01('0x1c')](_0x77914)[_0x5c01('0x19')](function(){_0x1b534a({'val':0x1});});});});}function insertAdditionalPhones(_0x293905){return new Promise(function(_0x21157a,_0x51926e){var _0x29369f=_0x293905[_0x5c01('0x18')];var _0x41c04d=_0x29369f[_0x5c01('0x1d')](';');var _0x2cb379=[];orderBy=0x0;for(var _0x442fa7=0x0;_0x442fa7<_0x41c04d[_0x5c01('0x1a')];_0x442fa7++){_0x2cb379[_0x5c01('0x1b')](splitAdditionalPhone(_0x293905['id'],_0x41c04d[_0x442fa7]));}Promise[_0x5c01('0x1c')](_0x2cb379)[_0x5c01('0x19')](function(){_0x21157a({'val':_0x41c04d[_0x5c01('0x1a')]});});});}function splitAdditionalPhone(_0x94ba1d,_0x526a50){return new Promise(function(_0x2408b6,_0x4c1ee4){var _0x38ebb6=_0x526a50[_0x5c01('0x1d')](':');var _0xebc5eb=_0x38ebb6[0x0];var _0x4607fe=_0x38ebb6[0x1];if(!_[_0x5c01('0x1e')](_0x4607fe)){var _0x43da18=_0x4607fe['split']('|');var _0x9c9457=[];for(var _0x2ea39c=0x0;_0x2ea39c<_0x43da18[_0x5c01('0x1a')];_0x2ea39c++){if(_0x43da18[_0x2ea39c]!==''){var _0x24e56e=_['filter'](promisesAdditionalPhones,{'contactId':_0x94ba1d,'phone':_0x43da18[_0x2ea39c]});if(_0x24e56e[_0x5c01('0x1a')]==0x0){orderBy++;promisesAdditionalPhones[_0x5c01('0x1b')]({'contactId':_0x94ba1d,'contactTypeId':_0xebc5eb,'phone':_0x43da18[_0x2ea39c],'orderBy':orderBy});}}}_0x2408b6({'ok':0x1});}else _0x2408b6({'res':0x0});});}function createAdditionalPhone(_0x5d852c,_0xbe890b,_0x4ac693,_0x3ee457){var _0x5e0228='';var _0x54a5c0='';var _0x291b83=_0x4ac693[_0x5c01('0x1d')]('§');_0x5e0228=_0x291b83[0x0];if(_0x291b83[_0x5c01('0x1a')]==0x2)_0x54a5c0=_0x291b83[0x1];return new Promise(function(_0x1984d7,_0x51343b){return db[_0x5c01('0x1f')]['findOne']({'where':{'CmContactId':_0x5d852c,'item':_0x5e0228}})[_0x5c01('0x19')](function(_0x206c8f){if(_0x206c8f){return db[_0x5c01('0x1f')][_0x5c01('0x20')]({'ItemTypeId':_0xbe890b,'description':_0x54a5c0,'OrderBy':_0x3ee457},{'where':{'CmContactId':_0x5d852c,'item':_0x5e0228}})[_0x5c01('0x19')](function(_0x504bae){_0x1984d7({'res':'updated'});});}else{return db[_0x5c01('0x1f')]['create']({'CmContactId':_0x5d852c,'item':_0x5e0228,'description':_0x54a5c0,'ItemTypeId':_0xbe890b,'OrderBy':_0x3ee457,'ItemClass':_0x5c01('0x21')})[_0x5c01('0x19')](function(_0x54868c){_0x1984d7({'res':'inserted'});});}});});}function insertCmHopper(_0x246d81,_0x18619c,_0x435fea,_0x527dec,_0x5b2a1b){var _0x482aeb=[_0x5c01('0x22'),_0x5c01('0x23'),_0x5c01('0x24'),_0x5c01('0x25'),_0x18619c+'.'+_0x527dec,_0x5c01('0x26'),_0x5c01('0x27'),'cm_contacts.priority',_0x5c01('0x28'),'\x22'+_0x5b2a1b+'\x22'];return squel[_0x5c01('0x29')]()['into']('cm_hopper')[_0x5c01('0x2a')](['phone',_0x5c01('0x2b'),_0x5c01('0x2c'),_0x5c01('0x2d'),_0x527dec,_0x5c01('0x2e'),_0x5c01('0x2f'),_0x5c01('0x30'),_0x5c01('0x31'),_0x5c01('0x32')],squel['select']()[_0x5c01('0x33')](_0x482aeb)[_0x5c01('0x11')](_0x18619c)['join'](_0x5c01('0x34'),null,_0x5c01('0x35')+_0x18619c+_0x5c01('0x36'))[_0x5c01('0x15')](_0x435fea,null,_0x435fea+_0x5c01('0x12')+_0x18619c+'.'+_0x527dec)[_0x5c01('0x13')](_0x18619c+_0x5c01('0x37'),_0x246d81)[_0x5c01('0x13')](_0x5c01('0x38'),NOW)[_0x5c01('0x13')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x18619c,_0x435fea,_0x527dec,_0x5c01('0x39'),['\x22always\x22','\x22onlyIfOpen\x22']))[_0x5c01('0x13')](_0x5c01('0x3a'),selectNotIn(_0x18619c,_0x435fea,_0x527dec,_0x5c01('0x39'),['\x22always\x22'])))[_0x5c01('0x3b')]();}function insertCmHopperBlack(_0x5ada36,_0x557b1e,_0x3a3d18,_0x3e5249){var _0x4a9fa7=[_0x5c01('0x22'),_0x5c01('0x24'),_0x5c01('0x25'),_0x557b1e+'.'+_0x3e5249,_0x5c01('0x26'),_0x5c01('0x27')];return squel[_0x5c01('0x29')]()[_0x5c01('0x3c')](_0x5c01('0x3d'))[_0x5c01('0x2a')]([_0x5c01('0x10'),_0x5c01('0x2c'),_0x5c01('0x2d'),_0x3e5249,_0x5c01('0x2e'),_0x5c01('0x2f')],squel['select']()[_0x5c01('0x33')](_0x4a9fa7)[_0x5c01('0x11')](_0x557b1e)[_0x5c01('0x15')](_0x5c01('0x34'),null,_0x5c01('0x35')+_0x557b1e+_0x5c01('0x36'))[_0x5c01('0x15')](_0x3a3d18,null,_0x3a3d18+_0x5c01('0x12')+_0x557b1e+'.'+_0x3e5249)[_0x5c01('0x13')](_0x557b1e+_0x5c01('0x37'),_0x5ada36)[_0x5c01('0x13')](_0x5c01('0x38'),NOW)[_0x5c01('0x13')](_0x5c01('0x3a'),squel['select']()['field']('phone')[_0x5c01('0x11')](_0x5c01('0x3d'))[_0x5c01('0x13')](_0x5c01('0x3e'),_0x5ada36)[_0x5c01('0x13')](_0x3e5249+_0x5c01('0x14')+_0x557b1e+'.'+_0x3e5249)))[_0x5c01('0x3b')]();}function insertTzCmHopper(_0x2797db,_0x11ef88,_0x2e60b7,_0x5bf857,_0x14048b,_0x3ae9d1){var _0x2a9152=[_0x5c01('0x22'),_0x5c01('0x3f')+_0x3ae9d1+_0x5c01('0x40'),_0x5c01('0x24'),_0x5c01('0x25'),_0x11ef88+'.'+_0x5bf857,'cm_contacts.createdAt',_0x5c01('0x27'),_0x5c01('0x41'),_0x5c01('0x28'),'\x22'+_0x14048b+'\x22'];var _0x303f6d=squel['insert']()[_0x5c01('0x3c')](_0x5c01('0x39'))[_0x5c01('0x2a')]([_0x5c01('0x10'),_0x5c01('0x2b'),_0x5c01('0x2c'),_0x5c01('0x2d'),_0x5bf857,_0x5c01('0x2e'),_0x5c01('0x2f'),_0x5c01('0x30'),_0x5c01('0x31'),'recallme'],squel[_0x5c01('0x42')]()[_0x5c01('0x33')](_0x2a9152)['from'](_0x11ef88)[_0x5c01('0x15')]('cm_contacts',null,_0x5c01('0x35')+_0x11ef88+_0x5c01('0x36'))['join'](_0x2e60b7,null,_0x2e60b7+_0x5c01('0x12')+_0x11ef88+'.'+_0x5bf857)[_0x5c01('0x15')](_0x3ae9d1,null,_0x3ae9d1+_0x5c01('0x12')+_0x11ef88+'.'+_0x5bf857)[_0x5c01('0x13')](_0x11ef88+_0x5c01('0x37'),_0x2797db)[_0x5c01('0x13')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x5c01('0x13')](_0x5c01('0x3a'),selectNotIn(_0x11ef88,_0x2e60b7,_0x5bf857,'cm_hopper',['\x22always\x22',_0x5c01('0x43')]))[_0x5c01('0x13')](_0x5c01('0x3a'),selectNotIn(_0x11ef88,_0x2e60b7,_0x5bf857,'cm_hopper',['\x22always\x22'])))['toString']();return _0x303f6d;}function insertTzCmHopperBlack(_0x5ad106,_0x45bfd1,_0x4418fb,_0x16c05c){var _0x2fd20a=[_0x5c01('0x22'),_0x5c01('0x24'),_0x5c01('0x25'),_0x45bfd1+'.'+_0x16c05c,_0x5c01('0x26'),_0x5c01('0x27')];return squel[_0x5c01('0x29')]()[_0x5c01('0x3c')](_0x5c01('0x3d'))[_0x5c01('0x2a')]([_0x5c01('0x10'),_0x5c01('0x2c'),_0x5c01('0x2d'),_0x16c05c,_0x5c01('0x2e'),_0x5c01('0x2f')],squel['select']()[_0x5c01('0x33')](_0x2fd20a)['from'](_0x45bfd1)[_0x5c01('0x15')](_0x5c01('0x34'),null,_0x5c01('0x35')+_0x45bfd1+'.CmListId')[_0x5c01('0x15')](_0x4418fb,null,_0x4418fb+_0x5c01('0x12')+_0x45bfd1+'.'+_0x16c05c)['where'](_0x45bfd1+_0x5c01('0x37'),_0x5ad106)[_0x5c01('0x13')](_0x5c01('0x38'),NOW)[_0x5c01('0x13')](_0x5c01('0x3a'),squel[_0x5c01('0x42')]()[_0x5c01('0xf')](_0x5c01('0x10'))[_0x5c01('0x11')](_0x5c01('0x3d'))[_0x5c01('0x13')]('ListId\x20=\x20?',_0x5ad106)[_0x5c01('0x13')](_0x16c05c+_0x5c01('0x14')+_0x45bfd1+'.'+_0x16c05c)))[_0x5c01('0x3b')]();}function insertCmHopperAdditionalPhones(_0x543d5f){var _0x4bc8d4=[_0x5c01('0x44'),_0x5c01('0x45'),_0x5c01('0x46'),_0x5c01('0x47'),_0x5c01('0x48')];return squel[_0x5c01('0x29')]()['into'](_0x5c01('0x49'))['fromQuery'](['CmHopperId',_0x5c01('0x10'),'OrderBy',_0x5c01('0x2e'),'updatedAt'],squel[_0x5c01('0x42')]()['fields'](_0x4bc8d4)[_0x5c01('0x11')](_0x5c01('0x39'))[_0x5c01('0x15')]('cm_contacts',null,_0x5c01('0x4a'))['join']('cm_contact_has_items',null,_0x5c01('0x4b'))['where'](_0x5c01('0x4c'),_0x543d5f)['where']('cm_contacts.createdAt\x20=\x20?',NOW))[_0x5c01('0x3b')]();}function insertCmContact(_0x26775f,_0x2dc027,_0x40c87d,_0x415651){var _0x34ecc5=_['concat'](_['keys'](_0x415651),[_0x5c01('0x2d'),'CompanyId','createdAt',_0x5c01('0x2f'),'scheduledAt']);return squel['insert']()[_0x5c01('0x3c')]('cm_contacts')[_0x5c01('0x2a')](_0x34ecc5,squel['select']()['fields'](_0x34ecc5)['from'](_0x2dc027)[_0x5c01('0x13')]('('+_0x40c87d[_0x5c01('0x15')](',')+_0x5c01('0x4d'),squel[_0x5c01('0x42')]()[_0x5c01('0x33')](_0x40c87d)['from'](_0x5c01('0x34'))[_0x5c01('0x13')](_0x5c01('0x3e'),_0x26775f)[_0x5c01('0x13')]('deletedAt\x20IS\x20NULL'))[_0x5c01('0x13')](_0x5c01('0x4e'),squel[_0x5c01('0x42')]()['field'](_0x5c01('0x4f'),_0x5c01('0x50'))[_0x5c01('0x11')](_0x2dc027)[_0x5c01('0x51')](_0x40c87d['join'](','))))['toString']();}function handleStop(){logger[_0x5c01('0x52')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x22851e){logger[_0x5c01('0x53')](_0x22851e['message']);process[_0x5c01('0x54')](0x1);}function handleError(_0x53b992,_0x368d09){stats[_0x5c01('0x55')][_0x5c01('0x1b')]({'name':_0x368d09[_0x5c01('0x56')],'message':_0x368d09[_0x5c01('0x57')],'row':_0x53b992});}function handleQuery(_0x58fc17){logger[_0x5c01('0x52')](_0x58fc17);return db[_0x5c01('0x58')][_0x5c01('0x59')](_0x58fc17)[_0x5c01('0x5a')](function(_0x34cb66){results[_0x5c01('0x1b')](_0x34cb66);})[_0x5c01('0x5b')](function(_0x467221){logger['error'](_0x467221[_0x5c01('0x57')]);});}function updateTzCampaigns(_0x27f1f9){return new Promise(function(_0x372b9d,_0x20bd64){var _0x30f821=squel[_0x5c01('0x42')]()[_0x5c01('0x33')]([_0x5c01('0x5c'),_0x5c01('0x5d')])[_0x5c01('0x11')](_0x5c01('0x5e'))[_0x5c01('0x15')]('campaigns_has_cm_lists',null,_0x5c01('0x5f'))['where'](_0x5c01('0x60')+_0x27f1f9);db[_0x5c01('0x58')][_0x5c01('0x59')](_0x30f821[_0x5c01('0x3b')]())['spread'](function(_0x480f11){var _0x25482d=[];for(var _0x163e24=0x0;_0x163e24<_0x480f11[_0x5c01('0x1a')];_0x163e24++){_0x25482d[_0x5c01('0x1b')](getTimezoneData(_0x480f11[_0x163e24],tmp_campaigns));}BPromise[_0x5c01('0x1c')](_0x25482d)['then'](function(){_0x372b9d({'val':0x1});});})[_0x5c01('0x5b')](function(_0x546b09){logger[_0x5c01('0x53')](_0x546b09['message']);_0x372b9d({'val':0x0});});});}function updateTzVoiceQueues(_0x4e6ca7){return new Promise(function(_0x5b9748,_0x16b31f){var _0x390f24=squel['select']()[_0x5c01('0x33')]([_0x5c01('0x61'),_0x5c01('0x62')])[_0x5c01('0x11')](_0x5c01('0x63'))[_0x5c01('0x15')](_0x5c01('0x64'),null,'voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId')[_0x5c01('0x13')]('voice_queues_has_cm_lists.CmListId='+_0x4e6ca7);db[_0x5c01('0x58')][_0x5c01('0x59')](_0x390f24[_0x5c01('0x3b')]())[_0x5c01('0x5a')](function(_0x584773){var _0x24a683=[];for(var _0x6ad4df=0x0;_0x6ad4df<_0x584773['length'];_0x6ad4df++){_0x24a683[_0x5c01('0x1b')](getTimezoneData(_0x584773[_0x6ad4df],tmp_voice_queues));}BPromise[_0x5c01('0x1c')](_0x24a683)[_0x5c01('0x19')](function(){_0x5b9748({'val':0x1});});})[_0x5c01('0x5b')](function(_0x2afe22){logger[_0x5c01('0x53')](_0x2afe22[_0x5c01('0x57')]);_0x5b9748({'val':0x0});});});}function getTimezoneData(_0x5d8b30,_0x5997af){return new Promise(function(_0x13f8f1,_0xce9cf8){var _0x25a5ac=shared['timezones'];var _0x283534=_0x25a5ac[_0x5d8b30[_0x5c01('0x65')]];if(_[_0x5c01('0x1e')](_0x283534)){_0x13f8f1({'ret':0x1});}else{var _0x137d4c=_0x283534['utcOffset'];var _0x5445ce=squel[_0x5c01('0x29')]()[_0x5c01('0x3c')](_0x5997af)[_0x5c01('0x66')]('id',_0x5d8b30['id'])['set'](_0x5c01('0x67'),_0x137d4c)['set'](_0x5c01('0x65'),_0x5d8b30[_0x5c01('0x65')])[_0x5c01('0x3b')]();return db[_0x5c01('0x58')][_0x5c01('0x59')](_0x5445ce)['spread'](function(_0x57530e){_0x13f8f1({'ret':0x1});})['catch'](function(_0x2bc2cc){logger[_0x5c01('0x53')](_0x2bc2cc[_0x5c01('0x57')]);_0xce9cf8({'ret':0x1});});}});}function handleTZQuery(_0x139a72){logger[_0x5c01('0x52')](_0x139a72);return db['sequelize'][_0x5c01('0x59')](_0x139a72)[_0x5c01('0x5a')](function(_0x4069c3){})[_0x5c01('0x5b')](function(_0x4b76f4){logger[_0x5c01('0x53')](_0x4b76f4[_0x5c01('0x57')]);});}function main(_0x26e881,_0x1edc46,_0x3fa8ed,_0x1932f6){logger[_0x5c01('0x52')]('main',_0x26e881,JSON[_0x5c01('0x68')](_0x1edc46));process[_0x5c01('0x69')](_0x5c01('0x6a'));var _0x5edcd8=_0x1edc46[_0x5c01('0x6b')];var _0x47cc7e=_[_0x5c01('0x6c')](_0x5edcd8);var _0x511b0f=_0x1edc46['socket_timestamp'];var _0x15e2a5=path[_0x5c01('0x15')](config[_0x5c01('0x6d')],_0x5c01('0x6e'),_0x511b0f+_0x5c01('0x6f'));hasTZ=_[_0x5c01('0x70')](_0x5edcd8)['includes']('dialTimezone');var _0x20583b=_['keys'](_0x5edcd8)[_0x5c01('0x15')]();logger[_0x5c01('0x52')]('header',_0x20583b);db['ContactItemType'][_0x5c01('0x17')]({'raw':!![],'attributes':['id',_0x5c01('0x71')]})[_0x5c01('0x19')](function(_0x399c8b){for(var _0x233d32=0x0;_0x233d32<_0x399c8b[_0x5c01('0x1a')];_0x233d32++){if(_0x399c8b[_0x233d32][_0x5c01('0x71')]in _0x5edcd8){contactItemTypes[_0x5c01('0x1b')](_0x399c8b[_0x233d32]);delete _0x47cc7e[_0x399c8b[_0x233d32][_0x5c01('0x71')]];hasAdditionalPhones=!![];}for(var _0xb301d3 in _0x5edcd8){if(_0x399c8b[_0x233d32][_0x5c01('0x71')]+_0x5c01('0x72')===_0xb301d3){phoneDescriptions[_0x5c01('0x1b')]({'itemTypeId':_0x399c8b[_0x233d32]['id'],'description':_0xb301d3});delete _0x47cc7e[_0xb301d3];}}}if(hasAdditionalPhones)_0x47cc7e[_0x5c01('0x18')]='';var _0x5900de=_[_0x5c01('0x70')](_0x47cc7e)[_0x5c01('0x15')]();logger[_0x5c01('0x52')](_0x5c01('0x73'),_0x5900de);fs['writeFileSync'](_0x15e2a5,_0x5900de+'\x0a');Papa[_0x5c01('0x74')](fs[_0x5c01('0x75')](_0x26e881),{'header':!![],'skipEmptyLines':!![],'step':function(_0x182fe9,_0x2ca6b6){try{for(var _0x1f4613=0x0,_0x47207e=[];_0x1f4613<_0x182fe9[_0x5c01('0x76')][_0x5c01('0x1a')];_0x1f4613++){stats['rows']+=0x1;if(_0x182fe9['errors'][_0x1f4613]){handleError(_0x182fe9[_0x5c01('0x76')][_0x1f4613],_0x182fe9[_0x5c01('0x55')][_0x1f4613]);}else{var _0x1e690c=[];var _0x5c2b8e=[];var _0x429545={};for(var _0x36b510 in _0x5edcd8){let _0x31ae83=contactItemTypes[_0x5c01('0x77')](_0x1cf171=>_0x1cf171[_0x5c01('0x71')]===_0x36b510);let _0x19fc60=contactItemTypes[_0x5c01('0x77')](_0x5e72d5=>_0x5e72d5['name']+'_description'===_0x36b510);if(_[_0x5c01('0x1e')](_0x31ae83)&&_[_0x5c01('0x1e')](_0x19fc60)){if(_0x5edcd8['hasOwnProperty'](_0x36b510)){if(_0x182fe9[_0x5c01('0x76')][_0x1f4613][_0x5edcd8[_0x36b510]]){var _0x58ee2c=_[_0x5c01('0x78')](_0x182fe9[_0x5c01('0x76')][_0x1f4613][_0x5edcd8[_0x36b510]][_0x5c01('0x79')](/"/g,'\x27'));switch(_0x36b510){case _0x5c01('0x2b'):var _0x34d87e=moment(_0x58ee2c,_0x5c01('0xe'),!![]);if(_0x34d87e[_0x5c01('0x7a')]()){_0x47207e[_0x5c01('0x1b')]('\x22'+_0x58ee2c+'\x22');}else{_0x1e690c['push'](_0x5c01('0x7b'));}break;case'priority':var _0x376fe0=parseInt(_0x58ee2c);_0x58ee2c=_[_0x5c01('0x7c')](_0x376fe0)||_0x376fe0<0x0||_0x376fe0>0x4?_0x1932f6?0x3:0x2:_0x376fe0;_0x47207e[_0x5c01('0x1b')]('\x22'+_0x58ee2c+'\x22');break;case _0x5c01('0x31'):var _0xa782ad=parseInt(_0x58ee2c);if(_[_0x5c01('0x7d')](_0xa782ad)&&_[_0x5c01('0x7e')](_0x3fa8ed,_0xa782ad)){_0x47207e['push']('\x22'+_0xa782ad+'\x22');}else{_0x1e690c[_0x5c01('0x1b')](_0x5c01('0x7f'));}break;case'email':if(isEmail(_0x58ee2c)){_0x47207e[_0x5c01('0x1b')]('\x22'+_0x58ee2c+'\x22');}else{_0x1e690c[_0x5c01('0x1b')](_0x5c01('0x80'));}break;case'dateOfBirth':var _0x6f5ac2=moment(_0x58ee2c,_0x5c01('0x81'),!![]);if(_0x6f5ac2[_0x5c01('0x7a')]()){_0x47207e[_0x5c01('0x1b')]('\x22'+_0x58ee2c+'\x22');}else{_0x1e690c[_0x5c01('0x1b')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;case _0x5c01('0x65'):var _0x2165d0=shared[_0x5c01('0x82')];var _0x1d470b=_0x2165d0[_0x58ee2c];if(!_[_0x5c01('0x1e')](_0x1d470b)){var _0xb9f1b9=_0x1d470b['utcOffset'];_0x47207e['push']('\x22'+_0x58ee2c+'\x22');_0x47207e[_0x5c01('0x1b')]('\x22'+_0xb9f1b9+'\x22');}break;default:_0x47207e[_0x5c01('0x1b')]('\x22'+_0x58ee2c+'\x22');}}else{switch(_0x36b510){case'firstName':case'phone':_0x1e690c[_0x5c01('0x1b')](_0x36b510+_0x5c01('0x83'));break;default:_0x47207e['push']('\x22\x22');}}}}else{var _0x46351f='';if(!_[_0x5c01('0x1e')](_0x31ae83)){if(!_0x429545[_0x5c01('0x84')](_0x31ae83['id'])){if(!_[_0x5c01('0x1e')](_0x182fe9[_0x5c01('0x76')][_0x1f4613][_0x5edcd8[_0x36b510]])){var _0x58ee2c=_[_0x5c01('0x78')](_0x182fe9[_0x5c01('0x76')][_0x1f4613][_0x5edcd8[_0x36b510]][_0x5c01('0x79')](/"/g,'\x27'));var _0x4120d5=phoneDescriptions[_0x5c01('0x77')](_0x3c5b60=>_0x3c5b60[_0x5c01('0x85')]===_0x31ae83['id']);if(!_[_0x5c01('0x1e')](_0x4120d5)){var _0x1e323e=_['trim'](_0x182fe9['data'][_0x1f4613][_0x5edcd8[_0x4120d5[_0x5c01('0x86')]]][_0x5c01('0x79')](/"/g,'\x27'));if(!_[_0x5c01('0x1e')](_0x1e323e))_0x58ee2c=_0x58ee2c+'§'+_0x1e323e;}if(_0x46351f=='')_0x46351f=_0x58ee2c;else _0x46351f+='|'+_0x58ee2c;}_0x5c2b8e['push'](_0x31ae83['id']+':'+_0x46351f);_0x429545[_0x31ae83['id']]=0x1;}}}}if(hasAdditionalPhones){_0x47207e['push']('\x22'+_0x5c2b8e[_0x5c01('0x15')](';')+'\x22');}if(_0x1e690c[_0x5c01('0x1a')]){handleError(_0x182fe9['data'][_0x1f4613],{'code':_0x5c01('0x87'),'message':_0x1e690c['join']()});}else{fs['appendFileSync'](_0x15e2a5,_0x47207e[_0x5c01('0x15')]()+'\x0a');}_0x47207e=[];}if(!(stats[_0x5c01('0x88')]%0xc8)){socket['emit'](_0x5c01('0x89')+_0x511b0f,stats);stats[_0x5c01('0x55')]=[];}}if(stopped){logger[_0x5c01('0x52')]('Abort\x20parser');_0x2ca6b6[_0x5c01('0x8a')]();}}catch(_0x576a42){handleError(_0x182fe9[_0x5c01('0x76')][_0x1f4613],{'code':_0x5c01('0x8b'),'message':_0x576a42[_0x5c01('0x57')]});logger['error'](_0x5c01('0x8c'),_0x576a42[_0x5c01('0x57')]);}},'complete':function(){try{var _0x1b9e20=[];var _0x251b5e=[];var _0x23afba=_0x5c01('0x34');if(_0x1edc46[_0x5c01('0x8d')]&&_0x1edc46[_0x5c01('0x8d')][_0x5c01('0x1a')]){_0x23afba=_0x5c01('0x8e')+_0x511b0f;_0x1b9e20[_0x5c01('0x1b')](_0x5c01('0x8f')+_0x23afba+'\x20LIKE\x20cm_contacts;');}tmp_campaigns=_0x5c01('0x90')+_0x511b0f;tmp_voice_queues='voice_queues_'+_0x511b0f;_0x251b5e[_0x5c01('0x1b')]('CREATE\x20TABLE\x20'+tmp_campaigns+_0x5c01('0x91'));_0x251b5e[_0x5c01('0x1b')](_0x5c01('0x8f')+tmp_voice_queues+_0x5c01('0x91'));BPromise['each'](_0x251b5e,handleTZQuery)[_0x5c01('0x19')](function(_0x4af42f){updateTzCampaigns(_0x1edc46[_0x5c01('0x2d')])[_0x5c01('0x19')](function(_0x5d66d3){updateTzVoiceQueues(_0x1edc46[_0x5c01('0x2d')])[_0x5c01('0x19')](function(_0x23f1e5){if(hasTZ)_0x5900de=_0x5900de[_0x5c01('0x79')]('dialTimezone',_0x5c01('0x92'));var _0x3c8ccb=util[_0x5c01('0xd')](_0x5c01('0x93'),_0x15e2a5,_0x23afba,_0x5900de,_0x1edc46[_0x5c01('0x2d')],_0x1edc46[_0x5c01('0x94')]||null,NOW,NOW);if(_[_0x5c01('0x1e')](_0x5edcd8[_0x5c01('0x2b')])){_0x3c8ccb+=_0x5c01('0x95');}_0x1b9e20[_0x5c01('0x1b')](_0x3c8ccb);if(_0x1edc46[_0x5c01('0x8d')]&&_0x1edc46[_0x5c01('0x8d')][_0x5c01('0x1a')]){_0x1b9e20[_0x5c01('0x1b')](insertCmContact(_0x1edc46[_0x5c01('0x2d')],_0x23afba,_0x1edc46[_0x5c01('0x8d')],_0x5edcd8));_0x1b9e20[_0x5c01('0x1b')](_0x5c01('0x96')+_0x23afba+';');}BPromise[_0x5c01('0x97')](_0x1b9e20,handleQuery)[_0x5c01('0x19')](function(_0x259a20){BPromise['all']([handleAdditionalPhones()])[_0x5c01('0x19')](function(){_0x1b9e20=[];for(var _0x27309f=0x0;_0x27309f\x20\x20','server/files/tmp','file\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','uncaughtException','papaparse','util','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','import','defaults','redis','localhost','socket.io-emitter','format','cm_contacts_temp_','field','from','join','.id\x20=\x20','where','\x20=\x20','sequelize','query','select\x20*\x20from\x20','spread','phone','isNil','AdditionalPhones','then','catch','message','split','push','all','length','CmContactHasItem','update','updated','create','PHONE','inserted','CmHopper','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','ContactId','ListId','createdAt','updatedAt','priority','recallme','select','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_contacts.updatedAt','cm_hopper_black','cm_contacts.createdAt\x20=\x20?','ListId\x20=\x20?','\x20=\x20?','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.updatedAt','CmHopperId','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','MIN(id)','min_id','info','error','errors','stringify','send','start','binding','socket_timestamp','root','.csv','ContactItemType','findAll','name','header','writeFileSync'];(function(_0x36a80e,_0x125922){var _0x1d8a8c=function(_0xcbda8d){while(--_0xcbda8d){_0x36a80e['push'](_0x36a80e['shift']());}};_0x1d8a8c(++_0x125922);}(_0xb982,0x15e));var _0x2b98=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb982[_0x20a584];return _0x4b41a8;};'use strict';var fs=require('fs');var path=require('path');var _=require('lodash');var Papa=require(_0x2b98('0x0'));var util=require(_0x2b98('0x1'));var BPromise=require(_0x2b98('0x2'));var moment=require(_0x2b98('0x3'));var squel=require(_0x2b98('0x4'));var Redis=require(_0x2b98('0x5'));var db=require(_0x2b98('0x6'))['db'];var config=require(_0x2b98('0x7'));var logger=require(_0x2b98('0x8'))(_0x2b98('0x9'));config['redis']=_[_0x2b98('0xa')](config[_0x2b98('0xb')],{'host':_0x2b98('0xc'),'port':0x18eb});var socket=require(_0x2b98('0xd'))(new Redis(config[_0x2b98('0xb')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var promisesContact=[];var orderBy=0x0;var updatedRows=0x0;var stopped=![];var NOW=moment()[_0x2b98('0xe')]('YYYY-MM-DD\x20HH:mm:ss');var tempTableName=_0x2b98('0xf')+moment()[_0x2b98('0xe')]('YYYYMMDDHHmmss');var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x8e30c5){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'](_0x8e30c5);}function selectNotIn(_0x3f8ef6,_0x17d985,_0x457b35,_0x200725,_0xbb4274){return squel['select']()[_0x2b98('0x10')]('phone')[_0x2b98('0x11')](_0x200725)[_0x2b98('0x12')](_0x17d985,null,_0x17d985+_0x2b98('0x13')+_0x200725+'.'+_0x457b35)[_0x2b98('0x14')](_0x200725+'.'+_0x457b35+_0x2b98('0x15')+_0x3f8ef6+'.'+_0x457b35)[_0x2b98('0x14')](_0x17d985+'.dialCheckDuplicateType\x20IN\x20('+_0xbb4274[_0x2b98('0x12')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x268fc3,_0x13d46d){promisesAdditionalPhones=[];promisesContact=[];return db[_0x2b98('0x16')][_0x2b98('0x17')](_0x2b98('0x18')+tempTableName)[_0x2b98('0x19')](function(_0x4eab53){if(_0x4eab53!==null){var _0xc2478a=[];for(var _0x27fb07=0x0;_0x27fb07<_0x4eab53['length'];_0x27fb07++){var _0x33614e=_0x4eab53[_0x27fb07];if(!_['isNil'](_0x33614e[_0x2b98('0x1a')])){if(!_[_0x2b98('0x1b')](_0x33614e[_0x2b98('0x1c')]))_0xc2478a['push'](insertAdditionalPhones(_0x33614e));promisesContact['push']({'contact':_0x33614e});}}}Promise['all'](_0xc2478a)[_0x2b98('0x1d')](function(){_0x268fc3({'val':0x1});});})[_0x2b98('0x1e')](function(_0x58a1f3){logger['error'](_0x58a1f3[_0x2b98('0x1f')]);});});}function insertAdditionalPhones(_0x15c747){return new Promise(function(_0x41c7de,_0x5b75de){var _0x1878f4=_0x15c747[_0x2b98('0x1c')];if(_[_0x2b98('0x1b')](_0x1878f4))_0x5b75de({'val':0x0});else{var _0x280caa=_0x1878f4[_0x2b98('0x20')](';');var _0x349a8d=[];orderBy=0x0;for(var _0x51db51=0x0;_0x51db51<_0x280caa['length'];_0x51db51++){_0x349a8d[_0x2b98('0x21')](splitAdditionalPhone(_0x15c747['id'],_0x280caa[_0x51db51]));}Promise[_0x2b98('0x22')](_0x349a8d)[_0x2b98('0x1d')](function(){_0x41c7de({'val':_0x280caa[_0x2b98('0x23')]});});}});}function splitAdditionalPhone(_0x3bdfa3,_0x404a3c){return new Promise(function(_0x274c1a,_0x4981ba){var _0x40c613=_0x404a3c[_0x2b98('0x20')](':');var _0x154f06=_0x40c613[0x0];var _0x112d71=_0x40c613[0x1];if(_0x112d71!==''){var _0x28e79a=_0x112d71['split']('|');var _0xccda69=[];for(var _0x54b0c3=0x0;_0x54b0c3<_0x28e79a['length'];_0x54b0c3++){if(_0x28e79a[_0x54b0c3]!==''){var _0x27811d=_['filter'](promisesAdditionalPhones,{'contactId':_0x3bdfa3,'phone':_0x28e79a[_0x54b0c3]});if(_0x27811d[_0x2b98('0x23')]==0x0){orderBy++;promisesAdditionalPhones[_0x2b98('0x21')]({'contactId':_0x3bdfa3,'contactTypeId':_0x154f06,'phone':_0x28e79a[_0x54b0c3],'orderBy':orderBy});}}}_0x274c1a({'ok':0x1});}else _0x274c1a({'res':0x0});});}function createAdditionalPhone(_0x17b7db,_0x596c25,_0x5467a4,_0x3e506f){var _0x2769a7='';var _0x2208b1='';var _0x8cf049=_0x5467a4['split']('§');_0x2769a7=_0x8cf049[0x0];if(_0x8cf049['length']==0x2)_0x2208b1=_0x8cf049[0x1];return new Promise(function(_0x268786,_0x4a40fc){return db[_0x2b98('0x24')]['findOne']({'where':{'CmContactId':_0x17b7db,'item':_0x2769a7}})['then'](function(_0x3962ce){if(_0x3962ce){return db[_0x2b98('0x24')][_0x2b98('0x25')]({'ItemTypeId':_0x596c25,'description':_0x2208b1,'OrderBy':_0x3e506f},{'where':{'CmContactId':_0x17b7db,'item':_0x2769a7}})[_0x2b98('0x1d')](function(_0x4fef06){_0x268786({'res':_0x2b98('0x26')});});}else{return db[_0x2b98('0x24')][_0x2b98('0x27')]({'CmContactId':_0x17b7db,'item':_0x2769a7,'ItemTypeId':_0x596c25,'description':_0x2208b1,'OrderBy':_0x3e506f,'ItemClass':_0x2b98('0x28')})[_0x2b98('0x1d')](function(_0x1d4b95){_0x268786({'res':_0x2b98('0x29')});});}});});}function updateContact(_0x9409e7){return new Promise(function(_0x2eaa8e,_0x350f52){var _0x1d9d07=_0x9409e7['id'];delete _0x9409e7['id'];return db['CmContact'][_0x2b98('0x25')](_0x9409e7,{'where':{'id':_0x1d9d07}})['then'](function(_0x3e38d0){updatedRows+=0x1;return db[_0x2b98('0x2a')][_0x2b98('0x25')]({'phone':_0x9409e7[_0x2b98('0x1a')]},{'where':{'ContactId':_0x1d9d07}})[_0x2b98('0x1d')](function(_0x1d0255){_0x2eaa8e({'ret':'OK'});});});});}function insertCmHopper(_0x5af738,_0x35b0cc,_0x5bc473,_0x3f75aa,_0x2cdb9e){var _0x403a96=[_0x2b98('0x2b'),_0x2b98('0x2c'),_0x2b98('0x2d'),_0x2b98('0x2e'),_0x35b0cc+'.'+_0x3f75aa,_0x2b98('0x2f'),'cm_contacts.updatedAt','cm_contacts.priority',_0x2b98('0x30'),'\x22'+_0x2cdb9e+'\x22'];return squel[_0x2b98('0x31')]()[_0x2b98('0x32')](_0x2b98('0x33'))[_0x2b98('0x34')]([_0x2b98('0x1a'),'scheduledat',_0x2b98('0x35'),_0x2b98('0x36'),_0x3f75aa,_0x2b98('0x37'),_0x2b98('0x38'),_0x2b98('0x39'),'UserId',_0x2b98('0x3a')],squel[_0x2b98('0x3b')]()[_0x2b98('0x3c')](_0x403a96)['from'](_0x35b0cc)[_0x2b98('0x12')](_0x2b98('0x3d'),null,_0x2b98('0x3e')+_0x35b0cc+_0x2b98('0x3f'))['join'](_0x5bc473,null,_0x5bc473+_0x2b98('0x13')+_0x35b0cc+'.'+_0x3f75aa)['where'](_0x35b0cc+_0x2b98('0x40'),_0x5af738)[_0x2b98('0x14')]('cm_contacts.createdAt\x20=\x20?',NOW)['where'](_0x2b98('0x41'),selectNotIn(_0x35b0cc,_0x5bc473,_0x3f75aa,_0x2b98('0x33'),[_0x2b98('0x42'),_0x2b98('0x43')]))[_0x2b98('0x14')](_0x2b98('0x41'),selectNotIn(_0x35b0cc,_0x5bc473,_0x3f75aa,_0x2b98('0x33'),['\x22always\x22'])))[_0x2b98('0x44')]();}function insertCmHopperBlack(_0x1d0277,_0x569fc4,_0x511ea2,_0xf68abc){var _0x1a4031=['cm_contacts.phone',_0x2b98('0x2d'),_0x2b98('0x2e'),_0x569fc4+'.'+_0xf68abc,_0x2b98('0x2f'),_0x2b98('0x45')];return squel['insert']()[_0x2b98('0x32')](_0x2b98('0x46'))[_0x2b98('0x34')]([_0x2b98('0x1a'),_0x2b98('0x35'),_0x2b98('0x36'),_0xf68abc,_0x2b98('0x37'),'updatedAt'],squel[_0x2b98('0x3b')]()[_0x2b98('0x3c')](_0x1a4031)['from'](_0x569fc4)[_0x2b98('0x12')](_0x2b98('0x3d'),null,'cm_contacts.ListId\x20=\x20'+_0x569fc4+_0x2b98('0x3f'))['join'](_0x511ea2,null,_0x511ea2+'.id\x20=\x20'+_0x569fc4+'.'+_0xf68abc)[_0x2b98('0x14')](_0x569fc4+_0x2b98('0x40'),_0x1d0277)[_0x2b98('0x14')](_0x2b98('0x47'),NOW)['where'](_0x2b98('0x41'),squel['select']()[_0x2b98('0x10')](_0x2b98('0x1a'))[_0x2b98('0x11')](_0x2b98('0x46'))[_0x2b98('0x14')](_0x2b98('0x48'),_0x1d0277)[_0x2b98('0x14')](_0xf68abc+_0x2b98('0x49'),_0x569fc4+'.'+_0xf68abc)))[_0x2b98('0x44')]();}function insertCmHopperAdditionalPhones(_0x9d4c9e){var _0x443b38=[_0x2b98('0x4a'),_0x2b98('0x4b'),'cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt',_0x2b98('0x4c')];return squel[_0x2b98('0x31')]()[_0x2b98('0x32')]('cm_hopper_additional_phones')[_0x2b98('0x34')]([_0x2b98('0x4d'),_0x2b98('0x1a'),_0x2b98('0x4e'),_0x2b98('0x37'),_0x2b98('0x38')],squel['select']()['fields'](_0x443b38)[_0x2b98('0x11')](_0x2b98('0x33'))[_0x2b98('0x12')](_0x2b98('0x3d'),null,_0x2b98('0x4f'))['join'](_0x2b98('0x50'),null,_0x2b98('0x51'))[_0x2b98('0x14')](_0x2b98('0x52'),_0x9d4c9e)[_0x2b98('0x14')](_0x2b98('0x47'),NOW))[_0x2b98('0x44')]();}function insertCmContact(_0x4a0fa7,_0x4d1cfa,_0x13f7b3,_0x5e9b51){var _0x391dea=_['concat'](_['keys'](_0x5e9b51),['ListId','CompanyId',_0x2b98('0x37'),_0x2b98('0x38')]);return squel[_0x2b98('0x31')]()['into']('cm_contacts')[_0x2b98('0x34')](_0x391dea,squel[_0x2b98('0x3b')]()[_0x2b98('0x3c')](_0x391dea)[_0x2b98('0x11')](_0x4d1cfa)[_0x2b98('0x14')]('('+_0x13f7b3['join'](',')+')\x20NOT\x20IN\x20?',squel[_0x2b98('0x3b')]()[_0x2b98('0x3c')](_0x13f7b3)['from'](_0x2b98('0x3d'))[_0x2b98('0x14')](_0x2b98('0x48'),_0x4a0fa7))[_0x2b98('0x14')]('id\x20IN\x20?',squel[_0x2b98('0x3b')]()[_0x2b98('0x10')](_0x2b98('0x53'),_0x2b98('0x54'))[_0x2b98('0x11')](_0x4d1cfa)['group'](_0x13f7b3[_0x2b98('0x12')](','))))[_0x2b98('0x44')]();}function handleStop(){logger[_0x2b98('0x55')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x40fe74){logger[_0x2b98('0x56')](_0x40fe74['message']);process['exit'](0x1);}function handleError(_0x4270eb,_0x4d5644){stats[_0x2b98('0x57')][_0x2b98('0x21')]({'name':_0x4d5644['code'],'message':_0x4d5644[_0x2b98('0x1f')],'row':_0x4270eb});}function handleQuery(_0x26798b){logger[_0x2b98('0x55')](_0x26798b);return db[_0x2b98('0x16')]['query'](_0x26798b)['spread'](function(_0x4f884d){results[_0x2b98('0x21')](_0x4f884d);})['catch'](function(_0x25de95){logger['error'](_0x25de95[_0x2b98('0x1f')]);});}function main(_0x2440c9,_0x228822,_0x23fbdd,_0x36abfa){logger[_0x2b98('0x55')]('main',_0x2440c9,JSON[_0x2b98('0x58')](_0x228822));process[_0x2b98('0x59')](_0x2b98('0x5a'));var _0xbc251f=_0x228822[_0x2b98('0x5b')];var _0x236a4d=_['clone'](_0xbc251f);var _0x31319d=_0x228822[_0x2b98('0x5c')];var _0x147b72=path['join'](config[_0x2b98('0x5d')],'server/files/tmp',_0x31319d+_0x2b98('0x5e'));logger['info']('body',_0x228822);db[_0x2b98('0x5f')][_0x2b98('0x60')]({'raw':!![],'attributes':['id',_0x2b98('0x61')]})[_0x2b98('0x1d')](function(_0x3eb3e4){for(var _0x24225e=0x0;_0x24225e<_0x3eb3e4[_0x2b98('0x23')];_0x24225e++){if(_0x3eb3e4[_0x24225e]['name']in _0xbc251f){contactItemTypes[_0x2b98('0x21')](_0x3eb3e4[_0x24225e]);delete _0x236a4d[_0x3eb3e4[_0x24225e][_0x2b98('0x61')]];hasAdditionalPhones=!![];}for(var _0x25679c in _0xbc251f){if(_0x3eb3e4[_0x24225e][_0x2b98('0x61')]+'_description'===_0x25679c){phoneDescriptions['push']({'itemTypeId':_0x3eb3e4[_0x24225e]['id'],'description':_0x25679c});delete _0x236a4d[_0x25679c];}}}if(hasAdditionalPhones)_0x236a4d[_0x2b98('0x1c')]='';var _0x25e97c=_['keys'](_0x236a4d)['join']();logger[_0x2b98('0x55')](_0x2b98('0x62'),_0x25e97c);fs[_0x2b98('0x63')](_0x147b72,_0x25e97c+'\x0a');Papa[_0x2b98('0x64')](fs[_0x2b98('0x65')](_0x2440c9),{'header':!![],'skipEmptyLines':!![],'step':function(_0x3feea,_0x3ea623){try{for(var _0x1e04e9=0x0,_0x45a8ee=[];_0x1e04e9<_0x3feea['data'][_0x2b98('0x23')];_0x1e04e9++){stats['rows']+=0x1;if(_0x3feea[_0x2b98('0x57')][_0x1e04e9]){handleError(_0x3feea[_0x2b98('0x66')][_0x1e04e9],_0x3feea[_0x2b98('0x57')][_0x1e04e9]);}else{var _0x30f140=[];var _0x5461a8=[];var _0x55b229={};for(var _0x42e5da in _0xbc251f){let _0x47810f=contactItemTypes[_0x2b98('0x67')](_0x2103c2=>_0x2103c2[_0x2b98('0x61')]===_0x42e5da);let _0x50b85f=contactItemTypes[_0x2b98('0x67')](_0x36beec=>_0x36beec[_0x2b98('0x61')]+'_description'===_0x42e5da);if(_['isNil'](_0x47810f)&&_['isNil'](_0x50b85f)){if(_0xbc251f['hasOwnProperty'](_0x42e5da)){if(_0x3feea['data'][_0x1e04e9][_0xbc251f[_0x42e5da]]){var _0x5abfa7=_[_0x2b98('0x68')](_0x3feea['data'][_0x1e04e9][_0xbc251f[_0x42e5da]][_0x2b98('0x69')](/"/g,'\x27'));switch(_0x42e5da){case _0x2b98('0x6a'):var _0x108d61=moment(_0x5abfa7,_0x2b98('0x6b'),!![]);if(_0x108d61[_0x2b98('0x6c')]()){_0x45a8ee[_0x2b98('0x21')]('\x22'+_0x5abfa7+'\x22');}else{_0x30f140['push']('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0x2b98('0x39'):var _0x11474f=parseInt(_0x5abfa7);_0x5abfa7=_[_0x2b98('0x6d')](_0x11474f)||_0x11474f<0x0||_0x11474f>0x4?_0x36abfa?0x3:0x2:_0x11474f;_0x45a8ee[_0x2b98('0x21')]('\x22'+_0x5abfa7+'\x22');break;case _0x2b98('0x6e'):var _0x466137=parseInt(_0x5abfa7);if(_[_0x2b98('0x6f')](_0x466137)&&_['includes'](_0x23fbdd,_0x466137)){_0x45a8ee[_0x2b98('0x21')]('\x22'+_0x466137+'\x22');}else{_0x30f140[_0x2b98('0x21')](_0x2b98('0x70'));}break;case _0x2b98('0x71'):if(isEmail(_0x5abfa7)){_0x45a8ee[_0x2b98('0x21')]('\x22'+_0x5abfa7+'\x22');}else{_0x30f140[_0x2b98('0x21')](_0x2b98('0x72'));}break;case _0x2b98('0x73'):var _0x3f2701=moment(_0x5abfa7,_0x2b98('0x74'),!![]);if(_0x3f2701[_0x2b98('0x6c')]()){_0x45a8ee['push']('\x22'+_0x5abfa7+'\x22');}else{_0x30f140[_0x2b98('0x21')](_0x2b98('0x75'));}break;default:_0x45a8ee[_0x2b98('0x21')]('\x22'+_0x5abfa7+'\x22');}}else{switch(_0x42e5da){case _0x2b98('0x76'):case _0x2b98('0x1a'):_0x30f140['push'](_0x42e5da+_0x2b98('0x77'));break;default:_0x45a8ee[_0x2b98('0x21')]('\x22\x22');}}}}else{var _0x217edb='';if(!_[_0x2b98('0x1b')](_0x47810f)){if(!_0x55b229[_0x2b98('0x78')](_0x47810f['id'])){for(var _0x3ad411=0x0;_0x3ad411<_0xbc251f[_0x42e5da][_0x2b98('0x23')];_0x3ad411++){var _0x5abfa7=_[_0x2b98('0x68')](_0x3feea[_0x2b98('0x66')][_0x1e04e9][_0xbc251f[_0x42e5da][_0x3ad411]][_0x2b98('0x69')](/"/g,'\x27'));var _0x5d266f=phoneDescriptions[_0x2b98('0x67')](_0x47cbc1=>_0x47cbc1['itemTypeId']===_0x47810f['id']);if(!_['isNil'](_0x5d266f)){var _0x23a187=_[_0x2b98('0x68')](_0x3feea[_0x2b98('0x66')][_0x1e04e9][_0xbc251f[_0x5d266f[_0x2b98('0x79')]][0x0]]['replace'](/"/g,'\x27'));if(!_['isNil'](_0x23a187))_0x5abfa7=_0x5abfa7+'§'+_0x23a187;}if(_0x217edb=='')_0x217edb=_0x5abfa7;else _0x217edb+='|'+_0x5abfa7;}_0x5461a8[_0x2b98('0x21')](_0x47810f['id']+':'+_0x217edb);_0x55b229[_0x47810f['id']]=0x1;}}}}if(hasAdditionalPhones){_0x45a8ee[_0x2b98('0x21')]('\x22'+_0x5461a8[_0x2b98('0x12')](';')+'\x22');}if(_0x30f140[_0x2b98('0x23')]){handleError(_0x3feea[_0x2b98('0x66')][_0x1e04e9],{'code':_0x2b98('0x7a'),'message':_0x30f140[_0x2b98('0x12')]()});}else{fs[_0x2b98('0x7b')](_0x147b72,_0x45a8ee[_0x2b98('0x12')]()+'\x0a');}_0x45a8ee=[];}if(!(stats[_0x2b98('0x7c')]%0xc8)){socket[_0x2b98('0x7d')]('contact:import:'+_0x31319d,stats);stats['errors']=[];}}if(stopped){logger['info'](_0x2b98('0x7e'));_0x3ea623['abort']();}}catch(_0x3c89b1){handleError(_0x3feea[_0x2b98('0x66')][_0x1e04e9],{'code':'SystemError','message':_0x3c89b1[_0x2b98('0x1f')]});logger[_0x2b98('0x56')](_0x2b98('0x7f'),_0x3c89b1[_0x2b98('0x1f')]);}},'complete':function(){try{var _0x45aa8d=[];var _0x3875ae=tempTableName;_0x45aa8d[_0x2b98('0x21')]('CREATE\x20TABLE\x20'+_0x3875ae+'\x20LIKE\x20cm_contacts;');logger[_0x2b98('0x55')](_0x2b98('0x80'),contactItemTypes[_0x2b98('0x23')]);var _0x20c536=util[_0x2b98('0xe')](_0x2b98('0x81'),_0x147b72,_0x3875ae,_0x25e97c,_0x228822[_0x2b98('0x36')],_0x228822[_0x2b98('0x82')]||null,NOW,NOW);if(_['isNil'](_0xbc251f[_0x2b98('0x6a')])){_0x20c536+=_0x2b98('0x83');}_0x45aa8d['push'](_0x20c536);BPromise[_0x2b98('0x84')](_0x45aa8d,handleQuery)[_0x2b98('0x1d')](function(_0xc042b8){BPromise[_0x2b98('0x22')]([handleAdditionalPhones()])['then'](function(){_0x45aa8d=[];for(var _0x1bc025=0x0;_0x1bc025\x20\x20','root','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','uncaughtException','path','moment','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','import','redis','localhost','socket.io-emitter','format','cm_contacts_temp_','YYYYMMDDHHmmss','test','select','phone','from','.id\x20=\x20','join','sequelize','query','select\x20*\x20from\x20','spread','length','isNil','AdditionalPhones','push','all','catch','error','message','then','split','CmContactHasItem','findOne','update','PHONE','inserted'];(function(_0x56db09,_0x5017a6){var _0x5999a2=function(_0x20363f){while(--_0x20363f){_0x56db09['push'](_0x56db09['shift']());}};_0x5999a2(++_0x5017a6);}(_0x4c4d,0x1a2));var _0xd4c4=function(_0x4d4248,_0x12d6ba){_0x4d4248=_0x4d4248-0x0;var _0x386343=_0x4c4d[_0x4d4248];return _0x386343;};'use strict';var fs=require('fs');var path=require(_0xd4c4('0x0'));var _=require('lodash');var Papa=require('papaparse');var util=require('util');var BPromise=require('bluebird');var moment=require(_0xd4c4('0x1'));var squel=require('squel');var Redis=require(_0xd4c4('0x2'));var db=require(_0xd4c4('0x3'))['db'];var config=require(_0xd4c4('0x4'));var logger=require(_0xd4c4('0x5'))(_0xd4c4('0x6'));config[_0xd4c4('0x7')]=_['defaults'](config[_0xd4c4('0x7')],{'host':_0xd4c4('0x8'),'port':0x18eb});var socket=require(_0xd4c4('0x9'))(new Redis(config[_0xd4c4('0x7')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var promisesContact=[];var orderBy=0x0;var updatedRows=0x0;var stopped=![];var NOW=moment()[_0xd4c4('0xa')]('YYYY-MM-DD\x20HH:mm:ss');var tempTableName=_0xd4c4('0xb')+moment()[_0xd4c4('0xa')](_0xd4c4('0xc'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x32370d){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))*$/[_0xd4c4('0xd')](_0x32370d);}function selectNotIn(_0x2e6360,_0x1696bf,_0x266f66,_0x794e78,_0x49a291){return squel[_0xd4c4('0xe')]()['field'](_0xd4c4('0xf'))[_0xd4c4('0x10')](_0x794e78)['join'](_0x1696bf,null,_0x1696bf+_0xd4c4('0x11')+_0x794e78+'.'+_0x266f66)['where'](_0x794e78+'.'+_0x266f66+'\x20=\x20'+_0x2e6360+'.'+_0x266f66)['where'](_0x1696bf+'.dialCheckDuplicateType\x20IN\x20('+_0x49a291[_0xd4c4('0x12')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x3c52b0,_0x55fbc9){promisesAdditionalPhones=[];promisesContact=[];return db[_0xd4c4('0x13')][_0xd4c4('0x14')](_0xd4c4('0x15')+tempTableName)[_0xd4c4('0x16')](function(_0x3851cf){if(_0x3851cf!==null){var _0x11318b=[];for(var _0x213926=0x0;_0x213926<_0x3851cf[_0xd4c4('0x17')];_0x213926++){var _0x1915ac=_0x3851cf[_0x213926];if(!_['isNil'](_0x1915ac['phone'])){if(!_[_0xd4c4('0x18')](_0x1915ac[_0xd4c4('0x19')]))_0x11318b[_0xd4c4('0x1a')](insertAdditionalPhones(_0x1915ac));promisesContact[_0xd4c4('0x1a')]({'contact':_0x1915ac});}}}Promise[_0xd4c4('0x1b')](_0x11318b)['then'](function(){_0x3c52b0({'val':0x1});});})[_0xd4c4('0x1c')](function(_0x5df304){logger[_0xd4c4('0x1d')](_0x5df304[_0xd4c4('0x1e')]);});});}function insertAdditionalPhones(_0x579554){return new Promise(function(_0x20224b,_0xc197d8){var _0x5be52d=_0x579554[_0xd4c4('0x19')];if(_[_0xd4c4('0x18')](_0x5be52d))_0xc197d8({'val':0x0});else{var _0x92a2ec=_0x5be52d['split'](';');var _0x29ea89=[];orderBy=0x0;for(var _0xe7d09c=0x0;_0xe7d09c<_0x92a2ec['length'];_0xe7d09c++){_0x29ea89['push'](splitAdditionalPhone(_0x579554['id'],_0x92a2ec[_0xe7d09c]));}Promise[_0xd4c4('0x1b')](_0x29ea89)[_0xd4c4('0x1f')](function(){_0x20224b({'val':_0x92a2ec['length']});});}});}function splitAdditionalPhone(_0x1c1a00,_0x15114a){return new Promise(function(_0x4979e6,_0xbf1e3c){var _0x59aade=_0x15114a[_0xd4c4('0x20')](':');var _0x337bd4=_0x59aade[0x0];var _0x2cb2db=_0x59aade[0x1];if(_0x2cb2db!==''){var _0x5f48a1=_0x2cb2db[_0xd4c4('0x20')]('|');var _0x5cc6fe=[];for(var _0x491417=0x0;_0x491417<_0x5f48a1[_0xd4c4('0x17')];_0x491417++){if(_0x5f48a1[_0x491417]!==''){var _0x5781ed=_['filter'](promisesAdditionalPhones,{'contactId':_0x1c1a00,'phone':_0x5f48a1[_0x491417]});if(_0x5781ed['length']==0x0){orderBy++;promisesAdditionalPhones['push']({'contactId':_0x1c1a00,'contactTypeId':_0x337bd4,'phone':_0x5f48a1[_0x491417],'orderBy':orderBy});}}}_0x4979e6({'ok':0x1});}else _0x4979e6({'res':0x0});});}function createAdditionalPhone(_0x1c768f,_0x127f03,_0x416c3f,_0x52a0f8){var _0x49c734='';var _0x530e28='';var _0x2c7654=_0x416c3f[_0xd4c4('0x20')]('§');_0x49c734=_0x2c7654[0x0];if(_0x2c7654[_0xd4c4('0x17')]==0x2)_0x530e28=_0x2c7654[0x1];return new Promise(function(_0x26b87f,_0x5f4e8d){return db[_0xd4c4('0x21')][_0xd4c4('0x22')]({'where':{'CmContactId':_0x1c768f,'item':_0x49c734}})['then'](function(_0x5bf9eb){if(_0x5bf9eb){return db['CmContactHasItem'][_0xd4c4('0x23')]({'ItemTypeId':_0x127f03,'description':_0x530e28,'OrderBy':_0x52a0f8},{'where':{'CmContactId':_0x1c768f,'item':_0x49c734}})['then'](function(_0x1c6b2e){_0x26b87f({'res':'updated'});});}else{return db[_0xd4c4('0x21')]['create']({'CmContactId':_0x1c768f,'item':_0x49c734,'ItemTypeId':_0x127f03,'description':_0x530e28,'OrderBy':_0x52a0f8,'ItemClass':_0xd4c4('0x24')})[_0xd4c4('0x1f')](function(_0x1a35cc){_0x26b87f({'res':_0xd4c4('0x25')});});}});});}function updateContact(_0xaa5b57){return new Promise(function(_0x230ec8,_0x1ef1f8){var _0x4a4be1=_0xaa5b57['id'];delete _0xaa5b57['id'];return db['CmContact'][_0xd4c4('0x23')](_0xaa5b57,{'where':{'id':_0x4a4be1}})[_0xd4c4('0x1f')](function(_0x255b29){updatedRows+=0x1;return db[_0xd4c4('0x26')]['update']({'phone':_0xaa5b57['phone']},{'where':{'ContactId':_0x4a4be1}})[_0xd4c4('0x1f')](function(_0x4a556a){_0x230ec8({'ret':'OK'});});});});}function insertCmHopper(_0x4b46ba,_0x3e79f1,_0x3cdb33,_0x203e7f,_0x4a5bbe){var _0x51aa5e=[_0xd4c4('0x27'),'cm_contacts.scheduledat','cm_contacts.id',_0xd4c4('0x28'),_0x3e79f1+'.'+_0x203e7f,_0xd4c4('0x29'),_0xd4c4('0x2a'),_0xd4c4('0x2b'),_0xd4c4('0x2c'),'\x22'+_0x4a5bbe+'\x22'];return squel['insert']()[_0xd4c4('0x2d')](_0xd4c4('0x2e'))[_0xd4c4('0x2f')]([_0xd4c4('0xf'),'scheduledat',_0xd4c4('0x30'),'ListId',_0x203e7f,_0xd4c4('0x31'),_0xd4c4('0x32'),'priority',_0xd4c4('0x33'),'recallme'],squel[_0xd4c4('0xe')]()['fields'](_0x51aa5e)[_0xd4c4('0x10')](_0x3e79f1)[_0xd4c4('0x12')](_0xd4c4('0x34'),null,_0xd4c4('0x35')+_0x3e79f1+_0xd4c4('0x36'))[_0xd4c4('0x12')](_0x3cdb33,null,_0x3cdb33+_0xd4c4('0x11')+_0x3e79f1+'.'+_0x203e7f)[_0xd4c4('0x37')](_0x3e79f1+'.CmListId\x20=\x20?',_0x4b46ba)[_0xd4c4('0x37')](_0xd4c4('0x38'),NOW)[_0xd4c4('0x37')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x3e79f1,_0x3cdb33,_0x203e7f,_0xd4c4('0x2e'),[_0xd4c4('0x39'),_0xd4c4('0x3a')]))[_0xd4c4('0x37')](_0xd4c4('0x3b'),selectNotIn(_0x3e79f1,_0x3cdb33,_0x203e7f,_0xd4c4('0x2e'),['\x22always\x22'])))['toString']();}function insertCmHopperBlack(_0x2ec298,_0x3e8ee2,_0x5542e7,_0x509f35){var _0x20def6=['cm_contacts.phone',_0xd4c4('0x3c'),'cm_contacts.ListId',_0x3e8ee2+'.'+_0x509f35,_0xd4c4('0x29'),_0xd4c4('0x2a')];return squel[_0xd4c4('0x3d')]()[_0xd4c4('0x2d')](_0xd4c4('0x3e'))[_0xd4c4('0x2f')]([_0xd4c4('0xf'),_0xd4c4('0x30'),_0xd4c4('0x3f'),_0x509f35,_0xd4c4('0x31'),_0xd4c4('0x32')],squel[_0xd4c4('0xe')]()[_0xd4c4('0x40')](_0x20def6)[_0xd4c4('0x10')](_0x3e8ee2)[_0xd4c4('0x12')](_0xd4c4('0x34'),null,_0xd4c4('0x35')+_0x3e8ee2+_0xd4c4('0x36'))[_0xd4c4('0x12')](_0x5542e7,null,_0x5542e7+_0xd4c4('0x11')+_0x3e8ee2+'.'+_0x509f35)['where'](_0x3e8ee2+_0xd4c4('0x41'),_0x2ec298)[_0xd4c4('0x37')](_0xd4c4('0x38'),NOW)[_0xd4c4('0x37')](_0xd4c4('0x3b'),squel[_0xd4c4('0xe')]()[_0xd4c4('0x42')]('phone')['from']('cm_hopper_black')[_0xd4c4('0x37')](_0xd4c4('0x43'),_0x2ec298)[_0xd4c4('0x37')](_0x509f35+_0xd4c4('0x44'),_0x3e8ee2+'.'+_0x509f35)))[_0xd4c4('0x45')]();}function insertCmHopperAdditionalPhones(_0x195a8c){var _0x45f0fa=[_0xd4c4('0x46'),'cm_contact_has_items.item','cm_contact_has_items.OrderBy',_0xd4c4('0x47'),_0xd4c4('0x48')];return squel[_0xd4c4('0x3d')]()['into'](_0xd4c4('0x49'))[_0xd4c4('0x2f')]([_0xd4c4('0x4a'),_0xd4c4('0xf'),_0xd4c4('0x4b'),'createdAt',_0xd4c4('0x32')],squel[_0xd4c4('0xe')]()['fields'](_0x45f0fa)['from'](_0xd4c4('0x2e'))['join'](_0xd4c4('0x34'),null,'cm_contacts.id\x20=\x20cm_hopper.ContactId')[_0xd4c4('0x12')](_0xd4c4('0x4c'),null,'cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId')[_0xd4c4('0x37')](_0xd4c4('0x4d'),_0x195a8c)[_0xd4c4('0x37')](_0xd4c4('0x38'),NOW))[_0xd4c4('0x45')]();}function insertCmContact(_0x85c9a7,_0x565785,_0x37efd7,_0x50ae4f){var _0x2d67d3=_[_0xd4c4('0x4e')](_[_0xd4c4('0x4f')](_0x50ae4f),[_0xd4c4('0x3f'),_0xd4c4('0x50'),'createdAt',_0xd4c4('0x32')]);return squel['insert']()[_0xd4c4('0x2d')](_0xd4c4('0x34'))['fromQuery'](_0x2d67d3,squel['select']()[_0xd4c4('0x40')](_0x2d67d3)[_0xd4c4('0x10')](_0x565785)[_0xd4c4('0x37')]('('+_0x37efd7[_0xd4c4('0x12')](',')+_0xd4c4('0x51'),squel[_0xd4c4('0xe')]()[_0xd4c4('0x40')](_0x37efd7)[_0xd4c4('0x10')](_0xd4c4('0x34'))[_0xd4c4('0x37')](_0xd4c4('0x43'),_0x85c9a7))[_0xd4c4('0x37')](_0xd4c4('0x52'),squel[_0xd4c4('0xe')]()[_0xd4c4('0x42')](_0xd4c4('0x53'),_0xd4c4('0x54'))[_0xd4c4('0x10')](_0x565785)['group'](_0x37efd7[_0xd4c4('0x12')](','))))[_0xd4c4('0x45')]();}function handleStop(){logger[_0xd4c4('0x55')](_0xd4c4('0x56'));stopped=!![];}function handleUncaughtException(_0xaddb06){logger['error'](_0xaddb06['message']);process['exit'](0x1);}function handleError(_0x244718,_0x2c3059){stats[_0xd4c4('0x57')]['push']({'name':_0x2c3059[_0xd4c4('0x58')],'message':_0x2c3059[_0xd4c4('0x1e')],'row':_0x244718});}function handleQuery(_0x3fadba){logger[_0xd4c4('0x55')](_0x3fadba);return db[_0xd4c4('0x13')][_0xd4c4('0x14')](_0x3fadba)[_0xd4c4('0x16')](function(_0x35a52e){results[_0xd4c4('0x1a')](_0x35a52e);})[_0xd4c4('0x1c')](function(_0x40b531){logger[_0xd4c4('0x1d')](_0x40b531[_0xd4c4('0x1e')]);});}function main(_0x9acc7f,_0x14acc9,_0x469464,_0x1fee3a){logger[_0xd4c4('0x55')]('main',_0x9acc7f,JSON['stringify'](_0x14acc9));process['send'](_0xd4c4('0x59'));var _0x262950=_0x14acc9[_0xd4c4('0x5a')];var _0x3af90b=_[_0xd4c4('0x5b')](_0x262950);var _0x13b7aa=_0x14acc9[_0xd4c4('0x5c')];var _0x2752b5=path[_0xd4c4('0x12')](config['root'],_0xd4c4('0x5d'),_0x13b7aa+_0xd4c4('0x5e'));logger['info'](_0xd4c4('0x5f'),_0x14acc9);db[_0xd4c4('0x60')]['findAll']({'raw':!![],'attributes':['id',_0xd4c4('0x61')]})[_0xd4c4('0x1f')](function(_0xd5c2cf){for(var _0x475708=0x0;_0x475708<_0xd5c2cf[_0xd4c4('0x17')];_0x475708++){if(_0xd5c2cf[_0x475708][_0xd4c4('0x61')]in _0x262950){contactItemTypes[_0xd4c4('0x1a')](_0xd5c2cf[_0x475708]);delete _0x3af90b[_0xd5c2cf[_0x475708][_0xd4c4('0x61')]];hasAdditionalPhones=!![];}for(var _0x3acc58 in _0x262950){if(_0xd5c2cf[_0x475708][_0xd4c4('0x61')]+_0xd4c4('0x62')===_0x3acc58){phoneDescriptions[_0xd4c4('0x1a')]({'itemTypeId':_0xd5c2cf[_0x475708]['id'],'description':_0x3acc58});delete _0x3af90b[_0x3acc58];}}}if(hasAdditionalPhones)_0x3af90b[_0xd4c4('0x19')]='';var _0x1bc37f=_['keys'](_0x3af90b)['join']();logger[_0xd4c4('0x55')](_0xd4c4('0x63'),_0x1bc37f);fs[_0xd4c4('0x64')](_0x2752b5,_0x1bc37f+'\x0a');Papa[_0xd4c4('0x65')](fs[_0xd4c4('0x66')](_0x9acc7f),{'header':!![],'skipEmptyLines':!![],'step':function(_0x524765,_0x100aed){try{for(var _0x1c6ad3=0x0,_0x1964ff=[];_0x1c6ad3<_0x524765['data']['length'];_0x1c6ad3++){stats['rows']+=0x1;if(_0x524765[_0xd4c4('0x57')][_0x1c6ad3]){handleError(_0x524765['data'][_0x1c6ad3],_0x524765[_0xd4c4('0x57')][_0x1c6ad3]);}else{var _0x19b89b=[];var _0x222116=[];var _0x44bccf={};for(var _0xae270b in _0x262950){let _0x24eea4=contactItemTypes['find'](_0x3e5604=>_0x3e5604['name']===_0xae270b);let _0x137107=contactItemTypes[_0xd4c4('0x67')](_0x39b41a=>_0x39b41a[_0xd4c4('0x61')]+_0xd4c4('0x62')===_0xae270b);if(_[_0xd4c4('0x18')](_0x24eea4)&&_[_0xd4c4('0x18')](_0x137107)){if(_0x262950[_0xd4c4('0x68')](_0xae270b)){if(_0x524765['data'][_0x1c6ad3][_0x262950[_0xae270b]]){var _0x593e53=_[_0xd4c4('0x69')](_0x524765['data'][_0x1c6ad3][_0x262950[_0xae270b]]['replace'](/"/g,'\x27'));switch(_0xae270b){case _0xd4c4('0x6a'):var _0x5a6a88=moment(_0x593e53,_0xd4c4('0x6b'),!![]);if(_0x5a6a88[_0xd4c4('0x6c')]()){_0x1964ff[_0xd4c4('0x1a')]('\x22'+_0x593e53+'\x22');}else{_0x19b89b[_0xd4c4('0x1a')](_0xd4c4('0x6d'));}break;case _0xd4c4('0x6e'):var _0x448546=parseInt(_0x593e53);_0x593e53=_[_0xd4c4('0x6f')](_0x448546)||_0x448546<0x0||_0x448546>0x4?_0x1fee3a?0x3:0x2:_0x448546;_0x1964ff[_0xd4c4('0x1a')]('\x22'+_0x593e53+'\x22');break;case _0xd4c4('0x33'):var _0xa23b8a=parseInt(_0x593e53);if(_['isNumber'](_0xa23b8a)&&_[_0xd4c4('0x70')](_0x469464,_0xa23b8a)){_0x1964ff[_0xd4c4('0x1a')]('\x22'+_0xa23b8a+'\x22');}else{_0x19b89b[_0xd4c4('0x1a')](_0xd4c4('0x71'));}break;case _0xd4c4('0x72'):if(isEmail(_0x593e53)){_0x1964ff['push']('\x22'+_0x593e53+'\x22');}else{_0x19b89b['push']('email\x20wrong\x20format');}break;case'dateOfBirth':var _0x4a1f17=moment(_0x593e53,_0xd4c4('0x73'),!![]);if(_0x4a1f17['isValid']()){_0x1964ff[_0xd4c4('0x1a')]('\x22'+_0x593e53+'\x22');}else{_0x19b89b['push']('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0x1964ff[_0xd4c4('0x1a')]('\x22'+_0x593e53+'\x22');}}else{switch(_0xae270b){case'firstName':case _0xd4c4('0xf'):_0x19b89b[_0xd4c4('0x1a')](_0xae270b+'\x20not\x20specified');break;default:_0x1964ff['push']('\x22\x22');}}}}else{var _0x4783fc='';if(!_[_0xd4c4('0x18')](_0x24eea4)){if(!_0x44bccf[_0xd4c4('0x68')](_0x24eea4['id'])){for(var _0x49fef7=0x0;_0x49fef7<_0x262950[_0xae270b][_0xd4c4('0x17')];_0x49fef7++){var _0x593e53=_[_0xd4c4('0x69')](_0x524765[_0xd4c4('0x74')][_0x1c6ad3][_0x262950[_0xae270b][_0x49fef7]]['replace'](/"/g,'\x27'));var _0x449c11=phoneDescriptions[_0xd4c4('0x67')](_0x2c4bbd=>_0x2c4bbd[_0xd4c4('0x75')]===_0x24eea4['id']);if(!_[_0xd4c4('0x18')](_0x449c11)){var _0x31cf97=_[_0xd4c4('0x69')](_0x524765['data'][_0x1c6ad3][_0x262950[_0x449c11[_0xd4c4('0x76')]][0x0]]['replace'](/"/g,'\x27'));if(!_[_0xd4c4('0x18')](_0x31cf97))_0x593e53=_0x593e53+'§'+_0x31cf97;}if(_0x4783fc=='')_0x4783fc=_0x593e53;else _0x4783fc+='|'+_0x593e53;}_0x222116[_0xd4c4('0x1a')](_0x24eea4['id']+':'+_0x4783fc);_0x44bccf[_0x24eea4['id']]=0x1;}}}}if(hasAdditionalPhones){_0x1964ff[_0xd4c4('0x1a')]('\x22'+_0x222116[_0xd4c4('0x12')](';')+'\x22');}if(_0x19b89b['length']){handleError(_0x524765[_0xd4c4('0x74')][_0x1c6ad3],{'code':_0xd4c4('0x77'),'message':_0x19b89b['join']()});}else{fs[_0xd4c4('0x78')](_0x2752b5,_0x1964ff['join']()+'\x0a');}_0x1964ff=[];}if(!(stats[_0xd4c4('0x79')]%0xc8)){socket[_0xd4c4('0x7a')](_0xd4c4('0x7b')+_0x13b7aa,stats);stats[_0xd4c4('0x57')]=[];}}if(stopped){logger[_0xd4c4('0x55')](_0xd4c4('0x7c'));_0x100aed[_0xd4c4('0x7d')]();}}catch(_0xfa735d){handleError(_0x524765['data'][_0x1c6ad3],{'code':_0xd4c4('0x7e'),'message':_0xfa735d['message']});logger[_0xd4c4('0x1d')]('step',_0xfa735d['message']);}},'complete':function(){try{var _0x5bf846=[];var _0x6a3e92=tempTableName;_0x5bf846[_0xd4c4('0x1a')](_0xd4c4('0x7f')+_0x6a3e92+_0xd4c4('0x80'));logger['info'](_0xd4c4('0x81'),contactItemTypes[_0xd4c4('0x17')]);var _0x4ac5e1=util[_0xd4c4('0xa')](_0xd4c4('0x82'),_0x2752b5,_0x6a3e92,_0x1bc37f,_0x14acc9[_0xd4c4('0x3f')],_0x14acc9['CompanyId']||null,NOW,NOW);if(_[_0xd4c4('0x18')](_0x262950[_0xd4c4('0x6a')])){_0x4ac5e1+=_0xd4c4('0x83');}_0x5bf846[_0xd4c4('0x1a')](_0x4ac5e1);BPromise[_0xd4c4('0x84')](_0x5bf846,handleQuery)[_0xd4c4('0x1f')](function(_0x497bee){BPromise[_0xd4c4('0x1b')]([handleAdditionalPhones()])[_0xd4c4('0x1f')](function(){_0x5bf846=[];for(var _0x517a44=0x0;_0x517a44\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','c.firstName','Contact.firstName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Owner.internal','TagIds','limit','offset','Setting','findOne','enableEmailPreview','all','clone','isEmpty','t.id\x20IN\x20?','lodash'];(function(_0x57a399,_0x5ef281){var _0x2fd321=function(_0x140b2e){while(--_0x140b2e){_0x57a399['push'](_0x57a399['shift']());}};_0x2fd321(++_0x5ef281);}(_0x361b,0x137));var _0xb361=function(_0x31d11b,_0x38a856){_0x31d11b=_0x31d11b-0x0;var _0x26d620=_0x361b[_0x31d11b];return _0x26d620;};'use strict';var _=require(_0xb361('0x0'));var squel=require(_0xb361('0x1'));var as=require(_0xb361('0x2'));var qs=require(_0xb361('0x3'));var updateInteraction=require(_0xb361('0x4'))['updateInteraction'];var utils=require('./utils');var db=require('../../mysqldb')['db'];function skipInteractionsQuery(_0x36d7ff,_0x2ba26d,_0x280c95){var _0x7097b4=![];var _0x1adb6e=utils[_0xb361('0x5')](_0x36d7ff);if(_0x2ba26d[_0xb361('0x6')]===_0xb361('0x7')&&!_0x280c95['search']&&!_0x280c95[_0x1adb6e]){_0x7097b4=!![];}return _0x7097b4;}function getTagsQuery(){return squel[_0xb361('0x8')]()['field']('id')['field'](_0xb361('0x9'))['field'](_0xb361('0xa'))[_0xb361('0xb')]('tools_tags');}function getUsersQuery(_0x5a727d,_0x32b42c){var _0x4e4702=utils['getInteractionFK'](_0x5a727d);var _0x2ff6d1=_0xb361('0xc')+_0x5a727d+_0xb361('0xd');var _0x1872a2=squel[_0xb361('0x8')]()['field'](_0xb361('0xe'))['field'](_0xb361('0xf'))[_0xb361('0x10')](_0xb361('0x11')+_0x4e4702)[_0xb361('0xb')](_0x2ff6d1,'ui')[_0xb361('0x12')](_0xb361('0x13'),'u','u.id\x20=\x20ui.UserId');if(_0x32b42c['length']>0x0){_0x1872a2['where'](_0xb361('0x11')+_0x4e4702+_0xb361('0x14'),_[_0xb361('0x15')](_0x32b42c,'id'));}return _0x1872a2;}function getInteractionsQuery(_0x54562d){var _0xb0b6bc=utils[_0xb361('0x16')](_0x54562d);var _0x3d3065=utils[_0xb361('0x5')](_0x54562d);var _0x5caeff=utils[_0xb361('0x17')](_0x54562d);return squel[_0xb361('0x8')]()['from'](_0xb0b6bc['interactions'],'i')['left_join'](_0xb361('0x18'),'c',_0xb361('0x19'))[_0xb361('0x12')]('users','o',_0xb361('0x1a'))[_0xb361('0x12')](_0xb0b6bc[_0xb361('0x1b')],'a',_0xb361('0x1c')+_0x3d3065)[_0xb361('0x12')](_0xb0b6bc['messages'],'me','me.'+_0x5caeff+'\x20=\x20i.id')['left_join'](_0xb0b6bc[_0xb361('0x1d')],'it',_0xb361('0x1e')+_0x5caeff+_0xb361('0x1f'))['left_join'](_0xb361('0x20'),'t',_0xb361('0x21'));}function getSqlClauses(){var _0x3a01a5={'body':squel[_0xb361('0x22')](),'contact':squel['expr'](),'default':squel[_0xb361('0x22')](),'fields':squel[_0xb361('0x22')](),'filter':squel[_0xb361('0x22')](),'read':squel['expr'](),'tags':{'clause':squel[_0xb361('0x22')](),'ids':null},'user':squel[_0xb361('0x22')]()};return _0x3a01a5;}function parseTagParameter(_0x26697f){var _0x5bcb54=squel['expr']();if(_0x26697f){var _0x2f3061=utils[_0xb361('0x23')](_0x26697f);_0x2f3061[_0xb361('0x24')](function(_0x1a2d22){_0x5bcb54['or'](_0xb361('0x25'),'%,'+_0x1a2d22+',%');});}return _0x5bcb54;}function parseReadParameter(_0x599cbd){var _0x3c230d='';if(_0x599cbd){_0x3c230d=_0xb361('0x26');if(_0x599cbd==='1'){_0x3c230d=_0x3c230d['replace'](_0xb361('0x27'),'=');}else{_0x3c230d=_0x3c230d[_0xb361('0x28')](_0xb361('0x27'),'>');}}return _0x3c230d;}function parseSearchFilter(_0x171704,_0x359a14){var _0x2bc7d7=squel['expr']();if(_0x359a14){var _0x4fcb1a=_0x359a14[_0xb361('0x28')]('\x5c','\x5c\x5c')[_0xb361('0x28')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x4fcb1a)){_0x2bc7d7['or'](_0xb361('0x29'),_0x4fcb1a+'%');if([_0xb361('0x2a'),'whatsapp'][_0xb361('0x2b')](_0x171704)){_0x2bc7d7['or'](_0xb361('0x2c'),_0x4fcb1a+'%');}else if(_0x171704===_0xb361('0x2d')){_0x2bc7d7['or']('i.fax\x20LIKE\x20?',_0x4fcb1a+'%');}else if(_0x171704===_0xb361('0x2e')){_0x2bc7d7['or'](_0xb361('0x2f'),_0x4fcb1a+'%');}}else if(_0x171704===_0xb361('0x30')&&qs['isEmail'](_0x4fcb1a)){_0x2bc7d7['or'](_0xb361('0x31'),_0x4fcb1a+'%');}else{if(_0x171704===_0xb361('0x30')){_0x2bc7d7['or'](_0xb361('0x32'),qs[_0xb361('0x33')](_0x4fcb1a,!![]))['or'](_0xb361('0x34'),qs['getFullTextValue'](_0x4fcb1a));}else if(_0x171704!=='fax'){_0x2bc7d7['or'](_0xb361('0x35'),qs['getFullTextValue'](_0x4fcb1a));}_0x2bc7d7['or'](_0xb361('0x36'),qs[_0xb361('0x33')](_0x4fcb1a,!![]),null);}}return _0x2bc7d7;}function parseAdvancedSearchFilter(_0x3edfb6,_0x48480d){var _0x9359b=getSqlClauses();var _0x11d651=as[_0xb361('0x37')](_0x3edfb6);var _0x23a83d=_0x11d651[_0xb361('0x38')];for(var _0x555114=0x0;_0x555114<_0x11d651[_0xb361('0x39')][_0xb361('0x3a')];_0x555114++){var _0x3e2201=_0x11d651['conditions'][_0x555114];var _0x56448f='i';var _0x2bcfc8=_[_0xb361('0x3b')](_0x48480d,[_0xb361('0x9'),_0x3e2201[_0xb361('0x10')]]);if(_0x2bcfc8){var _0x1b793f=as[_0xb361('0x3c')](_0x56448f,_0x2bcfc8[_0xb361('0x3d')],_0x3e2201);_0x9359b[_0xb361('0x3e')][_0x23a83d](_0x1b793f[_0xb361('0x3f')],_0x1b793f[_0xb361('0x40')][_0xb361('0x41')],_0x1b793f[_0xb361('0x40')][_0xb361('0x42')]);}else{switch(_0x3e2201[_0xb361('0x10')]){case _0xb361('0x43'):var _0x5e9daa=parseReadParameter(_0x3e2201['value']);_0x9359b[_0xb361('0x44')][_0xb361('0x45')](_0x5e9daa);break;case'Contact':if(_0x3e2201['operator']===_0xb361('0x46')){if(_0x3e2201['value'][_0xb361('0x47')]('\x20')[_0xb361('0x3a')]>0x1){_0x9359b['contact'][_0x23a83d](_0xb361('0x36'),qs['getFullTextValue'](_0x3e2201[_0xb361('0x40')],!![]),null);}else{var _0x1d39ff='%'+_0x3e2201[_0xb361('0x40')]+'%';_0x9359b[_0xb361('0x48')][_0x23a83d]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x1d39ff,_0x1d39ff,_0x1d39ff);}}else{_0x2bcfc8=_[_0xb361('0x3b')](_0x48480d,[_0xb361('0x9'),_0xb361('0x49')]);_0x3e2201[_0xb361('0x10')]=_0xb361('0x49');_0x1b793f=as[_0xb361('0x3c')](_0x56448f,_0x2bcfc8[_0xb361('0x3d')],_0x3e2201);_0x9359b[_0xb361('0x48')][_0x23a83d](_0x1b793f[_0xb361('0x3f')],_0x1b793f[_0xb361('0x40')][_0xb361('0x41')],_0x1b793f[_0xb361('0x40')][_0xb361('0x42')]);}break;case _0xb361('0x4a'):var _0xb6e89f=_0x3e2201[_0xb361('0x40')][_0xb361('0x47')](',')[_0xb361('0x15')](function(_0x1cf056){return Number(_0x1cf056);});var _0x5e4e1a=parseTagParameter(_0xb6e89f);_0x9359b[_0xb361('0x4b')][_0xb361('0x4c')][_0xb361('0x45')](_0x5e4e1a);_0x9359b[_0xb361('0x4b')][_0xb361('0x4d')]=_0xb6e89f;break;case'User':if(_0x3e2201[_0xb361('0x4e')]===_0xb361('0x46')){_0x9359b[_0xb361('0x4f')][_0x23a83d]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x3e2201[_0xb361('0x40')]+'%',null);}else{_0x2bcfc8=_[_0xb361('0x3b')](_0x48480d,[_0xb361('0x9'),_0xb361('0x50')]);_0x3e2201[_0xb361('0x10')]='UserId';_0x1b793f=as[_0xb361('0x3c')](_0x56448f,_0x2bcfc8[_0xb361('0x3d')],_0x3e2201);_0x9359b[_0xb361('0x4f')][_0x23a83d](_0x1b793f[_0xb361('0x3f')],_0x1b793f[_0xb361('0x40')]['start'],_0x1b793f[_0xb361('0x40')][_0xb361('0x42')]);}break;case _0xb361('0x51'):case'plainBody':_0x1b793f=as[_0xb361('0x3c')]('me',null,_0x3e2201);_0x9359b[_0xb361('0x51')][_0x23a83d](_0x1b793f[_0xb361('0x3f')],_0x1b793f[_0xb361('0x40')][_0xb361('0x41')],_0x1b793f[_0xb361('0x40')][_0xb361('0x42')]);break;}}}return _0x9359b;}function parseModelFields(_0x3cfaf4,_0x3eeedd,_0x2e2ed6){var _0x13492a=utils[_0xb361('0x5')](_0x3cfaf4);var _0x194aca=squel['expr']();var _0xc88508=_(_0x3eeedd)[_0xb361('0x52')]()[_0xb361('0x15')](function(_0x4fd41a){return _[_0xb361('0x53')](_0x2e2ed6,['name',_0x4fd41a])?_0x4fd41a:undefined;})['compact']()[_0xb361('0x40')]();if(_0xc88508[_0xb361('0x3a')]>0x0){_0xc88508[_0xb361('0x24')](function(_0x32ac2e){if(_0x32ac2e===_0x13492a){_0x194aca[_0xb361('0x45')]('i.'+_0x13492a+_0xb361('0x14'),[][_0xb361('0x54')](_0x3eeedd[_0x32ac2e]));}else if(_0x32ac2e===_0xb361('0x55')){var _0x1035d7=JSON[_0xb361('0x56')](_0x3eeedd[_0x32ac2e])['$gte'];var _0x1223ff=JSON[_0xb361('0x56')](_0x3eeedd[_0x32ac2e])[_0xb361('0x57')];_0x194aca['and'](_0xb361('0x58'),_0x1035d7,_0x1223ff);}else{if(_0x3eeedd[_0x32ac2e]==='null'){_0x194aca['and']('i.'+_0x32ac2e+_0xb361('0x59'));}else{_0x194aca['and']('i.'+_0x32ac2e+'\x20=\x20?',_0x3eeedd[_0x32ac2e]);}}});}return _0x194aca;}function parseQueryParameters(_0x297e23,_0x3912d7,_0x27e68e){var _0x477ae5=getSqlClauses();return Promise[_0xb361('0x5a')]()[_0xb361('0x5b')](function(){return parseModelFields(_0x297e23,_0x3912d7,_0x27e68e);})['then'](function(_0x53a424){_0x477ae5[_0xb361('0x5c')][_0xb361('0x45')](_0x53a424);return parseReadParameter(_0x3912d7[_0xb361('0x44')]);})[_0xb361('0x5b')](function(_0x492f15){_0x477ae5[_0xb361('0x44')][_0xb361('0x45')](_0x492f15);return parseTagParameter(_0x3912d7[_0xb361('0x5d')]);})['then'](function(_0x47a253){_0x477ae5[_0xb361('0x4b')]['clause'][_0xb361('0x45')](_0x47a253);return parseSearchFilter(_0x297e23,_0x3912d7[_0xb361('0x5e')]);})[_0xb361('0x5b')](function(_0x29e366){_0x477ae5[_0xb361('0x5e')]=_0x29e366;return _0x477ae5;});}function checkAccountsRestrictions(_0x164949,_0x1cef4a,_0x52824e){var _0x38ca2f=utils[_0xb361('0x5')](_0x164949);var _0x282adb='get'+_['capitalize'](_0x164949)+(_0x164949===_0xb361('0x5f')?'Websites':_0xb361('0x60'));var _0x3d4ed3=squel[_0xb361('0x22')]();return Promise[_0xb361('0x5a')]()['then'](function(){if(_0x52824e[_0xb361('0x61')]&&_0x1cef4a['role']==='agent'){return _0x1cef4a[_0x282adb]({'attributes':['id'],'raw':!![]});}})[_0xb361('0x5b')](function(_0x37553e){if(_0x37553e){if(_0x37553e[_0xb361('0x3a')]===0x0){_0x3d4ed3[_0xb361('0x45')]('i.'+_0x38ca2f+_0xb361('0x59'));}else{_0x3d4ed3[_0xb361('0x45')]('i.'+_0x38ca2f+_0xb361('0x14'),_[_0xb361('0x15')](_0x37553e,'id'));}}else if(!_0x52824e[_0x38ca2f]){_0x3d4ed3[_0xb361('0x45')]('i.'+_0x38ca2f+'\x20IS\x20NOT\x20NULL');}})[_0xb361('0x5b')](function(){return _0x3d4ed3;});}function getClosedOrderClause(_0x44f39f,_0x5ae241){var _0x24b8c4='';var _0xcc574b=[_0xb361('0x62'),_0xb361('0x63'),_0xb361('0x64')];if(_0x44f39f===_0xb361('0x30')){_0xcc574b[_0xb361('0x65')](_0xb361('0x66'));}if(_0x5ae241[_0xb361('0x67')]==='0'&&_0x44f39f===_0xb361('0x30')){_0x24b8c4=_0xb361('0x66');}else{if(_0x5ae241[_0xb361('0x67')]==='1'){_0xcc574b[_0xb361('0x68')]();}_0x24b8c4='CONCAT_WS(\x27\x27,\x20'+_0xcc574b[_0xb361('0x69')](',\x20')+')';}return _0x24b8c4;}function getFilteredInteractions(_0x4bb68f,_0x3f01fd,_0x16fe96,_0x317227){var _0x1f6256=utils[_0xb361('0x17')](_0x4bb68f);var _0x588684=_['capitalize'](_0x4bb68f)+_0xb361('0x6a');var _0x1df50a=[];var _0x5677b5=getTagsQuery();var _0x5cb9f2={'type':db[_0xb361('0x6b')][_0xb361('0x6c')][_0xb361('0x6d')],'raw':!![]};var _0xcf6475=[];var _0x435445=[];return db[_0xb361('0x6e')][_0xb361('0x6f')](_0x5677b5[_0xb361('0x70')](),_0x5cb9f2)[_0xb361('0x5b')](function(_0x24d4d9){_0x1df50a=_[_0xb361('0x71')](_0x24d4d9,'id');_0x5cb9f2=_['merge'](_0x5cb9f2,{'model':db[_0x588684],'mapToModel':!![],'nest':!![]});if(_0x16fe96[_0xb361('0x5c')]){_0x317227[_0xb361('0x72')][_0xb361('0x24')](function(_0x9acc91){_0x3f01fd[_0xb361('0x10')]('i.'+_0x9acc91);});}else{_0x3f01fd['field'](_0xb361('0x73'),_0xb361('0x43'));_0x3f01fd[_0xb361('0x10')](_0xb361('0x74'),_0xb361('0x75'));_0x3f01fd[_0xb361('0x10')]('a.mandatoryDisposition',_0xb361('0x76'));if(_0x4bb68f===_0xb361('0x30')){_0x3f01fd[_0xb361('0x10')](_0xb361('0x77'),_0xb361('0x78'));_0x3f01fd[_0xb361('0x10')]('CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201))\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END',_0xb361('0x79'));_0x3f01fd[_0xb361('0x10')]('i.id');_0x3f01fd[_0xb361('0x10')](_0xb361('0x7a'));_0x3f01fd[_0xb361('0x10')](_0xb361('0x7b'));_0x3f01fd['field']('i.closed');_0x3f01fd['field'](_0xb361('0x7c'));_0x3f01fd[_0xb361('0x10')](_0xb361('0x7d'));_0x3f01fd['field'](_0xb361('0x7e'));_0x3f01fd[_0xb361('0x10')](_0xb361('0x7f'));_0x3f01fd[_0xb361('0x10')](_0xb361('0x80'));_0x3f01fd[_0xb361('0x10')](_0xb361('0x64'));_0x3f01fd[_0xb361('0x10')]('i.secondDisposition');_0x3f01fd[_0xb361('0x10')](_0xb361('0x62'));_0x3f01fd[_0xb361('0x10')]('i.substatus');_0x3f01fd['field'](_0xb361('0x81'));_0x3f01fd[_0xb361('0x10')](_0xb361('0x82'));_0x3f01fd[_0xb361('0x10')](_0xb361('0x83'));_0x3f01fd[_0xb361('0x10')](_0xb361('0x84'));}else if(_0x4bb68f===_0xb361('0x2e')){_0x3f01fd[_0xb361('0x10')](_0xb361('0x85'),_0xb361('0x79'));}else{_0x3f01fd[_0xb361('0x10')](_0xb361('0x86'),_0xb361('0x79'));}if(_0x4bb68f!==_0xb361('0x30')){_0x3f01fd[_0xb361('0x10')]('i.*');}_0x3f01fd['field'](_0xb361('0x87'),_0xb361('0x88'));_0x3f01fd[_0xb361('0x10')]('c.lastName',_0xb361('0x89'));_0x3f01fd[_0xb361('0x10')](_0xb361('0x8a'),_0xb361('0x8b'));_0x3f01fd[_0xb361('0x10')](_0xb361('0x8c'),_0xb361('0x8d'));_0x3f01fd[_0xb361('0x10')](_0xb361('0x8e'),_0xb361('0x8f'));_0x3f01fd[_0xb361('0x10')](_0xb361('0x90'),'Contact.fax');_0x3f01fd['field']('o.fullname','Owner.fullname');_0x3f01fd['field']('o.internal',_0xb361('0x91'));_0x3f01fd[_0xb361('0x10')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0xb361('0x92'));}if(_0x317227[_0xb361('0x93')]){_0x3f01fd[_0xb361('0x93')](_0x317227['limit']);}if(_0x317227['offset']){_0x3f01fd['offset'](_0x317227[_0xb361('0x94')]);}return db['sequelize'][_0xb361('0x6f')](_0x3f01fd[_0xb361('0x70')](),_0x5cb9f2);})[_0xb361('0x5b')](function(_0x4735fd){_0xcf6475=_0x4735fd;var _0x43adf6=getUsersQuery(_0x4bb68f,_0xcf6475);return db['sequelize'][_0xb361('0x6f')](_0x43adf6[_0xb361('0x70')](),_0x5cb9f2);})[_0xb361('0x5b')](function(_0x3f2572){_0x435445=_['groupBy'](_0x3f2572,_0x1f6256);if(_0x4bb68f==='mail'){return db[_0xb361('0x95')][_0xb361('0x96')]({'attributes':[_0xb361('0x97')],'raw':!![]});}})[_0xb361('0x5b')](function(_0x56a572){var _0x3f6d0f=_0x56a572?_0x56a572['enableEmailPreview']:undefined;var _0x113a05=_0xcf6475[_0xb361('0x15')](function(_0x598f8e){return updateInteraction(_0x598f8e,_0x1df50a,_0x435445,_0x3f6d0f);});return Promise[_0xb361('0x98')](_0x113a05);});}function countFilteredInteractions(_0x19a63d,_0x460c47){var _0x50fd2a=_0x19a63d[_0xb361('0x99')]();_0x50fd2a[_0xb361('0x10')]('COUNT(*)');_0x50fd2a[_0xb361('0x10')](_0xb361('0x73'),_0xb361('0x43'));var _0x26cb04=utils[_0xb361('0x23')](_0x460c47);if(!_[_0xb361('0x9a')](_0x26cb04)){_0x50fd2a['where'](_0xb361('0x9b'),_0x26cb04);}var _0x4ef152={'type':db[_0xb361('0x6b')][_0xb361('0x6c')][_0xb361('0x6d')],'raw':!![]};return db['sequelize']['query'](_0x50fd2a[_0xb361('0x70')](),_0x4ef152);}module['exports']={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery}; \ No newline at end of file +var _0xfd00=['length','where','\x20IN\x20?','getInteractionsTables','interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','accounts','a.id\x20=\x20i.','messages','interactionsTags','it.','\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','getSelectedTags','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','unreadMessages\x20{OPERATOR}\x200','replace','{OPERATOR}','isNumeric','sms','includes','i.phone\x20LIKE\x20?','fax','i.fax\x20LIKE\x20?','openchannel','i.from\x20LIKE\x20?','mail','isEmail','getFullTextValue','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','sqlOperator','conditions','find','buildExpression','type','value','start','end','unreadMessages','read','and','operator','$substring','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','contact','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','text','Tag','tags','clause','ids','User','user','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','keys','map','compact','forEach','concat','createdAt','parse','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','then','tag','filter','get','capitalize','chat','Accounts','resolve','search','\x20IS\x20NULL','\x20IS\x20NOT\x20NULL','i.thirdDisposition','i.secondDisposition','i.disposition','unshift','closed','i.substatus','shift','getInteractionFK','Interaction','SELECT','sequelize','query','toString','keyBy','merge','fields','attributes','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','a.email','Account.email','i.id','i.updatedAt','i.closed','i.closedAt','i.lastMsgAt','i.lastMsgDirection','i.subject','i.ContactId','i.UserId','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','Contact.fax','o.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','limit','offset','groupBy','findOne','enableEmailPreview','all','clone','COUNT(*)','isEmpty','t.id\x20IN\x20?','lodash','squel','./update-interaction','updateInteraction','./utils','getAccountFK','role','agent','select','field','name','color','tools_tags','user_has_','u.id','u.fullname','ui.','from','left_join','u.id\x20=\x20ui.UserId'];(function(_0x25abea,_0x395d0f){var _0x26ea45=function(_0x4605f7){while(--_0x4605f7){_0x25abea['push'](_0x25abea['shift']());}};_0x26ea45(++_0x395d0f);}(_0xfd00,0x12e));var _0x0fd0=function(_0x19e769,_0xbb18dd){_0x19e769=_0x19e769-0x0;var _0x3b8913=_0xfd00[_0x19e769];return _0x3b8913;};'use strict';var _=require(_0x0fd0('0x0'));var squel=require(_0x0fd0('0x1'));var as=require('../parsers/advancedSearch');var qs=require('../parsers/qs');var updateInteraction=require(_0x0fd0('0x2'))[_0x0fd0('0x3')];var utils=require(_0x0fd0('0x4'));var db=require('../../mysqldb')['db'];function skipInteractionsQuery(_0x20212f,_0x21d817,_0x476dbd){var _0x18dcce=![];var _0x342b7e=utils[_0x0fd0('0x5')](_0x20212f);if(_0x21d817[_0x0fd0('0x6')]===_0x0fd0('0x7')&&!_0x476dbd['search']&&!_0x476dbd[_0x342b7e]){_0x18dcce=!![];}return _0x18dcce;}function getTagsQuery(){return squel[_0x0fd0('0x8')]()[_0x0fd0('0x9')]('id')[_0x0fd0('0x9')](_0x0fd0('0xa'))[_0x0fd0('0x9')](_0x0fd0('0xb'))['from'](_0x0fd0('0xc'));}function getUsersQuery(_0x64cdbe,_0x4aebfc){var _0x541d93=utils['getInteractionFK'](_0x64cdbe);var _0x29525d=_0x0fd0('0xd')+_0x64cdbe+'_interactions';var _0x5d6d6b=squel[_0x0fd0('0x8')]()['field'](_0x0fd0('0xe'))[_0x0fd0('0x9')](_0x0fd0('0xf'))[_0x0fd0('0x9')](_0x0fd0('0x10')+_0x541d93)[_0x0fd0('0x11')](_0x29525d,'ui')[_0x0fd0('0x12')]('users','u',_0x0fd0('0x13'));if(_0x4aebfc[_0x0fd0('0x14')]>0x0){_0x5d6d6b[_0x0fd0('0x15')](_0x0fd0('0x10')+_0x541d93+_0x0fd0('0x16'),_['map'](_0x4aebfc,'id'));}return _0x5d6d6b;}function getInteractionsQuery(_0x4e8124){var _0x3dde93=utils[_0x0fd0('0x17')](_0x4e8124);var _0x8db7b7=utils[_0x0fd0('0x5')](_0x4e8124);var _0x10ed08=utils['getInteractionFK'](_0x4e8124);return squel[_0x0fd0('0x8')]()['from'](_0x3dde93[_0x0fd0('0x18')],'i')['left_join'](_0x0fd0('0x19'),'c',_0x0fd0('0x1a'))['left_join'](_0x0fd0('0x1b'),'o',_0x0fd0('0x1c'))[_0x0fd0('0x12')](_0x3dde93[_0x0fd0('0x1d')],'a',_0x0fd0('0x1e')+_0x8db7b7)[_0x0fd0('0x12')](_0x3dde93[_0x0fd0('0x1f')],'me','me.'+_0x10ed08+'\x20=\x20i.id')[_0x0fd0('0x12')](_0x3dde93[_0x0fd0('0x20')],'it',_0x0fd0('0x21')+_0x10ed08+_0x0fd0('0x22'))[_0x0fd0('0x12')](_0x0fd0('0xc'),'t',_0x0fd0('0x23'));}function getSqlClauses(){var _0x11664b={'body':squel['expr'](),'contact':squel[_0x0fd0('0x24')](),'default':squel[_0x0fd0('0x24')](),'fields':squel[_0x0fd0('0x24')](),'filter':squel['expr'](),'read':squel[_0x0fd0('0x24')](),'tags':{'clause':squel[_0x0fd0('0x24')](),'ids':null},'user':squel[_0x0fd0('0x24')]()};return _0x11664b;}function parseTagParameter(_0x2f3131){var _0x106b98=squel[_0x0fd0('0x24')]();if(_0x2f3131){var _0x5c5a82=utils[_0x0fd0('0x25')](_0x2f3131);_0x5c5a82['forEach'](function(_0x48563d){_0x106b98['or'](_0x0fd0('0x26'),'%,'+_0x48563d+',%');});}return _0x106b98;}function parseReadParameter(_0x424a4f){var _0x31dfef='';if(_0x424a4f){_0x31dfef=_0x0fd0('0x27');if(_0x424a4f==='1'){_0x31dfef=_0x31dfef[_0x0fd0('0x28')]('{OPERATOR}','=');}else{_0x31dfef=_0x31dfef[_0x0fd0('0x28')](_0x0fd0('0x29'),'>');}}return _0x31dfef;}function parseSearchFilter(_0x49b958,_0x2d60bc){var _0x40995c=squel[_0x0fd0('0x24')]();if(_0x2d60bc){var _0x5434b1=_0x2d60bc['replace']('\x5c','\x5c\x5c')[_0x0fd0('0x28')](/'/g,'\x27\x27');if(qs[_0x0fd0('0x2a')](_0x5434b1)){_0x40995c['or']('i.id\x20LIKE\x20?',_0x5434b1+'%');if([_0x0fd0('0x2b'),'whatsapp'][_0x0fd0('0x2c')](_0x49b958)){_0x40995c['or'](_0x0fd0('0x2d'),_0x5434b1+'%');}else if(_0x49b958===_0x0fd0('0x2e')){_0x40995c['or'](_0x0fd0('0x2f'),_0x5434b1+'%');}else if(_0x49b958===_0x0fd0('0x30')){_0x40995c['or'](_0x0fd0('0x31'),_0x5434b1+'%');}}else if(_0x49b958===_0x0fd0('0x32')&&qs[_0x0fd0('0x33')](_0x5434b1)){_0x40995c['or']('c.email\x20LIKE\x20?',_0x5434b1+'%');}else{if(_0x49b958===_0x0fd0('0x32')){_0x40995c['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x5434b1,!![]))['or']('MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x0fd0('0x34')](_0x5434b1));}else if(_0x49b958!==_0x0fd0('0x2e')){_0x40995c['or'](_0x0fd0('0x35'),qs[_0x0fd0('0x34')](_0x5434b1));}_0x40995c['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x0fd0('0x34')](_0x5434b1,!![]),null);}}return _0x40995c;}function parseAdvancedSearchFilter(_0x495d30,_0x1f6828){var _0x594324=getSqlClauses();var _0x4229bd=as['parseSearch'](_0x495d30);var _0x53e13a=_0x4229bd[_0x0fd0('0x36')];for(var _0x2c5e70=0x0;_0x2c5e70<_0x4229bd[_0x0fd0('0x37')][_0x0fd0('0x14')];_0x2c5e70++){var _0x1cd9c2=_0x4229bd[_0x0fd0('0x37')][_0x2c5e70];var _0x2b30ee='i';var _0x29f3d0=_[_0x0fd0('0x38')](_0x1f6828,[_0x0fd0('0xa'),_0x1cd9c2[_0x0fd0('0x9')]]);if(_0x29f3d0){var _0xaa7efb=as[_0x0fd0('0x39')](_0x2b30ee,_0x29f3d0[_0x0fd0('0x3a')],_0x1cd9c2);_0x594324['default'][_0x53e13a](_0xaa7efb['text'],_0xaa7efb[_0x0fd0('0x3b')][_0x0fd0('0x3c')],_0xaa7efb[_0x0fd0('0x3b')][_0x0fd0('0x3d')]);}else{switch(_0x1cd9c2['field']){case _0x0fd0('0x3e'):var _0x5197a8=parseReadParameter(_0x1cd9c2[_0x0fd0('0x3b')]);_0x594324[_0x0fd0('0x3f')][_0x0fd0('0x40')](_0x5197a8);break;case'Contact':if(_0x1cd9c2[_0x0fd0('0x41')]===_0x0fd0('0x42')){if(_0x1cd9c2[_0x0fd0('0x3b')][_0x0fd0('0x43')]('\x20')['length']>0x1){_0x594324['contact'][_0x53e13a](_0x0fd0('0x44'),qs[_0x0fd0('0x34')](_0x1cd9c2['value'],!![]),null);}else{var _0x57829d='%'+_0x1cd9c2['value']+'%';_0x594324[_0x0fd0('0x45')][_0x53e13a](_0x0fd0('0x46'),_0x57829d,_0x57829d,_0x57829d);}}else{_0x29f3d0=_[_0x0fd0('0x38')](_0x1f6828,['name',_0x0fd0('0x47')]);_0x1cd9c2['field']='ContactId';_0xaa7efb=as[_0x0fd0('0x39')](_0x2b30ee,_0x29f3d0[_0x0fd0('0x3a')],_0x1cd9c2);_0x594324[_0x0fd0('0x45')][_0x53e13a](_0xaa7efb[_0x0fd0('0x48')],_0xaa7efb['value']['start'],_0xaa7efb[_0x0fd0('0x3b')]['end']);}break;case _0x0fd0('0x49'):var _0x5524cc=_0x1cd9c2[_0x0fd0('0x3b')][_0x0fd0('0x43')](',')['map'](function(_0x2d403c){return Number(_0x2d403c);});var _0x427fb8=parseTagParameter(_0x5524cc);_0x594324[_0x0fd0('0x4a')][_0x0fd0('0x4b')][_0x0fd0('0x40')](_0x427fb8);_0x594324[_0x0fd0('0x4a')][_0x0fd0('0x4c')]=_0x5524cc;break;case _0x0fd0('0x4d'):if(_0x1cd9c2[_0x0fd0('0x41')]===_0x0fd0('0x42')){_0x594324[_0x0fd0('0x4e')][_0x53e13a](_0x0fd0('0x4f'),'%'+_0x1cd9c2['value']+'%',null);}else{_0x29f3d0=_[_0x0fd0('0x38')](_0x1f6828,['name','UserId']);_0x1cd9c2[_0x0fd0('0x9')]='UserId';_0xaa7efb=as[_0x0fd0('0x39')](_0x2b30ee,_0x29f3d0[_0x0fd0('0x3a')],_0x1cd9c2);_0x594324[_0x0fd0('0x4e')][_0x53e13a](_0xaa7efb['text'],_0xaa7efb[_0x0fd0('0x3b')][_0x0fd0('0x3c')],_0xaa7efb['value'][_0x0fd0('0x3d')]);}break;case _0x0fd0('0x50'):case'plainBody':_0xaa7efb=as['buildExpression']('me',null,_0x1cd9c2);_0x594324['body'][_0x53e13a](_0xaa7efb['text'],_0xaa7efb[_0x0fd0('0x3b')][_0x0fd0('0x3c')],_0xaa7efb['value'][_0x0fd0('0x3d')]);break;}}}return _0x594324;}function parseModelFields(_0x478dd6,_0x4b39b7,_0x25f9a4){var _0x2d8350=utils['getAccountFK'](_0x478dd6);var _0x2d88ab=squel['expr']();var _0x29d01b=_(_0x4b39b7)[_0x0fd0('0x51')]()[_0x0fd0('0x52')](function(_0x512390){return _['some'](_0x25f9a4,[_0x0fd0('0xa'),_0x512390])?_0x512390:undefined;})[_0x0fd0('0x53')]()[_0x0fd0('0x3b')]();if(_0x29d01b[_0x0fd0('0x14')]>0x0){_0x29d01b[_0x0fd0('0x54')](function(_0x56dbaf){if(_0x56dbaf===_0x2d8350){_0x2d88ab[_0x0fd0('0x40')]('i.'+_0x2d8350+_0x0fd0('0x16'),[][_0x0fd0('0x55')](_0x4b39b7[_0x56dbaf]));}else if(_0x56dbaf===_0x0fd0('0x56')){var _0x5d2656=JSON['parse'](_0x4b39b7[_0x56dbaf])['$gte'];var _0x4bb5af=JSON[_0x0fd0('0x57')](_0x4b39b7[_0x56dbaf])['$lte'];_0x2d88ab[_0x0fd0('0x40')](_0x0fd0('0x58'),_0x5d2656,_0x4bb5af);}else{if(_0x4b39b7[_0x56dbaf]===_0x0fd0('0x59')){_0x2d88ab['and']('i.'+_0x56dbaf+'\x20IS\x20NULL');}else{_0x2d88ab[_0x0fd0('0x40')]('i.'+_0x56dbaf+_0x0fd0('0x5a'),_0x4b39b7[_0x56dbaf]);}}});}return _0x2d88ab;}function parseQueryParameters(_0x12395e,_0x5d0ee7,_0x1f4c9f){var _0x29e283=getSqlClauses();return Promise['resolve']()[_0x0fd0('0x5b')](function(){return parseModelFields(_0x12395e,_0x5d0ee7,_0x1f4c9f);})['then'](function(_0x97be57){_0x29e283['fields'][_0x0fd0('0x40')](_0x97be57);return parseReadParameter(_0x5d0ee7[_0x0fd0('0x3f')]);})[_0x0fd0('0x5b')](function(_0x39df1f){_0x29e283[_0x0fd0('0x3f')][_0x0fd0('0x40')](_0x39df1f);return parseTagParameter(_0x5d0ee7[_0x0fd0('0x5c')]);})[_0x0fd0('0x5b')](function(_0x16cb30){_0x29e283[_0x0fd0('0x4a')][_0x0fd0('0x4b')][_0x0fd0('0x40')](_0x16cb30);return parseSearchFilter(_0x12395e,_0x5d0ee7['filter']);})[_0x0fd0('0x5b')](function(_0x41e1f6){_0x29e283[_0x0fd0('0x5d')]=_0x41e1f6;return _0x29e283;});}function checkAccountsRestrictions(_0x1b95a8,_0x4594df,_0x333d4f){var _0xee1bf8=utils['getAccountFK'](_0x1b95a8);var _0x37edf0=_0x0fd0('0x5e')+_[_0x0fd0('0x5f')](_0x1b95a8)+(_0x1b95a8===_0x0fd0('0x60')?'Websites':_0x0fd0('0x61'));var _0x26d573=squel['expr']();return Promise[_0x0fd0('0x62')]()[_0x0fd0('0x5b')](function(){if(_0x333d4f[_0x0fd0('0x63')]&&_0x4594df[_0x0fd0('0x6')]===_0x0fd0('0x7')){return _0x4594df[_0x37edf0]({'attributes':['id'],'raw':!![]});}})[_0x0fd0('0x5b')](function(_0xc11c17){if(_0xc11c17){if(_0xc11c17[_0x0fd0('0x14')]===0x0){_0x26d573[_0x0fd0('0x40')]('i.'+_0xee1bf8+_0x0fd0('0x64'));}else{_0x26d573[_0x0fd0('0x40')]('i.'+_0xee1bf8+_0x0fd0('0x16'),_['map'](_0xc11c17,'id'));}}else if(!_0x333d4f[_0xee1bf8]){_0x26d573['and']('i.'+_0xee1bf8+_0x0fd0('0x65'));}})['then'](function(){return _0x26d573;});}function getClosedOrderClause(_0xde2dfe,_0x203c4f){var _0x248b9a='';var _0x17be6b=[_0x0fd0('0x66'),_0x0fd0('0x67'),_0x0fd0('0x68')];if(_0xde2dfe===_0x0fd0('0x32')){_0x17be6b[_0x0fd0('0x69')]('i.substatus');}if(_0x203c4f[_0x0fd0('0x6a')]==='0'&&_0xde2dfe===_0x0fd0('0x32')){_0x248b9a=_0x0fd0('0x6b');}else{if(_0x203c4f[_0x0fd0('0x6a')]==='1'){_0x17be6b[_0x0fd0('0x6c')]();}_0x248b9a='CONCAT_WS(\x27\x27,\x20'+_0x17be6b['join'](',\x20')+')';}return _0x248b9a;}function getFilteredInteractions(_0x23d49e,_0x38d224,_0x136feb,_0x1ea38f){var _0x51abb4=utils[_0x0fd0('0x6d')](_0x23d49e);var _0x4111ba=_[_0x0fd0('0x5f')](_0x23d49e)+_0x0fd0('0x6e');var _0x2cfde0=[];var _0x1555fd=getTagsQuery();var _0x1c360e={'type':db['Sequelize']['QueryTypes'][_0x0fd0('0x6f')],'raw':!![]};var _0x44b194=[];var _0x523758=[];return db[_0x0fd0('0x70')][_0x0fd0('0x71')](_0x1555fd[_0x0fd0('0x72')](),_0x1c360e)[_0x0fd0('0x5b')](function(_0x167657){_0x2cfde0=_[_0x0fd0('0x73')](_0x167657,'id');_0x1c360e=_[_0x0fd0('0x74')](_0x1c360e,{'model':db[_0x4111ba],'mapToModel':!![],'nest':!![]});if(_0x136feb[_0x0fd0('0x75')]){_0x1ea38f[_0x0fd0('0x76')][_0x0fd0('0x54')](function(_0x140378){_0x38d224['field']('i.'+_0x140378);});}else{_0x38d224[_0x0fd0('0x9')](_0x0fd0('0x77'),_0x0fd0('0x3e'));_0x38d224[_0x0fd0('0x9')]('a.key',_0x0fd0('0x78'));_0x38d224[_0x0fd0('0x9')](_0x0fd0('0x79'),_0x0fd0('0x7a'));if(_0x23d49e===_0x0fd0('0x32')){_0x38d224[_0x0fd0('0x9')](_0x0fd0('0x7b'),_0x0fd0('0x7c'));_0x38d224[_0x0fd0('0x9')]('CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201))\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName');_0x38d224[_0x0fd0('0x9')](_0x0fd0('0x7d'));_0x38d224['field']('i.createdAt');_0x38d224[_0x0fd0('0x9')](_0x0fd0('0x7e'));_0x38d224[_0x0fd0('0x9')](_0x0fd0('0x7f'));_0x38d224[_0x0fd0('0x9')](_0x0fd0('0x80'));_0x38d224[_0x0fd0('0x9')]('i.attach');_0x38d224[_0x0fd0('0x9')](_0x0fd0('0x81'));_0x38d224[_0x0fd0('0x9')](_0x0fd0('0x82'));_0x38d224[_0x0fd0('0x9')](_0x0fd0('0x83'));_0x38d224[_0x0fd0('0x9')]('i.disposition');_0x38d224['field'](_0x0fd0('0x67'));_0x38d224[_0x0fd0('0x9')]('i.thirdDisposition');_0x38d224['field']('i.substatus');_0x38d224[_0x0fd0('0x9')]('i.to');_0x38d224['field'](_0x0fd0('0x84'));_0x38d224[_0x0fd0('0x9')]('i.MailAccountId');_0x38d224['field'](_0x0fd0('0x85'));}else if(_0x23d49e===_0x0fd0('0x30')){_0x38d224[_0x0fd0('0x9')](_0x0fd0('0x86'),_0x0fd0('0x87'));}else{_0x38d224[_0x0fd0('0x9')](_0x0fd0('0x88'),_0x0fd0('0x87'));}if(_0x23d49e!=='mail'){_0x38d224[_0x0fd0('0x9')](_0x0fd0('0x89'));}_0x38d224[_0x0fd0('0x9')](_0x0fd0('0x8a'),_0x0fd0('0x8b'));_0x38d224[_0x0fd0('0x9')](_0x0fd0('0x8c'),_0x0fd0('0x8d'));_0x38d224[_0x0fd0('0x9')]('c.email',_0x0fd0('0x8e'));_0x38d224['field'](_0x0fd0('0x8f'),_0x0fd0('0x90'));_0x38d224[_0x0fd0('0x9')](_0x0fd0('0x91'),'Contact.mobile');_0x38d224[_0x0fd0('0x9')]('c.fax',_0x0fd0('0x92'));_0x38d224[_0x0fd0('0x9')](_0x0fd0('0x93'),'Owner.fullname');_0x38d224['field'](_0x0fd0('0x94'),'Owner.internal');_0x38d224[_0x0fd0('0x9')](_0x0fd0('0x95'),_0x0fd0('0x96'));}if(_0x1ea38f['limit']){_0x38d224[_0x0fd0('0x97')](_0x1ea38f[_0x0fd0('0x97')]);}if(_0x1ea38f['offset']){_0x38d224[_0x0fd0('0x98')](_0x1ea38f['offset']);}return db[_0x0fd0('0x70')][_0x0fd0('0x71')](_0x38d224[_0x0fd0('0x72')](),_0x1c360e);})[_0x0fd0('0x5b')](function(_0x419494){_0x44b194=_0x419494;var _0x49417e=getUsersQuery(_0x23d49e,_0x44b194);return db[_0x0fd0('0x70')][_0x0fd0('0x71')](_0x49417e['toString'](),_0x1c360e);})[_0x0fd0('0x5b')](function(_0x599ab9){_0x523758=_[_0x0fd0('0x99')](_0x599ab9,_0x51abb4);if(_0x23d49e===_0x0fd0('0x32')){return db['Setting'][_0x0fd0('0x9a')]({'attributes':[_0x0fd0('0x9b')],'raw':!![]});}})[_0x0fd0('0x5b')](function(_0x252b87){var _0x328ee3=_0x252b87?_0x252b87[_0x0fd0('0x9b')]:undefined;var _0x13db56=_0x44b194['map'](function(_0x1008f8){return updateInteraction(_0x1008f8,_0x2cfde0,_0x523758,_0x328ee3);});return Promise[_0x0fd0('0x9c')](_0x13db56);});}function countFilteredInteractions(_0x346437,_0xbe1bc9){var _0x5c12b2=_0x346437[_0x0fd0('0x9d')]();_0x5c12b2[_0x0fd0('0x9')](_0x0fd0('0x9e'));_0x5c12b2[_0x0fd0('0x9')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x0fd0('0x3e'));var _0x27a8dd=utils[_0x0fd0('0x25')](_0xbe1bc9);if(!_[_0x0fd0('0x9f')](_0x27a8dd)){_0x5c12b2[_0x0fd0('0x15')](_0x0fd0('0xa0'),_0x27a8dd);}var _0x3ff9e4={'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]};return db[_0x0fd0('0x70')][_0x0fd0('0x71')](_0x5c12b2[_0x0fd0('0x72')](),_0x3ff9e4);}module['exports']={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery}; \ No newline at end of file diff --git a/server/components/interaction/update-interaction.js b/server/components/interaction/update-interaction.js index 81459e1..4db9c0c 100644 --- a/server/components/interaction/update-interaction.js +++ b/server/components/interaction/update-interaction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0d25=['unmanaged','total','closed','disposition','abandoned','UserId','MailMessage','out','plainBody','-id','lastMsgText','trimStart','catch','updateInteraction','then','TagIds','map','fullname','split','forEach','waiting','answered'];(function(_0x5272d7,_0x38d560){var _0x38d8d3=function(_0x4bbd2f){while(--_0x4bbd2f){_0x5272d7['push'](_0x5272d7['shift']());}};_0x38d8d3(++_0x38d560);}(_0x0d25,0xaa));var _0x50d2=function(_0x582b0f,_0x35a9de){_0x582b0f=_0x582b0f-0x0;var _0x4658f0=_0x0d25[_0x582b0f];return _0x4658f0;};'use strict';var _=require('lodash');var db=require('../../mysqldb')['db'];function getInteractionUsers(_0x57d56b,_0x2c8796){return new Promise(function(_0x2677af,_0x411f1a){try{var _0x54c5e7=[];if(_0x2c8796[_0x57d56b]){_0x54c5e7=_0x2c8796[_0x57d56b][_0x50d2('0x0')](function(_0x56690a){return{'id':_0x56690a['id'],'fullname':_0x56690a[_0x50d2('0x1')]};});}return _0x2677af(_0x54c5e7);}catch(_0x3f72fa){_0x411f1a(_0x3f72fa);}});}function getInteractionTags(_0x550989,_0x49df6b){var _0x289a4f=[];if(_0x550989){_0x550989[_0x50d2('0x2')](',')[_0x50d2('0x3')](function(_0x17a3a0){_0x289a4f['push'](_0x49df6b[_0x17a3a0]);});}return _0x289a4f;}function updateWaitingCounter(_0x17ef45){if(_0x17ef45['waiting']){_0x17ef45[_0x50d2('0x4')]-=0x1;}}function updateInteractionCounters(_0x3ab32b){_0x3ab32b[_0x50d2('0x4')]=0x0;_0x3ab32b['talking']=0x0;_0x3ab32b[_0x50d2('0x5')]=0x0;_0x3ab32b[_0x50d2('0x6')]=0x0;_0x3ab32b['abandoned']=0x0;_0x3ab32b[_0x50d2('0x7')]=0x0;if(_0x3ab32b[_0x50d2('0x8')]){if(_0x3ab32b[_0x50d2('0x9')]===_0x50d2('0xa')){_0x3ab32b['abandoned']+=0x1;updateWaitingCounter(_0x3ab32b);}if(_0x3ab32b[_0x50d2('0xb')]){_0x3ab32b[_0x50d2('0x5')]+=0x1;if(_0x3ab32b['talking']){_0x3ab32b['talking']-=0x1;}}else{if(_0x3ab32b[_0x50d2('0x9')]){_0x3ab32b[_0x50d2('0x6')]+=0x1;updateWaitingCounter(_0x3ab32b);}}}else{if(!_0x3ab32b['UserId']){_0x3ab32b[_0x50d2('0x4')]+=0x1;}if(_0x3ab32b['UserId']){_0x3ab32b['talking']+=0x1;updateWaitingCounter(_0x3ab32b);}}_0x3ab32b[_0x50d2('0x7')]+=0x1;return _0x3ab32b;}function getLastMessageText(_0x61fc21){return db[_0x50d2('0xc')]['findOne']({'where':{'$and':[{'MailInteractionId':_0x61fc21['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x50d2('0xd')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x50d2('0xe')],'order':_0x50d2('0xf'),'raw':!![]})['then'](function(_0x1a7127){if(_0x1a7127&&_0x1a7127[_0x50d2('0xe')]){_0x61fc21[_0x50d2('0x10')]=_[_0x50d2('0x11')](_0x1a7127[_0x50d2('0xe')]);}return _0x61fc21;})[_0x50d2('0x12')](function(_0x3088e8){throw _0x3088e8;});}exports[_0x50d2('0x13')]=function(_0x160cd1,_0x4f7a78,_0x3a7954,_0x487751){return new Promise(function(_0x45947a,_0x51c90f){return getInteractionUsers(_0x160cd1['id'],_0x3a7954)[_0x50d2('0x14')](function(_0x2c0739){_0x160cd1['Users']=_0x2c0739;return getInteractionTags(_0x160cd1['TagIds'],_0x4f7a78);})[_0x50d2('0x14')](function(_0x22300a){_0x160cd1['Tags']=_0x22300a;delete _0x160cd1[_0x50d2('0x15')];return updateInteractionCounters(_0x160cd1);})['then'](function(_0x18d9c3){if(_0x487751){return getLastMessageText(_0x18d9c3);}else{return _0x18d9c3;}})[_0x50d2('0x14')](function(_0x4c55cf){_0x45947a(_0x4c55cf);})['catch'](function(_0x5a36f9){_0x51c90f(_0x5a36f9);});});}; \ No newline at end of file +var _0xa45a=['total','closed','disposition','UserId','findOne','plainBody','-id','updateInteraction','then','Users','TagIds','Tags','catch','lodash','../../mysqldb','map','fullname','split','forEach','waiting','talking','answered','unmanaged','abandoned'];(function(_0x53a453,_0xfbe94d){var _0x4ba28b=function(_0x10c1b9){while(--_0x10c1b9){_0x53a453['push'](_0x53a453['shift']());}};_0x4ba28b(++_0xfbe94d);}(_0xa45a,0x145));var _0xaa45=function(_0x64d881,_0x1e95b0){_0x64d881=_0x64d881-0x0;var _0x53eb8f=_0xa45a[_0x64d881];return _0x53eb8f;};'use strict';var _=require(_0xaa45('0x0'));var db=require(_0xaa45('0x1'))['db'];function getInteractionUsers(_0x38e74,_0x3a84fc){return new Promise(function(_0x586f95,_0xe64234){try{var _0x40bf97=[];if(_0x3a84fc[_0x38e74]){_0x40bf97=_0x3a84fc[_0x38e74][_0xaa45('0x2')](function(_0x44f0ac){return{'id':_0x44f0ac['id'],'fullname':_0x44f0ac[_0xaa45('0x3')]};});}return _0x586f95(_0x40bf97);}catch(_0xc3be8e){_0xe64234(_0xc3be8e);}});}function getInteractionTags(_0x3598c2,_0x172c92){var _0x2be6c6=[];if(_0x3598c2){_0x3598c2[_0xaa45('0x4')](',')[_0xaa45('0x5')](function(_0x5cdbb9){_0x2be6c6['push'](_0x172c92[_0x5cdbb9]);});}return _0x2be6c6;}function updateWaitingCounter(_0x5eb04f){if(_0x5eb04f[_0xaa45('0x6')]){_0x5eb04f[_0xaa45('0x6')]-=0x1;}}function updateInteractionCounters(_0x16541b){_0x16541b[_0xaa45('0x6')]=0x0;_0x16541b[_0xaa45('0x7')]=0x0;_0x16541b[_0xaa45('0x8')]=0x0;_0x16541b[_0xaa45('0x9')]=0x0;_0x16541b[_0xaa45('0xa')]=0x0;_0x16541b[_0xaa45('0xb')]=0x0;if(_0x16541b[_0xaa45('0xc')]){if(_0x16541b[_0xaa45('0xd')]===_0xaa45('0xa')){_0x16541b[_0xaa45('0xa')]+=0x1;updateWaitingCounter(_0x16541b);}if(_0x16541b[_0xaa45('0xe')]){_0x16541b[_0xaa45('0x8')]+=0x1;if(_0x16541b[_0xaa45('0x7')]){_0x16541b['talking']-=0x1;}}else{if(_0x16541b['disposition']){_0x16541b[_0xaa45('0x9')]+=0x1;updateWaitingCounter(_0x16541b);}}}else{if(!_0x16541b[_0xaa45('0xe')]){_0x16541b[_0xaa45('0x6')]+=0x1;}if(_0x16541b['UserId']){_0x16541b[_0xaa45('0x7')]+=0x1;updateWaitingCounter(_0x16541b);}}_0x16541b[_0xaa45('0xb')]+=0x1;return _0x16541b;}function getLastMessageText(_0x2d5b75){return db['MailMessage'][_0xaa45('0xf')]({'where':{'$and':[{'MailInteractionId':_0x2d5b75['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':'out'},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0xaa45('0x10')],'order':_0xaa45('0x11'),'raw':!![]})['then'](function(_0x2f243c){if(_0x2f243c&&_0x2f243c[_0xaa45('0x10')]){_0x2d5b75['lastMsgText']=_['trimStart'](_0x2f243c[_0xaa45('0x10')]);}return _0x2d5b75;})['catch'](function(_0x6cf2d6){throw _0x6cf2d6;});}exports[_0xaa45('0x12')]=function(_0x380a8d,_0x260505,_0x5051e5,_0x54b471){return new Promise(function(_0x574b16,_0x52ee44){return getInteractionUsers(_0x380a8d['id'],_0x5051e5)[_0xaa45('0x13')](function(_0x45312a){_0x380a8d[_0xaa45('0x14')]=_0x45312a;return getInteractionTags(_0x380a8d[_0xaa45('0x15')],_0x260505);})[_0xaa45('0x13')](function(_0x50f4dd){_0x380a8d[_0xaa45('0x16')]=_0x50f4dd;delete _0x380a8d['TagIds'];return updateInteractionCounters(_0x380a8d);})[_0xaa45('0x13')](function(_0x2037df){if(_0x54b471){return getLastMessageText(_0x2037df);}else{return _0x2037df;}})[_0xaa45('0x13')](function(_0xaa106b){_0x574b16(_0xaa106b);})[_0xaa45('0x17')](function(_0x2da25a){_0x52ee44(_0x2da25a);});});}; \ No newline at end of file diff --git a/server/components/interaction/utils.js b/server/components/interaction/utils.js index b4d87d5..526b733 100644 --- a/server/components/interaction/utils.js +++ b/server/components/interaction/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6173=['websites','accounts','_interactions','_messages','isArray','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','stringify','Interaction','findOne','then','update','info','catch','error','exports','lodash','../../mysqldb','../../config/logger','mail-interactions','fax-interactions','sms-interactions','chat-interactions','whatsapp-interactions','capitalize','chat','Website','InteractionId','upperFirst','unknown'];(function(_0x5ca1f9,_0x1e6994){var _0x5b4198=function(_0x7a2737){while(--_0x7a2737){_0x5ca1f9['push'](_0x5ca1f9['shift']());}};_0x5b4198(++_0x1e6994);}(_0x6173,0x92));var _0x3617=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x6173[_0x53ccf2];return _0x5a2964;};'use strict';var _=require(_0x3617('0x0'));var db=require(_0x3617('0x1'))['db'];var loggers={'openchannel':require(_0x3617('0x2'))('openchannel-interactions'),'mail':require(_0x3617('0x2'))(_0x3617('0x3')),'fax':require(_0x3617('0x2'))(_0x3617('0x4')),'sms':require('../../config/logger')(_0x3617('0x5')),'chat':require(_0x3617('0x2'))(_0x3617('0x6')),'whatsapp':require(_0x3617('0x2'))(_0x3617('0x7'))};function getAccountFK(_0x53e16d){return _[_0x3617('0x8')](_0x53e16d)+(_0x53e16d===_0x3617('0x9')?_0x3617('0xa'):'Account')+'Id';}function getInteractionFK(_0x683f43){return _[_0x3617('0x8')](_0x683f43)+_0x3617('0xb');}function getInteractionId(_0x8132a,_0x22ffa5,_0x542ecb){if(_0x8132a&&_0x8132a[_[_0x3617('0xc')](_0x542ecb)+'InteractionId']){return _0x8132a[_['upperFirst'](_0x542ecb)+_0x3617('0xb')];}else if(_0x8132a&&_0x8132a['id']){return _0x8132a['id'];}else if(_0x22ffa5&&_0x22ffa5['id']){return _0x22ffa5['id'];}else{return _0x3617('0xd');}}function getInteractionsTables(_0x12f3a9){return{'accounts':_0x12f3a9+'_'+(_0x12f3a9===_0x3617('0x9')?_0x3617('0xe'):_0x3617('0xf')),'interactions':_0x12f3a9+_0x3617('0x10'),'interactionsTags':_0x12f3a9+'_interaction_has_tags','messages':_0x12f3a9+_0x3617('0x11'),'userInteractions':'user_has_'+_0x12f3a9+_0x3617('0x10')};}function getSelectedTags(_0x2b577c){var _0xbfe48e=[];if(_0x2b577c){_0xbfe48e=Array[_0x3617('0x12')](_0x2b577c)?_0x2b577c:[_0x2b577c];}return _0xbfe48e;}function log(_0x2134a6,_0x3622e0,_0x452066,_0x4ce116,_0x187ed9,_0x16a103){loggers[_0x187ed9['toLowerCase']()][_0x2134a6](_0x3617('0x13'),_0x16a103[_0x3617('0x14')](),_0x3622e0?_0x3622e0['id']:null,_0x3622e0?_0x3622e0[_0x3617('0x15')]:null,_0x3622e0?_0x3622e0[_0x3617('0x16')]:null,getInteractionId(_0x452066,_0x4ce116,_0x187ed9),_0x452066?JSON[_0x3617('0x17')](_0x452066):'null');}function updateUser(_0x250aeb,_0x637ecb,_0x43bfe7,_0xf13ebf,_0x15cdf0){db[_[_0x3617('0xc')](_0xf13ebf)+_0x3617('0x18')][_0x3617('0x19')]({'where':{'id':getInteractionId(_0x637ecb,_0x43bfe7,_0xf13ebf)}})[_0x3617('0x1a')](function(_0x5007ad){if(_0x5007ad){return _0x5007ad[_0x3617('0x1b')]({'UserId':_0x250aeb?_0x250aeb['id']:null});}})['then'](function(_0x25cb5d){if(_0x25cb5d){log(_0x3617('0x1c'),_0x250aeb,_0x637ecb,_0x43bfe7,_0xf13ebf,_0x15cdf0);}})[_0x3617('0x1d')](function(){log(_0x3617('0x1e'),_0x250aeb,_0x637ecb,_0x43bfe7,_0xf13ebf,_0x15cdf0);});}module[_0x3617('0x1f')]={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file +var _0x179c=['Website','Account','upperFirst','InteractionId','websites','accounts','_interaction_has_tags','_messages','user_has_','_interactions','isArray','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','stringify','null','Interaction','then','update','info','catch','error','exports','lodash','openchannel-interactions','mail-interactions','../../config/logger','chat-interactions','whatsapp-interactions','capitalize','chat'];(function(_0x461eaa,_0x5b9604){var _0x3f2756=function(_0xddf81a){while(--_0xddf81a){_0x461eaa['push'](_0x461eaa['shift']());}};_0x3f2756(++_0x5b9604);}(_0x179c,0x198));var _0xc179=function(_0x277107,_0x3420dc){_0x277107=_0x277107-0x0;var _0x1da046=_0x179c[_0x277107];return _0x1da046;};'use strict';var _=require(_0xc179('0x0'));var db=require('../../mysqldb')['db'];var loggers={'openchannel':require('../../config/logger')(_0xc179('0x1')),'mail':require('../../config/logger')(_0xc179('0x2')),'fax':require(_0xc179('0x3'))('fax-interactions'),'sms':require(_0xc179('0x3'))('sms-interactions'),'chat':require('../../config/logger')(_0xc179('0x4')),'whatsapp':require(_0xc179('0x3'))(_0xc179('0x5'))};function getAccountFK(_0x14b933){return _[_0xc179('0x6')](_0x14b933)+(_0x14b933===_0xc179('0x7')?_0xc179('0x8'):_0xc179('0x9'))+'Id';}function getInteractionFK(_0x4678d3){return _[_0xc179('0x6')](_0x4678d3)+'InteractionId';}function getInteractionId(_0x53dad7,_0x1d123e,_0x4f6139){if(_0x53dad7&&_0x53dad7[_[_0xc179('0xa')](_0x4f6139)+_0xc179('0xb')]){return _0x53dad7[_[_0xc179('0xa')](_0x4f6139)+_0xc179('0xb')];}else if(_0x53dad7&&_0x53dad7['id']){return _0x53dad7['id'];}else if(_0x1d123e&&_0x1d123e['id']){return _0x1d123e['id'];}else{return'unknown';}}function getInteractionsTables(_0x485af9){return{'accounts':_0x485af9+'_'+(_0x485af9==='chat'?_0xc179('0xc'):_0xc179('0xd')),'interactions':_0x485af9+'_interactions','interactionsTags':_0x485af9+_0xc179('0xe'),'messages':_0x485af9+_0xc179('0xf'),'userInteractions':_0xc179('0x10')+_0x485af9+_0xc179('0x11')};}function getSelectedTags(_0x3a54f2){var _0x301d94=[];if(_0x3a54f2){_0x301d94=Array[_0xc179('0x12')](_0x3a54f2)?_0x3a54f2:[_0x3a54f2];}return _0x301d94;}function log(_0x138e04,_0x56a300,_0xef7277,_0x2472dc,_0x496ea7,_0x565db0){loggers[_0x496ea7[_0xc179('0x13')]()][_0x138e04](_0xc179('0x14'),_0x565db0[_0xc179('0x15')](),_0x56a300?_0x56a300['id']:null,_0x56a300?_0x56a300[_0xc179('0x16')]:null,_0x56a300?_0x56a300['role']:null,getInteractionId(_0xef7277,_0x2472dc,_0x496ea7),_0xef7277?JSON[_0xc179('0x17')](_0xef7277):_0xc179('0x18'));}function updateUser(_0x176aa2,_0x5af16e,_0x3c837b,_0x38ebe2,_0x57c053){db[_[_0xc179('0xa')](_0x38ebe2)+_0xc179('0x19')]['findOne']({'where':{'id':getInteractionId(_0x5af16e,_0x3c837b,_0x38ebe2)}})[_0xc179('0x1a')](function(_0x2acbfd){if(_0x2acbfd){return _0x2acbfd[_0xc179('0x1b')]({'UserId':_0x176aa2?_0x176aa2['id']:null});}})[_0xc179('0x1a')](function(_0x358f39){if(_0x358f39){log(_0xc179('0x1c'),_0x176aa2,_0x5af16e,_0x3c837b,_0x38ebe2,_0x57c053);}})[_0xc179('0x1d')](function(){log(_0xc179('0x1e'),_0x176aa2,_0x5af16e,_0x3c837b,_0x38ebe2,_0x57c053);});}module[_0xc179('0x1f')]={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index 2807f23..fc45bed 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 _0x5421=['isUserLimit','crypto','util','../../mysqldb','../../config/environment','data1','license','split','createDecipher','update','utf8','parse','hasOwnProperty','use','findOne','then','status','Maximum\x20%s\x20limit\x20have\x20been\x20reached','User','admin','user'];(function(_0x26908d,_0x53033b){var _0x3709e6=function(_0x5c17d4){while(--_0x5c17d4){_0x26908d['push'](_0x26908d['shift']());}};_0x3709e6(++_0x53033b);}(_0x5421,0x1cf));var _0x1542=function(_0x33975c,_0x50d085){_0x33975c=_0x33975c-0x0;var _0x1c15ab=_0x5421[_0x33975c];return _0x1c15ab;};'use strict';var crypto=require(_0x1542('0x0'));var util=require(_0x1542('0x1'));var compose=require('composable-middleware');var db=require(_0x1542('0x2'))['db'];var config=require(_0x1542('0x3'));function getValueFromLicense(_0x30c7c6,_0x481450){if(_0x30c7c6&&_0x481450){if(_0x481450[_0x1542('0x4')]&&_0x481450[_0x1542('0x5')]){var _0x493eca=_0x481450[_0x1542('0x4')];var _0x37207f=_0x481450[_0x1542('0x5')];var _0x52a0a4=_0x493eca['split']('-')[0x4];var _0x4c8e0e=_0x493eca[_0x1542('0x6')]('-')[0x0];var _0x273f66=crypto[_0x1542('0x7')]('aes-256-ctr',util['format']('%s:%s:%s',_0x52a0a4,_0x493eca,_0x4c8e0e));var _0x4b87b2=_0x273f66[_0x1542('0x8')](_0x37207f,'base64','utf8');_0x4b87b2+=_0x273f66['final'](_0x1542('0x9'));var _0x32a948=JSON[_0x1542('0xa')](_0x4b87b2);return _0x32a948[_0x1542('0xb')](_0x30c7c6)?_0x32a948[_0x30c7c6]:null;}}return null;}function isLimit(_0x33ae3e,_0x153a6d,_0x497931,_0x4d5314){var _0x34cf23=_0x153a6d;return compose()[_0x1542('0xc')](function(_0x56fee8,_0x31978d,_0x1c891b){return db['License'][_0x1542('0xd')]({'where':{'id':0x1},'raw':!![]})[_0x1542('0xe')](function(_0x29b022){var _0x2ca432=getValueFromLicense(_0x33ae3e,_0x29b022);return _0x2ca432?_0x2ca432:_0x34cf23;})['then'](function(_0x219309){_0x34cf23=_0x219309;return _0x497931['count'](_0x4d5314);})['then'](function(_0x281377){if(_0x281377>=_0x34cf23){return _0x31978d[_0x1542('0xf')](0x193)['json']({'message':util['format'](_0x1542('0x10'),_0x33ae3e)});}_0x1c891b();})['catch'](function(_0x41a8b8){_0x1c891b(_0x41a8b8);});});}function isUserLimit(){return isLimit('users',0x1,db[_0x1542('0x11')],{'where':{'$or':[{'role':_0x1542('0x12')},{'role':_0x1542('0x13')}]}});}exports[_0x1542('0x14')]=isUserLimit; \ No newline at end of file +var _0xd6c6=['utf8','final','use','findOne','then','count','status','json','catch','users','User','admin','user','crypto','util','composable-middleware','../../mysqldb','../../config/environment','license','data1','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','base64'];(function(_0x5ad127,_0x47f978){var _0x25ef58=function(_0x43bb69){while(--_0x43bb69){_0x5ad127['push'](_0x5ad127['shift']());}};_0x25ef58(++_0x47f978);}(_0xd6c6,0x136));var _0x6d6c=function(_0x94c8e2,_0x4fe767){_0x94c8e2=_0x94c8e2-0x0;var _0x25b67c=_0xd6c6[_0x94c8e2];return _0x25b67c;};'use strict';var crypto=require(_0x6d6c('0x0'));var util=require(_0x6d6c('0x1'));var compose=require(_0x6d6c('0x2'));var db=require(_0x6d6c('0x3'))['db'];var config=require(_0x6d6c('0x4'));function getValueFromLicense(_0x4fc719,_0x1c9d32){if(_0x4fc719&&_0x1c9d32){if(_0x1c9d32['data1']&&_0x1c9d32[_0x6d6c('0x5')]){var _0xed96c0=_0x1c9d32[_0x6d6c('0x6')];var _0x3ba04c=_0x1c9d32[_0x6d6c('0x5')];var _0x58c409=_0xed96c0[_0x6d6c('0x7')]('-')[0x4];var _0x43c7f2=_0xed96c0[_0x6d6c('0x7')]('-')[0x0];var _0x4fd878=crypto[_0x6d6c('0x8')](_0x6d6c('0x9'),util[_0x6d6c('0xa')](_0x6d6c('0xb'),_0x58c409,_0xed96c0,_0x43c7f2));var _0x538687=_0x4fd878[_0x6d6c('0xc')](_0x3ba04c,_0x6d6c('0xd'),_0x6d6c('0xe'));_0x538687+=_0x4fd878[_0x6d6c('0xf')](_0x6d6c('0xe'));var _0xd99765=JSON['parse'](_0x538687);return _0xd99765['hasOwnProperty'](_0x4fc719)?_0xd99765[_0x4fc719]:null;}}return null;}function isLimit(_0x39bf0b,_0x4c4ee3,_0x23ac13,_0x4f477b){var _0x3502ae=_0x4c4ee3;return compose()[_0x6d6c('0x10')](function(_0x4cdcad,_0x22452a,_0x15faa3){return db['License'][_0x6d6c('0x11')]({'where':{'id':0x1},'raw':!![]})[_0x6d6c('0x12')](function(_0x1082de){var _0x1eeec0=getValueFromLicense(_0x39bf0b,_0x1082de);return _0x1eeec0?_0x1eeec0:_0x3502ae;})[_0x6d6c('0x12')](function(_0x23957b){_0x3502ae=_0x23957b;return _0x23ac13[_0x6d6c('0x13')](_0x4f477b);})[_0x6d6c('0x12')](function(_0x2bb1b4){if(_0x2bb1b4>=_0x3502ae){return _0x22452a[_0x6d6c('0x14')](0x193)[_0x6d6c('0x15')]({'message':util[_0x6d6c('0xa')]('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x39bf0b)});}_0x15faa3();})[_0x6d6c('0x16')](function(_0x5ac4a5){_0x15faa3(_0x5ac4a5);});});}function isUserLimit(){return isLimit(_0x6d6c('0x17'),0x1,db[_0x6d6c('0x18')],{'where':{'$or':[{'role':_0x6d6c('0x19')},{'role':_0x6d6c('0x1a')}]}});}exports['isUserLimit']=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index 1fb8ac9..3160288 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 _0xc7c9=['[$or]','and','replace','split','slice','match','filter','map','conditions','push','operator','$eq','$between','value','includes','add','days','format','YYYY-MM-DD','castTo','text','CAST(','field','$ne','$notIn','IN\x20?','NOT\x20IN\x20?','<>\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','<\x20?','$gt','$lte','$gte','>=\x20?','$in','start','shift','pop','DATE','utcOffset','hours','minutes','lodash','moment','parseSearch','sqlOperator','startsWith'];(function(_0x521929,_0x479be5){var _0x632436=function(_0x288290){while(--_0x288290){_0x521929['push'](_0x521929['shift']());}};_0x632436(++_0x479be5);}(_0xc7c9,0x18b));var _0x9c7c=function(_0x26f3da,_0x9833e){_0x26f3da=_0x26f3da-0x0;var _0x41730c=_0xc7c9[_0x26f3da];return _0x41730c;};'use strict';var _=require(_0x9c7c('0x0'));var moment=require(_0x9c7c('0x1'));exports[_0x9c7c('0x2')]=function(_0x332a05){var _0x242f97={'conditions':[]};_0x242f97[_0x9c7c('0x3')]=_[_0x9c7c('0x4')](_0x332a05,_0x9c7c('0x5'))?'or':_0x9c7c('0x6');var _0x36e8b8=_0x332a05[_0x9c7c('0x7')]('[$and]','')[_0x9c7c('0x7')]('[$or]','')[_0x9c7c('0x8')]('||');for(var _0x2cb00a=0x0;_0x2cb00a<_0x36e8b8['length'];_0x2cb00a++){var _0xfc490=_0x36e8b8[_0x2cb00a][_0x9c7c('0x8')](':=');var _0x229019=_0xfc490[0x0];var _0x54498b=_0xfc490[_0x9c7c('0x9')](0x1);_0x54498b['forEach'](function(_0x249d7c){var _0x2b3aa7=_0x249d7c[_0x9c7c('0x8')]('[')['shift']();var _0x5e850a=_0x249d7c[_0x9c7c('0xa')](/\[(.*?)\]/g);_0x5e850a['forEach'](function(_0x8a27ff){var _0x8d91d5=_0x8a27ff[_0x9c7c('0x8')]('[')[_0x9c7c('0xb')](function(_0x189746){return _0x189746['indexOf'](']')>-0x1;})[_0x9c7c('0xc')](function(_0x59ad2c){return _0x59ad2c[_0x9c7c('0x8')](']')[0x0];})[0x0];_0x242f97[_0x9c7c('0xd')][_0x9c7c('0xe')]({'field':_0x229019,'operator':_0x2b3aa7,'value':_0x8d91d5});});});}return _0x242f97;};exports['buildExpression']=function(_0x5e1578,_0x1d14e5,_0x138895){var _0x580a9a={};if(_0x1d14e5==='DATE'){if(_0x138895[_0x9c7c('0xf')]===_0x9c7c('0x10')){_0x138895[_0x9c7c('0xf')]=_0x9c7c('0x11');_0x138895['value']+=','+_0x138895[_0x9c7c('0x12')];}else if(_[_0x9c7c('0x13')](['$gt','$lte'],_0x138895[_0x9c7c('0xf')])){_0x138895['value']=moment(_0x138895['value'])[_0x9c7c('0x14')](0x1,_0x9c7c('0x15'))[_0x9c7c('0x16')](_0x9c7c('0x17'));}}if(_0x138895[_0x9c7c('0x18')]){_0x1d14e5=_0x138895[_0x9c7c('0x18')];_0x580a9a[_0x9c7c('0x19')]=_0x9c7c('0x1a')+_0x5e1578+'.'+_0x138895[_0x9c7c('0x1b')]+'\x20AS\x20'+_0x138895[_0x9c7c('0x18')]+')\x20'+parseOperator(_0x138895['operator']);}else{_0x580a9a[_0x9c7c('0x19')]=_0x5e1578+'.'+_0x138895[_0x9c7c('0x1b')]+'\x20'+parseOperator(_0x138895[_0x9c7c('0xf')]);}if(_['includes']([_0x9c7c('0x1c'),_0x9c7c('0x1d')],_0x138895[_0x9c7c('0xf')]))_0x580a9a[_0x9c7c('0x19')]='('+_0x580a9a[_0x9c7c('0x19')]+'\x20OR\x20'+_0x5e1578+'.'+_0x138895['field']+'\x20IS\x20NULL)';_0x580a9a['value']=parseValue(_0x1d14e5,_0x138895[_0x9c7c('0xf')],_0x138895[_0x9c7c('0x12')]);return _0x580a9a;};function parseOperator(_0x2bc2d2){var _0x20a4e1;switch(_0x2bc2d2){case'$in':_0x20a4e1=_0x9c7c('0x1e');break;case _0x9c7c('0x1d'):_0x20a4e1=_0x9c7c('0x1f');break;case'$eq':_0x20a4e1='=\x20?';break;case _0x9c7c('0x1c'):_0x20a4e1=_0x9c7c('0x20');break;case _0x9c7c('0x21'):case _0x9c7c('0x22'):case _0x9c7c('0x23'):_0x20a4e1=_0x9c7c('0x24');break;case'$lt':_0x20a4e1=_0x9c7c('0x25');break;case _0x9c7c('0x26'):_0x20a4e1='>\x20?';break;case _0x9c7c('0x27'):_0x20a4e1='<=\x20?';break;case _0x9c7c('0x28'):_0x20a4e1=_0x9c7c('0x29');break;case _0x9c7c('0x11'):_0x20a4e1='BETWEEN\x20?\x20AND\x20?';break;}return _0x20a4e1;}function parseValue(_0x29c394,_0x3b0e21,_0x5b57d0){var _0x43f94a={'start':undefined,'end':undefined};switch(_0x3b0e21){case _0x9c7c('0x2a'):case _0x9c7c('0x1d'):_0x43f94a[_0x9c7c('0x2b')]=_0x5b57d0[_0x9c7c('0x8')](',');break;case _0x9c7c('0x21'):_0x43f94a[_0x9c7c('0x2b')]='%'+_0x5b57d0+'%';break;case _0x9c7c('0x22'):_0x43f94a[_0x9c7c('0x2b')]=_0x5b57d0+'%';break;case _0x9c7c('0x23'):_0x43f94a[_0x9c7c('0x2b')]='%'+_0x5b57d0;break;case _0x9c7c('0x11'):var _0x3dda10=_0x5b57d0[_0x9c7c('0x8')](',');var _0x5b57d0=_0x3dda10[_0x9c7c('0x2c')]();var _0x550405=_0x3dda10[_0x9c7c('0x2d')]();if(_0x29c394===_0x9c7c('0x2e')){_0x5b57d0=moment(_0x5b57d0)[_0x9c7c('0x2f')](0x0,!![])['format']();_0x550405=moment(_0x550405)[_0x9c7c('0x2f')](0x0,!![])['add'](0x17,_0x9c7c('0x30'))[_0x9c7c('0x14')](0x3b,_0x9c7c('0x31'))['add'](0x3b,'seconds')['format']();}_0x43f94a={'start':_0x5b57d0,'end':_0x550405};break;default:_0x43f94a[_0x9c7c('0x2b')]=_0x5b57d0;break;}return _0x43f94a;} \ No newline at end of file +var _0xce53=['=\x20?','$ne','<>\x20?','$substring','$endsWith','LIKE\x20?','<\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','$in','start','utcOffset','format','hours','minutes','lodash','moment','parseSearch','[$or]','and','replace','[$and]','split','length','slice','forEach','shift','match','filter','indexOf','map','conditions','buildExpression','DATE','operator','$eq','$between','value','$gt','$lte','add','days','castTo','text','CAST(','field','\x20AS\x20','includes','\x20OR\x20','\x20IS\x20NULL)','IN\x20?','$notIn','NOT\x20IN\x20?'];(function(_0x579c69,_0x31d32e){var _0x294362=function(_0x5619b6){while(--_0x5619b6){_0x579c69['push'](_0x579c69['shift']());}};_0x294362(++_0x31d32e);}(_0xce53,0x1c0));var _0x3ce5=function(_0x2c292a,_0x5b92f5){_0x2c292a=_0x2c292a-0x0;var _0x2c3036=_0xce53[_0x2c292a];return _0x2c3036;};'use strict';var _=require(_0x3ce5('0x0'));var moment=require(_0x3ce5('0x1'));exports[_0x3ce5('0x2')]=function(_0x26fa10){var _0x2f04f4={'conditions':[]};_0x2f04f4['sqlOperator']=_['startsWith'](_0x26fa10,_0x3ce5('0x3'))?'or':_0x3ce5('0x4');var _0x552559=_0x26fa10[_0x3ce5('0x5')](_0x3ce5('0x6'),'')[_0x3ce5('0x5')](_0x3ce5('0x3'),'')[_0x3ce5('0x7')]('||');for(var _0x27e835=0x0;_0x27e835<_0x552559[_0x3ce5('0x8')];_0x27e835++){var _0x4fa8ca=_0x552559[_0x27e835]['split'](':=');var _0x20dfba=_0x4fa8ca[0x0];var _0x542374=_0x4fa8ca[_0x3ce5('0x9')](0x1);_0x542374[_0x3ce5('0xa')](function(_0x4ba66e){var _0x179411=_0x4ba66e['split']('[')[_0x3ce5('0xb')]();var _0x3528ab=_0x4ba66e[_0x3ce5('0xc')](/\[(.*?)\]/g);_0x3528ab[_0x3ce5('0xa')](function(_0x2997f0){var _0x161039=_0x2997f0[_0x3ce5('0x7')]('[')[_0x3ce5('0xd')](function(_0x14a5e0){return _0x14a5e0[_0x3ce5('0xe')](']')>-0x1;})[_0x3ce5('0xf')](function(_0x1f0daa){return _0x1f0daa['split'](']')[0x0];})[0x0];_0x2f04f4[_0x3ce5('0x10')]['push']({'field':_0x20dfba,'operator':_0x179411,'value':_0x161039});});});}return _0x2f04f4;};exports[_0x3ce5('0x11')]=function(_0xbac89d,_0x56ba9f,_0x449be0){var _0x21c577={};if(_0x56ba9f===_0x3ce5('0x12')){if(_0x449be0[_0x3ce5('0x13')]===_0x3ce5('0x14')){_0x449be0[_0x3ce5('0x13')]=_0x3ce5('0x15');_0x449be0[_0x3ce5('0x16')]+=','+_0x449be0[_0x3ce5('0x16')];}else if(_['includes']([_0x3ce5('0x17'),_0x3ce5('0x18')],_0x449be0[_0x3ce5('0x13')])){_0x449be0[_0x3ce5('0x16')]=moment(_0x449be0[_0x3ce5('0x16')])[_0x3ce5('0x19')](0x1,_0x3ce5('0x1a'))['format']('YYYY-MM-DD');}}if(_0x449be0[_0x3ce5('0x1b')]){_0x56ba9f=_0x449be0[_0x3ce5('0x1b')];_0x21c577[_0x3ce5('0x1c')]=_0x3ce5('0x1d')+_0xbac89d+'.'+_0x449be0[_0x3ce5('0x1e')]+_0x3ce5('0x1f')+_0x449be0[_0x3ce5('0x1b')]+')\x20'+parseOperator(_0x449be0[_0x3ce5('0x13')]);}else{_0x21c577[_0x3ce5('0x1c')]=_0xbac89d+'.'+_0x449be0[_0x3ce5('0x1e')]+'\x20'+parseOperator(_0x449be0['operator']);}if(_[_0x3ce5('0x20')](['$ne','$notIn'],_0x449be0[_0x3ce5('0x13')]))_0x21c577[_0x3ce5('0x1c')]='('+_0x21c577[_0x3ce5('0x1c')]+_0x3ce5('0x21')+_0xbac89d+'.'+_0x449be0[_0x3ce5('0x1e')]+_0x3ce5('0x22');_0x21c577['value']=parseValue(_0x56ba9f,_0x449be0[_0x3ce5('0x13')],_0x449be0[_0x3ce5('0x16')]);return _0x21c577;};function parseOperator(_0x4e9ff1){var _0x3d6d2c;switch(_0x4e9ff1){case'$in':_0x3d6d2c=_0x3ce5('0x23');break;case _0x3ce5('0x24'):_0x3d6d2c=_0x3ce5('0x25');break;case _0x3ce5('0x14'):_0x3d6d2c=_0x3ce5('0x26');break;case _0x3ce5('0x27'):_0x3d6d2c=_0x3ce5('0x28');break;case _0x3ce5('0x29'):case'$startsWith':case _0x3ce5('0x2a'):_0x3d6d2c=_0x3ce5('0x2b');break;case'$lt':_0x3d6d2c=_0x3ce5('0x2c');break;case _0x3ce5('0x17'):_0x3d6d2c='>\x20?';break;case _0x3ce5('0x18'):_0x3d6d2c='<=\x20?';break;case _0x3ce5('0x2d'):_0x3d6d2c=_0x3ce5('0x2e');break;case _0x3ce5('0x15'):_0x3d6d2c=_0x3ce5('0x2f');break;}return _0x3d6d2c;}function parseValue(_0x4629d4,_0x38d662,_0x583768){var _0x1278ab={'start':undefined,'end':undefined};switch(_0x38d662){case _0x3ce5('0x30'):case'$notIn':_0x1278ab['start']=_0x583768[_0x3ce5('0x7')](',');break;case _0x3ce5('0x29'):_0x1278ab[_0x3ce5('0x31')]='%'+_0x583768+'%';break;case'$startsWith':_0x1278ab[_0x3ce5('0x31')]=_0x583768+'%';break;case _0x3ce5('0x2a'):_0x1278ab[_0x3ce5('0x31')]='%'+_0x583768;break;case _0x3ce5('0x15'):var _0x3c1073=_0x583768['split'](',');var _0x583768=_0x3c1073['shift']();var _0x129082=_0x3c1073['pop']();if(_0x4629d4===_0x3ce5('0x12')){_0x583768=moment(_0x583768)[_0x3ce5('0x32')](0x0,!![])[_0x3ce5('0x33')]();_0x129082=moment(_0x129082)['utcOffset'](0x0,!![])[_0x3ce5('0x19')](0x17,_0x3ce5('0x34'))[_0x3ce5('0x19')](0x3b,_0x3ce5('0x35'))[_0x3ce5('0x19')](0x3b,'seconds')[_0x3ce5('0x33')]();}_0x1278ab={'start':_0x583768,'end':_0x129082};break;default:_0x1278ab['start']=_0x583768;break;}return _0x1278ab;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 7df813c..5fe6ac8 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 _0x3c3e=['lodash','sequelize','moment','parse','keys','includes','model','alias','raw','fields','split','isEmpty','forOwn','find','type','DATE','isPlainObject','$gte','YYYY-MM-DD','utc','format','$lte','subtract','name','isArray','limit','offset','sort','map','indexOf','priority','cast','col','unsigned','substr','DESC','ASC','length','omit','isString','unset','hasOwnProperty','match','^[+]?[0-9]*$','getFullTextValue','{EXPR}','forEach','push','replace','join','getOptions','query','$id','filters','intersection','attributes','nolimit','order','where','pick','filter','object','merge','VIRTUAL','lower','includeAll','include'];(function(_0x44b346,_0xeb097d){var _0x1c2f2b=function(_0x4e1f23){while(--_0x4e1f23){_0x44b346['push'](_0x44b346['shift']());}};_0x1c2f2b(++_0xeb097d);}(_0x3c3e,0x86));var _0xe3c3=function(_0x3be52f,_0x22a3e4){_0x3be52f=_0x3be52f-0x0;var _0xe63f25=_0x3c3e[_0x3be52f];return _0xe63f25;};'use strict';var _=require(_0xe3c3('0x0'));var sequelize=require(_0xe3c3('0x1'));var moment=require(_0xe3c3('0x2'));var db=require('../../mysqldb')['db'];var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x12a9ba){var _0x516f92=['ne'];try{var _0x2a3a29=JSON[_0xe3c3('0x3')](_0x12a9ba);var _0x34fbb1=Object[_0xe3c3('0x4')](_0x2a3a29)[0x0];return _0x516f92[_0xe3c3('0x5')](_0x34fbb1);}catch(_0x39d7af){return![];}}function getOperatorValue(_0x21220e){var _0x4d9334=JSON[_0xe3c3('0x3')](_0x21220e);var _0x4c11c9=Object[_0xe3c3('0x4')](_0x4d9334)[0x0];var _0x5e0091=_0x4d9334[_0x4c11c9];return{['$'+_0x4c11c9]:_0x5e0091};}function parseIncludeModel(_0x5e6587){var _0x17c256=JSON['parse'](_0x5e6587);return{'model':db[_0x17c256[_0xe3c3('0x6')]],'as':_0x17c256[_0xe3c3('0x7')],'attributes':_0x17c256['fields'],'raw':_0x17c256[_0xe3c3('0x8')]};}exports[_0xe3c3('0x9')]=function(_0x3f7905){var _0xc7fad9=null;if(_0x3f7905){_0xc7fad9=_0x3f7905[_0xe3c3('0xa')](',');}return _0xc7fad9;};exports['filters']=function(_0x2d0ece,_0x5b9af9){var _0x3d5fe6={};if(!_[_0xe3c3('0xb')](_0x2d0ece)){_[_0xe3c3('0xc')](_0x2d0ece,function(_0x29c18a,_0x4b1409){try{if(_0x5b9af9){var _0x4aa6f0=_[_0xe3c3('0xd')](_0x5b9af9,{'name':_0x4b1409})||{};if(hasSequelizeOperator(_0x29c18a)){_0x3d5fe6[_0x4b1409]=getOperatorValue(_0x29c18a);}else if(_0x4aa6f0[_0xe3c3('0xe')]===_0xe3c3('0xf')&&_[_0xe3c3('0x10')](_0x29c18a)){var _0x29bd30=JSON[_0xe3c3('0x3')](_0x29c18a);var _0xa0da73={'$gte':moment(moment(_0x29bd30[_0xe3c3('0x11')])['format'](_0xe3c3('0x12')))[_0xe3c3('0x13')]()[_0xe3c3('0x14')](),'$lte':moment(moment(_0x29bd30[_0xe3c3('0x15')])[_0xe3c3('0x14')](_0xe3c3('0x12')))[_0xe3c3('0x13')]()[_0xe3c3('0x16')](0x1,'s')[_0xe3c3('0x14')]()};_0x3d5fe6[_0x4b1409]=_0xa0da73;}else if(_0x4aa6f0[_0xe3c3('0x17')]==='uniqueid'){_0x3d5fe6[_0x4b1409]=_0x29c18a;}else{_0x3d5fe6[_0x4b1409]=_[_0xe3c3('0x18')](_0x29c18a)?_0x29c18a:JSON['parse'](_0x29c18a);}}else{_0x3d5fe6[_0x4b1409]=_[_0xe3c3('0x18')](_0x29c18a)?_0x29c18a:JSON[_0xe3c3('0x3')](_0x29c18a);}}catch(_0x4c37a7){_0x3d5fe6[_0x4b1409]=_0x29c18a['split'](',');}});}return _0x3d5fe6;};exports[_0xe3c3('0x19')]=function(_0x2de4c5){_0x2de4c5=parseInt(_0x2de4c5,0xa);if(!_0x2de4c5||_0x2de4c5<0x0){_0x2de4c5=LIMIT_VALUE;}return _0x2de4c5;};exports[_0xe3c3('0x1a')]=function(_0x538f60){_0x538f60=parseInt(_0x538f60,0xa);if(!_0x538f60||_0x538f60<0x0){_0x538f60=0x0;}return _0x538f60;};exports[_0xe3c3('0x1b')]=function(_0x48046f){var _0x574a5c,_0x3125fd=null;if(_0x48046f){_0x574a5c=_0x48046f[_0xe3c3('0xa')](',');_0x3125fd=_[_0xe3c3('0x1c')](_0x574a5c,function(_0x228055){if(_0x228055[_0xe3c3('0x1d')]('-')===0x0){return[_0x228055===_0xe3c3('0x1e')?sequelize[_0xe3c3('0x1f')](sequelize[_0xe3c3('0x20')](_0xe3c3('0x1e')),_0xe3c3('0x21')):_0x228055[_0xe3c3('0x22')](0x1),_0xe3c3('0x23')];}else{return[_0x228055===_0xe3c3('0x1e')?sequelize[_0xe3c3('0x1f')](sequelize[_0xe3c3('0x20')](_0xe3c3('0x1e')),'unsigned'):_0x228055,_0xe3c3('0x24')];}});}return _0x3125fd;};exports['omit']=function(_0x15cf2b,_0x326acf){if(_[_0xe3c3('0xb')](_0x15cf2b)){return _0x15cf2b;}if(_[_0xe3c3('0x18')](_0x15cf2b)){for(var _0x64f36b=0x0;_0x64f36b<_0x15cf2b[_0xe3c3('0x25')];_0x64f36b+=0x1){_0x15cf2b[_0x64f36b]=this[_0xe3c3('0x26')](_0x15cf2b[_0x64f36b],_0x326acf);}return _0x15cf2b;}if(!_['isObject'](_0x15cf2b)){return _0x15cf2b;}if(_[_0xe3c3('0x27')](_0x326acf)){_0x326acf=[_0x326acf];}if(!_[_0xe3c3('0x18')](_0x326acf)){return _0x15cf2b;}for(var _0x55bffd=0x0;_0x55bffd<_0x326acf[_0xe3c3('0x25')];_0x55bffd+=0x1){_[_0xe3c3('0x28')](_0x15cf2b,_0x326acf[_0x55bffd]);}for(var _0x4da6a8 in _0x15cf2b){if(_0x15cf2b[_0xe3c3('0x29')](_0x4da6a8)){_0x15cf2b[_0x4da6a8]=this[_0xe3c3('0x26')](_0x15cf2b[_0x4da6a8],_0x326acf);}}return _0x15cf2b;};exports['isNumeric']=function(_0x109cf6){return _0x109cf6[_0xe3c3('0x2a')](RegExp(_0xe3c3('0x2b')))?!![]:![];};exports['isEmail']=function(_0x391c9f){return _0x391c9f[_0xe3c3('0x2a')](/^\S+@\S+$/)?!![]:![];};exports[_0xe3c3('0x2c')]=function(_0x48e9ce,_0x35848f){var _0x16c566=[];var _0xbbf619=/[ `!@#$%^&*()_\-?~]/;var _0x37a689=_0x35848f?'\x22{EXPR}\x22':_0xe3c3('0x2d');_0x48e9ce[_0xe3c3('0xa')](/[ ,]+/)[_0xe3c3('0x2e')](function(_0x4518f0){_0x4518f0=_0x4518f0['replace'](/([^:]")"+/g,'$1');_0x4518f0='+'+_0x4518f0+'*';var _0x21596f=_0x4518f0[_0xe3c3('0x2a')](_0xbbf619);if(_0x21596f){_0x4518f0='\x22'+_0x4518f0+'\x22';}_0x16c566[_0xe3c3('0x2f')](_0x4518f0);});_0x37a689=_0x37a689[_0xe3c3('0x30')]('{EXPR}',_0x16c566[_0xe3c3('0x31')]('\x20'));return _0x37a689;};exports[_0xe3c3('0x32')]=function(_0x4f6803,_0x1ee00a,_0x1051a2){var _0x179ea7={},_0x5ac569={};if(_0x1ee00a[_0xe3c3('0x33')]['$id']){_0x1ee00a[_0xe3c3('0x33')]['id']=_0x1ee00a[_0xe3c3('0x33')][_0xe3c3('0x34')];delete _0x1ee00a['query'][_0xe3c3('0x34')];}_0x179ea7[_0xe3c3('0x6')]=_['map'](_0x4f6803,_0xe3c3('0x17'));_0x179ea7[_0xe3c3('0x33')]=_[_0xe3c3('0x4')](_0x1ee00a['query']);_0x179ea7[_0xe3c3('0x35')]=_[_0xe3c3('0x36')](_0x179ea7[_0xe3c3('0x6')],_0x179ea7[_0xe3c3('0x33')]);_0x5ac569[_0xe3c3('0x37')]=_[_0xe3c3('0x36')](_0x179ea7['model'],this['fields'](_0x1ee00a['query']['fields']));_0x5ac569[_0xe3c3('0x37')]=_0x5ac569[_0xe3c3('0x37')][_0xe3c3('0x25')]?_0x5ac569['attributes']:_0x179ea7[_0xe3c3('0x6')];if(!_0x1ee00a[_0xe3c3('0x33')][_0xe3c3('0x29')](_0xe3c3('0x38'))){_0x5ac569[_0xe3c3('0x19')]=this[_0xe3c3('0x19')](_0x1ee00a[_0xe3c3('0x33')][_0xe3c3('0x19')]);_0x5ac569[_0xe3c3('0x1a')]=this[_0xe3c3('0x1a')](_0x1ee00a[_0xe3c3('0x33')][_0xe3c3('0x1a')]);}_0x5ac569[_0xe3c3('0x39')]=this[_0xe3c3('0x1b')](_0x1ee00a[_0xe3c3('0x33')][_0xe3c3('0x1b')]);_0x5ac569[_0xe3c3('0x3a')]=this[_0xe3c3('0x35')](_[_0xe3c3('0x3b')](_0x1ee00a[_0xe3c3('0x33')],_0x179ea7[_0xe3c3('0x35')]),_0x4f6803);if(_0x1ee00a[_0xe3c3('0x33')][_0xe3c3('0x3c')]){var _0x33c3e0=_0x4f6803;var _0x4cbe53=_0x1ee00a[_0xe3c3('0x33')]['filter'];if(typeof _0x4cbe53===_0xe3c3('0x3d')){_0x33c3e0=_[_0xe3c3('0x3c')](_0x4f6803,function(_0x4e49f5){return _[_0xe3c3('0x5')](_0x4cbe53['columns'],_0x4e49f5[_0xe3c3('0x17')]);});_0x4cbe53=_0x4cbe53['value'];}_0x5ac569[_0xe3c3('0x3a')]=_[_0xe3c3('0x3e')](_0x5ac569[_0xe3c3('0x3a')],{'$or':_[_0xe3c3('0x1c')](_0x33c3e0,function(_0x152837){if(_0x152837[_0xe3c3('0xe')]!==_0xe3c3('0x3f')){if(_0x1051a2){return sequelize[_0xe3c3('0x3a')](sequelize['fn'](_0xe3c3('0x40'),sequelize[_0xe3c3('0x20')](_0x152837[_0xe3c3('0x17')])),{'$like':sequelize['fn'](_0xe3c3('0x40'),'%'+_0x1ee00a[_0xe3c3('0x33')][_0xe3c3('0x3c')]+'%')});}else{var _0x227b66={};_0x227b66[_0x152837[_0xe3c3('0x17')]]={'$like':'%'+_0x1ee00a[_0xe3c3('0x33')][_0xe3c3('0x3c')]+'%'};return _0x227b66;}}})});}_0x5ac569=_[_0xe3c3('0x3e')]({},_0x5ac569,_0x1ee00a['options']);return _0x5ac569;};exports['include']=function(_0x25ceef){var _0x44ed2f=[];if(_0x25ceef[_0xe3c3('0x41')]){_0x44ed2f[_0xe3c3('0x2f')]({'all':!![]});}else if(_0x25ceef[_0xe3c3('0x42')]){if(Array[_0xe3c3('0x18')](_0x25ceef[_0xe3c3('0x42')])){_0x44ed2f=Object['keys'](_0x25ceef[_0xe3c3('0x42')])['map'](function(_0x49aefe){return parseIncludeModel(_0x25ceef[_0xe3c3('0x42')][_0x49aefe]);});}else{var _0x166678=parseIncludeModel(_0x25ceef[_0xe3c3('0x42')]);_0x44ed2f[_0xe3c3('0x2f')](_0x166678);}}return _0x44ed2f;}; \ No newline at end of file +var _0x28e3=['format','YYYY-MM-DD','utc','$lte','subtract','name','isArray','limit','offset','sort','map','indexOf','priority','unsigned','substr','DESC','col','ASC','omit','isObject','isString','length','hasOwnProperty','isNumeric','^[+]?[0-9]*$','isEmail','match','getFullTextValue','{EXPR}','push','replace','join','getOptions','$id','query','model','intersection','attributes','nolimit','order','where','pick','filter','columns','value','merge','type','VIRTUAL','lower','options','include','includeAll','lodash','sequelize','moment','../../mysqldb','parse','keys','includes','alias','fields','raw','split','filters','isEmpty','forOwn','find','DATE','isPlainObject','$gte'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0x28e3,0x106));var _0x328e=function(_0x725a4c,_0x102507){_0x725a4c=_0x725a4c-0x0;var _0x37b2cc=_0x28e3[_0x725a4c];return _0x37b2cc;};'use strict';var _=require(_0x328e('0x0'));var sequelize=require(_0x328e('0x1'));var moment=require(_0x328e('0x2'));var db=require(_0x328e('0x3'))['db'];var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x499442){var _0x5f1520=['ne'];try{var _0x392b85=JSON[_0x328e('0x4')](_0x499442);var _0x168893=Object[_0x328e('0x5')](_0x392b85)[0x0];return _0x5f1520[_0x328e('0x6')](_0x168893);}catch(_0xe03ffa){return![];}}function getOperatorValue(_0x439182){var _0x5e5bcf=JSON['parse'](_0x439182);var _0x58885f=Object[_0x328e('0x5')](_0x5e5bcf)[0x0];var _0x3696b6=_0x5e5bcf[_0x58885f];return{['$'+_0x58885f]:_0x3696b6};}function parseIncludeModel(_0x3467ee){var _0x6a5414=JSON[_0x328e('0x4')](_0x3467ee);return{'model':db[_0x6a5414['model']],'as':_0x6a5414[_0x328e('0x7')],'attributes':_0x6a5414[_0x328e('0x8')],'raw':_0x6a5414[_0x328e('0x9')]};}exports['fields']=function(_0x509c4d){var _0x4c366c=null;if(_0x509c4d){_0x4c366c=_0x509c4d[_0x328e('0xa')](',');}return _0x4c366c;};exports[_0x328e('0xb')]=function(_0x33f277,_0x1c7294){var _0x32e15b={};if(!_[_0x328e('0xc')](_0x33f277)){_[_0x328e('0xd')](_0x33f277,function(_0x39338e,_0x1d3e4a){try{if(_0x1c7294){var _0x96f79a=_[_0x328e('0xe')](_0x1c7294,{'name':_0x1d3e4a})||{};if(hasSequelizeOperator(_0x39338e)){_0x32e15b[_0x1d3e4a]=getOperatorValue(_0x39338e);}else if(_0x96f79a['type']===_0x328e('0xf')&&_[_0x328e('0x10')](_0x39338e)){var _0x1552ce=JSON[_0x328e('0x4')](_0x39338e);var _0x29f8bf={'$gte':moment(moment(_0x1552ce[_0x328e('0x11')])[_0x328e('0x12')](_0x328e('0x13')))[_0x328e('0x14')]()['format'](),'$lte':moment(moment(_0x1552ce[_0x328e('0x15')])[_0x328e('0x12')](_0x328e('0x13')))[_0x328e('0x14')]()[_0x328e('0x16')](0x1,'s')[_0x328e('0x12')]()};_0x32e15b[_0x1d3e4a]=_0x29f8bf;}else if(_0x96f79a[_0x328e('0x17')]==='uniqueid'){_0x32e15b[_0x1d3e4a]=_0x39338e;}else{_0x32e15b[_0x1d3e4a]=_[_0x328e('0x18')](_0x39338e)?_0x39338e:JSON[_0x328e('0x4')](_0x39338e);}}else{_0x32e15b[_0x1d3e4a]=_[_0x328e('0x18')](_0x39338e)?_0x39338e:JSON[_0x328e('0x4')](_0x39338e);}}catch(_0x2af341){_0x32e15b[_0x1d3e4a]=_0x39338e['split'](',');}});}return _0x32e15b;};exports[_0x328e('0x19')]=function(_0x1c5551){_0x1c5551=parseInt(_0x1c5551,0xa);if(!_0x1c5551||_0x1c5551<0x0){_0x1c5551=LIMIT_VALUE;}return _0x1c5551;};exports[_0x328e('0x1a')]=function(_0x5dcfaa){_0x5dcfaa=parseInt(_0x5dcfaa,0xa);if(!_0x5dcfaa||_0x5dcfaa<0x0){_0x5dcfaa=0x0;}return _0x5dcfaa;};exports[_0x328e('0x1b')]=function(_0x3bafb1){var _0x39a9e2,_0x273b45=null;if(_0x3bafb1){_0x39a9e2=_0x3bafb1[_0x328e('0xa')](',');_0x273b45=_[_0x328e('0x1c')](_0x39a9e2,function(_0x725a1){if(_0x725a1[_0x328e('0x1d')]('-')===0x0){return[_0x725a1===_0x328e('0x1e')?sequelize['cast'](sequelize['col'](_0x328e('0x1e')),_0x328e('0x1f')):_0x725a1[_0x328e('0x20')](0x1),_0x328e('0x21')];}else{return[_0x725a1===_0x328e('0x1e')?sequelize['cast'](sequelize[_0x328e('0x22')]('priority'),_0x328e('0x1f')):_0x725a1,_0x328e('0x23')];}});}return _0x273b45;};exports[_0x328e('0x24')]=function(_0x2fab5a,_0x108f0d){if(_['isEmpty'](_0x2fab5a)){return _0x2fab5a;}if(_['isArray'](_0x2fab5a)){for(var _0x3bd897=0x0;_0x3bd897<_0x2fab5a['length'];_0x3bd897+=0x1){_0x2fab5a[_0x3bd897]=this['omit'](_0x2fab5a[_0x3bd897],_0x108f0d);}return _0x2fab5a;}if(!_[_0x328e('0x25')](_0x2fab5a)){return _0x2fab5a;}if(_[_0x328e('0x26')](_0x108f0d)){_0x108f0d=[_0x108f0d];}if(!_[_0x328e('0x18')](_0x108f0d)){return _0x2fab5a;}for(var _0x232ec7=0x0;_0x232ec7<_0x108f0d[_0x328e('0x27')];_0x232ec7+=0x1){_['unset'](_0x2fab5a,_0x108f0d[_0x232ec7]);}for(var _0x26a204 in _0x2fab5a){if(_0x2fab5a[_0x328e('0x28')](_0x26a204)){_0x2fab5a[_0x26a204]=this[_0x328e('0x24')](_0x2fab5a[_0x26a204],_0x108f0d);}}return _0x2fab5a;};exports[_0x328e('0x29')]=function(_0x24702c){return _0x24702c['match'](RegExp(_0x328e('0x2a')))?!![]:![];};exports[_0x328e('0x2b')]=function(_0x3da580){return _0x3da580[_0x328e('0x2c')](/^\S+@\S+$/)?!![]:![];};exports[_0x328e('0x2d')]=function(_0x10a004,_0x37ba2e){var _0x123099=[];var _0xeb04ba=/[ `!@#$%^&*()_\-?~]/;var _0x56a1ea=_0x37ba2e?'\x22{EXPR}\x22':_0x328e('0x2e');_0x10a004[_0x328e('0xa')](/[ ,]+/)['forEach'](function(_0x514304){_0x514304=_0x514304['replace'](/([^:]")"+/g,'$1');_0x514304='+'+_0x514304+'*';var _0xba5335=_0x514304[_0x328e('0x2c')](_0xeb04ba);if(_0xba5335){_0x514304='\x22'+_0x514304+'\x22';}_0x123099[_0x328e('0x2f')](_0x514304);});_0x56a1ea=_0x56a1ea[_0x328e('0x30')](_0x328e('0x2e'),_0x123099[_0x328e('0x31')]('\x20'));return _0x56a1ea;};exports[_0x328e('0x32')]=function(_0x50fdad,_0x27ed20,_0x5c67e4){var _0x479550={},_0x25f1ba={};if(_0x27ed20['query'][_0x328e('0x33')]){_0x27ed20[_0x328e('0x34')]['id']=_0x27ed20[_0x328e('0x34')]['$id'];delete _0x27ed20[_0x328e('0x34')]['$id'];}_0x479550[_0x328e('0x35')]=_[_0x328e('0x1c')](_0x50fdad,_0x328e('0x17'));_0x479550[_0x328e('0x34')]=_['keys'](_0x27ed20[_0x328e('0x34')]);_0x479550['filters']=_[_0x328e('0x36')](_0x479550['model'],_0x479550['query']);_0x25f1ba[_0x328e('0x37')]=_['intersection'](_0x479550[_0x328e('0x35')],this[_0x328e('0x8')](_0x27ed20[_0x328e('0x34')][_0x328e('0x8')]));_0x25f1ba['attributes']=_0x25f1ba[_0x328e('0x37')][_0x328e('0x27')]?_0x25f1ba[_0x328e('0x37')]:_0x479550[_0x328e('0x35')];if(!_0x27ed20[_0x328e('0x34')]['hasOwnProperty'](_0x328e('0x38'))){_0x25f1ba[_0x328e('0x19')]=this[_0x328e('0x19')](_0x27ed20['query']['limit']);_0x25f1ba['offset']=this[_0x328e('0x1a')](_0x27ed20['query'][_0x328e('0x1a')]);}_0x25f1ba[_0x328e('0x39')]=this['sort'](_0x27ed20['query'][_0x328e('0x1b')]);_0x25f1ba[_0x328e('0x3a')]=this[_0x328e('0xb')](_[_0x328e('0x3b')](_0x27ed20[_0x328e('0x34')],_0x479550[_0x328e('0xb')]),_0x50fdad);if(_0x27ed20[_0x328e('0x34')][_0x328e('0x3c')]){var _0x2a823e=_0x50fdad;var _0xdf4229=_0x27ed20[_0x328e('0x34')][_0x328e('0x3c')];if(typeof _0xdf4229==='object'){_0x2a823e=_[_0x328e('0x3c')](_0x50fdad,function(_0x4f3687){return _['includes'](_0xdf4229[_0x328e('0x3d')],_0x4f3687[_0x328e('0x17')]);});_0xdf4229=_0xdf4229[_0x328e('0x3e')];}_0x25f1ba['where']=_[_0x328e('0x3f')](_0x25f1ba[_0x328e('0x3a')],{'$or':_[_0x328e('0x1c')](_0x2a823e,function(_0x414874){if(_0x414874[_0x328e('0x40')]!==_0x328e('0x41')){if(_0x5c67e4){return sequelize[_0x328e('0x3a')](sequelize['fn']('lower',sequelize['col'](_0x414874[_0x328e('0x17')])),{'$like':sequelize['fn'](_0x328e('0x42'),'%'+_0x27ed20['query'][_0x328e('0x3c')]+'%')});}else{var _0x22c843={};_0x22c843[_0x414874[_0x328e('0x17')]]={'$like':'%'+_0x27ed20['query'][_0x328e('0x3c')]+'%'};return _0x22c843;}}})});}_0x25f1ba=_[_0x328e('0x3f')]({},_0x25f1ba,_0x27ed20[_0x328e('0x43')]);return _0x25f1ba;};exports[_0x328e('0x44')]=function(_0x36f2b8){var _0x2ef923=[];if(_0x36f2b8[_0x328e('0x45')]){_0x2ef923['push']({'all':!![]});}else if(_0x36f2b8[_0x328e('0x44')]){if(Array[_0x328e('0x18')](_0x36f2b8[_0x328e('0x44')])){_0x2ef923=Object['keys'](_0x36f2b8[_0x328e('0x44')])[_0x328e('0x1c')](function(_0xf05042){return parseIncludeModel(_0x36f2b8[_0x328e('0x44')][_0xf05042]);});}else{var _0x1532d7=parseIncludeModel(_0x36f2b8[_0x328e('0x44')]);_0x2ef923[_0x328e('0x2f')](_0x1532d7);}}return _0x2ef923;}; \ No newline at end of file diff --git a/server/components/realtime/agents.js b/server/components/realtime/agents.js index dfed3a4..7d073c5 100644 --- a/server/components/realtime/agents.js +++ b/server/components/realtime/agents.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1c7c=['result','Agents','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','catch','busy','getAgentStatus','isArray','startCase','Queue','map','findOne','getAgents','all','uniq','includes','idle','User','name','fullname','find','globalStatus','getSortedAgentsIdsByStatus','split','fields','DESC','ASC','getUpdatedSortOptions','internal','substring','indexOf','validateSortParameter','pauseType','toLowerCase','sortAgentsByStatus','userpic','online','lastLoginAt','lastPauseAt','address','chatCapacity','openchannelCapacity','mailCapacity','whatsappCapacity','chatCurrentCapacity','openchannelCurrentCapacity','mailCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','chatStatusTime','openchannelStatusTime','mailStatusTime','smsStatusTime','whatsappStatusTime','voiceStatusTime','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','omit','pick','role','faxStatusTime','faxCapacity','smsCapacity','phoneBarEnableAutomaticScreenRecording','onhold','queue','getRealtimeAgentsQueryFields','lodash','jayson/promise','../../mysqldb','client','chatPause','faxPause','mailPause','openchannelPause','smsPause','voicePause','whatsappPause','every','filter','length','unknown','unavailable','isNil','voiceStatus','pause','chatStatus','faxStatus','mailStatus','openchannelStatus','smsStatus','whatsappStatus','request','then','error'];(function(_0x3f838d,_0x3a11ef){var _0x191305=function(_0x58fdc9){while(--_0x58fdc9){_0x3f838d['push'](_0x3f838d['shift']());}};_0x191305(++_0x3a11ef);}(_0x1c7c,0x164));var _0xc1c7=function(_0x138616,_0x2ba483){_0x138616=_0x138616-0x0;var _0x9fd75=_0x1c7c[_0x138616];return _0x9fd75;};'use strict';var _=require(_0xc1c7('0x0'));var jayson=require(_0xc1c7('0x1'));var db=require(_0xc1c7('0x2'))['db'];var amiClient=jayson[_0xc1c7('0x3')]['http']({'port':0x232a});var routingClient=jayson[_0xc1c7('0x3')]['http']({'port':0x232c});function isAgentPaused(_0x3cb551,_0x20dad3){var _0xbb9da0=[_0x3cb551[_0xc1c7('0x4')],_0x3cb551[_0xc1c7('0x5')],_0x3cb551[_0xc1c7('0x6')],_0x3cb551[_0xc1c7('0x7')],_0x3cb551[_0xc1c7('0x8')],_0x3cb551[_0xc1c7('0x9')],_0x3cb551[_0xc1c7('0xa')]];if(!_0x20dad3)return _[_0xc1c7('0xb')](_0xbb9da0);var _0x11c7ef=_[_0xc1c7('0xc')](_0xbb9da0);return _0x11c7ef[_0xc1c7('0xd')]>0x0&&_0x11c7ef[_0xc1c7('0xd')]<_0xbb9da0[_0xc1c7('0xd')]?!![]:![];}function isIdle(_0x25a669){return _0x25a669==='idle'||_0x25a669===_0xc1c7('0xe')||_0x25a669===_0xc1c7('0xf')||_0x25a669==='ringing'||_[_0xc1c7('0x10')](_0x25a669);}function isAgentIdle(_0x5ac140){if(_0x5ac140[_0xc1c7('0x11')]!=='idle'&&_0x5ac140[_0xc1c7('0x9')]){_0x5ac140[_0xc1c7('0x11')]=_0xc1c7('0x12');return![];}return _[_0xc1c7('0xb')]([_0x5ac140[_0xc1c7('0x13')],_0x5ac140[_0xc1c7('0x14')],_0x5ac140[_0xc1c7('0x15')],_0x5ac140[_0xc1c7('0x16')],_0x5ac140[_0xc1c7('0x17')],_0x5ac140[_0xc1c7('0x11')],_0x5ac140[_0xc1c7('0x18')]],isIdle);}function getRealtimeAgents(){return amiClient[_0xc1c7('0x19')]('Agents',{})[_0xc1c7('0x1a')](function(_0x335600){if(_0x335600[_0xc1c7('0x1b')]){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)');}var _0x94678a=_0x335600[_0xc1c7('0x1c')];return routingClient[_0xc1c7('0x19')](_0xc1c7('0x1d'),{})[_0xc1c7('0x1a')](function(_0xb42702){if(_0xb42702[_0xc1c7('0x1b')]){throw new Error(_0xc1c7('0x1e'));}var _0x5d44e9=_0xb42702[_0xc1c7('0x1c')];return _[_0xc1c7('0x1f')]({},_0x94678a,_0x5d44e9);});})[_0xc1c7('0x20')](function(_0x1bc9d){throw _0x1bc9d;});}exports['getRealtimeAgents']=getRealtimeAgents;function getAgentStatus(_0x124fd8){var _0x4d6171=_0xc1c7('0xe');if(isAgentPaused(_0x124fd8))_0x4d6171=_0xc1c7('0x12');else if(isAgentPaused(_0x124fd8,!![]))_0x4d6171='*pause';else if(isAgentIdle(_0x124fd8))_0x4d6171='idle';else _0x4d6171=_0xc1c7('0x21');return _0x4d6171;}exports[_0xc1c7('0x22')]=getAgentStatus;function getAgentIdsByQueues(_0x2f1b87,_0x4c6b34){var _0x813853=_[_0xc1c7('0x23')](_0x2f1b87)?_0x2f1b87:[_0x2f1b87];var _0x1751b6=_[_0xc1c7('0x24')](_0x4c6b34)+_0xc1c7('0x25');var _0x3a2483=_[_0xc1c7('0x26')](_0x813853,function(_0x120168){return db[_0x1751b6][_0xc1c7('0x27')]({'where':{'id':_0x120168}})[_0xc1c7('0x1a')](function(_0x29cf97){if(!_0x29cf97)return[];return _0x29cf97[_0xc1c7('0x28')]({'attributes':['id'],'raw':!![]});});});return Promise[_0xc1c7('0x29')](_0x3a2483)[_0xc1c7('0x1a')](function(_0xf1c405){var _0x21563a=_(_0xf1c405)['flatten']()[_0xc1c7('0x26')]('id')[_0xc1c7('0x2a')]()['value']();return _0x21563a;});}exports['getAgentIdsByQueues']=getAgentIdsByQueues;function getAgentIdsByStatus(_0x352f24,_0x539931,_0x544fbb){try{if(_0x539931[_0xc1c7('0xd')]>0x0){_0x352f24=_0x352f24[_0xc1c7('0xc')](function(_0x46d045){return _0x539931[_0xc1c7('0x2b')](_0x46d045['id']);});}var _0x461360=_0x352f24['filter'](function(_0x574e1c){var _0x1b6f97=_0xc1c7('0x21');if(isAgentIdle(_0x574e1c)){_0x1b6f97=_0xc1c7('0x2c');}return _0x1b6f97===_0x544fbb;});return _[_0xc1c7('0x26')](_0x461360,'id');}catch(_0x2e35f1){throw _0x2e35f1;}}exports['getAgentIdsByStatus']=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x50042f,_0x125920,_0x45a46c){return Promise['resolve']()[_0xc1c7('0x1a')](function(){if(_0x125920[_0xc1c7('0xd')]>0x0){_0x50042f=_0x50042f[_0xc1c7('0xc')](function(_0x1f9708){return _0x125920[_0xc1c7('0x2b')](_0x1f9708['id']);});}return _0x50042f;})[_0xc1c7('0x1a')](function(){return db[_0xc1c7('0x2d')]['findAll']({'attributes':['id',_0xc1c7('0x2e'),_0xc1c7('0x2f'),_0xc1c7('0x4'),_0xc1c7('0x5'),_0xc1c7('0x6'),_0xc1c7('0x7'),_0xc1c7('0x8'),_0xc1c7('0x9'),_0xc1c7('0xa'),'pauseType'],'where':{'id':{'$in':_['map'](_0x50042f,'id')}},'raw':!![]});})[_0xc1c7('0x1a')](function(_0x3bd89a){return _0x3bd89a[_0xc1c7('0x26')](function(_0x37220f){var _0x2a8665=_[_0xc1c7('0x30')](_0x50042f,['id',_0x37220f['id']]);var _0x1fc174=filterAgentAttributes(_0x2a8665);_[_0xc1c7('0x1f')](_0x37220f,_0x1fc174);_0x37220f[_0xc1c7('0x31')]=getAgentStatus(_0x37220f);return _0x37220f;});})[_0xc1c7('0x1a')](function(_0x3ad6a7){var _0x3cb2a0=sortAgentsByStatus(_0x3ad6a7,_0x45a46c);return _[_0xc1c7('0x26')](_0x3cb2a0,'id');})[_0xc1c7('0x20')](function(_0x43c8c1){throw _0x43c8c1;});}exports[_0xc1c7('0x32')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x41a847){var _0x3e4282={'fields':[],'order':null};var _0x2f9e9a=_0x41a847[_0xc1c7('0x33')](',');_0x3e4282[_0xc1c7('0x34')]=_['filter'](_0x2f9e9a,function(_0x568809){if(!_0x568809['includes'](_0xc1c7('0x31'))){return!![];}_0x3e4282['order']=_['startsWith'](_0x568809,'-')?_0xc1c7('0x35'):_0xc1c7('0x36');return![];});return _0x3e4282;}exports[_0xc1c7('0x37')]=getUpdatedSortOptions;function validateSortParameter(_0x146397){if(!_0x146397){_0x146397='fullname,internal';}if(_0x146397[_0xc1c7('0x2b')](_0xc1c7('0x2f'))&&!_0x146397[_0xc1c7('0x2b')](_0xc1c7('0x38'))){var _0x1a395c=_0x146397[_0xc1c7('0x39')](0x0,_0x146397[_0xc1c7('0x3a')](_0xc1c7('0x2f')));_0x146397+=','+_0x1a395c+_0xc1c7('0x38');}return _0x146397;}exports[_0xc1c7('0x3b')]=validateSortParameter;function sortAgentsByStatus(_0x955ba6,_0xc05b08){var _0x23d0b2=_0x955ba6['sort'](function(_0xbbf96d,_0x412520){if(_0xbbf96d['globalStatus']===_0x412520[_0xc1c7('0x31')]){if(_0xbbf96d[_0xc1c7('0x31')]===_0xc1c7('0x12')){if(_0xc05b08===_0xc1c7('0x35')){return(_0xbbf96d[_0xc1c7('0x3c')]||'')<(_0x412520[_0xc1c7('0x3c')]||'')||_0xbbf96d[_0xc1c7('0x2f')][_0xc1c7('0x3d')]()>_0x412520[_0xc1c7('0x2f')][_0xc1c7('0x3d')]()?0x1:-0x1;}else{return(_0xbbf96d['pauseType']||'')<(_0x412520[_0xc1c7('0x3c')]||'')||_0xbbf96d[_0xc1c7('0x2f')]['toLowerCase']()>_0x412520['fullname'][_0xc1c7('0x3d')]()?-0x1:0x1;}}else{if(_0xc05b08===_0xc1c7('0x35')){return _0xbbf96d[_0xc1c7('0x2f')][_0xc1c7('0x3d')]()<_0x412520[_0xc1c7('0x2f')]['toLowerCase']()?0x1:-0x1;}else{return _0xbbf96d[_0xc1c7('0x2f')][_0xc1c7('0x3d')]()<_0x412520['fullname']['toLowerCase']()?-0x1:0x1;}}}else{if(_0xc05b08==='DESC'){return _0xbbf96d[_0xc1c7('0x31')]<_0x412520[_0xc1c7('0x31')]?0x1:-0x1;}else{return _0xbbf96d[_0xc1c7('0x31')]<_0x412520['globalStatus']?-0x1:0x1;}}});return _0x23d0b2;}exports[_0xc1c7('0x3e')]=sortAgentsByStatus;function filterAgentAttributes(_0x1d9da8){var _0x5a7f68=[_0xc1c7('0x3f'),_0xc1c7('0x40'),_0xc1c7('0x41'),_0xc1c7('0x42'),_0xc1c7('0x3c'),_0xc1c7('0x42'),_0xc1c7('0x38'),_0xc1c7('0x43'),_0xc1c7('0x4'),_0xc1c7('0x7'),_0xc1c7('0x6'),_0xc1c7('0x8'),_0xc1c7('0xa'),_0xc1c7('0x5'),_0xc1c7('0x9'),_0xc1c7('0x44'),_0xc1c7('0x45'),_0xc1c7('0x46'),'smsCapacity',_0xc1c7('0x47'),'faxCapacity',_0xc1c7('0x48'),_0xc1c7('0x49'),_0xc1c7('0x4a'),'smsCurrentCapacity',_0xc1c7('0x4b'),_0xc1c7('0x4c'),'chatStatus','openchannelStatus','mailStatus',_0xc1c7('0x17'),_0xc1c7('0x18'),'faxStatus',_0xc1c7('0x11'),_0xc1c7('0x4d'),_0xc1c7('0x4e'),_0xc1c7('0x4f'),_0xc1c7('0x50'),_0xc1c7('0x51'),'faxStatusTime',_0xc1c7('0x52'),'queue',_0xc1c7('0x53'),_0xc1c7('0x54'),_0xc1c7('0x55'),'phoneBarEnableAutomaticScreenRecording'];var _0x3b4a7d=[_0xc1c7('0x4'),_0xc1c7('0x7'),_0xc1c7('0x6'),_0xc1c7('0x8'),_0xc1c7('0xa'),_0xc1c7('0x5'),_0xc1c7('0x9'),'online'];var _0x194865=_(_0x1d9da8)[_0xc1c7('0x56')](_0x3b4a7d)[_0xc1c7('0x57')](_0x5a7f68)['value']();return _0x194865;}exports['filterAgentAttributes']=filterAgentAttributes;function getRealtimeAgentsQueryFields(){return['id',_0xc1c7('0x2e'),_0xc1c7('0x2f'),_0xc1c7('0x58'),'internal',_0xc1c7('0x40'),'globalStatus',_0xc1c7('0x3f'),_0xc1c7('0x41'),_0xc1c7('0x3c'),_0xc1c7('0x42'),_0xc1c7('0x5'),_0xc1c7('0x4'),_0xc1c7('0x6'),'openchannelPause',_0xc1c7('0x8'),_0xc1c7('0x9'),_0xc1c7('0xa'),'chatStatus',_0xc1c7('0x14'),'mailStatus',_0xc1c7('0x16'),'smsStatus',_0xc1c7('0x11'),_0xc1c7('0x18'),_0xc1c7('0x4d'),_0xc1c7('0x59'),_0xc1c7('0x4f'),'openchannelStatusTime','smsStatusTime','voiceStatusTime',_0xc1c7('0x51'),_0xc1c7('0x44'),_0xc1c7('0x5a'),_0xc1c7('0x46'),_0xc1c7('0x45'),_0xc1c7('0x5b'),'whatsappCapacity',_0xc1c7('0x48'),_0xc1c7('0x4c'),_0xc1c7('0x4a'),_0xc1c7('0x49'),'smsCurrentCapacity',_0xc1c7('0x4b'),_0xc1c7('0x55'),_0xc1c7('0x5c'),'destconnectedlinenum',_0xc1c7('0x5d'),_0xc1c7('0x5e'),_0xc1c7('0x54')];}exports[_0xc1c7('0x5f')]=getRealtimeAgentsQueryFields; \ No newline at end of file +var _0xb2f3=['findOne','getAgents','flatten','getAgentIdsByQueues','includes','User','name','fullname','pauseType','find','getSortedAgentsIdsByStatus','split','fields','startsWith','DESC','getUpdatedSortOptions','fullname,internal','internal','indexOf','validateSortParameter','sort','globalStatus','toLowerCase','sortAgentsByStatus','userpic','online','lastLoginAt','lastPauseAt','address','chatCapacity','openchannelCapacity','smsCapacity','whatsappCapacity','mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','openchannelStatus','chatStatusTime','faxStatusTime','voiceStatusTime','queue','destconnectedlinenum','phoneBarEnableScreenRecordingByAgent','omit','pick','filterAgentAttributes','mailStatusTime','openchannelStatusTime','smsStatusTime','whatsappStatusTime','faxCapacity','mailCapacity','chatCurrentCapacity','phoneBarEnableAutomaticScreenRecording','screenrecording','getRealtimeAgentsQueryFields','lodash','jayson/promise','../../mysqldb','client','http','chatPause','faxPause','mailPause','openchannelPause','smsPause','whatsappPause','filter','length','idle','unknown','unavailable','ringing','isNil','voiceStatus','voicePause','pause','every','chatStatus','faxStatus','mailStatus','smsStatus','whatsappStatus','request','then','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','catch','getRealtimeAgents','busy','getAgentStatus','isArray','startCase','map'];(function(_0x131536,_0x4aab80){var _0x1c4de5=function(_0x286227){while(--_0x286227){_0x131536['push'](_0x131536['shift']());}};_0x1c4de5(++_0x4aab80);}(_0xb2f3,0xfd));var _0x3b2f=function(_0x35885a,_0x42fed7){_0x35885a=_0x35885a-0x0;var _0xe86249=_0xb2f3[_0x35885a];return _0xe86249;};'use strict';var _=require(_0x3b2f('0x0'));var jayson=require(_0x3b2f('0x1'));var db=require(_0x3b2f('0x2'))['db'];var amiClient=jayson[_0x3b2f('0x3')][_0x3b2f('0x4')]({'port':0x232a});var routingClient=jayson[_0x3b2f('0x3')][_0x3b2f('0x4')]({'port':0x232c});function isAgentPaused(_0x4f9278,_0x6748ce){var _0x3e35a1=[_0x4f9278[_0x3b2f('0x5')],_0x4f9278[_0x3b2f('0x6')],_0x4f9278[_0x3b2f('0x7')],_0x4f9278[_0x3b2f('0x8')],_0x4f9278[_0x3b2f('0x9')],_0x4f9278['voicePause'],_0x4f9278[_0x3b2f('0xa')]];if(!_0x6748ce)return _['every'](_0x3e35a1);var _0x266ed2=_[_0x3b2f('0xb')](_0x3e35a1);return _0x266ed2[_0x3b2f('0xc')]>0x0&&_0x266ed2[_0x3b2f('0xc')]<_0x3e35a1['length']?!![]:![];}function isIdle(_0x4ee831){return _0x4ee831===_0x3b2f('0xd')||_0x4ee831===_0x3b2f('0xe')||_0x4ee831===_0x3b2f('0xf')||_0x4ee831===_0x3b2f('0x10')||_[_0x3b2f('0x11')](_0x4ee831);}function isAgentIdle(_0x3feb27){if(_0x3feb27[_0x3b2f('0x12')]!==_0x3b2f('0xd')&&_0x3feb27[_0x3b2f('0x13')]){_0x3feb27[_0x3b2f('0x12')]=_0x3b2f('0x14');return![];}return _[_0x3b2f('0x15')]([_0x3feb27[_0x3b2f('0x16')],_0x3feb27[_0x3b2f('0x17')],_0x3feb27[_0x3b2f('0x18')],_0x3feb27['openchannelStatus'],_0x3feb27[_0x3b2f('0x19')],_0x3feb27['voiceStatus'],_0x3feb27[_0x3b2f('0x1a')]],isIdle);}function getRealtimeAgents(){return amiClient[_0x3b2f('0x1b')]('Agents',{})[_0x3b2f('0x1c')](function(_0x4c028a){if(_0x4c028a[_0x3b2f('0x1d')]){throw new Error(_0x3b2f('0x1e'));}var _0xd5a583=_0x4c028a[_0x3b2f('0x1f')];return routingClient['request']('Agents',{})[_0x3b2f('0x1c')](function(_0x6d8948){if(_0x6d8948[_0x3b2f('0x1d')]){throw new Error(_0x3b2f('0x20'));}var _0x3dea8b=_0x6d8948[_0x3b2f('0x1f')];return _[_0x3b2f('0x21')]({},_0xd5a583,_0x3dea8b);});})[_0x3b2f('0x22')](function(_0x1a93b3){throw _0x1a93b3;});}exports[_0x3b2f('0x23')]=getRealtimeAgents;function getAgentStatus(_0x9d7819){var _0x2116aa=_0x3b2f('0xe');if(isAgentPaused(_0x9d7819))_0x2116aa=_0x3b2f('0x14');else if(isAgentPaused(_0x9d7819,!![]))_0x2116aa='*pause';else if(isAgentIdle(_0x9d7819))_0x2116aa=_0x3b2f('0xd');else _0x2116aa=_0x3b2f('0x24');return _0x2116aa;}exports[_0x3b2f('0x25')]=getAgentStatus;function getAgentIdsByQueues(_0xef73a0,_0x57e96a){var _0x1476a0=_[_0x3b2f('0x26')](_0xef73a0)?_0xef73a0:[_0xef73a0];var _0x5ed7bd=_[_0x3b2f('0x27')](_0x57e96a)+'Queue';var _0x28ef68=_[_0x3b2f('0x28')](_0x1476a0,function(_0x267fa5){return db[_0x5ed7bd][_0x3b2f('0x29')]({'where':{'id':_0x267fa5}})['then'](function(_0x36f73b){if(!_0x36f73b)return[];return _0x36f73b[_0x3b2f('0x2a')]({'attributes':['id'],'raw':!![]});});});return Promise['all'](_0x28ef68)['then'](function(_0x11e9e7){var _0x44fa57=_(_0x11e9e7)[_0x3b2f('0x2b')]()[_0x3b2f('0x28')]('id')['uniq']()['value']();return _0x44fa57;});}exports[_0x3b2f('0x2c')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x5a39f0,_0xd3e5b2,_0x2a9afe){try{if(_0xd3e5b2['length']>0x0){_0x5a39f0=_0x5a39f0[_0x3b2f('0xb')](function(_0x4b76ea){return _0xd3e5b2[_0x3b2f('0x2d')](_0x4b76ea['id']);});}var _0x21c8a4=_0x5a39f0[_0x3b2f('0xb')](function(_0x469fc9){var _0x3f4bd2=_0x3b2f('0x24');if(isAgentIdle(_0x469fc9)){_0x3f4bd2='idle';}return _0x3f4bd2===_0x2a9afe;});return _[_0x3b2f('0x28')](_0x21c8a4,'id');}catch(_0x335e75){throw _0x335e75;}}exports['getAgentIdsByStatus']=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x500e82,_0x450080,_0x3380d4){return Promise['resolve']()['then'](function(){if(_0x450080[_0x3b2f('0xc')]>0x0){_0x500e82=_0x500e82[_0x3b2f('0xb')](function(_0x2bab13){return _0x450080[_0x3b2f('0x2d')](_0x2bab13['id']);});}return _0x500e82;})[_0x3b2f('0x1c')](function(){return db[_0x3b2f('0x2e')]['findAll']({'attributes':['id',_0x3b2f('0x2f'),_0x3b2f('0x30'),'chatPause',_0x3b2f('0x6'),_0x3b2f('0x7'),_0x3b2f('0x8'),_0x3b2f('0x9'),'voicePause',_0x3b2f('0xa'),_0x3b2f('0x31')],'where':{'id':{'$in':_[_0x3b2f('0x28')](_0x500e82,'id')}},'raw':!![]});})[_0x3b2f('0x1c')](function(_0x500b73){return _0x500b73['map'](function(_0x2421ce){var _0x30214f=_[_0x3b2f('0x32')](_0x500e82,['id',_0x2421ce['id']]);var _0xf0f1c=filterAgentAttributes(_0x30214f);_[_0x3b2f('0x21')](_0x2421ce,_0xf0f1c);_0x2421ce['globalStatus']=getAgentStatus(_0x2421ce);return _0x2421ce;});})['then'](function(_0xf7fb3){var _0x1af83a=sortAgentsByStatus(_0xf7fb3,_0x3380d4);return _[_0x3b2f('0x28')](_0x1af83a,'id');})['catch'](function(_0x296d4e){throw _0x296d4e;});}exports[_0x3b2f('0x33')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x2e50f4){var _0x5e1cde={'fields':[],'order':null};var _0x29eddb=_0x2e50f4[_0x3b2f('0x34')](',');_0x5e1cde[_0x3b2f('0x35')]=_['filter'](_0x29eddb,function(_0x51bdef){if(!_0x51bdef[_0x3b2f('0x2d')]('globalStatus')){return!![];}_0x5e1cde['order']=_[_0x3b2f('0x36')](_0x51bdef,'-')?_0x3b2f('0x37'):'ASC';return![];});return _0x5e1cde;}exports[_0x3b2f('0x38')]=getUpdatedSortOptions;function validateSortParameter(_0x39bf5){if(!_0x39bf5){_0x39bf5=_0x3b2f('0x39');}if(_0x39bf5[_0x3b2f('0x2d')](_0x3b2f('0x30'))&&!_0x39bf5[_0x3b2f('0x2d')](_0x3b2f('0x3a'))){var _0x1b0e8e=_0x39bf5['substring'](0x0,_0x39bf5[_0x3b2f('0x3b')](_0x3b2f('0x30')));_0x39bf5+=','+_0x1b0e8e+_0x3b2f('0x3a');}return _0x39bf5;}exports[_0x3b2f('0x3c')]=validateSortParameter;function sortAgentsByStatus(_0x2f3691,_0x3fbc7e){var _0x24981f=_0x2f3691[_0x3b2f('0x3d')](function(_0x21acde,_0x507813){if(_0x21acde[_0x3b2f('0x3e')]===_0x507813[_0x3b2f('0x3e')]){if(_0x21acde[_0x3b2f('0x3e')]==='pause'){if(_0x3fbc7e===_0x3b2f('0x37')){return(_0x21acde['pauseType']||'')<(_0x507813[_0x3b2f('0x31')]||'')||_0x21acde[_0x3b2f('0x30')][_0x3b2f('0x3f')]()>_0x507813[_0x3b2f('0x30')][_0x3b2f('0x3f')]()?0x1:-0x1;}else{return(_0x21acde[_0x3b2f('0x31')]||'')<(_0x507813['pauseType']||'')||_0x21acde[_0x3b2f('0x30')]['toLowerCase']()>_0x507813[_0x3b2f('0x30')][_0x3b2f('0x3f')]()?-0x1:0x1;}}else{if(_0x3fbc7e==='DESC'){return _0x21acde[_0x3b2f('0x30')][_0x3b2f('0x3f')]()<_0x507813[_0x3b2f('0x30')][_0x3b2f('0x3f')]()?0x1:-0x1;}else{return _0x21acde[_0x3b2f('0x30')]['toLowerCase']()<_0x507813['fullname'][_0x3b2f('0x3f')]()?-0x1:0x1;}}}else{if(_0x3fbc7e==='DESC'){return _0x21acde[_0x3b2f('0x3e')]<_0x507813['globalStatus']?0x1:-0x1;}else{return _0x21acde[_0x3b2f('0x3e')]<_0x507813[_0x3b2f('0x3e')]?-0x1:0x1;}}});return _0x24981f;}exports[_0x3b2f('0x40')]=sortAgentsByStatus;function filterAgentAttributes(_0x1d6ce0){var _0x4e6557=[_0x3b2f('0x41'),_0x3b2f('0x42'),_0x3b2f('0x43'),'lastPauseAt',_0x3b2f('0x31'),_0x3b2f('0x44'),_0x3b2f('0x3a'),_0x3b2f('0x45'),'chatPause',_0x3b2f('0x8'),_0x3b2f('0x7'),_0x3b2f('0x9'),_0x3b2f('0xa'),_0x3b2f('0x6'),_0x3b2f('0x13'),_0x3b2f('0x46'),_0x3b2f('0x47'),'mailCapacity',_0x3b2f('0x48'),_0x3b2f('0x49'),'faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity',_0x3b2f('0x4a'),_0x3b2f('0x4b'),_0x3b2f('0x4c'),_0x3b2f('0x4d'),'chatStatus',_0x3b2f('0x4e'),_0x3b2f('0x18'),'smsStatus','whatsappStatus','faxStatus',_0x3b2f('0x12'),_0x3b2f('0x4f'),'openchannelStatusTime','mailStatusTime','smsStatusTime','whatsappStatusTime',_0x3b2f('0x50'),_0x3b2f('0x51'),_0x3b2f('0x52'),_0x3b2f('0x53'),'screenrecording',_0x3b2f('0x54'),'phoneBarEnableAutomaticScreenRecording'];var _0x35c68a=[_0x3b2f('0x5'),_0x3b2f('0x8'),_0x3b2f('0x7'),'smsPause','whatsappPause','faxPause','voicePause',_0x3b2f('0x42')];var _0x56e5c9=_(_0x1d6ce0)[_0x3b2f('0x55')](_0x35c68a)[_0x3b2f('0x56')](_0x4e6557)['value']();return _0x56e5c9;}exports[_0x3b2f('0x57')]=filterAgentAttributes;function getRealtimeAgentsQueryFields(){return['id',_0x3b2f('0x2f'),_0x3b2f('0x30'),'role',_0x3b2f('0x3a'),_0x3b2f('0x42'),'globalStatus','userpic',_0x3b2f('0x43'),_0x3b2f('0x31'),_0x3b2f('0x44'),_0x3b2f('0x6'),'chatPause',_0x3b2f('0x7'),'openchannelPause',_0x3b2f('0x9'),'voicePause',_0x3b2f('0xa'),_0x3b2f('0x16'),'faxStatus',_0x3b2f('0x18'),_0x3b2f('0x4e'),_0x3b2f('0x19'),'voiceStatus','whatsappStatus',_0x3b2f('0x4f'),_0x3b2f('0x50'),_0x3b2f('0x58'),_0x3b2f('0x59'),_0x3b2f('0x5a'),'voiceStatusTime',_0x3b2f('0x5b'),_0x3b2f('0x46'),_0x3b2f('0x5c'),_0x3b2f('0x5d'),_0x3b2f('0x47'),_0x3b2f('0x48'),'whatsappCapacity',_0x3b2f('0x5e'),'faxCurrentCapacity',_0x3b2f('0x4a'),'openchannelCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','phoneBarEnableScreenRecordingByAgent',_0x3b2f('0x5f'),_0x3b2f('0x53'),'onhold',_0x3b2f('0x52'),_0x3b2f('0x60')];}exports[_0x3b2f('0x61')]=getRealtimeAgentsQueryFields; \ No newline at end of file diff --git a/server/components/realtime/queues.js b/server/components/realtime/queues.js index 5d22b14..cdb93cd 100644 --- a/server/components/realtime/queues.js +++ b/server/components/realtime/queues.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5edd=['waiting','busy','originated','find','merge','lodash','jayson/promise','client','available','loggedIn','paused','inUse','invalid','loggedInDb','notInUse','onHold','ringing','ringInUse','talking','unknown','pTalking','message','statusMessage','startPredictive','startProgressive','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','request','startCase','then','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','catch','getRealtimeQueues','voice','inbound','outbound','map','get'];(function(_0x31768c,_0x40865c){var _0x3bdd3c=function(_0x299159){while(--_0x299159){_0x31768c['push'](_0x31768c['shift']());}};_0x3bdd3c(++_0x40865c);}(_0x5edd,0x1e9));var _0xd5ed=function(_0x474bc0,_0x26989c){_0x474bc0=_0x474bc0-0x0;var _0x4b24cf=_0x5edd[_0x474bc0];return _0x4b24cf;};'use strict';var _=require(_0xd5ed('0x0'));var jayson=require(_0xd5ed('0x1'));var util=require('util');var amiClient=jayson[_0xd5ed('0x2')]['http']({'port':0x232a});var routingClient=jayson[_0xd5ed('0x2')]['http']({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=[_0xd5ed('0x3'),_0xd5ed('0x4'),_0xd5ed('0x5'),'waiting'];var VOICE_QUEUE_ATTRIBUTES=['busy',_0xd5ed('0x6'),_0xd5ed('0x7'),_0xd5ed('0x8'),_0xd5ed('0x9'),_0xd5ed('0xa'),_0xd5ed('0xb'),_0xd5ed('0xc'),_0xd5ed('0xd'),'unavailable',_0xd5ed('0xe')];var OUTBOUND_QUEUE_ATTRIBUTES=[_0xd5ed('0xf'),'originated',_0xd5ed('0x10'),_0xd5ed('0x11'),'dialActive','dialMethod','Trunk',_0xd5ed('0x12'),_0xd5ed('0x13'),'erlangCalls',_0xd5ed('0x14'),_0xd5ed('0x15'),_0xd5ed('0x16'),_0xd5ed('0x17'),'dialPredictiveIntervalMaxThreshold',_0xd5ed('0x18'),_0xd5ed('0x19'),'predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit',_0xd5ed('0x1a'),_0xd5ed('0x1b')];function getRealtimeQueues(_0x31bad9,_0xe59312){var _0x23f15e=_0xe59312==='voice'?amiClient:routingClient;return _0x23f15e[_0xd5ed('0x1c')](_[_0xd5ed('0x1d')](_0xe59312)+'Queues',_0x31bad9)[_0xd5ed('0x1e')](function(_0x52df12){if(_0x52df12['error'])throw new Error(util['format'](_0xd5ed('0x1f'),_0xe59312));return _0x52df12['result'];})[_0xd5ed('0x20')](function(_0x36e0fe){throw _0x36e0fe;});}exports[_0xd5ed('0x21')]=getRealtimeQueues;function initializeQueues(_0x12ef3d,_0x415c21,_0x312f6e,_0x6a7904){var _0x1b6774=DEFAULT_QUEUE_ATTRIBUTES;if(_0x312f6e===_0xd5ed('0x22')){if(_0x6a7904===_0xd5ed('0x23')){_0x1b6774=_0x1b6774['concat'](VOICE_QUEUE_ATTRIBUTES);}else if(_0x6a7904===_0xd5ed('0x24')){_0x1b6774=_0x1b6774['concat'](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x12ef3d[_0xd5ed('0x25')](function(_0xc90650){var _0x30ce1a=_0xc90650[_0xd5ed('0x26')]({'plain':!![]});_0x30ce1a['paused']=0x0;_0x30ce1a[_0xd5ed('0x8')]=0x0;_0x30ce1a[_0xd5ed('0x4')]=0x0;_0x30ce1a[_0xd5ed('0x3')]=0x0;_0x30ce1a[_0xd5ed('0x27')]=0x0;if(_0x312f6e===_0xd5ed('0x22')){_0x30ce1a[_0xd5ed('0xd')]=0x0;_0x30ce1a[_0xd5ed('0x28')]=0x0;if(_0x6a7904===_0xd5ed('0x24')){_0x30ce1a[_0xd5ed('0xf')]=0x0;_0x30ce1a[_0xd5ed('0x29')]=0x0;}}var _0x643bda=_[_0xd5ed('0x2a')](_0x415c21,['id',_0x30ce1a['id']]);if(_0x643bda){_[_0xd5ed('0x2b')](_0x30ce1a,_['pick'](_0x643bda,_0x1b6774));}return _0x30ce1a;});}exports['initializeQueues']=initializeQueues; \ No newline at end of file +var _0xe7aa=['predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','voice','startCase','Queues','error','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','catch','getRealtimeQueues','inbound','concat','outbound','pTalking','find','merge','pick','initializeQueues','lodash','jayson/promise','util','client','http','available','loggedIn','paused','waiting','busy','invalid','loggedInDb','onHold','ringing','ringInUse','talking','unavailable','unknown','originated','message','statusMessage','dialActive','dialMethod','startPredictive','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','predictiveIntervalAvailable','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xe7aa,0x107));var _0xae7a=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xe7aa[_0x47b58b];return _0x46bebe;};'use strict';var _=require(_0xae7a('0x0'));var jayson=require(_0xae7a('0x1'));var util=require(_0xae7a('0x2'));var amiClient=jayson['client']['http']({'port':0x232a});var routingClient=jayson[_0xae7a('0x3')][_0xae7a('0x4')]({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=[_0xae7a('0x5'),_0xae7a('0x6'),_0xae7a('0x7'),_0xae7a('0x8')];var VOICE_QUEUE_ATTRIBUTES=[_0xae7a('0x9'),'inUse',_0xae7a('0xa'),_0xae7a('0xb'),'notInUse',_0xae7a('0xc'),_0xae7a('0xd'),_0xae7a('0xe'),_0xae7a('0xf'),_0xae7a('0x10'),_0xae7a('0x11')];var OUTBOUND_QUEUE_ATTRIBUTES=['pTalking',_0xae7a('0x12'),_0xae7a('0x13'),_0xae7a('0x14'),_0xae7a('0x15'),_0xae7a('0x16'),'Trunk',_0xae7a('0x17'),'startProgressive','erlangCalls',_0xae7a('0x18'),_0xae7a('0x19'),_0xae7a('0x1a'),'dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold',_0xae7a('0x1b'),'predictiveIntervalTotalCalls',_0xae7a('0x1c'),_0xae7a('0x1d'),_0xae7a('0x1e'),_0xae7a('0x1f'),_0xae7a('0x20')];function getRealtimeQueues(_0xa2ef64,_0x34b3b2){var _0x14883a=_0x34b3b2===_0xae7a('0x21')?amiClient:routingClient;return _0x14883a['request'](_[_0xae7a('0x22')](_0x34b3b2)+_0xae7a('0x23'),_0xa2ef64)['then'](function(_0x502f87){if(_0x502f87[_0xae7a('0x24')])throw new Error(util[_0xae7a('0x25')](_0xae7a('0x26'),_0x34b3b2));return _0x502f87['result'];})[_0xae7a('0x27')](function(_0x27e81e){throw _0x27e81e;});}exports[_0xae7a('0x28')]=getRealtimeQueues;function initializeQueues(_0x5f4547,_0x4e3bcf,_0x34f21c,_0x341a0f){var _0x4c70ad=DEFAULT_QUEUE_ATTRIBUTES;if(_0x34f21c===_0xae7a('0x21')){if(_0x341a0f===_0xae7a('0x29')){_0x4c70ad=_0x4c70ad[_0xae7a('0x2a')](VOICE_QUEUE_ATTRIBUTES);}else if(_0x341a0f===_0xae7a('0x2b')){_0x4c70ad=_0x4c70ad['concat'](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x5f4547['map'](function(_0x31defb){var _0x1d9c50=_0x31defb['get']({'plain':!![]});_0x1d9c50[_0xae7a('0x7')]=0x0;_0x1d9c50['loggedInDb']=0x0;_0x1d9c50[_0xae7a('0x6')]=0x0;_0x1d9c50[_0xae7a('0x5')]=0x0;_0x1d9c50[_0xae7a('0x8')]=0x0;if(_0x34f21c===_0xae7a('0x21')){_0x1d9c50[_0xae7a('0xf')]=0x0;_0x1d9c50[_0xae7a('0x9')]=0x0;if(_0x341a0f===_0xae7a('0x2b')){_0x1d9c50[_0xae7a('0x2c')]=0x0;_0x1d9c50['originated']=0x0;}}var _0x3d861e=_[_0xae7a('0x2d')](_0x4e3bcf,['id',_0x1d9c50['id']]);if(_0x3d861e){_[_0xae7a('0x2e')](_0x1d9c50,_[_0xae7a('0x2f')](_0x3d861e,_0x4c70ad));}return _0x1d9c50;});}exports[_0xae7a('0x30')]=initializeQueues; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index c27d2b0..c809a2b 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['get','production','set','appPath','public','join','root','client','use','toISOString','split','static','views','/server/views','engine','html','ejs','urlencoded','50mb','json','initialize','express','method-override','cookie-parser','passport','./environment','default'];(function(_0x4358f5,_0x5b1ac6){var _0x4d8104=function(_0x1d4aee){while(--_0x1d4aee){_0x4358f5['push'](_0x4358f5['shift']());}};_0x4d8104(++_0x5b1ac6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xa9e0[_0x28947d];return _0x12d2ee;};'use strict';var express=require(_0x0a9e('0x0'));var methodOverride=require(_0x0a9e('0x1'));var cookieParser=require(_0x0a9e('0x2'));var errorHandler=require('errorhandler');var path=require('path');var passport=require(_0x0a9e('0x3'));var cors=require('cors');var config=require(_0x0a9e('0x4'));exports[_0x0a9e('0x5')]=function(_0x2ab90b){var _0x991246=_0x2ab90b[_0x0a9e('0x6')]('env');if(_0x991246===_0x0a9e('0x7')){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path['join'](config['root'],_0x0a9e('0xa')));}if(_0x991246==='development'||_0x991246==='test'){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path[_0x0a9e('0xb')](config[_0x0a9e('0xc')],_0x0a9e('0xd')));_0x2ab90b[_0x0a9e('0xe')](errorHandler());}_0x2ab90b['set']('json\x20replacer',function(_0x527cdd,_0x4cfe67){if(this[_0x527cdd]instanceof Date){_0x4cfe67=this[_0x527cdd][_0x0a9e('0xf')]()[_0x0a9e('0x10')]('.')[0x0]+'Z';}return _0x4cfe67;});_0x2ab90b[_0x0a9e('0xe')](express[_0x0a9e('0x11')](_0x2ab90b[_0x0a9e('0x6')](_0x0a9e('0x9'))));_0x2ab90b['set'](_0x0a9e('0x12'),config[_0x0a9e('0xc')]+_0x0a9e('0x13'));_0x2ab90b[_0x0a9e('0x14')](_0x0a9e('0x15'),require(_0x0a9e('0x16'))['renderFile']);_0x2ab90b[_0x0a9e('0x8')]('view\x20engine',_0x0a9e('0x15'));_0x2ab90b['use'](express[_0x0a9e('0x17')]({'limit':_0x0a9e('0x18'),'extended':!![]}));_0x2ab90b['use'](express[_0x0a9e('0x19')]({'limit':'50mb'}));_0x2ab90b[_0x0a9e('0xe')](cors());_0x2ab90b[_0x0a9e('0xe')](methodOverride());_0x2ab90b[_0x0a9e('0xe')](cookieParser());_0x2ab90b[_0x0a9e('0xe')](passport[_0x0a9e('0x1a')]());}; \ No newline at end of file +var _0x9957=['root','public','test','join','client','use','json\x20replacer','toISOString','split','static','/server/views','engine','html','ejs','renderFile','view\x20engine','urlencoded','json','50mb','express','method-override','cookie-parser','errorhandler','passport','cors','./environment','default','get','env','production','set','appPath'];(function(_0x19eb1c,_0xd78b93){var _0x107257=function(_0x386e80){while(--_0x386e80){_0x19eb1c['push'](_0x19eb1c['shift']());}};_0x107257(++_0xd78b93);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var express=require(_0x7995('0x0'));var methodOverride=require(_0x7995('0x1'));var cookieParser=require(_0x7995('0x2'));var errorHandler=require(_0x7995('0x3'));var path=require('path');var passport=require(_0x7995('0x4'));var cors=require(_0x7995('0x5'));var config=require(_0x7995('0x6'));exports[_0x7995('0x7')]=function(_0x576d89){var _0x744bea=_0x576d89[_0x7995('0x8')](_0x7995('0x9'));if(_0x744bea===_0x7995('0xa')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path['join'](config[_0x7995('0xd')],_0x7995('0xe')));}if(_0x744bea==='development'||_0x744bea===_0x7995('0xf')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path[_0x7995('0x10')](config[_0x7995('0xd')],_0x7995('0x11')));_0x576d89[_0x7995('0x12')](errorHandler());}_0x576d89['set'](_0x7995('0x13'),function(_0x41c652,_0x581f22){if(this[_0x41c652]instanceof Date){_0x581f22=this[_0x41c652][_0x7995('0x14')]()[_0x7995('0x15')]('.')[0x0]+'Z';}return _0x581f22;});_0x576d89[_0x7995('0x12')](express[_0x7995('0x16')](_0x576d89[_0x7995('0x8')](_0x7995('0xc'))));_0x576d89[_0x7995('0xb')]('views',config['root']+_0x7995('0x17'));_0x576d89[_0x7995('0x18')](_0x7995('0x19'),require(_0x7995('0x1a'))[_0x7995('0x1b')]);_0x576d89[_0x7995('0xb')](_0x7995('0x1c'),_0x7995('0x19'));_0x576d89['use'](express[_0x7995('0x1d')]({'limit':'50mb','extended':!![]}));_0x576d89[_0x7995('0x12')](express[_0x7995('0x1e')]({'limit':_0x7995('0x1f')}));_0x576d89[_0x7995('0x12')](cors());_0x576d89[_0x7995('0x12')](methodOverride());_0x576d89[_0x7995('0x12')](cookieParser());_0x576d89['use'](passport['initialize']());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index 8596ac0..0e974d2 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 _0x3dc7=['IPv4','internal','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','cpus','model','join','createHash','md5','update','hex','platform','licenseToken','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','ipAddress','digest','substring','child_process','execSync','../environment','networkInterfaces','orderBy','length','filter','family'];(function(_0x5a0496,_0x2c8c2c){var _0x5b0d3d=function(_0xee7aae){while(--_0xee7aae){_0x5a0496['push'](_0x5a0496['shift']());}};_0x5b0d3d(++_0x2c8c2c);}(_0x3dc7,0x9d));var _0x73dc=function(_0x45772c,_0x4b6986){_0x45772c=_0x45772c-0x0;var _0x41c8b6=_0x3dc7[_0x45772c];return _0x41c8b6;};'use strict';var _=require('lodash');var os=require('os');var crypto=require('crypto');var machine=require('bimedia-machine-uuid');var exec=require(_0x73dc('0x0'))[_0x73dc('0x1')];var config=require(_0x73dc('0x2'));function getInterfaces(){var _0x52a746=[];var _0x4ed0d4=os[_0x73dc('0x3')]();var _0x4f0a9e=_[_0x73dc('0x4')](_['keys'](_0x4ed0d4));for(var _0x5078d0=0x0;_0x5078d0<_0x4f0a9e[_0x73dc('0x5')];_0x5078d0++){var _0x55f046=_0x4ed0d4[_0x4f0a9e[_0x5078d0]][_0x73dc('0x6')](function(_0x15b54c){return _0x15b54c[_0x73dc('0x7')]===_0x73dc('0x8')&&_0x15b54c[_0x73dc('0x9')]===![];});_0x52a746=_0x52a746['concat'](_0x55f046);}return _0x52a746;}function getFirstInterface(){var _0x425661=_[_0x73dc('0xa')](getInterfaces());return{'macAddress':_0x425661&&_0x425661[_0x73dc('0xb')]?_0x425661[_0x73dc('0xb')]:_0x73dc('0xc'),'ipAddress':_0x425661&&_0x425661[_0x73dc('0xd')]?_0x425661[_0x73dc('0xd')]:_0x73dc('0xe')};}exports[_0x73dc('0xf')]=getFirstInterface;function getCPUhash(){var _0x1358df=_[_0x73dc('0x4')](os[_0x73dc('0x10')]()['map'](function(_0x51ce6b){return _0x51ce6b[_0x73dc('0x11')];}))[_0x73dc('0x12')](':');return crypto[_0x73dc('0x13')](_0x73dc('0x14'))[_0x73dc('0x15')](_0x1358df)['digest'](_0x73dc('0x16'));}exports['getUuid']=function(){var _0x372f2d=os[_0x73dc('0x17')]();var _0x5afba0=/[0-9a-f-]{36}/;if(config[_0x73dc('0x18')]&&_0x5afba0['test'](config[_0x73dc('0x18')])){return config['licenseToken'];}else if(_0x372f2d===_0x73dc('0x19')){return exec(_0x73dc('0x1a'),{'encoding':_0x73dc('0x1b')})[_0x73dc('0x1c')]('\x0d\x0a','');}else{var _0x2cd748=getFirstInterface();var _0x23636f=getCPUhash();var _0x3cdbd2=_0x23636f+'|'+os[_0x73dc('0x1d')]()+'|'+_0x2cd748['macAddress']+'|'+_0x2cd748[_0x73dc('0x1e')];var _0x12b536=crypto[_0x73dc('0x13')](_0x73dc('0x14'))[_0x73dc('0x15')](_0x3cdbd2)[_0x73dc('0x1f')](_0x73dc('0x16'));return _0x12b536[_0x73dc('0x20')](0x0,0x8)+'-'+_0x12b536[_0x73dc('0x20')](0x8,0xc)+'-'+_0x12b536[_0x73dc('0x20')](0xc,0x10)+'-'+_0x12b536[_0x73dc('0x20')](0x10,0x14)+'-'+_0x12b536['substring'](0x14);}}; \ No newline at end of file +var _0x0b3c=['utf8','replace','hostname','md5','substring','lodash','crypto','bimedia-machine-uuid','child_process','../environment','networkInterfaces','orderBy','keys','family','IPv4','head','mac','00:00:00:00:00:00','127.0.0.1','getFirstInterface','map','model','join','createHash','update','digest','hex','getUuid','licenseToken','test'];(function(_0x34859a,_0x3de4f5){var _0xbe0a03=function(_0x216094){while(--_0x216094){_0x34859a['push'](_0x34859a['shift']());}};_0xbe0a03(++_0x3de4f5);}(_0x0b3c,0x18b));var _0xc0b3=function(_0x5f79cb,_0x4b2c88){_0x5f79cb=_0x5f79cb-0x0;var _0x3580bc=_0x0b3c[_0x5f79cb];return _0x3580bc;};'use strict';var _=require(_0xc0b3('0x0'));var os=require('os');var crypto=require(_0xc0b3('0x1'));var machine=require(_0xc0b3('0x2'));var exec=require(_0xc0b3('0x3'))['execSync'];var config=require(_0xc0b3('0x4'));function getInterfaces(){var _0x45549c=[];var _0x38f9d0=os[_0xc0b3('0x5')]();var _0x290e59=_[_0xc0b3('0x6')](_[_0xc0b3('0x7')](_0x38f9d0));for(var _0x145342=0x0;_0x145342<_0x290e59['length'];_0x145342++){var _0x14a9a8=_0x38f9d0[_0x290e59[_0x145342]]['filter'](function(_0x4ff120){return _0x4ff120[_0xc0b3('0x8')]===_0xc0b3('0x9')&&_0x4ff120['internal']===![];});_0x45549c=_0x45549c['concat'](_0x14a9a8);}return _0x45549c;}function getFirstInterface(){var _0xe174b6=_[_0xc0b3('0xa')](getInterfaces());return{'macAddress':_0xe174b6&&_0xe174b6['mac']?_0xe174b6[_0xc0b3('0xb')]:_0xc0b3('0xc'),'ipAddress':_0xe174b6&&_0xe174b6['address']?_0xe174b6['address']:_0xc0b3('0xd')};}exports[_0xc0b3('0xe')]=getFirstInterface;function getCPUhash(){var _0x38c333=_[_0xc0b3('0x6')](os['cpus']()[_0xc0b3('0xf')](function(_0x40d921){return _0x40d921[_0xc0b3('0x10')];}))[_0xc0b3('0x11')](':');return crypto[_0xc0b3('0x12')]('md5')[_0xc0b3('0x13')](_0x38c333)[_0xc0b3('0x14')](_0xc0b3('0x15'));}exports[_0xc0b3('0x16')]=function(){var _0x86caea=os['platform']();var _0x3bcab4=/[0-9a-f-]{36}/;if(config[_0xc0b3('0x17')]&&_0x3bcab4[_0xc0b3('0x18')](config[_0xc0b3('0x17')])){return config[_0xc0b3('0x17')];}else if(_0x86caea==='win32'){return exec('dmidecode\x20--string\x20system-uuid',{'encoding':_0xc0b3('0x19')})[_0xc0b3('0x1a')]('\x0d\x0a','');}else{var _0x3fe438=getFirstInterface();var _0x1127b5=getCPUhash();var _0x148662=_0x1127b5+'|'+os[_0xc0b3('0x1b')]()+'|'+_0x3fe438['macAddress']+'|'+_0x3fe438['ipAddress'];var _0x2a3dc2=crypto[_0xc0b3('0x12')](_0xc0b3('0x1c'))['update'](_0x148662)[_0xc0b3('0x14')](_0xc0b3('0x15'));return _0x2a3dc2[_0xc0b3('0x1d')](0x0,0x8)+'-'+_0x2a3dc2[_0xc0b3('0x1d')](0x8,0xc)+'-'+_0x2a3dc2[_0xc0b3('0x1d')](0xc,0x10)+'-'+_0x2a3dc2[_0xc0b3('0x1d')](0x10,0x14)+'-'+_0x2a3dc2[_0xc0b3('0x1d')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 3c7e0bb..2063187 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 _0x33de=['request-promise','bluebird','pkginfo','version','../../components/encryptor','../logger','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s&oldtoken=%s','exports','GET','then','catch','get','data2','data1','active','license','info','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','encryptString','diff','decryptString','DEMO\x20START\x20AT\x20%s','message','finally','getUuid','License','error','default','util','moment'];(function(_0x2e819c,_0x3f99a5){var _0x24e271=function(_0x27d596){while(--_0x27d596){_0x2e819c['push'](_0x2e819c['shift']());}};_0x24e271(++_0x3f99a5);}(_0x33de,0x108));var _0xe33d=function(_0x4f7ca7,_0x5099e7){_0x4f7ca7=_0x4f7ca7-0x0;var _0x55f6b0=_0x33de[_0x4f7ca7];return _0x55f6b0;};'use strict';var util=require(_0xe33d('0x0'));var moment=require(_0xe33d('0x1'));var rp=require(_0xe33d('0x2'));var BPromise=require(_0xe33d('0x3'));var pkginfo=require(_0xe33d('0x4'))(module,_0xe33d('0x5'));var db=require('../../mysqldb')['db'];var encryptor=require(_0xe33d('0x6'));var hardware=require('./hardware');var logger=require(_0xe33d('0x7'))('license');var HOST=_0xe33d('0x8');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x221d58){return new BPromise(function(_0xbbd2bc,_0x107483){var _0x16ac14=util[_0xe33d('0x9')]('%s/api/servers/%s/check?version=%s',HOST,_0x221d58,module['exports'][_0xe33d('0x5')]);if(oldToken){_0x16ac14=util['format'](_0xe33d('0xa'),HOST,_0x221d58,module[_0xe33d('0xb')][_0xe33d('0x5')],oldToken);}var _0x3e4a21={'uri':_0x16ac14,'method':_0xe33d('0xc'),'timeout':0xea60,'json':!![]};return rp(_0x3e4a21)[_0xe33d('0xd')](function(_0x3b0b3a){_0xbbd2bc(_0x3b0b3a);})[_0xe33d('0xe')](function(_0x1efc1c){_0x107483(_0x1efc1c);});});}function manageLicense(_0x58f19a,_0x4055c4){var _0x338df0=_0x4055c4[_0xe33d('0xf')]({'plain':!![]});if(!isOldTokenSent&&_0x338df0['data1']!==_0x58f19a&&!_0x338df0[_0xe33d('0x10')]){oldToken=_0x338df0[_0xe33d('0x11')];}httpRequest(_0x58f19a)['then'](function(_0x414a82){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x414a82[_0xe33d('0x12')]){isOldTokenSent=![];if(!_0x338df0[_0xe33d('0x13')]&&_0x338df0[_0xe33d('0x13')]!=_0x414a82[_0xe33d('0x13')]||_0x338df0['license']&&_0x338df0[_0xe33d('0x10')]){logger[_0xe33d('0x14')]('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0x338df0['license']&&!_0x338df0[_0xe33d('0x10')]&&_0x338df0[_0xe33d('0x13')]!=_0x414a82[_0xe33d('0x13')]){logger['info'](_0xe33d('0x15'));}if(_0x338df0[_0xe33d('0x13')]&&!_0x338df0[_0xe33d('0x10')]&&_0x338df0[_0xe33d('0x13')]==_0x414a82[_0xe33d('0x13')]){return _0x4055c4;}return _0x4055c4[_0xe33d('0x16')]({'data1':_0x58f19a,'data2':null,'license':_0x414a82[_0xe33d('0x13')]});}else{if(_0x414a82[_0xe33d('0x13')]||_0x338df0[_0xe33d('0x13')]){if(!_0x338df0[_0xe33d('0x10')]){if(_0x338df0['data1']==_0x58f19a){GRAY_PERIOD_REASON='Disabled';logger[_0xe33d('0x14')](_0xe33d('0x17'));}else{GRAY_PERIOD_REASON='Changed';logger[_0xe33d('0x14')](_0xe33d('0x18'),_0x338df0['data1'],_0x58f19a);}logger[_0xe33d('0x14')](_0xe33d('0x19'),GRAY_PERIOD_REASON[_0xe33d('0x1a')](),moment()[_0xe33d('0x9')](_0xe33d('0x1b')));return _0x4055c4['update']({'data2':encryptor[_0xe33d('0x1c')](moment()['format'](_0xe33d('0x1b')))});}else{if(moment()[_0xe33d('0x1d')](encryptor[_0xe33d('0x1e')](_0x338df0['data2']),'days')>DAYS){logger['info'](_0xe33d('0x1f'),moment()[_0xe33d('0x9')](_0xe33d('0x1b')));isOldTokenSent=![];return _0x4055c4[_0xe33d('0x16')]({'data1':_0x58f19a,'data2':null,'license':null});}}}else{if(_0x338df0[_0xe33d('0x11')]!=_0x58f19a){logger[_0xe33d('0x14')](_0xe33d('0x18'),_0x338df0[_0xe33d('0x11')],_0x58f19a);return _0x4055c4['update']({'data1':_0x58f19a,'data2':null,'license':null});}}}return _0x4055c4;})[_0xe33d('0xd')](function(_0x5e9387){_0x4055c4=_0x5e9387;})[_0xe33d('0xe')](function(_0x49bfe2){logger['error'](_0x49bfe2[_0xe33d('0x20')]);})[_0xe33d('0x21')](function(){setTimeout(function(){manageLicense(hardware[_0xe33d('0x22')](),_0x4055c4);},TIME);});}function defaultLicense(){var _0xe2fcfc=hardware[_0xe33d('0x22')]();if(_0xe2fcfc){return db[_0xe33d('0x23')]['findOrCreate']({'where':{'id':0x1},'defaults':{'data1':_0xe2fcfc}})['spread'](function(_0x4e4813,_0x1b1175){logger[_0xe33d('0x14')]('SERVICE\x20LICENSE\x20STARTED\x20%s',_0xe2fcfc);manageLicense(_0xe2fcfc,_0x4e4813);})[_0xe33d('0xe')](function(_0x5d56f3){logger[_0xe33d('0x24')](_0x5d56f3['message']);});}}exports[_0xe33d('0x25')]=defaultLicense; \ No newline at end of file +var _0x535a=['decryptString','DEMO\x20START\x20AT\x20%s','catch','error','getUuid','findOrCreate','spread','message','default','util','request-promise','bluebird','pkginfo','../../mysqldb','../../components/encryptor','../logger','license','https://www.xcallymotion.com','%s/api/servers/%s/check?version=%s','exports','format','%s/api/servers/%s/check?version=%s&oldtoken=%s','version','GET','then','data1','data2','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','update','encryptString','diff'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x535a,0x75));var _0xa535=function(_0x27ffff,_0x357274){_0x27ffff=_0x27ffff-0x0;var _0x55e384=_0x535a[_0x27ffff];return _0x55e384;};'use strict';var util=require(_0xa535('0x0'));var moment=require('moment');var rp=require(_0xa535('0x1'));var BPromise=require(_0xa535('0x2'));var pkginfo=require(_0xa535('0x3'))(module,'version');var db=require(_0xa535('0x4'))['db'];var encryptor=require(_0xa535('0x5'));var hardware=require('./hardware');var logger=require(_0xa535('0x6'))(_0xa535('0x7'));var HOST=_0xa535('0x8');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x5197e1){return new BPromise(function(_0xe37f26,_0x366638){var _0x49edbc=util['format'](_0xa535('0x9'),HOST,_0x5197e1,module[_0xa535('0xa')]['version']);if(oldToken){_0x49edbc=util[_0xa535('0xb')](_0xa535('0xc'),HOST,_0x5197e1,module[_0xa535('0xa')][_0xa535('0xd')],oldToken);}var _0x3a2566={'uri':_0x49edbc,'method':_0xa535('0xe'),'timeout':0xea60,'json':!![]};return rp(_0x3a2566)[_0xa535('0xf')](function(_0x980fe7){_0xe37f26(_0x980fe7);})['catch'](function(_0x59d93b){_0x366638(_0x59d93b);});});}function manageLicense(_0x41369c,_0x284836){var _0x30b63a=_0x284836['get']({'plain':!![]});if(!isOldTokenSent&&_0x30b63a[_0xa535('0x10')]!==_0x41369c&&!_0x30b63a[_0xa535('0x11')]){oldToken=_0x30b63a['data1'];}httpRequest(_0x41369c)[_0xa535('0xf')](function(_0x25e51d){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x25e51d[_0xa535('0x12')]){isOldTokenSent=![];if(!_0x30b63a[_0xa535('0x7')]&&_0x30b63a[_0xa535('0x7')]!=_0x25e51d[_0xa535('0x7')]||_0x30b63a[_0xa535('0x7')]&&_0x30b63a[_0xa535('0x11')]){logger[_0xa535('0x13')](_0xa535('0x14'));}if(_0x30b63a[_0xa535('0x7')]&&!_0x30b63a[_0xa535('0x11')]&&_0x30b63a[_0xa535('0x7')]!=_0x25e51d[_0xa535('0x7')]){logger[_0xa535('0x13')](_0xa535('0x15'));}if(_0x30b63a['license']&&!_0x30b63a['data2']&&_0x30b63a[_0xa535('0x7')]==_0x25e51d['license']){return _0x284836;}return _0x284836['update']({'data1':_0x41369c,'data2':null,'license':_0x25e51d[_0xa535('0x7')]});}else{if(_0x25e51d[_0xa535('0x7')]||_0x30b63a[_0xa535('0x7')]){if(!_0x30b63a['data2']){if(_0x30b63a[_0xa535('0x10')]==_0x41369c){GRAY_PERIOD_REASON='Disabled';logger[_0xa535('0x13')](_0xa535('0x16'));}else{GRAY_PERIOD_REASON='Changed';logger['info'](_0xa535('0x17'),_0x30b63a[_0xa535('0x10')],_0x41369c);}logger['info']('%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s',GRAY_PERIOD_REASON['toUpperCase'](),moment()[_0xa535('0xb')]('YYYY-MM-DD\x20HH:mm'));return _0x284836[_0xa535('0x18')]({'data2':encryptor[_0xa535('0x19')](moment()[_0xa535('0xb')]('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()[_0xa535('0x1a')](encryptor[_0xa535('0x1b')](_0x30b63a['data2']),'days')>DAYS){logger[_0xa535('0x13')](_0xa535('0x1c'),moment()[_0xa535('0xb')]('YYYY-MM-DD\x20HH:mm'));isOldTokenSent=![];return _0x284836[_0xa535('0x18')]({'data1':_0x41369c,'data2':null,'license':null});}}}else{if(_0x30b63a[_0xa535('0x10')]!=_0x41369c){logger[_0xa535('0x13')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x30b63a[_0xa535('0x10')],_0x41369c);return _0x284836[_0xa535('0x18')]({'data1':_0x41369c,'data2':null,'license':null});}}}return _0x284836;})[_0xa535('0xf')](function(_0x4d5fdf){_0x284836=_0x4d5fdf;})[_0xa535('0x1d')](function(_0x1ce209){logger[_0xa535('0x1e')](_0x1ce209['message']);})['finally'](function(){setTimeout(function(){manageLicense(hardware[_0xa535('0x1f')](),_0x284836);},TIME);});}function defaultLicense(){var _0x31116a=hardware[_0xa535('0x1f')]();if(_0x31116a){return db['License'][_0xa535('0x20')]({'where':{'id':0x1},'defaults':{'data1':_0x31116a}})[_0xa535('0x21')](function(_0x360642,_0x366006){logger[_0xa535('0x13')]('SERVICE\x20LICENSE\x20STARTED\x20%s',_0x31116a);manageLicense(_0x31116a,_0x360642);})['catch'](function(_0x20fe83){logger[_0xa535('0x1e')](_0x20fe83[_0xa535('0x22')]);});}}exports[_0xa535('0x23')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index e6345c2..2601ee5 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 _0x43df=['format','%s:%s:%s','demo','machineUuid','gray','deadline','add','days','disabled','message','User','findAll','role','sequelize','count','admin','telephone','users','telephones','forEach','user','pick','countBy','License\x20limit\x20reached\x20for\x20telephones','lodash','moment','2027-01-01T00:00:00.000Z','getUuid','Breaking\x20license','License','defaults','then','catch','uuid','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','decryptString'];(function(_0x1fc122,_0x5e2c17){var _0xa2cb13=function(_0x263b13){while(--_0x263b13){_0x1fc122['push'](_0x1fc122['shift']());}};_0xa2cb13(++_0x5e2c17);}(_0x43df,0x1b2));var _0xf43d=function(_0x434380,_0x46abb2){_0x434380=_0x434380-0x0;var _0x5973a1=_0x43df[_0x434380];return _0x5973a1;};'use strict';var util=require('util');var _=require(_0xf43d('0x0'));var moment=require(_0xf43d('0x1'));var BPromise=require('bluebird');var hardware=require('./hardware');var encryptor=require('../../components/encryptor');var db=require('../../mysqldb')['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xf43d('0x2'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':'Demo\x20license','machineUuid':hardware[_0xf43d('0x3')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xf43d('0x4'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x5b2670){return new BPromise(function(_0xb1f12a,_0x20778f){return db[_0xf43d('0x5')]['find'](_[_0xf43d('0x6')](_0x5b2670,{'raw':!![],'where':{'id':0x1}}))[_0xf43d('0x7')](function(_0x1e1462){return checkLicense(_0x1e1462,null);})[_0xf43d('0x7')](function(_0x4dfb35){_0xb1f12a(_0x4dfb35);return;})[_0xf43d('0x8')](function(_0x413ddd){_0x20778f(_0x413ddd);});});}function checkLicense(_0x43bb1b,_0x2dd30f){if(!_0x43bb1b){demoLicense[_0xf43d('0x9')]=_0x43bb1b[_0xf43d('0xa')];return demoLicense;}try{var _0x37971d=_0x2dd30f||_0x43bb1b[_0xf43d('0xb')];if(_[_0xf43d('0xc')](_0x37971d)){throw new Error(_0xf43d('0xd'));}var _0x3e513f=_0x43bb1b[_0xf43d('0xa')];var _0xb7c596=_0x43bb1b[_0xf43d('0xe')];var _0xfa67ee=_0x3e513f[_0xf43d('0xf')]('-')[0x4];var _0x402c23=_0x3e513f[_0xf43d('0xf')]('-')[0x0];var _0x527a08=encryptor[_0xf43d('0x10')](_0x37971d,util[_0xf43d('0x11')](_0xf43d('0x12'),_0xfa67ee,_0x3e513f,_0x402c23));var _0x259d18=JSON['parse'](_0x527a08);_0x259d18[_0xf43d('0x13')]=![];_0x259d18[_0xf43d('0x9')]=_0x3e513f;_0x259d18[_0xf43d('0x14')]=hardware[_0xf43d('0x3')]();if(_0xb7c596){var _0x411220=encryptor[_0xf43d('0x10')](_0xb7c596);_0x259d18[_0xf43d('0x15')]=_0x411220;_0x259d18[_0xf43d('0x16')]=moment(_0x411220)[_0xf43d('0x17')](0x7,_0xf43d('0x18'))[_0xf43d('0x11')]();_0x259d18['grayReason']=_0x259d18['uuid']!=_0x259d18[_0xf43d('0x14')]?'changed':_0xf43d('0x19');}return _0x259d18;}catch(_0x39ee75){breakingLicense['uuid']=_0x43bb1b[_0xf43d('0xa')];breakingLicense[_0xf43d('0x1a')]=_0x39ee75['message'];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x44140e,_0x3c58b8){getLicense()[_0xf43d('0x7')](function(_0xf44a08){return db[_0xf43d('0x1b')][_0xf43d('0x1c')]({'attributes':[_0xf43d('0x1d'),[db['sequelize']['fn']('COUNT',db[_0xf43d('0x1e')]['col'](_0xf43d('0x1d'))),_0xf43d('0x1f')]],'group':_0xf43d('0x1d'),'where':{'role':{'$or':[_0xf43d('0x20'),'user',_0xf43d('0x21')]}},'raw':!![]})[_0xf43d('0x7')](function(_0x13134f){var _0xaca3ac={'user':_0xf44a08[_0xf43d('0x22')]||0x0,'telephone':_0xf44a08[_0xf43d('0x23')]||0x0};_0x13134f[_0xf43d('0x24')](function(_0x2bc666){var _0x1de776=_0x2bc666['role']==='admin'?_0xf43d('0x25'):_0x2bc666[_0xf43d('0x1d')];_0xaca3ac[_0x1de776]-=_0x2bc666['count'];if(_0xaca3ac[_0x1de776]<0x0)_0xaca3ac[_0x1de776]=0x0;});_0x44140e(_0xaca3ac);return;});})[_0xf43d('0x8')](function(_0x263c43){_0x3c58b8(_0x263c43);});});}function checkUserLimits(_0x244f00){return new BPromise(function(_0x4df69c,_0x286c10){getLimits()[_0xf43d('0x7')](function(_0x4e5cf4){var _0x4579fc=_[_0xf43d('0x26')](_[_0xf43d('0x27')](_0x244f00,_0xf43d('0x1d')),[_0xf43d('0x20'),_0xf43d('0x25'),_0xf43d('0x21')]);var _0x527ac5=(_0x4579fc[_0xf43d('0x20')]||0x0)+(_0x4579fc[_0xf43d('0x25')]||0x0);var _0x34aee8=_0x4579fc[_0xf43d('0x21')]||0x0;if(_0x527ac5>_0x4e5cf4[_0xf43d('0x25')])return _0x286c10('License\x20limit\x20reached\x20for\x20users');if(_0x34aee8>_0x4e5cf4[_0xf43d('0x21')])return _0x286c10(_0xf43d('0x28'));return _0x4df69c();})[_0xf43d('0x8')](function(_0x24faa4){_0x286c10(_0x24faa4);});});}module['exports']={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0xeedd=['license','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','format','parse','demo','decryptString','gray','deadline','days','grayReason','machineUuid','changed','message','User','findAll','sequelize','COUNT','col','role','count','admin','user','telephone','users','forEach','License\x20limit\x20reached\x20for\x20users','exports','util','lodash','moment','./hardware','../../components/encryptor','2027-01-01T00:00:00.000Z','Breaking\x20license','getUuid','defaults','then','catch','uuid','data1'];(function(_0x12012d,_0x46e1f6){var _0x2ccaf1=function(_0x3a9488){while(--_0x3a9488){_0x12012d['push'](_0x12012d['shift']());}};_0x2ccaf1(++_0x46e1f6);}(_0xeedd,0xf5));var _0xdeed=function(_0x2742e0,_0x496bec){_0x2742e0=_0x2742e0-0x0;var _0x2ab6d1=_0xeedd[_0x2742e0];return _0x2ab6d1;};'use strict';var util=require(_0xdeed('0x0'));var _=require(_0xdeed('0x1'));var moment=require(_0xdeed('0x2'));var BPromise=require('bluebird');var hardware=require(_0xdeed('0x3'));var encryptor=require(_0xdeed('0x4'));var db=require('../../mysqldb')['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':'Demo\x20license','machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xdeed('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xdeed('0x6'),'machineUuid':hardware[_0xdeed('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x1762d5){return new BPromise(function(_0x3fb86d,_0x5976bd){return db['License']['find'](_[_0xdeed('0x8')](_0x1762d5,{'raw':!![],'where':{'id':0x1}}))[_0xdeed('0x9')](function(_0x549bf3){return checkLicense(_0x549bf3,null);})[_0xdeed('0x9')](function(_0x185a02){_0x3fb86d(_0x185a02);return;})[_0xdeed('0xa')](function(_0x396f8c){_0x5976bd(_0x396f8c);});});}function checkLicense(_0x31c088,_0x1ff01e){if(!_0x31c088){demoLicense[_0xdeed('0xb')]=_0x31c088[_0xdeed('0xc')];return demoLicense;}try{var _0x543bee=_0x1ff01e||_0x31c088[_0xdeed('0xd')];if(_[_0xdeed('0xe')](_0x543bee)){throw new Error(_0xdeed('0xf'));}var _0x58532f=_0x31c088[_0xdeed('0xc')];var _0x4015c6=_0x31c088[_0xdeed('0x10')];var _0x43f333=_0x58532f[_0xdeed('0x11')]('-')[0x4];var _0x17beef=_0x58532f[_0xdeed('0x11')]('-')[0x0];var _0x26f85c=encryptor['decryptString'](_0x543bee,util[_0xdeed('0x12')]('%s:%s:%s',_0x43f333,_0x58532f,_0x17beef));var _0x577c4d=JSON[_0xdeed('0x13')](_0x26f85c);_0x577c4d[_0xdeed('0x14')]=![];_0x577c4d[_0xdeed('0xb')]=_0x58532f;_0x577c4d['machineUuid']=hardware[_0xdeed('0x7')]();if(_0x4015c6){var _0x33822a=encryptor[_0xdeed('0x15')](_0x4015c6);_0x577c4d[_0xdeed('0x16')]=_0x33822a;_0x577c4d[_0xdeed('0x17')]=moment(_0x33822a)['add'](0x7,_0xdeed('0x18'))[_0xdeed('0x12')]();_0x577c4d[_0xdeed('0x19')]=_0x577c4d[_0xdeed('0xb')]!=_0x577c4d[_0xdeed('0x1a')]?_0xdeed('0x1b'):'disabled';}return _0x577c4d;}catch(_0x3b243f){breakingLicense[_0xdeed('0xb')]=_0x31c088['data1'];breakingLicense[_0xdeed('0x1c')]=_0x3b243f[_0xdeed('0x1c')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x3d6043,_0x5344af){getLicense()['then'](function(_0x2649f9){return db[_0xdeed('0x1d')][_0xdeed('0x1e')]({'attributes':['role',[db[_0xdeed('0x1f')]['fn'](_0xdeed('0x20'),db[_0xdeed('0x1f')][_0xdeed('0x21')](_0xdeed('0x22'))),_0xdeed('0x23')]],'group':_0xdeed('0x22'),'where':{'role':{'$or':[_0xdeed('0x24'),_0xdeed('0x25'),_0xdeed('0x26')]}},'raw':!![]})[_0xdeed('0x9')](function(_0x163161){var _0x2d903a={'user':_0x2649f9[_0xdeed('0x27')]||0x0,'telephone':_0x2649f9['telephones']||0x0};_0x163161[_0xdeed('0x28')](function(_0x55c32a){var _0x4ecabd=_0x55c32a[_0xdeed('0x22')]===_0xdeed('0x24')?_0xdeed('0x25'):_0x55c32a['role'];_0x2d903a[_0x4ecabd]-=_0x55c32a['count'];if(_0x2d903a[_0x4ecabd]<0x0)_0x2d903a[_0x4ecabd]=0x0;});_0x3d6043(_0x2d903a);return;});})['catch'](function(_0x286360){_0x5344af(_0x286360);});});}function checkUserLimits(_0x3161cf){return new BPromise(function(_0x2f774b,_0x5d00a9){getLimits()[_0xdeed('0x9')](function(_0x2b641){var _0x20b8c3=_['pick'](_['countBy'](_0x3161cf,_0xdeed('0x22')),['admin',_0xdeed('0x25'),_0xdeed('0x26')]);var _0x1ed891=(_0x20b8c3[_0xdeed('0x24')]||0x0)+(_0x20b8c3[_0xdeed('0x25')]||0x0);var _0x4c82e5=_0x20b8c3[_0xdeed('0x26')]||0x0;if(_0x1ed891>_0x2b641['user'])return _0x5d00a9(_0xdeed('0x29'));if(_0x4c82e5>_0x2b641[_0xdeed('0x26')])return _0x5d00a9('License\x20limit\x20reached\x20for\x20telephones');return _0x2f774b();})[_0xdeed('0xa')](function(_0x11ca5d){_0x5d00a9(_0x11ca5d);});});}module[_0xdeed('0x2a')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file diff --git a/server/config/local.env.js b/server/config/local.env.js index d699dc8..4b2a821 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 _0x1c9a=['myappanuglar-secret','secret','exports'];(function(_0xbb411d,_0x114344){var _0x5e16e7=function(_0x7e637c){while(--_0x7e637c){_0xbb411d['push'](_0xbb411d['shift']());}};_0x5e16e7(++_0x114344);}(_0x1c9a,0x98));var _0xa1c9=function(_0x48d855,_0x3db5ed){_0x48d855=_0x48d855-0x0;var _0x34d80a=_0x1c9a[_0x48d855];return _0x34d80a;};'use strict';module[_0xa1c9('0x0')]={'DOMAIN':'http://localhost:9000','SESSION_SECRET':_0xa1c9('0x1'),'GOOGLE_ID':'app-id','GOOGLE_SECRET':_0xa1c9('0x2'),'DEBUG':''}; \ No newline at end of file +var _0xc2c7=['http://localhost:9000','myappanuglar-secret','app-id','secret'];(function(_0x2bcc88,_0x3071aa){var _0x50594f=function(_0x5dfae2){while(--_0x5dfae2){_0x2bcc88['push'](_0x2bcc88['shift']());}};_0x50594f(++_0x3071aa);}(_0xc2c7,0x134));var _0x7c2c=function(_0xf3c114,_0x1984fb){_0xf3c114=_0xf3c114-0x0;var _0x3de5a6=_0xc2c7[_0xf3c114];return _0x3de5a6;};'use strict';module['exports']={'DOMAIN':_0x7c2c('0x0'),'SESSION_SECRET':_0x7c2c('0x1'),'GOOGLE_ID':_0x7c2c('0x2'),'GOOGLE_SECRET':_0x7c2c('0x3'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index bac59dc..d68ec05 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcc97=['exports','../utils/loggers','fileLogger'];(function(_0x2cb8ba,_0x4f0a01){var _0x5ac396=function(_0x255399){while(--_0x255399){_0x2cb8ba['push'](_0x2cb8ba['shift']());}};_0x5ac396(++_0x4f0a01);}(_0xcc97,0x7f));var _0x7cc9=function(_0x2275a5,_0x33facc){_0x2275a5=_0x2275a5-0x0;var _0x5f5478=_0xcc97[_0x2275a5];return _0x5f5478;};'use strict';var fileLogger=require(_0x7cc9('0x0'))[_0x7cc9('0x1')];module[_0x7cc9('0x2')]=fileLogger; \ No newline at end of file +var _0x52e8=['fileLogger','exports','../utils/loggers'];(function(_0x2ba127,_0x2c0174){var _0x8d107a=function(_0x36ff7b){while(--_0x36ff7b){_0x2ba127['push'](_0x2ba127['shift']());}};_0x8d107a(++_0x2c0174);}(_0x52e8,0x7d));var _0x852e=function(_0x4bd950,_0x184ed5){_0x4bd950=_0x4bd950-0x0;var _0x5dc59a=_0x52e8[_0x4bd950];return _0x5dc59a;};'use strict';var fileLogger=require(_0x852e('0x0'))[_0x852e('0x1')];module[_0x852e('0x2')]=fileLogger; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index 91881c7..c4f4a35 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 _0xf5eb=['express','../../services/express/index.js','ami','join','agi','../../services/agi/index.js','email','../../services/email/index.js','xdr','../../services/xdr/index.js','exports','path','../../config/environment','root'];(function(_0x926557,_0xbddeff){var _0x163d05=function(_0x35019f){while(--_0x35019f){_0x926557['push'](_0x926557['shift']());}};_0x163d05(++_0xbddeff);}(_0xf5eb,0x169));var _0xbf5e=function(_0x44ef50,_0x13679f){_0x44ef50=_0x44ef50-0x0;var _0x78f849=_0xf5eb[_0x44ef50];return _0x78f849;};'use strict';var path=require(_0xbf5e('0x0'));var cfg=require(_0xbf5e('0x1'));var env={'NODE_PATH':path['resolve'](path['join'](cfg[_0xbf5e('0x2')],'legacy-libs'))};var pm2config={'apps':[{'name':_0xbf5e('0x3'),'script':path['join'](__dirname,_0xbf5e('0x4')),'env':env},{'name':_0xbf5e('0x5'),'script':path[_0xbf5e('0x6')](__dirname,'../../services/ami/index.js'),'env':env},{'name':_0xbf5e('0x7'),'script':path[_0xbf5e('0x6')](__dirname,_0xbf5e('0x8')),'env':env},{'name':_0xbf5e('0x9'),'script':path[_0xbf5e('0x6')](__dirname,_0xbf5e('0xa')),'env':env},{'name':'routing','script':path[_0xbf5e('0x6')](__dirname,'../../services/routing/index.js'),'env':env},{'name':_0xbf5e('0xb'),'script':path[_0xbf5e('0x6')](__dirname,_0xbf5e('0xc')),'env':env}]};module[_0xbf5e('0xd')]=pm2config; \ No newline at end of file +var _0xbb15=['legacy-libs','express','../../services/express/index.js','ami','../../services/ami/index.js','../../services/agi/index.js','../../services/email/index.js','routing','../../services/routing/index.js','xdr','../../services/xdr/index.js','exports','path','../../config/environment','resolve','join','root'];(function(_0x3667d8,_0x343668){var _0x1ed880=function(_0x4bd34e){while(--_0x4bd34e){_0x3667d8['push'](_0x3667d8['shift']());}};_0x1ed880(++_0x343668);}(_0xbb15,0x11c));var _0x5bb1=function(_0x543984,_0x251a39){_0x543984=_0x543984-0x0;var _0x183652=_0xbb15[_0x543984];return _0x183652;};'use strict';var path=require(_0x5bb1('0x0'));var cfg=require(_0x5bb1('0x1'));var env={'NODE_PATH':path[_0x5bb1('0x2')](path[_0x5bb1('0x3')](cfg[_0x5bb1('0x4')],_0x5bb1('0x5')))};var pm2config={'apps':[{'name':_0x5bb1('0x6'),'script':path['join'](__dirname,_0x5bb1('0x7')),'env':env},{'name':_0x5bb1('0x8'),'script':path[_0x5bb1('0x3')](__dirname,_0x5bb1('0x9')),'env':env},{'name':'agi','script':path['join'](__dirname,_0x5bb1('0xa')),'env':env},{'name':'email','script':path[_0x5bb1('0x3')](__dirname,_0x5bb1('0xb')),'env':env},{'name':_0x5bb1('0xc'),'script':path[_0x5bb1('0x3')](__dirname,_0x5bb1('0xd')),'env':env},{'name':_0x5bb1('0xe'),'script':path[_0x5bb1('0x3')](__dirname,_0x5bb1('0xf')),'env':env}]};module[_0x5bb1('0x10')]=pm2config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 1ec38e8..b590e76 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 _0x08ea=['start','then','disconnect','stop','restart','list','describe','delete','dump','saved','pm2','./config','connected'];(function(_0x2b47b9,_0x4c29c0){var _0x457589=function(_0x251d5b){while(--_0x251d5b){_0x2b47b9['push'](_0x2b47b9['shift']());}};_0x457589(++_0x4c29c0);}(_0x08ea,0xe7));var _0xa08e=function(_0x11c916,_0x448c6a){_0x11c916=_0x11c916-0x0;var _0x558e51=_0x08ea[_0x11c916];return _0x558e51;};'use strict';var pm2=require(_0xa08e('0x0'));var BPromise=require('bluebird');var config=require(_0xa08e('0x1'));function connect(){return new BPromise(function(_0xee3406,_0x358100){return pm2['connect'](function(_0x120613){if(_0x120613){return _0x358100(_0x120613);}return _0xee3406(_0xa08e('0x2'));});});};exports[_0xa08e('0x3')]=function(_0x43eb9f){return connect()[_0xa08e('0x4')](function(){return new BPromise(function(_0x5c38ff,_0x32aa35){return pm2[_0xa08e('0x3')](_0x43eb9f,function(_0x5b2580,_0x373cd2){if(_0x5b2580){return _0x32aa35(_0x5b2580);}pm2[_0xa08e('0x5')]();return _0x5c38ff(_0x373cd2);});});});};exports['stop']=function(_0x3691b5){return connect()['then'](function(){return new BPromise(function(_0x2a205c,_0x3fb136){return pm2[_0xa08e('0x6')](_0x3691b5,function(_0x26c919,_0x5e97c2){if(_0x26c919){return _0x3fb136(_0x26c919);}pm2[_0xa08e('0x5')]();return _0x2a205c(_0x5e97c2);});});});};exports[_0xa08e('0x7')]=function(_0x2d0fc4){return connect()[_0xa08e('0x4')](function(){return new BPromise(function(_0x449aeb,_0x2216df){return pm2['restart'](_0x2d0fc4,function(_0x384375,_0xa03a98){if(_0x384375){return _0x2216df(_0x384375);}pm2[_0xa08e('0x5')]();return _0x449aeb(_0xa03a98);});});});};exports[_0xa08e('0x8')]=function(){return connect()[_0xa08e('0x4')](function(){return new BPromise(function(_0x439b8e,_0xabd98b){return pm2[_0xa08e('0x8')](function(_0x1ae9d7,_0x1be36b){if(_0x1ae9d7){return _0xabd98b(_0x1ae9d7);}pm2[_0xa08e('0x5')]();return _0x439b8e(_0x1be36b);});});});};exports['describe']=function(_0xc77f39){return connect()[_0xa08e('0x4')](function(){return new BPromise(function(_0x3c0ee3,_0x50c463){return pm2[_0xa08e('0x9')](_0xc77f39,function(_0x28523c,_0x343f74){if(_0x28523c){return _0x50c463(_0x28523c);}pm2[_0xa08e('0x5')]();return _0x3c0ee3(_0x343f74);});});});};exports[_0xa08e('0xa')]=function(_0x233222){return connect()[_0xa08e('0x4')](function(){return new BPromise(function(_0x130dcb,_0x2e0d04){return pm2['delete'](_0x233222,function(_0x368333,_0x3ef652){if(_0x368333){return _0x2e0d04(_0x368333);}pm2['disconnect']();return _0x130dcb(_0x3ef652);});});});};exports[_0xa08e('0xb')]=function(){return connect()[_0xa08e('0x4')](function(){return new BPromise(function(_0x13b8e8,_0x1f3de7){return pm2[_0xa08e('0xb')](function(_0x20f502){if(_0x20f502){return _0x1f3de7(_0x20f502);}return _0x13b8e8(_0xa08e('0xc'));});});});}; \ No newline at end of file +var _0x4581=['dump','saved','pm2','bluebird','./config','connect','connected','then','start','disconnect','stop','restart','list','describe','delete'];(function(_0x88e4c3,_0x3eb1a2){var _0x1faf24=function(_0x404eb2){while(--_0x404eb2){_0x88e4c3['push'](_0x88e4c3['shift']());}};_0x1faf24(++_0x3eb1a2);}(_0x4581,0x1f1));var _0x1458=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x4581[_0x20a584];return _0x4b41a8;};'use strict';var pm2=require(_0x1458('0x0'));var BPromise=require(_0x1458('0x1'));var config=require(_0x1458('0x2'));function connect(){return new BPromise(function(_0x2de094,_0x390249){return pm2[_0x1458('0x3')](function(_0x2e5a65){if(_0x2e5a65){return _0x390249(_0x2e5a65);}return _0x2de094(_0x1458('0x4'));});});};exports['start']=function(_0x1d18c2){return connect()[_0x1458('0x5')](function(){return new BPromise(function(_0x3514ff,_0x10162b){return pm2[_0x1458('0x6')](_0x1d18c2,function(_0x3ba98b,_0x13e82f){if(_0x3ba98b){return _0x10162b(_0x3ba98b);}pm2[_0x1458('0x7')]();return _0x3514ff(_0x13e82f);});});});};exports['stop']=function(_0x5b9774){return connect()[_0x1458('0x5')](function(){return new BPromise(function(_0x28e270,_0x41c695){return pm2[_0x1458('0x8')](_0x5b9774,function(_0x1cad20,_0x3246eb){if(_0x1cad20){return _0x41c695(_0x1cad20);}pm2['disconnect']();return _0x28e270(_0x3246eb);});});});};exports[_0x1458('0x9')]=function(_0x1c5968){return connect()[_0x1458('0x5')](function(){return new BPromise(function(_0x278344,_0x153753){return pm2[_0x1458('0x9')](_0x1c5968,function(_0x3f20dd,_0x27c14f){if(_0x3f20dd){return _0x153753(_0x3f20dd);}pm2[_0x1458('0x7')]();return _0x278344(_0x27c14f);});});});};exports[_0x1458('0xa')]=function(){return connect()['then'](function(){return new BPromise(function(_0x58604a,_0x21fa7f){return pm2[_0x1458('0xa')](function(_0x31d698,_0x16dab0){if(_0x31d698){return _0x21fa7f(_0x31d698);}pm2[_0x1458('0x7')]();return _0x58604a(_0x16dab0);});});});};exports['describe']=function(_0x1a1591){return connect()['then'](function(){return new BPromise(function(_0x2aa722,_0x3baf53){return pm2[_0x1458('0xb')](_0x1a1591,function(_0x1509cf,_0x2c7790){if(_0x1509cf){return _0x3baf53(_0x1509cf);}pm2[_0x1458('0x7')]();return _0x2aa722(_0x2c7790);});});});};exports[_0x1458('0xc')]=function(_0x7ce237){return connect()['then'](function(){return new BPromise(function(_0x1057f4,_0x3b2f95){return pm2[_0x1458('0xc')](_0x7ce237,function(_0x14d69c,_0xb8872f){if(_0x14d69c){return _0x3b2f95(_0x14d69c);}pm2['disconnect']();return _0x1057f4(_0xb8872f);});});});};exports[_0x1458('0xd')]=function(){return connect()[_0x1458('0x5')](function(){return new BPromise(function(_0x338cf4,_0x464228){return pm2[_0x1458('0xd')](function(_0x2dff45){if(_0x2dff45){return _0x464228(_0x2dff45);}return _0x338cf4(_0x1458('0xe'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index 490474d..8c506fd 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 _0x432d=['../logger','schedule','redis','defaults','localhost','socket.io-emitter','chatTimeout','then','findAll','subtract','minutes','length','info','[CHAT]\x20Interactions\x20to\x20close:','system','timeout','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','chatInteraction:update','error','inspect','start','moment','util'];(function(_0x1233af,_0x3e12b0){var _0x204397=function(_0x416bcd){while(--_0x416bcd){_0x1233af['push'](_0x1233af['shift']());}};_0x204397(++_0x3e12b0);}(_0x432d,0xbe));var _0xd432=function(_0x5da107,_0x10357c){_0x5da107=_0x5da107-0x0;var _0x224f15=_0x432d[_0x5da107];return _0x224f15;};'use strict';var _=require('lodash');var moment=require(_0xd432('0x0'));var Redis=require('ioredis');var util=require(_0xd432('0x1'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var logger=require(_0xd432('0x2'))(_0xd432('0x3'));config[_0xd432('0x4')]=_[_0xd432('0x5')](config[_0xd432('0x4')],{'host':_0xd432('0x6'),'port':0x18eb});var io=require(_0xd432('0x7'))(new Redis(config['redis']));function closeInteractions(){var _0x5d6786=0x0;var _0xcc9bd3=[];return db['Setting']['find']({'raw':!![],'attributes':['id',_0xd432('0x8')],'where':{'id':0x1}})[_0xd432('0x9')](function(_0x6d247f){_0x5d6786=_0x6d247f[_0xd432('0x8')];if(_0x5d6786){return db['ChatInteraction'][_0xd432('0xa')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xd432('0xb')](_0x6d247f[_0xd432('0x8')],_0xd432('0xc'))}}});}else{return[];}})[_0xd432('0x9')](function(_0x14e924){if(_0x14e924&&_0x14e924[_0xd432('0xd')]){_0xcc9bd3=_['map'](_0x14e924||[],'id');logger[_0xd432('0xe')](_0xd432('0xf'),_0xcc9bd3['join']());return db['ChatInteraction']['update']({'closeReason':_0xd432('0x10'),'disposition':_0xd432('0x11'),'closed':!![],'closedAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0xcc9bd3}});}})[_0xd432('0x9')](function(){if(_0xcc9bd3&&_0xcc9bd3['length']){logger[_0xd432('0xe')](_0xd432('0x12'),_0xcc9bd3['join']());for(var _0x3c66da=0x0;_0x3c66da<_0xcc9bd3[_0xd432('0xd')];_0x3c66da++){io[_0xd432('0x13')](_0xd432('0x14'),{'id':_0xcc9bd3[_0x3c66da],'closed':!![]});}}})['catch'](function(_0x192347){logger[_0xd432('0x15')]('[CHAT]\x20Error\x20closing\x20interactions',_0x192347?util[_0xd432('0x16')](_0x192347,{'showHidden':![],'depth':null}):'');});}exports[_0xd432('0x17')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x0090=['YYYY-MM-DD\x20HH:mm:ss','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','chatInteraction:update','catch','error','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','lodash','ioredis','../../config/environment','../../mysqldb','redis','defaults','localhost','Setting','find','chatTimeout','then','ChatInteraction','findAll','subtract','minutes','info','[CHAT]\x20Interactions\x20to\x20close:','join','system','format'];(function(_0x16bd4f,_0x3e0e12){var _0x13e0cd=function(_0x408c87){while(--_0x408c87){_0x16bd4f['push'](_0x16bd4f['shift']());}};_0x13e0cd(++_0x3e0e12);}(_0x0090,0xf1));var _0x0009=function(_0x32222e,_0x764af1){_0x32222e=_0x32222e-0x0;var _0x622df=_0x0090[_0x32222e];return _0x622df;};'use strict';var _=require(_0x0009('0x0'));var moment=require('moment');var Redis=require(_0x0009('0x1'));var util=require('util');var config=require(_0x0009('0x2'));var db=require(_0x0009('0x3'))['db'];var logger=require('../logger')('schedule');config[_0x0009('0x4')]=_[_0x0009('0x5')](config[_0x0009('0x4')],{'host':_0x0009('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0009('0x4')]));function closeInteractions(){var _0x149204=0x0;var _0x3cfc18=[];return db[_0x0009('0x7')][_0x0009('0x8')]({'raw':!![],'attributes':['id',_0x0009('0x9')],'where':{'id':0x1}})[_0x0009('0xa')](function(_0x4f2836){_0x149204=_0x4f2836[_0x0009('0x9')];if(_0x149204){return db[_0x0009('0xb')][_0x0009('0xc')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x0009('0xd')](_0x4f2836[_0x0009('0x9')],_0x0009('0xe'))}}});}else{return[];}})[_0x0009('0xa')](function(_0x3d7a81){if(_0x3d7a81&&_0x3d7a81['length']){_0x3cfc18=_['map'](_0x3d7a81||[],'id');logger[_0x0009('0xf')](_0x0009('0x10'),_0x3cfc18[_0x0009('0x11')]());return db[_0x0009('0xb')]['update']({'closeReason':_0x0009('0x12'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0x0009('0x13')](_0x0009('0x14'))},{'where':{'id':_0x3cfc18}});}})['then'](function(){if(_0x3cfc18&&_0x3cfc18['length']){logger[_0x0009('0xf')](_0x0009('0x15'),_0x3cfc18['join']());for(var _0x2fac55=0x0;_0x2fac55<_0x3cfc18['length'];_0x2fac55++){io[_0x0009('0x16')](_0x0009('0x17'),{'id':_0x3cfc18[_0x2fac55],'closed':!![]});}}})[_0x0009('0x18')](function(_0x212cbc){logger[_0x0009('0x19')](_0x0009('0x1a'),_0x212cbc?util[_0x0009('0x1b')](_0x212cbc,{'showHidden':![],'depth':null}):'');});}exports[_0x0009('0x1c')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/schedule/cloud-provider.js b/server/config/schedule/cloud-provider.js index 827304e..273f396 100644 --- a/server/config/schedule/cloud-provider.js +++ b/server/config/schedule/cloud-provider.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4541=['exports','startAllRefreshIntervals'];(function(_0x32793f,_0x4160de){var _0x3218c8=function(_0x2ac029){while(--_0x2ac029){_0x32793f['push'](_0x32793f['shift']());}};_0x3218c8(++_0x4160de);}(_0x4541,0xd5));var _0x1454=function(_0x5922f7,_0x35b81e){_0x5922f7=_0x5922f7-0x0;var _0x30b80d=_0x4541[_0x5922f7];return _0x30b80d;};'use strict';function start(){var _0xe41874=require('../../api/cloudProvider/cloudProvider.oauth.js');return _0xe41874[_0x1454('0x0')]();}module[_0x1454('0x1')]={'intervals':{},'start':start}; \ No newline at end of file +var _0xd051=['exports','../../api/cloudProvider/cloudProvider.oauth.js','startAllRefreshIntervals'];(function(_0x41b62f,_0x247a1a){var _0x52f12f=function(_0x14dd6a){while(--_0x14dd6a){_0x41b62f['push'](_0x41b62f['shift']());}};_0x52f12f(++_0x247a1a);}(_0xd051,0x6d));var _0x1d05=function(_0x354df6,_0x4fb714){_0x354df6=_0x354df6-0x0;var _0x3b8676=_0xd051[_0x354df6];return _0x3b8676;};'use strict';function start(){var _0x54a364=require(_0x1d05('0x0'));return _0x54a364[_0x1d05('0x1')]();}module[_0x1d05('0x2')]={'intervals':{},'start':start}; \ No newline at end of file diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index 960670b..05698ba 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 _0xbb7f=['../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','findOne','catch','error','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','getSmtpOptions','format','\x22%s\x22\x20<%s>','user','bcc','Report\x20%s\x20last\x20%s\x20%s','name','join','../../files/reports','%s.%s','basename','savename','extname','existsSync','status','Sent','attachments','message','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','Empty','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','Loading','text','Report\x20still\x20running\x20after\x20timeout.\x0aYou\x20can\x20find\x20the\x20report\x20when\x20it\x20will\x20be\x20completed\x20in\x20Analytics\x20->\x20Extracted\x20Reports.\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','Completed','Report\x20file\x20creation\x20still\x20running\x20after\x20timeout.\x0aYou\x20can\x20find\x20the\x20report\x20when\x20it\x20will\x20be\x20completed\x20in\x20Analytics\x20->\x20Extracted\x20Reports.\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','Report\x20extraction\x20procedure\x20has\x20run\x20into\x20an\x20unexpected\x20error.\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','[handleSendEmail]\x20Unrecognized\x20status:','SendMail','then','stringify','case\x20loading','currentAttempt','retryOptions','data','stop','operation','retry','still\x20loading','case\x20completed','job','case\x20failed','Unrecognized\x20status:','dataValues','attempt','Job\x20ID\x20','\x20Attempt\x20#:','report\x20status:','sendMail','isNil','subtractNumber','subtractUnit','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','DefaultReportId','CustomReportId','exec\x20custom\x20report\x20id:%s','runReport','no\x20report\x20id','Schedule','findAll','MailServerOut','Smtp','CloudProvider','keys','jobs','keyBy','toString','difference','intersection','length','exists','deleteJob','toRun','run\x20job','cron','active','startAt','endAt','start','stop\x20cron','isBetween','update','update\x20cron','util','path','lodash','moment','cron-job-manager','jayson/promise','../logger','schedule','../../mysqldb'];(function(_0x37b8e4,_0x1e1148){var _0x1fae0f=function(_0x1dd281){while(--_0x1dd281){_0x37b8e4['push'](_0x37b8e4['shift']());}};_0x1fae0f(++_0x1e1148);}(_0xbb7f,0xc9));var _0xfbb7=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xbb7f[_0x3b380d];return _0x54502b;};'use strict';var fs=require('fs');var util=require(_0xfbb7('0x0'));var path=require(_0xfbb7('0x1'));var _=require(_0xfbb7('0x2'));var moment=require(_0xfbb7('0x3'));var CronJobManager=require(_0xfbb7('0x4'));var jayson=require(_0xfbb7('0x5'));var BPromise=require('bluebird');var logger=require(_0xfbb7('0x6'))(_0xfbb7('0x7'));var db=require(_0xfbb7('0x8'))['db'];const retry=require('retry');var analyticCustomReportController=require(_0xfbb7('0x9'));var analyticDefaultReportController=require(_0xfbb7('0xa'));var client=jayson[_0xfbb7('0xb')]['http']({'port':0x232b});var manager=new CronJobManager();function getReportData(_0x2fc2ef){const _0x2aeb3a={};if(typeof _0x2fc2ef==='number'){_0x2aeb3a['id']=_0x2fc2ef;}return db['AnalyticExtractedReport'][_0xfbb7('0xc')]({'where':_0x2aeb3a})['then'](function(_0x4d714d){return _0x4d714d;})[_0xfbb7('0xd')](function(_0x5438f4){logger[_0xfbb7('0xe')](_0x5438f4);});}function handleSendEmail(_0x10d9c7,_0xf5ee5d){logger[_0xfbb7('0xf')](_0xfbb7('0x10'),_0x10d9c7[_0xfbb7('0x11')]);var _0x2556d6=!![];var _0x507d0e=_0x10d9c7[_0xfbb7('0x12')][_0xfbb7('0x13')]();var _0x396aff={'account':_0x507d0e,'message':{'from':util[_0xfbb7('0x14')](_0xfbb7('0x15'),_0x10d9c7[_0xfbb7('0x12')]['name'],_0x10d9c7[_0xfbb7('0x12')][_0xfbb7('0x11')]||_0x10d9c7['MailAccount']['Smtp'][_0xfbb7('0x16')]),'to':_0x10d9c7[_0xfbb7('0x11')],'cc':_0x10d9c7['cc'],'bcc':_0x10d9c7[_0xfbb7('0x17')],'subject':util[_0xfbb7('0x14')](_0xfbb7('0x18'),_0xf5ee5d[_0xfbb7('0x19')],_0x10d9c7['subtractNumber'],_0x10d9c7['subtractUnit'])}};var _0x440c5c=path[_0xfbb7('0x1a')](__dirname,_0xfbb7('0x1b'));var _0x1a62c4=_0xf5ee5d['savename'];var _0x2d5369=util[_0xfbb7('0x14')](_0xfbb7('0x1c'),path[_0xfbb7('0x1d')](_0xf5ee5d[_0xfbb7('0x1e')],path[_0xfbb7('0x1f')](_0xf5ee5d[_0xfbb7('0x1e')])),'zip');var _0x28d95f=path['join'](_0x440c5c,_0x1a62c4);var _0x204b77=path[_0xfbb7('0x1a')](_0x440c5c,_0x2d5369);if(fs[_0xfbb7('0x20')](_0x28d95f)){_0xf5ee5d[_0xfbb7('0x21')]=_0xfbb7('0x22');_0x396aff['message'][_0xfbb7('0x23')]=[{'filename':_0x1a62c4,'path':_0x28d95f}];_0x396aff[_0xfbb7('0x24')]['text']=util[_0xfbb7('0x14')](_0xfbb7('0x25'),JSON['stringify'](_0xf5ee5d,null,0x2));}else if(fs['existsSync'](_0x204b77)){_0xf5ee5d['status']=_0xfbb7('0x22');_0x396aff[_0xfbb7('0x24')][_0xfbb7('0x23')]=[{'filename':_0x2d5369,'path':_0x204b77}];}else{if(_0xf5ee5d[_0xfbb7('0x21')]===_0xfbb7('0x26')){_0x396aff[_0xfbb7('0x24')]['text']='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0x10d9c7[_0xfbb7('0x27')]){_0x2556d6=![];logger['info'](_0xfbb7('0x28'));}}else if(_0xf5ee5d[_0xfbb7('0x21')]===_0xfbb7('0x29')){_0x396aff[_0xfbb7('0x24')][_0xfbb7('0x2a')]=_0xfbb7('0x2b');}else if(_0xf5ee5d['status']===_0xfbb7('0x2c')){_0x396aff['message'][_0xfbb7('0x2a')]=_0xfbb7('0x2d');}else if(_0xf5ee5d[_0xfbb7('0x21')]==='Failed'){_0x396aff[_0xfbb7('0x24')][_0xfbb7('0x2a')]=_0xfbb7('0x2e');}else{logger['error'](_0xfbb7('0x2f'),_0xf5ee5d[_0xfbb7('0x21')]);}}if(_0x2556d6){return client['request'](_0xfbb7('0x30'),_0x396aff)[_0xfbb7('0x31')](function(_0xc5789d){if(_0xc5789d[_0xfbb7('0xe')]){return logger[_0xfbb7('0xe')]('error\x20mail',JSON[_0xfbb7('0x32')](_0xc5789d));}return logger[_0xfbb7('0xf')]('email\x20sent');})[_0xfbb7('0xd')](function(_0xe2c63e){return logger[_0xfbb7('0xe')]('error\x20mail',JSON['stringify'](_0xe2c63e));});}}function handleError(){return function(_0x330c8d){return logger['error'](JSON[_0xfbb7('0x32')](_0x330c8d));};}function loading(_0x4872d0){logger['info'](_0xfbb7('0x33'));if(_0x4872d0[_0xfbb7('0x34')]===_0x4872d0[_0xfbb7('0x35')]['retries']){handleSendEmail(_0x4872d0['job'],_0x4872d0[_0xfbb7('0x36')]);_0x4872d0['operation'][_0xfbb7('0x37')]();}else{_0x4872d0[_0xfbb7('0x38')][_0xfbb7('0x39')](_0xfbb7('0x3a'));}}function completed(_0x118df2){logger['info'](_0xfbb7('0x3b'));handleSendEmail(_0x118df2[_0xfbb7('0x3c')],_0x118df2[_0xfbb7('0x36')]);_0x118df2[_0xfbb7('0x38')][_0xfbb7('0x37')]();}function empty(_0x12c14e){logger[_0xfbb7('0xf')]('case\x20empty');handleSendEmail(_0x12c14e[_0xfbb7('0x3c')],_0x12c14e[_0xfbb7('0x36')]);_0x12c14e[_0xfbb7('0x38')][_0xfbb7('0x37')]();}function failed(_0x400e77){logger[_0xfbb7('0xf')](_0xfbb7('0x3d'));handleSendEmail(_0x400e77[_0xfbb7('0x3c')],_0x400e77[_0xfbb7('0x36')]);_0x400e77[_0xfbb7('0x38')][_0xfbb7('0x37')]();}function urecognized(_0x19d5d4){logger[_0xfbb7('0xe')](_0xfbb7('0x3e'),_0x19d5d4['entity'][_0xfbb7('0x3f')][_0xfbb7('0x21')]);_0x19d5d4[_0xfbb7('0x38')][_0xfbb7('0x37')]();}const reportStatusStrategies={'Loading':loading,'Completed':completed,'Empty':empty,'Failed':failed,'Unrecognized':urecognized};function retryer(_0xd38795,_0x2b3448){const _0x2a01f4={'retries':0x3,'factor':0x2,'minTimeout':0x5b*0x3e8,'maxTimeout':0xa*0x3c*0x3e8};const _0x3d53c0=retry[_0xfbb7('0x38')](_0x2a01f4);_0x3d53c0[_0xfbb7('0x40')](_0x5dc01b=>{logger[_0xfbb7('0xf')](_0xfbb7('0x41')+_0xd38795['id']+_0xfbb7('0x42')+_0x5dc01b);try{getReportData(_0x2b3448['id'])['then'](function(_0x4c1688){_0x2b3448=_0x4c1688;logger[_0xfbb7('0xf')](_0xfbb7('0x43'),_0x4c1688[_0xfbb7('0x3f')][_0xfbb7('0x21')]);if(!reportStatusStrategies[_0x4c1688[_0xfbb7('0x3f')]['status']]){logger[_0xfbb7('0xe')](_0xfbb7('0x43'),_0x4c1688['dataValues'][_0xfbb7('0x21')]);_0x3d53c0['retry']();}reportStatusStrategies[_0x4c1688[_0xfbb7('0x3f')][_0xfbb7('0x21')]]({'operation':_0x3d53c0,'currentAttempt':_0x5dc01b,'retryOptions':_0x2a01f4,'job':_0xd38795,'data':_0x2b3448,'entity':_0x4c1688});});}catch(_0x4413d1){_0x3d53c0[_0xfbb7('0x39')](_0x4413d1);}});}function handleResult(_0x45b8e2){return function(_0x1ec347){if(_0x45b8e2[_0xfbb7('0x44')]&&_0x45b8e2[_0xfbb7('0x12')]&&_0x45b8e2[_0xfbb7('0x12')]['Smtp']&&!_['isNil'](_0x45b8e2['email'])){retryer(_0x45b8e2,_0x1ec347);}};}function handleJob(_0x8ceb71){return function(){try{if(_[_0xfbb7('0x45')](_0x8ceb71[_0xfbb7('0x46')])){return logger[_0xfbb7('0xf')]('subtractNumber\x20null\x20or\x20undefined');}if(_['isNil'](_0x8ceb71[_0xfbb7('0x47')])){return logger['info'](_0xfbb7('0x48'));}var _0x378518={'startDate':moment()[_0xfbb7('0x49')](_0x8ceb71[_0xfbb7('0x46')],_0x8ceb71[_0xfbb7('0x47')])[_0xfbb7('0x14')](_0xfbb7('0x4a')),'endDate':moment()['format'](_0xfbb7('0x4a')),'type':'scheduled','output':_0x8ceb71['output'],'name':_0x8ceb71[_0xfbb7('0x19')]};if(!_['isNil'](_0x8ceb71[_0xfbb7('0x4b')])){logger[_0xfbb7('0xf')]('exec\x20defaul\x20report\x20id:%s',_0x8ceb71[_0xfbb7('0x4b')]);return analyticDefaultReportController['runReport']({'id':_0x8ceb71['DefaultReportId']},_0x378518)[_0xfbb7('0x31')](handleResult(_0x8ceb71))['catch'](handleError());}if(!_[_0xfbb7('0x45')](_0x8ceb71[_0xfbb7('0x4c')])){logger[_0xfbb7('0xf')](_0xfbb7('0x4d'),_0x8ceb71[_0xfbb7('0x4c')]);return analyticCustomReportController[_0xfbb7('0x4e')]({'id':_0x8ceb71[_0xfbb7('0x4c')]},_0x378518)[_0xfbb7('0x31')](handleResult(_0x8ceb71))['catch'](handleError());}}catch(_0x59b539){logger[_0xfbb7('0xe')](JSON['stringify'](_0x59b539));}return logger['info'](_0xfbb7('0x4f'));};}function getJobs(_0x19eaad){var _0x155117={};if(_0x19eaad){_0x155117['id']=_0x19eaad;}return db[_0xfbb7('0x50')][_0xfbb7('0x51')]({'where':_0x155117,'include':[{'model':db[_0xfbb7('0x12')],'attributes':['id',_0xfbb7('0x19'),_0xfbb7('0x11')],'include':[{'model':db[_0xfbb7('0x52')],'as':_0xfbb7('0x53'),'include':[{'model':db[_0xfbb7('0x54')],'as':'CloudProvider'}]}]}]})[_0xfbb7('0x31')](function(_0x468e14){var _0xbcd06d=_[_0xfbb7('0x55')](manager[_0xfbb7('0x56')]);var _0x35bc2d=_['map'](_0x468e14,function(_0x1fb38a){return _0x1fb38a['id']['toString']();});var _0x1ce25a=_[_0xfbb7('0x57')](_0x468e14,function(_0x349d42){return _0x349d42['id'][_0xfbb7('0x58')]();});var _0xa38b0e=_0x19eaad?_0x35bc2d:_[_0xfbb7('0x59')](_0x35bc2d,_0xbcd06d);var _0x2e49ae=_[_0xfbb7('0x5a')](_0x35bc2d,_0xbcd06d);var _0x224592=_['difference'](_0xbcd06d,_0x35bc2d);var _0x5a503f;var _0x866da9;for(_0x5a503f=0x0;_0x5a503f<_0x224592[_0xfbb7('0x5b')]&&!_0x19eaad;_0x5a503f+=0x1){_0x866da9=_0x224592[_0x5a503f][_0xfbb7('0x58')]();if(manager[_0xfbb7('0x5c')](_0x866da9)){manager[_0xfbb7('0x37')](_0x866da9);manager[_0xfbb7('0x5d')](_0x866da9);logger['info']('delete\x20cron',_0x866da9);}}logger[_0xfbb7('0xf')](_0xfbb7('0x5e'),JSON['stringify'](_0xa38b0e));for(_0x5a503f=0x0;_0x5a503f<_0xa38b0e[_0xfbb7('0x5b')];_0x5a503f+=0x1){_0x866da9=_0xa38b0e[_0x5a503f][_0xfbb7('0x58')]();if(_0x19eaad){logger[_0xfbb7('0xf')](JSON['stringify'](_0x1ce25a[_0x866da9]));BPromise['resolve']()[_0xfbb7('0x31')](handleJob(_0x1ce25a[_0x866da9]));logger[_0xfbb7('0xf')](_0xfbb7('0x5f'),_0x1ce25a[_0x866da9][_0xfbb7('0x19')],_0x1ce25a[_0x866da9]['cron']);}else if(_0x1ce25a[_0x866da9][_0xfbb7('0x60')]&&_0x1ce25a[_0x866da9][_0xfbb7('0x61')]&&moment()['isBetween'](_0x1ce25a[_0x866da9][_0xfbb7('0x62')],_0x1ce25a[_0x866da9][_0xfbb7('0x63')])){manager['add'](_0x866da9,_0x1ce25a[_0x866da9][_0xfbb7('0x60')],handleJob(_0x1ce25a[_0x866da9]));manager[_0xfbb7('0x64')](_0x866da9);logger[_0xfbb7('0xf')]('add\x20cron',_0x1ce25a[_0x866da9][_0xfbb7('0x19')],_0x1ce25a[_0x866da9][_0xfbb7('0x60')]);}else if(manager[_0xfbb7('0x5c')](_0x866da9)){manager['stop'](_0x866da9);manager[_0xfbb7('0x5d')](_0x866da9);logger[_0xfbb7('0xf')](_0xfbb7('0x65'),_0x1ce25a[_0x866da9][_0xfbb7('0x19')],_0x1ce25a[_0x866da9][_0xfbb7('0x60')]);}}for(_0x5a503f=0x0,_0x866da9;_0x5a503f<_0x2e49ae[_0xfbb7('0x5b')]&&!_0x19eaad;_0x5a503f+=0x1){_0x866da9=_0x2e49ae[_0x5a503f][_0xfbb7('0x58')]();if(manager[_0xfbb7('0x5c')](_0x866da9)){if(_0x1ce25a[_0x866da9][_0xfbb7('0x60')]&&_0x1ce25a[_0x866da9][_0xfbb7('0x61')]&&moment()[_0xfbb7('0x66')](_0x1ce25a[_0x866da9]['startAt'],_0x1ce25a[_0x866da9][_0xfbb7('0x63')])){manager[_0xfbb7('0x67')](_0x866da9,_0x1ce25a[_0x866da9][_0xfbb7('0x60')],handleJob(_0x1ce25a[_0x866da9]));logger['info'](_0xfbb7('0x68'),_0x1ce25a[_0x866da9][_0xfbb7('0x19')],_0x1ce25a[_0x866da9][_0xfbb7('0x60')]);}else{manager[_0xfbb7('0x37')](_0x866da9);manager[_0xfbb7('0x5d')](_0x866da9);logger[_0xfbb7('0xf')](_0xfbb7('0x65'),_0x1ce25a[_0x866da9][_0xfbb7('0x19')],_0x1ce25a[_0x866da9]['cron']);}}}})[_0xfbb7('0xd')](function(_0x3ea88e){logger['error'](JSON[_0xfbb7('0x32')](_0x3ea88e));});}exports['run']=function(_0x5c3d45){return getJobs(_0x5c3d45);};exports[_0xfbb7('0x64')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x22c9=['scheduled','output','exec\x20defaul\x20report\x20id:%s','DefaultReportId','runReport','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','Schedule','findAll','MailServerOut','CloudProvider','jobs','map','toString','difference','intersection','length','deleteJob','toRun','resolve','run\x20job','cron','active','isBetween','startAt','endAt','start','add\x20cron','exists','stop\x20cron','update','update\x20cron','run','util','path','lodash','cron-job-manager','bluebird','../logger','../../mysqldb','retry','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','number','AnalyticExtractedReport','findOne','catch','info','Try\x20to\x20send\x20a\x20mail\x20to','MailAccount','getSmtpOptions','\x22%s\x22\x20<%s>','name','email','bcc','format','Report\x20%s\x20last\x20%s\x20%s','join','../../files/reports','savename','basename','extname','zip','existsSync','status','Sent','message','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','Empty','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','Loading','Report\x20still\x20running\x20after\x20timeout.\x0aYou\x20can\x20find\x20the\x20report\x20when\x20it\x20will\x20be\x20completed\x20in\x20Analytics\x20->\x20Extracted\x20Reports.\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','Completed','Failed','Report\x20extraction\x20procedure\x20has\x20run\x20into\x20an\x20unexpected\x20error.\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','request','SendMail','then','error','error\x20mail','stringify','email\x20sent','case\x20loading','currentAttempt','retryOptions','retries','data','stop','operation','still\x20loading','case\x20completed','job','case\x20failed','Unrecognized\x20status:','dataValues','Job\x20ID\x20','\x20Attempt\x20#:','report\x20status:','sendMail','Smtp','isNil','subtractNumber','subtractNumber\x20null\x20or\x20undefined','subtractUnit','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss'];(function(_0xda6b7d,_0x5e4ca7){var _0x4ae723=function(_0x3b1b08){while(--_0x3b1b08){_0xda6b7d['push'](_0xda6b7d['shift']());}};_0x4ae723(++_0x5e4ca7);}(_0x22c9,0x102));var _0x922c=function(_0x51d92a,_0x49d811){_0x51d92a=_0x51d92a-0x0;var _0x1236b0=_0x22c9[_0x51d92a];return _0x1236b0;};'use strict';var fs=require('fs');var util=require(_0x922c('0x0'));var path=require(_0x922c('0x1'));var _=require(_0x922c('0x2'));var moment=require('moment');var CronJobManager=require(_0x922c('0x3'));var jayson=require('jayson/promise');var BPromise=require(_0x922c('0x4'));var logger=require(_0x922c('0x5'))('schedule');var db=require(_0x922c('0x6'))['db'];const retry=require(_0x922c('0x7'));var analyticCustomReportController=require(_0x922c('0x8'));var analyticDefaultReportController=require(_0x922c('0x9'));var client=jayson[_0x922c('0xa')][_0x922c('0xb')]({'port':0x232b});var manager=new CronJobManager();function getReportData(_0x11c531){const _0x4ff2d5={};if(typeof _0x11c531===_0x922c('0xc')){_0x4ff2d5['id']=_0x11c531;}return db[_0x922c('0xd')][_0x922c('0xe')]({'where':_0x4ff2d5})['then'](function(_0x1e41c5){return _0x1e41c5;})[_0x922c('0xf')](function(_0x2028d6){logger['error'](_0x2028d6);});}function handleSendEmail(_0x41474d,_0x1052d7){logger[_0x922c('0x10')](_0x922c('0x11'),_0x41474d['email']);var _0x1d374a=!![];var _0x153f8a=_0x41474d[_0x922c('0x12')][_0x922c('0x13')]();var _0x4de285={'account':_0x153f8a,'message':{'from':util['format'](_0x922c('0x14'),_0x41474d[_0x922c('0x12')][_0x922c('0x15')],_0x41474d['MailAccount'][_0x922c('0x16')]||_0x41474d[_0x922c('0x12')]['Smtp']['user']),'to':_0x41474d[_0x922c('0x16')],'cc':_0x41474d['cc'],'bcc':_0x41474d[_0x922c('0x17')],'subject':util[_0x922c('0x18')](_0x922c('0x19'),_0x1052d7[_0x922c('0x15')],_0x41474d['subtractNumber'],_0x41474d['subtractUnit'])}};var _0x4760ba=path[_0x922c('0x1a')](__dirname,_0x922c('0x1b'));var _0x11eb6e=_0x1052d7[_0x922c('0x1c')];var _0x3fd897=util[_0x922c('0x18')]('%s.%s',path[_0x922c('0x1d')](_0x1052d7['savename'],path[_0x922c('0x1e')](_0x1052d7[_0x922c('0x1c')])),_0x922c('0x1f'));var _0x14199e=path[_0x922c('0x1a')](_0x4760ba,_0x11eb6e);var _0x3da02b=path['join'](_0x4760ba,_0x3fd897);if(fs[_0x922c('0x20')](_0x14199e)){_0x1052d7[_0x922c('0x21')]=_0x922c('0x22');_0x4de285[_0x922c('0x23')][_0x922c('0x24')]=[{'filename':_0x11eb6e,'path':_0x14199e}];_0x4de285[_0x922c('0x23')][_0x922c('0x25')]=util['format'](_0x922c('0x26'),JSON['stringify'](_0x1052d7,null,0x2));}else if(fs[_0x922c('0x20')](_0x3da02b)){_0x1052d7[_0x922c('0x21')]=_0x922c('0x22');_0x4de285[_0x922c('0x23')][_0x922c('0x24')]=[{'filename':_0x3fd897,'path':_0x3da02b}];}else{if(_0x1052d7[_0x922c('0x21')]===_0x922c('0x27')){_0x4de285['message'][_0x922c('0x25')]=_0x922c('0x28');if(!_0x41474d['sendIfEmpty']){_0x1d374a=![];logger[_0x922c('0x10')]('empty\x20file,\x20email\x20not\x20sent');}}else if(_0x1052d7[_0x922c('0x21')]===_0x922c('0x29')){_0x4de285['message'][_0x922c('0x25')]=_0x922c('0x2a');}else if(_0x1052d7[_0x922c('0x21')]===_0x922c('0x2b')){_0x4de285[_0x922c('0x23')][_0x922c('0x25')]='Report\x20file\x20creation\x20still\x20running\x20after\x20timeout.\x0aYou\x20can\x20find\x20the\x20report\x20when\x20it\x20will\x20be\x20completed\x20in\x20Analytics\x20->\x20Extracted\x20Reports.\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';}else if(_0x1052d7[_0x922c('0x21')]===_0x922c('0x2c')){_0x4de285[_0x922c('0x23')]['text']=_0x922c('0x2d');}else{logger['error']('[handleSendEmail]\x20Unrecognized\x20status:',_0x1052d7[_0x922c('0x21')]);}}if(_0x1d374a){return client[_0x922c('0x2e')](_0x922c('0x2f'),_0x4de285)[_0x922c('0x30')](function(_0x321692){if(_0x321692[_0x922c('0x31')]){return logger[_0x922c('0x31')](_0x922c('0x32'),JSON[_0x922c('0x33')](_0x321692));}return logger[_0x922c('0x10')](_0x922c('0x34'));})['catch'](function(_0x145279){return logger[_0x922c('0x31')](_0x922c('0x32'),JSON['stringify'](_0x145279));});}}function handleError(){return function(_0x144e38){return logger[_0x922c('0x31')](JSON[_0x922c('0x33')](_0x144e38));};}function loading(_0x45abdf){logger['info'](_0x922c('0x35'));if(_0x45abdf[_0x922c('0x36')]===_0x45abdf[_0x922c('0x37')][_0x922c('0x38')]){handleSendEmail(_0x45abdf['job'],_0x45abdf[_0x922c('0x39')]);_0x45abdf['operation'][_0x922c('0x3a')]();}else{_0x45abdf[_0x922c('0x3b')]['retry'](_0x922c('0x3c'));}}function completed(_0x15dc1c){logger['info'](_0x922c('0x3d'));handleSendEmail(_0x15dc1c['job'],_0x15dc1c['data']);_0x15dc1c['operation'][_0x922c('0x3a')]();}function empty(_0x3cb21c){logger[_0x922c('0x10')]('case\x20empty');handleSendEmail(_0x3cb21c[_0x922c('0x3e')],_0x3cb21c[_0x922c('0x39')]);_0x3cb21c[_0x922c('0x3b')]['stop']();}function failed(_0x51d607){logger[_0x922c('0x10')](_0x922c('0x3f'));handleSendEmail(_0x51d607[_0x922c('0x3e')],_0x51d607['data']);_0x51d607[_0x922c('0x3b')][_0x922c('0x3a')]();}function urecognized(_0x5a9a9d){logger[_0x922c('0x31')](_0x922c('0x40'),_0x5a9a9d['entity'][_0x922c('0x41')]['status']);_0x5a9a9d[_0x922c('0x3b')][_0x922c('0x3a')]();}const reportStatusStrategies={'Loading':loading,'Completed':completed,'Empty':empty,'Failed':failed,'Unrecognized':urecognized};function retryer(_0x1f22f6,_0xc6998c){const _0x58d957={'retries':0x3,'factor':0x2,'minTimeout':0x5b*0x3e8,'maxTimeout':0xa*0x3c*0x3e8};const _0x271e3e=retry[_0x922c('0x3b')](_0x58d957);_0x271e3e['attempt'](_0xd072b4=>{logger[_0x922c('0x10')](_0x922c('0x42')+_0x1f22f6['id']+_0x922c('0x43')+_0xd072b4);try{getReportData(_0xc6998c['id'])['then'](function(_0x30ebda){_0xc6998c=_0x30ebda;logger[_0x922c('0x10')]('report\x20status:',_0x30ebda['dataValues'][_0x922c('0x21')]);if(!reportStatusStrategies[_0x30ebda['dataValues'][_0x922c('0x21')]]){logger[_0x922c('0x31')](_0x922c('0x44'),_0x30ebda[_0x922c('0x41')][_0x922c('0x21')]);_0x271e3e[_0x922c('0x7')]();}reportStatusStrategies[_0x30ebda[_0x922c('0x41')][_0x922c('0x21')]]({'operation':_0x271e3e,'currentAttempt':_0xd072b4,'retryOptions':_0x58d957,'job':_0x1f22f6,'data':_0xc6998c,'entity':_0x30ebda});});}catch(_0x5664e9){_0x271e3e[_0x922c('0x7')](_0x5664e9);}});}function handleResult(_0x1326d4){return function(_0x49eea8){if(_0x1326d4[_0x922c('0x45')]&&_0x1326d4['MailAccount']&&_0x1326d4['MailAccount'][_0x922c('0x46')]&&!_[_0x922c('0x47')](_0x1326d4[_0x922c('0x16')])){retryer(_0x1326d4,_0x49eea8);}};}function handleJob(_0x4c6599){return function(){try{if(_[_0x922c('0x47')](_0x4c6599[_0x922c('0x48')])){return logger['info'](_0x922c('0x49'));}if(_[_0x922c('0x47')](_0x4c6599[_0x922c('0x4a')])){return logger[_0x922c('0x10')](_0x922c('0x4b'));}var _0x85ab8c={'startDate':moment()[_0x922c('0x4c')](_0x4c6599[_0x922c('0x48')],_0x4c6599[_0x922c('0x4a')])[_0x922c('0x18')](_0x922c('0x4d')),'endDate':moment()['format'](_0x922c('0x4d')),'type':_0x922c('0x4e'),'output':_0x4c6599[_0x922c('0x4f')],'name':_0x4c6599['name']};if(!_[_0x922c('0x47')](_0x4c6599['DefaultReportId'])){logger[_0x922c('0x10')](_0x922c('0x50'),_0x4c6599[_0x922c('0x51')]);return analyticDefaultReportController[_0x922c('0x52')]({'id':_0x4c6599[_0x922c('0x51')]},_0x85ab8c)[_0x922c('0x30')](handleResult(_0x4c6599))[_0x922c('0xf')](handleError());}if(!_[_0x922c('0x47')](_0x4c6599[_0x922c('0x53')])){logger['info'](_0x922c('0x54'),_0x4c6599[_0x922c('0x53')]);return analyticCustomReportController[_0x922c('0x52')]({'id':_0x4c6599[_0x922c('0x53')]},_0x85ab8c)[_0x922c('0x30')](handleResult(_0x4c6599))[_0x922c('0xf')](handleError());}}catch(_0x4ea8de){logger[_0x922c('0x31')](JSON[_0x922c('0x33')](_0x4ea8de));}return logger[_0x922c('0x10')](_0x922c('0x55'));};}function getJobs(_0x459209){var _0x3c3038={};if(_0x459209){_0x3c3038['id']=_0x459209;}return db[_0x922c('0x56')][_0x922c('0x57')]({'where':_0x3c3038,'include':[{'model':db[_0x922c('0x12')],'attributes':['id',_0x922c('0x15'),_0x922c('0x16')],'include':[{'model':db[_0x922c('0x58')],'as':_0x922c('0x46'),'include':[{'model':db['CloudProvider'],'as':_0x922c('0x59')}]}]}]})[_0x922c('0x30')](function(_0x4bc087){var _0x232d2f=_['keys'](manager[_0x922c('0x5a')]);var _0x353274=_[_0x922c('0x5b')](_0x4bc087,function(_0x3ec307){return _0x3ec307['id'][_0x922c('0x5c')]();});var _0x260946=_['keyBy'](_0x4bc087,function(_0x5619a1){return _0x5619a1['id']['toString']();});var _0x2a228d=_0x459209?_0x353274:_[_0x922c('0x5d')](_0x353274,_0x232d2f);var _0x445704=_[_0x922c('0x5e')](_0x353274,_0x232d2f);var _0x144dca=_[_0x922c('0x5d')](_0x232d2f,_0x353274);var _0x536e53;var _0x255fd0;for(_0x536e53=0x0;_0x536e53<_0x144dca[_0x922c('0x5f')]&&!_0x459209;_0x536e53+=0x1){_0x255fd0=_0x144dca[_0x536e53][_0x922c('0x5c')]();if(manager['exists'](_0x255fd0)){manager['stop'](_0x255fd0);manager[_0x922c('0x60')](_0x255fd0);logger[_0x922c('0x10')]('delete\x20cron',_0x255fd0);}}logger[_0x922c('0x10')](_0x922c('0x61'),JSON[_0x922c('0x33')](_0x2a228d));for(_0x536e53=0x0;_0x536e53<_0x2a228d[_0x922c('0x5f')];_0x536e53+=0x1){_0x255fd0=_0x2a228d[_0x536e53][_0x922c('0x5c')]();if(_0x459209){logger['info'](JSON[_0x922c('0x33')](_0x260946[_0x255fd0]));BPromise[_0x922c('0x62')]()[_0x922c('0x30')](handleJob(_0x260946[_0x255fd0]));logger[_0x922c('0x10')](_0x922c('0x63'),_0x260946[_0x255fd0]['name'],_0x260946[_0x255fd0][_0x922c('0x64')]);}else if(_0x260946[_0x255fd0][_0x922c('0x64')]&&_0x260946[_0x255fd0][_0x922c('0x65')]&&moment()[_0x922c('0x66')](_0x260946[_0x255fd0][_0x922c('0x67')],_0x260946[_0x255fd0][_0x922c('0x68')])){manager['add'](_0x255fd0,_0x260946[_0x255fd0][_0x922c('0x64')],handleJob(_0x260946[_0x255fd0]));manager[_0x922c('0x69')](_0x255fd0);logger['info'](_0x922c('0x6a'),_0x260946[_0x255fd0]['name'],_0x260946[_0x255fd0][_0x922c('0x64')]);}else if(manager[_0x922c('0x6b')](_0x255fd0)){manager[_0x922c('0x3a')](_0x255fd0);manager[_0x922c('0x60')](_0x255fd0);logger['info'](_0x922c('0x6c'),_0x260946[_0x255fd0][_0x922c('0x15')],_0x260946[_0x255fd0][_0x922c('0x64')]);}}for(_0x536e53=0x0,_0x255fd0;_0x536e53<_0x445704[_0x922c('0x5f')]&&!_0x459209;_0x536e53+=0x1){_0x255fd0=_0x445704[_0x536e53]['toString']();if(manager['exists'](_0x255fd0)){if(_0x260946[_0x255fd0]['cron']&&_0x260946[_0x255fd0][_0x922c('0x65')]&&moment()['isBetween'](_0x260946[_0x255fd0][_0x922c('0x67')],_0x260946[_0x255fd0][_0x922c('0x68')])){manager[_0x922c('0x6d')](_0x255fd0,_0x260946[_0x255fd0][_0x922c('0x64')],handleJob(_0x260946[_0x255fd0]));logger[_0x922c('0x10')](_0x922c('0x6e'),_0x260946[_0x255fd0][_0x922c('0x15')],_0x260946[_0x255fd0][_0x922c('0x64')]);}else{manager['stop'](_0x255fd0);manager[_0x922c('0x60')](_0x255fd0);logger[_0x922c('0x10')](_0x922c('0x6c'),_0x260946[_0x255fd0][_0x922c('0x15')],_0x260946[_0x255fd0][_0x922c('0x64')]);}}}})[_0x922c('0xf')](function(_0x51173a){logger[_0x922c('0x31')](JSON['stringify'](_0x51173a));});}exports[_0x922c('0x6f')]=function(_0x105f58){return getJobs(_0x105f58);};exports[_0x922c('0x69')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file diff --git a/server/config/schedule/transcribe.js b/server/config/schedule/transcribe.js index ae3bdbe..07e5b76 100644 --- a/server/config/schedule/transcribe.js +++ b/server/config/schedule/transcribe.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xac4a=['Sentiment','SentimentScore','Positive','Negative','Mixed','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','sentiment','Transcript\x20not\x20available','name','SequelizeValidationError','error','inspect','findAll','No\x20transcribe\x20job\x20to\x20check','Settings\x20not\x20available','transcribe','Transcribe\x20not\x20configured','transcribeAccountId','forEach','push','all','catch','start','lodash','aws-sdk','request-promise','util','bluebird','../../mysqldb','getTranscriptionJob','Comprehend','detectSentiment','substring','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','transcribeRegion','then','info','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJobStatus','TranscriptionJob','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','fileText','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentimentAccountId','sentimentRegion','language','bucket','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available'];(function(_0x5665ac,_0x2d7dd3){var _0x92c4ff=function(_0x22922b){while(--_0x22922b){_0x5665ac['push'](_0x5665ac['shift']());}};_0x92c4ff(++_0x2d7dd3);}(_0xac4a,0x13f));var _0xaac4=function(_0x1abf63,_0x42223e){_0x1abf63=_0x1abf63-0x0;var _0x209348=_0xac4a[_0x1abf63];return _0x209348;};var _=require(_0xaac4('0x0'));var AWS=require(_0xaac4('0x1'));var rp=require(_0xaac4('0x2'));var util=require(_0xaac4('0x3'));var BPromise=require(_0xaac4('0x4'));var db=require(_0xaac4('0x5'))['db'];var logger=require('../../config/logger')('transcribe');function getTranscriptionJob(_0x2af0f6,_0x2a5762,_0x32d34c,_0x58ae95){return new Promise(function(_0x1283a5,_0x53d03a){var _0x1cdfc5=new AWS['TranscribeService']({'accessKeyId':_0x2a5762,'secretAccessKey':_0x2af0f6,'region':_0x32d34c});_0x1cdfc5[_0xaac4('0x6')]({'TranscriptionJobName':_0x58ae95},function(_0x27354c,_0x567295){if(_0x27354c){return _0x53d03a(_0x27354c);}else{return _0x1283a5(_0x567295);}});});}function sentiment(_0x5cfc1b,_0x349671,_0x50d114,_0x452573,_0x59b992){return new Promise(function(_0x4f4c84,_0xeb6b9a){var _0x22cea4=new AWS[(_0xaac4('0x7'))]({'accessKeyId':_0x349671,'secretAccessKey':_0x5cfc1b,'region':_0x50d114});_0x22cea4[_0xaac4('0x8')]({'Text':_0x452573,'LanguageCode':_0x59b992[_0xaac4('0x9')](0x0,0x2)},function(_0x4e0f72,_0x508e14){if(_0x4e0f72){return _0xeb6b9a(_0x4e0f72);}else{return _0x4f4c84(_0x508e14);}});});}function checkTranscribeJob(_0x2348c2,_0x2e2d02,_0x45e512){var _0x5a4801;return new BPromise(function(_0x6a808d,_0x45c129){logger['info'](util[_0xaac4('0xa')](_0xaac4('0xb'),_0x2348c2['id'],_0x2348c2[_0xaac4('0xc')]));return getTranscriptionJob(_0x45e512[_0xaac4('0xd')],_0x45e512[_0xaac4('0xe')],_0x2e2d02[_0xaac4('0xf')],_0x2348c2[_0xaac4('0xc')])[_0xaac4('0x10')](function(_0x233278){logger[_0xaac4('0x11')](util[_0xaac4('0xa')](_0xaac4('0x12'),_0x2348c2['id'],_0x2348c2[_0xaac4('0xc')],_0x233278['TranscriptionJob'][_0xaac4('0x13')]));if(!_0x2348c2['fileText']){switch(_0x233278[_0xaac4('0x14')]['TranscriptionJobStatus']){case _0xaac4('0x15'):var _0x27fe7b={'transcribeStatus':_0x233278[_0xaac4('0x14')][_0xaac4('0x13')],'fileUri':_0x233278[_0xaac4('0x14')][_0xaac4('0x16')][_0xaac4('0x17')]};logger[_0xaac4('0x11')](util[_0xaac4('0xa')]('[RECORDING:%d]\x20Get\x20transcript',_0x2348c2['id']));return rp({'uri':_0x233278[_0xaac4('0x14')]['Transcript'][_0xaac4('0x17')],'json':!![]})[_0xaac4('0x10')](function(_0x43625c){logger[_0xaac4('0x11')](util[_0xaac4('0xa')](_0xaac4('0x18'),_0x2348c2['id']));if(_0x43625c&&_0x43625c['results']&&_0x43625c[_0xaac4('0x19')][_0xaac4('0x1a')]&&_0x43625c[_0xaac4('0x19')][_0xaac4('0x1a')][_0xaac4('0x1b')]){_0x27fe7b[_0xaac4('0x1c')]='';for(var _0xb2577b=0x0;_0xb2577b<_0x43625c['results'][_0xaac4('0x1a')]['length'];_0xb2577b++){_0x27fe7b['fileText']+=_0x43625c['results']['transcripts'][_0xb2577b][_0xaac4('0x1d')]+'';}}return _0x2348c2[_0xaac4('0x1e')](_0x27fe7b);})[_0xaac4('0x10')](function(){logger[_0xaac4('0x11')](util[_0xaac4('0xa')](_0xaac4('0x1f'),_0x2348c2['id']));if(!_0x2348c2[_0xaac4('0x20')]){throw new db[(_0xaac4('0x21'))][(_0xaac4('0x22'))](_0xaac4('0x23'));}if(!_0x2e2d02['sentiment']||!_0x2e2d02[_0xaac4('0x24')]||!_0x2e2d02[_0xaac4('0x25')]||!_0x2e2d02[_0xaac4('0x26')]||!_0x2e2d02[_0xaac4('0x27')]){throw new db[(_0xaac4('0x21'))][(_0xaac4('0x22'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x27fe7b[_0xaac4('0x1c')]){throw new Error('Transcript\x20not\x20available');}if(_0x2e2d02[_0xaac4('0x24')]===_0x45e512['id']){return _0x45e512;}else{return db[_0xaac4('0x28')][_0xaac4('0x29')]({'where':{'id':_settings[_0xaac4('0x24')]}});}})['then'](function(_0x5000e1){if(!_0x5000e1){throw new db['Sequelize'][(_0xaac4('0x22'))](_0xaac4('0x2a'));}if(!_0x5000e1[_0xaac4('0xd')]||!_0x5000e1[_0xaac4('0xe')]){throw new db[(_0xaac4('0x21'))][(_0xaac4('0x22'))](_0xaac4('0x2b'));}_0x5a4801=_0x5000e1;logger[_0xaac4('0x11')](util[_0xaac4('0xa')](_0xaac4('0x2c'),_0x2348c2['id']));return sentiment(_0x5a4801[_0xaac4('0xd')],_0x5a4801[_0xaac4('0xe')],_0x2e2d02[_0xaac4('0x25')],_0x27fe7b[_0xaac4('0x1c')],_0x2e2d02[_0xaac4('0x26')]);})['then'](function(_0x5bad9f){logger[_0xaac4('0x11')](util[_0xaac4('0xa')](_0xaac4('0x2d'),_0x2348c2['id']));return _0x2348c2['update']({'sentiment':_0x5bad9f[_0xaac4('0x2e')],'sPositive':_0x5bad9f[_0xaac4('0x2f')][_0xaac4('0x30')],'sNegative':_0x5bad9f[_0xaac4('0x2f')][_0xaac4('0x31')],'sMixed':_0x5bad9f[_0xaac4('0x2f')][_0xaac4('0x32')],'sNeutral':_0x5bad9f['SentimentScore'][_0xaac4('0x33')]});})[_0xaac4('0x10')](function(){logger[_0xaac4('0x11')](util['format'](_0xaac4('0x1f'),_0x2348c2['id']));_0x6a808d();});case'FAILED':return _0x2348c2['update']({'transcribeStatus':_0xaac4('0x34'),'failureReason':_0x233278[_0xaac4('0x14')][_0xaac4('0x35')]})['then'](function(){logger['info'](util[_0xaac4('0xa')](_0xaac4('0x1f'),_0x2348c2['id']));_0x6a808d();});default:logger[_0xaac4('0x11')](util[_0xaac4('0xa')](_0xaac4('0x36'),_0x2348c2['id']));break;}}else{return BPromise[_0xaac4('0x37')]()['then'](function(){if(!_0x2348c2['tempSentiment']){throw new db[(_0xaac4('0x21'))][(_0xaac4('0x22'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x2e2d02[_0xaac4('0x38')]||!_0x2e2d02[_0xaac4('0x24')]||!_0x2e2d02[_0xaac4('0x25')]||!_0x2e2d02['language']||!_0x2e2d02[_0xaac4('0x27')]){throw new db[(_0xaac4('0x21'))][(_0xaac4('0x22'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x2348c2[_0xaac4('0x1c')]){throw new Error(_0xaac4('0x39'));}if(_0x2e2d02[_0xaac4('0x24')]===_0x45e512['id']){return _0x45e512;}else{return db[_0xaac4('0x28')]['findOne']({'where':{'id':_settings[_0xaac4('0x24')]}});}})['then'](function(_0x50f410){if(!_0x50f410){throw new db[(_0xaac4('0x21'))][(_0xaac4('0x22'))](_0xaac4('0x2a'));}if(!_0x50f410[_0xaac4('0xd')]||!_0x50f410[_0xaac4('0xe')]){throw new db[(_0xaac4('0x21'))][(_0xaac4('0x22'))](_0xaac4('0x2b'));}_0x5a4801=_0x50f410;logger['info'](util[_0xaac4('0xa')](_0xaac4('0x2c'),_0x2348c2['id']));return sentiment(_0x5a4801[_0xaac4('0xd')],_0x5a4801[_0xaac4('0xe')],_0x2e2d02['sentimentRegion'],_0x2348c2[_0xaac4('0x1c')],_0x2e2d02[_0xaac4('0x26')]);})[_0xaac4('0x10')](function(_0x48faff){logger[_0xaac4('0x11')](util[_0xaac4('0xa')](_0xaac4('0x2d'),_0x2348c2['id']));return _0x2348c2[_0xaac4('0x1e')]({'sentiment':_0x48faff['Sentiment'],'sPositive':_0x48faff[_0xaac4('0x2f')][_0xaac4('0x30')],'sNegative':_0x48faff[_0xaac4('0x2f')]['Negative'],'sMixed':_0x48faff[_0xaac4('0x2f')][_0xaac4('0x32')],'sNeutral':_0x48faff[_0xaac4('0x2f')][_0xaac4('0x33')],'transcribeStatus':_0xaac4('0x15')});})[_0xaac4('0x10')](function(){logger[_0xaac4('0x11')](util[_0xaac4('0xa')](_0xaac4('0x1f'),_0x2348c2['id']));_0x6a808d();});}})['catch'](function(_0x10223a){if(_0x10223a){if(!_0x10223a[_0xaac4('0x3a')]||_0x10223a[_0xaac4('0x3a')]!==_0xaac4('0x3b')){logger[_0xaac4('0x3c')](util['format']('[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis',_0x2348c2['id']),util[_0xaac4('0x3d')](_0x10223a,{'showHidden':![],'depth':null}));}}_0x6a808d();});});}function checkTranscribe(){var _0x130324;var _0x4a445f;var _0x16c7f4;return db['VoiceRecording'][_0xaac4('0x3e')]({'where':{'transcribeStatus':'IN_PROGRESS'}})[_0xaac4('0x10')](function(_0x43ca24){if(!_0x43ca24||!_0x43ca24['length']){throw new db[(_0xaac4('0x21'))][(_0xaac4('0x22'))](_0xaac4('0x3f'));}_0x130324=_0x43ca24;return db['Setting']['findOne']({'where':{'id':0x1}});})[_0xaac4('0x10')](function(_0x2c1751){if(!_0x2c1751){throw new db[(_0xaac4('0x21'))][(_0xaac4('0x22'))](_0xaac4('0x40'));}_0x4a445f=_0x2c1751;if(!_0x4a445f[_0xaac4('0x41')]||!_0x4a445f['transcribeAccountId']||!_0x4a445f[_0xaac4('0xf')]||!_0x4a445f[_0xaac4('0x26')]||!_0x4a445f[_0xaac4('0x27')]){throw new db[(_0xaac4('0x21'))]['ValidationError'](_0xaac4('0x42'));}return db['CloudProvider'][_0xaac4('0x29')]({'where':{'id':_0x4a445f[_0xaac4('0x43')]}});})[_0xaac4('0x10')](function(_0x3922a0){if(!_0x3922a0){throw new db[(_0xaac4('0x21'))][(_0xaac4('0x22'))](_0xaac4('0x2a'));}if(!_0x3922a0[_0xaac4('0xd')]||!_0x3922a0[_0xaac4('0xe')]){throw new db[(_0xaac4('0x21'))][(_0xaac4('0x22'))](_0xaac4('0x2b'));}_0x16c7f4=_0x3922a0;var _0x3ce31f=[];_0x130324[_0xaac4('0x44')](function(_0x4ede1e){_0x3ce31f[_0xaac4('0x45')](checkTranscribeJob(_0x4ede1e,_0x4a445f,_0x16c7f4));});return BPromise[_0xaac4('0x46')](_0x3ce31f);})[_0xaac4('0x47')](function(_0x1e6e0e){if(_0x1e6e0e){if(!_0x1e6e0e[_0xaac4('0x3a')]||_0x1e6e0e[_0xaac4('0x3a')]!==_0xaac4('0x3b')){logger[_0xaac4('0x3c')](util['inspect'](_0x1e6e0e,{'showHidden':![],'depth':null}));}}});}exports[_0xaac4('0x48')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0x68b7=['../../config/logger','transcribe','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','info','format','transcribeName','data1','data2','transcribeRegion','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','Transcript','TranscriptFileUri','then','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','ValidationError','sentiment','sentimentRegion','language','bucket','Sequelize','Transcript\x20not\x20available','sentimentAccountId','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','update','Sentiment','SentimentScore','Positive','Mixed','Neutral','FAILED','FailureReason','Sentiment\x20Analysis\x20not\x20requested','Sentiment\x20Analysis\x20not\x20configured','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Negative','catch','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','transcribeAccountId','forEach','push','all','lodash','request-promise','util','bluebird'];(function(_0x4a96ca,_0x13754e){var _0x2aed48=function(_0x361330){while(--_0x361330){_0x4a96ca['push'](_0x4a96ca['shift']());}};_0x2aed48(++_0x13754e);}(_0x68b7,0x8c));var _0x768b=function(_0x277a88,_0xa478ed){_0x277a88=_0x277a88-0x0;var _0x334ad1=_0x68b7[_0x277a88];return _0x334ad1;};var _=require(_0x768b('0x0'));var AWS=require('aws-sdk');var rp=require(_0x768b('0x1'));var util=require(_0x768b('0x2'));var BPromise=require(_0x768b('0x3'));var db=require('../../mysqldb')['db'];var logger=require(_0x768b('0x4'))(_0x768b('0x5'));function getTranscriptionJob(_0xd48c9a,_0x569819,_0x1d3573,_0x1dc0e1){return new Promise(function(_0x18aaaa,_0x31aba4){var _0xba88ed=new AWS[(_0x768b('0x6'))]({'accessKeyId':_0x569819,'secretAccessKey':_0xd48c9a,'region':_0x1d3573});_0xba88ed[_0x768b('0x7')]({'TranscriptionJobName':_0x1dc0e1},function(_0x48405c,_0x441e3a){if(_0x48405c){return _0x31aba4(_0x48405c);}else{return _0x18aaaa(_0x441e3a);}});});}function sentiment(_0x47c2ea,_0x30fccf,_0x192508,_0x3ebfe5,_0x17f241){return new Promise(function(_0x40c6d3,_0x2d4edc){var _0x494750=new AWS[(_0x768b('0x8'))]({'accessKeyId':_0x30fccf,'secretAccessKey':_0x47c2ea,'region':_0x192508});_0x494750[_0x768b('0x9')]({'Text':_0x3ebfe5,'LanguageCode':_0x17f241['substring'](0x0,0x2)},function(_0x5b90ca,_0x46b23b){if(_0x5b90ca){return _0x2d4edc(_0x5b90ca);}else{return _0x40c6d3(_0x46b23b);}});});}function checkTranscribeJob(_0x1e26bd,_0x35689d,_0x9c3671){var _0x8fa3e6;return new BPromise(function(_0x2948b1,_0x9dae76){logger[_0x768b('0xa')](util[_0x768b('0xb')]('[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)',_0x1e26bd['id'],_0x1e26bd[_0x768b('0xc')]));return getTranscriptionJob(_0x9c3671[_0x768b('0xd')],_0x9c3671[_0x768b('0xe')],_0x35689d[_0x768b('0xf')],_0x1e26bd[_0x768b('0xc')])['then'](function(_0x17078f){logger[_0x768b('0xa')](util[_0x768b('0xb')](_0x768b('0x10'),_0x1e26bd['id'],_0x1e26bd[_0x768b('0xc')],_0x17078f[_0x768b('0x11')][_0x768b('0x12')]));if(!_0x1e26bd[_0x768b('0x13')]){switch(_0x17078f[_0x768b('0x11')][_0x768b('0x12')]){case _0x768b('0x14'):var _0x21aaa6={'transcribeStatus':_0x17078f['TranscriptionJob']['TranscriptionJobStatus'],'fileUri':_0x17078f[_0x768b('0x11')][_0x768b('0x15')]['TranscriptFileUri']};logger[_0x768b('0xa')](util[_0x768b('0xb')]('[RECORDING:%d]\x20Get\x20transcript',_0x1e26bd['id']));return rp({'uri':_0x17078f[_0x768b('0x11')][_0x768b('0x15')][_0x768b('0x16')],'json':!![]})[_0x768b('0x17')](function(_0xaa1538){logger['info'](util['format'](_0x768b('0x18'),_0x1e26bd['id']));if(_0xaa1538&&_0xaa1538[_0x768b('0x19')]&&_0xaa1538[_0x768b('0x19')][_0x768b('0x1a')]&&_0xaa1538[_0x768b('0x19')][_0x768b('0x1a')][_0x768b('0x1b')]){_0x21aaa6[_0x768b('0x13')]='';for(var _0x1a1733=0x0;_0x1a1733<_0xaa1538[_0x768b('0x19')][_0x768b('0x1a')][_0x768b('0x1b')];_0x1a1733++){_0x21aaa6[_0x768b('0x13')]+=_0xaa1538[_0x768b('0x19')]['transcripts'][_0x1a1733][_0x768b('0x1c')]+'';}}return _0x1e26bd['update'](_0x21aaa6);})['then'](function(){logger['info'](util['format'](_0x768b('0x1d'),_0x1e26bd['id']));if(!_0x1e26bd[_0x768b('0x1e')]){throw new db['Sequelize'][(_0x768b('0x1f'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x35689d[_0x768b('0x20')]||!_0x35689d['sentimentAccountId']||!_0x35689d[_0x768b('0x21')]||!_0x35689d[_0x768b('0x22')]||!_0x35689d[_0x768b('0x23')]){throw new db[(_0x768b('0x24'))]['ValidationError']('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x21aaa6['fileText']){throw new Error(_0x768b('0x25'));}if(_0x35689d[_0x768b('0x26')]===_0x9c3671['id']){return _0x9c3671;}else{return db[_0x768b('0x27')][_0x768b('0x28')]({'where':{'id':_settings['sentimentAccountId']}});}})[_0x768b('0x17')](function(_0x293ffd){if(!_0x293ffd){throw new db['Sequelize']['ValidationError'](_0x768b('0x29'));}if(!_0x293ffd[_0x768b('0xd')]||!_0x293ffd['data2']){throw new db[(_0x768b('0x24'))][(_0x768b('0x1f'))](_0x768b('0x2a'));}_0x8fa3e6=_0x293ffd;logger[_0x768b('0xa')](util[_0x768b('0xb')](_0x768b('0x2b'),_0x1e26bd['id']));return sentiment(_0x8fa3e6['data1'],_0x8fa3e6[_0x768b('0xe')],_0x35689d[_0x768b('0x21')],_0x21aaa6[_0x768b('0x13')],_0x35689d['language']);})[_0x768b('0x17')](function(_0x24383f){logger[_0x768b('0xa')](util['format']('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x1e26bd['id']));return _0x1e26bd[_0x768b('0x2c')]({'sentiment':_0x24383f[_0x768b('0x2d')],'sPositive':_0x24383f[_0x768b('0x2e')][_0x768b('0x2f')],'sNegative':_0x24383f[_0x768b('0x2e')]['Negative'],'sMixed':_0x24383f[_0x768b('0x2e')][_0x768b('0x30')],'sNeutral':_0x24383f[_0x768b('0x2e')][_0x768b('0x31')]});})[_0x768b('0x17')](function(){logger[_0x768b('0xa')](util[_0x768b('0xb')](_0x768b('0x1d'),_0x1e26bd['id']));_0x2948b1();});case _0x768b('0x32'):return _0x1e26bd['update']({'transcribeStatus':_0x768b('0x32'),'failureReason':_0x17078f[_0x768b('0x11')][_0x768b('0x33')]})[_0x768b('0x17')](function(){logger[_0x768b('0xa')](util['format'](_0x768b('0x1d'),_0x1e26bd['id']));_0x2948b1();});default:logger[_0x768b('0xa')](util['format']('[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed',_0x1e26bd['id']));break;}}else{return BPromise['resolve']()['then'](function(){if(!_0x1e26bd[_0x768b('0x1e')]){throw new db[(_0x768b('0x24'))][(_0x768b('0x1f'))](_0x768b('0x34'));}if(!_0x35689d[_0x768b('0x20')]||!_0x35689d['sentimentAccountId']||!_0x35689d[_0x768b('0x21')]||!_0x35689d['language']||!_0x35689d['bucket']){throw new db[(_0x768b('0x24'))][(_0x768b('0x1f'))](_0x768b('0x35'));}if(!_0x1e26bd[_0x768b('0x13')]){throw new Error(_0x768b('0x25'));}if(_0x35689d[_0x768b('0x26')]===_0x9c3671['id']){return _0x9c3671;}else{return db[_0x768b('0x27')][_0x768b('0x28')]({'where':{'id':_settings['sentimentAccountId']}});}})[_0x768b('0x17')](function(_0x3519da){if(!_0x3519da){throw new db[(_0x768b('0x24'))][(_0x768b('0x1f'))](_0x768b('0x29'));}if(!_0x3519da['data1']||!_0x3519da['data2']){throw new db['Sequelize'][(_0x768b('0x1f'))](_0x768b('0x2a'));}_0x8fa3e6=_0x3519da;logger[_0x768b('0xa')](util[_0x768b('0xb')](_0x768b('0x2b'),_0x1e26bd['id']));return sentiment(_0x8fa3e6[_0x768b('0xd')],_0x8fa3e6[_0x768b('0xe')],_0x35689d['sentimentRegion'],_0x1e26bd['fileText'],_0x35689d[_0x768b('0x22')]);})[_0x768b('0x17')](function(_0x2aff3d){logger[_0x768b('0xa')](util[_0x768b('0xb')](_0x768b('0x36'),_0x1e26bd['id']));return _0x1e26bd[_0x768b('0x2c')]({'sentiment':_0x2aff3d['Sentiment'],'sPositive':_0x2aff3d[_0x768b('0x2e')][_0x768b('0x2f')],'sNegative':_0x2aff3d[_0x768b('0x2e')][_0x768b('0x37')],'sMixed':_0x2aff3d[_0x768b('0x2e')][_0x768b('0x30')],'sNeutral':_0x2aff3d[_0x768b('0x2e')][_0x768b('0x31')],'transcribeStatus':_0x768b('0x14')});})[_0x768b('0x17')](function(){logger[_0x768b('0xa')](util[_0x768b('0xb')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x1e26bd['id']));_0x2948b1();});}})[_0x768b('0x38')](function(_0x1a2ad0){if(_0x1a2ad0){if(!_0x1a2ad0[_0x768b('0x39')]||_0x1a2ad0[_0x768b('0x39')]!==_0x768b('0x3a')){logger[_0x768b('0x3b')](util[_0x768b('0xb')](_0x768b('0x3c'),_0x1e26bd['id']),util[_0x768b('0x3d')](_0x1a2ad0,{'showHidden':![],'depth':null}));}}_0x2948b1();});});}function checkTranscribe(){var _0x2e4f69;var _0x27c62a;var _0x17fb3c;return db[_0x768b('0x3e')][_0x768b('0x3f')]({'where':{'transcribeStatus':_0x768b('0x40')}})[_0x768b('0x17')](function(_0x4a1407){if(!_0x4a1407||!_0x4a1407[_0x768b('0x1b')]){throw new db[(_0x768b('0x24'))][(_0x768b('0x1f'))](_0x768b('0x41'));}_0x2e4f69=_0x4a1407;return db[_0x768b('0x42')][_0x768b('0x28')]({'where':{'id':0x1}});})[_0x768b('0x17')](function(_0x4ef9ce){if(!_0x4ef9ce){throw new db[(_0x768b('0x24'))]['ValidationError'](_0x768b('0x43'));}_0x27c62a=_0x4ef9ce;if(!_0x27c62a[_0x768b('0x5')]||!_0x27c62a['transcribeAccountId']||!_0x27c62a[_0x768b('0xf')]||!_0x27c62a[_0x768b('0x22')]||!_0x27c62a[_0x768b('0x23')]){throw new db['Sequelize'][(_0x768b('0x1f'))]('Transcribe\x20not\x20configured');}return db['CloudProvider']['findOne']({'where':{'id':_0x27c62a[_0x768b('0x44')]}});})['then'](function(_0x3e4f3c){if(!_0x3e4f3c){throw new db['Sequelize'][(_0x768b('0x1f'))](_0x768b('0x29'));}if(!_0x3e4f3c['data1']||!_0x3e4f3c[_0x768b('0xe')]){throw new db[(_0x768b('0x24'))][(_0x768b('0x1f'))]('Cloud\x20Provider\x20not\x20configured');}_0x17fb3c=_0x3e4f3c;var _0x620c2f=[];_0x2e4f69[_0x768b('0x45')](function(_0x1fba37){_0x620c2f[_0x768b('0x46')](checkTranscribeJob(_0x1fba37,_0x27c62a,_0x17fb3c));});return BPromise[_0x768b('0x47')](_0x620c2f);})[_0x768b('0x38')](function(_0x52d061){if(_0x52d061){if(!_0x52d061[_0x768b('0x39')]||_0x52d061[_0x768b('0x39')]!==_0x768b('0x3a')){logger[_0x768b('0x3b')](util[_0x768b('0x3d')](_0x52d061,{'showHidden':![],'depth':null}));}}});}exports['start']=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file diff --git a/server/config/schedule/whatsapp.js b/server/config/schedule/whatsapp.js index 8d3c306..2be7c0b 100644 --- a/server/config/schedule/whatsapp.js +++ b/server/config/schedule/whatsapp.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa091=['lastMsgAt','hours','map','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','system','YYYY-MM-DD\x20HH:mm:ss','then','length','emit','whatsappInteraction:update','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','lodash','moment','ioredis','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','localhost','socket.io-emitter','WhatsappInteraction'];(function(_0x11ca60,_0x3c002b){var _0x5d6d30=function(_0x52149d){while(--_0x52149d){_0x11ca60['push'](_0x11ca60['shift']());}};_0x5d6d30(++_0x3c002b);}(_0xa091,0xf0));var _0x1a09=function(_0x2ded02,_0x12502a){_0x2ded02=_0x2ded02-0x0;var _0x3662b6=_0xa091[_0x2ded02];return _0x3662b6;};'use strict';var _=require(_0x1a09('0x0'));var moment=require(_0x1a09('0x1'));var Redis=require(_0x1a09('0x2'));var util=require('util');var config=require(_0x1a09('0x3'));var db=require(_0x1a09('0x4'))['db'];var logger=require(_0x1a09('0x5'))(_0x1a09('0x6'));config[_0x1a09('0x7')]=_[_0x1a09('0x8')](config[_0x1a09('0x7')],{'host':_0x1a09('0x9'),'port':0x18eb});var io=require(_0x1a09('0xa'))(new Redis(config['redis']));function closeInteractions(){var _0x163e60=[];return db[_0x1a09('0xb')]['findAll']({'raw':!![],'attributes':['id',_0x1a09('0xc')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()['subtract'](0x18,_0x1a09('0xd'))}}})['then'](function(_0x1d2641){if(_0x1d2641&&_0x1d2641['length']){_0x163e60=_[_0x1a09('0xe')](_0x1d2641||[],'id');logger['info'](_0x1a09('0xf'),_0x163e60[_0x1a09('0x10')]());return db['WhatsappInteraction'][_0x1a09('0x11')]({'closeReason':_0x1a09('0x12'),'disposition':'timeout','closed':!![],'closedAt':moment()['format'](_0x1a09('0x13'))},{'where':{'id':_0x163e60}});}})[_0x1a09('0x14')](function(){if(_0x163e60&&_0x163e60[_0x1a09('0x15')]){logger['info']('[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:',_0x163e60[_0x1a09('0x10')]());for(var _0x85a0a0=0x0;_0x85a0a0<_0x163e60['length'];_0x85a0a0++){io[_0x1a09('0x16')](_0x1a09('0x17'),{'id':_0x163e60[_0x85a0a0],'closed':!![]});}}})[_0x1a09('0x18')](function(_0x466ae5){logger[_0x1a09('0x19')](_0x1a09('0x1a'),_0x466ae5?util[_0x1a09('0x1b')](_0x466ae5,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xbb29=['../../config/environment','../logger','schedule','redis','defaults','localhost','socket.io-emitter','findAll','lastMsgAt','subtract','hours','then','length','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','WhatsappInteraction','update','timeout','format','YYYY-MM-DD\x20HH:mm:ss','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','whatsappInteraction:update','catch','[WHATSAPP]\x20Error\x20closing\x20interactions','start','lodash','moment','ioredis','util'];(function(_0x280820,_0xce9bc7){var _0x474787=function(_0x3d224e){while(--_0x3d224e){_0x280820['push'](_0x280820['shift']());}};_0x474787(++_0xce9bc7);}(_0xbb29,0x78));var _0x9bb2=function(_0x530376,_0x5a6e7d){_0x530376=_0x530376-0x0;var _0x30ee50=_0xbb29[_0x530376];return _0x30ee50;};'use strict';var _=require(_0x9bb2('0x0'));var moment=require(_0x9bb2('0x1'));var Redis=require(_0x9bb2('0x2'));var util=require(_0x9bb2('0x3'));var config=require(_0x9bb2('0x4'));var db=require('../../mysqldb')['db'];var logger=require(_0x9bb2('0x5'))(_0x9bb2('0x6'));config[_0x9bb2('0x7')]=_[_0x9bb2('0x8')](config[_0x9bb2('0x7')],{'host':_0x9bb2('0x9'),'port':0x18eb});var io=require(_0x9bb2('0xa'))(new Redis(config[_0x9bb2('0x7')]));function closeInteractions(){var _0x577d3d=[];return db['WhatsappInteraction'][_0x9bb2('0xb')]({'raw':!![],'attributes':['id',_0x9bb2('0xc')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x9bb2('0xd')](0x18,_0x9bb2('0xe'))}}})[_0x9bb2('0xf')](function(_0x37a8d5){if(_0x37a8d5&&_0x37a8d5[_0x9bb2('0x10')]){_0x577d3d=_[_0x9bb2('0x11')](_0x37a8d5||[],'id');logger[_0x9bb2('0x12')](_0x9bb2('0x13'),_0x577d3d[_0x9bb2('0x14')]());return db[_0x9bb2('0x15')][_0x9bb2('0x16')]({'closeReason':'system','disposition':_0x9bb2('0x17'),'closed':!![],'closedAt':moment()[_0x9bb2('0x18')](_0x9bb2('0x19'))},{'where':{'id':_0x577d3d}});}})[_0x9bb2('0xf')](function(){if(_0x577d3d&&_0x577d3d[_0x9bb2('0x10')]){logger['info'](_0x9bb2('0x1a'),_0x577d3d[_0x9bb2('0x14')]());for(var _0x4e75ac=0x0;_0x4e75ac<_0x577d3d[_0x9bb2('0x10')];_0x4e75ac++){io['emit'](_0x9bb2('0x1b'),{'id':_0x577d3d[_0x4e75ac],'closed':!![]});}}})[_0x9bb2('0x1c')](function(_0x4a0929){logger['error'](_0x9bb2('0x1d'),_0x4a0929?util['inspect'](_0x4a0929,{'showHidden':![],'depth':null}):'');});}exports[_0x9bb2('0x1e')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/seedContact.js b/server/config/seedContact.js index 120ccbc..94e6f40 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0a44=['now','Biondo','@xcally.com','CmContact','destroy','then','log','finished\x20populating','contacts1','CmHopper','bulkCreate','hopper1','contacts2','hopper2','catch','util','../mysqldb','push','Innocenzo','innocenzo.biondo'];(function(_0x2fd9a6,_0xf08237){var _0x374a41=function(_0x2d78ce){while(--_0x2d78ce){_0x2fd9a6['push'](_0x2fd9a6['shift']());}};_0x374a41(++_0xf08237);}(_0x0a44,0x1db));var _0x40a4=function(_0x2541d4,_0x4c7435){_0x2541d4=_0x2541d4-0x0;var _0x28c90e=_0x0a44[_0x2541d4];return _0x28c90e;};'use strict';var util=require(_0x40a4('0x0'));var db=require(_0x40a4('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x40a4('0x2')]({'id':i,'firstName':_0x40a4('0x3')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0x40a4('0x4')+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x40a4('0x2')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x40a4('0x5')](),'updatedAt':Date[_0x40a4('0x5')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':_0x40a4('0x3')+i,'lastName':_0x40a4('0x6')+i,'phone':0xf879fb460+i,'email':_0x40a4('0x4')+i+_0x40a4('0x7')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2['push']({'id':i,'active':![],'scheduledat':Date[_0x40a4('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0x40a4('0x5')]()});}db[_0x40a4('0x8')][_0x40a4('0x9')]({'where':{}})[_0x40a4('0xa')](function(){return db[_0x40a4('0x8')]['bulkCreate'](contacts);})['then'](function(){console[_0x40a4('0xb')](_0x40a4('0xc'),_0x40a4('0xd'));return db[_0x40a4('0xe')]['destroy']({'where':{}});})[_0x40a4('0xa')](function(){return db[_0x40a4('0xe')][_0x40a4('0xf')](hopper);})[_0x40a4('0xa')](function(){console['log'](_0x40a4('0xc'),_0x40a4('0x10'));return db[_0x40a4('0x8')][_0x40a4('0xf')](contacts2);})[_0x40a4('0xa')](function(){console['log']('finished\x20populating',_0x40a4('0x11'));return db[_0x40a4('0xe')][_0x40a4('0xf')](hopper2);})[_0x40a4('0xa')](function(){console['log']('finished\x20populating',_0x40a4('0x12'));})[_0x40a4('0x13')](function(_0x282dd7){console[_0x40a4('0xb')](_0x282dd7);}); \ No newline at end of file +var _0x9bb3=['destroy','then','bulkCreate','log','contacts1','CmHopper','finished\x20populating','hopper1','hopper2','catch','util','push','Innocenzo','Biondo','@xcally.com','now','CmContact'];(function(_0x1cddd4,_0x4a2f08){var _0x5d7bce=function(_0x9c71c0){while(--_0x9c71c0){_0x1cddd4['push'](_0x1cddd4['shift']());}};_0x5d7bce(++_0x4a2f08);}(_0x9bb3,0x14d));var _0x39bb=function(_0x4423d7,_0x367621){_0x4423d7=_0x4423d7-0x0;var _0x1ecad3=_0x9bb3[_0x4423d7];return _0x1ecad3;};'use strict';var util=require(_0x39bb('0x0'));var db=require('../mysqldb')['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x39bb('0x1')]({'id':i,'firstName':_0x39bb('0x2')+i,'lastName':_0x39bb('0x3')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0x39bb('0x4')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x39bb('0x1')]({'id':i,'active':![],'scheduledat':Date[_0x39bb('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x39bb('0x5')](),'updatedAt':Date[_0x39bb('0x5')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x39bb('0x1')]({'id':i,'firstName':_0x39bb('0x2')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0x39bb('0x4')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x39bb('0x1')]({'id':i,'active':![],'scheduledat':Date[_0x39bb('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0x39bb('0x5')]()});}db[_0x39bb('0x6')][_0x39bb('0x7')]({'where':{}})[_0x39bb('0x8')](function(){return db['CmContact'][_0x39bb('0x9')](contacts);})['then'](function(){console[_0x39bb('0xa')]('finished\x20populating',_0x39bb('0xb'));return db['CmHopper'][_0x39bb('0x7')]({'where':{}});})[_0x39bb('0x8')](function(){return db[_0x39bb('0xc')]['bulkCreate'](hopper);})[_0x39bb('0x8')](function(){console[_0x39bb('0xa')](_0x39bb('0xd'),_0x39bb('0xe'));return db[_0x39bb('0x6')]['bulkCreate'](contacts2);})['then'](function(){console[_0x39bb('0xa')](_0x39bb('0xd'),'contacts2');return db[_0x39bb('0xc')][_0x39bb('0x9')](hopper2);})[_0x39bb('0x8')](function(){console['log']('finished\x20populating',_0x39bb('0xf'));})[_0x39bb('0x10')](function(_0x5b7950){console[_0x39bb('0xa')](_0x5b7950);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 8420796..f0859f2 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfc39=['all','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','\x22%s\x22\x20<%s>','User','then','log','catch','util','../mysqldb','format','%s%s','agent','%s%s@xcally.com','udp','wss'];(function(_0x2c4f40,_0x4af6ca){var _0x149819=function(_0x276412){while(--_0x276412){_0x2c4f40['push'](_0x2c4f40['shift']());}};_0x149819(++_0x4af6ca);}(_0xfc39,0x184));var _0x9fc3=function(_0x20366a,_0x23becf){_0x20366a=_0x20366a-0x0;var _0x5e1abe=_0xfc39[_0x20366a];return _0x5e1abe;};'use strict';var util=require(_0x9fc3('0x0'));var db=require(_0x9fc3('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users['push']({'name':util[_0x9fc3('0x2')](_0x9fc3('0x3'),_0x9fc3('0x4'),i),'fullname':util[_0x9fc3('0x2')](_0x9fc3('0x3'),_0x9fc3('0x4'),i),'email':util[_0x9fc3('0x2')](_0x9fc3('0x5'),'agent',i),'role':_0x9fc3('0x4'),'password':'password','internal':0xfa0+i,'type':'friend','transport':[_0x9fc3('0x6'),'ws',_0x9fc3('0x7')],'disallow':[_0x9fc3('0x8')],'allow':[_0x9fc3('0x9')],'defaultuser':util['format']('%s%s','agent',i),'encryption':_0x9fc3('0xa'),'avpf':'yes','force_avp':_0x9fc3('0xa'),'icesupport':'yes','dtlsenable':'yes','dtlsverify':'no','dtlscertfile':_0x9fc3('0xb'),'dtlsprivatekey':_0x9fc3('0xc'),'dtlssetup':'actpass','callerid':util['format'](_0x9fc3('0xd'),util[_0x9fc3('0x2')](_0x9fc3('0x3'),'agent',i),0xfa0+i)});}db[_0x9fc3('0xe')]['bulkCreate'](users)[_0x9fc3('0xf')](function(){console[_0x9fc3('0x10')]('add\x20user');})[_0x9fc3('0x11')](function(_0x4cdd96){console[_0x9fc3('0x10')](_0x4cdd96);}); \ No newline at end of file +var _0xf2bb=['User','bulkCreate','log','add\x20user','catch','util','../mysqldb','push','format','%s%s','agent','%s%s@xcally.com','friend','udp','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass'];(function(_0x10eb69,_0xd421ab){var _0xf6d50d=function(_0x5c76db){while(--_0x5c76db){_0x10eb69['push'](_0x10eb69['shift']());}};_0xf6d50d(++_0xd421ab);}(_0xf2bb,0x1d1));var _0xbf2b=function(_0x2283dc,_0x2fcfc5){_0x2283dc=_0x2283dc-0x0;var _0x16db90=_0xf2bb[_0x2283dc];return _0x16db90;};'use strict';var util=require(_0xbf2b('0x0'));var db=require(_0xbf2b('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xbf2b('0x2')]({'name':util[_0xbf2b('0x3')](_0xbf2b('0x4'),_0xbf2b('0x5'),i),'fullname':util[_0xbf2b('0x3')]('%s%s',_0xbf2b('0x5'),i),'email':util[_0xbf2b('0x3')](_0xbf2b('0x6'),_0xbf2b('0x5'),i),'role':_0xbf2b('0x5'),'password':'password','internal':0xfa0+i,'type':_0xbf2b('0x7'),'transport':[_0xbf2b('0x8'),'ws','wss'],'disallow':[_0xbf2b('0x9')],'allow':[_0xbf2b('0xa')],'defaultuser':util['format'](_0xbf2b('0x4'),'agent',i),'encryption':_0xbf2b('0xb'),'avpf':_0xbf2b('0xb'),'force_avp':_0xbf2b('0xb'),'icesupport':_0xbf2b('0xb'),'dtlsenable':_0xbf2b('0xb'),'dtlsverify':'no','dtlscertfile':_0xbf2b('0xc'),'dtlsprivatekey':_0xbf2b('0xd'),'dtlssetup':_0xbf2b('0xe'),'callerid':util[_0xbf2b('0x3')]('\x22%s\x22\x20<%s>',util['format'](_0xbf2b('0x4'),_0xbf2b('0x5'),i),0xfa0+i)});}db[_0xbf2b('0xf')][_0xbf2b('0x10')](users)['then'](function(){console[_0xbf2b('0x11')](_0xbf2b('0x12'));})[_0xbf2b('0x13')](function(_0x11d1e7){console[_0xbf2b('0x11')](_0x11d1e7);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 1c3fde9..d828879 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbedb=['setMaxListeners','request','remoteAddress','remotePort','connectedAt','address','disconnect','DISCONNECTED','lodash','bluebird','../mysqldb','./environment','User','name','role','agent','telephone','ivr','UserProfileSection','findOne','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','MailQueues','WhatsappQueues','Telephones','findAll','Trunks','IvrCampaigns','UserProfileResource','resourceId','then','where','type','format','%s:queue:%s','Agents','length','user:%s','handshake','query','find','userProfileId','ChatInteractions','MailInteractions','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','WhatsappInteraction','WhatsappInteractions','voice:inbound','voice:outbound','push','FaxQueue','MailQueue','OpenchannelQueue','WhatsappQueue','Trunk','Campaign','user','VoiceQueue','ChatQueue','SmsQueue','OpenchannelQueues','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','voice','fax','sms','mail','whatsapp','telephone:%s','trunk:%s','campaign:%s:%s','leave','map','emit','user_has_chat_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','join','connection'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0xbedb,0x12e));var _0xbbed=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbedb[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xbbed('0x0'));var util=require('util');var BPromise=require(_0xbbed('0x1'));var db=require(_0xbbed('0x2'))['db'];var config=require(_0xbbed('0x3'));var queryQueues={'attributes':['id','name'],'include':[{'as':'Agents','model':db[_0xbbed('0x4')],'attributes':['id',_0xbbed('0x5'),_0xbbed('0x6')],'raw':!![],'where':{'role':_0xbbed('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0xbbed('0x5')],'where':{'role':_0xbbed('0x8')}};var queryTrunks={'raw':!![],'attributes':['id',_0xbbed('0x5')]};var queryAgents={'raw':!![],'attributes':['id',_0xbbed('0x5')],'where':{'role':_0xbbed('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id',_0xbbed('0x5'),'type'],'where':{'type':_0xbbed('0x9')}};function getAssociatedResources(_0x4b2cea,_0x5e949e,_0x3f5d87){return db[_0xbbed('0xa')][_0xbbed('0xb')]({'where':{'name':_0x4b2cea,'userProfileId':_0x5e949e},'raw':!![]})['then'](function(_0x4a67ca){if(_0x4a67ca){if(_0x4a67ca[_0xbbed('0xc')]){switch(_0x4b2cea){case _0xbbed('0xd'):case _0xbbed('0xe'):case _0xbbed('0xf'):case _0xbbed('0x10'):case _0xbbed('0x11'):case'OpenchannelQueues':case _0xbbed('0x12'):return db[_0x3f5d87]['findAll'](queryQueues);case _0xbbed('0x13'):return db[_0x3f5d87][_0xbbed('0x14')](queryTelephones);case _0xbbed('0x15'):return db[_0x3f5d87][_0xbbed('0x14')](queryTrunks);case _0xbbed('0x16'):return db[_0x3f5d87][_0xbbed('0x14')](queryCampaigns);}}else{return db[_0xbbed('0x17')][_0xbbed('0x14')]({'attributes':[_0xbbed('0x18')],'where':{'sectionId':_0x4a67ca['id']},'raw':!![]})[_0xbbed('0x19')](function(_0x5eb641){if(_0x5eb641){var _0x359469={'where':{'id':_['map'](_0x5eb641,_0xbbed('0x18'))},'raw':!![]};switch(_0x3f5d87){case _0xbbed('0x4'):_0x359469[_0xbbed('0x1a')][_0xbbed('0x6')]=_0xbbed('0x8');break;case'Campaign':_0x359469[_0xbbed('0x1a')][_0xbbed('0x1b')]=_0xbbed('0x9');break;}return db[_0x3f5d87][_0xbbed('0x14')](_0x359469);}else{return[];}});}}else{return[];}})[_0xbbed('0x19')](function(_0x218812){return _0x218812;});}function joinOrLeaveQueues(_0x31eea9,_0x431be1,_0x174068,_0x23549d){_0x31eea9[_0x431be1](util[_0xbbed('0x1c')](_0xbbed('0x1d'),_0x174068,_0x23549d[_0xbbed('0x5')]));if(_0x23549d['Agents']){for(var _0x2b4ad0=0x0;_0x2b4ad0<_0x23549d[_0xbbed('0x1e')][_0xbbed('0x1f')];_0x2b4ad0+=0x1){_0x31eea9[_0x431be1](util['format'](_0xbbed('0x20'),_0x23549d[_0xbbed('0x1e')][_0x2b4ad0][_0xbbed('0x5')]));}}}function joinOrLeave(_0x474ad7,_0x4ebc1e,_0x13c422){var _0x479c81;if(_0x474ad7[_0xbbed('0x21')][_0xbbed('0x22')]['id']){db['User'][_0xbbed('0x23')]({'attributes':['id',_0xbbed('0x5'),_0xbbed('0x6'),_0xbbed('0x24')],'where':{'id':_0x474ad7[_0xbbed('0x21')][_0xbbed('0x22')]['id']},'include':[{'model':db['ChatInteraction'],'as':_0xbbed('0x25'),'attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':_0xbbed('0x26'),'attributes':['id'],'raw':!![]},{'model':db['FaxInteraction'],'as':_0xbbed('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0xbbed('0x28')],'as':_0xbbed('0x29'),'attributes':['id'],'raw':!![]},{'model':db[_0xbbed('0x2a')],'as':'OpenchannelInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xbbed('0x2b')],'as':_0xbbed('0x2c'),'attributes':['id'],'raw':!![]}]})[_0xbbed('0x19')](function(_0x446c21){if(_0x446c21){_0x479c81=_0x446c21;_0x474ad7[_0x4ebc1e](util['format'](_0xbbed('0x20'),_0x446c21['name']));var _0x285912=[];switch(_0x446c21[_0xbbed('0x6')]){case'admin':_0x474ad7[_0x4ebc1e](_0xbbed('0x2d'));_0x474ad7[_0x4ebc1e](_0xbbed('0x2e'));if(queryQueues['hasOwnProperty']('include')){delete queryQueues['include'];}_0x285912['push'](db['VoiceQueue'][_0xbbed('0x14')](queryQueues));_0x285912[_0xbbed('0x2f')](db['ChatQueue']['findAll'](queryQueues));_0x285912[_0xbbed('0x2f')](db[_0xbbed('0x30')]['findAll'](queryQueues));_0x285912[_0xbbed('0x2f')](db['SmsQueue'][_0xbbed('0x14')](queryQueues));_0x285912[_0xbbed('0x2f')](db[_0xbbed('0x31')]['findAll'](queryQueues));_0x285912[_0xbbed('0x2f')](db[_0xbbed('0x32')][_0xbbed('0x14')](queryQueues));_0x285912[_0xbbed('0x2f')](db[_0xbbed('0x33')][_0xbbed('0x14')](queryQueues));_0x285912['push'](db[_0xbbed('0x4')]['findAll'](queryTelephones));_0x285912['push'](db[_0xbbed('0x34')]['findAll'](queryTrunks));_0x285912[_0xbbed('0x2f')](db[_0xbbed('0x35')][_0xbbed('0x14')](queryCampaigns));_0x285912[_0xbbed('0x2f')](db['User'][_0xbbed('0x14')](queryAgents));break;case _0xbbed('0x36'):_0x474ad7[_0x4ebc1e]('voice:inbound');_0x474ad7[_0x4ebc1e]('voice:outbound');_0x285912['push'](getAssociatedResources(_0xbbed('0xd'),_0x446c21[_0xbbed('0x24')],_0xbbed('0x37')));_0x285912[_0xbbed('0x2f')](getAssociatedResources(_0xbbed('0xe'),_0x446c21[_0xbbed('0x24')],_0xbbed('0x38')));_0x285912['push'](getAssociatedResources(_0xbbed('0xf'),_0x446c21[_0xbbed('0x24')],_0xbbed('0x30')));_0x285912[_0xbbed('0x2f')](getAssociatedResources(_0xbbed('0x10'),_0x446c21['userProfileId'],_0xbbed('0x39')));_0x285912[_0xbbed('0x2f')](getAssociatedResources('MailQueues',_0x446c21[_0xbbed('0x24')],_0xbbed('0x31')));_0x285912[_0xbbed('0x2f')](getAssociatedResources(_0xbbed('0x3a'),_0x446c21[_0xbbed('0x24')],_0xbbed('0x32')));_0x285912['push'](getAssociatedResources('WhatsappQueues',_0x446c21[_0xbbed('0x24')],'WhatsappQueue'));_0x285912[_0xbbed('0x2f')](getAssociatedResources('Telephones',_0x446c21[_0xbbed('0x24')],_0xbbed('0x4')));_0x285912[_0xbbed('0x2f')](getAssociatedResources(_0xbbed('0x15'),_0x446c21[_0xbbed('0x24')],_0xbbed('0x34')));_0x285912['push'](getAssociatedResources(_0xbbed('0x16'),_0x446c21['userProfileId'],_0xbbed('0x35')));_0x285912[_0xbbed('0x2f')](db[_0xbbed('0x4')]['findAll'](queryAgents));break;case _0xbbed('0x7'):_0x474ad7[_0x4ebc1e]('voice:inbound');_0x474ad7[_0x4ebc1e]('voice:outbound');_0x285912[_0xbbed('0x2f')](_0x446c21['getVoiceQueues']({'attributes':['id','name']}));_0x285912[_0xbbed('0x2f')](_0x446c21[_0xbbed('0x3b')]({'attributes':['id',_0xbbed('0x5')]}));_0x285912['push'](_0x446c21[_0xbbed('0x3c')]({'attributes':['id',_0xbbed('0x5')]}));_0x285912['push'](_0x446c21[_0xbbed('0x3d')]({'attributes':['id',_0xbbed('0x5')]}));_0x285912[_0xbbed('0x2f')](_0x446c21[_0xbbed('0x3e')]({'attributes':['id',_0xbbed('0x5')]}));_0x285912[_0xbbed('0x2f')](_0x446c21[_0xbbed('0x3f')]({'attributes':['id','name']}));_0x285912[_0xbbed('0x2f')](_0x446c21[_0xbbed('0x40')]({'attributes':['id',_0xbbed('0x5')]}));break;}return BPromise[_0xbbed('0x41')](_0x285912);}})[_0xbbed('0x19')](function(_0x286889){if(_0x286889&&_0x286889['length']){for(var _0x131e5b=0x0;_0x131e5b<_0x286889['length'];_0x131e5b+=0x1){for(var _0x486702=0x0;_0x486702<_0x286889[_0x131e5b][_0xbbed('0x1f')];_0x486702+=0x1){switch(_0x131e5b){case 0x0:joinOrLeaveQueues(_0x474ad7,_0x4ebc1e,_0xbbed('0x42'),_0x286889[_0x131e5b][_0x486702]);break;case 0x1:joinOrLeaveQueues(_0x474ad7,_0x4ebc1e,'chat',_0x286889[_0x131e5b][_0x486702]);break;case 0x2:joinOrLeaveQueues(_0x474ad7,_0x4ebc1e,_0xbbed('0x43'),_0x286889[_0x131e5b][_0x486702]);break;case 0x3:joinOrLeaveQueues(_0x474ad7,_0x4ebc1e,_0xbbed('0x44'),_0x286889[_0x131e5b][_0x486702]);break;case 0x4:joinOrLeaveQueues(_0x474ad7,_0x4ebc1e,_0xbbed('0x45'),_0x286889[_0x131e5b][_0x486702]);break;case 0x5:joinOrLeaveQueues(_0x474ad7,_0x4ebc1e,'openchannel',_0x286889[_0x131e5b][_0x486702]);break;case 0x6:joinOrLeaveQueues(_0x474ad7,_0x4ebc1e,_0xbbed('0x46'),_0x286889[_0x131e5b][_0x486702]);break;case 0x7:if(_0x479c81[_0xbbed('0x6')]!=='agent')_0x474ad7[_0x4ebc1e](util[_0xbbed('0x1c')](_0xbbed('0x47'),_0x286889[_0x131e5b][_0x486702][_0xbbed('0x5')]));break;case 0x8:if(_0x479c81[_0xbbed('0x6')]!==_0xbbed('0x7'))_0x474ad7[_0x4ebc1e](util[_0xbbed('0x1c')](_0xbbed('0x48'),_0x286889[_0x131e5b][_0x486702][_0xbbed('0x5')]));break;case 0x9:if(_0x479c81[_0xbbed('0x6')]!==_0xbbed('0x7'))_0x474ad7[_0x4ebc1e](util[_0xbbed('0x1c')](_0xbbed('0x49'),_0x286889[_0x131e5b][_0x486702][_0xbbed('0x1b')],_0x286889[_0x131e5b][_0x486702][_0xbbed('0x5')]));break;case 0xa:_0x474ad7[_0x4ebc1e](util[_0xbbed('0x1c')](_0xbbed('0x20'),_0x286889[_0x131e5b][_0x486702][_0xbbed('0x5')]));break;}}}}})[_0xbbed('0x19')](function(){if(_0x4ebc1e===_0xbbed('0x4a')){var _0x5ea984=_[_0xbbed('0x4b')](_0x479c81['ChatInteractions'],'id');return _0x479c81['removeChatInteractions'](_0x5ea984)['then'](function(){for(var _0x15d470=0x0;_0x15d470<_0x5ea984['length'];_0x15d470+=0x1){_0x13c422[_0xbbed('0x4c')](_0xbbed('0x4d'),{'ChatInteractionId':Number(_0x5ea984[_0x15d470]),'UserId':Number(_0x479c81['id'])});}});}})[_0xbbed('0x19')](function(){if(_0x4ebc1e===_0xbbed('0x4a')){var _0x313b48=_['map'](_0x479c81[_0xbbed('0x26')],'id');return _0x479c81['removeMailInteractions'](_0x313b48)[_0xbbed('0x19')](function(){for(var _0x205ec4=0x0;_0x205ec4<_0x313b48[_0xbbed('0x1f')];_0x205ec4+=0x1){_0x13c422['emit']('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x313b48[_0x205ec4]),'UserId':Number(_0x479c81['id'])});}});}})['then'](function(){if(_0x4ebc1e===_0xbbed('0x4a')){var _0x38126b=_[_0xbbed('0x4b')](_0x479c81[_0xbbed('0x27')],'id');return _0x479c81[_0xbbed('0x4e')](_0x38126b)[_0xbbed('0x19')](function(){for(var _0x187897=0x0;_0x187897<_0x38126b[_0xbbed('0x1f')];_0x187897+=0x1){_0x13c422[_0xbbed('0x4c')](_0xbbed('0x4f'),{'FaxInteractionId':Number(_0x38126b[_0x187897]),'UserId':Number(_0x479c81['id'])});}});}})[_0xbbed('0x19')](function(){if(_0x4ebc1e==='leave'){var _0x440eb3=_[_0xbbed('0x4b')](_0x479c81[_0xbbed('0x29')],'id');return _0x479c81[_0xbbed('0x50')](_0x440eb3)[_0xbbed('0x19')](function(){for(var _0x301d6c=0x0;_0x301d6c<_0x440eb3['length'];_0x301d6c+=0x1){_0x13c422['emit'](_0xbbed('0x51'),{'SmsInteractionId':Number(_0x440eb3[_0x301d6c]),'UserId':Number(_0x479c81['id'])});}});}})[_0xbbed('0x19')](function(){if(_0x4ebc1e==='leave'){var _0x3ae974=_[_0xbbed('0x4b')](_0x479c81['OpenchannelInteractions'],'id');return _0x479c81[_0xbbed('0x52')](_0x3ae974)[_0xbbed('0x19')](function(){for(var _0x4a1150=0x0;_0x4a1150<_0x3ae974[_0xbbed('0x1f')];_0x4a1150+=0x1){_0x13c422[_0xbbed('0x4c')](_0xbbed('0x53'),{'OpenchannelInteractionId':Number(_0x3ae974[_0x4a1150]),'UserId':Number(_0x479c81['id'])});}});}})[_0xbbed('0x19')](function(){if(_0x4ebc1e==='leave'){var _0x19abbb=_[_0xbbed('0x4b')](_0x479c81[_0xbbed('0x2c')],'id');return _0x479c81[_0xbbed('0x54')](_0x19abbb)[_0xbbed('0x19')](function(){for(var _0x4e7d82=0x0;_0x4e7d82<_0x19abbb['length'];_0x4e7d82+=0x1){_0x13c422['emit'](_0xbbed('0x55'),{'WhatsappInteractionId':Number(_0x19abbb[_0x4e7d82]),'UserId':Number(_0x479c81['id'])});}});}})[_0xbbed('0x56')](function(_0x443bf){_0x474ad7[_0xbbed('0x57')](_0x443bf);});}}function onDisconnect(_0x15fe7b,_0x1775b5){joinOrLeave(_0x15fe7b,_0xbbed('0x4a'),_0x1775b5);}function onConnect(_0x1eed39){joinOrLeave(_0x1eed39,_0xbbed('0x58'));}exports['default']=function(_0x307cb0){_0x307cb0['on'](_0xbbed('0x59'),function(_0x3d9d4a){_0x3d9d4a[_0xbbed('0x5a')](0x0);_0x3d9d4a['address']=_0x3d9d4a[_0xbbed('0x5b')][_0xbbed('0x59')][_0xbbed('0x5c')]+':'+_0x3d9d4a[_0xbbed('0x5b')][_0xbbed('0x59')][_0xbbed('0x5d')];_0x3d9d4a[_0xbbed('0x5e')]=new Date();_0x3d9d4a['log']=function(_0x11d8fc){console[_0xbbed('0x57')]('SocketIO\x20'+_0x3d9d4a['nsp'][_0xbbed('0x5')]+'['+_0x3d9d4a[_0xbbed('0x5f')]+']',_0x11d8fc);};_0x3d9d4a['on'](_0xbbed('0x60'),function(){onDisconnect(_0x3d9d4a,_0x307cb0);_0x3d9d4a[_0xbbed('0x57')](_0xbbed('0x61'));});onConnect(_0x3d9d4a);_0x3d9d4a['log']('CONNECTED');});}; \ No newline at end of file +var _0xd69e=['ChatInteraction','ChatInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','admin','voice:inbound','voice:outbound','hasOwnProperty','include','VoiceQueue','push','ChatQueue','FaxQueue','SmsQueue','MailQueue','WhatsappQueue','VoiceQueues','OpenchannelQueues','OpenchannelQueue','Trunk','getChatQueues','getFaxQueues','getMailQueues','getOpenchannelQueues','voice','fax','sms','mail','whatsapp','telephone:%s','trunk:%s','leave','emit','MailInteractions','removeMailInteractions','user_has_mail_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','join','default','connection','setMaxListeners','address','request','remotePort','connectedAt','SocketIO\x20','nsp','disconnect','DISCONNECTED','CONNECTED','lodash','util','bluebird','./environment','name','agent','ivr','findOne','then','autoAssociation','ChatQueues','FaxQueues','MailQueues','WhatsappQueues','findAll','Telephones','IvrCampaigns','UserProfileResource','map','resourceId','User','where','role','telephone','Campaign','format','%s:queue:%s','Agents','length','user:%s','handshake','query','find','userProfileId'];(function(_0x5c3d9b,_0x1dd32e){var _0x3d3d5d=function(_0x3688ef){while(--_0x3688ef){_0x5c3d9b['push'](_0x5c3d9b['shift']());}};_0x3d3d5d(++_0x1dd32e);}(_0xd69e,0xa0));var _0xed69=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0xd69e[_0x49b207];return _0x2dc8fa;};'use strict';var _=require(_0xed69('0x0'));var util=require(_0xed69('0x1'));var BPromise=require(_0xed69('0x2'));var db=require('../mysqldb')['db'];var config=require(_0xed69('0x3'));var queryQueues={'attributes':['id',_0xed69('0x4')],'include':[{'as':'Agents','model':db['User'],'attributes':['id','name','role'],'raw':!![],'where':{'role':_0xed69('0x5')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':'telephone'}};var queryTrunks={'raw':!![],'attributes':['id',_0xed69('0x4')]};var queryAgents={'raw':!![],'attributes':['id',_0xed69('0x4')],'where':{'role':_0xed69('0x5')}};var queryCampaigns={'raw':!![],'attributes':['id',_0xed69('0x4'),'type'],'where':{'type':_0xed69('0x6')}};function getAssociatedResources(_0x54ca2a,_0x31dbb0,_0x42c0b0){return db['UserProfileSection'][_0xed69('0x7')]({'where':{'name':_0x54ca2a,'userProfileId':_0x31dbb0},'raw':!![]})[_0xed69('0x8')](function(_0x4ebc85){if(_0x4ebc85){if(_0x4ebc85[_0xed69('0x9')]){switch(_0x54ca2a){case'VoiceQueues':case _0xed69('0xa'):case _0xed69('0xb'):case'SmsQueues':case _0xed69('0xc'):case'OpenchannelQueues':case _0xed69('0xd'):return db[_0x42c0b0][_0xed69('0xe')](queryQueues);case _0xed69('0xf'):return db[_0x42c0b0]['findAll'](queryTelephones);case'Trunks':return db[_0x42c0b0][_0xed69('0xe')](queryTrunks);case _0xed69('0x10'):return db[_0x42c0b0][_0xed69('0xe')](queryCampaigns);}}else{return db[_0xed69('0x11')][_0xed69('0xe')]({'attributes':['resourceId'],'where':{'sectionId':_0x4ebc85['id']},'raw':!![]})[_0xed69('0x8')](function(_0x1e318a){if(_0x1e318a){var _0x19af14={'where':{'id':_[_0xed69('0x12')](_0x1e318a,_0xed69('0x13'))},'raw':!![]};switch(_0x42c0b0){case _0xed69('0x14'):_0x19af14[_0xed69('0x15')][_0xed69('0x16')]=_0xed69('0x17');break;case _0xed69('0x18'):_0x19af14['where']['type']='ivr';break;}return db[_0x42c0b0][_0xed69('0xe')](_0x19af14);}else{return[];}});}}else{return[];}})[_0xed69('0x8')](function(_0x387cec){return _0x387cec;});}function joinOrLeaveQueues(_0x576a71,_0x237759,_0x11c1fc,_0x589f07){_0x576a71[_0x237759](util[_0xed69('0x19')](_0xed69('0x1a'),_0x11c1fc,_0x589f07[_0xed69('0x4')]));if(_0x589f07[_0xed69('0x1b')]){for(var _0x4ef2fe=0x0;_0x4ef2fe<_0x589f07[_0xed69('0x1b')][_0xed69('0x1c')];_0x4ef2fe+=0x1){_0x576a71[_0x237759](util['format'](_0xed69('0x1d'),_0x589f07[_0xed69('0x1b')][_0x4ef2fe][_0xed69('0x4')]));}}}function joinOrLeave(_0x176fd1,_0xa3486a,_0x169398){var _0x513337;if(_0x176fd1[_0xed69('0x1e')][_0xed69('0x1f')]['id']){db[_0xed69('0x14')][_0xed69('0x20')]({'attributes':['id',_0xed69('0x4'),_0xed69('0x16'),_0xed69('0x21')],'where':{'id':_0x176fd1[_0xed69('0x1e')][_0xed69('0x1f')]['id']},'include':[{'model':db[_0xed69('0x22')],'as':_0xed69('0x23'),'attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xed69('0x24')],'as':_0xed69('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0xed69('0x26')],'as':_0xed69('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0xed69('0x28')],'as':_0xed69('0x29'),'attributes':['id'],'raw':!![]},{'model':db[_0xed69('0x2a')],'as':_0xed69('0x2b'),'attributes':['id'],'raw':!![]}]})[_0xed69('0x8')](function(_0x1b24d7){if(_0x1b24d7){_0x513337=_0x1b24d7;_0x176fd1[_0xa3486a](util['format']('user:%s',_0x1b24d7[_0xed69('0x4')]));var _0x54474b=[];switch(_0x1b24d7[_0xed69('0x16')]){case _0xed69('0x2c'):_0x176fd1[_0xa3486a](_0xed69('0x2d'));_0x176fd1[_0xa3486a](_0xed69('0x2e'));if(queryQueues[_0xed69('0x2f')](_0xed69('0x30'))){delete queryQueues[_0xed69('0x30')];}_0x54474b['push'](db[_0xed69('0x31')][_0xed69('0xe')](queryQueues));_0x54474b[_0xed69('0x32')](db[_0xed69('0x33')][_0xed69('0xe')](queryQueues));_0x54474b[_0xed69('0x32')](db[_0xed69('0x34')]['findAll'](queryQueues));_0x54474b['push'](db[_0xed69('0x35')][_0xed69('0xe')](queryQueues));_0x54474b[_0xed69('0x32')](db[_0xed69('0x36')][_0xed69('0xe')](queryQueues));_0x54474b[_0xed69('0x32')](db['OpenchannelQueue'][_0xed69('0xe')](queryQueues));_0x54474b[_0xed69('0x32')](db[_0xed69('0x37')][_0xed69('0xe')](queryQueues));_0x54474b[_0xed69('0x32')](db[_0xed69('0x14')]['findAll'](queryTelephones));_0x54474b['push'](db['Trunk'][_0xed69('0xe')](queryTrunks));_0x54474b[_0xed69('0x32')](db[_0xed69('0x18')][_0xed69('0xe')](queryCampaigns));_0x54474b['push'](db[_0xed69('0x14')][_0xed69('0xe')](queryAgents));break;case'user':_0x176fd1[_0xa3486a](_0xed69('0x2d'));_0x176fd1[_0xa3486a](_0xed69('0x2e'));_0x54474b[_0xed69('0x32')](getAssociatedResources(_0xed69('0x38'),_0x1b24d7['userProfileId'],_0xed69('0x31')));_0x54474b[_0xed69('0x32')](getAssociatedResources(_0xed69('0xa'),_0x1b24d7[_0xed69('0x21')],_0xed69('0x33')));_0x54474b[_0xed69('0x32')](getAssociatedResources(_0xed69('0xb'),_0x1b24d7[_0xed69('0x21')],'FaxQueue'));_0x54474b[_0xed69('0x32')](getAssociatedResources('SmsQueues',_0x1b24d7[_0xed69('0x21')],_0xed69('0x35')));_0x54474b[_0xed69('0x32')](getAssociatedResources('MailQueues',_0x1b24d7[_0xed69('0x21')],'MailQueue'));_0x54474b[_0xed69('0x32')](getAssociatedResources(_0xed69('0x39'),_0x1b24d7[_0xed69('0x21')],_0xed69('0x3a')));_0x54474b[_0xed69('0x32')](getAssociatedResources(_0xed69('0xd'),_0x1b24d7[_0xed69('0x21')],'WhatsappQueue'));_0x54474b['push'](getAssociatedResources(_0xed69('0xf'),_0x1b24d7[_0xed69('0x21')],_0xed69('0x14')));_0x54474b[_0xed69('0x32')](getAssociatedResources('Trunks',_0x1b24d7[_0xed69('0x21')],_0xed69('0x3b')));_0x54474b[_0xed69('0x32')](getAssociatedResources(_0xed69('0x10'),_0x1b24d7[_0xed69('0x21')],_0xed69('0x18')));_0x54474b[_0xed69('0x32')](db[_0xed69('0x14')]['findAll'](queryAgents));break;case'agent':_0x176fd1[_0xa3486a](_0xed69('0x2d'));_0x176fd1[_0xa3486a](_0xed69('0x2e'));_0x54474b[_0xed69('0x32')](_0x1b24d7['getVoiceQueues']({'attributes':['id',_0xed69('0x4')]}));_0x54474b[_0xed69('0x32')](_0x1b24d7[_0xed69('0x3c')]({'attributes':['id',_0xed69('0x4')]}));_0x54474b[_0xed69('0x32')](_0x1b24d7[_0xed69('0x3d')]({'attributes':['id',_0xed69('0x4')]}));_0x54474b[_0xed69('0x32')](_0x1b24d7['getSmsQueues']({'attributes':['id',_0xed69('0x4')]}));_0x54474b['push'](_0x1b24d7[_0xed69('0x3e')]({'attributes':['id','name']}));_0x54474b[_0xed69('0x32')](_0x1b24d7[_0xed69('0x3f')]({'attributes':['id',_0xed69('0x4')]}));_0x54474b[_0xed69('0x32')](_0x1b24d7['getWhatsappQueues']({'attributes':['id',_0xed69('0x4')]}));break;}return BPromise['all'](_0x54474b);}})[_0xed69('0x8')](function(_0x22b575){if(_0x22b575&&_0x22b575[_0xed69('0x1c')]){for(var _0x187cef=0x0;_0x187cef<_0x22b575[_0xed69('0x1c')];_0x187cef+=0x1){for(var _0x2227d1=0x0;_0x2227d1<_0x22b575[_0x187cef][_0xed69('0x1c')];_0x2227d1+=0x1){switch(_0x187cef){case 0x0:joinOrLeaveQueues(_0x176fd1,_0xa3486a,_0xed69('0x40'),_0x22b575[_0x187cef][_0x2227d1]);break;case 0x1:joinOrLeaveQueues(_0x176fd1,_0xa3486a,'chat',_0x22b575[_0x187cef][_0x2227d1]);break;case 0x2:joinOrLeaveQueues(_0x176fd1,_0xa3486a,_0xed69('0x41'),_0x22b575[_0x187cef][_0x2227d1]);break;case 0x3:joinOrLeaveQueues(_0x176fd1,_0xa3486a,_0xed69('0x42'),_0x22b575[_0x187cef][_0x2227d1]);break;case 0x4:joinOrLeaveQueues(_0x176fd1,_0xa3486a,_0xed69('0x43'),_0x22b575[_0x187cef][_0x2227d1]);break;case 0x5:joinOrLeaveQueues(_0x176fd1,_0xa3486a,'openchannel',_0x22b575[_0x187cef][_0x2227d1]);break;case 0x6:joinOrLeaveQueues(_0x176fd1,_0xa3486a,_0xed69('0x44'),_0x22b575[_0x187cef][_0x2227d1]);break;case 0x7:if(_0x513337['role']!==_0xed69('0x5'))_0x176fd1[_0xa3486a](util[_0xed69('0x19')](_0xed69('0x45'),_0x22b575[_0x187cef][_0x2227d1][_0xed69('0x4')]));break;case 0x8:if(_0x513337[_0xed69('0x16')]!=='agent')_0x176fd1[_0xa3486a](util[_0xed69('0x19')](_0xed69('0x46'),_0x22b575[_0x187cef][_0x2227d1]['name']));break;case 0x9:if(_0x513337[_0xed69('0x16')]!==_0xed69('0x5'))_0x176fd1[_0xa3486a](util[_0xed69('0x19')]('campaign:%s:%s',_0x22b575[_0x187cef][_0x2227d1]['type'],_0x22b575[_0x187cef][_0x2227d1]['name']));break;case 0xa:_0x176fd1[_0xa3486a](util['format'](_0xed69('0x1d'),_0x22b575[_0x187cef][_0x2227d1][_0xed69('0x4')]));break;}}}}})[_0xed69('0x8')](function(){if(_0xa3486a===_0xed69('0x47')){var _0x4afc79=_[_0xed69('0x12')](_0x513337['ChatInteractions'],'id');return _0x513337['removeChatInteractions'](_0x4afc79)[_0xed69('0x8')](function(){for(var _0x1e2c03=0x0;_0x1e2c03<_0x4afc79[_0xed69('0x1c')];_0x1e2c03+=0x1){_0x169398[_0xed69('0x48')]('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x4afc79[_0x1e2c03]),'UserId':Number(_0x513337['id'])});}});}})['then'](function(){if(_0xa3486a===_0xed69('0x47')){var _0x4ed824=_[_0xed69('0x12')](_0x513337[_0xed69('0x49')],'id');return _0x513337[_0xed69('0x4a')](_0x4ed824)['then'](function(){for(var _0x1644b9=0x0;_0x1644b9<_0x4ed824[_0xed69('0x1c')];_0x1644b9+=0x1){_0x169398['emit'](_0xed69('0x4b'),{'MailInteractionId':Number(_0x4ed824[_0x1644b9]),'UserId':Number(_0x513337['id'])});}});}})[_0xed69('0x8')](function(){if(_0xa3486a===_0xed69('0x47')){var _0x44cd99=_['map'](_0x513337[_0xed69('0x25')],'id');return _0x513337['removeFaxInteractions'](_0x44cd99)['then'](function(){for(var _0xa6647b=0x0;_0xa6647b<_0x44cd99[_0xed69('0x1c')];_0xa6647b+=0x1){_0x169398[_0xed69('0x48')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x44cd99[_0xa6647b]),'UserId':Number(_0x513337['id'])});}});}})['then'](function(){if(_0xa3486a===_0xed69('0x47')){var _0x3093a3=_['map'](_0x513337['SmsInteractions'],'id');return _0x513337[_0xed69('0x4c')](_0x3093a3)[_0xed69('0x8')](function(){for(var _0x179566=0x0;_0x179566<_0x3093a3[_0xed69('0x1c')];_0x179566+=0x1){_0x169398[_0xed69('0x48')](_0xed69('0x4d'),{'SmsInteractionId':Number(_0x3093a3[_0x179566]),'UserId':Number(_0x513337['id'])});}});}})[_0xed69('0x8')](function(){if(_0xa3486a===_0xed69('0x47')){var _0x5bf1c6=_['map'](_0x513337[_0xed69('0x29')],'id');return _0x513337[_0xed69('0x4e')](_0x5bf1c6)[_0xed69('0x8')](function(){for(var _0x285867=0x0;_0x285867<_0x5bf1c6['length'];_0x285867+=0x1){_0x169398[_0xed69('0x48')](_0xed69('0x4f'),{'OpenchannelInteractionId':Number(_0x5bf1c6[_0x285867]),'UserId':Number(_0x513337['id'])});}});}})[_0xed69('0x8')](function(){if(_0xa3486a===_0xed69('0x47')){var _0x11dfa4=_[_0xed69('0x12')](_0x513337['WhatsappInteractions'],'id');return _0x513337[_0xed69('0x50')](_0x11dfa4)[_0xed69('0x8')](function(){for(var _0x4d229f=0x0;_0x4d229f<_0x11dfa4[_0xed69('0x1c')];_0x4d229f+=0x1){_0x169398[_0xed69('0x48')](_0xed69('0x51'),{'WhatsappInteractionId':Number(_0x11dfa4[_0x4d229f]),'UserId':Number(_0x513337['id'])});}});}})[_0xed69('0x52')](function(_0x2bffca){_0x176fd1[_0xed69('0x53')](_0x2bffca);});}}function onDisconnect(_0x2aae2b,_0x182471){joinOrLeave(_0x2aae2b,_0xed69('0x47'),_0x182471);}function onConnect(_0x2c3138){joinOrLeave(_0x2c3138,_0xed69('0x54'));}exports[_0xed69('0x55')]=function(_0x1d16ab){_0x1d16ab['on'](_0xed69('0x56'),function(_0xcb2bc3){_0xcb2bc3[_0xed69('0x57')](0x0);_0xcb2bc3[_0xed69('0x58')]=_0xcb2bc3[_0xed69('0x59')]['connection']['remoteAddress']+':'+_0xcb2bc3[_0xed69('0x59')][_0xed69('0x56')][_0xed69('0x5a')];_0xcb2bc3[_0xed69('0x5b')]=new Date();_0xcb2bc3['log']=function(_0x498229){console[_0xed69('0x53')](_0xed69('0x5c')+_0xcb2bc3[_0xed69('0x5d')][_0xed69('0x4')]+'['+_0xcb2bc3[_0xed69('0x58')]+']',_0x498229);};_0xcb2bc3['on'](_0xed69('0x5e'),function(){onDisconnect(_0xcb2bc3,_0x1d16ab);_0xcb2bc3['log'](_0xed69('0x5f'));});onConnect(_0xcb2bc3);_0xcb2bc3[_0xed69('0x53')](_0xed69('0x60'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index 50a0b1e..16faa61 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 _0x0076=['MailMessage','Openchannel','OpenchannelInteraction','OpenchannelMessage','request','EventManager','info','Trigger,\x20%s','error','code','catch','motionChannel','event','direction','resolve','ContactId','undefined','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','then','contact','UserId','format','name','agent','channel','incomingmessage','outgoingmessage','AfterCreateMessage','get','offlineMessage','opened','interface','SIP/%s','AfterCreate','changed','closed','substatus','AfterUpdate','fullname','email','internal','default','length','hasOwnProperty','callback','toLowerCase','condition','../../mysqldb','jayson/promise','../logger','client','Chat','ChatInteraction','newinteraction','afterUpdate','closedinteraction','ChatMessage','newmessage','ChatOfflineMessage','afterCreate','Sms','SmsInteraction','SmsMessage','Whatsapp','WhatsappInteraction','Fax','FaxInteraction','FaxMessage','Mail','MailInteraction'];(function(_0x1e789d,_0xb5efc3){var _0x5764df=function(_0x43c9ce){while(--_0x43c9ce){_0x1e789d['push'](_0x1e789d['shift']());}};_0x5764df(++_0xb5efc3);}(_0x0076,0x1ef));var _0x6007=function(_0x20589d,_0x55d5bf){_0x20589d=_0x20589d-0x0;var _0x422de9=_0x0076[_0x20589d];return _0x422de9;};'use strict';var util=require('util');var db=require(_0x6007('0x0'))['db'];var jayson=require(_0x6007('0x1'));var logger=require(_0x6007('0x2'))('triggers');var client=jayson[_0x6007('0x3')]['http']({'port':0x232a});var triggers=[{'channel':_0x6007('0x4'),'model':_0x6007('0x5'),'event':'afterCreate','condition':_0x6007('0x6'),'callback':afterCreate},{'channel':'Chat','model':_0x6007('0x5'),'event':_0x6007('0x7'),'condition':_0x6007('0x8'),'callback':afterUpdate},{'channel':_0x6007('0x4'),'model':_0x6007('0x9'),'event':'afterCreate','condition':_0x6007('0xa'),'callback':afterCreateMessage},{'channel':_0x6007('0x4'),'model':_0x6007('0xb'),'event':_0x6007('0xc'),'condition':'newmessage','callback':afterCreateOfflineMessage},{'channel':'Sms','model':'SmsInteraction','event':_0x6007('0xc'),'condition':_0x6007('0x6'),'callback':afterCreate},{'channel':_0x6007('0xd'),'model':_0x6007('0xe'),'event':_0x6007('0x7'),'condition':_0x6007('0x8'),'callback':afterUpdate},{'channel':_0x6007('0xd'),'model':_0x6007('0xf'),'event':_0x6007('0xc'),'condition':_0x6007('0xa'),'callback':afterCreateMessage},{'channel':_0x6007('0x10'),'model':_0x6007('0x11'),'event':'afterCreate','condition':_0x6007('0x6'),'callback':afterCreate},{'channel':'Whatsapp','model':_0x6007('0x11'),'event':_0x6007('0x7'),'condition':'closedinteraction','callback':afterUpdate},{'channel':'Whatsapp','model':'WhatsappMessage','event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':_0x6007('0x12'),'model':_0x6007('0x13'),'event':'afterCreate','condition':'newinteraction','callback':afterCreate},{'channel':_0x6007('0x12'),'model':_0x6007('0x13'),'event':_0x6007('0x7'),'condition':_0x6007('0x8'),'callback':afterUpdate},{'channel':'Fax','model':_0x6007('0x14'),'event':'afterCreate','condition':_0x6007('0xa'),'callback':afterCreateMessage},{'channel':_0x6007('0x15'),'model':_0x6007('0x16'),'event':_0x6007('0xc'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x6007('0x15'),'model':_0x6007('0x16'),'event':'afterUpdate','condition':_0x6007('0x8'),'callback':afterUpdate},{'channel':_0x6007('0x15'),'model':_0x6007('0x17'),'event':_0x6007('0xc'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0x6007('0x18'),'model':'OpenchannelInteraction','event':_0x6007('0xc'),'condition':_0x6007('0x6'),'callback':afterCreate},{'channel':_0x6007('0x18'),'model':_0x6007('0x19'),'event':_0x6007('0x7'),'condition':_0x6007('0x8'),'callback':afterUpdate},{'channel':_0x6007('0x18'),'model':_0x6007('0x1a'),'event':'afterCreate','condition':_0x6007('0xa'),'callback':afterCreateMessage}];function request(_0x54c60d){return client[_0x6007('0x1b')](_0x6007('0x1c'),_0x54c60d)['then'](function(_0x2b3af){logger[_0x6007('0x1d')](_0x6007('0x1e'),_0x6007('0x1c'),_0x2b3af);if(_0x2b3af['error']){if(_0x2b3af[_0x6007('0x1f')][_0x6007('0x20')]===0x1f4){logger[_0x6007('0x1f')]('Trigger,\x20%s',_0x6007('0x1c'),_0x2b3af['error']);}}})[_0x6007('0x21')](function(_0x1919d5){logger[_0x6007('0x1f')](_0x6007('0x1e'),_0x6007('0x1c'),_0x1919d5);});}function afterCreateMessage(_0x39b95f){return function(_0x5c9fad){_0x5c9fad=_0x5c9fad['get']({'plain':!![]});_0x5c9fad['channel']=_0x39b95f;_0x5c9fad[_0x6007('0x22')]=_0x39b95f;_0x5c9fad[_0x6007('0x23')]=_0x5c9fad[_0x6007('0x24')];Promise[_0x6007('0x25')]()['then'](function(){if(typeof _0x5c9fad[_0x6007('0x26')]===_0x6007('0x27'))return null;var _0x46bfe9=_0x6007('0x28')+_0x5c9fad[_0x6007('0x26')];return db[_0x6007('0x29')]['query'](_0x46bfe9,{'type':db[_0x6007('0x2a')][_0x6007('0x2b')][_0x6007('0x2c')],'raw':!![]});})[_0x6007('0x2d')](function(_0x5e2b02){if(_0x5e2b02){_0x5c9fad[_0x6007('0x2e')]=_0x5e2b02[0x0];}if(typeof _0x5c9fad[_0x6007('0x2f')]==='undefined')return;return getAgent(_0x5c9fad[_0x6007('0x2f')]);})['then'](function(_0x28a1f1){if(_0x28a1f1){_0x5c9fad['interface']=util[_0x6007('0x30')]('SIP/%s',_0x28a1f1[_0x6007('0x31')]);_0x5c9fad[_0x6007('0x32')]=_0x28a1f1;_0x5c9fad[_0x6007('0x33')]=_0x39b95f;return request({'event':_0x6007('0x34'),'message':_0x5c9fad});}else{return request({'event':_0x6007('0x35'),'message':_0x5c9fad});}})[_0x6007('0x21')](function(_0x3dce83){logger[_0x6007('0x1f')](_0x6007('0x1e'),_0x6007('0x36'),_0x3dce83);});};}function afterCreateOfflineMessage(_0x48218e){return function(_0x595c3a){_0x595c3a=_0x595c3a[_0x6007('0x37')]({'plain':!![]});_0x595c3a['channel']=_0x48218e;_0x595c3a[_0x6007('0x22')]=_0x48218e;_0x595c3a[_0x6007('0x23')]=_0x6007('0x38');return request({'event':_0x595c3a[_0x6007('0x23')],'message':_0x595c3a});};}function afterCreate(_0x250fb7,_0xc505d){return function(_0x352b5e){_0x352b5e=_0x352b5e[_0x6007('0x37')]({'plain':!![]});_0x352b5e['channel']=_0x250fb7;_0x352b5e[_0x6007('0x22')]=_0x250fb7;_0x352b5e[_0x6007('0x23')]=_0x6007('0x39');Promise[_0x6007('0x25')]()['then'](function(){var _0x242cfc=_0x6007('0x28')+_0x352b5e['ContactId'];return db[_0x6007('0x29')]['query'](_0x242cfc,{'type':db['Sequelize'][_0x6007('0x2b')][_0x6007('0x2c')],'raw':!![]});})[_0x6007('0x2d')](function(_0x586eba){if(_0x586eba){_0x352b5e[_0x6007('0x2e')]=_0x586eba[0x0];}if(typeof _0x352b5e['UserId']===_0x6007('0x27'))return;return getAgent(_0x352b5e[_0x6007('0x2f')]);})[_0x6007('0x2d')](function(_0x230fa3){if(_0x230fa3){_0x352b5e[_0x6007('0x3a')]=util['format'](_0x6007('0x3b'),_0x230fa3['name']);_0x352b5e['agent']=_0x230fa3;}return request({'event':_0xc505d,'message':_0x352b5e});})[_0x6007('0x21')](function(_0x14820d){logger[_0x6007('0x1f')](_0x6007('0x1e'),_0x6007('0x3c'),_0x14820d);});};}function afterUpdate(_0x587e0c){return function(_0x145999){var _0x5d201c=_0x145999[_0x6007('0x3d')](_0x6007('0x3e'))&&_0x145999[_0x6007('0x3e')];var _0x3afc53=_0x145999[_0x6007('0x3d')](_0x6007('0x3f'));if(_0x5d201c||_0x3afc53){var _0x4eb1ab=_0x5d201c?'closedinteraction':_0x6007('0x3f');var _0x1c476b=_0x145999[_0x6007('0x37')]({'plain':!![]});_0x1c476b[_0x6007('0x33')]=_0x587e0c;_0x1c476b[_0x6007('0x22')]=_0x587e0c;_0x1c476b['event']=_0x5d201c?_0x6007('0x3e'):_0x6007('0x3f');var _0x3a377c=_0x6007('0x28')+_0x1c476b['ContactId'];return db[_0x6007('0x29')]['query'](_0x3a377c,{'type':db[_0x6007('0x2a')][_0x6007('0x2b')][_0x6007('0x2c')],'raw':!![]})[_0x6007('0x2d')](function(_0x937ff2){if(_0x937ff2){_0x1c476b[_0x6007('0x2e')]=_0x937ff2[0x0];}if(typeof _0x1c476b['UserId']==='undefined')return;return getAgent(_0x1c476b[_0x6007('0x2f')]);})[_0x6007('0x2d')](function(_0x534114){if(_0x534114){_0x1c476b[_0x6007('0x3a')]=util[_0x6007('0x30')](_0x6007('0x3b'),_0x534114['name']);_0x1c476b[_0x6007('0x32')]=_0x534114;}return request({'event':_0x4eb1ab,'message':_0x1c476b});})[_0x6007('0x21')](function(_0x37936b){logger[_0x6007('0x1f')](_0x6007('0x1e'),_0x6007('0x40'),_0x37936b);});}};}function getAgent(_0x128ebe){return db['User']['find']({'where':{'id':_0x128ebe},'attributes':['id','name',_0x6007('0x41'),_0x6007('0x42'),_0x6007('0x43')],'raw':!![]})[_0x6007('0x2d')](function(_0x1146fe){return _0x1146fe;});}exports[_0x6007('0x44')]=function(){for(var _0x51eaba=0x0;_0x51eaba=_0x32412d[_0x5740('0x13')]){throw Error('Maximum\x20login\x20has\x20been\x20reached');}_0x2bb419(_0x295f50);})['catch'](function(_0x3233c7){_0x389a1c(_0x3233c7);});});}; \ No newline at end of file +var _0x49f8=['getLicense','agents','catch','lodash','bluebird','../mysqldb','voice','chat','fax','whatsapp','openchannel','getChannels','isValidChannel','toLowerCase','includes','clearBlockUser','blockedAt','updateAttributes','agent','User','count','then'];(function(_0xdcb46f,_0x8f628e){var _0x1382d8=function(_0x381441){while(--_0x381441){_0xdcb46f['push'](_0xdcb46f['shift']());}};_0x1382d8(++_0x8f628e);}(_0x49f8,0x1a5));var _0x849f=function(_0x1022ed,_0x2ac525){_0x1022ed=_0x1022ed-0x0;var _0x959b70=_0x49f8[_0x1022ed];return _0x959b70;};'use strict';var _=require(_0x849f('0x0'));var BPromise=require(_0x849f('0x1'));var db=require(_0x849f('0x2'))['db'];var util=require('./license/util');var channels=[_0x849f('0x3'),'mail',_0x849f('0x4'),_0x849f('0x5'),'sms',_0x849f('0x6'),_0x849f('0x7')];exports[_0x849f('0x8')]=function(){return channels;};exports[_0x849f('0x9')]=function(_0x1b40c0){_0x1b40c0=_0x1b40c0[_0x849f('0xa')]();return _[_0x849f('0xb')](channels,_0x1b40c0);};exports[_0x849f('0xc')]=function(_0x5ad211,_0x548135,_0x55b1b3,_0xbadce9){var _0x24e90e={'loginAttempts':_0x548135,'blocked':_0x55b1b3};if(!_['isUndefined'](_0xbadce9)){_0x24e90e[_0x849f('0xd')]=_0xbadce9;}return _0x5ad211[_0x849f('0xe')](_0x24e90e);};exports['getLicense']=function(_0x195e82){return new BPromise(function(_0x1ccadd,_0x2d3b8b){var _0x2e0256=0x0;if(_0x195e82['role']!==_0x849f('0xf')){_0x1ccadd(_0x195e82);}db[_0x849f('0x10')][_0x849f('0x11')]({'where':{'role':_0x849f('0xf'),'online':!![],'id':{'$ne':_0x195e82['id']}}})[_0x849f('0x12')](function(_0x5d53c5){_0x2e0256=_0x5d53c5;return util[_0x849f('0x13')]();})['then'](function(_0xf80a4e){if(_0xf80a4e&&_0xf80a4e[_0x849f('0x14')]&&_0x2e0256>=_0xf80a4e[_0x849f('0x14')]){throw Error('Maximum\x20login\x20has\x20been\x20reached');}_0x1ccadd(_0x195e82);})[_0x849f('0x15')](function(_0x24fa7b){_0x2d3b8b(_0x24fa7b);});});}; \ No newline at end of file diff --git a/server/errors/api.js b/server/errors/api.js index 0e15872..fb5d50a 100644 --- a/server/errors/api.js +++ b/server/errors/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5576=['api','message','Internal\x20Server\x20Error','name','Error','inherits','Bad\x20Request','Forbidden','Entity\x20not\x20found','Not\x20Found','Message\x20sent\x20outside\x20a\x20valid\x20interval','Out\x20Of\x20Interval','OutOfInterval','Resource\x20Conflict','Conflict','stack','statusMessage','status','exports','../config/logger'];(function(_0x267390,_0x4b9a63){var _0x159e43=function(_0x4e1b80){while(--_0x4e1b80){_0x267390['push'](_0x267390['shift']());}};_0x159e43(++_0x4b9a63);}(_0x5576,0x13f));var _0x6557=function(_0x38c632,_0x14e8e6){_0x38c632=_0x38c632-0x0;var _0x12737e=_0x5576[_0x38c632];return _0x12737e;};'use strict';var util=require('util');var logger=require(_0x6557('0x0'))(_0x6557('0x1'));var APIError=function(_0x2731b0,_0x400872){this[_0x6557('0x2')]=_0x2731b0||_0x6557('0x3');this[_0x6557('0x4')]=_0x400872||_0x6557('0x5');util[_0x6557('0x6')](APIError,Error);};var APIBadRequestError=function(_0x433fac){this['message']=_0x433fac||_0x6557('0x7');this[_0x6557('0x4')]=_0x6557('0x7');util['inherits'](APIBadRequestError,APIError);};var APIForbiddenError=function(_0x651b13){this[_0x6557('0x2')]=_0x651b13||_0x6557('0x8');this[_0x6557('0x4')]=_0x6557('0x8');util[_0x6557('0x6')](APIForbiddenError,APIError);};var APINotFoundError=function(_0x23e9e6){this[_0x6557('0x2')]=_0x23e9e6||_0x6557('0x9');this[_0x6557('0x4')]=_0x6557('0xa');util[_0x6557('0x6')](APINotFoundError,APIError);};var APIOutOfIntervalError=function(_0x30ad02){this[_0x6557('0x2')]=_0x30ad02||_0x6557('0xb');this[_0x6557('0x4')]=_0x6557('0xc');this['code']=0x193;this['details']={'type':_0x6557('0xd')};util[_0x6557('0x6')](APIOutOfIntervalError,APIError);};var APIConflictError=function(_0x53ed03){this[_0x6557('0x2')]=_0x53ed03||_0x6557('0xe');this[_0x6557('0x4')]=_0x6557('0xf');util[_0x6557('0x6')](APIBadRequestError,APIError);};function getStatusCode(_0x25ba2b){switch(_0x25ba2b){case _0x6557('0x7'):return 0x190;case'Forbidden',_0x6557('0xc'):return 0x193;case _0x6557('0xa'):return 0x194;case _0x6557('0xf'):return 0x199;default:return 0x1f4;}}function getCustomStatusMessage(_0x2ce6a7){if(_0x2ce6a7===_0x6557('0xc'))return _0x2ce6a7;return null;}function handleError(_0x57fddb){return function(_0x2681ff){logger['error'](_0x2681ff[_0x6557('0x10')]);var _0x35baad=getStatusCode(_0x2681ff[_0x6557('0x4')]);var _0x18d8ae=getCustomStatusMessage(_0x2681ff[_0x6557('0x4')]);if(_0x2681ff['name']){delete _0x2681ff[_0x6557('0x4')];}if(_0x18d8ae){_0x57fddb[_0x6557('0x11')]=_0x18d8ae;}return _0x57fddb[_0x6557('0x12')](_0x35baad)['send'](_0x2681ff);};}module[_0x6557('0x13')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APIForbiddenError':APIForbiddenError,'APINotFoundError':APINotFoundError,'APIOutOfIntervalError':APIOutOfIntervalError,'APIConflict':APIConflictError,'handleError':handleError}; \ No newline at end of file +var _0x153a=['api','message','name','Error','inherits','Bad\x20Request','Forbidden','Entity\x20not\x20found','Not\x20Found','Message\x20sent\x20outside\x20a\x20valid\x20interval','Out\x20Of\x20Interval','code','details','OutOfInterval','Resource\x20Conflict','Conflict','error','stack','statusMessage','status','send','../config/logger'];(function(_0x369151,_0x179f72){var _0x4292d5=function(_0x330422){while(--_0x330422){_0x369151['push'](_0x369151['shift']());}};_0x4292d5(++_0x179f72);}(_0x153a,0xaf));var _0xa153=function(_0x5cb1af,_0x4bdc8c){_0x5cb1af=_0x5cb1af-0x0;var _0x8d7940=_0x153a[_0x5cb1af];return _0x8d7940;};'use strict';var util=require('util');var logger=require(_0xa153('0x0'))(_0xa153('0x1'));var APIError=function(_0x530df0,_0x12ca30){this[_0xa153('0x2')]=_0x530df0||'Internal\x20Server\x20Error';this[_0xa153('0x3')]=_0x12ca30||_0xa153('0x4');util[_0xa153('0x5')](APIError,Error);};var APIBadRequestError=function(_0xb40f4e){this[_0xa153('0x2')]=_0xb40f4e||_0xa153('0x6');this[_0xa153('0x3')]=_0xa153('0x6');util['inherits'](APIBadRequestError,APIError);};var APIForbiddenError=function(_0x41cb5f){this[_0xa153('0x2')]=_0x41cb5f||_0xa153('0x7');this[_0xa153('0x3')]=_0xa153('0x7');util['inherits'](APIForbiddenError,APIError);};var APINotFoundError=function(_0x38babf){this[_0xa153('0x2')]=_0x38babf||_0xa153('0x8');this['name']=_0xa153('0x9');util[_0xa153('0x5')](APINotFoundError,APIError);};var APIOutOfIntervalError=function(_0x537948){this[_0xa153('0x2')]=_0x537948||_0xa153('0xa');this[_0xa153('0x3')]=_0xa153('0xb');this[_0xa153('0xc')]=0x193;this[_0xa153('0xd')]={'type':_0xa153('0xe')};util[_0xa153('0x5')](APIOutOfIntervalError,APIError);};var APIConflictError=function(_0x20f1f9){this['message']=_0x20f1f9||_0xa153('0xf');this[_0xa153('0x3')]='Conflict';util['inherits'](APIBadRequestError,APIError);};function getStatusCode(_0x56a416){switch(_0x56a416){case _0xa153('0x6'):return 0x190;case _0xa153('0x7'),_0xa153('0xb'):return 0x193;case'Not\x20Found':return 0x194;case _0xa153('0x10'):return 0x199;default:return 0x1f4;}}function getCustomStatusMessage(_0x581318){if(_0x581318===_0xa153('0xb'))return _0x581318;return null;}function handleError(_0x358bc7){return function(_0x3a759e){logger[_0xa153('0x11')](_0x3a759e[_0xa153('0x12')]);var _0x70b2=getStatusCode(_0x3a759e[_0xa153('0x3')]);var _0x30460c=getCustomStatusMessage(_0x3a759e['name']);if(_0x3a759e[_0xa153('0x3')]){delete _0x3a759e['name'];}if(_0x30460c){_0x358bc7[_0xa153('0x13')]=_0x30460c;}return _0x358bc7[_0xa153('0x14')](_0x70b2)[_0xa153('0x15')](_0x3a759e);};}module['exports']={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APIForbiddenError':APIForbiddenError,'APINotFoundError':APINotFoundError,'APIOutOfIntervalError':APIOutOfIntervalError,'APIConflict':APIConflictError,'handleError':handleError}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index e4958e5..03a1115 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x43e4=['send','exports','404','status','render','json'];(function(_0x19ae88,_0x4b4630){var _0x3ff7e4=function(_0x5c9fc6){while(--_0x5c9fc6){_0x19ae88['push'](_0x19ae88['shift']());}};_0x3ff7e4(++_0x4b4630);}(_0x43e4,0x1cf));var _0x443e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x43e4[_0x19e35c];return _0x3e1fe8;};'use strict';module[_0x443e('0x0')][0x194]=function pageNotFound(_0x3e8640,_0x472090){var _0x5d944d=_0x443e('0x1');var _0x1d3256=0x194;var _0x545e3f={'status':_0x1d3256};_0x472090[_0x443e('0x2')](_0x545e3f[_0x443e('0x2')]);_0x472090[_0x443e('0x3')](_0x5d944d,{},function(_0x3297bf,_0x60bcad){if(_0x3297bf){return _0x472090[_0x443e('0x2')](_0x545e3f[_0x443e('0x2')])[_0x443e('0x4')](_0x545e3f);}_0x472090[_0x443e('0x5')](_0x60bcad);});}; \ No newline at end of file +var _0x9a0b=['status','render','json','send','404'];(function(_0x3f6c23,_0x436877){var _0x1fe8b1=function(_0x3ac58f){while(--_0x3ac58f){_0x3f6c23['push'](_0x3f6c23['shift']());}};_0x1fe8b1(++_0x436877);}(_0x9a0b,0x1f3));var _0xb9a0=function(_0x5cc716,_0x385daf){_0x5cc716=_0x5cc716-0x0;var _0x54c1c8=_0x9a0b[_0x5cc716];return _0x54c1c8;};'use strict';module['exports'][0x194]=function pageNotFound(_0x3668a7,_0x3d99f0){var _0x23d8c7=_0xb9a0('0x0');var _0xaf57a4=0x194;var _0x557c4c={'status':_0xaf57a4};_0x3d99f0[_0xb9a0('0x1')](_0x557c4c[_0xb9a0('0x1')]);_0x3d99f0[_0xb9a0('0x2')](_0x23d8c7,{},function(_0x594155,_0x5d288f){if(_0x594155){return _0x3d99f0[_0xb9a0('0x1')](_0x557c4c[_0xb9a0('0x1')])[_0xb9a0('0x3')](_0x557c4c);}_0x3d99f0[_0xb9a0('0x4')](_0x5d288f);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index ea97aca..993c016 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb269=['OpenchannelAccountId','user_has_openchannel_accounts','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','team_has_openchannel_queues','ProactiveActions','OpenchannelQueueReport','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','ChatInternalMessage','CmContactHasItem','Phones','CmContactId','JscriptySessions','Company','CompanyId','cm_contact_has_tags','AdditionalPhones','CmHopperId','Campaign','CampaignId','Condition','OneAll','Any','AutomationAnyId','Action','Actions','AutomationId','ParentId','Intervals','MailApplications','ChatApplications','FaxApplications','SmsApplications','Schedule','CustomReportId','Mohs','whatsapp_interaction_has_tags','ItemTypeId','Hopper','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','TriggerId','Fields','DefaultReportId','AnalyticMetric','MetricId','Configurations','AccountId','Subjects','SubjectId','Descriptions','Subject','Description','Field','FieldId','Variable','DescriptionId','VariableId','DeskConfiguration','ZohoConfiguration','ZohoField','int_zendesk_configuration_has_tags','FreshdeskConfiguration','ServicenowAccount','ServicenowField','FreshsalesConfiguration','FreshsalesField','ToId','JscriptyQuestionReport','SessionId','SmsQueueReport','ProjectId','team_has_chat_queues','SmsQueues','team_has_whatsapp_queues','TrunkBackup','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromAgent','ToUserId','ToAgent','ToAccount','ChatTransferReport','FromChatWebsiteId','ToQueue','ToChatWebsiteId','FromFaxAccountId','FromUserId','ToFaxAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsAccountId','UserProfileSections','UserProfileResource','sectionId','WhatsappAccountId','WhatsappInteractionId','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','user','exports','../config/environment','sequelize','lodash','jstz','determine','defaultsDeep','motion2','xC@LL1234','utf8mb4','name','utf8','sequelizeHistory','xcall','127.0.0.1','mysql','utf8_general_ci','database','username','password','options','User','../api/user/user.model','VoiceChanSpy','import','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','VoiceQueue','../api/voiceQueue/voiceQueue.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','../api/mailSubstatus/mailSubstatus.model','MailInteraction','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailQueueReport/mailQueueReport.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxInteraction/faxInteraction.model','FaxMessage','FaxQueue','../api/faxQueue/faxQueue.model','../api/faxQueueReport/faxQueueReport.model','SmsAccount','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','OpenchannelQueue','ChatWebsite','../api/chatWebsite/chatWebsite.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','../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','Pause','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Sound','Tag','../api/tag/tag.model','ContactItemType','../api/contactItemType/contactItemType.model','../api/cmContactHasItem/cmContactHasItem.model','CmHopperAdditionalPhone','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','../api/variable/variable.model','../api/integration/integration.model','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','SalesforceField','SugarcrmAccount','SugarcrmConfiguration','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskField','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','../api/intZohoConfiguration/intZohoConfiguration.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','../api/intFreshsalesField/intFreshsalesField.model','Network','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','Setting','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','SquareRecording','SquareMessage','Team','../api/team/team.model','License','../api/license/license.model','../api/campaign/campaign.model','../api/migration/migration.model','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserNotification','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','WhatsappInteraction','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','UserSetting','../api/user-setting/user-setting.model','MailInteractionHasTag','../api/mailInteractionHasTag/mailInteractionHasTag.model','hasOne','VoiceMail','cascade','UserId','userSetting','VoiceRecording','Recordings','hasMany','VoiceQueuesRt','Extensions','HopperFinals','HopperHistory','OpenchannelInteractions','ChatInteraction','FaxInteractions','MailInteractions','WhatsappInteractions','UserNotifications','Hoppers','belongsTo','userProfileId','belongsToMany','chat_group_has_users','CmContact','Contacts','cm_user_has_contacts','CmList','Lists','cm_user_has_lists','user_has_teams','user_has_mail_interactions','ChatInteractions','user_has_chat_interactions','user_has_fax_interactions','OpenchannelInteraction','user_has_openchannel_interactions','user_has_whatsapp_interactions','UserVoiceQueue','VoicePrefixes','MailQueues','ChatQueues','FaxQueues','OpenchannelQueues','WhatsappQueues','ChatWebsites','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','MailAccounts','OpenchannelAccount','OpenchannelAccounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','Applications','Sounds','moh_has_sounds','VoiceQueueId','HopperHistories','HopperBlacks','TrunkId','TrunkBackupId','IntervalId','mandatoryDispositionPause','voice_queues_has_cm_lists','Agents','Teams','BlackLists','Messages','mailboxuser','mailbox','QueueCalls','uniqueid','Contact','ContactId','MailAccountId','CloudProviderId','CloudProvider','restrict','Imap','Smtp','Dispositions','Interactions','List','ListId','TemplateId','mandatoryDispositionPauseId','team_has_mail_queues','MailInteractionId','Account','Owner','mail_interaction_has_tags','Tags','Attachments','Interaction','ChatWebsiteId','ChatOfflineMessageId','TagId','MailQueueReport','Items','Answers','FaxAccountId','FaxInteraction','Exntensions','FaxInteractionId','fax_interaction_has_tags','Users','Attachment','AttachmentId','team_has_fax_queues','FaxQueueReport','SmsAccountId','SmsApplication','SmsInteractionId','sms_interaction_has_tags','ThroughTags','SmsQueueId','team_has_sms_queues'];(function(_0x1508f9,_0x4a267a){var _0x5e323a=function(_0x480aee){while(--_0x480aee){_0x1508f9['push'](_0x1508f9['shift']());}};_0x5e323a(++_0x4a267a);}(_0xb269,0x73));var _0x9b26=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xb269[_0x3b380d];return _0x54502b;};'use strict';var config=require(_0x9b26('0x0'));var Sequelize=require(_0x9b26('0x1'));var _=require(_0x9b26('0x2'));var jstz=require(_0x9b26('0x3'));var timezone=jstz[_0x9b26('0x4')]();config[_0x9b26('0x1')]=_[_0x9b26('0x5')](config['sequelize'],{'database':_0x9b26('0x6'),'username':'xcall','password':_0x9b26('0x7'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x9b26('0x8')},'logging':![],'timezone':timezone[_0x9b26('0x9')](),'define':{'charset':_0x9b26('0xa'),'collate':'utf8_general_ci'}}});config[_0x9b26('0xb')]=_[_0x9b26('0x5')](config[_0x9b26('0xb')],{'database':'motion2','username':_0x9b26('0xc'),'password':'xC@LL1234','options':{'host':_0x9b26('0xd'),'port':0xcea,'dialect':_0x9b26('0xe'),'dialectOptions':{'charset':_0x9b26('0x8')},'logging':![],'timezone':timezone[_0x9b26('0x9')](),'define':{'charset':'utf8','collate':_0x9b26('0xf')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize'][_0x9b26('0x10')],config[_0x9b26('0x1')][_0x9b26('0x11')],config[_0x9b26('0x1')][_0x9b26('0x12')],config[_0x9b26('0x1')][_0x9b26('0x13')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x9b26('0xb')][_0x9b26('0x10')],config[_0x9b26('0xb')][_0x9b26('0x11')],config['sequelizeHistory'][_0x9b26('0x12')],config[_0x9b26('0xb')][_0x9b26('0x13')])};db[_0x9b26('0x14')]=db[_0x9b26('0x1')]['import'](_0x9b26('0x15'));db[_0x9b26('0x16')]=db['sequelize'][_0x9b26('0x17')](_0x9b26('0x18'));db[_0x9b26('0x19')]=db[_0x9b26('0x1')][_0x9b26('0x17')](_0x9b26('0x1a'));db[_0x9b26('0x1b')]=db[_0x9b26('0x1')][_0x9b26('0x17')](_0x9b26('0x1c'));db[_0x9b26('0x1d')]=db[_0x9b26('0x1')][_0x9b26('0x17')]('../api/voiceMusicOnHold/voiceMusicOnHold.model');db[_0x9b26('0x1e')]=db[_0x9b26('0x1')][_0x9b26('0x17')](_0x9b26('0x1f'));db['VoiceRecording']=db[_0x9b26('0x1')][_0x9b26('0x17')]('../api/voiceRecording/voiceRecording.model');db[_0x9b26('0x20')]=db[_0x9b26('0x1')][_0x9b26('0x17')](_0x9b26('0x21'));db['VoiceMail']=db[_0x9b26('0x1')][_0x9b26('0x17')]('../api/voiceMail/voiceMail.model');db[_0x9b26('0x22')]=db[_0x9b26('0x1')]['import'](_0x9b26('0x23'));db[_0x9b26('0x24')]=db[_0x9b26('0x1')][_0x9b26('0x17')]('../api/voiceCallReport/voiceCallReport.model');db[_0x9b26('0x25')]=db[_0x9b26('0x1')]['import'](_0x9b26('0x26'));db[_0x9b26('0x27')]=db['sequelize'][_0x9b26('0x17')](_0x9b26('0x28'));db[_0x9b26('0x29')]=db[_0x9b26('0x1')][_0x9b26('0x17')](_0x9b26('0x2a'));db[_0x9b26('0x2b')]=db[_0x9b26('0x1')][_0x9b26('0x17')](_0x9b26('0x2c'));db[_0x9b26('0x2d')]=db[_0x9b26('0x1')][_0x9b26('0x17')](_0x9b26('0x2e'));db[_0x9b26('0x2f')]=db[_0x9b26('0x1')]['import']('../api/voiceTransferReport/voiceTransferReport.model');db[_0x9b26('0x30')]=db[_0x9b26('0x1')][_0x9b26('0x17')](_0x9b26('0x31'));db['UserVoiceQueue']=db[_0x9b26('0x1')][_0x9b26('0x17')](_0x9b26('0x32'));db[_0x9b26('0x33')]=db[_0x9b26('0x1')][_0x9b26('0x17')](_0x9b26('0x34'));db[_0x9b26('0x35')]=db['sequelize'][_0x9b26('0x17')](_0x9b26('0x36'));db[_0x9b26('0x37')]=db[_0x9b26('0x1')][_0x9b26('0x17')]('../api/userFaxQueue/userFaxQueue.model');db[_0x9b26('0x38')]=db[_0x9b26('0x1')][_0x9b26('0x17')](_0x9b26('0x39'));db[_0x9b26('0x3a')]=db[_0x9b26('0x1')][_0x9b26('0x17')](_0x9b26('0x3b'));db[_0x9b26('0x3c')]=db[_0x9b26('0x1')][_0x9b26('0x17')](_0x9b26('0x3d'));db[_0x9b26('0x3e')]=db[_0x9b26('0x1')][_0x9b26('0x17')](_0x9b26('0x3f'));db[_0x9b26('0x40')]=db['sequelize'][_0x9b26('0x17')](_0x9b26('0x41'));db[_0x9b26('0x42')]=db[_0x9b26('0x1')][_0x9b26('0x17')](_0x9b26('0x43'));db[_0x9b26('0x44')]=db[_0x9b26('0x1')]['import'](_0x9b26('0x45'));db['MailSubstatus']=db[_0x9b26('0x1')][_0x9b26('0x17')](_0x9b26('0x46'));db[_0x9b26('0x47')]=db[_0x9b26('0x1')][_0x9b26('0x17')]('../api/mailInteraction/mailInteraction.model');db[_0x9b26('0x48')]=db['sequelize'][_0x9b26('0x17')](_0x9b26('0x49'));db[_0x9b26('0x4a')]=db[_0x9b26('0x1')][_0x9b26('0x17')]('../api/mailApplication/mailApplication.model');db['MailQueueReport']=db['sequelize'][_0x9b26('0x17')](_0x9b26('0x4b'));db['Dashboard']=db[_0x9b26('0x1')][_0x9b26('0x17')]('../api/dashboard/dashboard.model');db[_0x9b26('0x4c')]=db[_0x9b26('0x1')]['import'](_0x9b26('0x4d'));db[_0x9b26('0x4e')]=db['sequelize'][_0x9b26('0x17')](_0x9b26('0x4f'));db[_0x9b26('0x50')]=db[_0x9b26('0x1')][_0x9b26('0x17')]('../api/faxApplication/faxApplication.model');db['FaxInteraction']=db[_0x9b26('0x1')]['import'](_0x9b26('0x51'));db[_0x9b26('0x52')]=db['sequelize'][_0x9b26('0x17')]('../api/faxMessage/faxMessage.model');db[_0x9b26('0x53')]=db[_0x9b26('0x1')][_0x9b26('0x17')](_0x9b26('0x54'));db['FaxQueueReport']=db[_0x9b26('0x1')][_0x9b26('0x17')](_0x9b26('0x55'));db[_0x9b26('0x56')]=db[_0x9b26('0x1')]['import']('../api/smsAccount/smsAccount.model');db['SmsApplication']=db[_0x9b26('0x1')][_0x9b26('0x17')]('../api/smsApplication/smsApplication.model');db[_0x9b26('0x57')]=db[_0x9b26('0x1')][_0x9b26('0x17')](_0x9b26('0x58'));db[_0x9b26('0x59')]=db[_0x9b26('0x1')][_0x9b26('0x17')](_0x9b26('0x5a'));db[_0x9b26('0x5b')]=db[_0x9b26('0x1')][_0x9b26('0x17')](_0x9b26('0x5c'));db['OpenchannelAccount']=db[_0x9b26('0x1')][_0x9b26('0x17')](_0x9b26('0x5d'));db[_0x9b26('0x5e')]=db['sequelize'][_0x9b26('0x17')]('../api/openchannelApplication/openchannelApplication.model');db['OpenchannelInteraction']=db[_0x9b26('0x1')][_0x9b26('0x17')](_0x9b26('0x5f'));db[_0x9b26('0x60')]=db[_0x9b26('0x1')][_0x9b26('0x17')]('../api/openchannelMessage/openchannelMessage.model');db[_0x9b26('0x61')]=db[_0x9b26('0x1')][_0x9b26('0x17')]('../api/openchannelQueue/openchannelQueue.model');db[_0x9b26('0x62')]=db[_0x9b26('0x1')][_0x9b26('0x17')](_0x9b26('0x63'));db['OpenchannelQueueReport']=db['sequelize'][_0x9b26('0x17')]('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0x9b26('0x64')]=db[_0x9b26('0x1')]['import'](_0x9b26('0x65'));db['ChatInteraction']=db[_0x9b26('0x1')][_0x9b26('0x17')]('../api/chatInteraction/chatInteraction.model');db[_0x9b26('0x66')]=db[_0x9b26('0x1')]['import'](_0x9b26('0x67'));db[_0x9b26('0x68')]=db[_0x9b26('0x1')][_0x9b26('0x17')](_0x9b26('0x69'));db[_0x9b26('0x6a')]=db[_0x9b26('0x1')][_0x9b26('0x17')](_0x9b26('0x6b'));db[_0x9b26('0x6c')]=db['sequelize'][_0x9b26('0x17')](_0x9b26('0x6d'));db[_0x9b26('0x6e')]=db[_0x9b26('0x1')][_0x9b26('0x17')](_0x9b26('0x6f'));db[_0x9b26('0x70')]=db[_0x9b26('0x1')][_0x9b26('0x17')]('../api/cmCompany/cmCompany.model');db['CmContact']=db[_0x9b26('0x1')][_0x9b26('0x17')]('../api/cmContact/cmContact.model');db[_0x9b26('0x71')]=db[_0x9b26('0x1')][_0x9b26('0x17')](_0x9b26('0x72'));db[_0x9b26('0x73')]=db[_0x9b26('0x1')][_0x9b26('0x17')](_0x9b26('0x74'));db[_0x9b26('0x75')]=db[_0x9b26('0x1')][_0x9b26('0x17')](_0x9b26('0x76'));db[_0x9b26('0x77')]=db[_0x9b26('0x1')][_0x9b26('0x17')](_0x9b26('0x78'));db[_0x9b26('0x79')]=db[_0x9b26('0x1')][_0x9b26('0x17')](_0x9b26('0x7a'));db[_0x9b26('0x7b')]=db[_0x9b26('0x1')][_0x9b26('0x17')](_0x9b26('0x7c'));db['Action']=db[_0x9b26('0x1')][_0x9b26('0x17')](_0x9b26('0x7d'));db[_0x9b26('0x7e')]=db[_0x9b26('0x1')]['import'](_0x9b26('0x7f'));db[_0x9b26('0x80')]=db[_0x9b26('0x1')][_0x9b26('0x17')](_0x9b26('0x81'));db[_0x9b26('0x82')]=db[_0x9b26('0x1')][_0x9b26('0x17')](_0x9b26('0x83'));db['Condition']=db[_0x9b26('0x1')]['import'](_0x9b26('0x84'));db[_0x9b26('0x85')]=db['sequelize']['import'](_0x9b26('0x86'));db[_0x9b26('0x87')]=db[_0x9b26('0x1')][_0x9b26('0x17')]('../api/pause/pause.model');db[_0x9b26('0x88')]=db[_0x9b26('0x1')][_0x9b26('0x17')](_0x9b26('0x89'));db[_0x9b26('0x8a')]=db['sequelize'][_0x9b26('0x17')](_0x9b26('0x8b'));db['Schedule']=db[_0x9b26('0x1')][_0x9b26('0x17')]('../api/schedule/schedule.model');db[_0x9b26('0x8c')]=db[_0x9b26('0x1')]['import']('../api/sound/sound.model');db[_0x9b26('0x8d')]=db[_0x9b26('0x1')][_0x9b26('0x17')](_0x9b26('0x8e'));db[_0x9b26('0x8f')]=db['sequelize'][_0x9b26('0x17')](_0x9b26('0x90'));db['CmContactHasItem']=db[_0x9b26('0x1')][_0x9b26('0x17')](_0x9b26('0x91'));db[_0x9b26('0x92')]=db[_0x9b26('0x1')][_0x9b26('0x17')]('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model');db[_0x9b26('0x93')]=db[_0x9b26('0x1')][_0x9b26('0x17')](_0x9b26('0x94'));db[_0x9b26('0x95')]=db[_0x9b26('0x1')][_0x9b26('0x17')](_0x9b26('0x96'));db['Variable']=db[_0x9b26('0x1')][_0x9b26('0x17')](_0x9b26('0x97'));db['Integration']=db['sequelize'][_0x9b26('0x17')](_0x9b26('0x98'));db['IntegrationReport']=db[_0x9b26('0x1')][_0x9b26('0x17')](_0x9b26('0x99'));db[_0x9b26('0x9a')]=db[_0x9b26('0x1')][_0x9b26('0x17')](_0x9b26('0x9b'));db['AnalyticDefaultReport']=db['sequelize'][_0x9b26('0x17')](_0x9b26('0x9c'));db[_0x9b26('0x9d')]=db[_0x9b26('0x1')][_0x9b26('0x17')]('../api/analyticExtractedReport/analyticExtractedReport.model');db['AnalyticMetric']=db[_0x9b26('0x1')]['import']('../api/analyticMetric/analyticMetric.model');db[_0x9b26('0x9e')]=db[_0x9b26('0x1')][_0x9b26('0x17')](_0x9b26('0x9f'));db[_0x9b26('0xa0')]=db[_0x9b26('0x1')]['import']('../api/analyticTreeReport/analyticTreeReport.model');db[_0x9b26('0xa1')]=db[_0x9b26('0x1')][_0x9b26('0x17')](_0x9b26('0xa2'));db[_0x9b26('0xa3')]=db['sequelize'][_0x9b26('0x17')]('../api/intSalesforceConfiguration/intSalesforceConfiguration.model');db[_0x9b26('0xa4')]=db[_0x9b26('0x1')]['import']('../api/intSalesforceField/intSalesforceField.model');db[_0x9b26('0xa5')]=db['sequelize'][_0x9b26('0x17')]('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0x9b26('0xa6')]=db[_0x9b26('0x1')][_0x9b26('0x17')]('../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model');db[_0x9b26('0xa7')]=db['sequelize'][_0x9b26('0x17')](_0x9b26('0xa8'));db[_0x9b26('0xa9')]=db[_0x9b26('0x1')][_0x9b26('0x17')](_0x9b26('0xaa'));db['DeskConfiguration']=db[_0x9b26('0x1')][_0x9b26('0x17')]('../api/intDeskConfiguration/intDeskConfiguration.model');db[_0x9b26('0xab')]=db[_0x9b26('0x1')][_0x9b26('0x17')]('../api/intDeskField/intDeskField.model');db[_0x9b26('0xac')]=db[_0x9b26('0x1')][_0x9b26('0x17')](_0x9b26('0xad'));db['ZohoConfiguration']=db[_0x9b26('0x1')][_0x9b26('0x17')](_0x9b26('0xae'));db['ZohoField']=db[_0x9b26('0x1')][_0x9b26('0x17')]('../api/intZohoField/intZohoField.model');db[_0x9b26('0xaf')]=db[_0x9b26('0x1')]['import'](_0x9b26('0xb0'));db[_0x9b26('0xb1')]=db['sequelize'][_0x9b26('0x17')](_0x9b26('0xb2'));db[_0x9b26('0xb3')]=db[_0x9b26('0x1')][_0x9b26('0x17')]('../api/intZendeskField/intZendeskField.model');db[_0x9b26('0xb4')]=db[_0x9b26('0x1')][_0x9b26('0x17')](_0x9b26('0xb5'));db['FreshdeskConfiguration']=db['sequelize'][_0x9b26('0x17')](_0x9b26('0xb6'));db[_0x9b26('0xb7')]=db[_0x9b26('0x1')][_0x9b26('0x17')](_0x9b26('0xb8'));db[_0x9b26('0xb9')]=db['sequelize'][_0x9b26('0x17')](_0x9b26('0xba'));db[_0x9b26('0xbb')]=db[_0x9b26('0x1')][_0x9b26('0x17')](_0x9b26('0xbc'));db[_0x9b26('0xbd')]=db['sequelize'][_0x9b26('0x17')](_0x9b26('0xbe'));db['ServicenowAccount']=db[_0x9b26('0x1')][_0x9b26('0x17')](_0x9b26('0xbf'));db[_0x9b26('0xc0')]=db[_0x9b26('0x1')][_0x9b26('0x17')](_0x9b26('0xc1'));db['ServicenowField']=db[_0x9b26('0x1')][_0x9b26('0x17')](_0x9b26('0xc2'));db[_0x9b26('0xc3')]=db[_0x9b26('0x1')][_0x9b26('0x17')](_0x9b26('0xc4'));db[_0x9b26('0xc5')]=db[_0x9b26('0x1')][_0x9b26('0x17')](_0x9b26('0xc6'));db[_0x9b26('0xc7')]=db[_0x9b26('0x1')]['import'](_0x9b26('0xc8'));db[_0x9b26('0xc9')]=db['sequelize']['import']('../api/intFreshsalesAccount/intFreshsalesAccount.model');db['FreshsalesConfiguration']=db[_0x9b26('0x1')][_0x9b26('0x17')](_0x9b26('0xca'));db['FreshsalesField']=db[_0x9b26('0x1')][_0x9b26('0x17')](_0x9b26('0xcb'));db['Integration']=db['sequelize'][_0x9b26('0x17')]('../api/integration/integration.model');db[_0x9b26('0xcc')]=db[_0x9b26('0x1')][_0x9b26('0x17')]('../api/network/network.model');db[_0x9b26('0xcd')]=db['sequelize']['import'](_0x9b26('0xce'));db['ChatInternalMessage']=db[_0x9b26('0x1')][_0x9b26('0x17')]('../api/chatInternalMessage/chatInternalMessage.model');db[_0x9b26('0xcf')]=db[_0x9b26('0x1')][_0x9b26('0x17')](_0x9b26('0xd0'));db['JscriptyQuestionReport']=db[_0x9b26('0x1')][_0x9b26('0x17')](_0x9b26('0xd1'));db[_0x9b26('0xd2')]=db['sequelize'][_0x9b26('0x17')](_0x9b26('0xd3'));db['SmsQueueReport']=db[_0x9b26('0x1')][_0x9b26('0x17')]('../api/smsQueueReport/smsQueueReport.model');db[_0x9b26('0xd4')]=db[_0x9b26('0x1')][_0x9b26('0x17')](_0x9b26('0xd5'));db[_0x9b26('0xd6')]=db['sequelize'][_0x9b26('0x17')](_0x9b26('0xd7'));db[_0x9b26('0xd8')]=db[_0x9b26('0x1')][_0x9b26('0x17')]('../api/jscriptyProject/jscriptyProject.model');db[_0x9b26('0xd9')]=db['sequelize']['import'](_0x9b26('0xda'));db[_0x9b26('0xdb')]=db['sequelize']['import'](_0x9b26('0xdc'));db[_0x9b26('0xdd')]=db['sequelize'][_0x9b26('0x17')]('../api/squareProject/squareProject.model');db[_0x9b26('0xde')]=db[_0x9b26('0x1')][_0x9b26('0x17')]('../api/squareRecording/squareRecording.model');db[_0x9b26('0xdf')]=db[_0x9b26('0x1')][_0x9b26('0x17')]('../api/squareMessage/squareMessage.model');db[_0x9b26('0xe0')]=db[_0x9b26('0x1')][_0x9b26('0x17')](_0x9b26('0xe1'));db[_0x9b26('0xe2')]=db[_0x9b26('0x1')]['import'](_0x9b26('0xe3'));db['Campaign']=db[_0x9b26('0x1')]['import'](_0x9b26('0xe4'));db['Migration']=db[_0x9b26('0x1')][_0x9b26('0x17')](_0x9b26('0xe5'));db['Attachment']=db[_0x9b26('0x1')][_0x9b26('0x17')](_0x9b26('0xe6'));db[_0x9b26('0xe7')]=db[_0x9b26('0x1')]['import'](_0x9b26('0xe8'));db[_0x9b26('0xe9')]=db[_0x9b26('0x1')][_0x9b26('0x17')](_0x9b26('0xea'));db['ChatTransferReport']=db[_0x9b26('0x1')][_0x9b26('0x17')](_0x9b26('0xeb'));db[_0x9b26('0xec')]=db['sequelize'][_0x9b26('0x17')](_0x9b26('0xed'));db[_0x9b26('0xee')]=db[_0x9b26('0x1')][_0x9b26('0x17')](_0x9b26('0xef'));db[_0x9b26('0xf0')]=db['sequelize'][_0x9b26('0x17')]('../api/smsTransferReport/smsTransferReport.model');db['CmList']=db[_0x9b26('0x1')][_0x9b26('0x17')]('../api/cmList/cmList.model');db[_0x9b26('0xf1')]=db[_0x9b26('0x1')]['import'](_0x9b26('0xf2'));db[_0x9b26('0xf3')]=db['sequelize'][_0x9b26('0x17')]('../api/userProfile/userProfile.model');db[_0x9b26('0xf4')]=db['sequelize'][_0x9b26('0x17')](_0x9b26('0xf5'));db['UserProfileResource']=db[_0x9b26('0x1')][_0x9b26('0x17')]('../api/userProfileResource/userProfileResource.model');db[_0x9b26('0xf6')]=db['sequelize']['import']('../api/userNotification/userNotification.model');db[_0x9b26('0xf7')]=db[_0x9b26('0x1')]['import'](_0x9b26('0xf8'));db[_0x9b26('0xf9')]=db['sequelize'][_0x9b26('0x17')]('../api/whatsappApplication/whatsappApplication.model');db[_0x9b26('0xfa')]=db[_0x9b26('0x1')][_0x9b26('0x17')]('../api/whatsappInteraction/whatsappInteraction.model');db[_0x9b26('0xfb')]=db[_0x9b26('0x1')][_0x9b26('0x17')](_0x9b26('0xfc'));db[_0x9b26('0xfd')]=db[_0x9b26('0x1')][_0x9b26('0x17')](_0x9b26('0xfe'));db[_0x9b26('0xff')]=db[_0x9b26('0x1')]['import']('../api/whatsappTransferReport/whatsappTransferReport.model');db[_0x9b26('0x100')]=db[_0x9b26('0x1')][_0x9b26('0x17')](_0x9b26('0x101'));db['CloudProvider']=db[_0x9b26('0x1')][_0x9b26('0x17')]('../api/cloudProvider/cloudProvider.model');db[_0x9b26('0x102')]=db[_0x9b26('0x1')][_0x9b26('0x17')](_0x9b26('0x103'));db[_0x9b26('0x104')]=db[_0x9b26('0x1')]['import'](_0x9b26('0x105'));db[_0x9b26('0x106')]=db[_0x9b26('0x1')][_0x9b26('0x17')]('../api/userVoicePrefix/userVoicePrefix.model');db[_0x9b26('0x107')]=db['sequelize'][_0x9b26('0x17')](_0x9b26('0x108'));db[_0x9b26('0x109')]=db[_0x9b26('0x1')][_0x9b26('0x17')](_0x9b26('0x10a'));db[_0x9b26('0x14')][_0x9b26('0x10b')](db[_0x9b26('0x10c')],{'as':_0x9b26('0x10c'),'onDelete':_0x9b26('0x10d'),'foreignKey':_0x9b26('0x10e')});db['User']['hasOne'](db[_0x9b26('0x107')],{'as':_0x9b26('0x10f'),'onDelete':_0x9b26('0x10d'),'foreignKey':_0x9b26('0x10e')});db['User']['hasMany'](db[_0x9b26('0x110')],{'as':_0x9b26('0x111'),'foreignKey':_0x9b26('0x10e')});db[_0x9b26('0x14')][_0x9b26('0x112')](db[_0x9b26('0x30')],{'as':_0x9b26('0x113'),'foreignKey':_0x9b26('0x10e')});db['User'][_0x9b26('0x112')](db['VoiceExtension'],{'as':_0x9b26('0x114'),'onDelete':_0x9b26('0x10d'),'hooks':!![]});db['User'][_0x9b26('0x112')](db[_0x9b26('0x75')],{'as':_0x9b26('0x115'),'foreignKey':_0x9b26('0x10e')});db['User'][_0x9b26('0x112')](db[_0x9b26('0x77')],{'as':_0x9b26('0x116'),'foreignKey':_0x9b26('0x10e')});db['User'][_0x9b26('0x112')](db[_0x9b26('0x79')],{'as':'ReportAgentPreview','foreignKey':'UserId'});db[_0x9b26('0x14')][_0x9b26('0x112')](db['OpenchannelInteraction'],{'as':_0x9b26('0x117'),'foreignKey':_0x9b26('0x10e')});db[_0x9b26('0x14')][_0x9b26('0x112')](db[_0x9b26('0x118')],{'as':'ChatInteractions','foreignKey':_0x9b26('0x10e')});db[_0x9b26('0x14')][_0x9b26('0x112')](db[_0x9b26('0x57')],{'as':'SmsInteractions','foreignKey':_0x9b26('0x10e')});db[_0x9b26('0x14')][_0x9b26('0x112')](db['FaxInteraction'],{'as':_0x9b26('0x119'),'foreignKey':_0x9b26('0x10e')});db[_0x9b26('0x14')][_0x9b26('0x112')](db[_0x9b26('0x47')],{'as':_0x9b26('0x11a'),'foreignKey':_0x9b26('0x10e')});db[_0x9b26('0x14')][_0x9b26('0x112')](db[_0x9b26('0xfa')],{'as':_0x9b26('0x11b'),'foreignKey':_0x9b26('0x10e')});db[_0x9b26('0x14')][_0x9b26('0x112')](db[_0x9b26('0xf6')],{'as':_0x9b26('0x11c'),'foreignKey':'SenderId'});db['User'][_0x9b26('0x112')](db[_0x9b26('0x71')],{'as':_0x9b26('0x11d'),'foreignKey':_0x9b26('0x10e'),'onDelete':'SET\x20NULL'});db[_0x9b26('0x14')][_0x9b26('0x11e')](db['UserProfile'],{'as':_0x9b26('0xf3'),'foreignKey':_0x9b26('0x11f')});db['User'][_0x9b26('0x120')](db['ChatGroup'],{'as':'Groups','through':_0x9b26('0x121')});db[_0x9b26('0x14')][_0x9b26('0x120')](db[_0x9b26('0x122')],{'as':_0x9b26('0x123'),'through':_0x9b26('0x124')});db[_0x9b26('0x14')][_0x9b26('0x120')](db[_0x9b26('0x125')],{'as':_0x9b26('0x126'),'through':_0x9b26('0x127')});db[_0x9b26('0x14')]['belongsToMany'](db[_0x9b26('0xe0')],{'through':_0x9b26('0x128')});db[_0x9b26('0x14')][_0x9b26('0x120')](db['MailInteraction'],{'as':_0x9b26('0x11a'),'through':_0x9b26('0x129')});db[_0x9b26('0x14')]['belongsToMany'](db['ChatInteraction'],{'as':_0x9b26('0x12a'),'through':_0x9b26('0x12b')});db['User'][_0x9b26('0x120')](db['FaxInteraction'],{'as':_0x9b26('0x119'),'through':_0x9b26('0x12c')});db[_0x9b26('0x14')][_0x9b26('0x120')](db[_0x9b26('0x57')],{'as':'SmsInteractions','through':'user_has_sms_interactions'});db[_0x9b26('0x14')][_0x9b26('0x120')](db[_0x9b26('0x12d')],{'as':_0x9b26('0x117'),'through':_0x9b26('0x12e')});db[_0x9b26('0x14')][_0x9b26('0x120')](db['WhatsappInteraction'],{'as':_0x9b26('0x11b'),'through':_0x9b26('0x12f')});db['User'][_0x9b26('0x120')](db[_0x9b26('0x1e')],{'as':'VoiceQueues','through':_0x9b26('0x130'),'required':![]});db['User'][_0x9b26('0x120')](db[_0x9b26('0xf1')],{'as':_0x9b26('0x131'),'through':_0x9b26('0x106'),'required':![]});db[_0x9b26('0x14')]['belongsToMany'](db[_0x9b26('0x44')],{'as':_0x9b26('0x132'),'through':'UserMailQueue','required':![]});db['User'][_0x9b26('0x120')](db[_0x9b26('0x6a')],{'as':_0x9b26('0x133'),'through':_0x9b26('0x33'),'required':![],'hooks':!![]});db[_0x9b26('0x14')][_0x9b26('0x120')](db['FaxQueue'],{'as':_0x9b26('0x134'),'through':_0x9b26('0x37'),'required':![]});db[_0x9b26('0x14')][_0x9b26('0x120')](db[_0x9b26('0x5b')],{'as':'SmsQueues','through':_0x9b26('0x38'),'required':![]});db['User']['belongsToMany'](db[_0x9b26('0x61')],{'as':_0x9b26('0x135'),'through':_0x9b26('0x3a'),'required':![]});db[_0x9b26('0x14')]['belongsToMany'](db[_0x9b26('0x100')],{'as':_0x9b26('0x136'),'through':_0x9b26('0x3c'),'required':![]});db[_0x9b26('0x14')][_0x9b26('0x120')](db[_0x9b26('0x125')],{'through':_0x9b26('0x127')});db[_0x9b26('0x14')][_0x9b26('0x120')](db[_0x9b26('0x62')],{'as':_0x9b26('0x137'),'through':_0x9b26('0x138')});db[_0x9b26('0x14')][_0x9b26('0x120')](db['FaxAccount'],{'as':_0x9b26('0x139'),'through':_0x9b26('0x13a')});db[_0x9b26('0x14')]['belongsToMany'](db[_0x9b26('0x42')],{'as':_0x9b26('0x13b'),'through':'user_has_mail_accounts'});db[_0x9b26('0x14')][_0x9b26('0x120')](db[_0x9b26('0x13c')],{'as':_0x9b26('0x13d'),'through':'user_has_openchannel_accounts'});db['User'][_0x9b26('0x120')](db[_0x9b26('0x56')],{'as':_0x9b26('0x13e'),'through':_0x9b26('0x13f')});db['User'][_0x9b26('0x120')](db[_0x9b26('0xf7')],{'as':_0x9b26('0x140'),'through':_0x9b26('0x141')});db[_0x9b26('0x16')][_0x9b26('0x112')](db['VoiceExtension'],{'as':'SpiedAgents','onDelete':'cascade','foreignKey':'ChanSpyId'});db[_0x9b26('0x19')]['hasMany'](db[_0x9b26('0x1b')],{'onDelete':'cascade'});db[_0x9b26('0x1b')][_0x9b26('0x112')](db[_0x9b26('0x1b')],{'as':_0x9b26('0x142'),'onDelete':_0x9b26('0x10d')});db['VoiceMusicOnHold'][_0x9b26('0x120')](db['Sound'],{'as':_0x9b26('0x143'),'through':_0x9b26('0x144')});db['VoiceQueue'][_0x9b26('0x112')](db[_0x9b26('0x30')],{'as':'Members','foreignKey':_0x9b26('0x145')});db['VoiceQueue']['hasMany'](db[_0x9b26('0x71')],{'as':'Hoppers','foreignKey':_0x9b26('0x145')});db[_0x9b26('0x1e')][_0x9b26('0x112')](db[_0x9b26('0x75')],{'as':_0x9b26('0x115'),'foreignKey':_0x9b26('0x145')});db[_0x9b26('0x1e')][_0x9b26('0x112')](db[_0x9b26('0x77')],{'as':_0x9b26('0x146'),'foreignKey':_0x9b26('0x145')});db['VoiceQueue'][_0x9b26('0x112')](db[_0x9b26('0x79')],{'as':_0x9b26('0x79'),'foreignKey':_0x9b26('0x145')});db['VoiceQueue'][_0x9b26('0x112')](db[_0x9b26('0x73')],{'as':_0x9b26('0x147'),'foreignKey':_0x9b26('0x145')});db[_0x9b26('0x1e')][_0x9b26('0x112')](db['JscriptySessionReport'],{'as':'JscriptySessions','foreignKey':_0x9b26('0x145')});db[_0x9b26('0x1e')][_0x9b26('0x11e')](db['Trunk'],{'as':_0x9b26('0x2d'),'foreignKey':_0x9b26('0x148')});db['VoiceQueue'][_0x9b26('0x11e')](db[_0x9b26('0x2d')],{'as':'TrunkBackup','foreignKey':_0x9b26('0x149')});db[_0x9b26('0x1e')][_0x9b26('0x11e')](db['Interval'],{'as':_0x9b26('0x85'),'foreignKey':_0x9b26('0x14a')});db[_0x9b26('0x1e')][_0x9b26('0x11e')](db[_0x9b26('0x87')],{'as':_0x9b26('0x14b'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x9b26('0x1e')]['belongsToMany'](db['CmList'],{'as':_0x9b26('0x126'),'through':_0x9b26('0x14c')});db['VoiceQueue'][_0x9b26('0x120')](db[_0x9b26('0x14')],{'as':_0x9b26('0x14d'),'through':_0x9b26('0x130')});db[_0x9b26('0x1e')][_0x9b26('0x120')](db[_0x9b26('0xe0')],{'as':_0x9b26('0x14e'),'through':_0x9b26('0x102')});db[_0x9b26('0x1e')][_0x9b26('0x120')](db[_0x9b26('0x125')],{'as':_0x9b26('0x14f'),'through':'voice_queues_has_cm_blacklists'});db[_0x9b26('0x110')]['belongsTo'](db[_0x9b26('0x14')],{'as':_0x9b26('0x14'),'foreignKey':_0x9b26('0x10e')});db[_0x9b26('0x20')]['belongsTo'](db[_0x9b26('0x14')],{'as':_0x9b26('0x14'),'foreignKey':'UserId'});db['VoiceMail'][_0x9b26('0x112')](db[_0x9b26('0x22')],{'as':_0x9b26('0x150'),'onDelete':_0x9b26('0x10d'),'foreignKey':_0x9b26('0x151'),'sourceKey':_0x9b26('0x152')});db['VoiceMailMessage']['belongsTo'](db[_0x9b26('0x10c')],{'foreignKey':_0x9b26('0x151'),'targetKey':'mailbox'});db[_0x9b26('0x24')][_0x9b26('0x112')](db[_0x9b26('0x29')],{'as':_0x9b26('0x153'),'foreignKey':_0x9b26('0x154'),'constraints':![]});db[_0x9b26('0x24')][_0x9b26('0x112')](db[_0x9b26('0x27')],{'as':'AgentReports','foreignKey':_0x9b26('0x154'),'constraints':![]});db[_0x9b26('0x24')][_0x9b26('0x11e')](db['User'],{'as':_0x9b26('0x14'),'foreignKey':_0x9b26('0x10e')});db['VoiceCallReport'][_0x9b26('0x11e')](db[_0x9b26('0x122')],{'as':_0x9b26('0x155'),'foreignKey':_0x9b26('0x156')});db[_0x9b26('0x3e')][_0x9b26('0x11e')](db[_0x9b26('0x42')],{'as':_0x9b26('0x42'),'foreignKey':_0x9b26('0x157')});db['MailServerIn'][_0x9b26('0x11e')](db['CloudProvider'],{'as':'CloudProvider','foreignKey':_0x9b26('0x158'),'onDelete':'restrict'});db['MailServerOut'][_0x9b26('0x11e')](db[_0x9b26('0x42')],{'as':'MailAccount','foreignKey':_0x9b26('0x157')});db[_0x9b26('0x40')][_0x9b26('0x11e')](db[_0x9b26('0x159')],{'as':_0x9b26('0x159'),'foreignKey':_0x9b26('0x158'),'onDelete':_0x9b26('0x15a')});db[_0x9b26('0x42')]['hasOne'](db[_0x9b26('0x3e')],{'as':_0x9b26('0x15b'),'onDelete':_0x9b26('0x10d')});db[_0x9b26('0x42')][_0x9b26('0x10b')](db[_0x9b26('0x40')],{'as':_0x9b26('0x15c'),'onDelete':_0x9b26('0x10d')});db[_0x9b26('0x42')][_0x9b26('0x112')](db[_0x9b26('0x82')],{'as':_0x9b26('0x15d'),'foreignKey':'MailAccountId','onDelete':'cascade'});db[_0x9b26('0x42')][_0x9b26('0x112')](db['CannedAnswer'],{'as':'Answers','foreignKey':_0x9b26('0x157')});db[_0x9b26('0x42')][_0x9b26('0x112')](db['MailMessage'],{'as':_0x9b26('0x150'),'foreignKey':_0x9b26('0x157')});db[_0x9b26('0x42')][_0x9b26('0x112')](db[_0x9b26('0x47')],{'as':_0x9b26('0x15e')});db[_0x9b26('0x42')]['hasMany'](db['MailApplication'],{'as':_0x9b26('0x142'),'foreignKey':_0x9b26('0x157'),'onDelete':_0x9b26('0x10d')});db[_0x9b26('0x42')][_0x9b26('0x11e')](db[_0x9b26('0x125')],{'as':_0x9b26('0x15f'),'foreignKey':_0x9b26('0x160')});db[_0x9b26('0x42')][_0x9b26('0x11e')](db[_0x9b26('0x93')],{'as':_0x9b26('0x93'),'foreignKey':_0x9b26('0x161')});db['MailAccount'][_0x9b26('0x11e')](db[_0x9b26('0x87')],{'as':_0x9b26('0x14b'),'foreignKey':_0x9b26('0x162')});db[_0x9b26('0x42')][_0x9b26('0x120')](db[_0x9b26('0x14')],{'as':_0x9b26('0x14d'),'through':'user_has_mail_accounts'});db['MailQueue'][_0x9b26('0x120')](db[_0x9b26('0x14')],{'as':_0x9b26('0x14d'),'through':_0x9b26('0x35')});db[_0x9b26('0x44')][_0x9b26('0x120')](db[_0x9b26('0xe0')],{'through':_0x9b26('0x163'),'as':'Teams'});db['MailInteraction'][_0x9b26('0x112')](db['MailMessage'],{'as':'Messages','onDelete':'cascade','foreignKey':_0x9b26('0x164')});db[_0x9b26('0x47')][_0x9b26('0x11e')](db[_0x9b26('0x42')],{'as':_0x9b26('0x165'),'foreignKey':_0x9b26('0x157')});db[_0x9b26('0x47')][_0x9b26('0x11e')](db[_0x9b26('0x122')],{'as':'Contact','foreignKey':'ContactId'});db['MailInteraction'][_0x9b26('0x11e')](db[_0x9b26('0x14')],{'as':_0x9b26('0x166'),'foreignKey':_0x9b26('0x10e')});db[_0x9b26('0x47')][_0x9b26('0x120')](db[_0x9b26('0x8d')],{'through':_0x9b26('0x167'),'as':_0x9b26('0x168')});db[_0x9b26('0x47')]['belongsToMany'](db[_0x9b26('0x8d')],{'through':_0x9b26('0x167'),'as':'ThroughTags'});db[_0x9b26('0x47')]['belongsToMany'](db[_0x9b26('0x14')],{'as':'Users','through':_0x9b26('0x129'),'foreignKey':_0x9b26('0x164')});db[_0x9b26('0x48')][_0x9b26('0x112')](db['Attachment'],{'as':_0x9b26('0x169'),'onDelete':'cascade'});db[_0x9b26('0x48')][_0x9b26('0x11e')](db[_0x9b26('0x14')],{'as':_0x9b26('0x14')});db[_0x9b26('0x48')][_0x9b26('0x11e')](db[_0x9b26('0x122')],{'onDelete':_0x9b26('0x10d'),'as':'Contact'});db[_0x9b26('0x48')][_0x9b26('0x11e')](db[_0x9b26('0x47')],{'as':_0x9b26('0x16a'),'foreignKey':'MailInteractionId'});db[_0x9b26('0x48')]['belongsTo'](db[_0x9b26('0x42')],{'as':_0x9b26('0x165'),'foreignKey':_0x9b26('0x157')});db[_0x9b26('0x48')][_0x9b26('0x11e')](db[_0x9b26('0x62')],{'as':_0x9b26('0x62'),'foreignKey':_0x9b26('0x16b')});db[_0x9b26('0x48')][_0x9b26('0x11e')](db[_0x9b26('0x68')],{'as':_0x9b26('0x68'),'foreignKey':_0x9b26('0x16c')});db[_0x9b26('0x4a')]['belongsTo'](db['User'],{'onDelete':_0x9b26('0x15a')});db['MailApplication'][_0x9b26('0x11e')](db[_0x9b26('0x44')],{'onDelete':_0x9b26('0x15a')});db[_0x9b26('0x4a')][_0x9b26('0x11e')](db[_0x9b26('0x42')],{'onDelete':_0x9b26('0x15a')});db[_0x9b26('0x4a')][_0x9b26('0x11e')](db[_0x9b26('0x85')],{'onDelete':'restrict','foreignKey':_0x9b26('0x14a')});db['MailApplication'][_0x9b26('0x11e')](db[_0x9b26('0x8d')],{'onDelete':'restrict','foreignKey':_0x9b26('0x16d')});db[_0x9b26('0x16e')][_0x9b26('0x11e')](db[_0x9b26('0x42')],{});db[_0x9b26('0x16e')]['belongsTo'](db[_0x9b26('0x125')],{'as':_0x9b26('0x15f'),'foreignKey':_0x9b26('0x160')});db[_0x9b26('0x16e')][_0x9b26('0x11e')](db[_0x9b26('0x122')],{'as':_0x9b26('0x155'),'foreignKey':_0x9b26('0x156')});db['MailQueueReport']['belongsTo'](db['MailInteraction'],{});db['MailQueueReport'][_0x9b26('0x11e')](db[_0x9b26('0x48')],{});db[_0x9b26('0x16e')][_0x9b26('0x11e')](db[_0x9b26('0x14')],{});db['MailQueueReport'][_0x9b26('0x11e')](db['MailQueue'],{});db['Dashboard'][_0x9b26('0x112')](db[_0x9b26('0x4c')],{'as':_0x9b26('0x16f'),'onDelete':'cascade'});db[_0x9b26('0x4e')][_0x9b26('0x112')](db['Disposition'],{'as':_0x9b26('0x15d'),'foreignKey':'FaxAccountId','onDelete':_0x9b26('0x10d')});db[_0x9b26('0x4e')][_0x9b26('0x112')](db[_0x9b26('0x80')],{'as':_0x9b26('0x170'),'foreignKey':_0x9b26('0x171')});db[_0x9b26('0x4e')][_0x9b26('0x112')](db[_0x9b26('0x172')],{'as':_0x9b26('0x15e')});db[_0x9b26('0x4e')][_0x9b26('0x112')](db[_0x9b26('0x50')],{'as':'Applications','foreignKey':_0x9b26('0x171'),'onDelete':_0x9b26('0x10d')});db[_0x9b26('0x4e')][_0x9b26('0x112')](db[_0x9b26('0x1b')],{'as':_0x9b26('0x173'),'onDelete':_0x9b26('0x10d')});db[_0x9b26('0x4e')]['hasMany'](db[_0x9b26('0x52')],{'as':'Messages'});db[_0x9b26('0x4e')][_0x9b26('0x11e')](db[_0x9b26('0x2d')],{'as':_0x9b26('0x2d')});db[_0x9b26('0x4e')][_0x9b26('0x11e')](db[_0x9b26('0x125')],{'as':_0x9b26('0x15f'),'foreignKey':'ListId'});db['FaxAccount'][_0x9b26('0x11e')](db[_0x9b26('0x87')],{'as':_0x9b26('0x14b'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x9b26('0x4e')][_0x9b26('0x120')](db[_0x9b26('0x14')],{'as':_0x9b26('0x14d'),'through':_0x9b26('0x13a')});db[_0x9b26('0x50')][_0x9b26('0x11e')](db[_0x9b26('0x14')],{'onDelete':'restrict'});db[_0x9b26('0x50')][_0x9b26('0x11e')](db[_0x9b26('0x53')],{'onDelete':'restrict'});db['FaxApplication'][_0x9b26('0x11e')](db['FaxAccount'],{'onDelete':_0x9b26('0x15a')});db[_0x9b26('0x50')][_0x9b26('0x11e')](db[_0x9b26('0x8d')],{'onDelete':'restrict','foreignKey':'TagId'});db['FaxInteraction'][_0x9b26('0x112')](db[_0x9b26('0x52')],{'as':_0x9b26('0x150'),'onDelete':_0x9b26('0x10d'),'foreignKey':_0x9b26('0x174')});db['FaxInteraction'][_0x9b26('0x11e')](db[_0x9b26('0x4e')],{'as':_0x9b26('0x165'),'foreignKey':_0x9b26('0x171')});db[_0x9b26('0x172')]['belongsTo'](db[_0x9b26('0x122')],{'as':_0x9b26('0x155'),'foreignKey':'ContactId'});db[_0x9b26('0x172')]['belongsTo'](db[_0x9b26('0x14')],{'as':_0x9b26('0x166'),'foreignKey':_0x9b26('0x10e')});db['FaxInteraction'][_0x9b26('0x120')](db[_0x9b26('0x8d')],{'through':_0x9b26('0x175'),'as':_0x9b26('0x168')});db[_0x9b26('0x172')]['belongsToMany'](db[_0x9b26('0x8d')],{'through':_0x9b26('0x175'),'as':'ThroughTags'});db[_0x9b26('0x172')]['belongsToMany'](db[_0x9b26('0x14')],{'as':_0x9b26('0x176'),'through':_0x9b26('0x12c'),'foreignKey':_0x9b26('0x174')});db[_0x9b26('0x52')]['belongsTo'](db[_0x9b26('0x14')],{'onDelete':_0x9b26('0x10d'),'as':_0x9b26('0x14')});db[_0x9b26('0x52')]['belongsTo'](db[_0x9b26('0x172')],{'as':_0x9b26('0x16a'),'foreignKey':'FaxInteractionId'});db[_0x9b26('0x52')][_0x9b26('0x11e')](db['CmContact'],{'onDelete':_0x9b26('0x10d'),'as':_0x9b26('0x155')});db[_0x9b26('0x52')][_0x9b26('0x11e')](db['Attachment'],{'as':_0x9b26('0x177'),'foreignKey':_0x9b26('0x178')});db['FaxMessage'][_0x9b26('0x11e')](db['FaxAccount'],{'as':_0x9b26('0x165'),'foreignKey':_0x9b26('0x171')});db['FaxQueue'][_0x9b26('0x120')](db[_0x9b26('0x14')],{'as':_0x9b26('0x14d'),'through':'UserFaxQueue'});db[_0x9b26('0x53')][_0x9b26('0x120')](db[_0x9b26('0xe0')],{'through':_0x9b26('0x179'),'as':_0x9b26('0x14e')});db[_0x9b26('0x17a')][_0x9b26('0x11e')](db[_0x9b26('0x4e')],{});db[_0x9b26('0x17a')][_0x9b26('0x11e')](db[_0x9b26('0x125')],{'as':'List','foreignKey':_0x9b26('0x160')});db[_0x9b26('0x17a')][_0x9b26('0x11e')](db[_0x9b26('0x122')],{'as':_0x9b26('0x155'),'foreignKey':_0x9b26('0x156')});db[_0x9b26('0x17a')][_0x9b26('0x11e')](db[_0x9b26('0x172')],{});db['FaxQueueReport'][_0x9b26('0x11e')](db[_0x9b26('0x52')],{});db[_0x9b26('0x17a')][_0x9b26('0x11e')](db[_0x9b26('0x14')],{});db['FaxQueueReport'][_0x9b26('0x11e')](db[_0x9b26('0x53')],{});db[_0x9b26('0x56')]['hasMany'](db[_0x9b26('0x82')],{'as':_0x9b26('0x15d'),'foreignKey':_0x9b26('0x17b'),'onDelete':_0x9b26('0x10d')});db[_0x9b26('0x56')][_0x9b26('0x112')](db[_0x9b26('0x80')],{'as':_0x9b26('0x170'),'foreignKey':_0x9b26('0x17b')});db['SmsAccount'][_0x9b26('0x112')](db[_0x9b26('0x59')],{'as':_0x9b26('0x150'),'foreignKey':_0x9b26('0x17b')});db[_0x9b26('0x56')]['hasMany'](db[_0x9b26('0x57')],{'as':_0x9b26('0x15e')});db[_0x9b26('0x56')][_0x9b26('0x112')](db[_0x9b26('0x17c')],{'as':_0x9b26('0x142'),'foreignKey':_0x9b26('0x17b'),'onDelete':_0x9b26('0x10d')});db[_0x9b26('0x56')][_0x9b26('0x11e')](db['CmList'],{'as':_0x9b26('0x15f'),'foreignKey':_0x9b26('0x160')});db[_0x9b26('0x56')][_0x9b26('0x11e')](db[_0x9b26('0x87')],{'as':'mandatoryDispositionPause','foreignKey':_0x9b26('0x162')});db[_0x9b26('0x56')][_0x9b26('0x120')](db[_0x9b26('0x14')],{'as':_0x9b26('0x14d'),'through':_0x9b26('0x13f')});db[_0x9b26('0x17c')]['belongsTo'](db[_0x9b26('0x14')],{'onDelete':'restrict'});db[_0x9b26('0x17c')][_0x9b26('0x11e')](db['SmsQueue'],{'onDelete':_0x9b26('0x15a')});db[_0x9b26('0x17c')][_0x9b26('0x11e')](db['SmsAccount'],{'onDelete':_0x9b26('0x15a')});db[_0x9b26('0x17c')]['belongsTo'](db[_0x9b26('0x85')],{'onDelete':_0x9b26('0x15a'),'foreignKey':_0x9b26('0x14a')});db['SmsApplication']['belongsTo'](db[_0x9b26('0x8d')],{'onDelete':_0x9b26('0x15a'),'foreignKey':'TagId'});db['SmsInteraction'][_0x9b26('0x112')](db[_0x9b26('0x59')],{'as':_0x9b26('0x150'),'onDelete':_0x9b26('0x10d'),'foreignKey':_0x9b26('0x17d')});db['SmsInteraction'][_0x9b26('0x11e')](db[_0x9b26('0x56')],{'as':_0x9b26('0x165'),'foreignKey':_0x9b26('0x17b')});db['SmsInteraction'][_0x9b26('0x11e')](db['CmContact'],{'as':_0x9b26('0x155'),'foreignKey':_0x9b26('0x156')});db[_0x9b26('0x57')][_0x9b26('0x11e')](db[_0x9b26('0x14')],{'as':_0x9b26('0x166'),'foreignKey':'UserId'});db[_0x9b26('0x57')][_0x9b26('0x120')](db[_0x9b26('0x8d')],{'through':_0x9b26('0x17e'),'as':'Tags'});db[_0x9b26('0x57')][_0x9b26('0x120')](db['Tag'],{'through':'sms_interaction_has_tags','as':_0x9b26('0x17f')});db['SmsInteraction'][_0x9b26('0x120')](db[_0x9b26('0x14')],{'as':_0x9b26('0x176'),'through':'user_has_sms_interactions','foreignKey':_0x9b26('0x17d')});db['SmsMessage'][_0x9b26('0x11e')](db[_0x9b26('0x14')],{'as':'User'});db[_0x9b26('0x59')][_0x9b26('0x11e')](db['CmContact'],{'onDelete':_0x9b26('0x10d'),'as':_0x9b26('0x155')});db['SmsMessage'][_0x9b26('0x11e')](db['SmsInteraction'],{'onDelete':_0x9b26('0x10d'),'as':_0x9b26('0x16a'),'foreignKey':_0x9b26('0x17d')});db[_0x9b26('0x59')][_0x9b26('0x11e')](db[_0x9b26('0x56')],{'as':_0x9b26('0x165'),'foreignKey':_0x9b26('0x17b')});db[_0x9b26('0x5b')][_0x9b26('0x120')](db[_0x9b26('0x14')],{'as':_0x9b26('0x14d'),'through':_0x9b26('0x38'),'foreignKey':_0x9b26('0x180')});db[_0x9b26('0x5b')][_0x9b26('0x120')](db[_0x9b26('0xe0')],{'through':_0x9b26('0x181'),'as':'Teams'});db[_0x9b26('0x13c')]['hasMany'](db[_0x9b26('0x82')],{'as':_0x9b26('0x15d'),'foreignKey':_0x9b26('0x182'),'onDelete':'cascade'});db['OpenchannelAccount'][_0x9b26('0x112')](db[_0x9b26('0x80')],{'as':_0x9b26('0x170'),'foreignKey':_0x9b26('0x182')});db[_0x9b26('0x13c')][_0x9b26('0x112')](db[_0x9b26('0x12d')],{'as':_0x9b26('0x15e'),'foreignKey':'OpenchannelAccountId'});db[_0x9b26('0x13c')]['hasMany'](db[_0x9b26('0x60')],{'as':'Messages','foreignKey':_0x9b26('0x182')});db[_0x9b26('0x13c')][_0x9b26('0x112')](db[_0x9b26('0x5e')],{'as':_0x9b26('0x142'),'foreignKey':_0x9b26('0x182'),'onDelete':_0x9b26('0x10d')});db[_0x9b26('0x13c')][_0x9b26('0x11e')](db[_0x9b26('0x125')],{'as':'List','foreignKey':_0x9b26('0x160')});db['OpenchannelAccount'][_0x9b26('0x11e')](db[_0x9b26('0x87')],{'as':_0x9b26('0x14b'),'foreignKey':_0x9b26('0x162')});db[_0x9b26('0x13c')][_0x9b26('0x120')](db['User'],{'as':'Agents','through':_0x9b26('0x183')});db[_0x9b26('0x5e')][_0x9b26('0x11e')](db[_0x9b26('0x14')],{'onDelete':_0x9b26('0x15a')});db[_0x9b26('0x5e')]['belongsTo'](db[_0x9b26('0x61')],{'onDelete':_0x9b26('0x15a'),'foreignKey':_0x9b26('0x184')});db['OpenchannelApplication'][_0x9b26('0x11e')](db[_0x9b26('0x13c')],{'onDelete':'restrict','foreignKey':_0x9b26('0x182')});db['OpenchannelApplication']['belongsTo'](db[_0x9b26('0x85')],{'onDelete':_0x9b26('0x15a'),'foreignKey':_0x9b26('0x14a')});db['OpenchannelApplication']['belongsTo'](db[_0x9b26('0x8d')],{'onDelete':_0x9b26('0x15a'),'foreignKey':_0x9b26('0x16d')});db['OpenchannelInteraction'][_0x9b26('0x112')](db[_0x9b26('0x60')],{'as':'Messages','onDelete':'cascade','foreignKey':_0x9b26('0x185')});db['OpenchannelInteraction']['belongsTo'](db[_0x9b26('0x13c')],{'as':_0x9b26('0x165'),'foreignKey':'OpenchannelAccountId'});db[_0x9b26('0x12d')][_0x9b26('0x11e')](db['CmContact'],{'as':_0x9b26('0x155'),'foreignKey':_0x9b26('0x156')});db[_0x9b26('0x12d')]['belongsTo'](db['User'],{'as':'Owner','foreignKey':_0x9b26('0x10e')});db[_0x9b26('0x12d')]['belongsToMany'](db[_0x9b26('0x8d')],{'through':_0x9b26('0x186'),'as':_0x9b26('0x168')});db[_0x9b26('0x12d')][_0x9b26('0x120')](db[_0x9b26('0x8d')],{'through':_0x9b26('0x186'),'as':_0x9b26('0x17f')});db[_0x9b26('0x12d')][_0x9b26('0x120')](db[_0x9b26('0x14')],{'as':'Users','through':_0x9b26('0x12e'),'foreignKey':_0x9b26('0x185')});db[_0x9b26('0x60')][_0x9b26('0x11e')](db[_0x9b26('0x14')],{'onDelete':_0x9b26('0x10d'),'as':_0x9b26('0x14')});db['OpenchannelMessage'][_0x9b26('0x11e')](db[_0x9b26('0x122')],{'onDelete':_0x9b26('0x10d'),'as':_0x9b26('0x155')});db[_0x9b26('0x60')][_0x9b26('0x11e')](db[_0x9b26('0x12d')],{'onDelete':_0x9b26('0x10d'),'as':_0x9b26('0x16a'),'foreignKey':_0x9b26('0x185')});db[_0x9b26('0x60')][_0x9b26('0x11e')](db[_0x9b26('0x177')],{'as':_0x9b26('0x177'),'foreignKey':_0x9b26('0x178')});db[_0x9b26('0x60')]['belongsTo'](db[_0x9b26('0x13c')],{'as':'Account','foreignKey':_0x9b26('0x182')});db[_0x9b26('0x61')][_0x9b26('0x120')](db['User'],{'as':_0x9b26('0x14d'),'through':_0x9b26('0x3a'),'foreignKey':_0x9b26('0x184')});db[_0x9b26('0x61')][_0x9b26('0x120')](db[_0x9b26('0xe0')],{'through':_0x9b26('0x187'),'as':_0x9b26('0x14e')});db[_0x9b26('0x62')][_0x9b26('0x112')](db['Disposition'],{'as':_0x9b26('0x15d'),'foreignKey':_0x9b26('0x16b'),'onDelete':_0x9b26('0x10d')});db[_0x9b26('0x62')][_0x9b26('0x112')](db[_0x9b26('0x80')],{'as':_0x9b26('0x170'),'foreignKey':_0x9b26('0x16b')});db[_0x9b26('0x62')][_0x9b26('0x112')](db[_0x9b26('0x6e')],{'as':_0x9b26('0x188')});db[_0x9b26('0x62')][_0x9b26('0x112')](db['ChatInteraction'],{'as':_0x9b26('0x15e')});db[_0x9b26('0x62')][_0x9b26('0x112')](db['ChatApplication'],{'as':_0x9b26('0x142'),'foreignKey':'ChatWebsiteId','onDelete':_0x9b26('0x10d')});db[_0x9b26('0x62')][_0x9b26('0x112')](db[_0x9b26('0x66')],{'as':_0x9b26('0x150')});db['ChatWebsite'][_0x9b26('0x11e')](db[_0x9b26('0x125')],{'as':_0x9b26('0x15f'),'foreignKey':_0x9b26('0x160')});db[_0x9b26('0x62')][_0x9b26('0x11e')](db[_0x9b26('0x85')],{'as':_0x9b26('0x85'),'foreignKey':_0x9b26('0x14a')});db['ChatWebsite'][_0x9b26('0x11e')](db[_0x9b26('0x42')],{'as':_0x9b26('0x42'),'foreignKey':_0x9b26('0x157')});db['ChatWebsite'][_0x9b26('0x11e')](db[_0x9b26('0x87')],{'as':'mandatoryDispositionPause','foreignKey':_0x9b26('0x162')});db[_0x9b26('0x62')][_0x9b26('0x120')](db[_0x9b26('0x14')],{'as':_0x9b26('0x14d'),'through':_0x9b26('0x138')});db[_0x9b26('0x189')]['belongsTo'](db[_0x9b26('0x13c')],{});db[_0x9b26('0x189')][_0x9b26('0x11e')](db[_0x9b26('0x125')],{'as':_0x9b26('0x15f'),'foreignKey':_0x9b26('0x160')});db[_0x9b26('0x189')]['belongsTo'](db['CmContact'],{'as':_0x9b26('0x155'),'foreignKey':'ContactId'});db[_0x9b26('0x189')][_0x9b26('0x11e')](db['OpenchannelInteraction'],{});db[_0x9b26('0x189')][_0x9b26('0x11e')](db[_0x9b26('0x60')],{});db[_0x9b26('0x189')]['belongsTo'](db[_0x9b26('0x14')],{});db[_0x9b26('0x189')][_0x9b26('0x11e')](db[_0x9b26('0x61')],{});db['ChatApplication']['belongsTo'](db[_0x9b26('0x14')],{'as':_0x9b26('0x18a'),'foreignKey':'UserId','onDelete':_0x9b26('0x15a')});db[_0x9b26('0x64')][_0x9b26('0x11e')](db[_0x9b26('0x6a')],{'as':_0x9b26('0x18b'),'foreignKey':_0x9b26('0x18c'),'onDelete':_0x9b26('0x15a')});db[_0x9b26('0x64')][_0x9b26('0x11e')](db[_0x9b26('0x62')],{'as':_0x9b26('0x18d'),'foreignKey':'ChatWebsiteId','onDelete':_0x9b26('0x15a')});db[_0x9b26('0x64')][_0x9b26('0x11e')](db['Tag'],{'onDelete':_0x9b26('0x15a'),'foreignKey':_0x9b26('0x16d')});db[_0x9b26('0x118')][_0x9b26('0x112')](db[_0x9b26('0x66')],{'as':'Messages','onDelete':_0x9b26('0x10d'),'foreignKey':_0x9b26('0x18e')});db[_0x9b26('0x118')][_0x9b26('0x11e')](db[_0x9b26('0x62')],{'as':'Account','foreignKey':'ChatWebsiteId'});db[_0x9b26('0x118')]['belongsTo'](db[_0x9b26('0x122')],{'as':_0x9b26('0x155'),'foreignKey':_0x9b26('0x156')});db[_0x9b26('0x118')][_0x9b26('0x11e')](db['User'],{'as':_0x9b26('0x166'),'foreignKey':'UserId'});db[_0x9b26('0x118')]['belongsToMany'](db[_0x9b26('0x8d')],{'through':_0x9b26('0x18f'),'as':'Tags'});db[_0x9b26('0x118')]['belongsToMany'](db[_0x9b26('0x8d')],{'through':_0x9b26('0x18f'),'as':'ThroughTags'});db[_0x9b26('0x118')]['belongsToMany'](db[_0x9b26('0x14')],{'as':_0x9b26('0x176'),'through':'user_has_chat_interactions','foreignKey':_0x9b26('0x18e')});db[_0x9b26('0x66')][_0x9b26('0x11e')](db[_0x9b26('0x14')],{'onDelete':'cascade','as':'User'});db[_0x9b26('0x66')]['belongsTo'](db[_0x9b26('0x122')],{'onDelete':'cascade','as':_0x9b26('0x155'),'foreignKey':_0x9b26('0x156')});db[_0x9b26('0x66')]['belongsTo'](db[_0x9b26('0x118')],{'onDelete':_0x9b26('0x10d'),'as':_0x9b26('0x16a'),'foreignKey':_0x9b26('0x18e')});db[_0x9b26('0x66')][_0x9b26('0x11e')](db['Attachment'],{'as':'Attachment','foreignKey':'AttachmentId'});db[_0x9b26('0x66')][_0x9b26('0x11e')](db[_0x9b26('0x62')],{'as':'Account','foreignKey':'ChatWebsiteId'});db[_0x9b26('0x68')][_0x9b26('0x112')](db['Attachment'],{'as':_0x9b26('0x169'),'foreignKey':_0x9b26('0x16c'),'onDelete':_0x9b26('0x10d'),'hooks':!![]});db[_0x9b26('0x68')][_0x9b26('0x11e')](db[_0x9b26('0x122')],{'onDelete':_0x9b26('0x10d'),'as':'Contact','foreignKey':'ContactId'});db[_0x9b26('0x68')]['belongsTo'](db['ChatWebsite'],{'as':_0x9b26('0x165'),'foreignKey':_0x9b26('0x16b')});db['ChatQueue'][_0x9b26('0x120')](db['User'],{'as':_0x9b26('0x14d'),'through':_0x9b26('0x33'),'hooks':!![]});db['ChatQueue'][_0x9b26('0x120')](db[_0x9b26('0xe0')],{'through':'team_has_chat_queues','as':_0x9b26('0x14e')});db[_0x9b26('0x6c')][_0x9b26('0x112')](db[_0x9b26('0x190')],{'as':_0x9b26('0x150'),'foreignKey':'ChatGroupId','onDelete':_0x9b26('0x10d')});db[_0x9b26('0x6c')]['belongsToMany'](db[_0x9b26('0x14')],{'as':'Members','through':_0x9b26('0x121')});db['ChatProactiveAction'][_0x9b26('0x11e')](db[_0x9b26('0x62')],{'as':'Website','foreignKey':_0x9b26('0x16b')});db[_0x9b26('0x70')]['hasMany'](db[_0x9b26('0x122')],{'as':'Contacts','foreignKey':'CompanyId'});db[_0x9b26('0x122')][_0x9b26('0x112')](db[_0x9b26('0x191')],{'as':_0x9b26('0x192'),'foreignKey':_0x9b26('0x193')});db[_0x9b26('0x122')]['hasMany'](db[_0x9b26('0x71')],{'as':_0x9b26('0x11d'),'foreignKey':_0x9b26('0x156')});db[_0x9b26('0x122')][_0x9b26('0x112')](db[_0x9b26('0x75')],{'as':_0x9b26('0x115'),'foreignKey':_0x9b26('0x156')});db[_0x9b26('0x122')][_0x9b26('0x112')](db[_0x9b26('0x77')],{'as':_0x9b26('0x146'),'foreignKey':_0x9b26('0x156')});db[_0x9b26('0x122')][_0x9b26('0x112')](db[_0x9b26('0x79')],{'as':'ReportAgentPreview','foreignKey':_0x9b26('0x156')});db[_0x9b26('0x122')][_0x9b26('0x112')](db[_0x9b26('0xd2')],{'as':_0x9b26('0x194'),'foreignKey':_0x9b26('0x156')});db['CmContact'][_0x9b26('0x112')](db[_0x9b26('0x12d')],{'as':_0x9b26('0x117'),'foreignKey':_0x9b26('0x156'),'onDelete':'restrict'});db['CmContact']['hasMany'](db[_0x9b26('0x118')],{'as':_0x9b26('0x12a'),'foreignKey':'ContactId','onDelete':_0x9b26('0x15a')});db['CmContact'][_0x9b26('0x112')](db['SmsInteraction'],{'as':'SmsInteractions','foreignKey':'ContactId','onDelete':_0x9b26('0x15a')});db[_0x9b26('0x122')][_0x9b26('0x112')](db[_0x9b26('0x172')],{'as':'FaxInteractions','foreignKey':_0x9b26('0x156'),'onDelete':'restrict'});db[_0x9b26('0x122')][_0x9b26('0x112')](db[_0x9b26('0x47')],{'as':_0x9b26('0x11a'),'foreignKey':_0x9b26('0x156'),'onDelete':'restrict'});db[_0x9b26('0x122')][_0x9b26('0x11e')](db[_0x9b26('0x70')],{'as':_0x9b26('0x195'),'foreignKey':_0x9b26('0x196')});db[_0x9b26('0x122')]['belongsTo'](db[_0x9b26('0x125')],{'as':_0x9b26('0x15f'),'foreignKey':_0x9b26('0x160'),'onDelete':_0x9b26('0x10d')});db[_0x9b26('0x122')]['belongsToMany'](db[_0x9b26('0x14')],{'as':_0x9b26('0x176'),'through':_0x9b26('0x124')});db[_0x9b26('0x122')]['belongsToMany'](db[_0x9b26('0x8d')],{'as':_0x9b26('0x168'),'through':_0x9b26('0x197')});db[_0x9b26('0x122')][_0x9b26('0x120')](db['Tag'],{'through':'cm_contact_has_tags','as':_0x9b26('0x17f')});db['CmHopper'][_0x9b26('0x112')](db['CmHopperAdditionalPhone'],{'as':_0x9b26('0x198'),'foreignKey':_0x9b26('0x199')});db[_0x9b26('0x71')][_0x9b26('0x11e')](db['CmContact'],{'as':_0x9b26('0x155'),'foreignKey':'ContactId','onDelete':_0x9b26('0x10d')});db[_0x9b26('0x71')]['belongsTo'](db[_0x9b26('0x125')],{'as':_0x9b26('0x15f'),'foreignKey':_0x9b26('0x160'),'onDelete':'cascade'});db[_0x9b26('0x71')][_0x9b26('0x11e')](db['User'],{'as':_0x9b26('0x18a'),'foreignKey':_0x9b26('0x10e')});db[_0x9b26('0x71')]['belongsTo'](db[_0x9b26('0x1e')],{'as':_0x9b26('0x18b'),'foreignKey':_0x9b26('0x145'),'onDelete':'cascade'});db[_0x9b26('0x71')][_0x9b26('0x11e')](db[_0x9b26('0x19a')],{'as':_0x9b26('0x19a'),'foreignKey':'CampaignId','onDelete':_0x9b26('0x10d')});db['CmHopper'][_0x9b26('0x11e')](db[_0x9b26('0x14')],{'as':_0x9b26('0x166'),'foreignKey':'OwnerId'});db[_0x9b26('0x73')][_0x9b26('0x11e')](db[_0x9b26('0x122')],{'as':_0x9b26('0x155'),'foreignKey':_0x9b26('0x156'),'onDelete':'cascade'});db[_0x9b26('0x73')][_0x9b26('0x11e')](db[_0x9b26('0x125')],{'as':_0x9b26('0x15f'),'foreignKey':_0x9b26('0x160'),'onDelete':_0x9b26('0x10d')});db[_0x9b26('0x73')][_0x9b26('0x11e')](db[_0x9b26('0x1e')],{'as':'Queue','foreignKey':'VoiceQueueId','onDelete':_0x9b26('0x10d')});db['CmHopperBlack']['belongsTo'](db['Campaign'],{'as':'Campaign','foreignKey':_0x9b26('0x19b'),'onDelete':_0x9b26('0x10d')});db['Automation'][_0x9b26('0x112')](db[_0x9b26('0x19c')],{'as':{'plural':'All','singular':_0x9b26('0x19d')},'foreignKey':'AutomationAllId','onDelete':_0x9b26('0x10d'),'hooks':!![]});db['Automation'][_0x9b26('0x112')](db[_0x9b26('0x19c')],{'as':{'plural':_0x9b26('0x19e'),'singular':'OneAny'},'foreignKey':_0x9b26('0x19f'),'onDelete':_0x9b26('0x10d'),'hooks':!![]});db[_0x9b26('0x7e')][_0x9b26('0x112')](db[_0x9b26('0x1a0')],{'as':_0x9b26('0x1a1'),'foreignKey':_0x9b26('0x1a2'),'onDelete':_0x9b26('0x10d'),'hooks':!![]});db[_0x9b26('0x82')]['hasMany'](db[_0x9b26('0x82')],{'as':_0x9b26('0x15d'),'foreignKey':_0x9b26('0x1a3'),'onDelete':_0x9b26('0x10d')});db['Interval']['hasMany'](db[_0x9b26('0x85')],{'as':_0x9b26('0x1a4'),'foreignKey':_0x9b26('0x14a'),'onDelete':_0x9b26('0x10d'),'hooks':!![],'required':![]});db[_0x9b26('0x85')]['hasMany'](db[_0x9b26('0x1b')],{'as':_0x9b26('0x114'),'foreignKey':_0x9b26('0x14a'),'onDelete':_0x9b26('0x15a')});db[_0x9b26('0x85')][_0x9b26('0x112')](db[_0x9b26('0x4a')],{'as':_0x9b26('0x1a5'),'foreignKey':_0x9b26('0x14a')});db[_0x9b26('0x85')][_0x9b26('0x112')](db[_0x9b26('0x64')],{'as':_0x9b26('0x1a6'),'foreignKey':_0x9b26('0x14a')});db[_0x9b26('0x85')][_0x9b26('0x112')](db['FaxApplication'],{'as':_0x9b26('0x1a7'),'foreignKey':_0x9b26('0x14a')});db['Interval'][_0x9b26('0x112')](db[_0x9b26('0x17c')],{'as':_0x9b26('0x1a8'),'foreignKey':'IntervalId'});db[_0x9b26('0x1a9')][_0x9b26('0x11e')](db['MailAccount'],{});db[_0x9b26('0x1a9')][_0x9b26('0x11e')](db['AnalyticDefaultReport'],{'foreignKey':'DefaultReportId'});db['Schedule'][_0x9b26('0x11e')](db[_0x9b26('0x9a')],{'foreignKey':_0x9b26('0x1aa')});db[_0x9b26('0x8c')]['belongsToMany'](db[_0x9b26('0x1d')],{'as':_0x9b26('0x1ab'),'through':_0x9b26('0x144'),'onDelete':_0x9b26('0x15a')});db['Tag'][_0x9b26('0x120')](db[_0x9b26('0x122')],{'through':'cm_contact_has_tags'});db[_0x9b26('0x8d')][_0x9b26('0x120')](db[_0x9b26('0x118')],{'through':_0x9b26('0x18f')});db[_0x9b26('0x8d')][_0x9b26('0x120')](db[_0x9b26('0x47')],{'through':_0x9b26('0x167')});db[_0x9b26('0x8d')]['belongsToMany'](db['SmsInteraction'],{'through':_0x9b26('0x17e')});db['Tag']['belongsToMany'](db[_0x9b26('0x172')],{'through':_0x9b26('0x175')});db[_0x9b26('0x8d')][_0x9b26('0x120')](db[_0x9b26('0x12d')],{'through':_0x9b26('0x186')});db[_0x9b26('0x8d')][_0x9b26('0x120')](db[_0x9b26('0xfa')],{'through':_0x9b26('0x1ac')});db['CmContactHasItem'][_0x9b26('0x11e')](db[_0x9b26('0x8f')],{'as':'ItemType','foreignKey':_0x9b26('0x1ad')});db[_0x9b26('0x92')]['belongsTo'](db[_0x9b26('0x71')],{'as':_0x9b26('0x1ae'),'foreignKey':_0x9b26('0x199')});db[_0x9b26('0x191')][_0x9b26('0x11e')](db[_0x9b26('0x122')],{'as':_0x9b26('0x155'),'foreignKey':_0x9b26('0x193')});db[_0x9b26('0x95')][_0x9b26('0x112')](db[_0x9b26('0x19c')],{'as':{'plural':'AllConditions','singular':_0x9b26('0x1af')},'foreignKey':_0x9b26('0x1b0'),'onDelete':_0x9b26('0x10d'),'hooks':!![]});db[_0x9b26('0x95')][_0x9b26('0x112')](db[_0x9b26('0x19c')],{'as':{'plural':_0x9b26('0x1b1'),'singular':_0x9b26('0x1b2')},'foreignKey':_0x9b26('0x1b3'),'onDelete':_0x9b26('0x10d'),'hooks':!![]});db['Trigger'][_0x9b26('0x112')](db[_0x9b26('0x1a0')],{'as':_0x9b26('0x1a1'),'foreignKey':_0x9b26('0x1b4'),'onDelete':_0x9b26('0x10d'),'hooks':!![]});db[_0x9b26('0x9a')]['hasMany'](db['AnalyticFieldReport'],{'as':_0x9b26('0x1b5'),'onDelete':'cascade','foreignKey':_0x9b26('0x1aa'),'hooks':!![]});db['AnalyticDefaultReport'][_0x9b26('0x112')](db[_0x9b26('0x9e')],{'as':_0x9b26('0x1b5'),'onDelete':_0x9b26('0x10d'),'foreignKey':_0x9b26('0x1b6')});db[_0x9b26('0x1b7')][_0x9b26('0x112')](db[_0x9b26('0x9e')],{'as':_0x9b26('0x1b5'),'onDelete':_0x9b26('0x10d'),'foreignKey':_0x9b26('0x1b8')});db['AnalyticFieldReport']['belongsTo'](db[_0x9b26('0x1b7')],{'foreignKey':_0x9b26('0x1b8')});db['SalesforceAccount'][_0x9b26('0x112')](db['SalesforceConfiguration'],{'as':_0x9b26('0x1b9'),'onDelete':_0x9b26('0x10d'),'foreignKey':_0x9b26('0x1ba')});db[_0x9b26('0xa3')][_0x9b26('0x112')](db[_0x9b26('0xa4')],{'as':_0x9b26('0x1bb'),'onDelete':_0x9b26('0x10d'),'foreignKey':_0x9b26('0x1bc')});db[_0x9b26('0xa3')][_0x9b26('0x112')](db[_0x9b26('0xa4')],{'as':_0x9b26('0x1bd'),'onDelete':_0x9b26('0x10d'),'foreignKey':'DescriptionId'});db[_0x9b26('0xa3')][_0x9b26('0x112')](db[_0x9b26('0xa4')],{'as':_0x9b26('0x1b5'),'onDelete':'cascade','foreignKey':'FieldId'});db[_0x9b26('0xa3')]['belongsTo'](db[_0x9b26('0xa1')],{'as':'Account','foreignKey':_0x9b26('0x1ba')});db[_0x9b26('0xa4')]['hasMany'](db[_0x9b26('0xa4')],{'as':_0x9b26('0x1be'),'foreignKey':_0x9b26('0x1bc')});db[_0x9b26('0xa4')][_0x9b26('0x112')](db[_0x9b26('0xa4')],{'as':_0x9b26('0x1bf'),'foreignKey':'DescriptionId'});db[_0x9b26('0xa4')][_0x9b26('0x112')](db[_0x9b26('0xa4')],{'as':_0x9b26('0x1c0'),'foreignKey':_0x9b26('0x1c1')});db[_0x9b26('0xa4')]['belongsTo'](db[_0x9b26('0x1c2')],{'as':'Variable','foreignKey':'VariableId'});db['SugarcrmAccount']['hasMany'](db[_0x9b26('0xa6')],{'as':'Configurations','onDelete':'cascade','foreignKey':'AccountId'});db['SugarcrmConfiguration'][_0x9b26('0x112')](db['SugarcrmField'],{'as':_0x9b26('0x1bb'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0x9b26('0xa6')][_0x9b26('0x112')](db[_0x9b26('0xa7')],{'as':_0x9b26('0x1bd'),'onDelete':_0x9b26('0x10d'),'foreignKey':'DescriptionId'});db[_0x9b26('0xa6')][_0x9b26('0x112')](db[_0x9b26('0xa7')],{'as':_0x9b26('0x1b5'),'onDelete':_0x9b26('0x10d'),'foreignKey':_0x9b26('0x1c1')});db[_0x9b26('0xa6')][_0x9b26('0x11e')](db['SugarcrmAccount'],{'as':_0x9b26('0x165'),'foreignKey':'AccountId'});db[_0x9b26('0xa7')][_0x9b26('0x112')](db[_0x9b26('0xa7')],{'as':_0x9b26('0x1be'),'foreignKey':'SubjectId'});db['SugarcrmField']['hasMany'](db['SugarcrmField'],{'as':_0x9b26('0x1bf'),'foreignKey':_0x9b26('0x1c3')});db[_0x9b26('0xa7')][_0x9b26('0x112')](db[_0x9b26('0xa7')],{'as':_0x9b26('0x1c0'),'foreignKey':_0x9b26('0x1c1')});db['SugarcrmField'][_0x9b26('0x11e')](db[_0x9b26('0x1c2')],{'as':_0x9b26('0x1c2'),'foreignKey':_0x9b26('0x1c4')});db[_0x9b26('0xa9')][_0x9b26('0x112')](db[_0x9b26('0x1c5')],{'as':_0x9b26('0x1b9'),'onDelete':'cascade','foreignKey':_0x9b26('0x1ba')});db['DeskConfiguration'][_0x9b26('0x112')](db[_0x9b26('0xab')],{'as':_0x9b26('0x1bb'),'onDelete':_0x9b26('0x10d'),'foreignKey':'SubjectId'});db['DeskConfiguration'][_0x9b26('0x112')](db[_0x9b26('0xab')],{'as':'Descriptions','onDelete':_0x9b26('0x10d'),'foreignKey':'DescriptionId'});db[_0x9b26('0x1c5')]['hasMany'](db[_0x9b26('0xab')],{'as':_0x9b26('0x1b5'),'onDelete':_0x9b26('0x10d'),'foreignKey':_0x9b26('0x1c1')});db[_0x9b26('0x1c5')][_0x9b26('0x11e')](db[_0x9b26('0xa9')],{'as':_0x9b26('0x165'),'foreignKey':_0x9b26('0x1ba')});db[_0x9b26('0x1c5')][_0x9b26('0x120')](db[_0x9b26('0x8d')],{'through':'int_desk_configuration_has_tags'});db[_0x9b26('0xab')]['hasMany'](db[_0x9b26('0xab')],{'as':_0x9b26('0x1be'),'foreignKey':_0x9b26('0x1bc')});db[_0x9b26('0xab')][_0x9b26('0x112')](db[_0x9b26('0xab')],{'as':_0x9b26('0x1bf'),'foreignKey':_0x9b26('0x1c3')});db[_0x9b26('0xab')]['hasMany'](db[_0x9b26('0xab')],{'as':'Field','foreignKey':'FieldId'});db[_0x9b26('0xab')][_0x9b26('0x11e')](db[_0x9b26('0x1c2')],{'as':_0x9b26('0x1c2'),'foreignKey':'VariableId'});db[_0x9b26('0xac')][_0x9b26('0x112')](db['ZohoConfiguration'],{'as':'Configurations','onDelete':_0x9b26('0x10d'),'foreignKey':'AccountId'});db[_0x9b26('0x1c6')][_0x9b26('0x112')](db[_0x9b26('0x1c7')],{'as':_0x9b26('0x1bb'),'onDelete':_0x9b26('0x10d'),'foreignKey':_0x9b26('0x1bc')});db[_0x9b26('0x1c6')][_0x9b26('0x112')](db[_0x9b26('0x1c7')],{'as':_0x9b26('0x1bd'),'onDelete':_0x9b26('0x10d'),'foreignKey':_0x9b26('0x1c3')});db['ZohoConfiguration']['hasMany'](db[_0x9b26('0x1c7')],{'as':'Fields','onDelete':_0x9b26('0x10d'),'foreignKey':_0x9b26('0x1c1')});db['ZohoConfiguration'][_0x9b26('0x11e')](db['ZohoAccount'],{'as':_0x9b26('0x165'),'foreignKey':'AccountId'});db[_0x9b26('0x1c7')][_0x9b26('0x112')](db[_0x9b26('0x1c7')],{'as':_0x9b26('0x1be'),'foreignKey':'SubjectId'});db[_0x9b26('0x1c7')]['hasMany'](db[_0x9b26('0x1c7')],{'as':_0x9b26('0x1bf'),'foreignKey':_0x9b26('0x1c3')});db[_0x9b26('0x1c7')]['hasMany'](db[_0x9b26('0x1c7')],{'as':_0x9b26('0x1c0'),'foreignKey':_0x9b26('0x1c1')});db[_0x9b26('0x1c7')][_0x9b26('0x11e')](db[_0x9b26('0x1c2')],{'as':_0x9b26('0x1c2'),'foreignKey':_0x9b26('0x1c4')});db['ZendeskAccount'][_0x9b26('0x112')](db[_0x9b26('0xb1')],{'as':_0x9b26('0x1b9'),'onDelete':_0x9b26('0x10d'),'foreignKey':_0x9b26('0x1ba')});db['ZendeskConfiguration'][_0x9b26('0x112')](db[_0x9b26('0xb3')],{'as':_0x9b26('0x1bb'),'foreignKey':_0x9b26('0x1bc')});db[_0x9b26('0xb1')][_0x9b26('0x112')](db[_0x9b26('0xb3')],{'as':'Descriptions','foreignKey':_0x9b26('0x1c3')});db[_0x9b26('0xb1')]['hasMany'](db[_0x9b26('0xb3')],{'as':'Fields','foreignKey':'FieldId'});db[_0x9b26('0xb1')][_0x9b26('0x11e')](db['ZendeskAccount'],{'as':_0x9b26('0x165'),'foreignKey':_0x9b26('0x1ba')});db[_0x9b26('0xb1')]['belongsToMany'](db[_0x9b26('0x8d')],{'through':_0x9b26('0x1c8')});db[_0x9b26('0xb3')][_0x9b26('0x112')](db['ZendeskField'],{'as':_0x9b26('0x1be'),'foreignKey':_0x9b26('0x1bc')});db[_0x9b26('0xb3')][_0x9b26('0x112')](db[_0x9b26('0xb3')],{'as':_0x9b26('0x1bf'),'foreignKey':_0x9b26('0x1c3')});db[_0x9b26('0xb3')][_0x9b26('0x112')](db[_0x9b26('0xb3')],{'as':_0x9b26('0x1c0'),'foreignKey':_0x9b26('0x1c1')});db[_0x9b26('0xb3')][_0x9b26('0x11e')](db['Variable'],{'as':_0x9b26('0x1c2'),'foreignKey':_0x9b26('0x1c4')});db[_0x9b26('0xb4')]['hasMany'](db[_0x9b26('0x1c9')],{'as':_0x9b26('0x1b9'),'onDelete':_0x9b26('0x10d'),'foreignKey':'AccountId'});db[_0x9b26('0x1c9')][_0x9b26('0x112')](db[_0x9b26('0xb7')],{'as':_0x9b26('0x1bb'),'onDelete':_0x9b26('0x10d'),'foreignKey':_0x9b26('0x1bc')});db['FreshdeskConfiguration'][_0x9b26('0x112')](db['FreshdeskField'],{'as':_0x9b26('0x1bd'),'onDelete':_0x9b26('0x10d'),'foreignKey':'DescriptionId'});db[_0x9b26('0x1c9')][_0x9b26('0x112')](db[_0x9b26('0xb7')],{'as':_0x9b26('0x1b5'),'onDelete':_0x9b26('0x10d'),'foreignKey':_0x9b26('0x1c1')});db[_0x9b26('0x1c9')][_0x9b26('0x11e')](db[_0x9b26('0xb4')],{'as':_0x9b26('0x165'),'foreignKey':'AccountId'});db[_0x9b26('0x1c9')][_0x9b26('0x120')](db['Tag'],{'through':'int_freshdesk_configuration_has_tags'});db['FreshdeskField'][_0x9b26('0x112')](db[_0x9b26('0xb7')],{'as':_0x9b26('0x1be'),'foreignKey':'SubjectId'});db[_0x9b26('0xb7')][_0x9b26('0x112')](db[_0x9b26('0xb7')],{'as':_0x9b26('0x1bf'),'foreignKey':'DescriptionId'});db[_0x9b26('0xb7')][_0x9b26('0x112')](db[_0x9b26('0xb7')],{'as':_0x9b26('0x1c0'),'foreignKey':'FieldId'});db[_0x9b26('0xb7')][_0x9b26('0x11e')](db[_0x9b26('0x1c2')],{'as':'Variable','foreignKey':_0x9b26('0x1c4')});db['VtigerAccount'][_0x9b26('0x112')](db[_0x9b26('0xbb')],{'as':_0x9b26('0x1b9'),'onDelete':_0x9b26('0x10d'),'foreignKey':_0x9b26('0x1ba')});db[_0x9b26('0xbb')]['hasMany'](db[_0x9b26('0xbd')],{'as':_0x9b26('0x1bb'),'foreignKey':_0x9b26('0x1bc')});db[_0x9b26('0xbb')][_0x9b26('0x112')](db[_0x9b26('0xbd')],{'as':'Descriptions','foreignKey':'DescriptionId'});db['VtigerConfiguration'][_0x9b26('0x112')](db[_0x9b26('0xbd')],{'as':'Fields','foreignKey':'FieldId'});db[_0x9b26('0xbb')][_0x9b26('0x11e')](db[_0x9b26('0xb9')],{'as':_0x9b26('0x165'),'foreignKey':_0x9b26('0x1ba')});db[_0x9b26('0xbd')][_0x9b26('0x112')](db[_0x9b26('0xbd')],{'as':'Subject','foreignKey':_0x9b26('0x1bc')});db['VtigerField'][_0x9b26('0x112')](db[_0x9b26('0xbd')],{'as':_0x9b26('0x1bf'),'foreignKey':'DescriptionId'});db['VtigerField'][_0x9b26('0x112')](db[_0x9b26('0xbd')],{'as':_0x9b26('0x1c0'),'foreignKey':_0x9b26('0x1c1')});db[_0x9b26('0xbd')][_0x9b26('0x11e')](db['Variable'],{'as':_0x9b26('0x1c2'),'foreignKey':_0x9b26('0x1c4')});db[_0x9b26('0x1ca')]['hasMany'](db['ServicenowConfiguration'],{'as':_0x9b26('0x1b9'),'onDelete':_0x9b26('0x10d'),'foreignKey':_0x9b26('0x1ba')});db[_0x9b26('0xc0')][_0x9b26('0x112')](db[_0x9b26('0x1cb')],{'as':_0x9b26('0x1bb'),'foreignKey':_0x9b26('0x1bc')});db[_0x9b26('0xc0')][_0x9b26('0x112')](db[_0x9b26('0x1cb')],{'as':_0x9b26('0x1bd'),'foreignKey':_0x9b26('0x1c3')});db['ServicenowConfiguration'][_0x9b26('0x112')](db[_0x9b26('0x1cb')],{'as':'Fields','foreignKey':_0x9b26('0x1c1')});db[_0x9b26('0xc0')][_0x9b26('0x11e')](db['ServicenowAccount'],{'as':_0x9b26('0x165'),'foreignKey':_0x9b26('0x1ba')});db[_0x9b26('0x1cb')][_0x9b26('0x112')](db['ServicenowField'],{'as':'Subject','foreignKey':_0x9b26('0x1bc')});db[_0x9b26('0x1cb')][_0x9b26('0x112')](db[_0x9b26('0x1cb')],{'as':'Description','foreignKey':_0x9b26('0x1c3')});db[_0x9b26('0x1cb')]['hasMany'](db[_0x9b26('0x1cb')],{'as':_0x9b26('0x1c0'),'foreignKey':_0x9b26('0x1c1')});db[_0x9b26('0x1cb')][_0x9b26('0x11e')](db[_0x9b26('0x1c2')],{'as':'Variable','foreignKey':'VariableId'});db[_0x9b26('0xc3')][_0x9b26('0x112')](db['Dynamics365Configuration'],{'as':_0x9b26('0x1b9'),'onDelete':_0x9b26('0x10d'),'foreignKey':_0x9b26('0x1ba')});db[_0x9b26('0xc3')][_0x9b26('0x11e')](db[_0x9b26('0x159')],{'as':_0x9b26('0x159'),'foreignKey':_0x9b26('0x158')});db[_0x9b26('0xc5')]['hasMany'](db[_0x9b26('0xc7')],{'as':_0x9b26('0x1bb'),'onDelete':'cascade','foreignKey':_0x9b26('0x1bc')});db[_0x9b26('0xc5')][_0x9b26('0x112')](db[_0x9b26('0xc7')],{'as':'Descriptions','onDelete':_0x9b26('0x10d'),'foreignKey':_0x9b26('0x1c3')});db['Dynamics365Configuration'][_0x9b26('0x112')](db[_0x9b26('0xc7')],{'as':_0x9b26('0x1b5'),'onDelete':_0x9b26('0x10d'),'foreignKey':_0x9b26('0x1c1')});db['Dynamics365Configuration'][_0x9b26('0x11e')](db[_0x9b26('0xc3')],{'as':_0x9b26('0x165'),'foreignKey':_0x9b26('0x1ba')});db[_0x9b26('0xc7')]['hasMany'](db[_0x9b26('0xc7')],{'as':_0x9b26('0x1be'),'foreignKey':_0x9b26('0x1bc')});db[_0x9b26('0xc7')][_0x9b26('0x112')](db[_0x9b26('0xc7')],{'as':'Description','foreignKey':_0x9b26('0x1c3')});db[_0x9b26('0xc7')]['hasMany'](db[_0x9b26('0xc7')],{'as':'Field','foreignKey':'FieldId'});db[_0x9b26('0xc7')][_0x9b26('0x11e')](db['Variable'],{'as':_0x9b26('0x1c2'),'foreignKey':_0x9b26('0x1c4')});db['FreshsalesAccount']['hasMany'](db[_0x9b26('0x1cc')],{'as':'Configurations','onDelete':_0x9b26('0x10d'),'foreignKey':_0x9b26('0x1ba')});db[_0x9b26('0x1cc')][_0x9b26('0x112')](db['FreshsalesField'],{'as':_0x9b26('0x1bb'),'foreignKey':_0x9b26('0x1bc')});db[_0x9b26('0x1cc')][_0x9b26('0x112')](db[_0x9b26('0x1cd')],{'as':_0x9b26('0x1bd'),'foreignKey':_0x9b26('0x1c3')});db['FreshsalesConfiguration'][_0x9b26('0x112')](db[_0x9b26('0x1cd')],{'as':_0x9b26('0x1b5'),'foreignKey':'FieldId'});db[_0x9b26('0x1cc')]['belongsTo'](db[_0x9b26('0xc9')],{'as':'Account','foreignKey':_0x9b26('0x1ba')});db[_0x9b26('0x1cd')][_0x9b26('0x112')](db[_0x9b26('0x1cd')],{'as':'Subject','foreignKey':'SubjectId'});db['FreshsalesField']['hasMany'](db['FreshsalesField'],{'as':'Description','foreignKey':_0x9b26('0x1c3')});db[_0x9b26('0x1cd')][_0x9b26('0x112')](db[_0x9b26('0x1cd')],{'as':_0x9b26('0x1c0'),'foreignKey':_0x9b26('0x1c1')});db['FreshsalesField'][_0x9b26('0x11e')](db[_0x9b26('0x1c2')],{'as':'Variable','foreignKey':'VariableId'});db[_0x9b26('0xcd')][_0x9b26('0x11e')](db[_0x9b26('0x62')],{});db[_0x9b26('0xcd')][_0x9b26('0x11e')](db[_0x9b26('0x125')],{'as':_0x9b26('0x15f'),'foreignKey':_0x9b26('0x160')});db['ChatQueueReport'][_0x9b26('0x11e')](db[_0x9b26('0x122')],{'as':'Contact','foreignKey':_0x9b26('0x156')});db[_0x9b26('0xcd')][_0x9b26('0x11e')](db[_0x9b26('0x118')],{});db['ChatQueueReport'][_0x9b26('0x11e')](db[_0x9b26('0x66')],{});db[_0x9b26('0xcd')][_0x9b26('0x11e')](db['User'],{});db[_0x9b26('0xcd')][_0x9b26('0x11e')](db[_0x9b26('0x6a')],{});db[_0x9b26('0x190')][_0x9b26('0x11e')](db[_0x9b26('0x14')],{'onDelete':'cascade','foreignKey':'FromId'});db['ChatInternalMessage'][_0x9b26('0x11e')](db['User'],{'onDelete':'cascade','foreignKey':_0x9b26('0x1ce')});db['JscriptySessionReport'][_0x9b26('0x112')](db[_0x9b26('0x1cf')],{'foreignKey':_0x9b26('0x1d0'),'onDelete':'cascade'});db[_0x9b26('0xd2')][_0x9b26('0x112')](db[_0x9b26('0xcf')],{'foreignKey':_0x9b26('0x1d0'),'onDelete':_0x9b26('0x10d')});db['SmsQueueReport'][_0x9b26('0x11e')](db[_0x9b26('0x56')],{});db['SmsQueueReport']['belongsTo'](db[_0x9b26('0x125')],{'as':_0x9b26('0x15f'),'foreignKey':_0x9b26('0x160')});db['SmsQueueReport'][_0x9b26('0x11e')](db[_0x9b26('0x122')],{'as':_0x9b26('0x155'),'foreignKey':_0x9b26('0x156')});db[_0x9b26('0x1d1')][_0x9b26('0x11e')](db[_0x9b26('0x57')],{});db[_0x9b26('0x1d1')][_0x9b26('0x11e')](db[_0x9b26('0x59')],{});db[_0x9b26('0x1d1')][_0x9b26('0x11e')](db['User'],{});db[_0x9b26('0x1d1')][_0x9b26('0x11e')](db[_0x9b26('0x5b')],{});db[_0x9b26('0xd8')][_0x9b26('0x112')](db[_0x9b26('0xd2')],{'foreignKey':_0x9b26('0x1d2')});db[_0x9b26('0xd8')][_0x9b26('0x112')](db[_0x9b26('0x1cf')],{'foreignKey':'ProjectId'});db[_0x9b26('0xd8')][_0x9b26('0x112')](db['JscriptyAnswerReport'],{'foreignKey':_0x9b26('0x1d2')});db[_0x9b26('0xe0')][_0x9b26('0x120')](db[_0x9b26('0x14')],{'as':_0x9b26('0x14d'),'through':'user_has_teams'});db[_0x9b26('0xe0')][_0x9b26('0x120')](db['VoiceQueue'],{'through':_0x9b26('0x102'),'as':'VoiceQueues'});db[_0x9b26('0xe0')]['belongsToMany'](db['MailQueue'],{'through':_0x9b26('0x163'),'as':_0x9b26('0x132')});db[_0x9b26('0xe0')]['belongsToMany'](db['ChatQueue'],{'through':_0x9b26('0x1d3'),'as':'ChatQueues'});db[_0x9b26('0xe0')][_0x9b26('0x120')](db[_0x9b26('0x53')],{'through':_0x9b26('0x179'),'as':_0x9b26('0x134')});db['Team'][_0x9b26('0x120')](db['SmsQueue'],{'through':_0x9b26('0x181'),'as':_0x9b26('0x1d4')});db[_0x9b26('0xe0')]['belongsToMany'](db[_0x9b26('0x61')],{'through':_0x9b26('0x187'),'as':_0x9b26('0x135')});db[_0x9b26('0xe0')][_0x9b26('0x120')](db[_0x9b26('0x100')],{'through':_0x9b26('0x1d5'),'as':_0x9b26('0x136')});db['Team'][_0x9b26('0x120')](db[_0x9b26('0xf1')],{'through':_0x9b26('0x104'),'as':'VoicePrefixes'});db['Campaign']['hasMany'](db['CmHopper'],{'as':_0x9b26('0x11d'),'foreignKey':_0x9b26('0x19b')});db[_0x9b26('0x19a')][_0x9b26('0x112')](db[_0x9b26('0x75')],{'as':_0x9b26('0x115'),'foreignKey':_0x9b26('0x19b')});db[_0x9b26('0x19a')][_0x9b26('0x112')](db[_0x9b26('0x77')],{'as':_0x9b26('0x146'),'foreignKey':'CampaignId'});db[_0x9b26('0x19a')][_0x9b26('0x112')](db[_0x9b26('0x73')],{'as':'HopperBlacks','foreignKey':_0x9b26('0x19b')});db[_0x9b26('0x19a')][_0x9b26('0x11e')](db[_0x9b26('0x2d')],{'as':_0x9b26('0x2d'),'foreignKey':_0x9b26('0x148')});db[_0x9b26('0x19a')][_0x9b26('0x11e')](db['Trunk'],{'as':_0x9b26('0x1d6'),'foreignKey':_0x9b26('0x149')});db['Campaign'][_0x9b26('0x11e')](db[_0x9b26('0x85')],{'as':_0x9b26('0x85'),'foreignKey':'IntervalId'});db[_0x9b26('0x19a')]['belongsTo'](db[_0x9b26('0xdd')],{'as':_0x9b26('0xdd'),'foreignKey':'SquareProjectId'});db['Campaign']['belongsToMany'](db[_0x9b26('0x125')],{'as':_0x9b26('0x126'),'through':_0x9b26('0x1d7')});db[_0x9b26('0x19a')][_0x9b26('0x120')](db[_0x9b26('0x125')],{'as':_0x9b26('0x14f'),'through':_0x9b26('0x1d8')});db[_0x9b26('0x177')][_0x9b26('0x11e')](db[_0x9b26('0x68')],{'as':_0x9b26('0x68'),'foreignKey':_0x9b26('0x16c')});db[_0x9b26('0xe9')][_0x9b26('0x11e')](db[_0x9b26('0x48')],{});db[_0x9b26('0xe9')][_0x9b26('0x11e')](db['MailInteraction'],{});db[_0x9b26('0xe9')][_0x9b26('0x11e')](db[_0x9b26('0x42')],{'foreignKey':_0x9b26('0x1d9'),'as':_0x9b26('0x1da')});db[_0x9b26('0xe9')]['belongsTo'](db[_0x9b26('0x14')],{'foreignKey':'FromUserId','as':_0x9b26('0x1db')});db[_0x9b26('0xe9')][_0x9b26('0x11e')](db[_0x9b26('0x14')],{'foreignKey':_0x9b26('0x1dc'),'as':_0x9b26('0x1dd')});db['MailTransferReport']['belongsTo'](db[_0x9b26('0x44')],{'foreignKey':'ToMailQueueId','as':'ToQueue'});db[_0x9b26('0xe9')][_0x9b26('0x11e')](db[_0x9b26('0x42')],{'foreignKey':'ToMailAccountId','as':_0x9b26('0x1de')});db[_0x9b26('0x1df')]['belongsTo'](db['ChatMessage'],{});db[_0x9b26('0x1df')][_0x9b26('0x11e')](db['ChatInteraction'],{});db[_0x9b26('0x1df')][_0x9b26('0x11e')](db[_0x9b26('0x62')],{'foreignKey':_0x9b26('0x1e0'),'as':'FromAccount'});db[_0x9b26('0x1df')]['belongsTo'](db['User'],{'foreignKey':'FromUserId','as':_0x9b26('0x1db')});db[_0x9b26('0x1df')][_0x9b26('0x11e')](db['User'],{'foreignKey':_0x9b26('0x1dc'),'as':'ToAgent'});db['ChatTransferReport'][_0x9b26('0x11e')](db['ChatQueue'],{'foreignKey':'ToChatQueueId','as':_0x9b26('0x1e1')});db[_0x9b26('0x1df')]['belongsTo'](db[_0x9b26('0x62')],{'foreignKey':_0x9b26('0x1e2'),'as':_0x9b26('0x1de')});db[_0x9b26('0xec')]['belongsTo'](db[_0x9b26('0x52')],{});db['FaxTransferReport'][_0x9b26('0x11e')](db[_0x9b26('0x172')],{});db[_0x9b26('0xec')][_0x9b26('0x11e')](db[_0x9b26('0x4e')],{'foreignKey':_0x9b26('0x1e3'),'as':_0x9b26('0x1da')});db[_0x9b26('0xec')][_0x9b26('0x11e')](db[_0x9b26('0x14')],{'foreignKey':_0x9b26('0x1e4'),'as':_0x9b26('0x1db')});db[_0x9b26('0xec')][_0x9b26('0x11e')](db[_0x9b26('0x14')],{'foreignKey':_0x9b26('0x1dc'),'as':_0x9b26('0x1dd')});db[_0x9b26('0xec')][_0x9b26('0x11e')](db[_0x9b26('0x53')],{'foreignKey':'ToFaxQueueId','as':_0x9b26('0x1e1')});db['FaxTransferReport']['belongsTo'](db[_0x9b26('0x4e')],{'foreignKey':_0x9b26('0x1e5'),'as':_0x9b26('0x1de')});db[_0x9b26('0xee')][_0x9b26('0x11e')](db[_0x9b26('0x60')],{});db[_0x9b26('0xee')][_0x9b26('0x11e')](db['OpenchannelInteraction'],{});db[_0x9b26('0xee')][_0x9b26('0x11e')](db[_0x9b26('0x13c')],{'foreignKey':'FromOpenchannelAccountId','as':_0x9b26('0x1da')});db[_0x9b26('0xee')]['belongsTo'](db[_0x9b26('0x14')],{'foreignKey':_0x9b26('0x1e4'),'as':_0x9b26('0x1db')});db[_0x9b26('0xee')]['belongsTo'](db[_0x9b26('0x14')],{'foreignKey':_0x9b26('0x1dc'),'as':_0x9b26('0x1dd')});db[_0x9b26('0xee')][_0x9b26('0x11e')](db['OpenchannelQueue'],{'foreignKey':_0x9b26('0x1e6'),'as':_0x9b26('0x1e1')});db[_0x9b26('0xee')]['belongsTo'](db[_0x9b26('0x13c')],{'foreignKey':_0x9b26('0x1e7'),'as':_0x9b26('0x1de')});db['SmsTransferReport'][_0x9b26('0x11e')](db[_0x9b26('0x59')],{});db[_0x9b26('0xf0')][_0x9b26('0x11e')](db['SmsInteraction'],{});db[_0x9b26('0xf0')]['belongsTo'](db[_0x9b26('0x56')],{'foreignKey':_0x9b26('0x1e8'),'as':_0x9b26('0x1da')});db['SmsTransferReport'][_0x9b26('0x11e')](db['User'],{'foreignKey':'FromUserId','as':_0x9b26('0x1db')});db[_0x9b26('0xf0')][_0x9b26('0x11e')](db[_0x9b26('0x14')],{'foreignKey':_0x9b26('0x1dc'),'as':_0x9b26('0x1dd')});db['SmsTransferReport'][_0x9b26('0x11e')](db['SmsQueue'],{'foreignKey':'ToSmsQueueId','as':'ToQueue'});db[_0x9b26('0xf0')][_0x9b26('0x11e')](db['SmsAccount'],{'foreignKey':_0x9b26('0x1e9'),'as':_0x9b26('0x1de')});db['CmList'][_0x9b26('0x112')](db['Disposition'],{'as':'Dispositions','foreignKey':_0x9b26('0x160'),'onDelete':'cascade'});db[_0x9b26('0x125')][_0x9b26('0x112')](db[_0x9b26('0x7b')],{'as':'CustomFields','foreignKey':_0x9b26('0x160')});db['CmList'][_0x9b26('0x112')](db[_0x9b26('0x122')],{'as':_0x9b26('0x123'),'onDelete':_0x9b26('0x10d'),'foreignKey':'ListId'});db[_0x9b26('0x125')]['hasMany'](db[_0x9b26('0x75')],{'as':_0x9b26('0x115'),'foreignKey':_0x9b26('0x160')});db['CmList'][_0x9b26('0x112')](db[_0x9b26('0x77')],{'as':_0x9b26('0x116'),'foreignKey':_0x9b26('0x160')});db[_0x9b26('0x125')][_0x9b26('0x112')](db[_0x9b26('0x79')],{'as':'ReportAgentPreview','foreignKey':'ListId'});db[_0x9b26('0x125')][_0x9b26('0x120')](db[_0x9b26('0x1e')],{'as':'Queues','through':_0x9b26('0x14c')});db[_0x9b26('0x125')][_0x9b26('0x120')](db[_0x9b26('0x14')],{'as':'Agents','through':'cm_user_has_lists'});db['VoicePrefix']['hasMany'](db[_0x9b26('0x1b')],{'as':'Extensions','onDelete':_0x9b26('0x10d')});db[_0x9b26('0xf1')]['belongsToMany'](db[_0x9b26('0x14')],{'as':_0x9b26('0x14d'),'through':_0x9b26('0x106')});db[_0x9b26('0xf1')][_0x9b26('0x120')](db[_0x9b26('0xe0')],{'through':_0x9b26('0x104'),'as':_0x9b26('0x14e')});db['UserProfile'][_0x9b26('0x112')](db[_0x9b26('0x14')],{'as':_0x9b26('0x176'),'foreignKey':_0x9b26('0x11f')});db[_0x9b26('0xf3')][_0x9b26('0x112')](db[_0x9b26('0xf4')],{'as':_0x9b26('0x1ea'),'foreignKey':_0x9b26('0x11f'),'onDelete':'cascade'});db[_0x9b26('0xf4')][_0x9b26('0x112')](db[_0x9b26('0x1eb')],{'as':'Resources','foreignKey':_0x9b26('0x1ec'),'onDelete':_0x9b26('0x10d')});db[_0x9b26('0xf7')]['hasMany'](db['Disposition'],{'as':'Dispositions','foreignKey':_0x9b26('0x1ed'),'onDelete':'cascade'});db['WhatsappAccount'][_0x9b26('0x112')](db[_0x9b26('0x80')],{'as':_0x9b26('0x170'),'foreignKey':'WhatsappAccountId'});db[_0x9b26('0xf7')][_0x9b26('0x112')](db[_0x9b26('0xfb')],{'as':_0x9b26('0x150'),'foreignKey':_0x9b26('0x1ed')});db[_0x9b26('0xf7')]['hasMany'](db[_0x9b26('0xfa')],{'as':_0x9b26('0x15e')});db[_0x9b26('0xf7')][_0x9b26('0x112')](db[_0x9b26('0xf9')],{'as':_0x9b26('0x142'),'foreignKey':'WhatsappAccountId','onDelete':_0x9b26('0x10d')});db[_0x9b26('0xf7')][_0x9b26('0x11e')](db['CmList'],{'as':_0x9b26('0x15f'),'foreignKey':_0x9b26('0x160')});db[_0x9b26('0xf7')][_0x9b26('0x11e')](db[_0x9b26('0x87')],{'as':_0x9b26('0x14b'),'foreignKey':_0x9b26('0x162')});db[_0x9b26('0xf7')][_0x9b26('0x120')](db[_0x9b26('0x14')],{'as':_0x9b26('0x14d'),'through':_0x9b26('0x141')});db[_0x9b26('0xf9')][_0x9b26('0x11e')](db[_0x9b26('0x14')],{'onDelete':'restrict'});db[_0x9b26('0xf9')][_0x9b26('0x11e')](db[_0x9b26('0x100')],{'onDelete':'restrict'});db[_0x9b26('0xf9')][_0x9b26('0x11e')](db[_0x9b26('0xf7')],{'onDelete':'restrict'});db[_0x9b26('0xf9')][_0x9b26('0x11e')](db['Interval'],{'onDelete':_0x9b26('0x15a'),'foreignKey':_0x9b26('0x14a')});db[_0x9b26('0xf9')]['belongsTo'](db[_0x9b26('0x8d')],{'onDelete':_0x9b26('0x15a'),'foreignKey':_0x9b26('0x16d')});db[_0x9b26('0xfa')]['hasMany'](db['WhatsappMessage'],{'as':_0x9b26('0x150'),'onDelete':_0x9b26('0x10d'),'foreignKey':_0x9b26('0x1ee')});db[_0x9b26('0xfa')][_0x9b26('0x11e')](db['WhatsappAccount'],{'as':_0x9b26('0x165'),'foreignKey':'WhatsappAccountId'});db[_0x9b26('0xfa')][_0x9b26('0x11e')](db[_0x9b26('0x122')],{'as':_0x9b26('0x155'),'foreignKey':'ContactId'});db[_0x9b26('0xfa')]['belongsTo'](db['User'],{'as':_0x9b26('0x166'),'foreignKey':_0x9b26('0x10e')});db[_0x9b26('0xfa')][_0x9b26('0x120')](db[_0x9b26('0x8d')],{'through':'whatsapp_interaction_has_tags','as':'Tags'});db[_0x9b26('0xfa')][_0x9b26('0x120')](db[_0x9b26('0x8d')],{'through':'whatsapp_interaction_has_tags','as':_0x9b26('0x17f')});db[_0x9b26('0xfa')][_0x9b26('0x120')](db[_0x9b26('0x14')],{'as':_0x9b26('0x176'),'through':_0x9b26('0x12f'),'foreignKey':'WhatsappInteractionId'});db['WhatsappMessage']['belongsTo'](db[_0x9b26('0x14')],{'as':_0x9b26('0x14')});db['WhatsappMessage'][_0x9b26('0x11e')](db['CmContact'],{'onDelete':_0x9b26('0x10d'),'as':_0x9b26('0x155')});db[_0x9b26('0xfb')][_0x9b26('0x11e')](db[_0x9b26('0xfa')],{'onDelete':_0x9b26('0x10d'),'as':'Interaction','foreignKey':_0x9b26('0x1ee')});db['WhatsappMessage']['belongsTo'](db[_0x9b26('0xf7')],{'as':_0x9b26('0x165'),'foreignKey':'WhatsappAccountId'});db[_0x9b26('0xfd')][_0x9b26('0x11e')](db[_0x9b26('0xf7')],{});db[_0x9b26('0xfd')][_0x9b26('0x11e')](db[_0x9b26('0x125')],{'as':'List','foreignKey':'ListId'});db['WhatsappQueueReport'][_0x9b26('0x11e')](db[_0x9b26('0x122')],{'as':'Contact','foreignKey':_0x9b26('0x156')});db[_0x9b26('0xfd')][_0x9b26('0x11e')](db['WhatsappInteraction'],{});db[_0x9b26('0xfd')][_0x9b26('0x11e')](db[_0x9b26('0x100')],{});db[_0x9b26('0xfd')][_0x9b26('0x11e')](db[_0x9b26('0xfb')],{});db[_0x9b26('0xfd')][_0x9b26('0x11e')](db[_0x9b26('0x14')],{});db[_0x9b26('0xff')][_0x9b26('0x11e')](db[_0x9b26('0xfb')],{});db[_0x9b26('0xff')]['belongsTo'](db['WhatsappInteraction'],{});db[_0x9b26('0xff')][_0x9b26('0x11e')](db[_0x9b26('0xf7')],{'foreignKey':_0x9b26('0x1ef'),'as':_0x9b26('0x1da')});db[_0x9b26('0xff')][_0x9b26('0x11e')](db[_0x9b26('0xf7')],{'foreignKey':_0x9b26('0x1f0'),'as':_0x9b26('0x1de')});db[_0x9b26('0xff')]['belongsTo'](db[_0x9b26('0x100')],{'foreignKey':_0x9b26('0x1f1'),'as':'ToQueue'});db[_0x9b26('0xff')][_0x9b26('0x11e')](db[_0x9b26('0x14')],{'foreignKey':'FromUserId','as':_0x9b26('0x1db')});db[_0x9b26('0xff')][_0x9b26('0x11e')](db['User'],{'foreignKey':_0x9b26('0x1dc'),'as':_0x9b26('0x1dd')});db['WhatsappQueue'][_0x9b26('0x120')](db[_0x9b26('0x14')],{'as':_0x9b26('0x14d'),'through':'UserWhatsappQueue','foreignKey':_0x9b26('0x1f2')});db['WhatsappQueue'][_0x9b26('0x120')](db[_0x9b26('0xe0')],{'through':_0x9b26('0x1d5'),'as':_0x9b26('0x14e')});db[_0x9b26('0x107')][_0x9b26('0x11e')](db[_0x9b26('0x14')],{'as':_0x9b26('0x1f3'),'foreignKey':_0x9b26('0x10e'),'onDelete':_0x9b26('0x10d'),'hooks':!![]});db['CloudProvider']['hasOne'](db[_0x9b26('0xc3')],{'as':_0x9b26('0xc3'),'onDelete':_0x9b26('0x15a')});db[_0x9b26('0x159')][_0x9b26('0x10b')](db[_0x9b26('0x3e')],{'as':_0x9b26('0x15b'),'onDelete':'restrict'});db[_0x9b26('0x159')][_0x9b26('0x10b')](db[_0x9b26('0x40')],{'as':_0x9b26('0x15c'),'onDelete':_0x9b26('0x15a')});module[_0x9b26('0x1f4')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0xf4f2=['../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','Network','ChatQueueReport','ChatInternalMessage','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','Setting','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','../api/team/team.model','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','../api/migration/migration.model','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','../api/cmList/cmList.model','UserProfile','../api/userProfile/userProfile.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','UserSetting','../api/user-setting/user-setting.model','MailInteractionHasTag','../api/mailInteractionHasTag/mailInteractionHasTag.model','hasOne','VoiceMail','cascade','UserId','userSetting','hasMany','Recordings','UserVoiceQueueRt','Extensions','HopperFinals','CmHopperHistory','HopperHistory','ChatInteractions','SmsInteractions','FaxInteractions','MailInteractions','WhatsappInteractions','SenderId','Hoppers','SET\x20NULL','belongsTo','belongsToMany','Groups','chat_group_has_users','Contacts','cm_user_has_contacts','CmList','Lists','cm_user_has_lists','Team','user_has_teams','user_has_mail_interactions','user_has_fax_interactions','OpenchannelInteractions','user_has_openchannel_interactions','VoiceQueues','VoicePrefixes','ChatQueues','FaxQueues','SmsQueues','OpenchannelQueues','WhatsappQueues','ChatWebsite','ChatWebsites','FaxAccounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','WhatsappAccounts','user_has_whatsapp_accounts','SpiedAgents','Applications','moh_has_sounds','Members','VoiceQueueId','HopperHistories','HopperBlacks','JscriptySessions','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','voice_queues_has_cm_lists','Agents','BlackLists','voice_queues_has_cm_blacklists','Messages','mailboxuser','mailbox','VoiceQueueReport','QueueCalls','uniqueid','VoiceAgentReport','AgentReports','Contact','ContactId','CloudProviderId','MailAccountId','Smtp','Dispositions','MailMessage','Interactions','List','Template','mandatoryDispositionPause','mandatoryDispositionPauseId','user_has_mail_accounts','team_has_mail_queues','Teams','MailInteractionId','Account','Tags','mail_interaction_has_tags','ThroughTags','Attachment','Attachments','ChatWebsiteId','ChatOfflineMessageId','restrict','ListId','DashboardItem','Items','FaxAccountId','Answers','FaxMessage','FaxInteractionId','Owner','fax_interaction_has_tags','Users','AttachmentId','team_has_fax_queues','SmsAccountId','SmsMessage','user_has_sms_accounts','TagId','SmsInteractionId','sms_interaction_has_tags','user_has_sms_interactions','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelInteractionId','openchannel_interaction_has_tags','Interaction','team_has_openchannel_queues','ChatProactiveAction','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','user_has_chat_interactions','team_has_chat_queues','ChatGroupId','CmCompany','Phones','CmContactId','CmHopper','Company','cm_contact_has_tags','CmHopperAdditionalPhone','AdditionalPhones','OwnerId','CampaignId','All','OneAll','Automation','OneAny','AutomationAnyId','Actions','AutomationId','ParentId','MailApplications','SmsApplications','DefaultReportId','CustomReportId','Mohs','ItemTypeId','Hopper','CmHopperId','AllConditions','AllCondition','TriggerAllId','AnyConditions','TriggerAnyId','TriggerId','Fields','MetricId','SalesforceAccount','Configurations','AccountId','SalesforceField','SubjectId','Descriptions','DescriptionId','FieldId','Subject','Field','SugarcrmAccount','Description','int_desk_configuration_has_tags','VariableId','ZendeskAccount','Subjects','int_freshdesk_configuration_has_tags','FromId','ToId','JscriptyQuestionReport','SessionId','JscriptyAnswerReport','JscriptyProject','ProjectId','MailQueues','team_has_whatsapp_queues','VoicePrefix','TeamVoicePrefix','SquareProjectId','campaigns_has_cm_lists','FromAccount','FromUserId','FromAgent','ToUserId','ToQueue','ToAccount','FromChatWebsiteId','ToAgent','ToChatQueueId','ToChatWebsiteId','FaxTransferReport','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','userProfileId','UserProfileSection','Resources','sectionId','WhatsappAccountId','WhatsappInteractionId','whatsapp_interaction_has_tags','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','user','Imap','exports','../config/environment','sequelize','jstz','determine','defaultsDeep','xC@LL1234','utf8mb4','name','utf8_general_ci','sequelizeHistory','motion2','xcall','127.0.0.1','mysql','utf8','database','username','password','options','User','import','../api/user/user.model','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','../api/voiceAgentReport/voiceAgentReport.model','../api/voiceQueueReport/voiceQueueReport.model','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueue','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','UserSmsQueue','UserOpenchannelQueue','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','Dashboard','../api/dashboard/dashboard.model','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','SmsInteraction','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','../api/chatProactiveAction/chatProactiveAction.model','CmContact','../api/cmHopper/cmHopper.model','CmHopperBlack','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','ContactItemType','../api/contactItemType/contactItemType.model','CmContactHasItem','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','Integration','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','AnalyticDefaultReport','AnalyticExtractedReport','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','../api/intSalesforceField/intSalesforceField.model','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','DeskConfiguration','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','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','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','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','FreshsalesAccount'];(function(_0x31ef50,_0x5edc2d){var _0x3855ae=function(_0x497d38){while(--_0x497d38){_0x31ef50['push'](_0x31ef50['shift']());}};_0x3855ae(++_0x5edc2d);}(_0xf4f2,0x12e));var _0x2f4f=function(_0x366ba1,_0x374fc4){_0x366ba1=_0x366ba1-0x0;var _0x17dcc4=_0xf4f2[_0x366ba1];return _0x17dcc4;};'use strict';var config=require(_0x2f4f('0x0'));var Sequelize=require(_0x2f4f('0x1'));var _=require('lodash');var jstz=require(_0x2f4f('0x2'));var timezone=jstz[_0x2f4f('0x3')]();config['sequelize']=_[_0x2f4f('0x4')](config['sequelize'],{'database':'motion2','username':'xcall','password':_0x2f4f('0x5'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x2f4f('0x6')},'logging':![],'timezone':timezone[_0x2f4f('0x7')](),'define':{'charset':'utf8','collate':_0x2f4f('0x8')}}});config[_0x2f4f('0x9')]=_[_0x2f4f('0x4')](config[_0x2f4f('0x9')],{'database':_0x2f4f('0xa'),'username':_0x2f4f('0xb'),'password':_0x2f4f('0x5'),'options':{'host':_0x2f4f('0xc'),'port':0xcea,'dialect':_0x2f4f('0xd'),'dialectOptions':{'charset':_0x2f4f('0x6')},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0x2f4f('0xe'),'collate':_0x2f4f('0x8')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x2f4f('0x1')][_0x2f4f('0xf')],config[_0x2f4f('0x1')][_0x2f4f('0x10')],config[_0x2f4f('0x1')][_0x2f4f('0x11')],config[_0x2f4f('0x1')][_0x2f4f('0x12')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x2f4f('0x9')]['database'],config[_0x2f4f('0x9')][_0x2f4f('0x10')],config['sequelizeHistory'][_0x2f4f('0x11')],config['sequelizeHistory'][_0x2f4f('0x12')])};db[_0x2f4f('0x13')]=db['sequelize'][_0x2f4f('0x14')](_0x2f4f('0x15'));db['VoiceChanSpy']=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0x16'));db[_0x2f4f('0x17')]=db[_0x2f4f('0x1')]['import'](_0x2f4f('0x18'));db[_0x2f4f('0x19')]=db[_0x2f4f('0x1')]['import'](_0x2f4f('0x1a'));db[_0x2f4f('0x1b')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')]('../api/voiceMusicOnHold/voiceMusicOnHold.model');db[_0x2f4f('0x1c')]=db[_0x2f4f('0x1')]['import'](_0x2f4f('0x1d'));db[_0x2f4f('0x1e')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0x1f'));db[_0x2f4f('0x20')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')]('../api/screenRecording/screenRecording.model');db['VoiceMail']=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0x21'));db[_0x2f4f('0x22')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0x23'));db[_0x2f4f('0x24')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')]('../api/voiceCallReport/voiceCallReport.model');db[_0x2f4f('0x25')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0x26'));db['VoiceAgentReport']=db[_0x2f4f('0x1')]['import'](_0x2f4f('0x27'));db['VoiceQueueReport']=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0x28'));db['MemberReport']=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0x29'));db[_0x2f4f('0x2a')]=db[_0x2f4f('0x1')]['import'](_0x2f4f('0x2b'));db['VoiceTransferReport']=db[_0x2f4f('0x1')]['import'](_0x2f4f('0x2c'));db['UserVoiceQueueRt']=db['sequelize'][_0x2f4f('0x14')]('../api/userVoiceQueueRt/userVoiceQueueRt.model');db[_0x2f4f('0x2d')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')]('../api/userVoiceQueue/userVoiceQueue.model');db[_0x2f4f('0x2e')]=db['sequelize']['import'](_0x2f4f('0x2f'));db[_0x2f4f('0x30')]=db['sequelize'][_0x2f4f('0x14')](_0x2f4f('0x31'));db[_0x2f4f('0x32')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')]('../api/userFaxQueue/userFaxQueue.model');db[_0x2f4f('0x33')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')]('../api/userSmsQueue/userSmsQueue.model');db[_0x2f4f('0x34')]=db[_0x2f4f('0x1')]['import']('../api/userOpenchannelQueue/userOpenchannelQueue.model');db[_0x2f4f('0x35')]=db['sequelize'][_0x2f4f('0x14')](_0x2f4f('0x36'));db[_0x2f4f('0x37')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')]('../api/mailServerIn/mailServerIn.model');db[_0x2f4f('0x38')]=db['sequelize'][_0x2f4f('0x14')](_0x2f4f('0x39'));db[_0x2f4f('0x3a')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0x3b'));db[_0x2f4f('0x3c')]=db[_0x2f4f('0x1')]['import'](_0x2f4f('0x3d'));db[_0x2f4f('0x3e')]=db['sequelize'][_0x2f4f('0x14')](_0x2f4f('0x3f'));db[_0x2f4f('0x40')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')]('../api/mailInteraction/mailInteraction.model');db['MailMessage']=db[_0x2f4f('0x1')][_0x2f4f('0x14')]('../api/mailMessage/mailMessage.model');db[_0x2f4f('0x41')]=db['sequelize'][_0x2f4f('0x14')](_0x2f4f('0x42'));db[_0x2f4f('0x43')]=db[_0x2f4f('0x1')]['import']('../api/mailQueueReport/mailQueueReport.model');db[_0x2f4f('0x44')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0x45'));db['DashboardItem']=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0x46'));db[_0x2f4f('0x47')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0x48'));db[_0x2f4f('0x49')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0x4a'));db[_0x2f4f('0x4b')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0x4c'));db['FaxMessage']=db['sequelize']['import'](_0x2f4f('0x4d'));db[_0x2f4f('0x4e')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0x4f'));db[_0x2f4f('0x50')]=db['sequelize'][_0x2f4f('0x14')](_0x2f4f('0x51'));db[_0x2f4f('0x52')]=db['sequelize'][_0x2f4f('0x14')](_0x2f4f('0x53'));db[_0x2f4f('0x54')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')]('../api/smsApplication/smsApplication.model');db[_0x2f4f('0x55')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')]('../api/smsInteraction/smsInteraction.model');db['SmsMessage']=db[_0x2f4f('0x1')][_0x2f4f('0x14')]('../api/smsMessage/smsMessage.model');db[_0x2f4f('0x56')]=db[_0x2f4f('0x1')]['import'](_0x2f4f('0x57'));db[_0x2f4f('0x58')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0x59'));db[_0x2f4f('0x5a')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0x5b'));db[_0x2f4f('0x5c')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0x5d'));db[_0x2f4f('0x5e')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0x5f'));db[_0x2f4f('0x60')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')]('../api/openchannelQueue/openchannelQueue.model');db['ChatWebsite']=db['sequelize']['import'](_0x2f4f('0x61'));db[_0x2f4f('0x62')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0x63'));db[_0x2f4f('0x64')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0x65'));db[_0x2f4f('0x66')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0x67'));db[_0x2f4f('0x68')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')]('../api/chatMessage/chatMessage.model');db[_0x2f4f('0x69')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0x6a'));db[_0x2f4f('0x6b')]=db['sequelize'][_0x2f4f('0x14')](_0x2f4f('0x6c'));db[_0x2f4f('0x6d')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0x6e'));db['ChatProactiveAction']=db['sequelize'][_0x2f4f('0x14')](_0x2f4f('0x6f'));db['CmCompany']=db['sequelize'][_0x2f4f('0x14')]('../api/cmCompany/cmCompany.model');db[_0x2f4f('0x70')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')]('../api/cmContact/cmContact.model');db['CmHopper']=db[_0x2f4f('0x1')]['import'](_0x2f4f('0x71'));db[_0x2f4f('0x72')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')]('../api/cmHopperBlack/cmHopperBlack.model');db[_0x2f4f('0x73')]=db['sequelize'][_0x2f4f('0x14')](_0x2f4f('0x74'));db['CmHopperHistory']=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0x75'));db[_0x2f4f('0x76')]=db['sequelize'][_0x2f4f('0x14')](_0x2f4f('0x77'));db[_0x2f4f('0x78')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0x79'));db[_0x2f4f('0x7a')]=db['sequelize'][_0x2f4f('0x14')]('../api/action/action.model');db['Automation']=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0x7b'));db[_0x2f4f('0x7c')]=db[_0x2f4f('0x1')]['import'](_0x2f4f('0x7d'));db[_0x2f4f('0x7e')]=db[_0x2f4f('0x1')]['import'](_0x2f4f('0x7f'));db[_0x2f4f('0x80')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')]('../api/condition/condition.model');db[_0x2f4f('0x81')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0x82'));db[_0x2f4f('0x83')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0x84'));db[_0x2f4f('0x85')]=db[_0x2f4f('0x1')]['import'](_0x2f4f('0x86'));db[_0x2f4f('0x87')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0x88'));db[_0x2f4f('0x89')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')]('../api/schedule/schedule.model');db[_0x2f4f('0x8a')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0x8b'));db[_0x2f4f('0x8c')]=db[_0x2f4f('0x1')]['import'](_0x2f4f('0x8d'));db[_0x2f4f('0x8e')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0x8f'));db[_0x2f4f('0x90')]=db[_0x2f4f('0x1')]['import']('../api/cmContactHasItem/cmContactHasItem.model');db['CmHopperAdditionalPhone']=db[_0x2f4f('0x1')]['import'](_0x2f4f('0x91'));db['Template']=db['sequelize']['import'](_0x2f4f('0x92'));db[_0x2f4f('0x93')]=db[_0x2f4f('0x1')]['import'](_0x2f4f('0x94'));db[_0x2f4f('0x95')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')]('../api/variable/variable.model');db[_0x2f4f('0x96')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0x97'));db[_0x2f4f('0x98')]=db['sequelize'][_0x2f4f('0x14')](_0x2f4f('0x99'));db[_0x2f4f('0x9a')]=db[_0x2f4f('0x1')]['import']('../api/analyticCustomReport/analyticCustomReport.model');db[_0x2f4f('0x9b')]=db['sequelize'][_0x2f4f('0x14')]('../api/analyticDefaultReport/analyticDefaultReport.model');db[_0x2f4f('0x9c')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')]('../api/analyticExtractedReport/analyticExtractedReport.model');db[_0x2f4f('0x9d')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0x9e'));db[_0x2f4f('0x9f')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0xa0'));db[_0x2f4f('0xa1')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0xa2'));db['SalesforceAccount']=db[_0x2f4f('0x1')]['import'](_0x2f4f('0xa3'));db[_0x2f4f('0xa4')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0xa5'));db['SalesforceField']=db['sequelize']['import'](_0x2f4f('0xa6'));db['SugarcrmAccount']=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0xa7'));db[_0x2f4f('0xa8')]=db['sequelize'][_0x2f4f('0x14')](_0x2f4f('0xa9'));db[_0x2f4f('0xaa')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0xab'));db[_0x2f4f('0xac')]=db['sequelize'][_0x2f4f('0x14')]('../api/intDeskAccount/intDeskAccount.model');db[_0x2f4f('0xad')]=db['sequelize'][_0x2f4f('0x14')]('../api/intDeskConfiguration/intDeskConfiguration.model');db[_0x2f4f('0xae')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0xaf'));db[_0x2f4f('0xb0')]=db[_0x2f4f('0x1')]['import'](_0x2f4f('0xb1'));db[_0x2f4f('0xb2')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0xb3'));db[_0x2f4f('0xb4')]=db['sequelize'][_0x2f4f('0x14')](_0x2f4f('0xb5'));db['ZendeskAccount']=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0xb6'));db[_0x2f4f('0xb7')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')]('../api/intZendeskConfiguration/intZendeskConfiguration.model');db[_0x2f4f('0xb8')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0xb9'));db[_0x2f4f('0xba')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0xbb'));db[_0x2f4f('0xbc')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0xbd'));db[_0x2f4f('0xbe')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0xbf'));db[_0x2f4f('0xc0')]=db['sequelize'][_0x2f4f('0x14')](_0x2f4f('0xc1'));db[_0x2f4f('0xc2')]=db['sequelize'][_0x2f4f('0x14')](_0x2f4f('0xc3'));db[_0x2f4f('0xc4')]=db['sequelize'][_0x2f4f('0x14')](_0x2f4f('0xc5'));db[_0x2f4f('0xc6')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0xc7'));db[_0x2f4f('0xc8')]=db['sequelize']['import'](_0x2f4f('0xc9'));db[_0x2f4f('0xca')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0xcb'));db[_0x2f4f('0xcc')]=db['sequelize'][_0x2f4f('0x14')](_0x2f4f('0xcd'));db[_0x2f4f('0xce')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0xcf'));db[_0x2f4f('0xd0')]=db['sequelize'][_0x2f4f('0x14')]('../api/intDynamics365Field/intDynamics365Field.model');db[_0x2f4f('0xd1')]=db[_0x2f4f('0x1')]['import'](_0x2f4f('0xd2'));db[_0x2f4f('0xd3')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0xd4'));db[_0x2f4f('0xd5')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')]('../api/intFreshsalesField/intFreshsalesField.model');db['Integration']=db['sequelize'][_0x2f4f('0x14')](_0x2f4f('0x97'));db[_0x2f4f('0xd6')]=db[_0x2f4f('0x1')]['import']('../api/network/network.model');db[_0x2f4f('0xd7')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')]('../api/chatQueueReport/chatQueueReport.model');db[_0x2f4f('0xd8')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')]('../api/chatInternalMessage/chatInternalMessage.model');db['JscriptyAnswerReport']=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0xd9'));db['JscriptyQuestionReport']=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0xda'));db[_0x2f4f('0xdb')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')]('../api/jscriptySessionReport/jscriptySessionReport.model');db[_0x2f4f('0xdc')]=db[_0x2f4f('0x1')]['import'](_0x2f4f('0xdd'));db['SquareReport']=db[_0x2f4f('0x1')]['import'](_0x2f4f('0xde'));db[_0x2f4f('0xdf')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0xe0'));db['JscriptyProject']=db[_0x2f4f('0x1')]['import']('../api/jscriptyProject/jscriptyProject.model');db[_0x2f4f('0xe1')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0xe2'));db[_0x2f4f('0xe3')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0xe4'));db[_0x2f4f('0xe5')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')]('../api/squareProject/squareProject.model');db['SquareRecording']=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0xe6'));db[_0x2f4f('0xe7')]=db['sequelize'][_0x2f4f('0x14')](_0x2f4f('0xe8'));db['Team']=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0xe9'));db[_0x2f4f('0xea')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0xeb'));db[_0x2f4f('0xec')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0xed'));db['Migration']=db[_0x2f4f('0x1')]['import'](_0x2f4f('0xee'));db['Attachment']=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0xef'));db[_0x2f4f('0xf0')]=db[_0x2f4f('0x1')]['import'](_0x2f4f('0xf1'));db[_0x2f4f('0xf2')]=db[_0x2f4f('0x1')]['import'](_0x2f4f('0xf3'));db[_0x2f4f('0xf4')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0xf5'));db['FaxTransferReport']=db[_0x2f4f('0x1')][_0x2f4f('0x14')]('../api/faxTransferReport/faxTransferReport.model');db[_0x2f4f('0xf6')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0xf7'));db[_0x2f4f('0xf8')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0xf9'));db['CmList']=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0xfa'));db['VoicePrefix']=db[_0x2f4f('0x1')][_0x2f4f('0x14')]('../api/voicePrefix/voicePrefix.model');db[_0x2f4f('0xfb')]=db['sequelize'][_0x2f4f('0x14')](_0x2f4f('0xfc'));db['UserProfileSection']=db[_0x2f4f('0x1')][_0x2f4f('0x14')]('../api/userProfileSection/userProfileSection.model');db[_0x2f4f('0xfd')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0xfe'));db[_0x2f4f('0xff')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0x100'));db[_0x2f4f('0x101')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0x102'));db[_0x2f4f('0x103')]=db['sequelize'][_0x2f4f('0x14')](_0x2f4f('0x104'));db[_0x2f4f('0x105')]=db['sequelize'][_0x2f4f('0x14')]('../api/whatsappInteraction/whatsappInteraction.model');db[_0x2f4f('0x106')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0x107'));db[_0x2f4f('0x108')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0x109'));db[_0x2f4f('0x10a')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0x10b'));db[_0x2f4f('0x10c')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0x10d'));db[_0x2f4f('0x10e')]=db['sequelize'][_0x2f4f('0x14')](_0x2f4f('0x10f'));db[_0x2f4f('0x110')]=db['sequelize'][_0x2f4f('0x14')](_0x2f4f('0x111'));db['TeamVoicePrefix']=db[_0x2f4f('0x1')][_0x2f4f('0x14')]('../api/teamVoicePrefix/teamVoicePrefix.model');db[_0x2f4f('0x112')]=db['sequelize'][_0x2f4f('0x14')](_0x2f4f('0x113'));db[_0x2f4f('0x114')]=db[_0x2f4f('0x1')]['import'](_0x2f4f('0x115'));db[_0x2f4f('0x116')]=db[_0x2f4f('0x1')][_0x2f4f('0x14')](_0x2f4f('0x117'));db['User'][_0x2f4f('0x118')](db[_0x2f4f('0x119')],{'as':_0x2f4f('0x119'),'onDelete':_0x2f4f('0x11a'),'foreignKey':_0x2f4f('0x11b')});db[_0x2f4f('0x13')][_0x2f4f('0x118')](db[_0x2f4f('0x114')],{'as':_0x2f4f('0x11c'),'onDelete':'cascade','foreignKey':_0x2f4f('0x11b')});db[_0x2f4f('0x13')][_0x2f4f('0x11d')](db[_0x2f4f('0x1e')],{'as':_0x2f4f('0x11e'),'foreignKey':_0x2f4f('0x11b')});db[_0x2f4f('0x13')]['hasMany'](db[_0x2f4f('0x11f')],{'as':'VoiceQueuesRt','foreignKey':_0x2f4f('0x11b')});db[_0x2f4f('0x13')][_0x2f4f('0x11d')](db[_0x2f4f('0x19')],{'as':_0x2f4f('0x120'),'onDelete':'cascade','hooks':!![]});db['User'][_0x2f4f('0x11d')](db[_0x2f4f('0x73')],{'as':_0x2f4f('0x121'),'foreignKey':_0x2f4f('0x11b')});db[_0x2f4f('0x13')]['hasMany'](db[_0x2f4f('0x122')],{'as':_0x2f4f('0x123'),'foreignKey':_0x2f4f('0x11b')});db[_0x2f4f('0x13')][_0x2f4f('0x11d')](db['ReportAgentPreview'],{'as':_0x2f4f('0x76'),'foreignKey':'UserId'});db[_0x2f4f('0x13')][_0x2f4f('0x11d')](db[_0x2f4f('0x5c')],{'as':'OpenchannelInteractions','foreignKey':'UserId'});db['User'][_0x2f4f('0x11d')](db[_0x2f4f('0x66')],{'as':_0x2f4f('0x124'),'foreignKey':_0x2f4f('0x11b')});db[_0x2f4f('0x13')]['hasMany'](db[_0x2f4f('0x55')],{'as':_0x2f4f('0x125'),'foreignKey':_0x2f4f('0x11b')});db[_0x2f4f('0x13')][_0x2f4f('0x11d')](db[_0x2f4f('0x4b')],{'as':_0x2f4f('0x126'),'foreignKey':_0x2f4f('0x11b')});db[_0x2f4f('0x13')][_0x2f4f('0x11d')](db[_0x2f4f('0x40')],{'as':_0x2f4f('0x127'),'foreignKey':'UserId'});db[_0x2f4f('0x13')][_0x2f4f('0x11d')](db[_0x2f4f('0x105')],{'as':_0x2f4f('0x128'),'foreignKey':_0x2f4f('0x11b')});db[_0x2f4f('0x13')]['hasMany'](db[_0x2f4f('0xff')],{'as':'UserNotifications','foreignKey':_0x2f4f('0x129')});db[_0x2f4f('0x13')][_0x2f4f('0x11d')](db['CmHopper'],{'as':_0x2f4f('0x12a'),'foreignKey':_0x2f4f('0x11b'),'onDelete':_0x2f4f('0x12b')});db['User'][_0x2f4f('0x12c')](db['UserProfile'],{'as':_0x2f4f('0xfb'),'foreignKey':'userProfileId'});db[_0x2f4f('0x13')][_0x2f4f('0x12d')](db['ChatGroup'],{'as':_0x2f4f('0x12e'),'through':_0x2f4f('0x12f')});db[_0x2f4f('0x13')][_0x2f4f('0x12d')](db['CmContact'],{'as':_0x2f4f('0x130'),'through':_0x2f4f('0x131')});db['User'][_0x2f4f('0x12d')](db[_0x2f4f('0x132')],{'as':_0x2f4f('0x133'),'through':_0x2f4f('0x134')});db['User']['belongsToMany'](db[_0x2f4f('0x135')],{'through':_0x2f4f('0x136')});db[_0x2f4f('0x13')][_0x2f4f('0x12d')](db[_0x2f4f('0x40')],{'as':_0x2f4f('0x127'),'through':_0x2f4f('0x137')});db['User'][_0x2f4f('0x12d')](db[_0x2f4f('0x66')],{'as':_0x2f4f('0x124'),'through':'user_has_chat_interactions'});db[_0x2f4f('0x13')][_0x2f4f('0x12d')](db['FaxInteraction'],{'as':_0x2f4f('0x126'),'through':_0x2f4f('0x138')});db['User']['belongsToMany'](db[_0x2f4f('0x55')],{'as':_0x2f4f('0x125'),'through':'user_has_sms_interactions'});db[_0x2f4f('0x13')][_0x2f4f('0x12d')](db['OpenchannelInteraction'],{'as':_0x2f4f('0x139'),'through':_0x2f4f('0x13a')});db[_0x2f4f('0x13')][_0x2f4f('0x12d')](db[_0x2f4f('0x105')],{'as':_0x2f4f('0x128'),'through':'user_has_whatsapp_interactions'});db[_0x2f4f('0x13')][_0x2f4f('0x12d')](db[_0x2f4f('0x1c')],{'as':_0x2f4f('0x13b'),'through':_0x2f4f('0x2d'),'required':![]});db[_0x2f4f('0x13')][_0x2f4f('0x12d')](db['VoicePrefix'],{'as':_0x2f4f('0x13c'),'through':_0x2f4f('0x112'),'required':![]});db[_0x2f4f('0x13')][_0x2f4f('0x12d')](db[_0x2f4f('0x3c')],{'as':'MailQueues','through':_0x2f4f('0x30'),'required':![]});db[_0x2f4f('0x13')][_0x2f4f('0x12d')](db[_0x2f4f('0x6b')],{'as':_0x2f4f('0x13d'),'through':_0x2f4f('0x2e'),'required':![],'hooks':!![]});db['User'][_0x2f4f('0x12d')](db[_0x2f4f('0x4e')],{'as':_0x2f4f('0x13e'),'through':_0x2f4f('0x32'),'required':![]});db[_0x2f4f('0x13')][_0x2f4f('0x12d')](db[_0x2f4f('0x56')],{'as':_0x2f4f('0x13f'),'through':'UserSmsQueue','required':![]});db[_0x2f4f('0x13')]['belongsToMany'](db[_0x2f4f('0x60')],{'as':_0x2f4f('0x140'),'through':_0x2f4f('0x34'),'required':![]});db[_0x2f4f('0x13')][_0x2f4f('0x12d')](db[_0x2f4f('0x10c')],{'as':_0x2f4f('0x141'),'through':_0x2f4f('0x35'),'required':![]});db[_0x2f4f('0x13')]['belongsToMany'](db[_0x2f4f('0x132')],{'through':_0x2f4f('0x134')});db[_0x2f4f('0x13')][_0x2f4f('0x12d')](db[_0x2f4f('0x142')],{'as':_0x2f4f('0x143'),'through':'user_has_chat_websites'});db['User'][_0x2f4f('0x12d')](db[_0x2f4f('0x47')],{'as':_0x2f4f('0x144'),'through':'user_has_fax_accounts'});db['User'][_0x2f4f('0x12d')](db[_0x2f4f('0x3a')],{'as':'MailAccounts','through':'user_has_mail_accounts'});db[_0x2f4f('0x13')][_0x2f4f('0x12d')](db[_0x2f4f('0x58')],{'as':_0x2f4f('0x145'),'through':_0x2f4f('0x146')});db[_0x2f4f('0x13')][_0x2f4f('0x12d')](db[_0x2f4f('0x52')],{'as':_0x2f4f('0x147'),'through':'user_has_sms_accounts'});db[_0x2f4f('0x13')][_0x2f4f('0x12d')](db[_0x2f4f('0x101')],{'as':_0x2f4f('0x148'),'through':_0x2f4f('0x149')});db['VoiceChanSpy'][_0x2f4f('0x11d')](db[_0x2f4f('0x19')],{'as':_0x2f4f('0x14a'),'onDelete':_0x2f4f('0x11a'),'foreignKey':'ChanSpyId'});db[_0x2f4f('0x17')][_0x2f4f('0x11d')](db['VoiceExtension'],{'onDelete':_0x2f4f('0x11a')});db[_0x2f4f('0x19')][_0x2f4f('0x11d')](db[_0x2f4f('0x19')],{'as':_0x2f4f('0x14b'),'onDelete':'cascade'});db[_0x2f4f('0x1b')][_0x2f4f('0x12d')](db['Sound'],{'as':'Sounds','through':_0x2f4f('0x14c')});db[_0x2f4f('0x1c')][_0x2f4f('0x11d')](db['UserVoiceQueueRt'],{'as':_0x2f4f('0x14d'),'foreignKey':'VoiceQueueId'});db[_0x2f4f('0x1c')][_0x2f4f('0x11d')](db['CmHopper'],{'as':_0x2f4f('0x12a'),'foreignKey':_0x2f4f('0x14e')});db[_0x2f4f('0x1c')][_0x2f4f('0x11d')](db[_0x2f4f('0x73')],{'as':_0x2f4f('0x121'),'foreignKey':_0x2f4f('0x14e')});db[_0x2f4f('0x1c')][_0x2f4f('0x11d')](db[_0x2f4f('0x122')],{'as':_0x2f4f('0x14f'),'foreignKey':'VoiceQueueId'});db[_0x2f4f('0x1c')][_0x2f4f('0x11d')](db[_0x2f4f('0x76')],{'as':'ReportAgentPreview','foreignKey':_0x2f4f('0x14e')});db[_0x2f4f('0x1c')][_0x2f4f('0x11d')](db[_0x2f4f('0x72')],{'as':_0x2f4f('0x150'),'foreignKey':_0x2f4f('0x14e')});db[_0x2f4f('0x1c')][_0x2f4f('0x11d')](db[_0x2f4f('0xdb')],{'as':_0x2f4f('0x151'),'foreignKey':'VoiceQueueId'});db[_0x2f4f('0x1c')]['belongsTo'](db[_0x2f4f('0x2a')],{'as':_0x2f4f('0x2a'),'foreignKey':_0x2f4f('0x152')});db[_0x2f4f('0x1c')][_0x2f4f('0x12c')](db['Trunk'],{'as':_0x2f4f('0x153'),'foreignKey':_0x2f4f('0x154')});db[_0x2f4f('0x1c')][_0x2f4f('0x12c')](db[_0x2f4f('0x81')],{'as':_0x2f4f('0x81'),'foreignKey':_0x2f4f('0x155')});db['VoiceQueue'][_0x2f4f('0x12c')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0x2f4f('0x1c')][_0x2f4f('0x12d')](db['CmList'],{'as':_0x2f4f('0x133'),'through':_0x2f4f('0x156')});db[_0x2f4f('0x1c')][_0x2f4f('0x12d')](db[_0x2f4f('0x13')],{'as':_0x2f4f('0x157'),'through':_0x2f4f('0x2d')});db['VoiceQueue']['belongsToMany'](db[_0x2f4f('0x135')],{'as':'Teams','through':'TeamVoiceQueue'});db['VoiceQueue'][_0x2f4f('0x12d')](db[_0x2f4f('0x132')],{'as':_0x2f4f('0x158'),'through':_0x2f4f('0x159')});db[_0x2f4f('0x1e')][_0x2f4f('0x12c')](db[_0x2f4f('0x13')],{'as':_0x2f4f('0x13'),'foreignKey':'UserId'});db['ScreenRecording']['belongsTo'](db[_0x2f4f('0x13')],{'as':'User','foreignKey':_0x2f4f('0x11b')});db[_0x2f4f('0x119')][_0x2f4f('0x11d')](db[_0x2f4f('0x22')],{'as':_0x2f4f('0x15a'),'onDelete':_0x2f4f('0x11a'),'foreignKey':_0x2f4f('0x15b'),'sourceKey':_0x2f4f('0x15c')});db[_0x2f4f('0x22')][_0x2f4f('0x12c')](db['VoiceMail'],{'foreignKey':_0x2f4f('0x15b'),'targetKey':_0x2f4f('0x15c')});db[_0x2f4f('0x24')][_0x2f4f('0x11d')](db[_0x2f4f('0x15d')],{'as':_0x2f4f('0x15e'),'foreignKey':_0x2f4f('0x15f'),'constraints':![]});db['VoiceCallReport'][_0x2f4f('0x11d')](db[_0x2f4f('0x160')],{'as':_0x2f4f('0x161'),'foreignKey':_0x2f4f('0x15f'),'constraints':![]});db['VoiceCallReport'][_0x2f4f('0x12c')](db[_0x2f4f('0x13')],{'as':_0x2f4f('0x13'),'foreignKey':_0x2f4f('0x11b')});db['VoiceCallReport'][_0x2f4f('0x12c')](db['CmContact'],{'as':_0x2f4f('0x162'),'foreignKey':_0x2f4f('0x163')});db[_0x2f4f('0x37')][_0x2f4f('0x12c')](db['MailAccount'],{'as':_0x2f4f('0x3a'),'foreignKey':'MailAccountId'});db[_0x2f4f('0x37')][_0x2f4f('0x12c')](db[_0x2f4f('0x10e')],{'as':_0x2f4f('0x10e'),'foreignKey':_0x2f4f('0x164'),'onDelete':'restrict'});db[_0x2f4f('0x38')]['belongsTo'](db['MailAccount'],{'as':_0x2f4f('0x3a'),'foreignKey':_0x2f4f('0x165')});db[_0x2f4f('0x38')][_0x2f4f('0x12c')](db[_0x2f4f('0x10e')],{'as':_0x2f4f('0x10e'),'foreignKey':_0x2f4f('0x164'),'onDelete':'restrict'});db[_0x2f4f('0x3a')]['hasOne'](db[_0x2f4f('0x37')],{'as':'Imap','onDelete':_0x2f4f('0x11a')});db[_0x2f4f('0x3a')]['hasOne'](db[_0x2f4f('0x38')],{'as':_0x2f4f('0x166'),'onDelete':_0x2f4f('0x11a')});db[_0x2f4f('0x3a')]['hasMany'](db[_0x2f4f('0x7e')],{'as':_0x2f4f('0x167'),'foreignKey':_0x2f4f('0x165'),'onDelete':_0x2f4f('0x11a')});db[_0x2f4f('0x3a')][_0x2f4f('0x11d')](db[_0x2f4f('0x7c')],{'as':'Answers','foreignKey':_0x2f4f('0x165')});db[_0x2f4f('0x3a')][_0x2f4f('0x11d')](db[_0x2f4f('0x168')],{'as':_0x2f4f('0x15a'),'foreignKey':_0x2f4f('0x165')});db[_0x2f4f('0x3a')][_0x2f4f('0x11d')](db['MailInteraction'],{'as':_0x2f4f('0x169')});db[_0x2f4f('0x3a')][_0x2f4f('0x11d')](db[_0x2f4f('0x41')],{'as':_0x2f4f('0x14b'),'foreignKey':_0x2f4f('0x165'),'onDelete':_0x2f4f('0x11a')});db[_0x2f4f('0x3a')]['belongsTo'](db[_0x2f4f('0x132')],{'as':_0x2f4f('0x16a'),'foreignKey':'ListId'});db[_0x2f4f('0x3a')][_0x2f4f('0x12c')](db[_0x2f4f('0x16b')],{'as':_0x2f4f('0x16b'),'foreignKey':'TemplateId'});db[_0x2f4f('0x3a')][_0x2f4f('0x12c')](db[_0x2f4f('0x83')],{'as':_0x2f4f('0x16c'),'foreignKey':_0x2f4f('0x16d')});db[_0x2f4f('0x3a')][_0x2f4f('0x12d')](db[_0x2f4f('0x13')],{'as':'Agents','through':_0x2f4f('0x16e')});db['MailQueue'][_0x2f4f('0x12d')](db[_0x2f4f('0x13')],{'as':'Agents','through':_0x2f4f('0x30')});db['MailQueue'][_0x2f4f('0x12d')](db[_0x2f4f('0x135')],{'through':_0x2f4f('0x16f'),'as':_0x2f4f('0x170')});db[_0x2f4f('0x40')]['hasMany'](db[_0x2f4f('0x168')],{'as':_0x2f4f('0x15a'),'onDelete':_0x2f4f('0x11a'),'foreignKey':_0x2f4f('0x171')});db[_0x2f4f('0x40')][_0x2f4f('0x12c')](db[_0x2f4f('0x3a')],{'as':_0x2f4f('0x172'),'foreignKey':_0x2f4f('0x165')});db[_0x2f4f('0x40')][_0x2f4f('0x12c')](db[_0x2f4f('0x70')],{'as':_0x2f4f('0x162'),'foreignKey':_0x2f4f('0x163')});db[_0x2f4f('0x40')][_0x2f4f('0x12c')](db[_0x2f4f('0x13')],{'as':'Owner','foreignKey':_0x2f4f('0x11b')});db['MailInteraction'][_0x2f4f('0x12d')](db[_0x2f4f('0x8c')],{'through':'mail_interaction_has_tags','as':_0x2f4f('0x173')});db[_0x2f4f('0x40')][_0x2f4f('0x12d')](db[_0x2f4f('0x8c')],{'through':_0x2f4f('0x174'),'as':_0x2f4f('0x175')});db[_0x2f4f('0x40')][_0x2f4f('0x12d')](db[_0x2f4f('0x13')],{'as':'Users','through':_0x2f4f('0x137'),'foreignKey':_0x2f4f('0x171')});db[_0x2f4f('0x168')][_0x2f4f('0x11d')](db[_0x2f4f('0x176')],{'as':_0x2f4f('0x177'),'onDelete':_0x2f4f('0x11a')});db['MailMessage'][_0x2f4f('0x12c')](db['User'],{'as':_0x2f4f('0x13')});db[_0x2f4f('0x168')][_0x2f4f('0x12c')](db['CmContact'],{'onDelete':_0x2f4f('0x11a'),'as':_0x2f4f('0x162')});db['MailMessage']['belongsTo'](db['MailInteraction'],{'as':'Interaction','foreignKey':'MailInteractionId'});db['MailMessage'][_0x2f4f('0x12c')](db[_0x2f4f('0x3a')],{'as':_0x2f4f('0x172'),'foreignKey':_0x2f4f('0x165')});db[_0x2f4f('0x168')]['belongsTo'](db[_0x2f4f('0x142')],{'as':_0x2f4f('0x142'),'foreignKey':_0x2f4f('0x178')});db[_0x2f4f('0x168')][_0x2f4f('0x12c')](db[_0x2f4f('0x69')],{'as':_0x2f4f('0x69'),'foreignKey':_0x2f4f('0x179')});db[_0x2f4f('0x41')]['belongsTo'](db[_0x2f4f('0x13')],{'onDelete':_0x2f4f('0x17a')});db[_0x2f4f('0x41')][_0x2f4f('0x12c')](db[_0x2f4f('0x3c')],{'onDelete':_0x2f4f('0x17a')});db[_0x2f4f('0x41')][_0x2f4f('0x12c')](db[_0x2f4f('0x3a')],{'onDelete':_0x2f4f('0x17a')});db['MailApplication'][_0x2f4f('0x12c')](db[_0x2f4f('0x81')],{'onDelete':'restrict','foreignKey':'IntervalId'});db[_0x2f4f('0x41')][_0x2f4f('0x12c')](db[_0x2f4f('0x8c')],{'onDelete':_0x2f4f('0x17a'),'foreignKey':'TagId'});db[_0x2f4f('0x43')]['belongsTo'](db[_0x2f4f('0x3a')],{});db['MailQueueReport'][_0x2f4f('0x12c')](db[_0x2f4f('0x132')],{'as':_0x2f4f('0x16a'),'foreignKey':_0x2f4f('0x17b')});db[_0x2f4f('0x43')][_0x2f4f('0x12c')](db[_0x2f4f('0x70')],{'as':_0x2f4f('0x162'),'foreignKey':'ContactId'});db[_0x2f4f('0x43')][_0x2f4f('0x12c')](db[_0x2f4f('0x40')],{});db['MailQueueReport'][_0x2f4f('0x12c')](db['MailMessage'],{});db['MailQueueReport'][_0x2f4f('0x12c')](db[_0x2f4f('0x13')],{});db[_0x2f4f('0x43')]['belongsTo'](db[_0x2f4f('0x3c')],{});db[_0x2f4f('0x44')]['hasMany'](db[_0x2f4f('0x17c')],{'as':_0x2f4f('0x17d'),'onDelete':'cascade'});db[_0x2f4f('0x47')][_0x2f4f('0x11d')](db['Disposition'],{'as':_0x2f4f('0x167'),'foreignKey':_0x2f4f('0x17e'),'onDelete':_0x2f4f('0x11a')});db['FaxAccount'][_0x2f4f('0x11d')](db[_0x2f4f('0x7c')],{'as':_0x2f4f('0x17f'),'foreignKey':_0x2f4f('0x17e')});db[_0x2f4f('0x47')][_0x2f4f('0x11d')](db[_0x2f4f('0x4b')],{'as':'Interactions'});db['FaxAccount'][_0x2f4f('0x11d')](db[_0x2f4f('0x49')],{'as':_0x2f4f('0x14b'),'foreignKey':_0x2f4f('0x17e'),'onDelete':'cascade'});db[_0x2f4f('0x47')][_0x2f4f('0x11d')](db['VoiceExtension'],{'as':'Exntensions','onDelete':'cascade'});db[_0x2f4f('0x47')]['hasMany'](db[_0x2f4f('0x180')],{'as':_0x2f4f('0x15a')});db[_0x2f4f('0x47')]['belongsTo'](db[_0x2f4f('0x2a')],{'as':'Trunk'});db[_0x2f4f('0x47')][_0x2f4f('0x12c')](db[_0x2f4f('0x132')],{'as':_0x2f4f('0x16a'),'foreignKey':_0x2f4f('0x17b')});db['FaxAccount'][_0x2f4f('0x12c')](db[_0x2f4f('0x83')],{'as':_0x2f4f('0x16c'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x2f4f('0x47')][_0x2f4f('0x12d')](db[_0x2f4f('0x13')],{'as':'Agents','through':'user_has_fax_accounts'});db[_0x2f4f('0x49')]['belongsTo'](db['User'],{'onDelete':_0x2f4f('0x17a')});db['FaxApplication'][_0x2f4f('0x12c')](db[_0x2f4f('0x4e')],{'onDelete':_0x2f4f('0x17a')});db[_0x2f4f('0x49')][_0x2f4f('0x12c')](db['FaxAccount'],{'onDelete':_0x2f4f('0x17a')});db[_0x2f4f('0x49')][_0x2f4f('0x12c')](db[_0x2f4f('0x8c')],{'onDelete':_0x2f4f('0x17a'),'foreignKey':'TagId'});db['FaxInteraction'][_0x2f4f('0x11d')](db['FaxMessage'],{'as':_0x2f4f('0x15a'),'onDelete':_0x2f4f('0x11a'),'foreignKey':_0x2f4f('0x181')});db[_0x2f4f('0x4b')]['belongsTo'](db[_0x2f4f('0x47')],{'as':_0x2f4f('0x172'),'foreignKey':_0x2f4f('0x17e')});db[_0x2f4f('0x4b')]['belongsTo'](db[_0x2f4f('0x70')],{'as':_0x2f4f('0x162'),'foreignKey':'ContactId'});db[_0x2f4f('0x4b')]['belongsTo'](db['User'],{'as':_0x2f4f('0x182'),'foreignKey':_0x2f4f('0x11b')});db['FaxInteraction'][_0x2f4f('0x12d')](db[_0x2f4f('0x8c')],{'through':_0x2f4f('0x183'),'as':_0x2f4f('0x173')});db[_0x2f4f('0x4b')]['belongsToMany'](db[_0x2f4f('0x8c')],{'through':_0x2f4f('0x183'),'as':_0x2f4f('0x175')});db[_0x2f4f('0x4b')]['belongsToMany'](db['User'],{'as':_0x2f4f('0x184'),'through':_0x2f4f('0x138'),'foreignKey':_0x2f4f('0x181')});db['FaxMessage'][_0x2f4f('0x12c')](db[_0x2f4f('0x13')],{'onDelete':'cascade','as':_0x2f4f('0x13')});db[_0x2f4f('0x180')][_0x2f4f('0x12c')](db[_0x2f4f('0x4b')],{'as':'Interaction','foreignKey':'FaxInteractionId'});db[_0x2f4f('0x180')]['belongsTo'](db[_0x2f4f('0x70')],{'onDelete':'cascade','as':'Contact'});db[_0x2f4f('0x180')]['belongsTo'](db[_0x2f4f('0x176')],{'as':'Attachment','foreignKey':_0x2f4f('0x185')});db[_0x2f4f('0x180')][_0x2f4f('0x12c')](db[_0x2f4f('0x47')],{'as':'Account','foreignKey':_0x2f4f('0x17e')});db[_0x2f4f('0x4e')][_0x2f4f('0x12d')](db[_0x2f4f('0x13')],{'as':_0x2f4f('0x157'),'through':'UserFaxQueue'});db[_0x2f4f('0x4e')][_0x2f4f('0x12d')](db[_0x2f4f('0x135')],{'through':_0x2f4f('0x186'),'as':_0x2f4f('0x170')});db[_0x2f4f('0x50')]['belongsTo'](db[_0x2f4f('0x47')],{});db[_0x2f4f('0x50')][_0x2f4f('0x12c')](db[_0x2f4f('0x132')],{'as':_0x2f4f('0x16a'),'foreignKey':'ListId'});db['FaxQueueReport'][_0x2f4f('0x12c')](db['CmContact'],{'as':'Contact','foreignKey':'ContactId'});db[_0x2f4f('0x50')][_0x2f4f('0x12c')](db[_0x2f4f('0x4b')],{});db['FaxQueueReport'][_0x2f4f('0x12c')](db[_0x2f4f('0x180')],{});db[_0x2f4f('0x50')]['belongsTo'](db['User'],{});db[_0x2f4f('0x50')][_0x2f4f('0x12c')](db['FaxQueue'],{});db['SmsAccount']['hasMany'](db[_0x2f4f('0x7e')],{'as':_0x2f4f('0x167'),'foreignKey':_0x2f4f('0x187'),'onDelete':_0x2f4f('0x11a')});db[_0x2f4f('0x52')][_0x2f4f('0x11d')](db[_0x2f4f('0x7c')],{'as':'Answers','foreignKey':'SmsAccountId'});db[_0x2f4f('0x52')][_0x2f4f('0x11d')](db[_0x2f4f('0x188')],{'as':'Messages','foreignKey':_0x2f4f('0x187')});db[_0x2f4f('0x52')][_0x2f4f('0x11d')](db[_0x2f4f('0x55')],{'as':_0x2f4f('0x169')});db[_0x2f4f('0x52')][_0x2f4f('0x11d')](db['SmsApplication'],{'as':'Applications','foreignKey':_0x2f4f('0x187'),'onDelete':_0x2f4f('0x11a')});db[_0x2f4f('0x52')]['belongsTo'](db[_0x2f4f('0x132')],{'as':'List','foreignKey':_0x2f4f('0x17b')});db[_0x2f4f('0x52')][_0x2f4f('0x12c')](db[_0x2f4f('0x83')],{'as':'mandatoryDispositionPause','foreignKey':_0x2f4f('0x16d')});db[_0x2f4f('0x52')]['belongsToMany'](db[_0x2f4f('0x13')],{'as':_0x2f4f('0x157'),'through':_0x2f4f('0x189')});db[_0x2f4f('0x54')]['belongsTo'](db['User'],{'onDelete':_0x2f4f('0x17a')});db[_0x2f4f('0x54')][_0x2f4f('0x12c')](db[_0x2f4f('0x56')],{'onDelete':'restrict'});db['SmsApplication'][_0x2f4f('0x12c')](db[_0x2f4f('0x52')],{'onDelete':_0x2f4f('0x17a')});db[_0x2f4f('0x54')][_0x2f4f('0x12c')](db[_0x2f4f('0x81')],{'onDelete':_0x2f4f('0x17a'),'foreignKey':_0x2f4f('0x155')});db[_0x2f4f('0x54')][_0x2f4f('0x12c')](db[_0x2f4f('0x8c')],{'onDelete':_0x2f4f('0x17a'),'foreignKey':_0x2f4f('0x18a')});db[_0x2f4f('0x55')]['hasMany'](db[_0x2f4f('0x188')],{'as':_0x2f4f('0x15a'),'onDelete':_0x2f4f('0x11a'),'foreignKey':_0x2f4f('0x18b')});db['SmsInteraction'][_0x2f4f('0x12c')](db[_0x2f4f('0x52')],{'as':_0x2f4f('0x172'),'foreignKey':_0x2f4f('0x187')});db[_0x2f4f('0x55')][_0x2f4f('0x12c')](db[_0x2f4f('0x70')],{'as':_0x2f4f('0x162'),'foreignKey':'ContactId'});db['SmsInteraction'][_0x2f4f('0x12c')](db[_0x2f4f('0x13')],{'as':_0x2f4f('0x182'),'foreignKey':'UserId'});db[_0x2f4f('0x55')]['belongsToMany'](db[_0x2f4f('0x8c')],{'through':_0x2f4f('0x18c'),'as':'Tags'});db[_0x2f4f('0x55')]['belongsToMany'](db['Tag'],{'through':_0x2f4f('0x18c'),'as':'ThroughTags'});db[_0x2f4f('0x55')][_0x2f4f('0x12d')](db[_0x2f4f('0x13')],{'as':_0x2f4f('0x184'),'through':_0x2f4f('0x18d'),'foreignKey':_0x2f4f('0x18b')});db[_0x2f4f('0x188')][_0x2f4f('0x12c')](db[_0x2f4f('0x13')],{'as':_0x2f4f('0x13')});db['SmsMessage'][_0x2f4f('0x12c')](db[_0x2f4f('0x70')],{'onDelete':'cascade','as':_0x2f4f('0x162')});db[_0x2f4f('0x188')]['belongsTo'](db[_0x2f4f('0x55')],{'onDelete':'cascade','as':'Interaction','foreignKey':_0x2f4f('0x18b')});db[_0x2f4f('0x188')][_0x2f4f('0x12c')](db[_0x2f4f('0x52')],{'as':_0x2f4f('0x172'),'foreignKey':_0x2f4f('0x187')});db[_0x2f4f('0x56')][_0x2f4f('0x12d')](db['User'],{'as':_0x2f4f('0x157'),'through':_0x2f4f('0x33'),'foreignKey':_0x2f4f('0x18e')});db[_0x2f4f('0x56')][_0x2f4f('0x12d')](db[_0x2f4f('0x135')],{'through':_0x2f4f('0x18f'),'as':_0x2f4f('0x170')});db[_0x2f4f('0x58')][_0x2f4f('0x11d')](db['Disposition'],{'as':_0x2f4f('0x167'),'foreignKey':_0x2f4f('0x190'),'onDelete':_0x2f4f('0x11a')});db[_0x2f4f('0x58')][_0x2f4f('0x11d')](db['CannedAnswer'],{'as':_0x2f4f('0x17f'),'foreignKey':_0x2f4f('0x190')});db[_0x2f4f('0x58')][_0x2f4f('0x11d')](db['OpenchannelInteraction'],{'as':'Interactions','foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0x2f4f('0x11d')](db[_0x2f4f('0x5e')],{'as':_0x2f4f('0x15a'),'foreignKey':'OpenchannelAccountId'});db[_0x2f4f('0x58')][_0x2f4f('0x11d')](db[_0x2f4f('0x5a')],{'as':_0x2f4f('0x14b'),'foreignKey':'OpenchannelAccountId','onDelete':'cascade'});db[_0x2f4f('0x58')]['belongsTo'](db[_0x2f4f('0x132')],{'as':_0x2f4f('0x16a'),'foreignKey':'ListId'});db['OpenchannelAccount'][_0x2f4f('0x12c')](db[_0x2f4f('0x83')],{'as':_0x2f4f('0x16c'),'foreignKey':_0x2f4f('0x16d')});db[_0x2f4f('0x58')]['belongsToMany'](db[_0x2f4f('0x13')],{'as':_0x2f4f('0x157'),'through':_0x2f4f('0x146')});db[_0x2f4f('0x5a')][_0x2f4f('0x12c')](db[_0x2f4f('0x13')],{'onDelete':'restrict'});db[_0x2f4f('0x5a')]['belongsTo'](db[_0x2f4f('0x60')],{'onDelete':_0x2f4f('0x17a'),'foreignKey':'OpenchannelQueueId'});db[_0x2f4f('0x5a')][_0x2f4f('0x12c')](db['OpenchannelAccount'],{'onDelete':_0x2f4f('0x17a'),'foreignKey':_0x2f4f('0x190')});db['OpenchannelApplication'][_0x2f4f('0x12c')](db[_0x2f4f('0x81')],{'onDelete':_0x2f4f('0x17a'),'foreignKey':_0x2f4f('0x155')});db[_0x2f4f('0x5a')]['belongsTo'](db['Tag'],{'onDelete':'restrict','foreignKey':_0x2f4f('0x18a')});db[_0x2f4f('0x5c')][_0x2f4f('0x11d')](db[_0x2f4f('0x5e')],{'as':_0x2f4f('0x15a'),'onDelete':_0x2f4f('0x11a'),'foreignKey':_0x2f4f('0x191')});db[_0x2f4f('0x5c')]['belongsTo'](db[_0x2f4f('0x58')],{'as':'Account','foreignKey':_0x2f4f('0x190')});db[_0x2f4f('0x5c')][_0x2f4f('0x12c')](db[_0x2f4f('0x70')],{'as':'Contact','foreignKey':_0x2f4f('0x163')});db[_0x2f4f('0x5c')]['belongsTo'](db[_0x2f4f('0x13')],{'as':'Owner','foreignKey':_0x2f4f('0x11b')});db['OpenchannelInteraction'][_0x2f4f('0x12d')](db[_0x2f4f('0x8c')],{'through':_0x2f4f('0x192'),'as':'Tags'});db[_0x2f4f('0x5c')][_0x2f4f('0x12d')](db[_0x2f4f('0x8c')],{'through':_0x2f4f('0x192'),'as':_0x2f4f('0x175')});db[_0x2f4f('0x5c')][_0x2f4f('0x12d')](db['User'],{'as':_0x2f4f('0x184'),'through':_0x2f4f('0x13a'),'foreignKey':_0x2f4f('0x191')});db[_0x2f4f('0x5e')][_0x2f4f('0x12c')](db['User'],{'onDelete':'cascade','as':_0x2f4f('0x13')});db[_0x2f4f('0x5e')][_0x2f4f('0x12c')](db[_0x2f4f('0x70')],{'onDelete':'cascade','as':_0x2f4f('0x162')});db[_0x2f4f('0x5e')][_0x2f4f('0x12c')](db['OpenchannelInteraction'],{'onDelete':'cascade','as':_0x2f4f('0x193'),'foreignKey':_0x2f4f('0x191')});db['OpenchannelMessage']['belongsTo'](db[_0x2f4f('0x176')],{'as':'Attachment','foreignKey':_0x2f4f('0x185')});db[_0x2f4f('0x5e')][_0x2f4f('0x12c')](db[_0x2f4f('0x58')],{'as':_0x2f4f('0x172'),'foreignKey':_0x2f4f('0x190')});db['OpenchannelQueue'][_0x2f4f('0x12d')](db['User'],{'as':'Agents','through':'UserOpenchannelQueue','foreignKey':'OpenchannelQueueId'});db['OpenchannelQueue'][_0x2f4f('0x12d')](db[_0x2f4f('0x135')],{'through':_0x2f4f('0x194'),'as':_0x2f4f('0x170')});db[_0x2f4f('0x142')]['hasMany'](db[_0x2f4f('0x7e')],{'as':_0x2f4f('0x167'),'foreignKey':_0x2f4f('0x178'),'onDelete':_0x2f4f('0x11a')});db['ChatWebsite']['hasMany'](db['CannedAnswer'],{'as':_0x2f4f('0x17f'),'foreignKey':'ChatWebsiteId'});db[_0x2f4f('0x142')][_0x2f4f('0x11d')](db[_0x2f4f('0x195')],{'as':'ProactiveActions'});db[_0x2f4f('0x142')][_0x2f4f('0x11d')](db[_0x2f4f('0x66')],{'as':'Interactions'});db[_0x2f4f('0x142')][_0x2f4f('0x11d')](db['ChatApplication'],{'as':_0x2f4f('0x14b'),'foreignKey':_0x2f4f('0x178'),'onDelete':_0x2f4f('0x11a')});db[_0x2f4f('0x142')][_0x2f4f('0x11d')](db[_0x2f4f('0x68')],{'as':_0x2f4f('0x15a')});db[_0x2f4f('0x142')]['belongsTo'](db[_0x2f4f('0x132')],{'as':'List','foreignKey':_0x2f4f('0x17b')});db[_0x2f4f('0x142')][_0x2f4f('0x12c')](db[_0x2f4f('0x81')],{'as':_0x2f4f('0x81'),'foreignKey':_0x2f4f('0x155')});db['ChatWebsite'][_0x2f4f('0x12c')](db[_0x2f4f('0x3a')],{'as':_0x2f4f('0x3a'),'foreignKey':_0x2f4f('0x165')});db[_0x2f4f('0x142')]['belongsTo'](db['Pause'],{'as':_0x2f4f('0x16c'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x2f4f('0x142')][_0x2f4f('0x12d')](db['User'],{'as':_0x2f4f('0x157'),'through':'user_has_chat_websites'});db[_0x2f4f('0x62')][_0x2f4f('0x12c')](db[_0x2f4f('0x58')],{});db['OpenchannelQueueReport'][_0x2f4f('0x12c')](db[_0x2f4f('0x132')],{'as':_0x2f4f('0x16a'),'foreignKey':_0x2f4f('0x17b')});db[_0x2f4f('0x62')][_0x2f4f('0x12c')](db[_0x2f4f('0x70')],{'as':_0x2f4f('0x162'),'foreignKey':'ContactId'});db[_0x2f4f('0x62')][_0x2f4f('0x12c')](db[_0x2f4f('0x5c')],{});db['OpenchannelQueueReport']['belongsTo'](db[_0x2f4f('0x5e')],{});db[_0x2f4f('0x62')][_0x2f4f('0x12c')](db[_0x2f4f('0x13')],{});db['OpenchannelQueueReport']['belongsTo'](db['OpenchannelQueue'],{});db[_0x2f4f('0x64')][_0x2f4f('0x12c')](db[_0x2f4f('0x13')],{'as':_0x2f4f('0x196'),'foreignKey':_0x2f4f('0x11b'),'onDelete':_0x2f4f('0x17a')});db[_0x2f4f('0x64')][_0x2f4f('0x12c')](db[_0x2f4f('0x6b')],{'as':_0x2f4f('0x197'),'foreignKey':_0x2f4f('0x198'),'onDelete':_0x2f4f('0x17a')});db['ChatApplication'][_0x2f4f('0x12c')](db[_0x2f4f('0x142')],{'as':_0x2f4f('0x199'),'foreignKey':_0x2f4f('0x178'),'onDelete':_0x2f4f('0x17a')});db[_0x2f4f('0x64')][_0x2f4f('0x12c')](db[_0x2f4f('0x8c')],{'onDelete':_0x2f4f('0x17a'),'foreignKey':_0x2f4f('0x18a')});db[_0x2f4f('0x66')][_0x2f4f('0x11d')](db[_0x2f4f('0x68')],{'as':_0x2f4f('0x15a'),'onDelete':_0x2f4f('0x11a'),'foreignKey':_0x2f4f('0x19a')});db[_0x2f4f('0x66')]['belongsTo'](db[_0x2f4f('0x142')],{'as':_0x2f4f('0x172'),'foreignKey':_0x2f4f('0x178')});db[_0x2f4f('0x66')][_0x2f4f('0x12c')](db[_0x2f4f('0x70')],{'as':_0x2f4f('0x162'),'foreignKey':_0x2f4f('0x163')});db[_0x2f4f('0x66')]['belongsTo'](db[_0x2f4f('0x13')],{'as':'Owner','foreignKey':_0x2f4f('0x11b')});db[_0x2f4f('0x66')][_0x2f4f('0x12d')](db['Tag'],{'through':_0x2f4f('0x19b'),'as':'Tags'});db['ChatInteraction'][_0x2f4f('0x12d')](db[_0x2f4f('0x8c')],{'through':_0x2f4f('0x19b'),'as':_0x2f4f('0x175')});db['ChatInteraction'][_0x2f4f('0x12d')](db[_0x2f4f('0x13')],{'as':'Users','through':_0x2f4f('0x19c'),'foreignKey':_0x2f4f('0x19a')});db[_0x2f4f('0x68')][_0x2f4f('0x12c')](db['User'],{'onDelete':_0x2f4f('0x11a'),'as':_0x2f4f('0x13')});db[_0x2f4f('0x68')][_0x2f4f('0x12c')](db[_0x2f4f('0x70')],{'onDelete':'cascade','as':_0x2f4f('0x162'),'foreignKey':'ContactId'});db[_0x2f4f('0x68')]['belongsTo'](db[_0x2f4f('0x66')],{'onDelete':_0x2f4f('0x11a'),'as':'Interaction','foreignKey':_0x2f4f('0x19a')});db[_0x2f4f('0x68')]['belongsTo'](db[_0x2f4f('0x176')],{'as':_0x2f4f('0x176'),'foreignKey':'AttachmentId'});db['ChatMessage'][_0x2f4f('0x12c')](db[_0x2f4f('0x142')],{'as':'Account','foreignKey':_0x2f4f('0x178')});db[_0x2f4f('0x69')][_0x2f4f('0x11d')](db[_0x2f4f('0x176')],{'as':_0x2f4f('0x177'),'foreignKey':_0x2f4f('0x179'),'onDelete':'cascade','hooks':!![]});db[_0x2f4f('0x69')]['belongsTo'](db[_0x2f4f('0x70')],{'onDelete':_0x2f4f('0x11a'),'as':_0x2f4f('0x162'),'foreignKey':_0x2f4f('0x163')});db[_0x2f4f('0x69')][_0x2f4f('0x12c')](db['ChatWebsite'],{'as':_0x2f4f('0x172'),'foreignKey':_0x2f4f('0x178')});db['ChatQueue'][_0x2f4f('0x12d')](db[_0x2f4f('0x13')],{'as':_0x2f4f('0x157'),'through':_0x2f4f('0x2e'),'hooks':!![]});db[_0x2f4f('0x6b')][_0x2f4f('0x12d')](db[_0x2f4f('0x135')],{'through':_0x2f4f('0x19d'),'as':_0x2f4f('0x170')});db[_0x2f4f('0x6d')]['hasMany'](db[_0x2f4f('0xd8')],{'as':_0x2f4f('0x15a'),'foreignKey':_0x2f4f('0x19e'),'onDelete':_0x2f4f('0x11a')});db[_0x2f4f('0x6d')]['belongsToMany'](db[_0x2f4f('0x13')],{'as':_0x2f4f('0x14d'),'through':'chat_group_has_users'});db[_0x2f4f('0x195')]['belongsTo'](db['ChatWebsite'],{'as':_0x2f4f('0x199'),'foreignKey':_0x2f4f('0x178')});db[_0x2f4f('0x19f')]['hasMany'](db['CmContact'],{'as':'Contacts','foreignKey':'CompanyId'});db[_0x2f4f('0x70')][_0x2f4f('0x11d')](db[_0x2f4f('0x90')],{'as':_0x2f4f('0x1a0'),'foreignKey':_0x2f4f('0x1a1')});db['CmContact'][_0x2f4f('0x11d')](db[_0x2f4f('0x1a2')],{'as':_0x2f4f('0x12a'),'foreignKey':'ContactId'});db[_0x2f4f('0x70')]['hasMany'](db[_0x2f4f('0x73')],{'as':'HopperFinals','foreignKey':_0x2f4f('0x163')});db['CmContact'][_0x2f4f('0x11d')](db['CmHopperHistory'],{'as':_0x2f4f('0x14f'),'foreignKey':_0x2f4f('0x163')});db[_0x2f4f('0x70')]['hasMany'](db['ReportAgentPreview'],{'as':_0x2f4f('0x76'),'foreignKey':_0x2f4f('0x163')});db[_0x2f4f('0x70')]['hasMany'](db[_0x2f4f('0xdb')],{'as':_0x2f4f('0x151'),'foreignKey':_0x2f4f('0x163')});db[_0x2f4f('0x70')]['hasMany'](db[_0x2f4f('0x5c')],{'as':_0x2f4f('0x139'),'foreignKey':_0x2f4f('0x163'),'onDelete':_0x2f4f('0x17a')});db[_0x2f4f('0x70')]['hasMany'](db['ChatInteraction'],{'as':_0x2f4f('0x124'),'foreignKey':_0x2f4f('0x163'),'onDelete':_0x2f4f('0x17a')});db[_0x2f4f('0x70')][_0x2f4f('0x11d')](db['SmsInteraction'],{'as':'SmsInteractions','foreignKey':_0x2f4f('0x163'),'onDelete':_0x2f4f('0x17a')});db[_0x2f4f('0x70')][_0x2f4f('0x11d')](db[_0x2f4f('0x4b')],{'as':'FaxInteractions','foreignKey':'ContactId','onDelete':'restrict'});db[_0x2f4f('0x70')][_0x2f4f('0x11d')](db['MailInteraction'],{'as':_0x2f4f('0x127'),'foreignKey':'ContactId','onDelete':'restrict'});db[_0x2f4f('0x70')][_0x2f4f('0x12c')](db[_0x2f4f('0x19f')],{'as':_0x2f4f('0x1a3'),'foreignKey':'CompanyId'});db[_0x2f4f('0x70')]['belongsTo'](db[_0x2f4f('0x132')],{'as':_0x2f4f('0x16a'),'foreignKey':_0x2f4f('0x17b'),'onDelete':_0x2f4f('0x11a')});db[_0x2f4f('0x70')][_0x2f4f('0x12d')](db[_0x2f4f('0x13')],{'as':'Users','through':_0x2f4f('0x131')});db['CmContact'][_0x2f4f('0x12d')](db[_0x2f4f('0x8c')],{'as':'Tags','through':'cm_contact_has_tags'});db['CmContact'][_0x2f4f('0x12d')](db[_0x2f4f('0x8c')],{'through':_0x2f4f('0x1a4'),'as':_0x2f4f('0x175')});db['CmHopper'][_0x2f4f('0x11d')](db[_0x2f4f('0x1a5')],{'as':_0x2f4f('0x1a6'),'foreignKey':'CmHopperId'});db[_0x2f4f('0x1a2')][_0x2f4f('0x12c')](db[_0x2f4f('0x70')],{'as':'Contact','foreignKey':_0x2f4f('0x163'),'onDelete':_0x2f4f('0x11a')});db[_0x2f4f('0x1a2')][_0x2f4f('0x12c')](db['CmList'],{'as':_0x2f4f('0x16a'),'foreignKey':_0x2f4f('0x17b'),'onDelete':_0x2f4f('0x11a')});db[_0x2f4f('0x1a2')][_0x2f4f('0x12c')](db[_0x2f4f('0x13')],{'as':_0x2f4f('0x196'),'foreignKey':_0x2f4f('0x11b')});db[_0x2f4f('0x1a2')][_0x2f4f('0x12c')](db[_0x2f4f('0x1c')],{'as':_0x2f4f('0x197'),'foreignKey':_0x2f4f('0x14e'),'onDelete':_0x2f4f('0x11a')});db[_0x2f4f('0x1a2')][_0x2f4f('0x12c')](db[_0x2f4f('0xec')],{'as':_0x2f4f('0xec'),'foreignKey':'CampaignId','onDelete':_0x2f4f('0x11a')});db['CmHopper'][_0x2f4f('0x12c')](db['User'],{'as':'Owner','foreignKey':_0x2f4f('0x1a7')});db[_0x2f4f('0x72')][_0x2f4f('0x12c')](db['CmContact'],{'as':_0x2f4f('0x162'),'foreignKey':_0x2f4f('0x163'),'onDelete':_0x2f4f('0x11a')});db[_0x2f4f('0x72')][_0x2f4f('0x12c')](db[_0x2f4f('0x132')],{'as':_0x2f4f('0x16a'),'foreignKey':'ListId','onDelete':'cascade'});db[_0x2f4f('0x72')]['belongsTo'](db[_0x2f4f('0x1c')],{'as':_0x2f4f('0x197'),'foreignKey':_0x2f4f('0x14e'),'onDelete':_0x2f4f('0x11a')});db[_0x2f4f('0x72')]['belongsTo'](db['Campaign'],{'as':'Campaign','foreignKey':_0x2f4f('0x1a8'),'onDelete':_0x2f4f('0x11a')});db['Automation'][_0x2f4f('0x11d')](db[_0x2f4f('0x80')],{'as':{'plural':_0x2f4f('0x1a9'),'singular':_0x2f4f('0x1aa')},'foreignKey':'AutomationAllId','onDelete':_0x2f4f('0x11a'),'hooks':!![]});db[_0x2f4f('0x1ab')][_0x2f4f('0x11d')](db[_0x2f4f('0x80')],{'as':{'plural':'Any','singular':_0x2f4f('0x1ac')},'foreignKey':_0x2f4f('0x1ad'),'onDelete':'cascade','hooks':!![]});db[_0x2f4f('0x1ab')]['hasMany'](db[_0x2f4f('0x7a')],{'as':_0x2f4f('0x1ae'),'foreignKey':_0x2f4f('0x1af'),'onDelete':'cascade','hooks':!![]});db[_0x2f4f('0x7e')][_0x2f4f('0x11d')](db[_0x2f4f('0x7e')],{'as':_0x2f4f('0x167'),'foreignKey':_0x2f4f('0x1b0'),'onDelete':_0x2f4f('0x11a')});db[_0x2f4f('0x81')]['hasMany'](db[_0x2f4f('0x81')],{'as':'Intervals','foreignKey':'IntervalId','onDelete':'cascade','hooks':!![],'required':![]});db[_0x2f4f('0x81')]['hasMany'](db['VoiceExtension'],{'as':_0x2f4f('0x120'),'foreignKey':_0x2f4f('0x155'),'onDelete':'restrict'});db[_0x2f4f('0x81')][_0x2f4f('0x11d')](db[_0x2f4f('0x41')],{'as':_0x2f4f('0x1b1'),'foreignKey':_0x2f4f('0x155')});db[_0x2f4f('0x81')]['hasMany'](db['ChatApplication'],{'as':'ChatApplications','foreignKey':_0x2f4f('0x155')});db['Interval']['hasMany'](db[_0x2f4f('0x49')],{'as':'FaxApplications','foreignKey':_0x2f4f('0x155')});db[_0x2f4f('0x81')]['hasMany'](db[_0x2f4f('0x54')],{'as':_0x2f4f('0x1b2'),'foreignKey':'IntervalId'});db[_0x2f4f('0x89')][_0x2f4f('0x12c')](db[_0x2f4f('0x3a')],{});db[_0x2f4f('0x89')][_0x2f4f('0x12c')](db[_0x2f4f('0x9b')],{'foreignKey':_0x2f4f('0x1b3')});db[_0x2f4f('0x89')]['belongsTo'](db[_0x2f4f('0x9a')],{'foreignKey':_0x2f4f('0x1b4')});db[_0x2f4f('0x8a')][_0x2f4f('0x12d')](db['VoiceMusicOnHold'],{'as':_0x2f4f('0x1b5'),'through':_0x2f4f('0x14c'),'onDelete':_0x2f4f('0x17a')});db[_0x2f4f('0x8c')]['belongsToMany'](db['CmContact'],{'through':_0x2f4f('0x1a4')});db[_0x2f4f('0x8c')]['belongsToMany'](db[_0x2f4f('0x66')],{'through':_0x2f4f('0x19b')});db['Tag'][_0x2f4f('0x12d')](db[_0x2f4f('0x40')],{'through':_0x2f4f('0x174')});db[_0x2f4f('0x8c')]['belongsToMany'](db[_0x2f4f('0x55')],{'through':_0x2f4f('0x18c')});db['Tag'][_0x2f4f('0x12d')](db[_0x2f4f('0x4b')],{'through':'fax_interaction_has_tags'});db['Tag'][_0x2f4f('0x12d')](db['OpenchannelInteraction'],{'through':'openchannel_interaction_has_tags'});db[_0x2f4f('0x8c')][_0x2f4f('0x12d')](db['WhatsappInteraction'],{'through':'whatsapp_interaction_has_tags'});db[_0x2f4f('0x90')][_0x2f4f('0x12c')](db['ContactItemType'],{'as':'ItemType','foreignKey':_0x2f4f('0x1b6')});db[_0x2f4f('0x1a5')]['belongsTo'](db[_0x2f4f('0x1a2')],{'as':_0x2f4f('0x1b7'),'foreignKey':_0x2f4f('0x1b8')});db['CmContactHasItem'][_0x2f4f('0x12c')](db[_0x2f4f('0x70')],{'as':'Contact','foreignKey':_0x2f4f('0x1a1')});db['Trigger'][_0x2f4f('0x11d')](db[_0x2f4f('0x80')],{'as':{'plural':_0x2f4f('0x1b9'),'singular':_0x2f4f('0x1ba')},'foreignKey':_0x2f4f('0x1bb'),'onDelete':_0x2f4f('0x11a'),'hooks':!![]});db[_0x2f4f('0x93')][_0x2f4f('0x11d')](db[_0x2f4f('0x80')],{'as':{'plural':_0x2f4f('0x1bc'),'singular':'AnyCondition'},'foreignKey':_0x2f4f('0x1bd'),'onDelete':'cascade','hooks':!![]});db['Trigger'][_0x2f4f('0x11d')](db[_0x2f4f('0x7a')],{'as':_0x2f4f('0x1ae'),'foreignKey':_0x2f4f('0x1be'),'onDelete':'cascade','hooks':!![]});db[_0x2f4f('0x9a')]['hasMany'](db['AnalyticFieldReport'],{'as':_0x2f4f('0x1bf'),'onDelete':_0x2f4f('0x11a'),'foreignKey':_0x2f4f('0x1b4'),'hooks':!![]});db['AnalyticDefaultReport']['hasMany'](db[_0x2f4f('0x9f')],{'as':_0x2f4f('0x1bf'),'onDelete':_0x2f4f('0x11a'),'foreignKey':_0x2f4f('0x1b3')});db[_0x2f4f('0x9d')][_0x2f4f('0x11d')](db['AnalyticFieldReport'],{'as':_0x2f4f('0x1bf'),'onDelete':'cascade','foreignKey':_0x2f4f('0x1c0')});db[_0x2f4f('0x9f')][_0x2f4f('0x12c')](db[_0x2f4f('0x9d')],{'foreignKey':_0x2f4f('0x1c0')});db[_0x2f4f('0x1c1')]['hasMany'](db[_0x2f4f('0xa4')],{'as':_0x2f4f('0x1c2'),'onDelete':_0x2f4f('0x11a'),'foreignKey':_0x2f4f('0x1c3')});db['SalesforceConfiguration'][_0x2f4f('0x11d')](db[_0x2f4f('0x1c4')],{'as':'Subjects','onDelete':_0x2f4f('0x11a'),'foreignKey':_0x2f4f('0x1c5')});db[_0x2f4f('0xa4')]['hasMany'](db['SalesforceField'],{'as':_0x2f4f('0x1c6'),'onDelete':'cascade','foreignKey':_0x2f4f('0x1c7')});db[_0x2f4f('0xa4')][_0x2f4f('0x11d')](db[_0x2f4f('0x1c4')],{'as':_0x2f4f('0x1bf'),'onDelete':'cascade','foreignKey':_0x2f4f('0x1c8')});db[_0x2f4f('0xa4')][_0x2f4f('0x12c')](db[_0x2f4f('0x1c1')],{'as':_0x2f4f('0x172'),'foreignKey':_0x2f4f('0x1c3')});db[_0x2f4f('0x1c4')][_0x2f4f('0x11d')](db['SalesforceField'],{'as':_0x2f4f('0x1c9'),'foreignKey':_0x2f4f('0x1c5')});db[_0x2f4f('0x1c4')]['hasMany'](db['SalesforceField'],{'as':'Description','foreignKey':_0x2f4f('0x1c7')});db[_0x2f4f('0x1c4')][_0x2f4f('0x11d')](db[_0x2f4f('0x1c4')],{'as':_0x2f4f('0x1ca'),'foreignKey':_0x2f4f('0x1c8')});db['SalesforceField']['belongsTo'](db['Variable'],{'as':'Variable','foreignKey':'VariableId'});db[_0x2f4f('0x1cb')][_0x2f4f('0x11d')](db['SugarcrmConfiguration'],{'as':_0x2f4f('0x1c2'),'onDelete':_0x2f4f('0x11a'),'foreignKey':'AccountId'});db[_0x2f4f('0xa8')][_0x2f4f('0x11d')](db[_0x2f4f('0xaa')],{'as':'Subjects','onDelete':_0x2f4f('0x11a'),'foreignKey':'SubjectId'});db[_0x2f4f('0xa8')][_0x2f4f('0x11d')](db[_0x2f4f('0xaa')],{'as':_0x2f4f('0x1c6'),'onDelete':'cascade','foreignKey':_0x2f4f('0x1c7')});db['SugarcrmConfiguration']['hasMany'](db[_0x2f4f('0xaa')],{'as':'Fields','onDelete':_0x2f4f('0x11a'),'foreignKey':'FieldId'});db['SugarcrmConfiguration'][_0x2f4f('0x12c')](db[_0x2f4f('0x1cb')],{'as':_0x2f4f('0x172'),'foreignKey':_0x2f4f('0x1c3')});db['SugarcrmField'][_0x2f4f('0x11d')](db['SugarcrmField'],{'as':_0x2f4f('0x1c9'),'foreignKey':_0x2f4f('0x1c5')});db['SugarcrmField'][_0x2f4f('0x11d')](db[_0x2f4f('0xaa')],{'as':_0x2f4f('0x1cc'),'foreignKey':_0x2f4f('0x1c7')});db['SugarcrmField']['hasMany'](db['SugarcrmField'],{'as':_0x2f4f('0x1ca'),'foreignKey':_0x2f4f('0x1c8')});db[_0x2f4f('0xaa')][_0x2f4f('0x12c')](db[_0x2f4f('0x95')],{'as':_0x2f4f('0x95'),'foreignKey':'VariableId'});db[_0x2f4f('0xac')][_0x2f4f('0x11d')](db[_0x2f4f('0xad')],{'as':_0x2f4f('0x1c2'),'onDelete':'cascade','foreignKey':_0x2f4f('0x1c3')});db[_0x2f4f('0xad')][_0x2f4f('0x11d')](db['DeskField'],{'as':'Subjects','onDelete':'cascade','foreignKey':'SubjectId'});db['DeskConfiguration'][_0x2f4f('0x11d')](db[_0x2f4f('0xae')],{'as':'Descriptions','onDelete':_0x2f4f('0x11a'),'foreignKey':_0x2f4f('0x1c7')});db[_0x2f4f('0xad')]['hasMany'](db[_0x2f4f('0xae')],{'as':_0x2f4f('0x1bf'),'onDelete':_0x2f4f('0x11a'),'foreignKey':'FieldId'});db[_0x2f4f('0xad')][_0x2f4f('0x12c')](db[_0x2f4f('0xac')],{'as':_0x2f4f('0x172'),'foreignKey':_0x2f4f('0x1c3')});db[_0x2f4f('0xad')][_0x2f4f('0x12d')](db['Tag'],{'through':_0x2f4f('0x1cd')});db[_0x2f4f('0xae')][_0x2f4f('0x11d')](db[_0x2f4f('0xae')],{'as':_0x2f4f('0x1c9'),'foreignKey':'SubjectId'});db['DeskField']['hasMany'](db[_0x2f4f('0xae')],{'as':_0x2f4f('0x1cc'),'foreignKey':_0x2f4f('0x1c7')});db[_0x2f4f('0xae')][_0x2f4f('0x11d')](db[_0x2f4f('0xae')],{'as':_0x2f4f('0x1ca'),'foreignKey':_0x2f4f('0x1c8')});db['DeskField'][_0x2f4f('0x12c')](db['Variable'],{'as':'Variable','foreignKey':_0x2f4f('0x1ce')});db[_0x2f4f('0xb0')]['hasMany'](db[_0x2f4f('0xb2')],{'as':_0x2f4f('0x1c2'),'onDelete':_0x2f4f('0x11a'),'foreignKey':'AccountId'});db[_0x2f4f('0xb2')][_0x2f4f('0x11d')](db[_0x2f4f('0xb4')],{'as':'Subjects','onDelete':_0x2f4f('0x11a'),'foreignKey':_0x2f4f('0x1c5')});db[_0x2f4f('0xb2')][_0x2f4f('0x11d')](db[_0x2f4f('0xb4')],{'as':_0x2f4f('0x1c6'),'onDelete':_0x2f4f('0x11a'),'foreignKey':'DescriptionId'});db[_0x2f4f('0xb2')][_0x2f4f('0x11d')](db[_0x2f4f('0xb4')],{'as':_0x2f4f('0x1bf'),'onDelete':_0x2f4f('0x11a'),'foreignKey':_0x2f4f('0x1c8')});db[_0x2f4f('0xb2')][_0x2f4f('0x12c')](db[_0x2f4f('0xb0')],{'as':'Account','foreignKey':'AccountId'});db[_0x2f4f('0xb4')]['hasMany'](db['ZohoField'],{'as':_0x2f4f('0x1c9'),'foreignKey':_0x2f4f('0x1c5')});db[_0x2f4f('0xb4')][_0x2f4f('0x11d')](db['ZohoField'],{'as':_0x2f4f('0x1cc'),'foreignKey':_0x2f4f('0x1c7')});db['ZohoField'][_0x2f4f('0x11d')](db[_0x2f4f('0xb4')],{'as':_0x2f4f('0x1ca'),'foreignKey':_0x2f4f('0x1c8')});db[_0x2f4f('0xb4')]['belongsTo'](db[_0x2f4f('0x95')],{'as':_0x2f4f('0x95'),'foreignKey':_0x2f4f('0x1ce')});db[_0x2f4f('0x1cf')]['hasMany'](db[_0x2f4f('0xb7')],{'as':_0x2f4f('0x1c2'),'onDelete':_0x2f4f('0x11a'),'foreignKey':_0x2f4f('0x1c3')});db[_0x2f4f('0xb7')][_0x2f4f('0x11d')](db[_0x2f4f('0xb8')],{'as':_0x2f4f('0x1d0'),'foreignKey':_0x2f4f('0x1c5')});db[_0x2f4f('0xb7')][_0x2f4f('0x11d')](db[_0x2f4f('0xb8')],{'as':_0x2f4f('0x1c6'),'foreignKey':_0x2f4f('0x1c7')});db[_0x2f4f('0xb7')][_0x2f4f('0x11d')](db['ZendeskField'],{'as':_0x2f4f('0x1bf'),'foreignKey':_0x2f4f('0x1c8')});db[_0x2f4f('0xb7')][_0x2f4f('0x12c')](db[_0x2f4f('0x1cf')],{'as':_0x2f4f('0x172'),'foreignKey':_0x2f4f('0x1c3')});db[_0x2f4f('0xb7')][_0x2f4f('0x12d')](db[_0x2f4f('0x8c')],{'through':'int_zendesk_configuration_has_tags'});db[_0x2f4f('0xb8')]['hasMany'](db['ZendeskField'],{'as':_0x2f4f('0x1c9'),'foreignKey':_0x2f4f('0x1c5')});db[_0x2f4f('0xb8')][_0x2f4f('0x11d')](db['ZendeskField'],{'as':'Description','foreignKey':'DescriptionId'});db['ZendeskField'][_0x2f4f('0x11d')](db[_0x2f4f('0xb8')],{'as':_0x2f4f('0x1ca'),'foreignKey':_0x2f4f('0x1c8')});db['ZendeskField'][_0x2f4f('0x12c')](db['Variable'],{'as':_0x2f4f('0x95'),'foreignKey':_0x2f4f('0x1ce')});db['FreshdeskAccount'][_0x2f4f('0x11d')](db[_0x2f4f('0xbc')],{'as':_0x2f4f('0x1c2'),'onDelete':_0x2f4f('0x11a'),'foreignKey':_0x2f4f('0x1c3')});db['FreshdeskConfiguration'][_0x2f4f('0x11d')](db[_0x2f4f('0xbe')],{'as':_0x2f4f('0x1d0'),'onDelete':_0x2f4f('0x11a'),'foreignKey':'SubjectId'});db['FreshdeskConfiguration'][_0x2f4f('0x11d')](db[_0x2f4f('0xbe')],{'as':_0x2f4f('0x1c6'),'onDelete':_0x2f4f('0x11a'),'foreignKey':_0x2f4f('0x1c7')});db[_0x2f4f('0xbc')][_0x2f4f('0x11d')](db[_0x2f4f('0xbe')],{'as':_0x2f4f('0x1bf'),'onDelete':_0x2f4f('0x11a'),'foreignKey':_0x2f4f('0x1c8')});db[_0x2f4f('0xbc')][_0x2f4f('0x12c')](db['FreshdeskAccount'],{'as':_0x2f4f('0x172'),'foreignKey':'AccountId'});db[_0x2f4f('0xbc')][_0x2f4f('0x12d')](db[_0x2f4f('0x8c')],{'through':_0x2f4f('0x1d1')});db['FreshdeskField']['hasMany'](db[_0x2f4f('0xbe')],{'as':_0x2f4f('0x1c9'),'foreignKey':_0x2f4f('0x1c5')});db[_0x2f4f('0xbe')][_0x2f4f('0x11d')](db[_0x2f4f('0xbe')],{'as':_0x2f4f('0x1cc'),'foreignKey':_0x2f4f('0x1c7')});db[_0x2f4f('0xbe')][_0x2f4f('0x11d')](db[_0x2f4f('0xbe')],{'as':'Field','foreignKey':'FieldId'});db[_0x2f4f('0xbe')][_0x2f4f('0x12c')](db[_0x2f4f('0x95')],{'as':_0x2f4f('0x95'),'foreignKey':'VariableId'});db['VtigerAccount'][_0x2f4f('0x11d')](db[_0x2f4f('0xc2')],{'as':_0x2f4f('0x1c2'),'onDelete':_0x2f4f('0x11a'),'foreignKey':_0x2f4f('0x1c3')});db['VtigerConfiguration'][_0x2f4f('0x11d')](db[_0x2f4f('0xc4')],{'as':'Subjects','foreignKey':_0x2f4f('0x1c5')});db[_0x2f4f('0xc2')][_0x2f4f('0x11d')](db[_0x2f4f('0xc4')],{'as':'Descriptions','foreignKey':_0x2f4f('0x1c7')});db['VtigerConfiguration'][_0x2f4f('0x11d')](db['VtigerField'],{'as':'Fields','foreignKey':'FieldId'});db[_0x2f4f('0xc2')]['belongsTo'](db['VtigerAccount'],{'as':_0x2f4f('0x172'),'foreignKey':_0x2f4f('0x1c3')});db['VtigerField']['hasMany'](db[_0x2f4f('0xc4')],{'as':_0x2f4f('0x1c9'),'foreignKey':_0x2f4f('0x1c5')});db['VtigerField'][_0x2f4f('0x11d')](db[_0x2f4f('0xc4')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x2f4f('0xc4')][_0x2f4f('0x11d')](db[_0x2f4f('0xc4')],{'as':_0x2f4f('0x1ca'),'foreignKey':_0x2f4f('0x1c8')});db[_0x2f4f('0xc4')][_0x2f4f('0x12c')](db['Variable'],{'as':_0x2f4f('0x95'),'foreignKey':_0x2f4f('0x1ce')});db['ServicenowAccount'][_0x2f4f('0x11d')](db[_0x2f4f('0xc8')],{'as':_0x2f4f('0x1c2'),'onDelete':_0x2f4f('0x11a'),'foreignKey':_0x2f4f('0x1c3')});db['ServicenowConfiguration'][_0x2f4f('0x11d')](db['ServicenowField'],{'as':_0x2f4f('0x1d0'),'foreignKey':'SubjectId'});db['ServicenowConfiguration']['hasMany'](db[_0x2f4f('0xca')],{'as':_0x2f4f('0x1c6'),'foreignKey':_0x2f4f('0x1c7')});db[_0x2f4f('0xc8')][_0x2f4f('0x11d')](db[_0x2f4f('0xca')],{'as':'Fields','foreignKey':'FieldId'});db[_0x2f4f('0xc8')][_0x2f4f('0x12c')](db[_0x2f4f('0xc6')],{'as':'Account','foreignKey':_0x2f4f('0x1c3')});db['ServicenowField'][_0x2f4f('0x11d')](db['ServicenowField'],{'as':'Subject','foreignKey':_0x2f4f('0x1c5')});db[_0x2f4f('0xca')][_0x2f4f('0x11d')](db[_0x2f4f('0xca')],{'as':'Description','foreignKey':_0x2f4f('0x1c7')});db['ServicenowField'][_0x2f4f('0x11d')](db[_0x2f4f('0xca')],{'as':_0x2f4f('0x1ca'),'foreignKey':'FieldId'});db['ServicenowField'][_0x2f4f('0x12c')](db['Variable'],{'as':_0x2f4f('0x95'),'foreignKey':_0x2f4f('0x1ce')});db[_0x2f4f('0xcc')][_0x2f4f('0x11d')](db['Dynamics365Configuration'],{'as':_0x2f4f('0x1c2'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0x2f4f('0xcc')][_0x2f4f('0x12c')](db['CloudProvider'],{'as':_0x2f4f('0x10e'),'foreignKey':_0x2f4f('0x164')});db[_0x2f4f('0xce')][_0x2f4f('0x11d')](db[_0x2f4f('0xd0')],{'as':_0x2f4f('0x1d0'),'onDelete':_0x2f4f('0x11a'),'foreignKey':_0x2f4f('0x1c5')});db[_0x2f4f('0xce')][_0x2f4f('0x11d')](db[_0x2f4f('0xd0')],{'as':'Descriptions','onDelete':'cascade','foreignKey':_0x2f4f('0x1c7')});db[_0x2f4f('0xce')][_0x2f4f('0x11d')](db[_0x2f4f('0xd0')],{'as':_0x2f4f('0x1bf'),'onDelete':_0x2f4f('0x11a'),'foreignKey':_0x2f4f('0x1c8')});db[_0x2f4f('0xce')][_0x2f4f('0x12c')](db['Dynamics365Account'],{'as':'Account','foreignKey':_0x2f4f('0x1c3')});db['Dynamics365Field']['hasMany'](db[_0x2f4f('0xd0')],{'as':_0x2f4f('0x1c9'),'foreignKey':_0x2f4f('0x1c5')});db[_0x2f4f('0xd0')]['hasMany'](db['Dynamics365Field'],{'as':_0x2f4f('0x1cc'),'foreignKey':'DescriptionId'});db['Dynamics365Field']['hasMany'](db[_0x2f4f('0xd0')],{'as':_0x2f4f('0x1ca'),'foreignKey':_0x2f4f('0x1c8')});db[_0x2f4f('0xd0')][_0x2f4f('0x12c')](db[_0x2f4f('0x95')],{'as':_0x2f4f('0x95'),'foreignKey':_0x2f4f('0x1ce')});db['FreshsalesAccount'][_0x2f4f('0x11d')](db[_0x2f4f('0xd3')],{'as':_0x2f4f('0x1c2'),'onDelete':_0x2f4f('0x11a'),'foreignKey':_0x2f4f('0x1c3')});db[_0x2f4f('0xd3')][_0x2f4f('0x11d')](db[_0x2f4f('0xd5')],{'as':_0x2f4f('0x1d0'),'foreignKey':_0x2f4f('0x1c5')});db['FreshsalesConfiguration'][_0x2f4f('0x11d')](db['FreshsalesField'],{'as':_0x2f4f('0x1c6'),'foreignKey':_0x2f4f('0x1c7')});db[_0x2f4f('0xd3')][_0x2f4f('0x11d')](db['FreshsalesField'],{'as':'Fields','foreignKey':_0x2f4f('0x1c8')});db['FreshsalesConfiguration']['belongsTo'](db[_0x2f4f('0xd1')],{'as':_0x2f4f('0x172'),'foreignKey':_0x2f4f('0x1c3')});db[_0x2f4f('0xd5')]['hasMany'](db['FreshsalesField'],{'as':_0x2f4f('0x1c9'),'foreignKey':_0x2f4f('0x1c5')});db[_0x2f4f('0xd5')][_0x2f4f('0x11d')](db[_0x2f4f('0xd5')],{'as':_0x2f4f('0x1cc'),'foreignKey':'DescriptionId'});db[_0x2f4f('0xd5')][_0x2f4f('0x11d')](db[_0x2f4f('0xd5')],{'as':_0x2f4f('0x1ca'),'foreignKey':_0x2f4f('0x1c8')});db[_0x2f4f('0xd5')]['belongsTo'](db[_0x2f4f('0x95')],{'as':_0x2f4f('0x95'),'foreignKey':'VariableId'});db['ChatQueueReport'][_0x2f4f('0x12c')](db[_0x2f4f('0x142')],{});db[_0x2f4f('0xd7')]['belongsTo'](db[_0x2f4f('0x132')],{'as':_0x2f4f('0x16a'),'foreignKey':_0x2f4f('0x17b')});db[_0x2f4f('0xd7')][_0x2f4f('0x12c')](db['CmContact'],{'as':_0x2f4f('0x162'),'foreignKey':_0x2f4f('0x163')});db['ChatQueueReport'][_0x2f4f('0x12c')](db['ChatInteraction'],{});db[_0x2f4f('0xd7')][_0x2f4f('0x12c')](db[_0x2f4f('0x68')],{});db['ChatQueueReport'][_0x2f4f('0x12c')](db[_0x2f4f('0x13')],{});db['ChatQueueReport']['belongsTo'](db[_0x2f4f('0x6b')],{});db[_0x2f4f('0xd8')]['belongsTo'](db[_0x2f4f('0x13')],{'onDelete':'cascade','foreignKey':_0x2f4f('0x1d2')});db['ChatInternalMessage']['belongsTo'](db[_0x2f4f('0x13')],{'onDelete':'cascade','foreignKey':_0x2f4f('0x1d3')});db['JscriptySessionReport'][_0x2f4f('0x11d')](db[_0x2f4f('0x1d4')],{'foreignKey':_0x2f4f('0x1d5'),'onDelete':_0x2f4f('0x11a')});db[_0x2f4f('0xdb')][_0x2f4f('0x11d')](db[_0x2f4f('0x1d6')],{'foreignKey':'SessionId','onDelete':_0x2f4f('0x11a')});db['SmsQueueReport'][_0x2f4f('0x12c')](db[_0x2f4f('0x52')],{});db[_0x2f4f('0xdc')][_0x2f4f('0x12c')](db[_0x2f4f('0x132')],{'as':_0x2f4f('0x16a'),'foreignKey':_0x2f4f('0x17b')});db['SmsQueueReport'][_0x2f4f('0x12c')](db[_0x2f4f('0x70')],{'as':_0x2f4f('0x162'),'foreignKey':_0x2f4f('0x163')});db[_0x2f4f('0xdc')]['belongsTo'](db[_0x2f4f('0x55')],{});db[_0x2f4f('0xdc')][_0x2f4f('0x12c')](db[_0x2f4f('0x188')],{});db[_0x2f4f('0xdc')][_0x2f4f('0x12c')](db[_0x2f4f('0x13')],{});db[_0x2f4f('0xdc')][_0x2f4f('0x12c')](db[_0x2f4f('0x56')],{});db[_0x2f4f('0x1d7')][_0x2f4f('0x11d')](db[_0x2f4f('0xdb')],{'foreignKey':'ProjectId'});db['JscriptyProject']['hasMany'](db['JscriptyQuestionReport'],{'foreignKey':_0x2f4f('0x1d8')});db[_0x2f4f('0x1d7')]['hasMany'](db[_0x2f4f('0x1d6')],{'foreignKey':_0x2f4f('0x1d8')});db['Team'][_0x2f4f('0x12d')](db[_0x2f4f('0x13')],{'as':_0x2f4f('0x157'),'through':_0x2f4f('0x136')});db['Team'][_0x2f4f('0x12d')](db['VoiceQueue'],{'through':_0x2f4f('0x110'),'as':_0x2f4f('0x13b')});db[_0x2f4f('0x135')][_0x2f4f('0x12d')](db[_0x2f4f('0x3c')],{'through':'team_has_mail_queues','as':_0x2f4f('0x1d9')});db[_0x2f4f('0x135')]['belongsToMany'](db[_0x2f4f('0x6b')],{'through':_0x2f4f('0x19d'),'as':_0x2f4f('0x13d')});db[_0x2f4f('0x135')][_0x2f4f('0x12d')](db[_0x2f4f('0x4e')],{'through':_0x2f4f('0x186'),'as':'FaxQueues'});db['Team'][_0x2f4f('0x12d')](db[_0x2f4f('0x56')],{'through':_0x2f4f('0x18f'),'as':_0x2f4f('0x13f')});db['Team'][_0x2f4f('0x12d')](db['OpenchannelQueue'],{'through':_0x2f4f('0x194'),'as':'OpenchannelQueues'});db[_0x2f4f('0x135')][_0x2f4f('0x12d')](db[_0x2f4f('0x10c')],{'through':_0x2f4f('0x1da'),'as':_0x2f4f('0x141')});db['Team'][_0x2f4f('0x12d')](db[_0x2f4f('0x1db')],{'through':_0x2f4f('0x1dc'),'as':_0x2f4f('0x13c')});db['Campaign']['hasMany'](db[_0x2f4f('0x1a2')],{'as':_0x2f4f('0x12a'),'foreignKey':_0x2f4f('0x1a8')});db[_0x2f4f('0xec')]['hasMany'](db[_0x2f4f('0x73')],{'as':_0x2f4f('0x121'),'foreignKey':_0x2f4f('0x1a8')});db[_0x2f4f('0xec')][_0x2f4f('0x11d')](db[_0x2f4f('0x122')],{'as':_0x2f4f('0x14f'),'foreignKey':_0x2f4f('0x1a8')});db[_0x2f4f('0xec')][_0x2f4f('0x11d')](db[_0x2f4f('0x72')],{'as':_0x2f4f('0x150'),'foreignKey':_0x2f4f('0x1a8')});db['Campaign'][_0x2f4f('0x12c')](db[_0x2f4f('0x2a')],{'as':_0x2f4f('0x2a'),'foreignKey':_0x2f4f('0x152')});db[_0x2f4f('0xec')][_0x2f4f('0x12c')](db[_0x2f4f('0x2a')],{'as':_0x2f4f('0x153'),'foreignKey':_0x2f4f('0x154')});db[_0x2f4f('0xec')][_0x2f4f('0x12c')](db[_0x2f4f('0x81')],{'as':'Interval','foreignKey':_0x2f4f('0x155')});db[_0x2f4f('0xec')][_0x2f4f('0x12c')](db[_0x2f4f('0xe5')],{'as':_0x2f4f('0xe5'),'foreignKey':_0x2f4f('0x1dd')});db[_0x2f4f('0xec')]['belongsToMany'](db[_0x2f4f('0x132')],{'as':_0x2f4f('0x133'),'through':_0x2f4f('0x1de')});db[_0x2f4f('0xec')][_0x2f4f('0x12d')](db[_0x2f4f('0x132')],{'as':_0x2f4f('0x158'),'through':'campaigns_has_cm_blacklists'});db[_0x2f4f('0x176')][_0x2f4f('0x12c')](db['ChatOfflineMessage'],{'as':_0x2f4f('0x69'),'foreignKey':_0x2f4f('0x179')});db[_0x2f4f('0xf2')]['belongsTo'](db[_0x2f4f('0x168')],{});db['MailTransferReport'][_0x2f4f('0x12c')](db['MailInteraction'],{});db[_0x2f4f('0xf2')]['belongsTo'](db[_0x2f4f('0x3a')],{'foreignKey':'FromMailAccountId','as':_0x2f4f('0x1df')});db[_0x2f4f('0xf2')][_0x2f4f('0x12c')](db[_0x2f4f('0x13')],{'foreignKey':_0x2f4f('0x1e0'),'as':_0x2f4f('0x1e1')});db[_0x2f4f('0xf2')][_0x2f4f('0x12c')](db[_0x2f4f('0x13')],{'foreignKey':_0x2f4f('0x1e2'),'as':'ToAgent'});db['MailTransferReport'][_0x2f4f('0x12c')](db[_0x2f4f('0x3c')],{'foreignKey':'ToMailQueueId','as':_0x2f4f('0x1e3')});db[_0x2f4f('0xf2')]['belongsTo'](db[_0x2f4f('0x3a')],{'foreignKey':'ToMailAccountId','as':_0x2f4f('0x1e4')});db['ChatTransferReport'][_0x2f4f('0x12c')](db[_0x2f4f('0x68')],{});db[_0x2f4f('0xf4')][_0x2f4f('0x12c')](db['ChatInteraction'],{});db[_0x2f4f('0xf4')][_0x2f4f('0x12c')](db[_0x2f4f('0x142')],{'foreignKey':_0x2f4f('0x1e5'),'as':_0x2f4f('0x1df')});db[_0x2f4f('0xf4')][_0x2f4f('0x12c')](db[_0x2f4f('0x13')],{'foreignKey':_0x2f4f('0x1e0'),'as':_0x2f4f('0x1e1')});db[_0x2f4f('0xf4')][_0x2f4f('0x12c')](db[_0x2f4f('0x13')],{'foreignKey':_0x2f4f('0x1e2'),'as':_0x2f4f('0x1e6')});db['ChatTransferReport']['belongsTo'](db[_0x2f4f('0x6b')],{'foreignKey':_0x2f4f('0x1e7'),'as':_0x2f4f('0x1e3')});db['ChatTransferReport'][_0x2f4f('0x12c')](db[_0x2f4f('0x142')],{'foreignKey':_0x2f4f('0x1e8'),'as':_0x2f4f('0x1e4')});db[_0x2f4f('0x1e9')]['belongsTo'](db[_0x2f4f('0x180')],{});db[_0x2f4f('0x1e9')][_0x2f4f('0x12c')](db['FaxInteraction'],{});db['FaxTransferReport'][_0x2f4f('0x12c')](db[_0x2f4f('0x47')],{'foreignKey':_0x2f4f('0x1ea'),'as':'FromAccount'});db['FaxTransferReport'][_0x2f4f('0x12c')](db[_0x2f4f('0x13')],{'foreignKey':'FromUserId','as':_0x2f4f('0x1e1')});db[_0x2f4f('0x1e9')]['belongsTo'](db[_0x2f4f('0x13')],{'foreignKey':_0x2f4f('0x1e2'),'as':_0x2f4f('0x1e6')});db['FaxTransferReport']['belongsTo'](db[_0x2f4f('0x4e')],{'foreignKey':_0x2f4f('0x1eb'),'as':'ToQueue'});db[_0x2f4f('0x1e9')][_0x2f4f('0x12c')](db[_0x2f4f('0x47')],{'foreignKey':_0x2f4f('0x1ec'),'as':_0x2f4f('0x1e4')});db[_0x2f4f('0xf6')][_0x2f4f('0x12c')](db[_0x2f4f('0x5e')],{});db[_0x2f4f('0xf6')][_0x2f4f('0x12c')](db[_0x2f4f('0x5c')],{});db[_0x2f4f('0xf6')][_0x2f4f('0x12c')](db[_0x2f4f('0x58')],{'foreignKey':_0x2f4f('0x1ed'),'as':_0x2f4f('0x1df')});db['OpenchannelTransferReport'][_0x2f4f('0x12c')](db[_0x2f4f('0x13')],{'foreignKey':'FromUserId','as':_0x2f4f('0x1e1')});db[_0x2f4f('0xf6')][_0x2f4f('0x12c')](db['User'],{'foreignKey':_0x2f4f('0x1e2'),'as':'ToAgent'});db[_0x2f4f('0xf6')][_0x2f4f('0x12c')](db[_0x2f4f('0x60')],{'foreignKey':'ToOpenchannelQueueId','as':_0x2f4f('0x1e3')});db['OpenchannelTransferReport'][_0x2f4f('0x12c')](db[_0x2f4f('0x58')],{'foreignKey':_0x2f4f('0x1ee'),'as':'ToAccount'});db[_0x2f4f('0xf8')]['belongsTo'](db[_0x2f4f('0x188')],{});db[_0x2f4f('0xf8')][_0x2f4f('0x12c')](db['SmsInteraction'],{});db[_0x2f4f('0xf8')]['belongsTo'](db[_0x2f4f('0x52')],{'foreignKey':_0x2f4f('0x1ef'),'as':_0x2f4f('0x1df')});db[_0x2f4f('0xf8')][_0x2f4f('0x12c')](db[_0x2f4f('0x13')],{'foreignKey':_0x2f4f('0x1e0'),'as':_0x2f4f('0x1e1')});db[_0x2f4f('0xf8')][_0x2f4f('0x12c')](db[_0x2f4f('0x13')],{'foreignKey':_0x2f4f('0x1e2'),'as':_0x2f4f('0x1e6')});db[_0x2f4f('0xf8')]['belongsTo'](db[_0x2f4f('0x56')],{'foreignKey':_0x2f4f('0x1f0'),'as':_0x2f4f('0x1e3')});db[_0x2f4f('0xf8')][_0x2f4f('0x12c')](db[_0x2f4f('0x52')],{'foreignKey':_0x2f4f('0x1f1'),'as':_0x2f4f('0x1e4')});db[_0x2f4f('0x132')][_0x2f4f('0x11d')](db[_0x2f4f('0x7e')],{'as':_0x2f4f('0x167'),'foreignKey':'ListId','onDelete':_0x2f4f('0x11a')});db[_0x2f4f('0x132')][_0x2f4f('0x11d')](db['CmCustomField'],{'as':'CustomFields','foreignKey':'ListId'});db[_0x2f4f('0x132')][_0x2f4f('0x11d')](db['CmContact'],{'as':_0x2f4f('0x130'),'onDelete':'cascade','foreignKey':_0x2f4f('0x17b')});db[_0x2f4f('0x132')][_0x2f4f('0x11d')](db[_0x2f4f('0x73')],{'as':_0x2f4f('0x121'),'foreignKey':_0x2f4f('0x17b')});db[_0x2f4f('0x132')][_0x2f4f('0x11d')](db[_0x2f4f('0x122')],{'as':'HopperHistory','foreignKey':'ListId'});db[_0x2f4f('0x132')]['hasMany'](db['ReportAgentPreview'],{'as':_0x2f4f('0x76'),'foreignKey':_0x2f4f('0x17b')});db[_0x2f4f('0x132')][_0x2f4f('0x12d')](db[_0x2f4f('0x1c')],{'as':'Queues','through':_0x2f4f('0x156')});db[_0x2f4f('0x132')][_0x2f4f('0x12d')](db[_0x2f4f('0x13')],{'as':'Agents','through':'cm_user_has_lists'});db[_0x2f4f('0x1db')]['hasMany'](db[_0x2f4f('0x19')],{'as':'Extensions','onDelete':'cascade'});db['VoicePrefix'][_0x2f4f('0x12d')](db['User'],{'as':_0x2f4f('0x157'),'through':_0x2f4f('0x112')});db['VoicePrefix'][_0x2f4f('0x12d')](db['Team'],{'through':_0x2f4f('0x1dc'),'as':_0x2f4f('0x170')});db[_0x2f4f('0xfb')][_0x2f4f('0x11d')](db[_0x2f4f('0x13')],{'as':_0x2f4f('0x184'),'foreignKey':_0x2f4f('0x1f2')});db[_0x2f4f('0xfb')]['hasMany'](db[_0x2f4f('0x1f3')],{'as':'UserProfileSections','foreignKey':_0x2f4f('0x1f2'),'onDelete':_0x2f4f('0x11a')});db[_0x2f4f('0x1f3')][_0x2f4f('0x11d')](db[_0x2f4f('0xfd')],{'as':_0x2f4f('0x1f4'),'foreignKey':_0x2f4f('0x1f5'),'onDelete':_0x2f4f('0x11a')});db[_0x2f4f('0x101')]['hasMany'](db[_0x2f4f('0x7e')],{'as':_0x2f4f('0x167'),'foreignKey':_0x2f4f('0x1f6'),'onDelete':_0x2f4f('0x11a')});db[_0x2f4f('0x101')]['hasMany'](db[_0x2f4f('0x7c')],{'as':_0x2f4f('0x17f'),'foreignKey':_0x2f4f('0x1f6')});db[_0x2f4f('0x101')][_0x2f4f('0x11d')](db[_0x2f4f('0x106')],{'as':'Messages','foreignKey':_0x2f4f('0x1f6')});db[_0x2f4f('0x101')][_0x2f4f('0x11d')](db[_0x2f4f('0x105')],{'as':_0x2f4f('0x169')});db[_0x2f4f('0x101')][_0x2f4f('0x11d')](db[_0x2f4f('0x103')],{'as':'Applications','foreignKey':_0x2f4f('0x1f6'),'onDelete':'cascade'});db[_0x2f4f('0x101')]['belongsTo'](db[_0x2f4f('0x132')],{'as':_0x2f4f('0x16a'),'foreignKey':_0x2f4f('0x17b')});db[_0x2f4f('0x101')][_0x2f4f('0x12c')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x2f4f('0x16d')});db[_0x2f4f('0x101')][_0x2f4f('0x12d')](db['User'],{'as':_0x2f4f('0x157'),'through':_0x2f4f('0x149')});db[_0x2f4f('0x103')][_0x2f4f('0x12c')](db[_0x2f4f('0x13')],{'onDelete':_0x2f4f('0x17a')});db[_0x2f4f('0x103')][_0x2f4f('0x12c')](db[_0x2f4f('0x10c')],{'onDelete':_0x2f4f('0x17a')});db[_0x2f4f('0x103')][_0x2f4f('0x12c')](db['WhatsappAccount'],{'onDelete':_0x2f4f('0x17a')});db[_0x2f4f('0x103')][_0x2f4f('0x12c')](db[_0x2f4f('0x81')],{'onDelete':'restrict','foreignKey':_0x2f4f('0x155')});db[_0x2f4f('0x103')]['belongsTo'](db[_0x2f4f('0x8c')],{'onDelete':_0x2f4f('0x17a'),'foreignKey':_0x2f4f('0x18a')});db[_0x2f4f('0x105')][_0x2f4f('0x11d')](db['WhatsappMessage'],{'as':_0x2f4f('0x15a'),'onDelete':_0x2f4f('0x11a'),'foreignKey':_0x2f4f('0x1f7')});db[_0x2f4f('0x105')][_0x2f4f('0x12c')](db[_0x2f4f('0x101')],{'as':_0x2f4f('0x172'),'foreignKey':'WhatsappAccountId'});db[_0x2f4f('0x105')]['belongsTo'](db[_0x2f4f('0x70')],{'as':_0x2f4f('0x162'),'foreignKey':'ContactId'});db[_0x2f4f('0x105')][_0x2f4f('0x12c')](db[_0x2f4f('0x13')],{'as':'Owner','foreignKey':_0x2f4f('0x11b')});db[_0x2f4f('0x105')]['belongsToMany'](db[_0x2f4f('0x8c')],{'through':_0x2f4f('0x1f8'),'as':_0x2f4f('0x173')});db[_0x2f4f('0x105')][_0x2f4f('0x12d')](db['Tag'],{'through':_0x2f4f('0x1f8'),'as':_0x2f4f('0x175')});db['WhatsappInteraction'][_0x2f4f('0x12d')](db[_0x2f4f('0x13')],{'as':_0x2f4f('0x184'),'through':'user_has_whatsapp_interactions','foreignKey':_0x2f4f('0x1f7')});db[_0x2f4f('0x106')][_0x2f4f('0x12c')](db[_0x2f4f('0x13')],{'as':'User'});db[_0x2f4f('0x106')][_0x2f4f('0x12c')](db['CmContact'],{'onDelete':_0x2f4f('0x11a'),'as':_0x2f4f('0x162')});db['WhatsappMessage'][_0x2f4f('0x12c')](db['WhatsappInteraction'],{'onDelete':_0x2f4f('0x11a'),'as':_0x2f4f('0x193'),'foreignKey':'WhatsappInteractionId'});db[_0x2f4f('0x106')]['belongsTo'](db[_0x2f4f('0x101')],{'as':'Account','foreignKey':_0x2f4f('0x1f6')});db['WhatsappQueueReport'][_0x2f4f('0x12c')](db[_0x2f4f('0x101')],{});db[_0x2f4f('0x108')][_0x2f4f('0x12c')](db[_0x2f4f('0x132')],{'as':_0x2f4f('0x16a'),'foreignKey':'ListId'});db[_0x2f4f('0x108')][_0x2f4f('0x12c')](db[_0x2f4f('0x70')],{'as':_0x2f4f('0x162'),'foreignKey':'ContactId'});db[_0x2f4f('0x108')][_0x2f4f('0x12c')](db['WhatsappInteraction'],{});db[_0x2f4f('0x108')][_0x2f4f('0x12c')](db[_0x2f4f('0x10c')],{});db[_0x2f4f('0x108')]['belongsTo'](db[_0x2f4f('0x106')],{});db['WhatsappQueueReport'][_0x2f4f('0x12c')](db[_0x2f4f('0x13')],{});db[_0x2f4f('0x10a')][_0x2f4f('0x12c')](db[_0x2f4f('0x106')],{});db[_0x2f4f('0x10a')][_0x2f4f('0x12c')](db[_0x2f4f('0x105')],{});db[_0x2f4f('0x10a')][_0x2f4f('0x12c')](db[_0x2f4f('0x101')],{'foreignKey':_0x2f4f('0x1f9'),'as':'FromAccount'});db['WhatsappTransferReport'][_0x2f4f('0x12c')](db[_0x2f4f('0x101')],{'foreignKey':_0x2f4f('0x1fa'),'as':'ToAccount'});db['WhatsappTransferReport'][_0x2f4f('0x12c')](db['WhatsappQueue'],{'foreignKey':_0x2f4f('0x1fb'),'as':_0x2f4f('0x1e3')});db['WhatsappTransferReport'][_0x2f4f('0x12c')](db[_0x2f4f('0x13')],{'foreignKey':'FromUserId','as':_0x2f4f('0x1e1')});db['WhatsappTransferReport'][_0x2f4f('0x12c')](db[_0x2f4f('0x13')],{'foreignKey':_0x2f4f('0x1e2'),'as':_0x2f4f('0x1e6')});db[_0x2f4f('0x10c')][_0x2f4f('0x12d')](db['User'],{'as':_0x2f4f('0x157'),'through':_0x2f4f('0x35'),'foreignKey':_0x2f4f('0x1fc')});db['WhatsappQueue'][_0x2f4f('0x12d')](db[_0x2f4f('0x135')],{'through':_0x2f4f('0x1da'),'as':'Teams'});db[_0x2f4f('0x114')]['belongsTo'](db['User'],{'as':_0x2f4f('0x1fd'),'foreignKey':_0x2f4f('0x11b'),'onDelete':_0x2f4f('0x11a'),'hooks':!![]});db[_0x2f4f('0x10e')][_0x2f4f('0x118')](db[_0x2f4f('0xcc')],{'as':_0x2f4f('0xcc'),'onDelete':_0x2f4f('0x17a')});db[_0x2f4f('0x10e')]['hasOne'](db[_0x2f4f('0x37')],{'as':_0x2f4f('0x1fe'),'onDelete':'restrict'});db[_0x2f4f('0x10e')][_0x2f4f('0x118')](db[_0x2f4f('0x38')],{'as':_0x2f4f('0x166'),'onDelete':_0x2f4f('0x17a')});module[_0x2f4f('0x1ff')]={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 5c1e925..22b22d9 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7696=['./api/sound','/api/tags','./api/tag','/api/contact_item_types','./api/contactItemType','/api/cm_contact_has_items','./api/cmContactHasItem','./api/cmHopperAdditionalPhone','/api/templates','./api/template','/api/triggers','./api/trigger','./api/variable','/api/integrations','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','/api/analytics/metrics','/api/analytics/field_reports','/api/analytics/tree_reports','./api/analyticTreeReport','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','./api/intDeskConfiguration','/api/integrations/desk/fields','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','./api/intZendeskConfiguration','/api/integrations/freshdesk/accounts','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','./api/squareProject','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','/api/license','/api/campaigns','./api/campaign','/api/migrations','./api/migration','/api/attachments','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','./api/userNotification','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/transfer','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/realtime','./api/realtime','./api/mailInteractionHasTag','./api/authLocal','/api/auth/google','/api/auth/activedirectory','/api/jira','./api/jira','./api/rpc','/api/version','./api/version','/api/system','./api/system','/api/pm2','./api/pm2','/api/webbar','./api/webbar','/apidoc','static','root','/www','join','/demo','/snippet','/plugins','/server/files/plugins','route','get','resolve','appPath','path','express','./errors','./config/environment','default','then','use','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','/api/voice/mails/messages','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','/api/trunks','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailQueueReport','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','./api/faxMessage','/api/fax/queues','./api/faxQueue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','./api/smsApplication','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','./api/chatGroup','/api/cm/companies','./api/cmCompany','/api/cm/contacts','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','/api/automations','/api/canned_answers','./api/cannedAnswer','./api/disposition','/api/conditions','./api/interval','/api/pauses','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule'];(function(_0x4dfaa0,_0x4459ce){var _0x242d71=function(_0x158e58){while(--_0x158e58){_0x4dfaa0['push'](_0x4dfaa0['shift']());}};_0x242d71(++_0x4459ce);}(_0x7696,0xa4));var _0x6769=function(_0x3f3b4a,_0x3d0354){_0x3f3b4a=_0x3f3b4a-0x0;var _0x584440=_0x7696[_0x3f3b4a];return _0x584440;};'use strict';var path=require(_0x6769('0x0'));var express=require(_0x6769('0x1'));var errors=require(_0x6769('0x2'));var config=require(_0x6769('0x3'));var setupLoggers=require('./utils/client-side-logger')['setupLoggers'];var clientSideLogs=require('./api/client-side-logs');exports[_0x6769('0x4')]=function(_0x4e2157){return setupLoggers(_0x4e2157)[_0x6769('0x5')](function(){_0x4e2157[_0x6769('0x6')]('/api/users',require('./api/user'));_0x4e2157[_0x6769('0x6')](_0x6769('0x7'),require(_0x6769('0x8')));_0x4e2157[_0x6769('0x6')](_0x6769('0x9'),require(_0x6769('0xa')));_0x4e2157[_0x6769('0x6')](_0x6769('0xb'),require(_0x6769('0xc')));_0x4e2157[_0x6769('0x6')](_0x6769('0xd'),require(_0x6769('0xe')));_0x4e2157[_0x6769('0x6')]('/api/voice/queues',require(_0x6769('0xf')));_0x4e2157['use'](_0x6769('0x10'),require(_0x6769('0x11')));_0x4e2157[_0x6769('0x6')](_0x6769('0x12'),require(_0x6769('0x13')));_0x4e2157[_0x6769('0x6')](_0x6769('0x14'),require('./api/voiceMail'));_0x4e2157[_0x6769('0x6')](_0x6769('0x15'),require('./api/voiceMailMessage'));_0x4e2157[_0x6769('0x6')](_0x6769('0x16'),require(_0x6769('0x17')));_0x4e2157['use'](_0x6769('0x18'),require(_0x6769('0x19')));_0x4e2157[_0x6769('0x6')](_0x6769('0x1a'),require(_0x6769('0x1b')));_0x4e2157[_0x6769('0x6')](_0x6769('0x1c'),require(_0x6769('0x1d')));_0x4e2157['use'](_0x6769('0x1e'),require('./api/memberReport'));_0x4e2157['use'](_0x6769('0x1f'),require('./api/trunk'));_0x4e2157[_0x6769('0x6')](_0x6769('0x20'),require(_0x6769('0x21')));_0x4e2157[_0x6769('0x6')](_0x6769('0x22'),require('./api/mailServerOut'));_0x4e2157[_0x6769('0x6')]('/api/mail/accounts',require(_0x6769('0x23')));_0x4e2157[_0x6769('0x6')](_0x6769('0x24'),require(_0x6769('0x25')));_0x4e2157['use'](_0x6769('0x26'),require(_0x6769('0x27')));_0x4e2157[_0x6769('0x6')](_0x6769('0x28'),require('./api/mailInteraction'));_0x4e2157[_0x6769('0x6')](_0x6769('0x29'),require(_0x6769('0x2a')));_0x4e2157[_0x6769('0x6')](_0x6769('0x2b'),require('./api/mailApplication'));_0x4e2157[_0x6769('0x6')]('/api/mail/reports/queue',require(_0x6769('0x2c')));_0x4e2157['use']('/api/dashboards',require('./api/dashboard'));_0x4e2157[_0x6769('0x6')]('/api/dashboards/items',require('./api/dashboardItem'));_0x4e2157[_0x6769('0x6')](_0x6769('0x2d'),require(_0x6769('0x2e')));_0x4e2157['use'](_0x6769('0x2f'),require(_0x6769('0x30')));_0x4e2157['use'](_0x6769('0x31'),require(_0x6769('0x32')));_0x4e2157['use']('/api/fax/messages',require(_0x6769('0x33')));_0x4e2157[_0x6769('0x6')](_0x6769('0x34'),require(_0x6769('0x35')));_0x4e2157[_0x6769('0x6')]('/api/fax/reports/queue',require(_0x6769('0x36')));_0x4e2157[_0x6769('0x6')](_0x6769('0x37'),require(_0x6769('0x38')));_0x4e2157[_0x6769('0x6')]('/api/sms/applications',require(_0x6769('0x39')));_0x4e2157[_0x6769('0x6')]('/api/sms/interactions',require(_0x6769('0x3a')));_0x4e2157['use'](_0x6769('0x3b'),require(_0x6769('0x3c')));_0x4e2157[_0x6769('0x6')](_0x6769('0x3d'),require(_0x6769('0x3e')));_0x4e2157[_0x6769('0x6')]('/api/openchannel/accounts',require('./api/openchannelAccount'));_0x4e2157['use'](_0x6769('0x3f'),require(_0x6769('0x40')));_0x4e2157['use'](_0x6769('0x41'),require('./api/openchannelInteraction'));_0x4e2157['use'](_0x6769('0x42'),require(_0x6769('0x43')));_0x4e2157[_0x6769('0x6')](_0x6769('0x44'),require(_0x6769('0x45')));_0x4e2157[_0x6769('0x6')]('/api/chat/websites',require(_0x6769('0x46')));_0x4e2157[_0x6769('0x6')](_0x6769('0x47'),require(_0x6769('0x48')));_0x4e2157['use'](_0x6769('0x49'),require(_0x6769('0x4a')));_0x4e2157['use'](_0x6769('0x4b'),require(_0x6769('0x4c')));_0x4e2157[_0x6769('0x6')](_0x6769('0x4d'),require(_0x6769('0x4e')));_0x4e2157['use'](_0x6769('0x4f'),require(_0x6769('0x50')));_0x4e2157['use'](_0x6769('0x51'),require(_0x6769('0x52')));_0x4e2157[_0x6769('0x6')]('/api/chat/groups',require(_0x6769('0x53')));_0x4e2157[_0x6769('0x6')]('/api/chat/proactive_actions',require('./api/chatProactiveAction'));_0x4e2157[_0x6769('0x6')](_0x6769('0x54'),require(_0x6769('0x55')));_0x4e2157[_0x6769('0x6')](_0x6769('0x56'),require('./api/cmContact'));_0x4e2157[_0x6769('0x6')](_0x6769('0x57'),require(_0x6769('0x58')));_0x4e2157[_0x6769('0x6')](_0x6769('0x59'),require('./api/cmHopperBlack'));_0x4e2157['use'](_0x6769('0x5a'),require(_0x6769('0x5b')));_0x4e2157[_0x6769('0x6')](_0x6769('0x5c'),require('./api/cmHopperHistory'));_0x4e2157['use'](_0x6769('0x5d'),require(_0x6769('0x5e')));_0x4e2157[_0x6769('0x6')](_0x6769('0x5f'),require(_0x6769('0x60')));_0x4e2157[_0x6769('0x6')](_0x6769('0x61'),require('./api/automation'));_0x4e2157[_0x6769('0x6')](_0x6769('0x62'),require(_0x6769('0x63')));_0x4e2157[_0x6769('0x6')]('/api/dispositions',require(_0x6769('0x64')));_0x4e2157['use'](_0x6769('0x65'),require('./api/condition'));_0x4e2157[_0x6769('0x6')]('/api/intervals',require(_0x6769('0x66')));_0x4e2157[_0x6769('0x6')](_0x6769('0x67'),require('./api/pause'));_0x4e2157[_0x6769('0x6')]('/api/cdr',require('./api/cdr'));_0x4e2157[_0x6769('0x6')](_0x6769('0x68'),require(_0x6769('0x69')));_0x4e2157['use'](_0x6769('0x6a'),require(_0x6769('0x6b')));_0x4e2157[_0x6769('0x6')]('/api/sounds',require(_0x6769('0x6c')));_0x4e2157[_0x6769('0x6')](_0x6769('0x6d'),require(_0x6769('0x6e')));_0x4e2157[_0x6769('0x6')](_0x6769('0x6f'),require(_0x6769('0x70')));_0x4e2157[_0x6769('0x6')](_0x6769('0x71'),require(_0x6769('0x72')));_0x4e2157[_0x6769('0x6')]('/api/cm_hopper_additional_phones',require(_0x6769('0x73')));_0x4e2157[_0x6769('0x6')](_0x6769('0x74'),require(_0x6769('0x75')));_0x4e2157['use'](_0x6769('0x76'),require(_0x6769('0x77')));_0x4e2157[_0x6769('0x6')]('/api/variables',require(_0x6769('0x78')));_0x4e2157['use'](_0x6769('0x79'),require('./api/integration'));_0x4e2157[_0x6769('0x6')]('/api/integrations/reports',require(_0x6769('0x7a')));_0x4e2157['use'](_0x6769('0x7b'),require(_0x6769('0x7c')));_0x4e2157[_0x6769('0x6')](_0x6769('0x7d'),require('./api/analyticDefaultReport'));_0x4e2157[_0x6769('0x6')]('/api/analytics/extracted_reports',require('./api/analyticExtractedReport'));_0x4e2157[_0x6769('0x6')](_0x6769('0x7e'),require('./api/analyticMetric'));_0x4e2157['use'](_0x6769('0x7f'),require('./api/analyticFieldReport'));_0x4e2157['use'](_0x6769('0x80'),require(_0x6769('0x81')));_0x4e2157['use']('/api/integrations/salesforce/accounts',require(_0x6769('0x82')));_0x4e2157[_0x6769('0x6')](_0x6769('0x83'),require(_0x6769('0x84')));_0x4e2157[_0x6769('0x6')](_0x6769('0x85'),require(_0x6769('0x86')));_0x4e2157[_0x6769('0x6')]('/api/integrations/sugarcrm/accounts',require(_0x6769('0x87')));_0x4e2157[_0x6769('0x6')](_0x6769('0x88'),require(_0x6769('0x89')));_0x4e2157[_0x6769('0x6')](_0x6769('0x8a'),require(_0x6769('0x8b')));_0x4e2157[_0x6769('0x6')](_0x6769('0x8c'),require(_0x6769('0x8d')));_0x4e2157[_0x6769('0x6')]('/api/integrations/desk/configurations',require(_0x6769('0x8e')));_0x4e2157[_0x6769('0x6')](_0x6769('0x8f'),require('./api/intDeskField'));_0x4e2157['use'](_0x6769('0x90'),require(_0x6769('0x91')));_0x4e2157[_0x6769('0x6')]('/api/integrations/zoho/configurations',require('./api/intZohoConfiguration'));_0x4e2157[_0x6769('0x6')](_0x6769('0x92'),require(_0x6769('0x93')));_0x4e2157[_0x6769('0x6')](_0x6769('0x94'),require(_0x6769('0x95')));_0x4e2157[_0x6769('0x6')]('/api/integrations/zendesk/configurations',require(_0x6769('0x96')));_0x4e2157[_0x6769('0x6')]('/api/integrations/zendesk/fields',require('./api/intZendeskField'));_0x4e2157[_0x6769('0x6')](_0x6769('0x97'),require('./api/intFreshdeskAccount'));_0x4e2157[_0x6769('0x6')](_0x6769('0x98'),require(_0x6769('0x99')));_0x4e2157[_0x6769('0x6')](_0x6769('0x9a'),require(_0x6769('0x9b')));_0x4e2157['use'](_0x6769('0x9c'),require(_0x6769('0x9d')));_0x4e2157['use'](_0x6769('0x9e'),require(_0x6769('0x9f')));_0x4e2157[_0x6769('0x6')](_0x6769('0xa0'),require(_0x6769('0xa1')));_0x4e2157['use'](_0x6769('0xa2'),require(_0x6769('0xa3')));_0x4e2157[_0x6769('0x6')](_0x6769('0xa4'),require(_0x6769('0xa5')));_0x4e2157['use'](_0x6769('0xa6'),require('./api/intServicenowField'));_0x4e2157[_0x6769('0x6')](_0x6769('0xa7'),require(_0x6769('0xa8')));_0x4e2157[_0x6769('0x6')](_0x6769('0xa9'),require(_0x6769('0xaa')));_0x4e2157[_0x6769('0x6')](_0x6769('0xab'),require(_0x6769('0xac')));_0x4e2157[_0x6769('0x6')](_0x6769('0xad'),require(_0x6769('0xae')));_0x4e2157[_0x6769('0x6')](_0x6769('0xaf'),require(_0x6769('0xb0')));_0x4e2157[_0x6769('0x6')](_0x6769('0xb1'),require('./api/intFreshsalesField'));_0x4e2157[_0x6769('0x6')](_0x6769('0xb2'),require(_0x6769('0xb3')));_0x4e2157[_0x6769('0x6')](_0x6769('0xb4'),require(_0x6769('0xb5')));_0x4e2157['use'](_0x6769('0xb6'),require(_0x6769('0xb7')));_0x4e2157[_0x6769('0x6')](_0x6769('0xb8'),require(_0x6769('0xb9')));_0x4e2157[_0x6769('0x6')](_0x6769('0xba'),require(_0x6769('0xbb')));_0x4e2157[_0x6769('0x6')](_0x6769('0xbc'),require(_0x6769('0xbd')));_0x4e2157[_0x6769('0x6')](_0x6769('0xbe'),require(_0x6769('0xbf')));_0x4e2157[_0x6769('0x6')](_0x6769('0xc0'),require(_0x6769('0xc1')));_0x4e2157[_0x6769('0x6')]('/api/square/details/reports',require(_0x6769('0xc2')));_0x4e2157[_0x6769('0x6')](_0x6769('0xc3'),require(_0x6769('0xc4')));_0x4e2157[_0x6769('0x6')](_0x6769('0xc5'),require(_0x6769('0xc6')));_0x4e2157[_0x6769('0x6')](_0x6769('0xc7'),require(_0x6769('0xc8')));_0x4e2157['use']('/api/square/projects',require(_0x6769('0xc9')));_0x4e2157[_0x6769('0x6')]('/api/square/recordings',require(_0x6769('0xca')));_0x4e2157[_0x6769('0x6')](_0x6769('0xcb'),require(_0x6769('0xcc')));_0x4e2157['use'](_0x6769('0xcd'),require('./api/team'));_0x4e2157[_0x6769('0x6')](_0x6769('0xce'),require('./api/license'));_0x4e2157[_0x6769('0x6')](_0x6769('0xcf'),require(_0x6769('0xd0')));_0x4e2157[_0x6769('0x6')](_0x6769('0xd1'),require(_0x6769('0xd2')));_0x4e2157[_0x6769('0x6')](_0x6769('0xd3'),require('./api/attachment'));_0x4e2157[_0x6769('0x6')](_0x6769('0xd4'),require(_0x6769('0xd5')));_0x4e2157[_0x6769('0x6')](_0x6769('0xd6'),require(_0x6769('0xd7')));_0x4e2157['use'](_0x6769('0xd8'),require(_0x6769('0xd9')));_0x4e2157[_0x6769('0x6')]('/api/fax/reports/transfer',require(_0x6769('0xda')));_0x4e2157[_0x6769('0x6')](_0x6769('0xdb'),require(_0x6769('0xdc')));_0x4e2157[_0x6769('0x6')](_0x6769('0xdd'),require(_0x6769('0xde')));_0x4e2157['use'](_0x6769('0xdf'),require(_0x6769('0xe0')));_0x4e2157['use'](_0x6769('0xe1'),require(_0x6769('0xe2')));_0x4e2157['use'](_0x6769('0xe3'),require('./api/userProfile'));_0x4e2157['use']('/api/userProfile/sections',require(_0x6769('0xe4')));_0x4e2157[_0x6769('0x6')](_0x6769('0xe5'),require(_0x6769('0xe6')));_0x4e2157[_0x6769('0x6')]('/api/userNotifications',require(_0x6769('0xe7')));_0x4e2157[_0x6769('0x6')]('/api/whatsapp/accounts',require(_0x6769('0xe8')));_0x4e2157[_0x6769('0x6')](_0x6769('0xe9'),require(_0x6769('0xea')));_0x4e2157['use'](_0x6769('0xeb'),require('./api/whatsappInteraction'));_0x4e2157[_0x6769('0x6')](_0x6769('0xec'),require(_0x6769('0xed')));_0x4e2157[_0x6769('0x6')]('/api/whatsapp/reports/queue',require('./api/whatsappQueueReport'));_0x4e2157[_0x6769('0x6')](_0x6769('0xee'),require('./api/whatsappTransferReport'));_0x4e2157[_0x6769('0x6')]('/api/whatsapp/queues',require(_0x6769('0xef')));_0x4e2157[_0x6769('0x6')](_0x6769('0xf0'),require(_0x6769('0xf1')));_0x4e2157[_0x6769('0x6')](_0x6769('0xf2'),require(_0x6769('0xf3')));_0x4e2157[_0x6769('0x6')]('/api/user-settings',require('./api/user-setting'));_0x4e2157[_0x6769('0x6')]('/api/mail_interaction_has_tags',require(_0x6769('0xf4')));_0x4e2157[_0x6769('0x6')]('/api/auth/local',require(_0x6769('0xf5')));_0x4e2157[_0x6769('0x6')](_0x6769('0xf6'),require('./api/authGoogle'));_0x4e2157[_0x6769('0x6')](_0x6769('0xf7'),require('./api/authActiveDirectory'));_0x4e2157[_0x6769('0x6')](_0x6769('0xf8'),require(_0x6769('0xf9')));_0x4e2157[_0x6769('0x6')]('/api/rpc',require(_0x6769('0xfa')));_0x4e2157['use'](_0x6769('0xfb'),require(_0x6769('0xfc')));_0x4e2157['use'](_0x6769('0xfd'),require(_0x6769('0xfe')));_0x4e2157[_0x6769('0x6')](_0x6769('0xff'),require(_0x6769('0x100')));_0x4e2157[_0x6769('0x6')](_0x6769('0x101'),require(_0x6769('0x102')));_0x4e2157['use']('/api/logs',clientSideLogs);_0x4e2157['use'](_0x6769('0x103'),express[_0x6769('0x104')](path['join'](config[_0x6769('0x105')],_0x6769('0x103'))));_0x4e2157[_0x6769('0x6')](_0x6769('0x106'),express[_0x6769('0x104')](path[_0x6769('0x107')](config[_0x6769('0x105')],'/www')));_0x4e2157[_0x6769('0x6')](_0x6769('0x108'),express[_0x6769('0x104')](path[_0x6769('0x107')](config[_0x6769('0x105')],_0x6769('0x108'))));_0x4e2157[_0x6769('0x6')](_0x6769('0x109'),express[_0x6769('0x104')](path[_0x6769('0x107')](config[_0x6769('0x105')],'snippet','3.9.0')));_0x4e2157[_0x6769('0x6')](_0x6769('0x10a'),express[_0x6769('0x104')](path[_0x6769('0x107')](config['root'],_0x6769('0x10b'))));_0x4e2157[_0x6769('0x10c')]('/:url(api|auth|components|app|bower_components|assets)/*')[_0x6769('0x10d')](errors[0x194]);_0x4e2157[_0x6769('0x10c')]('/*')[_0x6769('0x10d')](function(_0x31a407,_0xbfe23f){_0xbfe23f['sendFile'](path[_0x6769('0x10e')](_0x4e2157[_0x6769('0x10d')](_0x6769('0x10f'))+'/index.html'));});return _0x4e2157;});}; \ No newline at end of file +var _0x3564=['./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','./api/whatsappInteraction','./api/whatsappMessage','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','/api/whatsapp/queues','/api/cloudProviders','./api/cloudProvider','/api/realtime','/api/user-settings','./api/user-setting','/api/mail_interaction_has_tags','./api/mailInteractionHasTag','/api/auth/local','./api/authLocal','/api/auth/google','/api/auth/activedirectory','./api/authActiveDirectory','/api/jira','/api/rpc','/api/version','./api/version','./api/system','/api/pm2','./api/pm2','/api/webbar','./api/webbar','/api/logs','/apidoc','static','root','/www','join','/demo','/snippet','snippet','3.9.0','/plugins','/server/files/plugins','/:url(api|auth|components|app|bower_components|assets)/*','route','get','sendFile','resolve','appPath','/index.html','path','express','./errors','./config/environment','./utils/client-side-logger','setupLoggers','./api/client-side-logs','default','then','use','/api/users','./api/user','/api/voice/chanspy','/api/voice/contexts','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','./api/screenRecording','/api/voice/mails','./api/voiceMail','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','/api/mail/substatuses','/api/mail/interactions','./api/mailInteraction','./api/mailMessage','/api/mail/applications','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','/api/sms/queues','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','/api/openchannel/queues','./api/openchannelQueue','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','/api/chat/messages','/api/chat/offline_messages','./api/chatOfflineMessage','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','./api/cmCompany','/api/cm/contacts','./api/cmContact','./api/cmHopper','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','./api/condition','/api/intervals','./api/interval','/api/pauses','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','/api/tags','./api/contactItemType','/api/cm_hopper_additional_phones','./api/cmHopperAdditionalPhone','/api/templates','./api/template','/api/triggers','/api/variables','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','/api/integrations/salesforce/accounts','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','./api/intFreshdeskField','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/license','/api/campaigns','./api/campaign','/api/migrations','/api/attachments','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','./api/openchannelTransferReport','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','./api/userProfile','./api/userProfileSection','/api/userProfile/resources','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts'];(function(_0x5413ee,_0x1d0618){var _0x33f555=function(_0x4d61a7){while(--_0x4d61a7){_0x5413ee['push'](_0x5413ee['shift']());}};_0x33f555(++_0x1d0618);}(_0x3564,0x14f));var _0x4356=function(_0xd06b24,_0x1ed7dc){_0xd06b24=_0xd06b24-0x0;var _0x26df93=_0x3564[_0xd06b24];return _0x26df93;};'use strict';var path=require(_0x4356('0x0'));var express=require(_0x4356('0x1'));var errors=require(_0x4356('0x2'));var config=require(_0x4356('0x3'));var setupLoggers=require(_0x4356('0x4'))[_0x4356('0x5')];var clientSideLogs=require(_0x4356('0x6'));exports[_0x4356('0x7')]=function(_0x55c78f){return setupLoggers(_0x55c78f)[_0x4356('0x8')](function(){_0x55c78f[_0x4356('0x9')](_0x4356('0xa'),require(_0x4356('0xb')));_0x55c78f['use'](_0x4356('0xc'),require('./api/voiceChanSpy'));_0x55c78f[_0x4356('0x9')](_0x4356('0xd'),require('./api/voiceContext'));_0x55c78f['use']('/api/voice/extensions',require(_0x4356('0xe')));_0x55c78f[_0x4356('0x9')](_0x4356('0xf'),require(_0x4356('0x10')));_0x55c78f[_0x4356('0x9')](_0x4356('0x11'),require(_0x4356('0x12')));_0x55c78f[_0x4356('0x9')](_0x4356('0x13'),require(_0x4356('0x14')));_0x55c78f['use']('/api/screen/recordings',require(_0x4356('0x15')));_0x55c78f[_0x4356('0x9')](_0x4356('0x16'),require(_0x4356('0x17')));_0x55c78f[_0x4356('0x9')]('/api/voice/mails/messages',require(_0x4356('0x18')));_0x55c78f[_0x4356('0x9')](_0x4356('0x19'),require(_0x4356('0x1a')));_0x55c78f[_0x4356('0x9')](_0x4356('0x1b'),require('./api/voiceDialReport'));_0x55c78f[_0x4356('0x9')](_0x4356('0x1c'),require(_0x4356('0x1d')));_0x55c78f[_0x4356('0x9')](_0x4356('0x1e'),require(_0x4356('0x1f')));_0x55c78f['use'](_0x4356('0x20'),require(_0x4356('0x21')));_0x55c78f['use'](_0x4356('0x22'),require(_0x4356('0x23')));_0x55c78f['use'](_0x4356('0x24'),require('./api/voiceTransferReport'));_0x55c78f[_0x4356('0x9')]('/api/mail/out_servers',require(_0x4356('0x25')));_0x55c78f['use'](_0x4356('0x26'),require(_0x4356('0x27')));_0x55c78f[_0x4356('0x9')](_0x4356('0x28'),require('./api/mailQueue'));_0x55c78f[_0x4356('0x9')](_0x4356('0x29'),require('./api/mailSubstatus'));_0x55c78f[_0x4356('0x9')](_0x4356('0x2a'),require(_0x4356('0x2b')));_0x55c78f[_0x4356('0x9')]('/api/mail/messages',require(_0x4356('0x2c')));_0x55c78f['use'](_0x4356('0x2d'),require('./api/mailApplication'));_0x55c78f[_0x4356('0x9')]('/api/mail/reports/queue',require(_0x4356('0x2e')));_0x55c78f[_0x4356('0x9')](_0x4356('0x2f'),require(_0x4356('0x30')));_0x55c78f['use'](_0x4356('0x31'),require(_0x4356('0x32')));_0x55c78f[_0x4356('0x9')](_0x4356('0x33'),require(_0x4356('0x34')));_0x55c78f[_0x4356('0x9')](_0x4356('0x35'),require(_0x4356('0x36')));_0x55c78f[_0x4356('0x9')](_0x4356('0x37'),require(_0x4356('0x38')));_0x55c78f['use'](_0x4356('0x39'),require(_0x4356('0x3a')));_0x55c78f[_0x4356('0x9')]('/api/fax/queues',require(_0x4356('0x3b')));_0x55c78f[_0x4356('0x9')](_0x4356('0x3c'),require(_0x4356('0x3d')));_0x55c78f[_0x4356('0x9')]('/api/sms/accounts',require(_0x4356('0x3e')));_0x55c78f[_0x4356('0x9')](_0x4356('0x3f'),require(_0x4356('0x40')));_0x55c78f[_0x4356('0x9')](_0x4356('0x41'),require(_0x4356('0x42')));_0x55c78f['use'](_0x4356('0x43'),require('./api/smsMessage'));_0x55c78f[_0x4356('0x9')](_0x4356('0x44'),require('./api/smsQueue'));_0x55c78f[_0x4356('0x9')]('/api/openchannel/accounts',require(_0x4356('0x45')));_0x55c78f['use'](_0x4356('0x46'),require(_0x4356('0x47')));_0x55c78f['use'](_0x4356('0x48'),require(_0x4356('0x49')));_0x55c78f['use'](_0x4356('0x4a'),require('./api/openchannelMessage'));_0x55c78f[_0x4356('0x9')](_0x4356('0x4b'),require(_0x4356('0x4c')));_0x55c78f[_0x4356('0x9')]('/api/chat/websites',require('./api/chatWebsite'));_0x55c78f['use'](_0x4356('0x4d'),require(_0x4356('0x4e')));_0x55c78f[_0x4356('0x9')](_0x4356('0x4f'),require(_0x4356('0x50')));_0x55c78f[_0x4356('0x9')](_0x4356('0x51'),require('./api/chatInteraction'));_0x55c78f['use'](_0x4356('0x52'),require('./api/chatMessage'));_0x55c78f[_0x4356('0x9')](_0x4356('0x53'),require(_0x4356('0x54')));_0x55c78f[_0x4356('0x9')]('/api/chat/queues',require(_0x4356('0x55')));_0x55c78f[_0x4356('0x9')](_0x4356('0x56'),require(_0x4356('0x57')));_0x55c78f[_0x4356('0x9')](_0x4356('0x58'),require(_0x4356('0x59')));_0x55c78f[_0x4356('0x9')]('/api/cm/companies',require(_0x4356('0x5a')));_0x55c78f[_0x4356('0x9')](_0x4356('0x5b'),require(_0x4356('0x5c')));_0x55c78f[_0x4356('0x9')]('/api/cm/hopper',require(_0x4356('0x5d')));_0x55c78f[_0x4356('0x9')]('/api/cm/hopper_black',require(_0x4356('0x5e')));_0x55c78f[_0x4356('0x9')](_0x4356('0x5f'),require(_0x4356('0x60')));_0x55c78f[_0x4356('0x9')](_0x4356('0x61'),require(_0x4356('0x62')));_0x55c78f[_0x4356('0x9')](_0x4356('0x63'),require(_0x4356('0x64')));_0x55c78f[_0x4356('0x9')](_0x4356('0x65'),require(_0x4356('0x66')));_0x55c78f[_0x4356('0x9')](_0x4356('0x67'),require(_0x4356('0x68')));_0x55c78f[_0x4356('0x9')](_0x4356('0x69'),require(_0x4356('0x6a')));_0x55c78f['use'](_0x4356('0x6b'),require(_0x4356('0x6c')));_0x55c78f[_0x4356('0x9')](_0x4356('0x6d'),require(_0x4356('0x6e')));_0x55c78f[_0x4356('0x9')](_0x4356('0x6f'),require(_0x4356('0x70')));_0x55c78f[_0x4356('0x9')](_0x4356('0x71'),require('./api/pause'));_0x55c78f[_0x4356('0x9')](_0x4356('0x72'),require(_0x4356('0x73')));_0x55c78f[_0x4356('0x9')](_0x4356('0x74'),require(_0x4356('0x75')));_0x55c78f[_0x4356('0x9')](_0x4356('0x76'),require(_0x4356('0x77')));_0x55c78f[_0x4356('0x9')](_0x4356('0x78'),require(_0x4356('0x79')));_0x55c78f[_0x4356('0x9')](_0x4356('0x7a'),require('./api/tag'));_0x55c78f[_0x4356('0x9')]('/api/contact_item_types',require(_0x4356('0x7b')));_0x55c78f[_0x4356('0x9')]('/api/cm_contact_has_items',require('./api/cmContactHasItem'));_0x55c78f[_0x4356('0x9')](_0x4356('0x7c'),require(_0x4356('0x7d')));_0x55c78f[_0x4356('0x9')](_0x4356('0x7e'),require(_0x4356('0x7f')));_0x55c78f[_0x4356('0x9')](_0x4356('0x80'),require('./api/trigger'));_0x55c78f[_0x4356('0x9')](_0x4356('0x81'),require(_0x4356('0x82')));_0x55c78f[_0x4356('0x9')](_0x4356('0x83'),require(_0x4356('0x84')));_0x55c78f['use'](_0x4356('0x85'),require('./api/integrationReport'));_0x55c78f['use'](_0x4356('0x86'),require(_0x4356('0x87')));_0x55c78f['use'](_0x4356('0x88'),require(_0x4356('0x89')));_0x55c78f[_0x4356('0x9')](_0x4356('0x8a'),require(_0x4356('0x8b')));_0x55c78f[_0x4356('0x9')](_0x4356('0x8c'),require(_0x4356('0x8d')));_0x55c78f[_0x4356('0x9')](_0x4356('0x8e'),require(_0x4356('0x8f')));_0x55c78f[_0x4356('0x9')](_0x4356('0x90'),require('./api/analyticTreeReport'));_0x55c78f[_0x4356('0x9')](_0x4356('0x91'),require('./api/intSalesforceAccount'));_0x55c78f[_0x4356('0x9')]('/api/integrations/salesforce/configurations',require(_0x4356('0x92')));_0x55c78f[_0x4356('0x9')](_0x4356('0x93'),require(_0x4356('0x94')));_0x55c78f[_0x4356('0x9')](_0x4356('0x95'),require('./api/intSugarcrmAccount'));_0x55c78f[_0x4356('0x9')]('/api/integrations/sugarcrm/configurations',require(_0x4356('0x96')));_0x55c78f[_0x4356('0x9')](_0x4356('0x97'),require(_0x4356('0x98')));_0x55c78f[_0x4356('0x9')](_0x4356('0x99'),require(_0x4356('0x9a')));_0x55c78f['use'](_0x4356('0x9b'),require(_0x4356('0x9c')));_0x55c78f[_0x4356('0x9')]('/api/integrations/desk/fields',require(_0x4356('0x9d')));_0x55c78f[_0x4356('0x9')](_0x4356('0x9e'),require(_0x4356('0x9f')));_0x55c78f[_0x4356('0x9')](_0x4356('0xa0'),require(_0x4356('0xa1')));_0x55c78f[_0x4356('0x9')](_0x4356('0xa2'),require(_0x4356('0xa3')));_0x55c78f[_0x4356('0x9')](_0x4356('0xa4'),require(_0x4356('0xa5')));_0x55c78f[_0x4356('0x9')](_0x4356('0xa6'),require('./api/intZendeskConfiguration'));_0x55c78f[_0x4356('0x9')](_0x4356('0xa7'),require(_0x4356('0xa8')));_0x55c78f[_0x4356('0x9')](_0x4356('0xa9'),require(_0x4356('0xaa')));_0x55c78f[_0x4356('0x9')](_0x4356('0xab'),require(_0x4356('0xac')));_0x55c78f[_0x4356('0x9')]('/api/integrations/freshdesk/fields',require(_0x4356('0xad')));_0x55c78f['use']('/api/integrations/vtiger/accounts',require(_0x4356('0xae')));_0x55c78f[_0x4356('0x9')](_0x4356('0xaf'),require(_0x4356('0xb0')));_0x55c78f['use']('/api/integrations/vtiger/fields',require('./api/intVtigerField'));_0x55c78f[_0x4356('0x9')](_0x4356('0xb1'),require(_0x4356('0xb2')));_0x55c78f[_0x4356('0x9')](_0x4356('0xb3'),require(_0x4356('0xb4')));_0x55c78f[_0x4356('0x9')](_0x4356('0xb5'),require(_0x4356('0xb6')));_0x55c78f[_0x4356('0x9')](_0x4356('0xb7'),require('./api/intDynamics365Account'));_0x55c78f['use'](_0x4356('0xb8'),require(_0x4356('0xb9')));_0x55c78f['use'](_0x4356('0xba'),require(_0x4356('0xbb')));_0x55c78f['use']('/api/integrations/freshsales/accounts',require(_0x4356('0xbc')));_0x55c78f[_0x4356('0x9')](_0x4356('0xbd'),require('./api/intFreshsalesConfiguration'));_0x55c78f[_0x4356('0x9')](_0x4356('0xbe'),require(_0x4356('0xbf')));_0x55c78f[_0x4356('0x9')](_0x4356('0xc0'),require('./api/network'));_0x55c78f[_0x4356('0x9')]('/api/chat/reports/queue',require(_0x4356('0xc1')));_0x55c78f[_0x4356('0x9')](_0x4356('0xc2'),require(_0x4356('0xc3')));_0x55c78f[_0x4356('0x9')](_0x4356('0xc4'),require(_0x4356('0xc5')));_0x55c78f[_0x4356('0x9')](_0x4356('0xc6'),require('./api/jscriptyQuestionReport'));_0x55c78f['use'](_0x4356('0xc7'),require(_0x4356('0xc8')));_0x55c78f[_0x4356('0x9')](_0x4356('0xc9'),require(_0x4356('0xca')));_0x55c78f[_0x4356('0x9')](_0x4356('0xcb'),require('./api/squareReport'));_0x55c78f[_0x4356('0x9')](_0x4356('0xcc'),require(_0x4356('0xcd')));_0x55c78f[_0x4356('0x9')](_0x4356('0xce'),require(_0x4356('0xcf')));_0x55c78f[_0x4356('0x9')](_0x4356('0xd0'),require(_0x4356('0xd1')));_0x55c78f['use'](_0x4356('0xd2'),require(_0x4356('0xd3')));_0x55c78f['use']('/api/square/projects',require('./api/squareProject'));_0x55c78f[_0x4356('0x9')](_0x4356('0xd4'),require(_0x4356('0xd5')));_0x55c78f[_0x4356('0x9')](_0x4356('0xd6'),require(_0x4356('0xd7')));_0x55c78f['use']('/api/teams',require('./api/team'));_0x55c78f[_0x4356('0x9')](_0x4356('0xd8'),require('./api/license'));_0x55c78f[_0x4356('0x9')](_0x4356('0xd9'),require(_0x4356('0xda')));_0x55c78f[_0x4356('0x9')](_0x4356('0xdb'),require('./api/migration'));_0x55c78f[_0x4356('0x9')](_0x4356('0xdc'),require('./api/attachment'));_0x55c78f[_0x4356('0x9')]('/api/plugins',require('./api/plugin'));_0x55c78f[_0x4356('0x9')](_0x4356('0xdd'),require(_0x4356('0xde')));_0x55c78f[_0x4356('0x9')](_0x4356('0xdf'),require(_0x4356('0xe0')));_0x55c78f[_0x4356('0x9')](_0x4356('0xe1'),require(_0x4356('0xe2')));_0x55c78f[_0x4356('0x9')]('/api/openchannel/reports/transfer',require(_0x4356('0xe3')));_0x55c78f[_0x4356('0x9')]('/api/sms/reports/transfer',require(_0x4356('0xe4')));_0x55c78f[_0x4356('0x9')](_0x4356('0xe5'),require(_0x4356('0xe6')));_0x55c78f['use'](_0x4356('0xe7'),require(_0x4356('0xe8')));_0x55c78f[_0x4356('0x9')]('/api/userProfiles',require(_0x4356('0xe9')));_0x55c78f[_0x4356('0x9')]('/api/userProfile/sections',require(_0x4356('0xea')));_0x55c78f[_0x4356('0x9')](_0x4356('0xeb'),require('./api/userProfileResource'));_0x55c78f['use'](_0x4356('0xec'),require(_0x4356('0xed')));_0x55c78f[_0x4356('0x9')](_0x4356('0xee'),require(_0x4356('0xef')));_0x55c78f[_0x4356('0x9')](_0x4356('0xf0'),require(_0x4356('0xf1')));_0x55c78f[_0x4356('0x9')]('/api/whatsapp/interactions',require(_0x4356('0xf2')));_0x55c78f[_0x4356('0x9')]('/api/whatsapp/messages',require(_0x4356('0xf3')));_0x55c78f[_0x4356('0x9')]('/api/whatsapp/reports/queue',require(_0x4356('0xf4')));_0x55c78f[_0x4356('0x9')](_0x4356('0xf5'),require('./api/whatsappTransferReport'));_0x55c78f[_0x4356('0x9')](_0x4356('0xf6'),require('./api/whatsappQueue'));_0x55c78f[_0x4356('0x9')](_0x4356('0xf7'),require(_0x4356('0xf8')));_0x55c78f[_0x4356('0x9')](_0x4356('0xf9'),require('./api/realtime'));_0x55c78f[_0x4356('0x9')](_0x4356('0xfa'),require(_0x4356('0xfb')));_0x55c78f[_0x4356('0x9')](_0x4356('0xfc'),require(_0x4356('0xfd')));_0x55c78f['use'](_0x4356('0xfe'),require(_0x4356('0xff')));_0x55c78f[_0x4356('0x9')](_0x4356('0x100'),require('./api/authGoogle'));_0x55c78f[_0x4356('0x9')](_0x4356('0x101'),require(_0x4356('0x102')));_0x55c78f[_0x4356('0x9')](_0x4356('0x103'),require('./api/jira'));_0x55c78f[_0x4356('0x9')](_0x4356('0x104'),require('./api/rpc'));_0x55c78f[_0x4356('0x9')](_0x4356('0x105'),require(_0x4356('0x106')));_0x55c78f[_0x4356('0x9')]('/api/system',require(_0x4356('0x107')));_0x55c78f[_0x4356('0x9')](_0x4356('0x108'),require(_0x4356('0x109')));_0x55c78f[_0x4356('0x9')](_0x4356('0x10a'),require(_0x4356('0x10b')));_0x55c78f[_0x4356('0x9')](_0x4356('0x10c'),clientSideLogs);_0x55c78f['use'](_0x4356('0x10d'),express[_0x4356('0x10e')](path['join'](config[_0x4356('0x10f')],_0x4356('0x10d'))));_0x55c78f[_0x4356('0x9')](_0x4356('0x110'),express['static'](path[_0x4356('0x111')](config[_0x4356('0x10f')],_0x4356('0x110'))));_0x55c78f[_0x4356('0x9')](_0x4356('0x112'),express[_0x4356('0x10e')](path[_0x4356('0x111')](config[_0x4356('0x10f')],_0x4356('0x112'))));_0x55c78f[_0x4356('0x9')](_0x4356('0x113'),express[_0x4356('0x10e')](path[_0x4356('0x111')](config[_0x4356('0x10f')],_0x4356('0x114'),_0x4356('0x115'))));_0x55c78f[_0x4356('0x9')](_0x4356('0x116'),express[_0x4356('0x10e')](path[_0x4356('0x111')](config[_0x4356('0x10f')],_0x4356('0x117'))));_0x55c78f['route'](_0x4356('0x118'))['get'](errors[0x194]);_0x55c78f[_0x4356('0x119')]('/*')[_0x4356('0x11a')](function(_0x320e48,_0x51341e){_0x51341e[_0x4356('0x11b')](path[_0x4356('0x11c')](_0x55c78f[_0x4356('0x11a')](_0x4356('0x11d'))+_0x4356('0x11e')));});return _0x55c78f;});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index c32f3f0..ec0a7b7 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc918=['../api/chatMessage/chatMessage.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','rpc','port','localhost','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','lodash','listen','merge','../api/voiceQueue/voiceQueue.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/trunk/trunk.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc'];(function(_0x401a5a,_0x46e846){var _0x2a816b=function(_0xaac7e4){while(--_0xaac7e4){_0x401a5a['push'](_0x401a5a['shift']());}};_0x2a816b(++_0x46e846);}(_0xc918,0xb9));var _0x8c91=function(_0x3fc6bf,_0x7be6f1){_0x3fc6bf=_0x3fc6bf-0x0;var _0x4b68f4=_0xc918[_0x3fc6bf];return _0x4b68f4;};'use strict';var jayson=require(_0x8c91('0x0'));var _=require(_0x8c91('0x1'));var config=require('../config/environment');exports[_0x8c91('0x2')]=function(){return new Promise(function(_0x5b204b,_0x9f4503){var _0x41f065={};_0x41f065=_[_0x8c91('0x3')](_0x41f065,require('../api/user/user.rpc'));_0x41f065=_[_0x8c91('0x3')](_0x41f065,require('../api/voiceExtension/voiceExtension.rpc'));_0x41f065=_['merge'](_0x41f065,require(_0x8c91('0x4')));_0x41f065=_['merge'](_0x41f065,require('../api/voiceRecording/voiceRecording.rpc'));_0x41f065=_['merge'](_0x41f065,require('../api/voiceCallReport/voiceCallReport.rpc'));_0x41f065=_['merge'](_0x41f065,require('../api/voiceDialReport/voiceDialReport.rpc'));_0x41f065=_['merge'](_0x41f065,require(_0x8c91('0x5')));_0x41f065=_[_0x8c91('0x3')](_0x41f065,require(_0x8c91('0x6')));_0x41f065=_['merge'](_0x41f065,require('../api/memberReport/memberReport.rpc'));_0x41f065=_[_0x8c91('0x3')](_0x41f065,require(_0x8c91('0x7')));_0x41f065=_[_0x8c91('0x3')](_0x41f065,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0x41f065=_['merge'](_0x41f065,require('../api/userVoiceQueueRt/userVoiceQueueRt.rpc'));_0x41f065=_[_0x8c91('0x3')](_0x41f065,require(_0x8c91('0x8')));_0x41f065=_[_0x8c91('0x3')](_0x41f065,require(_0x8c91('0x9')));_0x41f065=_[_0x8c91('0x3')](_0x41f065,require(_0x8c91('0xa')));_0x41f065=_['merge'](_0x41f065,require(_0x8c91('0xb')));_0x41f065=_[_0x8c91('0x3')](_0x41f065,require(_0x8c91('0xc')));_0x41f065=_['merge'](_0x41f065,require(_0x8c91('0xd')));_0x41f065=_[_0x8c91('0x3')](_0x41f065,require(_0x8c91('0xe')));_0x41f065=_['merge'](_0x41f065,require(_0x8c91('0xf')));_0x41f065=_[_0x8c91('0x3')](_0x41f065,require(_0x8c91('0x10')));_0x41f065=_[_0x8c91('0x3')](_0x41f065,require(_0x8c91('0x11')));_0x41f065=_[_0x8c91('0x3')](_0x41f065,require(_0x8c91('0x12')));_0x41f065=_[_0x8c91('0x3')](_0x41f065,require(_0x8c91('0x13')));_0x41f065=_[_0x8c91('0x3')](_0x41f065,require(_0x8c91('0x14')));_0x41f065=_['merge'](_0x41f065,require(_0x8c91('0x15')));_0x41f065=_[_0x8c91('0x3')](_0x41f065,require(_0x8c91('0x16')));_0x41f065=_[_0x8c91('0x3')](_0x41f065,require(_0x8c91('0x17')));_0x41f065=_['merge'](_0x41f065,require('../api/smsQueue/smsQueue.rpc'));_0x41f065=_[_0x8c91('0x3')](_0x41f065,require(_0x8c91('0x18')));_0x41f065=_[_0x8c91('0x3')](_0x41f065,require(_0x8c91('0x19')));_0x41f065=_[_0x8c91('0x3')](_0x41f065,require(_0x8c91('0x1a')));_0x41f065=_[_0x8c91('0x3')](_0x41f065,require(_0x8c91('0x1b')));_0x41f065=_[_0x8c91('0x3')](_0x41f065,require('../api/openchannelQueueReport/openchannelQueueReport.rpc'));_0x41f065=_[_0x8c91('0x3')](_0x41f065,require('../api/chatInteraction/chatInteraction.rpc'));_0x41f065=_[_0x8c91('0x3')](_0x41f065,require(_0x8c91('0x1c')));_0x41f065=_[_0x8c91('0x3')](_0x41f065,require('../api/chatQueue/chatQueue.rpc'));_0x41f065=_[_0x8c91('0x3')](_0x41f065,require(_0x8c91('0x1d')));_0x41f065=_[_0x8c91('0x3')](_0x41f065,require(_0x8c91('0x1e')));_0x41f065=_['merge'](_0x41f065,require('../api/cmHopperBlack/cmHopperBlack.rpc'));_0x41f065=_[_0x8c91('0x3')](_0x41f065,require('../api/cmHopperFinal/cmHopperFinal.rpc'));_0x41f065=_['merge'](_0x41f065,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0x41f065=_[_0x8c91('0x3')](_0x41f065,require(_0x8c91('0x1f')));_0x41f065=_[_0x8c91('0x3')](_0x41f065,require(_0x8c91('0x20')));_0x41f065=_[_0x8c91('0x3')](_0x41f065,require('../api/pause/pause.rpc'));_0x41f065=_[_0x8c91('0x3')](_0x41f065,require(_0x8c91('0x21')));_0x41f065=_[_0x8c91('0x3')](_0x41f065,require('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc'));_0x41f065=_['merge'](_0x41f065,require(_0x8c91('0x22')));_0x41f065=_[_0x8c91('0x3')](_0x41f065,require(_0x8c91('0x23')));_0x41f065=_[_0x8c91('0x3')](_0x41f065,require(_0x8c91('0x24')));_0x41f065=_[_0x8c91('0x3')](_0x41f065,require(_0x8c91('0x25')));_0x41f065=_[_0x8c91('0x3')](_0x41f065,require(_0x8c91('0x26')));_0x41f065=_[_0x8c91('0x3')](_0x41f065,require(_0x8c91('0x27')));_0x41f065=_['merge'](_0x41f065,require(_0x8c91('0x28')));_0x41f065=_[_0x8c91('0x3')](_0x41f065,require('../api/intZendeskAccount/intZendeskAccount.rpc'));_0x41f065=_[_0x8c91('0x3')](_0x41f065,require(_0x8c91('0x29')));_0x41f065=_[_0x8c91('0x3')](_0x41f065,require(_0x8c91('0x2a')));_0x41f065=_[_0x8c91('0x3')](_0x41f065,require(_0x8c91('0x2b')));_0x41f065=_[_0x8c91('0x3')](_0x41f065,require(_0x8c91('0x2c')));_0x41f065=_[_0x8c91('0x3')](_0x41f065,require(_0x8c91('0x2d')));_0x41f065=_[_0x8c91('0x3')](_0x41f065,require(_0x8c91('0x2e')));_0x41f065=_['merge'](_0x41f065,require(_0x8c91('0x2f')));_0x41f065=_[_0x8c91('0x3')](_0x41f065,require(_0x8c91('0x30')));_0x41f065=_[_0x8c91('0x3')](_0x41f065,require(_0x8c91('0x31')));_0x41f065=_['merge'](_0x41f065,require(_0x8c91('0x32')));_0x41f065=_[_0x8c91('0x3')](_0x41f065,require(_0x8c91('0x33')));_0x41f065=_[_0x8c91('0x3')](_0x41f065,require(_0x8c91('0x34')));_0x41f065=_[_0x8c91('0x3')](_0x41f065,require('../api/squareRecording/squareRecording.rpc'));_0x41f065=_[_0x8c91('0x3')](_0x41f065,require('../api/squareMessage/squareMessage.rpc'));_0x41f065=_['merge'](_0x41f065,require(_0x8c91('0x35')));_0x41f065=_[_0x8c91('0x3')](_0x41f065,require(_0x8c91('0x36')));_0x41f065=_[_0x8c91('0x3')](_0x41f065,require(_0x8c91('0x37')));_0x41f065=_['merge'](_0x41f065,require(_0x8c91('0x38')));_0x41f065=_[_0x8c91('0x3')](_0x41f065,require(_0x8c91('0x39')));_0x41f065=_[_0x8c91('0x3')](_0x41f065,require('../api/whatsappMessage/whatsappMessage.rpc'));_0x41f065=_['merge'](_0x41f065,require(_0x8c91('0x3a')));_0x41f065=_[_0x8c91('0x3')](_0x41f065,require(_0x8c91('0x3b')));var _0x1ecbd6=jayson[_0x8c91('0x3c')](_0x41f065)[_0x8c91('0x3d')]();var _0x4c88ba=config[_0x8c91('0x3e')][_0x8c91('0x3f')]||config['port']+0x1;var _0x30d742=config['rpc']['ip']||_0x8c91('0x40');_0x1ecbd6['on'](_0x8c91('0x41'),function(_0xc1c556){return _0x9f4503(_0xc1c556);});_0x1ecbd6['listen'](_0x4c88ba,_0x30d742,function(){console[_0x8c91('0x42')](_0x8c91('0x43'),_0x30d742,_0x4c88ba);require(_0x8c91('0x44'))[_0x8c91('0x45')]();return _0x5b204b(_0x8c91('0x46')+_0x30d742+':'+_0x4c88ba);});});}; \ No newline at end of file +var _0x1d01=['../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsMessage/smsMessage.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','rpc','port','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','lodash','../config/environment','listen','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.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/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc'];(function(_0x4ec520,_0x15fee2){var _0xed49d7=function(_0x3031f2){while(--_0x3031f2){_0x4ec520['push'](_0x4ec520['shift']());}};_0xed49d7(++_0x15fee2);}(_0x1d01,0xb7));var _0x11d0=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x1d01[_0x2641f9];return _0x585741;};'use strict';var jayson=require(_0x11d0('0x0'));var _=require(_0x11d0('0x1'));var config=require(_0x11d0('0x2'));exports[_0x11d0('0x3')]=function(){return new Promise(function(_0x222d4a,_0x1580f7){var _0x467b74={};_0x467b74=_[_0x11d0('0x4')](_0x467b74,require(_0x11d0('0x5')));_0x467b74=_[_0x11d0('0x4')](_0x467b74,require(_0x11d0('0x6')));_0x467b74=_[_0x11d0('0x4')](_0x467b74,require(_0x11d0('0x7')));_0x467b74=_['merge'](_0x467b74,require('../api/voiceRecording/voiceRecording.rpc'));_0x467b74=_['merge'](_0x467b74,require('../api/voiceCallReport/voiceCallReport.rpc'));_0x467b74=_['merge'](_0x467b74,require('../api/voiceDialReport/voiceDialReport.rpc'));_0x467b74=_['merge'](_0x467b74,require(_0x11d0('0x8')));_0x467b74=_[_0x11d0('0x4')](_0x467b74,require(_0x11d0('0x9')));_0x467b74=_['merge'](_0x467b74,require(_0x11d0('0xa')));_0x467b74=_[_0x11d0('0x4')](_0x467b74,require('../api/trunk/trunk.rpc'));_0x467b74=_[_0x11d0('0x4')](_0x467b74,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0x467b74=_[_0x11d0('0x4')](_0x467b74,require(_0x11d0('0xb')));_0x467b74=_[_0x11d0('0x4')](_0x467b74,require('../api/mailServerIn/mailServerIn.rpc'));_0x467b74=_['merge'](_0x467b74,require('../api/mailAccount/mailAccount.rpc'));_0x467b74=_[_0x11d0('0x4')](_0x467b74,require(_0x11d0('0xc')));_0x467b74=_[_0x11d0('0x4')](_0x467b74,require(_0x11d0('0xd')));_0x467b74=_['merge'](_0x467b74,require(_0x11d0('0xe')));_0x467b74=_['merge'](_0x467b74,require(_0x11d0('0xf')));_0x467b74=_[_0x11d0('0x4')](_0x467b74,require(_0x11d0('0x10')));_0x467b74=_[_0x11d0('0x4')](_0x467b74,require(_0x11d0('0x11')));_0x467b74=_[_0x11d0('0x4')](_0x467b74,require(_0x11d0('0x12')));_0x467b74=_[_0x11d0('0x4')](_0x467b74,require(_0x11d0('0x13')));_0x467b74=_['merge'](_0x467b74,require(_0x11d0('0x14')));_0x467b74=_[_0x11d0('0x4')](_0x467b74,require(_0x11d0('0x15')));_0x467b74=_['merge'](_0x467b74,require(_0x11d0('0x16')));_0x467b74=_['merge'](_0x467b74,require('../api/smsAccount/smsAccount.rpc'));_0x467b74=_[_0x11d0('0x4')](_0x467b74,require('../api/smsInteraction/smsInteraction.rpc'));_0x467b74=_[_0x11d0('0x4')](_0x467b74,require(_0x11d0('0x17')));_0x467b74=_['merge'](_0x467b74,require('../api/smsQueue/smsQueue.rpc'));_0x467b74=_[_0x11d0('0x4')](_0x467b74,require(_0x11d0('0x18')));_0x467b74=_[_0x11d0('0x4')](_0x467b74,require(_0x11d0('0x19')));_0x467b74=_['merge'](_0x467b74,require(_0x11d0('0x1a')));_0x467b74=_[_0x11d0('0x4')](_0x467b74,require('../api/openchannelQueue/openchannelQueue.rpc'));_0x467b74=_[_0x11d0('0x4')](_0x467b74,require(_0x11d0('0x1b')));_0x467b74=_['merge'](_0x467b74,require('../api/chatInteraction/chatInteraction.rpc'));_0x467b74=_[_0x11d0('0x4')](_0x467b74,require(_0x11d0('0x1c')));_0x467b74=_['merge'](_0x467b74,require(_0x11d0('0x1d')));_0x467b74=_[_0x11d0('0x4')](_0x467b74,require(_0x11d0('0x1e')));_0x467b74=_['merge'](_0x467b74,require('../api/cmHopper/cmHopper.rpc'));_0x467b74=_['merge'](_0x467b74,require(_0x11d0('0x1f')));_0x467b74=_[_0x11d0('0x4')](_0x467b74,require(_0x11d0('0x20')));_0x467b74=_['merge'](_0x467b74,require(_0x11d0('0x21')));_0x467b74=_[_0x11d0('0x4')](_0x467b74,require(_0x11d0('0x22')));_0x467b74=_[_0x11d0('0x4')](_0x467b74,require(_0x11d0('0x23')));_0x467b74=_[_0x11d0('0x4')](_0x467b74,require(_0x11d0('0x24')));_0x467b74=_['merge'](_0x467b74,require(_0x11d0('0x25')));_0x467b74=_[_0x11d0('0x4')](_0x467b74,require(_0x11d0('0x26')));_0x467b74=_[_0x11d0('0x4')](_0x467b74,require(_0x11d0('0x27')));_0x467b74=_[_0x11d0('0x4')](_0x467b74,require(_0x11d0('0x28')));_0x467b74=_[_0x11d0('0x4')](_0x467b74,require(_0x11d0('0x29')));_0x467b74=_['merge'](_0x467b74,require(_0x11d0('0x2a')));_0x467b74=_[_0x11d0('0x4')](_0x467b74,require(_0x11d0('0x2b')));_0x467b74=_[_0x11d0('0x4')](_0x467b74,require(_0x11d0('0x2c')));_0x467b74=_[_0x11d0('0x4')](_0x467b74,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x467b74=_[_0x11d0('0x4')](_0x467b74,require(_0x11d0('0x2d')));_0x467b74=_[_0x11d0('0x4')](_0x467b74,require('../api/intFreshdeskAccount/intFreshdeskAccount.rpc'));_0x467b74=_['merge'](_0x467b74,require(_0x11d0('0x2e')));_0x467b74=_[_0x11d0('0x4')](_0x467b74,require('../api/intServicenowAccount/intServicenowAccount.rpc'));_0x467b74=_[_0x11d0('0x4')](_0x467b74,require(_0x11d0('0x2f')));_0x467b74=_[_0x11d0('0x4')](_0x467b74,require(_0x11d0('0x30')));_0x467b74=_[_0x11d0('0x4')](_0x467b74,require(_0x11d0('0x31')));_0x467b74=_[_0x11d0('0x4')](_0x467b74,require(_0x11d0('0x32')));_0x467b74=_[_0x11d0('0x4')](_0x467b74,require(_0x11d0('0x33')));_0x467b74=_[_0x11d0('0x4')](_0x467b74,require(_0x11d0('0x34')));_0x467b74=_[_0x11d0('0x4')](_0x467b74,require('../api/setting/setting.rpc'));_0x467b74=_['merge'](_0x467b74,require('../api/squareOdbc/squareOdbc.rpc'));_0x467b74=_['merge'](_0x467b74,require('../api/squareProject/squareProject.rpc'));_0x467b74=_[_0x11d0('0x4')](_0x467b74,require(_0x11d0('0x35')));_0x467b74=_[_0x11d0('0x4')](_0x467b74,require(_0x11d0('0x36')));_0x467b74=_[_0x11d0('0x4')](_0x467b74,require(_0x11d0('0x37')));_0x467b74=_['merge'](_0x467b74,require(_0x11d0('0x38')));_0x467b74=_[_0x11d0('0x4')](_0x467b74,require(_0x11d0('0x39')));_0x467b74=_[_0x11d0('0x4')](_0x467b74,require(_0x11d0('0x3a')));_0x467b74=_['merge'](_0x467b74,require('../api/whatsappInteraction/whatsappInteraction.rpc'));_0x467b74=_[_0x11d0('0x4')](_0x467b74,require('../api/whatsappMessage/whatsappMessage.rpc'));_0x467b74=_[_0x11d0('0x4')](_0x467b74,require(_0x11d0('0x3b')));_0x467b74=_[_0x11d0('0x4')](_0x467b74,require(_0x11d0('0x3c')));var _0xb03c61=jayson['server'](_0x467b74)['http']();var _0x1b7862=config[_0x11d0('0x3d')][_0x11d0('0x3e')]||config['port']+0x1;var _0x9eef2=config[_0x11d0('0x3d')]['ip']||'localhost';_0xb03c61['on']('error',function(_0x49f365){return _0x1580f7(_0x49f365);});_0xb03c61[_0x11d0('0x3')](_0x1b7862,_0x9eef2,function(){console[_0x11d0('0x3f')](_0x11d0('0x40'),_0x9eef2,_0x1b7862);require(_0x11d0('0x41'))[_0x11d0('0x42')]();return _0x222d4a(_0x11d0('0x43')+_0x9eef2+':'+_0x1b7862);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 0b77b61..e85608e 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 _0x084d=['VERBOSE\x20\x22%s\x22','exec','EXEC\x20%s\x20%s','setContext','setExtension','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isBoolean','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','extension','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','wav','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','AGI','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','lodash','events','EventEmitter','call','setEncoding','utf8','setTimeout','headers','emit','line','toLowerCase','hangup','substring','520-Invalid','search','520\x20End\x20of\x20proper','function','replace','result=','indexOf','split','length','match','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','command','inherits','prototype','sendRequest','sync','answer','ANSWER','getData','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE'];(function(_0x378b4,_0x5ca7fa){var _0x11d07b=function(_0x35d420){while(--_0x35d420){_0x378b4['push'](_0x378b4['shift']());}};_0x11d07b(++_0x5ca7fa);}(_0x084d,0x147));var _0xd084=function(_0x270958,_0x260ab4){_0x270958=_0x270958-0x0;var _0x1d057c=_0x084d[_0x270958];return _0x1d057c;};'use strict';var util=require(_0xd084('0x0'));var _=require(_0xd084('0x1'));var EventEmitter=require(_0xd084('0x2'))[_0xd084('0x3')];var AGIReply=require('./reply');var AGIError=require('./error');function AGIChannel(_0x1dd5f2){var _0x3cd476=this,_0x32f68a=new AGIReply(),_0x384c37=![],_0x1dd916={};EventEmitter[_0xd084('0x4')](_0x3cd476);_0x1dd5f2[_0xd084('0x5')](_0xd084('0x6'));_0x1dd5f2[_0xd084('0x7')](0x8*0x3c*0x3c*0x3e8);_0x32f68a[_0xd084('0x5')](_0xd084('0x6'));_0x32f68a['on'](_0xd084('0x8'),function(_0x541b8b){for(var _0x33c221 in _0x541b8b){_0x3cd476[_0x33c221]=_0x541b8b[_0x33c221];}_0x3cd476[_0xd084('0x9')]('ready');});_0x32f68a['on'](_0xd084('0xa'),function(_0x5e35c7){if(_0x5e35c7[_0xd084('0xb')]()==_0xd084('0xc')){_0x3cd476['emit'](_0xd084('0xc'));return;}if(_0x5e35c7[_0xd084('0xd')](0x0,0xb)==_0xd084('0xe')){_0x384c37=!![];}if(_0x384c37){_0x1dd916['rx']+=_0x5e35c7+'\x0a';if(_0x5e35c7[_0xd084('0xf')](_0xd084('0x10'))!=-0x1){_0x384c37=![];}}else{_0x1dd916['rx']=_0x5e35c7;}if(_0x384c37){return;}if(typeof _0x1dd916['cb']==_0xd084('0x11')){var _0x5ef43f=_0x1dd916['rx']['substring'](0x0,0x3),_0xb5bcfe=null,_0x594c0b=null;_0x5ef43f=parseInt(_0x5ef43f);if(isNaN(_0x5ef43f)){_0x1dd916['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0x5ef43f!=0xc8){_0x1dd916['cb'](null,{'code':_0x5ef43f,'result':-0x1,'extra':'KO'});return;}_0xb5bcfe=_0x1dd916['rx']['substring'](0x4)[_0xd084('0x12')](_0xd084('0x13'),'');if(_0xb5bcfe['indexOf']('\x20')!=-0x1){_0xb5bcfe=_0xb5bcfe['substr'](0x0,_0xb5bcfe[_0xd084('0x14')]('\x20'));}if(_['startsWith'](_0xb5bcfe,'-1')){_0xb5bcfe=parseInt(_0xb5bcfe);}_0x594c0b=_0x1dd916['rx'][_0xd084('0x15')]('\x20');if(_0x594c0b[_0xd084('0x16')]==0x3){_0x594c0b=_0x594c0b[0x2]['substring'](0x1,_0x594c0b[0x2][_0xd084('0x16')]-0x1);}else if(_0x594c0b[_0xd084('0x16')]>0x3){var _0x118e18=/\((.+)\)/;var _0x1ebf2e=_0x1dd916['rx'][_0xd084('0x17')](_0x118e18);if(_0x1ebf2e){_0x594c0b=_0x1ebf2e[0x1];}else{_0x594c0b=null;}}else{_0x594c0b=null;}_0x1dd916['cb'](null,{'code':_0x5ef43f,'result':_0xb5bcfe,'extra':_0x594c0b});}});_0x1dd5f2['on'](_0xd084('0x18'),function(_0x477a14){_0x3cd476[_0xd084('0x9')]('error',new AGIError(_0xd084('0x19'),_0x477a14[_0xd084('0x1a')]));});_0x1dd5f2['on']('close',function(){_0x3cd476[_0xd084('0x9')](_0xd084('0x1b'),new AGIError(_0xd084('0x1c')));});_0x1dd5f2['on'](_0xd084('0x1d'),function(){_0x3cd476[_0xd084('0x9')](_0xd084('0x1d'),new AGIError(_0xd084('0x1e')));_0x1dd5f2['destroy']();});_0x1dd5f2['pipe'](_0x32f68a);this[_0xd084('0x1f')]=function(_0x2473e3,_0x1f401c){var _0x2473e3=_0x2473e3||'',_0x1f401c=typeof _0x1f401c==_0xd084('0x11')?_0x1f401c:new Function();_0x1dd916={'tx':_0x2473e3,'rx':'','cb':_0x1f401c};_0x1dd5f2['write'](_0x2473e3+'\x0a');},this[_0xd084('0x1b')]=function(){_0x1dd5f2['destroy']();};}util[_0xd084('0x20')](AGIChannel,EventEmitter);AGIChannel[_0xd084('0x21')][_0xd084('0x22')]=function(_0x5e2a3f){return this[_0xd084('0x1f')][_0xd084('0x23')](this,_0x5e2a3f);};AGIChannel[_0xd084('0x21')][_0xd084('0x24')]=function(){return this['sendRequest'](_0xd084('0x25'));};AGIChannel['prototype'][_0xd084('0x26')]=function(_0x1204cc,_0x2edd5e,_0x148397){_0x1204cc=_0x1204cc===undefined?'beep':_0x1204cc;_0x2edd5e=_0x2edd5e===undefined?'5':_0x2edd5e;_0x148397=_0x148397===undefined?'1':_0x148397;return this[_0xd084('0x22')](util[_0xd084('0x27')](_0xd084('0x28'),_0x1204cc,_0x2edd5e*0x3e8,_0x148397));};AGIChannel['prototype'][_0xd084('0x29')]=function(_0x3800e1){_0x3800e1=_0x3800e1||_0xd084('0x2a');return this[_0xd084('0x22')](util[_0xd084('0x27')](_0xd084('0x2b'),_0x3800e1));};AGIChannel[_0xd084('0x21')][_0xd084('0x2c')]=function(_0x4a54b3,_0x371efc){if(_['isArray'](_0x371efc)){return this[_0xd084('0x22')](util[_0xd084('0x27')](_0xd084('0x2d'),_0x4a54b3,_0x371efc['join'](',')));}return this[_0xd084('0x22')](util[_0xd084('0x27')](_0xd084('0x2d'),_0x4a54b3,_0x371efc));};AGIChannel['prototype'][_0xd084('0x2e')]=function(_0x5d5252){return this[_0xd084('0x22')](util[_0xd084('0x27')]('SET\x20CONTEXT\x20%s',_0x5d5252));};AGIChannel[_0xd084('0x21')][_0xd084('0x2f')]=function(_0x11d5b5){return this[_0xd084('0x22')](util[_0xd084('0x27')](_0xd084('0x30'),_0x11d5b5));};AGIChannel['prototype'][_0xd084('0x31')]=function(_0x9b1e22){return this[_0xd084('0x22')](util[_0xd084('0x27')](_0xd084('0x32'),_0x9b1e22));};AGIChannel['prototype']['hangup']=function(){return this[_0xd084('0x22')](_0xd084('0x33'));};AGIChannel[_0xd084('0x21')][_0xd084('0x34')]=function(_0x1dcb2a,_0x42fc1e){var _0x4d0927=_[_0xd084('0x35')](_0x42fc1e)||_['isNumber'](_0x42fc1e)?_0x42fc1e['toString']():_0x42fc1e;return this[_0xd084('0x22')](util[_0xd084('0x27')](_0xd084('0x36'),_0x1dcb2a,_0x4d0927?_0x4d0927['toString']()[_0xd084('0x12')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0xd084('0x21')][_0xd084('0x37')]=function(_0x41518b,_0x25548c){return this[_0xd084('0x22')](util[_0xd084('0x27')](_0xd084('0x38'),_0x41518b,_0x25548c));};AGIChannel[_0xd084('0x21')]['sayDigits']=function(_0x1a949c,_0x52f2ff){return this[_0xd084('0x22')](util['format']('SAY\x20DIGITS\x20%s\x20%s',_0x1a949c,_0x52f2ff));};AGIChannel[_0xd084('0x21')][_0xd084('0x39')]=function(_0x29aa8c,_0x585227){return this[_0xd084('0x22')](util[_0xd084('0x27')](_0xd084('0x3a'),_0x29aa8c,_0x585227));};AGIChannel['prototype']['continueAt']=function(_0x475f99,_0x9c1a17,_0x23ca11){_0x9c1a17=_0x9c1a17||this[_0xd084('0x3b')];_0x23ca11=_0x23ca11||0x1;this['setContext'](_0x475f99);this['setExtension'](_0x9c1a17);this[_0xd084('0x31')](_0x23ca11);return this['noop'](util[_0xd084('0x27')](_0xd084('0x3c'),_0x475f99,_0x9c1a17,_0x23ca11));};AGIChannel[_0xd084('0x21')][_0xd084('0x3d')]=function(_0x21c828){return this[_0xd084('0x22')](util['format'](_0xd084('0x3e'),_0x21c828));};AGIChannel[_0xd084('0x21')]['recordFile']=function(_0x3c07a3,_0x1ab66c,_0x15a98b,_0xb89919,_0x3e7401,_0x82feaf){_0x1ab66c=_0x1ab66c||_0xd084('0x3f');_0x15a98b=_0x15a98b||'';_0xb89919=_0xb89919===undefined?-0x1:_0xb89919==='-1'?-0x1:_0xb89919*0x3e8;_0x3e7401=_0x3e7401===undefined?'':'s='+_0x3e7401;_0x82feaf=_0x82feaf?'BEEP':'';return this[_0xd084('0x22')](util[_0xd084('0x27')](_0xd084('0x40'),_0x3c07a3,_0x1ab66c,_0x15a98b,_0xb89919,_0x82feaf,_0x3e7401));};AGIChannel[_0xd084('0x21')][_0xd084('0x41')]=function(_0x245039,_0xc6fc3){_0xc6fc3=_0xc6fc3||'';return this[_0xd084('0x22')](util[_0xd084('0x27')](_0xd084('0x42'),_0x245039,_0xc6fc3));};AGIChannel[_0xd084('0x21')][_0xd084('0x43')]=function(_0x46f537){return this[_0xd084('0x2c')](_0xd084('0x44'),_0x46f537);};AGIChannel[_0xd084('0x21')][_0xd084('0x45')]=function(_0x281ac0){return this['exec'](_0xd084('0x46'),_0x281ac0);};AGIChannel[_0xd084('0x21')][_0xd084('0x18')]=function(_0xf7606e,_0x4c7438){this[_0xd084('0x29')](util['format'](_0xd084('0x47'),_0xf7606e['id'],_0xf7606e[_0xd084('0x48')],_0x4c7438));return{'code':0x1f4,'result':'-1','extra':''};};module[_0xd084('0x49')]=AGIChannel; \ No newline at end of file +var _0xa899=['code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','function','write','prototype','command','sync','answer','sendRequest','ANSWER','getData','format','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','extension','noop','GOTO\x20%s\x20%s\x20%s','recordFile','BEEP','streamFile','agi','AGI','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','exports','util','lodash','events','./reply','./error','call','setEncoding','utf8','setTimeout','emit','line','toLowerCase','hangup','substring','520-Invalid','search','replace','result=','substr','indexOf','startsWith','split','length','error'];(function(_0xaa804,_0x1c07b6){var _0x1617f1=function(_0x16b13a){while(--_0x16b13a){_0xaa804['push'](_0xaa804['shift']());}};_0x1617f1(++_0x1c07b6);}(_0xa899,0x155));var _0x9a89=function(_0x3050ca,_0x3e36b0){_0x3050ca=_0x3050ca-0x0;var _0x1eed1d=_0xa899[_0x3050ca];return _0x1eed1d;};'use strict';var util=require(_0x9a89('0x0'));var _=require(_0x9a89('0x1'));var EventEmitter=require(_0x9a89('0x2'))['EventEmitter'];var AGIReply=require(_0x9a89('0x3'));var AGIError=require(_0x9a89('0x4'));function AGIChannel(_0x2bc02a){var _0x45233c=this,_0x405c47=new AGIReply(),_0x15c431=![],_0x105758={};EventEmitter[_0x9a89('0x5')](_0x45233c);_0x2bc02a[_0x9a89('0x6')](_0x9a89('0x7'));_0x2bc02a[_0x9a89('0x8')](0x8*0x3c*0x3c*0x3e8);_0x405c47[_0x9a89('0x6')](_0x9a89('0x7'));_0x405c47['on']('headers',function(_0x4d2b72){for(var _0xe61171 in _0x4d2b72){_0x45233c[_0xe61171]=_0x4d2b72[_0xe61171];}_0x45233c[_0x9a89('0x9')]('ready');});_0x405c47['on'](_0x9a89('0xa'),function(_0x4f487d){if(_0x4f487d[_0x9a89('0xb')]()==_0x9a89('0xc')){_0x45233c[_0x9a89('0x9')](_0x9a89('0xc'));return;}if(_0x4f487d[_0x9a89('0xd')](0x0,0xb)==_0x9a89('0xe')){_0x15c431=!![];}if(_0x15c431){_0x105758['rx']+=_0x4f487d+'\x0a';if(_0x4f487d[_0x9a89('0xf')]('520\x20End\x20of\x20proper')!=-0x1){_0x15c431=![];}}else{_0x105758['rx']=_0x4f487d;}if(_0x15c431){return;}if(typeof _0x105758['cb']=='function'){var _0x4342c8=_0x105758['rx']['substring'](0x0,0x3),_0x8b7403=null,_0x2bdb0d=null;_0x4342c8=parseInt(_0x4342c8);if(isNaN(_0x4342c8)){_0x105758['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0x4342c8!=0xc8){_0x105758['cb'](null,{'code':_0x4342c8,'result':-0x1,'extra':'KO'});return;}_0x8b7403=_0x105758['rx']['substring'](0x4)[_0x9a89('0x10')](_0x9a89('0x11'),'');if(_0x8b7403['indexOf']('\x20')!=-0x1){_0x8b7403=_0x8b7403[_0x9a89('0x12')](0x0,_0x8b7403[_0x9a89('0x13')]('\x20'));}if(_[_0x9a89('0x14')](_0x8b7403,'-1')){_0x8b7403=parseInt(_0x8b7403);}_0x2bdb0d=_0x105758['rx'][_0x9a89('0x15')]('\x20');if(_0x2bdb0d['length']==0x3){_0x2bdb0d=_0x2bdb0d[0x2][_0x9a89('0xd')](0x1,_0x2bdb0d[0x2][_0x9a89('0x16')]-0x1);}else if(_0x2bdb0d['length']>0x3){var _0x4fe73e=/\((.+)\)/;var _0x35221f=_0x105758['rx']['match'](_0x4fe73e);if(_0x35221f){_0x2bdb0d=_0x35221f[0x1];}else{_0x2bdb0d=null;}}else{_0x2bdb0d=null;}_0x105758['cb'](null,{'code':_0x4342c8,'result':_0x8b7403,'extra':_0x2bdb0d});}});_0x2bc02a['on'](_0x9a89('0x17'),function(_0x334725){_0x45233c['emit'](_0x9a89('0x17'),new AGIError('E_AGI_SOCKET_ERROR',_0x334725[_0x9a89('0x18')]));});_0x2bc02a['on'](_0x9a89('0x19'),function(){_0x45233c['emit'](_0x9a89('0x19'),new AGIError(_0x9a89('0x1a')));});_0x2bc02a['on'](_0x9a89('0x1b'),function(){_0x45233c[_0x9a89('0x9')](_0x9a89('0x1b'),new AGIError(_0x9a89('0x1c')));_0x2bc02a[_0x9a89('0x1d')]();});_0x2bc02a[_0x9a89('0x1e')](_0x405c47);this['command']=function(_0x51618d,_0x1ef5ef){var _0x51618d=_0x51618d||'',_0x1ef5ef=typeof _0x1ef5ef==_0x9a89('0x1f')?_0x1ef5ef:new Function();_0x105758={'tx':_0x51618d,'rx':'','cb':_0x1ef5ef};_0x2bc02a[_0x9a89('0x20')](_0x51618d+'\x0a');},this[_0x9a89('0x19')]=function(){_0x2bc02a['destroy']();};}util['inherits'](AGIChannel,EventEmitter);AGIChannel[_0x9a89('0x21')]['sendRequest']=function(_0x3f5723){return this[_0x9a89('0x22')][_0x9a89('0x23')](this,_0x3f5723);};AGIChannel[_0x9a89('0x21')][_0x9a89('0x24')]=function(){return this[_0x9a89('0x25')](_0x9a89('0x26'));};AGIChannel['prototype'][_0x9a89('0x27')]=function(_0x5002a2,_0xd64312,_0x5a888b){_0x5002a2=_0x5002a2===undefined?'beep':_0x5002a2;_0xd64312=_0xd64312===undefined?'5':_0xd64312;_0x5a888b=_0x5a888b===undefined?'1':_0x5a888b;return this[_0x9a89('0x25')](util[_0x9a89('0x28')]('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0x5002a2,_0xd64312*0x3e8,_0x5a888b));};AGIChannel[_0x9a89('0x21')]['noop']=function(_0x27f442){_0x27f442=_0x27f442||_0x9a89('0x29');return this[_0x9a89('0x25')](util[_0x9a89('0x28')](_0x9a89('0x2a'),_0x27f442));};AGIChannel[_0x9a89('0x21')][_0x9a89('0x2b')]=function(_0x5e5751,_0x4df9f2){if(_['isArray'](_0x4df9f2)){return this[_0x9a89('0x25')](util['format'](_0x9a89('0x2c'),_0x5e5751,_0x4df9f2[_0x9a89('0x2d')](',')));}return this[_0x9a89('0x25')](util['format'](_0x9a89('0x2c'),_0x5e5751,_0x4df9f2));};AGIChannel['prototype'][_0x9a89('0x2e')]=function(_0x2102db){return this[_0x9a89('0x25')](util[_0x9a89('0x28')](_0x9a89('0x2f'),_0x2102db));};AGIChannel['prototype'][_0x9a89('0x30')]=function(_0x163055){return this[_0x9a89('0x25')](util[_0x9a89('0x28')](_0x9a89('0x31'),_0x163055));};AGIChannel[_0x9a89('0x21')][_0x9a89('0x32')]=function(_0x238bd8){return this[_0x9a89('0x25')](util['format'](_0x9a89('0x33'),_0x238bd8));};AGIChannel[_0x9a89('0x21')][_0x9a89('0xc')]=function(){return this[_0x9a89('0x25')](_0x9a89('0x34'));};AGIChannel[_0x9a89('0x21')][_0x9a89('0x35')]=function(_0x18304a,_0x394d2c){var _0x36f1b0=_['isBoolean'](_0x394d2c)||_[_0x9a89('0x36')](_0x394d2c)?_0x394d2c[_0x9a89('0x37')]():_0x394d2c;return this[_0x9a89('0x25')](util[_0x9a89('0x28')](_0x9a89('0x38'),_0x18304a,_0x36f1b0?_0x36f1b0[_0x9a89('0x37')]()[_0x9a89('0x10')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x9a89('0x21')][_0x9a89('0x39')]=function(_0x77fa47,_0x404511){return this[_0x9a89('0x25')](util['format'](_0x9a89('0x3a'),_0x77fa47,_0x404511));};AGIChannel['prototype'][_0x9a89('0x3b')]=function(_0x2c9cff,_0x26112d){return this[_0x9a89('0x25')](util[_0x9a89('0x28')](_0x9a89('0x3c'),_0x2c9cff,_0x26112d));};AGIChannel[_0x9a89('0x21')][_0x9a89('0x3d')]=function(_0x192138,_0x53c4a7){return this[_0x9a89('0x25')](util[_0x9a89('0x28')](_0x9a89('0x3e'),_0x192138,_0x53c4a7));};AGIChannel[_0x9a89('0x21')]['continueAt']=function(_0x496244,_0x46c1f9,_0x500ab3){_0x46c1f9=_0x46c1f9||this[_0x9a89('0x3f')];_0x500ab3=_0x500ab3||0x1;this[_0x9a89('0x2e')](_0x496244);this[_0x9a89('0x30')](_0x46c1f9);this[_0x9a89('0x32')](_0x500ab3);return this[_0x9a89('0x40')](util[_0x9a89('0x28')](_0x9a89('0x41'),_0x496244,_0x46c1f9,_0x500ab3));};AGIChannel[_0x9a89('0x21')]['getVariable']=function(_0x4c4f2c){return this['sendRequest'](util[_0x9a89('0x28')]('GET\x20VARIABLE\x20\x22%s\x22',_0x4c4f2c));};AGIChannel['prototype'][_0x9a89('0x42')]=function(_0x355006,_0x240887,_0x5e2662,_0x439089,_0x515370,_0xd3d7df){_0x240887=_0x240887||'wav';_0x5e2662=_0x5e2662||'';_0x439089=_0x439089===undefined?-0x1:_0x439089==='-1'?-0x1:_0x439089*0x3e8;_0x515370=_0x515370===undefined?'':'s='+_0x515370;_0xd3d7df=_0xd3d7df?_0x9a89('0x43'):'';return this[_0x9a89('0x25')](util[_0x9a89('0x28')]('RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s',_0x355006,_0x240887,_0x5e2662,_0x439089,_0xd3d7df,_0x515370));};AGIChannel[_0x9a89('0x21')][_0x9a89('0x44')]=function(_0x39c745,_0x582837){_0x582837=_0x582837||'';return this['sendRequest'](util[_0x9a89('0x28')]('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x39c745,_0x582837));};AGIChannel[_0x9a89('0x21')][_0x9a89('0x45')]=function(_0x533cbd){return this[_0x9a89('0x2b')](_0x9a89('0x46'),_0x533cbd);};AGIChannel['prototype']['wait']=function(_0x338559){return this[_0x9a89('0x2b')]('WAIT',_0x338559);};AGIChannel[_0x9a89('0x21')]['error']=function(_0x55e1dd,_0x2d58d4){this[_0x9a89('0x40')](util[_0x9a89('0x28')](_0x9a89('0x47'),_0x55e1dd['id'],_0x55e1dd['label'],_0x2d58d4));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x9a89('0x48')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index da019f5..4c86926 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 _0x11d7=['Empty\x20command.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','apply','util','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.'];(function(_0xb00710,_0x4d7d03){var _0x3980c0=function(_0x11addf){while(--_0x11addf){_0xb00710['push'](_0xb00710['shift']());}};_0x3980c0(++_0x4d7d03);}(_0x11d7,0x1f4));var _0x711d=function(_0xa30766,_0x6f613e){_0xa30766=_0xa30766-0x0;var _0x24e780=_0x11d7[_0xa30766];return _0x24e780;};'use strict';var util=require(_0x711d('0x0'));var error={'E_AGI_UNDEFINED':'Undefined\x20error.','E_AGI_ARGUMENT_PORT':_0x711d('0x1'),'E_AGI_SERVER_ERROR':_0x711d('0x2'),'E_AGI_SERVER_CLOSE':_0x711d('0x3'),'E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':_0x711d('0x4'),'E_AGI_SOCKET_CLOSE':_0x711d('0x5'),'E_AGI_SOCKET_TIMEOUT':'Socket\x20timeout.','E_AGI_COMMAND_EMPTY':_0x711d('0x6'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':_0x711d('0x7')};function AGIError(_0x443c33){var _0x443c33=_0x443c33||null,_0x254251=_0x254251||[],_0x5de281=0x1,_0x3ddd0d='';if(!error[_0x443c33]){_0x443c33=_0x711d('0x8');}_0x254251['push'](error[_0x443c33]);while(arguments[_0x5de281]){_0x254251[_0x711d('0x9')](arguments[_0x5de281]);_0x5de281++;}_0x3ddd0d=util['format'][_0x711d('0xa')](util,_0x254251);this['message']=_0x3ddd0d;this['name']=_0x443c33;}module['exports']=AGIError; \ No newline at end of file +var _0xe1c7=['Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Empty\x20command.','E_AGI_UNDEFINED','push','format','message','name','util','Undefined\x20error.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.'];(function(_0x5abd75,_0x240b60){var _0x3aabb2=function(_0x5b576d){while(--_0x5b576d){_0x5abd75['push'](_0x5abd75['shift']());}};_0x3aabb2(++_0x240b60);}(_0xe1c7,0x174));var _0x7e1c=function(_0x2d344f,_0x25fa84){_0x2d344f=_0x2d344f-0x0;var _0x2e796b=_0xe1c7[_0x2d344f];return _0x2e796b;};'use strict';var util=require(_0x7e1c('0x0'));var error={'E_AGI_UNDEFINED':_0x7e1c('0x1'),'E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':_0x7e1c('0x2'),'E_AGI_SERVER_CLOSE':_0x7e1c('0x3'),'E_AGI_SERVER_MAXCONNECTION':_0x7e1c('0x4'),'E_AGI_SERVER_VOICE_DISABLED':_0x7e1c('0x5'),'E_AGI_SOCKET_ERROR':_0x7e1c('0x6'),'E_AGI_SOCKET_CLOSE':_0x7e1c('0x7'),'E_AGI_SOCKET_TIMEOUT':'Socket\x20timeout.','E_AGI_COMMAND_EMPTY':_0x7e1c('0x8'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':'Missing\x20\x27ivr.entry\x27\x20menu.'};function AGIError(_0x5bbabd){var _0x5bbabd=_0x5bbabd||null,_0x4d13d6=_0x4d13d6||[],_0x117c26=0x1,_0x540219='';if(!error[_0x5bbabd]){_0x5bbabd=_0x7e1c('0x9');}_0x4d13d6[_0x7e1c('0xa')](error[_0x5bbabd]);while(arguments[_0x117c26]){_0x4d13d6[_0x7e1c('0xa')](arguments[_0x117c26]);_0x117c26++;}_0x540219=util[_0x7e1c('0xb')]['apply'](util,_0x4d13d6);this[_0x7e1c('0xc')]=_0x540219;this[_0x7e1c('0xd')]=_0x5bbabd;}module['exports']=AGIError; \ No newline at end of file diff --git a/server/services/agi/events.js b/server/services/agi/events.js index f7fff53..93ae9d3 100644 --- a/server/services/agi/events.js +++ b/server/services/agi/events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2589=['redis','localhost','subscribe','agi','emit','error','E_AGI_SERVER_ERROR','message','parse','projectUpdate','lodash','events','EventEmitter','ioredis','./error','../../config/environment'];(function(_0x53ed50,_0x25a004){var _0x391967=function(_0x5258c1){while(--_0x5258c1){_0x53ed50['push'](_0x53ed50['shift']());}};_0x391967(++_0x25a004);}(_0x2589,0x1ea));var _0x9258=function(_0x5aa87f,_0x13bffb){_0x5aa87f=_0x5aa87f-0x0;var _0x16d679=_0x2589[_0x5aa87f];return _0x16d679;};'use strict';var _=require(_0x9258('0x0'));var EventEmitter=require(_0x9258('0x1'))[_0x9258('0x2')];var Redis=require(_0x9258('0x3'));var AGIError=require(_0x9258('0x4'));var config=require(_0x9258('0x5'));config[_0x9258('0x6')]=_['defaults'](config['redis'],{'host':_0x9258('0x7'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0x9258('0x6')]);sub[_0x9258('0x8')](_0x9258('0x9'),function(_0x17d0b5){if(_0x17d0b5)return eventEmitter[_0x9258('0xa')](_0x9258('0xb'),new AGIError(_0x9258('0xc'),_0x17d0b5));});sub['on'](_0x9258('0xd'),function(_0x165b6f,_0x5f479a){if(_0x165b6f!==_0x9258('0x9'))return;try{var _0x1eabd4=JSON[_0x9258('0xe')](_0x5f479a);eventEmitter[_0x9258('0xa')](_0x9258('0xf'),_0x1eabd4);}catch(_0x12963d){eventEmitter[_0x9258('0xa')]('error',new AGIError(_0x9258('0xc'),_0x12963d));}});module['exports']={'EventEmitter':eventEmitter}; \ No newline at end of file +var _0x5d45=['exports','lodash','events','EventEmitter','ioredis','./error','../../config/environment','defaults','redis','subscribe','emit','error','message','agi','parse','projectUpdate','E_AGI_SERVER_ERROR'];(function(_0x50701f,_0xae209e){var _0x3d63a8=function(_0x3f0915){while(--_0x3f0915){_0x50701f['push'](_0x50701f['shift']());}};_0x3d63a8(++_0xae209e);}(_0x5d45,0x1ee));var _0x55d4=function(_0x998913,_0x13949a){_0x998913=_0x998913-0x0;var _0x523b55=_0x5d45[_0x998913];return _0x523b55;};'use strict';var _=require(_0x55d4('0x0'));var EventEmitter=require(_0x55d4('0x1'))[_0x55d4('0x2')];var Redis=require(_0x55d4('0x3'));var AGIError=require(_0x55d4('0x4'));var config=require(_0x55d4('0x5'));config['redis']=_[_0x55d4('0x6')](config['redis'],{'host':'localhost','port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0x55d4('0x7')]);sub[_0x55d4('0x8')]('agi',function(_0x5a52bf){if(_0x5a52bf)return eventEmitter[_0x55d4('0x9')](_0x55d4('0xa'),new AGIError('E_AGI_SERVER_ERROR',_0x5a52bf));});sub['on'](_0x55d4('0xb'),function(_0x1f96d4,_0x1cf3d5){if(_0x1f96d4!==_0x55d4('0xc'))return;try{var _0x2e6061=JSON[_0x55d4('0xd')](_0x1cf3d5);eventEmitter['emit'](_0x55d4('0xe'),_0x2e6061);}catch(_0x21e2c6){eventEmitter[_0x55d4('0x9')](_0x55d4('0xa'),new AGIError(_0x55d4('0xf'),_0x21e2c6));}});module[_0x55d4('0x10')]={'EventEmitter':eventEmitter}; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index e7e0789..9c5d48f 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 _0x2843=['agicommand','vswitch','target','invalid','default\x20on\x20switch\x20not\x20found','includes','max\x20retry\x20reach','exports','agi','menu','getdigits','getsecretdigits','numberOfEdges','prototype','addVertex','edges','size','relations','getVertex','vertices','traverseBFS','info','no\x20vertex\x20found','stop\x20traverse','length','condition','split'];(function(_0x44dcad,_0x2d1b9c){var _0x3cdc33=function(_0x21228b){while(--_0x21228b){_0x44dcad['push'](_0x44dcad['shift']());}};_0x3cdc33(++_0x2d1b9c);}(_0x2843,0x74));var _0x3284=function(_0xb301d4,_0x27ed18){_0xb301d4=_0xb301d4-0x0;var _0x3b5bde=_0x2843[_0xb301d4];return _0x3b5bde;};'use strict';var _=require('lodash');var logger=require('../../../config/logger')(_0x3284('0x0'));var verticesWithRetry=[_0x3284('0x1'),_0x3284('0x2'),_0x3284('0x3')];var Graph=function(){this['vertices']={};this['edges']={};this[_0x3284('0x4')]=0x0;};Graph[_0x3284('0x5')][_0x3284('0x6')]=function(_0x47859e){this['vertices'][_0x47859e['id']]=_0x47859e;this['edges'][_0x47859e['id']]=[];};Graph[_0x3284('0x5')]['addEdge']=function(_0x4a65d0,_0x11d0b3,_0xec45a6){this[_0x3284('0x7')][_0x4a65d0]['push']({'target':_0x11d0b3,'condition':_0xec45a6});this[_0x3284('0x4')]+=0x1;};Graph[_0x3284('0x5')][_0x3284('0x8')]=function(){return _[_0x3284('0x8')](this['vertices']);};Graph[_0x3284('0x5')][_0x3284('0x9')]=function(){return this[_0x3284('0x4')];};Graph[_0x3284('0x5')][_0x3284('0xa')]=function(_0x5c8cdd){return this[_0x3284('0xb')][_0x5c8cdd];};Graph[_0x3284('0x5')][_0x3284('0xc')]=function(_0x20a75e,_0x4a05a5){if(!this['vertices'][_0x20a75e]){return logger[_0x3284('0xd')](_0x3284('0xe'));}var _0x27539e=_0x4a05a5(this[_0x3284('0xb')][_0x20a75e]);if(!_0x27539e){return logger[_0x3284('0xd')](_0x3284('0xf'));}if(this[_0x3284('0x7')][_0x20a75e][_0x3284('0x10')]===0x0){return logger[_0x3284('0xd')]('no\x20edge/s\x20available');}for(var _0x327528=0x0,_0x360c9e=[],_0x31f9bc=![];_0x327528\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','then','catch','hasOwnProperty','indexOf','debug','variables','stringify','close','timeout','hangup','find','handleNotFound','production','handleUnpublished','voice','callysquare'];(function(_0x5d49c8,_0x341701){var _0xb6a158=function(_0x4def37){while(--_0x4def37){_0x5d49c8['push'](_0x5d49c8['shift']());}};_0xb6a158(++_0x341701);}(_0x373c,0xb4));var _0xc373=function(_0x50aa2e,_0xfbd6f0){_0x50aa2e=_0x50aa2e-0x0;var _0x5e07f0=_0x373c[_0x50aa2e];return _0x5e07f0;};'use strict';var _=require(_0xc373('0x0'));var syncho=require('syncho');var util=require(_0xc373('0x1'));var config=require('../../config/environment');var logger=require(_0xc373('0x2'))('agi');var utilLicense=require(_0xc373('0x3'));var rpc=require(_0xc373('0x4'));var Project=require(_0xc373('0x5'));var AGIEmitter=require('./events')[_0xc373('0x6')];var projects=[];config[_0xc373('0x7')]=_['defaults'](config['agi'],{'ip':_0xc373('0x8'),'port':0x11dd});AGIEmitter['on'](_0xc373('0x9'),projectUpdateHandler);function connectionHandler(_0x3e5278){process[_0xc373('0xa')](function(){syncho(function(){try{setChannelVariables(_0x3e5278);agiHandler(_0x3e5278);}catch(_0x2998bf){logger[_0xc373('0xb')](_0x2998bf['stack']);}});});}function projectUpdateHandler(_0x2ba8fb){try{var _0x170ebf=_[_0xc373('0xc')](projects,['id',_0x2ba8fb['id']]);if(_0x170ebf>-0x1){if(_0x2ba8fb[_0xc373('0xd')]===!![]){projects[_0xc373('0xe')](_0x170ebf,0x1);}else{projects[_0x170ebf]=_0x2ba8fb;}}else{projects['push'](_0x2ba8fb);}}catch(_0x164180){logger[_0xc373('0xb')](_0x164180['stack']);}}function listeningHandler(){console[_0xc373('0xf')](_0xc373('0x10'),config['agi'][_0xc373('0x11')]);logger[_0xc373('0x12')](util[_0xc373('0x13')](_0xc373('0x14'),config['agi']['ip'],config[_0xc373('0x7')][_0xc373('0x11')]));}function errorHandler(_0x402920){if(_0x402920&&_0x402920['name']&&_0x402920['message']){logger[_0xc373('0xb')](util['format']('[%s]\x20%s',_0x402920[_0xc373('0x15')],_0x402920[_0xc373('0x16')]));}else{logger[_0xc373('0xb')](util[_0xc373('0x13')]('[ERROR]\x20%s',_0x402920[_0xc373('0x17')]));}}function closeHandler(){logger[_0xc373('0x12')](util[_0xc373('0x13')]('[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0xc373('0x18')],this[_0xc373('0x19')],this[_0xc373('0x1a')],this[_0xc373('0x1b')],this[_0xc373('0x1c')]));try{createSquareReport(this);}catch(_0x41d5e3){logger[_0xc373('0xb')](_0x41d5e3['stack']);}}function timeoutHandler(){logger['info'](util[_0xc373('0x13')](_0xc373('0x1d'),this[_0xc373('0x18')],this[_0xc373('0x19')],this[_0xc373('0x1a')],this[_0xc373('0x1b')],this[_0xc373('0x1c')]));}function hangupHandler(){logger[_0xc373('0x12')](util[_0xc373('0x13')](_0xc373('0x1e'),this[_0xc373('0x18')],this[_0xc373('0x19')],this[_0xc373('0x1a')],this[_0xc373('0x1b')],this[_0xc373('0x1c')]));this[_0xc373('0x1f')]=!![];}function createSquareReport(_0x14e282,_0x30b3bf){rpc['createSquareReport'](_0x14e282)[_0xc373('0x20')](function(_0x3b5e52){if(_0x30b3bf){_0x30b3bf(null,_0x3b5e52);}})[_0xc373('0x21')](function(_0x5af7ae){if(_0x30b3bf){_0x30b3bf(null,_0x5af7ae);}});}function setChannelVariables(_0x5c674f){for(var _0xbb5048 in _0x5c674f){if(_0x5c674f[_0xc373('0x22')](_0xbb5048)){if(_0xbb5048[_0xc373('0x23')]('agi_')===0x0){_0x5c674f[_0xbb5048['substring'](0x4)]=_0x5c674f[_0xbb5048];delete _0x5c674f[_0xbb5048];}}}}function agiHandler(_0x49185d){logger[_0xc373('0x24')](_0xc373('0x25'),JSON[_0xc373('0x26')](_0x49185d,null,0x2));logger['info'](util['format']('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x49185d[_0xc373('0x18')],_0x49185d[_0xc373('0x19')],_0x49185d['callerid'],_0x49185d['dnid'],_0x49185d['uniqueid']));_0x49185d['on']('error',errorHandler);_0x49185d['on'](_0xc373('0x27'),closeHandler);_0x49185d['on'](_0xc373('0x28'),timeoutHandler);_0x49185d[_0xc373('0x1f')]=![];_0x49185d['on'](_0xc373('0x29'),hangupHandler);var _0x1357e7=_[_0xc373('0x2a')](projects,['name',_0x49185d[_0xc373('0x18')]]);if(!_0x1357e7)return Project[_0xc373('0x2b')](_0x49185d);if(!_0x1357e7[_0xc373('0x2c')])return Project[_0xc373('0x2d')](_0x49185d);return Project['initialize'](_0x1357e7,_0x49185d);}function main(){var _0x395e36;return utilLicense['getLicense']()['then'](function(_0x1b69a1){if(!_0x1b69a1)return;if(_0x1b69a1[_0xc373('0x2e')]){if(_0x1b69a1[_0xc373('0x2f')]&&_0x1b69a1['callysquare']>0x0){logger[_0xc373('0x12')](util['format'](_0xc373('0x30'),_0x1b69a1[_0xc373('0x2f')]));_0x395e36=_0x1b69a1[_0xc373('0x2f')];}else{logger['info'](_0xc373('0x31'));}}else{logger[_0xc373('0x12')](_0xc373('0x32'));_0x395e36=-0x1;}})[_0xc373('0x20')](function(){return Project[_0xc373('0x33')]();})[_0xc373('0x20')](function(_0x355335){projects=_0x355335;return;})[_0xc373('0x21')](function(_0xb8ff6a){logger['error'](_0xc373('0x34'),_0xb8ff6a['stack']);})[_0xc373('0x35')](function(){var _0x28bc4f=require(_0xc373('0x36'))(config[_0xc373('0x7')][_0xc373('0x11')],config['agi']['ip'],_0x395e36);_0x28bc4f['on'](_0xc373('0xb'),errorHandler);_0x28bc4f['on'](_0xc373('0x37'),listeningHandler);_0x28bc4f['on'](_0xc373('0x38'),connectionHandler);_0x28bc4f['on'](_0xc373('0x27'),closeHandler);});}main(); \ No newline at end of file +var _0xfc67=['EventEmitter','agi','127.0.0.1','projectUpdate','nextTick','error','stack','findIndex','splice','push','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','message','format','[%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','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','dnid','evtHangup','createSquareReport','catch','substring','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','find','handleNotFound','production','initialize','then','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20VOICE\x20IS\x20DISABLED','finally','connection','lodash','../../config/environment','../../config/logger','../../config/license/util','./project','./events'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xfc67,0x1c5));var _0x7fc6=function(_0x2511c6,_0x5859ca){_0x2511c6=_0x2511c6-0x0;var _0x10a803=_0xfc67[_0x2511c6];return _0x10a803;};'use strict';var _=require(_0x7fc6('0x0'));var syncho=require('syncho');var util=require('util');var config=require(_0x7fc6('0x1'));var logger=require(_0x7fc6('0x2'))('agi');var utilLicense=require(_0x7fc6('0x3'));var rpc=require('./rpc');var Project=require(_0x7fc6('0x4'));var AGIEmitter=require(_0x7fc6('0x5'))[_0x7fc6('0x6')];var projects=[];config[_0x7fc6('0x7')]=_['defaults'](config[_0x7fc6('0x7')],{'ip':_0x7fc6('0x8'),'port':0x11dd});AGIEmitter['on'](_0x7fc6('0x9'),projectUpdateHandler);function connectionHandler(_0x468fe9){process[_0x7fc6('0xa')](function(){syncho(function(){try{setChannelVariables(_0x468fe9);agiHandler(_0x468fe9);}catch(_0x9a0492){logger[_0x7fc6('0xb')](_0x9a0492[_0x7fc6('0xc')]);}});});}function projectUpdateHandler(_0x2aa0f7){try{var _0x3e80c1=_[_0x7fc6('0xd')](projects,['id',_0x2aa0f7['id']]);if(_0x3e80c1>-0x1){if(_0x2aa0f7['deleted']===!![]){projects[_0x7fc6('0xe')](_0x3e80c1,0x1);}else{projects[_0x3e80c1]=_0x2aa0f7;}}else{projects[_0x7fc6('0xf')](_0x2aa0f7);}}catch(_0x37f836){logger[_0x7fc6('0xb')](_0x37f836[_0x7fc6('0xc')]);}}function listeningHandler(){console['log'](_0x7fc6('0x10'),config[_0x7fc6('0x7')][_0x7fc6('0x11')]);logger[_0x7fc6('0x12')](util['format'](_0x7fc6('0x13'),config[_0x7fc6('0x7')]['ip'],config[_0x7fc6('0x7')]['port']));}function errorHandler(_0x47c567){if(_0x47c567&&_0x47c567['name']&&_0x47c567[_0x7fc6('0x14')]){logger['error'](util[_0x7fc6('0x15')](_0x7fc6('0x16'),_0x47c567['name'],_0x47c567['message']));}else{logger['error'](util['format'](_0x7fc6('0x17'),_0x47c567[_0x7fc6('0xc')]));}}function closeHandler(){logger['info'](util[_0x7fc6('0x15')](_0x7fc6('0x18'),this[_0x7fc6('0x19')],this[_0x7fc6('0x1a')],this[_0x7fc6('0x1b')],this['dnid'],this[_0x7fc6('0x1c')]));try{createSquareReport(this);}catch(_0x398196){logger[_0x7fc6('0xb')](_0x398196[_0x7fc6('0xc')]);}}function timeoutHandler(){logger['info'](util['format']('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x7fc6('0x19')],this['calleridname'],this[_0x7fc6('0x1b')],this['dnid'],this[_0x7fc6('0x1c')]));}function hangupHandler(){logger[_0x7fc6('0x12')](util[_0x7fc6('0x15')](_0x7fc6('0x1d'),this[_0x7fc6('0x19')],this[_0x7fc6('0x1a')],this['callerid'],this[_0x7fc6('0x1e')],this[_0x7fc6('0x1c')]));this[_0x7fc6('0x1f')]=!![];}function createSquareReport(_0x56e73f,_0x410c7f){rpc[_0x7fc6('0x20')](_0x56e73f)['then'](function(_0x2bf48a){if(_0x410c7f){_0x410c7f(null,_0x2bf48a);}})[_0x7fc6('0x21')](function(_0x753225){if(_0x410c7f){_0x410c7f(null,_0x753225);}});}function setChannelVariables(_0x14f26c){for(var _0x46cc06 in _0x14f26c){if(_0x14f26c['hasOwnProperty'](_0x46cc06)){if(_0x46cc06['indexOf']('agi_')===0x0){_0x14f26c[_0x46cc06[_0x7fc6('0x22')](0x4)]=_0x14f26c[_0x46cc06];delete _0x14f26c[_0x46cc06];}}}}function agiHandler(_0x2624c4){logger[_0x7fc6('0x23')](_0x7fc6('0x24'),JSON[_0x7fc6('0x25')](_0x2624c4,null,0x2));logger['info'](util[_0x7fc6('0x15')](_0x7fc6('0x26'),_0x2624c4[_0x7fc6('0x19')],_0x2624c4[_0x7fc6('0x1a')],_0x2624c4[_0x7fc6('0x1b')],_0x2624c4[_0x7fc6('0x1e')],_0x2624c4[_0x7fc6('0x1c')]));_0x2624c4['on'](_0x7fc6('0xb'),errorHandler);_0x2624c4['on'](_0x7fc6('0x27'),closeHandler);_0x2624c4['on'](_0x7fc6('0x28'),timeoutHandler);_0x2624c4[_0x7fc6('0x1f')]=![];_0x2624c4['on']('hangup',hangupHandler);var _0x539c7f=_[_0x7fc6('0x29')](projects,['name',_0x2624c4[_0x7fc6('0x19')]]);if(!_0x539c7f)return Project[_0x7fc6('0x2a')](_0x2624c4);if(!_0x539c7f[_0x7fc6('0x2b')])return Project['handleUnpublished'](_0x2624c4);return Project[_0x7fc6('0x2c')](_0x539c7f,_0x2624c4);}function main(){var _0x4383d2;return utilLicense['getLicense']()[_0x7fc6('0x2d')](function(_0x56429b){if(!_0x56429b)return;if(_0x56429b['voice']){if(_0x56429b[_0x7fc6('0x2e')]&&_0x56429b[_0x7fc6('0x2e')]>0x0){logger[_0x7fc6('0x12')](util[_0x7fc6('0x15')](_0x7fc6('0x2f'),_0x56429b[_0x7fc6('0x2e')]));_0x4383d2=_0x56429b[_0x7fc6('0x2e')];}else{logger[_0x7fc6('0x12')]('[LICENSE]\x20CHANNELS:\x20UNLIMITED');}}else{logger['info'](_0x7fc6('0x30'));_0x4383d2=-0x1;}})[_0x7fc6('0x2d')](function(){return Project['getAll']();})[_0x7fc6('0x2d')](function(_0x450e99){projects=_0x450e99;return;})[_0x7fc6('0x21')](function(_0x39537d){logger[_0x7fc6('0xb')]('[LICENSE]',_0x39537d['stack']);})[_0x7fc6('0x31')](function(){var _0x3bc9e3=require('./server')(config['agi']['port'],config[_0x7fc6('0x7')]['ip'],_0x4383d2);_0x3bc9e3['on']('error',errorHandler);_0x3bc9e3['on']('listening',listeningHandler);_0x3bc9e3['on'](_0x7fc6('0x32'),connectionHandler);_0x3bc9e3['on'](_0x7fc6('0x27'),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 bb3d25d..2597da5 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 _0x6322=['http','request','then','error','result','catch','sendMailMessage','SendMail','bluebird','jayson/promise','client'];(function(_0x299ee0,_0x415435){var _0x7f6ac7=function(_0x1819c2){while(--_0x1819c2){_0x299ee0['push'](_0x299ee0['shift']());}};_0x7f6ac7(++_0x415435);}(_0x6322,0x13c));var _0x2632=function(_0x2d7350,_0x37e450){_0x2d7350=_0x2d7350-0x0;var _0x4780ea=_0x6322[_0x2d7350];return _0x4780ea;};'use strict';var BPromise=require(_0x2632('0x0'));var jayson=require(_0x2632('0x1'));var client=jayson[_0x2632('0x2')][_0x2632('0x3')]({'port':0x232b});function request(_0x3efcf7,_0x5dc2b2){return new BPromise(function(_0xa00258,_0x35db38){return client[_0x2632('0x4')](_0x3efcf7,_0x5dc2b2)[_0x2632('0x5')](function(_0x585efd){if(_0x585efd[_0x2632('0x6')]){return _0x35db38(_0x585efd['error']['message']);}else{return _0xa00258(_0x585efd[_0x2632('0x7')]);}})[_0x2632('0x8')](function(_0x25d156){return _0x35db38(_0x25d156);});});}exports[_0x2632('0x9')]=function(_0x54bf1b,_0xe16517){return request(_0x2632('0xa'),{'account':_0x54bf1b,'message':_0xe16517});}; \ No newline at end of file +var _0x3937=['error','message','result','catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','then'];(function(_0x4f5c7b,_0xdc310e){var _0x317aee=function(_0x53b241){while(--_0x53b241){_0x4f5c7b['push'](_0x4f5c7b['shift']());}};_0x317aee(++_0xdc310e);}(_0x3937,0x11a));var _0x7393=function(_0x292250,_0x978c7a){_0x292250=_0x292250-0x0;var _0x49be41=_0x3937[_0x292250];return _0x49be41;};'use strict';var BPromise=require(_0x7393('0x0'));var jayson=require(_0x7393('0x1'));var client=jayson[_0x7393('0x2')][_0x7393('0x3')]({'port':0x232b});function request(_0x287bd1,_0x3bf2f0){return new BPromise(function(_0x5aa9ef,_0x3fcf70){return client[_0x7393('0x4')](_0x287bd1,_0x3bf2f0)[_0x7393('0x5')](function(_0x463067){if(_0x463067[_0x7393('0x6')]){return _0x3fcf70(_0x463067[_0x7393('0x6')][_0x7393('0x7')]);}else{return _0x5aa9ef(_0x463067[_0x7393('0x8')]);}})[_0x7393('0x9')](function(_0x586378){return _0x3fcf70(_0x586378);});});}exports[_0x7393('0xa')]=function(_0x4ce57c,_0x164781){return request(_0x7393('0xb'),{'account':_0x4ce57c,'message':_0x164781});}; \ No newline at end of file diff --git a/server/services/agi/project.js b/server/services/agi/project.js index c064946..c9720f6 100644 --- a/server/services/agi/project.js +++ b/server/services/agi/project.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc295=['toJson','root','inspect','production','debug','stringify','YYYY-MM-DD\x20HH:mm:ss','mxCell','format','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','callerid','dnid','uniqueid','traverseBFS','start','clear','agicommand','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','info','response','code','evtHangup','isUndefined','result','toString','agicommand\x20not\x20found','error','[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','calleridname','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','close','Project\x20%s\x20not\x20found','continueAt','exports','lodash','util','../../config/logger','./rpc','./mailRpc','./graph','./vertices','getSquareProjects','stack','hasOwnProperty','retry','maxRetry','addVertex','omit','isArray','length','target','source','value'];(function(_0x16c9b5,_0x521010){var _0x5f1022=function(_0x240c75){while(--_0x240c75){_0x16c9b5['push'](_0x16c9b5['shift']());}};_0x5f1022(++_0x521010);}(_0xc295,0x1c5));var _0x5c29=function(_0x49b23f,_0x1d23ad){_0x49b23f=_0x49b23f-0x0;var _0x4dfc9c=_0xc295[_0x49b23f];return _0x4dfc9c;};'use strict';var _=require(_0x5c29('0x0'));var moment=require('moment');var parser=require('xml2json');var util=require(_0x5c29('0x1'));var logger=require(_0x5c29('0x2'))('agi');var rpc=require(_0x5c29('0x3'));var mailRpc=require(_0x5c29('0x4'));var Graph=require(_0x5c29('0x5'));var Vertices=require(_0x5c29('0x6'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0x5c29('0x7')]()['catch'](function(_0x5df37f){logger['error']('Unable\x20to\x20download\x20CallySquare\x20projects',_0x5df37f[_0x5c29('0x8')]);return[];});}function addVertex(_0x55c964,_0x3799c2,_0x123360){_0x3799c2['agicommand']=_0x123360;if(_0x3799c2[_0x5c29('0x9')](_0x5c29('0xa'))){_0x3799c2[_0x5c29('0xb')]=parseInt(_0x3799c2[_0x5c29('0xa')],0xa);}_0x55c964[_0x5c29('0xc')](_[_0x5c29('0xd')](_0x3799c2,'mxCell'));}function initGraph(_0x549407,_0x38c453){var _0x106ad1=new Graph();for(var _0x282dd8 in _0x549407){if(_0x549407['hasOwnProperty'](_0x282dd8)){if(_[_0x5c29('0xe')](_0x549407[_0x282dd8])){for(var _0x1ca115=0x0;_0x1ca115<_0x549407[_0x282dd8][_0x5c29('0xf')];_0x1ca115+=0x1){addVertex(_0x106ad1,_0x549407[_0x282dd8][_0x1ca115],_0x282dd8);}}else{addVertex(_0x106ad1,_0x549407[_0x282dd8],_0x282dd8);}}}for(var _0x5696ac=0x0;_0x5696ac<_0x38c453[_0x5c29('0xf')];_0x5696ac+=0x1){if(_0x38c453[_0x5696ac]['source']&&_0x38c453[_0x5696ac][_0x5c29('0x10')]){_0x106ad1['addEdge'](_0x38c453[_0x5696ac][_0x5c29('0x11')],_0x38c453[_0x5696ac][_0x5c29('0x10')],_0x38c453[_0x5696ac][_0x5c29('0x12')]);}}return _0x106ad1;}function getRoot(_0xb7698a){return parser[_0x5c29('0x13')](_0xb7698a,{'object':!![]})['mxGraphModel'][_0x5c29('0x14')];}function inspect(_0x3ae2a4){return util[_0x5c29('0x15')](_0x3ae2a4,{'showHidden':![],'depth':null});}function initialize(_0x99aaa9,_0xb95c72){var _0x53c1cf=getRoot(_0x99aaa9[_0x5c29('0x16')]);if(!_0x53c1cf||!_0x53c1cf['start'])return;var _0x4b477b,_0x1d4d0c,_0x3e7438;logger[_0x5c29('0x17')](_0x5c29('0x14'),JSON[_0x5c29('0x18')](_0x53c1cf,null,0x2));_0xb95c72['joinAt']=moment()['format'](_0x5c29('0x19'));_0x4b477b=initGraph(_[_0x5c29('0xd')](_0x53c1cf,_0x5c29('0x1a')),_0x53c1cf[_0x5c29('0x1a')]);_0x1d4d0c=new Vertices(_0xb95c72,rpc,mailRpc);logger['info'](util[_0x5c29('0x1b')](_0x5c29('0x1c'),_0xb95c72[_0x5c29('0x1d')],_0xb95c72['calleridname'],_0xb95c72[_0x5c29('0x1e')],_0xb95c72[_0x5c29('0x1f')],_0xb95c72[_0x5c29('0x20')]));_0x4b477b[_0x5c29('0x21')](_0x53c1cf[_0x5c29('0x22')]['id'],function(_0x2d4c0b){try{_0x2d4c0b=_0x1d4d0c[_0x5c29('0x23')](_0x2d4c0b);logger[_0x5c29('0x17')]('vertex',JSON[_0x5c29('0x18')](_0x2d4c0b,null,0x2));if(_0x2d4c0b[_0x5c29('0x24')]==='gotoc'){logger['info'](_0x5c29('0x25'));_0xb95c72[_0x5c29('0x26')]=_0x2d4c0b['context']||_0xb95c72[_0x5c29('0x26')];_0xb95c72[_0x5c29('0x27')]=_0x2d4c0b[_0x5c29('0x27')];_0xb95c72[_0x5c29('0x28')]=_0x2d4c0b[_0x5c29('0x28')]?_0x2d4c0b[_0x5c29('0x28')]-0x1:0x1;return null;}else if(_0x2d4c0b&&_0x1d4d0c[_0x2d4c0b[_0x5c29('0x24')]]){_0x3e7438=_0x1d4d0c[_0x2d4c0b[_0x5c29('0x24')]](_0x2d4c0b);logger[_0x5c29('0x29')](_0x5c29('0x2a'),JSON[_0x5c29('0x18')](_0x3e7438,null,0x2));if(_0x3e7438&&_0x3e7438[_0x5c29('0x2b')]===AGI_CODE_SUCCESS&&_0x3e7438['result']!==AGI_RESULT_ERROR&&!_0xb95c72[_0x5c29('0x2c')]){logger[_0x5c29('0x17')](_0x5c29('0x2a'),inspect(_0x3e7438));return _[_0x5c29('0x2d')](_0x3e7438[_0x5c29('0x2e')])?null:_0x3e7438['result'][_0x5c29('0x2f')]();}else{logger['error'](_0x5c29('0x2a'),inspect(_0x3e7438));return null;}}else{logger['error'](_0x5c29('0x30'));return null;}}catch(_0x18f00a){logger[_0x5c29('0x31')](_0x18f00a[_0x5c29('0x8')]);return null;}});if(_0x53c1cf['finally']){logger['info'](util[_0x5c29('0x1b')](_0x5c29('0x32'),_0xb95c72[_0x5c29('0x1d')],_0xb95c72['calleridname'],_0xb95c72[_0x5c29('0x1e')],_0xb95c72[_0x5c29('0x1f')],_0xb95c72['uniqueid']));_0x4b477b[_0x5c29('0x21')](_0x53c1cf['finally']['id'],function(_0x81adf5){try{_0x81adf5=_0x1d4d0c[_0x5c29('0x23')](_0x81adf5);logger[_0x5c29('0x17')](_0x5c29('0x33'),JSON[_0x5c29('0x18')](_0x81adf5,null,0x2));if(_0x81adf5&&_0x1d4d0c[_0x81adf5[_0x5c29('0x24')]]){_0x3e7438=_0x1d4d0c[_0x81adf5[_0x5c29('0x24')]](_0x81adf5);if(_0x3e7438){logger[_0x5c29('0x17')](_0x5c29('0x2a'),inspect(_0x3e7438));return _['isUndefined'](_0x3e7438[_0x5c29('0x2e')])?null:_0x3e7438['result'][_0x5c29('0x2f')]();}else{logger[_0x5c29('0x31')]('response',inspect(_0x3e7438));return null;}}else{logger[_0x5c29('0x31')](_0x5c29('0x30'));return null;}}catch(_0xcaa1e7){logger[_0x5c29('0x31')](_0xcaa1e7[_0x5c29('0x8')]);return null;}});}logger['info'](util[_0x5c29('0x1b')](_0x5c29('0x34'),_0xb95c72['arg_1'],_0xb95c72[_0x5c29('0x35')],_0xb95c72[_0x5c29('0x1e')],_0xb95c72[_0x5c29('0x1f')],_0xb95c72[_0x5c29('0x20')]));logger[_0x5c29('0x29')](util[_0x5c29('0x1b')](_0x5c29('0x36'),_0xb95c72[_0x5c29('0x26')],_0xb95c72[_0x5c29('0x27')],parseInt(_0xb95c72[_0x5c29('0x28')],0xa)+0x1));_0xb95c72['continueAt'](_0xb95c72[_0x5c29('0x26')],_0xb95c72[_0x5c29('0x27')],parseInt(_0xb95c72[_0x5c29('0x28')],0xa)+0x1);_0xb95c72[_0x5c29('0x37')]();}function handleNotFound(_0x233069){logger[_0x5c29('0x31')](util[_0x5c29('0x1b')](_0x5c29('0x38'),_0x233069[_0x5c29('0x1d')]));_0x233069[_0x5c29('0x39')](_0x233069[_0x5c29('0x26')],_0x233069['extension'],parseInt(_0x233069[_0x5c29('0x28')],0xa)+0x1);_0x233069[_0x5c29('0x37')]();}function handleUnpublished(_0x3dc3eb){logger[_0x5c29('0x31')](util[_0x5c29('0x1b')]('Project\x20%s\x20not\x20published',_0x3dc3eb[_0x5c29('0x1d')]));_0x3dc3eb[_0x5c29('0x39')](_0x3dc3eb['context'],_0x3dc3eb['extension'],parseInt(_0x3dc3eb[_0x5c29('0x28')],0xa)+0x1);_0x3dc3eb['close']();}module[_0x5c29('0x3a')]={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file +var _0xd4a9=['calleridname','callerid','dnid','uniqueid','traverseBFS','clear','stringify','gotoc','context','extension','response','result','evtHangup','isUndefined','toString','error','finally','vertex','agicommand\x20not\x20found','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','priority','continueAt','close','lodash','util','../../config/logger','agi','./rpc','./graph','getSquareProjects','catch','Unable\x20to\x20download\x20CallySquare\x20projects','stack','agicommand','retry','maxRetry','addVertex','omit','mxCell','hasOwnProperty','isArray','length','source','target','addEdge','value','toJson','mxGraphModel','root','inspect','production','start','debug','joinAt','format','YYYY-MM-DD\x20HH:mm:ss','info'];(function(_0xfe1732,_0x3f89e9){var _0x5cb5e7=function(_0x45a1dd){while(--_0x45a1dd){_0xfe1732['push'](_0xfe1732['shift']());}};_0x5cb5e7(++_0x3f89e9);}(_0xd4a9,0x1b6));var _0x9d4a=function(_0x204806,_0x47e015){_0x204806=_0x204806-0x0;var _0x53e807=_0xd4a9[_0x204806];return _0x53e807;};'use strict';var _=require(_0x9d4a('0x0'));var moment=require('moment');var parser=require('xml2json');var util=require(_0x9d4a('0x1'));var logger=require(_0x9d4a('0x2'))(_0x9d4a('0x3'));var rpc=require(_0x9d4a('0x4'));var mailRpc=require('./mailRpc');var Graph=require(_0x9d4a('0x5'));var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0x9d4a('0x6')]()[_0x9d4a('0x7')](function(_0x10c7e4){logger['error'](_0x9d4a('0x8'),_0x10c7e4[_0x9d4a('0x9')]);return[];});}function addVertex(_0xcf4fef,_0x2232f9,_0x5a7fa9){_0x2232f9[_0x9d4a('0xa')]=_0x5a7fa9;if(_0x2232f9['hasOwnProperty'](_0x9d4a('0xb'))){_0x2232f9[_0x9d4a('0xc')]=parseInt(_0x2232f9[_0x9d4a('0xb')],0xa);}_0xcf4fef[_0x9d4a('0xd')](_[_0x9d4a('0xe')](_0x2232f9,_0x9d4a('0xf')));}function initGraph(_0x393931,_0x4c5f27){var _0x4bc83d=new Graph();for(var _0x32b28c in _0x393931){if(_0x393931[_0x9d4a('0x10')](_0x32b28c)){if(_[_0x9d4a('0x11')](_0x393931[_0x32b28c])){for(var _0x547e06=0x0;_0x547e06<_0x393931[_0x32b28c]['length'];_0x547e06+=0x1){addVertex(_0x4bc83d,_0x393931[_0x32b28c][_0x547e06],_0x32b28c);}}else{addVertex(_0x4bc83d,_0x393931[_0x32b28c],_0x32b28c);}}}for(var _0x47fb1e=0x0;_0x47fb1e<_0x4c5f27[_0x9d4a('0x12')];_0x47fb1e+=0x1){if(_0x4c5f27[_0x47fb1e][_0x9d4a('0x13')]&&_0x4c5f27[_0x47fb1e][_0x9d4a('0x14')]){_0x4bc83d[_0x9d4a('0x15')](_0x4c5f27[_0x47fb1e][_0x9d4a('0x13')],_0x4c5f27[_0x47fb1e]['target'],_0x4c5f27[_0x47fb1e][_0x9d4a('0x16')]);}}return _0x4bc83d;}function getRoot(_0x4bb728){return parser[_0x9d4a('0x17')](_0x4bb728,{'object':!![]})[_0x9d4a('0x18')][_0x9d4a('0x19')];}function inspect(_0x329051){return util[_0x9d4a('0x1a')](_0x329051,{'showHidden':![],'depth':null});}function initialize(_0x42dd0e,_0x3a13a7){var _0x34e293=getRoot(_0x42dd0e[_0x9d4a('0x1b')]);if(!_0x34e293||!_0x34e293[_0x9d4a('0x1c')])return;var _0x3076f6,_0x321c45,_0x383679;logger[_0x9d4a('0x1d')](_0x9d4a('0x19'),JSON['stringify'](_0x34e293,null,0x2));_0x3a13a7[_0x9d4a('0x1e')]=moment()[_0x9d4a('0x1f')](_0x9d4a('0x20'));_0x3076f6=initGraph(_[_0x9d4a('0xe')](_0x34e293,_0x9d4a('0xf')),_0x34e293['mxCell']);_0x321c45=new Vertices(_0x3a13a7,rpc,mailRpc);logger[_0x9d4a('0x21')](util[_0x9d4a('0x1f')]('[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x3a13a7['arg_1'],_0x3a13a7[_0x9d4a('0x22')],_0x3a13a7[_0x9d4a('0x23')],_0x3a13a7[_0x9d4a('0x24')],_0x3a13a7[_0x9d4a('0x25')]));_0x3076f6[_0x9d4a('0x26')](_0x34e293['start']['id'],function(_0x551a74){try{_0x551a74=_0x321c45[_0x9d4a('0x27')](_0x551a74);logger[_0x9d4a('0x1d')]('vertex',JSON[_0x9d4a('0x28')](_0x551a74,null,0x2));if(_0x551a74[_0x9d4a('0xa')]===_0x9d4a('0x29')){logger[_0x9d4a('0x21')]('gotoc\x20block\x20stop\x20traverse\x20BFS');_0x3a13a7[_0x9d4a('0x2a')]=_0x551a74[_0x9d4a('0x2a')]||_0x3a13a7['context'];_0x3a13a7[_0x9d4a('0x2b')]=_0x551a74['extension'];_0x3a13a7['priority']=_0x551a74['priority']?_0x551a74['priority']-0x1:0x1;return null;}else if(_0x551a74&&_0x321c45[_0x551a74['agicommand']]){_0x383679=_0x321c45[_0x551a74[_0x9d4a('0xa')]](_0x551a74);logger[_0x9d4a('0x21')](_0x9d4a('0x2c'),JSON[_0x9d4a('0x28')](_0x383679,null,0x2));if(_0x383679&&_0x383679['code']===AGI_CODE_SUCCESS&&_0x383679[_0x9d4a('0x2d')]!==AGI_RESULT_ERROR&&!_0x3a13a7[_0x9d4a('0x2e')]){logger[_0x9d4a('0x1d')](_0x9d4a('0x2c'),inspect(_0x383679));return _[_0x9d4a('0x2f')](_0x383679['result'])?null:_0x383679[_0x9d4a('0x2d')][_0x9d4a('0x30')]();}else{logger['error']('response',inspect(_0x383679));return null;}}else{logger['error']('agicommand\x20not\x20found');return null;}}catch(_0x5672ec){logger[_0x9d4a('0x31')](_0x5672ec[_0x9d4a('0x9')]);return null;}});if(_0x34e293[_0x9d4a('0x32')]){logger[_0x9d4a('0x21')](util[_0x9d4a('0x1f')]('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x3a13a7['arg_1'],_0x3a13a7[_0x9d4a('0x22')],_0x3a13a7[_0x9d4a('0x23')],_0x3a13a7[_0x9d4a('0x24')],_0x3a13a7['uniqueid']));_0x3076f6[_0x9d4a('0x26')](_0x34e293['finally']['id'],function(_0xf41596){try{_0xf41596=_0x321c45[_0x9d4a('0x27')](_0xf41596);logger[_0x9d4a('0x1d')](_0x9d4a('0x33'),JSON[_0x9d4a('0x28')](_0xf41596,null,0x2));if(_0xf41596&&_0x321c45[_0xf41596[_0x9d4a('0xa')]]){_0x383679=_0x321c45[_0xf41596[_0x9d4a('0xa')]](_0xf41596);if(_0x383679){logger[_0x9d4a('0x1d')](_0x9d4a('0x2c'),inspect(_0x383679));return _['isUndefined'](_0x383679['result'])?null:_0x383679[_0x9d4a('0x2d')][_0x9d4a('0x30')]();}else{logger['error'](_0x9d4a('0x2c'),inspect(_0x383679));return null;}}else{logger[_0x9d4a('0x31')](_0x9d4a('0x34'));return null;}}catch(_0x206949){logger[_0x9d4a('0x31')](_0x206949[_0x9d4a('0x9')]);return null;}});}logger[_0x9d4a('0x21')](util['format'](_0x9d4a('0x35'),_0x3a13a7[_0x9d4a('0x36')],_0x3a13a7['calleridname'],_0x3a13a7[_0x9d4a('0x23')],_0x3a13a7[_0x9d4a('0x24')],_0x3a13a7[_0x9d4a('0x25')]));logger[_0x9d4a('0x21')](util['format'](_0x9d4a('0x37'),_0x3a13a7[_0x9d4a('0x2a')],_0x3a13a7[_0x9d4a('0x2b')],parseInt(_0x3a13a7[_0x9d4a('0x38')],0xa)+0x1));_0x3a13a7[_0x9d4a('0x39')](_0x3a13a7['context'],_0x3a13a7[_0x9d4a('0x2b')],parseInt(_0x3a13a7[_0x9d4a('0x38')],0xa)+0x1);_0x3a13a7[_0x9d4a('0x3a')]();}function handleNotFound(_0x572c7e){logger['error'](util[_0x9d4a('0x1f')]('Project\x20%s\x20not\x20found',_0x572c7e['arg_1']));_0x572c7e[_0x9d4a('0x39')](_0x572c7e[_0x9d4a('0x2a')],_0x572c7e[_0x9d4a('0x2b')],parseInt(_0x572c7e[_0x9d4a('0x38')],0xa)+0x1);_0x572c7e[_0x9d4a('0x3a')]();}function handleUnpublished(_0x80e56d){logger['error'](util[_0x9d4a('0x1f')]('Project\x20%s\x20not\x20published',_0x80e56d[_0x9d4a('0x36')]));_0x80e56d[_0x9d4a('0x39')](_0x80e56d[_0x9d4a('0x2a')],_0x80e56d['extension'],parseInt(_0x80e56d[_0x9d4a('0x38')],0xa)+0x1);_0x80e56d[_0x9d4a('0x3a')]();}module['exports']={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index b1c2aa4..d6c42ec 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 _0xfe4e=['exports','util','Transform','call','_inBody','inherits','prototype','_transform','_localBuffer','toString','indexOf','substring','length','split','trim','slice','emit','headers'];(function(_0x233d57,_0x284678){var _0x3eec8c=function(_0x56d91b){while(--_0x56d91b){_0x233d57['push'](_0x233d57['shift']());}};_0x3eec8c(++_0x284678);}(_0xfe4e,0x133));var _0xefe4=function(_0x51e35e,_0x426aeb){_0x51e35e=_0x51e35e-0x0;var _0x32caba=_0xfe4e[_0x51e35e];return _0x32caba;};'use strict';var util=require(_0xefe4('0x0'));var Transform=require('stream')[_0xefe4('0x1')];function AGIReply(_0x8dba26){Transform[_0xefe4('0x2')](this,_0x8dba26);this['_localBuffer']='';this[_0xefe4('0x3')]=![];}util[_0xefe4('0x4')](AGIReply,Transform);AGIReply[_0xefe4('0x5')][_0xefe4('0x6')]=function(_0x32ba67,_0x5622b2,_0x197672){var _0x393857='\x0a',_0x2d4136=['\x0a\x0a','\x0d\x0a\x0d\x0a'],_0x2bab4e=-0x1,_0x244ab0=-0x1,_0x33798d='',_0x5e4d19=0x0,_0x3c1ba6='',_0x181ef8='';this[_0xefe4('0x7')]+=_0x32ba67[_0xefe4('0x8')]();_0x3c1ba6=this[_0xefe4('0x7')];if(!this[_0xefe4('0x3')]){_0x5e4d19=0x0;while(_0x2d4136[_0x5e4d19]){while((_0x244ab0=_0x3c1ba6[_0xefe4('0x9')](_0x2d4136[_0x5e4d19]))!=-0x1){_0x33798d=_0x2d4136[_0x5e4d19];_0x181ef8=_0x3c1ba6['substring'](0x0,_0x244ab0);_0x3c1ba6=_0x3c1ba6[_0xefe4('0xa')](_0x244ab0+_0x33798d[_0xefe4('0xb')]);var _0x2ccb9f=_0x181ef8[_0xefe4('0xc')](_0x393857),_0xe3773=0x0,_0x59e22e={},_0x19557e='',_0x5d89f1='',_0x47b97e=-0x1;while(_0x2ccb9f[_0xe3773]){_0x47b97e=_0x2ccb9f[_0xe3773][_0xefe4('0x9')](':');if(_0x47b97e!=-0x1){_0x19557e=_0x2ccb9f[_0xe3773]['slice'](0x0,_0x47b97e)[_0xefe4('0xd')]();_0x5d89f1=_0x2ccb9f[_0xe3773][_0xefe4('0xe')](_0x47b97e+0x1)['trim']();if(_0x19557e[_0xefe4('0xb')]>0x0){_0x59e22e[_0x19557e]=_0x5d89f1;}}else{}_0xe3773++;}this[_0xefe4('0xf')](_0xefe4('0x10'),_0x59e22e);this[_0xefe4('0x3')]=!![];}_0x5e4d19++;}this[_0xefe4('0x7')]=_0x3c1ba6;}else{while((_0x2bab4e=_0x3c1ba6[_0xefe4('0x9')](_0x393857))!=-0x1){_0x181ef8=_0x3c1ba6[_0xefe4('0xa')](0x0,_0x2bab4e);this[_0xefe4('0xf')]('line',_0x181ef8);_0x3c1ba6=_0x3c1ba6[_0xefe4('0xa')](_0x2bab4e+_0x393857[_0xefe4('0xb')]);}this[_0xefe4('0x7')]=_0x3c1ba6;}_0x197672();};module[_0xefe4('0x11')]=AGIReply; \ No newline at end of file +var _0x32ee=['indexOf','substring','length','split','slice','trim','emit','headers','line','exports','stream','Transform','call','_localBuffer','_inBody','inherits','prototype','_transform','\x0d\x0a\x0d\x0a','toString'];(function(_0x1d3a5d,_0x17fc32){var _0x257078=function(_0x482f3a){while(--_0x482f3a){_0x1d3a5d['push'](_0x1d3a5d['shift']());}};_0x257078(++_0x17fc32);}(_0x32ee,0x10e));var _0xe32e=function(_0x4503c2,_0x50c48b){_0x4503c2=_0x4503c2-0x0;var _0x3a7951=_0x32ee[_0x4503c2];return _0x3a7951;};'use strict';var util=require('util');var Transform=require(_0xe32e('0x0'))[_0xe32e('0x1')];function AGIReply(_0x5da788){Transform[_0xe32e('0x2')](this,_0x5da788);this[_0xe32e('0x3')]='';this[_0xe32e('0x4')]=![];}util[_0xe32e('0x5')](AGIReply,Transform);AGIReply[_0xe32e('0x6')][_0xe32e('0x7')]=function(_0x3efc32,_0xf9ee27,_0x2ccbd8){var _0x5fbbf7='\x0a',_0x5dc66d=['\x0a\x0a',_0xe32e('0x8')],_0x29110a=-0x1,_0x5d610d=-0x1,_0x5a63b0='',_0x29bddf=0x0,_0x456970='',_0x4c99b8='';this['_localBuffer']+=_0x3efc32[_0xe32e('0x9')]();_0x456970=this['_localBuffer'];if(!this['_inBody']){_0x29bddf=0x0;while(_0x5dc66d[_0x29bddf]){while((_0x5d610d=_0x456970[_0xe32e('0xa')](_0x5dc66d[_0x29bddf]))!=-0x1){_0x5a63b0=_0x5dc66d[_0x29bddf];_0x4c99b8=_0x456970[_0xe32e('0xb')](0x0,_0x5d610d);_0x456970=_0x456970[_0xe32e('0xb')](_0x5d610d+_0x5a63b0[_0xe32e('0xc')]);var _0x596633=_0x4c99b8[_0xe32e('0xd')](_0x5fbbf7),_0xfb181d=0x0,_0x1a6681={},_0x24f014='',_0x3f8cad='',_0x4cf21e=-0x1;while(_0x596633[_0xfb181d]){_0x4cf21e=_0x596633[_0xfb181d]['indexOf'](':');if(_0x4cf21e!=-0x1){_0x24f014=_0x596633[_0xfb181d][_0xe32e('0xe')](0x0,_0x4cf21e)['trim']();_0x3f8cad=_0x596633[_0xfb181d][_0xe32e('0xe')](_0x4cf21e+0x1)[_0xe32e('0xf')]();if(_0x24f014['length']>0x0){_0x1a6681[_0x24f014]=_0x3f8cad;}}else{}_0xfb181d++;}this[_0xe32e('0x10')](_0xe32e('0x11'),_0x1a6681);this[_0xe32e('0x4')]=!![];}_0x29bddf++;}this[_0xe32e('0x3')]=_0x456970;}else{while((_0x29110a=_0x456970[_0xe32e('0xa')](_0x5fbbf7))!=-0x1){_0x4c99b8=_0x456970[_0xe32e('0xb')](0x0,_0x29110a);this[_0xe32e('0x10')](_0xe32e('0x12'),_0x4c99b8);_0x456970=_0x456970['substring'](_0x29110a+_0x5fbbf7[_0xe32e('0xc')]);}this[_0xe32e('0x3')]=_0x456970;}_0x2ccbd8();};module[_0xe32e('0x13')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index f622bfa..21885f6 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 _0x98d5=['LoginUser','agentPause','PauseUser','agentUnpause','UnpauseUser','agentLogout','LogoutUser','lodash','client','http','request','then','error','message','getSquareProjects','name','production','getSquareProject','ShowSquareProject','ShowMailAccount','MailServerOut','Smtp','CloudProvider','email','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','ShowUser','getContactByPhone','GetContactByPhone','ShowTrunk','getSoundById','ShowSound','getIntervalById','ShowInterval','Interval','Intervals','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','ShowCmHopper','phone','ListId','CreateCmContact','ShowPause'];(function(_0x462bdc,_0x1556d2){var _0x5815e5=function(_0x32b9a3){while(--_0x32b9a3){_0x462bdc['push'](_0x462bdc['shift']());}};_0x5815e5(++_0x1556d2);}(_0x98d5,0xfb));var _0x598d=function(_0xc4b821,_0x2ee8f0){_0xc4b821=_0xc4b821-0x0;var _0x180783=_0x98d5[_0xc4b821];return _0x180783;};'use strict';var _=require(_0x598d('0x0'));var moment=require('moment');var jayson=require('jayson/promise');var client=jayson[_0x598d('0x1')][_0x598d('0x2')]({'port':0x2329});function request(_0xb5c285,_0x281a63){return new Promise(function(_0x418321,_0x3890f3){return client[_0x598d('0x3')](_0xb5c285,_0x281a63)[_0x598d('0x4')](function(_0x588b10){if(_0x588b10[_0x598d('0x5')]){return _0x3890f3(_0x588b10['error'][_0x598d('0x6')]);}else{return _0x418321(_0x588b10['result']);}})['catch'](function(_0x26d1cb){return _0x3890f3(_0x26d1cb);});});}exports[_0x598d('0x7')]=function(){return request('GetSquareProjects',{'options':{'raw':![],'attributes':['id',_0x598d('0x8'),_0x598d('0x9')]}});};exports[_0x598d('0xa')]=function(_0x38dcb4){return request(_0x598d('0xb'),{'options':{'raw':![],'where':{'name':_0x38dcb4},'attributes':[_0x598d('0x9')]}});};exports['getMailAccountById']=function(_0x5736a5){return request(_0x598d('0xc'),{'options':{'raw':![],'where':{'id':_0x5736a5},'include':[{'model':_0x598d('0xd'),'as':_0x598d('0xe'),'include':[{'model':_0x598d('0xf'),'as':_0x598d('0xf')}]}],'attributes':['id',_0x598d('0x8'),_0x598d('0x10')],'smtp':!![]}});};exports[_0x598d('0x11')]=function(_0x2a1d44){return request(_0x598d('0xb'),{'options':{'where':{'id':_0x2a1d44},'attributes':[_0x598d('0x8')]}});};exports[_0x598d('0x12')]=function(_0x507935){return request(_0x598d('0x13'),{'options':{'where':{'id':_0x507935},'attributes':['name']}});};exports[_0x598d('0x14')]=function(_0x12807d){return request(_0x598d('0x15'),{'options':{'where':{'id':_0x12807d},'attributes':[_0x598d('0x8')]}});};exports[_0x598d('0x16')]=function(_0x4b2e3a){return request(_0x598d('0x17'),{'options':{'where':{'id':_0x4b2e3a},'attributes':[_0x598d('0x18')]}});};exports['getUserById']=function(_0x210037){return request(_0x598d('0x19'),{'options':{'where':{'id':_0x210037},'attributes':['name']}});};exports[_0x598d('0x1a')]=function(_0x1223f6){return request(_0x598d('0x1b'),{'options':{'where':{'phone':_0x1223f6['phone']},'attributes':['id']}});};exports['getTrunkById']=function(_0x3d4612){return request(_0x598d('0x1c'),{'options':{'where':{'id':_0x3d4612},'attributes':[_0x598d('0x8')]}});};exports[_0x598d('0x1d')]=function(_0x26d7ee){return request(_0x598d('0x1e'),{'options':{'where':{'id':_0x26d7ee},'attributes':['save_name']}});};exports[_0x598d('0x1f')]=function(_0x41d5d8){return request(_0x598d('0x20'),{'options':{'raw':![],'where':{'id':_0x41d5d8},'include':[{'model':_0x598d('0x21'),'as':_0x598d('0x22')}]}});};exports['getSmsAccountById']=function(_0x44b762){return request(_0x598d('0x23'),{'options':{'where':{'id':_0x44b762},'attributes':['id','name']}});};exports[_0x598d('0x24')]=function(_0x2f850b){return request(_0x598d('0x25'),{'body':_0x2f850b});};exports[_0x598d('0x26')]=function(_0x323c84){return request(_0x598d('0x27'),{'body':_0x323c84});};exports[_0x598d('0x28')]=function(_0xc8b7f8){return request(_0x598d('0x29'),{'body':_[_0x598d('0x2a')](_0xc8b7f8,{'project_name':_0xc8b7f8['arg_1'],'prev_project_name':_0xc8b7f8[_0x598d('0x2b')]||'','is_subproject':_0xc8b7f8[_0x598d('0x2b')]?!![]:![],'leaveAt':moment()[_0x598d('0x2c')](_0x598d('0x2d'))})});};exports[_0x598d('0x2e')]=function(_0x2b7b15){return request(_0x598d('0x2f'),{'body':_0x2b7b15});};exports[_0x598d('0x30')]=function(_0x58b2de){return request('CreateSquareMessage',{'body':_0x58b2de});};exports['createCmContact']=function(_0x6d68d){return request(_0x598d('0x31'),{'options':{'raw':![],'where':{'phone':_0x6d68d[_0x598d('0x32')],'ListId':_0x6d68d[_0x598d('0x33')]}}})[_0x598d('0x4')](function(_0x47b0b9){if(_0x47b0b9){return _0x47b0b9;}return request(_0x598d('0x34'),{'body':_0x6d68d});});};exports['getPauseById']=function(_0x28e525){return request(_0x598d('0x35'),{'options':{'where':{'id':_0x28e525},'attributes':[_0x598d('0x8')]}});};exports['agentLogin']=function(_0x422f5a,_0x191852){return request(_0x598d('0x36'),{'body':{'interface':_0x191852},'options':{'where':_0x422f5a}});};exports[_0x598d('0x37')]=function(_0x3e86d6,_0x7114a4,_0x211f1a){return request(_0x598d('0x38'),{'body':{'type':_0x7114a4,'uniqueid':_0x211f1a},'options':{'where':_0x3e86d6}});};exports[_0x598d('0x39')]=function(_0x19eeba){return request(_0x598d('0x3a'),{'body':{},'options':{'where':_0x19eeba}});};exports[_0x598d('0x3b')]=function(_0x5a5e87){return request(_0x598d('0x3c'),{'body':{},'options':{'where':_0x5a5e87}});}; \ No newline at end of file +var _0x7579=['merge','arg_1','arg_2','format','createSquareRecording','CreateSquareRecording','createSquareMessage','createCmContact','ShowCmHopper','CreateCmContact','getPauseById','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','UnpauseUser','agentLogout','LogoutUser','lodash','moment','jayson/promise','client','http','request','then','error','message','catch','getSquareProjects','GetSquareProjects','name','getSquareProject','ShowSquareProject','production','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','CloudProvider','email','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowSquareOdbc','dsn','getUserById','ShowUser','getContactByPhone','GetContactByPhone','phone','getTrunkById','ShowTrunk','getSoundById','save_name','getIntervalById','ShowInterval','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0x7579,0x1e2));var _0x9757=function(_0x50f859,_0x54cefa){_0x50f859=_0x50f859-0x0;var _0x4710bd=_0x7579[_0x50f859];return _0x4710bd;};'use strict';var _=require(_0x9757('0x0'));var moment=require(_0x9757('0x1'));var jayson=require(_0x9757('0x2'));var client=jayson[_0x9757('0x3')][_0x9757('0x4')]({'port':0x2329});function request(_0x304b14,_0x5a7bc9){return new Promise(function(_0x399165,_0x231ca6){return client[_0x9757('0x5')](_0x304b14,_0x5a7bc9)[_0x9757('0x6')](function(_0x4c1a67){if(_0x4c1a67[_0x9757('0x7')]){return _0x231ca6(_0x4c1a67[_0x9757('0x7')][_0x9757('0x8')]);}else{return _0x399165(_0x4c1a67['result']);}})[_0x9757('0x9')](function(_0x51a1c8){return _0x231ca6(_0x51a1c8);});});}exports[_0x9757('0xa')]=function(){return request(_0x9757('0xb'),{'options':{'raw':![],'attributes':['id',_0x9757('0xc'),'production']}});};exports[_0x9757('0xd')]=function(_0x13f01a){return request(_0x9757('0xe'),{'options':{'raw':![],'where':{'name':_0x13f01a},'attributes':[_0x9757('0xf')]}});};exports[_0x9757('0x10')]=function(_0x399cca){return request(_0x9757('0x11'),{'options':{'raw':![],'where':{'id':_0x399cca},'include':[{'model':_0x9757('0x12'),'as':_0x9757('0x13'),'include':[{'model':_0x9757('0x14'),'as':_0x9757('0x14')}]}],'attributes':['id','name',_0x9757('0x15')],'smtp':!![]}});};exports[_0x9757('0x16')]=function(_0x2c2af0){return request('ShowSquareProject',{'options':{'where':{'id':_0x2c2af0},'attributes':[_0x9757('0xc')]}});};exports[_0x9757('0x17')]=function(_0x413d55){return request(_0x9757('0x18'),{'options':{'where':{'id':_0x413d55},'attributes':[_0x9757('0xc')]}});};exports[_0x9757('0x19')]=function(_0x105e56){return request('ShowVariable',{'options':{'where':{'id':_0x105e56},'attributes':[_0x9757('0xc')]}});};exports['getSquareOdbcById']=function(_0x17ab45){return request(_0x9757('0x1a'),{'options':{'where':{'id':_0x17ab45},'attributes':[_0x9757('0x1b')]}});};exports[_0x9757('0x1c')]=function(_0x3f6be9){return request(_0x9757('0x1d'),{'options':{'where':{'id':_0x3f6be9},'attributes':['name']}});};exports[_0x9757('0x1e')]=function(_0x2aa360){return request(_0x9757('0x1f'),{'options':{'where':{'phone':_0x2aa360[_0x9757('0x20')]},'attributes':['id']}});};exports[_0x9757('0x21')]=function(_0xd2306b){return request(_0x9757('0x22'),{'options':{'where':{'id':_0xd2306b},'attributes':['name']}});};exports[_0x9757('0x23')]=function(_0x4c1b66){return request('ShowSound',{'options':{'where':{'id':_0x4c1b66},'attributes':[_0x9757('0x24')]}});};exports[_0x9757('0x25')]=function(_0x1443a9){return request(_0x9757('0x26'),{'options':{'raw':![],'where':{'id':_0x1443a9},'include':[{'model':'Interval','as':'Intervals'}]}});};exports['getSmsAccountById']=function(_0x73dac4){return request(_0x9757('0x27'),{'options':{'where':{'id':_0x73dac4},'attributes':['id',_0x9757('0xc')]}});};exports[_0x9757('0x28')]=function(_0x5dc2fa){return request(_0x9757('0x29'),{'body':_0x5dc2fa});};exports[_0x9757('0x2a')]=function(_0x5d6554){return request(_0x9757('0x2b'),{'body':_0x5d6554});};exports[_0x9757('0x2c')]=function(_0x58caa8){return request(_0x9757('0x2d'),{'body':_[_0x9757('0x2e')](_0x58caa8,{'project_name':_0x58caa8[_0x9757('0x2f')],'prev_project_name':_0x58caa8[_0x9757('0x30')]||'','is_subproject':_0x58caa8[_0x9757('0x30')]?!![]:![],'leaveAt':moment()[_0x9757('0x31')]('YYYY-MM-DD\x20HH:mm:ss')})});};exports[_0x9757('0x32')]=function(_0x57c770){return request(_0x9757('0x33'),{'body':_0x57c770});};exports[_0x9757('0x34')]=function(_0x58ae5e){return request('CreateSquareMessage',{'body':_0x58ae5e});};exports[_0x9757('0x35')]=function(_0x21a4bd){return request(_0x9757('0x36'),{'options':{'raw':![],'where':{'phone':_0x21a4bd[_0x9757('0x20')],'ListId':_0x21a4bd['ListId']}}})[_0x9757('0x6')](function(_0xecf119){if(_0xecf119){return _0xecf119;}return request(_0x9757('0x37'),{'body':_0x21a4bd});});};exports[_0x9757('0x38')]=function(_0x815c25){return request(_0x9757('0x39'),{'options':{'where':{'id':_0x815c25},'attributes':['name']}});};exports[_0x9757('0x3a')]=function(_0x3aebbe,_0x36eb37){return request(_0x9757('0x3b'),{'body':{'interface':_0x36eb37},'options':{'where':_0x3aebbe}});};exports[_0x9757('0x3c')]=function(_0x328c9e,_0x115d93,_0x586e71){return request(_0x9757('0x3d'),{'body':{'type':_0x115d93,'uniqueid':_0x586e71},'options':{'where':_0x328c9e}});};exports[_0x9757('0x3e')]=function(_0x4622d0){return request(_0x9757('0x3f'),{'body':{},'options':{'where':_0x4622d0}});};exports[_0x9757('0x40')]=function(_0x1e9aca){return request(_0x9757('0x41'),{'body':{},'options':{'where':_0x1e9aca}});}; \ 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 a857d59..28cfe96 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 _0xd206=['./lex','./polly'];(function(_0x36f688,_0x136a34){var _0x5483e4=function(_0x218af7){while(--_0x218af7){_0x36f688['push'](_0x36f688['shift']());}};_0x5483e4(++_0x136a34);}(_0xd206,0x107));var _0x6d20=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0xd206[_0x2be8c2];return _0x97f531;};var polly=require(_0x6d20('0x0'));var lex=require(_0x6d20('0x1'));module['exports']={'polly':polly,'lex':lex}; \ No newline at end of file +var polly=require('./polly');var lex=require('./lex');module['exports']={'polly':polly,'lex':lex}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/index.js b/server/services/agi/scripts/aws/lex/index.js index 2dccdcb..cc29574 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 _0x2750=['./lib/api'];(function(_0x912d27,_0x28e0e3){var _0x31b918=function(_0x1882f7){while(--_0x1882f7){_0x912d27['push'](_0x912d27['shift']());}};_0x31b918(++_0x28e0e3);}(_0x2750,0x13b));var _0x0275=function(_0x55b72a,_0x143d85){_0x55b72a=_0x55b72a-0x0;var _0x52fed=_0x2750[_0x55b72a];return _0x52fed;};'use strict';var lex=require(_0x0275('0x0'));module['exports']=function(_0xf4568,_0xf2ae71,_0x372744,_0x429a37,_0x101b26,_0x41ec06){return lex(_0xf4568,_0xf2ae71,_0x372744,_0x429a37,_0x101b26,_0x41ec06);}; \ No newline at end of file +var _0x9c00=['./lib/api','exports'];(function(_0x38d8bc,_0x19cb01){var _0x2ff5b8=function(_0x5ba65f){while(--_0x5ba65f){_0x38d8bc['push'](_0x38d8bc['shift']());}};_0x2ff5b8(++_0x19cb01);}(_0x9c00,0x1a0));var _0x09c0=function(_0x7b7f5f,_0x2d472b){_0x7b7f5f=_0x7b7f5f-0x0;var _0x35e97f=_0x9c00[_0x7b7f5f];return _0x35e97f;};'use strict';var lex=require(_0x09c0('0x0'));module[_0x09c0('0x1')]=function(_0x4dff21,_0x5e32e7,_0xe0d293,_0x8c9907,_0x5d1967,_0x220c0c){return lex(_0x4dff21,_0x5e32e7,_0xe0d293,_0x8c9907,_0x5d1967,_0x220c0c);}; \ 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 8a76415..d9b8b51 100644 --- a/server/services/agi/scripts/aws/lex/lib/api.js +++ b/server/services/agi/scripts/aws/lex/lib/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['LexRuntime','bluebird','aws-sdk','slots','hasOwnProperty'];(function(_0x45a826,_0xa60611){var _0x153d43=function(_0x2e7a10){while(--_0x2e7a10){_0x45a826['push'](_0x45a826['shift']());}};_0x153d43(++_0xa60611);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'use strict';var BPromise=require(_0x0a9e('0x0'));var AWS=require(_0x0a9e('0x1'));function lexResult(_0x29929c,_0x5dd881){return new BPromise(function(_0x550fbc,_0x18d5c9){_0x29929c['postText'](_0x5dd881,function(_0x333808,_0x432180){if(_0x333808){_0x18d5c9(_0x333808);}if(_0x432180[_0x0a9e('0x2')]){for(const _0x991246 in _0x432180[_0x0a9e('0x2')]){if(_0x432180['slots'][_0x0a9e('0x3')](_0x991246)){var _0x441e3a=_0x432180[_0x0a9e('0x2')][_0x991246];_0x432180['slot_'+_0x991246]=_0x441e3a;}}}_0x550fbc(_0x432180);});});}module['exports']=function(_0xe42b77,_0x56465b,_0x52cace,_0x39753a,_0xf81284,_0x307b3e){var _0x3ab53f=new AWS[(_0x0a9e('0x4'))]({'accessKeyId':_0x56465b,'secretAccessKey':_0x52cace,'region':_0x39753a});var _0xbd1168={'botAlias':'$LATEST','botName':_0x307b3e,'inputText':_0xf81284,'userId':_0xe42b77};return lexResult(_0x3ab53f,_0xbd1168);}; \ No newline at end of file +var _0xa9e0=['LexRuntime','bluebird','aws-sdk','slots','hasOwnProperty'];(function(_0x1c9fba,_0x52db43){var _0x27687e=function(_0x368af0){while(--_0x368af0){_0x1c9fba['push'](_0x1c9fba['shift']());}};_0x27687e(++_0x52db43);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xa9e0[_0xbca1b1];return _0x4e1686;};'use strict';var BPromise=require(_0x0a9e('0x0'));var AWS=require(_0x0a9e('0x1'));function lexResult(_0x29929c,_0x5dd881){return new BPromise(function(_0x550fbc,_0x18d5c9){_0x29929c['postText'](_0x5dd881,function(_0x333808,_0x432180){if(_0x333808){_0x18d5c9(_0x333808);}if(_0x432180[_0x0a9e('0x2')]){for(const _0x991246 in _0x432180[_0x0a9e('0x2')]){if(_0x432180['slots'][_0x0a9e('0x3')](_0x991246)){var _0x441e3a=_0x432180[_0x0a9e('0x2')][_0x991246];_0x432180['slot_'+_0x991246]=_0x441e3a;}}}_0x550fbc(_0x432180);});});}module['exports']=function(_0xe42b77,_0x56465b,_0x52cace,_0x39753a,_0xf81284,_0x307b3e){var _0x3ab53f=new AWS[(_0x0a9e('0x4'))]({'accessKeyId':_0x56465b,'secretAccessKey':_0x52cace,'region':_0x39753a});var _0xbd1168={'botAlias':'$LATEST','botName':_0x307b3e,'inputText':_0xf81284,'userId':_0xe42b77};return lexResult(_0x3ab53f,_0xbd1168);}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/polly/index.js b/server/services/agi/scripts/aws/polly/index.js index 1d1c11d..05f3e38 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 _0x7615=['./lib/api','exports'];(function(_0x1609dc,_0x1107c8){var _0x4fde7a=function(_0x32c5cb){while(--_0x32c5cb){_0x1609dc['push'](_0x1609dc['shift']());}};_0x4fde7a(++_0x1107c8);}(_0x7615,0x12c));var _0x5761=function(_0x9729d7,_0x1b79a8){_0x9729d7=_0x9729d7-0x0;var _0x3c4ac6=_0x7615[_0x9729d7];return _0x3c4ac6;};'use strict';var polly=require(_0x5761('0x0'));module[_0x5761('0x1')]=function(_0x197e64,_0x2e8d1c,_0x29a19a,_0x4debee,_0x389a54,_0x40d388,_0xd7e33d){return polly(_0x197e64,_0x2e8d1c,_0x29a19a,_0x4debee,_0x389a54,_0x40d388,_0xd7e33d);}; \ No newline at end of file +var _0xf0f5=['exports'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0xf0f5,0x1cc));var _0x5f0f=function(_0xa72931,_0x37d87a){_0xa72931=_0xa72931-0x0;var _0x13b2f5=_0xf0f5[_0xa72931];return _0x13b2f5;};'use strict';var polly=require('./lib/api');module[_0x5f0f('0x0')]=function(_0xdb12a6,_0x486abc,_0x26d802,_0x2eef70,_0x1b7651,_0x56f21d,_0x2da53f){return polly(_0xdb12a6,_0x486abc,_0x26d802,_0x2eef70,_0x1b7651,_0x56f21d,_0x2da53f);}; \ 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 fb3f78a..32a51e6 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 _0xae09=['Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','mp3','bluebird','randomstring','aws-sdk','synthesizeSpeech','writeFile'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0xae09,0xb9));var _0x9ae0=function(_0x15a004,_0x371f70){_0x15a004=_0x15a004-0x0;var _0xaf8f1d=_0xae09[_0x15a004];return _0xaf8f1d;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require(_0x9ae0('0x0'));var rs=require(_0x9ae0('0x1'));var AWS=require(_0x9ae0('0x2'));function pollyResult(_0x87e082,_0x892b27,_0x51dfec){return new BPromise(function(_0x29dbde,_0x12e24a){_0x87e082[_0x9ae0('0x3')](_0x892b27,function(_0x425952,_0x56441b){if(_0x425952){_0x12e24a(_0x425952);}else if(_0x56441b){if(_0x56441b['AudioStream']instanceof Buffer){fs[_0x9ae0('0x4')](_0x51dfec,_0x56441b['AudioStream'],function(_0x16619c){if(_0x16619c){_0x12e24a(_0x16619c);}else{_0x29dbde();}});}else{_0x12e24a(new Error(_0x9ae0('0x5')));}}else{_0x12e24a(new Error(_0x9ae0('0x6')));}});});}module[_0x9ae0('0x7')]=function(_0x27ed3f,_0x29dd9f,_0x13de66,_0xb0ee5,_0x4c0447,_0x1ccced,_0x3a477c){var _0x586d7e=new AWS[(_0x9ae0('0x8'))]({'accessKeyId':_0x27ed3f,'secretAccessKey':_0x29dd9f,'region':_0x13de66});var _0x5311c5={'Text':_0x4c0447,'TextType':_0x1ccced||'text','OutputFormat':_0x9ae0('0x9'),'VoiceId':_0xb0ee5};return pollyResult(_0x586d7e,_0x5311c5,_0x3a477c);}; \ No newline at end of file +var _0x7fd1=['path','bluebird','randomstring','aws-sdk','synthesizeSpeech','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text'];(function(_0x4edc6c,_0x376629){var _0x31edc7=function(_0x28792b){while(--_0x28792b){_0x4edc6c['push'](_0x4edc6c['shift']());}};_0x31edc7(++_0x376629);}(_0x7fd1,0xfd));var _0x17fd=function(_0x1fd26d,_0x549292){_0x1fd26d=_0x1fd26d-0x0;var _0x145ffc=_0x7fd1[_0x1fd26d];return _0x145ffc;};'use strict';var fs=require('fs');var path=require(_0x17fd('0x0'));var BPromise=require(_0x17fd('0x1'));var rs=require(_0x17fd('0x2'));var AWS=require(_0x17fd('0x3'));function pollyResult(_0x467982,_0x5b87f3,_0x5842df){return new BPromise(function(_0x4c2922,_0x17b809){_0x467982[_0x17fd('0x4')](_0x5b87f3,function(_0x199a36,_0x456f72){if(_0x199a36){_0x17b809(_0x199a36);}else if(_0x456f72){if(_0x456f72[_0x17fd('0x5')]instanceof Buffer){fs['writeFile'](_0x5842df,_0x456f72[_0x17fd('0x5')],function(_0x4ca30){if(_0x4ca30){_0x17b809(_0x4ca30);}else{_0x4c2922();}});}else{_0x17b809(new Error(_0x17fd('0x6')));}}else{_0x17b809(new Error(_0x17fd('0x7')));}});});}module[_0x17fd('0x8')]=function(_0x47abae,_0x343e24,_0x25d3ae,_0x1621a9,_0x1ea737,_0x3cbfa0,_0x5805c8){var _0x542e65=new AWS[(_0x17fd('0x9'))]({'accessKeyId':_0x47abae,'secretAccessKey':_0x343e24,'region':_0x25d3ae});var _0x36fc4a={'Text':_0x1ea737,'TextType':_0x3cbfa0||_0x17fd('0xa'),'OutputFormat':'mp3','VoiceId':_0x1621a9};return pollyResult(_0x542e65,_0x36fc4a,_0x5805c8);}; \ 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 79fe399..96dd901 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 _0xa706=['./lib/api','exports'];(function(_0x34b662,_0xe7d98f){var _0x123b1c=function(_0x15ed59){while(--_0x15ed59){_0x34b662['push'](_0x34b662['shift']());}};_0x123b1c(++_0xe7d98f);}(_0xa706,0xd4));var _0x6a70=function(_0x254769,_0x4fb5dd){_0x254769=_0x254769-0x0;var _0x35f15f=_0xa706[_0x254769];return _0x35f15f;};'use strict';var asr=require(_0x6a70('0x0'));module[_0x6a70('0x1')]=function(_0x45a0e4,_0x49ef0c,_0x4e6cf2,_0x746e28){return asr(_0x45a0e4,_0x49ef0c,_0x4e6cf2);}; \ No newline at end of file +var _0x12d4=['exports','./lib/api'];(function(_0x504e8f,_0x46c3a5){var _0xf914fb=function(_0x19f937){while(--_0x19f937){_0x504e8f['push'](_0x504e8f['shift']());}};_0xf914fb(++_0x46c3a5);}(_0x12d4,0xdd));var _0x412d=function(_0x58fc2f,_0x111399){_0x58fc2f=_0x58fc2f-0x0;var _0x3a1312=_0x12d4[_0x58fc2f];return _0x3a1312;};'use strict';var asr=require(_0x412d('0x0'));module[_0x412d('0x1')]=function(_0x3efb15,_0x1a5d43,_0x1b3f2a,_0x1155db){return asr(_0x3efb15,_0x1a5d43,_0x1b3f2a);}; \ 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 139bfdc..c137b0b 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 _0x54ef=['https://speech.googleapis.com','string','length','key\x20should\x20be\x20a\x20string','lang\x20should\x20be\x20a\x20string','readFileSync','base64','POST','/v1/speech:recognize?key=','8000','url','bluebird'];(function(_0x434794,_0x1e5d1b){var _0x550224=function(_0x308af8){while(--_0x308af8){_0x434794['push'](_0x434794['shift']());}};_0x550224(++_0x1e5d1b);}(_0x54ef,0x112));var _0xf54e=function(_0x4d8d6b,_0x1d0f74){_0x4d8d6b=_0x4d8d6b-0x0;var _0x3edb72=_0x54ef[_0x4d8d6b];return _0x3edb72;};'use strict';var url=require(_0xf54e('0x0'));var BPromise=require(_0xf54e('0x1'));var fs=require('fs');var host=_0xf54e('0x2');module['exports']=function(_0xd936f7,_0x18b7d6,_0x18b1cf){return new BPromise(function(_0x42b9b2,_0x8b6bb6){var _0x431e36;if(typeof _0xd936f7!==_0xf54e('0x3')||_0xd936f7['length']===0x0){return _0x8b6bb6('filepath\x20should\x20be\x20a\x20string');}if(typeof _0x18b7d6!==_0xf54e('0x3')||_0x18b7d6[_0xf54e('0x4')]===0x0){return _0x8b6bb6(_0xf54e('0x5'));}if(typeof _0x18b1cf!=='undefined'&&(typeof _0x18b1cf!==_0xf54e('0x3')||_0x18b1cf['length']===0x0)){return _0x8b6bb6(_0xf54e('0x6'));}try{_0x431e36=fs[_0xf54e('0x7')](_0xd936f7)['toString'](_0xf54e('0x8'));}catch(_0xefa1c0){return _0x8b6bb6(_0xefa1c0);}return _0x42b9b2({'method':_0xf54e('0x9'),'uri':host+_0xf54e('0xa')+_0x18b7d6,'body':{'config':{'encoding':'LINEAR16','sampleRateHertz':_0xf54e('0xb'),'languageCode':_0x18b1cf},'audio':{'content':_0x431e36}},'json':!![]});});}; \ No newline at end of file +var _0xad8a=['string','length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','base64','POST','/v1/speech:recognize?key=','LINEAR16','8000','url','bluebird','https://speech.googleapis.com','exports'];(function(_0x1be42a,_0x531555){var _0xae4a2d=function(_0x579636){while(--_0x579636){_0x1be42a['push'](_0x1be42a['shift']());}};_0xae4a2d(++_0x531555);}(_0xad8a,0xb0));var _0xaad8=function(_0x512c27,_0x292143){_0x512c27=_0x512c27-0x0;var _0x298d01=_0xad8a[_0x512c27];return _0x298d01;};'use strict';var url=require(_0xaad8('0x0'));var BPromise=require(_0xaad8('0x1'));var fs=require('fs');var host=_0xaad8('0x2');module[_0xaad8('0x3')]=function(_0x158aa2,_0x4848a7,_0x201fbe){return new BPromise(function(_0x42b1d7,_0x398fde){var _0x58f2c5;if(typeof _0x158aa2!==_0xaad8('0x4')||_0x158aa2[_0xaad8('0x5')]===0x0){return _0x398fde(_0xaad8('0x6'));}if(typeof _0x4848a7!==_0xaad8('0x4')||_0x4848a7[_0xaad8('0x5')]===0x0){return _0x398fde(_0xaad8('0x7'));}if(typeof _0x201fbe!==_0xaad8('0x8')&&(typeof _0x201fbe!==_0xaad8('0x4')||_0x201fbe[_0xaad8('0x5')]===0x0)){return _0x398fde(_0xaad8('0x9'));}try{_0x58f2c5=fs['readFileSync'](_0x158aa2)['toString'](_0xaad8('0xa'));}catch(_0x3a5f81){return _0x398fde(_0x3a5f81);}return _0x42b1d7({'method':_0xaad8('0xb'),'uri':host+_0xaad8('0xc')+_0x4848a7,'body':{'config':{'encoding':_0xaad8('0xd'),'sampleRateHertz':_0xaad8('0xe'),'languageCode':_0x201fbe},'audio':{'content':_0x58f2c5}},'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 d598a8c..8140dec 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 _0x3c71=['./asr'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0x3c71,0x158));var _0x13c7=function(_0x129323,_0xc62f9f){_0x129323=_0x129323-0x0;var _0x162881=_0x3c71[_0x129323];return _0x162881;};var asr=require(_0x13c7('0x0'));module['exports']={'asr':asr}; \ No newline at end of file +var _0x8e2f=['./asr','exports'];(function(_0x8fd745,_0x3be743){var _0x66647=function(_0x8443c9){while(--_0x8443c9){_0x8fd745['push'](_0x8fd745['shift']());}};_0x66647(++_0x3be743);}(_0x8e2f,0x1e8));var _0xf8e2=function(_0x34cc9f,_0x4d891a){_0x34cc9f=_0x34cc9f-0x0;var _0x1991d3=_0x8e2f[_0x34cc9f];return _0x1991d3;};var asr=require(_0xf8e2('0x0'));module[_0xf8e2('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 c3d7071..d554fc1 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 _0xc6cc=['error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish\x20download\x20file','close','unlink','end','data','transcode','wav','finish\x20to\x20convert','start','resolve','tmp','generate','.wav','writeFileSync','base64','then','split','readFileSync','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice','text:synthesize','POST','.mp3','from','chmodSync','777','info','googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','f.req=','stringify','jQ1olc','null','generic','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','\x22\x20might\x20not\x20exist','goggleTTS\x20path','asr','uri','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','googleDialogflow','source','resolvedQuery','result','action','actionIncomplete','fulfillment','speech','score','status','metadata','endConversation','isFallbackIntent','googleDialogflowV2','SessionsClient','detectIntent','Dialogflow\x20V2\x20response:','queryResult','diagnosticInfo','end_conversation','boolValue','fulfillmentText','intent','displayName','isFallback','languageCode','queryText','intentDetectionConfidence','Tilde\x20ASR\x20transcription','awsPolly','polly','awsLex','ispeechTTS','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','parse','sestekNDA','nda','text','channelData','CustomAction','CustomActionData','AudioFromTts','dirName','apiai-promise','bluebird','dialogflow','https','path','querystring','request-promise','randomstring','sox','google-tts-api','url','util','./sestek','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','https:','host','WHAT_EVER','get','statusCode'];(function(_0x49677a,_0x197e86){var _0x115408=function(_0xc88918){while(--_0xc88918){_0x49677a['push'](_0x49677a['shift']());}};_0x115408(++_0x197e86);}(_0xc6cc,0x17c));var _0xcc6c=function(_0x17f0b0,_0x4b6d31){_0x17f0b0=_0x17f0b0-0x0;var _0x22b30c=_0xc6cc[_0x17f0b0];return _0x22b30c;};'use strict';var apiai=require(_0xcc6c('0x0'));var BPromise=require(_0xcc6c('0x1'));var dialogflow=require(_0xcc6c('0x2'));var fs=require('fs');var http=require('http');var https=require(_0xcc6c('0x3'));var md5=require('md5');var path=require(_0xcc6c('0x4'));var querystring=require(_0xcc6c('0x5'));var rp=require(_0xcc6c('0x6'));var rs=require(_0xcc6c('0x7'));var sox=require(_0xcc6c('0x8'));var tts=require(_0xcc6c('0x9'));var urlParse=require(_0xcc6c('0xa'))['parse'];var util=require(_0xcc6c('0xb'));var aws=require('./aws');var google=require('./google');var sestek=require(_0xcc6c('0xc'));var tilde=require('./tilde');var logger=require(_0xcc6c('0xd'))(_0xcc6c('0xe'));var ISPEECH_API=_0xcc6c('0xf');function downloadFile(_0x3d842a,_0x64c2dc){return new BPromise(function(_0x43dfd5,_0x18d8a1){var _0x49dde8=urlParse(_0x3d842a);var _0x286242=_0x49dde8[_0xcc6c('0x10')]===_0xcc6c('0x11')?https:http;var _0x2ab51f={'host':_0x49dde8[_0xcc6c('0x12')],'path':_0x49dde8[_0xcc6c('0x4')],'headers':{'user-agent':_0xcc6c('0x13')}};_0x286242[_0xcc6c('0x14')](_0x2ab51f,function(_0x1456e9){if(_0x1456e9[_0xcc6c('0x15')]!==0xc8){logger[_0xcc6c('0x16')](_0xcc6c('0x17')+_0x3d842a+_0xcc6c('0x18')+_0x1456e9[_0xcc6c('0x15')]+'\x20('+_0x1456e9[_0xcc6c('0x19')]+')');_0x18d8a1(new Error(_0xcc6c('0x17')+_0x3d842a+_0xcc6c('0x18')+_0x1456e9[_0xcc6c('0x15')]+'\x20('+_0x1456e9[_0xcc6c('0x19')]+')'));return;}var _0x5fac3=fs[_0xcc6c('0x1a')](_0x64c2dc);_0x5fac3['on']('finish',function(){logger['info'](_0xcc6c('0x1b'));_0x5fac3[_0xcc6c('0x1c')](_0x43dfd5);});_0x5fac3['on'](_0xcc6c('0x16'),function(_0x2d7ddb){fs[_0xcc6c('0x1d')](_0x64c2dc);logger[_0xcc6c('0x16')]('download\x20error',_0x2d7ddb);_0x18d8a1(_0x2d7ddb);});_0x1456e9['pipe'](_0x5fac3);})['on'](_0xcc6c('0x16'),function(_0x30d36f){logger[_0xcc6c('0x16')](_0x30d36f);_0x18d8a1(_0x30d36f);})[_0xcc6c('0x1e')]();});}function uploadFile(_0x3226ea){return new BPromise(function(_0x385987,_0x3e8beb){var _0x14248e=urlParse(_0x3226ea);var _0x51463a=_0x14248e[_0xcc6c('0x10')]==='https:'?https:http;var _0x3b98bd={'host':_0x14248e[_0xcc6c('0x12')],'path':_0x14248e[_0xcc6c('0x4')],'headers':{'user-agent':_0xcc6c('0x13')}};_0x51463a[_0xcc6c('0x14')](_0x3b98bd,function(_0x281234){if(_0x281234[_0xcc6c('0x15')]!==0xc8){_0x3e8beb(new Error('request\x20to\x20'+_0x3226ea+_0xcc6c('0x18')+_0x281234[_0xcc6c('0x15')]+'\x20('+_0x281234[_0xcc6c('0x19')]+')'));return;}var _0x269db2='';_0x281234['on'](_0xcc6c('0x1f'),function(_0x1e4d9e){_0x269db2+=_0x1e4d9e;});_0x281234['on'](_0xcc6c('0x1e'),function(){_0x385987(_0x269db2);});})['on'](_0xcc6c('0x16'),function(_0x46d41e){_0x3e8beb(_0x46d41e);})[_0xcc6c('0x1e')]();});}function convertFile(_0xde0dbd,_0x5efd83){return new BPromise(function(_0x4ff85e,_0x1598cb){var _0x18a192=sox[_0xcc6c('0x20')](_0xde0dbd,_0x5efd83,{'sampleRate':0x1f40,'format':_0xcc6c('0x21'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x18a192['on'](_0xcc6c('0x16'),function(_0x276be3){logger[_0xcc6c('0x16')]('error\x20convert',_0x276be3);_0x1598cb(_0x276be3);});_0x18a192['on'](_0xcc6c('0x1e'),function(){logger['info'](_0xcc6c('0x22'));_0x4ff85e();});_0x18a192[_0xcc6c('0x23')]();});}function base64Decode(_0x13b7c8,_0x4926ec){var _0x43b8eb=path[_0xcc6c('0x24')](__dirname,_0xcc6c('0x25'),rs[_0xcc6c('0x26')](0x4)+_0xcc6c('0x27'));fs[_0xcc6c('0x28')](_0x43b8eb,_0x13b7c8,_0xcc6c('0x29'));return convertFile(_0x43b8eb,_0x4926ec)[_0xcc6c('0x2a')](function(){try{fs['unlink'](_0x43b8eb);fs['chmodSync'](_0x4926ec,'777');}catch(_0x2f3b58){logger['error'](_0x2f3b58);}return _0x4926ec[_0xcc6c('0x2b')]('.')[0x0];});}function base64Encode(_0x3d99da){var _0x28299b=fs[_0xcc6c('0x2c')](_0x3d99da);return new Buffer(_0x28299b)[_0xcc6c('0x2d')](_0xcc6c('0x29'));}exports[_0xcc6c('0x2e')]=function(_0x3a70a4,_0x4ca139,_0x50cc1a,_0x5ea54f,_0x131ca0,_0x3478ab){var _0x55a00c,_0x3e1861;var _0x4b7ead=_0xcc6c('0x2f');var _0x4ea443=_0xcc6c('0x30')+_0x3a70a4;var _0xf3073f={};if(_0x4ca139===_0xcc6c('0x31')){_0xf3073f[_0xcc6c('0x32')]={'ssml':_0x50cc1a};}else{_0xf3073f[_0xcc6c('0x32')]={'text':_0x50cc1a};};_0xf3073f[_0xcc6c('0x33')]={'languageCode':_0x5ea54f,'ssmlGender':_0x131ca0};_0xf3073f['audioConfig']={'audioEncoding':'MP3','sampleRateHertz':0x1f40};var _0x2917dd={'url':_0x4b7ead+_0xcc6c('0x34')+_0x4ea443,'method':_0xcc6c('0x35'),'json':!![],'body':_0xf3073f};return rp(_0x2917dd)[_0xcc6c('0x2a')](function(_0x39f06b){return new BPromise(function(_0x51c439,_0x15259f){_0x55a00c=path[_0xcc6c('0x24')](__dirname,_0xcc6c('0x25'),rs[_0xcc6c('0x26')](0x4)+_0xcc6c('0x36'));var _0x27062c=Buffer[_0xcc6c('0x37')](_0x39f06b['audioContent'],_0xcc6c('0x29'));return fs['writeFile'](_0x55a00c,_0x27062c,function(_0x275bd1){_0x15259f(_0x275bd1);},function(_0x493370){fs[_0xcc6c('0x38')](_0x55a00c,'777');_0x51c439(_0x493370);});});})[_0xcc6c('0x2a')](function(_0x26a859){_0x3e1861=path[_0xcc6c('0x24')](__dirname,_0xcc6c('0x25'),rs['generate'](0x4)+'.wav');return convertFile(_0x55a00c,_0x3e1861);})[_0xcc6c('0x2a')](function(){try{fs[_0xcc6c('0x1d')](_0x55a00c);fs[_0xcc6c('0x38')](_0x3e1861,_0xcc6c('0x39'));}catch(_0x1f96bc){logger[_0xcc6c('0x16')](_0x1f96bc);}logger[_0xcc6c('0x3a')](_0xcc6c('0x3b'),_0x3e1861[_0xcc6c('0x2b')]('.')[0x0]);return _0x3e1861[_0xcc6c('0x2b')]('.')[0x0];});};exports[_0xcc6c('0x3c')]=function(_0x590559,_0x474900){var _0x4055d4=_0xcc6c('0x3d');var _0x241b62,_0x37f9fe;var _0x7acaeb;var _0x483ff8={'encoding':_0xcc6c('0x3e'),'method':'POST','timeout':0x2710,'url':_0x4055d4,'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':_0xcc6c('0x3f')+encodeURIComponent(JSON[_0xcc6c('0x40')]([[[_0xcc6c('0x41'),JSON['stringify']([_0x590559,_0x474900||'en',![],_0xcc6c('0x42')]),null,_0xcc6c('0x43')]]]))};return rp(_0x483ff8)[_0xcc6c('0x2a')](function(_0x48cb97){try{_0x7acaeb=eval(_0x48cb97['slice'](0x5))[0x0][0x2];}catch(_0x123aae){throw new Error(_0xcc6c('0x44')+_0x48cb97[_0xcc6c('0x1f')]);}if(!_0x7acaeb){if(_0x590559[_0xcc6c('0x45')]>0xc8){throw new Error(_0xcc6c('0x46'));}else{throw new Error('lang\x20\x22'+_0x474900+_0xcc6c('0x47'));}}try{_0x7acaeb=eval(_0x7acaeb)[0x0];}catch(_0x461654){throw new Error(_0xcc6c('0x44')+res[_0xcc6c('0x1f')]);}const _0x452db7=_0x7acaeb;_0x241b62=path[_0xcc6c('0x24')](__dirname,_0xcc6c('0x25'),rs['generate'](0x4)+_0xcc6c('0x36'));fs['writeFileSync'](_0x241b62,_0x7acaeb,{'encoding':_0xcc6c('0x29')});_0x37f9fe=path[_0xcc6c('0x24')](__dirname,_0xcc6c('0x25'),rs['generate'](0x4)+_0xcc6c('0x27'));return convertFile(_0x241b62,_0x37f9fe);})[_0xcc6c('0x2a')](function(){try{fs['unlink'](_0x241b62);fs['chmodSync'](_0x37f9fe,'777');}catch(_0x4777d0){logger[_0xcc6c('0x16')](_0x4777d0);}logger['info'](_0xcc6c('0x48'),_0x37f9fe[_0xcc6c('0x2b')]('.')[0x0]);return _0x37f9fe['split']('.')[0x0];});};exports['googleASR']=function(_0x3fb0b1,_0x31470c,_0x97d1bb){return google[_0xcc6c('0x49')](_0x3fb0b1,_0x31470c,_0x97d1bb)['then'](function(_0x183c78){logger[_0xcc6c('0x3a')](_0x183c78[_0xcc6c('0x4a')]);return rp(_0x183c78);})['then'](function(_0x3d9fe0){var _0xdf7f45='';var _0x38418f=0x0;try{fs['unlink'](_0x3fb0b1);}catch(_0x4ea26e){logger[_0xcc6c('0x16')](_0x4ea26e);}if(_0x3d9fe0&&_0x3d9fe0[_0xcc6c('0x4b')]){_0xdf7f45=_0x3d9fe0[_0xcc6c('0x4b')][_0xcc6c('0x4c')](function(_0x2360e5){return _0x2360e5&&_0x2360e5[_0xcc6c('0x4d')][0x0]&&_0x2360e5[_0xcc6c('0x4d')][0x0][_0xcc6c('0x4e')]?_0x2360e5['alternatives'][0x0]['transcript']:'';})[_0xcc6c('0x4f')]('\x0a');_0x38418f=_0x3d9fe0[_0xcc6c('0x4b')][_0xcc6c('0x4c')](function(_0x4655ed){return _0x4655ed&&_0x4655ed[_0xcc6c('0x4d')][0x0]&&_0x4655ed['alternatives'][0x0][_0xcc6c('0x50')]?_0x4655ed[_0xcc6c('0x4d')][0x0][_0xcc6c('0x50')]:0x0;})[_0xcc6c('0x4f')]('\x0a');}logger[_0xcc6c('0x3a')](_0xcc6c('0x51'),_0xdf7f45);logger[_0xcc6c('0x3a')](_0xcc6c('0x52'),_0x38418f);return{'transcript':_0xdf7f45,'confidence':_0x38418f};})[_0xcc6c('0x53')](function(_0x2fe725){logger['error'](_0xcc6c('0x54'),_0x2fe725[_0xcc6c('0x15')],_0x2fe725[_0xcc6c('0x55')],_0x2fe725[_0xcc6c('0x56')]);});};exports[_0xcc6c('0x57')]=function(_0x9ae79,_0x506862,_0x285779,_0x3ac5a9){var _0x595673=apiai(_0x506862,{'language':_0x3ac5a9||'en'});return _0x595673['textRequest'](_0x285779,{'sessionId':md5(_0x9ae79)})[_0xcc6c('0x2a')](function(_0x271e7e){logger[_0xcc6c('0x3a')](JSON[_0xcc6c('0x40')](_0x271e7e));return{'source':_0x271e7e['result'][_0xcc6c('0x58')],'resolvedQuery':_0x271e7e['result'][_0xcc6c('0x59')],'action':_0x271e7e[_0xcc6c('0x5a')][_0xcc6c('0x5b')],'actionIncomplete':_0x271e7e['result'][_0xcc6c('0x5c')],'speech':_0x271e7e['result'][_0xcc6c('0x5d')][_0xcc6c('0x5e')],'score':_0x271e7e[_0xcc6c('0x5a')][_0xcc6c('0x5f')],'statusCode':_0x271e7e[_0xcc6c('0x60')]['code'],'endConversation':_0x271e7e[_0xcc6c('0x5a')][_0xcc6c('0x61')][_0xcc6c('0x62')]||![],'isFallbackIntent':_0x271e7e[_0xcc6c('0x5a')][_0xcc6c('0x61')][_0xcc6c('0x63')]};});};exports[_0xcc6c('0x64')]=function(_0x15c318,_0x211581,_0x93d553,_0x39554e,_0x3c6013,_0x4e82cf){var _0x568e75=_0x39554e['replace'](/\\n/g,'\x0a');var _0x276d0e={'credentials':{'private_key':_0x568e75,'client_email':_0x93d553}};var _0x286685=new dialogflow[(_0xcc6c('0x65'))](_0x276d0e);var _0x5973b5=_0x286685['sessionPath'](_0x211581,md5(_0x15c318));var _0x17d8e3={'session':_0x5973b5,'queryInput':{'text':{'text':_0x3c6013,'languageCode':_0x4e82cf}}};return _0x286685[_0xcc6c('0x66')](_0x17d8e3)[_0xcc6c('0x2a')](function(_0x5d9df0){if(_0x5d9df0&&_0x5d9df0[_0xcc6c('0x45')]){logger[_0xcc6c('0x3a')](_0xcc6c('0x67'),JSON[_0xcc6c('0x40')](_0x5d9df0));var _0x29d29f=_0x5d9df0[0x0];if(_0x29d29f){var _0x398c04={'action':_0x29d29f[_0xcc6c('0x68')][_0xcc6c('0x5b')],'allRequiredParamsPresent':_0x29d29f[_0xcc6c('0x68')]['allRequiredParamsPresent'],'endConversation':_0x29d29f[_0xcc6c('0x68')][_0xcc6c('0x69')]&&_0x29d29f[_0xcc6c('0x68')][_0xcc6c('0x69')]['fields']?_0x29d29f[_0xcc6c('0x68')][_0xcc6c('0x69')]['fields'][_0xcc6c('0x6a')][_0xcc6c('0x6b')]:![],'fulfillmentText':_0x29d29f[_0xcc6c('0x68')][_0xcc6c('0x6c')],'intentName':_0x29d29f[_0xcc6c('0x68')]['intent'][_0xcc6c('0x55')],'intentDisplayName':_0x29d29f['queryResult'][_0xcc6c('0x6d')][_0xcc6c('0x6e')],'isFallbackIntent':_0x29d29f[_0xcc6c('0x68')][_0xcc6c('0x6d')][_0xcc6c('0x6f')],'languageCode':_0x29d29f[_0xcc6c('0x68')][_0xcc6c('0x70')],'queryText':_0x29d29f[_0xcc6c('0x68')][_0xcc6c('0x71')],'responseId':_0x29d29f['responseId'],'score':_0x29d29f[_0xcc6c('0x68')][_0xcc6c('0x72')],'speech':_0x29d29f[_0xcc6c('0x68')][_0xcc6c('0x6c')],'providerResponse':JSON[_0xcc6c('0x40')](_0x5d9df0)};return _0x398c04;}}});};exports['tildeASR']=function(_0x126770,_0x1d7064,_0x29e3c7,_0xb7d91f){return tilde[_0xcc6c('0x49')](_0x126770,_0x1d7064,_0x29e3c7,_0xb7d91f)[_0xcc6c('0x2a')](function(_0x267dda){try{fs['unlink'](_0x126770);}catch(_0x9d29d5){logger[_0xcc6c('0x16')](_0x9d29d5);}logger[_0xcc6c('0x3a')](_0xcc6c('0x73'),_0x267dda['transcript']);logger[_0xcc6c('0x3a')]('Tilde\x20ASR\x20confidence',_0x267dda[_0xcc6c('0x50')]);return _0x267dda;});};exports[_0xcc6c('0x74')]=function(_0x42eaa2,_0x3e440f,_0x3ca315,_0x2326d0,_0x15065d,_0x359842){var _0x5917d2=path[_0xcc6c('0x24')](__dirname,_0xcc6c('0x25'),rs[_0xcc6c('0x26')](0x4)+_0xcc6c('0x36'));var _0x115a05;return aws[_0xcc6c('0x75')](_0x42eaa2,_0x3e440f,_0x3ca315,_0x2326d0,_0x15065d,_0x359842,_0x5917d2)[_0xcc6c('0x2a')](function(){_0x115a05=path[_0xcc6c('0x24')](__dirname,'tmp',rs[_0xcc6c('0x26')](0x4)+_0xcc6c('0x27'));return convertFile(_0x5917d2,_0x115a05);})['then'](function(){try{fs[_0xcc6c('0x1d')](_0x5917d2);fs[_0xcc6c('0x38')](_0x115a05,_0xcc6c('0x39'));}catch(_0x3e0548){logger[_0xcc6c('0x16')](_0x3e0548);}return _0x115a05[_0xcc6c('0x2b')]('.')[0x0];});};exports[_0xcc6c('0x76')]=function(_0x58cbf3,_0x8a0172,_0x5dda15,_0x5180fe,_0x2955a1,_0x797e2c){return aws['lex'](_0x58cbf3,_0x8a0172,_0x5dda15,_0x5180fe,_0x2955a1,_0x797e2c)[_0xcc6c('0x2a')](function(_0x352d12){logger[_0xcc6c('0x3a')](JSON[_0xcc6c('0x40')](_0x352d12));return _0x352d12;});};exports[_0xcc6c('0x77')]=function(_0x4076fc,_0x119622,_0x37bc04,_0x96b57b){var _0x40d811=util[_0xcc6c('0x78')](_0xcc6c('0x79'),ISPEECH_API,_0x4076fc,encodeURIComponent(_0x119622),_0x37bc04,_0x96b57b);var _0x21e9fe=path[_0xcc6c('0x24')](__dirname,_0xcc6c('0x25'),rs[_0xcc6c('0x26')](0x4)+_0xcc6c('0x36'));var _0x5e70bf;return downloadFile(_0x40d811,_0x21e9fe)[_0xcc6c('0x2a')](function(){_0x5e70bf=path[_0xcc6c('0x24')](__dirname,_0xcc6c('0x25'),rs[_0xcc6c('0x26')](0x4)+_0xcc6c('0x27'));return convertFile(_0x21e9fe,_0x5e70bf);})['then'](function(){try{fs['unlink'](_0x21e9fe);fs[_0xcc6c('0x38')](_0x5e70bf,_0xcc6c('0x39'));}catch(_0x1489c3){logger['error'](_0x1489c3);}return _0x5e70bf[_0xcc6c('0x2b')]('.')[0x0];});};exports[_0xcc6c('0x7a')]=function(_0x212626,_0x43a3ca,_0x4dc2f1,_0x525f74){var _0x4d78b4=util[_0xcc6c('0x78')](_0xcc6c('0x7b'),ISPEECH_API,_0x43a3ca,_0x4dc2f1,base64Encode(_0x212626),_0x525f74?util[_0xcc6c('0x78')](_0xcc6c('0x7c'),encodeURIComponent(_0x525f74)):'freeform=3');return uploadFile(_0x4d78b4)[_0xcc6c('0x2a')](function(_0x473781){return querystring[_0xcc6c('0x7d')](_0x473781);});};exports[_0xcc6c('0x7e')]=function(_0x41e3c0,_0xe18f79){return sestek[_0xcc6c('0x7f')](_0x41e3c0,_0xe18f79)['then'](function(_0x49f560){logger[_0xcc6c('0x3a')](JSON[_0xcc6c('0x40')](_0x49f560));var _0x258f90={'speech':_0x49f560[_0xcc6c('0x80')],'action':_0x49f560['channelData']?_0x49f560[_0xcc6c('0x81')][_0xcc6c('0x82')]:undefined,'actiondata':_0x49f560['channelData']?_0x49f560['channelData'][_0xcc6c('0x83')]:undefined};if(_0x49f560[_0xcc6c('0x81')]&&_0x49f560[_0xcc6c('0x81')][_0xcc6c('0x84')]){return base64Decode(_0x49f560[_0xcc6c('0x81')][_0xcc6c('0x84')]['Data'],path[_0xcc6c('0x24')](__dirname,_0xcc6c('0x25'),rs[_0xcc6c('0x26')](0x4)+'.wav'))[_0xcc6c('0x2a')](function(_0x449fa9){_0x258f90['audiofile']=_0x449fa9;return _0x258f90;});}return _0x258f90;});};exports[_0xcc6c('0x85')]=function(){return __dirname;}; \ No newline at end of file +var _0x2f3e=['data','length','lang\x20\x22','\x22\x20might\x20not\x20exist','googleASR','uri','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','textRequest','source','result','resolvedQuery','fulfillment','speech','score','metadata','endConversation','isFallbackIntent','googleDialogflowV2','replace','detectIntent','queryResult','action','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','displayName','isFallback','languageCode','queryText','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','polly','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','freeform=3','sestekNDA','nda','text','channelData','CustomActionData','AudioFromTts','Data','audiofile','dirName','apiai-promise','http','https','md5','path','querystring','randomstring','sox','google-tts-api','url','parse','util','./aws','./google','./sestek','./tilde','../../../config/logger','protocol','https:','WHAT_EVER','statusCode','error','\x20failed,\x20status\x20code\x20=\x20','statusMessage','request\x20to\x20','finish','info','finish\x20download\x20file','close','unlink','download\x20error','pipe','end','host','transcode','wav','error\x20convert','start','resolve','generate','.wav','writeFileSync','base64','then','chmodSync','777','split','readFileSync','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice','audioConfig','text:synthesize','POST','.mp3','writeFile','tmp','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','jQ1olc','stringify','null','generic'];(function(_0x32d457,_0x1a39c9){var _0x338386=function(_0x199d7a){while(--_0x199d7a){_0x32d457['push'](_0x32d457['shift']());}};_0x338386(++_0x1a39c9);}(_0x2f3e,0x147));var _0xe2f3=function(_0x35d4e9,_0x298c61){_0x35d4e9=_0x35d4e9-0x0;var _0x5c2770=_0x2f3e[_0x35d4e9];return _0x5c2770;};'use strict';var apiai=require(_0xe2f3('0x0'));var BPromise=require('bluebird');var dialogflow=require('dialogflow');var fs=require('fs');var http=require(_0xe2f3('0x1'));var https=require(_0xe2f3('0x2'));var md5=require(_0xe2f3('0x3'));var path=require(_0xe2f3('0x4'));var querystring=require(_0xe2f3('0x5'));var rp=require('request-promise');var rs=require(_0xe2f3('0x6'));var sox=require(_0xe2f3('0x7'));var tts=require(_0xe2f3('0x8'));var urlParse=require(_0xe2f3('0x9'))[_0xe2f3('0xa')];var util=require(_0xe2f3('0xb'));var aws=require(_0xe2f3('0xc'));var google=require(_0xe2f3('0xd'));var sestek=require(_0xe2f3('0xe'));var tilde=require(_0xe2f3('0xf'));var logger=require(_0xe2f3('0x10'))('agi');var ISPEECH_API='https://api.ispeech.org/api/rest';function downloadFile(_0x1b01ed,_0x1a9eff){return new BPromise(function(_0x53628b,_0x27f87a){var _0x533ea3=urlParse(_0x1b01ed);var _0x2481be=_0x533ea3[_0xe2f3('0x11')]===_0xe2f3('0x12')?https:http;var _0x116db5={'host':_0x533ea3['host'],'path':_0x533ea3[_0xe2f3('0x4')],'headers':{'user-agent':_0xe2f3('0x13')}};_0x2481be['get'](_0x116db5,function(_0x6698bf){if(_0x6698bf[_0xe2f3('0x14')]!==0xc8){logger[_0xe2f3('0x15')]('request\x20to\x20'+_0x1b01ed+_0xe2f3('0x16')+_0x6698bf['statusCode']+'\x20('+_0x6698bf[_0xe2f3('0x17')]+')');_0x27f87a(new Error(_0xe2f3('0x18')+_0x1b01ed+_0xe2f3('0x16')+_0x6698bf['statusCode']+'\x20('+_0x6698bf[_0xe2f3('0x17')]+')'));return;}var _0x57af1e=fs['createWriteStream'](_0x1a9eff);_0x57af1e['on'](_0xe2f3('0x19'),function(){logger[_0xe2f3('0x1a')](_0xe2f3('0x1b'));_0x57af1e[_0xe2f3('0x1c')](_0x53628b);});_0x57af1e['on']('error',function(_0x4f0a5c){fs[_0xe2f3('0x1d')](_0x1a9eff);logger[_0xe2f3('0x15')](_0xe2f3('0x1e'),_0x4f0a5c);_0x27f87a(_0x4f0a5c);});_0x6698bf[_0xe2f3('0x1f')](_0x57af1e);})['on'](_0xe2f3('0x15'),function(_0x996e4f){logger['error'](_0x996e4f);_0x27f87a(_0x996e4f);})[_0xe2f3('0x20')]();});}function uploadFile(_0x3e47d9){return new BPromise(function(_0x585592,_0x581a7d){var _0x11c460=urlParse(_0x3e47d9);var _0x48724c=_0x11c460[_0xe2f3('0x11')]===_0xe2f3('0x12')?https:http;var _0x4cc0e9={'host':_0x11c460[_0xe2f3('0x21')],'path':_0x11c460[_0xe2f3('0x4')],'headers':{'user-agent':'WHAT_EVER'}};_0x48724c['get'](_0x4cc0e9,function(_0x6d0356){if(_0x6d0356[_0xe2f3('0x14')]!==0xc8){_0x581a7d(new Error(_0xe2f3('0x18')+_0x3e47d9+_0xe2f3('0x16')+_0x6d0356[_0xe2f3('0x14')]+'\x20('+_0x6d0356[_0xe2f3('0x17')]+')'));return;}var _0x17c78d='';_0x6d0356['on']('data',function(_0xeebff0){_0x17c78d+=_0xeebff0;});_0x6d0356['on'](_0xe2f3('0x20'),function(){_0x585592(_0x17c78d);});})['on'](_0xe2f3('0x15'),function(_0xbd5792){_0x581a7d(_0xbd5792);})[_0xe2f3('0x20')]();});}function convertFile(_0x41643c,_0x19e1e9){return new BPromise(function(_0x4a5494,_0x12a8ff){var _0x4b5c99=sox[_0xe2f3('0x22')](_0x41643c,_0x19e1e9,{'sampleRate':0x1f40,'format':_0xe2f3('0x23'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x4b5c99['on'](_0xe2f3('0x15'),function(_0x11fb3c){logger[_0xe2f3('0x15')](_0xe2f3('0x24'),_0x11fb3c);_0x12a8ff(_0x11fb3c);});_0x4b5c99['on'](_0xe2f3('0x20'),function(){logger[_0xe2f3('0x1a')]('finish\x20to\x20convert');_0x4a5494();});_0x4b5c99[_0xe2f3('0x25')]();});}function base64Decode(_0xca7000,_0x16799f){var _0x3756a7=path[_0xe2f3('0x26')](__dirname,'tmp',rs[_0xe2f3('0x27')](0x4)+_0xe2f3('0x28'));fs[_0xe2f3('0x29')](_0x3756a7,_0xca7000,_0xe2f3('0x2a'));return convertFile(_0x3756a7,_0x16799f)[_0xe2f3('0x2b')](function(){try{fs['unlink'](_0x3756a7);fs[_0xe2f3('0x2c')](_0x16799f,_0xe2f3('0x2d'));}catch(_0x44ce9c){logger[_0xe2f3('0x15')](_0x44ce9c);}return _0x16799f[_0xe2f3('0x2e')]('.')[0x0];});}function base64Encode(_0x21ea83){var _0xe6a624=fs[_0xe2f3('0x2f')](_0x21ea83);return new Buffer(_0xe6a624)[_0xe2f3('0x30')]('base64');}exports[_0xe2f3('0x31')]=function(_0x3cce8c,_0x5352f9,_0x54bc7b,_0x543959,_0x5507df,_0x47dc42){var _0x5a99eb,_0x3af10a;var _0xe6a1e5=_0xe2f3('0x32');var _0x2dd199=_0xe2f3('0x33')+_0x3cce8c;var _0x14751f={};if(_0x5352f9===_0xe2f3('0x34')){_0x14751f['input']={'ssml':_0x54bc7b};}else{_0x14751f[_0xe2f3('0x35')]={'text':_0x54bc7b};};_0x14751f[_0xe2f3('0x36')]={'languageCode':_0x543959,'ssmlGender':_0x5507df};_0x14751f[_0xe2f3('0x37')]={'audioEncoding':'MP3','sampleRateHertz':0x1f40};var _0x3bb7e2={'url':_0xe6a1e5+_0xe2f3('0x38')+_0x2dd199,'method':_0xe2f3('0x39'),'json':!![],'body':_0x14751f};return rp(_0x3bb7e2)[_0xe2f3('0x2b')](function(_0x134520){return new BPromise(function(_0x405271,_0x2da7d5){_0x5a99eb=path[_0xe2f3('0x26')](__dirname,'tmp',rs['generate'](0x4)+_0xe2f3('0x3a'));var _0x3f9290=Buffer['from'](_0x134520['audioContent'],'base64');return fs[_0xe2f3('0x3b')](_0x5a99eb,_0x3f9290,function(_0x190b8c){_0x2da7d5(_0x190b8c);},function(_0x1d01b2){fs[_0xe2f3('0x2c')](_0x5a99eb,_0xe2f3('0x2d'));_0x405271(_0x1d01b2);});});})['then'](function(_0x3427e1){_0x3af10a=path[_0xe2f3('0x26')](__dirname,_0xe2f3('0x3c'),rs[_0xe2f3('0x27')](0x4)+_0xe2f3('0x28'));return convertFile(_0x5a99eb,_0x3af10a);})[_0xe2f3('0x2b')](function(){try{fs['unlink'](_0x5a99eb);fs['chmodSync'](_0x3af10a,_0xe2f3('0x2d'));}catch(_0x17f67a){logger[_0xe2f3('0x15')](_0x17f67a);}logger[_0xe2f3('0x1a')]('googleCloudTTS\x20path',_0x3af10a['split']('.')[0x0]);return _0x3af10a[_0xe2f3('0x2e')]('.')[0x0];});};exports[_0xe2f3('0x3d')]=function(_0x24d6ae,_0x54b6cd){var _0x1ac0f4=_0xe2f3('0x3e');var _0x19c105,_0x41c421;var _0x4521ea;var _0x3781cd={'encoding':_0xe2f3('0x3f'),'method':_0xe2f3('0x39'),'timeout':0x2710,'url':_0x1ac0f4,'headers':{'Content-Type':_0xe2f3('0x40')},'body':'f.req='+encodeURIComponent(JSON['stringify']([[[_0xe2f3('0x41'),JSON[_0xe2f3('0x42')]([_0x24d6ae,_0x54b6cd||'en',![],_0xe2f3('0x43')]),null,_0xe2f3('0x44')]]]))};return rp(_0x3781cd)['then'](function(_0x126323){try{_0x4521ea=eval(_0x126323['slice'](0x5))[0x0][0x2];}catch(_0x4150eb){throw new Error('parse\x20response\x20failed:\x0a'+_0x126323[_0xe2f3('0x45')]);}if(!_0x4521ea){if(_0x24d6ae[_0xe2f3('0x46')]>0xc8){throw new Error('text\x20length\x20limit\x20reached');}else{throw new Error(_0xe2f3('0x47')+_0x54b6cd+_0xe2f3('0x48'));}}try{_0x4521ea=eval(_0x4521ea)[0x0];}catch(_0x3443ac){throw new Error('parse\x20response\x20failed:\x0a'+res[_0xe2f3('0x45')]);}const _0x39bc94=_0x4521ea;_0x19c105=path[_0xe2f3('0x26')](__dirname,_0xe2f3('0x3c'),rs['generate'](0x4)+_0xe2f3('0x3a'));fs[_0xe2f3('0x29')](_0x19c105,_0x4521ea,{'encoding':_0xe2f3('0x2a')});_0x41c421=path[_0xe2f3('0x26')](__dirname,_0xe2f3('0x3c'),rs['generate'](0x4)+_0xe2f3('0x28'));return convertFile(_0x19c105,_0x41c421);})[_0xe2f3('0x2b')](function(){try{fs[_0xe2f3('0x1d')](_0x19c105);fs[_0xe2f3('0x2c')](_0x41c421,_0xe2f3('0x2d'));}catch(_0x1bcd12){logger[_0xe2f3('0x15')](_0x1bcd12);}logger[_0xe2f3('0x1a')]('goggleTTS\x20path',_0x41c421[_0xe2f3('0x2e')]('.')[0x0]);return _0x41c421[_0xe2f3('0x2e')]('.')[0x0];});};exports[_0xe2f3('0x49')]=function(_0x5acc3c,_0x2e4a9a,_0x5b13a9){return google['asr'](_0x5acc3c,_0x2e4a9a,_0x5b13a9)[_0xe2f3('0x2b')](function(_0x569694){logger[_0xe2f3('0x1a')](_0x569694[_0xe2f3('0x4a')]);return rp(_0x569694);})[_0xe2f3('0x2b')](function(_0x5e9cb5){var _0x563ec5='';var _0x3a4722=0x0;try{fs[_0xe2f3('0x1d')](_0x5acc3c);}catch(_0x18a36a){logger[_0xe2f3('0x15')](_0x18a36a);}if(_0x5e9cb5&&_0x5e9cb5[_0xe2f3('0x4b')]){_0x563ec5=_0x5e9cb5[_0xe2f3('0x4b')][_0xe2f3('0x4c')](function(_0x1ff093){return _0x1ff093&&_0x1ff093[_0xe2f3('0x4d')][0x0]&&_0x1ff093[_0xe2f3('0x4d')][0x0]['transcript']?_0x1ff093[_0xe2f3('0x4d')][0x0][_0xe2f3('0x4e')]:'';})[_0xe2f3('0x4f')]('\x0a');_0x3a4722=_0x5e9cb5[_0xe2f3('0x4b')][_0xe2f3('0x4c')](function(_0x33faca){return _0x33faca&&_0x33faca['alternatives'][0x0]&&_0x33faca[_0xe2f3('0x4d')][0x0][_0xe2f3('0x50')]?_0x33faca[_0xe2f3('0x4d')][0x0][_0xe2f3('0x50')]:0x0;})['join']('\x0a');}logger[_0xe2f3('0x1a')](_0xe2f3('0x51'),_0x563ec5);logger[_0xe2f3('0x1a')](_0xe2f3('0x52'),_0x3a4722);return{'transcript':_0x563ec5,'confidence':_0x3a4722};})[_0xe2f3('0x53')](function(_0x512ed9){logger[_0xe2f3('0x15')](_0xe2f3('0x54'),_0x512ed9['statusCode'],_0x512ed9[_0xe2f3('0x55')],_0x512ed9[_0xe2f3('0x56')]);});};exports['googleDialogflow']=function(_0x5644f6,_0x591098,_0x10f670,_0x2a8549){var _0x31a75b=apiai(_0x591098,{'language':_0x2a8549||'en'});return _0x31a75b[_0xe2f3('0x57')](_0x10f670,{'sessionId':md5(_0x5644f6)})['then'](function(_0x3fe458){logger['info'](JSON[_0xe2f3('0x42')](_0x3fe458));return{'source':_0x3fe458['result'][_0xe2f3('0x58')],'resolvedQuery':_0x3fe458[_0xe2f3('0x59')][_0xe2f3('0x5a')],'action':_0x3fe458[_0xe2f3('0x59')]['action'],'actionIncomplete':_0x3fe458[_0xe2f3('0x59')]['actionIncomplete'],'speech':_0x3fe458[_0xe2f3('0x59')][_0xe2f3('0x5b')][_0xe2f3('0x5c')],'score':_0x3fe458[_0xe2f3('0x59')][_0xe2f3('0x5d')],'statusCode':_0x3fe458['status']['code'],'endConversation':_0x3fe458[_0xe2f3('0x59')][_0xe2f3('0x5e')][_0xe2f3('0x5f')]||![],'isFallbackIntent':_0x3fe458[_0xe2f3('0x59')][_0xe2f3('0x5e')][_0xe2f3('0x60')]};});};exports[_0xe2f3('0x61')]=function(_0x9c8860,_0x26ded4,_0x12135f,_0x2d09f8,_0x8840d3,_0x609402){var _0x44b795=_0x2d09f8[_0xe2f3('0x62')](/\\n/g,'\x0a');var _0x289480={'credentials':{'private_key':_0x44b795,'client_email':_0x12135f}};var _0xadd4b3=new dialogflow['SessionsClient'](_0x289480);var _0x6e917=_0xadd4b3['sessionPath'](_0x26ded4,md5(_0x9c8860));var _0x363562={'session':_0x6e917,'queryInput':{'text':{'text':_0x8840d3,'languageCode':_0x609402}}};return _0xadd4b3[_0xe2f3('0x63')](_0x363562)[_0xe2f3('0x2b')](function(_0x79bc55){if(_0x79bc55&&_0x79bc55[_0xe2f3('0x46')]){logger[_0xe2f3('0x1a')]('Dialogflow\x20V2\x20response:',JSON[_0xe2f3('0x42')](_0x79bc55));var _0x254016=_0x79bc55[0x0];if(_0x254016){var _0x208f50={'action':_0x254016[_0xe2f3('0x64')][_0xe2f3('0x65')],'allRequiredParamsPresent':_0x254016[_0xe2f3('0x64')]['allRequiredParamsPresent'],'endConversation':_0x254016['queryResult'][_0xe2f3('0x66')]&&_0x254016[_0xe2f3('0x64')][_0xe2f3('0x66')][_0xe2f3('0x67')]?_0x254016[_0xe2f3('0x64')][_0xe2f3('0x66')][_0xe2f3('0x67')][_0xe2f3('0x68')][_0xe2f3('0x69')]:![],'fulfillmentText':_0x254016[_0xe2f3('0x64')][_0xe2f3('0x6a')],'intentName':_0x254016[_0xe2f3('0x64')][_0xe2f3('0x6b')][_0xe2f3('0x55')],'intentDisplayName':_0x254016[_0xe2f3('0x64')][_0xe2f3('0x6b')][_0xe2f3('0x6c')],'isFallbackIntent':_0x254016[_0xe2f3('0x64')]['intent'][_0xe2f3('0x6d')],'languageCode':_0x254016[_0xe2f3('0x64')][_0xe2f3('0x6e')],'queryText':_0x254016[_0xe2f3('0x64')][_0xe2f3('0x6f')],'responseId':_0x254016['responseId'],'score':_0x254016[_0xe2f3('0x64')][_0xe2f3('0x70')],'speech':_0x254016[_0xe2f3('0x64')][_0xe2f3('0x6a')],'providerResponse':JSON[_0xe2f3('0x42')](_0x79bc55)};return _0x208f50;}}});};exports[_0xe2f3('0x71')]=function(_0xebc14b,_0x1251e4,_0x1c6ad,_0x13baa9){return tilde['asr'](_0xebc14b,_0x1251e4,_0x1c6ad,_0x13baa9)['then'](function(_0x34f693){try{fs[_0xe2f3('0x1d')](_0xebc14b);}catch(_0x162298){logger[_0xe2f3('0x15')](_0x162298);}logger['info'](_0xe2f3('0x72'),_0x34f693['transcript']);logger[_0xe2f3('0x1a')](_0xe2f3('0x73'),_0x34f693[_0xe2f3('0x50')]);return _0x34f693;});};exports[_0xe2f3('0x74')]=function(_0x1644d5,_0x537ad0,_0x295978,_0x37c94c,_0x22a99e,_0x3039a8){var _0x3b53c4=path[_0xe2f3('0x26')](__dirname,_0xe2f3('0x3c'),rs[_0xe2f3('0x27')](0x4)+_0xe2f3('0x3a'));var _0x470d69;return aws[_0xe2f3('0x75')](_0x1644d5,_0x537ad0,_0x295978,_0x37c94c,_0x22a99e,_0x3039a8,_0x3b53c4)[_0xe2f3('0x2b')](function(){_0x470d69=path[_0xe2f3('0x26')](__dirname,_0xe2f3('0x3c'),rs[_0xe2f3('0x27')](0x4)+'.wav');return convertFile(_0x3b53c4,_0x470d69);})[_0xe2f3('0x2b')](function(){try{fs[_0xe2f3('0x1d')](_0x3b53c4);fs[_0xe2f3('0x2c')](_0x470d69,_0xe2f3('0x2d'));}catch(_0x30e23c){logger[_0xe2f3('0x15')](_0x30e23c);}return _0x470d69[_0xe2f3('0x2e')]('.')[0x0];});};exports['awsLex']=function(_0x1676b2,_0x5b2584,_0x3aa611,_0x36bd13,_0x4b4e1,_0x415a95){return aws['lex'](_0x1676b2,_0x5b2584,_0x3aa611,_0x36bd13,_0x4b4e1,_0x415a95)[_0xe2f3('0x2b')](function(_0x128937){logger[_0xe2f3('0x1a')](JSON[_0xe2f3('0x42')](_0x128937));return _0x128937;});};exports[_0xe2f3('0x76')]=function(_0x1a274d,_0x13fe1e,_0x22f8fc,_0x3d973d){var _0xba6811=util[_0xe2f3('0x77')](_0xe2f3('0x78'),ISPEECH_API,_0x1a274d,encodeURIComponent(_0x13fe1e),_0x22f8fc,_0x3d973d);var _0x57d2c5=path[_0xe2f3('0x26')](__dirname,'tmp',rs[_0xe2f3('0x27')](0x4)+_0xe2f3('0x3a'));var _0x2b248d;return downloadFile(_0xba6811,_0x57d2c5)[_0xe2f3('0x2b')](function(){_0x2b248d=path[_0xe2f3('0x26')](__dirname,_0xe2f3('0x3c'),rs[_0xe2f3('0x27')](0x4)+_0xe2f3('0x28'));return convertFile(_0x57d2c5,_0x2b248d);})[_0xe2f3('0x2b')](function(){try{fs['unlink'](_0x57d2c5);fs['chmodSync'](_0x2b248d,_0xe2f3('0x2d'));}catch(_0x30f787){logger[_0xe2f3('0x15')](_0x30f787);}return _0x2b248d[_0xe2f3('0x2e')]('.')[0x0];});};exports[_0xe2f3('0x79')]=function(_0x8a85a,_0x2a19e4,_0x189af4,_0x48ae80){var _0x184eb3=util['format']('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x2a19e4,_0x189af4,base64Encode(_0x8a85a),_0x48ae80?util[_0xe2f3('0x77')]('model=%s',encodeURIComponent(_0x48ae80)):_0xe2f3('0x7a'));return uploadFile(_0x184eb3)[_0xe2f3('0x2b')](function(_0x51039e){return querystring[_0xe2f3('0xa')](_0x51039e);});};exports[_0xe2f3('0x7b')]=function(_0x298921,_0x186698){return sestek[_0xe2f3('0x7c')](_0x298921,_0x186698)[_0xe2f3('0x2b')](function(_0x2b2762){logger[_0xe2f3('0x1a')](JSON[_0xe2f3('0x42')](_0x2b2762));var _0xdd5f98={'speech':_0x2b2762[_0xe2f3('0x7d')],'action':_0x2b2762[_0xe2f3('0x7e')]?_0x2b2762[_0xe2f3('0x7e')]['CustomAction']:undefined,'actiondata':_0x2b2762[_0xe2f3('0x7e')]?_0x2b2762[_0xe2f3('0x7e')][_0xe2f3('0x7f')]:undefined};if(_0x2b2762[_0xe2f3('0x7e')]&&_0x2b2762[_0xe2f3('0x7e')][_0xe2f3('0x80')]){return base64Decode(_0x2b2762['channelData'][_0xe2f3('0x80')][_0xe2f3('0x81')],path[_0xe2f3('0x26')](__dirname,_0xe2f3('0x3c'),rs[_0xe2f3('0x27')](0x4)+_0xe2f3('0x28')))[_0xe2f3('0x2b')](function(_0x53b202){_0xdd5f98[_0xe2f3('0x82')]=_0x53b202;return _0xdd5f98;});}return _0xdd5f98;});};exports[_0xe2f3('0x83')]=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 2d3b518..a58a94e 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 _0xede9=['exports','./nda'];(function(_0x1c1039,_0x220a8d){var _0x221b78=function(_0x569c66){while(--_0x569c66){_0x1c1039['push'](_0x1c1039['shift']());}};_0x221b78(++_0x220a8d);}(_0xede9,0x169));var _0x9ede=function(_0x10e662,_0x1d61ea){_0x10e662=_0x10e662-0x0;var _0x767282=_0xede9[_0x10e662];return _0x767282;};var nda=require(_0x9ede('0x0'));module[_0x9ede('0x1')]={'nda':nda}; \ No newline at end of file +var _0xfd7d=['./nda','exports'];(function(_0x2ac7e7,_0x25a63c){var _0x3707ba=function(_0x46c114){while(--_0x46c114){_0x2ac7e7['push'](_0x2ac7e7['shift']());}};_0x3707ba(++_0x25a63c);}(_0xfd7d,0x19a));var _0xdfd7=function(_0x1261c2,_0x3ef819){_0x1261c2=_0x1261c2-0x0;var _0x3aabd2=_0xfd7d[_0x1261c2];return _0x3aabd2;};var nda=require(_0xdfd7('0x0'));module[_0xdfd7('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 80a4b16..884547c 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 _0x1bb2=['channelData','AudioOutputSettings','audio/wav','custom_action','custom_action_data','CustomActionData','info','stringify','url','../../../../../config/logger','agi','POST','resolve','ndauth_url','/token','password','username','then','/api/NaturalDialogAssistant/v1/Run','Nda','uniqueid','callerid','calleridname','dnid','extension','text','Bearer\x20','project','body','ProjectName'];(function(_0x57d753,_0x378035){var _0x4a5222=function(_0x1b19fd){while(--_0x1b19fd){_0x57d753['push'](_0x57d753['shift']());}};_0x4a5222(++_0x378035);}(_0x1bb2,0x152));var _0x21bb=function(_0x217b5b,_0x3f899b){_0x217b5b=_0x217b5b-0x0;var _0x18e16d=_0x1bb2[_0x217b5b];return _0x18e16d;};'use strict';var rp=require('request-promise');var url=require(_0x21bb('0x0'));var logger=require(_0x21bb('0x1'))(_0x21bb('0x2'));module['exports']=function(_0x4e514f,_0x170632){var _0x19c345={'method':_0x21bb('0x3'),'uri':url[_0x21bb('0x4')](_0x170632[_0x21bb('0x5')],_0x21bb('0x6')),'form':{'grant_type':_0x21bb('0x7'),'username':_0x170632[_0x21bb('0x8')],'password':_0x170632[_0x21bb('0x7')]},'json':!![]};return rp(_0x19c345)[_0x21bb('0x9')](function(_0x642998){var _0x316b77={'method':'POST','uri':url[_0x21bb('0x4')](_0x170632['ndassistant_url'],_0x21bb('0xa')),'body':{'type':_0x170632['ndaactivity_type']||'message','channelId':_0x21bb('0xb'),'conversation':{'id':_0x4e514f[_0x21bb('0xc')]},'from':{'id':_0x4e514f[_0x21bb('0xd')],'name':_0x4e514f[_0x21bb('0xe')]},'recipient':{'id':_0x4e514f[_0x21bb('0xf')],'name':_0x4e514f[_0x21bb('0x10')]},'text':_0x170632[_0x21bb('0x11')],'channelData':{}},'headers':{'Authorization':_0x21bb('0x12')+_0x642998['access_token']},'json':!![]};if(_0x170632[_0x21bb('0x13')]){_0x316b77[_0x21bb('0x14')]['channelData'][_0x21bb('0x15')]=_0x170632[_0x21bb('0x13')];}if(_0x170632['ndagenerate_audio']=='1'){_0x316b77[_0x21bb('0x14')][_0x21bb('0x16')][_0x21bb('0x17')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x21bb('0x18')};}if(_0x170632['custom_action']){_0x316b77[_0x21bb('0x14')]['channelData']['CustomAction']=_0x170632[_0x21bb('0x19')];if(_0x170632[_0x21bb('0x1a')]){_0x316b77[_0x21bb('0x14')][_0x21bb('0x16')][_0x21bb('0x1b')]=_0x170632[_0x21bb('0x1a')];}}logger[_0x21bb('0x1c')](JSON[_0x21bb('0x1d')](_0x316b77));return rp(_0x316b77);});}; \ No newline at end of file +var _0xa5fa=['ndagenerate_audio','channelData','AudioOutputSettings','audio/wav','CustomAction','custom_action','custom_action_data','CustomActionData','info','stringify','url','../../../../../config/logger','agi','exports','resolve','ndauth_url','/token','password','username','then','POST','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','uniqueid','dnid','text','Bearer\x20','access_token','project','body','ProjectName'];(function(_0x5ec655,_0x1b7d41){var _0x144c58=function(_0x4285dd){while(--_0x4285dd){_0x5ec655['push'](_0x5ec655['shift']());}};_0x144c58(++_0x1b7d41);}(_0xa5fa,0xc4));var _0xaa5f=function(_0x11167c,_0xb0ff07){_0x11167c=_0x11167c-0x0;var _0x34bdb0=_0xa5fa[_0x11167c];return _0x34bdb0;};'use strict';var rp=require('request-promise');var url=require(_0xaa5f('0x0'));var logger=require(_0xaa5f('0x1'))(_0xaa5f('0x2'));module[_0xaa5f('0x3')]=function(_0x499d69,_0x3e56f9){var _0x106128={'method':'POST','uri':url[_0xaa5f('0x4')](_0x3e56f9[_0xaa5f('0x5')],_0xaa5f('0x6')),'form':{'grant_type':_0xaa5f('0x7'),'username':_0x3e56f9[_0xaa5f('0x8')],'password':_0x3e56f9[_0xaa5f('0x7')]},'json':!![]};return rp(_0x106128)[_0xaa5f('0x9')](function(_0xc326df){var _0x74f64f={'method':_0xaa5f('0xa'),'uri':url[_0xaa5f('0x4')](_0x3e56f9['ndassistant_url'],_0xaa5f('0xb')),'body':{'type':_0x3e56f9[_0xaa5f('0xc')]||'message','channelId':'Nda','conversation':{'id':_0x499d69[_0xaa5f('0xd')]},'from':{'id':_0x499d69['callerid'],'name':_0x499d69['calleridname']},'recipient':{'id':_0x499d69[_0xaa5f('0xe')],'name':_0x499d69['extension']},'text':_0x3e56f9[_0xaa5f('0xf')],'channelData':{}},'headers':{'Authorization':_0xaa5f('0x10')+_0xc326df[_0xaa5f('0x11')]},'json':!![]};if(_0x3e56f9[_0xaa5f('0x12')]){_0x74f64f[_0xaa5f('0x13')]['channelData'][_0xaa5f('0x14')]=_0x3e56f9['project'];}if(_0x3e56f9[_0xaa5f('0x15')]=='1'){_0x74f64f[_0xaa5f('0x13')][_0xaa5f('0x16')][_0xaa5f('0x17')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xaa5f('0x18')};}if(_0x3e56f9['custom_action']){_0x74f64f['body'][_0xaa5f('0x16')][_0xaa5f('0x19')]=_0x3e56f9[_0xaa5f('0x1a')];if(_0x3e56f9[_0xaa5f('0x1b')]){_0x74f64f[_0xaa5f('0x13')][_0xaa5f('0x16')][_0xaa5f('0x1c')]=_0x3e56f9[_0xaa5f('0x1b')];}}logger[_0xaa5f('0x1d')](JSON[_0xaa5f('0x1e')](_0x74f64f));return rp(_0x74f64f);});}; \ 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 6e6936e..d7bba86 100644 --- a/server/services/agi/scripts/tilde/asr/index.js +++ b/server/services/agi/scripts/tilde/asr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -'use strict';var asr=require('./lib/api');module['exports']=function(_0x5f2a14,_0x54df9b,_0x3f5e15,_0x2228f7){return asr(_0x5f2a14,_0x54df9b,_0x3f5e15,_0x2228f7);}; \ No newline at end of file +var _0x8a24=['exports','./lib/api'];(function(_0x270e5b,_0x5095e8){var _0x6eaf1d=function(_0x189cb6){while(--_0x189cb6){_0x270e5b['push'](_0x270e5b['shift']());}};_0x6eaf1d(++_0x5095e8);}(_0x8a24,0x151));var _0x48a2=function(_0x1c1006,_0x52d7c1){_0x1c1006=_0x1c1006-0x0;var _0x1b9cb9=_0x8a24[_0x1c1006];return _0x1b9cb9;};'use strict';var asr=require(_0x48a2('0x0'));module[_0x48a2('0x1')]=function(_0x41a5df,_0x38bb29,_0x1029b3,_0x355823){return asr(_0x41a5df,_0x38bb29,_0x1029b3,_0x355823);}; \ 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 f09f42d..1906624 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 _0xe796=['Open\x20Tilde\x20ASR\x20socket','send','stringify','createReadStream','data','close','EOS','error','Tilde\x20ASR\x20send\x20error','parse','status','Tilde\x20ASR\x20hypoteses','result','hypotheses','likelihood','Success.','terminate','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.','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','bluebird','moment','crypto','../../../../../../config/logger','agi','exports','info','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','sha1','update','hex'];(function(_0x20e5b,_0x24fe92){var _0x271b93=function(_0x2954e6){while(--_0x2954e6){_0x20e5b['push'](_0x20e5b['shift']());}};_0x271b93(++_0x24fe92);}(_0xe796,0xb2));var _0x6e79=function(_0x4cf64f,_0x365988){_0x4cf64f=_0x4cf64f-0x0;var _0x5f041c=_0xe796[_0x4cf64f];return _0x5f041c;};'use strict';var BPromise=require(_0x6e79('0x0'));var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x6e79('0x1'));var crypto=require(_0x6e79('0x2'));var logger=require(_0x6e79('0x3'))(_0x6e79('0x4'));module[_0x6e79('0x5')]=function(_0x25c09b,_0x4e3e22,_0x2b5de8,_0x2c39a2){return new BPromise(function(_0x872254,_0x3d681a){logger[_0x6e79('0x6')]('Tilde\x20URI',_0x2c39a2||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0x232d8c=new WebSocket(_0x2c39a2||_0x6e79('0x7'),{'perMessageDeflate':![]});var _0x4b3331='';var _0xb108fd='0';var _0x5011d='1';var _0x1f8151=_0x6e79('0x8');function _0x217c9a(_0x57673d){var _0x3c3cd0=crypto['createHash'](_0x6e79('0x9'));_0x3c3cd0[_0x6e79('0xa')](_0x57673d);return _0x3c3cd0['digest'](_0x6e79('0xb'));}function _0x4c90cf(){try{logger[_0x6e79('0x6')](_0x6e79('0xc'));var _0xe6c122=moment()['unix']();var _0x4df868=_0x217c9a(_0xe6c122+_0x4e3e22+_0x2b5de8);_0x232d8c[_0x6e79('0xd')](JSON[_0x6e79('0xe')]({'appID':_0x4e3e22,'timestamp':_0xe6c122,'appKey':_0x4df868}));var _0xed1904=fs[_0x6e79('0xf')](_0x25c09b);_0xed1904['on'](_0x6e79('0x10'),function(_0x32c120){_0x232d8c[_0x6e79('0xd')](_0x32c120);});_0xed1904['on'](_0x6e79('0x11'),function(){_0x232d8c['send'](_0x6e79('0x12'));});}catch(_0x4fa1f8){logger[_0x6e79('0x13')](_0x6e79('0x14'),JSON['stringify'](_0x4fa1f8));_0x232d8c['terminate']();}}function _0x4af00c(_0x1cb121){try{if(_0x1cb121){var _0x175253=JSON[_0x6e79('0x15')](_0x1cb121);switch(_0x175253[_0x6e79('0x16')]){case 0x0:if(_0x175253['result']){if(_0x175253['result']['final']){logger[_0x6e79('0x6')](_0x6e79('0x17'),JSON[_0x6e79('0xe')](_0x175253[_0x6e79('0x18')][_0x6e79('0x19')]));_0x4b3331=_0x175253['result'][_0x6e79('0x19')][0x0]['transcript'];_0xb108fd=_0x175253[_0x6e79('0x18')][_0x6e79('0x19')][0x0][_0x6e79('0x1a')];_0x5011d='0';_0x1f8151=_0x6e79('0x1b');_0x232d8c[_0x6e79('0x1c')]();}}break;case 0x1:logger['info'](_0x6e79('0x8'));_0x5011d='1';_0x1f8151='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';break;case 0x2:logger[_0x6e79('0x6')](_0x6e79('0x1d'));_0x5011d='2';_0x1f8151='Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.';break;case 0x9:logger[_0x6e79('0x6')](_0x6e79('0x1e'));_0x5011d='9';_0x1f8151=_0x6e79('0x1e');break;case 0xa:logger[_0x6e79('0x6')](_0x6e79('0x1f'));_0x5011d='10';_0x1f8151=_0x6e79('0x1f');break;case 0xb:logger[_0x6e79('0x6')]('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x5011d='11';_0x1f8151=_0x6e79('0x20');}}}catch(_0x57e6db){logger[_0x6e79('0x13')]('Tilde\x20ASR\x20parse\x20error',JSON[_0x6e79('0xe')](_0x57e6db));_0x232d8c[_0x6e79('0x1c')]();}}function _0x3dbace(){logger['info'](_0x6e79('0x21'));_0x872254({'transcript':_0x4b3331,'confidence':_0xb108fd,'status':_0x5011d,'status_message':_0x1f8151});}function _0x579f77(_0x136683){logger['error'](_0x6e79('0x22'));if(!_[_0x6e79('0x23')](_0x136683)){logger[_0x6e79('0x13')](_[_0x6e79('0x24')](_0x136683)?JSON[_0x6e79('0xe')](_0x136683):_0x136683);}}_0x232d8c['on'](_0x6e79('0x25'),_0x4c90cf);_0x232d8c['on']('message',_0x4af00c);_0x232d8c['on']('close',_0x3dbace);_0x232d8c['on']('error',_0x579f77);});}; \ No newline at end of file +var _0x2a71=['digest','info','unix','send','stringify','createReadStream','data','close','EOS','error','Tilde\x20ASR\x20send\x20error','parse','status','result','final','transcript','Success.','terminate','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','bluebird','lodash','crypto','../../../../../../config/logger','agi','exports','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','update'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0x2a71,0x18d));var _0x12a7=function(_0x5012e0,_0x47a186){_0x5012e0=_0x5012e0-0x0;var _0x72706d=_0x2a71[_0x5012e0];return _0x72706d;};'use strict';var BPromise=require(_0x12a7('0x0'));var _=require(_0x12a7('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require('moment');var crypto=require(_0x12a7('0x2'));var logger=require(_0x12a7('0x3'))(_0x12a7('0x4'));module[_0x12a7('0x5')]=function(_0x410120,_0x3503ff,_0x468d70,_0x14c6a9){return new BPromise(function(_0x2cf050,_0x51c3eb){logger['info']('Tilde\x20URI',_0x14c6a9||_0x12a7('0x6'));var _0x370f37=new WebSocket(_0x14c6a9||_0x12a7('0x6'),{'perMessageDeflate':![]});var _0x26e36e='';var _0xb35666='0';var _0x4eabe9='1';var _0x4126db=_0x12a7('0x7');function _0x5bd052(_0x5375e2){var _0x4f8c6a=crypto[_0x12a7('0x8')]('sha1');_0x4f8c6a[_0x12a7('0x9')](_0x5375e2);return _0x4f8c6a[_0x12a7('0xa')]('hex');}function _0x9fef46(){try{logger[_0x12a7('0xb')]('Open\x20Tilde\x20ASR\x20socket');var _0x572951=moment()[_0x12a7('0xc')]();var _0x2f9dab=_0x5bd052(_0x572951+_0x3503ff+_0x468d70);_0x370f37[_0x12a7('0xd')](JSON[_0x12a7('0xe')]({'appID':_0x3503ff,'timestamp':_0x572951,'appKey':_0x2f9dab}));var _0x4cdd0d=fs[_0x12a7('0xf')](_0x410120);_0x4cdd0d['on'](_0x12a7('0x10'),function(_0x4ddd1e){_0x370f37[_0x12a7('0xd')](_0x4ddd1e);});_0x4cdd0d['on'](_0x12a7('0x11'),function(){_0x370f37[_0x12a7('0xd')](_0x12a7('0x12'));});}catch(_0x5c6d65){logger[_0x12a7('0x13')](_0x12a7('0x14'),JSON['stringify'](_0x5c6d65));_0x370f37['terminate']();}}function _0x15a9e5(_0x5cb6e5){try{if(_0x5cb6e5){var _0x565c96=JSON[_0x12a7('0x15')](_0x5cb6e5);switch(_0x565c96[_0x12a7('0x16')]){case 0x0:if(_0x565c96['result']){if(_0x565c96[_0x12a7('0x17')][_0x12a7('0x18')]){logger[_0x12a7('0xb')]('Tilde\x20ASR\x20hypoteses',JSON[_0x12a7('0xe')](_0x565c96[_0x12a7('0x17')]['hypotheses']));_0x26e36e=_0x565c96[_0x12a7('0x17')]['hypotheses'][0x0][_0x12a7('0x19')];_0xb35666=_0x565c96[_0x12a7('0x17')]['hypotheses'][0x0]['likelihood'];_0x4eabe9='0';_0x4126db=_0x12a7('0x1a');_0x370f37[_0x12a7('0x1b')]();}}break;case 0x1:logger['info'](_0x12a7('0x7'));_0x4eabe9='1';_0x4126db=_0x12a7('0x7');break;case 0x2:logger['info']('Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.');_0x4eabe9='2';_0x4126db='Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.';break;case 0x9:logger[_0x12a7('0xb')]('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0x4eabe9='9';_0x4126db=_0x12a7('0x1c');break;case 0xa:logger['info'](_0x12a7('0x1d'));_0x4eabe9='10';_0x4126db='Authentication\x20failed.';break;case 0xb:logger[_0x12a7('0xb')](_0x12a7('0x1e'));_0x4eabe9='11';_0x4126db=_0x12a7('0x1e');}}}catch(_0x3f5c96){logger[_0x12a7('0x13')](_0x12a7('0x1f'),JSON['stringify'](_0x3f5c96));_0x370f37['terminate']();}}function _0x5d1929(){logger[_0x12a7('0xb')](_0x12a7('0x20'));_0x2cf050({'transcript':_0x26e36e,'confidence':_0xb35666,'status':_0x4eabe9,'status_message':_0x4126db});}function _0x3b6a3a(_0x2917b9){logger['error'](_0x12a7('0x21'));if(!_[_0x12a7('0x22')](_0x2917b9)){logger['error'](_[_0x12a7('0x23')](_0x2917b9)?JSON[_0x12a7('0xe')](_0x2917b9):_0x2917b9);}}_0x370f37['on'](_0x12a7('0x24'),_0x9fef46);_0x370f37['on']('message',_0x15a9e5);_0x370f37['on'](_0x12a7('0x11'),_0x5d1929);_0x370f37['on'](_0x12a7('0x13'),_0x3b6a3a);});}; \ 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 f0a17c1..f09aa1c 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 _0xda3f=['exports','./asr'];(function(_0x2d0bfd,_0x2ba336){var _0x4d806c=function(_0x47938d){while(--_0x47938d){_0x2d0bfd['push'](_0x2d0bfd['shift']());}};_0x4d806c(++_0x2ba336);}(_0xda3f,0x10b));var _0xfda3=function(_0x4335ca,_0x23b0c0){_0x4335ca=_0x4335ca-0x0;var _0x450884=_0xda3f[_0x4335ca];return _0x450884;};var asr=require(_0xfda3('0x0'));module[_0xfda3('0x1')]={'asr':asr}; \ No newline at end of file +var _0x4b09=['./asr'];(function(_0x28acd0,_0x2d97e7){var _0x320376=function(_0x5d3656){while(--_0x5d3656){_0x28acd0['push'](_0x28acd0['shift']());}};_0x320376(++_0x2d97e7);}(_0x4b09,0x1d4));var _0x94b0=function(_0x4fdcc0,_0x560a01){_0x4fdcc0=_0x4fdcc0-0x0;var _0xc0ce94=_0x4b09[_0x4fdcc0];return _0xc0ce94;};var asr=require(_0x94b0('0x0'));module['exports']={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 8c6219f..08bd206 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 _0x9c44=['./error','./channel','127.0.0.1','call','emit','error','createServer','listen','listening','getConnections','destroy','E_AGI_SERVER_MAXCONNECTION','ready','connection','E_AGI_SERVER_ERROR','code','close','E_AGI_SERVER_CLOSE','nextTick','events','EventEmitter'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9c44,0x178));var _0x49c4=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0x9c44[_0x18ab2a];return _0x16dcee;};'use strict';var util=require('util');var net=require('net');var EventEmitter=require(_0x49c4('0x0'))[_0x49c4('0x1')];var AGIError=require(_0x49c4('0x2'));var AGIChannel=require(_0x49c4('0x3'));var AGIServer=function(_0x455700,_0x2ad237,_0x4e0313){var _0x4941f1=this;var _0x41a183=null;var _0x57effd=0x0;if(!_0x455700)_0x455700=0x11dd;if(!_0x2ad237)_0x2ad237=_0x49c4('0x4');EventEmitter[_0x49c4('0x5')](_0x4941f1);function _0x69bc41(){if(!_0x455700){_0x4941f1[_0x49c4('0x6')](_0x49c4('0x7'),new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x41a183=net[_0x49c4('0x8')]();_0x41a183[_0x49c4('0x9')](_0x455700,_0x2ad237);_0x41a183['on'](_0x49c4('0xa'),function(){_0x4941f1[_0x49c4('0x6')]('listening');});_0x41a183['on']('connection',function(_0x451ea6){_0x41a183[_0x49c4('0xb')](function(_0x58cad7,_0xb611a1){if(_0x58cad7){_0x4941f1[_0x49c4('0x6')]('error',new AGIError('E_AGI_SERVER_ERROR',_0x58cad7));}else if(_0x4e0313&&_0x4e0313<0x0){_0x4941f1[_0x49c4('0x6')](_0x49c4('0x7'),new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x451ea6[_0x49c4('0xc')]();}else if(_0x4e0313&&_0x4e0313>0x0&&_0x4e0313<_0xb611a1){_0x57effd+=0x1;_0x4941f1[_0x49c4('0x6')]('error',new AGIError(_0x49c4('0xd'),_0x57effd));_0x451ea6[_0x49c4('0xc')]();}else{var _0x21f15a=new AGIChannel(_0x451ea6);_0x21f15a['on'](_0x49c4('0xe'),function(){_0x4941f1[_0x49c4('0x6')](_0x49c4('0xf'),_0x21f15a);});}});});_0x41a183['on'](_0x49c4('0x7'),function(_0x3de397){_0x4941f1['emit'](_0x49c4('0x7'),new AGIError(_0x49c4('0x10'),_0x3de397[_0x49c4('0x11')]));});_0x41a183['on'](_0x49c4('0x12'),function(){_0x4941f1[_0x49c4('0x6')]('close',new AGIError(_0x49c4('0x13')));});}process[_0x49c4('0x14')](function(){_0x69bc41();});};util['inherits'](AGIServer,EventEmitter);module['exports']=function(_0x3c782d,_0x2f82d5,_0x3addb2){return new AGIServer(_0x3c782d,_0x2f82d5,_0x3addb2);}; \ No newline at end of file +var _0x9c44=['./error','./channel','127.0.0.1','call','emit','error','createServer','listen','listening','getConnections','destroy','E_AGI_SERVER_MAXCONNECTION','ready','connection','E_AGI_SERVER_ERROR','code','close','E_AGI_SERVER_CLOSE','nextTick','events','EventEmitter'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9c44,0x178));var _0x49c4=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0x9c44[_0x3511d3];return _0x5d6321;};'use strict';var util=require('util');var net=require('net');var EventEmitter=require(_0x49c4('0x0'))[_0x49c4('0x1')];var AGIError=require(_0x49c4('0x2'));var AGIChannel=require(_0x49c4('0x3'));var AGIServer=function(_0x455700,_0x2ad237,_0x4e0313){var _0x4941f1=this;var _0x41a183=null;var _0x57effd=0x0;if(!_0x455700)_0x455700=0x11dd;if(!_0x2ad237)_0x2ad237=_0x49c4('0x4');EventEmitter[_0x49c4('0x5')](_0x4941f1);function _0x69bc41(){if(!_0x455700){_0x4941f1[_0x49c4('0x6')](_0x49c4('0x7'),new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x41a183=net[_0x49c4('0x8')]();_0x41a183[_0x49c4('0x9')](_0x455700,_0x2ad237);_0x41a183['on'](_0x49c4('0xa'),function(){_0x4941f1[_0x49c4('0x6')]('listening');});_0x41a183['on']('connection',function(_0x451ea6){_0x41a183[_0x49c4('0xb')](function(_0x58cad7,_0xb611a1){if(_0x58cad7){_0x4941f1[_0x49c4('0x6')]('error',new AGIError('E_AGI_SERVER_ERROR',_0x58cad7));}else if(_0x4e0313&&_0x4e0313<0x0){_0x4941f1[_0x49c4('0x6')](_0x49c4('0x7'),new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x451ea6[_0x49c4('0xc')]();}else if(_0x4e0313&&_0x4e0313>0x0&&_0x4e0313<_0xb611a1){_0x57effd+=0x1;_0x4941f1[_0x49c4('0x6')]('error',new AGIError(_0x49c4('0xd'),_0x57effd));_0x451ea6[_0x49c4('0xc')]();}else{var _0x21f15a=new AGIChannel(_0x451ea6);_0x21f15a['on'](_0x49c4('0xe'),function(){_0x4941f1[_0x49c4('0x6')](_0x49c4('0xf'),_0x21f15a);});}});});_0x41a183['on'](_0x49c4('0x7'),function(_0x3de397){_0x4941f1['emit'](_0x49c4('0x7'),new AGIError(_0x49c4('0x10'),_0x3de397[_0x49c4('0x11')]));});_0x41a183['on'](_0x49c4('0x12'),function(){_0x4941f1[_0x49c4('0x6')]('close',new AGIError(_0x49c4('0x13')));});}process[_0x49c4('0x14')](function(){_0x69bc41();});};util['inherits'](AGIServer,EventEmitter);module['exports']=function(_0x3c782d,_0x2f82d5,_0x3addb2){return new AGIServer(_0x3c782d,_0x2f82d5,_0x3addb2);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index dc82b5f..d98307d 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 _0x106f=['google_tts_language','url','timeout','number','includes','PUT','toUpperCase','body','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','uri','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','500\x20-\x20Internal\x20Server\x20Error','options','key','dialogflow_language','dialogflowV2_project_id','private_key','sestekNDA','ispeechTTS','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appsecret','clear','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','isPlainObject','recursiveNodeIndex','isArray','length','saveRestApiResult','%s.%s','split','replaceAll','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','extra','setVariable','maxRetry','sync','retry','mrcpsynth','noop','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','grammar','no\x20grammar\x20configured','MRCPRecog','getAndSetVariable','RECOG_CONFIDENCE()','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','no\x20text\x20configured','sestektts','RECOG_INPUT()','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','getSquareOdbc','no\x20odbc\x20database\x20found','query','no\x20query\x20configured','query:\x20%s','no\x20variable\x20selected\x20for\x20the\x20result','variable_id','no\x20variable\x20found','forEach','keys','%s[%s][%s]','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','getUser','no\x20user\x20found','DIAL','SIP/%s','opts','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','bot','Trying\x20Dialogflow:\x20%s','googleDialogflow','speech','out','Dialogflow\x20Result\x20%s','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','client_email','no\x20client_email\x20configured','no\x20private_key\x20configured','dialogflowV2_language','googleDialogflowV2','providerResponse','DIALOGFLOW_%s','DialogflowV2\x20Result\x20%s','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','password','no\x20password\x20configured','ndassistant_url','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','.wav','SestekNDA\x20is\x20unreachable','end','trunk_id','no\x20trunk\x20selected','trunk_name','SIP/%s/%s','Executed\x20command\x20%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','response','maxdigit','test','mindigit','hiddendigitsnum','generate','hiddendigitspos','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','awslex','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','message','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','beep','NOBEEP','recordFile','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','Enter\x20in\x20TILDEASR\x20(%s)\x20block','appid','no\x20appid\x20configured','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','extension','gotoif','condition','no\x20condition\x20configured','true','false','EVAL\x20CONDITION\x20%s\x20%s','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','no\x20key\x20configured','intKey','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%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','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','Enter\x20in\x20LOGOUT\x20(%s)\x20block','no\x20find\x20by\x20configured','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','%s[%s]','variable\x20%s[key]\x20set','menu','Enter\x20in\x20MENU\x20(%s)\x20block','getSound','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','pause','getPause','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue_id','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','no\x20url\x20configured','Response:','inspect','%s_STATUS_CODE','statusMessage','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','saynumber','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','Smtp','\x22%s\x22\x20<%s>','email','user','bcc','subject','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','smtpOptions','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','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','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','XMCS-UNIQUEID','yes','Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','host','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','exports','util','lodash','odbc','randomstring','mustache','../../config/logger','agi','../../config/environment','./scripts','/var/opt/motion2/server/files','rawHeaders','rawBody','getdigits','getsecretdigits','mailRpc','prototype','getVariable','rpc','getVariableById','then','name','catch','getVoiceQueue','getVoiceQueueById','getSquareProject','getSquareProjectById','getSquareOdbcById','dsn','getUserById','getTrunk','getTrunkById','getSoundById','getSoundPath','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','IntervalId','Intervals','interval','format','%s/sounds/converted/%s','getQueryOdbc','open','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','channel','uniqueid','label','agicommand','arg_1','callerid','createSquareRecording','context','priority','accountcode','dnid','file','createSquareMessage','createCmContact','random','isEmpty','lastName','phone','list_id','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','callback_priority','agentPause','agent','isNil','agentUnpause','error','agentLogout','agentLogin','internal','%s/%s@from-sip/n','shellCommand','exec','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','en-US','ssmlGender','MALE','audioEncoding','MP3','googleTTS'];(function(_0x3063e1,_0x421b62){var _0x9c9769=function(_0x108e5b){while(--_0x108e5b){_0x3063e1['push'](_0x3063e1['shift']());}};_0x9c9769(++_0x421b62);}(_0x106f,0x162));var _0xf106=function(_0x541da6,_0x10f95){_0x541da6=_0x541da6-0x0;var _0x3a38e6=_0x106f[_0x541da6];return _0x3a38e6;};'use strict';var fs=require('fs');var util=require(_0xf106('0x0'));var _=require(_0xf106('0x1'));var sh=require('shelljs');var odbc=require(_0xf106('0x2'))();var rs=require(_0xf106('0x3'));var moment=require('moment');var Mustache=require(_0xf106('0x4'));var rp=require('request-promise');var logger=require(_0xf106('0x5'))(_0xf106('0x6'));var config=require(_0xf106('0x7'));var scripts=require(_0xf106('0x8'));var FILES_PATH=_0xf106('0x9');var recursiveMapAttributes=[_0xf106('0xa'),_0xf106('0xb')];var verticesWithRetry=['menu',_0xf106('0xc'),_0xf106('0xd')];var AGIVertices=function(_0x5ea4f0,_0x4a35bc,_0x507ad9){this['channel']=_0x5ea4f0;this['rpc']=_0x4a35bc;this[_0xf106('0xe')]=_0x507ad9;};AGIVertices[_0xf106('0xf')][_0xf106('0x10')]=function(_0x454d07,_0x47044b){this[_0xf106('0x11')][_0xf106('0x12')](_0x454d07)[_0xf106('0x13')](function(_0x2ac6ec){_0x47044b(null,_0x2ac6ec?_0x2ac6ec[_0xf106('0x14')]:![]);})[_0xf106('0x15')](function(_0x5e9da8){_0x47044b(_0x5e9da8);});};AGIVertices[_0xf106('0xf')][_0xf106('0x16')]=function(_0x52cbb5,_0x59854c){this[_0xf106('0x11')][_0xf106('0x17')](_0x52cbb5)[_0xf106('0x13')](function(_0x4bc341){_0x59854c(null,_0x4bc341?_0x4bc341[_0xf106('0x14')]:![]);})[_0xf106('0x15')](function(_0xf05683){_0x59854c(_0xf05683);});};AGIVertices['prototype'][_0xf106('0x18')]=function(_0x22e521,_0x5a7c1a){this[_0xf106('0x11')][_0xf106('0x19')](_0x22e521)[_0xf106('0x13')](function(_0x5e4c8f){_0x5a7c1a(null,_0x5e4c8f?_0x5e4c8f['name']:![]);})[_0xf106('0x15')](function(_0x726d7c){_0x5a7c1a(_0x726d7c);});};AGIVertices[_0xf106('0xf')]['getSquareOdbc']=function(_0x11d2a1,_0x1a6816){this[_0xf106('0x11')][_0xf106('0x1a')](_0x11d2a1)[_0xf106('0x13')](function(_0x2dcd67){_0x1a6816(null,_0x2dcd67?_0x2dcd67[_0xf106('0x1b')]:![]);})[_0xf106('0x15')](function(_0x1c08ff){_0x1a6816(_0x1c08ff);});};AGIVertices['prototype']['getUser']=function(_0x206cbe,_0x59abbc){this[_0xf106('0x11')][_0xf106('0x1c')](_0x206cbe)[_0xf106('0x13')](function(_0x228afc){_0x59abbc(null,_0x228afc?_0x228afc[_0xf106('0x14')]:![]);})['catch'](function(_0x58febd){_0x59abbc(_0x58febd);});};AGIVertices[_0xf106('0xf')][_0xf106('0x1d')]=function(_0x4122dc,_0x25d00a){this[_0xf106('0x11')][_0xf106('0x1e')](_0x4122dc)[_0xf106('0x13')](function(_0x118726){_0x25d00a(null,_0x118726?_0x118726[_0xf106('0x14')]:![]);})[_0xf106('0x15')](function(_0x468fce){_0x25d00a(_0x468fce);});};AGIVertices[_0xf106('0xf')]['getSound']=function(_0x4b14ad,_0x53750e){var _0x2d87f7=this;this[_0xf106('0x11')][_0xf106('0x1f')](_0x4b14ad)[_0xf106('0x13')](function(_0x4265b3){_0x53750e(null,_0x4265b3?_0x2d87f7[_0xf106('0x20')](_0x4265b3['save_name']):![]);})[_0xf106('0x15')](function(_0x269bff){_0x53750e(_0x269bff);});};AGIVertices[_0xf106('0xf')][_0xf106('0x21')]=function(_0x4f223e,_0x190355){this[_0xf106('0x11')][_0xf106('0x22')](_0x4f223e)[_0xf106('0x13')](function(_0xeba1d6){_0x190355(null,_0xeba1d6?_0xeba1d6:![]);})[_0xf106('0x15')](function(_0x593fa3){_0x190355(_0x593fa3);});};AGIVertices[_0xf106('0xf')][_0xf106('0x23')]=function(_0x31e3c7,_0x467617,_0x4db0e4){this[_0xf106('0xe')][_0xf106('0x23')](_0x31e3c7,_0x467617)['then'](function(){_0x4db0e4(null);})[_0xf106('0x15')](function(_0x22c0f6){_0x4db0e4(_0x22c0f6);});};AGIVertices[_0xf106('0xf')][_0xf106('0x24')]=function(_0x145125,_0x8d541a){this[_0xf106('0x11')][_0xf106('0x25')](_0x145125)[_0xf106('0x13')](function(_0x24a26d){if(_0x24a26d){if(_0x24a26d[_0xf106('0x26')]){_0x8d541a(null,[_0x24a26d['interval']]);}else{_0x8d541a(null,_['map'](_0x24a26d[_0xf106('0x27')],_0xf106('0x28')));}}else{_0x8d541a(null,![]);}})[_0xf106('0x15')](function(_0x58f5ac){_0x8d541a(_0x58f5ac);});};AGIVertices[_0xf106('0xf')][_0xf106('0x20')]=function(_0x19a9cc){return util[_0xf106('0x29')](_0xf106('0x2a'),FILES_PATH,_0x19a9cc);};AGIVertices['prototype'][_0xf106('0x2b')]=function(_0x551ac1,_0x1bbbd6,_0x2e4c93){odbc[_0xf106('0x2c')](_0x551ac1,function(_0x2faa9f){if(_0x2faa9f){logger['error'](_0xf106('0x2d'),_0x2faa9f);_0x2e4c93(_0x2faa9f);}else{logger[_0xf106('0x2e')](_0xf106('0x2f'));odbc['query'](_0x1bbbd6,function(_0x58b081,_0x59f096){if(_0x58b081){logger['info']('Error\x20executing\x20query\x20%s',_0x1bbbd6);_0x2e4c93(_0x58b081);}else{logger[_0xf106('0x2e')]('Query\x20executed\x20correctly\x20%s',_0x1bbbd6);odbc['close'](function(_0x1ea8ca){if(_0x1ea8ca){logger['error']('Error\x20closing\x20connection\x20to\x20odbc\x20%s',_0x1ea8ca);}_0x2e4c93(null,_0x59f096);});}});}});};AGIVertices[_0xf106('0xf')][_0xf106('0x30')]=function(_0x2d4c90,_0x3e557d){this['rpc'][_0xf106('0x31')](_0x2d4c90)[_0xf106('0x13')](function(_0x583a72){_0x3e557d(null,_0x583a72?_0x583a72:![]);})[_0xf106('0x15')](function(_0x209d24){_0x3e557d(_0x209d24);});};AGIVertices[_0xf106('0xf')][_0xf106('0x32')]=function(_0x783140,_0x430b36){this[_0xf106('0x11')]['createSmsMessage'](_0x783140)['then'](function(_0x5ef052){_0x430b36(null,_0x5ef052);})['catch'](function(_0x4a64d6){_0x430b36(_0x4a64d6);});};AGIVertices[_0xf106('0xf')][_0xf106('0x33')]=function(_0x5e6cb8,_0x47f4d3,_0x336ee3){this['rpc'][_0xf106('0x33')]({'uniqueid':this[_0xf106('0x34')][_0xf106('0x35')],'node':_0x5e6cb8[_0xf106('0x36')],'application':_0x5e6cb8[_0xf106('0x37')],'data':_0x47f4d3||null,'project_name':this[_0xf106('0x34')][_0xf106('0x38')],'callerid':this[_0xf106('0x34')][_0xf106('0x39')]})[_0xf106('0x13')](function(_0x1dc36e){if(_0x336ee3){_0x336ee3(null,_0x1dc36e);}})[_0xf106('0x15')](function(_0x39763c){if(_0x336ee3){_0x336ee3(_0x39763c);}});};AGIVertices[_0xf106('0xf')][_0xf106('0x3a')]=function(_0x212037,_0x25faca,_0x240a1b,_0x4c6bfe){this[_0xf106('0x11')][_0xf106('0x3a')]({'uniqueid':this[_0xf106('0x34')][_0xf106('0x35')],'callerid':this[_0xf106('0x34')]['callerid'],'calleridname':this['channel']['calleridname'],'context':this['channel'][_0xf106('0x3b')],'extension':this['channel']['extension'],'priority':this[_0xf106('0x34')][_0xf106('0x3c')],'accountcode':this[_0xf106('0x34')][_0xf106('0x3d')],'dnid':this['channel'][_0xf106('0x3e')],'projectName':this[_0xf106('0x34')][_0xf106('0x38')],'saveName':_0x25faca,'filename':_0x212037[_0xf106('0x3f')]||_0x25faca,'savePath':_0x240a1b})[_0xf106('0x13')](function(_0x519192){_0x4c6bfe(null,_0x519192);})['catch'](function(_0x37dc6a){_0x4c6bfe(_0x37dc6a);});};AGIVertices[_0xf106('0xf')][_0xf106('0x40')]=function(_0x489ace,_0x192edc,_0x5f594e,_0x458162,_0x1ddfce){this['rpc'][_0xf106('0x40')]({'uniqueid':this['channel']['uniqueid'],'body':_0x489ace,'direction':_0x192edc,'providerName':_0x5f594e,'providerResponse':_0x458162})[_0xf106('0x13')](function(_0x46d65b){if(_0x1ddfce){_0x1ddfce(null,_0x46d65b);}})['catch'](function(_0x25e009){if(_0x1ddfce){_0x1ddfce(_0x25e009);}});};AGIVertices[_0xf106('0xf')][_0xf106('0x41')]=function(_0x1c3f0c,_0x14375d){this[_0xf106('0x11')]['createCmContact']({'firstName':_['isEmpty'](_0x1c3f0c[_0xf106('0x14')])||_['isNil'](_0x1c3f0c[_0xf106('0x14')])?'callback_'+Math[_0xf106('0x42')]():_0x1c3f0c[_0xf106('0x14')],'lastName':_[_0xf106('0x43')](_0x1c3f0c[_0xf106('0x44')])||_['isNil'](_0x1c3f0c[_0xf106('0x44')])?null:_0x1c3f0c[_0xf106('0x44')],'phone':_0x1c3f0c[_0xf106('0x45')],'ListId':_0x1c3f0c[_0xf106('0x46')],'scheduledat':_0x1c3f0c[_0xf106('0x47')],'callbackUniqueid':this[_0xf106('0x34')][_0xf106('0x35')],'tags':_0xf106('0x48'),'description':_0xf106('0x49')+_0x1c3f0c[_0xf106('0x47')][_0xf106('0x4a')](),'priority':_0x1c3f0c[_0xf106('0x4b')]})[_0xf106('0x13')](function(_0x373ead){_0x14375d(null,_0x373ead);})[_0xf106('0x15')](function(_0x39aca7){_0x14375d(_0x39aca7);});};AGIVertices['prototype']['getPause']=function(_0x427cb3,_0x119cc6){this[_0xf106('0x11')]['getPauseById'](_0x427cb3)[_0xf106('0x13')](function(_0x47d3b6){_0x119cc6(null,_0x47d3b6?_0x47d3b6[_0xf106('0x14')]:![]);})[_0xf106('0x15')](function(_0x2a23a9){_0x119cc6(_0x2a23a9);});};AGIVertices['prototype'][_0xf106('0x4c')]=function(_0x5e422f,_0x11a93d,_0xe4733e){var _0x510c05={'role':_0xf106('0x4d')};_0x510c05[_0x5e422f]=this[_0xf106('0x34')]['callerid'];this[_0xf106('0x11')][_0xf106('0x4c')](_0x510c05,_0x11a93d,this['channel'][_0xf106('0x35')])['then'](function(_0x2b4420){_0xe4733e(null,_[_0xf106('0x4e')](_0x2b4420)?![]:!![]);})['catch'](function(_0x265172){logger['error'](_0x265172);_0xe4733e(null,![]);});};AGIVertices['prototype'][_0xf106('0x4f')]=function(_0x1b903b,_0x15bf0f){var _0x41ed09={'role':_0xf106('0x4d')};_0x41ed09[_0x1b903b]=this[_0xf106('0x34')][_0xf106('0x39')];this[_0xf106('0x11')][_0xf106('0x4f')](_0x41ed09)[_0xf106('0x13')](function(_0x402a3c){_0x15bf0f(null,_[_0xf106('0x4e')](_0x402a3c)?![]:!![]);})[_0xf106('0x15')](function(_0x1b1b77){logger[_0xf106('0x50')](_0x1b1b77);_0x15bf0f(null,![]);});};AGIVertices[_0xf106('0xf')]['agentLogout']=function(_0x3b955a,_0x48e702){var _0x40be0c={'role':'agent'};_0x40be0c[_0x3b955a]=this['channel'][_0xf106('0x39')];this['rpc'][_0xf106('0x51')](_0x40be0c)[_0xf106('0x13')](function(_0x2563d1){_0x48e702(null,_[_0xf106('0x4e')](_0x2563d1)?![]:!![]);})[_0xf106('0x15')](function(_0x59deaf){logger[_0xf106('0x50')](_0x59deaf);_0x48e702(null,![]);});};AGIVertices[_0xf106('0xf')][_0xf106('0x52')]=function(_0x4abd50,_0x13d06f){var _0x23c935={'role':'agent'};_0x23c935[_0x4abd50]=this[_0xf106('0x34')]['callerid'];var _0x2a147d=_0x4abd50!=_0xf106('0x53')?util[_0xf106('0x29')](_0xf106('0x54'),'LOCAL',this[_0xf106('0x34')][_0xf106('0x39')]):undefined;this[_0xf106('0x11')][_0xf106('0x52')](_0x23c935,_0x2a147d)['then'](function(_0xfc959f){_0x13d06f(null,_[_0xf106('0x4e')](_0xfc959f)?![]:!![]);})[_0xf106('0x15')](function(_0x18776d){logger[_0xf106('0x50')](_0x18776d);_0x13d06f(null,![]);});};AGIVertices[_0xf106('0xf')][_0xf106('0x55')]=function(_0x404306,_0x43dc7d){sh[_0xf106('0x56')](_[_0xf106('0x57')](_0x404306),function(_0x305bb3,_0x54d56b){var _0x4729f0=_0x54d56b[_0xf106('0x58')](/(\r\n|\n|\r)/gm,'');_0x43dc7d(null,_0x4729f0);});};AGIVertices[_0xf106('0xf')][_0xf106('0x59')]=function(_0x377e09,_0x5f23ab){scripts[_0xf106('0x59')](_0x377e09[_0xf106('0x5a')],_0x377e09[_0xf106('0x5b')]||'text',_0x377e09[_0xf106('0x5c')],_0x377e09['languageCode']||_0xf106('0x5d'),_0x377e09[_0xf106('0x5e')]||_0xf106('0x5f'),_0x377e09[_0xf106('0x60')]||_0xf106('0x61'))['then'](function(_0x2cd763){_0x5f23ab(null,_0x2cd763);})['catch'](function(_0x436d6a){_0x5f23ab(_0x436d6a);});};AGIVertices[_0xf106('0xf')][_0xf106('0x62')]=function(_0x10573d,_0x3530da){scripts[_0xf106('0x62')](_0x10573d[_0xf106('0x5c')],_0x10573d[_0xf106('0x63')]||'en',0x1)['then'](function(_0x341487){_0x3530da(null,_0x341487);})['catch'](function(_0x3347f1){_0x3530da(_0x3347f1);});};AGIVertices[_0xf106('0xf')]['restAPI']=function(_0x1d4b0f,_0x340317){var _0x5258ad={'uri':_0x1d4b0f[_0xf106('0x64')],'method':_0x1d4b0f['method'],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x1d4b0f[_0xf106('0x65')])===_0xf106('0x66')&&parseInt(_0x1d4b0f[_0xf106('0x65')])>=0x1?parseInt(_0x1d4b0f['timeout'])*0x3e8:0x5*0x3e8};if(_[_0xf106('0x67')](['POST',_0xf106('0x68')],_0x5258ad['method'][_0xf106('0x69')]())){try{_0x5258ad[_0xf106('0x6a')]=_0x1d4b0f[_0xf106('0xb')]?JSON[_0xf106('0x6b')](_0x1d4b0f[_0xf106('0xb')]):{};}catch(_0x25c8d1){logger[_0xf106('0x50')](_0xf106('0x6c'),_0x25c8d1);}}try{_0x5258ad[_0xf106('0x6d')]=_0x1d4b0f[_0xf106('0xa')]?JSON['parse'](_0x1d4b0f['rawHeaders']):{};}catch(_0x3707ed){logger[_0xf106('0x50')](_0xf106('0x6e'),_0x3707ed);}if(_0x1d4b0f[_0xf106('0x6f')]){try{var _0x3bc329=require(_0x1d4b0f[_0xf106('0x6f')])['sync'](this,_0x5258ad);_0x5258ad[_0xf106('0x70')]=Mustache[_0xf106('0x71')](_0x1d4b0f['url'],_0x3bc329,{},['$$','$$']);if(_0x5258ad[_0xf106('0x6d')]){_0x5258ad[_0xf106('0x6d')]=JSON['parse'](Mustache[_0xf106('0x71')](JSON[_0xf106('0x72')](_0x5258ad[_0xf106('0x6d')]),_0x3bc329,{},['$$','$$']));}if(_0x5258ad['body']){_0x5258ad[_0xf106('0x6a')]=JSON[_0xf106('0x6b')](Mustache[_0xf106('0x71')](JSON[_0xf106('0x72')](_0x5258ad[_0xf106('0x6a')]),_0x3bc329,{},['$$','$$']));}}catch(_0x2f6a31){logger[_0xf106('0x50')](_0xf106('0x73'),_0x2f6a31);}}rp(_0x5258ad)['then'](function(_0x4a39af){var _0x133767={'statusCode':_0x4a39af['statusCode']||0xc8,'statusMessage':_0x4a39af['statusMessage']||'OK','headers':_0x4a39af[_0xf106('0x6d')]||{},'body':_0x4a39af['body']||{}};_0x340317(null,_0x133767);})[_0xf106('0x15')](function(_0x58436a){var _0x20a9c1={'statusCode':_0x58436a[_0xf106('0x74')]||0x1f4,'statusMessage':_0x58436a['message']||_0xf106('0x75'),'headers':_0x58436a[_0xf106('0x76')][_0xf106('0x6d')]||{},'body':_0x58436a[_0xf106('0x76')][_0xf106('0x6a')]||{}};_0x340317(null,_0x20a9c1);});};AGIVertices[_0xf106('0xf')]['googleDialogflow']=function(_0x92e626,_0x4760fd){scripts['googleDialogflow'](this['channel'][_0xf106('0x35')],_0x92e626[_0xf106('0x77')],_0x92e626[_0xf106('0x5c')],_0x92e626[_0xf106('0x78')]||'en')[_0xf106('0x13')](function(_0x31caa7){_0x4760fd(null,_0x31caa7);})[_0xf106('0x15')](function(_0x4d2d6f){_0x4760fd(_0x4d2d6f);});};AGIVertices[_0xf106('0xf')]['googleDialogflowV2']=function(_0x3e037e,_0x10fb6e){scripts['googleDialogflowV2'](this['channel'][_0xf106('0x35')],_0x3e037e[_0xf106('0x79')],_0x3e037e['client_email'],_0x3e037e[_0xf106('0x7a')],_0x3e037e['text'],_0x3e037e['dialogflowV2_language']||'en')[_0xf106('0x13')](function(_0x45ee00){_0x10fb6e(null,_0x45ee00);})['catch'](function(_0x37a60d){_0x10fb6e(_0x37a60d);});};AGIVertices['prototype']['sestekNDA']=function(_0x423e77,_0x1d7bec){scripts[_0xf106('0x7b')](this[_0xf106('0x34')],_0x423e77)[_0xf106('0x13')](function(_0x12afa9){_0x1d7bec(null,_0x12afa9);})[_0xf106('0x15')](function(_0x26b651){_0x1d7bec(_0x26b651);});};AGIVertices['prototype']['ispeechTTS']=function(_0x5ccec2,_0x3a8cfb){scripts[_0xf106('0x7c')](_0x5ccec2[_0xf106('0x77')],_0x5ccec2[_0xf106('0x5c')],_0x5ccec2['ispeech_tts_language']||_0xf106('0x5d'),_0x5ccec2[_0xf106('0x7d')])[_0xf106('0x13')](function(_0xcb5f77){_0x3a8cfb(null,_0xcb5f77);})[_0xf106('0x15')](function(_0x15cc19){_0x3a8cfb(_0x15cc19);});};AGIVertices[_0xf106('0xf')][_0xf106('0x7e')]=function(_0x5f4e79,_0x285e3e,_0x2c6d79){scripts[_0xf106('0x7e')](_0x285e3e,_0x5f4e79[_0xf106('0x77')],_0x5f4e79[_0xf106('0x7f')]||_0xf106('0x5d'),this[_0xf106('0x80')](_0x5f4e79[_0xf106('0x81')])?_0x5f4e79[_0xf106('0x81')]:undefined)[_0xf106('0x13')](function(_0x3c1099){_0x2c6d79(null,_0x3c1099);})['catch'](function(_0x28f3a6){_0x2c6d79(_0x28f3a6);});};AGIVertices[_0xf106('0xf')][_0xf106('0x82')]=function(_0x17be2b,_0x3a9c99){scripts[_0xf106('0x82')](_0x17be2b[_0xf106('0x83')],_0x17be2b[_0xf106('0x84')],_0x17be2b[_0xf106('0x85')],_0x17be2b[_0xf106('0x86')]||_0xf106('0x87'),_0x17be2b[_0xf106('0x5c')],_0x17be2b[_0xf106('0x88')]||_0xf106('0x5c'))[_0xf106('0x13')](function(_0x5d8810){_0x3a9c99(null,_0x5d8810);})['catch'](function(_0x469e03){_0x3a9c99(_0x469e03);});};AGIVertices[_0xf106('0xf')][_0xf106('0x89')]=function(_0x4062f5,_0x32fa7f){scripts['awsLex'](this['channel']['uniqueid'],_0x4062f5[_0xf106('0x83')],_0x4062f5[_0xf106('0x84')],_0x4062f5[_0xf106('0x8a')],_0x4062f5[_0xf106('0x5c')],_0x4062f5[_0xf106('0x8b')])['then'](function(_0x4b88f1){_0x32fa7f(null,_0x4b88f1);})['catch'](function(_0x194adf){_0x32fa7f(_0x194adf);});};AGIVertices[_0xf106('0xf')][_0xf106('0x8c')]=function(_0x7205b,_0x1cee56,_0x1fcc8a){scripts[_0xf106('0x8c')](_0x1cee56,_0x7205b[_0xf106('0x77')],_0x7205b[_0xf106('0x8d')]||_0xf106('0x5d'))[_0xf106('0x13')](function(_0x151f79){_0x1fcc8a(null,_0x151f79);})[_0xf106('0x15')](function(_0x23409d){_0x1fcc8a(_0x23409d);});};AGIVertices[_0xf106('0xf')][_0xf106('0x8e')]=function(_0x279428,_0x34facf,_0x12b0f8){scripts['tildeASR'](_0x34facf,_0x279428['appid'],_0x279428[_0xf106('0x8f')],_0x279428[_0xf106('0x70')])[_0xf106('0x13')](function(_0x22310f){_0x12b0f8(null,_0x22310f);})['catch'](function(_0x86f62b){_0x12b0f8(_0x86f62b);});};AGIVertices[_0xf106('0xf')][_0xf106('0x90')]=function(_0x109d67){var _0x5d388d=_[_0xf106('0x67')](verticesWithRetry,_0x109d67[_0xf106('0x37')])?_0x109d67:_['clone'](_0x109d67);for(var _0x46b581 in _0x5d388d){if(_0x5d388d[_0xf106('0x91')](_0x46b581)){if(_0x5d388d[_0x46b581]&&_[_0xf106('0x92')](_0x5d388d[_0x46b581])){if(_[_0xf106('0x67')](recursiveMapAttributes,_0x46b581)){_0x5d388d[_0x46b581]=this[_0xf106('0x93')](_0x5d388d[_0x46b581]);}else{_0x5d388d[_0x46b581]=this[_0xf106('0x94')](_0x5d388d[_0x46b581]);}}}}return _0x5d388d;};AGIVertices[_0xf106('0xf')]['recursiveNodeIndex']=function(_0x564436){for(var _0x16af98 in _0x564436){if(_0x564436['hasOwnProperty'](_0x16af98)){if(_[_0xf106('0x95')](_0x564436[_0x16af98])){this[_0xf106('0x96')](_0x564436[_0x16af98]);}else if(_[_0xf106('0x97')](_0x564436[_0x16af98])){for(var _0x3ff245=0x0;_0x3ff245<_0x564436[_0x16af98][_0xf106('0x98')];_0x3ff245++){this['recursiveNodeIndex'](_0x564436[_0x16af98][_0x3ff245]);}}else if(_[_0xf106('0x92')](_0x564436[_0x16af98])){_0x564436[_0x16af98]=this[_0xf106('0x94')](_0x564436[_0x16af98]);}}}};AGIVertices[_0xf106('0xf')]['saveRestApiResult']=function(_0x28d1b0,_0x38122b){for(var _0x2eb599 in _0x28d1b0){if(_0x28d1b0[_0xf106('0x91')](_0x2eb599)){if(_['isPlainObject'](_0x28d1b0[_0x2eb599])){if(!_[_0xf106('0x43')](_0x28d1b0[_0x2eb599])){this[_0xf106('0x99')](_0x28d1b0[_0x2eb599],util['format'](_0xf106('0x9a'),_0x38122b,_0x2eb599));}}else if(_['isArray'](_0x28d1b0[_0x2eb599])){for(var _0x53b0fd=0x0;_0x53b0fd<_0x28d1b0[_0x2eb599][_0xf106('0x98')];_0x53b0fd++){this[_0xf106('0x99')](_0x28d1b0[_0x2eb599][_0x53b0fd],util[_0xf106('0x29')]('%s.%s',_0x38122b,_0x2eb599+'['+_0x53b0fd+']'));}}else{if(!_['isNil'](_0x28d1b0[_0x2eb599])){this[_0xf106('0x34')]['setVariable'](util[_0xf106('0x29')](_0xf106('0x9a'),_0x38122b,_0x2eb599),_0x28d1b0[_0x2eb599]);}}}}};AGIVertices[_0xf106('0xf')][_0xf106('0x93')]=function(_0x307c5d){try{var _0x251cc0=JSON['parse'](_0x307c5d);this[_0xf106('0x96')](_0x251cc0);return JSON[_0xf106('0x72')](_0x251cc0);}catch(_0x5a3e82){return this[_0xf106('0x94')](_0x307c5d);}};AGIVertices[_0xf106('0xf')]['replaceAllVariables']=function(_0x384578){var _0x20300b=_0x384578[_0xf106('0x9b')]('{');for(var _0x1e67f4=0x1;_0x1e67f4<_0x20300b['length'];_0x1e67f4+=0x1){var _0x3f20e5=_0x20300b[_0x1e67f4]['split']('}');if(_0x3f20e5['length']>0x1){_0x384578=_0x384578[_0xf106('0x9c')]('{'+_0x3f20e5[0x0]+'}',this[_0xf106('0x34')][_0xf106('0x10')](_0x3f20e5[0x0])['extra']||_0x3f20e5[0x0]);}}if(_0x20300b[_0xf106('0x98')]===0x1){return _0x384578[_0xf106('0x4a')]();}return this[_0xf106('0x94')](_0x384578);};AGIVertices['prototype']['getAndSetVariable']=function(_0x2ed372,_0x193499){var _0x376cac=this[_0xf106('0x34')][_0xf106('0x10')](_0x2ed372);if(_0x376cac[_0xf106('0x9d')]===-0x1){return _0x376cac;}logger[_0xf106('0x2e')](util['format'](_0xf106('0x9e'),_0x193499,_0x376cac[_0xf106('0x9f')]));return this['channel'][_0xf106('0xa0')](_0x193499,_0x376cac['extra']);};AGIVertices[_0xf106('0xf')]['isConfigured']=function(_0x4ae0e6){return _0x4ae0e6&&_0x4ae0e6!=='0'&&_0x4ae0e6!=='-1'&&_0x4ae0e6!=='';};AGIVertices[_0xf106('0xf')][_0xf106('0xa1')]=function(_0x1c3846){this['createSquareDetailsReport'][_0xf106('0xa2')](this,_0x1c3846,'-');_0x1c3846[_0xf106('0xa3')]=_0x1c3846[_0xf106('0xa1')];return{'code':0xc8,'result':'-'};};AGIVertices[_0xf106('0xf')][_0xf106('0xa4')]=function(_0x282a7b){logger[_0xf106('0x2e')](util['format']('Enter\x20in\x20MRCPSynth\x20(%s)\x20block',_0x282a7b[_0xf106('0x36')]));if(!this[_0xf106('0x80')](_0x282a7b[_0xf106('0x5c')])){return this[_0xf106('0x34')][_0xf106('0xa5')]('no\x20text\x20configured');}var _0x4351b3='\x22'+_0x282a7b[_0xf106('0x5c')]+'\x22';if(this[_0xf106('0x80')](_0x282a7b[_0xf106('0x76')])){_0x4351b3+=','+_0x282a7b[_0xf106('0x76')];}var _0x34516d=this[_0xf106('0x34')][_0xf106('0x56')](_0xf106('0xa6'),_0x4351b3);if(_0x34516d['result']===-0x1){return _0x34516d;}return this[_0xf106('0x34')][_0xf106('0xa5')](util[_0xf106('0x29')](_0xf106('0xa7'),_0x4351b3));};AGIVertices['prototype'][_0xf106('0xa8')]=function(_0x371f35){logger[_0xf106('0x2e')](util['format']('Enter\x20in\x20MRCPRecog\x20(%s)\x20block',_0x371f35['label']));if(!this[_0xf106('0x80')](_0x371f35[_0xf106('0xa9')])){return this[_0xf106('0x34')][_0xf106('0xa5')](_0xf106('0xaa'));}var _0x2ae414=_0x371f35[_0xf106('0xa9')];if(this[_0xf106('0x80')](_0x371f35[_0xf106('0x76')])){_0x2ae414+=','+_0x371f35[_0xf106('0x76')];}var _0x11b9fa=this['channel'][_0xf106('0x56')](_0xf106('0xab'),_0x2ae414);if(_0x11b9fa['result']===-0x1){return _0x11b9fa;}var _0x241bcb=this[_0xf106('0xac')](_0xf106('0xad'),'MRCP_RECOG_CONFIDENCE');if(_0x241bcb[_0xf106('0x9d')]===-0x1){return _0x241bcb;}var _0x58f7c2=this[_0xf106('0xac')]('RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT');if(_0x58f7c2[_0xf106('0x9d')]===-0x1){return _0x58f7c2;}var _0x1688a6=this['getAndSetVariable'](_0xf106('0xae'),_0xf106('0xaf'));if(_0x1688a6[_0xf106('0x9d')]===-0x1){return _0x1688a6;}return this['channel'][_0xf106('0xa5')](util[_0xf106('0x29')](_0xf106('0xb0'),_0x2ae414));};AGIVertices[_0xf106('0xf')][_0xf106('0x6')]=function(_0x343ad4){logger['info'](util[_0xf106('0x29')](_0xf106('0xb1'),_0x343ad4[_0xf106('0x36')]));return this[_0xf106('0x34')][_0xf106('0x6')]([_0x343ad4[_0xf106('0xb2')],_0x343ad4[_0xf106('0xb3')]]);};AGIVertices['prototype'][_0xf106('0xb4')]=function(_0x1593e0){logger[_0xf106('0x2e')](util[_0xf106('0x29')]('Enter\x20in\x20ANSWER\x20(%s)\x20block',_0x1593e0[_0xf106('0x36')]));if(this['isConfigured'](_0x1593e0[_0xf106('0x65')])){logger['info'](util[_0xf106('0x29')]('Wait\x20%s\x20seconds\x20before\x20answer',_0x1593e0[_0xf106('0x65')]));var _0x581a8b=this[_0xf106('0x34')][_0xf106('0xb5')](_0x1593e0[_0xf106('0x65')]);if(_0x581a8b[_0xf106('0x9d')]===-0x1){return _0x581a8b;}}return this[_0xf106('0x34')][_0xf106('0xb4')]();};AGIVertices['prototype'][_0xf106('0x48')]=function(_0x49778d){logger[_0xf106('0x2e')](util['format'](_0xf106('0xb6'),_0x49778d['label']));if(!this[_0xf106('0x80')](_0x49778d[_0xf106('0x46')])){return this[_0xf106('0x34')]['error'](_0x49778d,_0xf106('0xb7'));}_0x49778d[_0xf106('0x47')]=moment();if(this[_0xf106('0x80')](_0x49778d[_0xf106('0xb8')])){_0x49778d[_0xf106('0x47')]=moment()['add'](_0x49778d[_0xf106('0xb8')],_0xf106('0xb9'));}if(!this['isConfigured'](_0x49778d[_0xf106('0x4b')])){_0x49778d[_0xf106('0x4b')]=0x2;}this[_0xf106('0x41')][_0xf106('0xa2')](this,_0x49778d);return this['channel']['noop'](util[_0xf106('0x29')](_0xf106('0xba'),_0x49778d[_0xf106('0x45')],_0x49778d['list_id'],_0x49778d[_0xf106('0x47')]));};AGIVertices[_0xf106('0xf')]['custom_app']=function(_0x596542){logger[_0xf106('0x2e')](util[_0xf106('0x29')]('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x596542['label']));var _0x22725d=this[_0xf106('0x34')]['exec'](_0x596542[_0xf106('0xbb')],_0x596542[_0xf106('0x76')]);if(_0x22725d[_0xf106('0x9d')]===-0x1){return _0x22725d;}return this[_0xf106('0x34')]['noop'](util[_0xf106('0x29')](_0xf106('0xbc'),_0x596542['application'],_0x596542[_0xf106('0x76')]));};AGIVertices[_0xf106('0xf')][_0xf106('0xbd')]=function(_0x4ba12b){logger[_0xf106('0x2e')](util['format'](_0xf106('0xbe'),_0x4ba12b[_0xf106('0x36')]));if(!this[_0xf106('0x80')](_0x4ba12b[_0xf106('0x5c')])){return this[_0xf106('0x34')][_0xf106('0xa5')](_0xf106('0xbf'));}var _0x3ef116='\x22'+_0x4ba12b['text']+'\x22';if(this[_0xf106('0x80')](_0x4ba12b[_0xf106('0x76')])){_0x3ef116+=','+_0x4ba12b[_0xf106('0x76')];}var _0xc28471=this['channel'][_0xf106('0x56')]('MRCPSynth',_0x3ef116);if(_0xc28471[_0xf106('0x9d')]===-0x1){return _0xc28471;}return this['channel'][_0xf106('0xa5')](util[_0xf106('0x29')](_0xf106('0xa7'),_0x3ef116));};AGIVertices[_0xf106('0xf')][_0xf106('0xc0')]=function(_0x141c6f){logger[_0xf106('0x2e')](util[_0xf106('0x29')]('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x141c6f[_0xf106('0x36')]));if(!this['isConfigured'](_0x141c6f[_0xf106('0x5c')])){return this[_0xf106('0x34')][_0xf106('0xa5')](_0xf106('0xbf'));}var _0x5c6e22='\x22'+_0x141c6f[_0xf106('0x5c')]+'\x22';if(this[_0xf106('0x80')](_0x141c6f[_0xf106('0x76')])){_0x5c6e22+=','+_0x141c6f[_0xf106('0x76')];}var _0x3167d1=this[_0xf106('0x34')][_0xf106('0x56')](_0xf106('0xa6'),_0x5c6e22);if(_0x3167d1['result']===-0x1){return _0x3167d1;}return this[_0xf106('0x34')]['noop'](util[_0xf106('0x29')]('Executed\x20command\x20MRCPSynth\x20%s',_0x5c6e22));};AGIVertices[_0xf106('0xf')]['lumenvoxasr']=function(_0x2a001d){logger[_0xf106('0x2e')](util[_0xf106('0x29')]('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x2a001d[_0xf106('0x36')]));if(!this['isConfigured'](_0x2a001d['grammar'])){return this[_0xf106('0x34')][_0xf106('0xa5')](_0xf106('0xaa'));}var _0x37e91d=_0x2a001d['grammar'];if(this[_0xf106('0x80')](_0x2a001d[_0xf106('0x76')])){_0x37e91d+=','+_0x2a001d['options'];}var _0x4d5073=this['channel']['exec'](_0xf106('0xab'),_0x37e91d);if(_0x4d5073[_0xf106('0x9d')]===-0x1){return _0x4d5073;}var _0x105727=this[_0xf106('0xac')](_0xf106('0xad'),'LUMENVOX_ASR_CONFIDENCE');if(_0x105727[_0xf106('0x9d')]===-0x1){return _0x105727;}var _0x5b8aef=this[_0xf106('0xac')](_0xf106('0xc1'),_0xf106('0xc2'));if(_0x5b8aef[_0xf106('0x9d')]===-0x1){return _0x5b8aef;}var _0x438f41=this['getAndSetVariable'](_0xf106('0xae'),_0xf106('0xc3'));if(_0x438f41[_0xf106('0x9d')]===-0x1){return _0x438f41;}return this[_0xf106('0x34')]['noop'](util[_0xf106('0x29')](_0xf106('0xb0'),_0x37e91d));};AGIVertices['prototype'][_0xf106('0xc4')]=function(_0x2d414c){logger[_0xf106('0x2e')](util[_0xf106('0x29')](_0xf106('0xc5'),_0x2d414c[_0xf106('0x36')]));if(!this[_0xf106('0x80')](_0x2d414c[_0xf106('0xa9')])){return this[_0xf106('0x34')][_0xf106('0xa5')](_0xf106('0xaa'));}var _0x39e573=_0x2d414c['grammar'];if(this['isConfigured'](_0x2d414c[_0xf106('0x76')])){_0x39e573+=','+_0x2d414c[_0xf106('0x76')];}var _0x11c542=this[_0xf106('0x34')][_0xf106('0x56')](_0xf106('0xab'),_0x39e573);if(_0x11c542[_0xf106('0x9d')]===-0x1){return _0x11c542;}var _0x5094d1=this[_0xf106('0xac')]('RECOG_CONFIDENCE()','SESTEK_ASR_CONFIDENCE');if(_0x5094d1[_0xf106('0x9d')]===-0x1){return _0x5094d1;}var _0x21059b=this['getAndSetVariable'](_0xf106('0xc1'),_0xf106('0xc6'));if(_0x21059b[_0xf106('0x9d')]===-0x1){return _0x21059b;}var _0x402db7=this[_0xf106('0xac')](_0xf106('0xae'),_0xf106('0xc7'));if(_0x402db7['result']===-0x1){return _0x402db7;}return this[_0xf106('0x34')]['noop'](util[_0xf106('0x29')](_0xf106('0xb0'),_0x39e573));};AGIVertices[_0xf106('0xf')][_0xf106('0xc8')]=function(_0x1118e3){logger[_0xf106('0x2e')](util[_0xf106('0x29')](_0xf106('0xc9'),_0x1118e3[_0xf106('0x36')]));if(!this[_0xf106('0x80')](_0x1118e3[_0xf106('0xca')])){return this['channel'][_0xf106('0x50')](_0x1118e3,_0xf106('0xcb'));}var _0x576e44=this[_0xf106('0xcc')][_0xf106('0xa2')](this,_0x1118e3['odbc_id']);if(!_0x576e44){return this[_0xf106('0x34')][_0xf106('0x50')](_0x1118e3,_0xf106('0xcd'));}if(!this[_0xf106('0x80')](_0x1118e3[_0xf106('0xce')])){return this[_0xf106('0x34')]['error'](_0x1118e3,_0xf106('0xcf'));}var _0x1f1260=_0x1118e3[_0xf106('0xce')][_0xf106('0x58')](/(\r\n|\n|\r)/gm,'\x20');this['channel'][_0xf106('0xa5')](util[_0xf106('0x29')](_0xf106('0xd0'),_0x1f1260));var _0x8cb2=this[_0xf106('0x2b')][_0xf106('0xa2')](this,_0x576e44,_0x1f1260);this[_0xf106('0x33')][_0xf106('0xa2')](this,_0x1118e3,_0x1f1260);if(!this[_0xf106('0x80')](_0x1118e3['variable_id'])){return this[_0xf106('0x34')]['noop'](_0xf106('0xd1'));}var _0x2ab369=this['getVariable']['sync'](this,_0x1118e3[_0xf106('0xd2')]);if(!_0x2ab369){return this[_0xf106('0x34')][_0xf106('0x50')](_0x1118e3,_0xf106('0xd3'));}var _0x240e3a=this;_0x8cb2[_0xf106('0xd4')](function(_0x5d47cc,_0x32f7af){Object[_0xf106('0xd5')](_0x5d47cc)[_0xf106('0xd4')](function(_0x17ee5a){_0x240e3a[_0xf106('0x34')][_0xf106('0xa0')](util['format'](_0xf106('0xd6'),_0x2ab369,_0x32f7af,_0x17ee5a),_0x5d47cc[_0x17ee5a]);});});this[_0xf106('0x34')][_0xf106('0xa0')](util[_0xf106('0x29')]('%s_ROWS_COUNT',_0x2ab369),_0x8cb2[_0xf106('0x98')]);return this[_0xf106('0x34')][_0xf106('0xa5')](util['format']('variable\x20%s\x20set',_0x2ab369));};AGIVertices[_0xf106('0xf')][_0xf106('0xd7')]=function(_0x5eed70){logger[_0xf106('0xd8')](util[_0xf106('0x29')](_0xf106('0xd9'),_0x5eed70[_0xf106('0x36')]));if(!this['isConfigured'](_0x5eed70[_0xf106('0xda')])){return this[_0xf106('0x34')][_0xf106('0x50')](_0x5eed70,'no\x20user\x20selected');}var _0x35edce=this[_0xf106('0xdb')][_0xf106('0xa2')](this,_0x5eed70['sip_id']);if(!_0x35edce){return this['channel'][_0xf106('0x50')](_0x5eed70,_0xf106('0xdc'));}var _0x17311f=this[_0xf106('0x34')][_0xf106('0x56')](_0xf106('0xdd'),[util['format'](_0xf106('0xde'),_0x35edce),_0x5eed70[_0xf106('0x65')],_0x5eed70[_0xf106('0xdf')],_0x5eed70[_0xf106('0x64')]]);if(_0x17311f[_0xf106('0x9d')]===-0x1){return _0x17311f;}return this[_0xf106('0x34')][_0xf106('0xa5')](util['format']('Executed\x20command\x20%s',_0xf106('0xdd')));};AGIVertices['prototype'][_0xf106('0xe0')]=function(_0x3f6880){logger[_0xf106('0x2e')](util[_0xf106('0x29')](_0xf106('0xe1'),_0x3f6880['label']));if(!this[_0xf106('0x80')](_0x3f6880['key'])){return this[_0xf106('0x34')][_0xf106('0xa5')]('no\x20key\x20configured');}if(!this[_0xf106('0x80')](_0x3f6880['text'])){return this[_0xf106('0x34')]['noop'](_0xf106('0xbf'));}this[_0xf106('0x34')][_0xf106('0xe2')]=!![];this[_0xf106('0x33')](_0x3f6880);this[_0xf106('0x40')](_0x3f6880['text'],'in','','');this[_0xf106('0x34')]['noop'](util[_0xf106('0x29')](_0xf106('0xe3'),_0x3f6880[_0xf106('0x5c')]));var _0x59f161=this[_0xf106('0xe4')]['sync'](this,_0x3f6880);if(_0x59f161){for(var _0x41ba91 in _0x59f161){if(_0x59f161[_0xf106('0x91')](_0x41ba91)){this[_0xf106('0x34')][_0xf106('0xa0')](util['format']('DIALOGFLOW_%s',_0x41ba91['toUpperCase']()),_0x59f161[_0x41ba91]);}}this[_0xf106('0x40')](_0x59f161[_0xf106('0xe5')],_0xf106('0xe6'),_0xf106('0xe0'),'');return this['channel'][_0xf106('0xa5')](util['format'](_0xf106('0xe7'),_0x59f161[_0xf106('0xe5')]));}return this[_0xf106('0x34')][_0xf106('0x50')](_0x3f6880,'Dialogflow\x20is\x20unreachable');};AGIVertices['prototype'][_0xf106('0xe8')]=function(_0x3b1644){logger[_0xf106('0x2e')](util[_0xf106('0x29')](_0xf106('0xe9'),_0x3b1644[_0xf106('0x36')]));if(!this['isConfigured'](_0x3b1644[_0xf106('0x79')])){return this[_0xf106('0x34')][_0xf106('0xa5')]('no\x20project_id\x20configured');}if(!this['isConfigured'](_0x3b1644[_0xf106('0xea')])){return this[_0xf106('0x34')]['noop'](_0xf106('0xeb'));}if(!this['isConfigured'](_0x3b1644[_0xf106('0x7a')])){return this[_0xf106('0x34')][_0xf106('0xa5')](_0xf106('0xec'));}if(!this[_0xf106('0x80')](_0x3b1644[_0xf106('0xed')])){return this[_0xf106('0x34')][_0xf106('0xa5')]('no\x20anguage\x20configured');}if(!this[_0xf106('0x80')](_0x3b1644[_0xf106('0x5c')])){return this['channel'][_0xf106('0xa5')](_0xf106('0xbf'));}this[_0xf106('0x34')][_0xf106('0xe2')]=!![];this[_0xf106('0x33')](_0x3b1644);this['createSquareMessage'](_0x3b1644[_0xf106('0x5c')],'in','','');this['channel'][_0xf106('0xa5')](util[_0xf106('0x29')]('Trying\x20DialogflowV2:\x20%s',_0x3b1644[_0xf106('0x5c')]));var _0xa99e35=this[_0xf106('0xee')][_0xf106('0xa2')](this,_0x3b1644);if(_0xa99e35){for(var _0xbb6938 in _0xa99e35){if(_0xa99e35[_0xf106('0x91')](_0xbb6938)){if(_0xbb6938!==_0xf106('0xef')){this['channel']['setVariable'](util[_0xf106('0x29')](_0xf106('0xf0'),_0xbb6938['toUpperCase']()),_0xa99e35[_0xbb6938]);}}}this[_0xf106('0x40')](_0xa99e35[_0xf106('0xe5')],'out',_0xf106('0xe8'),_0xa99e35['providerResponse']);return this[_0xf106('0x34')][_0xf106('0xa5')](util[_0xf106('0x29')](_0xf106('0xf1'),_0xa99e35['speech']));}return this[_0xf106('0x34')]['error'](_0x3b1644,'DialogflowV2\x20is\x20unreachable');};AGIVertices['prototype'][_0xf106('0xf2')]=function(_0x439017){logger[_0xf106('0x2e')](util[_0xf106('0x29')](_0xf106('0xf3'),_0x439017[_0xf106('0x36')]));if(!this[_0xf106('0x80')](_0x439017[_0xf106('0xf4')])){return this[_0xf106('0x34')][_0xf106('0xa5')](_0xf106('0xf5'));}if(!this[_0xf106('0x80')](_0x439017[_0xf106('0xf6')])){return this[_0xf106('0x34')][_0xf106('0xa5')]('no\x20username\x20configured');}if(!this[_0xf106('0x80')](_0x439017[_0xf106('0xf7')])){return this[_0xf106('0x34')][_0xf106('0xa5')](_0xf106('0xf8'));}if(!this['isConfigured'](_0x439017[_0xf106('0xf9')])){return this[_0xf106('0x34')][_0xf106('0xa5')](_0xf106('0xbf'));}this[_0xf106('0x34')][_0xf106('0xe2')]=!![];this[_0xf106('0x33')](_0x439017);this[_0xf106('0x40')](_0x439017[_0xf106('0x5c')],'in','','');this[_0xf106('0x34')][_0xf106('0xa5')](util['format']('Trying\x20SestekNDA:\x20%s',_0x439017[_0xf106('0x5c')]));var _0x5b5d6e=this[_0xf106('0x7b')][_0xf106('0xa2')](this,_0x439017);if(_0x5b5d6e){for(var _0x3d15d0 in _0x5b5d6e){if(_0x5b5d6e[_0xf106('0x91')](_0x3d15d0)){this[_0xf106('0x34')][_0xf106('0xa0')](util[_0xf106('0x29')](_0xf106('0xfa'),_0x3d15d0['toUpperCase']()),_0x5b5d6e[_0x3d15d0]);}}this[_0xf106('0x40')](_0x5b5d6e[_0xf106('0xe5')],_0xf106('0xe6'),_0xf106('0xf2'),'');if(_0x5b5d6e[_0xf106('0xfb')]){this[_0xf106('0x34')]['noop'](util['format'](_0xf106('0xfc'),_0x5b5d6e['audiofile']));var _0x28b8ac=this['channel'][_0xf106('0xfd')](_0x5b5d6e[_0xf106('0xfb')]);try{fs[_0xf106('0xfe')](_0x5b5d6e[_0xf106('0xfb')]+_0xf106('0xff'));}catch(_0x8879be){logger[_0xf106('0x50')](_0x8879be);}return _0x28b8ac;}else{return this[_0xf106('0x34')][_0xf106('0xa5')](util[_0xf106('0x29')]('SestekNDA\x20Result\x20%s',_0x5b5d6e[_0xf106('0xe5')]));}}return this[_0xf106('0x34')][_0xf106('0x50')](_0x439017,_0xf106('0x100'));};AGIVertices[_0xf106('0xf')]['end']=function(_0xa73fbe){logger[_0xf106('0x2e')](util[_0xf106('0x29')]('Enter\x20in\x20END\x20(%s)\x20block',_0xa73fbe[_0xf106('0x36')]));return this[_0xf106('0x34')][_0xf106('0xa5')](_0xf106('0x101'));};AGIVertices[_0xf106('0xf')]['ext_dial']=function(_0x8b1803){logger[_0xf106('0x2e')](util['format']('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x8b1803['label']));var _0x4849ad='';if(_0x8b1803[_0xf106('0x102')]){if(!this[_0xf106('0x80')](_0x8b1803[_0xf106('0x102')])){return this[_0xf106('0x34')][_0xf106('0x50')](_0x8b1803,_0xf106('0x103'));}else{var _0x3e0488=parseInt(_0x8b1803[_0xf106('0x102')],0xa);if(isNaN(_0x3e0488)){_0x4849ad=_0x8b1803[_0xf106('0x102')];}else{_0x4849ad=this['getTrunk'][_0xf106('0xa2')](this,_0x8b1803[_0xf106('0x102')]);if(!_0x4849ad){return this[_0xf106('0x34')][_0xf106('0x50')](_0x8b1803,'no\x20trunk\x20found');}}}}else if(_0x8b1803[_0xf106('0x104')]){_0x4849ad=_0x8b1803[_0xf106('0x104')];}else{return this['channel'][_0xf106('0x50')](_0x8b1803,'no\x20trunk\x20selected');}var _0x4b393e=this['channel'][_0xf106('0x56')](_0xf106('0xdd'),[util['format'](_0xf106('0x105'),_0x4849ad,_0x8b1803[_0xf106('0x45')]),_0x8b1803[_0xf106('0x65')],_0x8b1803[_0xf106('0xdf')],_0x8b1803[_0xf106('0x64')]]);if(_0x4b393e['result']===-0x1){return _0x4b393e;}return this[_0xf106('0x34')][_0xf106('0xa5')](util['format'](_0xf106('0x106'),_0xf106('0xdd')));};AGIVertices[_0xf106('0xf')][_0xf106('0x107')]=function(_0x3df6a5){logger['info'](util[_0xf106('0x29')](_0xf106('0x108'),_0x3df6a5[_0xf106('0x36')]));return this['channel'][_0xf106('0xa5')]('finally');};AGIVertices[_0xf106('0xf')][_0xf106('0xc')]=function(_0x2708e5){logger['info'](util[_0xf106('0x29')](_0xf106('0x109'),_0x2708e5[_0xf106('0x36')]));if(_0x2708e5['retry']===0x0){return this['maxRetry'](_0x2708e5);}_0x2708e5[_0xf106('0xa3')]-=0x1;if(!this[_0xf106('0x80')](_0x2708e5[_0xf106('0x10a')])){return this[_0xf106('0x34')][_0xf106('0x50')](_0x2708e5,_0xf106('0x10b'));}var _0x33c3fe=this['getSound'][_0xf106('0xa2')](this,_0x2708e5[_0xf106('0x10a')]);if(!_0x33c3fe){return this[_0xf106('0x34')][_0xf106('0x50')](_0x2708e5,_0xf106('0x10c'));}if(!this[_0xf106('0x80')](_0x2708e5[_0xf106('0xd2')])){return this[_0xf106('0x34')]['error'](_0xf106('0xd1'));}var _0x3d1fde=this[_0xf106('0x34')]['getData'](_0x33c3fe,_0x2708e5[_0xf106('0x10d')],_0x2708e5[_0xf106('0x10e')]);var _0x553d02=_0x3d1fde[_0xf106('0x9d')]?_0x3d1fde[_0xf106('0x9d')][_0xf106('0x4a')]():'';logger[_0xf106('0x2e')](_0xf106('0x10f'),JSON[_0xf106('0x72')](_0x3d1fde));if(_0x3d1fde[_0xf106('0x9d')]===-0x1){this[_0xf106('0x33')]['sync'](this,_0x2708e5,_0x553d02);return _0x3d1fde;}else if(_0x3d1fde['extra']===_0xf106('0x65')){_0x3d1fde[_0xf106('0x9d')]=_0x553d02[_0xf106('0x98')]>=parseInt(_0x2708e5['mindigit'])?'x':'i';}else{_0x3d1fde[_0xf106('0x9d')]=_0x553d02[_0xf106('0x98')]>=parseInt(_0x2708e5[_0xf106('0x110')])&&_0x553d02['length']<=parseInt(_0x2708e5[_0xf106('0x10e')])?'x':'i';}var _0xd0745f=this[_0xf106('0x10')][_0xf106('0xa2')](this,_0x2708e5[_0xf106('0xd2')]);if(!_0xd0745f){return this[_0xf106('0x34')][_0xf106('0x50')](_0x2708e5,_0xf106('0xd3'));}this[_0xf106('0x34')][_0xf106('0xa0')](_0xd0745f,_0x553d02);if(this[_0xf106('0x80')](_0x2708e5[_0xf106('0x111')])){var _0x445a4e=parseInt(_0x2708e5[_0xf106('0x111')],0xa);var _0x35eaf7=rs[_0xf106('0x112')]({'charset':'*','length':_0x445a4e});var _0xdb5396=_0x553d02[_0xf106('0x98')];if(_0xdb5396>0x0){if(_0xdb5396>_0x445a4e){this[_0xf106('0x33')][_0xf106('0xa2')](this,_0x2708e5,_0x2708e5[_0xf106('0x113')]==='first'?_0x35eaf7+_0x553d02['substr'](_0x445a4e):_0x553d02[_0xf106('0x114')](0x0,_0xdb5396-_0x445a4e)+_0x35eaf7);}else{this['createSquareDetailsReport'][_0xf106('0xa2')](this,_0x2708e5,rs[_0xf106('0x112')]({'charset':'*','length':_0xdb5396}));}}else{this[_0xf106('0x33')][_0xf106('0xa2')](this,_0x2708e5,'');}}else{this[_0xf106('0x33')]['sync'](this,_0x2708e5,_0x553d02);}return _0x3d1fde;};AGIVertices[_0xf106('0xf')][_0xf106('0xd')]=function(_0x177e04){logger[_0xf106('0x2e')](util[_0xf106('0x29')](_0xf106('0x115'),_0x177e04[_0xf106('0x36')]));return this['getdigits'](_0x177e04);};AGIVertices['prototype']['goal']=function(_0x3f6b24){logger['info'](util[_0xf106('0x29')](_0xf106('0x116'),_0x3f6b24[_0xf106('0x36')]));this[_0xf106('0x33')]['sync'](this,_0x3f6b24,_0x3f6b24[_0xf106('0x117')]);return this[_0xf106('0x34')]['noop'](util[_0xf106('0x29')](_0xf106('0x118'),_0x3f6b24['goalname']));};AGIVertices[_0xf106('0xf')][_0xf106('0x119')]=function(_0x46c317){logger[_0xf106('0x2e')](util[_0xf106('0x29')](_0xf106('0x11a'),_0x46c317['label']));if(!this[_0xf106('0x80')](_0x46c317['aws_access_key_id'])||!this[_0xf106('0x80')](_0x46c317[_0xf106('0x84')])){return this[_0xf106('0x34')][_0xf106('0xa5')](_0xf106('0x11b'));}if(!this[_0xf106('0x80')](_0x46c317[_0xf106('0x5c')])){return this[_0xf106('0x34')][_0xf106('0xa5')](_0xf106('0xbf'));}this['channel'][_0xf106('0xa5')](util[_0xf106('0x29')](_0xf106('0x11c'),_0x46c317[_0xf106('0x5c')]));var _0xb99d8b=this[_0xf106('0x82')][_0xf106('0xa2')](this,_0x46c317);if(_0xb99d8b){this[_0xf106('0x34')]['noop'](util[_0xf106('0x29')](_0xf106('0x11d'),_0xb99d8b));var _0x1cf5a4=this[_0xf106('0x34')][_0xf106('0xfd')](_0xb99d8b);try{fs[_0xf106('0xfe')](_0xb99d8b+_0xf106('0xff'));}catch(_0x2a7c74){logger[_0xf106('0x50')](_0x2a7c74);}return _0x1cf5a4;}return this[_0xf106('0x34')][_0xf106('0x50')](_0x46c317,_0xf106('0x11e'));};AGIVertices[_0xf106('0xf')][_0xf106('0x11f')]=function(_0x516a77){logger['info'](util[_0xf106('0x29')]('Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block',_0x516a77[_0xf106('0x36')]));if(!this[_0xf106('0x80')](_0x516a77[_0xf106('0x83')])||!this[_0xf106('0x80')](_0x516a77[_0xf106('0x84')])){return this[_0xf106('0x34')][_0xf106('0xa5')]('no\x20valid\x20credentials\x20configured');}if(!this[_0xf106('0x80')](_0x516a77[_0xf106('0x8b')])){return this[_0xf106('0x34')][_0xf106('0xa5')](_0xf106('0x120'));}if(!this['isConfigured'](_0x516a77['text'])){return this[_0xf106('0x34')][_0xf106('0xa5')](_0xf106('0xbf'));}this[_0xf106('0x34')][_0xf106('0xe2')]=!![];this[_0xf106('0x33')](_0x516a77);this[_0xf106('0x40')](_0x516a77[_0xf106('0x5c')],'in','','');this['channel']['noop'](util[_0xf106('0x29')](_0xf106('0x121'),_0x516a77[_0xf106('0x5c')]));var _0x21c9c4=this[_0xf106('0x89')][_0xf106('0xa2')](this,_0x516a77);if(_0x21c9c4){for(var _0x1d02e9 in _0x21c9c4){if(_0x21c9c4[_0xf106('0x91')](_0x1d02e9)&&_[_0xf106('0x92')](_0x21c9c4[_0x1d02e9])){this[_0xf106('0x34')]['setVariable'](util[_0xf106('0x29')]('AWS_LEX_%s',_0x1d02e9[_0xf106('0x69')]()),_0x21c9c4[_0x1d02e9]);}}if(_[_0xf106('0x4e')](_0x21c9c4['message'])){return this['channel'][_0xf106('0xa5')](_0xf106('0x122'));}else{this[_0xf106('0x40')](_0x21c9c4[_0xf106('0x123')],_0xf106('0xe6'),'amazonlex','');return this[_0xf106('0x34')][_0xf106('0xa5')](util['format'](_0xf106('0x124'),_0x21c9c4[_0xf106('0x123')]));}}return this['channel'][_0xf106('0x50')](_0x516a77,_0xf106('0x125'));};AGIVertices[_0xf106('0xf')]['googleasr']=function(_0x3774d4){logger[_0xf106('0x2e')](util[_0xf106('0x29')](_0xf106('0x126'),_0x3774d4[_0xf106('0x36')],_0x3774d4[_0xf106('0x65')]));if(!this['isConfigured'](_0x3774d4[_0xf106('0x77')])){return this[_0xf106('0x34')][_0xf106('0xa5')]('no\x20key\x20configured');}var _0x2928c8=_0xf106('0x127');var _0x5c8136=util[_0xf106('0x29')](_0xf106('0x128'),FILES_PATH,rs[_0xf106('0x112')](0x4));var _0xf192fd=util[_0xf106('0x29')]('%s.%s',_0x5c8136,_0x2928c8);var _0x5e2aa6=!![];if(_0x3774d4[_0xf106('0x129')]===_0xf106('0x12a')){_0x5e2aa6=![];}var _0x40fc16=this[_0xf106('0x34')][_0xf106('0x12b')](_0x5c8136,_0x2928c8,_0x3774d4['intKey'],_0x3774d4[_0xf106('0x65')],undefined,_0x5e2aa6);if(_0x40fc16[_0xf106('0x9d')]!==-0x1){this[_0xf106('0x34')]['noop'](util[_0xf106('0x29')](_0xf106('0x12c'),_0xf192fd));var _0x54fdaa=this[_0xf106('0x8c')][_0xf106('0xa2')](this,_0x3774d4,_0xf192fd);if(_0x54fdaa){for(var _0x34a954 in _0x54fdaa){if(_0x54fdaa[_0xf106('0x91')](_0x34a954)){this[_0xf106('0x34')][_0xf106('0xa0')](util[_0xf106('0x29')](_0xf106('0x12d'),_0x34a954[_0xf106('0x69')]()),_0x54fdaa[_0x34a954]);}}return this['channel'][_0xf106('0xa5')](util[_0xf106('0x29')](_0xf106('0x12e'),JSON[_0xf106('0x72')](_0x54fdaa)));}}return _0x40fc16;};AGIVertices[_0xf106('0xf')]['tildeasr']=function(_0x179491){logger[_0xf106('0x2e')](util['format'](_0xf106('0x12f'),_0x179491[_0xf106('0x36')]));if(!this[_0xf106('0x80')](_0x179491[_0xf106('0x130')])){return this['channel'][_0xf106('0xa5')](_0xf106('0x131'));}if(!this['isConfigured'](_0x179491[_0xf106('0x8f')])){return this[_0xf106('0x34')]['noop']('no\x20appsecret\x20configured');}var _0x113f60=_0xf106('0x127');var _0x441ad4=util[_0xf106('0x29')](_0xf106('0x128'),FILES_PATH,rs['generate'](0x4));var _0x410d30=util[_0xf106('0x29')]('%s.%s',_0x441ad4,_0x113f60);var _0x15be6c=!![];if(_0x179491[_0xf106('0x129')]===_0xf106('0x12a')){_0x15be6c=![];}var _0x109552=this[_0xf106('0x34')][_0xf106('0x12b')](_0x441ad4,_0x113f60,_0x179491['intKey'],_0x179491[_0xf106('0x65')],undefined,_0x15be6c);if(_0x109552[_0xf106('0x9d')]!==-0x1){this['channel']['noop'](util[_0xf106('0x29')](_0xf106('0x132'),_0x410d30));var _0x1b36bd=this[_0xf106('0x8e')][_0xf106('0xa2')](this,_0x179491,_0x410d30);if(_0x1b36bd){for(var _0x4e04f4 in _0x1b36bd){if(_0x1b36bd[_0xf106('0x91')](_0x4e04f4)){this['channel']['setVariable'](util['format'](_0xf106('0x133'),_0x4e04f4[_0xf106('0x69')]()),_0x1b36bd[_0x4e04f4]);}}return this[_0xf106('0x34')][_0xf106('0xa5')](util[_0xf106('0x29')](_0xf106('0x134'),JSON['stringify'](_0x1b36bd)));}}return _0x109552;};AGIVertices['prototype'][_0xf106('0x135')]=function(_0xa76121){logger[_0xf106('0x2e')](util[_0xf106('0x29')](_0xf106('0x136'),_0xa76121[_0xf106('0x36')]));return this[_0xf106('0x34')][_0xf106('0x137')](_0xa76121[_0xf106('0x3b')],_0xa76121[_0xf106('0x138')],_0xa76121[_0xf106('0x3c')]);};AGIVertices[_0xf106('0xf')][_0xf106('0x139')]=function(_0x17fbb9){logger[_0xf106('0x2e')](util[_0xf106('0x29')]('Enter\x20in\x20GOTOIF\x20(%s)\x20block',_0x17fbb9[_0xf106('0x36')]));if(!this['isConfigured'](_0x17fbb9[_0xf106('0x13a')])){return this[_0xf106('0x34')][_0xf106('0x50')](_0x17fbb9,_0xf106('0x13b'));}try{var _0x1b9004=eval(_0x17fbb9[_0xf106('0x13a')])?_0xf106('0x13c'):_0xf106('0x13d');this['channel']['noop'](util['format'](_0xf106('0x13e'),_0x17fbb9[_0xf106('0x13a')],_0x1b9004));return{'code':0xc8,'result':_0x1b9004};}catch(_0x253ca9){return{'code':0xc8,'result':'false'};}};AGIVertices[_0xf106('0xf')]['gotoiftime']=function(_0x184792){logger[_0xf106('0x2e')](util[_0xf106('0x29')](_0xf106('0x13f'),_0x184792['label']));if(!this[_0xf106('0x80')](_0x184792[_0xf106('0x140')])){return this[_0xf106('0x34')]['error'](_0x184792,_0xf106('0x141'));}var _0x58b7de=this[_0xf106('0x24')]['sync'](this,_0x184792['interval_id']);if(!_0x58b7de){return this[_0xf106('0x34')][_0xf106('0x50')](_0x184792,_0xf106('0x142'));}for(var _0x4525dd=0x0;_0x4525dd<_0x58b7de[_0xf106('0x98')];_0x4525dd+=0x1){var _0x26996f=this[_0xf106('0x34')][_0xf106('0x10')](util['format'](_0xf106('0x143'),_0x58b7de[_0x4525dd]));if(_0x26996f[_0xf106('0x9d')]===-0x1){return _0x26996f;}logger[_0xf106('0x2e')](util[_0xf106('0x29')](_0xf106('0x144'),_0x58b7de[_0x4525dd],_0x26996f[_0xf106('0x9f')]));if(_0x26996f[_0xf106('0x9f')]===_0xf106('0x13c')){logger['info'](util[_0xf106('0x29')](_0xf106('0x144'),_0x58b7de[_0x4525dd],_0xf106('0x13c')));this[_0xf106('0x34')][_0xf106('0xa5')](util[_0xf106('0x29')]('IFTIME\x20%s\x20%s',_0x58b7de[_0x4525dd],_0xf106('0x13c')));return{'code':0xc8,'result':_0xf106('0x13c')};}else{logger[_0xf106('0x2e')](util[_0xf106('0x29')](_0xf106('0x144'),_0x58b7de[_0x4525dd],_0xf106('0x13d')));this[_0xf106('0x34')][_0xf106('0xa5')](util['format']('IFTIME\x20%s\x20%s',_0x58b7de[_0x4525dd],_0xf106('0x13d')));}}return{'code':0xc8,'result':_0xf106('0x13d')};};AGIVertices['prototype'][_0xf106('0x145')]=function(_0x5a7a2f){logger[_0xf106('0x2e')](util['format']('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x5a7a2f[_0xf106('0x36')]));return this['channel'][_0xf106('0x145')]();};AGIVertices[_0xf106('0xf')]['ispeechasr']=function(_0x42cc2c){logger['info'](util[_0xf106('0x29')](_0xf106('0x146'),_0x42cc2c[_0xf106('0x36')]));if(!this[_0xf106('0x80')](_0x42cc2c['key'])){return this[_0xf106('0x34')][_0xf106('0xa5')](_0xf106('0x147'));}var _0x434612='wav';var _0x1b5d30=util[_0xf106('0x29')](_0xf106('0x128'),FILES_PATH,rs[_0xf106('0x112')](0x4));var _0x2e2f18=util[_0xf106('0x29')]('%s.%s',_0x1b5d30,_0x434612);var _0x87d1fc=!![];if(_0x42cc2c[_0xf106('0x129')]===_0xf106('0x12a')){_0x87d1fc=![];}var _0x5a1a57=this[_0xf106('0x34')][_0xf106('0x12b')](_0x1b5d30,_0x434612,_0x42cc2c[_0xf106('0x148')],_0x42cc2c[_0xf106('0x65')],undefined,_0x87d1fc);if(_0x5a1a57['result']!==-0x1){this[_0xf106('0x34')][_0xf106('0xa5')](util['format'](_0xf106('0x149'),_0x2e2f18));var _0x41779a=this[_0xf106('0x7e')][_0xf106('0xa2')](this,_0x42cc2c,_0x2e2f18);if(_0x41779a){for(var _0xfd02b7 in _0x41779a){if(_0x41779a[_0xf106('0x91')](_0xfd02b7)){this[_0xf106('0x34')]['setVariable'](util[_0xf106('0x29')](_0xf106('0x14a'),_0xfd02b7[_0xf106('0x69')]()),_0x41779a[_0xfd02b7]);}}return this[_0xf106('0x34')][_0xf106('0xa5')](util[_0xf106('0x29')](_0xf106('0x14b'),JSON[_0xf106('0x72')](_0x41779a)));}}return _0x5a1a57;};AGIVertices['prototype']['ispeechtts']=function(_0x122922){logger[_0xf106('0x2e')](util['format'](_0xf106('0x14c'),_0x122922['label']));if(!this[_0xf106('0x80')](_0x122922[_0xf106('0x77')])){return this['channel'][_0xf106('0xa5')]('no\x20key\x20configured');}if(!this['isConfigured'](_0x122922['text'])){return this[_0xf106('0x34')][_0xf106('0xa5')](_0xf106('0xbf'));}this[_0xf106('0x34')][_0xf106('0xa5')](util[_0xf106('0x29')](_0xf106('0x14d'),_0x122922[_0xf106('0x5c')]));var _0x34b96b=this[_0xf106('0x7c')][_0xf106('0xa2')](this,_0x122922);if(_0x34b96b){this[_0xf106('0x34')]['noop'](util[_0xf106('0x29')](_0xf106('0x149'),_0x34b96b));var _0x300877=this[_0xf106('0x34')][_0xf106('0xfd')](_0x34b96b,_0x122922[_0xf106('0x148')]);try{fs[_0xf106('0xfe')](_0x34b96b+_0xf106('0xff'));}catch(_0x18a3df){logger[_0xf106('0x50')](_0x18a3df);}return _0x300877;}return this['channel'][_0xf106('0x50')](_0x122922,_0xf106('0x14e'));};AGIVertices[_0xf106('0xf')][_0xf106('0x14f')]=function(_0x4ab78d){logger[_0xf106('0x2e')](util['format'](_0xf106('0x150'),_0x4ab78d[_0xf106('0x36')]));if(!this[_0xf106('0x80')](_0x4ab78d[_0xf106('0x151')])){return this[_0xf106('0x34')]['error'](_0x4ab78d,'no\x20find\x20by\x20configured');}logger['info'](util[_0xf106('0x29')](_0xf106('0x152'),this[_0xf106('0x34')][_0xf106('0x39')],_0x4ab78d[_0xf106('0x151')]));var _0x20b964=this[_0xf106('0x52')][_0xf106('0xa2')](this,_0x4ab78d[_0xf106('0x151')]);if(_0x20b964){logger['info'](util[_0xf106('0x29')](_0xf106('0x153'),this[_0xf106('0x34')][_0xf106('0x39')],_0x4ab78d[_0xf106('0x151')]));this[_0xf106('0x34')]['noop'](util['format'](_0xf106('0x153'),this['channel'][_0xf106('0x39')],_0x4ab78d[_0xf106('0x151')]));return{'code':0xc8,'result':_0xf106('0x154')};}else{logger[_0xf106('0x2e')](util[_0xf106('0x29')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0xf106('0x39')],_0x4ab78d[_0xf106('0x151')]));this['channel'][_0xf106('0xa5')](util[_0xf106('0x29')](_0xf106('0x155'),this['channel'][_0xf106('0x39')],_0x4ab78d['findBy']));return{'code':0xc8,'result':_0xf106('0x156')};}};AGIVertices[_0xf106('0xf')]['logout']=function(_0x33dab8){logger['info'](util[_0xf106('0x29')](_0xf106('0x157'),_0x33dab8[_0xf106('0x36')]));if(!this[_0xf106('0x80')](_0x33dab8[_0xf106('0x151')])){return this['channel'][_0xf106('0x50')](_0x33dab8,_0xf106('0x158'));}logger['info'](util[_0xf106('0x29')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this['channel'][_0xf106('0x39')],_0x33dab8[_0xf106('0x151')]));var _0x25e474=this[_0xf106('0x51')][_0xf106('0xa2')](this,_0x33dab8[_0xf106('0x151')]);if(_0x25e474){logger[_0xf106('0x2e')](util[_0xf106('0x29')](_0xf106('0x153'),this[_0xf106('0x34')]['callerid'],_0x33dab8[_0xf106('0x151')]));this[_0xf106('0x34')][_0xf106('0xa5')](util['format'](_0xf106('0x153'),this['channel']['callerid'],_0x33dab8['findBy']));return{'code':0xc8,'result':'success'};}else{logger['info'](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xf106('0x34')][_0xf106('0x39')],_0x33dab8['findBy']));this[_0xf106('0x34')][_0xf106('0xa5')](util[_0xf106('0x29')](_0xf106('0x155'),this['channel'][_0xf106('0x39')],_0x33dab8[_0xf106('0x151')]));return{'code':0xc8,'result':_0xf106('0x156')};}};AGIVertices[_0xf106('0xf')][_0xf106('0x159')]=function(_0x49f461){logger[_0xf106('0x2e')](util['format'](_0xf106('0x15a'),_0x49f461[_0xf106('0x36')]));if(!this[_0xf106('0x80')](_0x49f461[_0xf106('0x15b')])){return this[_0xf106('0x34')][_0xf106('0x50')](_0x49f461,_0xf106('0x15c'));}this[_0xf106('0x34')][_0xf106('0xa5')](util[_0xf106('0x29')](_0xf106('0x15d'),_0x49f461['operation']));var _0x303189=eval(_0x49f461['operation']);if(!this[_0xf106('0x80')](_0x49f461['variable_id'])){return this['channel'][_0xf106('0xa5')](_0xf106('0xd1'));}var _0x64d498=this[_0xf106('0x10')][_0xf106('0xa2')](this,_0x49f461[_0xf106('0xd2')]);if(!_0x64d498){return this[_0xf106('0x34')][_0xf106('0x50')](_0x49f461,_0xf106('0xd3'));}if(_[_0xf106('0x97')](_0x303189)){var _0xaf6973=this;_0x303189['forEach'](function(_0x179c28,_0x29857e){_0xaf6973[_0xf106('0x34')][_0xf106('0xa0')](util[_0xf106('0x29')](_0xf106('0x15e'),_0x64d498,_0x29857e),_0x179c28);});return this[_0xf106('0x34')][_0xf106('0xa5')](util[_0xf106('0x29')](_0xf106('0x15f'),_0x64d498));}else{return this[_0xf106('0x34')]['setVariable'](_0x64d498,_0x303189);}};AGIVertices['prototype'][_0xf106('0x160')]=function(_0x56335b){logger[_0xf106('0x2e')](util[_0xf106('0x29')](_0xf106('0x161'),_0x56335b[_0xf106('0x36')]));if(_0x56335b['retry']===0x0){return this['maxRetry'](_0x56335b);}_0x56335b[_0xf106('0xa3')]-=0x1;if(!this[_0xf106('0x80')](_0x56335b['file_id'])){return this[_0xf106('0x34')][_0xf106('0x50')](_0x56335b,_0xf106('0x10b'));}var _0x4a6c34=this[_0xf106('0x162')]['sync'](this,_0x56335b[_0xf106('0x10a')]);if(!_0x4a6c34){return this['channel'][_0xf106('0x50')](_0x56335b,_0xf106('0x10c'));}var _0x4f4d94=this[_0xf106('0x34')]['getData'](_0x4a6c34,_0x56335b['response'],_0x56335b[_0xf106('0x163')]);var _0x1bcf68=_0x4f4d94[_0xf106('0x9d')];if(_0x4f4d94[_0xf106('0x9d')]===-0x1){this[_0xf106('0x33')][_0xf106('0xa2')](this,_0x56335b,'-1');return _0x4f4d94;}else if(_0x4f4d94[_0xf106('0x9f')]===_0xf106('0x65')){_0x4f4d94[_0xf106('0x9d')]=_0x4f4d94[_0xf106('0x9d')]['length']>0x0?_0x4f4d94[_0xf106('0x9d')]:'t';}else if(_['isEmpty'](_0x4f4d94['result'])){_0x4f4d94['result']='#';_0x1bcf68='#';}if(!this['isConfigured'](_0x56335b['variable_id'])){this[_0xf106('0x34')]['noop']('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0x21d0b9=this[_0xf106('0x10')][_0xf106('0xa2')](this,_0x56335b[_0xf106('0xd2')]);if(!_0x21d0b9){return this[_0xf106('0x34')][_0xf106('0x50')](_0x56335b,_0xf106('0xd3'));}this[_0xf106('0x34')]['setVariable'](_0x21d0b9,_0x1bcf68);}this[_0xf106('0x33')][_0xf106('0xa2')](this,_0x56335b,_0x1bcf68);return _0x4f4d94;};AGIVertices[_0xf106('0xf')][_0xf106('0xa5')]=function(_0x45c756){logger['info'](util[_0xf106('0x29')](_0xf106('0x164'),_0x45c756['label']));return this[_0xf106('0x34')][_0xf106('0xa5')](_0x45c756['output']||_0x45c756[_0xf106('0x36')]);};AGIVertices[_0xf106('0xf')][_0xf106('0x165')]=function(_0x2086d4){logger[_0xf106('0x2e')](util['format']('Enter\x20in\x20PAUSE\x20(%s)\x20block',_0x2086d4[_0xf106('0x36')]));if(!this[_0xf106('0x80')](_0x2086d4['findBy'])){return this[_0xf106('0x34')]['error'](_0x2086d4,_0xf106('0x158'));}logger['info'](util[_0xf106('0x29')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xf106('0x34')][_0xf106('0x39')],_0x2086d4[_0xf106('0x151')]));var _0x2a4da8=this[_0xf106('0x166')][_0xf106('0xa2')](this,_0x2086d4[_0xf106('0x167')]);var _0x27f51c=this['agentPause'][_0xf106('0xa2')](this,_0x2086d4[_0xf106('0x151')],_0x2a4da8);if(_0x27f51c){logger[_0xf106('0x2e')](util['format'](_0xf106('0x153'),this[_0xf106('0x34')]['callerid'],_0x2086d4[_0xf106('0x151')]));this[_0xf106('0x34')][_0xf106('0xa5')](util[_0xf106('0x29')](_0xf106('0x153'),this[_0xf106('0x34')][_0xf106('0x39')],_0x2086d4[_0xf106('0x151')]));return{'code':0xc8,'result':_0xf106('0x154')};}else{logger[_0xf106('0x2e')](util[_0xf106('0x29')](_0xf106('0x155'),this[_0xf106('0x34')][_0xf106('0x39')],_0x2086d4['findBy']));this['channel'][_0xf106('0xa5')](util['format'](_0xf106('0x153'),this[_0xf106('0x34')][_0xf106('0x39')],_0x2086d4[_0xf106('0x151')]));return{'code':0xc8,'result':_0xf106('0x156')};}};AGIVertices[_0xf106('0xf')][_0xf106('0x168')]=function(_0x22c026){logger[_0xf106('0x2e')](util[_0xf106('0x29')](_0xf106('0x169'),_0x22c026[_0xf106('0x36')]));if(!this['isConfigured'](_0x22c026['file_id'])){return this[_0xf106('0x34')][_0xf106('0x50')](_0x22c026,_0xf106('0x10b'));}var _0x4b3008=this[_0xf106('0x162')][_0xf106('0xa2')](this,_0x22c026['file_id']);if(!_0x4b3008){return this[_0xf106('0x34')]['error'](_0x22c026,_0xf106('0x10c'));}var _0x2a1eb8=this[_0xf106('0x34')][_0xf106('0x56')](_0xf106('0x16a'),[_0x4b3008,_0x22c026['opts']]);if(_0x2a1eb8['result']===-0x1){return _0x2a1eb8;}return this[_0xf106('0x34')]['noop'](util[_0xf106('0x29')](_0xf106('0xbc'),_0xf106('0x16a'),_0x4b3008));};AGIVertices[_0xf106('0xf')]['queue']=function(_0x1d557c){logger[_0xf106('0x2e')](util[_0xf106('0x29')]('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x1d557c[_0xf106('0x36')]));if(!this['isConfigured'](_0x1d557c[_0xf106('0x16b')])){return this['channel']['error'](_0x1d557c,'no\x20queue\x20selected');}var _0x49fe5e='';var _0xcbe8bf=parseInt(_0x1d557c[_0xf106('0x16b')],0xa);if(isNaN(_0xcbe8bf)){_0x49fe5e=_0x1d557c['queue_id'];}else{_0x49fe5e=this[_0xf106('0x16')][_0xf106('0xa2')](this,_0x1d557c['queue_id']);if(!_0x49fe5e){return this[_0xf106('0x34')][_0xf106('0x50')](_0x1d557c,_0xf106('0x16c'));}}var _0x54eba7='';if(this[_0xf106('0x80')](_0x1d557c[_0xf106('0x10a')])){var _0x4ba8d0=this[_0xf106('0x162')]['sync'](this,_0x1d557c['file_id']);if(_0x4ba8d0){_0x54eba7=_0x4ba8d0;}}this[_0xf106('0x33')][_0xf106('0xa2')](this,_0x1d557c,_0x49fe5e);if(_0x1d557c['opts'][_0xf106('0x16d')]('x')<0x0){_0x1d557c[_0xf106('0xdf')]+='x';}if(_0x1d557c[_0xf106('0xdf')][_0xf106('0x16d')]('X')<0x0){_0x1d557c[_0xf106('0xdf')]+='X';}this['channel'][_0xf106('0xa0')](_0xf106('0x16e'),_0x49fe5e?_0x49fe5e[_0xf106('0x16f')]():'');var _0xfe2f29=this[_0xf106('0x34')][_0xf106('0x56')](_0xf106('0x170'),[_0x49fe5e,_0x1d557c[_0xf106('0xdf')],_0x1d557c[_0xf106('0x64')],_0x54eba7,_0x1d557c['timeout'],_0x1d557c[_0xf106('0x6')],_0x1d557c[_0xf106('0x171')],_0x1d557c[_0xf106('0x172')],'',_0x1d557c[_0xf106('0x173')]]);if(_0xfe2f29[_0xf106('0x9d')]===-0x1){return _0xfe2f29;}return this[_0xf106('0x34')][_0xf106('0xa5')](util['format'](_0xf106('0xbc'),_0xf106('0x170'),_0x49fe5e));};AGIVertices['prototype'][_0xf106('0x174')]=function(_0x273e28){logger[_0xf106('0x2e')](util['format'](_0xf106('0x175'),_0x273e28[_0xf106('0x36')]));var _0x5ac99c=_0x273e28[_0xf106('0x176')]||_0xf106('0x127');var _0x4deed3=util[_0xf106('0x29')](_0xf106('0x177'),this[_0xf106('0x34')][_0xf106('0x35')],rs[_0xf106('0x112')](0x5));var _0x54fa82=util[_0xf106('0x29')](_0xf106('0x178'),FILES_PATH,_0x4deed3,_0x5ac99c);var _0x1ec2e8=util[_0xf106('0x29')](_0xf106('0x128'),FILES_PATH,_0x4deed3);this[_0xf106('0x3a')][_0xf106('0xa2')](this,_0x273e28,_0x4deed3,_0x54fa82);this[_0xf106('0x34')][_0xf106('0xa0')](_0xf106('0x179'),_0x4deed3);logger[_0xf106('0x2e')](_0xf106('0x17a'),_0x1ec2e8,_0x5ac99c,_0x273e28['escape_digits'],_0x273e28[_0xf106('0x65')]);return this[_0xf106('0x34')][_0xf106('0x12b')](_0x1ec2e8,_0x5ac99c,_0x273e28[_0xf106('0x17b')],_0x273e28['timeout'],undefined,!![]);};AGIVertices[_0xf106('0xf')][_0xf106('0x17c')]=function(_0x182a79){logger[_0xf106('0x2e')](util['format']('Enter\x20in\x20RESTAPI\x20(%s)\x20block',_0x182a79['label']));if(!this[_0xf106('0x80')](_0x182a79[_0xf106('0x64')])){return this[_0xf106('0x34')][_0xf106('0xa5')](_0xf106('0x17d'));}var _0x26b883=this['restAPI']['sync'](this,_0x182a79);logger[_0xf106('0x2e')](util[_0xf106('0x29')](_0xf106('0x17e'),util[_0xf106('0x17f')](_0x26b883,{'showHidden':![],'depth':null})));if(!this[_0xf106('0x80')](_0x182a79[_0xf106('0xd2')])){return this[_0xf106('0x34')]['noop']('no\x20variable\x20selected\x20for\x20the\x20response');}var _0x277f59=this[_0xf106('0x10')][_0xf106('0xa2')](this,_0x182a79[_0xf106('0xd2')]);if(!_0x277f59){return this[_0xf106('0x34')][_0xf106('0x50')](_0x182a79,_0xf106('0xd3'));}this[_0xf106('0x34')][_0xf106('0xa0')](util[_0xf106('0x29')](_0xf106('0x180'),_0x277f59),_0x26b883[_0xf106('0x74')]?_0x26b883[_0xf106('0x74')]:'200');this[_0xf106('0x34')][_0xf106('0xa0')](util[_0xf106('0x29')]('%s_STATUS_MESSAGE',_0x277f59),_0x26b883[_0xf106('0x181')]?_0x26b883[_0xf106('0x181')]:'OK');if(_0x26b883[_0xf106('0x6a')]){try{this[_0xf106('0x99')](_0x26b883[_0xf106('0x6a')],_0x277f59);}catch(_0x5ac698){logger[_0xf106('0x50')](util[_0xf106('0x29')](_0xf106('0x182'),_0x277f59));}}return this[_0xf106('0x34')][_0xf106('0xa5')](util[_0xf106('0x29')]('variable\x20%s\x20set',_0x277f59));};AGIVertices[_0xf106('0xf')]['saydigits']=function(_0x2633da){logger[_0xf106('0x2e')](util[_0xf106('0x29')](_0xf106('0x183'),_0x2633da[_0xf106('0x36')]));return this[_0xf106('0x34')][_0xf106('0x184')](_0x2633da['digits'][_0xf106('0x58')](/\s+/g,''),_0x2633da['escape_digits']);};AGIVertices[_0xf106('0xf')][_0xf106('0x185')]=function(_0x505e9f){logger[_0xf106('0x2e')](util[_0xf106('0x29')]('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0x505e9f[_0xf106('0x36')]));return this[_0xf106('0x34')]['sayNumber'](_0x505e9f[_0xf106('0x66')][_0xf106('0x58')](/\s+/g,''),_0x505e9f[_0xf106('0x17b')]);};AGIVertices['prototype']['sayphonetic']=function(_0x3570d5){logger[_0xf106('0x2e')](util['format']('Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block',_0x3570d5[_0xf106('0x36')]));return this[_0xf106('0x34')][_0xf106('0x186')](_0x3570d5['text'],_0x3570d5[_0xf106('0x17b')]);};AGIVertices[_0xf106('0xf')][_0xf106('0x187')]=function(_0x394d76){logger[_0xf106('0x2e')](util[_0xf106('0x29')](_0xf106('0x188'),_0x394d76['label']));if(!this[_0xf106('0x80')](_0x394d76[_0xf106('0x189')])){return this[_0xf106('0x34')][_0xf106('0xa5')](_0xf106('0x18a'));}var _0x5dcc8f=this[_0xf106('0x21')][_0xf106('0xa2')](this,_0x394d76[_0xf106('0x189')]);if(!_0x5dcc8f||!_0x5dcc8f[_0xf106('0x18b')]){return this[_0xf106('0x34')][_0xf106('0x50')](_0x394d76,'no\x20mail\x20account\x20found');}var _0xc6f48c={'from':util['format'](_0xf106('0x18c'),_0x5dcc8f[_0xf106('0x14')],_0x5dcc8f[_0xf106('0x18d')]||_0x5dcc8f['Smtp'][_0xf106('0x18e')]),'to':_0x394d76['to']||'','cc':_0x394d76['cc']||'','bcc':_0x394d76[_0xf106('0x18f')]||'','subject':_0x394d76[_0xf106('0x190')],'html':_0x394d76[_0xf106('0x5c')],'text':_0x394d76['text']};if(this['isConfigured'](_0x394d76[_0xf106('0x191')])){}logger[_0xf106('0xd8')](_0xf106('0x192'),JSON[_0xf106('0x72')](_0xc6f48c));this[_0xf106('0x33')][_0xf106('0xa2')](this,_0x394d76,_0x394d76[_0xf106('0x189')]);this[_0xf106('0x34')]['noop'](util[_0xf106('0x29')](_0xf106('0x193'),_0x5dcc8f['name']));this['sendMailMessage']['sync'](this,_0x5dcc8f[_0xf106('0x194')],_0xc6f48c);return this['channel']['noop'](_0xf106('0x195'));};AGIVertices[_0xf106('0xf')][_0xf106('0x196')]=function(_0x29ce86){logger[_0xf106('0x2e')](util[_0xf106('0x29')](_0xf106('0x197'),_0x29ce86[_0xf106('0x36')]));return this[_0xf106('0x34')][_0xf106('0xa5')](_0xf106('0x198'));};AGIVertices[_0xf106('0xf')][_0xf106('0x199')]=function(_0x192511){logger[_0xf106('0x2e')](util[_0xf106('0x29')](_0xf106('0x19a'),_0x192511[_0xf106('0x36')]));if(!this[_0xf106('0x80')](_0x192511[_0xf106('0x19b')])){return this[_0xf106('0x34')][_0xf106('0xa5')](_0xf106('0x19c'));}var _0x2c9338=this['getSmsAccount'][_0xf106('0xa2')](this,_0x192511[_0xf106('0x19b')]);if(!_0x2c9338){return this[_0xf106('0x34')][_0xf106('0x50')](_0x192511,_0xf106('0x19d'));}var _0x442292={'body':_0x192511[_0xf106('0x19e')],'phone':_0x192511['to']||'','SmsAccountId':_0x2c9338['id']};logger[_0xf106('0xd8')]('sendSMS\x20message',JSON['stringify'](_0x442292));this[_0xf106('0x33')][_0xf106('0xa2')](this,_0x192511,_0x192511[_0xf106('0x19b')]);this[_0xf106('0x34')][_0xf106('0xa5')](util[_0xf106('0x29')](_0xf106('0x19f'),_0x2c9338['name']));this['createSmsMessage'][_0xf106('0xa2')](this,_0x442292);return this[_0xf106('0x34')][_0xf106('0xa5')](_0xf106('0x1a0'));};AGIVertices[_0xf106('0xf')][_0xf106('0x1a1')]=function(_0x18582a){logger[_0xf106('0x2e')](util['format'](_0xf106('0x1a2'),_0x18582a['label']));if(!this[_0xf106('0x80')](_0x18582a[_0xf106('0xd2')])){return this[_0xf106('0x34')][_0xf106('0x50')](_0x18582a,_0xf106('0x1a3'));}var _0x106d0a=this[_0xf106('0x10')][_0xf106('0xa2')](this,_0x18582a['variable_id']);if(!_0x106d0a){return this[_0xf106('0x34')]['error'](_0x18582a,_0xf106('0xd3'));}return this[_0xf106('0x34')][_0xf106('0xa0')](_0x106d0a,_0x18582a[_0xf106('0x1a4')]);};AGIVertices['prototype'][_0xf106('0x1a5')]=function(_0x42f41c){logger[_0xf106('0x2e')](util[_0xf106('0x29')](_0xf106('0x1a6'),_0x42f41c[_0xf106('0x36')]));this['channel'][_0xf106('0xa5')](_0xf106('0x1a7'));var _0x3d1c45=this[_0xf106('0x34')][_0xf106('0x10')](_0xf106('0x1a8'));if(!_['isEmpty'](_0x3d1c45[_0xf106('0x9f')])){this[_0xf106('0x34')][_0xf106('0x35')]=_0x3d1c45['extra'];}if(_0x42f41c['answer']===_0xf106('0x1a9')){this[_0xf106('0x34')][_0xf106('0xa5')](_0xf106('0x1aa'));return this[_0xf106('0x34')][_0xf106('0xb4')]();}return this['channel'][_0xf106('0xa5')](_0xf106('0x1ab'));};AGIVertices[_0xf106('0xf')][_0xf106('0x1ac')]=function(_0x1d2e47){logger[_0xf106('0x2e')](util[_0xf106('0x29')](_0xf106('0x1ad'),_0x1d2e47['label']));if(!this[_0xf106('0x80')](_0x1d2e47['project_id'])){return this['channel']['error'](_0x1d2e47,'no\x20subproject\x20selected');}var _0x20b7a0=this[_0xf106('0x18')][_0xf106('0xa2')](this,_0x1d2e47[_0xf106('0x1ae')]);if(!this[_0xf106('0x80')](_0x20b7a0)){return this[_0xf106('0x34')][_0xf106('0x50')](_0x1d2e47,util[_0xf106('0x29')]('no\x20subproject\x20found\x20with\x20id\x20%d',_0x1d2e47[_0xf106('0x1ae')]));}if(_0x20b7a0===this[_0xf106('0x34')][_0xf106('0x38')]){return this[_0xf106('0x34')][_0xf106('0x50')](_0x1d2e47,'project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project');}this[_0xf106('0x33')][_0xf106('0xa2')](this,_0x1d2e47,_0x20b7a0);var _0xb3be6e=this[_0xf106('0x34')][_0xf106('0x56')]('AGI',util[_0xf106('0x29')]('agi://%s/square,\x22%s\x22,\x22%s\x22',config['agi'][_0xf106('0x1af')]||'127.0.0.1',_0x20b7a0,this[_0xf106('0x34')]['arg_1']));if(_0xb3be6e[_0xf106('0x9d')]===-0x1){return _0xb3be6e;}return this[_0xf106('0x34')]['noop'](util[_0xf106('0x29')]('Executed\x20command\x20%s\x20%s','AGI',_0x20b7a0));};AGIVertices[_0xf106('0xf')]['system']=function(_0x4f3ddc){logger[_0xf106('0x2e')](util['format'](_0xf106('0x1b0'),_0x4f3ddc['label']));var _0x5afaed=this[_0xf106('0x55')][_0xf106('0xa2')](this,_0x4f3ddc[_0xf106('0xb2')]);this[_0xf106('0x33')][_0xf106('0xa2')](this,_0x4f3ddc,_0x4f3ddc[_0xf106('0xb2')]);if(this[_0xf106('0x80')](_0x4f3ddc[_0xf106('0xd2')])){var _0x1b5b8a=this['getVariable'][_0xf106('0xa2')](this,_0x4f3ddc[_0xf106('0xd2')]);if(_0x1b5b8a){this['channel'][_0xf106('0xa0')](_0x1b5b8a,_0x5afaed);return this[_0xf106('0x34')]['noop'](util['format'](_0xf106('0x1b1'),_0x4f3ddc[_0xf106('0xb2')],_0x1b5b8a));}}return this[_0xf106('0x34')][_0xf106('0xa5')](util[_0xf106('0x29')]('sh\x20command:\x20%s\x20result\x20no\x20stored',_0x4f3ddc[_0xf106('0xb2')]));};AGIVertices[_0xf106('0xf')]['google_cloud_tts']=function(_0x347580){logger[_0xf106('0x2e')](util[_0xf106('0x29')](_0xf106('0x1b2'),_0x347580[_0xf106('0x36')]));_0x347580[_0xf106('0x5c')]=_0x347580[_0xf106('0x5c')][_0xf106('0x58')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xf106('0x80')](_0x347580['apiKey'])){return this[_0xf106('0x34')]['noop'](_0xf106('0x1b3'));}if(!this[_0xf106('0x80')](_0x347580[_0xf106('0x5c')])){return this[_0xf106('0x34')][_0xf106('0xa5')](_0xf106('0xbf'));}this[_0xf106('0x34')]['noop'](util[_0xf106('0x29')](_0xf106('0x1b4'),_0x347580['text']));var _0x5ba4e1=this[_0xf106('0x59')]['sync'](this,_0x347580);if(_0x5ba4e1){this[_0xf106('0x34')][_0xf106('0xa5')](util[_0xf106('0x29')](_0xf106('0x1b5'),_0x5ba4e1));var _0x352732=this[_0xf106('0x34')]['streamFile'](_0x5ba4e1);try{fs[_0xf106('0xfe')](_0x5ba4e1+'.wav');}catch(_0x5b28b3){logger['error'](_0x5b28b3);}return _0x352732;}return this['channel']['error'](_0x347580,_0xf106('0x1b6'));};AGIVertices['prototype'][_0xf106('0x1b7')]=function(_0x145ea2){logger[_0xf106('0x2e')](util[_0xf106('0x29')](_0xf106('0x1b8'),_0x145ea2['label']));_0x145ea2[_0xf106('0x5c')]=_0x145ea2[_0xf106('0x5c')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x145ea2[_0xf106('0x5c')])){return this[_0xf106('0x34')]['noop'](_0xf106('0xbf'));}this[_0xf106('0x34')][_0xf106('0xa5')](util[_0xf106('0x29')](_0xf106('0x1b9'),_0x145ea2['text']));var _0x416e3f=this[_0xf106('0x62')][_0xf106('0xa2')](this,_0x145ea2);if(_0x416e3f){this[_0xf106('0x34')]['noop'](util[_0xf106('0x29')](_0xf106('0x1ba'),_0x416e3f));var _0x358227=this[_0xf106('0x34')]['streamFile'](_0x416e3f);try{fs[_0xf106('0xfe')](_0x416e3f+_0xf106('0xff'));}catch(_0x489df3){logger['error'](_0x489df3);}return _0x358227;}return this[_0xf106('0x34')]['error'](_0x145ea2,_0xf106('0x1bb'));};AGIVertices[_0xf106('0xf')][_0xf106('0x1bc')]=function(_0x2dd247){logger[_0xf106('0x2e')](util[_0xf106('0x29')]('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0x2dd247[_0xf106('0x36')]));if(!this['isConfigured'](_0x2dd247[_0xf106('0x151')])){return this[_0xf106('0x34')][_0xf106('0x50')](_0x2dd247,_0xf106('0x158'));}logger[_0xf106('0x2e')](util[_0xf106('0x29')](_0xf106('0x152'),this['channel'][_0xf106('0x39')],_0x2dd247[_0xf106('0x151')]));var _0x91cd9c=this[_0xf106('0x4f')][_0xf106('0xa2')](this,_0x2dd247[_0xf106('0x151')]);if(_0x91cd9c){logger[_0xf106('0x2e')](util['format'](_0xf106('0x153'),this[_0xf106('0x34')][_0xf106('0x39')],_0x2dd247[_0xf106('0x151')]));this[_0xf106('0x34')]['noop'](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0xf106('0x34')]['callerid'],_0x2dd247['findBy']));return{'code':0xc8,'result':_0xf106('0x154')};}else{logger[_0xf106('0x2e')](util[_0xf106('0x29')](_0xf106('0x155'),this['channel'][_0xf106('0x39')],_0x2dd247[_0xf106('0x151')]));this[_0xf106('0x34')][_0xf106('0xa5')](util[_0xf106('0x29')](_0xf106('0x155'),this[_0xf106('0x34')][_0xf106('0x39')],_0x2dd247[_0xf106('0x151')]));return{'code':0xc8,'result':_0xf106('0x156')};}};AGIVertices[_0xf106('0xf')][_0xf106('0x1bd')]=function(_0x12d758){logger[_0xf106('0x2e')](util[_0xf106('0x29')](_0xf106('0x1be'),_0x12d758['label']));var _0x2f714f=this[_0xf106('0x34')][_0xf106('0x56')](_0xf106('0x1bf'),[_0x12d758[_0xf106('0x1c0')],_0x12d758[_0xf106('0x76')]]);if(_0x2f714f[_0xf106('0x9d')]===-0x1){return _0x2f714f;}return this[_0xf106('0x34')][_0xf106('0xa5')](util[_0xf106('0x29')]('Executed\x20command\x20%s\x20%s','VOICEMAIL',_0x12d758[_0xf106('0x1c0')]));};AGIVertices['prototype'][_0xf106('0x1c1')]=function(_0x52c7b0){logger[_0xf106('0x2e')](util['format'](_0xf106('0x1c2'),_0x52c7b0[_0xf106('0x36')]));if(!this[_0xf106('0x80')](_0x52c7b0[_0xf106('0xd2')])){return this['channel'][_0xf106('0x50')](_0x52c7b0,_0xf106('0x1a3'));}var _0x57f92b=this['getVariable']['sync'](this,_0x52c7b0[_0xf106('0xd2')]);if(!_0x57f92b){return this['channel']['error'](_0x52c7b0,'no\x20variable\x20found');}var _0x2e6176=this[_0xf106('0x34')]['getVariable'](_0x57f92b);return{'code':0xc8,'result':_0x2e6176[_0xf106('0x9f')]?_0x2e6176[_0xf106('0x9f')]:'-'};};String[_0xf106('0xf')]['replaceAll']=function(_0x30bba8,_0x4d0d53){return this[_0xf106('0x9b')](_0x30bba8)[_0xf106('0x1c3')](_0x4d0d53);};module[_0xf106('0x1c4')]=AGIVertices; \ No newline at end of file +var _0xbd50=['uniqueid','calleridname','context','extension','priority','accountcode','dnid','arg_1','file','createSquareMessage','createCmContact','isNil','isEmpty','lastName','phone','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','LOCAL','shellCommand','exec','replace','apiKey','text','languageCode','en-US','ssmlGender','MALE','audioEncoding','MP3','googleTTS','google_tts_language','restAPI','url','timeout','includes','POST','PUT','toUpperCase','body','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','computedVariables','sync','uri','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','speed','ispeechASR','ispeech_asr_language','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_lex_region','googleASR','tildeASR','appid','appsecret','clear','agicommand','clone','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isPlainObject','isArray','saveRestApiResult','%s.%s','length','split','replaceAll','getVariable','extra','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','setVariable','isConfigured','maxRetry','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','label','noop','no\x20text\x20configured','MRCPSynth','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','Executed\x20command\x20MRCPRecog\x20%s','agi','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','list_id','no\x20list\x20selected','delay','add','minutes','callback_priority','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','Executed\x20command\x20%s\x20%s','application','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','Executed\x20command\x20MRCPSynth\x20%s','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','no\x20grammar\x20configured','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','no\x20database\x20selected','odbc_id','query','no\x20query\x20configured','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20found','DIAL','SIP/%s','dialogflow','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20private_key\x20configured','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','dialogflowV2','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','no\x20ndauth\x20url\x20configured','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','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','getTrunk','no\x20trunk\x20found','trunk_name','SIP/%s/%s','opts','Executed\x20command\x20%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','getData','response','test','mindigit','maxdigit','hiddendigitsnum','generate','hiddendigitspos','first','substr','getsecretdigits','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','awspolly','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','unlink','.wav','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','aws_bot_name','no\x20bot\x20name\x20configured','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','beep','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','no\x20appid\x20configured','no\x20appsecret\x20configured','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','gotoif','condition','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','interval_id','no\x20interval\x20configured','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20%s\x20file\x20created','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','success','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','math\x20%s','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','PLAYBACK','no\x20queue\x20selected','queue_id','indexOf','XMCS-QUEUE','QUEUE','macro','gosub','position','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','escape_digits','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','statusCode','200','%s_STATUS_MESSAGE','statusMessage','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','smtpOptions','Mail\x20message\x20added\x20to\x20outgoing\x20process','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','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','no\x20variable\x20selected','start','Enter\x20in\x20START\x20(%s)\x20block','yes','Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','project_id','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','voicemail','VOICEMAIL','mailbox','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','exports','util','lodash','shelljs','randomstring','moment','mustache','request-promise','../../config/logger','/var/opt/motion2/server/files','rawHeaders','rawBody','menu','getdigits','channel','mailRpc','prototype','getVariableById','then','catch','getVoiceQueue','rpc','getVoiceQueueById','name','getSquareProject','getSquareProjectById','getSquareOdbc','getSquareOdbcById','getUser','getUserById','getTrunkById','getSound','getSoundById','getSoundPath','save_name','getMailAccount','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','map','Intervals','format','%s/sounds/converted/%s','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','callerid','createSquareRecording'];(function(_0x2eefeb,_0x2924c2){var _0x522442=function(_0x2c99e4){while(--_0x2c99e4){_0x2eefeb['push'](_0x2eefeb['shift']());}};_0x522442(++_0x2924c2);}(_0xbd50,0x196));var _0x0bd5=function(_0x192de5,_0x48058f){_0x192de5=_0x192de5-0x0;var _0x2ec949=_0xbd50[_0x192de5];return _0x2ec949;};'use strict';var fs=require('fs');var util=require(_0x0bd5('0x0'));var _=require(_0x0bd5('0x1'));var sh=require(_0x0bd5('0x2'));var odbc=require('odbc')();var rs=require(_0x0bd5('0x3'));var moment=require(_0x0bd5('0x4'));var Mustache=require(_0x0bd5('0x5'));var rp=require(_0x0bd5('0x6'));var logger=require(_0x0bd5('0x7'))('agi');var config=require('../../config/environment');var scripts=require('./scripts');var FILES_PATH=_0x0bd5('0x8');var recursiveMapAttributes=[_0x0bd5('0x9'),_0x0bd5('0xa')];var verticesWithRetry=[_0x0bd5('0xb'),_0x0bd5('0xc'),'getsecretdigits'];var AGIVertices=function(_0x47e78d,_0x1a5cb9,_0x25e31e){this[_0x0bd5('0xd')]=_0x47e78d;this['rpc']=_0x1a5cb9;this[_0x0bd5('0xe')]=_0x25e31e;};AGIVertices[_0x0bd5('0xf')]['getVariable']=function(_0x210f45,_0x7db86e){this['rpc'][_0x0bd5('0x10')](_0x210f45)[_0x0bd5('0x11')](function(_0x1aa818){_0x7db86e(null,_0x1aa818?_0x1aa818['name']:![]);})[_0x0bd5('0x12')](function(_0x23982f){_0x7db86e(_0x23982f);});};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x13')]=function(_0xfa1eed,_0x557be0){this[_0x0bd5('0x14')][_0x0bd5('0x15')](_0xfa1eed)['then'](function(_0x78f9b8){_0x557be0(null,_0x78f9b8?_0x78f9b8[_0x0bd5('0x16')]:![]);})['catch'](function(_0x31349f){_0x557be0(_0x31349f);});};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x17')]=function(_0xc22553,_0x55d565){this[_0x0bd5('0x14')][_0x0bd5('0x18')](_0xc22553)[_0x0bd5('0x11')](function(_0x277b32){_0x55d565(null,_0x277b32?_0x277b32[_0x0bd5('0x16')]:![]);})[_0x0bd5('0x12')](function(_0xc58e12){_0x55d565(_0xc58e12);});};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x19')]=function(_0x20c667,_0x27bc1e){this[_0x0bd5('0x14')][_0x0bd5('0x1a')](_0x20c667)[_0x0bd5('0x11')](function(_0x527c37){_0x27bc1e(null,_0x527c37?_0x527c37['dsn']:![]);})['catch'](function(_0x4ed64e){_0x27bc1e(_0x4ed64e);});};AGIVertices['prototype'][_0x0bd5('0x1b')]=function(_0x86381d,_0x13ce46){this[_0x0bd5('0x14')][_0x0bd5('0x1c')](_0x86381d)['then'](function(_0x440f85){_0x13ce46(null,_0x440f85?_0x440f85[_0x0bd5('0x16')]:![]);})[_0x0bd5('0x12')](function(_0x5a8139){_0x13ce46(_0x5a8139);});};AGIVertices[_0x0bd5('0xf')]['getTrunk']=function(_0x4969e6,_0x14c319){this[_0x0bd5('0x14')][_0x0bd5('0x1d')](_0x4969e6)['then'](function(_0x42428c){_0x14c319(null,_0x42428c?_0x42428c['name']:![]);})[_0x0bd5('0x12')](function(_0x3ffb08){_0x14c319(_0x3ffb08);});};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x1e')]=function(_0x3ff237,_0x2023d5){var _0x19bb5e=this;this[_0x0bd5('0x14')][_0x0bd5('0x1f')](_0x3ff237)[_0x0bd5('0x11')](function(_0x15561b){_0x2023d5(null,_0x15561b?_0x19bb5e[_0x0bd5('0x20')](_0x15561b[_0x0bd5('0x21')]):![]);})[_0x0bd5('0x12')](function(_0x5e5a33){_0x2023d5(_0x5e5a33);});};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x22')]=function(_0x4c799f,_0x20e6c3){this[_0x0bd5('0x14')]['getMailAccountById'](_0x4c799f)[_0x0bd5('0x11')](function(_0x1b7cf4){_0x20e6c3(null,_0x1b7cf4?_0x1b7cf4:![]);})[_0x0bd5('0x12')](function(_0x25a35b){_0x20e6c3(_0x25a35b);});};AGIVertices['prototype'][_0x0bd5('0x23')]=function(_0x366e8c,_0x622d46,_0x24ef4a){this[_0x0bd5('0xe')][_0x0bd5('0x23')](_0x366e8c,_0x622d46)['then'](function(){_0x24ef4a(null);})[_0x0bd5('0x12')](function(_0x589ea2){_0x24ef4a(_0x589ea2);});};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x24')]=function(_0x444ddb,_0x132e02){this[_0x0bd5('0x14')][_0x0bd5('0x25')](_0x444ddb)[_0x0bd5('0x11')](function(_0x24f7d5){if(_0x24f7d5){if(_0x24f7d5[_0x0bd5('0x26')]){_0x132e02(null,[_0x24f7d5[_0x0bd5('0x27')]]);}else{_0x132e02(null,_[_0x0bd5('0x28')](_0x24f7d5[_0x0bd5('0x29')],_0x0bd5('0x27')));}}else{_0x132e02(null,![]);}})['catch'](function(_0x3e153a){_0x132e02(_0x3e153a);});};AGIVertices[_0x0bd5('0xf')]['getSoundPath']=function(_0x50b9ce){return util[_0x0bd5('0x2a')](_0x0bd5('0x2b'),FILES_PATH,_0x50b9ce);};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x2c')]=function(_0x1dd2e1,_0x387e24,_0x22c10c){odbc[_0x0bd5('0x2d')](_0x1dd2e1,function(_0x44b2ce){if(_0x44b2ce){logger[_0x0bd5('0x2e')](_0x0bd5('0x2f'),_0x44b2ce);_0x22c10c(_0x44b2ce);}else{logger[_0x0bd5('0x30')](_0x0bd5('0x31'));odbc['query'](_0x387e24,function(_0x109f54,_0x5b915c){if(_0x109f54){logger[_0x0bd5('0x30')](_0x0bd5('0x32'),_0x387e24);_0x22c10c(_0x109f54);}else{logger[_0x0bd5('0x30')](_0x0bd5('0x33'),_0x387e24);odbc[_0x0bd5('0x34')](function(_0x18e408){if(_0x18e408){logger['error'](_0x0bd5('0x35'),_0x18e408);}_0x22c10c(null,_0x5b915c);});}});}});};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x36')]=function(_0x1a9dda,_0x1c73be){this[_0x0bd5('0x14')][_0x0bd5('0x37')](_0x1a9dda)[_0x0bd5('0x11')](function(_0x1c2ef8){_0x1c73be(null,_0x1c2ef8?_0x1c2ef8:![]);})['catch'](function(_0x177aa3){_0x1c73be(_0x177aa3);});};AGIVertices['prototype'][_0x0bd5('0x38')]=function(_0xc17464,_0x480b8b){this[_0x0bd5('0x14')][_0x0bd5('0x38')](_0xc17464)[_0x0bd5('0x11')](function(_0x3ec4b0){_0x480b8b(null,_0x3ec4b0);})[_0x0bd5('0x12')](function(_0x1a8d55){_0x480b8b(_0x1a8d55);});};AGIVertices[_0x0bd5('0xf')]['createSquareDetailsReport']=function(_0x4d3ca5,_0x994f24,_0x545b63){this['rpc'][_0x0bd5('0x39')]({'uniqueid':this[_0x0bd5('0xd')]['uniqueid'],'node':_0x4d3ca5['label'],'application':_0x4d3ca5['agicommand'],'data':_0x994f24||null,'project_name':this[_0x0bd5('0xd')]['arg_1'],'callerid':this['channel'][_0x0bd5('0x3a')]})[_0x0bd5('0x11')](function(_0x49e46a){if(_0x545b63){_0x545b63(null,_0x49e46a);}})['catch'](function(_0xb46d84){if(_0x545b63){_0x545b63(_0xb46d84);}});};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x3b')]=function(_0xa36962,_0x56a702,_0x290342,_0x44f485){this[_0x0bd5('0x14')][_0x0bd5('0x3b')]({'uniqueid':this[_0x0bd5('0xd')][_0x0bd5('0x3c')],'callerid':this['channel'][_0x0bd5('0x3a')],'calleridname':this[_0x0bd5('0xd')][_0x0bd5('0x3d')],'context':this['channel'][_0x0bd5('0x3e')],'extension':this[_0x0bd5('0xd')][_0x0bd5('0x3f')],'priority':this['channel'][_0x0bd5('0x40')],'accountcode':this[_0x0bd5('0xd')][_0x0bd5('0x41')],'dnid':this[_0x0bd5('0xd')][_0x0bd5('0x42')],'projectName':this['channel'][_0x0bd5('0x43')],'saveName':_0x56a702,'filename':_0xa36962[_0x0bd5('0x44')]||_0x56a702,'savePath':_0x290342})['then'](function(_0x2db9b0){_0x44f485(null,_0x2db9b0);})[_0x0bd5('0x12')](function(_0x146bdc){_0x44f485(_0x146bdc);});};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x45')]=function(_0x508aa8,_0x109793,_0x128df9,_0x5cd889,_0x70d7ce){this['rpc'][_0x0bd5('0x45')]({'uniqueid':this[_0x0bd5('0xd')][_0x0bd5('0x3c')],'body':_0x508aa8,'direction':_0x109793,'providerName':_0x128df9,'providerResponse':_0x5cd889})[_0x0bd5('0x11')](function(_0x5f54bb){if(_0x70d7ce){_0x70d7ce(null,_0x5f54bb);}})[_0x0bd5('0x12')](function(_0x4cb674){if(_0x70d7ce){_0x70d7ce(_0x4cb674);}});};AGIVertices['prototype'][_0x0bd5('0x46')]=function(_0x1b473f,_0x172393){this['rpc'][_0x0bd5('0x46')]({'firstName':_['isEmpty'](_0x1b473f[_0x0bd5('0x16')])||_[_0x0bd5('0x47')](_0x1b473f[_0x0bd5('0x16')])?'callback_'+Math['random']():_0x1b473f['name'],'lastName':_[_0x0bd5('0x48')](_0x1b473f[_0x0bd5('0x49')])||_[_0x0bd5('0x47')](_0x1b473f['lastName'])?null:_0x1b473f[_0x0bd5('0x49')],'phone':_0x1b473f[_0x0bd5('0x4a')],'ListId':_0x1b473f['list_id'],'scheduledat':_0x1b473f[_0x0bd5('0x4b')],'callbackUniqueid':this['channel']['uniqueid'],'tags':_0x0bd5('0x4c'),'description':_0x0bd5('0x4d')+_0x1b473f[_0x0bd5('0x4b')][_0x0bd5('0x4e')](),'priority':_0x1b473f['callback_priority']})[_0x0bd5('0x11')](function(_0x3316ba){_0x172393(null,_0x3316ba);})[_0x0bd5('0x12')](function(_0x5cf2f2){_0x172393(_0x5cf2f2);});};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x4f')]=function(_0x374701,_0x4851fb){this['rpc'][_0x0bd5('0x50')](_0x374701)['then'](function(_0x3e20e9){_0x4851fb(null,_0x3e20e9?_0x3e20e9[_0x0bd5('0x16')]:![]);})[_0x0bd5('0x12')](function(_0x5e7bcd){_0x4851fb(_0x5e7bcd);});};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x51')]=function(_0x3eaea6,_0x38aae5,_0x5e93fa){var _0x3c0d59={'role':_0x0bd5('0x52')};_0x3c0d59[_0x3eaea6]=this[_0x0bd5('0xd')][_0x0bd5('0x3a')];this[_0x0bd5('0x14')]['agentPause'](_0x3c0d59,_0x38aae5,this[_0x0bd5('0xd')]['uniqueid'])[_0x0bd5('0x11')](function(_0x5d6cb3){_0x5e93fa(null,_['isNil'](_0x5d6cb3)?![]:!![]);})[_0x0bd5('0x12')](function(_0x55883d){logger[_0x0bd5('0x2e')](_0x55883d);_0x5e93fa(null,![]);});};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x53')]=function(_0x5c84f9,_0x4f7e86){var _0x27609f={'role':'agent'};_0x27609f[_0x5c84f9]=this[_0x0bd5('0xd')][_0x0bd5('0x3a')];this['rpc'][_0x0bd5('0x53')](_0x27609f)['then'](function(_0x45ccf5){_0x4f7e86(null,_[_0x0bd5('0x47')](_0x45ccf5)?![]:!![]);})[_0x0bd5('0x12')](function(_0x18cb9b){logger[_0x0bd5('0x2e')](_0x18cb9b);_0x4f7e86(null,![]);});};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x54')]=function(_0x4ad449,_0x33ad3f){var _0x1e5e7d={'role':_0x0bd5('0x52')};_0x1e5e7d[_0x4ad449]=this['channel']['callerid'];this[_0x0bd5('0x14')][_0x0bd5('0x54')](_0x1e5e7d)[_0x0bd5('0x11')](function(_0x42dc72){_0x33ad3f(null,_[_0x0bd5('0x47')](_0x42dc72)?![]:!![]);})[_0x0bd5('0x12')](function(_0x1db7f2){logger[_0x0bd5('0x2e')](_0x1db7f2);_0x33ad3f(null,![]);});};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x55')]=function(_0x11c266,_0x377869){var _0x30b87e={'role':_0x0bd5('0x52')};_0x30b87e[_0x11c266]=this[_0x0bd5('0xd')][_0x0bd5('0x3a')];var _0x29d9d8=_0x11c266!=_0x0bd5('0x56')?util['format'](_0x0bd5('0x57'),_0x0bd5('0x58'),this['channel'][_0x0bd5('0x3a')]):undefined;this['rpc'][_0x0bd5('0x55')](_0x30b87e,_0x29d9d8)[_0x0bd5('0x11')](function(_0x4f7170){_0x377869(null,_[_0x0bd5('0x47')](_0x4f7170)?![]:!![]);})[_0x0bd5('0x12')](function(_0x1510bd){logger[_0x0bd5('0x2e')](_0x1510bd);_0x377869(null,![]);});};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x59')]=function(_0x2fbea8,_0x1a5708){sh[_0x0bd5('0x5a')](_['trim'](_0x2fbea8),function(_0x196c1c,_0x3be572){var _0x583835=_0x3be572[_0x0bd5('0x5b')](/(\r\n|\n|\r)/gm,'');_0x1a5708(null,_0x583835);});};AGIVertices[_0x0bd5('0xf')]['googleCloudTTS']=function(_0x215491,_0x333303){scripts['googleCloudTTS'](_0x215491[_0x0bd5('0x5c')],_0x215491['google_cloud_tts_text_type']||_0x0bd5('0x5d'),_0x215491[_0x0bd5('0x5d')],_0x215491[_0x0bd5('0x5e')]||_0x0bd5('0x5f'),_0x215491[_0x0bd5('0x60')]||_0x0bd5('0x61'),_0x215491[_0x0bd5('0x62')]||_0x0bd5('0x63'))[_0x0bd5('0x11')](function(_0x1812a4){_0x333303(null,_0x1812a4);})[_0x0bd5('0x12')](function(_0x1182b4){_0x333303(_0x1182b4);});};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x64')]=function(_0x580a90,_0x2707f7){scripts[_0x0bd5('0x64')](_0x580a90[_0x0bd5('0x5d')],_0x580a90[_0x0bd5('0x65')]||'en',0x1)[_0x0bd5('0x11')](function(_0xf5ef66){_0x2707f7(null,_0xf5ef66);})['catch'](function(_0x1500f2){_0x2707f7(_0x1500f2);});};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x66')]=function(_0x371b77,_0x3bc8cc){var _0x116e67={'uri':_0x371b77[_0x0bd5('0x67')],'method':_0x371b77['method'],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x371b77['timeout'])==='number'&&parseInt(_0x371b77[_0x0bd5('0x68')])>=0x1?parseInt(_0x371b77[_0x0bd5('0x68')])*0x3e8:0x5*0x3e8};if(_[_0x0bd5('0x69')]([_0x0bd5('0x6a'),_0x0bd5('0x6b')],_0x116e67['method'][_0x0bd5('0x6c')]())){try{_0x116e67[_0x0bd5('0x6d')]=_0x371b77['rawBody']?JSON[_0x0bd5('0x6e')](_0x371b77[_0x0bd5('0xa')]):{};}catch(_0x1a812e){logger[_0x0bd5('0x2e')](_0x0bd5('0x6f'),_0x1a812e);}}try{_0x116e67[_0x0bd5('0x70')]=_0x371b77[_0x0bd5('0x9')]?JSON[_0x0bd5('0x6e')](_0x371b77[_0x0bd5('0x9')]):{};}catch(_0x32110c){logger[_0x0bd5('0x2e')]('An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function',_0x32110c);}if(_0x371b77[_0x0bd5('0x71')]){try{var _0x3a0719=require(_0x371b77[_0x0bd5('0x71')])[_0x0bd5('0x72')](this,_0x116e67);_0x116e67[_0x0bd5('0x73')]=Mustache['render'](_0x371b77[_0x0bd5('0x67')],_0x3a0719,{},['$$','$$']);if(_0x116e67[_0x0bd5('0x70')]){_0x116e67[_0x0bd5('0x70')]=JSON[_0x0bd5('0x6e')](Mustache[_0x0bd5('0x74')](JSON[_0x0bd5('0x75')](_0x116e67[_0x0bd5('0x70')]),_0x3a0719,{},['$$','$$']));}if(_0x116e67[_0x0bd5('0x6d')]){_0x116e67[_0x0bd5('0x6d')]=JSON[_0x0bd5('0x6e')](Mustache[_0x0bd5('0x74')](JSON[_0x0bd5('0x75')](_0x116e67[_0x0bd5('0x6d')]),_0x3a0719,{},['$$','$$']));}}catch(_0xcbb2fc){logger[_0x0bd5('0x2e')](_0x0bd5('0x76'),_0xcbb2fc);}}rp(_0x116e67)[_0x0bd5('0x11')](function(_0x14653e){var _0x6afdff={'statusCode':_0x14653e['statusCode']||0xc8,'statusMessage':_0x14653e['statusMessage']||'OK','headers':_0x14653e[_0x0bd5('0x70')]||{},'body':_0x14653e[_0x0bd5('0x6d')]||{}};_0x3bc8cc(null,_0x6afdff);})[_0x0bd5('0x12')](function(_0xc53281){var _0x25b65b={'statusCode':_0xc53281['statusCode']||0x1f4,'statusMessage':_0xc53281[_0x0bd5('0x77')]||_0x0bd5('0x78'),'headers':_0xc53281[_0x0bd5('0x79')][_0x0bd5('0x70')]||{},'body':_0xc53281[_0x0bd5('0x79')]['body']||{}};_0x3bc8cc(null,_0x25b65b);});};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x7a')]=function(_0x7c1d11,_0x200df8){scripts[_0x0bd5('0x7a')](this[_0x0bd5('0xd')][_0x0bd5('0x3c')],_0x7c1d11[_0x0bd5('0x7b')],_0x7c1d11[_0x0bd5('0x5d')],_0x7c1d11[_0x0bd5('0x7c')]||'en')[_0x0bd5('0x11')](function(_0x48a77d){_0x200df8(null,_0x48a77d);})[_0x0bd5('0x12')](function(_0x26ad0c){_0x200df8(_0x26ad0c);});};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x7d')]=function(_0x2c77eb,_0x46a5ee){scripts[_0x0bd5('0x7d')](this[_0x0bd5('0xd')]['uniqueid'],_0x2c77eb[_0x0bd5('0x7e')],_0x2c77eb[_0x0bd5('0x7f')],_0x2c77eb[_0x0bd5('0x80')],_0x2c77eb[_0x0bd5('0x5d')],_0x2c77eb[_0x0bd5('0x81')]||'en')[_0x0bd5('0x11')](function(_0x3ee6bf){_0x46a5ee(null,_0x3ee6bf);})[_0x0bd5('0x12')](function(_0x97d31b){_0x46a5ee(_0x97d31b);});};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x82')]=function(_0x112e85,_0x23a041){scripts[_0x0bd5('0x82')](this[_0x0bd5('0xd')],_0x112e85)[_0x0bd5('0x11')](function(_0x54ba20){_0x23a041(null,_0x54ba20);})[_0x0bd5('0x12')](function(_0x331841){_0x23a041(_0x331841);});};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x83')]=function(_0x323f48,_0x2cd599){scripts[_0x0bd5('0x83')](_0x323f48[_0x0bd5('0x7b')],_0x323f48[_0x0bd5('0x5d')],_0x323f48['ispeech_tts_language']||_0x0bd5('0x5f'),_0x323f48[_0x0bd5('0x84')])[_0x0bd5('0x11')](function(_0x505d41){_0x2cd599(null,_0x505d41);})[_0x0bd5('0x12')](function(_0x1d5c3a){_0x2cd599(_0x1d5c3a);});};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x85')]=function(_0x1e7d05,_0x2fd908,_0x533297){scripts[_0x0bd5('0x85')](_0x2fd908,_0x1e7d05['key'],_0x1e7d05[_0x0bd5('0x86')]||'en-US',this['isConfigured'](_0x1e7d05[_0x0bd5('0x87')])?_0x1e7d05[_0x0bd5('0x87')]:undefined)[_0x0bd5('0x11')](function(_0x1e0a98){_0x533297(null,_0x1e0a98);})['catch'](function(_0xb303d9){_0x533297(_0xb303d9);});};AGIVertices[_0x0bd5('0xf')]['awsPolly']=function(_0x8e94cf,_0x3609db){scripts[_0x0bd5('0x88')](_0x8e94cf[_0x0bd5('0x89')],_0x8e94cf[_0x0bd5('0x8a')],_0x8e94cf[_0x0bd5('0x8b')],_0x8e94cf[_0x0bd5('0x8c')]||_0x0bd5('0x8d'),_0x8e94cf[_0x0bd5('0x5d')],_0x8e94cf[_0x0bd5('0x8e')]||_0x0bd5('0x5d'))[_0x0bd5('0x11')](function(_0xaea5ef){_0x3609db(null,_0xaea5ef);})[_0x0bd5('0x12')](function(_0x2220f5){_0x3609db(_0x2220f5);});};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x8f')]=function(_0x12da8d,_0x2eee49){scripts[_0x0bd5('0x8f')](this[_0x0bd5('0xd')][_0x0bd5('0x3c')],_0x12da8d[_0x0bd5('0x89')],_0x12da8d[_0x0bd5('0x8a')],_0x12da8d[_0x0bd5('0x90')],_0x12da8d[_0x0bd5('0x5d')],_0x12da8d['aws_bot_name'])[_0x0bd5('0x11')](function(_0x4b65f6){_0x2eee49(null,_0x4b65f6);})[_0x0bd5('0x12')](function(_0x467a37){_0x2eee49(_0x467a37);});};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x91')]=function(_0x105048,_0xeffd4d,_0x1fa5c7){scripts[_0x0bd5('0x91')](_0xeffd4d,_0x105048[_0x0bd5('0x7b')],_0x105048['google_asr_language']||'en-US')[_0x0bd5('0x11')](function(_0x392bdc){_0x1fa5c7(null,_0x392bdc);})['catch'](function(_0x3771b7){_0x1fa5c7(_0x3771b7);});};AGIVertices['prototype'][_0x0bd5('0x92')]=function(_0x1e754a,_0x240ed8,_0x40a5d0){scripts['tildeASR'](_0x240ed8,_0x1e754a[_0x0bd5('0x93')],_0x1e754a[_0x0bd5('0x94')],_0x1e754a[_0x0bd5('0x73')])[_0x0bd5('0x11')](function(_0x5d2896){_0x40a5d0(null,_0x5d2896);})[_0x0bd5('0x12')](function(_0x327708){_0x40a5d0(_0x327708);});};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x95')]=function(_0x31d2e0){var _0x32c424=_[_0x0bd5('0x69')](verticesWithRetry,_0x31d2e0[_0x0bd5('0x96')])?_0x31d2e0:_[_0x0bd5('0x97')](_0x31d2e0);for(var _0x42a7b0 in _0x32c424){if(_0x32c424[_0x0bd5('0x98')](_0x42a7b0)){if(_0x32c424[_0x42a7b0]&&_[_0x0bd5('0x99')](_0x32c424[_0x42a7b0])){if(_['includes'](recursiveMapAttributes,_0x42a7b0)){_0x32c424[_0x42a7b0]=this[_0x0bd5('0x9a')](_0x32c424[_0x42a7b0]);}else{_0x32c424[_0x42a7b0]=this[_0x0bd5('0x9b')](_0x32c424[_0x42a7b0]);}}}}return _0x32c424;};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x9c')]=function(_0x29db27){for(var _0x74b27 in _0x29db27){if(_0x29db27[_0x0bd5('0x98')](_0x74b27)){if(_[_0x0bd5('0x9d')](_0x29db27[_0x74b27])){this[_0x0bd5('0x9c')](_0x29db27[_0x74b27]);}else if(_[_0x0bd5('0x9e')](_0x29db27[_0x74b27])){for(var _0x2a05bc=0x0;_0x2a05bc<_0x29db27[_0x74b27]['length'];_0x2a05bc++){this[_0x0bd5('0x9c')](_0x29db27[_0x74b27][_0x2a05bc]);}}else if(_['isString'](_0x29db27[_0x74b27])){_0x29db27[_0x74b27]=this[_0x0bd5('0x9b')](_0x29db27[_0x74b27]);}}}};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x9f')]=function(_0x57e61b,_0x509e4d){for(var _0x57d9dd in _0x57e61b){if(_0x57e61b[_0x0bd5('0x98')](_0x57d9dd)){if(_[_0x0bd5('0x9d')](_0x57e61b[_0x57d9dd])){if(!_[_0x0bd5('0x48')](_0x57e61b[_0x57d9dd])){this[_0x0bd5('0x9f')](_0x57e61b[_0x57d9dd],util[_0x0bd5('0x2a')](_0x0bd5('0xa0'),_0x509e4d,_0x57d9dd));}}else if(_[_0x0bd5('0x9e')](_0x57e61b[_0x57d9dd])){for(var _0xe74312=0x0;_0xe74312<_0x57e61b[_0x57d9dd][_0x0bd5('0xa1')];_0xe74312++){this[_0x0bd5('0x9f')](_0x57e61b[_0x57d9dd][_0xe74312],util[_0x0bd5('0x2a')]('%s.%s',_0x509e4d,_0x57d9dd+'['+_0xe74312+']'));}}else{if(!_[_0x0bd5('0x47')](_0x57e61b[_0x57d9dd])){this[_0x0bd5('0xd')]['setVariable'](util['format'](_0x0bd5('0xa0'),_0x509e4d,_0x57d9dd),_0x57e61b[_0x57d9dd]);}}}}};AGIVertices['prototype']['replaceObjectAllVariables']=function(_0x4145b8){try{var _0x26c6db=JSON[_0x0bd5('0x6e')](_0x4145b8);this[_0x0bd5('0x9c')](_0x26c6db);return JSON[_0x0bd5('0x75')](_0x26c6db);}catch(_0x36e17c){return this[_0x0bd5('0x9b')](_0x4145b8);}};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x9b')]=function(_0xa965e5){var _0xa2096c=_0xa965e5['split']('{');for(var _0x137649=0x1;_0x137649<_0xa2096c[_0x0bd5('0xa1')];_0x137649+=0x1){var _0x41aeec=_0xa2096c[_0x137649][_0x0bd5('0xa2')]('}');if(_0x41aeec[_0x0bd5('0xa1')]>0x1){_0xa965e5=_0xa965e5[_0x0bd5('0xa3')]('{'+_0x41aeec[0x0]+'}',this[_0x0bd5('0xd')][_0x0bd5('0xa4')](_0x41aeec[0x0])[_0x0bd5('0xa5')]||_0x41aeec[0x0]);}}if(_0xa2096c[_0x0bd5('0xa1')]===0x1){return _0xa965e5[_0x0bd5('0x4e')]();}return this[_0x0bd5('0x9b')](_0xa965e5);};AGIVertices['prototype'][_0x0bd5('0xa6')]=function(_0x5d8f36,_0x337ed1){var _0x4b24f2=this[_0x0bd5('0xd')][_0x0bd5('0xa4')](_0x5d8f36);if(_0x4b24f2[_0x0bd5('0xa7')]===-0x1){return _0x4b24f2;}logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')](_0x0bd5('0xa8'),_0x337ed1,_0x4b24f2[_0x0bd5('0xa5')]));return this[_0x0bd5('0xd')][_0x0bd5('0xa9')](_0x337ed1,_0x4b24f2[_0x0bd5('0xa5')]);};AGIVertices['prototype'][_0x0bd5('0xaa')]=function(_0x365b22){return _0x365b22&&_0x365b22!=='0'&&_0x365b22!=='-1'&&_0x365b22!=='';};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0xab')]=function(_0x26c4c5){this[_0x0bd5('0x39')][_0x0bd5('0x72')](this,_0x26c4c5,'-');_0x26c4c5[_0x0bd5('0xac')]=_0x26c4c5[_0x0bd5('0xab')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0xad')]=function(_0x315e4a){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')](_0x0bd5('0xae'),_0x315e4a[_0x0bd5('0xaf')]));if(!this[_0x0bd5('0xaa')](_0x315e4a['text'])){return this['channel'][_0x0bd5('0xb0')](_0x0bd5('0xb1'));}var _0x2a8c09='\x22'+_0x315e4a['text']+'\x22';if(this[_0x0bd5('0xaa')](_0x315e4a[_0x0bd5('0x79')])){_0x2a8c09+=','+_0x315e4a[_0x0bd5('0x79')];}var _0x545fde=this[_0x0bd5('0xd')][_0x0bd5('0x5a')](_0x0bd5('0xb2'),_0x2a8c09);if(_0x545fde[_0x0bd5('0xa7')]===-0x1){return _0x545fde;}return this[_0x0bd5('0xd')]['noop'](util[_0x0bd5('0x2a')]('Executed\x20command\x20MRCPSynth\x20%s',_0x2a8c09));};AGIVertices[_0x0bd5('0xf')]['mrcprecog']=function(_0x39a94f){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')](_0x0bd5('0xb3'),_0x39a94f[_0x0bd5('0xaf')]));if(!this['isConfigured'](_0x39a94f[_0x0bd5('0xb4')])){return this['channel'][_0x0bd5('0xb0')]('no\x20grammar\x20configured');}var _0x5807ba=_0x39a94f[_0x0bd5('0xb4')];if(this[_0x0bd5('0xaa')](_0x39a94f[_0x0bd5('0x79')])){_0x5807ba+=','+_0x39a94f[_0x0bd5('0x79')];}var _0x4f9dd1=this[_0x0bd5('0xd')][_0x0bd5('0x5a')](_0x0bd5('0xb5'),_0x5807ba);if(_0x4f9dd1[_0x0bd5('0xa7')]===-0x1){return _0x4f9dd1;}var _0x5a05b4=this[_0x0bd5('0xa6')](_0x0bd5('0xb6'),_0x0bd5('0xb7'));if(_0x5a05b4[_0x0bd5('0xa7')]===-0x1){return _0x5a05b4;}var _0x20c7c6=this[_0x0bd5('0xa6')](_0x0bd5('0xb8'),_0x0bd5('0xb9'));if(_0x20c7c6[_0x0bd5('0xa7')]===-0x1){return _0x20c7c6;}var _0x466e41=this['getAndSetVariable'](_0x0bd5('0xba'),'MRCP_RECOG_INSTANCE');if(_0x466e41[_0x0bd5('0xa7')]===-0x1){return _0x466e41;}return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')](_0x0bd5('0xbb'),_0x5807ba));};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0xbc')]=function(_0x4b656e){logger['info'](util[_0x0bd5('0x2a')](_0x0bd5('0xbd'),_0x4b656e[_0x0bd5('0xaf')]));return this['channel'][_0x0bd5('0xbc')]([_0x4b656e[_0x0bd5('0xbe')],_0x4b656e[_0x0bd5('0xbf')]]);};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0xc0')]=function(_0x20ff57){logger['info'](util['format'](_0x0bd5('0xc1'),_0x20ff57['label']));if(this[_0x0bd5('0xaa')](_0x20ff57[_0x0bd5('0x68')])){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')](_0x0bd5('0xc2'),_0x20ff57[_0x0bd5('0x68')]));var _0x3da9b5=this[_0x0bd5('0xd')][_0x0bd5('0xc3')](_0x20ff57[_0x0bd5('0x68')]);if(_0x3da9b5[_0x0bd5('0xa7')]===-0x1){return _0x3da9b5;}}return this['channel'][_0x0bd5('0xc0')]();};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x4c')]=function(_0x2f1461){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')](_0x0bd5('0xc4'),_0x2f1461[_0x0bd5('0xaf')]));if(!this[_0x0bd5('0xaa')](_0x2f1461[_0x0bd5('0xc5')])){return this[_0x0bd5('0xd')][_0x0bd5('0x2e')](_0x2f1461,_0x0bd5('0xc6'));}_0x2f1461[_0x0bd5('0x4b')]=moment();if(this[_0x0bd5('0xaa')](_0x2f1461[_0x0bd5('0xc7')])){_0x2f1461[_0x0bd5('0x4b')]=moment()[_0x0bd5('0xc8')](_0x2f1461[_0x0bd5('0xc7')],_0x0bd5('0xc9'));}if(!this[_0x0bd5('0xaa')](_0x2f1461['callback_priority'])){_0x2f1461[_0x0bd5('0xca')]=0x2;}this[_0x0bd5('0x46')][_0x0bd5('0x72')](this,_0x2f1461);return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')](_0x0bd5('0xcb'),_0x2f1461[_0x0bd5('0x4a')],_0x2f1461[_0x0bd5('0xc5')],_0x2f1461['scheduledAt']));};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0xcc')]=function(_0x3263a7){logger[_0x0bd5('0x30')](util['format'](_0x0bd5('0xcd'),_0x3263a7['label']));var _0x2a50a2=this[_0x0bd5('0xd')][_0x0bd5('0x5a')](_0x3263a7['application'],_0x3263a7[_0x0bd5('0x79')]);if(_0x2a50a2[_0x0bd5('0xa7')]===-0x1){return _0x2a50a2;}return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')](_0x0bd5('0xce'),_0x3263a7[_0x0bd5('0xcf')],_0x3263a7[_0x0bd5('0x79')]));};AGIVertices[_0x0bd5('0xf')]['lumenvoxtts']=function(_0x1a5c39){logger[_0x0bd5('0x30')](util['format'](_0x0bd5('0xd0'),_0x1a5c39[_0x0bd5('0xaf')]));if(!this[_0x0bd5('0xaa')](_0x1a5c39['text'])){return this[_0x0bd5('0xd')]['noop'](_0x0bd5('0xb1'));}var _0x4996fc='\x22'+_0x1a5c39['text']+'\x22';if(this['isConfigured'](_0x1a5c39[_0x0bd5('0x79')])){_0x4996fc+=','+_0x1a5c39[_0x0bd5('0x79')];}var _0x3e7ce1=this[_0x0bd5('0xd')][_0x0bd5('0x5a')]('MRCPSynth',_0x4996fc);if(_0x3e7ce1[_0x0bd5('0xa7')]===-0x1){return _0x3e7ce1;}return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')]('Executed\x20command\x20MRCPSynth\x20%s',_0x4996fc));};AGIVertices['prototype']['sestektts']=function(_0x394de9){logger['info'](util[_0x0bd5('0x2a')](_0x0bd5('0xd1'),_0x394de9['label']));if(!this[_0x0bd5('0xaa')](_0x394de9[_0x0bd5('0x5d')])){return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](_0x0bd5('0xb1'));}var _0x3b617f='\x22'+_0x394de9['text']+'\x22';if(this[_0x0bd5('0xaa')](_0x394de9[_0x0bd5('0x79')])){_0x3b617f+=','+_0x394de9[_0x0bd5('0x79')];}var _0x4a3e68=this['channel'][_0x0bd5('0x5a')](_0x0bd5('0xb2'),_0x3b617f);if(_0x4a3e68[_0x0bd5('0xa7')]===-0x1){return _0x4a3e68;}return this['channel'][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')](_0x0bd5('0xd2'),_0x3b617f));};AGIVertices['prototype'][_0x0bd5('0xd3')]=function(_0x277dbe){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')](_0x0bd5('0xd4'),_0x277dbe[_0x0bd5('0xaf')]));if(!this[_0x0bd5('0xaa')](_0x277dbe['grammar'])){return this[_0x0bd5('0xd')]['noop']('no\x20grammar\x20configured');}var _0x2f066b=_0x277dbe[_0x0bd5('0xb4')];if(this[_0x0bd5('0xaa')](_0x277dbe[_0x0bd5('0x79')])){_0x2f066b+=','+_0x277dbe[_0x0bd5('0x79')];}var _0x221cf6=this[_0x0bd5('0xd')][_0x0bd5('0x5a')](_0x0bd5('0xb5'),_0x2f066b);if(_0x221cf6[_0x0bd5('0xa7')]===-0x1){return _0x221cf6;}var _0x30ffcc=this['getAndSetVariable'](_0x0bd5('0xb6'),_0x0bd5('0xd5'));if(_0x30ffcc['result']===-0x1){return _0x30ffcc;}var _0x3ac7da=this[_0x0bd5('0xa6')](_0x0bd5('0xb8'),_0x0bd5('0xd6'));if(_0x3ac7da[_0x0bd5('0xa7')]===-0x1){return _0x3ac7da;}var _0x163832=this['getAndSetVariable'](_0x0bd5('0xba'),_0x0bd5('0xd7'));if(_0x163832[_0x0bd5('0xa7')]===-0x1){return _0x163832;}return this[_0x0bd5('0xd')]['noop'](util[_0x0bd5('0x2a')](_0x0bd5('0xbb'),_0x2f066b));};AGIVertices['prototype'][_0x0bd5('0xd8')]=function(_0x3d3073){logger['info'](util[_0x0bd5('0x2a')](_0x0bd5('0xd9'),_0x3d3073['label']));if(!this['isConfigured'](_0x3d3073[_0x0bd5('0xb4')])){return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](_0x0bd5('0xda'));}var _0x56a475=_0x3d3073['grammar'];if(this[_0x0bd5('0xaa')](_0x3d3073[_0x0bd5('0x79')])){_0x56a475+=','+_0x3d3073[_0x0bd5('0x79')];}var _0x440d03=this[_0x0bd5('0xd')][_0x0bd5('0x5a')](_0x0bd5('0xb5'),_0x56a475);if(_0x440d03['result']===-0x1){return _0x440d03;}var _0xf69970=this['getAndSetVariable']('RECOG_CONFIDENCE()',_0x0bd5('0xdb'));if(_0xf69970[_0x0bd5('0xa7')]===-0x1){return _0xf69970;}var _0x101ada=this[_0x0bd5('0xa6')]('RECOG_INPUT()',_0x0bd5('0xdc'));if(_0x101ada[_0x0bd5('0xa7')]===-0x1){return _0x101ada;}var _0xb325b7=this[_0x0bd5('0xa6')](_0x0bd5('0xba'),_0x0bd5('0xdd'));if(_0xb325b7[_0x0bd5('0xa7')]===-0x1){return _0xb325b7;}return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util['format'](_0x0bd5('0xbb'),_0x56a475));};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0xde')]=function(_0x17a446){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')](_0x0bd5('0xdf'),_0x17a446[_0x0bd5('0xaf')]));if(!this[_0x0bd5('0xaa')](_0x17a446['odbc_id'])){return this[_0x0bd5('0xd')][_0x0bd5('0x2e')](_0x17a446,_0x0bd5('0xe0'));}var _0x8628fd=this[_0x0bd5('0x19')][_0x0bd5('0x72')](this,_0x17a446[_0x0bd5('0xe1')]);if(!_0x8628fd){return this[_0x0bd5('0xd')][_0x0bd5('0x2e')](_0x17a446,'no\x20odbc\x20database\x20found');}if(!this[_0x0bd5('0xaa')](_0x17a446[_0x0bd5('0xe2')])){return this[_0x0bd5('0xd')][_0x0bd5('0x2e')](_0x17a446,_0x0bd5('0xe3'));}var _0x284fbf=_0x17a446['query']['replace'](/(\r\n|\n|\r)/gm,'\x20');this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')]('query:\x20%s',_0x284fbf));var _0x187367=this[_0x0bd5('0x2c')][_0x0bd5('0x72')](this,_0x8628fd,_0x284fbf);this[_0x0bd5('0x39')][_0x0bd5('0x72')](this,_0x17a446,_0x284fbf);if(!this[_0x0bd5('0xaa')](_0x17a446[_0x0bd5('0xe4')])){return this['channel'][_0x0bd5('0xb0')](_0x0bd5('0xe5'));}var _0x4fd105=this[_0x0bd5('0xa4')]['sync'](this,_0x17a446[_0x0bd5('0xe4')]);if(!_0x4fd105){return this['channel']['error'](_0x17a446,_0x0bd5('0xe6'));}var _0x2a3d44=this;_0x187367[_0x0bd5('0xe7')](function(_0x7e0bac,_0x303cbb){Object[_0x0bd5('0xe8')](_0x7e0bac)[_0x0bd5('0xe7')](function(_0xd0cf36){_0x2a3d44['channel'][_0x0bd5('0xa9')](util[_0x0bd5('0x2a')](_0x0bd5('0xe9'),_0x4fd105,_0x303cbb,_0xd0cf36),_0x7e0bac[_0xd0cf36]);});});this[_0x0bd5('0xd')][_0x0bd5('0xa9')](util[_0x0bd5('0x2a')](_0x0bd5('0xea'),_0x4fd105),_0x187367['length']);return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')](_0x0bd5('0xeb'),_0x4fd105));};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0xec')]=function(_0x49363b){logger[_0x0bd5('0xed')](util['format'](_0x0bd5('0xee'),_0x49363b[_0x0bd5('0xaf')]));if(!this[_0x0bd5('0xaa')](_0x49363b[_0x0bd5('0xef')])){return this[_0x0bd5('0xd')][_0x0bd5('0x2e')](_0x49363b,'no\x20user\x20selected');}var _0x48a214=this[_0x0bd5('0x1b')][_0x0bd5('0x72')](this,_0x49363b[_0x0bd5('0xef')]);if(!_0x48a214){return this[_0x0bd5('0xd')][_0x0bd5('0x2e')](_0x49363b,_0x0bd5('0xf0'));}var _0x5e6752=this[_0x0bd5('0xd')][_0x0bd5('0x5a')](_0x0bd5('0xf1'),[util['format'](_0x0bd5('0xf2'),_0x48a214),_0x49363b['timeout'],_0x49363b['opts'],_0x49363b[_0x0bd5('0x67')]]);if(_0x5e6752[_0x0bd5('0xa7')]===-0x1){return _0x5e6752;}return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util['format']('Executed\x20command\x20%s',_0x0bd5('0xf1')));};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0xf3')]=function(_0x207acf){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')]('Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block',_0x207acf[_0x0bd5('0xaf')]));if(!this[_0x0bd5('0xaa')](_0x207acf['key'])){return this[_0x0bd5('0xd')]['noop'](_0x0bd5('0xf4'));}if(!this[_0x0bd5('0xaa')](_0x207acf['text'])){return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](_0x0bd5('0xb1'));}this[_0x0bd5('0xd')][_0x0bd5('0xf5')]=!![];this['createSquareDetailsReport'](_0x207acf);this[_0x0bd5('0x45')](_0x207acf[_0x0bd5('0x5d')],'in','','');this['channel']['noop'](util[_0x0bd5('0x2a')](_0x0bd5('0xf6'),_0x207acf[_0x0bd5('0x5d')]));var _0x24da0a=this[_0x0bd5('0x7a')][_0x0bd5('0x72')](this,_0x207acf);if(_0x24da0a){for(var _0x214875 in _0x24da0a){if(_0x24da0a['hasOwnProperty'](_0x214875)){this[_0x0bd5('0xd')][_0x0bd5('0xa9')](util[_0x0bd5('0x2a')](_0x0bd5('0xf7'),_0x214875[_0x0bd5('0x6c')]()),_0x24da0a[_0x214875]);}}this[_0x0bd5('0x45')](_0x24da0a[_0x0bd5('0xf8')],_0x0bd5('0xf9'),_0x0bd5('0xf3'),'');return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util['format'](_0x0bd5('0xfa'),_0x24da0a[_0x0bd5('0xf8')]));}return this[_0x0bd5('0xd')]['error'](_0x207acf,_0x0bd5('0xfb'));};AGIVertices[_0x0bd5('0xf')]['dialogflowV2']=function(_0x2b61e7){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')](_0x0bd5('0xfc'),_0x2b61e7[_0x0bd5('0xaf')]));if(!this[_0x0bd5('0xaa')](_0x2b61e7[_0x0bd5('0x7e')])){return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](_0x0bd5('0xfd'));}if(!this[_0x0bd5('0xaa')](_0x2b61e7[_0x0bd5('0x7f')])){return this[_0x0bd5('0xd')]['noop'](_0x0bd5('0xfe'));}if(!this[_0x0bd5('0xaa')](_0x2b61e7[_0x0bd5('0x80')])){return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](_0x0bd5('0xff'));}if(!this[_0x0bd5('0xaa')](_0x2b61e7[_0x0bd5('0x81')])){return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](_0x0bd5('0x100'));}if(!this['isConfigured'](_0x2b61e7['text'])){return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](_0x0bd5('0xb1'));}this[_0x0bd5('0xd')]['bot']=!![];this['createSquareDetailsReport'](_0x2b61e7);this[_0x0bd5('0x45')](_0x2b61e7[_0x0bd5('0x5d')],'in','','');this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')](_0x0bd5('0x101'),_0x2b61e7[_0x0bd5('0x5d')]));var _0x27e296=this[_0x0bd5('0x7d')][_0x0bd5('0x72')](this,_0x2b61e7);if(_0x27e296){for(var _0x70396c in _0x27e296){if(_0x27e296[_0x0bd5('0x98')](_0x70396c)){if(_0x70396c!==_0x0bd5('0x102')){this['channel'][_0x0bd5('0xa9')](util[_0x0bd5('0x2a')](_0x0bd5('0xf7'),_0x70396c[_0x0bd5('0x6c')]()),_0x27e296[_0x70396c]);}}}this[_0x0bd5('0x45')](_0x27e296[_0x0bd5('0xf8')],_0x0bd5('0xf9'),_0x0bd5('0x103'),_0x27e296[_0x0bd5('0x102')]);return this[_0x0bd5('0xd')]['noop'](util[_0x0bd5('0x2a')](_0x0bd5('0x104'),_0x27e296[_0x0bd5('0xf8')]));}return this[_0x0bd5('0xd')]['error'](_0x2b61e7,_0x0bd5('0x105'));};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x106')]=function(_0x47fc7a){logger['info'](util['format'](_0x0bd5('0x107'),_0x47fc7a[_0x0bd5('0xaf')]));if(!this[_0x0bd5('0xaa')](_0x47fc7a['ndauth_url'])){return this[_0x0bd5('0xd')]['noop'](_0x0bd5('0x108'));}if(!this[_0x0bd5('0xaa')](_0x47fc7a['username'])){return this['channel'][_0x0bd5('0xb0')](_0x0bd5('0x109'));}if(!this[_0x0bd5('0xaa')](_0x47fc7a[_0x0bd5('0x10a')])){return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](_0x0bd5('0x10b'));}if(!this['isConfigured'](_0x47fc7a[_0x0bd5('0x10c')])){return this[_0x0bd5('0xd')]['noop'](_0x0bd5('0xb1'));}this['channel']['bot']=!![];this[_0x0bd5('0x39')](_0x47fc7a);this[_0x0bd5('0x45')](_0x47fc7a[_0x0bd5('0x5d')],'in','','');this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util['format'](_0x0bd5('0x10d'),_0x47fc7a[_0x0bd5('0x5d')]));var _0x85338b=this[_0x0bd5('0x82')][_0x0bd5('0x72')](this,_0x47fc7a);if(_0x85338b){for(var _0xbf22de in _0x85338b){if(_0x85338b['hasOwnProperty'](_0xbf22de)){this[_0x0bd5('0xd')][_0x0bd5('0xa9')](util[_0x0bd5('0x2a')](_0x0bd5('0x10e'),_0xbf22de[_0x0bd5('0x6c')]()),_0x85338b[_0xbf22de]);}}this[_0x0bd5('0x45')](_0x85338b[_0x0bd5('0xf8')],'out','sesteknda','');if(_0x85338b[_0x0bd5('0x10f')]){this[_0x0bd5('0xd')]['noop'](util[_0x0bd5('0x2a')](_0x0bd5('0x110'),_0x85338b['audiofile']));var _0x2c67b1=this[_0x0bd5('0xd')][_0x0bd5('0x111')](_0x85338b[_0x0bd5('0x10f')]);try{fs['unlink'](_0x85338b[_0x0bd5('0x10f')]+'.wav');}catch(_0x27fe1e){logger[_0x0bd5('0x2e')](_0x27fe1e);}return _0x2c67b1;}else{return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')](_0x0bd5('0x112'),_0x85338b['speech']));}}return this[_0x0bd5('0xd')][_0x0bd5('0x2e')](_0x47fc7a,_0x0bd5('0x113'));};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x114')]=function(_0x1c44b6){logger['info'](util[_0x0bd5('0x2a')](_0x0bd5('0x115'),_0x1c44b6['label']));return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](_0x0bd5('0x114'));};AGIVertices['prototype'][_0x0bd5('0x116')]=function(_0xfa2e4d){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')](_0x0bd5('0x117'),_0xfa2e4d[_0x0bd5('0xaf')]));var _0x32d781='';if(_0xfa2e4d[_0x0bd5('0x118')]){if(!this[_0x0bd5('0xaa')](_0xfa2e4d['trunk_id'])){return this[_0x0bd5('0xd')]['error'](_0xfa2e4d,_0x0bd5('0x119'));}else{var _0x4a43d6=parseInt(_0xfa2e4d['trunk_id'],0xa);if(isNaN(_0x4a43d6)){_0x32d781=_0xfa2e4d[_0x0bd5('0x118')];}else{_0x32d781=this[_0x0bd5('0x11a')][_0x0bd5('0x72')](this,_0xfa2e4d[_0x0bd5('0x118')]);if(!_0x32d781){return this[_0x0bd5('0xd')]['error'](_0xfa2e4d,_0x0bd5('0x11b'));}}}}else if(_0xfa2e4d[_0x0bd5('0x11c')]){_0x32d781=_0xfa2e4d[_0x0bd5('0x11c')];}else{return this[_0x0bd5('0xd')][_0x0bd5('0x2e')](_0xfa2e4d,'no\x20trunk\x20selected');}var _0x57dd7c=this[_0x0bd5('0xd')][_0x0bd5('0x5a')]('DIAL',[util[_0x0bd5('0x2a')](_0x0bd5('0x11d'),_0x32d781,_0xfa2e4d['phone']),_0xfa2e4d['timeout'],_0xfa2e4d[_0x0bd5('0x11e')],_0xfa2e4d[_0x0bd5('0x67')]]);if(_0x57dd7c[_0x0bd5('0xa7')]===-0x1){return _0x57dd7c;}return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')](_0x0bd5('0x11f'),_0x0bd5('0xf1')));};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x120')]=function(_0x3aa0a8){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')](_0x0bd5('0x121'),_0x3aa0a8['label']));return this[_0x0bd5('0xd')]['noop'](_0x0bd5('0x120'));};AGIVertices['prototype'][_0x0bd5('0xc')]=function(_0x1a15f1){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')]('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x1a15f1[_0x0bd5('0xaf')]));if(_0x1a15f1[_0x0bd5('0xac')]===0x0){return this['maxRetry'](_0x1a15f1);}_0x1a15f1[_0x0bd5('0xac')]-=0x1;if(!this[_0x0bd5('0xaa')](_0x1a15f1[_0x0bd5('0x122')])){return this[_0x0bd5('0xd')][_0x0bd5('0x2e')](_0x1a15f1,_0x0bd5('0x123'));}var _0x5b19d3=this['getSound'][_0x0bd5('0x72')](this,_0x1a15f1['file_id']);if(!_0x5b19d3){return this[_0x0bd5('0xd')][_0x0bd5('0x2e')](_0x1a15f1,_0x0bd5('0x124'));}if(!this['isConfigured'](_0x1a15f1['variable_id'])){return this[_0x0bd5('0xd')][_0x0bd5('0x2e')](_0x0bd5('0xe5'));}var _0x4989be=this[_0x0bd5('0xd')][_0x0bd5('0x125')](_0x5b19d3,_0x1a15f1[_0x0bd5('0x126')],_0x1a15f1['maxdigit']);var _0x2add71=_0x4989be[_0x0bd5('0xa7')]?_0x4989be[_0x0bd5('0xa7')][_0x0bd5('0x4e')]():'';logger['info'](_0x0bd5('0x127'),JSON[_0x0bd5('0x75')](_0x4989be));if(_0x4989be['result']===-0x1){this['createSquareDetailsReport'][_0x0bd5('0x72')](this,_0x1a15f1,_0x2add71);return _0x4989be;}else if(_0x4989be['extra']===_0x0bd5('0x68')){_0x4989be[_0x0bd5('0xa7')]=_0x2add71[_0x0bd5('0xa1')]>=parseInt(_0x1a15f1[_0x0bd5('0x128')])?'x':'i';}else{_0x4989be[_0x0bd5('0xa7')]=_0x2add71[_0x0bd5('0xa1')]>=parseInt(_0x1a15f1[_0x0bd5('0x128')])&&_0x2add71[_0x0bd5('0xa1')]<=parseInt(_0x1a15f1[_0x0bd5('0x129')])?'x':'i';}var _0x54738d=this[_0x0bd5('0xa4')][_0x0bd5('0x72')](this,_0x1a15f1[_0x0bd5('0xe4')]);if(!_0x54738d){return this[_0x0bd5('0xd')][_0x0bd5('0x2e')](_0x1a15f1,'no\x20variable\x20found');}this['channel'][_0x0bd5('0xa9')](_0x54738d,_0x2add71);if(this[_0x0bd5('0xaa')](_0x1a15f1[_0x0bd5('0x12a')])){var _0x173e0b=parseInt(_0x1a15f1[_0x0bd5('0x12a')],0xa);var _0xaf06bd=rs[_0x0bd5('0x12b')]({'charset':'*','length':_0x173e0b});var _0x183052=_0x2add71[_0x0bd5('0xa1')];if(_0x183052>0x0){if(_0x183052>_0x173e0b){this[_0x0bd5('0x39')][_0x0bd5('0x72')](this,_0x1a15f1,_0x1a15f1[_0x0bd5('0x12c')]===_0x0bd5('0x12d')?_0xaf06bd+_0x2add71[_0x0bd5('0x12e')](_0x173e0b):_0x2add71[_0x0bd5('0x12e')](0x0,_0x183052-_0x173e0b)+_0xaf06bd);}else{this[_0x0bd5('0x39')][_0x0bd5('0x72')](this,_0x1a15f1,rs['generate']({'charset':'*','length':_0x183052}));}}else{this[_0x0bd5('0x39')]['sync'](this,_0x1a15f1,'');}}else{this[_0x0bd5('0x39')]['sync'](this,_0x1a15f1,_0x2add71);}return _0x4989be;};AGIVertices['prototype'][_0x0bd5('0x12f')]=function(_0x259463){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')]('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0x259463[_0x0bd5('0xaf')]));return this['getdigits'](_0x259463);};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x130')]=function(_0x5e5211){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')](_0x0bd5('0x131'),_0x5e5211[_0x0bd5('0xaf')]));this[_0x0bd5('0x39')]['sync'](this,_0x5e5211,_0x5e5211['goalname']);return this['channel'][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')]('GOAL\x20%s',_0x5e5211['goalname']));};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x132')]=function(_0x284191){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')]('[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block',_0x284191[_0x0bd5('0xaf')]));if(!this[_0x0bd5('0xaa')](_0x284191['aws_access_key_id'])||!this[_0x0bd5('0xaa')](_0x284191[_0x0bd5('0x8a')])){return this['channel'][_0x0bd5('0xb0')]('no\x20valid\x20credentials\x20configured');}if(!this[_0x0bd5('0xaa')](_0x284191['text'])){return this[_0x0bd5('0xd')]['noop'](_0x0bd5('0xb1'));}this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util['format'](_0x0bd5('0x133'),_0x284191['text']));var _0x194aca=this[_0x0bd5('0x88')][_0x0bd5('0x72')](this,_0x284191);if(_0x194aca){this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')](_0x0bd5('0x134'),_0x194aca));var _0x4f0c4b=this['channel'][_0x0bd5('0x111')](_0x194aca);try{fs[_0x0bd5('0x135')](_0x194aca+_0x0bd5('0x136'));}catch(_0x5e84a1){logger['error'](_0x5e84a1);}return _0x4f0c4b;}return this[_0x0bd5('0xd')][_0x0bd5('0x2e')](_0x284191,'aws\x20Polly\x20is\x20unreachable');};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x137')]=function(_0x4c522d){logger['info'](util[_0x0bd5('0x2a')](_0x0bd5('0x138'),_0x4c522d[_0x0bd5('0xaf')]));if(!this[_0x0bd5('0xaa')](_0x4c522d['aws_access_key_id'])||!this['isConfigured'](_0x4c522d[_0x0bd5('0x8a')])){return this[_0x0bd5('0xd')][_0x0bd5('0xb0')]('no\x20valid\x20credentials\x20configured');}if(!this[_0x0bd5('0xaa')](_0x4c522d[_0x0bd5('0x139')])){return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](_0x0bd5('0x13a'));}if(!this['isConfigured'](_0x4c522d[_0x0bd5('0x5d')])){return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](_0x0bd5('0xb1'));}this['channel'][_0x0bd5('0xf5')]=!![];this[_0x0bd5('0x39')](_0x4c522d);this[_0x0bd5('0x45')](_0x4c522d[_0x0bd5('0x5d')],'in','','');this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')]('Trying\x20Amazon\x20Lex:\x20%s',_0x4c522d[_0x0bd5('0x5d')]));var _0x309a34=this[_0x0bd5('0x8f')][_0x0bd5('0x72')](this,_0x4c522d);if(_0x309a34){for(var _0x3810ff in _0x309a34){if(_0x309a34[_0x0bd5('0x98')](_0x3810ff)&&_[_0x0bd5('0x99')](_0x309a34[_0x3810ff])){this[_0x0bd5('0xd')]['setVariable'](util[_0x0bd5('0x2a')](_0x0bd5('0x13b'),_0x3810ff[_0x0bd5('0x6c')]()),_0x309a34[_0x3810ff]);}}if(_[_0x0bd5('0x47')](_0x309a34[_0x0bd5('0x77')])){return this[_0x0bd5('0xd')]['noop'](_0x0bd5('0x13c'));}else{this['createSquareMessage'](_0x309a34[_0x0bd5('0x77')],_0x0bd5('0xf9'),_0x0bd5('0x13d'),'');return this['channel'][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')](_0x0bd5('0x13e'),_0x309a34[_0x0bd5('0x77')]));}}return this[_0x0bd5('0xd')]['error'](_0x4c522d,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x13f')]=function(_0x25f5c4){logger['info'](util[_0x0bd5('0x2a')](_0x0bd5('0x140'),_0x25f5c4[_0x0bd5('0xaf')],_0x25f5c4[_0x0bd5('0x68')]));if(!this[_0x0bd5('0xaa')](_0x25f5c4[_0x0bd5('0x7b')])){return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](_0x0bd5('0xf4'));}var _0xd23950=_0x0bd5('0x141');var _0x2e48f6=util[_0x0bd5('0x2a')](_0x0bd5('0x142'),FILES_PATH,rs[_0x0bd5('0x12b')](0x4));var _0x3ff8e9=util[_0x0bd5('0x2a')](_0x0bd5('0xa0'),_0x2e48f6,_0xd23950);var _0x1b9646=!![];if(_0x25f5c4[_0x0bd5('0x143')]===_0x0bd5('0x144')){_0x1b9646=![];}var _0x1e63e9=this[_0x0bd5('0xd')][_0x0bd5('0x145')](_0x2e48f6,_0xd23950,_0x25f5c4[_0x0bd5('0x146')],_0x25f5c4[_0x0bd5('0x68')],undefined,_0x1b9646);if(_0x1e63e9['result']!==-0x1){this['channel'][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')](_0x0bd5('0x147'),_0x3ff8e9));var _0x2c8810=this['googleASR']['sync'](this,_0x25f5c4,_0x3ff8e9);if(_0x2c8810){for(var _0x419a33 in _0x2c8810){if(_0x2c8810['hasOwnProperty'](_0x419a33)){this[_0x0bd5('0xd')][_0x0bd5('0xa9')](util['format'](_0x0bd5('0x148'),_0x419a33[_0x0bd5('0x6c')]()),_0x2c8810[_0x419a33]);}}return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')](_0x0bd5('0x149'),JSON[_0x0bd5('0x75')](_0x2c8810)));}}return _0x1e63e9;};AGIVertices['prototype'][_0x0bd5('0x14a')]=function(_0x3c245c){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')]('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x3c245c[_0x0bd5('0xaf')]));if(!this['isConfigured'](_0x3c245c[_0x0bd5('0x93')])){return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](_0x0bd5('0x14b'));}if(!this[_0x0bd5('0xaa')](_0x3c245c[_0x0bd5('0x94')])){return this['channel'][_0x0bd5('0xb0')](_0x0bd5('0x14c'));}var _0x48bd5d='wav';var _0x2c810e=util['format'](_0x0bd5('0x142'),FILES_PATH,rs[_0x0bd5('0x12b')](0x4));var _0xa8847=util[_0x0bd5('0x2a')](_0x0bd5('0xa0'),_0x2c810e,_0x48bd5d);var _0x112958=!![];if(_0x3c245c[_0x0bd5('0x143')]==='NOBEEP'){_0x112958=![];}var _0x463f05=this[_0x0bd5('0xd')][_0x0bd5('0x145')](_0x2c810e,_0x48bd5d,_0x3c245c['intKey'],_0x3c245c['timeout'],undefined,_0x112958);if(_0x463f05[_0x0bd5('0xa7')]!==-0x1){this[_0x0bd5('0xd')]['noop'](util[_0x0bd5('0x2a')]('tilde\x20%s\x20file\x20created',_0xa8847));var _0x376080=this[_0x0bd5('0x92')][_0x0bd5('0x72')](this,_0x3c245c,_0xa8847);if(_0x376080){for(var _0x44b594 in _0x376080){if(_0x376080[_0x0bd5('0x98')](_0x44b594)){this[_0x0bd5('0xd')][_0x0bd5('0xa9')](util[_0x0bd5('0x2a')](_0x0bd5('0x14d'),_0x44b594[_0x0bd5('0x6c')]()),_0x376080[_0x44b594]);}}return this['channel']['noop'](util['format'](_0x0bd5('0x14e'),JSON['stringify'](_0x376080)));}}return _0x463f05;};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x14f')]=function(_0x4087bb){logger['info'](util[_0x0bd5('0x2a')](_0x0bd5('0x150'),_0x4087bb[_0x0bd5('0xaf')]));return this[_0x0bd5('0xd')][_0x0bd5('0x151')](_0x4087bb[_0x0bd5('0x3e')],_0x4087bb[_0x0bd5('0x3f')],_0x4087bb[_0x0bd5('0x40')]);};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x152')]=function(_0x14f58f){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')]('Enter\x20in\x20GOTOIF\x20(%s)\x20block',_0x14f58f[_0x0bd5('0xaf')]));if(!this[_0x0bd5('0xaa')](_0x14f58f[_0x0bd5('0x153')])){return this[_0x0bd5('0xd')][_0x0bd5('0x2e')](_0x14f58f,'no\x20condition\x20configured');}try{var _0x44bde8=eval(_0x14f58f[_0x0bd5('0x153')])?_0x0bd5('0x154'):_0x0bd5('0x155');this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')](_0x0bd5('0x156'),_0x14f58f[_0x0bd5('0x153')],_0x44bde8));return{'code':0xc8,'result':_0x44bde8};}catch(_0x4f063e){return{'code':0xc8,'result':_0x0bd5('0x155')};}};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x157')]=function(_0x1f6da5){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')]('Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block',_0x1f6da5[_0x0bd5('0xaf')]));if(!this[_0x0bd5('0xaa')](_0x1f6da5[_0x0bd5('0x158')])){return this[_0x0bd5('0xd')][_0x0bd5('0x2e')](_0x1f6da5,_0x0bd5('0x159'));}var _0x3936a2=this['getIntervals']['sync'](this,_0x1f6da5[_0x0bd5('0x158')]);if(!_0x3936a2){return this[_0x0bd5('0xd')][_0x0bd5('0x2e')](_0x1f6da5,'no\x20intervals\x20found');}for(var _0x2e50ca=0x0;_0x2e50ca<_0x3936a2[_0x0bd5('0xa1')];_0x2e50ca+=0x1){var _0x26c6d7=this[_0x0bd5('0xd')][_0x0bd5('0xa4')](util[_0x0bd5('0x2a')](_0x0bd5('0x15a'),_0x3936a2[_0x2e50ca]));if(_0x26c6d7[_0x0bd5('0xa7')]===-0x1){return _0x26c6d7;}logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')](_0x0bd5('0x15b'),_0x3936a2[_0x2e50ca],_0x26c6d7[_0x0bd5('0xa5')]));if(_0x26c6d7[_0x0bd5('0xa5')]===_0x0bd5('0x154')){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')](_0x0bd5('0x15b'),_0x3936a2[_0x2e50ca],_0x0bd5('0x154')));this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util['format'](_0x0bd5('0x15b'),_0x3936a2[_0x2e50ca],_0x0bd5('0x154')));return{'code':0xc8,'result':_0x0bd5('0x154')};}else{logger[_0x0bd5('0x30')](util['format'](_0x0bd5('0x15b'),_0x3936a2[_0x2e50ca],'false'));this['channel'][_0x0bd5('0xb0')](util['format']('IFTIME\x20%s\x20%s',_0x3936a2[_0x2e50ca],_0x0bd5('0x155')));}}return{'code':0xc8,'result':_0x0bd5('0x155')};};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x15c')]=function(_0x7463ae){logger['info'](util[_0x0bd5('0x2a')]('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x7463ae[_0x0bd5('0xaf')]));return this['channel'][_0x0bd5('0x15c')]();};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x15d')]=function(_0x592215){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')](_0x0bd5('0x15e'),_0x592215[_0x0bd5('0xaf')]));if(!this[_0x0bd5('0xaa')](_0x592215[_0x0bd5('0x7b')])){return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](_0x0bd5('0xf4'));}var _0x33f0c0=_0x0bd5('0x141');var _0x6e88fa=util['format'](_0x0bd5('0x142'),FILES_PATH,rs[_0x0bd5('0x12b')](0x4));var _0x4faba1=util['format'](_0x0bd5('0xa0'),_0x6e88fa,_0x33f0c0);var _0x18009d=!![];if(_0x592215[_0x0bd5('0x143')]===_0x0bd5('0x144')){_0x18009d=![];}var _0x597660=this['channel'][_0x0bd5('0x145')](_0x6e88fa,_0x33f0c0,_0x592215[_0x0bd5('0x146')],_0x592215[_0x0bd5('0x68')],undefined,_0x18009d);if(_0x597660['result']!==-0x1){this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')]('ispeech\x20%s\x20file\x20created',_0x4faba1));var _0x43faa5=this[_0x0bd5('0x85')][_0x0bd5('0x72')](this,_0x592215,_0x4faba1);if(_0x43faa5){for(var _0x9605c1 in _0x43faa5){if(_0x43faa5['hasOwnProperty'](_0x9605c1)){this['channel'][_0x0bd5('0xa9')](util[_0x0bd5('0x2a')](_0x0bd5('0x15f'),_0x9605c1[_0x0bd5('0x6c')]()),_0x43faa5[_0x9605c1]);}}return this[_0x0bd5('0xd')]['noop'](util[_0x0bd5('0x2a')](_0x0bd5('0x160'),JSON['stringify'](_0x43faa5)));}}return _0x597660;};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x161')]=function(_0x277363){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')]('Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block',_0x277363[_0x0bd5('0xaf')]));if(!this[_0x0bd5('0xaa')](_0x277363[_0x0bd5('0x7b')])){return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](_0x0bd5('0xf4'));}if(!this['isConfigured'](_0x277363['text'])){return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](_0x0bd5('0xb1'));}this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')](_0x0bd5('0x162'),_0x277363['text']));var _0xb64926=this['ispeechTTS'][_0x0bd5('0x72')](this,_0x277363);if(_0xb64926){this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util['format'](_0x0bd5('0x163'),_0xb64926));var _0x3af7b0=this['channel'][_0x0bd5('0x111')](_0xb64926,_0x277363['intKey']);try{fs[_0x0bd5('0x135')](_0xb64926+_0x0bd5('0x136'));}catch(_0x41adb7){logger[_0x0bd5('0x2e')](_0x41adb7);}return _0x3af7b0;}return this['channel'][_0x0bd5('0x2e')](_0x277363,_0x0bd5('0x164'));};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x165')]=function(_0x357f6c){logger[_0x0bd5('0x30')](util['format'](_0x0bd5('0x166'),_0x357f6c[_0x0bd5('0xaf')]));if(!this['isConfigured'](_0x357f6c[_0x0bd5('0x167')])){return this[_0x0bd5('0xd')]['error'](_0x357f6c,_0x0bd5('0x168'));}logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')](_0x0bd5('0x169'),this[_0x0bd5('0xd')]['callerid'],_0x357f6c['findBy']));var _0x3017d9=this[_0x0bd5('0x55')]['sync'](this,_0x357f6c[_0x0bd5('0x167')]);if(_0x3017d9){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')](_0x0bd5('0x16a'),this['channel'][_0x0bd5('0x3a')],_0x357f6c['findBy']));this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util['format'](_0x0bd5('0x16a'),this[_0x0bd5('0xd')]['callerid'],_0x357f6c[_0x0bd5('0x167')]));return{'code':0xc8,'result':'success'};}else{logger[_0x0bd5('0x30')](util['format'](_0x0bd5('0x16b'),this[_0x0bd5('0xd')]['callerid'],_0x357f6c[_0x0bd5('0x167')]));this['channel'][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')](_0x0bd5('0x16b'),this['channel']['callerid'],_0x357f6c['findBy']));return{'code':0xc8,'result':_0x0bd5('0x16c')};}};AGIVertices[_0x0bd5('0xf')]['logout']=function(_0x43c805){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')]('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0x43c805[_0x0bd5('0xaf')]));if(!this[_0x0bd5('0xaa')](_0x43c805[_0x0bd5('0x167')])){return this[_0x0bd5('0xd')][_0x0bd5('0x2e')](_0x43c805,_0x0bd5('0x168'));}logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')](_0x0bd5('0x169'),this[_0x0bd5('0xd')][_0x0bd5('0x3a')],_0x43c805[_0x0bd5('0x167')]));var _0x145e75=this['agentLogout'][_0x0bd5('0x72')](this,_0x43c805['findBy']);if(_0x145e75){logger[_0x0bd5('0x30')](util['format'](_0x0bd5('0x16a'),this['channel'][_0x0bd5('0x3a')],_0x43c805[_0x0bd5('0x167')]));this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')](_0x0bd5('0x16a'),this[_0x0bd5('0xd')][_0x0bd5('0x3a')],_0x43c805[_0x0bd5('0x167')]));return{'code':0xc8,'result':_0x0bd5('0x16d')};}else{logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')](_0x0bd5('0x16b'),this[_0x0bd5('0xd')][_0x0bd5('0x3a')],_0x43c805['findBy']));this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')](_0x0bd5('0x16b'),this['channel'][_0x0bd5('0x3a')],_0x43c805['findBy']));return{'code':0xc8,'result':_0x0bd5('0x16c')};}};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x16e')]=function(_0x3f907d){logger['info'](util[_0x0bd5('0x2a')](_0x0bd5('0x16f'),_0x3f907d['label']));if(!this[_0x0bd5('0xaa')](_0x3f907d[_0x0bd5('0x170')])){return this['channel'][_0x0bd5('0x2e')](_0x3f907d,'no\x20operation\x20configured');}this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')](_0x0bd5('0x171'),_0x3f907d['operation']));var _0x171751=eval(_0x3f907d[_0x0bd5('0x170')]);if(!this[_0x0bd5('0xaa')](_0x3f907d[_0x0bd5('0xe4')])){return this['channel'][_0x0bd5('0xb0')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x1bf149=this[_0x0bd5('0xa4')][_0x0bd5('0x72')](this,_0x3f907d[_0x0bd5('0xe4')]);if(!_0x1bf149){return this['channel'][_0x0bd5('0x2e')](_0x3f907d,_0x0bd5('0xe6'));}if(_[_0x0bd5('0x9e')](_0x171751)){var _0x7109de=this;_0x171751[_0x0bd5('0xe7')](function(_0x4213e9,_0x406e53){_0x7109de['channel'][_0x0bd5('0xa9')](util['format'](_0x0bd5('0x172'),_0x1bf149,_0x406e53),_0x4213e9);});return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')](_0x0bd5('0x173'),_0x1bf149));}else{return this[_0x0bd5('0xd')][_0x0bd5('0xa9')](_0x1bf149,_0x171751);}};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0xb')]=function(_0x536b9f){logger['info'](util['format'](_0x0bd5('0x174'),_0x536b9f[_0x0bd5('0xaf')]));if(_0x536b9f[_0x0bd5('0xac')]===0x0){return this[_0x0bd5('0xab')](_0x536b9f);}_0x536b9f['retry']-=0x1;if(!this[_0x0bd5('0xaa')](_0x536b9f[_0x0bd5('0x122')])){return this['channel'][_0x0bd5('0x2e')](_0x536b9f,_0x0bd5('0x123'));}var _0x2a2059=this[_0x0bd5('0x1e')]['sync'](this,_0x536b9f[_0x0bd5('0x122')]);if(!_0x2a2059){return this[_0x0bd5('0xd')][_0x0bd5('0x2e')](_0x536b9f,'no\x20file\x20audio\x20found');}var _0x1f6463=this[_0x0bd5('0xd')]['getData'](_0x2a2059,_0x536b9f[_0x0bd5('0x126')],_0x536b9f['digit']);var _0x3e3704=_0x1f6463[_0x0bd5('0xa7')];if(_0x1f6463[_0x0bd5('0xa7')]===-0x1){this['createSquareDetailsReport'][_0x0bd5('0x72')](this,_0x536b9f,'-1');return _0x1f6463;}else if(_0x1f6463[_0x0bd5('0xa5')]===_0x0bd5('0x68')){_0x1f6463[_0x0bd5('0xa7')]=_0x1f6463['result'][_0x0bd5('0xa1')]>0x0?_0x1f6463[_0x0bd5('0xa7')]:'t';}else if(_[_0x0bd5('0x48')](_0x1f6463[_0x0bd5('0xa7')])){_0x1f6463[_0x0bd5('0xa7')]='#';_0x3e3704='#';}if(!this['isConfigured'](_0x536b9f[_0x0bd5('0xe4')])){this[_0x0bd5('0xd')][_0x0bd5('0xb0')]('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0x4bec93=this['getVariable'][_0x0bd5('0x72')](this,_0x536b9f[_0x0bd5('0xe4')]);if(!_0x4bec93){return this[_0x0bd5('0xd')][_0x0bd5('0x2e')](_0x536b9f,_0x0bd5('0xe6'));}this['channel'][_0x0bd5('0xa9')](_0x4bec93,_0x3e3704);}this[_0x0bd5('0x39')]['sync'](this,_0x536b9f,_0x3e3704);return _0x1f6463;};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0xb0')]=function(_0x12d23d){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')](_0x0bd5('0x175'),_0x12d23d['label']));return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](_0x12d23d[_0x0bd5('0x176')]||_0x12d23d['label']);};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x177')]=function(_0x4b91aa){logger[_0x0bd5('0x30')](util['format'](_0x0bd5('0x178'),_0x4b91aa[_0x0bd5('0xaf')]));if(!this[_0x0bd5('0xaa')](_0x4b91aa['findBy'])){return this[_0x0bd5('0xd')][_0x0bd5('0x2e')](_0x4b91aa,_0x0bd5('0x168'));}logger[_0x0bd5('0x30')](util['format'](_0x0bd5('0x169'),this[_0x0bd5('0xd')]['callerid'],_0x4b91aa[_0x0bd5('0x167')]));var _0x2b99b6=this[_0x0bd5('0x4f')]['sync'](this,_0x4b91aa[_0x0bd5('0x179')]);var _0x23e35a=this[_0x0bd5('0x51')][_0x0bd5('0x72')](this,_0x4b91aa[_0x0bd5('0x167')],_0x2b99b6);if(_0x23e35a){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')](_0x0bd5('0x16a'),this[_0x0bd5('0xd')][_0x0bd5('0x3a')],_0x4b91aa[_0x0bd5('0x167')]));this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x0bd5('0xd')][_0x0bd5('0x3a')],_0x4b91aa[_0x0bd5('0x167')]));return{'code':0xc8,'result':_0x0bd5('0x16d')};}else{logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')](_0x0bd5('0x16b'),this[_0x0bd5('0xd')]['callerid'],_0x4b91aa[_0x0bd5('0x167')]));this['channel'][_0x0bd5('0xb0')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x0bd5('0x3a')],_0x4b91aa['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x0bd5('0xf')]['playback']=function(_0x3d96fc){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')]('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x3d96fc['label']));if(!this[_0x0bd5('0xaa')](_0x3d96fc['file_id'])){return this[_0x0bd5('0xd')][_0x0bd5('0x2e')](_0x3d96fc,'no\x20file\x20audio\x20selected');}var _0x4b3285=this[_0x0bd5('0x1e')][_0x0bd5('0x72')](this,_0x3d96fc[_0x0bd5('0x122')]);if(!_0x4b3285){return this[_0x0bd5('0xd')][_0x0bd5('0x2e')](_0x3d96fc,_0x0bd5('0x124'));}var _0x1504e5=this[_0x0bd5('0xd')][_0x0bd5('0x5a')](_0x0bd5('0x17a'),[_0x4b3285,_0x3d96fc[_0x0bd5('0x11e')]]);if(_0x1504e5['result']===-0x1){return _0x1504e5;}return this[_0x0bd5('0xd')]['noop'](util[_0x0bd5('0x2a')](_0x0bd5('0xce'),'PLAYBACK',_0x4b3285));};AGIVertices['prototype']['queue']=function(_0x465452){logger['info'](util[_0x0bd5('0x2a')]('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x465452[_0x0bd5('0xaf')]));if(!this['isConfigured'](_0x465452['queue_id'])){return this[_0x0bd5('0xd')][_0x0bd5('0x2e')](_0x465452,_0x0bd5('0x17b'));}var _0x316e4c='';var _0x4edadd=parseInt(_0x465452[_0x0bd5('0x17c')],0xa);if(isNaN(_0x4edadd)){_0x316e4c=_0x465452[_0x0bd5('0x17c')];}else{_0x316e4c=this[_0x0bd5('0x13')][_0x0bd5('0x72')](this,_0x465452['queue_id']);if(!_0x316e4c){return this[_0x0bd5('0xd')]['error'](_0x465452,'no\x20queue\x20found');}}var _0x4010d7='';if(this[_0x0bd5('0xaa')](_0x465452['file_id'])){var _0x31beee=this[_0x0bd5('0x1e')][_0x0bd5('0x72')](this,_0x465452[_0x0bd5('0x122')]);if(_0x31beee){_0x4010d7=_0x31beee;}}this[_0x0bd5('0x39')]['sync'](this,_0x465452,_0x316e4c);if(_0x465452[_0x0bd5('0x11e')]['indexOf']('x')<0x0){_0x465452['opts']+='x';}if(_0x465452['opts'][_0x0bd5('0x17d')]('X')<0x0){_0x465452[_0x0bd5('0x11e')]+='X';}this[_0x0bd5('0xd')][_0x0bd5('0xa9')](_0x0bd5('0x17e'),_0x316e4c?_0x316e4c['toLowerCase']():'');var _0x1a22db=this[_0x0bd5('0xd')][_0x0bd5('0x5a')](_0x0bd5('0x17f'),[_0x316e4c,_0x465452[_0x0bd5('0x11e')],_0x465452[_0x0bd5('0x67')],_0x4010d7,_0x465452[_0x0bd5('0x68')],_0x465452[_0x0bd5('0xbc')],_0x465452[_0x0bd5('0x180')],_0x465452[_0x0bd5('0x181')],'',_0x465452[_0x0bd5('0x182')]]);if(_0x1a22db['result']===-0x1){return _0x1a22db;}return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')](_0x0bd5('0xce'),_0x0bd5('0x17f'),_0x316e4c));};AGIVertices[_0x0bd5('0xf')]['record']=function(_0x28d03a){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')](_0x0bd5('0x183'),_0x28d03a[_0x0bd5('0xaf')]));var _0x4655f1=_0x28d03a[_0x0bd5('0x184')]||_0x0bd5('0x141');var _0x5ba2ec=util[_0x0bd5('0x2a')](_0x0bd5('0x185'),this[_0x0bd5('0xd')][_0x0bd5('0x3c')],rs[_0x0bd5('0x12b')](0x5));var _0x4e77c9=util[_0x0bd5('0x2a')](_0x0bd5('0x186'),FILES_PATH,_0x5ba2ec,_0x4655f1);var _0x38f391=util[_0x0bd5('0x2a')]('%s/recordings/%s',FILES_PATH,_0x5ba2ec);this[_0x0bd5('0x3b')][_0x0bd5('0x72')](this,_0x28d03a,_0x5ba2ec,_0x4e77c9);this[_0x0bd5('0xd')][_0x0bd5('0xa9')](_0x0bd5('0x187'),_0x5ba2ec);logger['info']('Recording\x20%s\x20%s\x20%s\x20%s',_0x38f391,_0x4655f1,_0x28d03a[_0x0bd5('0x188')],_0x28d03a[_0x0bd5('0x68')]);return this[_0x0bd5('0xd')]['recordFile'](_0x38f391,_0x4655f1,_0x28d03a[_0x0bd5('0x188')],_0x28d03a[_0x0bd5('0x68')],undefined,!![]);};AGIVertices[_0x0bd5('0xf')]['restapi']=function(_0xb556c6){logger['info'](util[_0x0bd5('0x2a')](_0x0bd5('0x189'),_0xb556c6[_0x0bd5('0xaf')]));if(!this[_0x0bd5('0xaa')](_0xb556c6['url'])){return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](_0x0bd5('0x18a'));}var _0x3c45bf=this[_0x0bd5('0x66')][_0x0bd5('0x72')](this,_0xb556c6);logger['info'](util[_0x0bd5('0x2a')]('Response:',util[_0x0bd5('0x18b')](_0x3c45bf,{'showHidden':![],'depth':null})));if(!this[_0x0bd5('0xaa')](_0xb556c6[_0x0bd5('0xe4')])){return this[_0x0bd5('0xd')]['noop'](_0x0bd5('0x18c'));}var _0x118a01=this[_0x0bd5('0xa4')][_0x0bd5('0x72')](this,_0xb556c6[_0x0bd5('0xe4')]);if(!_0x118a01){return this[_0x0bd5('0xd')][_0x0bd5('0x2e')](_0xb556c6,_0x0bd5('0xe6'));}this[_0x0bd5('0xd')][_0x0bd5('0xa9')](util['format'](_0x0bd5('0x18d'),_0x118a01),_0x3c45bf[_0x0bd5('0x18e')]?_0x3c45bf[_0x0bd5('0x18e')]:_0x0bd5('0x18f'));this[_0x0bd5('0xd')][_0x0bd5('0xa9')](util['format'](_0x0bd5('0x190'),_0x118a01),_0x3c45bf[_0x0bd5('0x191')]?_0x3c45bf[_0x0bd5('0x191')]:'OK');if(_0x3c45bf[_0x0bd5('0x6d')]){try{this[_0x0bd5('0x9f')](_0x3c45bf['body'],_0x118a01);}catch(_0x2be7e2){logger[_0x0bd5('0x2e')](util[_0x0bd5('0x2a')](_0x0bd5('0x192'),_0x118a01));}}return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util['format'](_0x0bd5('0xeb'),_0x118a01));};AGIVertices[_0x0bd5('0xf')]['saydigits']=function(_0x23bfb7){logger[_0x0bd5('0x30')](util['format'](_0x0bd5('0x193'),_0x23bfb7['label']));return this[_0x0bd5('0xd')][_0x0bd5('0x194')](_0x23bfb7['digits']['replace'](/\s+/g,''),_0x23bfb7[_0x0bd5('0x188')]);};AGIVertices[_0x0bd5('0xf')]['saynumber']=function(_0x497cdf){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')](_0x0bd5('0x195'),_0x497cdf['label']));return this[_0x0bd5('0xd')]['sayNumber'](_0x497cdf['number'][_0x0bd5('0x5b')](/\s+/g,''),_0x497cdf[_0x0bd5('0x188')]);};AGIVertices[_0x0bd5('0xf')]['sayphonetic']=function(_0x4cbb81){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')](_0x0bd5('0x196'),_0x4cbb81[_0x0bd5('0xaf')]));return this[_0x0bd5('0xd')]['sayPhonetic'](_0x4cbb81[_0x0bd5('0x5d')],_0x4cbb81[_0x0bd5('0x188')]);};AGIVertices[_0x0bd5('0xf')]['sendMail']=function(_0x1827f9){logger['info'](util[_0x0bd5('0x2a')](_0x0bd5('0x197'),_0x1827f9['label']));if(!this[_0x0bd5('0xaa')](_0x1827f9[_0x0bd5('0x198')])){return this['channel'][_0x0bd5('0xb0')](_0x0bd5('0x199'));}var _0x14dbae=this[_0x0bd5('0x22')][_0x0bd5('0x72')](this,_0x1827f9[_0x0bd5('0x198')]);if(!_0x14dbae||!_0x14dbae[_0x0bd5('0x19a')]){return this[_0x0bd5('0xd')]['error'](_0x1827f9,_0x0bd5('0x19b'));}var _0x41215a={'from':util[_0x0bd5('0x2a')](_0x0bd5('0x19c'),_0x14dbae['name'],_0x14dbae[_0x0bd5('0x19d')]||_0x14dbae['Smtp']['user']),'to':_0x1827f9['to']||'','cc':_0x1827f9['cc']||'','bcc':_0x1827f9['bcc']||'','subject':_0x1827f9['subject'],'html':_0x1827f9[_0x0bd5('0x5d')],'text':_0x1827f9[_0x0bd5('0x5d')]};if(this[_0x0bd5('0xaa')](_0x1827f9[_0x0bd5('0x19e')])){}logger[_0x0bd5('0xed')](_0x0bd5('0x19f'),JSON[_0x0bd5('0x75')](_0x41215a));this[_0x0bd5('0x39')][_0x0bd5('0x72')](this,_0x1827f9,_0x1827f9[_0x0bd5('0x198')]);this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')](_0x0bd5('0x1a0'),_0x14dbae[_0x0bd5('0x16')]));this['sendMailMessage'][_0x0bd5('0x72')](this,_0x14dbae[_0x0bd5('0x1a1')],_0x41215a);return this['channel'][_0x0bd5('0xb0')](_0x0bd5('0x1a2'));};AGIVertices[_0x0bd5('0xf')]['sendFax']=function(_0x1d1b6f){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')](_0x0bd5('0x1a3'),_0x1d1b6f[_0x0bd5('0xaf')]));return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](_0x0bd5('0x1a4'));};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x1a5')]=function(_0x23ce8c){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')]('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x23ce8c['label']));if(!this[_0x0bd5('0xaa')](_0x23ce8c['sms_account_id'])){return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](_0x0bd5('0x1a6'));}var _0x3f0cd7=this[_0x0bd5('0x36')][_0x0bd5('0x72')](this,_0x23ce8c[_0x0bd5('0x1a7')]);if(!_0x3f0cd7){return this[_0x0bd5('0xd')][_0x0bd5('0x2e')](_0x23ce8c,_0x0bd5('0x1a8'));}var _0x42dd38={'body':_0x23ce8c[_0x0bd5('0x1a9')],'phone':_0x23ce8c['to']||'','SmsAccountId':_0x3f0cd7['id']};logger[_0x0bd5('0xed')]('sendSMS\x20message',JSON['stringify'](_0x42dd38));this[_0x0bd5('0x39')][_0x0bd5('0x72')](this,_0x23ce8c,_0x23ce8c[_0x0bd5('0x1a7')]);this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')](_0x0bd5('0x1aa'),_0x3f0cd7['name']));this[_0x0bd5('0x38')][_0x0bd5('0x72')](this,_0x42dd38);return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](_0x0bd5('0x1ab'));};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x1ac')]=function(_0x15add0){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')]('Enter\x20in\x20SET\x20(%s)\x20block',_0x15add0[_0x0bd5('0xaf')]));if(!this[_0x0bd5('0xaa')](_0x15add0[_0x0bd5('0xe4')])){return this[_0x0bd5('0xd')]['error'](_0x15add0,_0x0bd5('0x1ad'));}var _0x536880=this[_0x0bd5('0xa4')][_0x0bd5('0x72')](this,_0x15add0[_0x0bd5('0xe4')]);if(!_0x536880){return this[_0x0bd5('0xd')][_0x0bd5('0x2e')](_0x15add0,_0x0bd5('0xe6'));}return this['channel'][_0x0bd5('0xa9')](_0x536880,_0x15add0['variable_value']);};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x1ae')]=function(_0x3a412b){logger['info'](util[_0x0bd5('0x2a')](_0x0bd5('0x1af'),_0x3a412b['label']));this[_0x0bd5('0xd')][_0x0bd5('0xb0')]('START\x20CALLY\x20SQUARE');var _0x41b6df=this['channel'][_0x0bd5('0xa4')]('XMCS-UNIQUEID');if(!_['isEmpty'](_0x41b6df[_0x0bd5('0xa5')])){this[_0x0bd5('0xd')][_0x0bd5('0x3c')]=_0x41b6df[_0x0bd5('0xa5')];}if(_0x3a412b[_0x0bd5('0xc0')]===_0x0bd5('0x1b0')){this[_0x0bd5('0xd')][_0x0bd5('0xb0')](_0x0bd5('0x1b1'));return this[_0x0bd5('0xd')]['answer']();}return this[_0x0bd5('0xd')]['noop'](_0x0bd5('0x1b2'));};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x1b3')]=function(_0x282953){logger['info'](util[_0x0bd5('0x2a')](_0x0bd5('0x1b4'),_0x282953['label']));if(!this[_0x0bd5('0xaa')](_0x282953['project_id'])){return this[_0x0bd5('0xd')]['error'](_0x282953,_0x0bd5('0x1b5'));}var _0x3c24d2=this['getSquareProject'][_0x0bd5('0x72')](this,_0x282953['project_id']);if(!this['isConfigured'](_0x3c24d2)){return this[_0x0bd5('0xd')][_0x0bd5('0x2e')](_0x282953,util['format'](_0x0bd5('0x1b6'),_0x282953[_0x0bd5('0x1b7')]));}if(_0x3c24d2===this[_0x0bd5('0xd')]['arg_1']){return this[_0x0bd5('0xd')][_0x0bd5('0x2e')](_0x282953,_0x0bd5('0x1b8'));}this['createSquareDetailsReport']['sync'](this,_0x282953,_0x3c24d2);var _0xdb0a02=this[_0x0bd5('0xd')][_0x0bd5('0x5a')](_0x0bd5('0x1b9'),util[_0x0bd5('0x2a')](_0x0bd5('0x1ba'),config[_0x0bd5('0xbc')]['host']||_0x0bd5('0x1bb'),_0x3c24d2,this[_0x0bd5('0xd')][_0x0bd5('0x43')]));if(_0xdb0a02['result']===-0x1){return _0xdb0a02;}return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')]('Executed\x20command\x20%s\x20%s',_0x0bd5('0x1b9'),_0x3c24d2));};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x1bc')]=function(_0x3797c2){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')](_0x0bd5('0x1bd'),_0x3797c2[_0x0bd5('0xaf')]));var _0x50d6d4=this[_0x0bd5('0x59')]['sync'](this,_0x3797c2['command']);this['createSquareDetailsReport'][_0x0bd5('0x72')](this,_0x3797c2,_0x3797c2[_0x0bd5('0xbe')]);if(this[_0x0bd5('0xaa')](_0x3797c2[_0x0bd5('0xe4')])){var _0xa4bc74=this[_0x0bd5('0xa4')]['sync'](this,_0x3797c2[_0x0bd5('0xe4')]);if(_0xa4bc74){this[_0x0bd5('0xd')][_0x0bd5('0xa9')](_0xa4bc74,_0x50d6d4);return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')](_0x0bd5('0x1be'),_0x3797c2[_0x0bd5('0xbe')],_0xa4bc74));}}return this['channel'][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')](_0x0bd5('0x1bf'),_0x3797c2[_0x0bd5('0xbe')]));};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x1c0')]=function(_0xf92b03){logger['info'](util['format'](_0x0bd5('0x1c1'),_0xf92b03[_0x0bd5('0xaf')]));_0xf92b03[_0x0bd5('0x5d')]=_0xf92b03[_0x0bd5('0x5d')][_0x0bd5('0x5b')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x0bd5('0xaa')](_0xf92b03[_0x0bd5('0x5c')])){return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](_0x0bd5('0x1c2'));}if(!this[_0x0bd5('0xaa')](_0xf92b03[_0x0bd5('0x5d')])){return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](_0x0bd5('0xb1'));}this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')](_0x0bd5('0x1c3'),_0xf92b03[_0x0bd5('0x5d')]));var _0x452a90=this['googleCloudTTS'][_0x0bd5('0x72')](this,_0xf92b03);if(_0x452a90){this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util['format'](_0x0bd5('0x1c4'),_0x452a90));var _0x3ba9eb=this['channel'][_0x0bd5('0x111')](_0x452a90);try{fs[_0x0bd5('0x135')](_0x452a90+_0x0bd5('0x136'));}catch(_0x2aae79){logger[_0x0bd5('0x2e')](_0x2aae79);}return _0x3ba9eb;}return this[_0x0bd5('0xd')]['error'](_0xf92b03,_0x0bd5('0x1c5'));};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x1c6')]=function(_0x27cdf0){logger[_0x0bd5('0x30')](util['format'](_0x0bd5('0x1c7'),_0x27cdf0[_0x0bd5('0xaf')]));_0x27cdf0[_0x0bd5('0x5d')]=_0x27cdf0[_0x0bd5('0x5d')][_0x0bd5('0x5b')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x0bd5('0xaa')](_0x27cdf0[_0x0bd5('0x5d')])){return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](_0x0bd5('0xb1'));}this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util['format'](_0x0bd5('0x1c8'),_0x27cdf0[_0x0bd5('0x5d')]));var _0x3f8b2f=this[_0x0bd5('0x64')]['sync'](this,_0x27cdf0);if(_0x3f8b2f){this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')](_0x0bd5('0x1c9'),_0x3f8b2f));var _0x75e291=this['channel'][_0x0bd5('0x111')](_0x3f8b2f);try{fs[_0x0bd5('0x135')](_0x3f8b2f+'.wav');}catch(_0x4c23a4){logger[_0x0bd5('0x2e')](_0x4c23a4);}return _0x75e291;}return this[_0x0bd5('0xd')][_0x0bd5('0x2e')](_0x27cdf0,_0x0bd5('0x1ca'));};AGIVertices['prototype'][_0x0bd5('0x1cb')]=function(_0x1685b4){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')]('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0x1685b4[_0x0bd5('0xaf')]));if(!this[_0x0bd5('0xaa')](_0x1685b4[_0x0bd5('0x167')])){return this[_0x0bd5('0xd')][_0x0bd5('0x2e')](_0x1685b4,_0x0bd5('0x168'));}logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')](_0x0bd5('0x169'),this[_0x0bd5('0xd')][_0x0bd5('0x3a')],_0x1685b4[_0x0bd5('0x167')]));var _0x2e3f18=this[_0x0bd5('0x53')][_0x0bd5('0x72')](this,_0x1685b4[_0x0bd5('0x167')]);if(_0x2e3f18){logger[_0x0bd5('0x30')](util['format'](_0x0bd5('0x16a'),this[_0x0bd5('0xd')][_0x0bd5('0x3a')],_0x1685b4[_0x0bd5('0x167')]));this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util['format'](_0x0bd5('0x16a'),this[_0x0bd5('0xd')][_0x0bd5('0x3a')],_0x1685b4[_0x0bd5('0x167')]));return{'code':0xc8,'result':_0x0bd5('0x16d')};}else{logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0x0bd5('0x3a')],_0x1685b4[_0x0bd5('0x167')]));this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')](_0x0bd5('0x16b'),this[_0x0bd5('0xd')][_0x0bd5('0x3a')],_0x1685b4['findBy']));return{'code':0xc8,'result':_0x0bd5('0x16c')};}};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x1cc')]=function(_0x50911a){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')]('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x50911a[_0x0bd5('0xaf')]));var _0x2f083b=this[_0x0bd5('0xd')][_0x0bd5('0x5a')](_0x0bd5('0x1cd'),[_0x50911a[_0x0bd5('0x1ce')],_0x50911a[_0x0bd5('0x79')]]);if(_0x2f083b['result']===-0x1){return _0x2f083b;}return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')](_0x0bd5('0xce'),_0x0bd5('0x1cd'),_0x50911a[_0x0bd5('0x1ce')]));};AGIVertices[_0x0bd5('0xf')]['vswitch']=function(_0x31e58e){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')](_0x0bd5('0x1cf'),_0x31e58e[_0x0bd5('0xaf')]));if(!this[_0x0bd5('0xaa')](_0x31e58e['variable_id'])){return this[_0x0bd5('0xd')]['error'](_0x31e58e,_0x0bd5('0x1ad'));}var _0x49077c=this[_0x0bd5('0xa4')][_0x0bd5('0x72')](this,_0x31e58e[_0x0bd5('0xe4')]);if(!_0x49077c){return this[_0x0bd5('0xd')]['error'](_0x31e58e,_0x0bd5('0xe6'));}var _0x161c39=this[_0x0bd5('0xd')][_0x0bd5('0xa4')](_0x49077c);return{'code':0xc8,'result':_0x161c39[_0x0bd5('0xa5')]?_0x161c39[_0x0bd5('0xa5')]:'-'};};String[_0x0bd5('0xf')][_0x0bd5('0xa3')]=function(_0x6d1308,_0x1c8003){return this['split'](_0x6d1308)[_0x0bd5('0x1d0')](_0x1c8003);};module[_0x0bd5('0x1d1')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index b10a7d1..b98648b 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 _0x5f3d=['hanguprequest','syncHangupRequest','bind','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','prototype','updateAcw','timers','lastPauseAt','timer','update','uniqueid','info','finally','startAcw','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','QueuePause','then','getAgent','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','available','paused','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','stopAcw','YYYY-MM-DD\x20HH:mm:ss','catch','error','[ACW][START]\x20%s','message','saveUnpause','[%s][UPDATE][ACWTIME:%s]','[%s][UPDATE][ERRORS:%s]','interface','[ACW][syncAgentConnect]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','stringify','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','[ACW][syncAgentRingNoAnswer]\x20%s','exports','moment','../ami','../../../config/logger','acw','../rpc/voiceAgentReport','voiceQueues','agents','channels','agentconnect'];(function(_0x7275e9,_0x321fa5){var _0x17b99d=function(_0x54af41){while(--_0x54af41){_0x7275e9['push'](_0x7275e9['shift']());}};_0x17b99d(++_0x321fa5);}(_0x5f3d,0x191));var _0xd5f3=function(_0x39c2e7,_0x1bdb27){_0x39c2e7=_0x39c2e7-0x0;var _0x45981d=_0x5f3d[_0x39c2e7];return _0x45981d;};'use strict';var _=require('lodash');var moment=require(_0xd5f3('0x0'));var ami=require(_0xd5f3('0x1'));var logger=require(_0xd5f3('0x2'))(_0xd5f3('0x3'));var RpcUser=require('../rpc/user');var RpcVoiceAgentReport=require(_0xd5f3('0x4'));function Acw(_0x4109f7){this[_0xd5f3('0x5')]=_0x4109f7[_0xd5f3('0x5')];this[_0xd5f3('0x6')]=_0x4109f7[_0xd5f3('0x6')];this['timers']=_0x4109f7['timers'];this[_0xd5f3('0x7')]={};ami['on'](_0xd5f3('0x8'),this['syncAgentConnect']['bind'](this));ami['on'](_0xd5f3('0x9'),this[_0xd5f3('0xa')][_0xd5f3('0xb')](this));ami['on'](_0xd5f3('0xc'),this[_0xd5f3('0xd')]['bind'](this));ami['on'](_0xd5f3('0xe'),this[_0xd5f3('0xf')][_0xd5f3('0xb')](this));ami['on']('attendedtransfer',this[_0xd5f3('0x10')][_0xd5f3('0xb')](this));ami['on'](_0xd5f3('0x11'),this[_0xd5f3('0x12')]['bind'](this));ami['on'](_0xd5f3('0x13'),this[_0xd5f3('0x14')][_0xd5f3('0xb')](this));}function getDiff(_0x405e1c){var _0xe63aed=moment()[_0xd5f3('0x15')](0x0);var _0x7868af=moment(_0x405e1c)[_0xd5f3('0x15')](0x0);return _0xe63aed[_0xd5f3('0x16')](_0x7868af,'seconds');}Acw[_0xd5f3('0x17')][_0xd5f3('0x18')]=function(_0x10d269,_0xd48532){var _0x28c97d=this;var _0x26bc25=getDiff(_0x28c97d[_0xd5f3('0x19')][_0x10d269][_0xd5f3('0x1a')]);clearTimeout(_0x28c97d[_0xd5f3('0x19')][_0x10d269]['timer']);_0x28c97d['timers'][_0x10d269][_0xd5f3('0x1b')]=![];return RpcVoiceAgentReport[_0xd5f3('0x1c')]({'acwtime':_0x26bc25},_0x28c97d[_0xd5f3('0x19')][_0x10d269][_0xd5f3('0x1d')],_0x10d269)['then'](function(_0x538cd7){logger[_0xd5f3('0x1e')]('[%s][UPDATE][ACWTIME:%s]',_0xd48532,_0x26bc25,_0x538cd7);})['catch'](function(_0x5ed7b7){logger['error']('[%s][UPDATE][ERRORS:%s]',_0xd48532,_0x5ed7b7);})[_0xd5f3('0x1f')](function(){delete _0x28c97d['timers'][_0x10d269];});};Acw[_0xd5f3('0x17')][_0xd5f3('0x20')]=function(_0x59090f){try{var _0x505391=this;var _0x3239a6=this[_0xd5f3('0x7')][_0x59090f]['interface'];var _0x4655bc=this[_0xd5f3('0x7')][_0x59090f][_0xd5f3('0x21')];var _0xb3eb74=this['voiceQueues'][_0x4655bc];var _0x3a10c1=![];var _0x82242d=_0xd5f3('0x22');if(_0xb3eb74[_0xd5f3('0x23')]&&_0xb3eb74[_0xd5f3('0x24')][_0xd5f3('0x25')]){_0x3a10c1=!![];_0x82242d=_0xb3eb74[_0xd5f3('0x24')][_0xd5f3('0x25')];}return ami['Action']({'action':_0xd5f3('0x26'),'interface':_0x3239a6,'paused':!![],'reason':_0x82242d})[_0xd5f3('0x27')](function(){if(_0x505391[_0xd5f3('0x6')][_0x3239a6]){return RpcUser[_0xd5f3('0x28')](_0x505391[_0xd5f3('0x6')][_0x3239a6]['id'])[_0xd5f3('0x27')](function(_0x36b6f0){if(!_0x36b6f0||_0x36b6f0['voicePause']){logger[_0xd5f3('0x1e')]('[%s][INPAUSE][AGENT:%s][QUEUE:%s]',_0x59090f,_0x3239a6,_0x4655bc);return;}logger[_0xd5f3('0x1e')](_0xd5f3('0x29'),_0x59090f,_0x3239a6,_0x4655bc);var _0x16a252=_0x505391[_0xd5f3('0x7')][_0x59090f][_0xd5f3('0x2a')]&&_0x505391[_0xd5f3('0x7')][_0x59090f][_0xd5f3('0x2b')]?_0x505391[_0xd5f3('0x7')][_0x59090f]['destlinkedid']:_0x59090f;return RpcUser[_0xd5f3('0x2c')](_0x505391[_0xd5f3('0x6')][_0x3239a6],_0x82242d,_0x16a252)[_0xd5f3('0x27')](function(_0x5cbe34){_0x505391['voiceQueues'][_0x4655bc][_0xd5f3('0x2d')]-=0x1;_0x505391['voiceQueues'][_0x4655bc][_0xd5f3('0x2e')]+=0x1;return _0x5cbe34;});})[_0xd5f3('0x27')](function(_0x5b54bd){if(_0x3a10c1||!_0x5b54bd){return;}_0x505391[_0xd5f3('0x19')][_0x3239a6]={};logger['info'](_0xd5f3('0x2f'),_0x59090f,_0x505391[_0xd5f3('0x5')][_0x4655bc][_0xd5f3('0x30')],_0x3239a6,_0x4655bc);_0x505391[_0xd5f3('0x19')][_0x3239a6][_0xd5f3('0x1b')]=setTimeout(_0x505391[_0xd5f3('0x31')][_0xd5f3('0xb')](_0x505391,_0x3239a6),_0x505391[_0xd5f3('0x5')][_0x4655bc][_0xd5f3('0x30')]*0x3e8);_0x505391[_0xd5f3('0x19')][_0x3239a6][_0xd5f3('0x1a')]=moment()['format'](_0xd5f3('0x32'));_0x505391[_0xd5f3('0x19')][_0x3239a6][_0xd5f3('0x1d')]=_0x59090f;_0x505391[_0xd5f3('0x19')][_0x3239a6][_0xd5f3('0x21')]=_0x4655bc;_0x505391[_0xd5f3('0x19')][_0x3239a6][_0xd5f3('0x18')]=_0x505391[_0xd5f3('0x18')][_0xd5f3('0xb')](_0x505391,_0x3239a6,_0x59090f);});}})[_0xd5f3('0x33')](function(){logger[_0xd5f3('0x34')](_0xd5f3('0x2f'),_0x59090f,_0x505391[_0xd5f3('0x5')][_0x4655bc][_0xd5f3('0x30')],_0x3239a6,_0x4655bc);})['finally'](function(){delete _0x505391['channels'][_0x59090f];});}catch(_0x349463){logger[_0xd5f3('0x34')](_0xd5f3('0x35'),_0x349463[_0xd5f3('0x36')]);}};Acw[_0xd5f3('0x17')][_0xd5f3('0x31')]=function(_0x430367){try{var _0x3efa05=this;if(_0x3efa05['timers'][_0x430367]){_0x3efa05[_0xd5f3('0x19')][_0x430367][_0xd5f3('0x1b')]=![];var _0x19478c=_0x3efa05[_0xd5f3('0x19')][_0x430367]['uniqueid'];var _0x431703=_0x3efa05[_0xd5f3('0x19')][_0x430367][_0xd5f3('0x21')];var _0x52608e=_0x3efa05['voiceQueues'][_0x431703][_0xd5f3('0x30')];logger[_0xd5f3('0x1e')]('[%s][TIMER][STOP][AGENT:%s]',_0x19478c,_0x430367);RpcUser['getAgent'](this[_0xd5f3('0x6')][_0x430367]['id'])[_0xd5f3('0x27')](function(_0x2fe421){if(_0x2fe421['pauseType']===_0xd5f3('0x22')){return RpcUser[_0xd5f3('0x37')](_0x3efa05[_0xd5f3('0x6')][_0x430367]);}});RpcVoiceAgentReport[_0xd5f3('0x1c')]({'acwtime':_0x52608e,'agentacw':!![]},_0x19478c,_0x430367)[_0xd5f3('0x27')](function(_0x155330){logger[_0xd5f3('0x1e')](_0xd5f3('0x38'),_0x19478c,_0x52608e,_0x155330);})[_0xd5f3('0x33')](function(_0x10e888){logger[_0xd5f3('0x34')](_0xd5f3('0x39'),_0x19478c,_0x10e888);});}else{logger['error']('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0x430367);if(_0x3efa05[_0xd5f3('0x19')]){logger[_0xd5f3('0x1e')]('[ACW][TIMERS]',JSON['stringify'](_0x3efa05[_0xd5f3('0x19')]));}}}catch(_0x1ad726){logger[_0xd5f3('0x34')]('[ACW][STOP]\x20%s',_0x1ad726['message']);}};Acw['prototype']['syncAgentConnect']=function(_0x27c5c3){try{if(this[_0xd5f3('0x5')][_0x27c5c3[_0xd5f3('0x21')]]&&(this['voiceQueues'][_0x27c5c3[_0xd5f3('0x21')]][_0xd5f3('0x3')]||this[_0xd5f3('0x5')][_0x27c5c3[_0xd5f3('0x21')]][_0xd5f3('0x23')])){if(this[_0xd5f3('0x6')][_0x27c5c3[_0xd5f3('0x3a')]]){this[_0xd5f3('0x7')][_0x27c5c3[_0xd5f3('0x1d')]]={'queue':_0x27c5c3[_0xd5f3('0x21')],'interface':_0x27c5c3[_0xd5f3('0x3a')],'destlinkedid':_0x27c5c3[_0xd5f3('0x2b')]};}}}catch(_0x2e28ed){logger[_0xd5f3('0x34')](_0xd5f3('0x3b'),_0x2e28ed[_0xd5f3('0x36')]);}};Acw['prototype']['syncAgentConnectPreview']=function(_0x343150){try{if(this['voiceQueues'][_0x343150[_0xd5f3('0x21')]]&&(this[_0xd5f3('0x5')][_0x343150[_0xd5f3('0x21')]]['acw']||this[_0xd5f3('0x5')][_0x343150['queue']]['mandatoryDisposition'])){if(this[_0xd5f3('0x6')][_0x343150['interface']]){this[_0xd5f3('0x7')][_0x343150[_0xd5f3('0x1d')]]={'queue':_0x343150[_0xd5f3('0x21')],'interface':_0x343150[_0xd5f3('0x3a')]};}}}catch(_0x1b7519){logger[_0xd5f3('0x34')]('[ACW][syncAgentConnectPreview]\x20%s',_0x1b7519[_0xd5f3('0x36')]);}};Acw[_0xd5f3('0x17')]['syncHangupRequest']=function(_0x478aa4){try{if(this['channels'][_0x478aa4[_0xd5f3('0x1d')]]&&_[_0xd5f3('0x3c')](this[_0xd5f3('0x7')][_0x478aa4['uniqueid']]['attended'])){logger['info'](_0xd5f3('0x3d'),_0x478aa4['uniqueid']);this[_0xd5f3('0x20')](_0x478aa4['uniqueid']);}else if(this[_0xd5f3('0x7')][_0x478aa4[_0xd5f3('0x3e')]]&&_['isUndefined'](this[_0xd5f3('0x7')][_0x478aa4[_0xd5f3('0x3e')]][_0xd5f3('0x2a')])){logger[_0xd5f3('0x1e')](_0xd5f3('0x3f'),_0x478aa4[_0xd5f3('0x3e')]);this[_0xd5f3('0x20')](_0x478aa4['linkedid']);}}catch(_0x2ec577){logger['error']('[ACW][syncHangupRequest]\x20%s',_0x2ec577[_0xd5f3('0x36')]);}};Acw[_0xd5f3('0x17')][_0xd5f3('0xd')]=function(_0xe9cbd2){try{if(this[_0xd5f3('0x7')][_0xe9cbd2[_0xd5f3('0x1d')]]&&this[_0xd5f3('0x7')][_0xe9cbd2['uniqueid']][_0xd5f3('0x2a')]){logger[_0xd5f3('0x1e')]('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0xe9cbd2[_0xd5f3('0x1d')]);this[_0xd5f3('0x20')](_0xe9cbd2['uniqueid']);}else if(this[_0xd5f3('0x7')][_0xe9cbd2[_0xd5f3('0x3e')]]&&this[_0xd5f3('0x7')][_0xe9cbd2['linkedid']][_0xd5f3('0x2a')]){logger[_0xd5f3('0x1e')](_0xd5f3('0x40'),_0xe9cbd2[_0xd5f3('0x3e')]);this[_0xd5f3('0x20')](_0xe9cbd2[_0xd5f3('0x3e')]);}}catch(_0x283070){logger[_0xd5f3('0x34')]('[ACW][syncHangup]\x20%s',_0x283070['message']);}};Acw[_0xd5f3('0x17')][_0xd5f3('0x10')]=function(_0x207bd6){try{if(!_[_0xd5f3('0x41')](this[_0xd5f3('0x7')][_0x207bd6[_0xd5f3('0x42')]])){this[_0xd5f3('0x20')](_0x207bd6['transfereeuniqueid']);if(this[_0xd5f3('0x7')][_0x207bd6[_0xd5f3('0x43')]]){this[_0xd5f3('0x7')][_0x207bd6[_0xd5f3('0x43')]][_0xd5f3('0x2a')]=!![];this['channels'][_0x207bd6['transfertargetuniqueid']]=this[_0xd5f3('0x7')][_0x207bd6['secondtransfereruniqueid']];delete this[_0xd5f3('0x7')][_0x207bd6[_0xd5f3('0x43')]];}}else if(!_[_0xd5f3('0x41')](this[_0xd5f3('0x7')][_0x207bd6[_0xd5f3('0x44')]])){this[_0xd5f3('0x20')](_0x207bd6[_0xd5f3('0x44')]);if(this['channels'][_0x207bd6[_0xd5f3('0x45')]]){this['channels'][_0x207bd6['origtransfereruniqueid']][_0xd5f3('0x2a')]=!![];this[_0xd5f3('0x7')][_0x207bd6[_0xd5f3('0x42')]]=this[_0xd5f3('0x7')][_0x207bd6['origtransfereruniqueid']];delete this['channels'][_0x207bd6[_0xd5f3('0x45')]];}}}catch(_0x4d7389){logger['error'](_0xd5f3('0x46'),_0x4d7389[_0xd5f3('0x36')]);}};Acw[_0xd5f3('0x17')][_0xd5f3('0x12')]=function(_0x2a70ac){try{if(this[_0xd5f3('0x7')][_0x2a70ac[_0xd5f3('0x47')]]){logger[_0xd5f3('0x1e')](_0xd5f3('0x48'),JSON[_0xd5f3('0x49')](_0x2a70ac[_0xd5f3('0x47')]));this[_0xd5f3('0x20')](_0x2a70ac[_0xd5f3('0x47')]);}else if(this[_0xd5f3('0x7')][_0x2a70ac[_0xd5f3('0x4a')]]){logger[_0xd5f3('0x1e')](_0xd5f3('0x4b'),JSON[_0xd5f3('0x49')](_0x2a70ac[_0xd5f3('0x4a')]));this[_0xd5f3('0x20')](_0x2a70ac['transfererlinkedid']);}}catch(_0x312366){logger[_0xd5f3('0x34')](_0xd5f3('0x4c'),_0x312366[_0xd5f3('0x36')]);}};Acw[_0xd5f3('0x17')][_0xd5f3('0xf')]=function(_0x7cc979){try{if(this[_0xd5f3('0x5')][_0x7cc979[_0xd5f3('0x21')]]&&this[_0xd5f3('0x5')][_0x7cc979[_0xd5f3('0x21')]][_0xd5f3('0x4d')]===_0xd5f3('0x4e')){if(this[_0xd5f3('0x6')][_0x7cc979[_0xd5f3('0x3a')]]){logger[_0xd5f3('0x1e')](_0xd5f3('0x4f'),_0x7cc979[_0xd5f3('0x1d')],_0x7cc979[_0xd5f3('0x3a')],_0x7cc979[_0xd5f3('0x21')]);return RpcUser['savePause'](this[_0xd5f3('0x6')][_0x7cc979[_0xd5f3('0x3a')]],'Auto-Pause',_0x7cc979[_0xd5f3('0x1d')]);}}}catch(_0x2f6171){logger[_0xd5f3('0x34')](_0xd5f3('0x50'),_0x2f6171['message']);}};module[_0xd5f3('0x51')]=Acw; \ No newline at end of file +var _0x34b9=['error','[ACW][START]\x20%s','message','[%s][TIMER][STOP][AGENT:%s]','[%s][UPDATE][ACWTIME:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','acw','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','startAcw','linkedid','isUndefined','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','stringify','transfereruniqueid','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','all','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','lodash','../ami','../../../config/logger','../rpc/user','agents','channels','syncAgentConnect','bind','hanguprequest','syncHangupRequest','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','syncAgentConnectPreview','diff','seconds','prototype','timers','lastPauseAt','timer','update','uniqueid','then','info','catch','[%s][UPDATE][ERRORS:%s]','finally','interface','voiceQueues','ACW','mandatoryDisposition','mandatoryDispositionPause','name','Action','QueuePause','getAgent','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','available','paused','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','stopAcw','format','YYYY-MM-DD\x20HH:mm:ss','queue','updateAcw'];(function(_0x257b0e,_0x563d7e){var _0x27ac2a=function(_0x3a4bbc){while(--_0x3a4bbc){_0x257b0e['push'](_0x257b0e['shift']());}};_0x27ac2a(++_0x563d7e);}(_0x34b9,0x120));var _0x934b=function(_0x651087,_0x1b1fcf){_0x651087=_0x651087-0x0;var _0x7ffe33=_0x34b9[_0x651087];return _0x7ffe33;};'use strict';var _=require(_0x934b('0x0'));var moment=require('moment');var ami=require(_0x934b('0x1'));var logger=require(_0x934b('0x2'))('acw');var RpcUser=require(_0x934b('0x3'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0x405c1d){this['voiceQueues']=_0x405c1d['voiceQueues'];this[_0x934b('0x4')]=_0x405c1d[_0x934b('0x4')];this['timers']=_0x405c1d['timers'];this[_0x934b('0x5')]={};ami['on']('agentconnect',this[_0x934b('0x6')][_0x934b('0x7')](this));ami['on'](_0x934b('0x8'),this[_0x934b('0x9')][_0x934b('0x7')](this));ami['on']('hangup',this[_0x934b('0xa')]['bind'](this));ami['on'](_0x934b('0xb'),this[_0x934b('0xc')]['bind'](this));ami['on']('attendedtransfer',this[_0x934b('0xd')][_0x934b('0x7')](this));ami['on'](_0x934b('0xe'),this[_0x934b('0xf')][_0x934b('0x7')](this));ami['on']('custom:agentConnectPreview',this[_0x934b('0x10')]['bind'](this));}function getDiff(_0x3e056c){var _0x34485f=moment()['milliseconds'](0x0);var _0x5494fe=moment(_0x3e056c)['milliseconds'](0x0);return _0x34485f[_0x934b('0x11')](_0x5494fe,_0x934b('0x12'));}Acw[_0x934b('0x13')]['updateAcw']=function(_0x168e65,_0x1bfb2f){var _0x25acb7=this;var _0xdb4194=getDiff(_0x25acb7[_0x934b('0x14')][_0x168e65][_0x934b('0x15')]);clearTimeout(_0x25acb7[_0x934b('0x14')][_0x168e65][_0x934b('0x16')]);_0x25acb7[_0x934b('0x14')][_0x168e65]['timer']=![];return RpcVoiceAgentReport[_0x934b('0x17')]({'acwtime':_0xdb4194},_0x25acb7[_0x934b('0x14')][_0x168e65][_0x934b('0x18')],_0x168e65)[_0x934b('0x19')](function(_0x49abb8){logger[_0x934b('0x1a')]('[%s][UPDATE][ACWTIME:%s]',_0x1bfb2f,_0xdb4194,_0x49abb8);})[_0x934b('0x1b')](function(_0x567adb){logger['error'](_0x934b('0x1c'),_0x1bfb2f,_0x567adb);})[_0x934b('0x1d')](function(){delete _0x25acb7['timers'][_0x168e65];});};Acw[_0x934b('0x13')]['startAcw']=function(_0x35790c){try{var _0x200663=this;var _0x4ed087=this[_0x934b('0x5')][_0x35790c][_0x934b('0x1e')];var _0x520254=this[_0x934b('0x5')][_0x35790c]['queue'];var _0x175643=this[_0x934b('0x1f')][_0x520254];var _0x3f8922=![];var _0x5da6e3=_0x934b('0x20');if(_0x175643[_0x934b('0x21')]&&_0x175643[_0x934b('0x22')]['name']){_0x3f8922=!![];_0x5da6e3=_0x175643[_0x934b('0x22')][_0x934b('0x23')];}return ami[_0x934b('0x24')]({'action':_0x934b('0x25'),'interface':_0x4ed087,'paused':!![],'reason':_0x5da6e3})['then'](function(){if(_0x200663['agents'][_0x4ed087]){return RpcUser[_0x934b('0x26')](_0x200663[_0x934b('0x4')][_0x4ed087]['id'])[_0x934b('0x19')](function(_0x27a0d9){if(!_0x27a0d9||_0x27a0d9['voicePause']){logger[_0x934b('0x1a')](_0x934b('0x27'),_0x35790c,_0x4ed087,_0x520254);return;}logger[_0x934b('0x1a')]('[%s][START][AGENT:%s][QUEUE:%s]',_0x35790c,_0x4ed087,_0x520254);var _0xe1564=_0x200663[_0x934b('0x5')][_0x35790c][_0x934b('0x28')]&&_0x200663[_0x934b('0x5')][_0x35790c][_0x934b('0x29')]?_0x200663[_0x934b('0x5')][_0x35790c][_0x934b('0x29')]:_0x35790c;return RpcUser[_0x934b('0x2a')](_0x200663['agents'][_0x4ed087],_0x5da6e3,_0xe1564)[_0x934b('0x19')](function(_0x26cd01){_0x200663['voiceQueues'][_0x520254][_0x934b('0x2b')]-=0x1;_0x200663[_0x934b('0x1f')][_0x520254][_0x934b('0x2c')]+=0x1;return _0x26cd01;});})['then'](function(_0x7a1be2){if(_0x3f8922||!_0x7a1be2){return;}_0x200663['timers'][_0x4ed087]={};logger[_0x934b('0x1a')](_0x934b('0x2d'),_0x35790c,_0x200663[_0x934b('0x1f')][_0x520254][_0x934b('0x2e')],_0x4ed087,_0x520254);_0x200663[_0x934b('0x14')][_0x4ed087]['timer']=setTimeout(_0x200663[_0x934b('0x2f')]['bind'](_0x200663,_0x4ed087),_0x200663[_0x934b('0x1f')][_0x520254][_0x934b('0x2e')]*0x3e8);_0x200663[_0x934b('0x14')][_0x4ed087]['lastPauseAt']=moment()[_0x934b('0x30')](_0x934b('0x31'));_0x200663[_0x934b('0x14')][_0x4ed087][_0x934b('0x18')]=_0x35790c;_0x200663['timers'][_0x4ed087][_0x934b('0x32')]=_0x520254;_0x200663[_0x934b('0x14')][_0x4ed087][_0x934b('0x33')]=_0x200663['updateAcw']['bind'](_0x200663,_0x4ed087,_0x35790c);});}})[_0x934b('0x1b')](function(){logger[_0x934b('0x34')](_0x934b('0x2d'),_0x35790c,_0x200663[_0x934b('0x1f')][_0x520254]['acwTimeout'],_0x4ed087,_0x520254);})[_0x934b('0x1d')](function(){delete _0x200663[_0x934b('0x5')][_0x35790c];});}catch(_0x101a7e){logger[_0x934b('0x34')](_0x934b('0x35'),_0x101a7e[_0x934b('0x36')]);}};Acw[_0x934b('0x13')][_0x934b('0x2f')]=function(_0x590983){try{var _0xf41b9f=this;if(_0xf41b9f[_0x934b('0x14')][_0x590983]){_0xf41b9f[_0x934b('0x14')][_0x590983]['timer']=![];var _0x152818=_0xf41b9f['timers'][_0x590983][_0x934b('0x18')];var _0x43ecdb=_0xf41b9f[_0x934b('0x14')][_0x590983]['queue'];var _0x55880e=_0xf41b9f[_0x934b('0x1f')][_0x43ecdb][_0x934b('0x2e')];logger[_0x934b('0x1a')](_0x934b('0x37'),_0x152818,_0x590983);RpcUser[_0x934b('0x26')](this[_0x934b('0x4')][_0x590983]['id'])[_0x934b('0x19')](function(_0x5cc77c){if(_0x5cc77c['pauseType']===_0x934b('0x20')){return RpcUser['saveUnpause'](_0xf41b9f['agents'][_0x590983]);}});RpcVoiceAgentReport[_0x934b('0x17')]({'acwtime':_0x55880e,'agentacw':!![]},_0x152818,_0x590983)[_0x934b('0x19')](function(_0x462ec0){logger[_0x934b('0x1a')](_0x934b('0x38'),_0x152818,_0x55880e,_0x462ec0);})[_0x934b('0x1b')](function(_0x3d8d4c){logger['error']('[%s][UPDATE][ERRORS:%s]',_0x152818,_0x3d8d4c);});}else{logger[_0x934b('0x34')](_0x934b('0x39'),_0x590983);if(_0xf41b9f[_0x934b('0x14')]){logger[_0x934b('0x1a')](_0x934b('0x3a'),JSON['stringify'](_0xf41b9f[_0x934b('0x14')]));}}}catch(_0x5a35f2){logger[_0x934b('0x34')]('[ACW][STOP]\x20%s',_0x5a35f2[_0x934b('0x36')]);}};Acw[_0x934b('0x13')][_0x934b('0x6')]=function(_0x4b0a8c){try{if(this[_0x934b('0x1f')][_0x4b0a8c[_0x934b('0x32')]]&&(this[_0x934b('0x1f')][_0x4b0a8c['queue']][_0x934b('0x3b')]||this[_0x934b('0x1f')][_0x4b0a8c[_0x934b('0x32')]]['mandatoryDisposition'])){if(this[_0x934b('0x4')][_0x4b0a8c[_0x934b('0x1e')]]){this[_0x934b('0x5')][_0x4b0a8c['uniqueid']]={'queue':_0x4b0a8c['queue'],'interface':_0x4b0a8c['interface'],'destlinkedid':_0x4b0a8c[_0x934b('0x29')]};}}}catch(_0x207fa){logger['error'](_0x934b('0x3c'),_0x207fa[_0x934b('0x36')]);}};Acw[_0x934b('0x13')][_0x934b('0x10')]=function(_0x201012){try{if(this['voiceQueues'][_0x201012[_0x934b('0x32')]]&&(this['voiceQueues'][_0x201012[_0x934b('0x32')]]['acw']||this[_0x934b('0x1f')][_0x201012[_0x934b('0x32')]]['mandatoryDisposition'])){if(this[_0x934b('0x4')][_0x201012['interface']]){this['channels'][_0x201012[_0x934b('0x18')]]={'queue':_0x201012[_0x934b('0x32')],'interface':_0x201012[_0x934b('0x1e')]};}}}catch(_0x58ae1d){logger[_0x934b('0x34')](_0x934b('0x3d'),_0x58ae1d[_0x934b('0x36')]);}};Acw['prototype'][_0x934b('0x9')]=function(_0x555c05){try{if(this[_0x934b('0x5')][_0x555c05[_0x934b('0x18')]]&&_['isUndefined'](this[_0x934b('0x5')][_0x555c05[_0x934b('0x18')]][_0x934b('0x28')])){logger[_0x934b('0x1a')]('[%s][HANGUP:UNIQUEID]',_0x555c05['uniqueid']);this[_0x934b('0x3e')](_0x555c05[_0x934b('0x18')]);}else if(this['channels'][_0x555c05[_0x934b('0x3f')]]&&_[_0x934b('0x40')](this['channels'][_0x555c05[_0x934b('0x3f')]]['attended'])){logger[_0x934b('0x1a')](_0x934b('0x41'),_0x555c05['linkedid']);this[_0x934b('0x3e')](_0x555c05[_0x934b('0x3f')]);}}catch(_0x1de08b){logger['error'](_0x934b('0x42'),_0x1de08b[_0x934b('0x36')]);}};Acw[_0x934b('0x13')]['syncHangup']=function(_0x156296){try{if(this['channels'][_0x156296[_0x934b('0x18')]]&&this[_0x934b('0x5')][_0x156296[_0x934b('0x18')]]['attended']){logger[_0x934b('0x1a')](_0x934b('0x43'),_0x156296['uniqueid']);this[_0x934b('0x3e')](_0x156296[_0x934b('0x18')]);}else if(this[_0x934b('0x5')][_0x156296[_0x934b('0x3f')]]&&this[_0x934b('0x5')][_0x156296['linkedid']]['attended']){logger['info'](_0x934b('0x44'),_0x156296[_0x934b('0x3f')]);this[_0x934b('0x3e')](_0x156296[_0x934b('0x3f')]);}}catch(_0x4b1282){logger[_0x934b('0x34')](_0x934b('0x45'),_0x4b1282[_0x934b('0x36')]);}};Acw[_0x934b('0x13')][_0x934b('0xd')]=function(_0x9d8f51){try{if(!_[_0x934b('0x46')](this[_0x934b('0x5')][_0x9d8f51[_0x934b('0x47')]])){this[_0x934b('0x3e')](_0x9d8f51[_0x934b('0x47')]);if(this[_0x934b('0x5')][_0x9d8f51[_0x934b('0x48')]]){this[_0x934b('0x5')][_0x9d8f51[_0x934b('0x48')]][_0x934b('0x28')]=!![];this[_0x934b('0x5')][_0x9d8f51['transfertargetuniqueid']]=this[_0x934b('0x5')][_0x9d8f51[_0x934b('0x48')]];delete this[_0x934b('0x5')][_0x9d8f51[_0x934b('0x48')]];}}else if(!_[_0x934b('0x46')](this[_0x934b('0x5')][_0x9d8f51['transfertargetuniqueid']])){this[_0x934b('0x3e')](_0x9d8f51[_0x934b('0x49')]);if(this['channels'][_0x9d8f51[_0x934b('0x4a')]]){this[_0x934b('0x5')][_0x9d8f51['origtransfereruniqueid']]['attended']=!![];this[_0x934b('0x5')][_0x9d8f51[_0x934b('0x47')]]=this[_0x934b('0x5')][_0x9d8f51[_0x934b('0x4a')]];delete this['channels'][_0x9d8f51[_0x934b('0x4a')]];}}}catch(_0x490a96){logger[_0x934b('0x34')]('[ACW][syncAttendedTransfer]\x20%s',_0x490a96[_0x934b('0x36')]);}};Acw[_0x934b('0x13')]['syncBlindTransfer']=function(_0x4a5d5b){try{if(this['channels'][_0x4a5d5b['transfereruniqueid']]){logger[_0x934b('0x1a')](_0x934b('0x4b'),JSON[_0x934b('0x4c')](_0x4a5d5b[_0x934b('0x4d')]));this['startAcw'](_0x4a5d5b[_0x934b('0x4d')]);}else if(this[_0x934b('0x5')][_0x4a5d5b[_0x934b('0x4e')]]){logger['info'](_0x934b('0x4f'),JSON[_0x934b('0x4c')](_0x4a5d5b[_0x934b('0x4e')]));this[_0x934b('0x3e')](_0x4a5d5b[_0x934b('0x4e')]);}}catch(_0x5671b5){logger[_0x934b('0x34')](_0x934b('0x50'),_0x5671b5[_0x934b('0x36')]);}};Acw['prototype'][_0x934b('0xc')]=function(_0x414c72){try{if(this['voiceQueues'][_0x414c72[_0x934b('0x32')]]&&this['voiceQueues'][_0x414c72[_0x934b('0x32')]]['autopause']===_0x934b('0x51')){if(this[_0x934b('0x4')][_0x414c72['interface']]){logger[_0x934b('0x1a')]('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x414c72[_0x934b('0x18')],_0x414c72[_0x934b('0x1e')],_0x414c72[_0x934b('0x32')]);return RpcUser[_0x934b('0x2a')](this[_0x934b('0x4')][_0x414c72['interface']],_0x934b('0x52'),_0x414c72[_0x934b('0x18')]);}}}catch(_0x2b3d93){logger[_0x934b('0x34')](_0x934b('0x53'),_0x2b3d93['message']);}};module[_0x934b('0x54')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 6a4fbfc..16dbbc6 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 _0x1a46=['keepConnected','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','devicestatelist','sippeerstatus','actionQueueSummary','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','connect','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionSipPeerStatus','actionCoreShowChannels','catch','[ami.js][fullybooted]','close','util','../../config/logger','ami','../../config/environment','asterisk','port','username'];(function(_0x277107,_0x3420dc){var _0x1da046=function(_0x47122d){while(--_0x47122d){_0x277107['push'](_0x277107['shift']());}};_0x1da046(++_0x3420dc);}(_0x1a46,0xcb));var _0x61a4=function(_0x20867c,_0x338acb){_0x20867c=_0x20867c-0x0;var _0x5e6298=_0x1a46[_0x20867c];return _0x5e6298;};'use strict';var Manager=require('asterisk-manager');var BPromise=require('bluebird');var util=require(_0x61a4('0x0'));var logger=require(_0x61a4('0x1'))(_0x61a4('0x2'));var config=require(_0x61a4('0x3'));var ami=new Manager(config[_0x61a4('0x4')][_0x61a4('0x5')],config['asterisk']['ip'],config[_0x61a4('0x4')][_0x61a4('0x6')],config[_0x61a4('0x4')]['password'],!![]);ami[_0x61a4('0x7')]();ami['Action']=BPromise[_0x61a4('0x8')](ami[_0x61a4('0x9')]);function error(_0x3e351d){logger[_0x61a4('0xa')](util[_0x61a4('0xb')](_0x61a4('0xc'),config[_0x61a4('0x4')][_0x61a4('0x6')],config[_0x61a4('0x4')]['ip'],config['asterisk'][_0x61a4('0x5')],util[_0x61a4('0xd')](_0x3e351d,![],null)));}function close(){logger[_0x61a4('0xa')](util['format'](_0x61a4('0xe'),config['asterisk']['username'],config[_0x61a4('0x4')]['ip'],config[_0x61a4('0x4')][_0x61a4('0x5')]));}ami[_0x61a4('0xf')]=function(){return function(){return ami[_0x61a4('0x10')]({'action':'sipshowregistry'});};};ami['actionDeviceStateList']=function(){return function(){return ami['Action']({'action':_0x61a4('0x11')});};};ami['actionSipPeerStatus']=function(){return function(){return ami[_0x61a4('0x10')]({'action':_0x61a4('0x12')});};};ami[_0x61a4('0x13')]=function(){return function(){return ami[_0x61a4('0x10')]({'action':'queuesummary'});};};ami['actionCoreShowChannels']=function(){return function(){return ami[_0x61a4('0x10')]({'action':_0x61a4('0x14')});};};function connect(){logger[_0x61a4('0x15')](util['format'](_0x61a4('0x16'),config[_0x61a4('0x4')][_0x61a4('0x6')],config['asterisk']['ip'],config[_0x61a4('0x4')][_0x61a4('0x5')]));ami[_0x61a4('0x17')](_0x61a4('0xa'),error);ami[_0x61a4('0x17')]('close',close);}ami['on'](_0x61a4('0x18'),connect);ami['on']('shutdown',function(_0x508792){logger[_0x61a4('0x15')](util[_0x61a4('0xb')](_0x61a4('0x19'),config[_0x61a4('0x4')][_0x61a4('0x6')],config[_0x61a4('0x4')]['ip'],config[_0x61a4('0x4')][_0x61a4('0x5')],util[_0x61a4('0xd')](_0x508792,![],null)));});ami['on'](_0x61a4('0x1a'),function(){logger[_0x61a4('0x15')](util[_0x61a4('0xb')](_0x61a4('0x1b'),config[_0x61a4('0x4')][_0x61a4('0x6')],config[_0x61a4('0x4')]['ip'],config[_0x61a4('0x4')][_0x61a4('0x5')]));return Promise[_0x61a4('0x1c')]()[_0x61a4('0x1d')](ami['actionSipShowRegistry']())[_0x61a4('0x1d')](ami['actionDeviceStateList']())[_0x61a4('0x1d')](ami[_0x61a4('0x1e')]())['then'](ami[_0x61a4('0x13')]())[_0x61a4('0x1d')](ami[_0x61a4('0x1f')]())[_0x61a4('0x20')](function(_0x297f55){logger[_0x61a4('0xa')](_0x61a4('0x21'),util[_0x61a4('0xd')](_0x297f55,{'showHidden':![],'depth':null}));});});ami['once'](_0x61a4('0xa'),error);ami['once'](_0x61a4('0x22'),close);module['exports']=ami; \ No newline at end of file +var _0xc0f0=['Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','then','catch','exports','asterisk-manager','bluebird','../../config/logger','ami','../../config/environment','asterisk','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','port','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','username','actionSipShowRegistry','Action','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','shutdown'];(function(_0x1f5268,_0x513614){var _0x3532ef=function(_0xdf8826){while(--_0xdf8826){_0x1f5268['push'](_0x1f5268['shift']());}};_0x3532ef(++_0x513614);}(_0xc0f0,0x1e0));var _0x0c0f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc0f0[_0x3dd15e];return _0x231fd0;};'use strict';var Manager=require(_0x0c0f('0x0'));var BPromise=require(_0x0c0f('0x1'));var util=require('util');var logger=require(_0x0c0f('0x2'))(_0x0c0f('0x3'));var config=require(_0x0c0f('0x4'));var ami=new Manager(config[_0x0c0f('0x5')]['port'],config[_0x0c0f('0x5')]['ip'],config[_0x0c0f('0x5')]['username'],config[_0x0c0f('0x5')]['password'],!![]);ami['keepConnected']();ami['Action']=BPromise['promisify'](ami[_0x0c0f('0x6')]);function error(_0x20342d){logger[_0x0c0f('0x7')](util[_0x0c0f('0x8')](_0x0c0f('0x9'),config['asterisk']['username'],config[_0x0c0f('0x5')]['ip'],config[_0x0c0f('0x5')][_0x0c0f('0xa')],util[_0x0c0f('0xb')](_0x20342d,![],null)));}function close(){logger['error'](util[_0x0c0f('0x8')](_0x0c0f('0xc'),config[_0x0c0f('0x5')][_0x0c0f('0xd')],config['asterisk']['ip'],config['asterisk'][_0x0c0f('0xa')]));}ami[_0x0c0f('0xe')]=function(){return function(){return ami[_0x0c0f('0xf')]({'action':_0x0c0f('0x10')});};};ami[_0x0c0f('0x11')]=function(){return function(){return ami['Action']({'action':_0x0c0f('0x12')});};};ami[_0x0c0f('0x13')]=function(){return function(){return ami[_0x0c0f('0xf')]({'action':_0x0c0f('0x14')});};};ami[_0x0c0f('0x15')]=function(){return function(){return ami[_0x0c0f('0xf')]({'action':_0x0c0f('0x16')});};};ami[_0x0c0f('0x17')]=function(){return function(){return ami[_0x0c0f('0xf')]({'action':_0x0c0f('0x18')});};};function connect(){logger[_0x0c0f('0x19')](util['format'](_0x0c0f('0x1a'),config['asterisk'][_0x0c0f('0xd')],config[_0x0c0f('0x5')]['ip'],config[_0x0c0f('0x5')][_0x0c0f('0xa')]));ami[_0x0c0f('0x1b')]('error',error);ami[_0x0c0f('0x1b')](_0x0c0f('0x1c'),close);}ami['on']('connect',connect);ami['on'](_0x0c0f('0x1d'),function(_0x3334f9){logger[_0x0c0f('0x19')](util[_0x0c0f('0x8')](_0x0c0f('0x1e'),config[_0x0c0f('0x5')][_0x0c0f('0xd')],config['asterisk']['ip'],config[_0x0c0f('0x5')][_0x0c0f('0xa')],util[_0x0c0f('0xb')](_0x3334f9,![],null)));});ami['on']('fullybooted',function(){logger[_0x0c0f('0x19')](util[_0x0c0f('0x8')]('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0x0c0f('0x5')][_0x0c0f('0xd')],config['asterisk']['ip'],config[_0x0c0f('0x5')]['port']));return Promise['resolve']()[_0x0c0f('0x1f')](ami[_0x0c0f('0xe')]())[_0x0c0f('0x1f')](ami[_0x0c0f('0x11')]())[_0x0c0f('0x1f')](ami[_0x0c0f('0x13')]())[_0x0c0f('0x1f')](ami[_0x0c0f('0x15')]())[_0x0c0f('0x1f')](ami['actionCoreShowChannels']())[_0x0c0f('0x20')](function(_0x493efb){logger['error']('[ami.js][fullybooted]',util[_0x0c0f('0xb')](_0x493efb,{'showHidden':![],'depth':null}));});});ami[_0x0c0f('0x1b')]('error',error);ami['once'](_0x0c0f('0x1c'),close);module[_0x0c0f('0x21')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index f49da9b..14c68da 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 _0x70e0=['catch','exports','jayson/promise','bluebird','../../config/logger','http','Request','then','memberReport','error','rpc','message','result'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x70e0,0x17b));var _0x070e=function(_0x597b8c,_0x5b7182){_0x597b8c=_0x597b8c-0x0;var _0xd988c8=_0x70e0[_0x597b8c];return _0xd988c8;};'use strict';var jayson=require(_0x070e('0x0'));var BPromise=require(_0x070e('0x1'));var logger=require(_0x070e('0x2'))('ami');var client=jayson['client'][_0x070e('0x3')]({'port':0x2329});client[_0x070e('0x4')]=function(_0x277d32,_0x2593e5){return new BPromise(function(_0x5c90fc,_0x7bce9b){return client['request'](_0x277d32,_0x2593e5)[_0x070e('0x5')](function(_0x4b041d){logger['debug']('rpc',_0x070e('0x6'),_0x277d32,_0x2593e5,_0x4b041d);if(_0x4b041d[_0x070e('0x7')]){logger[_0x070e('0x7')](_0x070e('0x8'),_0x070e('0x6'),_0x277d32,_0x4b041d[_0x070e('0x7')][_0x070e('0x9')],_0x2593e5);return _0x7bce9b(_0x4b041d['error']['message']);}else{return _0x5c90fc(_0x4b041d[_0x070e('0xa')]);}})[_0x070e('0xb')](function(_0x12bb37){logger[_0x070e('0x7')](_0x070e('0x8'),_0x070e('0x6'),_0x277d32,_0x12bb37,_0x2593e5);return _0x7bce9b(_0x12bb37);});});};module[_0x070e('0xc')]=client; \ No newline at end of file +var _0xbdb7=['result','catch','jayson/promise','bluebird','../../config/logger','ami','client','http','Request','debug','error','message'];(function(_0x4bf29c,_0x3d437b){var _0x87e844=function(_0x3f856d){while(--_0x3f856d){_0x4bf29c['push'](_0x4bf29c['shift']());}};_0x87e844(++_0x3d437b);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x16de43,_0x2bb75f){_0x16de43=_0x16de43-0x0;var _0x2aaa5d=_0xbdb7[_0x16de43];return _0x2aaa5d;};'use strict';var jayson=require(_0x7bdb('0x0'));var BPromise=require(_0x7bdb('0x1'));var logger=require(_0x7bdb('0x2'))(_0x7bdb('0x3'));var client=jayson[_0x7bdb('0x4')][_0x7bdb('0x5')]({'port':0x2329});client[_0x7bdb('0x6')]=function(_0x2c7e07,_0x46c068){return new BPromise(function(_0x47aec5,_0x28542c){return client['request'](_0x2c7e07,_0x46c068)['then'](function(_0xffdc86){logger[_0x7bdb('0x7')]('rpc','memberReport',_0x2c7e07,_0x46c068,_0xffdc86);if(_0xffdc86[_0x7bdb('0x8')]){logger[_0x7bdb('0x8')]('rpc','memberReport',_0x2c7e07,_0xffdc86[_0x7bdb('0x8')][_0x7bdb('0x9')],_0x46c068);return _0x28542c(_0xffdc86[_0x7bdb('0x8')][_0x7bdb('0x9')]);}else{return _0x47aec5(_0xffdc86[_0x7bdb('0xa')]);}})[_0x7bdb('0xb')](function(_0x297724){logger[_0x7bdb('0x8')]('rpc','memberReport',_0x2c7e07,_0x297724,_0x46c068);return _0x28542c(_0x297724);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index 1c5953e..26573f4 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 _0x282c=['ACTIVE','[syncQueueSummary]','compareToOutboundQueue','queueSummaryCountersUpdated','updateReportFromOutboundQueue','assign','throttle','filter','dialPreviewRecallmeReminder','length','handlePreviewRecallNotifications','map','user:%s','user:dialPreviewRecallReminder','checkPreviewRecallReminder','loopClearZombieChannels','clearZombieChannels','[uniqueid]','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','originated','undefined','[updateOriginated]\x20object\x20originated\x20is\x20negative','loggerHandler','emptyContact','UserId','[emptyContact][createHistory]','launchHandleIvr','handleIvr','actionOriginate','object','originate','phone','getCaller','\x22agi://%s/square,%s\x22','NONE','isOutboundQueue','dialQueueOptions','dialer','XMD-AMDINITIALSILENCE','XMD-AMDGREETING','dialAMDGreeting','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','setXMDContactVariables','Contact','Trunk','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','TrunkBackup','XMD-ORIGINATECALLERIDNAME','originatecalleridname','extractCalleridName','XMD-ORIGINATECALLERIDNUM','dialPrefix','trim','dialCutDigit','dialOriginateTimeout','[originateError]:\x20%s','[originate][error]','originate\x20action\x20Error','checkRetriveMax','dialNoAnswerMaxRetry','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','callProgressDetecting','[callProgressDetecting]','outboundNoSuchCallsDay','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','[syncAgentComplete][createHistory][0]','dialNoSuchNumberMaxRetry','stateGlobal','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','buildNoAnswerEventPayload','dialNoAnswerRetryFrequency','callAdditionalPhoneAfterMin','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','Busy','custom:agentbusy','dialBusyRetryFrequency','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','custom:agentcongestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','AgentReject','reason\x2020\x20agentreject','outboundUnknownCallsDay','[syncAgentComplete][createHistory][?]','Global','Success','[moveContactManagedDialer][0]','contact\x20not\x20moved','round','predictiveIntervalAvailable','predictiveIntervalMinThreshold','floor','predictiveIntervalHitRate','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','Dropped\x20calls\x20day','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','avgHandleTime','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','dialPredictiveOptimizationPercentage','agentBusyFactor','busyFactor','[getDataPredictive]','getDataPredictiveOld','loggedIn','outboundQueuePauses','[CatchErlangB]','predictiveIntervalPauses','one\x20call\x20every:','milliseconds','[handlePredictive]','checkContactBlack','recallme','[booked][checkContactBlack]','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','Agent','voicePause','unlockContact','outboundReCallsDay','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','QUEUE_RECALL','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALL_TIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','limitCalls','checkContactEmpty','[getContactCampaign2][Empty]','ivrTotalCallsDays','[actionOriginate]\x20','checkIsBlackListIvr','[actionOriginateIvr]\x20','[getContactCampaign2]','dialMethod','dialLimitQueue','getContactDialer','countReScheduled','[countReScheduled]\x20','RUNNING','checkIsBlackList','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','not_inuse','dialOrderByScheduledAt','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','abandonmentRate','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','erlangb','----\x20Agent\x20Busy\x20Factor\x20----','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','Umin\x20=\x20','exports','util','lodash','uuid','moment','./utils','./utils/hopper','../preview/util/util','../../../config/logger','predictiveCalls','../ami','defaults','redis','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/voiceQueueRt','../rpc/setting','../rpc/interval','./models/action','./models/history','./models/agentComplete','./models/queueCallerAbandon','./models/hangup','env','XCALLY_IP_AGI','127.0.0.1','enqueue','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','contactsId','uniqueId','optionPredictive','startPredictive','ivrOriginated','queueBooked','queueBookedRR','queuesSummary','agentconnect','syncAgentConnect','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','bind','agentcomplete','syncAgentComplete','custom:queuesummary','syncQueueSummary','custom:queuesummarycomplete','syncQueueSummaryComplete','hangup','syncHangup','newexten','syncNewExten','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','getSettings','then','previewRecallmeReminderInterval','isUndefined','outbound','debug','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','inspect','format','voice:queue:%s','name','voice_queue:save','isEmpty','-----\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','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsCallersExit','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgHoldtime','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','predictiveIntervalTotalCalls','predictiveIntervalAvgTalktime','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCalls','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangBusyFactor','erlangAbandonmentRate','getSeconds','startProgressive','startPredictive\x20value\x20cleared','handlePredictive','error','stack','checkContactLowerLimitOriginate','temp','message','CAMPAIGN_STATUS','[getContactDialer2][ReScheduled]','contactsRescheduled','contacts','NO_AVAILABLE_CONTACTS','[getContactDialer2][Empty]','state','starttime','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','stringify','Interval','NULL_INTERVAL','\x20INTERVAL_IS_NULL','Intervals','INACTIVE','\x20NOT\x20Active','campaign:ivr:%s','campaign:save','sendMessageOneNotActive','is\x20not\x20active','DISACTIVED','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20disactive','Error','prototype','active','SIP/%s','reachable','isTrunkReachable','\x20trunk\x20is\x20not\x20reachable','checkIfTime','checkIfTimeIntervals','ifTimeIvr','ifTime','Failure','EMPTY_INTERVAL','timezones','UNKNOWN_TIMEZONE','\x20Timezone\x20unknow\x20','isArray','push','command','iftime\x20%s,%s','interval','indexOf','catch','Action','true','some','OVERTIME_GLOBAL_INTERVAL','OVERTIME_INTERVAL','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','resetActiveCalls','syncCampaigns','isIVRCampaign','isIVRCampaignActive','resolve','dialGlobalInterval','dialTimezone','[syncCampaigns]','checkDialMethod','predictive','progressive','handlePower','power','dialPowerLevel','booked','Queue','silly','Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:','isGlobal','AMI\x20IfTime','[ifTime][Action]','queue','uniqueid','type','ivr','YYYY-MM-DD\x20HH:mm:ss','outboundAnswerCallsDay','reason','agent','dialQueueProject2','dialAgiAfterHangupAgent','createHistory','[syncAgentComplete][createHistory]','moveContactManagedDialer','[syncAgentComplete]','updateOriginated','droptime','dialQueueTimeout','outboundDropCallsDayTimeout','predictiveIntervalErlangCallsDroppedCalls','statedesc','dropreason','agiafterat','countdropretry','countglobal','dialDropRetryFrequency','verifyAdditionalPhones','voiceQueue','additional','dialDropMaxRetry','add','minutes','ContactId','VoiceQueueId','CampaignId','[rescheduleContact][Drop]','Drop','endtime','calleridnum','swapAdditionalPhones','outboundDropCallsDayCallersExit','CALLEREXIT','countabandonedretry','dialAbandonedMaxRetry','queueCallerAbandonCreateState','dialAbandonedRetryFrequency','ListId','[rescheduleContact][Abandoned]','Abandoned','[syncAgentComplete][createHistory][11]','actions','channel','actionid','rrmemory','isNil','status','paused','stateinterface','locked','merge','idHopper','strategy','roundrobin','run','rescheduleContact','_rr','unlockRR','[booked][RR]','pick','contactAgent-idHopper:\x20','[Catch][Preview][syncQueueStatusComplete]','Agent:\x20','[booked][unlock]','[unlock][syncQueueStatusComplete]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[unlock3][syncQueueStatusComplete]','getQueue','[callProgressDetecting]\x20','variable','exten','xcally-motion-dialer','value','HANGUP','outboundAnswerAgiCallsDay','HangupInAMD','membername','emit','buildObj','amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','Machine','countmachineretry','custom:amd','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','dialGlobalMaxRetry','reason19\x20machine....','createStateFinal','reason\x2019\x20machine....','dialMachineRetryFrequency','[rescheduleContact][Machine]','dialAMDActive','AMD','saveInDb','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','countagentrejectretry','dialMachineMaxRetry','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','dialQueueProject','AnswerAGI','cause-txt','Normal\x20Clearing','Unknow','[syncHangupIvr]','running','isPreviewCampaign','statusMessage','getQueueCampaignStatusMessage','available','inUse','talking','pTalking'];(function(_0x260c53,_0xdcce16){var _0x25bd0a=function(_0x553ae6){while(--_0x553ae6){_0x260c53['push'](_0x260c53['shift']());}};_0x25bd0a(++_0xdcce16);}(_0x282c,0xdd));var _0xc282=function(_0x2938bd,_0x32bc07){_0x2938bd=_0x2938bd-0x0;var _0xe2cde1=_0x282c[_0x2938bd];return _0xe2cde1;};'use strict';var util=require(_0xc282('0x0'));var _=require(_0xc282('0x1'));var uuid=require(_0xc282('0x2'));var moment=require(_0xc282('0x3'));var rr=require('rr');var Redis=require('ioredis');var utils=require(_0xc282('0x4'));var hopperUtils=require(_0xc282('0x5'));var ut=require(_0xc282('0x6'));var config=require('../../../config/environment/');var logger=require(_0xc282('0x7'))('dialer');var loggerBooked=require(_0xc282('0x7'))('booked');var loggerPredictive=require(_0xc282('0x7'))('predictive');var loggerPredictiveCalls=require(_0xc282('0x7'))(_0xc282('0x8'));var loggerSyncQueueSummary=require('../../../config/logger')('syncQueueSummary');var ami=require(_0xc282('0x9'));config['redis']=_[_0xc282('0xa')](config[_0xc282('0xb')],{'host':_0xc282('0xc'),'port':0x18eb});var io=require(_0xc282('0xd'))(new Redis(config['redis']));var cmHopper=require(_0xc282('0xe'));var voiceQueueRt=require(_0xc282('0xf'));var RpcSetting=require(_0xc282('0x10'));var Interval=require(_0xc282('0x11'));var Action=require(_0xc282('0x12'));var History=require(_0xc282('0x13'));var Final=require('./models/final');var AgentComplete=require(_0xc282('0x14'));var QueueCallerAbandon=require(_0xc282('0x15'));var Hangup=require(_0xc282('0x16'));var ipAgi=process[_0xc282('0x17')][_0xc282('0x18')]||_0xc282('0x19');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence['prototype'][_0xc282('0x1a')]=function(_0x410419){this[_0xc282('0x1b')]=this[_0xc282('0x1b')]?this['tail'][_0xc282('0x1c')](_0x410419):_0x410419();};function Dialer(_0x17510a,_0x36cb59){this[_0xc282('0x1d')]=new Sequence();this[_0xc282('0x1e')]=_0x36cb59;this[_0xc282('0x1f')]=_0x17510a['voiceQueues'];this[_0xc282('0x20')]=_0x17510a[_0xc282('0x20')];this['agents']=_0x17510a[_0xc282('0x21')];this[_0xc282('0x22')]=_0x17510a[_0xc282('0x22')];this[_0xc282('0x23')]=config[_0xc282('0x23')]||0x2;this[_0xc282('0x24')]={};this['actions']={};this[_0xc282('0x25')]={};this[_0xc282('0x26')]={};this[_0xc282('0x27')]={};this[_0xc282('0x28')]={};this['startProgressive']={};this[_0xc282('0x29')]={};this[_0xc282('0x2a')]={};this[_0xc282('0x2b')]={};this[_0xc282('0x2c')]={};ami['on'](_0xc282('0x2d'),this[_0xc282('0x2e')]['bind'](this));ami['on'](_0xc282('0x2f'),this[_0xc282('0x30')]['bind'](this));ami['on'](_0xc282('0x31'),this[_0xc282('0x32')][_0xc282('0x33')](this));ami['on'](_0xc282('0x34'),this[_0xc282('0x35')]['bind'](this));ami['on'](_0xc282('0x36'),this[_0xc282('0x37')][_0xc282('0x33')](this));ami['on'](_0xc282('0x38'),this[_0xc282('0x39')][_0xc282('0x33')](this));ami['on'](_0xc282('0x3a'),this[_0xc282('0x3b')][_0xc282('0x33')](this));ami['on'](_0xc282('0x3c'),this[_0xc282('0x3d')][_0xc282('0x33')](this));ami['on'](_0xc282('0x3e'),this[_0xc282('0x3f')][_0xc282('0x33')](this));ami['on'](_0xc282('0x40'),this[_0xc282('0x41')][_0xc282('0x33')](this));ami['on'](_0xc282('0x42'),this[_0xc282('0x43')][_0xc282('0x33')](this));this[_0xc282('0x44')]();this['loopClearZombieChannels']();RpcSetting[_0xc282('0x45')]()[_0xc282('0x46')](function(_0x2537bd){previewRecallmeReminderInterval=_0x2537bd[_0xc282('0x47')];});}function isNotNull(_0x1974e4){return _0x1974e4!==null&&!_[_0xc282('0x48')](_0x1974e4);}function msgResponse(_0x197fa4,_0x203d3e,_0x977ac6){return{'action':_0x197fa4,'response':_0x203d3e,'message':_0x977ac6,'stack':_0x977ac6};}function emit(_0x608956,_0x4cf617,_0x458637){io['to'](_0x608956)['emit'](_0x4cf617,_0x458637);}function emitOutboundVoiceQueueSummary(_0x5b50a4){if(_0x5b50a4['type']===_0xc282('0x49')){logger[_0xc282('0x4a')](_0xc282('0x4b'),util[_0xc282('0x4c')](_0x5b50a4,{'showHidden':![],'depth':null}));emit(util[_0xc282('0x4d')](_0xc282('0x4e'),_0x5b50a4[_0xc282('0x4f')]),_0xc282('0x50'),_0x5b50a4);}}function checkGetDataPredictive(_0x3c8904){if(isNotNull(_0x3c8904)&&!_[_0xc282('0x51')](_0x3c8904)){loggerPredictive['info'](_0xc282('0x52'));loggerPredictive[_0xc282('0x53')](_0xc282('0x54'),_0x3c8904['predictiveIntervalTotalCalls']);loggerPredictive[_0xc282('0x53')](_0xc282('0x55'),_0x3c8904[_0xc282('0x56')]);loggerPredictive[_0xc282('0x53')]('Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3c8904[_0xc282('0x57')]);loggerPredictive[_0xc282('0x53')](_0xc282('0x58'),_0x3c8904[_0xc282('0x59')]);loggerPredictive[_0xc282('0x53')](_0xc282('0x5a'),_0x3c8904[_0xc282('0x5b')]);loggerPredictive[_0xc282('0x53')](_0xc282('0x5c'),_0x3c8904['predictiveIntervalAvgTalktime']);loggerPredictive[_0xc282('0x53')](_0xc282('0x5d'));if(_0x3c8904[_0xc282('0x5e')]>0x0){if(!_[_0xc282('0x48')](_0x3c8904['predictiveIntervalAvgTalktime'])&&_0x3c8904[_0xc282('0x5f')]>0x0){return!![];}loggerPredictive[_0xc282('0x53')](_0xc282('0x60'));if(!_[_0xc282('0x48')](_0x3c8904['predictiveIntervalAvgHoldtime'])&&_0x3c8904[_0xc282('0x5b')]>0x0){return!![];}loggerPredictive[_0xc282('0x53')](_0xc282('0x61'));}else{loggerPredictive['info']('Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive[_0xc282('0x53')](_0xc282('0x62'));}return![];}function mergeDataErlangB(_0x3e9ea2){return function(_0x57f579){loggerPredictive[_0xc282('0x53')](_0xc282('0x63'));loggerPredictive[_0xc282('0x53')](_0xc282('0x64'),_0x57f579[_0xc282('0x65')]);loggerPredictive[_0xc282('0x53')]('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x57f579['erlangCallToSecond']);loggerPredictive[_0xc282('0x53')](_0xc282('0x66'),_0x57f579['erlangAbandonmentRate']);loggerPredictive[_0xc282('0x53')]('Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x57f579[_0xc282('0x67')]);loggerPredictive[_0xc282('0x53')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x57f579[_0xc282('0x68')]);loggerPredictive['info'](_0xc282('0x5d'));_['merge'](_0x3e9ea2,_0x57f579);};}function ifInterval(_0x240ae8,_0x1b4702){if(_[_0xc282('0x48')](_0x1b4702)){return![];}return utils[_0xc282('0x69')](undefined,_0x1b4702)<_0x240ae8*0x3c;}function clearPredictiveAttributes(_0x1b2404){if(_0x1b2404[_0xc282('0x6a')]){_0x1b2404['startProgressive']=undefined;loggerPredictive['debug'](_0x1b2404[_0xc282('0x4f')],'startProgressive\x20value\x20cleared');}if(_0x1b2404[_0xc282('0x28')]){_0x1b2404[_0xc282('0x28')]=undefined;loggerPredictive[_0xc282('0x4a')](_0x1b2404[_0xc282('0x4f')],_0xc282('0x6b'));}if(_0x1b2404['handlePredictive']){clearInterval(_0x1b2404[_0xc282('0x6c')]);_0x1b2404[_0xc282('0x6c')]=undefined;loggerPredictive[_0xc282('0x4a')](_0x1b2404['name'],'handlePredictive\x20interval\x20cleared');}}function loggerCatchPredictive(_0x37498e,_0x2f3338){return function(_0x2f8122){loggerPredictive[_0xc282('0x6d')](_0x2f3338[_0xc282('0x4f')],_0x37498e);loggerPredictive[_0xc282('0x6d')](_0x2f8122[_0xc282('0x6e')]);clearPredictiveAttributes(_0x2f3338);};}function loggerCatch(_0x342ee8){return function(_0x4f0087){logger[_0xc282('0x6d')](_0x342ee8,util[_0xc282('0x4c')](_0x4f0087,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x3c13fd,_0x499f1f,_0x381372){return function(_0x14bb0f){utils[_0xc282('0x6f')](_0x499f1f,_0x381372,0x0);_0x499f1f[_0xc282('0x70')]=0x0;logger[_0xc282('0x6d')](_0x3c13fd,util[_0xc282('0x4c')](_0x14bb0f,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x25dbb8){return function(_0x38ebcb){if(isNotNull(_0x38ebcb)&&isNotNull(_0x38ebcb[0x0])){if(_0x38ebcb[0x0]['contactsRescheduled']>0x0){_0x25dbb8[_0xc282('0x71')]=utils[_0xc282('0x72')]['CONTACTS_RESCHEDULED'];logger[_0xc282('0x53')](_0xc282('0x73')+_0x25dbb8['name'],_0x38ebcb[0x0][_0xc282('0x74')],_0xc282('0x75'));}else{_0x25dbb8[_0xc282('0x71')]=utils[_0xc282('0x72')][_0xc282('0x76')];logger['info'](_0xc282('0x77')+_0x25dbb8['name']);}}};}function createObjHistory(_0x8f7dcf,_0xc86e39,_0x249bc4,_0x350604,_0x316e14){_0x8f7dcf[_0xc282('0x71')]=_0x249bc4;var _0x50621a=new Action(_0x8f7dcf,_0xc86e39);var _0x2a06a6=new History(_0x50621a);_0x2a06a6[_0xc282('0x78')]=_0x350604;_0x2a06a6['statedesc']=_0x316e14;_0x2a06a6['endtime']=_0x50621a[_0xc282('0x79')];return _0x2a06a6;}function unlockQueueStatus(_0x349b10,_0x11aa73){setTimeout(function(){if(_[_0xc282('0x48')](_0x349b10[_0xc282('0x7a')])){loggerBooked[_0xc282('0x6d')](_0xc282('0x7b'),_0x11aa73);}_0x349b10[_0xc282('0x7a')]=!![];loggerBooked[_0xc282('0x53')](_0xc282('0x7c'),_0x11aa73,JSON[_0xc282('0x7d')](_['pick'](_0x349b10,['name',_0xc282('0x7a')])));},0x1f3);}function checkInterval(_0x289586){return function(){if(!isNotNull(_0x289586[_0xc282('0x7e')])){_0x289586[_0xc282('0x71')]=utils[_0xc282('0x72')][_0xc282('0x7f')];throw _0x289586['name']+_0xc282('0x80');}if(!isNotNull(_0x289586[_0xc282('0x7e')]['Intervals'])){_0x289586[_0xc282('0x71')]=utils[_0xc282('0x72')][_0xc282('0x7f')];throw _0x289586['name']+_0xc282('0x80');}if(!isNotNull(_[_0xc282('0x51')](_0x289586['Interval'][_0xc282('0x81')]))){_0x289586[_0xc282('0x71')]=utils[_0xc282('0x72')][_0xc282('0x7f')];throw _0x289586[_0xc282('0x4f')]+_0xc282('0x80');}};}function checkIsIVRCampaignActive(_0x427739){return function(){if(!utils['isIVRCampaignActive'](_0x427739)){_0x427739['message']=utils[_0xc282('0x72')][_0xc282('0x82')];throw _0x427739['name']+_0xc282('0x83');}};}function emitCampaignSummary(_0x19f882){if(utils['isIVRCampaign'](_0x19f882)){emit(util[_0xc282('0x4d')](_0xc282('0x84'),_0x19f882[_0xc282('0x4f')]),_0xc282('0x85'),_0x19f882);}}function loggerCatchQueueSummary(_0x4bafc8,_0x285599){return function(_0x544385){clearPredictiveAttributes(_0x285599);emitCampaignSummary(_0x285599);loggerSyncQueueSummary[_0xc282('0x4a')](_0x4bafc8,util[_0xc282('0x4c')](_0x544385,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x510d6b){if(_0x510d6b['sendMessageOneNotActive']){if(_0x510d6b['originated']===0x0){_0x510d6b[_0xc282('0x86')]=![];_0x510d6b[_0xc282('0x71')]=utils['CAMPAIGN_STATUS'][_0xc282('0x82')];loggerSyncQueueSummary[_0xc282('0x4a')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x510d6b[_0xc282('0x4f')],_0xc282('0x87'));}else{_0x510d6b['message']=utils[_0xc282('0x72')][_0xc282('0x88')];loggerSyncQueueSummary[_0xc282('0x4a')](_0xc282('0x89'),_0x510d6b[_0xc282('0x4f')],_0xc282('0x8a'));}emitCampaignSummary(_0x510d6b);}}function myreject(_0x269411){return function(_0x1af77a){return _0x269411(msgResponse('[ifTime][Action]',_0xc282('0x8b'),JSON['stringify'](_0x1af77a)));};}Dialer[_0xc282('0x8c')]['isTrunkReachable']=function(_0x561274){return!_['isUndefined'](_0x561274)&&_0x561274&&!_[_0xc282('0x48')](_0x561274['name'])&&!_[_0xc282('0x48')](_0x561274[_0xc282('0x8d')])&&_0x561274[_0xc282('0x8d')]&&(this[_0xc282('0x22')][util[_0xc282('0x4d')](_0xc282('0x8e'),_0x561274['name'])]['status']===_0xc282('0x8f')||this[_0xc282('0x22')][util[_0xc282('0x4d')](_0xc282('0x8e'),_0x561274[_0xc282('0x4f')])]['status']==='unmonitored');};Dialer[_0xc282('0x8c')]['checkIsTrunkReachable']=function(_0x48f4f6){var _0x5278ff=this;return function(){if(!_0x5278ff[_0xc282('0x90')](_0x48f4f6['Trunk'])){if(!_0x5278ff[_0xc282('0x90')](_0x48f4f6['TrunkBackup'])){_0x48f4f6[_0xc282('0x71')]=utils[_0xc282('0x72')]['TRUNK_NOT_REACHABLE'];throw _0x48f4f6[_0xc282('0x4f')]+_0xc282('0x91');}}};};Dialer[_0xc282('0x8c')][_0xc282('0x92')]=function(_0x513f43,_0x4b781e,_0x171b68,_0x35f239){var _0x48ccab=this;return function(){var _0x543de2=!![];return _0x48ccab['ifTimeIvr'](_0x513f43,_0x4b781e,_0x171b68,_0x35f239,_0x543de2);};};Dialer[_0xc282('0x8c')][_0xc282('0x93')]=function(_0x108f84,_0x2cf9be,_0x34f5fe,_0x4361c0){var _0x586b2c=this;return function(){var _0x42ba69=![];return _0x586b2c[_0xc282('0x94')](_0x108f84[_0xc282('0x81')],_0x2cf9be,_0x34f5fe,_0x4361c0,_0x42ba69);};};Dialer[_0xc282('0x8c')]['ifTimeIvr']=function(_0x15e722,_0xe014b9,_0x12b794,_0x37bf23,_0x42a900){var _0x4dd6ec=[];return new Promise(function(_0x4baebf,_0x5ae940){if(!isNotNull(_0x15e722)){_0x37bf23['message']=utils[_0xc282('0x72')]['NULL_INTERVAL'];return _0x5ae940(msgResponse(_0xc282('0x95'),_0xc282('0x96'),_0x12b794+'\x20Intervals\x20is\x20null\x20'));}if(_[_0xc282('0x51')](_0x15e722)){_0x37bf23['message']=utils[_0xc282('0x72')][_0xc282('0x97')];return _0x5ae940(msgResponse(_0xc282('0x95'),'Failure',_0x12b794+'\x20Intervals\x20is\x20empty\x20'));}if(_0xe014b9&&_[_0xc282('0x48')](config[_0xc282('0x98')][_0xe014b9])){_0x37bf23[_0xc282('0x71')]=utils[_0xc282('0x72')][_0xc282('0x99')];return _0x5ae940(msgResponse('ifTime',_0xc282('0x96'),_0x12b794+_0xc282('0x9a')+_0xe014b9));}if(_[_0xc282('0x9b')](_0x15e722)){for(var _0x2eaf6e=0x0;_0x2eaf6e<_0x15e722['length'];_0x2eaf6e+=0x1){_0x4dd6ec[_0xc282('0x9c')](ami['Action']({'action':_0xc282('0x9d'),'command':util[_0xc282('0x4d')](_0xc282('0x9e'),_0x15e722[_0x2eaf6e][_0xc282('0x9f')],!_[_0xc282('0x48')](config[_0xc282('0x98')][_0xe014b9])?_0xe014b9:'')})['then'](function(_0x7aaf4c){return _0x7aaf4c['content'][_0xc282('0xa0')]('true')>=0x0;})[_0xc282('0xa1')](myreject(_0x5ae940)));}}else{_0x4dd6ec[_0xc282('0x9c')](ami[_0xc282('0xa2')]({'action':_0xc282('0x9d'),'command':util[_0xc282('0x4d')](_0xc282('0x9e'),_0x15e722,!_[_0xc282('0x48')](config[_0xc282('0x98')][_0xe014b9])?_0xe014b9:'')})[_0xc282('0x46')](function(_0x3cbd39){return _0x3cbd39['content'][_0xc282('0xa0')](_0xc282('0xa3'))>=0x0;})[_0xc282('0xa1')](myreject(_0x5ae940)));}Promise['all'](_0x4dd6ec)[_0xc282('0x46')](function(_0x508381){var _0x22423e=_[_0xc282('0xa4')](_0x508381);if(_0x22423e){return _0x4baebf(_0x22423e);}else{_0x37bf23['message']=_0x42a900?utils['CAMPAIGN_STATUS'][_0xc282('0xa5')]:utils[_0xc282('0x72')][_0xc282('0xa6')];return _0x5ae940(msgResponse(_0xc282('0xa7'),_0xc282('0x96'),_0xc282('0xa8')+_0x42a900+'\x20'+_0x12b794+_0xc282('0xa9')+util[_0xc282('0x4c')](_0x15e722,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0xe014b9));}})[_0xc282('0xa1')](function(_0xdd6e19){return _0x5ae940(msgResponse(_0xc282('0x95'),_0xc282('0x96'),JSON['stringify'](_0xdd6e19)));});});};Dialer[_0xc282('0x8c')][_0xc282('0x44')]=function(){var _0x1faa9c=this;return cmHopper[_0xc282('0xaa')]({'active':![]},{'where':{'active':!![]}})[_0xc282('0x46')](function(){setInterval(function(){_0x1faa9c[_0xc282('0xab')]();},0x3e8);});};Dialer[_0xc282('0x8c')][_0xc282('0xab')]=function(){var _0x5de015=this;var _0x5640de;for(var _0x325974 in this[_0xc282('0x20')]){if(typeof this[_0xc282('0x20')][_0x325974]!=='undefined'){_0x5640de=this[_0xc282('0x20')][_0x325974];if(utils[_0xc282('0xac')](_0x5640de)&&utils[_0xc282('0xad')](_0x5640de)){_0x5640de[_0xc282('0x86')]=!![];Promise[_0xc282('0xae')]()['then'](checkIsIVRCampaignActive(_0x5640de))[_0xc282('0x46')](checkInterval(_0x5640de))['then'](_0x5de015['checkIsTrunkReachable'](_0x5640de))['then'](_0x5de015[_0xc282('0x92')](_0x5640de[_0xc282('0xaf')],_0x5640de[_0xc282('0xb0')],_0x5640de['name'],_0x5640de))['then'](_0x5de015[_0xc282('0x93')](_0x5640de[_0xc282('0x7e')],_0x5640de[_0xc282('0xb0')],_0x5640de[_0xc282('0x4f')],_0x5640de))['then'](_0x5de015['launchHandleIvr'](_0x5640de))[_0xc282('0xa1')](loggerCatchQueueSummary(_0xc282('0xb1'),_0x5640de));}else{notSendMessagesCampaign(_0x5640de);}}}};Dialer[_0xc282('0x8c')][_0xc282('0xb2')]=function(_0x11ad82){if(_0x11ad82['dialMethod']!==_0xc282('0xb3')){clearPredictiveAttributes(_0x11ad82);}switch(_0x11ad82['dialMethod']){case _0xc282('0xb4'):this[_0xc282('0xb5')](_0x11ad82,0x1);break;case _0xc282('0xb6'):this[_0xc282('0xb5')](_0x11ad82,_0x11ad82[_0xc282('0xb7')]);break;case _0xc282('0xb3'):this['predictive'](_0x11ad82);break;case _0xc282('0xb8'):this[_0xc282('0xb5')](_0x11ad82,0x1);break;default:logger['error'](_0xc282('0xb9'),_0x11ad82[_0xc282('0x4f')],'method\x20not\x20recognized');}};Dialer['prototype'][_0xc282('0x95')]=function(_0x422ea6,_0x554a81){var _0xbd5f19=_0x422ea6[_0xc282('0xb0')];var _0x17c770=_0x554a81?_0x422ea6['dialGlobalInterval']:_0x422ea6[_0xc282('0x7e')][_0xc282('0x81')];logger[_0xc282('0xba')]('Dialer::ifTime()',_0x17c770,_0xbd5f19,_0x422ea6[_0xc282('0x4f')],util[_0xc282('0x4d')]('Voice\x20Queue\x20%s\x20$s',_0x422ea6[_0xc282('0x4f')],_0x422ea6['id']));var _0x34f2e8=null;return Interval['intervalIftime'](_0x17c770,_0xbd5f19)[_0xc282('0x46')](function(_0x1288b6){if(_0x1288b6===!![]){return _0x1288b6;}else{_0x422ea6[_0xc282('0x71')]=_0x554a81?utils[_0xc282('0x72')][_0xc282('0xa5')]:utils[_0xc282('0x72')]['OVERTIME_INTERVAL'];_0x34f2e8=msgResponse(_0xc282('0xa7'),_0xc282('0x96'),_0xc282('0xa8')+_0x554a81+'\x20'+_0x422ea6[_0xc282('0x4f')]+_0xc282('0xa9')+util[_0xc282('0x4c')](_0x17c770,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0xbd5f19);}if(_0x34f2e8!==null){logger[_0xc282('0xba')](_0xc282('0xbb'),_0x34f2e8);_0x34f2e8[_0xc282('0xbc')]=_0x554a81;throw _0x34f2e8;}})['catch'](function(_0x585af4){logger['error'](_0xc282('0xbd'),_0x585af4);throw msgResponse(_0xc282('0xbe'),_0xc282('0x8b'),util[_0xc282('0x4c')](_0x585af4,{'showHidden':![],'depth':null}));});};Dialer[_0xc282('0x8c')]['syncAgentConnect']=function(_0x3080c8){if(this[_0xc282('0x1f')][_0x3080c8[_0xc282('0xbf')]]){if(this[_0xc282('0x26')][_0x3080c8[_0xc282('0xc0')]]&&this[_0xc282('0x26')][_0x3080c8[_0xc282('0xc0')]][_0xc282('0xc1')]!==_0xc282('0xc2')){this['updateOriginated'](this[_0xc282('0x1f')][_0x3080c8[_0xc282('0xbf')]]);this[_0xc282('0x26')][_0x3080c8['uniqueid']]['answertime']=moment()['format'](_0xc282('0xc3'));}}};Dialer[_0xc282('0x8c')][_0xc282('0x35')]=function(_0x4aa492){var _0x54337d=this[_0xc282('0x26')][_0x4aa492['uniqueid']];if(this[_0xc282('0x1f')][_0x4aa492[_0xc282('0xbf')]]){if(_0x54337d&&_0x54337d['type']!==_0xc282('0xc2')){delete this[_0xc282('0x26')][_0x4aa492[_0xc282('0xc0')]];this[_0xc282('0x1f')][_0x4aa492[_0xc282('0xbf')]][_0xc282('0xc4')]+=0x1;var _0xddac09=new AgentComplete(_0x54337d,_0x4aa492);if(_0x4aa492[_0xc282('0xc5')]===_0xc282('0xc6')){_0xddac09['agiafterat']=this[_0xc282('0x1f')][_0x4aa492[_0xc282('0xbf')]][_0xc282('0xc7')]&&this['voiceQueues'][_0x4aa492[_0xc282('0xbf')]][_0xc282('0xc8')]?moment()['format'](_0xc282('0xc3')):undefined;}hopperUtils[_0xc282('0xc9')](_0xddac09)[_0xc282('0xa1')](loggerCatch(_0xc282('0xca')));hopperUtils[_0xc282('0xcb')](_0xddac09)[_0xc282('0xa1')](loggerCatch(_0xc282('0xcc')));}}};Dialer['prototype']['syncQueueCallerAbandon']=function(_0x397e50){var _0xf9316a=this[_0xc282('0x26')][_0x397e50[_0xc282('0xc0')]];var _0x55e4b2=this;var _0x3a108a=![];var _0x462647;var _0x591289;if(this[_0xc282('0x1f')][_0x397e50[_0xc282('0xbf')]]){if(_0xf9316a&&_0xf9316a[_0xc282('0xc1')]!==_0xc282('0xc2')){delete this[_0xc282('0x26')][_0x397e50[_0xc282('0xc0')]];this[_0xc282('0xcd')](this[_0xc282('0x1f')][_0x397e50[_0xc282('0xbf')]]);_0xf9316a[_0xc282('0xce')]=moment()[_0xc282('0x4d')](_0xc282('0xc3'));var _0x4e15f5=new QueueCallerAbandon(_0xf9316a,_0x397e50);if(utils[_0xc282('0x69')](_0xf9316a[_0xc282('0xce')],_0xf9316a['responsetime'])>=_0xf9316a[_0xc282('0xcf')]){this[_0xc282('0x1f')][_0x397e50[_0xc282('0xbf')]][_0xc282('0x57')]+=0x1;this['voiceQueues'][_0x397e50[_0xc282('0xbf')]][_0xc282('0xd0')]+=0x1;this[_0xc282('0x1f')][_0x397e50[_0xc282('0xbf')]][_0xc282('0xd1')]+=0x1;_0x4e15f5[_0xc282('0x78')]=0xa;_0x4e15f5[_0xc282('0xd2')]='Drop';_0x4e15f5[_0xc282('0xd3')]='TIMEOUT';_0x4e15f5[_0xc282('0xd4')]=this[_0xc282('0x1f')][_0x397e50[_0xc282('0xbf')]][_0xc282('0xc7')]?moment()[_0xc282('0x4d')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;_0x4e15f5[_0xc282('0xd5')]+=0x1;_0x4e15f5[_0xc282('0xd6')]+=0x1;_0x462647=this['voiceQueues'][_0x397e50[_0xc282('0xbf')]][_0xc282('0xd7')];_0x591289=this['voiceQueues'][_0x397e50[_0xc282('0xbf')]]['callAdditionalPhoneAfterMin'];hopperUtils[_0xc282('0xd8')](_0x4e15f5,_0x4e15f5[_0xc282('0x78')],_0xf9316a[_0xc282('0xd9')])[_0xc282('0x46')](function(_0x56d91b){_0x3a108a=_0x56d91b[_0xc282('0xda')]==0x1;if(_0x4e15f5['countdropretry']>=_0x55e4b2[_0xc282('0x1f')][_0x397e50['queue']][_0xc282('0xdb')]){_0x55e4b2['queueCallerAbandonCreateState'](_0x4e15f5,_0x56d91b[_0xc282('0xda')]);}else{hopperUtils['rescheduleContact']({'active':![],'countdropretry':_0x4e15f5[_0xc282('0xd5')],'scheduledat':moment()[_0xc282('0xdc')](_0x55e4b2[_0xc282('0x1f')][_0x397e50['queue']][_0xc282('0xd7')],_0xc282('0xdd'))[_0xc282('0x4d')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0xf9316a[_0xc282('0xde')],'ListId':_0xf9316a['ListId'],'VoiceQueueId':_0xf9316a[_0xc282('0xdf')]||undefined,'CampaignId':_0xf9316a[_0xc282('0xe0')]||undefined})[_0xc282('0xa1')](loggerCatch(_0xc282('0xe1')));var _0xdace67=new History(_0x4e15f5);_0xdace67[_0xc282('0x78')]=0xa;_0xdace67[_0xc282('0xd2')]=_0xc282('0xe2');_0xdace67[_0xc282('0x79')]=moment()['format'](_0xc282('0xc3'));_0xdace67[_0xc282('0xe3')]=_0xdace67[_0xc282('0x79')];_0xdace67['calleridname']=_0x4e15f5['calleridname'];_0xdace67['calleridnum']=_0x4e15f5[_0xc282('0xe4')];hopperUtils[_0xc282('0xc9')](_0xdace67)['catch'](loggerCatch('[syncAgentComplete][createHistory][10]'));}})[_0xc282('0x46')](function(){if(_0x3a108a)hopperUtils[_0xc282('0xe5')](_0x4e15f5,_0x462647,_0x591289)[_0xc282('0x46')](function(){return 0x1;});});}else{this[_0xc282('0x1f')][_0x397e50[_0xc282('0xbf')]]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this[_0xc282('0x1f')][_0x397e50['queue']][_0xc282('0xe6')]+=0x1;_0x4e15f5['state']=0xb;_0x4e15f5[_0xc282('0xd2')]='Abandoned';_0x4e15f5[_0xc282('0xd3')]=_0xc282('0xe7');_0x4e15f5[_0xc282('0xe8')]+=0x1;_0x4e15f5['countglobal']+=0x1;_0x462647=this['voiceQueues'][_0x397e50[_0xc282('0xbf')]]['dialAbandonedRetryFrequency'];_0x591289=this['voiceQueues'][_0x397e50['queue']]['callAdditionalPhoneAfterMin'];hopperUtils['verifyAdditionalPhones'](_0x4e15f5,_0x4e15f5['state'],_0xf9316a['voiceQueue'])[_0xc282('0x46')](function(_0x2cba99){if(_0x4e15f5[_0xc282('0xe8')]>=_0x55e4b2[_0xc282('0x1f')][_0x397e50[_0xc282('0xbf')]][_0xc282('0xe9')]){_0x55e4b2[_0xc282('0xea')](_0x4e15f5,_0x2cba99[_0xc282('0xda')]);}else{hopperUtils['rescheduleContact']({'active':![],'countabandonedretry':_0x4e15f5[_0xc282('0xe8')],'scheduledat':moment()[_0xc282('0xdc')](_0x55e4b2['voiceQueues'][_0x397e50['queue']][_0xc282('0xeb')],_0xc282('0xdd'))['format'](_0xc282('0xc3')),'ContactId':_0xf9316a[_0xc282('0xde')],'ListId':_0xf9316a[_0xc282('0xec')],'VoiceQueueId':_0xf9316a[_0xc282('0xdf')]||undefined,'CampaignId':_0xf9316a[_0xc282('0xe0')]||undefined})[_0xc282('0xa1')](loggerCatch(_0xc282('0xed')));var _0x556a45=new History(_0x4e15f5);_0x556a45['state']=0xb;_0x556a45[_0xc282('0xd2')]=_0xc282('0xee');_0x556a45[_0xc282('0x79')]=moment()[_0xc282('0x4d')]('YYYY-MM-DD\x20HH:mm:ss');_0x556a45[_0xc282('0xe3')]=_0x556a45[_0xc282('0x79')];_0x556a45['calleridname']=_0x4e15f5['calleridname'];_0x556a45['calleridnum']=_0x4e15f5[_0xc282('0xe4')];hopperUtils['createHistory'](_0x556a45)[_0xc282('0xa1')](loggerCatch(_0xc282('0xef')));}})[_0xc282('0x46')](function(){if(_0x3a108a)hopperUtils[_0xc282('0xe5')](_0x4e15f5,_0x462647,_0x591289)[_0xc282('0x46')](function(){return 0x1;});});}}}};Dialer['prototype'][_0xc282('0x3d')]=function(_0x216d78){if(this[_0xc282('0xf0')][_0x216d78[_0xc282('0xc0')]]){this[_0xc282('0xf0')][_0x216d78[_0xc282('0xc0')]][_0xc282('0xf1')]=_0x216d78[_0xc282('0xf1')];}if(this['uniqueId'][_0x216d78[_0xc282('0xc0')]]){this[_0xc282('0x26')][_0x216d78[_0xc282('0xc0')]][_0xc282('0xf1')]=_0x216d78[_0xc282('0xf1')];}};Dialer['prototype']['syncQueueMember']=function(_0x328d6a){if(!this[_0xc282('0xf0')][_0x328d6a['actionid']]){return;}var _0x20d081=this[_0xc282('0x1f')][this[_0xc282('0xf0')][_0x328d6a[_0xc282('0xf2')]][_0xc282('0xbf')]]['strategy']||_0xc282('0xf3');if(_0x20d081==='roundrobin'){if(this[_0xc282('0xf0')][_0x328d6a[_0xc282('0xf2')]]&&_[_0xc282('0xf4')](this[_0xc282('0xf0')][_0x328d6a[_0xc282('0xf2')]]['locked'])&&_0x328d6a[_0xc282('0xf5')]==='1'&&_0x328d6a[_0xc282('0xf6')]==='0'){if(this['agents'][_0x328d6a['stateinterface']]){if(!this[_0xc282('0x21')][_0x328d6a[_0xc282('0xf7')]][_0xc282('0xf8')]){this[_0xc282('0x21')][_0x328d6a['stateinterface']][_0xc282('0xf8')]=!![];this[_0xc282('0xf0')][_0x328d6a[_0xc282('0xf2')]]['locked']=!![];this[_0xc282('0xf0')][_0x328d6a[_0xc282('0xf2')]][_0xc282('0xf7')]=_0x328d6a['stateinterface'];}}}}else if(_0x20d081===_0xc282('0xf3')){if(this[_0xc282('0xf0')][_0x328d6a[_0xc282('0xf2')]]){if(this[_0xc282('0x21')][_0x328d6a[_0xc282('0xf7')]]){this[_0xc282('0xf0')][_0x328d6a[_0xc282('0xf2')]][_0xc282('0xf7')]=_0x328d6a[_0xc282('0xf7')];if(_[_0xc282('0xf4')](this['queueBooked'][this['actions'][_0x328d6a['actionid']][_0xc282('0xbf')]])){this[_0xc282('0x2a')][this[_0xc282('0xf0')][_0x328d6a['actionid']][_0xc282('0xbf')]]=[];}this[_0xc282('0x2a')][this[_0xc282('0xf0')][_0x328d6a[_0xc282('0xf2')]][_0xc282('0xbf')]]['push'](_[_0xc282('0xf9')](_['pick'](this['actions'][_0x328d6a[_0xc282('0xf2')]],[_0xc282('0xfa'),_0xc282('0xf7')]),{'status':_0x328d6a['status'],'paused':_0x328d6a[_0xc282('0xf6')]}));}}}};Dialer[_0xc282('0x8c')][_0xc282('0x43')]=function(_0x1c05ed){if(!this[_0xc282('0xf0')][_0x1c05ed['actionid']]){return;}var _0x345ca6=this;var _0x2670b2=this[_0xc282('0x1f')][this[_0xc282('0xf0')][_0x1c05ed[_0xc282('0xf2')]][_0xc282('0xbf')]];var _0x2eab0f=_0x2670b2[_0xc282('0xfb')]||'rrmemory';if(_0x2eab0f===_0xc282('0xfc')){if(this[_0xc282('0xf0')][_0x1c05ed['actionid']]&&this[_0xc282('0xf0')][_0x1c05ed['actionid']][_0xc282('0xf7')]){this[_0xc282('0x1e')][_0xc282('0xfd')](this['actions'][_0x1c05ed[_0xc282('0xf2')]][_0xc282('0xfa')],this[_0xc282('0xf0')][_0x1c05ed[_0xc282('0xf2')]]['stateinterface'])['catch'](function(_0x35f655){logger[_0xc282('0x6d')]('[Catch][Preview][syncQueueStatusComplete]',util['inspect'](_0x35f655,{'showHidden':![],'depth':null}));})[_0xc282('0x1c')](function(){_0x345ca6[_0xc282('0xcd')](_0x345ca6[_0xc282('0x1f')][_0x345ca6[_0xc282('0xf0')][_0x1c05ed[_0xc282('0xf2')]][_0xc282('0xbf')]]);_0x345ca6[_0xc282('0x21')][_0x345ca6[_0xc282('0xf0')][_0x1c05ed[_0xc282('0xf2')]][_0xc282('0xf7')]]['locked']=![];delete _0x345ca6[_0xc282('0xf0')][_0x1c05ed['actionid']];unlockQueueStatus(_0x2670b2);});}else{this[_0xc282('0xcd')](this['voiceQueues'][this[_0xc282('0xf0')][_0x1c05ed['actionid']][_0xc282('0xbf')]]);hopperUtils[_0xc282('0xfe')]({'active':![],'ContactId':this[_0xc282('0xf0')][_0x1c05ed[_0xc282('0xf2')]][_0xc282('0xde')],'ListId':this[_0xc282('0xf0')][_0x1c05ed[_0xc282('0xf2')]][_0xc282('0xec')],'VoiceQueueId':this[_0xc282('0xf0')][_0x1c05ed[_0xc282('0xf2')]][_0xc282('0xdf')]||undefined,'CampaignId':this[_0xc282('0xf0')][_0x1c05ed[_0xc282('0xf2')]][_0xc282('0xe0')]||undefined})[_0xc282('0xa1')](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this[_0xc282('0xf0')][_0x1c05ed[_0xc282('0xf2')]];unlockQueueStatus(_0x2670b2);}}else if(_0x2eab0f==='rrmemory'){var _0x43f245;if(this[_0xc282('0xf0')][_0x1c05ed['actionid']]&&!_[_0xc282('0x51')](this['queueBooked'][this[_0xc282('0xf0')][_0x1c05ed[_0xc282('0xf2')]][_0xc282('0xbf')]])){if(this[_0xc282('0x2b')][_0x345ca6[_0xc282('0xf0')][_0x1c05ed[_0xc282('0xf2')]]['queue']]){this[_0xc282('0x2b')][_0x345ca6[_0xc282('0xf0')][_0x1c05ed[_0xc282('0xf2')]][_0xc282('0xbf')]]=this['queueBookedRR'][this[_0xc282('0xf0')][_0x1c05ed['actionid']][_0xc282('0xbf')]]?this[_0xc282('0x2b')][this['actions'][_0x1c05ed['actionid']][_0xc282('0xbf')]]:this[_0xc282('0x2a')][this[_0xc282('0xf0')][_0x1c05ed[_0xc282('0xf2')]][_0xc282('0xbf')]]?this[_0xc282('0x2a')][this[_0xc282('0xf0')][_0x1c05ed[_0xc282('0xf2')]][_0xc282('0xbf')]]['_rr']||0x0:0x0;}this[_0xc282('0x2a')][this[_0xc282('0xf0')][_0x1c05ed['actionid']][_0xc282('0xbf')]][_0xc282('0xff')]=this['queueBookedRR'][this[_0xc282('0xf0')][_0x1c05ed[_0xc282('0xf2')]][_0xc282('0xbf')]];for(var _0x32d64b=0x0;_0x32d64b=_0x462cf3[_0xc282('0x122')]){_0x312416['stateGlobal'](_0x30b67c,_0x283199,_0x2de906,_0xc282('0x123'));}else{if(_0x30b67c[_0xc282('0x11c')]>=_0x462cf3['dialMachineMaxRetry']){_0x312416[_0xc282('0x124')](_0x30b67c,_0x283199,_0x2de906,_0xc282('0x125'));}else{hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x30b67c[_0xc282('0x11c')],'scheduledat':moment()['add'](_0x462cf3[_0xc282('0x126')],_0xc282('0xdd'))[_0xc282('0x4d')](_0xc282('0xc3')),'ContactId':_0x30b67c['ContactId'],'ListId':_0x30b67c[_0xc282('0xec')],'VoiceQueueId':_0x30b67c[_0xc282('0xdf')]||undefined,'CampaignId':_0x30b67c[_0xc282('0xe0')]||undefined})[_0xc282('0xa1')](loggerCatch(_0xc282('0x127')));_0x283199({'reschedule':0x1});}}});}if(_0x3c13b0[_0xc282('0xc1')]==='ivr'&&this[_0xc282('0x20')][_0x3c13b0[_0xc282('0xbf')]][_0xc282('0x128')]&&_0x127d86[_0xc282('0x110')]===_0xc282('0x111')){delete this['uniqueId'][_0x127d86[_0xc282('0xc0')]];this[_0xc282('0xcd')](this['campaigns'][_0x3c13b0[_0xc282('0xbf')]]);_0x4add9b=new Hangup(_0x3c13b0,_0x127d86);_0x4add9b[_0xc282('0x78')]=0x12;_0x4add9b[_0xc282('0xd2')]='HangupInAMD';_0x4add9b['membername']=_0xc282('0x129');ami[_0xc282('0x115')](_0xc282('0x11d'),ut[_0xc282('0x116')](_0x4add9b,_0xc282('0x117')));this[_0xc282('0x12a')](_0x4add9b,_0xc282('0x12b'),_0xc282('0x12c'));}if(_0x3c13b0['type']===_0xc282('0xc2')&&this[_0xc282('0x20')][_0x3c13b0[_0xc282('0xbf')]][_0xc282('0x128')]&&_0x127d86['value']==='MACHINE'){return new Promise(function(_0x34528f,_0x4c782b){delete _0x312416[_0xc282('0x26')][_0x127d86['uniqueid']];_0x312416[_0xc282('0xcd')](_0x312416[_0xc282('0x20')][_0x3c13b0[_0xc282('0xbf')]]);_0x312416[_0xc282('0x20')][_0x3c13b0[_0xc282('0xbf')]][_0xc282('0xc4')]+=0x1;_0x312416['campaigns'][_0x3c13b0[_0xc282('0xbf')]][_0xc282('0x112')]+=0x1;var _0x14bd2a=_0x312416[_0xc282('0x20')][_0x3c13b0['queue']];var _0x2a7923=new Hangup(_0x3c13b0,_0x127d86);_0x2a7923[_0xc282('0x78')]=0x13;_0x2a7923[_0xc282('0xd2')]='Machine';_0x2a7923[_0xc282('0x114')]=_0xc282('0x129');_0x2a7923[_0xc282('0x11c')]+=0x1;_0x2a7923[_0xc282('0xd6')]+=0x1;_0x2a7923[_0xc282('0x117')]=!![];ami[_0xc282('0x115')]('custom:amd',ut[_0xc282('0x116')](_0x2a7923,_0xc282('0x117')));hopperUtils[_0xc282('0xc9')](_0x2a7923)[_0xc282('0xa1')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x2a7923[_0xc282('0x11e')]+_0x2a7923[_0xc282('0x11f')]+_0x2a7923[_0xc282('0x120')]+_0x2a7923[_0xc282('0x121')]+_0x2a7923[_0xc282('0xd5')]+_0x2a7923[_0xc282('0xe8')]+_0x2a7923['countmachineretry']+_0x2a7923[_0xc282('0x12d')]>=_0x14bd2a[_0xc282('0x122')]){_0x312416['stateGlobal'](_0x2a7923,_0x34528f,_0x4c782b,'reason19\x20machine....');}else{if(_0x2a7923['countmachineretry']>=_0x14bd2a[_0xc282('0x12e')]){_0x312416['createStateFinal'](_0x2a7923,_0x34528f,_0x4c782b,_0xc282('0x125'));}else{hopperUtils[_0xc282('0xfe')]({'active':![],'countmachineretry':_0x2a7923['countmachineretry'],'scheduledat':moment()[_0xc282('0xdc')](_0x14bd2a[_0xc282('0x126')],'minutes')[_0xc282('0x4d')](_0xc282('0xc3')),'ContactId':_0x2a7923[_0xc282('0xde')],'ListId':_0x2a7923[_0xc282('0xec')],'VoiceQueueId':_0x2a7923[_0xc282('0xdf')]||undefined,'CampaignId':_0x2a7923['CampaignId']||undefined})[_0xc282('0xa1')](loggerCatch('[rescheduleContact][Machine]'));_0x34528f({'reschedule':0x1});}}});}}};Dialer[_0xc282('0x8c')][_0xc282('0x3b')]=function(_0x392db2){var _0x3fa6f3=this[_0xc282('0x26')][_0x392db2[_0xc282('0xc0')]];var _0x4bb93d;if(_0x3fa6f3&&_0x3fa6f3[_0xc282('0xc1')]===_0xc282('0xc2')){delete this[_0xc282('0x26')][_0x392db2[_0xc282('0xc0')]];this['updateOriginated'](this[_0xc282('0x20')][_0x3fa6f3[_0xc282('0xbf')]]);this[_0xc282('0x20')][_0x3fa6f3[_0xc282('0xbf')]][_0xc282('0x12f')]+=0x1;_0x4bb93d=new Hangup(_0x3fa6f3,_0x392db2);hopperUtils[_0xc282('0xc9')](_0x4bb93d)[_0xc282('0xa1')](loggerCatch(_0xc282('0x130')));hopperUtils[_0xc282('0xcb')](_0x4bb93d)['catch'](loggerCatch('[syncHangupIvr]'));}if(_0x3fa6f3&&_0x3fa6f3[_0xc282('0xc1')]!==_0xc282('0xc2')&&isNotNull(this[_0xc282('0x1f')][_0x3fa6f3[_0xc282('0xbf')]][_0xc282('0x131')])){delete this[_0xc282('0x26')][_0x392db2[_0xc282('0xc0')]];this[_0xc282('0xcd')](this['voiceQueues'][_0x3fa6f3['queue']]);this[_0xc282('0x1f')][_0x3fa6f3[_0xc282('0xbf')]][_0xc282('0xc4')]+=0x1;this[_0xc282('0x1f')][_0x3fa6f3[_0xc282('0xbf')]]['outboundAnswerAgiCallsDay']+=0x1;_0x4bb93d=new Hangup(_0x3fa6f3,_0x392db2);_0x4bb93d[_0xc282('0x78')]=0x10;_0x4bb93d['statedesc']=_0xc282('0x132');_0x4bb93d[_0xc282('0x114')]='AGI';hopperUtils[_0xc282('0xc9')](_0x4bb93d)[_0xc282('0xa1')](loggerCatch('[syncHangupIvr][createHistory]'));hopperUtils[_0xc282('0xcb')](_0x4bb93d)['catch'](loggerCatch('[syncHangupIvr]'));}if(_0x3fa6f3&&_0x3fa6f3[_0xc282('0xc1')]!==_0xc282('0xc2')&&!isNotNull(this[_0xc282('0x1f')][_0x3fa6f3[_0xc282('0xbf')]][_0xc282('0x131')])){if(_0x392db2[_0xc282('0x133')]===_0xc282('0x134')){delete this[_0xc282('0x26')][_0x392db2[_0xc282('0xc0')]];this['voiceQueues'][_0x3fa6f3['queue']][_0xc282('0xc4')]+=0x1;const _0x21d85c=new AgentComplete(_0x3fa6f3,_0x392db2);_0x21d85c['CampaignId']=this['voiceQueues'][_0x3fa6f3[_0xc282('0xbf')]]['id'];hopperUtils[_0xc282('0xc9')](_0x21d85c)['catch'](loggerCatch('[syncAgentComplete][createHistory]'));hopperUtils[_0xc282('0xcb')](_0x21d85c)['catch'](loggerCatch('[syncAgentComplete]'));}else{delete this[_0xc282('0x26')][_0x392db2['uniqueid']];this[_0xc282('0xcd')](this[_0xc282('0x1f')][_0x3fa6f3['queue']]);this[_0xc282('0x1f')][_0x3fa6f3[_0xc282('0xbf')]]['outboundUnknownCallsDay']+=0x1;_0x4bb93d=new Hangup(_0x3fa6f3,_0x392db2);_0x4bb93d[_0xc282('0x78')]=0xc;_0x4bb93d[_0xc282('0xd2')]=_0x392db2[_0xc282('0x133')];_0x4bb93d['membername']=_0xc282('0x135');hopperUtils[_0xc282('0xc9')](_0x4bb93d)[_0xc282('0xa1')](loggerCatch(_0xc282('0x130')));hopperUtils[_0xc282('0xcb')](_0x4bb93d)[_0xc282('0xa1')](loggerCatch(_0xc282('0x136')));}}};Dialer[_0xc282('0x8c')][_0xc282('0x37')]=function(_0x1313ac){var _0x1f42ae=this;if(!_0x1f42ae[_0xc282('0x2c')][_0x1313ac[_0xc282('0x4f')]]){_0x1f42ae[_0xc282('0x2c')][_0x1313ac[_0xc282('0x4f')]]={'running':![]};}else if(_0x1f42ae['queuesSummary'][_0x1313ac[_0xc282('0x4f')]][_0xc282('0x137')]===!![]){return;}else if(_0x1f42ae['queuesSummary'][_0x1313ac[_0xc282('0x4f')]][_0xc282('0x137')]===![]){_0x1f42ae[_0xc282('0x2c')][_0x1313ac[_0xc282('0x4f')]][_0xc282('0x137')]=!![];}var _0x46c68b=_0x1f42ae[_0xc282('0x1f')][_0x1313ac['name']];var _0x25a3ff=_0x46c68b['message']!==utils['CAMPAIGN_STATUS'][_0xc282('0x82')];var _0xd97484=utils[_0xc282('0x138')](_0x46c68b);_0x46c68b[_0xc282('0x139')]=utils[_0xc282('0x13a')](_0x46c68b,_0x1f42ae[_0xc282('0x22')]);Promise[_0xc282('0xae')]()['then'](function(){if(_0x46c68b['statusMessage']===utils['CAMPAIGN_STATUS'][_0xc282('0x82')]){if(_0x25a3ff){clearPredictiveAttributes(_0x46c68b);_0x1313ac['startPredictive']=undefined;_0x1313ac[_0xc282('0x6a')]=undefined;}if(_0x46c68b[_0xc282('0x139')]===utils[_0xc282('0x72')]['INACTIVE']){_0x1313ac[_0xc282('0x13b')]=0x0;_0x1313ac['paused']=0x0;_0x1313ac[_0xc282('0x13c')]=0x0;_0x1313ac[_0xc282('0x13d')]=0x0;_0x1313ac[_0xc282('0x13e')]=0x0;}}else if(_0x46c68b[_0xc282('0x139')]===utils['CAMPAIGN_STATUS'][_0xc282('0x13f')]&&!_0xd97484){return _0x1f42ae['ifTime'](_0x46c68b,!![])['then'](function(){return _0x1f42ae[_0xc282('0x95')](_0x46c68b,![]);})[_0xc282('0x46')](function(){return _0x1f42ae[_0xc282('0xb2')](_0x46c68b);})['catch'](function(_0x178aac){loggerSyncQueueSummary[_0xc282('0x4a')](_0xc282('0x140'),util['inspect'](_0x178aac,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x46c68b);});}else{clearPredictiveAttributes(_0x46c68b);}})[_0xc282('0x46')](function(){var _0x3aab26=_0x1313ac[_0xc282('0x141')](_0x46c68b);if(_0x3aab26||_0x46c68b[_0xc282('0x142')]){_0x46c68b[_0xc282('0x142')]=![];_0x1313ac[_0xc282('0x143')](_0x46c68b);Object[_0xc282('0x144')](_0x46c68b,_0x1313ac);emitOutboundVoiceQueueSummary(_0x1313ac);}_0x1f42ae[_0xc282('0x2c')][_0x46c68b[_0xc282('0x4f')]][_0xc282('0x137')]=![];})[_0xc282('0xa1')](function(_0x1833af){logger[_0xc282('0x6d')](_0xc282('0x140'),util['inspect'](_0x1833af,{'showHidden':![],'depth':null}));_0x1f42ae[_0xc282('0x2c')][_0x46c68b[_0xc282('0x4f')]][_0xc282('0x137')]=![];});};Dialer[_0xc282('0x8c')][_0xc282('0x39')]=_[_0xc282('0x145')](function(){var _0x31775d=_[_0xc282('0x146')](this['voiceQueues'],function(_0x1e9efa){return _0x1e9efa[_0xc282('0x147')];});var _0x35f03c=_[_0xc282('0x146')](this['agents'],function(_0x2c08a8){return _0x2c08a8['online']&&_0x2c08a8[_0xc282('0xf5')]==='reachable';});if(_0x31775d[_0xc282('0x148')]>0x0&&_0x35f03c['length']>0x0){return Promise[_0xc282('0xae')]()[_0xc282('0x46')](cmHopper[_0xc282('0x149')](_[_0xc282('0x14a')](_0x31775d,'id'),previewRecallmeReminderInterval,_['map'](_0x35f03c,'id')))[_0xc282('0x46')](function(_0x2de028){for(var _0xc5a6ed=0x0;_0xc5a6ed<_0x2de028[_0xc282('0x148')];_0xc5a6ed++){var _0x1ef1f1=_0x2de028[_0xc5a6ed]['Agent'][_0xc282('0x4f')];if(_0x1ef1f1)io['to'](util[_0xc282('0x4d')](_0xc282('0x14b'),_0x1ef1f1))[_0xc282('0x115')](_0xc282('0x14c'),{'hopper':_0x2de028[_0xc5a6ed]});}})[_0xc282('0xa1')](function(_0x5dac29){logger['error'](_0xc282('0x14d'),_0x5dac29);});}},0x3c*0x3e8,{'leading':!![]});Dialer['prototype'][_0xc282('0x14e')]=function(){var _0x42d079=this;setInterval(function(){_0x42d079[_0xc282('0x14f')](_0x42d079[_0xc282('0x26')],_0xc282('0x150'));_0x42d079['clearZombieChannels'](_0x42d079['actions'],'[actions]');},0x32c8);};Dialer[_0xc282('0x8c')][_0xc282('0x14f')]=function(_0x2b14ea,_0x45e10c){var _0x20d39b=this;for(var _0x35667e in _0x2b14ea){if(typeof _0x2b14ea[_0x35667e]!=='undefined'){this[_0xc282('0x1d')][_0xc282('0x1a')](function(){if(!_['isNil'](_0x2b14ea[_0x35667e])){return ami[_0xc282('0xa2')]({'action':_0xc282('0xf5'),'channel':_0x2b14ea[_0x35667e][_0xc282('0xf1')]})[_0xc282('0xa1')](function(_0x14d99a){if(_0x14d99a[_0xc282('0x71')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x2b14ea[_0x35667e]&&_0x2b14ea[_0x35667e][_0xc282('0xc1')]!==_0xc282('0xc2')){_0x20d39b[_0xc282('0xcd')](_0x20d39b[_0xc282('0x1f')][_0x2b14ea[_0x35667e]['queue']]);logger[_0xc282('0x6d')]('[Dialer][checkChannel]',_0x45e10c,_0x35667e,_0x2b14ea[_0x35667e][_0xc282('0xbf')]);delete _0x2b14ea[_0x35667e];}if(_0x2b14ea[_0x35667e]&&_0x2b14ea[_0x35667e]['type']===_0xc282('0xc2')){_0x20d39b[_0xc282('0xcd')](_0x20d39b['campaigns'][_0x2b14ea[_0x35667e]['queue']]);logger[_0xc282('0x6d')]('[Dialer][checkChannel][ivr]',_0x45e10c,_0x35667e,_0x2b14ea[_0x35667e]['queue']);delete _0x2b14ea[_0x35667e];}},0x2328);}});}});}}};Dialer[_0xc282('0x8c')]['getVoiceQueueRtPauses']=function(_0x2f13ae){return Promise[_0xc282('0xae')]()[_0xc282('0x46')](voiceQueueRt[_0xc282('0x151')](_0x2f13ae))[_0xc282('0xa1')](loggerCatch(_0xc282('0x152')));};Dialer['prototype'][_0xc282('0xcd')]=function(_0x1c8226){if(!_['isUndefined'](_0x1c8226)&&_0x1c8226!==null){if(typeof _0x1c8226[_0xc282('0x153')]!==_0xc282('0x154')){if(_0x1c8226[_0xc282('0x153')]>0x0){_0x1c8226['originated']-=0x1;}else{logger[_0xc282('0x6d')](_0xc282('0x155'));}}}else{logger[_0xc282('0x6d')]('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer[_0xc282('0x8c')][_0xc282('0x156')]=function(_0x4a3211,_0xb0911e){var _0x1fb92a=this;return function(_0x220a80){_0x1fb92a[_0xc282('0xcd')](_0xb0911e);logger[_0xc282('0x6d')](_0x4a3211,util[_0xc282('0x4c')](_0x220a80,{'showHidden':![],'depth':null}));};};Dialer[_0xc282('0x8c')][_0xc282('0x157')]=function(_0x1f52d9,_0x1847b3,_0x35b67e){var _0x381b98={'state':0x19,'statedesc':'notFound'};this['updateOriginated'](_0x1847b3);this[_0xc282('0x12a')](_[_0xc282('0xf9')](_0x381b98,_['pick'](_0x35b67e,[_0xc282('0xde'),_0xc282('0xec'),_0xc282('0x158'),_0xc282('0xdf'),_0xc282('0xe0')])),_0xc282('0x159'),'[emptyContact]');logger[_0xc282('0x6d')](_0x1f52d9);};Dialer[_0xc282('0x8c')]['saveInDb']=function(_0x4b2eac,_0x2ea699,_0x9f4a7c){hopperUtils[_0xc282('0xc9')](_0x4b2eac)[_0xc282('0xa1')](loggerCatch(_0x2ea699));hopperUtils[_0xc282('0xcb')](_0x4b2eac)['catch'](loggerCatch(_0x9f4a7c));};Dialer['prototype'][_0xc282('0xea')]=function(_0x5c0f01,_0x2ca3e4){hopperUtils[_0xc282('0xc9')](_0x5c0f01)[_0xc282('0xa1')](loggerCatch(_0xc282('0xca')));if(_0x2ca3e4==0x0){hopperUtils['moveContactManagedDialer'](_0x5c0f01)[_0xc282('0xa1')](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));}};Dialer[_0xc282('0x8c')][_0xc282('0x14d')]=function(_0x1e34d0){return Promise[_0xc282('0xae')]()[_0xc282('0x46')](cmHopper['handlePreviewRecallNotifications'](_0x1e34d0['id'],previewRecallmeReminderInterval))[_0xc282('0x46')](function(_0x572787){for(var _0x5a435a=0x0;_0x5a435a<_0x572787[_0xc282('0x148')];_0x5a435a++){var _0x5ee7dc=_0x572787[_0x5a435a]['Agent'][_0xc282('0x4f')];if(_0x5ee7dc)io['to'](util['format'](_0xc282('0x14b'),_0x5ee7dc))[_0xc282('0x115')](_0xc282('0x14c'),{'hopper':_0x572787[_0x5a435a]});}})['catch'](function(){});};Dialer[_0xc282('0x8c')][_0xc282('0x15a')]=function(_0x257b21){var _0x5b2bfb=this;return function(){_0x5b2bfb[_0xc282('0x15b')](_0x257b21);};};Dialer[_0xc282('0x8c')][_0xc282('0x15c')]=function(_0x5c48c5,_0x1cef4e){var _0x2dbe3c=this;var _0x2f0a26=uuid['v4']();this['actions'][_0x2f0a26]=new Action(_0x5c48c5,_0x1cef4e,_0x2f0a26);return new Promise(function(_0x59b639,_0x33caa5){if(_[_0xc282('0x48')](_0x5c48c5)&&typeof _0x5c48c5!==_0xc282('0x15d')){return _0x33caa5(msgResponse(_0xc282('0x15e'),'Failure','voiceQueue\x20is\x20undefine'));}if(_[_0xc282('0x48')](_0x1cef4e[_0xc282('0x15f')])||_0x1cef4e[_0xc282('0x15f')]===null){return _0x33caa5(msgResponse(_0xc282('0x15e'),_0xc282('0x96'),'contact\x20is\x20undefine'));}var _0x5e9b0f={'XMD-CALLERID':_0x2dbe3c[_0xc282('0xf0')][_0x2f0a26][_0xc282('0x160')](),'XMD-AGI':_0x5c48c5['dialQueueProject']?util[_0xc282('0x4d')](_0xc282('0x161'),ipAgi,_0x5c48c5[_0xc282('0x131')]):'NONE','XMD-AGIAFTER':_0x5c48c5[_0xc282('0xc7')]?util['format'](_0xc282('0x161'),ipAgi,_0x5c48c5['dialQueueProject2']):_0xc282('0x162'),'XMD-QUEUE':utils[_0xc282('0x163')](_0x5c48c5)?util['format']('\x22%s,%s%s,,,%s\x22',_0x5c48c5[_0xc282('0x4f')],_0x5c48c5[_0xc282('0x164')]||'',_0x5c48c5[_0xc282('0xc8')]?'c':'',_0x5c48c5['dialQueueTimeout']||0x3):_0xc282('0x162'),'XMD-CONTACTID':_0x1cef4e[_0xc282('0xde')],'XMD-CDRTYPE':_0xc282('0x165'),'CALLERID(all)':_0x2dbe3c[_0xc282('0xf0')][_0x2f0a26][_0xc282('0x160')](),'XMD-AMD':_0x5c48c5[_0xc282('0x128')]?_0xc282('0x13f'):_0xc282('0x162'),'XMD-DESTINATION':'xcally-motion-dialer'};if(_0x5c48c5[_0xc282('0x128')]){_0x5e9b0f[_0xc282('0x166')]=_0x5c48c5['dialAMDInitialSilence']||0x9c4;_0x5e9b0f[_0xc282('0x167')]=_0x5c48c5[_0xc282('0x168')]||0x5dc;_0x5e9b0f['XMD-AMDAFTERGREETINGSILENCE']=_0x5c48c5[_0xc282('0x169')]||0x320;_0x5e9b0f[_0xc282('0x16a')]=_0x5c48c5[_0xc282('0x16b')]||0x1388;_0x5e9b0f['XMD-AMDMINWORDLENGTH']=_0x5c48c5['dialAMDMinWordLength']||0x64;_0x5e9b0f[_0xc282('0x16c')]=_0x5c48c5[_0xc282('0x16d')]||0x32;_0x5e9b0f[_0xc282('0x16e')]=_0x5c48c5[_0xc282('0x16f')]||0x3;_0x5e9b0f[_0xc282('0x170')]=_0x5c48c5[_0xc282('0x171')]||0x100;_0x5e9b0f['XMD-AMDMAXIMUMWORDLENGTH']=_0x5c48c5['dialAMDMaximumWordLength']||0x1388;}if(utils[_0xc282('0x163')](_0x5c48c5)){_0x5e9b0f['XMD-VOICEQUEUEID']=_0x1cef4e[_0xc282('0xdf')];}else{_0x5e9b0f['XMD-CAMPAIGNID']=_0x1cef4e[_0xc282('0xe0')];}var _0x440f9f=utils[_0xc282('0x172')](_0x1cef4e[_0xc282('0x173')]);Object[_0xc282('0x144')](_0x5e9b0f,_0x440f9f);var _0x1bc303=_0x2dbe3c[_0xc282('0x90')](_0x5c48c5[_0xc282('0x174')])?utils[_0xc282('0x175')](_0x5c48c5['Trunk'][_0xc282('0x176')],_0x5c48c5[_0xc282('0x177')],_0x5c48c5[_0xc282('0x178')]>0x0?utils[_0xc282('0x179')](_0x5c48c5[_0xc282('0x17a')],_0x5c48c5[_0xc282('0x178')]):_0x5c48c5[_0xc282('0x17a')]):utils[_0xc282('0x175')](_[_0xc282('0xf4')](_0x5c48c5[_0xc282('0x17b')])?_0x5c48c5[_0xc282('0x174')][_0xc282('0x176')]:_0x5c48c5[_0xc282('0x17b')][_0xc282('0x176')],_0x5c48c5[_0xc282('0x177')],_0x5c48c5[_0xc282('0x178')]>0x0?utils['getCallerIdRandom'](_0x5c48c5[_0xc282('0x17a')],_0x5c48c5[_0xc282('0x178')]):_0x5c48c5['dialOriginateCallerIdNumber']);if(_0x1bc303){_0x5e9b0f[_0xc282('0x17c')]=_0x2dbe3c['actions'][_0x2f0a26][_0xc282('0x17d')]=utils[_0xc282('0x17e')](_0x1bc303);_0x5e9b0f[_0xc282('0x17f')]=_0x1cef4e[_0xc282('0x15f')];}_0x5c48c5['variables']=_0x5e9b0f;return ami[_0xc282('0xa2')]({'actionid':_0x2f0a26,'action':'originate','channel':_0x2dbe3c[_0xc282('0x90')](_0x5c48c5[_0xc282('0x174')])?util[_0xc282('0x4d')]('SIP/%s/%s%s',_0x5c48c5['Trunk'][_0xc282('0x4f')],isNotNull(_0x5c48c5[_0xc282('0x180')])?_0x5c48c5[_0xc282('0x180')][_0xc282('0x181')]()||'':'',_0x5c48c5[_0xc282('0x182')]>0x0?_0x1cef4e[_0xc282('0x15f')]['substring'](_0x5c48c5[_0xc282('0x182')]):_0x1cef4e[_0xc282('0x15f')]):util[_0xc282('0x4d')]('SIP/%s/%s%s',_[_0xc282('0xf4')](_0x5c48c5['TrunkBackup'])?_0x5c48c5[_0xc282('0x174')]['name']:_0x5c48c5['TrunkBackup'][_0xc282('0x4f')],isNotNull(_0x5c48c5['dialPrefix'])?_0x5c48c5[_0xc282('0x180')]['trim']()||'':'',_0x5c48c5[_0xc282('0x182')]>0x0?_0x1cef4e[_0xc282('0x15f')]['substring'](_0x5c48c5['dialCutDigit']):_0x1cef4e[_0xc282('0x15f')]),'callerid':_0x1bc303,'Exten':_0xc282('0x10f'),'Context':'from-sip','Priority':'1','variable':_0x5e9b0f,'timeout':(_0x5c48c5[_0xc282('0x183')]||0x1e)*0x3e8,'async':!![],'channelid':_0x2f0a26})[_0xc282('0x46')](function(_0x401f39){return _0x59b639(_0x401f39);})[_0xc282('0xa1')](function(_0x539dca){_0x5c48c5['outboundOriginateFailureCallsDay']+=0x1;var _0x2c3bb1=new History(_0x2dbe3c[_0xc282('0xf0')][_0x2f0a26]);logger[_0xc282('0x6d')](util[_0xc282('0x4d')](_0xc282('0x184'),JSON[_0xc282('0x7d')](_0x539dca)));_0x2c3bb1[_0xc282('0x78')]=0xe;_0x2c3bb1['statedesc']='OriginateError';_0x2c3bb1[_0xc282('0x79')]=moment()[_0xc282('0x4d')](_0xc282('0xc3'));_0x2c3bb1[_0xc282('0xe3')]=_0x2c3bb1[_0xc282('0x79')];hopperUtils[_0xc282('0xc9')](_0x2c3bb1)[_0xc282('0xa1')](loggerCatch(_0xc282('0x185')));_0x2dbe3c[_0xc282('0xcb')](_0x2c3bb1)[_0xc282('0xa1')](loggerCatch(_0xc282('0x185')))[_0xc282('0x1c')](function(){delete _0x2dbe3c[_0xc282('0xf0')][_0x2f0a26];return _0x33caa5(msgResponse(_0xc282('0x15e'),_0xc282('0x8b'),_0xc282('0x186')));});});});};Dialer[_0xc282('0x8c')][_0xc282('0x187')]=function(_0xcdec26,_0x1ce8e5,_0x67fc64){var _0x5e9667=new History(_0x1ce8e5);if(_0x5e9667['countbusyretry']+_0x5e9667[_0xc282('0x11f')]+_0x5e9667[_0xc282('0x120')]+_0x5e9667['countnosuchnumberretry']+_0x5e9667['countdropretry']+_0x5e9667[_0xc282('0xe8')]+_0x5e9667[_0xc282('0x11c')]+_0x5e9667[_0xc282('0x12d')]>=_0x67fc64[_0xc282('0x122')]-0x1){return!![];}switch(_0xcdec26){case 0x3:if(_0x5e9667['countnoanswerretry']>=_0x67fc64[_0xc282('0x188')]-0x1){return!![];}hopperUtils[_0xc282('0xfe')]({'active':![],'countnoanswerretry':_0x5e9667[_0xc282('0x120')]+=0x1,'scheduledat':moment()[_0xc282('0xdc')](_0x67fc64['dialNoAnswerRetryFrequency'],'minutes')['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x5e9667[_0xc282('0xde')],'ListId':_0x5e9667[_0xc282('0xec')],'VoiceQueueId':_0x5e9667[_0xc282('0xdf')]||undefined,'CampaignId':_0x5e9667[_0xc282('0xe0')]||undefined})[_0xc282('0xa1')](loggerCatch(_0xc282('0x189')));break;case 0x5:if(_0x5e9667['countbusyretry']>=_0x67fc64[_0xc282('0x18a')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countbusyretry':_0x5e9667[_0xc282('0x11e')]+=0x1,'scheduledat':moment()['add'](_0x67fc64['dialBusyRetryFrequency'],_0xc282('0xdd'))[_0xc282('0x4d')](_0xc282('0xc3')),'ContactId':_0x5e9667[_0xc282('0xde')],'ListId':_0x5e9667[_0xc282('0xec')],'VoiceQueueId':_0x5e9667[_0xc282('0xdf')]||undefined,'CampaignId':_0x5e9667[_0xc282('0xe0')]||undefined})[_0xc282('0xa1')](loggerCatch(_0xc282('0x18b')));break;case 0x8:if(_0x5e9667[_0xc282('0x11f')]>=_0x67fc64[_0xc282('0x18c')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countcongestionretry':_0x5e9667[_0xc282('0x11f')]+=0x1,'scheduledat':moment()[_0xc282('0xdc')](_0x67fc64[_0xc282('0x18d')],_0xc282('0xdd'))[_0xc282('0x4d')](_0xc282('0xc3')),'ContactId':_0x5e9667[_0xc282('0xde')],'ListId':_0x5e9667[_0xc282('0xec')],'VoiceQueueId':_0x5e9667[_0xc282('0xdf')]||undefined,'CampaignId':_0x5e9667[_0xc282('0xe0')]||undefined})[_0xc282('0xa1')](loggerCatch(_0xc282('0x18e')));break;case 0x0:if(_0x5e9667[_0xc282('0x121')]>=_0x67fc64['dialNoSuchNumberMaxRetry']-0x1){return!![];}else{hopperUtils[_0xc282('0xfe')]({'active':![],'countnosuchnumberretry':_0x5e9667[_0xc282('0x121')]+=0x1,'scheduledat':moment()[_0xc282('0xdc')](_0x67fc64[_0xc282('0x18f')],'minutes')[_0xc282('0x4d')](_0xc282('0xc3')),'ContactId':_0x5e9667['ContactId'],'ListId':_0x5e9667[_0xc282('0xec')],'VoiceQueueId':_0x5e9667[_0xc282('0xdf')]||undefined,'CampaignId':_0x5e9667[_0xc282('0xe0')]||undefined})[_0xc282('0xa1')](loggerCatch(_0xc282('0x190')));}break;case 0xa:if(_0x5e9667[_0xc282('0xd5')]>=_0x67fc64['dialDropMaxRetry']-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countdropretry':_0x5e9667['countdropretry']+=0x1,'scheduledat':moment()[_0xc282('0xdc')](_0x67fc64[_0xc282('0xd7')],_0xc282('0xdd'))[_0xc282('0x4d')](_0xc282('0xc3')),'ContactId':_0x5e9667['ContactId'],'ListId':_0x5e9667['ListId'],'VoiceQueueId':_0x5e9667[_0xc282('0xdf')]||undefined,'CampaignId':_0x5e9667['CampaignId']||undefined})[_0xc282('0xa1')](loggerCatch(_0xc282('0xe1')));break;case 0xb:if(_0x5e9667[_0xc282('0xe8')]>=_0x67fc64['dialAbandonedMaxRetry']-0x1){return!![];}hopperUtils[_0xc282('0xfe')]({'active':![],'countabandonedretry':_0x5e9667[_0xc282('0xe8')]+=0x1,'scheduledat':moment()['add'](_0x67fc64['dialAbandonedRetryFrequency'],_0xc282('0xdd'))[_0xc282('0x4d')](_0xc282('0xc3')),'ContactId':_0x5e9667[_0xc282('0xde')],'ListId':_0x5e9667[_0xc282('0xec')],'VoiceQueueId':_0x5e9667[_0xc282('0xdf')]||undefined,'CampaignId':_0x5e9667[_0xc282('0xe0')]||undefined})[_0xc282('0xa1')](loggerCatch('[rescheduleContact][Abandoned]'));break;case 0x13:if(_0x5e9667[_0xc282('0x11c')]>=_0x67fc64[_0xc282('0x12e')]-0x1){return!![];}hopperUtils[_0xc282('0xfe')]({'active':![],'countmachineretry':_0x5e9667[_0xc282('0x11c')]+=0x1,'scheduledat':moment()[_0xc282('0xdc')](_0x67fc64[_0xc282('0x126')],_0xc282('0xdd'))[_0xc282('0x4d')](_0xc282('0xc3')),'ContactId':_0x5e9667[_0xc282('0xde')],'ListId':_0x5e9667[_0xc282('0xec')],'VoiceQueueId':_0x5e9667[_0xc282('0xdf')]||undefined,'CampaignId':_0x5e9667[_0xc282('0xe0')]||undefined})[_0xc282('0xa1')](loggerCatch(_0xc282('0x127')));break;case 0x14:if(_0x5e9667[_0xc282('0x12d')]>=_0x67fc64[_0xc282('0x191')]-0x1){return!![];}hopperUtils[_0xc282('0xfe')]({'active':![],'countagentrejectretry':_0x5e9667['countagentrejectretry']+=0x1,'scheduledat':moment()[_0xc282('0xdc')](_0x67fc64[_0xc282('0x192')],_0xc282('0xdd'))[_0xc282('0x4d')](_0xc282('0xc3')),'ContactId':_0x5e9667[_0xc282('0xde')],'ListId':_0x5e9667[_0xc282('0xec')],'VoiceQueueId':_0x5e9667['VoiceQueueId']||undefined,'CampaignId':_0x5e9667['CampaignId']||undefined})['catch'](loggerCatch(_0xc282('0x193')));break;default:return!![];}};Dialer['prototype'][_0xc282('0x194')]=function(_0x435c53,_0x27470b,_0x16b698){var _0x30aba2=this;var _0xe2eaec=new History(_0x435c53);var _0x3127e8=![];var _0x480afc;var _0x2b53f3;return new Promise(function(_0x11fab3,_0x4f204f){if(_[_0xc282('0x48')](_0x27470b)&&typeof _0x27470b!==_0xc282('0x15d')){return _0x4f204f(msgResponse(_0xc282('0x195'),_0xc282('0x96'),'entity\x20is\x20undefine'));}if(_[_0xc282('0x48')](_0x16b698)&&typeof _0x16b698!==_0xc282('0x15d')){return _0x4f204f(msgResponse('[callProgressDetecting]','Failure','evt\x20is\x20undefine'));}hopperUtils[_0xc282('0xd8')](_0xe2eaec,_0x16b698[_0xc282('0xc5')],_0x27470b)[_0xc282('0x46')](function(_0x5ab5ab){if(_0x5ab5ab['additional']==0x1)_0x3127e8=!![];switch(_0x16b698[_0xc282('0xc5')]){case'0':_0x27470b[_0xc282('0x196')]+=0x1;_0xe2eaec[_0xc282('0x78')]=0x0;_0xe2eaec[_0xc282('0xd2')]=_0xc282('0x197');_0xe2eaec[_0xc282('0x121')]+=0x1;_0xe2eaec[_0xc282('0xd6')]+=0x1;ami[_0xc282('0x115')](_0xc282('0x198'),ut[_0xc282('0x116')](_0x435c53,_0xc282('0x199')));_0x480afc=_0x27470b[_0xc282('0x18f')];_0x2b53f3=_0x27470b['callAdditionalPhoneAfterMin'];hopperUtils['createHistory'](_0xe2eaec)[_0xc282('0xa1')](loggerCatch(_0xc282('0x19a')));if(_0x30aba2[_0xc282('0x187')](0x0,_0x435c53,_0x27470b)&&!_0x3127e8){if(_0xe2eaec[_0xc282('0x121')]>=_0x27470b[_0xc282('0x19b')]){_0x30aba2[_0xc282('0x124')](_0xe2eaec,_0x11fab3,_0x4f204f,'reason\x200\x20no\x20such\x20number....');}else{_0x30aba2[_0xc282('0x19c')](_0xe2eaec,_0x11fab3,_0x4f204f,_0xc282('0x19d'));}}break;case'3':_0x27470b[_0xc282('0x19e')]+=0x1;_0xe2eaec[_0xc282('0x78')]=0x3;_0xe2eaec[_0xc282('0xd2')]=_0xc282('0x19f');_0xe2eaec[_0xc282('0x120')]+=0x1;_0xe2eaec[_0xc282('0xd6')]+=0x1;var _0x56b2bf=ut[_0xc282('0x1a0')](_0x435c53,_0x27470b);ami[_0xc282('0x115')]('custom:agentnoanswer',_0x56b2bf);_0x480afc=_0x27470b[_0xc282('0x1a1')];_0x2b53f3=_0x27470b[_0xc282('0x1a2')];hopperUtils['createHistory'](_0xe2eaec)['catch'](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0x30aba2[_0xc282('0x187')](0x3,_0x435c53,_0x27470b)&&!_0x3127e8){if(_0xe2eaec[_0xc282('0x120')]>=_0x27470b[_0xc282('0x188')]){_0x30aba2[_0xc282('0x124')](_0xe2eaec,_0x11fab3,_0x4f204f,'reason\x203\x20ringing\x20no\x20answer');}else{_0x30aba2[_0xc282('0x19c')](_0xe2eaec,_0x11fab3,_0x4f204f,_0xc282('0x1a3'));}}break;case'5':_0x27470b[_0xc282('0x1a4')]+=0x1;_0xe2eaec[_0xc282('0x78')]=0x5;_0xe2eaec[_0xc282('0xd2')]=_0xc282('0x1a5');_0xe2eaec[_0xc282('0x11e')]+=0x1;_0xe2eaec['countglobal']+=0x1;ami['emit'](_0xc282('0x1a6'),ut[_0xc282('0x116')](_0x435c53,'busy'));_0x480afc=_0x27470b[_0xc282('0x1a7')];_0x2b53f3=_0x27470b['callAdditionalPhoneAfterMin'];hopperUtils['createHistory'](_0xe2eaec)['catch'](loggerCatch(_0xc282('0x1a8')));if(_0x30aba2['checkRetriveMax'](0x5,_0x435c53,_0x27470b)&&!_0x3127e8){if(_0xe2eaec[_0xc282('0x11e')]>=_0x27470b[_0xc282('0x18a')]){_0x30aba2[_0xc282('0x124')](_0xe2eaec,_0x11fab3,_0x4f204f,_0xc282('0x1a9'));}else{_0x30aba2[_0xc282('0x19c')](_0xe2eaec,_0x11fab3,_0x4f204f,_0xc282('0x1a9'));}}break;case'8':_0x27470b['outboundCongestionCallsDay']+=0x1;_0xe2eaec['state']=0x8;_0xe2eaec[_0xc282('0xd2')]=_0xc282('0x1aa');_0xe2eaec[_0xc282('0x11f')]+=0x1;_0xe2eaec[_0xc282('0xd6')]+=0x1;_0x480afc=_0x27470b[_0xc282('0x18d')];_0x2b53f3=_0x27470b['callAdditionalPhoneAfterMin'];ami['emit'](_0xc282('0x1ab'),ut[_0xc282('0x116')](_0x435c53,'congestion'));hopperUtils['createHistory'](_0xe2eaec)[_0xc282('0xa1')](loggerCatch(_0xc282('0x1ac')));if(_0x30aba2[_0xc282('0x187')](0x8,_0x435c53,_0x27470b)&&!_0x3127e8){if(_0xe2eaec[_0xc282('0x11f')]>=_0x27470b[_0xc282('0x18c')]){_0x30aba2[_0xc282('0x124')](_0xe2eaec,_0x11fab3,_0x4f204f,_0xc282('0x1ad'));}else{_0x30aba2['stateGlobal'](_0xe2eaec,_0x11fab3,_0x4f204f,_0xc282('0x1ad'));}}break;case'11':_0x27470b[_0xc282('0x1ae')]+=0x1;_0xe2eaec['state']=0xb;_0xe2eaec[_0xc282('0xd2')]=_0xc282('0xee');_0xe2eaec['countabandonedretry']+=0x1;_0xe2eaec['countglobal']+=0x1;_0x480afc=_0x27470b[_0xc282('0xeb')];_0x2b53f3=_0x27470b['callAdditionalPhoneAfterMin'];hopperUtils[_0xc282('0xc9')](_0xe2eaec)[_0xc282('0xa1')](loggerCatch(_0xc282('0xef')));if(_0x30aba2[_0xc282('0x187')](0xb,_0x435c53,_0x27470b)&&!_0x3127e8){if(_0xe2eaec[_0xc282('0xe8')]>=_0x27470b[_0xc282('0xe9')]){_0x30aba2['createStateFinal'](_0xe2eaec,_0x11fab3,_0x4f204f,'reason\x2011\x20abandoned');}else{_0x30aba2[_0xc282('0x19c')](_0xe2eaec,_0x11fab3,_0x4f204f,_0xc282('0x1af'));}}break;case'20':_0x27470b['outboundRejectCallsDay']+=0x1;_0xe2eaec[_0xc282('0x78')]=0x14;_0xe2eaec[_0xc282('0xd2')]=_0xc282('0x1b0');_0xe2eaec[_0xc282('0x12d')]+=0x1;_0xe2eaec['countglobal']+=0x1;_0x480afc=_0x27470b['dialAgentRejectRetryFrequency'];_0x2b53f3=_0x27470b[_0xc282('0x1a2')];ami[_0xc282('0x115')]('custom:agentreject',ut[_0xc282('0x116')](_0x435c53,'agentreject'));hopperUtils[_0xc282('0xc9')](_0xe2eaec)[_0xc282('0xa1')](loggerCatch('[syncAgentComplete][createHistory][20]'));if(_0x30aba2['checkRetriveMax'](0x14,_0x435c53,_0x27470b)&&!_0x3127e8){if(_0xe2eaec[_0xc282('0x12d')]>=_0x27470b['dialAgentRejectMaxRetry']){_0x30aba2[_0xc282('0x124')](_0xe2eaec,_0x11fab3,_0x4f204f,_0xc282('0x1b1'));}else{_0x30aba2['stateGlobal'](_0xe2eaec,_0x11fab3,_0x4f204f,_0xc282('0x1b1'));}}break;default:_0x27470b[_0xc282('0x1b2')]+=0x1;_0xe2eaec[_0xc282('0x78')]=0xc;_0xe2eaec[_0xc282('0xd2')]=_0x16b698[_0xc282('0xc5')];_0x480afc=_0x27470b[_0xc282('0x192')];_0x2b53f3=_0x27470b[_0xc282('0x1a2')];hopperUtils[_0xc282('0xc9')](_0xe2eaec)[_0xc282('0xa1')](loggerCatch(_0xc282('0x1b3')));if(_0x30aba2['checkRetriveMax'](_0x16b698['reason'],_0x435c53,_0x27470b)&&!_0x3127e8){if(_0xe2eaec[_0xc282('0x11e')]+_0xe2eaec[_0xc282('0x11f')]+_0xe2eaec[_0xc282('0x120')]+_0xe2eaec[_0xc282('0x121')]+_0xe2eaec[_0xc282('0xd5')]+_0xe2eaec['countabandonedretry']+_0xe2eaec[_0xc282('0x11c')]+_0xe2eaec[_0xc282('0x12d')]>=_0x27470b[_0xc282('0x122')]){_0x30aba2[_0xc282('0x19c')](_0xe2eaec,_0x11fab3,_0x4f204f,_0x16b698[_0xc282('0xc5')]);}else{_0x30aba2[_0xc282('0x124')](_0xe2eaec,_0x11fab3,_0x4f204f,_0x16b698[_0xc282('0xc5')]);}}}})[_0xc282('0x46')](function(){if(_0x3127e8){hopperUtils['swapAdditionalPhones'](_0xe2eaec,_0x480afc,_0x2b53f3)[_0xc282('0x46')](function(){return _0x11fab3(0x1);});}});});};Dialer['prototype'][_0xc282('0x19c')]=function(_0x330411,_0x46e1b4,_0x291c5a,_0x3ae577){var _0x38d636=new Final(_0x330411);_0x38d636['state']=0xf;_0x38d636['statedesc']=_0xc282('0x1b4');this['createStateFinal'](_0x38d636,_0x46e1b4,_0x291c5a,_0x3ae577);};Dialer[_0xc282('0x8c')]['createStateFinal']=function(_0x394619,_0x53e281,_0x1cecfb,_0x28d6a1){hopperUtils[_0xc282('0xcb')](_0x394619)[_0xc282('0x46')](function(){return _0x53e281(msgResponse(_0xc282('0x195'),_0xc282('0x1b5'),_0x28d6a1));})[_0xc282('0xa1')](function(){return _0x1cecfb(msgResponse(_0xc282('0x1b6'),_0xc282('0x96'),_0xc282('0x1b7')));});};Dialer[_0xc282('0x8c')]['predictive']=function(_0x162105){var _0x32129a=_0x162105['dialPredictiveOptimizationPercentage']/0x64;var _0x1309e5=_0x162105[_0xc282('0xd0')]/(_0x162105[_0xc282('0xd0')]+_0x162105['outboundAnswerCallsDay']);var _0x2a5e52=Math[_0xc282('0x1b8')](_0x162105[_0xc282('0x1b9')]*(_0x162105['predictiveIntervalMaxThreshold']/0x64));var _0x33f286=Math[_0xc282('0x1b8')](_0x162105[_0xc282('0x1b9')]*(_0x162105[_0xc282('0x1ba')]/0x64));var _0x30757a=_0x162105[_0xc282('0x13b')]+_0x162105[_0xc282('0x13d')];var _0x448234=Math[_0xc282('0x1bb')](_0x162105[_0xc282('0x65')]*_0x162105['erlangAbandonmentRate']*_0x162105[_0xc282('0x1bc')]*_0x162105['predictiveIntervalMultiplicativeFactor']);if(_[_0xc282('0x48')](_0x162105[_0xc282('0x6a')])){if(!_[_0xc282('0x48')](_0x162105[_0xc282('0x28')])){_0x162105[_0xc282('0x28')]=undefined;loggerPredictive['error'](_0xc282('0x1bd'),_0xc282('0x1be'));}if(!_[_0xc282('0x48')](_0x162105[_0xc282('0x6c')])){loggerPredictive['error'](_0xc282('0x1bd'),_0xc282('0x1bf'));clearInterval(_0x162105[_0xc282('0x6c')]);_0x162105['handlePredictive']=undefined;}_0x162105[_0xc282('0x6a')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0xc282('0x53')](_0x162105['name'],'collection\x20data\x20in\x20progressive\x20at',_0x162105[_0xc282('0x6a')]);this[_0xc282('0xb5')](_0x162105,0x1);}else if(ifInterval(_0x162105[_0xc282('0x1c0')],_0x162105['startProgressive'])){this[_0xc282('0xb5')](_0x162105,0x1);loggerPredictiveCalls[_0xc282('0x53')](_0xc282('0x1c1'),_0x162105[_0xc282('0x6a')],_0x162105[_0xc282('0x4f')]);_0x162105['erlangCalls']=0x0;_0x162105['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0x32129a<_0x1309e5&&_0x162105[_0xc282('0x1c2')]===_0xc282('0x1c3')){clearPredictiveAttributes(_0x162105);loggerPredictive[_0xc282('0x53')]('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]',_0xc282('0x1c4'),_0x1309e5,_0xc282('0x6a'),_0x162105[_0xc282('0x4f')]);}else if(_0x448234<_0x162105[_0xc282('0xd1')]&&_0x162105['dialPredictiveOptimization']==='dropRate'){clearPredictiveAttributes(_0x162105);loggerPredictive[_0xc282('0x53')]('[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]',_0xc282('0x1c5'),_0x448234,_0xc282('0x1c6'),_0x162105['predictiveIntervalErlangCallsDroppedCalls'],_0xc282('0x6a'),_0x162105[_0xc282('0x4f')]);}else if(!ifInterval(_0x162105[_0xc282('0x1c0')],_0x162105[_0xc282('0x6a')])&&_[_0xc282('0x48')](_0x162105[_0xc282('0x28')])&&!_[_0xc282('0x48')](_0x162105['startProgressive'])){_0x162105[_0xc282('0x28')]=moment()[_0xc282('0x4d')](_0xc282('0xc3'));loggerPredictive[_0xc282('0x53')](_0x162105[_0xc282('0x4f')],_0xc282('0x1c7'),_0x162105[_0xc282('0x28')]);hopperUtils[_0xc282('0x1c8')](_0x162105['dialPredictiveInterval'])[_0xc282('0x46')](this[_0xc282('0x1c9')](_0x162105))['then'](mergeDataErlangB(_0x162105))[_0xc282('0x46')](this[_0xc282('0x1ca')](_0x162105))[_0xc282('0xa1')](loggerCatchPredictive(_0xc282('0x1cb'),_0x162105));}else if(!ifInterval(_0x162105[_0xc282('0x1c0')],_0x162105[_0xc282('0x28')])){_0x162105['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x162105[_0xc282('0x28')]=moment()[_0xc282('0x4d')](_0xc282('0xc3'));loggerPredictive[_0xc282('0x53')](_0x162105[_0xc282('0x4f')],_0xc282('0x1cc'),_0x162105[_0xc282('0x28')]);clearInterval(_0x162105[_0xc282('0x6c')]);_0x162105[_0xc282('0x6c')]=undefined;hopperUtils[_0xc282('0x1c8')](_0x162105[_0xc282('0x1c0')])[_0xc282('0x46')](this[_0xc282('0x1c9')](_0x162105))[_0xc282('0x46')](mergeDataErlangB(_0x162105))[_0xc282('0x46')](this[_0xc282('0x1ca')](_0x162105))[_0xc282('0xa1')](loggerCatchPredictive(_0xc282('0x1cd'),_0x162105));}else if(_0x162105[_0xc282('0x1b9')]&&_0x30757a<_0x162105['predictiveIntervalAvailable']-_0x33f286){clearPredictiveAttributes(_0x162105);loggerPredictive[_0xc282('0x53')](_0x162105[_0xc282('0x4f')],_0xc282('0x1ce'),_0x30757a,_0xc282('0x1cf'),_0x162105[_0xc282('0x1b9')],'-',_0x33f286,'=',_0x162105[_0xc282('0x1b9')]-_0x33f286,')');}else if(_0x162105[_0xc282('0x1b9')]&&_0x30757a>_0x162105[_0xc282('0x1b9')]+_0x2a5e52){clearPredictiveAttributes(_0x162105);loggerPredictive[_0xc282('0x53')](_0x162105[_0xc282('0x4f')],_0xc282('0x1ce'),_0x30757a,_0xc282('0x1d0'),_0x162105[_0xc282('0x1b9')],'+',_0x2a5e52,'=',_0x162105[_0xc282('0x1b9')]+_0x2a5e52,')');}};Dialer[_0xc282('0x8c')][_0xc282('0x1c9')]=function(_0x2ac36e){var _0x312e4c=this;return function(_0x2f187b){return new Promise(function(_0x128c1b,_0x3f5197){_['merge'](_0x2ac36e,_0x2f187b[0x0]);if(checkGetDataPredictive(_0x2f187b[0x0])){var _0xf3a7eb=_0x2ac36e[_0xc282('0x1b9')]=_0x2ac36e[_0xc282('0x13d')]+_0x2ac36e[_0xc282('0x13b')];var _0x193b89=_0x2ac36e['dialPredictiveInterval']*0x3c;var _0x4977e1=_0x2f187b[0x0][_0xc282('0x5f')]+_0x2f187b[0x0]['predictiveIntervalAvgHoldtime'];var _0x2bc131=(_0x2f187b[0x0][_0xc282('0x56')]+_0x2f187b[0x0][_0xc282('0x57')]+_0x2f187b[0x0][_0xc282('0x59')])/_0x2f187b[0x0][_0xc282('0x5e')];_0x2ac36e['predictiveIntervalHitRate']=_0x2bc131>0x0?_0x2bc131:0x1;switch(_0x2ac36e[_0xc282('0x1c2')]){case _0xc282('0x1c3'):var _0x2b7bf7=_0x2ac36e[_0xc282('0x1d1')]/0x64;return _0x312e4c['abandonmentRate'](_0xf3a7eb,_0x193b89,_0x4977e1,_0x2bc131,_0x2b7bf7)[_0xc282('0x46')](function(_0x53cd7f){return _0x128c1b(_0x53cd7f);});case _0xc282('0x1d2'):var _0x54976d=_0x2ac36e[_0xc282('0x1d1')]/0x64;return _0x312e4c[_0xc282('0x1d3')](_0xf3a7eb,_0x193b89,_0x4977e1,_0x2bc131,_0x54976d)[_0xc282('0x46')](function(_0x362356){return _0x128c1b(_0x362356);});default:return _0x3f5197(msgResponse(_0xc282('0x1d4'),_0xc282('0x96'),'Unknown\x20Predictive'));}}else{return _0x3f5197(msgResponse(_0xc282('0x1d4'),'Failure','check\x20failure'));}});};};Dialer[_0xc282('0x8c')][_0xc282('0x1d5')]=function(_0x2447a5){var _0x195617=this;return function(_0x3d3953){return new Promise(function(_0x56ccb7,_0x239f52){_[_0xc282('0xf9')](_0x2447a5,_0x3d3953[0x0]);if(checkGetDataPredictive(_0x3d3953[0x0])){loggerPredictive[_0xc282('0x53')](JSON[_0xc282('0x7d')](_0x3d3953[0x0]));if(_0x2447a5[_0xc282('0x1c2')]===_0xc282('0x1c3')){return _0x195617[_0xc282('0x151')](_0x2447a5['id'])[_0xc282('0x46')](function(_0x46e664){var _0x31d54c=_0x2447a5[_0xc282('0x1d6')]-_0x46e664[0x0][_0xc282('0x1d7')];var _0x57c0df=_0x2447a5[_0xc282('0x1c0')]*0x3c;var _0x2b1373=_0x3d3953[0x0][_0xc282('0x5f')]+_0x3d3953[0x0][_0xc282('0x5b')];var _0x221ab7=(_0x3d3953[0x0]['predictiveIntervalAnsweredCalls']+_0x3d3953[0x0][_0xc282('0x57')]+_0x3d3953[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x3d3953[0x0]['predictiveIntervalTotalCalls'];var _0xc04942=_0x2447a5[_0xc282('0x1d1')]/0x64;_0x2447a5['predictiveIntervalPauses']=_0x46e664[0x0][_0xc282('0x1d7')]||0x0;_0x2447a5[_0xc282('0x1bc')]=_0x221ab7>0x0?_0x221ab7:0x1;return _0x195617['abandonmentRate'](_0x31d54c,_0x57c0df,_0x2b1373,_0x221ab7,_0xc04942);})['then'](function(_0x2e150e){return _0x56ccb7(_0x2e150e);})['catch'](function(_0x5f7564){return _0x239f52(msgResponse(_0xc282('0x1d8'),_0xc282('0x96'),JSON[_0xc282('0x7d')](_0x5f7564)));});}if(_0x2447a5[_0xc282('0x1c2')]==='agentBusyFactor'){return _0x195617[_0xc282('0x151')](_0x2447a5['id'])[_0xc282('0x46')](function(_0x3b6504){var _0x2d11c7=_0x2447a5[_0xc282('0x1d6')]-_0x3b6504[0x0][_0xc282('0x1d7')];var _0x3d6638=_0x2447a5[_0xc282('0x1c0')]*0x3c;var _0xe35cea=_0x3d3953[0x0][_0xc282('0x5f')]+_0x3d3953[0x0][_0xc282('0x5b')];var _0x4547cb=(_0x3d3953[0x0][_0xc282('0x56')]+_0x3d3953[0x0][_0xc282('0x57')]+_0x3d3953[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x3d3953[0x0][_0xc282('0x5e')];var _0x189e54=_0x2447a5[_0xc282('0x1d1')]/0x64;_0x2447a5[_0xc282('0x1d9')]=_0x3b6504[0x0][_0xc282('0x1d7')]||0x0;_0x2447a5[_0xc282('0x1bc')]=_0x4547cb>0x0?_0x4547cb:0x1;return _0x195617['busyFactor'](_0x2d11c7,_0x3d6638,_0xe35cea,_0x4547cb,_0x189e54);})[_0xc282('0x46')](function(_0x4a0517){return _0x56ccb7(_0x4a0517);})[_0xc282('0xa1')](function(_0x579aa4){return _0x239f52(msgResponse(_0xc282('0x1d8'),_0xc282('0x96'),JSON[_0xc282('0x7d')](_0x579aa4)));});}}else{return _0x239f52(msgResponse(_0xc282('0x1d4'),_0xc282('0x96'),'check\x20failure'));}});};};Dialer[_0xc282('0x8c')][_0xc282('0x1ca')]=function(_0x46877a){var _0x3203f3=this;return function(){var _0x4e9bab=0x0;var _0x11d503=Math[_0xc282('0x1bb')](_0x46877a['erlangCallToSecond']*0x3e8);if(_0x11d503>0x0){_0x11d503=_0x11d503<0x64?0x64:_0x11d503;loggerPredictive[_0xc282('0x53')](_0x46877a[_0xc282('0x4f')],_0xc282('0x1da'),_0x11d503,_0xc282('0x1db'));_0x46877a[_0xc282('0x6c')]=setInterval(function(){_0x3203f3['handlePredictive'](_0x46877a);loggerPredictiveCalls[_0xc282('0x53')](_0xc282('0x1dc'),_0x4e9bab+=0x1);},_0x11d503);}else{loggerPredictive['info'](_0x46877a[_0xc282('0x4f')],'fail\x20to\x20scheduled\x20calls');}};};Dialer[_0xc282('0x8c')][_0xc282('0x1dd')]=function(_0x3c898c,_0xa2c405){var _0x3744cd=this;return function(_0x3683e1){if(_[_0xc282('0x51')](_0x3683e1)){if(_[_0xc282('0xf4')](_0xa2c405['UserId'])||!_0xa2c405[_0xc282('0x1de')]){if(_0x3c898c['dialMethod']===_0xc282('0xb8')){_0x3c898c[_0xc282('0x7a')]=_[_0xc282('0x48')](_0x3c898c[_0xc282('0x7a')])?!![]:_0x3c898c[_0xc282('0x7a')];var _0xcee789=uuid['v4']();_0x3744cd[_0xc282('0xf0')][_0xcee789]=new Action(_0x3c898c,_0xa2c405,_0xcee789);loggerBooked['info'](_0xc282('0x1df'),_0xcee789,'queueStatusComplete:\x20',JSON[_0xc282('0x7d')](_0x3c898c['queueStatusComplete']),_0xc282('0x1e0'),_0x3c898c['name']);if(_0x3c898c[_0xc282('0x7a')]){_0x3c898c['queueStatusComplete']=![];_0x3744cd[_0xc282('0x2a')][_0x3744cd[_0xc282('0xf0')][_0xcee789][_0xc282('0xbf')]]=[];ami['Action']({'actionid':_0xcee789,'action':_0xc282('0x1e1'),'queue':_0x3c898c[_0xc282('0x4f')]})[_0xc282('0xa1')](function(){_0x3744cd[_0xc282('0xcd')](_0x3c898c);hopperUtils[_0xc282('0xfe')]({'active':![],'ContactId':_0x3744cd[_0xc282('0xf0')][_0xcee789][_0xc282('0xde')],'ListId':_0x3744cd[_0xc282('0xf0')][_0xcee789][_0xc282('0xec')],'VoiceQueueId':_0x3744cd[_0xc282('0xf0')][_0xcee789][_0xc282('0xdf')]||undefined,'CampaignId':_0x3744cd[_0xc282('0xf0')][_0xcee789][_0xc282('0xe0')]||undefined})[_0xc282('0xa1')](loggerCatch(_0xc282('0x1e2')));delete _0x3744cd[_0xc282('0xf0')][_0xcee789];});}else{loggerBooked[_0xc282('0x53')](_0xc282('0x1e3'),JSON[_0xc282('0x7d')](_0x3c898c[_0xc282('0x7a')]),'Queue:\x20',_0x3c898c[_0xc282('0x4f')]);_0x3744cd[_0xc282('0xcd')](_0x3c898c);hopperUtils[_0xc282('0xfe')]({'active':![],'ContactId':_0x3744cd[_0xc282('0xf0')][_0xcee789][_0xc282('0xde')],'ListId':_0x3744cd['actions'][_0xcee789]['ListId'],'VoiceQueueId':_0x3744cd[_0xc282('0xf0')][_0xcee789][_0xc282('0xdf')]||undefined,'CampaignId':_0x3744cd[_0xc282('0xf0')][_0xcee789][_0xc282('0xe0')]||undefined})[_0xc282('0xa1')](loggerCatch(_0xc282('0x1e2')));delete _0x3744cd[_0xc282('0xf0')][_0xcee789];}}else{return _0x3744cd[_0xc282('0x15c')](_0x3c898c,_0xa2c405);}}else{if(utils[_0xc282('0x69')](undefined,_0xa2c405[_0xc282('0x1e4')])<_0x3c898c['dialRecallMeTimeout']*0x3c){if(_0xa2c405[_0xc282('0x1e5')]&&!_0xa2c405[_0xc282('0x1e5')][_0xc282('0x1e6')]){_0x3744cd[_0xc282('0x1e')]['run'](_0xa2c405['id'])['finally'](function(){_0x3744cd[_0xc282('0xcd')](_0x3c898c);});}else{hopperUtils[_0xc282('0x1e7')]({'active':![]},_0xa2c405['id'],0x1)[_0xc282('0x1c')](function(){_0x3744cd[_0xc282('0xcd')](_0x3c898c);});}}else{_0x3c898c[_0xc282('0x1e8')]+=0x1;_0x3744cd[_0xc282('0xcd')](_0x3c898c);if(_0x3c898c[_0xc282('0x1e9')]){hopperUtils['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0xa2c405['ContactId'],'ListId':_0xa2c405[_0xc282('0xec')],'VoiceQueueId':_0xa2c405[_0xc282('0xdf')]||undefined,'CampaignId':_0xa2c405['CampaignId']||undefined})[_0xc282('0xa1')](loggerCatch(_0xc282('0x1ea')));hopperUtils['createHistory'](createObjHistory(_0x3c898c,_0xa2c405,utils[_0xc282('0x72')][_0xc282('0x1eb')],0x17,'RecallInQueue'))['catch'](loggerCatch(_0xc282('0x1ec')));}else{_0x3744cd['saveInDb'](createObjHistory(_0x3c898c,_0xa2c405,utils[_0xc282('0x72')][_0xc282('0x1ed')],0x16,_0xc282('0x1ee')),_0xc282('0x1ef'),'[Originate][HistoryRecallClose]');}}}}else{_0x3c898c['outboundBlacklistCallsDay']+=0x1;_0x3744cd[_0xc282('0x12a')](createObjHistory(_0x3c898c,_0xa2c405,utils['CAMPAIGN_STATUS'][_0xc282('0x1f0')],0xd,_0xc282('0x1f1')),_0xc282('0x1f2'),_0xc282('0x1f3'));throw'inBlackList';}};};Dialer[_0xc282('0x8c')][_0xc282('0x15b')]=function(_0x13d96a){var _0x5e1993=this;var _0x223124=_0x13d96a[_0xc282('0x1f4')]-_0x13d96a[_0xc282('0x153')];emitCampaignSummary(_0x13d96a);if(_0x223124>0x0&&_0x13d96a[_0xc282('0x70')]==0x0){if(_0x223124>this[_0xc282('0x23')]){_0x223124=this[_0xc282('0x23')];}_0x13d96a[_0xc282('0x70')]=0x1;hopperUtils['getContactDialerIvr'](_0x13d96a,_0x223124)[_0xc282('0x46')](function(_0x25e13e){_0x13d96a[_0xc282('0x70')]=0x0;if(_0x25e13e){if(!utils[_0xc282('0x1f5')](_0x25e13e)){_0x13d96a['message']=utils[_0xc282('0x72')]['NO_AVAILABLE_CONTACTS'];logger['info'](_0xc282('0x1f6')+_0x13d96a['name']);}else{_0x13d96a[_0xc282('0x153')]+=_0x25e13e['length'];_0x13d96a[_0xc282('0x71')]=utils['CAMPAIGN_STATUS']['RUNNING'];for(var _0x5ef0b0=0x0;_0x5ef0b0<_0x25e13e[_0xc282('0x148')];_0x5ef0b0+=0x1){_0x13d96a[_0xc282('0x1f7')]+=0x1;if(_[_0xc282('0xf4')](_0x25e13e[_0x5ef0b0])||_[_0xc282('0xf4')](_0x25e13e[_0x5ef0b0][_0xc282('0x173')])||_['isNil'](_0x25e13e[_0x5ef0b0][_0xc282('0x15f')])){_0x5e1993[_0xc282('0x157')](_0xc282('0x1f8'),_0x13d96a,_0x25e13e[_0x5ef0b0]);}else{hopperUtils[_0xc282('0x1f9')](_['pick'](_0x25e13e[_0x5ef0b0],[_0xc282('0xe0'),'phone']))[_0xc282('0x46')](_0x5e1993[_0xc282('0x1dd')](_0x13d96a,_0x25e13e[_0x5ef0b0]))[_0xc282('0xa1')](_0x5e1993[_0xc282('0x156')](_0xc282('0x1fa'),_0x13d96a));}}}}})[_0xc282('0xa1')](loggerGetContactDialer(_0xc282('0x1fb'),_0x13d96a,_0x223124));}};Dialer['prototype'][_0xc282('0xb5')]=function(_0x548084,_0x5d48ec){var _0x184c76=this;var _0x25766e=[];if(_0x5d48ec<0x1||_0x548084[_0xc282('0x1fc')]==='booked'){_0x5d48ec=0x1;}var _0x442e6e=Math[_0xc282('0x1bb')](_0x548084[_0xc282('0x13b')]*_0x5d48ec)-_0x548084[_0xc282('0x153')];if(_0x548084[_0xc282('0x1fd')]>0x0){var _0x5e3944=_0x548084[_0xc282('0x1fd')]-_0x548084[_0xc282('0x153')]-_0x548084[_0xc282('0x13d')]-_0x548084[_0xc282('0x13e')];if(_0x442e6e>_0x5e3944){_0x442e6e=_0x5e3944;}}if(_0x442e6e>0x0&&_0x548084[_0xc282('0x70')]==0x0){if(_0x548084[_0xc282('0x1fc')]==='booked'){_0x442e6e=0x1;}if(_0x442e6e>this[_0xc282('0x23')]){_0x442e6e=this[_0xc282('0x23')];}for(var _0x43eeaa in this[_0xc282('0x21')]){if(typeof this[_0xc282('0x21')][_0x43eeaa]!==_0xc282('0x154')){if(this[_0xc282('0x21')][_0x43eeaa][_0xc282('0x78')]==='not_inuse'&&this['agents'][_0x43eeaa]['status']===_0xc282('0x8f')){_0x25766e[_0xc282('0x9c')](this[_0xc282('0x21')][_0x43eeaa]['id']);}}}_0x548084[_0xc282('0x70')]=0x1;hopperUtils[_0xc282('0x1fe')](_0x548084,_0x25766e,_0x442e6e)[_0xc282('0x46')](function(_0x1cc250){_0x548084[_0xc282('0x70')]=0x0;if(_0x1cc250){if(!utils['checkContactEmpty'](_0x1cc250)){hopperUtils[_0xc282('0x1ff')](_0x548084)['then'](sendMessageReschedule(_0x548084))[_0xc282('0xa1')](loggerCatch(_0xc282('0x200')));}else{_0x548084[_0xc282('0x153')]+=_0x1cc250['length'];_0x548084['message']=_0x548084[_0xc282('0x1fc')]===_0xc282('0xb8')?utils[_0xc282('0x72')][_0xc282('0x13f')]:utils[_0xc282('0x72')][_0xc282('0x201')];for(var _0xb9430b=0x0;_0xb9430b<_0x1cc250[_0xc282('0x148')];_0xb9430b+=0x1){if(_[_0xc282('0xf4')](_0x1cc250[_0xb9430b])||_[_0xc282('0xf4')](_0x1cc250[_0xb9430b][_0xc282('0x173')])||_[_0xc282('0xf4')](_0x1cc250[_0xb9430b][_0xc282('0x15f')])){_0x184c76[_0xc282('0x157')](_0xc282('0x1f8'),_0x548084,_0x1cc250[_0xb9430b]);}else{hopperUtils[_0xc282('0x202')](_[_0xc282('0x102')](_0x1cc250[_0xb9430b],['VoiceQueueId',_0xc282('0x15f')]))['then'](_0x184c76[_0xc282('0x1dd')](_0x548084,_0x1cc250[_0xb9430b]))[_0xc282('0xa1')](_0x184c76[_0xc282('0x156')](_0xc282('0x1f8'),_0x548084));}}}}})['catch'](loggerGetContactDialer(_0xc282('0x203'),_0x548084,_0x442e6e));}};Dialer[_0xc282('0x8c')][_0xc282('0x6c')]=function(_0x13b230){if(_0x13b230[_0xc282('0x1fd')]>0x0){var _0x4f0fd0=_0x13b230[_0xc282('0x1fd')]-_0x13b230['originated']-_0x13b230[_0xc282('0x13d')];if(_0x4f0fd0>0x0&&_0x13b230[_0xc282('0x70')]==0x0){this[_0xc282('0x204')](_0x13b230);}else{loggerPredictiveCalls[_0xc282('0x53')](_0xc282('0x205'));}}else{this['tryOriginatePredictive'](_0x13b230);}};Dialer['prototype'][_0xc282('0x204')]=function(_0x2cf1bb){var _0x2dacb8=this;var _0x244122=[];_0x2cf1bb[_0xc282('0x153')]+=0x1;for(var _0x13aed7 in this[_0xc282('0x21')]){if(typeof this[_0xc282('0x21')][_0x13aed7]!==_0xc282('0x154')){if(this[_0xc282('0x21')][_0x13aed7][_0xc282('0x78')]===_0xc282('0x206')&&this[_0xc282('0x21')][_0x13aed7][_0xc282('0xf5')]===_0xc282('0x8f')){_0x244122[_0xc282('0x9c')](this[_0xc282('0x21')][_0x13aed7]['id']);}}}_0x2cf1bb[_0xc282('0x70')]=0x1;return this[_0xc282('0x1fe')](_0x2cf1bb['id'],_0x244122,0x1,_0x2cf1bb[_0xc282('0x207')],_0x2cf1bb)[_0xc282('0x46')](function(_0x5cd715){_0x2cf1bb[_0xc282('0x70')]=0x1;if(_0x5cd715){if(!utils[_0xc282('0x1f5')](_0x5cd715)){utils[_0xc282('0x6f')](_0x2cf1bb,0x1,0x0);return hopperUtils['countReScheduled'](_0x2cf1bb)['then'](sendMessageReschedule(_0x2cf1bb))[_0xc282('0xa1')](loggerCatch(_0xc282('0x200')));}else{_0x2cf1bb[_0xc282('0x71')]=utils['CAMPAIGN_STATUS'][_0xc282('0x201')];if(_[_0xc282('0xf4')](_0x5cd715[0x0])||_[_0xc282('0xf4')](_0x5cd715[0x0][_0xc282('0x173')])||_['isNil'](_0x5cd715[0x0][_0xc282('0x15f')])){_0x2dacb8[_0xc282('0x157')]('[actionOriginate]\x20',_0x2cf1bb,_0x5cd715[0x0]);}else{return hopperUtils[_0xc282('0x202')](_[_0xc282('0x102')](_0x5cd715[0x0],[_0xc282('0xdf'),_0xc282('0x15f')]))['then'](_0x2dacb8['checkContactBlack'](_0x2cf1bb,_0x5cd715[0x0]))[_0xc282('0xa1')](_0x2dacb8[_0xc282('0x156')](_0xc282('0x208'),_0x2cf1bb));}}}})['catch'](loggerGetContactDialer(_0xc282('0x209'),_0x2cf1bb,0x1));};Dialer['prototype'][_0xc282('0x20a')]=function(_0x3a1882,_0x15566c,_0x4a7aef,_0x3cc240,_0x35597b,_0x3d51cd){loggerPredictive[_0xc282('0x53')](_0xc282('0x20b'));loggerPredictive[_0xc282('0x53')](_0xc282('0x20c'),_0x3a1882);loggerPredictive[_0xc282('0x53')](_0xc282('0x20d'),_0x15566c);loggerPredictive['info'](_0xc282('0x20e'),_0x4a7aef);loggerPredictive[_0xc282('0x53')]('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',_0x3cc240);loggerPredictive[_0xc282('0x53')]('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x35597b);loggerPredictive[_0xc282('0x53')](_0xc282('0x5d'));return new Promise(function(_0x42e3e6,_0x5867ea){if(_0x3a1882<=0x0||isNaN(_0x3a1882)){return _0x5867ea(msgResponse(_0xc282('0x20f'),'Error',_0xc282('0x210')+_0x3a1882));}if(_0x4a7aef<=0x0||isNaN(_0x4a7aef)){return _0x5867ea(msgResponse(_0xc282('0x20f'),_0xc282('0x8b'),_0xc282('0x211')+_0x4a7aef));}if(_0x3cc240<=0x0||isNaN(_0x3cc240)){return _0x5867ea(msgResponse('[abandonmentRate]',_0xc282('0x8b'),_0xc282('0x212')+_0x3cc240));}if(_0x15566c<=0x0||isNaN(_0x15566c)){return _0x5867ea(msgResponse(_0xc282('0x20f'),'Error',_0xc282('0x213')+_0x15566c));}if(_0x35597b<=0x0||isNaN(_0x35597b)){return _0x5867ea(msgResponse(_0xc282('0x20f'),'Error',_0xc282('0x214')+_0x35597b));}_0x3d51cd=_0x3d51cd||0x0;var _0x2e3bb6=0x1/_0x4a7aef;var _0x2b86b0=0x0;var _0x5e8a8e=0x0;var _0x3b540d=0x0;var _0x2ae22b=0x0;for(var _0x5f35ef=0x0;_0x3b540d<_0x35597b;_0x5f35ef+=0x1){_0x5e8a8e=_0x5f35ef/_0x15566c;_0x2b86b0=(_0x3cc240*_0x5e8a8e+_0x3d51cd)/_0x2e3bb6;_0x3b540d=utils[_0xc282('0x215')](_0x2b86b0,_0x3a1882);_0x2ae22b=_0x2b86b0/_0x3a1882*(0x1-utils[_0xc282('0x215')](_0x2b86b0,_0x3a1882));}return _0x42e3e6({'erlangCalls':_0x5f35ef,'erlangCallToSecond':_0x15566c/_0x5f35ef,'erlangAbandonmentRate':_0x3b540d,'erlangBusyFactor':_0x2ae22b});});};Dialer[_0xc282('0x8c')]['busyFactor']=function(_0x55cea0,_0x2bcbf2,_0x17afe5,_0x2bbdb5,_0x1fc651,_0x991144){loggerPredictive[_0xc282('0x53')](_0xc282('0x216'));loggerPredictive['info'](_0xc282('0x20c'),_0x55cea0);loggerPredictive[_0xc282('0x53')](_0xc282('0x20d'),_0x2bcbf2);loggerPredictive[_0xc282('0x53')](_0xc282('0x20e'),_0x17afe5);loggerPredictive[_0xc282('0x53')](_0xc282('0x217'),_0x2bbdb5);loggerPredictive['info'](_0xc282('0x218'),_0x1fc651);loggerPredictive[_0xc282('0x53')](_0xc282('0x5d'));return new Promise(function(_0x28ad55,_0x59704a){if(_0x55cea0<=0x0||isNaN(_0x55cea0)){return _0x59704a(msgResponse(_0xc282('0x219'),_0xc282('0x8b'),_0xc282('0x210')+_0x55cea0));}if(_0x17afe5<=0x0||isNaN(_0x17afe5)){return _0x59704a(msgResponse(_0xc282('0x219'),_0xc282('0x8b'),_0xc282('0x211')+_0x17afe5));}if(_0x2bbdb5<=0x0||isNaN(_0x2bbdb5)){return _0x59704a(msgResponse(_0xc282('0x219'),_0xc282('0x8b'),_0xc282('0x212')+_0x2bbdb5));}if(_0x2bcbf2<=0x0||isNaN(_0x2bcbf2)){return _0x59704a(msgResponse('[busyFactor]',_0xc282('0x8b'),_0xc282('0x213')+_0x2bcbf2));}if(_0x1fc651<=0x0||isNaN(_0x1fc651)){return _0x59704a(msgResponse(_0xc282('0x219'),_0xc282('0x8b'),_0xc282('0x21a')+_0x1fc651));}_0x991144=_0x991144||0x0;var _0x504cb7=0x1/_0x17afe5;var _0x73fc6b=0x0;var _0x3e127c=0x0;var _0xbac00=0x0;var _0x4573a3=0x0;for(var _0x188259=0x0;_0x4573a3<_0x1fc651;_0x188259+=0x1){_0x3e127c=_0x188259/_0x2bcbf2;_0x73fc6b=(_0x2bbdb5*_0x3e127c+_0x991144)/_0x504cb7;_0xbac00=utils['erlangb'](_0x73fc6b,_0x55cea0);_0x4573a3=_0x73fc6b/_0x55cea0*(0x1-utils[_0xc282('0x215')](_0x73fc6b,_0x55cea0));}return _0x28ad55({'erlangCalls':_0x188259,'erlangCallToSecond':_0x2bcbf2/_0x188259,'erlangAbandonmentRate':_0xbac00,'erlangBusyFactor':_0x4573a3});});};module[_0xc282('0x21b')]=Dialer; \ No newline at end of file +var _0xd655=['outbound','debug','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','inspect','format','name','voice_queue:save','isEmpty','-----\x20Stats\x20Predictive\x20---','info','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsTimeout','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsCallersExit','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','predictiveIntervalAvgHoldtime','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','erlangCalls','erlangCallToSecond','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','startProgressive\x20value\x20cleared','startPredictive\x20value\x20cleared','handlePredictive','handlePredictive\x20interval\x20cleared','error','stack','checkContactLowerLimitOriginate','temp','contactsRescheduled','message','CAMPAIGN_STATUS','CONTACTS_RESCHEDULED','[getContactDialer2][ReScheduled]','NO_AVAILABLE_CONTACTS','state','statedesc','endtime','starttime','stringify','pick','queueStatusComplete','Interval','NULL_INTERVAL','\x20INTERVAL_IS_NULL','Intervals','isIVRCampaignActive','campaign:ivr:%s','sendMessageOneNotActive','originated','INACTIVE','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20not\x20active','DISACTIVED','is\x20disactive','Error','isTrunkReachable','active','SIP/%s','status','reachable','unmonitored','checkIsTrunkReachable','Trunk','TrunkBackup','TRUNK_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','ifTimeIvr','checkIfTimeIntervals','ifTime','\x20Intervals\x20is\x20null\x20','EMPTY_INTERVAL','\x20Intervals\x20is\x20empty\x20','timezones','isArray','length','push','Action','command','iftime\x20%s,%s','interval','indexOf','true','catch','content','all','OVERTIME_GLOBAL_INTERVAL','[ifTime][promiseAll]','Failure','Global:\x20','syncCampaigns','isIVRCampaign','resolve','checkIfTime','dialTimezone','launchHandleIvr','dialMethod','handlePower','power','booked','Queue','method\x20not\x20recognized','dialGlobalInterval','silly','Dialer::ifTime()','Voice\x20Queue\x20%s\x20$s','intervalIftime','OVERTIME_INTERVAL','\x20Interval\x20is\x20overtime:\x20','isGlobal','AMI\x20IfTime','[ifTime][Action]','voiceQueues','queue','uniqueid','ivr','YYYY-MM-DD\x20HH:mm:ss','type','outboundAnswerCallsDay','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','createHistory','[syncAgentComplete][createHistory]','moveContactManagedDialer','[syncAgentComplete]','updateOriginated','droptime','outboundDropCallsDayTimeout','predictiveIntervalErlangCallsDroppedCalls','dropreason','countglobal','dialDropRetryFrequency','verifyAdditionalPhones','voiceQueue','additional','queueCallerAbandonCreateState','rescheduleContact','countdropretry','minutes','ContactId','ListId','VoiceQueueId','CampaignId','[rescheduleContact][Drop]','Drop','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','swapAdditionalPhones','outboundDropCallsDayCallersExit','callAdditionalPhoneAfterMin','countabandonedretry','add','dialAbandonedRetryFrequency','Abandoned','channel','actionid','rrmemory','isNil','locked','stateinterface','idHopper','paused','strategy','roundrobin','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncOriginateResponse','getQueue','response','callProgressDetecting','[callProgressDetecting]\x20','variable','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','HangupInAMD','membername','AMD','custom:amd','buildObj','saveInDb','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','outboundAnswerAgiCallsDay','countmachineretry','amd','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','reason\x2019\x20machine....','dialMachineRetryFrequency','[rescheduleContact][Machine]','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','MACHINE','[syncAgentComplete][createHistory][0]','createStateFinal','ivrAnswerCallsDay','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','[syncHangupIvr][createHistory]','cause-txt','Normal\x20Clearing','Unknow','queuesSummary','running','statusMessage','available','inUse','talking','ACTIVE','checkDialMethod','compareToOutboundQueue','queueSummaryCountersUpdated','updateReportFromOutboundQueue','assign','[syncQueueSummary]','throttle','filter','online','handlePreviewRecallNotifications','user:%s','clearZombieChannels','[uniqueid]','[actions]','No\x20such\x20channel','[Dialer][checkChannel]','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','undefined','[updateOriginated]\x20object\x20originated\x20is\x20negative','loggerHandler','emptyContact','notFound','[emptyContact][createHistory]','[syncQueueCallerAbandon]\x20[Drop]','actionOriginate','originate','voiceQueue\x20is\x20undefine','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','dialQueueOptions','dialQueueTimeout','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','XMD-AMDMINWORDLENGTH','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','isOutboundQueue','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','Contact','getCallerId','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','callerid','getCallerIdRandom','XMD-ORIGINATECALLERIDNAME','originatecalleridname','extractCalleridName','XMD-ORIGINATECALLERIDNUM','SIP/%s/%s%s','dialPrefix','trim','substring','dialCutDigit','from-sip','dialOriginateTimeout','outboundOriginateFailureCallsDay','[originateError]:\x20%s','OriginateError','[originate][error]','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','dialCongestionMaxRetry','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAbandonedMaxRetry','object','entity\x20is\x20undefine','[callProgressDetecting]','evt\x20is\x20undefine','reason','custom:agentnosuchnumber','nosuchnumber','dialNoSuchNumberMaxRetry','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','buildNoAnswerEventPayload','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','dialCongestionRetryFrequency','congestion','[syncAgentComplete][createHistory][8]','[syncAgentComplete][createHistory][11]','reason\x2011\x20abandoned','outboundRejectCallsDay','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','dialAgentRejectMaxRetry','reason\x2020\x20agentreject','outboundUnknownCallsDay','Success','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','[startMethodPredictive][StartProgressive][Loop]','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','Max\x20Drop\x20','dialPredictiveInterval','started\x20in\x20predictive\x20at','avgHandleTime','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','predictiveIntervalHitRate','dialPredictiveOptimization','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','loggedIn','outboundQueuePauses','predictiveIntervalPauses','[CatchErlangB]','floor','one\x20call\x20every:','[handlePredictive]','checkContactBlack','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','getSeconds','scheduledat','dialRecallMeTimeout','Agent','voicePause','run','unlockContact','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','BLACKLIST','Blacklist','[Originate][historyBlacklist]','handleIvr','limitCalls','checkContactEmpty','[getContactCampaign2][Empty]','RUNNING','[actionOriginate]\x20','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','pTalking','not_inuse','getContactDialer','[countReScheduled]\x20','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','dialOrderByScheduledAt','checkIsBlackList','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','erlangb','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','Umin\x20=\x20','util','lodash','uuid','ioredis','./utils','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','predictive','syncQueueSummary','../ami','redis','socket.io-emitter','../rpc/cmHopper','../rpc/voiceQueueRt','../rpc/setting','./models/action','./models/history','./models/final','./models/agentComplete','./models/queueCallerAbandon','env','XCALLY_IP_AGI','127.0.0.1','prototype','enqueue','tail','finally','sequence','preview','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','syncAgentConnect','bind','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','custom:queuesummarycomplete','syncQueueSummaryComplete','hangup','syncHangup','newexten','syncNewExten','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','getSettings','then','isUndefined','emit'];(function(_0x543242,_0xeac9fd){var _0x4c99b6=function(_0x47d087){while(--_0x47d087){_0x543242['push'](_0x543242['shift']());}};_0x4c99b6(++_0xeac9fd);}(_0xd655,0x1ca));var _0x5d65=function(_0x257495,_0x18269b){_0x257495=_0x257495-0x0;var _0x3849aa=_0xd655[_0x257495];return _0x3849aa;};'use strict';var util=require(_0x5d65('0x0'));var _=require(_0x5d65('0x1'));var uuid=require(_0x5d65('0x2'));var moment=require('moment');var rr=require('rr');var Redis=require(_0x5d65('0x3'));var utils=require(_0x5d65('0x4'));var hopperUtils=require('./utils/hopper');var ut=require(_0x5d65('0x5'));var config=require(_0x5d65('0x6'));var logger=require(_0x5d65('0x7'))(_0x5d65('0x8'));var loggerBooked=require(_0x5d65('0x7'))('booked');var loggerPredictive=require(_0x5d65('0x7'))(_0x5d65('0x9'));var loggerPredictiveCalls=require(_0x5d65('0x7'))('predictiveCalls');var loggerSyncQueueSummary=require(_0x5d65('0x7'))(_0x5d65('0xa'));var ami=require(_0x5d65('0xb'));config[_0x5d65('0xc')]=_['defaults'](config[_0x5d65('0xc')],{'host':'localhost','port':0x18eb});var io=require(_0x5d65('0xd'))(new Redis(config[_0x5d65('0xc')]));var cmHopper=require(_0x5d65('0xe'));var voiceQueueRt=require(_0x5d65('0xf'));var RpcSetting=require(_0x5d65('0x10'));var Interval=require('../rpc/interval');var Action=require(_0x5d65('0x11'));var History=require(_0x5d65('0x12'));var Final=require(_0x5d65('0x13'));var AgentComplete=require(_0x5d65('0x14'));var QueueCallerAbandon=require(_0x5d65('0x15'));var Hangup=require('./models/hangup');var ipAgi=process[_0x5d65('0x16')][_0x5d65('0x17')]||_0x5d65('0x18');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x5d65('0x19')][_0x5d65('0x1a')]=function(_0x54b8ef){this[_0x5d65('0x1b')]=this[_0x5d65('0x1b')]?this[_0x5d65('0x1b')][_0x5d65('0x1c')](_0x54b8ef):_0x54b8ef();};function Dialer(_0x21e225,_0x509743){this[_0x5d65('0x1d')]=new Sequence();this[_0x5d65('0x1e')]=_0x509743;this['voiceQueues']=_0x21e225['voiceQueues'];this[_0x5d65('0x1f')]=_0x21e225[_0x5d65('0x1f')];this[_0x5d65('0x20')]=_0x21e225[_0x5d65('0x20')];this[_0x5d65('0x21')]=_0x21e225[_0x5d65('0x21')];this[_0x5d65('0x22')]=config['maxNumberOriginate']||0x2;this[_0x5d65('0x23')]={};this[_0x5d65('0x24')]={};this[_0x5d65('0x25')]={};this[_0x5d65('0x26')]={};this[_0x5d65('0x27')]={};this[_0x5d65('0x28')]={};this[_0x5d65('0x29')]={};this[_0x5d65('0x2a')]={};this[_0x5d65('0x2b')]={};this[_0x5d65('0x2c')]={};this['queuesSummary']={};ami['on'](_0x5d65('0x2d'),this[_0x5d65('0x2e')][_0x5d65('0x2f')](this));ami['on']('queuecallerabandon',this[_0x5d65('0x30')][_0x5d65('0x2f')](this));ami['on']('originateresponse',this['syncOriginateResponse'][_0x5d65('0x2f')](this));ami['on'](_0x5d65('0x31'),this[_0x5d65('0x32')]['bind'](this));ami['on']('custom:queuesummary',this[_0x5d65('0xa')]['bind'](this));ami['on'](_0x5d65('0x33'),this[_0x5d65('0x34')][_0x5d65('0x2f')](this));ami['on'](_0x5d65('0x35'),this[_0x5d65('0x36')]['bind'](this));ami['on'](_0x5d65('0x37'),this[_0x5d65('0x38')]['bind'](this));ami['on'](_0x5d65('0x39'),this[_0x5d65('0x3a')]['bind'](this));ami['on'](_0x5d65('0x3b'),this[_0x5d65('0x3c')]['bind'](this));ami['on'](_0x5d65('0x3d'),this[_0x5d65('0x3e')]['bind'](this));this[_0x5d65('0x3f')]();this[_0x5d65('0x40')]();RpcSetting[_0x5d65('0x41')]()[_0x5d65('0x42')](function(_0x4e6a16){previewRecallmeReminderInterval=_0x4e6a16['previewRecallmeReminderInterval'];});}function isNotNull(_0x365d72){return _0x365d72!==null&&!_[_0x5d65('0x43')](_0x365d72);}function msgResponse(_0x31f6a5,_0x207363,_0x2b67fa){return{'action':_0x31f6a5,'response':_0x207363,'message':_0x2b67fa,'stack':_0x2b67fa};}function emit(_0x41cebd,_0x1f0575,_0x1eb2ec){io['to'](_0x41cebd)[_0x5d65('0x44')](_0x1f0575,_0x1eb2ec);}function emitOutboundVoiceQueueSummary(_0x4cfc84){if(_0x4cfc84['type']===_0x5d65('0x45')){logger[_0x5d65('0x46')](_0x5d65('0x47'),util[_0x5d65('0x48')](_0x4cfc84,{'showHidden':![],'depth':null}));emit(util[_0x5d65('0x49')]('voice:queue:%s',_0x4cfc84[_0x5d65('0x4a')]),_0x5d65('0x4b'),_0x4cfc84);}}function checkGetDataPredictive(_0x403d76){if(isNotNull(_0x403d76)&&!_[_0x5d65('0x4c')](_0x403d76)){loggerPredictive['info'](_0x5d65('0x4d'));loggerPredictive[_0x5d65('0x4e')](_0x5d65('0x4f'),_0x403d76[_0x5d65('0x50')]);loggerPredictive['info']('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x403d76[_0x5d65('0x51')]);loggerPredictive[_0x5d65('0x4e')](_0x5d65('0x52'),_0x403d76[_0x5d65('0x53')]);loggerPredictive['info'](_0x5d65('0x54'),_0x403d76[_0x5d65('0x55')]);loggerPredictive[_0x5d65('0x4e')](_0x5d65('0x56'),_0x403d76['predictiveIntervalAvgHoldtime']);loggerPredictive[_0x5d65('0x4e')]('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x403d76[_0x5d65('0x57')]);loggerPredictive[_0x5d65('0x4e')](_0x5d65('0x58'));if(_0x403d76[_0x5d65('0x50')]>0x0){if(!_['isUndefined'](_0x403d76[_0x5d65('0x57')])&&_0x403d76[_0x5d65('0x57')]>0x0){return!![];}loggerPredictive['info'](_0x5d65('0x59'));if(!_[_0x5d65('0x43')](_0x403d76['predictiveIntervalAvgHoldtime'])&&_0x403d76[_0x5d65('0x5a')]>0x0){return!![];}loggerPredictive[_0x5d65('0x4e')](_0x5d65('0x5b'));}else{loggerPredictive['info'](_0x5d65('0x5c'));}}else{loggerPredictive[_0x5d65('0x4e')]('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x25b93b){return function(_0x44a3d2){loggerPredictive[_0x5d65('0x4e')]('---------\x20ErlangB\x20---------');loggerPredictive[_0x5d65('0x4e')]('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x44a3d2[_0x5d65('0x5d')]);loggerPredictive[_0x5d65('0x4e')]('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x44a3d2[_0x5d65('0x5e')]);loggerPredictive[_0x5d65('0x4e')](_0x5d65('0x5f'),_0x44a3d2[_0x5d65('0x60')]);loggerPredictive[_0x5d65('0x4e')](_0x5d65('0x61'),_0x44a3d2['erlangBusyFactor']);loggerPredictive[_0x5d65('0x4e')](_0x5d65('0x5f'),_0x44a3d2['erlangAbandonmentRate']);loggerPredictive[_0x5d65('0x4e')](_0x5d65('0x58'));_[_0x5d65('0x62')](_0x25b93b,_0x44a3d2);};}function ifInterval(_0x5416bf,_0x2c3cae){if(_[_0x5d65('0x43')](_0x2c3cae)){return![];}return utils['getSeconds'](undefined,_0x2c3cae)<_0x5416bf*0x3c;}function clearPredictiveAttributes(_0x32a2b1){if(_0x32a2b1[_0x5d65('0x29')]){_0x32a2b1[_0x5d65('0x29')]=undefined;loggerPredictive[_0x5d65('0x46')](_0x32a2b1[_0x5d65('0x4a')],_0x5d65('0x63'));}if(_0x32a2b1[_0x5d65('0x28')]){_0x32a2b1[_0x5d65('0x28')]=undefined;loggerPredictive[_0x5d65('0x46')](_0x32a2b1[_0x5d65('0x4a')],_0x5d65('0x64'));}if(_0x32a2b1[_0x5d65('0x65')]){clearInterval(_0x32a2b1['handlePredictive']);_0x32a2b1[_0x5d65('0x65')]=undefined;loggerPredictive['debug'](_0x32a2b1['name'],_0x5d65('0x66'));}}function loggerCatchPredictive(_0x1f514a,_0x3f27dc){return function(_0x2be936){loggerPredictive[_0x5d65('0x67')](_0x3f27dc[_0x5d65('0x4a')],_0x1f514a);loggerPredictive[_0x5d65('0x67')](_0x2be936[_0x5d65('0x68')]);clearPredictiveAttributes(_0x3f27dc);};}function loggerCatch(_0x3d6988){return function(_0x4efe6a){logger[_0x5d65('0x67')](_0x3d6988,util['inspect'](_0x4efe6a,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x538f9b,_0x4f15cd,_0x4d0ea9){return function(_0x180a54){utils[_0x5d65('0x69')](_0x4f15cd,_0x4d0ea9,0x0);_0x4f15cd[_0x5d65('0x6a')]=0x0;logger[_0x5d65('0x67')](_0x538f9b,util[_0x5d65('0x48')](_0x180a54,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x235160){return function(_0x199b5a){if(isNotNull(_0x199b5a)&&isNotNull(_0x199b5a[0x0])){if(_0x199b5a[0x0][_0x5d65('0x6b')]>0x0){_0x235160[_0x5d65('0x6c')]=utils[_0x5d65('0x6d')][_0x5d65('0x6e')];logger[_0x5d65('0x4e')](_0x5d65('0x6f')+_0x235160['name'],_0x199b5a[0x0][_0x5d65('0x6b')],'contacts');}else{_0x235160[_0x5d65('0x6c')]=utils[_0x5d65('0x6d')][_0x5d65('0x70')];logger[_0x5d65('0x4e')]('[getContactDialer2][Empty]'+_0x235160[_0x5d65('0x4a')]);}}};}function createObjHistory(_0x23eb6a,_0x54015a,_0x4e1695,_0x770aed,_0x510312){_0x23eb6a['message']=_0x4e1695;var _0x25da15=new Action(_0x23eb6a,_0x54015a);var _0x4d18cb=new History(_0x25da15);_0x4d18cb[_0x5d65('0x71')]=_0x770aed;_0x4d18cb[_0x5d65('0x72')]=_0x510312;_0x4d18cb[_0x5d65('0x73')]=_0x25da15[_0x5d65('0x74')];return _0x4d18cb;}function unlockQueueStatus(_0x1fd9b4,_0xf582f4){setTimeout(function(){if(_[_0x5d65('0x43')](_0x1fd9b4['queueStatusComplete'])){loggerBooked[_0x5d65('0x67')]('[unlockQueueStatus][undefined]',_0xf582f4);}_0x1fd9b4['queueStatusComplete']=!![];loggerBooked[_0x5d65('0x4e')]('[booked][unlockQueueStatus]',_0xf582f4,JSON[_0x5d65('0x75')](_[_0x5d65('0x76')](_0x1fd9b4,[_0x5d65('0x4a'),_0x5d65('0x77')])));},0x1f3);}function checkInterval(_0xc5621e){return function(){if(!isNotNull(_0xc5621e[_0x5d65('0x78')])){_0xc5621e['message']=utils[_0x5d65('0x6d')][_0x5d65('0x79')];throw _0xc5621e[_0x5d65('0x4a')]+_0x5d65('0x7a');}if(!isNotNull(_0xc5621e['Interval']['Intervals'])){_0xc5621e[_0x5d65('0x6c')]=utils[_0x5d65('0x6d')][_0x5d65('0x79')];throw _0xc5621e[_0x5d65('0x4a')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_[_0x5d65('0x4c')](_0xc5621e['Interval'][_0x5d65('0x7b')]))){_0xc5621e[_0x5d65('0x6c')]=utils[_0x5d65('0x6d')]['NULL_INTERVAL'];throw _0xc5621e['name']+_0x5d65('0x7a');}};}function checkIsIVRCampaignActive(_0x106f31){return function(){if(!utils[_0x5d65('0x7c')](_0x106f31)){_0x106f31[_0x5d65('0x6c')]=utils[_0x5d65('0x6d')]['INACTIVE'];throw _0x106f31[_0x5d65('0x4a')]+'\x20NOT\x20Active';}};}function emitCampaignSummary(_0x42ef11){if(utils['isIVRCampaign'](_0x42ef11)){emit(util[_0x5d65('0x49')](_0x5d65('0x7d'),_0x42ef11[_0x5d65('0x4a')]),'campaign:save',_0x42ef11);}}function loggerCatchQueueSummary(_0x51f985,_0x2c1a82){return function(_0x4ab95a){clearPredictiveAttributes(_0x2c1a82);emitCampaignSummary(_0x2c1a82);loggerSyncQueueSummary[_0x5d65('0x46')](_0x51f985,util[_0x5d65('0x48')](_0x4ab95a,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x441dfa){if(_0x441dfa[_0x5d65('0x7e')]){if(_0x441dfa[_0x5d65('0x7f')]===0x0){_0x441dfa['sendMessageOneNotActive']=![];_0x441dfa[_0x5d65('0x6c')]=utils[_0x5d65('0x6d')][_0x5d65('0x80')];loggerSyncQueueSummary[_0x5d65('0x46')](_0x5d65('0x81'),_0x441dfa[_0x5d65('0x4a')],_0x5d65('0x82'));}else{_0x441dfa[_0x5d65('0x6c')]=utils[_0x5d65('0x6d')][_0x5d65('0x83')];loggerSyncQueueSummary[_0x5d65('0x46')](_0x5d65('0x81'),_0x441dfa[_0x5d65('0x4a')],_0x5d65('0x84'));}emitCampaignSummary(_0x441dfa);}}function myreject(_0x2d6361){return function(_0x562fc2){return _0x2d6361(msgResponse('[ifTime][Action]',_0x5d65('0x85'),JSON[_0x5d65('0x75')](_0x562fc2)));};}Dialer['prototype'][_0x5d65('0x86')]=function(_0x2e0aab){return!_[_0x5d65('0x43')](_0x2e0aab)&&_0x2e0aab&&!_[_0x5d65('0x43')](_0x2e0aab[_0x5d65('0x4a')])&&!_[_0x5d65('0x43')](_0x2e0aab['active'])&&_0x2e0aab[_0x5d65('0x87')]&&(this['trunks'][util['format'](_0x5d65('0x88'),_0x2e0aab[_0x5d65('0x4a')])][_0x5d65('0x89')]===_0x5d65('0x8a')||this[_0x5d65('0x21')][util[_0x5d65('0x49')](_0x5d65('0x88'),_0x2e0aab[_0x5d65('0x4a')])][_0x5d65('0x89')]===_0x5d65('0x8b'));};Dialer['prototype'][_0x5d65('0x8c')]=function(_0x2258ce){var _0xdff586=this;return function(){if(!_0xdff586[_0x5d65('0x86')](_0x2258ce[_0x5d65('0x8d')])){if(!_0xdff586['isTrunkReachable'](_0x2258ce[_0x5d65('0x8e')])){_0x2258ce[_0x5d65('0x6c')]=utils[_0x5d65('0x6d')][_0x5d65('0x8f')];throw _0x2258ce[_0x5d65('0x4a')]+_0x5d65('0x90');}}};};Dialer[_0x5d65('0x19')]['checkIfTime']=function(_0xb1b5d9,_0x935893,_0xe0cabc,_0x2b8ae3){var _0x30c45c=this;return function(){var _0xd8f8e3=!![];return _0x30c45c[_0x5d65('0x91')](_0xb1b5d9,_0x935893,_0xe0cabc,_0x2b8ae3,_0xd8f8e3);};};Dialer['prototype'][_0x5d65('0x92')]=function(_0x32ccd9,_0x3a4d7e,_0x4b7295,_0x28137a){var _0x5e85f4=this;return function(){var _0x1a9724=![];return _0x5e85f4[_0x5d65('0x91')](_0x32ccd9[_0x5d65('0x7b')],_0x3a4d7e,_0x4b7295,_0x28137a,_0x1a9724);};};Dialer[_0x5d65('0x19')][_0x5d65('0x91')]=function(_0x2064c4,_0x30a2ce,_0x1a689a,_0x1ed2d0,_0x248d55){var _0x7e657e=[];return new Promise(function(_0x2a5f57,_0x561e66){if(!isNotNull(_0x2064c4)){_0x1ed2d0[_0x5d65('0x6c')]=utils['CAMPAIGN_STATUS']['NULL_INTERVAL'];return _0x561e66(msgResponse(_0x5d65('0x93'),'Failure',_0x1a689a+_0x5d65('0x94')));}if(_[_0x5d65('0x4c')](_0x2064c4)){_0x1ed2d0['message']=utils[_0x5d65('0x6d')][_0x5d65('0x95')];return _0x561e66(msgResponse('ifTime','Failure',_0x1a689a+_0x5d65('0x96')));}if(_0x30a2ce&&_['isUndefined'](config[_0x5d65('0x97')][_0x30a2ce])){_0x1ed2d0['message']=utils[_0x5d65('0x6d')]['UNKNOWN_TIMEZONE'];return _0x561e66(msgResponse('ifTime','Failure',_0x1a689a+'\x20Timezone\x20unknow\x20'+_0x30a2ce));}if(_[_0x5d65('0x98')](_0x2064c4)){for(var _0x1f9926=0x0;_0x1f9926<_0x2064c4[_0x5d65('0x99')];_0x1f9926+=0x1){_0x7e657e[_0x5d65('0x9a')](ami[_0x5d65('0x9b')]({'action':_0x5d65('0x9c'),'command':util[_0x5d65('0x49')](_0x5d65('0x9d'),_0x2064c4[_0x1f9926][_0x5d65('0x9e')],!_[_0x5d65('0x43')](config[_0x5d65('0x97')][_0x30a2ce])?_0x30a2ce:'')})['then'](function(_0x4770fb){return _0x4770fb['content'][_0x5d65('0x9f')](_0x5d65('0xa0'))>=0x0;})[_0x5d65('0xa1')](myreject(_0x561e66)));}}else{_0x7e657e[_0x5d65('0x9a')](ami[_0x5d65('0x9b')]({'action':_0x5d65('0x9c'),'command':util[_0x5d65('0x49')](_0x5d65('0x9d'),_0x2064c4,!_[_0x5d65('0x43')](config[_0x5d65('0x97')][_0x30a2ce])?_0x30a2ce:'')})[_0x5d65('0x42')](function(_0x5e5fd2){return _0x5e5fd2[_0x5d65('0xa2')][_0x5d65('0x9f')](_0x5d65('0xa0'))>=0x0;})[_0x5d65('0xa1')](myreject(_0x561e66)));}Promise[_0x5d65('0xa3')](_0x7e657e)[_0x5d65('0x42')](function(_0x6418df){var _0x2f9675=_['some'](_0x6418df);if(_0x2f9675){return _0x2a5f57(_0x2f9675);}else{_0x1ed2d0[_0x5d65('0x6c')]=_0x248d55?utils[_0x5d65('0x6d')][_0x5d65('0xa4')]:utils[_0x5d65('0x6d')]['OVERTIME_INTERVAL'];return _0x561e66(msgResponse(_0x5d65('0xa5'),_0x5d65('0xa6'),_0x5d65('0xa7')+_0x248d55+'\x20'+_0x1a689a+'\x20Interval\x20is\x20overtime:\x20'+util[_0x5d65('0x48')](_0x2064c4,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x30a2ce));}})[_0x5d65('0xa1')](function(_0x19b649){return _0x561e66(msgResponse(_0x5d65('0x93'),_0x5d65('0xa6'),JSON[_0x5d65('0x75')](_0x19b649)));});});};Dialer[_0x5d65('0x19')][_0x5d65('0x3f')]=function(){var _0x132dad=this;return cmHopper['resetActiveCalls']({'active':![]},{'where':{'active':!![]}})[_0x5d65('0x42')](function(){setInterval(function(){_0x132dad[_0x5d65('0xa8')]();},0x3e8);});};Dialer[_0x5d65('0x19')][_0x5d65('0xa8')]=function(){var _0x4809dd=this;var _0xdc7453;for(var _0x31807e in this[_0x5d65('0x1f')]){if(typeof this[_0x5d65('0x1f')][_0x31807e]!=='undefined'){_0xdc7453=this[_0x5d65('0x1f')][_0x31807e];if(utils[_0x5d65('0xa9')](_0xdc7453)&&utils['isIVRCampaignActive'](_0xdc7453)){_0xdc7453[_0x5d65('0x7e')]=!![];Promise[_0x5d65('0xaa')]()[_0x5d65('0x42')](checkIsIVRCampaignActive(_0xdc7453))[_0x5d65('0x42')](checkInterval(_0xdc7453))[_0x5d65('0x42')](_0x4809dd[_0x5d65('0x8c')](_0xdc7453))[_0x5d65('0x42')](_0x4809dd[_0x5d65('0xab')](_0xdc7453['dialGlobalInterval'],_0xdc7453[_0x5d65('0xac')],_0xdc7453['name'],_0xdc7453))[_0x5d65('0x42')](_0x4809dd[_0x5d65('0x92')](_0xdc7453[_0x5d65('0x78')],_0xdc7453[_0x5d65('0xac')],_0xdc7453['name'],_0xdc7453))[_0x5d65('0x42')](_0x4809dd[_0x5d65('0xad')](_0xdc7453))[_0x5d65('0xa1')](loggerCatchQueueSummary('[syncCampaigns]',_0xdc7453));}else{notSendMessagesCampaign(_0xdc7453);}}}};Dialer['prototype']['checkDialMethod']=function(_0x16bb18){if(_0x16bb18['dialMethod']!==_0x5d65('0x9')){clearPredictiveAttributes(_0x16bb18);}switch(_0x16bb18[_0x5d65('0xae')]){case'progressive':this[_0x5d65('0xaf')](_0x16bb18,0x1);break;case _0x5d65('0xb0'):this[_0x5d65('0xaf')](_0x16bb18,_0x16bb18['dialPowerLevel']);break;case _0x5d65('0x9'):this[_0x5d65('0x9')](_0x16bb18);break;case _0x5d65('0xb1'):this['handlePower'](_0x16bb18,0x1);break;default:logger[_0x5d65('0x67')](_0x5d65('0xb2'),_0x16bb18['name'],_0x5d65('0xb3'));}};Dialer[_0x5d65('0x19')][_0x5d65('0x93')]=function(_0x4b5ea4,_0x183c95){var _0x5979f5=_0x4b5ea4[_0x5d65('0xac')];var _0x1236b=_0x183c95?_0x4b5ea4[_0x5d65('0xb4')]:_0x4b5ea4['Interval'][_0x5d65('0x7b')];logger[_0x5d65('0xb5')](_0x5d65('0xb6'),_0x1236b,_0x5979f5,_0x4b5ea4['name'],util[_0x5d65('0x49')](_0x5d65('0xb7'),_0x4b5ea4['name'],_0x4b5ea4['id']));var _0x4810c9=null;return Interval[_0x5d65('0xb8')](_0x1236b,_0x5979f5)['then'](function(_0x59d9c9){if(_0x59d9c9===!![]){return _0x59d9c9;}else{_0x4b5ea4[_0x5d65('0x6c')]=_0x183c95?utils[_0x5d65('0x6d')][_0x5d65('0xa4')]:utils['CAMPAIGN_STATUS'][_0x5d65('0xb9')];_0x4810c9=msgResponse('[ifTime][promiseAll]',_0x5d65('0xa6'),_0x5d65('0xa7')+_0x183c95+'\x20'+_0x4b5ea4[_0x5d65('0x4a')]+_0x5d65('0xba')+util[_0x5d65('0x48')](_0x1236b,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x5979f5);}if(_0x4810c9!==null){logger[_0x5d65('0xb5')]('Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:',_0x4810c9);_0x4810c9[_0x5d65('0xbb')]=_0x183c95;throw _0x4810c9;}})['catch'](function(_0x4f64f5){logger[_0x5d65('0x67')](_0x5d65('0xbc'),_0x4f64f5);throw msgResponse(_0x5d65('0xbd'),_0x5d65('0x85'),util[_0x5d65('0x48')](_0x4f64f5,{'showHidden':![],'depth':null}));});};Dialer[_0x5d65('0x19')][_0x5d65('0x2e')]=function(_0x3f4470){if(this[_0x5d65('0xbe')][_0x3f4470[_0x5d65('0xbf')]]){if(this[_0x5d65('0x26')][_0x3f4470[_0x5d65('0xc0')]]&&this['uniqueId'][_0x3f4470[_0x5d65('0xc0')]]['type']!==_0x5d65('0xc1')){this['updateOriginated'](this[_0x5d65('0xbe')][_0x3f4470[_0x5d65('0xbf')]]);this[_0x5d65('0x26')][_0x3f4470[_0x5d65('0xc0')]]['answertime']=moment()[_0x5d65('0x49')](_0x5d65('0xc2'));}}};Dialer[_0x5d65('0x19')][_0x5d65('0x32')]=function(_0x31731f){var _0x7277=this[_0x5d65('0x26')][_0x31731f[_0x5d65('0xc0')]];if(this[_0x5d65('0xbe')][_0x31731f['queue']]){if(_0x7277&&_0x7277[_0x5d65('0xc3')]!=='ivr'){delete this['uniqueId'][_0x31731f['uniqueid']];this[_0x5d65('0xbe')][_0x31731f['queue']][_0x5d65('0xc4')]+=0x1;var _0x2656b2=new AgentComplete(_0x7277,_0x31731f);if(_0x31731f['reason']===_0x5d65('0xc5')){_0x2656b2[_0x5d65('0xc6')]=this['voiceQueues'][_0x31731f['queue']][_0x5d65('0xc7')]&&this['voiceQueues'][_0x31731f[_0x5d65('0xbf')]][_0x5d65('0xc8')]?moment()[_0x5d65('0x49')](_0x5d65('0xc2')):undefined;}hopperUtils[_0x5d65('0xc9')](_0x2656b2)[_0x5d65('0xa1')](loggerCatch(_0x5d65('0xca')));hopperUtils[_0x5d65('0xcb')](_0x2656b2)[_0x5d65('0xa1')](loggerCatch(_0x5d65('0xcc')));}}};Dialer[_0x5d65('0x19')][_0x5d65('0x30')]=function(_0x27ec40){var _0x44b613=this[_0x5d65('0x26')][_0x27ec40['uniqueid']];var _0x4845a7=this;var _0x40a955=![];var _0x5988cd;var _0x590bad;if(this[_0x5d65('0xbe')][_0x27ec40['queue']]){if(_0x44b613&&_0x44b613['type']!==_0x5d65('0xc1')){delete this[_0x5d65('0x26')][_0x27ec40['uniqueid']];this[_0x5d65('0xcd')](this[_0x5d65('0xbe')][_0x27ec40[_0x5d65('0xbf')]]);_0x44b613['droptime']=moment()['format'](_0x5d65('0xc2'));var _0x8dce99=new QueueCallerAbandon(_0x44b613,_0x27ec40);if(utils['getSeconds'](_0x44b613[_0x5d65('0xce')],_0x44b613['responsetime'])>=_0x44b613['dialQueueTimeout']){this[_0x5d65('0xbe')][_0x27ec40[_0x5d65('0xbf')]][_0x5d65('0x53')]+=0x1;this[_0x5d65('0xbe')][_0x27ec40[_0x5d65('0xbf')]][_0x5d65('0xcf')]+=0x1;this[_0x5d65('0xbe')][_0x27ec40[_0x5d65('0xbf')]][_0x5d65('0xd0')]+=0x1;_0x8dce99[_0x5d65('0x71')]=0xa;_0x8dce99[_0x5d65('0x72')]='Drop';_0x8dce99[_0x5d65('0xd1')]='TIMEOUT';_0x8dce99[_0x5d65('0xc6')]=this['voiceQueues'][_0x27ec40[_0x5d65('0xbf')]][_0x5d65('0xc7')]?moment()[_0x5d65('0x49')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;_0x8dce99['countdropretry']+=0x1;_0x8dce99[_0x5d65('0xd2')]+=0x1;_0x5988cd=this[_0x5d65('0xbe')][_0x27ec40[_0x5d65('0xbf')]][_0x5d65('0xd3')];_0x590bad=this[_0x5d65('0xbe')][_0x27ec40[_0x5d65('0xbf')]]['callAdditionalPhoneAfterMin'];hopperUtils[_0x5d65('0xd4')](_0x8dce99,_0x8dce99[_0x5d65('0x71')],_0x44b613[_0x5d65('0xd5')])[_0x5d65('0x42')](function(_0x27c42c){_0x40a955=_0x27c42c[_0x5d65('0xd6')]==0x1;if(_0x8dce99['countdropretry']>=_0x4845a7[_0x5d65('0xbe')][_0x27ec40[_0x5d65('0xbf')]]['dialDropMaxRetry']){_0x4845a7[_0x5d65('0xd7')](_0x8dce99,_0x27c42c['additional']);}else{hopperUtils[_0x5d65('0xd8')]({'active':![],'countdropretry':_0x8dce99[_0x5d65('0xd9')],'scheduledat':moment()['add'](_0x4845a7['voiceQueues'][_0x27ec40[_0x5d65('0xbf')]][_0x5d65('0xd3')],_0x5d65('0xda'))[_0x5d65('0x49')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x44b613[_0x5d65('0xdb')],'ListId':_0x44b613[_0x5d65('0xdc')],'VoiceQueueId':_0x44b613[_0x5d65('0xdd')]||undefined,'CampaignId':_0x44b613[_0x5d65('0xde')]||undefined})['catch'](loggerCatch(_0x5d65('0xdf')));var _0x192ba2=new History(_0x8dce99);_0x192ba2['state']=0xa;_0x192ba2['statedesc']=_0x5d65('0xe0');_0x192ba2['starttime']=moment()[_0x5d65('0x49')](_0x5d65('0xc2'));_0x192ba2['endtime']=_0x192ba2[_0x5d65('0x74')];_0x192ba2[_0x5d65('0xe1')]=_0x8dce99[_0x5d65('0xe1')];_0x192ba2[_0x5d65('0xe2')]=_0x8dce99[_0x5d65('0xe2')];hopperUtils[_0x5d65('0xc9')](_0x192ba2)[_0x5d65('0xa1')](loggerCatch(_0x5d65('0xe3')));}})[_0x5d65('0x42')](function(){if(_0x40a955)hopperUtils[_0x5d65('0xe4')](_0x8dce99,_0x5988cd,_0x590bad)[_0x5d65('0x42')](function(){return 0x1;});});}else{this[_0x5d65('0xbe')][_0x27ec40[_0x5d65('0xbf')]]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this[_0x5d65('0xbe')][_0x27ec40[_0x5d65('0xbf')]][_0x5d65('0xe5')]+=0x1;_0x8dce99[_0x5d65('0x71')]=0xb;_0x8dce99[_0x5d65('0x72')]='Abandoned';_0x8dce99[_0x5d65('0xd1')]='CALLEREXIT';_0x8dce99['countabandonedretry']+=0x1;_0x8dce99[_0x5d65('0xd2')]+=0x1;_0x5988cd=this[_0x5d65('0xbe')][_0x27ec40[_0x5d65('0xbf')]]['dialAbandonedRetryFrequency'];_0x590bad=this[_0x5d65('0xbe')][_0x27ec40[_0x5d65('0xbf')]][_0x5d65('0xe6')];hopperUtils[_0x5d65('0xd4')](_0x8dce99,_0x8dce99[_0x5d65('0x71')],_0x44b613[_0x5d65('0xd5')])[_0x5d65('0x42')](function(_0x5a71b8){if(_0x8dce99['countabandonedretry']>=_0x4845a7[_0x5d65('0xbe')][_0x27ec40[_0x5d65('0xbf')]]['dialAbandonedMaxRetry']){_0x4845a7[_0x5d65('0xd7')](_0x8dce99,_0x5a71b8[_0x5d65('0xd6')]);}else{hopperUtils['rescheduleContact']({'active':![],'countabandonedretry':_0x8dce99[_0x5d65('0xe7')],'scheduledat':moment()[_0x5d65('0xe8')](_0x4845a7[_0x5d65('0xbe')][_0x27ec40[_0x5d65('0xbf')]][_0x5d65('0xe9')],_0x5d65('0xda'))[_0x5d65('0x49')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x44b613[_0x5d65('0xdb')],'ListId':_0x44b613[_0x5d65('0xdc')],'VoiceQueueId':_0x44b613[_0x5d65('0xdd')]||undefined,'CampaignId':_0x44b613['CampaignId']||undefined})[_0x5d65('0xa1')](loggerCatch('[rescheduleContact][Abandoned]'));var _0x29f35b=new History(_0x8dce99);_0x29f35b[_0x5d65('0x71')]=0xb;_0x29f35b[_0x5d65('0x72')]=_0x5d65('0xea');_0x29f35b[_0x5d65('0x74')]=moment()['format'](_0x5d65('0xc2'));_0x29f35b[_0x5d65('0x73')]=_0x29f35b[_0x5d65('0x74')];_0x29f35b[_0x5d65('0xe1')]=_0x8dce99[_0x5d65('0xe1')];_0x29f35b['calleridnum']=_0x8dce99[_0x5d65('0xe2')];hopperUtils[_0x5d65('0xc9')](_0x29f35b)['catch'](loggerCatch('[syncAgentComplete][createHistory][11]'));}})['then'](function(){if(_0x40a955)hopperUtils[_0x5d65('0xe4')](_0x8dce99,_0x5988cd,_0x590bad)[_0x5d65('0x42')](function(){return 0x1;});});}}}};Dialer[_0x5d65('0x19')][_0x5d65('0x38')]=function(_0xd2a08b){if(this['actions'][_0xd2a08b[_0x5d65('0xc0')]]){this['actions'][_0xd2a08b[_0x5d65('0xc0')]]['channel']=_0xd2a08b[_0x5d65('0xeb')];}if(this[_0x5d65('0x26')][_0xd2a08b[_0x5d65('0xc0')]]){this[_0x5d65('0x26')][_0xd2a08b['uniqueid']][_0x5d65('0xeb')]=_0xd2a08b[_0x5d65('0xeb')];}};Dialer[_0x5d65('0x19')][_0x5d65('0x3c')]=function(_0x165fe0){if(!this[_0x5d65('0x24')][_0x165fe0[_0x5d65('0xec')]]){return;}var _0x5e9220=this[_0x5d65('0xbe')][this[_0x5d65('0x24')][_0x165fe0[_0x5d65('0xec')]][_0x5d65('0xbf')]]['strategy']||_0x5d65('0xed');if(_0x5e9220==='roundrobin'){if(this[_0x5d65('0x24')][_0x165fe0[_0x5d65('0xec')]]&&_[_0x5d65('0xee')](this[_0x5d65('0x24')][_0x165fe0[_0x5d65('0xec')]][_0x5d65('0xef')])&&_0x165fe0[_0x5d65('0x89')]==='1'&&_0x165fe0['paused']==='0'){if(this['agents'][_0x165fe0[_0x5d65('0xf0')]]){if(!this['agents'][_0x165fe0['stateinterface']][_0x5d65('0xef')]){this['agents'][_0x165fe0[_0x5d65('0xf0')]][_0x5d65('0xef')]=!![];this[_0x5d65('0x24')][_0x165fe0['actionid']][_0x5d65('0xef')]=!![];this[_0x5d65('0x24')][_0x165fe0['actionid']][_0x5d65('0xf0')]=_0x165fe0[_0x5d65('0xf0')];}}}}else if(_0x5e9220===_0x5d65('0xed')){if(this[_0x5d65('0x24')][_0x165fe0[_0x5d65('0xec')]]){if(this['agents'][_0x165fe0[_0x5d65('0xf0')]]){this[_0x5d65('0x24')][_0x165fe0[_0x5d65('0xec')]][_0x5d65('0xf0')]=_0x165fe0[_0x5d65('0xf0')];if(_[_0x5d65('0xee')](this[_0x5d65('0x2b')][this[_0x5d65('0x24')][_0x165fe0[_0x5d65('0xec')]]['queue']])){this[_0x5d65('0x2b')][this[_0x5d65('0x24')][_0x165fe0[_0x5d65('0xec')]]['queue']]=[];}this['queueBooked'][this[_0x5d65('0x24')][_0x165fe0[_0x5d65('0xec')]][_0x5d65('0xbf')]]['push'](_[_0x5d65('0x62')](_[_0x5d65('0x76')](this[_0x5d65('0x24')][_0x165fe0[_0x5d65('0xec')]],[_0x5d65('0xf1'),'stateinterface']),{'status':_0x165fe0[_0x5d65('0x89')],'paused':_0x165fe0[_0x5d65('0xf2')]}));}}}};Dialer[_0x5d65('0x19')]['syncQueueStatusComplete']=function(_0x35d2e9){if(!this['actions'][_0x35d2e9[_0x5d65('0xec')]]){return;}var _0x81308b=this;var _0x5c0d1c=this[_0x5d65('0xbe')][this[_0x5d65('0x24')][_0x35d2e9['actionid']]['queue']];var _0x59ecd0=_0x5c0d1c[_0x5d65('0xf3')]||_0x5d65('0xed');if(_0x59ecd0===_0x5d65('0xf4')){if(this[_0x5d65('0x24')][_0x35d2e9[_0x5d65('0xec')]]&&this[_0x5d65('0x24')][_0x35d2e9[_0x5d65('0xec')]][_0x5d65('0xf0')]){this[_0x5d65('0x1e')]['run'](this['actions'][_0x35d2e9[_0x5d65('0xec')]][_0x5d65('0xf1')],this[_0x5d65('0x24')][_0x35d2e9['actionid']][_0x5d65('0xf0')])[_0x5d65('0xa1')](function(_0x38b441){logger[_0x5d65('0x67')]('[Catch][Preview][syncQueueStatusComplete]',util['inspect'](_0x38b441,{'showHidden':![],'depth':null}));})['finally'](function(){_0x81308b['updateOriginated'](_0x81308b[_0x5d65('0xbe')][_0x81308b[_0x5d65('0x24')][_0x35d2e9['actionid']][_0x5d65('0xbf')]]);_0x81308b['agents'][_0x81308b[_0x5d65('0x24')][_0x35d2e9[_0x5d65('0xec')]]['stateinterface']][_0x5d65('0xef')]=![];delete _0x81308b[_0x5d65('0x24')][_0x35d2e9[_0x5d65('0xec')]];unlockQueueStatus(_0x5c0d1c);});}else{this[_0x5d65('0xcd')](this[_0x5d65('0xbe')][this[_0x5d65('0x24')][_0x35d2e9['actionid']][_0x5d65('0xbf')]]);hopperUtils['rescheduleContact']({'active':![],'ContactId':this[_0x5d65('0x24')][_0x35d2e9[_0x5d65('0xec')]][_0x5d65('0xdb')],'ListId':this[_0x5d65('0x24')][_0x35d2e9[_0x5d65('0xec')]][_0x5d65('0xdc')],'VoiceQueueId':this[_0x5d65('0x24')][_0x35d2e9[_0x5d65('0xec')]][_0x5d65('0xdd')]||undefined,'CampaignId':this[_0x5d65('0x24')][_0x35d2e9[_0x5d65('0xec')]][_0x5d65('0xde')]||undefined})[_0x5d65('0xa1')](loggerCatch(_0x5d65('0xf5')));delete this[_0x5d65('0x24')][_0x35d2e9[_0x5d65('0xec')]];unlockQueueStatus(_0x5c0d1c);}}else if(_0x59ecd0===_0x5d65('0xed')){var _0x10dbf7;if(this[_0x5d65('0x24')][_0x35d2e9[_0x5d65('0xec')]]&&!_[_0x5d65('0x4c')](this[_0x5d65('0x2b')][this[_0x5d65('0x24')][_0x35d2e9[_0x5d65('0xec')]]['queue']])){if(this['queueBookedRR'][_0x81308b[_0x5d65('0x24')][_0x35d2e9[_0x5d65('0xec')]][_0x5d65('0xbf')]]){this[_0x5d65('0x2c')][_0x81308b[_0x5d65('0x24')][_0x35d2e9[_0x5d65('0xec')]][_0x5d65('0xbf')]]=this[_0x5d65('0x2c')][this[_0x5d65('0x24')][_0x35d2e9['actionid']][_0x5d65('0xbf')]]?this[_0x5d65('0x2c')][this[_0x5d65('0x24')][_0x35d2e9['actionid']][_0x5d65('0xbf')]]:this['queueBooked'][this[_0x5d65('0x24')][_0x35d2e9[_0x5d65('0xec')]][_0x5d65('0xbf')]]?this[_0x5d65('0x2b')][this[_0x5d65('0x24')][_0x35d2e9[_0x5d65('0xec')]]['queue']][_0x5d65('0xf6')]||0x0:0x0;}this[_0x5d65('0x2b')][this[_0x5d65('0x24')][_0x35d2e9[_0x5d65('0xec')]][_0x5d65('0xbf')]][_0x5d65('0xf6')]=this[_0x5d65('0x2c')][this[_0x5d65('0x24')][_0x35d2e9[_0x5d65('0xec')]][_0x5d65('0xbf')]];for(var _0x54e81f=0x0;_0x54e81f=_0x8ded4b[_0x5d65('0x11b')]){_0x1ae820[_0x5d65('0x11c')](_0x5d6d62,_0x2e0ee5,_0x57867c,_0x5d65('0x11d'));}else{if(_0x5d6d62[_0x5d65('0x114')]>=_0x8ded4b[_0x5d65('0x11e')]){_0x1ae820['createStateFinal'](_0x5d6d62,_0x2e0ee5,_0x57867c,_0x5d65('0x11f'));}else{hopperUtils[_0x5d65('0xd8')]({'active':![],'countmachineretry':_0x5d6d62['countmachineretry'],'scheduledat':moment()[_0x5d65('0xe8')](_0x8ded4b[_0x5d65('0x120')],'minutes')[_0x5d65('0x49')](_0x5d65('0xc2')),'ContactId':_0x5d6d62[_0x5d65('0xdb')],'ListId':_0x5d6d62[_0x5d65('0xdc')],'VoiceQueueId':_0x5d6d62[_0x5d65('0xdd')]||undefined,'CampaignId':_0x5d6d62['CampaignId']||undefined})[_0x5d65('0xa1')](loggerCatch(_0x5d65('0x121')));_0x2e0ee5({'reschedule':0x1});}}});}if(_0x919e1b['type']===_0x5d65('0xc1')&&this['campaigns'][_0x919e1b[_0x5d65('0xbf')]][_0x5d65('0x108')]&&_0x1b419c[_0x5d65('0x109')]===_0x5d65('0x10a')){delete this[_0x5d65('0x26')][_0x1b419c[_0x5d65('0xc0')]];this[_0x5d65('0xcd')](this[_0x5d65('0x1f')][_0x919e1b['queue']]);_0x259b9b=new Hangup(_0x919e1b,_0x1b419c);_0x259b9b[_0x5d65('0x71')]=0x12;_0x259b9b[_0x5d65('0x72')]=_0x5d65('0x10b');_0x259b9b[_0x5d65('0x10c')]='AMD';ami[_0x5d65('0x44')](_0x5d65('0x10e'),ut[_0x5d65('0x10f')](_0x259b9b,_0x5d65('0x115')));this['saveInDb'](_0x259b9b,_0x5d65('0x122'),_0x5d65('0x123'));}if(_0x919e1b[_0x5d65('0xc3')]===_0x5d65('0xc1')&&this[_0x5d65('0x1f')][_0x919e1b[_0x5d65('0xbf')]][_0x5d65('0x108')]&&_0x1b419c['value']===_0x5d65('0x124')){return new Promise(function(_0x5324ea,_0x594449){delete _0x1ae820[_0x5d65('0x26')][_0x1b419c['uniqueid']];_0x1ae820[_0x5d65('0xcd')](_0x1ae820['campaigns'][_0x919e1b['queue']]);_0x1ae820[_0x5d65('0x1f')][_0x919e1b[_0x5d65('0xbf')]]['outboundAnswerCallsDay']+=0x1;_0x1ae820[_0x5d65('0x1f')][_0x919e1b[_0x5d65('0xbf')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x4a2c37=_0x1ae820[_0x5d65('0x1f')][_0x919e1b['queue']];var _0xce8d31=new Hangup(_0x919e1b,_0x1b419c);_0xce8d31[_0x5d65('0x71')]=0x13;_0xce8d31['statedesc']='Machine';_0xce8d31[_0x5d65('0x10c')]=_0x5d65('0x10d');_0xce8d31['countmachineretry']+=0x1;_0xce8d31['countglobal']+=0x1;_0xce8d31['amd']=!![];ami[_0x5d65('0x44')](_0x5d65('0x10e'),ut[_0x5d65('0x10f')](_0xce8d31,'amd'));hopperUtils[_0x5d65('0xc9')](_0xce8d31)[_0x5d65('0xa1')](loggerCatch(_0x5d65('0x125')));if(_0xce8d31[_0x5d65('0x116')]+_0xce8d31['countcongestionretry']+_0xce8d31[_0x5d65('0x118')]+_0xce8d31[_0x5d65('0x119')]+_0xce8d31[_0x5d65('0xd9')]+_0xce8d31[_0x5d65('0xe7')]+_0xce8d31[_0x5d65('0x114')]+_0xce8d31[_0x5d65('0x11a')]>=_0x4a2c37[_0x5d65('0x11b')]){_0x1ae820[_0x5d65('0x11c')](_0xce8d31,_0x5324ea,_0x594449,_0x5d65('0x11d'));}else{if(_0xce8d31[_0x5d65('0x114')]>=_0x4a2c37[_0x5d65('0x11e')]){_0x1ae820[_0x5d65('0x126')](_0xce8d31,_0x5324ea,_0x594449,_0x5d65('0x11f'));}else{hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0xce8d31[_0x5d65('0x114')],'scheduledat':moment()['add'](_0x4a2c37[_0x5d65('0x120')],_0x5d65('0xda'))[_0x5d65('0x49')](_0x5d65('0xc2')),'ContactId':_0xce8d31[_0x5d65('0xdb')],'ListId':_0xce8d31['ListId'],'VoiceQueueId':_0xce8d31['VoiceQueueId']||undefined,'CampaignId':_0xce8d31[_0x5d65('0xde')]||undefined})[_0x5d65('0xa1')](loggerCatch('[rescheduleContact][Machine]'));_0x5324ea({'reschedule':0x1});}}});}}};Dialer['prototype'][_0x5d65('0x36')]=function(_0x5e6b43){var _0x18f922=this[_0x5d65('0x26')][_0x5e6b43[_0x5d65('0xc0')]];var _0x5c6430;if(_0x18f922&&_0x18f922[_0x5d65('0xc3')]===_0x5d65('0xc1')){delete this[_0x5d65('0x26')][_0x5e6b43[_0x5d65('0xc0')]];this[_0x5d65('0xcd')](this[_0x5d65('0x1f')][_0x18f922[_0x5d65('0xbf')]]);this[_0x5d65('0x1f')][_0x18f922[_0x5d65('0xbf')]][_0x5d65('0x127')]+=0x1;_0x5c6430=new Hangup(_0x18f922,_0x5e6b43);hopperUtils[_0x5d65('0xc9')](_0x5c6430)[_0x5d65('0xa1')](loggerCatch('[syncHangupIvr][createHistory]'));hopperUtils['moveContactManagedDialer'](_0x5c6430)['catch'](loggerCatch(_0x5d65('0x128')));}if(_0x18f922&&_0x18f922[_0x5d65('0xc3')]!==_0x5d65('0xc1')&&isNotNull(this['voiceQueues'][_0x18f922[_0x5d65('0xbf')]][_0x5d65('0x129')])){delete this['uniqueId'][_0x5e6b43['uniqueid']];this['updateOriginated'](this[_0x5d65('0xbe')][_0x18f922[_0x5d65('0xbf')]]);this[_0x5d65('0xbe')][_0x18f922[_0x5d65('0xbf')]][_0x5d65('0xc4')]+=0x1;this[_0x5d65('0xbe')][_0x18f922[_0x5d65('0xbf')]][_0x5d65('0x113')]+=0x1;_0x5c6430=new Hangup(_0x18f922,_0x5e6b43);_0x5c6430[_0x5d65('0x71')]=0x10;_0x5c6430[_0x5d65('0x72')]=_0x5d65('0x12a');_0x5c6430['membername']=_0x5d65('0x12b');hopperUtils[_0x5d65('0xc9')](_0x5c6430)[_0x5d65('0xa1')](loggerCatch(_0x5d65('0x12c')));hopperUtils[_0x5d65('0xcb')](_0x5c6430)[_0x5d65('0xa1')](loggerCatch(_0x5d65('0x128')));}if(_0x18f922&&_0x18f922[_0x5d65('0xc3')]!==_0x5d65('0xc1')&&!isNotNull(this[_0x5d65('0xbe')][_0x18f922[_0x5d65('0xbf')]]['dialQueueProject'])){if(_0x5e6b43[_0x5d65('0x12d')]===_0x5d65('0x12e')){delete this[_0x5d65('0x26')][_0x5e6b43[_0x5d65('0xc0')]];this['voiceQueues'][_0x18f922[_0x5d65('0xbf')]][_0x5d65('0xc4')]+=0x1;const _0x23bec2=new AgentComplete(_0x18f922,_0x5e6b43);_0x23bec2[_0x5d65('0xde')]=this[_0x5d65('0xbe')][_0x18f922[_0x5d65('0xbf')]]['id'];hopperUtils[_0x5d65('0xc9')](_0x23bec2)[_0x5d65('0xa1')](loggerCatch(_0x5d65('0xca')));hopperUtils[_0x5d65('0xcb')](_0x23bec2)[_0x5d65('0xa1')](loggerCatch(_0x5d65('0xcc')));}else{delete this[_0x5d65('0x26')][_0x5e6b43[_0x5d65('0xc0')]];this['updateOriginated'](this[_0x5d65('0xbe')][_0x18f922[_0x5d65('0xbf')]]);this[_0x5d65('0xbe')][_0x18f922[_0x5d65('0xbf')]]['outboundUnknownCallsDay']+=0x1;_0x5c6430=new Hangup(_0x18f922,_0x5e6b43);_0x5c6430[_0x5d65('0x71')]=0xc;_0x5c6430[_0x5d65('0x72')]=_0x5e6b43[_0x5d65('0x12d')];_0x5c6430[_0x5d65('0x10c')]=_0x5d65('0x12f');hopperUtils[_0x5d65('0xc9')](_0x5c6430)['catch'](loggerCatch(_0x5d65('0x12c')));hopperUtils[_0x5d65('0xcb')](_0x5c6430)[_0x5d65('0xa1')](loggerCatch(_0x5d65('0x128')));}}};Dialer[_0x5d65('0x19')][_0x5d65('0xa')]=function(_0x484063){var _0x201bc2=this;if(!_0x201bc2[_0x5d65('0x130')][_0x484063[_0x5d65('0x4a')]]){_0x201bc2[_0x5d65('0x130')][_0x484063[_0x5d65('0x4a')]]={'running':![]};}else if(_0x201bc2[_0x5d65('0x130')][_0x484063[_0x5d65('0x4a')]][_0x5d65('0x131')]===!![]){return;}else if(_0x201bc2['queuesSummary'][_0x484063[_0x5d65('0x4a')]][_0x5d65('0x131')]===![]){_0x201bc2[_0x5d65('0x130')][_0x484063[_0x5d65('0x4a')]]['running']=!![];}var _0x327b6b=_0x201bc2[_0x5d65('0xbe')][_0x484063[_0x5d65('0x4a')]];var _0x4d6502=_0x327b6b[_0x5d65('0x6c')]!==utils[_0x5d65('0x6d')]['INACTIVE'];var _0x4badbf=utils['isPreviewCampaign'](_0x327b6b);_0x327b6b['statusMessage']=utils['getQueueCampaignStatusMessage'](_0x327b6b,_0x201bc2[_0x5d65('0x21')]);Promise[_0x5d65('0xaa')]()[_0x5d65('0x42')](function(){if(_0x327b6b[_0x5d65('0x132')]===utils[_0x5d65('0x6d')][_0x5d65('0x80')]){if(_0x4d6502){clearPredictiveAttributes(_0x327b6b);_0x484063[_0x5d65('0x28')]=undefined;_0x484063[_0x5d65('0x29')]=undefined;}if(_0x327b6b[_0x5d65('0x132')]===utils['CAMPAIGN_STATUS'][_0x5d65('0x80')]){_0x484063[_0x5d65('0x133')]=0x0;_0x484063[_0x5d65('0xf2')]=0x0;_0x484063[_0x5d65('0x134')]=0x0;_0x484063[_0x5d65('0x135')]=0x0;_0x484063['pTalking']=0x0;}}else if(_0x327b6b[_0x5d65('0x132')]===utils[_0x5d65('0x6d')][_0x5d65('0x136')]&&!_0x4badbf){return _0x201bc2[_0x5d65('0x93')](_0x327b6b,!![])[_0x5d65('0x42')](function(){return _0x201bc2['ifTime'](_0x327b6b,![]);})[_0x5d65('0x42')](function(){return _0x201bc2[_0x5d65('0x137')](_0x327b6b);})['catch'](function(_0x5976c2){loggerSyncQueueSummary[_0x5d65('0x46')]('[syncQueueSummary]',util[_0x5d65('0x48')](_0x5976c2,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x327b6b);});}else{clearPredictiveAttributes(_0x327b6b);}})[_0x5d65('0x42')](function(){var _0x5e97da=_0x484063[_0x5d65('0x138')](_0x327b6b);if(_0x5e97da||_0x327b6b[_0x5d65('0x139')]){_0x327b6b[_0x5d65('0x139')]=![];_0x484063[_0x5d65('0x13a')](_0x327b6b);Object[_0x5d65('0x13b')](_0x327b6b,_0x484063);emitOutboundVoiceQueueSummary(_0x484063);}_0x201bc2[_0x5d65('0x130')][_0x327b6b['name']]['running']=![];})[_0x5d65('0xa1')](function(_0x200df9){logger['error'](_0x5d65('0x13c'),util[_0x5d65('0x48')](_0x200df9,{'showHidden':![],'depth':null}));_0x201bc2['queuesSummary'][_0x327b6b[_0x5d65('0x4a')]][_0x5d65('0x131')]=![];});};Dialer[_0x5d65('0x19')][_0x5d65('0x34')]=_[_0x5d65('0x13d')](function(){var _0x54c0c5=_[_0x5d65('0x13e')](this[_0x5d65('0xbe')],function(_0x194f16){return _0x194f16['dialPreviewRecallmeReminder'];});var _0x31685f=_[_0x5d65('0x13e')](this['agents'],function(_0x598fc2){return _0x598fc2[_0x5d65('0x13f')]&&_0x598fc2['status']===_0x5d65('0x8a');});if(_0x54c0c5['length']>0x0&&_0x31685f['length']>0x0){return Promise[_0x5d65('0xaa')]()[_0x5d65('0x42')](cmHopper[_0x5d65('0x140')](_['map'](_0x54c0c5,'id'),previewRecallmeReminderInterval,_['map'](_0x31685f,'id')))[_0x5d65('0x42')](function(_0x58ada5){for(var _0x1a28bf=0x0;_0x1a28bf<_0x58ada5[_0x5d65('0x99')];_0x1a28bf++){var _0x48aa85=_0x58ada5[_0x1a28bf]['Agent']['name'];if(_0x48aa85)io['to'](util[_0x5d65('0x49')](_0x5d65('0x141'),_0x48aa85))[_0x5d65('0x44')]('user:dialPreviewRecallReminder',{'hopper':_0x58ada5[_0x1a28bf]});}})[_0x5d65('0xa1')](function(_0x583375){logger[_0x5d65('0x67')]('checkPreviewRecallReminder',_0x583375);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0x5d65('0x19')][_0x5d65('0x40')]=function(){var _0x457a75=this;setInterval(function(){_0x457a75[_0x5d65('0x142')](_0x457a75[_0x5d65('0x26')],_0x5d65('0x143'));_0x457a75[_0x5d65('0x142')](_0x457a75[_0x5d65('0x24')],_0x5d65('0x144'));},0x32c8);};Dialer[_0x5d65('0x19')]['clearZombieChannels']=function(_0x4d4c06,_0x7e65fe){var _0x5f3e34=this;for(var _0x42ea6c in _0x4d4c06){if(typeof _0x4d4c06[_0x42ea6c]!=='undefined'){this[_0x5d65('0x1d')][_0x5d65('0x1a')](function(){if(!_[_0x5d65('0xee')](_0x4d4c06[_0x42ea6c])){return ami[_0x5d65('0x9b')]({'action':_0x5d65('0x89'),'channel':_0x4d4c06[_0x42ea6c][_0x5d65('0xeb')]})[_0x5d65('0xa1')](function(_0x23425f){if(_0x23425f[_0x5d65('0x6c')]===_0x5d65('0x145')){setTimeout(function(){if(_0x4d4c06[_0x42ea6c]&&_0x4d4c06[_0x42ea6c]['type']!==_0x5d65('0xc1')){_0x5f3e34['updateOriginated'](_0x5f3e34[_0x5d65('0xbe')][_0x4d4c06[_0x42ea6c][_0x5d65('0xbf')]]);logger[_0x5d65('0x67')](_0x5d65('0x146'),_0x7e65fe,_0x42ea6c,_0x4d4c06[_0x42ea6c][_0x5d65('0xbf')]);delete _0x4d4c06[_0x42ea6c];}if(_0x4d4c06[_0x42ea6c]&&_0x4d4c06[_0x42ea6c]['type']===_0x5d65('0xc1')){_0x5f3e34[_0x5d65('0xcd')](_0x5f3e34[_0x5d65('0x1f')][_0x4d4c06[_0x42ea6c]['queue']]);logger['error']('[Dialer][checkChannel][ivr]',_0x7e65fe,_0x42ea6c,_0x4d4c06[_0x42ea6c]['queue']);delete _0x4d4c06[_0x42ea6c];}},0x2328);}});}});}}};Dialer[_0x5d65('0x19')]['getVoiceQueueRtPauses']=function(_0x1d8e83){return Promise[_0x5d65('0xaa')]()['then'](voiceQueueRt[_0x5d65('0x147')](_0x1d8e83))['catch'](loggerCatch(_0x5d65('0x148')));};Dialer[_0x5d65('0x19')][_0x5d65('0xcd')]=function(_0x48cb21){if(!_['isUndefined'](_0x48cb21)&&_0x48cb21!==null){if(typeof _0x48cb21[_0x5d65('0x7f')]!==_0x5d65('0x149')){if(_0x48cb21['originated']>0x0){_0x48cb21[_0x5d65('0x7f')]-=0x1;}else{logger[_0x5d65('0x67')](_0x5d65('0x14a'));}}}else{logger[_0x5d65('0x67')]('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer[_0x5d65('0x19')][_0x5d65('0x14b')]=function(_0x12b5ed,_0x281fdb){var _0x161d46=this;return function(_0x42d76a){_0x161d46[_0x5d65('0xcd')](_0x281fdb);logger['error'](_0x12b5ed,util[_0x5d65('0x48')](_0x42d76a,{'showHidden':![],'depth':null}));};};Dialer[_0x5d65('0x19')][_0x5d65('0x14c')]=function(_0x28911a,_0x4e08ce,_0x559100){var _0x249db4={'state':0x19,'statedesc':_0x5d65('0x14d')};this[_0x5d65('0xcd')](_0x4e08ce);this[_0x5d65('0x110')](_[_0x5d65('0x62')](_0x249db4,_[_0x5d65('0x76')](_0x559100,['ContactId',_0x5d65('0xdc'),'UserId','VoiceQueueId',_0x5d65('0xde')])),_0x5d65('0x14e'),'[emptyContact]');logger['error'](_0x28911a);};Dialer[_0x5d65('0x19')]['saveInDb']=function(_0x1a402a,_0x59c090,_0x39ba12){hopperUtils[_0x5d65('0xc9')](_0x1a402a)[_0x5d65('0xa1')](loggerCatch(_0x59c090));hopperUtils[_0x5d65('0xcb')](_0x1a402a)['catch'](loggerCatch(_0x39ba12));};Dialer[_0x5d65('0x19')][_0x5d65('0xd7')]=function(_0x11e446,_0x1351af){hopperUtils[_0x5d65('0xc9')](_0x11e446)[_0x5d65('0xa1')](loggerCatch(_0x5d65('0xca')));if(_0x1351af==0x0){hopperUtils[_0x5d65('0xcb')](_0x11e446)['catch'](loggerCatch(_0x5d65('0x14f')));}};Dialer[_0x5d65('0x19')]['checkPreviewRecallReminder']=function(_0x28d914){return Promise[_0x5d65('0xaa')]()[_0x5d65('0x42')](cmHopper['handlePreviewRecallNotifications'](_0x28d914['id'],previewRecallmeReminderInterval))[_0x5d65('0x42')](function(_0x12ef55){for(var _0x170f3d=0x0;_0x170f3d<_0x12ef55[_0x5d65('0x99')];_0x170f3d++){var _0x4b3e7a=_0x12ef55[_0x170f3d]['Agent'][_0x5d65('0x4a')];if(_0x4b3e7a)io['to'](util[_0x5d65('0x49')](_0x5d65('0x141'),_0x4b3e7a))[_0x5d65('0x44')]('user:dialPreviewRecallReminder',{'hopper':_0x12ef55[_0x170f3d]});}})[_0x5d65('0xa1')](function(){});};Dialer[_0x5d65('0x19')][_0x5d65('0xad')]=function(_0x148c19){var _0x1ae095=this;return function(){_0x1ae095['handleIvr'](_0x148c19);};};Dialer[_0x5d65('0x19')][_0x5d65('0x150')]=function(_0x749ab0,_0x2edd57){var _0x1433d4=this;var _0x5a98ca=uuid['v4']();this[_0x5d65('0x24')][_0x5a98ca]=new Action(_0x749ab0,_0x2edd57,_0x5a98ca);return new Promise(function(_0x5e4dc5,_0x32f69b){if(_['isUndefined'](_0x749ab0)&&typeof _0x749ab0!=='object'){return _0x32f69b(msgResponse(_0x5d65('0x151'),_0x5d65('0xa6'),_0x5d65('0x152')));}if(_['isUndefined'](_0x2edd57[_0x5d65('0x153')])||_0x2edd57[_0x5d65('0x153')]===null){return _0x32f69b(msgResponse(_0x5d65('0x151'),'Failure',_0x5d65('0x154')));}var _0x41b086={'XMD-CALLERID':_0x1433d4[_0x5d65('0x24')][_0x5a98ca][_0x5d65('0x155')](),'XMD-AGI':_0x749ab0['dialQueueProject']?util['format'](_0x5d65('0x156'),ipAgi,_0x749ab0[_0x5d65('0x129')]):_0x5d65('0x157'),'XMD-AGIAFTER':_0x749ab0[_0x5d65('0xc7')]?util[_0x5d65('0x49')](_0x5d65('0x156'),ipAgi,_0x749ab0[_0x5d65('0xc7')]):'NONE','XMD-QUEUE':utils['isOutboundQueue'](_0x749ab0)?util[_0x5d65('0x49')]('\x22%s,%s%s,,,%s\x22',_0x749ab0[_0x5d65('0x4a')],_0x749ab0[_0x5d65('0x158')]||'',_0x749ab0[_0x5d65('0xc8')]?'c':'',_0x749ab0[_0x5d65('0x159')]||0x3):_0x5d65('0x157'),'XMD-CONTACTID':_0x2edd57[_0x5d65('0xdb')],'XMD-CDRTYPE':_0x5d65('0x8'),'CALLERID(all)':_0x1433d4[_0x5d65('0x24')][_0x5a98ca][_0x5d65('0x155')](),'XMD-AMD':_0x749ab0[_0x5d65('0x108')]?_0x5d65('0x136'):'NONE','XMD-DESTINATION':'xcally-motion-dialer'};if(_0x749ab0[_0x5d65('0x108')]){_0x41b086[_0x5d65('0x15a')]=_0x749ab0[_0x5d65('0x15b')]||0x9c4;_0x41b086[_0x5d65('0x15c')]=_0x749ab0[_0x5d65('0x15d')]||0x5dc;_0x41b086[_0x5d65('0x15e')]=_0x749ab0[_0x5d65('0x15f')]||0x320;_0x41b086[_0x5d65('0x160')]=_0x749ab0['dialAMDTotalAnalysisTime']||0x1388;_0x41b086[_0x5d65('0x161')]=_0x749ab0['dialAMDMinWordLength']||0x64;_0x41b086['XMD-AMDBETWEENWORDSSILENCE']=_0x749ab0[_0x5d65('0x162')]||0x32;_0x41b086[_0x5d65('0x163')]=_0x749ab0[_0x5d65('0x164')]||0x3;_0x41b086[_0x5d65('0x165')]=_0x749ab0[_0x5d65('0x166')]||0x100;_0x41b086[_0x5d65('0x167')]=_0x749ab0[_0x5d65('0x168')]||0x1388;}if(utils[_0x5d65('0x169')](_0x749ab0)){_0x41b086[_0x5d65('0x16a')]=_0x2edd57[_0x5d65('0xdd')];}else{_0x41b086[_0x5d65('0x16b')]=_0x2edd57[_0x5d65('0xde')];}var _0x4d2d7e=utils['setXMDContactVariables'](_0x2edd57[_0x5d65('0x16c')]);Object[_0x5d65('0x13b')](_0x41b086,_0x4d2d7e);var _0x3ea22d=_0x1433d4[_0x5d65('0x86')](_0x749ab0[_0x5d65('0x8d')])?utils[_0x5d65('0x16d')](_0x749ab0[_0x5d65('0x8d')]['callerid'],_0x749ab0[_0x5d65('0x16e')],_0x749ab0[_0x5d65('0x16f')]>0x0?utils['getCallerIdRandom'](_0x749ab0[_0x5d65('0x170')],_0x749ab0[_0x5d65('0x16f')]):_0x749ab0[_0x5d65('0x170')]):utils[_0x5d65('0x16d')](_[_0x5d65('0xee')](_0x749ab0[_0x5d65('0x8e')])?_0x749ab0['Trunk'][_0x5d65('0x171')]:_0x749ab0[_0x5d65('0x8e')][_0x5d65('0x171')],_0x749ab0[_0x5d65('0x16e')],_0x749ab0['dialRandomLastDigitCallerIdNumber']>0x0?utils[_0x5d65('0x172')](_0x749ab0[_0x5d65('0x170')],_0x749ab0[_0x5d65('0x16f')]):_0x749ab0['dialOriginateCallerIdNumber']);if(_0x3ea22d){_0x41b086[_0x5d65('0x173')]=_0x1433d4[_0x5d65('0x24')][_0x5a98ca][_0x5d65('0x174')]=utils[_0x5d65('0x175')](_0x3ea22d);_0x41b086[_0x5d65('0x176')]=_0x2edd57[_0x5d65('0x153')];}_0x749ab0['variables']=_0x41b086;return ami[_0x5d65('0x9b')]({'actionid':_0x5a98ca,'action':'originate','channel':_0x1433d4[_0x5d65('0x86')](_0x749ab0[_0x5d65('0x8d')])?util[_0x5d65('0x49')](_0x5d65('0x177'),_0x749ab0[_0x5d65('0x8d')]['name'],isNotNull(_0x749ab0[_0x5d65('0x178')])?_0x749ab0[_0x5d65('0x178')][_0x5d65('0x179')]()||'':'',_0x749ab0['dialCutDigit']>0x0?_0x2edd57['phone'][_0x5d65('0x17a')](_0x749ab0[_0x5d65('0x17b')]):_0x2edd57['phone']):util[_0x5d65('0x49')]('SIP/%s/%s%s',_[_0x5d65('0xee')](_0x749ab0['TrunkBackup'])?_0x749ab0[_0x5d65('0x8d')][_0x5d65('0x4a')]:_0x749ab0[_0x5d65('0x8e')]['name'],isNotNull(_0x749ab0[_0x5d65('0x178')])?_0x749ab0['dialPrefix'][_0x5d65('0x179')]()||'':'',_0x749ab0[_0x5d65('0x17b')]>0x0?_0x2edd57[_0x5d65('0x153')][_0x5d65('0x17a')](_0x749ab0[_0x5d65('0x17b')]):_0x2edd57[_0x5d65('0x153')]),'callerid':_0x3ea22d,'Exten':_0x5d65('0x107'),'Context':_0x5d65('0x17c'),'Priority':'1','variable':_0x41b086,'timeout':(_0x749ab0[_0x5d65('0x17d')]||0x1e)*0x3e8,'async':!![],'channelid':_0x5a98ca})[_0x5d65('0x42')](function(_0x505b4a){return _0x5e4dc5(_0x505b4a);})[_0x5d65('0xa1')](function(_0x241ae4){_0x749ab0[_0x5d65('0x17e')]+=0x1;var _0xb788dc=new History(_0x1433d4[_0x5d65('0x24')][_0x5a98ca]);logger['error'](util[_0x5d65('0x49')](_0x5d65('0x17f'),JSON[_0x5d65('0x75')](_0x241ae4)));_0xb788dc['state']=0xe;_0xb788dc[_0x5d65('0x72')]=_0x5d65('0x180');_0xb788dc['starttime']=moment()[_0x5d65('0x49')](_0x5d65('0xc2'));_0xb788dc[_0x5d65('0x73')]=_0xb788dc[_0x5d65('0x74')];hopperUtils['createHistory'](_0xb788dc)[_0x5d65('0xa1')](loggerCatch(_0x5d65('0x181')));_0x1433d4[_0x5d65('0xcb')](_0xb788dc)[_0x5d65('0xa1')](loggerCatch('[originate][error]'))[_0x5d65('0x1c')](function(){delete _0x1433d4['actions'][_0x5a98ca];return _0x32f69b(msgResponse(_0x5d65('0x151'),_0x5d65('0x85'),'originate\x20action\x20Error'));});});});};Dialer[_0x5d65('0x19')][_0x5d65('0x182')]=function(_0x807b41,_0x1d1e44,_0x18a2d4){var _0x1ee969=new History(_0x1d1e44);if(_0x1ee969[_0x5d65('0x116')]+_0x1ee969['countcongestionretry']+_0x1ee969[_0x5d65('0x118')]+_0x1ee969[_0x5d65('0x119')]+_0x1ee969['countdropretry']+_0x1ee969[_0x5d65('0xe7')]+_0x1ee969[_0x5d65('0x114')]+_0x1ee969[_0x5d65('0x11a')]>=_0x18a2d4['dialGlobalMaxRetry']-0x1){return!![];}switch(_0x807b41){case 0x3:if(_0x1ee969[_0x5d65('0x118')]>=_0x18a2d4[_0x5d65('0x183')]-0x1){return!![];}hopperUtils[_0x5d65('0xd8')]({'active':![],'countnoanswerretry':_0x1ee969[_0x5d65('0x118')]+=0x1,'scheduledat':moment()['add'](_0x18a2d4[_0x5d65('0x184')],'minutes')['format'](_0x5d65('0xc2')),'ContactId':_0x1ee969[_0x5d65('0xdb')],'ListId':_0x1ee969[_0x5d65('0xdc')],'VoiceQueueId':_0x1ee969[_0x5d65('0xdd')]||undefined,'CampaignId':_0x1ee969[_0x5d65('0xde')]||undefined})[_0x5d65('0xa1')](loggerCatch(_0x5d65('0x185')));break;case 0x5:if(_0x1ee969['countbusyretry']>=_0x18a2d4[_0x5d65('0x186')]-0x1){return!![];}hopperUtils[_0x5d65('0xd8')]({'active':![],'countbusyretry':_0x1ee969[_0x5d65('0x116')]+=0x1,'scheduledat':moment()[_0x5d65('0xe8')](_0x18a2d4[_0x5d65('0x187')],_0x5d65('0xda'))[_0x5d65('0x49')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1ee969[_0x5d65('0xdb')],'ListId':_0x1ee969['ListId'],'VoiceQueueId':_0x1ee969[_0x5d65('0xdd')]||undefined,'CampaignId':_0x1ee969[_0x5d65('0xde')]||undefined})['catch'](loggerCatch('[rescheduleContact]\x20[Busy]'));break;case 0x8:if(_0x1ee969[_0x5d65('0x117')]>=_0x18a2d4[_0x5d65('0x188')]-0x1){return!![];}hopperUtils[_0x5d65('0xd8')]({'active':![],'countcongestionretry':_0x1ee969['countcongestionretry']+=0x1,'scheduledat':moment()[_0x5d65('0xe8')](_0x18a2d4['dialCongestionRetryFrequency'],'minutes')['format'](_0x5d65('0xc2')),'ContactId':_0x1ee969['ContactId'],'ListId':_0x1ee969['ListId'],'VoiceQueueId':_0x1ee969['VoiceQueueId']||undefined,'CampaignId':_0x1ee969[_0x5d65('0xde')]||undefined})[_0x5d65('0xa1')](loggerCatch(_0x5d65('0x189')));break;case 0x0:if(_0x1ee969[_0x5d65('0x119')]>=_0x18a2d4['dialNoSuchNumberMaxRetry']-0x1){return!![];}else{hopperUtils['rescheduleContact']({'active':![],'countnosuchnumberretry':_0x1ee969[_0x5d65('0x119')]+=0x1,'scheduledat':moment()[_0x5d65('0xe8')](_0x18a2d4[_0x5d65('0x18a')],'minutes')['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1ee969[_0x5d65('0xdb')],'ListId':_0x1ee969[_0x5d65('0xdc')],'VoiceQueueId':_0x1ee969[_0x5d65('0xdd')]||undefined,'CampaignId':_0x1ee969[_0x5d65('0xde')]||undefined})[_0x5d65('0xa1')](loggerCatch('[rescheduleContact][NoSuchNumber]'));}break;case 0xa:if(_0x1ee969[_0x5d65('0xd9')]>=_0x18a2d4[_0x5d65('0x18b')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countdropretry':_0x1ee969[_0x5d65('0xd9')]+=0x1,'scheduledat':moment()[_0x5d65('0xe8')](_0x18a2d4[_0x5d65('0xd3')],'minutes')[_0x5d65('0x49')](_0x5d65('0xc2')),'ContactId':_0x1ee969[_0x5d65('0xdb')],'ListId':_0x1ee969['ListId'],'VoiceQueueId':_0x1ee969[_0x5d65('0xdd')]||undefined,'CampaignId':_0x1ee969['CampaignId']||undefined})['catch'](loggerCatch(_0x5d65('0xdf')));break;case 0xb:if(_0x1ee969['countabandonedretry']>=_0x18a2d4[_0x5d65('0x18c')]-0x1){return!![];}hopperUtils[_0x5d65('0xd8')]({'active':![],'countabandonedretry':_0x1ee969[_0x5d65('0xe7')]+=0x1,'scheduledat':moment()[_0x5d65('0xe8')](_0x18a2d4['dialAbandonedRetryFrequency'],_0x5d65('0xda'))['format'](_0x5d65('0xc2')),'ContactId':_0x1ee969['ContactId'],'ListId':_0x1ee969[_0x5d65('0xdc')],'VoiceQueueId':_0x1ee969['VoiceQueueId']||undefined,'CampaignId':_0x1ee969[_0x5d65('0xde')]||undefined})[_0x5d65('0xa1')](loggerCatch('[rescheduleContact][Abandoned]'));break;case 0x13:if(_0x1ee969[_0x5d65('0x114')]>=_0x18a2d4[_0x5d65('0x11e')]-0x1){return!![];}hopperUtils[_0x5d65('0xd8')]({'active':![],'countmachineretry':_0x1ee969['countmachineretry']+=0x1,'scheduledat':moment()['add'](_0x18a2d4[_0x5d65('0x120')],_0x5d65('0xda'))[_0x5d65('0x49')](_0x5d65('0xc2')),'ContactId':_0x1ee969[_0x5d65('0xdb')],'ListId':_0x1ee969['ListId'],'VoiceQueueId':_0x1ee969['VoiceQueueId']||undefined,'CampaignId':_0x1ee969[_0x5d65('0xde')]||undefined})[_0x5d65('0xa1')](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0x1ee969['countagentrejectretry']>=_0x18a2d4['dialAgentRejectMaxRetry']-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countagentrejectretry':_0x1ee969[_0x5d65('0x11a')]+=0x1,'scheduledat':moment()[_0x5d65('0xe8')](_0x18a2d4['dialAgentRejectRetryFrequency'],_0x5d65('0xda'))[_0x5d65('0x49')](_0x5d65('0xc2')),'ContactId':_0x1ee969[_0x5d65('0xdb')],'ListId':_0x1ee969[_0x5d65('0xdc')],'VoiceQueueId':_0x1ee969[_0x5d65('0xdd')]||undefined,'CampaignId':_0x1ee969[_0x5d65('0xde')]||undefined})[_0x5d65('0xa1')](loggerCatch('[rescheduleContact][AgentReject]'));break;default:return!![];}};Dialer[_0x5d65('0x19')][_0x5d65('0x103')]=function(_0x8d3dd1,_0x7e7e8,_0x30dd83){var _0x22b492=this;var _0x4ccae3=new History(_0x8d3dd1);var _0x592a74=![];var _0x564907;var _0x3906d4;return new Promise(function(_0x189f44,_0x586f00){if(_[_0x5d65('0x43')](_0x7e7e8)&&typeof _0x7e7e8!==_0x5d65('0x18d')){return _0x586f00(msgResponse('[callProgressDetecting]',_0x5d65('0xa6'),_0x5d65('0x18e')));}if(_[_0x5d65('0x43')](_0x30dd83)&&typeof _0x30dd83!=='object'){return _0x586f00(msgResponse(_0x5d65('0x18f'),_0x5d65('0xa6'),_0x5d65('0x190')));}hopperUtils[_0x5d65('0xd4')](_0x4ccae3,_0x30dd83[_0x5d65('0x191')],_0x7e7e8)[_0x5d65('0x42')](function(_0x51b0c2){if(_0x51b0c2[_0x5d65('0xd6')]==0x1)_0x592a74=!![];switch(_0x30dd83[_0x5d65('0x191')]){case'0':_0x7e7e8['outboundNoSuchCallsDay']+=0x1;_0x4ccae3[_0x5d65('0x71')]=0x0;_0x4ccae3[_0x5d65('0x72')]='NoSuchNumber';_0x4ccae3['countnosuchnumberretry']+=0x1;_0x4ccae3[_0x5d65('0xd2')]+=0x1;ami[_0x5d65('0x44')](_0x5d65('0x192'),ut[_0x5d65('0x10f')](_0x8d3dd1,_0x5d65('0x193')));_0x564907=_0x7e7e8[_0x5d65('0x18a')];_0x3906d4=_0x7e7e8['callAdditionalPhoneAfterMin'];hopperUtils['createHistory'](_0x4ccae3)[_0x5d65('0xa1')](loggerCatch(_0x5d65('0x125')));if(_0x22b492[_0x5d65('0x182')](0x0,_0x8d3dd1,_0x7e7e8)&&!_0x592a74){if(_0x4ccae3[_0x5d65('0x119')]>=_0x7e7e8[_0x5d65('0x194')]){_0x22b492[_0x5d65('0x126')](_0x4ccae3,_0x189f44,_0x586f00,_0x5d65('0x195'));}else{_0x22b492[_0x5d65('0x11c')](_0x4ccae3,_0x189f44,_0x586f00,_0x5d65('0x195'));}}break;case'3':_0x7e7e8[_0x5d65('0x196')]+=0x1;_0x4ccae3[_0x5d65('0x71')]=0x3;_0x4ccae3['statedesc']=_0x5d65('0x197');_0x4ccae3['countnoanswerretry']+=0x1;_0x4ccae3['countglobal']+=0x1;var _0x19bc4d=ut[_0x5d65('0x198')](_0x8d3dd1,_0x7e7e8);ami[_0x5d65('0x44')]('custom:agentnoanswer',_0x19bc4d);_0x564907=_0x7e7e8[_0x5d65('0x184')];_0x3906d4=_0x7e7e8['callAdditionalPhoneAfterMin'];hopperUtils[_0x5d65('0xc9')](_0x4ccae3)[_0x5d65('0xa1')](loggerCatch(_0x5d65('0x199')));if(_0x22b492['checkRetriveMax'](0x3,_0x8d3dd1,_0x7e7e8)&&!_0x592a74){if(_0x4ccae3['countnoanswerretry']>=_0x7e7e8['dialNoAnswerMaxRetry']){_0x22b492[_0x5d65('0x126')](_0x4ccae3,_0x189f44,_0x586f00,'reason\x203\x20ringing\x20no\x20answer');}else{_0x22b492['stateGlobal'](_0x4ccae3,_0x189f44,_0x586f00,_0x5d65('0x19a'));}}break;case'5':_0x7e7e8[_0x5d65('0x19b')]+=0x1;_0x4ccae3[_0x5d65('0x71')]=0x5;_0x4ccae3[_0x5d65('0x72')]='Busy';_0x4ccae3[_0x5d65('0x116')]+=0x1;_0x4ccae3['countglobal']+=0x1;ami['emit'](_0x5d65('0x19c'),ut[_0x5d65('0x10f')](_0x8d3dd1,_0x5d65('0x19d')));_0x564907=_0x7e7e8[_0x5d65('0x187')];_0x3906d4=_0x7e7e8[_0x5d65('0xe6')];hopperUtils[_0x5d65('0xc9')](_0x4ccae3)['catch'](loggerCatch(_0x5d65('0x19e')));if(_0x22b492[_0x5d65('0x182')](0x5,_0x8d3dd1,_0x7e7e8)&&!_0x592a74){if(_0x4ccae3[_0x5d65('0x116')]>=_0x7e7e8['dialBusyMaxRetry']){_0x22b492['createStateFinal'](_0x4ccae3,_0x189f44,_0x586f00,'reason\x205\x20busy');}else{_0x22b492['stateGlobal'](_0x4ccae3,_0x189f44,_0x586f00,_0x5d65('0x19f'));}}break;case'8':_0x7e7e8[_0x5d65('0x1a0')]+=0x1;_0x4ccae3[_0x5d65('0x71')]=0x8;_0x4ccae3[_0x5d65('0x72')]=_0x5d65('0x1a1');_0x4ccae3[_0x5d65('0x117')]+=0x1;_0x4ccae3[_0x5d65('0xd2')]+=0x1;_0x564907=_0x7e7e8[_0x5d65('0x1a2')];_0x3906d4=_0x7e7e8['callAdditionalPhoneAfterMin'];ami[_0x5d65('0x44')]('custom:agentcongestion',ut['buildObj'](_0x8d3dd1,_0x5d65('0x1a3')));hopperUtils['createHistory'](_0x4ccae3)[_0x5d65('0xa1')](loggerCatch(_0x5d65('0x1a4')));if(_0x22b492[_0x5d65('0x182')](0x8,_0x8d3dd1,_0x7e7e8)&&!_0x592a74){if(_0x4ccae3[_0x5d65('0x117')]>=_0x7e7e8[_0x5d65('0x188')]){_0x22b492[_0x5d65('0x126')](_0x4ccae3,_0x189f44,_0x586f00,'reason\x208\x20congestion');}else{_0x22b492[_0x5d65('0x11c')](_0x4ccae3,_0x189f44,_0x586f00,'reason\x208\x20congestion');}}break;case'11':_0x7e7e8['outboundAbandonedCallsDay']+=0x1;_0x4ccae3[_0x5d65('0x71')]=0xb;_0x4ccae3[_0x5d65('0x72')]=_0x5d65('0xea');_0x4ccae3[_0x5d65('0xe7')]+=0x1;_0x4ccae3[_0x5d65('0xd2')]+=0x1;_0x564907=_0x7e7e8[_0x5d65('0xe9')];_0x3906d4=_0x7e7e8[_0x5d65('0xe6')];hopperUtils[_0x5d65('0xc9')](_0x4ccae3)['catch'](loggerCatch(_0x5d65('0x1a5')));if(_0x22b492['checkRetriveMax'](0xb,_0x8d3dd1,_0x7e7e8)&&!_0x592a74){if(_0x4ccae3[_0x5d65('0xe7')]>=_0x7e7e8['dialAbandonedMaxRetry']){_0x22b492[_0x5d65('0x126')](_0x4ccae3,_0x189f44,_0x586f00,'reason\x2011\x20abandoned');}else{_0x22b492[_0x5d65('0x11c')](_0x4ccae3,_0x189f44,_0x586f00,_0x5d65('0x1a6'));}}break;case'20':_0x7e7e8[_0x5d65('0x1a7')]+=0x1;_0x4ccae3[_0x5d65('0x71')]=0x14;_0x4ccae3[_0x5d65('0x72')]='AgentReject';_0x4ccae3['countagentrejectretry']+=0x1;_0x4ccae3['countglobal']+=0x1;_0x564907=_0x7e7e8[_0x5d65('0x1a8')];_0x3906d4=_0x7e7e8[_0x5d65('0xe6')];ami[_0x5d65('0x44')](_0x5d65('0x1a9'),ut[_0x5d65('0x10f')](_0x8d3dd1,_0x5d65('0x1aa')));hopperUtils[_0x5d65('0xc9')](_0x4ccae3)['catch'](loggerCatch(_0x5d65('0x1ab')));if(_0x22b492[_0x5d65('0x182')](0x14,_0x8d3dd1,_0x7e7e8)&&!_0x592a74){if(_0x4ccae3[_0x5d65('0x11a')]>=_0x7e7e8[_0x5d65('0x1ac')]){_0x22b492['createStateFinal'](_0x4ccae3,_0x189f44,_0x586f00,'reason\x2020\x20agentreject');}else{_0x22b492['stateGlobal'](_0x4ccae3,_0x189f44,_0x586f00,_0x5d65('0x1ad'));}}break;default:_0x7e7e8[_0x5d65('0x1ae')]+=0x1;_0x4ccae3[_0x5d65('0x71')]=0xc;_0x4ccae3[_0x5d65('0x72')]=_0x30dd83[_0x5d65('0x191')];_0x564907=_0x7e7e8['dialAgentRejectRetryFrequency'];_0x3906d4=_0x7e7e8[_0x5d65('0xe6')];hopperUtils[_0x5d65('0xc9')](_0x4ccae3)['catch'](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x22b492[_0x5d65('0x182')](_0x30dd83[_0x5d65('0x191')],_0x8d3dd1,_0x7e7e8)&&!_0x592a74){if(_0x4ccae3[_0x5d65('0x116')]+_0x4ccae3[_0x5d65('0x117')]+_0x4ccae3[_0x5d65('0x118')]+_0x4ccae3[_0x5d65('0x119')]+_0x4ccae3[_0x5d65('0xd9')]+_0x4ccae3[_0x5d65('0xe7')]+_0x4ccae3[_0x5d65('0x114')]+_0x4ccae3[_0x5d65('0x11a')]>=_0x7e7e8['dialGlobalMaxRetry']){_0x22b492[_0x5d65('0x11c')](_0x4ccae3,_0x189f44,_0x586f00,_0x30dd83[_0x5d65('0x191')]);}else{_0x22b492[_0x5d65('0x126')](_0x4ccae3,_0x189f44,_0x586f00,_0x30dd83[_0x5d65('0x191')]);}}}})[_0x5d65('0x42')](function(){if(_0x592a74){hopperUtils[_0x5d65('0xe4')](_0x4ccae3,_0x564907,_0x3906d4)['then'](function(){return _0x189f44(0x1);});}});});};Dialer[_0x5d65('0x19')][_0x5d65('0x11c')]=function(_0x29f31b,_0x4adb35,_0xf6b0fb,_0x167289){var _0x433e8b=new Final(_0x29f31b);_0x433e8b[_0x5d65('0x71')]=0xf;_0x433e8b['statedesc']='Global';this['createStateFinal'](_0x433e8b,_0x4adb35,_0xf6b0fb,_0x167289);};Dialer[_0x5d65('0x19')][_0x5d65('0x126')]=function(_0x29eb6e,_0x26c4df,_0x4aaf4f,_0x127101){hopperUtils['moveContactManagedDialer'](_0x29eb6e)[_0x5d65('0x42')](function(){return _0x26c4df(msgResponse('[callProgressDetecting]',_0x5d65('0x1af'),_0x127101));})['catch'](function(){return _0x4aaf4f(msgResponse(_0x5d65('0x1b0'),_0x5d65('0xa6'),_0x5d65('0x1b1')));});};Dialer[_0x5d65('0x19')][_0x5d65('0x9')]=function(_0x3bef35){var _0x338725=_0x3bef35[_0x5d65('0x1b2')]/0x64;var _0x8f6158=_0x3bef35['outboundDropCallsDayTimeout']/(_0x3bef35['outboundDropCallsDayTimeout']+_0x3bef35[_0x5d65('0xc4')]);var _0x407c80=Math[_0x5d65('0x1b3')](_0x3bef35[_0x5d65('0x1b4')]*(_0x3bef35[_0x5d65('0x1b5')]/0x64));var _0x5f3fb0=Math[_0x5d65('0x1b3')](_0x3bef35[_0x5d65('0x1b4')]*(_0x3bef35[_0x5d65('0x1b6')]/0x64));var _0x16f563=_0x3bef35[_0x5d65('0x133')]+_0x3bef35[_0x5d65('0x135')];var _0x32f072=Math['floor'](_0x3bef35[_0x5d65('0x5d')]*_0x3bef35['erlangAbandonmentRate']*_0x3bef35['predictiveIntervalHitRate']*_0x3bef35['predictiveIntervalMultiplicativeFactor']);if(_['isUndefined'](_0x3bef35[_0x5d65('0x29')])){if(!_[_0x5d65('0x43')](_0x3bef35['startPredictive'])){_0x3bef35[_0x5d65('0x28')]=undefined;loggerPredictive['error'](_0x5d65('0x1b7'),_0x5d65('0x1b8'));}if(!_['isUndefined'](_0x3bef35[_0x5d65('0x65')])){loggerPredictive[_0x5d65('0x67')](_0x5d65('0x1b7'),'check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x3bef35[_0x5d65('0x65')]);_0x3bef35['handlePredictive']=undefined;}_0x3bef35[_0x5d65('0x29')]=moment()[_0x5d65('0x49')](_0x5d65('0xc2'));loggerPredictive[_0x5d65('0x4e')](_0x3bef35[_0x5d65('0x4a')],_0x5d65('0x1b9'),_0x3bef35[_0x5d65('0x29')]);this[_0x5d65('0xaf')](_0x3bef35,0x1);}else if(ifInterval(_0x3bef35['dialPredictiveInterval'],_0x3bef35[_0x5d65('0x29')])){this[_0x5d65('0xaf')](_0x3bef35,0x1);loggerPredictiveCalls['info'](_0x5d65('0x1ba'),_0x3bef35['startProgressive'],_0x3bef35[_0x5d65('0x4a')]);_0x3bef35['erlangCalls']=0x0;_0x3bef35[_0x5d65('0xd0')]=0x0;}else if(_0x338725<_0x8f6158&&_0x3bef35['dialPredictiveOptimization']===_0x5d65('0x1bb')){clearPredictiveAttributes(_0x3bef35);loggerPredictive[_0x5d65('0x4e')](_0x5d65('0x1bc'),_0x5d65('0x1bd'),_0x8f6158,'startProgressive',_0x3bef35[_0x5d65('0x4a')]);}else if(_0x32f072<_0x3bef35[_0x5d65('0xd0')]&&_0x3bef35['dialPredictiveOptimization']===_0x5d65('0x1bb')){clearPredictiveAttributes(_0x3bef35);loggerPredictive['info']('[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]',_0x5d65('0x1be'),_0x32f072,'Drop\x20in\x20this\x20interval',_0x3bef35[_0x5d65('0xd0')],_0x5d65('0x29'),_0x3bef35[_0x5d65('0x4a')]);}else if(!ifInterval(_0x3bef35[_0x5d65('0x1bf')],_0x3bef35[_0x5d65('0x29')])&&_[_0x5d65('0x43')](_0x3bef35[_0x5d65('0x28')])&&!_[_0x5d65('0x43')](_0x3bef35['startProgressive'])){_0x3bef35['startPredictive']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x5d65('0x4e')](_0x3bef35['name'],_0x5d65('0x1c0'),_0x3bef35[_0x5d65('0x28')]);hopperUtils[_0x5d65('0x1c1')](_0x3bef35['dialPredictiveInterval'])[_0x5d65('0x42')](this[_0x5d65('0x1c2')](_0x3bef35))[_0x5d65('0x42')](mergeDataErlangB(_0x3bef35))[_0x5d65('0x42')](this[_0x5d65('0x1c3')](_0x3bef35))[_0x5d65('0xa1')](loggerCatchPredictive(_0x5d65('0x1c4'),_0x3bef35));}else if(!ifInterval(_0x3bef35[_0x5d65('0x1bf')],_0x3bef35[_0x5d65('0x28')])){_0x3bef35[_0x5d65('0xd0')]=0x0;_0x3bef35[_0x5d65('0x28')]=moment()[_0x5d65('0x49')](_0x5d65('0xc2'));loggerPredictive['info'](_0x3bef35[_0x5d65('0x4a')],'recalculate\x20predictive\x20at',_0x3bef35[_0x5d65('0x28')]);clearInterval(_0x3bef35[_0x5d65('0x65')]);_0x3bef35[_0x5d65('0x65')]=undefined;hopperUtils[_0x5d65('0x1c1')](_0x3bef35['dialPredictiveInterval'])[_0x5d65('0x42')](this[_0x5d65('0x1c2')](_0x3bef35))['then'](mergeDataErlangB(_0x3bef35))[_0x5d65('0x42')](this[_0x5d65('0x1c3')](_0x3bef35))[_0x5d65('0xa1')](loggerCatchPredictive(_0x5d65('0x1c5'),_0x3bef35));}else if(_0x3bef35[_0x5d65('0x1b4')]&&_0x16f563<_0x3bef35[_0x5d65('0x1b4')]-_0x5f3fb0){clearPredictiveAttributes(_0x3bef35);loggerPredictive['info'](_0x3bef35[_0x5d65('0x4a')],_0x5d65('0x1c6'),_0x16f563,')\x20are\x20less\x20than\x20threshold\x20(',_0x3bef35[_0x5d65('0x1b4')],'-',_0x5f3fb0,'=',_0x3bef35[_0x5d65('0x1b4')]-_0x5f3fb0,')');}else if(_0x3bef35[_0x5d65('0x1b4')]&&_0x16f563>_0x3bef35[_0x5d65('0x1b4')]+_0x407c80){clearPredictiveAttributes(_0x3bef35);loggerPredictive[_0x5d65('0x4e')](_0x3bef35[_0x5d65('0x4a')],_0x5d65('0x1c6'),_0x16f563,_0x5d65('0x1c7'),_0x3bef35[_0x5d65('0x1b4')],'+',_0x407c80,'=',_0x3bef35['predictiveIntervalAvailable']+_0x407c80,')');}};Dialer[_0x5d65('0x19')][_0x5d65('0x1c2')]=function(_0x18dfa3){var _0x3d0fda=this;return function(_0x458415){return new Promise(function(_0x238013,_0x4693d6){_[_0x5d65('0x62')](_0x18dfa3,_0x458415[0x0]);if(checkGetDataPredictive(_0x458415[0x0])){var _0x1b6fdd=_0x18dfa3[_0x5d65('0x1b4')]=_0x18dfa3[_0x5d65('0x135')]+_0x18dfa3[_0x5d65('0x133')];var _0x4022de=_0x18dfa3[_0x5d65('0x1bf')]*0x3c;var _0x9259ce=_0x458415[0x0][_0x5d65('0x57')]+_0x458415[0x0][_0x5d65('0x5a')];var _0x458990=(_0x458415[0x0][_0x5d65('0x51')]+_0x458415[0x0][_0x5d65('0x53')]+_0x458415[0x0][_0x5d65('0x55')])/_0x458415[0x0][_0x5d65('0x50')];_0x18dfa3[_0x5d65('0x1c8')]=_0x458990>0x0?_0x458990:0x1;switch(_0x18dfa3[_0x5d65('0x1c9')]){case'dropRate':var _0x1f14e5=_0x18dfa3['dialPredictiveOptimizationPercentage']/0x64;return _0x3d0fda[_0x5d65('0x1ca')](_0x1b6fdd,_0x4022de,_0x9259ce,_0x458990,_0x1f14e5)[_0x5d65('0x42')](function(_0x34f90f){return _0x238013(_0x34f90f);});case _0x5d65('0x1cb'):var _0x3633d4=_0x18dfa3['dialPredictiveOptimizationPercentage']/0x64;return _0x3d0fda[_0x5d65('0x1cc')](_0x1b6fdd,_0x4022de,_0x9259ce,_0x458990,_0x3633d4)['then'](function(_0x2d173b){return _0x238013(_0x2d173b);});default:return _0x4693d6(msgResponse(_0x5d65('0x1cd'),_0x5d65('0xa6'),_0x5d65('0x1ce')));}}else{return _0x4693d6(msgResponse(_0x5d65('0x1cd'),'Failure','check\x20failure'));}});};};Dialer['prototype']['getDataPredictiveOld']=function(_0x284381){var _0x52a0af=this;return function(_0x5cd4ec){return new Promise(function(_0x480783,_0x21274e){_[_0x5d65('0x62')](_0x284381,_0x5cd4ec[0x0]);if(checkGetDataPredictive(_0x5cd4ec[0x0])){loggerPredictive[_0x5d65('0x4e')](JSON['stringify'](_0x5cd4ec[0x0]));if(_0x284381[_0x5d65('0x1c9')]==='dropRate'){return _0x52a0af[_0x5d65('0x147')](_0x284381['id'])[_0x5d65('0x42')](function(_0x48a03f){var _0x36cb5b=_0x284381[_0x5d65('0x1cf')]-_0x48a03f[0x0][_0x5d65('0x1d0')];var _0x1d35c9=_0x284381[_0x5d65('0x1bf')]*0x3c;var _0x570a27=_0x5cd4ec[0x0]['predictiveIntervalAvgTalktime']+_0x5cd4ec[0x0]['predictiveIntervalAvgHoldtime'];var _0x24f1df=(_0x5cd4ec[0x0][_0x5d65('0x51')]+_0x5cd4ec[0x0][_0x5d65('0x53')]+_0x5cd4ec[0x0][_0x5d65('0x55')])/_0x5cd4ec[0x0][_0x5d65('0x50')];var _0x320023=_0x284381[_0x5d65('0x1b2')]/0x64;_0x284381[_0x5d65('0x1d1')]=_0x48a03f[0x0][_0x5d65('0x1d0')]||0x0;_0x284381[_0x5d65('0x1c8')]=_0x24f1df>0x0?_0x24f1df:0x1;return _0x52a0af[_0x5d65('0x1ca')](_0x36cb5b,_0x1d35c9,_0x570a27,_0x24f1df,_0x320023);})[_0x5d65('0x42')](function(_0x1b4ea3){return _0x480783(_0x1b4ea3);})[_0x5d65('0xa1')](function(_0x1bacbd){return _0x21274e(msgResponse(_0x5d65('0x1d2'),'Failure',JSON[_0x5d65('0x75')](_0x1bacbd)));});}if(_0x284381[_0x5d65('0x1c9')]===_0x5d65('0x1cb')){return _0x52a0af[_0x5d65('0x147')](_0x284381['id'])[_0x5d65('0x42')](function(_0x25efb3){var _0x1c49b7=_0x284381['loggedIn']-_0x25efb3[0x0][_0x5d65('0x1d0')];var _0x19e82b=_0x284381['dialPredictiveInterval']*0x3c;var _0x4c711a=_0x5cd4ec[0x0][_0x5d65('0x57')]+_0x5cd4ec[0x0][_0x5d65('0x5a')];var _0xc42ff5=(_0x5cd4ec[0x0][_0x5d65('0x51')]+_0x5cd4ec[0x0][_0x5d65('0x53')]+_0x5cd4ec[0x0][_0x5d65('0x55')])/_0x5cd4ec[0x0][_0x5d65('0x50')];var _0x3204db=_0x284381[_0x5d65('0x1b2')]/0x64;_0x284381[_0x5d65('0x1d1')]=_0x25efb3[0x0][_0x5d65('0x1d0')]||0x0;_0x284381['predictiveIntervalHitRate']=_0xc42ff5>0x0?_0xc42ff5:0x1;return _0x52a0af['busyFactor'](_0x1c49b7,_0x19e82b,_0x4c711a,_0xc42ff5,_0x3204db);})[_0x5d65('0x42')](function(_0x46d418){return _0x480783(_0x46d418);})[_0x5d65('0xa1')](function(_0x4a2583){return _0x21274e(msgResponse(_0x5d65('0x1d2'),_0x5d65('0xa6'),JSON[_0x5d65('0x75')](_0x4a2583)));});}}else{return _0x21274e(msgResponse(_0x5d65('0x1cd'),_0x5d65('0xa6'),'check\x20failure'));}});};};Dialer[_0x5d65('0x19')][_0x5d65('0x1c3')]=function(_0x4d2d17){var _0x179846=this;return function(){var _0x15c1e0=0x0;var _0x20d6bd=Math[_0x5d65('0x1d3')](_0x4d2d17[_0x5d65('0x5e')]*0x3e8);if(_0x20d6bd>0x0){_0x20d6bd=_0x20d6bd<0x64?0x64:_0x20d6bd;loggerPredictive['info'](_0x4d2d17['name'],_0x5d65('0x1d4'),_0x20d6bd,'milliseconds');_0x4d2d17['handlePredictive']=setInterval(function(){_0x179846[_0x5d65('0x65')](_0x4d2d17);loggerPredictiveCalls[_0x5d65('0x4e')](_0x5d65('0x1d5'),_0x15c1e0+=0x1);},_0x20d6bd);}else{loggerPredictive[_0x5d65('0x4e')](_0x4d2d17[_0x5d65('0x4a')],'fail\x20to\x20scheduled\x20calls');}};};Dialer[_0x5d65('0x19')][_0x5d65('0x1d6')]=function(_0x2e7ec1,_0x48ce1a){var _0x54165d=this;return function(_0x2ca176){if(_[_0x5d65('0x4c')](_0x2ca176)){if(_[_0x5d65('0xee')](_0x48ce1a['UserId'])||!_0x48ce1a['recallme']){if(_0x2e7ec1[_0x5d65('0xae')]===_0x5d65('0xb1')){_0x2e7ec1[_0x5d65('0x77')]=_[_0x5d65('0x43')](_0x2e7ec1[_0x5d65('0x77')])?!![]:_0x2e7ec1[_0x5d65('0x77')];var _0x7e1764=uuid['v4']();_0x54165d['actions'][_0x7e1764]=new Action(_0x2e7ec1,_0x48ce1a,_0x7e1764);loggerBooked[_0x5d65('0x4e')](_0x5d65('0x1d7'),_0x7e1764,_0x5d65('0x1d8'),JSON[_0x5d65('0x75')](_0x2e7ec1[_0x5d65('0x77')]),_0x5d65('0x1d9'),_0x2e7ec1[_0x5d65('0x4a')]);if(_0x2e7ec1[_0x5d65('0x77')]){_0x2e7ec1[_0x5d65('0x77')]=![];_0x54165d[_0x5d65('0x2b')][_0x54165d[_0x5d65('0x24')][_0x7e1764][_0x5d65('0xbf')]]=[];ami[_0x5d65('0x9b')]({'actionid':_0x7e1764,'action':_0x5d65('0x1da'),'queue':_0x2e7ec1[_0x5d65('0x4a')]})['catch'](function(){_0x54165d[_0x5d65('0xcd')](_0x2e7ec1);hopperUtils[_0x5d65('0xd8')]({'active':![],'ContactId':_0x54165d['actions'][_0x7e1764][_0x5d65('0xdb')],'ListId':_0x54165d[_0x5d65('0x24')][_0x7e1764][_0x5d65('0xdc')],'VoiceQueueId':_0x54165d[_0x5d65('0x24')][_0x7e1764]['VoiceQueueId']||undefined,'CampaignId':_0x54165d['actions'][_0x7e1764][_0x5d65('0xde')]||undefined})['catch'](loggerCatch(_0x5d65('0x1db')));delete _0x54165d[_0x5d65('0x24')][_0x7e1764];});}else{loggerBooked[_0x5d65('0x4e')](_0x5d65('0x1dc'),JSON['stringify'](_0x2e7ec1['queueStatusComplete']),'Queue:\x20',_0x2e7ec1[_0x5d65('0x4a')]);_0x54165d[_0x5d65('0xcd')](_0x2e7ec1);hopperUtils[_0x5d65('0xd8')]({'active':![],'ContactId':_0x54165d[_0x5d65('0x24')][_0x7e1764][_0x5d65('0xdb')],'ListId':_0x54165d['actions'][_0x7e1764]['ListId'],'VoiceQueueId':_0x54165d[_0x5d65('0x24')][_0x7e1764][_0x5d65('0xdd')]||undefined,'CampaignId':_0x54165d[_0x5d65('0x24')][_0x7e1764]['CampaignId']||undefined})['catch'](loggerCatch(_0x5d65('0x1db')));delete _0x54165d[_0x5d65('0x24')][_0x7e1764];}}else{return _0x54165d[_0x5d65('0x150')](_0x2e7ec1,_0x48ce1a);}}else{if(utils[_0x5d65('0x1dd')](undefined,_0x48ce1a[_0x5d65('0x1de')])<_0x2e7ec1[_0x5d65('0x1df')]*0x3c){if(_0x48ce1a[_0x5d65('0x1e0')]&&!_0x48ce1a['Agent'][_0x5d65('0x1e1')]){_0x54165d[_0x5d65('0x1e')][_0x5d65('0x1e2')](_0x48ce1a['id'])[_0x5d65('0x1c')](function(){_0x54165d[_0x5d65('0xcd')](_0x2e7ec1);});}else{hopperUtils[_0x5d65('0x1e3')]({'active':![]},_0x48ce1a['id'],0x1)[_0x5d65('0x1c')](function(){_0x54165d[_0x5d65('0xcd')](_0x2e7ec1);});}}else{_0x2e7ec1['outboundReCallsDay']+=0x1;_0x54165d['updateOriginated'](_0x2e7ec1);if(_0x2e7ec1[_0x5d65('0x1e4')]){hopperUtils[_0x5d65('0xd8')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x48ce1a[_0x5d65('0xdb')],'ListId':_0x48ce1a[_0x5d65('0xdc')],'VoiceQueueId':_0x48ce1a[_0x5d65('0xdd')]||undefined,'CampaignId':_0x48ce1a[_0x5d65('0xde')]||undefined})[_0x5d65('0xa1')](loggerCatch(_0x5d65('0x1e5')));hopperUtils['createHistory'](createObjHistory(_0x2e7ec1,_0x48ce1a,utils[_0x5d65('0x6d')]['QUEUE_RECALL'],0x17,_0x5d65('0x1e6')))[_0x5d65('0xa1')](loggerCatch(_0x5d65('0x1e7')));}else{_0x54165d[_0x5d65('0x110')](createObjHistory(_0x2e7ec1,_0x48ce1a,utils[_0x5d65('0x6d')]['RECALL_TIMEOUT'],0x16,'RecallFailedTimeout'),_0x5d65('0x1e8'),_0x5d65('0x1e9'));}}}}else{_0x2e7ec1[_0x5d65('0x1ea')]+=0x1;_0x54165d['saveInDb'](createObjHistory(_0x2e7ec1,_0x48ce1a,utils['CAMPAIGN_STATUS'][_0x5d65('0x1eb')],0xd,_0x5d65('0x1ec')),_0x5d65('0x1ed'),'[Originate][MoveBlacklist]');throw'inBlackList';}};};Dialer[_0x5d65('0x19')][_0x5d65('0x1ee')]=function(_0x1fe28f){var _0x1fee52=this;var _0x1af0d3=_0x1fe28f[_0x5d65('0x1ef')]-_0x1fe28f[_0x5d65('0x7f')];emitCampaignSummary(_0x1fe28f);if(_0x1af0d3>0x0&&_0x1fe28f[_0x5d65('0x6a')]==0x0){if(_0x1af0d3>this[_0x5d65('0x22')]){_0x1af0d3=this[_0x5d65('0x22')];}_0x1fe28f['temp']=0x1;hopperUtils['getContactDialerIvr'](_0x1fe28f,_0x1af0d3)[_0x5d65('0x42')](function(_0x56e179){_0x1fe28f[_0x5d65('0x6a')]=0x0;if(_0x56e179){if(!utils[_0x5d65('0x1f0')](_0x56e179)){_0x1fe28f['message']=utils[_0x5d65('0x6d')][_0x5d65('0x70')];logger['info'](_0x5d65('0x1f1')+_0x1fe28f[_0x5d65('0x4a')]);}else{_0x1fe28f[_0x5d65('0x7f')]+=_0x56e179[_0x5d65('0x99')];_0x1fe28f[_0x5d65('0x6c')]=utils['CAMPAIGN_STATUS'][_0x5d65('0x1f2')];for(var _0x40a2c2=0x0;_0x40a2c2<_0x56e179[_0x5d65('0x99')];_0x40a2c2+=0x1){_0x1fe28f['ivrTotalCallsDays']+=0x1;if(_[_0x5d65('0xee')](_0x56e179[_0x40a2c2])||_[_0x5d65('0xee')](_0x56e179[_0x40a2c2]['Contact'])||_[_0x5d65('0xee')](_0x56e179[_0x40a2c2][_0x5d65('0x153')])){_0x1fee52[_0x5d65('0x14c')](_0x5d65('0x1f3'),_0x1fe28f,_0x56e179[_0x40a2c2]);}else{hopperUtils['checkIsBlackListIvr'](_['pick'](_0x56e179[_0x40a2c2],[_0x5d65('0xde'),_0x5d65('0x153')]))[_0x5d65('0x42')](_0x1fee52[_0x5d65('0x1d6')](_0x1fe28f,_0x56e179[_0x40a2c2]))[_0x5d65('0xa1')](_0x1fee52[_0x5d65('0x14b')](_0x5d65('0x1f4'),_0x1fe28f));}}}}})['catch'](loggerGetContactDialer(_0x5d65('0x1f5'),_0x1fe28f,_0x1af0d3));}};Dialer['prototype'][_0x5d65('0xaf')]=function(_0x38e0a5,_0x36dfdd){var _0x1e4156=this;var _0x1c9a45=[];if(_0x36dfdd<0x1||_0x38e0a5[_0x5d65('0xae')]==='booked'){_0x36dfdd=0x1;}var _0x5d42df=Math[_0x5d65('0x1d3')](_0x38e0a5['available']*_0x36dfdd)-_0x38e0a5['originated'];if(_0x38e0a5[_0x5d65('0x1f6')]>0x0){var _0x5deba4=_0x38e0a5[_0x5d65('0x1f6')]-_0x38e0a5['originated']-_0x38e0a5[_0x5d65('0x135')]-_0x38e0a5[_0x5d65('0x1f7')];if(_0x5d42df>_0x5deba4){_0x5d42df=_0x5deba4;}}if(_0x5d42df>0x0&&_0x38e0a5[_0x5d65('0x6a')]==0x0){if(_0x38e0a5[_0x5d65('0xae')]==='booked'){_0x5d42df=0x1;}if(_0x5d42df>this[_0x5d65('0x22')]){_0x5d42df=this[_0x5d65('0x22')];}for(var _0x31188b in this[_0x5d65('0x20')]){if(typeof this[_0x5d65('0x20')][_0x31188b]!=='undefined'){if(this[_0x5d65('0x20')][_0x31188b][_0x5d65('0x71')]===_0x5d65('0x1f8')&&this['agents'][_0x31188b][_0x5d65('0x89')]==='reachable'){_0x1c9a45['push'](this[_0x5d65('0x20')][_0x31188b]['id']);}}}_0x38e0a5[_0x5d65('0x6a')]=0x1;hopperUtils[_0x5d65('0x1f9')](_0x38e0a5,_0x1c9a45,_0x5d42df)[_0x5d65('0x42')](function(_0x2cd48c){_0x38e0a5[_0x5d65('0x6a')]=0x0;if(_0x2cd48c){if(!utils[_0x5d65('0x1f0')](_0x2cd48c)){hopperUtils['countReScheduled'](_0x38e0a5)[_0x5d65('0x42')](sendMessageReschedule(_0x38e0a5))[_0x5d65('0xa1')](loggerCatch(_0x5d65('0x1fa')));}else{_0x38e0a5[_0x5d65('0x7f')]+=_0x2cd48c['length'];_0x38e0a5['message']=_0x38e0a5[_0x5d65('0xae')]===_0x5d65('0xb1')?utils[_0x5d65('0x6d')][_0x5d65('0x136')]:utils[_0x5d65('0x6d')][_0x5d65('0x1f2')];for(var _0x4eb1bf=0x0;_0x4eb1bf<_0x2cd48c[_0x5d65('0x99')];_0x4eb1bf+=0x1){if(_[_0x5d65('0xee')](_0x2cd48c[_0x4eb1bf])||_[_0x5d65('0xee')](_0x2cd48c[_0x4eb1bf][_0x5d65('0x16c')])||_[_0x5d65('0xee')](_0x2cd48c[_0x4eb1bf][_0x5d65('0x153')])){_0x1e4156[_0x5d65('0x14c')](_0x5d65('0x1f3'),_0x38e0a5,_0x2cd48c[_0x4eb1bf]);}else{hopperUtils['checkIsBlackList'](_[_0x5d65('0x76')](_0x2cd48c[_0x4eb1bf],[_0x5d65('0xdd'),'phone']))['then'](_0x1e4156[_0x5d65('0x1d6')](_0x38e0a5,_0x2cd48c[_0x4eb1bf]))[_0x5d65('0xa1')](_0x1e4156[_0x5d65('0x14b')](_0x5d65('0x1f3'),_0x38e0a5));}}}}})[_0x5d65('0xa1')](loggerGetContactDialer(_0x5d65('0x1fb'),_0x38e0a5,_0x5d42df));}};Dialer['prototype']['handlePredictive']=function(_0x50d486){if(_0x50d486[_0x5d65('0x1f6')]>0x0){var _0x497957=_0x50d486[_0x5d65('0x1f6')]-_0x50d486['originated']-_0x50d486[_0x5d65('0x135')];if(_0x497957>0x0&&_0x50d486[_0x5d65('0x6a')]==0x0){this[_0x5d65('0x1fc')](_0x50d486);}else{loggerPredictiveCalls[_0x5d65('0x4e')](_0x5d65('0x1fd'));}}else{this[_0x5d65('0x1fc')](_0x50d486);}};Dialer['prototype']['tryOriginatePredictive']=function(_0x5a3bf9){var _0x5493ae=this;var _0x126208=[];_0x5a3bf9['originated']+=0x1;for(var _0x2089c8 in this[_0x5d65('0x20')]){if(typeof this[_0x5d65('0x20')][_0x2089c8]!==_0x5d65('0x149')){if(this[_0x5d65('0x20')][_0x2089c8][_0x5d65('0x71')]==='not_inuse'&&this[_0x5d65('0x20')][_0x2089c8]['status']==='reachable'){_0x126208[_0x5d65('0x9a')](this['agents'][_0x2089c8]['id']);}}}_0x5a3bf9[_0x5d65('0x6a')]=0x1;return this[_0x5d65('0x1f9')](_0x5a3bf9['id'],_0x126208,0x1,_0x5a3bf9[_0x5d65('0x1fe')],_0x5a3bf9)['then'](function(_0x34f80e){_0x5a3bf9[_0x5d65('0x6a')]=0x1;if(_0x34f80e){if(!utils['checkContactEmpty'](_0x34f80e)){utils[_0x5d65('0x69')](_0x5a3bf9,0x1,0x0);return hopperUtils['countReScheduled'](_0x5a3bf9)[_0x5d65('0x42')](sendMessageReschedule(_0x5a3bf9))['catch'](loggerCatch(_0x5d65('0x1fa')));}else{_0x5a3bf9[_0x5d65('0x6c')]=utils[_0x5d65('0x6d')][_0x5d65('0x1f2')];if(_['isNil'](_0x34f80e[0x0])||_[_0x5d65('0xee')](_0x34f80e[0x0][_0x5d65('0x16c')])||_[_0x5d65('0xee')](_0x34f80e[0x0][_0x5d65('0x153')])){_0x5493ae[_0x5d65('0x14c')](_0x5d65('0x1f3'),_0x5a3bf9,_0x34f80e[0x0]);}else{return hopperUtils[_0x5d65('0x1ff')](_['pick'](_0x34f80e[0x0],['VoiceQueueId',_0x5d65('0x153')]))['then'](_0x5493ae[_0x5d65('0x1d6')](_0x5a3bf9,_0x34f80e[0x0]))[_0x5d65('0xa1')](_0x5493ae['loggerHandler'](_0x5d65('0x200'),_0x5a3bf9));}}}})['catch'](loggerGetContactDialer(_0x5d65('0x201'),_0x5a3bf9,0x1));};Dialer['prototype']['abandonmentRate']=function(_0x5ddfc5,_0x410fce,_0x476e84,_0x2a1ad0,_0xf5378f,_0x233127){loggerPredictive['info'](_0x5d65('0x202'));loggerPredictive['info'](_0x5d65('0x203'),_0x5ddfc5);loggerPredictive['info'](_0x5d65('0x204'),_0x410fce);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',_0x476e84);loggerPredictive[_0x5d65('0x4e')](_0x5d65('0x205'),_0x2a1ad0);loggerPredictive[_0x5d65('0x4e')](_0x5d65('0x206'),_0xf5378f);loggerPredictive[_0x5d65('0x4e')]('---------------------------');return new Promise(function(_0x7e80e9,_0x1771d8){if(_0x5ddfc5<=0x0||isNaN(_0x5ddfc5)){return _0x1771d8(msgResponse('[abandonmentRate]',_0x5d65('0x85'),'m\x20=\x20'+_0x5ddfc5));}if(_0x476e84<=0x0||isNaN(_0x476e84)){return _0x1771d8(msgResponse(_0x5d65('0x207'),_0x5d65('0x85'),_0x5d65('0x208')+_0x476e84));}if(_0x2a1ad0<=0x0||isNaN(_0x2a1ad0)){return _0x1771d8(msgResponse(_0x5d65('0x207'),_0x5d65('0x85'),_0x5d65('0x209')+_0x2a1ad0));}if(_0x410fce<=0x0||isNaN(_0x410fce)){return _0x1771d8(msgResponse(_0x5d65('0x207'),_0x5d65('0x85'),_0x5d65('0x20a')+_0x410fce));}if(_0xf5378f<=0x0||isNaN(_0xf5378f)){return _0x1771d8(msgResponse(_0x5d65('0x207'),_0x5d65('0x85'),'Amax\x20=\x20'+_0xf5378f));}_0x233127=_0x233127||0x0;var _0x25e512=0x1/_0x476e84;var _0x318f10=0x0;var _0x52b614=0x0;var _0x5da34c=0x0;var _0x50f7c4=0x0;for(var _0x20ef8c=0x0;_0x5da34c<_0xf5378f;_0x20ef8c+=0x1){_0x52b614=_0x20ef8c/_0x410fce;_0x318f10=(_0x2a1ad0*_0x52b614+_0x233127)/_0x25e512;_0x5da34c=utils[_0x5d65('0x20b')](_0x318f10,_0x5ddfc5);_0x50f7c4=_0x318f10/_0x5ddfc5*(0x1-utils[_0x5d65('0x20b')](_0x318f10,_0x5ddfc5));}return _0x7e80e9({'erlangCalls':_0x20ef8c,'erlangCallToSecond':_0x410fce/_0x20ef8c,'erlangAbandonmentRate':_0x5da34c,'erlangBusyFactor':_0x50f7c4});});};Dialer[_0x5d65('0x19')][_0x5d65('0x1cc')]=function(_0x2718b0,_0x372a20,_0x2d9987,_0x3b4301,_0x346e82,_0x3ee6c0){loggerPredictive[_0x5d65('0x4e')]('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive[_0x5d65('0x4e')](_0x5d65('0x203'),_0x2718b0);loggerPredictive[_0x5d65('0x4e')](_0x5d65('0x204'),_0x372a20);loggerPredictive[_0x5d65('0x4e')]('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',_0x2d9987);loggerPredictive['info'](_0x5d65('0x205'),_0x3b4301);loggerPredictive['info'](_0x5d65('0x20c'),_0x346e82);loggerPredictive[_0x5d65('0x4e')](_0x5d65('0x58'));return new Promise(function(_0x78fae1,_0x25c6e7){if(_0x2718b0<=0x0||isNaN(_0x2718b0)){return _0x25c6e7(msgResponse(_0x5d65('0x20d'),'Error','m\x20=\x20'+_0x2718b0));}if(_0x2d9987<=0x0||isNaN(_0x2d9987)){return _0x25c6e7(msgResponse(_0x5d65('0x20d'),'Error',_0x5d65('0x208')+_0x2d9987));}if(_0x3b4301<=0x0||isNaN(_0x3b4301)){return _0x25c6e7(msgResponse('[busyFactor]',_0x5d65('0x85'),_0x5d65('0x209')+_0x3b4301));}if(_0x372a20<=0x0||isNaN(_0x372a20)){return _0x25c6e7(msgResponse(_0x5d65('0x20d'),'Error',_0x5d65('0x20a')+_0x372a20));}if(_0x346e82<=0x0||isNaN(_0x346e82)){return _0x25c6e7(msgResponse(_0x5d65('0x20d'),_0x5d65('0x85'),_0x5d65('0x20e')+_0x346e82));}_0x3ee6c0=_0x3ee6c0||0x0;var _0x21413b=0x1/_0x2d9987;var _0x249e31=0x0;var _0x31d38c=0x0;var _0x1df7a6=0x0;var _0x37d055=0x0;for(var _0xe7bacb=0x0;_0x37d055<_0x346e82;_0xe7bacb+=0x1){_0x31d38c=_0xe7bacb/_0x372a20;_0x249e31=(_0x3b4301*_0x31d38c+_0x3ee6c0)/_0x21413b;_0x1df7a6=utils[_0x5d65('0x20b')](_0x249e31,_0x2718b0);_0x37d055=_0x249e31/_0x2718b0*(0x1-utils[_0x5d65('0x20b')](_0x249e31,_0x2718b0));}return _0x78fae1({'erlangCalls':_0xe7bacb,'erlangCallToSecond':_0x372a20/_0xe7bacb,'erlangAbandonmentRate':_0x1df7a6,'erlangBusyFactor':_0x37d055});});};module['exports']=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/models/action.js b/server/services/ami/dialer/models/action.js index 8793fab..5f022d7 100644 --- a/server/services/ami/dialer/models/action.js +++ b/server/services/ami/dialer/models/action.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4a9d=['isNil','string','voiceQueue','uniqueid','name','firstName','Contact','lastName','number','phone','active','type','dialQueueTimeout','scheduledat','countbusyretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','dialCutDigit','substring','exports','util','lodash','moment'];(function(_0x3e6cc9,_0x18d023){var _0x1bc014=function(_0x1965af){while(--_0x1965af){_0x3e6cc9['push'](_0x3e6cc9['shift']());}};_0x1bc014(++_0x18d023);}(_0x4a9d,0x1e1));var _0xd4a9=function(_0x420e03,_0x74f496){_0x420e03=_0x420e03-0x0;var _0x4d2ce7=_0x4a9d[_0x420e03];return _0x4d2ce7;};'use strict';var util=require(_0xd4a9('0x0'));var _=require(_0xd4a9('0x1'));var moment=require(_0xd4a9('0x2'));function checkNameSurname(_0x4d300f,_0x14b320,_0x21e439){var _0x3b501a='';if(!_[_0xd4a9('0x3')](_0x14b320)&&_0xd4a9('0x4')===typeof _0x14b320){_0x3b501a+=_0x14b320;}if(!_['isNil'](_0x21e439)&&_0xd4a9('0x4')===typeof _0x21e439){_0x3b501a+='\x20'+_0x21e439;}if(_0x3b501a!==''){return _0x3b501a;}return _0x4d300f;}function Action(_0x539211,_0x3d74ec,_0xa8256b){this[_0xd4a9('0x5')]=_0x539211;this[_0xd4a9('0x6')]=_0xa8256b||undefined;this[_0xd4a9('0x7')]=checkNameSurname(_0x3d74ec['Contact']['phone'],_0x3d74ec['Contact'][_0xd4a9('0x8')],_0x3d74ec[_0xd4a9('0x9')][_0xd4a9('0xa')]);this[_0xd4a9('0xb')]=_0x3d74ec[_0xd4a9('0xc')];this['queue']=_0x539211[_0xd4a9('0x7')];this[_0xd4a9('0xd')]=_0x3d74ec[_0xd4a9('0xd')]||![];this['type']=_0x539211[_0xd4a9('0xe')];this['dialQueueTimeout']=_0x539211[_0xd4a9('0xf')]||0x3;this[_0xd4a9('0x10')]=_0x3d74ec[_0xd4a9('0x10')];this[_0xd4a9('0x11')]=_0x3d74ec[_0xd4a9('0x11')];this['countcongestionretry']=_0x3d74ec['countcongestionretry'];this['countnoanswerretry']=_0x3d74ec[_0xd4a9('0x12')];this[_0xd4a9('0x13')]=_0x3d74ec[_0xd4a9('0x13')];this[_0xd4a9('0x14')]=_0x3d74ec['countdropretry'];this[_0xd4a9('0x15')]=_0x3d74ec[_0xd4a9('0x15')];this[_0xd4a9('0x16')]=_0x3d74ec[_0xd4a9('0x16')];this['countagentrejectretry']=_0x3d74ec[_0xd4a9('0x17')];this[_0xd4a9('0x18')]=_0x3d74ec[_0xd4a9('0x18')];this['ListId']=_0x3d74ec[_0xd4a9('0x19')];this[_0xd4a9('0x1a')]=_0x3d74ec[_0xd4a9('0x1a')];this[_0xd4a9('0x1b')]=_0x3d74ec[_0xd4a9('0x1b')];this[_0xd4a9('0x1c')]=_0x3d74ec['CampaignId'];this[_0xd4a9('0x1d')]=_0x3d74ec['id'];this['ContactFirstName']=_0x3d74ec[_0xd4a9('0x9')][_0xd4a9('0x8')]||'';this[_0xd4a9('0x1e')]=moment()[_0xd4a9('0x1f')](_0xd4a9('0x20'));this[_0xd4a9('0x21')]=_0x3d74ec[_0xd4a9('0x21')];this[_0xd4a9('0x22')]=_0x3d74ec[_0xd4a9('0x22')];this[_0xd4a9('0x23')]=_0x3d74ec[_0xd4a9('0x23')];this[_0xd4a9('0x24')]=_0x3d74ec[_0xd4a9('0x24')];this[_0xd4a9('0x25')]='';this[_0xd4a9('0x26')]='';}Action[_0xd4a9('0x27')][_0xd4a9('0x28')]=function(){return util[_0xd4a9('0x1f')]('\x22%s\x22\x20<%s>',this[_0xd4a9('0x7')],this['voiceQueue'][_0xd4a9('0x29')]>0x0?this[_0xd4a9('0xb')][_0xd4a9('0x2a')](this[_0xd4a9('0x5')][_0xd4a9('0x29')]):this[_0xd4a9('0xb')]);};Action['prototype']['getQueue']=function(){return this['queue'];};module[_0xd4a9('0x2b')]=Action; \ No newline at end of file +var _0x923b=['Contact','phone','firstName','number','name','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','idHopper','ContactFirstName','starttime','callback','callbackuniqueid','callbackat','recallme','prototype','getCaller','format','\x22%s\x22\x20<%s>','voiceQueue','dialCutDigit','substring','getQueue','queue','moment','string','isNil'];(function(_0x292397,_0x4d59f5){var _0x29ba42=function(_0x2d71a2){while(--_0x2d71a2){_0x292397['push'](_0x292397['shift']());}};_0x29ba42(++_0x4d59f5);}(_0x923b,0x9d));var _0xb923=function(_0x516ffb,_0x5b5b42){_0x516ffb=_0x516ffb-0x0;var _0x319667=_0x923b[_0x516ffb];return _0x319667;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0xb923('0x0'));function checkNameSurname(_0x3f2720,_0x1af706,_0x18eb81){var _0x1dcd8f='';if(!_['isNil'](_0x1af706)&&_0xb923('0x1')===typeof _0x1af706){_0x1dcd8f+=_0x1af706;}if(!_[_0xb923('0x2')](_0x18eb81)&&'string'===typeof _0x18eb81){_0x1dcd8f+='\x20'+_0x18eb81;}if(_0x1dcd8f!==''){return _0x1dcd8f;}return _0x3f2720;}function Action(_0x48b94c,_0x52191e,_0x5c8cbe){this['voiceQueue']=_0x48b94c;this['uniqueid']=_0x5c8cbe||undefined;this['name']=checkNameSurname(_0x52191e[_0xb923('0x3')][_0xb923('0x4')],_0x52191e[_0xb923('0x3')][_0xb923('0x5')],_0x52191e[_0xb923('0x3')]['lastName']);this[_0xb923('0x6')]=_0x52191e['phone'];this['queue']=_0x48b94c[_0xb923('0x7')];this[_0xb923('0x8')]=_0x52191e[_0xb923('0x8')]||![];this['type']=_0x48b94c[_0xb923('0x9')];this[_0xb923('0xa')]=_0x48b94c[_0xb923('0xa')]||0x3;this[_0xb923('0xb')]=_0x52191e[_0xb923('0xb')];this[_0xb923('0xc')]=_0x52191e[_0xb923('0xc')];this[_0xb923('0xd')]=_0x52191e['countcongestionretry'];this[_0xb923('0xe')]=_0x52191e['countnoanswerretry'];this['countnosuchnumberretry']=_0x52191e[_0xb923('0xf')];this['countdropretry']=_0x52191e[_0xb923('0x10')];this['countabandonedretry']=_0x52191e[_0xb923('0x11')];this[_0xb923('0x12')]=_0x52191e[_0xb923('0x12')];this[_0xb923('0x13')]=_0x52191e['countagentrejectretry'];this['ContactId']=_0x52191e[_0xb923('0x14')];this[_0xb923('0x15')]=_0x52191e[_0xb923('0x15')];this[_0xb923('0x16')]=_0x52191e[_0xb923('0x16')];this['VoiceQueueId']=_0x52191e[_0xb923('0x17')];this['CampaignId']=_0x52191e['CampaignId'];this[_0xb923('0x18')]=_0x52191e['id'];this[_0xb923('0x19')]=_0x52191e[_0xb923('0x3')][_0xb923('0x5')]||'';this[_0xb923('0x1a')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0xb923('0x1b')]=_0x52191e[_0xb923('0x1b')];this[_0xb923('0x1c')]=_0x52191e['callbackuniqueid'];this[_0xb923('0x1d')]=_0x52191e[_0xb923('0x1d')];this['recallme']=_0x52191e[_0xb923('0x1e')];this['originatecalleridnum']='';this['originatecalleridname']='';}Action[_0xb923('0x1f')][_0xb923('0x20')]=function(){return util[_0xb923('0x21')](_0xb923('0x22'),this[_0xb923('0x7')],this[_0xb923('0x23')][_0xb923('0x24')]>0x0?this[_0xb923('0x6')][_0xb923('0x25')](this[_0xb923('0x23')][_0xb923('0x24')]):this['number']);};Action['prototype'][_0xb923('0x26')]=function(){return this[_0xb923('0x27')];};module['exports']=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/models/agentComplete.js b/server/services/ami/dialer/models/agentComplete.js index 4edb197..4d30503 100644 --- a/server/services/ami/dialer/models/agentComplete.js +++ b/server/services/ami/dialer/models/agentComplete.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8069=['holdtime','talktime','queue','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','exports','moment','../utils','statedesc','Answer','scheduledat','type','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','getSeconds'];(function(_0x1f930e,_0x24c403){var _0x5bfa2b=function(_0x2e4893){while(--_0x2e4893){_0x1f930e['push'](_0x1f930e['shift']());}};_0x5bfa2b(++_0x24c403);}(_0x8069,0x13e));var _0x9806=function(_0x502cb0,_0x36b7cb){_0x502cb0=_0x502cb0-0x0;var _0x29ce44=_0x8069[_0x502cb0];return _0x29ce44;};'use strict';var moment=require(_0x9806('0x0'));var utils=require(_0x9806('0x1'));function AgentComplete(_0x5e523c,_0x5580c0){this['state']=0x4;this[_0x9806('0x2')]=_0x9806('0x3');this[_0x9806('0x4')]=_0x5e523c[_0x9806('0x4')];this[_0x9806('0x5')]=_0x5e523c[_0x9806('0x5')];this['campaigntype']=_0x5e523c[_0x9806('0x5')]===_0x9806('0x6')?'queue':_0x5e523c['type'];this[_0x9806('0x7')]=_0x5e523c[_0x9806('0x7')];this[_0x9806('0x8')]=_0x5e523c[_0x9806('0x8')];this[_0x9806('0x9')]=_0x5e523c[_0x9806('0x9')];this['countglobal']=_0x5e523c[_0x9806('0x7')]+_0x5e523c[_0x9806('0x8')]+_0x5e523c[_0x9806('0x9')]+_0x5e523c[_0x9806('0xa')]+_0x5e523c[_0x9806('0xb')]+_0x5e523c[_0x9806('0xc')]+_0x5e523c[_0x9806('0xd')]+_0x5e523c[_0x9806('0xe')];this[_0x9806('0xa')]=_0x5e523c[_0x9806('0xa')];this[_0x9806('0xb')]=_0x5e523c[_0x9806('0xb')];this[_0x9806('0xc')]=_0x5e523c['countabandonedretry'];this[_0x9806('0xd')]=_0x5e523c[_0x9806('0xd')];this[_0x9806('0xe')]=_0x5e523c['countagentrejectretry'];this[_0x9806('0xf')]=_0x5580c0[_0x9806('0xf')];this[_0x9806('0x10')]=_0x5e523c[_0x9806('0x11')];this['calleridnum']=_0x5e523c[_0x9806('0x12')];this[_0x9806('0x13')]=_0x5e523c[_0x9806('0x13')];this[_0x9806('0x14')]=_0x5e523c[_0x9806('0x14')];this[_0x9806('0x15')]=_0x5e523c[_0x9806('0x15')];this[_0x9806('0x16')]=moment()[_0x9806('0x17')](_0x9806('0x18'));this['ringtime']=utils[_0x9806('0x19')](_0x5e523c[_0x9806('0x14')],_0x5e523c[_0x9806('0x13')]);this[_0x9806('0x1a')]=utils[_0x9806('0x19')](_0x5e523c[_0x9806('0x15')],_0x5e523c[_0x9806('0x14')]);this[_0x9806('0x1b')]=utils['getSeconds'](this['endtime'],_0x5e523c['answertime']);this['queue']=_0x5580c0[_0x9806('0x1c')];this[_0x9806('0x1d')]=_0x5580c0['membername'];this[_0x9806('0x1e')]=_0x5580c0[_0x9806('0x1e')];this[_0x9806('0x1f')]=_0x5e523c[_0x9806('0x1f')];this[_0x9806('0x20')]=_0x5e523c['callbackuniqueid'];this[_0x9806('0x21')]=_0x5e523c[_0x9806('0x21')];this[_0x9806('0x22')]=_0x5e523c[_0x9806('0x22')];this[_0x9806('0x23')]=_0x5e523c['ContactId'];this[_0x9806('0x24')]=_0x5e523c[_0x9806('0x24')];this['UserId']=_0x5e523c['UserId'];this[_0x9806('0x25')]=_0x5e523c[_0x9806('0x25')];this[_0x9806('0x26')]=_0x5e523c[_0x9806('0x26')];this[_0x9806('0x27')]=_0x5e523c[_0x9806('0x27')]||'';this[_0x9806('0x28')]=_0x5e523c[_0x9806('0x28')]||'';this[_0x9806('0x29')]=_0x5e523c[_0x9806('0x29')];}module[_0x9806('0x2a')]=AgentComplete; \ No newline at end of file +var _0x72c1=['reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','../utils','state','statedesc','Answer','scheduledat','type','campaigntype','countcongestionretry','countnoanswerretry','countglobal','countbusyretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','number','starttime','responsetime','answertime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','talktime','endtime','queue','membername'];(function(_0x3b52bb,_0x4f9aba){var _0x23defe=function(_0x245702){while(--_0x245702){_0x3b52bb['push'](_0x3b52bb['shift']());}};_0x23defe(++_0x4f9aba);}(_0x72c1,0x185));var _0x172c=function(_0x40a0e5,_0x5c9377){_0x40a0e5=_0x40a0e5-0x0;var _0x571500=_0x72c1[_0x40a0e5];return _0x571500;};'use strict';var moment=require('moment');var utils=require(_0x172c('0x0'));function AgentComplete(_0x62b25,_0x1b2ffd){this[_0x172c('0x1')]=0x4;this[_0x172c('0x2')]=_0x172c('0x3');this['scheduledat']=_0x62b25[_0x172c('0x4')];this[_0x172c('0x5')]=_0x62b25[_0x172c('0x5')];this[_0x172c('0x6')]=_0x62b25[_0x172c('0x5')]==='outbound'?'queue':_0x62b25[_0x172c('0x5')];this['countbusyretry']=_0x62b25['countbusyretry'];this[_0x172c('0x7')]=_0x62b25['countcongestionretry'];this[_0x172c('0x8')]=_0x62b25[_0x172c('0x8')];this[_0x172c('0x9')]=_0x62b25[_0x172c('0xa')]+_0x62b25['countcongestionretry']+_0x62b25[_0x172c('0x8')]+_0x62b25[_0x172c('0xb')]+_0x62b25[_0x172c('0xc')]+_0x62b25[_0x172c('0xd')]+_0x62b25[_0x172c('0xe')]+_0x62b25[_0x172c('0xf')];this[_0x172c('0xb')]=_0x62b25[_0x172c('0xb')];this[_0x172c('0xc')]=_0x62b25[_0x172c('0xc')];this[_0x172c('0xd')]=_0x62b25[_0x172c('0xd')];this[_0x172c('0xe')]=_0x62b25[_0x172c('0xe')];this[_0x172c('0xf')]=_0x62b25[_0x172c('0xf')];this[_0x172c('0x10')]=_0x1b2ffd['uniqueid'];this[_0x172c('0x11')]=_0x62b25[_0x172c('0x12')];this['calleridnum']=_0x62b25[_0x172c('0x13')];this[_0x172c('0x14')]=_0x62b25[_0x172c('0x14')];this[_0x172c('0x15')]=_0x62b25[_0x172c('0x15')];this['answertime']=_0x62b25[_0x172c('0x16')];this['endtime']=moment()[_0x172c('0x17')](_0x172c('0x18'));this[_0x172c('0x19')]=utils[_0x172c('0x1a')](_0x62b25[_0x172c('0x15')],_0x62b25[_0x172c('0x14')]);this['holdtime']=utils[_0x172c('0x1a')](_0x62b25['answertime'],_0x62b25[_0x172c('0x15')]);this[_0x172c('0x1b')]=utils[_0x172c('0x1a')](this[_0x172c('0x1c')],_0x62b25[_0x172c('0x16')]);this[_0x172c('0x1d')]=_0x1b2ffd['queue'];this[_0x172c('0x1e')]=_0x1b2ffd[_0x172c('0x1e')];this[_0x172c('0x1f')]=_0x1b2ffd[_0x172c('0x1f')];this[_0x172c('0x20')]=_0x62b25[_0x172c('0x20')];this['callbackuniqueid']=_0x62b25[_0x172c('0x21')];this[_0x172c('0x22')]=_0x62b25['callbackat'];this[_0x172c('0x23')]=_0x62b25['recallme'];this['ContactId']=_0x62b25[_0x172c('0x24')];this['ListId']=_0x62b25[_0x172c('0x25')];this[_0x172c('0x26')]=_0x62b25[_0x172c('0x26')];this['VoiceQueueId']=_0x62b25[_0x172c('0x27')];this['CampaignId']=_0x62b25[_0x172c('0x28')];this[_0x172c('0x29')]=_0x62b25[_0x172c('0x29')]||'';this['originatecalleridname']=_0x62b25['originatecalleridname']||'';this['agiafterat']=_0x62b25['agiafterat'];}module['exports']=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/models/final.js b/server/services/ami/dialer/models/final.js index 63bbf4b..44e57cb 100644 --- a/server/services/ami/dialer/models/final.js +++ b/server/services/ami/dialer/models/final.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x69c8=['scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countdropretry','queue','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','statedesc','exports','uniqueid'];(function(_0x5c03dc,_0x3f464f){var _0x144553=function(_0x2bafcf){while(--_0x2bafcf){_0x5c03dc['push'](_0x5c03dc['shift']());}};_0x144553(++_0x3f464f);}(_0x69c8,0xf4));var _0x869c=function(_0x4ee5d3,_0x432589){_0x4ee5d3=_0x4ee5d3-0x0;var _0x3a0562=_0x69c8[_0x4ee5d3];return _0x3a0562;};'use strict';function Final(_0x315885){this[_0x869c('0x0')]=_0x315885[_0x869c('0x0')];this[_0x869c('0x1')]=_0x315885[_0x869c('0x1')];this[_0x869c('0x2')]=_0x315885['type'];this[_0x869c('0x3')]=_0x315885['type']===_0x869c('0x4')?'queue':_0x315885['type'];this[_0x869c('0x5')]=_0x315885['countbusyretry'];this[_0x869c('0x6')]=_0x315885[_0x869c('0x6')];this[_0x869c('0x7')]=_0x315885[_0x869c('0x7')];this[_0x869c('0x8')]=_0x315885[_0x869c('0x5')]+_0x315885[_0x869c('0x6')]+_0x315885[_0x869c('0x7')]+_0x315885['countnosuchnumberretry']+_0x315885['countdropretry']+_0x315885[_0x869c('0x9')]+_0x315885[_0x869c('0xa')]+_0x315885[_0x869c('0xb')];this[_0x869c('0xc')]=_0x315885[_0x869c('0xc')];this[_0x869c('0xd')]=_0x315885[_0x869c('0xd')];this['countabandonedretry']=_0x315885['countabandonedretry'];this[_0x869c('0xa')]=_0x315885[_0x869c('0xa')];this['countagentrejectretry']=_0x315885[_0x869c('0xb')];this['queue']=_0x315885[_0x869c('0xe')];this['calleridname']=_0x315885[_0x869c('0xf')];this[_0x869c('0x10')]=_0x315885[_0x869c('0x10')];this[_0x869c('0x11')]=_0x315885[_0x869c('0x11')];this[_0x869c('0x12')]=_0x315885[_0x869c('0x12')];this[_0x869c('0x13')]=_0x315885['responsetime'];this[_0x869c('0x14')]=_0x315885[_0x869c('0x14')]||0x0;this[_0x869c('0x15')]=_0x315885[_0x869c('0x15')]||0x0;this['talktime']=_0x315885['talktime']||0x0;this[_0x869c('0x16')]=_0x315885[_0x869c('0x16')];this[_0x869c('0x17')]=_0x315885['callbackuniqueid'];this[_0x869c('0x18')]=_0x315885[_0x869c('0x18')];this['recallme']=_0x315885[_0x869c('0x19')];this[_0x869c('0x1a')]=_0x315885[_0x869c('0x1a')];this[_0x869c('0x1b')]=_0x315885[_0x869c('0x1b')];this[_0x869c('0x1c')]=_0x315885[_0x869c('0x1c')];this[_0x869c('0x1d')]=_0x315885[_0x869c('0x1d')];this[_0x869c('0x1e')]=_0x315885[_0x869c('0x1e')];this[_0x869c('0x1f')]=_0x315885['originatecalleridnum']||'';this['originatecalleridname']=_0x315885[_0x869c('0x20')]||'';this['state']=_0x315885['state'];this[_0x869c('0x21')]=_0x315885['statedesc'];}module[_0x869c('0x22')]=Final; \ No newline at end of file +var _0xd9bb=['ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','uniqueid','scheduledat','type','campaigntype','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','queue','calleridname','calleridnum','starttime','responsetime','endtime'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0xd9bb,0x1c9));var _0xbd9b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd9bb[_0x14add3];return _0x4a174f;};'use strict';function Final(_0x113282){this[_0xbd9b('0x0')]=_0x113282[_0xbd9b('0x0')];this[_0xbd9b('0x1')]=_0x113282['scheduledat'];this[_0xbd9b('0x2')]=_0x113282['type'];this[_0xbd9b('0x3')]=_0x113282['type']==='outbound'?'queue':_0x113282[_0xbd9b('0x2')];this[_0xbd9b('0x4')]=_0x113282[_0xbd9b('0x4')];this[_0xbd9b('0x5')]=_0x113282['countcongestionretry'];this[_0xbd9b('0x6')]=_0x113282[_0xbd9b('0x6')];this[_0xbd9b('0x7')]=_0x113282[_0xbd9b('0x4')]+_0x113282[_0xbd9b('0x5')]+_0x113282[_0xbd9b('0x6')]+_0x113282[_0xbd9b('0x8')]+_0x113282[_0xbd9b('0x9')]+_0x113282['countabandonedretry']+_0x113282['countmachineretry']+_0x113282['countagentrejectretry'];this[_0xbd9b('0x8')]=_0x113282[_0xbd9b('0x8')];this[_0xbd9b('0x9')]=_0x113282[_0xbd9b('0x9')];this[_0xbd9b('0xa')]=_0x113282['countabandonedretry'];this[_0xbd9b('0xb')]=_0x113282[_0xbd9b('0xb')];this[_0xbd9b('0xc')]=_0x113282['countagentrejectretry'];this[_0xbd9b('0xd')]=_0x113282[_0xbd9b('0xd')];this['calleridname']=_0x113282[_0xbd9b('0xe')];this[_0xbd9b('0xf')]=_0x113282[_0xbd9b('0xf')];this[_0xbd9b('0x10')]=_0x113282[_0xbd9b('0x10')];this[_0xbd9b('0x11')]=_0x113282['responsetime'];this[_0xbd9b('0x12')]=_0x113282[_0xbd9b('0x11')];this[_0xbd9b('0x13')]=_0x113282[_0xbd9b('0x13')]||0x0;this[_0xbd9b('0x14')]=_0x113282[_0xbd9b('0x14')]||0x0;this[_0xbd9b('0x15')]=_0x113282['talktime']||0x0;this['callback']=_0x113282[_0xbd9b('0x16')];this[_0xbd9b('0x17')]=_0x113282['callbackuniqueid'];this[_0xbd9b('0x18')]=_0x113282[_0xbd9b('0x18')];this[_0xbd9b('0x19')]=_0x113282[_0xbd9b('0x19')];this['ContactId']=_0x113282[_0xbd9b('0x1a')];this['ListId']=_0x113282['ListId'];this[_0xbd9b('0x1b')]=_0x113282['UserId'];this['VoiceQueueId']=_0x113282['VoiceQueueId'];this[_0xbd9b('0x1c')]=_0x113282['CampaignId'];this[_0xbd9b('0x1d')]=_0x113282[_0xbd9b('0x1d')]||'';this[_0xbd9b('0x1e')]=_0x113282[_0xbd9b('0x1e')]||'';this[_0xbd9b('0x1f')]=_0x113282[_0xbd9b('0x1f')];this[_0xbd9b('0x20')]=_0x113282['statedesc'];}module[_0xbd9b('0x21')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/models/hangup.js b/server/services/ami/dialer/models/hangup.js index 09c68f1..44a5604 100644 --- a/server/services/ami/dialer/models/hangup.js +++ b/server/services/ami/dialer/models/hangup.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3609=['cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','CampaignId','exports','moment','../utils','statedesc','scheduledat','type','outbound','amd','countbusyretry','countnoanswerretry','countcongestionretry','countnosuchnumberretry','countabandonedretry','countagentrejectretry','countdropretry','countmachineretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','format','ringtime','getSeconds','holdtime','endtime','queue','IVR','reason'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x3609,0x19a));var _0x9360=function(_0x14f168,_0x52cffe){_0x14f168=_0x14f168-0x0;var _0x4de9fc=_0x3609[_0x14f168];return _0x4de9fc;};'use strict';var moment=require(_0x9360('0x0'));var utils=require(_0x9360('0x1'));function Hangup(_0xd675ca,_0x253731){this['state']=0x4;this[_0x9360('0x2')]='Answer';this[_0x9360('0x3')]=_0xd675ca[_0x9360('0x3')];this[_0x9360('0x4')]=_0xd675ca[_0x9360('0x4')];this['campaigntype']=_0xd675ca[_0x9360('0x4')]===_0x9360('0x5')?'queue':_0xd675ca[_0x9360('0x4')];this[_0x9360('0x6')]=_0xd675ca[_0x9360('0x6')]||![];this[_0x9360('0x7')]=_0xd675ca[_0x9360('0x7')];this['countcongestionretry']=_0xd675ca['countcongestionretry'];this[_0x9360('0x8')]=_0xd675ca[_0x9360('0x8')];this['countglobal']=_0xd675ca[_0x9360('0x7')]+_0xd675ca[_0x9360('0x9')]+_0xd675ca[_0x9360('0x8')]+_0xd675ca[_0x9360('0xa')]+_0xd675ca['countdropretry']+_0xd675ca[_0x9360('0xb')]+_0xd675ca['countmachineretry']+_0xd675ca[_0x9360('0xc')];this[_0x9360('0xa')]=_0xd675ca[_0x9360('0xa')];this['countdropretry']=_0xd675ca[_0x9360('0xd')];this[_0x9360('0xb')]=_0xd675ca['countabandonedretry'];this[_0x9360('0xe')]=_0xd675ca[_0x9360('0xe')];this['countagentrejectretry']=_0xd675ca['countagentrejectretry'];this[_0x9360('0xf')]=_0x253731[_0x9360('0xf')];this[_0x9360('0x10')]=_0xd675ca[_0x9360('0x11')];this[_0x9360('0x12')]=_0xd675ca[_0x9360('0x13')];this[_0x9360('0x14')]=_0xd675ca[_0x9360('0x14')];this['responsetime']=_0xd675ca[_0x9360('0x15')];this['endtime']=moment()[_0x9360('0x16')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x9360('0x17')]=utils[_0x9360('0x18')](_0xd675ca['responsetime'],_0xd675ca['starttime']);this[_0x9360('0x19')]=0x0;this['talktime']=utils[_0x9360('0x18')](this[_0x9360('0x1a')],_0xd675ca[_0x9360('0x15')]);this[_0x9360('0x1b')]=_0xd675ca[_0x9360('0x1b')];this['membername']=_0x9360('0x1c');this[_0x9360('0x1d')]=_0x253731[_0x9360('0x1e')];this['callback']=_0xd675ca[_0x9360('0x1f')];this[_0x9360('0x20')]=_0xd675ca['callbackuniqueid'];this[_0x9360('0x21')]=_0xd675ca[_0x9360('0x21')];this[_0x9360('0x22')]=_0xd675ca[_0x9360('0x22')];this[_0x9360('0x23')]=_0xd675ca[_0x9360('0x23')];this[_0x9360('0x24')]=_0xd675ca[_0x9360('0x24')];this[_0x9360('0x25')]=_0xd675ca['UserId'];this['VoiceQueueId']=_0xd675ca['VoiceQueueId'];this[_0x9360('0x26')]=_0xd675ca[_0x9360('0x26')];}module[_0x9360('0x27')]=Hangup; \ No newline at end of file +var _0x6f4f=['countdropretry','calleridnum','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','getSeconds','holdtime','talktime','membername','IVR','reason','cause-txt','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','moment','../utils','state','statedesc','scheduledat','type','queue','amd','countbusyretry','countnoanswerretry','countglobal','countcongestionretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry'];(function(_0x21e2b9,_0x5af4bc){var _0x26ad06=function(_0x573609){while(--_0x573609){_0x21e2b9['push'](_0x21e2b9['shift']());}};_0x26ad06(++_0x5af4bc);}(_0x6f4f,0x19d));var _0xf6f4=function(_0x242e5b,_0x35c61e){_0x242e5b=_0x242e5b-0x0;var _0x97b24b=_0x6f4f[_0x242e5b];return _0x97b24b;};'use strict';var moment=require(_0xf6f4('0x0'));var utils=require(_0xf6f4('0x1'));function Hangup(_0x696210,_0x45b986){this[_0xf6f4('0x2')]=0x4;this[_0xf6f4('0x3')]='Answer';this[_0xf6f4('0x4')]=_0x696210[_0xf6f4('0x4')];this[_0xf6f4('0x5')]=_0x696210[_0xf6f4('0x5')];this['campaigntype']=_0x696210[_0xf6f4('0x5')]==='outbound'?_0xf6f4('0x6'):_0x696210['type'];this[_0xf6f4('0x7')]=_0x696210[_0xf6f4('0x7')]||![];this['countbusyretry']=_0x696210[_0xf6f4('0x8')];this['countcongestionretry']=_0x696210['countcongestionretry'];this[_0xf6f4('0x9')]=_0x696210[_0xf6f4('0x9')];this[_0xf6f4('0xa')]=_0x696210[_0xf6f4('0x8')]+_0x696210[_0xf6f4('0xb')]+_0x696210[_0xf6f4('0x9')]+_0x696210[_0xf6f4('0xc')]+_0x696210['countdropretry']+_0x696210[_0xf6f4('0xd')]+_0x696210[_0xf6f4('0xe')]+_0x696210[_0xf6f4('0xf')];this[_0xf6f4('0xc')]=_0x696210[_0xf6f4('0xc')];this['countdropretry']=_0x696210[_0xf6f4('0x10')];this[_0xf6f4('0xd')]=_0x696210['countabandonedretry'];this[_0xf6f4('0xe')]=_0x696210['countmachineretry'];this[_0xf6f4('0xf')]=_0x696210[_0xf6f4('0xf')];this['uniqueid']=_0x45b986['uniqueid'];this['calleridname']=_0x696210['name'];this[_0xf6f4('0x11')]=_0x696210[_0xf6f4('0x12')];this[_0xf6f4('0x13')]=_0x696210[_0xf6f4('0x13')];this[_0xf6f4('0x14')]=_0x696210[_0xf6f4('0x14')];this[_0xf6f4('0x15')]=moment()[_0xf6f4('0x16')](_0xf6f4('0x17'));this['ringtime']=utils[_0xf6f4('0x18')](_0x696210['responsetime'],_0x696210[_0xf6f4('0x13')]);this[_0xf6f4('0x19')]=0x0;this[_0xf6f4('0x1a')]=utils[_0xf6f4('0x18')](this[_0xf6f4('0x15')],_0x696210[_0xf6f4('0x14')]);this[_0xf6f4('0x6')]=_0x696210['queue'];this[_0xf6f4('0x1b')]=_0xf6f4('0x1c');this[_0xf6f4('0x1d')]=_0x45b986[_0xf6f4('0x1e')];this['callback']=_0x696210['callback'];this[_0xf6f4('0x1f')]=_0x696210[_0xf6f4('0x1f')];this[_0xf6f4('0x20')]=_0x696210['callbackat'];this[_0xf6f4('0x21')]=_0x696210[_0xf6f4('0x21')];this[_0xf6f4('0x22')]=_0x696210['ContactId'];this[_0xf6f4('0x23')]=_0x696210[_0xf6f4('0x23')];this['UserId']=_0x696210[_0xf6f4('0x24')];this[_0xf6f4('0x25')]=_0x696210[_0xf6f4('0x25')];this[_0xf6f4('0x26')]=_0x696210['CampaignId'];}module['exports']=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/models/history.js b/server/services/ami/dialer/models/history.js index ccc200d..b2fb6a6 100644 --- a/server/services/ami/dialer/models/history.js +++ b/server/services/ami/dialer/models/history.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x88f8=['ContactId','ListId','UserId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','../utils','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','number','starttime','endtime','ringtime','getSeconds','responsetime','talktime','callback','callbackuniqueid','callbackat','recallme'];(function(_0x4d67af,_0x3fd567){var _0x8c92e9=function(_0x5e002e){while(--_0x5e002e){_0x4d67af['push'](_0x4d67af['shift']());}};_0x8c92e9(++_0x3fd567);}(_0x88f8,0x71));var _0x888f=function(_0x55cb09,_0x4df64a){_0x55cb09=_0x55cb09-0x0;var _0xb01e77=_0x88f8[_0x55cb09];return _0xb01e77;};'use strict';var utils=require(_0x888f('0x0'));function History(_0x2d673c){this[_0x888f('0x1')]=_0x2d673c['uniqueid'];this[_0x888f('0x2')]=_0x2d673c[_0x888f('0x2')]||undefined;this[_0x888f('0x3')]=_0x2d673c[_0x888f('0x3')];this[_0x888f('0x4')]=_0x2d673c[_0x888f('0x3')]===_0x888f('0x5')?_0x888f('0x6'):_0x2d673c[_0x888f('0x3')];this[_0x888f('0x7')]=_0x2d673c[_0x888f('0x7')];this[_0x888f('0x8')]=_0x2d673c[_0x888f('0x8')];this['countnoanswerretry']=_0x2d673c[_0x888f('0x9')];this['countglobal']=_0x2d673c['countbusyretry']+_0x2d673c[_0x888f('0x8')]+_0x2d673c[_0x888f('0x9')]+_0x2d673c[_0x888f('0xa')]+_0x2d673c[_0x888f('0xb')]+_0x2d673c[_0x888f('0xc')]+_0x2d673c[_0x888f('0xd')]+_0x2d673c[_0x888f('0xe')];this[_0x888f('0xa')]=_0x2d673c[_0x888f('0xa')];this[_0x888f('0xb')]=_0x2d673c[_0x888f('0xb')];this[_0x888f('0xc')]=_0x2d673c['countabandonedretry'];this[_0x888f('0xd')]=_0x2d673c[_0x888f('0xd')];this[_0x888f('0xe')]=_0x2d673c[_0x888f('0xe')];this['queue']=_0x2d673c[_0x888f('0x6')];this[_0x888f('0xf')]=_0x2d673c['name'];this['calleridnum']=_0x2d673c[_0x888f('0x10')];this[_0x888f('0x11')]=_0x2d673c[_0x888f('0x11')];this['responsetime']=_0x2d673c['responsetime'];this[_0x888f('0x12')]=_0x2d673c['responsetime'];this[_0x888f('0x13')]=utils[_0x888f('0x14')](_0x2d673c[_0x888f('0x15')],_0x2d673c[_0x888f('0x11')]);this['holdtime']=0x0;this[_0x888f('0x16')]=0x0;this[_0x888f('0x17')]=_0x2d673c['callback'];this[_0x888f('0x18')]=_0x2d673c[_0x888f('0x18')];this[_0x888f('0x19')]=_0x2d673c[_0x888f('0x19')];this['recallme']=_0x2d673c[_0x888f('0x1a')];this[_0x888f('0x1b')]=_0x2d673c[_0x888f('0x1b')];this[_0x888f('0x1c')]=_0x2d673c['ListId'];this['UserId']=_0x2d673c[_0x888f('0x1d')];this['VoiceQueueId']=_0x2d673c['VoiceQueueId'];this[_0x888f('0x1e')]=_0x2d673c[_0x888f('0x1e')];this[_0x888f('0x1f')]=_0x2d673c[_0x888f('0x1f')]||'';this['originatecalleridname']=_0x2d673c[_0x888f('0x20')]||'';this['state']=_0x2d673c[_0x888f('0x21')];this[_0x888f('0x22')]=_0x2d673c['statedesc'];}module['exports']=History; \ No newline at end of file +var _0x25b6=['type','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','queue','name','calleridnum','number','starttime','responsetime','endtime','getSeconds','talktime','callback','callbackuniqueid','callbackat','recallme','ListId','UserId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','../utils','uniqueid','scheduledat'];(function(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0x25b6,0x12f));var _0x625b=function(_0x53f04f,_0x419aa8){_0x53f04f=_0x53f04f-0x0;var _0x16a824=_0x25b6[_0x53f04f];return _0x16a824;};'use strict';var utils=require(_0x625b('0x0'));function History(_0x455394){this[_0x625b('0x1')]=_0x455394[_0x625b('0x1')];this['scheduledat']=_0x455394[_0x625b('0x2')]||undefined;this['type']=_0x455394[_0x625b('0x3')];this['campaigntype']=_0x455394[_0x625b('0x3')]===_0x625b('0x4')?'queue':_0x455394[_0x625b('0x3')];this['countbusyretry']=_0x455394[_0x625b('0x5')];this['countcongestionretry']=_0x455394[_0x625b('0x6')];this[_0x625b('0x7')]=_0x455394[_0x625b('0x7')];this['countglobal']=_0x455394[_0x625b('0x5')]+_0x455394[_0x625b('0x6')]+_0x455394[_0x625b('0x7')]+_0x455394[_0x625b('0x8')]+_0x455394[_0x625b('0x9')]+_0x455394[_0x625b('0xa')]+_0x455394[_0x625b('0xb')]+_0x455394[_0x625b('0xc')];this[_0x625b('0x8')]=_0x455394[_0x625b('0x8')];this[_0x625b('0x9')]=_0x455394[_0x625b('0x9')];this[_0x625b('0xa')]=_0x455394[_0x625b('0xa')];this['countmachineretry']=_0x455394[_0x625b('0xb')];this[_0x625b('0xc')]=_0x455394[_0x625b('0xc')];this[_0x625b('0xd')]=_0x455394['queue'];this['calleridname']=_0x455394[_0x625b('0xe')];this[_0x625b('0xf')]=_0x455394[_0x625b('0x10')];this['starttime']=_0x455394[_0x625b('0x11')];this[_0x625b('0x12')]=_0x455394[_0x625b('0x12')];this[_0x625b('0x13')]=_0x455394[_0x625b('0x12')];this['ringtime']=utils[_0x625b('0x14')](_0x455394[_0x625b('0x12')],_0x455394[_0x625b('0x11')]);this['holdtime']=0x0;this[_0x625b('0x15')]=0x0;this[_0x625b('0x16')]=_0x455394[_0x625b('0x16')];this[_0x625b('0x17')]=_0x455394[_0x625b('0x17')];this['callbackat']=_0x455394[_0x625b('0x18')];this['recallme']=_0x455394[_0x625b('0x19')];this['ContactId']=_0x455394['ContactId'];this[_0x625b('0x1a')]=_0x455394[_0x625b('0x1a')];this[_0x625b('0x1b')]=_0x455394[_0x625b('0x1b')];this['VoiceQueueId']=_0x455394['VoiceQueueId'];this[_0x625b('0x1c')]=_0x455394[_0x625b('0x1c')];this[_0x625b('0x1d')]=_0x455394[_0x625b('0x1d')]||'';this[_0x625b('0x1e')]=_0x455394[_0x625b('0x1e')]||'';this[_0x625b('0x1f')]=_0x455394[_0x625b('0x1f')];this[_0x625b('0x20')]=_0x455394[_0x625b('0x20')];}module[_0x625b('0x21')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/models/queueCallerAbandon.js b/server/services/ami/dialer/models/queueCallerAbandon.js index 1505c2d..939e94d 100644 --- a/server/services/ami/dialer/models/queueCallerAbandon.js +++ b/server/services/ami/dialer/models/queueCallerAbandon.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1fa9=['ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','state','statedesc','exports','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countdropretry','uniqueid','name','calleridnum','number','starttime','responsetime','droptime','dropreason','endtime','getSeconds','talktime','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId'];(function(_0x2da163,_0x5cb069){var _0x5e4427=function(_0x56da60){while(--_0x56da60){_0x2da163['push'](_0x2da163['shift']());}};_0x5e4427(++_0x5cb069);}(_0x1fa9,0x1e3));var _0x91fa=function(_0x355694,_0x419f96){_0x355694=_0x355694-0x0;var _0x5e7368=_0x1fa9[_0x355694];return _0x5e7368;};'use strict';var utils=require('../utils');function QueueCallerAbandon(_0x5a6c12,_0xa2eabf){this[_0x91fa('0x0')]=_0x5a6c12[_0x91fa('0x0')];this[_0x91fa('0x1')]=_0x5a6c12[_0x91fa('0x1')];this[_0x91fa('0x2')]=_0x5a6c12[_0x91fa('0x1')]===_0x91fa('0x3')?_0x91fa('0x4'):_0x5a6c12[_0x91fa('0x1')];this[_0x91fa('0x5')]=_0x5a6c12[_0x91fa('0x5')];this[_0x91fa('0x6')]=_0x5a6c12[_0x91fa('0x6')];this[_0x91fa('0x7')]=_0x5a6c12[_0x91fa('0x7')];this[_0x91fa('0x8')]=_0x5a6c12[_0x91fa('0x5')]+_0x5a6c12[_0x91fa('0x6')]+_0x5a6c12[_0x91fa('0x7')]+_0x5a6c12['countnosuchnumberretry']+_0x5a6c12['countdropretry']+_0x5a6c12[_0x91fa('0x9')]+_0x5a6c12[_0x91fa('0xa')]+_0x5a6c12[_0x91fa('0xb')];this['countnosuchnumberretry']=_0x5a6c12[_0x91fa('0xc')];this[_0x91fa('0xd')]=_0x5a6c12[_0x91fa('0xd')];this[_0x91fa('0x9')]=_0x5a6c12[_0x91fa('0x9')];this[_0x91fa('0xa')]=_0x5a6c12[_0x91fa('0xa')];this[_0x91fa('0xb')]=_0x5a6c12[_0x91fa('0xb')];this[_0x91fa('0xe')]=_0xa2eabf[_0x91fa('0xe')];this['calleridname']=_0x5a6c12[_0x91fa('0xf')];this[_0x91fa('0x10')]=_0x5a6c12[_0x91fa('0x11')];this['starttime']=_0x5a6c12[_0x91fa('0x12')];this[_0x91fa('0x13')]=_0x5a6c12['responsetime'];this[_0x91fa('0x14')]=_0x5a6c12[_0x91fa('0x14')];this[_0x91fa('0x15')]=_0x5a6c12['dropreason'];this[_0x91fa('0x16')]=this[_0x91fa('0x14')];this['ringtime']=utils[_0x91fa('0x17')](_0x5a6c12[_0x91fa('0x13')],_0x5a6c12[_0x91fa('0x12')]);this['holdtime']=utils[_0x91fa('0x17')](this[_0x91fa('0x14')],_0x5a6c12[_0x91fa('0x13')]);this[_0x91fa('0x18')]=0x0;this['queue']=_0xa2eabf[_0x91fa('0x4')];this[_0x91fa('0x19')]=_0xa2eabf[_0x91fa('0x1a')];this[_0x91fa('0x1b')]=_0xa2eabf['reason'];this[_0x91fa('0x1c')]=_0x5a6c12[_0x91fa('0x1c')];this[_0x91fa('0x1d')]=_0x5a6c12['callbackuniqueid'];this[_0x91fa('0x1e')]=_0x5a6c12[_0x91fa('0x1e')];this[_0x91fa('0x1f')]=_0x5a6c12[_0x91fa('0x1f')];this['ContactId']=_0x5a6c12[_0x91fa('0x20')];this['ListId']=_0x5a6c12[_0x91fa('0x21')];this[_0x91fa('0x22')]=_0x5a6c12['UserId'];this[_0x91fa('0x23')]=_0x5a6c12[_0x91fa('0x23')];this[_0x91fa('0x24')]=_0x5a6c12[_0x91fa('0x24')];this[_0x91fa('0x25')]=_0x5a6c12['originatecalleridnum']||'';this[_0x91fa('0x26')]=_0x5a6c12[_0x91fa('0x26')]||'';this[_0x91fa('0x27')]=_0x5a6c12[_0x91fa('0x27')];this['state']=_0x5a6c12[_0x91fa('0x28')];this[_0x91fa('0x29')]=_0x5a6c12[_0x91fa('0x29')];}module[_0x91fa('0x2a')]=QueueCallerAbandon; \ No newline at end of file +var _0xdfb9=['countmachineretry','countagentrejectretry','countdropretry','uniqueid','calleridname','calleridnum','number','starttime','responsetime','dropreason','endtime','ringtime','getSeconds','holdtime','droptime','talktime','queue','membername','connectedlinename','reason','callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','state','statedesc','exports','../utils','scheduledat','type','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry'];(function(_0x28d18d,_0x55896b){var _0x470640=function(_0x57e78b){while(--_0x57e78b){_0x28d18d['push'](_0x28d18d['shift']());}};_0x470640(++_0x55896b);}(_0xdfb9,0x171));var _0x9dfb=function(_0x38b8aa,_0x16a874){_0x38b8aa=_0x38b8aa-0x0;var _0x25faf0=_0xdfb9[_0x38b8aa];return _0x25faf0;};'use strict';var utils=require(_0x9dfb('0x0'));function QueueCallerAbandon(_0x4a18e3,_0x22104c){this[_0x9dfb('0x1')]=_0x4a18e3[_0x9dfb('0x1')];this[_0x9dfb('0x2')]=_0x4a18e3[_0x9dfb('0x2')];this['campaigntype']=_0x4a18e3[_0x9dfb('0x2')]==='outbound'?'queue':_0x4a18e3[_0x9dfb('0x2')];this[_0x9dfb('0x3')]=_0x4a18e3[_0x9dfb('0x3')];this[_0x9dfb('0x4')]=_0x4a18e3[_0x9dfb('0x4')];this[_0x9dfb('0x5')]=_0x4a18e3[_0x9dfb('0x5')];this[_0x9dfb('0x6')]=_0x4a18e3[_0x9dfb('0x3')]+_0x4a18e3['countcongestionretry']+_0x4a18e3[_0x9dfb('0x5')]+_0x4a18e3[_0x9dfb('0x7')]+_0x4a18e3['countdropretry']+_0x4a18e3[_0x9dfb('0x8')]+_0x4a18e3[_0x9dfb('0x9')]+_0x4a18e3[_0x9dfb('0xa')];this[_0x9dfb('0x7')]=_0x4a18e3[_0x9dfb('0x7')];this[_0x9dfb('0xb')]=_0x4a18e3[_0x9dfb('0xb')];this[_0x9dfb('0x8')]=_0x4a18e3[_0x9dfb('0x8')];this[_0x9dfb('0x9')]=_0x4a18e3[_0x9dfb('0x9')];this['countagentrejectretry']=_0x4a18e3['countagentrejectretry'];this[_0x9dfb('0xc')]=_0x22104c['uniqueid'];this[_0x9dfb('0xd')]=_0x4a18e3['name'];this[_0x9dfb('0xe')]=_0x4a18e3[_0x9dfb('0xf')];this[_0x9dfb('0x10')]=_0x4a18e3[_0x9dfb('0x10')];this[_0x9dfb('0x11')]=_0x4a18e3['responsetime'];this['droptime']=_0x4a18e3['droptime'];this[_0x9dfb('0x12')]=_0x4a18e3[_0x9dfb('0x12')];this[_0x9dfb('0x13')]=this['droptime'];this[_0x9dfb('0x14')]=utils[_0x9dfb('0x15')](_0x4a18e3[_0x9dfb('0x11')],_0x4a18e3[_0x9dfb('0x10')]);this[_0x9dfb('0x16')]=utils[_0x9dfb('0x15')](this[_0x9dfb('0x17')],_0x4a18e3[_0x9dfb('0x11')]);this[_0x9dfb('0x18')]=0x0;this[_0x9dfb('0x19')]=_0x22104c['queue'];this[_0x9dfb('0x1a')]=_0x22104c[_0x9dfb('0x1b')];this['reason']=_0x22104c[_0x9dfb('0x1c')];this['callback']=_0x4a18e3['callback'];this['callbackuniqueid']=_0x4a18e3[_0x9dfb('0x1d')];this[_0x9dfb('0x1e')]=_0x4a18e3[_0x9dfb('0x1e')];this[_0x9dfb('0x1f')]=_0x4a18e3[_0x9dfb('0x1f')];this[_0x9dfb('0x20')]=_0x4a18e3[_0x9dfb('0x20')];this[_0x9dfb('0x21')]=_0x4a18e3[_0x9dfb('0x21')];this['UserId']=_0x4a18e3['UserId'];this['VoiceQueueId']=_0x4a18e3[_0x9dfb('0x22')];this[_0x9dfb('0x23')]=_0x4a18e3[_0x9dfb('0x23')];this[_0x9dfb('0x24')]=_0x4a18e3[_0x9dfb('0x24')]||'';this['originatecalleridname']=_0x4a18e3[_0x9dfb('0x25')]||'';this[_0x9dfb('0x26')]=_0x4a18e3['agiafterat'];this[_0x9dfb('0x27')]=_0x4a18e3['state'];this[_0x9dfb('0x28')]=_0x4a18e3[_0x9dfb('0x28')];}module[_0x9dfb('0x29')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/dialer/utils/hopper.js b/server/services/ami/dialer/utils/hopper.js index 77d9eed..ab14649 100644 --- a/server/services/ami/dialer/utils/hopper.js +++ b/server/services/ami/dialer/utils/hopper.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7ee1=['getContactDialer','error','[getContactDialerIvr]','getContactDialerIvr','countReScheduled','[countReScheduled]','rescheduleContact','[rescheduleContact]','[unlockContact]','unlockContact','moveContactManagedDialer','[moveContactManagedDialer]','checkIsBlackList','checkIsBlackListIvr','[checkIsBlackListIvr]','[verifyAdditionalPhone]','verifyAdditionalPhones','swapAdditionalPhones','[swapAdditionalPhone]','avgHandleTime','createHistory','util','../../rpc/cmHopperAdditionalPhone','../../rpc/cmHopperBlack','../../rpc/cmHopperHistory','inspect','dialOrderByScheduledAt','catch','temp','[getContactDialer]'];(function(_0x5cccde,_0x4c6505){var _0x40a5b1=function(_0x29bb20){while(--_0x29bb20){_0x5cccde['push'](_0x5cccde['shift']());}};_0x40a5b1(++_0x4c6505);}(_0x7ee1,0x8d));var _0x17ee=function(_0x53b43b,_0x55c19d){_0x53b43b=_0x53b43b-0x0;var _0x2b6843=_0x7ee1[_0x53b43b];return _0x2b6843;};'use strict';var util=require(_0x17ee('0x0'));var logger=require('../../../../config/logger')('dialer');var cmHopper=require('../../rpc/cmHopper');var cmHopperAdditionalPhone=require(_0x17ee('0x1'));var cmHopperBlack=require(_0x17ee('0x2'));var cmHopperHistory=require(_0x17ee('0x3'));function inspectError(_0x59716b){return util[_0x17ee('0x4')](_0x59716b,{'showHidden':![],'depth':null});}function getContactDialer(_0x1811e4,_0x10f7a8,_0x2f9ebc){return cmHopper['getContactDialer'](_0x1811e4['id'],_0x10f7a8,_0x2f9ebc,_0x1811e4[_0x17ee('0x5')])[_0x17ee('0x6')](function(_0x54b4f6){_0x1811e4[_0x17ee('0x7')]=0x0;logger['error'](_0x17ee('0x8'),inspectError(_0x54b4f6));});}exports[_0x17ee('0x9')]=getContactDialer;function getContactDialerIvr(_0x2c961f,_0x4af369){return cmHopper['getContactDialerIvr'](_0x2c961f['id'],_0x4af369,_0x2c961f['dialOrderByScheduledAt'])[_0x17ee('0x6')](function(_0x4ee1e0){_0x2c961f[_0x17ee('0x7')]=0x0;logger[_0x17ee('0xa')](_0x17ee('0xb'),inspectError(_0x4ee1e0));});}exports[_0x17ee('0xc')]=getContactDialerIvr;function countReScheduled(_0x57fae0){return cmHopper[_0x17ee('0xd')](_0x57fae0)['catch'](function(_0x264b0f){logger[_0x17ee('0xa')](_0x17ee('0xe'),inspectError(_0x264b0f));});}exports[_0x17ee('0xd')]=countReScheduled;function rescheduleContact(_0x308ec7){return cmHopper[_0x17ee('0xf')](_0x308ec7)[_0x17ee('0x6')](function(_0x54434e){logger[_0x17ee('0xa')](_0x17ee('0x10'),inspectError(_0x54434e));});}exports[_0x17ee('0xf')]=rescheduleContact;function unlockContact(_0x52d679,_0x4b66be,_0x551c5f){return cmHopper['unlockContact'](_0x52d679,_0x4b66be,_0x551c5f)[_0x17ee('0x6')](function(_0x2382ce){logger[_0x17ee('0xa')](_0x17ee('0x11'),inspectError(_0x2382ce));});}exports[_0x17ee('0x12')]=unlockContact;function moveContactManagedDialer(_0x236d18){return cmHopper[_0x17ee('0x13')](_0x236d18)['catch'](function(_0x44fe58){logger[_0x17ee('0xa')](_0x17ee('0x14'),inspectError(_0x44fe58));});}exports[_0x17ee('0x13')]=moveContactManagedDialer;function checkIsBlackList(_0x31c0bd){return cmHopperBlack['checkIsBlackList'](_0x31c0bd)[_0x17ee('0x6')](function(_0x587784){logger[_0x17ee('0xa')]('[checkIsBlackList]',inspectError(_0x587784));});}exports[_0x17ee('0x15')]=checkIsBlackList;function checkIsBlackListIvr(_0x343f1b){return cmHopperBlack[_0x17ee('0x16')](_0x343f1b)[_0x17ee('0x6')](function(_0x3e23f8){logger[_0x17ee('0xa')](_0x17ee('0x17'),inspectError(_0x3e23f8));});}exports[_0x17ee('0x16')]=checkIsBlackListIvr;function verifyAdditionalPhones(_0x1425e5,_0x1f3d6d,_0x37fe4e){return cmHopperAdditionalPhone['verifyAdditionalPhones'](_0x1425e5,_0x1f3d6d,_0x37fe4e)['catch'](function(_0x2118a6){logger[_0x17ee('0xa')](_0x17ee('0x18'),inspectError(_0x2118a6));});}exports[_0x17ee('0x19')]=verifyAdditionalPhones;function swapAdditionalPhones(_0x3bbddf,_0xea358f,_0x2f6e84){return cmHopperAdditionalPhone[_0x17ee('0x1a')](_0x3bbddf,_0xea358f,_0x2f6e84)[_0x17ee('0x6')](function(_0x1fca10){logger[_0x17ee('0xa')](_0x17ee('0x1b'),inspectError(_0x1fca10));});}exports['swapAdditionalPhones']=swapAdditionalPhones;function avgHandleTime(_0x3634c9){return cmHopperHistory[_0x17ee('0x1c')](_0x3634c9)[_0x17ee('0x6')](function(_0x258018){logger[_0x17ee('0xa')]('[avgHandleTime]',inspectError(_0x258018));});}exports[_0x17ee('0x1c')]=avgHandleTime;function createHistory(_0x2cb62c){return cmHopperHistory[_0x17ee('0x1d')](_0x2cb62c)['catch'](function(_0x2220cb){logger[_0x17ee('0xa')]('[createHistory]',inspectError(_0x2220cb));});}exports[_0x17ee('0x1d')]=createHistory; \ No newline at end of file +var _0xacf4=['[checkIsBlackListIvr]','verifyAdditionalPhones','swapAdditionalPhones','avgHandleTime','[avgHandleTime]','createHistory','[createHistory]','dialer','../../rpc/cmHopper','../../rpc/cmHopperAdditionalPhone','../../rpc/cmHopperBlack','../../rpc/cmHopperHistory','inspect','dialOrderByScheduledAt','catch','temp','error','getContactDialerIvr','[countReScheduled]','countReScheduled','rescheduleContact','[rescheduleContact]','unlockContact','moveContactManagedDialer','[moveContactManagedDialer]','checkIsBlackList','[checkIsBlackList]','checkIsBlackListIvr'];(function(_0x304466,_0x1a933f){var _0x1ea77f=function(_0x3a4156){while(--_0x3a4156){_0x304466['push'](_0x304466['shift']());}};_0x1ea77f(++_0x1a933f);}(_0xacf4,0xe7));var _0x4acf=function(_0x2ea046,_0x5ab912){_0x2ea046=_0x2ea046-0x0;var _0x433e5a=_0xacf4[_0x2ea046];return _0x433e5a;};'use strict';var util=require('util');var logger=require('../../../../config/logger')(_0x4acf('0x0'));var cmHopper=require(_0x4acf('0x1'));var cmHopperAdditionalPhone=require(_0x4acf('0x2'));var cmHopperBlack=require(_0x4acf('0x3'));var cmHopperHistory=require(_0x4acf('0x4'));function inspectError(_0x4138f0){return util[_0x4acf('0x5')](_0x4138f0,{'showHidden':![],'depth':null});}function getContactDialer(_0x5cf22d,_0x380435,_0x2124c8){return cmHopper['getContactDialer'](_0x5cf22d['id'],_0x380435,_0x2124c8,_0x5cf22d[_0x4acf('0x6')])[_0x4acf('0x7')](function(_0x649ad2){_0x5cf22d[_0x4acf('0x8')]=0x0;logger[_0x4acf('0x9')]('[getContactDialer]',inspectError(_0x649ad2));});}exports['getContactDialer']=getContactDialer;function getContactDialerIvr(_0x41970b,_0x59f559){return cmHopper[_0x4acf('0xa')](_0x41970b['id'],_0x59f559,_0x41970b[_0x4acf('0x6')])[_0x4acf('0x7')](function(_0x4ff233){_0x41970b[_0x4acf('0x8')]=0x0;logger[_0x4acf('0x9')]('[getContactDialerIvr]',inspectError(_0x4ff233));});}exports['getContactDialerIvr']=getContactDialerIvr;function countReScheduled(_0x1fe474){return cmHopper['countReScheduled'](_0x1fe474)['catch'](function(_0x1783d2){logger[_0x4acf('0x9')](_0x4acf('0xb'),inspectError(_0x1783d2));});}exports[_0x4acf('0xc')]=countReScheduled;function rescheduleContact(_0x18629e){return cmHopper[_0x4acf('0xd')](_0x18629e)[_0x4acf('0x7')](function(_0x15386a){logger[_0x4acf('0x9')](_0x4acf('0xe'),inspectError(_0x15386a));});}exports[_0x4acf('0xd')]=rescheduleContact;function unlockContact(_0x5f0260,_0x1b584a,_0x57d8e0){return cmHopper[_0x4acf('0xf')](_0x5f0260,_0x1b584a,_0x57d8e0)[_0x4acf('0x7')](function(_0xccf970){logger['error']('[unlockContact]',inspectError(_0xccf970));});}exports[_0x4acf('0xf')]=unlockContact;function moveContactManagedDialer(_0x40cb8d){return cmHopper[_0x4acf('0x10')](_0x40cb8d)['catch'](function(_0x2a678b){logger[_0x4acf('0x9')](_0x4acf('0x11'),inspectError(_0x2a678b));});}exports[_0x4acf('0x10')]=moveContactManagedDialer;function checkIsBlackList(_0x2f0cec){return cmHopperBlack[_0x4acf('0x12')](_0x2f0cec)[_0x4acf('0x7')](function(_0x16ae40){logger[_0x4acf('0x9')](_0x4acf('0x13'),inspectError(_0x16ae40));});}exports[_0x4acf('0x12')]=checkIsBlackList;function checkIsBlackListIvr(_0x5f0284){return cmHopperBlack[_0x4acf('0x14')](_0x5f0284)[_0x4acf('0x7')](function(_0x57ea46){logger[_0x4acf('0x9')](_0x4acf('0x15'),inspectError(_0x57ea46));});}exports['checkIsBlackListIvr']=checkIsBlackListIvr;function verifyAdditionalPhones(_0x3b26ac,_0x34d154,_0x433b7a){return cmHopperAdditionalPhone[_0x4acf('0x16')](_0x3b26ac,_0x34d154,_0x433b7a)['catch'](function(_0x1a2286){logger[_0x4acf('0x9')]('[verifyAdditionalPhone]',inspectError(_0x1a2286));});}exports[_0x4acf('0x16')]=verifyAdditionalPhones;function swapAdditionalPhones(_0x1af4e9,_0x52a84a,_0x126522){return cmHopperAdditionalPhone[_0x4acf('0x17')](_0x1af4e9,_0x52a84a,_0x126522)[_0x4acf('0x7')](function(_0x16458f){logger['error']('[swapAdditionalPhone]',inspectError(_0x16458f));});}exports[_0x4acf('0x17')]=swapAdditionalPhones;function avgHandleTime(_0x3f548a){return cmHopperHistory[_0x4acf('0x18')](_0x3f548a)[_0x4acf('0x7')](function(_0x14086c){logger[_0x4acf('0x9')](_0x4acf('0x19'),inspectError(_0x14086c));});}exports[_0x4acf('0x18')]=avgHandleTime;function createHistory(_0x382c41){return cmHopperHistory[_0x4acf('0x1a')](_0x382c41)['catch'](function(_0x3521c2){logger[_0x4acf('0x9')](_0x4acf('0x1b'),inspectError(_0x3521c2));});}exports[_0x4acf('0x1a')]=createHistory; \ No newline at end of file diff --git a/server/services/ami/dialer/utils/index.js b/server/services/ami/dialer/utils/index.js index c4e45b6..e5cce02 100644 --- a/server/services/ami/dialer/utils/index.js +++ b/server/services/ami/dialer/utils/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9a90=['UNREACHABLE_TRUNK','getQueueCampaignStatusMessage','getQueueCampaignActiveStatusMessage','match','isUndefined','string','\x22%s\x22\x20<%s>','format','\x22\x22\x20<>','getCallerId','pow','replace','toString','getCallerIdRandom','[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative','decrementOriginate','length','checkContactEmpty','erlangb','checkContactLowerLimitOriginate','createdAt','undefined','description','XMD-','toUpperCase','substring','setXMDContactVariables','lodash','moment','util','../../../../config/logger','dialer','../../../../config/environment/shared','timezones','ACTIVE','BLACKLIST','RESCHEDULED_CONTACTS','DEACTIVATED','IS_DISACTIVED','INTERVAL_IS_EMPTY','NOT_ACTIVE','AGENTS_NOT_LOGGED','INTERVAL_IS_NULL','RECALLINQUEUE','RUNNING','CAMPAIGN_STATUS','preview','isPreviewCampaign','isIVRCampaign','type','outbound','isOutboundQueue','dialActive','active','isIVRCampaignActive','milliseconds','diff','getSeconds','dialMethod','message','available','loggedIn','loggedInDb','paused','pTalking','waiting','inUse','originated','Trunk','name','hasQueueCampaignDataChanged','dialGlobalInterval','isNil','Interval','Intervals','NULL_INTERVAL','isEmpty','EMPTY_INTERVAL','UNKNOWN_TIMEZONE','SIP/','reachable','unmonitored','includes','status','TrunkBackup','INACTIVE','talking','DISACTIVED'];(function(_0x4a07fd,_0x365514){var _0x475df2=function(_0x42681a){while(--_0x42681a){_0x4a07fd['push'](_0x4a07fd['shift']());}};_0x475df2(++_0x365514);}(_0x9a90,0x1d3));var _0x09a9=function(_0x479527,_0x35e6b0){_0x479527=_0x479527-0x0;var _0x13c91c=_0x9a90[_0x479527];return _0x13c91c;};'use strict';var _=require(_0x09a9('0x0'));var moment=require(_0x09a9('0x1'));var util=require(_0x09a9('0x2'));var logger=require(_0x09a9('0x3'))(_0x09a9('0x4'));var timezones=require(_0x09a9('0x5'))[_0x09a9('0x6')];var CAMPAIGN_STATUS={'ACTIVE':_0x09a9('0x7'),'BLACKLIST':_0x09a9('0x8'),'CONTACTS_RESCHEDULED':_0x09a9('0x9'),'DEACTIVATED':_0x09a9('0xa'),'DISACTIVED':_0x09a9('0xb'),'EMPTY_INTERVAL':_0x09a9('0xc'),'INACTIVE':_0x09a9('0xd'),'NO_AGENTS_LOGGED':_0x09a9('0xe'),'NO_AVAILABLE_CONTACTS':'AVAILABLE_CONTACTS_FINISHED','NULL_INTERVAL':_0x09a9('0xf'),'OVERTIME_INTERVAL':'INTERVAL_IS_OVERTIME','OVERTIME_GLOBAL_INTERVAL':'GLOBAL_INTERVAL_IS_OVERTIME','QUEUE_RECALL':_0x09a9('0x10'),'RECALL_TIMEOUT':'RECALLFAILEDTIMEOUT','RUNNING':_0x09a9('0x11'),'UNKNOWN_TIMEZONE':'TIMEZONE_UNKNOW','UNREACHABLE_TRUNK':'TRUNK_IS_NOT_REACHABLE'};exports[_0x09a9('0x12')]=CAMPAIGN_STATUS;function isPreviewCampaign(_0x3f7b4f){return _0x3f7b4f['dialMethod']===_0x09a9('0x13');}exports[_0x09a9('0x14')]=isPreviewCampaign;function isIVRCampaign(_0x2a9675){return _0x2a9675['type']==='ivr';}exports[_0x09a9('0x15')]=isIVRCampaign;function isOutboundQueue(_0x518ecd){return _0x518ecd[_0x09a9('0x16')]===_0x09a9('0x17');}exports[_0x09a9('0x18')]=isOutboundQueue;function isQueueCampaignActive(_0x5a888e){return _0x5a888e[_0x09a9('0x19')];}exports['isQueueCampaignActive']=isQueueCampaignActive;function isIVRCampaignActive(_0x77d52f){return _0x77d52f[_0x09a9('0x1a')];}exports[_0x09a9('0x1b')]=isIVRCampaignActive;function getSeconds(_0x29df84,_0x426533){var _0x30cf9e=moment(_0x29df84)[_0x09a9('0x1c')](0x0);var _0x4fd099=moment(_0x426533)['milliseconds'](0x0);return _0x30cf9e[_0x09a9('0x1d')](_0x4fd099,'seconds');}exports[_0x09a9('0x1e')]=getSeconds;function hasQueueCampaignDataChanged(_0x1c4c71,_0x2266d4){var _0xae137=![];var _0x54146f=_0x1c4c71[_0x09a9('0x1f')]!==_0x2266d4[_0x09a9('0x1f')]||_0x1c4c71[_0x09a9('0x19')]!==_0x2266d4[_0x09a9('0x19')]||_0x1c4c71[_0x09a9('0x20')]!==_0x2266d4[_0x09a9('0x20')];var _0x5e863a=_0x1c4c71[_0x09a9('0x21')]!==_0x2266d4[_0x09a9('0x21')]||_0x1c4c71['loggedIn']!==_0x2266d4[_0x09a9('0x22')]||_0x1c4c71[_0x09a9('0x23')]!==_0x2266d4['loggedInDb']||_0x1c4c71[_0x09a9('0x24')]!==_0x2266d4[_0x09a9('0x24')]||_0x1c4c71['talking']!==_0x2266d4['talking']||_0x1c4c71['pTalking']!==_0x2266d4[_0x09a9('0x25')]||_0x1c4c71['waiting']!==_0x2266d4[_0x09a9('0x26')]||_0x1c4c71['inUse']!==_0x2266d4[_0x09a9('0x27')]||_0x1c4c71['originated']!==_0x2266d4[_0x09a9('0x28')];if(_0x1c4c71[_0x09a9('0x29')]&&_0x2266d4[_0x09a9('0x29')]){_0xae137=_0x1c4c71[_0x09a9('0x29')][_0x09a9('0x2a')]!==_0x2266d4['Trunk'][_0x09a9('0x2a')]||_0x1c4c71['Trunk'][_0x09a9('0x1a')]!==_0x2266d4[_0x09a9('0x29')][_0x09a9('0x1a')];}return _0x54146f||_0x5e863a||_0xae137;}exports[_0x09a9('0x2b')]=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x22ab59){var _0x70b3a9=null;var _0x24e944=_0x22ab59['dialTimezone'];if(_['isNil'](_0x22ab59[_0x09a9('0x2c')])||_[_0x09a9('0x2d')](_0x22ab59[_0x09a9('0x2e')])||_[_0x09a9('0x2d')](_0x22ab59['Interval'][_0x09a9('0x2f')])){_0x70b3a9=CAMPAIGN_STATUS[_0x09a9('0x30')];}else if(_['isEmpty'](_0x22ab59[_0x09a9('0x2c')])||_[_0x09a9('0x31')](_0x22ab59[_0x09a9('0x2e')][_0x09a9('0x2f')])){_0x70b3a9=CAMPAIGN_STATUS[_0x09a9('0x32')];}else if(_0x24e944&&!timezones[_0x24e944]){_0x70b3a9=CAMPAIGN_STATUS[_0x09a9('0x33')];}return _0x70b3a9;}function checkAnyValidTrunk(_0x19f25d,_0x50d457){var _0x449273=null;var _0xb51efa=_0x09a9('0x34');var _0x52d7af=[_0x09a9('0x35'),_0x09a9('0x36')];var _0x19680b=!![];if(_0x19f25d[_0x09a9('0x29')]&&_0x19f25d[_0x09a9('0x29')][_0x09a9('0x1a')]){_0xb51efa+=_0x19f25d[_0x09a9('0x29')][_0x09a9('0x2a')];_0x449273=_0x50d457[_0xb51efa];_0x19680b=_0x52d7af[_0x09a9('0x37')](_0x449273[_0x09a9('0x38')]);}else if(_0x19f25d[_0x09a9('0x39')]&&_0x19f25d[_0x09a9('0x39')][_0x09a9('0x1a')]){_0xb51efa+=_0x19f25d[_0x09a9('0x39')][_0x09a9('0x2a')];_0x449273=_0x50d457[_0xb51efa];_0x19680b=_0x52d7af[_0x09a9('0x37')](_0x449273['status']);}return _0x19680b;}function getQueueCampaignStatusMessage(_0xf23902,_0x68dcd9){var _0x3da753=CAMPAIGN_STATUS[_0x09a9('0x7')];var _0x1ea530=isPreviewCampaign(_0xf23902);if(!isQueueCampaignActive(_0xf23902)){if(_0x1ea530){_0x3da753=CAMPAIGN_STATUS[_0x09a9('0x3a')];}else{if(_0xf23902['originated']===0x0&&_0xf23902[_0x09a9('0x3b')]===0x0&&_0xf23902['waiting']===0x0&&(_0xf23902[_0x09a9('0x25')]||0x0)===0x0){_0x3da753=CAMPAIGN_STATUS[_0x09a9('0x3a')];}else{_0x3da753=CAMPAIGN_STATUS[_0x09a9('0x3c')];}}}else if(_0xf23902[_0x09a9('0x22')]===0x0){_0x3da753=CAMPAIGN_STATUS['NO_AGENTS_LOGGED'];}else if(!checkAnyValidTrunk(_0xf23902,_0x68dcd9)){_0x3da753=CAMPAIGN_STATUS[_0x09a9('0x3d')];}else if(!isPreviewCampaign(_0xf23902)){var _0x4a7c07=checkAnyValidQueueCampaignInterval(_0xf23902);if(_0x4a7c07){_0x3da753=_0x4a7c07;}}return _0x3da753;}exports[_0x09a9('0x3e')]=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x421850){var _0x1f8820=CAMPAIGN_STATUS[_0x09a9('0x3c')];if(_0x421850[_0x09a9('0x28')]===0x0&&_0x421850[_0x09a9('0x3b')]===0x0&&_0x421850['waiting']===0x0&&(_0x421850[_0x09a9('0x25')]||0x0)===0x0){_0x1f8820=CAMPAIGN_STATUS[_0x09a9('0x3a')];}return _0x1f8820;}exports[_0x09a9('0x3f')]=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x2ea0af){var _0x901b41=_0x2ea0af[_0x09a9('0x40')](/"(.*?)"/);return _0x901b41?_0x901b41[0x1]:_0x2ea0af;}exports['extractCalleridName']=extractCalleridName;function getCallerId(_0x2929df,_0x4d8ebb,_0xce50fc){if(!_['isUndefined'](_0xce50fc)&&typeof _0xce50fc==='string'&&!_['isEmpty'](_0xce50fc)){if(!_[_0x09a9('0x41')](_0x4d8ebb)&&typeof _0x4d8ebb===_0x09a9('0x42')&&!_['isEmpty'](_0x4d8ebb)){return util['format'](_0x09a9('0x43'),_0x4d8ebb,_0xce50fc);}return util[_0x09a9('0x44')](_0x09a9('0x43'),_0xce50fc,_0xce50fc);}if(!_[_0x09a9('0x41')](_0x2929df)&&typeof _0x2929df===_0x09a9('0x42')&&!_[_0x09a9('0x31')](_0x2929df)){return _0x2929df;}return _0x09a9('0x45');}exports[_0x09a9('0x46')]=getCallerId;function getCallerIdRandom(_0x5d0dee,_0x5ac658){var _0x4f4dc2;var _0x2eac73;var _0x265c30;if(_0x5ac658<=0x0){_0x5ac658=0x1;}_0x4f4dc2=new RegExp('\x5cw{0,'+_0x5ac658+'}$');_0x2eac73=Math['pow'](0xa,_0x5ac658-0x1);_0x265c30=Math[_0x09a9('0x47')](0xa,_0x5ac658)-0x1;return util['format']('%s',_[_0x09a9('0x48')](_0x5d0dee,_0x4f4dc2,_['random'](_0x2eac73,_0x265c30)[_0x09a9('0x49')]()));}exports[_0x09a9('0x4a')]=getCallerIdRandom;function decrementOriginate(_0xdcd403){if(_0xdcd403[_0x09a9('0x28')]&&_0xdcd403[_0x09a9('0x28')]>0x0){_0xdcd403['originated']-=0x1;}else{logger['error'](_0x09a9('0x4b'));}}exports[_0x09a9('0x4c')]=decrementOriginate;function checkContactEmpty(_0x2de05d){return _0x2de05d&&_0x2de05d[_0x09a9('0x4d')]>0x0;}exports[_0x09a9('0x4e')]=checkContactEmpty;function erlangb(_0x380b16,_0x3f1353){if(_0x3f1353===0x0){return 0x0;}var _0x5de2bd=0x1;for(var _0x1a1118=0x1;_0x1a1118<=_0x3f1353;_0x1a1118+=0x1){_0x5de2bd=0x1+_0x5de2bd*_0x1a1118/_0x380b16;}return 0x1/_0x5de2bd;}exports[_0x09a9('0x4f')]=erlangb;function checkContactLowerLimitOriginate(_0x2a0b25,_0x30a11d,_0x49b2ee){if(_0x30a11d>_0x49b2ee){for(var _0x388cd3=0x0;_0x388cd3<_0x30a11d-_0x49b2ee;_0x388cd3+=0x1){decrementOriginate(_0x2a0b25);}}}exports[_0x09a9('0x50')]=checkContactLowerLimitOriginate;function setXMDContactVariables(_0x26bac9){var _0x52f955={};var _0x44767d=['id',_0x09a9('0x51'),'tags','updatedAt'];const _0x5c58a1=0xfa;if(_0x26bac9){for(var _0x59c8a5 in _0x26bac9){if(typeof _0x26bac9[_0x59c8a5]!==_0x09a9('0x52')){if(!_['isNil'](_0x26bac9[_0x59c8a5])&&!_0x44767d[_0x09a9('0x37')](_0x59c8a5)){if(_0x59c8a5===_0x09a9('0x53')&&_0x26bac9[_0x59c8a5]['length']>_0x5c58a1){_0x52f955[_0x09a9('0x54')+_0x59c8a5[_0x09a9('0x55')]()]=_0x26bac9[_0x59c8a5][_0x09a9('0x49')]()[_0x09a9('0x56')](0x0,_0x5c58a1);}else{_0x52f955[_0x09a9('0x54')+_0x59c8a5['toUpperCase']()]=_0x26bac9[_0x59c8a5];}}}}}return _0x52f955;}exports[_0x09a9('0x57')]=setXMDContactVariables; \ No newline at end of file +var _0xa004=['updatedAt','description','XMD-','toUpperCase','setXMDContactVariables','lodash','../../../../config/logger','dialer','../../../../config/environment/shared','BLACKLIST','RESCHEDULED_CONTACTS','DEACTIVATED','IS_DISACTIVED','INTERVAL_IS_EMPTY','NOT_ACTIVE','AGENTS_NOT_LOGGED','AVAILABLE_CONTACTS_FINISHED','INTERVAL_IS_NULL','INTERVAL_IS_OVERTIME','GLOBAL_INTERVAL_IS_OVERTIME','TIMEZONE_UNKNOW','TRUNK_IS_NOT_REACHABLE','dialMethod','preview','isPreviewCampaign','ivr','outbound','isOutboundQueue','dialActive','isQueueCampaignActive','active','isIVRCampaignActive','milliseconds','diff','seconds','getSeconds','message','available','loggedIn','loggedInDb','paused','talking','pTalking','waiting','inUse','originated','Trunk','name','dialTimezone','isNil','dialGlobalInterval','Interval','Intervals','EMPTY_INTERVAL','UNKNOWN_TIMEZONE','SIP/','reachable','unmonitored','includes','status','TrunkBackup','ACTIVE','INACTIVE','DISACTIVED','UNREACHABLE_TRUNK','getQueueCampaignActiveStatusMessage','match','extractCalleridName','string','isEmpty','\x22%s\x22\x20<%s>','format','isUndefined','\x22\x22\x20<>','getCallerId','\x5cw{0,','pow','replace','random','toString','getCallerIdRandom','[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative','decrementOriginate','length','checkContactEmpty','erlangb','createdAt','tags'];(function(_0x20ff2b,_0x277560){var _0x463fa4=function(_0x32da1){while(--_0x32da1){_0x20ff2b['push'](_0x20ff2b['shift']());}};_0x463fa4(++_0x277560);}(_0xa004,0xb5));var _0x4a00=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa004[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4a00('0x0'));var moment=require('moment');var util=require('util');var logger=require(_0x4a00('0x1'))(_0x4a00('0x2'));var timezones=require(_0x4a00('0x3'))['timezones'];var CAMPAIGN_STATUS={'ACTIVE':'ACTIVE','BLACKLIST':_0x4a00('0x4'),'CONTACTS_RESCHEDULED':_0x4a00('0x5'),'DEACTIVATED':_0x4a00('0x6'),'DISACTIVED':_0x4a00('0x7'),'EMPTY_INTERVAL':_0x4a00('0x8'),'INACTIVE':_0x4a00('0x9'),'NO_AGENTS_LOGGED':_0x4a00('0xa'),'NO_AVAILABLE_CONTACTS':_0x4a00('0xb'),'NULL_INTERVAL':_0x4a00('0xc'),'OVERTIME_INTERVAL':_0x4a00('0xd'),'OVERTIME_GLOBAL_INTERVAL':_0x4a00('0xe'),'QUEUE_RECALL':'RECALLINQUEUE','RECALL_TIMEOUT':'RECALLFAILEDTIMEOUT','RUNNING':'RUNNING','UNKNOWN_TIMEZONE':_0x4a00('0xf'),'UNREACHABLE_TRUNK':_0x4a00('0x10')};exports['CAMPAIGN_STATUS']=CAMPAIGN_STATUS;function isPreviewCampaign(_0x5efaf9){return _0x5efaf9[_0x4a00('0x11')]===_0x4a00('0x12');}exports[_0x4a00('0x13')]=isPreviewCampaign;function isIVRCampaign(_0x4f6437){return _0x4f6437['type']===_0x4a00('0x14');}exports['isIVRCampaign']=isIVRCampaign;function isOutboundQueue(_0x350494){return _0x350494['type']===_0x4a00('0x15');}exports[_0x4a00('0x16')]=isOutboundQueue;function isQueueCampaignActive(_0x2f81e1){return _0x2f81e1[_0x4a00('0x17')];}exports[_0x4a00('0x18')]=isQueueCampaignActive;function isIVRCampaignActive(_0x8d072e){return _0x8d072e[_0x4a00('0x19')];}exports[_0x4a00('0x1a')]=isIVRCampaignActive;function getSeconds(_0x928b6c,_0x3a2fdc){var _0x5e86a4=moment(_0x928b6c)['milliseconds'](0x0);var _0x308a64=moment(_0x3a2fdc)[_0x4a00('0x1b')](0x0);return _0x5e86a4[_0x4a00('0x1c')](_0x308a64,_0x4a00('0x1d'));}exports[_0x4a00('0x1e')]=getSeconds;function hasQueueCampaignDataChanged(_0x451389,_0x1020d5){var _0x541f71=![];var _0xc1f65d=_0x451389[_0x4a00('0x11')]!==_0x1020d5[_0x4a00('0x11')]||_0x451389['dialActive']!==_0x1020d5[_0x4a00('0x17')]||_0x451389[_0x4a00('0x1f')]!==_0x1020d5['message'];var _0x297415=_0x451389[_0x4a00('0x20')]!==_0x1020d5[_0x4a00('0x20')]||_0x451389['loggedIn']!==_0x1020d5[_0x4a00('0x21')]||_0x451389[_0x4a00('0x22')]!==_0x1020d5[_0x4a00('0x22')]||_0x451389[_0x4a00('0x23')]!==_0x1020d5[_0x4a00('0x23')]||_0x451389['talking']!==_0x1020d5[_0x4a00('0x24')]||_0x451389[_0x4a00('0x25')]!==_0x1020d5[_0x4a00('0x25')]||_0x451389[_0x4a00('0x26')]!==_0x1020d5['waiting']||_0x451389['inUse']!==_0x1020d5[_0x4a00('0x27')]||_0x451389[_0x4a00('0x28')]!==_0x1020d5['originated'];if(_0x451389['Trunk']&&_0x1020d5['Trunk']){_0x541f71=_0x451389[_0x4a00('0x29')][_0x4a00('0x2a')]!==_0x1020d5[_0x4a00('0x29')]['name']||_0x451389[_0x4a00('0x29')][_0x4a00('0x19')]!==_0x1020d5['Trunk'][_0x4a00('0x19')];}return _0xc1f65d||_0x297415||_0x541f71;}exports['hasQueueCampaignDataChanged']=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x4e4b80){var _0x4da761=null;var _0x58b057=_0x4e4b80[_0x4a00('0x2b')];if(_[_0x4a00('0x2c')](_0x4e4b80[_0x4a00('0x2d')])||_[_0x4a00('0x2c')](_0x4e4b80[_0x4a00('0x2e')])||_[_0x4a00('0x2c')](_0x4e4b80[_0x4a00('0x2e')]['Intervals'])){_0x4da761=CAMPAIGN_STATUS['NULL_INTERVAL'];}else if(_['isEmpty'](_0x4e4b80[_0x4a00('0x2d')])||_['isEmpty'](_0x4e4b80[_0x4a00('0x2e')][_0x4a00('0x2f')])){_0x4da761=CAMPAIGN_STATUS[_0x4a00('0x30')];}else if(_0x58b057&&!timezones[_0x58b057]){_0x4da761=CAMPAIGN_STATUS[_0x4a00('0x31')];}return _0x4da761;}function checkAnyValidTrunk(_0xf9aee9,_0x2a1e46){var _0xe522d1=null;var _0x336adb=_0x4a00('0x32');var _0x58db76=[_0x4a00('0x33'),_0x4a00('0x34')];var _0x27cbe7=!![];if(_0xf9aee9[_0x4a00('0x29')]&&_0xf9aee9[_0x4a00('0x29')][_0x4a00('0x19')]){_0x336adb+=_0xf9aee9[_0x4a00('0x29')][_0x4a00('0x2a')];_0xe522d1=_0x2a1e46[_0x336adb];_0x27cbe7=_0x58db76[_0x4a00('0x35')](_0xe522d1[_0x4a00('0x36')]);}else if(_0xf9aee9[_0x4a00('0x37')]&&_0xf9aee9[_0x4a00('0x37')][_0x4a00('0x19')]){_0x336adb+=_0xf9aee9[_0x4a00('0x37')][_0x4a00('0x2a')];_0xe522d1=_0x2a1e46[_0x336adb];_0x27cbe7=_0x58db76['includes'](_0xe522d1[_0x4a00('0x36')]);}return _0x27cbe7;}function getQueueCampaignStatusMessage(_0x160b03,_0x167416){var _0x575ac2=CAMPAIGN_STATUS[_0x4a00('0x38')];var _0x13f4a9=isPreviewCampaign(_0x160b03);if(!isQueueCampaignActive(_0x160b03)){if(_0x13f4a9){_0x575ac2=CAMPAIGN_STATUS[_0x4a00('0x39')];}else{if(_0x160b03['originated']===0x0&&_0x160b03[_0x4a00('0x24')]===0x0&&_0x160b03['waiting']===0x0&&(_0x160b03['pTalking']||0x0)===0x0){_0x575ac2=CAMPAIGN_STATUS['INACTIVE'];}else{_0x575ac2=CAMPAIGN_STATUS[_0x4a00('0x3a')];}}}else if(_0x160b03[_0x4a00('0x21')]===0x0){_0x575ac2=CAMPAIGN_STATUS['NO_AGENTS_LOGGED'];}else if(!checkAnyValidTrunk(_0x160b03,_0x167416)){_0x575ac2=CAMPAIGN_STATUS[_0x4a00('0x3b')];}else if(!isPreviewCampaign(_0x160b03)){var _0x2f663e=checkAnyValidQueueCampaignInterval(_0x160b03);if(_0x2f663e){_0x575ac2=_0x2f663e;}}return _0x575ac2;}exports['getQueueCampaignStatusMessage']=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x596b57){var _0x1161c5=CAMPAIGN_STATUS['DISACTIVED'];if(_0x596b57[_0x4a00('0x28')]===0x0&&_0x596b57[_0x4a00('0x24')]===0x0&&_0x596b57['waiting']===0x0&&(_0x596b57[_0x4a00('0x25')]||0x0)===0x0){_0x1161c5=CAMPAIGN_STATUS[_0x4a00('0x39')];}return _0x1161c5;}exports[_0x4a00('0x3c')]=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x53244b){var _0xcc0192=_0x53244b[_0x4a00('0x3d')](/"(.*?)"/);return _0xcc0192?_0xcc0192[0x1]:_0x53244b;}exports[_0x4a00('0x3e')]=extractCalleridName;function getCallerId(_0x366d33,_0x306e86,_0x168906){if(!_['isUndefined'](_0x168906)&&typeof _0x168906===_0x4a00('0x3f')&&!_[_0x4a00('0x40')](_0x168906)){if(!_['isUndefined'](_0x306e86)&&typeof _0x306e86===_0x4a00('0x3f')&&!_[_0x4a00('0x40')](_0x306e86)){return util['format'](_0x4a00('0x41'),_0x306e86,_0x168906);}return util[_0x4a00('0x42')]('\x22%s\x22\x20<%s>',_0x168906,_0x168906);}if(!_[_0x4a00('0x43')](_0x366d33)&&typeof _0x366d33===_0x4a00('0x3f')&&!_[_0x4a00('0x40')](_0x366d33)){return _0x366d33;}return _0x4a00('0x44');}exports[_0x4a00('0x45')]=getCallerId;function getCallerIdRandom(_0xa4076b,_0x3a7e9e){var _0x5f4d97;var _0x357fcb;var _0x4f2468;if(_0x3a7e9e<=0x0){_0x3a7e9e=0x1;}_0x5f4d97=new RegExp(_0x4a00('0x46')+_0x3a7e9e+'}$');_0x357fcb=Math[_0x4a00('0x47')](0xa,_0x3a7e9e-0x1);_0x4f2468=Math[_0x4a00('0x47')](0xa,_0x3a7e9e)-0x1;return util[_0x4a00('0x42')]('%s',_[_0x4a00('0x48')](_0xa4076b,_0x5f4d97,_[_0x4a00('0x49')](_0x357fcb,_0x4f2468)[_0x4a00('0x4a')]()));}exports[_0x4a00('0x4b')]=getCallerIdRandom;function decrementOriginate(_0x9c6c0a){if(_0x9c6c0a[_0x4a00('0x28')]&&_0x9c6c0a[_0x4a00('0x28')]>0x0){_0x9c6c0a['originated']-=0x1;}else{logger['error'](_0x4a00('0x4c'));}}exports[_0x4a00('0x4d')]=decrementOriginate;function checkContactEmpty(_0x34ab32){return _0x34ab32&&_0x34ab32[_0x4a00('0x4e')]>0x0;}exports[_0x4a00('0x4f')]=checkContactEmpty;function erlangb(_0xdc82a7,_0x128e16){if(_0x128e16===0x0){return 0x0;}var _0x3bae75=0x1;for(var _0x8d21cd=0x1;_0x8d21cd<=_0x128e16;_0x8d21cd+=0x1){_0x3bae75=0x1+_0x3bae75*_0x8d21cd/_0xdc82a7;}return 0x1/_0x3bae75;}exports[_0x4a00('0x50')]=erlangb;function checkContactLowerLimitOriginate(_0x1b3ac0,_0xf05eed,_0x56ab10){if(_0xf05eed>_0x56ab10){for(var _0x4f3f45=0x0;_0x4f3f45<_0xf05eed-_0x56ab10;_0x4f3f45+=0x1){decrementOriginate(_0x1b3ac0);}}}exports['checkContactLowerLimitOriginate']=checkContactLowerLimitOriginate;function setXMDContactVariables(_0x168668){var _0x1fbad2={};var _0x2468c8=['id',_0x4a00('0x51'),_0x4a00('0x52'),_0x4a00('0x53')];const _0x346a3d=0xfa;if(_0x168668){for(var _0xa826c6 in _0x168668){if(typeof _0x168668[_0xa826c6]!=='undefined'){if(!_['isNil'](_0x168668[_0xa826c6])&&!_0x2468c8[_0x4a00('0x35')](_0xa826c6)){if(_0xa826c6===_0x4a00('0x54')&&_0x168668[_0xa826c6]['length']>_0x346a3d){_0x1fbad2[_0x4a00('0x55')+_0xa826c6[_0x4a00('0x56')]()]=_0x168668[_0xa826c6][_0x4a00('0x4a')]()['substring'](0x0,_0x346a3d);}else{_0x1fbad2[_0x4a00('0x55')+_0xa826c6['toUpperCase']()]=_0x168668[_0xa826c6];}}}}}return _0x1fbad2;}exports[_0x4a00('0x57')]=setXMDContactVariables; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index f16e08f..465d2b1 100644 --- a/server/services/ami/fax/action.js +++ b/server/services/ami/fax/action.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['fax','localstationid','path','AttachmentId','exports','util','lodash','moment','channel','format','%s/%s/%s','tech','Trunk'];(function(_0x18c33d,_0x5df9de){var _0x4dd0dd=function(_0x22c6d5){while(--_0x22c6d5){_0x18c33d['push'](_0x18c33d['shift']());}};_0x4dd0dd(++_0x5df9de);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa9e0[_0x2b4411];return _0x8e41ef;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));function Action(_0x5dd881,_0x550fbc,_0x18d5c9){this['uniqueid']=_0x5dd881||undefined;this[_0x0a9e('0x3')]=util[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x550fbc[_0x0a9e('0x6')],_0x550fbc[_0x0a9e('0x7')]['name'],_0x18d5c9[_0x0a9e('0x8')]);this[_0x0a9e('0x9')]=_0x550fbc[_0x0a9e('0x9')];this['headerinfo']=_0x550fbc['headerinfo'];this[_0x0a9e('0xa')]=_0x18d5c9['path'];this['AttachmentId']=_0x18d5c9[_0x0a9e('0xb')];}module[_0x0a9e('0xc')]=Action; \ No newline at end of file +var _0xa9e0=['fax','localstationid','path','AttachmentId','exports','util','lodash','moment','channel','format','%s/%s/%s','tech','Trunk'];(function(_0x55891a,_0x49cdf2){var _0x49f23e=function(_0x183575){while(--_0x183575){_0x55891a['push'](_0x55891a['shift']());}};_0x49f23e(++_0x49cdf2);}(_0xa9e0,0x123));var _0x0a9e=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xa9e0[_0xc6be3a];return _0x56a310;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));function Action(_0x5dd881,_0x550fbc,_0x18d5c9){this['uniqueid']=_0x5dd881||undefined;this[_0x0a9e('0x3')]=util[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x550fbc[_0x0a9e('0x6')],_0x550fbc[_0x0a9e('0x7')]['name'],_0x18d5c9[_0x0a9e('0x8')]);this[_0x0a9e('0x9')]=_0x550fbc[_0x0a9e('0x9')];this['headerinfo']=_0x550fbc['headerinfo'];this[_0x0a9e('0xa')]=_0x18d5c9['path'];this['AttachmentId']=_0x18d5c9[_0x0a9e('0xb')];}module[_0x0a9e('0xc')]=Action; \ No newline at end of file diff --git a/server/services/ami/fax/index.js b/server/services/ami/fax/index.js index 1d7aa33..7ec6987 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 _0x137c=['Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','util','lodash','bluebird','uuid','moment','tiff2pdf','./util/gs','../../../config/logger','fax','../ami','./channel','./util/util','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','faxAccounts','trunks','actions','newchannel','bind','varset','syncVarSet','newstate','newexten','faxstatus','syncFaxStatus','receivefax','hangup','syncHangup','originateresponse','prototype','syncNewchannel','context','from-voip-provider','hasOwnProperty','exten','localstationid','channels','uniqueid','channel','name','\x20syncNewchannel\x20','info','variable','value','syncNewState','channelstate','channelstatedesc','operation','status','filename','\x20syncFaxStatus\x20','syncReceiveFax','remotestationid','pagestransferred','resolution','transferrate','calleridnum','parse','application/pdf','then','notify','.pdf','catch','\x20notify\x20','stringify','syncOriginateResponse','merge','pick','response','reason','AttachmentId','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','SENDING\x20FAILED:\x20','faxstatusstring','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','message','checkAfterSend','checkTrunk','isValid','Trunk\x20Reachable','path','execute','Action','variablesAction','addVariables','isTrunkReachable','isNil','active','format','SIP/%s','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','Trunk\x20not\x20working\x20correctly'];(function(_0x29a29f,_0x155ce7){var _0x443ea3=function(_0xe0dd24){while(--_0xe0dd24){_0x29a29f['push'](_0x29a29f['shift']());}};_0x443ea3(++_0x155ce7);}(_0x137c,0x15d));var _0xc137=function(_0x208d75,_0x92d742){_0x208d75=_0x208d75-0x0;var _0x382d27=_0x137c[_0x208d75];return _0x382d27;};'use strict';var util=require(_0xc137('0x0'));var _=require(_0xc137('0x1'));var BPromise=require(_0xc137('0x2'));var uuid=require(_0xc137('0x3'));var moment=require(_0xc137('0x4'));var path=require('path');var tiff2pdf=require(_0xc137('0x5'));var gs=require(_0xc137('0x6'));var logger=require(_0xc137('0x7'))(_0xc137('0x8'));var ami=require(_0xc137('0x9'));var rpcDb=require('./rpcDb');var Channel=require(_0xc137('0xa'));var ut=require(_0xc137('0xb'));var Action=require(_0xc137('0xc'));var faxAccount=require(_0xc137('0xd'));var attachment=require(_0xc137('0xe'));var faxMessage=require(_0xc137('0xf'));function Fax(_0xf73a7d){this['channels']={};this[_0xc137('0x10')]=_0xf73a7d[_0xc137('0x10')];this[_0xc137('0x11')]=_0xf73a7d[_0xc137('0x11')];this[_0xc137('0x12')]={};ami['on'](_0xc137('0x13'),this['syncNewchannel'][_0xc137('0x14')](this));ami['on'](_0xc137('0x15'),this[_0xc137('0x16')][_0xc137('0x14')](this));ami['on'](_0xc137('0x17'),this['syncNewState'][_0xc137('0x14')](this));ami['on'](_0xc137('0x18'),this['syncNewExten']['bind'](this));ami['on'](_0xc137('0x19'),this[_0xc137('0x1a')][_0xc137('0x14')](this));ami['on'](_0xc137('0x1b'),this['syncReceiveFax'][_0xc137('0x14')](this));ami['on'](_0xc137('0x1c'),this[_0xc137('0x1d')][_0xc137('0x14')](this));ami['on'](_0xc137('0x1e'),this['syncOriginateResponse']['bind'](this));}Fax[_0xc137('0x1f')][_0xc137('0x20')]=function(_0x6e9757){if(_0x6e9757[_0xc137('0x21')]===_0xc137('0x22')){for(var _0x305c1b in this['faxAccounts']){if(this['faxAccounts'][_0xc137('0x23')](_0x305c1b)){if(_0x6e9757[_0xc137('0x24')]===this[_0xc137('0x10')][_0x305c1b][_0xc137('0x25')]){this[_0xc137('0x26')][_0x6e9757[_0xc137('0x27')]]={};this[_0xc137('0x26')][_0x6e9757[_0xc137('0x27')]][_0xc137('0x28')]=_0x6e9757[_0xc137('0x28')];this['channels'][_0x6e9757[_0xc137('0x27')]]['id']=this['faxAccounts'][_0x305c1b]['id'];this[_0xc137('0x26')][_0x6e9757[_0xc137('0x27')]][_0xc137('0x29')]=this['faxAccounts'][_0x305c1b][_0xc137('0x29')];logger['info'](_0x6e9757['uniqueid'],_0xc137('0x2a'));}}}}if(this[_0xc137('0x12')][_0x6e9757['uniqueid']]){this[_0xc137('0x26')][_0x6e9757[_0xc137('0x27')]]={};this['channels'][_0x6e9757[_0xc137('0x27')]][_0xc137('0x28')]=_0x6e9757[_0xc137('0x28')];logger[_0xc137('0x2b')](_0x6e9757['uniqueid'],_0xc137('0x2a'));}};Fax[_0xc137('0x1f')][_0xc137('0x16')]=function(_0x26b8b9){if(this[_0xc137('0x26')][_0x26b8b9['uniqueid']]){for(var _0x3de4ac in _0x26b8b9['variable']){if(_0x26b8b9[_0xc137('0x2c')]['hasOwnProperty'](_0x3de4ac)){this[_0xc137('0x26')][_0x26b8b9[_0xc137('0x27')]][_0x3de4ac]=_0x26b8b9[_0xc137('0x2d')];}}}};Fax[_0xc137('0x1f')][_0xc137('0x2e')]=function(_0x41be09){if(this[_0xc137('0x26')][_0x41be09[_0xc137('0x27')]]){this[_0xc137('0x26')][_0x41be09['uniqueid']][_0xc137('0x2f')]=_0x41be09[_0xc137('0x2f')];this[_0xc137('0x26')][_0x41be09['uniqueid']][_0xc137('0x30')]=_0x41be09[_0xc137('0x30')];}};Fax['prototype']['syncNewExten']=function(_0x5de16f){if(this[_0xc137('0x26')][_0x5de16f[_0xc137('0x27')]]){for(var _0x523131 in _0x5de16f['variable']){if(_0x5de16f[_0xc137('0x2c')]['hasOwnProperty'](_0x523131)){this[_0xc137('0x26')][_0x5de16f[_0xc137('0x27')]][_0x523131]=_0x5de16f['value'];}}}};Fax['prototype']['syncFaxStatus']=function(_0x3ae3fa){if(this[_0xc137('0x26')][_0x3ae3fa['uniqueid']]){this[_0xc137('0x26')][_0x3ae3fa[_0xc137('0x27')]][_0xc137('0x31')]=_0x3ae3fa[_0xc137('0x31')];this['channels'][_0x3ae3fa[_0xc137('0x27')]]['status']=_0x3ae3fa[_0xc137('0x32')];this[_0xc137('0x26')][_0x3ae3fa[_0xc137('0x27')]][_0xc137('0x25')]=_0x3ae3fa['localstationid'];this['channels'][_0x3ae3fa[_0xc137('0x27')]][_0xc137('0x33')]=_0x3ae3fa[_0xc137('0x33')];logger[_0xc137('0x2b')](_0x3ae3fa[_0xc137('0x27')],_0xc137('0x34'));}};Fax[_0xc137('0x1f')][_0xc137('0x35')]=function(_0x521b52){var _0x239ab8=this;if(this[_0xc137('0x26')][_0x521b52[_0xc137('0x27')]]){var _0x4342c7=this['channels'][_0x521b52[_0xc137('0x27')]]['id'];this[_0xc137('0x26')][_0x521b52[_0xc137('0x27')]][_0xc137('0x36')]=_0x521b52[_0xc137('0x36')];this[_0xc137('0x26')][_0x521b52[_0xc137('0x27')]]['pagestransferred']=_0x521b52[_0xc137('0x37')];this[_0xc137('0x26')][_0x521b52[_0xc137('0x27')]][_0xc137('0x25')]=_0x521b52[_0xc137('0x25')];this['channels'][_0x521b52[_0xc137('0x27')]]['resolution']=_0x521b52[_0xc137('0x38')];this[_0xc137('0x26')][_0x521b52[_0xc137('0x27')]][_0xc137('0x39')]=_0x521b52['transferrate'];this[_0xc137('0x26')][_0x521b52[_0xc137('0x27')]][_0xc137('0x33')]=_0x521b52['filename'];this[_0xc137('0x26')][_0x521b52[_0xc137('0x27')]]['calleridnum']=_0x521b52[_0xc137('0x3a')];if(this[_0xc137('0x26')][_0x521b52[_0xc137('0x27')]]['pagestransferred']>0x0){tiff2pdf(_0x521b52[_0xc137('0x33')],'/var/opt/motion2/server/files/attachments/',function(_0x4eeb9a){logger['info'](_0x521b52[_0xc137('0x27')],'\x20result\x20conversion\x20file\x20',_0x4eeb9a['message']);attachment['create']({'name':path['parse'](_0x521b52['filename'])[_0xc137('0x29')],'basename':path[_0xc137('0x3b')](_0x521b52[_0xc137('0x33')])['name']+'.pdf','type':_0xc137('0x3c')})[_0xc137('0x3d')](function(_0x1972a2){faxAccount[_0xc137('0x3e')](_0x4342c7,{'from':_0x521b52['calleridnum'],'mapKey':_0xc137('0x8'),'body':path[_0xc137('0x3b')](_0x521b52['filename'])[_0xc137('0x29')]+_0xc137('0x3f'),'AttachmentId':_0x1972a2['id']})[_0xc137('0x40')](function(_0x50dc94){logger['error'](_0x521b52[_0xc137('0x27')],_0xc137('0x41'),JSON[_0xc137('0x42')](_0x50dc94));});})[_0xc137('0x40')](function(_0x4d20af){logger['error'](_0x521b52['uniqueid'],'\x20receiveFax\x20',JSON[_0xc137('0x42')](_0x4d20af));});});}logger[_0xc137('0x2b')](_0x521b52[_0xc137('0x27')],'\x20receiveFax\x20');}};Fax[_0xc137('0x1f')][_0xc137('0x43')]=function(_0x272b39){if(this[_0xc137('0x12')][_0x272b39[_0xc137('0x27')]]){_[_0xc137('0x44')](this['channels'][_0x272b39[_0xc137('0x27')]],_[_0xc137('0x45')](_0x272b39,[_0xc137('0x46'),_0xc137('0x47')]));}};function updateStatus(_0x317be7){if(_0x317be7[_0xc137('0x48')]){faxMessage['update'](_0x317be7['AttachmentId'],{'failMessage':_0xc137('0x49')})[_0xc137('0x3d')](function(_0x4f6441){ut[_0xc137('0x4a')](_0xc137('0x4b'),_0x4f6441);})[_0xc137('0x40')](function(_0x153a6e){ut[_0xc137('0x4a')](_0xc137('0x4c'),_0x153a6e);});}else{ut[_0xc137('0x4a')](_0xc137('0x4d'));}}Fax['prototype'][_0xc137('0x4e')]=function(_0x508858,_0x31767d,_0xf1c134){var _0x35c99d=this;var _0x397695={};if(_0x31767d){_0x397695={'read':_0x31767d};}else{_0x397695={'failMessage':_0xf1c134};}if(this[_0xc137('0x12')][_0x508858]['AttachmentId']){faxMessage['update'](this[_0xc137('0x12')][_0x508858][_0xc137('0x48')],_0x397695)[_0xc137('0x3d')](function(_0x23fbbd){ut[_0xc137('0x4a')](_0xc137('0x4f'),_0x23fbbd);})[_0xc137('0x40')](function(_0x30ddcd){ut[_0xc137('0x4a')]('[Fax][Message][NoUpdate1]',_0x30ddcd);})['finally'](function(){delete _0x35c99d[_0xc137('0x26')][_0x508858];delete _0x35c99d['actions'][_0x508858];});}else{ut[_0xc137('0x4a')](_0xc137('0x50'));delete this[_0xc137('0x26')][_0x508858];delete this[_0xc137('0x12')][_0x508858];}};Fax[_0xc137('0x1f')][_0xc137('0x1d')]=function(_0x230044){var _0x3bc830=this;if(this[_0xc137('0x26')][_0x230044[_0xc137('0x27')]]){if(this[_0xc137('0x12')][_0x230044[_0xc137('0x27')]]){this[_0xc137('0x26')][_0x230044[_0xc137('0x27')]]['id']=this[_0xc137('0x12')][_0x230044['uniqueid']]['id'];this[_0xc137('0x26')][_0x230044[_0xc137('0x27')]][_0xc137('0x29')]=this[_0xc137('0x12')][_0x230044[_0xc137('0x27')]][_0xc137('0x29')];}logger['info'](_0x230044[_0xc137('0x27')],this[_0xc137('0x12')][_0x230044['uniqueid']]?_0xc137('0x51'):_0xc137('0x52'),JSON[_0xc137('0x42')](this[_0xc137('0x26')][_0x230044['uniqueid']]));if(this[_0xc137('0x12')][_0x230044['uniqueid']]){if(this[_0xc137('0x26')][_0x230044['uniqueid']][_0xc137('0x53')]>0x0&&this['channels'][_0x230044[_0xc137('0x27')]][_0xc137('0x19')]===_0xc137('0x54')){this[_0xc137('0x4e')](_0x230044[_0xc137('0x27')],!![]);}else{this[_0xc137('0x4e')](_0x230044[_0xc137('0x27')],![],this[_0xc137('0x26')][_0x230044[_0xc137('0x27')]]['faxstatusstring']?_0xc137('0x55')+this[_0xc137('0x26')][_0x230044['uniqueid']][_0xc137('0x56')]:'SENDING\x20FAILED');}}}};Fax[_0xc137('0x1f')][_0xc137('0x57')]=function(_0x211c95){var _0x34c3ba=this;return new BPromise(function(_0x3a4864,_0x17c2d9){_0x34c3ba[_0xc137('0x58')](_0x211c95,_0x34c3ba['faxAccounts'][_0x211c95[_0xc137('0x59')]])[_0xc137('0x3d')](function(_0x5d6c72){ut[_0xc137('0x4a')](_0xc137('0x5a'),_0x5d6c72);_0x3a4864(ut['message'](_0xc137('0x5b')));})[_0xc137('0x40')](function(_0x39f4f7){ut[_0xc137('0x4a')]('[Fax][execOriginate][failure]',_0x39f4f7);updateStatus(_0x211c95);_0x17c2d9(ut[_0xc137('0x5c')]('Fax\x20failed'));});});};Fax['prototype'][_0xc137('0x5d')]=function(_0xccd4a3){var _0x2e2d6c=this;return new BPromise(function(_0x17cb0f,_0xfa20cd){var _0x367c98=_0x2e2d6c[_0xc137('0x5e')](_0x2e2d6c[_0xc137('0x10')][_0xccd4a3['FaxAccountId']]['Trunk'],_0xccd4a3);if(_0x367c98[_0xc137('0x5f')]){_0x17cb0f(ut[_0xc137('0x5c')](_0xc137('0x60')));}else{_0xfa20cd(ut[_0xc137('0x5c')](_0x367c98[_0xc137('0x5c')]));}});};function originate(_0x58442d,_0x200519,_0x41dd78){return new BPromise(function(_0x42cb88,_0x42dc64){if(_0x41dd78){var _0x3e8473=util['format']('gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit',path[_0xc137('0x3b')](_0x58442d[_0xc137('0x61')])[_0xc137('0x29')],_0x58442d['path']);gs[_0xc137('0x62')](_0x3e8473)[_0xc137('0x3d')](function(){_0x58442d[_0xc137('0x61')]=util['format']('%s/%s.tif',path[_0xc137('0x3b')](_0x58442d['path'])['dir'],path[_0xc137('0x3b')](_0x58442d['path'])[_0xc137('0x29')]);_0x200519['XMF-PATH']=_0x58442d[_0xc137('0x61')];ut[_0xc137('0x4a')]('Convert\x20pdf\x20to\x20tif','');ami['Action'](ut['variablesAction'](_0x58442d,_0x200519))[_0xc137('0x3d')](function(_0x590785){_0x42cb88(_0x590785);})[_0xc137('0x40')](function(_0x4e3762){_0x42dc64(_0x4e3762);});})[_0xc137('0x40')](function(_0x1a31b6){_0x42dc64(_0x1a31b6);});}else{ami[_0xc137('0x63')](ut[_0xc137('0x64')](_0x58442d,_0x200519))['then'](function(_0x14d904){_0x42cb88(_0x14d904);})[_0xc137('0x40')](function(_0x552dc9){_0x42dc64(_0x552dc9);});}});}Fax[_0xc137('0x1f')]['execOriginate']=function(_0x3e3545,_0x5c7646){var _0x12dc58=this;return new BPromise(function(_0x133776,_0x2a16c6){var _0x4463cc=uuid['v4']();var _0x1cc9f7=ut[_0xc137('0x65')](_0x3e3545,_0x5c7646);_0x12dc58[_0xc137('0x12')][_0x4463cc]=new Action(_0x4463cc,_0x5c7646,_0x3e3545);var _0x559ad0=_0x12dc58[_0xc137('0x12')][_0x4463cc];if(path[_0xc137('0x3b')](_0x3e3545['path'])['ext']===_0xc137('0x3f')){originate(_0x559ad0,_0x1cc9f7,!![])[_0xc137('0x3d')](function(_0x32f6e9){_0x133776(_0x32f6e9);})[_0xc137('0x40')](function(_0x25dbc6){_0x2a16c6(_0x25dbc6);});}else{originate(_0x559ad0,_0x1cc9f7,![])[_0xc137('0x3d')](function(_0x5f7676){_0x133776(_0x5f7676);})[_0xc137('0x40')](function(_0x31db8c){_0x2a16c6(_0x31db8c);});}});};Fax[_0xc137('0x1f')][_0xc137('0x66')]=function(_0x45a17d){return!_[_0xc137('0x67')](_0x45a17d)&&!_[_0xc137('0x67')](_0x45a17d['name'])&&!_[_0xc137('0x67')](_0x45a17d[_0xc137('0x68')])&&_0x45a17d[_0xc137('0x68')]&&!_[_0xc137('0x67')](this[_0xc137('0x11')][util[_0xc137('0x69')]('SIP/%s',_0x45a17d[_0xc137('0x29')])])&&!_['isNil'](this[_0xc137('0x11')][util[_0xc137('0x69')](_0xc137('0x6a'),_0x45a17d['name'])][_0xc137('0x32')])&&(this[_0xc137('0x11')][util[_0xc137('0x69')](_0xc137('0x6a'),_0x45a17d[_0xc137('0x29')])][_0xc137('0x32')]===_0xc137('0x6b')||this[_0xc137('0x11')][util[_0xc137('0x69')]('SIP/%s',_0x45a17d[_0xc137('0x29')])]['status']===_0xc137('0x6c'));};Fax[_0xc137('0x1f')]['checkTrunk']=function(_0x125e26,_0x231b59){if(!this[_0xc137('0x66')](_0x125e26)){ut[_0xc137('0x4a')](_0xc137('0x6d'),_[_0xc137('0x67')](_0x125e26)?'':_0x125e26['name']+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':_0xc137('0x6e')};}if(_[_0xc137('0x67')](_0x231b59[_0xc137('0x8')])){ut['logger']('[Fax][checkTrunk][Empty\x20Fax]',JSON[_0xc137('0x42')](_0x231b59));return{'isValid':![],'message':_0xc137('0x6f')};}if(_[_0xc137('0x67')](_0x231b59['path'])){ut[_0xc137('0x4a')](_0xc137('0x70'),JSON[_0xc137('0x42')](_0x231b59));return{'isValid':![],'message':_0xc137('0x71')};}return{'isValid':!![],'message':_0xc137('0x72')};};module['exports']=Fax; \ No newline at end of file +var _0x3cae=['[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20is\x20not\x20active','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','lodash','uuid','moment','tiff2pdf','./util/gs','../../../config/logger','../ami','./channel','./util/util','../rpc/faxMessage','faxAccounts','trunks','newchannel','syncNewchannel','bind','varset','newstate','syncNewState','newexten','syncNewExten','faxstatus','receivefax','syncReceiveFax','hangup','syncHangup','syncOriginateResponse','context','from-voip-provider','localstationid','uniqueid','channels','channel','name','info','actions','\x20syncNewchannel\x20','prototype','syncVarSet','variable','hasOwnProperty','value','channelstate','channelstatedesc','syncFaxStatus','operation','status','\x20syncFaxStatus\x20','pagestransferred','resolution','transferrate','filename','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','create','parse','.pdf','application/pdf','then','notify','fax','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','pick','response','reason','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','SENDING\x20FAILED:\x20','faxstatusstring','SENDING\x20FAILED','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','message','Fax\x20received','[Fax][execOriginate][failure]','checkAfterSend','checkTrunk','Trunk','isValid','Trunk\x20Reachable','format','path','execute','%s/%s.tif','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','reachable'];(function(_0x3480f2,_0x4947fa){var _0x1e4899=function(_0x4a884f){while(--_0x4a884f){_0x3480f2['push'](_0x3480f2['shift']());}};_0x1e4899(++_0x4947fa);}(_0x3cae,0x172));var _0xe3ca=function(_0x43b08,_0x15f967){_0x43b08=_0x43b08-0x0;var _0x5e05f4=_0x3cae[_0x43b08];return _0x5e05f4;};'use strict';var util=require('util');var _=require(_0xe3ca('0x0'));var BPromise=require('bluebird');var uuid=require(_0xe3ca('0x1'));var moment=require(_0xe3ca('0x2'));var path=require('path');var tiff2pdf=require(_0xe3ca('0x3'));var gs=require(_0xe3ca('0x4'));var logger=require(_0xe3ca('0x5'))('fax');var ami=require(_0xe3ca('0x6'));var rpcDb=require('./rpcDb');var Channel=require(_0xe3ca('0x7'));var ut=require(_0xe3ca('0x8'));var Action=require('./action');var faxAccount=require('../rpc/faxAccount');var attachment=require('../rpc/attachment');var faxMessage=require(_0xe3ca('0x9'));function Fax(_0x4f531f){this['channels']={};this[_0xe3ca('0xa')]=_0x4f531f['faxAccounts'];this[_0xe3ca('0xb')]=_0x4f531f['trunks'];this['actions']={};ami['on'](_0xe3ca('0xc'),this[_0xe3ca('0xd')][_0xe3ca('0xe')](this));ami['on'](_0xe3ca('0xf'),this['syncVarSet'][_0xe3ca('0xe')](this));ami['on'](_0xe3ca('0x10'),this[_0xe3ca('0x11')][_0xe3ca('0xe')](this));ami['on'](_0xe3ca('0x12'),this[_0xe3ca('0x13')][_0xe3ca('0xe')](this));ami['on'](_0xe3ca('0x14'),this['syncFaxStatus']['bind'](this));ami['on'](_0xe3ca('0x15'),this[_0xe3ca('0x16')][_0xe3ca('0xe')](this));ami['on'](_0xe3ca('0x17'),this[_0xe3ca('0x18')]['bind'](this));ami['on']('originateresponse',this[_0xe3ca('0x19')]['bind'](this));}Fax['prototype']['syncNewchannel']=function(_0x1a4c60){if(_0x1a4c60[_0xe3ca('0x1a')]===_0xe3ca('0x1b')){for(var _0x22e605 in this[_0xe3ca('0xa')]){if(this[_0xe3ca('0xa')]['hasOwnProperty'](_0x22e605)){if(_0x1a4c60['exten']===this[_0xe3ca('0xa')][_0x22e605][_0xe3ca('0x1c')]){this['channels'][_0x1a4c60[_0xe3ca('0x1d')]]={};this[_0xe3ca('0x1e')][_0x1a4c60[_0xe3ca('0x1d')]][_0xe3ca('0x1f')]=_0x1a4c60['channel'];this['channels'][_0x1a4c60[_0xe3ca('0x1d')]]['id']=this['faxAccounts'][_0x22e605]['id'];this[_0xe3ca('0x1e')][_0x1a4c60[_0xe3ca('0x1d')]][_0xe3ca('0x20')]=this[_0xe3ca('0xa')][_0x22e605][_0xe3ca('0x20')];logger[_0xe3ca('0x21')](_0x1a4c60[_0xe3ca('0x1d')],'\x20syncNewchannel\x20');}}}}if(this[_0xe3ca('0x22')][_0x1a4c60[_0xe3ca('0x1d')]]){this[_0xe3ca('0x1e')][_0x1a4c60[_0xe3ca('0x1d')]]={};this[_0xe3ca('0x1e')][_0x1a4c60[_0xe3ca('0x1d')]][_0xe3ca('0x1f')]=_0x1a4c60[_0xe3ca('0x1f')];logger['info'](_0x1a4c60['uniqueid'],_0xe3ca('0x23'));}};Fax[_0xe3ca('0x24')][_0xe3ca('0x25')]=function(_0x419c8a){if(this[_0xe3ca('0x1e')][_0x419c8a[_0xe3ca('0x1d')]]){for(var _0x28c4ae in _0x419c8a[_0xe3ca('0x26')]){if(_0x419c8a[_0xe3ca('0x26')][_0xe3ca('0x27')](_0x28c4ae)){this[_0xe3ca('0x1e')][_0x419c8a[_0xe3ca('0x1d')]][_0x28c4ae]=_0x419c8a[_0xe3ca('0x28')];}}}};Fax[_0xe3ca('0x24')]['syncNewState']=function(_0x319b58){if(this[_0xe3ca('0x1e')][_0x319b58['uniqueid']]){this[_0xe3ca('0x1e')][_0x319b58[_0xe3ca('0x1d')]][_0xe3ca('0x29')]=_0x319b58[_0xe3ca('0x29')];this[_0xe3ca('0x1e')][_0x319b58['uniqueid']][_0xe3ca('0x2a')]=_0x319b58[_0xe3ca('0x2a')];}};Fax[_0xe3ca('0x24')]['syncNewExten']=function(_0x2b7aa8){if(this['channels'][_0x2b7aa8[_0xe3ca('0x1d')]]){for(var _0x1bf8b5 in _0x2b7aa8[_0xe3ca('0x26')]){if(_0x2b7aa8['variable'][_0xe3ca('0x27')](_0x1bf8b5)){this['channels'][_0x2b7aa8['uniqueid']][_0x1bf8b5]=_0x2b7aa8[_0xe3ca('0x28')];}}}};Fax['prototype'][_0xe3ca('0x2b')]=function(_0x334f41){if(this['channels'][_0x334f41['uniqueid']]){this[_0xe3ca('0x1e')][_0x334f41['uniqueid']][_0xe3ca('0x2c')]=_0x334f41[_0xe3ca('0x2c')];this['channels'][_0x334f41[_0xe3ca('0x1d')]][_0xe3ca('0x2d')]=_0x334f41[_0xe3ca('0x2d')];this['channels'][_0x334f41[_0xe3ca('0x1d')]]['localstationid']=_0x334f41[_0xe3ca('0x1c')];this[_0xe3ca('0x1e')][_0x334f41[_0xe3ca('0x1d')]]['filename']=_0x334f41['filename'];logger['info'](_0x334f41[_0xe3ca('0x1d')],_0xe3ca('0x2e'));}};Fax[_0xe3ca('0x24')]['syncReceiveFax']=function(_0x3a9a5a){var _0x214e6d=this;if(this['channels'][_0x3a9a5a[_0xe3ca('0x1d')]]){var _0x3db100=this['channels'][_0x3a9a5a['uniqueid']]['id'];this[_0xe3ca('0x1e')][_0x3a9a5a[_0xe3ca('0x1d')]]['remotestationid']=_0x3a9a5a['remotestationid'];this[_0xe3ca('0x1e')][_0x3a9a5a[_0xe3ca('0x1d')]][_0xe3ca('0x2f')]=_0x3a9a5a[_0xe3ca('0x2f')];this[_0xe3ca('0x1e')][_0x3a9a5a['uniqueid']]['localstationid']=_0x3a9a5a[_0xe3ca('0x1c')];this[_0xe3ca('0x1e')][_0x3a9a5a[_0xe3ca('0x1d')]][_0xe3ca('0x30')]=_0x3a9a5a['resolution'];this[_0xe3ca('0x1e')][_0x3a9a5a[_0xe3ca('0x1d')]][_0xe3ca('0x31')]=_0x3a9a5a['transferrate'];this[_0xe3ca('0x1e')][_0x3a9a5a[_0xe3ca('0x1d')]][_0xe3ca('0x32')]=_0x3a9a5a[_0xe3ca('0x32')];this[_0xe3ca('0x1e')][_0x3a9a5a[_0xe3ca('0x1d')]]['calleridnum']=_0x3a9a5a[_0xe3ca('0x33')];if(this[_0xe3ca('0x1e')][_0x3a9a5a['uniqueid']][_0xe3ca('0x2f')]>0x0){tiff2pdf(_0x3a9a5a['filename'],_0xe3ca('0x34'),function(_0x622a51){logger[_0xe3ca('0x21')](_0x3a9a5a[_0xe3ca('0x1d')],_0xe3ca('0x35'),_0x622a51['message']);attachment[_0xe3ca('0x36')]({'name':path['parse'](_0x3a9a5a['filename'])[_0xe3ca('0x20')],'basename':path[_0xe3ca('0x37')](_0x3a9a5a[_0xe3ca('0x32')])[_0xe3ca('0x20')]+_0xe3ca('0x38'),'type':_0xe3ca('0x39')})[_0xe3ca('0x3a')](function(_0x5a63b8){faxAccount[_0xe3ca('0x3b')](_0x3db100,{'from':_0x3a9a5a['calleridnum'],'mapKey':_0xe3ca('0x3c'),'body':path[_0xe3ca('0x37')](_0x3a9a5a[_0xe3ca('0x32')])[_0xe3ca('0x20')]+_0xe3ca('0x38'),'AttachmentId':_0x5a63b8['id']})[_0xe3ca('0x3d')](function(_0x1d219d){logger[_0xe3ca('0x3e')](_0x3a9a5a[_0xe3ca('0x1d')],_0xe3ca('0x3f'),JSON[_0xe3ca('0x40')](_0x1d219d));});})[_0xe3ca('0x3d')](function(_0xbc091d){logger[_0xe3ca('0x3e')](_0x3a9a5a[_0xe3ca('0x1d')],'\x20receiveFax\x20',JSON[_0xe3ca('0x40')](_0xbc091d));});});}logger['info'](_0x3a9a5a[_0xe3ca('0x1d')],_0xe3ca('0x41'));}};Fax[_0xe3ca('0x24')]['syncOriginateResponse']=function(_0x9bb8b){if(this['actions'][_0x9bb8b[_0xe3ca('0x1d')]]){_['merge'](this[_0xe3ca('0x1e')][_0x9bb8b['uniqueid']],_[_0xe3ca('0x42')](_0x9bb8b,[_0xe3ca('0x43'),_0xe3ca('0x44')]));}};function updateStatus(_0x137165){if(_0x137165[_0xe3ca('0x45')]){faxMessage[_0xe3ca('0x46')](_0x137165[_0xe3ca('0x45')],{'failMessage':_0xe3ca('0x47')})[_0xe3ca('0x3a')](function(_0x34fe20){ut[_0xe3ca('0x48')](_0xe3ca('0x49'),_0x34fe20);})[_0xe3ca('0x3d')](function(_0x1cead4){ut[_0xe3ca('0x48')](_0xe3ca('0x4a'),_0x1cead4);});}else{ut['logger'](_0xe3ca('0x4b'));}}Fax[_0xe3ca('0x24')][_0xe3ca('0x4c')]=function(_0x49fda7,_0x551190,_0x192644){var _0x3af1ab=this;var _0x36f5fc={};if(_0x551190){_0x36f5fc={'read':_0x551190};}else{_0x36f5fc={'failMessage':_0x192644};}if(this[_0xe3ca('0x22')][_0x49fda7]['AttachmentId']){faxMessage['update'](this['actions'][_0x49fda7][_0xe3ca('0x45')],_0x36f5fc)[_0xe3ca('0x3a')](function(_0x3cd576){ut[_0xe3ca('0x48')](_0xe3ca('0x4d'),_0x3cd576);})['catch'](function(_0x493bd2){ut[_0xe3ca('0x48')](_0xe3ca('0x4e'),_0x493bd2);})[_0xe3ca('0x4f')](function(){delete _0x3af1ab[_0xe3ca('0x1e')][_0x49fda7];delete _0x3af1ab[_0xe3ca('0x22')][_0x49fda7];});}else{ut['logger'](_0xe3ca('0x50'));delete this[_0xe3ca('0x1e')][_0x49fda7];delete this[_0xe3ca('0x22')][_0x49fda7];}};Fax[_0xe3ca('0x24')][_0xe3ca('0x18')]=function(_0x5576e2){var _0x1eedce=this;if(this[_0xe3ca('0x1e')][_0x5576e2[_0xe3ca('0x1d')]]){if(this['actions'][_0x5576e2[_0xe3ca('0x1d')]]){this[_0xe3ca('0x1e')][_0x5576e2[_0xe3ca('0x1d')]]['id']=this['actions'][_0x5576e2[_0xe3ca('0x1d')]]['id'];this[_0xe3ca('0x1e')][_0x5576e2[_0xe3ca('0x1d')]][_0xe3ca('0x20')]=this['actions'][_0x5576e2['uniqueid']][_0xe3ca('0x20')];}logger['info'](_0x5576e2[_0xe3ca('0x1d')],this['actions'][_0x5576e2[_0xe3ca('0x1d')]]?'\x20hangup\x20sendFile\x20':_0xe3ca('0x51'),JSON[_0xe3ca('0x40')](this['channels'][_0x5576e2['uniqueid']]));if(this['actions'][_0x5576e2['uniqueid']]){if(this[_0xe3ca('0x1e')][_0x5576e2[_0xe3ca('0x1d')]][_0xe3ca('0x52')]>0x0&&this[_0xe3ca('0x1e')][_0x5576e2[_0xe3ca('0x1d')]][_0xe3ca('0x14')]===_0xe3ca('0x53')){this['updateStatus'](_0x5576e2[_0xe3ca('0x1d')],!![]);}else{this['updateStatus'](_0x5576e2[_0xe3ca('0x1d')],![],this[_0xe3ca('0x1e')][_0x5576e2[_0xe3ca('0x1d')]]['faxstatusstring']?_0xe3ca('0x54')+this[_0xe3ca('0x1e')][_0x5576e2[_0xe3ca('0x1d')]][_0xe3ca('0x55')]:_0xe3ca('0x56'));}}}};Fax[_0xe3ca('0x24')][_0xe3ca('0x57')]=function(_0x3caba2){var _0xf427d9=this;return new BPromise(function(_0x22a972,_0x53d79f){_0xf427d9[_0xe3ca('0x58')](_0x3caba2,_0xf427d9[_0xe3ca('0xa')][_0x3caba2[_0xe3ca('0x59')]])['then'](function(_0x1d493d){ut[_0xe3ca('0x48')](_0xe3ca('0x5a'),_0x1d493d);_0x22a972(ut[_0xe3ca('0x5b')](_0xe3ca('0x5c')));})[_0xe3ca('0x3d')](function(_0x4dcea3){ut[_0xe3ca('0x48')](_0xe3ca('0x5d'),_0x4dcea3);updateStatus(_0x3caba2);_0x53d79f(ut[_0xe3ca('0x5b')]('Fax\x20failed'));});});};Fax[_0xe3ca('0x24')][_0xe3ca('0x5e')]=function(_0xe93fe0){var _0x1af8b9=this;return new BPromise(function(_0x5dbe9a,_0x2afc79){var _0x37d7ac=_0x1af8b9[_0xe3ca('0x5f')](_0x1af8b9[_0xe3ca('0xa')][_0xe93fe0[_0xe3ca('0x59')]][_0xe3ca('0x60')],_0xe93fe0);if(_0x37d7ac[_0xe3ca('0x61')]){_0x5dbe9a(ut[_0xe3ca('0x5b')](_0xe3ca('0x62')));}else{_0x2afc79(ut[_0xe3ca('0x5b')](_0x37d7ac[_0xe3ca('0x5b')]));}});};function originate(_0x371d09,_0x1e4677,_0xc3409){return new BPromise(function(_0x15c2bc,_0x1e56ed){if(_0xc3409){var _0x19c4a6=util[_0xe3ca('0x63')]('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[_0xe3ca('0x37')](_0x371d09['path'])[_0xe3ca('0x20')],_0x371d09[_0xe3ca('0x64')]);gs[_0xe3ca('0x65')](_0x19c4a6)['then'](function(){_0x371d09['path']=util[_0xe3ca('0x63')](_0xe3ca('0x66'),path[_0xe3ca('0x37')](_0x371d09[_0xe3ca('0x64')])['dir'],path[_0xe3ca('0x37')](_0x371d09['path'])[_0xe3ca('0x20')]);_0x1e4677[_0xe3ca('0x67')]=_0x371d09[_0xe3ca('0x64')];ut[_0xe3ca('0x48')](_0xe3ca('0x68'),'');ami[_0xe3ca('0x69')](ut[_0xe3ca('0x6a')](_0x371d09,_0x1e4677))[_0xe3ca('0x3a')](function(_0x58df5a){_0x15c2bc(_0x58df5a);})[_0xe3ca('0x3d')](function(_0x22d5c7){_0x1e56ed(_0x22d5c7);});})[_0xe3ca('0x3d')](function(_0x537f8a){_0x1e56ed(_0x537f8a);});}else{ami[_0xe3ca('0x69')](ut['variablesAction'](_0x371d09,_0x1e4677))[_0xe3ca('0x3a')](function(_0x4efaa5){_0x15c2bc(_0x4efaa5);})[_0xe3ca('0x3d')](function(_0x3b56e3){_0x1e56ed(_0x3b56e3);});}});}Fax[_0xe3ca('0x24')][_0xe3ca('0x58')]=function(_0x4c9db7,_0x32ad35){var _0x31dcdc=this;return new BPromise(function(_0x27459b,_0x3ff2c1){var _0x3df7f1=uuid['v4']();var _0x4a6edc=ut[_0xe3ca('0x6b')](_0x4c9db7,_0x32ad35);_0x31dcdc[_0xe3ca('0x22')][_0x3df7f1]=new Action(_0x3df7f1,_0x32ad35,_0x4c9db7);var _0x260f69=_0x31dcdc['actions'][_0x3df7f1];if(path[_0xe3ca('0x37')](_0x4c9db7['path'])[_0xe3ca('0x6c')]==='.pdf'){originate(_0x260f69,_0x4a6edc,!![])[_0xe3ca('0x3a')](function(_0x517639){_0x27459b(_0x517639);})[_0xe3ca('0x3d')](function(_0x484a84){_0x3ff2c1(_0x484a84);});}else{originate(_0x260f69,_0x4a6edc,![])[_0xe3ca('0x3a')](function(_0x12b07c){_0x27459b(_0x12b07c);})['catch'](function(_0x2ad7d8){_0x3ff2c1(_0x2ad7d8);});}});};Fax[_0xe3ca('0x24')][_0xe3ca('0x6d')]=function(_0x231ad1){return!_[_0xe3ca('0x6e')](_0x231ad1)&&!_['isNil'](_0x231ad1[_0xe3ca('0x20')])&&!_[_0xe3ca('0x6e')](_0x231ad1[_0xe3ca('0x6f')])&&_0x231ad1['active']&&!_[_0xe3ca('0x6e')](this['trunks'][util['format'](_0xe3ca('0x70'),_0x231ad1[_0xe3ca('0x20')])])&&!_['isNil'](this[_0xe3ca('0xb')][util[_0xe3ca('0x63')]('SIP/%s',_0x231ad1[_0xe3ca('0x20')])]['status'])&&(this[_0xe3ca('0xb')][util['format'](_0xe3ca('0x70'),_0x231ad1['name'])][_0xe3ca('0x2d')]===_0xe3ca('0x71')||this[_0xe3ca('0xb')][util['format']('SIP/%s',_0x231ad1[_0xe3ca('0x20')])][_0xe3ca('0x2d')]==='unmonitored');};Fax['prototype'][_0xe3ca('0x5f')]=function(_0x2fabdc,_0x5d76a4){if(!this[_0xe3ca('0x6d')](_0x2fabdc)){ut[_0xe3ca('0x48')](_0xe3ca('0x72'),_[_0xe3ca('0x6e')](_0x2fabdc)?'':_0x2fabdc[_0xe3ca('0x20')]+_0xe3ca('0x73'));return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}if(_['isNil'](_0x5d76a4[_0xe3ca('0x3c')])){ut['logger'](_0xe3ca('0x74'),JSON[_0xe3ca('0x40')](_0x5d76a4));return{'isValid':![],'message':_0xe3ca('0x75')};}if(_[_0xe3ca('0x6e')](_0x5d76a4[_0xe3ca('0x64')])){ut[_0xe3ca('0x48')](_0xe3ca('0x76'),JSON['stringify'](_0x5d76a4));return{'isValid':![],'message':_0xe3ca('0x77')};}return{'isValid':!![],'message':_0xe3ca('0x78')};};module['exports']=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index 23972b7..302b1ae 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 _0xff08=['error','inspect','notify','resolve','then','catch','[Notify]\x20','util','bluebird','../../../config/logger','preview','lodash','../rpc/faxAccount'];(function(_0x4dc7b9,_0x319d5a){var _0x3ab114=function(_0x51a9df){while(--_0x51a9df){_0x4dc7b9['push'](_0x4dc7b9['shift']());}};_0x3ab114(++_0x319d5a);}(_0xff08,0xbd));var _0x8ff0=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xff08[_0x4b369d];return _0x571a98;};'use strict';var util=require(_0x8ff0('0x0'));var BPromise=require(_0x8ff0('0x1'));var logger=require(_0x8ff0('0x2'))(_0x8ff0('0x3'));var _=require(_0x8ff0('0x4'));var faxAccount=require(_0x8ff0('0x5'));function loggerCatch(_0x1f0cd5){return function(_0x5bd204){logger[_0x8ff0('0x6')](_0x1f0cd5,util[_0x8ff0('0x7')](_0x5bd204,{'showHidden':![],'depth':null}));};}exports[_0x8ff0('0x8')]=function(_0x14d9ed,_0x2cf215){return BPromise[_0x8ff0('0x9')]()[_0x8ff0('0xa')](faxAccount['notify'](_0x14d9ed,_0x2cf215))[_0x8ff0('0xb')](loggerCatch(_0x8ff0('0xc')));}; \ No newline at end of file +var _0x2346=['catch','[Notify]\x20','util','bluebird','preview','error','inspect','notify','resolve','then'];(function(_0x40534e,_0x1be148){var _0xf0cc8a=function(_0x1d5b2c){while(--_0x1d5b2c){_0x40534e['push'](_0x40534e['shift']());}};_0xf0cc8a(++_0x1be148);}(_0x2346,0x192));var _0x6234=function(_0x4bad6c,_0x29ec89){_0x4bad6c=_0x4bad6c-0x0;var _0x46ac3b=_0x2346[_0x4bad6c];return _0x46ac3b;};'use strict';var util=require(_0x6234('0x0'));var BPromise=require(_0x6234('0x1'));var logger=require('../../../config/logger')(_0x6234('0x2'));var _=require('lodash');var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x3dffb0){return function(_0xe6ca2d){logger[_0x6234('0x3')](_0x3dffb0,util[_0x6234('0x4')](_0xe6ca2d,{'showHidden':![],'depth':null}));};}exports[_0x6234('0x5')]=function(_0x3fa24a,_0x11b24d){return BPromise[_0x6234('0x6')]()[_0x6234('0x7')](faxAccount[_0x6234('0x5')](_0x3fa24a,_0x11b24d))[_0x6234('0x8')](loggerCatch(_0x6234('0x9')));}; \ No newline at end of file diff --git a/server/services/ami/fax/util/gs.js b/server/services/ami/fax/util/gs.js index c90effb..3a14de6 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 _0xd117=['Exec\x20gs','\x20Error\x20:','inspect','util','../../../../config/logger','bluebird','child_process','exec','info'];(function(_0x5d2b9d,_0x3f8689){var _0x265d6d=function(_0x91b4e4){while(--_0x91b4e4){_0x5d2b9d['push'](_0x5d2b9d['shift']());}};_0x265d6d(++_0x3f8689);}(_0xd117,0x147));var _0x7d11=function(_0x2ab3d9,_0x50e716){_0x2ab3d9=_0x2ab3d9-0x0;var _0x210a54=_0xd117[_0x2ab3d9];return _0x210a54;};'use strict';var util=require(_0x7d11('0x0'));var logger=require(_0x7d11('0x1'))('fax');var BPromise=require(_0x7d11('0x2'));var exec=require(_0x7d11('0x3'))[_0x7d11('0x4')];exports['execute']=function(_0x20c2d6){return new BPromise(function(_0x49f619,_0x3fc5c7){exec(_0x20c2d6,function(_0x429fd3,_0x4c7603,_0x388682){logger[_0x7d11('0x5')]('Exec\x20gs',_0x4c7603);if(_0x429fd3){logger['info'](_0x7d11('0x6'),_0x7d11('0x7'),util[_0x7d11('0x8')](_0x429fd3,{'showHidden':![],'depth':null}),_0x4c7603,_0x388682);_0x3fc5c7(_0x429fd3);}_0x49f619(_0x4c7603);});});}; \ No newline at end of file +var _0xfff6=['inspect','util','../../../../config/logger','bluebird','exec','execute','\x20Error\x20:'];(function(_0x2eefec,_0x34f543){var _0x448213=function(_0x1dc7b7){while(--_0x1dc7b7){_0x2eefec['push'](_0x2eefec['shift']());}};_0x448213(++_0x34f543);}(_0xfff6,0x14a));var _0x6fff=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xfff6[_0x17d9e3];return _0x14192d;};'use strict';var util=require(_0x6fff('0x0'));var logger=require(_0x6fff('0x1'))('fax');var BPromise=require(_0x6fff('0x2'));var exec=require('child_process')[_0x6fff('0x3')];exports[_0x6fff('0x4')]=function(_0x2df9d1){return new BPromise(function(_0x476a34,_0x1b803d){exec(_0x2df9d1,function(_0x58a78e,_0x47a434,_0x56a545){logger['info']('Exec\x20gs',_0x47a434);if(_0x58a78e){logger['info']('Exec\x20gs',_0x6fff('0x5'),util[_0x6fff('0x6')](_0x58a78e,{'showHidden':![],'depth':null}),_0x47a434,_0x56a545);_0x1b803d(_0x58a78e);}_0x476a34(_0x47a434);});});}; \ 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 cc92436..6b6637c 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 _0x3dbc=['path','variablesAction','originate','channel','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','util','lodash','moment','../../../../config/logger','message','info','ecm','maxrate','format','\x22%s\x22','modem','gateway','localstationid'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x3dbc,0x1d3));var _0xc3db=function(_0x3806e6,_0x2f55d1){_0x3806e6=_0x3806e6-0x0;var _0x43aea8=_0x3dbc[_0x3806e6];return _0x43aea8;};'use strict';var util=require(_0xc3db('0x0'));var _=require(_0xc3db('0x1'));var moment=require(_0xc3db('0x2'));var logger=require(_0xc3db('0x3'))('fax');exports[_0xc3db('0x4')]=function(_0x41c5ec){return{'message':_0x41c5ec};};exports['logger']=function(_0x3f706f,_0x37cc7c){logger[_0xc3db('0x5')](_0x3f706f,util['inspect'](_0x37cc7c,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x4fb5d1,_0xa6560a){var _0x1c4816={'XMF-ECM':_0xa6560a[_0xc3db('0x6')],'XMF-HEADERINFO':_0xa6560a['headerinfo'],'XMF-MINRATE':_0xa6560a['minrate'],'XMF-MAXRATE':_0xa6560a[_0xc3db('0x7')],'XMF-MODEM':util[_0xc3db('0x8')](_0xc3db('0x9'),_0xa6560a[_0xc3db('0xa')]),'XMF-GATEWAY':_0xa6560a[_0xc3db('0xb')],'XMF-FAXDETECT':_0xa6560a['faxdetect'],'XMF-T38TIMEOUT':_0xa6560a['t38timeout'],'XMF-LOCALSTATIONID':_0xa6560a[_0xc3db('0xc')],'XMF-PATH':_0x4fb5d1[_0xc3db('0xd')]};return _0x1c4816;};exports[_0xc3db('0xe')]=function(_0x1412f7,_0x3f9fe6){return{'actionid':_0x1412f7['uniqueid'],'action':_0xc3db('0xf'),'channel':_0x1412f7[_0xc3db('0x10')],'Exten':_0xc3db('0x11'),'Context':_0xc3db('0x12'),'Priority':'1','callerid':util['format'](_0xc3db('0x13'),_0x1412f7['headerinfo']?_0x1412f7['headerinfo']:'',_0x1412f7[_0xc3db('0xc')]),'variable':_0x3f9fe6,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x1412f7['uniqueid']};}; \ No newline at end of file +var _0xfc4b=['message','logger','info','addVariables','ecm','minrate','\x22%s\x22','gateway','t38timeout','localstationid','path','variablesAction','uniqueid','originate','channel','xcally-motion-fax','from-sip','format','headerinfo','util','lodash','../../../../config/logger'];(function(_0x3474ac,_0x22d0f7){var _0x5345ec=function(_0x45056e){while(--_0x45056e){_0x3474ac['push'](_0x3474ac['shift']());}};_0x5345ec(++_0x22d0f7);}(_0xfc4b,0x105));var _0xbfc4=function(_0x30d3ee,_0x45ce43){_0x30d3ee=_0x30d3ee-0x0;var _0x20c324=_0xfc4b[_0x30d3ee];return _0x20c324;};'use strict';var util=require(_0xbfc4('0x0'));var _=require(_0xbfc4('0x1'));var moment=require('moment');var logger=require(_0xbfc4('0x2'))('fax');exports[_0xbfc4('0x3')]=function(_0x549eed){return{'message':_0x549eed};};exports[_0xbfc4('0x4')]=function(_0x24201d,_0x2aa37e){logger[_0xbfc4('0x5')](_0x24201d,util['inspect'](_0x2aa37e,{'showHidden':![],'depth':null}));};exports[_0xbfc4('0x6')]=function(_0x12098d,_0x3bce56){var _0x491b73={'XMF-ECM':_0x3bce56[_0xbfc4('0x7')],'XMF-HEADERINFO':_0x3bce56['headerinfo'],'XMF-MINRATE':_0x3bce56[_0xbfc4('0x8')],'XMF-MAXRATE':_0x3bce56['maxrate'],'XMF-MODEM':util['format'](_0xbfc4('0x9'),_0x3bce56['modem']),'XMF-GATEWAY':_0x3bce56[_0xbfc4('0xa')],'XMF-FAXDETECT':_0x3bce56['faxdetect'],'XMF-T38TIMEOUT':_0x3bce56[_0xbfc4('0xb')],'XMF-LOCALSTATIONID':_0x3bce56[_0xbfc4('0xc')],'XMF-PATH':_0x12098d[_0xbfc4('0xd')]};return _0x491b73;};exports[_0xbfc4('0xe')]=function(_0x33cbd5,_0x30fed8){return{'actionid':_0x33cbd5[_0xbfc4('0xf')],'action':_0xbfc4('0x10'),'channel':_0x33cbd5[_0xbfc4('0x11')],'Exten':_0xbfc4('0x12'),'Context':_0xbfc4('0x13'),'Priority':'1','callerid':util[_0xbfc4('0x14')]('\x22%s\x22\x20<%s>',_0x33cbd5[_0xbfc4('0x15')]?_0x33cbd5[_0xbfc4('0x15')]:'',_0x33cbd5[_0xbfc4('0xc')]),'variable':_0x30fed8,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x33cbd5['uniqueid']};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 148286f..138d1e7 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 _0x9040=['./rpc/integrations/vtiger','./rpc/integrations/servicenow','../../config/logger','ami','get','hour','then','getAgents','initAgents','getTelephones','initTelephones','initTrunks','getTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','initServicenowAccounts','getDynamics365Accounts','initCampaigns','initVoiceExtensions','initFaxAccounts','resolve','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','initVoiceCallReports','catch','inspect','listen','sync','error','[index.js][main]','./server','./realtime','./acw','./trigger','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho'];(function(_0x45ed81,_0x290091){var _0x45cb98=function(_0x3849bb){while(--_0x3849bb){_0x45ed81['push'](_0x45ed81['shift']());}};_0x45cb98(++_0x290091);}(_0x9040,0x75));var _0x0904=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9040[_0x14add3];return _0x4a174f;};'use strict';var util=require('util');var moment=require('moment');var server=require(_0x0904('0x0'));var Realtime=require(_0x0904('0x1'));var Report=require('./report');var Acw=require(_0x0904('0x2'));var Trigger=require(_0x0904('0x3'));var Dialer=require('./dialer');var Preview=require(_0x0904('0x4'));var Fax=require(_0x0904('0x5'));var user=require(_0x0904('0x6'));var voiceQueue=require(_0x0904('0x7'));var voiceQueueReport=require(_0x0904('0x8'));var voiceCallReport=require(_0x0904('0x9'));var trunk=require('./rpc/trunk');var trigger=require(_0x0904('0xa'));var template=require(_0x0904('0xb'));var cmHopperHistory=require(_0x0904('0xc'));var campaign=require('./rpc/campaign');var voiceExtension=require(_0x0904('0xd'));var faxAccount=require(_0x0904('0xe'));var zendesk=require(_0x0904('0xf'));var salesforce=require(_0x0904('0x10'));var sugarcrm=require(_0x0904('0x11'));var freshdesk=require(_0x0904('0x12'));var desk=require(_0x0904('0x13'));var zoho=require(_0x0904('0x14'));var vtiger=require(_0x0904('0x15'));var freshsales=require('./rpc/integrations/freshsales');var servicenow=require(_0x0904('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 logger=require(_0x0904('0x17'))(_0x0904('0x18'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x0904('0x19')]('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x0904('0x19')](_0x0904('0x1a'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise['resolve']()[_0x0904('0x1b')](user[_0x0904('0x1c')]())[_0x0904('0x1b')](realtime[_0x0904('0x1d')]())[_0x0904('0x1b')](user[_0x0904('0x1e')]())[_0x0904('0x1b')](realtime[_0x0904('0x1f')]())['then'](trunk['getTrunks']())[_0x0904('0x1b')](realtime[_0x0904('0x20')]())['then'](voiceQueue['getVoiceQueues']())[_0x0904('0x1b')](realtime['initVoiceQueues']())[_0x0904('0x1b')](trigger['getTriggers']())[_0x0904('0x1b')](realtime['initTriggers']())[_0x0904('0x1b')](template[_0x0904('0x21')]())[_0x0904('0x1b')](realtime['initTemplates']())['then'](zendesk[_0x0904('0x22')]())[_0x0904('0x1b')](realtime[_0x0904('0x23')]())['then'](salesforce[_0x0904('0x24')]())[_0x0904('0x1b')](realtime[_0x0904('0x25')]())[_0x0904('0x1b')](sugarcrm[_0x0904('0x26')]())[_0x0904('0x1b')](realtime[_0x0904('0x27')]())[_0x0904('0x1b')](freshdesk[_0x0904('0x28')]())[_0x0904('0x1b')](realtime[_0x0904('0x29')]())[_0x0904('0x1b')](desk[_0x0904('0x2a')]())[_0x0904('0x1b')](realtime[_0x0904('0x2b')]())['then'](zoho[_0x0904('0x2c')]())['then'](realtime[_0x0904('0x2d')]())[_0x0904('0x1b')](vtiger[_0x0904('0x2e')]())['then'](realtime[_0x0904('0x2f')]())[_0x0904('0x1b')](freshsales[_0x0904('0x30')]())[_0x0904('0x1b')](realtime[_0x0904('0x31')]())[_0x0904('0x1b')](servicenow['getServicenowAccounts']())[_0x0904('0x1b')](realtime[_0x0904('0x32')]())[_0x0904('0x1b')](dynamics365[_0x0904('0x33')]())['then'](realtime['initDynamics365Accounts']())[_0x0904('0x1b')](campaign['getCampaigns']())[_0x0904('0x1b')](realtime[_0x0904('0x34')]())[_0x0904('0x1b')](voiceExtension['getVoiceExtensions']())['then'](realtime[_0x0904('0x35')]())[_0x0904('0x1b')](faxAccount['getFaxAccounts']())[_0x0904('0x1b')](realtime[_0x0904('0x36')]())[_0x0904('0x1b')](function(){return realtime;});}function initParams(){return Promise[_0x0904('0x37')]()[_0x0904('0x1b')](voiceQueueReport[_0x0904('0x38')]())[_0x0904('0x1b')](realtime[_0x0904('0x39')]())['then'](cmHopperHistory[_0x0904('0x3a')]())[_0x0904('0x1b')](realtime[_0x0904('0x3b')]())[_0x0904('0x1b')](cmHopperHistory[_0x0904('0x3c')]())[_0x0904('0x1b')](realtime[_0x0904('0x3d')]())['then'](voiceCallReport['getVoiceCallReports']())[_0x0904('0x1b')](realtime[_0x0904('0x3e')]())[_0x0904('0x3f')](function(_0x25f35d){logger['error']('[index.js][initParams]',util[_0x0904('0x40')](_0x25f35d,{'showHidden':![],'depth':null}));});}function main(){return server[_0x0904('0x41')](realtime,preview,fax)[_0x0904('0x1b')](function(){return initRealtime();})['then'](function(){return initParams();})[_0x0904('0x1b')](function(){report[_0x0904('0x42')]();setInterval(initRealtime,0x1388);})[_0x0904('0x3f')](function(_0xf595a0){logger[_0x0904('0x43')](_0x0904('0x44'),util['inspect'](_0xf595a0,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0x4bea=['getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','getDeskAccounts','initDeskAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initCampaignHopperHistory','initVoiceCallReports','catch','[index.js][initParams]','inspect','listen','sync','error','[index.js][main]','util','./realtime','./report','./trigger','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/campaign','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger','get','then','getAgents','getTelephones','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','initTriggers','getTemplates','initTemplates','getZendeskAccounts'];(function(_0x17406a,_0x1e2320){var _0x1501ff=function(_0x4b075a){while(--_0x4b075a){_0x17406a['push'](_0x17406a['shift']());}};_0x1501ff(++_0x1e2320);}(_0x4bea,0x1a3));var _0xa4be=function(_0x1a0a9b,_0x2e52e0){_0x1a0a9b=_0x1a0a9b-0x0;var _0x5eb67c=_0x4bea[_0x1a0a9b];return _0x5eb67c;};'use strict';var util=require(_0xa4be('0x0'));var moment=require('moment');var server=require('./server');var Realtime=require(_0xa4be('0x1'));var Report=require(_0xa4be('0x2'));var Acw=require('./acw');var Trigger=require(_0xa4be('0x3'));var Dialer=require(_0xa4be('0x4'));var Preview=require(_0xa4be('0x5'));var Fax=require(_0xa4be('0x6'));var user=require(_0xa4be('0x7'));var voiceQueue=require(_0xa4be('0x8'));var voiceQueueReport=require('./rpc/voiceQueueReport');var voiceCallReport=require(_0xa4be('0x9'));var trunk=require(_0xa4be('0xa'));var trigger=require(_0xa4be('0xb'));var template=require('./rpc/template');var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require(_0xa4be('0xc'));var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require(_0xa4be('0xd'));var zendesk=require(_0xa4be('0xe'));var salesforce=require(_0xa4be('0xf'));var sugarcrm=require(_0xa4be('0x10'));var freshdesk=require(_0xa4be('0x11'));var desk=require('./rpc/integrations/desk');var zoho=require(_0xa4be('0x12'));var vtiger=require(_0xa4be('0x13'));var freshsales=require(_0xa4be('0x14'));var servicenow=require(_0xa4be('0x15'));var dynamics365=require(_0xa4be('0x16'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require(_0xa4be('0x17'))('ami');var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0xa4be('0x18')]('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xa4be('0x18')]('hour')===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise['resolve']()[_0xa4be('0x19')](user[_0xa4be('0x1a')]())[_0xa4be('0x19')](realtime['initAgents']())[_0xa4be('0x19')](user[_0xa4be('0x1b')]())[_0xa4be('0x19')](realtime['initTelephones']())[_0xa4be('0x19')](trunk[_0xa4be('0x1c')]())[_0xa4be('0x19')](realtime[_0xa4be('0x1d')]())[_0xa4be('0x19')](voiceQueue[_0xa4be('0x1e')]())[_0xa4be('0x19')](realtime[_0xa4be('0x1f')]())[_0xa4be('0x19')](trigger['getTriggers']())[_0xa4be('0x19')](realtime[_0xa4be('0x20')]())['then'](template[_0xa4be('0x21')]())[_0xa4be('0x19')](realtime[_0xa4be('0x22')]())[_0xa4be('0x19')](zendesk[_0xa4be('0x23')]())['then'](realtime['initZendeskAccounts']())[_0xa4be('0x19')](salesforce[_0xa4be('0x24')]())[_0xa4be('0x19')](realtime[_0xa4be('0x25')]())[_0xa4be('0x19')](sugarcrm[_0xa4be('0x26')]())['then'](realtime[_0xa4be('0x27')]())['then'](freshdesk[_0xa4be('0x28')]())[_0xa4be('0x19')](realtime['initFreshdeskAccounts']())[_0xa4be('0x19')](desk[_0xa4be('0x29')]())[_0xa4be('0x19')](realtime[_0xa4be('0x2a')]())['then'](zoho['getZohoAccounts']())[_0xa4be('0x19')](realtime[_0xa4be('0x2b')]())[_0xa4be('0x19')](vtiger[_0xa4be('0x2c')]())['then'](realtime[_0xa4be('0x2d')]())[_0xa4be('0x19')](freshsales[_0xa4be('0x2e')]())[_0xa4be('0x19')](realtime['initFreshsalesAccounts']())[_0xa4be('0x19')](servicenow['getServicenowAccounts']())[_0xa4be('0x19')](realtime['initServicenowAccounts']())[_0xa4be('0x19')](dynamics365['getDynamics365Accounts']())[_0xa4be('0x19')](realtime[_0xa4be('0x2f')]())['then'](campaign[_0xa4be('0x30')]())[_0xa4be('0x19')](realtime[_0xa4be('0x31')]())['then'](voiceExtension[_0xa4be('0x32')]())['then'](realtime[_0xa4be('0x33')]())['then'](faxAccount['getFaxAccounts']())['then'](realtime[_0xa4be('0x34')]())[_0xa4be('0x19')](function(){return realtime;});}function initParams(){return Promise['resolve']()[_0xa4be('0x19')](voiceQueueReport[_0xa4be('0x35')]())[_0xa4be('0x19')](realtime[_0xa4be('0x36')]())['then'](cmHopperHistory[_0xa4be('0x37')]())[_0xa4be('0x19')](realtime['initVoiceQueueHopperHistory']())['then'](cmHopperHistory['getCampaignHopperHistory']())[_0xa4be('0x19')](realtime[_0xa4be('0x38')]())['then'](voiceCallReport['getVoiceCallReports']())[_0xa4be('0x19')](realtime[_0xa4be('0x39')]())[_0xa4be('0x3a')](function(_0x48c28f){logger['error'](_0xa4be('0x3b'),util[_0xa4be('0x3c')](_0x48c28f,{'showHidden':![],'depth':null}));});}function main(){return server[_0xa4be('0x3d')](realtime,preview,fax)['then'](function(){return initRealtime();})[_0xa4be('0x19')](function(){return initParams();})['then'](function(){report[_0xa4be('0x3e')]();setInterval(initRealtime,0x1388);})[_0xa4be('0x3a')](function(_0x52f27f){logger[_0xa4be('0x3f')](_0xa4be('0x40'),util[_0xa4be('0x3c')](_0x52f27f,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file diff --git a/server/services/ami/model/agent.js b/server/services/ami/model/agent.js index e459579..c2e30ef 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 _0x881a=['mobile','interface','online','voiceStatusQueue','onhold','local','md5','updateStatusRealtime','state','not_inuse','idle','inuse','talking','voiceStatus','statePause','voiceStatusTime','toNumber','format','fullname','status','voiceStatusCallerIdNumber','emit','user:ami:update','omit','user:presence','util','moment','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','email','accountcode','unknown','stateTime','address','phone'];(function(_0x515da8,_0x3b69d2){var _0x10da36=function(_0x50e50b){while(--_0x50e50b){_0x515da8['push'](_0x515da8['shift']());}};_0x10da36(++_0x3b69d2);}(_0x881a,0x91));var _0xa881=function(_0xe01d60,_0x340301){_0xe01d60=_0xe01d60-0x0;var _0x46d858=_0x881a[_0xe01d60];return _0x46d858;};'use strict';var _=require('lodash');var util=require(_0xa881('0x0'));var moment=require(_0xa881('0x1'));var md5=require('md5');var Redis=require(_0xa881('0x2'));var config=require(_0xa881('0x3'));config[_0xa881('0x4')]=_[_0xa881('0x5')](config[_0xa881('0x4')],{'host':_0xa881('0x6'),'port':0x18eb});var io=require(_0xa881('0x7'))(new Redis(config[_0xa881('0x4')]));function Agent(_0x4c0389){this['id']=_0x4c0389['id']||0x0;this[_0xa881('0x8')]=_0x4c0389[_0xa881('0x8')]||'';this[_0xa881('0x9')]=_0x4c0389[_0xa881('0x9')]||'';this['accountcode']=_0x4c0389[_0xa881('0xa')]||'';this['fullname']=_0x4c0389['fullname']||'';this['state']=_0xa881('0xb');this[_0xa881('0xc')]=0x0;this['status']='unknown';this[_0xa881('0xd')]='';this[_0xa881('0xe')]='';this[_0xa881('0xf')]='';this[_0xa881('0x10')]='';this['online']=_0x4c0389[_0xa881('0x11')]||![];this['voiceStatus']=_0xa881('0xb');this['voiceStatusTime']=0x0;this['voiceStatusCallerIdNumber']='';this[_0xa881('0x12')]='';this[_0xa881('0x13')]=![];this[_0xa881('0x14')]=![];this[_0xa881('0x15')]='';}Agent['prototype'][_0xa881('0x16')]=function(_0x5d7bcf){var _0x35b2bd;if(_0x5d7bcf&&_0x5d7bcf[_0xa881('0x17')]){_0x35b2bd=_0x5d7bcf[_0xa881('0x17')]['toLowerCase']();switch(_0x35b2bd){case _0xa881('0x18'):_0x35b2bd=_0xa881('0x19');break;case _0xa881('0x1a'):_0x35b2bd=_0xa881('0x1b');break;}}if(_0x35b2bd&&this[_0xa881('0x1c')]!==_0x35b2bd||_0x5d7bcf[_0xa881('0x1d')]){this[_0xa881('0x1e')]=_[_0xa881('0x1f')](moment()[_0xa881('0x20')]('x'));}if(_0x35b2bd){this[_0xa881('0x1c')]=_0x35b2bd;}var _0xa90476={'id':this['id'],'name':this['name'],'email':this[_0xa881('0x9')],'accountcode':this['accountcode'],'fullname':this[_0xa881('0x21')],'state':this[_0xa881('0x17')],'stateTime':this[_0xa881('0xc')],'status':this[_0xa881('0x22')],'address':this[_0xa881('0xd')],'online':this[_0xa881('0x11')],'voiceStatus':this[_0xa881('0x1c')],'voiceStatusTime':this[_0xa881('0x1e')],'voiceStatusCallerIdNumber':this[_0xa881('0x23')],'voiceStatusQueue':this[_0xa881('0x12')],'interface':this[_0xa881('0x10')],'onhold':this['onhold']};var _0x2d214e=md5(JSON['stringify'](_0xa90476));if(this['md5']!==_0x2d214e){this[_0xa881('0x15')]=_0x2d214e;io['to'](util['format']('user:%s',_0xa90476['name']))[_0xa881('0x24')](_0xa881('0x25'),_[_0xa881('0x26')](_0xa90476,[_0xa881('0x11')]));io[_0xa881('0x24')](_0xa881('0x27'),_0xa90476);}};module['exports']=Agent; \ No newline at end of file +var _0xeec6=['interface','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','local','prototype','state','toLowerCase','not_inuse','statePause','toNumber','format','stringify','user:%s','emit','user:ami:update','omit','exports','util','moment','md5','ioredis','../../../config/environment','redis','defaults','localhost','name','email','accountcode','fullname','stateTime','status','unknown','address','phone','mobile'];(function(_0x3185d2,_0x56afa8){var _0x516c26=function(_0x31cdec){while(--_0x31cdec){_0x3185d2['push'](_0x3185d2['shift']());}};_0x516c26(++_0x56afa8);}(_0xeec6,0x126));var _0x6eec=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xeec6[_0x2576d7];return _0x16a08c;};'use strict';var _=require('lodash');var util=require(_0x6eec('0x0'));var moment=require(_0x6eec('0x1'));var md5=require(_0x6eec('0x2'));var Redis=require(_0x6eec('0x3'));var config=require(_0x6eec('0x4'));config[_0x6eec('0x5')]=_[_0x6eec('0x6')](config['redis'],{'host':_0x6eec('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x6eec('0x5')]));function Agent(_0x4ebcb0){this['id']=_0x4ebcb0['id']||0x0;this[_0x6eec('0x8')]=_0x4ebcb0[_0x6eec('0x8')]||'';this['email']=_0x4ebcb0[_0x6eec('0x9')]||'';this[_0x6eec('0xa')]=_0x4ebcb0[_0x6eec('0xa')]||'';this[_0x6eec('0xb')]=_0x4ebcb0[_0x6eec('0xb')]||'';this['state']='unknown';this[_0x6eec('0xc')]=0x0;this[_0x6eec('0xd')]=_0x6eec('0xe');this[_0x6eec('0xf')]='';this[_0x6eec('0x10')]='';this[_0x6eec('0x11')]='';this[_0x6eec('0x12')]='';this[_0x6eec('0x13')]=_0x4ebcb0[_0x6eec('0x13')]||![];this[_0x6eec('0x14')]=_0x6eec('0xe');this[_0x6eec('0x15')]=0x0;this[_0x6eec('0x16')]='';this[_0x6eec('0x17')]='';this[_0x6eec('0x18')]=![];this[_0x6eec('0x19')]=![];this['md5']='';}Agent[_0x6eec('0x1a')]['updateStatusRealtime']=function(_0x20f5dc){var _0x3dd238;if(_0x20f5dc&&_0x20f5dc['state']){_0x3dd238=_0x20f5dc[_0x6eec('0x1b')][_0x6eec('0x1c')]();switch(_0x3dd238){case _0x6eec('0x1d'):_0x3dd238='idle';break;case'inuse':_0x3dd238='talking';break;}}if(_0x3dd238&&this[_0x6eec('0x14')]!==_0x3dd238||_0x20f5dc[_0x6eec('0x1e')]){this['voiceStatusTime']=_[_0x6eec('0x1f')](moment()[_0x6eec('0x20')]('x'));}if(_0x3dd238){this[_0x6eec('0x14')]=_0x3dd238;}var _0x4e8ddc={'id':this['id'],'name':this[_0x6eec('0x8')],'email':this[_0x6eec('0x9')],'accountcode':this['accountcode'],'fullname':this[_0x6eec('0xb')],'state':this['state'],'stateTime':this[_0x6eec('0xc')],'status':this[_0x6eec('0xd')],'address':this[_0x6eec('0xf')],'online':this[_0x6eec('0x13')],'voiceStatus':this['voiceStatus'],'voiceStatusTime':this[_0x6eec('0x15')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this['voiceStatusQueue'],'interface':this[_0x6eec('0x12')],'onhold':this[_0x6eec('0x18')]};var _0x5b81af=md5(JSON[_0x6eec('0x21')](_0x4e8ddc));if(this[_0x6eec('0x2')]!==_0x5b81af){this[_0x6eec('0x2')]=_0x5b81af;io['to'](util[_0x6eec('0x20')](_0x6eec('0x22'),_0x4e8ddc['name']))[_0x6eec('0x23')](_0x6eec('0x24'),_[_0x6eec('0x25')](_0x4e8ddc,[_0x6eec('0x13')]));io[_0x6eec('0x23')]('user:presence',_0x4e8ddc);}};module[_0x6eec('0x26')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index e2dd613..c768999 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 _0x52e0=['SquareProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x52e0,0x6d));var _0x052e=function(_0x25fe11,_0xd1edf6){_0x25fe11=_0x25fe11-0x0;var _0x95a7eb=_0x52e0[_0x25fe11];return _0x95a7eb;};'use strict';function Campaign(_0x3803ab){this['id']=_0x3803ab['id']||0x0;this[_0x052e('0x0')]=_0x3803ab[_0x052e('0x0')]||'';this[_0x052e('0x1')]=_0x3803ab[_0x052e('0x1')]||'campaign';this[_0x052e('0x2')]=0x0;this[_0x052e('0x3')]=0x0;this[_0x052e('0x4')]=0x0;this[_0x052e('0x5')]=0x0;this['message']='';this[_0x052e('0x6')]=!![];this['active']=_0x3803ab[_0x052e('0x7')];this[_0x052e('0x8')]=_0x3803ab[_0x052e('0x8')];this[_0x052e('0x9')]=_0x3803ab[_0x052e('0x9')]||null;this[_0x052e('0xa')]=_0x3803ab[_0x052e('0xa')]?_0x3803ab[_0x052e('0xa')]:null;this[_0x052e('0xb')]=_0x3803ab[_0x052e('0xb')];this['dialOriginateCallerIdNumber']=_0x3803ab[_0x052e('0xc')];this[_0x052e('0xd')]=_0x3803ab[_0x052e('0xd')]||0x1e;this[_0x052e('0xe')]=_0x3803ab[_0x052e('0xe')];this[_0x052e('0xf')]=_0x3803ab[_0x052e('0xf')];this['dialBusyMaxRetry']=_0x3803ab[_0x052e('0x10')];this[_0x052e('0x11')]=_0x3803ab[_0x052e('0x11')];this[_0x052e('0x12')]=_0x3803ab['dialNoAnswerMaxRetry'];this[_0x052e('0x13')]=_0x3803ab[_0x052e('0x13')];this[_0x052e('0x14')]=_0x3803ab['dialGlobalMaxRetry'];this[_0x052e('0x15')]=_0x3803ab[_0x052e('0x15')]||0x3;this[_0x052e('0x16')]=_0x3803ab[_0x052e('0x16')]||0x96;this[_0x052e('0x17')]=_0x3803ab[_0x052e('0x17')]||0x3;this[_0x052e('0x18')]=_0x3803ab[_0x052e('0x18')]||0x96;this[_0x052e('0x19')]=_0x3803ab['dialAbandonedMaxRetry']||0x3;this[_0x052e('0x1a')]=_0x3803ab['dialAbandonedRetryFrequency']||0x96;this[_0x052e('0x1b')]=_0x3803ab[_0x052e('0x1b')]||0x3;this[_0x052e('0x1c')]=_0x3803ab['dialMachineRetryFrequency']||0x96;this[_0x052e('0x1d')]=_0x3803ab['dialAgentRejectMaxRetry']||0x3;this[_0x052e('0x1e')]=_0x3803ab[_0x052e('0x1e')]||0x96;this['dialOrderByScheduledAt']=_0x3803ab[_0x052e('0x1f')]||'DESC';this[_0x052e('0x20')]=_0x3803ab[_0x052e('0x20')]||undefined;this['dialRandomLastDigitCallerIdNumber']=_0x3803ab[_0x052e('0x21')]||undefined;this['dialCutDigit']=_0x3803ab[_0x052e('0x22')]||undefined;this['TrunkBackup']=_0x3803ab[_0x052e('0x23')]?_0x3803ab[_0x052e('0x23')]:undefined;this['Trunk']=_0x3803ab[_0x052e('0x24')]?_0x3803ab[_0x052e('0x24')]:undefined;this[_0x052e('0x25')]=_0x3803ab['Interval']?_0x3803ab[_0x052e('0x25')]:undefined;this[_0x052e('0x26')]=_0x3803ab[_0x052e('0x26')]?_0x3803ab[_0x052e('0x26')]:undefined;this['dialQueueProject']=_0x3803ab['SquareProject']?_0x3803ab[_0x052e('0x26')][_0x052e('0x0')]:undefined;this['dialAMDActive']=_0x3803ab[_0x052e('0x27')]||![];this[_0x052e('0x28')]=_0x3803ab[_0x052e('0x28')];this[_0x052e('0x29')]=_0x3803ab[_0x052e('0x29')];this[_0x052e('0x2a')]=_0x3803ab[_0x052e('0x2a')];this[_0x052e('0x2b')]=_0x3803ab[_0x052e('0x2b')];this[_0x052e('0x2c')]=_0x3803ab['dialAMDMinWordLength'];this[_0x052e('0x2d')]=_0x3803ab[_0x052e('0x2d')];this['dialAMDMaximumNumberOfWords']=_0x3803ab['dialAMDMaximumNumberOfWords'];this[_0x052e('0x2e')]=_0x3803ab[_0x052e('0x2e')];this['dialAMDMaximumWordLength']=_0x3803ab[_0x052e('0x2f')];}module[_0x052e('0x30')]=Campaign; \ No newline at end of file +var _0x9a05=['type','campaign','originated','temp','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateTimeout','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name'];(function(_0x1dffaf,_0x43e4e6){var _0x483c1a=function(_0x126f60){while(--_0x126f60){_0x1dffaf['push'](_0x1dffaf['shift']());}};_0x483c1a(++_0x43e4e6);}(_0x9a05,0xc7));var _0x59a0=function(_0x460be0,_0x8de397){_0x460be0=_0x460be0-0x0;var _0x43ea41=_0x9a05[_0x460be0];return _0x43ea41;};'use strict';function Campaign(_0x2a1efd){this['id']=_0x2a1efd['id']||0x0;this[_0x59a0('0x0')]=_0x2a1efd['name']||'';this[_0x59a0('0x1')]=_0x2a1efd['type']||_0x59a0('0x2');this[_0x59a0('0x3')]=0x0;this[_0x59a0('0x4')]=0x0;this['ivrAnswerCallsDay']=0x0;this[_0x59a0('0x5')]=0x0;this[_0x59a0('0x6')]='';this[_0x59a0('0x7')]=!![];this[_0x59a0('0x8')]=_0x2a1efd[_0x59a0('0x8')];this[_0x59a0('0x9')]=_0x2a1efd[_0x59a0('0x9')];this[_0x59a0('0xa')]=_0x2a1efd[_0x59a0('0xa')]||null;this[_0x59a0('0xb')]=_0x2a1efd['dialGlobalInterval']?_0x2a1efd['dialGlobalInterval']:null;this[_0x59a0('0xc')]=_0x2a1efd[_0x59a0('0xc')];this['dialOriginateCallerIdNumber']=_0x2a1efd['dialOriginateCallerIdNumber'];this[_0x59a0('0xd')]=_0x2a1efd[_0x59a0('0xd')]||0x1e;this['dialCongestionMaxRetry']=_0x2a1efd['dialCongestionMaxRetry'];this['dialCongestionRetryFrequency']=_0x2a1efd[_0x59a0('0xe')];this[_0x59a0('0xf')]=_0x2a1efd[_0x59a0('0xf')];this[_0x59a0('0x10')]=_0x2a1efd[_0x59a0('0x10')];this['dialNoAnswerMaxRetry']=_0x2a1efd[_0x59a0('0x11')];this[_0x59a0('0x12')]=_0x2a1efd[_0x59a0('0x12')];this[_0x59a0('0x13')]=_0x2a1efd[_0x59a0('0x13')];this[_0x59a0('0x14')]=_0x2a1efd[_0x59a0('0x14')]||0x3;this[_0x59a0('0x15')]=_0x2a1efd[_0x59a0('0x15')]||0x96;this[_0x59a0('0x16')]=_0x2a1efd[_0x59a0('0x16')]||0x3;this[_0x59a0('0x17')]=_0x2a1efd['dialDropRetryFrequency']||0x96;this[_0x59a0('0x18')]=_0x2a1efd[_0x59a0('0x18')]||0x3;this[_0x59a0('0x19')]=_0x2a1efd[_0x59a0('0x19')]||0x96;this[_0x59a0('0x1a')]=_0x2a1efd[_0x59a0('0x1a')]||0x3;this[_0x59a0('0x1b')]=_0x2a1efd[_0x59a0('0x1b')]||0x96;this['dialAgentRejectMaxRetry']=_0x2a1efd[_0x59a0('0x1c')]||0x3;this[_0x59a0('0x1d')]=_0x2a1efd[_0x59a0('0x1d')]||0x96;this['dialOrderByScheduledAt']=_0x2a1efd[_0x59a0('0x1e')]||_0x59a0('0x1f');this[_0x59a0('0x20')]=_0x2a1efd[_0x59a0('0x20')]||undefined;this[_0x59a0('0x21')]=_0x2a1efd[_0x59a0('0x21')]||undefined;this['dialCutDigit']=_0x2a1efd['dialCutDigit']||undefined;this['TrunkBackup']=_0x2a1efd[_0x59a0('0x22')]?_0x2a1efd[_0x59a0('0x22')]:undefined;this[_0x59a0('0x23')]=_0x2a1efd[_0x59a0('0x23')]?_0x2a1efd[_0x59a0('0x23')]:undefined;this[_0x59a0('0x24')]=_0x2a1efd[_0x59a0('0x24')]?_0x2a1efd['Interval']:undefined;this[_0x59a0('0x25')]=_0x2a1efd[_0x59a0('0x25')]?_0x2a1efd[_0x59a0('0x25')]:undefined;this[_0x59a0('0x26')]=_0x2a1efd['SquareProject']?_0x2a1efd[_0x59a0('0x25')][_0x59a0('0x0')]:undefined;this[_0x59a0('0x27')]=_0x2a1efd[_0x59a0('0x27')]||![];this[_0x59a0('0x28')]=_0x2a1efd['dialAMDInitialSilence'];this[_0x59a0('0x29')]=_0x2a1efd[_0x59a0('0x29')];this[_0x59a0('0x2a')]=_0x2a1efd[_0x59a0('0x2a')];this['dialAMDTotalAnalysisTime']=_0x2a1efd[_0x59a0('0x2b')];this[_0x59a0('0x2c')]=_0x2a1efd['dialAMDMinWordLength'];this[_0x59a0('0x2d')]=_0x2a1efd[_0x59a0('0x2d')];this[_0x59a0('0x2e')]=_0x2a1efd[_0x59a0('0x2e')];this[_0x59a0('0x2f')]=_0x2a1efd[_0x59a0('0x2f')];this['dialAMDMaximumWordLength']=_0x2a1efd[_0x59a0('0x30')];}module[_0x59a0('0x31')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index b0357aa..b547701 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 _0xc953=['connectedlinenum','connectedlinename','accountcode','context','uniqueid','linkedid','exten','answered','unmanaged','abandoned','lastapplication','lastdata','duration','billableseconds','holdtime','tag','disposition','monitor','monitorFilename','queue','monitors','transfercalleridnum','transferType','exports','starttime','channel','destinationchannel'];(function(_0x4ecca8,_0x46c5ee){var _0x5b9f84=function(_0x45f6fd){while(--_0x45f6fd){_0x4ecca8['push'](_0x4ecca8['shift']());}};_0x5b9f84(++_0x46c5ee);}(_0xc953,0x84));var _0x3c95=function(_0x1e6e4e,_0x2b1b09){_0x1e6e4e=_0x1e6e4e-0x0;var _0x3d746b=_0xc953[_0x1e6e4e];return _0x3d746b;};'use strict';function Channel(){this[_0x3c95('0x0')]=null;this[_0x3c95('0x1')]='';this[_0x3c95('0x2')]='';this['calleridnum']=0x0;this['calleridname']='';this[_0x3c95('0x3')]=undefined;this[_0x3c95('0x4')]=undefined;this[_0x3c95('0x5')]=0x0;this[_0x3c95('0x6')]='';this[_0x3c95('0x7')]=0x0;this[_0x3c95('0x8')]=0x0;this[_0x3c95('0x9')]=0x0;this[_0x3c95('0xa')]=![];this['answertime']=null;this['endtime']=null;this[_0x3c95('0xb')]=![];this[_0x3c95('0xc')]=![];this[_0x3c95('0xd')]='';this[_0x3c95('0xe')]='';this[_0x3c95('0xf')]=0x0;this[_0x3c95('0x10')]=0x0;this[_0x3c95('0x11')]=0x0;this['type']=null;this[_0x3c95('0x12')]=null;this[_0x3c95('0x13')]=null;this[_0x3c95('0x14')]=![];this[_0x3c95('0x15')]=null;this[_0x3c95('0x16')]=null;this[_0x3c95('0x17')]=[];this[_0x3c95('0x18')]=undefined;this['transferconnectedlinenum']=undefined;this[_0x3c95('0x19')]=undefined;this['mohtime']=0x0;}module[_0x3c95('0x1a')]=Channel; \ No newline at end of file +var _0xbac2=['billableseconds','holdtime','type','tag','disposition','transferconnectedlinenum','transferType','mohtime','exports','starttime','channel','destinationchannel','calleridnum','calleridname','connectedlinenum','connectedlinename','accountcode','uniqueid','linkedid','answered','answertime','endtime','unmanaged','abandoned','lastapplication','lastdata','duration'];(function(_0x5cb1af,_0x4bdc8c){var _0x8d7940=function(_0x3db70a){while(--_0x3db70a){_0x5cb1af['push'](_0x5cb1af['shift']());}};_0x8d7940(++_0x4bdc8c);}(_0xbac2,0xc6));var _0x2bac=function(_0x3ef4f1,_0x5f0f9b){_0x3ef4f1=_0x3ef4f1-0x0;var _0x69953c=_0xbac2[_0x3ef4f1];return _0x69953c;};'use strict';function Channel(){this[_0x2bac('0x0')]=null;this[_0x2bac('0x1')]='';this[_0x2bac('0x2')]='';this[_0x2bac('0x3')]=0x0;this[_0x2bac('0x4')]='';this[_0x2bac('0x5')]=undefined;this[_0x2bac('0x6')]=undefined;this[_0x2bac('0x7')]=0x0;this['context']='';this[_0x2bac('0x8')]=0x0;this[_0x2bac('0x9')]=0x0;this['exten']=0x0;this[_0x2bac('0xa')]=![];this[_0x2bac('0xb')]=null;this[_0x2bac('0xc')]=null;this[_0x2bac('0xd')]=![];this[_0x2bac('0xe')]=![];this[_0x2bac('0xf')]='';this[_0x2bac('0x10')]='';this[_0x2bac('0x11')]=0x0;this[_0x2bac('0x12')]=0x0;this[_0x2bac('0x13')]=0x0;this[_0x2bac('0x14')]=null;this[_0x2bac('0x15')]=null;this[_0x2bac('0x16')]=null;this['monitor']=![];this['monitorFilename']=null;this['queue']=null;this['monitors']=[];this['transfercalleridnum']=undefined;this[_0x2bac('0x17')]=undefined;this[_0x2bac('0x18')]=undefined;this[_0x2bac('0x19')]=0x0;}module[_0x2bac('0x1a')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index de945cb..c1a6410 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 _0xede9=['type','serverUrl','Configurations','name','username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret'];(function(_0x91433f,_0x5e92f0){var _0x12569d=function(_0x22c204){while(--_0x22c204){_0x91433f['push'](_0x91433f['shift']());}};_0x12569d(++_0x5e92f0);}(_0xede9,0x10b));var _0x9ede=function(_0x5900db,_0x31054f){_0x5900db=_0x5900db-0x0;var _0x399e27=_0xede9[_0x5900db];return _0x399e27;};'use strict';function DeskAccount(_0x32dba1){this['id']=_0x32dba1['id']||0x0;this[_0x9ede('0x0')]=_0x32dba1[_0x9ede('0x0')]||'';this[_0x9ede('0x1')]=_0x32dba1[_0x9ede('0x1')]||'';this[_0x9ede('0x2')]=_0x32dba1[_0x9ede('0x2')]||'';this['authType']=_0x32dba1[_0x9ede('0x3')]||'';this[_0x9ede('0x4')]=_0x32dba1[_0x9ede('0x4')]||'';this[_0x9ede('0x5')]=_0x32dba1[_0x9ede('0x5')]||'';this[_0x9ede('0x6')]=_0x32dba1[_0x9ede('0x6')]||'';this[_0x9ede('0x7')]=_0x32dba1['token']||'';this[_0x9ede('0x8')]=_0x32dba1[_0x9ede('0x8')]||'';this[_0x9ede('0x9')]=_0x32dba1[_0x9ede('0x9')]||'';this['serverUrl']=_0x32dba1[_0x9ede('0xa')]||'';this['Configurations']=_0x32dba1[_0x9ede('0xb')]||{};}module['exports']=DeskAccount; \ No newline at end of file +var _0x1b20=['token','tokenSecret','type','serverUrl','Configurations','exports','name','username','remoteUri','authType','password','consumerKey','consumerSecret'];(function(_0x2ffb42,_0x1a53ac){var _0x26dfd7=function(_0x4388d5){while(--_0x4388d5){_0x2ffb42['push'](_0x2ffb42['shift']());}};_0x26dfd7(++_0x1a53ac);}(_0x1b20,0x1f4));var _0x01b2=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x1b20[_0x59ee6f];return _0x4c0979;};'use strict';function DeskAccount(_0x2b2bef){this['id']=_0x2b2bef['id']||0x0;this[_0x01b2('0x0')]=_0x2b2bef[_0x01b2('0x0')]||'';this[_0x01b2('0x1')]=_0x2b2bef['username']||'';this['remoteUri']=_0x2b2bef[_0x01b2('0x2')]||'';this[_0x01b2('0x3')]=_0x2b2bef[_0x01b2('0x3')]||'';this[_0x01b2('0x4')]=_0x2b2bef[_0x01b2('0x4')]||'';this[_0x01b2('0x5')]=_0x2b2bef[_0x01b2('0x5')]||'';this[_0x01b2('0x6')]=_0x2b2bef[_0x01b2('0x6')]||'';this[_0x01b2('0x7')]=_0x2b2bef[_0x01b2('0x7')]||'';this[_0x01b2('0x8')]=_0x2b2bef[_0x01b2('0x8')]||'';this['type']=_0x2b2bef[_0x01b2('0x9')]||'';this[_0x01b2('0xa')]=_0x2b2bef['serverUrl']||'';this[_0x01b2('0xb')]=_0x2b2bef[_0x01b2('0xb')]||{};}module[_0x01b2('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 ac8f841..1657f7f 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 _0x17c3=['password','remoteUri','tenantId','clientId','clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider','name','username'];(function(_0x48e6c1,_0x2c5211){var _0x1521e2=function(_0x27e789){while(--_0x27e789){_0x48e6c1['push'](_0x48e6c1['shift']());}};_0x1521e2(++_0x2c5211);}(_0x17c3,0x1ed));var _0x317c=function(_0x1a95f6,_0x12b158){_0x1a95f6=_0x1a95f6-0x0;var _0x5ad718=_0x17c3[_0x1a95f6];return _0x5ad718;};'use strict';function Dynamics365Account(_0x5ab3d1){this['id']=_0x5ab3d1['id']||0x0;this['name']=_0x5ab3d1[_0x317c('0x0')]||'';this[_0x317c('0x1')]=_0x5ab3d1[_0x317c('0x1')]||'';this[_0x317c('0x2')]=_0x5ab3d1[_0x317c('0x2')]||'';this[_0x317c('0x3')]=_0x5ab3d1[_0x317c('0x3')]||'';this[_0x317c('0x4')]=_0x5ab3d1[_0x317c('0x4')]||'';this[_0x317c('0x5')]=_0x5ab3d1[_0x317c('0x5')]||'';this['clientSecret']=_0x5ab3d1[_0x317c('0x6')]||{};this[_0x317c('0x7')]=_0x5ab3d1['serverUrl']||'';this[_0x317c('0x8')]=_0x5ab3d1[_0x317c('0x8')]||![];this['Configurations']=_0x5ab3d1[_0x317c('0x9')]||{};this[_0x317c('0xa')]=_0x5ab3d1['CloudProvider']||{};}module['exports']=Dynamics365Account; \ No newline at end of file +var _0xbf57=['Configurations','CloudProvider','exports','name','username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','modernAuthentication'];(function(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0xbf57,0x123));var _0x7bf5=function(_0x3bb43c,_0x5e18f3){_0x3bb43c=_0x3bb43c-0x0;var _0x1c5bf9=_0xbf57[_0x3bb43c];return _0x1c5bf9;};'use strict';function Dynamics365Account(_0x3270f4){this['id']=_0x3270f4['id']||0x0;this[_0x7bf5('0x0')]=_0x3270f4['name']||'';this['username']=_0x3270f4[_0x7bf5('0x1')]||'';this[_0x7bf5('0x2')]=_0x3270f4[_0x7bf5('0x2')]||'';this['remoteUri']=_0x3270f4[_0x7bf5('0x3')]||'';this[_0x7bf5('0x4')]=_0x3270f4[_0x7bf5('0x4')]||'';this[_0x7bf5('0x5')]=_0x3270f4[_0x7bf5('0x5')]||'';this['clientSecret']=_0x3270f4[_0x7bf5('0x6')]||{};this[_0x7bf5('0x7')]=_0x3270f4[_0x7bf5('0x7')]||'';this['modernAuthentication']=_0x3270f4[_0x7bf5('0x8')]||![];this[_0x7bf5('0x9')]=_0x3270f4['Configurations']||{};this[_0x7bf5('0xa')]=_0x3270f4['CloudProvider']||{};}module[_0x7bf5('0xb')]=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index d225b56..2fe9127 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 _0x1c64=['v17,v27,v29','gateway','faxdetect','t38timeout','tech','Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x1c64,0xf7));var _0x41c6=function(_0x244f4f,_0x39bb65){_0x244f4f=_0x244f4f-0x0;var _0x128127=_0x1c64[_0x244f4f];return _0x128127;};'use strict';function FaxAccount(_0x1541d2){this['id']=_0x1541d2['id']||0x0;this[_0x41c6('0x0')]=_0x1541d2[_0x41c6('0x0')]||'';this[_0x41c6('0x1')]=_0x1541d2[_0x41c6('0x1')];this['ecm']=_0x1541d2[_0x41c6('0x2')];this[_0x41c6('0x3')]=_0x1541d2[_0x41c6('0x3')];this[_0x41c6('0x4')]=_0x1541d2[_0x41c6('0x4')];this[_0x41c6('0x5')]=_0x1541d2[_0x41c6('0x5')]||0x960;this[_0x41c6('0x6')]=_0x1541d2['maxrate']||0x3840;this[_0x41c6('0x7')]=_0x1541d2[_0x41c6('0x7')]||_0x41c6('0x8');this[_0x41c6('0x9')]=_0x1541d2[_0x41c6('0x9')]||'no';this['faxdetect']=_0x1541d2[_0x41c6('0xa')]||'no';this[_0x41c6('0xb')]=_0x1541d2[_0x41c6('0xb')]||0x1388;this['tech']=_0x1541d2[_0x41c6('0xc')]||'SIP';this[_0x41c6('0xd')]=_0x1541d2[_0x41c6('0xd')]?_0x1541d2[_0x41c6('0xd')]:undefined;this[_0x41c6('0xe')]=_0x1541d2[_0x41c6('0xe')];this[_0x41c6('0xf')]=_0x1541d2[_0x41c6('0xf')];}module[_0x41c6('0x10')]=FaxAccount; \ No newline at end of file +var _0x27f3=['name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','exports'];(function(_0x19d6a7,_0x2b2b10){var _0x2f56b1=function(_0x5c8cad){while(--_0x5c8cad){_0x19d6a7['push'](_0x19d6a7['shift']());}};_0x2f56b1(++_0x2b2b10);}(_0x27f3,0x165));var _0x327f=function(_0x4fc80b,_0xfe1b3d){_0x4fc80b=_0x4fc80b-0x0;var _0x119dba=_0x27f3[_0x4fc80b];return _0x119dba;};'use strict';function FaxAccount(_0x472b68){this['id']=_0x472b68['id']||0x0;this[_0x327f('0x0')]=_0x472b68['name']||'';this[_0x327f('0x1')]=_0x472b68[_0x327f('0x1')];this[_0x327f('0x2')]=_0x472b68[_0x327f('0x2')];this[_0x327f('0x3')]=_0x472b68[_0x327f('0x3')];this['localstationid']=_0x472b68[_0x327f('0x4')];this[_0x327f('0x5')]=_0x472b68['minrate']||0x960;this[_0x327f('0x6')]=_0x472b68[_0x327f('0x6')]||0x3840;this[_0x327f('0x7')]=_0x472b68['modem']||'v17,v27,v29';this[_0x327f('0x8')]=_0x472b68['gateway']||'no';this['faxdetect']=_0x472b68[_0x327f('0x9')]||'no';this[_0x327f('0xa')]=_0x472b68[_0x327f('0xa')]||0x1388;this[_0x327f('0xb')]=_0x472b68[_0x327f('0xb')]||_0x327f('0xc');this[_0x327f('0xd')]=_0x472b68[_0x327f('0xd')]?_0x472b68[_0x327f('0xd')]:undefined;this[_0x327f('0xe')]=_0x472b68['ListId'];this[_0x327f('0xf')]=_0x472b68[_0x327f('0xf')];}module[_0x327f('0x10')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index f11bed4..3e05ad7 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 _0x4971=['name','username','remoteUri','serverUrl','Configurations','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4971,0x72));var _0x1497=function(_0x3767c,_0x16099b){_0x3767c=_0x3767c-0x0;var _0x45dfb8=_0x4971[_0x3767c];return _0x45dfb8;};'use strict';function FreshdeskAccount(_0x13ae06){this['id']=_0x13ae06['id']||0x0;this[_0x1497('0x0')]=_0x13ae06[_0x1497('0x0')]||'';this[_0x1497('0x1')]=_0x13ae06[_0x1497('0x1')]||'';this['apiKey']=_0x13ae06['token']||'';this['remoteUri']=_0x13ae06[_0x1497('0x2')]||'';this[_0x1497('0x3')]=_0x13ae06[_0x1497('0x3')]||'';this[_0x1497('0x4')]=_0x13ae06[_0x1497('0x4')]||{};}module[_0x1497('0x5')]=FreshdeskAccount; \ No newline at end of file +var _0x27d7=['serverUrl','Configurations','exports','name','username','remoteUri'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x27d7,0x1ef));var _0x727d=function(_0xf27a5d,_0x5a3b2f){_0xf27a5d=_0xf27a5d-0x0;var _0x217da7=_0x27d7[_0xf27a5d];return _0x217da7;};'use strict';function FreshdeskAccount(_0x386dd3){this['id']=_0x386dd3['id']||0x0;this[_0x727d('0x0')]=_0x386dd3['name']||'';this[_0x727d('0x1')]=_0x386dd3[_0x727d('0x1')]||'';this['apiKey']=_0x386dd3['token']||'';this[_0x727d('0x2')]=_0x386dd3[_0x727d('0x2')]||'';this['serverUrl']=_0x386dd3[_0x727d('0x3')]||'';this[_0x727d('0x4')]=_0x386dd3['Configurations']||{};}module[_0x727d('0x5')]=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index b8f2274..99c4a29 100644 --- a/server/services/ami/model/freshsalesAccount.js +++ b/server/services/ami/model/freshsalesAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5294=['name','username','apiKey','remoteUri','serverUrl','Configurations','exports'];(function(_0x1f584f,_0x3122ae){var _0x6bc70d=function(_0x3a8136){while(--_0x3a8136){_0x1f584f['push'](_0x1f584f['shift']());}};_0x6bc70d(++_0x3122ae);}(_0x5294,0x111));var _0x4529=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0x5294[_0x134c2e];return _0x2825db;};'use strict';function FreshsalesAccount(_0x4d96f6){this['id']=_0x4d96f6['id']||0x0;this[_0x4529('0x0')]=_0x4d96f6[_0x4529('0x0')]||'';this[_0x4529('0x1')]=_0x4d96f6[_0x4529('0x1')]||'';this[_0x4529('0x2')]=_0x4d96f6['token']||'';this[_0x4529('0x3')]=_0x4d96f6[_0x4529('0x3')]||'';this[_0x4529('0x4')]=_0x4d96f6['serverUrl']||'';this[_0x4529('0x5')]=_0x4d96f6[_0x4529('0x5')]||{};}module[_0x4529('0x6')]=FreshsalesAccount; \ No newline at end of file +var _0xa9b1=['username','apiKey','token','remoteUri','Configurations','exports','name'];(function(_0x593713,_0x5cef2a){var _0x4bf4f3=function(_0x53a549){while(--_0x53a549){_0x593713['push'](_0x593713['shift']());}};_0x4bf4f3(++_0x5cef2a);}(_0xa9b1,0x133));var _0x1a9b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa9b1[_0x3dd15e];return _0x231fd0;};'use strict';function FreshsalesAccount(_0x32f8da){this['id']=_0x32f8da['id']||0x0;this['name']=_0x32f8da[_0x1a9b('0x0')]||'';this[_0x1a9b('0x1')]=_0x32f8da[_0x1a9b('0x1')]||'';this[_0x1a9b('0x2')]=_0x32f8da[_0x1a9b('0x3')]||'';this[_0x1a9b('0x4')]=_0x32f8da['remoteUri']||'';this['serverUrl']=_0x32f8da['serverUrl']||'';this[_0x1a9b('0x5')]=_0x32f8da[_0x1a9b('0x5')]||{};}module[_0x1a9b('0x6')]=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index 6fb6d21..8a9247f 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 _0x3b16=['uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallerexit','queuecallerexitAt','originalposition','connectedlinenum','connectedlinename','accountcode','context','exten','priority','holdtime','assigned','lastAssignedTo','voice','mohtime','variables','exports'];(function(_0x149a9b,_0x5bb275){var _0x2c2bf6=function(_0xfe0c14){while(--_0xfe0c14){_0x149a9b['push'](_0x149a9b['shift']());}};_0x2c2bf6(++_0x5bb275);}(_0x3b16,0x82));var _0x63b1=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0x3b16[_0x55f8b4];return _0x2475f9;};'use strict';function QueueReport(){this['type']='inbound';this[_0x63b1('0x0')]='';this[_0x63b1('0x1')]='';this[_0x63b1('0x2')]='';this[_0x63b1('0x3')]='';this[_0x63b1('0x4')]=null;this[_0x63b1('0x5')]=null;this['position']=0x1;this[_0x63b1('0x6')]=0x1;this[_0x63b1('0x7')]=![];this[_0x63b1('0x8')]=null;this[_0x63b1('0x9')]=![];this['queuecallercompleteAt']=null;this[_0x63b1('0xa')]=![];this[_0x63b1('0xb')]=null;this[_0x63b1('0xc')]=0x1;this['channel']='';this[_0x63b1('0xd')]='';this[_0x63b1('0xe')]='';this[_0x63b1('0xf')]='';this[_0x63b1('0x10')]='';this[_0x63b1('0x11')]='';this[_0x63b1('0x12')]='';this[_0x63b1('0x13')]=0x0;this[_0x63b1('0x14')]=![];this[_0x63b1('0x15')]='';this['motionChannel']=_0x63b1('0x16');this[_0x63b1('0x17')]=0x0;this[_0x63b1('0x18')]={};}module[_0x63b1('0x19')]=QueueReport; \ No newline at end of file +var _0xb814=['queuecallerabandonAt','queuecallercompleteAt','originalposition','channel','connectedlinenum','accountcode','exten','priority','holdtime','lastAssignedTo','motionChannel','voice','mohtime','variables','exports','type','inbound','uniqueid','calleridnum','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandon'];(function(_0x61b3ab,_0x1fc298){var _0x57097f=function(_0x25970b){while(--_0x25970b){_0x61b3ab['push'](_0x61b3ab['shift']());}};_0x57097f(++_0x1fc298);}(_0xb814,0x117));var _0x4b81=function(_0x4f8156,_0x22953d){_0x4f8156=_0x4f8156-0x0;var _0x2aace4=_0xb814[_0x4f8156];return _0x2aace4;};'use strict';function QueueReport(){this[_0x4b81('0x0')]=_0x4b81('0x1');this[_0x4b81('0x2')]='';this[_0x4b81('0x3')]='';this['calleridname']='';this['queue']='';this[_0x4b81('0x4')]=null;this[_0x4b81('0x5')]=null;this[_0x4b81('0x6')]=0x1;this[_0x4b81('0x7')]=0x1;this[_0x4b81('0x8')]=![];this[_0x4b81('0x9')]=null;this['queuecallercomplete']=![];this[_0x4b81('0xa')]=null;this['queuecallerexit']=![];this['queuecallerexitAt']=null;this[_0x4b81('0xb')]=0x1;this[_0x4b81('0xc')]='';this[_0x4b81('0xd')]='';this['connectedlinename']='';this[_0x4b81('0xe')]='';this['context']='';this[_0x4b81('0xf')]='';this[_0x4b81('0x10')]='';this[_0x4b81('0x11')]=0x0;this['assigned']=![];this[_0x4b81('0x12')]='';this[_0x4b81('0x13')]=_0x4b81('0x14');this[_0x4b81('0x15')]=0x0;this[_0x4b81('0x16')]={};}module[_0x4b81('0x17')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index 30e9816..2b21cd8 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 _0x4796=['Configurations','exports','name','username','remoteUri','password','clientId','clientSecret','securityToken','type','serverUrl'];(function(_0x31bab3,_0x44554f){var _0x4fd382=function(_0x42b336){while(--_0x42b336){_0x31bab3['push'](_0x31bab3['shift']());}};_0x4fd382(++_0x44554f);}(_0x4796,0x70));var _0x6479=function(_0x33377d,_0x6031e1){_0x33377d=_0x33377d-0x0;var _0x12254c=_0x4796[_0x33377d];return _0x12254c;};'use strict';function SalesforceAccount(_0x3fcca8){this['id']=_0x3fcca8['id']||0x0;this[_0x6479('0x0')]=_0x3fcca8['name']||'';this['username']=_0x3fcca8[_0x6479('0x1')]||'';this['remoteUri']=_0x3fcca8[_0x6479('0x2')]||'';this[_0x6479('0x3')]=_0x3fcca8['password']||'';this[_0x6479('0x4')]=_0x3fcca8['clientId']||'';this[_0x6479('0x5')]=_0x3fcca8[_0x6479('0x5')]||'';this[_0x6479('0x6')]=_0x3fcca8[_0x6479('0x6')]||'';this[_0x6479('0x7')]=_0x3fcca8['type']||'integrationTab';this[_0x6479('0x8')]=_0x3fcca8[_0x6479('0x8')]||'';this[_0x6479('0x9')]=_0x3fcca8[_0x6479('0x9')]||{};}module[_0x6479('0xa')]=SalesforceAccount; \ No newline at end of file +var _0xe953=['username','remoteUri','password','clientId','securityToken','type','integrationTab','serverUrl','Configurations','name'];(function(_0x3e72f0,_0x493275){var _0x5e1157=function(_0x3b4f09){while(--_0x3b4f09){_0x3e72f0['push'](_0x3e72f0['shift']());}};_0x5e1157(++_0x493275);}(_0xe953,0xf9));var _0x3e95=function(_0xf73c09,_0x4e424e){_0xf73c09=_0xf73c09-0x0;var _0xa8923c=_0xe953[_0xf73c09];return _0xa8923c;};'use strict';function SalesforceAccount(_0x16c358){this['id']=_0x16c358['id']||0x0;this[_0x3e95('0x0')]=_0x16c358[_0x3e95('0x0')]||'';this['username']=_0x16c358[_0x3e95('0x1')]||'';this[_0x3e95('0x2')]=_0x16c358[_0x3e95('0x2')]||'';this[_0x3e95('0x3')]=_0x16c358[_0x3e95('0x3')]||'';this[_0x3e95('0x4')]=_0x16c358[_0x3e95('0x4')]||'';this['clientSecret']=_0x16c358['clientSecret']||'';this[_0x3e95('0x5')]=_0x16c358['securityToken']||'';this[_0x3e95('0x6')]=_0x16c358['type']||_0x3e95('0x7');this[_0x3e95('0x8')]=_0x16c358['serverUrl']||'';this['Configurations']=_0x16c358[_0x3e95('0x9')]||{};}module['exports']=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index 1d4f591..1b08742 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 _0x0c88=['username','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x1262f0,_0x3573c9){var _0xf8efc9=function(_0x4a7ea9){while(--_0x4a7ea9){_0x1262f0['push'](_0x1262f0['shift']());}};_0xf8efc9(++_0x3573c9);}(_0x0c88,0x149));var _0x80c8=function(_0x41382c,_0xc3ffd1){_0x41382c=_0x41382c-0x0;var _0x4da35b=_0x0c88[_0x41382c];return _0x4da35b;};'use strict';function ServicenowAccount(_0x4c08b4){this['id']=_0x4c08b4['id']||0x0;this[_0x80c8('0x0')]=_0x4c08b4[_0x80c8('0x0')]||'';this[_0x80c8('0x1')]=_0x4c08b4['username']||'';this['password']=_0x4c08b4['password']||'';this[_0x80c8('0x2')]=_0x4c08b4[_0x80c8('0x2')]||'';this['serverUrl']=_0x4c08b4[_0x80c8('0x3')]||'';this[_0x80c8('0x4')]=_0x4c08b4[_0x80c8('0x4')]||{};}module[_0x80c8('0x5')]=ServicenowAccount; \ No newline at end of file +var _0xd70d=['name','username','password','remoteUri','serverUrl','Configurations','exports'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xd70d,0x19d));var _0xdd70=function(_0x1d08ac,_0xeb569d){_0x1d08ac=_0x1d08ac-0x0;var _0x26b6f4=_0xd70d[_0x1d08ac];return _0x26b6f4;};'use strict';function ServicenowAccount(_0x4d1227){this['id']=_0x4d1227['id']||0x0;this[_0xdd70('0x0')]=_0x4d1227['name']||'';this[_0xdd70('0x1')]=_0x4d1227['username']||'';this[_0xdd70('0x2')]=_0x4d1227['password']||'';this[_0xdd70('0x3')]=_0x4d1227[_0xdd70('0x3')]||'';this[_0xdd70('0x4')]=_0x4d1227[_0xdd70('0x4')]||'';this[_0xdd70('0x5')]=_0x4d1227[_0xdd70('0x5')]||{};}module[_0xdd70('0x6')]=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index 31038a2..3c9cd55 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 _0xbc70=['remoteUri','serverUrl','exports','name','username','password'];(function(_0x180c9b,_0x13d173){var _0x3ff116=function(_0x241982){while(--_0x241982){_0x180c9b['push'](_0x180c9b['shift']());}};_0x3ff116(++_0x13d173);}(_0xbc70,0x1a1));var _0x0bc7=function(_0x3125ff,_0x2096f6){_0x3125ff=_0x3125ff-0x0;var _0x16f0dd=_0xbc70[_0x3125ff];return _0x16f0dd;};'use strict';function SugarcrmAccount(_0x7d549b){this['id']=_0x7d549b['id']||0x0;this['name']=_0x7d549b[_0x0bc7('0x0')]||'';this[_0x0bc7('0x1')]=_0x7d549b[_0x0bc7('0x1')]||'';this[_0x0bc7('0x2')]=_0x7d549b[_0x0bc7('0x2')]||'';this['remoteUri']=_0x7d549b[_0x0bc7('0x3')]||'';this[_0x0bc7('0x4')]=_0x7d549b[_0x0bc7('0x4')]||'';this['Configurations']=_0x7d549b['Configurations']||{};}module[_0x0bc7('0x5')]=SugarcrmAccount; \ No newline at end of file +var _0xb63c=['password','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x16b24f,_0x59fc8d){var _0x57e2ec=function(_0x25e4b6){while(--_0x25e4b6){_0x16b24f['push'](_0x16b24f['shift']());}};_0x57e2ec(++_0x59fc8d);}(_0xb63c,0x155));var _0xcb63=function(_0x2af359,_0x1b1d8c){_0x2af359=_0x2af359-0x0;var _0x2c2f84=_0xb63c[_0x2af359];return _0x2c2f84;};'use strict';function SugarcrmAccount(_0x49fa82){this['id']=_0x49fa82['id']||0x0;this[_0xcb63('0x0')]=_0x49fa82[_0xcb63('0x0')]||'';this[_0xcb63('0x1')]=_0x49fa82[_0xcb63('0x1')]||'';this[_0xcb63('0x2')]=_0x49fa82[_0xcb63('0x2')]||'';this[_0xcb63('0x3')]=_0x49fa82[_0xcb63('0x3')]||'';this[_0xcb63('0x4')]=_0x49fa82[_0xcb63('0x4')]||'';this[_0xcb63('0x5')]=_0x49fa82[_0xcb63('0x5')]||{};}module[_0xcb63('0x6')]=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index f549251..4d43563 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 _0x7914=['accountcode','state','unknown','stateTime','status','address','exports','name'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7914,0x107));var _0x4791=function(_0x53cfb5,_0x4cde67){_0x53cfb5=_0x53cfb5-0x0;var _0x5d55cc=_0x7914[_0x53cfb5];return _0x5d55cc;};'use strict';function Telephone(_0x33c503){this['id']=_0x33c503['id']||0x0;this[_0x4791('0x0')]=_0x33c503['name']||'';this[_0x4791('0x1')]=_0x33c503[_0x4791('0x1')]||'';this[_0x4791('0x2')]=_0x4791('0x3');this[_0x4791('0x4')]=0x0;this[_0x4791('0x5')]=_0x4791('0x3');this[_0x4791('0x6')]='';}module[_0x4791('0x7')]=Telephone; \ No newline at end of file +var _0xceb0=['exports','accountcode','unknown','stateTime','status'];(function(_0x509273,_0x13fc9f){var _0x38ef40=function(_0xf8d4c9){while(--_0xf8d4c9){_0x509273['push'](_0x509273['shift']());}};_0x38ef40(++_0x13fc9f);}(_0xceb0,0x173));var _0x0ceb=function(_0x3f3107,_0x2b7937){_0x3f3107=_0x3f3107-0x0;var _0x18e9cf=_0xceb0[_0x3f3107];return _0x18e9cf;};'use strict';function Telephone(_0x5c19fb){this['id']=_0x5c19fb['id']||0x0;this['name']=_0x5c19fb['name']||'';this['accountcode']=_0x5c19fb[_0x0ceb('0x0')]||'';this['state']=_0x0ceb('0x1');this[_0x0ceb('0x2')]=0x0;this[_0x0ceb('0x3')]='unknown';this['address']='';}module[_0x0ceb('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 823098a..02687e1 100644 --- a/server/services/ami/model/template.js +++ b/server/services/ami/model/template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['name','html'];(function(_0x4feaad,_0x1fe0de){var _0x1ca56e=function(_0xdf4714){while(--_0xdf4714){_0x4feaad['push'](_0x4feaad['shift']());}};_0x1ca56e(++_0x1fe0de);}(_0xb10b,0x12a));var _0xbb10=function(_0x44ea1b,_0x36bbd3){_0x44ea1b=_0x44ea1b-0x0;var _0x239690=_0xb10b[_0x44ea1b];return _0x239690;};'use strict';function template(_0x13ce8d){this['id']=_0x13ce8d['id']||0x0;this['name']=_0x13ce8d[_0xbb10('0x0')]||'';this[_0xbb10('0x1')]=_0x13ce8d[_0xbb10('0x1')]||'';}module['exports']=template; \ No newline at end of file +var _0xb10b=['name','html'];(function(_0x1766df,_0x33b7d3){var _0x19b492=function(_0x45a847){while(--_0x45a847){_0x1766df['push'](_0x1766df['shift']());}};_0x19b492(++_0x33b7d3);}(_0xb10b,0x12a));var _0xbb10=function(_0x2ec7f2,_0xe24da3){_0x2ec7f2=_0x2ec7f2-0x0;var _0x29de00=_0xb10b[_0x2ec7f2];return _0x29de00;};'use strict';function template(_0x13ce8d){this['id']=_0x13ce8d['id']||0x0;this['name']=_0x13ce8d[_0xbb10('0x0')]||'';this[_0xbb10('0x1')]=_0x13ce8d[_0xbb10('0x1')]||'';}module['exports']=template; \ No newline at end of file diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index 87ada58..d8fea8a 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 _0xda2d=['channel','voice','AllConditions','AnyConditions','Actions','exports','name'];(function(_0x30c061,_0x30ccd7){var _0x2551d0=function(_0x58b2e5){while(--_0x58b2e5){_0x30c061['push'](_0x30c061['shift']());}};_0x2551d0(++_0x30ccd7);}(_0xda2d,0x102));var _0xdda2=function(_0x20d5c4,_0x1d26a9){_0x20d5c4=_0x20d5c4-0x0;var _0x19ecae=_0xda2d[_0x20d5c4];return _0x19ecae;};'use strict';function Trigger(_0x2625ed){this['id']=_0x2625ed['id']||0x0;this[_0xdda2('0x0')]=_0x2625ed[_0xdda2('0x0')]||'';this[_0xdda2('0x1')]=_0x2625ed[_0xdda2('0x1')]||_0xdda2('0x2');this['status']=_0x2625ed['status']||![];this['AllConditions']=_0x2625ed[_0xdda2('0x3')]||[];this[_0xdda2('0x4')]=_0x2625ed[_0xdda2('0x4')]||[];this[_0xdda2('0x5')]=_0x2625ed[_0xdda2('0x5')]||[];}module[_0xdda2('0x6')]=Trigger; \ No newline at end of file +var _0xb7e7=['Actions','exports','name','channel','status','AllConditions','AnyConditions'];(function(_0x4caf4f,_0x1f9d37){var _0xf64dd9=function(_0x37507){while(--_0x37507){_0x4caf4f['push'](_0x4caf4f['shift']());}};_0xf64dd9(++_0x1f9d37);}(_0xb7e7,0x121));var _0x7b7e=function(_0x513aa5,_0x1fba79){_0x513aa5=_0x513aa5-0x0;var _0x1a1a7c=_0xb7e7[_0x513aa5];return _0x1a1a7c;};'use strict';function Trigger(_0x2e5e07){this['id']=_0x2e5e07['id']||0x0;this['name']=_0x2e5e07[_0x7b7e('0x0')]||'';this['channel']=_0x2e5e07[_0x7b7e('0x1')]||'voice';this[_0x7b7e('0x2')]=_0x2e5e07['status']||![];this[_0x7b7e('0x3')]=_0x2e5e07[_0x7b7e('0x3')]||[];this[_0x7b7e('0x4')]=_0x2e5e07['AnyConditions']||[];this['Actions']=_0x2e5e07[_0x7b7e('0x5')]||[];}module[_0x7b7e('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 26df1c4..1ccbe3e 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 _0x82d3=['exports','active','state','unknown','status','registry','indexOf','split','host','port','domain','domainport','refresh','stateRegistry','registrationtime','address','defaultuser'];(function(_0x355092,_0x10e360){var _0x5a535d=function(_0x957553){while(--_0x957553){_0x355092['push'](_0x355092['shift']());}};_0x5a535d(++_0x10e360);}(_0x82d3,0x1ee));var _0x382d=function(_0x4a874c,_0x34a3c9){_0x4a874c=_0x4a874c-0x0;var _0x569f0b=_0x82d3[_0x4a874c];return _0x569f0b;};'use strict';function Trunk(_0x39fca1){this['id']=_0x39fca1['id']||0x0;this[_0x382d('0x0')]=_0x39fca1['active']||![];this['name']=_0x39fca1['name']||'';this[_0x382d('0x1')]=_0x382d('0x2');this['stateTime']=0x0;this[_0x382d('0x3')]=_0x382d('0x2');this[_0x382d('0x4')]=_0x39fca1[_0x382d('0x4')]&&_0x39fca1[_0x382d('0x4')][_0x382d('0x5')](':')?_0x39fca1[_0x382d('0x4')][_0x382d('0x6')](':')[0x0]:'';this[_0x382d('0x7')]='';this[_0x382d('0x8')]='';this[_0x382d('0x9')]='';this[_0x382d('0xa')]='';this[_0x382d('0xb')]='';this[_0x382d('0xc')]=_0x382d('0x2');this[_0x382d('0xd')]='';this[_0x382d('0xe')]='';this[_0x382d('0xf')]=_0x39fca1['defaultuser']||'';}module[_0x382d('0x10')]=Trunk; \ No newline at end of file +var _0x3785=['registrationtime','defaultuser','exports','active','name','status','unknown','registry','indexOf','split','host','port','refresh','stateRegistry'];(function(_0x10e189,_0x34a620){var _0x5c7c24=function(_0x3a57ab){while(--_0x3a57ab){_0x10e189['push'](_0x10e189['shift']());}};_0x5c7c24(++_0x34a620);}(_0x3785,0x17d));var _0x5378=function(_0x494d1f,_0x3f72ff){_0x494d1f=_0x494d1f-0x0;var _0x457b6e=_0x3785[_0x494d1f];return _0x457b6e;};'use strict';function Trunk(_0x53a082){this['id']=_0x53a082['id']||0x0;this['active']=_0x53a082[_0x5378('0x0')]||![];this[_0x5378('0x1')]=_0x53a082[_0x5378('0x1')]||'';this['state']='unknown';this['stateTime']=0x0;this[_0x5378('0x2')]=_0x5378('0x3');this[_0x5378('0x4')]=_0x53a082['registry']&&_0x53a082[_0x5378('0x4')][_0x5378('0x5')](':')?_0x53a082[_0x5378('0x4')][_0x5378('0x6')](':')[0x0]:'';this[_0x5378('0x7')]='';this[_0x5378('0x8')]='';this['domain']='';this['domainport']='';this[_0x5378('0x9')]='';this[_0x5378('0xa')]=_0x5378('0x3');this[_0x5378('0xb')]='';this['address']='';this[_0x5378('0xc')]=_0x53a082['defaultuser']||'';}module[_0x5378('0xd')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index 1185790..1682235 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 _0xe004=['mandatoryDisposition','exports','exten','recordingFormat','none'];(function(_0x31427d,_0x87fb83){var _0x1eb348=function(_0x297ce3){while(--_0x297ce3){_0x31427d['push'](_0x31427d['shift']());}};_0x1eb348(++_0x87fb83);}(_0xe004,0xa2));var _0x4e00=function(_0x2fea68,_0x31caf5){_0x2fea68=_0x2fea68-0x0;var _0x4576e4=_0xe004[_0x2fea68];return _0x4576e4;};'use strict';function voiceExtension(_0x370e9){this['id']=_0x370e9['id']||0x0;this[_0x4e00('0x0')]=_0x370e9[_0x4e00('0x0')]||'';this['recordingFormat']=_0x370e9[_0x4e00('0x1')]||_0x4e00('0x2');this['mandatoryDisposition']=_0x370e9[_0x4e00('0x3')]||![];}module[_0x4e00('0x4')]=voiceExtension; \ No newline at end of file +var _0x62c5=['exports','exten','recordingFormat','mandatoryDisposition'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x62c5,0x1a1));var _0x562c=function(_0x215863,_0x44609a){_0x215863=_0x215863-0x0;var _0x4d5f5c=_0x62c5[_0x215863];return _0x4d5f5c;};'use strict';function voiceExtension(_0x160540){this['id']=_0x160540['id']||0x0;this[_0x562c('0x0')]=_0x160540['exten']||'';this[_0x562c('0x1')]=_0x160540[_0x562c('0x1')]||'none';this[_0x562c('0x2')]=_0x160540[_0x562c('0x2')]||![];}module[_0x562c('0x3')]=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index 2a843fb..b132bd1 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 _0x0b3d=['leastrecent','random','roundrobin','rrordered','wrandom','name','monitor_format','type','total','sumDuration','sumHoldTime','abandoned','available','busy','inUse','notInUse','onHold','paused','ringing','ringInUse','talking','unavailable','acw','acwTimeout','autopause','sendMessageOneNotActive','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayACS','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalAvailable','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','queueSummaryCountersUpdated','exports','wav','gsm'];(function(_0x421725,_0x318a04){var _0x51b322=function(_0xe58018){while(--_0xe58018){_0x421725['push'](_0x421725['shift']());}};_0x51b322(++_0x318a04);}(_0x0b3d,0x76));var _0xd0b3=function(_0xba6b88,_0x4f1e92){_0xba6b88=_0xba6b88-0x0;var _0x575135=_0x0b3d[_0xba6b88];return _0x575135;};'use strict';var monitorFormat={'wav':_0xd0b3('0x0'),'wav49':'wav49','gsm':_0xd0b3('0x1')};var strategy={'fewestcalls':'fewestcalls','leastrecent':_0xd0b3('0x2'),'linear':'linear','random':_0xd0b3('0x3'),'ringall':'ringall','rr':_0xd0b3('0x4'),'rrmemory':'rrmemory','rrordered':_0xd0b3('0x5'),'wrandom':_0xd0b3('0x6')};function VoiceQueue(_0x5b80df){this['id']=_0x5b80df['id']||0x0;this[_0xd0b3('0x7')]=_0x5b80df['name']||'';this[_0xd0b3('0x8')]=_0x5b80df['monitor_format']||'';this['type']=_0x5b80df[_0xd0b3('0x9')]||'inbound';this['waiting']=0x0;this[_0xd0b3('0xa')]=0x0;this['answered']=0x0;this[_0xd0b3('0xb')]=0x0;this[_0xd0b3('0xc')]=0x0;this['sumBillable']=0x0;this['unmanaged']=0x0;this[_0xd0b3('0xd')]=0x0;this[_0xd0b3('0xe')]=0x0;this[_0xd0b3('0xf')]=0x0;this[_0xd0b3('0x10')]=0x0;this['invalid']=0x0;this['loggedIn']=0x0;this[_0xd0b3('0x11')]=0x0;this[_0xd0b3('0x12')]=0x0;this[_0xd0b3('0x13')]=0x0;this[_0xd0b3('0x14')]=0x0;this[_0xd0b3('0x15')]=0x0;this[_0xd0b3('0x16')]=0x0;this[_0xd0b3('0x17')]=0x0;this['unknown']=0x0;this[_0xd0b3('0x18')]=_0x5b80df[_0xd0b3('0x18')]||![];this[_0xd0b3('0x19')]=_0x5b80df[_0xd0b3('0x19')]||0xa;this['autopause']=_0x5b80df[_0xd0b3('0x1a')]||'no';this[_0xd0b3('0x1b')]=!![];this[_0xd0b3('0x1c')]='';this['statusMessage']='';this[_0xd0b3('0x1d')]=0x0;this[_0xd0b3('0x1e')]=0x0;this['dialTimezone']=_0x5b80df[_0xd0b3('0x1f')]||null;this[_0xd0b3('0x20')]=_0x5b80df['dialGlobalInterval']?_0x5b80df[_0xd0b3('0x20')]:null;this[_0xd0b3('0x21')]=_0x5b80df[_0xd0b3('0x21')];this['dialMethod']=_0x5b80df[_0xd0b3('0x22')]||_0xd0b3('0x23');this[_0xd0b3('0x24')]=_0x5b80df['dialLimitChannel']||0x0;this['dialLimitQueue']=_0x5b80df[_0xd0b3('0x25')]||0x0;this['dialPowerLevel']=_0x5b80df[_0xd0b3('0x26')]||0x1;this[_0xd0b3('0x27')]=_0x5b80df[_0xd0b3('0x27')]||_0xd0b3('0x28');this[_0xd0b3('0x29')]=_0x5b80df['dialPredictiveOptimizationPercentage']||0.03;this['dialPredictiveInterval']=_0x5b80df['dialPredictiveInterval']||0x258;this[_0xd0b3('0x2a')]=_0x5b80df[_0xd0b3('0x2a')]||_0xd0b3('0x2b');this[_0xd0b3('0x2c')]=_0x5b80df[_0xd0b3('0x2c')]||'anonymous';this[_0xd0b3('0x2d')]=_0x5b80df[_0xd0b3('0x2d')]||0x1e;this[_0xd0b3('0x2e')]=_0x5b80df[_0xd0b3('0x2e')]||'tTxX';this[_0xd0b3('0x2f')]=_0x5b80df[_0xd0b3('0x2f')]||0x3;this[_0xd0b3('0x30')]=_0x5b80df['dialQueueProject']||undefined;this[_0xd0b3('0x31')]=_0x5b80df[_0xd0b3('0x31')]||0x3;this[_0xd0b3('0x32')]=_0x5b80df[_0xd0b3('0x32')]||0x96;this['dialBusyMaxRetry']=_0x5b80df[_0xd0b3('0x33')]||0x3;this[_0xd0b3('0x34')]=_0x5b80df['dialBusyRetryFrequency']||0x96;this[_0xd0b3('0x35')]=_0x5b80df[_0xd0b3('0x35')]||0x3;this['dialNoAnswerRetryFrequency']=_0x5b80df[_0xd0b3('0x36')]||0x96;this['dialNoSuchNumberMaxRetry']=_0x5b80df[_0xd0b3('0x37')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x5b80df[_0xd0b3('0x38')]||0x96;this[_0xd0b3('0x39')]=_0x5b80df[_0xd0b3('0x39')]||0x3;this[_0xd0b3('0x3a')]=_0x5b80df[_0xd0b3('0x3a')]||0x96;this[_0xd0b3('0x3b')]=_0x5b80df[_0xd0b3('0x3b')]||0x3;this['dialAbandonedRetryFrequency']=_0x5b80df[_0xd0b3('0x3c')]||0x96;this[_0xd0b3('0x3d')]=_0x5b80df[_0xd0b3('0x3d')]||0x3;this[_0xd0b3('0x3e')]=_0x5b80df['dialMachineRetryFrequency']||0x96;this[_0xd0b3('0x3f')]=_0x5b80df[_0xd0b3('0x3f')]||0x3;this[_0xd0b3('0x40')]=_0x5b80df[_0xd0b3('0x40')]||0x96;this['callAdditionalPhoneAfterMin']=_0x5b80df[_0xd0b3('0x41')]||0x3;this[_0xd0b3('0x42')]=_0x5b80df[_0xd0b3('0x42')]||0x4;this[_0xd0b3('0x43')]=_0x5b80df[_0xd0b3('0x43')]?_0x5b80df[_0xd0b3('0x43')]:undefined;this[_0xd0b3('0x44')]=_0x5b80df[_0xd0b3('0x44')]?_0x5b80df[_0xd0b3('0x44')]:undefined;this[_0xd0b3('0x45')]=_0x5b80df[_0xd0b3('0x45')]||undefined;this[_0xd0b3('0x46')]=_0x5b80df[_0xd0b3('0x46')]?_0x5b80df[_0xd0b3('0x46')]:undefined;this['dialOrderByScheduledAt']=_0x5b80df[_0xd0b3('0x47')]||_0xd0b3('0x48');this[_0xd0b3('0x49')]=_0x5b80df[_0xd0b3('0x49')]||undefined;this['dialCutDigit']=_0x5b80df['dialCutDigit']||undefined;this['strategy']=strategy[_0x5b80df[_0xd0b3('0x4a')]];this[_0xd0b3('0x4b')]=!![];this[_0xd0b3('0x4c')]=_0x5b80df[_0xd0b3('0x4c')]||![];this[_0xd0b3('0x4d')]=_0x5b80df[_0xd0b3('0x4d')];this['dialAMDGreeting']=_0x5b80df[_0xd0b3('0x4e')];this[_0xd0b3('0x4f')]=_0x5b80df[_0xd0b3('0x4f')];this[_0xd0b3('0x50')]=_0x5b80df[_0xd0b3('0x50')];this[_0xd0b3('0x51')]=_0x5b80df[_0xd0b3('0x51')];this[_0xd0b3('0x52')]=_0x5b80df[_0xd0b3('0x52')];this[_0xd0b3('0x53')]=_0x5b80df[_0xd0b3('0x53')];this['dialAMDSilenceThreshold']=_0x5b80df['dialAMDSilenceThreshold'];this[_0xd0b3('0x54')]=_0x5b80df[_0xd0b3('0x54')];this[_0xd0b3('0x55')]=0x0;this[_0xd0b3('0x56')]=0x0;this[_0xd0b3('0x57')]=_0x5b80df[_0xd0b3('0x57')];this['outboundAnswerCallsDay']=0x0;this[_0xd0b3('0x58')]=0x0;this['outboundNoAnswerCallsDay']=0x0;this[_0xd0b3('0x59')]=0x0;this[_0xd0b3('0x5a')]=0x0;this[_0xd0b3('0x5b')]=0x0;this[_0xd0b3('0x5c')]=0x0;this[_0xd0b3('0x5d')]=0x0;this['outboundOriginateFailureCallsDay']=0x0;this['outboundDropCallsDayCallersExit']=0x0;this[_0xd0b3('0x5e')]=0x0;this[_0xd0b3('0x5f')]=0x0;this['outboundReCallsDay']=0x0;this['outboundAbandonedDay']=0x0;this['startProgressive']=undefined;this[_0xd0b3('0x60')]=undefined;this[_0xd0b3('0x61')]=undefined;this[_0xd0b3('0x62')]=1.05;this['predictiveIntervalTotalCalls']=0x0;this['predictiveIntervalAnsweredCalls']=0x0;this[_0xd0b3('0x63')]=0x0;this[_0xd0b3('0x64')]=0x0;this[_0xd0b3('0x65')]=0x0;this[_0xd0b3('0x66')]=0x0;this['predictiveIntervalPauses']=0x0;this[_0xd0b3('0x67')]=0x0;this['predictiveIntervalMaxThreshold']=_0x5b80df[_0xd0b3('0x68')]||0x14;this['predictiveIntervalMinThreshold']=_0x5b80df[_0xd0b3('0x68')]||0xa;this[_0xd0b3('0x69')]=0x0;this['predictiveIntervalErlangCallsDroppedCalls']=0x0;this['predictiveIntervalHitRate']=0x1;this['erlangCalls']=0x0;this[_0xd0b3('0x6a')]=0x0;this[_0xd0b3('0x6b')]=0x0;this[_0xd0b3('0x6c')]=0x0;this['dialRecallMeTimeout']=_0x5b80df[_0xd0b3('0x6d')]||0x1e;this[_0xd0b3('0x6e')]=_0x5b80df[_0xd0b3('0x6e')]||![];this[_0xd0b3('0x6f')]=!!_0x5b80df[_0xd0b3('0x6f')]||![];this[_0xd0b3('0x70')]=!!_0x5b80df['dialPreviewRecallmeReminder']||![];this[_0xd0b3('0x71')]=_0x5b80df['dialQueueProject2']||undefined;this[_0xd0b3('0x72')]=_0x5b80df[_0xd0b3('0x72')]||![];this[_0xd0b3('0x73')]=_0x5b80df[_0xd0b3('0x73')]||![];this[_0xd0b3('0x8')]=monitorFormat[_0x5b80df[_0xd0b3('0x8')]]?monitorFormat[_0x5b80df[_0xd0b3('0x8')]]:undefined;this[_0xd0b3('0x74')]=_0x5b80df['mandatoryDisposition']||![];this[_0xd0b3('0x75')]=_0x5b80df[_0xd0b3('0x75')]?_0x5b80df[_0xd0b3('0x75')]:undefined;this[_0xd0b3('0x76')]=![];}module[_0xd0b3('0x77')]=VoiceQueue; \ No newline at end of file +var _0x342a=['outboundBusyCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundReCallsDay','startProgressive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCallsDroppedCalls','erlangCallToSecond','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','wav','wav49','gsm','fewestcalls','linear','random','ringall','roundrobin','rrmemory','rrordered','wrandom','name','monitor_format','type','inbound','waiting','total','answered','sumDuration','sumHoldTime','sumBillable','unmanaged','abandoned','available','busy','inUse','invalid','notInUse','onHold','paused','ringing','talking','unavailable','unknown','acw','acwTimeout','autopause','message','statusMessage','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','anonymous','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundNoAnswerCallsDay'];(function(_0x28423d,_0xd2f58f){var _0x1b4ec3=function(_0x5be9b1){while(--_0x5be9b1){_0x28423d['push'](_0x28423d['shift']());}};_0x1b4ec3(++_0xd2f58f);}(_0x342a,0xa2));var _0xa342=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x342a[_0x2f5ac5];return _0x37c9a8;};'use strict';var monitorFormat={'wav':_0xa342('0x0'),'wav49':_0xa342('0x1'),'gsm':_0xa342('0x2')};var strategy={'fewestcalls':_0xa342('0x3'),'leastrecent':'leastrecent','linear':_0xa342('0x4'),'random':_0xa342('0x5'),'ringall':_0xa342('0x6'),'rr':_0xa342('0x7'),'rrmemory':_0xa342('0x8'),'rrordered':_0xa342('0x9'),'wrandom':_0xa342('0xa')};function VoiceQueue(_0xe4f458){this['id']=_0xe4f458['id']||0x0;this[_0xa342('0xb')]=_0xe4f458[_0xa342('0xb')]||'';this[_0xa342('0xc')]=_0xe4f458[_0xa342('0xc')]||'';this['type']=_0xe4f458[_0xa342('0xd')]||_0xa342('0xe');this[_0xa342('0xf')]=0x0;this[_0xa342('0x10')]=0x0;this[_0xa342('0x11')]=0x0;this[_0xa342('0x12')]=0x0;this[_0xa342('0x13')]=0x0;this[_0xa342('0x14')]=0x0;this[_0xa342('0x15')]=0x0;this[_0xa342('0x16')]=0x0;this[_0xa342('0x17')]=0x0;this[_0xa342('0x18')]=0x0;this[_0xa342('0x19')]=0x0;this[_0xa342('0x1a')]=0x0;this['loggedIn']=0x0;this[_0xa342('0x1b')]=0x0;this[_0xa342('0x1c')]=0x0;this[_0xa342('0x1d')]=0x0;this[_0xa342('0x1e')]=0x0;this['ringInUse']=0x0;this[_0xa342('0x1f')]=0x0;this[_0xa342('0x20')]=0x0;this[_0xa342('0x21')]=0x0;this[_0xa342('0x22')]=_0xe4f458['acw']||![];this[_0xa342('0x23')]=_0xe4f458[_0xa342('0x23')]||0xa;this[_0xa342('0x24')]=_0xe4f458[_0xa342('0x24')]||'no';this['sendMessageOneNotActive']=!![];this[_0xa342('0x25')]='';this[_0xa342('0x26')]='';this['originated']=0x0;this[_0xa342('0x27')]=0x0;this[_0xa342('0x28')]=_0xe4f458[_0xa342('0x28')]||null;this[_0xa342('0x29')]=_0xe4f458[_0xa342('0x29')]?_0xe4f458['dialGlobalInterval']:null;this[_0xa342('0x2a')]=_0xe4f458[_0xa342('0x2a')];this['dialMethod']=_0xe4f458[_0xa342('0x2b')]||_0xa342('0x2c');this[_0xa342('0x2d')]=_0xe4f458[_0xa342('0x2d')]||0x0;this['dialLimitQueue']=_0xe4f458[_0xa342('0x2e')]||0x0;this[_0xa342('0x2f')]=_0xe4f458[_0xa342('0x2f')]||0x1;this[_0xa342('0x30')]=_0xe4f458['dialPredictiveOptimization']||_0xa342('0x31');this[_0xa342('0x32')]=_0xe4f458['dialPredictiveOptimizationPercentage']||0.03;this[_0xa342('0x33')]=_0xe4f458[_0xa342('0x33')]||0x258;this[_0xa342('0x34')]=_0xe4f458[_0xa342('0x34')]||'anonymous';this[_0xa342('0x35')]=_0xe4f458[_0xa342('0x35')]||_0xa342('0x36');this[_0xa342('0x37')]=_0xe4f458['dialOriginateTimeout']||0x1e;this[_0xa342('0x38')]=_0xe4f458[_0xa342('0x38')]||'tTxX';this[_0xa342('0x39')]=_0xe4f458['dialQueueTimeout']||0x3;this['dialQueueProject']=_0xe4f458[_0xa342('0x3a')]||undefined;this[_0xa342('0x3b')]=_0xe4f458[_0xa342('0x3b')]||0x3;this[_0xa342('0x3c')]=_0xe4f458['dialCongestionRetryFrequency']||0x96;this['dialBusyMaxRetry']=_0xe4f458[_0xa342('0x3d')]||0x3;this[_0xa342('0x3e')]=_0xe4f458[_0xa342('0x3e')]||0x96;this['dialNoAnswerMaxRetry']=_0xe4f458['dialNoAnswerMaxRetry']||0x3;this[_0xa342('0x3f')]=_0xe4f458[_0xa342('0x3f')]||0x96;this['dialNoSuchNumberMaxRetry']=_0xe4f458[_0xa342('0x40')]||0x3;this[_0xa342('0x41')]=_0xe4f458[_0xa342('0x41')]||0x96;this[_0xa342('0x42')]=_0xe4f458[_0xa342('0x42')]||0x3;this[_0xa342('0x43')]=_0xe4f458[_0xa342('0x43')]||0x96;this[_0xa342('0x44')]=_0xe4f458[_0xa342('0x44')]||0x3;this['dialAbandonedRetryFrequency']=_0xe4f458[_0xa342('0x45')]||0x96;this[_0xa342('0x46')]=_0xe4f458[_0xa342('0x46')]||0x3;this[_0xa342('0x47')]=_0xe4f458['dialMachineRetryFrequency']||0x96;this[_0xa342('0x48')]=_0xe4f458['dialAgentRejectMaxRetry']||0x3;this[_0xa342('0x49')]=_0xe4f458['dialAgentRejectRetryFrequency']||0x96;this[_0xa342('0x4a')]=_0xe4f458[_0xa342('0x4a')]||0x3;this[_0xa342('0x4b')]=_0xe4f458[_0xa342('0x4b')]||0x4;this[_0xa342('0x4c')]=_0xe4f458[_0xa342('0x4c')]?_0xe4f458[_0xa342('0x4c')]:undefined;this['TrunkBackup']=_0xe4f458['TrunkBackup']?_0xe4f458[_0xa342('0x4d')]:undefined;this[_0xa342('0x4e')]=_0xe4f458['dialPrefix']||undefined;this[_0xa342('0x4f')]=_0xe4f458[_0xa342('0x4f')]?_0xe4f458[_0xa342('0x4f')]:undefined;this['dialOrderByScheduledAt']=_0xe4f458['dialOrderByScheduledAt']||_0xa342('0x50');this[_0xa342('0x51')]=_0xe4f458['dialRandomLastDigitCallerIdNumber']||undefined;this[_0xa342('0x52')]=_0xe4f458['dialCutDigit']||undefined;this[_0xa342('0x53')]=strategy[_0xe4f458[_0xa342('0x53')]];this['queueStatusComplete']=!![];this[_0xa342('0x54')]=_0xe4f458[_0xa342('0x54')]||![];this[_0xa342('0x55')]=_0xe4f458['dialAMDInitialSilence'];this['dialAMDGreeting']=_0xe4f458[_0xa342('0x56')];this[_0xa342('0x57')]=_0xe4f458[_0xa342('0x57')];this[_0xa342('0x58')]=_0xe4f458[_0xa342('0x58')];this['dialAMDMinWordLength']=_0xe4f458[_0xa342('0x59')];this[_0xa342('0x5a')]=_0xe4f458['dialAMDBetweenWordsSilence'];this[_0xa342('0x5b')]=_0xe4f458[_0xa342('0x5b')];this['dialAMDSilenceThreshold']=_0xe4f458['dialAMDSilenceThreshold'];this['dialAMDMaximumWordLength']=_0xe4f458[_0xa342('0x5c')];this[_0xa342('0x5d')]=0x0;this[_0xa342('0x5e')]=0x0;this[_0xa342('0x5f')]=_0xe4f458[_0xa342('0x5f')];this[_0xa342('0x60')]=0x0;this['outboundAnswerAgiCallsDay']=0x0;this[_0xa342('0x61')]=0x0;this[_0xa342('0x62')]=0x0;this['outboundCongestionCallsDay']=0x0;this[_0xa342('0x63')]=0x0;this[_0xa342('0x64')]=0x0;this[_0xa342('0x65')]=0x0;this[_0xa342('0x66')]=0x0;this[_0xa342('0x67')]=0x0;this[_0xa342('0x68')]=0x0;this['outboundDropCallsDayACS']=0x0;this[_0xa342('0x69')]=0x0;this['outboundAbandonedDay']=0x0;this[_0xa342('0x6a')]=undefined;this['startPredictive']=undefined;this[_0xa342('0x6b')]=undefined;this[_0xa342('0x6c')]=1.05;this[_0xa342('0x6d')]=0x0;this[_0xa342('0x6e')]=0x0;this[_0xa342('0x6f')]=0x0;this[_0xa342('0x70')]=0x0;this[_0xa342('0x71')]=0x0;this['predictiveIntervalAvgTalktime']=0x0;this[_0xa342('0x72')]=0x0;this[_0xa342('0x73')]=0x0;this[_0xa342('0x74')]=_0xe4f458[_0xa342('0x75')]||0x14;this[_0xa342('0x76')]=_0xe4f458[_0xa342('0x75')]||0xa;this['predictiveIntervalErlangCalls']=0x0;this[_0xa342('0x77')]=0x0;this['predictiveIntervalHitRate']=0x1;this['erlangCalls']=0x0;this[_0xa342('0x78')]=0x0;this['erlangAbandonmentRate']=0x0;this[_0xa342('0x79')]=0x0;this[_0xa342('0x7a')]=_0xe4f458['dialRecallMeTimeout']||0x1e;this[_0xa342('0x7b')]=_0xe4f458['dialRecallInQueue']||![];this[_0xa342('0x7c')]=!!_0xe4f458[_0xa342('0x7c')]||![];this[_0xa342('0x7d')]=!!_0xe4f458[_0xa342('0x7d')]||![];this['dialQueueProject2']=_0xe4f458['dialQueueProject2']||undefined;this[_0xa342('0x7e')]=_0xe4f458[_0xa342('0x7e')]||![];this[_0xa342('0x7f')]=_0xe4f458['dialAgiAfterHangupAgent']||![];this['monitor_format']=monitorFormat[_0xe4f458['monitor_format']]?monitorFormat[_0xe4f458[_0xa342('0xc')]]:undefined;this[_0xa342('0x80')]=_0xe4f458[_0xa342('0x80')]||![];this['mandatoryDispositionPause']=_0xe4f458['mandatoryDispositionPause']?_0xe4f458[_0xa342('0x81')]:undefined;this['queueSummaryCountersUpdated']=![];}module['exports']=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueueSummary.js b/server/services/ami/model/voiceQueueSummary.js index 72eadd9..6b94be7 100644 --- a/server/services/ami/model/voiceQueueSummary.js +++ b/server/services/ami/model/voiceQueueSummary.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe002=['paused','sumBillable','sumDuration','total','name','strategy','busy','invalid','onHold','notInUse','ringInUse','sumHoldTime','type','unavailable','unknown','unmanaged','outbound','pTalking','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','message','statusMessage','Trunk','active','callerid','prototype','createReport','loggedin','callers','length','SIP/','incall','includes','status','booked','keys','dialer','xcally-motion-preview','compareToInboundQueue','some','updateReportFromOutboundQueue','preview','exports','available','loggedIn','loggedInDb','ringing','talking','waiting','answered','inUse','originated','outboundAbandonedCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundNoAnswerCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay'];(function(_0x1554e6,_0x28607d){var _0x4cafbf=function(_0x478aaf){while(--_0x478aaf){_0x1554e6['push'](_0x1554e6['shift']());}};_0x4cafbf(++_0x28607d);}(_0xe002,0xf7));var _0x2e00=function(_0x15f8ad,_0x5275c3){_0x15f8ad=_0x15f8ad-0x0;var _0xc0238a=_0xe002[_0x15f8ad];return _0xc0238a;};'use strict';var INBOUND_COUNTERS=[_0x2e00('0x0'),_0x2e00('0x1'),_0x2e00('0x2'),'paused',_0x2e00('0x3'),_0x2e00('0x4'),_0x2e00('0x5')];var OUTBOUND_COUNTERS=['available',_0x2e00('0x6'),_0x2e00('0x7'),_0x2e00('0x1'),_0x2e00('0x2'),_0x2e00('0x8'),_0x2e00('0x9'),_0x2e00('0xa'),_0x2e00('0xb'),'outboundBusyCallsDay',_0x2e00('0xc'),_0x2e00('0xd'),'outboundNoSuchCallsDay',_0x2e00('0xe'),_0x2e00('0xf'),_0x2e00('0x10'),_0x2e00('0x11'),'pTalking','talking',_0x2e00('0x12'),_0x2e00('0x13'),_0x2e00('0x14'),'waiting'];function VoiceQueueSummary(_0x9a9d02){this['id']=_0x9a9d02['id'];this[_0x2e00('0x15')]=_0x9a9d02[_0x2e00('0x15')];this[_0x2e00('0x16')]=_0x9a9d02[_0x2e00('0x16')];this['abandoned']=_0x9a9d02['abandoned']||0x0;this[_0x2e00('0x6')]=_0x9a9d02[_0x2e00('0x6')]||0x0;this[_0x2e00('0x0')]=_0x9a9d02[_0x2e00('0x0')]||0x0;this[_0x2e00('0x17')]=_0x9a9d02['busy']||0x0;this[_0x2e00('0x7')]=_0x9a9d02['inUse']||0x0;this[_0x2e00('0x18')]=_0x9a9d02[_0x2e00('0x18')]||0x0;this['loggedIn']=_0x9a9d02[_0x2e00('0x1')]||0x0;this[_0x2e00('0x2')]=_0x9a9d02[_0x2e00('0x2')]||0x0;this[_0x2e00('0x19')]=_0x9a9d02['onHold']||0x0;this[_0x2e00('0x1a')]=_0x9a9d02[_0x2e00('0x1a')]||0x0;this['paused']=_0x9a9d02[_0x2e00('0x11')]||0x0;this[_0x2e00('0x3')]=_0x9a9d02[_0x2e00('0x3')]||0x0;this['ringInUse']=_0x9a9d02[_0x2e00('0x1b')];this[_0x2e00('0x12')]=_0x9a9d02['sumBillable'];this['sumDuration']=_0x9a9d02['sumDuration'];this['sumHoldTime']=_0x9a9d02[_0x2e00('0x1c')]||0x0;this[_0x2e00('0x4')]=_0x9a9d02[_0x2e00('0x4')]||0x0;this['total']=_0x9a9d02[_0x2e00('0x14')]||0x0;this[_0x2e00('0x1d')]=_0x9a9d02[_0x2e00('0x1d')];this[_0x2e00('0x1e')]=_0x9a9d02[_0x2e00('0x1e')]||0x0;this[_0x2e00('0x1f')]=_0x9a9d02[_0x2e00('0x1f')]||0x0;this[_0x2e00('0x20')]=_0x9a9d02[_0x2e00('0x20')]||0x0;this[_0x2e00('0x5')]=_0x9a9d02[_0x2e00('0x5')]||0x0;if(_0x9a9d02[_0x2e00('0x1d')]===_0x2e00('0x21')){this[_0x2e00('0x22')]=_0x9a9d02[_0x2e00('0x22')]||0x0;this[_0x2e00('0x23')]=_0x9a9d02['dialActive'];this[_0x2e00('0x24')]=_0x9a9d02[_0x2e00('0x24')];this[_0x2e00('0x25')]=_0x9a9d02['dialOriginateCallerIdName'];this[_0x2e00('0x26')]=_0x9a9d02[_0x2e00('0x26')];this[_0x2e00('0x27')]=_0x9a9d02[_0x2e00('0x27')];this[_0x2e00('0x28')]=_0x9a9d02['dialPrefix'];this[_0x2e00('0x29')]=_0x9a9d02['temp'];this[_0x2e00('0x2a')]=_0x9a9d02['outboundAnswerAgiCallsDay'];this[_0x2e00('0xa')]=_0x9a9d02['outboundAnswerCallsDay'];this[_0x2e00('0xb')]=_0x9a9d02[_0x2e00('0xb')];this[_0x2e00('0x2b')]=_0x9a9d02['outboundBusyCallsDay'];this[_0x2e00('0xc')]=_0x9a9d02[_0x2e00('0xc')];this[_0x2e00('0x2c')]=_0x9a9d02[_0x2e00('0x2c')];this[_0x2e00('0x2d')]=_0x9a9d02['outboundDropCallsDayCallersExit'];this[_0x2e00('0x2e')]=_0x9a9d02[_0x2e00('0x2e')];this[_0x2e00('0xd')]=_0x9a9d02[_0x2e00('0xd')];this[_0x2e00('0x2f')]=_0x9a9d02[_0x2e00('0x2f')];this[_0x2e00('0x30')]=_0x9a9d02[_0x2e00('0x30')];this['outboundReCallsDay']=_0x9a9d02[_0x2e00('0xe')];this['outboundRejectCallsDay']=_0x9a9d02[_0x2e00('0xf')];this[_0x2e00('0x10')]=_0x9a9d02['outboundUnknownCallsDay'];this[_0x2e00('0x31')]=_0x9a9d02[_0x2e00('0x31')];this[_0x2e00('0x32')]=_0x9a9d02[_0x2e00('0x32')];this[_0x2e00('0x33')]=_0x9a9d02['predictiveIntervalAvgTalktime'];this[_0x2e00('0x34')]=_0x9a9d02[_0x2e00('0x34')];this[_0x2e00('0x35')]=_0x9a9d02['predictiveIntervalDroppedCallsTimeout'];this[_0x2e00('0x36')]=_0x9a9d02[_0x2e00('0x36')];this[_0x2e00('0x37')]=_0x9a9d02[_0x2e00('0x37')];this[_0x2e00('0x38')]=_0x9a9d02[_0x2e00('0x38')];this[_0x2e00('0x39')]=_0x9a9d02[_0x2e00('0x39')];this['predictiveIntervalPauses']=_0x9a9d02['predictiveIntervalPauses'];this['predictiveIntervalAvailable']=_0x9a9d02[_0x2e00('0x3a')];this[_0x2e00('0x3b')]=_0x9a9d02[_0x2e00('0x3b')];this[_0x2e00('0x8')]=_0x9a9d02['originated'];this[_0x2e00('0x3c')]=_0x9a9d02[_0x2e00('0x3c')];this[_0x2e00('0x3d')]=_0x9a9d02[_0x2e00('0x3d')];this[_0x2e00('0x3e')]=_0x9a9d02['erlangAbandonmentRate'];this[_0x2e00('0x3f')]=_0x9a9d02[_0x2e00('0x3f')];this['startPredictive']=_0x9a9d02[_0x2e00('0x40')];this['startProgressive']=_0x9a9d02['startProgressive'];this[_0x2e00('0x41')]=_0x9a9d02['message'];this[_0x2e00('0x42')]=_0x9a9d02[_0x2e00('0x42')];}if(_0x9a9d02[_0x2e00('0x43')]){this['Trunk']={'id':_0x9a9d02['Trunk']['id'],'name':_0x9a9d02[_0x2e00('0x43')]['name'],'active':_0x9a9d02[_0x2e00('0x43')][_0x2e00('0x44')],'callerid':_0x9a9d02[_0x2e00('0x43')][_0x2e00('0x45')]};}}VoiceQueueSummary[_0x2e00('0x46')][_0x2e00('0x47')]=function(_0x1187ac,_0x1ee23d,_0x3df24a,_0x5333cc){this[_0x2e00('0x2')]=0x0;this[_0x2e00('0x4')]=0x0;this[_0x2e00('0x11')]=0x0;this['unknown']=0x0;this[_0x2e00('0x1a')]=0x0;this[_0x2e00('0x7')]=0x0;this[_0x2e00('0x17')]=0x0;this[_0x2e00('0x18')]=0x0;this[_0x2e00('0x1e')]=0x0;this[_0x2e00('0x3')]=0x0;this['ringInUse']=0x0;this[_0x2e00('0x19')]=0x0;if(_0x3df24a){if(_0x3df24a[_0x2e00('0x0')]){this[_0x2e00('0x0')]=Number(_0x3df24a['available']);}if(_0x3df24a[_0x2e00('0x48')]){this[_0x2e00('0x1')]=Number(_0x3df24a['loggedin']);}if(_0x3df24a[_0x2e00('0x49')]){this[_0x2e00('0x5')]=Number(_0x3df24a[_0x2e00('0x49')]);}}for(var _0xaee046=0x0;_0xaee046<_0x1187ac[_0x2e00('0x4a')];_0xaee046++){var _0x4fd083=_0x1ee23d[_0x2e00('0x4b')+_0x1187ac[_0xaee046][_0x2e00('0x15')]];if(_0x4fd083&&_0x4fd083['online']){this['loggedInDb']+=0x1;}if(_0x1187ac[_0xaee046][_0x2e00('0x4c')]==='1'){this[_0x2e00('0x4')]+=0x1;}if(_0x1187ac[_0xaee046]['paused']==='1'&&!['2','7','8'][_0x2e00('0x4d')](_0x1187ac[_0xaee046][_0x2e00('0x4e')])){this[_0x2e00('0x11')]+=0x1;}switch(_0x1187ac[_0xaee046]['status']){case'0':this[_0x2e00('0x1f')]+=0x1;break;case'1':this[_0x2e00('0x1a')]+=0x1;break;case'2':this[_0x2e00('0x7')]+=0x1;break;case'3':this['busy']+=0x1;break;case'4':this['invalid']+=0x1;break;case'5':this[_0x2e00('0x1e')]+=0x1;break;case'6':this[_0x2e00('0x3')]+=0x1;break;case'7':this[_0x2e00('0x1b')]+=0x1;break;case'8':this[_0x2e00('0x19')]+=0x1;break;}}if(this['dialMethod']===_0x2e00('0x4f')){var _0x127e76=Object[_0x2e00('0x50')](_0x5333cc);for(var _0xd245a1=0x0;_0xd245a1<_0x127e76['length'];_0xd245a1++){var _0x3b550d=_0x127e76[_0xd245a1];var _0x3862f8=_0x5333cc[_0x3b550d];if(_0x3862f8['queue']===this['name']&&_0x3862f8[_0x2e00('0x1d')]===_0x2e00('0x51')&&_0x3862f8['exten']===_0x2e00('0x52')){this['talking']+=0x1;}}if(this[_0x2e00('0x4')]>this[_0x2e00('0x7')]){this[_0x2e00('0x4')]=this[_0x2e00('0x7')];}this['pTalking']=0x0;}return this;};VoiceQueueSummary['prototype'][_0x2e00('0x53')]=function(_0x5a298f){var _0x404610=![];if(_0x5a298f){_0x404610=INBOUND_COUNTERS[_0x2e00('0x54')](function(_0xe7b287){return this[_0xe7b287]!==_0x5a298f[_0xe7b287];},this);}return _0x404610;};VoiceQueueSummary[_0x2e00('0x46')]['compareToOutboundQueue']=function(_0x2d97c2){var _0x1b95d3=![];var _0x5acdfe=![];var _0x58e3aa=![];if(_0x2d97c2){_0x1b95d3=this[_0x2e00('0x24')]!==_0x2d97c2[_0x2e00('0x24')]||this[_0x2e00('0x23')]!==_0x2d97c2[_0x2e00('0x23')]||this['message']!==_0x2d97c2[_0x2e00('0x41')]||this['statusMessage']!==_0x2d97c2['statusMessage'];_0x5acdfe=OUTBOUND_COUNTERS[_0x2e00('0x54')](function(_0x39970c){return this[_0x39970c]!==_0x2d97c2[_0x39970c];},this);if(this[_0x2e00('0x43')]&&_0x2d97c2[_0x2e00('0x43')]){_0x58e3aa=this[_0x2e00('0x43')][_0x2e00('0x15')]!==_0x2d97c2[_0x2e00('0x43')]['name']||this[_0x2e00('0x43')][_0x2e00('0x44')]!==_0x2d97c2[_0x2e00('0x43')][_0x2e00('0x44')];}}return _0x1b95d3||_0x5acdfe||_0x58e3aa;};VoiceQueueSummary[_0x2e00('0x46')][_0x2e00('0x55')]=function(_0x16a34c){this[_0x2e00('0x6')]=_0x16a34c['answered'];this[_0x2e00('0x41')]=_0x16a34c[_0x2e00('0x41')];this['statusMessage']=_0x16a34c[_0x2e00('0x42')];this[_0x2e00('0x8')]=_0x16a34c['originated'];this[_0x2e00('0x9')]=_0x16a34c[_0x2e00('0x9')];this[_0x2e00('0xa')]=_0x16a34c[_0x2e00('0xa')];this[_0x2e00('0xb')]=_0x16a34c[_0x2e00('0xb')];this[_0x2e00('0x2b')]=_0x16a34c['outboundBusyCallsDay'];this[_0x2e00('0xc')]=_0x16a34c['outboundCongestionCallsDay'];this[_0x2e00('0xd')]=_0x16a34c[_0x2e00('0xd')];this[_0x2e00('0x2f')]=_0x16a34c[_0x2e00('0x2f')];this[_0x2e00('0xe')]=_0x16a34c[_0x2e00('0xe')];this[_0x2e00('0xf')]=_0x16a34c[_0x2e00('0xf')];this[_0x2e00('0x10')]=_0x16a34c[_0x2e00('0x10')];this[_0x2e00('0x12')]=_0x16a34c['sumBillable'];this['sumDuration']=_0x16a34c['sumDuration'];this[_0x2e00('0x14')]=_0x16a34c['total'];if(this['dialMethod']===_0x2e00('0x56')){this[_0x2e00('0x22')]=_0x16a34c[_0x2e00('0x22')];}};module[_0x2e00('0x57')]=VoiceQueueSummary; \ No newline at end of file +var _0x9c63=['outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','message','statusMessage','Trunk','active','callerid','prototype','createReport','invalid','ringInUse','loggedin','callers','length','SIP/','online','incall','includes','status','booked','keys','queue','dialer','exten','xcally-motion-preview','compareToInboundQueue','some','compareToOutboundQueue','updateReportFromOutboundQueue','outboundUnknownCallsDay','preview','exports','available','loggedIn','loggedInDb','paused','ringing','waiting','originated','outboundAbandonedCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','talking','sumDuration','total','name','abandoned','answered','busy','inUse','onHold','notInUse','sumBillable','sumHoldTime','type','unavailable','unknown','unmanaged','outbound','pTalking','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundBusyCallsDay'];(function(_0x39772f,_0x5605cb){var _0xc9edbf=function(_0x106a39){while(--_0x106a39){_0x39772f['push'](_0x39772f['shift']());}};_0xc9edbf(++_0x5605cb);}(_0x9c63,0x1a7));var _0x39c6=function(_0x23d397,_0x462583){_0x23d397=_0x23d397-0x0;var _0x3f912=_0x9c63[_0x23d397];return _0x3f912;};'use strict';var INBOUND_COUNTERS=[_0x39c6('0x0'),_0x39c6('0x1'),_0x39c6('0x2'),_0x39c6('0x3'),_0x39c6('0x4'),'talking',_0x39c6('0x5')];var OUTBOUND_COUNTERS=[_0x39c6('0x0'),'answered','inUse',_0x39c6('0x1'),_0x39c6('0x2'),_0x39c6('0x6'),_0x39c6('0x7'),_0x39c6('0x8'),_0x39c6('0x9'),'outboundBusyCallsDay',_0x39c6('0xa'),_0x39c6('0xb'),_0x39c6('0xc'),_0x39c6('0xd'),_0x39c6('0xe'),'outboundUnknownCallsDay',_0x39c6('0x3'),'pTalking',_0x39c6('0xf'),'sumBillable',_0x39c6('0x10'),_0x39c6('0x11'),_0x39c6('0x5')];function VoiceQueueSummary(_0x231669){this['id']=_0x231669['id'];this['name']=_0x231669[_0x39c6('0x12')];this['strategy']=_0x231669['strategy'];this[_0x39c6('0x13')]=_0x231669[_0x39c6('0x13')]||0x0;this[_0x39c6('0x14')]=_0x231669[_0x39c6('0x14')]||0x0;this['available']=_0x231669[_0x39c6('0x0')]||0x0;this['busy']=_0x231669[_0x39c6('0x15')]||0x0;this[_0x39c6('0x16')]=_0x231669[_0x39c6('0x16')]||0x0;this['invalid']=_0x231669['invalid']||0x0;this[_0x39c6('0x1')]=_0x231669[_0x39c6('0x1')]||0x0;this['loggedInDb']=_0x231669[_0x39c6('0x2')]||0x0;this[_0x39c6('0x17')]=_0x231669[_0x39c6('0x17')]||0x0;this[_0x39c6('0x18')]=_0x231669[_0x39c6('0x18')]||0x0;this[_0x39c6('0x3')]=_0x231669['paused']||0x0;this['ringing']=_0x231669['ringing']||0x0;this['ringInUse']=_0x231669['ringInUse'];this[_0x39c6('0x19')]=_0x231669['sumBillable'];this['sumDuration']=_0x231669[_0x39c6('0x10')];this[_0x39c6('0x1a')]=_0x231669[_0x39c6('0x1a')]||0x0;this[_0x39c6('0xf')]=_0x231669['talking']||0x0;this['total']=_0x231669['total']||0x0;this[_0x39c6('0x1b')]=_0x231669['type'];this['unavailable']=_0x231669[_0x39c6('0x1c')]||0x0;this[_0x39c6('0x1d')]=_0x231669[_0x39c6('0x1d')]||0x0;this[_0x39c6('0x1e')]=_0x231669[_0x39c6('0x1e')]||0x0;this[_0x39c6('0x5')]=_0x231669[_0x39c6('0x5')]||0x0;if(_0x231669[_0x39c6('0x1b')]===_0x39c6('0x1f')){this[_0x39c6('0x20')]=_0x231669[_0x39c6('0x20')]||0x0;this[_0x39c6('0x21')]=_0x231669[_0x39c6('0x21')];this[_0x39c6('0x22')]=_0x231669[_0x39c6('0x22')];this[_0x39c6('0x23')]=_0x231669[_0x39c6('0x23')];this['dialOriginateCallerIdNumber']=_0x231669[_0x39c6('0x24')];this[_0x39c6('0x25')]=_0x231669[_0x39c6('0x25')];this['dialPrefix']=_0x231669[_0x39c6('0x26')];this[_0x39c6('0x27')]=_0x231669[_0x39c6('0x27')];this[_0x39c6('0x28')]=_0x231669['outboundAnswerAgiCallsDay'];this['outboundAnswerCallsDay']=_0x231669[_0x39c6('0x8')];this[_0x39c6('0x9')]=_0x231669['outboundBlacklistCallsDay'];this[_0x39c6('0x29')]=_0x231669['outboundBusyCallsDay'];this['outboundCongestionCallsDay']=_0x231669[_0x39c6('0xa')];this[_0x39c6('0x2a')]=_0x231669[_0x39c6('0x2a')];this[_0x39c6('0x2b')]=_0x231669[_0x39c6('0x2b')];this[_0x39c6('0x2c')]=_0x231669[_0x39c6('0x2c')];this[_0x39c6('0xb')]=_0x231669[_0x39c6('0xb')];this[_0x39c6('0xc')]=_0x231669[_0x39c6('0xc')];this[_0x39c6('0x2d')]=_0x231669[_0x39c6('0x2d')];this[_0x39c6('0xd')]=_0x231669[_0x39c6('0xd')];this[_0x39c6('0xe')]=_0x231669[_0x39c6('0xe')];this['outboundUnknownCallsDay']=_0x231669['outboundUnknownCallsDay'];this[_0x39c6('0x2e')]=_0x231669[_0x39c6('0x2e')];this[_0x39c6('0x2f')]=_0x231669[_0x39c6('0x2f')];this[_0x39c6('0x30')]=_0x231669[_0x39c6('0x30')];this[_0x39c6('0x31')]=_0x231669['predictiveIntervalDroppedCallsCallersExit'];this[_0x39c6('0x32')]=_0x231669[_0x39c6('0x32')];this['predictiveIntervalErlangCalls']=_0x231669['predictiveIntervalErlangCalls'];this[_0x39c6('0x33')]=_0x231669[_0x39c6('0x33')];this[_0x39c6('0x34')]=_0x231669[_0x39c6('0x34')];this[_0x39c6('0x35')]=_0x231669[_0x39c6('0x35')];this[_0x39c6('0x36')]=_0x231669[_0x39c6('0x36')];this[_0x39c6('0x37')]=_0x231669[_0x39c6('0x37')];this[_0x39c6('0x38')]=_0x231669[_0x39c6('0x38')];this[_0x39c6('0x6')]=_0x231669['originated'];this['erlangCalls']=_0x231669[_0x39c6('0x39')];this[_0x39c6('0x3a')]=_0x231669[_0x39c6('0x3a')];this['erlangAbandonmentRate']=_0x231669[_0x39c6('0x3b')];this[_0x39c6('0x3c')]=_0x231669[_0x39c6('0x3c')];this[_0x39c6('0x3d')]=_0x231669['startPredictive'];this['startProgressive']=_0x231669[_0x39c6('0x3e')];this['message']=_0x231669[_0x39c6('0x3f')];this[_0x39c6('0x40')]=_0x231669[_0x39c6('0x40')];}if(_0x231669[_0x39c6('0x41')]){this['Trunk']={'id':_0x231669[_0x39c6('0x41')]['id'],'name':_0x231669[_0x39c6('0x41')][_0x39c6('0x12')],'active':_0x231669[_0x39c6('0x41')][_0x39c6('0x42')],'callerid':_0x231669[_0x39c6('0x41')][_0x39c6('0x43')]};}}VoiceQueueSummary[_0x39c6('0x44')][_0x39c6('0x45')]=function(_0x4bf748,_0x4e219c,_0x1b15b0,_0x4b50b9){this[_0x39c6('0x2')]=0x0;this['talking']=0x0;this['paused']=0x0;this[_0x39c6('0x1d')]=0x0;this[_0x39c6('0x18')]=0x0;this[_0x39c6('0x16')]=0x0;this['busy']=0x0;this[_0x39c6('0x46')]=0x0;this[_0x39c6('0x1c')]=0x0;this[_0x39c6('0x4')]=0x0;this[_0x39c6('0x47')]=0x0;this[_0x39c6('0x17')]=0x0;if(_0x1b15b0){if(_0x1b15b0[_0x39c6('0x0')]){this['available']=Number(_0x1b15b0['available']);}if(_0x1b15b0[_0x39c6('0x48')]){this[_0x39c6('0x1')]=Number(_0x1b15b0['loggedin']);}if(_0x1b15b0[_0x39c6('0x49')]){this[_0x39c6('0x5')]=Number(_0x1b15b0['callers']);}}for(var _0x43bf40=0x0;_0x43bf40<_0x4bf748[_0x39c6('0x4a')];_0x43bf40++){var _0x100283=_0x4e219c[_0x39c6('0x4b')+_0x4bf748[_0x43bf40][_0x39c6('0x12')]];if(_0x100283&&_0x100283[_0x39c6('0x4c')]){this['loggedInDb']+=0x1;}if(_0x4bf748[_0x43bf40][_0x39c6('0x4d')]==='1'){this[_0x39c6('0xf')]+=0x1;}if(_0x4bf748[_0x43bf40][_0x39c6('0x3')]==='1'&&!['2','7','8'][_0x39c6('0x4e')](_0x4bf748[_0x43bf40][_0x39c6('0x4f')])){this['paused']+=0x1;}switch(_0x4bf748[_0x43bf40][_0x39c6('0x4f')]){case'0':this['unknown']+=0x1;break;case'1':this[_0x39c6('0x18')]+=0x1;break;case'2':this[_0x39c6('0x16')]+=0x1;break;case'3':this[_0x39c6('0x15')]+=0x1;break;case'4':this[_0x39c6('0x46')]+=0x1;break;case'5':this[_0x39c6('0x1c')]+=0x1;break;case'6':this[_0x39c6('0x4')]+=0x1;break;case'7':this[_0x39c6('0x47')]+=0x1;break;case'8':this[_0x39c6('0x17')]+=0x1;break;}}if(this['dialMethod']===_0x39c6('0x50')){var _0x7c2f08=Object[_0x39c6('0x51')](_0x4b50b9);for(var _0x3147e2=0x0;_0x3147e2<_0x7c2f08[_0x39c6('0x4a')];_0x3147e2++){var _0x25150e=_0x7c2f08[_0x3147e2];var _0x369859=_0x4b50b9[_0x25150e];if(_0x369859[_0x39c6('0x52')]===this[_0x39c6('0x12')]&&_0x369859['type']===_0x39c6('0x53')&&_0x369859[_0x39c6('0x54')]===_0x39c6('0x55')){this['talking']+=0x1;}}if(this[_0x39c6('0xf')]>this['inUse']){this[_0x39c6('0xf')]=this['inUse'];}this[_0x39c6('0x20')]=0x0;}return this;};VoiceQueueSummary[_0x39c6('0x44')][_0x39c6('0x56')]=function(_0x56d80b){var _0x3c181e=![];if(_0x56d80b){_0x3c181e=INBOUND_COUNTERS[_0x39c6('0x57')](function(_0x348228){return this[_0x348228]!==_0x56d80b[_0x348228];},this);}return _0x3c181e;};VoiceQueueSummary[_0x39c6('0x44')][_0x39c6('0x58')]=function(_0x43119d){var _0x59136d=![];var _0x1c775f=![];var _0x14e7f4=![];if(_0x43119d){_0x59136d=this[_0x39c6('0x22')]!==_0x43119d['dialMethod']||this[_0x39c6('0x21')]!==_0x43119d[_0x39c6('0x21')]||this['message']!==_0x43119d[_0x39c6('0x3f')]||this[_0x39c6('0x40')]!==_0x43119d[_0x39c6('0x40')];_0x1c775f=OUTBOUND_COUNTERS[_0x39c6('0x57')](function(_0x369394){return this[_0x369394]!==_0x43119d[_0x369394];},this);if(this[_0x39c6('0x41')]&&_0x43119d['Trunk']){_0x14e7f4=this[_0x39c6('0x41')]['name']!==_0x43119d[_0x39c6('0x41')][_0x39c6('0x12')]||this['Trunk']['active']!==_0x43119d[_0x39c6('0x41')][_0x39c6('0x42')];}}return _0x59136d||_0x1c775f||_0x14e7f4;};VoiceQueueSummary[_0x39c6('0x44')][_0x39c6('0x59')]=function(_0x130c35){this['answered']=_0x130c35['answered'];this['message']=_0x130c35[_0x39c6('0x3f')];this[_0x39c6('0x40')]=_0x130c35[_0x39c6('0x40')];this[_0x39c6('0x6')]=_0x130c35[_0x39c6('0x6')];this['outboundAbandonedCallsDay']=_0x130c35[_0x39c6('0x7')];this[_0x39c6('0x8')]=_0x130c35[_0x39c6('0x8')];this[_0x39c6('0x9')]=_0x130c35[_0x39c6('0x9')];this[_0x39c6('0x29')]=_0x130c35['outboundBusyCallsDay'];this['outboundCongestionCallsDay']=_0x130c35[_0x39c6('0xa')];this['outboundNoAnswerCallsDay']=_0x130c35[_0x39c6('0xb')];this[_0x39c6('0xc')]=_0x130c35[_0x39c6('0xc')];this[_0x39c6('0xd')]=_0x130c35[_0x39c6('0xd')];this[_0x39c6('0xe')]=_0x130c35[_0x39c6('0xe')];this[_0x39c6('0x5a')]=_0x130c35[_0x39c6('0x5a')];this[_0x39c6('0x19')]=_0x130c35['sumBillable'];this[_0x39c6('0x10')]=_0x130c35['sumDuration'];this[_0x39c6('0x11')]=_0x130c35['total'];if(this[_0x39c6('0x22')]===_0x39c6('0x5b')){this[_0x39c6('0x20')]=_0x130c35[_0x39c6('0x20')];}};module[_0x39c6('0x5c')]=VoiceQueueSummary; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index ea99139..db83fbd 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 _0xa76a=['name','username','accessKey','serverUrl','Configurations'];(function(_0x3d9176,_0x399d6f){var _0x12adc5=function(_0x700b01){while(--_0x700b01){_0x3d9176['push'](_0x3d9176['shift']());}};_0x12adc5(++_0x399d6f);}(_0xa76a,0xaf));var _0xaa76=function(_0x311909,_0x414bf7){_0x311909=_0x311909-0x0;var _0x8d3163=_0xa76a[_0x311909];return _0x8d3163;};'use strict';function VtigerAccount(_0x69a8eb){this['id']=_0x69a8eb['id']||0x0;this[_0xaa76('0x0')]=_0x69a8eb['name']||'';this[_0xaa76('0x1')]=_0x69a8eb['username']||'';this[_0xaa76('0x2')]=_0x69a8eb[_0xaa76('0x2')]||'';this['remoteUri']=_0x69a8eb['remoteUri']||'';this[_0xaa76('0x3')]=_0x69a8eb['serverUrl']||'';this[_0xaa76('0x4')]=_0x69a8eb[_0xaa76('0x4')]||{};}module['exports']=VtigerAccount; \ No newline at end of file +var _0x25f9=['name','username','accessKey','remoteUri','serverUrl'];(function(_0x3ec1a9,_0x393d76){var _0x4e9778=function(_0x4acf80){while(--_0x4acf80){_0x3ec1a9['push'](_0x3ec1a9['shift']());}};_0x4e9778(++_0x393d76);}(_0x25f9,0x87));var _0x925f=function(_0x5b72b6,_0x5f5562){_0x5b72b6=_0x5b72b6-0x0;var _0x2f8117=_0x25f9[_0x5b72b6];return _0x2f8117;};'use strict';function VtigerAccount(_0x2d7e8d){this['id']=_0x2d7e8d['id']||0x0;this['name']=_0x2d7e8d[_0x925f('0x0')]||'';this[_0x925f('0x1')]=_0x2d7e8d[_0x925f('0x1')]||'';this[_0x925f('0x2')]=_0x2d7e8d[_0x925f('0x2')]||'';this[_0x925f('0x3')]=_0x2d7e8d[_0x925f('0x3')]||'';this[_0x925f('0x4')]=_0x2d7e8d[_0x925f('0x4')]||'';this['Configurations']=_0x2d7e8d['Configurations']||{};}module['exports']=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index 0ed72ab..143838e 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 _0x5536=['integrationTab','serverUrl','Configurations','name','username','password','token','remoteUri','authType','type'];(function(_0x3b82f5,_0x3fd603){var _0x5375e4=function(_0x950740){while(--_0x950740){_0x3b82f5['push'](_0x3b82f5['shift']());}};_0x5375e4(++_0x3fd603);}(_0x5536,0xc1));var _0x6553=function(_0x96a6d5,_0x5b1751){_0x96a6d5=_0x96a6d5-0x0;var _0x4c15f5=_0x5536[_0x96a6d5];return _0x4c15f5;};'use strict';function ZendeskAccount(_0x3b0bb6){this['id']=_0x3b0bb6['id']||0x0;this[_0x6553('0x0')]=_0x3b0bb6[_0x6553('0x0')]||'';this['username']=_0x3b0bb6[_0x6553('0x1')]||'';this[_0x6553('0x2')]=_0x3b0bb6[_0x6553('0x2')]||'';this[_0x6553('0x3')]=_0x3b0bb6[_0x6553('0x3')]||'';this[_0x6553('0x4')]=_0x3b0bb6[_0x6553('0x4')]||'';this[_0x6553('0x5')]=_0x3b0bb6[_0x6553('0x5')]||'';this[_0x6553('0x6')]=_0x3b0bb6['type']||_0x6553('0x7');this[_0x6553('0x8')]=_0x3b0bb6[_0x6553('0x8')]||'';this[_0x6553('0x9')]=_0x3b0bb6[_0x6553('0x9')]||{};}module['exports']=ZendeskAccount; \ No newline at end of file +var _0x0fd7=['Configurations','exports','name','username','password','token','remoteUri','authType','type','integrationTab','serverUrl'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x0fd7,0x120));var _0x70fd=function(_0x51b59b,_0x4b3e0d){_0x51b59b=_0x51b59b-0x0;var _0xd5dec0=_0x0fd7[_0x51b59b];return _0xd5dec0;};'use strict';function ZendeskAccount(_0x95aecd){this['id']=_0x95aecd['id']||0x0;this[_0x70fd('0x0')]=_0x95aecd[_0x70fd('0x0')]||'';this[_0x70fd('0x1')]=_0x95aecd[_0x70fd('0x1')]||'';this[_0x70fd('0x2')]=_0x95aecd[_0x70fd('0x2')]||'';this[_0x70fd('0x3')]=_0x95aecd['token']||'';this[_0x70fd('0x4')]=_0x95aecd[_0x70fd('0x4')]||'';this[_0x70fd('0x5')]=_0x95aecd[_0x70fd('0x5')]||'';this[_0x70fd('0x6')]=_0x95aecd['type']||_0x70fd('0x7');this[_0x70fd('0x8')]=_0x95aecd[_0x70fd('0x8')]||'';this[_0x70fd('0x9')]=_0x95aecd[_0x70fd('0x9')]||{};}module[_0x70fd('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 897d5da..3a38f48 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 _0xc643=['name','description','host','zone','clientId','clientSecret','serverUrl','code','refreshToken','Configurations','exports'];(function(_0x468bbf,_0x56d581){var _0x27eec7=function(_0x549c2a){while(--_0x549c2a){_0x468bbf['push'](_0x468bbf['shift']());}};_0x27eec7(++_0x56d581);}(_0xc643,0xfd));var _0x3c64=function(_0x118d39,_0x43be87){_0x118d39=_0x118d39-0x0;var _0x47958b=_0xc643[_0x118d39];return _0x47958b;};'use strict';function ZohoAccount(_0xc3bc26){this['id']=_0xc3bc26['id']||0x0;this[_0x3c64('0x0')]=_0xc3bc26[_0x3c64('0x0')]||'';this[_0x3c64('0x1')]=_0xc3bc26['description']||'';this[_0x3c64('0x2')]=_0xc3bc26['host']||'';this['zone']=_0xc3bc26[_0x3c64('0x3')]||'';this[_0x3c64('0x4')]=_0xc3bc26[_0x3c64('0x4')]||'';this['clientSecret']=_0xc3bc26[_0x3c64('0x5')]||'';this[_0x3c64('0x6')]=_0xc3bc26[_0x3c64('0x6')]||'';this['code']=_0xc3bc26[_0x3c64('0x7')]||'';this[_0x3c64('0x8')]=_0xc3bc26['refreshToken']||'';this[_0x3c64('0x9')]=_0xc3bc26[_0x3c64('0x9')]||{};}module[_0x3c64('0xa')]=ZohoAccount; \ No newline at end of file +var _0x0d15=['name','description','host','zone','clientId','clientSecret','serverUrl','code','refreshToken','Configurations','exports'];(function(_0x4365a0,_0x1371a4){var _0x3b829d=function(_0x5538c1){while(--_0x5538c1){_0x4365a0['push'](_0x4365a0['shift']());}};_0x3b829d(++_0x1371a4);}(_0x0d15,0x9a));var _0x50d1=function(_0x1bfc33,_0x5c3574){_0x1bfc33=_0x1bfc33-0x0;var _0x1def7b=_0x0d15[_0x1bfc33];return _0x1def7b;};'use strict';function ZohoAccount(_0x420cb4){this['id']=_0x420cb4['id']||0x0;this[_0x50d1('0x0')]=_0x420cb4['name']||'';this[_0x50d1('0x1')]=_0x420cb4[_0x50d1('0x1')]||'';this['host']=_0x420cb4[_0x50d1('0x2')]||'';this['zone']=_0x420cb4[_0x50d1('0x3')]||'';this[_0x50d1('0x4')]=_0x420cb4[_0x50d1('0x4')]||'';this['clientSecret']=_0x420cb4[_0x50d1('0x5')]||'';this[_0x50d1('0x6')]=_0x420cb4[_0x50d1('0x6')]||'';this['code']=_0x420cb4[_0x50d1('0x7')]||'';this[_0x50d1('0x8')]=_0x420cb4[_0x50d1('0x8')]||'';this['Configurations']=_0x420cb4[_0x50d1('0x9')]||{};}module[_0x50d1('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 b091836..d7fbdc3 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 _0x4325=['type','membername','Agent','format','calleridname','Contact','phone','firstName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','prototype','getCaller','util','lodash','string','isNil','idContact','queue','name'];(function(_0x3414fa,_0x30f564){var _0x2bd392=function(_0x2af7c2){while(--_0x2af7c2){_0x3414fa['push'](_0x3414fa['shift']());}};_0x2bd392(++_0x30f564);}(_0x4325,0x1da));var _0x5432=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x4325[_0x3b380d];return _0x54502b;};'use strict';var util=require(_0x5432('0x0'));var _=require(_0x5432('0x1'));var moment=require('moment');function checkNameSurname(_0x3f491f,_0x533c92,_0x12c8d8){var _0x480fb7='';if(!_['isNil'](_0x533c92)&&_0x5432('0x2')===typeof _0x533c92){_0x480fb7+=_0x533c92;}if(!_[_0x5432('0x3')](_0x12c8d8)&&_0x5432('0x2')===typeof _0x12c8d8){_0x480fb7+='\x20'+_0x12c8d8;}if(_0x480fb7!==''){return _0x480fb7;}return _0x3f491f;}function Action(_0x4acbe4,_0x209e2e,_0xbb0075,_0x4a6e76,_0x106ec9){this['uniqueid']=_0xbb0075||undefined;this[_0x5432('0x4')]=_0x4acbe4['id'];this[_0x5432('0x5')]=_0x209e2e[_0x5432('0x6')];this[_0x5432('0x7')]=_0x209e2e[_0x5432('0x7')];this['campaigntype']=_0x5432('0x5');this['dialAnswer']=![];this[_0x5432('0x8')]=_[_0x5432('0x3')](_0x4acbe4[_0x5432('0x9')])?undefined:_0x4acbe4[_0x5432('0x9')]['name'];this['channelAgent']=this[_0x5432('0x8')]?util[_0x5432('0xa')]('SIP/%s',this[_0x5432('0x8')]):_0x4a6e76||undefined;this[_0x5432('0xb')]=checkNameSurname(_0x4acbe4[_0x5432('0xc')][_0x5432('0xd')],_0x4acbe4[_0x5432('0xc')][_0x5432('0xe')],_0x4acbe4['Contact']['lastName']);this[_0x5432('0xf')]=_0x4acbe4[_0x5432('0xf')]||![];this[_0x5432('0x10')]=_0x4acbe4[_0x5432('0xd')];this[_0x5432('0x11')]=_0x4acbe4[_0x5432('0x11')];this['countbusyretry']=_0x4acbe4[_0x5432('0x12')]||0x0;this['countcongestionretry']=_0x4acbe4[_0x5432('0x13')]||0x0;this[_0x5432('0x14')]=_0x4acbe4[_0x5432('0x14')]||0x0;this[_0x5432('0x15')]=(_0x4acbe4[_0x5432('0x12')]||0x0)+(_0x4acbe4['countcongestionretry']||0x0)+(_0x4acbe4[_0x5432('0x14')]||0x0)+(_0x4acbe4[_0x5432('0x16')]||0x0)+(_0x4acbe4[_0x5432('0x17')]||0x0)+(_0x4acbe4[_0x5432('0x18')]||0x0)+(_0x4acbe4[_0x5432('0x19')]||0x0)+(_0x4acbe4[_0x5432('0x1a')]||0x0);this[_0x5432('0x16')]=_0x4acbe4['countnosuchnumberretry']||0x0;this[_0x5432('0x17')]=_0x4acbe4[_0x5432('0x17')]||0x0;this[_0x5432('0x18')]=_0x4acbe4[_0x5432('0x18')]||0x0;this[_0x5432('0x19')]=_0x4acbe4['countmachineretry']||0x0;this['countagentrejectretry']=_0x4acbe4['countagentrejectretry']||0x0;this[_0x5432('0x1b')]=_0x4acbe4[_0x5432('0x1b')];this[_0x5432('0x1c')]=_0x4acbe4[_0x5432('0x1c')];this['callbackat']=_0x4acbe4['callbackat'];this[_0x5432('0x1d')]=_0x4acbe4[_0x5432('0x1d')];this['ContactId']=_0x4acbe4[_0x5432('0x1e')];this[_0x5432('0x1f')]=_0x4acbe4[_0x5432('0x1f')];this['UserId']=_[_0x5432('0x3')](_0x4acbe4[_0x5432('0x9')])?_0x4acbe4[_0x5432('0x20')]:_0x4acbe4['Agent']['id'];this['VoiceQueueId']=_0x4acbe4[_0x5432('0x21')];this[_0x5432('0x22')]='';this['originatecalleridname']='';}Action[_0x5432('0x23')][_0x5432('0x24')]=function(){return util[_0x5432('0xa')]('\x22%s\x22\x20<%s>',this[_0x5432('0xb')],this['number']);};module['exports']=Action; \ No newline at end of file +var _0x4bd3=['name','type','campaigntype','dialAnswer','membername','Agent','channelAgent','SIP/%s','calleridname','Contact','phone','firstName','lastName','active','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridname','prototype','format','\x22%s\x22\x20<%s>','number','exports','util','moment','isNil','string','idContact','queue'];(function(_0x545658,_0x2c9e2f){var _0x3bb509=function(_0x51e269){while(--_0x51e269){_0x545658['push'](_0x545658['shift']());}};_0x3bb509(++_0x2c9e2f);}(_0x4bd3,0x174));var _0x34bd=function(_0x1a09b9,_0x2c9f0a){_0x1a09b9=_0x1a09b9-0x0;var _0xe67872=_0x4bd3[_0x1a09b9];return _0xe67872;};'use strict';var util=require(_0x34bd('0x0'));var _=require('lodash');var moment=require(_0x34bd('0x1'));function checkNameSurname(_0x22a9f9,_0x5369c1,_0x4997bc){var _0x4cad21='';if(!_[_0x34bd('0x2')](_0x5369c1)&&_0x34bd('0x3')===typeof _0x5369c1){_0x4cad21+=_0x5369c1;}if(!_[_0x34bd('0x2')](_0x4997bc)&&'string'===typeof _0x4997bc){_0x4cad21+='\x20'+_0x4997bc;}if(_0x4cad21!==''){return _0x4cad21;}return _0x22a9f9;}function Action(_0x2133c5,_0x2a15a2,_0x5c2a7a,_0x3e8744,_0x213716){this['uniqueid']=_0x5c2a7a||undefined;this[_0x34bd('0x4')]=_0x2133c5['id'];this[_0x34bd('0x5')]=_0x2a15a2[_0x34bd('0x6')];this[_0x34bd('0x7')]=_0x2a15a2[_0x34bd('0x7')];this[_0x34bd('0x8')]='queue';this[_0x34bd('0x9')]=![];this[_0x34bd('0xa')]=_[_0x34bd('0x2')](_0x2133c5[_0x34bd('0xb')])?undefined:_0x2133c5['Agent']['name'];this[_0x34bd('0xc')]=this['membername']?util['format'](_0x34bd('0xd'),this[_0x34bd('0xa')]):_0x3e8744||undefined;this[_0x34bd('0xe')]=checkNameSurname(_0x2133c5[_0x34bd('0xf')][_0x34bd('0x10')],_0x2133c5[_0x34bd('0xf')][_0x34bd('0x11')],_0x2133c5[_0x34bd('0xf')][_0x34bd('0x12')]);this['active']=_0x2133c5[_0x34bd('0x13')]||![];this['calleridnum']=_0x2133c5['phone'];this[_0x34bd('0x14')]=_0x2133c5[_0x34bd('0x14')];this[_0x34bd('0x15')]=_0x2133c5[_0x34bd('0x15')]||0x0;this[_0x34bd('0x16')]=_0x2133c5[_0x34bd('0x16')]||0x0;this[_0x34bd('0x17')]=_0x2133c5[_0x34bd('0x17')]||0x0;this[_0x34bd('0x18')]=(_0x2133c5[_0x34bd('0x15')]||0x0)+(_0x2133c5[_0x34bd('0x16')]||0x0)+(_0x2133c5['countnoanswerretry']||0x0)+(_0x2133c5[_0x34bd('0x19')]||0x0)+(_0x2133c5[_0x34bd('0x1a')]||0x0)+(_0x2133c5[_0x34bd('0x1b')]||0x0)+(_0x2133c5[_0x34bd('0x1c')]||0x0)+(_0x2133c5[_0x34bd('0x1d')]||0x0);this[_0x34bd('0x19')]=_0x2133c5[_0x34bd('0x19')]||0x0;this[_0x34bd('0x1a')]=_0x2133c5[_0x34bd('0x1a')]||0x0;this['countabandonedretry']=_0x2133c5[_0x34bd('0x1b')]||0x0;this[_0x34bd('0x1c')]=_0x2133c5[_0x34bd('0x1c')]||0x0;this[_0x34bd('0x1d')]=_0x2133c5[_0x34bd('0x1d')]||0x0;this['callback']=_0x2133c5['callback'];this['callbackuniqueid']=_0x2133c5['callbackuniqueid'];this[_0x34bd('0x1e')]=_0x2133c5['callbackat'];this[_0x34bd('0x1f')]=_0x2133c5[_0x34bd('0x1f')];this[_0x34bd('0x20')]=_0x2133c5['ContactId'];this[_0x34bd('0x21')]=_0x2133c5[_0x34bd('0x21')];this[_0x34bd('0x22')]=_[_0x34bd('0x2')](_0x2133c5['Agent'])?_0x2133c5[_0x34bd('0x22')]:_0x2133c5[_0x34bd('0xb')]['id'];this[_0x34bd('0x23')]=_0x2133c5[_0x34bd('0x23')];this['originatecalleridnum']='';this[_0x34bd('0x24')]='';}Action[_0x34bd('0x25')]['getCaller']=function(){return util[_0x34bd('0x26')](_0x34bd('0x27'),this[_0x34bd('0xe')],this[_0x34bd('0x28')]);};module[_0x34bd('0x29')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index 43e1b70..af5d60c 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 _0xa9e0=['varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','info','format','voice:queue:%s','name','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','originated','pTalking','available','CAMPAIGN_STATUS','INACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','\x20is\x20deactivated','syncCampaigns','hasOwnProperty','dialMethod','booked','type','outbound','dialActive','setMessage','recallMe','clearZombieChannel','sequence','isNil','Queue','queue','originated:\x20','stringify','pick','UserId','VoiceQueueId','ListId','channel','message','No\x20such\x20channel','dialAnswer','decrementTalkink','[clearZombieChannel]','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','clearZombieChannels','size','getContactRecallMe','then','length','getDiff','scheduledat','Agent','voicePause','run','[RecallMe]','catch','logger2','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[getContactRecallMe]','IsNotLoggedIn','NO_AGENTS_LOGGED','isActive','isTrunkReachable','UNREACHABLE_TRUNK','callProgressDetectingCustomer','outboundNoSuchCallsDay','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','additional','dialNoSuchNumberRetryFrequency','cloneAction','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','scheduledAt','activeContact','linkedid','idContact','incrementPreviewCounters','ANSWER','answertime','[syncHangup][talking][increment]','pTalking:\x20','custom:agentconnect','connect','acw','mandatoryDisposition','custom:agentConnectPreview','channelAgent','uniqueid','custom:agentcomplete','complete','outboundAnswerCallsDay','answered','[16]','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumDuration','talktime','sumBillable','[syncHangup][talking][decrement]','\x20Queue','outboundBusyCallsDay','countbusyretry','Busy','dialBusyRetryFrequency','callAdditionalPhoneAfterMin','busy','[callProgressDetectingCustomer][logBusy]','dialGlobalMaxRetry','Global','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','unlockAgent','NOANSWER','countnoanswerretry','dialNoAnswerRetryFrequency','buildNoAnswerEventPayload','custom:agentnoanswer','dialNoAnswerMaxRetry','[callProgressDetectingCustomer][logNoAnswer]','outboundCongestionCallsDay','countcongestionretry','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','[callProgressDetectingCustomer][logCongestion]','swapAdditionalPhones','CANCEL','outboundRejectCallsDay','countagentrejectretry','AgentReject','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedMaxRety','countmachineretry','cause-txt','custom:amd','[callProgressDetectingCustomer][hangupInAMD]','outboundUnknownCallsDay','dialstatus','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknownGlobal]','updateOriginated','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','object','isUndefined','reason','logAgent','[callProgressDetectingAgent][logNoSuch]','NoAnswer','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','resolve','checkInBlack','Contact','phone','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','[Preview][execCall][success]','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','[Blacklist][error]','Contact\x20in\x20black\x20List','active','SIP/%s','status','reachable','unmonitored','execRun','unlock','unlockContact','recallme','validateContact','checkIsBlackList','[Preview][checkIsBlackList]','[Preview][getContactPreview]','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','Trunk','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','TrunkBackup','\x20Trunk\x20Backup\x20is\x20not\x20active','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','dialPrefix','trim','dialCutDigit','substring','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','merge','toLowerVariables','variables','variablesAction','Action','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','logLookAgent','clone','responsetime','response','rejected','Answer','[callProgressDetectingAgent][logAnswer]','cause','[syncHangup][talking][cause]','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','syncHangupRequest','addVariable','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','uuid','../../../config/environment','preview','../../../config/logger','actionPreview','../ami','./rpcDb','./action','./util/util','../dialer/utils','redis','prototype','enqueue','tail','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncDialEnd','syncNewExten'];(function(_0x3bc44d,_0x32e661){var _0xad001=function(_0xc7b819){while(--_0xc7b819){_0x3bc44d['push'](_0x3bc44d['shift']());}};_0xad001(++_0x32e661);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xa9e0[_0x5ddb1c];return _0x354adc;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var uuid=require(_0x0a9e('0x2'));var moment=require('moment');var Redis=require('ioredis');var config=require(_0x0a9e('0x3'));var logger=require('../../../config/logger')(_0x0a9e('0x4'));var loggerAction=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var ami=require(_0x0a9e('0x7'));var rpcDb=require(_0x0a9e('0x8'));var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var Action=require(_0x0a9e('0x9'));var ut=require(_0x0a9e('0xa'));var utils=require(_0x0a9e('0xb'));config['redis']=_['defaults'](config[_0x0a9e('0xc')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0a9e('0xc')]));var Sequence=function(){};Sequence[_0x0a9e('0xd')][_0x0a9e('0xe')]=function(_0x3ab53f){this[_0x0a9e('0xf')]=this[_0x0a9e('0xf')]?this['tail']['finally'](_0x3ab53f):_0x3ab53f();};function Preview(_0x527cdd){this['sequence']=new Sequence();this[_0x0a9e('0x10')]=_0x527cdd[_0x0a9e('0x11')];this[_0x0a9e('0x12')]=_0x527cdd[_0x0a9e('0x12')];this[_0x0a9e('0x13')]={};this[_0x0a9e('0x14')]=_0x527cdd['agents'];this[_0x0a9e('0x15')]=0x0;ami['on'](_0x0a9e('0x16'),this[_0x0a9e('0x17')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x19'),this[_0x0a9e('0x1a')]['bind'](this));ami['on'](_0x0a9e('0x1b'),this['syncHangupRequest'][_0x0a9e('0x18')](this));ami['on']('dialend',this[_0x0a9e('0x1c')][_0x0a9e('0x18')](this));ami['on']('newexten',this[_0x0a9e('0x1d')]['bind'](this));ami['on'](_0x0a9e('0x1e'),this[_0x0a9e('0x1f')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x20'),this[_0x0a9e('0x21')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x22'),this[_0x0a9e('0x23')][_0x0a9e('0x18')](this));this[_0x0a9e('0x24')](this[_0x0a9e('0x10')]);}function emit(_0x105080,_0x4bb1e3,_0x2c3407){io['to'](_0x105080)[_0x0a9e('0x25')](_0x4bb1e3,_0x2c3407);}function emitVoiceQueueChannelRemove(_0x53682f){logger[_0x0a9e('0x26')]('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON['stringify'](_0x53682f));emit(util[_0x0a9e('0x27')](_0x0a9e('0x28'),_0x53682f[_0x0a9e('0x29')]),_0x0a9e('0x2a'),_0x53682f);io['emit'](_0x0a9e('0x2b'),_0x53682f);}function notSendMessagesQueue(_0x2fb0e4){if(_0x2fb0e4[_0x0a9e('0x2c')]){if(_0x2fb0e4[_0x0a9e('0x2d')]===0x0&&_0x2fb0e4[_0x0a9e('0x2e')]===0x0){_0x2fb0e4[_0x0a9e('0x2c')]=![];_0x2fb0e4[_0x0a9e('0x2f')]=0x0;_0x2fb0e4['paused']=0x0;_0x2fb0e4['message']=utils[_0x0a9e('0x30')][_0x0a9e('0x31')];ut[_0x0a9e('0x32')](_0x0a9e('0x33'),_0x2fb0e4['name']+_0x0a9e('0x34'));}else{_0x2fb0e4['message']=utils[_0x0a9e('0x30')]['DEACTIVATED'];ut[_0x0a9e('0x32')](_0x0a9e('0x33'),_0x2fb0e4[_0x0a9e('0x29')]+_0x0a9e('0x35'));}}}Preview[_0x0a9e('0xd')][_0x0a9e('0x24')]=function(){var _0x11c3b6=this;setInterval(function(){_0x11c3b6[_0x0a9e('0x36')]();},0x7cf);};Preview['prototype'][_0x0a9e('0x36')]=function(){var _0x468813=this[_0x0a9e('0x10')];this[_0x0a9e('0x15')]+=0x1;for(var _0x5c877d in _0x468813){if(_0x468813[_0x0a9e('0x37')](_0x5c877d)&&(_0x468813[_0x5c877d][_0x0a9e('0x38')]===_0x0a9e('0x4')||_0x468813[_0x5c877d][_0x0a9e('0x38')]===_0x0a9e('0x39'))&&_0x468813[_0x5c877d][_0x0a9e('0x3a')]===_0x0a9e('0x3b')){if(this[_0x0a9e('0x15')]>0x7){this[_0x0a9e('0x15')]=0x0;this['clearZombieChannels']();}}if(_0x468813[_0x0a9e('0x37')](_0x5c877d)&&_0x468813[_0x5c877d]['dialMethod']===_0x0a9e('0x4')&&_0x468813[_0x5c877d][_0x0a9e('0x3a')]===_0x0a9e('0x3b')){if(_0x468813[_0x5c877d][_0x0a9e('0x3c')]){this[_0x0a9e('0x3d')](_0x468813[_0x5c877d]);if(_0x468813[_0x5c877d]['dialPreviewAutoRecallMe'])this[_0x0a9e('0x3e')](_0x468813[_0x5c877d]);}else{notSendMessagesQueue(_0x468813[_0x5c877d]);}}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x3f')]=function(_0x2da5c0){var _0x2b45ea=this;this[_0x0a9e('0x40')][_0x0a9e('0xe')](function(){if(!_[_0x0a9e('0x41')](_0x2b45ea['actions'][_0x2da5c0])){loggerAction[_0x0a9e('0x26')]('[clearZombieChannels][talking]',_0x2da5c0,_0x0a9e('0x42'),_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')],_0x0a9e('0x44'),JSON['stringify'](_0x2b45ea[_0x0a9e('0x10')][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]][_0x0a9e('0x2d')]),'pTalking:\x20',JSON['stringify'](_0x2b45ea[_0x0a9e('0x10')][_0x2b45ea['actions'][_0x2da5c0][_0x0a9e('0x43')]][_0x0a9e('0x2e')]),JSON[_0x0a9e('0x45')](_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0]['dialAnswer']),JSON[_0x0a9e('0x45')](_[_0x0a9e('0x46')](_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0],['contactId',_0x0a9e('0x47'),_0x0a9e('0x48'),_0x0a9e('0x49')])));return ami['Action']({'action':'status','channel':_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x4a')]})['catch'](function(_0x2b814e){if(_0x2b814e[_0x0a9e('0x4b')]===_0x0a9e('0x4c')){setTimeout(function(){if(_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0]){ut['updateOriginated'](_0x2b45ea['campaignsPreview'][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]],'[clearZombieChannel]');if(_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x4d')]===!![]){ut[_0x0a9e('0x4e')](_0x2b45ea['campaignsPreview'][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]],_0x0a9e('0x4f'));ut[_0x0a9e('0x50')](_0x0a9e('0x51')+_0x2da5c0,_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]);}ut[_0x0a9e('0x50')](_0x0a9e('0x52')+_0x2da5c0,_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]);delete _0x2b45ea[_0x0a9e('0x13')][_0x2da5c0];}},0x2328);}});}});};Preview[_0x0a9e('0xd')][_0x0a9e('0x53')]=function(){var _0x37f6cc=this;loggerAction['info']('[action]',_[_0x0a9e('0x54')](this[_0x0a9e('0x13')]));for(var _0x405c8f in this[_0x0a9e('0x13')]){if(_0x37f6cc[_0x0a9e('0x13')][_0x0a9e('0x37')](_0x405c8f)){_0x37f6cc[_0x0a9e('0x3f')](_0x405c8f);}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x3e')]=function(_0x25c6e6){var _0x2c2cb0=this;rpcDb[_0x0a9e('0x55')](_0x25c6e6['id'],ut['agentReadyId'](this[_0x0a9e('0x14')]))[_0x0a9e('0x56')](function(_0xdd268f){if(!_[_0x0a9e('0x41')](_0xdd268f)){for(var _0x2e8caf=0x0;_0x2e8caf<_0xdd268f[_0x0a9e('0x57')];_0x2e8caf+=0x1){if(ut[_0x0a9e('0x58')](_0xdd268f[_0x2e8caf][_0x0a9e('0x59')])<_0x25c6e6['dialRecallMeTimeout']*0x3c){if(_0xdd268f[_0x2e8caf][_0x0a9e('0x5a')]&&!_0xdd268f[_0x2e8caf]['Agent'][_0x0a9e('0x5b')]){_0x2c2cb0[_0x0a9e('0x5c')](_0xdd268f[_0x2e8caf]['id'])[_0x0a9e('0x56')](ut['logger2'](_0x0a9e('0x5d')))[_0x0a9e('0x5e')](ut[_0x0a9e('0x5f')](_0x0a9e('0x5d')));}else{rpcDb[_0x0a9e('0x60')](_0xdd268f[_0x2e8caf]['id']);}}else{var _0x37be73=new Action(_0xdd268f[_0x2e8caf],_0x25c6e6);_0x37be73[_0x0a9e('0x61')]=moment()['format'](_0x0a9e('0x62'));_0x25c6e6[_0x0a9e('0x63')]+=0x1;ut[_0x0a9e('0x64')](_0x37be73,0x17,_0x0a9e('0x65'));if(_0x25c6e6[_0x0a9e('0x66')]){rpcDb[_0x0a9e('0x67')](ut[_0x0a9e('0x68')](_0xdd268f[_0x2e8caf]));rpcDb[_0x0a9e('0x69')](_0x37be73,_0x0a9e('0x6a'));}else{ut['logCustomer'](_0x37be73,0x16,_0x0a9e('0x6b'));rpcDb[_0x0a9e('0x69')](_0x37be73,'[HistoryRecallClose]');rpcDb['createCustomerFinal'](_0x37be73,'[HistoryRecallClose]');}}}}})[_0x0a9e('0x5e')](ut[_0x0a9e('0x5f')](_0x0a9e('0x6c')));};Preview[_0x0a9e('0xd')][_0x0a9e('0x3d')]=function(_0x30decb){_0x30decb[_0x0a9e('0x2c')]=!![];if(ut[_0x0a9e('0x6d')](_0x30decb['loggedIn'])){_0x30decb['message']=utils['CAMPAIGN_STATUS'][_0x0a9e('0x6e')];}else if(!ut[_0x0a9e('0x6f')](_0x30decb[_0x0a9e('0x3c')])){_0x30decb['message']=utils[_0x0a9e('0x30')][_0x0a9e('0x31')];}else if(!this['isTrunkReachable'](_0x30decb['Trunk'])){if(!this[_0x0a9e('0x70')](_0x30decb['TrunkBackup'])){_0x30decb[_0x0a9e('0x4b')]=utils['CAMPAIGN_STATUS'][_0x0a9e('0x71')];}else{_0x30decb[_0x0a9e('0x4b')]=utils[_0x0a9e('0x30')]['ACTIVE'];}}else{_0x30decb[_0x0a9e('0x4b')]=utils[_0x0a9e('0x30')]['ACTIVE'];}};Preview['prototype'][_0x0a9e('0x72')]=function(_0x3aedd0,_0x49c095,_0x145931){var _0x5ce9ac=this;var _0x211ef9=this['actions'][_0x49c095];var _0xe22ccc=this['campaignsPreview'][_0x211ef9['queue']];var _0x5df0ad;var _0x2da03c=![];var _0x47de4c=0x2;var _0x2f7092=0x3;if(_0xe22ccc){switch(_0x145931){case'1':_0xe22ccc[_0x0a9e('0x73')]+=0x1;_0x211ef9[_0x0a9e('0x74')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x0,_0x0a9e('0x77'));ami[_0x0a9e('0x25')]('custom:agentnosuchnumber',ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0x79')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0x7a'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'0',_0xe22ccc)[_0x0a9e('0x56')](function(_0x5d86e9){_0x2da03c=_0x5d86e9[_0x0a9e('0x7c')]==0x1;_0x47de4c=_0xe22ccc[_0x0a9e('0x7d')];_0x2f7092=_0xe22ccc['callAdditionalPhoneAfterMin'];if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc['dialGlobalMaxRetry']){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,'Global');rpcDb['createCustomerFinal'](_0x5df0ad,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x211ef9[_0x0a9e('0x74')]>=_0xe22ccc['dialNoSuchNumberMaxRetry']){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0x80'));}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,_0x0a9e('0x74'),_0xe22ccc[_0x0a9e('0x7d')]),_0x211ef9['unlockAgent'],_0x211ef9[_0x0a9e('0x83')]);}}delete this['actions'][_0x3aedd0[_0x0a9e('0x84')]];}else{_0x211ef9[_0x0a9e('0x74')]++;logger[_0x0a9e('0x26')]('actioncountonusuch',_0x211ef9[_0x0a9e('0x74')]);logger[_0x0a9e('0x26')]('id',_0x211ef9[_0x0a9e('0x85')]);_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9['idContact'],'field':{'countnosuchnumberretry':_0x211ef9[_0x0a9e('0x74')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0x87'):var _0x88dcbf=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));_0x211ef9['responsetime']=_0x88dcbf;_0x211ef9[_0x0a9e('0x88')]=_0x88dcbf;_0x211ef9[_0x0a9e('0x4d')]=!![];_0xe22ccc[_0x0a9e('0x2e')]+=0x1;logger['info'](_0x0a9e('0x89'),_0x211ef9['uniqueid'],'\x20Queue',_0xe22ccc[_0x0a9e('0x29')],_0x0a9e('0x8a'),_0xe22ccc[_0x0a9e('0x2e')]);ami[_0x0a9e('0x25')](_0x0a9e('0x8b'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0x8c'),this[_0x0a9e('0x10')][_0x211ef9[_0x0a9e('0x43')]]));if(_0xe22ccc[_0x0a9e('0x8d')]||_0xe22ccc[_0x0a9e('0x8e')]){ami[_0x0a9e('0x25')](_0x0a9e('0x8f'),{'queue':_0x211ef9[_0x0a9e('0x43')],'interface':_0x211ef9[_0x0a9e('0x90')],'uniqueid':_0x211ef9[_0x0a9e('0x91')]});}break;case'16':ami[_0x0a9e('0x25')](_0x0a9e('0x92'),ut['buildObj'](_0x211ef9,_0x0a9e('0x93'),this[_0x0a9e('0x10')][_0x211ef9[_0x0a9e('0x43')]]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x211ef9,_0x0a9e('0x93')));_0xe22ccc[_0x0a9e('0x94')]+=0x1;_0xe22ccc['total']+=0x1;_0xe22ccc[_0x0a9e('0x95')]+=0x1;ut[_0x0a9e('0x4e')](_0xe22ccc,_0x0a9e('0x96'));_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x4,'Answer');rpcDb['createCustomerHistory'](_0x211ef9,_0x0a9e('0x97'));rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0x98'));rpcDb[_0x0a9e('0x99')](_0x211ef9);_0xe22ccc[_0x0a9e('0x9a')]+=_0x211ef9[_0x0a9e('0x9b')];_0xe22ccc[_0x0a9e('0x9c')]+=_0x211ef9[_0x0a9e('0x9b')];logger['info'](_0x0a9e('0x9d'),_0x211ef9[_0x0a9e('0x91')],_0x0a9e('0x9e'),_0xe22ccc['name'],_0x0a9e('0x8a'),_0xe22ccc['pTalking']);delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;case'BUSY':_0xe22ccc[_0x0a9e('0x9f')]+=0x1;_0x211ef9[_0x0a9e('0xa0')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x5,_0x0a9e('0xa1'));_0x47de4c=_0xe22ccc[_0x0a9e('0xa2')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami[_0x0a9e('0x25')]('custom:agentbusy',ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xa4')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xa5'));_0x5ce9ac['verifyAdditionalPhones'](_0x211ef9,'5',_0xe22ccc)[_0x0a9e('0x56')](function(_0x3511c9){_0x2da03c=_0x3511c9[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xa8'));}else{if(_0x211ef9[_0x0a9e('0xa0')]>=_0xe22ccc[_0x0a9e('0xa9')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xa5'));}else{rpcDb[_0x0a9e('0x81')](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xa0'),_0xe22ccc[_0x0a9e('0xa2')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xa0')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countbusyretry':_0x211ef9[_0x0a9e('0xa0')]}})['then'](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0xab'):_0xe22ccc['outboundNoAnswerCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xac')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x3,'NoAnswer');_0x47de4c=_0xe22ccc[_0x0a9e('0xad')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];var _0x2d2286=ut[_0x0a9e('0xae')](_0x211ef9,_0xe22ccc);ami[_0x0a9e('0x25')](_0x0a9e('0xaf'),_0x2d2286);rpcDb[_0x0a9e('0x69')](_0x211ef9,'[callProgressDetectingCustomer][logNoAnswer]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'3',_0xe22ccc)[_0x0a9e('0x56')](function(_0x45c109){_0x2da03c=_0x45c109[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,'Global');rpcDb[_0x0a9e('0x7f')](_0x5df0ad,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x211ef9[_0x0a9e('0xac')]>=_0xe22ccc[_0x0a9e('0xb0')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xb1'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xac'),_0xe22ccc[_0x0a9e('0xad')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9['idContact'],'field':{'countnoanswerretry':_0x211ef9['countnoanswerretry']}})[_0x0a9e('0x56')](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});break;case'CONGESTION':_0xe22ccc[_0x0a9e('0xb2')]+=0x1;_0x211ef9[_0x0a9e('0xb3')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x8,_0x0a9e('0xb4'));_0x47de4c=_0xe22ccc['dialCongestionRetryFrequency'];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami['emit'](_0x0a9e('0xb5'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xb6')));rpcDb[_0x0a9e('0x69')](_0x211ef9,'[callProgressDetectingCustomer][logCongestion]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'8',_0xe22ccc)[_0x0a9e('0x56')](function(_0x1d4877){_0x2da03c=_0x1d4877['additional']==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xb7'));}else{if(_0x211ef9[_0x0a9e('0xb3')]>=_0xe22ccc[_0x0a9e('0xb8')]){rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xb9'));}else{rpcDb[_0x0a9e('0x81')](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xb3'),_0xe22ccc[_0x0a9e('0xa2')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xb3')]++;_0x5ce9ac['incrementPreviewCounters']({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countcongestionretry':_0x211ef9[_0x0a9e('0xb3')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0xbb'):_0xe22ccc[_0x0a9e('0xbc')]+=0x1;_0x211ef9[_0x0a9e('0xbd')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x14,_0x0a9e('0xbe'));_0x47de4c=_0xe22ccc[_0x0a9e('0xbf')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami[_0x0a9e('0x25')](_0x0a9e('0xc0'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xc1')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xc2'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'20',_0xe22ccc)[_0x0a9e('0x56')](function(_0x4989f9){_0x2da03c=_0x4989f9[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0x14,_0x0a9e('0xbe'));rpcDb['createCustomerFinal'](_0x5df0ad,_0x0a9e('0xc3'));}else{if(_0x211ef9[_0x0a9e('0xbd')]>=_0xe22ccc['dialAgentRejectMaxRetry']){rpcDb[_0x0a9e('0x7f')](_0x211ef9,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,_0x0a9e('0xbd'),_0xe22ccc[_0x0a9e('0xbf')]),_0x211ef9['unlockAgent'],_0x211ef9[_0x0a9e('0x83')]);}}}else{_0x211ef9['countnoanswerretry']++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9['countnoanswerretry']}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case'ABANDONED':_0xe22ccc['outboundAbandonedCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xc4')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0xb,_0x0a9e('0xc5'));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xc6'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'11',_0xe22ccc)[_0x0a9e('0x56')](function(_0x586510){_0x2da03c=_0x586510[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xc6'));}else{if(_0x211ef9['countabandonedetry']>=_0xe22ccc[_0x0a9e('0xc7')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xc6'));}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,'countabandonedretry',_0xe22ccc['dialAbandonedRetryFrequency']),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});break;case'18':_0xe22ccc['outboundUnknownCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xc8')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x12,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0['dialstatus']);ami['emit'](_0x0a9e('0xca'),ut[_0x0a9e('0x78')](_0x211ef9,'amd'));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xcb'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'18',_0xe22ccc)[_0x0a9e('0x56')](function(_0x2eb028){_0x2da03c=_0x2eb028['additional']==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0x12,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xcb'));}else{rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xcb'));}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac['incrementPreviewCounters']({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;case'19':_0xe22ccc[_0x0a9e('0xcc')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x13,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0[_0x0a9e('0xcd')]);ami[_0x0a9e('0x25')](_0x0a9e('0xca'),ut[_0x0a9e('0x78')](_0x211ef9,'amd'));rpcDb['createCustomerHistory'](_0x211ef9,_0x0a9e('0xce'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'18',_0xe22ccc)[_0x0a9e('0x56')](function(_0x2fea95){_0x2da03c=_0x2fea95[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb['createCustomerFinal'](_0x5df0ad,_0x0a9e('0xce'));}else{rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xce'));}}else{_0x211ef9['countnoanswerretry']++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})['then'](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;default:if(_0x211ef9[_0x0a9e('0x4d')]){ut[_0x0a9e('0x4e')](_0xe22ccc,_0x0a9e('0xcf'));ut[_0x0a9e('0x50')](_0x0a9e('0xd0')+_0xe22ccc[_0x0a9e('0x29')],_0x3aedd0);}_0xe22ccc[_0x0a9e('0xcc')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0xc,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0[_0x0a9e('0xcd')]);_0x47de4c=_0xe22ccc[_0x0a9e('0xbf')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];rpcDb['createCustomerHistory'](_0x211ef9,'[callProgressDetectingCustomer][logUnknown]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'20',_0xe22ccc)['then'](function(_0x1d999b){_0x2da03c=_0x1d999b[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xd1'));}delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];}else{_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});}});}if(!(_0x211ef9[_0x0a9e('0x4d')]&&_0x145931==='16')){ut[_0x0a9e('0xd2')](_0xe22ccc,'[callProgressDetectingCustomer]');logger[_0x0a9e('0x26')](_0x0a9e('0xd3'),_0x211ef9[_0x0a9e('0x91')],'\x20Queue',_0xe22ccc[_0x0a9e('0x29')],_0x0a9e('0x44'),_0xe22ccc[_0x0a9e('0x2d')]);}if(_0x145931!==_0x0a9e('0x87')){delete this[_0x0a9e('0x13')][_0x3aedd0['linkedid']];delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0xd4')]];}_0xe22ccc['queueSummaryCountersUpdated']=!![];}};Preview[_0x0a9e('0xd')][_0x0a9e('0xd5')]=function(_0x1f6f1c,_0x5822a7,_0x5c3b6f){if(_['isUndefined'](_0x5822a7)&&_0x0a9e('0xd6')!==typeof _0x5822a7){return;}if(_[_0x0a9e('0xd7')](_0x5c3b6f)&&'object'!==typeof _0x5c3b6f){return;}switch(_0x5c3b6f[_0x0a9e('0xd8')]){case'0':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x0,_0x0a9e('0x77'));rpcDb['createAgentHistory'](_0x1f6f1c,_0x0a9e('0xda'));break;case'3':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x3,_0x0a9e('0xdb'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xdd'));break;case'5':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x5,_0x0a9e('0xa1'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xde'));break;case'8':ut['logAgent'](_0x1f6f1c,0x8,_0x0a9e('0xb4'));rpcDb['createAgentHistory'](_0x1f6f1c,_0x0a9e('0xdf'));break;case'22':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x16,_0x0a9e('0xe0'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xe1'));break;default:ut[_0x0a9e('0xd9')](_0x1f6f1c,0xc,_0x5c3b6f['reason']);rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xdf'));}ut[_0x0a9e('0xd2')](_0x5822a7,_0x0a9e('0xe2'));logger['info'](_0x0a9e('0xe3'),_0x1f6f1c[_0x0a9e('0x91')],_0x0a9e('0x9e'),_0x5822a7[_0x0a9e('0x29')],_0x0a9e('0x44'),_0x5822a7[_0x0a9e('0x2d')]);delete this[_0x0a9e('0x13')][_0x1f6f1c[_0x0a9e('0x91')]];};Preview[_0x0a9e('0xd')][_0x0a9e('0x7b')]=function(_0x57f0ad,_0x2272bc,_0x88b25f){return cmHopperAdditionalPhone[_0x0a9e('0x7b')](_0x57f0ad,_0x2272bc,_0x88b25f)[_0x0a9e('0x5e')](logger[_0x0a9e('0x26')](_0x0a9e('0xe4')));};Preview[_0x0a9e('0xd')][_0x0a9e('0xba')]=function(_0x566b90,_0x3b581c,_0xd2391){return cmHopperAdditionalPhone[_0x0a9e('0xba')](_0x566b90,_0x3b581c,_0xd2391)['catch'](logger[_0x0a9e('0x26')](_0x0a9e('0xe5')));};Preview[_0x0a9e('0xd')][_0x0a9e('0x86')]=function(_0x370b5e){return Promise[_0x0a9e('0xe6')]()[_0x0a9e('0x56')](cmHopperAdditionalPhone[_0x0a9e('0x86')](_0x370b5e))[_0x0a9e('0x5e')](logger[_0x0a9e('0x26')]('[incrementPreviewCounters]\x20'));};Preview[_0x0a9e('0xd')][_0x0a9e('0xe7')]=function(_0x15a9ed,_0x3db98f,_0x2b624e,_0x3942fd,_0x5cb48d){var _0x382687=this;return new Promise(function(_0x4f854b,_0x5bd139){if(_['isNil'](_0x3db98f)||_[_0x0a9e('0x41')](_0x3db98f[_0x0a9e('0xe8')])||_[_0x0a9e('0x41')](_0x3db98f[_0x0a9e('0xe9')])||_['isNil'](_0x3db98f[_0x0a9e('0x48')])){_0x5bd139(ut[_0x0a9e('0x4b')](_0x0a9e('0xea'),_0x3942fd,_0x5cb48d));return;}var _0x1fdb10=uuid['v4']();var _0x2c8d1d=_0x382687['campaignsPreview'][_0x3db98f['Queue'][_0x0a9e('0x29')]];var _0x33bcb2=_0x2b624e?_0x382687[_0x0a9e('0x14')][_0x2b624e]['id']:undefined;_0x382687['actions'][_0x1fdb10]=new Action(_0x3db98f,_0x2c8d1d,_0x1fdb10,_0x2b624e,_0x33bcb2);var _0x319752=_0x382687[_0x0a9e('0x13')][_0x1fdb10];_0x319752[_0x0a9e('0xaa')]=_0x3942fd;_0x319752['activeContact']=_0x5cb48d;_0x319752[_0x0a9e('0xeb')]=_0x2b624e;if(_[_0x0a9e('0xec')](_0x15a9ed)){_0x382687[_0x0a9e('0xed')](_0x319752,_0x2c8d1d,_0x3db98f,_0x2b624e)['then'](function(_0x272291){logger[_0x0a9e('0x26')](_0x0a9e('0xee'),'Queue:\x20'+_0x319752['queue']+'\x20IdHopper:\x20'+_0x319752[_0x0a9e('0x85')],JSON[_0x0a9e('0x45')](_0x272291));ami[_0x0a9e('0x25')](_0x0a9e('0xef'),ut['buildObj'](_0x319752,_0x0a9e('0xf0'),_0x382687['campaignsPreview'][_0x319752[_0x0a9e('0x43')]]));_0x4f854b(ut[_0x0a9e('0x4b')](_0x0a9e('0xf1')));})['catch'](function(_0x33b4b3){ut[_0x0a9e('0x32')](_0x0a9e('0xf2'),_0x33b4b3);_0x5bd139(ut['message'](_0x0a9e('0xf3'),_0x3942fd,_0x5cb48d));});}else{_0x2c8d1d['outboundBlacklistCallsDay']+=0x1;ut[_0x0a9e('0xf4')](_0x319752);rpcDb['createHistory'](_0x319752,_0x0a9e('0xf5'));delete _0x382687['actions'][_0x1fdb10];_0x5bd139(ut[_0x0a9e('0x4b')](_0x0a9e('0xf6'),_0x3942fd,_0x5cb48d));}});};Preview[_0x0a9e('0xd')][_0x0a9e('0x70')]=function(_0x1e306c){return!_[_0x0a9e('0x41')](_0x1e306c)&&!_[_0x0a9e('0x41')](_0x1e306c['name'])&&!_[_0x0a9e('0x41')](_0x1e306c[_0x0a9e('0xf7')])&&_0x1e306c['active']&&!_[_0x0a9e('0x41')](this[_0x0a9e('0x12')][util['format'](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])])&&!_[_0x0a9e('0x41')](this['trunks'][util[_0x0a9e('0x27')](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')])&&(this[_0x0a9e('0x12')][util[_0x0a9e('0x27')](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')]===_0x0a9e('0xfa')||this['trunks'][util[_0x0a9e('0x27')]('SIP/%s',_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')]===_0x0a9e('0xfb'));};Preview[_0x0a9e('0xd')][_0x0a9e('0x5c')]=function(_0x2d45db,_0x5691ac){return this[_0x0a9e('0xfc')](_0x2d45db,_0x5691ac)[_0x0a9e('0x56')](function(_0x2977a7){return _['pick'](_0x2977a7,[_0x0a9e('0x4b')]);})[_0x0a9e('0x5e')](function(_0x4435d2){if(_0x4435d2[_0x0a9e('0xfd')]){rpcDb[_0x0a9e('0xfe')](_0x2d45db);}if(_0x4435d2[_0x0a9e('0xf7')]){rpcDb[_0x0a9e('0x60')](_0x2d45db);}throw _['pick'](_0x4435d2,[_0x0a9e('0x4b')]);});};Preview[_0x0a9e('0xd')][_0x0a9e('0xfc')]=function(_0x2ce3be,_0x3de77e){var _0x241404=this;var _0x8120e,_0x5d6a48;return rpcDb['getContactPreview'](_0x2ce3be)[_0x0a9e('0x56')](function(_0x3f507c){if(!_[_0x0a9e('0x41')](_0x3f507c[0x0])){_0x5d6a48=_0x3f507c[0x0][_0x0a9e('0xff')]?![]:!![];_0x8120e=_0x3f507c[0x0][_0x0a9e('0xff')]?!![]:![];_0x8120e=_0x3de77e?!![]:_0x8120e;}var _0x131da8=_0x241404[_0x0a9e('0x100')](_0x3f507c);if(_0x131da8['isValid']){rpcDb[_0x0a9e('0x101')](_[_0x0a9e('0x46')](_0x3f507c[0x0],[_0x0a9e('0x48'),_0x0a9e('0xe9')]))[_0x0a9e('0x56')](function(_0x3c6082){_0x241404[_0x0a9e('0xe7')](_0x3c6082,_0x3f507c[0x0],_0x3de77e,_0x5d6a48,_0x8120e)['then'](function(_0x311288){return _0x311288;})[_0x0a9e('0x5e')](function(_0x231826){throw _0x231826;});})['catch'](function(_0x2b8ad4){ut[_0x0a9e('0x32')](_0x0a9e('0x102'),_0x2b8ad4);throw ut[_0x0a9e('0x4b')]('Call\x20unsuccessful',_0x5d6a48,_0x8120e);});}else{throw ut[_0x0a9e('0x4b')](_0x131da8[_0x0a9e('0x4b')],_0x5d6a48,_0x8120e);}})[_0x0a9e('0x5e')](function(_0x93d953){ut[_0x0a9e('0x32')](_0x0a9e('0x103'),_0x93d953);throw ut[_0x0a9e('0x4b')](_0x0a9e('0x104'),![],!![]);});};Preview['prototype'][_0x0a9e('0x100')]=function(_0x266aa1){if(_[_0x0a9e('0x41')](_0x266aa1)||_[_0x0a9e('0xec')](_0x266aa1)||!_['isNil'](_0x266aa1[0x0]['Agent'])&&_[_0x0a9e('0x41')](_0x266aa1[0x0][_0x0a9e('0x5a')][_0x0a9e('0x29')])){ut['logger'](_0x0a9e('0x105'),_0x266aa1);return{'isValid':![],'message':_0x0a9e('0x106')};}var _0x4d8a67=this[_0x0a9e('0x10')][_0x266aa1[0x0]['Queue'][_0x0a9e('0x29')]];_0x4d8a67['message']=utils['CAMPAIGN_STATUS']['ACTIVE'];if(_[_0x0a9e('0x41')](_0x4d8a67)){ut[_0x0a9e('0x32')](_0x0a9e('0x107'),_0x4d8a67);return{'isValid':![],'message':_0x0a9e('0x108')};}if(!this[_0x0a9e('0x70')](_0x4d8a67[_0x0a9e('0x109')])){ut['logger'](_0x0a9e('0x10a'),_0x0a9e('0x10b')+_0x4d8a67[_0x0a9e('0x29')]+_0x0a9e('0x10c'));if(!this[_0x0a9e('0x70')](_0x4d8a67[_0x0a9e('0x10d')])){ut[_0x0a9e('0x32')]('[Preview][validateContact][Trunk\x20not\x20working\x20correctly]',_0x4d8a67['name']+_0x0a9e('0x10e'));return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}}if(!ut[_0x0a9e('0x6f')](_0x4d8a67[_0x0a9e('0x3c')])){ut[_0x0a9e('0x32')](_0x0a9e('0x10f'),_0x4d8a67[_0x0a9e('0x29')]+_0x0a9e('0x110'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x4d8a67[_0x0a9e('0x29')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview[_0x0a9e('0xd')]['execCall']=function(_0x38dceb,_0x5dc978,_0x550cbf,_0x26223f){var _0x4a7a3c=this;return new Promise(function(_0x24470a,_0x142e53){var _0xe1ab0d=_0x38dceb['uniqueid'];var _0x4152cd=_0x4a7a3c[_0x0a9e('0x70')](_0x5dc978[_0x0a9e('0x109')])?util['format']('SIP/%s/%s%s',_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x29')],_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x111')])?'':_0x5dc978[_0x0a9e('0x111')][_0x0a9e('0x112')]()||'',_0x5dc978[_0x0a9e('0x113')]>0x0?_0x550cbf[_0x0a9e('0xe9')][_0x0a9e('0x114')](_0x5dc978[_0x0a9e('0x113')]):_0x550cbf['phone']):util['format']('SIP/%s/%s%s',_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x10d')])?_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x29')]:_0x5dc978[_0x0a9e('0x10d')][_0x0a9e('0x29')],_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x111')])?'':_0x5dc978['dialPrefix']['trim']()||'',_0x5dc978[_0x0a9e('0x113')]>0x0?_0x550cbf[_0x0a9e('0xe9')]['substring'](_0x5dc978[_0x0a9e('0x113')]):_0x550cbf[_0x0a9e('0xe9')]);var _0x2e2280=_0x4a7a3c[_0x0a9e('0x70')](_0x5dc978[_0x0a9e('0x109')])?ut[_0x0a9e('0x115')](_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x116')],_0x5dc978[_0x0a9e('0x117')],_0x5dc978[_0x0a9e('0x118')]>0x0?ut[_0x0a9e('0x119')](_0x5dc978[_0x0a9e('0x11a')],_0x5dc978['dialRandomLastDigitCallerIdNumber']):_0x5dc978[_0x0a9e('0x11a')]):ut[_0x0a9e('0x115')](_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x10d')])?_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x116')]:_0x5dc978[_0x0a9e('0x10d')][_0x0a9e('0x116')],_0x5dc978[_0x0a9e('0x117')],_0x5dc978[_0x0a9e('0x118')]>0x0?ut[_0x0a9e('0x119')](_0x5dc978[_0x0a9e('0x11a')],_0x5dc978['dialRandomLastDigitCallerIdNumber']):_0x5dc978['dialOriginateCallerIdNumber']);if(_0x2e2280){_0x38dceb[_0x0a9e('0x11b')]=ut[_0x0a9e('0x11c')](_0x2e2280);_0x38dceb[_0x0a9e('0x11d')]=ut[_0x0a9e('0x11e')](_0x2e2280);}var _0x33359a=ut[_0x0a9e('0x11f')](_0x5dc978,_0x550cbf,_0x4152cd,_0x2e2280,_0xe1ab0d,_0x38dceb);var _0xa8b5de=utils['setXMDContactVariables'](_0x550cbf[_0x0a9e('0xe8')]);Object['assign'](_0x33359a,_0xa8b5de);_[_0x0a9e('0x120')](_0x38dceb,ut[_0x0a9e('0x121')](_0x33359a));_0x38dceb[_0x0a9e('0x61')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));_0x5dc978[_0x0a9e('0x122')]=_0x33359a;var _0x465003=ut[_0x0a9e('0x123')](_0x38dceb,_0x5dc978,_0x33359a,_0x38dceb[_0x0a9e('0x83')],_0x26223f);return ami[_0x0a9e('0x124')](_0x465003)[_0x0a9e('0x56')](function(_0x8231e5){_0x5dc978[_0x0a9e('0x2d')]+=0x1;logger[_0x0a9e('0x26')](_0x0a9e('0x125'),_0xe1ab0d,_0x0a9e('0x9e'),_0x5dc978['name'],'originated:\x20',_0x5dc978[_0x0a9e('0x2d')]);_0x24470a(_0x8231e5);})[_0x0a9e('0x5e')](function(_0x52b365){ut['logAgent'](_0x38dceb,0xe,_0x0a9e('0x126'));rpcDb[_0x0a9e('0xdc')](_0x38dceb,_0x0a9e('0x127'));_0x142e53(_0x52b365);});});};Preview['prototype'][_0x0a9e('0x1d')]=function(_0x5b6447){if(this[_0x0a9e('0x13')][_0x5b6447['linkedid']]){this[_0x0a9e('0x13')][_0x5b6447['linkedid']][_0x0a9e('0x4a')]=_0x5b6447[_0x0a9e('0x4a')];}};Preview[_0x0a9e('0xd')]['syncOriginateResponse']=function(_0x316b51){var _0x497fda=this;var _0x505ffd=this[_0x0a9e('0x13')][_0x316b51[_0x0a9e('0x128')]];if(_0x505ffd){if(_0x505ffd[_0x0a9e('0xeb')]&&this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]]){ut[_0x0a9e('0x129')](_0x505ffd,this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]][_0x0a9e('0x29')],this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]]['id']);}var _0x98bf26=_[_0x0a9e('0x12a')](_0x505ffd);_0x98bf26[_0x0a9e('0x12b')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));var _0x310026=_0x497fda[_0x0a9e('0x10')][_0x505ffd[_0x0a9e('0x43')]];if(ut['isFailure'](_0x316b51[_0x0a9e('0x12c')])){if(_0x505ffd[_0x0a9e('0xaa')]){rpcDb[_0x0a9e('0xfe')](_0x505ffd[_0x0a9e('0x85')]);}if(_0x505ffd['activeContact']){rpcDb['disableContact'](_0x505ffd['idContact']);}ami[_0x0a9e('0x25')]('custom:agentringnoanswer',ut[_0x0a9e('0x78')](_0x505ffd,_0x0a9e('0x12d'),this[_0x0a9e('0x10')][_0x505ffd[_0x0a9e('0x43')]]));this[_0x0a9e('0xd5')](_0x98bf26,_0x310026,_0x316b51);}else{_0x505ffd[_0x0a9e('0x61')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));ut[_0x0a9e('0xd9')](_0x98bf26,0x4,_0x0a9e('0x12e'));rpcDb['createAgentHistory'](_0x98bf26,_0x0a9e('0x12f'));}}};Preview['prototype'][_0x0a9e('0x1a')]=function(_0x586d2f){var _0xf4de86=this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]];var _0x556bb7;if(_0xf4de86){_0x556bb7=this[_0x0a9e('0x10')][_0xf4de86[_0x0a9e('0x43')]];logger['info']('[syncHangup][talking]',_0x586d2f[_0x0a9e('0x84')],_0x0a9e('0x9e'),_0x556bb7[_0x0a9e('0x29')],'pTalking:\x20',_0x556bb7['pTalking']);}if(this['actions'][_0x586d2f[_0x0a9e('0x84')]]&&_0x586d2f[_0x0a9e('0x84')]!==_0x586d2f[_0x0a9e('0x91')]){if(_0x586d2f[_0x0a9e('0x130')]==='16'&&this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]][_0x0a9e('0x4d')]){this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}else if(this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]][_0x0a9e('0x4d')]){logger[_0x0a9e('0x26')](_0x0a9e('0x131'),_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7['name'],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}}else if(_0xf4de86&&_[_0x0a9e('0x41')](_0xf4de86['statedesc'])&&_0x556bb7[_0x0a9e('0x132')]&&_0x586d2f[_0x0a9e('0x84')]===_0x586d2f[_0x0a9e('0x91')]&&_[_0x0a9e('0x41')](_0x586d2f[_0x0a9e('0xd8')])&&_0x586d2f[_0x0a9e('0x130')]==='16'&&_0x586d2f[_0x0a9e('0x133')]==='6'&&_[_0x0a9e('0xd7')](_0xf4de86[_0x0a9e('0x134')])){if(_0xf4de86['unlockAgent']){rpcDb['unlockContact'](_0xf4de86[_0x0a9e('0x85')]);}if(_0xf4de86[_0x0a9e('0x83')]){rpcDb['disableContact'](_0xf4de86[_0x0a9e('0x85')]);}_0x586d2f[_0x0a9e('0xd8')]='22';this['callProgressDetectingAgent'](_0xf4de86,_0x556bb7,_0x586d2f);}else if(_0xf4de86&&_0xf4de86[_0x0a9e('0x134')]){if(_0x586d2f['cause']==='16'&&this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]]['dialAnswer']){logger[_0x0a9e('0x26')](_0x0a9e('0x135'),_0x586d2f['linkedid'],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7['name'],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}else if(this[_0x0a9e('0x13')][_0x586d2f['linkedid']][_0x0a9e('0x4d')]){logger[_0x0a9e('0x26')]('[syncHangup][talking][cause]',_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7[_0x0a9e('0x29')],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f['linkedid'],_0x586d2f['cause']);}}};Preview['prototype']['syncDialEnd']=function(_0x5e9817){if(this[_0x0a9e('0x13')][_0x5e9817[_0x0a9e('0xd4')]]&&_0x5e9817['destlinkedid']!==_0x5e9817['destuniqueid']){this[_0x0a9e('0x72')](_0x5e9817,_0x5e9817['destlinkedid'],_0x5e9817[_0x0a9e('0xcd')]);}};Preview[_0x0a9e('0xd')][_0x0a9e('0x136')]=function(_0x175c97){if(this[_0x0a9e('0x13')][_0x175c97[_0x0a9e('0x84')]]&&_0x175c97['linkedid']!==_0x175c97[_0x0a9e('0x91')]&&!this[_0x0a9e('0x13')][_0x175c97['linkedid']][_0x0a9e('0x4d')]){if(_0x175c97[_0x0a9e('0x130')]==='1'){this[_0x0a9e('0x72')](_0x175c97,_0x175c97[_0x0a9e('0x84')],_0x175c97[_0x0a9e('0x130')]);}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x137')]=function(_0x4a36df,_0x331216,_0x508395){if(this[_0x0a9e('0x13')][_0x4a36df]){if(_[_0x0a9e('0x41')](this['actions'][_0x4a36df][_0x0a9e('0x122')])){this[_0x0a9e('0x13')][_0x4a36df]['variables']={};}this[_0x0a9e('0x13')][_0x4a36df]['variables'][_0x331216]=_0x508395;}};Preview[_0x0a9e('0xd')][_0x0a9e('0x1f')]=function(_0x5d0620){try{if(!_[_0x0a9e('0x41')](_0x5d0620)){if(ut['filterKey'](_[_0x0a9e('0x138')](_0x5d0620[_0x0a9e('0x139')])[0x0])){this[_0x0a9e('0x137')](_0x5d0620[_0x0a9e('0x91')],_[_0x0a9e('0x138')](_0x5d0620[_0x0a9e('0x139')])[0x0],_0x5d0620[_0x0a9e('0x13a')]);}}}catch(_0x53b5c2){logger[_0x0a9e('0x13b')](_0x0a9e('0x13c'),util[_0x0a9e('0x13d')](_0x53b5c2,{'showHidden':![],'depth':null}));}};Preview[_0x0a9e('0xd')][_0x0a9e('0x21')]=function(_0x5932ad){if(_0x5932ad){if(this[_0x0a9e('0x13')][_0x5932ad['transfertargetlinkedid']]){this['actions'][_0x5932ad[_0x0a9e('0x13e')]]['transfer']=!![];}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x23')]=function(_0x58d5fd){if(_0x58d5fd){if(this[_0x0a9e('0x13')][_0x58d5fd[_0x0a9e('0x13f')]]){this[_0x0a9e('0x13')][_0x58d5fd[_0x0a9e('0x13f')]][_0x0a9e('0x134')]=!![];}}};module[_0x0a9e('0x140')]=Preview; \ No newline at end of file +var _0xa9e0=['varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','info','format','voice:queue:%s','name','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','originated','pTalking','available','CAMPAIGN_STATUS','INACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','\x20is\x20deactivated','syncCampaigns','hasOwnProperty','dialMethod','booked','type','outbound','dialActive','setMessage','recallMe','clearZombieChannel','sequence','isNil','Queue','queue','originated:\x20','stringify','pick','UserId','VoiceQueueId','ListId','channel','message','No\x20such\x20channel','dialAnswer','decrementTalkink','[clearZombieChannel]','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','clearZombieChannels','size','getContactRecallMe','then','length','getDiff','scheduledat','Agent','voicePause','run','[RecallMe]','catch','logger2','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[getContactRecallMe]','IsNotLoggedIn','NO_AGENTS_LOGGED','isActive','isTrunkReachable','UNREACHABLE_TRUNK','callProgressDetectingCustomer','outboundNoSuchCallsDay','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','additional','dialNoSuchNumberRetryFrequency','cloneAction','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','scheduledAt','activeContact','linkedid','idContact','incrementPreviewCounters','ANSWER','answertime','[syncHangup][talking][increment]','pTalking:\x20','custom:agentconnect','connect','acw','mandatoryDisposition','custom:agentConnectPreview','channelAgent','uniqueid','custom:agentcomplete','complete','outboundAnswerCallsDay','answered','[16]','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumDuration','talktime','sumBillable','[syncHangup][talking][decrement]','\x20Queue','outboundBusyCallsDay','countbusyretry','Busy','dialBusyRetryFrequency','callAdditionalPhoneAfterMin','busy','[callProgressDetectingCustomer][logBusy]','dialGlobalMaxRetry','Global','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','unlockAgent','NOANSWER','countnoanswerretry','dialNoAnswerRetryFrequency','buildNoAnswerEventPayload','custom:agentnoanswer','dialNoAnswerMaxRetry','[callProgressDetectingCustomer][logNoAnswer]','outboundCongestionCallsDay','countcongestionretry','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','[callProgressDetectingCustomer][logCongestion]','swapAdditionalPhones','CANCEL','outboundRejectCallsDay','countagentrejectretry','AgentReject','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedMaxRety','countmachineretry','cause-txt','custom:amd','[callProgressDetectingCustomer][hangupInAMD]','outboundUnknownCallsDay','dialstatus','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknownGlobal]','updateOriginated','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','object','isUndefined','reason','logAgent','[callProgressDetectingAgent][logNoSuch]','NoAnswer','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','resolve','checkInBlack','Contact','phone','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','[Preview][execCall][success]','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','[Blacklist][error]','Contact\x20in\x20black\x20List','active','SIP/%s','status','reachable','unmonitored','execRun','unlock','unlockContact','recallme','validateContact','checkIsBlackList','[Preview][checkIsBlackList]','[Preview][getContactPreview]','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','Trunk','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','TrunkBackup','\x20Trunk\x20Backup\x20is\x20not\x20active','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','dialPrefix','trim','dialCutDigit','substring','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','merge','toLowerVariables','variables','variablesAction','Action','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','logLookAgent','clone','responsetime','response','rejected','Answer','[callProgressDetectingAgent][logAnswer]','cause','[syncHangup][talking][cause]','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','syncHangupRequest','addVariable','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','uuid','../../../config/environment','preview','../../../config/logger','actionPreview','../ami','./rpcDb','./action','./util/util','../dialer/utils','redis','prototype','enqueue','tail','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncDialEnd','syncNewExten'];(function(_0x4f0ecb,_0x544eed){var _0x4594f0=function(_0x41f3a6){while(--_0x41f3a6){_0x4f0ecb['push'](_0x4f0ecb['shift']());}};_0x4594f0(++_0x544eed);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0xa9e0[_0x1b349a];return _0x5d1f7c;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var uuid=require(_0x0a9e('0x2'));var moment=require('moment');var Redis=require('ioredis');var config=require(_0x0a9e('0x3'));var logger=require('../../../config/logger')(_0x0a9e('0x4'));var loggerAction=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var ami=require(_0x0a9e('0x7'));var rpcDb=require(_0x0a9e('0x8'));var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var Action=require(_0x0a9e('0x9'));var ut=require(_0x0a9e('0xa'));var utils=require(_0x0a9e('0xb'));config['redis']=_['defaults'](config[_0x0a9e('0xc')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0a9e('0xc')]));var Sequence=function(){};Sequence[_0x0a9e('0xd')][_0x0a9e('0xe')]=function(_0x3ab53f){this[_0x0a9e('0xf')]=this[_0x0a9e('0xf')]?this['tail']['finally'](_0x3ab53f):_0x3ab53f();};function Preview(_0x527cdd){this['sequence']=new Sequence();this[_0x0a9e('0x10')]=_0x527cdd[_0x0a9e('0x11')];this[_0x0a9e('0x12')]=_0x527cdd[_0x0a9e('0x12')];this[_0x0a9e('0x13')]={};this[_0x0a9e('0x14')]=_0x527cdd['agents'];this[_0x0a9e('0x15')]=0x0;ami['on'](_0x0a9e('0x16'),this[_0x0a9e('0x17')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x19'),this[_0x0a9e('0x1a')]['bind'](this));ami['on'](_0x0a9e('0x1b'),this['syncHangupRequest'][_0x0a9e('0x18')](this));ami['on']('dialend',this[_0x0a9e('0x1c')][_0x0a9e('0x18')](this));ami['on']('newexten',this[_0x0a9e('0x1d')]['bind'](this));ami['on'](_0x0a9e('0x1e'),this[_0x0a9e('0x1f')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x20'),this[_0x0a9e('0x21')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x22'),this[_0x0a9e('0x23')][_0x0a9e('0x18')](this));this[_0x0a9e('0x24')](this[_0x0a9e('0x10')]);}function emit(_0x105080,_0x4bb1e3,_0x2c3407){io['to'](_0x105080)[_0x0a9e('0x25')](_0x4bb1e3,_0x2c3407);}function emitVoiceQueueChannelRemove(_0x53682f){logger[_0x0a9e('0x26')]('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON['stringify'](_0x53682f));emit(util[_0x0a9e('0x27')](_0x0a9e('0x28'),_0x53682f[_0x0a9e('0x29')]),_0x0a9e('0x2a'),_0x53682f);io['emit'](_0x0a9e('0x2b'),_0x53682f);}function notSendMessagesQueue(_0x2fb0e4){if(_0x2fb0e4[_0x0a9e('0x2c')]){if(_0x2fb0e4[_0x0a9e('0x2d')]===0x0&&_0x2fb0e4[_0x0a9e('0x2e')]===0x0){_0x2fb0e4[_0x0a9e('0x2c')]=![];_0x2fb0e4[_0x0a9e('0x2f')]=0x0;_0x2fb0e4['paused']=0x0;_0x2fb0e4['message']=utils[_0x0a9e('0x30')][_0x0a9e('0x31')];ut[_0x0a9e('0x32')](_0x0a9e('0x33'),_0x2fb0e4['name']+_0x0a9e('0x34'));}else{_0x2fb0e4['message']=utils[_0x0a9e('0x30')]['DEACTIVATED'];ut[_0x0a9e('0x32')](_0x0a9e('0x33'),_0x2fb0e4[_0x0a9e('0x29')]+_0x0a9e('0x35'));}}}Preview[_0x0a9e('0xd')][_0x0a9e('0x24')]=function(){var _0x11c3b6=this;setInterval(function(){_0x11c3b6[_0x0a9e('0x36')]();},0x7cf);};Preview['prototype'][_0x0a9e('0x36')]=function(){var _0x468813=this[_0x0a9e('0x10')];this[_0x0a9e('0x15')]+=0x1;for(var _0x5c877d in _0x468813){if(_0x468813[_0x0a9e('0x37')](_0x5c877d)&&(_0x468813[_0x5c877d][_0x0a9e('0x38')]===_0x0a9e('0x4')||_0x468813[_0x5c877d][_0x0a9e('0x38')]===_0x0a9e('0x39'))&&_0x468813[_0x5c877d][_0x0a9e('0x3a')]===_0x0a9e('0x3b')){if(this[_0x0a9e('0x15')]>0x7){this[_0x0a9e('0x15')]=0x0;this['clearZombieChannels']();}}if(_0x468813[_0x0a9e('0x37')](_0x5c877d)&&_0x468813[_0x5c877d]['dialMethod']===_0x0a9e('0x4')&&_0x468813[_0x5c877d][_0x0a9e('0x3a')]===_0x0a9e('0x3b')){if(_0x468813[_0x5c877d][_0x0a9e('0x3c')]){this[_0x0a9e('0x3d')](_0x468813[_0x5c877d]);if(_0x468813[_0x5c877d]['dialPreviewAutoRecallMe'])this[_0x0a9e('0x3e')](_0x468813[_0x5c877d]);}else{notSendMessagesQueue(_0x468813[_0x5c877d]);}}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x3f')]=function(_0x2da5c0){var _0x2b45ea=this;this[_0x0a9e('0x40')][_0x0a9e('0xe')](function(){if(!_[_0x0a9e('0x41')](_0x2b45ea['actions'][_0x2da5c0])){loggerAction[_0x0a9e('0x26')]('[clearZombieChannels][talking]',_0x2da5c0,_0x0a9e('0x42'),_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')],_0x0a9e('0x44'),JSON['stringify'](_0x2b45ea[_0x0a9e('0x10')][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]][_0x0a9e('0x2d')]),'pTalking:\x20',JSON['stringify'](_0x2b45ea[_0x0a9e('0x10')][_0x2b45ea['actions'][_0x2da5c0][_0x0a9e('0x43')]][_0x0a9e('0x2e')]),JSON[_0x0a9e('0x45')](_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0]['dialAnswer']),JSON[_0x0a9e('0x45')](_[_0x0a9e('0x46')](_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0],['contactId',_0x0a9e('0x47'),_0x0a9e('0x48'),_0x0a9e('0x49')])));return ami['Action']({'action':'status','channel':_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x4a')]})['catch'](function(_0x2b814e){if(_0x2b814e[_0x0a9e('0x4b')]===_0x0a9e('0x4c')){setTimeout(function(){if(_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0]){ut['updateOriginated'](_0x2b45ea['campaignsPreview'][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]],'[clearZombieChannel]');if(_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x4d')]===!![]){ut[_0x0a9e('0x4e')](_0x2b45ea['campaignsPreview'][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]],_0x0a9e('0x4f'));ut[_0x0a9e('0x50')](_0x0a9e('0x51')+_0x2da5c0,_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]);}ut[_0x0a9e('0x50')](_0x0a9e('0x52')+_0x2da5c0,_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]);delete _0x2b45ea[_0x0a9e('0x13')][_0x2da5c0];}},0x2328);}});}});};Preview[_0x0a9e('0xd')][_0x0a9e('0x53')]=function(){var _0x37f6cc=this;loggerAction['info']('[action]',_[_0x0a9e('0x54')](this[_0x0a9e('0x13')]));for(var _0x405c8f in this[_0x0a9e('0x13')]){if(_0x37f6cc[_0x0a9e('0x13')][_0x0a9e('0x37')](_0x405c8f)){_0x37f6cc[_0x0a9e('0x3f')](_0x405c8f);}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x3e')]=function(_0x25c6e6){var _0x2c2cb0=this;rpcDb[_0x0a9e('0x55')](_0x25c6e6['id'],ut['agentReadyId'](this[_0x0a9e('0x14')]))[_0x0a9e('0x56')](function(_0xdd268f){if(!_[_0x0a9e('0x41')](_0xdd268f)){for(var _0x2e8caf=0x0;_0x2e8caf<_0xdd268f[_0x0a9e('0x57')];_0x2e8caf+=0x1){if(ut[_0x0a9e('0x58')](_0xdd268f[_0x2e8caf][_0x0a9e('0x59')])<_0x25c6e6['dialRecallMeTimeout']*0x3c){if(_0xdd268f[_0x2e8caf][_0x0a9e('0x5a')]&&!_0xdd268f[_0x2e8caf]['Agent'][_0x0a9e('0x5b')]){_0x2c2cb0[_0x0a9e('0x5c')](_0xdd268f[_0x2e8caf]['id'])[_0x0a9e('0x56')](ut['logger2'](_0x0a9e('0x5d')))[_0x0a9e('0x5e')](ut[_0x0a9e('0x5f')](_0x0a9e('0x5d')));}else{rpcDb[_0x0a9e('0x60')](_0xdd268f[_0x2e8caf]['id']);}}else{var _0x37be73=new Action(_0xdd268f[_0x2e8caf],_0x25c6e6);_0x37be73[_0x0a9e('0x61')]=moment()['format'](_0x0a9e('0x62'));_0x25c6e6[_0x0a9e('0x63')]+=0x1;ut[_0x0a9e('0x64')](_0x37be73,0x17,_0x0a9e('0x65'));if(_0x25c6e6[_0x0a9e('0x66')]){rpcDb[_0x0a9e('0x67')](ut[_0x0a9e('0x68')](_0xdd268f[_0x2e8caf]));rpcDb[_0x0a9e('0x69')](_0x37be73,_0x0a9e('0x6a'));}else{ut['logCustomer'](_0x37be73,0x16,_0x0a9e('0x6b'));rpcDb[_0x0a9e('0x69')](_0x37be73,'[HistoryRecallClose]');rpcDb['createCustomerFinal'](_0x37be73,'[HistoryRecallClose]');}}}}})[_0x0a9e('0x5e')](ut[_0x0a9e('0x5f')](_0x0a9e('0x6c')));};Preview[_0x0a9e('0xd')][_0x0a9e('0x3d')]=function(_0x30decb){_0x30decb[_0x0a9e('0x2c')]=!![];if(ut[_0x0a9e('0x6d')](_0x30decb['loggedIn'])){_0x30decb['message']=utils['CAMPAIGN_STATUS'][_0x0a9e('0x6e')];}else if(!ut[_0x0a9e('0x6f')](_0x30decb[_0x0a9e('0x3c')])){_0x30decb['message']=utils[_0x0a9e('0x30')][_0x0a9e('0x31')];}else if(!this['isTrunkReachable'](_0x30decb['Trunk'])){if(!this[_0x0a9e('0x70')](_0x30decb['TrunkBackup'])){_0x30decb[_0x0a9e('0x4b')]=utils['CAMPAIGN_STATUS'][_0x0a9e('0x71')];}else{_0x30decb[_0x0a9e('0x4b')]=utils[_0x0a9e('0x30')]['ACTIVE'];}}else{_0x30decb[_0x0a9e('0x4b')]=utils[_0x0a9e('0x30')]['ACTIVE'];}};Preview['prototype'][_0x0a9e('0x72')]=function(_0x3aedd0,_0x49c095,_0x145931){var _0x5ce9ac=this;var _0x211ef9=this['actions'][_0x49c095];var _0xe22ccc=this['campaignsPreview'][_0x211ef9['queue']];var _0x5df0ad;var _0x2da03c=![];var _0x47de4c=0x2;var _0x2f7092=0x3;if(_0xe22ccc){switch(_0x145931){case'1':_0xe22ccc[_0x0a9e('0x73')]+=0x1;_0x211ef9[_0x0a9e('0x74')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x0,_0x0a9e('0x77'));ami[_0x0a9e('0x25')]('custom:agentnosuchnumber',ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0x79')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0x7a'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'0',_0xe22ccc)[_0x0a9e('0x56')](function(_0x5d86e9){_0x2da03c=_0x5d86e9[_0x0a9e('0x7c')]==0x1;_0x47de4c=_0xe22ccc[_0x0a9e('0x7d')];_0x2f7092=_0xe22ccc['callAdditionalPhoneAfterMin'];if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc['dialGlobalMaxRetry']){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,'Global');rpcDb['createCustomerFinal'](_0x5df0ad,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x211ef9[_0x0a9e('0x74')]>=_0xe22ccc['dialNoSuchNumberMaxRetry']){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0x80'));}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,_0x0a9e('0x74'),_0xe22ccc[_0x0a9e('0x7d')]),_0x211ef9['unlockAgent'],_0x211ef9[_0x0a9e('0x83')]);}}delete this['actions'][_0x3aedd0[_0x0a9e('0x84')]];}else{_0x211ef9[_0x0a9e('0x74')]++;logger[_0x0a9e('0x26')]('actioncountonusuch',_0x211ef9[_0x0a9e('0x74')]);logger[_0x0a9e('0x26')]('id',_0x211ef9[_0x0a9e('0x85')]);_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9['idContact'],'field':{'countnosuchnumberretry':_0x211ef9[_0x0a9e('0x74')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0x87'):var _0x88dcbf=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));_0x211ef9['responsetime']=_0x88dcbf;_0x211ef9[_0x0a9e('0x88')]=_0x88dcbf;_0x211ef9[_0x0a9e('0x4d')]=!![];_0xe22ccc[_0x0a9e('0x2e')]+=0x1;logger['info'](_0x0a9e('0x89'),_0x211ef9['uniqueid'],'\x20Queue',_0xe22ccc[_0x0a9e('0x29')],_0x0a9e('0x8a'),_0xe22ccc[_0x0a9e('0x2e')]);ami[_0x0a9e('0x25')](_0x0a9e('0x8b'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0x8c'),this[_0x0a9e('0x10')][_0x211ef9[_0x0a9e('0x43')]]));if(_0xe22ccc[_0x0a9e('0x8d')]||_0xe22ccc[_0x0a9e('0x8e')]){ami[_0x0a9e('0x25')](_0x0a9e('0x8f'),{'queue':_0x211ef9[_0x0a9e('0x43')],'interface':_0x211ef9[_0x0a9e('0x90')],'uniqueid':_0x211ef9[_0x0a9e('0x91')]});}break;case'16':ami[_0x0a9e('0x25')](_0x0a9e('0x92'),ut['buildObj'](_0x211ef9,_0x0a9e('0x93'),this[_0x0a9e('0x10')][_0x211ef9[_0x0a9e('0x43')]]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x211ef9,_0x0a9e('0x93')));_0xe22ccc[_0x0a9e('0x94')]+=0x1;_0xe22ccc['total']+=0x1;_0xe22ccc[_0x0a9e('0x95')]+=0x1;ut[_0x0a9e('0x4e')](_0xe22ccc,_0x0a9e('0x96'));_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x4,'Answer');rpcDb['createCustomerHistory'](_0x211ef9,_0x0a9e('0x97'));rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0x98'));rpcDb[_0x0a9e('0x99')](_0x211ef9);_0xe22ccc[_0x0a9e('0x9a')]+=_0x211ef9[_0x0a9e('0x9b')];_0xe22ccc[_0x0a9e('0x9c')]+=_0x211ef9[_0x0a9e('0x9b')];logger['info'](_0x0a9e('0x9d'),_0x211ef9[_0x0a9e('0x91')],_0x0a9e('0x9e'),_0xe22ccc['name'],_0x0a9e('0x8a'),_0xe22ccc['pTalking']);delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;case'BUSY':_0xe22ccc[_0x0a9e('0x9f')]+=0x1;_0x211ef9[_0x0a9e('0xa0')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x5,_0x0a9e('0xa1'));_0x47de4c=_0xe22ccc[_0x0a9e('0xa2')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami[_0x0a9e('0x25')]('custom:agentbusy',ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xa4')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xa5'));_0x5ce9ac['verifyAdditionalPhones'](_0x211ef9,'5',_0xe22ccc)[_0x0a9e('0x56')](function(_0x3511c9){_0x2da03c=_0x3511c9[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xa8'));}else{if(_0x211ef9[_0x0a9e('0xa0')]>=_0xe22ccc[_0x0a9e('0xa9')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xa5'));}else{rpcDb[_0x0a9e('0x81')](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xa0'),_0xe22ccc[_0x0a9e('0xa2')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xa0')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countbusyretry':_0x211ef9[_0x0a9e('0xa0')]}})['then'](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0xab'):_0xe22ccc['outboundNoAnswerCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xac')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x3,'NoAnswer');_0x47de4c=_0xe22ccc[_0x0a9e('0xad')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];var _0x2d2286=ut[_0x0a9e('0xae')](_0x211ef9,_0xe22ccc);ami[_0x0a9e('0x25')](_0x0a9e('0xaf'),_0x2d2286);rpcDb[_0x0a9e('0x69')](_0x211ef9,'[callProgressDetectingCustomer][logNoAnswer]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'3',_0xe22ccc)[_0x0a9e('0x56')](function(_0x45c109){_0x2da03c=_0x45c109[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,'Global');rpcDb[_0x0a9e('0x7f')](_0x5df0ad,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x211ef9[_0x0a9e('0xac')]>=_0xe22ccc[_0x0a9e('0xb0')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xb1'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xac'),_0xe22ccc[_0x0a9e('0xad')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9['idContact'],'field':{'countnoanswerretry':_0x211ef9['countnoanswerretry']}})[_0x0a9e('0x56')](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});break;case'CONGESTION':_0xe22ccc[_0x0a9e('0xb2')]+=0x1;_0x211ef9[_0x0a9e('0xb3')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x8,_0x0a9e('0xb4'));_0x47de4c=_0xe22ccc['dialCongestionRetryFrequency'];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami['emit'](_0x0a9e('0xb5'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xb6')));rpcDb[_0x0a9e('0x69')](_0x211ef9,'[callProgressDetectingCustomer][logCongestion]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'8',_0xe22ccc)[_0x0a9e('0x56')](function(_0x1d4877){_0x2da03c=_0x1d4877['additional']==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xb7'));}else{if(_0x211ef9[_0x0a9e('0xb3')]>=_0xe22ccc[_0x0a9e('0xb8')]){rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xb9'));}else{rpcDb[_0x0a9e('0x81')](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xb3'),_0xe22ccc[_0x0a9e('0xa2')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xb3')]++;_0x5ce9ac['incrementPreviewCounters']({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countcongestionretry':_0x211ef9[_0x0a9e('0xb3')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0xbb'):_0xe22ccc[_0x0a9e('0xbc')]+=0x1;_0x211ef9[_0x0a9e('0xbd')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x14,_0x0a9e('0xbe'));_0x47de4c=_0xe22ccc[_0x0a9e('0xbf')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami[_0x0a9e('0x25')](_0x0a9e('0xc0'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xc1')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xc2'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'20',_0xe22ccc)[_0x0a9e('0x56')](function(_0x4989f9){_0x2da03c=_0x4989f9[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0x14,_0x0a9e('0xbe'));rpcDb['createCustomerFinal'](_0x5df0ad,_0x0a9e('0xc3'));}else{if(_0x211ef9[_0x0a9e('0xbd')]>=_0xe22ccc['dialAgentRejectMaxRetry']){rpcDb[_0x0a9e('0x7f')](_0x211ef9,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,_0x0a9e('0xbd'),_0xe22ccc[_0x0a9e('0xbf')]),_0x211ef9['unlockAgent'],_0x211ef9[_0x0a9e('0x83')]);}}}else{_0x211ef9['countnoanswerretry']++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9['countnoanswerretry']}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case'ABANDONED':_0xe22ccc['outboundAbandonedCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xc4')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0xb,_0x0a9e('0xc5'));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xc6'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'11',_0xe22ccc)[_0x0a9e('0x56')](function(_0x586510){_0x2da03c=_0x586510[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xc6'));}else{if(_0x211ef9['countabandonedetry']>=_0xe22ccc[_0x0a9e('0xc7')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xc6'));}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,'countabandonedretry',_0xe22ccc['dialAbandonedRetryFrequency']),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});break;case'18':_0xe22ccc['outboundUnknownCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xc8')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x12,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0['dialstatus']);ami['emit'](_0x0a9e('0xca'),ut[_0x0a9e('0x78')](_0x211ef9,'amd'));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xcb'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'18',_0xe22ccc)[_0x0a9e('0x56')](function(_0x2eb028){_0x2da03c=_0x2eb028['additional']==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0x12,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xcb'));}else{rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xcb'));}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac['incrementPreviewCounters']({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;case'19':_0xe22ccc[_0x0a9e('0xcc')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x13,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0[_0x0a9e('0xcd')]);ami[_0x0a9e('0x25')](_0x0a9e('0xca'),ut[_0x0a9e('0x78')](_0x211ef9,'amd'));rpcDb['createCustomerHistory'](_0x211ef9,_0x0a9e('0xce'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'18',_0xe22ccc)[_0x0a9e('0x56')](function(_0x2fea95){_0x2da03c=_0x2fea95[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb['createCustomerFinal'](_0x5df0ad,_0x0a9e('0xce'));}else{rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xce'));}}else{_0x211ef9['countnoanswerretry']++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})['then'](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;default:if(_0x211ef9[_0x0a9e('0x4d')]){ut[_0x0a9e('0x4e')](_0xe22ccc,_0x0a9e('0xcf'));ut[_0x0a9e('0x50')](_0x0a9e('0xd0')+_0xe22ccc[_0x0a9e('0x29')],_0x3aedd0);}_0xe22ccc[_0x0a9e('0xcc')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0xc,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0[_0x0a9e('0xcd')]);_0x47de4c=_0xe22ccc[_0x0a9e('0xbf')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];rpcDb['createCustomerHistory'](_0x211ef9,'[callProgressDetectingCustomer][logUnknown]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'20',_0xe22ccc)['then'](function(_0x1d999b){_0x2da03c=_0x1d999b[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xd1'));}delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];}else{_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});}});}if(!(_0x211ef9[_0x0a9e('0x4d')]&&_0x145931==='16')){ut[_0x0a9e('0xd2')](_0xe22ccc,'[callProgressDetectingCustomer]');logger[_0x0a9e('0x26')](_0x0a9e('0xd3'),_0x211ef9[_0x0a9e('0x91')],'\x20Queue',_0xe22ccc[_0x0a9e('0x29')],_0x0a9e('0x44'),_0xe22ccc[_0x0a9e('0x2d')]);}if(_0x145931!==_0x0a9e('0x87')){delete this[_0x0a9e('0x13')][_0x3aedd0['linkedid']];delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0xd4')]];}_0xe22ccc['queueSummaryCountersUpdated']=!![];}};Preview[_0x0a9e('0xd')][_0x0a9e('0xd5')]=function(_0x1f6f1c,_0x5822a7,_0x5c3b6f){if(_['isUndefined'](_0x5822a7)&&_0x0a9e('0xd6')!==typeof _0x5822a7){return;}if(_[_0x0a9e('0xd7')](_0x5c3b6f)&&'object'!==typeof _0x5c3b6f){return;}switch(_0x5c3b6f[_0x0a9e('0xd8')]){case'0':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x0,_0x0a9e('0x77'));rpcDb['createAgentHistory'](_0x1f6f1c,_0x0a9e('0xda'));break;case'3':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x3,_0x0a9e('0xdb'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xdd'));break;case'5':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x5,_0x0a9e('0xa1'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xde'));break;case'8':ut['logAgent'](_0x1f6f1c,0x8,_0x0a9e('0xb4'));rpcDb['createAgentHistory'](_0x1f6f1c,_0x0a9e('0xdf'));break;case'22':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x16,_0x0a9e('0xe0'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xe1'));break;default:ut[_0x0a9e('0xd9')](_0x1f6f1c,0xc,_0x5c3b6f['reason']);rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xdf'));}ut[_0x0a9e('0xd2')](_0x5822a7,_0x0a9e('0xe2'));logger['info'](_0x0a9e('0xe3'),_0x1f6f1c[_0x0a9e('0x91')],_0x0a9e('0x9e'),_0x5822a7[_0x0a9e('0x29')],_0x0a9e('0x44'),_0x5822a7[_0x0a9e('0x2d')]);delete this[_0x0a9e('0x13')][_0x1f6f1c[_0x0a9e('0x91')]];};Preview[_0x0a9e('0xd')][_0x0a9e('0x7b')]=function(_0x57f0ad,_0x2272bc,_0x88b25f){return cmHopperAdditionalPhone[_0x0a9e('0x7b')](_0x57f0ad,_0x2272bc,_0x88b25f)[_0x0a9e('0x5e')](logger[_0x0a9e('0x26')](_0x0a9e('0xe4')));};Preview[_0x0a9e('0xd')][_0x0a9e('0xba')]=function(_0x566b90,_0x3b581c,_0xd2391){return cmHopperAdditionalPhone[_0x0a9e('0xba')](_0x566b90,_0x3b581c,_0xd2391)['catch'](logger[_0x0a9e('0x26')](_0x0a9e('0xe5')));};Preview[_0x0a9e('0xd')][_0x0a9e('0x86')]=function(_0x370b5e){return Promise[_0x0a9e('0xe6')]()[_0x0a9e('0x56')](cmHopperAdditionalPhone[_0x0a9e('0x86')](_0x370b5e))[_0x0a9e('0x5e')](logger[_0x0a9e('0x26')]('[incrementPreviewCounters]\x20'));};Preview[_0x0a9e('0xd')][_0x0a9e('0xe7')]=function(_0x15a9ed,_0x3db98f,_0x2b624e,_0x3942fd,_0x5cb48d){var _0x382687=this;return new Promise(function(_0x4f854b,_0x5bd139){if(_['isNil'](_0x3db98f)||_[_0x0a9e('0x41')](_0x3db98f[_0x0a9e('0xe8')])||_[_0x0a9e('0x41')](_0x3db98f[_0x0a9e('0xe9')])||_['isNil'](_0x3db98f[_0x0a9e('0x48')])){_0x5bd139(ut[_0x0a9e('0x4b')](_0x0a9e('0xea'),_0x3942fd,_0x5cb48d));return;}var _0x1fdb10=uuid['v4']();var _0x2c8d1d=_0x382687['campaignsPreview'][_0x3db98f['Queue'][_0x0a9e('0x29')]];var _0x33bcb2=_0x2b624e?_0x382687[_0x0a9e('0x14')][_0x2b624e]['id']:undefined;_0x382687['actions'][_0x1fdb10]=new Action(_0x3db98f,_0x2c8d1d,_0x1fdb10,_0x2b624e,_0x33bcb2);var _0x319752=_0x382687[_0x0a9e('0x13')][_0x1fdb10];_0x319752[_0x0a9e('0xaa')]=_0x3942fd;_0x319752['activeContact']=_0x5cb48d;_0x319752[_0x0a9e('0xeb')]=_0x2b624e;if(_[_0x0a9e('0xec')](_0x15a9ed)){_0x382687[_0x0a9e('0xed')](_0x319752,_0x2c8d1d,_0x3db98f,_0x2b624e)['then'](function(_0x272291){logger[_0x0a9e('0x26')](_0x0a9e('0xee'),'Queue:\x20'+_0x319752['queue']+'\x20IdHopper:\x20'+_0x319752[_0x0a9e('0x85')],JSON[_0x0a9e('0x45')](_0x272291));ami[_0x0a9e('0x25')](_0x0a9e('0xef'),ut['buildObj'](_0x319752,_0x0a9e('0xf0'),_0x382687['campaignsPreview'][_0x319752[_0x0a9e('0x43')]]));_0x4f854b(ut[_0x0a9e('0x4b')](_0x0a9e('0xf1')));})['catch'](function(_0x33b4b3){ut[_0x0a9e('0x32')](_0x0a9e('0xf2'),_0x33b4b3);_0x5bd139(ut['message'](_0x0a9e('0xf3'),_0x3942fd,_0x5cb48d));});}else{_0x2c8d1d['outboundBlacklistCallsDay']+=0x1;ut[_0x0a9e('0xf4')](_0x319752);rpcDb['createHistory'](_0x319752,_0x0a9e('0xf5'));delete _0x382687['actions'][_0x1fdb10];_0x5bd139(ut[_0x0a9e('0x4b')](_0x0a9e('0xf6'),_0x3942fd,_0x5cb48d));}});};Preview[_0x0a9e('0xd')][_0x0a9e('0x70')]=function(_0x1e306c){return!_[_0x0a9e('0x41')](_0x1e306c)&&!_[_0x0a9e('0x41')](_0x1e306c['name'])&&!_[_0x0a9e('0x41')](_0x1e306c[_0x0a9e('0xf7')])&&_0x1e306c['active']&&!_[_0x0a9e('0x41')](this[_0x0a9e('0x12')][util['format'](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])])&&!_[_0x0a9e('0x41')](this['trunks'][util[_0x0a9e('0x27')](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')])&&(this[_0x0a9e('0x12')][util[_0x0a9e('0x27')](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')]===_0x0a9e('0xfa')||this['trunks'][util[_0x0a9e('0x27')]('SIP/%s',_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')]===_0x0a9e('0xfb'));};Preview[_0x0a9e('0xd')][_0x0a9e('0x5c')]=function(_0x2d45db,_0x5691ac){return this[_0x0a9e('0xfc')](_0x2d45db,_0x5691ac)[_0x0a9e('0x56')](function(_0x2977a7){return _['pick'](_0x2977a7,[_0x0a9e('0x4b')]);})[_0x0a9e('0x5e')](function(_0x4435d2){if(_0x4435d2[_0x0a9e('0xfd')]){rpcDb[_0x0a9e('0xfe')](_0x2d45db);}if(_0x4435d2[_0x0a9e('0xf7')]){rpcDb[_0x0a9e('0x60')](_0x2d45db);}throw _['pick'](_0x4435d2,[_0x0a9e('0x4b')]);});};Preview[_0x0a9e('0xd')][_0x0a9e('0xfc')]=function(_0x2ce3be,_0x3de77e){var _0x241404=this;var _0x8120e,_0x5d6a48;return rpcDb['getContactPreview'](_0x2ce3be)[_0x0a9e('0x56')](function(_0x3f507c){if(!_[_0x0a9e('0x41')](_0x3f507c[0x0])){_0x5d6a48=_0x3f507c[0x0][_0x0a9e('0xff')]?![]:!![];_0x8120e=_0x3f507c[0x0][_0x0a9e('0xff')]?!![]:![];_0x8120e=_0x3de77e?!![]:_0x8120e;}var _0x131da8=_0x241404[_0x0a9e('0x100')](_0x3f507c);if(_0x131da8['isValid']){rpcDb[_0x0a9e('0x101')](_[_0x0a9e('0x46')](_0x3f507c[0x0],[_0x0a9e('0x48'),_0x0a9e('0xe9')]))[_0x0a9e('0x56')](function(_0x3c6082){_0x241404[_0x0a9e('0xe7')](_0x3c6082,_0x3f507c[0x0],_0x3de77e,_0x5d6a48,_0x8120e)['then'](function(_0x311288){return _0x311288;})[_0x0a9e('0x5e')](function(_0x231826){throw _0x231826;});})['catch'](function(_0x2b8ad4){ut[_0x0a9e('0x32')](_0x0a9e('0x102'),_0x2b8ad4);throw ut[_0x0a9e('0x4b')]('Call\x20unsuccessful',_0x5d6a48,_0x8120e);});}else{throw ut[_0x0a9e('0x4b')](_0x131da8[_0x0a9e('0x4b')],_0x5d6a48,_0x8120e);}})[_0x0a9e('0x5e')](function(_0x93d953){ut[_0x0a9e('0x32')](_0x0a9e('0x103'),_0x93d953);throw ut[_0x0a9e('0x4b')](_0x0a9e('0x104'),![],!![]);});};Preview['prototype'][_0x0a9e('0x100')]=function(_0x266aa1){if(_[_0x0a9e('0x41')](_0x266aa1)||_[_0x0a9e('0xec')](_0x266aa1)||!_['isNil'](_0x266aa1[0x0]['Agent'])&&_[_0x0a9e('0x41')](_0x266aa1[0x0][_0x0a9e('0x5a')][_0x0a9e('0x29')])){ut['logger'](_0x0a9e('0x105'),_0x266aa1);return{'isValid':![],'message':_0x0a9e('0x106')};}var _0x4d8a67=this[_0x0a9e('0x10')][_0x266aa1[0x0]['Queue'][_0x0a9e('0x29')]];_0x4d8a67['message']=utils['CAMPAIGN_STATUS']['ACTIVE'];if(_[_0x0a9e('0x41')](_0x4d8a67)){ut[_0x0a9e('0x32')](_0x0a9e('0x107'),_0x4d8a67);return{'isValid':![],'message':_0x0a9e('0x108')};}if(!this[_0x0a9e('0x70')](_0x4d8a67[_0x0a9e('0x109')])){ut['logger'](_0x0a9e('0x10a'),_0x0a9e('0x10b')+_0x4d8a67[_0x0a9e('0x29')]+_0x0a9e('0x10c'));if(!this[_0x0a9e('0x70')](_0x4d8a67[_0x0a9e('0x10d')])){ut[_0x0a9e('0x32')]('[Preview][validateContact][Trunk\x20not\x20working\x20correctly]',_0x4d8a67['name']+_0x0a9e('0x10e'));return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}}if(!ut[_0x0a9e('0x6f')](_0x4d8a67[_0x0a9e('0x3c')])){ut[_0x0a9e('0x32')](_0x0a9e('0x10f'),_0x4d8a67[_0x0a9e('0x29')]+_0x0a9e('0x110'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x4d8a67[_0x0a9e('0x29')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview[_0x0a9e('0xd')]['execCall']=function(_0x38dceb,_0x5dc978,_0x550cbf,_0x26223f){var _0x4a7a3c=this;return new Promise(function(_0x24470a,_0x142e53){var _0xe1ab0d=_0x38dceb['uniqueid'];var _0x4152cd=_0x4a7a3c[_0x0a9e('0x70')](_0x5dc978[_0x0a9e('0x109')])?util['format']('SIP/%s/%s%s',_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x29')],_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x111')])?'':_0x5dc978[_0x0a9e('0x111')][_0x0a9e('0x112')]()||'',_0x5dc978[_0x0a9e('0x113')]>0x0?_0x550cbf[_0x0a9e('0xe9')][_0x0a9e('0x114')](_0x5dc978[_0x0a9e('0x113')]):_0x550cbf['phone']):util['format']('SIP/%s/%s%s',_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x10d')])?_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x29')]:_0x5dc978[_0x0a9e('0x10d')][_0x0a9e('0x29')],_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x111')])?'':_0x5dc978['dialPrefix']['trim']()||'',_0x5dc978[_0x0a9e('0x113')]>0x0?_0x550cbf[_0x0a9e('0xe9')]['substring'](_0x5dc978[_0x0a9e('0x113')]):_0x550cbf[_0x0a9e('0xe9')]);var _0x2e2280=_0x4a7a3c[_0x0a9e('0x70')](_0x5dc978[_0x0a9e('0x109')])?ut[_0x0a9e('0x115')](_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x116')],_0x5dc978[_0x0a9e('0x117')],_0x5dc978[_0x0a9e('0x118')]>0x0?ut[_0x0a9e('0x119')](_0x5dc978[_0x0a9e('0x11a')],_0x5dc978['dialRandomLastDigitCallerIdNumber']):_0x5dc978[_0x0a9e('0x11a')]):ut[_0x0a9e('0x115')](_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x10d')])?_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x116')]:_0x5dc978[_0x0a9e('0x10d')][_0x0a9e('0x116')],_0x5dc978[_0x0a9e('0x117')],_0x5dc978[_0x0a9e('0x118')]>0x0?ut[_0x0a9e('0x119')](_0x5dc978[_0x0a9e('0x11a')],_0x5dc978['dialRandomLastDigitCallerIdNumber']):_0x5dc978['dialOriginateCallerIdNumber']);if(_0x2e2280){_0x38dceb[_0x0a9e('0x11b')]=ut[_0x0a9e('0x11c')](_0x2e2280);_0x38dceb[_0x0a9e('0x11d')]=ut[_0x0a9e('0x11e')](_0x2e2280);}var _0x33359a=ut[_0x0a9e('0x11f')](_0x5dc978,_0x550cbf,_0x4152cd,_0x2e2280,_0xe1ab0d,_0x38dceb);var _0xa8b5de=utils['setXMDContactVariables'](_0x550cbf[_0x0a9e('0xe8')]);Object['assign'](_0x33359a,_0xa8b5de);_[_0x0a9e('0x120')](_0x38dceb,ut[_0x0a9e('0x121')](_0x33359a));_0x38dceb[_0x0a9e('0x61')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));_0x5dc978[_0x0a9e('0x122')]=_0x33359a;var _0x465003=ut[_0x0a9e('0x123')](_0x38dceb,_0x5dc978,_0x33359a,_0x38dceb[_0x0a9e('0x83')],_0x26223f);return ami[_0x0a9e('0x124')](_0x465003)[_0x0a9e('0x56')](function(_0x8231e5){_0x5dc978[_0x0a9e('0x2d')]+=0x1;logger[_0x0a9e('0x26')](_0x0a9e('0x125'),_0xe1ab0d,_0x0a9e('0x9e'),_0x5dc978['name'],'originated:\x20',_0x5dc978[_0x0a9e('0x2d')]);_0x24470a(_0x8231e5);})[_0x0a9e('0x5e')](function(_0x52b365){ut['logAgent'](_0x38dceb,0xe,_0x0a9e('0x126'));rpcDb[_0x0a9e('0xdc')](_0x38dceb,_0x0a9e('0x127'));_0x142e53(_0x52b365);});});};Preview['prototype'][_0x0a9e('0x1d')]=function(_0x5b6447){if(this[_0x0a9e('0x13')][_0x5b6447['linkedid']]){this[_0x0a9e('0x13')][_0x5b6447['linkedid']][_0x0a9e('0x4a')]=_0x5b6447[_0x0a9e('0x4a')];}};Preview[_0x0a9e('0xd')]['syncOriginateResponse']=function(_0x316b51){var _0x497fda=this;var _0x505ffd=this[_0x0a9e('0x13')][_0x316b51[_0x0a9e('0x128')]];if(_0x505ffd){if(_0x505ffd[_0x0a9e('0xeb')]&&this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]]){ut[_0x0a9e('0x129')](_0x505ffd,this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]][_0x0a9e('0x29')],this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]]['id']);}var _0x98bf26=_[_0x0a9e('0x12a')](_0x505ffd);_0x98bf26[_0x0a9e('0x12b')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));var _0x310026=_0x497fda[_0x0a9e('0x10')][_0x505ffd[_0x0a9e('0x43')]];if(ut['isFailure'](_0x316b51[_0x0a9e('0x12c')])){if(_0x505ffd[_0x0a9e('0xaa')]){rpcDb[_0x0a9e('0xfe')](_0x505ffd[_0x0a9e('0x85')]);}if(_0x505ffd['activeContact']){rpcDb['disableContact'](_0x505ffd['idContact']);}ami[_0x0a9e('0x25')]('custom:agentringnoanswer',ut[_0x0a9e('0x78')](_0x505ffd,_0x0a9e('0x12d'),this[_0x0a9e('0x10')][_0x505ffd[_0x0a9e('0x43')]]));this[_0x0a9e('0xd5')](_0x98bf26,_0x310026,_0x316b51);}else{_0x505ffd[_0x0a9e('0x61')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));ut[_0x0a9e('0xd9')](_0x98bf26,0x4,_0x0a9e('0x12e'));rpcDb['createAgentHistory'](_0x98bf26,_0x0a9e('0x12f'));}}};Preview['prototype'][_0x0a9e('0x1a')]=function(_0x586d2f){var _0xf4de86=this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]];var _0x556bb7;if(_0xf4de86){_0x556bb7=this[_0x0a9e('0x10')][_0xf4de86[_0x0a9e('0x43')]];logger['info']('[syncHangup][talking]',_0x586d2f[_0x0a9e('0x84')],_0x0a9e('0x9e'),_0x556bb7[_0x0a9e('0x29')],'pTalking:\x20',_0x556bb7['pTalking']);}if(this['actions'][_0x586d2f[_0x0a9e('0x84')]]&&_0x586d2f[_0x0a9e('0x84')]!==_0x586d2f[_0x0a9e('0x91')]){if(_0x586d2f[_0x0a9e('0x130')]==='16'&&this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]][_0x0a9e('0x4d')]){this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}else if(this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]][_0x0a9e('0x4d')]){logger[_0x0a9e('0x26')](_0x0a9e('0x131'),_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7['name'],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}}else if(_0xf4de86&&_[_0x0a9e('0x41')](_0xf4de86['statedesc'])&&_0x556bb7[_0x0a9e('0x132')]&&_0x586d2f[_0x0a9e('0x84')]===_0x586d2f[_0x0a9e('0x91')]&&_[_0x0a9e('0x41')](_0x586d2f[_0x0a9e('0xd8')])&&_0x586d2f[_0x0a9e('0x130')]==='16'&&_0x586d2f[_0x0a9e('0x133')]==='6'&&_[_0x0a9e('0xd7')](_0xf4de86[_0x0a9e('0x134')])){if(_0xf4de86['unlockAgent']){rpcDb['unlockContact'](_0xf4de86[_0x0a9e('0x85')]);}if(_0xf4de86[_0x0a9e('0x83')]){rpcDb['disableContact'](_0xf4de86[_0x0a9e('0x85')]);}_0x586d2f[_0x0a9e('0xd8')]='22';this['callProgressDetectingAgent'](_0xf4de86,_0x556bb7,_0x586d2f);}else if(_0xf4de86&&_0xf4de86[_0x0a9e('0x134')]){if(_0x586d2f['cause']==='16'&&this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]]['dialAnswer']){logger[_0x0a9e('0x26')](_0x0a9e('0x135'),_0x586d2f['linkedid'],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7['name'],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}else if(this[_0x0a9e('0x13')][_0x586d2f['linkedid']][_0x0a9e('0x4d')]){logger[_0x0a9e('0x26')]('[syncHangup][talking][cause]',_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7[_0x0a9e('0x29')],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f['linkedid'],_0x586d2f['cause']);}}};Preview['prototype']['syncDialEnd']=function(_0x5e9817){if(this[_0x0a9e('0x13')][_0x5e9817[_0x0a9e('0xd4')]]&&_0x5e9817['destlinkedid']!==_0x5e9817['destuniqueid']){this[_0x0a9e('0x72')](_0x5e9817,_0x5e9817['destlinkedid'],_0x5e9817[_0x0a9e('0xcd')]);}};Preview[_0x0a9e('0xd')][_0x0a9e('0x136')]=function(_0x175c97){if(this[_0x0a9e('0x13')][_0x175c97[_0x0a9e('0x84')]]&&_0x175c97['linkedid']!==_0x175c97[_0x0a9e('0x91')]&&!this[_0x0a9e('0x13')][_0x175c97['linkedid']][_0x0a9e('0x4d')]){if(_0x175c97[_0x0a9e('0x130')]==='1'){this[_0x0a9e('0x72')](_0x175c97,_0x175c97[_0x0a9e('0x84')],_0x175c97[_0x0a9e('0x130')]);}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x137')]=function(_0x4a36df,_0x331216,_0x508395){if(this[_0x0a9e('0x13')][_0x4a36df]){if(_[_0x0a9e('0x41')](this['actions'][_0x4a36df][_0x0a9e('0x122')])){this[_0x0a9e('0x13')][_0x4a36df]['variables']={};}this[_0x0a9e('0x13')][_0x4a36df]['variables'][_0x331216]=_0x508395;}};Preview[_0x0a9e('0xd')][_0x0a9e('0x1f')]=function(_0x5d0620){try{if(!_[_0x0a9e('0x41')](_0x5d0620)){if(ut['filterKey'](_[_0x0a9e('0x138')](_0x5d0620[_0x0a9e('0x139')])[0x0])){this[_0x0a9e('0x137')](_0x5d0620[_0x0a9e('0x91')],_[_0x0a9e('0x138')](_0x5d0620[_0x0a9e('0x139')])[0x0],_0x5d0620[_0x0a9e('0x13a')]);}}}catch(_0x53b5c2){logger[_0x0a9e('0x13b')](_0x0a9e('0x13c'),util[_0x0a9e('0x13d')](_0x53b5c2,{'showHidden':![],'depth':null}));}};Preview[_0x0a9e('0xd')][_0x0a9e('0x21')]=function(_0x5932ad){if(_0x5932ad){if(this[_0x0a9e('0x13')][_0x5932ad['transfertargetlinkedid']]){this['actions'][_0x5932ad[_0x0a9e('0x13e')]]['transfer']=!![];}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x23')]=function(_0x58d5fd){if(_0x58d5fd){if(this[_0x0a9e('0x13')][_0x58d5fd[_0x0a9e('0x13f')]]){this[_0x0a9e('0x13')][_0x58d5fd[_0x0a9e('0x13f')]][_0x0a9e('0x134')]=!![];}}};module[_0x0a9e('0x140')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 9e55656..51b3080 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 _0xab4d=['resolve','then','createHistory','[createHistory]\x20','[moveContactManagedDialer]\x20','checkIsBlackList','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','disableContact','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercompleteAt','connectedlinename','membername','context','from-sip','exten','xcally-motion-preview','lastAssignedTo','queuecallerexitreason','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','preview','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/agentReportPreview','catch'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xab4d,0x163));var _0xdab4=function(_0x15dbca,_0x1d7c3c){_0x15dbca=_0x15dbca-0x0;var _0x326533=_0xab4d[_0x15dbca];return _0x326533;};'use strict';var util=require(_0xdab4('0x0'));var BPromise=require(_0xdab4('0x1'));var logger=require(_0xdab4('0x2'))(_0xdab4('0x3'));var cmHopper=require(_0xdab4('0x4'));var cmHopperHistory=require(_0xdab4('0x5'));var cmHopperBlack=require(_0xdab4('0x6'));var agentReportPreview=require(_0xdab4('0x7'));var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0x33bc4f){return function(_0xedd9cd){logger['error'](_0x33bc4f,util['inspect'](_0xedd9cd,{'showHidden':![],'depth':null}));};}function create(_0x88e10d){return cmHopperHistory['createHistory'](_0x88e10d)[_0xdab4('0x8')](loggerCatch('[createHistory]\x20'));}function createAgent(_0x2ae977){return BPromise[_0xdab4('0x9')]()[_0xdab4('0xa')](agentReportPreview[_0xdab4('0xb')](_0x2ae977))[_0xdab4('0x8')](loggerCatch(_0xdab4('0xc')));}function moveContact(_0x29d60d){return cmHopper['moveContactManagedDialer'](_0x29d60d,!![])['catch'](loggerCatch(_0xdab4('0xd')));}exports[_0xdab4('0xe')]=function(_0x34d10d){return cmHopperBlack[_0xdab4('0xe')](_0x34d10d)['catch'](loggerCatch('[checkIsBlackList]\x20'));};exports['getContactPreview']=function(_0x509fe7){return BPromise['resolve']()['then'](cmHopper[_0xdab4('0xf')](_0x509fe7))[_0xdab4('0x8')](loggerCatch(_0xdab4('0x10')));};exports[_0xdab4('0xb')]=function(_0x5584a3,_0x5f39b1){create(_0x5584a3)[_0xdab4('0x8')](loggerCatch(_0x5f39b1));moveContact(_0x5584a3)[_0xdab4('0x8')](loggerCatch(_0x5f39b1));};exports[_0xdab4('0x11')]=function(_0x1b9837,_0x16fdfe){createAgent(_0x1b9837)['catch'](loggerCatch(_0x16fdfe));};exports[_0xdab4('0x12')]=function(_0x1f5791,_0x545b66){create(_0x1f5791)[_0xdab4('0x8')](loggerCatch(_0x545b66));};exports[_0xdab4('0x13')]=function(_0x18f12f,_0x1edf80){moveContact(_0x18f12f)['catch'](loggerCatch(_0x1edf80));};exports[_0xdab4('0x14')]=function(_0x3ae2f9,_0x172f89,_0x39486f){if(_0x172f89){_0x3ae2f9[_0xdab4('0x15')]=null;}if(_0x39486f){_0x3ae2f9[_0xdab4('0x16')]=![];}return cmHopper[_0xdab4('0x14')](_0x3ae2f9)[_0xdab4('0x8')](loggerCatch(_0xdab4('0x17')));};exports[_0xdab4('0x18')]=function(_0x4429ec){return cmHopper['countReScheduled'](_0x4429ec)[_0xdab4('0x8')](loggerCatch(_0xdab4('0x19')));};exports['unlockContact']=function(_0x2c8e20){return cmHopper[_0xdab4('0x1a')]({'UserId':null},_0x2c8e20,0x1)[_0xdab4('0x8')](loggerCatch('[unlockContact]\x20'));};exports[_0xdab4('0x1b')]=function(_0x3e6ec3){return cmHopper[_0xdab4('0x1a')]({'active':![]},_0x3e6ec3,0x1)[_0xdab4('0x8')](loggerCatch('[activeContact]\x20'));};exports[_0xdab4('0x1c')]=function(_0x1ba9e2){var _0xd1808e={};_0xd1808e[_0xdab4('0x1d')]=_0x1ba9e2[_0xdab4('0x1d')];_0xd1808e[_0xdab4('0x1e')]=_0x1ba9e2['uniqueid'];_0xd1808e[_0xdab4('0x1f')]=_0x1ba9e2['calleridnum'];_0xd1808e['calleridname']=_0x1ba9e2[_0xdab4('0x20')];_0xd1808e['queue']=_0x1ba9e2[_0xdab4('0x21')];_0xd1808e[_0xdab4('0x22')]=_0x1ba9e2[_0xdab4('0x23')];_0xd1808e[_0xdab4('0x24')]=_0x1ba9e2['answertime'];_0xd1808e['queuecallercomplete']=0x1;_0xd1808e[_0xdab4('0x25')]=_0x1ba9e2['endtime'];_0xd1808e[_0xdab4('0x26')]=_0x1ba9e2[_0xdab4('0x27')];_0xd1808e[_0xdab4('0x28')]=_0xdab4('0x29');_0xd1808e[_0xdab4('0x2a')]=_0xdab4('0x2b');_0xd1808e['holdtime']=0x0;_0xd1808e['assigned']=0x1;_0xd1808e[_0xdab4('0x2c')]=_0x1ba9e2[_0xdab4('0x27')];_0xd1808e[_0xdab4('0x2d')]='COMPLETED';return BPromise[_0xdab4('0x9')]()[_0xdab4('0xa')](voiceQueueReport[_0xdab4('0x2e')](_0xd1808e))[_0xdab4('0x8')](loggerCatch(_0xdab4('0x2f')));};exports[_0xdab4('0x30')]=function(_0x3bd694,_0x33d5ab){return BPromise[_0xdab4('0x9')]()[_0xdab4('0xa')](cmHopper[_0xdab4('0x30')](_0x3bd694,_0x33d5ab))[_0xdab4('0x8')](loggerCatch(_0xdab4('0x31')));};exports[_0xdab4('0x32')]=function(_0x3cbca6){return cmHopper[_0xdab4('0x14')](_0x3cbca6,!![],!![])['catch'](loggerCatch(_0xdab4('0x33')));}; \ No newline at end of file +var _0x536f=['createCustomerHistory','createCustomerFinal','rescheduleContact','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','membername','context','from-sip','exten','xcally-motion-preview','holdtime','lastAssignedTo','queuecallerexitreason','COMPLETED','getContactRecallMe','[GetContactRecallMe]\x20','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','preview','../rpc/cmHopperHistory','../rpc/cmHopperBlack','error','inspect','createHistory','catch','[createHistory]\x20','resolve','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','then','getContactPreview','[getContactPreview]\x20','createAgentHistory'];(function(_0x5d15d2,_0x51cd88){var _0x304bc0=function(_0x5eed0d){while(--_0x5eed0d){_0x5d15d2['push'](_0x5d15d2['shift']());}};_0x304bc0(++_0x51cd88);}(_0x536f,0x160));var _0xf536=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x536f[_0x20a584];return _0x4b41a8;};'use strict';var util=require(_0xf536('0x0'));var BPromise=require(_0xf536('0x1'));var logger=require(_0xf536('0x2'))(_0xf536('0x3'));var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require(_0xf536('0x4'));var cmHopperBlack=require(_0xf536('0x5'));var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0x116d97){return function(_0x409d87){logger[_0xf536('0x6')](_0x116d97,util[_0xf536('0x7')](_0x409d87,{'showHidden':![],'depth':null}));};}function create(_0xfa66cc){return cmHopperHistory[_0xf536('0x8')](_0xfa66cc)[_0xf536('0x9')](loggerCatch(_0xf536('0xa')));}function createAgent(_0x408f38){return BPromise[_0xf536('0xb')]()['then'](agentReportPreview[_0xf536('0x8')](_0x408f38))[_0xf536('0x9')](loggerCatch(_0xf536('0xa')));}function moveContact(_0x37e2ee){return cmHopper['moveContactManagedDialer'](_0x37e2ee,!![])['catch'](loggerCatch(_0xf536('0xc')));}exports[_0xf536('0xd')]=function(_0x2ea866){return cmHopperBlack['checkIsBlackList'](_0x2ea866)[_0xf536('0x9')](loggerCatch(_0xf536('0xe')));};exports['getContactPreview']=function(_0x15210d){return BPromise['resolve']()[_0xf536('0xf')](cmHopper[_0xf536('0x10')](_0x15210d))[_0xf536('0x9')](loggerCatch(_0xf536('0x11')));};exports[_0xf536('0x8')]=function(_0x116994,_0x30d1ee){create(_0x116994)[_0xf536('0x9')](loggerCatch(_0x30d1ee));moveContact(_0x116994)[_0xf536('0x9')](loggerCatch(_0x30d1ee));};exports[_0xf536('0x12')]=function(_0x125535,_0x3417cb){createAgent(_0x125535)['catch'](loggerCatch(_0x3417cb));};exports[_0xf536('0x13')]=function(_0x3852d0,_0x5d63c9){create(_0x3852d0)[_0xf536('0x9')](loggerCatch(_0x5d63c9));};exports[_0xf536('0x14')]=function(_0x174863,_0x104d07){moveContact(_0x174863)[_0xf536('0x9')](loggerCatch(_0x104d07));};exports[_0xf536('0x15')]=function(_0x30edff,_0x52c938,_0x1e1086){if(_0x52c938){_0x30edff['UserId']=null;}if(_0x1e1086){_0x30edff[_0xf536('0x16')]=![];}return cmHopper[_0xf536('0x15')](_0x30edff)[_0xf536('0x9')](loggerCatch(_0xf536('0x17')));};exports[_0xf536('0x18')]=function(_0x7141ae){return cmHopper[_0xf536('0x18')](_0x7141ae)[_0xf536('0x9')](loggerCatch(_0xf536('0x19')));};exports[_0xf536('0x1a')]=function(_0xc70578){return cmHopper[_0xf536('0x1a')]({'UserId':null},_0xc70578,0x1)[_0xf536('0x9')](loggerCatch(_0xf536('0x1b')));};exports['disableContact']=function(_0x119046){return cmHopper[_0xf536('0x1a')]({'active':![]},_0x119046,0x1)[_0xf536('0x9')](loggerCatch(_0xf536('0x1c')));};exports[_0xf536('0x1d')]=function(_0x102c6f){var _0x16e8e8={};_0x16e8e8[_0xf536('0x1e')]=_0x102c6f[_0xf536('0x1e')];_0x16e8e8[_0xf536('0x1f')]=_0x102c6f[_0xf536('0x1f')];_0x16e8e8[_0xf536('0x20')]=_0x102c6f[_0xf536('0x20')];_0x16e8e8['calleridname']=_0x102c6f[_0xf536('0x21')];_0x16e8e8[_0xf536('0x22')]=_0x102c6f[_0xf536('0x22')];_0x16e8e8[_0xf536('0x23')]=_0x102c6f[_0xf536('0x24')];_0x16e8e8['queuecallerleaveAt']=_0x102c6f[_0xf536('0x24')];_0x16e8e8[_0xf536('0x25')]=0x1;_0x16e8e8[_0xf536('0x26')]=_0x102c6f[_0xf536('0x27')];_0x16e8e8[_0xf536('0x28')]=_0x102c6f[_0xf536('0x29')];_0x16e8e8[_0xf536('0x2a')]=_0xf536('0x2b');_0x16e8e8[_0xf536('0x2c')]=_0xf536('0x2d');_0x16e8e8[_0xf536('0x2e')]=0x0;_0x16e8e8['assigned']=0x1;_0x16e8e8[_0xf536('0x2f')]=_0x102c6f[_0xf536('0x29')];_0x16e8e8[_0xf536('0x30')]=_0xf536('0x31');return BPromise['resolve']()[_0xf536('0xf')](voiceQueueReport['create'](_0x16e8e8))[_0xf536('0x9')](loggerCatch('[voiceQueueReport]\x20'));};exports['getContactRecallMe']=function(_0x24be54,_0x36a545){return BPromise[_0xf536('0xb')]()[_0xf536('0xf')](cmHopper[_0xf536('0x32')](_0x24be54,_0x36a545))[_0xf536('0x9')](loggerCatch(_0xf536('0x33')));};exports['rescheduleContactInQueue']=function(_0x322ce0){return cmHopper[_0xf536('0x15')](_0x322ce0,!![],!![])['catch'](loggerCatch(_0xf536('0x34')));}; \ 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 7c15fa4..95a9713 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 _0xacbd=['util','moment','../../../../config/logger','preview','env','127.0.0.1','../../dialer/utils','loggerCatch','inspect','info','loggerError','error','logger2','getCallerId','isUndefined','string','isEmpty','\x22%s\x22\x20<%s>','format','isActive','addVariables','Queue','name','calleridname','calleridnum','dialer','VoiceQueueId','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','dialPreviewUrl','\x22agi://%s/square,%s\x22','dialQueueProject','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','hasOwnProperty','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','responsetime','logAgent','getSeconds','logLookAgent','membername','UserId','logCustomer','endtime','ringtime','talktime','answertime','isFailure','Failure','variablesAction','RECALL','uniqueid','channelAgent','timeout','totalGlobal','countbusyretry','countnoanswerretry','cloneAction','Global','active','scheduledat','add','minutes','ContactId','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','lastevent','interface','motionChannel','voice','mandatoryDisposition','agentReadyId','isNil','not_inuse','status','getDiff','milliseconds','diff','seconds','createBody','filterKey','idContact','queue','campaigntype','dialAnswer','countcongestionretry','callbackuniqueid','callbackat','recallme','xmd-voicequeueid','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialoptions','xmd-dialchannel','xmd-cdrtype','xmd-callerid','xmd-agi','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqos','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','random','extractCalleridName','match','extractCalleridNumber','noanswer','keys','variables','forEach','buildNoAnswerEventPayload'];(function(_0x46dd53,_0x16df27){var _0x829672=function(_0x563bf8){while(--_0x563bf8){_0x46dd53['push'](_0x46dd53['shift']());}};_0x829672(++_0x16df27);}(_0xacbd,0x8a));var _0xdacb=function(_0x2a36a2,_0x5a80e8){_0x2a36a2=_0x2a36a2-0x0;var _0x368a3c=_0xacbd[_0x2a36a2];return _0x368a3c;};'use strict';var util=require(_0xdacb('0x0'));var _=require('lodash');var moment=require(_0xdacb('0x1'));var logger=require(_0xdacb('0x2'))(_0xdacb('0x3'));var ipAgi=process[_0xdacb('0x4')]['XCALLY_IP_AGI']||_0xdacb('0x5');var utils=require(_0xdacb('0x6'));exports[_0xdacb('0x7')]=function(_0x3123a7){return function(_0x5888e0){logger['error'](_0x3123a7,util[_0xdacb('0x8')](_0x5888e0,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x4b790c,_0x4baf6f){logger[_0xdacb('0x9')](_0x4b790c,util[_0xdacb('0x8')](_0x4baf6f,{'showHidden':![],'depth':null}));};exports[_0xdacb('0xa')]=function(_0x53ea30,_0x4f8f96){logger[_0xdacb('0xb')](_0x53ea30,util[_0xdacb('0x8')](_0x4f8f96,{'showHidden':![],'depth':null}));};exports[_0xdacb('0xc')]=function(_0x4dc911){return function(_0x167cbc){logger[_0xdacb('0x9')](_0x4dc911,util[_0xdacb('0x8')](_0x167cbc,{'showHidden':![],'depth':null}));};};exports['message']=function(_0x62650a,_0x362847,_0x4b0ae1){return{'message':_0x62650a,'unlock':_0x362847,'active':_0x4b0ae1};};exports[_0xdacb('0xd')]=function(_0x2684b9,_0x7b0365,_0x1dd026){if(!_[_0xdacb('0xe')](_0x1dd026)&&_0xdacb('0xf')===typeof _0x1dd026&&!_['isEmpty'](_0x1dd026)){if(!_[_0xdacb('0xe')](_0x7b0365)&&_0xdacb('0xf')===typeof _0x7b0365&&!_[_0xdacb('0x10')](_0x7b0365)){return util['format'](_0xdacb('0x11'),_0x7b0365,_0x1dd026);}return util[_0xdacb('0x12')]('\x22%s\x22\x20<%s>',_0x1dd026,_0x1dd026);}if(!_[_0xdacb('0xe')](_0x2684b9)&&_0xdacb('0xf')===typeof _0x2684b9&&!_[_0xdacb('0x10')](_0x2684b9)){return _0x2684b9;}return'\x22\x22\x20<>';};exports[_0xdacb('0x13')]=function(_0x5c3364){if(_['isNil'](_0x5c3364)){return![];}return _0x5c3364;};exports[_0xdacb('0x14')]=function(_0x2af47f,_0x383b53,_0xce68dc,_0x1b588e,_0x5ca35d,_0x28d2bf){var _0x4e8f4a={'XMD-QUEUE':_0x383b53['Queue']?_0x383b53[_0xdacb('0x15')][_0xdacb('0x16')]:'','XMD-CALLERID':_0x1b588e,'XMD-CALLERID-PREVIEW':_0x28d2bf?util[_0xdacb('0x12')]('\x22%s\x22\x20<%s>',_0x28d2bf[_0xdacb('0x17')],_0x28d2bf[_0xdacb('0x18')]):_0x1b588e,'XMD-DIALID':_0x5ca35d,'XMD-CONTACTID':_0x383b53['ContactId'],'XMD-CDRTYPE':_0xdacb('0x19'),'CALLERID(all)':_0x1b588e,'XMD-VOICEQUEUEID':_0x383b53[_0xdacb('0x1a')],'XMD-DIALCHANNEL':_0xce68dc,'XMD-DIALTIMEOUT':_0x2af47f['dialOriginateTimeout']||0x1e,'XMD-DIALOPTIONS':util[_0xdacb('0x12')](_0xdacb('0x1b'),_0x2af47f[_0xdacb('0x1c')]?'g':'',_[_0xdacb('0x10')](_0x2af47f[_0xdacb('0x1d')])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x2af47f[_0xdacb('0x1e')]||'','XMD-AGI':_0x2af47f['dialQueueProject']?util[_0xdacb('0x12')](_0xdacb('0x1f'),ipAgi,_0x2af47f[_0xdacb('0x20')]):_0xdacb('0x21'),'XMD-AGIAFTER':_0x2af47f['dialQueueProject2']?util[_0xdacb('0x12')](_0xdacb('0x1f'),ipAgi,_0x2af47f[_0xdacb('0x1c')]):'NONE','XMD-ORIGINATECALLERIDNUM':_0x28d2bf?_0x28d2bf[_0xdacb('0x22')]:'','XMD-ORIGINATECALLERIDNAME':_0x28d2bf?_0x28d2bf[_0xdacb('0x23')]:'','XMD-DESTINATION':_0xdacb('0x24'),'SIPADDHEADER':_0xdacb('0x25')};if(!_['isEmpty'](_0x2af47f[_0xdacb('0x1d')])){_0x4e8f4a[util[_0xdacb('0x12')]('%s',_0xdacb('0x26'))]=_0x2af47f[_0xdacb('0x1d')];_0x4e8f4a[util[_0xdacb('0x12')]('%s',_0xdacb('0x27'))]=_0x5ca35d;}return _0x4e8f4a;};exports['toLowerVariables']=function(_0x18de9f){var _0x372df4={};for(var _0x39add6 in _0x18de9f){if(_0x18de9f[_0xdacb('0x28')](_0x39add6)){_0x372df4[util['format']('%s',_[_0xdacb('0x29')](_0x39add6))]=_0x18de9f[_0x39add6];}}return{'variables':_0x372df4};};exports[_0xdacb('0x2a')]=function(_0x43de29,_0x26a572){if(!_['isNil'](_0x43de29)){if(_0x43de29[_0xdacb('0x28')](_0xdacb('0x2b'))){if(_0x43de29[_0xdacb('0x2b')]>0x0){_0x43de29[_0xdacb('0x2b')]-=0x1;}else{logger[_0xdacb('0xb')](_0xdacb('0x2c'),_0x26a572);}}}else{logger[_0xdacb('0xb')](_0xdacb('0x2d'),_0x26a572);}};exports['logBlacklist']=function(_0x353b5d){var _0x1fa5c3=moment()[_0xdacb('0x12')](_0xdacb('0x2e'));_0x353b5d[_0xdacb('0x2f')]=0xd;_0x353b5d[_0xdacb('0x30')]=_0xdacb('0x31');_0x353b5d[_0xdacb('0x32')]=_0x1fa5c3;_0x353b5d[_0xdacb('0x33')]=_0x1fa5c3;_0x353b5d['endtime']=_0x1fa5c3;};exports[_0xdacb('0x34')]=function(_0x2541ae,_0x1a790a,_0x2f2351){var _0x32ce1c=moment()[_0xdacb('0x12')](_0xdacb('0x2e'));_0x2541ae[_0xdacb('0x2f')]=_0x1a790a;_0x2541ae[_0xdacb('0x30')]=_0x2f2351;_0x2541ae[_0xdacb('0x33')]=_0x32ce1c;_0x2541ae['ringtime']=utils[_0xdacb('0x35')](_0x2541ae[_0xdacb('0x33')],_0x2541ae[_0xdacb('0x32')]);};exports[_0xdacb('0x36')]=function(_0x469ee1,_0x3b55a4,_0x1e544f){_0x469ee1[_0xdacb('0x37')]=_0x3b55a4;_0x469ee1[_0xdacb('0x38')]=_0x1e544f;};exports[_0xdacb('0x39')]=function(_0x2f01d8,_0x46c986,_0x41c813){var _0x14dbe8=moment()[_0xdacb('0x12')](_0xdacb('0x2e'));_0x2f01d8[_0xdacb('0x2f')]=_0x46c986;_0x2f01d8[_0xdacb('0x30')]=_0x41c813;_0x2f01d8['responsetime']=_0x2f01d8[_0xdacb('0x33')]?_0x2f01d8[_0xdacb('0x33')]:_0x14dbe8;_0x2f01d8[_0xdacb('0x3a')]=_0x2f01d8['endtime']?_0x2f01d8[_0xdacb('0x3a')]:_0x14dbe8;_0x2f01d8[_0xdacb('0x3b')]=utils[_0xdacb('0x35')](_0x2f01d8[_0xdacb('0x33')]||0x0,_0x2f01d8[_0xdacb('0x32')]||0x0);_0x2f01d8[_0xdacb('0x3c')]=_0x2f01d8[_0xdacb('0x3d')]?utils['getSeconds'](_0x2f01d8[_0xdacb('0x3a')],_0x2f01d8[_0xdacb('0x3d')]):0x0;};exports[_0xdacb('0x3e')]=function(_0x4e75e6){return _0x4e75e6===_0xdacb('0x3f');};exports[_0xdacb('0x40')]=function(_0x50a88e,_0x116158,_0x2bbf3e,_0x2e09ec,_0x33421f){var _0x343e48=_0x2e09ec?_0xdacb('0x41'):_0x50a88e['calleridname'];_0x343e48=_0x33421f?'BOOKED':_0x343e48;return{'actionid':_0x50a88e[_0xdacb('0x42')],'action':'originate','channel':_0x50a88e[_0xdacb('0x43')],'callerid':util['format']('\x22%s\x22\x20<%s>',_0x343e48,_0x50a88e[_0xdacb('0x18')]),'Exten':_0xdacb('0x24'),'Context':'from-sip','Priority':'1','variable':_0x2bbf3e,'timeout':(_0x116158[_0xdacb('0x44')]||0x1e)*0x3e8,'async':!![],'channelid':_0x50a88e[_0xdacb('0x42')]};};exports[_0xdacb('0x45')]=function(_0x518548){return _0x518548[_0xdacb('0x46')]+_0x518548['countcongestionretry']+_0x518548[_0xdacb('0x47')]+_0x518548['countagentrejectretry']+_0x518548['countnosuchnumberretry'];};exports[_0xdacb('0x48')]=function(_0x4be934){var _0x543bc3=_['clone'](_0x4be934);_0x543bc3[_0xdacb('0x2f')]=0xf;_0x543bc3[_0xdacb('0x30')]=_0xdacb('0x49');return _0x543bc3;};exports['scheduledAt']=function(_0x280793,_0x2557c9,_0x433135){var _0x205b07={};_0x205b07[_0x2557c9]=_0x280793[_0x2557c9];_0x205b07[_0xdacb('0x4a')]=![];_0x205b07[_0xdacb('0x4b')]=moment()[_0xdacb('0x4c')](_0x433135,_0xdacb('0x4d'))[_0xdacb('0x12')](_0xdacb('0x2e'));_0x205b07[_0xdacb('0x4e')]=_0x280793['ContactId'];_0x205b07[_0xdacb('0x4f')]=_0x280793[_0xdacb('0x4f')];_0x205b07[_0xdacb('0x1a')]=_0x280793[_0xdacb('0x1a')]||undefined;return _0x205b07;};exports[_0xdacb('0x50')]=function(_0x1f3705,_0x3472d7){if(!_['isNil'](_0x1f3705)){if(_0x1f3705[_0xdacb('0x51')]>0x0){_0x1f3705[_0xdacb('0x51')]-=0x1;}else{logger[_0xdacb('0xb')](_0x3472d7,_0xdacb('0x52'));}}else{logger[_0xdacb('0xb')](_0x3472d7,_0xdacb('0x53'));}};exports[_0xdacb('0x54')]=function(_0x1f561f){if(_0x1f561f<=0x0){return!![];}return![];};function buildObj(_0x366613,_0xd55db7,_0x528f41){_0x366613[_0xdacb('0x55')]=_0xd55db7;_0x366613[_0xdacb('0x16')]=_0x366613['queue'];_0x366613[_0xdacb('0x56')]=_0x366613[_0xdacb('0x43')];_0x366613[_0xdacb('0x57')]=_0xdacb('0x58');if(_0x528f41){_0x366613[_0xdacb('0x59')]=_0x528f41[_0xdacb('0x59')];}return _0x366613;}exports['buildObj']=buildObj;exports[_0xdacb('0x5a')]=function(_0x23975a){var _0x4e4a08=[];for(var _0x1700b0 in _0x23975a){if(_0x23975a[_0xdacb('0x28')](_0x1700b0)){if(!_[_0xdacb('0x5b')](_0x23975a[_0x1700b0])&&_0x23975a[_0x1700b0][_0xdacb('0x2f')]===_0xdacb('0x5c')&&_0x23975a[_0x1700b0][_0xdacb('0x5d')]==='reachable'){_0x4e4a08['push'](_0x23975a[_0x1700b0]['id']);}}}return _0x4e4a08;};exports[_0xdacb('0x5e')]=function(_0xfee6a4){var _0x2ead19=moment()[_0xdacb('0x5f')](0x0);var _0x531a02=moment(_0xfee6a4)['milliseconds'](0x0);return _0x2ead19[_0xdacb('0x60')](_0x531a02,_0xdacb('0x61'));};exports[_0xdacb('0x62')]=function(_0x19e905){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x19e905[_0xdacb('0x4e')],'ListId':_0x19e905[_0xdacb('0x4f')],'VoiceQueueId':_0x19e905['VoiceQueueId']||undefined,'CampaignId':_0x19e905['CampaignId']||undefined};};exports[_0xdacb('0x63')]=function(_0x39f936){if(_0x39f936===_0xdacb('0x42')||_0x39f936===_0xdacb('0x64')||_0x39f936===_0xdacb('0x65')||_0x39f936==='type'||_0x39f936===_0xdacb('0x66')||_0x39f936===_0xdacb('0x67')||_0x39f936==='membername'||_0x39f936===_0xdacb('0x43')||_0x39f936===_0xdacb('0x17')||_0x39f936===_0xdacb('0x4a')||_0x39f936==='calleridnum'||_0x39f936==='scheduledat'||_0x39f936===_0xdacb('0x46')||_0x39f936===_0xdacb('0x68')||_0x39f936===_0xdacb('0x47')||_0x39f936==='countglobal'||_0x39f936==='callback'||_0x39f936===_0xdacb('0x69')||_0x39f936===_0xdacb('0x6a')||_0x39f936===_0xdacb('0x6b')||_0x39f936==='ContactId'||_0x39f936===_0xdacb('0x4f')||_0x39f936===_0xdacb('0x38')||_0x39f936===_0xdacb('0x1a')||_0x39f936==='sipcallid'||_0x39f936===_0xdacb('0x6c')||_0x39f936==='xmd-queue'||_0x39f936===_0xdacb('0x6d')||_0x39f936===_0xdacb('0x6e')||_0x39f936===_0xdacb('0x6f')||_0x39f936==='xmd-dialtimeout'||_0x39f936===_0xdacb('0x70')||_0x39f936==='xmd-dialid'||_0x39f936===_0xdacb('0x71')||_0x39f936==='xmd-contactid'||_0x39f936===_0xdacb('0x72')||_0x39f936===_0xdacb('0x73')||_0x39f936==='xmd-agiafter'||_0x39f936===_0xdacb('0x74')||_0x39f936==='rtpaudioqos'||_0x39f936===_0xdacb('0x75')||_0x39f936===_0xdacb('0x76')||_0x39f936==='rtpaudioqosjitterbridged'||_0x39f936===_0xdacb('0x77')||_0x39f936===_0xdacb('0x78')||_0x39f936===_0xdacb('0x79')||_0x39f936===_0xdacb('0x7a')||_0x39f936===_0xdacb('0x7b')||_0x39f936===_0xdacb('0x75')||_0x39f936===_0xdacb('0x76')||_0x39f936==='rtpaudioqosjitterbridged'||_0x39f936===_0xdacb('0x77')||_0x39f936===_0xdacb('0x78')||_0x39f936===_0xdacb('0x79')||_0x39f936==='rtpaudioqosrttbridged'||_0x39f936==='bridgepeer'||_0x39f936===_0xdacb('0x7c')||_0x39f936===_0xdacb('0x2f')||_0x39f936===_0xdacb('0x30')){return![];}return!![];};exports[_0xdacb('0x7d')]=function(_0x104634,_0x4cf14f){var _0x404879,_0x25715e,_0x55a401;if(_0x4cf14f<=0x0){_0x4cf14f=0x1;}_0x404879=new RegExp(_0xdacb('0x7e')+_0x4cf14f+'}$');_0x25715e=Math['pow'](0xa,_0x4cf14f-0x1);_0x55a401=Math[_0xdacb('0x7f')](0xa,_0x4cf14f)-0x1;return util[_0xdacb('0x12')]('%s',_[_0xdacb('0x80')](_0x104634,_0x404879,_[_0xdacb('0x81')](_0x25715e,_0x55a401)));};exports[_0xdacb('0x82')]=function(_0x5b2b89){var _0x208656=_0x5b2b89[_0xdacb('0x83')](/"(.*?)"/);return _0x208656?_0x208656[0x1]:_0x5b2b89;};exports[_0xdacb('0x84')]=function(_0x25f434){var _0x5f5cfc=_0x25f434['match'](/<(.*?)>/);return _0x5f5cfc?_0x5f5cfc[0x1]:_0x25f434;};function buildNoAnswerEventPayload(_0x5755a6,_0x3aca9e){var _0x3e0dc5=buildObj(_0x5755a6,_0xdacb('0x85'));if(!_['isEmpty'](_0x3aca9e['variables'])){Object[_0xdacb('0x86')](_0x3aca9e[_0xdacb('0x87')])[_0xdacb('0x88')](function(_0x56970a){_0x3e0dc5[_0x56970a['toLowerCase']()]=_0x3aca9e['variables'][_0x56970a];});}return _0x3e0dc5;}exports[_0xdacb('0x89')]=buildNoAnswerEventPayload; \ No newline at end of file +var _0xbecc=['rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','rtpaudioqosrtt','bridgepeer','bridgepvtcallid','\x5cw{0,','pow','random','extractCalleridName','match','extractCalleridNumber','noanswer','variables','keys','forEach','util','lodash','../../../../config/logger','preview','env','XCALLY_IP_AGI','127.0.0.1','../../dialer/utils','logger','info','inspect','error','logger2','message','getCallerId','isUndefined','string','isEmpty','\x22%s\x22\x20<%s>','format','isNil','addVariables','Queue','name','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','dialQueueProject2','originatecalleridnum','originatecalleridname','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','hasOwnProperty','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','Blacklist','starttime','endtime','logAgent','statedesc','ringtime','getSeconds','responsetime','UserId','logCustomer','talktime','answertime','isFailure','Failure','variablesAction','RECALL','calleridname','uniqueid','originate','channelAgent','xcally-motion-preview','from-sip','timeout','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','cloneAction','Global','scheduledAt','scheduledat','add','minutes','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','queue','interface','mandatoryDisposition','agentReadyId','status','reachable','getDiff','milliseconds','createBody','ListId','filterKey','idContact','type','campaigntype','dialAnswer','active','callbackuniqueid','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialoptions','xmd-contactid','xmd-cdrtype','xmd-agi','rtpaudioqos','rtpaudioqosbridged'];(function(_0xa2bb69,_0x41803f){var _0x5e6eea=function(_0x460ecb){while(--_0x460ecb){_0xa2bb69['push'](_0xa2bb69['shift']());}};_0x5e6eea(++_0x41803f);}(_0xbecc,0x126));var _0xcbec=function(_0xca016f,_0x37994d){_0xca016f=_0xca016f-0x0;var _0x3f1ce1=_0xbecc[_0xca016f];return _0x3f1ce1;};'use strict';var util=require(_0xcbec('0x0'));var _=require(_0xcbec('0x1'));var moment=require('moment');var logger=require(_0xcbec('0x2'))(_0xcbec('0x3'));var ipAgi=process[_0xcbec('0x4')][_0xcbec('0x5')]||_0xcbec('0x6');var utils=require(_0xcbec('0x7'));exports['loggerCatch']=function(_0x261607){return function(_0x5483f3){logger['error'](_0x261607,util['inspect'](_0x5483f3,{'showHidden':![],'depth':null}));};};exports[_0xcbec('0x8')]=function(_0x1484c5,_0xe80129){logger[_0xcbec('0x9')](_0x1484c5,util[_0xcbec('0xa')](_0xe80129,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x1641a8,_0x5e2c66){logger[_0xcbec('0xb')](_0x1641a8,util['inspect'](_0x5e2c66,{'showHidden':![],'depth':null}));};exports[_0xcbec('0xc')]=function(_0x2a7c9e){return function(_0x48c8f9){logger['info'](_0x2a7c9e,util[_0xcbec('0xa')](_0x48c8f9,{'showHidden':![],'depth':null}));};};exports[_0xcbec('0xd')]=function(_0x36525c,_0x24ef04,_0x2be314){return{'message':_0x36525c,'unlock':_0x24ef04,'active':_0x2be314};};exports[_0xcbec('0xe')]=function(_0x19bea5,_0x5d3381,_0x441c5c){if(!_[_0xcbec('0xf')](_0x441c5c)&&_0xcbec('0x10')===typeof _0x441c5c&&!_['isEmpty'](_0x441c5c)){if(!_[_0xcbec('0xf')](_0x5d3381)&&_0xcbec('0x10')===typeof _0x5d3381&&!_[_0xcbec('0x11')](_0x5d3381)){return util['format'](_0xcbec('0x12'),_0x5d3381,_0x441c5c);}return util[_0xcbec('0x13')](_0xcbec('0x12'),_0x441c5c,_0x441c5c);}if(!_[_0xcbec('0xf')](_0x19bea5)&&_0xcbec('0x10')===typeof _0x19bea5&&!_[_0xcbec('0x11')](_0x19bea5)){return _0x19bea5;}return'\x22\x22\x20<>';};exports['isActive']=function(_0x53f29b){if(_[_0xcbec('0x14')](_0x53f29b)){return![];}return _0x53f29b;};exports[_0xcbec('0x15')]=function(_0x559d7d,_0x3fb7d3,_0x2c0d9f,_0x13a188,_0x639e94,_0x32863){var _0x1105a5={'XMD-QUEUE':_0x3fb7d3[_0xcbec('0x16')]?_0x3fb7d3[_0xcbec('0x16')][_0xcbec('0x17')]:'','XMD-CALLERID':_0x13a188,'XMD-CALLERID-PREVIEW':_0x32863?util[_0xcbec('0x13')](_0xcbec('0x12'),_0x32863['calleridname'],_0x32863[_0xcbec('0x18')]):_0x13a188,'XMD-DIALID':_0x639e94,'XMD-CONTACTID':_0x3fb7d3[_0xcbec('0x19')],'XMD-CDRTYPE':_0xcbec('0x1a'),'CALLERID(all)':_0x13a188,'XMD-VOICEQUEUEID':_0x3fb7d3[_0xcbec('0x1b')],'XMD-DIALCHANNEL':_0x2c0d9f,'XMD-DIALTIMEOUT':_0x559d7d[_0xcbec('0x1c')]||0x1e,'XMD-DIALOPTIONS':util[_0xcbec('0x13')](_0xcbec('0x1d'),_0x559d7d['dialQueueProject2']?'g':'',_['isEmpty'](_0x559d7d[_0xcbec('0x1e')])?'':_0xcbec('0x1f')),'XMD-DIALURL':_0x559d7d[_0xcbec('0x20')]||'','XMD-AGI':_0x559d7d[_0xcbec('0x21')]?util['format'](_0xcbec('0x22'),ipAgi,_0x559d7d[_0xcbec('0x21')]):_0xcbec('0x23'),'XMD-AGIAFTER':_0x559d7d[_0xcbec('0x24')]?util[_0xcbec('0x13')]('\x22agi://%s/square,%s\x22',ipAgi,_0x559d7d['dialQueueProject2']):_0xcbec('0x23'),'XMD-ORIGINATECALLERIDNUM':_0x32863?_0x32863[_0xcbec('0x25')]:'','XMD-ORIGINATECALLERIDNAME':_0x32863?_0x32863[_0xcbec('0x26')]:'','XMD-DESTINATION':'xcally-motion-preview','SIPADDHEADER':_0xcbec('0x27')};if(!_[_0xcbec('0x11')](_0x559d7d[_0xcbec('0x1e')])){_0x1105a5[util[_0xcbec('0x13')]('%s',_0xcbec('0x28'))]=_0x559d7d['monitor_format'];_0x1105a5[util[_0xcbec('0x13')]('%s',_0xcbec('0x29'))]=_0x639e94;}return _0x1105a5;};exports['toLowerVariables']=function(_0x2743b2){var _0xb076b0={};for(var _0x38e60c in _0x2743b2){if(_0x2743b2[_0xcbec('0x2a')](_0x38e60c)){_0xb076b0[util[_0xcbec('0x13')]('%s',_[_0xcbec('0x2b')](_0x38e60c))]=_0x2743b2[_0x38e60c];}}return{'variables':_0xb076b0};};exports[_0xcbec('0x2c')]=function(_0xd88f91,_0x127672){if(!_[_0xcbec('0x14')](_0xd88f91)){if(_0xd88f91[_0xcbec('0x2a')](_0xcbec('0x2d'))){if(_0xd88f91[_0xcbec('0x2d')]>0x0){_0xd88f91[_0xcbec('0x2d')]-=0x1;}else{logger[_0xcbec('0xb')](_0xcbec('0x2e'),_0x127672);}}}else{logger[_0xcbec('0xb')](_0xcbec('0x2f'),_0x127672);}};exports[_0xcbec('0x30')]=function(_0x3640a5){var _0x1de261=moment()[_0xcbec('0x13')](_0xcbec('0x31'));_0x3640a5[_0xcbec('0x32')]=0xd;_0x3640a5['statedesc']=_0xcbec('0x33');_0x3640a5[_0xcbec('0x34')]=_0x1de261;_0x3640a5['responsetime']=_0x1de261;_0x3640a5[_0xcbec('0x35')]=_0x1de261;};exports[_0xcbec('0x36')]=function(_0x52bfde,_0xf9163b,_0x44feb4){var _0x389aa9=moment()[_0xcbec('0x13')](_0xcbec('0x31'));_0x52bfde['state']=_0xf9163b;_0x52bfde[_0xcbec('0x37')]=_0x44feb4;_0x52bfde['responsetime']=_0x389aa9;_0x52bfde[_0xcbec('0x38')]=utils[_0xcbec('0x39')](_0x52bfde[_0xcbec('0x3a')],_0x52bfde[_0xcbec('0x34')]);};exports['logLookAgent']=function(_0x75835a,_0x4ca3ff,_0x558a2b){_0x75835a['membername']=_0x4ca3ff;_0x75835a[_0xcbec('0x3b')]=_0x558a2b;};exports[_0xcbec('0x3c')]=function(_0x18f62f,_0x3fb2d2,_0x4cf286){var _0x21ef56=moment()['format'](_0xcbec('0x31'));_0x18f62f['state']=_0x3fb2d2;_0x18f62f['statedesc']=_0x4cf286;_0x18f62f[_0xcbec('0x3a')]=_0x18f62f[_0xcbec('0x3a')]?_0x18f62f[_0xcbec('0x3a')]:_0x21ef56;_0x18f62f[_0xcbec('0x35')]=_0x18f62f[_0xcbec('0x35')]?_0x18f62f[_0xcbec('0x35')]:_0x21ef56;_0x18f62f[_0xcbec('0x38')]=utils['getSeconds'](_0x18f62f[_0xcbec('0x3a')]||0x0,_0x18f62f[_0xcbec('0x34')]||0x0);_0x18f62f[_0xcbec('0x3d')]=_0x18f62f['answertime']?utils['getSeconds'](_0x18f62f[_0xcbec('0x35')],_0x18f62f[_0xcbec('0x3e')]):0x0;};exports[_0xcbec('0x3f')]=function(_0x13012a){return _0x13012a===_0xcbec('0x40');};exports[_0xcbec('0x41')]=function(_0xbc7442,_0x3b93fb,_0x50de2e,_0x2c235f,_0x56ca1){var _0x22798d=_0x2c235f?_0xcbec('0x42'):_0xbc7442[_0xcbec('0x43')];_0x22798d=_0x56ca1?'BOOKED':_0x22798d;return{'actionid':_0xbc7442[_0xcbec('0x44')],'action':_0xcbec('0x45'),'channel':_0xbc7442[_0xcbec('0x46')],'callerid':util['format'](_0xcbec('0x12'),_0x22798d,_0xbc7442['calleridnum']),'Exten':_0xcbec('0x47'),'Context':_0xcbec('0x48'),'Priority':'1','variable':_0x50de2e,'timeout':(_0x3b93fb[_0xcbec('0x49')]||0x1e)*0x3e8,'async':!![],'channelid':_0xbc7442[_0xcbec('0x44')]};};exports[_0xcbec('0x4a')]=function(_0x242916){return _0x242916[_0xcbec('0x4b')]+_0x242916[_0xcbec('0x4c')]+_0x242916[_0xcbec('0x4d')]+_0x242916[_0xcbec('0x4e')]+_0x242916['countnosuchnumberretry'];};exports[_0xcbec('0x4f')]=function(_0x26a040){var _0x2d551c=_['clone'](_0x26a040);_0x2d551c[_0xcbec('0x32')]=0xf;_0x2d551c[_0xcbec('0x37')]=_0xcbec('0x50');return _0x2d551c;};exports[_0xcbec('0x51')]=function(_0x1566cc,_0x524319,_0x4b83c7){var _0x8a0a5c={};_0x8a0a5c[_0x524319]=_0x1566cc[_0x524319];_0x8a0a5c['active']=![];_0x8a0a5c[_0xcbec('0x52')]=moment()[_0xcbec('0x53')](_0x4b83c7,_0xcbec('0x54'))[_0xcbec('0x13')](_0xcbec('0x31'));_0x8a0a5c[_0xcbec('0x19')]=_0x1566cc['ContactId'];_0x8a0a5c['ListId']=_0x1566cc['ListId'];_0x8a0a5c[_0xcbec('0x1b')]=_0x1566cc['VoiceQueueId']||undefined;return _0x8a0a5c;};exports[_0xcbec('0x55')]=function(_0x3d422a,_0x1a707f){if(!_[_0xcbec('0x14')](_0x3d422a)){if(_0x3d422a[_0xcbec('0x56')]>0x0){_0x3d422a[_0xcbec('0x56')]-=0x1;}else{logger[_0xcbec('0xb')](_0x1a707f,_0xcbec('0x57'));}}else{logger['error'](_0x1a707f,_0xcbec('0x58'));}};exports[_0xcbec('0x59')]=function(_0x1b3359){if(_0x1b3359<=0x0){return!![];}return![];};function buildObj(_0x30b9fa,_0x3a14a0,_0x557b6b){_0x30b9fa['lastevent']=_0x3a14a0;_0x30b9fa['name']=_0x30b9fa[_0xcbec('0x5a')];_0x30b9fa[_0xcbec('0x5b')]=_0x30b9fa[_0xcbec('0x46')];_0x30b9fa['motionChannel']='voice';if(_0x557b6b){_0x30b9fa[_0xcbec('0x5c')]=_0x557b6b[_0xcbec('0x5c')];}return _0x30b9fa;}exports['buildObj']=buildObj;exports[_0xcbec('0x5d')]=function(_0x535639){var _0x4102fb=[];for(var _0x359be7 in _0x535639){if(_0x535639[_0xcbec('0x2a')](_0x359be7)){if(!_[_0xcbec('0x14')](_0x535639[_0x359be7])&&_0x535639[_0x359be7][_0xcbec('0x32')]==='not_inuse'&&_0x535639[_0x359be7][_0xcbec('0x5e')]===_0xcbec('0x5f')){_0x4102fb['push'](_0x535639[_0x359be7]['id']);}}}return _0x4102fb;};exports[_0xcbec('0x60')]=function(_0x560fab){var _0x204a0a=moment()[_0xcbec('0x61')](0x0);var _0x2812b6=moment(_0x560fab)[_0xcbec('0x61')](0x0);return _0x204a0a['diff'](_0x2812b6,'seconds');};exports[_0xcbec('0x62')]=function(_0x3fbae8){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x3fbae8[_0xcbec('0x19')],'ListId':_0x3fbae8[_0xcbec('0x63')],'VoiceQueueId':_0x3fbae8['VoiceQueueId']||undefined,'CampaignId':_0x3fbae8['CampaignId']||undefined};};exports[_0xcbec('0x64')]=function(_0x1f4be5){if(_0x1f4be5==='uniqueid'||_0x1f4be5===_0xcbec('0x65')||_0x1f4be5===_0xcbec('0x5a')||_0x1f4be5===_0xcbec('0x66')||_0x1f4be5===_0xcbec('0x67')||_0x1f4be5===_0xcbec('0x68')||_0x1f4be5==='membername'||_0x1f4be5==='channelAgent'||_0x1f4be5==='calleridname'||_0x1f4be5===_0xcbec('0x69')||_0x1f4be5===_0xcbec('0x18')||_0x1f4be5===_0xcbec('0x52')||_0x1f4be5==='countbusyretry'||_0x1f4be5==='countcongestionretry'||_0x1f4be5===_0xcbec('0x4d')||_0x1f4be5==='countglobal'||_0x1f4be5==='callback'||_0x1f4be5===_0xcbec('0x6a')||_0x1f4be5===_0xcbec('0x6b')||_0x1f4be5===_0xcbec('0x6c')||_0x1f4be5===_0xcbec('0x19')||_0x1f4be5===_0xcbec('0x63')||_0x1f4be5===_0xcbec('0x3b')||_0x1f4be5==='VoiceQueueId'||_0x1f4be5===_0xcbec('0x6d')||_0x1f4be5===_0xcbec('0x6e')||_0x1f4be5==='xmd-queue'||_0x1f4be5===_0xcbec('0x6f')||_0x1f4be5===_0xcbec('0x70')||_0x1f4be5===_0xcbec('0x71')||_0x1f4be5==='xmd-dialtimeout'||_0x1f4be5===_0xcbec('0x72')||_0x1f4be5==='xmd-dialid'||_0x1f4be5==='xmd-dialchannel'||_0x1f4be5===_0xcbec('0x73')||_0x1f4be5===_0xcbec('0x74')||_0x1f4be5==='xmd-callerid'||_0x1f4be5==='xmd-agiafter'||_0x1f4be5===_0xcbec('0x75')||_0x1f4be5===_0xcbec('0x76')||_0x1f4be5===_0xcbec('0x77')||_0x1f4be5===_0xcbec('0x78')||_0x1f4be5===_0xcbec('0x79')||_0x1f4be5===_0xcbec('0x7a')||_0x1f4be5===_0xcbec('0x7b')||_0x1f4be5==='rtpaudioqosrtt'||_0x1f4be5===_0xcbec('0x7c')||_0x1f4be5===_0xcbec('0x76')||_0x1f4be5===_0xcbec('0x77')||_0x1f4be5===_0xcbec('0x78')||_0x1f4be5==='rtpaudioqosjitterbridged'||_0x1f4be5===_0xcbec('0x7a')||_0x1f4be5===_0xcbec('0x7b')||_0x1f4be5===_0xcbec('0x7d')||_0x1f4be5==='rtpaudioqosrttbridged'||_0x1f4be5===_0xcbec('0x7e')||_0x1f4be5===_0xcbec('0x7f')||_0x1f4be5==='state'||_0x1f4be5===_0xcbec('0x37')){return![];}return!![];};exports['getCallerIdRandom']=function(_0x2deccc,_0x3f7f1e){var _0x49d151,_0x437a27,_0x56f25e;if(_0x3f7f1e<=0x0){_0x3f7f1e=0x1;}_0x49d151=new RegExp(_0xcbec('0x80')+_0x3f7f1e+'}$');_0x437a27=Math[_0xcbec('0x81')](0xa,_0x3f7f1e-0x1);_0x56f25e=Math[_0xcbec('0x81')](0xa,_0x3f7f1e)-0x1;return util[_0xcbec('0x13')]('%s',_['replace'](_0x2deccc,_0x49d151,_[_0xcbec('0x82')](_0x437a27,_0x56f25e)));};exports[_0xcbec('0x83')]=function(_0x401520){var _0x9207e5=_0x401520[_0xcbec('0x84')](/"(.*?)"/);return _0x9207e5?_0x9207e5[0x1]:_0x401520;};exports[_0xcbec('0x85')]=function(_0x209593){var _0x5a23ed=_0x209593[_0xcbec('0x84')](/<(.*?)>/);return _0x5a23ed?_0x5a23ed[0x1]:_0x209593;};function buildNoAnswerEventPayload(_0x225c73,_0x52fa78){var _0x1358e6=buildObj(_0x225c73,_0xcbec('0x86'));if(!_[_0xcbec('0x11')](_0x52fa78[_0xcbec('0x87')])){Object[_0xcbec('0x88')](_0x52fa78['variables'])[_0xcbec('0x89')](function(_0x175e6a){_0x1358e6[_0x175e6a['toLowerCase']()]=_0x52fa78['variables'][_0x175e6a];});}return _0x1358e6;}exports['buildNoAnswerEventPayload']=buildNoAnswerEventPayload; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index 1409d25..8835938 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 _0x1fb7=['voicequeuechannelhangup','voicequeuechannelredirect','queueadd','string','number','boolean','queueremove'];(function(_0x534079,_0x182693){var _0x4406f3=function(_0x107682){while(--_0x107682){_0x534079['push'](_0x534079['shift']());}};_0x4406f3(++_0x182693);}(_0x1fb7,0x17c));var _0x71fb=function(_0x482914,_0x3fe08e){_0x482914=_0x482914-0x0;var _0x151f6a=_0x1fb7[_0x482914];return _0x151f6a;};'use strict';exports[_0x71fb('0x0')]={'queue':{'type':_0x71fb('0x1'),'required':!![]},'interface':{'type':_0x71fb('0x1'),'required':!![]},'membername':{'type':_0x71fb('0x1'),'required':!![]},'penalty':{'type':_0x71fb('0x2'),'required':![]},'paused':{'type':_0x71fb('0x3'),'required':![]}};exports[_0x71fb('0x4')]={'queue':{'type':_0x71fb('0x1'),'required':!![]},'interface':{'type':_0x71fb('0x1'),'required':!![]}};exports['queuepause']={'interface':{'type':_0x71fb('0x1'),'required':!![]},'paused':{'type':_0x71fb('0x3')},'reason':{'type':'string','required':![]}};exports['reload']={'module':{'type':_0x71fb('0x1'),'required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':_0x71fb('0x1'),'required':!![]}};exports['voicechannel']={'uniqueid':{'type':_0x71fb('0x1'),'required':!![]},'filename':{'type':_0x71fb('0x1')},'format':{'type':_0x71fb('0x1')},'mixmonitorid':{'type':'string'}};exports[_0x71fb('0x5')]={'uniqueid':{'type':'string','required':!![]}};exports[_0x71fb('0x6')]={'uniqueid':{'type':_0x71fb('0x1'),'required':!![]},'exten':{'type':_0x71fb('0x1'),'required':!![]},'context':{'type':_0x71fb('0x1')}}; \ No newline at end of file +var _0x91bb=['boolean','queueremove','queuepause','voicequeuechannel','voicechannel','voicequeuechannelhangup','voicequeuechannelredirect','string','number'];(function(_0x28b5d9,_0x2d87b7){var _0x2a7fe1=function(_0x11d5f3){while(--_0x11d5f3){_0x28b5d9['push'](_0x28b5d9['shift']());}};_0x2a7fe1(++_0x2d87b7);}(_0x91bb,0x15d));var _0xb91b=function(_0x4921d5,_0x2e52c5){_0x4921d5=_0x4921d5-0x0;var _0x25a0fe=_0x91bb[_0x4921d5];return _0x25a0fe;};'use strict';exports['queueadd']={'queue':{'type':_0xb91b('0x0'),'required':!![]},'interface':{'type':_0xb91b('0x0'),'required':!![]},'membername':{'type':_0xb91b('0x0'),'required':!![]},'penalty':{'type':_0xb91b('0x1'),'required':![]},'paused':{'type':_0xb91b('0x2'),'required':![]}};exports[_0xb91b('0x3')]={'queue':{'type':_0xb91b('0x0'),'required':!![]},'interface':{'type':_0xb91b('0x0'),'required':!![]}};exports[_0xb91b('0x4')]={'interface':{'type':_0xb91b('0x0'),'required':!![]},'paused':{'type':'boolean'},'reason':{'type':_0xb91b('0x0'),'required':![]}};exports['reload']={'module':{'type':'string','required':![]}};exports[_0xb91b('0x5')]={'uniqueid':{'type':_0xb91b('0x0'),'required':!![]}};exports[_0xb91b('0x6')]={'uniqueid':{'type':_0xb91b('0x0'),'required':!![]},'filename':{'type':'string'},'format':{'type':'string'},'mixmonitorid':{'type':_0xb91b('0x0')}};exports[_0xb91b('0x7')]={'uniqueid':{'type':_0xb91b('0x0'),'required':!![]}};exports[_0xb91b('0x8')]={'uniqueid':{'type':_0xb91b('0x0'),'required':!![]},'exten':{'type':_0xb91b('0x0'),'required':!![]},'context':{'type':_0xb91b('0x0')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 3d130e7..bdde064 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 _0xadb5=['ivrTotalCallsDays','ivrAnswerCallsDay','unmanaged','sumBillable','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','mergeFromDatabase','prototype','initAgents','initTelephones','length','isUndefined','triggers','initTemplates','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initDeskAccounts','initSugarcrmAccounts','sugarcrmAccounts','initVtigerAccounts','vtigerAccounts','initServicenowAccounts','dynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','voiceQueues','groupBy','uniqueid','queue','queuecallerexit','queuecallerabandon','abandoned','queuecallerleaveAt','diff','seconds','queuecallerabandonAt','queuecallerexitAt','queuecallerjoinAt','queuecallercomplete','queuecallercompleteAt','duration','ANSWERED','billableseconds','initCampaigns','dialQueueProject','initVoiceExtensions','voiceExtensions','initCampaignHopperHistory','initFaxAccounts','moment','../model/agent','../model/telephone','../model/trunk','../model/trigger','../model/template','../model/campaign','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','telephones','trunks','campaigns','templates','outbound','channels','outboundChannels','settings','zendeskAccounts','salesforceAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','servicenowAccounts','freshsalesAccounts','faxAccounts','mapKeys','name','hasOwnProperty','isNil','interface','format','SIP/%s','total','answered','sumHoldTime','sumDuration','isEmpty'];(function(_0x2b7f04,_0x46927d){var _0x19564e=function(_0x3d5314){while(--_0x3d5314){_0x2b7f04['push'](_0x2b7f04['shift']());}};_0x19564e(++_0x46927d);}(_0xadb5,0xad));var _0x5adb=function(_0x474ac7,_0x501bdd){_0x474ac7=_0x474ac7-0x0;var _0xc838a=_0xadb5[_0x474ac7];return _0xc838a;};'use strict';var _=require('lodash');var moment=require(_0x5adb('0x0'));var util=require('util');var Agent=require(_0x5adb('0x1'));var Telephone=require(_0x5adb('0x2'));var Trunk=require(_0x5adb('0x3'));var VoiceQueue=require('../model/voiceQueue');var Trigger=require(_0x5adb('0x4'));var Template=require(_0x5adb('0x5'));var Campaign=require(_0x5adb('0x6'));var VoiceExtension=require('../model/voiceExtension');var ZendeskAccount=require(_0x5adb('0x7'));var SalesforceAccount=require(_0x5adb('0x8'));var FreshdeskAccount=require(_0x5adb('0x9'));var SugarcrmAccount=require(_0x5adb('0xa'));var ZohoAccount=require(_0x5adb('0xb'));var DeskAccount=require(_0x5adb('0xc'));var VtigerAccount=require(_0x5adb('0xd'));var ServicenowAccount=require(_0x5adb('0xe'));var Dynamics365Account=require(_0x5adb('0xf'));var FreshsalesAccount=require(_0x5adb('0x10'));var FaxAccount=require(_0x5adb('0x11'));function Realtime(){this[_0x5adb('0x12')]={};this[_0x5adb('0x13')]={};this[_0x5adb('0x14')]={};this['voiceQueues']={};this['triggers']={};this[_0x5adb('0x15')]={};this[_0x5adb('0x16')]={};this[_0x5adb('0x17')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0x5adb('0x18')]={};this['queueChannels']={};this[_0x5adb('0x19')]={};this['timers']={};this[_0x5adb('0x1a')]={};this[_0x5adb('0x1b')]={};this[_0x5adb('0x1c')]={};this['sugarcrmAccounts']={};this[_0x5adb('0x1d')]={};this[_0x5adb('0x1e')]={};this[_0x5adb('0x1f')]={};this['vtigerAccounts']={};this[_0x5adb('0x20')]={};this['dynamics365Accounts']={};this[_0x5adb('0x21')]={};this[_0x5adb('0x22')]={};}function freeIsNotKey(_0x30614e,_0x304784,_0x1c0f97){var _0x39d24d=_[_0x5adb('0x23')](_0x30614e,function(_0x42f4c6){return _0x42f4c6[_0x1c0f97];});for(var _0xb953a6 in _0x304784){if(_0x304784['hasOwnProperty'](_0xb953a6)){if(!_0x39d24d[_0xb953a6]){delete _0x304784[_0xb953a6];}}}}function freeIsNotKeySip(_0x3fff62,_0x5de028){var _0x1d9e86=_['mapKeys'](_0x3fff62,function(_0x3ef465){return util['format']('SIP/%s',_0x3ef465[_0x5adb('0x24')]);});for(var _0x1bed20 in _0x5de028){if(_0x5de028[_0x5adb('0x25')](_0x1bed20)){if(!_0x1d9e86[_0x1bed20]){delete _0x5de028[_0x1bed20];}}}}function freeIsNotKeyAgent(_0x1fd4a7,_0x99bc6c){var _0x5af69d=_[_0x5adb('0x23')](_0x1fd4a7,function(_0x5c296e){var _0x4e9f16=_[_0x5adb('0x26')](_0x5c296e[_0x5adb('0x27')])?util[_0x5adb('0x28')](_0x5adb('0x29'),_0x5c296e[_0x5adb('0x24')]):_0x5c296e[_0x5adb('0x27')];return _0x4e9f16;});for(var _0xfd9bb9 in _0x99bc6c){if(_0x99bc6c['hasOwnProperty'](_0xfd9bb9)){if(!_0x5af69d[_0xfd9bb9]){delete _0x99bc6c[_0xfd9bb9];}}}}function clearVoiceCallReports(_0x4b1957){_0x4b1957[_0x5adb('0x2a')]=0x0;_0x4b1957[_0x5adb('0x2b')]=0x0;_0x4b1957[_0x5adb('0x2c')]=0x0;_0x4b1957[_0x5adb('0x2d')]=0x0;_0x4b1957['sumBillable']=0x0;}function clearCampaigns(_0x2fee18){if(!_[_0x5adb('0x2e')](_0x2fee18)){for(var _0x5aed76 in _0x2fee18){if(_0x2fee18[_0x5adb('0x25')](_0x5aed76)){_0x2fee18[_0x5aed76][_0x5adb('0x2f')]=0x0;_0x2fee18[_0x5aed76][_0x5adb('0x30')]=0x0;}}}}function clearVoiceQueues(_0x55b40a){if(!_[_0x5adb('0x2e')](_0x55b40a)){for(var _0xbe21b1 in _0x55b40a){if(_0x55b40a[_0x5adb('0x25')](_0xbe21b1)){_0x55b40a[_0xbe21b1][_0x5adb('0x2a')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x2b')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x31')]=0x0;_0x55b40a[_0xbe21b1]['abandoned']=0x0;_0x55b40a[_0xbe21b1]['sumHoldTime']=0x0;_0x55b40a[_0xbe21b1]['sumDuration']=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x32')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x33')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x34')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x35')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x36')]=0x0;_0x55b40a[_0xbe21b1]['outboundNoSuchCallsDay']=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x37')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x38')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x39')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x3a')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x3b')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x3c')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x3d')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x33')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x3e')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x3f')]=!![];}}}}Realtime['prototype'][_0x5adb('0x40')]=function(_0x4c8b2e,_0x12424d){for(var _0x20cde6 in _0x12424d){if(_0x4c8b2e['hasOwnProperty'](_0x20cde6)){_0x4c8b2e[_0x20cde6]=_0x12424d[_0x20cde6];}}};Realtime[_0x5adb('0x41')][_0x5adb('0x42')]=function(){var _0x461a39=this;return function(_0x4a3661){if(_0x4a3661){freeIsNotKeyAgent(_0x4a3661,_0x461a39[_0x5adb('0x12')]);for(var _0x14cf00=0x0,_0x4b5887={};_0x14cf00<_0x4a3661['length'];_0x14cf00+=0x1){_0x4b5887=_0x4a3661[_0x14cf00];var _0x1ed9ea=_['isNil'](_0x4b5887[_0x5adb('0x27')])?util[_0x5adb('0x28')](_0x5adb('0x29'),_0x4b5887[_0x5adb('0x24')]):_0x4b5887[_0x5adb('0x27')];if(_['isUndefined'](_0x461a39[_0x5adb('0x12')][_0x1ed9ea])){_0x461a39[_0x5adb('0x12')][_0x1ed9ea]=new Agent(_0x4b5887);}else{_0x461a39[_0x5adb('0x40')](_0x461a39['agents'][_0x1ed9ea],_0x4b5887);}}}return _0x461a39['agents'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x43')]=function(){var _0x586820=this;return function(_0x2355bc){if(_0x2355bc){freeIsNotKeySip(_0x2355bc,_0x586820['telephones']);for(var _0x199d3b=0x0,_0x58cc5d={};_0x199d3b<_0x2355bc[_0x5adb('0x44')];_0x199d3b+=0x1){_0x58cc5d=_0x2355bc[_0x199d3b];if(_['isUndefined'](_0x586820[_0x5adb('0x13')][util[_0x5adb('0x28')]('SIP/%s',_0x58cc5d[_0x5adb('0x24')])])){_0x586820['telephones'][util[_0x5adb('0x28')](_0x5adb('0x29'),_0x58cc5d[_0x5adb('0x24')])]=new Telephone(_0x58cc5d);}else{_0x586820['mergeFromDatabase'](_0x586820[_0x5adb('0x13')][util[_0x5adb('0x28')](_0x5adb('0x29'),_0x58cc5d[_0x5adb('0x24')])],_0x58cc5d);}}}return _0x586820[_0x5adb('0x13')];};};Realtime['prototype']['initTrunks']=function(){var _0x4f491a=this;return function(_0x599999){if(_0x599999){freeIsNotKeySip(_0x599999,_0x4f491a[_0x5adb('0x14')]);for(var _0x2fbe14=0x0,_0x3a104a={};_0x2fbe14<_0x599999[_0x5adb('0x44')];_0x2fbe14+=0x1){_0x3a104a=_0x599999[_0x2fbe14];if(_[_0x5adb('0x45')](_0x4f491a[_0x5adb('0x14')][util[_0x5adb('0x28')](_0x5adb('0x29'),_0x3a104a['name'])])){_0x4f491a['trunks'][util[_0x5adb('0x28')]('SIP/%s',_0x3a104a[_0x5adb('0x24')])]=new Trunk(_0x3a104a);}else{_0x4f491a[_0x5adb('0x40')](_0x4f491a[_0x5adb('0x14')][util[_0x5adb('0x28')](_0x5adb('0x29'),_0x3a104a['name'])],_0x3a104a);}}}return _0x4f491a[_0x5adb('0x14')];};};Realtime[_0x5adb('0x41')]['initTriggers']=function(){var _0x4160ad=this;return function(_0x1a256c){if(_0x1a256c){freeIsNotKey(_0x1a256c,_0x4160ad['triggers'],'id');for(var _0x120497=0x0,_0x407a4c={};_0x120497<_0x1a256c[_0x5adb('0x44')];_0x120497+=0x1){_0x407a4c=_0x1a256c[_0x120497];if(_[_0x5adb('0x45')](_0x4160ad[_0x5adb('0x46')][_0x407a4c['id']])){_0x4160ad[_0x5adb('0x46')][_0x407a4c['id']]=new Trigger(_0x407a4c);}else{_0x4160ad[_0x5adb('0x40')](_0x4160ad['triggers'][_0x407a4c['id']],_0x407a4c);}}}return _0x4160ad['triggers'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x47')]=function(){var _0x1cd0a3=this;return function(_0xb79d85){if(_0xb79d85){freeIsNotKey(_0xb79d85,_0x1cd0a3['templates'],'id');for(var _0x507e48=0x0,_0xaa32e4={};_0x507e48<_0xb79d85[_0x5adb('0x44')];_0x507e48+=0x1){_0xaa32e4=_0xb79d85[_0x507e48];if(_[_0x5adb('0x45')](_0x1cd0a3[_0x5adb('0x16')][_0xaa32e4['id']])){_0x1cd0a3[_0x5adb('0x16')][_0xaa32e4['id']]=new Template(_0xaa32e4);}else{_0x1cd0a3['mergeFromDatabase'](_0x1cd0a3[_0x5adb('0x16')][_0xaa32e4['id']],_0xaa32e4);}}}return _0x1cd0a3[_0x5adb('0x16')];};};Realtime['prototype'][_0x5adb('0x48')]=function(){var _0x251f45=this;return function(_0x1cdb03){if(_0x1cdb03){freeIsNotKey(_0x1cdb03,_0x251f45[_0x5adb('0x1b')],'id');for(var _0x186bd2=0x0,_0x3a5409={};_0x186bd2<_0x1cdb03[_0x5adb('0x44')];_0x186bd2+=0x1){_0x3a5409=_0x1cdb03[_0x186bd2];if(_[_0x5adb('0x45')](_0x251f45['zendeskAccounts'][_0x3a5409['id']])){_0x251f45[_0x5adb('0x1b')][_0x3a5409['id']]=new ZendeskAccount(_0x3a5409);}else{_0x251f45['mergeFromDatabase'](_0x251f45['zendeskAccounts'][_0x3a5409['id']],_0x3a5409);}}}return _0x251f45['zendeskAccounts'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x49')]=function(){var _0x207a81=this;return function(_0x4ba0b5){if(_0x4ba0b5){freeIsNotKey(_0x4ba0b5,_0x207a81[_0x5adb('0x1c')],'id');for(var _0x5cbab5=0x0,_0x177a81={};_0x5cbab5<_0x4ba0b5[_0x5adb('0x44')];_0x5cbab5+=0x1){_0x177a81=_0x4ba0b5[_0x5cbab5];if(_[_0x5adb('0x45')](_0x207a81['salesforceAccounts'][_0x177a81['id']])){_0x207a81[_0x5adb('0x1c')][_0x177a81['id']]=new SalesforceAccount(_0x177a81);}else{_0x207a81['mergeFromDatabase'](_0x207a81[_0x5adb('0x1c')][_0x177a81['id']],_0x177a81);}}}return _0x207a81[_0x5adb('0x1c')];};};Realtime['prototype'][_0x5adb('0x4a')]=function(){var _0x1ab97b=this;return function(_0x3594e3){if(_0x3594e3){freeIsNotKey(_0x3594e3,_0x1ab97b[_0x5adb('0x1d')],'id');for(var _0x372734=0x0,_0x4cb36c={};_0x372734<_0x3594e3[_0x5adb('0x44')];_0x372734+=0x1){_0x4cb36c=_0x3594e3[_0x372734];if(_[_0x5adb('0x45')](_0x1ab97b[_0x5adb('0x1d')][_0x4cb36c['id']])){_0x1ab97b[_0x5adb('0x1d')][_0x4cb36c['id']]=new FreshdeskAccount(_0x4cb36c);}else{_0x1ab97b['mergeFromDatabase'](_0x1ab97b[_0x5adb('0x1d')][_0x4cb36c['id']],_0x4cb36c);}}}return _0x1ab97b[_0x5adb('0x1d')];};};Realtime[_0x5adb('0x41')]['initZohoAccounts']=function(){var _0x2b34a8=this;return function(_0xd0e5b7){if(_0xd0e5b7){freeIsNotKey(_0xd0e5b7,_0x2b34a8[_0x5adb('0x1e')],'id');for(var _0xfd3471=0x0,_0x4f2da9={};_0xfd3471<_0xd0e5b7[_0x5adb('0x44')];_0xfd3471+=0x1){_0x4f2da9=_0xd0e5b7[_0xfd3471];if(_[_0x5adb('0x45')](_0x2b34a8[_0x5adb('0x1e')][_0x4f2da9['id']])){_0x2b34a8[_0x5adb('0x1e')][_0x4f2da9['id']]=new ZohoAccount(_0x4f2da9);}else{_0x2b34a8[_0x5adb('0x40')](_0x2b34a8['zohoAccounts'][_0x4f2da9['id']],_0x4f2da9);}}}return _0x2b34a8[_0x5adb('0x1e')];};};Realtime['prototype'][_0x5adb('0x4b')]=function(){var _0x4f7227=this;return function(_0x31ae72){if(_0x31ae72){freeIsNotKey(_0x31ae72,_0x4f7227[_0x5adb('0x1f')],'id');for(var _0x1a9358=0x0,_0x42f6d9={};_0x1a9358<_0x31ae72['length'];_0x1a9358+=0x1){_0x42f6d9=_0x31ae72[_0x1a9358];if(_[_0x5adb('0x45')](_0x4f7227[_0x5adb('0x1f')][_0x42f6d9['id']])){_0x4f7227[_0x5adb('0x1f')][_0x42f6d9['id']]=new DeskAccount(_0x42f6d9);}else{_0x4f7227['mergeFromDatabase'](_0x4f7227['deskAccounts'][_0x42f6d9['id']],_0x42f6d9);}}}return _0x4f7227['deskAccounts'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x4c')]=function(){var _0xa5ecc0=this;return function(_0x12a146){if(_0x12a146){freeIsNotKey(_0x12a146,_0xa5ecc0[_0x5adb('0x4d')],'id');for(var _0xb06bee=0x0,_0x204b9b={};_0xb06bee<_0x12a146[_0x5adb('0x44')];_0xb06bee+=0x1){_0x204b9b=_0x12a146[_0xb06bee];if(_[_0x5adb('0x45')](_0xa5ecc0[_0x5adb('0x4d')][_0x204b9b['id']])){_0xa5ecc0[_0x5adb('0x4d')][_0x204b9b['id']]=new SugarcrmAccount(_0x204b9b);}else{_0xa5ecc0[_0x5adb('0x40')](_0xa5ecc0[_0x5adb('0x4d')][_0x204b9b['id']],_0x204b9b);}}}return _0xa5ecc0['sugarcrmAccounts'];};};Realtime['prototype'][_0x5adb('0x4e')]=function(){var _0x27a8e4=this;return function(_0x43cde9){if(_0x43cde9){freeIsNotKey(_0x43cde9,_0x27a8e4[_0x5adb('0x4f')],'id');for(var _0x5d7a9f=0x0,_0xfba0d5={};_0x5d7a9f<_0x43cde9[_0x5adb('0x44')];_0x5d7a9f+=0x1){_0xfba0d5=_0x43cde9[_0x5d7a9f];if(_['isUndefined'](_0x27a8e4[_0x5adb('0x4f')][_0xfba0d5['id']])){_0x27a8e4[_0x5adb('0x4f')][_0xfba0d5['id']]=new VtigerAccount(_0xfba0d5);}else{_0x27a8e4[_0x5adb('0x40')](_0x27a8e4['vtigerAccounts'][_0xfba0d5['id']],_0xfba0d5);}}}return _0x27a8e4[_0x5adb('0x4f')];};};Realtime[_0x5adb('0x41')][_0x5adb('0x50')]=function(){var _0x30c92c=this;return function(_0x330290){if(_0x330290){freeIsNotKey(_0x330290,_0x30c92c[_0x5adb('0x20')],'id');for(var _0x513f26=0x0,_0x836b91={};_0x513f26<_0x330290[_0x5adb('0x44')];_0x513f26+=0x1){_0x836b91=_0x330290[_0x513f26];if(_[_0x5adb('0x45')](_0x30c92c['servicenowAccounts'][_0x836b91['id']])){_0x30c92c[_0x5adb('0x20')][_0x836b91['id']]=new ServicenowAccount(_0x836b91);}else{_0x30c92c[_0x5adb('0x40')](_0x30c92c[_0x5adb('0x20')][_0x836b91['id']],_0x836b91);}}}return _0x30c92c['servicenowAccounts'];};};Realtime[_0x5adb('0x41')]['initDynamics365Accounts']=function(){var _0xa8ff64=this;return function(_0x1e7e3a){if(_0x1e7e3a){freeIsNotKey(_0x1e7e3a,_0xa8ff64[_0x5adb('0x51')],'id');for(var _0x57f0a4=0x0,_0x192b1f={};_0x57f0a4<_0x1e7e3a[_0x5adb('0x44')];_0x57f0a4+=0x1){_0x192b1f=_0x1e7e3a[_0x57f0a4];if(_['isUndefined'](_0xa8ff64[_0x5adb('0x51')][_0x192b1f['id']])){_0xa8ff64[_0x5adb('0x51')][_0x192b1f['id']]=new Dynamics365Account(_0x192b1f);}else{_0xa8ff64[_0x5adb('0x40')](_0xa8ff64[_0x5adb('0x51')][_0x192b1f['id']],_0x192b1f);}}}return _0xa8ff64['dynamics365Accounts'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x52')]=function(){var _0x307f07=this;return function(_0x16716e){if(_0x16716e){freeIsNotKey(_0x16716e,_0x307f07['freshsalesAccounts'],'id');for(var _0x53a4bc=0x0,_0x304512={};_0x53a4bc<_0x16716e['length'];_0x53a4bc+=0x1){_0x304512=_0x16716e[_0x53a4bc];if(_['isUndefined'](_0x307f07['freshsalesAccounts'][_0x304512['id']])){_0x307f07[_0x5adb('0x21')][_0x304512['id']]=new FreshsalesAccount(_0x304512);}else{_0x307f07[_0x5adb('0x40')](_0x307f07['freshsalesAccounts'][_0x304512['id']],_0x304512);}}}return _0x307f07[_0x5adb('0x21')];};};Realtime[_0x5adb('0x41')][_0x5adb('0x53')]=function(){var _0xf6ef8a=this;return function(_0x358a23){for(var _0x126e38=0x0;_0x126e38<_0x358a23[_0x5adb('0x44')];_0x126e38+=0x1){_[_0x5adb('0x54')](_0xf6ef8a['voiceQueues'][_0x358a23[_0x126e38]['name']],_0x358a23[_0x126e38]);}return _0xf6ef8a['voiceQueues'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x55')]=function(){var _0x3a0d1b=this;return function(_0x2a55a3){clearVoiceQueues(_0x3a0d1b[_0x5adb('0x56')]);if(_0x2a55a3){_0x2a55a3=_[_0x5adb('0x57')](_0x2a55a3,_0x5adb('0x58'));for(var _0x25f761 in _0x2a55a3){if(_0x2a55a3['hasOwnProperty'](_0x25f761)){for(var _0x5e55c2=0x0;_0x5e55c2<_0x2a55a3[_0x25f761][_0x5adb('0x44')];_0x5e55c2+=0x1){var _0x56df90=_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x59')];if(_0x3a0d1b[_0x5adb('0x56')][_0x56df90]){if(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x5a')]){_0x3a0d1b[_0x5adb('0x56')][_0x56df90][_0x5adb('0x31')]+=0x1;}if(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x5b')]){_0x3a0d1b[_0x5adb('0x56')][_0x56df90][_0x5adb('0x5c')]+=0x1;}_0x3a0d1b['voiceQueues'][_0x56df90][_0x5adb('0x2c')]+=moment(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x5d')])[_0x5adb('0x5e')](moment(_0x2a55a3[_0x25f761][_0x5e55c2]['queuecallerjoinAt']),_0x5adb('0x5f'))||0x0;if(_0x5e55c2===_0x2a55a3[_0x25f761][_0x5adb('0x44')]-0x1){_0x3a0d1b['voiceQueues'][_0x56df90][_0x5adb('0x2d')]+=moment(_0x2a55a3[_0x25f761][_0x5e55c2]['queuecallercompleteAt']||_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x60')]||_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x61')])['diff'](moment(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x62')]),_0x5adb('0x5f'))||0x0;_0x3a0d1b[_0x5adb('0x56')][_0x56df90][_0x5adb('0x2a')]+=0x1;if(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x63')]){_0x3a0d1b[_0x5adb('0x56')][_0x56df90][_0x5adb('0x2b')]+=0x1;_0x3a0d1b[_0x5adb('0x56')][_0x56df90]['sumBillable']+=moment(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x64')])[_0x5adb('0x5e')](moment(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x5d')]),'seconds')||0x0;}}else{_0x3a0d1b['voiceQueues'][_0x56df90][_0x5adb('0x2d')]+=_0x3a0d1b['voiceQueues'][_0x56df90][_0x5adb('0x2c')]||0x0;}}}}}}return _0x3a0d1b[_0x5adb('0x56')];};};Realtime[_0x5adb('0x41')]['initVoiceCallReports']=function(){var _0x3a9735=this;return function(_0x288e4f){clearVoiceCallReports(_0x3a9735[_0x5adb('0x17')]);if(_0x288e4f){for(var _0x3ecc56=0x0;_0x3ecc56<_0x288e4f[_0x5adb('0x44')];_0x3ecc56+=0x1){_0x3a9735['outbound'][_0x5adb('0x2a')]+=0x1;_0x3a9735[_0x5adb('0x17')][_0x5adb('0x2d')]+=_0x288e4f[_0x3ecc56][_0x5adb('0x65')];if(_0x288e4f[_0x3ecc56]['disposition']===_0x5adb('0x66')){_0x3a9735[_0x5adb('0x17')][_0x5adb('0x2b')]+=0x1;_0x3a9735[_0x5adb('0x17')][_0x5adb('0x2c')]+=_0x288e4f[_0x3ecc56][_0x5adb('0x65')]-_0x288e4f[_0x3ecc56][_0x5adb('0x67')]||0x0;_0x3a9735['outbound'][_0x5adb('0x32')]+=_0x288e4f[_0x3ecc56][_0x5adb('0x67')];}}}return _0x3a9735['outbound'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x68')]=function(){var _0x4fc0d5=this;return function(_0x462fa0){if(_0x462fa0){freeIsNotKey(_0x462fa0,_0x4fc0d5['campaigns'],_0x5adb('0x24'));for(var _0x268df2=0x0,_0x4a2ebc={};_0x268df2<_0x462fa0[_0x5adb('0x44')];_0x268df2+=0x1){_0x4a2ebc=_0x462fa0[_0x268df2];if(_['isUndefined'](_0x4fc0d5[_0x5adb('0x15')][_0x4a2ebc[_0x5adb('0x24')]])){_0x4fc0d5[_0x5adb('0x15')][_0x4a2ebc[_0x5adb('0x24')]]=new Campaign(_0x4a2ebc);}else{_0x4fc0d5[_0x5adb('0x40')](_0x4fc0d5['campaigns'][_0x4a2ebc[_0x5adb('0x24')]],_0x4a2ebc);_0x4fc0d5[_0x5adb('0x15')][_0x4a2ebc[_0x5adb('0x24')]][_0x5adb('0x69')]=_0x4a2ebc['SquareProject']?_0x4a2ebc['SquareProject'][_0x5adb('0x24')]:undefined;}}}return _0x4fc0d5[_0x5adb('0x15')];};};Realtime[_0x5adb('0x41')][_0x5adb('0x6a')]=function(){var _0x277668=this;return function(_0xc74e86){if(_0xc74e86){freeIsNotKey(_0xc74e86,_0x277668[_0x5adb('0x6b')],'id');for(var _0x514833=0x0,_0xda26cc={};_0x514833<_0xc74e86[_0x5adb('0x44')];_0x514833+=0x1){_0xda26cc=_0xc74e86[_0x514833];if(_[_0x5adb('0x45')](_0x277668[_0x5adb('0x6b')][_0xda26cc['id']])){_0x277668['voiceExtensions'][_0xda26cc['id']]=new VoiceExtension(_0xda26cc);}else{_0x277668[_0x5adb('0x40')](_0x277668[_0x5adb('0x6b')][_0xda26cc['id']],_0xda26cc);}}}return _0x277668[_0x5adb('0x6b')];};};Realtime[_0x5adb('0x41')][_0x5adb('0x6c')]=function(){var _0x188cbd=this;return function(_0x315ac6){clearCampaigns(_0x188cbd[_0x5adb('0x15')]);for(var _0x1f753e=0x0;_0x1f753e<_0x315ac6['length'];_0x1f753e+=0x1){_[_0x5adb('0x54')](_0x188cbd[_0x5adb('0x15')][_0x315ac6[_0x1f753e]['name']],_0x315ac6[_0x1f753e]);}return _0x188cbd[_0x5adb('0x15')];};};Realtime[_0x5adb('0x41')][_0x5adb('0x6d')]=function(){var _0x3bb3fc=this;return function(_0x200221){if(_0x200221){freeIsNotKey(_0x200221,_0x3bb3fc[_0x5adb('0x22')],'id');for(var _0x450516=0x0,_0x350bb1={};_0x450516<_0x200221['length'];_0x450516+=0x1){_0x350bb1=_0x200221[_0x450516];if(_[_0x5adb('0x45')](_0x3bb3fc[_0x5adb('0x22')][_0x350bb1['id']])){_0x3bb3fc['faxAccounts'][_0x350bb1['id']]=new FaxAccount(_0x350bb1);}else{_0x3bb3fc[_0x5adb('0x40')](_0x3bb3fc[_0x5adb('0x22')][_0x350bb1['id']],_0x350bb1);}}}return _0x3bb3fc[_0x5adb('0x22')];};};Realtime['prototype']['initVoiceQueues']=function(){var _0x2d7a9f=this;return function(_0x328851){if(_0x328851){freeIsNotKey(_0x328851,_0x2d7a9f[_0x5adb('0x56')],'name');for(var _0x14b36f=0x0,_0x321c3a={};_0x14b36f<_0x328851[_0x5adb('0x44')];_0x14b36f+=0x1){_0x321c3a=_0x328851[_0x14b36f];if(_[_0x5adb('0x45')](_0x2d7a9f[_0x5adb('0x56')][_0x321c3a[_0x5adb('0x24')]])){_0x2d7a9f[_0x5adb('0x56')][_0x321c3a[_0x5adb('0x24')]]=new VoiceQueue(_0x321c3a);}else{_0x2d7a9f[_0x5adb('0x40')](_0x2d7a9f[_0x5adb('0x56')][_0x321c3a[_0x5adb('0x24')]],_0x321c3a);}}}return _0x2d7a9f[_0x5adb('0x56')];};};module['exports']=Realtime; \ No newline at end of file +var _0xb10b=['../model/voiceExtension','../model/zendeskAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','telephones','triggers','campaigns','templates','voiceExtensions','queueChannels','outboundChannels','timers','settings','zendeskAccounts','salesforceAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','SIP/%s','name','interface','format','total','answered','sumHoldTime','sumDuration','ivrTotalCallsDays','isEmpty','unmanaged','sumBillable','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundDropCallsDayTimeout','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundAnswerCallsDay','queueStatusComplete','mergeFromDatabase','prototype','initAgents','length','isNil','isUndefined','initTelephones','trunks','initTemplates','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initDeskAccounts','initSugarcrmAccounts','sugarcrmAccounts','initVtigerAccounts','initVoiceQueueHopperHistory','voiceQueues','groupBy','uniqueid','queue','queuecallerexit','abandoned','queuecallerleaveAt','diff','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','queuecallercomplete','initVoiceCallReports','outbound','duration','billableseconds','initCampaigns','dialQueueProject','initCampaignHopperHistory','merge','initFaxAccounts','initVoiceQueues','lodash','util','../model/agent','../model/telephone','../model/voiceQueue','../model/trigger','../model/template','../model/campaign'];(function(_0x5366ab,_0x4b8df7){var _0x35e82b=function(_0x2d0afd){while(--_0x2d0afd){_0x5366ab['push'](_0x5366ab['shift']());}};_0x35e82b(++_0x4b8df7);}(_0xb10b,0x12a));var _0xbb10=function(_0x2050aa,_0x2e48ea){_0x2050aa=_0x2050aa-0x0;var _0x5b03bd=_0xb10b[_0x2050aa];return _0x5b03bd;};'use strict';var _=require(_0xbb10('0x0'));var moment=require('moment');var util=require(_0xbb10('0x1'));var Agent=require(_0xbb10('0x2'));var Telephone=require(_0xbb10('0x3'));var Trunk=require('../model/trunk');var VoiceQueue=require(_0xbb10('0x4'));var Trigger=require(_0xbb10('0x5'));var Template=require(_0xbb10('0x6'));var Campaign=require(_0xbb10('0x7'));var VoiceExtension=require(_0xbb10('0x8'));var ZendeskAccount=require(_0xbb10('0x9'));var SalesforceAccount=require('../model/salesforceAccount');var FreshdeskAccount=require(_0xbb10('0xa'));var SugarcrmAccount=require(_0xbb10('0xb'));var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require(_0xbb10('0xc'));var VtigerAccount=require(_0xbb10('0xd'));var ServicenowAccount=require(_0xbb10('0xe'));var Dynamics365Account=require(_0xbb10('0xf'));var FreshsalesAccount=require(_0xbb10('0x10'));var FaxAccount=require(_0xbb10('0x11'));function Realtime(){this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['trunks']={};this['voiceQueues']={};this[_0xbb10('0x14')]={};this[_0xbb10('0x15')]={};this[_0xbb10('0x16')]={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xbb10('0x17')]={};this['channels']={};this[_0xbb10('0x18')]={};this[_0xbb10('0x19')]={};this[_0xbb10('0x1a')]={};this[_0xbb10('0x1b')]={};this[_0xbb10('0x1c')]={};this[_0xbb10('0x1d')]={};this['sugarcrmAccounts']={};this[_0xbb10('0x1e')]={};this[_0xbb10('0x1f')]={};this[_0xbb10('0x20')]={};this[_0xbb10('0x21')]={};this[_0xbb10('0x22')]={};this[_0xbb10('0x23')]={};this[_0xbb10('0x24')]={};this[_0xbb10('0x25')]={};}function freeIsNotKey(_0x3e26f4,_0x2b184e,_0x4a2bfc){var _0x2eca0f=_[_0xbb10('0x26')](_0x3e26f4,function(_0x133ac2){return _0x133ac2[_0x4a2bfc];});for(var _0x42db98 in _0x2b184e){if(_0x2b184e[_0xbb10('0x27')](_0x42db98)){if(!_0x2eca0f[_0x42db98]){delete _0x2b184e[_0x42db98];}}}}function freeIsNotKeySip(_0x1682a4,_0x575cca){var _0x30efc6=_[_0xbb10('0x26')](_0x1682a4,function(_0xe1c665){return util['format'](_0xbb10('0x28'),_0xe1c665[_0xbb10('0x29')]);});for(var _0x388fab in _0x575cca){if(_0x575cca[_0xbb10('0x27')](_0x388fab)){if(!_0x30efc6[_0x388fab]){delete _0x575cca[_0x388fab];}}}}function freeIsNotKeyAgent(_0xdf237d,_0x44e563){var _0x4deb49=_[_0xbb10('0x26')](_0xdf237d,function(_0x12ef77){var _0x50aea1=_['isNil'](_0x12ef77[_0xbb10('0x2a')])?util[_0xbb10('0x2b')](_0xbb10('0x28'),_0x12ef77[_0xbb10('0x29')]):_0x12ef77[_0xbb10('0x2a')];return _0x50aea1;});for(var _0x1824b7 in _0x44e563){if(_0x44e563[_0xbb10('0x27')](_0x1824b7)){if(!_0x4deb49[_0x1824b7]){delete _0x44e563[_0x1824b7];}}}}function clearVoiceCallReports(_0x436104){_0x436104[_0xbb10('0x2c')]=0x0;_0x436104[_0xbb10('0x2d')]=0x0;_0x436104[_0xbb10('0x2e')]=0x0;_0x436104[_0xbb10('0x2f')]=0x0;_0x436104['sumBillable']=0x0;}function clearCampaigns(_0x4fedac){if(!_['isEmpty'](_0x4fedac)){for(var _0xc93a04 in _0x4fedac){if(_0x4fedac[_0xbb10('0x27')](_0xc93a04)){_0x4fedac[_0xc93a04][_0xbb10('0x30')]=0x0;_0x4fedac[_0xc93a04]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0x2fdde9){if(!_[_0xbb10('0x31')](_0x2fdde9)){for(var _0x6ed43b in _0x2fdde9){if(_0x2fdde9[_0xbb10('0x27')](_0x6ed43b)){_0x2fdde9[_0x6ed43b][_0xbb10('0x2c')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x2d')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x32')]=0x0;_0x2fdde9[_0x6ed43b]['abandoned']=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x2e')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x2f')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x33')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x34')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x35')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x36')]=0x0;_0x2fdde9[_0x6ed43b]['outboundCongestionCallsDay']=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x37')]=0x0;_0x2fdde9[_0x6ed43b]['outboundUnknownCallsDay']=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x38')]=0x0;_0x2fdde9[_0x6ed43b]['outboundDropCallsDayCallersExit']=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x39')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x3a')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x3b')]=0x0;_0x2fdde9[_0x6ed43b]['outboundReCallsDay']=0x0;_0x2fdde9[_0x6ed43b]['outboundAnswerAgiCallsDay']=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x3c')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x3d')]=!![];}}}}Realtime['prototype'][_0xbb10('0x3e')]=function(_0x37dde7,_0x2f653f){for(var _0x1c0b57 in _0x2f653f){if(_0x37dde7[_0xbb10('0x27')](_0x1c0b57)){_0x37dde7[_0x1c0b57]=_0x2f653f[_0x1c0b57];}}};Realtime[_0xbb10('0x3f')][_0xbb10('0x40')]=function(){var _0x4975f5=this;return function(_0x25acb3){if(_0x25acb3){freeIsNotKeyAgent(_0x25acb3,_0x4975f5[_0xbb10('0x12')]);for(var _0x441d15=0x0,_0x8c1ce6={};_0x441d15<_0x25acb3[_0xbb10('0x41')];_0x441d15+=0x1){_0x8c1ce6=_0x25acb3[_0x441d15];var _0x9de708=_[_0xbb10('0x42')](_0x8c1ce6[_0xbb10('0x2a')])?util[_0xbb10('0x2b')]('SIP/%s',_0x8c1ce6[_0xbb10('0x29')]):_0x8c1ce6[_0xbb10('0x2a')];if(_[_0xbb10('0x43')](_0x4975f5[_0xbb10('0x12')][_0x9de708])){_0x4975f5['agents'][_0x9de708]=new Agent(_0x8c1ce6);}else{_0x4975f5[_0xbb10('0x3e')](_0x4975f5['agents'][_0x9de708],_0x8c1ce6);}}}return _0x4975f5['agents'];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x44')]=function(){var _0x26e76a=this;return function(_0x120d21){if(_0x120d21){freeIsNotKeySip(_0x120d21,_0x26e76a[_0xbb10('0x13')]);for(var _0x29d11a=0x0,_0x547062={};_0x29d11a<_0x120d21[_0xbb10('0x41')];_0x29d11a+=0x1){_0x547062=_0x120d21[_0x29d11a];if(_[_0xbb10('0x43')](_0x26e76a['telephones'][util['format']('SIP/%s',_0x547062[_0xbb10('0x29')])])){_0x26e76a[_0xbb10('0x13')][util[_0xbb10('0x2b')]('SIP/%s',_0x547062[_0xbb10('0x29')])]=new Telephone(_0x547062);}else{_0x26e76a[_0xbb10('0x3e')](_0x26e76a[_0xbb10('0x13')][util['format'](_0xbb10('0x28'),_0x547062[_0xbb10('0x29')])],_0x547062);}}}return _0x26e76a[_0xbb10('0x13')];};};Realtime[_0xbb10('0x3f')]['initTrunks']=function(){var _0xd238e9=this;return function(_0x110eb5){if(_0x110eb5){freeIsNotKeySip(_0x110eb5,_0xd238e9['trunks']);for(var _0xe2040f=0x0,_0x2e3214={};_0xe2040f<_0x110eb5[_0xbb10('0x41')];_0xe2040f+=0x1){_0x2e3214=_0x110eb5[_0xe2040f];if(_[_0xbb10('0x43')](_0xd238e9[_0xbb10('0x45')][util[_0xbb10('0x2b')]('SIP/%s',_0x2e3214[_0xbb10('0x29')])])){_0xd238e9[_0xbb10('0x45')][util[_0xbb10('0x2b')](_0xbb10('0x28'),_0x2e3214['name'])]=new Trunk(_0x2e3214);}else{_0xd238e9[_0xbb10('0x3e')](_0xd238e9[_0xbb10('0x45')][util[_0xbb10('0x2b')](_0xbb10('0x28'),_0x2e3214['name'])],_0x2e3214);}}}return _0xd238e9[_0xbb10('0x45')];};};Realtime[_0xbb10('0x3f')]['initTriggers']=function(){var _0x5d9a4f=this;return function(_0x38d78f){if(_0x38d78f){freeIsNotKey(_0x38d78f,_0x5d9a4f['triggers'],'id');for(var _0x318984=0x0,_0x180933={};_0x318984<_0x38d78f['length'];_0x318984+=0x1){_0x180933=_0x38d78f[_0x318984];if(_[_0xbb10('0x43')](_0x5d9a4f[_0xbb10('0x14')][_0x180933['id']])){_0x5d9a4f[_0xbb10('0x14')][_0x180933['id']]=new Trigger(_0x180933);}else{_0x5d9a4f['mergeFromDatabase'](_0x5d9a4f[_0xbb10('0x14')][_0x180933['id']],_0x180933);}}}return _0x5d9a4f[_0xbb10('0x14')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x46')]=function(){var _0x36e1fa=this;return function(_0x19f94d){if(_0x19f94d){freeIsNotKey(_0x19f94d,_0x36e1fa[_0xbb10('0x16')],'id');for(var _0x3efa96=0x0,_0x205bb4={};_0x3efa96<_0x19f94d[_0xbb10('0x41')];_0x3efa96+=0x1){_0x205bb4=_0x19f94d[_0x3efa96];if(_[_0xbb10('0x43')](_0x36e1fa[_0xbb10('0x16')][_0x205bb4['id']])){_0x36e1fa['templates'][_0x205bb4['id']]=new Template(_0x205bb4);}else{_0x36e1fa[_0xbb10('0x3e')](_0x36e1fa[_0xbb10('0x16')][_0x205bb4['id']],_0x205bb4);}}}return _0x36e1fa['templates'];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x47')]=function(){var _0x1a7df6=this;return function(_0x5a5226){if(_0x5a5226){freeIsNotKey(_0x5a5226,_0x1a7df6[_0xbb10('0x1c')],'id');for(var _0x39f0de=0x0,_0x3e06b0={};_0x39f0de<_0x5a5226['length'];_0x39f0de+=0x1){_0x3e06b0=_0x5a5226[_0x39f0de];if(_['isUndefined'](_0x1a7df6[_0xbb10('0x1c')][_0x3e06b0['id']])){_0x1a7df6[_0xbb10('0x1c')][_0x3e06b0['id']]=new ZendeskAccount(_0x3e06b0);}else{_0x1a7df6[_0xbb10('0x3e')](_0x1a7df6['zendeskAccounts'][_0x3e06b0['id']],_0x3e06b0);}}}return _0x1a7df6['zendeskAccounts'];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x48')]=function(){var _0x1bd054=this;return function(_0xf820fe){if(_0xf820fe){freeIsNotKey(_0xf820fe,_0x1bd054[_0xbb10('0x1d')],'id');for(var _0x22b315=0x0,_0x2f2552={};_0x22b315<_0xf820fe[_0xbb10('0x41')];_0x22b315+=0x1){_0x2f2552=_0xf820fe[_0x22b315];if(_[_0xbb10('0x43')](_0x1bd054[_0xbb10('0x1d')][_0x2f2552['id']])){_0x1bd054['salesforceAccounts'][_0x2f2552['id']]=new SalesforceAccount(_0x2f2552);}else{_0x1bd054['mergeFromDatabase'](_0x1bd054[_0xbb10('0x1d')][_0x2f2552['id']],_0x2f2552);}}}return _0x1bd054[_0xbb10('0x1d')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x49')]=function(){var _0x36aa7d=this;return function(_0x440f9e){if(_0x440f9e){freeIsNotKey(_0x440f9e,_0x36aa7d[_0xbb10('0x1e')],'id');for(var _0x445870=0x0,_0x1c0d8f={};_0x445870<_0x440f9e[_0xbb10('0x41')];_0x445870+=0x1){_0x1c0d8f=_0x440f9e[_0x445870];if(_[_0xbb10('0x43')](_0x36aa7d[_0xbb10('0x1e')][_0x1c0d8f['id']])){_0x36aa7d[_0xbb10('0x1e')][_0x1c0d8f['id']]=new FreshdeskAccount(_0x1c0d8f);}else{_0x36aa7d[_0xbb10('0x3e')](_0x36aa7d[_0xbb10('0x1e')][_0x1c0d8f['id']],_0x1c0d8f);}}}return _0x36aa7d['freshdeskAccounts'];};};Realtime[_0xbb10('0x3f')]['initZohoAccounts']=function(){var _0x33d60a=this;return function(_0x2e21a0){if(_0x2e21a0){freeIsNotKey(_0x2e21a0,_0x33d60a[_0xbb10('0x1f')],'id');for(var _0x3f27ce=0x0,_0x26e66e={};_0x3f27ce<_0x2e21a0[_0xbb10('0x41')];_0x3f27ce+=0x1){_0x26e66e=_0x2e21a0[_0x3f27ce];if(_[_0xbb10('0x43')](_0x33d60a[_0xbb10('0x1f')][_0x26e66e['id']])){_0x33d60a[_0xbb10('0x1f')][_0x26e66e['id']]=new ZohoAccount(_0x26e66e);}else{_0x33d60a[_0xbb10('0x3e')](_0x33d60a[_0xbb10('0x1f')][_0x26e66e['id']],_0x26e66e);}}}return _0x33d60a[_0xbb10('0x1f')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x4a')]=function(){var _0x4475e1=this;return function(_0x5de0cc){if(_0x5de0cc){freeIsNotKey(_0x5de0cc,_0x4475e1[_0xbb10('0x20')],'id');for(var _0x466eb7=0x0,_0x1b83a9={};_0x466eb7<_0x5de0cc[_0xbb10('0x41')];_0x466eb7+=0x1){_0x1b83a9=_0x5de0cc[_0x466eb7];if(_[_0xbb10('0x43')](_0x4475e1[_0xbb10('0x20')][_0x1b83a9['id']])){_0x4475e1['deskAccounts'][_0x1b83a9['id']]=new DeskAccount(_0x1b83a9);}else{_0x4475e1[_0xbb10('0x3e')](_0x4475e1[_0xbb10('0x20')][_0x1b83a9['id']],_0x1b83a9);}}}return _0x4475e1[_0xbb10('0x20')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x4b')]=function(){var _0x22de7f=this;return function(_0x175872){if(_0x175872){freeIsNotKey(_0x175872,_0x22de7f[_0xbb10('0x4c')],'id');for(var _0x205e01=0x0,_0x40c4fb={};_0x205e01<_0x175872[_0xbb10('0x41')];_0x205e01+=0x1){_0x40c4fb=_0x175872[_0x205e01];if(_[_0xbb10('0x43')](_0x22de7f[_0xbb10('0x4c')][_0x40c4fb['id']])){_0x22de7f['sugarcrmAccounts'][_0x40c4fb['id']]=new SugarcrmAccount(_0x40c4fb);}else{_0x22de7f['mergeFromDatabase'](_0x22de7f[_0xbb10('0x4c')][_0x40c4fb['id']],_0x40c4fb);}}}return _0x22de7f[_0xbb10('0x4c')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x4d')]=function(){var _0x5573bb=this;return function(_0x506498){if(_0x506498){freeIsNotKey(_0x506498,_0x5573bb[_0xbb10('0x21')],'id');for(var _0xaf2cc3=0x0,_0x410bef={};_0xaf2cc3<_0x506498[_0xbb10('0x41')];_0xaf2cc3+=0x1){_0x410bef=_0x506498[_0xaf2cc3];if(_[_0xbb10('0x43')](_0x5573bb[_0xbb10('0x21')][_0x410bef['id']])){_0x5573bb[_0xbb10('0x21')][_0x410bef['id']]=new VtigerAccount(_0x410bef);}else{_0x5573bb['mergeFromDatabase'](_0x5573bb[_0xbb10('0x21')][_0x410bef['id']],_0x410bef);}}}return _0x5573bb[_0xbb10('0x21')];};};Realtime['prototype']['initServicenowAccounts']=function(){var _0x5a231f=this;return function(_0x32c1e8){if(_0x32c1e8){freeIsNotKey(_0x32c1e8,_0x5a231f[_0xbb10('0x22')],'id');for(var _0x155dc5=0x0,_0x5bd1c0={};_0x155dc5<_0x32c1e8['length'];_0x155dc5+=0x1){_0x5bd1c0=_0x32c1e8[_0x155dc5];if(_['isUndefined'](_0x5a231f[_0xbb10('0x22')][_0x5bd1c0['id']])){_0x5a231f[_0xbb10('0x22')][_0x5bd1c0['id']]=new ServicenowAccount(_0x5bd1c0);}else{_0x5a231f[_0xbb10('0x3e')](_0x5a231f['servicenowAccounts'][_0x5bd1c0['id']],_0x5bd1c0);}}}return _0x5a231f[_0xbb10('0x22')];};};Realtime[_0xbb10('0x3f')]['initDynamics365Accounts']=function(){var _0x4a560c=this;return function(_0x27d7b9){if(_0x27d7b9){freeIsNotKey(_0x27d7b9,_0x4a560c[_0xbb10('0x23')],'id');for(var _0xd77753=0x0,_0x237246={};_0xd77753<_0x27d7b9['length'];_0xd77753+=0x1){_0x237246=_0x27d7b9[_0xd77753];if(_[_0xbb10('0x43')](_0x4a560c[_0xbb10('0x23')][_0x237246['id']])){_0x4a560c[_0xbb10('0x23')][_0x237246['id']]=new Dynamics365Account(_0x237246);}else{_0x4a560c['mergeFromDatabase'](_0x4a560c[_0xbb10('0x23')][_0x237246['id']],_0x237246);}}}return _0x4a560c[_0xbb10('0x23')];};};Realtime[_0xbb10('0x3f')]['initFreshsalesAccounts']=function(){var _0x2ca491=this;return function(_0x31e85e){if(_0x31e85e){freeIsNotKey(_0x31e85e,_0x2ca491[_0xbb10('0x24')],'id');for(var _0x37b65f=0x0,_0x5e4a6e={};_0x37b65f<_0x31e85e[_0xbb10('0x41')];_0x37b65f+=0x1){_0x5e4a6e=_0x31e85e[_0x37b65f];if(_[_0xbb10('0x43')](_0x2ca491[_0xbb10('0x24')][_0x5e4a6e['id']])){_0x2ca491[_0xbb10('0x24')][_0x5e4a6e['id']]=new FreshsalesAccount(_0x5e4a6e);}else{_0x2ca491['mergeFromDatabase'](_0x2ca491[_0xbb10('0x24')][_0x5e4a6e['id']],_0x5e4a6e);}}}return _0x2ca491[_0xbb10('0x24')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x4e')]=function(){var _0x12f750=this;return function(_0x17807e){for(var _0x1e4694=0x0;_0x1e4694<_0x17807e['length'];_0x1e4694+=0x1){_['merge'](_0x12f750['voiceQueues'][_0x17807e[_0x1e4694][_0xbb10('0x29')]],_0x17807e[_0x1e4694]);}return _0x12f750[_0xbb10('0x4f')];};};Realtime[_0xbb10('0x3f')]['initVoiceQueueReports']=function(){var _0x5cd089=this;return function(_0x46f462){clearVoiceQueues(_0x5cd089[_0xbb10('0x4f')]);if(_0x46f462){_0x46f462=_[_0xbb10('0x50')](_0x46f462,_0xbb10('0x51'));for(var _0x260e06 in _0x46f462){if(_0x46f462[_0xbb10('0x27')](_0x260e06)){for(var _0x4cf2f3=0x0;_0x4cf2f3<_0x46f462[_0x260e06][_0xbb10('0x41')];_0x4cf2f3+=0x1){var _0x15fae2=_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x52')];if(_0x5cd089[_0xbb10('0x4f')][_0x15fae2]){if(_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x53')]){_0x5cd089['voiceQueues'][_0x15fae2]['unmanaged']+=0x1;}if(_0x46f462[_0x260e06][_0x4cf2f3]['queuecallerabandon']){_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x54')]+=0x1;}_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x2e')]+=moment(_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x55')])[_0xbb10('0x56')](moment(_0x46f462[_0x260e06][_0x4cf2f3]['queuecallerjoinAt']),_0xbb10('0x57'))||0x0;if(_0x4cf2f3===_0x46f462[_0x260e06]['length']-0x1){_0x5cd089['voiceQueues'][_0x15fae2]['sumDuration']+=moment(_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x58')]||_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x59')]||_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x5a')])[_0xbb10('0x56')](moment(_0x46f462[_0x260e06][_0x4cf2f3]['queuecallerjoinAt']),_0xbb10('0x57'))||0x0;_0x5cd089['voiceQueues'][_0x15fae2]['total']+=0x1;if(_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x5b')]){_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x2d')]+=0x1;_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x33')]+=moment(_0x46f462[_0x260e06][_0x4cf2f3]['queuecallercompleteAt'])[_0xbb10('0x56')](moment(_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x55')]),_0xbb10('0x57'))||0x0;}}else{_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x2f')]+=_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x2e')]||0x0;}}}}}}return _0x5cd089['voiceQueues'];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x5c')]=function(){var _0x30f3ea=this;return function(_0x322b41){clearVoiceCallReports(_0x30f3ea[_0xbb10('0x5d')]);if(_0x322b41){for(var _0x172be3=0x0;_0x172be3<_0x322b41[_0xbb10('0x41')];_0x172be3+=0x1){_0x30f3ea[_0xbb10('0x5d')]['total']+=0x1;_0x30f3ea[_0xbb10('0x5d')][_0xbb10('0x2f')]+=_0x322b41[_0x172be3][_0xbb10('0x5e')];if(_0x322b41[_0x172be3]['disposition']==='ANSWERED'){_0x30f3ea['outbound'][_0xbb10('0x2d')]+=0x1;_0x30f3ea['outbound']['sumHoldTime']+=_0x322b41[_0x172be3][_0xbb10('0x5e')]-_0x322b41[_0x172be3][_0xbb10('0x5f')]||0x0;_0x30f3ea[_0xbb10('0x5d')][_0xbb10('0x33')]+=_0x322b41[_0x172be3][_0xbb10('0x5f')];}}}return _0x30f3ea[_0xbb10('0x5d')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x60')]=function(){var _0x188b97=this;return function(_0x5206e1){if(_0x5206e1){freeIsNotKey(_0x5206e1,_0x188b97[_0xbb10('0x15')],_0xbb10('0x29'));for(var _0x46b6d2=0x0,_0x35b811={};_0x46b6d2<_0x5206e1['length'];_0x46b6d2+=0x1){_0x35b811=_0x5206e1[_0x46b6d2];if(_['isUndefined'](_0x188b97[_0xbb10('0x15')][_0x35b811[_0xbb10('0x29')]])){_0x188b97[_0xbb10('0x15')][_0x35b811[_0xbb10('0x29')]]=new Campaign(_0x35b811);}else{_0x188b97['mergeFromDatabase'](_0x188b97[_0xbb10('0x15')][_0x35b811[_0xbb10('0x29')]],_0x35b811);_0x188b97[_0xbb10('0x15')][_0x35b811[_0xbb10('0x29')]][_0xbb10('0x61')]=_0x35b811['SquareProject']?_0x35b811['SquareProject'][_0xbb10('0x29')]:undefined;}}}return _0x188b97[_0xbb10('0x15')];};};Realtime[_0xbb10('0x3f')]['initVoiceExtensions']=function(){var _0x256b35=this;return function(_0x13e2ab){if(_0x13e2ab){freeIsNotKey(_0x13e2ab,_0x256b35['voiceExtensions'],'id');for(var _0x5caa06=0x0,_0x2f667f={};_0x5caa06<_0x13e2ab[_0xbb10('0x41')];_0x5caa06+=0x1){_0x2f667f=_0x13e2ab[_0x5caa06];if(_[_0xbb10('0x43')](_0x256b35['voiceExtensions'][_0x2f667f['id']])){_0x256b35[_0xbb10('0x17')][_0x2f667f['id']]=new VoiceExtension(_0x2f667f);}else{_0x256b35[_0xbb10('0x3e')](_0x256b35[_0xbb10('0x17')][_0x2f667f['id']],_0x2f667f);}}}return _0x256b35[_0xbb10('0x17')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x62')]=function(){var _0x45bd4e=this;return function(_0x226363){clearCampaigns(_0x45bd4e[_0xbb10('0x15')]);for(var _0x479d51=0x0;_0x479d51<_0x226363[_0xbb10('0x41')];_0x479d51+=0x1){_[_0xbb10('0x63')](_0x45bd4e[_0xbb10('0x15')][_0x226363[_0x479d51][_0xbb10('0x29')]],_0x226363[_0x479d51]);}return _0x45bd4e[_0xbb10('0x15')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x64')]=function(){var _0x305d52=this;return function(_0x17ed20){if(_0x17ed20){freeIsNotKey(_0x17ed20,_0x305d52[_0xbb10('0x25')],'id');for(var _0x15e043=0x0,_0x2a4278={};_0x15e043<_0x17ed20['length'];_0x15e043+=0x1){_0x2a4278=_0x17ed20[_0x15e043];if(_['isUndefined'](_0x305d52[_0xbb10('0x25')][_0x2a4278['id']])){_0x305d52[_0xbb10('0x25')][_0x2a4278['id']]=new FaxAccount(_0x2a4278);}else{_0x305d52[_0xbb10('0x3e')](_0x305d52[_0xbb10('0x25')][_0x2a4278['id']],_0x2a4278);}}}return _0x305d52[_0xbb10('0x25')];};};Realtime['prototype'][_0xbb10('0x65')]=function(){var _0x332fbe=this;return function(_0x3b4d0b){if(_0x3b4d0b){freeIsNotKey(_0x3b4d0b,_0x332fbe[_0xbb10('0x4f')],_0xbb10('0x29'));for(var _0x379d49=0x0,_0x546db5={};_0x379d49<_0x3b4d0b[_0xbb10('0x41')];_0x379d49+=0x1){_0x546db5=_0x3b4d0b[_0x379d49];if(_[_0xbb10('0x43')](_0x332fbe['voiceQueues'][_0x546db5[_0xbb10('0x29')]])){_0x332fbe['voiceQueues'][_0x546db5[_0xbb10('0x29')]]=new VoiceQueue(_0x546db5);}else{_0x332fbe[_0xbb10('0x3e')](_0x332fbe[_0xbb10('0x4f')][_0x546db5[_0xbb10('0x29')]],_0x546db5);}}}return _0x332fbe[_0xbb10('0x4f')];};};module['exports']=Realtime; \ No newline at end of file diff --git a/server/services/ami/realtime/utils.js b/server/services/ami/realtime/utils.js index e038d15..2a91504 100644 --- a/server/services/ami/realtime/utils.js +++ b/server/services/ami/realtime/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x438f=['assign','hasOwnProperty','mergeDBDataToRealtime'];(function(_0x188794,_0x5d169b){var _0x4bc88c=function(_0x26fa7d){while(--_0x26fa7d){_0x188794['push'](_0x188794['shift']());}};_0x4bc88c(++_0x5d169b);}(_0x438f,0x99));var _0xf438=function(_0x1664fe,_0x31bd8c){_0x1664fe=_0x1664fe-0x0;var _0x36dd20=_0x438f[_0x1664fe];return _0x36dd20;};'use strict';function mergeDBDataToRealtime(_0x357d78,_0x396dbc){var _0x33e6b9=Object[_0xf438('0x0')]({},_0x357d78);for(var _0xcd9735 in _0x396dbc){if(_0x33e6b9[_0xf438('0x1')](_0xcd9735)){_0x33e6b9[_0xcd9735]=_0x396dbc[_0xcd9735];}}return _0x33e6b9;}exports[_0xf438('0x2')]=mergeDBDataToRealtime; \ No newline at end of file +var _0x8310=['mergeDBDataToRealtime','assign','hasOwnProperty'];(function(_0x13553b,_0x10b2c0){var _0x10bcd4=function(_0x2cfc93){while(--_0x2cfc93){_0x13553b['push'](_0x13553b['shift']());}};_0x10bcd4(++_0x10b2c0);}(_0x8310,0xd6));var _0x0831=function(_0x338f73,_0x1945c8){_0x338f73=_0x338f73-0x0;var _0x163fdf=_0x8310[_0x338f73];return _0x163fdf;};'use strict';function mergeDBDataToRealtime(_0x3fccb7,_0x5c98c7){var _0x303417=Object[_0x0831('0x0')]({},_0x3fccb7);for(var _0x543386 in _0x5c98c7){if(_0x303417[_0x0831('0x1')](_0x543386)){_0x303417[_0x543386]=_0x5c98c7[_0x543386];}}return _0x303417;}exports[_0x0831('0x2')]=mergeDBDataToRealtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index a4ced8d..6494b5e 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 _0x71ed=['../rpc/voiceRecording','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','agents','telephones','sync','xdr','custom:voiceQueueReport','bind','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','blindTransfer','attendedTransfer','prototype','findAgent','accountcode','name','find','format','SIP/%s','voiceQueueReport','length','connectedlinenum','interface','isNil','queuecallercomplete','YYYY-MM-DD\x20HH:mm:ss','queuecallerexitAt','create','match','getAgentByInternal','getCallType','channel','outbound','destination','exten','type','dialer','queue','lastdata','context','callerid','from-sip','calleridpreview','calleridnum','originatecalleridnum','destinationchannel','disposition','ANSWERED','calleridname','transfers','linkedid','transfereelinkedid','uniqueid','UserId','split','membername','monitor','monitors','filename','createdAt','xcally-motion-preview','connectedlinename','isArray','forEach','startsWith','Local','substring','indexOf','mobile','phone','lastIndexOf','transfererlinkedid','exports','lodash','moment','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport'];(function(_0x210dac,_0xaeea98){var _0x9a108c=function(_0x546263){while(--_0x546263){_0x210dac['push'](_0x210dac['shift']());}};_0x9a108c(++_0xaeea98);}(_0x71ed,0xab));var _0xd71e=function(_0x56fdb3,_0x41d6c0){_0x56fdb3=_0x56fdb3-0x0;var _0x1f9239=_0x71ed[_0x56fdb3];return _0x1f9239;};'use strict';var _=require(_0xd71e('0x0'));var moment=require(_0xd71e('0x1'));var util=require('util');var config=require(_0xd71e('0x2'));var ami=require(_0xd71e('0x3'));var RpcVoiceAgentReport=require(_0xd71e('0x4'));var RpcVoiceCallReport=require(_0xd71e('0x5'));var RpcVoiceDialReport=require(_0xd71e('0x6'));var RpcMemberReport=require(_0xd71e('0x7'));var RpcVoiceQueueReport=require(_0xd71e('0x8'));var RpcVoiceRecording=require(_0xd71e('0x9'));var RpcVoiceTransferReport=require('../rpc/voiceTransferReport');var VoiceQueueReport=require('./voiceQueueReport');var VoiceCallReport=require(_0xd71e('0xa'));var VoiceAgentReport=require(_0xd71e('0xb'));var VoiceDialReport=require(_0xd71e('0xc'));var UserReport=require(_0xd71e('0xd'));function Report(_0x53f6d3){this[_0xd71e('0xe')]=_0x53f6d3;this[_0xd71e('0xf')]=_0x53f6d3[_0xd71e('0xf')];this['telephones']=_0x53f6d3[_0xd71e('0x10')];}Report['prototype'][_0xd71e('0x11')]=function(_0xd317b){var _0x27a486=new VoiceQueueReport(this[_0xd71e('0xe')]);var _0x515a4c=new VoiceAgentReport(this[_0xd71e('0xe')]);var _0x49733a=new VoiceDialReport(this[_0xd71e('0xe')]);var _0x3e58c5=new VoiceCallReport(this[_0xd71e('0xe')]);var _0x3a01d2=new UserReport(this['realtime']);if(config[_0xd71e('0x12')]&&config[_0xd71e('0x12')]['disabled']){ami['on'](_0xd71e('0x13'),this['voiceQueueReport'][_0xd71e('0x14')](this));ami['on']('custom:voiceCallReport',this[_0xd71e('0x15')][_0xd71e('0x14')](this));ami['on'](_0xd71e('0x16'),this[_0xd71e('0x17')][_0xd71e('0x14')](this));ami['on'](_0xd71e('0x18'),this[_0xd71e('0x19')][_0xd71e('0x14')](this));ami['on'](_0xd71e('0x1a'),this[_0xd71e('0x1b')]['bind'](this));ami['on']('attendedtransfer',this[_0xd71e('0x1c')]['bind'](this));}};Report[_0xd71e('0x1d')][_0xd71e('0x1e')]=function(_0x2dc1c2){var _0x3e66df;_0x3e66df=_['find'](this['agents'],function(_0x22f13f){return _0x22f13f[_0xd71e('0x1f')]==_0x2dc1c2||_0x22f13f[_0xd71e('0x20')]==_0x2dc1c2;});if(_['isNil'](_0x3e66df)){var _0x930b2e=_[_0xd71e('0x21')](this[_0xd71e('0x10')],function(_0x421121){return _0x421121[_0xd71e('0x1f')]==_0x2dc1c2||_0x421121[_0xd71e('0x20')]==_0x2dc1c2;});if(_0x930b2e){_0x3e66df=_['find'](this[_0xd71e('0xf')],function(_0x569535){return _0x569535['interface']==util[_0xd71e('0x22')](_0xd71e('0x23'),_0x930b2e[_0xd71e('0x20')]);});}}return _0x3e66df;};Report['prototype'][_0xd71e('0x24')]=function(_0x43b5b9){for(var _0x21d902=0x0;_0x21d902<_0x43b5b9[_0xd71e('0x25')];_0x21d902+=0x1){var _0x21c2bc=this[_0xd71e('0x1e')](_0x43b5b9[_0x21d902][_0xd71e('0x26')]);if(_0x21c2bc){_0x43b5b9[_0x21d902]['accountcode']=_0x21c2bc[_0xd71e('0x1f')];_0x43b5b9[_0x21d902]['assigned']=!![];_0x43b5b9[_0x21d902]['lastAssignedTo']=_0x21c2bc[_0xd71e('0x20')];_0x43b5b9[_0x21d902][_0xd71e('0x27')]=_[_0xd71e('0x28')](_0x21c2bc[_0xd71e('0x27')])?util[_0xd71e('0x22')](_0xd71e('0x23'),_0x21c2bc[_0xd71e('0x20')]):_0x21c2bc[_0xd71e('0x27')];if(_0x43b5b9[_0x21d902][_0xd71e('0x29')]){_0x43b5b9[_0x21d902]['queuecallercompleteAt']=moment()[_0xd71e('0x22')](_0xd71e('0x2a'));}if(_0x43b5b9[_0x21d902]['queuecallerexit']){_0x43b5b9[_0x21d902][_0xd71e('0x2b')]=moment()[_0xd71e('0x22')](_0xd71e('0x2a'));}RpcMemberReport[_0xd71e('0x24')](_0x43b5b9[_0x21d902]);}RpcVoiceQueueReport[_0xd71e('0x2c')](_0x43b5b9[_0x21d902]);}};function extractCalleridNumber(_0x2daf02){var _0x1318c3=_0x2daf02[_0xd71e('0x2d')](/<(.*?)>/);return _0x1318c3?_0x1318c3[0x1]:_0x2daf02;}Report[_0xd71e('0x1d')][_0xd71e('0x2e')]=function(_0x540da0){for(var _0x55430f=0x0;_0x55430f',_0x710cfe[_0xd71e('0x41')],_0x710cfe[_0xd71e('0x3c')]);}if(RpcVoiceTransferReport[_0xd71e('0x42')][_0x710cfe[_0xd71e('0x43')]]){var _0x373103=RpcVoiceTransferReport[_0xd71e('0x42')][_0x710cfe[_0xd71e('0x43')]];_0x373103[_0xd71e('0x44')]=_0x710cfe[_0xd71e('0x45')];RpcVoiceTransferReport[_0xd71e('0x1b')](_0x373103);delete RpcVoiceTransferReport[_0xd71e('0x42')][_0x710cfe[_0xd71e('0x43')]];}if(_['isNil'](_0x710cfe[_0xd71e('0x34')])){_0x710cfe['type']=this[_0xd71e('0x2f')](_0x710cfe);}if(_[_0xd71e('0x28')](_0x710cfe[_0xd71e('0x46')])){var _0x5defc8=_0x710cfe[_0xd71e('0x30')][_0xd71e('0x47')]('-')[0x0];var _0x482efb=this[_0xd71e('0xf')][_0x5defc8];if(!_0x482efb)_0x482efb=this['getAgentByInternal'](_0x710cfe[_0xd71e('0x1f')]);if(_0x482efb){_0x710cfe['UserId']=_0x482efb['id'];_0x710cfe[_0xd71e('0x48')]=_0x482efb[_0xd71e('0x20')];}}RpcVoiceCallReport[_0xd71e('0x2c')](_0x710cfe);if(_0x710cfe[_0xd71e('0x49')]){for(var _0x3b21a1=0x0;_0x3b21a1<_0x710cfe[_0xd71e('0x4a')][_0xd71e('0x25')];_0x3b21a1+=0x1){_0x710cfe['monitorFilename']=_0x710cfe['monitors'][_0x3b21a1][_0xd71e('0x4b')];_0x710cfe[_0xd71e('0x4c')]=_0x710cfe[_0xd71e('0x4a')][_0x3b21a1][_0xd71e('0x4c')];if(_0x710cfe[_0xd71e('0x33')]==_0xd71e('0x4d')){_0x710cfe[_0xd71e('0x3c')]=_0x710cfe['connectedlinenum'];_0x710cfe[_0xd71e('0x41')]=_0x710cfe[_0xd71e('0x4e')];_0x710cfe[_0xd71e('0x26')]=_0x710cfe[_0xd71e('0x1f')];_0x710cfe[_0xd71e('0x4e')]=_0x710cfe[_0xd71e('0x48')];_0x710cfe[_0xd71e('0x33')]=_0x710cfe[_0xd71e('0x3d')];}else if(_0x710cfe[_0xd71e('0x33')]=='xcally-motion-dialer'){_0x710cfe[_0xd71e('0x3c')]=_0x710cfe[_0xd71e('0x32')];_0x710cfe[_0xd71e('0x33')]=_0x710cfe[_0xd71e('0x3d')];}RpcVoiceRecording['create'](_0x710cfe);}}};Report[_0xd71e('0x1d')]['voiceAgentReport']=function(_0x32afe6){if(_[_0xd71e('0x4f')](_0x32afe6)){_0x32afe6[_0xd71e('0x50')](function(_0xaa0a82){RpcVoiceAgentReport['create'](_0xaa0a82);});}else{RpcVoiceAgentReport[_0xd71e('0x2c')](_0x32afe6);}};Report[_0xd71e('0x1d')][_0xd71e('0x19')]=function(_0x3ce8ec){RpcVoiceDialReport[_0xd71e('0x2c')](_0x3ce8ec);var _0x4dc1d4;var _0x5b09db;var _0x180336=_0x3ce8ec[_0xd71e('0x30')];if(_[_0xd71e('0x51')](_0x180336,_0xd71e('0x52'))){_0x5b09db=_0x180336[_0xd71e('0x53')](_0x180336[_0xd71e('0x54')]('/')+0x1,_0x180336[_0xd71e('0x54')]('@'));_0x4dc1d4=_[_0xd71e('0x21')](this['agents'],function(_0x87632a){return _0x87632a[_0xd71e('0x55')]==_0x5b09db||_0x87632a[_0xd71e('0x56')]==_0x5b09db||_0x87632a['accountcode']==_0x5b09db;});}else{_0x5b09db=_0x180336[_0xd71e('0x53')](_0x180336[_0xd71e('0x54')]('/')+0x1,_0x180336[_0xd71e('0x57')]('-'));_0x4dc1d4=this[_0xd71e('0x1e')](_0x5b09db);}if(_0x4dc1d4){_0x3ce8ec[_0xd71e('0x27')]=_[_0xd71e('0x28')](_0x4dc1d4[_0xd71e('0x27')])?util['format'](_0xd71e('0x23'),_0x4dc1d4['name']):_0x4dc1d4[_0xd71e('0x27')];_0x3ce8ec[_0xd71e('0x48')]=_0x4dc1d4[_0xd71e('0x20')];_0x3ce8ec[_0xd71e('0x1f')]=_0x4dc1d4[_0xd71e('0x1f')];RpcMemberReport[_0xd71e('0x19')](_0x3ce8ec);}};Report[_0xd71e('0x1d')][_0xd71e('0x1b')]=function(_0x2b6d2d){RpcVoiceTransferReport['transfers'][_0x2b6d2d[_0xd71e('0x58')]]=_0x2b6d2d;};Report[_0xd71e('0x1d')][_0xd71e('0x1c')]=function(_0x2af3a3){RpcVoiceTransferReport[_0xd71e('0x1c')](_0x2af3a3);};module[_0xd71e('0x59')]=Report; \ No newline at end of file +var _0xec78=['./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','agents','telephones','prototype','sync','realtime','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','bind','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','findAgent','accountcode','name','isNil','find','interface','length','connectedlinenum','lastAssignedTo','format','SIP/%s','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','create','keys','channel','outbound','destination','type','lastapplication','queue','lastdata','context','from-voip-provider','callerid','from-sip','xcally-motion-preview','calleridpreview','calleridnum','originatecalleridnum','destinationchannel','ANSWERED','\x22%s\x22\x20<%s>','calleridname','transfers','linkedid','transfereelinkedid','uniqueid','UserId','split','membername','monitor','monitors','monitorFilename','createdAt','exten','connectedlinename','xcally-motion-dialer','forEach','voiceDialReport','Local','substring','indexOf','mobile','lastIndexOf','attendedTransfer','exports','lodash','moment','../../../config/environment','../ami','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0xec78,0x109));var _0x8ec7=function(_0x4bd06e,_0x593701){_0x4bd06e=_0x4bd06e-0x0;var _0x85ebb=_0xec78[_0x4bd06e];return _0x85ebb;};'use strict';var _=require(_0x8ec7('0x0'));var moment=require(_0x8ec7('0x1'));var util=require('util');var config=require(_0x8ec7('0x2'));var ami=require(_0x8ec7('0x3'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require(_0x8ec7('0x4'));var RpcVoiceDialReport=require(_0x8ec7('0x5'));var RpcMemberReport=require(_0x8ec7('0x6'));var RpcVoiceQueueReport=require(_0x8ec7('0x7'));var RpcVoiceRecording=require(_0x8ec7('0x8'));var RpcVoiceTransferReport=require(_0x8ec7('0x9'));var VoiceQueueReport=require(_0x8ec7('0xa'));var VoiceCallReport=require(_0x8ec7('0xb'));var VoiceAgentReport=require(_0x8ec7('0xc'));var VoiceDialReport=require(_0x8ec7('0xd'));var UserReport=require(_0x8ec7('0xe'));function Report(_0x265d34){this['realtime']=_0x265d34;this[_0x8ec7('0xf')]=_0x265d34[_0x8ec7('0xf')];this[_0x8ec7('0x10')]=_0x265d34[_0x8ec7('0x10')];}Report[_0x8ec7('0x11')][_0x8ec7('0x12')]=function(_0x1ff17f){var _0x343584=new VoiceQueueReport(this['realtime']);var _0x3f2b76=new VoiceAgentReport(this[_0x8ec7('0x13')]);var _0x257401=new VoiceDialReport(this['realtime']);var _0x3bdd20=new VoiceCallReport(this['realtime']);var _0x1b10c8=new UserReport(this['realtime']);if(config[_0x8ec7('0x14')]&&config['xdr'][_0x8ec7('0x15')]){ami['on'](_0x8ec7('0x16'),this[_0x8ec7('0x17')][_0x8ec7('0x18')](this));ami['on']('custom:voiceCallReport',this[_0x8ec7('0x19')]['bind'](this));ami['on'](_0x8ec7('0x1a'),this[_0x8ec7('0x1b')][_0x8ec7('0x18')](this));ami['on'](_0x8ec7('0x1c'),this['voiceDialReport'][_0x8ec7('0x18')](this));ami['on'](_0x8ec7('0x1d'),this[_0x8ec7('0x1e')]['bind'](this));ami['on'](_0x8ec7('0x1f'),this['attendedTransfer'][_0x8ec7('0x18')](this));}};Report[_0x8ec7('0x11')][_0x8ec7('0x20')]=function(_0x701b92){var _0x58524a;_0x58524a=_['find'](this[_0x8ec7('0xf')],function(_0x5daa58){return _0x5daa58[_0x8ec7('0x21')]==_0x701b92||_0x5daa58[_0x8ec7('0x22')]==_0x701b92;});if(_[_0x8ec7('0x23')](_0x58524a)){var _0x4e41cc=_[_0x8ec7('0x24')](this[_0x8ec7('0x10')],function(_0x3871d6){return _0x3871d6[_0x8ec7('0x21')]==_0x701b92||_0x3871d6[_0x8ec7('0x22')]==_0x701b92;});if(_0x4e41cc){_0x58524a=_[_0x8ec7('0x24')](this[_0x8ec7('0xf')],function(_0x32d9bf){return _0x32d9bf[_0x8ec7('0x25')]==util['format']('SIP/%s',_0x4e41cc[_0x8ec7('0x22')]);});}}return _0x58524a;};Report['prototype'][_0x8ec7('0x17')]=function(_0x3a7da8){for(var _0x44aaca=0x0;_0x44aaca<_0x3a7da8[_0x8ec7('0x26')];_0x44aaca+=0x1){var _0x35a4e0=this[_0x8ec7('0x20')](_0x3a7da8[_0x44aaca][_0x8ec7('0x27')]);if(_0x35a4e0){_0x3a7da8[_0x44aaca][_0x8ec7('0x21')]=_0x35a4e0[_0x8ec7('0x21')];_0x3a7da8[_0x44aaca]['assigned']=!![];_0x3a7da8[_0x44aaca][_0x8ec7('0x28')]=_0x35a4e0['name'];_0x3a7da8[_0x44aaca][_0x8ec7('0x25')]=_['isNil'](_0x35a4e0[_0x8ec7('0x25')])?util[_0x8ec7('0x29')](_0x8ec7('0x2a'),_0x35a4e0[_0x8ec7('0x22')]):_0x35a4e0[_0x8ec7('0x25')];if(_0x3a7da8[_0x44aaca][_0x8ec7('0x2b')]){_0x3a7da8[_0x44aaca][_0x8ec7('0x2c')]=moment()[_0x8ec7('0x29')](_0x8ec7('0x2d'));}if(_0x3a7da8[_0x44aaca][_0x8ec7('0x2e')]){_0x3a7da8[_0x44aaca][_0x8ec7('0x2f')]=moment()[_0x8ec7('0x29')](_0x8ec7('0x2d'));}RpcMemberReport[_0x8ec7('0x17')](_0x3a7da8[_0x44aaca]);}RpcVoiceQueueReport[_0x8ec7('0x30')](_0x3a7da8[_0x44aaca]);}};function extractCalleridNumber(_0x1cb686){var _0x421362=_0x1cb686['match'](/<(.*?)>/);return _0x421362?_0x421362[0x1]:_0x1cb686;}Report[_0x8ec7('0x11')]['getAgentByInternal']=function(_0x473895){for(var _0x4fd9ff=0x0;_0x4fd9ff0x0?!![]:![];if(!_0x481a17){return this['syncQueueSummaryComplete'](this[_0x55cb('0x15')][_0x55cb('0x6e')]);}};VoiceQueueReport[_0x55cb('0x3a')][_0x55cb('0x1d')]=function(_0x13e16a){var _0x205421=this[_0x55cb('0x15')]['id'];if(this[_0x55cb('0x15')]['queuestatus'][_0x205421]&&this[_0x55cb('0x15')][_0x55cb('0x61')][_0x205421][_0x13e16a[_0x55cb('0x5f')]]){this['summary']['queuestatus'][_0x205421][_0x13e16a[_0x55cb('0x5f')]][_0x55cb('0x11')][_0x55cb('0x6f')](_0x13e16a);}};VoiceQueueReport[_0x55cb('0x3a')][_0x55cb('0x18')]=function(_0x23619c){var _0x10d991=this;try{if(this[_0x55cb('0x70')](_0x23619c)&&this[_0x55cb('0x70')](_0x23619c[_0x55cb('0x6a')])){logger[_0x55cb('0x4e')]('[voiceQueueReport][queuesummary]\x20event:',util['inspect'](_0x23619c,{'showHidden':![],'depth':null}));var _0x27349c=this['voiceQueues'][_0x23619c['queue']];if(_0x27349c){logger[_0x55cb('0x4e')](_0x55cb('0x71'),_0x27349c[_0x55cb('0x5b')]);this[_0x55cb('0x15')][_0x55cb('0x64')][_0x27349c[_0x55cb('0x5b')]]={'summaryEvent':_0x23619c};this['summary'][_0x55cb('0x6d')]+=0x1;return ami[_0x55cb('0x5d')]({'action':_0x55cb('0x61'),'queue':_0x27349c[_0x55cb('0x5b')]})['then'](function(_0x117af2){if(!_0x10d991[_0x55cb('0x15')]['queuestatus'][_0x23619c['actionid']]){_0x10d991[_0x55cb('0x15')][_0x55cb('0x61')][_0x23619c['actionid']]={};}_0x10d991[_0x55cb('0x15')][_0x55cb('0x61')][_0x23619c[_0x55cb('0x5f')]][_0x117af2['actionid']]={'queue':_0x27349c[_0x55cb('0x5b')],'agents':[]};})['catch'](function(_0x6d95c4){throw _0x6d95c4;});}}}catch(_0x3930e6){logger[_0x55cb('0x43')](_0x55cb('0x62'),util[_0x55cb('0x45')](_0x3930e6,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x55cb('0x1b')]=function(_0x51ec72){if(this[_0x55cb('0x15')]['statusRequests']>0x0){this[_0x55cb('0x15')][_0x55cb('0x6e')]=_0x51ec72;return;}logger[_0x55cb('0x4e')](_0x55cb('0x72'),util[_0x55cb('0x45')](_0x51ec72,{'showHidden':![],'depth':null}));this[_0x55cb('0x15')]=initializeSummary();ami['emit'](_0x55cb('0x73'),{});};VoiceQueueReport[_0x55cb('0x3a')]['syncQueueCallerJoin']=function(_0x53e7a3){try{if(this[_0x55cb('0x70')](_0x53e7a3)){logger[_0x55cb('0x4e')]('[%s][voiceQueueReport][queuecallerjoin]',_0x53e7a3['uniqueid'],util[_0x55cb('0x45')](_0x53e7a3,{'showHidden':![],'depth':null}));if(_['isUndefined'](this[_0x55cb('0xf')][_0x53e7a3[_0x55cb('0x74')]])){this[_0x55cb('0xf')][_0x53e7a3[_0x55cb('0x74')]]=[];}if(_['isUndefined'](this[_0x55cb('0x12')][_0x53e7a3[_0x55cb('0x74')]])){this[_0x55cb('0x12')][_0x53e7a3[_0x55cb('0x74')]]={};}var _0x3c0aa8=new QueueReport();_0x3c0aa8[_0x55cb('0x6a')]=_0x53e7a3[_0x55cb('0x6a')];_0x3c0aa8[_0x55cb('0x59')]=this[_0x55cb('0x14')][_0x3c0aa8['queue']]&&this[_0x55cb('0x14')][_0x3c0aa8['queue']][_0x55cb('0x59')]?this['voiceQueues'][_0x3c0aa8[_0x55cb('0x6a')]]['type']||_0x55cb('0x5a'):_0x55cb('0x5a');_0x3c0aa8[_0x55cb('0x75')]=moment()['format'](_0x55cb('0x76'));_0x3c0aa8[_0x55cb('0x77')]=_0x53e7a3[_0x55cb('0x77')];_0x3c0aa8['count']=_0x53e7a3[_0x55cb('0x78')];_0x3c0aa8[_0x55cb('0x74')]=_0x53e7a3[_0x55cb('0x74')];logger[_0x55cb('0x79')](_0x55cb('0x7a'),_0x3c0aa8[_0x55cb('0x6a')],_0x3c0aa8[_0x55cb('0x59')]);Object[_0x55cb('0x68')](_0x3c0aa8,_[_0x55cb('0x7b')](_0x53e7a3,_['keys'](_0x3c0aa8)));this[_0x55cb('0xf')][_0x53e7a3[_0x55cb('0x74')]][_0x55cb('0x6f')](_0x3c0aa8);this['channels'][_0x53e7a3[_0x55cb('0x74')]]=_0x3c0aa8;this['emitVoiceQueueChannelSave'](_0x3c0aa8,'queuecallerjoin');}}catch(_0x3f24d6){logger[_0x55cb('0x43')](_0x55cb('0x7c'),_0x53e7a3[_0x55cb('0x74')],util['inspect'](_0x3f24d6,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x55cb('0x3a')][_0x55cb('0x7d')]=function(_0x141e85){try{if(this[_0x55cb('0x70')](_0x141e85)){logger[_0x55cb('0x4e')]('[%s][voiceQueueReport][queuecallerabandon]',_0x141e85[_0x55cb('0x74')],util[_0x55cb('0x45')](_0x141e85,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x141e85[_0x55cb('0x74')]]){var _0x346a96=_['last'](this[_0x55cb('0xf')][_0x141e85[_0x55cb('0x74')]]);_0x346a96[_0x55cb('0x39')]=![];_0x346a96[_0x55cb('0x7e')]=null;_0x346a96[_0x55cb('0x7f')]=_0x141e85[_0x55cb('0x7f')];_0x346a96[_0x55cb('0x80')]=_0x141e85[_0x55cb('0x80')];_0x346a96[_0x55cb('0x38')]=!![];_0x346a96[_0x55cb('0x81')]=moment()[_0x55cb('0x51')](_0x55cb('0x76'));_0x346a96[_0x55cb('0x82')]=_0x55cb('0x83');_0x346a96[_0x55cb('0x84')]=null;logger[_0x55cb('0x79')]('[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s',_0x346a96[_0x55cb('0x6a')],_0x346a96[_0x55cb('0x59')]);this[_0x55cb('0x12')][_0x141e85[_0x55cb('0x74')]]=_0x346a96;this[_0x55cb('0x4a')](_0x346a96,_0x55cb('0x38'));}}}catch(_0x5bbab3){logger[_0x55cb('0x43')]('[%s][voiceQueueReport][queuecallerabandon]',_0x141e85[_0x55cb('0x74')],util[_0x55cb('0x45')](_0x5bbab3,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x55cb('0x3a')]['syncQueueCallerLeave']=function(_0x4e17b1){try{if(this[_0x55cb('0x70')](_0x4e17b1)){logger['debug'](_0x55cb('0x85'),_0x4e17b1[_0x55cb('0x74')],util[_0x55cb('0x45')](_0x4e17b1,{'showHidden':![],'depth':null}));if(this[_0x55cb('0xf')][_0x4e17b1[_0x55cb('0x74')]]){var _0x58ea0e=_[_0x55cb('0x86')](this[_0x55cb('0xf')][_0x4e17b1[_0x55cb('0x74')]]);_0x58ea0e['queuecallerleaveAt']=moment()[_0x55cb('0x51')](_0x55cb('0x76'));_0x58ea0e[_0x55cb('0x87')]=_0x4e17b1[_0x55cb('0x87')];_0x58ea0e[_0x55cb('0x88')]=_0x4e17b1[_0x55cb('0x88')];logger[_0x55cb('0x79')](_0x55cb('0x89'),_0x58ea0e[_0x55cb('0x6a')],_0x58ea0e[_0x55cb('0x59')],_0x4e17b1[_0x55cb('0x87')],_0x4e17b1[_0x55cb('0x88')]);this[_0x55cb('0x12')][_0x4e17b1[_0x55cb('0x74')]]=_0x58ea0e;this['emitVoiceQueueChannelSave'](_0x58ea0e,_0x55cb('0x8a'));}}}catch(_0x550d8f){logger[_0x55cb('0x43')](_0x55cb('0x85'),_0x4e17b1[_0x55cb('0x74')],util['inspect'](_0x550d8f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x55cb('0x3a')][_0x55cb('0x24')]=function(_0x32ce9d){try{if(this[_0x55cb('0x70')](_0x32ce9d)){logger[_0x55cb('0x4e')](_0x55cb('0x8b'),_0x32ce9d[_0x55cb('0x74')],util[_0x55cb('0x45')](_0x32ce9d,{'showHidden':![],'depth':null}));if(this[_0x55cb('0xf')][_0x32ce9d['uniqueid']]){var _0x1b8d19=_[_0x55cb('0x86')](this[_0x55cb('0xf')][_0x32ce9d[_0x55cb('0x74')]]);_0x1b8d19['queuecallercomplete']=!![];_0x1b8d19['queuecallerexitreason']=_0x55cb('0x8c');logger[_0x55cb('0x79')]('[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT',_0x1b8d19[_0x55cb('0x6a')],_0x1b8d19[_0x55cb('0x59')]);}}}catch(_0x41ef7e){logger[_0x55cb('0x43')]('[%s][voiceQueueReport][agentconnect]',_0x32ce9d[_0x55cb('0x74')],util['inspect'](_0x41ef7e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x55cb('0x3a')][_0x55cb('0x8d')]=function(_0x15d36f){try{if(this[_0x55cb('0x70')](_0x15d36f)){logger[_0x55cb('0x4e')](_0x55cb('0x8e'),_0x15d36f[_0x55cb('0x74')],util[_0x55cb('0x45')](_0x15d36f,{'showHidden':![],'depth':null}));if(this[_0x55cb('0xf')][_0x15d36f[_0x55cb('0x74')]]){var _0x7c7699=_[_0x55cb('0x86')](this[_0x55cb('0xf')][_0x15d36f[_0x55cb('0x74')]]);_0x7c7699['queuecallerabandon']=![];_0x7c7699[_0x55cb('0x81')]=null;_0x7c7699[_0x55cb('0x8f')]=!![];_0x7c7699[_0x55cb('0x84')]=_0x15d36f[_0x55cb('0x90')];_0x7c7699['holdtime']=_0x15d36f['holdtime'];_0x7c7699[_0x55cb('0x39')]=!![];_0x7c7699[_0x55cb('0x91')]=![];_0x7c7699['queuecallerexitAt']=null;if(!_0x7c7699[_0x55cb('0x92')]){if(_0x15d36f['reason']==_0x55cb('0x92')){_0x7c7699[_0x55cb('0x82')]=_0x55cb('0x93');logger[_0x55cb('0x79')](_0x55cb('0x94'),_0x7c7699['queue'],_0x7c7699[_0x55cb('0x59')]);}else{if(_['startsWith'](_0x15d36f[_0x55cb('0x3f')]['toLowerCase'](),'local/')){if(this['queueReports'][_0x15d36f[_0x55cb('0x95')]]){var _0x36ec2f=_[_0x55cb('0x86')](this['queueReports'][_0x15d36f[_0x55cb('0x95')]]);_0x36ec2f[_0x55cb('0x39')]=![];_0x36ec2f[_0x55cb('0x91')]=!![];_0x36ec2f[_0x55cb('0x96')]=moment(_0x7c7699[_0x55cb('0x75')])[_0x55cb('0x97')](_0x15d36f[_0x55cb('0x7f')],_0x55cb('0x98'))[_0x55cb('0x51')](_0x55cb('0x76'));_0x36ec2f[_0x55cb('0x82')]='FORWARDTRANSFER';_0x36ec2f[_0x55cb('0x92')]=!![];_0x36ec2f['transfertype']=_0x55cb('0x99');_0x36ec2f[_0x55cb('0x9a')]=_0x15d36f[_0x55cb('0x9b')];_0x36ec2f[_0x55cb('0x9c')]=_0x15d36f[_0x55cb('0x74')];logger[_0x55cb('0x79')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER',_0x36ec2f[_0x55cb('0x6a')],_0x36ec2f['type']);var _0x490a6a=this['queueReports'][_0x15d36f[_0x55cb('0x95')]];this[_0x55cb('0xf')][_0x15d36f['linkedid']]=this[_0x55cb('0xf')][_0x15d36f[_0x55cb('0x74')]];this['queueReports'][_0x15d36f[_0x55cb('0x74')]]=_0x490a6a;}}else{_0x7c7699[_0x55cb('0x82')]='COMPLETEDBY'+_0x15d36f[_0x55cb('0x9d')][_0x55cb('0x9e')]();logger[_0x55cb('0x79')](_0x55cb('0x9f'),_0x7c7699[_0x55cb('0x6a')],_0x7c7699[_0x55cb('0x59')],_0x7c7699[_0x55cb('0x82')]);}}}this[_0x55cb('0x12')][_0x15d36f[_0x55cb('0x74')]]=_0x7c7699;}}}catch(_0x39901e){logger[_0x55cb('0x43')](_0x55cb('0x8e'),_0x15d36f[_0x55cb('0x74')],util['inspect'](_0x39901e,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x55cb('0x26')]=function(_0x43114d){try{if(this['isNotNull'](_0x43114d)){logger[_0x55cb('0x4e')](_0x55cb('0xa0'),_0x43114d[_0x55cb('0x74')],util[_0x55cb('0x45')](_0x43114d,{'showHidden':![],'depth':null}));this[_0x55cb('0xa1')](_0x43114d['uniqueid'],_[_0x55cb('0xa2')](_0x43114d[_0x55cb('0xa3')])[0x0],_0x43114d[_0x55cb('0xa4')]);if(this[_0x55cb('0xf')][_0x43114d['uniqueid']]){var _0x4712ab=_['last'](this['queueReports'][_0x43114d[_0x55cb('0x74')]]);if(_0x4712ab){if(this[_0x55cb('0x70')](_0x43114d[_0x55cb('0xa3')])&&this[_0x55cb('0x70')](_0x43114d[_0x55cb('0xa3')][_0x55cb('0x61')])){switch(_0x43114d[_0x55cb('0xa4')]){case _0x55cb('0xa5'):_0x4712ab[_0x55cb('0x91')]=![];_0x4712ab[_0x55cb('0x96')]=null;break;case _0x55cb('0xa6'):_0x4712ab[_0x55cb('0xa7')]=_0x55cb('0xa8');_0x4712ab[_0x55cb('0x91')]=!![];_0x4712ab[_0x55cb('0x96')]=moment()[_0x55cb('0x51')](_0x55cb('0x76'));_0x4712ab['queuecallerleaveAt']=moment()[_0x55cb('0x51')](_0x55cb('0x76'));logger[_0x55cb('0x4e')](_0x55cb('0xa9'),_0x43114d[_0x55cb('0x74')],util[_0x55cb('0x45')](_0x4712ab,{'showHidden':![],'depth':null}));ami['emit'](_0x55cb('0xaa'),_0x4712ab);break;default:_0x4712ab[_0x55cb('0x91')]=!![];_0x4712ab['queuecallerexitAt']=moment()['format'](_0x55cb('0x76'));_0x4712ab[_0x55cb('0xab')]=moment()[_0x55cb('0x51')](_0x55cb('0x76'));}_0x4712ab[_0x55cb('0x38')]=![];_0x4712ab[_0x55cb('0x81')]=null;_0x4712ab['queuecallerexitreason']=_0x43114d[_0x55cb('0xa4')];this[_0x55cb('0x12')][_0x43114d[_0x55cb('0x74')]]=_0x4712ab;this[_0x55cb('0x4a')](_0x4712ab,'varset');}else if(this[_0x55cb('0x70')](_0x43114d[_0x55cb('0xa3')])&&this['isNotNull'](_0x43114d[_0x55cb('0xa3')][_0x55cb('0xac')])){if(!_0x4712ab[_0x55cb('0x38')]){_0x4712ab[_0x55cb('0x91')]=!![];_0x4712ab[_0x55cb('0x96')]=moment()['format'](_0x55cb('0x76'));_0x4712ab[_0x55cb('0x82')]=_0x55cb('0xad');_0x4712ab[_0x55cb('0xab')]=moment()[_0x55cb('0x51')](_0x55cb('0x76'));this[_0x55cb('0x12')][_0x43114d[_0x55cb('0x74')]]=_0x4712ab;}}logger[_0x55cb('0x79')]('[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s',_0x43114d['uniqueid'],_0x4712ab[_0x55cb('0x6a')],_0x4712ab['type'],_[_0x55cb('0xa2')](_0x43114d['variable'])[0x0],_0x43114d[_0x55cb('0xa4')]);_0x4712ab[_0x55cb('0x16')]=this[_0x55cb('0x16')][_0x43114d[_0x55cb('0x74')]];}}}}catch(_0x279464){logger[_0x55cb('0x43')](_0x55cb('0xa0'),_0x43114d[_0x55cb('0x74')],util[_0x55cb('0x45')](_0x279464,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x55cb('0x3a')][_0x55cb('0xa1')]=function(_0x2be516,_0x5c277e,_0x482861){var _0x403b07=[_0x55cb('0xae'),'rtpaudioqosbridged','rtpaudioqosjitter',_0x55cb('0xaf'),_0x55cb('0xb0'),_0x55cb('0xb1'),_0x55cb('0xb2'),_0x55cb('0xb3'),_0x55cb('0xb4'),_0x55cb('0xb5'),_0x55cb('0xb6'),_0x55cb('0xb7'),'membercalls',_0x55cb('0xb8'),_0x55cb('0xb9'),'memberlastcall','membername',_0x55cb('0xba'),_0x55cb('0xbb')];if(!_['isNil'](_0x5c277e)&&!_['includes'](_0x403b07,_0x5c277e)){if(_[_0x55cb('0x5c')](this[_0x55cb('0x16')][_0x2be516])){this[_0x55cb('0x16')][_0x2be516]={};}this[_0x55cb('0x16')][_0x2be516][_0x5c277e]=_0x482861;}};VoiceQueueReport['prototype'][_0x55cb('0xbc')]=function(_0x5c96f1,_0x43bf5d,_0x305417){try{var _0x13996c={};if(this[_0x55cb('0xf')][_0x5c96f1]){for(var _0x475fc5=0x0;_0x475fc50x0?!![]:![];if(!_0x5a806d){return this[_0x8fc2('0x16')](this[_0x8fc2('0x10')]['completeEvent']);}};VoiceQueueReport[_0x8fc2('0x8')][_0x8fc2('0x17')]=function(_0x24ce3f){var _0x4ae8c=this[_0x8fc2('0x10')]['id'];if(this[_0x8fc2('0x10')]['queuestatus'][_0x4ae8c]&&this['summary'][_0x8fc2('0x61')][_0x4ae8c][_0x24ce3f[_0x8fc2('0x69')]]){this[_0x8fc2('0x10')][_0x8fc2('0x61')][_0x4ae8c][_0x24ce3f[_0x8fc2('0x69')]][_0x8fc2('0xc')][_0x8fc2('0x6d')](_0x24ce3f);}};VoiceQueueReport[_0x8fc2('0x8')][_0x8fc2('0x13')]=function(_0x331ed0){var _0x2b94df=this;try{if(this[_0x8fc2('0x5b')](_0x331ed0)&&this['isNotNull'](_0x331ed0[_0x8fc2('0x4f')])){logger[_0x8fc2('0x4b')](_0x8fc2('0x6e'),util[_0x8fc2('0x43')](_0x331ed0,{'showHidden':![],'depth':null}));var _0x10d8d1=this[_0x8fc2('0xe')][_0x331ed0['queue']];if(_0x10d8d1){logger[_0x8fc2('0x4b')]('[voiceQueueReport][queuesummary]\x20name:%s',_0x10d8d1['name']);this[_0x8fc2('0x10')][_0x8fc2('0x5d')][_0x10d8d1['name']]={'summaryEvent':_0x331ed0};this[_0x8fc2('0x10')][_0x8fc2('0x6c')]+=0x1;return ami[_0x8fc2('0x3e')]({'action':'queuestatus','queue':_0x10d8d1[_0x8fc2('0x63')]})[_0x8fc2('0x5f')](function(_0x1591eb){if(!_0x2b94df[_0x8fc2('0x10')][_0x8fc2('0x61')][_0x331ed0[_0x8fc2('0x69')]]){_0x2b94df[_0x8fc2('0x10')][_0x8fc2('0x61')][_0x331ed0[_0x8fc2('0x69')]]={};}_0x2b94df['summary']['queuestatus'][_0x331ed0['actionid']][_0x1591eb[_0x8fc2('0x69')]]={'queue':_0x10d8d1[_0x8fc2('0x63')],'agents':[]};})[_0x8fc2('0x5e')](function(_0x3ac16c){throw _0x3ac16c;});}}}catch(_0x956823){logger['error'](_0x8fc2('0x6f'),util[_0x8fc2('0x43')](_0x956823,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8fc2('0x8')][_0x8fc2('0x16')]=function(_0x5d1fac){if(this[_0x8fc2('0x10')][_0x8fc2('0x6c')]>0x0){this[_0x8fc2('0x10')][_0x8fc2('0x70')]=_0x5d1fac;return;}logger['debug'](_0x8fc2('0x71'),util[_0x8fc2('0x43')](_0x5d1fac,{'showHidden':![],'depth':null}));this[_0x8fc2('0x10')]=initializeSummary();ami[_0x8fc2('0x49')](_0x8fc2('0x72'),{});};VoiceQueueReport[_0x8fc2('0x8')][_0x8fc2('0x73')]=function(_0x58e8d8){try{if(this[_0x8fc2('0x5b')](_0x58e8d8)){logger[_0x8fc2('0x4b')](_0x8fc2('0x74'),_0x58e8d8[_0x8fc2('0x53')],util[_0x8fc2('0x43')](_0x58e8d8,{'showHidden':![],'depth':null}));if(_[_0x8fc2('0x5c')](this[_0x8fc2('0xb')][_0x58e8d8[_0x8fc2('0x53')]])){this[_0x8fc2('0xb')][_0x58e8d8[_0x8fc2('0x53')]]=[];}if(_[_0x8fc2('0x5c')](this[_0x8fc2('0xd')][_0x58e8d8[_0x8fc2('0x53')]])){this[_0x8fc2('0xd')][_0x58e8d8[_0x8fc2('0x53')]]={};}var _0x27ca33=new QueueReport();_0x27ca33[_0x8fc2('0x4f')]=_0x58e8d8[_0x8fc2('0x4f')];_0x27ca33['type']=this[_0x8fc2('0xe')][_0x27ca33[_0x8fc2('0x4f')]]&&this['voiceQueues'][_0x27ca33[_0x8fc2('0x4f')]]['type']?this[_0x8fc2('0xe')][_0x27ca33[_0x8fc2('0x4f')]][_0x8fc2('0x6a')]||'inbound':'inbound';_0x27ca33[_0x8fc2('0x75')]=moment()[_0x8fc2('0x4e')](_0x8fc2('0x76'));_0x27ca33[_0x8fc2('0x77')]=_0x58e8d8['position'];_0x27ca33[_0x8fc2('0x78')]=_0x58e8d8[_0x8fc2('0x78')];_0x27ca33[_0x8fc2('0x53')]=_0x58e8d8[_0x8fc2('0x53')];logger[_0x8fc2('0x79')](_0x8fc2('0x7a'),_0x27ca33['queue'],_0x27ca33[_0x8fc2('0x6a')]);Object[_0x8fc2('0x68')](_0x27ca33,_[_0x8fc2('0x7b')](_0x58e8d8,_[_0x8fc2('0x7c')](_0x27ca33)));this[_0x8fc2('0xb')][_0x58e8d8['uniqueid']][_0x8fc2('0x6d')](_0x27ca33);this['channels'][_0x58e8d8[_0x8fc2('0x53')]]=_0x27ca33;this['emitVoiceQueueChannelSave'](_0x27ca33,_0x8fc2('0x7d'));}}catch(_0x2196d9){logger[_0x8fc2('0x42')]('[%s][voiceQueueReport][queuecallerjoin]',_0x58e8d8['uniqueid'],util[_0x8fc2('0x43')](_0x2196d9,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8fc2('0x8')][_0x8fc2('0x7e')]=function(_0x26a2b8){try{if(this[_0x8fc2('0x5b')](_0x26a2b8)){logger[_0x8fc2('0x4b')]('[%s][voiceQueueReport][queuecallerabandon]',_0x26a2b8['uniqueid'],util['inspect'](_0x26a2b8,{'showHidden':![],'depth':null}));if(this[_0x8fc2('0xb')][_0x26a2b8['uniqueid']]){var _0x4ae3c4=_[_0x8fc2('0x7f')](this['queueReports'][_0x26a2b8[_0x8fc2('0x53')]]);_0x4ae3c4[_0x8fc2('0x38')]=![];_0x4ae3c4[_0x8fc2('0x80')]=null;_0x4ae3c4['holdtime']=_0x26a2b8[_0x8fc2('0x81')];_0x4ae3c4[_0x8fc2('0x82')]=_0x26a2b8[_0x8fc2('0x82')];_0x4ae3c4[_0x8fc2('0x19')]=!![];_0x4ae3c4[_0x8fc2('0x83')]=moment()[_0x8fc2('0x4e')]('YYYY-MM-DD\x20HH:mm:ss');_0x4ae3c4[_0x8fc2('0x84')]=_0x8fc2('0x85');_0x4ae3c4[_0x8fc2('0x86')]=null;logger[_0x8fc2('0x79')]('[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s',_0x4ae3c4[_0x8fc2('0x4f')],_0x4ae3c4['type']);this[_0x8fc2('0xd')][_0x26a2b8[_0x8fc2('0x53')]]=_0x4ae3c4;this['emitVoiceQueueChannelRemove'](_0x4ae3c4,_0x8fc2('0x19'));}}}catch(_0x377251){logger[_0x8fc2('0x42')](_0x8fc2('0x87'),_0x26a2b8[_0x8fc2('0x53')],util[_0x8fc2('0x43')](_0x377251,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8fc2('0x8')][_0x8fc2('0x1b')]=function(_0xe5b791){try{if(this[_0x8fc2('0x5b')](_0xe5b791)){logger['debug']('[%s][voiceQueueReport][queuecallerleave]',_0xe5b791[_0x8fc2('0x53')],util[_0x8fc2('0x43')](_0xe5b791,{'showHidden':![],'depth':null}));if(this[_0x8fc2('0xb')][_0xe5b791[_0x8fc2('0x53')]]){var _0x196a4b=_[_0x8fc2('0x7f')](this['queueReports'][_0xe5b791['uniqueid']]);_0x196a4b['queuecallerleaveAt']=moment()[_0x8fc2('0x4e')](_0x8fc2('0x76'));_0x196a4b[_0x8fc2('0x88')]=_0xe5b791[_0x8fc2('0x88')];_0x196a4b[_0x8fc2('0x89')]=_0xe5b791[_0x8fc2('0x89')];logger[_0x8fc2('0x79')]('[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x196a4b[_0x8fc2('0x4f')],_0x196a4b[_0x8fc2('0x6a')],_0xe5b791['connectedlinenum'],_0xe5b791[_0x8fc2('0x89')]);this['channels'][_0xe5b791[_0x8fc2('0x53')]]=_0x196a4b;this[_0x8fc2('0x4a')](_0x196a4b,_0x8fc2('0x1a'));}}}catch(_0x4c0929){logger['error'](_0x8fc2('0x8a'),_0xe5b791['uniqueid'],util[_0x8fc2('0x43')](_0x4c0929,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8fc2('0x8')][_0x8fc2('0x1f')]=function(_0x3e02ec){try{if(this[_0x8fc2('0x5b')](_0x3e02ec)){logger['debug'](_0x8fc2('0x8b'),_0x3e02ec['uniqueid'],util[_0x8fc2('0x43')](_0x3e02ec,{'showHidden':![],'depth':null}));if(this[_0x8fc2('0xb')][_0x3e02ec['uniqueid']]){var _0x5a59fd=_['last'](this[_0x8fc2('0xb')][_0x3e02ec['uniqueid']]);_0x5a59fd[_0x8fc2('0x38')]=!![];_0x5a59fd[_0x8fc2('0x84')]=_0x8fc2('0x8c');logger[_0x8fc2('0x79')](_0x8fc2('0x8d'),_0x5a59fd[_0x8fc2('0x4f')],_0x5a59fd['type']);}}}catch(_0x369ac0){logger['error'](_0x8fc2('0x8b'),_0x3e02ec['uniqueid'],util[_0x8fc2('0x43')](_0x369ac0,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8fc2('0x8')][_0x8fc2('0x1d')]=function(_0x4ea802){try{if(this[_0x8fc2('0x5b')](_0x4ea802)){logger[_0x8fc2('0x4b')](_0x8fc2('0x8e'),_0x4ea802[_0x8fc2('0x53')],util[_0x8fc2('0x43')](_0x4ea802,{'showHidden':![],'depth':null}));if(this[_0x8fc2('0xb')][_0x4ea802['uniqueid']]){var _0x4cf84b=_[_0x8fc2('0x7f')](this[_0x8fc2('0xb')][_0x4ea802[_0x8fc2('0x53')]]);_0x4cf84b['queuecallerabandon']=![];_0x4cf84b[_0x8fc2('0x83')]=null;_0x4cf84b[_0x8fc2('0x8f')]=!![];_0x4cf84b[_0x8fc2('0x86')]=_0x4ea802['membername'];_0x4cf84b[_0x8fc2('0x81')]=_0x4ea802[_0x8fc2('0x81')];_0x4cf84b[_0x8fc2('0x38')]=!![];_0x4cf84b['queuecallerexit']=![];_0x4cf84b['queuecallerexitAt']=null;if(!_0x4cf84b[_0x8fc2('0x90')]){if(_0x4ea802[_0x8fc2('0x91')]=='transfer'){_0x4cf84b[_0x8fc2('0x84')]=_0x8fc2('0x92');logger['info']('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0x4cf84b[_0x8fc2('0x4f')],_0x4cf84b[_0x8fc2('0x6a')]);}else{if(_[_0x8fc2('0x93')](_0x4ea802[_0x8fc2('0x94')][_0x8fc2('0x95')](),_0x8fc2('0x96'))){if(this[_0x8fc2('0xb')][_0x4ea802['linkedid']]){var _0x11484a=_[_0x8fc2('0x7f')](this['queueReports'][_0x4ea802[_0x8fc2('0x97')]]);_0x11484a[_0x8fc2('0x38')]=![];_0x11484a['queuecallerexit']=!![];_0x11484a[_0x8fc2('0x98')]=moment(_0x4cf84b['queuecallerjoinAt'])['add'](_0x4ea802[_0x8fc2('0x81')],'seconds')['format'](_0x8fc2('0x76'));_0x11484a[_0x8fc2('0x84')]=_0x8fc2('0x99');_0x11484a[_0x8fc2('0x90')]=!![];_0x11484a[_0x8fc2('0x9a')]=_0x8fc2('0x9b');_0x11484a[_0x8fc2('0x9c')]=_0x4ea802[_0x8fc2('0x9d')];_0x11484a[_0x8fc2('0x9e')]=_0x4ea802['uniqueid'];logger[_0x8fc2('0x79')](_0x8fc2('0x9f'),_0x11484a['queue'],_0x11484a[_0x8fc2('0x6a')]);var _0x4c02ef=this['queueReports'][_0x4ea802[_0x8fc2('0x97')]];this[_0x8fc2('0xb')][_0x4ea802[_0x8fc2('0x97')]]=this['queueReports'][_0x4ea802[_0x8fc2('0x53')]];this[_0x8fc2('0xb')][_0x4ea802['uniqueid']]=_0x4c02ef;}}else{_0x4cf84b['queuecallerexitreason']=_0x8fc2('0xa0')+_0x4ea802[_0x8fc2('0x91')][_0x8fc2('0xa1')]();logger[_0x8fc2('0x79')](_0x8fc2('0xa2'),_0x4cf84b[_0x8fc2('0x4f')],_0x4cf84b['type'],_0x4cf84b[_0x8fc2('0x84')]);}}}this[_0x8fc2('0xd')][_0x4ea802[_0x8fc2('0x53')]]=_0x4cf84b;}}}catch(_0x582f4a){logger[_0x8fc2('0x42')](_0x8fc2('0x8e'),_0x4ea802[_0x8fc2('0x53')],util['inspect'](_0x582f4a,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x8fc2('0x21')]=function(_0x2502ed){try{if(this['isNotNull'](_0x2502ed)){logger[_0x8fc2('0x4b')]('[%s][voiceQueueReport][varset]',_0x2502ed['uniqueid'],util[_0x8fc2('0x43')](_0x2502ed,{'showHidden':![],'depth':null}));this[_0x8fc2('0xa3')](_0x2502ed[_0x8fc2('0x53')],_['keys'](_0x2502ed[_0x8fc2('0xa4')])[0x0],_0x2502ed['value']);if(this['queueReports'][_0x2502ed[_0x8fc2('0x53')]]){var _0x587771=_['last'](this['queueReports'][_0x2502ed[_0x8fc2('0x53')]]);if(_0x587771){if(this[_0x8fc2('0x5b')](_0x2502ed['variable'])&&this[_0x8fc2('0x5b')](_0x2502ed[_0x8fc2('0xa4')][_0x8fc2('0x61')])){switch(_0x2502ed[_0x8fc2('0xa5')]){case'CONTINUE':_0x587771[_0x8fc2('0xa6')]=![];_0x587771[_0x8fc2('0x98')]=null;break;case _0x8fc2('0xa7'):_0x587771[_0x8fc2('0xa8')]='timeout';_0x587771[_0x8fc2('0xa6')]=!![];_0x587771[_0x8fc2('0x98')]=moment()[_0x8fc2('0x4e')](_0x8fc2('0x76'));_0x587771['queuecallerleaveAt']=moment()[_0x8fc2('0x4e')]('YYYY-MM-DD\x20HH:mm:ss');logger['debug'](_0x8fc2('0xa9'),_0x2502ed[_0x8fc2('0x53')],util['inspect'](_0x587771,{'showHidden':![],'depth':null}));ami['emit']('custom:timeout',_0x587771);break;default:_0x587771[_0x8fc2('0xa6')]=!![];_0x587771[_0x8fc2('0x98')]=moment()[_0x8fc2('0x4e')](_0x8fc2('0x76'));_0x587771['queuecallerleaveAt']=moment()['format'](_0x8fc2('0x76'));}_0x587771[_0x8fc2('0x19')]=![];_0x587771[_0x8fc2('0x83')]=null;_0x587771[_0x8fc2('0x84')]=_0x2502ed[_0x8fc2('0xa5')];this[_0x8fc2('0xd')][_0x2502ed['uniqueid']]=_0x587771;this[_0x8fc2('0x47')](_0x587771,_0x8fc2('0x20'));}else if(this[_0x8fc2('0x5b')](_0x2502ed[_0x8fc2('0xa4')])&&this[_0x8fc2('0x5b')](_0x2502ed['variable'][_0x8fc2('0xaa')])){if(!_0x587771[_0x8fc2('0x19')]){_0x587771['queuecallerexit']=!![];_0x587771[_0x8fc2('0x98')]=moment()[_0x8fc2('0x4e')](_0x8fc2('0x76'));_0x587771[_0x8fc2('0x84')]=_0x8fc2('0xab');_0x587771[_0x8fc2('0xac')]=moment()[_0x8fc2('0x4e')](_0x8fc2('0x76'));this['channels'][_0x2502ed['uniqueid']]=_0x587771;}}logger['info'](_0x8fc2('0xad'),_0x2502ed[_0x8fc2('0x53')],_0x587771['queue'],_0x587771['type'],_[_0x8fc2('0x7c')](_0x2502ed[_0x8fc2('0xa4')])[0x0],_0x2502ed[_0x8fc2('0xa5')]);_0x587771[_0x8fc2('0x11')]=this['variables'][_0x2502ed[_0x8fc2('0x53')]];}}}}catch(_0x187ab0){logger[_0x8fc2('0x42')]('[%s][voiceQueueReport][varset]',_0x2502ed['uniqueid'],util[_0x8fc2('0x43')](_0x187ab0,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8fc2('0x8')]['addVariable']=function(_0x593f13,_0x4c9a5a,_0xce28dc){var _0x17a457=[_0x8fc2('0xae'),_0x8fc2('0xaf'),_0x8fc2('0xb0'),_0x8fc2('0xb1'),_0x8fc2('0xb2'),_0x8fc2('0xb3'),_0x8fc2('0xb4'),'rtpaudioqosrttbridged',_0x8fc2('0xb5'),_0x8fc2('0xb6'),'bridgepeer',_0x8fc2('0xb7'),_0x8fc2('0xb8'),'memberdynamic',_0x8fc2('0xb9'),'memberlastcall','membername',_0x8fc2('0xba'),_0x8fc2('0xbb')];if(!_[_0x8fc2('0x3d')](_0x4c9a5a)&&!_['includes'](_0x17a457,_0x4c9a5a)){if(_[_0x8fc2('0x5c')](this[_0x8fc2('0x11')][_0x593f13])){this[_0x8fc2('0x11')][_0x593f13]={};}this[_0x8fc2('0x11')][_0x593f13][_0x4c9a5a]=_0xce28dc;}};VoiceQueueReport[_0x8fc2('0x8')][_0x8fc2('0xbc')]=function(_0x357611,_0x1034af,_0x49654a){try{var _0x3c288f={};if(this[_0x8fc2('0xb')][_0x357611]){for(var _0x246eb4=0x0;_0x246eb4=0x0?moment(_0x17f8ef[_0x9ea1('0x16')])[_0x9ea1('0xc')](_0x17f8ef[_0x9ea1('0x15')],_0x9ea1('0xd')):null,'data1':_0x9ea1('0x17'),'data2':_0x17f8ef['accountcode'],'data3':_0x17f8ef[_0x9ea1('0xe')],'data4':_0x17f8ef[_0x9ea1('0x18')]||null,'role':_0x9ea1('0x10'),'internal':_0x17f8ef['accountcode']?_[_0x9ea1('0x12')](_0x17f8ef['accountcode']):undefined,'uniqueid':_0x17f8ef[_0x9ea1('0x13')]},'log':_0x9ea1('0x5')});}; \ No newline at end of file +var _0xff3f=['toNumber','voiceDialReport','membername','TALKING','endtime','starttime','outbound','uniqueid','moment','util','voiceQueueReport','queuecallerexitAt','Request','CreateMemberReport','voice','isNil','interface','SIP/%s','lastAssignedTo','diff','queuecallerleaveAt','seconds','inbound','calleridnum','exten','queue','agent','accountcode'];(function(_0x53f943,_0x2ed7d4){var _0x33a3d2=function(_0x452972){while(--_0x452972){_0x53f943['push'](_0x53f943['shift']());}};_0x33a3d2(++_0x2ed7d4);}(_0xff3f,0xb0));var _0xfff3=function(_0x545bed,_0x221e96){_0x545bed=_0x545bed-0x0;var _0x16c79c=_0xff3f[_0x545bed];return _0x16c79c;};'use strict';var moment=require(_0xfff3('0x0'));var _=require('lodash');var util=require(_0xfff3('0x1'));var client=require('../client');exports[_0xfff3('0x2')]=function(_0x1d0b95){var _0x521fdf=_0x1d0b95['queuecallercompleteAt']||_0x1d0b95[_0xfff3('0x3')];return client[_0xfff3('0x4')](_0xfff3('0x5'),{'body':{'channel':_0xfff3('0x6'),'membername':_0x1d0b95['lastAssignedTo'],'interface':_[_0xfff3('0x7')](_0x1d0b95[_0xfff3('0x8')])?util['format'](_0xfff3('0x9'),_0x1d0b95[_0xfff3('0xa')]):_0x1d0b95[_0xfff3('0x8')],'type':'TALKING','enterAt':_0x1d0b95['queuecallerleaveAt'],'exitAt':_0x521fdf,'duration':moment(_0x521fdf)[_0xfff3('0xb')](_0x1d0b95[_0xfff3('0xc')],_0xfff3('0xd')),'data1':_0xfff3('0xe'),'data2':_0x1d0b95[_0xfff3('0xf')],'data3':_0x1d0b95[_0xfff3('0x10')],'data4':null,'data5':_0x1d0b95[_0xfff3('0x11')],'role':_0xfff3('0x12'),'internal':_0x1d0b95[_0xfff3('0x13')]?_[_0xfff3('0x14')](_0x1d0b95[_0xfff3('0x13')]):undefined,'uniqueid':_0x1d0b95['uniqueid']},'log':'CreateMemberReport'});};exports[_0xfff3('0x15')]=function(_0x4dc2aa){return client[_0xfff3('0x4')]('CreateMemberReport',{'body':{'channel':_0xfff3('0x6'),'membername':_0x4dc2aa[_0xfff3('0x16')],'interface':_0x4dc2aa['interface'],'type':_0xfff3('0x17'),'enterAt':_0x4dc2aa['starttime'],'exitAt':_0x4dc2aa[_0xfff3('0x18')],'duration':moment(_0x4dc2aa[_0xfff3('0x18')])['diff'](_0x4dc2aa[_0xfff3('0x19')],'seconds')>=0x0?moment(_0x4dc2aa['endtime'])[_0xfff3('0xb')](_0x4dc2aa[_0xfff3('0x19')],_0xfff3('0xd')):null,'data1':_0xfff3('0x1a'),'data2':_0x4dc2aa['accountcode'],'data3':_0x4dc2aa['exten'],'data4':_0x4dc2aa['dialstring']||null,'role':_0xfff3('0x12'),'internal':_0x4dc2aa['accountcode']?_[_0xfff3('0x14')](_0x4dc2aa[_0xfff3('0x13')]):undefined,'uniqueid':_0x4dc2aa[_0xfff3('0x1b')]},'log':_0xfff3('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index 328d44d..f88e767 100644 --- a/server/services/ami/rpc/setting.js +++ b/server/services/ami/rpc/setting.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd193=['GetSettings','../client','getSettings','Request','ShowSetting'];(function(_0x4ea69d,_0x290f53){var _0x5318e0=function(_0x18e081){while(--_0x18e081){_0x4ea69d['push'](_0x4ea69d['shift']());}};_0x5318e0(++_0x290f53);}(_0xd193,0x119));var _0x3d19=function(_0x31ecc1,_0x30e013){_0x31ecc1=_0x31ecc1-0x0;var _0x5e9ea3=_0xd193[_0x31ecc1];return _0x5e9ea3;};'use strict';var client=require(_0x3d19('0x0'));exports[_0x3d19('0x1')]=function(){return client[_0x3d19('0x2')](_0x3d19('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['stopRecordingOnTransfer','previewRecallmeReminderInterval']},'log':_0x3d19('0x4')});}; \ No newline at end of file +var _0x69d3=['Request','stopRecordingOnTransfer','previewRecallmeReminderInterval','../client','getSettings'];(function(_0x562d84,_0x1759c2){var _0x28b33d=function(_0x42872d){while(--_0x42872d){_0x562d84['push'](_0x562d84['shift']());}};_0x28b33d(++_0x1759c2);}(_0x69d3,0xda));var _0x369d=function(_0x3c1ca2,_0x56dc2c){_0x3c1ca2=_0x3c1ca2-0x0;var _0x534caf=_0x69d3[_0x3c1ca2];return _0x534caf;};'use strict';var client=require(_0x369d('0x0'));exports[_0x369d('0x1')]=function(){return client[_0x369d('0x2')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x369d('0x3'),_0x369d('0x4')]},'log':'GetSettings'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index 94b735c..abdce7e 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 _0xb954=['GetTemplate','../client','getTemplates','name'];(function(_0x1670b8,_0x2c77fb){var _0x2cda52=function(_0x33c3e5){while(--_0x33c3e5){_0x1670b8['push'](_0x1670b8['shift']());}};_0x2cda52(++_0x2c77fb);}(_0xb954,0x115));var _0x4b95=function(_0x299784,_0xb0918f){_0x299784=_0x299784-0x0;var _0x5ab008=_0xb954[_0x299784];return _0x5ab008;};'use strict';var client=require(_0x4b95('0x0'));exports[_0x4b95('0x1')]=function(_0x16897b){return function(_0x44bbff){return client['Request']('GetTemplate',{'options':{'raw':!![],'attributes':['id',_0x4b95('0x2'),'html']},'log':_0x4b95('0x3')});};}; \ No newline at end of file +var _0x560e=['html','getTemplates','GetTemplate','name'];(function(_0xa1b26f,_0x59a9de){var _0x2a5c3b=function(_0x26af7d){while(--_0x26af7d){_0xa1b26f['push'](_0xa1b26f['shift']());}};_0x2a5c3b(++_0x59a9de);}(_0x560e,0x141));var _0xe560=function(_0x438487,_0x41f017){_0x438487=_0x438487-0x0;var _0x4900ce=_0x560e[_0x438487];return _0x4900ce;};'use strict';var client=require('../client');exports[_0xe560('0x0')]=function(_0x14d043){return function(_0x549481){return client['Request'](_0xe560('0x1'),{'options':{'raw':!![],'attributes':['id',_0xe560('0x2'),_0xe560('0x3')]},'log':'GetTemplate'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 3c90a05..8b1bf87 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 _0xbb03=['name','channel','status','Condition','AllConditions','field','operator','value','AnyConditions','Action','data1','data2','data4','data5','data6','../client','getTriggers','Request','GetTrigger'];(function(_0x8727b7,_0x530a7f){var _0xdb9955=function(_0x1f0e51){while(--_0x1f0e51){_0x8727b7['push'](_0x8727b7['shift']());}};_0xdb9955(++_0x530a7f);}(_0xbb03,0x19e));var _0x3bb0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbb03[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x3bb0('0x0'));exports[_0x3bb0('0x1')]=function(_0x1ad98a){return function(_0x38ff6c){return client[_0x3bb0('0x2')](_0x3bb0('0x3'),{'options':{'raw':![],'attributes':['id',_0x3bb0('0x4'),_0x3bb0('0x5'),_0x3bb0('0x6')],'include':[{'model':_0x3bb0('0x7'),'as':_0x3bb0('0x8'),'attributes':['id',_0x3bb0('0x9'),_0x3bb0('0xa'),_0x3bb0('0xb')]},{'model':_0x3bb0('0x7'),'as':_0x3bb0('0xc'),'attributes':['id',_0x3bb0('0x9'),_0x3bb0('0xa'),_0x3bb0('0xb')]},{'model':_0x3bb0('0xd'),'as':'Actions','attributes':['id','action',_0x3bb0('0xe'),_0x3bb0('0xf'),'data3',_0x3bb0('0x10'),_0x3bb0('0x11'),_0x3bb0('0x12'),'data7']}]},'log':_0x3bb0('0x3')});};}; \ No newline at end of file +var _0x7838=['GetTrigger','name','channel','AllConditions','field','value','AnyConditions','operator','Action','action','data1','data3','data4','data5','data6','data7','../client','getTriggers','Request'];(function(_0x184cc6,_0x4961ee){var _0x3f7435=function(_0x448fed){while(--_0x448fed){_0x184cc6['push'](_0x184cc6['shift']());}};_0x3f7435(++_0x4961ee);}(_0x7838,0x107));var _0x8783=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0x7838[_0x521929];return _0x632436;};'use strict';var client=require(_0x8783('0x0'));exports[_0x8783('0x1')]=function(_0x2ed38d){return function(_0x1b321e){return client[_0x8783('0x2')](_0x8783('0x3'),{'options':{'raw':![],'attributes':['id',_0x8783('0x4'),_0x8783('0x5'),'status'],'include':[{'model':'Condition','as':_0x8783('0x6'),'attributes':['id',_0x8783('0x7'),'operator',_0x8783('0x8')]},{'model':'Condition','as':_0x8783('0x9'),'attributes':['id',_0x8783('0x7'),_0x8783('0xa'),_0x8783('0x8')]},{'model':_0x8783('0xb'),'as':'Actions','attributes':['id',_0x8783('0xc'),_0x8783('0xd'),'data2',_0x8783('0xe'),_0x8783('0xf'),_0x8783('0x10'),_0x8783('0x11'),_0x8783('0x12')]}]},'log':_0x8783('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index 4ec5b14..c5bc2e5 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 _0x433d=['defaultuser','Request','GetTrunk','registry'];(function(_0x1e8ecc,_0x27b83b){var _0x11abc1=function(_0x42c432){while(--_0x42c432){_0x1e8ecc['push'](_0x1e8ecc['shift']());}};_0x11abc1(++_0x27b83b);}(_0x433d,0xe9));var _0xd433=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0x433d[_0x481bf7];return _0x461787;};'use strict';var client=require('../client');exports['getTrunks']=function(_0x1b0990){return function(_0x3045bf){return client[_0xd433('0x0')](_0xd433('0x1'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name',_0xd433('0x2'),_0xd433('0x3')]},'log':_0xd433('0x1')});};}; \ No newline at end of file +var _0x871b=['defaultuser','../client','getTrunks','GetTrunk','registry'];(function(_0x2d8667,_0x3a4ac6){var _0x2b6069=function(_0x166d2b){while(--_0x166d2b){_0x2d8667['push'](_0x2d8667['shift']());}};_0x2b6069(++_0x3a4ac6);}(_0x871b,0xe7));var _0xb871=function(_0x5b1e02,_0x229964){_0x5b1e02=_0x5b1e02-0x0;var _0x345810=_0x871b[_0x5b1e02];return _0x345810;};'use strict';var client=require(_0xb871('0x0'));exports[_0xb871('0x1')]=function(_0x642eb8){return function(_0x6b3e6){return client['Request'](_0xb871('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name',_0xb871('0x3'),_0xb871('0x4')]},'log':_0xb871('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index eadef42..724b15c 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 _0xcb91=['UnpauseUser','getAgent','ShowUser','email','lastPauseAt','Request','GetUser','agent','name','accountcode','fullname','lastLoginAt','pauseType','voicePause','phone','interface','getAgents','internal','getTelephones','savePause','PauseUser'];(function(_0x5018da,_0x19a756){var _0x3fb199=function(_0x181d0c){while(--_0x181d0c){_0x5018da['push'](_0x5018da['shift']());}};_0x3fb199(++_0x19a756);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x872b02,_0x4f4458){_0x872b02=_0x872b02-0x0;var _0x1a6b24=_0xcb91[_0x872b02];return _0x1a6b24;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client[_0x1cb9('0x0')](_0x1cb9('0x1'),{'options':{'raw':![],'where':{'role':_0x1cb9('0x2')},'attributes':['id',_0x1cb9('0x3'),'email',_0x1cb9('0x4'),_0x1cb9('0x5'),'online',_0x1cb9('0x6'),_0x1cb9('0x7'),'lastPauseAt',_0x1cb9('0x8'),_0x1cb9('0x9'),'mobile',_0x1cb9('0xa')]},'log':_0x1cb9('0xb')});};};exports['getTelephones']=function(){return function(){return client[_0x1cb9('0x0')]('GetUser',{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x1cb9('0x3'),_0x1cb9('0x4'),_0x1cb9('0xc')]},'log':_0x1cb9('0xd')});};};exports[_0x1cb9('0xe')]=function(_0x50ce71,_0x9b58f1,_0x44a6b4){return client[_0x1cb9('0x0')](_0x1cb9('0xf'),{'body':{'type':_0x9b58f1,'uniqueid':_0x44a6b4},'options':{'where':{'id':_0x50ce71['id']}},'log':_0x1cb9('0xe')});};exports['saveUnpause']=function(_0x5e3c19){return client['Request'](_0x1cb9('0x10'),{'body':{},'options':{'where':{'id':_0x5e3c19['id']}},'log':_0x1cb9('0xe')});};exports[_0x1cb9('0x11')]=function(_0x1c714f){return client['Request'](_0x1cb9('0x12'),{'options':{'raw':![],'where':{'role':_0x1cb9('0x2'),'id':_0x1c714f},'attributes':['id',_0x1cb9('0x3'),_0x1cb9('0x13'),_0x1cb9('0x4'),'fullname','online',_0x1cb9('0x6'),_0x1cb9('0x7'),_0x1cb9('0x14'),_0x1cb9('0x8'),_0x1cb9('0xa')]},'log':_0x1cb9('0x11')});}; \ No newline at end of file +var _0x0713=['getAgent','Request','GetUser','agent','name','email','fullname','online','lastLoginAt','pauseType','lastPauseAt','voicePause','phone','mobile','interface','getAgents','getTelephones','accountcode','internal','savePause','PauseUser'];(function(_0x1ad46d,_0x1dc3c5){var _0x3e90a1=function(_0x121f5f){while(--_0x121f5f){_0x1ad46d['push'](_0x1ad46d['shift']());}};_0x3e90a1(++_0x1dc3c5);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client[_0x3071('0x0')](_0x3071('0x1'),{'options':{'raw':![],'where':{'role':_0x3071('0x2')},'attributes':['id',_0x3071('0x3'),_0x3071('0x4'),'accountcode',_0x3071('0x5'),_0x3071('0x6'),_0x3071('0x7'),_0x3071('0x8'),_0x3071('0x9'),_0x3071('0xa'),_0x3071('0xb'),_0x3071('0xc'),_0x3071('0xd')]},'log':_0x3071('0xe')});};};exports[_0x3071('0xf')]=function(){return function(){return client[_0x3071('0x0')](_0x3071('0x1'),{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x3071('0x3'),_0x3071('0x10'),_0x3071('0x11')]},'log':_0x3071('0xf')});};};exports[_0x3071('0x12')]=function(_0x4a470a,_0x2ace21,_0x11a7ee){return client[_0x3071('0x0')](_0x3071('0x13'),{'body':{'type':_0x2ace21,'uniqueid':_0x11a7ee},'options':{'where':{'id':_0x4a470a['id']}},'log':_0x3071('0x12')});};exports['saveUnpause']=function(_0x5330a8){return client[_0x3071('0x0')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x5330a8['id']}},'log':_0x3071('0x12')});};exports[_0x3071('0x14')]=function(_0x5d4883){return client[_0x3071('0x0')]('ShowUser',{'options':{'raw':![],'where':{'role':_0x3071('0x2'),'id':_0x5d4883},'attributes':['id',_0x3071('0x3'),_0x3071('0x4'),_0x3071('0x10'),_0x3071('0x5'),_0x3071('0x6'),_0x3071('0x7'),_0x3071('0x8'),_0x3071('0x9'),_0x3071('0xa'),'interface']},'log':_0x3071('0x14')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index c0799f0..cd9772a 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 _0x7033=['UpdateVoiceAgentReport','Request','CreateVoiceAgentReport','update'];(function(_0x18ba29,_0x2fd5ef){var _0x39a50c=function(_0x14f30f){while(--_0x14f30f){_0x18ba29['push'](_0x18ba29['shift']());}};_0x39a50c(++_0x2fd5ef);}(_0x7033,0x111));var _0x3703=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x7033[_0xfae23b];return _0x200640;};'use strict';var client=require('../client');exports['create']=function(_0x266458){return client[_0x3703('0x0')](_0x3703('0x1'),{'body':_0x266458,'log':'CreateVoiceAgentReport'});};exports[_0x3703('0x2')]=function(_0xc540a,_0x4b7d67,_0x3f022b){return client['Request'](_0x3703('0x3'),{'body':_0xc540a,'options':{'where':{'uniqueid':_0x4b7d67,'interface':_0x3f022b,'agentcomplete':!![]}},'log':_0x3703('0x3')});}; \ No newline at end of file +var _0xf98e=['create','Request','CreateVoiceAgentReport','update','UpdateVoiceAgentReport'];(function(_0x820b89,_0x364baa){var _0x2e32dc=function(_0x22353d){while(--_0x22353d){_0x820b89['push'](_0x820b89['shift']());}};_0x2e32dc(++_0x364baa);}(_0xf98e,0x19a));var _0xef98=function(_0x11f373,_0x200696){_0x11f373=_0x11f373-0x0;var _0xec7711=_0xf98e[_0x11f373];return _0xec7711;};'use strict';var client=require('../client');exports[_0xef98('0x0')]=function(_0x1108f3){return client[_0xef98('0x1')](_0xef98('0x2'),{'body':_0x1108f3,'log':'CreateVoiceAgentReport'});};exports[_0xef98('0x3')]=function(_0x1f9b0c,_0x207ddd,_0x35a4d9){return client[_0xef98('0x1')]('UpdateVoiceAgentReport',{'body':_0x1f9b0c,'options':{'where':{'uniqueid':_0x207ddd,'interface':_0x35a4d9,'agentcomplete':!![]}},'log':_0xef98('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index a284c40..16d6dc8 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 _0x3a10=['billableseconds','GetVoiceCallReports','moment','lodash','../client','Request','CreateVoiceCallReport','merge','calleridnum','context','callerid','GetVoiceCallReport','outbound','format','YYYY-MM-DD\x20HH:mm:ss','endOf','type','disposition','duration'];(function(_0x152678,_0x11e0ac){var _0x311a9=function(_0x4f5291){while(--_0x4f5291){_0x152678['push'](_0x152678['shift']());}};_0x311a9(++_0x11e0ac);}(_0x3a10,0x74));var _0x03a1=function(_0x325a26,_0x28adeb){_0x325a26=_0x325a26-0x0;var _0x4712c4=_0x3a10[_0x325a26];return _0x4712c4;};'use strict';var moment=require(_0x03a1('0x0'));var util=require('util');var _=require(_0x03a1('0x1'));var client=require(_0x03a1('0x2'));exports['create']=function(_0xfb76bc){return client[_0x03a1('0x3')](_0x03a1('0x4'),{'body':_[_0x03a1('0x5')](_0xfb76bc,{'source':_0xfb76bc[_0x03a1('0x6')],'destinationcontext':_0xfb76bc[_0x03a1('0x7')],'callerid':_0xfb76bc[_0x03a1('0x8')],'amaflags':'DOCUMENTATION'}),'log':_0x03a1('0x4')});};exports['getVoiceCallReports']=function(){return function(){return client[_0x03a1('0x3')](_0x03a1('0x9'),{'options':{'where':{'type':[_0x03a1('0xa')],'createdAt':{'$between':[moment()['startOf']('day')[_0x03a1('0xb')](_0x03a1('0xc')),moment()[_0x03a1('0xd')]('day')['format'](_0x03a1('0xc'))]}},'attributes':[_0x03a1('0xe'),_0x03a1('0xf'),_0x03a1('0x10'),_0x03a1('0x11')]},'log':_0x03a1('0x12')});};}; \ No newline at end of file +var _0x8718=['lodash','../client','create','CreateVoiceCallReport','merge','calleridnum','getVoiceCallReports','Request','GetVoiceCallReport','outbound','day','endOf','format','duration','billableseconds','moment','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8718,0x130));var _0x8871=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x8718[_0x2641f9];return _0x585741;};'use strict';var moment=require(_0x8871('0x0'));var util=require(_0x8871('0x1'));var _=require(_0x8871('0x2'));var client=require(_0x8871('0x3'));exports[_0x8871('0x4')]=function(_0x4b1583){return client['Request'](_0x8871('0x5'),{'body':_[_0x8871('0x6')](_0x4b1583,{'source':_0x4b1583[_0x8871('0x7')],'destinationcontext':_0x4b1583['context'],'callerid':_0x4b1583['callerid'],'amaflags':'DOCUMENTATION'}),'log':_0x8871('0x5')});};exports[_0x8871('0x8')]=function(){return function(){return client[_0x8871('0x9')](_0x8871('0xa'),{'options':{'where':{'type':[_0x8871('0xb')],'createdAt':{'$between':[moment()['startOf'](_0x8871('0xc'))['format']('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0x8871('0xd')](_0x8871('0xc'))[_0x8871('0xe')]('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':['type','disposition',_0x8871('0xf'),_0x8871('0x10')]},'log':'GetVoiceCallReports'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index 362f20c..9bbde29 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 _0x6efe=['CreateVoiceDialReport','create','Request'];(function(_0x25237a,_0x5a4bfe){var _0x433d0f=function(_0xc9d80b){while(--_0xc9d80b){_0x25237a['push'](_0x25237a['shift']());}};_0x433d0f(++_0x5a4bfe);}(_0x6efe,0x1e1));var _0xe6ef=function(_0x7d10b3,_0x5128ae){_0x7d10b3=_0x7d10b3-0x0;var _0x578539=_0x6efe[_0x7d10b3];return _0x578539;};'use strict';var client=require('../client');exports[_0xe6ef('0x0')]=function(_0x4da6a7){return client[_0xe6ef('0x1')]('CreateVoiceDialReport',{'body':_0x4da6a7,'log':_0xe6ef('0x2')});}; \ No newline at end of file +var _0xe836=['../client','create','CreateVoiceDialReport'];(function(_0x190dda,_0x459b67){var _0x4e9f94=function(_0x122beb){while(--_0x122beb){_0x190dda['push'](_0x190dda['shift']());}};_0x4e9f94(++_0x459b67);}(_0xe836,0x162));var _0x6e83=function(_0x2a132a,_0x47c7d1){_0x2a132a=_0x2a132a-0x0;var _0x17957a=_0xe836[_0x2a132a];return _0x17957a;};'use strict';var client=require(_0x6e83('0x0'));exports[_0x6e83('0x1')]=function(_0x26b17b){return client['Request'](_0x6e83('0x2'),{'body':_0x26b17b,'log':'CreateVoiceDialReport'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index c5847b1..50d8f0d 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 _0xe600=['recordingFormat','getVoiceExtensions','GetVoiceExtension','exten'];(function(_0x497b1e,_0x586379){var _0x3f72e1=function(_0x4c227d){while(--_0x4c227d){_0x497b1e['push'](_0x497b1e['shift']());}};_0x3f72e1(++_0x586379);}(_0xe600,0x159));var _0x0e60=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xe600[_0x122ef9];return _0x42fba0;};'use strict';var client=require('../client');exports[_0x0e60('0x0')]=function(){return function(){return client['Request'](_0x0e60('0x1'),{'options':{'raw':!![],'attributes':['id',_0x0e60('0x2'),_0x0e60('0x3')],'where':{'VoiceExtensionId':null}},'log':_0x0e60('0x0')});};}; \ No newline at end of file +var _0x3df4=['exten','recordingFormat','getVoiceExtensions','Request','GetVoiceExtension'];(function(_0x565ddf,_0x1ff463){var _0x2f1ac2=function(_0x485f0b){while(--_0x485f0b){_0x565ddf['push'](_0x565ddf['shift']());}};_0x2f1ac2(++_0x1ff463);}(_0x3df4,0x102));var _0x43df=function(_0x56893a,_0x57934b){_0x56893a=_0x56893a-0x0;var _0x234e33=_0x3df4[_0x56893a];return _0x234e33;};'use strict';var client=require('../client');exports['getVoiceExtensions']=function(){return function(){return client[_0x43df('0x0')](_0x43df('0x1'),{'options':{'raw':!![],'attributes':['id',_0x43df('0x2'),_0x43df('0x3')],'where':{'VoiceExtensionId':null}},'log':_0x43df('0x4')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index c46140a..1dd486c 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 _0xee64=['dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialGlobalMaxRetry','dialTimezone','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','dialAMDMaximumWordLength','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupClient','strategy','dialRandomLastDigitCallerIdNumber','dialNoSuchNumberMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','Trunk','name','callerid','Pause','mandatoryDispositionPause','TrunkBackup','active','Interval','Intervals','../client','Request','GetVoiceQueue','acw','autopause','monitor_format','type','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout'];(function(_0x12922e,_0x30af16){var _0x15ce34=function(_0x4e5f47){while(--_0x4e5f47){_0x12922e['push'](_0x12922e['shift']());}};_0x15ce34(++_0x30af16);}(_0xee64,0xa7));var _0x4ee6=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xee64[_0x3bf83f];return _0x22c4a9;};'use strict';var client=require(_0x4ee6('0x0'));exports['getVoiceQueues']=function(){return function(){return client[_0x4ee6('0x1')](_0x4ee6('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x4ee6('0x3'),'acwTimeout',_0x4ee6('0x4'),_0x4ee6('0x5'),_0x4ee6('0x6'),_0x4ee6('0x7'),_0x4ee6('0x8'),_0x4ee6('0x9'),_0x4ee6('0xa'),'dialPowerLevel',_0x4ee6('0xb'),_0x4ee6('0xc'),_0x4ee6('0xd'),_0x4ee6('0xe'),_0x4ee6('0xf'),_0x4ee6('0x10'),_0x4ee6('0x11'),_0x4ee6('0x12'),_0x4ee6('0x13'),_0x4ee6('0x14'),_0x4ee6('0x15'),_0x4ee6('0x16'),_0x4ee6('0x17'),_0x4ee6('0x18'),'dialNoAnswerRetryFrequency',_0x4ee6('0x19'),_0x4ee6('0x1a'),'dialGlobalInterval','dialPrefix','dialCheckDuplicateType',_0x4ee6('0x1b'),_0x4ee6('0x1c'),_0x4ee6('0x1d'),_0x4ee6('0x1e'),'dialAMDTotalAnalysisTime',_0x4ee6('0x1f'),_0x4ee6('0x20'),'dialAMDMaximumNumberOfWords',_0x4ee6('0x21'),_0x4ee6('0x22'),'timeout',_0x4ee6('0x23'),_0x4ee6('0x24'),_0x4ee6('0x25'),'dialAgiAfterHangupAgent',_0x4ee6('0x26'),'dialQueueProject2',_0x4ee6('0x5'),_0x4ee6('0x27'),_0x4ee6('0x28'),'dialCutDigit',_0x4ee6('0x29'),'dialNoSuchNumberRetryFrequency','dialDropMaxRetry',_0x4ee6('0x2a'),_0x4ee6('0x2b'),_0x4ee6('0x2c'),'dialMachineMaxRetry',_0x4ee6('0x2d'),_0x4ee6('0x2e'),_0x4ee6('0x2f'),_0x4ee6('0x30'),_0x4ee6('0x31'),_0x4ee6('0x32'),_0x4ee6('0x33'),_0x4ee6('0x34')],'include':[{'model':'Trunk','as':_0x4ee6('0x35'),'attributes':['id',_0x4ee6('0x36'),_0x4ee6('0x37'),'active']},{'model':_0x4ee6('0x38'),'as':_0x4ee6('0x39'),'attributes':['id',_0x4ee6('0x36')]},{'model':_0x4ee6('0x35'),'as':_0x4ee6('0x3a'),'attributes':['id',_0x4ee6('0x36'),_0x4ee6('0x37'),_0x4ee6('0x3b')]},{'model':_0x4ee6('0x3c'),'as':_0x4ee6('0x3c'),'attributes':['id',_0x4ee6('0x36')],'include':[{'model':_0x4ee6('0x3c'),'as':_0x4ee6('0x3d'),'attributes':['id',_0x4ee6('0x36'),'interval']}]}]},'log':'getVoiceQueues'});};}; \ No newline at end of file +var _0x0191=['dialPreviewAutoRecallMe','Trunk','active','Pause','name','TrunkBackup','callerid','Interval','interval','../client','getVoiceQueues','Request','GetVoiceQueue','acw','acwTimeout','autopause','monitor_format','type','dialActive','dialMethod','dialLimitChannel','dialPowerLevel','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','timeout','dialRecallMeTimeout','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialNoSuchNumberMaxRetry','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold'];(function(_0x1ff575,_0xdba21f){var _0x48fc9e=function(_0x51cf97){while(--_0x51cf97){_0x1ff575['push'](_0x1ff575['shift']());}};_0x48fc9e(++_0xdba21f);}(_0x0191,0x144));var _0x1019=function(_0x2f7d18,_0x44bea6){_0x2f7d18=_0x2f7d18-0x0;var _0x425175=_0x0191[_0x2f7d18];return _0x425175;};'use strict';var client=require(_0x1019('0x0'));exports[_0x1019('0x1')]=function(){return function(){return client[_0x1019('0x2')](_0x1019('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x1019('0x4'),_0x1019('0x5'),_0x1019('0x6'),_0x1019('0x7'),_0x1019('0x8'),_0x1019('0x9'),_0x1019('0xa'),_0x1019('0xb'),'dialLimitQueue',_0x1019('0xc'),'dialPredictiveOptimization',_0x1019('0xd'),_0x1019('0xe'),_0x1019('0xf'),_0x1019('0x10'),'dialOriginateTimeout',_0x1019('0x11'),_0x1019('0x12'),_0x1019('0x13'),_0x1019('0x14'),_0x1019('0x15'),_0x1019('0x16'),'dialBusyRetryFrequency',_0x1019('0x17'),_0x1019('0x18'),_0x1019('0x19'),_0x1019('0x1a'),_0x1019('0x1b'),_0x1019('0x1c'),_0x1019('0x1d'),_0x1019('0x1e'),_0x1019('0x1f'),'dialAMDGreeting','dialAMDAfterGreetingSilence',_0x1019('0x20'),'dialAMDMinWordLength',_0x1019('0x21'),_0x1019('0x22'),_0x1019('0x23'),'dialAMDMaximumWordLength',_0x1019('0x24'),_0x1019('0x25'),'dialRecallInQueue','dialOrderByScheduledAt',_0x1019('0x26'),_0x1019('0x27'),_0x1019('0x28'),_0x1019('0x7'),_0x1019('0x29'),_0x1019('0x2a'),'dialCutDigit',_0x1019('0x2b'),'dialNoSuchNumberRetryFrequency',_0x1019('0x2c'),_0x1019('0x2d'),'dialAbandonedMaxRetry',_0x1019('0x2e'),_0x1019('0x2f'),_0x1019('0x30'),_0x1019('0x31'),_0x1019('0x32'),_0x1019('0x33'),_0x1019('0x34'),_0x1019('0x35'),_0x1019('0x36'),'dialPreviewRecallmeReminder'],'include':[{'model':_0x1019('0x37'),'as':_0x1019('0x37'),'attributes':['id','name','callerid',_0x1019('0x38')]},{'model':_0x1019('0x39'),'as':'mandatoryDispositionPause','attributes':['id',_0x1019('0x3a')]},{'model':'Trunk','as':_0x1019('0x3b'),'attributes':['id',_0x1019('0x3a'),_0x1019('0x3c'),_0x1019('0x38')]},{'model':_0x1019('0x3d'),'as':'Interval','attributes':['id',_0x1019('0x3a')],'include':[{'model':_0x1019('0x3d'),'as':'Intervals','attributes':['id',_0x1019('0x3a'),_0x1019('0x3e')]}]}]},'log':'getVoiceQueues'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 28cf229..174578e 100644 --- a/server/services/ami/rpc/voiceQueueReport.js +++ b/server/services/ami/rpc/voiceQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['queuecallerexit','queuecallerexitAt','moment','lodash','../client','Request','CreateVoiceQueueReport','getVoiceQueueReports','GetVoiceQueueReport','startOf','format','YYYY-MM-DD\x20HH:mm:ss','endOf','queuecallerjoinAt','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt'];(function(_0x2f4e4e,_0x472aef){var _0x2e9f56=function(_0x5bbd23){while(--_0x5bbd23){_0x2f4e4e['push'](_0x2f4e4e['shift']());}};_0x2e9f56(++_0x472aef);}(_0xa9e0,0x123));var _0x0a9e=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xa9e0[_0x373dee];return _0x46798f;};'use strict';var moment=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var client=require(_0x0a9e('0x2'));exports['create']=function(_0x550fbc){return client[_0x0a9e('0x3')]('CreateVoiceQueueReport',{'body':_0x550fbc,'log':_0x0a9e('0x4')});};exports[_0x0a9e('0x5')]=function(){return function(){return client[_0x0a9e('0x3')](_0x0a9e('0x6'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x0a9e('0x7')]('day')[_0x0a9e('0x8')](_0x0a9e('0x9')),moment()[_0x0a9e('0xa')]('day')['format'](_0x0a9e('0x9'))]}},'attributes':['uniqueid','queue',_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe'),_0x0a9e('0xf'),_0x0a9e('0x10'),'queuecallerabandon','queuecallerabandonAt']},'log':'GetVoiceQueueReports'});};}; \ No newline at end of file +var _0xa9e0=['queuecallerexit','queuecallerexitAt','moment','lodash','../client','Request','CreateVoiceQueueReport','getVoiceQueueReports','GetVoiceQueueReport','startOf','format','YYYY-MM-DD\x20HH:mm:ss','endOf','queuecallerjoinAt','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt'];(function(_0xd75b2,_0x23533b){var _0x2e0d82=function(_0x303abf){while(--_0x303abf){_0xd75b2['push'](_0xd75b2['shift']());}};_0x2e0d82(++_0x23533b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xa9e0[_0x5c351c];return _0x26f3b3;};'use strict';var moment=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var client=require(_0x0a9e('0x2'));exports['create']=function(_0x550fbc){return client[_0x0a9e('0x3')]('CreateVoiceQueueReport',{'body':_0x550fbc,'log':_0x0a9e('0x4')});};exports[_0x0a9e('0x5')]=function(){return function(){return client[_0x0a9e('0x3')](_0x0a9e('0x6'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x0a9e('0x7')]('day')[_0x0a9e('0x8')](_0x0a9e('0x9')),moment()[_0x0a9e('0xa')]('day')['format'](_0x0a9e('0x9'))]}},'attributes':['uniqueid','queue',_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe'),_0x0a9e('0xf'),_0x0a9e('0x10'),'queuecallerabandon','queuecallerabandonAt']},'log':'GetVoiceQueueReports'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueRt.js b/server/services/ami/rpc/voiceQueueRt.js index 036c68a..a5187d6 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 _0x0f1c=['../client','getVoiceQueueRtPauses','Request','GetVoiceQueueRtPauses'];(function(_0x424d6f,_0x327144){var _0x317e38=function(_0x10d50b){while(--_0x10d50b){_0x424d6f['push'](_0x424d6f['shift']());}};_0x317e38(++_0x327144);}(_0x0f1c,0x1d4));var _0xc0f1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0f1c[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xc0f1('0x0'));exports[_0xc0f1('0x1')]=function(_0x32f3bc){return function(){return client[_0xc0f1('0x2')](_0xc0f1('0x3'),{'options':{'where':{'VoiceQueueId':_0x32f3bc,'paused':!![]},'raw':!![]},'log':_0xc0f1('0x1')});};}; \ No newline at end of file +var _0xb67e=['getVoiceQueueRtPauses','Request','GetVoiceQueueRtPauses','../client'];(function(_0x1ac120,_0x3e7e45){var _0x19b703=function(_0x5f32cb){while(--_0x5f32cb){_0x1ac120['push'](_0x1ac120['shift']());}};_0x19b703(++_0x3e7e45);}(_0xb67e,0xb7));var _0xeb67=function(_0x54d71b,_0x2edf62){_0x54d71b=_0x54d71b-0x0;var _0x4b9249=_0xb67e[_0x54d71b];return _0x4b9249;};'use strict';var client=require(_0xeb67('0x0'));exports[_0xeb67('0x1')]=function(_0x4a3942){return function(){return client[_0xeb67('0x2')](_0xeb67('0x3'),{'options':{'where':{'VoiceQueueId':_0x4a3942,'paused':!![]},'raw':!![]},'log':_0xeb67('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index 1efae74..d886e39 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 _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x190931,_0x760c05){var _0x54fd50=function(_0x5eda3b){while(--_0x5eda3b){_0x190931['push'](_0x190931['shift']());}};_0x54fd50(++_0x760c05);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'use strict';var _=require(_0x7995('0x0'));var client=require(_0x7995('0x1'));exports[_0x7995('0x2')]=function(_0x10a05d){return client['Request'](_0x7995('0x3'),{'body':_[_0x7995('0x4')](_0x10a05d,{'value':_0x10a05d[_0x7995('0x5')]}),'log':_0x7995('0x3')});}; \ No newline at end of file +var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x1ca313,_0x8ec7e1){var _0x163831=function(_0x3f35d0){while(--_0x3f35d0){_0x1ca313['push'](_0x1ca313['shift']());}};_0x163831(++_0x8ec7e1);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x7995('0x0'));var client=require(_0x7995('0x1'));exports[_0x7995('0x2')]=function(_0x10a05d){return client['Request'](_0x7995('0x3'),{'body':_[_0x7995('0x4')](_0x10a05d,{'value':_0x10a05d[_0x7995('0x5')]}),'log':_0x7995('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index 70ef161..26e4903 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 _0xf7d9=['transfererconnectedlinename','transfereraccountcode','transfererexten','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','isexternal','context','extension','attendedTransfer','origtransferercalleridnum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetaccountcode','transfertargetcontext','transfertargetlinkedid','origtransferercontext','origtransfererexten','attended','../client','transfers','blindTransfer','Request','CreateVoiceTransferReport','result','transferercalleridnum','transferercalleridname','transfererconnectedlinenum'];(function(_0x3c058b,_0x173ede){var _0x3ea5a7=function(_0x78c1cd){while(--_0x78c1cd){_0x3c058b['push'](_0x3c058b['shift']());}};_0x3ea5a7(++_0x173ede);}(_0xf7d9,0x6c));var _0x9f7d=function(_0x4af351,_0x280e2d){_0x4af351=_0x4af351-0x0;var _0x41eb58=_0xf7d9[_0x4af351];return _0x41eb58;};'use strict';var client=require(_0x9f7d('0x0'));exports[_0x9f7d('0x1')]={};exports[_0x9f7d('0x2')]=function(_0x565f9d){return client[_0x9f7d('0x3')](_0x9f7d('0x4'),{'body':{'result':_0x565f9d[_0x9f7d('0x5')],'transfererchannel':_0x565f9d['transfererchannel'],'transferercalleridnum':_0x565f9d[_0x9f7d('0x6')],'transferercalleridname':_0x565f9d[_0x9f7d('0x7')],'transfererconnectedlinenum':_0x565f9d[_0x9f7d('0x8')],'transfererconnectedlinename':_0x565f9d[_0x9f7d('0x9')],'transfereraccountcode':_0x565f9d[_0x9f7d('0xa')],'transferercontext':_0x565f9d['transferercontext'],'transfererexten':_0x565f9d[_0x9f7d('0xb')],'transfererlinkedid':_0x565f9d['transfererlinkedid'],'transfereechannel':_0x565f9d[_0x9f7d('0xc')],'transfereecalleridnum':_0x565f9d[_0x9f7d('0xd')],'transfereecalleridname':_0x565f9d[_0x9f7d('0xe')],'transfereeconnectedlinenum':_0x565f9d[_0x9f7d('0xf')],'transfereeconnectedlinename':_0x565f9d[_0x9f7d('0x10')],'transfereeaccountcode':_0x565f9d[_0x9f7d('0x11')],'transfereecontext':_0x565f9d[_0x9f7d('0x12')],'transfereeexten':_0x565f9d[_0x9f7d('0x13')],'transfereelinkedid':_0x565f9d[_0x9f7d('0x14')],'isexternal':_0x565f9d[_0x9f7d('0x15')],'context':_0x565f9d[_0x9f7d('0x16')],'extension':_0x565f9d[_0x9f7d('0x17')],'type':'blind'},'log':_0x9f7d('0x4')});};exports[_0x9f7d('0x18')]=function(_0x47e782){return client[_0x9f7d('0x3')](_0x9f7d('0x4'),{'body':{'result':_0x47e782['result'],'transfererchannel':_0x47e782['origtransfererchannel'],'transferercalleridnum':_0x47e782[_0x9f7d('0x19')],'transferercalleridname':_0x47e782['origtransferercalleridname'],'transfererconnectedlinenum':_0x47e782['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x47e782[_0x9f7d('0x1a')],'transfereraccountcode':_0x47e782[_0x9f7d('0x1b')],'transferercontext':_0x47e782[_0x9f7d('0x1c')],'transfererexten':_0x47e782[_0x9f7d('0x1d')],'transfererlinkedid':_0x47e782[_0x9f7d('0x1e')],'transfereechannel':_0x47e782['transfertargetchannel'],'transfereecalleridnum':_0x47e782['transfertargetcalleridnum'],'transfereecalleridname':_0x47e782[_0x9f7d('0x1f')],'transfereeconnectedlinenum':_0x47e782[_0x9f7d('0x20')],'transfereeconnectedlinename':_0x47e782['transfertargetconnectedlinename'],'transfereeaccountcode':_0x47e782[_0x9f7d('0x21')],'transfereecontext':_0x47e782[_0x9f7d('0x22')],'transfereeexten':_0x47e782['transfertargetexten'],'transfereelinkedid':_0x47e782[_0x9f7d('0x23')],'isexternal':_0x47e782['isexternal'],'context':_0x47e782[_0x9f7d('0x24')],'extension':_0x47e782[_0x9f7d('0x25')],'type':_0x9f7d('0x26')},'log':'CreateVoiceTransferReport'});}; \ No newline at end of file +var _0x40fc=['Request','CreateVoiceTransferReport','result','transfererchannel','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererlinkedid','transfereechannel','transfereecalleridname','transfereeaccountcode','transfereecontext','transfereeexten','isexternal','context','extension','blind','attendedTransfer','origtransfererchannel','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','secondtransfererexten','origtransfererlinkedid','transfertargetcalleridname','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','origtransferercontext','origtransfererexten','attended','transfers','blindTransfer'];(function(_0x2067c1,_0x4ad413){var _0x4c2968=function(_0x51df02){while(--_0x51df02){_0x2067c1['push'](_0x2067c1['shift']());}};_0x4c2968(++_0x4ad413);}(_0x40fc,0x1da));var _0xc40f=function(_0x354404,_0x141542){_0x354404=_0x354404-0x0;var _0x1c10f8=_0x40fc[_0x354404];return _0x1c10f8;};'use strict';var client=require('../client');exports[_0xc40f('0x0')]={};exports[_0xc40f('0x1')]=function(_0x400377){return client[_0xc40f('0x2')](_0xc40f('0x3'),{'body':{'result':_0x400377[_0xc40f('0x4')],'transfererchannel':_0x400377[_0xc40f('0x5')],'transferercalleridnum':_0x400377['transferercalleridnum'],'transferercalleridname':_0x400377['transferercalleridname'],'transfererconnectedlinenum':_0x400377[_0xc40f('0x6')],'transfererconnectedlinename':_0x400377[_0xc40f('0x7')],'transfereraccountcode':_0x400377[_0xc40f('0x8')],'transferercontext':_0x400377[_0xc40f('0x9')],'transfererexten':_0x400377['transfererexten'],'transfererlinkedid':_0x400377[_0xc40f('0xa')],'transfereechannel':_0x400377[_0xc40f('0xb')],'transfereecalleridnum':_0x400377['transfereecalleridnum'],'transfereecalleridname':_0x400377[_0xc40f('0xc')],'transfereeconnectedlinenum':_0x400377['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x400377['transfereeconnectedlinename'],'transfereeaccountcode':_0x400377[_0xc40f('0xd')],'transfereecontext':_0x400377[_0xc40f('0xe')],'transfereeexten':_0x400377[_0xc40f('0xf')],'transfereelinkedid':_0x400377['transfereelinkedid'],'isexternal':_0x400377[_0xc40f('0x10')],'context':_0x400377[_0xc40f('0x11')],'extension':_0x400377[_0xc40f('0x12')],'type':_0xc40f('0x13')},'log':_0xc40f('0x3')});};exports[_0xc40f('0x14')]=function(_0x427d9c){return client['Request'](_0xc40f('0x3'),{'body':{'result':_0x427d9c[_0xc40f('0x4')],'transfererchannel':_0x427d9c[_0xc40f('0x15')],'transferercalleridnum':_0x427d9c['origtransferercalleridnum'],'transferercalleridname':_0x427d9c[_0xc40f('0x16')],'transfererconnectedlinenum':_0x427d9c[_0xc40f('0x17')],'transfererconnectedlinename':_0x427d9c[_0xc40f('0x18')],'transfereraccountcode':_0x427d9c['origtransfereraccountcode'],'transferercontext':_0x427d9c['secondtransferercontext'],'transfererexten':_0x427d9c[_0xc40f('0x19')],'transfererlinkedid':_0x427d9c[_0xc40f('0x1a')],'transfereechannel':_0x427d9c['transfertargetchannel'],'transfereecalleridnum':_0x427d9c['transfertargetcalleridnum'],'transfereecalleridname':_0x427d9c[_0xc40f('0x1b')],'transfereeconnectedlinenum':_0x427d9c['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x427d9c[_0xc40f('0x1c')],'transfereeaccountcode':_0x427d9c[_0xc40f('0x1d')],'transfereecontext':_0x427d9c[_0xc40f('0x1e')],'transfereeexten':_0x427d9c['transfertargetexten'],'transfereelinkedid':_0x427d9c['transfertargetlinkedid'],'isexternal':_0x427d9c['isexternal'],'context':_0x427d9c[_0xc40f('0x1f')],'extension':_0x427d9c[_0xc40f('0x20')],'type':_0xc40f('0x21')},'log':_0xc40f('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 2130996..5f01f40 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 _0xb10b=['type','Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound','filter','count','rows','voicequeuechannel','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','telephones','trunks','run','event','Event\x20name\x20mandatory','faxAccounts','send','checkAfterSend','server','http','127.0.0.1','RPC\x20listening\x20on\x20port:','lodash','jayson/promise','validate','moment','../properties','../ami','../model/voiceQueueSummary','listen','format','%s/%s','SIP','name','timers','timer','updateAcw','agents','voiceStatus','pause','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','join','pick','keys','module','action','Reload','Action','then','message','catch','command','Command','content','voiceQueues','hasOwnProperty','push','length','find','omit','undefined','values','voicechannel','map','channels','uniqueid','channel','%s.%s','filename','wav','ai(mixmonitorid)','/var/spool/asterisk/monitor/','toLowerCase','mixmonitorid','rec','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','resolve','StopMixMonitor','destinationchannel','monitors','stop','queueChannels','inbound','outbound','includes'];(function(_0x57d370,_0xf38291){var _0x290161=function(_0x7b8540){while(--_0x7b8540){_0x57d370['push'](_0x57d370['shift']());}};_0x290161(++_0xf38291);}(_0xb10b,0x12a));var _0xbb10=function(_0x21abf1,_0xcd06d){_0x21abf1=_0x21abf1-0x0;var _0x8f3ba=_0xb10b[_0x21abf1];return _0x8f3ba;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var jayson=require(_0xbb10('0x1'));var schema=require(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var config=require('../../../config/environment');var properties=require(_0xbb10('0x4'));var ami=require(_0xbb10('0x5'));var VoiceQueueSummary=require(_0xbb10('0x6'));exports[_0xbb10('0x7')]=function(_0x49baf4,_0x312b72,_0x481979){return new Promise(function(_0x328583,_0x3cdd53){var _0x513741={'QueuePause':function(_0x1b9e94){return new Promise(function(_0x3fb675){var _0x21370f=util[_0xbb10('0x8')](_0xbb10('0x9'),_0xbb10('0xa'),_0x1b9e94[_0xbb10('0xb')]);if(_0x49baf4[_0xbb10('0xc')]&&_0x49baf4['timers'][_0x21370f]&&_0x49baf4['timers'][_0x21370f][_0xbb10('0xd')]){_0x49baf4[_0xbb10('0xc')][_0x21370f][_0xbb10('0xe')]();}if(_0x49baf4['agents'][_0x21370f]){_0x49baf4[_0xbb10('0xf')][_0x21370f]['updateStatusRealtime']({'state':_0x49baf4[_0xbb10('0xf')][_0x21370f][_0xbb10('0x10')],'statePause':_0x1b9e94[_0xbb10('0x11')]?!![]:![]});}_0x3fb675({'code':0xc8,'message':_0xbb10('0x12')});});},'Reload':function(_0x442548){var _0x147230=this;return new Promise(function(_0x58a612,_0x26e021){if(ami[_0xbb10('0x13')]()==![]){return _0x26e021(_0x147230[_0xbb10('0x14')](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],_0xbb10('0x17')][_0xbb10('0x18')]('\x20')));}_0x442548=_[_0xbb10('0x19')](_0x442548,_[_0xbb10('0x1a')](properties['reload'][_0xbb10('0x1b')]));_0x442548[_0xbb10('0x1c')]=_0xbb10('0x1d');return ami[_0xbb10('0x1e')](_0x442548)[_0xbb10('0x1f')](function(_0x1682a4){_0x58a612({'code':0xc8,'message':_0x1682a4[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0xbf2906){_0x26e021(_0x147230[_0xbb10('0x14')](0x1f5,_0xbf2906['message']));});});},'Command':function(_0x5ff0cf){var _0x19f48d=this;return new Promise(function(_0x388fab,_0x109908){if(ami[_0xbb10('0x13')]()==![]){return _0x109908(_0x19f48d[_0xbb10('0x14')](0x1f4,[config['asterisk']['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],'ami\x20disconnected']['join']('\x20')));}_0x5ff0cf=_[_0xbb10('0x19')](_0x5ff0cf,_0xbb10('0x22'));_0x5ff0cf[_0xbb10('0x1c')]=_0xbb10('0x23');return ami[_0xbb10('0x1e')](_0x5ff0cf)[_0xbb10('0x1f')](function(_0x407cb4){_0x388fab({'code':0xc8,'message':_0x407cb4[_0xbb10('0x24')]});})[_0xbb10('0x21')](function(_0x395404){_0x109908(_0x19f48d[_0xbb10('0x14')](0x1f5,_0x395404[_0xbb10('0x20')]));});});},'VoiceQueues':function(){return new Promise(function(_0x537898){var _0x4fedac=[];for(var _0x4fb5e0 in _0x49baf4[_0xbb10('0x25')]){if(_0x49baf4[_0xbb10('0x25')][_0xbb10('0x26')](_0x4fb5e0)){var _0x4e25ff=_0x49baf4[_0xbb10('0x25')][_0x4fb5e0];var _0x24d586=new VoiceQueueSummary(_0x4e25ff);_0x4fedac[_0xbb10('0x27')](_0x24d586);}}_0x537898({'count':_0x4fedac[_0xbb10('0x28')],'rows':_0x4fedac});});},'UpdateVoiceQueue':function(_0x1acce9){return new Promise(function(_0x20d946,_0x2a0e8b){var _0x4aabb9=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x25')],{'id':parseInt(_0x1acce9['id'])});var _0xfc3595=_[_0xbb10('0x2a')](_0x1acce9,['id']);if(_0x4aabb9){for(var _0x1d30aa in _0xfc3595){if(typeof _0xfc3595[_0x1d30aa]!==_0xbb10('0x2b')&&typeof _0x4aabb9[_0x1d30aa]!=='undefined'){_0x4aabb9[_0x1d30aa]=_0xfc3595[_0x1d30aa];}}_0x20d946(_0x4aabb9);}else{_0x2a0e8b();}});},'VoiceChannels':function(){return new Promise(function(_0x221624){var _0x4ee02e=_[_0xbb10('0x2c')](_0x49baf4['channels']);_0x221624({'count':_0x4ee02e[_0xbb10('0x28')],'rows':_0x4ee02e});});},'VoiceChannelMixMonitor':function(_0x1dcc9c){var _0x1b59f9=this;return new Promise(function(_0x491db4,_0x518d47){if(ami[_0xbb10('0x13')]()==![]){return _0x518d47(_0x1b59f9[_0xbb10('0x14')](0x1f4,[config['asterisk']['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],_0xbb10('0x17')][_0xbb10('0x18')]('\x20')));}var _0x37a83f=schema(properties[_0xbb10('0x2d')])[_0xbb10('0x2')](_0x1dcc9c);if(_0x37a83f['length']>0x0){return _0x518d47(_0x1b59f9[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x37a83f,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0xfb2c5e=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x2f')],{'uniqueid':_0x1dcc9c[_0xbb10('0x30')]});if(_0xfb2c5e&&_0xfb2c5e[_0xbb10('0x31')]){var _0x56943c=util[_0xbb10('0x8')](_0xbb10('0x32'),_0x1dcc9c[_0xbb10('0x33')]||_0x1dcc9c[_0xbb10('0x30')],_0x1dcc9c['format']||_0xbb10('0x34'));return ami['Action']({'action':'MixMonitor','channel':_0xfb2c5e[_0xbb10('0x31')],'file':_0x56943c,'options':_0xbb10('0x35')})[_0xbb10('0x1f')](function(_0x120d21){var _0x15d895=_[_0xbb10('0x29')](_0xfb2c5e['monitors'],{'filename':_0xbb10('0x36')+_0x56943c[_0xbb10('0x37')]()});if(_['isNil'](_0x15d895)){_0xfb2c5e['monitors']['push']({'filename':_0xbb10('0x36')+_0x56943c[_0xbb10('0x37')](),'createdAt':moment()[_0xbb10('0x8')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x120d21[_0xbb10('0x38')],'status':_0xbb10('0x39')});}else{_0x15d895[_0xbb10('0x38')]=_0x120d21['mixmonitorid'];_0x15d895[_0xbb10('0x3a')]=_0xbb10('0x39');}_0x491db4({'code':0xc8,'message':[_0x1dcc9c[_0xbb10('0x30')],_0xbb10('0x3b'),_0x120d21['mixmonitorid']][_0xbb10('0x18')]('\x20'),'mixmonitorid':_0x120d21[_0xbb10('0x38')]});})['catch'](function(_0xe2040f){_0x518d47(_0x1b59f9[_0xbb10('0x14')](0x1f5,[_0x1dcc9c[_0xbb10('0x30')],_0xe2040f[_0xbb10('0x20')][_0xbb10('0x37')]()][_0xbb10('0x18')]('\x20')));});}else{return _0x518d47(_0x1b59f9['error'](0x1f5,_0xbb10('0x3c')));}});},'VoiceChannelStopMixMonitor':function(_0x1c7fae){var _0x3e7b4c=this;return new Promise(function(_0x3d3c41,_0x4943d9){if(ami[_0xbb10('0x13')]()==![]){return _0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')]['username'],_0xbb10('0x17')][_0xbb10('0x18')]('\x20')));}var _0x54ac18=schema(properties['voicechannel'])[_0xbb10('0x2')](_0x1c7fae);if(_0x54ac18['length']>0x0){return _0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x54ac18,'message')[_0xbb10('0x18')](',\x20')));}var _0x1d82bf=_[_0xbb10('0x29')](_0x49baf4['channels'],{'uniqueid':_0x1c7fae[_0xbb10('0x30')]});if(_0x1d82bf){return Promise[_0xbb10('0x3d')]()[_0xbb10('0x1f')](function(){if(_0x1d82bf[_0xbb10('0x31')]){return ami[_0xbb10('0x1e')]({'action':_0xbb10('0x3e'),'channel':_0x1d82bf[_0xbb10('0x31')],'mixmonitorid':_0x1c7fae[_0xbb10('0x38')]})[_0xbb10('0x21')](function(){});}})[_0xbb10('0x1f')](function(){if(_0x1d82bf[_0xbb10('0x3f')]){return ami[_0xbb10('0x1e')]({'action':'StopMixMonitor','channel':_0x1d82bf[_0xbb10('0x3f')],'mixmonitorid':_0x1c7fae[_0xbb10('0x38')]})['catch'](function(){});}})[_0xbb10('0x1f')](function(){var _0x2f5027=_[_0xbb10('0x29')](_0x1d82bf[_0xbb10('0x40')],{'mixmonitorid':_0x1c7fae[_0xbb10('0x38')]});if(_0x2f5027){_0x2f5027[_0xbb10('0x3a')]=_0xbb10('0x41');}})['then'](function(){var _0x4a9793=util[_0xbb10('0x8')](_0xbb10('0x32'),_0x1c7fae[_0xbb10('0x33')]||_0x1c7fae['uniqueid'],_0x1c7fae['format']||_0xbb10('0x34'));var _0x34cf4e=_[_0xbb10('0x29')](_0x1d82bf[_0xbb10('0x40')],{'filename':_0xbb10('0x36')+_0x4a9793[_0xbb10('0x37')]()});if(_0x34cf4e){_0x34cf4e[_0xbb10('0x3a')]=_0xbb10('0x41');}})[_0xbb10('0x1f')](function(){_0x3d3c41({'code':0xc8,'message':[_0x1c7fae[_0xbb10('0x30')],'StopMixMonitor\x20Success']['join']('\x20')});})[_0xbb10('0x21')](function(_0x467dba){_0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f5,[_0x1c7fae[_0xbb10('0x30')],_0x467dba[_0xbb10('0x20')][_0xbb10('0x37')]()][_0xbb10('0x18')]('\x20')));});}else{return _0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'VoiceQueuesChannels':function(_0x1214f7){var _0x19ca3e=this;return new Promise(function(_0x20e18a){var _0x61e689=_[_0xbb10('0x2c')](_0x49baf4[_0xbb10('0x42')]);var _0x547a7a={'count':_0x61e689[_0xbb10('0x28')],'rows':_0x61e689};if(_0x1214f7&&_0x1214f7['type']){if(![_0xbb10('0x43'),_0xbb10('0x44')][_0xbb10('0x45')](_0x1214f7[_0xbb10('0x46')])){return _0x3cdd53(_0x19ca3e[_0xbb10('0x14')](0x190,_0xbb10('0x47')));}var _0x2e3326=_[_0xbb10('0x48')](_0x61e689,function(_0x180400){return _0x180400[_0xbb10('0x46')]===_0x1214f7[_0xbb10('0x46')];});_0x547a7a[_0xbb10('0x49')]=_0x2e3326[_0xbb10('0x28')];_0x547a7a[_0xbb10('0x4a')]=_0x2e3326;}_0x20e18a(_0x547a7a);});},'VoiceQueuesChannel':function(_0x4475e1){var _0x5de0cc=this;return new Promise(function(_0x4571b6,_0x466eb7){var _0x1b83a9=schema(properties[_0xbb10('0x4b')])[_0xbb10('0x2')](_0x4475e1);if(_0x1b83a9[_0xbb10('0x28')]>0x0){return _0x466eb7(_0x5de0cc['error'](0x1f4,_[_0xbb10('0x2e')](_0x1b83a9,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0x14fed3=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x42')],{'uniqueid':_0x4475e1[_0xbb10('0x30')]});if(_0x14fed3){_0x4571b6(_0x14fed3);}else{return _0x466eb7(_0x5de0cc[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'VoiceQueuesChannelHangup':function(_0x40c4fb){var _0x2eb05a=this;return new Promise(function(_0x2a1ce1,_0x16932f){if(ami['isConnected']()==![]){return _0x16932f(_0x2eb05a['error'](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],_0xbb10('0x17')]['join']('\x20')));}var _0x506498=schema(properties[_0xbb10('0x4c')])[_0xbb10('0x2')](_0x40c4fb);if(_0x506498[_0xbb10('0x28')]>0x0){return _0x16932f(_0x2eb05a[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x506498,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0x4a5fb9=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x42')],{'uniqueid':_0x40c4fb['uniqueid']});if(_0x4a5fb9&&_0x4a5fb9['channel']){return ami['Action']({'action':_0xbb10('0x4d'),'channel':_0x4a5fb9[_0xbb10('0x31')]})[_0xbb10('0x1f')](function(_0x5bd1c0){_0x2a1ce1({'code':0xc8,'message':[_0x40c4fb['uniqueid'],_0x5bd1c0['message'][_0xbb10('0x37')]()][_0xbb10('0x18')]('\x20')});})[_0xbb10('0x21')](function(_0x4e9fbd){_0x16932f(_0x2eb05a[_0xbb10('0x14')](0x1f5,[_0x40c4fb[_0xbb10('0x30')],_0x4e9fbd['message']['toLowerCase']()][_0xbb10('0x18')]('\x20')));});}else{return _0x16932f(_0x2eb05a[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'VoiceQueuesChannelRedirect':function(_0x237246){var _0x54b7c5=this;return new Promise(function(_0x43eaec,_0xec48ac){if(ami[_0xbb10('0x13')]()==![]){return _0xec48ac(_0x54b7c5['error'](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],'ami\x20disconnected'][_0xbb10('0x18')]('\x20')));}var _0x31e85e=schema(properties[_0xbb10('0x4e')])[_0xbb10('0x2')](_0x237246);if(_0x31e85e['length']>0x0){return _0xec48ac(_0x54b7c5[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x31e85e,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0x56b3a3=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x42')],{'uniqueid':_0x237246[_0xbb10('0x30')]});if(_0x56b3a3&&_0x56b3a3[_0xbb10('0x31')]){return ami[_0xbb10('0x1e')]({'action':_0xbb10('0x4f'),'channel':_0x56b3a3[_0xbb10('0x31')],'exten':_0x237246['exten'],'context':_0x237246['context']||_0x56b3a3['context'],'priority':0x1})[_0xbb10('0x1f')](function(_0x9c672d){_0x43eaec({'code':0xc8,'message':[_0x237246[_0xbb10('0x30')],_0x9c672d['message']['toLowerCase']()][_0xbb10('0x18')]('\x20')});})[_0xbb10('0x21')](function(_0xd9e743){_0xec48ac(_0x54b7c5[_0xbb10('0x14')](0x1f5,[_0x237246[_0xbb10('0x30')],_0xd9e743[_0xbb10('0x20')]['toLowerCase']()][_0xbb10('0x18')]('\x20')));});}else{return _0xec48ac(_0x54b7c5[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'Agents':function(_0x14f16b){return new Promise(function(_0x2aaaa6){var _0x5bfc68=_['values'](_0x49baf4['agents']);if(_0x14f16b&&_0x14f16b['id']){var _0x329da7=_[_0xbb10('0x29')](_0x5bfc68,function(_0x36917f){return _0x36917f['id']===_0x14f16b['id'];});_0x2aaaa6(_0x329da7);}else{_0x2aaaa6({'count':_0x5bfc68[_0xbb10('0x28')],'rows':_0x5bfc68});}});},'Telephones':function(){return new Promise(function(_0x2f7d2a){var _0x1d40b8=_['values'](_0x49baf4[_0xbb10('0x50')]);_0x2f7d2a({'count':_0x1d40b8['length'],'rows':_0x1d40b8});});},'Trunks':function(){return new Promise(function(_0x4fe3b5){var _0x519a54=_[_0xbb10('0x2c')](_0x49baf4[_0xbb10('0x51')]);_0x4fe3b5({'count':_0x519a54[_0xbb10('0x28')],'rows':_0x519a54});});},'OutboundChannels':function(){return new Promise(function(_0x108f99){var _0x5ce94f=_[_0xbb10('0x2c')](_0x49baf4['outboundChannels']);_0x108f99({'count':_0x5ce94f['length'],'rows':_0x5ce94f});});},'Outbound':function(){return new Promise(function(_0x165fe9){_0x165fe9(_0x49baf4[_0xbb10('0x44')]);});},'Campaigns':function(){return new Promise(function(_0x29529c){var _0x2bd2ab=_[_0xbb10('0x2c')](_0x49baf4['campaigns']);_0x29529c({'count':_0x2bd2ab[_0xbb10('0x28')],'rows':_0x2bd2ab});});},'VoiceQueuesPreview':function(_0x19fcec){var _0x2c6429=this;return new Promise(function(_0x3f3d38,_0x43cdb7){_0x312b72[_0xbb10('0x52')](_0x19fcec['id'])[_0xbb10('0x1f')](function(_0x53fa98){_0x3f3d38({'code':0xc8,'message':_0x53fa98[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0x30f3ea){_0x43cdb7(_0x2c6429[_0xbb10('0x14')](0x1f4,_0x30f3ea[_0xbb10('0x20')]));});});},'EventManager':function(_0x172be3){var _0xa3b23=this;return new Promise(function(_0x312a08,_0x5a4429){if(!_0x172be3[_0xbb10('0x53')]){return _0x5a4429(_0xa3b23[_0xbb10('0x14')](0x1f4,_0xbb10('0x54')));}ami['emit']('custom:'+_0x172be3['event'],_0x172be3[_0xbb10('0x20')]);_0x312a08({'code':0xc8,'message':_0x172be3});});},'FaxAccounts':function(){return new Promise(function(_0x5a3c44){var _0x4e3d6a=_[_0xbb10('0x2c')](_0x49baf4[_0xbb10('0x55')]);_0x5a3c44({'count':_0x4e3d6a[_0xbb10('0x28')],'rows':_0x4e3d6a});});},'SendFax':function(_0x12ed63){var _0x32ec27=this;return new Promise(function(_0x24dca6,_0x33116){_0x481979[_0xbb10('0x56')](_0x12ed63)[_0xbb10('0x1f')](function(_0x5206e1){_0x24dca6({'code':0xc8,'message':_0x5206e1[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0x46b6d2){_0x33116(_0x32ec27[_0xbb10('0x14')](0x1f4,_0x46b6d2['message']));});});},'CheckAfterSend':function(_0x4c0795){var _0x3547a3=this;return new Promise(function(_0x2280bd,_0x30f0a4){_0x481979[_0xbb10('0x57')](_0x4c0795)['then'](function(_0x17d596){_0x2280bd({'code':0xc8,'message':_0x17d596[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0xf7b3e1){_0x30f0a4(_0x3547a3[_0xbb10('0x14')](0x1f4,_0xf7b3e1['message']));});});}};var _0x5f0691=jayson[_0xbb10('0x58')](_0x513741)[_0xbb10('0x59')]();_0x5f0691['on'](_0xbb10('0x14'),function(_0x5239da){return _0x3cdd53(_0x5239da);});_0x5f0691[_0xbb10('0x7')](0x232a,_0xbb10('0x5a'),function(){console['log']('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x328583(_0xbb10('0x5b')+0x232a);});});}; \ No newline at end of file +var _0xb10b=['type','Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound','filter','count','rows','voicequeuechannel','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','telephones','trunks','run','event','Event\x20name\x20mandatory','faxAccounts','send','checkAfterSend','server','http','127.0.0.1','RPC\x20listening\x20on\x20port:','lodash','jayson/promise','validate','moment','../properties','../ami','../model/voiceQueueSummary','listen','format','%s/%s','SIP','name','timers','timer','updateAcw','agents','voiceStatus','pause','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','join','pick','keys','module','action','Reload','Action','then','message','catch','command','Command','content','voiceQueues','hasOwnProperty','push','length','find','omit','undefined','values','voicechannel','map','channels','uniqueid','channel','%s.%s','filename','wav','ai(mixmonitorid)','/var/spool/asterisk/monitor/','toLowerCase','mixmonitorid','rec','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','resolve','StopMixMonitor','destinationchannel','monitors','stop','queueChannels','inbound','outbound','includes'];(function(_0x23aa9e,_0x4994f4){var _0x5f50e0=function(_0x8276f0){while(--_0x8276f0){_0x23aa9e['push'](_0x23aa9e['shift']());}};_0x5f50e0(++_0x4994f4);}(_0xb10b,0x12a));var _0xbb10=function(_0x574ce3,_0x59eef4){_0x574ce3=_0x574ce3-0x0;var _0x3447a0=_0xb10b[_0x574ce3];return _0x3447a0;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var jayson=require(_0xbb10('0x1'));var schema=require(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var config=require('../../../config/environment');var properties=require(_0xbb10('0x4'));var ami=require(_0xbb10('0x5'));var VoiceQueueSummary=require(_0xbb10('0x6'));exports[_0xbb10('0x7')]=function(_0x49baf4,_0x312b72,_0x481979){return new Promise(function(_0x328583,_0x3cdd53){var _0x513741={'QueuePause':function(_0x1b9e94){return new Promise(function(_0x3fb675){var _0x21370f=util[_0xbb10('0x8')](_0xbb10('0x9'),_0xbb10('0xa'),_0x1b9e94[_0xbb10('0xb')]);if(_0x49baf4[_0xbb10('0xc')]&&_0x49baf4['timers'][_0x21370f]&&_0x49baf4['timers'][_0x21370f][_0xbb10('0xd')]){_0x49baf4[_0xbb10('0xc')][_0x21370f][_0xbb10('0xe')]();}if(_0x49baf4['agents'][_0x21370f]){_0x49baf4[_0xbb10('0xf')][_0x21370f]['updateStatusRealtime']({'state':_0x49baf4[_0xbb10('0xf')][_0x21370f][_0xbb10('0x10')],'statePause':_0x1b9e94[_0xbb10('0x11')]?!![]:![]});}_0x3fb675({'code':0xc8,'message':_0xbb10('0x12')});});},'Reload':function(_0x442548){var _0x147230=this;return new Promise(function(_0x58a612,_0x26e021){if(ami[_0xbb10('0x13')]()==![]){return _0x26e021(_0x147230[_0xbb10('0x14')](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],_0xbb10('0x17')][_0xbb10('0x18')]('\x20')));}_0x442548=_[_0xbb10('0x19')](_0x442548,_[_0xbb10('0x1a')](properties['reload'][_0xbb10('0x1b')]));_0x442548[_0xbb10('0x1c')]=_0xbb10('0x1d');return ami[_0xbb10('0x1e')](_0x442548)[_0xbb10('0x1f')](function(_0x1682a4){_0x58a612({'code':0xc8,'message':_0x1682a4[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0xbf2906){_0x26e021(_0x147230[_0xbb10('0x14')](0x1f5,_0xbf2906['message']));});});},'Command':function(_0x5ff0cf){var _0x19f48d=this;return new Promise(function(_0x388fab,_0x109908){if(ami[_0xbb10('0x13')]()==![]){return _0x109908(_0x19f48d[_0xbb10('0x14')](0x1f4,[config['asterisk']['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],'ami\x20disconnected']['join']('\x20')));}_0x5ff0cf=_[_0xbb10('0x19')](_0x5ff0cf,_0xbb10('0x22'));_0x5ff0cf[_0xbb10('0x1c')]=_0xbb10('0x23');return ami[_0xbb10('0x1e')](_0x5ff0cf)[_0xbb10('0x1f')](function(_0x407cb4){_0x388fab({'code':0xc8,'message':_0x407cb4[_0xbb10('0x24')]});})[_0xbb10('0x21')](function(_0x395404){_0x109908(_0x19f48d[_0xbb10('0x14')](0x1f5,_0x395404[_0xbb10('0x20')]));});});},'VoiceQueues':function(){return new Promise(function(_0x537898){var _0x4fedac=[];for(var _0x4fb5e0 in _0x49baf4[_0xbb10('0x25')]){if(_0x49baf4[_0xbb10('0x25')][_0xbb10('0x26')](_0x4fb5e0)){var _0x4e25ff=_0x49baf4[_0xbb10('0x25')][_0x4fb5e0];var _0x24d586=new VoiceQueueSummary(_0x4e25ff);_0x4fedac[_0xbb10('0x27')](_0x24d586);}}_0x537898({'count':_0x4fedac[_0xbb10('0x28')],'rows':_0x4fedac});});},'UpdateVoiceQueue':function(_0x1acce9){return new Promise(function(_0x20d946,_0x2a0e8b){var _0x4aabb9=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x25')],{'id':parseInt(_0x1acce9['id'])});var _0xfc3595=_[_0xbb10('0x2a')](_0x1acce9,['id']);if(_0x4aabb9){for(var _0x1d30aa in _0xfc3595){if(typeof _0xfc3595[_0x1d30aa]!==_0xbb10('0x2b')&&typeof _0x4aabb9[_0x1d30aa]!=='undefined'){_0x4aabb9[_0x1d30aa]=_0xfc3595[_0x1d30aa];}}_0x20d946(_0x4aabb9);}else{_0x2a0e8b();}});},'VoiceChannels':function(){return new Promise(function(_0x221624){var _0x4ee02e=_[_0xbb10('0x2c')](_0x49baf4['channels']);_0x221624({'count':_0x4ee02e[_0xbb10('0x28')],'rows':_0x4ee02e});});},'VoiceChannelMixMonitor':function(_0x1dcc9c){var _0x1b59f9=this;return new Promise(function(_0x491db4,_0x518d47){if(ami[_0xbb10('0x13')]()==![]){return _0x518d47(_0x1b59f9[_0xbb10('0x14')](0x1f4,[config['asterisk']['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],_0xbb10('0x17')][_0xbb10('0x18')]('\x20')));}var _0x37a83f=schema(properties[_0xbb10('0x2d')])[_0xbb10('0x2')](_0x1dcc9c);if(_0x37a83f['length']>0x0){return _0x518d47(_0x1b59f9[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x37a83f,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0xfb2c5e=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x2f')],{'uniqueid':_0x1dcc9c[_0xbb10('0x30')]});if(_0xfb2c5e&&_0xfb2c5e[_0xbb10('0x31')]){var _0x56943c=util[_0xbb10('0x8')](_0xbb10('0x32'),_0x1dcc9c[_0xbb10('0x33')]||_0x1dcc9c[_0xbb10('0x30')],_0x1dcc9c['format']||_0xbb10('0x34'));return ami['Action']({'action':'MixMonitor','channel':_0xfb2c5e[_0xbb10('0x31')],'file':_0x56943c,'options':_0xbb10('0x35')})[_0xbb10('0x1f')](function(_0x120d21){var _0x15d895=_[_0xbb10('0x29')](_0xfb2c5e['monitors'],{'filename':_0xbb10('0x36')+_0x56943c[_0xbb10('0x37')]()});if(_['isNil'](_0x15d895)){_0xfb2c5e['monitors']['push']({'filename':_0xbb10('0x36')+_0x56943c[_0xbb10('0x37')](),'createdAt':moment()[_0xbb10('0x8')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x120d21[_0xbb10('0x38')],'status':_0xbb10('0x39')});}else{_0x15d895[_0xbb10('0x38')]=_0x120d21['mixmonitorid'];_0x15d895[_0xbb10('0x3a')]=_0xbb10('0x39');}_0x491db4({'code':0xc8,'message':[_0x1dcc9c[_0xbb10('0x30')],_0xbb10('0x3b'),_0x120d21['mixmonitorid']][_0xbb10('0x18')]('\x20'),'mixmonitorid':_0x120d21[_0xbb10('0x38')]});})['catch'](function(_0xe2040f){_0x518d47(_0x1b59f9[_0xbb10('0x14')](0x1f5,[_0x1dcc9c[_0xbb10('0x30')],_0xe2040f[_0xbb10('0x20')][_0xbb10('0x37')]()][_0xbb10('0x18')]('\x20')));});}else{return _0x518d47(_0x1b59f9['error'](0x1f5,_0xbb10('0x3c')));}});},'VoiceChannelStopMixMonitor':function(_0x1c7fae){var _0x3e7b4c=this;return new Promise(function(_0x3d3c41,_0x4943d9){if(ami[_0xbb10('0x13')]()==![]){return _0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')]['username'],_0xbb10('0x17')][_0xbb10('0x18')]('\x20')));}var _0x54ac18=schema(properties['voicechannel'])[_0xbb10('0x2')](_0x1c7fae);if(_0x54ac18['length']>0x0){return _0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x54ac18,'message')[_0xbb10('0x18')](',\x20')));}var _0x1d82bf=_[_0xbb10('0x29')](_0x49baf4['channels'],{'uniqueid':_0x1c7fae[_0xbb10('0x30')]});if(_0x1d82bf){return Promise[_0xbb10('0x3d')]()[_0xbb10('0x1f')](function(){if(_0x1d82bf[_0xbb10('0x31')]){return ami[_0xbb10('0x1e')]({'action':_0xbb10('0x3e'),'channel':_0x1d82bf[_0xbb10('0x31')],'mixmonitorid':_0x1c7fae[_0xbb10('0x38')]})[_0xbb10('0x21')](function(){});}})[_0xbb10('0x1f')](function(){if(_0x1d82bf[_0xbb10('0x3f')]){return ami[_0xbb10('0x1e')]({'action':'StopMixMonitor','channel':_0x1d82bf[_0xbb10('0x3f')],'mixmonitorid':_0x1c7fae[_0xbb10('0x38')]})['catch'](function(){});}})[_0xbb10('0x1f')](function(){var _0x2f5027=_[_0xbb10('0x29')](_0x1d82bf[_0xbb10('0x40')],{'mixmonitorid':_0x1c7fae[_0xbb10('0x38')]});if(_0x2f5027){_0x2f5027[_0xbb10('0x3a')]=_0xbb10('0x41');}})['then'](function(){var _0x4a9793=util[_0xbb10('0x8')](_0xbb10('0x32'),_0x1c7fae[_0xbb10('0x33')]||_0x1c7fae['uniqueid'],_0x1c7fae['format']||_0xbb10('0x34'));var _0x34cf4e=_[_0xbb10('0x29')](_0x1d82bf[_0xbb10('0x40')],{'filename':_0xbb10('0x36')+_0x4a9793[_0xbb10('0x37')]()});if(_0x34cf4e){_0x34cf4e[_0xbb10('0x3a')]=_0xbb10('0x41');}})[_0xbb10('0x1f')](function(){_0x3d3c41({'code':0xc8,'message':[_0x1c7fae[_0xbb10('0x30')],'StopMixMonitor\x20Success']['join']('\x20')});})[_0xbb10('0x21')](function(_0x467dba){_0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f5,[_0x1c7fae[_0xbb10('0x30')],_0x467dba[_0xbb10('0x20')][_0xbb10('0x37')]()][_0xbb10('0x18')]('\x20')));});}else{return _0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'VoiceQueuesChannels':function(_0x1214f7){var _0x19ca3e=this;return new Promise(function(_0x20e18a){var _0x61e689=_[_0xbb10('0x2c')](_0x49baf4[_0xbb10('0x42')]);var _0x547a7a={'count':_0x61e689[_0xbb10('0x28')],'rows':_0x61e689};if(_0x1214f7&&_0x1214f7['type']){if(![_0xbb10('0x43'),_0xbb10('0x44')][_0xbb10('0x45')](_0x1214f7[_0xbb10('0x46')])){return _0x3cdd53(_0x19ca3e[_0xbb10('0x14')](0x190,_0xbb10('0x47')));}var _0x2e3326=_[_0xbb10('0x48')](_0x61e689,function(_0x180400){return _0x180400[_0xbb10('0x46')]===_0x1214f7[_0xbb10('0x46')];});_0x547a7a[_0xbb10('0x49')]=_0x2e3326[_0xbb10('0x28')];_0x547a7a[_0xbb10('0x4a')]=_0x2e3326;}_0x20e18a(_0x547a7a);});},'VoiceQueuesChannel':function(_0x4475e1){var _0x5de0cc=this;return new Promise(function(_0x4571b6,_0x466eb7){var _0x1b83a9=schema(properties[_0xbb10('0x4b')])[_0xbb10('0x2')](_0x4475e1);if(_0x1b83a9[_0xbb10('0x28')]>0x0){return _0x466eb7(_0x5de0cc['error'](0x1f4,_[_0xbb10('0x2e')](_0x1b83a9,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0x14fed3=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x42')],{'uniqueid':_0x4475e1[_0xbb10('0x30')]});if(_0x14fed3){_0x4571b6(_0x14fed3);}else{return _0x466eb7(_0x5de0cc[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'VoiceQueuesChannelHangup':function(_0x40c4fb){var _0x2eb05a=this;return new Promise(function(_0x2a1ce1,_0x16932f){if(ami['isConnected']()==![]){return _0x16932f(_0x2eb05a['error'](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],_0xbb10('0x17')]['join']('\x20')));}var _0x506498=schema(properties[_0xbb10('0x4c')])[_0xbb10('0x2')](_0x40c4fb);if(_0x506498[_0xbb10('0x28')]>0x0){return _0x16932f(_0x2eb05a[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x506498,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0x4a5fb9=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x42')],{'uniqueid':_0x40c4fb['uniqueid']});if(_0x4a5fb9&&_0x4a5fb9['channel']){return ami['Action']({'action':_0xbb10('0x4d'),'channel':_0x4a5fb9[_0xbb10('0x31')]})[_0xbb10('0x1f')](function(_0x5bd1c0){_0x2a1ce1({'code':0xc8,'message':[_0x40c4fb['uniqueid'],_0x5bd1c0['message'][_0xbb10('0x37')]()][_0xbb10('0x18')]('\x20')});})[_0xbb10('0x21')](function(_0x4e9fbd){_0x16932f(_0x2eb05a[_0xbb10('0x14')](0x1f5,[_0x40c4fb[_0xbb10('0x30')],_0x4e9fbd['message']['toLowerCase']()][_0xbb10('0x18')]('\x20')));});}else{return _0x16932f(_0x2eb05a[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'VoiceQueuesChannelRedirect':function(_0x237246){var _0x54b7c5=this;return new Promise(function(_0x43eaec,_0xec48ac){if(ami[_0xbb10('0x13')]()==![]){return _0xec48ac(_0x54b7c5['error'](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],'ami\x20disconnected'][_0xbb10('0x18')]('\x20')));}var _0x31e85e=schema(properties[_0xbb10('0x4e')])[_0xbb10('0x2')](_0x237246);if(_0x31e85e['length']>0x0){return _0xec48ac(_0x54b7c5[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x31e85e,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0x56b3a3=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x42')],{'uniqueid':_0x237246[_0xbb10('0x30')]});if(_0x56b3a3&&_0x56b3a3[_0xbb10('0x31')]){return ami[_0xbb10('0x1e')]({'action':_0xbb10('0x4f'),'channel':_0x56b3a3[_0xbb10('0x31')],'exten':_0x237246['exten'],'context':_0x237246['context']||_0x56b3a3['context'],'priority':0x1})[_0xbb10('0x1f')](function(_0x9c672d){_0x43eaec({'code':0xc8,'message':[_0x237246[_0xbb10('0x30')],_0x9c672d['message']['toLowerCase']()][_0xbb10('0x18')]('\x20')});})[_0xbb10('0x21')](function(_0xd9e743){_0xec48ac(_0x54b7c5[_0xbb10('0x14')](0x1f5,[_0x237246[_0xbb10('0x30')],_0xd9e743[_0xbb10('0x20')]['toLowerCase']()][_0xbb10('0x18')]('\x20')));});}else{return _0xec48ac(_0x54b7c5[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'Agents':function(_0x14f16b){return new Promise(function(_0x2aaaa6){var _0x5bfc68=_['values'](_0x49baf4['agents']);if(_0x14f16b&&_0x14f16b['id']){var _0x329da7=_[_0xbb10('0x29')](_0x5bfc68,function(_0x36917f){return _0x36917f['id']===_0x14f16b['id'];});_0x2aaaa6(_0x329da7);}else{_0x2aaaa6({'count':_0x5bfc68[_0xbb10('0x28')],'rows':_0x5bfc68});}});},'Telephones':function(){return new Promise(function(_0x2f7d2a){var _0x1d40b8=_['values'](_0x49baf4[_0xbb10('0x50')]);_0x2f7d2a({'count':_0x1d40b8['length'],'rows':_0x1d40b8});});},'Trunks':function(){return new Promise(function(_0x4fe3b5){var _0x519a54=_[_0xbb10('0x2c')](_0x49baf4[_0xbb10('0x51')]);_0x4fe3b5({'count':_0x519a54[_0xbb10('0x28')],'rows':_0x519a54});});},'OutboundChannels':function(){return new Promise(function(_0x108f99){var _0x5ce94f=_[_0xbb10('0x2c')](_0x49baf4['outboundChannels']);_0x108f99({'count':_0x5ce94f['length'],'rows':_0x5ce94f});});},'Outbound':function(){return new Promise(function(_0x165fe9){_0x165fe9(_0x49baf4[_0xbb10('0x44')]);});},'Campaigns':function(){return new Promise(function(_0x29529c){var _0x2bd2ab=_[_0xbb10('0x2c')](_0x49baf4['campaigns']);_0x29529c({'count':_0x2bd2ab[_0xbb10('0x28')],'rows':_0x2bd2ab});});},'VoiceQueuesPreview':function(_0x19fcec){var _0x2c6429=this;return new Promise(function(_0x3f3d38,_0x43cdb7){_0x312b72[_0xbb10('0x52')](_0x19fcec['id'])[_0xbb10('0x1f')](function(_0x53fa98){_0x3f3d38({'code':0xc8,'message':_0x53fa98[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0x30f3ea){_0x43cdb7(_0x2c6429[_0xbb10('0x14')](0x1f4,_0x30f3ea[_0xbb10('0x20')]));});});},'EventManager':function(_0x172be3){var _0xa3b23=this;return new Promise(function(_0x312a08,_0x5a4429){if(!_0x172be3[_0xbb10('0x53')]){return _0x5a4429(_0xa3b23[_0xbb10('0x14')](0x1f4,_0xbb10('0x54')));}ami['emit']('custom:'+_0x172be3['event'],_0x172be3[_0xbb10('0x20')]);_0x312a08({'code':0xc8,'message':_0x172be3});});},'FaxAccounts':function(){return new Promise(function(_0x5a3c44){var _0x4e3d6a=_[_0xbb10('0x2c')](_0x49baf4[_0xbb10('0x55')]);_0x5a3c44({'count':_0x4e3d6a[_0xbb10('0x28')],'rows':_0x4e3d6a});});},'SendFax':function(_0x12ed63){var _0x32ec27=this;return new Promise(function(_0x24dca6,_0x33116){_0x481979[_0xbb10('0x56')](_0x12ed63)[_0xbb10('0x1f')](function(_0x5206e1){_0x24dca6({'code':0xc8,'message':_0x5206e1[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0x46b6d2){_0x33116(_0x32ec27[_0xbb10('0x14')](0x1f4,_0x46b6d2['message']));});});},'CheckAfterSend':function(_0x4c0795){var _0x3547a3=this;return new Promise(function(_0x2280bd,_0x30f0a4){_0x481979[_0xbb10('0x57')](_0x4c0795)['then'](function(_0x17d596){_0x2280bd({'code':0xc8,'message':_0x17d596[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0xf7b3e1){_0x30f0a4(_0x3547a3[_0xbb10('0x14')](0x1f4,_0xf7b3e1['message']));});});}};var _0x5f0691=jayson[_0xbb10('0x58')](_0x513741)[_0xbb10('0x59')]();_0x5f0691['on'](_0xbb10('0x14'),function(_0x5239da){return _0x3cdd53(_0x5239da);});_0x5f0691[_0xbb10('0x7')](0x232a,_0xbb10('0x5a'),function(){console['log']('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x328583(_0xbb10('0x5b')+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 9e8d129..07f3f47 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 _0x7c93=['updatedAt','resolve','getContacts','then','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','uniqueid','join','data4','calleridname','','Unknown','destcalleridname','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','format','name','trigger:%s','action','merge','ioredis','util','../../../../config/environment','trigger','../../rpc/cmContact','redis','defaults','localhost','socket.io-emitter','info','[CM][%s][%s]','stringify','emit','data1','data2','isNil','data5','xmd-contactid','ListId','data3','split','$or','map','routeId','destcalleridnum','calleridnum','firstName','lastName','phone','mobile','fax','createdAt','scheduledAt'];(function(_0x1caf6a,_0x26a5bf){var _0x1bf493=function(_0x3982f5){while(--_0x3982f5){_0x1caf6a['push'](_0x1caf6a['shift']());}};_0x1bf493(++_0x26a5bf);}(_0x7c93,0x16e));var _0x37c9=function(_0x43b979,_0x40584e){_0x43b979=_0x43b979-0x0;var _0x46b9c4=_0x7c93[_0x43b979];return _0x46b9c4;};'use strict';var _=require('lodash');var BPromise=require('bluebird');var Redis=require(_0x37c9('0x0'));var util=require(_0x37c9('0x1'));var config=require(_0x37c9('0x2'));var logger=require('../../../../config/logger')(_0x37c9('0x3'));var cmContactRpc=require(_0x37c9('0x4'));config[_0x37c9('0x5')]=_[_0x37c9('0x6')](config[_0x37c9('0x5')],{'host':_0x37c9('0x7'),'port':0x18eb});var io=require(_0x37c9('0x8'))(new Redis(config[_0x37c9('0x5')]));function emit(_0x3aa9c8,_0x1c8507,_0x203e1f,_0xfc5e74,_0x2f4c3e){logger[_0x37c9('0x9')](_0x37c9('0xa'),_0x3aa9c8,_0x1c8507['id'],_0x203e1f,_0xfc5e74,JSON[_0x37c9('0xb')](_0x2f4c3e));io['to'](_0x203e1f)[_0x37c9('0xc')](_0xfc5e74,_0x2f4c3e);}exports['exec']=function(_0x8c145f,_0x33f844,_0x348fe0,_0x3de0f0){var _0xb6022f,_0x206499;var _0x17b40d={};var _0x135072;var _0x3f57e8=Number(_0x348fe0[_0x37c9('0xd')]);var _0x146b8a=_0x348fe0[_0x37c9('0xe')]?Boolean(Number(_0x348fe0['data2'])):![];var _0x18b092;var _0x3c0806=![];if(!_[_0x37c9('0xf')](_0x348fe0[_0x37c9('0x10')])){if(_0x348fe0[_0x37c9('0x10')]=='1')_0x3c0806=!![];}if(!_0x3c0806){if(_0x3de0f0[_0x37c9('0x11')]){_0x17b40d['id']=_0x3de0f0[_0x37c9('0x11')];}}if(!_0x17b40d['id']){_0x17b40d[_0x37c9('0x12')]=_0x3f57e8;_0x18b092=_0x348fe0[_0x37c9('0x13')]&&_0x348fe0['data3']!=='0'?_0x348fe0[_0x37c9('0x13')][_0x37c9('0x14')](','):['phone'];_0x17b40d[_0x37c9('0x15')]=_[_0x37c9('0x16')](_0x18b092,function(_0x35b72d){var _0x4ad991={};_0x4ad991[_0x35b72d]=_0x3de0f0[_0x37c9('0x17')]?_0x3de0f0[_0x37c9('0x18')]:_0x3de0f0[_0x37c9('0x19')];return _0x4ad991;});_0x135072=_0x3de0f0['routeId']?_0x3de0f0['destcalleridnum']:_0x3de0f0[_0x37c9('0x19')];}var _0x157350=['id',_0x37c9('0x1a'),_0x37c9('0x1b'),_0x37c9('0x1c'),_0x37c9('0x1d'),_0x37c9('0x1e'),_0x37c9('0x12'),_0x37c9('0x1f'),_0x37c9('0x20'),_0x37c9('0x21')];var _0x3a0f16=_['union'](_0x157350,_0x18b092);BPromise[_0x37c9('0x22')]()['then'](cmContactRpc[_0x37c9('0x23')]({'attributes':_0x3a0f16,'where':_0x17b40d,'phone':_0x135072}))[_0x37c9('0x24')](function(_0x1c0eaf){_0x206499=_0x1c0eaf;if(!_[_0x37c9('0x25')](_0x206499)){if(_0x206499[_0x37c9('0x26')]===0x1){_0xb6022f=_0x206499[0x0];logger[_0x37c9('0x9')](_0x37c9('0x27'),_0x3de0f0['uniqueid'],_0x33f844['id'],_0xb6022f['id']);}else{logger[_0x37c9('0x9')](_0x37c9('0x28'),_0x3de0f0[_0x37c9('0x29')],_0x33f844['id'],_[_0x37c9('0x16')](_0x206499,'id')[_0x37c9('0x2a')](','));}return;}else{logger[_0x37c9('0x9')]('[CM][%s][%s]\x20Contact\x20not\x20found',_0x3de0f0[_0x37c9('0x29')],_0x33f844['id']);var _0x53c7a9={'ListId':_0x3f57e8};var _0xd4455b=_0x348fe0['data4']&&_0x348fe0[_0x37c9('0x2b')]!=='0'?_0x348fe0['data4']:_0x37c9('0x1c');if(_0x146b8a){logger['info']('[CM][%s][%s]\x20Autocreate\x20enabled',_0x3de0f0[_0x37c9('0x29')],_0x33f844['id']);_0x53c7a9[_0xd4455b]=_[_0x37c9('0xf')](_0x3de0f0[_0x37c9('0x17')])?_0x3de0f0['calleridnum']:_0x3de0f0[_0x37c9('0x18')];if(_['isNil'](_0x3de0f0[_0x37c9('0x17')])){_0x53c7a9['firstName']=_0x3de0f0[_0x37c9('0x2c')]&&_0x3de0f0[_0x37c9('0x2c')]!==_0x37c9('0x2d')?_0x3de0f0[_0x37c9('0x2c')]:_0x37c9('0x2e');}else{_0x53c7a9[_0x37c9('0x1a')]=_0x3de0f0[_0x37c9('0x2f')]&&_0x3de0f0['destcalleridname']!==_0x37c9('0x2d')?_0x3de0f0[_0x37c9('0x2f')]:_0x37c9('0x2e');}return BPromise['resolve']()[_0x37c9('0x24')](cmContactRpc[_0x37c9('0x30')](_0x53c7a9))[_0x37c9('0x24')](function(_0x22aefd){_0xb6022f=_0x22aefd;_0x206499[_0x37c9('0x31')](_0x22aefd);if(_0xb6022f){logger[_0x37c9('0x9')](_0x37c9('0x32'),_0x3de0f0['uniqueid'],_0x33f844['id'],_0xb6022f['id']);}return;});}else{logger['info'](_0x37c9('0x33'),_0x3de0f0[_0x37c9('0x29')],_0x33f844['id']);_0x53c7a9[_0xd4455b]=_[_0x37c9('0xf')](_0x3de0f0[_0x37c9('0x17')])?_0x3de0f0['calleridnum']:_0x3de0f0[_0x37c9('0x18')];if(_[_0x37c9('0xf')](_0x3de0f0[_0x37c9('0x17')])){_0x53c7a9[_0x37c9('0x1a')]=_0x3de0f0['calleridname']&&_0x3de0f0['calleridname']!==_0x37c9('0x2d')?_0x3de0f0['calleridname']:_0x37c9('0x2e');}else{_0x53c7a9['firstName']=_0x3de0f0[_0x37c9('0x2f')]&&_0x3de0f0[_0x37c9('0x2f')]!==_0x37c9('0x2d')?_0x3de0f0['destcalleridname']:'Unknown';}_0xb6022f=_0x53c7a9;_0x206499[_0x37c9('0x31')](_0x53c7a9);return;}}})['then'](function(){if(_0x8c145f){emit(_0x3de0f0[_0x37c9('0x29')],_0x33f844,util[_0x37c9('0x34')]('user:%s',_0x8c145f[_0x37c9('0x35')]),util['format'](_0x37c9('0x36'),_0x348fe0[_0x37c9('0x37')]['toLowerCase']()),{'evt':_[_0x37c9('0x38')](_0x3de0f0,{'autoCreate':_0x146b8a}),'contact':_0xb6022f===undefined?{}:_0xb6022f,'contacts':_0x206499[_0x37c9('0x26')]===0x0?undefined:_0x206499});}});}; \ No newline at end of file +var _0xb59b=['createContact','push','format','user:%s','name','trigger:%s','action','toLowerCase','merge','lodash','ioredis','util','../../../../config/environment','trigger','redis','defaults','localhost','socket.io-emitter','info','[CM][%s][%s]','stringify','emit','exec','data1','data2','isNil','data5','xmd-contactid','ListId','data3','split','phone','$or','destcalleridnum','lastName','mobile','fax','createdAt','scheduledAt','updatedAt','union','resolve','getContacts','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','map','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','routeId','calleridnum','firstName','calleridname','','Unknown','destcalleridname','then'];(function(_0x5606c1,_0x1b4d9e){var _0x43f9d9=function(_0x5ee9af){while(--_0x5ee9af){_0x5606c1['push'](_0x5606c1['shift']());}};_0x43f9d9(++_0x1b4d9e);}(_0xb59b,0xbd));var _0xbb59=function(_0x5ad153,_0x1b2d0e){_0x5ad153=_0x5ad153-0x0;var _0x21402c=_0xb59b[_0x5ad153];return _0x21402c;};'use strict';var _=require(_0xbb59('0x0'));var BPromise=require('bluebird');var Redis=require(_0xbb59('0x1'));var util=require(_0xbb59('0x2'));var config=require(_0xbb59('0x3'));var logger=require('../../../../config/logger')(_0xbb59('0x4'));var cmContactRpc=require('../../rpc/cmContact');config[_0xbb59('0x5')]=_[_0xbb59('0x6')](config[_0xbb59('0x5')],{'host':_0xbb59('0x7'),'port':0x18eb});var io=require(_0xbb59('0x8'))(new Redis(config[_0xbb59('0x5')]));function emit(_0x55ee64,_0x2513e3,_0x29cfe2,_0x3ef7a6,_0x2028d0){logger[_0xbb59('0x9')](_0xbb59('0xa'),_0x55ee64,_0x2513e3['id'],_0x29cfe2,_0x3ef7a6,JSON[_0xbb59('0xb')](_0x2028d0));io['to'](_0x29cfe2)[_0xbb59('0xc')](_0x3ef7a6,_0x2028d0);}exports[_0xbb59('0xd')]=function(_0x1952ac,_0x2a9857,_0x48f25a,_0x24d052){var _0x1634f6,_0x545111;var _0x3a5931={};var _0x21ebb6;var _0x1e4e7e=Number(_0x48f25a[_0xbb59('0xe')]);var _0x281fb4=_0x48f25a[_0xbb59('0xf')]?Boolean(Number(_0x48f25a['data2'])):![];var _0x2ff03b;var _0x12b44f=![];if(!_[_0xbb59('0x10')](_0x48f25a[_0xbb59('0x11')])){if(_0x48f25a[_0xbb59('0x11')]=='1')_0x12b44f=!![];}if(!_0x12b44f){if(_0x24d052[_0xbb59('0x12')]){_0x3a5931['id']=_0x24d052['xmd-contactid'];}}if(!_0x3a5931['id']){_0x3a5931[_0xbb59('0x13')]=_0x1e4e7e;_0x2ff03b=_0x48f25a[_0xbb59('0x14')]&&_0x48f25a[_0xbb59('0x14')]!=='0'?_0x48f25a[_0xbb59('0x14')][_0xbb59('0x15')](','):[_0xbb59('0x16')];_0x3a5931[_0xbb59('0x17')]=_['map'](_0x2ff03b,function(_0x23b0ce){var _0x9eaa51={};_0x9eaa51[_0x23b0ce]=_0x24d052['routeId']?_0x24d052[_0xbb59('0x18')]:_0x24d052['calleridnum'];return _0x9eaa51;});_0x21ebb6=_0x24d052['routeId']?_0x24d052[_0xbb59('0x18')]:_0x24d052['calleridnum'];}var _0x5f5d9f=['id','firstName',_0xbb59('0x19'),_0xbb59('0x16'),_0xbb59('0x1a'),_0xbb59('0x1b'),_0xbb59('0x13'),_0xbb59('0x1c'),_0xbb59('0x1d'),_0xbb59('0x1e')];var _0x55d72b=_[_0xbb59('0x1f')](_0x5f5d9f,_0x2ff03b);BPromise[_0xbb59('0x20')]()['then'](cmContactRpc[_0xbb59('0x21')]({'attributes':_0x55d72b,'where':_0x3a5931,'phone':_0x21ebb6}))['then'](function(_0x488680){_0x545111=_0x488680;if(!_[_0xbb59('0x22')](_0x545111)){if(_0x545111[_0xbb59('0x23')]===0x1){_0x1634f6=_0x545111[0x0];logger[_0xbb59('0x9')](_0xbb59('0x24'),_0x24d052['uniqueid'],_0x2a9857['id'],_0x1634f6['id']);}else{logger[_0xbb59('0x9')]('[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]',_0x24d052[_0xbb59('0x25')],_0x2a9857['id'],_[_0xbb59('0x26')](_0x545111,'id')[_0xbb59('0x27')](','));}return;}else{logger['info'](_0xbb59('0x28'),_0x24d052[_0xbb59('0x25')],_0x2a9857['id']);var _0x2aba43={'ListId':_0x1e4e7e};var _0x350556=_0x48f25a[_0xbb59('0x29')]&&_0x48f25a[_0xbb59('0x29')]!=='0'?_0x48f25a['data4']:'phone';if(_0x281fb4){logger[_0xbb59('0x9')](_0xbb59('0x2a'),_0x24d052[_0xbb59('0x25')],_0x2a9857['id']);_0x2aba43[_0x350556]=_[_0xbb59('0x10')](_0x24d052[_0xbb59('0x2b')])?_0x24d052[_0xbb59('0x2c')]:_0x24d052[_0xbb59('0x18')];if(_[_0xbb59('0x10')](_0x24d052[_0xbb59('0x2b')])){_0x2aba43[_0xbb59('0x2d')]=_0x24d052[_0xbb59('0x2e')]&&_0x24d052[_0xbb59('0x2e')]!==_0xbb59('0x2f')?_0x24d052[_0xbb59('0x2e')]:_0xbb59('0x30');}else{_0x2aba43[_0xbb59('0x2d')]=_0x24d052[_0xbb59('0x31')]&&_0x24d052[_0xbb59('0x31')]!==_0xbb59('0x2f')?_0x24d052[_0xbb59('0x31')]:_0xbb59('0x30');}return BPromise['resolve']()[_0xbb59('0x32')](cmContactRpc[_0xbb59('0x33')](_0x2aba43))[_0xbb59('0x32')](function(_0x5b7731){_0x1634f6=_0x5b7731;_0x545111[_0xbb59('0x34')](_0x5b7731);if(_0x1634f6){logger['info']('[CM][%s][%s]\x20Contact\x20created:%s',_0x24d052[_0xbb59('0x25')],_0x2a9857['id'],_0x1634f6['id']);}return;});}else{logger[_0xbb59('0x9')]('[CM][%s][%s]\x20Autocreate\x20disabled',_0x24d052['uniqueid'],_0x2a9857['id']);_0x2aba43[_0x350556]=_[_0xbb59('0x10')](_0x24d052[_0xbb59('0x2b')])?_0x24d052[_0xbb59('0x2c')]:_0x24d052[_0xbb59('0x18')];if(_[_0xbb59('0x10')](_0x24d052[_0xbb59('0x2b')])){_0x2aba43['firstName']=_0x24d052[_0xbb59('0x2e')]&&_0x24d052[_0xbb59('0x2e')]!==_0xbb59('0x2f')?_0x24d052[_0xbb59('0x2e')]:'Unknown';}else{_0x2aba43['firstName']=_0x24d052[_0xbb59('0x31')]&&_0x24d052['destcalleridname']!==_0xbb59('0x2f')?_0x24d052[_0xbb59('0x31')]:_0xbb59('0x30');}_0x1634f6=_0x2aba43;_0x545111[_0xbb59('0x34')](_0x2aba43);return;}}})[_0xbb59('0x32')](function(){if(_0x1952ac){emit(_0x24d052['uniqueid'],_0x2a9857,util[_0xbb59('0x35')](_0xbb59('0x36'),_0x1952ac[_0xbb59('0x37')]),util[_0xbb59('0x35')](_0xbb59('0x38'),_0x48f25a[_0xbb59('0x39')][_0xbb59('0x3a')]()),{'evt':_[_0xbb59('0x3b')](_0x24d052,{'autoCreate':_0x281fb4}),'contact':_0x1634f6===undefined?{}:_0x1634f6,'contacts':_0x545111[_0xbb59('0x23')]===0x0?undefined:_0x545111});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 42e0bef..4311292 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 _0xd0d1=['trigger','../ami','redis','defaults','localhost','popup','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','zendeskAccounts','custom:agentcalled','syncCustomEvent','bind','custom:agentcomplete','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentbusy','custom:amd','custom:queuecallerabandon','syncAgentDial','custom:dialconnect','custom:dialend','custom:newinteraction','custom:closedinteraction','custom:substatus','custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','custom:offlineMessage','emit','info','stringify','undefined','motionChannel','voice','debug','checkTriggers','prototype','hasOwnProperty','status','merge','variables','length','interface','action','toLowerCase','contactmanager','browser','TemplateId','data2','html','render','template\x20not\x20found','uri','buildUri','isNil','data3','location','uriLocation','data4','windowWidth','data5','800','windowHeight','data6','600','winApplication','winArguments','format','user:%s','name','trigger:%s:%s','data1','jscripty','trigger:%s','exec','integration','queue','routeId','urlforward','script','query','search','checkTrigger','AllConditions','every','channel','AnyConditions','some','checkConditions','checkTrigger:\x20trigger','inspect','evt','account','chat','ChatWebsiteId','operator','value','upperFirst','AccountId','interaction','event','membername','lastevent','null','substatus','offlineMessage','created','util','lodash','url','mustache','./urlforward','./integration','./cmContact','./script','../../../config/environment'];(function(_0x9a0c5c,_0x44e874){var _0xfb3c5b=function(_0x108d95){while(--_0x108d95){_0x9a0c5c['push'](_0x9a0c5c['shift']());}};_0xfb3c5b(++_0x44e874);}(_0xd0d1,0x79));var _0x1d0d=function(_0x54be84,_0x3d0391){_0x54be84=_0x54be84-0x0;var _0x3392f5=_0xd0d1[_0x54be84];return _0x3392f5;};'use strict';var util=require(_0x1d0d('0x0'));var _=require(_0x1d0d('0x1'));var url=require(_0x1d0d('0x2'));var Mustache=require(_0x1d0d('0x3'));var Redis=require('ioredis');var urlforward=require(_0x1d0d('0x4'));var integration=require(_0x1d0d('0x5'));var cmContact=require(_0x1d0d('0x6'));var script=require(_0x1d0d('0x7'));var config=require(_0x1d0d('0x8'));var logger=require('../../../config/logger')(_0x1d0d('0x9'));var ami=require(_0x1d0d('0xa'));config[_0x1d0d('0xb')]=_[_0x1d0d('0xc')](config['redis'],{'host':_0x1d0d('0xd'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x1d0d('0xb')]));var operators={'equals':function(_0x223333,_0x4a6c69){return _0x223333==_0x4a6c69;},'not_equals':function(_0x4c916c,_0x4e0f8d){return _0x4c916c!=_0x4e0f8d;}};var barAndWebActions=[_0x1d0d('0xe'),_0x1d0d('0x2'),_0x1d0d('0xf')];function Trigger(_0x40ba7c){this[_0x1d0d('0x10')]=_0x40ba7c[_0x1d0d('0x10')];this[_0x1d0d('0x11')]=_0x40ba7c[_0x1d0d('0x11')];this[_0x1d0d('0x12')]=_0x40ba7c[_0x1d0d('0x12')];this[_0x1d0d('0x13')]=_0x40ba7c[_0x1d0d('0x13')];this[_0x1d0d('0x14')]=_0x40ba7c[_0x1d0d('0x14')];this['zendeskAccounts']=_0x40ba7c['zendeskAccounts'];this[_0x1d0d('0x15')]=_0x40ba7c[_0x1d0d('0x15')];this['salesforceAccounts']=_0x40ba7c[_0x1d0d('0x16')];this[_0x1d0d('0x17')]=_0x40ba7c[_0x1d0d('0x17')];this[_0x1d0d('0x18')]=_0x40ba7c[_0x1d0d('0x18')];this['deskAccounts']=_0x40ba7c[_0x1d0d('0x19')];this[_0x1d0d('0x1a')]=_0x40ba7c[_0x1d0d('0x1a')];this[_0x1d0d('0x1b')]=_0x40ba7c[_0x1d0d('0x1b')];this[_0x1d0d('0x1c')]=_0x40ba7c['dynamics365Accounts'];this[_0x1d0d('0x1d')]=_0x40ba7c['freshsalesAccounts'];this['accounts']={'zendesk':this[_0x1d0d('0x1e')],'salesforce':this[_0x1d0d('0x16')],'freshdesk':this[_0x1d0d('0x15')],'sugarcrm':this['sugarcrmAccounts'],'zoho':this[_0x1d0d('0x18')],'desk':this[_0x1d0d('0x19')],'vtiger':this[_0x1d0d('0x1a')],'dynamics365':this[_0x1d0d('0x1c')],'freshsales':this['freshsalesAccounts'],'servicenow':this['servicenowAccounts']};ami['on'](_0x1d0d('0x1f'),this[_0x1d0d('0x20')]['bind'](this));ami['on']('custom:agentconnect',this[_0x1d0d('0x20')][_0x1d0d('0x21')](this));ami['on']('custom:agentringnoanswer',this['syncCustomEvent'][_0x1d0d('0x21')](this));ami['on'](_0x1d0d('0x22'),this[_0x1d0d('0x20')][_0x1d0d('0x21')](this));ami['on'](_0x1d0d('0x23'),this['syncCustomEvent'][_0x1d0d('0x21')](this));ami['on'](_0x1d0d('0x24'),this['syncCustomEvent'][_0x1d0d('0x21')](this));ami['on'](_0x1d0d('0x25'),this['syncCustomEvent']['bind'](this));ami['on']('custom:agentcongestion',this[_0x1d0d('0x20')][_0x1d0d('0x21')](this));ami['on']('custom:agentreject',this[_0x1d0d('0x20')][_0x1d0d('0x21')](this));ami['on'](_0x1d0d('0x26'),this[_0x1d0d('0x20')][_0x1d0d('0x21')](this));ami['on'](_0x1d0d('0x27'),this[_0x1d0d('0x20')]['bind'](this));ami['on']('custom:timeout',this['syncCustomEvent'][_0x1d0d('0x21')](this));ami['on']('custom:dialbegin',this[_0x1d0d('0x28')][_0x1d0d('0x21')](this));ami['on'](_0x1d0d('0x29'),this[_0x1d0d('0x28')][_0x1d0d('0x21')](this));ami['on'](_0x1d0d('0x2a'),this[_0x1d0d('0x28')]['bind'](this));ami['on'](_0x1d0d('0x2b'),this[_0x1d0d('0x20')][_0x1d0d('0x21')](this));ami['on'](_0x1d0d('0x2c'),this[_0x1d0d('0x20')][_0x1d0d('0x21')](this));ami['on'](_0x1d0d('0x2d'),this[_0x1d0d('0x20')][_0x1d0d('0x21')](this));ami['on'](_0x1d0d('0x2e'),this[_0x1d0d('0x20')]['bind'](this));ami['on'](_0x1d0d('0x2f'),this[_0x1d0d('0x20')][_0x1d0d('0x21')](this));ami['on'](_0x1d0d('0x30'),this[_0x1d0d('0x20')][_0x1d0d('0x21')](this));ami['on'](_0x1d0d('0x31'),this[_0x1d0d('0x20')][_0x1d0d('0x21')](this));ami['on'](_0x1d0d('0x32'),this['syncCustomEvent']['bind'](this));}Trigger['prototype'][_0x1d0d('0x33')]=function(_0x5f28fd,_0x1277c5,_0x1e7d16){logger[_0x1d0d('0x34')](_0x5f28fd,_0x1277c5,JSON[_0x1d0d('0x35')](_0x1e7d16));io['to'](_0x5f28fd)['emit'](_0x1277c5,_0x1e7d16);};Trigger['prototype'][_0x1d0d('0x20')]=function(_0x4bd418){var _0x231e73=_['clone'](_0x4bd418);if(typeof _0x231e73['motionChannel']===_0x1d0d('0x36')){_0x231e73[_0x1d0d('0x37')]=_0x1d0d('0x38');}logger[_0x1d0d('0x39')](_0x1d0d('0x20'),util['inspect'](_0x231e73,{'showHidden':!![],'depth':null}));this[_0x1d0d('0x3a')](_0x231e73);};Trigger['prototype']['syncAgentDial']=function(_0x9129dc){if(this[_0x1d0d('0x11')][_0x9129dc['interface']]){this[_0x1d0d('0x20')](_0x9129dc);}};Trigger[_0x1d0d('0x3b')]['checkTriggers']=function(_0x551ff7){var _0x34dbcd;for(var _0x3c1f50 in this[_0x1d0d('0x10')]){if(this[_0x1d0d('0x10')][_0x1d0d('0x3c')](_0x3c1f50)){if(this[_0x1d0d('0x10')][_0x3c1f50][_0x1d0d('0x3d')]){_0x34dbcd=this['checkTrigger'](this[_0x1d0d('0x10')][_0x3c1f50],_0x551ff7);if(_0x34dbcd){_[_0x1d0d('0x3e')](_0x551ff7,_0x551ff7[_0x1d0d('0x3f')]);for(var _0x3dada5=0x0,_0x2e720d,_0x26cec9,_0x38d490;_0x3dada50x0){_0x1c9f6b=_['map'](_0x430d55,_0x28814f);}return _0x1c9f6b;}function getCustomFields(_0x1377b0,_0x22f6b6){var _0x1b8388=[];var _0x201941={'custom_fields':{}};if(_0x1377b0[_0xa55c('0x28')]>0x0){_[_0xa55c('0x29')](_0x1377b0,function(_0x52d37f){if(_[_0xa55c('0x2a')](['string',_0xa55c('0x2b')],_0x52d37f[_0xa55c('0x2c')])&&_0x52d37f[_0xa55c('0x2d')]&&!_0x52d37f[_0xa55c('0x2e')]){_0x201941[_0x52d37f['nameField'][_0xa55c('0x2f')]()]=_0x52d37f[_0xa55c('0x30')][_0xa55c('0x1f')]();}else if(_[_0xa55c('0x2a')]([_0xa55c('0x31'),_0xa55c('0x2b')],_0x52d37f[_0xa55c('0x2c')])&&_0x52d37f[_0xa55c('0x32')]&&_0x52d37f[_0xa55c('0x2e')]){_0x201941[_0xa55c('0x33')][_0x52d37f[_0xa55c('0x32')]]=_0x52d37f['content']['toString']();}else if(_0x52d37f[_0xa55c('0x2c')]===_0xa55c('0x34')&&_0x52d37f['variableName']&&_0x52d37f[_0xa55c('0x32')]&&_0x52d37f[_0xa55c('0x2e')]){_0x22f6b6[_0x52d37f[_0xa55c('0x35')]]&&(_0x201941[_0xa55c('0x33')][_0x52d37f[_0xa55c('0x32')]]=_0x22f6b6[_0x52d37f[_0xa55c('0x35')]][_0xa55c('0x1f')]());}else if(_0x52d37f[_0xa55c('0x2c')]===_0xa55c('0x36')&&_0x52d37f['Variable']&&_0x52d37f['Variable']['name']&&_0x52d37f[_0xa55c('0x32')]&&_0x52d37f[_0xa55c('0x2e')]){_0x22f6b6[_0x52d37f[_0xa55c('0x37')]['name'][_0xa55c('0x2f')]()]&&(_0x201941['custom_fields'][_0x52d37f[_0xa55c('0x32')]]=_0x22f6b6[_0x52d37f['Variable'][_0xa55c('0x38')][_0xa55c('0x2f')]()][_0xa55c('0x1f')]());}});}if(_0x201941['priority']){_0x201941[_0xa55c('0x39')]=Number(_0x201941[_0xa55c('0x39')]);}return _0x201941;}function getTicket(_0x47e93c,_0x6f9c4c,_0x194e78,_0x4d9083,_0x529ff8){logger[_0xa55c('0xb')]('Creating\x20new\x20ticket...');var _0x1e75dc=_[_0xa55c('0x3a')]({'subject':intUtil['getString'](_0x4d9083['Subjects'],_0x529ff8,'\x20'),'type':'phone','status':'new','labels':[_0xa55c('0x3b'),_0xa55c('0x3c'),_0xa55c('0x3d')][_0xa55c('0x3e')](getTags(_0x4d9083[_0xa55c('0x3f')],'name')),'description':intUtil[_0xa55c('0x40')](_0x4d9083[_0xa55c('0x41')],_0x529ff8,'\x0a'),'_links':{'assigned_user':{'href':util[_0xa55c('0xd')](_0xa55c('0x42'),_0x6f9c4c['id']),'class':_0xa55c('0x43')}},'message':{'direction':'in','body':intUtil[_0xa55c('0x40')](_0x4d9083['Descriptions'],_0x529ff8,'\x0a')}},getCustomFields(_0x4d9083[_0xa55c('0x44')],_0x529ff8));return request({'uri':util['format']('%s/customers/%d/cases',_0x47e93c[_0xa55c('0xf')],_0x194e78['id']),'method':_0xa55c('0x27'),'body':_0x1e75dc});}exports['queue']=function(_0x2bd98b,_0x508bd3,_0x5f25f7,_0x2f8449,_0x3fea03,_0x1630ac){var _0x540337,_0x1b2708;_0x1630ac[_0xa55c('0xf')]=intUtil['stripTrailingSlash'](_0x1630ac[_0xa55c('0xf')]);_0x1630ac['serverUrl']=intUtil[_0xa55c('0x45')](_0x1630ac[_0xa55c('0x46')]);if(_0x3fea03&&_0x3fea03['monitor_format']){logger[_0xa55c('0xb')](_0xa55c('0x47'),'Recording\x20is\x20enabled!');_0x508bd3[_0xa55c('0x48')]=util[_0xa55c('0xd')](_0xa55c('0x49'),_0x1630ac['serverUrl'],_0x508bd3[_0xa55c('0x4a')],md5(_0x508bd3['uniqueid']));}else{_0x508bd3[_0xa55c('0x48')]='';}headers[_0xa55c('0x4b')]=getAuth(_0x1630ac);return getUser(_0x1630ac,_0x2f8449[_0xa55c('0x4c')])['then'](function(_0x41eab1){_0x540337=_0x41eab1;logger[_0xa55c('0xb')]('The\x20User\x20ID\x20is:',_0x540337['id']);return getEndUser(_0x1630ac,_0x508bd3[_0xa55c('0x4d')],_0x508bd3[_0xa55c('0x4e')]);})['then'](function(_0x11ff1d){_0x1b2708=_0x11ff1d;logger[_0xa55c('0xb')]('The\x20Enduser\x20ID\x20is:',_0x1b2708['id']);return getTicket(_0x1630ac,_0x540337,_0x1b2708,_0x5f25f7,_0x508bd3);})[_0xa55c('0x10')](function(_0x81cee8){if(_0x81cee8){logger[_0xa55c('0xb')](_0xa55c('0x4f'));logger['info'](_0xa55c('0x50'),_0x81cee8['id']);switch(_0x1630ac['type']){case _0xa55c('0x51'):logger[_0xa55c('0xb')](_0xa55c('0x47'),'Displaying\x20ticket\x20to\x20agent...');emit(util[_0xa55c('0xd')](_0xa55c('0x52'),_0x2f8449['name']),_0xa55c('0x53'),{'recordId':_0x81cee8['id']});break;case _0xa55c('0x54'):logger[_0xa55c('0xb')](_0xa55c('0x47'),_0xa55c('0x55'));emit(util[_0xa55c('0xd')](_0xa55c('0x52'),_0x2f8449[_0xa55c('0x38')]),_0xa55c('0x56'),{'uri':util[_0xa55c('0xd')]('https://xcally.desk.com/web/agent/case/%d',_0x81cee8['id'])});break;default:logger[_0xa55c('0x57')](_0xa55c('0x47'),_0xa55c('0x58'));}}})['catch'](function(_0x4c3095){console[_0xa55c('0x57')](_0x4c3095);logger['error'](_0xa55c('0x47'),JSON['stringify'](_0x4c3095));});};exports[_0xa55c('0x59')]=function(_0x228df4,_0x181802,_0x3f9313,_0x2ecf79,_0x5b1cf3,_0x44b7c1,_0x4607ca){var _0x4b85cc,_0x3929a6;_0x44b7c1[_0xa55c('0xf')]=intUtil[_0xa55c('0x45')](_0x44b7c1[_0xa55c('0xf')]);_0x44b7c1['serverUrl']=intUtil['stripTrailingSlash'](_0x44b7c1[_0xa55c('0x46')]);if(_0x4607ca&&_0x4607ca[_0xa55c('0x5a')]&&_0x4607ca[_0xa55c('0x5a')]!==_0xa55c('0x5b')){logger['info'](_0xa55c('0x5c'),'Recording\x20is\x20enabled!');_0x181802[_0xa55c('0x48')]=util[_0xa55c('0xd')](_0xa55c('0x49'),_0x44b7c1[_0xa55c('0x46')],_0x181802[_0xa55c('0x4a')],md5(_0x181802['uniqueid']));}headers[_0xa55c('0x4b')]=getAuth(_0x44b7c1);return getUser(_0x44b7c1,_0x2ecf79['email'])[_0xa55c('0x10')](function(_0x157afe){_0x4b85cc=_0x157afe;logger[_0xa55c('0xb')](_0xa55c('0x5d'),_0x4b85cc['id']);return getEndUser(_0x44b7c1,_0x181802[_0xa55c('0x5e')],_0x181802[_0xa55c('0x5f')]);})[_0xa55c('0x10')](function(_0x53e2be){_0x3929a6=_0x53e2be;logger[_0xa55c('0xb')](_0xa55c('0x60'),_0x3929a6['id']);return getTicket(_0x44b7c1,_0x4b85cc,_0x3929a6,_0x3f9313,_0x181802);})[_0xa55c('0x10')](function(_0x23a30e){if(_0x23a30e){logger[_0xa55c('0xb')]('Ticket\x20created!');logger[_0xa55c('0xb')](_0xa55c('0x50'),_0x23a30e['id']);switch(_0x44b7c1[_0xa55c('0x2c')]){case _0xa55c('0x51'):logger[_0xa55c('0xb')]('[QUEUE]',_0xa55c('0x61'));emit(util[_0xa55c('0xd')](_0xa55c('0x52'),_0x2ecf79[_0xa55c('0x38')]),_0xa55c('0x53'),{'recordId':_0x23a30e['id']});break;case'newTab':logger[_0xa55c('0xb')]('[QUEUE]',_0xa55c('0x55'));emit(util['format'](_0xa55c('0x52'),_0x2ecf79['name']),_0xa55c('0x56'),{'uri':util[_0xa55c('0xd')](_0xa55c('0x62'),_0x44b7c1[_0xa55c('0xf')],_0x23a30e['id'])});break;default:logger[_0xa55c('0x57')](_0xa55c('0x5c'),_0xa55c('0x58'));}}})[_0xa55c('0x63')](function(_0x14b515){logger[_0xa55c('0x57')]('[OUTBOUND]',JSON[_0xa55c('0x17')](_0x14b515));});};exports[_0xa55c('0x64')]=function(_0x4ef914,_0x18b928,_0x2b8b88,_0x3e3b4b,_0x9fe234,_0x1b8b06){var _0xa38271,_0x3cef1f;_0x1b8b06[_0xa55c('0xf')]=intUtil['stripTrailingSlash'](_0x1b8b06[_0xa55c('0xf')]);_0x1b8b06[_0xa55c('0x46')]=intUtil[_0xa55c('0x45')](_0x1b8b06[_0xa55c('0x46')]);if(_0x9fe234&&_0x9fe234[_0xa55c('0x65')]){logger[_0xa55c('0xb')]('['+_0x18b928[_0xa55c('0x66')][_0xa55c('0x67')]()+']',_0xa55c('0x68'));_0x18b928['recordingURL']=util[_0xa55c('0xd')](_0xa55c('0x49'),_0x1b8b06[_0xa55c('0x46')],_0x18b928[_0xa55c('0x4a')],md5(_0x18b928[_0xa55c('0x4a')]));}else{_0x18b928[_0xa55c('0x48')]='';}headers[_0xa55c('0x4b')]=getAuth(_0x1b8b06);return getUser(_0x1b8b06)[_0xa55c('0x10')](function(_0x2e4cf7){_0xa38271=_0x2e4cf7;logger[_0xa55c('0xb')](_0xa55c('0x5d'),_0xa38271['id']);return getEndUser(_0x1b8b06,_0x18b928['calleridname'],_0x18b928[_0xa55c('0x4e')]);})['then'](function(_0x1228a4){_0x3cef1f=_0x1228a4;logger[_0xa55c('0xb')](_0xa55c('0x60'),_0x3cef1f['id']);return getTicket(_0x1b8b06,_0xa38271,_0x3cef1f,_0x2b8b88,_0x18b928);})['then'](function(_0x4d9722){if(_0x4d9722){logger[_0xa55c('0xb')](_0xa55c('0x4f'));logger[_0xa55c('0xb')](_0xa55c('0x50'),_0x4d9722['id']);}})['catch'](function(_0x149cb9){logger[_0xa55c('0x57')]('['+_0x18b928[_0xa55c('0x66')][_0xa55c('0x67')]()+']',JSON[_0xa55c('0x17')](_0x149cb9));});}; \ No newline at end of file +var _0x326f=['catch','stringify','unmanaged','lastevent','toUpperCase','lodash','util','ioredis','./util','../../../../config/environment','../../../../config/logger','desk','redis','defaults','localhost','validateEmail','info','Getting\x20agent\x20with\x20email','%s/users','then','total_entries','_embedded','entries','Agent\x20found!','format','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/users/me','remoteUri','debug','[HTTP]','GET','authType','basic','password','%s/token:%s','Basic\x20%s','Searching\x20enduser\x20with\x20phone','%s/customers/search','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','work','map','length','includes','string','picklist','type','nameField','customField','toLowerCase','content','idField','custom_fields','toString','variable','variableName','customVariable','Variable','name','priority','Creating\x20new\x20ticket...','getString','Subjects','xCALLY','concat','Descriptions','user','Fields','%s/customers/%d/cases','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','trigger:desk:display','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','error','Desk\x20account\x20type\x20not\x20recognized','outbound','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','integrationTab','%s/agent/tickets/%s'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x326f,0xd1));var _0xf326=function(_0x21fb45,_0x7cf98d){_0x21fb45=_0x21fb45-0x0;var _0x3b2cd9=_0x326f[_0x21fb45];return _0x3b2cd9;};'use strict';var _=require(_0xf326('0x0'));var rp=require('request-promise');var md5=require('md5');var util=require(_0xf326('0x1'));var Redis=require(_0xf326('0x2'));var intUtil=require(_0xf326('0x3'));var config=require(_0xf326('0x4'));var logger=require(_0xf326('0x5'))(_0xf326('0x6'));config[_0xf326('0x7')]=_[_0xf326('0x8')](config[_0xf326('0x7')],{'host':_0xf326('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xf326('0x7')]));function emit(_0x3851eb,_0x165f95,_0x1e7b8a){io['to'](_0x3851eb)['emit'](_0x165f95,_0x1e7b8a);}var headers={'Content-Type':'application/json','Accept':'application/json'};function getUser(_0x3bacf2,_0x1fc80e){if(intUtil[_0xf326('0xa')](_0x1fc80e)===!![]){logger[_0xf326('0xb')](_0xf326('0xc'),_0x1fc80e);return request({'uri':util['format'](_0xf326('0xd'),_0x3bacf2['remoteUri'])})[_0xf326('0xe')](function(_0x4aaf3a){if(_0x4aaf3a[_0xf326('0xf')]){return _['find'](_0x4aaf3a[_0xf326('0x10')][_0xf326('0x11')],{'email':_0x1fc80e});}})['then'](function(_0x342fe5){if(_0x342fe5){logger[_0xf326('0xb')](_0xf326('0x12'));return _0x342fe5;}else{logger[_0xf326('0xb')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xf326('0x13')]('%s/users/me',_0x3bacf2['remoteUri'])});}});}else{logger[_0xf326('0xb')](_0xf326('0x14'));return request({'uri':util[_0xf326('0x13')](_0xf326('0x15'),_0x3bacf2[_0xf326('0x16')])});}}function request(_0x287a2a){logger[_0xf326('0x17')](_0xf326('0x18'),JSON['stringify'](_0x287a2a));return rp(_[_0xf326('0x8')](_0x287a2a,{'method':_0xf326('0x19'),'headers':headers,'json':!![]}));}function getAuth(_0x18bee3){var _0x31ffb9;if(_0x18bee3[_0xf326('0x1a')]===_0xf326('0x1b')){_0x31ffb9=util['format']('%s:%s',_0x18bee3['username'],_0x18bee3[_0xf326('0x1c')]);}else if(_0x18bee3[_0xf326('0x1a')]==='token'){_0x31ffb9=util['format'](_0xf326('0x1d'),_0x18bee3['username'],_0x18bee3['token']);}return util[_0xf326('0x13')](_0xf326('0x1e'),new Buffer(_0x31ffb9)['toString']('base64'));}function getEndUser(_0x19b8ba,_0xb1efcf,_0x5f21a2){logger[_0xf326('0xb')](_0xf326('0x1f'),_0x5f21a2);return request({'uri':util[_0xf326('0x13')](_0xf326('0x20'),_0x19b8ba[_0xf326('0x16')]),'qs':{'phone':_0x5f21a2}})[_0xf326('0xe')](function(_0x5ce532){if(_0x5ce532['total_entries']){logger['info'](_0xf326('0x21'));return _0x5ce532[_0xf326('0x10')][_0xf326('0x11')][0x0];}else{logger[_0xf326('0xb')](_0xf326('0x22'));return request({'uri':util[_0xf326('0x13')]('%s/customers',_0x19b8ba[_0xf326('0x16')]),'method':_0xf326('0x23'),'body':{'first_name':_0xb1efcf,'title':_0xb1efcf,'phone_numbers':[{'type':_0xf326('0x24'),'value':_0x5f21a2}]}});}});}function getTags(_0x581531,_0x1617d2){var _0x55ad0f=[];if(_0x581531&&_0x581531['length']>0x0){_0x55ad0f=_[_0xf326('0x25')](_0x581531,_0x1617d2);}return _0x55ad0f;}function getCustomFields(_0x1ae23a,_0x2fa28e){var _0x5dbe63=[];var _0xc115d9={'custom_fields':{}};if(_0x1ae23a[_0xf326('0x26')]>0x0){_['forEach'](_0x1ae23a,function(_0x225776){if(_[_0xf326('0x27')]([_0xf326('0x28'),_0xf326('0x29')],_0x225776[_0xf326('0x2a')])&&_0x225776[_0xf326('0x2b')]&&!_0x225776[_0xf326('0x2c')]){_0xc115d9[_0x225776[_0xf326('0x2b')][_0xf326('0x2d')]()]=_0x225776[_0xf326('0x2e')]['toString']();}else if(_[_0xf326('0x27')]([_0xf326('0x28'),_0xf326('0x29')],_0x225776['type'])&&_0x225776[_0xf326('0x2f')]&&_0x225776[_0xf326('0x2c')]){_0xc115d9[_0xf326('0x30')][_0x225776['idField']]=_0x225776['content'][_0xf326('0x31')]();}else if(_0x225776[_0xf326('0x2a')]===_0xf326('0x32')&&_0x225776[_0xf326('0x33')]&&_0x225776[_0xf326('0x2f')]&&_0x225776[_0xf326('0x2c')]){_0x2fa28e[_0x225776[_0xf326('0x33')]]&&(_0xc115d9[_0xf326('0x30')][_0x225776['idField']]=_0x2fa28e[_0x225776[_0xf326('0x33')]][_0xf326('0x31')]());}else if(_0x225776['type']===_0xf326('0x34')&&_0x225776['Variable']&&_0x225776[_0xf326('0x35')]['name']&&_0x225776['idField']&&_0x225776[_0xf326('0x2c')]){_0x2fa28e[_0x225776['Variable'][_0xf326('0x36')]['toLowerCase']()]&&(_0xc115d9[_0xf326('0x30')][_0x225776[_0xf326('0x2f')]]=_0x2fa28e[_0x225776[_0xf326('0x35')]['name'][_0xf326('0x2d')]()][_0xf326('0x31')]());}});}if(_0xc115d9['priority']){_0xc115d9[_0xf326('0x37')]=Number(_0xc115d9[_0xf326('0x37')]);}return _0xc115d9;}function getTicket(_0x40fa7a,_0xaf65e0,_0x51076c,_0x2c4416,_0xb1ef35){logger[_0xf326('0xb')](_0xf326('0x38'));var _0x1d88ed=_['merge']({'subject':intUtil[_0xf326('0x39')](_0x2c4416[_0xf326('0x3a')],_0xb1ef35,'\x20'),'type':'phone','status':'new','labels':[_0xf326('0x3b'),'Motion','CTI'][_0xf326('0x3c')](getTags(_0x2c4416['Tags'],_0xf326('0x36'))),'description':intUtil[_0xf326('0x39')](_0x2c4416[_0xf326('0x3d')],_0xb1ef35,'\x0a'),'_links':{'assigned_user':{'href':util[_0xf326('0x13')]('/api/v2/users/%d',_0xaf65e0['id']),'class':_0xf326('0x3e')}},'message':{'direction':'in','body':intUtil[_0xf326('0x39')](_0x2c4416[_0xf326('0x3d')],_0xb1ef35,'\x0a')}},getCustomFields(_0x2c4416[_0xf326('0x3f')],_0xb1ef35));return request({'uri':util[_0xf326('0x13')](_0xf326('0x40'),_0x40fa7a[_0xf326('0x16')],_0x51076c['id']),'method':_0xf326('0x23'),'body':_0x1d88ed});}exports[_0xf326('0x41')]=function(_0x1227d3,_0x361776,_0x2bab13,_0x50d63f,_0x1b6126,_0x1637dc){var _0x2ed1a7,_0x270288;_0x1637dc[_0xf326('0x16')]=intUtil[_0xf326('0x42')](_0x1637dc['remoteUri']);_0x1637dc[_0xf326('0x43')]=intUtil[_0xf326('0x42')](_0x1637dc['serverUrl']);if(_0x1b6126&&_0x1b6126[_0xf326('0x44')]){logger[_0xf326('0xb')](_0xf326('0x45'),_0xf326('0x46'));_0x361776[_0xf326('0x47')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1637dc[_0xf326('0x43')],_0x361776[_0xf326('0x48')],md5(_0x361776['uniqueid']));}else{_0x361776['recordingURL']='';}headers[_0xf326('0x49')]=getAuth(_0x1637dc);return getUser(_0x1637dc,_0x50d63f[_0xf326('0x4a')])[_0xf326('0xe')](function(_0x5b3705){_0x2ed1a7=_0x5b3705;logger[_0xf326('0xb')](_0xf326('0x4b'),_0x2ed1a7['id']);return getEndUser(_0x1637dc,_0x361776[_0xf326('0x4c')],_0x361776[_0xf326('0x4d')]);})[_0xf326('0xe')](function(_0x2d9bba){_0x270288=_0x2d9bba;logger[_0xf326('0xb')](_0xf326('0x4e'),_0x270288['id']);return getTicket(_0x1637dc,_0x2ed1a7,_0x270288,_0x2bab13,_0x361776);})[_0xf326('0xe')](function(_0x27ced1){if(_0x27ced1){logger[_0xf326('0xb')](_0xf326('0x4f'));logger[_0xf326('0xb')](_0xf326('0x50'),_0x27ced1['id']);switch(_0x1637dc[_0xf326('0x2a')]){case'integrationTab':logger[_0xf326('0xb')](_0xf326('0x45'),_0xf326('0x51'));emit(util[_0xf326('0x13')]('user:%s',_0x50d63f[_0xf326('0x36')]),_0xf326('0x52'),{'recordId':_0x27ced1['id']});break;case _0xf326('0x53'):logger[_0xf326('0xb')]('[QUEUE]',_0xf326('0x54'));emit(util[_0xf326('0x13')](_0xf326('0x55'),_0x50d63f[_0xf326('0x36')]),_0xf326('0x56'),{'uri':util['format']('https://xcally.desk.com/web/agent/case/%d',_0x27ced1['id'])});break;default:logger[_0xf326('0x57')](_0xf326('0x45'),_0xf326('0x58'));}}})['catch'](function(_0x102fba){console[_0xf326('0x57')](_0x102fba);logger[_0xf326('0x57')]('[QUEUE]',JSON['stringify'](_0x102fba));});};exports[_0xf326('0x59')]=function(_0x5b4832,_0x1cf58f,_0x554277,_0x458e5f,_0x7ee57,_0x28c959,_0x25e091){var _0x212594,_0x35d3c8;_0x28c959[_0xf326('0x16')]=intUtil['stripTrailingSlash'](_0x28c959[_0xf326('0x16')]);_0x28c959[_0xf326('0x43')]=intUtil[_0xf326('0x42')](_0x28c959['serverUrl']);if(_0x25e091&&_0x25e091[_0xf326('0x5a')]&&_0x25e091[_0xf326('0x5a')]!==_0xf326('0x5b')){logger[_0xf326('0xb')](_0xf326('0x5c'),'Recording\x20is\x20enabled!');_0x1cf58f[_0xf326('0x47')]=util[_0xf326('0x13')](_0xf326('0x5d'),_0x28c959[_0xf326('0x43')],_0x1cf58f['uniqueid'],md5(_0x1cf58f[_0xf326('0x48')]));}headers[_0xf326('0x49')]=getAuth(_0x28c959);return getUser(_0x28c959,_0x458e5f[_0xf326('0x4a')])[_0xf326('0xe')](function(_0x4d3b9e){_0x212594=_0x4d3b9e;logger['info'](_0xf326('0x4b'),_0x212594['id']);return getEndUser(_0x28c959,_0x1cf58f[_0xf326('0x5e')],_0x1cf58f['destcalleridnum']);})[_0xf326('0xe')](function(_0x29de71){_0x35d3c8=_0x29de71;logger[_0xf326('0xb')](_0xf326('0x4e'),_0x35d3c8['id']);return getTicket(_0x28c959,_0x212594,_0x35d3c8,_0x554277,_0x1cf58f);})['then'](function(_0xb1c18c){if(_0xb1c18c){logger['info']('Ticket\x20created!');logger[_0xf326('0xb')]('The\x20Ticket\x20ID\x20is:',_0xb1c18c['id']);switch(_0x28c959[_0xf326('0x2a')]){case _0xf326('0x5f'):logger[_0xf326('0xb')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent...');emit(util[_0xf326('0x13')](_0xf326('0x55'),_0x458e5f[_0xf326('0x36')]),'trigger:desk:display',{'recordId':_0xb1c18c['id']});break;case _0xf326('0x53'):logger['info'](_0xf326('0x45'),_0xf326('0x54'));emit(util[_0xf326('0x13')](_0xf326('0x55'),_0x458e5f[_0xf326('0x36')]),_0xf326('0x56'),{'uri':util[_0xf326('0x13')](_0xf326('0x60'),_0x28c959[_0xf326('0x16')],_0xb1c18c['id'])});break;default:logger[_0xf326('0x57')](_0xf326('0x5c'),_0xf326('0x58'));}}})[_0xf326('0x61')](function(_0x4ca1b8){logger[_0xf326('0x57')]('[OUTBOUND]',JSON[_0xf326('0x62')](_0x4ca1b8));});};exports[_0xf326('0x63')]=function(_0x5e858d,_0x2b770c,_0x5283da,_0x3255b2,_0xd55246,_0x28f3cb){var _0x2d45c9,_0x31b6dd;_0x28f3cb['remoteUri']=intUtil['stripTrailingSlash'](_0x28f3cb[_0xf326('0x16')]);_0x28f3cb[_0xf326('0x43')]=intUtil[_0xf326('0x42')](_0x28f3cb[_0xf326('0x43')]);if(_0xd55246&&_0xd55246[_0xf326('0x44')]){logger['info']('['+_0x2b770c[_0xf326('0x64')][_0xf326('0x65')]()+']','Recording\x20is\x20enabled!');_0x2b770c['recordingURL']=util['format'](_0xf326('0x5d'),_0x28f3cb[_0xf326('0x43')],_0x2b770c[_0xf326('0x48')],md5(_0x2b770c[_0xf326('0x48')]));}else{_0x2b770c[_0xf326('0x47')]='';}headers[_0xf326('0x49')]=getAuth(_0x28f3cb);return getUser(_0x28f3cb)[_0xf326('0xe')](function(_0x4b9013){_0x2d45c9=_0x4b9013;logger[_0xf326('0xb')](_0xf326('0x4b'),_0x2d45c9['id']);return getEndUser(_0x28f3cb,_0x2b770c[_0xf326('0x4c')],_0x2b770c[_0xf326('0x4d')]);})['then'](function(_0x3717fe){_0x31b6dd=_0x3717fe;logger['info']('The\x20Enduser\x20ID\x20is:',_0x31b6dd['id']);return getTicket(_0x28f3cb,_0x2d45c9,_0x31b6dd,_0x5283da,_0x2b770c);})[_0xf326('0xe')](function(_0x540fa0){if(_0x540fa0){logger[_0xf326('0xb')](_0xf326('0x4f'));logger[_0xf326('0xb')](_0xf326('0x50'),_0x540fa0['id']);}})[_0xf326('0x61')](function(_0x541491){logger['error']('['+_0x2b770c['lastevent'][_0xf326('0x65')]()+']',JSON[_0xf326('0x62')](_0x541491));});}; \ 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 ba098d6..6da1d8e 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 _0x43c3=['Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:','moduleCreate',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','openNewTab','name','Error\x20running\x20Dynamics365\x20integration','request-promise','util','./util','md5','ioredis','dynamics365','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','modernAuthentication','remoteUri','CloudProvider','data7','tenantId','resolve','data5','POST','username','password','clientSecret','access_token','catch','error',']\x20Wrong\x20credentials!','message','systemusers?$select=internalemailaddress,isdisabled,systemuserid','4.0','then','isNil','email','length','internalemailaddress','info','systemuserid','userId','userEmail','toLowerCase','body','odata-entityid','substring','lastIndexOf','enduserId','outbound','telephone1','GET','contacts?$select=','&$filter=','\x20eq\x20\x27','replace','%2b','value','contactid','nothing','toUpperCase',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing','forEach','includes','string','picklist','customField','indexOf','content','ticketType','incident','getString','Subjects','Descriptions','/contacts(','Fields','phonecall','queue','callDirection','/systemusers(','phonecalls','assign','calleridnum','Bearer\x20','headers','ticketId','format','user:%s','trigger:browser:url','stripTrailingSlash','serverUrl','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','uniqueid','[QUEUE]'];(function(_0x1af415,_0x443c14){var _0x5158b3=function(_0x5df2a4){while(--_0x5df2a4){_0x1af415['push'](_0x1af415['shift']());}};_0x5158b3(++_0x443c14);}(_0x43c3,0xdb));var _0x343c=function(_0x6a2520,_0x267ead){_0x6a2520=_0x6a2520-0x0;var _0x2cb43f=_0x43c3[_0x6a2520];return _0x2cb43f;};'use strict';var _=require('lodash');var rp=require(_0x343c('0x0'));var util=require(_0x343c('0x1'));var intUtil=require(_0x343c('0x2'));var md5=require(_0x343c('0x3'));var Redis=require(_0x343c('0x4'));var logger=require('../../../../config/logger')(_0x343c('0x5'));var config=require(_0x343c('0x6'));config[_0x343c('0x7')]=_[_0x343c('0x8')](config[_0x343c('0x7')],{'host':_0x343c('0x9'),'port':0x18eb});var io=require(_0x343c('0xa'))(new Redis(config[_0x343c('0x7')]));function getAuthToken(_0x20bcc1,_0x260408,_0x259c51){if(_0x20bcc1[_0x343c('0xb')]){_0x20bcc1[_0x343c('0xc')]=_0x20bcc1[_0x343c('0xd')][_0x343c('0xe')];_0x20bcc1[_0x343c('0xf')]=_0x20bcc1[_0x343c('0xd')]['data2'];return Promise[_0x343c('0x10')](_0x20bcc1[_0x343c('0xd')][_0x343c('0x11')]);}var _0x5d4825={'method':_0x343c('0x12'),'uri':_0x260408,'form':{'client_id':_0x20bcc1['clientId'],'resource':_0x20bcc1[_0x343c('0xc')],'username':_0x20bcc1[_0x343c('0x13')],'password':_0x20bcc1['password'],'grant_type':_0x343c('0x14'),'client_secret':_0x20bcc1[_0x343c('0x15')]},'json':!![]};return rp(_0x5d4825)['then'](function(_0x483249){return _0x483249[_0x343c('0x16')];})[_0x343c('0x17')](function(_0x4b2258){logger[_0x343c('0x18')]('['+[_0x259c51['toUpperCase']()]+_0x343c('0x19'));return _0x4b2258[_0x343c('0x1a')];});}function getUser(_0x29e710,_0x542112,_0x148c91,_0x284638,_0x4fd798,_0x307a8a){return new Promise(function(_0x11d958,_0x525570){return getAuthToken(_0x542112,_0x284638,_0x307a8a)['then'](function(_0x2abd4f){var _0x3108e8={'method':'GET','uri':_0x4fd798+_0x343c('0x1b'),'headers':{'Authorization':'Bearer\x20'+_0x2abd4f,'OData-Version':_0x343c('0x1c')},'json':!![]};return rp(_0x3108e8);})[_0x343c('0x1d')](function(_0x40a389){var _0x1112b4=_0x40a389['value'];var _0x4345d4=![];var _0x5ab9b2=null;if(!_[_0x343c('0x1e')](_0x148c91)){if(intUtil['validateEmail'](_0x148c91['email'])){_0x29e710['userEmail']=_0x148c91[_0x343c('0x1f')];for(_0x5ab9b2=0x0;_0x5ab9b2<_0x1112b4[_0x343c('0x20')];_0x5ab9b2++){if(_0x1112b4[_0x5ab9b2][_0x343c('0x21')]===_0x148c91[_0x343c('0x1f')]&&!_0x1112b4[_0x5ab9b2]['isdisabled']){_0x4345d4=!![];logger[_0x343c('0x22')]('['+[_0x307a8a['toUpperCase']()]+']\x20Agent\x20found\x20'+_0x1112b4[_0x5ab9b2][_0x343c('0x23')]+'!');_0x29e710[_0x343c('0x24')]=_0x1112b4[_0x5ab9b2]['systemuserid'];}}}}if(!_0x4345d4){logger[_0x343c('0x22')]('['+[_0x307a8a['toUpperCase']()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0x29e710[_0x343c('0x25')]=_0x542112['username'];for(_0x5ab9b2=0x0;_0x5ab9b2<_0x1112b4[_0x343c('0x20')];_0x5ab9b2++){if(_0x1112b4[_0x5ab9b2][_0x343c('0x21')]===_0x542112[_0x343c('0x13')]){_0x29e710[_0x343c('0x24')]=_0x1112b4[_0x5ab9b2][_0x343c('0x23')];}}}_0x11d958(_0x29e710);})[_0x343c('0x17')](function(_0x17a20d){_0x525570(_0x17a20d[_0x343c('0x1a')]);});});}function createEndUser(_0x3b16b2,_0x572f88,_0x96dff6,_0x114a1d,_0x2a7c3b,_0x1f0103,_0x4d2f3a){return new Promise(function(_0x183305,_0xc81d86){return getAuthToken(_0x572f88,_0x96dff6,_0x1f0103)[_0x343c('0x1d')](function(_0x502a3d){var _0x43bf77=_0x1f0103[_0x343c('0x26')]()==='outbound'?_0x2a7c3b['destcalleridnum']:_0x2a7c3b['calleridnum'];var _0x42ef8c={'method':'POST','uri':_0x114a1d+'contacts','body':{'fullname':_0x43bf77,'firstname':_0x43bf77,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':'/systemusers('+_0x3b16b2[_0x343c('0x24')]+')'},'headers':{'Authorization':'Bearer\x20'+_0x502a3d,'OData-Version':_0x343c('0x1c')},'json':!![],'resolveWithFullResponse':!![]};_0x42ef8c[_0x343c('0x27')][_0x4d2f3a]=_0x43bf77;return rp(_0x42ef8c);})[_0x343c('0x1d')](function(_0x330323){var _0xcc2593=_0x330323['headers'][_0x343c('0x28')];var _0x2a226f=_0xcc2593[_0x343c('0x29')](_0xcc2593[_0x343c('0x2a')]('(')+0x1,_0xcc2593['lastIndexOf'](')'));_0x3b16b2[_0x343c('0x2b')]=_0x2a226f;_0x183305(_0x3b16b2);})[_0x343c('0x17')](function(_0x845e0f){_0xc81d86(_0x845e0f[_0x343c('0x1a')]);});});}function getEndUser(_0x45a903,_0x7484c7,_0x142f7b,_0x55a80c,_0x5131b3,_0x353bde,_0x415274,_0x585418){var _0x79097f=_0x353bde[_0x343c('0x26')]()===_0x343c('0x2c')?_0x5131b3['destcalleridnum']:_0x5131b3['calleridnum'];return getAuthToken(_0x7484c7,_0x142f7b,_0x353bde)[_0x343c('0x1d')](function(_0x5e4aa3){_0x585418=_0x585418?_0x585418:_0x343c('0x2d');var _0x418e45={'method':_0x343c('0x2e'),'uri':_0x55a80c+_0x343c('0x2f')+_0x585418+_0x343c('0x30')+_0x585418+_0x343c('0x31')+_0x79097f[_0x343c('0x32')]('+',_0x343c('0x33'))+'\x27','headers':{'Authorization':'Bearer\x20'+_0x5e4aa3,'If-None-Match':null,'OData-Version':_0x343c('0x1c')},'json':!![]};return rp(_0x418e45);})[_0x343c('0x1d')](function(_0x6e0e6e){var _0x3becf1=![];if(!_0x6e0e6e)return _0x3becf1;var _0x3156b0=_0x6e0e6e[_0x343c('0x34')];for(var _0x578386=0x0;_0x578386<_0x3156b0[_0x343c('0x20')];_0x578386++){if(_0x3156b0[_0x578386][_0x585418]===_0x79097f){_0x3becf1=!![];_0x45a903[_0x343c('0x2b')]=_0x3156b0[_0x578386][_0x343c('0x35')];}}return _0x3becf1;})[_0x343c('0x1d')](function(_0x2dd43b){if(_0x2dd43b)return _0x45a903;if(_0x415274===_0x343c('0x36')){logger[_0x343c('0x22')]('['+[_0x353bde[_0x343c('0x37')]()]+_0x343c('0x38'));return _0x45a903;}return createEndUser(_0x45a903,_0x7484c7,_0x142f7b,_0x55a80c,_0x5131b3,_0x353bde,_0x585418)[_0x343c('0x1d')](function(_0x314b43){logger['info']('['+[_0x353bde[_0x343c('0x37')]()]+']\x20Enduser\x20created!',_0x314b43['enduserId']);return _0x314b43;});});}function getCustomFields(_0x2c451e,_0x40984f,_0x3bc399){var _0xc6b670={};if(_0x2c451e[_0x343c('0x20')]>0x0){_[_0x343c('0x39')](_0x2c451e,function(_0x2465c7){if(_[_0x343c('0x3a')]([_0x343c('0x3b'),_0x343c('0x3c')],_0x2465c7['type'])&&_0x2465c7['nameField']&&!_0x2465c7[_0x343c('0x3d')]){var _0x3fe66a=_0x2465c7['idField']['toLowerCase']();var _0x366ee=_0x3fe66a['substring'](0x0,_0x3fe66a[_0x343c('0x3e')]('_'));var _0x1c9525=_0x3fe66a[_0x343c('0x29')](_0x3fe66a[_0x343c('0x3e')]('_')+0x1);if(_0x366ee===_0x3bc399){_0xc6b670[_0x1c9525]=_0x2465c7[_0x343c('0x3f')];}}});}return _0xc6b670;}function getTicket(_0x2089c2,_0x2bea60,_0x1a6644,_0x261114,_0x1f08e1,_0x3854e6,_0x3feb82){return new Promise(function(_0x5dbd3a,_0xb21334){var _0x1a1060;return getAuthToken(_0x2bea60,_0x1a6644,_0x3feb82)[_0x343c('0x1d')](function(_0x44840c){if(_0x3854e6[_0x343c('0x40')]===_0x343c('0x41')){_0x1a1060={'method':'POST','uri':_0x261114+'incidents','body':Object['assign']({},{'title':intUtil[_0x343c('0x42')](_0x3854e6[_0x343c('0x43')],_0x1f08e1,'\x20'),'description':intUtil[_0x343c('0x42')](_0x3854e6[_0x343c('0x44')],_0x1f08e1,'\x0a'),'customerid_contact@odata.bind':_0x2089c2['enduserId']?_0x343c('0x45')+_0x2089c2[_0x343c('0x2b')]+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x2089c2['userId']+')','caseorigincode':'1'},getCustomFields(_0x3854e6[_0x343c('0x46')],_0x1f08e1,_0x3854e6['ticketType'])),'headers':{'Authorization':'Bearer\x20'+_0x44840c,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x3854e6[_0x343c('0x40')]===_0x343c('0x47')){var _0xf5e7e6=_0x2089c2[_0x343c('0x2b')]?[{'partyid_systemuser@odata.bind':'/systemusers('+_0x2089c2[_0x343c('0x24')]+')','participationtypemask':_0x2089c2['callDirection']===_0x343c('0x48')?0x2:0x1},{'partyid_contact@odata.bind':_0x343c('0x45')+_0x2089c2[_0x343c('0x2b')]+')','participationtypemask':_0x2089c2[_0x343c('0x49')]===_0x343c('0x48')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x343c('0x4a')+_0x2089c2[_0x343c('0x24')]+')','participationtypemask':_0x2089c2[_0x343c('0x49')]==='queue'?0x2:0x1}];_0x1a1060={'method':_0x343c('0x12'),'uri':_0x261114+_0x343c('0x4b'),'body':Object[_0x343c('0x4c')]({},{'subject':intUtil[_0x343c('0x42')](_0x3854e6[_0x343c('0x43')],_0x1f08e1,'\x20'),'phonenumber':String(_0x1f08e1[_0x343c('0x4d')]),'description':intUtil[_0x343c('0x42')](_0x3854e6[_0x343c('0x44')],_0x1f08e1,'\x0a'),'regardingobjectid_contact@odata.bind':_0x2089c2[_0x343c('0x2b')]?'/contacts('+_0x2089c2[_0x343c('0x2b')]+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x2089c2['userId']+')','directioncode':_0x2089c2['callDirection']===_0x343c('0x48')?![]:!![],'phonecall_activity_parties':_0xf5e7e6},getCustomFields(_0x3854e6[_0x343c('0x46')],_0x1f08e1,_0x3854e6['ticketType'])),'headers':{'Authorization':_0x343c('0x4e')+_0x44840c,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x1a1060);})[_0x343c('0x1d')](function(_0x4b98cd){var _0x2f6949=_0x4b98cd[_0x343c('0x4f')][_0x343c('0x28')];var _0x769215=_0x2f6949[_0x343c('0x29')](_0x2f6949[_0x343c('0x2a')]('(')+0x1,_0x2f6949[_0x343c('0x2a')](')'));_0x2089c2[_0x343c('0x50')]=_0x769215;_0x5dbd3a(_0x2089c2);})[_0x343c('0x17')](function(_0x1d9148){_0xb21334(_0x1d9148[_0x343c('0x1a')]);});});}function emit(_0x1296ab,_0x279946,_0x2e1fe4,_0x440e74){var _0x464a47={'uri':util[_0x343c('0x51')]('%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s',_0x1296ab,_0x2e1fe4,_0x440e74)};io['to'](util[_0x343c('0x51')](_0x343c('0x52'),_0x279946))['emit'](_0x343c('0x53'),_0x464a47);}exports['cs']=function(_0x481bec,_0x5039fd,_0x5b3b65,_0x4d8dca,_0x36295c,_0x24111e,_0x3d6d3b,_0x43dfc3){var _0xb6ac99={};_0x24111e[_0x343c('0xc')]=_0x24111e[_0x343c('0xb')]?intUtil['stripTrailingSlash'](_0x24111e[_0x343c('0xd')][_0x343c('0xe')]):intUtil[_0x343c('0x54')](_0x24111e[_0x343c('0xc')]);_0x24111e[_0x343c('0x55')]=intUtil[_0x343c('0x54')](_0x24111e[_0x343c('0x55')]);_0xb6ac99[_0x343c('0x49')]=_0x43dfc3==='queue'||_0x43dfc3==='unmanaged'?_0x343c('0x48'):_0x343c('0x2c');var _0x9caffd=_0x24111e[_0x343c('0xb')]?util[_0x343c('0x51')](_0x343c('0x56'),_0x24111e[_0x343c('0xd')][_0x343c('0xe')]):util[_0x343c('0x51')](_0x343c('0x56'),_0x24111e['remoteUri']);var _0x4d5549=util[_0x343c('0x51')](_0x343c('0x57'),_0x24111e[_0x343c('0xf')]);var _0x11c927=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x24111e[_0x343c('0x55')],_0x5039fd[_0x343c('0x58')],md5(_0x5039fd[_0x343c('0x58')]));if(_0x36295c&&_0x36295c['monitor_format']){logger['info'](_0x343c('0x59'),_0x343c('0x5a'));_0x5039fd[_0x343c('0x5b')]=_0x11c927;}else if(_0x3d6d3b&&_0x3d6d3b[_0x343c('0x5c')]&&_0x3d6d3b[_0x343c('0x5c')]!==_0x343c('0x5d')){logger['info'](_0x343c('0x5e'),'Recording\x20is\x20enabled!');_0x5039fd[_0x343c('0x5b')]=_0x11c927;}else{_0x5039fd[_0x343c('0x5b')]='';}return getUser(_0xb6ac99,_0x24111e,_0x4d8dca,_0x4d5549,_0x9caffd,_0x43dfc3)[_0x343c('0x1d')](function(_0x3ca9f8){logger['info']('['+_0x43dfc3[_0x343c('0x37')]()+_0x343c('0x5f'),_0x3ca9f8['userId']);logger['info']('['+_0x43dfc3['toUpperCase']()+']\x20The\x20User\x20email\x20is:',_0x3ca9f8[_0x343c('0x25')]);return getEndUser(_0x3ca9f8,_0x24111e,_0x4d5549,_0x9caffd,_0x5039fd,_0x43dfc3,_0x5b3b65[_0x343c('0x60')],_0x5b3b65['additionalSearchContact']);})[_0x343c('0x1d')](function(_0x53bef4){logger['info']('['+_0x43dfc3[_0x343c('0x37')]()+']\x20The\x20Enduser\x20ID\x20is:',_0x53bef4[_0x343c('0x2b')]);logger['info']('['+_0x43dfc3['toUpperCase']()+_0x343c('0x61'),_0x5039fd[_0x343c('0x4d')]);return getTicket(_0x53bef4,_0x24111e,_0x4d5549,_0x9caffd,_0x5039fd,_0x5b3b65,_0x43dfc3);})[_0x343c('0x1d')](function(_0x24b7f2){logger['info'](util[_0x343c('0x51')]('['+_0x43dfc3['toUpperCase']()+_0x343c('0x62'),_0x5b3b65[_0x343c('0x40')],_0x24b7f2[_0x343c('0x50')]));logger[_0x343c('0x22')](util[_0x343c('0x51')]('['+_0x43dfc3[_0x343c('0x37')]()+_0x343c('0x63'),_0x43dfc3));if(_0x43dfc3!=='unmanaged'&&_0x5b3b65[_0x343c('0x64')]){logger[_0x343c('0x22')]('['+_0x43dfc3['toUpperCase']()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x24111e[_0x343c('0xc')],_0x4d8dca[_0x343c('0x65')],_0x5b3b65[_0x343c('0x40')],_0x24b7f2[_0x343c('0x50')]);}})['catch'](function(_0x31369f){logger[_0x343c('0x18')]('['+_0x43dfc3['toUpperCase']()+']\x20Error\x20running\x20Dynamics365\x20integration',_0x31369f['message']);console[_0x343c('0x18')](_0x343c('0x66'),_0x31369f);});}; \ No newline at end of file +var _0xa422=['picklist','nameField','customField','idField','indexOf','content','assign','getString','/contacts(','Fields','ticketType','phonecall','callDirection','queue','Descriptions','odata-entityid','ticketId','format','user:%s','emit','trigger:browser:url','serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingURL','none',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','moduleCreate','additionalSearchContact',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','openNewTab','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Dynamics365\x20integration','Error\x20running\x20Dynamics365\x20integration','lodash','request-promise','util','./util','md5','ioredis','dynamics365','../../../../config/environment','redis','localhost','modernAuthentication','remoteUri','data7','CloudProvider','data2','resolve','data5','POST','clientId','username','clientSecret','access_token','catch','error',']\x20Wrong\x20credentials!','then','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','validateEmail','email','userEmail','length','internalemailaddress','toUpperCase',']\x20Agent\x20found\x20','systemuserid','userId','info',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','message','toLowerCase','calleridnum','contacts','/systemusers(','body','headers','substring','lastIndexOf','outbound','GET','contacts?$select=','&$filter=','replace','%2b','value','enduserId','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing','string'];(function(_0x436a1a,_0x1c6be0){var _0x8e1d7b=function(_0x514831){while(--_0x514831){_0x436a1a['push'](_0x436a1a['shift']());}};_0x8e1d7b(++_0x1c6be0);}(_0xa422,0x160));var _0x2a42=function(_0x28c096,_0x148c62){_0x28c096=_0x28c096-0x0;var _0x2b3aa0=_0xa422[_0x28c096];return _0x2b3aa0;};'use strict';var _=require(_0x2a42('0x0'));var rp=require(_0x2a42('0x1'));var util=require(_0x2a42('0x2'));var intUtil=require(_0x2a42('0x3'));var md5=require(_0x2a42('0x4'));var Redis=require(_0x2a42('0x5'));var logger=require('../../../../config/logger')(_0x2a42('0x6'));var config=require(_0x2a42('0x7'));config[_0x2a42('0x8')]=_['defaults'](config[_0x2a42('0x8')],{'host':_0x2a42('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function getAuthToken(_0x4535c2,_0x5ed5d0,_0x2e39dc){if(_0x4535c2[_0x2a42('0xa')]){_0x4535c2[_0x2a42('0xb')]=_0x4535c2['CloudProvider'][_0x2a42('0xc')];_0x4535c2['tenantId']=_0x4535c2[_0x2a42('0xd')][_0x2a42('0xe')];return Promise[_0x2a42('0xf')](_0x4535c2['CloudProvider'][_0x2a42('0x10')]);}var _0x1bded2={'method':_0x2a42('0x11'),'uri':_0x5ed5d0,'form':{'client_id':_0x4535c2[_0x2a42('0x12')],'resource':_0x4535c2[_0x2a42('0xb')],'username':_0x4535c2[_0x2a42('0x13')],'password':_0x4535c2['password'],'grant_type':'password','client_secret':_0x4535c2[_0x2a42('0x14')]},'json':!![]};return rp(_0x1bded2)['then'](function(_0x37f573){return _0x37f573[_0x2a42('0x15')];})[_0x2a42('0x16')](function(_0x5a92ca){logger[_0x2a42('0x17')]('['+[_0x2e39dc['toUpperCase']()]+_0x2a42('0x18'));return _0x5a92ca['message'];});}function getUser(_0x4a41cd,_0x1b1959,_0x436646,_0x2d9a19,_0x72dd16,_0x495c3e){return new Promise(function(_0x6f4ff3,_0x418eef){return getAuthToken(_0x1b1959,_0x2d9a19,_0x495c3e)[_0x2a42('0x19')](function(_0x21b84b){var _0x59bc20={'method':'GET','uri':_0x72dd16+_0x2a42('0x1a'),'headers':{'Authorization':_0x2a42('0x1b')+_0x21b84b,'OData-Version':_0x2a42('0x1c')},'json':!![]};return rp(_0x59bc20);})['then'](function(_0x1e8666){var _0x3282a2=_0x1e8666['value'];var _0x29cff4=![];var _0x240513=null;if(!_['isNil'](_0x436646)){if(intUtil[_0x2a42('0x1d')](_0x436646[_0x2a42('0x1e')])){_0x4a41cd[_0x2a42('0x1f')]=_0x436646['email'];for(_0x240513=0x0;_0x240513<_0x3282a2[_0x2a42('0x20')];_0x240513++){if(_0x3282a2[_0x240513][_0x2a42('0x21')]===_0x436646[_0x2a42('0x1e')]&&!_0x3282a2[_0x240513]['isdisabled']){_0x29cff4=!![];logger['info']('['+[_0x495c3e[_0x2a42('0x22')]()]+_0x2a42('0x23')+_0x3282a2[_0x240513][_0x2a42('0x24')]+'!');_0x4a41cd[_0x2a42('0x25')]=_0x3282a2[_0x240513][_0x2a42('0x24')];}}}}if(!_0x29cff4){logger[_0x2a42('0x26')]('['+[_0x495c3e[_0x2a42('0x22')]()]+_0x2a42('0x27'));_0x4a41cd['userEmail']=_0x1b1959[_0x2a42('0x13')];for(_0x240513=0x0;_0x240513<_0x3282a2[_0x2a42('0x20')];_0x240513++){if(_0x3282a2[_0x240513][_0x2a42('0x21')]===_0x1b1959[_0x2a42('0x13')]){_0x4a41cd[_0x2a42('0x25')]=_0x3282a2[_0x240513][_0x2a42('0x24')];}}}_0x6f4ff3(_0x4a41cd);})[_0x2a42('0x16')](function(_0x1cd411){_0x418eef(_0x1cd411[_0x2a42('0x28')]);});});}function createEndUser(_0x45422e,_0x107aad,_0x2f3059,_0x110ab1,_0x47b3b5,_0x3e8baf,_0x19528c){return new Promise(function(_0x2a59fd,_0x22b911){return getAuthToken(_0x107aad,_0x2f3059,_0x3e8baf)[_0x2a42('0x19')](function(_0x435a30){var _0x1a58e8=_0x3e8baf[_0x2a42('0x29')]()==='outbound'?_0x47b3b5['destcalleridnum']:_0x47b3b5[_0x2a42('0x2a')];var _0x342bd1={'method':_0x2a42('0x11'),'uri':_0x110ab1+_0x2a42('0x2b'),'body':{'fullname':_0x1a58e8,'firstname':_0x1a58e8,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x2a42('0x2c')+_0x45422e[_0x2a42('0x25')]+')'},'headers':{'Authorization':_0x2a42('0x1b')+_0x435a30,'OData-Version':_0x2a42('0x1c')},'json':!![],'resolveWithFullResponse':!![]};_0x342bd1[_0x2a42('0x2d')][_0x19528c]=_0x1a58e8;return rp(_0x342bd1);})[_0x2a42('0x19')](function(_0x15c36e){var _0xfa0af2=_0x15c36e[_0x2a42('0x2e')]['odata-entityid'];var _0x5f85c7=_0xfa0af2[_0x2a42('0x2f')](_0xfa0af2[_0x2a42('0x30')]('(')+0x1,_0xfa0af2[_0x2a42('0x30')](')'));_0x45422e['enduserId']=_0x5f85c7;_0x2a59fd(_0x45422e);})[_0x2a42('0x16')](function(_0x329c70){_0x22b911(_0x329c70['message']);});});}function getEndUser(_0x41c413,_0x275330,_0x4cac4b,_0x13578c,_0x5ccb86,_0x2123ce,_0x1633d7,_0x6ea8c5){var _0x80aa59=_0x2123ce[_0x2a42('0x29')]()===_0x2a42('0x31')?_0x5ccb86['destcalleridnum']:_0x5ccb86[_0x2a42('0x2a')];return getAuthToken(_0x275330,_0x4cac4b,_0x2123ce)['then'](function(_0x45e033){_0x6ea8c5=_0x6ea8c5?_0x6ea8c5:'telephone1';var _0x8465ad={'method':_0x2a42('0x32'),'uri':_0x13578c+_0x2a42('0x33')+_0x6ea8c5+_0x2a42('0x34')+_0x6ea8c5+'\x20eq\x20\x27'+_0x80aa59[_0x2a42('0x35')]('+',_0x2a42('0x36'))+'\x27','headers':{'Authorization':'Bearer\x20'+_0x45e033,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x8465ad);})[_0x2a42('0x19')](function(_0x8303ac){var _0x4e1f32=![];if(!_0x8303ac)return _0x4e1f32;var _0x4cf8cc=_0x8303ac[_0x2a42('0x37')];for(var _0x520ef5=0x0;_0x520ef5<_0x4cf8cc[_0x2a42('0x20')];_0x520ef5++){if(_0x4cf8cc[_0x520ef5][_0x6ea8c5]===_0x80aa59){_0x4e1f32=!![];_0x41c413[_0x2a42('0x38')]=_0x4cf8cc[_0x520ef5]['contactid'];}}return _0x4e1f32;})[_0x2a42('0x19')](function(_0x52cf47){if(_0x52cf47)return _0x41c413;if(_0x1633d7===_0x2a42('0x39')){logger[_0x2a42('0x26')]('['+[_0x2123ce[_0x2a42('0x22')]()]+_0x2a42('0x3a'));return _0x41c413;}return createEndUser(_0x41c413,_0x275330,_0x4cac4b,_0x13578c,_0x5ccb86,_0x2123ce,_0x6ea8c5)[_0x2a42('0x19')](function(_0x5c95e1){logger['info']('['+[_0x2123ce['toUpperCase']()]+']\x20Enduser\x20created!',_0x5c95e1[_0x2a42('0x38')]);return _0x5c95e1;});});}function getCustomFields(_0x3a2983,_0x4ab1ad,_0x5a4218){var _0x2d2725={};if(_0x3a2983[_0x2a42('0x20')]>0x0){_['forEach'](_0x3a2983,function(_0x1fc233){if(_['includes']([_0x2a42('0x3b'),_0x2a42('0x3c')],_0x1fc233['type'])&&_0x1fc233[_0x2a42('0x3d')]&&!_0x1fc233[_0x2a42('0x3e')]){var _0x5994c1=_0x1fc233[_0x2a42('0x3f')][_0x2a42('0x29')]();var _0x4e968e=_0x5994c1[_0x2a42('0x2f')](0x0,_0x5994c1[_0x2a42('0x40')]('_'));var _0x48bdaf=_0x5994c1[_0x2a42('0x2f')](_0x5994c1[_0x2a42('0x40')]('_')+0x1);if(_0x4e968e===_0x5a4218){_0x2d2725[_0x48bdaf]=_0x1fc233[_0x2a42('0x41')];}}});}return _0x2d2725;}function getTicket(_0x1c3abd,_0x392f70,_0x226248,_0x3509a7,_0x43daf8,_0x1c1448,_0x545de2){return new Promise(function(_0x125091,_0x35be30){var _0x5cb9a9;return getAuthToken(_0x392f70,_0x226248,_0x545de2)[_0x2a42('0x19')](function(_0x4a4930){if(_0x1c1448['ticketType']==='incident'){_0x5cb9a9={'method':_0x2a42('0x11'),'uri':_0x3509a7+'incidents','body':Object[_0x2a42('0x42')]({},{'title':intUtil['getString'](_0x1c1448['Subjects'],_0x43daf8,'\x20'),'description':intUtil[_0x2a42('0x43')](_0x1c1448['Descriptions'],_0x43daf8,'\x0a'),'customerid_contact@odata.bind':_0x1c3abd[_0x2a42('0x38')]?_0x2a42('0x44')+_0x1c3abd['enduserId']+')':undefined,'ownerid@odata.bind':_0x2a42('0x2c')+_0x1c3abd[_0x2a42('0x25')]+')','caseorigincode':'1'},getCustomFields(_0x1c1448[_0x2a42('0x45')],_0x43daf8,_0x1c1448['ticketType'])),'headers':{'Authorization':'Bearer\x20'+_0x4a4930,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x1c1448[_0x2a42('0x46')]===_0x2a42('0x47')){var _0x221790=_0x1c3abd[_0x2a42('0x38')]?[{'partyid_systemuser@odata.bind':'/systemusers('+_0x1c3abd['userId']+')','participationtypemask':_0x1c3abd[_0x2a42('0x48')]===_0x2a42('0x49')?0x2:0x1},{'partyid_contact@odata.bind':_0x2a42('0x44')+_0x1c3abd[_0x2a42('0x38')]+')','participationtypemask':_0x1c3abd['callDirection']===_0x2a42('0x49')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x2a42('0x2c')+_0x1c3abd[_0x2a42('0x25')]+')','participationtypemask':_0x1c3abd[_0x2a42('0x48')]===_0x2a42('0x49')?0x2:0x1}];_0x5cb9a9={'method':_0x2a42('0x11'),'uri':_0x3509a7+'phonecalls','body':Object[_0x2a42('0x42')]({},{'subject':intUtil[_0x2a42('0x43')](_0x1c1448['Subjects'],_0x43daf8,'\x20'),'phonenumber':String(_0x43daf8['calleridnum']),'description':intUtil[_0x2a42('0x43')](_0x1c1448[_0x2a42('0x4a')],_0x43daf8,'\x0a'),'regardingobjectid_contact@odata.bind':_0x1c3abd[_0x2a42('0x38')]?_0x2a42('0x44')+_0x1c3abd[_0x2a42('0x38')]+')':undefined,'ownerid@odata.bind':_0x2a42('0x2c')+_0x1c3abd['userId']+')','directioncode':_0x1c3abd[_0x2a42('0x48')]===_0x2a42('0x49')?![]:!![],'phonecall_activity_parties':_0x221790},getCustomFields(_0x1c1448[_0x2a42('0x45')],_0x43daf8,_0x1c1448[_0x2a42('0x46')])),'headers':{'Authorization':_0x2a42('0x1b')+_0x4a4930,'OData-Version':_0x2a42('0x1c')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x5cb9a9);})['then'](function(_0x1af00d){var _0x2f3d70=_0x1af00d[_0x2a42('0x2e')][_0x2a42('0x4b')];var _0x205960=_0x2f3d70[_0x2a42('0x2f')](_0x2f3d70[_0x2a42('0x30')]('(')+0x1,_0x2f3d70[_0x2a42('0x30')](')'));_0x1c3abd[_0x2a42('0x4c')]=_0x205960;_0x125091(_0x1c3abd);})[_0x2a42('0x16')](function(_0x1a3ade){_0x35be30(_0x1a3ade[_0x2a42('0x28')]);});});}function emit(_0x179bf0,_0x2cd065,_0x1e31b1,_0x2f3240){var _0x57eab0={'uri':util[_0x2a42('0x4d')]('%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s',_0x179bf0,_0x1e31b1,_0x2f3240)};io['to'](util[_0x2a42('0x4d')](_0x2a42('0x4e'),_0x2cd065))[_0x2a42('0x4f')](_0x2a42('0x50'),_0x57eab0);}exports['cs']=function(_0x593462,_0x58175f,_0xea8766,_0x1d8c76,_0x1c8851,_0x275beb,_0xe9e3e6,_0x5b1127){var _0x55f324={};_0x275beb['remoteUri']=_0x275beb['modernAuthentication']?intUtil['stripTrailingSlash'](_0x275beb[_0x2a42('0xd')]['data7']):intUtil['stripTrailingSlash'](_0x275beb['remoteUri']);_0x275beb[_0x2a42('0x51')]=intUtil['stripTrailingSlash'](_0x275beb[_0x2a42('0x51')]);_0x55f324[_0x2a42('0x48')]=_0x5b1127==='queue'||_0x5b1127===_0x2a42('0x52')?_0x2a42('0x49'):_0x2a42('0x31');var _0x17a9d6=_0x275beb[_0x2a42('0xa')]?util['format'](_0x2a42('0x53'),_0x275beb[_0x2a42('0xd')][_0x2a42('0xc')]):util['format'](_0x2a42('0x53'),_0x275beb[_0x2a42('0xb')]);var _0x7fdfa8=util[_0x2a42('0x4d')](_0x2a42('0x54'),_0x275beb[_0x2a42('0x55')]);var _0x232c2a=util[_0x2a42('0x4d')](_0x2a42('0x56'),_0x275beb[_0x2a42('0x51')],_0x58175f[_0x2a42('0x57')],md5(_0x58175f[_0x2a42('0x57')]));if(_0x1c8851&&_0x1c8851[_0x2a42('0x58')]){logger[_0x2a42('0x26')]('[QUEUE]',_0x2a42('0x59'));_0x58175f[_0x2a42('0x5a')]=_0x232c2a;}else if(_0xe9e3e6&&_0xe9e3e6['recordingFormat']&&_0xe9e3e6['recordingFormat']!==_0x2a42('0x5b')){logger[_0x2a42('0x26')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x58175f[_0x2a42('0x5a')]=_0x232c2a;}else{_0x58175f[_0x2a42('0x5a')]='';}return getUser(_0x55f324,_0x275beb,_0x1d8c76,_0x7fdfa8,_0x17a9d6,_0x5b1127)[_0x2a42('0x19')](function(_0x5b261e){logger[_0x2a42('0x26')]('['+_0x5b1127[_0x2a42('0x22')]()+_0x2a42('0x5c'),_0x5b261e[_0x2a42('0x25')]);logger[_0x2a42('0x26')]('['+_0x5b1127[_0x2a42('0x22')]()+_0x2a42('0x5d'),_0x5b261e[_0x2a42('0x1f')]);return getEndUser(_0x5b261e,_0x275beb,_0x7fdfa8,_0x17a9d6,_0x58175f,_0x5b1127,_0xea8766[_0x2a42('0x5e')],_0xea8766[_0x2a42('0x5f')]);})['then'](function(_0x2eea68){logger[_0x2a42('0x26')]('['+_0x5b1127[_0x2a42('0x22')]()+']\x20The\x20Enduser\x20ID\x20is:',_0x2eea68[_0x2a42('0x38')]);logger[_0x2a42('0x26')]('['+_0x5b1127[_0x2a42('0x22')]()+_0x2a42('0x60'),_0x58175f[_0x2a42('0x2a')]);return getTicket(_0x2eea68,_0x275beb,_0x7fdfa8,_0x17a9d6,_0x58175f,_0xea8766,_0x5b1127);})[_0x2a42('0x19')](function(_0x52e75b){logger[_0x2a42('0x26')](util[_0x2a42('0x4d')]('['+_0x5b1127[_0x2a42('0x22')]()+_0x2a42('0x61'),_0xea8766[_0x2a42('0x46')],_0x52e75b['ticketId']));logger[_0x2a42('0x26')](util[_0x2a42('0x4d')]('['+_0x5b1127['toUpperCase']()+_0x2a42('0x62'),_0x5b1127));if(_0x5b1127!=='unmanaged'&&_0xea8766[_0x2a42('0x63')]){logger[_0x2a42('0x26')]('['+_0x5b1127[_0x2a42('0x22')]()+']',_0x2a42('0x64'));emit(_0x275beb[_0x2a42('0xb')],_0x1d8c76['name'],_0xea8766[_0x2a42('0x46')],_0x52e75b[_0x2a42('0x4c')]);}})[_0x2a42('0x16')](function(_0x1d3b9d){logger[_0x2a42('0x17')]('['+_0x5b1127[_0x2a42('0x22')]()+_0x2a42('0x65'),_0x1d3b9d[_0x2a42('0x28')]);console[_0x2a42('0x17')](_0x2a42('0x66'),_0x1d3b9d);});}; \ 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 59d648d..1fa42e5 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 _0x5603=['then','length','Agent\x20found!','find','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20created.','apiKey','toString','base64','[HTTP]','stringify','GET','map','includes','picklist','type','nameField','customField','toLowerCase','string','idField','push','content','variable','variableName','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','Authorization','email','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','[QUEUE]','recordingFormat','none','[OUTBOUND]','destcalleridnum','The\x20Ticket\x20ID\x20is:','error','unmanaged','toUpperCase','Recording\x20is\x20enabled!','lastevent','lodash','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','application/json','info','Creating\x20new\x20ticket...','merge','format','calleridname','calleridnum','Subjects','getString','Descriptions','
','name','Fields','mapValues','keyBy','custom_fields','value','%s/api/v2/tickets','remoteUri','POST','Ticket\x20created!','validateEmail'];(function(_0xf3842b,_0x51d854){var _0x34317f=function(_0x44c91d){while(--_0x44c91d){_0xf3842b['push'](_0xf3842b['shift']());}};_0x34317f(++_0x51d854);}(_0x5603,0x92));var _0x3560=function(_0x912214,_0x1f675d){_0x912214=_0x912214-0x0;var _0x50d694=_0x5603[_0x912214];return _0x50d694;};'use strict';var _=require(_0x3560('0x0'));var rp=require('request-promise');var md5=require(_0x3560('0x1'));var util=require(_0x3560('0x2'));var Redis=require(_0x3560('0x3'));var intUtil=require(_0x3560('0x4'));var config=require(_0x3560('0x5'));var logger=require(_0x3560('0x6'))(_0x3560('0x7'));config[_0x3560('0x8')]=_[_0x3560('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x3560('0x8')]));var headers={'Content-Type':_0x3560('0xa'),'Accept':_0x3560('0xa')};function emit(_0x339094,_0x8210f8,_0x24b61d){io['to'](_0x339094)['emit'](_0x8210f8,_0x24b61d);}function getTicket(_0x15de20,_0x193cf4,_0x3bd9f7,_0x30520d,_0x28b575){logger[_0x3560('0xb')](_0x3560('0xc'));var _0x5e8d1e=_[_0x3560('0xd')]({'responder_id':_0x193cf4['id'],'requester_id':_0x3bd9f7['id'],'name':util[_0x3560('0xe')]('Caller\x20-\x20%s',_0x28b575[_0x3560('0xf')]),'phone':_0x28b575[_0x3560('0x10')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0x30520d[_0x3560('0x11')],_0x28b575,'\x20'),'description':intUtil[_0x3560('0x12')](_0x30520d[_0x3560('0x13')],_0x28b575,_0x3560('0x14')),'tags':getTags(_0x30520d['Tags'],_0x3560('0x15'))},getCustomFields(_0x30520d[_0x3560('0x16')],_0x28b575));_0x5e8d1e['custom_fields']=_[_0x3560('0x17')](_[_0x3560('0x18')](_0x5e8d1e[_0x3560('0x19')],'id'),_0x3560('0x1a'));return request({'uri':util[_0x3560('0xe')](_0x3560('0x1b'),_0x15de20[_0x3560('0x1c')]),'method':_0x3560('0x1d'),'body':_0x5e8d1e})['then'](function(_0x53017a){logger[_0x3560('0xb')](_0x3560('0x1e'));return _0x53017a;});}function getUser(_0x21354c,_0x3ad9fe){if(intUtil[_0x3560('0x1f')](_0x3ad9fe)){return request({'uri':util[_0x3560('0xe')]('%s/api/v2/agents',_0x21354c[_0x3560('0x1c')]),'qs':{'email':_0x3ad9fe}})[_0x3560('0x20')](function(_0x4bdbd3){if(_0x4bdbd3[_0x3560('0x21')]){logger['info'](_0x3560('0x22'));return _[_0x3560('0x23')](_0x4bdbd3,function(_0x4bdc09){return _0x4bdc09['contact']['email']===_0x3ad9fe;});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format']('%s/api/v2/agents/me',_0x21354c[_0x3560('0x1c')])})[_0x3560('0x20')](function(_0x493aab){logger['info'](_0x3560('0x24'));return _0x493aab;});}});}else{logger[_0x3560('0xb')](_0x3560('0x25'));return request({'uri':util[_0x3560('0xe')]('%s/api/v2/agents/me',_0x21354c[_0x3560('0x1c')])})[_0x3560('0x20')](function(_0x67df83){logger[_0x3560('0xb')](_0x3560('0x24'));return _0x67df83;});}}function getEndUser(_0x52ba4c,_0x35fad5,_0x30aa1f){logger[_0x3560('0xb')](_0x3560('0x26'),_0x30aa1f);return request({'uri':util['format'](_0x3560('0x27'),_0x52ba4c[_0x3560('0x1c')]),'qs':{'phone':_0x30aa1f}})[_0x3560('0x20')](function(_0x2c1937){if(_0x2c1937[_0x3560('0x21')]){logger[_0x3560('0xb')](_0x3560('0x28'));return _[_0x3560('0x23')](_0x2c1937,{'phone':_0x30aa1f});}else{logger[_0x3560('0xb')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0x3560('0xe')](_0x3560('0x27'),_0x52ba4c[_0x3560('0x1c')]),'method':'POST','body':{'name':_0x35fad5,'phone':_0x30aa1f}})[_0x3560('0x20')](function(_0x478c57){logger[_0x3560('0xb')](_0x3560('0x29'));return _0x478c57;});}});}function getAuth(_0x197cce){return util['format']('Basic\x20%s',new Buffer(_0x197cce[_0x3560('0x2a')]+':X')[_0x3560('0x2b')](_0x3560('0x2c')));}function request(_0x2a7f7c){logger['debug'](_0x3560('0x2d'),JSON[_0x3560('0x2e')](_0x2a7f7c));return rp(_[_0x3560('0x9')](_0x2a7f7c,{'method':_0x3560('0x2f'),'headers':headers,'json':!![]}));}function getTags(_0xad88bd,_0x5d541f){var _0x1593a5=[];if(_0xad88bd&&_0xad88bd[_0x3560('0x21')]>0x0){_0x1593a5=_[_0x3560('0x30')](_0xad88bd,_0x5d541f);}return _0x1593a5;}function getCustomFields(_0x462f42,_0x5c0fab){var _0x394df0=[];var _0x48c586={'custom_fields':[]};if(_0x462f42[_0x3560('0x21')]>0x0){_['forEach'](_0x462f42,function(_0x3e6a59){if(_[_0x3560('0x31')](['string',_0x3560('0x32')],_0x3e6a59[_0x3560('0x33')])&&_0x3e6a59[_0x3560('0x34')]&&!_0x3e6a59[_0x3560('0x35')]){_0x48c586[_0x3e6a59['nameField'][_0x3560('0x36')]()]=_0x3e6a59['content'][_0x3560('0x2b')]();}else if(_[_0x3560('0x31')]([_0x3560('0x37'),_0x3560('0x32')],_0x3e6a59[_0x3560('0x33')])&&_0x3e6a59[_0x3560('0x38')]&&_0x3e6a59[_0x3560('0x35')]){_0x48c586[_0x3560('0x19')][_0x3560('0x39')]({'id':_0x3e6a59['idField'],'value':_0x3e6a59[_0x3560('0x3a')][_0x3560('0x2b')]()});}else if(_0x3e6a59[_0x3560('0x33')]===_0x3560('0x3b')&&_0x3e6a59[_0x3560('0x3c')]&&_0x3e6a59[_0x3560('0x38')]&&_0x3e6a59[_0x3560('0x35')]){_0x5c0fab[_0x3e6a59[_0x3560('0x3c')]]&&_0x48c586['custom_fields'][_0x3560('0x39')]({'id':_0x3e6a59[_0x3560('0x38')],'value':_0x5c0fab[_0x3e6a59[_0x3560('0x3c')]]['toString']()});}else if(_0x3e6a59[_0x3560('0x33')]===_0x3560('0x3d')&&_0x3e6a59[_0x3560('0x3e')]&&_0x3e6a59['Variable']['name']&&_0x3e6a59[_0x3560('0x38')]&&_0x3e6a59[_0x3560('0x35')]){_0x5c0fab[_0x3e6a59['Variable'][_0x3560('0x15')][_0x3560('0x36')]()]&&_0x48c586[_0x3560('0x19')][_0x3560('0x39')]({'id':_0x3e6a59[_0x3560('0x38')],'value':_0x5c0fab[_0x3e6a59['Variable'][_0x3560('0x15')][_0x3560('0x36')]()]['toString']()});}});}return _0x48c586;}exports[_0x3560('0x3f')]=function(_0x197640,_0x24aca2,_0x3e3cff,_0xef963a,_0x163d83,_0x554553){var _0x585274,_0x3ebf61;_0x554553[_0x3560('0x1c')]=intUtil[_0x3560('0x40')](_0x554553[_0x3560('0x1c')]);_0x554553['serverUrl']=intUtil[_0x3560('0x40')](_0x554553[_0x3560('0x41')]);if(_0x163d83&&_0x163d83[_0x3560('0x42')]){logger[_0x3560('0xb')]('[QUEUE]','Recording\x20is\x20enabled!');_0x24aca2['recordingURL']=util[_0x3560('0xe')](_0x3560('0x43'),_0x554553[_0x3560('0x41')],_0x24aca2[_0x3560('0x44')],md5(_0x24aca2[_0x3560('0x44')]));}else{_0x24aca2[_0x3560('0x45')]='';}headers[_0x3560('0x46')]=getAuth(_0x554553);return getUser(_0x554553,_0xef963a[_0x3560('0x47')])[_0x3560('0x20')](function(_0x54467e){_0x585274=_0x54467e;logger[_0x3560('0xb')](_0x3560('0x48'),_0x585274['id']);return getEndUser(_0x554553,_0x24aca2[_0x3560('0xf')],_0x24aca2['calleridnum']);})[_0x3560('0x20')](function(_0x1d0c27){_0x3ebf61=_0x1d0c27;logger['info'](_0x3560('0x49'),_0x3ebf61['id']);return getTicket(_0x554553,_0x585274,_0x3ebf61,_0x3e3cff,_0x24aca2);})[_0x3560('0x20')](function(_0xc5b1a5){if(_0xc5b1a5&&_0xc5b1a5['id']){logger['info'](_0x3560('0x1e'));logger['info']('The\x20Ticket\x20ID\x20is:',_0xc5b1a5['id']);logger[_0x3560('0xb')]('[QUEUE]',_0x3560('0x4a'));emit(util[_0x3560('0xe')](_0x3560('0x4b'),_0xef963a[_0x3560('0x15')]),_0x3560('0x4c'),{'uri':util[_0x3560('0xe')]('%s/helpdesk/tickets/%d',_0x554553['remoteUri'],_0xc5b1a5['id'])});}})[_0x3560('0x4d')](function(_0x10515d){logger['error'](_0x3560('0x4e'),JSON[_0x3560('0x2e')](_0x10515d));});};exports['outbound']=function(_0x12c9f1,_0x34743d,_0x3095cb,_0x3f3946,_0x20838a,_0x1e4cf9,_0x345f01){var _0x43e59c,_0x19efd3;_0x1e4cf9['remoteUri']=intUtil['stripTrailingSlash'](_0x1e4cf9[_0x3560('0x1c')]);_0x1e4cf9[_0x3560('0x41')]=intUtil[_0x3560('0x40')](_0x1e4cf9[_0x3560('0x41')]);if(_0x345f01&&_0x345f01[_0x3560('0x4f')]&&_0x345f01[_0x3560('0x4f')]!==_0x3560('0x50')){logger[_0x3560('0xb')](_0x3560('0x51'),'Recording\x20is\x20enabled!');_0x34743d[_0x3560('0x45')]=util[_0x3560('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1e4cf9[_0x3560('0x41')],_0x34743d[_0x3560('0x44')],md5(_0x34743d['uniqueid']));}headers['Authorization']=getAuth(_0x1e4cf9);return getUser(_0x1e4cf9,_0x3f3946[_0x3560('0x47')])['then'](function(_0x10b84f){_0x43e59c=_0x10b84f;logger[_0x3560('0xb')](_0x3560('0x48'),_0x43e59c['id']);return getEndUser(_0x1e4cf9,_0x34743d['destcalleridname'],_0x34743d[_0x3560('0x52')]);})['then'](function(_0x2c0668){_0x19efd3=_0x2c0668;logger[_0x3560('0xb')](_0x3560('0x49'),_0x19efd3['id']);return getTicket(_0x1e4cf9,_0x43e59c,_0x19efd3,_0x3095cb,_0x34743d);})['then'](function(_0x4fcd17){if(_0x4fcd17&&_0x4fcd17['id']){logger[_0x3560('0xb')](_0x3560('0x1e'));logger[_0x3560('0xb')](_0x3560('0x53'),_0x4fcd17['id']);logger['info'](_0x3560('0x51'),_0x3560('0x4a'));emit(util[_0x3560('0xe')](_0x3560('0x4b'),_0x3f3946[_0x3560('0x15')]),_0x3560('0x4c'),{'uri':util[_0x3560('0xe')]('%s/helpdesk/tickets/%d',_0x1e4cf9[_0x3560('0x1c')],_0x4fcd17['id'])});}})[_0x3560('0x4d')](function(_0x282869){logger[_0x3560('0x54')](_0x3560('0x51'),JSON[_0x3560('0x2e')](_0x282869));});};exports[_0x3560('0x55')]=function(_0x222fec,_0x57bce4,_0x36130a,_0x23ea3e,_0x60643a,_0x3005e4){var _0x366301,_0x500eb1;_0x3005e4['remoteUri']=intUtil[_0x3560('0x40')](_0x3005e4[_0x3560('0x1c')]);_0x3005e4['serverUrl']=intUtil[_0x3560('0x40')](_0x3005e4['serverUrl']);if(_0x60643a&&_0x60643a[_0x3560('0x42')]){logger[_0x3560('0xb')]('['+_0x57bce4['lastevent'][_0x3560('0x56')]()+']',_0x3560('0x57'));_0x57bce4[_0x3560('0x45')]=util[_0x3560('0xe')](_0x3560('0x43'),_0x3005e4[_0x3560('0x41')],_0x57bce4['uniqueid'],md5(_0x57bce4['uniqueid']));}else{_0x57bce4['recordingURL']='';}headers[_0x3560('0x46')]=getAuth(_0x3005e4);return getUser(_0x3005e4,'')[_0x3560('0x20')](function(_0x50d614){_0x366301=_0x50d614;logger[_0x3560('0xb')](_0x3560('0x48'),_0x366301['id']);return getEndUser(_0x3005e4,_0x57bce4['calleridname'],_0x57bce4['calleridnum']);})[_0x3560('0x20')](function(_0x50ca68){_0x500eb1=_0x50ca68;logger[_0x3560('0xb')](_0x3560('0x49'),_0x500eb1['id']);return getTicket(_0x3005e4,_0x366301,_0x500eb1,_0x36130a,_0x57bce4);})['then'](function(_0x1fd117){if(_0x1fd117){logger[_0x3560('0xb')](_0x3560('0x1e'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x1fd117['id']);}})[_0x3560('0x4d')](function(_0xd1be17){logger[_0x3560('0x54')]('['+_0x57bce4[_0x3560('0x58')][_0x3560('0x56')]()+']',JSON['stringify'](_0xd1be17));});}; \ No newline at end of file +var _0xdba2=['recordingFormat','none','Recording\x20is\x20enabled!','Authorization','destcalleridname','destcalleridnum','[OUTBOUND]','catch','unmanaged','monitor_format','lastevent','toUpperCase','calleridname','request-promise','md5','util','ioredis','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','localhost','socket.io-emitter','application/json','emit','info','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','Subjects','getString','Descriptions','Tags','name','Fields','custom_fields','mapValues','keyBy','value','%s/api/v2/tickets','POST','then','Ticket\x20created!','validateEmail','%s/api/v2/agents','remoteUri','length','Agent\x20found!','find','contact','email','%s/api/v2/agents/me','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20created.','Basic\x20%s','apiKey','base64','debug','[HTTP]','stringify','GET','map','forEach','includes','string','picklist','type','nameField','customField','toLowerCase','content','toString','variable','variableName','idField','push','customVariable','Variable','queue','stripTrailingSlash','serverUrl','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','outbound'];(function(_0x359313,_0x318562){var _0x413466=function(_0x9fea0b){while(--_0x9fea0b){_0x359313['push'](_0x359313['shift']());}};_0x413466(++_0x318562);}(_0xdba2,0x195));var _0x2dba=function(_0x34cefa,_0x5ab77b){_0x34cefa=_0x34cefa-0x0;var _0xcef7bc=_0xdba2[_0x34cefa];return _0xcef7bc;};'use strict';var _=require('lodash');var rp=require(_0x2dba('0x0'));var md5=require(_0x2dba('0x1'));var util=require(_0x2dba('0x2'));var Redis=require(_0x2dba('0x3'));var intUtil=require('./util');var config=require(_0x2dba('0x4'));var logger=require(_0x2dba('0x5'))(_0x2dba('0x6'));config[_0x2dba('0x7')]=_[_0x2dba('0x8')](config[_0x2dba('0x7')],{'host':_0x2dba('0x9'),'port':0x18eb});var io=require(_0x2dba('0xa'))(new Redis(config[_0x2dba('0x7')]));var headers={'Content-Type':'application/json','Accept':_0x2dba('0xb')};function emit(_0x23a225,_0x5ca9b8,_0x5496d4){io['to'](_0x23a225)[_0x2dba('0xc')](_0x5ca9b8,_0x5496d4);}function getTicket(_0x25fcea,_0x6e876d,_0x46d2ef,_0x3213b5,_0x2a8c61){logger[_0x2dba('0xd')](_0x2dba('0xe'));var _0x582d91=_[_0x2dba('0xf')]({'responder_id':_0x6e876d['id'],'requester_id':_0x46d2ef['id'],'name':util[_0x2dba('0x10')](_0x2dba('0x11'),_0x2a8c61['calleridname']),'phone':_0x2a8c61['calleridnum'],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0x3213b5[_0x2dba('0x12')],_0x2a8c61,'\x20'),'description':intUtil[_0x2dba('0x13')](_0x3213b5[_0x2dba('0x14')],_0x2a8c61,'
'),'tags':getTags(_0x3213b5[_0x2dba('0x15')],_0x2dba('0x16'))},getCustomFields(_0x3213b5[_0x2dba('0x17')],_0x2a8c61));_0x582d91[_0x2dba('0x18')]=_[_0x2dba('0x19')](_[_0x2dba('0x1a')](_0x582d91[_0x2dba('0x18')],'id'),_0x2dba('0x1b'));return request({'uri':util['format'](_0x2dba('0x1c'),_0x25fcea['remoteUri']),'method':_0x2dba('0x1d'),'body':_0x582d91})[_0x2dba('0x1e')](function(_0x5e6740){logger['info'](_0x2dba('0x1f'));return _0x5e6740;});}function getUser(_0x1e211a,_0x213a55){if(intUtil[_0x2dba('0x20')](_0x213a55)){return request({'uri':util[_0x2dba('0x10')](_0x2dba('0x21'),_0x1e211a[_0x2dba('0x22')]),'qs':{'email':_0x213a55}})[_0x2dba('0x1e')](function(_0x3be874){if(_0x3be874[_0x2dba('0x23')]){logger[_0x2dba('0xd')](_0x2dba('0x24'));return _[_0x2dba('0x25')](_0x3be874,function(_0x435469){return _0x435469[_0x2dba('0x26')][_0x2dba('0x27')]===_0x213a55;});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format'](_0x2dba('0x28'),_0x1e211a[_0x2dba('0x22')])})[_0x2dba('0x1e')](function(_0x13fa87){logger['info']('Admin\x20account\x20selected.');return _0x13fa87;});}});}else{logger[_0x2dba('0xd')](_0x2dba('0x29'));return request({'uri':util['format'](_0x2dba('0x28'),_0x1e211a[_0x2dba('0x22')])})[_0x2dba('0x1e')](function(_0x4e5eb8){logger['info']('Admin\x20account\x20selected.');return _0x4e5eb8;});}}function getEndUser(_0x327b7a,_0xd3e23a,_0x5ac795){logger[_0x2dba('0xd')](_0x2dba('0x2a'),_0x5ac795);return request({'uri':util['format'](_0x2dba('0x2b'),_0x327b7a[_0x2dba('0x22')]),'qs':{'phone':_0x5ac795}})['then'](function(_0x574d94){if(_0x574d94[_0x2dba('0x23')]){logger[_0x2dba('0xd')](_0x2dba('0x2c'));return _['find'](_0x574d94,{'phone':_0x5ac795});}else{logger['info']('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util['format'](_0x2dba('0x2b'),_0x327b7a[_0x2dba('0x22')]),'method':_0x2dba('0x1d'),'body':{'name':_0xd3e23a,'phone':_0x5ac795}})[_0x2dba('0x1e')](function(_0x40b90d){logger['info'](_0x2dba('0x2d'));return _0x40b90d;});}});}function getAuth(_0x17d45c){return util[_0x2dba('0x10')](_0x2dba('0x2e'),new Buffer(_0x17d45c[_0x2dba('0x2f')]+':X')['toString'](_0x2dba('0x30')));}function request(_0xbf358c){logger[_0x2dba('0x31')](_0x2dba('0x32'),JSON[_0x2dba('0x33')](_0xbf358c));return rp(_[_0x2dba('0x8')](_0xbf358c,{'method':_0x2dba('0x34'),'headers':headers,'json':!![]}));}function getTags(_0x2dac32,_0x27afb3){var _0x1341a0=[];if(_0x2dac32&&_0x2dac32[_0x2dba('0x23')]>0x0){_0x1341a0=_[_0x2dba('0x35')](_0x2dac32,_0x27afb3);}return _0x1341a0;}function getCustomFields(_0x4aab0f,_0x127049){var _0x528159=[];var _0x2d5bd8={'custom_fields':[]};if(_0x4aab0f[_0x2dba('0x23')]>0x0){_[_0x2dba('0x36')](_0x4aab0f,function(_0x3d2670){if(_[_0x2dba('0x37')]([_0x2dba('0x38'),_0x2dba('0x39')],_0x3d2670[_0x2dba('0x3a')])&&_0x3d2670[_0x2dba('0x3b')]&&!_0x3d2670[_0x2dba('0x3c')]){_0x2d5bd8[_0x3d2670['nameField'][_0x2dba('0x3d')]()]=_0x3d2670[_0x2dba('0x3e')][_0x2dba('0x3f')]();}else if(_[_0x2dba('0x37')]([_0x2dba('0x38'),_0x2dba('0x39')],_0x3d2670[_0x2dba('0x3a')])&&_0x3d2670['idField']&&_0x3d2670['customField']){_0x2d5bd8['custom_fields']['push']({'id':_0x3d2670['idField'],'value':_0x3d2670[_0x2dba('0x3e')][_0x2dba('0x3f')]()});}else if(_0x3d2670[_0x2dba('0x3a')]===_0x2dba('0x40')&&_0x3d2670[_0x2dba('0x41')]&&_0x3d2670[_0x2dba('0x42')]&&_0x3d2670['customField']){_0x127049[_0x3d2670[_0x2dba('0x41')]]&&_0x2d5bd8[_0x2dba('0x18')][_0x2dba('0x43')]({'id':_0x3d2670[_0x2dba('0x42')],'value':_0x127049[_0x3d2670[_0x2dba('0x41')]][_0x2dba('0x3f')]()});}else if(_0x3d2670[_0x2dba('0x3a')]===_0x2dba('0x44')&&_0x3d2670['Variable']&&_0x3d2670[_0x2dba('0x45')]['name']&&_0x3d2670[_0x2dba('0x42')]&&_0x3d2670[_0x2dba('0x3c')]){_0x127049[_0x3d2670['Variable'][_0x2dba('0x16')][_0x2dba('0x3d')]()]&&_0x2d5bd8[_0x2dba('0x18')][_0x2dba('0x43')]({'id':_0x3d2670[_0x2dba('0x42')],'value':_0x127049[_0x3d2670[_0x2dba('0x45')][_0x2dba('0x16')]['toLowerCase']()][_0x2dba('0x3f')]()});}});}return _0x2d5bd8;}exports[_0x2dba('0x46')]=function(_0x4bb122,_0x52af9d,_0x4cb919,_0x1f83bc,_0x83e9ff,_0x377a47){var _0x22d36a,_0x47fe6d;_0x377a47['remoteUri']=intUtil[_0x2dba('0x47')](_0x377a47[_0x2dba('0x22')]);_0x377a47[_0x2dba('0x48')]=intUtil[_0x2dba('0x47')](_0x377a47['serverUrl']);if(_0x83e9ff&&_0x83e9ff['monitor_format']){logger['info'](_0x2dba('0x49'),'Recording\x20is\x20enabled!');_0x52af9d['recordingURL']=util['format'](_0x2dba('0x4a'),_0x377a47[_0x2dba('0x48')],_0x52af9d['uniqueid'],md5(_0x52af9d[_0x2dba('0x4b')]));}else{_0x52af9d[_0x2dba('0x4c')]='';}headers['Authorization']=getAuth(_0x377a47);return getUser(_0x377a47,_0x1f83bc[_0x2dba('0x27')])['then'](function(_0x11f0ed){_0x22d36a=_0x11f0ed;logger[_0x2dba('0xd')](_0x2dba('0x4d'),_0x22d36a['id']);return getEndUser(_0x377a47,_0x52af9d['calleridname'],_0x52af9d[_0x2dba('0x4e')]);})['then'](function(_0x1cec2f){_0x47fe6d=_0x1cec2f;logger[_0x2dba('0xd')](_0x2dba('0x4f'),_0x47fe6d['id']);return getTicket(_0x377a47,_0x22d36a,_0x47fe6d,_0x4cb919,_0x52af9d);})[_0x2dba('0x1e')](function(_0x23ee10){if(_0x23ee10&&_0x23ee10['id']){logger[_0x2dba('0xd')](_0x2dba('0x1f'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x23ee10['id']);logger[_0x2dba('0xd')](_0x2dba('0x49'),_0x2dba('0x50'));emit(util[_0x2dba('0x10')](_0x2dba('0x51'),_0x1f83bc[_0x2dba('0x16')]),_0x2dba('0x52'),{'uri':util[_0x2dba('0x10')](_0x2dba('0x53'),_0x377a47[_0x2dba('0x22')],_0x23ee10['id'])});}})['catch'](function(_0x5f0052){logger['error'](_0x2dba('0x49'),JSON[_0x2dba('0x33')](_0x5f0052));});};exports[_0x2dba('0x54')]=function(_0x5b82aa,_0x42616b,_0x3e914c,_0x4d989d,_0x242e74,_0x3d7bd0,_0x4f4a20){var _0x34aaae,_0x4b26e7;_0x3d7bd0[_0x2dba('0x22')]=intUtil[_0x2dba('0x47')](_0x3d7bd0[_0x2dba('0x22')]);_0x3d7bd0[_0x2dba('0x48')]=intUtil[_0x2dba('0x47')](_0x3d7bd0['serverUrl']);if(_0x4f4a20&&_0x4f4a20['recordingFormat']&&_0x4f4a20[_0x2dba('0x55')]!==_0x2dba('0x56')){logger[_0x2dba('0xd')]('[OUTBOUND]',_0x2dba('0x57'));_0x42616b[_0x2dba('0x4c')]=util[_0x2dba('0x10')](_0x2dba('0x4a'),_0x3d7bd0[_0x2dba('0x48')],_0x42616b[_0x2dba('0x4b')],md5(_0x42616b['uniqueid']));}headers[_0x2dba('0x58')]=getAuth(_0x3d7bd0);return getUser(_0x3d7bd0,_0x4d989d[_0x2dba('0x27')])['then'](function(_0x525d68){_0x34aaae=_0x525d68;logger[_0x2dba('0xd')](_0x2dba('0x4d'),_0x34aaae['id']);return getEndUser(_0x3d7bd0,_0x42616b[_0x2dba('0x59')],_0x42616b[_0x2dba('0x5a')]);})[_0x2dba('0x1e')](function(_0x1d3588){_0x4b26e7=_0x1d3588;logger['info'](_0x2dba('0x4f'),_0x4b26e7['id']);return getTicket(_0x3d7bd0,_0x34aaae,_0x4b26e7,_0x3e914c,_0x42616b);})[_0x2dba('0x1e')](function(_0x43a1db){if(_0x43a1db&&_0x43a1db['id']){logger[_0x2dba('0xd')]('Ticket\x20created!');logger['info']('The\x20Ticket\x20ID\x20is:',_0x43a1db['id']);logger[_0x2dba('0xd')](_0x2dba('0x5b'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x2dba('0x10')](_0x2dba('0x51'),_0x4d989d[_0x2dba('0x16')]),_0x2dba('0x52'),{'uri':util[_0x2dba('0x10')](_0x2dba('0x53'),_0x3d7bd0[_0x2dba('0x22')],_0x43a1db['id'])});}})[_0x2dba('0x5c')](function(_0x5ed938){logger['error'](_0x2dba('0x5b'),JSON['stringify'](_0x5ed938));});};exports[_0x2dba('0x5d')]=function(_0xe58f4,_0x4ea616,_0x4ceebf,_0x1a189a,_0x4a2ecf,_0x3c41fb){var _0x50cc9c,_0x1bb90b;_0x3c41fb['remoteUri']=intUtil['stripTrailingSlash'](_0x3c41fb[_0x2dba('0x22')]);_0x3c41fb[_0x2dba('0x48')]=intUtil[_0x2dba('0x47')](_0x3c41fb[_0x2dba('0x48')]);if(_0x4a2ecf&&_0x4a2ecf[_0x2dba('0x5e')]){logger['info']('['+_0x4ea616[_0x2dba('0x5f')][_0x2dba('0x60')]()+']',_0x2dba('0x57'));_0x4ea616['recordingURL']=util['format'](_0x2dba('0x4a'),_0x3c41fb['serverUrl'],_0x4ea616[_0x2dba('0x4b')],md5(_0x4ea616[_0x2dba('0x4b')]));}else{_0x4ea616[_0x2dba('0x4c')]='';}headers[_0x2dba('0x58')]=getAuth(_0x3c41fb);return getUser(_0x3c41fb,'')[_0x2dba('0x1e')](function(_0xb44241){_0x50cc9c=_0xb44241;logger[_0x2dba('0xd')]('The\x20User\x20ID\x20is:',_0x50cc9c['id']);return getEndUser(_0x3c41fb,_0x4ea616[_0x2dba('0x61')],_0x4ea616[_0x2dba('0x4e')]);})[_0x2dba('0x1e')](function(_0x36e00e){_0x1bb90b=_0x36e00e;logger[_0x2dba('0xd')]('The\x20Enduser\x20ID\x20is:',_0x1bb90b['id']);return getTicket(_0x3c41fb,_0x50cc9c,_0x1bb90b,_0x4ceebf,_0x4ea616);})[_0x2dba('0x1e')](function(_0x36426c){if(_0x36426c){logger[_0x2dba('0xd')](_0x2dba('0x1f'));logger[_0x2dba('0xd')]('The\x20Ticket\x20ID\x20is:',_0x36426c['id']);}})[_0x2dba('0x5c')](function(_0x408d1a){logger['error']('['+_0x4ea616[_0x2dba('0x5f')]['toUpperCase']()+']',JSON[_0x2dba('0x33')](_0x408d1a));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/freshsales.js b/server/services/ami/trigger/integration/freshsales.js index f2f286a..445e35b 100644 --- a/server/services/ami/trigger/integration/freshsales.js +++ b/server/services/ami/trigger/integration/freshsales.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3428=['length','email','adminEmail','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','message','Getting\x20user\x20list','users','agentEmail','Getting\x20user\x20with\x20email','userEmail','userId','User\x20found:','Admin\x20selected','&f=','then','find','contacts','Searching\x20contact\x20with\x20phone\x20%s','mobile_number','contactNumber','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','Contact\x20created:','/api/contacts','YYYY-MM-DDTHH:mm:ss','contact','Creating\x20new\x20task','POST','/api/tasks','getString','Subjects','Descriptions','Contact','format','add','task','Task\x20created:','ticketId','user:%s','trigger:browser:url','Token\x20token=','apiKey','remoteUri','serverUrl','stripTrailingSlash','username','outbound','destcalleridnum','callDirection','queue','unmanaged','uniqueid','[QUEUE]','recordingURL','recordingFormat','none','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','md5','util','bluebird','ioredis','../../../../config/environment','../../../../config/logger','freshsales','redis','defaults','localhost','socket.io-emitter','GET','/api/selector/owners','headers','info','Getting\x20admin\x20information'];(function(_0x20d87c,_0x2e3d22){var _0x21d9be=function(_0x1f1d83){while(--_0x1f1d83){_0x20d87c['push'](_0x20d87c['shift']());}};_0x21d9be(++_0x2e3d22);}(_0x3428,0x13f));var _0x8342=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0x3428[_0x21549c];return _0x426cbd;};'use strict';var _=require(_0x8342('0x0'));var rp=require('request-promise');var md5=require(_0x8342('0x1'));var util=require(_0x8342('0x2'));var moment=require('moment');var Promise=require(_0x8342('0x3'));var Redis=require(_0x8342('0x4'));var intUtil=require('./util');var config=require(_0x8342('0x5'));var logger=require(_0x8342('0x6'))(_0x8342('0x7'));config[_0x8342('0x8')]=_[_0x8342('0x9')](config[_0x8342('0x8')],{'host':_0x8342('0xa'),'port':0x18eb});var io=require(_0x8342('0xb'))(new Redis(config['redis']));function getAdminId(_0x95b5fa,_0x599754,_0x4bf5c6,_0x54ef7c){return new Promise(function(_0x496231,_0x3e21a2){var _0x216ce9=![];var _0x296ace={'method':_0x8342('0xc'),'uri':_0x54ef7c+_0x8342('0xd'),'json':!![]};_0x296ace[_0x8342('0xe')]=_0x4bf5c6;logger[_0x8342('0xf')](_0x8342('0x10'));return rp(_0x296ace)['then'](function(_0x57ff4f){if(_0x57ff4f){var _0x5f1e8c=_0x57ff4f['users'];var _0x291eb3=null;for(_0x291eb3=0x0;_0x291eb3<_0x5f1e8c[_0x8342('0x11')];_0x291eb3++){if(_0x5f1e8c[_0x291eb3][_0x8342('0x12')]===_0x95b5fa[_0x8342('0x13')]){_0x95b5fa[_0x8342('0x14')]=_0x5f1e8c[_0x291eb3]['id'];_0x216ce9=!![];}}if(_0x216ce9){logger['info'](_0x8342('0x15'),_0x95b5fa[_0x8342('0x14')]);_0x496231(_0x95b5fa);}else{_0x3e21a2({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x3e21a2({'statusCode':0x194,'message':_0x8342('0x16')});}})[_0x8342('0x17')](function(_0x39ae93){logger[_0x8342('0x18')]('['+[_0x599754[_0x8342('0x19')]()]+']',_0x39ae93[_0x8342('0x1a')]);_0x3e21a2(_0x39ae93);});});}function getUser(_0x398594,_0x243845,_0x8c142f){return function(_0x591ae3){return new Promise(function(_0x2c28f0,_0x23c26a){var _0x191651={'method':'GET','uri':_0x8c142f+_0x8342('0xd'),'json':!![]};_0x191651[_0x8342('0xe')]=_0x243845;logger['info'](_0x8342('0x1b'));return rp(_0x191651)['then'](function(_0x305b41){if(_0x305b41){var _0x17367b=_0x305b41[_0x8342('0x1c')];var _0xb5a13d=![];var _0x18cff3=null;if(_0x591ae3[_0x8342('0x1d')]!==null){logger[_0x8342('0xf')](_0x8342('0x1e'),_0x591ae3[_0x8342('0x1d')]);_0x591ae3[_0x8342('0x1f')]=_0x591ae3[_0x8342('0x1d')];for(_0x18cff3=0x0;_0x18cff3<_0x17367b[_0x8342('0x11')];_0x18cff3++){if(_0x17367b[_0x18cff3][_0x8342('0x12')]===_0x591ae3[_0x8342('0x1d')]){_0xb5a13d=!![];_0x591ae3[_0x8342('0x20')]=_0x17367b[_0x18cff3]['id'];logger[_0x8342('0xf')](_0x8342('0x21'),_0x591ae3['userId']);}}}if(!_0xb5a13d){logger[_0x8342('0xf')](_0x8342('0x22'));_0x591ae3['userEmail']=_0x591ae3[_0x8342('0x13')];_0x591ae3['userId']=_0x591ae3[_0x8342('0x14')];_0xb5a13d=!![];}if(_0xb5a13d){_0x2c28f0(_0x591ae3);}else{_0x23c26a({'statusCode':0x194,'message':_0x8342('0x16')});}}else{_0x23c26a({'statusCode':0x194,'message':_0x8342('0x16')});}})[_0x8342('0x17')](function(_0x4410ea){logger[_0x8342('0x18')]('['+[_0x398594['toUpperCase']()]+']',_0x4410ea['message']);_0x23c26a(_0x4410ea);});});};}function searchContact(_0xea2687,_0x37731d,_0x1704a2,_0x5ca166){return new Promise(function(_0x1fd612,_0x23626f){var _0x51b384={'method':'GET','headers':_0x37731d,'uri':_0xea2687+'/api/lookup?q='+_0x5ca166+_0x8342('0x23')+_0x1704a2+'&entities=contact','json':!![]};rp(_0x51b384)[_0x8342('0x24')](function(_0x3c9b38){var _0x3356b0=_[_0x8342('0x25')](_0x3c9b38['contacts'][_0x8342('0x26')],[_0x1704a2,_0x5ca166]);_0x1fd612(_0x3356b0);})[_0x8342('0x17')](function(_0x5acff5){_0x23626f(_0x5acff5);});});}function getEndUser(_0x1f332b,_0x1747e0,_0x11adda){return function(_0x42355a){return new Promise(function(_0x2cb96e,_0x45ac8c){logger['info'](util['format'](_0x8342('0x27'),_0x42355a['contactNumber']));searchContact(_0x11adda,_0x1747e0,_0x8342('0x28'),_0x42355a[_0x8342('0x29')])['then'](function(_0x47a643){if(_0x47a643){_0x42355a[_0x8342('0x2a')]=_0x47a643['id'];logger[_0x8342('0xf')](_0x8342('0x2b'),_0x42355a[_0x8342('0x2a')]);return _0x2cb96e(_0x42355a);}searchContact(_0x11adda,_0x1747e0,_0x8342('0x2c'),_0x42355a['contactNumber'])['then'](function(_0x1df5e2){if(_0x1df5e2){_0x42355a[_0x8342('0x2a')]=_0x1df5e2['id'];logger[_0x8342('0xf')](_0x8342('0x2d'),_0x42355a[_0x8342('0x2a')]);return _0x2cb96e(_0x42355a);}createEndUser(_0x42355a,_0x1f332b,_0x1747e0,_0x11adda)[_0x8342('0x24')](function(_0x299aef){logger[_0x8342('0xf')](_0x8342('0x2e'),_0x299aef[_0x8342('0x2a')]);return _0x2cb96e(_0x299aef);});});})[_0x8342('0x17')](function(_0x4d763a){_0x45ac8c(_0x4d763a);});});};}function createEndUser(_0x1739e4,_0x59f3a5,_0x183491,_0x473f66){return new Promise(function(_0x31f359,_0x46eb37){var _0x321302=moment();var _0x2b8cc3={'method':'POST','uri':_0x473f66+_0x8342('0x2f'),'body':{'contact':{'last_name':_0x1739e4[_0x8342('0x29')],'work_number':_0x1739e4['contactNumber'],'mobile_number':_0x1739e4['contactNumber'],'owner_id':_0x1739e4[_0x8342('0x20')],'created_at':_0x321302['format'](_0x8342('0x30'))}},'json':!![]};_0x2b8cc3[_0x8342('0xe')]=_0x183491;logger[_0x8342('0xf')]('Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact');return rp(_0x2b8cc3)[_0x8342('0x24')](function(_0xb66291){_0x1739e4[_0x8342('0x2a')]=_0xb66291[_0x8342('0x31')]['id'];_0x31f359(_0x1739e4);})[_0x8342('0x17')](function(_0x296d24){logger[_0x8342('0x18')]('['+[_0x59f3a5['toUpperCase']()]+']',_0x296d24[_0x8342('0x1a')]);_0x46eb37(_0x296d24[_0x8342('0x1a')]);});});}function getTicket(_0x17e0d6,_0x15564c,_0x18fd2a,_0x137853,_0x41a6a2){return function(_0x893347){logger[_0x8342('0xf')](_0x8342('0x32'));return new Promise(function(_0x3ad48b,_0x459760){var _0x3776a8=moment();var _0x14196e={'method':_0x8342('0x33'),'uri':_0x18fd2a+_0x8342('0x34'),'body':{'title':intUtil[_0x8342('0x35')](_0x137853[_0x8342('0x36')],_0x41a6a2,'\x20'),'description':intUtil[_0x8342('0x35')](_0x137853[_0x8342('0x37')],_0x41a6a2,'\x0a'),'owner_id':_0x893347[_0x8342('0x20')],'creater_id':_0x893347[_0x8342('0x14')],'targetable_id':_0x893347[_0x8342('0x2a')],'targetable_type':_0x8342('0x38'),'created_at':_0x3776a8[_0x8342('0x39')](_0x8342('0x30')),'due_date':_0x3776a8[_0x8342('0x3a')](0x1e,'m')[_0x8342('0x39')](_0x8342('0x30'))},'json':!![]};_0x14196e[_0x8342('0xe')]=_0x15564c;return rp(_0x14196e)[_0x8342('0x24')](function(_0x51244e){_0x893347['ticketId']=_0x51244e[_0x8342('0x3b')]['id'];logger[_0x8342('0xf')](_0x8342('0x3c'),_0x893347[_0x8342('0x3d')]);_0x3ad48b(_0x893347);})[_0x8342('0x17')](function(_0x56ff09){logger[_0x8342('0x18')]('['+[_0x17e0d6[_0x8342('0x19')]()]+']',_0x56ff09[_0x8342('0x1a')]);_0x459760(_0x56ff09[_0x8342('0x1a')]);});});};}function emit(_0x11c21a,_0x3b5916,_0x15d120){var _0x3a454a={'uri':_0x11c21a+'/contacts/'+_0x15d120};io['to'](util[_0x8342('0x39')](_0x8342('0x3e'),_0x3b5916))['emit'](_0x8342('0x3f'),_0x3a454a);}exports['cs']=function(_0x15a635,_0xe17b17,_0x53609f,_0x144228,_0x47c941,_0x9e6129,_0x4393b2,_0x553462){var _0x2b8d94={};var _0x1dc80d={'Authorization':_0x8342('0x40')+_0x9e6129[_0x8342('0x41')]};_0x9e6129['remoteUri']=intUtil['stripTrailingSlash'](_0x9e6129[_0x8342('0x42')]);_0x9e6129[_0x8342('0x43')]=intUtil[_0x8342('0x44')](_0x9e6129[_0x8342('0x43')]);var _0x3f6cd7=_0x9e6129['remoteUri'];_0x2b8d94[_0x8342('0x13')]=_0x9e6129[_0x8342('0x45')];_0x2b8d94['contactNumber']=_0x553462['toLowerCase']()===_0x8342('0x46')?_0xe17b17[_0x8342('0x47')]:_0xe17b17['calleridnum'];_0x2b8d94[_0x8342('0x48')]=_0x553462===_0x8342('0x49')||_0x553462===_0x8342('0x4a')?_0x8342('0x49'):_0x8342('0x46');if(_0x144228){_0x2b8d94[_0x8342('0x1d')]=_0x144228[_0x8342('0x12')];}var _0x5330ba=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x9e6129[_0x8342('0x43')],_0xe17b17['uniqueid'],md5(_0xe17b17[_0x8342('0x4b')]));if(_0x47c941&&_0x47c941['monitor_format']){logger[_0x8342('0xf')](_0x8342('0x4c'),'Recording\x20is\x20enabled!');_0xe17b17[_0x8342('0x4d')]=_0x5330ba;}else if(_0x4393b2&&_0x4393b2[_0x8342('0x4e')]&&_0x4393b2[_0x8342('0x4e')]!==_0x8342('0x4f')){logger['info']('[OUTBOUND]','Recording\x20is\x20enabled!');_0xe17b17[_0x8342('0x4d')]=_0x5330ba;}else{_0xe17b17[_0x8342('0x4d')]='';}return getAdminId(_0x2b8d94,_0x553462,_0x1dc80d,_0x3f6cd7)[_0x8342('0x24')](getUser(_0x553462,_0x1dc80d,_0x3f6cd7))[_0x8342('0x24')](getEndUser(_0x553462,_0x1dc80d,_0x3f6cd7))[_0x8342('0x24')](getTicket(_0x553462,_0x1dc80d,_0x3f6cd7,_0x53609f,_0xe17b17))[_0x8342('0x24')](function(_0x19158e){logger[_0x8342('0xf')](util[_0x8342('0x39')]('The\x20ticket\x20ID\x20is:\x20%s',_0x19158e[_0x8342('0x3d')]));if(_0x553462!=='unmanaged'){logger['info']('['+[_0x553462[_0x8342('0x19')]()]+']',_0x8342('0x50'));emit(_0x3f6cd7,_0x144228[_0x8342('0x51')],_0x19158e[_0x8342('0x2a')]);}})['catch'](function(_0x4eccd2){logger[_0x8342('0x18')]('['+[_0x553462[_0x8342('0x19')]()]+_0x8342('0x52'),util[_0x8342('0x53')](_0x4eccd2,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xc1b8=['adminId','info','Admin\x20found:','Requested\x20Resource\x20not\x20Found','toUpperCase','message','GET','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','email','userId','User\x20found:','userEmail','error','find','contacts','catch','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','Contact\x20found\x20work_number:','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','headers','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','/api/tasks','getString','Subjects','Descriptions','add','task','Task\x20created:','user:%s','emit','trigger:browser:url','Token\x20token=','apiKey','stripTrailingSlash','remoteUri','serverUrl','username','toLowerCase','destcalleridnum','unmanaged','queue','outbound','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','request-promise','md5','ioredis','../../../../config/environment','redis','socket.io-emitter','/api/selector/owners','Getting\x20admin\x20information','then','users','adminEmail'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0xc1b8,0x128));var _0x8c1b=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xc1b8[_0x433a86];return _0x23000c;};'use strict';var _=require(_0x8c1b('0x0'));var rp=require(_0x8c1b('0x1'));var md5=require(_0x8c1b('0x2'));var util=require('util');var moment=require('moment');var Promise=require('bluebird');var Redis=require(_0x8c1b('0x3'));var intUtil=require('./util');var config=require(_0x8c1b('0x4'));var logger=require('../../../../config/logger')('freshsales');config[_0x8c1b('0x5')]=_['defaults'](config[_0x8c1b('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x8c1b('0x6'))(new Redis(config['redis']));function getAdminId(_0x3df475,_0x16661f,_0x2c8a22,_0x1e9afe){return new Promise(function(_0xfb661c,_0x340771){var _0x4ded96=![];var _0x8ffb3f={'method':'GET','uri':_0x1e9afe+_0x8c1b('0x7'),'json':!![]};_0x8ffb3f['headers']=_0x2c8a22;logger['info'](_0x8c1b('0x8'));return rp(_0x8ffb3f)[_0x8c1b('0x9')](function(_0x54a78f){if(_0x54a78f){var _0x50d68b=_0x54a78f[_0x8c1b('0xa')];var _0x18ba47=null;for(_0x18ba47=0x0;_0x18ba47<_0x50d68b['length'];_0x18ba47++){if(_0x50d68b[_0x18ba47]['email']===_0x3df475[_0x8c1b('0xb')]){_0x3df475[_0x8c1b('0xc')]=_0x50d68b[_0x18ba47]['id'];_0x4ded96=!![];}}if(_0x4ded96){logger[_0x8c1b('0xd')](_0x8c1b('0xe'),_0x3df475['adminId']);_0xfb661c(_0x3df475);}else{_0x340771({'statusCode':0x194,'message':_0x8c1b('0xf')});}}else{_0x340771({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})['catch'](function(_0x4d3958){logger['error']('['+[_0x16661f[_0x8c1b('0x10')]()]+']',_0x4d3958[_0x8c1b('0x11')]);_0x340771(_0x4d3958);});});}function getUser(_0x495e9c,_0x468ee3,_0x20672c){return function(_0x547faa){return new Promise(function(_0x53322d,_0x1f2ebf){var _0x8c495f={'method':_0x8c1b('0x12'),'uri':_0x20672c+'/api/selector/owners','json':!![]};_0x8c495f['headers']=_0x468ee3;logger['info'](_0x8c1b('0x13'));return rp(_0x8c495f)['then'](function(_0x15e2d3){if(_0x15e2d3){var _0x29b02a=_0x15e2d3[_0x8c1b('0xa')];var _0x36b441=![];var _0x593510=null;if(_0x547faa[_0x8c1b('0x14')]!==null){logger['info'](_0x8c1b('0x15'),_0x547faa[_0x8c1b('0x14')]);_0x547faa['userEmail']=_0x547faa[_0x8c1b('0x14')];for(_0x593510=0x0;_0x593510<_0x29b02a['length'];_0x593510++){if(_0x29b02a[_0x593510][_0x8c1b('0x16')]===_0x547faa[_0x8c1b('0x14')]){_0x36b441=!![];_0x547faa[_0x8c1b('0x17')]=_0x29b02a[_0x593510]['id'];logger[_0x8c1b('0xd')](_0x8c1b('0x18'),_0x547faa[_0x8c1b('0x17')]);}}}if(!_0x36b441){logger['info']('Admin\x20selected');_0x547faa[_0x8c1b('0x19')]=_0x547faa[_0x8c1b('0xb')];_0x547faa[_0x8c1b('0x17')]=_0x547faa[_0x8c1b('0xc')];_0x36b441=!![];}if(_0x36b441){_0x53322d(_0x547faa);}else{_0x1f2ebf({'statusCode':0x194,'message':_0x8c1b('0xf')});}}else{_0x1f2ebf({'statusCode':0x194,'message':_0x8c1b('0xf')});}})['catch'](function(_0x32a3b6){logger[_0x8c1b('0x1a')]('['+[_0x495e9c[_0x8c1b('0x10')]()]+']',_0x32a3b6[_0x8c1b('0x11')]);_0x1f2ebf(_0x32a3b6);});});};}function searchContact(_0x2eb8c3,_0xefe7f8,_0xf7efb4,_0xe5fdbe){return new Promise(function(_0x4dfbd7,_0x14a14c){var _0x56adac={'method':_0x8c1b('0x12'),'headers':_0xefe7f8,'uri':_0x2eb8c3+'/api/lookup?q='+_0xe5fdbe+'&f='+_0xf7efb4+'&entities=contact','json':!![]};rp(_0x56adac)['then'](function(_0xf2488f){var _0x2d103b=_[_0x8c1b('0x1b')](_0xf2488f[_0x8c1b('0x1c')]['contacts'],[_0xf7efb4,_0xe5fdbe]);_0x4dfbd7(_0x2d103b);})[_0x8c1b('0x1d')](function(_0x54a26d){_0x14a14c(_0x54a26d);});});}function getEndUser(_0x336c50,_0x2587d7,_0xc6029f){return function(_0x1ee8c2){return new Promise(function(_0x5eeb6c,_0x511839){logger[_0x8c1b('0xd')](util[_0x8c1b('0x1e')](_0x8c1b('0x1f'),_0x1ee8c2[_0x8c1b('0x20')]));searchContact(_0xc6029f,_0x2587d7,_0x8c1b('0x21'),_0x1ee8c2[_0x8c1b('0x20')])['then'](function(_0x47f475){if(_0x47f475){_0x1ee8c2[_0x8c1b('0x22')]=_0x47f475['id'];logger[_0x8c1b('0xd')](_0x8c1b('0x23'),_0x1ee8c2[_0x8c1b('0x22')]);return _0x5eeb6c(_0x1ee8c2);}searchContact(_0xc6029f,_0x2587d7,'work_number',_0x1ee8c2[_0x8c1b('0x20')])[_0x8c1b('0x9')](function(_0x227187){if(_0x227187){_0x1ee8c2[_0x8c1b('0x22')]=_0x227187['id'];logger['info'](_0x8c1b('0x24'),_0x1ee8c2[_0x8c1b('0x22')]);return _0x5eeb6c(_0x1ee8c2);}createEndUser(_0x1ee8c2,_0x336c50,_0x2587d7,_0xc6029f)[_0x8c1b('0x9')](function(_0x33db5c){logger['info']('Contact\x20created:',_0x33db5c['endUserId']);return _0x5eeb6c(_0x33db5c);});});})[_0x8c1b('0x1d')](function(_0x1d307e){_0x511839(_0x1d307e);});});};}function createEndUser(_0x590ebe,_0x4dcbce,_0x1791cf,_0x201fcf){return new Promise(function(_0x51cd0e,_0x416296){var _0x100ab8=moment();var _0x94f996={'method':_0x8c1b('0x25'),'uri':_0x201fcf+_0x8c1b('0x26'),'body':{'contact':{'last_name':_0x590ebe[_0x8c1b('0x20')],'work_number':_0x590ebe[_0x8c1b('0x20')],'mobile_number':_0x590ebe[_0x8c1b('0x20')],'owner_id':_0x590ebe[_0x8c1b('0x17')],'created_at':_0x100ab8[_0x8c1b('0x1e')](_0x8c1b('0x27'))}},'json':!![]};_0x94f996[_0x8c1b('0x28')]=_0x1791cf;logger[_0x8c1b('0xd')](_0x8c1b('0x29'));return rp(_0x94f996)['then'](function(_0x4faee9){_0x590ebe[_0x8c1b('0x22')]=_0x4faee9[_0x8c1b('0x2a')]['id'];_0x51cd0e(_0x590ebe);})[_0x8c1b('0x1d')](function(_0x5d1fca){logger[_0x8c1b('0x1a')]('['+[_0x4dcbce[_0x8c1b('0x10')]()]+']',_0x5d1fca['message']);_0x416296(_0x5d1fca[_0x8c1b('0x11')]);});});}function getTicket(_0x3a057f,_0x18facd,_0x1c070b,_0x47c250,_0x25946b){return function(_0xeb4cee){logger[_0x8c1b('0xd')](_0x8c1b('0x2b'));return new Promise(function(_0x14945b,_0x4cf80c){var _0x122d9d=moment();var _0x49d79c={'method':_0x8c1b('0x25'),'uri':_0x1c070b+_0x8c1b('0x2c'),'body':{'title':intUtil[_0x8c1b('0x2d')](_0x47c250[_0x8c1b('0x2e')],_0x25946b,'\x20'),'description':intUtil['getString'](_0x47c250[_0x8c1b('0x2f')],_0x25946b,'\x0a'),'owner_id':_0xeb4cee['userId'],'creater_id':_0xeb4cee['adminId'],'targetable_id':_0xeb4cee[_0x8c1b('0x22')],'targetable_type':'Contact','created_at':_0x122d9d[_0x8c1b('0x1e')](_0x8c1b('0x27')),'due_date':_0x122d9d[_0x8c1b('0x30')](0x1e,'m')[_0x8c1b('0x1e')]('YYYY-MM-DDTHH:mm:ss')},'json':!![]};_0x49d79c[_0x8c1b('0x28')]=_0x18facd;return rp(_0x49d79c)[_0x8c1b('0x9')](function(_0x341af4){_0xeb4cee['ticketId']=_0x341af4[_0x8c1b('0x31')]['id'];logger[_0x8c1b('0xd')](_0x8c1b('0x32'),_0xeb4cee['ticketId']);_0x14945b(_0xeb4cee);})['catch'](function(_0x11a463){logger['error']('['+[_0x3a057f[_0x8c1b('0x10')]()]+']',_0x11a463['message']);_0x4cf80c(_0x11a463['message']);});});};}function emit(_0x35a6c4,_0x2db531,_0x2573ab){var _0x479ef6={'uri':_0x35a6c4+'/contacts/'+_0x2573ab};io['to'](util[_0x8c1b('0x1e')](_0x8c1b('0x33'),_0x2db531))[_0x8c1b('0x34')](_0x8c1b('0x35'),_0x479ef6);}exports['cs']=function(_0x3a9e31,_0x230180,_0x407d84,_0x5c6d08,_0x44c7f5,_0x49d161,_0x19081f,_0x5c2478){var _0x5d7d24={};var _0x1b62fa={'Authorization':_0x8c1b('0x36')+_0x49d161[_0x8c1b('0x37')]};_0x49d161['remoteUri']=intUtil[_0x8c1b('0x38')](_0x49d161[_0x8c1b('0x39')]);_0x49d161[_0x8c1b('0x3a')]=intUtil[_0x8c1b('0x38')](_0x49d161[_0x8c1b('0x3a')]);var _0x4dedd4=_0x49d161[_0x8c1b('0x39')];_0x5d7d24[_0x8c1b('0xb')]=_0x49d161[_0x8c1b('0x3b')];_0x5d7d24[_0x8c1b('0x20')]=_0x5c2478[_0x8c1b('0x3c')]()==='outbound'?_0x230180[_0x8c1b('0x3d')]:_0x230180['calleridnum'];_0x5d7d24['callDirection']=_0x5c2478==='queue'||_0x5c2478===_0x8c1b('0x3e')?_0x8c1b('0x3f'):_0x8c1b('0x40');if(_0x5c6d08){_0x5d7d24[_0x8c1b('0x14')]=_0x5c6d08[_0x8c1b('0x16')];}var _0x3ec420=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x49d161['serverUrl'],_0x230180[_0x8c1b('0x41')],md5(_0x230180['uniqueid']));if(_0x44c7f5&&_0x44c7f5[_0x8c1b('0x42')]){logger[_0x8c1b('0xd')](_0x8c1b('0x43'),_0x8c1b('0x44'));_0x230180[_0x8c1b('0x45')]=_0x3ec420;}else if(_0x19081f&&_0x19081f[_0x8c1b('0x46')]&&_0x19081f[_0x8c1b('0x46')]!==_0x8c1b('0x47')){logger[_0x8c1b('0xd')](_0x8c1b('0x48'),_0x8c1b('0x44'));_0x230180[_0x8c1b('0x45')]=_0x3ec420;}else{_0x230180[_0x8c1b('0x45')]='';}return getAdminId(_0x5d7d24,_0x5c2478,_0x1b62fa,_0x4dedd4)[_0x8c1b('0x9')](getUser(_0x5c2478,_0x1b62fa,_0x4dedd4))[_0x8c1b('0x9')](getEndUser(_0x5c2478,_0x1b62fa,_0x4dedd4))[_0x8c1b('0x9')](getTicket(_0x5c2478,_0x1b62fa,_0x4dedd4,_0x407d84,_0x230180))[_0x8c1b('0x9')](function(_0x2c4233){logger[_0x8c1b('0xd')](util[_0x8c1b('0x1e')](_0x8c1b('0x49'),_0x2c4233['ticketId']));if(_0x5c2478!==_0x8c1b('0x3e')){logger['info']('['+[_0x5c2478[_0x8c1b('0x10')]()]+']','Displaying\x20task\x20in\x20a\x20new\x20tab...');emit(_0x4dedd4,_0x5c6d08[_0x8c1b('0x4a')],_0x2c4233[_0x8c1b('0x22')]);}})[_0x8c1b('0x1d')](function(_0x24d054){logger[_0x8c1b('0x1a')]('['+[_0x5c2478['toUpperCase']()]+_0x8c1b('0x4b'),util[_0x8c1b('0x4c')](_0x24d054,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/index.js b/server/services/ami/trigger/integration/index.js index 5815af5..d61824a 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 _0xef99=['servicenow','dynamics365','../../../../config/logger','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','data3','%s\x20account\x20#%s\x20not\x20found','lodash','util','./zendesk','./salesforce','./sugarcrm','./freshdesk','./desk','./vtiger','./servicenow','./dynamics365','./freshsales','zendesk','salesforce','sugarcrm','freshdesk','zoho','desk','vtiger','freshsales','exec','includes','data1','toLowerCase','Configurations','queue','routeId','outbound','log','EVENT\x20UNKNOWN'];(function(_0x5d8bb5,_0x352fe0){var _0xc99ea0=function(_0x430436){while(--_0x430436){_0x5d8bb5['push'](_0x5d8bb5['shift']());}};_0xc99ea0(++_0x352fe0);}(_0xef99,0xc7));var _0x9ef9=function(_0x5834c0,_0x2ef58f){_0x5834c0=_0x5834c0-0x0;var _0x1ee7e0=_0xef99[_0x5834c0];return _0x1ee7e0;};'use strict';var _=require(_0x9ef9('0x0'));var util=require(_0x9ef9('0x1'));var zendesk=require(_0x9ef9('0x2'));var salesforce=require(_0x9ef9('0x3'));var sugarcrm=require(_0x9ef9('0x4'));var freshdesk=require(_0x9ef9('0x5'));var zoho=require('./zoho');var desk=require(_0x9ef9('0x6'));var vtiger=require(_0x9ef9('0x7'));var servicenow=require(_0x9ef9('0x8'));var dynamics365=require(_0x9ef9('0x9'));var freshsales=require(_0x9ef9('0xa'));var integrations=[_0x9ef9('0xb'),_0x9ef9('0xc'),_0x9ef9('0xd'),_0x9ef9('0xe'),_0x9ef9('0xf'),_0x9ef9('0x10'),_0x9ef9('0x11'),'dynamics365',_0x9ef9('0x12'),'servicenow'];exports[_0x9ef9('0x13')]=function(_0xd178b6,_0x3824c6,_0x3f2b9f,_0xea9398,_0x320649,_0x4f874f){if(_0x3f2b9f){if(_[_0x9ef9('0x14')](integrations,_0xd178b6[_0x9ef9('0x15')][_0x9ef9('0x16')]())){try{var _0x2e71ca=null;var _0x2c27c7='';var _0x486d26=_0x3f2b9f[_0xd178b6['data1'][_0x9ef9('0x16')]()];if(_0x486d26){var _0x17ddf1=_0x486d26[_0xd178b6['data2']];if(_0x17ddf1){var _0x22af24=_['find'](_0x17ddf1[_0x9ef9('0x17')],{'id':parseInt(_0xd178b6['data3'],0xa)});if(_0x22af24){if(_0xea9398){if(_0x320649&&_0x3824c6[_0x9ef9('0x18')]){_0x2c27c7=_0x9ef9('0x18');}else if(_0x3824c6[_0x9ef9('0x19')]){_0x2c27c7=_0x9ef9('0x1a');}else{console[_0x9ef9('0x1b')](_0x9ef9('0x1c'),_0x3824c6);}}else{_0x2c27c7='unmanaged';}switch(_0xd178b6['data1']['toLowerCase']()){case'zendesk':zendesk[_0x2c27c7](_0xd178b6,_0x3824c6,_0x22af24,_0xea9398,_0x320649,_0x17ddf1,_0x4f874f);break;case _0x9ef9('0xc'):salesforce[_0x2c27c7](_0xd178b6,_0x3824c6,_0x22af24,_0xea9398,_0x320649,_0x17ddf1,_0x4f874f);break;case _0x9ef9('0xd'):sugarcrm[_0x2c27c7](_0xd178b6,_0x3824c6,_0x22af24,_0xea9398,_0x320649,_0x17ddf1,_0x4f874f);break;case _0x9ef9('0xe'):freshdesk[_0x2c27c7](_0xd178b6,_0x3824c6,_0x22af24,_0xea9398,_0x320649,_0x17ddf1,_0x4f874f);break;case'zoho':zoho[_0x2c27c7](_0xd178b6,_0x3824c6,_0x22af24,_0xea9398,_0x320649,_0x17ddf1,_0x4f874f);break;case _0x9ef9('0x10'):desk[_0x2c27c7](_0xd178b6,_0x3824c6,_0x22af24,_0xea9398,_0x320649,_0x17ddf1,_0x4f874f);break;case _0x9ef9('0x11'):vtiger[_0x2c27c7](_0xd178b6,_0x3824c6,_0x22af24,_0xea9398,_0x320649,_0x17ddf1,_0x4f874f);break;case _0x9ef9('0x12'):freshsales['cs'](_0xd178b6,_0x3824c6,_0x22af24,_0xea9398,_0x320649,_0x17ddf1,_0x4f874f,_0x2c27c7);break;case _0x9ef9('0x1d'):servicenow['cs'](_0xd178b6,_0x3824c6,_0x22af24,_0xea9398,_0x320649,_0x17ddf1,_0x4f874f,_0x2c27c7);break;case _0x9ef9('0x1e'):dynamics365['cs'](_0xd178b6,_0x3824c6,_0x22af24,_0xea9398,_0x320649,_0x17ddf1,_0x4f874f,_0x2c27c7);break;default:console['log']('unknown\x20integration');}}else{_0x2e71ca=require(_0x9ef9('0x1f'))(_0xd178b6[_0x9ef9('0x15')]['toLowerCase']());_0x2e71ca[_0x9ef9('0x20')](_0x9ef9('0x21'),util[_0x9ef9('0x22')](_0x9ef9('0x23'),_0xd178b6[_0x9ef9('0x15')]['toLowerCase'](),_0xd178b6[_0x9ef9('0x24')]));}}else{_0x2e71ca=require(_0x9ef9('0x1f'))(_0xd178b6[_0x9ef9('0x15')][_0x9ef9('0x16')]());_0x2e71ca[_0x9ef9('0x20')]('[EXEC]',util[_0x9ef9('0x22')](_0x9ef9('0x25'),_0xd178b6['data1'][_0x9ef9('0x16')](),_0xd178b6['data2']));}}else{}}catch(_0x394725){console[_0x9ef9('0x20')](_0x394725);}}}}; \ No newline at end of file +var _0xe748=['log','EVENT\x20UNKNOWN','unmanaged','salesforce','servicenow','unknown\x20integration','../../../../config/logger','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','data3','%s\x20account\x20#%s\x20not\x20found','lodash','./zendesk','./sugarcrm','./zoho','./desk','./vtiger','./servicenow','./freshsales','zendesk','sugarcrm','freshdesk','zoho','desk','vtiger','dynamics365','freshsales','includes','data1','toLowerCase','data2','find','Configurations','queue','routeId','outbound'];(function(_0x3b5ad9,_0x223867){var _0x611ae9=function(_0x1c5e28){while(--_0x1c5e28){_0x3b5ad9['push'](_0x3b5ad9['shift']());}};_0x611ae9(++_0x223867);}(_0xe748,0xcb));var _0x8e74=function(_0x1056ad,_0x52d38f){_0x1056ad=_0x1056ad-0x0;var _0x302574=_0xe748[_0x1056ad];return _0x302574;};'use strict';var _=require(_0x8e74('0x0'));var util=require('util');var zendesk=require(_0x8e74('0x1'));var salesforce=require('./salesforce');var sugarcrm=require(_0x8e74('0x2'));var freshdesk=require('./freshdesk');var zoho=require(_0x8e74('0x3'));var desk=require(_0x8e74('0x4'));var vtiger=require(_0x8e74('0x5'));var servicenow=require(_0x8e74('0x6'));var dynamics365=require('./dynamics365');var freshsales=require(_0x8e74('0x7'));var integrations=[_0x8e74('0x8'),'salesforce',_0x8e74('0x9'),_0x8e74('0xa'),_0x8e74('0xb'),_0x8e74('0xc'),_0x8e74('0xd'),_0x8e74('0xe'),_0x8e74('0xf'),'servicenow'];exports['exec']=function(_0x594646,_0x420ee3,_0x3c585d,_0x160578,_0x14d4f2,_0x367a67){if(_0x3c585d){if(_[_0x8e74('0x10')](integrations,_0x594646[_0x8e74('0x11')][_0x8e74('0x12')]())){try{var _0x19dc65=null;var _0x58632a='';var _0x5bf1b1=_0x3c585d[_0x594646[_0x8e74('0x11')][_0x8e74('0x12')]()];if(_0x5bf1b1){var _0x5df380=_0x5bf1b1[_0x594646[_0x8e74('0x13')]];if(_0x5df380){var _0x313d7b=_[_0x8e74('0x14')](_0x5df380[_0x8e74('0x15')],{'id':parseInt(_0x594646['data3'],0xa)});if(_0x313d7b){if(_0x160578){if(_0x14d4f2&&_0x420ee3[_0x8e74('0x16')]){_0x58632a=_0x8e74('0x16');}else if(_0x420ee3[_0x8e74('0x17')]){_0x58632a=_0x8e74('0x18');}else{console[_0x8e74('0x19')](_0x8e74('0x1a'),_0x420ee3);}}else{_0x58632a=_0x8e74('0x1b');}switch(_0x594646[_0x8e74('0x11')][_0x8e74('0x12')]()){case _0x8e74('0x8'):zendesk[_0x58632a](_0x594646,_0x420ee3,_0x313d7b,_0x160578,_0x14d4f2,_0x5df380,_0x367a67);break;case _0x8e74('0x1c'):salesforce[_0x58632a](_0x594646,_0x420ee3,_0x313d7b,_0x160578,_0x14d4f2,_0x5df380,_0x367a67);break;case _0x8e74('0x9'):sugarcrm[_0x58632a](_0x594646,_0x420ee3,_0x313d7b,_0x160578,_0x14d4f2,_0x5df380,_0x367a67);break;case _0x8e74('0xa'):freshdesk[_0x58632a](_0x594646,_0x420ee3,_0x313d7b,_0x160578,_0x14d4f2,_0x5df380,_0x367a67);break;case _0x8e74('0xb'):zoho[_0x58632a](_0x594646,_0x420ee3,_0x313d7b,_0x160578,_0x14d4f2,_0x5df380,_0x367a67);break;case _0x8e74('0xc'):desk[_0x58632a](_0x594646,_0x420ee3,_0x313d7b,_0x160578,_0x14d4f2,_0x5df380,_0x367a67);break;case _0x8e74('0xd'):vtiger[_0x58632a](_0x594646,_0x420ee3,_0x313d7b,_0x160578,_0x14d4f2,_0x5df380,_0x367a67);break;case _0x8e74('0xf'):freshsales['cs'](_0x594646,_0x420ee3,_0x313d7b,_0x160578,_0x14d4f2,_0x5df380,_0x367a67,_0x58632a);break;case _0x8e74('0x1d'):servicenow['cs'](_0x594646,_0x420ee3,_0x313d7b,_0x160578,_0x14d4f2,_0x5df380,_0x367a67,_0x58632a);break;case _0x8e74('0xe'):dynamics365['cs'](_0x594646,_0x420ee3,_0x313d7b,_0x160578,_0x14d4f2,_0x5df380,_0x367a67,_0x58632a);break;default:console[_0x8e74('0x19')](_0x8e74('0x1e'));}}else{_0x19dc65=require(_0x8e74('0x1f'))(_0x594646['data1'][_0x8e74('0x12')]());_0x19dc65[_0x8e74('0x20')](_0x8e74('0x21'),util[_0x8e74('0x22')](_0x8e74('0x23'),_0x594646[_0x8e74('0x11')]['toLowerCase'](),_0x594646[_0x8e74('0x24')]));}}else{_0x19dc65=require('../../../../config/logger')(_0x594646[_0x8e74('0x11')][_0x8e74('0x12')]());_0x19dc65['error'](_0x8e74('0x21'),util[_0x8e74('0x22')](_0x8e74('0x25'),_0x594646[_0x8e74('0x11')]['toLowerCase'](),_0x594646[_0x8e74('0x13')]));}}else{}}catch(_0x49a1ec){console[_0x8e74('0x20')](_0x49a1ec);}}}}; \ 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 beeb0fe..b2cc024 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 _0x74b1=['catch','unmanaged','toUpperCase','isNil','lastevent',']\x20Ticket\x20%s\x20created.','lodash','request-promise','moment','md5','jsforce','util','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','assign','Subjects','Descriptions','Task','ActivityDate','utc','IsReminderSet','IsRecurrence','endUserType','contact','WhoId','WhatId','Case','ContactId','account','lead','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','validateEmail','User','find','execute','then','length','Email','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','user_id','display_name','identity','moduleSearch','cloneDeep','additionalSearchContact','merge','Contact','$or','Lead','additionalSearchAccount','additionalSearchLead','Account','first','Phone','attributes','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','format','Caller\x20-\x20%s','Company','No\x20Company','includes','string','picklist','type','idField','content','toString','variableName','customVariable','Variable','name','password','concat','securityToken','remoteUri','https://login.salesforce.com','clientId','clientSecret','login','username','Connection\x20established.','queue','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','email','calleridname','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','trigger:salesforce:display','newTab','user:%s','%s/%s/e','instanceUrl','error','[QUEUE]','recordingFormat','none','[OUTBOUND]','uniqueid','Fields','outbound','[OUTBOUND]\x20Ticket\x20%s\x20created.','trigger:browser:url','Salesforce\x20account\x20type\x20not\x20recognized'];(function(_0x302c55,_0x1ff3d9){var _0x2a4849=function(_0x16e449){while(--_0x16e449){_0x302c55['push'](_0x302c55['shift']());}};_0x2a4849(++_0x1ff3d9);}(_0x74b1,0x104));var _0x174b=function(_0x272d90,_0x5e70ff){_0x272d90=_0x272d90-0x0;var _0x2bf4a2=_0x74b1[_0x272d90];return _0x2bf4a2;};'use strict';var _=require(_0x174b('0x0'));var rp=require(_0x174b('0x1'));var moment=require(_0x174b('0x2'));var BPromise=require('bluebird');var md5=require(_0x174b('0x3'));var jsforce=require(_0x174b('0x4'));var util=require(_0x174b('0x5'));var Redis=require(_0x174b('0x6'));var intUtil=require(_0x174b('0x7'));var config=require(_0x174b('0x8'));var logger=require(_0x174b('0x9'))('salesforce');config[_0x174b('0xa')]=_[_0x174b('0xb')](config[_0x174b('0xa')],{'host':_0x174b('0xc'),'port':0x18eb});var io=require(_0x174b('0xd'))(new Redis(config[_0x174b('0xa')]));function emit(_0x5af751,_0x11ac50,_0xe946f){io['to'](_0x5af751)['emit'](_0x11ac50,_0xe946f);}function getTicket(_0x27bf59,_0x1a8202,_0x33b845,_0x543907,_0x3bb1ce,_0x4c4ad9,_0x6a977b,_0xeec95d){var _0x5456ff=Object[_0x174b('0xe')]({},{'OwnerId':_0x1a8202['id'],'Subject':intUtil['getString'](_0x543907[_0x174b('0xf')],_0x3bb1ce,'\x20'),'Description':intUtil['getString'](_0x543907[_0x174b('0x10')],_0x3bb1ce,'\x0a')},getCustomFields(_0x4c4ad9,_0x3bb1ce));if(_0x33b845){if(_0x543907['ticketType']===_0x174b('0x11')){_0x5456ff[_0x174b('0x12')]=moment[_0x174b('0x13')]();_0x5456ff[_0x174b('0x14')]=![];_0x5456ff[_0x174b('0x15')]=![];if(_0x33b845[_0x174b('0x16')]===_0x174b('0x17')||_0x33b845[_0x174b('0x16')]==='lead'){_0x5456ff[_0x174b('0x18')]=_0x33b845['id'];}else if(_0x33b845['endUserType']==='account'){_0x5456ff[_0x174b('0x19')]=_0x33b845['id'];}}else if(_0x543907['ticketType']===_0x174b('0x1a')){if(_0x33b845[_0x174b('0x16')]===_0x174b('0x17')){_0x5456ff[_0x174b('0x1b')]=_0x33b845['id'];}else if(_0x33b845[_0x174b('0x16')]===_0x174b('0x1c')){_0x5456ff['AccountId']=_0x33b845['id'];}else if(_0x33b845[_0x174b('0x16')]===_0x174b('0x1d')&&_0x543907[_0x174b('0x1e')]){_0x5456ff[_0x543907[_0x174b('0x1e')]]=_0x33b845['id'];}else{logger[_0x174b('0x1f')](_0x174b('0x20'));}}}return _0x6a977b[_0x174b('0x21')](_0x543907['ticketType'])[_0x174b('0x22')](_0x5456ff);}function getUser(_0x4c25de,_0x4407d2,_0x2ba9d7){if(!_['isNil'](_0x4407d2)&&intUtil[_0x174b('0x23')](_0x4407d2)){var _0x412667={'Email':_0x4407d2};var _0x34d63d={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x2ba9d7[_0x174b('0x21')](_0x174b('0x24'))[_0x174b('0x25')](_0x412667,_0x34d63d)[_0x174b('0x26')]()[_0x174b('0x27')](function(_0x13617a){if(_0x13617a[_0x174b('0x28')]){var _0x2c812c=_['find'](_0x13617a,function(_0xbfeb3){return _0xbfeb3[_0x174b('0x29')]===_0x4407d2;});if(_0x2c812c){logger[_0x174b('0x1f')]('Agent\x20%s\x20found.',_0x4407d2);return BPromise[_0x174b('0x2a')]({'id':_0x2c812c['Id'],'name':_0x2c812c[_0x174b('0x2b')]});}}else{logger[_0x174b('0x1f')](_0x174b('0x2c'),_0x4407d2);return _0x2ba9d7['identity']()[_0x174b('0x27')](function(_0x189578){return BPromise[_0x174b('0x2a')]({'id':_0x189578[_0x174b('0x2d')],'name':_0x189578[_0x174b('0x2e')]});});}});}else{logger['info'](_0x174b('0x2c'),_0x4407d2);return _0x2ba9d7[_0x174b('0x2f')]()[_0x174b('0x27')](function(_0x4b616c){return BPromise['resolve']({'id':_0x4b616c[_0x174b('0x2d')],'name':_0x4b616c['display_name']});});}}function getEndUser(_0x354473,_0x14b0bd,_0x27b8b2,_0x5c6bf7,_0x399165){var _0x2f757e={'$or':{'Phone':_0x5c6bf7}};var _0x100914={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x174b('0x2a')]()[_0x174b('0x27')](function(){logger['info']('Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.',_0x5c6bf7,_0x14b0bd[_0x174b('0x30')]);switch(_0x14b0bd[_0x174b('0x30')]){case'contact_lead':var _0x18b38a=_[_0x174b('0x31')](_0x2f757e);if(_0x14b0bd[_0x174b('0x32')]){var _0xabf86={};_0xabf86[_0x14b0bd[_0x174b('0x32')]]=_0x5c6bf7;_[_0x174b('0x33')](_0x18b38a['$or'],_0xabf86);}return _0x399165[_0x174b('0x21')](_0x174b('0x34'))[_0x174b('0x25')](_0x18b38a,_0x100914)[_0x174b('0x26')]()[_0x174b('0x27')](function(_0x194ff7){if(_0x194ff7&&_0x194ff7[_0x174b('0x28')]){return _0x194ff7;}else{var _0x377c8b=_[_0x174b('0x31')](_0x2f757e);if(_0x14b0bd['additionalSearchLead']){var _0x5e6ac8={};_0x5e6ac8[_0x14b0bd['additionalSearchLead']]=_0x5c6bf7;_[_0x174b('0x33')](_0x377c8b[_0x174b('0x35')],_0x5e6ac8);}return _0x399165[_0x174b('0x21')](_0x174b('0x36'))['find'](_0x377c8b,_0x100914);}});case'account_contact_lead':var _0x284514=_['cloneDeep'](_0x2f757e);if(_0x14b0bd[_0x174b('0x37')]){var _0xabf86={};_0xabf86[_0x14b0bd['additionalSearchAccount']]=_0x5c6bf7;_[_0x174b('0x33')](_0x284514[_0x174b('0x35')],_0xabf86);}return _0x399165[_0x174b('0x21')]('Account')['find'](_0x284514,_0x100914)[_0x174b('0x26')]()[_0x174b('0x27')](function(_0x358cd4){if(_0x358cd4&&_0x358cd4[_0x174b('0x28')]){return _0x358cd4;}else{var _0x368554=_['cloneDeep'](_0x2f757e);if(_0x14b0bd['additionalSearchContact']){var _0x497a43={};_0x497a43[_0x14b0bd[_0x174b('0x32')]]=_0x5c6bf7;_[_0x174b('0x33')](_0x368554[_0x174b('0x35')],_0x497a43);}return _0x399165[_0x174b('0x21')](_0x174b('0x34'))['find'](_0x368554,_0x100914)[_0x174b('0x27')](function(_0x33d7b9){if(_0x33d7b9&&_0x33d7b9[_0x174b('0x28')]){return _0x33d7b9;}else{var _0x24c843=_[_0x174b('0x31')](_0x2f757e);if(_0x14b0bd[_0x174b('0x38')]){var _0x20cb58={};_0x20cb58[_0x14b0bd[_0x174b('0x38')]]=_0x5c6bf7;_['merge'](_0x24c843['$or'],_0x20cb58);}return _0x399165[_0x174b('0x21')](_0x174b('0x36'))[_0x174b('0x25')](_0x24c843,_0x100914);}});}});case _0x174b('0x17'):var _0x18b38a=_[_0x174b('0x31')](_0x2f757e);if(_0x14b0bd[_0x174b('0x32')]){var _0xabf86={};_0xabf86[_0x14b0bd[_0x174b('0x32')]]=_0x5c6bf7;_[_0x174b('0x33')](_0x18b38a['$or'],_0xabf86);}return _0x399165[_0x174b('0x21')]('Contact')[_0x174b('0x25')](_0x18b38a,_0x100914)[_0x174b('0x26')]();case _0x174b('0x1d'):var _0x5b632c=_[_0x174b('0x31')](_0x2f757e);if(_0x14b0bd[_0x174b('0x38')]){var _0xabf86={};_0xabf86[_0x14b0bd['additionalSearchLead']]=_0x5c6bf7;_['merge'](_0x5b632c[_0x174b('0x35')],_0xabf86);}return _0x399165[_0x174b('0x21')](_0x174b('0x36'))['find'](_0x5b632c,_0x100914);case'account':var _0x284514=_[_0x174b('0x31')](_0x2f757e);if(_0x14b0bd[_0x174b('0x37')]){var _0xabf86={};_0xabf86[_0x14b0bd[_0x174b('0x37')]]=_0x5c6bf7;_['merge'](_0x284514['$or'],_0xabf86);}return _0x399165[_0x174b('0x21')](_0x174b('0x39'))[_0x174b('0x25')](_0x284514,_0x100914);default:return null;}})[_0x174b('0x27')](function(_0x14f2e2){if(_0x14f2e2&&_0x14f2e2[_0x174b('0x28')]){var _0x34dc91=_[_0x174b('0x3a')](_0x14f2e2);if(_0x34dc91){return BPromise[_0x174b('0x2a')]({'id':_0x34dc91['Id'],'name':_0x34dc91['Name'],'phone':_0x34dc91[_0x174b('0x3b')],'endUserType':_0x34dc91[_0x174b('0x3c')]['type'][_0x174b('0x3d')]()});}}})[_0x174b('0x27')](function(_0x3b0e76){if(_0x3b0e76){logger[_0x174b('0x1f')](_0x174b('0x3e'),_0x3b0e76[_0x174b('0x16')],_0x5c6bf7);return BPromise[_0x174b('0x2a')](_0x3b0e76);}else{logger[_0x174b('0x1f')](_0x174b('0x3f'),_0x5c6bf7);var _0x411b25={'Phone':_0x5c6bf7};if(_0x14b0bd[_0x174b('0x40')]){if(_0x14b0bd[_0x174b('0x40')]===_0x174b('0x17')){logger[_0x174b('0x1f')](_0x174b('0x41'),_0x5c6bf7,_0x14b0bd[_0x174b('0x40')]);_0x411b25[_0x174b('0x42')]=_0x27b8b2!==_0x174b('0x43')?_0x27b8b2:util[_0x174b('0x44')](_0x174b('0x45'),_0x5c6bf7);}else if(_0x14b0bd[_0x174b('0x40')]===_0x174b('0x1d')){logger['info'](_0x174b('0x41'),_0x5c6bf7,_0x14b0bd[_0x174b('0x40')]);_0x411b25[_0x174b('0x42')]=_0x27b8b2!==''?_0x27b8b2:util[_0x174b('0x44')](_0x174b('0x45'),_0x5c6bf7);_0x411b25[_0x174b('0x46')]=_0x174b('0x47');}else if(_0x14b0bd[_0x174b('0x40')]==='account'){logger[_0x174b('0x1f')](_0x174b('0x41'),_0x5c6bf7,_0x14b0bd[_0x174b('0x40')]);_0x411b25[_0x174b('0x2b')]=_0x27b8b2!==''?_0x27b8b2:util[_0x174b('0x44')]('Caller\x20-\x20%s',_0x5c6bf7);}else{return null;}}return _0x399165[_0x174b('0x21')](_['upperFirst'](_0x14b0bd[_0x174b('0x40')]))[_0x174b('0x22')](_0x411b25)['then'](function(_0x135b20){return BPromise[_0x174b('0x2a')]({'id':_0x135b20['id'],'endUserType':_0x14b0bd[_0x174b('0x40')]});});}});}function getCustomFields(_0x18450d,_0x18c1dd){var _0x203a47={};if(_0x18450d[_0x174b('0x28')]>0x0){_['forEach'](_0x18450d,function(_0xfaa277){if(_[_0x174b('0x48')]([_0x174b('0x49'),_0x174b('0x4a')],_0xfaa277[_0x174b('0x4b')])&&_0xfaa277[_0x174b('0x4c')]){_0x203a47[_0xfaa277[_0x174b('0x4c')]]=_0xfaa277[_0x174b('0x4d')][_0x174b('0x4e')]();}else if(_0xfaa277[_0x174b('0x4b')]==='variable'&&_0xfaa277[_0x174b('0x4f')]&&_0xfaa277[_0x174b('0x4c')]){_0x18c1dd[_0xfaa277['variableName']]&&(_0x203a47[_0xfaa277[_0x174b('0x4c')]]=_0x18c1dd[_0xfaa277[_0x174b('0x4f')]][_0x174b('0x4e')]());}else if(_0xfaa277['type']===_0x174b('0x50')&&_0xfaa277[_0x174b('0x51')]&&_0xfaa277[_0x174b('0x51')][_0x174b('0x52')]&&_0xfaa277['idField']){_0x18c1dd[_0xfaa277['Variable']['name'][_0x174b('0x3d')]()]&&(_0x203a47[_0xfaa277[_0x174b('0x4c')]]=_0x18c1dd[_0xfaa277['Variable'][_0x174b('0x52')][_0x174b('0x3d')]()]['toString']());}});}return _0x203a47;}function getConnection(_0x4973c2){var _0x150f3c=_0x4973c2[_0x174b('0x53')][_0x174b('0x54')](_0x4973c2[_0x174b('0x55')]);var _0x47dcfc=new jsforce['Connection']({'oauth2':{'loginUrl':_0x4973c2[_0x174b('0x56')]||_0x174b('0x57'),'clientId':_0x4973c2[_0x174b('0x58')],'clientSecret':_0x4973c2[_0x174b('0x59')]}});return _0x47dcfc[_0x174b('0x5a')](_0x4973c2[_0x174b('0x5b')],_0x150f3c)[_0x174b('0x27')](function(){logger[_0x174b('0x1f')](_0x174b('0x5c'));return _0x47dcfc;});}exports[_0x174b('0x5d')]=function(_0x1b8bec,_0x16879d,_0xc43f19,_0x11c3f5,_0x50c1e6,_0x198285){var _0x3301b8,_0x4f94df,_0x144135,_0x32dbc1;_0x198285['serverUrl']=intUtil[_0x174b('0x5e')](_0x198285[_0x174b('0x5f')]);_0x198285[_0x174b('0x56')]=intUtil[_0x174b('0x5e')](_0x198285['remoteUri']);if(_0x50c1e6&&_0x50c1e6[_0x174b('0x60')]){logger['info']('[QUEUE]',_0x174b('0x61'));_0x16879d[_0x174b('0x62')]=util['format'](_0x174b('0x63'),_0x198285['serverUrl'],_0x16879d['uniqueid'],md5(_0x16879d['uniqueid']));}else{_0x16879d[_0x174b('0x62')]='';}return getConnection(_0x198285)[_0x174b('0x27')](function(_0x4be2aa){_0x32dbc1=_0x4be2aa;return getUser(_0x198285,_0x11c3f5[_0x174b('0x64')],_0x32dbc1);})[_0x174b('0x27')](function(_0x3852d0){_0x3301b8=_0x3852d0;return getEndUser(_0x198285,_0xc43f19,_0x16879d[_0x174b('0x65')],_0x16879d['calleridnum'],_0x32dbc1);})[_0x174b('0x27')](function(_0xff33aa){_0x4f94df=_0xff33aa;return getTicket(_0x198285,_0x3301b8,_0x4f94df,_0xc43f19,_0x16879d,_0xc43f19['Fields'],_0x32dbc1,_0x174b('0x5d'));})[_0x174b('0x27')](function(_0x5363d5){_0x144135=_0x5363d5;logger[_0x174b('0x1f')](_0x174b('0x66'),_0x144135['id']);logger[_0x174b('0x1f')](_0x174b('0x67'),_0x144135['id'],_0x11c3f5[_0x174b('0x52')],_0x198285['type']);switch(_0x198285[_0x174b('0x4b')]){case _0x174b('0x68'):emit(util[_0x174b('0x44')]('user:%s',_0x11c3f5[_0x174b('0x52')]),_0x174b('0x69'),{'recordId':_0x144135['id']});break;case _0x174b('0x6a'):emit(util[_0x174b('0x44')](_0x174b('0x6b'),_0x11c3f5['name']),'trigger:browser:url',{'uri':util['format'](_0x174b('0x6c'),_0x32dbc1[_0x174b('0x6d')],_0x144135['id'])});break;default:logger[_0x174b('0x6e')]('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})['catch'](function(_0x36f2d0){logger[_0x174b('0x6e')](_0x174b('0x6f'),_0x36f2d0);});};exports['outbound']=function(_0x28a526,_0x214c5b,_0x5b4e03,_0x2a2448,_0x368d7a,_0x18d299,_0x189661){var _0x55070d,_0x21c317,_0x236ff5,_0x10034a;_0x18d299[_0x174b('0x5f')]=intUtil[_0x174b('0x5e')](_0x18d299['serverUrl']);_0x18d299[_0x174b('0x56')]=intUtil[_0x174b('0x5e')](_0x18d299[_0x174b('0x56')]);if(_0x189661&&_0x189661[_0x174b('0x70')]&&_0x189661[_0x174b('0x70')]!==_0x174b('0x71')){logger[_0x174b('0x1f')](_0x174b('0x72'),_0x174b('0x61'));_0x214c5b[_0x174b('0x62')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x18d299[_0x174b('0x5f')],_0x214c5b[_0x174b('0x73')],md5(_0x214c5b['uniqueid']));}return getConnection(_0x18d299)['then'](function(_0x593428){_0x10034a=_0x593428;return getUser(_0x18d299,_0x2a2448[_0x174b('0x64')],_0x10034a);})[_0x174b('0x27')](function(_0x5ec149){_0x55070d=_0x5ec149;return getEndUser(_0x18d299,_0x5b4e03,_0x214c5b['destcalleridname'],_0x214c5b['destcalleridnum'],_0x10034a);})[_0x174b('0x27')](function(_0x2e45c3){_0x21c317=_0x2e45c3;return getTicket(_0x18d299,_0x55070d,_0x21c317,_0x5b4e03,_0x214c5b,_0x5b4e03[_0x174b('0x74')],_0x10034a,_0x174b('0x75'));})[_0x174b('0x27')](function(_0x4eef06){_0x236ff5=_0x4eef06;logger[_0x174b('0x1f')](_0x174b('0x76'),_0x236ff5['id']);logger[_0x174b('0x1f')]('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x236ff5['id'],_0x2a2448[_0x174b('0x52')],_0x18d299['type']);switch(_0x18d299['type']){case'integrationTab':emit(util[_0x174b('0x44')](_0x174b('0x6b'),_0x2a2448[_0x174b('0x52')]),_0x174b('0x69'),{'recordId':_0x236ff5['id']});break;case'newTab':emit(util[_0x174b('0x44')](_0x174b('0x6b'),_0x2a2448['name']),_0x174b('0x77'),{'uri':util['format'](_0x174b('0x6c'),_0x10034a[_0x174b('0x6d')],_0x236ff5['id'])});break;default:logger[_0x174b('0x6e')]('[OUTBOUND]',_0x174b('0x78'));}})[_0x174b('0x79')](function(_0x4fc6b7){logger[_0x174b('0x6e')](_0x174b('0x72'),_0x4fc6b7);});};exports[_0x174b('0x7a')]=function(_0x27fea5,_0x3fdb27,_0x1f5cd4,_0x4f4f20,_0x4980d9,_0x38e886){var _0x354354,_0x5243b1,_0x9fdfa9,_0x51b9dd;_0x38e886[_0x174b('0x5f')]=intUtil[_0x174b('0x5e')](_0x38e886[_0x174b('0x5f')]);_0x38e886[_0x174b('0x56')]=intUtil['stripTrailingSlash'](_0x38e886[_0x174b('0x56')]);if(_0x4980d9&&_0x4980d9['monitor_format']){logger['info']('['+_0x3fdb27['lastevent'][_0x174b('0x7b')]()+']',_0x174b('0x61'));_0x3fdb27[_0x174b('0x62')]=util[_0x174b('0x44')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x38e886[_0x174b('0x5f')],_0x3fdb27['uniqueid'],md5(_0x3fdb27[_0x174b('0x73')]));}else{_0x3fdb27[_0x174b('0x62')]='';}return getConnection(_0x38e886)[_0x174b('0x27')](function(_0x4030a1){_0x51b9dd=_0x4030a1;if(!_[_0x174b('0x7c')](_0x4f4f20)){return getUser(_0x38e886,_0x4f4f20[_0x174b('0x52')],_0x51b9dd);}else{return getUser(_0x38e886,null,_0x51b9dd);}})[_0x174b('0x27')](function(_0x5aa542){_0x354354=_0x5aa542;return getEndUser(_0x38e886,_0x1f5cd4,_0x3fdb27[_0x174b('0x65')],_0x3fdb27['calleridnum'],_0x51b9dd);})[_0x174b('0x27')](function(_0x4e07a8){_0x5243b1=_0x4e07a8;return getTicket(_0x38e886,_0x354354,_0x5243b1,_0x1f5cd4,_0x3fdb27,_0x1f5cd4[_0x174b('0x74')],_0x51b9dd);})['then'](function(_0x57c47a){_0x9fdfa9=_0x57c47a;logger[_0x174b('0x1f')]('['+_0x3fdb27[_0x174b('0x7d')][_0x174b('0x7b')]()+_0x174b('0x7e'),_0x9fdfa9['id']);logger[_0x174b('0x1f')]('['+_0x3fdb27['lastevent'][_0x174b('0x7b')]()+']\x20Integration\x20account\x20type\x20%s.',_0x38e886[_0x174b('0x4b')]);})[_0x174b('0x79')](function(_0x3e36bd){logger[_0x174b('0x6e')]('['+_0x3fdb27[_0x174b('0x7d')][_0x174b('0x7b')]()+']',_0x3e36bd);});}; \ No newline at end of file +var _0x1ff8=['./util','../../../../config/logger','salesforce','redis','defaults','localhost','socket.io-emitter','emit','assign','getString','Descriptions','ticketType','ActivityDate','IsRecurrence','endUserType','contact','lead','WhoId','account','Case','ContactId','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','isNil','validateEmail','User','find','execute','length','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','then','user_id','display_name','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','$or','Contact','additionalSearchLead','Lead','additionalSearchAccount','first','Phone','attributes','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','format','Caller\x20-\x20%s','No\x20Company','upperFirst','forEach','includes','string','picklist','idField','content','toString','variableName','Variable','name','password','concat','securityToken','Connection','remoteUri','https://login.salesforce.com','clientId','login','username','Connection\x20established.','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','recordingFormat','none','[OUTBOUND]','recordingURL','destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','newTab','unmanaged','lastevent',']\x20Ticket\x20%s\x20created.','toUpperCase',']\x20Integration\x20account\x20type\x20%s.','request-promise','moment','bluebird','md5'];(function(_0x1aa28e,_0xf2300f){var _0x125078=function(_0x59833a){while(--_0x59833a){_0x1aa28e['push'](_0x1aa28e['shift']());}};_0x125078(++_0xf2300f);}(_0x1ff8,0x1f4));var _0x81ff=function(_0x519380,_0x7f196){_0x519380=_0x519380-0x0;var _0x60ba2c=_0x1ff8[_0x519380];return _0x60ba2c;};'use strict';var _=require('lodash');var rp=require(_0x81ff('0x0'));var moment=require(_0x81ff('0x1'));var BPromise=require(_0x81ff('0x2'));var md5=require(_0x81ff('0x3'));var jsforce=require('jsforce');var util=require('util');var Redis=require('ioredis');var intUtil=require(_0x81ff('0x4'));var config=require('../../../../config/environment');var logger=require(_0x81ff('0x5'))(_0x81ff('0x6'));config[_0x81ff('0x7')]=_[_0x81ff('0x8')](config[_0x81ff('0x7')],{'host':_0x81ff('0x9'),'port':0x18eb});var io=require(_0x81ff('0xa'))(new Redis(config[_0x81ff('0x7')]));function emit(_0x49382e,_0x39ebe8,_0x46a76d){io['to'](_0x49382e)[_0x81ff('0xb')](_0x39ebe8,_0x46a76d);}function getTicket(_0x2c0407,_0x4c646d,_0x4196f0,_0x175ff2,_0x28eb04,_0x5537bd,_0x7f2776,_0x5c4206){var _0x1e6164=Object[_0x81ff('0xc')]({},{'OwnerId':_0x4c646d['id'],'Subject':intUtil[_0x81ff('0xd')](_0x175ff2['Subjects'],_0x28eb04,'\x20'),'Description':intUtil[_0x81ff('0xd')](_0x175ff2[_0x81ff('0xe')],_0x28eb04,'\x0a')},getCustomFields(_0x5537bd,_0x28eb04));if(_0x4196f0){if(_0x175ff2[_0x81ff('0xf')]==='Task'){_0x1e6164[_0x81ff('0x10')]=moment['utc']();_0x1e6164['IsReminderSet']=![];_0x1e6164[_0x81ff('0x11')]=![];if(_0x4196f0[_0x81ff('0x12')]===_0x81ff('0x13')||_0x4196f0[_0x81ff('0x12')]===_0x81ff('0x14')){_0x1e6164[_0x81ff('0x15')]=_0x4196f0['id'];}else if(_0x4196f0['endUserType']===_0x81ff('0x16')){_0x1e6164['WhatId']=_0x4196f0['id'];}}else if(_0x175ff2['ticketType']===_0x81ff('0x17')){if(_0x4196f0[_0x81ff('0x12')]==='contact'){_0x1e6164[_0x81ff('0x18')]=_0x4196f0['id'];}else if(_0x4196f0[_0x81ff('0x12')]===_0x81ff('0x16')){_0x1e6164[_0x81ff('0x19')]=_0x4196f0['id'];}else if(_0x4196f0[_0x81ff('0x12')]===_0x81ff('0x14')&&_0x175ff2['leadId']){_0x1e6164[_0x175ff2[_0x81ff('0x1a')]]=_0x4196f0['id'];}else{logger[_0x81ff('0x1b')](_0x81ff('0x1c'));}}}return _0x7f2776[_0x81ff('0x1d')](_0x175ff2['ticketType'])[_0x81ff('0x1e')](_0x1e6164);}function getUser(_0x1f25b5,_0x2a3b39,_0x283489){if(!_[_0x81ff('0x1f')](_0x2a3b39)&&intUtil[_0x81ff('0x20')](_0x2a3b39)){var _0x2617f0={'Email':_0x2a3b39};var _0x57b696={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x283489[_0x81ff('0x1d')](_0x81ff('0x21'))[_0x81ff('0x22')](_0x2617f0,_0x57b696)[_0x81ff('0x23')]()['then'](function(_0xdcd3b5){if(_0xdcd3b5[_0x81ff('0x24')]){var _0x32bc63=_[_0x81ff('0x22')](_0xdcd3b5,function(_0x8e8787){return _0x8e8787['Email']===_0x2a3b39;});if(_0x32bc63){logger[_0x81ff('0x1b')](_0x81ff('0x25'),_0x2a3b39);return BPromise[_0x81ff('0x26')]({'id':_0x32bc63['Id'],'name':_0x32bc63[_0x81ff('0x27')]});}}else{logger['info'](_0x81ff('0x28'),_0x2a3b39);return _0x283489[_0x81ff('0x29')]()[_0x81ff('0x2a')](function(_0x237adf){return BPromise['resolve']({'id':_0x237adf[_0x81ff('0x2b')],'name':_0x237adf[_0x81ff('0x2c')]});});}});}else{logger['info'](_0x81ff('0x28'),_0x2a3b39);return _0x283489[_0x81ff('0x29')]()[_0x81ff('0x2a')](function(_0x34d27e){return BPromise[_0x81ff('0x26')]({'id':_0x34d27e['user_id'],'name':_0x34d27e[_0x81ff('0x2c')]});});}}function getEndUser(_0x2dfffe,_0x43f186,_0x12c9be,_0x17724b,_0x19613a){var _0x172dcf={'$or':{'Phone':_0x17724b}};var _0x592934={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x81ff('0x26')]()[_0x81ff('0x2a')](function(){logger['info']('Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.',_0x17724b,_0x43f186[_0x81ff('0x2d')]);switch(_0x43f186[_0x81ff('0x2d')]){case _0x81ff('0x2e'):var _0x5b1c1f=_[_0x81ff('0x2f')](_0x172dcf);if(_0x43f186[_0x81ff('0x30')]){var _0x2419b7={};_0x2419b7[_0x43f186[_0x81ff('0x30')]]=_0x17724b;_[_0x81ff('0x31')](_0x5b1c1f[_0x81ff('0x32')],_0x2419b7);}return _0x19613a['sobject'](_0x81ff('0x33'))[_0x81ff('0x22')](_0x5b1c1f,_0x592934)[_0x81ff('0x23')]()[_0x81ff('0x2a')](function(_0x2166f0){if(_0x2166f0&&_0x2166f0[_0x81ff('0x24')]){return _0x2166f0;}else{var _0x34cbc1=_[_0x81ff('0x2f')](_0x172dcf);if(_0x43f186[_0x81ff('0x34')]){var _0x39b108={};_0x39b108[_0x43f186[_0x81ff('0x34')]]=_0x17724b;_['merge'](_0x34cbc1[_0x81ff('0x32')],_0x39b108);}return _0x19613a[_0x81ff('0x1d')](_0x81ff('0x35'))[_0x81ff('0x22')](_0x34cbc1,_0x592934);}});case'account_contact_lead':var _0x599225=_[_0x81ff('0x2f')](_0x172dcf);if(_0x43f186['additionalSearchAccount']){var _0x2419b7={};_0x2419b7[_0x43f186[_0x81ff('0x36')]]=_0x17724b;_['merge'](_0x599225[_0x81ff('0x32')],_0x2419b7);}return _0x19613a[_0x81ff('0x1d')]('Account')[_0x81ff('0x22')](_0x599225,_0x592934)['execute']()[_0x81ff('0x2a')](function(_0xe0a93c){if(_0xe0a93c&&_0xe0a93c[_0x81ff('0x24')]){return _0xe0a93c;}else{var _0x162c24=_[_0x81ff('0x2f')](_0x172dcf);if(_0x43f186[_0x81ff('0x30')]){var _0x1a863e={};_0x1a863e[_0x43f186['additionalSearchContact']]=_0x17724b;_['merge'](_0x162c24['$or'],_0x1a863e);}return _0x19613a[_0x81ff('0x1d')](_0x81ff('0x33'))['find'](_0x162c24,_0x592934)[_0x81ff('0x2a')](function(_0x659be4){if(_0x659be4&&_0x659be4[_0x81ff('0x24')]){return _0x659be4;}else{var _0x1639fc=_[_0x81ff('0x2f')](_0x172dcf);if(_0x43f186[_0x81ff('0x34')]){var _0x194477={};_0x194477[_0x43f186[_0x81ff('0x34')]]=_0x17724b;_[_0x81ff('0x31')](_0x1639fc[_0x81ff('0x32')],_0x194477);}return _0x19613a[_0x81ff('0x1d')]('Lead')[_0x81ff('0x22')](_0x1639fc,_0x592934);}});}});case _0x81ff('0x13'):var _0x5b1c1f=_['cloneDeep'](_0x172dcf);if(_0x43f186[_0x81ff('0x30')]){var _0x2419b7={};_0x2419b7[_0x43f186['additionalSearchContact']]=_0x17724b;_[_0x81ff('0x31')](_0x5b1c1f[_0x81ff('0x32')],_0x2419b7);}return _0x19613a[_0x81ff('0x1d')](_0x81ff('0x33'))[_0x81ff('0x22')](_0x5b1c1f,_0x592934)[_0x81ff('0x23')]();case _0x81ff('0x14'):var _0x2c765d=_[_0x81ff('0x2f')](_0x172dcf);if(_0x43f186['additionalSearchLead']){var _0x2419b7={};_0x2419b7[_0x43f186[_0x81ff('0x34')]]=_0x17724b;_[_0x81ff('0x31')](_0x2c765d[_0x81ff('0x32')],_0x2419b7);}return _0x19613a['sobject'](_0x81ff('0x35'))[_0x81ff('0x22')](_0x2c765d,_0x592934);case _0x81ff('0x16'):var _0x599225=_['cloneDeep'](_0x172dcf);if(_0x43f186[_0x81ff('0x36')]){var _0x2419b7={};_0x2419b7[_0x43f186[_0x81ff('0x36')]]=_0x17724b;_[_0x81ff('0x31')](_0x599225[_0x81ff('0x32')],_0x2419b7);}return _0x19613a[_0x81ff('0x1d')]('Account')['find'](_0x599225,_0x592934);default:return null;}})[_0x81ff('0x2a')](function(_0x278760){if(_0x278760&&_0x278760[_0x81ff('0x24')]){var _0x2ce465=_[_0x81ff('0x37')](_0x278760);if(_0x2ce465){return BPromise[_0x81ff('0x26')]({'id':_0x2ce465['Id'],'name':_0x2ce465['Name'],'phone':_0x2ce465[_0x81ff('0x38')],'endUserType':_0x2ce465[_0x81ff('0x39')][_0x81ff('0x3a')][_0x81ff('0x3b')]()});}}})['then'](function(_0x5d6368){if(_0x5d6368){logger[_0x81ff('0x1b')](_0x81ff('0x3c'),_0x5d6368['endUserType'],_0x17724b);return BPromise['resolve'](_0x5d6368);}else{logger['info'](_0x81ff('0x3d'),_0x17724b);var _0x51fb41={'Phone':_0x17724b};if(_0x43f186[_0x81ff('0x3e')]){if(_0x43f186[_0x81ff('0x3e')]===_0x81ff('0x13')){logger[_0x81ff('0x1b')](_0x81ff('0x3f'),_0x17724b,_0x43f186[_0x81ff('0x3e')]);_0x51fb41[_0x81ff('0x40')]=_0x12c9be!==_0x81ff('0x41')?_0x12c9be:util[_0x81ff('0x42')]('Caller\x20-\x20%s',_0x17724b);}else if(_0x43f186['moduleCreate']==='lead'){logger[_0x81ff('0x1b')](_0x81ff('0x3f'),_0x17724b,_0x43f186['moduleCreate']);_0x51fb41[_0x81ff('0x40')]=_0x12c9be!==''?_0x12c9be:util[_0x81ff('0x42')](_0x81ff('0x43'),_0x17724b);_0x51fb41['Company']=_0x81ff('0x44');}else if(_0x43f186['moduleCreate']==='account'){logger[_0x81ff('0x1b')](_0x81ff('0x3f'),_0x17724b,_0x43f186[_0x81ff('0x3e')]);_0x51fb41[_0x81ff('0x27')]=_0x12c9be!==_0x81ff('0x41')?_0x12c9be:util[_0x81ff('0x42')](_0x81ff('0x43'),_0x17724b);}else{return null;}}return _0x19613a[_0x81ff('0x1d')](_[_0x81ff('0x45')](_0x43f186[_0x81ff('0x3e')]))[_0x81ff('0x1e')](_0x51fb41)[_0x81ff('0x2a')](function(_0x47bf1b){return BPromise[_0x81ff('0x26')]({'id':_0x47bf1b['id'],'endUserType':_0x43f186[_0x81ff('0x3e')]});});}});}function getCustomFields(_0x2a5968,_0x3717a3){var _0x32ce46={};if(_0x2a5968[_0x81ff('0x24')]>0x0){_[_0x81ff('0x46')](_0x2a5968,function(_0x3df886){if(_[_0x81ff('0x47')]([_0x81ff('0x48'),_0x81ff('0x49')],_0x3df886[_0x81ff('0x3a')])&&_0x3df886[_0x81ff('0x4a')]){_0x32ce46[_0x3df886[_0x81ff('0x4a')]]=_0x3df886[_0x81ff('0x4b')][_0x81ff('0x4c')]();}else if(_0x3df886['type']==='variable'&&_0x3df886[_0x81ff('0x4d')]&&_0x3df886[_0x81ff('0x4a')]){_0x3717a3[_0x3df886[_0x81ff('0x4d')]]&&(_0x32ce46[_0x3df886['idField']]=_0x3717a3[_0x3df886[_0x81ff('0x4d')]][_0x81ff('0x4c')]());}else if(_0x3df886[_0x81ff('0x3a')]==='customVariable'&&_0x3df886[_0x81ff('0x4e')]&&_0x3df886[_0x81ff('0x4e')][_0x81ff('0x4f')]&&_0x3df886['idField']){_0x3717a3[_0x3df886['Variable']['name'][_0x81ff('0x3b')]()]&&(_0x32ce46[_0x3df886[_0x81ff('0x4a')]]=_0x3717a3[_0x3df886[_0x81ff('0x4e')]['name'][_0x81ff('0x3b')]()]['toString']());}});}return _0x32ce46;}function getConnection(_0x12e4e3){var _0x449453=_0x12e4e3[_0x81ff('0x50')][_0x81ff('0x51')](_0x12e4e3[_0x81ff('0x52')]);var _0x396069=new jsforce[(_0x81ff('0x53'))]({'oauth2':{'loginUrl':_0x12e4e3[_0x81ff('0x54')]||_0x81ff('0x55'),'clientId':_0x12e4e3[_0x81ff('0x56')],'clientSecret':_0x12e4e3['clientSecret']}});return _0x396069[_0x81ff('0x57')](_0x12e4e3[_0x81ff('0x58')],_0x449453)[_0x81ff('0x2a')](function(){logger['info'](_0x81ff('0x59'));return _0x396069;});}exports[_0x81ff('0x5a')]=function(_0x502133,_0x108f6c,_0x26ec58,_0x50c399,_0x1cb2aa,_0x38f287){var _0x1c1658,_0x53c0a1,_0x514036,_0x855dfa;_0x38f287['serverUrl']=intUtil[_0x81ff('0x5b')](_0x38f287[_0x81ff('0x5c')]);_0x38f287[_0x81ff('0x54')]=intUtil[_0x81ff('0x5b')](_0x38f287[_0x81ff('0x54')]);if(_0x1cb2aa&&_0x1cb2aa[_0x81ff('0x5d')]){logger[_0x81ff('0x1b')](_0x81ff('0x5e'),_0x81ff('0x5f'));_0x108f6c['recordingURL']=util[_0x81ff('0x42')](_0x81ff('0x60'),_0x38f287[_0x81ff('0x5c')],_0x108f6c[_0x81ff('0x61')],md5(_0x108f6c[_0x81ff('0x61')]));}else{_0x108f6c['recordingURL']='';}return getConnection(_0x38f287)[_0x81ff('0x2a')](function(_0x47fec6){_0x855dfa=_0x47fec6;return getUser(_0x38f287,_0x50c399[_0x81ff('0x62')],_0x855dfa);})[_0x81ff('0x2a')](function(_0xf5b5c1){_0x1c1658=_0xf5b5c1;return getEndUser(_0x38f287,_0x26ec58,_0x108f6c[_0x81ff('0x63')],_0x108f6c[_0x81ff('0x64')],_0x855dfa);})['then'](function(_0x148a46){_0x53c0a1=_0x148a46;return getTicket(_0x38f287,_0x1c1658,_0x53c0a1,_0x26ec58,_0x108f6c,_0x26ec58[_0x81ff('0x65')],_0x855dfa,_0x81ff('0x5a'));})['then'](function(_0x27066e){_0x514036=_0x27066e;logger[_0x81ff('0x1b')](_0x81ff('0x66'),_0x514036['id']);logger[_0x81ff('0x1b')](_0x81ff('0x67'),_0x514036['id'],_0x50c399['name'],_0x38f287[_0x81ff('0x3a')]);switch(_0x38f287['type']){case _0x81ff('0x68'):emit(util['format'](_0x81ff('0x69'),_0x50c399[_0x81ff('0x4f')]),'trigger:salesforce:display',{'recordId':_0x514036['id']});break;case'newTab':emit(util[_0x81ff('0x42')](_0x81ff('0x69'),_0x50c399['name']),_0x81ff('0x6a'),{'uri':util[_0x81ff('0x42')](_0x81ff('0x6b'),_0x855dfa[_0x81ff('0x6c')],_0x514036['id'])});break;default:logger[_0x81ff('0x6d')](_0x81ff('0x6e'));}})[_0x81ff('0x6f')](function(_0x43b54a){logger[_0x81ff('0x6d')](_0x81ff('0x5e'),_0x43b54a);});};exports['outbound']=function(_0x222015,_0x4f1989,_0x67a39b,_0x203a1c,_0x41e24c,_0x13c098,_0x120e4c){var _0x11130a,_0x136d31,_0x259867,_0x750f87;_0x13c098[_0x81ff('0x5c')]=intUtil[_0x81ff('0x5b')](_0x13c098[_0x81ff('0x5c')]);_0x13c098[_0x81ff('0x54')]=intUtil['stripTrailingSlash'](_0x13c098[_0x81ff('0x54')]);if(_0x120e4c&&_0x120e4c[_0x81ff('0x70')]&&_0x120e4c['recordingFormat']!==_0x81ff('0x71')){logger[_0x81ff('0x1b')](_0x81ff('0x72'),_0x81ff('0x5f'));_0x4f1989[_0x81ff('0x73')]=util[_0x81ff('0x42')](_0x81ff('0x60'),_0x13c098['serverUrl'],_0x4f1989[_0x81ff('0x61')],md5(_0x4f1989['uniqueid']));}return getConnection(_0x13c098)[_0x81ff('0x2a')](function(_0x3f84f5){_0x750f87=_0x3f84f5;return getUser(_0x13c098,_0x203a1c[_0x81ff('0x62')],_0x750f87);})[_0x81ff('0x2a')](function(_0x3ce100){_0x11130a=_0x3ce100;return getEndUser(_0x13c098,_0x67a39b,_0x4f1989[_0x81ff('0x74')],_0x4f1989[_0x81ff('0x75')],_0x750f87);})[_0x81ff('0x2a')](function(_0x4614c6){_0x136d31=_0x4614c6;return getTicket(_0x13c098,_0x11130a,_0x136d31,_0x67a39b,_0x4f1989,_0x67a39b['Fields'],_0x750f87,'outbound');})['then'](function(_0xd33102){_0x259867=_0xd33102;logger[_0x81ff('0x1b')](_0x81ff('0x76'),_0x259867['id']);logger[_0x81ff('0x1b')](_0x81ff('0x77'),_0x259867['id'],_0x203a1c[_0x81ff('0x4f')],_0x13c098[_0x81ff('0x3a')]);switch(_0x13c098['type']){case _0x81ff('0x68'):emit(util[_0x81ff('0x42')](_0x81ff('0x69'),_0x203a1c[_0x81ff('0x4f')]),'trigger:salesforce:display',{'recordId':_0x259867['id']});break;case _0x81ff('0x78'):emit(util[_0x81ff('0x42')](_0x81ff('0x69'),_0x203a1c[_0x81ff('0x4f')]),'trigger:browser:url',{'uri':util[_0x81ff('0x42')](_0x81ff('0x6b'),_0x750f87['instanceUrl'],_0x259867['id'])});break;default:logger['error'](_0x81ff('0x72'),'Salesforce\x20account\x20type\x20not\x20recognized');}})[_0x81ff('0x6f')](function(_0x42f2b2){logger[_0x81ff('0x6d')](_0x81ff('0x72'),_0x42f2b2);});};exports[_0x81ff('0x79')]=function(_0x17e67d,_0x4f3d96,_0x7f0d6a,_0xc35442,_0x73cd49,_0x3f0d23){var _0xb16fbc,_0x2f976b,_0x3508de,_0x3df8d0;_0x3f0d23[_0x81ff('0x5c')]=intUtil[_0x81ff('0x5b')](_0x3f0d23[_0x81ff('0x5c')]);_0x3f0d23[_0x81ff('0x54')]=intUtil[_0x81ff('0x5b')](_0x3f0d23[_0x81ff('0x54')]);if(_0x73cd49&&_0x73cd49[_0x81ff('0x5d')]){logger[_0x81ff('0x1b')]('['+_0x4f3d96[_0x81ff('0x7a')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x4f3d96[_0x81ff('0x73')]=util['format'](_0x81ff('0x60'),_0x3f0d23['serverUrl'],_0x4f3d96[_0x81ff('0x61')],md5(_0x4f3d96[_0x81ff('0x61')]));}else{_0x4f3d96[_0x81ff('0x73')]='';}return getConnection(_0x3f0d23)[_0x81ff('0x2a')](function(_0x32f643){_0x3df8d0=_0x32f643;if(!_['isNil'](_0xc35442)){return getUser(_0x3f0d23,_0xc35442[_0x81ff('0x4f')],_0x3df8d0);}else{return getUser(_0x3f0d23,null,_0x3df8d0);}})[_0x81ff('0x2a')](function(_0x2efe26){_0xb16fbc=_0x2efe26;return getEndUser(_0x3f0d23,_0x7f0d6a,_0x4f3d96['calleridname'],_0x4f3d96['calleridnum'],_0x3df8d0);})['then'](function(_0x55e141){_0x2f976b=_0x55e141;return getTicket(_0x3f0d23,_0xb16fbc,_0x2f976b,_0x7f0d6a,_0x4f3d96,_0x7f0d6a[_0x81ff('0x65')],_0x3df8d0);})[_0x81ff('0x2a')](function(_0x33d41e){_0x3508de=_0x33d41e;logger['info']('['+_0x4f3d96[_0x81ff('0x7a')]['toUpperCase']()+_0x81ff('0x7b'),_0x3508de['id']);logger[_0x81ff('0x1b')]('['+_0x4f3d96[_0x81ff('0x7a')][_0x81ff('0x7c')]()+_0x81ff('0x7d'),_0x3f0d23[_0x81ff('0x3a')]);})[_0x81ff('0x6f')](function(_0x3e4d10){logger[_0x81ff('0x6d')]('['+_0x4f3d96[_0x81ff('0x7a')][_0x81ff('0x7c')]()+']',_0x3e4d10);});}; \ 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 6d92df5..192969b 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 _0x8fc1=['bluebird','request-promise','util','ioredis','../../../../config/environment','servicenow','redis','socket.io-emitter','GET','then','length','adminId','result','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','error','],\x20getUser\x20input\x20crm','userEmail','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','active','userId','adminEmail','catch','message',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','endUserNumber','System','],\x20EndUser\x20schema','endUserId','sys_user?sysparm_query=phone%3D','],\x20createEndUser\x20crm','forEach','includes','string','type','customField','nameField','toLowerCase','content','toString','picklist','variable','variableName','customVariable','Variable','name','idField',']\x20getTicket\x20input\x20crm','outbound','POST','incident','getString','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','Incident','Incident\x20-\x20','push','all','Tags','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','/nav_to.do?uri=incident.do?sys_id%3D','format','username','password','sysparm_limit=1','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','isNil','destcalleridnum','calleridnum','callDirection','queue','unmanaged','%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','inspect','lodash'];(function(_0x173dd9,_0x4ecf44){var _0x5a0d5a=function(_0x4d731a){while(--_0x4d731a){_0x173dd9['push'](_0x173dd9['shift']());}};_0x5a0d5a(++_0x4ecf44);}(_0x8fc1,0x193));var _0x18fc=function(_0x9bba42,_0x8f2344){_0x9bba42=_0x9bba42-0x0;var _0x42264f=_0x8fc1[_0x9bba42];return _0x42264f;};'use strict';var _=require(_0x18fc('0x0'));var Promise=require(_0x18fc('0x1'));var rp=require(_0x18fc('0x2'));var util=require(_0x18fc('0x3'));var md5=require('md5');var Redis=require(_0x18fc('0x4'));var intUtil=require('./util');var config=require(_0x18fc('0x5'));var logger=require('../../../../config/logger')(_0x18fc('0x6'));config[_0x18fc('0x7')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x18fc('0x8'))(new Redis(config['redis']));function getAdminUser(_0x3c26b8,_0x2233e3,_0x2d98ca,_0x5a4c09,_0x4e3a81,_0x32cd88){return new Promise(function(_0x2429da,_0x2180c2){var _0x48e9d4={'method':_0x18fc('0x9'),'uri':_0x5a4c09+'sys_user?sysparm_query=user_name%3Dadmin'+'&'+_0x4e3a81+'&'+_0x32cd88,'auth':_0x2233e3,'json':!![]};return rp(_0x48e9d4)[_0x18fc('0xa')](function(_0x51e236){if(_0x51e236['result'][_0x18fc('0xb')]>0x0){_0x2d98ca[_0x18fc('0xc')]=_0x51e236[_0x18fc('0xd')][0x0][_0x18fc('0xe')];}logger[_0x18fc('0xf')]('['+[_0x3c26b8[_0x18fc('0x10')]()]+_0x18fc('0x11'),_0x2d98ca);_0x2429da(_0x2d98ca);})['catch'](function(_0x1aa67c){logger[_0x18fc('0x12')]('['+[_0x3c26b8[_0x18fc('0x10')]()]+']',_0x1aa67c['message']);_0x2180c2(_0x1aa67c['message']);});});}function getUser(_0x1985c8,_0x1af0c8,_0x2c79d5,_0x3ffd1a,_0x1f0a41){return function(_0x50d57c){logger[_0x18fc('0xf')]('['+[_0x1985c8['toUpperCase']()]+_0x18fc('0x13'),_0x50d57c);return new Promise(function(_0x454f02,_0x26ed19){if(intUtil['validateEmail'](_0x50d57c[_0x18fc('0x14')])){var _0x286778={'method':_0x18fc('0x9'),'uri':_0x2c79d5+'sys_user?sysparm_query=email%3D'+_0x50d57c['userEmail']+'&'+_0x3ffd1a+'&'+_0x1f0a41,'auth':_0x1af0c8,'json':!![]};logger[_0x18fc('0xf')]('['+[_0x1985c8[_0x18fc('0x10')]()]+_0x18fc('0x15'),_0x286778);return rp(_0x286778)[_0x18fc('0xa')](function(_0x315a9e){logger[_0x18fc('0xf')]('['+[_0x1985c8[_0x18fc('0x10')]()]+_0x18fc('0x16'),_0x315a9e);if(_0x315a9e[_0x18fc('0xd')][_0x18fc('0xb')]>0x0&&String(_0x315a9e['result'][0x0][_0x18fc('0x17')])==='true'){_0x50d57c['userId']=_0x315a9e[_0x18fc('0xd')][0x0][_0x18fc('0xe')];}else{_0x50d57c[_0x18fc('0x18')]=_0x50d57c[_0x18fc('0xc')];_0x50d57c[_0x18fc('0x14')]=_0x50d57c[_0x18fc('0x19')];}logger[_0x18fc('0xf')]('['+[_0x1985c8[_0x18fc('0x10')]()]+'],\x20getUser\x20crm',_0x50d57c);_0x454f02(_0x50d57c);})[_0x18fc('0x1a')](function(_0x4beace){logger[_0x18fc('0x12')]('['+[_0x1985c8[_0x18fc('0x10')]()]+']',_0x4beace[_0x18fc('0x1b')]);_0x26ed19(_0x4beace[_0x18fc('0x1b')]);});}else{logger[_0x18fc('0xf')]('['+[_0x1985c8[_0x18fc('0x10')]()]+_0x18fc('0x1c'));_0x50d57c[_0x18fc('0x18')]=_0x50d57c[_0x18fc('0xc')];_0x50d57c[_0x18fc('0x14')]=_0x50d57c[_0x18fc('0x19')];_0x454f02(_0x50d57c);}});};}function createEndUser(_0x23f47d,_0x279ad3,_0x4c7cde,_0x4c265d,_0x4ed98e){logger['info']('['+[_0x23f47d[_0x18fc('0x10')]()]+_0x18fc('0x1d'),_0x4c7cde);return new Promise(function(_0x48de0a,_0x1f0738){var _0x28b2a3={'method':'POST','uri':_0x4c265d+'sys_user?'+_0x4ed98e,'body':{'user_name':_0x4c7cde[_0x18fc('0x1e')],'roles':'user','first_name':_0x4c7cde[_0x18fc('0x1e')],'active':'true','date_format':_0x18fc('0x1f'),'phone':_0x4c7cde['endUserNumber']},'auth':_0x279ad3,'json':!![]};return rp(_0x28b2a3)[_0x18fc('0xa')](function(_0x4497b2){logger['info']('['+[_0x23f47d[_0x18fc('0x10')]()]+_0x18fc('0x20'),_0x4497b2[_0x18fc('0xd')]);_0x4c7cde[_0x18fc('0x21')]=_0x4497b2[_0x18fc('0xd')][_0x18fc('0xe')];_0x48de0a(_0x4c7cde);})[_0x18fc('0x1a')](function(_0x2a53d7){logger[_0x18fc('0x12')]('['+[_0x23f47d['toUpperCase']()]+']',_0x2a53d7[_0x18fc('0x1b')]);_0x1f0738(_0x2a53d7[_0x18fc('0x1b')]);});});}function getEndUser(_0x5d6b38,_0x2196c,_0x5161c4,_0x349c20,_0xb9621e){return function(_0x422e91){logger['info']('['+[_0x5d6b38[_0x18fc('0x10')]()]+'],\x20getEndUser\x20input\x20crm',_0x422e91);return new Promise(function(_0x504251,_0x2eea51){var _0x371626={'method':_0x18fc('0x9'),'uri':_0x5161c4+_0x18fc('0x22')+_0x422e91[_0x18fc('0x1e')]+'&'+_0x349c20+'&'+_0xb9621e,'auth':_0x2196c,'json':!![]};return rp(_0x371626)[_0x18fc('0xa')](function(_0x3819a1){if(_0x3819a1[_0x18fc('0xd')][_0x18fc('0xb')]>0x0){_0x422e91[_0x18fc('0x21')]=_0x3819a1['result'][0x0][_0x18fc('0xe')];logger[_0x18fc('0xf')]('['+[_0x5d6b38[_0x18fc('0x10')]()]+'],\x20getEndUser\x20crm',_0x422e91);_0x504251(_0x422e91);}else{return createEndUser(_0x5d6b38,_0x2196c,_0x422e91,_0x5161c4,_0x349c20)[_0x18fc('0xa')](function(_0x50a857){logger[_0x18fc('0xf')]('['+[_0x5d6b38[_0x18fc('0x10')]()]+_0x18fc('0x23'),_0x50a857);_0x504251(_0x50a857);});}})[_0x18fc('0x1a')](function(_0x51c31c){logger[_0x18fc('0x12')]('['+[_0x5d6b38[_0x18fc('0x10')]()]+']',_0x51c31c['message']);_0x2eea51(_0x51c31c[_0x18fc('0x1b')]);});});};}function getCustomFields(_0x4032ff,_0x55fa4d){var _0x4c4a34={};if(_0x4032ff[_0x18fc('0xb')]>0x0){_[_0x18fc('0x24')](_0x4032ff,function(_0x1904a2){if(_[_0x18fc('0x25')]([_0x18fc('0x26'),'picklist'],_0x1904a2[_0x18fc('0x27')])&&_0x1904a2['nameField']&&!_0x1904a2[_0x18fc('0x28')]){_0x4c4a34[_0x1904a2[_0x18fc('0x29')][_0x18fc('0x2a')]()]=_0x1904a2[_0x18fc('0x2b')][_0x18fc('0x2c')]();}else if(_[_0x18fc('0x25')]([_0x18fc('0x26'),_0x18fc('0x2d')],_0x1904a2[_0x18fc('0x27')])&&_0x1904a2['idField']&&_0x1904a2['customField']){_0x4c4a34[_0x1904a2['idField'][_0x18fc('0x2a')]()]=_0x1904a2[_0x18fc('0x2b')][_0x18fc('0x2c')]();}else if(_0x1904a2[_0x18fc('0x27')]===_0x18fc('0x2e')&&_0x1904a2[_0x18fc('0x2f')]&&_0x1904a2['idField']&&_0x1904a2[_0x18fc('0x28')]){_0x4c4a34[_0x1904a2['idField'][_0x18fc('0x2a')]()]=_0x55fa4d[_0x1904a2[_0x18fc('0x2f')]][_0x18fc('0x2c')]();}else if(_0x1904a2['type']===_0x18fc('0x30')&&_0x1904a2[_0x18fc('0x31')]&&_0x1904a2[_0x18fc('0x31')][_0x18fc('0x32')]&&_0x1904a2[_0x18fc('0x33')]&&_0x1904a2['customField']){_0x4c4a34[_0x1904a2[_0x18fc('0x33')][_0x18fc('0x2a')]()]=_0x55fa4d[_0x1904a2[_0x18fc('0x31')][_0x18fc('0x32')][_0x18fc('0x2a')]()][_0x18fc('0x2c')]();}});}return _0x4c4a34;}function getTicket(_0x3c3f0d,_0x4bb5ac,_0x478633,_0x185e41,_0x538e5c,_0x24b8be){return function(_0x428868){logger[_0x18fc('0xf')]('['+[_0x3c3f0d[_0x18fc('0x10')]()]+_0x18fc('0x34'),_0x428868);return new Promise(function(_0x36e53c,_0x2ad419){var _0x23da24=_0x3c3f0d[_0x18fc('0x2a')]()===_0x18fc('0x35')?_0x428868[_0x18fc('0x18')]:_0x428868['endUserId'];var _0x251ca2={'method':_0x18fc('0x36'),'uri':_0x478633+_0x18fc('0x37')+'?'+_0x24b8be,'body':Object['assign']({},{'active':'true','caller_id':_0x23da24,'assigned_to':_0x428868[_0x18fc('0x18')],'short_description':intUtil[_0x18fc('0x38')](_0x185e41['Subjects'],_0x538e5c,'\x20'),'description':intUtil[_0x18fc('0x38')](_0x185e41['Descriptions'],_0x538e5c,'\x0a')},getCustomFields(_0x185e41[_0x18fc('0x39')],_0x538e5c)),'auth':_0x4bb5ac,'json':!![]};return rp(_0x251ca2)[_0x18fc('0xa')](function(_0x295dcb){logger['info']('['+[_0x3c3f0d[_0x18fc('0x10')]()]+_0x18fc('0x3a'),_0x295dcb[_0x18fc('0xd')]);_0x428868[_0x18fc('0x3b')]=_0x295dcb['result']['sys_id'];_0x428868[_0x18fc('0x3c')]=_0x295dcb[_0x18fc('0xd')][_0x18fc('0x3d')];logger['info']('['+[_0x3c3f0d[_0x18fc('0x10')]()]+_0x18fc('0x3e'),_0x428868);_0x36e53c(_0x428868);})[_0x18fc('0x1a')](function(_0x2ab1d6){logger[_0x18fc('0x12')]('['+[_0x3c3f0d[_0x18fc('0x10')]()]+']',_0x2ab1d6['message']);_0x2ad419(_0x2ab1d6[_0x18fc('0x1b')]);});});};}function createRemoteTag(_0x451931,_0x2d5a61,_0x4e3f08,_0x2cd6d0){return new Promise(function(_0x563561,_0x215ae3){var _0x44406a={'method':'POST','uri':_0x4e3f08+'label'+'?'+_0x2cd6d0,'body':{'short_description':_0x451931,'global':!![],'active':!![],'name':_0x451931},'auth':_0x2d5a61,'json':!![]};return rp(_0x44406a)[_0x18fc('0xa')](function(_0x538d77){var _0x4d4bc3=_0x538d77[_0x18fc('0xd')][_0x18fc('0xe')];_0x563561(_0x4d4bc3);});});}function getRemoteTag(_0x353b92,_0x5d93aa,_0x5c9f40,_0x292712,_0x2f7c5a){return new Promise(function(_0x900681,_0x46825f){var _0x3b62e6={'method':_0x18fc('0x9'),'uri':_0x5c9f40+_0x18fc('0x3f')+_0x18fc('0x40')+_0x353b92+'&'+_0x292712,'auth':_0x5d93aa,'json':!![]};return rp(_0x3b62e6)['then'](function(_0x243cc4){if(_0x243cc4[_0x18fc('0xd')]['length']>0x0){var _0x446082=_0x243cc4[_0x18fc('0xd')][0x0][_0x18fc('0xe')];_0x900681(_0x446082);}else{return createRemoteTag(_0x353b92,_0x5d93aa,_0x5c9f40,_0x292712)[_0x18fc('0xa')](function(_0x24603b){_0x900681(_0x24603b);});}});});}function assignTagToIncident(_0x55139b,_0x5b16c7,_0x3d2f31,_0x5987d8,_0x1881d8){return new Promise(function(_0x30e1ab,_0x17b707){var _0x2f59d9={'method':'POST','uri':_0x3d2f31+_0x18fc('0x41')+'?'+_0x1881d8,'body':{'label':_0x55139b,'table':_0x18fc('0x37'),'id_type':_0x18fc('0x42'),'table_key':_0x5987d8[_0x18fc('0x3b')],'title':_0x18fc('0x43')+_0x5987d8[_0x18fc('0x3c')],'id_display':_0x5987d8[_0x18fc('0x3c')]},'auth':_0x5b16c7,'json':!![]};return rp(_0x2f59d9)['then'](function(_0x20c3e9){_0x30e1ab();})[_0x18fc('0x1a')](function(){_0x30e1ab();});});}function manageTags(_0x58fdf9,_0x8ee0f5,_0x558c1a,_0x2abf74,_0x24531a,_0x21de3f,_0x3be723){return new Promise(function(_0x19c2f1,_0x5ddef9){var _0xda83a4=[];_0x8ee0f5[_0x18fc('0x24')](function(_0x29808d){_0xda83a4[_0x18fc('0x44')](getRemoteTag(_0x29808d,_0x558c1a,_0x2abf74,_0x21de3f,_0x3be723));});return Promise[_0x18fc('0x45')](_0xda83a4)[_0x18fc('0xa')](function(_0x2238fd){if(_0x2238fd[_0x18fc('0xb')]){logger['info']('['+[_0x58fdf9[_0x18fc('0x10')]()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0x2238fd);var _0x4f691e=[];_0x2238fd[_0x18fc('0x24')](function(_0x3ebe58){_0x4f691e[_0x18fc('0x44')](assignTagToIncident(_0x3ebe58,_0x558c1a,_0x2abf74,_0x24531a,_0x21de3f));});return Promise[_0x18fc('0x45')](_0x4f691e)[_0x18fc('0xa')](function(){_0x19c2f1();})['catch'](function(){_0x19c2f1();});}else{_0x19c2f1();}});});}function getTags(_0x28a669,_0x354810,_0xdc1e44,_0x417d67,_0x3d4df2,_0x4f19fb){return function(_0x50ac00){return new Promise(function(_0x436356,_0x52d1ae){var _0x357ee9=[];var _0x503479=_0x417d67[_0x18fc('0x46')];if(_0x503479&&_0x503479[_0x18fc('0xb')]>0x0){_0x357ee9=_['map'](_0x503479,_0x18fc('0x32'));}if(_0x357ee9['length']>0x0){return manageTags(_0x28a669,_0x357ee9,_0x354810,_0xdc1e44,_0x50ac00,_0x3d4df2,_0x4f19fb)[_0x18fc('0xa')](function(){_0x436356(_0x50ac00);});}else{_0x436356(_0x50ac00);}});};}function emit(_0xa8451c,_0x2802df,_0x4355dc){var _0x11778d=_0x18fc('0x47')+_0x18fc('0x48')+_0x18fc('0x49')+'%255EORDERBYDESCnumber';var _0x5aedc7={'uri':_0xa8451c+_0x18fc('0x4a')+_0x4355dc+_0x11778d};io['to'](util[_0x18fc('0x4b')]('user:%s',_0x2802df))['emit']('trigger:browser:url',_0x5aedc7);}exports['cs']=function(_0x4be157,_0x2068c6,_0x9f6c7d,_0x52dfd2,_0x169c46,_0x4e36c1,_0x4b9df0,_0x279577){var _0x1eb0aa={};var _0x326cac={'user':_0x4e36c1[_0x18fc('0x4c')],'pass':_0x4e36c1[_0x18fc('0x4d')]};var _0x45d2cf=_0x18fc('0x4e');var _0x2b12c7='sysparm_display_value=true';_0x4e36c1[_0x18fc('0x4f')]=intUtil[_0x18fc('0x50')](_0x4e36c1['remoteUri']);_0x4e36c1[_0x18fc('0x51')]=intUtil['stripTrailingSlash'](_0x4e36c1[_0x18fc('0x51')]);var _0xe7d440=util[_0x18fc('0x4b')](_0x18fc('0x52'),_0x4e36c1['remoteUri']);_0x1eb0aa[_0x18fc('0x14')]=!_[_0x18fc('0x53')](_0x52dfd2)?_0x52dfd2['email']:null;_0x1eb0aa[_0x18fc('0x19')]=_0x4e36c1['email'];_0x1eb0aa['endUserNumber']=_0x279577['toLowerCase']()==='outbound'?_0x2068c6[_0x18fc('0x54')]:_0x2068c6[_0x18fc('0x55')];_0x1eb0aa[_0x18fc('0x56')]=_0x279577===_0x18fc('0x57')||_0x279577===_0x18fc('0x58')?_0x18fc('0x57'):'outbound';var _0x1bed98=util['format'](_0x18fc('0x59'),_0x4e36c1[_0x18fc('0x51')],_0x2068c6[_0x18fc('0x5a')],md5(_0x2068c6['uniqueid']));if(_0x169c46&&_0x169c46[_0x18fc('0x5b')]){logger[_0x18fc('0xf')](_0x18fc('0x5c'),_0x18fc('0x5d'));_0x2068c6['recordingURL']=_0x1bed98;}else if(_0x4b9df0&&_0x4b9df0[_0x18fc('0x5e')]&&_0x4b9df0['recordingFormat']!==_0x18fc('0x5f')){logger[_0x18fc('0xf')](_0x18fc('0x60'),_0x18fc('0x5d'));_0x2068c6['recordingURL']=_0x1bed98;}else{_0x2068c6[_0x18fc('0x61')]='';}return getAdminUser(_0x279577,_0x326cac,_0x1eb0aa,_0xe7d440,_0x2b12c7,_0x45d2cf)[_0x18fc('0xa')](getUser(_0x279577,_0x326cac,_0xe7d440,_0x2b12c7,_0x45d2cf))['then'](getEndUser(_0x279577,_0x326cac,_0xe7d440,_0x2b12c7,_0x45d2cf))[_0x18fc('0xa')](getTicket(_0x279577,_0x326cac,_0xe7d440,_0x9f6c7d,_0x2068c6,_0x2b12c7))['then'](function(_0x4e858c){logger[_0x18fc('0xf')](util['format'](_0x18fc('0x62'),_0x4e858c[_0x18fc('0x3b')]));logger[_0x18fc('0xf')](util['format'](_0x18fc('0x63'),_0x279577));if(_0x279577!=='unmanaged'){logger['info']('['+[_0x279577[_0x18fc('0x10')]()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x4e36c1[_0x18fc('0x4f')],_0x52dfd2[_0x18fc('0x32')],_0x4e858c[_0x18fc('0x3b')]);}})[_0x18fc('0x1a')](function(_0xb8e20b){logger['error']('['+[_0x279577[_0x18fc('0x10')]()]+']\x20Error\x20running\x20ServiceNow\x20integration',util[_0x18fc('0x64')](_0xb8e20b,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x7f4a=['remoteUri','serverUrl','%s/api/now/table/','isNil','destcalleridnum','calleridnum','callDirection','queue','unmanaged','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','[OUTBOUND]','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','lodash','bluebird','util','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','sys_id','toUpperCase','],\x20getAdminUser\x20crm','error','message','info','],\x20getUser\x20input\x20crm','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','true','userId','adminId','adminEmail','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','user','System','],\x20EndUser\x20schema','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','length','],\x20createEndUser\x20crm','forEach','includes','picklist','type','customField','toLowerCase','content','toString','string','idField','variable','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','endUserId','incident','assign','Subjects','getString','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketNumber','number',']\x20getTicket\x20crm','catch','label','Incident','ticketId','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','%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','emit','trigger:browser:url','username','sysparm_limit=1'];(function(_0x49aaee,_0x1156dc){var _0x4e51c7=function(_0x23d961){while(--_0x23d961){_0x49aaee['push'](_0x49aaee['shift']());}};_0x4e51c7(++_0x1156dc);}(_0x7f4a,0x1c7));var _0xa7f4=function(_0x468ac5,_0x2edfd5){_0x468ac5=_0x468ac5-0x0;var _0x33a807=_0x7f4a[_0x468ac5];return _0x33a807;};'use strict';var _=require(_0xa7f4('0x0'));var Promise=require(_0xa7f4('0x1'));var rp=require('request-promise');var util=require(_0xa7f4('0x2'));var md5=require(_0xa7f4('0x3'));var Redis=require(_0xa7f4('0x4'));var intUtil=require(_0xa7f4('0x5'));var config=require(_0xa7f4('0x6'));var logger=require(_0xa7f4('0x7'))(_0xa7f4('0x8'));config[_0xa7f4('0x9')]=_[_0xa7f4('0xa')](config[_0xa7f4('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0xa7f4('0xb'))(new Redis(config[_0xa7f4('0x9')]));function getAdminUser(_0x4368c9,_0x46cb60,_0x3fbfb5,_0x399f18,_0x12bae5,_0x492904){return new Promise(function(_0x5026a2,_0x1d3d1e){var _0x5c93e8={'method':_0xa7f4('0xc'),'uri':_0x399f18+_0xa7f4('0xd')+'&'+_0x12bae5+'&'+_0x492904,'auth':_0x46cb60,'json':!![]};return rp(_0x5c93e8)[_0xa7f4('0xe')](function(_0x4bf071){if(_0x4bf071['result']['length']>0x0){_0x3fbfb5['adminId']=_0x4bf071[_0xa7f4('0xf')][0x0][_0xa7f4('0x10')];}logger['info']('['+[_0x4368c9[_0xa7f4('0x11')]()]+_0xa7f4('0x12'),_0x3fbfb5);_0x5026a2(_0x3fbfb5);})['catch'](function(_0x511c8c){logger[_0xa7f4('0x13')]('['+[_0x4368c9[_0xa7f4('0x11')]()]+']',_0x511c8c[_0xa7f4('0x14')]);_0x1d3d1e(_0x511c8c[_0xa7f4('0x14')]);});});}function getUser(_0x873b3a,_0x3d2efd,_0x286c37,_0x598049,_0x28509a){return function(_0x25f211){logger[_0xa7f4('0x15')]('['+[_0x873b3a['toUpperCase']()]+_0xa7f4('0x16'),_0x25f211);return new Promise(function(_0x40a146,_0x1b3edd){if(intUtil[_0xa7f4('0x17')](_0x25f211[_0xa7f4('0x18')])){var _0x477faa={'method':'GET','uri':_0x286c37+_0xa7f4('0x19')+_0x25f211[_0xa7f4('0x18')]+'&'+_0x598049+'&'+_0x28509a,'auth':_0x3d2efd,'json':!![]};logger[_0xa7f4('0x15')]('['+[_0x873b3a[_0xa7f4('0x11')]()]+_0xa7f4('0x1a'),_0x477faa);return rp(_0x477faa)[_0xa7f4('0xe')](function(_0x359e1f){logger['info']('['+[_0x873b3a[_0xa7f4('0x11')]()]+_0xa7f4('0x1b'),_0x359e1f);if(_0x359e1f[_0xa7f4('0xf')]['length']>0x0&&String(_0x359e1f[_0xa7f4('0xf')][0x0]['active'])===_0xa7f4('0x1c')){_0x25f211[_0xa7f4('0x1d')]=_0x359e1f[_0xa7f4('0xf')][0x0]['sys_id'];}else{_0x25f211['userId']=_0x25f211[_0xa7f4('0x1e')];_0x25f211['userEmail']=_0x25f211[_0xa7f4('0x1f')];}logger['info']('['+[_0x873b3a[_0xa7f4('0x11')]()]+_0xa7f4('0x20'),_0x25f211);_0x40a146(_0x25f211);})['catch'](function(_0x4d0792){logger[_0xa7f4('0x13')]('['+[_0x873b3a[_0xa7f4('0x11')]()]+']',_0x4d0792[_0xa7f4('0x14')]);_0x1b3edd(_0x4d0792[_0xa7f4('0x14')]);});}else{logger[_0xa7f4('0x15')]('['+[_0x873b3a[_0xa7f4('0x11')]()]+_0xa7f4('0x21'));_0x25f211[_0xa7f4('0x1d')]=_0x25f211['adminId'];_0x25f211['userEmail']=_0x25f211['adminEmail'];_0x40a146(_0x25f211);}});};}function createEndUser(_0x6e5bd7,_0x4bd238,_0x24212f,_0x233336,_0x199308){logger['info']('['+[_0x6e5bd7['toUpperCase']()]+_0xa7f4('0x22'),_0x24212f);return new Promise(function(_0x459c22,_0x76a965){var _0x2e943b={'method':_0xa7f4('0x23'),'uri':_0x233336+_0xa7f4('0x24')+_0x199308,'body':{'user_name':_0x24212f[_0xa7f4('0x25')],'roles':_0xa7f4('0x26'),'first_name':_0x24212f[_0xa7f4('0x25')],'active':_0xa7f4('0x1c'),'date_format':_0xa7f4('0x27'),'phone':_0x24212f[_0xa7f4('0x25')]},'auth':_0x4bd238,'json':!![]};return rp(_0x2e943b)['then'](function(_0x5c7448){logger[_0xa7f4('0x15')]('['+[_0x6e5bd7[_0xa7f4('0x11')]()]+_0xa7f4('0x28'),_0x5c7448[_0xa7f4('0xf')]);_0x24212f['endUserId']=_0x5c7448[_0xa7f4('0xf')][_0xa7f4('0x10')];_0x459c22(_0x24212f);})['catch'](function(_0x34a937){logger[_0xa7f4('0x13')]('['+[_0x6e5bd7[_0xa7f4('0x11')]()]+']',_0x34a937[_0xa7f4('0x14')]);_0x76a965(_0x34a937['message']);});});}function getEndUser(_0x4b5446,_0x4dd9d3,_0x1db9ad,_0x12acb9,_0x1bcb12){return function(_0x55469d){logger[_0xa7f4('0x15')]('['+[_0x4b5446[_0xa7f4('0x11')]()]+_0xa7f4('0x29'),_0x55469d);return new Promise(function(_0x58a6c6,_0xc9cc56){var _0x19462a={'method':_0xa7f4('0xc'),'uri':_0x1db9ad+_0xa7f4('0x2a')+_0x55469d[_0xa7f4('0x25')]+'&'+_0x12acb9+'&'+_0x1bcb12,'auth':_0x4dd9d3,'json':!![]};return rp(_0x19462a)['then'](function(_0x4d0641){if(_0x4d0641[_0xa7f4('0xf')][_0xa7f4('0x2b')]>0x0){_0x55469d['endUserId']=_0x4d0641[_0xa7f4('0xf')][0x0]['sys_id'];logger[_0xa7f4('0x15')]('['+[_0x4b5446[_0xa7f4('0x11')]()]+'],\x20getEndUser\x20crm',_0x55469d);_0x58a6c6(_0x55469d);}else{return createEndUser(_0x4b5446,_0x4dd9d3,_0x55469d,_0x1db9ad,_0x12acb9)[_0xa7f4('0xe')](function(_0x1b06a9){logger[_0xa7f4('0x15')]('['+[_0x4b5446[_0xa7f4('0x11')]()]+_0xa7f4('0x2c'),_0x1b06a9);_0x58a6c6(_0x1b06a9);});}})['catch'](function(_0x1a09d5){logger['error']('['+[_0x4b5446['toUpperCase']()]+']',_0x1a09d5[_0xa7f4('0x14')]);_0xc9cc56(_0x1a09d5[_0xa7f4('0x14')]);});});};}function getCustomFields(_0x4f3414,_0x1f8b7f){var _0x43b6b1={};if(_0x4f3414[_0xa7f4('0x2b')]>0x0){_[_0xa7f4('0x2d')](_0x4f3414,function(_0x5ae69c){if(_[_0xa7f4('0x2e')](['string',_0xa7f4('0x2f')],_0x5ae69c[_0xa7f4('0x30')])&&_0x5ae69c['nameField']&&!_0x5ae69c[_0xa7f4('0x31')]){_0x43b6b1[_0x5ae69c['nameField'][_0xa7f4('0x32')]()]=_0x5ae69c[_0xa7f4('0x33')][_0xa7f4('0x34')]();}else if(_['includes']([_0xa7f4('0x35'),_0xa7f4('0x2f')],_0x5ae69c[_0xa7f4('0x30')])&&_0x5ae69c[_0xa7f4('0x36')]&&_0x5ae69c['customField']){_0x43b6b1[_0x5ae69c['idField'][_0xa7f4('0x32')]()]=_0x5ae69c['content'][_0xa7f4('0x34')]();}else if(_0x5ae69c[_0xa7f4('0x30')]===_0xa7f4('0x37')&&_0x5ae69c[_0xa7f4('0x38')]&&_0x5ae69c[_0xa7f4('0x36')]&&_0x5ae69c[_0xa7f4('0x31')]){_0x43b6b1[_0x5ae69c[_0xa7f4('0x36')][_0xa7f4('0x32')]()]=_0x1f8b7f[_0x5ae69c[_0xa7f4('0x38')]][_0xa7f4('0x34')]();}else if(_0x5ae69c[_0xa7f4('0x30')]===_0xa7f4('0x39')&&_0x5ae69c[_0xa7f4('0x3a')]&&_0x5ae69c[_0xa7f4('0x3a')][_0xa7f4('0x3b')]&&_0x5ae69c[_0xa7f4('0x36')]&&_0x5ae69c[_0xa7f4('0x31')]){_0x43b6b1[_0x5ae69c['idField']['toLowerCase']()]=_0x1f8b7f[_0x5ae69c[_0xa7f4('0x3a')][_0xa7f4('0x3b')][_0xa7f4('0x32')]()][_0xa7f4('0x34')]();}});}return _0x43b6b1;}function getTicket(_0x2553e2,_0x4344a2,_0x28cf44,_0x3d7531,_0x39d166,_0x49d3aa){return function(_0x95bf09){logger[_0xa7f4('0x15')]('['+[_0x2553e2[_0xa7f4('0x11')]()]+_0xa7f4('0x3c'),_0x95bf09);return new Promise(function(_0x4ba0a7,_0x2615dc){var _0x59bb69=_0x2553e2['toLowerCase']()===_0xa7f4('0x3d')?_0x95bf09[_0xa7f4('0x1d')]:_0x95bf09[_0xa7f4('0x3e')];var _0x46395a={'method':_0xa7f4('0x23'),'uri':_0x28cf44+_0xa7f4('0x3f')+'?'+_0x49d3aa,'body':Object[_0xa7f4('0x40')]({},{'active':_0xa7f4('0x1c'),'caller_id':_0x59bb69,'assigned_to':_0x95bf09['userId'],'short_description':intUtil['getString'](_0x3d7531[_0xa7f4('0x41')],_0x39d166,'\x20'),'description':intUtil[_0xa7f4('0x42')](_0x3d7531[_0xa7f4('0x43')],_0x39d166,'\x0a')},getCustomFields(_0x3d7531[_0xa7f4('0x44')],_0x39d166)),'auth':_0x4344a2,'json':!![]};return rp(_0x46395a)['then'](function(_0x345ef0){logger[_0xa7f4('0x15')]('['+[_0x2553e2[_0xa7f4('0x11')]()]+_0xa7f4('0x45'),_0x345ef0[_0xa7f4('0xf')]);_0x95bf09['ticketId']=_0x345ef0[_0xa7f4('0xf')][_0xa7f4('0x10')];_0x95bf09[_0xa7f4('0x46')]=_0x345ef0[_0xa7f4('0xf')][_0xa7f4('0x47')];logger[_0xa7f4('0x15')]('['+[_0x2553e2[_0xa7f4('0x11')]()]+_0xa7f4('0x48'),_0x95bf09);_0x4ba0a7(_0x95bf09);})[_0xa7f4('0x49')](function(_0x164ee1){logger[_0xa7f4('0x13')]('['+[_0x2553e2[_0xa7f4('0x11')]()]+']',_0x164ee1['message']);_0x2615dc(_0x164ee1[_0xa7f4('0x14')]);});});};}function createRemoteTag(_0x32c7bd,_0x37cf6c,_0x1e7131,_0x4898c3){return new Promise(function(_0x2a401d,_0x2ce1bb){var _0x5838fe={'method':_0xa7f4('0x23'),'uri':_0x1e7131+_0xa7f4('0x4a')+'?'+_0x4898c3,'body':{'short_description':_0x32c7bd,'global':!![],'active':!![],'name':_0x32c7bd},'auth':_0x37cf6c,'json':!![]};return rp(_0x5838fe)[_0xa7f4('0xe')](function(_0x5b9973){var _0x3fe9f2=_0x5b9973[_0xa7f4('0xf')][_0xa7f4('0x10')];_0x2a401d(_0x3fe9f2);});});}function getRemoteTag(_0x1fa5d2,_0x2c3f74,_0x4080a5,_0x2712e9,_0x489cd8){return new Promise(function(_0xb4c2ba,_0x3d56c0){var _0x11d550={'method':'GET','uri':_0x4080a5+'label'+'?sysparm_query=name%3D'+_0x1fa5d2+'&'+_0x2712e9,'auth':_0x2c3f74,'json':!![]};return rp(_0x11d550)[_0xa7f4('0xe')](function(_0x2b5bd4){if(_0x2b5bd4[_0xa7f4('0xf')][_0xa7f4('0x2b')]>0x0){var _0x53bef4=_0x2b5bd4[_0xa7f4('0xf')][0x0][_0xa7f4('0x10')];_0xb4c2ba(_0x53bef4);}else{return createRemoteTag(_0x1fa5d2,_0x2c3f74,_0x4080a5,_0x2712e9)['then'](function(_0x3e567c){_0xb4c2ba(_0x3e567c);});}});});}function assignTagToIncident(_0x13d24d,_0x5daf02,_0x3daa8b,_0x5a2923,_0x5ee7f5){return new Promise(function(_0xba5487,_0x56c16a){var _0x5e6784={'method':_0xa7f4('0x23'),'uri':_0x3daa8b+'label_entry'+'?'+_0x5ee7f5,'body':{'label':_0x13d24d,'table':_0xa7f4('0x3f'),'id_type':_0xa7f4('0x4b'),'table_key':_0x5a2923[_0xa7f4('0x4c')],'title':'Incident\x20-\x20'+_0x5a2923[_0xa7f4('0x46')],'id_display':_0x5a2923[_0xa7f4('0x46')]},'auth':_0x5daf02,'json':!![]};return rp(_0x5e6784)['then'](function(_0x5e7add){_0xba5487();})[_0xa7f4('0x49')](function(){_0xba5487();});});}function manageTags(_0x805f2b,_0x35a6fc,_0x22cf96,_0x192586,_0x39da37,_0x123803,_0xc9be0b){return new Promise(function(_0x5002d8,_0xef0e03){var _0x162fc7=[];_0x35a6fc[_0xa7f4('0x2d')](function(_0x2c2ecf){_0x162fc7[_0xa7f4('0x4d')](getRemoteTag(_0x2c2ecf,_0x22cf96,_0x192586,_0x123803,_0xc9be0b));});return Promise[_0xa7f4('0x4e')](_0x162fc7)[_0xa7f4('0xe')](function(_0x16bc4d){if(_0x16bc4d[_0xa7f4('0x2b')]){logger[_0xa7f4('0x15')]('['+[_0x805f2b[_0xa7f4('0x11')]()]+_0xa7f4('0x4f'),_0x16bc4d);var _0x1fa887=[];_0x16bc4d[_0xa7f4('0x2d')](function(_0x19c3e0){_0x1fa887[_0xa7f4('0x4d')](assignTagToIncident(_0x19c3e0,_0x22cf96,_0x192586,_0x39da37,_0x123803));});return Promise[_0xa7f4('0x4e')](_0x1fa887)['then'](function(){_0x5002d8();})[_0xa7f4('0x49')](function(){_0x5002d8();});}else{_0x5002d8();}});});}function getTags(_0x29df82,_0x2e4698,_0x5d619e,_0x1f1a32,_0x9af3f,_0x2a91bc){return function(_0x1c5335){return new Promise(function(_0x2dc6c6,_0x27fab6){var _0x5b4bbe=[];var _0x567504=_0x1f1a32['Tags'];if(_0x567504&&_0x567504[_0xa7f4('0x2b')]>0x0){_0x5b4bbe=_['map'](_0x567504,_0xa7f4('0x3b'));}if(_0x5b4bbe[_0xa7f4('0x2b')]>0x0){return manageTags(_0x29df82,_0x5b4bbe,_0x2e4698,_0x5d619e,_0x1c5335,_0x9af3f,_0x2a91bc)[_0xa7f4('0xe')](function(){_0x2dc6c6(_0x1c5335);});}else{_0x2dc6c6(_0x1c5335);}});};}function emit(_0xcb010a,_0x44a98f,_0x18845a){var _0x413295=_0xa7f4('0x50')+_0xa7f4('0x51')+_0xa7f4('0x52')+_0xa7f4('0x53');var _0x3559e2={'uri':_0xcb010a+_0xa7f4('0x54')+_0x18845a+_0x413295};io['to'](util[_0xa7f4('0x55')]('user:%s',_0x44a98f))[_0xa7f4('0x56')](_0xa7f4('0x57'),_0x3559e2);}exports['cs']=function(_0x355d61,_0x5c1b70,_0x549805,_0x5595a4,_0x3ffd2a,_0x281b45,_0x6ede5d,_0x2ef20f){var _0x4510f4={};var _0x586eb8={'user':_0x281b45[_0xa7f4('0x58')],'pass':_0x281b45['password']};var _0xe33fc8=_0xa7f4('0x59');var _0xa1b067='sysparm_display_value=true';_0x281b45[_0xa7f4('0x5a')]=intUtil['stripTrailingSlash'](_0x281b45[_0xa7f4('0x5a')]);_0x281b45[_0xa7f4('0x5b')]=intUtil['stripTrailingSlash'](_0x281b45[_0xa7f4('0x5b')]);var _0x20be22=util[_0xa7f4('0x55')](_0xa7f4('0x5c'),_0x281b45[_0xa7f4('0x5a')]);_0x4510f4[_0xa7f4('0x18')]=!_[_0xa7f4('0x5d')](_0x5595a4)?_0x5595a4['email']:null;_0x4510f4[_0xa7f4('0x1f')]=_0x281b45['email'];_0x4510f4[_0xa7f4('0x25')]=_0x2ef20f['toLowerCase']()===_0xa7f4('0x3d')?_0x5c1b70[_0xa7f4('0x5e')]:_0x5c1b70[_0xa7f4('0x5f')];_0x4510f4[_0xa7f4('0x60')]=_0x2ef20f===_0xa7f4('0x61')||_0x2ef20f===_0xa7f4('0x62')?_0xa7f4('0x61'):_0xa7f4('0x3d');var _0x4d34d2=util[_0xa7f4('0x55')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x281b45[_0xa7f4('0x5b')],_0x5c1b70['uniqueid'],md5(_0x5c1b70['uniqueid']));if(_0x3ffd2a&&_0x3ffd2a[_0xa7f4('0x63')]){logger[_0xa7f4('0x15')](_0xa7f4('0x64'),_0xa7f4('0x65'));_0x5c1b70['recordingURL']=_0x4d34d2;}else if(_0x6ede5d&&_0x6ede5d[_0xa7f4('0x66')]&&_0x6ede5d[_0xa7f4('0x66')]!=='none'){logger['info'](_0xa7f4('0x67'),'Recording\x20is\x20enabled!');_0x5c1b70[_0xa7f4('0x68')]=_0x4d34d2;}else{_0x5c1b70[_0xa7f4('0x68')]='';}return getAdminUser(_0x2ef20f,_0x586eb8,_0x4510f4,_0x20be22,_0xa1b067,_0xe33fc8)['then'](getUser(_0x2ef20f,_0x586eb8,_0x20be22,_0xa1b067,_0xe33fc8))[_0xa7f4('0xe')](getEndUser(_0x2ef20f,_0x586eb8,_0x20be22,_0xa1b067,_0xe33fc8))[_0xa7f4('0xe')](getTicket(_0x2ef20f,_0x586eb8,_0x20be22,_0x549805,_0x5c1b70,_0xa1b067))['then'](function(_0x5b3c49){logger[_0xa7f4('0x15')](util[_0xa7f4('0x55')](_0xa7f4('0x69'),_0x5b3c49[_0xa7f4('0x4c')]));logger[_0xa7f4('0x15')](util[_0xa7f4('0x55')](_0xa7f4('0x6a'),_0x2ef20f));if(_0x2ef20f!==_0xa7f4('0x62')){logger[_0xa7f4('0x15')]('['+[_0x2ef20f[_0xa7f4('0x11')]()]+']',_0xa7f4('0x6b'));emit(_0x281b45['remoteUri'],_0x5595a4[_0xa7f4('0x3b')],_0x5b3c49[_0xa7f4('0x4c')]);}})['catch'](function(_0x331095){logger[_0xa7f4('0x13')]('['+[_0x2ef20f[_0xa7f4('0x11')]()]+_0xa7f4('0x6c'),util['inspect'](_0x331095,{'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 2bccf01..1a6d6a1 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 _0xa1c3=['defaults','socket.io-emitter','POST','info','Creating\x20new\x20ticket...','name','getString','Subjects','assigned_user_id','created_by','description','Descriptions','date_start','toISOString','replace','duration_hours','duration_minutes','parent_id','parent_type','Contacts','parent_name','direction','length','forEach','variableName','push','idField','set_entry','JSON','Calls','Basic\x20%s','apiKey','base64','get_server_info','stringify','isNil','Getting\x20agent\x20with\x20name','get_entry_list','Employees','format','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','find','name_value_list','value','Agent\x20found!','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','phone_home','Enduser\x20found!','first_name','Enduser\x20created.','[HTTP]','merge','map','type','string','nameField','customField','toLowerCase','content','toString','custom_fields','customVariable','Variable','login','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','remoteUri','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','catch','error','recordingFormat','none','Recording\x20is\x20enabled!','destcalleridnum','Outbound','user:%s','trigger:browser:url','[OUTBOUND]','monitor_format','lastevent','toUpperCase','lodash','bluebird','md5','ioredis','./util','../../../../config/logger','sugarcrm','redis'];(function(_0x861088,_0x128d8a){var _0x476980=function(_0x55f31a){while(--_0x55f31a){_0x861088['push'](_0x861088['shift']());}};_0x476980(++_0x128d8a);}(_0xa1c3,0x1d8));var _0x3a1c=function(_0x4c1caa,_0x3b1ff1){_0x4c1caa=_0x4c1caa-0x0;var _0x465e74=_0xa1c3[_0x4c1caa];return _0x465e74;};'use strict';var _=require(_0x3a1c('0x0'));var rp=require('request-promise');var BPromise=require(_0x3a1c('0x1'));var md5=require(_0x3a1c('0x2'));var util=require('util');var Redis=require(_0x3a1c('0x3'));var intUtil=require(_0x3a1c('0x4'));var config=require('../../../../config/environment');var logger=require(_0x3a1c('0x5'))(_0x3a1c('0x6'));config[_0x3a1c('0x7')]=_[_0x3a1c('0x8')](config[_0x3a1c('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x3a1c('0x9'))(new Redis(config[_0x3a1c('0x7')]));var def={'method':_0x3a1c('0xa'),'json':!![]};function emit(_0x3e1a5e,_0x3629a2,_0x3f1b27){io['to'](_0x3e1a5e)['emit'](_0x3629a2,_0x3f1b27);}function getTicket(_0x49c673,_0x1a37c2,_0x34eb13,_0x51b2b4,_0x34a1fc,_0x59586a,_0x5070d1,_0x263809){logger[_0x3a1c('0xb')](_0x3a1c('0xc'));var _0x5d5aa9=new Date();var _0x3d2881=[{'name':_0x3a1c('0xd'),'value':intUtil[_0x3a1c('0xe')](_0x51b2b4[_0x3a1c('0xf')],_0x34a1fc,'\x20')},{'name':_0x3a1c('0x10'),'value':_0x1a37c2['id']},{'name':_0x3a1c('0x11'),'value':_0x1a37c2['id']},{'name':_0x3a1c('0x12'),'value':intUtil[_0x3a1c('0xe')](_0x51b2b4[_0x3a1c('0x13')],_0x34a1fc,'\x0a')},{'name':_0x3a1c('0x14'),'value':_0x5d5aa9[_0x3a1c('0x15')]()['slice'](0x0,0x13)[_0x3a1c('0x16')]('T','\x20')},{'name':_0x3a1c('0x17'),'value':'0'},{'name':_0x3a1c('0x18'),'value':'15'},{'name':_0x3a1c('0x19'),'value':_0x34eb13['id']},{'name':_0x3a1c('0x1a'),'value':_0x3a1c('0x1b')},{'name':_0x3a1c('0x1c'),'value':_0x34eb13['name']},{'name':_0x3a1c('0x1d'),'value':_0x263809}];if(_0x59586a[_0x3a1c('0x1e')]){_[_0x3a1c('0x1f')](_0x59586a,function(_0x3e3613){if(_0x34a1fc[_0x3e3613[_0x3a1c('0x20')]]){_0x3d2881[_0x3a1c('0x21')]({'name':_0x3e3613[_0x3a1c('0x22')],'value':_0x34a1fc[_0x3e3613['variableName']]});}});}return request({'form':{'method':_0x3a1c('0x23'),'input_type':'JSON','response_type':_0x3a1c('0x24'),'rest_data':JSON['stringify']({'session':_0x5070d1['id'],'module_name':_0x3a1c('0x25'),'name_value_list':_0x3d2881})}});}function getAuth(_0x23e21f){return util['format'](_0x3a1c('0x26'),new Buffer(_0x23e21f[_0x3a1c('0x27')]+':X')['toString'](_0x3a1c('0x28')));}function getServerInfo(_0x146ac4){return request({'form':{'method':_0x3a1c('0x29'),'input_type':_0x3a1c('0x24'),'response_type':'JSON','rest_data':JSON[_0x3a1c('0x2a')]({'session':_0x146ac4['id']})}});}function getUser(_0x36efde,_0x5a0c2f,_0x5dc43e){if(!_[_0x3a1c('0x2b')](_0x5a0c2f)){logger[_0x3a1c('0xb')](_0x3a1c('0x2c'),_0x5a0c2f);return request({'form':{'method':_0x3a1c('0x2d'),'input_type':'JSON','response_type':'JSON','rest_data':JSON['stringify']({'session':_0x5dc43e['id'],'module_name':_0x3a1c('0x2e'),'query':util[_0x3a1c('0x2f')](_0x3a1c('0x30'),_0x5a0c2f),'order_by':'','offset':'0','select_fields':['id',_0x3a1c('0xd'),_0x3a1c('0x31')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x3a1c('0x32')](function(_0x30516f){if(_0x30516f[_0x3a1c('0x33')][_0x3a1c('0x1e')]){var _0xc5e6c6=_[_0x3a1c('0x34')](_0x30516f['entry_list'],function(_0x2881c4){return _0x2881c4[_0x3a1c('0x35')][_0x3a1c('0x31')][_0x3a1c('0x36')]===_0x5a0c2f;});if(_0xc5e6c6){logger[_0x3a1c('0xb')](_0x3a1c('0x37'));return BPromise[_0x3a1c('0x38')]({'id':_0xc5e6c6[_0x3a1c('0x35')]['id'][_0x3a1c('0x36')],'name':_0xc5e6c6['name_value_list'][_0x3a1c('0xd')][_0x3a1c('0x36')]});}}logger[_0x3a1c('0xb')](_0x3a1c('0x39'));return BPromise[_0x3a1c('0x38')]({'id':_0x5dc43e['name_value_list'][_0x3a1c('0x3a')][_0x3a1c('0x36')],'name':_0x5dc43e[_0x3a1c('0x35')]['user_name'][_0x3a1c('0x36')]});});}else{logger[_0x3a1c('0xb')](_0x3a1c('0x3b'));return BPromise['resolve']({'id':_0x5dc43e[_0x3a1c('0x35')][_0x3a1c('0x3a')][_0x3a1c('0x36')],'name':_0x5dc43e[_0x3a1c('0x35')]['user_name'][_0x3a1c('0x36')]});}}function getEndUser(_0xde1daa,_0x4d3c2d,_0x1b36fb,_0x3b4384){logger['info'](_0x3a1c('0x3c'),_0x1b36fb);return request({'form':{'method':_0x3a1c('0x2d'),'input_type':'JSON','response_type':_0x3a1c('0x24'),'rest_data':JSON[_0x3a1c('0x2a')]({'session':_0x3b4384['id'],'module_name':_0x3a1c('0x1b'),'query':util[_0x3a1c('0x2f')]('contacts.phone_home\x20=\x20\x22%s\x22',_0x1b36fb),'order_by':'','offset':'0','select_fields':['id',_0x3a1c('0xd'),'phone_home'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x3a1c('0x32')](function(_0x3f37cf){if(_0x3f37cf['entry_list']['length']){var _0x526ed0=_[_0x3a1c('0x34')](_0x3f37cf[_0x3a1c('0x33')],function(_0x12924){return _0x12924['name_value_list'][_0x3a1c('0x3d')][_0x3a1c('0x36')]===_0x1b36fb;});if(_0x526ed0){logger[_0x3a1c('0xb')](_0x3a1c('0x3e'));return BPromise['resolve']({'id':_0x526ed0[_0x3a1c('0x35')]['id'][_0x3a1c('0x36')],'name':_0x526ed0[_0x3a1c('0x35')][_0x3a1c('0xd')][_0x3a1c('0x36')],'phone':_0x526ed0[_0x3a1c('0x35')][_0x3a1c('0x3d')]['value']});}}else{logger[_0x3a1c('0xb')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'form':{'method':_0x3a1c('0x23'),'input_type':_0x3a1c('0x24'),'response_type':_0x3a1c('0x24'),'rest_data':JSON[_0x3a1c('0x2a')]({'session':_0x3b4384['id'],'module_name':'Contacts','name_value_list':[{'name':_0x3a1c('0x3f'),'value':_0x4d3c2d!==''?_0x4d3c2d:util[_0x3a1c('0x2f')]('Caller\x20-\x20%s',_0x1b36fb)},{'name':'phone_home','value':_0x1b36fb}]})}})[_0x3a1c('0x32')](function(_0x1cd358){logger['info'](_0x3a1c('0x40'));return BPromise[_0x3a1c('0x38')]({'id':_0x1cd358['id'],'name':_0x1cd358[_0x3a1c('0x33')][_0x3a1c('0x3f')][_0x3a1c('0x36')],'phone':_0x1cd358[_0x3a1c('0x33')][_0x3a1c('0x3d')]['value']});});}});}function request(_0x25d5a5){logger['debug'](_0x3a1c('0x41'),JSON[_0x3a1c('0x2a')](_0x25d5a5));return rp(_[_0x3a1c('0x42')](def,_0x25d5a5));}function getTags(_0x3b72ff,_0x54c182){var _0xe5e298=[];if(_0x3b72ff&&_0x3b72ff['length']>0x0){_0xe5e298=_[_0x3a1c('0x43')](_0x3b72ff,_0x54c182);}return _0xe5e298;}function getCustomFields(_0x2e8472,_0xf7927b){var _0x15eb94=[];var _0x22f3fe={'custom_fields':[]};if(_0x2e8472[_0x3a1c('0x1e')]>0x0){_['forEach'](_0x2e8472,function(_0x93ce12){if(_0x93ce12[_0x3a1c('0x44')]===_0x3a1c('0x45')&&_0x93ce12[_0x3a1c('0x46')]&&!_0x93ce12[_0x3a1c('0x47')]){_0x22f3fe[_0x93ce12[_0x3a1c('0x46')][_0x3a1c('0x48')]()]=_0x93ce12[_0x3a1c('0x49')][_0x3a1c('0x4a')]();}else if(_0x93ce12[_0x3a1c('0x44')]===_0x3a1c('0x45')&&_0x93ce12[_0x3a1c('0x22')]&&_0x93ce12[_0x3a1c('0x47')]){_0x22f3fe[_0x3a1c('0x4b')][_0x3a1c('0x21')]({'id':_0x93ce12[_0x3a1c('0x22')],'value':_0x93ce12[_0x3a1c('0x49')][_0x3a1c('0x4a')]()});}else if(_0x93ce12[_0x3a1c('0x44')]==='variable'&&_0x93ce12[_0x3a1c('0x20')]&&_0x93ce12[_0x3a1c('0x22')]&&_0x93ce12[_0x3a1c('0x47')]){_0xf7927b[_0x93ce12[_0x3a1c('0x20')]]&&_0x22f3fe['custom_fields']['push']({'id':_0x93ce12['idField'],'value':_0xf7927b[_0x93ce12[_0x3a1c('0x20')]][_0x3a1c('0x4a')]()});}else if(_0x93ce12[_0x3a1c('0x44')]===_0x3a1c('0x4c')&&_0x93ce12['Variable']&&_0x93ce12[_0x3a1c('0x4d')]['name']&&_0x93ce12[_0x3a1c('0x22')]&&_0x93ce12[_0x3a1c('0x47')]){_0xf7927b[_0x93ce12['Variable'][_0x3a1c('0xd')][_0x3a1c('0x48')]()]&&_0x22f3fe[_0x3a1c('0x4b')][_0x3a1c('0x21')]({'id':_0x93ce12[_0x3a1c('0x22')],'value':_0xf7927b[_0x93ce12[_0x3a1c('0x4d')][_0x3a1c('0xd')][_0x3a1c('0x48')]()][_0x3a1c('0x4a')]()});}});}return _0x22f3fe;}function getConnection(_0x1082c7){return request({'method':'POST','form':{'method':_0x3a1c('0x4e'),'input_type':_0x3a1c('0x24'),'response_type':_0x3a1c('0x24'),'rest_data':JSON[_0x3a1c('0x2a')]({'user_auth':{'user_name':_0x1082c7['username'],'password':_0x1082c7[_0x3a1c('0x4f')],'encryption':_0x3a1c('0x50')},'application':_0x3a1c('0x51')})}})[_0x3a1c('0x32')](function(_0x26b62f){var _0x2a86ff=_0x26b62f;if(_0x2a86ff['id']){def[_0x3a1c('0x52')]=_0x2a86ff['id'];return BPromise[_0x3a1c('0x38')](_0x2a86ff);}else{throw new Error(util['format'](_0x3a1c('0x53'),_0x1082c7['id']));}});}function setRelationship(_0x46e309,_0x55d923,_0x17f117,_0x2d32e2){return request({'form':{'method':_0x3a1c('0x54'),'input_type':_0x3a1c('0x24'),'response_type':'JSON','rest_data':JSON[_0x3a1c('0x2a')]({'session':_0x46e309['id'],'module_name':_0x3a1c('0x25'),'module_id':_0x17f117['id'],'link_field_name':_0x2d32e2,'related_ids':[_0x55d923['id']],'name_value_list':[],'delete':0x0})}});}exports['queue']=function(_0x336dc9,_0x1ea9d0,_0x15de54,_0x5c4063,_0x323ea6,_0xed399e){var _0x3c9805,_0x2450b5,_0x2fbf33,_0x324612;_0xed399e[_0x3a1c('0x55')]=intUtil[_0x3a1c('0x56')](_0xed399e[_0x3a1c('0x55')]);_0xed399e['serverUrl']=intUtil[_0x3a1c('0x56')](_0xed399e[_0x3a1c('0x57')]);def[_0x3a1c('0x58')]=util[_0x3a1c('0x2f')](_0x3a1c('0x59'),_0xed399e['remoteUri']);if(_0x323ea6&&_0x323ea6['monitor_format']){logger[_0x3a1c('0xb')]('[QUEUE]','Recording\x20is\x20enabled!');_0x1ea9d0['recordingURL']=util[_0x3a1c('0x2f')](_0x3a1c('0x5a'),_0xed399e['serverUrl'],_0x1ea9d0['uniqueid'],md5(_0x1ea9d0[_0x3a1c('0x5b')]));}else{_0x1ea9d0[_0x3a1c('0x5c')]='';}return getConnection(_0xed399e)[_0x3a1c('0x32')](function(_0x31f871){_0x324612=_0x31f871;return getUser(_0xed399e,_0x5c4063['name'],_0x324612);})[_0x3a1c('0x32')](function(_0x36e71a){_0x3c9805=_0x36e71a;logger[_0x3a1c('0xb')](_0x3a1c('0x5d'),_0x3c9805['id']);return getEndUser(_0xed399e,_0x1ea9d0[_0x3a1c('0x5e')],_0x1ea9d0[_0x3a1c('0x5f')],_0x324612);})[_0x3a1c('0x32')](function(_0x2bb22e){_0x2450b5=_0x2bb22e;logger[_0x3a1c('0xb')](_0x3a1c('0x60'),_0x2450b5['id']);return getTicket(_0xed399e,_0x3c9805,_0x2450b5,_0x15de54,_0x1ea9d0,_0x15de54[_0x3a1c('0x61')],_0x324612,_0x3a1c('0x62'));})[_0x3a1c('0x32')](function(_0x2f6e21){_0x2fbf33=_0x2f6e21;logger['info'](_0x3a1c('0x63'));logger[_0x3a1c('0xb')](_0x3a1c('0x64'),_0x2fbf33['id']);return setRelationship(_0x324612,_0x3c9805,_0x2fbf33,_0x3a1c('0x65'));})[_0x3a1c('0x32')](function(){return setRelationship(_0x324612,_0x2450b5,_0x2fbf33,_0x3a1c('0x66'));})['then'](function(){return getServerInfo(_0x324612);})[_0x3a1c('0x32')](function(_0x2cb266){var _0x3aaa11=parseInt(_0x2cb266[_0x3a1c('0x67')][_0x3a1c('0x68')](0x0));var _0xc8f8ae=util[_0x3a1c('0x2f')](_0x3a1c('0x69'),_0xed399e[_0x3a1c('0x55')],_0x2fbf33['id']);if(_0x3aaa11>0x6){_0xc8f8ae=util[_0x3a1c('0x2f')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0xed399e[_0x3a1c('0x55')],_0x2fbf33['id']);}logger[_0x3a1c('0xb')]('[QUEUE]',_0x3a1c('0x6a'));emit(util[_0x3a1c('0x2f')]('user:%s',_0x5c4063['name']),'trigger:browser:url',{'uri':_0xc8f8ae});})[_0x3a1c('0x6b')](function(_0x2d1f0a){logger[_0x3a1c('0x6c')]('[QUEUE]',JSON[_0x3a1c('0x2a')](_0x2d1f0a));});};exports['outbound']=function(_0x280008,_0x49b6e6,_0x566027,_0x5e42c3,_0x2d87b1,_0x4a9d49,_0x59a013){var _0x49eba5,_0x196c6c,_0x179111,_0x1227fa;_0x4a9d49[_0x3a1c('0x55')]=intUtil[_0x3a1c('0x56')](_0x4a9d49[_0x3a1c('0x55')]);_0x4a9d49[_0x3a1c('0x57')]=intUtil[_0x3a1c('0x56')](_0x4a9d49[_0x3a1c('0x57')]);def[_0x3a1c('0x58')]=util['format'](_0x3a1c('0x59'),_0x4a9d49[_0x3a1c('0x55')]);if(_0x59a013&&_0x59a013[_0x3a1c('0x6d')]&&_0x59a013[_0x3a1c('0x6d')]!==_0x3a1c('0x6e')){logger[_0x3a1c('0xb')]('[OUTBOUND]',_0x3a1c('0x6f'));_0x49b6e6[_0x3a1c('0x5c')]=util['format'](_0x3a1c('0x5a'),_0x4a9d49[_0x3a1c('0x57')],_0x49b6e6[_0x3a1c('0x5b')],md5(_0x49b6e6[_0x3a1c('0x5b')]));}return getConnection(_0x4a9d49)[_0x3a1c('0x32')](function(_0x46c16d){_0x1227fa=_0x46c16d;return getUser(_0x4a9d49,_0x5e42c3[_0x3a1c('0xd')],_0x1227fa);})[_0x3a1c('0x32')](function(_0x136050){_0x49eba5=_0x136050;logger[_0x3a1c('0xb')](_0x3a1c('0x5d'),_0x49eba5['id']);return getEndUser(_0x4a9d49,_0x49b6e6['destcalleridname'],_0x49b6e6[_0x3a1c('0x70')],_0x1227fa);})[_0x3a1c('0x32')](function(_0x3af715){_0x196c6c=_0x3af715;logger[_0x3a1c('0xb')](_0x3a1c('0x60'),_0x196c6c['id']);return getTicket(_0x4a9d49,_0x49eba5,_0x196c6c,_0x566027,_0x49b6e6,_0x566027[_0x3a1c('0x61')],_0x1227fa,_0x3a1c('0x71'));})[_0x3a1c('0x32')](function(_0xbabae3){_0x179111=_0xbabae3;logger[_0x3a1c('0xb')](_0x3a1c('0x63'));logger['info'](_0x3a1c('0x64'),_0x179111['id']);return setRelationship(_0x1227fa,_0x49eba5,_0x179111,_0x3a1c('0x65'));})[_0x3a1c('0x32')](function(){return setRelationship(_0x1227fa,_0x196c6c,_0x179111,_0x3a1c('0x66'));})[_0x3a1c('0x32')](function(){return getServerInfo(_0x1227fa);})[_0x3a1c('0x32')](function(_0x531a7f){var _0x31544b=parseInt(_0x531a7f[_0x3a1c('0x67')][_0x3a1c('0x68')](0x0));var _0x5ce71b=util[_0x3a1c('0x2f')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x4a9d49['remoteUri'],_0x179111['id']);if(_0x31544b>0x6){_0x5ce71b=util[_0x3a1c('0x2f')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x4a9d49['remoteUri'],_0x179111['id']);}logger['info']('[OUTBOUND]',_0x3a1c('0x6a'));emit(util[_0x3a1c('0x2f')](_0x3a1c('0x72'),_0x5e42c3['name']),_0x3a1c('0x73'),{'uri':_0x5ce71b});})[_0x3a1c('0x6b')](function(_0x50d6c8){logger[_0x3a1c('0x6c')](_0x3a1c('0x74'),JSON[_0x3a1c('0x2a')](_0x50d6c8));});};exports['unmanaged']=function(_0x4ccd55,_0x97e9f4,_0x745499,_0xc3cb5a,_0x57b772,_0xf44e8f){var _0x1d97d1,_0x44c1a2,_0x22d4ac,_0x5baf2f;_0xf44e8f[_0x3a1c('0x55')]=intUtil['stripTrailingSlash'](_0xf44e8f[_0x3a1c('0x55')]);_0xf44e8f[_0x3a1c('0x57')]=intUtil[_0x3a1c('0x56')](_0xf44e8f[_0x3a1c('0x57')]);def[_0x3a1c('0x58')]=util['format'](_0x3a1c('0x59'),_0xf44e8f['remoteUri']);if(_0x57b772&&_0x57b772[_0x3a1c('0x75')]){logger['info']('['+_0x97e9f4[_0x3a1c('0x76')][_0x3a1c('0x77')]()+']',_0x3a1c('0x6f'));_0x97e9f4['recordingURL']=util[_0x3a1c('0x2f')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xf44e8f[_0x3a1c('0x57')],_0x97e9f4[_0x3a1c('0x5b')],md5(_0x97e9f4[_0x3a1c('0x5b')]));}else{_0x97e9f4[_0x3a1c('0x5c')]='';}return getConnection(_0xf44e8f)['then'](function(_0x1ee8fa){_0x5baf2f=_0x1ee8fa;if(!_['isNil'](_0xc3cb5a)){return getUser(_0xf44e8f,_0xc3cb5a['name'],_0x5baf2f);}else{return getUser(_0xf44e8f,null,_0x5baf2f);}})['then'](function(_0x385030){_0x1d97d1=_0x385030;logger['info'](_0x3a1c('0x5d'),_0x1d97d1['id']);return getEndUser(_0xf44e8f,_0x97e9f4['calleridname'],_0x97e9f4[_0x3a1c('0x5f')],_0x5baf2f);})[_0x3a1c('0x32')](function(_0x245924){_0x44c1a2=_0x245924;logger[_0x3a1c('0xb')](_0x3a1c('0x60'),_0x44c1a2['id']);return getTicket(_0xf44e8f,_0x1d97d1,_0x44c1a2,_0x745499,_0x97e9f4,_0x745499[_0x3a1c('0x61')],_0x5baf2f,_0x3a1c('0x62'));})[_0x3a1c('0x32')](function(_0x28108c){_0x22d4ac=_0x28108c;logger[_0x3a1c('0xb')]('Ticket\x20created!');logger[_0x3a1c('0xb')]('The\x20Ticket\x20ID\x20is:',_0x22d4ac['id']);return setRelationship(_0x5baf2f,_0x1d97d1,_0x22d4ac,'users');})['then'](function(){return setRelationship(_0x5baf2f,_0x44c1a2,_0x22d4ac,_0x3a1c('0x66'));})['then'](function(){return getServerInfo(_0x5baf2f);})['catch'](function(_0x213902){logger['error']('['+_0x97e9f4[_0x3a1c('0x76')][_0x3a1c('0x77')]()+']',JSON[_0x3a1c('0x2a')](_0x213902));});}; \ No newline at end of file +var _0x3958=['name_value_list','Agent\x20found!','resolve','value','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','user_name','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Contacts','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','first_name','','Caller\x20-\x20%s','Enduser\x20created.','debug','[HTTP]','merge','map','forEach','type','string','nameField','customField','content','custom_fields','variable','idField','Variable','toLowerCase','login','password','PLAIN','sessionID','Account\x20%d\x20is\x20not\x20valid','queue','stripTrailingSlash','serverUrl','uri','remoteUri','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridname','calleridnum','Inbound','Ticket\x20created!','users','version','charAt','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','catch','outbound','%s/service/v4_1/rest.php','recordingFormat','recordingURL','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','Fields','Outbound','The\x20Ticket\x20ID\x20is:','contacts','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','error','lastevent','toUpperCase','The\x20User\x20ID\x20is:','request-promise','bluebird','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','POST','emit','info','Creating\x20new\x20ticket...','name','getString','Subjects','assigned_user_id','created_by','description','Descriptions','toISOString','slice','replace','duration_hours','duration_minutes','parent_id','parent_type','parent_name','direction','length','variableName','push','set_entry','JSON','stringify','Calls','format','toString','base64','get_server_info','isNil','Getting\x20agent\x20with\x20name','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','then','entry_list','find'];(function(_0x40c849,_0xbc22a1){var _0x7d3bef=function(_0x23df0c){while(--_0x23df0c){_0x40c849['push'](_0x40c849['shift']());}};_0x7d3bef(++_0xbc22a1);}(_0x3958,0x140));var _0x8395=function(_0x5ede82,_0x4754bc){_0x5ede82=_0x5ede82-0x0;var _0x57c35c=_0x3958[_0x5ede82];return _0x57c35c;};'use strict';var _=require('lodash');var rp=require(_0x8395('0x0'));var BPromise=require(_0x8395('0x1'));var md5=require('md5');var util=require('util');var Redis=require(_0x8395('0x2'));var intUtil=require(_0x8395('0x3'));var config=require(_0x8395('0x4'));var logger=require(_0x8395('0x5'))('sugarcrm');config[_0x8395('0x6')]=_[_0x8395('0x7')](config['redis'],{'host':_0x8395('0x8'),'port':0x18eb});var io=require(_0x8395('0x9'))(new Redis(config[_0x8395('0x6')]));var def={'method':_0x8395('0xa'),'json':!![]};function emit(_0x326c4d,_0x5b0820,_0x818295){io['to'](_0x326c4d)[_0x8395('0xb')](_0x5b0820,_0x818295);}function getTicket(_0x144440,_0x55a6c0,_0xb2a42c,_0x46ac88,_0x36d0f0,_0x323c40,_0x385faf,_0x1255ad){logger[_0x8395('0xc')](_0x8395('0xd'));var _0x2e9d75=new Date();var _0x178da4=[{'name':_0x8395('0xe'),'value':intUtil[_0x8395('0xf')](_0x46ac88[_0x8395('0x10')],_0x36d0f0,'\x20')},{'name':_0x8395('0x11'),'value':_0x55a6c0['id']},{'name':_0x8395('0x12'),'value':_0x55a6c0['id']},{'name':_0x8395('0x13'),'value':intUtil[_0x8395('0xf')](_0x46ac88[_0x8395('0x14')],_0x36d0f0,'\x0a')},{'name':'date_start','value':_0x2e9d75[_0x8395('0x15')]()[_0x8395('0x16')](0x0,0x13)[_0x8395('0x17')]('T','\x20')},{'name':_0x8395('0x18'),'value':'0'},{'name':_0x8395('0x19'),'value':'15'},{'name':_0x8395('0x1a'),'value':_0xb2a42c['id']},{'name':_0x8395('0x1b'),'value':'Contacts'},{'name':_0x8395('0x1c'),'value':_0xb2a42c['name']},{'name':_0x8395('0x1d'),'value':_0x1255ad}];if(_0x323c40[_0x8395('0x1e')]){_['forEach'](_0x323c40,function(_0x4a88b1){if(_0x36d0f0[_0x4a88b1[_0x8395('0x1f')]]){_0x178da4[_0x8395('0x20')]({'name':_0x4a88b1['idField'],'value':_0x36d0f0[_0x4a88b1['variableName']]});}});}return request({'form':{'method':_0x8395('0x21'),'input_type':_0x8395('0x22'),'response_type':_0x8395('0x22'),'rest_data':JSON[_0x8395('0x23')]({'session':_0x385faf['id'],'module_name':_0x8395('0x24'),'name_value_list':_0x178da4})}});}function getAuth(_0x32c66e){return util[_0x8395('0x25')]('Basic\x20%s',new Buffer(_0x32c66e['apiKey']+':X')[_0x8395('0x26')](_0x8395('0x27')));}function getServerInfo(_0x5a3d5a){return request({'form':{'method':_0x8395('0x28'),'input_type':_0x8395('0x22'),'response_type':_0x8395('0x22'),'rest_data':JSON[_0x8395('0x23')]({'session':_0x5a3d5a['id']})}});}function getUser(_0x3e6030,_0x20be61,_0x49577f){if(!_[_0x8395('0x29')](_0x20be61)){logger['info'](_0x8395('0x2a'),_0x20be61);return request({'form':{'method':_0x8395('0x2b'),'input_type':'JSON','response_type':_0x8395('0x22'),'rest_data':JSON[_0x8395('0x23')]({'session':_0x49577f['id'],'module_name':_0x8395('0x2c'),'query':util[_0x8395('0x25')](_0x8395('0x2d'),_0x20be61),'order_by':'','offset':'0','select_fields':['id',_0x8395('0xe'),'user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x8395('0x2e')](function(_0x37f3f7){if(_0x37f3f7[_0x8395('0x2f')][_0x8395('0x1e')]){var _0x3f777e=_[_0x8395('0x30')](_0x37f3f7[_0x8395('0x2f')],function(_0x3415fb){return _0x3415fb[_0x8395('0x31')]['user_name']['value']===_0x20be61;});if(_0x3f777e){logger['info'](_0x8395('0x32'));return BPromise[_0x8395('0x33')]({'id':_0x3f777e[_0x8395('0x31')]['id'][_0x8395('0x34')],'name':_0x3f777e[_0x8395('0x31')][_0x8395('0xe')][_0x8395('0x34')]});}}logger[_0x8395('0xc')](_0x8395('0x35'));return BPromise['resolve']({'id':_0x49577f['name_value_list'][_0x8395('0x36')][_0x8395('0x34')],'name':_0x49577f[_0x8395('0x31')][_0x8395('0x37')][_0x8395('0x34')]});});}else{logger['info'](_0x8395('0x38'));return BPromise['resolve']({'id':_0x49577f[_0x8395('0x31')]['user_id'][_0x8395('0x34')],'name':_0x49577f['name_value_list']['user_name']['value']});}}function getEndUser(_0x1cba85,_0x360db1,_0x2cae98,_0x28a0c7){logger[_0x8395('0xc')]('Searching\x20enduser\x20with\x20phone',_0x2cae98);return request({'form':{'method':_0x8395('0x2b'),'input_type':'JSON','response_type':_0x8395('0x22'),'rest_data':JSON[_0x8395('0x23')]({'session':_0x28a0c7['id'],'module_name':_0x8395('0x39'),'query':util[_0x8395('0x25')](_0x8395('0x3a'),_0x2cae98),'order_by':'','offset':'0','select_fields':['id',_0x8395('0xe'),_0x8395('0x3b')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x8395('0x2e')](function(_0x200fbf){if(_0x200fbf[_0x8395('0x2f')][_0x8395('0x1e')]){var _0xa4e8db=_[_0x8395('0x30')](_0x200fbf[_0x8395('0x2f')],function(_0x1a6f1c){return _0x1a6f1c['name_value_list'][_0x8395('0x3b')][_0x8395('0x34')]===_0x2cae98;});if(_0xa4e8db){logger['info']('Enduser\x20found!');return BPromise[_0x8395('0x33')]({'id':_0xa4e8db[_0x8395('0x31')]['id'][_0x8395('0x34')],'name':_0xa4e8db['name_value_list']['name']['value'],'phone':_0xa4e8db['name_value_list'][_0x8395('0x3b')][_0x8395('0x34')]});}}else{logger[_0x8395('0xc')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'form':{'method':_0x8395('0x21'),'input_type':_0x8395('0x22'),'response_type':_0x8395('0x22'),'rest_data':JSON[_0x8395('0x23')]({'session':_0x28a0c7['id'],'module_name':_0x8395('0x39'),'name_value_list':[{'name':_0x8395('0x3c'),'value':_0x360db1!==_0x8395('0x3d')?_0x360db1:util[_0x8395('0x25')](_0x8395('0x3e'),_0x2cae98)},{'name':_0x8395('0x3b'),'value':_0x2cae98}]})}})[_0x8395('0x2e')](function(_0x352265){logger[_0x8395('0xc')](_0x8395('0x3f'));return BPromise['resolve']({'id':_0x352265['id'],'name':_0x352265[_0x8395('0x2f')][_0x8395('0x3c')][_0x8395('0x34')],'phone':_0x352265[_0x8395('0x2f')][_0x8395('0x3b')][_0x8395('0x34')]});});}});}function request(_0x4c5a7a){logger[_0x8395('0x40')](_0x8395('0x41'),JSON[_0x8395('0x23')](_0x4c5a7a));return rp(_[_0x8395('0x42')](def,_0x4c5a7a));}function getTags(_0x3d5fdc,_0x11d7fb){var _0x1ee4b2=[];if(_0x3d5fdc&&_0x3d5fdc['length']>0x0){_0x1ee4b2=_[_0x8395('0x43')](_0x3d5fdc,_0x11d7fb);}return _0x1ee4b2;}function getCustomFields(_0x2de832,_0x2ab2cd){var _0x10ec35=[];var _0x1378e9={'custom_fields':[]};if(_0x2de832[_0x8395('0x1e')]>0x0){_[_0x8395('0x44')](_0x2de832,function(_0xe47dfa){if(_0xe47dfa[_0x8395('0x45')]===_0x8395('0x46')&&_0xe47dfa[_0x8395('0x47')]&&!_0xe47dfa[_0x8395('0x48')]){_0x1378e9[_0xe47dfa[_0x8395('0x47')]['toLowerCase']()]=_0xe47dfa[_0x8395('0x49')][_0x8395('0x26')]();}else if(_0xe47dfa[_0x8395('0x45')]===_0x8395('0x46')&&_0xe47dfa['idField']&&_0xe47dfa[_0x8395('0x48')]){_0x1378e9[_0x8395('0x4a')]['push']({'id':_0xe47dfa['idField'],'value':_0xe47dfa['content'][_0x8395('0x26')]()});}else if(_0xe47dfa['type']===_0x8395('0x4b')&&_0xe47dfa[_0x8395('0x1f')]&&_0xe47dfa[_0x8395('0x4c')]&&_0xe47dfa[_0x8395('0x48')]){_0x2ab2cd[_0xe47dfa[_0x8395('0x1f')]]&&_0x1378e9[_0x8395('0x4a')][_0x8395('0x20')]({'id':_0xe47dfa['idField'],'value':_0x2ab2cd[_0xe47dfa['variableName']]['toString']()});}else if(_0xe47dfa[_0x8395('0x45')]==='customVariable'&&_0xe47dfa[_0x8395('0x4d')]&&_0xe47dfa[_0x8395('0x4d')]['name']&&_0xe47dfa[_0x8395('0x4c')]&&_0xe47dfa['customField']){_0x2ab2cd[_0xe47dfa[_0x8395('0x4d')][_0x8395('0xe')]['toLowerCase']()]&&_0x1378e9[_0x8395('0x4a')]['push']({'id':_0xe47dfa['idField'],'value':_0x2ab2cd[_0xe47dfa[_0x8395('0x4d')][_0x8395('0xe')][_0x8395('0x4e')]()][_0x8395('0x26')]()});}});}return _0x1378e9;}function getConnection(_0x152fde){return request({'method':_0x8395('0xa'),'form':{'method':_0x8395('0x4f'),'input_type':_0x8395('0x22'),'response_type':_0x8395('0x22'),'rest_data':JSON[_0x8395('0x23')]({'user_auth':{'user_name':_0x152fde['username'],'password':_0x152fde[_0x8395('0x50')],'encryption':_0x8395('0x51')},'application':'xCALLY\x20Motion\x20integration'})}})[_0x8395('0x2e')](function(_0x53fd73){var _0x3b6fa2=_0x53fd73;if(_0x3b6fa2['id']){def[_0x8395('0x52')]=_0x3b6fa2['id'];return BPromise[_0x8395('0x33')](_0x3b6fa2);}else{throw new Error(util['format'](_0x8395('0x53'),_0x152fde['id']));}});}function setRelationship(_0x19f469,_0x18a895,_0x29984e,_0x3d2cc1){return request({'form':{'method':'set_relationship','input_type':_0x8395('0x22'),'response_type':_0x8395('0x22'),'rest_data':JSON[_0x8395('0x23')]({'session':_0x19f469['id'],'module_name':'Calls','module_id':_0x29984e['id'],'link_field_name':_0x3d2cc1,'related_ids':[_0x18a895['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x8395('0x54')]=function(_0x37f6f5,_0x1d38dd,_0x4acc24,_0x33a96d,_0x4fda60,_0xf3f05a){var _0xf0d050,_0x42ff8d,_0x113ba2,_0x4a4dcc;_0xf3f05a['remoteUri']=intUtil[_0x8395('0x55')](_0xf3f05a['remoteUri']);_0xf3f05a['serverUrl']=intUtil[_0x8395('0x55')](_0xf3f05a[_0x8395('0x56')]);def[_0x8395('0x57')]=util[_0x8395('0x25')]('%s/service/v4_1/rest.php',_0xf3f05a[_0x8395('0x58')]);if(_0x4fda60&&_0x4fda60[_0x8395('0x59')]){logger[_0x8395('0xc')](_0x8395('0x5a'),_0x8395('0x5b'));_0x1d38dd['recordingURL']=util[_0x8395('0x25')](_0x8395('0x5c'),_0xf3f05a[_0x8395('0x56')],_0x1d38dd[_0x8395('0x5d')],md5(_0x1d38dd[_0x8395('0x5d')]));}else{_0x1d38dd['recordingURL']='';}return getConnection(_0xf3f05a)['then'](function(_0x276d54){_0x4a4dcc=_0x276d54;return getUser(_0xf3f05a,_0x33a96d[_0x8395('0xe')],_0x4a4dcc);})[_0x8395('0x2e')](function(_0x2b38ee){_0xf0d050=_0x2b38ee;logger[_0x8395('0xc')]('The\x20User\x20ID\x20is:',_0xf0d050['id']);return getEndUser(_0xf3f05a,_0x1d38dd[_0x8395('0x5e')],_0x1d38dd[_0x8395('0x5f')],_0x4a4dcc);})['then'](function(_0x1b9d21){_0x42ff8d=_0x1b9d21;logger[_0x8395('0xc')]('The\x20Enduser\x20ID\x20is:',_0x42ff8d['id']);return getTicket(_0xf3f05a,_0xf0d050,_0x42ff8d,_0x4acc24,_0x1d38dd,_0x4acc24['Fields'],_0x4a4dcc,_0x8395('0x60'));})[_0x8395('0x2e')](function(_0x108562){_0x113ba2=_0x108562;logger[_0x8395('0xc')](_0x8395('0x61'));logger[_0x8395('0xc')]('The\x20Ticket\x20ID\x20is:',_0x113ba2['id']);return setRelationship(_0x4a4dcc,_0xf0d050,_0x113ba2,_0x8395('0x62'));})[_0x8395('0x2e')](function(){return setRelationship(_0x4a4dcc,_0x42ff8d,_0x113ba2,'contacts');})[_0x8395('0x2e')](function(){return getServerInfo(_0x4a4dcc);})[_0x8395('0x2e')](function(_0x43387b){var _0x48e328=parseInt(_0x43387b[_0x8395('0x63')][_0x8395('0x64')](0x0));var _0x3ad6f0=util[_0x8395('0x25')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0xf3f05a[_0x8395('0x58')],_0x113ba2['id']);if(_0x48e328>0x6){_0x3ad6f0=util[_0x8395('0x25')](_0x8395('0x65'),_0xf3f05a[_0x8395('0x58')],_0x113ba2['id']);}logger[_0x8395('0xc')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format']('user:%s',_0x33a96d[_0x8395('0xe')]),'trigger:browser:url',{'uri':_0x3ad6f0});})[_0x8395('0x66')](function(_0x195692){logger['error'](_0x8395('0x5a'),JSON['stringify'](_0x195692));});};exports[_0x8395('0x67')]=function(_0x39b679,_0x26b1a0,_0x384ce3,_0x4322d8,_0x302190,_0x5b4716,_0xb67cbc){var _0x55485e,_0x40f37c,_0x43a200,_0x54efdb;_0x5b4716['remoteUri']=intUtil['stripTrailingSlash'](_0x5b4716[_0x8395('0x58')]);_0x5b4716[_0x8395('0x56')]=intUtil[_0x8395('0x55')](_0x5b4716[_0x8395('0x56')]);def[_0x8395('0x57')]=util['format'](_0x8395('0x68'),_0x5b4716[_0x8395('0x58')]);if(_0xb67cbc&&_0xb67cbc[_0x8395('0x69')]&&_0xb67cbc[_0x8395('0x69')]!=='none'){logger['info']('[OUTBOUND]',_0x8395('0x5b'));_0x26b1a0[_0x8395('0x6a')]=util[_0x8395('0x25')](_0x8395('0x5c'),_0x5b4716[_0x8395('0x56')],_0x26b1a0[_0x8395('0x5d')],md5(_0x26b1a0[_0x8395('0x5d')]));}return getConnection(_0x5b4716)[_0x8395('0x2e')](function(_0x47b00e){_0x54efdb=_0x47b00e;return getUser(_0x5b4716,_0x4322d8[_0x8395('0xe')],_0x54efdb);})[_0x8395('0x2e')](function(_0x6eae58){_0x55485e=_0x6eae58;logger[_0x8395('0xc')]('The\x20User\x20ID\x20is:',_0x55485e['id']);return getEndUser(_0x5b4716,_0x26b1a0[_0x8395('0x6b')],_0x26b1a0[_0x8395('0x6c')],_0x54efdb);})[_0x8395('0x2e')](function(_0x52faaf){_0x40f37c=_0x52faaf;logger[_0x8395('0xc')](_0x8395('0x6d'),_0x40f37c['id']);return getTicket(_0x5b4716,_0x55485e,_0x40f37c,_0x384ce3,_0x26b1a0,_0x384ce3[_0x8395('0x6e')],_0x54efdb,_0x8395('0x6f'));})[_0x8395('0x2e')](function(_0x333aa0){_0x43a200=_0x333aa0;logger[_0x8395('0xc')]('Ticket\x20created!');logger[_0x8395('0xc')](_0x8395('0x70'),_0x43a200['id']);return setRelationship(_0x54efdb,_0x55485e,_0x43a200,_0x8395('0x62'));})['then'](function(){return setRelationship(_0x54efdb,_0x40f37c,_0x43a200,_0x8395('0x71'));})[_0x8395('0x2e')](function(){return getServerInfo(_0x54efdb);})[_0x8395('0x2e')](function(_0x289325){var _0x2f9260=parseInt(_0x289325[_0x8395('0x63')][_0x8395('0x64')](0x0));var _0x3749a1=util[_0x8395('0x25')](_0x8395('0x72'),_0x5b4716[_0x8395('0x58')],_0x43a200['id']);if(_0x2f9260>0x6){_0x3749a1=util['format']('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x5b4716[_0x8395('0x58')],_0x43a200['id']);}logger['info'](_0x8395('0x73'),_0x8395('0x74'));emit(util[_0x8395('0x25')](_0x8395('0x75'),_0x4322d8['name']),_0x8395('0x76'),{'uri':_0x3749a1});})['catch'](function(_0x3b5e74){logger[_0x8395('0x77')](_0x8395('0x73'),JSON[_0x8395('0x23')](_0x3b5e74));});};exports['unmanaged']=function(_0x3b5b33,_0x4b7862,_0x126a35,_0x4985d7,_0x9c6392,_0x47e409){var _0x4cc6db,_0x343dfb,_0x3043b9,_0x41e17b;_0x47e409[_0x8395('0x58')]=intUtil[_0x8395('0x55')](_0x47e409['remoteUri']);_0x47e409[_0x8395('0x56')]=intUtil[_0x8395('0x55')](_0x47e409[_0x8395('0x56')]);def[_0x8395('0x57')]=util['format'](_0x8395('0x68'),_0x47e409[_0x8395('0x58')]);if(_0x9c6392&&_0x9c6392[_0x8395('0x59')]){logger[_0x8395('0xc')]('['+_0x4b7862[_0x8395('0x78')][_0x8395('0x79')]()+']',_0x8395('0x5b'));_0x4b7862[_0x8395('0x6a')]=util[_0x8395('0x25')](_0x8395('0x5c'),_0x47e409[_0x8395('0x56')],_0x4b7862[_0x8395('0x5d')],md5(_0x4b7862[_0x8395('0x5d')]));}else{_0x4b7862[_0x8395('0x6a')]='';}return getConnection(_0x47e409)['then'](function(_0x30e7f9){_0x41e17b=_0x30e7f9;if(!_[_0x8395('0x29')](_0x4985d7)){return getUser(_0x47e409,_0x4985d7[_0x8395('0xe')],_0x41e17b);}else{return getUser(_0x47e409,null,_0x41e17b);}})[_0x8395('0x2e')](function(_0x2b99c0){_0x4cc6db=_0x2b99c0;logger[_0x8395('0xc')](_0x8395('0x7a'),_0x4cc6db['id']);return getEndUser(_0x47e409,_0x4b7862[_0x8395('0x5e')],_0x4b7862[_0x8395('0x5f')],_0x41e17b);})[_0x8395('0x2e')](function(_0x11e172){_0x343dfb=_0x11e172;logger[_0x8395('0xc')](_0x8395('0x6d'),_0x343dfb['id']);return getTicket(_0x47e409,_0x4cc6db,_0x343dfb,_0x126a35,_0x4b7862,_0x126a35['Fields'],_0x41e17b,'Inbound');})[_0x8395('0x2e')](function(_0x212a42){_0x3043b9=_0x212a42;logger['info'](_0x8395('0x61'));logger['info'](_0x8395('0x70'),_0x3043b9['id']);return setRelationship(_0x41e17b,_0x4cc6db,_0x3043b9,'users');})[_0x8395('0x2e')](function(){return setRelationship(_0x41e17b,_0x343dfb,_0x3043b9,_0x8395('0x71'));})['then'](function(){return getServerInfo(_0x41e17b);})[_0x8395('0x66')](function(_0x47d0f1){logger[_0x8395('0x77')]('['+_0x4b7862[_0x8395('0x78')][_0x8395('0x79')]()+']',JSON[_0x8395('0x23')](_0x47d0f1));});}; \ 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 e5a0780..70a30de 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 _0x37b2=['keyType','format','key','keyContent','%s:\x20%s','customVariable','lastIndexOf','validateEmail','isNil','test','lodash','util','getString','length','type','string','push','content','variable','variableName','toString','Variable','name','toLowerCase','keyValue'];(function(_0x1c85ef,_0x51e609){var _0x2ed48b=function(_0x4ab011){while(--_0x4ab011){_0x1c85ef['push'](_0x1c85ef['shift']());}};_0x2ed48b(++_0x51e609);}(_0x37b2,0x136));var _0x237b=function(_0x5e0914,_0x481afe){_0x5e0914=_0x5e0914-0x0;var _0x5eebff=_0x37b2[_0x5e0914];return _0x5eebff;};'use strict';var _=require(_0x237b('0x0'));var util=require(_0x237b('0x1'));exports[_0x237b('0x2')]=function(_0x21a648,_0x304fca,_0x12c65b){var _0x59dfaa=[];if(_0x21a648[_0x237b('0x3')]>0x0){var _0x4b5e0b=_['sortBy'](_0x21a648,['id']);for(var _0x1544ac=0x0;_0x1544ac<_0x4b5e0b[_0x237b('0x3')];_0x1544ac++){var _0x3a60e9=_0x4b5e0b[_0x1544ac];if(_0x3a60e9[_0x237b('0x4')]===_0x237b('0x5')){_0x59dfaa[_0x237b('0x6')](_0x3a60e9[_0x237b('0x7')]);}else if(_0x3a60e9[_0x237b('0x4')]===_0x237b('0x8')&&_0x3a60e9['variableName']){_0x304fca[_0x3a60e9[_0x237b('0x9')]]&&_0x59dfaa[_0x237b('0x6')](_0x304fca[_0x3a60e9[_0x237b('0x9')]][_0x237b('0xa')]());}else if(_0x3a60e9[_0x237b('0x4')]==='customVariable'&&_0x3a60e9[_0x237b('0xb')]&&_0x3a60e9[_0x237b('0xb')][_0x237b('0xc')]){_0x304fca[_0x3a60e9['Variable'][_0x237b('0xc')]['toLowerCase']()]&&_0x59dfaa[_0x237b('0x6')](_0x304fca[_0x3a60e9[_0x237b('0xb')][_0x237b('0xc')][_0x237b('0xd')]()][_0x237b('0xa')]());}else if(_0x3a60e9['type']===_0x237b('0xe')){if(_0x3a60e9[_0x237b('0xf')]===_0x237b('0x5')&&_0x3a60e9['key']){_0x59dfaa[_0x237b('0x6')](util[_0x237b('0x10')]('%s:\x20%s',_0x3a60e9[_0x237b('0x11')],_0x3a60e9[_0x237b('0x12')]));}else if(_0x3a60e9[_0x237b('0xf')]===_0x237b('0x8')&&_0x3a60e9[_0x237b('0x9')]&&_0x3a60e9[_0x237b('0x11')]){_0x304fca[_0x3a60e9[_0x237b('0x9')]]&&_0x59dfaa['push'](util[_0x237b('0x10')](_0x237b('0x13'),_0x3a60e9[_0x237b('0x11')],_0x304fca[_0x3a60e9['variableName']]));}else if(_0x3a60e9[_0x237b('0xf')]===_0x237b('0x14')&&_0x3a60e9[_0x237b('0xb')]&&_0x3a60e9[_0x237b('0xb')]['name']&&_0x3a60e9['key']){_0x304fca[_0x3a60e9[_0x237b('0xb')][_0x237b('0xc')][_0x237b('0xd')]()]&&_0x59dfaa[_0x237b('0x6')](util[_0x237b('0x10')]('%s:\x20%s',_0x3a60e9[_0x237b('0x11')],_0x304fca[_0x3a60e9[_0x237b('0xb')]['name'][_0x237b('0xd')]()]));}}}}return _0x59dfaa['join'](_0x12c65b);};exports['stripTrailingSlash']=function(_0x44ae37){var _0x589e75=_0x44ae37['slice'](-0x1);if(_0x589e75==='/'){_0x44ae37=_0x44ae37['substring'](0x0,_0x44ae37[_0x237b('0x15')](_0x589e75));}return _0x44ae37;};exports[_0x237b('0x16')]=function(_0x5f3419){if(!_[_0x237b('0x17')](_0x5f3419)&&_0x5f3419!==''){var _0x4e51b9=/^(([^<>()\[\]\\.,;:\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 _0x4e51b9[_0x237b('0x18')](String(_0x5f3419)[_0x237b('0xd')]());}else{return![];}}; \ No newline at end of file +var _0x51f4=['getString','length','sortBy','type','string','push','content','variable','variableName','toString','customVariable','Variable','name','toLowerCase','keyValue','keyType','key','format','%s:\x20%s','stripTrailingSlash','slice','substring','lastIndexOf','isNil','test','lodash','util'];(function(_0x50a1fc,_0x340938){var _0x312628=function(_0x1d0878){while(--_0x1d0878){_0x50a1fc['push'](_0x50a1fc['shift']());}};_0x312628(++_0x340938);}(_0x51f4,0x1ae));var _0x451f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x51f4[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x451f('0x0'));var util=require(_0x451f('0x1'));exports[_0x451f('0x2')]=function(_0x2c1d60,_0x2e251b,_0x4c4e9b){var _0x42d43d=[];if(_0x2c1d60[_0x451f('0x3')]>0x0){var _0x35131e=_[_0x451f('0x4')](_0x2c1d60,['id']);for(var _0x4f76dd=0x0;_0x4f76dd<_0x35131e[_0x451f('0x3')];_0x4f76dd++){var _0x547912=_0x35131e[_0x4f76dd];if(_0x547912[_0x451f('0x5')]===_0x451f('0x6')){_0x42d43d[_0x451f('0x7')](_0x547912[_0x451f('0x8')]);}else if(_0x547912['type']===_0x451f('0x9')&&_0x547912[_0x451f('0xa')]){_0x2e251b[_0x547912['variableName']]&&_0x42d43d[_0x451f('0x7')](_0x2e251b[_0x547912[_0x451f('0xa')]][_0x451f('0xb')]());}else if(_0x547912[_0x451f('0x5')]===_0x451f('0xc')&&_0x547912[_0x451f('0xd')]&&_0x547912['Variable'][_0x451f('0xe')]){_0x2e251b[_0x547912['Variable'][_0x451f('0xe')][_0x451f('0xf')]()]&&_0x42d43d[_0x451f('0x7')](_0x2e251b[_0x547912['Variable'][_0x451f('0xe')]['toLowerCase']()][_0x451f('0xb')]());}else if(_0x547912[_0x451f('0x5')]===_0x451f('0x10')){if(_0x547912[_0x451f('0x11')]==='string'&&_0x547912[_0x451f('0x12')]){_0x42d43d[_0x451f('0x7')](util[_0x451f('0x13')](_0x451f('0x14'),_0x547912[_0x451f('0x12')],_0x547912['keyContent']));}else if(_0x547912[_0x451f('0x11')]===_0x451f('0x9')&&_0x547912['variableName']&&_0x547912['key']){_0x2e251b[_0x547912[_0x451f('0xa')]]&&_0x42d43d[_0x451f('0x7')](util[_0x451f('0x13')]('%s:\x20%s',_0x547912['key'],_0x2e251b[_0x547912[_0x451f('0xa')]]));}else if(_0x547912[_0x451f('0x11')]==='customVariable'&&_0x547912[_0x451f('0xd')]&&_0x547912[_0x451f('0xd')][_0x451f('0xe')]&&_0x547912[_0x451f('0x12')]){_0x2e251b[_0x547912[_0x451f('0xd')][_0x451f('0xe')][_0x451f('0xf')]()]&&_0x42d43d[_0x451f('0x7')](util[_0x451f('0x13')](_0x451f('0x14'),_0x547912['key'],_0x2e251b[_0x547912[_0x451f('0xd')][_0x451f('0xe')][_0x451f('0xf')]()]));}}}}return _0x42d43d['join'](_0x4c4e9b);};exports[_0x451f('0x15')]=function(_0x2db112){var _0x5ae4b3=_0x2db112[_0x451f('0x16')](-0x1);if(_0x5ae4b3==='/'){_0x2db112=_0x2db112[_0x451f('0x17')](0x0,_0x2db112[_0x451f('0x18')](_0x5ae4b3));}return _0x2db112;};exports['validateEmail']=function(_0x45f541){if(!_[_0x451f('0x19')](_0x45f541)&&_0x45f541!==''){var _0x104e62=/^(([^<>()\[\]\\.,;:\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 _0x104e62[_0x451f('0x1a')](String(_0x45f541)[_0x451f('0xf')]());}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 8e3696c..ee53c05 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 _0x34e8=['redis','defaults','localhost','emit','length','forEach','includes','string','picklist','type','idField','toString','variableName','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','getString','Subjects','POST','format','remoteUri','create','sessionName','HelpDesk','stringify','success','error','catch','statusCode','Getting\x20agent\x20with\x20email','GET','%s/webservice.php','query','username','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','result','Agent\x20found!','resolve','email1','first_name','last_name','userId','[vTiger],\x20%s,\x20%s,\x20%s','getUser','admin','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','phone','getEndUser','accessKey','getchallenge','then','login','token','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','recordingURL','email','The\x20User\x20ID\x20is:','calleridnum','Fields','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','outbound','stripTrailingSlash','recordingFormat','none','[OUTBOUND]','uniqueid','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','split','unmanaged','lastevent','toUpperCase','calleridname','lodash','request-promise','bluebird','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger'];(function(_0x1f5a9c,_0x2a2df1){var _0x53f00c=function(_0x20275d){while(--_0x20275d){_0x1f5a9c['push'](_0x1f5a9c['shift']());}};_0x53f00c(++_0x2a2df1);}(_0x34e8,0x12c));var _0x834e=function(_0x42aebd,_0x2cb987){_0x42aebd=_0x42aebd-0x0;var _0x451110=_0x34e8[_0x42aebd];return _0x451110;};'use strict';var _=require(_0x834e('0x0'));var rp=require(_0x834e('0x1'));var BPromise=require(_0x834e('0x2'));var md5=require(_0x834e('0x3'));var util=require('util');var Redis=require(_0x834e('0x4'));var intUtil=require(_0x834e('0x5'));var config=require(_0x834e('0x6'));var logger=require(_0x834e('0x7'))(_0x834e('0x8'));config[_0x834e('0x9')]=_[_0x834e('0xa')](config['redis'],{'host':_0x834e('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x834e('0x9')]));function emit(_0x3cc2e3,_0x3a3ef6,_0x2e69e2){io['to'](_0x3cc2e3)[_0x834e('0xc')](_0x3a3ef6,_0x2e69e2);}function getCustomFields(_0x23501c,_0x363786){var _0x1af45a={};if(_0x23501c[_0x834e('0xd')]>0x0){_[_0x834e('0xe')](_0x23501c,function(_0x1e41fe){if(_[_0x834e('0xf')]([_0x834e('0x10'),_0x834e('0x11')],_0x1e41fe[_0x834e('0x12')])&&_0x1e41fe[_0x834e('0x13')]){_0x1af45a[_0x1e41fe[_0x834e('0x13')]]=_0x1e41fe['content'][_0x834e('0x14')]();}else if(_0x1e41fe[_0x834e('0x12')]==='variable'&&_0x1e41fe[_0x834e('0x15')]&&_0x1e41fe[_0x834e('0x13')]&&_0x363786[_0x1e41fe[_0x834e('0x15')]]){_0x1af45a[_0x1e41fe[_0x834e('0x13')]]=_0x363786[_0x1e41fe['variableName']][_0x834e('0x14')]();}else if(_0x1e41fe[_0x834e('0x12')]==='customVariable'&&_0x1e41fe[_0x834e('0x16')]&&_0x1e41fe['Variable'][_0x834e('0x17')]&&_0x1e41fe[_0x834e('0x13')]&&_0x363786[_0x1e41fe['Variable'][_0x834e('0x17')][_0x834e('0x18')]()]){_0x1af45a[_0x1e41fe[_0x834e('0x13')]]=_0x363786[_0x1e41fe['Variable'][_0x834e('0x17')][_0x834e('0x18')]()][_0x834e('0x14')]();}});}return _0x1af45a;}function createTicket(_0xb993a1,_0x237947,_0x254677,_0x1dd214,_0x595515,_0x2545b4,_0x1fd2c6){logger[_0x834e('0x19')](_0x834e('0x1a'));var _0x4ab05d=_[_0x834e('0x1b')]({'parent_id':'','assigned_user_id':_0x237947['id'],'ticketpriorities':_0x834e('0x1c'),'ticketstatus':'Open','ticket_title':intUtil[_0x834e('0x1d')](_0x1dd214[_0x834e('0x1e')],_0x595515,'\x20'),'description':intUtil[_0x834e('0x1d')](_0x1dd214['Descriptions'],_0x595515,'\x0a'),'contact_id':_0x254677['id']},getCustomFields(_0x2545b4,_0x595515));var _0x4e3f48={'method':_0x834e('0x1f'),'uri':util[_0x834e('0x20')]('%s/webservice.php',_0xb993a1[_0x834e('0x21')]),'form':{'operation':_0x834e('0x22'),'username':_0xb993a1['username'],'sessionName':_0x1fd2c6[_0x834e('0x23')],'elementType':_0x834e('0x24'),'element':JSON[_0x834e('0x25')](_0x4ab05d)},'json':!![]};return request(_0x4e3f48)['then'](function(_0x24fcf7){if(_0x24fcf7[_0x834e('0x26')]){return BPromise['resolve']({'id':_0x24fcf7['result']['id']});}else{throw new Error(util[_0x834e('0x20')]('Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s',JSON[_0x834e('0x25')](_0x24fcf7[_0x834e('0x27')])));}})[_0x834e('0x28')](function(_0x2cc2eb){var _0x3cd928=_0x2cc2eb[_0x834e('0x29')]||0x1f4;logger['error']('[vTiger],\x20%s,\x20%s,\x20%s','createTicket',_0x3cd928,JSON['stringify'](_0x2cc2eb));});}function getUser(_0x2c7a8d,_0x567cea,_0x106d6a){if(intUtil['validateEmail'](_0x567cea)){logger[_0x834e('0x19')](_0x834e('0x2a'),_0x567cea);return request({'method':_0x834e('0x2b'),'uri':util[_0x834e('0x20')](_0x834e('0x2c'),_0x2c7a8d[_0x834e('0x21')]),'qs':{'operation':_0x834e('0x2d'),'username':_0x2c7a8d[_0x834e('0x2e')],'sessionName':_0x106d6a[_0x834e('0x23')],'query':util['format'](_0x834e('0x2f'),_0x567cea)},'json':!![]})['then'](function(_0x2c75c2){if(_0x2c75c2[_0x834e('0x26')]&&_0x2c75c2[_0x834e('0x30')][_0x834e('0xd')]){logger[_0x834e('0x19')](_0x834e('0x31'));return BPromise[_0x834e('0x32')]({'id':_0x2c75c2[_0x834e('0x30')][0x0]['id'],'email':_0x2c75c2[_0x834e('0x30')][0x0][_0x834e('0x33')],'name':_0x2c75c2['result'][0x0][_0x834e('0x34')]+'\x20'+_0x2c75c2[_0x834e('0x30')][_0x834e('0x35')]});}else{logger[_0x834e('0x19')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x834e('0x32')]({'id':_0x106d6a[_0x834e('0x36')],'email':_0x2c7a8d['username'],'name':'admin'});}})['catch'](function(_0x3e58fa){var _0x41bf4d=_0x3e58fa[_0x834e('0x29')]||0x1f4;logger[_0x834e('0x27')](_0x834e('0x37'),_0x834e('0x38'),_0x41bf4d,JSON['stringify'](_0x3e58fa));});}else{logger[_0x834e('0x19')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x834e('0x32')]({'id':_0x106d6a[_0x834e('0x36')],'email':_0x2c7a8d['username'],'name':_0x834e('0x39')})[_0x834e('0x28')](function(_0x491c28){var _0x481f70=_0x491c28[_0x834e('0x29')]||0x1f4;logger[_0x834e('0x27')](_0x834e('0x37'),_0x834e('0x38'),_0x481f70,JSON[_0x834e('0x25')](_0x491c28));});}}function getEndUser(_0x4ca43c,_0x1c5ed6,_0x548d1d,_0x50c243){logger[_0x834e('0x19')]('Searching\x20end\x20user\x20with\x20phone',_0x548d1d);return request({'method':_0x834e('0x2b'),'uri':util[_0x834e('0x20')](_0x834e('0x2c'),_0x4ca43c[_0x834e('0x21')]),'qs':{'operation':_0x834e('0x2d'),'username':_0x4ca43c['username'],'sessionName':_0x50c243[_0x834e('0x23')],'query':util[_0x834e('0x20')](_0x834e('0x3a'),_0x548d1d,_0x548d1d,_0x548d1d,_0x548d1d,_0x548d1d)},'json':!![]})['then'](function(_0x35380e){if(_0x35380e[_0x834e('0x26')]&&_0x35380e['result'][_0x834e('0xd')]){logger['info'](_0x834e('0x3b'));return BPromise[_0x834e('0x32')]({'id':_0x35380e['result'][0x0]['id'],'name':_0x35380e['result'][0x0][_0x834e('0x3c')]+'\x20'+_0x35380e[_0x834e('0x30')][0x0][_0x834e('0x3d')],'phone':_0x548d1d});}else{logger[_0x834e('0x19')](_0x834e('0x3e'));return request({'method':_0x834e('0x1f'),'uri':util[_0x834e('0x20')]('%s/webservice.php',_0x4ca43c[_0x834e('0x21')]),'form':{'operation':'create','sessionName':_0x50c243[_0x834e('0x23')],'elementType':'Contacts','element':JSON[_0x834e('0x25')]({'lastname':_0x1c5ed6,'phone':_0x548d1d,'assigned_user_id':'\x20'})},'json':!![]})['then'](function(_0x361f60){logger[_0x834e('0x19')]('Enduser\x20created.');return BPromise[_0x834e('0x32')]({'id':_0x361f60[_0x834e('0x30')]['id'],'name':_0x361f60[_0x834e('0x30')][_0x834e('0x3d')],'phone':_0x361f60[_0x834e('0x30')][_0x834e('0x3f')]});})[_0x834e('0x28')](function(_0x3ccd8e){var _0x5dc63b=_0x3ccd8e[_0x834e('0x29')]||0x1f4;logger['error'](_0x834e('0x37'),_0x834e('0x40'),_0x5dc63b,JSON['stringify'](_0x3ccd8e));});}});}function getConnection(_0x112306){var _0x42fd90=_0x112306[_0x834e('0x2e')];var _0x2112d5=_0x112306[_0x834e('0x41')];return request({'method':_0x834e('0x2b'),'uri':util['format']('%s/webservice.php',_0x112306[_0x834e('0x21')]),'qs':{'operation':_0x834e('0x42'),'username':_0x42fd90},'json':!![]})[_0x834e('0x43')](function(_0x40ff5a){if(_0x40ff5a[_0x834e('0x26')]){return request({'method':_0x834e('0x1f'),'uri':util[_0x834e('0x20')](_0x834e('0x2c'),_0x112306[_0x834e('0x21')]),'form':{'operation':_0x834e('0x44'),'username':_0x42fd90,'accessKey':md5(_0x40ff5a[_0x834e('0x30')][_0x834e('0x45')]+_0x2112d5)},'json':!![]});}})[_0x834e('0x43')](function(_0x1a3237){if(_0x1a3237[_0x834e('0x26')]){return BPromise[_0x834e('0x32')](_0x1a3237[_0x834e('0x30')]);}else{throw new Error(util[_0x834e('0x20')](_0x834e('0x46'),_0x112306['id']));}})[_0x834e('0x28')](function(_0x4cfacd){var _0x1cc0b8=_0x4cfacd[_0x834e('0x29')]||0x1f4;logger['error'](_0x834e('0x37'),_0x834e('0x47'),_0x1cc0b8,JSON['stringify'](_0x4cfacd));});}function request(_0x3dcca3){logger[_0x834e('0x19')](_0x834e('0x48'),JSON[_0x834e('0x25')](_0x3dcca3));return rp(_0x3dcca3);}exports[_0x834e('0x49')]=function(_0xb77aab,_0x4549ba,_0x4a8b32,_0x1ad7fe,_0x8bc6c6,_0x3e0550){var _0x363675,_0x86ad2b,_0x396bbe,_0x344b51;_0x3e0550[_0x834e('0x21')]=intUtil['stripTrailingSlash'](_0x3e0550[_0x834e('0x21')]);if(_0x8bc6c6&&_0x8bc6c6['monitor_format']){logger[_0x834e('0x19')]('[QUEUE]',_0x834e('0x4a'));_0x4549ba['recordingURL']=util['format'](_0x834e('0x4b'),_0x3e0550[_0x834e('0x4c')],_0x4549ba['uniqueid'],md5(_0x4549ba['uniqueid']));}else{_0x4549ba[_0x834e('0x4d')]='';}return getConnection(_0x3e0550)[_0x834e('0x43')](function(_0x138ed2){_0x344b51=_0x138ed2;return getUser(_0x3e0550,_0x1ad7fe[_0x834e('0x4e')],_0x344b51);})[_0x834e('0x43')](function(_0x315858){_0x363675=_0x315858;logger[_0x834e('0x19')](_0x834e('0x4f'),_0x363675['id']);return getEndUser(_0x3e0550,_0x4549ba['calleridname'],_0x4549ba[_0x834e('0x50')],_0x344b51);})[_0x834e('0x43')](function(_0x5d5ac2){_0x86ad2b=_0x5d5ac2;logger[_0x834e('0x19')]('The\x20Enduser\x20ID\x20is:',_0x86ad2b['id']);return createTicket(_0x3e0550,_0x363675,_0x86ad2b,_0x4a8b32,_0x4549ba,_0x4a8b32[_0x834e('0x51')],_0x344b51);})[_0x834e('0x43')](function(_0x5160c4){_0x396bbe=_0x5160c4;logger[_0x834e('0x19')](_0x834e('0x52'));logger[_0x834e('0x19')](_0x834e('0x53'),_0x396bbe['id']);var _0x5a2924=util[_0x834e('0x20')](_0x834e('0x54'),_0x3e0550[_0x834e('0x21')],_['split'](_0x396bbe['id'],'x')[0x1]);logger[_0x834e('0x19')](_0x834e('0x55'),_0x834e('0x56'));emit(util[_0x834e('0x20')](_0x834e('0x57'),_0x1ad7fe[_0x834e('0x17')]),_0x834e('0x58'),{'uri':_0x5a2924});})[_0x834e('0x28')](function(_0x208c21){logger[_0x834e('0x27')](_0x834e('0x55'),JSON[_0x834e('0x25')](_0x208c21));});};exports[_0x834e('0x59')]=function(_0x1659c8,_0x460a7a,_0x17b8e3,_0x297cce,_0x14ed83,_0x193a15,_0x3e3467){var _0xed4081,_0x2cb233,_0x5c83eb,_0x2145cf;_0x193a15[_0x834e('0x21')]=intUtil[_0x834e('0x5a')](_0x193a15[_0x834e('0x21')]);_0x193a15['serverUrl']=intUtil[_0x834e('0x5a')](_0x193a15['serverUrl']);if(_0x3e3467&&_0x3e3467['recordingFormat']&&_0x3e3467[_0x834e('0x5b')]!==_0x834e('0x5c')){logger[_0x834e('0x19')](_0x834e('0x5d'),_0x834e('0x4a'));_0x460a7a[_0x834e('0x4d')]=util[_0x834e('0x20')](_0x834e('0x4b'),_0x193a15['serverUrl'],_0x460a7a[_0x834e('0x5e')],md5(_0x460a7a['uniqueid']));}return getConnection(_0x193a15)[_0x834e('0x43')](function(_0xd35dda){_0x2145cf=_0xd35dda;return getUser(_0x193a15,_0x297cce['email'],_0x2145cf);})['then'](function(_0x4a4def){_0xed4081=_0x4a4def;logger[_0x834e('0x19')](_0x834e('0x4f'),_0xed4081['id']);return getEndUser(_0x193a15,_0x460a7a[_0x834e('0x5f')],_0x460a7a[_0x834e('0x60')],_0x2145cf);})['then'](function(_0x2b0d93){_0x2cb233=_0x2b0d93;logger[_0x834e('0x19')](_0x834e('0x61'),_0x2cb233['id']);return createTicket(_0x193a15,_0xed4081,_0x2cb233,_0x17b8e3,_0x460a7a,_0x17b8e3[_0x834e('0x51')],_0x2145cf);})[_0x834e('0x43')](function(_0x28b5c9){_0x5c83eb=_0x28b5c9;logger[_0x834e('0x19')](_0x834e('0x52'));logger[_0x834e('0x19')](_0x834e('0x53'),_0x5c83eb['id']);var _0x5b2bf6=util[_0x834e('0x20')](_0x834e('0x54'),_0x193a15[_0x834e('0x21')],_[_0x834e('0x62')](_0x5c83eb['id'],'x')[0x1]);logger['info'](_0x834e('0x5d'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format']('user:%s',_0x297cce[_0x834e('0x17')]),_0x834e('0x58'),{'uri':_0x5b2bf6});})['catch'](function(_0x2645df){logger[_0x834e('0x27')]('[OUTBOUND]',JSON[_0x834e('0x25')](_0x2645df));});};exports[_0x834e('0x63')]=function(_0x4b88e7,_0x5df169,_0x346be5,_0x2a42a3,_0x8bc7d9,_0x44c909){var _0x1d8e7,_0x493239,_0x264a6f,_0x520367;_0x44c909[_0x834e('0x21')]=intUtil[_0x834e('0x5a')](_0x44c909[_0x834e('0x21')]);_0x44c909['serverUrl']=intUtil[_0x834e('0x5a')](_0x44c909[_0x834e('0x4c')]);if(_0x8bc7d9&&_0x8bc7d9['monitor_format']){logger[_0x834e('0x19')]('['+_0x5df169[_0x834e('0x64')][_0x834e('0x65')]()+']','Recording\x20is\x20enabled!');_0x5df169[_0x834e('0x4d')]=util[_0x834e('0x20')](_0x834e('0x4b'),_0x44c909[_0x834e('0x4c')],_0x5df169[_0x834e('0x5e')],md5(_0x5df169[_0x834e('0x5e')]));}else{_0x5df169[_0x834e('0x4d')]='';}return getConnection(_0x44c909)[_0x834e('0x43')](function(_0xd49002){_0x520367=_0xd49002;return getUser(_0x44c909,'',_0x520367);})[_0x834e('0x43')](function(_0x57d898){_0x1d8e7=_0x57d898;logger['info']('The\x20User\x20ID\x20is:',_0x1d8e7['id']);return getEndUser(_0x44c909,_0x5df169[_0x834e('0x66')],_0x5df169[_0x834e('0x50')],_0x520367);})[_0x834e('0x43')](function(_0x37fa2c){_0x493239=_0x37fa2c;logger[_0x834e('0x19')]('The\x20Enduser\x20ID\x20is:',_0x493239['id']);return createTicket(_0x44c909,_0x1d8e7,_0x493239,_0x346be5,_0x5df169,_0x346be5['Fields'],_0x520367);})[_0x834e('0x43')](function(_0x1ad428){_0x264a6f=_0x1ad428;logger[_0x834e('0x19')](_0x834e('0x52'));logger[_0x834e('0x19')]('The\x20Ticket\x20ID\x20is:',_0x264a6f['id']);})[_0x834e('0x28')](function(_0x2b162a){logger[_0x834e('0x27')]('['+_0x5df169['lastevent'][_0x834e('0x65')]()+']',JSON[_0x834e('0x25')](_0x2b162a));});}; \ No newline at end of file +var _0xd8b0=['info','Creating\x20new\x20ticket...','merge','Normal','Subjects','POST','format','%s/webservice.php','remoteUri','create','username','sessionName','HelpDesk','stringify','success','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','error','statusCode','[vTiger],\x20%s,\x20%s,\x20%s','validateEmail','Getting\x20agent\x20with\x20email','then','Agent\x20found!','resolve','email1','first_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','admin','catch','userId','getUser','Searching\x20end\x20user\x20with\x20phone','GET','query','Enduser\x20found!','firstname','Enduser\x20created.','lastname','phone','accessKey','getchallenge','login','token','getConnection','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','recordingURL','email','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','outbound','recordingFormat','none','[OUTBOUND]','uniqueid','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','user:%s','lastevent','toUpperCase','lodash','request-promise','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger','redis','localhost','socket.io-emitter','emit','length','forEach','includes','picklist','idField','content','toString','type','variable','variableName','customVariable','Variable','name','toLowerCase'];(function(_0x4c70c4,_0x963969){var _0x437865=function(_0x54e323){while(--_0x54e323){_0x4c70c4['push'](_0x4c70c4['shift']());}};_0x437865(++_0x963969);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x0d8b('0x0'));var rp=require(_0x0d8b('0x1'));var BPromise=require('bluebird');var md5=require('md5');var util=require('util');var Redis=require(_0x0d8b('0x2'));var intUtil=require(_0x0d8b('0x3'));var config=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));config['redis']=_['defaults'](config[_0x0d8b('0x7')],{'host':_0x0d8b('0x8'),'port':0x18eb});var io=require(_0x0d8b('0x9'))(new Redis(config['redis']));function emit(_0x413284,_0x284169,_0x58e4e2){io['to'](_0x413284)[_0x0d8b('0xa')](_0x284169,_0x58e4e2);}function getCustomFields(_0x348e65,_0x3b027f){var _0x1f4800={};if(_0x348e65[_0x0d8b('0xb')]>0x0){_[_0x0d8b('0xc')](_0x348e65,function(_0x2c5e9e){if(_[_0x0d8b('0xd')](['string',_0x0d8b('0xe')],_0x2c5e9e['type'])&&_0x2c5e9e[_0x0d8b('0xf')]){_0x1f4800[_0x2c5e9e[_0x0d8b('0xf')]]=_0x2c5e9e[_0x0d8b('0x10')][_0x0d8b('0x11')]();}else if(_0x2c5e9e[_0x0d8b('0x12')]===_0x0d8b('0x13')&&_0x2c5e9e[_0x0d8b('0x14')]&&_0x2c5e9e[_0x0d8b('0xf')]&&_0x3b027f[_0x2c5e9e[_0x0d8b('0x14')]]){_0x1f4800[_0x2c5e9e[_0x0d8b('0xf')]]=_0x3b027f[_0x2c5e9e[_0x0d8b('0x14')]][_0x0d8b('0x11')]();}else if(_0x2c5e9e[_0x0d8b('0x12')]===_0x0d8b('0x15')&&_0x2c5e9e['Variable']&&_0x2c5e9e[_0x0d8b('0x16')][_0x0d8b('0x17')]&&_0x2c5e9e[_0x0d8b('0xf')]&&_0x3b027f[_0x2c5e9e[_0x0d8b('0x16')][_0x0d8b('0x17')]['toLowerCase']()]){_0x1f4800[_0x2c5e9e[_0x0d8b('0xf')]]=_0x3b027f[_0x2c5e9e[_0x0d8b('0x16')][_0x0d8b('0x17')][_0x0d8b('0x18')]()][_0x0d8b('0x11')]();}});}return _0x1f4800;}function createTicket(_0x18dd2d,_0x264b39,_0xa3612a,_0x4a15bf,_0x27512e,_0x23d58f,_0x196c0a){logger[_0x0d8b('0x19')](_0x0d8b('0x1a'));var _0x5b709c=_[_0x0d8b('0x1b')]({'parent_id':'','assigned_user_id':_0x264b39['id'],'ticketpriorities':_0x0d8b('0x1c'),'ticketstatus':'Open','ticket_title':intUtil['getString'](_0x4a15bf[_0x0d8b('0x1d')],_0x27512e,'\x20'),'description':intUtil['getString'](_0x4a15bf['Descriptions'],_0x27512e,'\x0a'),'contact_id':_0xa3612a['id']},getCustomFields(_0x23d58f,_0x27512e));var _0x5527d8={'method':_0x0d8b('0x1e'),'uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x18dd2d[_0x0d8b('0x21')]),'form':{'operation':_0x0d8b('0x22'),'username':_0x18dd2d[_0x0d8b('0x23')],'sessionName':_0x196c0a[_0x0d8b('0x24')],'elementType':_0x0d8b('0x25'),'element':JSON[_0x0d8b('0x26')](_0x5b709c)},'json':!![]};return request(_0x5527d8)['then'](function(_0xe8bbee){if(_0xe8bbee[_0x0d8b('0x27')]){return BPromise['resolve']({'id':_0xe8bbee[_0x0d8b('0x28')]['id']});}else{throw new Error(util['format'](_0x0d8b('0x29'),JSON[_0x0d8b('0x26')](_0xe8bbee[_0x0d8b('0x2a')])));}})['catch'](function(_0x59a905){var _0x28f639=_0x59a905[_0x0d8b('0x2b')]||0x1f4;logger['error'](_0x0d8b('0x2c'),'createTicket',_0x28f639,JSON[_0x0d8b('0x26')](_0x59a905));});}function getUser(_0x4b59e5,_0x97050a,_0x48f24f){if(intUtil[_0x0d8b('0x2d')](_0x97050a)){logger['info'](_0x0d8b('0x2e'),_0x97050a);return request({'method':'GET','uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x4b59e5[_0x0d8b('0x21')]),'qs':{'operation':'query','username':_0x4b59e5['username'],'sessionName':_0x48f24f['sessionName'],'query':util[_0x0d8b('0x1f')]('SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;',_0x97050a)},'json':!![]})[_0x0d8b('0x2f')](function(_0x54f6f3){if(_0x54f6f3['success']&&_0x54f6f3[_0x0d8b('0x28')][_0x0d8b('0xb')]){logger[_0x0d8b('0x19')](_0x0d8b('0x30'));return BPromise[_0x0d8b('0x31')]({'id':_0x54f6f3[_0x0d8b('0x28')][0x0]['id'],'email':_0x54f6f3[_0x0d8b('0x28')][0x0][_0x0d8b('0x32')],'name':_0x54f6f3['result'][0x0][_0x0d8b('0x33')]+'\x20'+_0x54f6f3[_0x0d8b('0x28')]['last_name']});}else{logger[_0x0d8b('0x19')](_0x0d8b('0x34'));return BPromise[_0x0d8b('0x31')]({'id':_0x48f24f['userId'],'email':_0x4b59e5[_0x0d8b('0x23')],'name':_0x0d8b('0x35')});}})[_0x0d8b('0x36')](function(_0x31ceba){var _0x933e01=_0x31ceba['statusCode']||0x1f4;logger[_0x0d8b('0x2a')](_0x0d8b('0x2c'),'getUser',_0x933e01,JSON[_0x0d8b('0x26')](_0x31ceba));});}else{logger[_0x0d8b('0x19')](_0x0d8b('0x34'));return BPromise[_0x0d8b('0x31')]({'id':_0x48f24f[_0x0d8b('0x37')],'email':_0x4b59e5['username'],'name':'admin'})[_0x0d8b('0x36')](function(_0x5c2c04){var _0x531c55=_0x5c2c04[_0x0d8b('0x2b')]||0x1f4;logger[_0x0d8b('0x2a')](_0x0d8b('0x2c'),_0x0d8b('0x38'),_0x531c55,JSON[_0x0d8b('0x26')](_0x5c2c04));});}}function getEndUser(_0x24c789,_0x579324,_0x6e5bab,_0x6a02ad){logger[_0x0d8b('0x19')](_0x0d8b('0x39'),_0x6e5bab);return request({'method':_0x0d8b('0x3a'),'uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x24c789['remoteUri']),'qs':{'operation':_0x0d8b('0x3b'),'username':_0x24c789[_0x0d8b('0x23')],'sessionName':_0x6a02ad[_0x0d8b('0x24')],'query':util[_0x0d8b('0x1f')]('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;',_0x6e5bab,_0x6e5bab,_0x6e5bab,_0x6e5bab,_0x6e5bab)},'json':!![]})[_0x0d8b('0x2f')](function(_0x4b4bde){if(_0x4b4bde[_0x0d8b('0x27')]&&_0x4b4bde[_0x0d8b('0x28')][_0x0d8b('0xb')]){logger[_0x0d8b('0x19')](_0x0d8b('0x3c'));return BPromise[_0x0d8b('0x31')]({'id':_0x4b4bde[_0x0d8b('0x28')][0x0]['id'],'name':_0x4b4bde[_0x0d8b('0x28')][0x0][_0x0d8b('0x3d')]+'\x20'+_0x4b4bde[_0x0d8b('0x28')][0x0]['lastname'],'phone':_0x6e5bab});}else{logger['info']('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'method':'POST','uri':util['format'](_0x0d8b('0x20'),_0x24c789[_0x0d8b('0x21')]),'form':{'operation':_0x0d8b('0x22'),'sessionName':_0x6a02ad['sessionName'],'elementType':'Contacts','element':JSON[_0x0d8b('0x26')]({'lastname':_0x579324,'phone':_0x6e5bab,'assigned_user_id':'\x20'})},'json':!![]})[_0x0d8b('0x2f')](function(_0x344278){logger['info'](_0x0d8b('0x3e'));return BPromise[_0x0d8b('0x31')]({'id':_0x344278['result']['id'],'name':_0x344278['result'][_0x0d8b('0x3f')],'phone':_0x344278['result'][_0x0d8b('0x40')]});})['catch'](function(_0x53f643){var _0x30ccee=_0x53f643[_0x0d8b('0x2b')]||0x1f4;logger['error']('[vTiger],\x20%s,\x20%s,\x20%s','getEndUser',_0x30ccee,JSON['stringify'](_0x53f643));});}});}function getConnection(_0x374d40){var _0x1e0498=_0x374d40[_0x0d8b('0x23')];var _0x490eda=_0x374d40[_0x0d8b('0x41')];return request({'method':_0x0d8b('0x3a'),'uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x374d40[_0x0d8b('0x21')]),'qs':{'operation':_0x0d8b('0x42'),'username':_0x1e0498},'json':!![]})[_0x0d8b('0x2f')](function(_0x1d5067){if(_0x1d5067[_0x0d8b('0x27')]){return request({'method':_0x0d8b('0x1e'),'uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x374d40[_0x0d8b('0x21')]),'form':{'operation':_0x0d8b('0x43'),'username':_0x1e0498,'accessKey':md5(_0x1d5067[_0x0d8b('0x28')][_0x0d8b('0x44')]+_0x490eda)},'json':!![]});}})[_0x0d8b('0x2f')](function(_0x1e162c){if(_0x1e162c[_0x0d8b('0x27')]){return BPromise['resolve'](_0x1e162c[_0x0d8b('0x28')]);}else{throw new Error(util['format']('Account\x20%d\x20is\x20not\x20valid',_0x374d40['id']));}})[_0x0d8b('0x36')](function(_0x113fb7){var _0x3f943a=_0x113fb7[_0x0d8b('0x2b')]||0x1f4;logger['error'](_0x0d8b('0x2c'),_0x0d8b('0x45'),_0x3f943a,JSON[_0x0d8b('0x26')](_0x113fb7));});}function request(_0x241587){logger[_0x0d8b('0x19')]('[HTTP]',JSON['stringify'](_0x241587));return rp(_0x241587);}exports['queue']=function(_0x573f4f,_0x368ede,_0xf22c3c,_0x5e3bb4,_0x4950a8,_0x44c5c1){var _0x3d3cb6,_0x5c5bd7,_0x5ef6c3,_0x900906;_0x44c5c1[_0x0d8b('0x21')]=intUtil[_0x0d8b('0x46')](_0x44c5c1[_0x0d8b('0x21')]);if(_0x4950a8&&_0x4950a8[_0x0d8b('0x47')]){logger['info'](_0x0d8b('0x48'),_0x0d8b('0x49'));_0x368ede['recordingURL']=util['format'](_0x0d8b('0x4a'),_0x44c5c1[_0x0d8b('0x4b')],_0x368ede['uniqueid'],md5(_0x368ede['uniqueid']));}else{_0x368ede[_0x0d8b('0x4c')]='';}return getConnection(_0x44c5c1)[_0x0d8b('0x2f')](function(_0x377027){_0x900906=_0x377027;return getUser(_0x44c5c1,_0x5e3bb4[_0x0d8b('0x4d')],_0x900906);})['then'](function(_0x356b3d){_0x3d3cb6=_0x356b3d;logger['info']('The\x20User\x20ID\x20is:',_0x3d3cb6['id']);return getEndUser(_0x44c5c1,_0x368ede[_0x0d8b('0x4e')],_0x368ede[_0x0d8b('0x4f')],_0x900906);})['then'](function(_0x4a8f33){_0x5c5bd7=_0x4a8f33;logger[_0x0d8b('0x19')](_0x0d8b('0x50'),_0x5c5bd7['id']);return createTicket(_0x44c5c1,_0x3d3cb6,_0x5c5bd7,_0xf22c3c,_0x368ede,_0xf22c3c[_0x0d8b('0x51')],_0x900906);})[_0x0d8b('0x2f')](function(_0x3afc3a){_0x5ef6c3=_0x3afc3a;logger[_0x0d8b('0x19')](_0x0d8b('0x52'));logger[_0x0d8b('0x19')]('The\x20Ticket\x20ID\x20is:',_0x5ef6c3['id']);var _0x24a859=util[_0x0d8b('0x1f')](_0x0d8b('0x53'),_0x44c5c1[_0x0d8b('0x21')],_[_0x0d8b('0x54')](_0x5ef6c3['id'],'x')[0x1]);logger[_0x0d8b('0x19')](_0x0d8b('0x48'),_0x0d8b('0x55'));emit(util[_0x0d8b('0x1f')]('user:%s',_0x5e3bb4[_0x0d8b('0x17')]),_0x0d8b('0x56'),{'uri':_0x24a859});})[_0x0d8b('0x36')](function(_0x23de9e){logger[_0x0d8b('0x2a')]('[QUEUE]',JSON[_0x0d8b('0x26')](_0x23de9e));});};exports[_0x0d8b('0x57')]=function(_0x181d49,_0x17a87f,_0x1d6cd4,_0x59ada2,_0x4d0e7c,_0x3b1166,_0x291b83){var _0x3e4a41,_0xbbb520,_0x5a70bd,_0x199122;_0x3b1166[_0x0d8b('0x21')]=intUtil[_0x0d8b('0x46')](_0x3b1166['remoteUri']);_0x3b1166[_0x0d8b('0x4b')]=intUtil['stripTrailingSlash'](_0x3b1166[_0x0d8b('0x4b')]);if(_0x291b83&&_0x291b83[_0x0d8b('0x58')]&&_0x291b83[_0x0d8b('0x58')]!==_0x0d8b('0x59')){logger[_0x0d8b('0x19')](_0x0d8b('0x5a'),'Recording\x20is\x20enabled!');_0x17a87f[_0x0d8b('0x4c')]=util['format'](_0x0d8b('0x4a'),_0x3b1166[_0x0d8b('0x4b')],_0x17a87f[_0x0d8b('0x5b')],md5(_0x17a87f[_0x0d8b('0x5b')]));}return getConnection(_0x3b1166)['then'](function(_0x19e097){_0x199122=_0x19e097;return getUser(_0x3b1166,_0x59ada2[_0x0d8b('0x4d')],_0x199122);})[_0x0d8b('0x2f')](function(_0x2332fc){_0x3e4a41=_0x2332fc;logger[_0x0d8b('0x19')](_0x0d8b('0x5c'),_0x3e4a41['id']);return getEndUser(_0x3b1166,_0x17a87f[_0x0d8b('0x5d')],_0x17a87f[_0x0d8b('0x5e')],_0x199122);})[_0x0d8b('0x2f')](function(_0x34affb){_0xbbb520=_0x34affb;logger['info']('The\x20Enduser\x20ID\x20is:',_0xbbb520['id']);return createTicket(_0x3b1166,_0x3e4a41,_0xbbb520,_0x1d6cd4,_0x17a87f,_0x1d6cd4[_0x0d8b('0x51')],_0x199122);})[_0x0d8b('0x2f')](function(_0x53e399){_0x5a70bd=_0x53e399;logger[_0x0d8b('0x19')]('Ticket\x20created!');logger['info'](_0x0d8b('0x5f'),_0x5a70bd['id']);var _0x1c4e96=util['format']('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x3b1166[_0x0d8b('0x21')],_[_0x0d8b('0x54')](_0x5a70bd['id'],'x')[0x1]);logger[_0x0d8b('0x19')](_0x0d8b('0x5a'),_0x0d8b('0x55'));emit(util[_0x0d8b('0x1f')](_0x0d8b('0x60'),_0x59ada2['name']),_0x0d8b('0x56'),{'uri':_0x1c4e96});})['catch'](function(_0x1a203e){logger[_0x0d8b('0x2a')](_0x0d8b('0x5a'),JSON[_0x0d8b('0x26')](_0x1a203e));});};exports['unmanaged']=function(_0x3fe47d,_0x4a1c4a,_0x3a356b,_0x2c6c5f,_0x1c5fe2,_0x2ebea3){var _0xc5c35f,_0x2b44e5,_0x3e927c,_0x91aa89;_0x2ebea3[_0x0d8b('0x21')]=intUtil[_0x0d8b('0x46')](_0x2ebea3['remoteUri']);_0x2ebea3[_0x0d8b('0x4b')]=intUtil['stripTrailingSlash'](_0x2ebea3[_0x0d8b('0x4b')]);if(_0x1c5fe2&&_0x1c5fe2[_0x0d8b('0x47')]){logger['info']('['+_0x4a1c4a[_0x0d8b('0x61')]['toUpperCase']()+']',_0x0d8b('0x49'));_0x4a1c4a[_0x0d8b('0x4c')]=util[_0x0d8b('0x1f')](_0x0d8b('0x4a'),_0x2ebea3[_0x0d8b('0x4b')],_0x4a1c4a[_0x0d8b('0x5b')],md5(_0x4a1c4a[_0x0d8b('0x5b')]));}else{_0x4a1c4a[_0x0d8b('0x4c')]='';}return getConnection(_0x2ebea3)['then'](function(_0x10eca6){_0x91aa89=_0x10eca6;return getUser(_0x2ebea3,'',_0x91aa89);})[_0x0d8b('0x2f')](function(_0x5b2916){_0xc5c35f=_0x5b2916;logger[_0x0d8b('0x19')](_0x0d8b('0x5c'),_0xc5c35f['id']);return getEndUser(_0x2ebea3,_0x4a1c4a[_0x0d8b('0x4e')],_0x4a1c4a[_0x0d8b('0x4f')],_0x91aa89);})[_0x0d8b('0x2f')](function(_0x9e44b4){_0x2b44e5=_0x9e44b4;logger[_0x0d8b('0x19')](_0x0d8b('0x50'),_0x2b44e5['id']);return createTicket(_0x2ebea3,_0xc5c35f,_0x2b44e5,_0x3a356b,_0x4a1c4a,_0x3a356b[_0x0d8b('0x51')],_0x91aa89);})[_0x0d8b('0x2f')](function(_0xe35028){_0x3e927c=_0xe35028;logger[_0x0d8b('0x19')]('Ticket\x20created!');logger[_0x0d8b('0x19')](_0x0d8b('0x5f'),_0x3e927c['id']);})[_0x0d8b('0x36')](function(_0x58525c){logger['error']('['+_0x4a1c4a[_0x0d8b('0x61')][_0x0d8b('0x62')]()+']',JSON[_0x0d8b('0x26')](_0x58525c));});}; \ 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 6600200..57ce640 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 _0x3313=['/api/v2','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','lastevent','calleridname','\x20Error\x20running\x20Zendesk\x20integration','md5','util','ioredis','./util','../../../../config/logger','zendesk','defaults','redis','socket.io-emitter','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','merge','Tags','name','getString','Subjects','Descriptions','then','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','find','results','agent','%s/users/me.json','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','length','filter','end-user','first','%s/users.json','Caller\x20-\x20%s','Enduser\x20created.','password','%s:%s','username','authType','%s/token:%s','token','Basic\x20%s','toString','base64','[HTTP]','stringify','GET','map','forEach','string','picklist','type','nameField','customField','toLowerCase','content','includes','idField','push','variable','variableName','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','email','The\x20User\x20ID\x20is:','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...','user:%s','trigger:browser:url','%s/agent/tickets/%s','replace','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','[OUTBOUND]','Authorization','destcalleridname','destcalleridnum','Displaying\x20ticket\x20to\x20agent...'];(function(_0x37f5a3,_0x2d1bd0){var _0x1ce2ca=function(_0x126d29){while(--_0x126d29){_0x37f5a3['push'](_0x37f5a3['shift']());}};_0x1ce2ca(++_0x2d1bd0);}(_0x3313,0x77));var _0x3331=function(_0x4aa2cf,_0x3f87cf){_0x4aa2cf=_0x4aa2cf-0x0;var _0x4a3813=_0x3313[_0x4aa2cf];return _0x4a3813;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require(_0x3331('0x0'));var util=require(_0x3331('0x1'));var Redis=require(_0x3331('0x2'));var intUtil=require(_0x3331('0x3'));var config=require('../../../../config/environment');var logger=require(_0x3331('0x4'))(_0x3331('0x5'));config['redis']=_[_0x3331('0x6')](config[_0x3331('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x3331('0x8'))(new Redis(config['redis']));function emit(_0x34e396,_0x205bdf,_0x4ce87e){io['to'](_0x34e396)['emit'](_0x205bdf,_0x4ce87e);}var headers={'Content-Type':_0x3331('0x9'),'Accept':'application/json'};function getTicket(_0x2f865a,_0xac2532,_0x494dd6,_0xbf83ca,_0x209795){logger[_0x3331('0xa')](_0x3331('0xb'));return request({'uri':util[_0x3331('0xc')](_0x3331('0xd'),_0x2f865a[_0x3331('0xe')]),'method':_0x3331('0xf'),'body':{'ticket':_[_0x3331('0x10')]({'requester_id':_0x494dd6['id'],'submitter_id':_0xac2532?_0xac2532['id']:undefined,'assignee_id':_0xac2532?_0xac2532['id']:undefined,'tags':getTags(_0xbf83ca[_0x3331('0x11')],_0x3331('0x12')),'subject':intUtil[_0x3331('0x13')](_0xbf83ca[_0x3331('0x14')],_0x209795,'\x20'),'description':intUtil[_0x3331('0x13')](_0xbf83ca[_0x3331('0x15')],_0x209795,'\x0a'),'comment':{'public':![],'body':intUtil[_0x3331('0x13')](_0xbf83ca[_0x3331('0x15')],_0x209795,'\x0a')}},getCustomFields(_0xbf83ca['Fields'],_0x209795))}})[_0x3331('0x16')](function(_0x135613){logger[_0x3331('0xa')](_0x3331('0x17'));return _0x135613[_0x3331('0x18')];});}function getUser(_0x4c15a6,_0xe31d54){if(intUtil[_0x3331('0x19')](_0xe31d54)){logger[_0x3331('0xa')](_0x3331('0x1a'),_0xe31d54);return request({'uri':util[_0x3331('0xc')](_0x3331('0x1b'),_0x4c15a6[_0x3331('0xe')]),'qs':{'query':util[_0x3331('0xc')](_0x3331('0x1c'),_0xe31d54)}})[_0x3331('0x16')](function(_0x52b225){if(_0x52b225[_0x3331('0x1d')]){logger[_0x3331('0xa')](_0x3331('0x1e'));return _[_0x3331('0x1f')](_0x52b225[_0x3331('0x20')],{'email':_0xe31d54,'role':_0x3331('0x21')});}else{logger[_0x3331('0xa')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format'](_0x3331('0x22'),_0x4c15a6[_0x3331('0xe')])})[_0x3331('0x16')](function(_0x46818e){logger[_0x3331('0xa')]('Admin\x20account\x20selected.');return _0x46818e['user'];});}});}else{logger['info'](_0x3331('0x23'));return request({'uri':util['format']('%s/users/me.json',_0x4c15a6['remoteUri'])})['then'](function(_0x4dcebe){logger[_0x3331('0xa')](_0x3331('0x24'));return _0x4dcebe[_0x3331('0x25')];});}}function getEndUser(_0x47986e,_0x42cfa6,_0x1054af){logger[_0x3331('0xa')](_0x3331('0x26'),_0x1054af);return request({'uri':util[_0x3331('0xc')](_0x3331('0x1b'),_0x47986e[_0x3331('0xe')]),'qs':{'query':util[_0x3331('0xc')](_0x3331('0x27'),_0x1054af)}})[_0x3331('0x16')](function(_0x30a9ed){var _0x4e1206;if(_0x30a9ed[_0x3331('0x20')][_0x3331('0x28')]){_0x30a9ed['results']=_[_0x3331('0x29')](_0x30a9ed[_0x3331('0x20')],{'suspended':![],'role':_0x3331('0x2a')});if(_0x30a9ed[_0x3331('0x20')][_0x3331('0x28')]){_0x4e1206=_[_0x3331('0x2b')](_0x30a9ed['results']);}}if(_0x4e1206){logger[_0x3331('0xa')]('Enduser\x20found!');return _0x4e1206;}else{logger[_0x3331('0xa')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0x3331('0xc')](_0x3331('0x2c'),_0x47986e[_0x3331('0xe')]),'method':_0x3331('0xf'),'body':{'user':{'role':'end-user','name':util['format'](_0x3331('0x2d'),_0x42cfa6||_0x1054af),'phone':_0x1054af}}})[_0x3331('0x16')](function(_0x377d78){logger[_0x3331('0xa')](_0x3331('0x2e'));return _0x377d78['user'];});}});}function getAuth(_0x3d58e4){var _0x418470;if(_0x3d58e4['authType']===_0x3331('0x2f')){_0x418470=util[_0x3331('0xc')](_0x3331('0x30'),_0x3d58e4[_0x3331('0x31')],_0x3d58e4['password']);}else if(_0x3d58e4[_0x3331('0x32')]==='token'){_0x418470=util[_0x3331('0xc')](_0x3331('0x33'),_0x3d58e4[_0x3331('0x31')],_0x3d58e4[_0x3331('0x34')]);}return util[_0x3331('0xc')](_0x3331('0x35'),new Buffer(_0x418470)[_0x3331('0x36')](_0x3331('0x37')));}function request(_0x4bbebb){logger['debug'](_0x3331('0x38'),JSON[_0x3331('0x39')](_0x4bbebb));return rp(_[_0x3331('0x6')](_0x4bbebb,{'method':_0x3331('0x3a'),'headers':headers,'json':!![]}));}function getTags(_0x4d7882,_0x3ff562){var _0x402848=[];if(_0x4d7882&&_0x4d7882[_0x3331('0x28')]>0x0){_0x402848=_[_0x3331('0x3b')](_0x4d7882,_0x3ff562);}return _0x402848;}function getCustomFields(_0x38ce24,_0x5280a3){var _0x432f2d=[];var _0x4e1c90={'custom_fields':[]};if(_0x38ce24['length']>0x0){_[_0x3331('0x3c')](_0x38ce24,function(_0x169bc9){if(_['includes']([_0x3331('0x3d'),_0x3331('0x3e')],_0x169bc9[_0x3331('0x3f')])&&_0x169bc9[_0x3331('0x40')]&&!_0x169bc9[_0x3331('0x41')]){_0x4e1c90[_0x169bc9[_0x3331('0x40')][_0x3331('0x42')]()]=_0x169bc9[_0x3331('0x43')][_0x3331('0x36')]();}else if(_[_0x3331('0x44')](['string',_0x3331('0x3e')],_0x169bc9['type'])&&_0x169bc9[_0x3331('0x45')]&&_0x169bc9[_0x3331('0x41')]){_0x4e1c90['custom_fields'][_0x3331('0x46')]({'id':_0x169bc9[_0x3331('0x45')],'value':_0x169bc9[_0x3331('0x43')][_0x3331('0x36')]()});}else if(_0x169bc9[_0x3331('0x3f')]===_0x3331('0x47')&&_0x169bc9[_0x3331('0x48')]&&_0x169bc9[_0x3331('0x45')]&&_0x169bc9[_0x3331('0x41')]){_0x5280a3[_0x169bc9[_0x3331('0x48')]]&&_0x4e1c90['custom_fields']['push']({'id':_0x169bc9['idField'],'value':_0x5280a3[_0x169bc9[_0x3331('0x48')]]['toString']()});}else if(_0x169bc9[_0x3331('0x3f')]===_0x3331('0x49')&&_0x169bc9[_0x3331('0x4a')]&&_0x169bc9[_0x3331('0x4a')][_0x3331('0x12')]&&_0x169bc9[_0x3331('0x45')]&&_0x169bc9['customField']){_0x5280a3[_0x169bc9[_0x3331('0x4a')][_0x3331('0x12')][_0x3331('0x42')]()]&&_0x4e1c90['custom_fields']['push']({'id':_0x169bc9[_0x3331('0x45')],'value':_0x5280a3[_0x169bc9[_0x3331('0x4a')][_0x3331('0x12')][_0x3331('0x42')]()]['toString']()});}});}return _0x4e1c90;}exports[_0x3331('0x4b')]=function(_0x58bcba,_0x303c6a,_0x4a4a62,_0xb0dd5d,_0x389a68,_0xffdd08){var _0x36b5ef,_0x3b398d;_0xffdd08[_0x3331('0xe')]=intUtil[_0x3331('0x4c')](_0xffdd08[_0x3331('0xe')]);_0xffdd08['serverUrl']=intUtil[_0x3331('0x4c')](_0xffdd08[_0x3331('0x4d')]);if(_0x389a68&&_0x389a68[_0x3331('0x4e')]){logger['info'](_0x3331('0x4f'),'Recording\x20is\x20enabled!');_0x303c6a['recordingURL']=util['format'](_0x3331('0x50'),_0xffdd08['serverUrl'],_0x303c6a['uniqueid'],md5(_0x303c6a[_0x3331('0x51')]));}else{_0x303c6a[_0x3331('0x52')]='';}headers['Authorization']=getAuth(_0xffdd08);return getUser(_0xffdd08,_0xb0dd5d[_0x3331('0x53')])[_0x3331('0x16')](function(_0x5291ee){_0x36b5ef=_0x5291ee;logger['info'](_0x3331('0x54'),_0x36b5ef['id']);return getEndUser(_0xffdd08,_0x303c6a['calleridname'],_0x303c6a[_0x3331('0x55')]);})[_0x3331('0x16')](function(_0x3f409c){_0x3b398d=_0x3f409c;logger['info'](_0x3331('0x56'),_0x3b398d['id']);return getTicket(_0xffdd08,_0x36b5ef,_0x3b398d,_0x4a4a62,_0x303c6a);})['then'](function(_0x1b09f2){if(_0x1b09f2){logger[_0x3331('0xa')](_0x3331('0x57'),_0x1b09f2['id']);switch(_0xffdd08[_0x3331('0x3f')]){case _0x3331('0x58'):logger[_0x3331('0xa')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0x3331('0xc')](_0x3331('0x59'),_0xffdd08[_0x3331('0xe')],_0x36b5ef['id'],_0x1b09f2['id']),'method':'POST'});case _0x3331('0x5a'):logger[_0x3331('0xa')](_0x3331('0x4f'),_0x3331('0x5b'));emit(util['format'](_0x3331('0x5c'),_0xb0dd5d[_0x3331('0x12')]),_0x3331('0x5d'),{'uri':util[_0x3331('0xc')](_0x3331('0x5e'),_0xffdd08[_0x3331('0xe')][_0x3331('0x5f')]('/api/v2',''),_0x1b09f2['id'])});break;default:logger[_0x3331('0x60')](_0x3331('0x4f'),_0x3331('0x61'));}}})[_0x3331('0x62')](function(_0x2e4ce7){logger[_0x3331('0x60')](_0x3331('0x63'),util[_0x3331('0x64')](_0x2e4ce7,{'showHidden':!![],'depth':null}));});};exports[_0x3331('0x65')]=function(_0x280efc,_0x3c3c4f,_0x276009,_0x4caf8e,_0x5b7e87,_0x361871,_0x1ea231){var _0x437967,_0x274beb;_0x361871['remoteUri']=intUtil[_0x3331('0x4c')](_0x361871['remoteUri']);_0x361871[_0x3331('0x4d')]=intUtil['stripTrailingSlash'](_0x361871['serverUrl']);if(_0x1ea231&&_0x1ea231[_0x3331('0x66')]&&_0x1ea231['recordingFormat']!==_0x3331('0x67')){logger[_0x3331('0xa')](_0x3331('0x68'),'Recording\x20is\x20enabled!');_0x3c3c4f[_0x3331('0x52')]=util[_0x3331('0xc')](_0x3331('0x50'),_0x361871[_0x3331('0x4d')],_0x3c3c4f[_0x3331('0x51')],md5(_0x3c3c4f[_0x3331('0x51')]));}headers[_0x3331('0x69')]=getAuth(_0x361871);return getUser(_0x361871,_0x4caf8e[_0x3331('0x53')])[_0x3331('0x16')](function(_0x5710e4){_0x437967=_0x5710e4;logger['info']('The\x20User\x20ID\x20is:',_0x437967['id']);return getEndUser(_0x361871,_0x3c3c4f[_0x3331('0x6a')],_0x3c3c4f[_0x3331('0x6b')]);})[_0x3331('0x16')](function(_0x2cf478){_0x274beb=_0x2cf478;logger['info'](_0x3331('0x56'),_0x274beb['id']);return getTicket(_0x361871,_0x437967,_0x274beb,_0x276009,_0x3c3c4f);})[_0x3331('0x16')](function(_0x37ce4f){if(_0x37ce4f){logger[_0x3331('0xa')]('The\x20Ticket\x20ID\x20is:',_0x37ce4f['id']);switch(_0x361871[_0x3331('0x3f')]){case _0x3331('0x58'):logger[_0x3331('0xa')](_0x3331('0x68'),_0x3331('0x6c'));return request({'uri':util[_0x3331('0xc')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x361871['remoteUri'],_0x437967['id'],_0x37ce4f['id']),'method':'POST'});case _0x3331('0x5a'):logger[_0x3331('0xa')]('[OUTBOUND]',_0x3331('0x5b'));emit(util[_0x3331('0xc')](_0x3331('0x5c'),_0x4caf8e[_0x3331('0x12')]),'trigger:browser:url',{'uri':util[_0x3331('0xc')]('%s/agent/tickets/%s',_0x361871['remoteUri'][_0x3331('0x5f')](_0x3331('0x6d'),''),_0x37ce4f['id'])});break;default:logger[_0x3331('0x60')]('[OUTBOUND]',_0x3331('0x61'));}}})['catch'](function(_0x558361){logger['error'](_0x3331('0x6e'),util['inspect'](_0x558361,{'showHidden':!![],'depth':null}));});};exports['unmanaged']=function(_0xf85e40,_0x484584,_0x205d88,_0xe21b65,_0xc01b99,_0x712ad8){var _0x4d2573,_0x2a90cf;_0x712ad8[_0x3331('0xe')]=intUtil[_0x3331('0x4c')](_0x712ad8[_0x3331('0xe')]);_0x712ad8[_0x3331('0x4d')]=intUtil['stripTrailingSlash'](_0x712ad8[_0x3331('0x4d')]);if(_0xc01b99&&_0xc01b99[_0x3331('0x4e')]){logger[_0x3331('0xa')]('['+_0x484584[_0x3331('0x6f')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x484584[_0x3331('0x52')]=util[_0x3331('0xc')](_0x3331('0x50'),_0x712ad8[_0x3331('0x4d')],_0x484584[_0x3331('0x51')],md5(_0x484584[_0x3331('0x51')]));}else{_0x484584[_0x3331('0x52')]='';}headers[_0x3331('0x69')]=getAuth(_0x712ad8);return getUser(_0x712ad8)[_0x3331('0x16')](function(_0x269f91){_0x4d2573=_0x269f91;logger['info'](_0x3331('0x54'),_0x4d2573['id']);return getEndUser(_0x712ad8,_0x484584[_0x3331('0x70')],_0x484584[_0x3331('0x55')]);})[_0x3331('0x16')](function(_0x51e0ef){_0x2a90cf=_0x51e0ef;logger[_0x3331('0xa')]('The\x20Enduser\x20ID\x20is:',_0x2a90cf['id']);return getTicket(_0x712ad8,_0x4d2573,_0x2a90cf,_0x205d88,_0x484584);})['then'](function(_0x9a7277){if(_0x9a7277){logger[_0x3331('0xa')](_0x3331('0x57'),_0x9a7277['id']);}})[_0x3331('0x62')](function(_0x365620){logger[_0x3331('0x60')]('['+_0x484584[_0x3331('0x6f')]['toUpperCase']()+']'+_0x3331('0x71'),util['inspect'](_0x365620,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xc9d6=['find','results','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','user','type:user\x20role:end-user\x20phone:%s','end-user','length','first','Enduser\x20found!','%s/users.json','POST','Caller\x20-\x20%s','Enduser\x20created.','authType','password','%s:%s','username','toString','base64','debug','[HTTP]','stringify','defaults','GET','map','forEach','includes','string','picklist','type','customField','toLowerCase','content','idField','custom_fields','push','variableName','customVariable','Variable','name','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/agent/tickets/%s','replace','/api/v2','error','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','recordingFormat','[OUTBOUND]','Authorization','destcalleridname','Zendesk\x20account\x20type\x20not\x20recognized','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','localhost','redis','emit','application/json','info','%s/tickets.json','remoteUri','getString','Subjects','then','ticket','validateEmail','Getting\x20agent\x20with\x20email','format','%s/search.json','type:user\x20role:agent\x20email:%s','count','Agent\x20found!'];(function(_0x463ace,_0x21a674){var _0x10adbb=function(_0x4611a0){while(--_0x4611a0){_0x463ace['push'](_0x463ace['shift']());}};_0x10adbb(++_0x21a674);}(_0xc9d6,0x18a));var _0x6c9d=function(_0x5ad399,_0x2fc72a){_0x5ad399=_0x5ad399-0x0;var _0x5f0b40=_0xc9d6[_0x5ad399];return _0x5f0b40;};'use strict';var _=require(_0x6c9d('0x0'));var rp=require(_0x6c9d('0x1'));var md5=require(_0x6c9d('0x2'));var util=require(_0x6c9d('0x3'));var Redis=require(_0x6c9d('0x4'));var intUtil=require(_0x6c9d('0x5'));var config=require(_0x6c9d('0x6'));var logger=require(_0x6c9d('0x7'))('zendesk');config['redis']=_['defaults'](config['redis'],{'host':_0x6c9d('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x6c9d('0x9')]));function emit(_0x3f228d,_0x256411,_0x595aae){io['to'](_0x3f228d)[_0x6c9d('0xa')](_0x256411,_0x595aae);}var headers={'Content-Type':_0x6c9d('0xb'),'Accept':_0x6c9d('0xb')};function getTicket(_0xbd3509,_0x2b1be5,_0x4c97dd,_0xdda139,_0x5e6f27){logger[_0x6c9d('0xc')]('Creating\x20new\x20ticket...');return request({'uri':util['format'](_0x6c9d('0xd'),_0xbd3509[_0x6c9d('0xe')]),'method':'POST','body':{'ticket':_['merge']({'requester_id':_0x4c97dd['id'],'submitter_id':_0x2b1be5?_0x2b1be5['id']:undefined,'assignee_id':_0x2b1be5?_0x2b1be5['id']:undefined,'tags':getTags(_0xdda139['Tags'],'name'),'subject':intUtil[_0x6c9d('0xf')](_0xdda139[_0x6c9d('0x10')],_0x5e6f27,'\x20'),'description':intUtil[_0x6c9d('0xf')](_0xdda139['Descriptions'],_0x5e6f27,'\x0a'),'comment':{'public':![],'body':intUtil[_0x6c9d('0xf')](_0xdda139['Descriptions'],_0x5e6f27,'\x0a')}},getCustomFields(_0xdda139['Fields'],_0x5e6f27))}})[_0x6c9d('0x11')](function(_0x3723f0){logger[_0x6c9d('0xc')]('Ticket\x20created!');return _0x3723f0[_0x6c9d('0x12')];});}function getUser(_0x2ea87e,_0x2aa494){if(intUtil[_0x6c9d('0x13')](_0x2aa494)){logger['info'](_0x6c9d('0x14'),_0x2aa494);return request({'uri':util[_0x6c9d('0x15')](_0x6c9d('0x16'),_0x2ea87e[_0x6c9d('0xe')]),'qs':{'query':util['format'](_0x6c9d('0x17'),_0x2aa494)}})[_0x6c9d('0x11')](function(_0x40e62b){if(_0x40e62b[_0x6c9d('0x18')]){logger[_0x6c9d('0xc')](_0x6c9d('0x19'));return _[_0x6c9d('0x1a')](_0x40e62b[_0x6c9d('0x1b')],{'email':_0x2aa494,'role':'agent'});}else{logger[_0x6c9d('0xc')](_0x6c9d('0x1c'));return request({'uri':util[_0x6c9d('0x15')]('%s/users/me.json',_0x2ea87e[_0x6c9d('0xe')])})[_0x6c9d('0x11')](function(_0x293b2f){logger[_0x6c9d('0xc')](_0x6c9d('0x1d'));return _0x293b2f[_0x6c9d('0x1e')];});}});}else{logger[_0x6c9d('0xc')](_0x6c9d('0x1c'));return request({'uri':util['format']('%s/users/me.json',_0x2ea87e[_0x6c9d('0xe')])})[_0x6c9d('0x11')](function(_0x5dbd00){logger[_0x6c9d('0xc')](_0x6c9d('0x1d'));return _0x5dbd00[_0x6c9d('0x1e')];});}}function getEndUser(_0x5cd008,_0x51ab42,_0x269d62){logger[_0x6c9d('0xc')]('Searching\x20enduser\x20with\x20phone',_0x269d62);return request({'uri':util['format']('%s/search.json',_0x5cd008[_0x6c9d('0xe')]),'qs':{'query':util[_0x6c9d('0x15')](_0x6c9d('0x1f'),_0x269d62)}})[_0x6c9d('0x11')](function(_0x260998){var _0x4e58e1;if(_0x260998['results']['length']){_0x260998[_0x6c9d('0x1b')]=_['filter'](_0x260998[_0x6c9d('0x1b')],{'suspended':![],'role':_0x6c9d('0x20')});if(_0x260998[_0x6c9d('0x1b')][_0x6c9d('0x21')]){_0x4e58e1=_[_0x6c9d('0x22')](_0x260998[_0x6c9d('0x1b')]);}}if(_0x4e58e1){logger[_0x6c9d('0xc')](_0x6c9d('0x23'));return _0x4e58e1;}else{logger[_0x6c9d('0xc')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util['format'](_0x6c9d('0x24'),_0x5cd008[_0x6c9d('0xe')]),'method':_0x6c9d('0x25'),'body':{'user':{'role':_0x6c9d('0x20'),'name':util[_0x6c9d('0x15')](_0x6c9d('0x26'),_0x51ab42||_0x269d62),'phone':_0x269d62}}})[_0x6c9d('0x11')](function(_0x56415a){logger[_0x6c9d('0xc')](_0x6c9d('0x27'));return _0x56415a[_0x6c9d('0x1e')];});}});}function getAuth(_0xc9eab2){var _0x1f1bf9;if(_0xc9eab2[_0x6c9d('0x28')]===_0x6c9d('0x29')){_0x1f1bf9=util['format'](_0x6c9d('0x2a'),_0xc9eab2[_0x6c9d('0x2b')],_0xc9eab2[_0x6c9d('0x29')]);}else if(_0xc9eab2[_0x6c9d('0x28')]==='token'){_0x1f1bf9=util['format']('%s/token:%s',_0xc9eab2[_0x6c9d('0x2b')],_0xc9eab2['token']);}return util[_0x6c9d('0x15')]('Basic\x20%s',new Buffer(_0x1f1bf9)[_0x6c9d('0x2c')](_0x6c9d('0x2d')));}function request(_0x42ddcd){logger[_0x6c9d('0x2e')](_0x6c9d('0x2f'),JSON[_0x6c9d('0x30')](_0x42ddcd));return rp(_[_0x6c9d('0x31')](_0x42ddcd,{'method':_0x6c9d('0x32'),'headers':headers,'json':!![]}));}function getTags(_0x4c711c,_0x1a54c6){var _0x2b386a=[];if(_0x4c711c&&_0x4c711c[_0x6c9d('0x21')]>0x0){_0x2b386a=_[_0x6c9d('0x33')](_0x4c711c,_0x1a54c6);}return _0x2b386a;}function getCustomFields(_0x404e2f,_0x4ec756){var _0x2c67f0=[];var _0x133832={'custom_fields':[]};if(_0x404e2f[_0x6c9d('0x21')]>0x0){_[_0x6c9d('0x34')](_0x404e2f,function(_0x2a36cf){if(_[_0x6c9d('0x35')]([_0x6c9d('0x36'),_0x6c9d('0x37')],_0x2a36cf[_0x6c9d('0x38')])&&_0x2a36cf['nameField']&&!_0x2a36cf[_0x6c9d('0x39')]){_0x133832[_0x2a36cf['nameField'][_0x6c9d('0x3a')]()]=_0x2a36cf[_0x6c9d('0x3b')][_0x6c9d('0x2c')]();}else if(_[_0x6c9d('0x35')]([_0x6c9d('0x36'),_0x6c9d('0x37')],_0x2a36cf[_0x6c9d('0x38')])&&_0x2a36cf[_0x6c9d('0x3c')]&&_0x2a36cf['customField']){_0x133832[_0x6c9d('0x3d')][_0x6c9d('0x3e')]({'id':_0x2a36cf[_0x6c9d('0x3c')],'value':_0x2a36cf[_0x6c9d('0x3b')]['toString']()});}else if(_0x2a36cf[_0x6c9d('0x38')]==='variable'&&_0x2a36cf[_0x6c9d('0x3f')]&&_0x2a36cf['idField']&&_0x2a36cf['customField']){_0x4ec756[_0x2a36cf[_0x6c9d('0x3f')]]&&_0x133832['custom_fields'][_0x6c9d('0x3e')]({'id':_0x2a36cf[_0x6c9d('0x3c')],'value':_0x4ec756[_0x2a36cf[_0x6c9d('0x3f')]][_0x6c9d('0x2c')]()});}else if(_0x2a36cf[_0x6c9d('0x38')]===_0x6c9d('0x40')&&_0x2a36cf[_0x6c9d('0x41')]&&_0x2a36cf['Variable'][_0x6c9d('0x42')]&&_0x2a36cf[_0x6c9d('0x3c')]&&_0x2a36cf[_0x6c9d('0x39')]){_0x4ec756[_0x2a36cf[_0x6c9d('0x41')][_0x6c9d('0x42')][_0x6c9d('0x3a')]()]&&_0x133832[_0x6c9d('0x3d')][_0x6c9d('0x3e')]({'id':_0x2a36cf[_0x6c9d('0x3c')],'value':_0x4ec756[_0x2a36cf['Variable']['name'][_0x6c9d('0x3a')]()]['toString']()});}});}return _0x133832;}exports['queue']=function(_0x356552,_0x1d7da9,_0x43b783,_0x1d375c,_0x5700b7,_0x9ebb55){var _0x520790,_0x43d404;_0x9ebb55[_0x6c9d('0xe')]=intUtil[_0x6c9d('0x43')](_0x9ebb55[_0x6c9d('0xe')]);_0x9ebb55['serverUrl']=intUtil[_0x6c9d('0x43')](_0x9ebb55[_0x6c9d('0x44')]);if(_0x5700b7&&_0x5700b7[_0x6c9d('0x45')]){logger[_0x6c9d('0xc')](_0x6c9d('0x46'),_0x6c9d('0x47'));_0x1d7da9['recordingURL']=util['format'](_0x6c9d('0x48'),_0x9ebb55['serverUrl'],_0x1d7da9[_0x6c9d('0x49')],md5(_0x1d7da9[_0x6c9d('0x49')]));}else{_0x1d7da9[_0x6c9d('0x4a')]='';}headers['Authorization']=getAuth(_0x9ebb55);return getUser(_0x9ebb55,_0x1d375c[_0x6c9d('0x4b')])[_0x6c9d('0x11')](function(_0x8adaf){_0x520790=_0x8adaf;logger[_0x6c9d('0xc')](_0x6c9d('0x4c'),_0x520790['id']);return getEndUser(_0x9ebb55,_0x1d7da9[_0x6c9d('0x4d')],_0x1d7da9[_0x6c9d('0x4e')]);})[_0x6c9d('0x11')](function(_0x2c2b53){_0x43d404=_0x2c2b53;logger[_0x6c9d('0xc')](_0x6c9d('0x4f'),_0x43d404['id']);return getTicket(_0x9ebb55,_0x520790,_0x43d404,_0x43b783,_0x1d7da9);})[_0x6c9d('0x11')](function(_0x3ea94c){if(_0x3ea94c){logger[_0x6c9d('0xc')](_0x6c9d('0x50'),_0x3ea94c['id']);switch(_0x9ebb55[_0x6c9d('0x38')]){case _0x6c9d('0x51'):logger[_0x6c9d('0xc')]('[QUEUE]',_0x6c9d('0x52'));return request({'uri':util[_0x6c9d('0x15')](_0x6c9d('0x53'),_0x9ebb55[_0x6c9d('0xe')],_0x520790['id'],_0x3ea94c['id']),'method':_0x6c9d('0x25')});case _0x6c9d('0x54'):logger['info'](_0x6c9d('0x46'),_0x6c9d('0x55'));emit(util['format'](_0x6c9d('0x56'),_0x1d375c[_0x6c9d('0x42')]),_0x6c9d('0x57'),{'uri':util[_0x6c9d('0x15')](_0x6c9d('0x58'),_0x9ebb55[_0x6c9d('0xe')][_0x6c9d('0x59')](_0x6c9d('0x5a'),''),_0x3ea94c['id'])});break;default:logger[_0x6c9d('0x5b')](_0x6c9d('0x46'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0x6c9d('0x5c')](function(_0x4fa0d8){logger[_0x6c9d('0x5b')](_0x6c9d('0x5d'),util[_0x6c9d('0x5e')](_0x4fa0d8,{'showHidden':!![],'depth':null}));});};exports['outbound']=function(_0x44d088,_0xcf9ca8,_0x534d2d,_0x320d8c,_0x118691,_0x111afc,_0x2bcb72){var _0x50c79f,_0x96439b;_0x111afc[_0x6c9d('0xe')]=intUtil[_0x6c9d('0x43')](_0x111afc['remoteUri']);_0x111afc[_0x6c9d('0x44')]=intUtil[_0x6c9d('0x43')](_0x111afc[_0x6c9d('0x44')]);if(_0x2bcb72&&_0x2bcb72[_0x6c9d('0x5f')]&&_0x2bcb72['recordingFormat']!=='none'){logger[_0x6c9d('0xc')](_0x6c9d('0x60'),_0x6c9d('0x47'));_0xcf9ca8[_0x6c9d('0x4a')]=util[_0x6c9d('0x15')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x111afc[_0x6c9d('0x44')],_0xcf9ca8[_0x6c9d('0x49')],md5(_0xcf9ca8[_0x6c9d('0x49')]));}headers[_0x6c9d('0x61')]=getAuth(_0x111afc);return getUser(_0x111afc,_0x320d8c[_0x6c9d('0x4b')])[_0x6c9d('0x11')](function(_0xecae77){_0x50c79f=_0xecae77;logger['info'](_0x6c9d('0x4c'),_0x50c79f['id']);return getEndUser(_0x111afc,_0xcf9ca8[_0x6c9d('0x62')],_0xcf9ca8['destcalleridnum']);})[_0x6c9d('0x11')](function(_0x287afc){_0x96439b=_0x287afc;logger[_0x6c9d('0xc')](_0x6c9d('0x4f'),_0x96439b['id']);return getTicket(_0x111afc,_0x50c79f,_0x96439b,_0x534d2d,_0xcf9ca8);})['then'](function(_0x3b4a55){if(_0x3b4a55){logger[_0x6c9d('0xc')](_0x6c9d('0x50'),_0x3b4a55['id']);switch(_0x111afc[_0x6c9d('0x38')]){case _0x6c9d('0x51'):logger[_0x6c9d('0xc')]('[OUTBOUND]',_0x6c9d('0x52'));return request({'uri':util[_0x6c9d('0x15')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x111afc[_0x6c9d('0xe')],_0x50c79f['id'],_0x3b4a55['id']),'method':_0x6c9d('0x25')});case _0x6c9d('0x54'):logger[_0x6c9d('0xc')](_0x6c9d('0x60'),_0x6c9d('0x55'));emit(util['format'](_0x6c9d('0x56'),_0x320d8c[_0x6c9d('0x42')]),_0x6c9d('0x57'),{'uri':util[_0x6c9d('0x15')](_0x6c9d('0x58'),_0x111afc[_0x6c9d('0xe')][_0x6c9d('0x59')]('/api/v2',''),_0x3b4a55['id'])});break;default:logger[_0x6c9d('0x5b')]('[OUTBOUND]',_0x6c9d('0x63'));}}})[_0x6c9d('0x5c')](function(_0x4da264){logger[_0x6c9d('0x5b')](_0x6c9d('0x64'),util[_0x6c9d('0x5e')](_0x4da264,{'showHidden':!![],'depth':null}));});};exports[_0x6c9d('0x65')]=function(_0x401f8b,_0x2b834a,_0x4c7dd4,_0x2505ec,_0x4ee0e6,_0x335385){var _0x4d5e9d,_0x273600;_0x335385[_0x6c9d('0xe')]=intUtil[_0x6c9d('0x43')](_0x335385[_0x6c9d('0xe')]);_0x335385[_0x6c9d('0x44')]=intUtil[_0x6c9d('0x43')](_0x335385[_0x6c9d('0x44')]);if(_0x4ee0e6&&_0x4ee0e6[_0x6c9d('0x45')]){logger[_0x6c9d('0xc')]('['+_0x2b834a[_0x6c9d('0x66')][_0x6c9d('0x67')]()+']','Recording\x20is\x20enabled!');_0x2b834a['recordingURL']=util[_0x6c9d('0x15')](_0x6c9d('0x48'),_0x335385[_0x6c9d('0x44')],_0x2b834a[_0x6c9d('0x49')],md5(_0x2b834a[_0x6c9d('0x49')]));}else{_0x2b834a[_0x6c9d('0x4a')]='';}headers['Authorization']=getAuth(_0x335385);return getUser(_0x335385)[_0x6c9d('0x11')](function(_0x121eb1){_0x4d5e9d=_0x121eb1;logger['info'](_0x6c9d('0x4c'),_0x4d5e9d['id']);return getEndUser(_0x335385,_0x2b834a[_0x6c9d('0x4d')],_0x2b834a[_0x6c9d('0x4e')]);})[_0x6c9d('0x11')](function(_0xb1f3f2){_0x273600=_0xb1f3f2;logger[_0x6c9d('0xc')](_0x6c9d('0x4f'),_0x273600['id']);return getTicket(_0x335385,_0x4d5e9d,_0x273600,_0x4c7dd4,_0x2b834a);})[_0x6c9d('0x11')](function(_0x55b855){if(_0x55b855){logger['info'](_0x6c9d('0x50'),_0x55b855['id']);}})[_0x6c9d('0x5c')](function(_0x5526ad){logger['error']('['+_0x2b834a[_0x6c9d('0x66')][_0x6c9d('0x67')]()+']'+_0x6c9d('0x68'),util[_0x6c9d('0x5e')](_0x5526ad,{'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 463a9e6..5088907 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 _0x6e7f=['agentcalledAt','Call_Type','Inbound','merge','Fields','/crm/v2/Calls','details','err','host','stripTrailingSlash','serverUrl','recordingURL','/api/voice/recordings/','/downloads?type=uniqueid&token=','uniqueid','zoho.eu','com','email','calleridname','calleridnum','The\x20Call\x20ID\x20is:','[QUEUE]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','The\x20User\x20ID\x20is:','destcalleridname','unmanaged','monitor_format','toUpperCase','lodash','request-promise','md5','util','./util','moment','ioredis','../../../../config/logger','zoho','defaults','redis','localhost','socket.io-emitter','emit','[HTTP]','stringify','length','forEach','includes','string','picklist','type','idField','toString','variable','variableName','Variable','name','toLowerCase','indexOf','split','isNil','access_token','isBefore','expires_in','zone','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','then','add','seconds','error','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','GET','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','users','Agent\x20found!','Using\x20the\x20admin\x20account!','findIndex','profile','user','Administrator','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','The\x20failing\x20result\x20is','catch','data','enduserType','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','code','SUCCESS','Error:\x20','log','CREATE\x20ERROR','moduleSearch','contact_lead','uri','https://www.zohoapis.','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','nothing','lead','Creating\x20new\x20call...','Owner','administrator','Subject','Subjects','Description','getString','Descriptions','Full_Name','Last_Name','Leads','First_Name','$se_module','talktime','utc','format','mm:ss','answertime','endtime','Call_Duration','YYYY-MM-DDTHH:mm:ss','diff','starttime','lastevent','complete','connect','Call_Result','rejected','Rejected','abandoned','timeout','Timeout','Call_Start_Time','outbound'];(function(_0x522c6d,_0x4d250d){var _0x26300d=function(_0x3ab228){while(--_0x3ab228){_0x522c6d['push'](_0x522c6d['shift']());}};_0x26300d(++_0x4d250d);}(_0x6e7f,0xc4));var _0xf6e7=function(_0x28cec4,_0x419b54){_0x28cec4=_0x28cec4-0x0;var _0x15c645=_0x6e7f[_0x28cec4];return _0x15c645;};'use strict';var _=require(_0xf6e7('0x0'));var rp=require(_0xf6e7('0x1'));var md5=require(_0xf6e7('0x2'));var util=require(_0xf6e7('0x3'));var intUtil=require(_0xf6e7('0x4'));var moment=require(_0xf6e7('0x5'));var Redis=require(_0xf6e7('0x6'));var BPromise=require('bluebird');var config=require('../../../../config/environment');var logger=require(_0xf6e7('0x7'))(_0xf6e7('0x8'));config['redis']=_[_0xf6e7('0x9')](config[_0xf6e7('0xa')],{'host':_0xf6e7('0xb'),'port':0x18eb});var io=require(_0xf6e7('0xc'))(new Redis(config[_0xf6e7('0xa')]));function emit(_0x451313,_0x37d8eb,_0x196c96){io['to'](_0x451313)[_0xf6e7('0xd')](_0x37d8eb,_0x196c96);}function request(_0x3a84a5){logger['debug'](_0xf6e7('0xe'),JSON[_0xf6e7('0xf')](_0x3a84a5));return rp(_0x3a84a5);}function getCustomFields(_0x8568a1,_0x2c4ce2){var _0x3be625={};if(_0x8568a1[_0xf6e7('0x10')]>0x0){_[_0xf6e7('0x11')](_0x8568a1,function(_0x40ca48){if(_[_0xf6e7('0x12')]([_0xf6e7('0x13'),_0xf6e7('0x14')],_0x40ca48[_0xf6e7('0x15')])&&_0x40ca48[_0xf6e7('0x16')]){_0x3be625[_0x40ca48[_0xf6e7('0x16')]]=_0x40ca48['content'][_0xf6e7('0x17')]();}else if(_0x40ca48[_0xf6e7('0x15')]===_0xf6e7('0x18')&&_0x40ca48[_0xf6e7('0x19')]&&_0x40ca48['idField']&&_0x2c4ce2[_0x40ca48['variableName']]){_0x3be625[_0x40ca48[_0xf6e7('0x16')]]=_0x2c4ce2[_0x40ca48['variableName']]['toString']();}else if(_0x40ca48[_0xf6e7('0x15')]==='customVariable'&&_0x40ca48[_0xf6e7('0x1a')]&&_0x40ca48[_0xf6e7('0x1a')][_0xf6e7('0x1b')]&&_0x40ca48[_0xf6e7('0x16')]&&_0x2c4ce2[_0x40ca48[_0xf6e7('0x1a')][_0xf6e7('0x1b')][_0xf6e7('0x1c')]()]){_0x3be625[_0x40ca48[_0xf6e7('0x16')]]=_0x2c4ce2[_0x40ca48[_0xf6e7('0x1a')][_0xf6e7('0x1b')][_0xf6e7('0x1c')]()][_0xf6e7('0x17')]();}});}return _0x3be625;}function getName(_0x15b71f){if(_0x15b71f[_0xf6e7('0x1d')]('\x20')>0x0){var _0x26ed17=_0x15b71f[_0xf6e7('0x1e')](/ (.+)/);if(_0x26ed17[0x1]){return _0x26ed17;}}return[_0x15b71f,_0x15b71f];}var accountsTokens={};function getAccessToken(_0xd19368){return new Promise(function(_0x1322d6,_0x1cd96f){if(!_[_0xf6e7('0x1f')](accountsTokens[_0xd19368['id']])&&!_[_0xf6e7('0x1f')](accountsTokens[_0xd19368['id']][_0xf6e7('0x20')])){if(moment()[_0xf6e7('0x21')](accountsTokens[_0xd19368['id']][_0xf6e7('0x22')])){_0x1322d6(accountsTokens[_0xd19368['id']][_0xf6e7('0x20')]);}}var _0x1953ce;switch(_0xd19368[_0xf6e7('0x23')]){case'US':_0x1953ce='https://accounts.zoho.com';break;case'AU':_0x1953ce=_0xf6e7('0x24');break;case'EU':_0x1953ce=_0xf6e7('0x25');break;case'IN':_0x1953ce=_0xf6e7('0x26');break;case'CN':_0x1953ce=_0xf6e7('0x27');break;default:_0x1953ce='https://accounts.zoho.eu';break;}var _0x2356c1={'method':_0xf6e7('0x28'),'uri':_0x1953ce+_0xf6e7('0x29'),'qs':{'refresh_token':_0xd19368[_0xf6e7('0x2a')],'client_id':_0xd19368[_0xf6e7('0x2b')],'client_secret':_0xd19368[_0xf6e7('0x2c')],'grant_type':_0xf6e7('0x2d')},'json':!![]};return rp(_0x2356c1)[_0xf6e7('0x2e')](function(_0x23db2c){accountsTokens[_0xd19368['id']]={'access_token':_0x23db2c[_0xf6e7('0x20')],'expires_in':moment()[_0xf6e7('0x2f')](_0x23db2c[_0xf6e7('0x22')],_0xf6e7('0x30'))};_0x1322d6(_0x23db2c[_0xf6e7('0x20')]);})['catch'](function(_0x1533b0){logger[_0xf6e7('0x31')](_0xf6e7('0x32'),_0x1533b0[_0xf6e7('0x33')]);_0x1cd96f(_0x1533b0);});});}function getUser(_0x1d5e91,_0x3384f2,_0x1b08f5,_0x3b84c2){logger[_0xf6e7('0x34')](_0xf6e7('0x35'));return request({'method':_0xf6e7('0x36'),'uri':util['format'](_0xf6e7('0x37'),_0x3384f2),'qs':{'type':_0xf6e7('0x38')},'headers':{'Authorization':_0xf6e7('0x39')+_0x1d5e91},'json':!![]})[_0xf6e7('0x2e')](function(_0x4551d7){if(_0x4551d7[_0xf6e7('0x3a')]){var _0x17625b=-0x1;if(_['isArrayLikeObject'](_0x4551d7['users'])){if(!_[_0xf6e7('0x1f')](_0x3b84c2)){_0x17625b=_['findIndex'](_0x4551d7[_0xf6e7('0x3a')],function(_0x278838){return _0x278838['email']===_0x3b84c2;});}if(_0x17625b>=0x0){logger[_0xf6e7('0x34')](_0xf6e7('0x3b'));}else{logger[_0xf6e7('0x34')](_0xf6e7('0x3c'));_0x17625b=_[_0xf6e7('0x3d')](_0x4551d7[_0xf6e7('0x3a')],function(_0x560552){return _0x560552[_0xf6e7('0x3e')][_0xf6e7('0x1b')]==='Administrator';});}return _0x4551d7[_0xf6e7('0x3a')][_0x17625b];}else{if(_0x4551d7[_0xf6e7('0x3f')]['profile']['name']===_0xf6e7('0x40')){logger['info']('Using\x20the\x20admin\x20account!');user=_0x4551d7[_0xf6e7('0x3f')];return user;}else{logger[_0xf6e7('0x31')]('The\x20failing\x20result\x20is',JSON[_0xf6e7('0xf')](_0x4551d7));throw new Error(_0xf6e7('0x41')+JSON[_0xf6e7('0xf')](_0x4551d7));}}}else{logger[_0xf6e7('0x31')](_0xf6e7('0x42'),JSON['stringify'](_0x4551d7));throw new Error(_0xf6e7('0x41')+JSON['stringify'](_0x4551d7));}})[_0xf6e7('0x43')](function(_0x2f81c9){console[_0xf6e7('0x31')](_0x2f81c9);});}function getZohoUser(_0x2c0a91,_0x37b8fe){return new BPromise(function(_0x419306,_0x378e0c){request(_0x2c0a91)[_0xf6e7('0x2e')](function(_0x3fad62){var _0x2d32a0=null;if(_0x3fad62){_0x2d32a0=_0x3fad62[_0xf6e7('0x44')][0x0];_0x2d32a0[_0xf6e7('0x45')]=_0x37b8fe;}_0x419306(_0x2d32a0);})[_0xf6e7('0x43')](function(_0x2e1d03){_0x378e0c(_0x2e1d03);});});}function createEndUser(_0x372c5b,_0x36f167,_0x440707,_0x3e41b6,_0x26d048,_0x5cff8e){var _0x440707=getName(_0x440707);return request({'method':_0xf6e7('0x28'),'uri':'https://www.zohoapis.'+_0x36f167+_0xf6e7('0x46')+_[_0xf6e7('0x47')](_0x5cff8e[_0xf6e7('0x48')])+'s','body':{'data':[{'Last_Name':_0x440707[0x1],'First_Name':_0x440707[0x0],'Phone':_0x3e41b6,'Owner':{'name':!_[_0xf6e7('0x1f')](_0x26d048[_0xf6e7('0x49')]['name'])?_0x26d048['role'][_0xf6e7('0x1b')]:!_[_0xf6e7('0x1f')](_0x26d048[_0xf6e7('0x4a')])?_0x26d048[_0xf6e7('0x4a')]+'\x20'+_0x26d048[_0xf6e7('0x4b')]:_0x26d048[_0xf6e7('0x4b')],'id':_0x26d048['id']}}]},'headers':{'Authorization':_0xf6e7('0x39')+_0x372c5b},'json':!![]})[_0xf6e7('0x2e')](function(_0x24cb17){if(_0x24cb17&&_0x24cb17[_0xf6e7('0x44')][0x0][_0xf6e7('0x4c')]===_0xf6e7('0x4d')){var _0x4a80db=_0x24cb17[_0xf6e7('0x44')][0x0]['details'];_0x4a80db[_0xf6e7('0x45')]=_['startCase'](_0x5cff8e[_0xf6e7('0x48')])+'s';return _0x4a80db;}logger['error'](_0xf6e7('0x42'),JSON[_0xf6e7('0xf')](data));throw new Error(_0xf6e7('0x4e')+JSON[_0xf6e7('0xf')](data));})['catch'](function(_0x44f889){console[_0xf6e7('0x4f')](_0xf6e7('0x50'),_0x44f889);});}function getEndUser(_0x59fb8b,_0x15ab34,_0x332f5c,_0x521ff8,_0x3b9384,_0x19272f,_0x4b5050){var _0x27bf3d={'method':'GET','uri':'','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x59fb8b},'json':!![]};switch(_0x4b5050[_0xf6e7('0x51')]){case _0xf6e7('0x52'):_0x27bf3d[_0xf6e7('0x53')]=_0xf6e7('0x54')+_0x15ab34+_0xf6e7('0x55')+_0x3b9384+'))';return getZohoUser(_0x27bf3d,_0xf6e7('0x56'))['then'](function(_0x12b456){if(_0x12b456)return _0x12b456;_0x27bf3d[_0xf6e7('0x53')]='https://www.zohoapis.'+_0x15ab34+_0xf6e7('0x57')+_0x3b9384+'))';return getZohoUser(_0x27bf3d,'Leads')[_0xf6e7('0x2e')](function(_0x562587){if(_0x562587)return _0x562587;if(_0x4b5050['moduleCreate']!=_0xf6e7('0x58')){return createEndUser(_0x59fb8b,_0x15ab34,_0x521ff8,_0x3b9384,_0x19272f,_0x4b5050);}else{return{};}});});break;case'contact':_0x27bf3d[_0xf6e7('0x53')]=_0xf6e7('0x54')+_0x15ab34+_0xf6e7('0x55')+_0x3b9384+'))';return getZohoUser(_0x27bf3d,_0xf6e7('0x56'))['then'](function(_0x38c34a){if(_0x38c34a)return _0x38c34a;if(_0x4b5050[_0xf6e7('0x48')]!=_0xf6e7('0x58')){return createEndUser(_0x59fb8b,_0x15ab34,_0x521ff8,_0x3b9384,_0x19272f,_0x4b5050);}else{return{};}});break;case _0xf6e7('0x59'):_0x27bf3d[_0xf6e7('0x53')]=_0xf6e7('0x54')+_0x15ab34+_0xf6e7('0x57')+_0x3b9384+'))';return getZohoUser(_0x27bf3d,'Leads')[_0xf6e7('0x2e')](function(_0x35c0ae){if(_0x35c0ae)return _0x35c0ae;if(_0x4b5050[_0xf6e7('0x48')]!=_0xf6e7('0x58')){return createEndUser(_0x59fb8b,_0x15ab34,_0x521ff8,_0x3b9384,_0x19272f,_0x4b5050);}else{return{};}});break;}}function getCall(_0x51a906,_0x4f9014,_0x50e15c,_0x1f20a9,_0xb4d8c5,_0x3ab116,_0x18bee9,_0x2c772b){logger['info'](_0xf6e7('0x5a'));var _0x49741d={};_0x49741d[_0xf6e7('0x5b')]={'name':!_[_0xf6e7('0x1f')](_0x1f20a9['role'][_0xf6e7('0x1b')])&&!_['isNil'](_0x1f20a9[_0xf6e7('0x3e')]['name'])&&_0x1f20a9[_0xf6e7('0x3e')][_0xf6e7('0x1b')]===_0xf6e7('0x5c')?_0x1f20a9[_0xf6e7('0x49')][_0xf6e7('0x1b')]:!_[_0xf6e7('0x1f')](_0x1f20a9[_0xf6e7('0x4a')])?_0x1f20a9['first_name']+'\x20'+_0x1f20a9['last_name']:_0x1f20a9['last_name'],'id':_0x1f20a9['id']};_0x49741d[_0xf6e7('0x5d')]=intUtil['getString'](_0x3ab116[_0xf6e7('0x5e')],_0x18bee9,'\x20');_0x49741d[_0xf6e7('0x5f')]=intUtil[_0xf6e7('0x60')](_0x3ab116[_0xf6e7('0x61')],_0x18bee9,'\x0a');if(_0xb4d8c5[_0xf6e7('0x45')]===_0xf6e7('0x56')){_0x49741d['Who_Id']={'name':!_[_0xf6e7('0x1f')](_0xb4d8c5[_0xf6e7('0x62')])?_0xb4d8c5[_0xf6e7('0x62')]:!_['isNil'](_0xb4d8c5['First_Name'])?_0xb4d8c5['First_Name']+'\x20'+_0xb4d8c5[_0xf6e7('0x63')]:_0xb4d8c5[_0xf6e7('0x63')],'id':_0xb4d8c5['id']};}if(_0xb4d8c5[_0xf6e7('0x45')]===_0xf6e7('0x64')){_0x49741d['What_Id']={'name':!_[_0xf6e7('0x1f')](_0xb4d8c5[_0xf6e7('0x62')])?_0xb4d8c5[_0xf6e7('0x62')]:!_[_0xf6e7('0x1f')](_0xb4d8c5[_0xf6e7('0x65')])?_0xb4d8c5[_0xf6e7('0x65')]+'\x20'+_0xb4d8c5[_0xf6e7('0x63')]:_0xb4d8c5[_0xf6e7('0x63')],'id':_0xb4d8c5['id']};_0x49741d[_0xf6e7('0x66')]=_[_0xf6e7('0x47')](_0xb4d8c5[_0xf6e7('0x45')]);}if(_0x18bee9[_0xf6e7('0x67')]){_0x49741d['Call_Duration']=moment[_0xf6e7('0x68')](parseInt(_0x18bee9['talktime'])*0x3e8)[_0xf6e7('0x69')](_0xf6e7('0x6a'));}else if(_0x18bee9[_0xf6e7('0x6b')]&&_0x18bee9[_0xf6e7('0x6c')]){_0x49741d[_0xf6e7('0x6d')]=moment[_0xf6e7('0x68')](moment(_0x18bee9[_0xf6e7('0x6c')],_0xf6e7('0x6e'))[_0xf6e7('0x6f')](moment(_0x18bee9[_0xf6e7('0x70')],'YYYY-MM-DDTHH:mm:ss')))[_0xf6e7('0x69')](_0xf6e7('0x6a'));}switch(_0x18bee9[_0xf6e7('0x71')]){case'called':_0x49741d['Call_Result']='Called';break;case _0xf6e7('0x72'):case _0xf6e7('0x73'):_0x49741d[_0xf6e7('0x74')]='Answered';break;case _0xf6e7('0x75'):_0x49741d[_0xf6e7('0x74')]=_0xf6e7('0x76');break;case _0xf6e7('0x77'):_0x49741d[_0xf6e7('0x74')]='Abandoned';break;case _0xf6e7('0x78'):_0x49741d[_0xf6e7('0x74')]=_0xf6e7('0x79');default:}_0x49741d[_0xf6e7('0x7a')]=(_0x2c772b===_0xf6e7('0x7b')?moment(_0x18bee9['starttime'])[_0xf6e7('0x69')](_0xf6e7('0x6e')):moment(_0x18bee9[_0xf6e7('0x7c')])[_0xf6e7('0x69')](_0xf6e7('0x6e')))||moment()[_0xf6e7('0x69')](_0xf6e7('0x6e'));_0x49741d[_0xf6e7('0x7d')]=_0x2c772b||_0xf6e7('0x7e');_0x49741d=_[_0xf6e7('0x7f')](_0x49741d,getCustomFields(_0x3ab116[_0xf6e7('0x80')],_0x18bee9));return request({'method':_0xf6e7('0x28'),'uri':_0xf6e7('0x54')+_0x4f9014+_0xf6e7('0x81'),'headers':{'Authorization':_0xf6e7('0x39')+_0x51a906},'body':{'data':[_0x49741d]},'json':!![]})[_0xf6e7('0x2e')](function(_0x59e142){if(_0x59e142&&_0x59e142[_0xf6e7('0x44')][0x0]['code']===_0xf6e7('0x4d')){logger['info']('Call\x20created!');return{'id':_0x59e142[_0xf6e7('0x44')][0x0][_0xf6e7('0x82')]['id']};}})['catch'](function(_0x5e25a8){logger[_0xf6e7('0x34')](_0xf6e7('0x83'),_0x5e25a8[_0xf6e7('0x33')]);console[_0xf6e7('0x4f')](_0xf6e7('0x83'),_0x5e25a8);});}exports['queue']=function(_0x468aac,_0x12bfc6,_0xe44a06,_0x3bc6cc,_0x145aa3,_0x5edc9f){var _0x4e97f5,_0xef17df,_0x48fb71;_0x5edc9f[_0xf6e7('0x84')]=intUtil[_0xf6e7('0x85')](_0x5edc9f['host']);_0x5edc9f['serverUrl']=intUtil[_0xf6e7('0x85')](_0x5edc9f[_0xf6e7('0x86')]);if(_0x145aa3&&_0x145aa3['monitor_format']){logger[_0xf6e7('0x34')]('[QUEUE]','Recording\x20is\x20enabled!');_0x12bfc6[_0xf6e7('0x87')]=_0x5edc9f[_0xf6e7('0x86')]+_0xf6e7('0x88')+_0x12bfc6['uniqueid']+_0xf6e7('0x89')+md5(_0x12bfc6[_0xf6e7('0x8a')]);}else{_0x12bfc6[_0xf6e7('0x87')]='';}var _0x5446f1=_0x5edc9f['host']===_0xf6e7('0x8b')?'eu':_0xf6e7('0x8c');return getAccessToken(_0x5edc9f)[_0xf6e7('0x2e')](function(_0x43f28a){_0x48fb71=_0x43f28a;return getUser(_0x48fb71,_0x5446f1,_0x5edc9f,_0x3bc6cc[_0xf6e7('0x8d')]);})[_0xf6e7('0x2e')](function(_0x208fcb){_0x4e97f5=_0x208fcb;logger[_0xf6e7('0x34')]('The\x20User\x20ID\x20is:',_0x4e97f5['id']);return getEndUser(_0x48fb71,_0x5446f1,_0x5edc9f,_0x12bfc6[_0xf6e7('0x8e')],_0x12bfc6[_0xf6e7('0x8f')],_0x4e97f5,_0xe44a06);})[_0xf6e7('0x2e')](function(_0x26201e){_0xef17df=_0x26201e;return getCall(_0x48fb71,_0x5446f1,_0x5edc9f,_0x4e97f5,_0xef17df,_0xe44a06,_0x12bfc6,'Inbound');})[_0xf6e7('0x2e')](function(_0x2c50f6){if(_0x2c50f6){logger[_0xf6e7('0x34')](_0xf6e7('0x90'),_0x2c50f6['id']);logger[_0xf6e7('0x34')](_0xf6e7('0x91'),_0xf6e7('0x92'));emit(util['format'](_0xf6e7('0x93'),_0x3bc6cc[_0xf6e7('0x1b')]),_0xf6e7('0x94'),{'uri':_0xf6e7('0x95')+_0x5edc9f[_0xf6e7('0x84')]+_0xf6e7('0x96')+_0x2c50f6['id']});}})[_0xf6e7('0x43')](function(_0x23629f){logger['error'](_0xf6e7('0x91'),JSON[_0xf6e7('0xf')](_0x23629f));});};exports['outbound']=function(_0x318c8f,_0x34524b,_0x57547a,_0x3c7502,_0x58d3b1,_0x5dd416,_0x16b7df){var _0x1b2da8,_0x529f77,_0x3dbaed;_0x5dd416[_0xf6e7('0x84')]=intUtil[_0xf6e7('0x85')](_0x5dd416[_0xf6e7('0x84')]);_0x5dd416[_0xf6e7('0x86')]=intUtil[_0xf6e7('0x85')](_0x5dd416[_0xf6e7('0x86')]);if(_0x16b7df&&_0x16b7df[_0xf6e7('0x97')]&&_0x16b7df[_0xf6e7('0x97')]!==_0xf6e7('0x98')){logger[_0xf6e7('0x34')](_0xf6e7('0x99'),_0xf6e7('0x9a'));_0x34524b[_0xf6e7('0x87')]=_0x5dd416[_0xf6e7('0x86')]+_0xf6e7('0x88')+_0x34524b['uniqueid']+_0xf6e7('0x89')+md5(_0x34524b['uniqueid']);}var _0x450fcf=_0x5dd416[_0xf6e7('0x84')]==='zoho.eu'?'eu':_0xf6e7('0x8c');return getAccessToken(_0x5dd416)[_0xf6e7('0x2e')](function(_0xdac7c2){_0x3dbaed=_0xdac7c2;return getUser(_0x3dbaed,_0x450fcf,_0x5dd416,_0x3c7502[_0xf6e7('0x8d')]);})[_0xf6e7('0x2e')](function(_0x3daec7){_0x1b2da8=_0x3daec7;logger[_0xf6e7('0x34')](_0xf6e7('0x9b'),_0x1b2da8['id']);return getEndUser(_0x3dbaed,_0x450fcf,_0x5dd416,_0x34524b[_0xf6e7('0x9c')],_0x34524b['destcalleridnum'],_0x1b2da8,_0x57547a);})['then'](function(_0x18d8f3){_0x529f77=_0x18d8f3;return getCall(_0x3dbaed,_0x450fcf,_0x5dd416,_0x1b2da8,_0x529f77,_0x57547a,_0x34524b,'Outbound');})['then'](function(_0x2b3533){if(_0x2b3533){logger[_0xf6e7('0x34')](_0xf6e7('0x90'),_0x2b3533['id']);logger[_0xf6e7('0x34')]('[OUTBOUND]',_0xf6e7('0x92'));emit(util['format'](_0xf6e7('0x93'),_0x3c7502['name']),_0xf6e7('0x94'),{'uri':_0xf6e7('0x95')+_0x5dd416['host']+_0xf6e7('0x96')+_0x2b3533['id']});}})[_0xf6e7('0x43')](function(_0x4a4600){logger[_0xf6e7('0x31')](_0xf6e7('0x99'),JSON[_0xf6e7('0xf')](_0x4a4600));});};exports[_0xf6e7('0x9d')]=function(_0x48fe65,_0x4849be,_0x2a1fe3,_0x4e05f6,_0x24070c,_0x3bd0fa){var _0x1fa527,_0x39140e,_0x1b9cf0;_0x3bd0fa[_0xf6e7('0x84')]=intUtil[_0xf6e7('0x85')](_0x3bd0fa[_0xf6e7('0x84')]);_0x3bd0fa[_0xf6e7('0x86')]=intUtil[_0xf6e7('0x85')](_0x3bd0fa['serverUrl']);if(_0x24070c&&_0x24070c[_0xf6e7('0x9e')]){logger['info']('['+_0x4849be[_0xf6e7('0x71')][_0xf6e7('0x9f')]()+']',_0xf6e7('0x9a'));_0x4849be[_0xf6e7('0x87')]=_0x3bd0fa[_0xf6e7('0x86')]+_0xf6e7('0x88')+_0x4849be[_0xf6e7('0x8a')]+'/downloads?type=uniqueid&token='+md5(_0x4849be[_0xf6e7('0x8a')]);}else{_0x4849be['recordingURL']='';}var _0xb485f7=_0x3bd0fa['host']===_0xf6e7('0x8b')?'eu':_0xf6e7('0x8c');return getAccessToken(_0x3bd0fa)['then'](function(_0x5b9b21){_0x1b9cf0=_0x5b9b21;return getUser(_0x1b9cf0,_0xb485f7,_0x3bd0fa);})[_0xf6e7('0x2e')](function(_0x2718d0){_0x1fa527=_0x2718d0;logger[_0xf6e7('0x34')]('The\x20User\x20ID\x20is:',_0x1fa527['id']);return getEndUser(_0x1b9cf0,_0xb485f7,_0x3bd0fa,_0x4849be[_0xf6e7('0x8e')],_0x4849be['calleridnum'],_0x1fa527,_0x2a1fe3);})[_0xf6e7('0x2e')](function(_0xd49758){_0x39140e=_0xd49758;return getCall(_0x1b9cf0,_0xb485f7,_0x3bd0fa,_0x1fa527,_0x39140e,_0x2a1fe3,_0x4849be,_0xf6e7('0x7e'));})[_0xf6e7('0x2e')](function(_0x313f70){if(_0x313f70){logger[_0xf6e7('0x34')]('The\x20Call\x20ID\x20is:',_0x313f70['id']);}})[_0xf6e7('0x43')](function(_0x61d4c1){logger[_0xf6e7('0x31')]('['+_0x4849be['lastevent']['toUpperCase']()+']',JSON['stringify'](_0x61d4c1));});}; \ No newline at end of file +var _0x4d7f=['outbound','Inbound','merge','Fields','/crm/v2/Calls','Call\x20created!','stack','err','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','zoho.eu','com','email','calleridname','calleridnum','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','host','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','[OUTBOUND]','/downloads?type=uniqueid&token=','The\x20User\x20ID\x20is:','destcalleridnum','Outbound','unmanaged','toUpperCase','lodash','md5','./util','moment','ioredis','bluebird','../../../../config/environment','zoho','defaults','redis','localhost','emit','[HTTP]','stringify','length','forEach','includes','picklist','type','idField','content','toString','variableName','Variable','name','toLowerCase','access_token','isBefore','expires_in','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.com.cn','/oauth/v2/token','refreshToken','clientId','clientSecret','add','error','Failing\x20creating\x20the\x20access_token','info','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','then','users','isArrayLikeObject','findIndex','Agent\x20found!','Using\x20the\x20admin\x20account!','Administrator','user','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','catch','data','enduserType','POST','https://www.zohoapis.','startCase','moduleCreate','isNil','role','first_name','last_name','Zoho-oauthtoken\x20','code','SUCCESS','details','The\x20failing\x20result\x20is','Error:\x20','log','CREATE\x20ERROR','moduleSearch','contact_lead','uri','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','contact','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','lead','Creating\x20new\x20call...','profile','administrator','Subject','getString','Description','Descriptions','Full_Name','First_Name','Last_Name','What_Id','$se_module','talktime','mm:ss','Call_Duration','utc','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','lastevent','called','Call_Result','Called','complete','connect','Answered','rejected','Rejected','abandoned','Abandoned','timeout','Timeout','Call_Start_Time'];(function(_0x22c46d,_0x443e4a){var _0x443881=function(_0x40803d){while(--_0x40803d){_0x22c46d['push'](_0x22c46d['shift']());}};_0x443881(++_0x443e4a);}(_0x4d7f,0xc1));var _0xf4d7=function(_0xb5dabc,_0x2b0598){_0xb5dabc=_0xb5dabc-0x0;var _0x5cffb9=_0x4d7f[_0xb5dabc];return _0x5cffb9;};'use strict';var _=require(_0xf4d7('0x0'));var rp=require('request-promise');var md5=require(_0xf4d7('0x1'));var util=require('util');var intUtil=require(_0xf4d7('0x2'));var moment=require(_0xf4d7('0x3'));var Redis=require(_0xf4d7('0x4'));var BPromise=require(_0xf4d7('0x5'));var config=require(_0xf4d7('0x6'));var logger=require('../../../../config/logger')(_0xf4d7('0x7'));config['redis']=_[_0xf4d7('0x8')](config[_0xf4d7('0x9')],{'host':_0xf4d7('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xf4d7('0x9')]));function emit(_0x43036b,_0x5cfee6,_0x4370a7){io['to'](_0x43036b)[_0xf4d7('0xb')](_0x5cfee6,_0x4370a7);}function request(_0x473d45){logger['debug'](_0xf4d7('0xc'),JSON[_0xf4d7('0xd')](_0x473d45));return rp(_0x473d45);}function getCustomFields(_0x21cc59,_0x46ef3a){var _0x3be4b4={};if(_0x21cc59[_0xf4d7('0xe')]>0x0){_[_0xf4d7('0xf')](_0x21cc59,function(_0x50bd06){if(_[_0xf4d7('0x10')](['string',_0xf4d7('0x11')],_0x50bd06[_0xf4d7('0x12')])&&_0x50bd06[_0xf4d7('0x13')]){_0x3be4b4[_0x50bd06[_0xf4d7('0x13')]]=_0x50bd06[_0xf4d7('0x14')][_0xf4d7('0x15')]();}else if(_0x50bd06['type']==='variable'&&_0x50bd06[_0xf4d7('0x16')]&&_0x50bd06[_0xf4d7('0x13')]&&_0x46ef3a[_0x50bd06[_0xf4d7('0x16')]]){_0x3be4b4[_0x50bd06[_0xf4d7('0x13')]]=_0x46ef3a[_0x50bd06[_0xf4d7('0x16')]][_0xf4d7('0x15')]();}else if(_0x50bd06['type']==='customVariable'&&_0x50bd06[_0xf4d7('0x17')]&&_0x50bd06[_0xf4d7('0x17')]['name']&&_0x50bd06[_0xf4d7('0x13')]&&_0x46ef3a[_0x50bd06[_0xf4d7('0x17')][_0xf4d7('0x18')][_0xf4d7('0x19')]()]){_0x3be4b4[_0x50bd06['idField']]=_0x46ef3a[_0x50bd06[_0xf4d7('0x17')][_0xf4d7('0x18')][_0xf4d7('0x19')]()]['toString']();}});}return _0x3be4b4;}function getName(_0x3e324f){if(_0x3e324f['indexOf']('\x20')>0x0){var _0x2036c1=_0x3e324f['split'](/ (.+)/);if(_0x2036c1[0x1]){return _0x2036c1;}}return[_0x3e324f,_0x3e324f];}var accountsTokens={};function getAccessToken(_0x2dff78){return new Promise(function(_0x2609ba,_0xc0cb68){if(!_['isNil'](accountsTokens[_0x2dff78['id']])&&!_['isNil'](accountsTokens[_0x2dff78['id']][_0xf4d7('0x1a')])){if(moment()[_0xf4d7('0x1b')](accountsTokens[_0x2dff78['id']][_0xf4d7('0x1c')])){_0x2609ba(accountsTokens[_0x2dff78['id']][_0xf4d7('0x1a')]);}}var _0x538731;switch(_0x2dff78['zone']){case'US':_0x538731=_0xf4d7('0x1d');break;case'AU':_0x538731=_0xf4d7('0x1e');break;case'EU':_0x538731=_0xf4d7('0x1f');break;case'IN':_0x538731='https://accounts.zoho.in';break;case'CN':_0x538731=_0xf4d7('0x20');break;default:_0x538731=_0xf4d7('0x1f');break;}var _0x58733a={'method':'POST','uri':_0x538731+_0xf4d7('0x21'),'qs':{'refresh_token':_0x2dff78[_0xf4d7('0x22')],'client_id':_0x2dff78[_0xf4d7('0x23')],'client_secret':_0x2dff78[_0xf4d7('0x24')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x58733a)['then'](function(_0x5ee4be){accountsTokens[_0x2dff78['id']]={'access_token':_0x5ee4be[_0xf4d7('0x1a')],'expires_in':moment()[_0xf4d7('0x25')](_0x5ee4be['expires_in'],'seconds')};_0x2609ba(_0x5ee4be['access_token']);})['catch'](function(_0x242ea6){logger[_0xf4d7('0x26')](_0xf4d7('0x27'),_0x242ea6['stack']);_0xc0cb68(_0x242ea6);});});}function getUser(_0x326b45,_0x5b015a,_0x5a2fa6,_0x62ef51){logger[_0xf4d7('0x28')]('Search\x20user');return request({'method':_0xf4d7('0x29'),'uri':util[_0xf4d7('0x2a')](_0xf4d7('0x2b'),_0x5b015a),'qs':{'type':_0xf4d7('0x2c')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x326b45},'json':!![]})[_0xf4d7('0x2d')](function(_0x1be151){if(_0x1be151[_0xf4d7('0x2e')]){var _0xe7f58=-0x1;if(_[_0xf4d7('0x2f')](_0x1be151[_0xf4d7('0x2e')])){if(!_['isNil'](_0x62ef51)){_0xe7f58=_[_0xf4d7('0x30')](_0x1be151['users'],function(_0x4651a6){return _0x4651a6['email']===_0x62ef51;});}if(_0xe7f58>=0x0){logger['info'](_0xf4d7('0x31'));}else{logger['info'](_0xf4d7('0x32'));_0xe7f58=_[_0xf4d7('0x30')](_0x1be151['users'],function(_0x3f1906){return _0x3f1906['profile']['name']===_0xf4d7('0x33');});}return _0x1be151[_0xf4d7('0x2e')][_0xe7f58];}else{if(_0x1be151['user']['profile'][_0xf4d7('0x18')]===_0xf4d7('0x33')){logger[_0xf4d7('0x28')](_0xf4d7('0x32'));user=_0x1be151[_0xf4d7('0x34')];return user;}else{logger[_0xf4d7('0x26')]('The\x20failing\x20result\x20is',JSON[_0xf4d7('0xd')](_0x1be151));throw new Error(_0xf4d7('0x35')+JSON['stringify'](_0x1be151));}}}else{logger['error']('The\x20failing\x20result\x20is',JSON[_0xf4d7('0xd')](_0x1be151));throw new Error(_0xf4d7('0x35')+JSON[_0xf4d7('0xd')](_0x1be151));}})[_0xf4d7('0x36')](function(_0x2d4de1){console[_0xf4d7('0x26')](_0x2d4de1);});}function getZohoUser(_0x340a17,_0x1ef947){return new BPromise(function(_0x8c1b8e,_0x56822c){request(_0x340a17)['then'](function(_0x1b7c97){var _0x2fbcb9=null;if(_0x1b7c97){_0x2fbcb9=_0x1b7c97[_0xf4d7('0x37')][0x0];_0x2fbcb9[_0xf4d7('0x38')]=_0x1ef947;}_0x8c1b8e(_0x2fbcb9);})['catch'](function(_0x268829){_0x56822c(_0x268829);});});}function createEndUser(_0x5b8bf1,_0x5e8194,_0x3ca661,_0xb83cf8,_0x4a53b2,_0x1c6607){var _0x3ca661=getName(_0x3ca661);return request({'method':_0xf4d7('0x39'),'uri':_0xf4d7('0x3a')+_0x5e8194+'/crm/v2/'+_[_0xf4d7('0x3b')](_0x1c6607[_0xf4d7('0x3c')])+'s','body':{'data':[{'Last_Name':_0x3ca661[0x1],'First_Name':_0x3ca661[0x0],'Phone':_0xb83cf8,'Owner':{'name':!_[_0xf4d7('0x3d')](_0x4a53b2[_0xf4d7('0x3e')][_0xf4d7('0x18')])?_0x4a53b2[_0xf4d7('0x3e')][_0xf4d7('0x18')]:!_[_0xf4d7('0x3d')](_0x4a53b2[_0xf4d7('0x3f')])?_0x4a53b2['first_name']+'\x20'+_0x4a53b2[_0xf4d7('0x40')]:_0x4a53b2[_0xf4d7('0x40')],'id':_0x4a53b2['id']}}]},'headers':{'Authorization':_0xf4d7('0x41')+_0x5b8bf1},'json':!![]})[_0xf4d7('0x2d')](function(_0x33b6ab){if(_0x33b6ab&&_0x33b6ab[_0xf4d7('0x37')][0x0][_0xf4d7('0x42')]===_0xf4d7('0x43')){var _0x118ff1=_0x33b6ab[_0xf4d7('0x37')][0x0][_0xf4d7('0x44')];_0x118ff1[_0xf4d7('0x38')]=_[_0xf4d7('0x3b')](_0x1c6607[_0xf4d7('0x3c')])+'s';return _0x118ff1;}logger[_0xf4d7('0x26')](_0xf4d7('0x45'),JSON[_0xf4d7('0xd')](data));throw new Error(_0xf4d7('0x46')+JSON[_0xf4d7('0xd')](data));})[_0xf4d7('0x36')](function(_0x394e2c){console[_0xf4d7('0x47')](_0xf4d7('0x48'),_0x394e2c);});}function getEndUser(_0x2502e5,_0x394558,_0x4369f1,_0xb4ab48,_0x2f8891,_0xe268fb,_0x168990){var _0x3a90a2={'method':_0xf4d7('0x29'),'uri':'','headers':{'Authorization':_0xf4d7('0x41')+_0x2502e5},'json':!![]};switch(_0x168990[_0xf4d7('0x49')]){case _0xf4d7('0x4a'):_0x3a90a2[_0xf4d7('0x4b')]='https://www.zohoapis.'+_0x394558+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x2f8891+'))';return getZohoUser(_0x3a90a2,'Contacts')[_0xf4d7('0x2d')](function(_0x4174ec){if(_0x4174ec)return _0x4174ec;_0x3a90a2['uri']=_0xf4d7('0x3a')+_0x394558+_0xf4d7('0x4c')+_0x2f8891+'))';return getZohoUser(_0x3a90a2,_0xf4d7('0x4d'))[_0xf4d7('0x2d')](function(_0xb1f2f8){if(_0xb1f2f8)return _0xb1f2f8;if(_0x168990[_0xf4d7('0x3c')]!=_0xf4d7('0x4e')){return createEndUser(_0x2502e5,_0x394558,_0xb4ab48,_0x2f8891,_0xe268fb,_0x168990);}else{return{};}});});break;case _0xf4d7('0x4f'):_0x3a90a2[_0xf4d7('0x4b')]=_0xf4d7('0x3a')+_0x394558+_0xf4d7('0x50')+_0x2f8891+'))';return getZohoUser(_0x3a90a2,_0xf4d7('0x51'))[_0xf4d7('0x2d')](function(_0x28ae50){if(_0x28ae50)return _0x28ae50;if(_0x168990['moduleCreate']!=_0xf4d7('0x4e')){return createEndUser(_0x2502e5,_0x394558,_0xb4ab48,_0x2f8891,_0xe268fb,_0x168990);}else{return{};}});break;case _0xf4d7('0x52'):_0x3a90a2['uri']=_0xf4d7('0x3a')+_0x394558+_0xf4d7('0x4c')+_0x2f8891+'))';return getZohoUser(_0x3a90a2,_0xf4d7('0x4d'))[_0xf4d7('0x2d')](function(_0x802879){if(_0x802879)return _0x802879;if(_0x168990[_0xf4d7('0x3c')]!=_0xf4d7('0x4e')){return createEndUser(_0x2502e5,_0x394558,_0xb4ab48,_0x2f8891,_0xe268fb,_0x168990);}else{return{};}});break;}}function getCall(_0x3d997d,_0x17dbc7,_0x16081,_0xccc830,_0x1ff861,_0x3041ff,_0x5b0934,_0x2b6bd9){logger['info'](_0xf4d7('0x53'));var _0x5bd162={};_0x5bd162['Owner']={'name':!_[_0xf4d7('0x3d')](_0xccc830[_0xf4d7('0x3e')][_0xf4d7('0x18')])&&!_['isNil'](_0xccc830[_0xf4d7('0x54')][_0xf4d7('0x18')])&&_0xccc830[_0xf4d7('0x54')][_0xf4d7('0x18')]===_0xf4d7('0x55')?_0xccc830[_0xf4d7('0x3e')][_0xf4d7('0x18')]:!_['isNil'](_0xccc830['first_name'])?_0xccc830[_0xf4d7('0x3f')]+'\x20'+_0xccc830[_0xf4d7('0x40')]:_0xccc830[_0xf4d7('0x40')],'id':_0xccc830['id']};_0x5bd162[_0xf4d7('0x56')]=intUtil[_0xf4d7('0x57')](_0x3041ff['Subjects'],_0x5b0934,'\x20');_0x5bd162[_0xf4d7('0x58')]=intUtil[_0xf4d7('0x57')](_0x3041ff[_0xf4d7('0x59')],_0x5b0934,'\x0a');if(_0x1ff861[_0xf4d7('0x38')]==='Contacts'){_0x5bd162['Who_Id']={'name':!_['isNil'](_0x1ff861[_0xf4d7('0x5a')])?_0x1ff861['Full_Name']:!_['isNil'](_0x1ff861[_0xf4d7('0x5b')])?_0x1ff861['First_Name']+'\x20'+_0x1ff861[_0xf4d7('0x5c')]:_0x1ff861['Last_Name'],'id':_0x1ff861['id']};}if(_0x1ff861[_0xf4d7('0x38')]===_0xf4d7('0x4d')){_0x5bd162[_0xf4d7('0x5d')]={'name':!_[_0xf4d7('0x3d')](_0x1ff861['Full_Name'])?_0x1ff861[_0xf4d7('0x5a')]:!_[_0xf4d7('0x3d')](_0x1ff861[_0xf4d7('0x5b')])?_0x1ff861['First_Name']+'\x20'+_0x1ff861['Last_Name']:_0x1ff861['Last_Name'],'id':_0x1ff861['id']};_0x5bd162[_0xf4d7('0x5e')]=_[_0xf4d7('0x3b')](_0x1ff861['enduserType']);}if(_0x5b0934[_0xf4d7('0x5f')]){_0x5bd162['Call_Duration']=moment['utc'](parseInt(_0x5b0934[_0xf4d7('0x5f')])*0x3e8)['format'](_0xf4d7('0x60'));}else if(_0x5b0934['answertime']&&_0x5b0934['endtime']){_0x5bd162[_0xf4d7('0x61')]=moment[_0xf4d7('0x62')](moment(_0x5b0934[_0xf4d7('0x63')],_0xf4d7('0x64'))[_0xf4d7('0x65')](moment(_0x5b0934[_0xf4d7('0x66')],_0xf4d7('0x64'))))[_0xf4d7('0x2a')](_0xf4d7('0x60'));}switch(_0x5b0934[_0xf4d7('0x67')]){case _0xf4d7('0x68'):_0x5bd162[_0xf4d7('0x69')]=_0xf4d7('0x6a');break;case _0xf4d7('0x6b'):case _0xf4d7('0x6c'):_0x5bd162[_0xf4d7('0x69')]=_0xf4d7('0x6d');break;case _0xf4d7('0x6e'):_0x5bd162[_0xf4d7('0x69')]=_0xf4d7('0x6f');break;case _0xf4d7('0x70'):_0x5bd162[_0xf4d7('0x69')]=_0xf4d7('0x71');break;case _0xf4d7('0x72'):_0x5bd162[_0xf4d7('0x69')]=_0xf4d7('0x73');default:}_0x5bd162[_0xf4d7('0x74')]=(_0x2b6bd9===_0xf4d7('0x75')?moment(_0x5b0934[_0xf4d7('0x66')])[_0xf4d7('0x2a')]('YYYY-MM-DDTHH:mm:ss'):moment(_0x5b0934['agentcalledAt'])[_0xf4d7('0x2a')]('YYYY-MM-DDTHH:mm:ss'))||moment()[_0xf4d7('0x2a')](_0xf4d7('0x64'));_0x5bd162['Call_Type']=_0x2b6bd9||_0xf4d7('0x76');_0x5bd162=_[_0xf4d7('0x77')](_0x5bd162,getCustomFields(_0x3041ff[_0xf4d7('0x78')],_0x5b0934));return request({'method':_0xf4d7('0x39'),'uri':'https://www.zohoapis.'+_0x17dbc7+_0xf4d7('0x79'),'headers':{'Authorization':_0xf4d7('0x41')+_0x3d997d},'body':{'data':[_0x5bd162]},'json':!![]})['then'](function(_0xd91286){if(_0xd91286&&_0xd91286['data'][0x0][_0xf4d7('0x42')]===_0xf4d7('0x43')){logger[_0xf4d7('0x28')](_0xf4d7('0x7a'));return{'id':_0xd91286['data'][0x0][_0xf4d7('0x44')]['id']};}})[_0xf4d7('0x36')](function(_0x1c65ff){logger[_0xf4d7('0x28')]('err',_0x1c65ff[_0xf4d7('0x7b')]);console[_0xf4d7('0x47')](_0xf4d7('0x7c'),_0x1c65ff);});}exports[_0xf4d7('0x7d')]=function(_0x5be115,_0x149479,_0x4c7ae7,_0x2fd4a5,_0x48c59d,_0x46f03a){var _0x1d4df9,_0x23ad66,_0x3c6328;_0x46f03a['host']=intUtil[_0xf4d7('0x7e')](_0x46f03a['host']);_0x46f03a['serverUrl']=intUtil[_0xf4d7('0x7e')](_0x46f03a[_0xf4d7('0x7f')]);if(_0x48c59d&&_0x48c59d[_0xf4d7('0x80')]){logger[_0xf4d7('0x28')](_0xf4d7('0x81'),_0xf4d7('0x82'));_0x149479[_0xf4d7('0x83')]=_0x46f03a[_0xf4d7('0x7f')]+_0xf4d7('0x84')+_0x149479['uniqueid']+'/downloads?type=uniqueid&token='+md5(_0x149479[_0xf4d7('0x85')]);}else{_0x149479[_0xf4d7('0x83')]='';}var _0x103549=_0x46f03a['host']===_0xf4d7('0x86')?'eu':_0xf4d7('0x87');return getAccessToken(_0x46f03a)['then'](function(_0x11db78){_0x3c6328=_0x11db78;return getUser(_0x3c6328,_0x103549,_0x46f03a,_0x2fd4a5[_0xf4d7('0x88')]);})[_0xf4d7('0x2d')](function(_0x112a94){_0x1d4df9=_0x112a94;logger['info']('The\x20User\x20ID\x20is:',_0x1d4df9['id']);return getEndUser(_0x3c6328,_0x103549,_0x46f03a,_0x149479[_0xf4d7('0x89')],_0x149479[_0xf4d7('0x8a')],_0x1d4df9,_0x4c7ae7);})['then'](function(_0x49aa80){_0x23ad66=_0x49aa80;return getCall(_0x3c6328,_0x103549,_0x46f03a,_0x1d4df9,_0x23ad66,_0x4c7ae7,_0x149479,_0xf4d7('0x76'));})[_0xf4d7('0x2d')](function(_0x688d89){if(_0x688d89){logger[_0xf4d7('0x28')](_0xf4d7('0x8b'),_0x688d89['id']);logger['info'](_0xf4d7('0x81'),_0xf4d7('0x8c'));emit(util['format'](_0xf4d7('0x8d'),_0x2fd4a5['name']),_0xf4d7('0x8e'),{'uri':_0xf4d7('0x8f')+_0x46f03a[_0xf4d7('0x90')]+_0xf4d7('0x91')+_0x688d89['id']});}})['catch'](function(_0x5234e1){logger[_0xf4d7('0x26')](_0xf4d7('0x81'),JSON[_0xf4d7('0xd')](_0x5234e1));});};exports[_0xf4d7('0x75')]=function(_0x2a92df,_0xacc727,_0x4cd97e,_0xb41b04,_0x145915,_0x26e062,_0x3fe844){var _0x5ebd67,_0x3daf11,_0x137ca8;_0x26e062['host']=intUtil['stripTrailingSlash'](_0x26e062[_0xf4d7('0x90')]);_0x26e062[_0xf4d7('0x7f')]=intUtil[_0xf4d7('0x7e')](_0x26e062[_0xf4d7('0x7f')]);if(_0x3fe844&&_0x3fe844[_0xf4d7('0x92')]&&_0x3fe844['recordingFormat']!==_0xf4d7('0x93')){logger[_0xf4d7('0x28')](_0xf4d7('0x94'),_0xf4d7('0x82'));_0xacc727[_0xf4d7('0x83')]=_0x26e062[_0xf4d7('0x7f')]+_0xf4d7('0x84')+_0xacc727[_0xf4d7('0x85')]+_0xf4d7('0x95')+md5(_0xacc727['uniqueid']);}var _0x15fc59=_0x26e062[_0xf4d7('0x90')]==='zoho.eu'?'eu':'com';return getAccessToken(_0x26e062)[_0xf4d7('0x2d')](function(_0x430981){_0x137ca8=_0x430981;return getUser(_0x137ca8,_0x15fc59,_0x26e062,_0xb41b04[_0xf4d7('0x88')]);})['then'](function(_0xde905a){_0x5ebd67=_0xde905a;logger['info'](_0xf4d7('0x96'),_0x5ebd67['id']);return getEndUser(_0x137ca8,_0x15fc59,_0x26e062,_0xacc727['destcalleridname'],_0xacc727[_0xf4d7('0x97')],_0x5ebd67,_0x4cd97e);})[_0xf4d7('0x2d')](function(_0x446128){_0x3daf11=_0x446128;return getCall(_0x137ca8,_0x15fc59,_0x26e062,_0x5ebd67,_0x3daf11,_0x4cd97e,_0xacc727,_0xf4d7('0x98'));})['then'](function(_0x59a3c3){if(_0x59a3c3){logger[_0xf4d7('0x28')](_0xf4d7('0x8b'),_0x59a3c3['id']);logger[_0xf4d7('0x28')](_0xf4d7('0x94'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xf4d7('0x2a')]('user:%s',_0xb41b04['name']),'trigger:browser:url',{'uri':_0xf4d7('0x8f')+_0x26e062[_0xf4d7('0x90')]+_0xf4d7('0x91')+_0x59a3c3['id']});}})[_0xf4d7('0x36')](function(_0x52169b){logger[_0xf4d7('0x26')]('[OUTBOUND]',JSON['stringify'](_0x52169b));});};exports[_0xf4d7('0x99')]=function(_0x569de3,_0x55372b,_0x38902,_0x31295d,_0x350cf5,_0x424035){var _0x7fad1c,_0x190353,_0x332add;_0x424035['host']=intUtil[_0xf4d7('0x7e')](_0x424035[_0xf4d7('0x90')]);_0x424035['serverUrl']=intUtil[_0xf4d7('0x7e')](_0x424035[_0xf4d7('0x7f')]);if(_0x350cf5&&_0x350cf5[_0xf4d7('0x80')]){logger[_0xf4d7('0x28')]('['+_0x55372b[_0xf4d7('0x67')][_0xf4d7('0x9a')]()+']',_0xf4d7('0x82'));_0x55372b['recordingURL']=_0x424035[_0xf4d7('0x7f')]+_0xf4d7('0x84')+_0x55372b[_0xf4d7('0x85')]+_0xf4d7('0x95')+md5(_0x55372b[_0xf4d7('0x85')]);}else{_0x55372b[_0xf4d7('0x83')]='';}var _0x2fa2e9=_0x424035['host']===_0xf4d7('0x86')?'eu':_0xf4d7('0x87');return getAccessToken(_0x424035)[_0xf4d7('0x2d')](function(_0x5ef752){_0x332add=_0x5ef752;return getUser(_0x332add,_0x2fa2e9,_0x424035);})[_0xf4d7('0x2d')](function(_0x246275){_0x7fad1c=_0x246275;logger[_0xf4d7('0x28')](_0xf4d7('0x96'),_0x7fad1c['id']);return getEndUser(_0x332add,_0x2fa2e9,_0x424035,_0x55372b[_0xf4d7('0x89')],_0x55372b[_0xf4d7('0x8a')],_0x7fad1c,_0x38902);})[_0xf4d7('0x2d')](function(_0x27838e){_0x190353=_0x27838e;return getCall(_0x332add,_0x2fa2e9,_0x424035,_0x7fad1c,_0x190353,_0x38902,_0x55372b,'Inbound');})['then'](function(_0x378411){if(_0x378411){logger[_0xf4d7('0x28')]('The\x20Call\x20ID\x20is:',_0x378411['id']);}})[_0xf4d7('0x36')](function(_0x16029d){logger['error']('['+_0x55372b[_0xf4d7('0x67')][_0xf4d7('0x9a')]()+']',JSON['stringify'](_0x16029d));});}; \ 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 f8d9080..268c099 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 _0x38d2=['%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','shelljs','mustache','exec','data2','Script','data3','render','format'];(function(_0xd788a4,_0x4ebf70){var _0x1f1e99=function(_0x170456){while(--_0x170456){_0xd788a4['push'](_0xd788a4['shift']());}};_0x1f1e99(++_0x4ebf70);}(_0x38d2,0x1f2));var _0x238d=function(_0x27f774,_0x111402){_0x27f774=_0x27f774-0x0;var _0x49c1ac=_0x38d2[_0x27f774];return _0x49c1ac;};'use strict';var util=require('util');var sh=require(_0x238d('0x0'));var Mustache=require(_0x238d('0x1'));var logger=require('../../../../config/logger')('trigger');exports[_0x238d('0x2')]=function(_0x43e960,_0x388b9e){var _0x5251b4=_0x43e960['data2']?_0x43e960[_0x238d('0x3')]:_0x238d('0x4');var _0x21b7a2=_0x43e960[_0x238d('0x5')]?Mustache[_0x238d('0x6')](_0x43e960[_0x238d('0x5')],_0x388b9e):_0x388b9e;sh[_0x238d('0x2')](_0x21b7a2,function(_0xfd272e,_0x411e73,_0x5f2a55){if(_0xfd272e!==0x0){logger['error'](util[_0x238d('0x7')](_0x238d('0x8'),_0x5251b4,_0x21b7a2,_0xfd272e,_0x5f2a55));}else{logger[_0x238d('0x9')](util[_0x238d('0x7')](_0x238d('0xa'),_0x5251b4,_0x21b7a2,_0x411e73));}});}; \ No newline at end of file +var _0x271c=['format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs','mustache','../../../../config/logger','trigger','exec','data2','data3','render','error'];(function(_0x4ef09b,_0x2c6068){var _0x13b1e9=function(_0x55f97a){while(--_0x55f97a){_0x4ef09b['push'](_0x4ef09b['shift']());}};_0x13b1e9(++_0x2c6068);}(_0x271c,0x16f));var _0xc271=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x271c[_0x21a9d9];return _0x46adce;};'use strict';var util=require(_0xc271('0x0'));var sh=require(_0xc271('0x1'));var Mustache=require(_0xc271('0x2'));var logger=require(_0xc271('0x3'))(_0xc271('0x4'));exports[_0xc271('0x5')]=function(_0xbbde6d,_0x11f6b8){var _0x2448d8=_0xbbde6d[_0xc271('0x6')]?_0xbbde6d[_0xc271('0x6')]:'Script';var _0x499211=_0xbbde6d[_0xc271('0x7')]?Mustache[_0xc271('0x8')](_0xbbde6d[_0xc271('0x7')],_0x11f6b8):_0x11f6b8;sh[_0xc271('0x5')](_0x499211,function(_0x354cef,_0x9670ce,_0x329afb){if(_0x354cef!==0x0){logger[_0xc271('0x9')](util[_0xc271('0xa')](_0xc271('0xb'),_0x2448d8,_0x499211,_0x354cef,_0x329afb));}else{logger['info'](util[_0xc271('0xa')](_0xc271('0xc'),_0x2448d8,_0x499211,_0x9670ce));}});}; \ 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 e8cbbc1..8b3f084 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 _0x2394=['statusCode','name','message','request-promise','util','lodash','mustache','../../../../config/logger','trigger','exec','data1','toUpperCase','render','data2','data5','number','headers','parse','error','DELETE','PUT','data7','stack','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','then','isNil','body','stringify'];(function(_0x5e6214,_0x450554){var _0x4c5ad8=function(_0x4e693e){while(--_0x4e693e){_0x5e6214['push'](_0x5e6214['shift']());}};_0x4c5ad8(++_0x450554);}(_0x2394,0x142));var _0x4239=function(_0x3a5531,_0x322199){_0x3a5531=_0x3a5531-0x0;var _0x302833=_0x2394[_0x3a5531];return _0x302833;};'use strict';var rp=require(_0x4239('0x0'));var util=require(_0x4239('0x1'));var _=require(_0x4239('0x2'));var Mustache=require(_0x4239('0x3'));var logger=require(_0x4239('0x4'))(_0x4239('0x5'));exports[_0x4239('0x6')]=function(_0x2cf31e,_0x1b56a2){var _0x3dccd6,_0x1322d0;var _0x59f996={'method':_0x2cf31e[_0x4239('0x7')][_0x4239('0x8')](),'uri':Mustache[_0x4239('0x9')](_0x2cf31e[_0x4239('0xa')],_0x1b56a2),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x2cf31e[_0x4239('0xb')])===_0x4239('0xc')&&parseInt(_0x2cf31e[_0x4239('0xb')])>=0x1&&parseInt(_0x2cf31e['data5'])<=0xa?parseInt(_0x2cf31e['data5'])*0x3e8:0x5*0x3e8};try{_0x59f996[_0x4239('0xd')]=_0x2cf31e['data6']?JSON[_0x4239('0xe')](Mustache[_0x4239('0x9')](_0x2cf31e['data6'],_0x1b56a2)):{};}catch(_0x3da4e6){logger[_0x4239('0xf')](_0x3da4e6['stack']);}switch(_0x2cf31e[_0x4239('0x7')][_0x4239('0x8')]()){case'GET':case _0x4239('0x10'):_0x3dccd6=null;_0x59f996['qs']=_0x1b56a2;break;case'POST':case _0x4239('0x11'):if(_0x2cf31e[_0x4239('0x12')]){try{_0x3dccd6=JSON[_0x4239('0xe')](Mustache[_0x4239('0x9')](_0x2cf31e[_0x4239('0x12')],_0x1b56a2));_0x59f996['body']=_0x3dccd6;}catch(_0x58917b){logger[_0x4239('0xf')](_0x58917b[_0x4239('0x13')]);logger[_0x4239('0xf')](_0x4239('0x14'));}}else{_0x3dccd6=_0x1b56a2;_0x59f996['body']=_0x3dccd6;}break;}logger[_0x4239('0x15')](util['format']('%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s',_0x2cf31e[_0x4239('0x7')],_0x2cf31e[_0x4239('0xa')],JSON['stringify'](_0x59f996)));rp(_0x59f996)[_0x4239('0x16')](function(_0x58a090){_0x3dccd6=!_[_0x4239('0x17')](_0x3dccd6)?',\x20request\x20body:\x20'+_0x3dccd6:'';_0x1322d0=typeof _0x58a090[_0x4239('0x18')]==='object'?JSON[_0x4239('0x19')](_0x58a090[_0x4239('0x18')]):_0x58a090[_0x4239('0x18')];logger[_0x4239('0x15')](util['format']('%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s',_0x2cf31e[_0x4239('0x7')],_0x2cf31e[_0x4239('0xa')],_0x58a090[_0x4239('0x1a')],_0x1322d0));})['catch'](function(_0x54d86b){logger[_0x4239('0xf')](util['format']('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x2cf31e[_0x4239('0x7')],_0x2cf31e[_0x4239('0xa')],_0x54d86b[_0x4239('0x1a')],_0x54d86b[_0x4239('0x1b')],_0x54d86b[_0x4239('0x1c')]));});}; \ No newline at end of file +var _0x0733=['%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','request-promise','util','lodash','mustache','../../../../config/logger','trigger','exec','data1','toUpperCase','render','data2','number','data5','headers','data6','parse','error','GET','DELETE','data7','stack','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','body','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','isNil',',\x20request\x20body:\x20'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0733,0x137));var _0x3073=function(_0x3d1f46,_0x15c08a){_0x3d1f46=_0x3d1f46-0x0;var _0x5fa326=_0x0733[_0x3d1f46];return _0x5fa326;};'use strict';var rp=require(_0x3073('0x0'));var util=require(_0x3073('0x1'));var _=require(_0x3073('0x2'));var Mustache=require(_0x3073('0x3'));var logger=require(_0x3073('0x4'))(_0x3073('0x5'));exports[_0x3073('0x6')]=function(_0xa5c443,_0xc4ac25){var _0x4fe7be,_0x385ddc;var _0x21e4eb={'method':_0xa5c443[_0x3073('0x7')][_0x3073('0x8')](),'uri':Mustache[_0x3073('0x9')](_0xa5c443[_0x3073('0xa')],_0xc4ac25),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0xa5c443['data5'])===_0x3073('0xb')&&parseInt(_0xa5c443[_0x3073('0xc')])>=0x1&&parseInt(_0xa5c443[_0x3073('0xc')])<=0xa?parseInt(_0xa5c443[_0x3073('0xc')])*0x3e8:0x5*0x3e8};try{_0x21e4eb[_0x3073('0xd')]=_0xa5c443[_0x3073('0xe')]?JSON[_0x3073('0xf')](Mustache[_0x3073('0x9')](_0xa5c443[_0x3073('0xe')],_0xc4ac25)):{};}catch(_0x207a61){logger[_0x3073('0x10')](_0x207a61['stack']);}switch(_0xa5c443[_0x3073('0x7')][_0x3073('0x8')]()){case _0x3073('0x11'):case _0x3073('0x12'):_0x4fe7be=null;_0x21e4eb['qs']=_0xc4ac25;break;case'POST':case'PUT':if(_0xa5c443[_0x3073('0x13')]){try{_0x4fe7be=JSON[_0x3073('0xf')](Mustache[_0x3073('0x9')](_0xa5c443[_0x3073('0x13')],_0xc4ac25));_0x21e4eb['body']=_0x4fe7be;}catch(_0x4fff47){logger[_0x3073('0x10')](_0x4fff47[_0x3073('0x14')]);logger[_0x3073('0x10')](_0x3073('0x15'));}}else{_0x4fe7be=_0xc4ac25;_0x21e4eb[_0x3073('0x16')]=_0x4fe7be;}break;}logger[_0x3073('0x17')](util[_0x3073('0x18')](_0x3073('0x19'),_0xa5c443['data1'],_0xa5c443[_0x3073('0xa')],JSON[_0x3073('0x1a')](_0x21e4eb)));rp(_0x21e4eb)['then'](function(_0x336d06){_0x4fe7be=!_[_0x3073('0x1b')](_0x4fe7be)?_0x3073('0x1c')+_0x4fe7be:'';_0x385ddc=typeof _0x336d06['body']==='object'?JSON['stringify'](_0x336d06[_0x3073('0x16')]):_0x336d06[_0x3073('0x16')];logger[_0x3073('0x17')](util[_0x3073('0x18')](_0x3073('0x1d'),_0xa5c443[_0x3073('0x7')],_0xa5c443[_0x3073('0xa')],_0x336d06[_0x3073('0x1e')],_0x385ddc));})['catch'](function(_0x272b58){logger[_0x3073('0x10')](util['format'](_0x3073('0x1f'),_0xa5c443[_0x3073('0x7')],_0xa5c443['data2'],_0x272b58['statusCode'],_0x272b58[_0x3073('0x20')],_0x272b58[_0x3073('0x21')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 8abae34..d40686b 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 _0x6ab3=['catch','exports','jayson/promise','../../config/logger','routing','client','http','Request','request','then','rpc','error','message','result'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0x6ab3,0xe2));var _0x36ab=function(_0x180c9b,_0x13d173){_0x180c9b=_0x180c9b-0x0;var _0x3ff116=_0x6ab3[_0x180c9b];return _0x3ff116;};'use strict';var jayson=require(_0x36ab('0x0'));var BPromise=require('bluebird');var logger=require(_0x36ab('0x1'))(_0x36ab('0x2'));var client=jayson[_0x36ab('0x3')][_0x36ab('0x4')]({'port':0x2329});client[_0x36ab('0x5')]=function(_0x125e76,_0xaf3dc){return new BPromise(function(_0x3b77b3,_0x291845){return client[_0x36ab('0x6')](_0x125e76,_0xaf3dc)[_0x36ab('0x7')](function(_0x3510ec){logger['debug'](_0x36ab('0x8'),_0x36ab('0x2'),_0x125e76,_0xaf3dc,_0x3510ec);if(_0x3510ec[_0x36ab('0x9')]){logger[_0x36ab('0x9')](_0x36ab('0x8'),'routing',_0x125e76,_0x3510ec['error'][_0x36ab('0xa')],_0xaf3dc);return _0x291845(_0x3510ec[_0x36ab('0x9')][_0x36ab('0xa')]);}else{return _0x3b77b3(_0x3510ec[_0x36ab('0xb')]);}})[_0x36ab('0xc')](function(_0xa4586){logger['error']('rpc','routing',_0x125e76,_0xa4586,_0xaf3dc);return _0x291845(_0xa4586);});});};module[_0x36ab('0xd')]=client; \ No newline at end of file +var _0xc14b=['result','catch','rpc','exports','jayson/promise','bluebird','../../config/logger','routing','http','request','debug','error','message'];(function(_0x52ba15,_0x44132b){var _0x730d84=function(_0x262bad){while(--_0x262bad){_0x52ba15['push'](_0x52ba15['shift']());}};_0x730d84(++_0x44132b);}(_0xc14b,0xa0));var _0xbc14=function(_0xd40d77,_0x101b68){_0xd40d77=_0xd40d77-0x0;var _0x5f062a=_0xc14b[_0xd40d77];return _0x5f062a;};'use strict';var jayson=require(_0xbc14('0x0'));var BPromise=require(_0xbc14('0x1'));var logger=require(_0xbc14('0x2'))(_0xbc14('0x3'));var client=jayson['client'][_0xbc14('0x4')]({'port':0x2329});client['Request']=function(_0x2f6b84,_0x1ef0d5){return new BPromise(function(_0x46d5e0,_0x13476b){return client[_0xbc14('0x5')](_0x2f6b84,_0x1ef0d5)['then'](function(_0x355114){logger[_0xbc14('0x6')]('rpc',_0xbc14('0x3'),_0x2f6b84,_0x1ef0d5,_0x355114);if(_0x355114[_0xbc14('0x7')]){logger[_0xbc14('0x7')]('rpc','routing',_0x2f6b84,_0x355114['error']['message'],_0x1ef0d5);return _0x13476b(_0x355114['error'][_0xbc14('0x8')]);}else{return _0x46d5e0(_0x355114[_0xbc14('0x9')]);}})[_0xbc14('0xa')](function(_0x31f39f){logger['error'](_0xbc14('0xb'),'routing',_0x2f6b84,_0x31f39f,_0x1ef0d5);return _0x13476b(_0x31f39f);});});};module[_0xbc14('0xc')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 59204f5..956d4df 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 _0xeba0=['error','Email\x20service\x20initialization','./server','./realtime','./lib/email','./rpc/mailAccount','resolve','getMailAccounts','then','refresh','listen','getSettings','loginMailFrequency'];(function(_0x4b5815,_0x44fb95){var _0x58634a=function(_0x5565ce){while(--_0x5565ce){_0x4b5815['push'](_0x4b5815['shift']());}};_0x58634a(++_0x44fb95);}(_0xeba0,0x84));var _0x0eba=function(_0x46d9cc,_0x4ec9ce){_0x46d9cc=_0x46d9cc-0x0;var _0xc70e83=_0xeba0[_0x46d9cc];return _0xc70e83;};'use strict';var server=require(_0x0eba('0x0'));var Realtime=require(_0x0eba('0x1'));var EmailChannel=require(_0x0eba('0x2'));var mailAccount=require(_0x0eba('0x3'));var setting=require('./rpc/setting');var logger=require('../../config/logger')('email');var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0x0eba('0x4')]()['then'](mailAccount[_0x0eba('0x5')]())[_0x0eba('0x6')](realtime['initMailAccounts']())['then'](function(){email[_0x0eba('0x7')](realtime['mailAccounts']);return realtime;});}function main(){return server[_0x0eba('0x8')](realtime,email)[_0x0eba('0x6')](function(){return initRealtime();})[_0x0eba('0x6')](function(){return setting[_0x0eba('0x9')]();})['then'](function(_0x493576){return setInterval(initRealtime,_0x493576[_0x0eba('0xa')]*0x3e8);})['catch'](function(_0x504bf8){logger[_0x0eba('0xb')](_0x0eba('0xc'),_0x504bf8);});}main(); \ No newline at end of file +var _0x827a=['getMailAccounts','initMailAccounts','refresh','mailAccounts','getSettings','catch','error','Email\x20service\x20initialization','./server','./lib/email','./rpc/mailAccount','./rpc/setting','email','resolve','then'];(function(_0x4f617a,_0x2475f7){var _0x9d2059=function(_0x498fa6){while(--_0x498fa6){_0x4f617a['push'](_0x4f617a['shift']());}};_0x9d2059(++_0x2475f7);}(_0x827a,0xbc));var _0xa827=function(_0xf6eff,_0x1fc3c6){_0xf6eff=_0xf6eff-0x0;var _0x3959a0=_0x827a[_0xf6eff];return _0x3959a0;};'use strict';var server=require(_0xa827('0x0'));var Realtime=require('./realtime');var EmailChannel=require(_0xa827('0x1'));var mailAccount=require(_0xa827('0x2'));var setting=require(_0xa827('0x3'));var logger=require('../../config/logger')(_0xa827('0x4'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0xa827('0x5')]()[_0xa827('0x6')](mailAccount[_0xa827('0x7')]())[_0xa827('0x6')](realtime[_0xa827('0x8')]())[_0xa827('0x6')](function(){email[_0xa827('0x9')](realtime[_0xa827('0xa')]);return realtime;});}function main(){return server['listen'](realtime,email)[_0xa827('0x6')](function(){return initRealtime();})['then'](function(){return setting[_0xa827('0xb')]();})[_0xa827('0x6')](function(_0x27a66b){return setInterval(initRealtime,_0x27a66b['loginMailFrequency']*0x3e8);})[_0xa827('0xc')](function(_0x14b854){logger[_0xa827('0xd')](_0xa827('0xe'),_0x14b854);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index f410f45..bb4cd39 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 _0x830b=['handleImapEmail','handleImapEnd','handleImapError','disabled','status','connected','name','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','from','notify','then','Mail\x20accepted\x20from\x20routing','error','Mail\x20not\x20accepted\x20from\x20routing\x20%s','sendMail','smtp','send','verifySmtp','Smtp','lastSync','verify','verified','catch','exports','lodash','moment','bluebird','md5','../../../config/environment','email','redis','defaults','localhost','socket.io-emitter','./imap','./smtp','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','key','active','Imap','messageStatus','total','isNil','stringify','emit','mailAccount:update','prototype','refresh','hasOwnProperty','service','provider','custom','imapAccounts','box','handleImapBox','bind'];(function(_0x3c504b,_0x437693){var _0x2e5354=function(_0x456709){while(--_0x456709){_0x3c504b['push'](_0x3c504b['shift']());}};_0x2e5354(++_0x437693);}(_0x830b,0x97));var _0xb830=function(_0x43bf3a,_0x39d3b9){_0x43bf3a=_0x43bf3a-0x0;var _0x264845=_0x830b[_0x43bf3a];return _0x264845;};'use strict';var _=require(_0xb830('0x0'));var moment=require(_0xb830('0x1'));var BPromise=require(_0xb830('0x2'));var md5=require(_0xb830('0x3'));var Redis=require('ioredis');var config=require(_0xb830('0x4'));var logger=require('../../../config/logger')(_0xb830('0x5'));config[_0xb830('0x6')]=_[_0xb830('0x7')](config[_0xb830('0x6')],{'host':_0xb830('0x8'),'port':0x18eb});var io=require(_0xb830('0x9'))(new Redis(config[_0xb830('0x6')]));var EmailImap=require(_0xb830('0xa'));var EmailSmtp=require(_0xb830('0xb'));var mailAccount=require(_0xb830('0xc'));var md5Accounts={};function EmailChannel(_0xcfd053){logger[_0xb830('0xd')](_0xb830('0xe'));this[_0xb830('0xf')]=_0xcfd053[_0xb830('0xf')];this['imapAccounts']={};this['smtp']=new EmailSmtp();}EmailChannel['prototype']['emit']=function(_0x3c6821){var _0x449685=this[_0xb830('0xf')][_0x3c6821];var _0x492bfe={'id':_0x449685['id'],'name':_0x449685['name'],'key':_0x449685[_0xb830('0x10')],'active':_0x449685[_0xb830('0x11')],'Imap':{'status':_0x449685[_0xb830('0x12')]['status'],'messageStatus':_0x449685[_0xb830('0x12')][_0xb830('0x13')],'total':_0x449685[_0xb830('0x12')][_0xb830('0x14')]}};if(_[_0xb830('0x15')](md5Accounts[_0x3c6821])){md5Accounts[_0x3c6821]={};}var _0x26350c=md5(JSON[_0xb830('0x16')](_0x492bfe));if(md5Accounts[_0x3c6821][_0xb830('0x3')]!==_0x26350c){md5Accounts[_0x3c6821]['md5']=_0x26350c;io[_0xb830('0x17')](_0xb830('0x18'),_0x492bfe);}};EmailChannel[_0xb830('0x19')][_0xb830('0x1a')]=function(_0x2caf88){for(var _0x58a58f in _0x2caf88){if(_0x2caf88[_0xb830('0x1b')](_0x58a58f)){if(_0x2caf88[_0x58a58f][_0xb830('0x12')]&&_0x2caf88[_0x58a58f]['active']){var _0xcdc1e0=_0x2caf88[_0x58a58f][_0xb830('0x12')];if(!_0xcdc1e0[_0xb830('0x1c')]&&_0x2caf88[_0x58a58f][_0xb830('0x1d')]!==_0xb830('0x1e'))_0xcdc1e0[_0xb830('0x1c')]=_0x2caf88[_0x58a58f][_0xb830('0x1d')];if(!this['imapAccounts']['hasOwnProperty'](_0xcdc1e0['id'])){this[_0xb830('0x1f')][_0xcdc1e0['id']]=new EmailImap(_0xcdc1e0,_0x2caf88[_0x58a58f][_0xb830('0x5')]);this['imapAccounts'][_0xcdc1e0['id']]['on'](_0xb830('0x20'),this[_0xb830('0x21')][_0xb830('0x22')](this,_0x58a58f));this['imapAccounts'][_0xcdc1e0['id']]['on'](_0xb830('0x5'),this[_0xb830('0x23')][_0xb830('0x22')](this,_0x58a58f));this['imapAccounts'][_0xcdc1e0['id']]['on']('end',this[_0xb830('0x24')][_0xb830('0x22')](this,_0x58a58f));this[_0xb830('0x1f')][_0xcdc1e0['id']]['on']('error',this[_0xb830('0x25')]['bind'](this,_0x58a58f));}}else{if(_[_0xb830('0x15')](this[_0xb830('0xf')][_0x58a58f][_0xb830('0x12')])){this[_0xb830('0xf')][_0x58a58f][_0xb830('0x12')]={};}this['mailAccounts'][_0x58a58f][_0xb830('0x12')]['status']=_0xb830('0x26');this['mailAccounts'][_0x58a58f][_0xb830('0x12')][_0xb830('0x13')]='';this[_0xb830('0x17')](_0x58a58f);}}}};EmailChannel[_0xb830('0x19')][_0xb830('0x21')]=function(_0x30562e,_0xa31bec){if(this[_0xb830('0xf')][_0x30562e]){this['mailAccounts'][_0x30562e][_0xb830('0x12')][_0xb830('0x27')]=_0xb830('0x28');this[_0xb830('0xf')][_0x30562e][_0xb830('0x12')]['messageStatus']=_0xa31bec[_0xb830('0x29')];if(_0xa31bec[_0xb830('0x2a')]){this[_0xb830('0xf')][_0x30562e][_0xb830('0x12')][_0xb830('0x14')]=_0xa31bec[_0xb830('0x2a')][_0xb830('0x14')];}return this[_0xb830('0x17')](_0x30562e);}};EmailChannel['prototype'][_0xb830('0x23')]=function(_0x3e5202,_0x3b6b21){logger[_0xb830('0xd')](_0xb830('0x2b'),_0x3b6b21[_0xb830('0x2c')],_0x3b6b21[_0xb830('0x2d')],_0x3b6b21[_0xb830('0x2e')],_0x3e5202);if(this[_0xb830('0xf')][_0x3e5202]){return mailAccount[_0xb830('0x2f')](_0x3e5202,_0x3b6b21)[_0xb830('0x30')](function(_0x134506){if(_0x134506){logger['info'](_0xb830('0x31'));}})['catch'](function(_0x2325d7){logger[_0xb830('0x32')](_0xb830('0x33'),JSON['stringify'](_0x2325d7));});}};EmailChannel[_0xb830('0x19')][_0xb830('0x24')]=function(_0xcae0cd){if(this[_0xb830('0xf')][_0xcae0cd]&&this['mailAccounts'][_0xcae0cd][_0xb830('0x12')]){if(this[_0xb830('0x1f')][this['mailAccounts'][_0xcae0cd]['Imap']['id']]){delete this['imapAccounts'][this['mailAccounts'][_0xcae0cd][_0xb830('0x12')]['id']];}this[_0xb830('0xf')][_0xcae0cd][_0xb830('0x12')]['lastSync']=moment();this[_0xb830('0x17')](_0xcae0cd);}};EmailChannel['prototype']['handleImapError']=function(_0x566c2c,_0x30b155){if(this[_0xb830('0xf')][_0x566c2c]){this[_0xb830('0xf')][_0x566c2c][_0xb830('0x12')][_0xb830('0x27')]=_0xb830('0x32');this[_0xb830('0xf')][_0x566c2c][_0xb830('0x12')][_0xb830('0x13')]=_0x30b155;return this[_0xb830('0x17')](_0x566c2c);}};EmailChannel[_0xb830('0x19')][_0xb830('0x34')]=function(_0x2a57a5,_0xa8a311){return this[_0xb830('0x35')][_0xb830('0x36')](_0x2a57a5,_0xa8a311);};EmailChannel[_0xb830('0x19')][_0xb830('0x37')]=function(_0x138472){var _0x2e4d3f=this;if(this[_0xb830('0xf')][_0x138472['id']]){if(_[_0xb830('0x15')](this[_0xb830('0xf')][_0x138472['id']][_0xb830('0x38')])){this['mailAccounts'][_0x138472['id']][_0xb830('0x38')]={};}this[_0xb830('0xf')][_0x138472['id']][_0xb830('0x38')][_0xb830('0x39')]=moment();return new BPromise(function(_0x5cb808,_0x39c4e1){return _0x2e4d3f[_0xb830('0x35')][_0xb830('0x3a')](_0x138472)[_0xb830('0x30')](function(_0x5d454e){_0x2e4d3f['mailAccounts'][_0x138472['id']][_0xb830('0x38')][_0xb830('0x27')]=_0xb830('0x3b');_0x2e4d3f[_0xb830('0xf')][_0x138472['id']][_0xb830('0x38')][_0xb830('0x13')]='';_0x2e4d3f[_0xb830('0x17')](_0x138472['id']);_0x5cb808(_0x5d454e);})[_0xb830('0x3c')](function(_0x5631a6){_0x2e4d3f['mailAccounts'][_0x138472['id']][_0xb830('0x38')][_0xb830('0x27')]='error';_0x2e4d3f['mailAccounts'][_0x138472['id']][_0xb830('0x38')]['messageStatus']=_0x5631a6;_0x2e4d3f[_0xb830('0x17')](_0x138472['id']);_0x39c4e1(_0x5631a6);});});}return this['smtp'][_0xb830('0x3a')](_0x138472);};module[_0xb830('0x3d')]=EmailChannel; \ No newline at end of file +var _0xdf3b=['messageStatus','verifySmtp','Smtp','verify','verified','bluebird','md5','ioredis','../../../config/environment','email','redis','socket.io-emitter','./imap','../rpc/mailAccount','info','start\x20email\x20channel','imapAccounts','smtp','prototype','mailAccounts','name','active','Imap','status','total','isNil','stringify','emit','mailAccount:update','refresh','service','provider','custom','box','bind','handleImapEmail','end','handleImapEnd','error','handleImapError','disabled','handleImapBox','connected','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','notify','then','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdf3b,0x137));var _0xbdf3=function(_0x1daaa9,_0x220393){_0x1daaa9=_0x1daaa9-0x0;var _0x1dd221=_0xdf3b[_0x1daaa9];return _0x1dd221;};'use strict';var _=require('lodash');var moment=require('moment');var BPromise=require(_0xbdf3('0x0'));var md5=require(_0xbdf3('0x1'));var Redis=require(_0xbdf3('0x2'));var config=require(_0xbdf3('0x3'));var logger=require('../../../config/logger')(_0xbdf3('0x4'));config[_0xbdf3('0x5')]=_['defaults'](config[_0xbdf3('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0xbdf3('0x6'))(new Redis(config[_0xbdf3('0x5')]));var EmailImap=require(_0xbdf3('0x7'));var EmailSmtp=require('./smtp');var mailAccount=require(_0xbdf3('0x8'));var md5Accounts={};function EmailChannel(_0x51c6e5){logger[_0xbdf3('0x9')](_0xbdf3('0xa'));this['mailAccounts']=_0x51c6e5['mailAccounts'];this[_0xbdf3('0xb')]={};this[_0xbdf3('0xc')]=new EmailSmtp();}EmailChannel[_0xbdf3('0xd')]['emit']=function(_0x295d35){var _0x4f2576=this[_0xbdf3('0xe')][_0x295d35];var _0xcf4fb2={'id':_0x4f2576['id'],'name':_0x4f2576[_0xbdf3('0xf')],'key':_0x4f2576['key'],'active':_0x4f2576[_0xbdf3('0x10')],'Imap':{'status':_0x4f2576[_0xbdf3('0x11')][_0xbdf3('0x12')],'messageStatus':_0x4f2576['Imap']['messageStatus'],'total':_0x4f2576[_0xbdf3('0x11')][_0xbdf3('0x13')]}};if(_[_0xbdf3('0x14')](md5Accounts[_0x295d35])){md5Accounts[_0x295d35]={};}var _0x334c6a=md5(JSON[_0xbdf3('0x15')](_0xcf4fb2));if(md5Accounts[_0x295d35][_0xbdf3('0x1')]!==_0x334c6a){md5Accounts[_0x295d35][_0xbdf3('0x1')]=_0x334c6a;io[_0xbdf3('0x16')](_0xbdf3('0x17'),_0xcf4fb2);}};EmailChannel['prototype'][_0xbdf3('0x18')]=function(_0x5e87c3){for(var _0x2f40c9 in _0x5e87c3){if(_0x5e87c3['hasOwnProperty'](_0x2f40c9)){if(_0x5e87c3[_0x2f40c9]['Imap']&&_0x5e87c3[_0x2f40c9]['active']){var _0x385619=_0x5e87c3[_0x2f40c9][_0xbdf3('0x11')];if(!_0x385619[_0xbdf3('0x19')]&&_0x5e87c3[_0x2f40c9][_0xbdf3('0x1a')]!==_0xbdf3('0x1b'))_0x385619[_0xbdf3('0x19')]=_0x5e87c3[_0x2f40c9][_0xbdf3('0x1a')];if(!this['imapAccounts']['hasOwnProperty'](_0x385619['id'])){this['imapAccounts'][_0x385619['id']]=new EmailImap(_0x385619,_0x5e87c3[_0x2f40c9][_0xbdf3('0x4')]);this['imapAccounts'][_0x385619['id']]['on'](_0xbdf3('0x1c'),this['handleImapBox'][_0xbdf3('0x1d')](this,_0x2f40c9));this[_0xbdf3('0xb')][_0x385619['id']]['on']('email',this[_0xbdf3('0x1e')][_0xbdf3('0x1d')](this,_0x2f40c9));this[_0xbdf3('0xb')][_0x385619['id']]['on'](_0xbdf3('0x1f'),this[_0xbdf3('0x20')][_0xbdf3('0x1d')](this,_0x2f40c9));this[_0xbdf3('0xb')][_0x385619['id']]['on'](_0xbdf3('0x21'),this[_0xbdf3('0x22')][_0xbdf3('0x1d')](this,_0x2f40c9));}}else{if(_[_0xbdf3('0x14')](this[_0xbdf3('0xe')][_0x2f40c9][_0xbdf3('0x11')])){this['mailAccounts'][_0x2f40c9][_0xbdf3('0x11')]={};}this[_0xbdf3('0xe')][_0x2f40c9][_0xbdf3('0x11')][_0xbdf3('0x12')]=_0xbdf3('0x23');this[_0xbdf3('0xe')][_0x2f40c9][_0xbdf3('0x11')]['messageStatus']='';this[_0xbdf3('0x16')](_0x2f40c9);}}}};EmailChannel['prototype'][_0xbdf3('0x24')]=function(_0x222f38,_0xb29ed3){if(this[_0xbdf3('0xe')][_0x222f38]){this[_0xbdf3('0xe')][_0x222f38][_0xbdf3('0x11')]['status']=_0xbdf3('0x25');this['mailAccounts'][_0x222f38][_0xbdf3('0x11')]['messageStatus']=_0xb29ed3[_0xbdf3('0xf')];if(_0xb29ed3[_0xbdf3('0x26')]){this[_0xbdf3('0xe')][_0x222f38][_0xbdf3('0x11')][_0xbdf3('0x13')]=_0xb29ed3[_0xbdf3('0x26')][_0xbdf3('0x13')];}return this[_0xbdf3('0x16')](_0x222f38);}};EmailChannel[_0xbdf3('0xd')][_0xbdf3('0x1e')]=function(_0x52aed5,_0x4a7f04){logger[_0xbdf3('0x9')](_0xbdf3('0x27'),_0x4a7f04[_0xbdf3('0x28')],_0x4a7f04['lastName'],_0x4a7f04['from'],_0x52aed5);if(this[_0xbdf3('0xe')][_0x52aed5]){return mailAccount[_0xbdf3('0x29')](_0x52aed5,_0x4a7f04)[_0xbdf3('0x2a')](function(_0x9ba072){if(_0x9ba072){logger[_0xbdf3('0x9')]('Mail\x20accepted\x20from\x20routing');}})[_0xbdf3('0x2b')](function(_0x1504dc){logger[_0xbdf3('0x21')](_0xbdf3('0x2c'),JSON[_0xbdf3('0x15')](_0x1504dc));});}};EmailChannel[_0xbdf3('0xd')][_0xbdf3('0x20')]=function(_0x27f691){if(this['mailAccounts'][_0x27f691]&&this['mailAccounts'][_0x27f691][_0xbdf3('0x11')]){if(this[_0xbdf3('0xb')][this[_0xbdf3('0xe')][_0x27f691][_0xbdf3('0x11')]['id']]){delete this[_0xbdf3('0xb')][this[_0xbdf3('0xe')][_0x27f691]['Imap']['id']];}this[_0xbdf3('0xe')][_0x27f691][_0xbdf3('0x11')][_0xbdf3('0x2d')]=moment();this[_0xbdf3('0x16')](_0x27f691);}};EmailChannel['prototype'][_0xbdf3('0x22')]=function(_0x1a1a92,_0x35b70a){if(this[_0xbdf3('0xe')][_0x1a1a92]){this[_0xbdf3('0xe')][_0x1a1a92][_0xbdf3('0x11')][_0xbdf3('0x12')]=_0xbdf3('0x21');this[_0xbdf3('0xe')][_0x1a1a92][_0xbdf3('0x11')][_0xbdf3('0x2e')]=_0x35b70a;return this[_0xbdf3('0x16')](_0x1a1a92);}};EmailChannel[_0xbdf3('0xd')]['sendMail']=function(_0x3fd333,_0x1e2074){return this['smtp']['send'](_0x3fd333,_0x1e2074);};EmailChannel[_0xbdf3('0xd')][_0xbdf3('0x2f')]=function(_0xbea14a){var _0x1e4211=this;if(this['mailAccounts'][_0xbea14a['id']]){if(_[_0xbdf3('0x14')](this[_0xbdf3('0xe')][_0xbea14a['id']][_0xbdf3('0x30')])){this['mailAccounts'][_0xbea14a['id']]['Smtp']={};}this[_0xbdf3('0xe')][_0xbea14a['id']][_0xbdf3('0x30')]['lastSync']=moment();return new BPromise(function(_0x406ba3,_0x555c42){return _0x1e4211[_0xbdf3('0xc')][_0xbdf3('0x31')](_0xbea14a)[_0xbdf3('0x2a')](function(_0x5a5f8c){_0x1e4211[_0xbdf3('0xe')][_0xbea14a['id']][_0xbdf3('0x30')][_0xbdf3('0x12')]=_0xbdf3('0x32');_0x1e4211['mailAccounts'][_0xbea14a['id']][_0xbdf3('0x30')]['messageStatus']='';_0x1e4211[_0xbdf3('0x16')](_0xbea14a['id']);_0x406ba3(_0x5a5f8c);})[_0xbdf3('0x2b')](function(_0x4787ba){_0x1e4211['mailAccounts'][_0xbea14a['id']][_0xbdf3('0x30')]['status']=_0xbdf3('0x21');_0x1e4211['mailAccounts'][_0xbea14a['id']][_0xbdf3('0x30')]['messageStatus']=_0x4787ba;_0x1e4211[_0xbdf3('0x16')](_0xbea14a['id']);_0x555c42(_0x4787ba);});});}return this['smtp']['verify'](_0xbea14a);};module['exports']=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index a6210a0..0e27a44 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 _0x319c=['authentication','anonymous@xcally.com','host','port','tls','openBox','handleOpenBox','emit','readUnseen','handleCloseBox','search','UNSEEN','handleReadUnseen','length','fetch','message','handleFetchMessage','handleFetchError','handleFetchEnd','closeBox','body','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','stringify','textCode','hasOwnProperty','upperFirst','exports','lodash','imap','mailparser','simpleParser','Iconv','events','EventEmitter','./utils','../../../config/logger','email','mailbox','account','getAccount','once','ready','handleReady','bind','end','handleEnd','error','handleError','connect','prototype','connTimeout','service','modernAuthentication','xoauth2','generateXOAuth2Token','CloudProvider','user','password'];(function(_0x31da15,_0x4c5450){var _0x150e9b=function(_0x32e1dd){while(--_0x32e1dd){_0x31da15['push'](_0x31da15['shift']());}};_0x150e9b(++_0x4c5450);}(_0x319c,0x1d9));var _0xc319=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x319c[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xc319('0x0'));var util=require('util');var Imap=require(_0xc319('0x1'));var simpleParser=require(_0xc319('0x2'))[_0xc319('0x3')];var Iconv=require('iconv')[_0xc319('0x4')];var EventEmitter=require(_0xc319('0x5'))[_0xc319('0x6')];var utils=require(_0xc319('0x7'));var logger=require(_0xc319('0x8'))(_0xc319('0x9'));function EmailImap(_0xd892a7,_0x1c6cc6){this[_0xc319('0xa')]=_0xd892a7[_0xc319('0xa')];this[_0xc319('0xb')]=this[_0xc319('0xc')](_0xd892a7,_0x1c6cc6);this[_0xc319('0x1')]=new Imap(this['account']);this[_0xc319('0x1')][_0xc319('0xd')](_0xc319('0xe'),this[_0xc319('0xf')][_0xc319('0x10')](this));this[_0xc319('0x1')][_0xc319('0xd')](_0xc319('0x11'),this[_0xc319('0x12')][_0xc319('0x10')](this));this[_0xc319('0x1')]['on'](_0xc319('0x13'),this[_0xc319('0x14')][_0xc319('0x10')](this));this[_0xc319('0x1')][_0xc319('0x15')]();}util['inherits'](EmailImap,EventEmitter);EmailImap[_0xc319('0x16')][_0xc319('0xc')]=function(_0x3a2833,_0x1615b2){var _0x3ea965={'connTimeout':_0x3a2833[_0xc319('0x17')]?_0x3a2833[_0xc319('0x17')]*0x3e8:0x2710,'authTimeout':_0x3a2833['authTimeout']?_0x3a2833['authTimeout']*0x3e8:0x1388};if(_0x3a2833[_0xc319('0x18')]){_0x3ea965['user']=_0x3a2833['user'];if(_0x3a2833[_0xc319('0x19')]){_0x3ea965[_0xc319('0x1a')]=utils[_0xc319('0x1b')](_0x3a2833[_0xc319('0x1c')]['data5'],_0x3a2833[_0xc319('0x1d')]);}else{_0x3ea965[_0xc319('0x1e')]=_0x3a2833[_0xc319('0x1e')];}}else{if(_0x3a2833[_0xc319('0x1f')]){_0x3ea965[_0xc319('0x1d')]=_0x3a2833[_0xc319('0x1d')];_0x3ea965['password']=_0x3a2833[_0xc319('0x1e')];}}_0x3ea965[_0xc319('0x9')]=_0x1615b2||_0x3a2833[_0xc319('0x1d')]||_0xc319('0x20');_0x3ea965[_0xc319('0x21')]=_0x3a2833[_0xc319('0x21')];_0x3ea965[_0xc319('0x22')]=_0x3a2833[_0xc319('0x22')]||0x3e1;if(_0x3a2833[_0xc319('0x23')]){_0x3ea965[_0xc319('0x23')]=!![];}else{_0x3ea965[_0xc319('0x23')]=![];_0x3ea965['autotls']='required';}return _0x3ea965;};EmailImap[_0xc319('0x16')][_0xc319('0xf')]=function(){this[_0xc319('0x1')][_0xc319('0x24')](this[_0xc319('0xa')],![],this[_0xc319('0x25')][_0xc319('0x10')](this));};EmailImap[_0xc319('0x16')][_0xc319('0x25')]=function(_0x10e91d,_0x1c9d84){if(_0x10e91d){this['handleError'](_0x10e91d,!![]);}else{this[_0xc319('0x26')]('box',_0x1c9d84);this[_0xc319('0x27')]();}};EmailImap['prototype'][_0xc319('0x28')]=function(_0x5b122b){if(_0x5b122b){this[_0xc319('0x14')](_0x5b122b,!![]);}else{this['imap'][_0xc319('0x11')]();}};EmailImap[_0xc319('0x16')]['readUnseen']=function(){this[_0xc319('0x1')][_0xc319('0x29')]([_0xc319('0x2a')],this[_0xc319('0x2b')]['bind'](this));};EmailImap[_0xc319('0x16')][_0xc319('0x2b')]=function(_0x450781,_0x4c4f77){if(_0x450781){this[_0xc319('0x14')](_0x450781,!![]);}else{if(_0x4c4f77[_0xc319('0x2c')]){try{var _0x11eda7=this[_0xc319('0x1')][_0xc319('0x2d')](_0x4c4f77,{'bodies':'','markSeen':!![]});_0x11eda7['on'](_0xc319('0x2e'),this[_0xc319('0x2f')][_0xc319('0x10')](this));_0x11eda7[_0xc319('0xd')](_0xc319('0x13'),this[_0xc319('0x30')]['bind'](this));_0x11eda7[_0xc319('0xd')](_0xc319('0x11'),this[_0xc319('0x31')][_0xc319('0x10')](this));}catch(_0x338a6e){logger['error'](_0x338a6e);}}else{this[_0xc319('0x1')][_0xc319('0x32')](!![],this[_0xc319('0x28')]['bind'](this));}}};EmailImap[_0xc319('0x16')][_0xc319('0x2f')]=function(_0x4fdc17){_0x4fdc17['on'](_0xc319('0x33'),this[_0xc319('0x34')][_0xc319('0x10')](this));_0x4fdc17['once'](_0xc319('0x35'),this[_0xc319('0x36')][_0xc319('0x10')](this));_0x4fdc17['once'](_0xc319('0x11'),this[_0xc319('0x37')][_0xc319('0x10')](this));};EmailImap[_0xc319('0x16')][_0xc319('0x34')]=function(_0xaca19a){simpleParser(_0xaca19a,{'Iconv':Iconv},this['handleSimpleParser'][_0xc319('0x10')](this));};EmailImap['prototype'][_0xc319('0x36')]=function(){};EmailImap[_0xc319('0x16')]['handleMessageEnd']=function(){};EmailImap[_0xc319('0x16')][_0xc319('0x38')]=function(_0x4f7fd7,_0x1c60ed){if(_0x4f7fd7){logger['error'](_0x4f7fd7);}else{var _0x2db8e6=this;utils[_0xc319('0x39')](this['account'],_0x1c60ed,function(_0x14d83b){_0x2db8e6[_0xc319('0x26')](_0xc319('0x9'),_0x14d83b);});}};EmailImap['prototype'][_0xc319('0x31')]=function(){this[_0xc319('0x1')][_0xc319('0x32')](!![],this[_0xc319('0x28')][_0xc319('0x10')](this));};EmailImap['prototype'][_0xc319('0x30')]=function(_0x1f9b3b){this['handleError'](_0x1f9b3b);this[_0xc319('0x1')]['closeBox'](!![],this[_0xc319('0x28')][_0xc319('0x10')](this));};EmailImap[_0xc319('0x16')][_0xc319('0x12')]=function(){this['emit'](_0xc319('0x11'));};EmailImap['prototype']['handleError']=function(_0x53a183,_0x2f63ff){logger[_0xc319('0x13')]('handleError',this[_0xc319('0xb')][_0xc319('0x9')],JSON[_0xc319('0x3a')](_0x53a183));var _0xa60707='';if(_0x53a183){if(_0x53a183[_0xc319('0x3b')]){_0xa60707=_0x53a183[_0xc319('0x3b')];}else{for(var _0x199413 in _0x53a183){if(_0x53a183[_0xc319('0x3c')](_0x199413)){_0xa60707+=_[_0xc319('0x3d')](_0x199413)+':\x20'+_0x53a183[_0x199413]+'\x0a';}}}}if(_0x2f63ff){this[_0xc319('0x1')]['end']();}else{this[_0xc319('0x26')](_0xc319('0x13'),_0xa60707);this[_0xc319('0x26')](_0xc319('0x11'));}};module[_0xc319('0x3e')]=EmailImap; \ No newline at end of file +var _0x7033=['handleFetchError','closeBox','handleFetchMessage','handleMessageBody','attributes','handleMessageEnd','handleSimpleParser','parser','handleFetchEnd','stringify','textCode','hasOwnProperty','upperFirst','exports','lodash','imap','simpleParser','iconv','events','EventEmitter','./utils','../../../config/logger','email','mailbox','account','getAccount','bind','once','end','handleEnd','error','handleError','connect','inherits','prototype','connTimeout','authTimeout','service','user','modernAuthentication','xoauth2','CloudProvider','data5','password','authentication','anonymous@xcally.com','host','port','tls','autotls','required','handleReady','handleOpenBox','emit','readUnseen','handleCloseBox','search','handleReadUnseen','length','message'];(function(_0x2644b4,_0xd4d01c){var _0x249b3c=function(_0x3524d7){while(--_0x3524d7){_0x2644b4['push'](_0x2644b4['shift']());}};_0x249b3c(++_0xd4d01c);}(_0x7033,0xc2));var _0x3703=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x7033[_0x465a0c];return _0x1e202e;};'use strict';var _=require(_0x3703('0x0'));var util=require('util');var Imap=require(_0x3703('0x1'));var simpleParser=require('mailparser')[_0x3703('0x2')];var Iconv=require(_0x3703('0x3'))['Iconv'];var EventEmitter=require(_0x3703('0x4'))[_0x3703('0x5')];var utils=require(_0x3703('0x6'));var logger=require(_0x3703('0x7'))(_0x3703('0x8'));function EmailImap(_0x401e22,_0x3c421a){this[_0x3703('0x9')]=_0x401e22[_0x3703('0x9')];this[_0x3703('0xa')]=this[_0x3703('0xb')](_0x401e22,_0x3c421a);this[_0x3703('0x1')]=new Imap(this[_0x3703('0xa')]);this[_0x3703('0x1')]['once']('ready',this['handleReady'][_0x3703('0xc')](this));this[_0x3703('0x1')][_0x3703('0xd')](_0x3703('0xe'),this[_0x3703('0xf')][_0x3703('0xc')](this));this[_0x3703('0x1')]['on'](_0x3703('0x10'),this[_0x3703('0x11')]['bind'](this));this[_0x3703('0x1')][_0x3703('0x12')]();}util[_0x3703('0x13')](EmailImap,EventEmitter);EmailImap[_0x3703('0x14')][_0x3703('0xb')]=function(_0x366048,_0x16fb40){var _0x423449={'connTimeout':_0x366048['connTimeout']?_0x366048[_0x3703('0x15')]*0x3e8:0x2710,'authTimeout':_0x366048[_0x3703('0x16')]?_0x366048[_0x3703('0x16')]*0x3e8:0x1388};if(_0x366048[_0x3703('0x17')]){_0x423449[_0x3703('0x18')]=_0x366048[_0x3703('0x18')];if(_0x366048[_0x3703('0x19')]){_0x423449[_0x3703('0x1a')]=utils['generateXOAuth2Token'](_0x366048[_0x3703('0x1b')][_0x3703('0x1c')],_0x366048[_0x3703('0x18')]);}else{_0x423449[_0x3703('0x1d')]=_0x366048[_0x3703('0x1d')];}}else{if(_0x366048[_0x3703('0x1e')]){_0x423449[_0x3703('0x18')]=_0x366048[_0x3703('0x18')];_0x423449['password']=_0x366048[_0x3703('0x1d')];}}_0x423449[_0x3703('0x8')]=_0x16fb40||_0x366048[_0x3703('0x18')]||_0x3703('0x1f');_0x423449['host']=_0x366048[_0x3703('0x20')];_0x423449['port']=_0x366048[_0x3703('0x21')]||0x3e1;if(_0x366048[_0x3703('0x22')]){_0x423449[_0x3703('0x22')]=!![];}else{_0x423449[_0x3703('0x22')]=![];_0x423449[_0x3703('0x23')]=_0x3703('0x24');}return _0x423449;};EmailImap[_0x3703('0x14')][_0x3703('0x25')]=function(){this['imap']['openBox'](this[_0x3703('0x9')],![],this[_0x3703('0x26')]['bind'](this));};EmailImap[_0x3703('0x14')]['handleOpenBox']=function(_0x415ac2,_0x5a71f1){if(_0x415ac2){this[_0x3703('0x11')](_0x415ac2,!![]);}else{this[_0x3703('0x27')]('box',_0x5a71f1);this[_0x3703('0x28')]();}};EmailImap['prototype'][_0x3703('0x29')]=function(_0x101113){if(_0x101113){this[_0x3703('0x11')](_0x101113,!![]);}else{this[_0x3703('0x1')][_0x3703('0xe')]();}};EmailImap['prototype']['readUnseen']=function(){this[_0x3703('0x1')][_0x3703('0x2a')](['UNSEEN'],this['handleReadUnseen'][_0x3703('0xc')](this));};EmailImap['prototype'][_0x3703('0x2b')]=function(_0x5401a1,_0x1488a4){if(_0x5401a1){this[_0x3703('0x11')](_0x5401a1,!![]);}else{if(_0x1488a4[_0x3703('0x2c')]){try{var _0x5f354b=this[_0x3703('0x1')]['fetch'](_0x1488a4,{'bodies':'','markSeen':!![]});_0x5f354b['on'](_0x3703('0x2d'),this['handleFetchMessage'][_0x3703('0xc')](this));_0x5f354b[_0x3703('0xd')](_0x3703('0x10'),this[_0x3703('0x2e')][_0x3703('0xc')](this));_0x5f354b[_0x3703('0xd')]('end',this['handleFetchEnd'][_0x3703('0xc')](this));}catch(_0x302920){logger['error'](_0x302920);}}else{this[_0x3703('0x1')][_0x3703('0x2f')](!![],this[_0x3703('0x29')][_0x3703('0xc')](this));}}};EmailImap['prototype'][_0x3703('0x30')]=function(_0x2ac0e5){_0x2ac0e5['on']('body',this[_0x3703('0x31')][_0x3703('0xc')](this));_0x2ac0e5['once'](_0x3703('0x32'),this['handleMessageAttributes'][_0x3703('0xc')](this));_0x2ac0e5[_0x3703('0xd')]('end',this[_0x3703('0x33')][_0x3703('0xc')](this));};EmailImap['prototype']['handleMessageBody']=function(_0x50f99e){simpleParser(_0x50f99e,{'Iconv':Iconv},this['handleSimpleParser']['bind'](this));};EmailImap['prototype']['handleMessageAttributes']=function(){};EmailImap[_0x3703('0x14')][_0x3703('0x33')]=function(){};EmailImap[_0x3703('0x14')][_0x3703('0x34')]=function(_0x1f7585,_0x3beb59){if(_0x1f7585){logger[_0x3703('0x10')](_0x1f7585);}else{var _0x283377=this;utils[_0x3703('0x35')](this[_0x3703('0xa')],_0x3beb59,function(_0x115e9f){_0x283377[_0x3703('0x27')](_0x3703('0x8'),_0x115e9f);});}};EmailImap['prototype'][_0x3703('0x36')]=function(){this[_0x3703('0x1')]['closeBox'](!![],this['handleCloseBox'][_0x3703('0xc')](this));};EmailImap[_0x3703('0x14')][_0x3703('0x2e')]=function(_0x4613f7){this['handleError'](_0x4613f7);this['imap']['closeBox'](!![],this[_0x3703('0x29')][_0x3703('0xc')](this));};EmailImap[_0x3703('0x14')][_0x3703('0xf')]=function(){this['emit']('end');};EmailImap['prototype']['handleError']=function(_0x273881,_0x49c0f2){logger[_0x3703('0x10')](_0x3703('0x11'),this[_0x3703('0xa')][_0x3703('0x8')],JSON[_0x3703('0x37')](_0x273881));var _0x4e14bf='';if(_0x273881){if(_0x273881[_0x3703('0x38')]){_0x4e14bf=_0x273881['textCode'];}else{for(var _0x8651b1 in _0x273881){if(_0x273881[_0x3703('0x39')](_0x8651b1)){_0x4e14bf+=_[_0x3703('0x3a')](_0x8651b1)+':\x20'+_0x273881[_0x8651b1]+'\x0a';}}}}if(_0x49c0f2){this[_0x3703('0x1')][_0x3703('0xe')]();}else{this['emit']('error',_0x4e14bf);this[_0x3703('0x27')](_0x3703('0xe'));}};module[_0x3703('0x3b')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index b5949c6..e96153d 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 _0x2624=['prototype','verify','exports','send','createTransport','compile','toString'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2624,0x168));var _0x4262=function(_0x399007,_0x53bb9d){_0x399007=_0x399007-0x0;var _0x11b692=_0x2624[_0x399007];return _0x11b692;};'use strict';var nodemailer=require('nodemailer');var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp['prototype'][_0x4262('0x0')]=function(_0x58a531,_0x5f49b2){return new Promise(function(_0x489449,_0x345707){var _0x560fb1=nodemailer[_0x4262('0x1')](_0x58a531);_0x560fb1['use'](_0x4262('0x2'),inlineBase64());_0x560fb1['sendMail'](_0x5f49b2,function(_0x43df6a,_0x343ab7){if(_0x43df6a){_0x345707(_0x43df6a[_0x4262('0x3')]());}else{_0x489449(_0x343ab7);}});});};EmailSmtp[_0x4262('0x4')][_0x4262('0x5')]=function(_0x3f646d){return new Promise(function(_0x7fb584,_0x5ae3c5){var _0x169c71=nodemailer[_0x4262('0x1')](_0x3f646d);_0x169c71[_0x4262('0x5')](function(_0x3f4147,_0x32ce9e){if(_0x3f4147){_0x5ae3c5(_0x3f4147[_0x4262('0x3')]());}else{if(_0x32ce9e){_0x7fb584(_0x32ce9e);}else{_0x5ae3c5('Not\x20verifired');}}});});};module[_0x4262('0x6')]=EmailSmtp; \ No newline at end of file +var _0x5693=['compile','sendMail','toString','createTransport','verify','Not\x20verifired','exports','nodemailer','prototype','use'];(function(_0x2b2ce6,_0x2488d3){var _0x39b9c3=function(_0x118160){while(--_0x118160){_0x2b2ce6['push'](_0x2b2ce6['shift']());}};_0x39b9c3(++_0x2488d3);}(_0x5693,0x89));var _0x3569=function(_0x2f44ad,_0x317f33){_0x2f44ad=_0x2f44ad-0x0;var _0x3a681a=_0x5693[_0x2f44ad];return _0x3a681a;};'use strict';var nodemailer=require(_0x3569('0x0'));var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp[_0x3569('0x1')]['send']=function(_0x14922d,_0x3b34e0){return new Promise(function(_0x50c4b8,_0x3a8e03){var _0x351cab=nodemailer['createTransport'](_0x14922d);_0x351cab[_0x3569('0x2')](_0x3569('0x3'),inlineBase64());_0x351cab[_0x3569('0x4')](_0x3b34e0,function(_0x1a46b1,_0x159be0){if(_0x1a46b1){_0x3a8e03(_0x1a46b1[_0x3569('0x5')]());}else{_0x50c4b8(_0x159be0);}});});};EmailSmtp[_0x3569('0x1')]['verify']=function(_0xc6a2f4){return new Promise(function(_0x15b664,_0x902c4e){var _0x4ff938=nodemailer[_0x3569('0x6')](_0xc6a2f4);_0x4ff938[_0x3569('0x7')](function(_0x314066,_0x3a581c){if(_0x314066){_0x902c4e(_0x314066[_0x3569('0x5')]());}else{if(_0x3a581c){_0x15b664(_0x3a581c);}else{_0x902c4e(_0x3569('0x8'));}}});});};module[_0x3569('0x9')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index 6a7a3e8..adcff6a 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 _0xf1c5=['messageId','inReplyTo','date','filter','application/ms-tnef','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','parseBuffer','first','content','

Empty\x20message

','Attachments','Title','Data','user=','auth=Bearer\x20','utf-8','base64','lodash','moment','randomstring','path','util','email','head','address','anonymous','generate','@xcally.com','value','name','substring','indexOf','split','length','join','Anonymous','pop','isEmpty','html','test','includes','\x20[Attachment:\x20','\x20]','body','message','originTo','originCc','type','attachment','attachment-','format','now','root','contentType','headerLines','Auto-Submitted:\x20auto-replied','Precedence:\x20auto_reply','line','isAutoreply','parser','from','subject'];(function(_0x3eff4a,_0x409014){var _0x2b68d9=function(_0x14e638){while(--_0x14e638){_0x3eff4a['push'](_0x3eff4a['shift']());}};_0x2b68d9(++_0x409014);}(_0xf1c5,0xe4));var _0x5f1c=function(_0x4bb5d9,_0x20172e){_0x4bb5d9=_0x4bb5d9-0x0;var _0x3cf188=_0xf1c5[_0x4bb5d9];return _0x3cf188;};'use strict';var _=require(_0x5f1c('0x0'));var moment=require(_0x5f1c('0x1'));var random=require(_0x5f1c('0x2'));var fs=require('fs');var path=require(_0x5f1c('0x3'));var util=require(_0x5f1c('0x4'));var tnef=require('node-tnef');var logger=require('../../../config/logger')(_0x5f1c('0x5'));var config=require('../../../config/environment');function getAddress(_0x4aef0e){var _0x127ad2=_[_0x5f1c('0x6')](_0x4aef0e['value']);return _0x127ad2&&_0x127ad2[_0x5f1c('0x7')]?_0x127ad2['address']:_0x5f1c('0x8')+random[_0x5f1c('0x9')](0x6)+_0x5f1c('0xa');}function getFirstName(_0x38b006){var _0x5ee9fb=_[_0x5f1c('0x6')](_0x38b006[_0x5f1c('0xb')]);if(_0x5ee9fb&&_0x5ee9fb[_0x5f1c('0xc')]){if(_0x5ee9fb[_0x5f1c('0xc')]==_0x5ee9fb['address']){return _0x5ee9fb[_0x5f1c('0xc')][_0x5f1c('0xd')](0x0,_0x5ee9fb[_0x5f1c('0xc')][_0x5f1c('0xe')]('@'));}var _0x1b6ed4=_0x5ee9fb[_0x5f1c('0xc')][_0x5f1c('0xf')](/\s+/);return _0x1b6ed4[_0x5f1c('0x10')]>0x1?_0x1b6ed4['slice'](0x0,-0x1)[_0x5f1c('0x11')]('\x20'):_0x5ee9fb['name'];}return _0x5f1c('0x12');}function getLastName(_0x124b2b){var _0x58405c=_[_0x5f1c('0x6')](_0x124b2b['value']);if(_0x58405c&&_0x58405c[_0x5f1c('0xc')]){var _0x3aff6a=_0x58405c[_0x5f1c('0xc')][_0x5f1c('0xf')](/\s+/);return _0x3aff6a[_0x5f1c('0x10')]>0x1?_0x3aff6a[_0x5f1c('0x13')]():'';}return'';}function getMails(_0x1bfc90,_0x9ebcbf){var _0x420ef9='';for(var _0x3d565c=0x0;_0x3d565c<_0x9ebcbf[_0x5f1c('0xb')][_0x5f1c('0x10')];_0x3d565c+=0x1){if(_0x9ebcbf[_0x5f1c('0xb')][_0x3d565c][_0x5f1c('0x7')]!==_0x1bfc90){if(!_[_0x5f1c('0x14')](_0x420ef9)){_0x420ef9+=',';}_0x420ef9+=_0x9ebcbf[_0x5f1c('0xb')][_0x3d565c][_0x5f1c('0xc')]||_0x9ebcbf[_0x5f1c('0xb')][_0x3d565c][_0x5f1c('0x7')]||'';_0x420ef9+='\x20<';_0x420ef9+=_0x9ebcbf[_0x5f1c('0xb')][_0x3d565c][_0x5f1c('0x7')]?_0x9ebcbf[_0x5f1c('0xb')][_0x3d565c][_0x5f1c('0x7')]:'anonymous'+random[_0x5f1c('0x9')](0x6)+_0x5f1c('0xa');_0x420ef9+='>';}}return _0x420ef9;}function parseEmail(_0x4f1ee4,_0x33531c,_0x5ef3ff){if(_0x33531c[_0x5f1c('0x15')]){var _0x3588fc=/)<[^<]*)*<\/script>/gi;while(_0x3588fc[_0x5f1c('0x16')](_0x33531c[_0x5f1c('0x15')])){_0x33531c[_0x5f1c('0x15')]=_0x33531c[_0x5f1c('0x15')]['replace'](_0x3588fc,'');}if(_0x33531c[_0x5f1c('0x15')][_0x5f1c('0x17')](_0x5f1c('0x18'))){var _0x239b25=[];_0x33531c[_0x5f1c('0x19')][_0x5f1c('0x1a')](_0x415ba4=>{_0x239b25[_0x5f1c('0x1b')](_0x415ba4[_0x5f1c('0x1c')]);});var _0x46411f=/]+>/g;var _0x3471bc=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x9d7509=_0x33531c[_0x5f1c('0x15')][_0x5f1c('0x1d')](_0x3471bc,_0x5f1c('0x1e'));var _0x447001=_0x9d7509[_0x5f1c('0x1d')](_0x46411f,'_IMG');for(let _0x5de118=0x0;_0x5de118<_0x239b25[_0x5f1c('0x10')];_0x5de118++){var _0x57b6a3=_0x447001[_0x5f1c('0x1d')]('_IMG',_0x5f1c('0x1f')+_0x239b25[_0x5de118]+_0x5f1c('0x20'));_0x447001=_0x57b6a3;}_0x33531c['html']=_0x447001;}_0x5ef3ff[_0x5f1c('0x21')]=_0x33531c[_0x5f1c('0x15')];}else{_0x5ef3ff['body']=_0x33531c['textAsHtml'];}if(_0x5ef3ff[_0x5f1c('0x21')]){_0x5ef3ff[_0x5f1c('0x21')]=_0x5ef3ff[_0x5f1c('0x21')][_0x5f1c('0x1d')](/0x0){var _0x3f7daa=[_0x5f1c('0x2d'),'X-Auto-Response-Suppress:\x20All',_0x5f1c('0x2e')];for(var _0x2f5442=0x0;_0x2f5442<_0x33531c[_0x5f1c('0x2c')][_0x5f1c('0x10')];_0x2f5442++){var _0x13badf=_[_0x5f1c('0xe')](_0x3f7daa,_0x33531c['headerLines'][_0x2f5442][_0x5f1c('0x2f')]);if(_0x13badf>=0x0){_0x5ef3ff[_0x5f1c('0x30')]=!![];}}}return _0x5ef3ff;}exports[_0x5f1c('0x31')]=function(_0x398572,_0x3da32b,_0x543d63){var _0x1490a8={'from':getAddress(_0x3da32b[_0x5f1c('0x32')]),'firstName':getFirstName(_0x3da32b[_0x5f1c('0x32')]),'lastName':getLastName(_0x3da32b[_0x5f1c('0x32')]),'mapKey':_0x5f1c('0x5'),'message':{'from':getMails(_0x398572[_0x5f1c('0x5')],_0x3da32b[_0x5f1c('0x32')]),'to':_0x398572[_0x5f1c('0x5')],'cc':'','subject':_0x3da32b[_0x5f1c('0x33')]||'','messageId':_0x3da32b[_0x5f1c('0x34')],'inReplyTo':_0x3da32b[_0x5f1c('0x35')],'sentAt':moment(_0x3da32b[_0x5f1c('0x36')])[_0x5f1c('0x28')]('YYYY-MM-DD\x20HH:mm:ss'),'attach':![],'attachments':[]}};if(!_0x3da32b[_0x5f1c('0x15')]&&!_0x3da32b['textAsHtml']){var _0x1219f8=_[_0x5f1c('0x37')](_0x3da32b['attachments'],{'contentType':_0x5f1c('0x38')});if(_0x1219f8[_0x5f1c('0x10')]){logger[_0x5f1c('0x39')](util[_0x5f1c('0x28')](_0x5f1c('0x3a'),_0x3da32b['messageId']));tnef[_0x5f1c('0x3b')](_[_0x5f1c('0x3c')](_0x1219f8)[_0x5f1c('0x3d')],function(_0x4104d6,_0x53bfea){if(_0x53bfea){_0x3da32b[_0x5f1c('0x15')]=_0x53bfea['BodyHTML']||_0x5f1c('0x3e');if(_0x53bfea[_0x5f1c('0x3f')]){for(var _0x4db150=0x0;_0x4db150<_0x53bfea['Attachments'][_0x5f1c('0x10')];_0x4db150++){var _0x26e503=_0x53bfea[_0x5f1c('0x3f')][_0x4db150];_0x1490a8[_0x5f1c('0x22')][_0x5f1c('0x19')][_0x5f1c('0x1b')]({'filename':_0x26e503[_0x5f1c('0x40')],'content':Buffer[_0x5f1c('0x32')](_0x26e503[_0x5f1c('0x41')])});}}}_0x543d63(parseEmail(_0x398572,_0x3da32b,_0x1490a8));});}else{_0x3da32b['html']=_0x5f1c('0x3e');_0x543d63(parseEmail(_0x398572,_0x3da32b,_0x1490a8));}}else{_0x543d63(parseEmail(_0x398572,_0x3da32b,_0x1490a8));}};exports['generateXOAuth2Token']=function(_0x14309c,_0x1c43bd){var _0x2e7196=[_0x5f1c('0x42')+(_0x1c43bd||''),_0x5f1c('0x43')+_0x14309c,'',''];return Buffer[_0x5f1c('0x32')](_0x2e7196[_0x5f1c('0x11')](''),_0x5f1c('0x44'))['toString'](_0x5f1c('0x45'));}; \ No newline at end of file +var _0x6dd1=['isEmpty','message','originCc','bcc','attach','type','attachment','format','%s-%s','now','root','server/files/attachments/','writeFileSync','push','contentType','headerLines','Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All','line','isAutoreply','parser','from','subject','messageId','inReplyTo','date','YYYY-MM-DD\x20HH:mm:ss','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','first','BodyHTML','Attachments','Title','Data','

Empty\x20message

','generateXOAuth2Token','user=','auth=Bearer\x20','utf-8','toString','base64','lodash','moment','randomstring','path','util','node-tnef','../../../config/logger','email','../../../config/environment','head','value','anonymous','generate','@xcally.com','name','address','indexOf','split','length','slice','join','Anonymous','pop','html','replace','includes','\x20[Attachment:\x20','\x20]','body','textAsHtml','0x1?_0x4eee23[_0x16dd('0x13')](0x0,-0x1)[_0x16dd('0x14')]('\x20'):_0xfd6dc9['name'];}return _0x16dd('0x15');}function getLastName(_0x5720a1){var _0x5458eb=_['head'](_0x5720a1[_0x16dd('0xa')]);if(_0x5458eb&&_0x5458eb[_0x16dd('0xe')]){var _0x2c3a4d=_0x5458eb[_0x16dd('0xe')][_0x16dd('0x11')](/\s+/);return _0x2c3a4d[_0x16dd('0x12')]>0x1?_0x2c3a4d[_0x16dd('0x16')]():'';}return'';}function getMails(_0x359f28,_0x50034e){var _0x1224b2='';for(var _0x5bf36e=0x0;_0x5bf36e<_0x50034e[_0x16dd('0xa')]['length'];_0x5bf36e+=0x1){if(_0x50034e[_0x16dd('0xa')][_0x5bf36e]['address']!==_0x359f28){if(!_['isEmpty'](_0x1224b2)){_0x1224b2+=',';}_0x1224b2+=_0x50034e[_0x16dd('0xa')][_0x5bf36e][_0x16dd('0xe')]||_0x50034e[_0x16dd('0xa')][_0x5bf36e][_0x16dd('0xf')]||'';_0x1224b2+='\x20<';_0x1224b2+=_0x50034e[_0x16dd('0xa')][_0x5bf36e][_0x16dd('0xf')]?_0x50034e[_0x16dd('0xa')][_0x5bf36e][_0x16dd('0xf')]:'anonymous'+random[_0x16dd('0xc')](0x6)+_0x16dd('0xd');_0x1224b2+='>';}}return _0x1224b2;}function parseEmail(_0x7c716b,_0x12e590,_0x36368e){if(_0x12e590[_0x16dd('0x17')]){var _0x2170e0=/)<[^<]*)*<\/script>/gi;while(_0x2170e0['test'](_0x12e590['html'])){_0x12e590['html']=_0x12e590['html'][_0x16dd('0x18')](_0x2170e0,'');}if(_0x12e590[_0x16dd('0x17')][_0x16dd('0x19')](_0x16dd('0x1a'))){var _0xfd63d2=[];_0x12e590[_0x16dd('0x1b')][_0x16dd('0x1c')](_0x4245b4=>{_0xfd63d2['push'](_0x4245b4[_0x16dd('0x1d')]);});var _0x42616a=/]+>/g;var _0x4d5bed=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x33645c=_0x12e590[_0x16dd('0x17')][_0x16dd('0x18')](_0x4d5bed,'_SRC');var _0x424537=_0x33645c['replace'](_0x42616a,'_IMG');for(let _0xca7bb1=0x0;_0xca7bb1<_0xfd63d2['length'];_0xca7bb1++){var _0x16db34=_0x424537[_0x16dd('0x18')](_0x16dd('0x1e'),_0x16dd('0x1f')+_0xfd63d2[_0xca7bb1]+_0x16dd('0x20'));_0x424537=_0x16db34;}_0x12e590[_0x16dd('0x17')]=_0x424537;}_0x36368e[_0x16dd('0x21')]=_0x12e590[_0x16dd('0x17')];}else{_0x36368e[_0x16dd('0x21')]=_0x12e590[_0x16dd('0x22')];}if(_0x36368e['body']){_0x36368e['body']=_0x36368e[_0x16dd('0x21')][_0x16dd('0x18')](/0x0){var _0x18fd32=[_0x16dd('0x35'),_0x16dd('0x36'),'Precedence:\x20auto_reply'];for(var _0x738cc5=0x0;_0x738cc5<_0x12e590[_0x16dd('0x34')][_0x16dd('0x12')];_0x738cc5++){var _0x1eb64e=_[_0x16dd('0x10')](_0x18fd32,_0x12e590['headerLines'][_0x738cc5][_0x16dd('0x37')]);if(_0x1eb64e>=0x0){_0x36368e[_0x16dd('0x38')]=!![];}}}return _0x36368e;}exports[_0x16dd('0x39')]=function(_0x5052ea,_0xb35bd7,_0x5ecb44){var _0x7370d3={'from':getAddress(_0xb35bd7['from']),'firstName':getFirstName(_0xb35bd7[_0x16dd('0x3a')]),'lastName':getLastName(_0xb35bd7['from']),'mapKey':'email','message':{'from':getMails(_0x5052ea[_0x16dd('0x7')],_0xb35bd7[_0x16dd('0x3a')]),'to':_0x5052ea[_0x16dd('0x7')],'cc':'','subject':_0xb35bd7[_0x16dd('0x3b')]||'','messageId':_0xb35bd7[_0x16dd('0x3c')],'inReplyTo':_0xb35bd7[_0x16dd('0x3d')],'sentAt':moment(_0xb35bd7[_0x16dd('0x3e')])[_0x16dd('0x2c')](_0x16dd('0x3f')),'attach':![],'attachments':[]}};if(!_0xb35bd7[_0x16dd('0x17')]&&!_0xb35bd7[_0x16dd('0x22')]){var _0x4eb67e=_['filter'](_0xb35bd7['attachments'],{'contentType':'application/ms-tnef'});if(_0x4eb67e[_0x16dd('0x12')]){logger['info'](util[_0x16dd('0x2c')](_0x16dd('0x40'),_0xb35bd7[_0x16dd('0x3c')]));tnef['parseBuffer'](_[_0x16dd('0x41')](_0x4eb67e)['content'],function(_0x14a79d,_0x156ce4){if(_0x156ce4){_0xb35bd7[_0x16dd('0x17')]=_0x156ce4[_0x16dd('0x42')]||'

Empty\x20message

';if(_0x156ce4['Attachments']){for(var _0x5d92c2=0x0;_0x5d92c2<_0x156ce4[_0x16dd('0x43')]['length'];_0x5d92c2++){var _0x12cafc=_0x156ce4[_0x16dd('0x43')][_0x5d92c2];_0x7370d3['message'][_0x16dd('0x1b')]['push']({'filename':_0x12cafc[_0x16dd('0x44')],'content':Buffer['from'](_0x12cafc[_0x16dd('0x45')])});}}}_0x5ecb44(parseEmail(_0x5052ea,_0xb35bd7,_0x7370d3));});}else{_0xb35bd7[_0x16dd('0x17')]=_0x16dd('0x46');_0x5ecb44(parseEmail(_0x5052ea,_0xb35bd7,_0x7370d3));}}else{_0x5ecb44(parseEmail(_0x5052ea,_0xb35bd7,_0x7370d3));}};exports[_0x16dd('0x47')]=function(_0x16fad5,_0x40893d){var _0x487eef=[_0x16dd('0x48')+(_0x40893d||''),_0x16dd('0x49')+_0x16fad5,'',''];return Buffer[_0x16dd('0x3a')](_0x487eef[_0x16dd('0x14')](''),_0x16dd('0x4a'))[_0x16dd('0x4b')](_0x16dd('0x4c'));}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index 321d0d9..c5dc57f 100644 --- a/server/services/email/model/mailAccount.js +++ b/server/services/email/model/mailAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf780=['lodash','name','Service','key','SERV','active','Imap','Smtp','exports'];(function(_0x2974cb,_0x845236){var _0x2865be=function(_0x56253f){while(--_0x56253f){_0x2974cb['push'](_0x2974cb['shift']());}};_0x2865be(++_0x845236);}(_0xf780,0x14d));var _0x0f78=function(_0x35649a,_0x2cf8ce){_0x35649a=_0x35649a-0x0;var _0x47aa32=_0xf780[_0x35649a];return _0x47aa32;};'use strict';var _=require(_0x0f78('0x0'));function MailAccount(_0x460d69){this['id']=_0x460d69['id']||0x0;this[_0x0f78('0x1')]=_0x460d69['name']||_0x0f78('0x2');this[_0x0f78('0x3')]=_0x460d69['key']||_0x0f78('0x4');this[_0x0f78('0x5')]=_0x460d69[_0x0f78('0x5')]||![];this[_0x0f78('0x6')]=_0x460d69[_0x0f78('0x6')]||[];this[_0x0f78('0x7')]=_0x460d69[_0x0f78('0x7')]||[];}module[_0x0f78('0x8')]=MailAccount; \ No newline at end of file +var _0xaf21=['name','Service','key','SERV','active','Imap','Smtp','exports','lodash'];(function(_0x5a082b,_0x329dfd){var _0x55ca3b=function(_0xb9ec19){while(--_0xb9ec19){_0x5a082b['push'](_0x5a082b['shift']());}};_0x55ca3b(++_0x329dfd);}(_0xaf21,0x131));var _0x1af2=function(_0x304de6,_0x4e4cdc){_0x304de6=_0x304de6-0x0;var _0x5005cb=_0xaf21[_0x304de6];return _0x5005cb;};'use strict';var _=require(_0x1af2('0x0'));function MailAccount(_0x4c739f){this['id']=_0x4c739f['id']||0x0;this[_0x1af2('0x1')]=_0x4c739f[_0x1af2('0x1')]||_0x1af2('0x2');this[_0x1af2('0x3')]=_0x4c739f['key']||_0x1af2('0x4');this[_0x1af2('0x5')]=_0x4c739f[_0x1af2('0x5')]||![];this[_0x1af2('0x6')]=_0x4c739f['Imap']||[];this['Smtp']=_0x4c739f[_0x1af2('0x7')]||[];}module[_0x1af2('0x8')]=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index 7eec44d..7584df1 100644 --- a/server/services/email/realtime/index.js +++ b/server/services/email/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5371=['merge','exports','lodash','../model/mailAccount','mailAccounts','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initMailAccounts','isUndefined'];(function(_0x36f37b,_0x36ea03){var _0x249634=function(_0x1cde21){while(--_0x1cde21){_0x36f37b['push'](_0x36f37b['shift']());}};_0x249634(++_0x36ea03);}(_0x5371,0x136));var _0x1537=function(_0x5d6c2d,_0x5558d4){_0x5d6c2d=_0x5d6c2d-0x0;var _0xe5efeb=_0x5371[_0x5d6c2d];return _0xe5efeb;};'use strict';var _=require(_0x1537('0x0'));var MailAccount=require(_0x1537('0x1'));var Realtime=function(){this[_0x1537('0x2')]={};};function freeIsNotKey(_0x1d597b,_0xb81c46,_0xf367e7){var _0x12c809=_[_0x1537('0x3')](_0x1d597b,function(_0x163ace,_0x4fd1f0){return _0x163ace[_0xf367e7];});for(var _0x28822a in _0xb81c46){if(_0xb81c46[_0x1537('0x4')](_0x28822a)){if(!_0x12c809[_0x28822a]){delete _0xb81c46[_0x28822a];}}}}Realtime[_0x1537('0x5')][_0x1537('0x6')]=function(_0x5786f6,_0x324468){for(var _0x2acbd0 in _0x324468){if(_0x5786f6[_0x1537('0x4')](_0x2acbd0)){_0x5786f6[_0x2acbd0]=_0x324468[_0x2acbd0];}}};Realtime['prototype'][_0x1537('0x7')]=function(){var _0x405896=this;return function(_0x3ce718){if(_0x3ce718){freeIsNotKey(_0x3ce718,_0x405896[_0x1537('0x2')],'id');for(var _0x443e2b=0x0,_0x2c9b80={},_0x4d63b6={};_0x443e2b<_0x3ce718['length'];_0x443e2b+=0x1){_0x2c9b80=_0x3ce718[_0x443e2b];if(_[_0x1537('0x8')](_0x405896[_0x1537('0x2')][_0x2c9b80['id']])){_0x405896[_0x1537('0x2')][_0x2c9b80['id']]=new MailAccount(_0x2c9b80);}else{_[_0x1537('0x9')](_0x405896[_0x1537('0x2')][_0x2c9b80['id']],_0x2c9b80);}}}return _0x405896[_0x1537('0x2')];};};module[_0x1537('0xa')]=Realtime; \ No newline at end of file +var _0x951e=['mapKeys','hasOwnProperty','prototype','initMailAccounts','length','lodash','mailAccounts'];(function(_0x27296a,_0x409e08){var _0x51de68=function(_0x634cb6){while(--_0x634cb6){_0x27296a['push'](_0x27296a['shift']());}};_0x51de68(++_0x409e08);}(_0x951e,0x1cc));var _0xe951=function(_0x2d4811,_0x153cec){_0x2d4811=_0x2d4811-0x0;var _0x4c5ab6=_0x951e[_0x2d4811];return _0x4c5ab6;};'use strict';var _=require(_0xe951('0x0'));var MailAccount=require('../model/mailAccount');var Realtime=function(){this[_0xe951('0x1')]={};};function freeIsNotKey(_0x494950,_0x190c16,_0x5df210){var _0x28b5f6=_[_0xe951('0x2')](_0x494950,function(_0x53d287,_0x40175c){return _0x53d287[_0x5df210];});for(var _0x307630 in _0x190c16){if(_0x190c16[_0xe951('0x3')](_0x307630)){if(!_0x28b5f6[_0x307630]){delete _0x190c16[_0x307630];}}}}Realtime[_0xe951('0x4')]['mergeFromDatabase']=function(_0x52e972,_0x37959e){for(var _0x43a50a in _0x37959e){if(_0x52e972[_0xe951('0x3')](_0x43a50a)){_0x52e972[_0x43a50a]=_0x37959e[_0x43a50a];}}};Realtime[_0xe951('0x4')][_0xe951('0x5')]=function(){var _0x4d1e66=this;return function(_0x5686c3){if(_0x5686c3){freeIsNotKey(_0x5686c3,_0x4d1e66[_0xe951('0x1')],'id');for(var _0x36005d=0x0,_0x5e43ff={},_0x41ebf2={};_0x36005d<_0x5686c3[_0xe951('0x6')];_0x36005d+=0x1){_0x5e43ff=_0x5686c3[_0x36005d];if(_['isUndefined'](_0x4d1e66[_0xe951('0x1')][_0x5e43ff['id']])){_0x4d1e66[_0xe951('0x1')][_0x5e43ff['id']]=new MailAccount(_0x5e43ff);}else{_['merge'](_0x4d1e66[_0xe951('0x1')][_0x5e43ff['id']],_0x5e43ff);}}}return _0x4d1e66[_0xe951('0x1')];};};module['exports']=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index cfd5803..1e41516 100644 --- a/server/services/email/rpc/mailAccount.js +++ b/server/services/email/rpc/mailAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7bd0=['../client','getMailAccounts','Request','GetMailAccount','name','provider','service','email','key','ListId','TemplateId','MailServerIn','Imap','CloudProvider','type','MailServerOut','Smtp','data5','getMailAccount','notify','NotifyMailAccount'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x7bd0,0x111));var _0x07bd=function(_0x1283d4,_0x36b6f1){_0x1283d4=_0x1283d4-0x0;var _0x433643=_0x7bd0[_0x1283d4];return _0x433643;};'use strict';var client=require(_0x07bd('0x0'));exports[_0x07bd('0x1')]=function(){return function(){return client[_0x07bd('0x2')](_0x07bd('0x3'),{'options':{'attributes':['id',_0x07bd('0x4'),_0x07bd('0x5'),_0x07bd('0x6'),_0x07bd('0x7'),'active',_0x07bd('0x8'),_0x07bd('0x9'),_0x07bd('0xa')],'raw':![],'include':[{'model':_0x07bd('0xb'),'as':_0x07bd('0xc'),'include':[{'model':_0x07bd('0xd'),'attributes':['id',_0x07bd('0x4'),'service',_0x07bd('0xe'),'data5'],'as':_0x07bd('0xd')}]},{'model':_0x07bd('0xf'),'as':_0x07bd('0x10'),'include':[{'model':'CloudProvider','attributes':['id',_0x07bd('0x4'),_0x07bd('0x6'),_0x07bd('0xe'),_0x07bd('0x11')],'as':'CloudProvider'}]}]},'log':_0x07bd('0x12')});};};exports[_0x07bd('0x13')]=function(_0x1b067a,_0x222efa){return client[_0x07bd('0x2')](_0x07bd('0x14'),{'account':{'id':_0x1b067a},'body':_0x222efa,'log':_0x07bd('0x14')});}; \ No newline at end of file +var _0xff4f=['../client','getMailAccounts','Request','provider','service','email','key','ListId','TemplateId','MailServerIn','Imap','CloudProvider','type','MailServerOut','Smtp','data5','notify','NotifyMailAccount'];(function(_0x4423f7,_0x37bf8e){var _0x185595=function(_0x20d730){while(--_0x20d730){_0x4423f7['push'](_0x4423f7['shift']());}};_0x185595(++_0x37bf8e);}(_0xff4f,0x156));var _0xfff4=function(_0x434764,_0xf45a0f){_0x434764=_0x434764-0x0;var _0x416967=_0xff4f[_0x434764];return _0x416967;};'use strict';var client=require(_0xfff4('0x0'));exports[_0xfff4('0x1')]=function(){return function(){return client[_0xfff4('0x2')]('GetMailAccount',{'options':{'attributes':['id','name',_0xfff4('0x3'),_0xfff4('0x4'),_0xfff4('0x5'),'active',_0xfff4('0x6'),_0xfff4('0x7'),_0xfff4('0x8')],'raw':![],'include':[{'model':_0xfff4('0x9'),'as':_0xfff4('0xa'),'include':[{'model':_0xfff4('0xb'),'attributes':['id','name',_0xfff4('0x4'),_0xfff4('0xc'),'data5'],'as':_0xfff4('0xb')}]},{'model':_0xfff4('0xd'),'as':_0xfff4('0xe'),'include':[{'model':_0xfff4('0xb'),'attributes':['id','name',_0xfff4('0x4'),_0xfff4('0xc'),_0xfff4('0xf')],'as':_0xfff4('0xb')}]}]},'log':'getMailAccount'});};};exports[_0xfff4('0x10')]=function(_0x53bd65,_0xff1cf){return client[_0xfff4('0x2')](_0xfff4('0x11'),{'account':{'id':_0x53bd65},'body':_0xff1cf,'log':_0xfff4('0x11')});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index 9aa6174..1e14438 100644 --- a/server/services/email/rpc/setting.js +++ b/server/services/email/rpc/setting.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0d02=['getSettings','ShowSetting','loginMailFrequency','GetSettings'];(function(_0x535759,_0x110f80){var _0x472d1f=function(_0x5434a5){while(--_0x5434a5){_0x535759['push'](_0x535759['shift']());}};_0x472d1f(++_0x110f80);}(_0x0d02,0x1d8));var _0x20d0=function(_0x6a39db,_0x35bfe0){_0x6a39db=_0x6a39db-0x0;var _0xe1ee5e=_0x0d02[_0x6a39db];return _0xe1ee5e;};'use strict';var client=require('../client');exports[_0x20d0('0x0')]=function(){return client['Request'](_0x20d0('0x1'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x20d0('0x2')]},'log':_0x20d0('0x3')});}; \ No newline at end of file +var _0xd253=['../client','getSettings','ShowSetting','GetSettings'];(function(_0x491cc1,_0x5245f6){var _0x5d2cce=function(_0x26fcee){while(--_0x26fcee){_0x491cc1['push'](_0x491cc1['shift']());}};_0x5d2cce(++_0x5245f6);}(_0xd253,0xc0));var _0x3d25=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0xd253[_0x3c4737];return _0x2bb926;};'use strict';var client=require(_0x3d25('0x0'));exports[_0x3d25('0x1')]=function(){return client['Request'](_0x3d25('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['loginMailFrequency']},'log':_0x3d25('0x3')});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index 522a08a..8cc0516 100644 --- a/server/services/email/server/index.js +++ b/server/services/email/server/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xa9e0[_0x102e37];return _0x35a07c;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var logger=require('../../../config/logger')('email');exports[_0x0a9e('0x3')]=function(_0x4ce2f1,_0x333808){return new BPromise(function(_0x432180,_0x2ab90b){var _0x991246={'SendMail':function(_0x981158){var _0x57b080=this;return new Promise(function(_0x219af0,_0x441e3a){_0x333808[_0x0a9e('0x4')](_0x981158['account'],_0x981158['message'])[_0x0a9e('0x5')](function(_0x56465b){_0x219af0({'code':0xc8,'message':_0x56465b});})['catch'](function(_0x39753a){_0x441e3a(_0x57b080[_0x0a9e('0x6')](0x1f4,_0x39753a));});});},'VerifySmtp':function(_0x307b3e){var _0x3ab53f=this;return new Promise(function(_0xfeb75b,_0xbd1168){_0x333808['verifySmtp'](_0x307b3e['account'])['then'](function(_0x4cfe67){_0xfeb75b({'code':0xc8,'message':_0x0a9e('0x7')});})[_0x0a9e('0x8')](function(_0xd5b662){_0xbd1168(_0x3ab53f[_0x0a9e('0x6')](0x1f4,_0xd5b662));});});},'MailAccounts':function(_0x32d742){return new Promise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_[_0x0a9e('0x9')](_0x4ce2f1[_0x0a9e('0xa')]);for(var _0x281129=0x0;_0x281129<_0x4283ce[_0x0a9e('0xb')];_0x281129+=0x1){if(_0x4283ce[_0x281129][_0x0a9e('0xc')]&&_0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')]){delete _0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')];}if(_0x4283ce[_0x281129]['Smtp']&&_0x4283ce[_0x281129][_0x0a9e('0xe')][_0x0a9e('0xf')]){delete _0x4283ce[_0x281129]['Smtp'][_0x0a9e('0xf')];}}_0x69aeb7({'count':_0x4283ce['length'],'rows':_0x4283ce});});}};var _0x459eb1=jayson[_0x0a9e('0x10')](_0x991246)[_0x0a9e('0x11')]();_0x459eb1['on'](_0x0a9e('0x6'),function(_0x31b1ca){logger[_0x0a9e('0x6')](JSON[_0x0a9e('0x12')](_0x31b1ca));return _0x2ab90b(_0x31b1ca);});_0x459eb1[_0x0a9e('0x3')](0x232b,_0x0a9e('0x13'),function(){console[_0x0a9e('0x14')](_0x0a9e('0x15'),0x232b);return _0x432180(_0x0a9e('0x16')+0x232b);});});}; \ No newline at end of file +var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa9e0[_0x3c2a69];return _0x596bc8;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var logger=require('../../../config/logger')('email');exports[_0x0a9e('0x3')]=function(_0x4ce2f1,_0x333808){return new BPromise(function(_0x432180,_0x2ab90b){var _0x991246={'SendMail':function(_0x981158){var _0x57b080=this;return new Promise(function(_0x219af0,_0x441e3a){_0x333808[_0x0a9e('0x4')](_0x981158['account'],_0x981158['message'])[_0x0a9e('0x5')](function(_0x56465b){_0x219af0({'code':0xc8,'message':_0x56465b});})['catch'](function(_0x39753a){_0x441e3a(_0x57b080[_0x0a9e('0x6')](0x1f4,_0x39753a));});});},'VerifySmtp':function(_0x307b3e){var _0x3ab53f=this;return new Promise(function(_0xfeb75b,_0xbd1168){_0x333808['verifySmtp'](_0x307b3e['account'])['then'](function(_0x4cfe67){_0xfeb75b({'code':0xc8,'message':_0x0a9e('0x7')});})[_0x0a9e('0x8')](function(_0xd5b662){_0xbd1168(_0x3ab53f[_0x0a9e('0x6')](0x1f4,_0xd5b662));});});},'MailAccounts':function(_0x32d742){return new Promise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_[_0x0a9e('0x9')](_0x4ce2f1[_0x0a9e('0xa')]);for(var _0x281129=0x0;_0x281129<_0x4283ce[_0x0a9e('0xb')];_0x281129+=0x1){if(_0x4283ce[_0x281129][_0x0a9e('0xc')]&&_0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')]){delete _0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')];}if(_0x4283ce[_0x281129]['Smtp']&&_0x4283ce[_0x281129][_0x0a9e('0xe')][_0x0a9e('0xf')]){delete _0x4283ce[_0x281129]['Smtp'][_0x0a9e('0xf')];}}_0x69aeb7({'count':_0x4283ce['length'],'rows':_0x4283ce});});}};var _0x459eb1=jayson[_0x0a9e('0x10')](_0x991246)[_0x0a9e('0x11')]();_0x459eb1['on'](_0x0a9e('0x6'),function(_0x31b1ca){logger[_0x0a9e('0x6')](JSON[_0x0a9e('0x12')](_0x31b1ca));return _0x2ab90b(_0x31b1ca);});_0x459eb1[_0x0a9e('0x3')](0x232b,_0x0a9e('0x13'),function(){console[_0x0a9e('0x14')](_0x0a9e('0x15'),0x232b);return _0x432180(_0x0a9e('0x16')+0x232b);});});}; \ No newline at end of file diff --git a/server/services/express/index.js b/server/services/express/index.js index 48d6596..a8d7bfa 100644 --- a/server/services/express/index.js +++ b/server/services/express/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6df8=['listening','Express\x20server\x20listening\x20on\x20port\x20%d!','ioredis','../../config/environment','createServer','port','socket.io','polling','redis','localhost','adapter','socket.io-redis','../../config/triggers','default','../../config/socketio','../../config/express','once'];(function(_0x5712d4,_0x5a17da){var _0x1b9391=function(_0x362209){while(--_0x362209){_0x5712d4['push'](_0x5712d4['shift']());}};_0x1b9391(++_0x5a17da);}(_0x6df8,0x112));var _0x86df=function(_0x5b26e0,_0x25f1e1){_0x5b26e0=_0x5b26e0-0x0;var _0x52126a=_0x6df8[_0x5b26e0];return _0x52126a;};'use strict';var _=require('lodash');var http=require('http');var express=require('express');var sticky=require('sticky-session');var Redis=require(_0x86df('0x0'));var config=require(_0x86df('0x1'));var app=express();var server=http[_0x86df('0x2')](app);server['timeout']=0xdbba0;if(sticky['listen'](server,config[_0x86df('0x3')])){var socketio=require(_0x86df('0x4'))(server,{'transports':['websocket',_0x86df('0x5')]});config[_0x86df('0x6')]=_['defaults'](config[_0x86df('0x6')],{'host':_0x86df('0x7'),'port':0x18eb});socketio[_0x86df('0x8')](require(_0x86df('0x9'))({'pubClient':new Redis(config[_0x86df('0x6')]),'subClient':new Redis(config[_0x86df('0x6')])}));require(_0x86df('0xa'))[_0x86df('0xb')]();require(_0x86df('0xc'))['default'](socketio);require(_0x86df('0xd'))['default'](app);require('../../routes')[_0x86df('0xb')](app);}else{server[_0x86df('0xe')](_0x86df('0xf'),function(){console['log'](_0x86df('0x10'),config[_0x86df('0x3')]);});}exports=module['exports']=app; \ No newline at end of file +var _0x5b27=['express','sticky-session','ioredis','../../config/environment','createServer','timeout','listen','port','socket.io','websocket','defaults','localhost','adapter','socket.io-redis','../../config/triggers','../../config/socketio','default','../../config/express','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','http'];(function(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0x5b27,0x17e));var _0x75b2=function(_0x4dec9d,_0x39f463){_0x4dec9d=_0x4dec9d-0x0;var _0x29d07d=_0x5b27[_0x4dec9d];return _0x29d07d;};'use strict';var _=require(_0x75b2('0x0'));var http=require(_0x75b2('0x1'));var express=require(_0x75b2('0x2'));var sticky=require(_0x75b2('0x3'));var Redis=require(_0x75b2('0x4'));var config=require(_0x75b2('0x5'));var app=express();var server=http[_0x75b2('0x6')](app);server[_0x75b2('0x7')]=0xdbba0;if(sticky[_0x75b2('0x8')](server,config[_0x75b2('0x9')])){var socketio=require(_0x75b2('0xa'))(server,{'transports':[_0x75b2('0xb'),'polling']});config['redis']=_[_0x75b2('0xc')](config['redis'],{'host':_0x75b2('0xd'),'port':0x18eb});socketio[_0x75b2('0xe')](require(_0x75b2('0xf'))({'pubClient':new Redis(config['redis']),'subClient':new Redis(config['redis'])}));require(_0x75b2('0x10'))['default']();require(_0x75b2('0x11'))[_0x75b2('0x12')](socketio);require(_0x75b2('0x13'))[_0x75b2('0x12')](app);require('../../routes')['default'](app);}else{server['once'](_0x75b2('0x14'),function(){console[_0x75b2('0x15')](_0x75b2('0x16'),config[_0x75b2('0x9')]);});}exports=module[_0x75b2('0x17')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index 3af1d23..3ed8fd5 100644 --- a/server/services/routing/client.js +++ b/server/services/routing/client.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe607=['http','request','then','debug','rpc','error','message','catch','exports','bluebird','../../config/logger','routing','client'];(function(_0x588011,_0x5e9d11){var _0x3b3773=function(_0x4cca54){while(--_0x4cca54){_0x588011['push'](_0x588011['shift']());}};_0x3b3773(++_0x5e9d11);}(_0xe607,0x15b));var _0x7e60=function(_0xbb2d95,_0x23b2f7){_0xbb2d95=_0xbb2d95-0x0;var _0x58cfa7=_0xe607[_0xbb2d95];return _0x58cfa7;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x7e60('0x0'));var logger=require(_0x7e60('0x1'))(_0x7e60('0x2'));var client=jayson[_0x7e60('0x3')][_0x7e60('0x4')]({'port':0x2329});client['Request']=function(_0x27f3a1,_0x4eca1c){return new BPromise(function(_0x1a8fc8,_0x9333e5){return client[_0x7e60('0x5')](_0x27f3a1,_0x4eca1c)[_0x7e60('0x6')](function(_0xaac891){logger[_0x7e60('0x7')](_0x7e60('0x8'),_0x7e60('0x2'),_0x27f3a1,_0x4eca1c,_0xaac891);if(_0xaac891[_0x7e60('0x9')]){logger[_0x7e60('0x9')]('rpc',_0x7e60('0x2'),_0x27f3a1,_0xaac891[_0x7e60('0x9')][_0x7e60('0xa')],_0x4eca1c);return _0x9333e5(_0xaac891['error'][_0x7e60('0xa')]);}else{return _0x1a8fc8(_0xaac891['result']);}})[_0x7e60('0xb')](function(_0x2eb37f){logger[_0x7e60('0x9')](_0x7e60('0x8'),'routing',_0x27f3a1,_0x2eb37f,_0x4eca1c);return _0x9333e5(_0x2eb37f);});});};module[_0x7e60('0xc')]=client; \ No newline at end of file +var _0x1451=['result','catch','exports','jayson/promise','bluebird','../../config/logger','client','http','Request','request','debug','rpc','routing','error','message'];(function(_0x2af353,_0x418430){var _0x3f3f4e=function(_0x186bb5){while(--_0x186bb5){_0x2af353['push'](_0x2af353['shift']());}};_0x3f3f4e(++_0x418430);}(_0x1451,0x189));var _0x1145=function(_0x5cdf3c,_0x233f63){_0x5cdf3c=_0x5cdf3c-0x0;var _0x515b20=_0x1451[_0x5cdf3c];return _0x515b20;};'use strict';var jayson=require(_0x1145('0x0'));var BPromise=require(_0x1145('0x1'));var logger=require(_0x1145('0x2'))('routing');var client=jayson[_0x1145('0x3')][_0x1145('0x4')]({'port':0x2329});client[_0x1145('0x5')]=function(_0x24b587,_0x3af2e0){return new BPromise(function(_0xf0f7a,_0x8cc85){return client[_0x1145('0x6')](_0x24b587,_0x3af2e0)['then'](function(_0x14b610){logger[_0x1145('0x7')](_0x1145('0x8'),_0x1145('0x9'),_0x24b587,_0x3af2e0,_0x14b610);if(_0x14b610[_0x1145('0xa')]){logger[_0x1145('0xa')](_0x1145('0x8'),_0x1145('0x9'),_0x24b587,_0x14b610[_0x1145('0xa')][_0x1145('0xb')],_0x3af2e0);return _0x8cc85(_0x14b610[_0x1145('0xa')]['message']);}else{return _0xf0f7a(_0x14b610[_0x1145('0xc')]);}})[_0x1145('0xd')](function(_0x914165){logger['error'](_0x1145('0x8'),'routing',_0x24b587,_0x914165,_0x3af2e0);return _0x8cc85(_0x914165);});});};module[_0x1145('0xe')]=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index 703723b..660c80b 100644 --- a/server/services/routing/index.js +++ b/server/services/routing/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xab8b=['getChatQueues','initChatQueues','initSmsQueues','getMailQueues','initMailQueues','getFaxQueues','getWhatsappQueues','initWhatsappQueues','listen','log','bluebird','./server','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','then','initIntervals','getOpenchannelQueues'];(function(_0x28baee,_0x2ab27a){var _0x251d3d=function(_0x34277f){while(--_0x34277f){_0x28baee['push'](_0x28baee['shift']());}};_0x251d3d(++_0x2ab27a);}(_0xab8b,0x1a8));var _0xbab8=function(_0x1ffe94,_0xe54fec){_0x1ffe94=_0x1ffe94-0x0;var _0x97cc92=_0xab8b[_0x1ffe94];return _0x97cc92;};'use strict';var BPromise=require(_0xbab8('0x0'));var server=require(_0xbab8('0x1'));var Realtime=require('./realtime');var user=require('./rpc/user');var interval=require(_0xbab8('0x2'));var openchannelQueue=require(_0xbab8('0x3'));var chatQueue=require(_0xbab8('0x4'));var smsQueue=require(_0xbab8('0x5'));var mailQueue=require(_0xbab8('0x6'));var faxQueue=require(_0xbab8('0x7'));var whatsappQueue=require(_0xbab8('0x8'));var realtime=new Realtime();function initRealtime(){return BPromise[_0xbab8('0x9')]()[_0xbab8('0xa')](user['getAgents']())[_0xbab8('0xa')](realtime['initAgents']())['then'](interval['getIntervals']())[_0xbab8('0xa')](realtime[_0xbab8('0xb')]())[_0xbab8('0xa')](openchannelQueue[_0xbab8('0xc')]())[_0xbab8('0xa')](realtime['initOpenchannelQueues']())[_0xbab8('0xa')](chatQueue[_0xbab8('0xd')]())[_0xbab8('0xa')](realtime[_0xbab8('0xe')]())[_0xbab8('0xa')](smsQueue['getSmsQueues']())[_0xbab8('0xa')](realtime[_0xbab8('0xf')]())[_0xbab8('0xa')](mailQueue[_0xbab8('0x10')]())['then'](realtime[_0xbab8('0x11')]())[_0xbab8('0xa')](faxQueue[_0xbab8('0x12')]())[_0xbab8('0xa')](realtime['initFaxQueues']())[_0xbab8('0xa')](whatsappQueue[_0xbab8('0x13')]())[_0xbab8('0xa')](realtime[_0xbab8('0x14')]())[_0xbab8('0xa')](function(){return realtime;});}function main(){return server[_0xbab8('0x15')](realtime)[_0xbab8('0xa')](function(_0x1a109e){return initRealtime();})['then'](function(_0x8b82aa){return setInterval(initRealtime,0x1388);})['catch'](function(_0x56717b){console[_0xbab8('0x16')](_0x56717b);});}main(); \ No newline at end of file +var _0x9743=['initAgents','getIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','initChatQueues','getMailQueues','initMailQueues','getWhatsappQueues','initWhatsappQueues','listen','catch','log','bluebird','./server','./realtime','./rpc/user','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','then'];(function(_0x237f45,_0x45987a){var _0x268b78=function(_0x5a24b1){while(--_0x5a24b1){_0x237f45['push'](_0x237f45['shift']());}};_0x268b78(++_0x45987a);}(_0x9743,0x1bd));var _0x3974=function(_0x3e0b25,_0x4c80dd){_0x3e0b25=_0x3e0b25-0x0;var _0x578c64=_0x9743[_0x3e0b25];return _0x578c64;};'use strict';var BPromise=require(_0x3974('0x0'));var server=require(_0x3974('0x1'));var Realtime=require(_0x3974('0x2'));var user=require(_0x3974('0x3'));var interval=require('./rpc/interval');var openchannelQueue=require('./rpc/openchannelQueue');var chatQueue=require(_0x3974('0x4'));var smsQueue=require(_0x3974('0x5'));var mailQueue=require(_0x3974('0x6'));var faxQueue=require(_0x3974('0x7'));var whatsappQueue=require(_0x3974('0x8'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x3974('0x9')]()['then'](user['getAgents']())[_0x3974('0xa')](realtime[_0x3974('0xb')]())['then'](interval[_0x3974('0xc')]())[_0x3974('0xa')](realtime['initIntervals']())[_0x3974('0xa')](openchannelQueue[_0x3974('0xd')]())['then'](realtime[_0x3974('0xe')]())['then'](chatQueue[_0x3974('0xf')]())[_0x3974('0xa')](realtime[_0x3974('0x10')]())[_0x3974('0xa')](smsQueue['getSmsQueues']())[_0x3974('0xa')](realtime['initSmsQueues']())[_0x3974('0xa')](mailQueue[_0x3974('0x11')]())['then'](realtime[_0x3974('0x12')]())['then'](faxQueue['getFaxQueues']())['then'](realtime['initFaxQueues']())['then'](whatsappQueue[_0x3974('0x13')]())[_0x3974('0xa')](realtime[_0x3974('0x14')]())['then'](function(){return realtime;});}function main(){return server[_0x3974('0x15')](realtime)[_0x3974('0xa')](function(_0x25810d){return initRealtime();})[_0x3974('0xa')](function(_0x3f4eff){return setInterval(initRealtime,0x1388);})[_0x3974('0x16')](function(_0x49286d){console[_0x3974('0x17')](_0x49286d);});}main(); \ No newline at end of file diff --git a/server/services/routing/lib/rule-engine.js b/server/services/routing/lib/rule-engine.js index 1acd40c..259d5ea 100644 --- a/server/services/routing/lib/rule-engine.js +++ b/server/services/routing/lib/rule-engine.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5fc3=['lodash','util','EventEmitter','init','isNil','ignoreFactChanges','inherits','activeRules','prototype','register','isArray','rules','isObject','sync','orderBy','asc','execute','clone','ruleRef','name','index_','push','call','nextTick','next','isEqual','restart','length','condition','matchPath','noop','findRules','filter','prioritize','priority','toJSON','map','consequence','toString','fromJSON','isString','parse'];(function(_0x440064,_0x15230d){var _0x4f32c7=function(_0x21c549){while(--_0x21c549){_0x440064['push'](_0x440064['shift']());}};_0x4f32c7(++_0x15230d);}(_0x5fc3,0xa8));var _0x35fc=function(_0x142ec2,_0x5bb03d){_0x142ec2=_0x142ec2-0x0;var _0x45ef4e=_0x5fc3[_0x142ec2];return _0x45ef4e;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var EventEmitter=require('events')[_0x35fc('0x2')];function RuleEngine(_0x2ac6da,_0x196bc2){this[_0x35fc('0x3')]();if(!_[_0x35fc('0x4')](_0x2ac6da)){this['register'](_0x2ac6da);}if(_0x196bc2){this[_0x35fc('0x5')]=_0x196bc2[_0x35fc('0x5')];}return this;}util[_0x35fc('0x6')](RuleEngine,EventEmitter);RuleEngine['prototype']['init']=function(_0x19a0d1){this['rules']=[];this[_0x35fc('0x7')]=[];};RuleEngine[_0x35fc('0x8')][_0x35fc('0x9')]=function(_0x1e5f90){if(Array[_0x35fc('0xa')](_0x1e5f90)){this[_0x35fc('0xb')]=this[_0x35fc('0xb')]['concat'](_0x1e5f90);}else if(_0x1e5f90!==null&&_[_0x35fc('0xc')](_0x1e5f90)){this[_0x35fc('0xb')]['push'](_0x1e5f90);}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')]['sync']=function(){this[_0x35fc('0x7')]=this[_0x35fc('0xb')]['filter'](function(_0x4cbe74){if(_[_0x35fc('0x4')](_0x4cbe74['on'])){_0x4cbe74['on']=!![];}if(_0x4cbe74['on']===!![]){return _0x4cbe74;}});this['activeRules']=_[_0x35fc('0xe')](this[_0x35fc('0x7')],['p'],[_0x35fc('0xf')]);};RuleEngine[_0x35fc('0x8')][_0x35fc('0x10')]=function(_0x5cfe94,_0x59507a){var _0x5eac0f=![];_0x5cfe94['result']=!![];var _0x398b67=_[_0x35fc('0x11')](_0x5cfe94);var _0x53b898=_[_0x35fc('0x11')](_0x5cfe94);var _0x227a49=this[_0x35fc('0x7')];var _0x480851=[];var _0x26ba54=this[_0x35fc('0x5')];(function FnRuleLoop(_0x553677){var _0x41e165={'rules':function(){return _0x227a49;},'rule':function(){return _0x227a49[_0x553677];},'when':function(_0x363e47){if(_0x363e47){var _0x2e513b=_0x227a49[_0x553677]['consequence'];_0x2e513b[_0x35fc('0x12')]=_0x227a49[_0x553677]['id']||_0x227a49[_0x553677][_0x35fc('0x13')]||_0x35fc('0x14')+_0x553677;process['nextTick'](function(){_0x480851[_0x35fc('0x15')](_0x2e513b[_0x35fc('0x12')]);_0x2e513b[_0x35fc('0x16')](_0x398b67,_0x41e165);});}else{process[_0x35fc('0x17')](function(){_0x41e165[_0x35fc('0x18')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x5eac0f=!![];return FnRuleLoop(0x0);},'next':function(_0x21f1a9){if(!_0x26ba54&&!_[_0x35fc('0x19')](_0x53b898,_0x398b67)){_0x53b898=_[_0x35fc('0x11')](_0x398b67);process[_0x35fc('0x17')](function(){_0x41e165[_0x35fc('0x1a')]();});}else{process['nextTick'](function(){if(_[_0x35fc('0x4')](_0x21f1a9)){return FnRuleLoop(_0x553677+0x1);}else{return FnRuleLoop(_0x21f1a9);}});}}};if(_0x553677<_0x227a49[_0x35fc('0x1b')]&&_0x5eac0f===![]){var _0x257719=_0x227a49[_0x553677][_0x35fc('0x1c')];_0x257719[_0x35fc('0x16')](_0x398b67,_0x41e165);}else{process['nextTick'](function(){_0x398b67[_0x35fc('0x1d')]=_0x480851;return _0x59507a?_0x59507a(_0x398b67):_[_0x35fc('0x1e')]();});}}(0x0));};RuleEngine['prototype'][_0x35fc('0x1f')]=function(_0x5a93df){if(_[_0x35fc('0x4')](_0x5a93df)){return this['rules'];}else{var _0x4086e9=_['matches'](_0x5a93df);return _[_0x35fc('0x20')](this[_0x35fc('0xb')],_0x4086e9);}};RuleEngine['prototype']['turn']=function(_0x47774c,_0x58edb6){var _0x274208=_0x47774c==='on'||_0x47774c==='ON'?!![]:![];var _0x1a5d92=this['findRules'](_0x58edb6);for(var _0x26b7cb=0x0,_0x645eac=_0x1a5d92[_0x35fc('0x1b')];_0x26b7cb<_0x645eac;_0x26b7cb+=0x1){_0x1a5d92[_0x26b7cb]['on']=_0x274208;}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')][_0x35fc('0x21')]=function(_0x11ccdb,_0x451f0c){_0x11ccdb=parseInt(_0x11ccdb,0xa);var _0x54aedc=this[_0x35fc('0x1f')](_0x451f0c);for(var _0x220931=0x0,_0x22af18=_0x54aedc['length'];_0x220931<_0x22af18;_0x220931+=0x1){_0x54aedc[_0x220931][_0x35fc('0x22')]=_0x11ccdb;}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')][_0x35fc('0x23')]=function(){var _0xd8a4ca=this[_0x35fc('0xb')];if(_0xd8a4ca instanceof Array){_0xd8a4ca=_0xd8a4ca[_0x35fc('0x24')](function(_0x37b435){_0x37b435[_0x35fc('0x1c')]=_0x37b435[_0x35fc('0x1c')]['toString']();_0x37b435['consequence']=_0x37b435[_0x35fc('0x25')]['toString']();return _0x37b435;});}else if(!_[_0x35fc('0x4')](_0xd8a4ca)){_0xd8a4ca[_0x35fc('0x1c')]=_0xd8a4ca[_0x35fc('0x1c')][_0x35fc('0x26')]();_0xd8a4ca[_0x35fc('0x25')]=_0xd8a4ca[_0x35fc('0x25')]['toString']();}return _0xd8a4ca;};RuleEngine[_0x35fc('0x8')][_0x35fc('0x27')]=function(_0x46b9ef){this[_0x35fc('0x3')]();if(_[_0x35fc('0x28')](_0x46b9ef)){_0x46b9ef=JSON[_0x35fc('0x29')](_0x46b9ef);}if(_0x46b9ef instanceof Array){_0x46b9ef=_0x46b9ef['map'](function(_0x2483be){_0x2483be[_0x35fc('0x1c')]=eval('('+_0x2483be[_0x35fc('0x1c')]+')');_0x2483be['consequence']=eval('('+_0x2483be[_0x35fc('0x25')]+')');return _0x2483be;});}else if(_0x46b9ef!==null&&typeof _0x46b9ef=='object'){_0x46b9ef[_0x35fc('0x1c')]=eval('('+_0x46b9ef[_0x35fc('0x1c')]+')');_0x46b9ef[_0x35fc('0x25')]=eval('('+_0x46b9ef[_0x35fc('0x25')]+')');}this['register'](_0x46b9ef);};module['exports']=RuleEngine; \ No newline at end of file +var _0x326f=['orderBy','asc','result','clone','consequence','nextTick','push','isEqual','condition','call','matchPath','noop','matches','filter','turn','length','prioritize','findRules','priority','toJSON','map','toString','fromJSON','isString','lodash','EventEmitter','init','isNil','register','ignoreFactChanges','inherits','prototype','rules','activeRules','concat','isObject','sync'];(function(_0xa5e821,_0x4dd2f6){var _0x62d0cd=function(_0x119f86){while(--_0x119f86){_0xa5e821['push'](_0xa5e821['shift']());}};_0x62d0cd(++_0x4dd2f6);}(_0x326f,0xd1));var _0xf326=function(_0x264338,_0x1a2343){_0x264338=_0x264338-0x0;var _0xbdd1c1=_0x326f[_0x264338];return _0xbdd1c1;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var EventEmitter=require('events')[_0xf326('0x1')];function RuleEngine(_0x330ddb,_0x22aabf){this[_0xf326('0x2')]();if(!_[_0xf326('0x3')](_0x330ddb)){this[_0xf326('0x4')](_0x330ddb);}if(_0x22aabf){this[_0xf326('0x5')]=_0x22aabf[_0xf326('0x5')];}return this;}util[_0xf326('0x6')](RuleEngine,EventEmitter);RuleEngine[_0xf326('0x7')]['init']=function(_0x3c254d){this[_0xf326('0x8')]=[];this[_0xf326('0x9')]=[];};RuleEngine[_0xf326('0x7')]['register']=function(_0x4c206c){if(Array['isArray'](_0x4c206c)){this[_0xf326('0x8')]=this[_0xf326('0x8')][_0xf326('0xa')](_0x4c206c);}else if(_0x4c206c!==null&&_[_0xf326('0xb')](_0x4c206c)){this[_0xf326('0x8')]['push'](_0x4c206c);}this[_0xf326('0xc')]();};RuleEngine['prototype'][_0xf326('0xc')]=function(){this['activeRules']=this[_0xf326('0x8')]['filter'](function(_0x3162f9){if(_[_0xf326('0x3')](_0x3162f9['on'])){_0x3162f9['on']=!![];}if(_0x3162f9['on']===!![]){return _0x3162f9;}});this['activeRules']=_[_0xf326('0xd')](this[_0xf326('0x9')],['p'],[_0xf326('0xe')]);};RuleEngine[_0xf326('0x7')]['execute']=function(_0x45c1b6,_0x5204ee){var _0x54bd1a=![];_0x45c1b6[_0xf326('0xf')]=!![];var _0x11f6d2=_[_0xf326('0x10')](_0x45c1b6);var _0xa63d1a=_[_0xf326('0x10')](_0x45c1b6);var _0x287a2a=this[_0xf326('0x9')];var _0x2cf2ca=[];var _0x5a682a=this[_0xf326('0x5')];(function FnRuleLoop(_0x453100){var _0x18bee3={'rules':function(){return _0x287a2a;},'rule':function(){return _0x287a2a[_0x453100];},'when':function(_0x31ffb9){if(_0x31ffb9){var _0xcef2b5=_0x287a2a[_0x453100][_0xf326('0x11')];_0xcef2b5['ruleRef']=_0x287a2a[_0x453100]['id']||_0x287a2a[_0x453100]['name']||'index_'+_0x453100;process[_0xf326('0x12')](function(){_0x2cf2ca[_0xf326('0x13')](_0xcef2b5['ruleRef']);_0xcef2b5['call'](_0x11f6d2,_0x18bee3);});}else{process[_0xf326('0x12')](function(){_0x18bee3['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x54bd1a=!![];return FnRuleLoop(0x0);},'next':function(_0x5b6d3c){if(!_0x5a682a&&!_[_0xf326('0x14')](_0xa63d1a,_0x11f6d2)){_0xa63d1a=_[_0xf326('0x10')](_0x11f6d2);process['nextTick'](function(){_0x18bee3['restart']();});}else{process[_0xf326('0x12')](function(){if(_[_0xf326('0x3')](_0x5b6d3c)){return FnRuleLoop(_0x453100+0x1);}else{return FnRuleLoop(_0x5b6d3c);}});}}};if(_0x453100<_0x287a2a['length']&&_0x54bd1a===![]){var _0x337ed5=_0x287a2a[_0x453100][_0xf326('0x15')];_0x337ed5[_0xf326('0x16')](_0x11f6d2,_0x18bee3);}else{process[_0xf326('0x12')](function(){_0x11f6d2[_0xf326('0x17')]=_0x2cf2ca;return _0x5204ee?_0x5204ee(_0x11f6d2):_[_0xf326('0x18')]();});}}(0x0));};RuleEngine['prototype']['findRules']=function(_0x4f31f6){if(_[_0xf326('0x3')](_0x4f31f6)){return this[_0xf326('0x8')];}else{var _0x2cd45a=_[_0xf326('0x19')](_0x4f31f6);return _[_0xf326('0x1a')](this[_0xf326('0x8')],_0x2cd45a);}};RuleEngine['prototype'][_0xf326('0x1b')]=function(_0xa3c0b,_0x212d5d){var _0x581531=_0xa3c0b==='on'||_0xa3c0b==='ON'?!![]:![];var _0x1617d2=this['findRules'](_0x212d5d);for(var _0x4a9abf=0x0,_0x6a8e89=_0x1617d2[_0xf326('0x1c')];_0x4a9abf<_0x6a8e89;_0x4a9abf+=0x1){_0x1617d2[_0x4a9abf]['on']=_0x581531;}this[_0xf326('0xc')]();};RuleEngine['prototype'][_0xf326('0x1d')]=function(_0x292500,_0x55790d){_0x292500=parseInt(_0x292500,0xa);var _0x225776=this[_0xf326('0x1e')](_0x55790d);for(var _0xd77aba=0x0,_0x18d110=_0x225776[_0xf326('0x1c')];_0xd77aba<_0x18d110;_0xd77aba+=0x1){_0x225776[_0xd77aba][_0xf326('0x1f')]=_0x292500;}this[_0xf326('0xc')]();};RuleEngine[_0xf326('0x7')][_0xf326('0x20')]=function(){var _0x349a03=this['rules'];if(_0x349a03 instanceof Array){_0x349a03=_0x349a03[_0xf326('0x21')](function(_0x424104){_0x424104[_0xf326('0x15')]=_0x424104['condition'][_0xf326('0x22')]();_0x424104[_0xf326('0x11')]=_0x424104[_0xf326('0x11')]['toString']();return _0x424104;});}else if(!_['isNil'](_0x349a03)){_0x349a03[_0xf326('0x15')]=_0x349a03[_0xf326('0x15')][_0xf326('0x22')]();_0x349a03[_0xf326('0x11')]=_0x349a03[_0xf326('0x11')][_0xf326('0x22')]();}return _0x349a03;};RuleEngine[_0xf326('0x7')][_0xf326('0x23')]=function(_0x580374){this[_0xf326('0x2')]();if(_[_0xf326('0x24')](_0x580374)){_0x580374=JSON['parse'](_0x580374);}if(_0x580374 instanceof Array){_0x580374=_0x580374[_0xf326('0x21')](function(_0x4e5d7c){_0x4e5d7c[_0xf326('0x15')]=eval('('+_0x4e5d7c['condition']+')');_0x4e5d7c['consequence']=eval('('+_0x4e5d7c[_0xf326('0x11')]+')');return _0x4e5d7c;});}else if(_0x580374!==null&&typeof _0x580374=='object'){_0x580374[_0xf326('0x15')]=eval('('+_0x580374['condition']+')');_0x580374[_0xf326('0x11')]=eval('('+_0x580374[_0xf326('0x11')]+')');}this[_0xf326('0x4')](_0x580374);};module['exports']=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index fc188d3..4db0383 100644 --- a/server/services/routing/mailRpc/index.js +++ b/server/services/routing/mailRpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd806=['client','http','request','then','error','message','result','catch','sendMailMessage','SendMail','bluebird','jayson/promise'];(function(_0x52a8da,_0x5d9213){var _0x5e9460=function(_0x191193){while(--_0x191193){_0x52a8da['push'](_0x52a8da['shift']());}};_0x5e9460(++_0x5d9213);}(_0xd806,0x14e));var _0x6d80=function(_0x4fbd61,_0x4d0605){_0x4fbd61=_0x4fbd61-0x0;var _0x579ea5=_0xd806[_0x4fbd61];return _0x579ea5;};'use strict';var BPromise=require(_0x6d80('0x0'));var jayson=require(_0x6d80('0x1'));var client=jayson[_0x6d80('0x2')][_0x6d80('0x3')]({'port':0x232b});function request(_0x2f976d,_0x1e3380){return new BPromise(function(_0x438a78,_0x20503a){return client[_0x6d80('0x4')](_0x2f976d,_0x1e3380)[_0x6d80('0x5')](function(_0xf8ac){if(_0xf8ac[_0x6d80('0x6')]){return _0x20503a(_0xf8ac[_0x6d80('0x6')][_0x6d80('0x7')]);}else{return _0x438a78(_0xf8ac[_0x6d80('0x8')]);}})[_0x6d80('0x9')](function(_0x2dd3ec){return _0x20503a(_0x2dd3ec);});});}exports[_0x6d80('0xa')]=function(_0x4a7959,_0xb4f840){return request(_0x6d80('0xb'),{'account':_0x4a7959,'message':_0xb4f840});}; \ No newline at end of file +var _0x14a9=['jayson/promise','client','http','request','error','message','catch','sendMailMessage','SendMail'];(function(_0x25f7d9,_0x56c8f7){var _0x48f1d1=function(_0x447d99){while(--_0x447d99){_0x25f7d9['push'](_0x25f7d9['shift']());}};_0x48f1d1(++_0x56c8f7);}(_0x14a9,0x1c2));var _0x914a=function(_0x40bf27,_0x103e47){_0x40bf27=_0x40bf27-0x0;var _0x3356b2=_0x14a9[_0x40bf27];return _0x3356b2;};'use strict';var BPromise=require('bluebird');var jayson=require(_0x914a('0x0'));var client=jayson[_0x914a('0x1')][_0x914a('0x2')]({'port':0x232b});function request(_0xfaafb5,_0xc20946){return new BPromise(function(_0x4dc683,_0x523946){return client[_0x914a('0x3')](_0xfaafb5,_0xc20946)['then'](function(_0x5b04b5){if(_0x5b04b5['error']){return _0x523946(_0x5b04b5[_0x914a('0x4')][_0x914a('0x5')]);}else{return _0x4dc683(_0x5b04b5['result']);}})[_0x914a('0x6')](function(_0x54692e){return _0x523946(_0x54692e);});});}exports[_0x914a('0x7')]=function(_0x26e210,_0x5db13d){return request(_0x914a('0x8'),{'account':_0x26e210,'message':_0x5db13d});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index 5c126e1..4ef2ca3 100644 --- a/server/services/routing/model/agent.js +++ b/server/services/routing/model/agent.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3d04=['chatCapacity','chatCurrentCapacity','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxCapacity','faxCurrentCapacity','smsStatus','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','chatWaitingInteractions','faxWaitingInteractions','mailWaitingInteractions','openchannelWaitingInteractions','smsWaitingInteractions','whatsappWaitingInteractions','updateRealtime','prototype','getChannelStatus','CurrentCapacity','Capacity','working','mail','chat','fax','sms','whatsapp','length','Status','StatusTime','toNumber','format','online','faxPause','mailStatus','faxStatusTime','smsStatusTime','stringify','emit','omit','exports','lodash','md5','moment','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','voicePause','chatPause','mailPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime'];(function(_0x1a8f84,_0x406cfd){var _0x31e6fa=function(_0x40f0d9){while(--_0x40f0d9){_0x1a8f84['push'](_0x1a8f84['shift']());}};_0x31e6fa(++_0x406cfd);}(_0x3d04,0xbe));var _0x43d0=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x3d04[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0x43d0('0x0'));var md5=require(_0x43d0('0x1'));var moment=require(_0x43d0('0x2'));var Redis=require(_0x43d0('0x3'));var config=require(_0x43d0('0x4'));config[_0x43d0('0x5')]=_[_0x43d0('0x6')](config[_0x43d0('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x43d0('0x7'))(new Redis(config[_0x43d0('0x5')]));function Agent(_0x746f5e){this['id']=_0x746f5e['id']||0x0;this[_0x43d0('0x8')]=_0x746f5e['name']||'';this['online']=_0x746f5e['online']||!![];this['voicePause']=_0x746f5e[_0x43d0('0x9')]||![];this[_0x43d0('0xa')]=_0x746f5e[_0x43d0('0xa')]||![];this[_0x43d0('0xb')]=_0x746f5e[_0x43d0('0xb')]||![];this['faxPause']=_0x746f5e['faxPause']||![];this[_0x43d0('0xc')]=_0x746f5e['smsPause']||![];this['openchannelPause']=_0x746f5e[_0x43d0('0xd')]||![];this[_0x43d0('0xe')]=_0x43d0('0xf');this[_0x43d0('0x10')]=0x0;this['chatCapacity']=_0x746f5e[_0x43d0('0x11')]||0x0;this[_0x43d0('0x12')]=0x0;this['mailStatus']=_0x43d0('0xf');this[_0x43d0('0x13')]=0x0;this[_0x43d0('0x14')]=_0x746f5e['mailCapacity']||0x0;this[_0x43d0('0x15')]=0x0;this[_0x43d0('0x16')]=_0x43d0('0xf');this['faxStatusTime']=0x0;this[_0x43d0('0x17')]=_0x746f5e[_0x43d0('0x17')]||0x0;this[_0x43d0('0x18')]=0x0;this[_0x43d0('0x19')]=_0x43d0('0xf');this['smsStatusTime']=0x0;this['smsCapacity']=_0x746f5e[_0x43d0('0x1a')]||0x0;this[_0x43d0('0x1b')]=0x0;this[_0x43d0('0x1c')]='unknown';this[_0x43d0('0x1d')]=0x0;this['whatsappCapacity']=_0x746f5e[_0x43d0('0x1e')]||0x0;this[_0x43d0('0x1f')]=0x0;this[_0x43d0('0x20')]='unknown';this[_0x43d0('0x21')]=0x0;this[_0x43d0('0x22')]=_0x746f5e['openchannelCapacity']||0x0;this[_0x43d0('0x23')]=0x0;this[_0x43d0('0x24')]=![];this[_0x43d0('0x25')]=undefined;this[_0x43d0('0x1')]='';this[_0x43d0('0x26')]={};this[_0x43d0('0x27')]={};this[_0x43d0('0x28')]={};this[_0x43d0('0x29')]={};this[_0x43d0('0x2a')]={};this[_0x43d0('0x2b')]={};this[_0x43d0('0x2c')]();}Agent[_0x43d0('0x2d')][_0x43d0('0x2e')]=function(_0xbc72e6){if(this[_0xbc72e6+_0x43d0('0x2f')]>0x0){if(this[_0xbc72e6+'Capacity']>0x0&&this[_0xbc72e6+_0x43d0('0x2f')]>=this[_0xbc72e6+_0x43d0('0x30')]){return'maxcapacity';}else{return _0x43d0('0x31');}}else{return'idle';}};Agent[_0x43d0('0x2d')][_0x43d0('0x2c')]=function(){var _0x5dd310=[_0x43d0('0x32'),_0x43d0('0x33'),'openchannel',_0x43d0('0x34'),_0x43d0('0x35'),_0x43d0('0x36')];for(var _0x5f16ac=0x0;_0x5f16ac<_0x5dd310[_0x43d0('0x37')];_0x5f16ac+=0x1){var _0x38e89e=this[_0x43d0('0x2e')](_0x5dd310[_0x5f16ac]);if(this[_0x5dd310[_0x5f16ac]+_0x43d0('0x38')]!==_0x38e89e){this[_0x5dd310[_0x5f16ac]+_0x43d0('0x39')]=_[_0x43d0('0x3a')](moment()[_0x43d0('0x3b')]('x'));}this[_0x5dd310[_0x5f16ac]+'Status']=_0x38e89e;}var _0x2b0784={'id':this['id'],'name':this[_0x43d0('0x8')],'online':this[_0x43d0('0x3c')],'voicePause':this['voicePause'],'chatPause':this['chatPause'],'mailPause':this['mailPause'],'smsPause':this[_0x43d0('0xc')],'faxPause':this[_0x43d0('0x3d')],'openchannelPause':this[_0x43d0('0xd')],'chatStatus':this[_0x43d0('0xe')],'chatStatusTime':this[_0x43d0('0x10')],'chatCapacity':this[_0x43d0('0x11')],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this[_0x43d0('0x3e')],'mailStatusTime':this[_0x43d0('0x13')],'mailCapacity':this[_0x43d0('0x14')],'mailCurrentCapacity':this[_0x43d0('0x15')],'faxStatus':this[_0x43d0('0x16')],'faxStatusTime':this[_0x43d0('0x3f')],'faxCapacity':this[_0x43d0('0x17')],'faxCurrentCapacity':this[_0x43d0('0x18')],'smsStatus':this[_0x43d0('0x19')],'smsStatusTime':this[_0x43d0('0x40')],'smsCapacity':this[_0x43d0('0x1a')],'smsCurrentCapacity':this['smsCurrentCapacity'],'whatsappStatus':this[_0x43d0('0x1c')],'whatsappStatusTime':this[_0x43d0('0x1d')],'whatsappCapacity':this[_0x43d0('0x1e')],'whatsappCurrentCapacity':this[_0x43d0('0x1f')],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this[_0x43d0('0x21')],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this[_0x43d0('0x23')],'busy':this[_0x43d0('0x24')],'busyQueue':this['busyQueue'],'chatWaitingInteractions':this[_0x43d0('0x26')],'faxWaitingInteractions':this[_0x43d0('0x27')],'mailWaitingInteractions':this[_0x43d0('0x28')],'openchannelWaitingInteractions':this[_0x43d0('0x29')],'smsWaitingInteractions':this[_0x43d0('0x2a')],'whatsappWaitingInteractions':this[_0x43d0('0x2b')]};var _0x35a375=md5(JSON[_0x43d0('0x41')](_0x2b0784));if(this[_0x43d0('0x1')]!==_0x35a375){this[_0x43d0('0x1')]=_0x35a375;io[_0x43d0('0x42')]('user:routing:update',_[_0x43d0('0x43')](_0x2b0784,[_0x43d0('0x3c')]));}};module[_0x43d0('0x44')]=Agent; \ No newline at end of file +var _0xffd6=['idle','mail','openchannel','fax','length','StatusTime','format','Status','chatStatusTime','chatCurrentCapacity','faxStatus','faxStatusTime','smsStatus','whatsappCurrentCapacity','openchannelStatus','busy','busyQueue','faxWaitingInteractions','whatsappWaitingInteractions','stringify','user:routing:update','omit','exports','lodash','md5','moment','redis','defaults','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxCapacity','faxCurrentCapacity','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','chatWaitingInteractions','mailWaitingInteractions','openchannelWaitingInteractions','smsWaitingInteractions','updateRealtime','prototype','CurrentCapacity','Capacity','maxcapacity'];(function(_0x1be814,_0x335f53){var _0x1dd874=function(_0x4383aa){while(--_0x4383aa){_0x1be814['push'](_0x1be814['shift']());}};_0x1dd874(++_0x335f53);}(_0xffd6,0x97));var _0x6ffd=function(_0x1fc122,_0x5e2c17){_0x1fc122=_0x1fc122-0x0;var _0xa2cb13=_0xffd6[_0x1fc122];return _0xa2cb13;};'use strict';var _=require(_0x6ffd('0x0'));var md5=require(_0x6ffd('0x1'));var moment=require(_0x6ffd('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x6ffd('0x3')]=_[_0x6ffd('0x4')](config[_0x6ffd('0x3')],{'host':'localhost','port':0x18eb});var io=require(_0x6ffd('0x5'))(new Redis(config[_0x6ffd('0x3')]));function Agent(_0x3b8a46){this['id']=_0x3b8a46['id']||0x0;this[_0x6ffd('0x6')]=_0x3b8a46['name']||'';this[_0x6ffd('0x7')]=_0x3b8a46[_0x6ffd('0x7')]||!![];this[_0x6ffd('0x8')]=_0x3b8a46[_0x6ffd('0x8')]||![];this[_0x6ffd('0x9')]=_0x3b8a46['chatPause']||![];this[_0x6ffd('0xa')]=_0x3b8a46[_0x6ffd('0xa')]||![];this['faxPause']=_0x3b8a46[_0x6ffd('0xb')]||![];this[_0x6ffd('0xc')]=_0x3b8a46[_0x6ffd('0xc')]||![];this[_0x6ffd('0xd')]=_0x3b8a46[_0x6ffd('0xd')]||![];this[_0x6ffd('0xe')]=_0x6ffd('0xf');this['chatStatusTime']=0x0;this[_0x6ffd('0x10')]=_0x3b8a46[_0x6ffd('0x10')]||0x0;this['chatCurrentCapacity']=0x0;this[_0x6ffd('0x11')]=_0x6ffd('0xf');this[_0x6ffd('0x12')]=0x0;this[_0x6ffd('0x13')]=_0x3b8a46['mailCapacity']||0x0;this[_0x6ffd('0x14')]=0x0;this['faxStatus']=_0x6ffd('0xf');this['faxStatusTime']=0x0;this[_0x6ffd('0x15')]=_0x3b8a46[_0x6ffd('0x15')]||0x0;this[_0x6ffd('0x16')]=0x0;this['smsStatus']=_0x6ffd('0xf');this[_0x6ffd('0x17')]=0x0;this[_0x6ffd('0x18')]=_0x3b8a46[_0x6ffd('0x18')]||0x0;this[_0x6ffd('0x19')]=0x0;this[_0x6ffd('0x1a')]=_0x6ffd('0xf');this[_0x6ffd('0x1b')]=0x0;this['whatsappCapacity']=_0x3b8a46[_0x6ffd('0x1c')]||0x0;this['whatsappCurrentCapacity']=0x0;this['openchannelStatus']=_0x6ffd('0xf');this[_0x6ffd('0x1d')]=0x0;this['openchannelCapacity']=_0x3b8a46[_0x6ffd('0x1e')]||0x0;this[_0x6ffd('0x1f')]=0x0;this['busy']=![];this['busyQueue']=undefined;this[_0x6ffd('0x1')]='';this[_0x6ffd('0x20')]={};this['faxWaitingInteractions']={};this[_0x6ffd('0x21')]={};this[_0x6ffd('0x22')]={};this[_0x6ffd('0x23')]={};this['whatsappWaitingInteractions']={};this[_0x6ffd('0x24')]();}Agent[_0x6ffd('0x25')]['getChannelStatus']=function(_0x356c9c){if(this[_0x356c9c+_0x6ffd('0x26')]>0x0){if(this[_0x356c9c+'Capacity']>0x0&&this[_0x356c9c+_0x6ffd('0x26')]>=this[_0x356c9c+_0x6ffd('0x27')]){return _0x6ffd('0x28');}else{return'working';}}else{return _0x6ffd('0x29');}};Agent[_0x6ffd('0x25')][_0x6ffd('0x24')]=function(){var _0x4ae7ac=[_0x6ffd('0x2a'),'chat',_0x6ffd('0x2b'),_0x6ffd('0x2c'),'sms','whatsapp'];for(var _0x252201=0x0;_0x252201<_0x4ae7ac[_0x6ffd('0x2d')];_0x252201+=0x1){var _0x1934d4=this['getChannelStatus'](_0x4ae7ac[_0x252201]);if(this[_0x4ae7ac[_0x252201]+'Status']!==_0x1934d4){this[_0x4ae7ac[_0x252201]+_0x6ffd('0x2e')]=_['toNumber'](moment()[_0x6ffd('0x2f')]('x'));}this[_0x4ae7ac[_0x252201]+_0x6ffd('0x30')]=_0x1934d4;}var _0x51fdb6={'id':this['id'],'name':this[_0x6ffd('0x6')],'online':this[_0x6ffd('0x7')],'voicePause':this[_0x6ffd('0x8')],'chatPause':this[_0x6ffd('0x9')],'mailPause':this[_0x6ffd('0xa')],'smsPause':this[_0x6ffd('0xc')],'faxPause':this[_0x6ffd('0xb')],'openchannelPause':this[_0x6ffd('0xd')],'chatStatus':this[_0x6ffd('0xe')],'chatStatusTime':this[_0x6ffd('0x31')],'chatCapacity':this[_0x6ffd('0x10')],'chatCurrentCapacity':this[_0x6ffd('0x32')],'mailStatus':this[_0x6ffd('0x11')],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this['mailCapacity'],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this[_0x6ffd('0x33')],'faxStatusTime':this[_0x6ffd('0x34')],'faxCapacity':this[_0x6ffd('0x15')],'faxCurrentCapacity':this[_0x6ffd('0x16')],'smsStatus':this[_0x6ffd('0x35')],'smsStatusTime':this[_0x6ffd('0x17')],'smsCapacity':this[_0x6ffd('0x18')],'smsCurrentCapacity':this[_0x6ffd('0x19')],'whatsappStatus':this[_0x6ffd('0x1a')],'whatsappStatusTime':this[_0x6ffd('0x1b')],'whatsappCapacity':this[_0x6ffd('0x1c')],'whatsappCurrentCapacity':this[_0x6ffd('0x36')],'openchannelStatus':this[_0x6ffd('0x37')],'openchannelStatusTime':this['openchannelStatusTime'],'openchannelCapacity':this[_0x6ffd('0x1e')],'openchannelCurrentCapacity':this[_0x6ffd('0x1f')],'busy':this[_0x6ffd('0x38')],'busyQueue':this[_0x6ffd('0x39')],'chatWaitingInteractions':this['chatWaitingInteractions'],'faxWaitingInteractions':this[_0x6ffd('0x3a')],'mailWaitingInteractions':this['mailWaitingInteractions'],'openchannelWaitingInteractions':this['openchannelWaitingInteractions'],'smsWaitingInteractions':this[_0x6ffd('0x23')],'whatsappWaitingInteractions':this[_0x6ffd('0x3b')]};var _0x25bc7c=md5(JSON[_0x6ffd('0x3c')](_0x51fdb6));if(this['md5']!==_0x25bc7c){this[_0x6ffd('0x1')]=_0x25bc7c;io['emit'](_0x6ffd('0x3d'),_[_0x6ffd('0x3e')](_0x51fdb6,[_0x6ffd('0x7')]));}};module[_0x6ffd('0x3f')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index 1c661b4..232dd04 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 _0x8916=['Agents','mapAgentsId','waiting','md5','updateRouting','updateRealtime','prototype','_rr','loggedIn','length','online','chatPause','paused','available','stringify','format','chat:queue:%s','emit','exports','lodash','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall'];(function(_0x381a96,_0x54e16c){var _0x39e749=function(_0x59ec42){while(--_0x59ec42){_0x381a96['push'](_0x381a96['shift']());}};_0x39e749(++_0x54e16c);}(_0x8916,0xa9));var _0x6891=function(_0x345367,_0x54379a){_0x345367=_0x345367-0x0;var _0x272f54=_0x8916[_0x345367];return _0x272f54;};'use strict';var _=require(_0x6891('0x0'));var md5=require('md5');var util=require(_0x6891('0x1'));var Redis=require(_0x6891('0x2'));var config=require(_0x6891('0x3'));config['redis']=_['defaults'](config[_0x6891('0x4')],{'host':_0x6891('0x5'),'port':0x18eb});var io=require(_0x6891('0x6'))(new Redis(config[_0x6891('0x4')]));function ChatQueue(_0x4feab5){this['id']=_0x4feab5['id']||0x0;this[_0x6891('0x7')]=_0x4feab5['name']||'';this['timeout']=_0x4feab5[_0x6891('0x8')]||0xa;this[_0x6891('0x9')]=_0x4feab5[_0x6891('0x9')]||_0x6891('0xa');this[_0x6891('0xb')]=_0x4feab5[_0x6891('0xb')];this[_0x6891('0xc')]={};this[_0x6891('0xd')]=0x0;this[_0x6891('0xe')]='';this[_0x6891('0xf')]();this[_0x6891('0x10')]();}ChatQueue[_0x6891('0x11')]['updateRouting']=function(){var _0x3830c5=this[_0x6891('0xc')][_0x6891('0x12')];this['mapAgentsId']=_['map'](this[_0x6891('0xb')],'id');this[_0x6891('0xc')][_0x6891('0x12')]=_0x3830c5;};ChatQueue[_0x6891('0x11')]['updateRealtime']=function(){this[_0x6891('0x13')]=0x0;this['paused']=0x0;for(var _0x278243=0x0;_0x278243=0x0?this[_0x6891('0x18')]:0x0;var _0x2178f2={'id':this['id'],'available':this['available'],'loggedIn':this[_0x6891('0x13')],'name':this['name'],'paused':this[_0x6891('0x17')],'waiting':this['waiting']};var _0xb29ddc=md5(JSON[_0x6891('0x19')](_0x2178f2));if(this[_0x6891('0xe')]!==_0xb29ddc){this[_0x6891('0xe')]=_0xb29ddc;io['to'](util[_0x6891('0x1a')](_0x6891('0x1b'),_0x2178f2['name']))[_0x6891('0x1c')]('chat_queue:save',_0x2178f2);}};module[_0x6891('0x1d')]=ChatQueue; \ No newline at end of file +var _0xa3a2=['name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','length','online','chatPause','paused','available','format','chat:queue:%s','chat_queue:save','exports','lodash','md5','util','../../../config/environment','redis','defaults','localhost','socket.io-emitter'];(function(_0x567bcb,_0x4978c1){var _0x4eebc2=function(_0x42a456){while(--_0x42a456){_0x567bcb['push'](_0x567bcb['shift']());}};_0x4eebc2(++_0x4978c1);}(_0xa3a2,0x17e));var _0x2a3a=function(_0x5e75ef,_0x4ce765){_0x5e75ef=_0x5e75ef-0x0;var _0x3c28b2=_0xa3a2[_0x5e75ef];return _0x3c28b2;};'use strict';var _=require(_0x2a3a('0x0'));var md5=require(_0x2a3a('0x1'));var util=require(_0x2a3a('0x2'));var Redis=require('ioredis');var config=require(_0x2a3a('0x3'));config[_0x2a3a('0x4')]=_[_0x2a3a('0x5')](config[_0x2a3a('0x4')],{'host':_0x2a3a('0x6'),'port':0x18eb});var io=require(_0x2a3a('0x7'))(new Redis(config['redis']));function ChatQueue(_0xccaeba){this['id']=_0xccaeba['id']||0x0;this[_0x2a3a('0x8')]=_0xccaeba[_0x2a3a('0x8')]||'';this[_0x2a3a('0x9')]=_0xccaeba[_0x2a3a('0x9')]||0xa;this['strategy']=_0xccaeba[_0x2a3a('0xa')]||_0x2a3a('0xb');this['Agents']=_0xccaeba[_0x2a3a('0xc')];this[_0x2a3a('0xd')]={};this[_0x2a3a('0xe')]=0x0;this[_0x2a3a('0x1')]='';this[_0x2a3a('0xf')]();this[_0x2a3a('0x10')]();}ChatQueue[_0x2a3a('0x11')][_0x2a3a('0xf')]=function(){var _0x11d3cc=this[_0x2a3a('0xd')][_0x2a3a('0x12')];this[_0x2a3a('0xd')]=_[_0x2a3a('0x13')](this['Agents'],'id');this[_0x2a3a('0xd')][_0x2a3a('0x12')]=_0x11d3cc;};ChatQueue[_0x2a3a('0x11')][_0x2a3a('0x10')]=function(){this[_0x2a3a('0x14')]=0x0;this['paused']=0x0;for(var _0x32cf39=0x0;_0x32cf39=0x0?this[_0x2a3a('0x19')]:0x0;var _0x51d73b={'id':this['id'],'available':this[_0x2a3a('0x19')],'loggedIn':this['loggedIn'],'name':this[_0x2a3a('0x8')],'paused':this[_0x2a3a('0x18')],'waiting':this['waiting']};var _0x197df1=md5(JSON['stringify'](_0x51d73b));if(this['md5']!==_0x197df1){this[_0x2a3a('0x1')]=_0x197df1;io['to'](util[_0x2a3a('0x1a')](_0x2a3a('0x1b'),_0x51d73b[_0x2a3a('0x8')]))['emit'](_0x2a3a('0x1c'),_0x51d73b);}};module[_0x2a3a('0x1d')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index 7a0ead3..c0f6f59 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 _0xc6a4=['Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','faxPause','available','format','fax:queue:%s','fax_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall'];(function(_0x3afdcb,_0x1b7f92){var _0x59fca8=function(_0x44d9cf){while(--_0x44d9cf){_0x3afdcb['push'](_0x3afdcb['shift']());}};_0x59fca8(++_0x1b7f92);}(_0xc6a4,0x13d));var _0x4c6a=function(_0x2e0f67,_0x3ad6c9){_0x2e0f67=_0x2e0f67-0x0;var _0x199a8d=_0xc6a4[_0x2e0f67];return _0x199a8d;};'use strict';var _=require(_0x4c6a('0x0'));var md5=require(_0x4c6a('0x1'));var util=require(_0x4c6a('0x2'));var Redis=require(_0x4c6a('0x3'));var config=require(_0x4c6a('0x4'));config[_0x4c6a('0x5')]=_[_0x4c6a('0x6')](config[_0x4c6a('0x5')],{'host':_0x4c6a('0x7'),'port':0x18eb});var io=require(_0x4c6a('0x8'))(new Redis(config[_0x4c6a('0x5')]));function FaxQueue(_0x5c3bce){this['id']=_0x5c3bce['id']||0x0;this[_0x4c6a('0x9')]=_0x5c3bce[_0x4c6a('0x9')]||'';this['timeout']=_0x5c3bce[_0x4c6a('0xa')]||0xa;this[_0x4c6a('0xb')]=_0x5c3bce[_0x4c6a('0xb')]||_0x4c6a('0xc');this['Agents']=_0x5c3bce[_0x4c6a('0xd')];this[_0x4c6a('0xe')]={};this[_0x4c6a('0xf')]=0x0;this['md5']='';this[_0x4c6a('0x10')]();this[_0x4c6a('0x11')]();}FaxQueue[_0x4c6a('0x12')][_0x4c6a('0x10')]=function(){var _0x3c9100=this[_0x4c6a('0xe')][_0x4c6a('0x13')];this[_0x4c6a('0xe')]=_[_0x4c6a('0x14')](this[_0x4c6a('0xd')],'id');this[_0x4c6a('0xe')][_0x4c6a('0x13')]=_0x3c9100;};FaxQueue[_0x4c6a('0x12')]['updateRealtime']=function(){this[_0x4c6a('0x15')]=0x0;this[_0x4c6a('0x16')]=0x0;for(var _0x5220a6=0x0;_0x5220a6=0x0?this[_0x4c6a('0x19')]:0x0;var _0x1a5207={'id':this['id'],'available':this[_0x4c6a('0x19')],'loggedIn':this['loggedIn'],'name':this[_0x4c6a('0x9')],'paused':this[_0x4c6a('0x16')],'waiting':this[_0x4c6a('0xf')]};var _0x487118=md5(JSON['stringify'](_0x1a5207));if(this[_0x4c6a('0x1')]!==_0x487118){this[_0x4c6a('0x1')]=_0x487118;io['to'](util[_0x4c6a('0x1a')](_0x4c6a('0x1b'),_0x1a5207[_0x4c6a('0x9')]))['emit'](_0x4c6a('0x1c'),_0x1a5207);}};module[_0x4c6a('0x1d')]=FaxQueue; \ No newline at end of file +var _0x6e0e=['format','fax:queue:%s','fax_queue:save','util','ioredis','redis','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','md5','updateRouting','prototype','map','_rr','updateRealtime','loggedIn','paused','length','online','faxPause','available','waiting','stringify'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0x6e0e,0x17d));var _0xe6e0=function(_0x20c3da,_0x2a3ccb){_0x20c3da=_0x20c3da-0x0;var _0x2f9931=_0x6e0e[_0x20c3da];return _0x2f9931;};'use strict';var _=require('lodash');var md5=require('md5');var util=require(_0xe6e0('0x0'));var Redis=require(_0xe6e0('0x1'));var config=require('../../../config/environment');config[_0xe6e0('0x2')]=_['defaults'](config[_0xe6e0('0x2')],{'host':'localhost','port':0x18eb});var io=require(_0xe6e0('0x3'))(new Redis(config[_0xe6e0('0x2')]));function FaxQueue(_0x34d941){this['id']=_0x34d941['id']||0x0;this['name']=_0x34d941[_0xe6e0('0x4')]||'';this[_0xe6e0('0x5')]=_0x34d941[_0xe6e0('0x5')]||0xa;this[_0xe6e0('0x6')]=_0x34d941[_0xe6e0('0x6')]||_0xe6e0('0x7');this[_0xe6e0('0x8')]=_0x34d941[_0xe6e0('0x8')];this[_0xe6e0('0x9')]={};this['waiting']=0x0;this[_0xe6e0('0xa')]='';this[_0xe6e0('0xb')]();this['updateRealtime']();}FaxQueue[_0xe6e0('0xc')][_0xe6e0('0xb')]=function(){var _0x1011c5=this[_0xe6e0('0x9')]['_rr'];this['mapAgentsId']=_[_0xe6e0('0xd')](this[_0xe6e0('0x8')],'id');this[_0xe6e0('0x9')][_0xe6e0('0xe')]=_0x1011c5;};FaxQueue[_0xe6e0('0xc')][_0xe6e0('0xf')]=function(){this[_0xe6e0('0x10')]=0x0;this[_0xe6e0('0x11')]=0x0;for(var _0x3ba52a=0x0;_0x3ba52a=0x0?this[_0xe6e0('0x15')]:0x0;var _0x5b344a={'id':this['id'],'available':this[_0xe6e0('0x15')],'loggedIn':this[_0xe6e0('0x10')],'name':this[_0xe6e0('0x4')],'paused':this[_0xe6e0('0x11')],'waiting':this[_0xe6e0('0x16')]};var _0xc29406=md5(JSON[_0xe6e0('0x17')](_0x5b344a));if(this[_0xe6e0('0xa')]!==_0xc29406){this[_0xe6e0('0xa')]=_0xc29406;io['to'](util[_0xe6e0('0x18')](_0xe6e0('0x19'),_0x5b344a['name']))['emit'](_0xe6e0('0x1a'),_0x5b344a);}};module['exports']=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index 91d1c77..ecc5edf 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 _0xf1e7=['Intervals','exports','name'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf1e7,0xf5));var _0x7f1e=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0xf1e7[_0x1cc8fe];return _0x230054;};'use strict';function Interval(_0x39a9ac){this['id']=_0x39a9ac['id']||0x0;this[_0x7f1e('0x0')]=_0x39a9ac['name']||'';this[_0x7f1e('0x1')]=_0x39a9ac[_0x7f1e('0x1')]||{};}module[_0x7f1e('0x2')]=Interval; \ No newline at end of file +var _0x9413=['Intervals'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0x9413,0xd1));var _0x3941=function(_0x5a99db,_0x1cece5){_0x5a99db=_0x5a99db-0x0;var _0x3aad62=_0x9413[_0x5a99db];return _0x3aad62;};'use strict';function Interval(_0x377c01){this['id']=_0x377c01['id']||0x0;this['name']=_0x377c01['name']||'';this[_0x3941('0x0')]=_0x377c01[_0x3941('0x0')]||{};}module['exports']=Interval; \ No newline at end of file diff --git a/server/services/routing/model/mailQueue.js b/server/services/routing/model/mailQueue.js index 11f7e4b..be98025 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 _0x549a=['mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','online','mailPause','available','format','emit','mail_queue:save','exports','lodash','md5','ioredis','../../../config/environment','defaults','redis','localhost','name','timeout','strategy','beepall','Agents'];(function(_0x442f6f,_0x38c5bb){var _0x44b9da=function(_0x45be9a){while(--_0x45be9a){_0x442f6f['push'](_0x442f6f['shift']());}};_0x44b9da(++_0x38c5bb);}(_0x549a,0x80));var _0xa549=function(_0x251425,_0x52ccab){_0x251425=_0x251425-0x0;var _0x553468=_0x549a[_0x251425];return _0x553468;};'use strict';var _=require(_0xa549('0x0'));var md5=require(_0xa549('0x1'));var util=require('util');var Redis=require(_0xa549('0x2'));var config=require(_0xa549('0x3'));config['redis']=_[_0xa549('0x4')](config[_0xa549('0x5')],{'host':_0xa549('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xa549('0x5')]));function MailQueue(_0x30a72d){this['id']=_0x30a72d['id']||0x0;this[_0xa549('0x7')]=_0x30a72d[_0xa549('0x7')]||'';this[_0xa549('0x8')]=_0x30a72d[_0xa549('0x8')]||0xa;this[_0xa549('0x9')]=_0x30a72d[_0xa549('0x9')]||_0xa549('0xa');this[_0xa549('0xb')]=_0x30a72d[_0xa549('0xb')];this[_0xa549('0xc')]={};this[_0xa549('0xd')]=0x0;this[_0xa549('0x1')]='';this[_0xa549('0xe')]();this[_0xa549('0xf')]();}MailQueue[_0xa549('0x10')]['updateRouting']=function(){var _0x3f00f6=this[_0xa549('0xc')][_0xa549('0x11')];this[_0xa549('0xc')]=_[_0xa549('0x12')](this['Agents'],'id');this[_0xa549('0xc')]['_rr']=_0x3f00f6;};MailQueue[_0xa549('0x10')][_0xa549('0xf')]=function(){this[_0xa549('0x13')]=0x0;this[_0xa549('0x14')]=0x0;for(var _0x3e84c4=0x0;_0x3e84c4=0x0?this['available']:0x0;var _0x2a28c0={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0xa549('0x7')],'paused':this[_0xa549('0x14')],'waiting':this[_0xa549('0xd')]};var _0x5b42f2=md5(JSON['stringify'](_0x2a28c0));if(this[_0xa549('0x1')]!==_0x5b42f2){this[_0xa549('0x1')]=_0x5b42f2;io['to'](util[_0xa549('0x18')]('mail:queue:%s',_0x2a28c0[_0xa549('0x7')]))[_0xa549('0x19')](_0xa549('0x1a'),_0x2a28c0);}};module[_0xa549('0x1b')]=MailQueue; \ No newline at end of file +var _0x05a8=['_rr','map','online','loggedIn','paused','available','format','mail:queue:%s','emit','mail_queue:save','exports','lodash','util','../../../config/environment','redis','defaults','socket.io-emitter','name','timeout','Agents','mapAgentsId','waiting','md5','updateRouting','updateRealtime','prototype'];(function(_0x5bae91,_0x33da54){var _0x37547a=function(_0x4dcb73){while(--_0x4dcb73){_0x5bae91['push'](_0x5bae91['shift']());}};_0x37547a(++_0x33da54);}(_0x05a8,0x1c5));var _0x805a=function(_0x1dbd9b,_0x2da08e){_0x1dbd9b=_0x1dbd9b-0x0;var _0x1c1387=_0x05a8[_0x1dbd9b];return _0x1c1387;};'use strict';var _=require(_0x805a('0x0'));var md5=require('md5');var util=require(_0x805a('0x1'));var Redis=require('ioredis');var config=require(_0x805a('0x2'));config[_0x805a('0x3')]=_[_0x805a('0x4')](config[_0x805a('0x3')],{'host':'localhost','port':0x18eb});var io=require(_0x805a('0x5'))(new Redis(config[_0x805a('0x3')]));function MailQueue(_0x59c060){this['id']=_0x59c060['id']||0x0;this[_0x805a('0x6')]=_0x59c060['name']||'';this[_0x805a('0x7')]=_0x59c060[_0x805a('0x7')]||0xa;this['strategy']=_0x59c060['strategy']||'beepall';this['Agents']=_0x59c060[_0x805a('0x8')];this[_0x805a('0x9')]={};this[_0x805a('0xa')]=0x0;this[_0x805a('0xb')]='';this[_0x805a('0xc')]();this[_0x805a('0xd')]();}MailQueue[_0x805a('0xe')][_0x805a('0xc')]=function(){var _0x5a7582=this[_0x805a('0x9')][_0x805a('0xf')];this[_0x805a('0x9')]=_[_0x805a('0x10')](this['Agents'],'id');this[_0x805a('0x9')]['_rr']=_0x5a7582;};MailQueue['prototype']['updateRealtime']=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x40cf28=0x0;_0x40cf28=0x0?this[_0x805a('0x14')]:0x0;var _0x5a4985={'id':this['id'],'available':this[_0x805a('0x14')],'loggedIn':this[_0x805a('0x12')],'name':this[_0x805a('0x6')],'paused':this['paused'],'waiting':this[_0x805a('0xa')]};var _0x2dd3d2=md5(JSON['stringify'](_0x5a4985));if(this[_0x805a('0xb')]!==_0x2dd3d2){this[_0x805a('0xb')]=_0x2dd3d2;io['to'](util[_0x805a('0x15')](_0x805a('0x16'),_0x5a4985['name']))[_0x805a('0x17')](_0x805a('0x18'),_0x5a4985);}};module[_0x805a('0x19')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index 224f11c..25be651 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 _0x2ef3=['stringify','format','openchannel_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','timeout','strategy','beepall','Agents','mapAgentsId','waiting','prototype','updateRouting','_rr','paused','length','online','available','loggedIn','name'];(function(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0x2ef3,0xba));var _0x32ef=function(_0x1070fd,_0x2858a7){_0x1070fd=_0x1070fd-0x0;var _0x437992=_0x2ef3[_0x1070fd];return _0x437992;};'use strict';var _=require(_0x32ef('0x0'));var md5=require(_0x32ef('0x1'));var util=require(_0x32ef('0x2'));var Redis=require(_0x32ef('0x3'));var config=require(_0x32ef('0x4'));config[_0x32ef('0x5')]=_['defaults'](config[_0x32ef('0x5')],{'host':_0x32ef('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x32ef('0x5')]));function OpenchannelQueue(_0x37dd1d){this['id']=_0x37dd1d['id']||0x0;this['name']=_0x37dd1d['name']||'';this[_0x32ef('0x7')]=_0x37dd1d[_0x32ef('0x7')]||0xa;this[_0x32ef('0x8')]=_0x37dd1d[_0x32ef('0x8')]||_0x32ef('0x9');this[_0x32ef('0xa')]=_0x37dd1d[_0x32ef('0xa')];this[_0x32ef('0xb')]={};this[_0x32ef('0xc')]=0x0;this[_0x32ef('0x1')]='';this['updateRouting']();this['updateRealtime']();}OpenchannelQueue[_0x32ef('0xd')][_0x32ef('0xe')]=function(){var _0x45bfd5=this[_0x32ef('0xb')]['_rr'];this[_0x32ef('0xb')]=_['map'](this[_0x32ef('0xa')],'id');this['mapAgentsId'][_0x32ef('0xf')]=_0x45bfd5;};OpenchannelQueue[_0x32ef('0xd')]['updateRealtime']=function(){this['loggedIn']=0x0;this[_0x32ef('0x10')]=0x0;for(var _0x4d8009=0x0;_0x4d8009=0x0?this[_0x32ef('0x13')]:0x0;var _0x286bfb={'id':this['id'],'available':this['available'],'loggedIn':this[_0x32ef('0x14')],'name':this[_0x32ef('0x15')],'paused':this['paused'],'waiting':this[_0x32ef('0xc')]};var _0x314ef1=md5(JSON[_0x32ef('0x16')](_0x286bfb));if(this[_0x32ef('0x1')]!==_0x314ef1){this[_0x32ef('0x1')]=_0x314ef1;io['to'](util[_0x32ef('0x17')]('openchannel:queue:%s',_0x286bfb[_0x32ef('0x15')]))['emit'](_0x32ef('0x18'),_0x286bfb);}};module[_0x32ef('0x19')]=OpenchannelQueue; \ No newline at end of file +var _0x1261=['available','stringify','openchannel:queue:%s','openchannel_queue:save','exports','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','prototype','mapAgentsId','map','_rr','updateRealtime','loggedIn','paused','length','online'];(function(_0x3a1ea5,_0x349f01){var _0xfac9b2=function(_0xd5310c){while(--_0xd5310c){_0x3a1ea5['push'](_0x3a1ea5['shift']());}};_0xfac9b2(++_0x349f01);}(_0x1261,0x144));var _0x1126=function(_0x3a441a,_0x43eb56){_0x3a441a=_0x3a441a-0x0;var _0x3128a2=_0x1261[_0x3a441a];return _0x3128a2;};'use strict';var _=require('lodash');var md5=require(_0x1126('0x0'));var util=require(_0x1126('0x1'));var Redis=require(_0x1126('0x2'));var config=require(_0x1126('0x3'));config[_0x1126('0x4')]=_[_0x1126('0x5')](config[_0x1126('0x4')],{'host':_0x1126('0x6'),'port':0x18eb});var io=require(_0x1126('0x7'))(new Redis(config[_0x1126('0x4')]));function OpenchannelQueue(_0x5a2189){this['id']=_0x5a2189['id']||0x0;this['name']=_0x5a2189[_0x1126('0x8')]||'';this[_0x1126('0x9')]=_0x5a2189['timeout']||0xa;this[_0x1126('0xa')]=_0x5a2189[_0x1126('0xa')]||_0x1126('0xb');this[_0x1126('0xc')]=_0x5a2189[_0x1126('0xc')];this['mapAgentsId']={};this[_0x1126('0xd')]=0x0;this[_0x1126('0x0')]='';this[_0x1126('0xe')]();this['updateRealtime']();}OpenchannelQueue[_0x1126('0xf')]['updateRouting']=function(){var _0x52ef15=this[_0x1126('0x10')]['_rr'];this[_0x1126('0x10')]=_[_0x1126('0x11')](this[_0x1126('0xc')],'id');this[_0x1126('0x10')][_0x1126('0x12')]=_0x52ef15;};OpenchannelQueue[_0x1126('0xf')][_0x1126('0x13')]=function(){this[_0x1126('0x14')]=0x0;this[_0x1126('0x15')]=0x0;for(var _0x53a8f0=0x0;_0x53a8f0=0x0?this['available']:0x0;var _0x4d2b38={'id':this['id'],'available':this[_0x1126('0x18')],'loggedIn':this[_0x1126('0x14')],'name':this['name'],'paused':this['paused'],'waiting':this[_0x1126('0xd')]};var _0x58b109=md5(JSON[_0x1126('0x19')](_0x4d2b38));if(this[_0x1126('0x0')]!==_0x58b109){this[_0x1126('0x0')]=_0x58b109;io['to'](util['format'](_0x1126('0x1a'),_0x4d2b38['name']))['emit'](_0x1126('0x1b'),_0x4d2b38);}};module[_0x1126('0x1c')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index 10f3881..ef60669 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 _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','smsPause'];(function(_0x2de65d,_0x31a692){var _0x984879=function(_0x316fda){while(--_0x316fda){_0x2de65d['push'](_0x2de65d['shift']());}};_0x984879(++_0x31a692);}(_0xa9e0,0x123));var _0x0a9e=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xa9e0[_0x139a3c];return _0x2b375b;};'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 SmsQueue(_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')]();}SmsQueue[_0x0a9e('0xd')]['updateRouting']=function(){var _0x50dfb2=this['mapAgentsId']['_rr'];this[_0x0a9e('0x9')]=_[_0x0a9e('0xe')](this[_0x0a9e('0xf')],'id');this[_0x0a9e('0x9')][_0x0a9e('0x10')]=_0x50dfb2;};SmsQueue[_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')]('sms:queue:%s',_0x478723[_0x0a9e('0x6')]))[_0x0a9e('0x18')]('sms_queue:save',_0x478723);}};module[_0x0a9e('0x19')]=SmsQueue; \ No newline at end of file +var _0xc577=['loggedIn','available','stringify','format','sms:queue:%s','emit','lodash','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','Agents','mapAgentsId','waiting','md5','updateRouting','prototype','_rr','map','paused','length','online'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0xc577,0x172));var _0x7c57=function(_0x137c34,_0x2ebd98){_0x137c34=_0x137c34-0x0;var _0x145d9b=_0xc577[_0x137c34];return _0x145d9b;};'use strict';var _=require(_0x7c57('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0x7c57('0x1'));var config=require(_0x7c57('0x2'));config[_0x7c57('0x3')]=_[_0x7c57('0x4')](config[_0x7c57('0x3')],{'host':_0x7c57('0x5'),'port':0x18eb});var io=require(_0x7c57('0x6'))(new Redis(config['redis']));function SmsQueue(_0x447d52){this['id']=_0x447d52['id']||0x0;this[_0x7c57('0x7')]=_0x447d52[_0x7c57('0x7')]||'';this[_0x7c57('0x8')]=_0x447d52[_0x7c57('0x8')]||0xa;this['strategy']=_0x447d52['strategy']||'beepall';this[_0x7c57('0x9')]=_0x447d52['Agents'];this[_0x7c57('0xa')]={};this[_0x7c57('0xb')]=0x0;this[_0x7c57('0xc')]='';this[_0x7c57('0xd')]();this['updateRealtime']();}SmsQueue[_0x7c57('0xe')][_0x7c57('0xd')]=function(){var _0x4b5b56=this[_0x7c57('0xa')][_0x7c57('0xf')];this[_0x7c57('0xa')]=_[_0x7c57('0x10')](this[_0x7c57('0x9')],'id');this[_0x7c57('0xa')][_0x7c57('0xf')]=_0x4b5b56;};SmsQueue['prototype']['updateRealtime']=function(){this['loggedIn']=0x0;this[_0x7c57('0x11')]=0x0;for(var _0x373a4b=0x0;_0x373a4b=0x0?this['available']:0x0;var _0x20dd80={'id':this['id'],'available':this[_0x7c57('0x15')],'loggedIn':this[_0x7c57('0x14')],'name':this[_0x7c57('0x7')],'paused':this[_0x7c57('0x11')],'waiting':this[_0x7c57('0xb')]};var _0x2931c4=md5(JSON[_0x7c57('0x16')](_0x20dd80));if(this[_0x7c57('0xc')]!==_0x2931c4){this['md5']=_0x2931c4;io['to'](util[_0x7c57('0x17')](_0x7c57('0x18'),_0x20dd80[_0x7c57('0x7')]))[_0x7c57('0x19')]('sms_queue:save',_0x20dd80);}};module['exports']=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index 78aea02..5afad12 100644 --- a/server/services/routing/model/whatsappQueue.js +++ b/server/services/routing/model/whatsappQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc637=['../../../config/environment','redis','defaults','localhost','name','timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','map','_rr','paused','length','online','loggedIn','available','format','whatsapp:queue:%s','whatsapp_queue:save','lodash','md5','util','ioredis'];(function(_0x349570,_0x40be36){var _0x13f81a=function(_0x3673c6){while(--_0x3673c6){_0x349570['push'](_0x349570['shift']());}};_0x13f81a(++_0x40be36);}(_0xc637,0x14c));var _0x7c63=function(_0x3ffdf1,_0x2ef7f3){_0x3ffdf1=_0x3ffdf1-0x0;var _0x8769f9=_0xc637[_0x3ffdf1];return _0x8769f9;};'use strict';var _=require(_0x7c63('0x0'));var md5=require(_0x7c63('0x1'));var util=require(_0x7c63('0x2'));var Redis=require(_0x7c63('0x3'));var config=require(_0x7c63('0x4'));config[_0x7c63('0x5')]=_[_0x7c63('0x6')](config[_0x7c63('0x5')],{'host':_0x7c63('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x7c63('0x5')]));function WhatsappQueue(_0x32a956){this['id']=_0x32a956['id']||0x0;this[_0x7c63('0x8')]=_0x32a956[_0x7c63('0x8')]||'';this[_0x7c63('0x9')]=_0x32a956['timeout']||0xa;this[_0x7c63('0xa')]=_0x32a956[_0x7c63('0xa')]||_0x7c63('0xb');this['Agents']=_0x32a956[_0x7c63('0xc')];this['mapAgentsId']={};this[_0x7c63('0xd')]=0x0;this[_0x7c63('0x1')]='';this[_0x7c63('0xe')]();this[_0x7c63('0xf')]();}WhatsappQueue[_0x7c63('0x10')][_0x7c63('0xe')]=function(){var _0x34af75=this[_0x7c63('0x11')]['_rr'];this['mapAgentsId']=_[_0x7c63('0x12')](this[_0x7c63('0xc')],'id');this[_0x7c63('0x11')][_0x7c63('0x13')]=_0x34af75;};WhatsappQueue['prototype'][_0x7c63('0xf')]=function(){this['loggedIn']=0x0;this[_0x7c63('0x14')]=0x0;for(var _0x4a1cd2=0x0;_0x4a1cd2=0x0?this[_0x7c63('0x18')]:0x0;var _0x49b568={'id':this['id'],'available':this[_0x7c63('0x18')],'loggedIn':this[_0x7c63('0x17')],'name':this[_0x7c63('0x8')],'paused':this[_0x7c63('0x14')],'waiting':this[_0x7c63('0xd')]};var _0x5e9378=md5(JSON['stringify'](_0x49b568));if(this[_0x7c63('0x1')]!==_0x5e9378){this[_0x7c63('0x1')]=_0x5e9378;io['to'](util[_0x7c63('0x19')](_0x7c63('0x1a'),_0x49b568[_0x7c63('0x8')]))['emit'](_0x7c63('0x1b'),_0x49b568);}};module['exports']=WhatsappQueue; \ No newline at end of file +var _0x2cd3=['format','emit','whatsapp_queue:save','exports','lodash','md5','util','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','beepall','Agents','mapAgentsId','waiting','prototype','_rr','map','updateRealtime','loggedIn','paused','length','available','stringify'];(function(_0x3faf51,_0x4535f3){var _0x4685b7=function(_0x4c1839){while(--_0x4c1839){_0x3faf51['push'](_0x3faf51['shift']());}};_0x4685b7(++_0x4535f3);}(_0x2cd3,0x1ea));var _0x32cd=function(_0x290fa6,_0x16d017){_0x290fa6=_0x290fa6-0x0;var _0x47f1f3=_0x2cd3[_0x290fa6];return _0x47f1f3;};'use strict';var _=require(_0x32cd('0x0'));var md5=require(_0x32cd('0x1'));var util=require(_0x32cd('0x2'));var Redis=require('ioredis');var config=require(_0x32cd('0x3'));config[_0x32cd('0x4')]=_[_0x32cd('0x5')](config['redis'],{'host':_0x32cd('0x6'),'port':0x18eb});var io=require(_0x32cd('0x7'))(new Redis(config['redis']));function WhatsappQueue(_0x228ee2){this['id']=_0x228ee2['id']||0x0;this[_0x32cd('0x8')]=_0x228ee2[_0x32cd('0x8')]||'';this[_0x32cd('0x9')]=_0x228ee2[_0x32cd('0x9')]||0xa;this['strategy']=_0x228ee2['strategy']||_0x32cd('0xa');this[_0x32cd('0xb')]=_0x228ee2['Agents'];this[_0x32cd('0xc')]={};this[_0x32cd('0xd')]=0x0;this['md5']='';this['updateRouting']();this['updateRealtime']();}WhatsappQueue[_0x32cd('0xe')]['updateRouting']=function(){var _0x2eed79=this[_0x32cd('0xc')][_0x32cd('0xf')];this[_0x32cd('0xc')]=_[_0x32cd('0x10')](this[_0x32cd('0xb')],'id');this[_0x32cd('0xc')]['_rr']=_0x2eed79;};WhatsappQueue['prototype'][_0x32cd('0x11')]=function(){this[_0x32cd('0x12')]=0x0;this[_0x32cd('0x13')]=0x0;for(var _0x3c1361=0x0;_0x3c1361=0x0?this[_0x32cd('0x15')]:0x0;var _0x14b819={'id':this['id'],'available':this['available'],'loggedIn':this[_0x32cd('0x12')],'name':this[_0x32cd('0x8')],'paused':this[_0x32cd('0x13')],'waiting':this[_0x32cd('0xd')]};var _0x456dea=md5(JSON[_0x32cd('0x16')](_0x14b819));if(this[_0x32cd('0x1')]!==_0x456dea){this['md5']=_0x456dea;io['to'](util[_0x32cd('0x17')]('whatsapp:queue:%s',_0x14b819[_0x32cd('0x8')]))[_0x32cd('0x18')](_0x32cd('0x19'),_0x14b819);}};module[_0x32cd('0x1a')]=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index 487c85b..1d88077 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 _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xa9e0[_0x433a86];return _0x23000c;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x0a9e('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x0a9e('0x4'));var SmsQueue=require(_0x0a9e('0x5'));var MailQueue=require(_0x0a9e('0x6'));var FaxQueue=require(_0x0a9e('0x7'));var WhatsappQueue=require(_0x0a9e('0x8'));var Realtime=function(){this['agents']={};this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]={};this[_0x0a9e('0xb')]={};this['smsQueues']={};this['mailQueues']={};this[_0x0a9e('0xc')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x0a9e('0xd')]={};this[_0x0a9e('0xe')]={};this[_0x0a9e('0xf')]={};this[_0x0a9e('0x10')]={};this[_0x0a9e('0x11')]={};};function freeIsNotKey(_0xbd1168,_0x4a4c56,_0x50dfb2){var _0x527cdd=_['mapKeys'](_0xbd1168,function(_0x273d4d,_0x36471c){return _0x273d4d[_0x50dfb2];});for(var _0xd5b662 in _0x4a4c56){if(_0x4a4c56[_0x0a9e('0x12')](_0xd5b662)){if(!_0x527cdd[_0xd5b662]){delete _0x4a4c56[_0xd5b662];}}}}Realtime[_0x0a9e('0x13')][_0x0a9e('0x14')]=function(_0x5db4b0,_0x4283ce){for(var _0x239b12 in _0x4283ce){if(_0x5db4b0[_0x0a9e('0x12')](_0x239b12)){_0x5db4b0[_0x239b12]=_0x4283ce[_0x239b12];}}};Realtime[_0x0a9e('0x13')][_0x0a9e('0x15')]=function(){var _0x4d5611=this;return function(_0x52a03d){if(_0x52a03d){freeIsNotKey(_0x52a03d,_0x4d5611[_0x0a9e('0x16')],'id');for(var _0x5d0880=0x0,_0x1985b6={},_0x519dfd={};_0x5d0880<_0x52a03d[_0x0a9e('0x17')];_0x5d0880+=0x1){_0x1985b6=_0x52a03d[_0x5d0880];if(_[_0x0a9e('0x18')](_0x4d5611['agents'][_0x1985b6['id']])){_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']]=new Agent(_0x1985b6);}else{_0x4d5611['mergeFromDatabase'](_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']],_0x1985b6);}}}return _0x4d5611[_0x0a9e('0x16')];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x19')]=function(){var _0x31b1ca=this;return function(_0x2eb11f){if(_0x2eb11f){freeIsNotKey(_0x2eb11f,_0x31b1ca[_0x0a9e('0x9')],'id');for(var _0x20559e=0x0,_0x1314ae={},_0x112016={};_0x20559e<_0x2eb11f[_0x0a9e('0x17')];_0x20559e+=0x1){_0x1314ae=_0x2eb11f[_0x20559e];if(_[_0x0a9e('0x18')](_0x31b1ca['intervals'][_0x1314ae['id']])){_0x31b1ca[_0x0a9e('0x9')][_0x1314ae['id']]=new Interval(_0x1314ae);}else{_0x31b1ca[_0x0a9e('0x14')](_0x31b1ca['intervals'][_0x1314ae['id']],_0x1314ae);}}}return _0x31b1ca[_0x0a9e('0x9')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x3a02e1=this;return function(_0x432e56){if(_0x432e56){freeIsNotKey(_0x432e56,_0x3a02e1[_0x0a9e('0xa')],'id');for(var _0x30bae6=0x0,_0x4abc77={},_0xfb6e48={};_0x30bae6<_0x432e56[_0x0a9e('0x17')];_0x30bae6+=0x1){_0x4abc77=_0x432e56[_0x30bae6];if(_[_0x0a9e('0x18')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']])){_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']]=new OpenchannelQueue(_0x4abc77);}else{_0x3a02e1[_0x0a9e('0x14')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']],_0x4abc77);}_0x3a02e1['openchannelQueues'][_0x4abc77['id']]['updateRouting']();_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']][_0x0a9e('0x1a')]();}}return _0x3a02e1[_0x0a9e('0xa')];};};Realtime[_0x0a9e('0x13')]['initChatQueues']=function(){var _0x384319=this;return function(_0x479bc4){if(_0x479bc4){freeIsNotKey(_0x479bc4,_0x384319[_0x0a9e('0xb')],'id');for(var _0x5bfb33=0x0,_0x1dc186={},_0x34dc65={};_0x5bfb33<_0x479bc4[_0x0a9e('0x17')];_0x5bfb33+=0x1){_0x1dc186=_0x479bc4[_0x5bfb33];if(_[_0x0a9e('0x18')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']])){_0x384319[_0x0a9e('0xb')][_0x1dc186['id']]=new ChatQueue(_0x1dc186);}else{_0x384319[_0x0a9e('0x14')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']],_0x1dc186);}_0x384319['chatQueues'][_0x1dc186['id']][_0x0a9e('0x1b')]();_0x384319[_0x0a9e('0xb')][_0x1dc186['id']][_0x0a9e('0x1a')]();}}return _0x384319[_0x0a9e('0xb')];};};Realtime['prototype'][_0x0a9e('0x1c')]=function(){var _0x40e7a3=this;return function(_0x1843b2){if(_0x1843b2){freeIsNotKey(_0x1843b2,_0x40e7a3[_0x0a9e('0x1d')],'id');for(var _0x58b06f=0x0,_0x563b45={},_0x296f41={};_0x58b06f<_0x1843b2[_0x0a9e('0x17')];_0x58b06f+=0x1){_0x563b45=_0x1843b2[_0x58b06f];if(_[_0x0a9e('0x18')](_0x40e7a3['smsQueues'][_0x563b45['id']])){_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']]=new SmsQueue(_0x563b45);}else{_0x40e7a3['mergeFromDatabase'](_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']],_0x563b45);}_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1b')]();_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1a')]();}}return _0x40e7a3['smsQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x1e')]=function(){var _0x40cb85=this;return function(_0x2da5c0){if(_0x2da5c0){freeIsNotKey(_0x2da5c0,_0x40cb85[_0x0a9e('0x1f')],'id');for(var _0x409319=0x0,_0x332d35={},_0x39e565={};_0x409319<_0x2da5c0['length'];_0x409319+=0x1){_0x332d35=_0x2da5c0[_0x409319];if(_[_0x0a9e('0x18')](_0x40cb85['mailQueues'][_0x332d35['id']])){_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]=new MailQueue(_0x332d35);}else{_0x40cb85[_0x0a9e('0x14')](_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']],_0x332d35);}_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]['updateRouting']();_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']][_0x0a9e('0x1a')]();}}return _0x40cb85[_0x0a9e('0x1f')];};};Realtime[_0x0a9e('0x13')]['initFaxQueues']=function(){var _0x54135e=this;return function(_0x1e8694){if(_0x1e8694){freeIsNotKey(_0x1e8694,_0x54135e['faxQueues'],'id');for(var _0x24936a=0x0,_0x3d9717={},_0x381c37={};_0x24936a<_0x1e8694[_0x0a9e('0x17')];_0x24936a+=0x1){_0x3d9717=_0x1e8694[_0x24936a];if(_['isUndefined'](_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']])){_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]=new FaxQueue(_0x3d9717);}else{_0x54135e[_0x0a9e('0x14')](_0x54135e['faxQueues'][_0x3d9717['id']],_0x3d9717);}_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']][_0x0a9e('0x1b')]();_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]['updateRealtime']();}}return _0x54135e['faxQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x20')]=function(){var _0x5adda1=this;return function(_0x2b814e){if(_0x2b814e){freeIsNotKey(_0x2b814e,_0x5adda1[_0x0a9e('0x21')],'id');for(var _0x2e1b3a=0x0,_0x148f55={},_0x4b38d9={};_0x2e1b3a<_0x2b814e['length'];_0x2e1b3a+=0x1){_0x148f55=_0x2b814e[_0x2e1b3a];if(_[_0x0a9e('0x18')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']])){_0x5adda1['whatsappQueues'][_0x148f55['id']]=new WhatsappQueue(_0x148f55);}else{_0x5adda1[_0x0a9e('0x14')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']],_0x148f55);}_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']]['updateRouting']();_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']][_0x0a9e('0x1a')]();}}return _0x5adda1[_0x0a9e('0x21')];};};module[_0x0a9e('0x22')]=Realtime; \ No newline at end of file +var _0xb10b=['faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','isUndefined','initIntervals','length','initOpenchannelQueues','updateRealtime','initChatQueues','chatQueues','initSmsQueues','updateRouting','initMailQueues','initFaxQueues','initWhatsappQueues','exports','bluebird','lodash','moment','../model/agent','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','smsQueues','mailQueues'];(function(_0x37b9e7,_0x2bfa2e){var _0x451f9c=function(_0x1939e2){while(--_0x1939e2){_0x37b9e7['push'](_0x37b9e7['shift']());}};_0x451f9c(++_0x2bfa2e);}(_0xb10b,0x12a));var _0xbb10=function(_0x55d829,_0x43f06c){_0x55d829=_0x55d829-0x0;var _0x52163b=_0xb10b[_0x55d829];return _0x52163b;};'use strict';var BPromise=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var Agent=require(_0xbb10('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xbb10('0x4'));var ChatQueue=require(_0xbb10('0x5'));var SmsQueue=require(_0xbb10('0x6'));var MailQueue=require(_0xbb10('0x7'));var FaxQueue=require(_0xbb10('0x8'));var WhatsappQueue=require(_0xbb10('0x9'));var Realtime=function(){this['agents']={};this[_0xbb10('0xa')]={};this[_0xbb10('0xb')]={};this['chatQueues']={};this[_0xbb10('0xc')]={};this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]={};this[_0xbb10('0xf')]={};this[_0xbb10('0x10')]={};this[_0xbb10('0x11')]={};this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x20bd61,_0x118a74,_0xce64f3){var _0x5e136d=_[_0xbb10('0x14')](_0x20bd61,function(_0x5be7e0,_0x44fb19){return _0x5be7e0[_0xce64f3];});for(var _0x916a32 in _0x118a74){if(_0x118a74[_0xbb10('0x15')](_0x916a32)){if(!_0x5e136d[_0x916a32]){delete _0x118a74[_0x916a32];}}}}Realtime[_0xbb10('0x16')][_0xbb10('0x17')]=function(_0x147230,_0x58a612){for(var _0x26e021 in _0x58a612){if(_0x147230[_0xbb10('0x15')](_0x26e021)){_0x147230[_0x26e021]=_0x58a612[_0x26e021];}}};Realtime[_0xbb10('0x16')][_0xbb10('0x18')]=function(){var _0x3df17b=this;return function(_0x2f2ebf){if(_0x2f2ebf){freeIsNotKey(_0x2f2ebf,_0x3df17b[_0xbb10('0x19')],'id');for(var _0x36b5e8=0x0,_0x3e26f4={},_0x2b184e={};_0x36b5e8<_0x2f2ebf['length'];_0x36b5e8+=0x1){_0x3e26f4=_0x2f2ebf[_0x36b5e8];if(_[_0xbb10('0x1a')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']])){_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']]=new Agent(_0x3e26f4);}else{_0x3df17b[_0xbb10('0x17')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']],_0x3e26f4);}}}return _0x3df17b[_0xbb10('0x19')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x1b')]=function(){var _0xbf2906=this;return function(_0xe1c665){if(_0xe1c665){freeIsNotKey(_0xe1c665,_0xbf2906['intervals'],'id');for(var _0x5ff0cf=0x0,_0x19f48d={},_0x388fab={};_0x5ff0cf<_0xe1c665[_0xbb10('0x1c')];_0x5ff0cf+=0x1){_0x19f48d=_0xe1c665[_0x5ff0cf];if(_[_0xbb10('0x1a')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']])){_0xbf2906['intervals'][_0x19f48d['id']]=new Interval(_0x19f48d);}else{_0xbf2906[_0xbb10('0x17')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']],_0x19f48d);}}}return _0xbf2906['intervals'];};};Realtime['prototype'][_0xbb10('0x1d')]=function(){var _0x311abe=this;return function(_0x2e911d){if(_0x2e911d){freeIsNotKey(_0x2e911d,_0x311abe[_0xbb10('0xb')],'id');for(var _0x445761=0x0,_0x1824b7={},_0x407cb4={};_0x445761<_0x2e911d[_0xbb10('0x1c')];_0x445761+=0x1){_0x1824b7=_0x2e911d[_0x445761];if(_[_0xbb10('0x1a')](_0x311abe[_0xbb10('0xb')][_0x1824b7['id']])){_0x311abe[_0xbb10('0xb')][_0x1824b7['id']]=new OpenchannelQueue(_0x1824b7);}else{_0x311abe[_0xbb10('0x17')](_0x311abe['openchannelQueues'][_0x1824b7['id']],_0x1824b7);}_0x311abe['openchannelQueues'][_0x1824b7['id']]['updateRouting']();_0x311abe[_0xbb10('0xb')][_0x1824b7['id']][_0xbb10('0x1e')]();}}return _0x311abe[_0xbb10('0xb')];};};Realtime['prototype'][_0xbb10('0x1f')]=function(){var _0x24d586=this;return function(_0x6ed43b){if(_0x6ed43b){freeIsNotKey(_0x6ed43b,_0x24d586[_0xbb10('0x20')],'id');for(var _0x1acce9=0x0,_0x20d946={},_0x2a0e8b={};_0x1acce9<_0x6ed43b['length'];_0x1acce9+=0x1){_0x20d946=_0x6ed43b[_0x1acce9];if(_[_0xbb10('0x1a')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']])){_0x24d586[_0xbb10('0x20')][_0x20d946['id']]=new ChatQueue(_0x20d946);}else{_0x24d586[_0xbb10('0x17')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']],_0x20d946);}_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRouting']();_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRealtime']();}}return _0x24d586[_0xbb10('0x20')];};};Realtime['prototype'][_0xbb10('0x21')]=function(){var _0x1dcc9c=this;return function(_0x1b59f9){if(_0x1b59f9){freeIsNotKey(_0x1b59f9,_0x1dcc9c['smsQueues'],'id');for(var _0x518d47=0x0,_0x4c3744={},_0x34f65e={};_0x518d47<_0x1b59f9['length'];_0x518d47+=0x1){_0x4c3744=_0x1b59f9[_0x518d47];if(_[_0xbb10('0x1a')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']])){_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']]=new SmsQueue(_0x4c3744);}else{_0x1dcc9c[_0xbb10('0x17')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']],_0x4c3744);}_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']][_0xbb10('0x22')]();_0x1dcc9c['smsQueues'][_0x4c3744['id']][_0xbb10('0x1e')]();}}return _0x1dcc9c[_0xbb10('0xc')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x23')]=function(){var _0xfb2c5e=this;return function(_0x9de708){if(_0x9de708){freeIsNotKey(_0x9de708,_0xfb2c5e[_0xbb10('0xd')],'id');for(var _0x10202c=0x0,_0x3c8d7d={},_0x56943c={};_0x10202c<_0x9de708[_0xbb10('0x1c')];_0x10202c+=0x1){_0x3c8d7d=_0x9de708[_0x10202c];if(_[_0xbb10('0x1a')](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']])){_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']]=new MailQueue(_0x3c8d7d);}else{_0xfb2c5e['mergeFromDatabase'](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']],_0x3c8d7d);}_0xfb2c5e['mailQueues'][_0x3c8d7d['id']]['updateRouting']();_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']][_0xbb10('0x1e')]();}}return _0xfb2c5e[_0xbb10('0xd')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x24')]=function(){var _0x29d11a=this;return function(_0x547062){if(_0x547062){freeIsNotKey(_0x547062,_0x29d11a[_0xbb10('0xe')],'id');for(var _0x25d72f=0x0,_0x52de31={},_0x5e3fbd={};_0x25d72f<_0x547062['length'];_0x25d72f+=0x1){_0x52de31=_0x547062[_0x25d72f];if(_[_0xbb10('0x1a')](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']])){_0x29d11a[_0xbb10('0xe')][_0x52de31['id']]=new FaxQueue(_0x52de31);}else{_0x29d11a['mergeFromDatabase'](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']],_0x52de31);}_0x29d11a[_0xbb10('0xe')][_0x52de31['id']][_0xbb10('0x22')]();_0x29d11a['faxQueues'][_0x52de31['id']][_0xbb10('0x1e')]();}}return _0x29d11a[_0xbb10('0xe')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x25')]=function(){var _0x4f1cdd=this;return function(_0xd238e9){if(_0xd238e9){freeIsNotKey(_0xd238e9,_0x4f1cdd[_0xbb10('0xf')],'id');for(var _0x5835fd=0x0,_0xe2040f={},_0x2e3214={};_0x5835fd<_0xd238e9[_0xbb10('0x1c')];_0x5835fd+=0x1){_0xe2040f=_0xd238e9[_0x5835fd];if(_[_0xbb10('0x1a')](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']])){_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]=new WhatsappQueue(_0xe2040f);}else{_0x4f1cdd['mergeFromDatabase'](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']],_0xe2040f);}_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']][_0xbb10('0x22')]();_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]['updateRealtime']();}}return _0x4f1cdd[_0xbb10('0xf')];};};module[_0xbb10('0x26')]=Realtime; \ No newline at end of file diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index 57066d0..db025a3 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 _0xc719=['update','Request','UpdateChatInteraction','addTags','AddTagsToChatInteraction','addTagsToChatInteraction','../client'];(function(_0x45974d,_0x16fd32){var _0x7a059e=function(_0x47af46){while(--_0x47af46){_0x45974d['push'](_0x45974d['shift']());}};_0x7a059e(++_0x16fd32);}(_0xc719,0x7d));var _0x9c71=function(_0x13fd59,_0x2e05b1){_0x13fd59=_0x13fd59-0x0;var _0x2e6ce7=_0xc719[_0x13fd59];return _0x2e6ce7;};'use strict';var client=require(_0x9c71('0x0'));exports[_0x9c71('0x1')]=function(_0x55e56d,_0x527586){return client[_0x9c71('0x2')](_0x9c71('0x3'),{'body':_0x527586,'options':{'where':{'id':_0x55e56d}},'log':'updateChatInteraction'});};exports[_0x9c71('0x4')]=function(_0x4f05f5,_0x1f807b){return client[_0x9c71('0x2')](_0x9c71('0x5'),{'body':_0x1f807b,'options':{'where':{'id':_0x4f05f5}},'log':_0x9c71('0x6')});}; \ No newline at end of file +var _0xd1e8=['update','Request','updateChatInteraction','AddTagsToChatInteraction','addTagsToChatInteraction','../client'];(function(_0x560408,_0x45c914){var _0x3fd4da=function(_0x47e9a9){while(--_0x47e9a9){_0x560408['push'](_0x560408['shift']());}};_0x3fd4da(++_0x45c914);}(_0xd1e8,0x15b));var _0x8d1e=function(_0x2cad4d,_0x286c70){_0x2cad4d=_0x2cad4d-0x0;var _0x1f0915=_0xd1e8[_0x2cad4d];return _0x1f0915;};'use strict';var client=require(_0x8d1e('0x0'));exports[_0x8d1e('0x1')]=function(_0x14fb21,_0x19563f){return client[_0x8d1e('0x2')]('UpdateChatInteraction',{'body':_0x19563f,'options':{'where':{'id':_0x14fb21}},'log':_0x8d1e('0x3')});};exports['addTags']=function(_0x5d2fbe,_0x17d11c){return client[_0x8d1e('0x2')](_0x8d1e('0x4'),{'body':_0x17d11c,'options':{'where':{'id':_0x5d2fbe}},'log':_0x8d1e('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index d2c8373..ea372c7 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 _0x700d=['create','Request','CreateChatMessage','../client'];(function(_0x43ddab,_0x190264){var _0x15f7a6=function(_0x1397b1){while(--_0x1397b1){_0x43ddab['push'](_0x43ddab['shift']());}};_0x15f7a6(++_0x190264);}(_0x700d,0x77));var _0xd700=function(_0x39b6f3,_0x282165){_0x39b6f3=_0x39b6f3-0x0;var _0x10f446=_0x700d[_0x39b6f3];return _0x10f446;};'use strict';var client=require(_0xd700('0x0'));exports[_0xd700('0x1')]=function(_0x5097bd){return client[_0xd700('0x2')](_0xd700('0x3'),{'body':_0x5097bd,'log':'createChatMessage'});}; \ No newline at end of file +var _0x1762=['create','CreateChatMessage','../client'];(function(_0x14510c,_0x86ac6b){var _0xb4d007=function(_0x2959b8){while(--_0x2959b8){_0x14510c['push'](_0x14510c['shift']());}};_0xb4d007(++_0x86ac6b);}(_0x1762,0x98));var _0x2176=function(_0x3dfb4a,_0x4c216a){_0x3dfb4a=_0x3dfb4a-0x0;var _0x144c5f=_0x1762[_0x3dfb4a];return _0x144c5f;};'use strict';var client=require(_0x2176('0x0'));exports[_0x2176('0x1')]=function(_0x1f258d){return client['Request'](_0x2176('0x2'),{'body':_0x1f258d,'log':'createChatMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 222305c..7e6d304 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 _0x36bb=['../client','getChatQueues','Request','name','timeout','strategy','User','Agents','online','chatPause'];(function(_0x49f869,_0x22a659){var _0x286918=function(_0x14d3a9){while(--_0x14d3a9){_0x49f869['push'](_0x49f869['shift']());}};_0x286918(++_0x22a659);}(_0x36bb,0xe6));var _0xb36b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x36bb[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xb36b('0x0'));exports[_0xb36b('0x1')]=function(){return function(){return client[_0xb36b('0x2')]('GetChatQueue',{'options':{'raw':![],'attributes':['id',_0xb36b('0x3'),_0xb36b('0x4'),_0xb36b('0x5')],'include':[{'model':_0xb36b('0x6'),'as':_0xb36b('0x7'),'attributes':['id',_0xb36b('0x3'),_0xb36b('0x8'),_0xb36b('0x9')]}]},'log':_0xb36b('0x1')});};}; \ No newline at end of file +var _0xa992=['../client','getChatQueues','Request','GetChatQueue','timeout','strategy','User','Agents','name','online','chatPause'];(function(_0x49d9db,_0x41347b){var _0x5f049d=function(_0x2fb1ac){while(--_0x2fb1ac){_0x49d9db['push'](_0x49d9db['shift']());}};_0x5f049d(++_0x41347b);}(_0xa992,0x18c));var _0x2a99=function(_0xd09c56,_0x4aa28c){_0xd09c56=_0xd09c56-0x0;var _0x2009e7=_0xa992[_0xd09c56];return _0x2009e7;};'use strict';var client=require(_0x2a99('0x0'));exports[_0x2a99('0x1')]=function(){return function(){return client[_0x2a99('0x2')](_0x2a99('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x2a99('0x4'),_0x2a99('0x5')],'include':[{'model':_0x2a99('0x6'),'as':_0x2a99('0x7'),'attributes':['id',_0x2a99('0x8'),_0x2a99('0x9'),_0x2a99('0xa')]}]},'log':_0x2a99('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index e2c6043..9a78e8c 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 _0xb2b3=['DESC','../client','create','Request','CreateChatQueueReport','update','UpdateChatQueueReport'];(function(_0x23cc7d,_0x553e85){var _0x41abb3=function(_0x3cbbde){while(--_0x3cbbde){_0x23cc7d['push'](_0x23cc7d['shift']());}};_0x41abb3(++_0x553e85);}(_0xb2b3,0x71));var _0x3b2b=function(_0x15e7e1,_0x12cda8){_0x15e7e1=_0x15e7e1-0x0;var _0x5daaaf=_0xb2b3[_0x15e7e1];return _0x5daaaf;};'use strict';var client=require(_0x3b2b('0x0'));exports[_0x3b2b('0x1')]=function(_0xcf49e8){return client[_0x3b2b('0x2')](_0x3b2b('0x3'),{'body':_0xcf49e8,'log':_0x3b2b('0x3')});};exports[_0x3b2b('0x4')]=function(_0x4dad94,_0x3eff63){return client[_0x3b2b('0x2')](_0x3b2b('0x5'),{'body':_0x3eff63,'options':{'where':{'uniqueid':_0x4dad94},'order':[['id',_0x3b2b('0x6')]],'limit':0x1},'log':_0x3b2b('0x5')});}; \ No newline at end of file +var _0xd404=['CreateChatQueueReport','update','UpdateChatQueueReport','DESC','../client','create','Request'];(function(_0x2a68fc,_0xba0da6){var _0x22c819=function(_0x4f00c0){while(--_0x4f00c0){_0x2a68fc['push'](_0x2a68fc['shift']());}};_0x22c819(++_0xba0da6);}(_0xd404,0x15b));var _0x4d40=function(_0x27a8e1,_0x51ce9c){_0x27a8e1=_0x27a8e1-0x0;var _0x1c4267=_0xd404[_0x27a8e1];return _0x1c4267;};'use strict';var client=require(_0x4d40('0x0'));exports[_0x4d40('0x1')]=function(_0x5b9c2b){return client[_0x4d40('0x2')](_0x4d40('0x3'),{'body':_0x5b9c2b,'log':'CreateChatQueueReport'});};exports[_0x4d40('0x4')]=function(_0x610dbf,_0xba821){return client[_0x4d40('0x2')](_0x4d40('0x5'),{'body':_0xba821,'options':{'where':{'uniqueid':_0x610dbf},'order':[['id',_0x4d40('0x6')]],'limit':0x1},'log':_0x4d40('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index f8114de..07eb90d 100644 --- a/server/services/routing/rpc/faxInteraction.js +++ b/server/services/routing/rpc/faxInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0x3a2a08,_0x12e654){var _0xa42823=function(_0x87b619){while(--_0x87b619){_0x3a2a08['push'](_0x3a2a08['shift']());}};_0xa42823(++_0x12e654);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_0x10a05d){return client['Request'](_0x7995('0x2'),{'body':_0x10a05d,'options':{'where':{'id':_0x2722a3}},'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x462a03,_0x576d89){return client[_0x7995('0x5')](_0x7995('0x6'),{'body':_0x576d89,'options':{'where':{'id':_0x462a03}},'log':_0x7995('0x7')});}; \ No newline at end of file +var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0xdd827a,_0x482ad2){var _0x2f46f1=function(_0x221046){while(--_0x221046){_0xdd827a['push'](_0xdd827a['shift']());}};_0x2f46f1(++_0x482ad2);}(_0x7a54,0x106));var _0x47a5=function(_0x5e77d4,_0x4bd018){_0x5e77d4=_0x5e77d4-0x0;var _0x2d4e17=_0x7a54[_0x5e77d4];return _0x2d4e17;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(_0x44b31e,_0x58157c){return client[_0x47a5('0x2')](_0x47a5('0x3'),{'body':_0x58157c,'options':{'where':{'id':_0x44b31e}},'log':'updateFaxInteraction'});};exports[_0x47a5('0x4')]=function(_0x11bf85,_0x2a1a7e){return client[_0x47a5('0x2')](_0x47a5('0x5'),{'body':_0x2a1a7e,'options':{'where':{'id':_0x11bf85}},'log':'addTagsToFaxInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index c2d0d30..2c27687 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 _0xf5e6=['createFaxMessage','create','Request','CreateFaxMessage'];(function(_0x2bf5ed,_0x436001){var _0x537be3=function(_0x304c9f){while(--_0x304c9f){_0x2bf5ed['push'](_0x2bf5ed['shift']());}};_0x537be3(++_0x436001);}(_0xf5e6,0xf9));var _0x6f5e=function(_0x5ae4b6,_0x31540b){_0x5ae4b6=_0x5ae4b6-0x0;var _0x26ad27=_0xf5e6[_0x5ae4b6];return _0x26ad27;};'use strict';var client=require('../client');exports[_0x6f5e('0x0')]=function(_0x477321){return client[_0x6f5e('0x1')](_0x6f5e('0x2'),{'body':_0x477321,'log':_0x6f5e('0x3')});}; \ No newline at end of file +var _0x80d9=['../client','create','Request','createFaxMessage'];(function(_0x24764a,_0x4b7466){var _0x39ebd8=function(_0x4f3fcb){while(--_0x4f3fcb){_0x24764a['push'](_0x24764a['shift']());}};_0x39ebd8(++_0x4b7466);}(_0x80d9,0x140));var _0x980d=function(_0x3722c8,_0x52df1f){_0x3722c8=_0x3722c8-0x0;var _0x4f8c9b=_0x80d9[_0x3722c8];return _0x4f8c9b;};'use strict';var client=require(_0x980d('0x0'));exports[_0x980d('0x1')]=function(_0x5f2dc2){return client[_0x980d('0x2')]('CreateFaxMessage',{'body':_0x5f2dc2,'log':_0x980d('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index efb12e1..b8c8050 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 _0xc1b3=['name','timeout','strategy','User','Agents','online','getFaxQueues'];(function(_0x50dc5e,_0x2d26de){var _0x7e27f3=function(_0x11beea){while(--_0x11beea){_0x50dc5e['push'](_0x50dc5e['shift']());}};_0x7e27f3(++_0x2d26de);}(_0xc1b3,0xbc));var _0x3c1b=function(_0xdf5dfa,_0x4156db){_0xdf5dfa=_0xdf5dfa-0x0;var _0x5a3ff0=_0xc1b3[_0xdf5dfa];return _0x5a3ff0;};'use strict';var client=require('../client');exports[_0x3c1b('0x0')]=function(){return function(){return client['Request']('GetFaxQueue',{'options':{'raw':![],'attributes':['id',_0x3c1b('0x1'),_0x3c1b('0x2'),_0x3c1b('0x3')],'include':[{'model':_0x3c1b('0x4'),'as':_0x3c1b('0x5'),'attributes':['id',_0x3c1b('0x1'),_0x3c1b('0x6'),'faxPause']}]},'log':'getFaxQueues'});};}; \ No newline at end of file +var _0x24b5=['timeout','strategy','User','Agents','online','faxPause','../client','getFaxQueues','name'];(function(_0xebb3a4,_0x17fc20){var _0x11babf=function(_0x16f78a){while(--_0x16f78a){_0xebb3a4['push'](_0xebb3a4['shift']());}};_0x11babf(++_0x17fc20);}(_0x24b5,0x141));var _0x524b=function(_0x4b2151,_0x36131b){_0x4b2151=_0x4b2151-0x0;var _0x3c113c=_0x24b5[_0x4b2151];return _0x3c113c;};'use strict';var client=require(_0x524b('0x0'));exports[_0x524b('0x1')]=function(){return function(){return client['Request']('GetFaxQueue',{'options':{'raw':![],'attributes':['id',_0x524b('0x2'),_0x524b('0x3'),_0x524b('0x4')],'include':[{'model':_0x524b('0x5'),'as':_0x524b('0x6'),'attributes':['id',_0x524b('0x2'),_0x524b('0x7'),_0x524b('0x8')]}]},'log':_0x524b('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index 88ad5c2..fe28e6b 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 _0x9816=['Request','DESC','UpdateFaxQueueReport','../client','create','update'];(function(_0x590b5d,_0x303148){var _0x288eec=function(_0x5a72d4){while(--_0x5a72d4){_0x590b5d['push'](_0x590b5d['shift']());}};_0x288eec(++_0x303148);}(_0x9816,0x8d));var _0x6981=function(_0x338f4d,_0x3e98e8){_0x338f4d=_0x338f4d-0x0;var _0x427e04=_0x9816[_0x338f4d];return _0x427e04;};'use strict';var client=require(_0x6981('0x0'));exports[_0x6981('0x1')]=function(_0x5979e5){return client['Request']('CreateFaxQueueReport',{'body':_0x5979e5,'log':'CreateFaxQueueReport'});};exports[_0x6981('0x2')]=function(_0x5a8d0e,_0x2cb835){return client[_0x6981('0x3')]('UpdateFaxQueueReport',{'body':_0x2cb835,'options':{'where':{'uniqueid':_0x5a8d0e},'order':[['id',_0x6981('0x4')]],'limit':0x1},'log':_0x6981('0x5')});}; \ No newline at end of file +var _0x1047=['../client','create','Request','CreateFaxQueueReport','update','UpdateFaxQueueReport'];(function(_0x5b5e4e,_0x3d257e){var _0x798ce1=function(_0x52dc3c){while(--_0x52dc3c){_0x5b5e4e['push'](_0x5b5e4e['shift']());}};_0x798ce1(++_0x3d257e);}(_0x1047,0x1c2));var _0x7104=function(_0x45abd9,_0x3d9abc){_0x45abd9=_0x45abd9-0x0;var _0x5e89ee=_0x1047[_0x45abd9];return _0x5e89ee;};'use strict';var client=require(_0x7104('0x0'));exports[_0x7104('0x1')]=function(_0x544dd1){return client[_0x7104('0x2')](_0x7104('0x3'),{'body':_0x544dd1,'log':'CreateFaxQueueReport'});};exports[_0x7104('0x4')]=function(_0x3a2856,_0x5bd6d3){return client[_0x7104('0x2')]('UpdateFaxQueueReport',{'body':_0x5bd6d3,'options':{'where':{'uniqueid':_0x3a2856},'order':[['id','DESC']],'limit':0x1},'log':_0x7104('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index 47584f1..138a1be 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 _0x2e52=['interval','../client','getIntervals','name','Interval','Intervals'];(function(_0x22b103,_0x53ea6e){var _0x314127=function(_0x550596){while(--_0x550596){_0x22b103['push'](_0x22b103['shift']());}};_0x314127(++_0x53ea6e);}(_0x2e52,0x193));var _0x22e5=function(_0x4b7895,_0x3c4f5d){_0x4b7895=_0x4b7895-0x0;var _0x264180=_0x2e52[_0x4b7895];return _0x264180;};'use strict';var client=require(_0x22e5('0x0'));exports[_0x22e5('0x1')]=function(){return function(){return client['Request']('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x22e5('0x2')],'include':[{'model':_0x22e5('0x3'),'as':_0x22e5('0x4'),'attributes':['id',_0x22e5('0x2'),_0x22e5('0x5')]}]},'log':_0x22e5('0x1')});};}; \ No newline at end of file +var _0x3127=['Request','GetInterval','name','Interval','Intervals','../client'];(function(_0x28ac58,_0x4614cb){var _0x1da86a=function(_0x24d6ae){while(--_0x24d6ae){_0x28ac58['push'](_0x28ac58['shift']());}};_0x1da86a(++_0x4614cb);}(_0x3127,0x1e5));var _0x7312=function(_0x5293a1,_0x351c64){_0x5293a1=_0x5293a1-0x0;var _0x5085aa=_0x3127[_0x5293a1];return _0x5085aa;};'use strict';var client=require(_0x7312('0x0'));exports['getIntervals']=function(){return function(){return client[_0x7312('0x1')](_0x7312('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x7312('0x3')],'include':[{'model':_0x7312('0x4'),'as':_0x7312('0x5'),'attributes':['id',_0x7312('0x3'),'interval']}]},'log':'getIntervals'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index 6d54640..87335c1 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 _0xd824=['Request','UpdateMailInteraction','updateMailInteraction','addTags','addTagsToChatInteraction','../client','update'];(function(_0x1a595a,_0x263824){var _0x33f008=function(_0x1e2f9c){while(--_0x1e2f9c){_0x1a595a['push'](_0x1a595a['shift']());}};_0x33f008(++_0x263824);}(_0xd824,0xc2));var _0x4d82=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xd824[_0x19950b];return _0x3c6b41;};'use strict';var client=require(_0x4d82('0x0'));exports[_0x4d82('0x1')]=function(_0x572eea,_0x53fe9a){return client[_0x4d82('0x2')](_0x4d82('0x3'),{'body':_0x53fe9a,'options':{'where':{'id':_0x572eea}},'log':_0x4d82('0x4')});};exports[_0x4d82('0x5')]=function(_0x287fbf,_0x1c8ad9){return client['Request']('AddTagsToMailInteraction',{'body':_0x1c8ad9,'options':{'where':{'id':_0x287fbf}},'log':_0x4d82('0x6')});}; \ No newline at end of file +var _0x32b6=['addTags','AddTagsToMailInteraction','addTagsToChatInteraction','../client','update','Request'];(function(_0x466c42,_0x17d7c1){var _0x2a833f=function(_0x17408a){while(--_0x17408a){_0x466c42['push'](_0x466c42['shift']());}};_0x2a833f(++_0x17d7c1);}(_0x32b6,0x1d1));var _0x632b=function(_0x42e25d,_0x215216){_0x42e25d=_0x42e25d-0x0;var _0x530107=_0x32b6[_0x42e25d];return _0x530107;};'use strict';var client=require(_0x632b('0x0'));exports[_0x632b('0x1')]=function(_0x4d7646,_0x1f0635){return client[_0x632b('0x2')]('UpdateMailInteraction',{'body':_0x1f0635,'options':{'where':{'id':_0x4d7646}},'log':'updateMailInteraction'});};exports[_0x632b('0x3')]=function(_0x3435e8,_0x3ba3a7){return client[_0x632b('0x2')](_0x632b('0x4'),{'body':_0x3ba3a7,'options':{'where':{'id':_0x3435e8}},'log':_0x632b('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index e323f89..986e992 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 _0xddd7=['create','Request','CreateMailMessage','createMailMessage'];(function(_0xb2def0,_0x2004ca){var _0x40bfaa=function(_0x21ecc6){while(--_0x21ecc6){_0xb2def0['push'](_0xb2def0['shift']());}};_0x40bfaa(++_0x2004ca);}(_0xddd7,0x1d8));var _0x7ddd=function(_0x5e08ef,_0x52d10c){_0x5e08ef=_0x5e08ef-0x0;var _0x46c025=_0xddd7[_0x5e08ef];return _0x46c025;};'use strict';var client=require('../client');exports[_0x7ddd('0x0')]=function(_0x2d8ee3){return client[_0x7ddd('0x1')](_0x7ddd('0x2'),{'body':_0x2d8ee3,'log':_0x7ddd('0x3')});}; \ No newline at end of file +var _0x0726=['createMailMessage','create','CreateMailMessage'];(function(_0x2ffa40,_0x1a23b0){var _0x2b8203=function(_0x49f740){while(--_0x49f740){_0x2ffa40['push'](_0x2ffa40['shift']());}};_0x2b8203(++_0x1a23b0);}(_0x0726,0x19f));var _0x6072=function(_0x8f66f,_0xe4d19f){_0x8f66f=_0x8f66f-0x0;var _0x93ce78=_0x0726[_0x8f66f];return _0x93ce78;};'use strict';var client=require('../client');exports[_0x6072('0x0')]=function(_0x5ac069){return client['Request'](_0x6072('0x1'),{'body':_0x5ac069,'log':_0x6072('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index 0423244..8694b25 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 _0x5b47=['strategy','User','online','mailPause','../client','getMailQueues','name','timeout'];(function(_0x4bd441,_0x14ce37){var _0x56423=function(_0x5b6220){while(--_0x5b6220){_0x4bd441['push'](_0x4bd441['shift']());}};_0x56423(++_0x14ce37);}(_0x5b47,0x11c));var _0x75b4=function(_0x9520c7,_0x2b87ad){_0x9520c7=_0x9520c7-0x0;var _0x147cb5=_0x5b47[_0x9520c7];return _0x147cb5;};'use strict';var client=require(_0x75b4('0x0'));exports[_0x75b4('0x1')]=function(){return function(){return client['Request']('GetMailQueue',{'options':{'raw':![],'attributes':['id',_0x75b4('0x2'),_0x75b4('0x3'),_0x75b4('0x4')],'include':[{'model':_0x75b4('0x5'),'as':'Agents','attributes':['id',_0x75b4('0x2'),_0x75b4('0x6'),_0x75b4('0x7')]}]},'log':_0x75b4('0x1')});};}; \ No newline at end of file +var _0x88ed=['online','mailPause','getMailQueues','../client','Request','name','timeout','Agents'];(function(_0x575217,_0x39ed2b){var _0x54517a=function(_0x459823){while(--_0x459823){_0x575217['push'](_0x575217['shift']());}};_0x54517a(++_0x39ed2b);}(_0x88ed,0xc3));var _0xd88e=function(_0x7f6653,_0xe6a1b5){_0x7f6653=_0x7f6653-0x0;var _0x94d3da=_0x88ed[_0x7f6653];return _0x94d3da;};'use strict';var client=require(_0xd88e('0x0'));exports['getMailQueues']=function(){return function(){return client[_0xd88e('0x1')]('GetMailQueue',{'options':{'raw':![],'attributes':['id',_0xd88e('0x2'),_0xd88e('0x3'),'strategy'],'include':[{'model':'User','as':_0xd88e('0x4'),'attributes':['id',_0xd88e('0x2'),_0xd88e('0x5'),_0xd88e('0x6')]}]},'log':_0xd88e('0x7')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index 530527f..f7a6ef2 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 _0xa6e8=['UpdateMailQueueReport','DESC','../client','create','Request','CreateMailQueueReport'];(function(_0x583bd3,_0x5527f9){var _0x10e1d3=function(_0x52fc5f){while(--_0x52fc5f){_0x583bd3['push'](_0x583bd3['shift']());}};_0x10e1d3(++_0x5527f9);}(_0xa6e8,0xe6));var _0x8a6e=function(_0x2c3c46,_0x24dc88){_0x2c3c46=_0x2c3c46-0x0;var _0x5e9e3b=_0xa6e8[_0x2c3c46];return _0x5e9e3b;};'use strict';var client=require(_0x8a6e('0x0'));exports[_0x8a6e('0x1')]=function(_0x5ad299){return client[_0x8a6e('0x2')](_0x8a6e('0x3'),{'body':_0x5ad299,'log':_0x8a6e('0x3')});};exports['update']=function(_0xa44ea8,_0x28ed3e){return client[_0x8a6e('0x2')](_0x8a6e('0x4'),{'body':_0x28ed3e,'options':{'where':{'uniqueid':_0xa44ea8},'order':[['id',_0x8a6e('0x5')]],'limit':0x1},'log':'UpdateMailQueueReport'});}; \ No newline at end of file +var _0x2a0c=['DESC','../client','create','Request','CreateMailQueueReport','UpdateMailQueueReport'];(function(_0x10d52b,_0xc6a4f1){var _0x2bf44a=function(_0x286009){while(--_0x286009){_0x10d52b['push'](_0x10d52b['shift']());}};_0x2bf44a(++_0xc6a4f1);}(_0x2a0c,0xe5));var _0xc2a0=function(_0x4b1d4c,_0x4a5653){_0x4b1d4c=_0x4b1d4c-0x0;var _0x4bca87=_0x2a0c[_0x4b1d4c];return _0x4bca87;};'use strict';var client=require(_0xc2a0('0x0'));exports[_0xc2a0('0x1')]=function(_0x577c4d){return client[_0xc2a0('0x2')](_0xc2a0('0x3'),{'body':_0x577c4d,'log':_0xc2a0('0x3')});};exports['update']=function(_0x1301ec,_0xff8f46){return client[_0xc2a0('0x2')](_0xc2a0('0x4'),{'body':_0xff8f46,'options':{'where':{'uniqueid':_0x1301ec},'order':[['id',_0xc2a0('0x5')]],'limit':0x1},'log':_0xc2a0('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 9f500be..bcf440b 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 _0x9748=['addTags','AddTagsToOpenchannelInteraction','../client','update','Request','updateOpenchannelInteraction'];(function(_0x5a1533,_0x1dc425){var _0x3fba08=function(_0x4791a7){while(--_0x4791a7){_0x5a1533['push'](_0x5a1533['shift']());}};_0x3fba08(++_0x1dc425);}(_0x9748,0x86));var _0x8974=function(_0x43f837,_0x319224){_0x43f837=_0x43f837-0x0;var _0x4d6ded=_0x9748[_0x43f837];return _0x4d6ded;};'use strict';var client=require(_0x8974('0x0'));exports[_0x8974('0x1')]=function(_0x16d1fc,_0x3358d0){return client[_0x8974('0x2')]('UpdateOpenchannelInteraction',{'body':_0x3358d0,'options':{'where':{'id':_0x16d1fc}},'log':_0x8974('0x3')});};exports[_0x8974('0x4')]=function(_0xb0fce2,_0x33961d){return client[_0x8974('0x2')](_0x8974('0x5'),{'body':_0x33961d,'options':{'where':{'id':_0xb0fce2}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0x9d32=['Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client','update'];(function(_0x24cd97,_0xb4d986){var _0x3ef07a=function(_0x6bed66){while(--_0x6bed66){_0x24cd97['push'](_0x24cd97['shift']());}};_0x3ef07a(++_0xb4d986);}(_0x9d32,0x11e));var _0x29d3=function(_0xd02bb,_0x26e2d0){_0xd02bb=_0xd02bb-0x0;var _0x1cdf23=_0x9d32[_0xd02bb];return _0x1cdf23;};'use strict';var client=require(_0x29d3('0x0'));exports[_0x29d3('0x1')]=function(_0xc43d98,_0x24ee23){return client[_0x29d3('0x2')](_0x29d3('0x3'),{'body':_0x24ee23,'options':{'where':{'id':_0xc43d98}},'log':_0x29d3('0x4')});};exports[_0x29d3('0x5')]=function(_0x3e627d,_0x5d3fc7){return client['Request'](_0x29d3('0x6'),{'body':_0x5d3fc7,'options':{'where':{'id':_0x3e627d}},'log':_0x29d3('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index e06d82e..0d0093a 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 _0x1551=['Request','CreateOpenchannelMessage','createOpenchannelMessage','../client','create'];(function(_0x547a14,_0xf36a9f){var _0x42bd69=function(_0x503799){while(--_0x503799){_0x547a14['push'](_0x547a14['shift']());}};_0x42bd69(++_0xf36a9f);}(_0x1551,0x120));var _0x1155=function(_0x4ca6a4,_0x5e9694){_0x4ca6a4=_0x4ca6a4-0x0;var _0x120555=_0x1551[_0x4ca6a4];return _0x120555;};'use strict';var client=require(_0x1155('0x0'));exports[_0x1155('0x1')]=function(_0x2b23b7){return client[_0x1155('0x2')](_0x1155('0x3'),{'body':_0x2b23b7,'log':_0x1155('0x4')});}; \ No newline at end of file +var _0x8cc7=['CreateOpenchannelMessage'];(function(_0x274dd7,_0x2e6051){var _0x148829=function(_0x4cec98){while(--_0x4cec98){_0x274dd7['push'](_0x274dd7['shift']());}};_0x148829(++_0x2e6051);}(_0x8cc7,0x6d));var _0x78cc=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0x8cc7[_0x2bf141];return _0x48277b;};'use strict';var client=require('../client');exports['create']=function(_0x5b39fe){return client['Request'](_0x78cc('0x0'),{'body':_0x5b39fe,'log':'createOpenchannelMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index 9954c75..5e52b96 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 _0x588f=['getOpenchannelQueues','Request','name','strategy','User','Agents','online','openchannelPause','../client'];(function(_0x18efd9,_0x1e4654){var _0x216e04=function(_0x4968b2){while(--_0x4968b2){_0x18efd9['push'](_0x18efd9['shift']());}};_0x216e04(++_0x1e4654);}(_0x588f,0x194));var _0xf588=function(_0x1fead5,_0x279a72){_0x1fead5=_0x1fead5-0x0;var _0x5d3935=_0x588f[_0x1fead5];return _0x5d3935;};'use strict';var client=require(_0xf588('0x0'));exports[_0xf588('0x1')]=function(){return function(){return client[_0xf588('0x2')]('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id',_0xf588('0x3'),'timeout',_0xf588('0x4')],'include':[{'model':_0xf588('0x5'),'as':_0xf588('0x6'),'attributes':['id',_0xf588('0x3'),_0xf588('0x7'),_0xf588('0x8')]}]},'log':_0xf588('0x1')});};}; \ No newline at end of file +var _0x5c13=['getOpenchannelQueues','Request','name','timeout','strategy','User','Agents','online','openchannelPause'];(function(_0x4525cc,_0x15b692){var _0x10775c=function(_0x1034e4){while(--_0x1034e4){_0x4525cc['push'](_0x4525cc['shift']());}};_0x10775c(++_0x15b692);}(_0x5c13,0x1ef));var _0x35c1=function(_0x2a390b,_0xf49f9b){_0x2a390b=_0x2a390b-0x0;var _0x5df10a=_0x5c13[_0x2a390b];return _0x5df10a;};'use strict';var client=require('../client');exports[_0x35c1('0x0')]=function(){return function(){return client[_0x35c1('0x1')]('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id',_0x35c1('0x2'),_0x35c1('0x3'),_0x35c1('0x4')],'include':[{'model':_0x35c1('0x5'),'as':_0x35c1('0x6'),'attributes':['id','name',_0x35c1('0x7'),_0x35c1('0x8')]}]},'log':_0x35c1('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index d7c8339..787156b 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 _0x775e=['../client','create','Request','update','UpdateOpenchannelQueueReport'];(function(_0x1c8354,_0x472655){var _0x593362=function(_0x90193d){while(--_0x90193d){_0x1c8354['push'](_0x1c8354['shift']());}};_0x593362(++_0x472655);}(_0x775e,0x181));var _0xe775=function(_0x37f90d,_0x362772){_0x37f90d=_0x37f90d-0x0;var _0x375b8c=_0x775e[_0x37f90d];return _0x375b8c;};'use strict';var client=require(_0xe775('0x0'));exports[_0xe775('0x1')]=function(_0x34f073){return client[_0xe775('0x2')]('CreateOpenchannelQueueReport',{'body':_0x34f073,'log':'CreateOpenchannelQueueReport'});};exports[_0xe775('0x3')]=function(_0x385b38,_0x35443d){return client[_0xe775('0x2')]('UpdateOpenchannelQueueReport',{'body':_0x35443d,'options':{'where':{'uniqueid':_0x385b38},'order':[['id','DESC']],'limit':0x1},'log':_0xe775('0x4')});}; \ No newline at end of file +var _0x2ceb=['create','Request','CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport','DESC','../client'];(function(_0x72eb91,_0x40296b){var _0x408230=function(_0xdee3db){while(--_0xdee3db){_0x72eb91['push'](_0x72eb91['shift']());}};_0x408230(++_0x40296b);}(_0x2ceb,0x110));var _0xb2ce=function(_0x2a65e5,_0x3ce826){_0x2a65e5=_0x2a65e5-0x0;var _0x2fc50d=_0x2ceb[_0x2a65e5];return _0x2fc50d;};'use strict';var client=require(_0xb2ce('0x0'));exports[_0xb2ce('0x1')]=function(_0x4a7860){return client[_0xb2ce('0x2')](_0xb2ce('0x3'),{'body':_0x4a7860,'log':_0xb2ce('0x3')});};exports[_0xb2ce('0x4')]=function(_0xa187b4,_0x35242f){return client['Request'](_0xb2ce('0x5'),{'body':_0x35242f,'options':{'where':{'uniqueid':_0xa187b4},'order':[['id',_0xb2ce('0x6')]],'limit':0x1},'log':'UpdateOpenchannelQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index 9f94e8c..8172424 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 _0xcb57=['../client','update','UpdateSmsInteraction','addTags','Request','AddTagsToSmsInteraction','addTagsToSmsInteraction'];(function(_0x5c3ea5,_0xa9ed0c){var _0x102b61=function(_0xafb4a3){while(--_0xafb4a3){_0x5c3ea5['push'](_0x5c3ea5['shift']());}};_0x102b61(++_0xa9ed0c);}(_0xcb57,0xa1));var _0x7cb5=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0xcb57[_0x4a53d];return _0x27410e;};'use strict';var client=require(_0x7cb5('0x0'));exports[_0x7cb5('0x1')]=function(_0x5df18a,_0x21a4c6){return client['Request'](_0x7cb5('0x2'),{'body':_0x21a4c6,'options':{'where':{'id':_0x5df18a}},'log':'updateSmsInteraction'});};exports[_0x7cb5('0x3')]=function(_0x1b1ef7,_0x4850d6){return client[_0x7cb5('0x4')](_0x7cb5('0x5'),{'body':_0x4850d6,'options':{'where':{'id':_0x1b1ef7}},'log':_0x7cb5('0x6')});}; \ No newline at end of file +var _0x0dba=['addTags','AddTagsToSmsInteraction','../client','update','Request','UpdateSmsInteraction','updateSmsInteraction'];(function(_0xeeeb66,_0xaa6265){var _0x191ef6=function(_0x225bc5){while(--_0x225bc5){_0xeeeb66['push'](_0xeeeb66['shift']());}};_0x191ef6(++_0xaa6265);}(_0x0dba,0x136));var _0xa0db=function(_0x4766d8,_0x1fbf51){_0x4766d8=_0x4766d8-0x0;var _0x2b0872=_0x0dba[_0x4766d8];return _0x2b0872;};'use strict';var client=require(_0xa0db('0x0'));exports[_0xa0db('0x1')]=function(_0x19a3c7,_0x39cde6){return client[_0xa0db('0x2')](_0xa0db('0x3'),{'body':_0x39cde6,'options':{'where':{'id':_0x19a3c7}},'log':_0xa0db('0x4')});};exports[_0xa0db('0x5')]=function(_0x20d00b,_0x4208b7){return client[_0xa0db('0x2')](_0xa0db('0x6'),{'body':_0x4208b7,'options':{'where':{'id':_0x20d00b}},'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 8ffcfd5..afece52 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 _0x61be=['createSmsMessage','../client','Request','CreateSmsMessage'];(function(_0xdb8e92,_0x60b84d){var _0xbfbb6c=function(_0x5dca35){while(--_0x5dca35){_0xdb8e92['push'](_0xdb8e92['shift']());}};_0xbfbb6c(++_0x60b84d);}(_0x61be,0x12d));var _0xe61b=function(_0x2d48fa,_0x103065){_0x2d48fa=_0x2d48fa-0x0;var _0x4645b7=_0x61be[_0x2d48fa];return _0x4645b7;};'use strict';var client=require(_0xe61b('0x0'));exports['create']=function(_0x2e8274){return client[_0xe61b('0x1')](_0xe61b('0x2'),{'body':_0x2e8274,'log':_0xe61b('0x3')});}; \ No newline at end of file +var _0xf891=['createSmsMessage','../client','create','Request'];(function(_0x9cf9ca,_0x1f8738){var _0x13ba06=function(_0x3abc30){while(--_0x3abc30){_0x9cf9ca['push'](_0x9cf9ca['shift']());}};_0x13ba06(++_0x1f8738);}(_0xf891,0xd9));var _0x1f89=function(_0x2109bf,_0x1ce6d8){_0x2109bf=_0x2109bf-0x0;var _0x54b3dc=_0xf891[_0x2109bf];return _0x54b3dc;};'use strict';var client=require(_0x1f89('0x0'));exports[_0x1f89('0x1')]=function(_0x7db00){return client[_0x1f89('0x2')]('CreateSmsMessage',{'body':_0x7db00,'log':_0x1f89('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index 03c3831..b9a6d9f 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 _0x0713=['getSmsQueues','Request','GetSmsQueue','name','timeout','strategy','Agents','online','smsPause'];(function(_0x3cb86b,_0x3c75f6){var _0x3c10a0=function(_0x71331f){while(--_0x71331f){_0x3cb86b['push'](_0x3cb86b['shift']());}};_0x3c10a0(++_0x3c75f6);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports['getSmsQueues']=function(){return function(){return client[_0x3071('0x0')](_0x3071('0x1'),{'options':{'raw':![],'attributes':['id',_0x3071('0x2'),_0x3071('0x3'),_0x3071('0x4')],'include':[{'model':'User','as':_0x3071('0x5'),'attributes':['id',_0x3071('0x2'),_0x3071('0x6'),_0x3071('0x7')]}]},'log':_0x3071('0x8')});};}; \ No newline at end of file +var _0xd8b0=['timeout','strategy','User','Agents','name','../client','getSmsQueues'];(function(_0x780b4c,_0x483434){var _0x53aa14=function(_0x4f9aca){while(--_0x4f9aca){_0x780b4c['push'](_0x780b4c['shift']());}};_0x53aa14(++_0x483434);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var client=require(_0x0d8b('0x0'));exports[_0x0d8b('0x1')]=function(){return function(){return client['Request']('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x0d8b('0x2'),_0x0d8b('0x3')],'include':[{'model':_0x0d8b('0x4'),'as':_0x0d8b('0x5'),'attributes':['id',_0x0d8b('0x6'),'online','smsPause']}]},'log':_0x0d8b('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index 078085f..ddf0f70 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 _0x55ca=['../client','create','CreateSmsQueueReport','update','Request','UpdateSmsQueueReport','DESC'];(function(_0x1ddb68,_0x16912f){var _0x3c78d0=function(_0x12965f){while(--_0x12965f){_0x1ddb68['push'](_0x1ddb68['shift']());}};_0x3c78d0(++_0x16912f);}(_0x55ca,0x126));var _0xa55c=function(_0x5f309e,_0x66e31){_0x5f309e=_0x5f309e-0x0;var _0x487b5e=_0x55ca[_0x5f309e];return _0x487b5e;};'use strict';var client=require(_0xa55c('0x0'));exports[_0xa55c('0x1')]=function(_0x4e78b4){return client['Request']('CreateSmsQueueReport',{'body':_0x4e78b4,'log':_0xa55c('0x2')});};exports[_0xa55c('0x3')]=function(_0x5dc716,_0x3b478a){return client[_0xa55c('0x4')](_0xa55c('0x5'),{'body':_0x3b478a,'options':{'where':{'uniqueid':_0x5dc716},'order':[['id',_0xa55c('0x6')]],'limit':0x1},'log':_0xa55c('0x5')});}; \ No newline at end of file +var _0x34e8=['create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC','../client'];(function(_0x572a44,_0x48b9b0){var _0x5e3a88=function(_0x52d656){while(--_0x52d656){_0x572a44['push'](_0x572a44['shift']());}};_0x5e3a88(++_0x48b9b0);}(_0x34e8,0x12c));var _0x834e=function(_0x4aa973,_0x571c28){_0x4aa973=_0x4aa973-0x0;var _0x987fb5=_0x34e8[_0x4aa973];return _0x987fb5;};'use strict';var client=require(_0x834e('0x0'));exports[_0x834e('0x1')]=function(_0x8b339){return client[_0x834e('0x2')]('CreateSmsQueueReport',{'body':_0x8b339,'log':_0x834e('0x3')});};exports[_0x834e('0x4')]=function(_0x472111,_0x31bf20){return client[_0x834e('0x2')](_0x834e('0x5'),{'body':_0x31bf20,'options':{'where':{'uniqueid':_0x472111},'order':[['id',_0x834e('0x6')]],'limit':0x1},'log':'UpdateSmsQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 2544aa6..e150737 100644 --- a/server/services/routing/rpc/user.js +++ b/server/services/routing/rpc/user.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['name','pauseType','lastPauseAt','voicePause','chatPause','mailPause','smsPause','whatsappPause','openchannelPause','faxCapacity','openchannelCapacity','../client','getAgents','Request'];(function(_0x2b03cc,_0x495696){var _0x4b7472=function(_0xb8fd58){while(--_0xb8fd58){_0x2b03cc['push'](_0x2b03cc['shift']());}};_0x4b7472(++_0x495696);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xa9e0[_0x2763f2];return _0x3ef471;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetUser',{'options':{'raw':!![],'where':{'role':'agent'},'attributes':['id',_0x0a9e('0x3'),'online',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'faxPause',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'chatCapacity','mailCapacity',_0x0a9e('0xc'),'smsCapacity','whatsappCapacity',_0x0a9e('0xd')]},'log':_0x0a9e('0x1')});};}; \ No newline at end of file +var _0xa9e0=['name','pauseType','lastPauseAt','voicePause','chatPause','mailPause','smsPause','whatsappPause','openchannelPause','faxCapacity','openchannelCapacity','../client','getAgents','Request'];(function(_0x53832d,_0x49cec2){var _0x20efe2=function(_0x7fd41c){while(--_0x7fd41c){_0x53832d['push'](_0x53832d['shift']());}};_0x20efe2(++_0x49cec2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetUser',{'options':{'raw':!![],'where':{'role':'agent'},'attributes':['id',_0x0a9e('0x3'),'online',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'faxPause',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'chatCapacity','mailCapacity',_0x0a9e('0xc'),'smsCapacity','whatsappCapacity',_0x0a9e('0xd')]},'log':_0x0a9e('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappInteraction.js b/server/services/routing/rpc/whatsappInteraction.js index a18616e..412fad2 100644 --- a/server/services/routing/rpc/whatsappInteraction.js +++ b/server/services/routing/rpc/whatsappInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7c1a=['UpdateWhatsappInteraction','addTags','addTagsToWhatsappInteraction','../client','update','Request'];(function(_0x4374c2,_0x1d4f6b){var _0x544ced=function(_0x33dc63){while(--_0x33dc63){_0x4374c2['push'](_0x4374c2['shift']());}};_0x544ced(++_0x1d4f6b);}(_0x7c1a,0x159));var _0xa7c1=function(_0x3a7261,_0x3ee28e){_0x3a7261=_0x3a7261-0x0;var _0x3fdf33=_0x7c1a[_0x3a7261];return _0x3fdf33;};'use strict';var client=require(_0xa7c1('0x0'));exports[_0xa7c1('0x1')]=function(_0x285492,_0x38f547){return client[_0xa7c1('0x2')](_0xa7c1('0x3'),{'body':_0x38f547,'options':{'where':{'id':_0x285492}},'log':'updateWhatsappInteraction'});};exports[_0xa7c1('0x4')]=function(_0x132b08,_0x506858){return client[_0xa7c1('0x2')]('AddTagsToWhatsappInteraction',{'body':_0x506858,'options':{'where':{'id':_0x132b08}},'log':_0xa7c1('0x5')});}; \ No newline at end of file +var _0xe451=['updateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction'];(function(_0x1ad07b,_0x551d55){var _0x2c447f=function(_0x43340b){while(--_0x43340b){_0x1ad07b['push'](_0x1ad07b['shift']());}};_0x2c447f(++_0x551d55);}(_0xe451,0xec));var _0x1e45=function(_0x24ddef,_0x352eb8){_0x24ddef=_0x24ddef-0x0;var _0x344daa=_0xe451[_0x24ddef];return _0x344daa;};'use strict';var client=require('../client');exports['update']=function(_0xfe805c,_0x479192){return client['Request']('UpdateWhatsappInteraction',{'body':_0x479192,'options':{'where':{'id':_0xfe805c}},'log':_0x1e45('0x0')});};exports[_0x1e45('0x1')]=function(_0x1f9061,_0x197c03){return client['Request'](_0x1e45('0x2'),{'body':_0x197c03,'options':{'where':{'id':_0x1f9061}},'log':_0x1e45('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index 130b934..47c02b9 100644 --- a/server/services/routing/rpc/whatsappMessage.js +++ b/server/services/routing/rpc/whatsappMessage.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf6b8=['createWhatsappMessage','create','Request','CreateWhatsappMessage'];(function(_0x1c7222,_0x22674d){var _0x21ed6e=function(_0x11665c){while(--_0x11665c){_0x1c7222['push'](_0x1c7222['shift']());}};_0x21ed6e(++_0x22674d);}(_0xf6b8,0x189));var _0x8f6b=function(_0x37cc4c,_0x288c26){_0x37cc4c=_0x37cc4c-0x0;var _0x425695=_0xf6b8[_0x37cc4c];return _0x425695;};'use strict';var client=require('../client');exports[_0x8f6b('0x0')]=function(_0x36441d){return client[_0x8f6b('0x1')](_0x8f6b('0x2'),{'body':_0x36441d,'log':_0x8f6b('0x3')});}; \ No newline at end of file +var _0x18b2=['create','CreateWhatsappMessage','../client'];(function(_0x34e386,_0x4aa7b5){var _0x1de185=function(_0x3b547b){while(--_0x3b547b){_0x34e386['push'](_0x34e386['shift']());}};_0x1de185(++_0x4aa7b5);}(_0x18b2,0x1ac));var _0x218b=function(_0xa27382,_0x4f0b4f){_0xa27382=_0xa27382-0x0;var _0xcb86a6=_0x18b2[_0xa27382];return _0xcb86a6;};'use strict';var client=require(_0x218b('0x0'));exports[_0x218b('0x1')]=function(_0x5ab2ba){return client['Request'](_0x218b('0x2'),{'body':_0x5ab2ba,'log':'createWhatsappMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index 9f5683a..e469669 100644 --- a/server/services/routing/rpc/whatsappQueue.js +++ b/server/services/routing/rpc/whatsappQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1c8b=['User','Agents','whatsappPause','getWhatsappQueues','Request','GetWhatsappQueue','name'];(function(_0x2c1f7a,_0x1dfec3){var _0x39bd95=function(_0x38d096){while(--_0x38d096){_0x2c1f7a['push'](_0x2c1f7a['shift']());}};_0x39bd95(++_0x1dfec3);}(_0x1c8b,0x15a));var _0xb1c8=function(_0x1034ee,_0x12998c){_0x1034ee=_0x1034ee-0x0;var _0x2922af=_0x1c8b[_0x1034ee];return _0x2922af;};'use strict';var client=require('../client');exports[_0xb1c8('0x0')]=function(){return function(){return client[_0xb1c8('0x1')](_0xb1c8('0x2'),{'options':{'raw':![],'attributes':['id',_0xb1c8('0x3'),'timeout','strategy'],'include':[{'model':_0xb1c8('0x4'),'as':_0xb1c8('0x5'),'attributes':['id',_0xb1c8('0x3'),'online',_0xb1c8('0x6')]}]},'log':_0xb1c8('0x0')});};}; \ No newline at end of file +var _0x26b8=['timeout','strategy','User','Agents','name','online','whatsappPause','../client','getWhatsappQueues','GetWhatsappQueue'];(function(_0x145ec0,_0x3f40aa){var _0xc93ae9=function(_0x393193){while(--_0x393193){_0x145ec0['push'](_0x145ec0['shift']());}};_0xc93ae9(++_0x3f40aa);}(_0x26b8,0x1ab));var _0x826b=function(_0xcc580b,_0x4d47c0){_0xcc580b=_0xcc580b-0x0;var _0x4e164d=_0x26b8[_0xcc580b];return _0x4e164d;};'use strict';var client=require(_0x826b('0x0'));exports[_0x826b('0x1')]=function(){return function(){return client['Request'](_0x826b('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x826b('0x3'),_0x826b('0x4')],'include':[{'model':_0x826b('0x5'),'as':_0x826b('0x6'),'attributes':['id',_0x826b('0x7'),_0x826b('0x8'),_0x826b('0x9')]}]},'log':'getWhatsappQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index 5c26636..9f25f1c 100644 --- a/server/services/routing/rpc/whatsappQueueReport.js +++ b/server/services/routing/rpc/whatsappQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xac93=['../client','create','Request','CreateWhatsappQueueReport','update','DESC','UpdateWhatsappQueueReport'];(function(_0x43b08,_0x15f967){var _0x5e05f4=function(_0x4bb0cb){while(--_0x4bb0cb){_0x43b08['push'](_0x43b08['shift']());}};_0x5e05f4(++_0x15f967);}(_0xac93,0x150));var _0x3ac9=function(_0x5416db,_0x55683a){_0x5416db=_0x5416db-0x0;var _0x243e35=_0xac93[_0x5416db];return _0x243e35;};'use strict';var client=require(_0x3ac9('0x0'));exports[_0x3ac9('0x1')]=function(_0x354f02){return client[_0x3ac9('0x2')](_0x3ac9('0x3'),{'body':_0x354f02,'log':'CreateWhatsappQueueReport'});};exports[_0x3ac9('0x4')]=function(_0x25154f,_0x57d52b){return client['Request']('UpdateWhatsappQueueReport',{'body':_0x57d52b,'options':{'where':{'uniqueid':_0x25154f},'order':[['id',_0x3ac9('0x5')]],'limit':0x1},'log':_0x3ac9('0x6')});}; \ No newline at end of file +var _0xe152=['UpdateWhatsappQueueReport','../client','Request','CreateWhatsappQueueReport','update'];(function(_0x5b64a1,_0x2ec810){var _0x4b6f55=function(_0x44dd84){while(--_0x44dd84){_0x5b64a1['push'](_0x5b64a1['shift']());}};_0x4b6f55(++_0x2ec810);}(_0xe152,0xd8));var _0x2e15=function(_0x2549df,_0x5d53f6){_0x2549df=_0x2549df-0x0;var _0x14165b=_0xe152[_0x2549df];return _0x14165b;};'use strict';var client=require(_0x2e15('0x0'));exports['create']=function(_0x1cecdf){return client[_0x2e15('0x1')](_0x2e15('0x2'),{'body':_0x1cecdf,'log':_0x2e15('0x2')});};exports[_0x2e15('0x3')]=function(_0x31b81a,_0x59ff69){return client[_0x2e15('0x1')](_0x2e15('0x4'),{'body':_0x59ff69,'options':{'where':{'uniqueid':_0x31b81a},'order':[['id','DESC']],'limit':0x1},'log':_0x2e15('0x4')});}; \ 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 496915a..9a8b0ea 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 _0xeca9=['[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','stack','lodash','seq-queue','../../../../config/logger','routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','validate','length','error','[%s][AGENT]\x20%s','message','stop','find','agents','timeout','createQueue','atimeout','channel','START:%s','info','[%s][AGENT]\x20ROUTING\x20STOPPED','close','rules','[%s][AGENT]\x20ROUTING\x20END','next'];(function(_0x14d88b,_0x2c70b8){var _0x5d0e9c=function(_0x540fb1){while(--_0x540fb1){_0x14d88b['push'](_0x14d88b['shift']());}};_0x5d0e9c(++_0x2c70b8);}(_0xeca9,0x6c));var _0x9eca=function(_0x596ed9,_0x22bb78){_0x596ed9=_0x596ed9-0x0;var _0x584f5b=_0xeca9[_0x596ed9];return _0x584f5b;};'use strict';var schema=require('validate');var _=require(_0x9eca('0x0'));var util=require('util');var seqqueue=require(_0x9eca('0x1'));var logger=require(_0x9eca('0x2'))(_0x9eca('0x3'));var strategy=require(_0x9eca('0x4'));var queue=schema({'name':{'type':_0x9eca('0x5'),'required':!![],'message':_0x9eca('0x6')},'timeout':{'type':'number','message':_0x9eca('0x7')}});function writeLog(_0xc18209,_0x20f65c,_0x44b9ed){return logger['info'](util[_0x9eca('0x8')](_0x9eca('0x9'),_0xc18209,_0x20f65c[_0x9eca('0xa')],_0x44b9ed));}function handleFindAgent(_0x43811f){return function(_0x3c65f1){return _0x3c65f1[_0x9eca('0xa')][_0x9eca('0xb')]()===_0x43811f[_0x9eca('0xb')]();};}exports[_0x9eca('0xc')]=function(_0x5737ea,_0x5ea680,_0x56a5cd,_0x5647ed){return function(_0x3a0397){try{var _0x5cbfb0={'name':_0x5ea680[0x0],'timeout':_0x5ea680[0x1]};var _0x339d1d=queue[_0x9eca('0xd')](_0x5cbfb0,{'typecast':!![]});if(_0x339d1d[_0x9eca('0xe')]){logger[_0x9eca('0xf')](_0x9eca('0x10'),_0x5737ea,_['map'](_0x339d1d,_0x9eca('0x11'))['join'](',\x20'));_0x3a0397[_0x9eca('0x12')]();}else{var _0x1bac26=_[_0x9eca('0x13')](_0x56a5cd[_0x9eca('0x14')],handleFindAgent(_0x5cbfb0[_0x9eca('0xa')]));if(_0x1bac26){var _0x1bb003=(_0x5cbfb0[_0x9eca('0x15')]||0xa)*0x3e8;var _0x1a49a4,_0x4db836;var _0x126d7a=seqqueue[_0x9eca('0x16')](_0x1bb003);_0x126d7a['id']=_0x5737ea;_0x126d7a[_0x9eca('0x17')]=_0x1bb003;_0x126d7a[_0x9eca('0x18')]=_0x5647ed[_0x9eca('0x18')];writeLog(_0x5737ea,_0x1bac26,util['format'](_0x9eca('0x19'),_0x1bb003));_0x56a5cd['rules'][_0x5737ea]['on']('end',function(){logger[_0x9eca('0x1a')](_0x9eca('0x1b'),_0x5737ea);clearTimeout(_0x4db836);_0x4db836=undefined;_0x126d7a[_0x9eca('0x1c')]();if(_0x56a5cd[_0x9eca('0x1d')][_0x5737ea]){delete _0x56a5cd[_0x9eca('0x1d')][_0x5737ea];}_0x3a0397[_0x9eca('0x12')]();});_0x56a5cd[_0x9eca('0x1d')][_0x5737ea]['on']('complete',function(){if(_0x56a5cd['rules'][_0x5737ea]){delete _0x56a5cd[_0x9eca('0x1d')][_0x5737ea];}});_0x4db836=setTimeout(function(){logger[_0x9eca('0x1a')](_0x9eca('0x1e'),_0x5737ea);clearTimeout(_0x4db836);_0x126d7a[_0x9eca('0x1c')]();_0x3a0397[_0x9eca('0x1f')]();},_0x1bb003);strategy['agent'](_0x126d7a,_0x1bac26,_0x56a5cd,_0x5647ed);}else{logger[_0x9eca('0xf')](_0x9eca('0x20'),_0x5737ea,_0x5cbfb0['name']);_0x3a0397[_0x9eca('0x12')]();}}}catch(_0x2e8e33){console[_0x9eca('0x21')](_0x2e8e33);logger[_0x9eca('0xf')]('[%s][QUEUE]\x20%s',_0x5737ea,_0x2e8e33[_0x9eca('0x22')]);_0x3a0397['stop']();}};}; \ No newline at end of file +var _0xc00d=['string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','format','name','toLowerCase','consequence','length','error','map','message','agents','createQueue','atimeout','channel','START:%s','rules','[%s][AGENT]\x20ROUTING\x20STOPPED','close','stop','complete','[%s][AGENT]\x20ROUTING\x20END','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','[%s][QUEUE]\x20%s','stack','validate','lodash','util','seq-queue','routing','./strategy'];(function(_0x5b7efb,_0x58efa4){var _0x16a5e4=function(_0x202b14){while(--_0x202b14){_0x5b7efb['push'](_0x5b7efb['shift']());}};_0x16a5e4(++_0x58efa4);}(_0xc00d,0xcc));var _0xdc00=function(_0x1033fc,_0x17c76c){_0x1033fc=_0x1033fc-0x0;var _0x160c4e=_0xc00d[_0x1033fc];return _0x160c4e;};'use strict';var schema=require(_0xdc00('0x0'));var _=require(_0xdc00('0x1'));var util=require(_0xdc00('0x2'));var seqqueue=require(_0xdc00('0x3'));var logger=require('../../../../config/logger')(_0xdc00('0x4'));var strategy=require(_0xdc00('0x5'));var queue=schema({'name':{'type':_0xdc00('0x6'),'required':!![],'message':_0xdc00('0x7')},'timeout':{'type':_0xdc00('0x8'),'message':_0xdc00('0x9')}});function writeLog(_0x14034a,_0x59e1c5,_0x4afe20){return logger[_0xdc00('0xa')](util[_0xdc00('0xb')]('[%s][AGENT][NAME:%s][STATUS:%s]',_0x14034a,_0x59e1c5[_0xdc00('0xc')],_0x4afe20));}function handleFindAgent(_0xe8294b){return function(_0xdf4d8){return _0xdf4d8[_0xdc00('0xc')][_0xdc00('0xd')]()===_0xe8294b[_0xdc00('0xd')]();};}exports[_0xdc00('0xe')]=function(_0x9e1ab,_0x445b08,_0x2b0ed5,_0x7452f2){return function(_0x1289d6){try{var _0x55d2f7={'name':_0x445b08[0x0],'timeout':_0x445b08[0x1]};var _0x5d71f1=queue[_0xdc00('0x0')](_0x55d2f7,{'typecast':!![]});if(_0x5d71f1[_0xdc00('0xf')]){logger[_0xdc00('0x10')]('[%s][AGENT]\x20%s',_0x9e1ab,_[_0xdc00('0x11')](_0x5d71f1,_0xdc00('0x12'))['join'](',\x20'));_0x1289d6['stop']();}else{var _0x4d005f=_['find'](_0x2b0ed5[_0xdc00('0x13')],handleFindAgent(_0x55d2f7[_0xdc00('0xc')]));if(_0x4d005f){var _0x183496=(_0x55d2f7['timeout']||0xa)*0x3e8;var _0x4c2515,_0x58a63f;var _0x3944c1=seqqueue[_0xdc00('0x14')](_0x183496);_0x3944c1['id']=_0x9e1ab;_0x3944c1[_0xdc00('0x15')]=_0x183496;_0x3944c1[_0xdc00('0x16')]=_0x7452f2[_0xdc00('0x16')];writeLog(_0x9e1ab,_0x4d005f,util[_0xdc00('0xb')](_0xdc00('0x17'),_0x183496));_0x2b0ed5[_0xdc00('0x18')][_0x9e1ab]['on']('end',function(){logger[_0xdc00('0xa')](_0xdc00('0x19'),_0x9e1ab);clearTimeout(_0x58a63f);_0x58a63f=undefined;_0x3944c1[_0xdc00('0x1a')]();if(_0x2b0ed5[_0xdc00('0x18')][_0x9e1ab]){delete _0x2b0ed5[_0xdc00('0x18')][_0x9e1ab];}_0x1289d6[_0xdc00('0x1b')]();});_0x2b0ed5['rules'][_0x9e1ab]['on'](_0xdc00('0x1c'),function(){if(_0x2b0ed5[_0xdc00('0x18')][_0x9e1ab]){delete _0x2b0ed5[_0xdc00('0x18')][_0x9e1ab];}});_0x58a63f=setTimeout(function(){logger[_0xdc00('0xa')](_0xdc00('0x1d'),_0x9e1ab);clearTimeout(_0x58a63f);_0x3944c1[_0xdc00('0x1a')]();_0x1289d6[_0xdc00('0x1e')]();},_0x183496);strategy[_0xdc00('0x1f')](_0x3944c1,_0x4d005f,_0x2b0ed5,_0x7452f2);}else{logger['error'](_0xdc00('0x20'),_0x9e1ab,_0x55d2f7['name']);_0x1289d6[_0xdc00('0x1b')]();}}}catch(_0x178959){console['log'](_0x178959);logger[_0xdc00('0x10')](_0xdc00('0x21'),_0x9e1ab,_0x178959[_0xdc00('0x22')]);_0x1289d6[_0xdc00('0x1b')]();}};}; \ 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 3b08af5..eb4e95d 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 _0x8f2d=['consequence','isNil','interaction','info','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','sms','channel','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','InteractionId','isEmpty','Message','create','then','[%s][AMAZONLEX]\x20%s','catch','error','stringify','finally','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','$LATEST','message','body','postText','amazonlex','providerName','Failed','moment','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage'];(function(_0x462b34,_0x2dbe8c){var _0x1a5506=function(_0xe95f){while(--_0xe95f){_0x462b34['push'](_0x462b34['shift']());}};_0x1a5506(++_0x2dbe8c);}(_0x8f2d,0x12b));var _0xd8f2=function(_0x2b08d8,_0x599bea){_0x2b08d8=_0x2b08d8-0x0;var _0x427ac7=_0x8f2d[_0x2b08d8];return _0x427ac7;};'use strict';var _=require('lodash');var moment=require(_0xd8f2('0x0'));var AWS=require('aws-sdk');var utils=require(_0xd8f2('0x1'));var logger=require(_0xd8f2('0x2'))('routing');var rpc={'chatMessage':require(_0xd8f2('0x3')),'openchannelMessage':require(_0xd8f2('0x4')),'mailMessage':require(_0xd8f2('0x5')),'smsMessage':require(_0xd8f2('0x6')),'faxMessage':require(_0xd8f2('0x7')),'whatsappMessage':require(_0xd8f2('0x8'))};exports[_0xd8f2('0x9')]=function(_0x1ceb61,_0x512f9){return function(_0x433a9a){try{if(!_[_0xd8f2('0xa')](this[_0xd8f2('0xb')]['UserId'])){logger[_0xd8f2('0xc')]('[%s][AMAZONLEX]\x20%s',_0x1ceb61,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x433a9a[_0xd8f2('0xd')]();}var _0x5b0863={'ContactId':this[_0xd8f2('0xe')]['id'],'sentAt':moment()[_0xd8f2('0xf')](_0xd8f2('0x10')),'direction':'out'};if(this['channel']===_0xd8f2('0x11')||this[_0xd8f2('0x12')]===_0xd8f2('0x13')){_0x5b0863[_0xd8f2('0x14')]=this['interaction'][_0xd8f2('0x14')];}var _0x3bd4a1=this[_0xd8f2('0x12')];if(_0x3bd4a1===_0xd8f2('0x15')){_0x5b0863[_0xd8f2('0x16')]=this[_0xd8f2('0x17')]['id'];}else{_0x5b0863[_[_0xd8f2('0x18')](_0x3bd4a1)+'AccountId']=this[_0xd8f2('0x17')]['id'];}_0x5b0863[_[_0xd8f2('0x18')](_0x3bd4a1)+_0xd8f2('0x19')]=this[_0xd8f2('0xb')]['id'];if(this[_0xd8f2('0xb')]['created']){var _0x26b97e=_0x512f9[0x4];if(!_[_0xd8f2('0x1a')](_0x26b97e)){_0x5b0863['body']=utils['getMustacheRender'](_0x26b97e,this);return rpc[_0x3bd4a1+_0xd8f2('0x1b')][_0xd8f2('0x1c')](_0x5b0863)[_0xd8f2('0x1d')](function(_0x21a3cd){logger[_0xd8f2('0xc')](_0xd8f2('0x1e'),_0x1ceb61,_0x5b0863['body']);})[_0xd8f2('0x1f')](function(_0x551f1b){logger[_0xd8f2('0x20')]('[%s][AMAZONLEX]\x20%s',_0x1ceb61,JSON[_0xd8f2('0x21')](_0x551f1b));})[_0xd8f2('0x22')](function(){logger[_0xd8f2('0xc')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x1ceb61);_0x433a9a[_0xd8f2('0x23')]();});}else{logger[_0xd8f2('0xc')](_0xd8f2('0x24'),_0x1ceb61);_0x433a9a[_0xd8f2('0x23')]();}}else{var _0x55f557=this;var _0x2f862f=new AWS['LexRuntime']({'accessKeyId':_0x512f9[0x0],'secretAccessKey':_0x512f9[0x1],'region':_0x512f9[0x2]});var _0x41c014={'botAlias':_0xd8f2('0x25'),'botName':_0x512f9[0x3],'inputText':this[_0xd8f2('0x26')][_0xd8f2('0x27')],'userId':this[_0xd8f2('0x12')]+':'+this[_0xd8f2('0xb')]['id']['toString']()};_0x2f862f[_0xd8f2('0x28')](_0x41c014,function(_0x4f7d48,_0x1ccafc){if(_0x4f7d48){logger[_0xd8f2('0x20')](_0xd8f2('0x1e'),_0x1ceb61,_0x4f7d48['message']);_0x433a9a[_0xd8f2('0xd')]();}else if(_0x1ccafc&&_0x1ccafc[_0xd8f2('0x26')]){_0x55f557[_0xd8f2('0x27')][_0xd8f2('0x29')]=_0x1ccafc;_0x5b0863[_0xd8f2('0x27')]=_0x1ccafc[_0xd8f2('0x26')];_0x5b0863[_0xd8f2('0x2a')]=_0xd8f2('0x29');_0x5b0863['providerResponse']=JSON[_0xd8f2('0x21')](_0x1ccafc);return rpc[_0x3bd4a1+_0xd8f2('0x1b')][_0xd8f2('0x1c')](_0x5b0863)[_0xd8f2('0x1d')](function(_0x3210f7){logger[_0xd8f2('0xc')](_0xd8f2('0x1e'),_0x1ceb61,_0x5b0863['body']);if(_0x1ccafc['dialogState']==_0xd8f2('0x2b')){_0x433a9a[_0xd8f2('0xd')]();}else{_0x433a9a['stop']();}})[_0xd8f2('0x1f')](function(_0x1b4770){logger[_0xd8f2('0x20')](_0xd8f2('0x1e'),_0x1ceb61,JSON['stringify'](_0x1b4770));_0x433a9a[_0xd8f2('0xd')]();});}else{_0x433a9a[_0xd8f2('0xd')]();}});}}catch(_0x52ba0f){logger[_0xd8f2('0x20')](_0xd8f2('0x1e'),_0x1ceb61,JSON[_0xd8f2('0x21')](_0x52ba0f));_0x433a9a[_0xd8f2('0x23')]();}};}; \ No newline at end of file +var _0x0e71=['providerResponse','then','dialogState','lodash','moment','aws-sdk','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','isNil','interaction','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','channel','sms','phone','account','upperFirst','InteractionId','created','isEmpty','getMustacheRender','Message','create','body','catch','error','stringify','finally','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','postText','message','providerName','amazonlex'];(function(_0x446834,_0x430ebf){var _0x16d7e0=function(_0x504707){while(--_0x504707){_0x446834['push'](_0x446834['shift']());}};_0x16d7e0(++_0x430ebf);}(_0x0e71,0xbf));var _0x10e7=function(_0x3222ec,_0x438791){_0x3222ec=_0x3222ec-0x0;var _0x19c92b=_0x0e71[_0x3222ec];return _0x19c92b;};'use strict';var _=require(_0x10e7('0x0'));var moment=require(_0x10e7('0x1'));var AWS=require(_0x10e7('0x2'));var utils=require('./utils');var logger=require(_0x10e7('0x3'))(_0x10e7('0x4'));var rpc={'chatMessage':require(_0x10e7('0x5')),'openchannelMessage':require(_0x10e7('0x6')),'mailMessage':require(_0x10e7('0x7')),'smsMessage':require(_0x10e7('0x8')),'faxMessage':require(_0x10e7('0x9')),'whatsappMessage':require(_0x10e7('0xa'))};exports['consequence']=function(_0xddf086,_0x4e4808){return function(_0x21e540){try{if(!_[_0x10e7('0xb')](this[_0x10e7('0xc')]['UserId'])){logger[_0x10e7('0xd')](_0x10e7('0xe'),_0xddf086,_0x10e7('0xf'));return _0x21e540[_0x10e7('0x10')]();}var _0x5b4675={'ContactId':this[_0x10e7('0x11')]['id'],'sentAt':moment()[_0x10e7('0x12')](_0x10e7('0x13')),'direction':'out'};if(this[_0x10e7('0x14')]===_0x10e7('0x15')||this[_0x10e7('0x14')]==='whatsapp'){_0x5b4675[_0x10e7('0x16')]=this[_0x10e7('0xc')][_0x10e7('0x16')];}var _0x55b702=this[_0x10e7('0x14')];if(_0x55b702==='chat'){_0x5b4675['ChatWebsiteId']=this[_0x10e7('0x17')]['id'];}else{_0x5b4675[_[_0x10e7('0x18')](_0x55b702)+'AccountId']=this[_0x10e7('0x17')]['id'];}_0x5b4675[_[_0x10e7('0x18')](_0x55b702)+_0x10e7('0x19')]=this[_0x10e7('0xc')]['id'];if(this[_0x10e7('0xc')][_0x10e7('0x1a')]){var _0x1feee9=_0x4e4808[0x4];if(!_[_0x10e7('0x1b')](_0x1feee9)){_0x5b4675['body']=utils[_0x10e7('0x1c')](_0x1feee9,this);return rpc[_0x55b702+_0x10e7('0x1d')][_0x10e7('0x1e')](_0x5b4675)['then'](function(_0x54626e){logger['info'](_0x10e7('0xe'),_0xddf086,_0x5b4675[_0x10e7('0x1f')]);})[_0x10e7('0x20')](function(_0x1babfc){logger[_0x10e7('0x21')](_0x10e7('0xe'),_0xddf086,JSON[_0x10e7('0x22')](_0x1babfc));})[_0x10e7('0x23')](function(){logger['info']('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0xddf086);_0x21e540[_0x10e7('0x24')]();});}else{logger[_0x10e7('0xd')](_0x10e7('0x25'),_0xddf086);_0x21e540['stop']();}}else{var _0x5aa47e=this;var _0x5cce18=new AWS[(_0x10e7('0x26'))]({'accessKeyId':_0x4e4808[0x0],'secretAccessKey':_0x4e4808[0x1],'region':_0x4e4808[0x2]});var _0x45f8c6={'botAlias':_0x10e7('0x27'),'botName':_0x4e4808[0x3],'inputText':this['message'][_0x10e7('0x1f')],'userId':this[_0x10e7('0x14')]+':'+this[_0x10e7('0xc')]['id']['toString']()};_0x5cce18[_0x10e7('0x28')](_0x45f8c6,function(_0x4270cc,_0x2ea940){if(_0x4270cc){logger['error'](_0x10e7('0xe'),_0xddf086,_0x4270cc[_0x10e7('0x29')]);_0x21e540[_0x10e7('0x10')]();}else if(_0x2ea940&&_0x2ea940[_0x10e7('0x29')]){_0x5aa47e['body']['amazonlex']=_0x2ea940;_0x5b4675[_0x10e7('0x1f')]=_0x2ea940[_0x10e7('0x29')];_0x5b4675[_0x10e7('0x2a')]=_0x10e7('0x2b');_0x5b4675[_0x10e7('0x2c')]=JSON[_0x10e7('0x22')](_0x2ea940);return rpc[_0x55b702+_0x10e7('0x1d')][_0x10e7('0x1e')](_0x5b4675)[_0x10e7('0x2d')](function(_0x1e2a61){logger[_0x10e7('0xd')](_0x10e7('0xe'),_0xddf086,_0x5b4675['body']);if(_0x2ea940[_0x10e7('0x2e')]=='Failed'){_0x21e540[_0x10e7('0x10')]();}else{_0x21e540[_0x10e7('0x24')]();}})[_0x10e7('0x20')](function(_0x198877){logger['error'](_0x10e7('0xe'),_0xddf086,JSON['stringify'](_0x198877));_0x21e540[_0x10e7('0x10')]();});}else{_0x21e540[_0x10e7('0x10')]();}});}}catch(_0x1890f0){logger[_0x10e7('0x21')]('[%s][AMAZONLEX]\x20%s',_0xddf086,JSON[_0x10e7('0x22')](_0x1890f0));_0x21e540[_0x10e7('0x24')]();}};}; \ 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 7f64fe9..5528b18 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 _0xedc6=['auto_reply','sendMailMessage','smtpOptions','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','catch','error','[RPC][%s][AUTOREPLY]\x20%s','stringify','finally','resolve','Interaction','update','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','create','lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/openchannelInteraction','../../rpc/faxInteraction','consequence','channel','mail','body','isAutoreply','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','interaction','created','Autoreply\x20already\x20sent','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','getMustacheRender','message','from','phone','subject','chat','account','upperFirst','AccountId','InteractionId','Message','inReplyTo','messageId','html','','replace','','headers','auto-replied','All'];(function(_0x2a26c9,_0x1de138){var _0xb4fdd7=function(_0xb440d){while(--_0xb440d){_0x2a26c9['push'](_0x2a26c9['shift']());}};_0xb4fdd7(++_0x1de138);}(_0xedc6,0x1cf));var _0x6edc=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0xedc6[_0x2f3848];return _0x102668;};'use strict';var _=require(_0x6edc('0x0'));var moment=require('moment');var utils=require(_0x6edc('0x1'));var logger=require(_0x6edc('0x2'))(_0x6edc('0x3'));var rpc={'chatMessage':require(_0x6edc('0x4')),'openchannelMessage':require(_0x6edc('0x5')),'mailMessage':require(_0x6edc('0x6')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x6edc('0x7')),'whatsappMessage':require(_0x6edc('0x8')),'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x6edc('0x9')),'mailInteraction':require('../../rpc/mailInteraction'),'smsInteraction':require('../../rpc/smsInteraction'),'faxInteraction':require(_0x6edc('0xa')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var mailRpc=require('../../mailRpc');exports[_0x6edc('0xb')]=function(_0x58694b,_0x55a411,_0x4a1f5f,_0x52c220){return function(_0x23852b){try{var _0x575412=this[_0x6edc('0xc')];if(_0x575412===_0x6edc('0xd')&&_0x52c220[_0x6edc('0xe')][_0x6edc('0xf')]){logger[_0x6edc('0x10')](_0x6edc('0x11'),_0x58694b,_0x6edc('0x12'));return _0x23852b[_0x6edc('0x13')]();}if(_0x55a411[0x0]==='1'&&(_[_0x6edc('0x14')](this[_0x6edc('0x15')][_0x6edc('0x16')])||!this[_0x6edc('0x15')]['created'])){logger[_0x6edc('0x10')](_0x6edc('0x11'),_0x58694b,_0x6edc('0x17'));return _0x23852b[_0x6edc('0x13')]();}if(_0x55a411[0x0]==='2'&&this[_0x6edc('0x15')][_0x6edc('0x18')]){logger[_0x6edc('0x10')](_0x6edc('0x19'),_0x58694b,_0x6edc('0x1a'));return _0x23852b[_0x6edc('0x13')]();}var _0x2f6603={'ContactId':this['contact']['id'],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'direction':'out'};if(this[_0x6edc('0xc')]===_0x6edc('0xd')){_0x2f6603['body']=utils[_0x6edc('0x1b')](_0x55a411[0x2],this);}else{_0x2f6603[_0x6edc('0xe')]=utils[_0x6edc('0x1b')](_0x55a411[0x1],this);}if(this[_0x6edc('0x1c')]){_0x2f6603['to']=this[_0x6edc('0x1c')][_0x6edc('0x1d')]||'';if(this[_0x6edc('0xc')]==='mail'&&_0x55a411[0x1]==='1'){_0x2f6603['cc']=this[_0x6edc('0x1c')]['cc']||'';}_0x2f6603[_0x6edc('0x1d')]=this[_0x6edc('0x1c')]['to']||'';_0x2f6603[_0x6edc('0x1e')]=this[_0x6edc('0x1c')][_0x6edc('0x1e')]||'';_0x2f6603['read']=!![];if(this[_0x6edc('0x1c')][_0x6edc('0x1f')]){_0x2f6603[_0x6edc('0x1f')]='';_0x2f6603['subject']+=_['startsWith'](this[_0x6edc('0x1c')][_0x6edc('0x1f')],'Re:')?'':'Re:\x20';_0x2f6603[_0x6edc('0x1f')]+=this[_0x6edc('0x1c')]['subject'];}}if(this[_0x6edc('0xc')]===_0x6edc('0x20')){_0x2f6603['ChatWebsiteId']=this[_0x6edc('0x21')]['id'];}else{_0x2f6603[_[_0x6edc('0x22')](this['channel'])+_0x6edc('0x23')]=this[_0x6edc('0x21')]['id'];}_0x2f6603[_['upperFirst'](this[_0x6edc('0xc')])+_0x6edc('0x24')]=this[_0x6edc('0x15')]['id'];var _0x4120c6=this[_0x6edc('0x15')];if(rpc[this['channel']+_0x6edc('0x25')]){if(this[_0x6edc('0xc')]===_0x6edc('0xd')){_0x2f6603[_0x6edc('0x26')]=this['message'][_0x6edc('0x27')];_0x2f6603[_0x6edc('0x28')]=_0x6edc('0x29')+_[_0x6edc('0x2a')](_0x2f6603[_0x6edc('0xe')],_0x6edc('0x2b'),_0x6edc('0x2c'))+_0x6edc('0x2d');_0x2f6603[_0x6edc('0x2e')]={'Auto-Submitted':_0x6edc('0x2f'),'X-Auto-Response-Suppress':_0x6edc('0x30'),'Precedence':_0x6edc('0x31')};return mailRpc[_0x6edc('0x32')](this[_0x6edc('0x21')][_0x6edc('0x33')],_0x2f6603)[_0x6edc('0x34')](function(_0x271029){logger[_0x6edc('0x10')](_0x6edc('0x35'),_0x58694b);_0x2f6603[_0x6edc('0x27')]=_0x271029[_0x6edc('0x1c')][_0x6edc('0x27')];return rpc[_0x575412+_0x6edc('0x25')]['create'](_0x2f6603);})[_0x6edc('0x34')](function(_0x3bc0cd){logger[_0x6edc('0x10')](_0x6edc('0x11'),_0x58694b,JSON['stringify'](_0x3bc0cd));})[_0x6edc('0x36')](function(_0x3cb128){logger[_0x6edc('0x37')](_0x6edc('0x38'),_0x58694b,JSON[_0x6edc('0x39')](_0x3cb128));})[_0x6edc('0x3a')](function(){Promise[_0x6edc('0x3b')]()[_0x6edc('0x34')](function(){if(_0x55a411[0x0]!=='2'||_0x4120c6[_0x6edc('0x18')])return;return rpc[_0x575412+_0x6edc('0x3c')][_0x6edc('0x3d')](_0x4120c6['id'],{'autoreplyExecuted':!![]})['then'](function(_0x3dc62e){logger['info'](_0x6edc('0x19'),_0x58694b,JSON[_0x6edc('0x39')](_0x3dc62e));})[_0x6edc('0x36')](function(_0x15224b){logger['error'](_0x6edc('0x3e'),_0x58694b,JSON[_0x6edc('0x39')](_0x15224b));});})['then'](function(){_0x23852b[_0x6edc('0x13')]();});});}else{return rpc[this[_0x6edc('0xc')]+_0x6edc('0x25')][_0x6edc('0x3f')](_0x2f6603)[_0x6edc('0x34')](function(){logger['info'](_0x6edc('0x11'),_0x58694b,_0x2f6603[_0x6edc('0xe')]);})['catch'](function(_0x50373e){logger[_0x6edc('0x37')](_0x6edc('0x11'),_0x58694b,JSON['stringify'](_0x50373e));})[_0x6edc('0x3a')](function(){Promise[_0x6edc('0x3b')]()[_0x6edc('0x34')](function(){if(_0x55a411[0x0]!=='2'||_0x4120c6[_0x6edc('0x18')])return;return rpc[_0x575412+_0x6edc('0x3c')][_0x6edc('0x3d')](_0x4120c6['id'],{'autoreplyExecuted':!![]})[_0x6edc('0x34')](function(_0x44a9c8){logger[_0x6edc('0x10')](_0x6edc('0x19'),_0x58694b,JSON[_0x6edc('0x39')](_0x44a9c8));})['catch'](function(_0x2d3286){logger['error'](_0x6edc('0x3e'),_0x58694b,JSON['stringify'](_0x2d3286));});})['then'](function(){_0x23852b['next']();});});}}}catch(_0x56ea2b){logger[_0x6edc('0x37')](_0x6edc('0x11'),_0x58694b,JSON['stringify'](_0x56ea2b));_0x23852b['stop']();}};}; \ No newline at end of file +var _0x15df=['../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','consequence','mail','body','isAutoreply','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','isNil','interaction','created','Autoreply\x20already\x20sent','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','channel','getMustacheRender','message','from','phone','read','subject','startsWith','Re:\x20','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','Message','inReplyTo','html','','headers','auto-replied','All','auto_reply','smtpOptions','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','messageId','create','catch','error','[RPC][%s][AUTOREPLY]\x20%s','finally','resolve','Interaction','update','stringify','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','stop','lodash','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/mailInteraction','../../rpc/smsInteraction'];(function(_0x9f03b2,_0x456903){var _0x5df7eb=function(_0x21d518){while(--_0x21d518){_0x9f03b2['push'](_0x9f03b2['shift']());}};_0x5df7eb(++_0x456903);}(_0x15df,0xc9));var _0xf15d=function(_0x564122,_0x43ffb3){_0x564122=_0x564122-0x0;var _0x446554=_0x15df[_0x564122];return _0x446554;};'use strict';var _=require(_0xf15d('0x0'));var moment=require('moment');var utils=require(_0xf15d('0x1'));var logger=require(_0xf15d('0x2'))('routing');var rpc={'chatMessage':require(_0xf15d('0x3')),'openchannelMessage':require(_0xf15d('0x4')),'mailMessage':require(_0xf15d('0x5')),'smsMessage':require(_0xf15d('0x6')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require('../../rpc/whatsappMessage'),'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'mailInteraction':require(_0xf15d('0x7')),'smsInteraction':require(_0xf15d('0x8')),'faxInteraction':require(_0xf15d('0x9')),'whatsappInteraction':require(_0xf15d('0xa'))};var mailRpc=require(_0xf15d('0xb'));exports[_0xf15d('0xc')]=function(_0x4846d1,_0xb0c97d,_0x172530,_0x57c43e){return function(_0xd5959b){try{var _0x28062a=this['channel'];if(_0x28062a===_0xf15d('0xd')&&_0x57c43e[_0xf15d('0xe')][_0xf15d('0xf')]){logger[_0xf15d('0x10')](_0xf15d('0x11'),_0x4846d1,_0xf15d('0x12'));return _0xd5959b['next']();}if(_0xb0c97d[0x0]==='1'&&(_[_0xf15d('0x13')](this[_0xf15d('0x14')][_0xf15d('0x15')])||!this[_0xf15d('0x14')][_0xf15d('0x15')])){logger[_0xf15d('0x10')]('[%s][AUTOREPLY]\x20%s',_0x4846d1,_0xf15d('0x16'));return _0xd5959b['next']();}if(_0xb0c97d[0x0]==='2'&&this[_0xf15d('0x14')][_0xf15d('0x17')]){logger['info'](_0xf15d('0x18'),_0x4846d1,_0xf15d('0x19'));return _0xd5959b[_0xf15d('0x1a')]();}var _0x2d5d59={'ContactId':this[_0xf15d('0x1b')]['id'],'sentAt':moment()[_0xf15d('0x1c')](_0xf15d('0x1d')),'direction':'out'};if(this[_0xf15d('0x1e')]===_0xf15d('0xd')){_0x2d5d59[_0xf15d('0xe')]=utils[_0xf15d('0x1f')](_0xb0c97d[0x2],this);}else{_0x2d5d59[_0xf15d('0xe')]=utils[_0xf15d('0x1f')](_0xb0c97d[0x1],this);}if(this['message']){_0x2d5d59['to']=this[_0xf15d('0x20')][_0xf15d('0x21')]||'';if(this[_0xf15d('0x1e')]===_0xf15d('0xd')&&_0xb0c97d[0x1]==='1'){_0x2d5d59['cc']=this[_0xf15d('0x20')]['cc']||'';}_0x2d5d59[_0xf15d('0x21')]=this[_0xf15d('0x20')]['to']||'';_0x2d5d59[_0xf15d('0x22')]=this[_0xf15d('0x20')]['phone']||'';_0x2d5d59[_0xf15d('0x23')]=!![];if(this[_0xf15d('0x20')][_0xf15d('0x24')]){_0x2d5d59[_0xf15d('0x24')]='';_0x2d5d59[_0xf15d('0x24')]+=_[_0xf15d('0x25')](this['message']['subject'],'Re:')?'':_0xf15d('0x26');_0x2d5d59[_0xf15d('0x24')]+=this['message'][_0xf15d('0x24')];}}if(this[_0xf15d('0x1e')]===_0xf15d('0x27')){_0x2d5d59[_0xf15d('0x28')]=this[_0xf15d('0x29')]['id'];}else{_0x2d5d59[_[_0xf15d('0x2a')](this['channel'])+_0xf15d('0x2b')]=this[_0xf15d('0x29')]['id'];}_0x2d5d59[_[_0xf15d('0x2a')](this[_0xf15d('0x1e')])+_0xf15d('0x2c')]=this[_0xf15d('0x14')]['id'];var _0x6b5ed2=this[_0xf15d('0x14')];if(rpc[this['channel']+_0xf15d('0x2d')]){if(this[_0xf15d('0x1e')]===_0xf15d('0xd')){_0x2d5d59[_0xf15d('0x2e')]=this['message']['messageId'];_0x2d5d59[_0xf15d('0x2f')]=''+_['replace'](_0x2d5d59[_0xf15d('0xe')],_0xf15d('0x30'),_0xf15d('0x31'))+_0xf15d('0x32');_0x2d5d59[_0xf15d('0x33')]={'Auto-Submitted':_0xf15d('0x34'),'X-Auto-Response-Suppress':_0xf15d('0x35'),'Precedence':_0xf15d('0x36')};return mailRpc['sendMailMessage'](this['account'][_0xf15d('0x37')],_0x2d5d59)[_0xf15d('0x38')](function(_0x3eb2d7){logger[_0xf15d('0x10')](_0xf15d('0x39'),_0x4846d1);_0x2d5d59[_0xf15d('0x3a')]=_0x3eb2d7[_0xf15d('0x20')][_0xf15d('0x3a')];return rpc[_0x28062a+_0xf15d('0x2d')][_0xf15d('0x3b')](_0x2d5d59);})[_0xf15d('0x38')](function(_0x333e16){logger[_0xf15d('0x10')](_0xf15d('0x11'),_0x4846d1,JSON['stringify'](_0x333e16));})[_0xf15d('0x3c')](function(_0x2cf510){logger[_0xf15d('0x3d')](_0xf15d('0x3e'),_0x4846d1,JSON['stringify'](_0x2cf510));})[_0xf15d('0x3f')](function(){Promise[_0xf15d('0x40')]()[_0xf15d('0x38')](function(){if(_0xb0c97d[0x0]!=='2'||_0x6b5ed2['autoreplyExecuted'])return;return rpc[_0x28062a+_0xf15d('0x41')][_0xf15d('0x42')](_0x6b5ed2['id'],{'autoreplyExecuted':!![]})[_0xf15d('0x38')](function(_0x40728c){logger[_0xf15d('0x10')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x4846d1,JSON[_0xf15d('0x43')](_0x40728c));})[_0xf15d('0x3c')](function(_0x3bbbfb){logger['error'](_0xf15d('0x44'),_0x4846d1,JSON[_0xf15d('0x43')](_0x3bbbfb));});})[_0xf15d('0x38')](function(){_0xd5959b['next']();});});}else{return rpc[this[_0xf15d('0x1e')]+_0xf15d('0x2d')][_0xf15d('0x3b')](_0x2d5d59)[_0xf15d('0x38')](function(){logger[_0xf15d('0x10')](_0xf15d('0x11'),_0x4846d1,_0x2d5d59[_0xf15d('0xe')]);})[_0xf15d('0x3c')](function(_0x49bbf1){logger[_0xf15d('0x3d')](_0xf15d('0x11'),_0x4846d1,JSON['stringify'](_0x49bbf1));})[_0xf15d('0x3f')](function(){Promise[_0xf15d('0x40')]()[_0xf15d('0x38')](function(){if(_0xb0c97d[0x0]!=='2'||_0x6b5ed2[_0xf15d('0x17')])return;return rpc[_0x28062a+_0xf15d('0x41')][_0xf15d('0x42')](_0x6b5ed2['id'],{'autoreplyExecuted':!![]})[_0xf15d('0x38')](function(_0x59c189){logger[_0xf15d('0x10')](_0xf15d('0x18'),_0x4846d1,JSON[_0xf15d('0x43')](_0x59c189));})[_0xf15d('0x3c')](function(_0x46ed4f){logger['error']('[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x4846d1,JSON['stringify'](_0x46ed4f));});})[_0xf15d('0x38')](function(){_0xd5959b[_0xf15d('0x1a')]();});});}}}catch(_0x43ff41){logger[_0xf15d('0x3d')](_0xf15d('0x11'),_0x4846d1,JSON[_0xf15d('0x43')](_0x43ff41));_0xd5959b[_0xf15d('0x45')]();}};}; \ 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 b5a70a4..98b705f 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 _0x2fce=['finally','stop','error','moment','../../../../config/logger','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','consequence','format','channel','Interaction','update','interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','[%s][CLOSE]\x20%s','stringify'];(function(_0x94e30a,_0x4a6cde){var _0xef4d47=function(_0xb98c4b){while(--_0xb98c4b){_0x94e30a['push'](_0x94e30a['shift']());}};_0xef4d47(++_0x4a6cde);}(_0x2fce,0x16b));var _0xe2fc=function(_0x542701,_0x149324){_0x542701=_0x542701-0x0;var _0x2fb39a=_0x2fce[_0x542701];return _0x2fb39a;};'use strict';var moment=require(_0xe2fc('0x0'));var logger=require(_0xe2fc('0x1'))('routing');var rpc={'chatInteraction':require(_0xe2fc('0x2')),'openchannelInteraction':require(_0xe2fc('0x3')),'smsInteraction':require(_0xe2fc('0x4')),'mailInteraction':require(_0xe2fc('0x5')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require('../../rpc/whatsappInteraction')};exports[_0xe2fc('0x6')]=function(_0x4103ae,_0x22894b,_0x5b4918,_0x73b0ed){return function(_0x3e1ea7){try{logger['info']('[%s][CLOSE]\x20reason\x20%s',_0x4103ae,_0x22894b[0x0]);var _0x2163d1={'closed':0x1,'closedAt':moment()[_0xe2fc('0x7')]('YYYY-MM-DD\x20HH:mm:ss'),'closeReason':'system','disposition':_0x22894b[0x0]};if(rpc[_0x73b0ed[_0xe2fc('0x8')]+_0xe2fc('0x9')]){rpc[_0x73b0ed[_0xe2fc('0x8')]+'Interaction'][_0xe2fc('0xa')](_0x73b0ed[_0xe2fc('0xb')]['id'],_0x2163d1)[_0xe2fc('0xc')](function(_0x2734bd){logger['info'](_0xe2fc('0xd'),_0x4103ae,_0x73b0ed[_0xe2fc('0xb')]['id']);})[_0xe2fc('0xe')](function(_0x421d78){logger['error'](_0xe2fc('0xf'),_0x4103ae,JSON[_0xe2fc('0x10')](_0x421d78));})[_0xe2fc('0x11')](function(){_0x3e1ea7[_0xe2fc('0x12')]();});}}catch(_0x4b2f57){logger[_0xe2fc('0x13')](_0xe2fc('0xf'),_0x4103ae,JSON[_0xe2fc('0x10')](_0x4b2f57));_0x3e1ea7[_0xe2fc('0x12')]();}};}; \ No newline at end of file +var _0x9d8b=['format','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction','update','interaction','then','info','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','error','finally','stop','stringify','moment','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','[%s][CLOSE]\x20reason\x20%s'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9d8b,0xf4));var _0xb9d8=function(_0x2872b0,_0x4b0855){_0x2872b0=_0x2872b0-0x0;var _0x58b379=_0x9d8b[_0x2872b0];return _0x58b379;};'use strict';var moment=require(_0xb9d8('0x0'));var logger=require(_0xb9d8('0x1'))(_0xb9d8('0x2'));var rpc={'chatInteraction':require(_0xb9d8('0x3')),'openchannelInteraction':require(_0xb9d8('0x4')),'smsInteraction':require(_0xb9d8('0x5')),'mailInteraction':require(_0xb9d8('0x6')),'faxInteraction':require(_0xb9d8('0x7')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};exports['consequence']=function(_0x22e7a7,_0x3a4d18,_0x1c301b,_0x1c57c7){return function(_0x45d7fa){try{logger['info'](_0xb9d8('0x8'),_0x22e7a7,_0x3a4d18[0x0]);var _0xb355fa={'closed':0x1,'closedAt':moment()[_0xb9d8('0x9')](_0xb9d8('0xa')),'closeReason':_0xb9d8('0xb'),'disposition':_0x3a4d18[0x0]};if(rpc[_0x1c57c7[_0xb9d8('0xc')]+_0xb9d8('0xd')]){rpc[_0x1c57c7[_0xb9d8('0xc')]+_0xb9d8('0xd')][_0xb9d8('0xe')](_0x1c57c7[_0xb9d8('0xf')]['id'],_0xb355fa)[_0xb9d8('0x10')](function(_0x4edbef){logger[_0xb9d8('0x11')](_0xb9d8('0x12'),_0x22e7a7,_0x1c57c7['interaction']['id']);})['catch'](function(_0x7d3534){logger[_0xb9d8('0x13')]('[%s][CLOSE]\x20%s',_0x22e7a7,JSON['stringify'](_0x7d3534));})[_0xb9d8('0x14')](function(){_0x45d7fa[_0xb9d8('0x15')]();});}}catch(_0x175196){logger[_0xb9d8('0x13')]('[%s][CLOSE]\x20%s',_0x22e7a7,JSON[_0xb9d8('0x16')](_0x175196));_0x45d7fa[_0xb9d8('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 4ab4d63..82e25b7 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 _0x96aa=['stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','message','result','speech','providerName','dialogflow','metadata','next','lodash','moment','md5','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','format','YYYY-MM-DD\x20HH:mm:ss','channel','sms','whatsapp','phone','chat','ChatWebsiteId','account','InteractionId','created','isEmpty','body','getMustacheRender','create','then','catch','error'];(function(_0x42611d,_0x83e9c9){var _0xae917a=function(_0x1ffc9c){while(--_0x1ffc9c){_0x42611d['push'](_0x42611d['shift']());}};_0xae917a(++_0x83e9c9);}(_0x96aa,0x67));var _0xa96a=function(_0x373ff2,_0x1f566c){_0x373ff2=_0x373ff2-0x0;var _0x251056=_0x96aa[_0x373ff2];return _0x251056;};'use strict';var _=require(_0xa96a('0x0'));var moment=require(_0xa96a('0x1'));var apiai=require('apiai-promise');var md5=require(_0xa96a('0x2'));var utils=require(_0xa96a('0x3'));var logger=require(_0xa96a('0x4'))(_0xa96a('0x5'));var rpc={'chatMessage':require(_0xa96a('0x6')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xa96a('0x7')),'smsMessage':require(_0xa96a('0x8')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0xa96a('0x9'))};exports[_0xa96a('0xa')]=function(_0x282c8c,_0x3f391e){return function(_0x44fb9d){try{if(!_[_0xa96a('0xb')](this[_0xa96a('0xc')][_0xa96a('0xd')])){logger[_0xa96a('0xe')](_0xa96a('0xf'),_0x282c8c,_0xa96a('0x10'));return _0x44fb9d['next']();}var _0x33b786={'ContactId':this['contact']['id'],'sentAt':moment()[_0xa96a('0x11')](_0xa96a('0x12')),'direction':'out'};if(this[_0xa96a('0x13')]===_0xa96a('0x14')||this[_0xa96a('0x13')]===_0xa96a('0x15')){_0x33b786[_0xa96a('0x16')]=this[_0xa96a('0xc')][_0xa96a('0x16')];}var _0x197116=this[_0xa96a('0x13')];if(_0x197116===_0xa96a('0x17')){_0x33b786[_0xa96a('0x18')]=this[_0xa96a('0x19')]['id'];}else{_0x33b786[_['upperFirst'](_0x197116)+'AccountId']=this[_0xa96a('0x19')]['id'];}_0x33b786[_['upperFirst'](_0x197116)+_0xa96a('0x1a')]=this['interaction']['id'];if(this[_0xa96a('0xc')][_0xa96a('0x1b')]){var _0x1f623e=_0x3f391e[0x2];if(!_[_0xa96a('0x1c')](_0x1f623e)){_0x33b786[_0xa96a('0x1d')]=utils[_0xa96a('0x1e')](_0x1f623e,this);return rpc[_0x197116+'Message'][_0xa96a('0x1f')](_0x33b786)[_0xa96a('0x20')](function(_0x48ca06){logger[_0xa96a('0xe')](_0xa96a('0xf'),_0x282c8c,_0x33b786[_0xa96a('0x1d')]);})[_0xa96a('0x21')](function(_0x482c59){logger[_0xa96a('0x22')](_0xa96a('0xf'),_0x282c8c,JSON[_0xa96a('0x23')](_0x482c59));})[_0xa96a('0x24')](function(){logger['info'](_0xa96a('0x25'),_0x282c8c);_0x44fb9d['stop']();});}else{logger[_0xa96a('0xe')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x282c8c);_0x44fb9d[_0xa96a('0x26')]();}}else{var _0x96a6b2=this;var _0x484ee7=apiai(_0x3f391e[0x0],{'language':_0x3f391e[0x1]||'en'});return _0x484ee7['textRequest'](this[_0xa96a('0x27')][_0xa96a('0x1d')],{'sessionId':md5(this[_0xa96a('0xc')]['id'])})[_0xa96a('0x20')](function(_0x3eca00){_0x96a6b2[_0xa96a('0x1d')]['dialogflow']=_0x3eca00;_0x33b786['body']=_0x3eca00[_0xa96a('0x28')]['fulfillment'][_0xa96a('0x29')];_0x33b786[_0xa96a('0x2a')]=_0xa96a('0x2b');_0x33b786['providerResponse']=JSON[_0xa96a('0x23')](_0x3eca00);return rpc[_0x197116+'Message']['create'](_0x33b786)[_0xa96a('0x20')](function(_0x4f76e0){logger[_0xa96a('0xe')](_0xa96a('0xf'),_0x282c8c,_0x33b786[_0xa96a('0x1d')]);if(_0x3eca00['result'][_0xa96a('0x2c')]['endConversation']){_0x44fb9d['next']();}else{_0x44fb9d[_0xa96a('0x26')]();}})['catch'](function(_0x585af1){logger[_0xa96a('0x22')](_0xa96a('0xf'),_0x282c8c,JSON['stringify'](_0x585af1));_0x44fb9d[_0xa96a('0x2d')]();});})[_0xa96a('0x21')](function(_0x472d59){logger[_0xa96a('0x22')](_0xa96a('0xf'),_0x282c8c,_0x472d59['message']);_0x44fb9d[_0xa96a('0x2d')]();});}}catch(_0x17b6e9){logger['error'](_0xa96a('0xf'),_0x282c8c,JSON[_0xa96a('0x23')](_0x17b6e9));_0x44fb9d[_0xa96a('0x26')]();}};}; \ No newline at end of file +var _0xf3a7=['providerName','providerResponse','Message','metadata','endConversation','next','moment','apiai-promise','md5','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','info','[%s][DIALOGFLOW]\x20%s','contact','YYYY-MM-DD\x20HH:mm:ss','channel','whatsapp','phone','chat','ChatWebsiteId','upperFirst','account','InteractionId','created','body','getMustacheRender','create','then','catch','error','stringify','[%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'];(function(_0x4588a0,_0x337469){var _0x5c8cef=function(_0x564b2a){while(--_0x564b2a){_0x4588a0['push'](_0x4588a0['shift']());}};_0x5c8cef(++_0x337469);}(_0xf3a7,0x99));var _0x7f3a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf3a7[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var moment=require(_0x7f3a('0x0'));var apiai=require(_0x7f3a('0x1'));var md5=require(_0x7f3a('0x2'));var utils=require(_0x7f3a('0x3'));var logger=require(_0x7f3a('0x4'))(_0x7f3a('0x5'));var rpc={'chatMessage':require(_0x7f3a('0x6')),'openchannelMessage':require(_0x7f3a('0x7')),'mailMessage':require(_0x7f3a('0x8')),'smsMessage':require(_0x7f3a('0x9')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x7f3a('0xa'))};exports[_0x7f3a('0xb')]=function(_0x2a7d66,_0x2c6b8b){return function(_0x1dd804){try{if(!_[_0x7f3a('0xc')](this[_0x7f3a('0xd')]['UserId'])){logger[_0x7f3a('0xe')](_0x7f3a('0xf'),_0x2a7d66,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x1dd804['next']();}var _0x265fb7={'ContactId':this[_0x7f3a('0x10')]['id'],'sentAt':moment()['format'](_0x7f3a('0x11')),'direction':'out'};if(this[_0x7f3a('0x12')]==='sms'||this[_0x7f3a('0x12')]===_0x7f3a('0x13')){_0x265fb7[_0x7f3a('0x14')]=this[_0x7f3a('0xd')][_0x7f3a('0x14')];}var _0x1ac26c=this[_0x7f3a('0x12')];if(_0x1ac26c===_0x7f3a('0x15')){_0x265fb7[_0x7f3a('0x16')]=this['account']['id'];}else{_0x265fb7[_[_0x7f3a('0x17')](_0x1ac26c)+'AccountId']=this[_0x7f3a('0x18')]['id'];}_0x265fb7[_[_0x7f3a('0x17')](_0x1ac26c)+_0x7f3a('0x19')]=this[_0x7f3a('0xd')]['id'];if(this[_0x7f3a('0xd')][_0x7f3a('0x1a')]){var _0x2ce340=_0x2c6b8b[0x2];if(!_['isEmpty'](_0x2ce340)){_0x265fb7[_0x7f3a('0x1b')]=utils[_0x7f3a('0x1c')](_0x2ce340,this);return rpc[_0x1ac26c+'Message'][_0x7f3a('0x1d')](_0x265fb7)[_0x7f3a('0x1e')](function(_0x235e64){logger[_0x7f3a('0xe')]('[%s][DIALOGFLOW]\x20%s',_0x2a7d66,_0x265fb7['body']);})[_0x7f3a('0x1f')](function(_0x429d04){logger[_0x7f3a('0x20')](_0x7f3a('0xf'),_0x2a7d66,JSON[_0x7f3a('0x21')](_0x429d04));})['finally'](function(){logger[_0x7f3a('0xe')](_0x7f3a('0x22'),_0x2a7d66);_0x1dd804[_0x7f3a('0x23')]();});}else{logger[_0x7f3a('0xe')](_0x7f3a('0x24'),_0x2a7d66);_0x1dd804[_0x7f3a('0x23')]();}}else{var _0x7c55cb=this;var _0x203067=apiai(_0x2c6b8b[0x0],{'language':_0x2c6b8b[0x1]||'en'});return _0x203067[_0x7f3a('0x25')](this[_0x7f3a('0x26')]['body'],{'sessionId':md5(this['interaction']['id'])})['then'](function(_0x22cb57){_0x7c55cb[_0x7f3a('0x1b')][_0x7f3a('0x27')]=_0x22cb57;_0x265fb7['body']=_0x22cb57[_0x7f3a('0x28')][_0x7f3a('0x29')][_0x7f3a('0x2a')];_0x265fb7[_0x7f3a('0x2b')]=_0x7f3a('0x27');_0x265fb7[_0x7f3a('0x2c')]=JSON[_0x7f3a('0x21')](_0x22cb57);return rpc[_0x1ac26c+_0x7f3a('0x2d')][_0x7f3a('0x1d')](_0x265fb7)['then'](function(_0x1d0b25){logger[_0x7f3a('0xe')](_0x7f3a('0xf'),_0x2a7d66,_0x265fb7[_0x7f3a('0x1b')]);if(_0x22cb57[_0x7f3a('0x28')][_0x7f3a('0x2e')][_0x7f3a('0x2f')]){_0x1dd804[_0x7f3a('0x30')]();}else{_0x1dd804[_0x7f3a('0x23')]();}})[_0x7f3a('0x1f')](function(_0x34e987){logger[_0x7f3a('0x20')](_0x7f3a('0xf'),_0x2a7d66,JSON[_0x7f3a('0x21')](_0x34e987));_0x1dd804['next']();});})[_0x7f3a('0x1f')](function(_0x1e1420){logger['error']('[%s][DIALOGFLOW]\x20%s',_0x2a7d66,_0x1e1420[_0x7f3a('0x26')]);_0x1dd804[_0x7f3a('0x30')]();});}}catch(_0x21306f){logger['error'](_0x7f3a('0xf'),_0x2a7d66,JSON[_0x7f3a('0x21')](_0x21306f));_0x1dd804[_0x7f3a('0x23')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflowV2.js b/server/services/routing/server/applications/dialogflowV2.js index 03e3474..f36c9dd 100644 --- a/server/services/routing/server/applications/dialogflowV2.js +++ b/server/services/routing/server/applications/dialogflowV2.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x96d6=['created','isEmpty','create','catch','error','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','replace','SessionsClient','sessionPath','message','detectIntent','length','dialogflowV2','queryResult','diagnosticInfo','fields','end_conversation','boolValue','DIALOGFLOWV2_ACTION','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','DIALOGFLOWV2_INTENTNAME','DIALOGFLOWV2_INTENTDISPLAYNAME','intent','displayName','DIALOGFLOWV2_LANGUAGECODE','languageCode','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','providerResponse','fulfillmentText','push','stack','lodash','dialogflow','md5','bluebird','routing','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','clone','body','Message','then','[%s][DIALOGFLOWV2]\x20%s','stringify','isNil','interaction','UserId','info','next','contact','format','out','channel','phone','ChatWebsiteId','account','AccountId','upperFirst'];(function(_0x250bbc,_0x3297f3){var _0x489e34=function(_0x67c2d3){while(--_0x67c2d3){_0x250bbc['push'](_0x250bbc['shift']());}};_0x489e34(++_0x3297f3);}(_0x96d6,0x190));var _0x696d=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x96d6[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x696d('0x0'));var dialogflow=require(_0x696d('0x1'));var md5=require(_0x696d('0x2'));var moment=require('moment');var Promise=require(_0x696d('0x3'));var logger=require('../../../../config/logger')(_0x696d('0x4'));var utils=require(_0x696d('0x5'));var rpc={'chatMessage':require(_0x696d('0x6')),'openchannelMessage':require(_0x696d('0x7')),'mailMessage':require(_0x696d('0x8')),'smsMessage':require(_0x696d('0x9')),'faxMessage':require(_0x696d('0xa')),'whatsappMessage':require(_0x696d('0xb'))};function createMessage(_0x3d08b7,_0xc896c1,_0x281f75,_0x12eb6b){return new Promise(function(_0x596ab1,_0x5f1a06){var _0x344bdf=_[_0x696d('0xc')](_0x281f75);_0x344bdf[_0x696d('0xd')]=_0x12eb6b;return rpc[_0xc896c1+_0x696d('0xe')]['create'](_0x344bdf)[_0x696d('0xf')](function(){logger['info'](_0x696d('0x10'),_0x3d08b7,_0x344bdf['body']);_0x596ab1();})['catch'](function(_0x29c9e1){logger['error'](_0x696d('0x10'),_0x3d08b7,JSON[_0x696d('0x11')](_0x29c9e1));_0x5f1a06(_0x29c9e1);});});}exports['consequence']=function(_0x5dfb86,_0x264d32){return function(_0x5e95ed){try{if(!_[_0x696d('0x12')](this[_0x696d('0x13')][_0x696d('0x14')])){logger[_0x696d('0x15')](_0x696d('0x10'),_0x5dfb86,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x5e95ed[_0x696d('0x16')]();}var _0x9cbce={'ContactId':this[_0x696d('0x17')]['id'],'sentAt':moment()[_0x696d('0x18')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x696d('0x19')};if(this[_0x696d('0x1a')]==='sms'||this[_0x696d('0x1a')]==='whatsapp'){_0x9cbce[_0x696d('0x1b')]=this[_0x696d('0x13')][_0x696d('0x1b')];}var _0x1c09a7=this[_0x696d('0x1a')];if(_0x1c09a7==='chat'){_0x9cbce[_0x696d('0x1c')]=this[_0x696d('0x1d')]['id'];}else{_0x9cbce[_['upperFirst'](_0x1c09a7)+_0x696d('0x1e')]=this[_0x696d('0x1d')]['id'];}_0x9cbce[_[_0x696d('0x1f')](_0x1c09a7)+'InteractionId']=this[_0x696d('0x13')]['id'];if(this[_0x696d('0x13')][_0x696d('0x20')]){var _0x12ead5=_0x264d32[0x4];if(!_[_0x696d('0x21')](_0x12ead5)){_0x9cbce[_0x696d('0xd')]=utils['getMustacheRender'](_0x12ead5,this);return rpc[_0x1c09a7+_0x696d('0xe')][_0x696d('0x22')](_0x9cbce)[_0x696d('0xf')](function(_0x448758){logger['info'](_0x696d('0x10'),_0x5dfb86,_0x9cbce[_0x696d('0xd')]);})[_0x696d('0x23')](function(_0x176a4c){logger[_0x696d('0x24')](_0x696d('0x10'),_0x5dfb86,JSON['stringify'](_0x176a4c));})[_0x696d('0x25')](function(){logger['info'](_0x696d('0x26'),_0x5dfb86);_0x5e95ed[_0x696d('0x27')]();});}else{logger[_0x696d('0x15')](_0x696d('0x28'),_0x5dfb86);_0x5e95ed['stop']();}}else{var _0x3ceef6=this;var _0x55ff1d=_0x264d32[0x2][_0x696d('0x29')](/\\n/g,'\x0a');var _0x533fb2={'credentials':{'private_key':_0x55ff1d,'client_email':_0x264d32[0x1]}};var _0x333b5a=new dialogflow[(_0x696d('0x2a'))](_0x533fb2);var _0x2754c4=_0x333b5a[_0x696d('0x2b')](_0x264d32[0x0],md5(_0x3ceef6['interaction']['id']));var _0x36a965={'session':_0x2754c4,'queryInput':{'text':{'text':_0x3ceef6[_0x696d('0x2c')]['body'],'languageCode':_0x264d32[0x3]||'en'}}};return _0x333b5a[_0x696d('0x2d')](_0x36a965)['then'](function(_0x5138d6){if(_0x5138d6&&_0x5138d6[_0x696d('0x2e')]){_0x3ceef6[_0x696d('0xd')][_0x696d('0x2f')]=_0x5138d6;var _0x300663=_0x5138d6[0x0];var _0x3d32e3=_0x300663[_0x696d('0x30')][_0x696d('0x31')]&&_0x300663[_0x696d('0x30')]['diagnosticInfo'][_0x696d('0x32')]?_0x300663[_0x696d('0x30')][_0x696d('0x31')][_0x696d('0x32')][_0x696d('0x33')][_0x696d('0x34')]:![];_0x3ceef6[_0x696d('0xd')][_0x696d('0x35')]=_0x300663[_0x696d('0x30')][_0x696d('0x36')];_0x3ceef6[_0x696d('0xd')][_0x696d('0x37')]=_0x300663['queryResult'][_0x696d('0x38')];_0x3ceef6[_0x696d('0xd')][_0x696d('0x39')]=_0x300663[_0x696d('0x30')][_0x696d('0x31')]&&_0x300663[_0x696d('0x30')][_0x696d('0x31')]['fields']?_0x300663[_0x696d('0x30')]['diagnosticInfo'][_0x696d('0x32')][_0x696d('0x33')]['boolValue']:![];_0x3ceef6[_0x696d('0xd')][_0x696d('0x3a')]=_0x300663[_0x696d('0x30')]['intent']['name'];_0x3ceef6[_0x696d('0xd')][_0x696d('0x3b')]=_0x300663['queryResult'][_0x696d('0x3c')][_0x696d('0x3d')];_0x3ceef6[_0x696d('0xd')]['DIALOGFLOWV2_ISFALLBACKINTENT']=_0x300663[_0x696d('0x30')][_0x696d('0x3c')]['isFallback'];_0x3ceef6[_0x696d('0xd')][_0x696d('0x3e')]=_0x300663[_0x696d('0x30')][_0x696d('0x3f')];_0x3ceef6[_0x696d('0xd')]['DIALOGFLOWV2_QUERYTEXT']=_0x300663[_0x696d('0x30')][_0x696d('0x40')];_0x3ceef6[_0x696d('0xd')][_0x696d('0x41')]=_0x300663[_0x696d('0x30')][_0x696d('0x42')];_0x9cbce[_0x696d('0x43')]='dialogflowV2';_0x9cbce[_0x696d('0x44')]=JSON[_0x696d('0x11')](_0x5138d6);var _0x1a152c=[];for(var _0x23b161=0x0;_0x23b161<_0x5138d6[_0x696d('0x2e')];_0x23b161++){var _0x44ed7e=_0x5138d6[_0x23b161];if(_0x44ed7e&&_0x44ed7e[_0x696d('0x30')]&&_0x44ed7e[_0x696d('0x30')][_0x696d('0x45')]){_0x1a152c[_0x696d('0x46')](createMessage(_0x5dfb86,_0x1c09a7,_0x9cbce,_0x44ed7e[_0x696d('0x30')]['fulfillmentText']));}}return Promise['all'](_0x1a152c)[_0x696d('0xf')](function(){if(_0x3d32e3){_0x5e95ed[_0x696d('0x16')]();}else{_0x5e95ed['stop']();}})[_0x696d('0x23')](function(_0xf4d5ae){logger[_0x696d('0x24')](_0x696d('0x10'),_0x5dfb86,JSON['stringify'](_0xf4d5ae));_0x5e95ed[_0x696d('0x16')]();});}})[_0x696d('0x23')](function(_0x778f11){logger[_0x696d('0x24')](_0x696d('0x10'),_0x5dfb86,_0x778f11[_0x696d('0x2c')],_0x778f11[_0x696d('0x47')]);_0x5e95ed['next']();});}}catch(_0x3e78b2){logger[_0x696d('0x24')](_0x696d('0x10'),_0x5dfb86,JSON[_0x696d('0x11')](_0x3e78b2));_0x5e95ed[_0x696d('0x27')]();}};}; \ No newline at end of file +var _0x6d33=['routing','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','clone','body','Message','create','info','[%s][DIALOGFLOWV2]\x20%s','error','stringify','interaction','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','format','YYYY-MM-DD\x20HH:mm:ss','out','sms','channel','whatsapp','phone','chat','ChatWebsiteId','account','AccountId','upperFirst','created','then','catch','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','SessionsClient','sessionPath','message','detectIntent','dialogflowV2','queryResult','diagnosticInfo','fields','boolValue','DIALOGFLOWV2_ENDCONVERSATION','end_conversation','DIALOGFLOWV2_INTENTNAME','intent','name','DIALOGFLOWV2_INTENTDISPLAYNAME','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','DIALOGFLOWV2_LANGUAGECODE','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerResponse','length','push','all','stack','lodash','dialogflow','md5','bluebird','../../../../config/logger'];(function(_0x4f83ca,_0x46f67a){var _0x1fbac3=function(_0x19e401){while(--_0x19e401){_0x4f83ca['push'](_0x4f83ca['shift']());}};_0x1fbac3(++_0x46f67a);}(_0x6d33,0x10f));var _0x36d3=function(_0xe1b5f6,_0x210c09){_0xe1b5f6=_0xe1b5f6-0x0;var _0x44636e=_0x6d33[_0xe1b5f6];return _0x44636e;};'use strict';var _=require(_0x36d3('0x0'));var dialogflow=require(_0x36d3('0x1'));var md5=require(_0x36d3('0x2'));var moment=require('moment');var Promise=require(_0x36d3('0x3'));var logger=require(_0x36d3('0x4'))(_0x36d3('0x5'));var utils=require(_0x36d3('0x6'));var rpc={'chatMessage':require(_0x36d3('0x7')),'openchannelMessage':require(_0x36d3('0x8')),'mailMessage':require(_0x36d3('0x9')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x36d3('0xa')),'whatsappMessage':require(_0x36d3('0xb'))};function createMessage(_0xfe6a73,_0x12822a,_0xac0117,_0x554937){return new Promise(function(_0x44a2fb,_0xbe952b){var _0xa4a008=_[_0x36d3('0xc')](_0xac0117);_0xa4a008[_0x36d3('0xd')]=_0x554937;return rpc[_0x12822a+_0x36d3('0xe')][_0x36d3('0xf')](_0xa4a008)['then'](function(){logger[_0x36d3('0x10')](_0x36d3('0x11'),_0xfe6a73,_0xa4a008['body']);_0x44a2fb();})['catch'](function(_0x295609){logger[_0x36d3('0x12')](_0x36d3('0x11'),_0xfe6a73,JSON[_0x36d3('0x13')](_0x295609));_0xbe952b(_0x295609);});});}exports['consequence']=function(_0x15f6bb,_0x156f39){return function(_0x35c68c){try{if(!_['isNil'](this[_0x36d3('0x14')][_0x36d3('0x15')])){logger[_0x36d3('0x10')]('[%s][DIALOGFLOWV2]\x20%s',_0x15f6bb,_0x36d3('0x16'));return _0x35c68c[_0x36d3('0x17')]();}var _0x1f7299={'ContactId':this['contact']['id'],'sentAt':moment()[_0x36d3('0x18')](_0x36d3('0x19')),'direction':_0x36d3('0x1a')};if(this['channel']===_0x36d3('0x1b')||this[_0x36d3('0x1c')]===_0x36d3('0x1d')){_0x1f7299['phone']=this[_0x36d3('0x14')][_0x36d3('0x1e')];}var _0xb6ce79=this[_0x36d3('0x1c')];if(_0xb6ce79===_0x36d3('0x1f')){_0x1f7299[_0x36d3('0x20')]=this[_0x36d3('0x21')]['id'];}else{_0x1f7299[_['upperFirst'](_0xb6ce79)+_0x36d3('0x22')]=this['account']['id'];}_0x1f7299[_[_0x36d3('0x23')](_0xb6ce79)+'InteractionId']=this[_0x36d3('0x14')]['id'];if(this[_0x36d3('0x14')][_0x36d3('0x24')]){var _0x5ed0eb=_0x156f39[0x4];if(!_['isEmpty'](_0x5ed0eb)){_0x1f7299[_0x36d3('0xd')]=utils['getMustacheRender'](_0x5ed0eb,this);return rpc[_0xb6ce79+_0x36d3('0xe')][_0x36d3('0xf')](_0x1f7299)[_0x36d3('0x25')](function(_0x25f86d){logger[_0x36d3('0x10')](_0x36d3('0x11'),_0x15f6bb,_0x1f7299[_0x36d3('0xd')]);})[_0x36d3('0x26')](function(_0x149a30){logger['error'](_0x36d3('0x11'),_0x15f6bb,JSON[_0x36d3('0x13')](_0x149a30));})['finally'](function(){logger[_0x36d3('0x10')](_0x36d3('0x27'),_0x15f6bb);_0x35c68c[_0x36d3('0x28')]();});}else{logger[_0x36d3('0x10')](_0x36d3('0x29'),_0x15f6bb);_0x35c68c['stop']();}}else{var _0x59fda8=this;var _0x4cd259=_0x156f39[0x2]['replace'](/\\n/g,'\x0a');var _0x3a606c={'credentials':{'private_key':_0x4cd259,'client_email':_0x156f39[0x1]}};var _0x1a2678=new dialogflow[(_0x36d3('0x2a'))](_0x3a606c);var _0x4af058=_0x1a2678[_0x36d3('0x2b')](_0x156f39[0x0],md5(_0x59fda8[_0x36d3('0x14')]['id']));var _0x14e8e5={'session':_0x4af058,'queryInput':{'text':{'text':_0x59fda8[_0x36d3('0x2c')][_0x36d3('0xd')],'languageCode':_0x156f39[0x3]||'en'}}};return _0x1a2678[_0x36d3('0x2d')](_0x14e8e5)[_0x36d3('0x25')](function(_0x13c94e){if(_0x13c94e&&_0x13c94e['length']){_0x59fda8[_0x36d3('0xd')][_0x36d3('0x2e')]=_0x13c94e;var _0x2ce44f=_0x13c94e[0x0];var _0x413127=_0x2ce44f[_0x36d3('0x2f')][_0x36d3('0x30')]&&_0x2ce44f[_0x36d3('0x2f')]['diagnosticInfo'][_0x36d3('0x31')]?_0x2ce44f[_0x36d3('0x2f')][_0x36d3('0x30')]['fields']['end_conversation'][_0x36d3('0x32')]:![];_0x59fda8[_0x36d3('0xd')]['DIALOGFLOWV2_ACTION']=_0x2ce44f['queryResult']['action'];_0x59fda8['body']['DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT']=_0x2ce44f[_0x36d3('0x2f')]['allRequiredParamsPresent'];_0x59fda8[_0x36d3('0xd')][_0x36d3('0x33')]=_0x2ce44f[_0x36d3('0x2f')][_0x36d3('0x30')]&&_0x2ce44f[_0x36d3('0x2f')][_0x36d3('0x30')][_0x36d3('0x31')]?_0x2ce44f[_0x36d3('0x2f')]['diagnosticInfo']['fields'][_0x36d3('0x34')][_0x36d3('0x32')]:![];_0x59fda8[_0x36d3('0xd')][_0x36d3('0x35')]=_0x2ce44f[_0x36d3('0x2f')][_0x36d3('0x36')][_0x36d3('0x37')];_0x59fda8[_0x36d3('0xd')][_0x36d3('0x38')]=_0x2ce44f[_0x36d3('0x2f')][_0x36d3('0x36')][_0x36d3('0x39')];_0x59fda8[_0x36d3('0xd')][_0x36d3('0x3a')]=_0x2ce44f[_0x36d3('0x2f')][_0x36d3('0x36')]['isFallback'];_0x59fda8[_0x36d3('0xd')][_0x36d3('0x3b')]=_0x2ce44f[_0x36d3('0x2f')]['languageCode'];_0x59fda8[_0x36d3('0xd')][_0x36d3('0x3c')]=_0x2ce44f[_0x36d3('0x2f')][_0x36d3('0x3d')];_0x59fda8[_0x36d3('0xd')][_0x36d3('0x3e')]=_0x2ce44f[_0x36d3('0x2f')][_0x36d3('0x3f')];_0x1f7299['providerName']=_0x36d3('0x2e');_0x1f7299[_0x36d3('0x40')]=JSON['stringify'](_0x13c94e);var _0x4bc258=[];for(var _0x47c584=0x0;_0x47c584<_0x13c94e[_0x36d3('0x41')];_0x47c584++){var _0x3e0ce0=_0x13c94e[_0x47c584];if(_0x3e0ce0&&_0x3e0ce0[_0x36d3('0x2f')]&&_0x3e0ce0['queryResult']['fulfillmentText']){_0x4bc258[_0x36d3('0x42')](createMessage(_0x15f6bb,_0xb6ce79,_0x1f7299,_0x3e0ce0[_0x36d3('0x2f')]['fulfillmentText']));}}return Promise[_0x36d3('0x43')](_0x4bc258)['then'](function(){if(_0x413127){_0x35c68c[_0x36d3('0x17')]();}else{_0x35c68c[_0x36d3('0x28')]();}})[_0x36d3('0x26')](function(_0x7626a){logger['error']('[%s][DIALOGFLOWV2]\x20%s',_0x15f6bb,JSON[_0x36d3('0x13')](_0x7626a));_0x35c68c[_0x36d3('0x17')]();});}})[_0x36d3('0x26')](function(_0x4c593a){logger[_0x36d3('0x12')](_0x36d3('0x11'),_0x15f6bb,_0x4c593a['message'],_0x4c593a[_0x36d3('0x44')]);_0x35c68c['next']();});}}catch(_0x529c3f){logger[_0x36d3('0x12')](_0x36d3('0x11'),_0x15f6bb,JSON['stringify'](_0x529c3f));_0x35c68c[_0x36d3('0x28')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotoif.js b/server/services/routing/server/applications/gotoif.js index 6a981fa..3ce4a02 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 _0x338d=['rules','[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify','validate','lodash','html-to-text','./utils','../../../../config/logger','routing','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence','fromString','getMustacheRender','replace','error','[%s][GOTOIF]\x20%s','message','join','stop','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex'];(function(_0x3074f3,_0x4f2c03){var _0x53f112=function(_0x4a17af){while(--_0x4a17af){_0x3074f3['push'](_0x3074f3['shift']());}};_0x53f112(++_0x4f2c03);}(_0x338d,0x1a3));var _0xd338=function(_0x30b330,_0x571c55){_0x30b330=_0x30b330-0x0;var _0x295ddd=_0x338d[_0x30b330];return _0x295ddd;};'use strict';var schema=require(_0xd338('0x0'));var _=require(_0xd338('0x1'));var htmlToText=require(_0xd338('0x2'));var utils=require(_0xd338('0x3'));var logger=require(_0xd338('0x4'))(_0xd338('0x5'));var gotoif=schema({'condition':{'type':'string','required':!![],'message':_0xd338('0x6')},'priorityTrue':{'type':_0xd338('0x7'),'message':_0xd338('0x8')},'priorityFalse':{'type':_0xd338('0x7'),'message':_0xd338('0x9')}});exports[_0xd338('0xa')]=function(_0x1661eb,_0x2fa3e3){return function(_0x5eea7a){try{var _0x30a037={'condition':htmlToText[_0xd338('0xb')](utils[_0xd338('0xc')](_0x2fa3e3[0x0],this),{'wordwrap':![]})[_0xd338('0xd')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x2fa3e3[0x1],'priorityFalse':_0x2fa3e3[0x2]};var _0x2d0796=gotoif['validate'](_0x30a037,{'typecast':!![]});if(_0x2d0796['length']){logger[_0xd338('0xe')](_0xd338('0xf'),_0x1661eb,_['map'](_0x2d0796,_0xd338('0x10'))[_0xd338('0x11')](',\x20'));_0x5eea7a[_0xd338('0x12')]();}else{try{var _0x3096a0=eval('('+_0x30a037['condition']+')');var _0x2527a2=_0x3096a0?_0x30a037['priorityTrue']:_0x30a037['priorityFalse'];logger[_0xd338('0x13')](_0xd338('0x14'),_0x1661eb,_0x30a037['condition'],_0x3096a0,_0x2527a2||_0xd338('0x15'));if(_0x2527a2){var _0x925773=_[_0xd338('0x16')](_0x5eea7a[_0xd338('0x17')](),{'p':_0x2527a2});if(_0x925773>=0x0){logger[_0xd338('0x13')]('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x1661eb,_0x2527a2||_0xd338('0x15'),_0x925773);_0x5eea7a[_0xd338('0x15')](_0x925773);}else{logger['info']('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0x1661eb,_0x2527a2||_0xd338('0x15'));_0x5eea7a[_0xd338('0x12')]();}}else{_0x5eea7a[_0xd338('0x15')]();}}catch(_0x342e86){logger[_0xd338('0xe')](_0xd338('0x18'),_0x1661eb,_0x342e86[_0xd338('0x10')]);_0x5eea7a[_0xd338('0x12')]();}}}catch(_0x5b0c58){logger[_0xd338('0xe')](_0xd338('0xf'),_0x1661eb,JSON[_0xd338('0x19')](_0x5b0c58));_0x5eea7a[_0xd338('0x12')]();}};}; \ No newline at end of file +var _0x511f=['next','findIndex','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20%s','stringify','validate','lodash','html-to-text','./utils','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence','fromString','getMustacheRender','error','message','join','stop','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','condition'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x511f,0x114));var _0xf511=function(_0x1cc5e4,_0x8b1496){_0x1cc5e4=_0x1cc5e4-0x0;var _0x1d83c3=_0x511f[_0x1cc5e4];return _0x1d83c3;};'use strict';var schema=require(_0xf511('0x0'));var _=require(_0xf511('0x1'));var htmlToText=require(_0xf511('0x2'));var utils=require(_0xf511('0x3'));var logger=require(_0xf511('0x4'))(_0xf511('0x5'));var gotoif=schema({'condition':{'type':_0xf511('0x6'),'required':!![],'message':_0xf511('0x7')},'priorityTrue':{'type':_0xf511('0x8'),'message':_0xf511('0x9')},'priorityFalse':{'type':'number','message':_0xf511('0xa')}});exports[_0xf511('0xb')]=function(_0x397a6a,_0x5b4326){return function(_0x56967a){try{var _0x131b01={'condition':htmlToText[_0xf511('0xc')](utils[_0xf511('0xd')](_0x5b4326[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x5b4326[0x1],'priorityFalse':_0x5b4326[0x2]};var _0x759695=gotoif['validate'](_0x131b01,{'typecast':!![]});if(_0x759695['length']){logger[_0xf511('0xe')]('[%s][GOTOIF]\x20%s',_0x397a6a,_['map'](_0x759695,_0xf511('0xf'))[_0xf511('0x10')](',\x20'));_0x56967a[_0xf511('0x11')]();}else{try{var _0x4d32eb=eval('('+_0x131b01['condition']+')');var _0x8dc9a8=_0x4d32eb?_0x131b01['priorityTrue']:_0x131b01['priorityFalse'];logger[_0xf511('0x12')](_0xf511('0x13'),_0x397a6a,_0x131b01[_0xf511('0x14')],_0x4d32eb,_0x8dc9a8||_0xf511('0x15'));if(_0x8dc9a8){var _0x597753=_[_0xf511('0x16')](_0x56967a['rules'](),{'p':_0x8dc9a8});if(_0x597753>=0x0){logger[_0xf511('0x12')](_0xf511('0x17'),_0x397a6a,_0x8dc9a8||_0xf511('0x15'),_0x597753);_0x56967a['next'](_0x597753);}else{logger[_0xf511('0x12')](_0xf511('0x18'),_0x397a6a,_0x8dc9a8||'next');_0x56967a[_0xf511('0x11')]();}}else{_0x56967a[_0xf511('0x15')]();}}catch(_0x5900e8){logger[_0xf511('0xe')]('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x397a6a,_0x5900e8[_0xf511('0xf')]);_0x56967a['stop']();}}}catch(_0x155dbd){logger[_0xf511('0xe')](_0xf511('0x19'),_0x397a6a,JSON[_0xf511('0x1a')](_0x155dbd));_0x56967a[_0xf511('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 9d1976f..d7fe180 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 _0xcfd0=['priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','error','validate','lodash','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','[%s][GOTOP]\x20%s','map','message','join','stop','info'];(function(_0x13ce0c,_0x3f2a0d){var _0x4388fb=function(_0x27db4b){while(--_0x27db4b){_0x13ce0c['push'](_0x13ce0c['shift']());}};_0x4388fb(++_0x3f2a0d);}(_0xcfd0,0x11f));var _0x0cfd=function(_0x1c436b,_0x410e61){_0x1c436b=_0x1c436b-0x0;var _0x2dae3c=_0xcfd0[_0x1c436b];return _0x2dae3c;};'use strict';var schema=require(_0x0cfd('0x0'));var _=require(_0x0cfd('0x1'));var logger=require('../../../../config/logger')(_0x0cfd('0x2'));var gotop=schema({'priority':{'type':_0x0cfd('0x3'),'required':!![],'message':_0x0cfd('0x4')}});exports[_0x0cfd('0x5')]=function(_0x5f0fcb,_0xd71add){return function(_0x2d83d9){try{var _0x22f799={'priority':_0xd71add[0x0]};var _0xeea14=gotop[_0x0cfd('0x0')](_0x22f799,{'typecast':!![]});if(_0xeea14[_0x0cfd('0x6')]){logger['error'](_0x0cfd('0x7'),_0x5f0fcb,_[_0x0cfd('0x8')](_0xeea14,_0x0cfd('0x9'))[_0x0cfd('0xa')](',\x20'));_0x2d83d9[_0x0cfd('0xb')]();}else{logger[_0x0cfd('0xc')]('[%s][GOTOP]\x20priority\x20%s',_0x5f0fcb,_0x22f799['priority']);if(_0x22f799[_0x0cfd('0xd')]){var _0x42df97=_[_0x0cfd('0xe')](_0x2d83d9[_0x0cfd('0xf')](),{'p':_0x22f799[_0x0cfd('0xd')]});if(_0x42df97>=0x0){logger['info'](_0x0cfd('0x10'),_0x5f0fcb,_0x22f799['priority']||_0x0cfd('0x11'),_0x42df97);_0x2d83d9[_0x0cfd('0x11')](_0x42df97);}else{logger[_0x0cfd('0xc')](_0x0cfd('0x12'),_0x5f0fcb,_0x22f799[_0x0cfd('0xd')]||'next');_0x2d83d9[_0x0cfd('0xb')]();}}else{_0x2d83d9[_0x0cfd('0x11')]();}}}catch(_0xc7082e){logger[_0x0cfd('0x13')](_0x0cfd('0x7'),_0x5f0fcb,JSON['stringify'](_0xc7082e));_0x2d83d9[_0x0cfd('0xb')]();}};}; \ No newline at end of file +var _0x91eb=['number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','validate','length','[%s][GOTOP]\x20%s','map','join','info','[%s][GOTOP]\x20priority\x20%s','priority','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stop','error','stringify','../../../../config/logger'];(function(_0x22b68a,_0x2bffc3){var _0x1ac67a=function(_0x25f9d5){while(--_0x25f9d5){_0x22b68a['push'](_0x22b68a['shift']());}};_0x1ac67a(++_0x2bffc3);}(_0x91eb,0x1af));var _0xb91e=function(_0x180fe2,_0x2767d7){_0x180fe2=_0x180fe2-0x0;var _0x45bcb6=_0x91eb[_0x180fe2];return _0x45bcb6;};'use strict';var schema=require('validate');var _=require('lodash');var logger=require(_0xb91e('0x0'))('routing');var gotop=schema({'priority':{'type':_0xb91e('0x1'),'required':!![],'message':_0xb91e('0x2')}});exports[_0xb91e('0x3')]=function(_0x5296d5,_0x2c49e4){return function(_0x942366){try{var _0x4f226a={'priority':_0x2c49e4[0x0]};var _0xaca9bf=gotop[_0xb91e('0x4')](_0x4f226a,{'typecast':!![]});if(_0xaca9bf[_0xb91e('0x5')]){logger['error'](_0xb91e('0x6'),_0x5296d5,_[_0xb91e('0x7')](_0xaca9bf,'message')[_0xb91e('0x8')](',\x20'));_0x942366['stop']();}else{logger[_0xb91e('0x9')](_0xb91e('0xa'),_0x5296d5,_0x4f226a[_0xb91e('0xb')]);if(_0x4f226a[_0xb91e('0xb')]){var _0x29fc7e=_['findIndex'](_0x942366['rules'](),{'p':_0x4f226a[_0xb91e('0xb')]});if(_0x29fc7e>=0x0){logger['info'](_0xb91e('0xc'),_0x5296d5,_0x4f226a[_0xb91e('0xb')]||_0xb91e('0xd'),_0x29fc7e);_0x942366[_0xb91e('0xd')](_0x29fc7e);}else{logger[_0xb91e('0x9')](_0xb91e('0xe'),_0x5296d5,_0x4f226a[_0xb91e('0xb')]||'next');_0x942366[_0xb91e('0xf')]();}}else{_0x942366[_0xb91e('0xd')]();}}}catch(_0x563d0e){logger[_0xb91e('0x10')]('[%s][GOTOP]\x20%s',_0x5296d5,JSON[_0xb91e('0x11')](_0x563d0e));_0x942366[_0xb91e('0xf')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/message.js b/server/services/routing/server/applications/message.js index abf73b7..f94deea 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 _0xfecd=['../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','consequence','getMustacheRender','contact','channel','chat','account','upperFirst','interaction','create','then','info','[%s][MESSAGE]\x20%s','body','next','catch','error','stop','stringify','lodash'];(function(_0x5a306d,_0x101e07){var _0x54dfcf=function(_0x53fa29){while(--_0x53fa29){_0x5a306d['push'](_0x5a306d['shift']());}};_0x54dfcf(++_0x101e07);}(_0xfecd,0x107));var _0xdfec=function(_0x26c2f3,_0x424805){_0x26c2f3=_0x26c2f3-0x0;var _0x2fa8bd=_0xfecd[_0x26c2f3];return _0x2fa8bd;};'use strict';var _=require(_0xdfec('0x0'));var utils=require('./utils');var logger=require(_0xdfec('0x1'))(_0xdfec('0x2'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xdfec('0x3')),'mailMessage':require(_0xdfec('0x4')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xdfec('0x5')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0xdfec('0x6')]=function(_0x25209a,_0x10ca9b){return function(_0x4d0fa6){try{var _0x2f35a8={'body':utils[_0xdfec('0x7')](_0x10ca9b[0x0],this),'ContactId':this[_0xdfec('0x8')]['id']};if(this[_0xdfec('0x9')]===_0xdfec('0xa')){_0x2f35a8['ChatWebsiteId']=this[_0xdfec('0xb')]['id'];}else{_0x2f35a8[_[_0xdfec('0xc')](this[_0xdfec('0x9')])+'AccountId']=this['account']['id'];}_0x2f35a8[_[_0xdfec('0xc')](this[_0xdfec('0x9')])+'InteractionId']=this[_0xdfec('0xd')]['id'];if(rpc[this[_0xdfec('0x9')]+'Message']){return rpc[this[_0xdfec('0x9')]+'Message'][_0xdfec('0xe')](_0x2f35a8)[_0xdfec('0xf')](function(_0x2384f5){logger[_0xdfec('0x10')](_0xdfec('0x11'),_0x25209a,_0x2f35a8[_0xdfec('0x12')]);_0x4d0fa6[_0xdfec('0x13')]();})[_0xdfec('0x14')](function(_0x4d7c6e){logger[_0xdfec('0x15')](_0xdfec('0x11'),_0x25209a,JSON['stringify'](_0x4d7c6e));_0x4d0fa6[_0xdfec('0x16')]();});}}catch(_0x53ef23){logger[_0xdfec('0x15')](_0xdfec('0x11'),_0x25209a,JSON[_0xdfec('0x17')](_0x53ef23));_0x4d0fa6[_0xdfec('0x16')]();}};}; \ No newline at end of file +var _0x795a=['Message','create','then','info','body','next','catch','error','[%s][MESSAGE]\x20%s','stringify','stop','./utils','../../../../config/logger','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','contact','channel','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','interaction'];(function(_0x258fb0,_0x5362dc){var _0x4d1afe=function(_0x1c8f24){while(--_0x1c8f24){_0x258fb0['push'](_0x258fb0['shift']());}};_0x4d1afe(++_0x5362dc);}(_0x795a,0xeb));var _0xa795=function(_0x537d6c,_0x2e63b8){_0x537d6c=_0x537d6c-0x0;var _0x56c250=_0x795a[_0x537d6c];return _0x56c250;};'use strict';var _=require('lodash');var utils=require(_0xa795('0x0'));var logger=require(_0xa795('0x1'))('routing');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xa795('0x2')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0xa795('0x3')),'faxMessage':require(_0xa795('0x4')),'whatsappMessage':require(_0xa795('0x5'))};exports[_0xa795('0x6')]=function(_0x147dd8,_0x5c01f2){return function(_0x5e0f19){try{var _0x39e56e={'body':utils[_0xa795('0x7')](_0x5c01f2[0x0],this),'ContactId':this[_0xa795('0x8')]['id']};if(this[_0xa795('0x9')]===_0xa795('0xa')){_0x39e56e[_0xa795('0xb')]=this[_0xa795('0xc')]['id'];}else{_0x39e56e[_[_0xa795('0xd')](this[_0xa795('0x9')])+_0xa795('0xe')]=this[_0xa795('0xc')]['id'];}_0x39e56e[_[_0xa795('0xd')](this[_0xa795('0x9')])+_0xa795('0xf')]=this[_0xa795('0x10')]['id'];if(rpc[this[_0xa795('0x9')]+_0xa795('0x11')]){return rpc[this['channel']+_0xa795('0x11')][_0xa795('0x12')](_0x39e56e)[_0xa795('0x13')](function(_0x3d5a70){logger[_0xa795('0x14')]('[%s][MESSAGE]\x20%s',_0x147dd8,_0x39e56e[_0xa795('0x15')]);_0x5e0f19[_0xa795('0x16')]();})[_0xa795('0x17')](function(_0x5e73a6){logger[_0xa795('0x18')](_0xa795('0x19'),_0x147dd8,JSON[_0xa795('0x1a')](_0x5e73a6));_0x5e0f19[_0xa795('0x1b')]();});}}catch(_0x33f02e){logger['error'](_0xa795('0x19'),_0x147dd8,JSON[_0xa795('0x1a')](_0x33f02e));_0x5e0f19[_0xa795('0x1b')]();}};}; \ 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 5a45bc6..56b781f 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 _0xef21=['./utils','../../../../config/logger','routing','consequence','info','[%s][NOOP]\x20%s','getMustacheRender','next','stringify','stop'];(function(_0x2f7cb8,_0x191a3a){var _0x46ee0f=function(_0x4f894c){while(--_0x4f894c){_0x2f7cb8['push'](_0x2f7cb8['shift']());}};_0x46ee0f(++_0x191a3a);}(_0xef21,0x8c));var _0x1ef2=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0xef21[_0x2aec52];return _0x3b8835;};'use strict';var utils=require(_0x1ef2('0x0'));var logger=require(_0x1ef2('0x1'))(_0x1ef2('0x2'));exports[_0x1ef2('0x3')]=function(_0x300306,_0x55877f){return function(_0x47666c){try{logger[_0x1ef2('0x4')](_0x1ef2('0x5'),_0x300306,utils[_0x1ef2('0x6')](_0x55877f[0x0],this));_0x47666c[_0x1ef2('0x7')]();}catch(_0x439a97){logger['error'](_0x1ef2('0x5'),_0x300306,JSON[_0x1ef2('0x8')](_0x439a97));_0x47666c[_0x1ef2('0x9')]();}};}; \ No newline at end of file +var _0x885c=['consequence','info','getMustacheRender','error','[%s][NOOP]\x20%s','stop','../../../../config/logger','routing'];(function(_0x3564ca,_0x401cf1){var _0x3bf55a=function(_0x652de2){while(--_0x652de2){_0x3564ca['push'](_0x3564ca['shift']());}};_0x3bf55a(++_0x401cf1);}(_0x885c,0x1be));var _0xc885=function(_0x5e6bec,_0x1eb54d){_0x5e6bec=_0x5e6bec-0x0;var _0x5dc5cf=_0x885c[_0x5e6bec];return _0x5dc5cf;};'use strict';var utils=require('./utils');var logger=require(_0xc885('0x0'))(_0xc885('0x1'));exports[_0xc885('0x2')]=function(_0xb85833,_0x2f6fda){return function(_0x1b74d8){try{logger[_0xc885('0x3')]('[%s][NOOP]\x20%s',_0xb85833,utils[_0xc885('0x4')](_0x2f6fda[0x0],this));_0x1b74d8['next']();}catch(_0x3377f3){logger[_0xc885('0x5')](_0xc885('0x6'),_0xb85833,JSON['stringify'](_0x3377f3));_0x1b74d8[_0xc885('0x7')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/queue.js b/server/services/routing/server/applications/queue.js index c303fb0..ff2c1e3 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 _0xcb2d=['stack','validate','util','seq-queue','moment','ioredis','../../../../config/environment','../../../../config/logger','routing','./strategy','redis','queue_id','from','joinAt','emit','clone','queue','account','capitalize','InteractionId','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','../../rpc/faxInteraction','../../rpc/mailInteraction','../../rpc/whatsappInteraction','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','QueueId','interaction','MessageId','message','chat','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','error','[%s][STOP:QUEUE][NAME:%s]','Interaction','update','then','catch','update\x20queue\x20report','waiting','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','length','map','join','createQueue','atimeout','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','complete','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','stop','[%s][QUEUE]\x20%s'];(function(_0x2011aa,_0x2c413a){var _0x3cd269=function(_0x1c6c3c){while(--_0x1c6c3c){_0x2011aa['push'](_0x2011aa['shift']());}};_0x3cd269(++_0x2c413a);}(_0xcb2d,0x106));var _0xdcb2=function(_0x42e8f9,_0x387507){_0x42e8f9=_0x42e8f9-0x0;var _0x52ceb9=_0xcb2d[_0x42e8f9];return _0x52ceb9;};'use strict';var schema=require(_0xdcb2('0x0'));var _=require('lodash');var util=require(_0xdcb2('0x1'));var seqqueue=require(_0xdcb2('0x2'));var moment=require(_0xdcb2('0x3'));var Redis=require(_0xdcb2('0x4'));var config=require(_0xdcb2('0x5'));var logger=require(_0xdcb2('0x6'))(_0xdcb2('0x7'));var strategy=require(_0xdcb2('0x8'));config[_0xdcb2('0x9')]=_['defaults'](config[_0xdcb2('0x9')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var attributes=['id',_0xdcb2('0xa'),'account','queue',_0xdcb2('0xb'),_0xdcb2('0xc')];function emit(_0xca7997,_0x3a85fb,_0x2323f6){io['to'](_0xca7997)[_0xdcb2('0xd')](_0x3a85fb,_0x2323f6);}function emitChannelQueueInteraction(_0x211458,_0x3c8e93,_0x44abb8,_0x3592f7,_0x4a94bb,_0x9ff96b,_0x1b6c56,_0x454582){var _0x1bec5e=_[_0xdcb2('0xe')](_0x44abb8);_0x1bec5e['queue_id']=_0x454582;_0x1bec5e[_0xdcb2('0xf')]=_0x3c8e93;_0x1bec5e[_0xdcb2('0x10')]=_0x3592f7;_0x1bec5e['id']=_0x4a94bb;if(_0x9ff96b){attributes['push'](_[_0xdcb2('0x11')](_0x211458)+_0xdcb2('0x12'));_0x1b6c56[util[_0xdcb2('0x13')](_0xdcb2('0x14'),_0x211458)][_0x4a94bb]=_[_0xdcb2('0x15')](_0x1bec5e,attributes);}else{delete _0x1b6c56[util[_0xdcb2('0x13')](_0xdcb2('0x14'),_0x211458)][_0x4a94bb];}emit(util['format'](_0xdcb2('0x16'),_0x211458,_0x3c8e93),util[_0xdcb2('0x13')](_0xdcb2('0x17'),_0x211458,_0x9ff96b?_0xdcb2('0x18'):_0xdcb2('0x19')),_['pick'](_0x1bec5e,attributes));}var rpc={'openchannelQueueReport':require(_0xdcb2('0x1a')),'mailQueueReport':require(_0xdcb2('0x1b')),'chatQueueReport':require(_0xdcb2('0x1c')),'smsQueueReport':require('../../rpc/smsQueueReport'),'faxQueueReport':require(_0xdcb2('0x1d')),'whatsappQueueReport':require(_0xdcb2('0x1e')),'chatInteraction':require('../../rpc/chatInteraction'),'faxInteraction':require(_0xdcb2('0x1f')),'mailInteraction':require(_0xdcb2('0x20')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require('../../rpc/smsInteraction'),'whatsappInteraction':require(_0xdcb2('0x21'))};var queue=schema({'name':{'type':_0xdcb2('0x22'),'required':!![],'message':_0xdcb2('0x23')},'timeout':{'type':_0xdcb2('0x24'),'message':'timeout\x20is\x20a\x20number'}});function startRouting(_0x51ae68,_0x40ba94,_0x989060,_0x345645){if(_0x51ae68&&_0x40ba94&&_0x989060){_0x40ba94['waiting']+=0x1;var _0x272d03={'uniqueid':_0x51ae68,'from':_0x989060[_0xdcb2('0x25')]?_0x989060[_0xdcb2('0x25')]['from']:'','joinAt':moment()[_0xdcb2('0x13')](_0xdcb2('0x26')),'ContactId':_0x989060[_0xdcb2('0x27')]?_0x989060[_0xdcb2('0x27')]['id']:null,'ListId':_0x989060['list']?_0x989060[_0xdcb2('0x28')]['id']:null};_0x272d03[_[_0xdcb2('0x29')](_0x989060[_0xdcb2('0x2a')])+_0xdcb2('0x2b')]=_0x40ba94['id']||null;_0x272d03[_[_0xdcb2('0x29')](_0x989060[_0xdcb2('0x2a')])+_0xdcb2('0x12')]=_0x989060[_0xdcb2('0x2c')]?_0x989060['interaction']['id']:null;_0x272d03[_[_0xdcb2('0x29')](_0x989060[_0xdcb2('0x2a')])+_0xdcb2('0x2d')]=_0x989060[_0xdcb2('0x2e')]?_0x989060['message']['id']:null;_0x272d03[_[_0xdcb2('0x29')](_0x989060[_0xdcb2('0x2a')])+(_0x989060[_0xdcb2('0x2a')]!==_0xdcb2('0x2f')?_0xdcb2('0x30'):_0xdcb2('0x31'))]=_0x989060['account']?_0x989060[_0xdcb2('0x10')]['id']:null;logger[_0xdcb2('0x32')](util[_0xdcb2('0x13')](_0xdcb2('0x33'),_0x51ae68,_0x40ba94[_0xdcb2('0x34')]));emitChannelQueueInteraction(_0x989060[_0xdcb2('0x2a')],_0x40ba94[_0xdcb2('0x34')],_0x272d03,_0x989060['account'][_0xdcb2('0x34')],_0x989060['message']['id'],!![],_0x345645,_0x40ba94['id']);if(rpc[_0x989060[_0xdcb2('0x2a')]+_0xdcb2('0x35')]){return rpc[_0x989060[_0xdcb2('0x2a')]+'QueueReport'][_0xdcb2('0x36')](_0x272d03)['catch'](function(_0x378b50){logger[_0xdcb2('0x37')]('create\x20queue\x20report',_0x378b50);});}}}function stopRouting(_0x2f21df,_0xe3ecef,_0x287b44,_0x24d44f){if(_0x2f21df&&_0xe3ecef){_0xe3ecef['waiting']-=0x1;var _0x7f3813={'leaveAt':moment()[_0xdcb2('0x13')](_0xdcb2('0x26')),'acceptAt':moment()['format'](_0xdcb2('0x26')),'reason':'accepted'};logger[_0xdcb2('0x32')](util['format'](_0xdcb2('0x38'),_0x2f21df,_0xe3ecef[_0xdcb2('0x34')]));emitChannelQueueInteraction(_0x287b44[_0xdcb2('0x2a')],_0xe3ecef[_0xdcb2('0x34')],_0x287b44[_0xdcb2('0x25')],_0x287b44[_0xdcb2('0x10')][_0xdcb2('0x34')],_0x287b44['message']['id'],![],_0x24d44f,_0xe3ecef['id']);return rpc[_0x287b44[_0xdcb2('0x2a')]+_0xdcb2('0x39')][_0xdcb2('0x3a')](_0x287b44[_0xdcb2('0x2c')]['id'],{'queueId':_0xe3ecef['id']})[_0xdcb2('0x3b')](function(){if(rpc[_0x287b44[_0xdcb2('0x2a')]+_0xdcb2('0x35')]){return rpc[_0x287b44[_0xdcb2('0x2a')]+'QueueReport']['update'](_0x2f21df,_0x7f3813)[_0xdcb2('0x3c')](function(_0x4951b6){logger['error'](_0xdcb2('0x3d'),_0x4951b6);});}});}}function endRouting(_0x3f7e92,_0x5447b7,_0x16f519,_0x38a159){if(_0x3f7e92&&_0x5447b7){_0x5447b7[_0xdcb2('0x3e')]-=0x1;var _0x17459a={'leaveAt':moment()[_0xdcb2('0x13')](_0xdcb2('0x26')),'exitAt':moment()['format'](_0xdcb2('0x26')),'reason':_0xdcb2('0x3f')};logger[_0xdcb2('0x32')](util['format'](_0xdcb2('0x40'),_0x3f7e92,_0x5447b7['name']));emitChannelQueueInteraction(_0x16f519[_0xdcb2('0x2a')],_0x5447b7[_0xdcb2('0x34')],_0x16f519['body'],_0x16f519['account']['name'],_0x16f519['message']['id'],![],_0x38a159);if(rpc[_0x16f519['channel']+_0xdcb2('0x35')]){return rpc[_0x16f519[_0xdcb2('0x2a')]+'QueueReport'][_0xdcb2('0x3a')](_0x3f7e92,_0x17459a)[_0xdcb2('0x3c')](function(_0x23a42f){logger['error'](_0xdcb2('0x3d'),_0x23a42f);});}}}function handleFindQueue(_0x129eae){return function(_0x3248cc){return _0x3248cc[_0xdcb2('0x34')][_0xdcb2('0x41')]()===_0x129eae[_0xdcb2('0x41')]();};}exports[_0xdcb2('0x42')]=function(_0x18e222,_0x4cb511,_0x1ed9f1,_0x10a991){return function(_0x40dd2e){try{var _0x237cd6={'name':_0x4cb511[0x0],'timeout':_0x4cb511[0x1]};var _0x1e977d=queue[_0xdcb2('0x0')](_0x237cd6,{'typecast':!![]});if(_0x1e977d[_0xdcb2('0x43')]){logger[_0xdcb2('0x37')]('[%s][QUEUE]\x20%s',_0x18e222,_[_0xdcb2('0x44')](_0x1e977d,_0xdcb2('0x2e'))[_0xdcb2('0x45')](',\x20'));_0x40dd2e['stop']();}else{var _0x483a93=_['find'](_0x1ed9f1[_0x10a991[_0xdcb2('0x2a')]+'Queues'],handleFindQueue(_0x237cd6[_0xdcb2('0x34')]));if(_0x483a93){startRouting(_0x18e222,_0x483a93,_0x10a991,_0x1ed9f1);var _0x5fe25e=(_0x483a93[_0xdcb2('0x3f')]||0xa)*0x3e8;var _0xbbe4bc=(_0x237cd6[_0xdcb2('0x3f')]||0x14)*0x3e8;var _0x49a2dd;if(_0x5fe25e>_0xbbe4bc){_0xbbe4bc=_0x5fe25e;}var _0x254a94=seqqueue[_0xdcb2('0x46')](_0x5fe25e);_0x254a94['id']=_0x18e222;_0x254a94[_0xdcb2('0x47')]=_0x5fe25e;_0x254a94[_0xdcb2('0x48')]=_0xbbe4bc;_0x254a94['channel']=_0x10a991[_0xdcb2('0x2a')];_0x1ed9f1[_0xdcb2('0x49')][_0x18e222]['on'](_0xdcb2('0x4a'),function(){logger[_0xdcb2('0x32')](_0xdcb2('0x4b'),_0x18e222);stopRouting(_0x18e222,_0x483a93,_0x10a991,_0x1ed9f1);clearTimeout(_0x49a2dd);_0x49a2dd=undefined;_0x254a94[_0xdcb2('0x4c')](!![]);if(_0x1ed9f1[_0xdcb2('0x49')][_0x18e222]){delete _0x1ed9f1[_0xdcb2('0x49')][_0x18e222];}_0x40dd2e['stop']();});_0x1ed9f1[_0xdcb2('0x49')][_0x18e222]['on'](_0xdcb2('0x4d'),function(){if(_0x1ed9f1[_0xdcb2('0x49')][_0x18e222]){delete _0x1ed9f1[_0xdcb2('0x49')][_0x18e222];}});_0x49a2dd=setTimeout(function(){logger[_0xdcb2('0x32')](_0xdcb2('0x4e'),_0x18e222);endRouting(_0x18e222,_0x483a93,_0x10a991,_0x1ed9f1);clearTimeout(_0x49a2dd);_0x254a94[_0xdcb2('0x4c')](!![]);_0x40dd2e[_0xdcb2('0x4f')]();},_0xbbe4bc);switch(_0x483a93[_0xdcb2('0x50')]){case'rrmemory':strategy[_0xdcb2('0x51')](_0x254a94,_0x483a93,_0x1ed9f1,_0x10a991);break;default:strategy[_0xdcb2('0x52')](_0x254a94,_0x483a93,_0x1ed9f1,_0x10a991);}}else{logger['error'](_0xdcb2('0x53'),_0x18e222,_0x237cd6[_0xdcb2('0x34')]);_0x40dd2e[_0xdcb2('0x54')]();}}}catch(_0x36ba09){logger[_0xdcb2('0x37')](_0xdcb2('0x55'),_0x18e222,_0x36ba09[_0xdcb2('0x56')]);_0x40dd2e['stop']();}};}; \ No newline at end of file +var _0xacf4=['remove','pick','../../rpc/openchannelQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/whatsappInteraction','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','QueueId','channel','MessageId','message','chat','AccountId','info','name','QueueReport','create','catch','create\x20queue\x20report','waiting','accepted','[%s][STOP:QUEUE][NAME:%s]','Interaction','interaction','then','update','update\x20queue\x20report','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','[%s][QUEUE]\x20%s','map','join','stop','Queues','timeout','createQueue','atimeout','qtimeout','rules','end','close','complete','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','beepall','error','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','stack','lodash','util','seq-queue','moment','ioredis','../../../../config/environment','./strategy','redis','localhost','socket.io-emitter','account','from','joinAt','emit','clone','queue_id','queue','capitalize','format','%sQueuesWaitingInteractions','%s:queue:%s','%s_queue_waiting_interaction:%s'];(function(_0x46d14b,_0x147907){var _0x367dfd=function(_0x117d8e){while(--_0x117d8e){_0x46d14b['push'](_0x46d14b['shift']());}};_0x367dfd(++_0x147907);}(_0xacf4,0x1e8));var _0x4acf=function(_0xcdfc4f,_0x8a111a){_0xcdfc4f=_0xcdfc4f-0x0;var _0x3f70d1=_0xacf4[_0xcdfc4f];return _0x3f70d1;};'use strict';var schema=require('validate');var _=require(_0x4acf('0x0'));var util=require(_0x4acf('0x1'));var seqqueue=require(_0x4acf('0x2'));var moment=require(_0x4acf('0x3'));var Redis=require(_0x4acf('0x4'));var config=require(_0x4acf('0x5'));var logger=require('../../../../config/logger')('routing');var strategy=require(_0x4acf('0x6'));config[_0x4acf('0x7')]=_['defaults'](config[_0x4acf('0x7')],{'host':_0x4acf('0x8'),'port':0x18eb});var io=require(_0x4acf('0x9'))(new Redis(config[_0x4acf('0x7')]));var attributes=['id','queue_id',_0x4acf('0xa'),'queue',_0x4acf('0xb'),_0x4acf('0xc')];function emit(_0x359846,_0x494050,_0x202dd2){io['to'](_0x359846)[_0x4acf('0xd')](_0x494050,_0x202dd2);}function emitChannelQueueInteraction(_0x4ca4d1,_0x12fc2a,_0x345235,_0x49bb11,_0x352260,_0x1b9994,_0x2e7f82,_0x4288c9){var _0x8fba09=_[_0x4acf('0xe')](_0x345235);_0x8fba09[_0x4acf('0xf')]=_0x4288c9;_0x8fba09[_0x4acf('0x10')]=_0x12fc2a;_0x8fba09[_0x4acf('0xa')]=_0x49bb11;_0x8fba09['id']=_0x352260;if(_0x1b9994){attributes['push'](_[_0x4acf('0x11')](_0x4ca4d1)+'InteractionId');_0x2e7f82[util[_0x4acf('0x12')](_0x4acf('0x13'),_0x4ca4d1)][_0x352260]=_['pick'](_0x8fba09,attributes);}else{delete _0x2e7f82[util[_0x4acf('0x12')](_0x4acf('0x13'),_0x4ca4d1)][_0x352260];}emit(util[_0x4acf('0x12')](_0x4acf('0x14'),_0x4ca4d1,_0x12fc2a),util[_0x4acf('0x12')](_0x4acf('0x15'),_0x4ca4d1,_0x1b9994?'save':_0x4acf('0x16')),_[_0x4acf('0x17')](_0x8fba09,attributes));}var rpc={'openchannelQueueReport':require(_0x4acf('0x18')),'mailQueueReport':require('../../rpc/mailQueueReport'),'chatQueueReport':require(_0x4acf('0x19')),'smsQueueReport':require(_0x4acf('0x1a')),'faxQueueReport':require(_0x4acf('0x1b')),'whatsappQueueReport':require(_0x4acf('0x1c')),'chatInteraction':require(_0x4acf('0x1d')),'faxInteraction':require('../../rpc/faxInteraction'),'mailInteraction':require('../../rpc/mailInteraction'),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x4acf('0x1e')),'whatsappInteraction':require(_0x4acf('0x1f'))};var queue=schema({'name':{'type':_0x4acf('0x20'),'required':!![],'message':_0x4acf('0x21')},'timeout':{'type':_0x4acf('0x22'),'message':_0x4acf('0x23')}});function startRouting(_0x452023,_0x19f6b8,_0xbd0467,_0x123253){if(_0x452023&&_0x19f6b8&&_0xbd0467){_0x19f6b8['waiting']+=0x1;var _0x479861={'uniqueid':_0x452023,'from':_0xbd0467[_0x4acf('0x24')]?_0xbd0467['body'][_0x4acf('0xb')]:'','joinAt':moment()[_0x4acf('0x12')](_0x4acf('0x25')),'ContactId':_0xbd0467[_0x4acf('0x26')]?_0xbd0467[_0x4acf('0x26')]['id']:null,'ListId':_0xbd0467[_0x4acf('0x27')]?_0xbd0467['list']['id']:null};_0x479861[_[_0x4acf('0x28')](_0xbd0467['channel'])+_0x4acf('0x29')]=_0x19f6b8['id']||null;_0x479861[_[_0x4acf('0x28')](_0xbd0467[_0x4acf('0x2a')])+'InteractionId']=_0xbd0467['interaction']?_0xbd0467['interaction']['id']:null;_0x479861[_[_0x4acf('0x28')](_0xbd0467[_0x4acf('0x2a')])+_0x4acf('0x2b')]=_0xbd0467[_0x4acf('0x2c')]?_0xbd0467[_0x4acf('0x2c')]['id']:null;_0x479861[_[_0x4acf('0x28')](_0xbd0467[_0x4acf('0x2a')])+(_0xbd0467['channel']!==_0x4acf('0x2d')?_0x4acf('0x2e'):'WebsiteId')]=_0xbd0467[_0x4acf('0xa')]?_0xbd0467[_0x4acf('0xa')]['id']:null;logger[_0x4acf('0x2f')](util[_0x4acf('0x12')]('[%s][START:QUEUE][NAME:%s]',_0x452023,_0x19f6b8[_0x4acf('0x30')]));emitChannelQueueInteraction(_0xbd0467['channel'],_0x19f6b8['name'],_0x479861,_0xbd0467[_0x4acf('0xa')]['name'],_0xbd0467[_0x4acf('0x2c')]['id'],!![],_0x123253,_0x19f6b8['id']);if(rpc[_0xbd0467['channel']+_0x4acf('0x31')]){return rpc[_0xbd0467['channel']+_0x4acf('0x31')][_0x4acf('0x32')](_0x479861)[_0x4acf('0x33')](function(_0x577593){logger['error'](_0x4acf('0x34'),_0x577593);});}}}function stopRouting(_0x2d059b,_0x86f29c,_0x7c4cc1,_0x388144){if(_0x2d059b&&_0x86f29c){_0x86f29c[_0x4acf('0x35')]-=0x1;var _0x9f7fc0={'leaveAt':moment()['format'](_0x4acf('0x25')),'acceptAt':moment()[_0x4acf('0x12')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0x4acf('0x36')};logger[_0x4acf('0x2f')](util[_0x4acf('0x12')](_0x4acf('0x37'),_0x2d059b,_0x86f29c[_0x4acf('0x30')]));emitChannelQueueInteraction(_0x7c4cc1[_0x4acf('0x2a')],_0x86f29c['name'],_0x7c4cc1['body'],_0x7c4cc1[_0x4acf('0xa')][_0x4acf('0x30')],_0x7c4cc1['message']['id'],![],_0x388144,_0x86f29c['id']);return rpc[_0x7c4cc1[_0x4acf('0x2a')]+_0x4acf('0x38')]['update'](_0x7c4cc1[_0x4acf('0x39')]['id'],{'queueId':_0x86f29c['id']})[_0x4acf('0x3a')](function(){if(rpc[_0x7c4cc1[_0x4acf('0x2a')]+'QueueReport']){return rpc[_0x7c4cc1[_0x4acf('0x2a')]+_0x4acf('0x31')][_0x4acf('0x3b')](_0x2d059b,_0x9f7fc0)['catch'](function(_0x56fcc1){logger['error'](_0x4acf('0x3c'),_0x56fcc1);});}});}}function endRouting(_0x153216,_0x3ad1c4,_0x16bf33,_0x5c90cd){if(_0x153216&&_0x3ad1c4){_0x3ad1c4['waiting']-=0x1;var _0x11e1b9={'leaveAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()[_0x4acf('0x12')](_0x4acf('0x25')),'reason':'timeout'};logger[_0x4acf('0x2f')](util[_0x4acf('0x12')](_0x4acf('0x3d'),_0x153216,_0x3ad1c4[_0x4acf('0x30')]));emitChannelQueueInteraction(_0x16bf33[_0x4acf('0x2a')],_0x3ad1c4[_0x4acf('0x30')],_0x16bf33[_0x4acf('0x24')],_0x16bf33[_0x4acf('0xa')][_0x4acf('0x30')],_0x16bf33[_0x4acf('0x2c')]['id'],![],_0x5c90cd);if(rpc[_0x16bf33['channel']+_0x4acf('0x31')]){return rpc[_0x16bf33[_0x4acf('0x2a')]+_0x4acf('0x31')][_0x4acf('0x3b')](_0x153216,_0x11e1b9)[_0x4acf('0x33')](function(_0x21a179){logger['error'](_0x4acf('0x3c'),_0x21a179);});}}}function handleFindQueue(_0x145edc){return function(_0x35208c){return _0x35208c[_0x4acf('0x30')][_0x4acf('0x3e')]()===_0x145edc[_0x4acf('0x3e')]();};}exports[_0x4acf('0x3f')]=function(_0x2ebcb0,_0x5ab36f,_0xd51728,_0x5bb848){return function(_0x9fe63b){try{var _0x38ce55={'name':_0x5ab36f[0x0],'timeout':_0x5ab36f[0x1]};var _0x5f41d5=queue['validate'](_0x38ce55,{'typecast':!![]});if(_0x5f41d5['length']){logger['error'](_0x4acf('0x40'),_0x2ebcb0,_[_0x4acf('0x41')](_0x5f41d5,_0x4acf('0x2c'))[_0x4acf('0x42')](',\x20'));_0x9fe63b[_0x4acf('0x43')]();}else{var _0x3a72fc=_['find'](_0xd51728[_0x5bb848[_0x4acf('0x2a')]+_0x4acf('0x44')],handleFindQueue(_0x38ce55[_0x4acf('0x30')]));if(_0x3a72fc){startRouting(_0x2ebcb0,_0x3a72fc,_0x5bb848,_0xd51728);var _0x3a632e=(_0x3a72fc[_0x4acf('0x45')]||0xa)*0x3e8;var _0xa92639=(_0x38ce55[_0x4acf('0x45')]||0x14)*0x3e8;var _0x427267;if(_0x3a632e>_0xa92639){_0xa92639=_0x3a632e;}var _0x3834c0=seqqueue[_0x4acf('0x46')](_0x3a632e);_0x3834c0['id']=_0x2ebcb0;_0x3834c0[_0x4acf('0x47')]=_0x3a632e;_0x3834c0[_0x4acf('0x48')]=_0xa92639;_0x3834c0[_0x4acf('0x2a')]=_0x5bb848[_0x4acf('0x2a')];_0xd51728[_0x4acf('0x49')][_0x2ebcb0]['on'](_0x4acf('0x4a'),function(){logger[_0x4acf('0x2f')]('[%s][QUEUE]\x20ROUTING\x20STOPPED',_0x2ebcb0);stopRouting(_0x2ebcb0,_0x3a72fc,_0x5bb848,_0xd51728);clearTimeout(_0x427267);_0x427267=undefined;_0x3834c0[_0x4acf('0x4b')](!![]);if(_0xd51728[_0x4acf('0x49')][_0x2ebcb0]){delete _0xd51728[_0x4acf('0x49')][_0x2ebcb0];}_0x9fe63b[_0x4acf('0x43')]();});_0xd51728[_0x4acf('0x49')][_0x2ebcb0]['on'](_0x4acf('0x4c'),function(){if(_0xd51728[_0x4acf('0x49')][_0x2ebcb0]){delete _0xd51728[_0x4acf('0x49')][_0x2ebcb0];}});_0x427267=setTimeout(function(){logger[_0x4acf('0x2f')](_0x4acf('0x4d'),_0x2ebcb0);endRouting(_0x2ebcb0,_0x3a72fc,_0x5bb848,_0xd51728);clearTimeout(_0x427267);_0x3834c0[_0x4acf('0x4b')](!![]);_0x9fe63b[_0x4acf('0x4e')]();},_0xa92639);switch(_0x3a72fc[_0x4acf('0x4f')]){case _0x4acf('0x50'):strategy[_0x4acf('0x50')](_0x3834c0,_0x3a72fc,_0xd51728,_0x5bb848);break;default:strategy[_0x4acf('0x51')](_0x3834c0,_0x3a72fc,_0xd51728,_0x5bb848);}}else{logger[_0x4acf('0x52')](_0x4acf('0x53'),_0x2ebcb0,_0x38ce55['name']);_0x9fe63b[_0x4acf('0x43')]();}}}catch(_0x402085){logger[_0x4acf('0x52')](_0x4acf('0x40'),_0x2ebcb0,_0x402085[_0x4acf('0x54')]);_0x9fe63b[_0x4acf('0x43')]();}};}; \ 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 d0cdeb0..0415786 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 _0x7bae=['[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','agents','channel','busy','busyQueue','saveWaitingNotification','showNotification','RINGING',':FORCED','debug','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','writeLog','TIMEOUT','./util','../../../../../config/logger','notificationId','squeue','agent','realtime','routing','push','handleRun','bind','handleTimeout','drained','handleDrained','prototype','[%s][AGENT]\x20try\x20with\x20%s'];(function(_0xb6160,_0x206fdb){var _0xce706e=function(_0x581daa){while(--_0x581daa){_0xb6160['push'](_0xb6160['shift']());}};_0xce706e(++_0x206fdb);}(_0x7bae,0x13b));var _0xe7ba=function(_0x125ff8,_0x41925f){_0x125ff8=_0x125ff8-0x0;var _0x2d9ef=_0x7bae[_0x125ff8];return _0x2d9ef;};'use strict';var _=require('lodash');var uuid=require('uuid');var util=require(_0xe7ba('0x0'));var logger=require(_0xe7ba('0x1'))('routing');var Agent=function(_0x3963c7,_0x4f2e91,_0x120efa,_0x10908b){this[_0xe7ba('0x2')]=uuid['v4']();this[_0xe7ba('0x3')]=_0x3963c7;this[_0xe7ba('0x4')]=_0x4f2e91;this[_0xe7ba('0x5')]=_0x120efa;this[_0xe7ba('0x6')]=_0x10908b;this[_0xe7ba('0x3')][_0xe7ba('0x7')](this[_0xe7ba('0x8')][_0xe7ba('0x9')](this),this[_0xe7ba('0xa')][_0xe7ba('0x9')](this));this[_0xe7ba('0x3')]['on']('timeout',this[_0xe7ba('0xa')][_0xe7ba('0x9')](this));this[_0xe7ba('0x3')]['on'](_0xe7ba('0xb'),this[_0xe7ba('0xc')][_0xe7ba('0x9')](this));};Agent[_0xe7ba('0xd')][_0xe7ba('0x7')]=function(){this[_0xe7ba('0x3')]['push'](this[_0xe7ba('0x8')]['bind'](this),this[_0xe7ba('0xa')][_0xe7ba('0x9')](this));};Agent[_0xe7ba('0xd')][_0xe7ba('0xc')]=function(){this[_0xe7ba('0xa')](!![]);};Agent[_0xe7ba('0xd')]['handleRun']=function(){logger['debug'](_0xe7ba('0xe'),this[_0xe7ba('0x3')]['id'],this[_0xe7ba('0x4')]['id']);if(_['isNil'](this[_0xe7ba('0x5')]['agents'][this['agent']['id']])){logger['debug'](_0xe7ba('0xf'),this['squeue']['id'],this[_0xe7ba('0x4')]['id']);setTimeout(this['push']['bind'](this),0x3e8);}else{if(this['routing'][_0xe7ba('0x10')]||util[_0xe7ba('0x11')](this[_0xe7ba('0x3')]['id'],this[_0xe7ba('0x5')][_0xe7ba('0x12')][this['agent']['id']],this[_0xe7ba('0x3')][_0xe7ba('0x13')],![])){this[_0xe7ba('0x5')][_0xe7ba('0x12')][this['agent']['id']][_0xe7ba('0x14')]=!![];this[_0xe7ba('0x5')]['agents'][this[_0xe7ba('0x4')]['id']][_0xe7ba('0x15')]=undefined;util[_0xe7ba('0x16')](this[_0xe7ba('0x5')],this[_0xe7ba('0x6')],this[_0xe7ba('0x4')],this[_0xe7ba('0x3')][_0xe7ba('0x13')]);util[_0xe7ba('0x17')](this[_0xe7ba('0x2')],this['squeue']['id'],this['realtime']['agents'][this['agent']['id']],null,this[_0xe7ba('0x6')]);util['writeLog'](this['squeue']['id'],this['realtime'][_0xe7ba('0x12')][this[_0xe7ba('0x4')]['id']],_0xe7ba('0x18')+(this[_0xe7ba('0x6')][_0xe7ba('0x10')]?_0xe7ba('0x19'):''));}else{logger[_0xe7ba('0x1a')](_0xe7ba('0x1b'),this['squeue']['id'],this[_0xe7ba('0x4')]['id']);setTimeout(this['push'][_0xe7ba('0x9')](this),0x3e8);}}};Agent[_0xe7ba('0xd')][_0xe7ba('0xa')]=function(_0x4bf5f9){if(_['isNil'](this[_0xe7ba('0x5')][_0xe7ba('0x12')][this[_0xe7ba('0x4')]['id']])){return logger[_0xe7ba('0x1a')](_0xe7ba('0xf'),this['squeue']['id'],this[_0xe7ba('0x4')]['id']);}else{logger[_0xe7ba('0x1a')]('[%s][AGENT]\x20timeout\x20with\x20%s',this[_0xe7ba('0x3')]['id'],this['agent']['id']);util['hideNotification'](this[_0xe7ba('0x2')],this[_0xe7ba('0x3')]['id'],this[_0xe7ba('0x5')]['agents'][this[_0xe7ba('0x4')]['id']],null,this['routing']);this[_0xe7ba('0x5')][_0xe7ba('0x12')][this[_0xe7ba('0x4')]['id']][_0xe7ba('0x14')]=![];this[_0xe7ba('0x5')]['agents'][this[_0xe7ba('0x4')]['id']][_0xe7ba('0x15')]=undefined;util['removeWaitingNotification'](this[_0xe7ba('0x5')],this[_0xe7ba('0x6')],this[_0xe7ba('0x4')],this['squeue'][_0xe7ba('0x13')]);util[_0xe7ba('0x1c')](this['squeue']['id'],this[_0xe7ba('0x5')][_0xe7ba('0x12')][this[_0xe7ba('0x4')]['id']],_0x4bf5f9?'STOP':_0xe7ba('0x1d'));}if(!_0x4bf5f9){setTimeout(this[_0xe7ba('0x7')]['bind'](this),0x3e8);}};function agent(_0x330e98,_0x3182d9,_0x8a5776,_0x582833){return new Agent(_0x330e98,_0x3182d9,_0x8a5776,_0x582833);}module['exports']=agent; \ No newline at end of file +var _0xdb94=['agents','channel','busy','busyQueue','showNotification','notificationId','writeLog','forcedOwnership','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','removeWaitingNotification','exports','uuid','./util','routing','squeue','realtime','push','handleRun','handleTimeout','bind','timeout','drained','handleDrained','prototype','debug','[%s][AGENT]\x20try\x20with\x20%s','isNil','agent','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable'];(function(_0x32b542,_0x4512fa){var _0x554d54=function(_0x35cdfc){while(--_0x35cdfc){_0x32b542['push'](_0x32b542['shift']());}};_0x554d54(++_0x4512fa);}(_0xdb94,0xe5));var _0x4db9=function(_0x321b25,_0x558ca2){_0x321b25=_0x321b25-0x0;var _0x16516e=_0xdb94[_0x321b25];return _0x16516e;};'use strict';var _=require('lodash');var uuid=require(_0x4db9('0x0'));var util=require(_0x4db9('0x1'));var logger=require('../../../../../config/logger')(_0x4db9('0x2'));var Agent=function(_0x3b24a6,_0x25b510,_0x2e85f4,_0x1f05d4){this['notificationId']=uuid['v4']();this[_0x4db9('0x3')]=_0x3b24a6;this['agent']=_0x25b510;this[_0x4db9('0x4')]=_0x2e85f4;this[_0x4db9('0x2')]=_0x1f05d4;this[_0x4db9('0x3')][_0x4db9('0x5')](this[_0x4db9('0x6')]['bind'](this),this[_0x4db9('0x7')][_0x4db9('0x8')](this));this[_0x4db9('0x3')]['on'](_0x4db9('0x9'),this[_0x4db9('0x7')]['bind'](this));this[_0x4db9('0x3')]['on'](_0x4db9('0xa'),this[_0x4db9('0xb')][_0x4db9('0x8')](this));};Agent[_0x4db9('0xc')][_0x4db9('0x5')]=function(){this['squeue'][_0x4db9('0x5')](this[_0x4db9('0x6')]['bind'](this),this['handleTimeout'][_0x4db9('0x8')](this));};Agent[_0x4db9('0xc')][_0x4db9('0xb')]=function(){this['handleTimeout'](!![]);};Agent[_0x4db9('0xc')][_0x4db9('0x6')]=function(){logger[_0x4db9('0xd')](_0x4db9('0xe'),this[_0x4db9('0x3')]['id'],this['agent']['id']);if(_[_0x4db9('0xf')](this[_0x4db9('0x4')]['agents'][this[_0x4db9('0x10')]['id']])){logger[_0x4db9('0xd')](_0x4db9('0x11'),this['squeue']['id'],this[_0x4db9('0x10')]['id']);setTimeout(this[_0x4db9('0x5')]['bind'](this),0x3e8);}else{if(this['routing']['forcedOwnership']||util[_0x4db9('0x12')](this[_0x4db9('0x3')]['id'],this['realtime'][_0x4db9('0x13')][this[_0x4db9('0x10')]['id']],this[_0x4db9('0x3')][_0x4db9('0x14')],![])){this[_0x4db9('0x4')][_0x4db9('0x13')][this[_0x4db9('0x10')]['id']][_0x4db9('0x15')]=!![];this[_0x4db9('0x4')][_0x4db9('0x13')][this[_0x4db9('0x10')]['id']][_0x4db9('0x16')]=undefined;util['saveWaitingNotification'](this[_0x4db9('0x4')],this[_0x4db9('0x2')],this['agent'],this[_0x4db9('0x3')][_0x4db9('0x14')]);util[_0x4db9('0x17')](this[_0x4db9('0x18')],this['squeue']['id'],this[_0x4db9('0x4')]['agents'][this[_0x4db9('0x10')]['id']],null,this[_0x4db9('0x2')]);util[_0x4db9('0x19')](this[_0x4db9('0x3')]['id'],this[_0x4db9('0x4')][_0x4db9('0x13')][this[_0x4db9('0x10')]['id']],'RINGING'+(this['routing'][_0x4db9('0x1a')]?':FORCED':''));}else{logger[_0x4db9('0xd')](_0x4db9('0x1b'),this[_0x4db9('0x3')]['id'],this[_0x4db9('0x10')]['id']);setTimeout(this[_0x4db9('0x5')][_0x4db9('0x8')](this),0x3e8);}}};Agent[_0x4db9('0xc')][_0x4db9('0x7')]=function(_0x4c4a47){if(_[_0x4db9('0xf')](this['realtime'][_0x4db9('0x13')][this[_0x4db9('0x10')]['id']])){return logger[_0x4db9('0xd')](_0x4db9('0x11'),this[_0x4db9('0x3')]['id'],this['agent']['id']);}else{logger[_0x4db9('0xd')](_0x4db9('0x1c'),this[_0x4db9('0x3')]['id'],this[_0x4db9('0x10')]['id']);util['hideNotification'](this['notificationId'],this[_0x4db9('0x3')]['id'],this[_0x4db9('0x4')]['agents'][this['agent']['id']],null,this[_0x4db9('0x2')]);this['realtime']['agents'][this[_0x4db9('0x10')]['id']][_0x4db9('0x15')]=![];this['realtime'][_0x4db9('0x13')][this[_0x4db9('0x10')]['id']][_0x4db9('0x16')]=undefined;util[_0x4db9('0x1d')](this['realtime'],this[_0x4db9('0x2')],this['agent'],this['squeue']['channel']);util[_0x4db9('0x19')](this[_0x4db9('0x3')]['id'],this['realtime'][_0x4db9('0x13')][this[_0x4db9('0x10')]['id']],_0x4c4a47?'STOP':'TIMEOUT');}if(!_0x4c4a47){setTimeout(this['push'][_0x4db9('0x8')](this),0x3e8);}};function agent(_0x52613e,_0x29dc69,_0x52711a,_0xaf383e){return new Agent(_0x52613e,_0x29dc69,_0x52711a,_0xaf383e);}module[_0x4db9('0x1e')]=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 e4739e6..da1589c 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 _0x460f=['routing','squeue','queue','realtime','push','bind','handleTimeout','drained','handleDrained','handleRun','isNil','Agents','length','agents','debug','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','channel','busy','busyQueue','name','showNotification','[%s][QUEUE]\x20EMPTY','hideNotification','writeLog','removeWaitingNotification','exports','lodash','uuid','./util'];(function(_0x58fac8,_0x5ec989){var _0x4a560e=function(_0x1edf34){while(--_0x1edf34){_0x58fac8['push'](_0x58fac8['shift']());}};_0x4a560e(++_0x5ec989);}(_0x460f,0x10b));var _0xf460=function(_0x142776,_0x266157){_0x142776=_0x142776-0x0;var _0x4ed181=_0x460f[_0x142776];return _0x4ed181;};'use strict';var _=require(_0xf460('0x0'));var uuid=require(_0xf460('0x1'));var util=require(_0xf460('0x2'));var logger=require('../../../../../config/logger')(_0xf460('0x3'));var Beepall=function(_0x4fe103,_0x10bd66,_0x5848cd,_0x430b4a){this['notificationId']=uuid['v4']();this[_0xf460('0x4')]=_0x4fe103;this[_0xf460('0x5')]=_0x10bd66;this[_0xf460('0x6')]=_0x5848cd;this[_0xf460('0x3')]=_0x430b4a;this['squeue'][_0xf460('0x7')](this['handleRun'][_0xf460('0x8')](this),this[_0xf460('0x9')]['bind'](this));this[_0xf460('0x4')]['on']('timeout',this[_0xf460('0x9')]['bind'](this));this[_0xf460('0x4')]['on'](_0xf460('0xa'),this[_0xf460('0xb')][_0xf460('0x8')](this));};Beepall['prototype']['push']=function(){this[_0xf460('0x4')][_0xf460('0x7')](this['handleRun'][_0xf460('0x8')](this),this[_0xf460('0x9')][_0xf460('0x8')](this));};Beepall['prototype'][_0xf460('0xb')]=function(){this[_0xf460('0x9')](!![]);};Beepall['prototype'][_0xf460('0xc')]=function(){var _0x3ebda7=!![];if(!_[_0xf460('0xd')](this['queue'])&&!_['isNil'](this[_0xf460('0x5')][_0xf460('0xe')])&&this[_0xf460('0x5')][_0xf460('0xe')][_0xf460('0xf')]>0x0){for(var _0x86cac3=0x0,_0x513cd2;_0x86cac30x0){for(var _0x5eae31=0x0,_0x461b5e;_0x5eae310x0&&_0x1a9e97[_0x167682+_0x6213('0x22')]>=_0x1a9e97[_0x167682+_0x6213('0x21')]){writeLog(_0x40f5ac,_0x1a9e97,_0x167682[_0x6213('0x23')]()+_0x6213('0x24'));return![];}}return!![];};exports[_0x6213('0x25')]=function(_0x461289,_0x11bb9d,_0x3ed96a,_0x5407a6,_0x5f42a8){return sendNotification(!![],_0x461289,_0x11bb9d,_0x3ed96a,_0x5407a6,_0x5f42a8);};exports[_0x6213('0x26')]=function(_0x11881d,_0x3ccd2b,_0x1415c1,_0x3f961a,_0x3b4735){return sendNotification(![],_0x11881d,_0x3ccd2b,_0x1415c1,_0x3f961a,_0x3b4735);};exports[_0x6213('0x27')]=function(_0x29e86e,_0x58f30b,_0xacf549){var _0x14aa5c=_0x58f30b['interaction'][_0x6213('0x28')];if(!_0x14aa5c&&_0xacf549){_0x14aa5c=_0xacf549['id'];}var _0x224039=_['some'](_0x29e86e[_0x58f30b['channel']+_0x6213('0x29')],function(_0x2df3ec){var _0x1289c4=_[_0x6213('0x2a')](_0x58f30b[_0x6213('0x2b')])+'InteractionId';return _0x2df3ec[_0x1289c4]===_0x58f30b[_0x6213('0x2c')]['id'];});if(!_0x224039&&_0x14aa5c&&_0x29e86e[_0x6213('0x2d')][_0x14aa5c]){_0x224039=_[_0x6213('0x2e')](_0x29e86e[_0x6213('0x2d')][_0x14aa5c][_0x58f30b[_0x6213('0x2b')]+_0x6213('0x2f')],function(_0x3da972){return _0x3da972['id']===_0x58f30b[_0x6213('0x2c')]['id'];});}return _0x224039;};exports[_0x6213('0x30')]=function(_0x18c994,_0x44cd5f,_0x57d825,_0x3ec389){if(_0x57d825&&_0x57d825['id']&&_0x18c994[_0x6213('0x2d')]&&_0x18c994[_0x6213('0x2d')][_0x57d825['id']]){_0x18c994[_0x6213('0x2d')][_0x57d825['id']][_0x3ec389+_0x6213('0x2f')][_0x44cd5f[_0x6213('0x31')]['id']]={'id':_0x44cd5f[_0x6213('0x2c')]['id']};}};exports['removeWaitingNotification']=function(_0x16990f,_0x240088,_0x9640d7,_0x3a630d){if(_0x9640d7&&_0x9640d7['id']&&_0x16990f[_0x6213('0x2d')]&&_0x16990f[_0x6213('0x2d')][_0x9640d7['id']]){delete _0x16990f[_0x6213('0x2d')][_0x9640d7['id']][_0x3a630d+'WaitingInteractions'][_0x240088['message']['id']];}};exports[_0x6213('0x32')]=writeLog; \ No newline at end of file +var _0x7fee=['capitalize','agents','saveWaitingNotification','WaitingInteractions','removeWaitingNotification','writeLog','lodash','util','../utils','ioredis','../../../../../config/environment','../../../../../config/logger','redis','defaults','socket.io-emitter','\x20interaction','account','notificationSound','body','queue','msg','getMustacheRender','notificationTemplate','I\x20can\x27t\x20render\x20your\x20template','error','format','[%s][QUEUE]\x20%s','message','user:%s','name','emit','notification:%s','save','remove','debug','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','BUSY','OFFLINE','PAUSE','hasOwnProperty','Capacity','CurrentCapacity','toUpperCase','\x20MAXCAPACITY','showNotification','hideNotification','checkWaitingNotifications','interaction','UserId','channel','QueuesWaitingInteractions'];(function(_0x56a0bd,_0x2e755e){var _0x28a46e=function(_0x38d4ee){while(--_0x38d4ee){_0x56a0bd['push'](_0x56a0bd['shift']());}};_0x28a46e(++_0x2e755e);}(_0x7fee,0x1a6));var _0xe7fe=function(_0x2f1762,_0xab43df){_0x2f1762=_0x2f1762-0x0;var _0x8ab21=_0x7fee[_0x2f1762];return _0x8ab21;};'use strict';var _=require(_0xe7fe('0x0'));var util=require(_0xe7fe('0x1'));var utils=require(_0xe7fe('0x2'));var Redis=require(_0xe7fe('0x3'));var config=require(_0xe7fe('0x4'));var logger=require(_0xe7fe('0x5'))('routing');config[_0xe7fe('0x6')]=_[_0xe7fe('0x7')](config[_0xe7fe('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0xe7fe('0x8'))(new Redis(config['redis']));function sendNotification(_0x183b0b,_0xeca7d9,_0x25a6a4,_0x9b55e8,_0x1f3366,_0xf5e41b){var _0xe91ed8=_0xf5e41b||{};var _0x4a72d6=_0x25a6a4['split']('.');var _0x592924={'uniqueid':_0xeca7d9,'channel':_0x4a72d6[0x0],'id':_0x4a72d6[0x1],'title':_0x4a72d6[0x0]+_0xe7fe('0x9'),'interactionId':_0x4a72d6[0x2],'queue':_0x1f3366?_0x1f3366['name']:null,'sound':_0xe91ed8[_0xe7fe('0xa')][_0xe7fe('0xb')],'shake':_0xe91ed8['account']['notificationShake']};try{if(!_0xe91ed8[_0xe7fe('0xc')]){_0xe91ed8[_0xe7fe('0xc')]={};}if(_0x1f3366){_0xe91ed8['body'][_0xe7fe('0xd')]=_0x1f3366;}else if(_0xe91ed8[_0xe7fe('0xc')][_0xe7fe('0xd')]){delete _0xe91ed8['body'][_0xe7fe('0xd')];}_0x592924[_0xe7fe('0xe')]=utils[_0xe7fe('0xf')](_0xe91ed8['account'][_0xe7fe('0x10')],_0xe91ed8);}catch(_0x29e745){_0x592924[_0xe7fe('0xe')]=_0xe7fe('0x11');logger[_0xe7fe('0x12')](util[_0xe7fe('0x13')](_0xe7fe('0x14'),_0xeca7d9,_0x29e745[_0xe7fe('0x15')]));}io['to'](util[_0xe7fe('0x13')](_0xe7fe('0x16'),_0x9b55e8[_0xe7fe('0x17')]))[_0xe7fe('0x18')](util[_0xe7fe('0x13')](_0xe7fe('0x19'),_0x183b0b?_0xe7fe('0x1a'):_0xe7fe('0x1b')),_0x592924);}function writeLog(_0x5e16a8,_0x1390ea,_0x1c2594){return logger[_0xe7fe('0x1c')](util[_0xe7fe('0x13')](_0xe7fe('0x1d'),_0x5e16a8,_0x1390ea['name'],_0x1c2594));}exports[_0xe7fe('0x1e')]=function(_0x3c3945,_0x2cbe81,_0x584779,_0x11fdf3){if(_0x2cbe81['busy']){writeLog(_0x3c3945,_0x2cbe81,_0xe7fe('0x1f'));return![];}if(!_0x2cbe81['online']){writeLog(_0x3c3945,_0x2cbe81,_0xe7fe('0x20'));return![];}if(_0x2cbe81[_0x584779+'Pause']){writeLog(_0x3c3945,_0x2cbe81,_0xe7fe('0x21'));return![];}if(_0x11fdf3&&_0x2cbe81[_0xe7fe('0x22')](_0x584779+_0xe7fe('0x23'))&&_0x2cbe81[_0xe7fe('0x22')](_0x584779+_0xe7fe('0x24'))){if(_0x2cbe81[_0x584779+_0xe7fe('0x23')]>0x0&&_0x2cbe81[_0x584779+_0xe7fe('0x24')]>=_0x2cbe81[_0x584779+_0xe7fe('0x23')]){writeLog(_0x3c3945,_0x2cbe81,_0x584779[_0xe7fe('0x25')]()+_0xe7fe('0x26'));return![];}}return!![];};exports[_0xe7fe('0x27')]=function(_0x3256be,_0x34652a,_0x452af3,_0x218dbd,_0x21504b){return sendNotification(!![],_0x3256be,_0x34652a,_0x452af3,_0x218dbd,_0x21504b);};exports[_0xe7fe('0x28')]=function(_0x22909d,_0x5d464e,_0x1d230d,_0x536bd9,_0x28d237){return sendNotification(![],_0x22909d,_0x5d464e,_0x1d230d,_0x536bd9,_0x28d237);};exports[_0xe7fe('0x29')]=function(_0x5a8650,_0x48fa94,_0x2adb68){var _0x115208=_0x48fa94[_0xe7fe('0x2a')][_0xe7fe('0x2b')];if(!_0x115208&&_0x2adb68){_0x115208=_0x2adb68['id'];}var _0x174b14=_['some'](_0x5a8650[_0x48fa94[_0xe7fe('0x2c')]+_0xe7fe('0x2d')],function(_0x48962d){var _0x4dcd4a=_[_0xe7fe('0x2e')](_0x48fa94[_0xe7fe('0x2c')])+'InteractionId';return _0x48962d[_0x4dcd4a]===_0x48fa94['interaction']['id'];});if(!_0x174b14&&_0x115208&&_0x5a8650[_0xe7fe('0x2f')][_0x115208]){_0x174b14=_['some'](_0x5a8650[_0xe7fe('0x2f')][_0x115208][_0x48fa94[_0xe7fe('0x2c')]+'WaitingInteractions'],function(_0x4cb436){return _0x4cb436['id']===_0x48fa94[_0xe7fe('0x2a')]['id'];});}return _0x174b14;};exports[_0xe7fe('0x30')]=function(_0x197893,_0xfcb0bd,_0xcb205b,_0x1e5f4b){if(_0xcb205b&&_0xcb205b['id']&&_0x197893[_0xe7fe('0x2f')]&&_0x197893[_0xe7fe('0x2f')][_0xcb205b['id']]){_0x197893[_0xe7fe('0x2f')][_0xcb205b['id']][_0x1e5f4b+_0xe7fe('0x31')][_0xfcb0bd['message']['id']]={'id':_0xfcb0bd[_0xe7fe('0x2a')]['id']};}};exports[_0xe7fe('0x32')]=function(_0x1d5ae1,_0x155556,_0x301ea2,_0x330d18){if(_0x301ea2&&_0x301ea2['id']&&_0x1d5ae1[_0xe7fe('0x2f')]&&_0x1d5ae1[_0xe7fe('0x2f')][_0x301ea2['id']]){delete _0x1d5ae1[_0xe7fe('0x2f')][_0x301ea2['id']][_0x330d18+_0xe7fe('0x31')][_0x155556[_0xe7fe('0x15')]['id']];}};exports[_0xe7fe('0x33')]=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 28ac90f..9406834 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 _0x0f67=['message','join','info','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isEmpty','[%s][SYSTEM]\x20no\x20variable','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','isObject','stringify','lodash','./utils','../../../../config/logger','routing','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','validate','length','error','[%s][SYSTEM]\x20%s','map'];(function(_0x56756b,_0x3e8cc7){var _0xa3002=function(_0x5f1386){while(--_0x5f1386){_0x56756b['push'](_0x56756b['shift']());}};_0xa3002(++_0x3e8cc7);}(_0x0f67,0xab));var _0x70f6=function(_0x1f0533,_0x12f344){_0x1f0533=_0x1f0533-0x0;var _0x498dd3=_0x0f67[_0x1f0533];return _0x498dd3;};'use strict';var schema=require('validate');var sh=require('shelljs');var _=require(_0x70f6('0x0'));var utils=require(_0x70f6('0x1'));var logger=require(_0x70f6('0x2'))(_0x70f6('0x3'));var system=schema({'command':{'type':'string','required':!![],'message':_0x70f6('0x4')}});exports[_0x70f6('0x5')]=function(_0x5a8f60,_0x1d94fb){return function(_0x3fc804){try{var _0x34ecf0={'command':_0x1d94fb[0x0]};var _0x138109=system[_0x70f6('0x6')](_0x34ecf0,{'typecast':!![]});if(_0x138109[_0x70f6('0x7')]){logger[_0x70f6('0x8')](_0x70f6('0x9'),_0x5a8f60,_[_0x70f6('0xa')](_0x138109,_0x70f6('0xb'))[_0x70f6('0xc')](',\x20'));logger[_0x70f6('0xd')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x5a8f60);_0x3fc804[_0x70f6('0xe')]();}else{var _0x5101c0=this;var _0x2dc2e2=utils[_0x70f6('0xf')](_0x1d94fb[0x0],this);logger[_0x70f6('0xd')](_0x70f6('0x10'),_0x5a8f60,_0x2dc2e2);sh[_0x70f6('0x11')](_[_0x70f6('0x12')](_0x2dc2e2),function(_0x4f2bf4,_0x45b0d8){logger[_0x70f6('0xd')](_0x70f6('0x13'),_0x5a8f60,_0x4f2bf4);if(_0x4f2bf4==0x0){var _0xcf1316=_0x45b0d8[_0x70f6('0x14')](/(\r\n|\n|\r)/gm,'');if(_['isNil'](_0x1d94fb[0x1])||_[_0x70f6('0x15')](_0x1d94fb[0x1])){logger[_0x70f6('0xd')](_0x70f6('0x16'),_0x5a8f60);_0x5101c0['body'][_0x1d94fb[0x1]]=_0xcf1316;}else{logger[_0x70f6('0xd')](_0x70f6('0x17'),_0x5a8f60,_0x1d94fb[0x1],_0xcf1316);_0x5101c0['body'][_0x1d94fb[0x1]]=_0xcf1316;}}_0x3fc804['next']();});}}catch(_0x480759){logger[_0x70f6('0x8')](_0x70f6('0x9'),_0x5a8f60,_[_0x70f6('0x18')](_0x480759)?JSON[_0x70f6('0x19')](_0x480759):_0x480759);logger['info']('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x5a8f60);_0x3fc804[_0x70f6('0xe')]();}};}; \ No newline at end of file +var _0x5615=['replace','isNil','isEmpty','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','error','validate','shelljs','../../../../config/logger','routing','string','consequence','length','[%s][SYSTEM]\x20%s','message','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','trim','[%s][SYSTEM]\x20result\x20code:\x20%s'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0x5615,0xa0));var _0x5561=function(_0x279a51,_0xf5640b){_0x279a51=_0x279a51-0x0;var _0x29c2b5=_0x5615[_0x279a51];return _0x29c2b5;};'use strict';var schema=require(_0x5561('0x0'));var sh=require(_0x5561('0x1'));var _=require('lodash');var utils=require('./utils');var logger=require(_0x5561('0x2'))(_0x5561('0x3'));var system=schema({'command':{'type':_0x5561('0x4'),'required':!![],'message':'command\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0x5561('0x5')]=function(_0x389854,_0x35f851){return function(_0x4b281a){try{var _0x3aaddb={'command':_0x35f851[0x0]};var _0x1ef83c=system[_0x5561('0x0')](_0x3aaddb,{'typecast':!![]});if(_0x1ef83c[_0x5561('0x6')]){logger['error'](_0x5561('0x7'),_0x389854,_['map'](_0x1ef83c,_0x5561('0x8'))['join'](',\x20'));logger[_0x5561('0x9')](_0x5561('0xa'),_0x389854);_0x4b281a[_0x5561('0xb')]();}else{var _0x30bac3=this;var _0x4fcb27=utils[_0x5561('0xc')](_0x35f851[0x0],this);logger['info'](_0x5561('0xd'),_0x389854,_0x4fcb27);sh['exec'](_[_0x5561('0xe')](_0x4fcb27),function(_0x15f695,_0x346689){logger[_0x5561('0x9')](_0x5561('0xf'),_0x389854,_0x15f695);if(_0x15f695==0x0){var _0x2428e7=_0x346689[_0x5561('0x10')](/(\r\n|\n|\r)/gm,'');if(_[_0x5561('0x11')](_0x35f851[0x1])||_[_0x5561('0x12')](_0x35f851[0x1])){logger[_0x5561('0x9')]('[%s][SYSTEM]\x20no\x20variable',_0x389854);_0x30bac3[_0x5561('0x13')][_0x35f851[0x1]]=_0x2428e7;}else{logger[_0x5561('0x9')](_0x5561('0x14'),_0x389854,_0x35f851[0x1],_0x2428e7);_0x30bac3[_0x5561('0x13')][_0x35f851[0x1]]=_0x2428e7;}}_0x4b281a['next']();});}}catch(_0x1b18f1){logger[_0x5561('0x15')](_0x5561('0x7'),_0x389854,_['isObject'](_0x1b18f1)?JSON['stringify'](_0x1b18f1):_0x1b18f1);logger[_0x5561('0x9')](_0x5561('0xa'),_0x389854);_0x4b281a[_0x5561('0xb')]();}};}; \ 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 b8943e7..bcc2fbb 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 _0xcda3=['interaction','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','stringify','finally','isObject','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][TAG]\x20%s','map','message','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','addTags'];(function(_0x2bb1fe,_0x4ec16a){var _0x4e7e01=function(_0x27eb3a){while(--_0x27eb3a){_0x2bb1fe['push'](_0x2bb1fe['shift']());}};_0x4e7e01(++_0x4ec16a);}(_0xcda3,0x128));var _0x3cda=function(_0x556bb1,_0x34830d){_0x556bb1=_0x556bb1-0x0;var _0x45455f=_0xcda3[_0x556bb1];return _0x45455f;};'use strict';var schema=require(_0x3cda('0x0'));var _=require(_0x3cda('0x1'));var rpc={'chatInteraction':require(_0x3cda('0x2')),'openchannelInteraction':require(_0x3cda('0x3')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0x3cda('0x4')),'faxInteraction':require(_0x3cda('0x5')),'whatsappInteraction':require(_0x3cda('0x6'))};var logger=require(_0x3cda('0x7'))(_0x3cda('0x8'));var tag=schema({'tag':{'type':_0x3cda('0x9'),'required':!![],'message':_0x3cda('0xa')}});exports[_0x3cda('0xb')]=function(_0x364634,_0x318f98,_0x862f64,_0x85f129){return function(_0xe1f608){try{var _0xa161e5={'tag':_0x318f98[0x0]};var _0x28084d=tag[_0x3cda('0x0')](_0xa161e5,{'typecast':!![]});if(_0x28084d[_0x3cda('0xc')]){logger[_0x3cda('0xd')](_0x3cda('0xe'),_0x364634,_[_0x3cda('0xf')](_0x28084d,_0x3cda('0x10'))['join'](',\x20'));logger[_0x3cda('0x11')](_0x3cda('0x12'),_0x364634);_0xe1f608[_0x3cda('0x13')]();}else{var _0x26607d={'ids':[_0x318f98[0x0]]};if(rpc[_0x85f129[_0x3cda('0x14')]+'Interaction']){rpc[_0x85f129[_0x3cda('0x14')]+_0x3cda('0x15')][_0x3cda('0x16')](_0x85f129[_0x3cda('0x17')]['id'],_0x26607d)[_0x3cda('0x18')](function(_0x159d98){logger[_0x3cda('0x11')](_0x3cda('0x19'),_0x364634,_0x318f98[0x1],_0x85f129[_0x3cda('0x14')],_0x85f129['interaction']['id']);})['catch'](function(_0x194b26){logger[_0x3cda('0xd')](_0x3cda('0xe'),_0x364634,JSON[_0x3cda('0x1a')](_0x194b26));logger[_0x3cda('0x11')](_0x3cda('0x12'),_0x364634);})[_0x3cda('0x1b')](function(){_0xe1f608[_0x3cda('0x13')]();});}}}catch(_0x2cc4d8){logger[_0x3cda('0xd')](_0x3cda('0xe'),_0x364634,_[_0x3cda('0x1c')](_0x2cc4d8)?JSON[_0x3cda('0x1a')](_0x2cc4d8):_0x2cc4d8);logger[_0x3cda('0x11')](_0x3cda('0x12'),_0x364634);_0xe1f608[_0x3cda('0x13')]();}};}; \ No newline at end of file +var _0x155b=['error','[%s][TAG]\x20%s','map','message','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','interaction','then','catch','stringify','finally','isObject','validate','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length'];(function(_0x558b27,_0x420951){var _0x1caf94=function(_0x3a8c3e){while(--_0x3a8c3e){_0x558b27['push'](_0x558b27['shift']());}};_0x1caf94(++_0x420951);}(_0x155b,0x1d0));var _0xb155=function(_0xf35672,_0x3833af){_0xf35672=_0xf35672-0x0;var _0x26afcf=_0x155b[_0xf35672];return _0x26afcf;};'use strict';var schema=require(_0xb155('0x0'));var _=require('lodash');var rpc={'chatInteraction':require(_0xb155('0x1')),'openchannelInteraction':require(_0xb155('0x2')),'smsInteraction':require(_0xb155('0x3')),'mailInteraction':require(_0xb155('0x4')),'faxInteraction':require(_0xb155('0x5')),'whatsappInteraction':require(_0xb155('0x6'))};var logger=require(_0xb155('0x7'))('routing');var tag=schema({'tag':{'type':_0xb155('0x8'),'required':!![],'message':_0xb155('0x9')}});exports[_0xb155('0xa')]=function(_0x58390a,_0x1ffd34,_0x20ce1a,_0x35c7b4){return function(_0x4b0943){try{var _0x20fc43={'tag':_0x1ffd34[0x0]};var _0x1e9e24=tag[_0xb155('0x0')](_0x20fc43,{'typecast':!![]});if(_0x1e9e24[_0xb155('0xb')]){logger[_0xb155('0xc')](_0xb155('0xd'),_0x58390a,_[_0xb155('0xe')](_0x1e9e24,_0xb155('0xf'))[_0xb155('0x10')](',\x20'));logger[_0xb155('0x11')](_0xb155('0x12'),_0x58390a);_0x4b0943[_0xb155('0x13')]();}else{var _0x4d034f={'ids':[_0x1ffd34[0x0]]};if(rpc[_0x35c7b4[_0xb155('0x14')]+'Interaction']){rpc[_0x35c7b4['channel']+_0xb155('0x15')]['addTags'](_0x35c7b4[_0xb155('0x16')]['id'],_0x4d034f)[_0xb155('0x17')](function(_0x2b55d6){logger['info']('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0x58390a,_0x1ffd34[0x1],_0x35c7b4['channel'],_0x35c7b4[_0xb155('0x16')]['id']);})[_0xb155('0x18')](function(_0x5bbaa4){logger[_0xb155('0xc')](_0xb155('0xd'),_0x58390a,JSON[_0xb155('0x19')](_0x5bbaa4));logger[_0xb155('0x11')](_0xb155('0x12'),_0x58390a);})[_0xb155('0x1a')](function(){_0x4b0943[_0xb155('0x13')]();});}}}catch(_0x448ec9){logger[_0xb155('0xc')](_0xb155('0xd'),_0x58390a,_[_0xb155('0x1b')](_0x448ec9)?JSON[_0xb155('0x19')](_0x448ec9):_0x448ec9);logger[_0xb155('0x11')](_0xb155('0x12'),_0x58390a);_0x4b0943[_0xb155('0x13')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/tvox.js b/server/services/routing/server/applications/tvox.js index 45dd1ba..2011e17 100644 --- a/server/services/routing/server/applications/tvox.js +++ b/server/services/routing/server/applications/tvox.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc3a9=['routing','lodash','\x20-\x20','includes','push','?params=','title','jsonrpc','2.0','method','login','params','stringify','POST','then','parse','result','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&serviceId=','&sessionId=','error','isObject','stop','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','request-promise'];(function(_0xfa634c,_0x414e0e){var _0x73e478=function(_0xac2a51){while(--_0xac2a51){_0xfa634c['push'](_0xfa634c['shift']());}};_0x73e478(++_0x414e0e);}(_0xc3a9,0xfb));var _0x9c3a=function(_0x53cffc,_0x3ebad9){_0x53cffc=_0x53cffc-0x0;var _0x43ab22=_0xc3a9[_0x53cffc];return _0x43ab22;};'use strict';var rp=require(_0x9c3a('0x0'));var logger=require('../../../../config/logger')(_0x9c3a('0x1'));var _=require(_0x9c3a('0x2'));var arr=[];exports['consequence']=function(_0x5e16dc,_0x274478){return function(_0x362163){var _0x510135=_0x274478[0xa];var _0x1ceb59=_0x274478[0xb];var _0x3a9716=_0x274478[0xc];var _0x232fcb=_0x274478[0xd];var _0x1d5943=_0x274478[0xe];var _0x4d259a=_0x274478[0xf]['replace'](/\n/g,_0x9c3a('0x3'));var _0x4e202e=_0x274478[0x10]['replace'](/\n/g,'\x20');if(!arr[_0x9c3a('0x4')](_0x1ceb59)){arr[_0x9c3a('0x5')](_0x1ceb59);var _0x3690c7=_0x274478[0x3];var _0x549942=_0x274478[0x4];var _0x1ad2cd=_0x274478[0x1];var _0xfc9cd4=_0x274478[0x0];var _0x2da8e5={};_0x2da8e5['urlOnAnswer']=_0x274478[0x8]+_0x9c3a('0x6')+_0x3a9716+'|'+_0x510135+'|'+_0x232fcb+'|'+_0x1ceb59+'|'+_0x1d5943;_0x2da8e5['urlOnRing']=_0x274478[0x7]+_0x9c3a('0x6')+_0x3a9716+'|'+_0x510135+'|'+_0x232fcb+'|'+_0x1ceb59+'|'+_0x1d5943+'|'+_0x4d259a+'|'+_0x4e202e;_0x2da8e5[_0x9c3a('0x7')]=_0x274478[0x9];var _0x44870f={};_0x44870f[_0x9c3a('0x8')]=_0x9c3a('0x9');_0x44870f[_0x9c3a('0xa')]=_0x9c3a('0xb');var _0x4fa858=[];_0x4fa858[_0x9c3a('0x5')](_0x274478[0x2]);_0x4fa858['push'](_0x274478[0x5]);_0x4fa858[_0x9c3a('0x5')](_0x274478[0x6]);_0x44870f[_0x9c3a('0xc')]=_0x4fa858;_0x44870f['id']=0x1;var _0x1b4353=JSON[_0x9c3a('0xd')](_0x44870f);var _0x41c07c={'encoding':'utf8','method':_0x9c3a('0xe'),'timeout':0x2710,'url':_0x3690c7,'headers':{'Content-Type':'application/json-rpc'},'body':_0x1b4353};return rp(_0x41c07c)[_0x9c3a('0xf')](function(_0x1937cb){const _0x52aa4a=JSON[_0x9c3a('0x10')](_0x1937cb);if(!_0x52aa4a[_0x9c3a('0x11')][_0x9c3a('0x12')]){throw new Error(_0x9c3a('0x13'));}var _0x5cdb96=_0x1ceb59;var _0x3162da=_0x9c3a('0x14')+_0x1ad2cd+_0x9c3a('0x15')+_0xfc9cd4+_0x9c3a('0x16')+_0x5cdb96+'&data='+JSON[_0x9c3a('0xd')](_0x2da8e5);var _0x17ffb8=_0x549942+'?'+_0x3162da;return rp(_0x17ffb8);})[_0x9c3a('0xf')](function(_0x338a8a){logger['info']('[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s',_0x5e16dc,_0x338a8a);_0x362163['stop']();})['catch'](function(_0x575bb4){logger[_0x9c3a('0x17')]('[%s][TVOX]\x20%s',_0x5e16dc,_[_0x9c3a('0x18')](_0x575bb4)?JSON[_0x9c3a('0xd')](_0x575bb4):_0x575bb4);_0x362163[_0x9c3a('0x19')]();});}else{logger['info'](_0x9c3a('0x1a'),_0x5e16dc);_0x362163[_0x9c3a('0x1b')]();}};}; \ No newline at end of file +var _0x8d25=['replace','\x20-\x20','includes','urlOnAnswer','?params=','urlOnRing','jsonrpc','2.0','method','push','params','stringify','utf8','POST','application/json-rpc','parse','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&serviceId=','&data=','then','info','stop','error','[%s][TVOX]\x20%s','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','request-promise','../../../../config/logger','routing','lodash','consequence'];(function(_0x291947,_0x5d7a8e){var _0x40f240=function(_0x222fbf){while(--_0x222fbf){_0x291947['push'](_0x291947['shift']());}};_0x40f240(++_0x5d7a8e);}(_0x8d25,0xc1));var _0x58d2=function(_0x15b899,_0x531c4b){_0x15b899=_0x15b899-0x0;var _0x12ad71=_0x8d25[_0x15b899];return _0x12ad71;};'use strict';var rp=require(_0x58d2('0x0'));var logger=require(_0x58d2('0x1'))(_0x58d2('0x2'));var _=require(_0x58d2('0x3'));var arr=[];exports[_0x58d2('0x4')]=function(_0x1758f2,_0xcda1af){return function(_0x1c3f2d){var _0x2c4d83=_0xcda1af[0xa];var _0x1ad766=_0xcda1af[0xb];var _0x1a1640=_0xcda1af[0xc];var _0x33a355=_0xcda1af[0xd];var _0x434439=_0xcda1af[0xe];var _0x17cabf=_0xcda1af[0xf][_0x58d2('0x5')](/\n/g,_0x58d2('0x6'));var _0x19ffcc=_0xcda1af[0x10][_0x58d2('0x5')](/\n/g,'\x20');if(!arr[_0x58d2('0x7')](_0x1ad766)){arr['push'](_0x1ad766);var _0x48833a=_0xcda1af[0x3];var _0x262349=_0xcda1af[0x4];var _0x1e96c0=_0xcda1af[0x1];var _0x203820=_0xcda1af[0x0];var _0x77d130={};_0x77d130[_0x58d2('0x8')]=_0xcda1af[0x8]+_0x58d2('0x9')+_0x1a1640+'|'+_0x2c4d83+'|'+_0x33a355+'|'+_0x1ad766+'|'+_0x434439;_0x77d130[_0x58d2('0xa')]=_0xcda1af[0x7]+'?params='+_0x1a1640+'|'+_0x2c4d83+'|'+_0x33a355+'|'+_0x1ad766+'|'+_0x434439+'|'+_0x17cabf+'|'+_0x19ffcc;_0x77d130['title']=_0xcda1af[0x9];var _0x16501d={};_0x16501d[_0x58d2('0xb')]=_0x58d2('0xc');_0x16501d[_0x58d2('0xd')]='login';var _0x37ec60=[];_0x37ec60['push'](_0xcda1af[0x2]);_0x37ec60[_0x58d2('0xe')](_0xcda1af[0x5]);_0x37ec60[_0x58d2('0xe')](_0xcda1af[0x6]);_0x16501d[_0x58d2('0xf')]=_0x37ec60;_0x16501d['id']=0x1;var _0x2caf27=JSON[_0x58d2('0x10')](_0x16501d);var _0x10d639={'encoding':_0x58d2('0x11'),'method':_0x58d2('0x12'),'timeout':0x2710,'url':_0x48833a,'headers':{'Content-Type':_0x58d2('0x13')},'body':_0x2caf27};return rp(_0x10d639)['then'](function(_0x22b76f){const _0x29eedb=JSON[_0x58d2('0x14')](_0x22b76f);if(!_0x29eedb['result'][_0x58d2('0x15')]){throw new Error(_0x58d2('0x16'));}var _0x19a095=_0x1ad766;var _0x291682=_0x58d2('0x17')+_0x1e96c0+_0x58d2('0x18')+_0x203820+'&sessionId='+_0x19a095+_0x58d2('0x19')+JSON[_0x58d2('0x10')](_0x77d130);var _0x41a39f=_0x262349+'?'+_0x291682;return rp(_0x41a39f);})[_0x58d2('0x1a')](function(_0x29989d){logger[_0x58d2('0x1b')]('[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s',_0x1758f2,_0x29989d);_0x1c3f2d[_0x58d2('0x1c')]();})['catch'](function(_0x198661){logger[_0x58d2('0x1d')](_0x58d2('0x1e'),_0x1758f2,_['isObject'](_0x198661)?JSON['stringify'](_0x198661):_0x198661);_0x1c3f2d[_0x58d2('0x1c')]();});}else{logger[_0x58d2('0x1b')](_0x58d2('0x1f'),_0x1758f2);_0x1c3f2d[_0x58d2('0x20')]();}};}; \ 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 2a14e0a..5551432 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 _0x9c44=['merge','body','account','list','exports','render'];(function(_0x183808,_0x53924e){var _0x211b96=function(_0x4d3102){while(--_0x4d3102){_0x183808['push'](_0x183808['shift']());}};_0x211b96(++_0x53924e);}(_0x9c44,0x178));var _0x49c4=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0x9c44[_0x5608a3];return _0x1ed50a;};'use strict';var Mustache=require('mustache');var _=require('lodash');module[_0x49c4('0x0')]={'getMustacheRender':function(_0x18bf2d,_0x26844b){return Mustache[_0x49c4('0x1')](_0x18bf2d,_[_0x49c4('0x2')](_0x26844b[_0x49c4('0x3')],{'contact':_0x26844b['contact'],'message':_0x26844b['message'],'account':_0x26844b[_0x49c4('0x4')],'interaction':_0x26844b['interaction'],'list':_0x26844b[_0x49c4('0x5')]}))||'';}}; \ No newline at end of file +var _0xbaf0=['list','lodash','exports','render','merge','contact','message','account','interaction'];(function(_0x525aeb,_0xedc6db){var _0x228693=function(_0x547161){while(--_0x547161){_0x525aeb['push'](_0x525aeb['shift']());}};_0x228693(++_0xedc6db);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xbaf0[_0x6131cd];return _0x47e916;};'use strict';var Mustache=require('mustache');var _=require(_0x0baf('0x0'));module[_0x0baf('0x1')]={'getMustacheRender':function(_0x1e212d,_0x263f79){return Mustache[_0x0baf('0x2')](_0x1e212d,_[_0x0baf('0x3')](_0x263f79['body'],{'contact':_0x263f79[_0x0baf('0x4')],'message':_0x263f79[_0x0baf('0x5')],'account':_0x263f79[_0x0baf('0x6')],'interaction':_0x263f79[_0x0baf('0x7')],'list':_0x263f79[_0x0baf('0x8')]}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index eaa4ef5..d79edb7 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 _0xd7d1=['values','find','chatQueues','available','loggedIn','name','paused','mailQueues','waiting','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','listen','127.0.0.1','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','bluebird','./applications/utils','./applications/strategy/util','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','rules','channel','message','interaction','checkWaitingNotifications','isArray','applications','length','existsSync','app','toLowerCase','autoreply','appdata','split','mail','push','join','slice','dialogflow','amazonlex','tag','TagId','getMustacheRender','notificationTemplate','ChatWebsiteId','body','%s:%s:%s','./interval','intervals','consequence','priority','info','Push\x20new\x20rule','\x20|\x20','.js','execute','stringify','matchPath','emit','complete','Skipped\x20routing\x20for\x20%s','No\x20applications\x20to\x20execute','error','stack','agent','agents','QueueReport','update','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','busyQueue','end','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0x24119f,_0x245fa2){_0x24119f=_0x24119f-0x0;var _0x37b050=_0xd7d1[_0x24119f];return _0x37b050;};'use strict';var _=require(_0x1d7d('0x0'));var util=require(_0x1d7d('0x1'));var path=require(_0x1d7d('0x2'));var fs=require('fs');var jayson=require(_0x1d7d('0x3'));var BPromise=require(_0x1d7d('0x4'));var utils=require(_0x1d7d('0x5'));var sUtils=require(_0x1d7d('0x6'));var logger=require(_0x1d7d('0x7'))(_0x1d7d('0x8'));var rpc={'openchannelQueueReport':require(_0x1d7d('0x9')),'mailQueueReport':require(_0x1d7d('0xa')),'chatQueueReport':require(_0x1d7d('0xb')),'smsQueueReport':require(_0x1d7d('0xc')),'faxQueueReport':require('../rpc/faxQueueReport'),'whatsappQueueReport':require(_0x1d7d('0xd'))};var RuleEngine=require(_0x1d7d('0xe'));function getId(_0x14dbf6,_0x3675a2,_0xd6189e){return util[_0x1d7d('0xf')](_0x1d7d('0x10'),_0x14dbf6,_0x3675a2||0x0,_0xd6189e||0x0);}function getIntervals(_0xa44223,_0x1ad06f){var _0x8b258b=[];if(!_[_0x1d7d('0x11')](_0x1ad06f['IntervalId'])&&!_[_0x1d7d('0x11')](_0xa44223[_0x1ad06f['IntervalId']])&&!_[_0x1d7d('0x11')](_0xa44223[_0x1ad06f[_0x1d7d('0x12')]][_0x1d7d('0x13')])){_0x8b258b=_[_0x1d7d('0x14')](_0xa44223[_0x1ad06f['IntervalId']][_0x1d7d('0x13')],'interval');}else if(!_['isNil'](_0x1ad06f[_0x1d7d('0x15')])){_0x8b258b=[_0x1ad06f[_0x1d7d('0x15')]];}return _0x8b258b;}exports['listen']=function(_0x55dba7){_0x55dba7[_0x1d7d('0x16')]={};return new BPromise(function(_0x334e78,_0xe10fdd){var _0x183fc6={'Start':function(_0xeb05b3){var _0x53423f=this;return new Promise(function(_0x28adf3,_0x1de6cc){if(_0xeb05b3){try{var _0x51cbca=[];var _0xb90a8c=getId(_0xeb05b3[_0x1d7d('0x17')],_0xeb05b3[_0x1d7d('0x18')]?_0xeb05b3[_0x1d7d('0x18')]['id']:0x0,_0xeb05b3[_0x1d7d('0x19')]?_0xeb05b3['interaction']['id']:0x0);var _0x664e3f=sUtils[_0x1d7d('0x1a')](_0x55dba7,_0xeb05b3);if(_0xeb05b3['transfer']||!_0x664e3f&&_0xeb05b3['applications']&&_[_0x1d7d('0x1b')](_0xeb05b3[_0x1d7d('0x1c')])&&_0xeb05b3[_0x1d7d('0x1c')][_0x1d7d('0x1d')]){for(var _0x2ae740=0x0;_0x2ae740<_0xeb05b3[_0x1d7d('0x1c')]['length'];_0x2ae740+=0x1){var _0x225f85=_0xeb05b3[_0x1d7d('0x1c')][_0x2ae740];if(fs[_0x1d7d('0x1e')](path['join'](__dirname,_0x1d7d('0x1c'),_0x225f85[_0x1d7d('0x1f')]+'.js'))){var _0x5950bd=[];switch(_0x225f85[_0x1d7d('0x1f')][_0x1d7d('0x20')]()){case _0x1d7d('0x21'):var _0x5097b8=_0x225f85[_0x1d7d('0x22')][_0x1d7d('0x23')](',');if(_0xeb05b3[_0x1d7d('0x17')]===_0x1d7d('0x24')){_0x5950bd['push'](_0x5097b8[0x0]);_0x5950bd[_0x1d7d('0x25')](_0x5097b8[0x1]);_0x5950bd[_0x1d7d('0x25')](_0x5097b8['slice'](0x2,_0x5097b8['length'])[_0x1d7d('0x26')](','));}else{_0x5950bd['push'](_0x5097b8[0x0]);_0x5950bd[_0x1d7d('0x25')](_0x5097b8[_0x1d7d('0x27')](0x1,_0x5097b8[_0x1d7d('0x1d')])[_0x1d7d('0x26')](','));}break;case _0x1d7d('0x28'):var _0x59f827=_0x225f85[_0x1d7d('0x22')][_0x1d7d('0x23')](',');_0x5950bd[_0x1d7d('0x25')](_0x59f827[0x0]);_0x5950bd['push'](_0x59f827[0x1]);_0x5950bd[_0x1d7d('0x25')](_0x59f827[_0x1d7d('0x27')](0x2,_0x59f827[_0x1d7d('0x1d')])['join'](','));break;case'dialogflowv2':var _0x53e25c=_0x225f85[_0x1d7d('0x22')][_0x1d7d('0x23')](',');_0x5950bd['push'](_0x53e25c[0x0]);_0x5950bd[_0x1d7d('0x25')](_0x53e25c[0x1]);_0x5950bd[_0x1d7d('0x25')](_0x53e25c[0x2]);_0x5950bd[_0x1d7d('0x25')](_0x53e25c[0x3]);_0x5950bd[_0x1d7d('0x25')](_0x53e25c[_0x1d7d('0x27')](0x4,_0x53e25c[_0x1d7d('0x1d')])[_0x1d7d('0x26')](','));break;case _0x1d7d('0x29'):var _0xd701e1=_0x225f85[_0x1d7d('0x22')]['split'](',');_0x5950bd['push'](_0xd701e1[0x0]);_0x5950bd[_0x1d7d('0x25')](_0xd701e1[0x1]);_0x5950bd[_0x1d7d('0x25')](_0xd701e1[0x2]);_0x5950bd[_0x1d7d('0x25')](_0xd701e1[0x3]);_0x5950bd[_0x1d7d('0x25')](_0xd701e1[_0x1d7d('0x27')](0x4,_0xd701e1[_0x1d7d('0x1d')])[_0x1d7d('0x26')](','));break;case _0x1d7d('0x18'):_0x5950bd[_0x1d7d('0x25')](_0x225f85['appdata']);break;case _0x1d7d('0x2a'):_0x5950bd[_0x1d7d('0x25')](_0x225f85[_0x1d7d('0x2b')]);_0x5950bd[_0x1d7d('0x25')](_0x225f85['appdata']);break;case'tvox':var _0x472fd9=utils[_0x1d7d('0x2c')](_0xeb05b3['account'][_0x1d7d('0x2d')],_0xeb05b3);var _0x3fea2e=_0x225f85['appdata']['split'](',');_0x5950bd[_0x1d7d('0x25')](_0x3fea2e[0x0]);_0x5950bd[_0x1d7d('0x25')](_0x3fea2e[0x1]);_0x5950bd[_0x1d7d('0x25')](_0x3fea2e[0x2]);_0x5950bd[_0x1d7d('0x25')](_0x3fea2e[0x3]);_0x5950bd[_0x1d7d('0x25')](_0x3fea2e[0x4]);_0x5950bd[_0x1d7d('0x25')](_0x3fea2e[0x5]);_0x5950bd[_0x1d7d('0x25')](_0x3fea2e[0x6]);_0x5950bd[_0x1d7d('0x25')](_0x3fea2e[0x7]);_0x5950bd[_0x1d7d('0x25')](_0x3fea2e[0x8]);_0x5950bd[_0x1d7d('0x25')](_0x3fea2e[0x9]);_0x5950bd['push'](_0x3fea2e[0xa]);_0x5950bd['push'](_0xeb05b3['interaction']['id']);_0x5950bd['push'](_0xeb05b3[_0x1d7d('0x18')]['id']);_0x5950bd['push'](_0x225f85[_0x1d7d('0x2e')]);_0x5950bd[_0x1d7d('0x25')](_0xeb05b3[_0x1d7d('0x19')]['ContactId']);_0x5950bd[_0x1d7d('0x25')](_0xeb05b3[_0x1d7d('0x2f')][_0x1d7d('0x2f')]);_0x5950bd['push'](_0x472fd9);break;default:_0x5950bd=_[_0x1d7d('0x11')](_0x225f85[_0x1d7d('0x22')])?[]:_0x225f85[_0x1d7d('0x22')][_0x1d7d('0x23')](',');}var _0x5eef0a={'id':util[_0x1d7d('0xf')](_0x1d7d('0x30'),_0xb90a8c,_0x225f85['id'],_0x225f85[_0x1d7d('0x1f')]),'condition':require(_0x1d7d('0x31'))['condition'](_0xb90a8c,getIntervals(_0x55dba7[_0x1d7d('0x32')],_0x225f85),_0x55dba7),'consequence':require('./applications/'+_0x225f85[_0x1d7d('0x1f')])[_0x1d7d('0x33')](_0xb90a8c,_0x5950bd,_0x55dba7,_0xeb05b3),'p':_0x225f85[_0x1d7d('0x34')]||0x0};logger[_0x1d7d('0x35')](_0x1d7d('0x36'),_0x5eef0a['id'],'on\x20interval',getIntervals(_0x55dba7['intervals'],_0x225f85)[_0x1d7d('0x26')](_0x1d7d('0x37')));_0x51cbca[_0x1d7d('0x25')](_0x5eef0a);}else{logger['error']('Please\x20create\x20a\x20new\x20file\x20under',path[_0x1d7d('0x26')](__dirname,'applications',_0x225f85[_0x1d7d('0x1f')]+_0x1d7d('0x38')));}}_0x55dba7[_0x1d7d('0x16')][_0xb90a8c]=new RuleEngine(_0x51cbca);_0x55dba7[_0x1d7d('0x16')][_0xb90a8c][_0x1d7d('0x39')](_0xeb05b3,function(_0x370e8d){logger[_0x1d7d('0x35')]('Applications\x20executed',JSON[_0x1d7d('0x3a')](_0x370e8d[_0x1d7d('0x3b')]));if(_0x55dba7['rules'][_0xb90a8c]){_0x55dba7[_0x1d7d('0x16')][_0xb90a8c][_0x1d7d('0x3c')](_0x1d7d('0x3d'));}});return _0x28adf3({'code':0xc8,'message':_0xeb05b3});}else{if(_0x664e3f){logger[_0x1d7d('0x35')](util[_0x1d7d('0xf')](_0x1d7d('0x3e'),_0xb90a8c));}else{logger[_0x1d7d('0x35')](_0x1d7d('0x3f'));}return _0x28adf3({'code':0xc8,'message':_0xeb05b3});}}catch(_0x43c6f1){logger[_0x1d7d('0x40')](_0x43c6f1[_0x1d7d('0x41')]);return _0x1de6cc(_0x53423f[_0x1d7d('0x40')](0x1f4,_0x43c6f1));}}return _0x1de6cc('routing\x20is\x20empty');});},'AcceptMessage':function(_0x14e80d){var _0x5904e0=this;return new Promise(function(_0xbfe60,_0x526261){if(_0x14e80d[_0x1d7d('0x42')]&&_0x14e80d[_0x1d7d('0x42')]['id']){if(_0x55dba7[_0x1d7d('0x43')][_0x14e80d[_0x1d7d('0x42')]['id']]){_0x55dba7['agents'][_0x14e80d[_0x1d7d('0x42')]['id']]['busy']=![];_0x55dba7['agents'][_0x14e80d[_0x1d7d('0x42')]['id']]['busyQueue']=undefined;}}if(_0x14e80d['message']&&_0x14e80d[_0x1d7d('0x18')]['id']){try{var _0xf9b677=getId(_0x14e80d['channel'],_0x14e80d[_0x1d7d('0x18')]?_0x14e80d[_0x1d7d('0x18')]['id']:0x0,_0x14e80d['interaction']?_0x14e80d[_0x1d7d('0x19')]['id']:0x0);if(_0x55dba7[_0x1d7d('0x16')][_0xf9b677]){_0x55dba7[_0x1d7d('0x16')][_0xf9b677][_0x1d7d('0x3c')]('end');if(rpc[_0x14e80d['channel']+_0x1d7d('0x44')]){rpc[_0x14e80d[_0x1d7d('0x17')]+_0x1d7d('0x44')][_0x1d7d('0x45')](_0xf9b677,{'UserId':_0x14e80d[_0x1d7d('0x18')]['UserId']})[_0x1d7d('0x46')](function(){logger[_0x1d7d('0x40')](_0x1d7d('0x47'));});}}return _0xbfe60({'code':0xc8,'message':_0x14e80d});}catch(_0x18a2d1){logger[_0x1d7d('0x40')](_0x18a2d1[_0x1d7d('0x41')]);return _0x526261(_0x5904e0[_0x1d7d('0x40')](0x1f4,_0x18a2d1));}}logger[_0x1d7d('0x40')](_0x1d7d('0x48'));return _0x526261(_0x5904e0['error'](0x1f4,_0x1d7d('0x48')));});},'RejectMessage':function(_0x41ad41){var _0x44b1f7=this;return new Promise(function(_0x49c5ad,_0x591555){if(_0x41ad41[_0x1d7d('0x42')]&&_0x41ad41[_0x1d7d('0x42')]['id']){try{if(_0x55dba7[_0x1d7d('0x43')][_0x41ad41['agent']['id']]){_0x55dba7[_0x1d7d('0x43')][_0x41ad41[_0x1d7d('0x42')]['id']]['busy']=![];_0x55dba7[_0x1d7d('0x43')][_0x41ad41[_0x1d7d('0x42')]['id']][_0x1d7d('0x49')]=undefined;}return _0x49c5ad({'code':0xc8,'message':_0x41ad41});}catch(_0x39dfa2){logger['error'](_0x39dfa2[_0x1d7d('0x41')]);return _0x591555(_0x44b1f7[_0x1d7d('0x40')](0x1f4,_0x39dfa2));}}logger['error']('message\x20is\x20empty');return _0x591555(_0x44b1f7[_0x1d7d('0x40')](0x1f4,_0x1d7d('0x48')));});},'AbandonInteraction':function(_0x5bee2e){var _0x552b8e=this;return new Promise(function(_0x155ef4,_0x37f221){if(_0x5bee2e[_0x1d7d('0x17')]&&_0x5bee2e[_0x1d7d('0x19')]&&_0x5bee2e['interaction']['id']){try{var _0x311ec2=getId(_0x5bee2e['channel'],_0x5bee2e[_0x1d7d('0x18')]?_0x5bee2e[_0x1d7d('0x18')]['id']:0x0,_0x5bee2e[_0x1d7d('0x19')]?_0x5bee2e[_0x1d7d('0x19')]['id']:0x0);if(_0x55dba7['rules'][_0x311ec2]){_0x55dba7[_0x1d7d('0x16')][_0x311ec2][_0x1d7d('0x3c')](_0x1d7d('0x4a'));}return _0x155ef4({'code':0xc8,'message':_0x5bee2e});}catch(_0x226509){logger[_0x1d7d('0x40')](_0x226509[_0x1d7d('0x41')]);return _0x37f221(_0x552b8e[_0x1d7d('0x40')](0x1f4,_0x226509));}}logger[_0x1d7d('0x40')](_0x1d7d('0x48'));return _0x37f221(_0x552b8e[_0x1d7d('0x40')](0x1f4,_0x1d7d('0x48')));});},'AgentCapacity':function(_0x23974e){var _0x301a67=this;return new Promise(function(_0x31810f,_0x3fb914){if(_0x55dba7['agents'][_0x1d7d('0x4b')](_0x23974e['id'])){for(var _0x566d27 in _0x23974e[_0x1d7d('0x4c')]){if(_0x23974e[_0x1d7d('0x4c')][_0x1d7d('0x4b')](_0x566d27)){if(_0x55dba7[_0x1d7d('0x43')][_0x23974e['id']][_0x1d7d('0x4b')](_0x566d27+_0x1d7d('0x4d'))){_0x55dba7['agents'][_0x23974e['id']][_0x566d27+_0x1d7d('0x4d')]=parseInt(_0x23974e[_0x1d7d('0x4c')][_0x566d27],0xa);}}}_0x55dba7['agents'][_0x23974e['id']][_0x1d7d('0x4e')]();return _0x31810f({'code':0xc8,'message':_0x55dba7['agents'][_0x23974e['id']]});}else{return _0x3fb914(_0x301a67[_0x1d7d('0x40')](0x1f4,_0x1d7d('0x4f')));}});},'Agents':function(_0x11eddd){return new Promise(function(_0x283f77){var _0x95ae40=_[_0x1d7d('0x50')](_0x55dba7['agents']);if(_0x11eddd&&_0x11eddd['id']){var _0x3768a7=_[_0x1d7d('0x51')](_0x95ae40,function(_0x4d69cc){return _0x4d69cc['id']===_0x11eddd['id'];});_0x283f77(_0x3768a7);}else{_0x283f77({'count':_0x95ae40[_0x1d7d('0x1d')],'rows':_0x95ae40});}});},'ChatQueues':function(){return new Promise(function(_0x3da337){var _0x3c8a65=[];for(var _0x4bc7b8 in _0x55dba7[_0x1d7d('0x52')]){if(_0x55dba7[_0x1d7d('0x52')][_0x1d7d('0x4b')](_0x4bc7b8)){var _0x1938fe=_0x55dba7['chatQueues'][_0x4bc7b8];var _0x40e6be={'id':_0x1938fe['id'],'available':_0x1938fe[_0x1d7d('0x53')],'loggedIn':_0x1938fe[_0x1d7d('0x54')],'name':_0x1938fe[_0x1d7d('0x55')],'paused':_0x1938fe[_0x1d7d('0x56')],'waiting':_0x1938fe['waiting']};_0x3c8a65[_0x1d7d('0x25')](_0x40e6be);}}_0x3da337({'count':_0x3c8a65[_0x1d7d('0x1d')],'rows':_0x3c8a65});});},'MailQueues':function(){return new Promise(function(_0x586603){var _0xac21ec=[];for(var _0x2d48d2 in _0x55dba7[_0x1d7d('0x57')]){if(_0x55dba7[_0x1d7d('0x57')]['hasOwnProperty'](_0x2d48d2)){var _0x24c0a7=_0x55dba7['mailQueues'][_0x2d48d2];var _0x3b93aa={'id':_0x24c0a7['id'],'available':_0x24c0a7[_0x1d7d('0x53')],'loggedIn':_0x24c0a7[_0x1d7d('0x54')],'name':_0x24c0a7['name'],'paused':_0x24c0a7[_0x1d7d('0x56')],'waiting':_0x24c0a7[_0x1d7d('0x58')]};_0xac21ec[_0x1d7d('0x25')](_0x3b93aa);}}_0x586603({'count':_0xac21ec['length'],'rows':_0xac21ec});});},'OpenchannelQueues':function(){return new Promise(function(_0x45b66d){var _0x47c1d5=[];for(var _0x6e9ee6 in _0x55dba7[_0x1d7d('0x59')]){if(_0x55dba7[_0x1d7d('0x59')][_0x1d7d('0x4b')](_0x6e9ee6)){var _0x30cf98=_0x55dba7[_0x1d7d('0x59')][_0x6e9ee6];var _0xbf2415={'id':_0x30cf98['id'],'available':_0x30cf98[_0x1d7d('0x53')],'loggedIn':_0x30cf98[_0x1d7d('0x54')],'name':_0x30cf98[_0x1d7d('0x55')],'paused':_0x30cf98[_0x1d7d('0x56')],'waiting':_0x30cf98['waiting']};_0x47c1d5['push'](_0xbf2415);}}_0x45b66d({'count':_0x47c1d5[_0x1d7d('0x1d')],'rows':_0x47c1d5});});},'SmsQueues':function(){return new Promise(function(_0x2e26d4){var _0x3b2615=[];for(var _0x5f3406 in _0x55dba7[_0x1d7d('0x5a')]){if(_0x55dba7['smsQueues'][_0x1d7d('0x4b')](_0x5f3406)){var _0x33e656=_0x55dba7['smsQueues'][_0x5f3406];var _0x1f55a2={'id':_0x33e656['id'],'available':_0x33e656[_0x1d7d('0x53')],'loggedIn':_0x33e656['loggedIn'],'name':_0x33e656[_0x1d7d('0x55')],'paused':_0x33e656[_0x1d7d('0x56')],'waiting':_0x33e656[_0x1d7d('0x58')]};_0x3b2615['push'](_0x1f55a2);}}_0x2e26d4({'count':_0x3b2615['length'],'rows':_0x3b2615});});},'FaxQueues':function(){return new Promise(function(_0x2f774f){var _0x87e6aa=[];for(var _0x588b2d in _0x55dba7[_0x1d7d('0x5b')]){if(_0x55dba7[_0x1d7d('0x5b')][_0x1d7d('0x4b')](_0x588b2d)){var _0x429823=_0x55dba7['faxQueues'][_0x588b2d];var _0x708306={'id':_0x429823['id'],'available':_0x429823[_0x1d7d('0x53')],'loggedIn':_0x429823[_0x1d7d('0x54')],'name':_0x429823[_0x1d7d('0x55')],'paused':_0x429823[_0x1d7d('0x56')],'waiting':_0x429823[_0x1d7d('0x58')]};_0x87e6aa[_0x1d7d('0x25')](_0x708306);}}_0x2f774f({'count':_0x87e6aa[_0x1d7d('0x1d')],'rows':_0x87e6aa});});},'WhatsappQueues':function(){return new Promise(function(_0x8ace8b){var _0x1ae438=[];for(var _0xe904e5 in _0x55dba7[_0x1d7d('0x5c')]){if(_0x55dba7[_0x1d7d('0x5c')]['hasOwnProperty'](_0xe904e5)){var _0x33dd3c=_0x55dba7[_0x1d7d('0x5c')][_0xe904e5];var _0x4dd390={'id':_0x33dd3c['id'],'available':_0x33dd3c[_0x1d7d('0x53')],'loggedIn':_0x33dd3c[_0x1d7d('0x54')],'name':_0x33dd3c['name'],'paused':_0x33dd3c['paused'],'waiting':_0x33dd3c['waiting']};_0x1ae438[_0x1d7d('0x25')](_0x4dd390);}}_0x8ace8b({'count':_0x1ae438[_0x1d7d('0x1d')],'rows':_0x1ae438});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x288532){var _0x3929cc=_['values'](_0x55dba7[_0x1d7d('0x5d')]);_0x288532({'count':_0x3929cc[_0x1d7d('0x1d')],'rows':_0x3929cc});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x351807){var _0x1d39a9=_['values'](_0x55dba7[_0x1d7d('0x5e')]);_0x351807({'count':_0x1d39a9[_0x1d7d('0x1d')],'rows':_0x1d39a9});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x135910){var _0x43d3b0=_[_0x1d7d('0x50')](_0x55dba7[_0x1d7d('0x5f')]);_0x135910({'count':_0x43d3b0['length'],'rows':_0x43d3b0});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x230834){var _0x2d90fb=_['values'](_0x55dba7[_0x1d7d('0x60')]);_0x230834({'count':_0x2d90fb[_0x1d7d('0x1d')],'rows':_0x2d90fb});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x7d394b){var _0x56db77=_[_0x1d7d('0x50')](_0x55dba7['faxQueuesWaitingInteractions']);_0x7d394b({'count':_0x56db77[_0x1d7d('0x1d')],'rows':_0x56db77});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x58b2fb){var _0x53028a=_[_0x1d7d('0x50')](_0x55dba7[_0x1d7d('0x61')]);_0x58b2fb({'count':_0x53028a[_0x1d7d('0x1d')],'rows':_0x53028a});});}};var _0xc3c42f=jayson[_0x1d7d('0x62')](_0x183fc6)[_0x1d7d('0x63')]();_0xc3c42f['on'](_0x1d7d('0x40'),function(_0x155e88){logger[_0x1d7d('0x40')](JSON[_0x1d7d('0x3a')](_0x155e88));return _0xe10fdd(_0x155e88);});_0xc3c42f[_0x1d7d('0x64')](0x232c,_0x1d7d('0x65'),function(){console['log']('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0x334e78(_0x1d7d('0x66')+0x232c);});});}; \ No newline at end of file +var _0x1751=['mailQueues','waiting','openchannelQueues','paused','smsQueues','faxQueues','whatsappQueues','values','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','server','http','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','util','path','jayson/promise','./applications/utils','./applications/strategy/util','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','Intervals','interval','listen','rules','message','checkWaitingNotifications','transfer','applications','isArray','length','join','app','.js','toLowerCase','appdata','split','channel','mail','push','slice','dialogflow','amazonlex','tag','tvox','getMustacheRender','account','notificationTemplate','interaction','ChatWebsiteId','ContactId','body','%s:%s:%s','condition','intervals','./applications/','consequence','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','execute','Applications\x20executed','stringify','matchPath','emit','complete','Skipped\x20routing\x20for\x20%s','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','agent','agents','busy','busyQueue','end','QueueReport','update','UserId','error\x20update\x20queue\x20report','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','agent\x20not\x20found','chatQueues','available','loggedIn','name'];(function(_0x1c546b,_0x304e8f){var _0x18398a=function(_0x56b036){while(--_0x56b036){_0x1c546b['push'](_0x1c546b['shift']());}};_0x18398a(++_0x304e8f);}(_0x1751,0x76));var _0x1175=function(_0x41a09f,_0x27bb47){_0x41a09f=_0x41a09f-0x0;var _0x287766=_0x1751[_0x41a09f];return _0x287766;};'use strict';var _=require(_0x1175('0x0'));var util=require(_0x1175('0x1'));var path=require(_0x1175('0x2'));var fs=require('fs');var jayson=require(_0x1175('0x3'));var BPromise=require('bluebird');var utils=require(_0x1175('0x4'));var sUtils=require(_0x1175('0x5'));var logger=require(_0x1175('0x6'))(_0x1175('0x7'));var rpc={'openchannelQueueReport':require(_0x1175('0x8')),'mailQueueReport':require(_0x1175('0x9')),'chatQueueReport':require(_0x1175('0xa')),'smsQueueReport':require(_0x1175('0xb')),'faxQueueReport':require(_0x1175('0xc')),'whatsappQueueReport':require(_0x1175('0xd'))};var RuleEngine=require(_0x1175('0xe'));function getId(_0x37c744,_0x434f79,_0xf4d43d){return util[_0x1175('0xf')](_0x1175('0x10'),_0x37c744,_0x434f79||0x0,_0xf4d43d||0x0);}function getIntervals(_0x470b89,_0xbd22d9){var _0x1daa12=[];if(!_[_0x1175('0x11')](_0xbd22d9[_0x1175('0x12')])&&!_[_0x1175('0x11')](_0x470b89[_0xbd22d9[_0x1175('0x12')]])&&!_[_0x1175('0x11')](_0x470b89[_0xbd22d9[_0x1175('0x12')]][_0x1175('0x13')])){_0x1daa12=_['map'](_0x470b89[_0xbd22d9['IntervalId']][_0x1175('0x13')],_0x1175('0x14'));}else if(!_['isNil'](_0xbd22d9[_0x1175('0x14')])){_0x1daa12=[_0xbd22d9[_0x1175('0x14')]];}return _0x1daa12;}exports[_0x1175('0x15')]=function(_0x5068d9){_0x5068d9[_0x1175('0x16')]={};return new BPromise(function(_0x42671f,_0x16979a){var _0x57cea4={'Start':function(_0x1fab4e){var _0x5cf0b5=this;return new Promise(function(_0x14be3c,_0x43b6b1){if(_0x1fab4e){try{var _0x2a9bc4=[];var _0x2585be=getId(_0x1fab4e['channel'],_0x1fab4e[_0x1175('0x17')]?_0x1fab4e[_0x1175('0x17')]['id']:0x0,_0x1fab4e['interaction']?_0x1fab4e['interaction']['id']:0x0);var _0x40b685=sUtils[_0x1175('0x18')](_0x5068d9,_0x1fab4e);if(_0x1fab4e[_0x1175('0x19')]||!_0x40b685&&_0x1fab4e[_0x1175('0x1a')]&&_[_0x1175('0x1b')](_0x1fab4e['applications'])&&_0x1fab4e[_0x1175('0x1a')][_0x1175('0x1c')]){for(var _0x3eae78=0x0;_0x3eae78<_0x1fab4e[_0x1175('0x1a')][_0x1175('0x1c')];_0x3eae78+=0x1){var _0x2f303e=_0x1fab4e['applications'][_0x3eae78];if(fs['existsSync'](path[_0x1175('0x1d')](__dirname,_0x1175('0x1a'),_0x2f303e[_0x1175('0x1e')]+_0x1175('0x1f')))){var _0x4542c7=[];switch(_0x2f303e[_0x1175('0x1e')][_0x1175('0x20')]()){case'autoreply':var _0x3bcac9=_0x2f303e[_0x1175('0x21')][_0x1175('0x22')](',');if(_0x1fab4e[_0x1175('0x23')]===_0x1175('0x24')){_0x4542c7[_0x1175('0x25')](_0x3bcac9[0x0]);_0x4542c7[_0x1175('0x25')](_0x3bcac9[0x1]);_0x4542c7[_0x1175('0x25')](_0x3bcac9[_0x1175('0x26')](0x2,_0x3bcac9[_0x1175('0x1c')])[_0x1175('0x1d')](','));}else{_0x4542c7['push'](_0x3bcac9[0x0]);_0x4542c7['push'](_0x3bcac9['slice'](0x1,_0x3bcac9[_0x1175('0x1c')])[_0x1175('0x1d')](','));}break;case _0x1175('0x27'):var _0x5e4ac6=_0x2f303e['appdata']['split'](',');_0x4542c7['push'](_0x5e4ac6[0x0]);_0x4542c7[_0x1175('0x25')](_0x5e4ac6[0x1]);_0x4542c7[_0x1175('0x25')](_0x5e4ac6[_0x1175('0x26')](0x2,_0x5e4ac6[_0x1175('0x1c')])['join'](','));break;case'dialogflowv2':var _0x225279=_0x2f303e[_0x1175('0x21')]['split'](',');_0x4542c7['push'](_0x225279[0x0]);_0x4542c7['push'](_0x225279[0x1]);_0x4542c7[_0x1175('0x25')](_0x225279[0x2]);_0x4542c7[_0x1175('0x25')](_0x225279[0x3]);_0x4542c7['push'](_0x225279[_0x1175('0x26')](0x4,_0x225279[_0x1175('0x1c')])[_0x1175('0x1d')](','));break;case _0x1175('0x28'):var _0x239b73=_0x2f303e[_0x1175('0x21')]['split'](',');_0x4542c7[_0x1175('0x25')](_0x239b73[0x0]);_0x4542c7[_0x1175('0x25')](_0x239b73[0x1]);_0x4542c7[_0x1175('0x25')](_0x239b73[0x2]);_0x4542c7[_0x1175('0x25')](_0x239b73[0x3]);_0x4542c7['push'](_0x239b73[_0x1175('0x26')](0x4,_0x239b73['length'])[_0x1175('0x1d')](','));break;case _0x1175('0x17'):_0x4542c7[_0x1175('0x25')](_0x2f303e[_0x1175('0x21')]);break;case _0x1175('0x29'):_0x4542c7[_0x1175('0x25')](_0x2f303e['TagId']);_0x4542c7['push'](_0x2f303e['appdata']);break;case _0x1175('0x2a'):var _0x3fd639=utils[_0x1175('0x2b')](_0x1fab4e[_0x1175('0x2c')][_0x1175('0x2d')],_0x1fab4e);var _0x2beda3=_0x2f303e['appdata']['split'](',');_0x4542c7[_0x1175('0x25')](_0x2beda3[0x0]);_0x4542c7[_0x1175('0x25')](_0x2beda3[0x1]);_0x4542c7[_0x1175('0x25')](_0x2beda3[0x2]);_0x4542c7['push'](_0x2beda3[0x3]);_0x4542c7[_0x1175('0x25')](_0x2beda3[0x4]);_0x4542c7[_0x1175('0x25')](_0x2beda3[0x5]);_0x4542c7[_0x1175('0x25')](_0x2beda3[0x6]);_0x4542c7['push'](_0x2beda3[0x7]);_0x4542c7['push'](_0x2beda3[0x8]);_0x4542c7[_0x1175('0x25')](_0x2beda3[0x9]);_0x4542c7[_0x1175('0x25')](_0x2beda3[0xa]);_0x4542c7['push'](_0x1fab4e[_0x1175('0x2e')]['id']);_0x4542c7[_0x1175('0x25')](_0x1fab4e[_0x1175('0x17')]['id']);_0x4542c7[_0x1175('0x25')](_0x2f303e[_0x1175('0x2f')]);_0x4542c7[_0x1175('0x25')](_0x1fab4e[_0x1175('0x2e')][_0x1175('0x30')]);_0x4542c7[_0x1175('0x25')](_0x1fab4e[_0x1175('0x31')][_0x1175('0x31')]);_0x4542c7[_0x1175('0x25')](_0x3fd639);break;default:_0x4542c7=_[_0x1175('0x11')](_0x2f303e[_0x1175('0x21')])?[]:_0x2f303e[_0x1175('0x21')][_0x1175('0x22')](',');}var _0x4fdb83={'id':util[_0x1175('0xf')](_0x1175('0x32'),_0x2585be,_0x2f303e['id'],_0x2f303e[_0x1175('0x1e')]),'condition':require('./interval')[_0x1175('0x33')](_0x2585be,getIntervals(_0x5068d9[_0x1175('0x34')],_0x2f303e),_0x5068d9),'consequence':require(_0x1175('0x35')+_0x2f303e[_0x1175('0x1e')])[_0x1175('0x36')](_0x2585be,_0x4542c7,_0x5068d9,_0x1fab4e),'p':_0x2f303e['priority']||0x0};logger[_0x1175('0x37')](_0x1175('0x38'),_0x4fdb83['id'],_0x1175('0x39'),getIntervals(_0x5068d9[_0x1175('0x34')],_0x2f303e)['join'](_0x1175('0x3a')));_0x2a9bc4[_0x1175('0x25')](_0x4fdb83);}else{logger[_0x1175('0x3b')]('Please\x20create\x20a\x20new\x20file\x20under',path[_0x1175('0x1d')](__dirname,'applications',_0x2f303e[_0x1175('0x1e')]+_0x1175('0x1f')));}}_0x5068d9[_0x1175('0x16')][_0x2585be]=new RuleEngine(_0x2a9bc4);_0x5068d9[_0x1175('0x16')][_0x2585be][_0x1175('0x3c')](_0x1fab4e,function(_0x1ec471){logger[_0x1175('0x37')](_0x1175('0x3d'),JSON[_0x1175('0x3e')](_0x1ec471[_0x1175('0x3f')]));if(_0x5068d9['rules'][_0x2585be]){_0x5068d9['rules'][_0x2585be][_0x1175('0x40')](_0x1175('0x41'));}});return _0x14be3c({'code':0xc8,'message':_0x1fab4e});}else{if(_0x40b685){logger['info'](util[_0x1175('0xf')](_0x1175('0x42'),_0x2585be));}else{logger['info'](_0x1175('0x43'));}return _0x14be3c({'code':0xc8,'message':_0x1fab4e});}}catch(_0x1ed96f){logger[_0x1175('0x3b')](_0x1ed96f[_0x1175('0x44')]);return _0x43b6b1(_0x5cf0b5[_0x1175('0x3b')](0x1f4,_0x1ed96f));}}return _0x43b6b1(_0x1175('0x45'));});},'AcceptMessage':function(_0x2acc28){var _0xde8a9b=this;return new Promise(function(_0x17a04c,_0x36da8f){if(_0x2acc28[_0x1175('0x46')]&&_0x2acc28[_0x1175('0x46')]['id']){if(_0x5068d9[_0x1175('0x47')][_0x2acc28[_0x1175('0x46')]['id']]){_0x5068d9[_0x1175('0x47')][_0x2acc28[_0x1175('0x46')]['id']][_0x1175('0x48')]=![];_0x5068d9['agents'][_0x2acc28['agent']['id']][_0x1175('0x49')]=undefined;}}if(_0x2acc28[_0x1175('0x17')]&&_0x2acc28[_0x1175('0x17')]['id']){try{var _0x4b3a70=getId(_0x2acc28[_0x1175('0x23')],_0x2acc28[_0x1175('0x17')]?_0x2acc28[_0x1175('0x17')]['id']:0x0,_0x2acc28[_0x1175('0x2e')]?_0x2acc28[_0x1175('0x2e')]['id']:0x0);if(_0x5068d9[_0x1175('0x16')][_0x4b3a70]){_0x5068d9['rules'][_0x4b3a70][_0x1175('0x40')](_0x1175('0x4a'));if(rpc[_0x2acc28[_0x1175('0x23')]+_0x1175('0x4b')]){rpc[_0x2acc28[_0x1175('0x23')]+_0x1175('0x4b')][_0x1175('0x4c')](_0x4b3a70,{'UserId':_0x2acc28[_0x1175('0x17')][_0x1175('0x4d')]})['catch'](function(){logger['error'](_0x1175('0x4e'));});}}return _0x17a04c({'code':0xc8,'message':_0x2acc28});}catch(_0x82478b){logger[_0x1175('0x3b')](_0x82478b[_0x1175('0x44')]);return _0x36da8f(_0xde8a9b['error'](0x1f4,_0x82478b));}}logger[_0x1175('0x3b')]('message\x20is\x20empty');return _0x36da8f(_0xde8a9b['error'](0x1f4,_0x1175('0x4f')));});},'RejectMessage':function(_0x2d85dd){var _0x425110=this;return new Promise(function(_0x5cdedb,_0x38d9b4){if(_0x2d85dd[_0x1175('0x46')]&&_0x2d85dd[_0x1175('0x46')]['id']){try{if(_0x5068d9['agents'][_0x2d85dd['agent']['id']]){_0x5068d9[_0x1175('0x47')][_0x2d85dd[_0x1175('0x46')]['id']][_0x1175('0x48')]=![];_0x5068d9[_0x1175('0x47')][_0x2d85dd[_0x1175('0x46')]['id']][_0x1175('0x49')]=undefined;}return _0x5cdedb({'code':0xc8,'message':_0x2d85dd});}catch(_0x3c5d47){logger[_0x1175('0x3b')](_0x3c5d47[_0x1175('0x44')]);return _0x38d9b4(_0x425110[_0x1175('0x3b')](0x1f4,_0x3c5d47));}}logger[_0x1175('0x3b')](_0x1175('0x4f'));return _0x38d9b4(_0x425110['error'](0x1f4,'message\x20is\x20empty'));});},'AbandonInteraction':function(_0x30c2bc){var _0x3bebe9=this;return new Promise(function(_0x527c58,_0x306160){if(_0x30c2bc['channel']&&_0x30c2bc['interaction']&&_0x30c2bc[_0x1175('0x2e')]['id']){try{var _0x112b22=getId(_0x30c2bc[_0x1175('0x23')],_0x30c2bc[_0x1175('0x17')]?_0x30c2bc[_0x1175('0x17')]['id']:0x0,_0x30c2bc['interaction']?_0x30c2bc['interaction']['id']:0x0);if(_0x5068d9['rules'][_0x112b22]){_0x5068d9['rules'][_0x112b22][_0x1175('0x40')](_0x1175('0x4a'));}return _0x527c58({'code':0xc8,'message':_0x30c2bc});}catch(_0x50a84c){logger[_0x1175('0x3b')](_0x50a84c[_0x1175('0x44')]);return _0x306160(_0x3bebe9[_0x1175('0x3b')](0x1f4,_0x50a84c));}}logger[_0x1175('0x3b')](_0x1175('0x4f'));return _0x306160(_0x3bebe9[_0x1175('0x3b')](0x1f4,_0x1175('0x4f')));});},'AgentCapacity':function(_0x23316e){var _0x326696=this;return new Promise(function(_0xce19ef,_0x541f3d){if(_0x5068d9[_0x1175('0x47')][_0x1175('0x50')](_0x23316e['id'])){for(var _0x493b43 in _0x23316e[_0x1175('0x51')]){if(_0x23316e[_0x1175('0x51')][_0x1175('0x50')](_0x493b43)){if(_0x5068d9[_0x1175('0x47')][_0x23316e['id']][_0x1175('0x50')](_0x493b43+_0x1175('0x52'))){_0x5068d9[_0x1175('0x47')][_0x23316e['id']][_0x493b43+'CurrentCapacity']=parseInt(_0x23316e[_0x1175('0x51')][_0x493b43],0xa);}}}_0x5068d9[_0x1175('0x47')][_0x23316e['id']]['updateRealtime']();return _0xce19ef({'code':0xc8,'message':_0x5068d9[_0x1175('0x47')][_0x23316e['id']]});}else{return _0x541f3d(_0x326696[_0x1175('0x3b')](0x1f4,_0x1175('0x53')));}});},'Agents':function(_0x178885){return new Promise(function(_0x45e30b){var _0x5c9483=_['values'](_0x5068d9[_0x1175('0x47')]);if(_0x178885&&_0x178885['id']){var _0xecadee=_['find'](_0x5c9483,function(_0x1ee26f){return _0x1ee26f['id']===_0x178885['id'];});_0x45e30b(_0xecadee);}else{_0x45e30b({'count':_0x5c9483['length'],'rows':_0x5c9483});}});},'ChatQueues':function(){return new Promise(function(_0x580c4d){var _0xa161a9=[];for(var _0x2d59dc in _0x5068d9['chatQueues']){if(_0x5068d9[_0x1175('0x54')][_0x1175('0x50')](_0x2d59dc)){var _0xa3f39f=_0x5068d9[_0x1175('0x54')][_0x2d59dc];var _0x3f3a7={'id':_0xa3f39f['id'],'available':_0xa3f39f[_0x1175('0x55')],'loggedIn':_0xa3f39f[_0x1175('0x56')],'name':_0xa3f39f[_0x1175('0x57')],'paused':_0xa3f39f['paused'],'waiting':_0xa3f39f['waiting']};_0xa161a9[_0x1175('0x25')](_0x3f3a7);}}_0x580c4d({'count':_0xa161a9['length'],'rows':_0xa161a9});});},'MailQueues':function(){return new Promise(function(_0x1ab407){var _0x277a9a=[];for(var _0x1d46ab in _0x5068d9['mailQueues']){if(_0x5068d9[_0x1175('0x58')]['hasOwnProperty'](_0x1d46ab)){var _0x486e29=_0x5068d9[_0x1175('0x58')][_0x1d46ab];var _0x19c907={'id':_0x486e29['id'],'available':_0x486e29[_0x1175('0x55')],'loggedIn':_0x486e29[_0x1175('0x56')],'name':_0x486e29['name'],'paused':_0x486e29['paused'],'waiting':_0x486e29[_0x1175('0x59')]};_0x277a9a[_0x1175('0x25')](_0x19c907);}}_0x1ab407({'count':_0x277a9a['length'],'rows':_0x277a9a});});},'OpenchannelQueues':function(){return new Promise(function(_0x256114){var _0x569cbd=[];for(var _0x2ffb1e in _0x5068d9[_0x1175('0x5a')]){if(_0x5068d9['openchannelQueues']['hasOwnProperty'](_0x2ffb1e)){var _0x233387=_0x5068d9['openchannelQueues'][_0x2ffb1e];var _0x3e2380={'id':_0x233387['id'],'available':_0x233387[_0x1175('0x55')],'loggedIn':_0x233387[_0x1175('0x56')],'name':_0x233387[_0x1175('0x57')],'paused':_0x233387[_0x1175('0x5b')],'waiting':_0x233387[_0x1175('0x59')]};_0x569cbd[_0x1175('0x25')](_0x3e2380);}}_0x256114({'count':_0x569cbd[_0x1175('0x1c')],'rows':_0x569cbd});});},'SmsQueues':function(){return new Promise(function(_0xb3329b){var _0x14a347=[];for(var _0x23ef26 in _0x5068d9[_0x1175('0x5c')]){if(_0x5068d9['smsQueues']['hasOwnProperty'](_0x23ef26)){var _0x1c3d8d=_0x5068d9['smsQueues'][_0x23ef26];var _0x23de44={'id':_0x1c3d8d['id'],'available':_0x1c3d8d['available'],'loggedIn':_0x1c3d8d[_0x1175('0x56')],'name':_0x1c3d8d[_0x1175('0x57')],'paused':_0x1c3d8d[_0x1175('0x5b')],'waiting':_0x1c3d8d[_0x1175('0x59')]};_0x14a347[_0x1175('0x25')](_0x23de44);}}_0xb3329b({'count':_0x14a347[_0x1175('0x1c')],'rows':_0x14a347});});},'FaxQueues':function(){return new Promise(function(_0x31226c){var _0xd1dbd9=[];for(var _0x4d640f in _0x5068d9[_0x1175('0x5d')]){if(_0x5068d9[_0x1175('0x5d')]['hasOwnProperty'](_0x4d640f)){var _0x1a4241=_0x5068d9[_0x1175('0x5d')][_0x4d640f];var _0x49428a={'id':_0x1a4241['id'],'available':_0x1a4241[_0x1175('0x55')],'loggedIn':_0x1a4241[_0x1175('0x56')],'name':_0x1a4241[_0x1175('0x57')],'paused':_0x1a4241[_0x1175('0x5b')],'waiting':_0x1a4241[_0x1175('0x59')]};_0xd1dbd9[_0x1175('0x25')](_0x49428a);}}_0x31226c({'count':_0xd1dbd9[_0x1175('0x1c')],'rows':_0xd1dbd9});});},'WhatsappQueues':function(){return new Promise(function(_0x272ebb){var _0x5dc15e=[];for(var _0x5649fb in _0x5068d9[_0x1175('0x5e')]){if(_0x5068d9[_0x1175('0x5e')][_0x1175('0x50')](_0x5649fb)){var _0x225d65=_0x5068d9[_0x1175('0x5e')][_0x5649fb];var _0x233053={'id':_0x225d65['id'],'available':_0x225d65[_0x1175('0x55')],'loggedIn':_0x225d65[_0x1175('0x56')],'name':_0x225d65[_0x1175('0x57')],'paused':_0x225d65['paused'],'waiting':_0x225d65['waiting']};_0x5dc15e[_0x1175('0x25')](_0x233053);}}_0x272ebb({'count':_0x5dc15e[_0x1175('0x1c')],'rows':_0x5dc15e});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x56fc3f){var _0x2c049f=_[_0x1175('0x5f')](_0x5068d9[_0x1175('0x60')]);_0x56fc3f({'count':_0x2c049f[_0x1175('0x1c')],'rows':_0x2c049f});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x4251f9){var _0x593109=_[_0x1175('0x5f')](_0x5068d9[_0x1175('0x61')]);_0x4251f9({'count':_0x593109[_0x1175('0x1c')],'rows':_0x593109});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0xf88c98){var _0x146b12=_[_0x1175('0x5f')](_0x5068d9[_0x1175('0x62')]);_0xf88c98({'count':_0x146b12[_0x1175('0x1c')],'rows':_0x146b12});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x2d66c4){var _0x2ccbb2=_['values'](_0x5068d9['smsQueuesWaitingInteractions']);_0x2d66c4({'count':_0x2ccbb2['length'],'rows':_0x2ccbb2});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x18f788){var _0x136fce=_[_0x1175('0x5f')](_0x5068d9['faxQueuesWaitingInteractions']);_0x18f788({'count':_0x136fce[_0x1175('0x1c')],'rows':_0x136fce});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x1f9722){var _0x72e058=_[_0x1175('0x5f')](_0x5068d9['whatsappQueuesWaitingInteractions']);_0x1f9722({'count':_0x72e058[_0x1175('0x1c')],'rows':_0x72e058});});}};var _0xf99c77=jayson[_0x1175('0x63')](_0x57cea4)[_0x1175('0x64')]();_0xf99c77['on']('error',function(_0x2566d8){logger[_0x1175('0x3b')](JSON['stringify'](_0x2566d8));return _0x16979a(_0x2566d8);});_0xf99c77['listen'](0x232c,'127.0.0.1',function(){console[_0x1175('0x65')](_0x1175('0x66'),0x232c);return _0x42671f('RPC\x20listening\x20on\x20port:'+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index 9df9547..80044cc 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 _0x430c=['iftime\x20%s','message','indexOf','true','some','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when','stack','util','jayson/promise','routing','client','http','request','then','error','result','catch','condition','rules','info','stop','length','format'];(function(_0x4683eb,_0x2aa078){var _0x30a6ff=function(_0x2330ae){while(--_0x2330ae){_0x4683eb['push'](_0x4683eb['shift']());}};_0x30a6ff(++_0x2aa078);}(_0x430c,0xf4));var _0xc430=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x430c[_0x4a9fb1];return _0x348672;};'use strict';var util=require(_0xc430('0x0'));var BPromise=require('bluebird');var jayson=require(_0xc430('0x1'));var _=require('lodash');var logger=require('../../../config/logger')(_0xc430('0x2'));var client=jayson[_0xc430('0x3')][_0xc430('0x4')]({'port':0x232a});function request(_0x52c03a,_0x5515a4){return new BPromise(function(_0x7bbba9,_0x5943f5){return client[_0xc430('0x5')](_0x52c03a,_0x5515a4)[_0xc430('0x6')](function(_0x3d970d){if(_0x3d970d[_0xc430('0x7')]){return _0x5943f5(_0x3d970d['error']['message']);}else{return _0x7bbba9(_0x3d970d[_0xc430('0x8')]);}})[_0xc430('0x9')](function(_0x3944f8){return _0x5943f5(_0x3944f8);});});}exports[_0xc430('0xa')]=function(_0x208458,_0x261891,_0x658b){return function(_0xb5c749){if(_0x658b[_0xc430('0xb')]&&!_0x658b[_0xc430('0xb')][_0x208458]){logger[_0xc430('0xc')]('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0x208458);return _0xb5c749[_0xc430('0xd')]();}var _0x3ff286=[];for(var _0xd785b6=0x0;_0xd785b6<_0x261891[_0xc430('0xe')];_0xd785b6+=0x1){_0x3ff286['push'](request('Command',{'command':util[_0xc430('0xf')](_0xc430('0x10'),_0x261891[_0xd785b6])})[_0xc430('0x6')](function(_0x22e039){return _0x22e039&&_0x22e039[_0xc430('0x11')]&&_0x22e039[_0xc430('0x11')][_0xc430('0x12')](_0xc430('0x13'))>=0x0?!![]:![];})[_0xc430('0x9')](function(){logger[_0xc430('0x7')]('[%s][INTERVAL]\x20%s',_0x208458,_0x261891[_0xd785b6]);}));}BPromise['all'](_0x3ff286)['then'](function(_0x35baa1){var _0x313d8c=_[_0xc430('0x14')](_0x35baa1);logger[_0xc430('0xc')](_0xc430('0x15'),_0x208458,_0x261891[_0xc430('0x16')](_0xc430('0x17')),_0x313d8c);_0xb5c749[_0xc430('0x18')](_0x313d8c);})[_0xc430('0x9')](function(_0x2772f9){logger[_0xc430('0x7')]('[%s][INTERVAL]\x20%s\x20%s',_0x208458,_0x261891[_0xc430('0x16')](_0xc430('0x17')),_0x2772f9[_0xc430('0x19')]);_0xb5c749['stop']();});};}; \ No newline at end of file +var _0x0ed1=['lodash','../../../config/logger','client','then','message','result','catch','condition','rules','info','stop','length','push','Command','iftime\x20%s','indexOf','error','[%s][INTERVAL]\x20%s','all','some','[%s][INTERVAL]\x20%s\x20%s','\x20|\x20','when','join','util','bluebird'];(function(_0x31ff46,_0x48fc21){var _0x1c564e=function(_0x2dff32){while(--_0x2dff32){_0x31ff46['push'](_0x31ff46['shift']());}};_0x1c564e(++_0x48fc21);}(_0x0ed1,0x9a));var _0x10ed=function(_0x941677,_0x3d1039){_0x941677=_0x941677-0x0;var _0x3b1eb6=_0x0ed1[_0x941677];return _0x3b1eb6;};'use strict';var util=require(_0x10ed('0x0'));var BPromise=require(_0x10ed('0x1'));var jayson=require('jayson/promise');var _=require(_0x10ed('0x2'));var logger=require(_0x10ed('0x3'))('routing');var client=jayson[_0x10ed('0x4')]['http']({'port':0x232a});function request(_0x4050f2,_0x40af92){return new BPromise(function(_0x524924,_0x5965b7){return client['request'](_0x4050f2,_0x40af92)[_0x10ed('0x5')](function(_0xe18bf3){if(_0xe18bf3['error']){return _0x5965b7(_0xe18bf3['error'][_0x10ed('0x6')]);}else{return _0x524924(_0xe18bf3[_0x10ed('0x7')]);}})[_0x10ed('0x8')](function(_0x3b57b2){return _0x5965b7(_0x3b57b2);});});}exports[_0x10ed('0x9')]=function(_0x5edab5,_0x452c83,_0x1356e8){return function(_0x4cb4c0){if(_0x1356e8[_0x10ed('0xa')]&&!_0x1356e8[_0x10ed('0xa')][_0x5edab5]){logger[_0x10ed('0xb')]('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0x5edab5);return _0x4cb4c0[_0x10ed('0xc')]();}var _0x13b928=[];for(var _0x5440be=0x0;_0x5440be<_0x452c83[_0x10ed('0xd')];_0x5440be+=0x1){_0x13b928[_0x10ed('0xe')](request(_0x10ed('0xf'),{'command':util['format'](_0x10ed('0x10'),_0x452c83[_0x5440be])})[_0x10ed('0x5')](function(_0x251519){return _0x251519&&_0x251519[_0x10ed('0x6')]&&_0x251519[_0x10ed('0x6')][_0x10ed('0x11')]('true')>=0x0?!![]:![];})[_0x10ed('0x8')](function(){logger[_0x10ed('0x12')](_0x10ed('0x13'),_0x5edab5,_0x452c83[_0x5440be]);}));}BPromise[_0x10ed('0x14')](_0x13b928)[_0x10ed('0x5')](function(_0x4bab62){var _0x1368fd=_[_0x10ed('0x15')](_0x4bab62);logger['info'](_0x10ed('0x16'),_0x5edab5,_0x452c83['join'](_0x10ed('0x17')),_0x1368fd);_0x4cb4c0[_0x10ed('0x18')](_0x1368fd);})[_0x10ed('0x8')](function(_0x4cb288){logger[_0x10ed('0x12')](_0x10ed('0x16'),_0x5edab5,_0x452c83[_0x10ed('0x19')]('\x20|\x20'),_0x4cb288['stack']);_0x4cb4c0[_0x10ed('0xc')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index de76ddc..90cb226 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 _0x750a=['interface','calleridnum','connectedlinenum','lastevent','then','type','agentcomplete','acw','acwTimeout','CreateVoiceAgentReport','request','destuniqueid','agentcalled','debug','[%s][agents][agentcalled]','now','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','agentringnoanswer','isNil','agentringnoanswerAt','timeout','reason','holdtime','ringtime','talktime','push','[%s][agents][agentringnoanswer]','queuecallerabandon','forIn','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','connectedlinename','answered_elsewhere','answeredelsewheremembername','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','agentconnectAt','complete','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','blind','transferuniqueid','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','transfertype','ATTENDED','transferexten','origtransfererexten','transfereeuniqueid','agententerreason','calleridname','agentcalledAt','secondtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','transfer','secondtransfererexten','transfertargetuniqueid','clone','hangup','[%s][agents][hangup]','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','diffTime','agent','util','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','membername'];(function(_0x2d1af2,_0x2a2bae){var _0x14dcdd=function(_0x2592b9){while(--_0x2592b9){_0x2d1af2['push'](_0x2d1af2['shift']());}};_0x14dcdd(++_0x2a2bae);}(_0x750a,0x140));var _0xa750=function(_0x3b839d,_0x15b068){_0x3b839d=_0x3b839d-0x0;var _0xc8b7b8=_0x750a[_0x3b839d];return _0xc8b7b8;};'use strict';var _=require('lodash');var util=require(_0xa750('0x0'));var utils=require('./utils');var agents={};var transfers={};var unanswered=[];function writeDB(_0x499583,_0x139fa5){utils[_0xa750('0x1')](util[_0xa750('0x2')](_0xa750('0x3'),_0x499583[_0xa750('0x4')],_0x499583[_0xa750('0x5')],_0x499583[_0xa750('0x6')],_0x499583[_0xa750('0x7')],_0x499583[_0xa750('0x8')],_0x499583[_0xa750('0x9')],_0x499583[_0xa750('0xa')],_0x499583[_0xa750('0xb')]));if(_0x499583[_0xa750('0x6')]){utils['getVoiceQueueByName'](_0x499583['queue'])[_0xa750('0xc')](function(_0x5b684e){if(_0x5b684e){_0x499583[_0xa750('0xd')]=_0x5b684e[_0xa750('0xd')];_0x499583['agentacw']=_0x499583[_0xa750('0xe')]?_0x5b684e[_0xa750('0xf')]:![];_0x499583['acwtime']=_0x499583['agentacw']?_0x5b684e[_0xa750('0x10')]:0x0;}utils['request'](_0xa750('0x11'),_0x499583);});}else{utils[_0xa750('0x12')]('CreateVoiceAgentReport',_0x499583);}if(_0x139fa5){delete transfers[_0x499583[_0xa750('0x4')]];}else{delete agents[_0x499583[_0xa750('0x13')]];}}exports[_0xa750('0x14')]=function(_0x567c51){try{utils[_0xa750('0x15')](util[_0xa750('0x2')](_0xa750('0x16'),_0x567c51[_0xa750('0x4')]),_0x567c51);agents[_0x567c51[_0xa750('0x13')]]=_0x567c51;agents[_0x567c51[_0xa750('0x13')]]['agentcalledAt']=utils[_0xa750('0x17')]();agents[_0x567c51[_0xa750('0x13')]][_0xa750('0xb')]='called';agents[_0x567c51[_0xa750('0x13')]][_0xa750('0xa')]=null;agents[_0x567c51['destuniqueid']]['connectedlinename']=null;utils[_0xa750('0x1')](util['format'](_0xa750('0x18'),_0x567c51[_0xa750('0x4')],agents[_0x567c51['destuniqueid']][_0xa750('0x7')],_0x567c51['destuniqueid']));}catch(_0x5f28f4){utils[_0xa750('0x19')](util['format'](_0xa750('0x16'),_0x567c51['uniqueid']),_0x5f28f4);}};exports[_0xa750('0x1a')]=function(_0x4a007d){try{if(!_[_0xa750('0x1b')](agents[_0x4a007d['destuniqueid']])){utils[_0xa750('0x15')](util['format']('[%s][agents][agentringnoanswer]',_0x4a007d[_0xa750('0x4')]),_0x4a007d);utils['info'](util[_0xa750('0x2')]('[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout',_0x4a007d['uniqueid'],agents[_0x4a007d['destuniqueid']]['membername'],_0x4a007d[_0xa750('0x13')]));agents[_0x4a007d[_0xa750('0x13')]][_0xa750('0x1a')]=!![];agents[_0x4a007d[_0xa750('0x13')]][_0xa750('0x1c')]=utils[_0xa750('0x17')]();agents[_0x4a007d[_0xa750('0x13')]][_0xa750('0xb')]=_0xa750('0x1d');agents[_0x4a007d[_0xa750('0x13')]][_0xa750('0x1e')]=_0xa750('0x1d');agents[_0x4a007d[_0xa750('0x13')]][_0xa750('0x1f')]=_0x4a007d[_0xa750('0x20')]?parseInt(_0x4a007d['ringtime'])/0x3e8:0x0;agents[_0x4a007d[_0xa750('0x13')]][_0xa750('0x21')]=0x0;unanswered[_0xa750('0x22')](_0x4a007d['destuniqueid']);}}catch(_0x35ab53){utils[_0xa750('0x19')](util[_0xa750('0x2')](_0xa750('0x23'),_0x4a007d['uniqueid']),_0x35ab53);}};exports[_0xa750('0x24')]=function(_0x34d5e9){try{_[_0xa750('0x25')](agents,function(_0x2aef3a,_0x2c5253){if(_0x2aef3a['uniqueid']==_0x34d5e9[_0xa750('0x4')]&&!_['includes'](unanswered,_0x2aef3a[_0xa750('0x13')])){utils[_0xa750('0x15')](util['format'](_0xa750('0x26'),_0x34d5e9[_0xa750('0x4')]),_0x34d5e9);utils[_0xa750('0x1')](util[_0xa750('0x2')](_0xa750('0x27'),_0x34d5e9[_0xa750('0x4')],_0x2aef3a[_0xa750('0x7')],_0x2aef3a[_0xa750('0x13')]));_0x2aef3a['agentringnoanswer']=!![];_0x2aef3a[_0xa750('0x1c')]=utils['now']();_0x2aef3a[_0xa750('0xb')]=_0xa750('0x28');_0x2aef3a[_0xa750('0x1e')]=_0xa750('0x28');_0x2aef3a['holdtime']=_0x34d5e9[_0xa750('0x1f')];_0x2aef3a[_0xa750('0x21')]=0x0;writeDB(_0x2aef3a);}});}catch(_0x5c2e02){utils[_0xa750('0x19')](util[_0xa750('0x2')](_0xa750('0x26'),_0x34d5e9[_0xa750('0x4')]),_0x5c2e02);}};exports['agentconnect']=function(_0xf60128){try{if(agents[_0xf60128['destuniqueid']]){utils['debug'](util[_0xa750('0x2')](_0xa750('0x29'),_0xf60128[_0xa750('0x4')]),_0xf60128);utils['info'](util[_0xa750('0x2')](_0xa750('0x2a'),_0xf60128[_0xa750('0x4')],agents[_0xf60128['destuniqueid']][_0xa750('0x7')],_0xf60128[_0xa750('0x13')]));agents[_0xf60128[_0xa750('0x13')]]['agentconnectAt']=utils[_0xa750('0x17')]();agents[_0xf60128[_0xa750('0x13')]][_0xa750('0xa')]=_0xf60128['connectedlinenum'];agents[_0xf60128[_0xa750('0x13')]][_0xa750('0x2b')]=_0xf60128[_0xa750('0x2b')];agents[_0xf60128[_0xa750('0x13')]]['holdtime']=_0xf60128['ringtime'];agents[_0xf60128[_0xa750('0x13')]][_0xa750('0xb')]='connect';_[_0xa750('0x25')](agents,function(_0x2f57e9,_0x15d35a){if(_0x2f57e9[_0xa750('0x13')]!=_0xf60128[_0xa750('0x13')]&&_0x2f57e9['uniqueid']==_0xf60128[_0xa750('0x4')]){_0x2f57e9[_0xa750('0x21')]=0x0;_0x2f57e9[_0xa750('0x1f')]=_0xf60128[_0xa750('0x20')];_0x2f57e9[_0xa750('0x1a')]=!![];_0x2f57e9[_0xa750('0x1c')]=utils[_0xa750('0x17')]();_0x2f57e9['lastevent']=_0xa750('0x2c');_0x2f57e9['reason']=_0xa750('0x2c');_0x2f57e9['answeredelsewheredestinationuniqueid']=_0xf60128[_0xa750('0x13')];_0x2f57e9[_0xa750('0x2d')]=_0xf60128[_0xa750('0x7')];writeDB(_0x2f57e9);}});}}catch(_0x1be24e){utils[_0xa750('0x19')](util[_0xa750('0x2')](_0xa750('0x29'),_0xf60128[_0xa750('0x4')]),_0x1be24e);}};exports[_0xa750('0xe')]=function(_0x108a1a){try{if(!_[_0xa750('0x1b')](agents[_0x108a1a[_0xa750('0x13')]])){utils[_0xa750('0x15')](util[_0xa750('0x2')](_0xa750('0x2e'),_0x108a1a[_0xa750('0x4')]),_0x108a1a);utils[_0xa750('0x1')](util[_0xa750('0x2')](_0xa750('0x2f'),_0x108a1a[_0xa750('0x4')],agents[_0x108a1a['destuniqueid']][_0xa750('0x7')],_0x108a1a[_0xa750('0x13')]));agents[_0x108a1a[_0xa750('0x13')]][_0xa750('0xe')]=!![];agents[_0x108a1a[_0xa750('0x13')]][_0xa750('0x30')]=utils[_0xa750('0x17')]();agents[_0x108a1a[_0xa750('0x13')]][_0xa750('0x21')]=utils['diffTime'](agents[_0x108a1a[_0xa750('0x13')]][_0xa750('0x30')],agents[_0x108a1a['destuniqueid']][_0xa750('0x31')]);agents[_0x108a1a[_0xa750('0x13')]][_0xa750('0x1e')]=_0x108a1a[_0xa750('0x1e')];agents[_0x108a1a[_0xa750('0x13')]][_0xa750('0xb')]=_0xa750('0x32');writeDB(agents[_0x108a1a[_0xa750('0x13')]]);}}catch(_0x3faf01){utils[_0xa750('0x19')](util['format'](_0xa750('0x2e'),_0x108a1a[_0xa750('0x4')]),_0x3faf01);}};exports['blindtransfer']=function(_0x93e49f){try{if(!_[_0xa750('0x1b')](agents[_0x93e49f[_0xa750('0x33')]])){utils['debug'](util[_0xa750('0x2')](_0xa750('0x34'),_0x93e49f[_0xa750('0x4')]),_0x93e49f);utils[_0xa750('0x1')](util['format'](_0xa750('0x35'),_0x93e49f[_0xa750('0x4')],agents[_0x93e49f[_0xa750('0x33')]][_0xa750('0x7')],agents[_0x93e49f['transfereruniqueid']][_0xa750('0x4')]));agents[_0x93e49f[_0xa750('0x33')]]['transfer']=!![];agents[_0x93e49f[_0xa750('0x33')]]['transfertype']=_0xa750('0x36');agents[_0x93e49f[_0xa750('0x33')]]['transferexten']=_0x93e49f['extension'];agents[_0x93e49f['transfereruniqueid']][_0xa750('0x37')]=agents[_0x93e49f[_0xa750('0x33')]]['uniqueid'];}}catch(_0xe88dc){utils[_0xa750('0x19')](util[_0xa750('0x2')]('[%s][agents][blindtransfer]',_0x93e49f['uniqueid']),_0xe88dc);}};exports['attendedtransfer']=function(_0x5d8dd2){try{utils[_0xa750('0x15')](util['format'](_0xa750('0x38'),_0x5d8dd2[_0xa750('0x39')]),_0x5d8dd2);if(_0x5d8dd2['origtransfereruniqueid']==_0x5d8dd2[_0xa750('0x3a')]){if(!_['isNil'](agents[_0x5d8dd2[_0xa750('0x3b')]])){utils['info'](util['format']('[%s][agents][attendedtransfer]\x20agent:%s',_0x5d8dd2['origtransfereruniqueid'],agents[_0x5d8dd2[_0xa750('0x3b')]][_0xa750('0x7')]));agents[_0x5d8dd2['secondtransfereruniqueid']]['transfer']=!![];agents[_0x5d8dd2['secondtransfereruniqueid']][_0xa750('0x3c')]=_0xa750('0x3d');agents[_0x5d8dd2[_0xa750('0x3b')]][_0xa750('0x3e')]=_0x5d8dd2[_0xa750('0x3f')];agents[_0x5d8dd2[_0xa750('0x3b')]]['transferuniqueid']=_0x5d8dd2['origtransfereruniqueid'];}if(_0x5d8dd2[_0xa750('0x40')]&&agents[_0x5d8dd2[_0xa750('0x40')]]){agents[_0x5d8dd2[_0xa750('0x40')]][_0xa750('0x41')]=0x1;transfers[_0x5d8dd2[_0xa750('0x40')]]=_['clone'](agents[_0x5d8dd2[_0xa750('0x40')]]);transfers[_0x5d8dd2[_0xa750('0x40')]][_0xa750('0x9')]=agents[_0x5d8dd2[_0xa750('0x3b')]][_0xa750('0x9')];transfers[_0x5d8dd2[_0xa750('0x40')]][_0xa750('0x42')]=agents[_0x5d8dd2[_0xa750('0x3b')]]['calleridname'];transfers[_0x5d8dd2[_0xa750('0x40')]][_0xa750('0x43')]=utils[_0xa750('0x17')]();transfers[_0x5d8dd2[_0xa750('0x40')]][_0xa750('0x31')]=utils['now']();transfers[_0x5d8dd2[_0xa750('0x40')]][_0xa750('0x1f')]=0x0;transfers[_0x5d8dd2[_0xa750('0x40')]][_0xa750('0x41')]=0x2;}}else if(_0x5d8dd2[_0xa750('0x3b')]==_0x5d8dd2[_0xa750('0x44')]){if(!_[_0xa750('0x1b')](agents[_0x5d8dd2[_0xa750('0x39')]])){utils[_0xa750('0x1')](util[_0xa750('0x2')](_0xa750('0x45'),_0x5d8dd2[_0xa750('0x39')],agents[_0x5d8dd2[_0xa750('0x39')]][_0xa750('0x7')]));agents[_0x5d8dd2[_0xa750('0x39')]][_0xa750('0x46')]=!![];agents[_0x5d8dd2['origtransfereruniqueid']][_0xa750('0x3c')]='ATTENDED';agents[_0x5d8dd2[_0xa750('0x39')]][_0xa750('0x3e')]=_0x5d8dd2[_0xa750('0x47')];agents[_0x5d8dd2['origtransfereruniqueid']][_0xa750('0x37')]=_0x5d8dd2[_0xa750('0x3b')];}if(_0x5d8dd2[_0xa750('0x48')]&&agents[_0x5d8dd2[_0xa750('0x48')]]){agents[_0x5d8dd2[_0xa750('0x48')]][_0xa750('0x41')]=0x1;transfers[_0x5d8dd2['transfertargetuniqueid']]=_[_0xa750('0x49')](agents[_0x5d8dd2[_0xa750('0x48')]]);transfers[_0x5d8dd2['transfertargetuniqueid']][_0xa750('0x9')]=agents[_0x5d8dd2[_0xa750('0x39')]][_0xa750('0x9')];transfers[_0x5d8dd2[_0xa750('0x48')]][_0xa750('0x42')]=agents[_0x5d8dd2[_0xa750('0x39')]][_0xa750('0x42')];transfers[_0x5d8dd2[_0xa750('0x48')]][_0xa750('0x43')]=utils[_0xa750('0x17')]();transfers[_0x5d8dd2[_0xa750('0x48')]]['agentconnectAt']=utils['now']();transfers[_0x5d8dd2[_0xa750('0x48')]][_0xa750('0x1f')]=0x0;transfers[_0x5d8dd2[_0xa750('0x48')]][_0xa750('0x41')]=0x2;}}}catch(_0x5e17a0){utils[_0xa750('0x19')](util[_0xa750('0x2')](_0xa750('0x38'),_0x5d8dd2[_0xa750('0x39')]),_0x5e17a0);}};exports[_0xa750('0x4a')]=function(_0x473188){try{utils[_0xa750('0x15')](util[_0xa750('0x2')](_0xa750('0x4b'),_0x473188[_0xa750('0x4')]),_0x473188);if(agents[_0x473188[_0xa750('0x4')]]&&agents[_0x473188['uniqueid']]['reason']===_0xa750('0x1d')){if(_0x473188['cause']==='21'){agents[_0x473188['uniqueid']][_0xa750('0x1e')]=_0xa750('0x4c');agents[_0x473188[_0xa750('0x4')]][_0xa750('0xb')]=_0xa750('0x4c');}utils['info'](util[_0xa750('0x2')](_0xa750('0x4d'),_0x473188[_0xa750('0x4')],agents[_0x473188[_0xa750('0x4')]][_0xa750('0x7')],agents[_0x473188[_0xa750('0x4')]]['reason'],agents[_0x473188['uniqueid']][_0xa750('0xb')]));writeDB(agents[_0x473188[_0xa750('0x4')]]);var _0x30a371=unanswered[_0xa750('0x4e')](_0x473188[_0xa750('0x4')]);if(_0x30a371>-0x1){unanswered[_0xa750('0x4f')](_0x30a371,0x1);}}if(transfers[_0x473188[_0xa750('0x4')]]){transfers[_0x473188[_0xa750('0x4')]]['agentcomplete']=!![];transfers[_0x473188[_0xa750('0x4')]]['agentcompleteAt']=utils['now']();transfers[_0x473188[_0xa750('0x4')]][_0xa750('0x21')]=utils[_0xa750('0x50')](transfers[_0x473188[_0xa750('0x4')]]['agentcompleteAt'],transfers[_0x473188[_0xa750('0x4')]][_0xa750('0x31')]);transfers[_0x473188[_0xa750('0x4')]][_0xa750('0x1e')]='agent';transfers[_0x473188[_0xa750('0x4')]][_0xa750('0xb')]=_0xa750('0x32');utils[_0xa750('0x1')](util[_0xa750('0x2')](_0xa750('0x4d'),_0x473188[_0xa750('0x4')],transfers[_0x473188[_0xa750('0x4')]]['membername'],transfers[_0x473188['uniqueid']][_0xa750('0x1e')],transfers[_0x473188['uniqueid']][_0xa750('0xb')]));writeDB(transfers[_0x473188[_0xa750('0x4')]],!![]);}if(agents[_0x473188['uniqueid']]&&agents[_0x473188[_0xa750('0x4')]]['agentconnectAt']){agents[_0x473188[_0xa750('0x4')]][_0xa750('0xe')]=!![];agents[_0x473188[_0xa750('0x4')]]['agentcompleteAt']=utils[_0xa750('0x17')]();agents[_0x473188[_0xa750('0x4')]][_0xa750('0x21')]=utils[_0xa750('0x50')](agents[_0x473188['uniqueid']]['agentcompleteAt'],agents[_0x473188['uniqueid']][_0xa750('0x31')]);agents[_0x473188[_0xa750('0x4')]]['reason']=agents[_0x473188[_0xa750('0x4')]][_0xa750('0x46')]?_0xa750('0x46'):_0xa750('0x51');agents[_0x473188[_0xa750('0x4')]][_0xa750('0xb')]='complete';utils[_0xa750('0x1')](util[_0xa750('0x2')](_0xa750('0x4d'),_0x473188['uniqueid'],agents[_0x473188[_0xa750('0x4')]][_0xa750('0x7')],agents[_0x473188[_0xa750('0x4')]][_0xa750('0x1e')],agents[_0x473188['uniqueid']][_0xa750('0xb')]));writeDB(agents[_0x473188[_0xa750('0x4')]]);}}catch(_0x32b8e7){utils['error'](util[_0xa750('0x2')]('[%s][agents][hangup]',_0x473188[_0xa750('0x4')]),_0x32b8e7);}}; \ No newline at end of file +var _0x2547=['transfertargetuniqueid','clone','[%s][agents][attendedtransfer]','hangup','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','agent','[%s][agents][hangup]','util','./utils','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','queue','membername','interface','calleridnum','lastevent','getVoiceQueueByName','then','agentacw','agentcomplete','acw','acwtime','acwTimeout','CreateVoiceAgentReport','destuniqueid','agentcalled','debug','[%s][agents][agentcalled]','agentcalledAt','now','connectedlinenum','connectedlinename','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','reason','timeout','holdtime','ringtime','push','queuecallerabandon','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','talktime','agentconnect','[%s][agents][agentconnect]','connect','forIn','answered_elsewhere','answeredelsewheredestinationuniqueid','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','agentconnectAt','complete','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','transfertype','blind','extension','transferuniqueid','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','ATTENDED','transferexten','origtransfererexten','transfereeuniqueid','agententerreason','calleridname','secondtransfererlinkedid','secondtransfererexten'];(function(_0x1db87f,_0x27574f){var _0xaa0552=function(_0x19da18){while(--_0x19da18){_0x1db87f['push'](_0x1db87f['shift']());}};_0xaa0552(++_0x27574f);}(_0x2547,0x1cd));var _0x7254=function(_0x286a51,_0x462c82){_0x286a51=_0x286a51-0x0;var _0x35cf8c=_0x2547[_0x286a51];return _0x35cf8c;};'use strict';var _=require('lodash');var util=require(_0x7254('0x0'));var utils=require(_0x7254('0x1'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x44b692,_0x3ea6e6){utils[_0x7254('0x2')](util[_0x7254('0x3')](_0x7254('0x4'),_0x44b692[_0x7254('0x5')],_0x44b692['channel'],_0x44b692[_0x7254('0x6')],_0x44b692[_0x7254('0x7')],_0x44b692[_0x7254('0x8')],_0x44b692[_0x7254('0x9')],_0x44b692['connectedlinenum'],_0x44b692[_0x7254('0xa')]));if(_0x44b692[_0x7254('0x6')]){utils[_0x7254('0xb')](_0x44b692['queue'])[_0x7254('0xc')](function(_0x555b2e){if(_0x555b2e){_0x44b692['type']=_0x555b2e['type'];_0x44b692[_0x7254('0xd')]=_0x44b692[_0x7254('0xe')]?_0x555b2e[_0x7254('0xf')]:![];_0x44b692[_0x7254('0x10')]=_0x44b692[_0x7254('0xd')]?_0x555b2e[_0x7254('0x11')]:0x0;}utils['request'](_0x7254('0x12'),_0x44b692);});}else{utils['request'](_0x7254('0x12'),_0x44b692);}if(_0x3ea6e6){delete transfers[_0x44b692['uniqueid']];}else{delete agents[_0x44b692[_0x7254('0x13')]];}}exports[_0x7254('0x14')]=function(_0x348d4e){try{utils[_0x7254('0x15')](util[_0x7254('0x3')](_0x7254('0x16'),_0x348d4e[_0x7254('0x5')]),_0x348d4e);agents[_0x348d4e[_0x7254('0x13')]]=_0x348d4e;agents[_0x348d4e[_0x7254('0x13')]][_0x7254('0x17')]=utils[_0x7254('0x18')]();agents[_0x348d4e[_0x7254('0x13')]][_0x7254('0xa')]='called';agents[_0x348d4e[_0x7254('0x13')]][_0x7254('0x19')]=null;agents[_0x348d4e[_0x7254('0x13')]][_0x7254('0x1a')]=null;utils[_0x7254('0x2')](util[_0x7254('0x3')](_0x7254('0x1b'),_0x348d4e['uniqueid'],agents[_0x348d4e[_0x7254('0x13')]][_0x7254('0x7')],_0x348d4e[_0x7254('0x13')]));}catch(_0x45aa93){utils[_0x7254('0x1c')](util[_0x7254('0x3')](_0x7254('0x16'),_0x348d4e[_0x7254('0x5')]),_0x45aa93);}};exports[_0x7254('0x1d')]=function(_0x3b6cb6){try{if(!_[_0x7254('0x1e')](agents[_0x3b6cb6[_0x7254('0x13')]])){utils[_0x7254('0x15')](util[_0x7254('0x3')](_0x7254('0x1f'),_0x3b6cb6[_0x7254('0x5')]),_0x3b6cb6);utils[_0x7254('0x2')](util[_0x7254('0x3')](_0x7254('0x20'),_0x3b6cb6[_0x7254('0x5')],agents[_0x3b6cb6[_0x7254('0x13')]]['membername'],_0x3b6cb6['destuniqueid']));agents[_0x3b6cb6[_0x7254('0x13')]][_0x7254('0x1d')]=!![];agents[_0x3b6cb6[_0x7254('0x13')]][_0x7254('0x21')]=utils[_0x7254('0x18')]();agents[_0x3b6cb6[_0x7254('0x13')]][_0x7254('0xa')]='timeout';agents[_0x3b6cb6[_0x7254('0x13')]][_0x7254('0x22')]=_0x7254('0x23');agents[_0x3b6cb6['destuniqueid']][_0x7254('0x24')]=_0x3b6cb6['ringtime']?parseInt(_0x3b6cb6[_0x7254('0x25')])/0x3e8:0x0;agents[_0x3b6cb6[_0x7254('0x13')]]['talktime']=0x0;unanswered[_0x7254('0x26')](_0x3b6cb6[_0x7254('0x13')]);}}catch(_0x4f684c){utils[_0x7254('0x1c')](util[_0x7254('0x3')](_0x7254('0x1f'),_0x3b6cb6[_0x7254('0x5')]),_0x4f684c);}};exports[_0x7254('0x27')]=function(_0xfe02ea){try{_['forIn'](agents,function(_0x146028,_0x2dba3f){if(_0x146028['uniqueid']==_0xfe02ea[_0x7254('0x5')]&&!_[_0x7254('0x28')](unanswered,_0x146028[_0x7254('0x13')])){utils['debug'](util[_0x7254('0x3')](_0x7254('0x29'),_0xfe02ea[_0x7254('0x5')]),_0xfe02ea);utils[_0x7254('0x2')](util[_0x7254('0x3')](_0x7254('0x2a'),_0xfe02ea[_0x7254('0x5')],_0x146028['membername'],_0x146028[_0x7254('0x13')]));_0x146028['agentringnoanswer']=!![];_0x146028['agentringnoanswerAt']=utils[_0x7254('0x18')]();_0x146028[_0x7254('0xa')]=_0x7254('0x2b');_0x146028[_0x7254('0x22')]=_0x7254('0x2b');_0x146028[_0x7254('0x24')]=_0xfe02ea[_0x7254('0x24')];_0x146028[_0x7254('0x2c')]=0x0;writeDB(_0x146028);}});}catch(_0x447515){utils[_0x7254('0x1c')](util[_0x7254('0x3')](_0x7254('0x29'),_0xfe02ea[_0x7254('0x5')]),_0x447515);}};exports[_0x7254('0x2d')]=function(_0x57a7d4){try{if(agents[_0x57a7d4[_0x7254('0x13')]]){utils[_0x7254('0x15')](util[_0x7254('0x3')](_0x7254('0x2e'),_0x57a7d4[_0x7254('0x5')]),_0x57a7d4);utils['info'](util[_0x7254('0x3')]('[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x57a7d4[_0x7254('0x5')],agents[_0x57a7d4[_0x7254('0x13')]][_0x7254('0x7')],_0x57a7d4[_0x7254('0x13')]));agents[_0x57a7d4[_0x7254('0x13')]]['agentconnectAt']=utils[_0x7254('0x18')]();agents[_0x57a7d4['destuniqueid']][_0x7254('0x19')]=_0x57a7d4[_0x7254('0x19')];agents[_0x57a7d4['destuniqueid']][_0x7254('0x1a')]=_0x57a7d4[_0x7254('0x1a')];agents[_0x57a7d4[_0x7254('0x13')]][_0x7254('0x24')]=_0x57a7d4[_0x7254('0x25')];agents[_0x57a7d4[_0x7254('0x13')]]['lastevent']=_0x7254('0x2f');_[_0x7254('0x30')](agents,function(_0x105b8c,_0x4eca7a){if(_0x105b8c[_0x7254('0x13')]!=_0x57a7d4[_0x7254('0x13')]&&_0x105b8c[_0x7254('0x5')]==_0x57a7d4['uniqueid']){_0x105b8c[_0x7254('0x2c')]=0x0;_0x105b8c[_0x7254('0x24')]=_0x57a7d4[_0x7254('0x25')];_0x105b8c[_0x7254('0x1d')]=!![];_0x105b8c[_0x7254('0x21')]=utils['now']();_0x105b8c['lastevent']=_0x7254('0x31');_0x105b8c[_0x7254('0x22')]=_0x7254('0x31');_0x105b8c[_0x7254('0x32')]=_0x57a7d4['destuniqueid'];_0x105b8c['answeredelsewheremembername']=_0x57a7d4[_0x7254('0x7')];writeDB(_0x105b8c);}});}}catch(_0x565cd8){utils[_0x7254('0x1c')](util[_0x7254('0x3')](_0x7254('0x2e'),_0x57a7d4[_0x7254('0x5')]),_0x565cd8);}};exports['agentcomplete']=function(_0x4adf34){try{if(!_[_0x7254('0x1e')](agents[_0x4adf34[_0x7254('0x13')]])){utils[_0x7254('0x15')](util[_0x7254('0x3')](_0x7254('0x33'),_0x4adf34['uniqueid']),_0x4adf34);utils['info'](util[_0x7254('0x3')](_0x7254('0x34'),_0x4adf34[_0x7254('0x5')],agents[_0x4adf34['destuniqueid']][_0x7254('0x7')],_0x4adf34[_0x7254('0x13')]));agents[_0x4adf34['destuniqueid']][_0x7254('0xe')]=!![];agents[_0x4adf34[_0x7254('0x13')]][_0x7254('0x35')]=utils[_0x7254('0x18')]();agents[_0x4adf34['destuniqueid']][_0x7254('0x2c')]=utils[_0x7254('0x36')](agents[_0x4adf34['destuniqueid']][_0x7254('0x35')],agents[_0x4adf34[_0x7254('0x13')]][_0x7254('0x37')]);agents[_0x4adf34['destuniqueid']][_0x7254('0x22')]=_0x4adf34[_0x7254('0x22')];agents[_0x4adf34['destuniqueid']]['lastevent']=_0x7254('0x38');writeDB(agents[_0x4adf34['destuniqueid']]);}}catch(_0x2e437c){utils[_0x7254('0x1c')](util['format']('[%s][agents][agentcomplete]',_0x4adf34[_0x7254('0x5')]),_0x2e437c);}};exports[_0x7254('0x39')]=function(_0x38bcd5){try{if(!_[_0x7254('0x1e')](agents[_0x38bcd5[_0x7254('0x3a')]])){utils[_0x7254('0x15')](util['format'](_0x7254('0x3b'),_0x38bcd5['uniqueid']),_0x38bcd5);utils[_0x7254('0x2')](util[_0x7254('0x3')](_0x7254('0x3c'),_0x38bcd5['uniqueid'],agents[_0x38bcd5[_0x7254('0x3a')]][_0x7254('0x7')],agents[_0x38bcd5[_0x7254('0x3a')]]['uniqueid']));agents[_0x38bcd5[_0x7254('0x3a')]][_0x7254('0x3d')]=!![];agents[_0x38bcd5[_0x7254('0x3a')]][_0x7254('0x3e')]=_0x7254('0x3f');agents[_0x38bcd5['transfereruniqueid']]['transferexten']=_0x38bcd5[_0x7254('0x40')];agents[_0x38bcd5[_0x7254('0x3a')]][_0x7254('0x41')]=agents[_0x38bcd5[_0x7254('0x3a')]][_0x7254('0x5')];}}catch(_0x4c6838){utils['error'](util[_0x7254('0x3')](_0x7254('0x3b'),_0x38bcd5[_0x7254('0x5')]),_0x4c6838);}};exports[_0x7254('0x42')]=function(_0x5061be){try{utils[_0x7254('0x15')](util[_0x7254('0x3')]('[%s][agents][attendedtransfer]',_0x5061be[_0x7254('0x43')]),_0x5061be);if(_0x5061be['origtransfereruniqueid']==_0x5061be[_0x7254('0x44')]){if(!_['isNil'](agents[_0x5061be[_0x7254('0x45')]])){utils['info'](util['format'](_0x7254('0x46'),_0x5061be[_0x7254('0x43')],agents[_0x5061be[_0x7254('0x45')]][_0x7254('0x7')]));agents[_0x5061be['secondtransfereruniqueid']][_0x7254('0x3d')]=!![];agents[_0x5061be['secondtransfereruniqueid']][_0x7254('0x3e')]=_0x7254('0x47');agents[_0x5061be[_0x7254('0x45')]][_0x7254('0x48')]=_0x5061be[_0x7254('0x49')];agents[_0x5061be[_0x7254('0x45')]]['transferuniqueid']=_0x5061be[_0x7254('0x43')];}if(_0x5061be[_0x7254('0x4a')]&&agents[_0x5061be[_0x7254('0x4a')]]){agents[_0x5061be[_0x7254('0x4a')]][_0x7254('0x4b')]=0x1;transfers[_0x5061be[_0x7254('0x4a')]]=_['clone'](agents[_0x5061be[_0x7254('0x4a')]]);transfers[_0x5061be[_0x7254('0x4a')]][_0x7254('0x9')]=agents[_0x5061be[_0x7254('0x45')]][_0x7254('0x9')];transfers[_0x5061be[_0x7254('0x4a')]][_0x7254('0x4c')]=agents[_0x5061be['secondtransfereruniqueid']]['calleridname'];transfers[_0x5061be[_0x7254('0x4a')]]['agentcalledAt']=utils['now']();transfers[_0x5061be[_0x7254('0x4a')]][_0x7254('0x37')]=utils[_0x7254('0x18')]();transfers[_0x5061be['transfereeuniqueid']][_0x7254('0x24')]=0x0;transfers[_0x5061be['transfereeuniqueid']][_0x7254('0x4b')]=0x2;}}else if(_0x5061be[_0x7254('0x45')]==_0x5061be[_0x7254('0x4d')]){if(!_[_0x7254('0x1e')](agents[_0x5061be[_0x7254('0x43')]])){utils['info'](util[_0x7254('0x3')](_0x7254('0x46'),_0x5061be[_0x7254('0x43')],agents[_0x5061be[_0x7254('0x43')]]['membername']));agents[_0x5061be['origtransfereruniqueid']][_0x7254('0x3d')]=!![];agents[_0x5061be[_0x7254('0x43')]][_0x7254('0x3e')]=_0x7254('0x47');agents[_0x5061be[_0x7254('0x43')]][_0x7254('0x48')]=_0x5061be[_0x7254('0x4e')];agents[_0x5061be[_0x7254('0x43')]][_0x7254('0x41')]=_0x5061be[_0x7254('0x45')];}if(_0x5061be[_0x7254('0x4f')]&&agents[_0x5061be[_0x7254('0x4f')]]){agents[_0x5061be[_0x7254('0x4f')]]['agententerreason']=0x1;transfers[_0x5061be[_0x7254('0x4f')]]=_[_0x7254('0x50')](agents[_0x5061be[_0x7254('0x4f')]]);transfers[_0x5061be['transfertargetuniqueid']][_0x7254('0x9')]=agents[_0x5061be[_0x7254('0x43')]][_0x7254('0x9')];transfers[_0x5061be[_0x7254('0x4f')]]['calleridname']=agents[_0x5061be[_0x7254('0x43')]]['calleridname'];transfers[_0x5061be[_0x7254('0x4f')]][_0x7254('0x17')]=utils[_0x7254('0x18')]();transfers[_0x5061be[_0x7254('0x4f')]]['agentconnectAt']=utils[_0x7254('0x18')]();transfers[_0x5061be['transfertargetuniqueid']][_0x7254('0x24')]=0x0;transfers[_0x5061be['transfertargetuniqueid']][_0x7254('0x4b')]=0x2;}}}catch(_0x42dc64){utils[_0x7254('0x1c')](util[_0x7254('0x3')](_0x7254('0x51'),_0x5061be[_0x7254('0x43')]),_0x42dc64);}};exports[_0x7254('0x52')]=function(_0x23b89a){try{utils['debug'](util[_0x7254('0x3')]('[%s][agents][hangup]',_0x23b89a[_0x7254('0x5')]),_0x23b89a);if(agents[_0x23b89a[_0x7254('0x5')]]&&agents[_0x23b89a[_0x7254('0x5')]][_0x7254('0x22')]===_0x7254('0x23')){if(_0x23b89a[_0x7254('0x53')]==='21'){agents[_0x23b89a[_0x7254('0x5')]][_0x7254('0x22')]='rejected';agents[_0x23b89a[_0x7254('0x5')]]['lastevent']=_0x7254('0x54');}utils[_0x7254('0x2')](util[_0x7254('0x3')](_0x7254('0x55'),_0x23b89a[_0x7254('0x5')],agents[_0x23b89a[_0x7254('0x5')]][_0x7254('0x7')],agents[_0x23b89a[_0x7254('0x5')]][_0x7254('0x22')],agents[_0x23b89a[_0x7254('0x5')]][_0x7254('0xa')]));writeDB(agents[_0x23b89a[_0x7254('0x5')]]);var _0x3f7be7=unanswered[_0x7254('0x56')](_0x23b89a[_0x7254('0x5')]);if(_0x3f7be7>-0x1){unanswered[_0x7254('0x57')](_0x3f7be7,0x1);}}if(transfers[_0x23b89a[_0x7254('0x5')]]){transfers[_0x23b89a['uniqueid']]['agentcomplete']=!![];transfers[_0x23b89a[_0x7254('0x5')]][_0x7254('0x35')]=utils['now']();transfers[_0x23b89a['uniqueid']]['talktime']=utils[_0x7254('0x36')](transfers[_0x23b89a[_0x7254('0x5')]][_0x7254('0x35')],transfers[_0x23b89a[_0x7254('0x5')]]['agentconnectAt']);transfers[_0x23b89a[_0x7254('0x5')]][_0x7254('0x22')]='agent';transfers[_0x23b89a[_0x7254('0x5')]][_0x7254('0xa')]=_0x7254('0x38');utils['info'](util['format'](_0x7254('0x55'),_0x23b89a[_0x7254('0x5')],transfers[_0x23b89a['uniqueid']][_0x7254('0x7')],transfers[_0x23b89a[_0x7254('0x5')]][_0x7254('0x22')],transfers[_0x23b89a[_0x7254('0x5')]][_0x7254('0xa')]));writeDB(transfers[_0x23b89a['uniqueid']],!![]);}if(agents[_0x23b89a[_0x7254('0x5')]]&&agents[_0x23b89a[_0x7254('0x5')]][_0x7254('0x37')]){agents[_0x23b89a['uniqueid']][_0x7254('0xe')]=!![];agents[_0x23b89a['uniqueid']]['agentcompleteAt']=utils['now']();agents[_0x23b89a[_0x7254('0x5')]]['talktime']=utils['diffTime'](agents[_0x23b89a[_0x7254('0x5')]][_0x7254('0x35')],agents[_0x23b89a[_0x7254('0x5')]]['agentconnectAt']);agents[_0x23b89a[_0x7254('0x5')]]['reason']=agents[_0x23b89a[_0x7254('0x5')]][_0x7254('0x3d')]?'transfer':_0x7254('0x58');agents[_0x23b89a[_0x7254('0x5')]][_0x7254('0xa')]=_0x7254('0x38');utils[_0x7254('0x2')](util[_0x7254('0x3')](_0x7254('0x55'),_0x23b89a['uniqueid'],agents[_0x23b89a[_0x7254('0x5')]]['membername'],agents[_0x23b89a['uniqueid']][_0x7254('0x22')],agents[_0x23b89a[_0x7254('0x5')]][_0x7254('0xa')]));writeDB(agents[_0x23b89a[_0x7254('0x5')]]);}}catch(_0x54c7d5){utils[_0x7254('0x1c')](util[_0x7254('0x3')](_0x7254('0x59'),_0x23b89a[_0x7254('0x5')]),_0x54c7d5);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 5f043a4..ec070ee 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 _0xef04=['[%s][calls][varset]','variable','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','source','value','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-callerid-preview','xmd-queue','xmcs-queue','lastapplication','Queue','lastdata','queue','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','application','appdata','toLowerCase','startsWith','split','substring','lastIndexOf','execif','gotoif','[%s][calls][newexten]','util','./utils','FAILED','NO\x20ANSWER','ANSWERED','BUSY','info','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','calleridnum','lastevent','accountcode','getUserByInternal','UserId','request','CreateVoiceCallReport','newchannel','debug','format','[%s][calls][newchannel]','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','now','DOCUMENTATION','newstate','isNil','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','channelstate','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','linkedid','destinationchannel','answertime','disposition','toNumber','error','[%s][calls][newstate]','hangup','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','duration','diffTime','starttime','billableseconds','endtime','[%s][calls][hangup]','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','origtransfereruniqueid','secondtransfererchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','varset'];(function(_0x2bb18c,_0x44c34e){var _0x2fa5e8=function(_0x46912f){while(--_0x46912f){_0x2bb18c['push'](_0x2bb18c['shift']());}};_0x2fa5e8(++_0x44c34e);}(_0xef04,0x16b));var _0x4ef0=function(_0x3422cf,_0x3640fb){_0x3422cf=_0x3422cf-0x0;var _0x377b90=_0xef04[_0x3422cf];return _0x377b90;};'use strict';var _=require('lodash');var util=require(_0x4ef0('0x0'));var utils=require(_0x4ef0('0x1'));var dispositions=['NO\x20ANSWER',_0x4ef0('0x2'),'FAILED','NO\x20ANSWER',_0x4ef0('0x3'),_0x4ef0('0x3'),_0x4ef0('0x4'),_0x4ef0('0x5'),_0x4ef0('0x2'),_0x4ef0('0x2'),'FAILED'];var channels={};function writeDB(_0x4fa117){utils[_0x4ef0('0x6')](util['format'](_0x4ef0('0x7'),_0x4fa117[_0x4ef0('0x8')],_0x4fa117[_0x4ef0('0x9')],_0x4fa117['queue'],_0x4fa117['membername'],_0x4fa117['interface'],_0x4fa117[_0x4ef0('0xa')],_0x4fa117['connectedlinenum'],_0x4fa117[_0x4ef0('0xb')]));if(_0x4fa117[_0x4ef0('0xc')]){utils[_0x4ef0('0xd')](_0x4fa117['accountcode'])['then'](function(_0x4eed17){if(_0x4eed17){_0x4fa117[_0x4ef0('0xe')]=_0x4eed17['id'];}utils[_0x4ef0('0xf')](_0x4ef0('0x10'),_0x4fa117);});}else{utils[_0x4ef0('0xf')]('CreateVoiceCallReport',_0x4fa117);}if(channels[_0x4fa117[_0x4ef0('0x8')]]){delete channels[_0x4fa117[_0x4ef0('0x8')]];}}exports[_0x4ef0('0x11')]=function(_0x38ed86){try{utils[_0x4ef0('0x12')](util[_0x4ef0('0x13')](_0x4ef0('0x14'),_0x38ed86[_0x4ef0('0x8')]),_0x38ed86);if(_0x38ed86['uniqueid']==_0x38ed86['linkedid']&&_0x38ed86['channel']!=_0x4ef0('0x15')){utils[_0x4ef0('0x6')](util[_0x4ef0('0x13')](_0x4ef0('0x16'),_0x38ed86[_0x4ef0('0x8')],_0x38ed86[_0x4ef0('0x17')],_0x38ed86[_0x4ef0('0x18')]));channels[_0x38ed86[_0x4ef0('0x8')]]={'uniqueid':_0x38ed86[_0x4ef0('0x8')],'accountcode':_0x38ed86[_0x4ef0('0xc')],'source':_0x38ed86[_0x4ef0('0xa')],'destination':_0x38ed86[_0x4ef0('0x18')],'destinationcontext':_0x38ed86[_0x4ef0('0x17')],'channel':_0x38ed86[_0x4ef0('0x9')],'starttime':utils[_0x4ef0('0x19')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x4ef0('0x3'),'amaflags':_0x4ef0('0x1a')};}}catch(_0x6f8ce9){utils['error'](util['format'](_0x4ef0('0x14'),_0x38ed86['uniqueid']),_0x6f8ce9);}};exports[_0x4ef0('0x1b')]=function(_0x17e001){try{utils['debug'](util[_0x4ef0('0x13')]('[%s][calls][newstate]',_0x17e001[_0x4ef0('0x8')]),_0x17e001);if(!_[_0x4ef0('0x1c')](channels[_0x17e001[_0x4ef0('0x8')]])&&_0x17e001['channelstate']==0x6){utils[_0x4ef0('0x6')](util[_0x4ef0('0x13')](_0x4ef0('0x1d'),_0x17e001[_0x4ef0('0x8')],_0x17e001[_0x4ef0('0x17')],_0x17e001[_0x4ef0('0x9')]));if(_[_0x4ef0('0x1c')](channels[_0x17e001[_0x4ef0('0x8')]][_0x4ef0('0x1e')])){channels[_0x17e001[_0x4ef0('0x8')]][_0x4ef0('0x1e')]=utils[_0x4ef0('0x19')]();}}else if(!_[_0x4ef0('0x1c')](channels[_0x17e001['linkedid']])&&_0x17e001[_0x4ef0('0x1f')]==0x6&&_0x17e001[_0x4ef0('0x17')]!='transfer'){utils['info'](util[_0x4ef0('0x13')](_0x4ef0('0x20'),_0x17e001['uniqueid'],_0x17e001['linkedid'],_0x17e001[_0x4ef0('0x17')],_0x17e001[_0x4ef0('0x9')]));channels[_0x17e001['linkedid']][_0x4ef0('0xc')]=_0x17e001[_0x4ef0('0xc')];channels[_0x17e001[_0x4ef0('0x21')]][_0x4ef0('0x22')]=_0x17e001[_0x4ef0('0x9')];if(_[_0x4ef0('0x1c')](channels[_0x17e001['linkedid']][_0x4ef0('0x23')])){channels[_0x17e001[_0x4ef0('0x21')]][_0x4ef0('0x23')]=utils[_0x4ef0('0x19')]();}channels[_0x17e001[_0x4ef0('0x21')]][_0x4ef0('0x24')]=dispositions[_[_0x4ef0('0x25')](_0x17e001[_0x4ef0('0x1f')])]||_0x4ef0('0x4');}}catch(_0x4b924e){utils[_0x4ef0('0x26')](util[_0x4ef0('0x13')](_0x4ef0('0x27'),_0x17e001[_0x4ef0('0x8')]),_0x4b924e);}};exports[_0x4ef0('0x28')]=function(_0x3263bd){try{if(!_[_0x4ef0('0x1c')](channels[_0x3263bd['uniqueid']])){utils['debug'](util['format']('[%s][calls][hangup]',_0x3263bd[_0x4ef0('0x8')]),_0x3263bd);if(_['isNil'](channels[_0x3263bd[_0x4ef0('0x8')]]['callerid'])){channels[_0x3263bd[_0x4ef0('0x8')]][_0x4ef0('0x29')]=_0x3263bd[_0x4ef0('0x2a')]+'\x20<'+_0x3263bd['calleridnum']+'>';}utils['info'](util[_0x4ef0('0x13')](_0x4ef0('0x2b'),_0x3263bd[_0x4ef0('0x8')],channels[_0x3263bd['uniqueid']][_0x4ef0('0x29')],_0x3263bd[_0x4ef0('0x2c')]));channels[_0x3263bd['uniqueid']]['endtime']=utils[_0x4ef0('0x19')]();channels[_0x3263bd['uniqueid']][_0x4ef0('0x2d')]=utils[_0x4ef0('0x2e')](channels[_0x3263bd[_0x4ef0('0x8')]]['endtime'],channels[_0x3263bd[_0x4ef0('0x8')]][_0x4ef0('0x2f')]);channels[_0x3263bd['uniqueid']][_0x4ef0('0x30')]=channels[_0x3263bd['uniqueid']][_0x4ef0('0x23')]?utils['diffTime'](channels[_0x3263bd[_0x4ef0('0x8')]][_0x4ef0('0x31')],channels[_0x3263bd[_0x4ef0('0x8')]][_0x4ef0('0x23')]):0x0;writeDB(channels[_0x3263bd[_0x4ef0('0x8')]]);}}catch(_0xbd650b){utils['error'](util[_0x4ef0('0x13')](_0x4ef0('0x32'),_0x3263bd[_0x4ef0('0x8')]),_0xbd650b);}};exports[_0x4ef0('0x33')]=function(_0xe4d59){try{if(!_[_0x4ef0('0x1c')](channels[_0xe4d59[_0x4ef0('0x34')]])){utils['debug'](util[_0x4ef0('0x13')](_0x4ef0('0x35'),_0xe4d59['origtransfereruniqueid']),_0xe4d59);if(channels[_0xe4d59[_0x4ef0('0x34')]]['channel']==_0xe4d59['transfereechannel']){utils[_0x4ef0('0x6')](util[_0x4ef0('0x13')](_0x4ef0('0x36'),_0xe4d59[_0x4ef0('0x37')],_0xe4d59['localtwolinkedid'],_0xe4d59[_0x4ef0('0x38')]));channels[_0xe4d59[_0x4ef0('0x34')]]['destinationchannel']=_0xe4d59[_0x4ef0('0x38')];channels[_0xe4d59[_0x4ef0('0x34')]][_0x4ef0('0x39')]=_0x4ef0('0x3a');}else if(channels[_0xe4d59[_0x4ef0('0x34')]][_0x4ef0('0x9')]=_0xe4d59[_0x4ef0('0x3b')]){utils[_0x4ef0('0x6')](util['format'](_0x4ef0('0x36'),_0xe4d59[_0x4ef0('0x37')],_0xe4d59[_0x4ef0('0x34')],_0xe4d59[_0x4ef0('0x3c')]));channels[_0xe4d59['localtwolinkedid']]['destinationchannel']=_0xe4d59[_0x4ef0('0x3c')];channels[_0xe4d59[_0x4ef0('0x34')]]['userfield']='_attended';}}}catch(_0xe02e25){utils['error'](util['format']('[%s][calls][attendedtransfer]',_0xe4d59[_0x4ef0('0x37')]),_0xe02e25);}};exports['musiconholdstart']=function(_0x55140e){try{if(!_['isNil'](channels[_0x55140e[_0x4ef0('0x8')]])){utils[_0x4ef0('0x12')](util[_0x4ef0('0x13')](_0x4ef0('0x3d'),_0x55140e[_0x4ef0('0x8')]),_0x55140e);channels[_0x55140e[_0x4ef0('0x8')]][_0x4ef0('0x3e')]=utils['now']();utils['info'](util[_0x4ef0('0x13')](_0x4ef0('0x3f'),_0x55140e[_0x4ef0('0x8')],channels[_0x55140e['uniqueid']][_0x4ef0('0x3e')]));}}catch(_0x3f752d){utils[_0x4ef0('0x26')](util[_0x4ef0('0x13')](_0x4ef0('0x3d'),_0x55140e['uniqueid']),_0x3f752d);}};exports[_0x4ef0('0x40')]=function(_0xeb2e95){try{if(!_[_0x4ef0('0x1c')](channels[_0xeb2e95[_0x4ef0('0x8')]])){utils[_0x4ef0('0x12')](util[_0x4ef0('0x13')](_0x4ef0('0x41'),_0xeb2e95[_0x4ef0('0x8')]),_0xeb2e95);if(!_[_0x4ef0('0x1c')](channels[_0xeb2e95[_0x4ef0('0x8')]][_0x4ef0('0x3e')])){channels[_0xeb2e95[_0x4ef0('0x8')]][_0x4ef0('0x42')]+=utils[_0x4ef0('0x2e')](utils['now'](),channels[_0xeb2e95['uniqueid']][_0x4ef0('0x3e')]);utils[_0x4ef0('0x6')](util[_0x4ef0('0x13')](_0x4ef0('0x43'),_0xeb2e95[_0x4ef0('0x8')],channels[_0xeb2e95[_0x4ef0('0x8')]]['mohtime']));delete channels[_0xeb2e95[_0x4ef0('0x8')]]['musiconholdstartAt'];}}}catch(_0x145500){utils['error'](util['format'](_0x4ef0('0x41'),_0xeb2e95['uniqueid']),_0x145500);}};exports[_0x4ef0('0x44')]=function(_0x1c1b53){try{if(!_[_0x4ef0('0x1c')](channels[_0x1c1b53[_0x4ef0('0x8')]])){utils[_0x4ef0('0x12')](util[_0x4ef0('0x13')](_0x4ef0('0x45'),_0x1c1b53['uniqueid']),_0x1c1b53);if(!_[_0x4ef0('0x1c')](_0x1c1b53[_0x4ef0('0x46')]['xmd-originatecalleridnum'])){utils[_0x4ef0('0x6')](util['format'](_0x4ef0('0x47'),_0x1c1b53[_0x4ef0('0x8')],_0x1c1b53['value']));channels[_0x1c1b53[_0x4ef0('0x8')]][_0x4ef0('0x48')]=_0x1c1b53[_0x4ef0('0x49')];}if(!_[_0x4ef0('0x1c')](_0x1c1b53[_0x4ef0('0x46')][_0x4ef0('0x4a')])){utils[_0x4ef0('0x6')](util[_0x4ef0('0x13')](_0x4ef0('0x4b'),_0x1c1b53[_0x4ef0('0x8')],_0x1c1b53[_0x4ef0('0x49')]));channels[_0x1c1b53[_0x4ef0('0x8')]][_0x4ef0('0x4c')]=_0x1c1b53[_0x4ef0('0x49')];channels[_0x1c1b53[_0x4ef0('0x8')]]['callerid']='\x22'+_0x1c1b53[_0x4ef0('0x49')]+_0x4ef0('0x4d')+_0x1c1b53[_0x4ef0('0x49')]+'>';}if(!_[_0x4ef0('0x1c')](_0x1c1b53[_0x4ef0('0x46')]['xmd-callerid-preview'])||!_[_0x4ef0('0x1c')](_0x1c1b53[_0x4ef0('0x46')][_0x4ef0('0x4e')])){utils['info'](util[_0x4ef0('0x13')](_0x4ef0('0x4f'),_0x1c1b53[_0x4ef0('0x8')],!_[_0x4ef0('0x1c')](_0x1c1b53[_0x4ef0('0x46')][_0x4ef0('0x50')])?'xmd-callerid-preview':_0x4ef0('0x4e'),_0x1c1b53[_0x4ef0('0x49')]));channels[_0x1c1b53['uniqueid']][_0x4ef0('0x29')]=_0x1c1b53[_0x4ef0('0x49')];}if(!_[_0x4ef0('0x1c')](_0x1c1b53[_0x4ef0('0x46')][_0x4ef0('0x51')])||!_['isNil'](_0x1c1b53['variable'][_0x4ef0('0x52')])){utils[_0x4ef0('0x6')](util[_0x4ef0('0x13')](_0x4ef0('0x4f'),_0x1c1b53[_0x4ef0('0x8')],!_[_0x4ef0('0x1c')](_0x1c1b53[_0x4ef0('0x46')][_0x4ef0('0x51')])?_0x4ef0('0x51'):_0x4ef0('0x52'),_0x1c1b53['value']));channels[_0x1c1b53['uniqueid']][_0x4ef0('0x53')]=_0x4ef0('0x54');channels[_0x1c1b53[_0x4ef0('0x8')]][_0x4ef0('0x55')]=_0x1c1b53[_0x4ef0('0x49')];channels[_0x1c1b53[_0x4ef0('0x8')]][_0x4ef0('0x56')]=!![];}if(!_[_0x4ef0('0x1c')](_0x1c1b53['variable']['xmd-contactid'])){utils[_0x4ef0('0x6')](util['format'](_0x4ef0('0x57'),_0x1c1b53[_0x4ef0('0x8')],_0x1c1b53[_0x4ef0('0x49')]));channels[_0x1c1b53[_0x4ef0('0x8')]][_0x4ef0('0x58')]=_0x1c1b53[_0x4ef0('0x49')];}if(!_[_0x4ef0('0x1c')](_0x1c1b53[_0x4ef0('0x46')][_0x4ef0('0x59')])){utils['info'](util[_0x4ef0('0x13')](_0x4ef0('0x5a'),_0x1c1b53[_0x4ef0('0x8')],_0x1c1b53[_0x4ef0('0x49')]));channels[_0x1c1b53['uniqueid']][_0x4ef0('0x5b')]=_0x1c1b53['value'];}if(!_[_0x4ef0('0x1c')](_0x1c1b53['variable'][_0x4ef0('0x5c')])){utils[_0x4ef0('0x6')](util[_0x4ef0('0x13')](_0x4ef0('0x5d'),_0x1c1b53[_0x4ef0('0x8')],_0x1c1b53[_0x4ef0('0x49')]));channels[_0x1c1b53[_0x4ef0('0x8')]][_0x4ef0('0x5e')]=_0x1c1b53['value'];}if(!_[_0x4ef0('0x1c')](_0x1c1b53[_0x4ef0('0x46')][_0x4ef0('0x5f')])){utils[_0x4ef0('0x6')](util['format'](_0x4ef0('0x60'),_0x1c1b53['uniqueid'],_0x1c1b53[_0x4ef0('0x49')]));channels[_0x1c1b53[_0x4ef0('0x8')]][_0x4ef0('0x5f')]=_0x1c1b53[_0x4ef0('0x49')];}}}catch(_0x44e835){utils['error'](util['format'](_0x4ef0('0x45'),_0x1c1b53[_0x4ef0('0x8')]),_0x44e835);}};exports[_0x4ef0('0x61')]=function(_0x3dc060){try{if(!_[_0x4ef0('0x1c')](channels[_0x3dc060[_0x4ef0('0x8')]])){utils[_0x4ef0('0x12')](util['format']('[%s][calls][newexten]',_0x3dc060[_0x4ef0('0x8')]),_0x3dc060);utils['info'](util['format']('[%s][calls][newexten]\x20application:%s\x20appdata:%s',_0x3dc060[_0x4ef0('0x8')],_0x3dc060[_0x4ef0('0x62')],_0x3dc060[_0x4ef0('0x63')]));if(_0x3dc060[_0x4ef0('0x62')][_0x4ef0('0x64')]()=='set'&&_[_0x4ef0('0x65')](_0x3dc060[_0x4ef0('0x63')][_0x4ef0('0x64')](),'cdr')){var _0x37bb58=_0x3dc060[_0x4ef0('0x63')][_0x4ef0('0x66')]('=');var _0x3ea408=_0x37bb58[0x0][_0x4ef0('0x67')](_0x37bb58[0x0][_0x4ef0('0x68')]('(')+0x1,_0x37bb58[0x0][_0x4ef0('0x68')](')'));var _0x55ce69=_0x37bb58[0x1];channels[_0x3dc060[_0x4ef0('0x8')]][_0x3ea408]=_0x55ce69;}if(!_['includes']([_0x4ef0('0x28'),'noop',_0x4ef0('0x69'),'set',_0x4ef0('0x6a')],_0x3dc060[_0x4ef0('0x62')][_0x4ef0('0x64')]())){channels[_0x3dc060[_0x4ef0('0x8')]]['lastapplication']=_0x3dc060['application'];channels[_0x3dc060[_0x4ef0('0x8')]][_0x4ef0('0x55')]=_0x3dc060[_0x4ef0('0x63')];}}}catch(_0x430b18){utils[_0x4ef0('0x26')](util[_0x4ef0('0x13')](_0x4ef0('0x6b'),_0x3dc060[_0x4ef0('0x8')]),_0x430b18);}}; \ No newline at end of file +var _0x67d0=['xmd-callerid','xmd-queue','xmcs-queue','lastapplication','Queue','lastdata','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','newexten','[%s][calls][newexten]','application','appdata','toLowerCase','set','startsWith','split','substring','lastIndexOf','includes','hangup','execif','gotoif','lodash','./utils','FAILED','NO\x20ANSWER','ANSWERED','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','membername','interface','getUserByInternal','UserId','CreateVoiceCallReport','request','newchannel','debug','[%s][calls][newchannel]','linkedid','channel','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','accountcode','calleridnum','exten','DOCUMENTATION','[%s][calls][newstate]','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','now','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','answertime','disposition','error','[%s][calls][hangup]','callerid','calleridname','cause-txt','endtime','duration','starttime','attendedtransfer','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','localtwolinkedid','secondtransfererchannel','_attended','transfertargetchannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','musiconholdstop','mohtime','diffTime','[%s][calls][musiconholdstop]\x20mohtime:%s','[%s][calls][varset]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-callerid-preview'];(function(_0x993a27,_0x2374b1){var _0x2cc9ba=function(_0x596ba8){while(--_0x596ba8){_0x993a27['push'](_0x993a27['shift']());}};_0x2cc9ba(++_0x2374b1);}(_0x67d0,0xeb));var _0x067d=function(_0x530db2,_0x2193ed){_0x530db2=_0x530db2-0x0;var _0x23654d=_0x67d0[_0x530db2];return _0x23654d;};'use strict';var _=require(_0x067d('0x0'));var util=require('util');var utils=require(_0x067d('0x1'));var dispositions=['NO\x20ANSWER',_0x067d('0x2'),_0x067d('0x2'),_0x067d('0x3'),'NO\x20ANSWER','NO\x20ANSWER',_0x067d('0x4'),'BUSY',_0x067d('0x2'),_0x067d('0x2'),'FAILED'];var channels={};function writeDB(_0x391ccb){utils[_0x067d('0x5')](util[_0x067d('0x6')](_0x067d('0x7'),_0x391ccb[_0x067d('0x8')],_0x391ccb['channel'],_0x391ccb['queue'],_0x391ccb[_0x067d('0x9')],_0x391ccb[_0x067d('0xa')],_0x391ccb['calleridnum'],_0x391ccb['connectedlinenum'],_0x391ccb['lastevent']));if(_0x391ccb['accountcode']){utils[_0x067d('0xb')](_0x391ccb['accountcode'])['then'](function(_0x215505){if(_0x215505){_0x391ccb[_0x067d('0xc')]=_0x215505['id'];}utils['request'](_0x067d('0xd'),_0x391ccb);});}else{utils[_0x067d('0xe')](_0x067d('0xd'),_0x391ccb);}if(channels[_0x391ccb[_0x067d('0x8')]]){delete channels[_0x391ccb[_0x067d('0x8')]];}}exports[_0x067d('0xf')]=function(_0xc6fe1c){try{utils[_0x067d('0x10')](util['format'](_0x067d('0x11'),_0xc6fe1c[_0x067d('0x8')]),_0xc6fe1c);if(_0xc6fe1c['uniqueid']==_0xc6fe1c[_0x067d('0x12')]&&_0xc6fe1c[_0x067d('0x13')]!=_0x067d('0x14')){utils['info'](util[_0x067d('0x6')](_0x067d('0x15'),_0xc6fe1c['uniqueid'],_0xc6fe1c[_0x067d('0x16')],_0xc6fe1c['exten']));channels[_0xc6fe1c[_0x067d('0x8')]]={'uniqueid':_0xc6fe1c[_0x067d('0x8')],'accountcode':_0xc6fe1c[_0x067d('0x17')],'source':_0xc6fe1c[_0x067d('0x18')],'destination':_0xc6fe1c[_0x067d('0x19')],'destinationcontext':_0xc6fe1c[_0x067d('0x16')],'channel':_0xc6fe1c[_0x067d('0x13')],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x067d('0x3'),'amaflags':_0x067d('0x1a')};}}catch(_0x24c1d1){utils['error'](util[_0x067d('0x6')](_0x067d('0x11'),_0xc6fe1c[_0x067d('0x8')]),_0x24c1d1);}};exports['newstate']=function(_0x277880){try{utils['debug'](util[_0x067d('0x6')](_0x067d('0x1b'),_0x277880[_0x067d('0x8')]),_0x277880);if(!_[_0x067d('0x1c')](channels[_0x277880['uniqueid']])&&_0x277880[_0x067d('0x1d')]==0x6){utils['info'](util['format'](_0x067d('0x1e'),_0x277880[_0x067d('0x8')],_0x277880[_0x067d('0x16')],_0x277880[_0x067d('0x13')]));if(_[_0x067d('0x1c')](channels[_0x277880[_0x067d('0x8')]]['systemanswertime'])){channels[_0x277880['uniqueid']][_0x067d('0x1f')]=utils[_0x067d('0x20')]();}}else if(!_[_0x067d('0x1c')](channels[_0x277880['linkedid']])&&_0x277880[_0x067d('0x1d')]==0x6&&_0x277880['context']!=_0x067d('0x21')){utils[_0x067d('0x5')](util[_0x067d('0x6')](_0x067d('0x22'),_0x277880[_0x067d('0x8')],_0x277880[_0x067d('0x12')],_0x277880[_0x067d('0x16')],_0x277880['channel']));channels[_0x277880[_0x067d('0x12')]][_0x067d('0x17')]=_0x277880[_0x067d('0x17')];channels[_0x277880[_0x067d('0x12')]]['destinationchannel']=_0x277880['channel'];if(_['isNil'](channels[_0x277880['linkedid']]['answertime'])){channels[_0x277880[_0x067d('0x12')]][_0x067d('0x23')]=utils[_0x067d('0x20')]();}channels[_0x277880['linkedid']][_0x067d('0x24')]=dispositions[_['toNumber'](_0x277880[_0x067d('0x1d')])]||'ANSWERED';}}catch(_0x10324c){utils[_0x067d('0x25')](util[_0x067d('0x6')](_0x067d('0x1b'),_0x277880[_0x067d('0x8')]),_0x10324c);}};exports['hangup']=function(_0x5286d7){try{if(!_[_0x067d('0x1c')](channels[_0x5286d7['uniqueid']])){utils[_0x067d('0x10')](util[_0x067d('0x6')](_0x067d('0x26'),_0x5286d7[_0x067d('0x8')]),_0x5286d7);if(_[_0x067d('0x1c')](channels[_0x5286d7[_0x067d('0x8')]][_0x067d('0x27')])){channels[_0x5286d7[_0x067d('0x8')]][_0x067d('0x27')]=_0x5286d7[_0x067d('0x28')]+'\x20<'+_0x5286d7[_0x067d('0x18')]+'>';}utils['info'](util[_0x067d('0x6')]('[%s][calls][hangup]\x20callerid:%s\x20reason:%s',_0x5286d7[_0x067d('0x8')],channels[_0x5286d7[_0x067d('0x8')]][_0x067d('0x27')],_0x5286d7[_0x067d('0x29')]));channels[_0x5286d7[_0x067d('0x8')]][_0x067d('0x2a')]=utils[_0x067d('0x20')]();channels[_0x5286d7['uniqueid']][_0x067d('0x2b')]=utils['diffTime'](channels[_0x5286d7[_0x067d('0x8')]]['endtime'],channels[_0x5286d7[_0x067d('0x8')]][_0x067d('0x2c')]);channels[_0x5286d7[_0x067d('0x8')]]['billableseconds']=channels[_0x5286d7[_0x067d('0x8')]][_0x067d('0x23')]?utils['diffTime'](channels[_0x5286d7[_0x067d('0x8')]][_0x067d('0x2a')],channels[_0x5286d7['uniqueid']][_0x067d('0x23')]):0x0;writeDB(channels[_0x5286d7[_0x067d('0x8')]]);}}catch(_0x28a38d){utils[_0x067d('0x25')](util[_0x067d('0x6')](_0x067d('0x26'),_0x5286d7[_0x067d('0x8')]),_0x28a38d);}};exports[_0x067d('0x2d')]=function(_0x2f00a4){try{if(!_[_0x067d('0x1c')](channels[_0x2f00a4['localtwolinkedid']])){utils[_0x067d('0x10')](util[_0x067d('0x6')](_0x067d('0x2e'),_0x2f00a4[_0x067d('0x2f')]),_0x2f00a4);if(channels[_0x2f00a4['localtwolinkedid']]['channel']==_0x2f00a4[_0x067d('0x30')]){utils[_0x067d('0x5')](util['format']('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x2f00a4['origtransfereruniqueid'],_0x2f00a4[_0x067d('0x31')],_0x2f00a4[_0x067d('0x32')]));channels[_0x2f00a4[_0x067d('0x31')]]['destinationchannel']=_0x2f00a4[_0x067d('0x32')];channels[_0x2f00a4['localtwolinkedid']]['userfield']=_0x067d('0x33');}else if(channels[_0x2f00a4[_0x067d('0x31')]]['channel']=_0x2f00a4[_0x067d('0x34')]){utils[_0x067d('0x5')](util[_0x067d('0x6')](_0x067d('0x35'),_0x2f00a4[_0x067d('0x2f')],_0x2f00a4[_0x067d('0x31')],_0x2f00a4[_0x067d('0x36')]));channels[_0x2f00a4['localtwolinkedid']]['destinationchannel']=_0x2f00a4[_0x067d('0x36')];channels[_0x2f00a4[_0x067d('0x31')]]['userfield']=_0x067d('0x33');}}}catch(_0x5ca736){utils[_0x067d('0x25')](util[_0x067d('0x6')](_0x067d('0x2e'),_0x2f00a4[_0x067d('0x2f')]),_0x5ca736);}};exports[_0x067d('0x37')]=function(_0x150a4d){try{if(!_[_0x067d('0x1c')](channels[_0x150a4d[_0x067d('0x8')]])){utils['debug'](util['format'](_0x067d('0x38'),_0x150a4d[_0x067d('0x8')]),_0x150a4d);channels[_0x150a4d[_0x067d('0x8')]][_0x067d('0x39')]=utils[_0x067d('0x20')]();utils[_0x067d('0x5')](util[_0x067d('0x6')]('[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s',_0x150a4d[_0x067d('0x8')],channels[_0x150a4d[_0x067d('0x8')]][_0x067d('0x39')]));}}catch(_0x3485fb){utils[_0x067d('0x25')](util[_0x067d('0x6')](_0x067d('0x38'),_0x150a4d[_0x067d('0x8')]),_0x3485fb);}};exports[_0x067d('0x3a')]=function(_0x4f9c9b){try{if(!_[_0x067d('0x1c')](channels[_0x4f9c9b['uniqueid']])){utils[_0x067d('0x10')](util[_0x067d('0x6')]('[%s][calls][musiconholdstop]',_0x4f9c9b[_0x067d('0x8')]),_0x4f9c9b);if(!_[_0x067d('0x1c')](channels[_0x4f9c9b[_0x067d('0x8')]][_0x067d('0x39')])){channels[_0x4f9c9b[_0x067d('0x8')]][_0x067d('0x3b')]+=utils[_0x067d('0x3c')](utils['now'](),channels[_0x4f9c9b[_0x067d('0x8')]][_0x067d('0x39')]);utils[_0x067d('0x5')](util[_0x067d('0x6')](_0x067d('0x3d'),_0x4f9c9b['uniqueid'],channels[_0x4f9c9b[_0x067d('0x8')]]['mohtime']));delete channels[_0x4f9c9b[_0x067d('0x8')]][_0x067d('0x39')];}}}catch(_0x5c27fa){utils[_0x067d('0x25')](util['format']('[%s][calls][musiconholdstop]',_0x4f9c9b[_0x067d('0x8')]),_0x5c27fa);}};exports['varset']=function(_0x2a3697){try{if(!_[_0x067d('0x1c')](channels[_0x2a3697[_0x067d('0x8')]])){utils[_0x067d('0x10')](util['format'](_0x067d('0x3e'),_0x2a3697[_0x067d('0x8')]),_0x2a3697);if(!_[_0x067d('0x1c')](_0x2a3697[_0x067d('0x3f')][_0x067d('0x40')])){utils[_0x067d('0x5')](util[_0x067d('0x6')](_0x067d('0x41'),_0x2a3697[_0x067d('0x8')],_0x2a3697[_0x067d('0x42')]));channels[_0x2a3697[_0x067d('0x8')]][_0x067d('0x43')]=_0x2a3697[_0x067d('0x42')];}if(!_['isNil'](_0x2a3697[_0x067d('0x3f')][_0x067d('0x44')])){utils[_0x067d('0x5')](util[_0x067d('0x6')](_0x067d('0x45'),_0x2a3697[_0x067d('0x8')],_0x2a3697[_0x067d('0x42')]));channels[_0x2a3697[_0x067d('0x8')]][_0x067d('0x46')]=_0x2a3697['value'];channels[_0x2a3697[_0x067d('0x8')]][_0x067d('0x27')]='\x22'+_0x2a3697[_0x067d('0x42')]+_0x067d('0x47')+_0x2a3697[_0x067d('0x42')]+'>';}if(!_[_0x067d('0x1c')](_0x2a3697[_0x067d('0x3f')]['xmd-callerid-preview'])||!_[_0x067d('0x1c')](_0x2a3697['variable']['xmd-callerid'])){utils[_0x067d('0x5')](util[_0x067d('0x6')](_0x067d('0x48'),_0x2a3697[_0x067d('0x8')],!_['isNil'](_0x2a3697[_0x067d('0x3f')][_0x067d('0x49')])?_0x067d('0x49'):_0x067d('0x4a'),_0x2a3697[_0x067d('0x42')]));channels[_0x2a3697[_0x067d('0x8')]][_0x067d('0x27')]=_0x2a3697[_0x067d('0x42')];}if(!_[_0x067d('0x1c')](_0x2a3697[_0x067d('0x3f')][_0x067d('0x4b')])||!_[_0x067d('0x1c')](_0x2a3697[_0x067d('0x3f')]['xmcs-queue'])){utils[_0x067d('0x5')](util[_0x067d('0x6')](_0x067d('0x48'),_0x2a3697[_0x067d('0x8')],!_['isNil'](_0x2a3697[_0x067d('0x3f')][_0x067d('0x4b')])?'xmd-queue':_0x067d('0x4c'),_0x2a3697[_0x067d('0x42')]));channels[_0x2a3697[_0x067d('0x8')]][_0x067d('0x4d')]=_0x067d('0x4e');channels[_0x2a3697[_0x067d('0x8')]][_0x067d('0x4f')]=_0x2a3697['value'];channels[_0x2a3697['uniqueid']]['queue']=!![];}if(!_[_0x067d('0x1c')](_0x2a3697[_0x067d('0x3f')][_0x067d('0x50')])){utils[_0x067d('0x5')](util['format'](_0x067d('0x51'),_0x2a3697[_0x067d('0x8')],_0x2a3697[_0x067d('0x42')]));channels[_0x2a3697[_0x067d('0x8')]][_0x067d('0x52')]=_0x2a3697[_0x067d('0x42')];}if(!_[_0x067d('0x1c')](_0x2a3697[_0x067d('0x3f')][_0x067d('0x53')])){utils[_0x067d('0x5')](util['format'](_0x067d('0x54'),_0x2a3697[_0x067d('0x8')],_0x2a3697[_0x067d('0x42')]));channels[_0x2a3697[_0x067d('0x8')]][_0x067d('0x55')]=_0x2a3697[_0x067d('0x42')];}if(!_[_0x067d('0x1c')](_0x2a3697[_0x067d('0x3f')]['outboundrouteid'])){utils[_0x067d('0x5')](util[_0x067d('0x6')](_0x067d('0x56'),_0x2a3697[_0x067d('0x8')],_0x2a3697[_0x067d('0x42')]));channels[_0x2a3697[_0x067d('0x8')]][_0x067d('0x57')]=_0x2a3697['value'];}if(!_[_0x067d('0x1c')](_0x2a3697['variable'][_0x067d('0x58')])){utils['info'](util[_0x067d('0x6')]('[%s][calls][varset]\x20variable:sipcallid\x20value:%s',_0x2a3697[_0x067d('0x8')],_0x2a3697['value']));channels[_0x2a3697[_0x067d('0x8')]]['sipcallid']=_0x2a3697['value'];}}}catch(_0x329be7){utils['error'](util[_0x067d('0x6')](_0x067d('0x3e'),_0x2a3697[_0x067d('0x8')]),_0x329be7);}};exports[_0x067d('0x59')]=function(_0x482989){try{if(!_[_0x067d('0x1c')](channels[_0x482989[_0x067d('0x8')]])){utils[_0x067d('0x10')](util['format'](_0x067d('0x5a'),_0x482989[_0x067d('0x8')]),_0x482989);utils['info'](util['format']('[%s][calls][newexten]\x20application:%s\x20appdata:%s',_0x482989[_0x067d('0x8')],_0x482989[_0x067d('0x5b')],_0x482989[_0x067d('0x5c')]));if(_0x482989[_0x067d('0x5b')][_0x067d('0x5d')]()==_0x067d('0x5e')&&_[_0x067d('0x5f')](_0x482989[_0x067d('0x5c')][_0x067d('0x5d')](),'cdr')){var _0x3e2cec=_0x482989['appdata'][_0x067d('0x60')]('=');var _0x3bc8c3=_0x3e2cec[0x0][_0x067d('0x61')](_0x3e2cec[0x0][_0x067d('0x62')]('(')+0x1,_0x3e2cec[0x0][_0x067d('0x62')](')'));var _0x108c00=_0x3e2cec[0x1];channels[_0x482989[_0x067d('0x8')]][_0x3bc8c3]=_0x108c00;}if(!_[_0x067d('0x63')]([_0x067d('0x64'),'noop',_0x067d('0x65'),_0x067d('0x5e'),_0x067d('0x66')],_0x482989[_0x067d('0x5b')]['toLowerCase']())){channels[_0x482989[_0x067d('0x8')]][_0x067d('0x4d')]=_0x482989[_0x067d('0x5b')];channels[_0x482989['uniqueid']][_0x067d('0x4f')]=_0x482989['appdata'];}}}catch(_0x1f2385){utils[_0x067d('0x25')](util['format'](_0x067d('0x5a'),_0x482989['uniqueid']),_0x1f2385);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index 8ab2165..255781e 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 _0x038c=['managerevent','./utils','connect','[core]\x20connected','info','[core]\x20shutdown','fullybooted','[core]\x20fullybooted','error','[core]\x20error','close'];(function(_0x3e469e,_0x334923){var _0x33d855=function(_0x123ba9){while(--_0x123ba9){_0x3e469e['push'](_0x3e469e['shift']());}};_0x33d855(++_0x334923);}(_0x038c,0x1c4));var _0xc038=function(_0x5f4dd2,_0x1ea296){_0x5f4dd2=_0x5f4dd2-0x0;var _0x55fae0=_0x038c[_0x5f4dd2];return _0x55fae0;};'use strict';var utils=require(_0xc038('0x0'));exports[_0xc038('0x1')]=function(){utils['info'](_0xc038('0x2'));};exports['shutdown']=function(){utils[_0xc038('0x3')](_0xc038('0x4'));};exports[_0xc038('0x5')]=function(){utils[_0xc038('0x3')](_0xc038('0x6'));};exports[_0xc038('0x7')]=function(_0x11d689){utils[_0xc038('0x7')](_0xc038('0x8'),_0x11d689);};exports[_0xc038('0x9')]=function(){utils[_0xc038('0x3')]('[core]\x20close');};exports[_0xc038('0xa')]=function(_0x2d1bfe){}; \ No newline at end of file +var _0xa1b9=['info','[core]\x20connected','fullybooted','[core]\x20fullybooted','[core]\x20error','close','[core]\x20close','managerevent'];(function(_0x5e77db,_0x356d1c){var _0x34b675=function(_0x4914b5){while(--_0x4914b5){_0x5e77db['push'](_0x5e77db['shift']());}};_0x34b675(++_0x356d1c);}(_0xa1b9,0x170));var _0x9a1b=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xa1b9[_0x5c351c];return _0x26f3b3;};'use strict';var utils=require('./utils');exports['connect']=function(){utils[_0x9a1b('0x0')](_0x9a1b('0x1'));};exports['shutdown']=function(){utils[_0x9a1b('0x0')]('[core]\x20shutdown');};exports[_0x9a1b('0x2')]=function(){utils[_0x9a1b('0x0')](_0x9a1b('0x3'));};exports['error']=function(_0x1383da){utils['error'](_0x9a1b('0x4'),_0x1383da);};exports[_0x9a1b('0x5')]=function(){utils['info'](_0x9a1b('0x6'));};exports[_0x9a1b('0x7')]=function(_0x13d155){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index ff7f489..cb60a1b 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 _0xa5cf=['calleridnum','calleridname','cause-txt','complete','endtime','holdtime','diffTime','[%s][dials][hangup]','util','uniqueid','dialstring','dialstatus','request','CreateVoiceDialReport','newexten','debug','format','info','appdata','application','toLowerCase','startsWith','cdr(routeid)','split','error','[%s][dials][newexten]','varset','[%s][dials][varset]','isNil','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','[%s][dials][dialbegin]','assign','starttime','now','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','dialend','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','answertime','[%s][dials][dialend]\x20dialstatus:%s','[%s][dials][dialend]','hangup','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s'];(function(_0x23648b,_0x51a25f){var _0x2b5a63=function(_0x227cfe){while(--_0x227cfe){_0x23648b['push'](_0x23648b['shift']());}};_0x2b5a63(++_0x51a25f);}(_0xa5cf,0x15f));var _0xfa5c=function(_0x527053,_0x145d42){_0x527053=_0x527053-0x0;var _0x3f5bd5=_0xa5cf[_0x527053];return _0x3f5bd5;};'use strict';var _=require('lodash');var util=require(_0xfa5c('0x0'));var utils=require('./utils');var dials={};function writeDB(_0x41ea59){utils['info'](util['format']('[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s',_0x41ea59[_0xfa5c('0x1')],_0x41ea59['channel'],_0x41ea59[_0xfa5c('0x2')],_0x41ea59['calleridnum'],_0x41ea59['connectedlinenum'],_0x41ea59[_0xfa5c('0x3')]));utils[_0xfa5c('0x4')](_0xfa5c('0x5'),_0x41ea59);delete dials[_0x41ea59['uniqueid']];}exports[_0xfa5c('0x6')]=function(_0xa3dc5b){try{utils[_0xfa5c('0x7')](util[_0xfa5c('0x8')]('[%s][dials][newexten]',_0xa3dc5b[_0xfa5c('0x1')]),_0xa3dc5b);utils[_0xfa5c('0x9')](util[_0xfa5c('0x8')]('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0xa3dc5b[_0xfa5c('0x1')],_0xa3dc5b['application'],_0xa3dc5b[_0xfa5c('0xa')]));if(_0xa3dc5b[_0xfa5c('0xb')][_0xfa5c('0xc')]()=='set'&&_[_0xfa5c('0xd')](_0xa3dc5b['appdata'][_0xfa5c('0xc')](),_0xfa5c('0xe'))){var _0x155b34=_0xa3dc5b[_0xfa5c('0xa')][_0xfa5c('0xf')]('=');dials[_0xa3dc5b[_0xfa5c('0x1')]]={'routeId':_0x155b34[0x1]};}}catch(_0x4967bb){utils[_0xfa5c('0x10')](util[_0xfa5c('0x8')](_0xfa5c('0x11'),_0xa3dc5b[_0xfa5c('0x1')]),_0x4967bb);}};exports[_0xfa5c('0x12')]=function(_0x2f29e2){try{utils[_0xfa5c('0x7')](util[_0xfa5c('0x8')](_0xfa5c('0x13'),_0x2f29e2['uniqueid']),_0x2f29e2);if(!_[_0xfa5c('0x14')](_0x2f29e2[_0xfa5c('0x15')][_0xfa5c('0x16')])){utils[_0xfa5c('0x9')](util[_0xfa5c('0x8')](_0xfa5c('0x17'),_0x2f29e2[_0xfa5c('0x1')],_0x2f29e2['value']));dials[_0x2f29e2[_0xfa5c('0x1')]]={'routeId':_0x2f29e2[_0xfa5c('0x18')]};}}catch(_0x214cff){utils[_0xfa5c('0x10')](util[_0xfa5c('0x8')]('[%s][dials][varset]',_0x2f29e2[_0xfa5c('0x1')]),_0x214cff);}};exports[_0xfa5c('0x19')]=function(_0x142912){try{if(!_['isNil'](dials[_0x142912[_0xfa5c('0x1')]])){utils[_0xfa5c('0x7')](util[_0xfa5c('0x8')](_0xfa5c('0x1a'),_0x142912['uniqueid']),_0x142912);dials[_0x142912[_0xfa5c('0x1')]]=_[_0xfa5c('0x1b')](dials[_0x142912[_0xfa5c('0x1')]],_0x142912);dials[_0x142912[_0xfa5c('0x1')]][_0xfa5c('0x1c')]=utils[_0xfa5c('0x1d')]();dials[_0x142912[_0xfa5c('0x1')]][_0xfa5c('0x1e')]=_0xfa5c('0x1f');utils[_0xfa5c('0x9')](util[_0xfa5c('0x8')](_0xfa5c('0x20'),_0x142912[_0xfa5c('0x1')],dials[_0x142912[_0xfa5c('0x1')]][_0xfa5c('0x1c')]));}}catch(_0x2e8f89){utils['error'](util[_0xfa5c('0x8')](_0xfa5c('0x1a'),_0x142912[_0xfa5c('0x1')]),_0x2e8f89);}};exports[_0xfa5c('0x21')]=function(_0x2f1e70){try{if(!_[_0xfa5c('0x14')](dials[_0x2f1e70[_0xfa5c('0x1')]])){utils[_0xfa5c('0x7')](util[_0xfa5c('0x8')]('[%s][dials][dialend]',_0x2f1e70[_0xfa5c('0x1')]),_0x2f1e70);dials[_0x2f1e70[_0xfa5c('0x1')]][_0xfa5c('0x3')]=_0x2f1e70[_0xfa5c('0x3')];if(_0x2f1e70[_0xfa5c('0x3')]=='ANSWER'){dials[_0x2f1e70[_0xfa5c('0x1')]]=_['assign'](dials[_0x2f1e70['uniqueid']],_0x2f1e70);dials[_0x2f1e70[_0xfa5c('0x1')]]['answertime']=utils[_0xfa5c('0x1d')]();dials[_0x2f1e70[_0xfa5c('0x1')]][_0xfa5c('0x1e')]=_0xfa5c('0x22');utils[_0xfa5c('0x9')](util[_0xfa5c('0x8')](_0xfa5c('0x23'),_0x2f1e70[_0xfa5c('0x1')],_0x2f1e70[_0xfa5c('0x3')],dials[_0x2f1e70[_0xfa5c('0x1')]][_0xfa5c('0x24')]));}else{utils[_0xfa5c('0x9')](util[_0xfa5c('0x8')](_0xfa5c('0x25'),_0x2f1e70['uniqueid'],_0x2f1e70['dialstatus']));}}}catch(_0x330a63){utils[_0xfa5c('0x10')](util[_0xfa5c('0x8')](_0xfa5c('0x26'),_0x2f1e70[_0xfa5c('0x1')]),_0x330a63);}};exports[_0xfa5c('0x27')]=function(_0x39bd05){try{if(!_[_0xfa5c('0x14')](dials[_0x39bd05[_0xfa5c('0x1')]])){utils['debug'](util[_0xfa5c('0x8')]('[%s][dials][hangup]',_0x39bd05['uniqueid']),_0x39bd05);utils[_0xfa5c('0x9')](util[_0xfa5c('0x8')](_0xfa5c('0x28'),_0x39bd05[_0xfa5c('0x1')],_0x39bd05[_0xfa5c('0x29')],_0x39bd05[_0xfa5c('0x2a')],_0x39bd05[_0xfa5c('0x2b')]));dials[_0x39bd05[_0xfa5c('0x1')]]=_['assign'](dials[_0x39bd05[_0xfa5c('0x1')]],{'endtime':utils[_0xfa5c('0x1d')](),'lastevent':_0xfa5c('0x2c')});dials[_0x39bd05[_0xfa5c('0x1')]]['duration']=utils['diffTime'](dials[_0x39bd05['uniqueid']][_0xfa5c('0x2d')],dials[_0x39bd05[_0xfa5c('0x1')]][_0xfa5c('0x1c')]);dials[_0x39bd05[_0xfa5c('0x1')]][_0xfa5c('0x2e')]=utils[_0xfa5c('0x2f')](dials[_0x39bd05[_0xfa5c('0x1')]]['answertime']||dials[_0x39bd05['uniqueid']][_0xfa5c('0x2d')],dials[_0x39bd05[_0xfa5c('0x1')]][_0xfa5c('0x1c')]);dials[_0x39bd05['uniqueid']]['billableseconds']=dials[_0x39bd05[_0xfa5c('0x1')]][_0xfa5c('0x24')]?utils[_0xfa5c('0x2f')](dials[_0x39bd05['uniqueid']][_0xfa5c('0x2d')],dials[_0x39bd05[_0xfa5c('0x1')]][_0xfa5c('0x24')]):0x0;writeDB(dials[_0x39bd05['uniqueid']]);}}catch(_0x4f651d){utils[_0xfa5c('0x10')](util[_0xfa5c('0x8')](_0xfa5c('0x30'),_0x39bd05[_0xfa5c('0x1')]),_0x4f651d);}}; \ No newline at end of file +var _0xcb7d=['format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','dialstring','calleridnum','dialstatus','CreateVoiceDialReport','debug','[%s][dials][newexten]','application','appdata','toLowerCase','set','startsWith','cdr(routeid)','split','error','varset','[%s][dials][varset]','isNil','info','value','[%s][dials][dialbegin]','assign','starttime','now','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','dialend','[%s][dials][dialend]','ANSWER','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','complete','endtime','holdtime','diffTime','lodash','util','./utils'];(function(_0x14beb8,_0x3e7f13){var _0x1a17ce=function(_0x37ea4b){while(--_0x37ea4b){_0x14beb8['push'](_0x14beb8['shift']());}};_0x1a17ce(++_0x3e7f13);}(_0xcb7d,0xbd));var _0xdcb7=function(_0x529a0f,_0x1cf35a){_0x529a0f=_0x529a0f-0x0;var _0x158329=_0xcb7d[_0x529a0f];return _0x158329;};'use strict';var _=require(_0xdcb7('0x0'));var util=require(_0xdcb7('0x1'));var utils=require(_0xdcb7('0x2'));var dials={};function writeDB(_0x2a2e33){utils['info'](util[_0xdcb7('0x3')](_0xdcb7('0x4'),_0x2a2e33[_0xdcb7('0x5')],_0x2a2e33[_0xdcb7('0x6')],_0x2a2e33[_0xdcb7('0x7')],_0x2a2e33[_0xdcb7('0x8')],_0x2a2e33['connectedlinenum'],_0x2a2e33[_0xdcb7('0x9')]));utils['request'](_0xdcb7('0xa'),_0x2a2e33);delete dials[_0x2a2e33[_0xdcb7('0x5')]];}exports['newexten']=function(_0x335313){try{utils[_0xdcb7('0xb')](util[_0xdcb7('0x3')](_0xdcb7('0xc'),_0x335313['uniqueid']),_0x335313);utils['info'](util['format']('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x335313[_0xdcb7('0x5')],_0x335313[_0xdcb7('0xd')],_0x335313[_0xdcb7('0xe')]));if(_0x335313[_0xdcb7('0xd')][_0xdcb7('0xf')]()==_0xdcb7('0x10')&&_[_0xdcb7('0x11')](_0x335313[_0xdcb7('0xe')][_0xdcb7('0xf')](),_0xdcb7('0x12'))){var _0xb6577d=_0x335313['appdata'][_0xdcb7('0x13')]('=');dials[_0x335313[_0xdcb7('0x5')]]={'routeId':_0xb6577d[0x1]};}}catch(_0x37ec00){utils[_0xdcb7('0x14')](util['format'](_0xdcb7('0xc'),_0x335313['uniqueid']),_0x37ec00);}};exports[_0xdcb7('0x15')]=function(_0x20b0f6){try{utils[_0xdcb7('0xb')](util[_0xdcb7('0x3')](_0xdcb7('0x16'),_0x20b0f6['uniqueid']),_0x20b0f6);if(!_[_0xdcb7('0x17')](_0x20b0f6['variable']['outboundrouteid'])){utils[_0xdcb7('0x18')](util[_0xdcb7('0x3')]('[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s',_0x20b0f6[_0xdcb7('0x5')],_0x20b0f6[_0xdcb7('0x19')]));dials[_0x20b0f6['uniqueid']]={'routeId':_0x20b0f6[_0xdcb7('0x19')]};}}catch(_0x1419a4){utils['error'](util[_0xdcb7('0x3')](_0xdcb7('0x16'),_0x20b0f6[_0xdcb7('0x5')]),_0x1419a4);}};exports['dialbegin']=function(_0x59df13){try{if(!_[_0xdcb7('0x17')](dials[_0x59df13[_0xdcb7('0x5')]])){utils[_0xdcb7('0xb')](util['format'](_0xdcb7('0x1a'),_0x59df13[_0xdcb7('0x5')]),_0x59df13);dials[_0x59df13[_0xdcb7('0x5')]]=_[_0xdcb7('0x1b')](dials[_0x59df13[_0xdcb7('0x5')]],_0x59df13);dials[_0x59df13[_0xdcb7('0x5')]][_0xdcb7('0x1c')]=utils[_0xdcb7('0x1d')]();dials[_0x59df13[_0xdcb7('0x5')]][_0xdcb7('0x1e')]=_0xdcb7('0x1f');utils[_0xdcb7('0x18')](util[_0xdcb7('0x3')](_0xdcb7('0x20'),_0x59df13[_0xdcb7('0x5')],dials[_0x59df13['uniqueid']][_0xdcb7('0x1c')]));}}catch(_0x23b0c8){utils[_0xdcb7('0x14')](util['format']('[%s][dials][dialbegin]',_0x59df13[_0xdcb7('0x5')]),_0x23b0c8);}};exports[_0xdcb7('0x21')]=function(_0x3b6c8c){try{if(!_[_0xdcb7('0x17')](dials[_0x3b6c8c[_0xdcb7('0x5')]])){utils[_0xdcb7('0xb')](util[_0xdcb7('0x3')](_0xdcb7('0x22'),_0x3b6c8c[_0xdcb7('0x5')]),_0x3b6c8c);dials[_0x3b6c8c[_0xdcb7('0x5')]][_0xdcb7('0x9')]=_0x3b6c8c[_0xdcb7('0x9')];if(_0x3b6c8c['dialstatus']==_0xdcb7('0x23')){dials[_0x3b6c8c[_0xdcb7('0x5')]]=_[_0xdcb7('0x1b')](dials[_0x3b6c8c[_0xdcb7('0x5')]],_0x3b6c8c);dials[_0x3b6c8c[_0xdcb7('0x5')]][_0xdcb7('0x24')]=utils[_0xdcb7('0x1d')]();dials[_0x3b6c8c[_0xdcb7('0x5')]]['lastevent']=_0xdcb7('0x25');utils[_0xdcb7('0x18')](util[_0xdcb7('0x3')](_0xdcb7('0x26'),_0x3b6c8c[_0xdcb7('0x5')],_0x3b6c8c['dialstatus'],dials[_0x3b6c8c[_0xdcb7('0x5')]][_0xdcb7('0x24')]));}else{utils[_0xdcb7('0x18')](util[_0xdcb7('0x3')](_0xdcb7('0x27'),_0x3b6c8c['uniqueid'],_0x3b6c8c[_0xdcb7('0x9')]));}}}catch(_0x289616){utils['error'](util['format'](_0xdcb7('0x22'),_0x3b6c8c[_0xdcb7('0x5')]),_0x289616);}};exports[_0xdcb7('0x28')]=function(_0x2921a2){try{if(!_[_0xdcb7('0x17')](dials[_0x2921a2[_0xdcb7('0x5')]])){utils[_0xdcb7('0xb')](util['format']('[%s][dials][hangup]',_0x2921a2['uniqueid']),_0x2921a2);utils[_0xdcb7('0x18')](util[_0xdcb7('0x3')](_0xdcb7('0x29'),_0x2921a2[_0xdcb7('0x5')],_0x2921a2['calleridnum'],_0x2921a2[_0xdcb7('0x2a')],_0x2921a2[_0xdcb7('0x2b')]));dials[_0x2921a2[_0xdcb7('0x5')]]=_[_0xdcb7('0x1b')](dials[_0x2921a2[_0xdcb7('0x5')]],{'endtime':utils[_0xdcb7('0x1d')](),'lastevent':_0xdcb7('0x2c')});dials[_0x2921a2['uniqueid']]['duration']=utils['diffTime'](dials[_0x2921a2[_0xdcb7('0x5')]][_0xdcb7('0x2d')],dials[_0x2921a2['uniqueid']][_0xdcb7('0x1c')]);dials[_0x2921a2[_0xdcb7('0x5')]][_0xdcb7('0x2e')]=utils[_0xdcb7('0x2f')](dials[_0x2921a2[_0xdcb7('0x5')]][_0xdcb7('0x24')]||dials[_0x2921a2[_0xdcb7('0x5')]][_0xdcb7('0x2d')],dials[_0x2921a2[_0xdcb7('0x5')]]['starttime']);dials[_0x2921a2[_0xdcb7('0x5')]]['billableseconds']=dials[_0x2921a2[_0xdcb7('0x5')]][_0xdcb7('0x24')]?utils['diffTime'](dials[_0x2921a2[_0xdcb7('0x5')]][_0xdcb7('0x2d')],dials[_0x2921a2[_0xdcb7('0x5')]][_0xdcb7('0x24')]):0x0;writeDB(dials[_0x2921a2[_0xdcb7('0x5')]]);}}catch(_0x46543d){utils['error'](util[_0xdcb7('0x3')]('[%s][dials][hangup]',_0x2921a2[_0xdcb7('0x5')]),_0x46543d);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index da34eb3..04e86c3 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 _0x7ada=['[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','[%s][index][blindtransfer]','blindtransfer','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','[%s][index][varset]','varset','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s]dialbegin','dialend','asterisk-manager','util','disabled','xdr','production','local','asterisk','port','password','keepConnected','info','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','format','[%s][index][devicestatechange]','device','agentcalled','[%s][index][agentcalled]','agentringnoanswer','[%s][index][agentringnoanswer]','uniqueid','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop'];(function(_0x382d99,_0x20ee16){var _0xa481ba=function(_0x49d5b2){while(--_0x49d5b2){_0x382d99['push'](_0x382d99['shift']());}};_0xa481ba(++_0x20ee16);}(_0x7ada,0x9f));var _0xa7ad=function(_0x2c5caa,_0x597221){_0x2c5caa=_0x2c5caa-0x0;var _0x5cf2c8=_0x7ada[_0x2c5caa];return _0x5cf2c8;};var AsteriskManager=require(_0xa7ad('0x0'));var config=require('../../config/environment');var utils=require('./utils');var util=require(_0xa7ad('0x1'));var isXDREnabled=config['xdr']&&config['xdr'][_0xa7ad('0x2')]?!config[_0xa7ad('0x3')][_0xa7ad('0x2')]:!![];var isProduction=config['env']===_0xa7ad('0x4')||![];var isLocalAsterisk=config['xdr']&&config['xdr'][_0xa7ad('0x5')]===!![]||![];var ami=new AsteriskManager(config[_0xa7ad('0x6')][_0xa7ad('0x7')],config[_0xa7ad('0x6')]['ip'],config[_0xa7ad('0x6')]['username'],config[_0xa7ad('0x6')][_0xa7ad('0x8')],!![]);ami[_0xa7ad('0x9')]();if(!isXDREnabled){utils[_0xa7ad('0xa')]('XDR\x20DISABLED');}else if(!isProduction&&!isLocalAsterisk){utils['info']('Asterisk\x20disabled\x20on\x20localhost');}else{var agents=require(_0xa7ad('0xb'));var calls=require(_0xa7ad('0xc'));var queues=require(_0xa7ad('0xd'));var recordings=require(_0xa7ad('0xe'));var members=require(_0xa7ad('0xf'));var dials=require(_0xa7ad('0x10'));var transfers=require(_0xa7ad('0x11'));var core=require(_0xa7ad('0x12'));ami['on']('connect',core[_0xa7ad('0x13')]);ami['on'](_0xa7ad('0x14'),core[_0xa7ad('0x14')]);ami['on'](_0xa7ad('0x15'),core[_0xa7ad('0x15')]);ami['on']('error',core[_0xa7ad('0x16')]);ami['on'](_0xa7ad('0x17'),core[_0xa7ad('0x17')]);ami['on'](_0xa7ad('0x18'),core[_0xa7ad('0x18')]);ami['on'](_0xa7ad('0x19'),function(_0x443c6b){try{utils[_0xa7ad('0x1a')](util[_0xa7ad('0x1b')]('[%s][index][devicestatechange]',_0x443c6b['device']),_0x443c6b);members[_0xa7ad('0x19')](_0x443c6b);}catch(_0x4eb5c0){utils['error'](util[_0xa7ad('0x1b')](_0xa7ad('0x1c'),_0x443c6b[_0xa7ad('0x1d')]),_0x4eb5c0);}});ami['on'](_0xa7ad('0x1e'),function(_0x4c31c1){try{utils[_0xa7ad('0x1a')](util[_0xa7ad('0x1b')](_0xa7ad('0x1f'),_0x4c31c1['uniqueid']),_0x4c31c1);agents[_0xa7ad('0x1e')](_0x4c31c1);}catch(_0x2ce77a){utils['error'](util['format'](_0xa7ad('0x1f'),_0x4c31c1['uniqueid']),_0x2ce77a);}});ami['on'](_0xa7ad('0x20'),function(_0x4ab181){try{utils['debug'](util[_0xa7ad('0x1b')](_0xa7ad('0x21'),_0x4ab181['uniqueid']),_0x4ab181);agents[_0xa7ad('0x20')](_0x4ab181);}catch(_0x2375ed){utils[_0xa7ad('0x16')](util[_0xa7ad('0x1b')](_0xa7ad('0x21'),_0x4ab181[_0xa7ad('0x22')]),_0x2375ed);}});ami['on'](_0xa7ad('0x23'),function(_0x2d3431){try{utils['debug'](util[_0xa7ad('0x1b')]('[%s][index][agentconnect]',_0x2d3431[_0xa7ad('0x22')]),_0x2d3431);agents[_0xa7ad('0x23')](_0x2d3431);queues[_0xa7ad('0x23')](_0x2d3431);}catch(_0x59ff6b){utils[_0xa7ad('0x16')](util[_0xa7ad('0x1b')](_0xa7ad('0x24'),_0x2d3431[_0xa7ad('0x22')]),_0x59ff6b);}});ami['on'](_0xa7ad('0x25'),function(_0x1d4c0f){try{utils[_0xa7ad('0x1a')](util[_0xa7ad('0x1b')]('[%s][index][agentcomplete]',_0x1d4c0f[_0xa7ad('0x22')]),_0x1d4c0f);agents[_0xa7ad('0x25')](_0x1d4c0f);queues[_0xa7ad('0x25')](_0x1d4c0f);members[_0xa7ad('0x25')](_0x1d4c0f);}catch(_0x23b79a){utils['error'](util['format'](_0xa7ad('0x26'),_0x1d4c0f[_0xa7ad('0x22')]),_0x23b79a);}});ami['on']('queuecallerabandon',function(_0x558ce3){try{utils[_0xa7ad('0x1a')](util[_0xa7ad('0x1b')]('[%s][index][queuecallerabandon]',_0x558ce3['uniqueid']),_0x558ce3);agents[_0xa7ad('0x27')](_0x558ce3);queues['queuecallerabandon'](_0x558ce3);}catch(_0x450c1e){utils[_0xa7ad('0x16')](util[_0xa7ad('0x1b')](_0xa7ad('0x28'),_0x558ce3[_0xa7ad('0x22')]),_0x450c1e);}});ami['on']('queuecallerjoin',function(_0x46be29){try{utils[_0xa7ad('0x1a')](util[_0xa7ad('0x1b')]('[%s][index][queuecallerjoin]',_0x46be29[_0xa7ad('0x22')]),_0x46be29);queues[_0xa7ad('0x29')](_0x46be29);recordings[_0xa7ad('0x29')](_0x46be29);}catch(_0x1f2020){utils['error'](util['format'](_0xa7ad('0x2a'),_0x46be29[_0xa7ad('0x22')]),_0x1f2020);}});ami['on'](_0xa7ad('0x2b'),function(_0x13a2f6){try{utils[_0xa7ad('0x1a')](util[_0xa7ad('0x1b')](_0xa7ad('0x2c'),_0x13a2f6[_0xa7ad('0x22')]),_0x13a2f6);queues[_0xa7ad('0x2b')](_0x13a2f6);}catch(_0x361b1d){utils['error'](util[_0xa7ad('0x1b')](_0xa7ad('0x2c'),_0x13a2f6[_0xa7ad('0x22')]),_0x361b1d);}});ami['on'](_0xa7ad('0x2d'),function(_0x1e50da){try{utils['debug'](util[_0xa7ad('0x1b')](_0xa7ad('0x2e'),_0x1e50da[_0xa7ad('0x22')]),_0x1e50da);queues[_0xa7ad('0x2d')](_0x1e50da);calls[_0xa7ad('0x2d')](_0x1e50da);}catch(_0x15a2e8){utils[_0xa7ad('0x16')](util[_0xa7ad('0x1b')](_0xa7ad('0x2e'),_0x1e50da['uniqueid']),_0x15a2e8);}});ami['on'](_0xa7ad('0x2f'),function(_0x44c589){try{utils[_0xa7ad('0x1a')](util[_0xa7ad('0x1b')](_0xa7ad('0x30'),_0x44c589[_0xa7ad('0x22')]),_0x44c589);queues['musiconholdstop'](_0x44c589);calls['musiconholdstop'](_0x44c589);}catch(_0x36675c){utils['error'](util[_0xa7ad('0x1b')](_0xa7ad('0x30'),_0x44c589[_0xa7ad('0x22')]),_0x36675c);}});ami['on'](_0xa7ad('0x31'),function(_0x2d8413){try{utils[_0xa7ad('0x1a')](util[_0xa7ad('0x1b')](_0xa7ad('0x32'),_0x2d8413[_0xa7ad('0x22')]),_0x2d8413);calls[_0xa7ad('0x31')](_0x2d8413);recordings[_0xa7ad('0x31')](_0x2d8413);}catch(_0x34cc97){utils[_0xa7ad('0x16')](util['format']('[%s][index][newstate]',_0x2d8413[_0xa7ad('0x22')]),_0x34cc97);}});ami['on'](_0xa7ad('0x33'),function(_0x4b4347){try{utils['debug'](util['format'](_0xa7ad('0x34'),_0x4b4347[_0xa7ad('0x22')]),_0x4b4347);calls[_0xa7ad('0x33')](_0x4b4347);recordings[_0xa7ad('0x33')](_0x4b4347);dials[_0xa7ad('0x33')](_0x4b4347);agents[_0xa7ad('0x33')](_0x4b4347);queues[_0xa7ad('0x33')](_0x4b4347);}catch(_0x182741){utils[_0xa7ad('0x16')](util[_0xa7ad('0x1b')](_0xa7ad('0x34'),_0x4b4347[_0xa7ad('0x22')]),_0x182741);}});ami['on'](_0xa7ad('0x35'),function(_0x14f3e8){try{utils[_0xa7ad('0x1a')](util[_0xa7ad('0x1b')](_0xa7ad('0x36'),_0x14f3e8[_0xa7ad('0x22')]),_0x14f3e8);members[_0xa7ad('0x35')](_0x14f3e8);}catch(_0x10b55a){utils[_0xa7ad('0x16')](util[_0xa7ad('0x1b')](_0xa7ad('0x36'),_0x14f3e8[_0xa7ad('0x22')]),_0x10b55a);}});ami['on']('blindtransfer',function(_0x5d48b3){try{utils['debug'](util[_0xa7ad('0x1b')](_0xa7ad('0x37'),_0x5d48b3[_0xa7ad('0x22')]),_0x5d48b3);queues['blindtransfer'](_0x5d48b3);agents[_0xa7ad('0x38')](_0x5d48b3);transfers[_0xa7ad('0x38')](_0x5d48b3);}catch(_0x3712c5){utils[_0xa7ad('0x16')](util[_0xa7ad('0x1b')](_0xa7ad('0x37'),_0x5d48b3[_0xa7ad('0x22')]),_0x3712c5);}});ami['on'](_0xa7ad('0x39'),function(_0xea311){try{utils[_0xa7ad('0x1a')](util[_0xa7ad('0x1b')](_0xa7ad('0x3a'),_0xea311[_0xa7ad('0x3b')]),_0xea311);queues['attendedtransfer'](_0xea311);transfers['attendedtransfer'](_0xea311);agents[_0xa7ad('0x39')](_0xea311);calls[_0xa7ad('0x39')](_0xea311);}catch(_0x25728a){utils[_0xa7ad('0x16')](util[_0xa7ad('0x1b')](_0xa7ad('0x3a'),_0xea311[_0xa7ad('0x3b')]),_0x25728a);}});ami['on']('varset',function(_0x3bd4b0){try{utils[_0xa7ad('0x1a')](util['format'](_0xa7ad('0x3c'),_0x3bd4b0[_0xa7ad('0x22')]),_0x3bd4b0);queues[_0xa7ad('0x3d')](_0x3bd4b0);recordings[_0xa7ad('0x3d')](_0x3bd4b0);calls[_0xa7ad('0x3d')](_0x3bd4b0);dials['varset'](_0x3bd4b0);}catch(_0x484e8c){utils['error'](util['format']('[%s][index][varset]',_0x3bd4b0[_0xa7ad('0x22')]),_0x484e8c);}});ami['on']('newexten',function(_0x2ce92c){try{utils[_0xa7ad('0x1a')](util[_0xa7ad('0x1b')]('[%s][index][newexten]',_0x2ce92c[_0xa7ad('0x22')]),_0x2ce92c);calls['newexten'](_0x2ce92c);recordings[_0xa7ad('0x3e')](_0x2ce92c);dials[_0xa7ad('0x3e')](_0x2ce92c);}catch(_0x949ba1){utils[_0xa7ad('0x16')](util[_0xa7ad('0x1b')](_0xa7ad('0x3f'),_0x2ce92c['uniqueid']),_0x949ba1);}});ami['on'](_0xa7ad('0x40'),function(_0x153a33){try{utils[_0xa7ad('0x1a')](util['format'](_0xa7ad('0x41'),_0x153a33[_0xa7ad('0x22')]),_0x153a33);calls[_0xa7ad('0x40')](_0x153a33);recordings[_0xa7ad('0x40')](_0x153a33);}catch(_0x357410){utils['error'](util[_0xa7ad('0x1b')](_0xa7ad('0x41'),_0x153a33['uniqueid']),_0x357410);}});ami['on'](_0xa7ad('0x42'),function(_0x5cdd1e){try{utils[_0xa7ad('0x1a')](util[_0xa7ad('0x1b')]('[%s][index][dialbegin]',_0x5cdd1e['uniqueid']),_0x5cdd1e);dials[_0xa7ad('0x42')](_0x5cdd1e);}catch(_0x55fa03){utils[_0xa7ad('0x16')](util[_0xa7ad('0x1b')](_0xa7ad('0x43'),_0x5cdd1e['uniqueid']),_0x55fa03);}});ami['on'](_0xa7ad('0x44'),function(_0x182d6e){try{utils[_0xa7ad('0x1a')](util[_0xa7ad('0x1b')]('[%s][index][dialend]',_0x182d6e[_0xa7ad('0x22')]),_0x182d6e);dials['dialend'](_0x182d6e);}catch(_0x2c2a35){utils[_0xa7ad('0x16')](util[_0xa7ad('0x1b')]('[%s][index][dialend]',_0x182d6e[_0xa7ad('0x22')]),_0x2c2a35);}});} \ No newline at end of file +var _0xeefd=['[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','./utils','util','xdr','disabled','env','production','local','asterisk','port','info','XDR\x20DISABLED','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','connect','shutdown','fullybooted','error','close','managerevent','debug','device','format','[%s][index][devicestatechange]','agentcalled','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','[%s][index][agentconnect]','agentconnect','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','[%s][index][musiconholdstop]','musiconholdstop','newstate','[%s][index][newstate]','hangup'];(function(_0x252ef1,_0x2e0041){var _0x25817c=function(_0x243776){while(--_0x243776){_0x252ef1['push'](_0x252ef1['shift']());}};_0x25817c(++_0x2e0041);}(_0xeefd,0x123));var _0xdeef=function(_0x2dbfbe,_0x119e32){_0x2dbfbe=_0x2dbfbe-0x0;var _0x375c84=_0xeefd[_0x2dbfbe];return _0x375c84;};var AsteriskManager=require(_0xdeef('0x0'));var config=require(_0xdeef('0x1'));var utils=require(_0xdeef('0x2'));var util=require(_0xdeef('0x3'));var isXDREnabled=config[_0xdeef('0x4')]&&config[_0xdeef('0x4')][_0xdeef('0x5')]?!config[_0xdeef('0x4')][_0xdeef('0x5')]:!![];var isProduction=config[_0xdeef('0x6')]===_0xdeef('0x7')||![];var isLocalAsterisk=config[_0xdeef('0x4')]&&config[_0xdeef('0x4')][_0xdeef('0x8')]===!![]||![];var ami=new AsteriskManager(config[_0xdeef('0x9')][_0xdeef('0xa')],config['asterisk']['ip'],config[_0xdeef('0x9')]['username'],config['asterisk']['password'],!![]);ami['keepConnected']();if(!isXDREnabled){utils[_0xdeef('0xb')](_0xdeef('0xc'));}else if(!isProduction&&!isLocalAsterisk){utils[_0xdeef('0xb')]('Asterisk\x20disabled\x20on\x20localhost');}else{var agents=require('./agents.controller');var calls=require('./calls.controller');var queues=require(_0xdeef('0xd'));var recordings=require(_0xdeef('0xe'));var members=require(_0xdeef('0xf'));var dials=require(_0xdeef('0x10'));var transfers=require(_0xdeef('0x11'));var core=require('./core.controller');ami['on'](_0xdeef('0x12'),core[_0xdeef('0x12')]);ami['on']('shutdown',core[_0xdeef('0x13')]);ami['on'](_0xdeef('0x14'),core[_0xdeef('0x14')]);ami['on'](_0xdeef('0x15'),core[_0xdeef('0x15')]);ami['on'](_0xdeef('0x16'),core[_0xdeef('0x16')]);ami['on'](_0xdeef('0x17'),core[_0xdeef('0x17')]);ami['on']('devicestatechange',function(_0x53800a){try{utils[_0xdeef('0x18')](util['format']('[%s][index][devicestatechange]',_0x53800a[_0xdeef('0x19')]),_0x53800a);members['devicestatechange'](_0x53800a);}catch(_0x8506ca){utils['error'](util[_0xdeef('0x1a')](_0xdeef('0x1b'),_0x53800a['device']),_0x8506ca);}});ami['on'](_0xdeef('0x1c'),function(_0x2fc7de){try{utils[_0xdeef('0x18')](util[_0xdeef('0x1a')](_0xdeef('0x1d'),_0x2fc7de['uniqueid']),_0x2fc7de);agents[_0xdeef('0x1c')](_0x2fc7de);}catch(_0x2f030e){utils['error'](util['format'](_0xdeef('0x1d'),_0x2fc7de[_0xdeef('0x1e')]),_0x2f030e);}});ami['on'](_0xdeef('0x1f'),function(_0x189a24){try{utils[_0xdeef('0x18')](util[_0xdeef('0x1a')]('[%s][index][agentringnoanswer]',_0x189a24[_0xdeef('0x1e')]),_0x189a24);agents['agentringnoanswer'](_0x189a24);}catch(_0x26ad30){utils[_0xdeef('0x15')](util['format'](_0xdeef('0x20'),_0x189a24[_0xdeef('0x1e')]),_0x26ad30);}});ami['on']('agentconnect',function(_0x316e1b){try{utils[_0xdeef('0x18')](util[_0xdeef('0x1a')](_0xdeef('0x21'),_0x316e1b[_0xdeef('0x1e')]),_0x316e1b);agents['agentconnect'](_0x316e1b);queues[_0xdeef('0x22')](_0x316e1b);}catch(_0x1c18e6){utils[_0xdeef('0x15')](util[_0xdeef('0x1a')](_0xdeef('0x21'),_0x316e1b['uniqueid']),_0x1c18e6);}});ami['on']('agentcomplete',function(_0x3dee4d){try{utils[_0xdeef('0x18')](util['format']('[%s][index][agentcomplete]',_0x3dee4d[_0xdeef('0x1e')]),_0x3dee4d);agents[_0xdeef('0x23')](_0x3dee4d);queues[_0xdeef('0x23')](_0x3dee4d);members[_0xdeef('0x23')](_0x3dee4d);}catch(_0x1c0317){utils[_0xdeef('0x15')](util[_0xdeef('0x1a')](_0xdeef('0x24'),_0x3dee4d[_0xdeef('0x1e')]),_0x1c0317);}});ami['on'](_0xdeef('0x25'),function(_0x52bc80){try{utils[_0xdeef('0x18')](util[_0xdeef('0x1a')](_0xdeef('0x26'),_0x52bc80['uniqueid']),_0x52bc80);agents[_0xdeef('0x25')](_0x52bc80);queues['queuecallerabandon'](_0x52bc80);}catch(_0x27e314){utils['error'](util[_0xdeef('0x1a')]('[%s][index][queuecallerabandon]',_0x52bc80[_0xdeef('0x1e')]),_0x27e314);}});ami['on'](_0xdeef('0x27'),function(_0x49b2df){try{utils[_0xdeef('0x18')](util['format'](_0xdeef('0x28'),_0x49b2df[_0xdeef('0x1e')]),_0x49b2df);queues[_0xdeef('0x27')](_0x49b2df);recordings[_0xdeef('0x27')](_0x49b2df);}catch(_0x30e6de){utils[_0xdeef('0x15')](util[_0xdeef('0x1a')](_0xdeef('0x28'),_0x49b2df[_0xdeef('0x1e')]),_0x30e6de);}});ami['on']('queuecallerleave',function(_0x475f85){try{utils['debug'](util[_0xdeef('0x1a')](_0xdeef('0x29'),_0x475f85['uniqueid']),_0x475f85);queues['queuecallerleave'](_0x475f85);}catch(_0x2f3187){utils['error'](util['format'](_0xdeef('0x29'),_0x475f85[_0xdeef('0x1e')]),_0x2f3187);}});ami['on'](_0xdeef('0x2a'),function(_0x2ef8de){try{utils[_0xdeef('0x18')](util[_0xdeef('0x1a')]('[%s][index][musiconholdstart]',_0x2ef8de[_0xdeef('0x1e')]),_0x2ef8de);queues[_0xdeef('0x2a')](_0x2ef8de);calls[_0xdeef('0x2a')](_0x2ef8de);}catch(_0x2b2712){utils['error'](util[_0xdeef('0x1a')](_0xdeef('0x2b'),_0x2ef8de[_0xdeef('0x1e')]),_0x2b2712);}});ami['on']('musiconholdstop',function(_0x440da6){try{utils['debug'](util[_0xdeef('0x1a')](_0xdeef('0x2c'),_0x440da6['uniqueid']),_0x440da6);queues[_0xdeef('0x2d')](_0x440da6);calls[_0xdeef('0x2d')](_0x440da6);}catch(_0x26d147){utils['error'](util[_0xdeef('0x1a')]('[%s][index][musiconholdstop]',_0x440da6['uniqueid']),_0x26d147);}});ami['on'](_0xdeef('0x2e'),function(_0x37dc7f){try{utils[_0xdeef('0x18')](util['format'](_0xdeef('0x2f'),_0x37dc7f['uniqueid']),_0x37dc7f);calls[_0xdeef('0x2e')](_0x37dc7f);recordings[_0xdeef('0x2e')](_0x37dc7f);}catch(_0x13986e){utils[_0xdeef('0x15')](util['format'](_0xdeef('0x2f'),_0x37dc7f[_0xdeef('0x1e')]),_0x13986e);}});ami['on']('hangup',function(_0x18612d){try{utils[_0xdeef('0x18')](util[_0xdeef('0x1a')]('[%s][index][hangup]',_0x18612d[_0xdeef('0x1e')]),_0x18612d);calls[_0xdeef('0x30')](_0x18612d);recordings['hangup'](_0x18612d);dials[_0xdeef('0x30')](_0x18612d);agents[_0xdeef('0x30')](_0x18612d);queues[_0xdeef('0x30')](_0x18612d);}catch(_0x2cf472){utils[_0xdeef('0x15')](util[_0xdeef('0x1a')](_0xdeef('0x31'),_0x18612d['uniqueid']),_0x2cf472);}});ami['on'](_0xdeef('0x32'),function(_0x55cc5a){try{utils[_0xdeef('0x18')](util[_0xdeef('0x1a')](_0xdeef('0x33'),_0x55cc5a['uniqueid']),_0x55cc5a);members[_0xdeef('0x32')](_0x55cc5a);}catch(_0x5247b3){utils[_0xdeef('0x15')](util[_0xdeef('0x1a')](_0xdeef('0x33'),_0x55cc5a[_0xdeef('0x1e')]),_0x5247b3);}});ami['on'](_0xdeef('0x34'),function(_0xe2737d){try{utils[_0xdeef('0x18')](util[_0xdeef('0x1a')](_0xdeef('0x35'),_0xe2737d['uniqueid']),_0xe2737d);queues[_0xdeef('0x34')](_0xe2737d);agents['blindtransfer'](_0xe2737d);transfers[_0xdeef('0x34')](_0xe2737d);}catch(_0x1c7d14){utils[_0xdeef('0x15')](util[_0xdeef('0x1a')](_0xdeef('0x35'),_0xe2737d['uniqueid']),_0x1c7d14);}});ami['on'](_0xdeef('0x36'),function(_0xc5e375){try{utils[_0xdeef('0x18')](util[_0xdeef('0x1a')](_0xdeef('0x37'),_0xc5e375[_0xdeef('0x38')]),_0xc5e375);queues[_0xdeef('0x36')](_0xc5e375);transfers['attendedtransfer'](_0xc5e375);agents[_0xdeef('0x36')](_0xc5e375);calls[_0xdeef('0x36')](_0xc5e375);}catch(_0x238465){utils['error'](util[_0xdeef('0x1a')](_0xdeef('0x37'),_0xc5e375[_0xdeef('0x38')]),_0x238465);}});ami['on']('varset',function(_0x124aa5){try{utils[_0xdeef('0x18')](util[_0xdeef('0x1a')]('[%s][index][varset]',_0x124aa5['uniqueid']),_0x124aa5);queues[_0xdeef('0x39')](_0x124aa5);recordings[_0xdeef('0x39')](_0x124aa5);calls[_0xdeef('0x39')](_0x124aa5);dials[_0xdeef('0x39')](_0x124aa5);}catch(_0x5dfcb1){utils['error'](util[_0xdeef('0x1a')](_0xdeef('0x3a'),_0x124aa5['uniqueid']),_0x5dfcb1);}});ami['on']('newexten',function(_0x243586){try{utils[_0xdeef('0x18')](util[_0xdeef('0x1a')]('[%s][index][newexten]',_0x243586[_0xdeef('0x1e')]),_0x243586);calls['newexten'](_0x243586);recordings[_0xdeef('0x3b')](_0x243586);dials['newexten'](_0x243586);}catch(_0x18fcdf){utils[_0xdeef('0x15')](util['format'](_0xdeef('0x3c'),_0x243586[_0xdeef('0x1e')]),_0x18fcdf);}});ami['on'](_0xdeef('0x3d'),function(_0x17f668){try{utils['debug'](util['format'](_0xdeef('0x3e'),_0x17f668[_0xdeef('0x1e')]),_0x17f668);calls['newchannel'](_0x17f668);recordings[_0xdeef('0x3d')](_0x17f668);}catch(_0x36bea5){utils[_0xdeef('0x15')](util[_0xdeef('0x1a')]('[%s][index][newchannel]',_0x17f668[_0xdeef('0x1e')]),_0x36bea5);}});ami['on'](_0xdeef('0x3f'),function(_0x3c2173){try{utils[_0xdeef('0x18')](util[_0xdeef('0x1a')](_0xdeef('0x40'),_0x3c2173[_0xdeef('0x1e')]),_0x3c2173);dials[_0xdeef('0x3f')](_0x3c2173);}catch(_0x26535e){utils[_0xdeef('0x15')](util[_0xdeef('0x1a')](_0xdeef('0x41'),_0x3c2173[_0xdeef('0x1e')]),_0x26535e);}});ami['on'](_0xdeef('0x42'),function(_0x38d611){try{utils[_0xdeef('0x18')](util[_0xdeef('0x1a')](_0xdeef('0x43'),_0x38d611['uniqueid']),_0x38d611);dials['dialend'](_0x38d611);}catch(_0x2451d6){utils[_0xdeef('0x15')](util['format'](_0xdeef('0x43'),_0x38d611[_0xdeef('0x1e')]),_0x2451d6);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index c8a5ab8..4bbdbc2 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 _0x8a9c=['info','format','uniqueid','interface','channel','membername','type','getUserByInterface','then','name','request','CreateMemberReport','internal','catch','[%s][members][writeDB]','some','debug','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','TALKING','now','NOT_INUSE','isNil','exitAt','duration','diffTime','enterAt','error','[%s][members][devicestatechange]','agentcomplete','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','[%s][members][cdr]','split','data1','data2','source','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','data3','destinationchannel','lodash','util','./utils','Local/_attended@transfer','Queue:'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x8a9c,0x12d));var _0xc8a9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8a9c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc8a9('0x0'));var util=require(_0xc8a9('0x1'));var utils=require(_0xc8a9('0x2'));var members={};var exclude=[_0xc8a9('0x3'),_0xc8a9('0x4')];function writeDB(_0x4b2260){utils[_0xc8a9('0x5')](util[_0xc8a9('0x6')]('[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s',_0x4b2260[_0xc8a9('0x7')],_0x4b2260[_0xc8a9('0x8')],_0x4b2260[_0xc8a9('0x9')],_0x4b2260['data2'],_0x4b2260[_0xc8a9('0xa')],_0x4b2260[_0xc8a9('0xb')]));if(_0x4b2260[_0xc8a9('0x8')]){utils[_0xc8a9('0xc')](_0x4b2260[_0xc8a9('0x8')])[_0xc8a9('0xd')](function(_0x46184e){if(_0x46184e){_0x4b2260[_0xc8a9('0xa')]=_0x46184e[_0xc8a9('0xe')];_0x4b2260['internal']=_0x46184e['internal'];utils[_0xc8a9('0xf')](_0xc8a9('0x10'),_0x4b2260);}else{utils['getUserByName'](_0x4b2260[_0xc8a9('0x8')]['split']('/')[0x1])[_0xc8a9('0xd')](function(_0x5b45f4){if(_0x5b45f4){_0x4b2260['membername']=_0x5b45f4[_0xc8a9('0xe')];_0x4b2260['internal']=_0x5b45f4[_0xc8a9('0x11')];utils[_0xc8a9('0xf')](_0xc8a9('0x10'),_0x4b2260);}});}})[_0xc8a9('0x12')](function(_0x330d46){utils['error'](util['format'](_0xc8a9('0x13'),_0x4b2260['uniqueid']),_0x330d46);});}delete members[_0x4b2260[_0xc8a9('0x8')]];}function startsWith(_0x43e420,_0x60f79e){return _[_0xc8a9('0x14')](_0x43e420,function(_0x4ba467){return _['startsWith'](_0x60f79e,_0x4ba467);});}exports['devicestatechange']=function(_0x4d03fe){try{utils[_0xc8a9('0x15')](util[_0xc8a9('0x6')]('[%s][members][devicestatechange]',members[_0x4d03fe[_0xc8a9('0x16')]]?members[_0x4d03fe[_0xc8a9('0x16')]][_0xc8a9('0x7')]:_0x4d03fe[_0xc8a9('0x16')]),_0x4d03fe);utils[_0xc8a9('0x5')](util[_0xc8a9('0x6')](_0xc8a9('0x17'),members[_0x4d03fe[_0xc8a9('0x16')]]?members[_0x4d03fe['device']][_0xc8a9('0x7')]:_0x4d03fe[_0xc8a9('0x16')],_0x4d03fe[_0xc8a9('0x18')],_0x4d03fe[_0xc8a9('0x16')]));switch(_0x4d03fe[_0xc8a9('0x18')]){case _0xc8a9('0x19'):case _0xc8a9('0x1a'):if(!startsWith(exclude,_0x4d03fe[_0xc8a9('0x16')])){members[_0x4d03fe[_0xc8a9('0x16')]]={'channel':'voice','interface':_0x4d03fe[_0xc8a9('0x16')],'type':_0xc8a9('0x1b'),'enterAt':utils[_0xc8a9('0x1c')](),'role':'agent'};}break;case _0xc8a9('0x1d'):if(!_[_0xc8a9('0x1e')](members[_0x4d03fe['device']])){members[_0x4d03fe[_0xc8a9('0x16')]][_0xc8a9('0x1f')]=utils['now']();members[_0x4d03fe[_0xc8a9('0x16')]][_0xc8a9('0x20')]=utils[_0xc8a9('0x21')](members[_0x4d03fe[_0xc8a9('0x16')]][_0xc8a9('0x1f')],members[_0x4d03fe['device']][_0xc8a9('0x22')]);if(members[_0x4d03fe[_0xc8a9('0x16')]][_0xc8a9('0x7')]){writeDB(members[_0x4d03fe[_0xc8a9('0x16')]]);}}break;default:break;}}catch(_0x4e0d83){utils[_0xc8a9('0x23')](util[_0xc8a9('0x6')](_0xc8a9('0x24'),members[_0x4d03fe['device']]?members[_0x4d03fe[_0xc8a9('0x16')]][_0xc8a9('0x7')]:_0x4d03fe[_0xc8a9('0x16')]),_0x4e0d83);}};exports[_0xc8a9('0x25')]=function(_0x3fcc57){try{if(!_[_0xc8a9('0x1e')](members[_0x3fcc57[_0xc8a9('0x8')]])){utils[_0xc8a9('0x15')](util[_0xc8a9('0x6')](_0xc8a9('0x26'),_0x3fcc57[_0xc8a9('0x7')]),_0x3fcc57);utils[_0xc8a9('0x5')](util[_0xc8a9('0x6')](_0xc8a9('0x27'),_0x3fcc57[_0xc8a9('0x7')],_0x3fcc57[_0xc8a9('0x8')],_0x3fcc57[_0xc8a9('0x28')]));members[_0x3fcc57[_0xc8a9('0x8')]]=_[_0xc8a9('0x29')](members[_0x3fcc57[_0xc8a9('0x8')]],{'data4':_0x3fcc57[_0xc8a9('0x28')],'uniqueid':_0x3fcc57['uniqueid']});}}catch(_0xa44001){utils[_0xc8a9('0x23')](util[_0xc8a9('0x6')]('[%s][members][agentcomplete]',_0x3fcc57['uniqueid']),_0xa44001);}};exports['cdr']=function(_0x4fa124){try{utils[_0xc8a9('0x15')](util[_0xc8a9('0x6')](_0xc8a9('0x2a'),_0x4fa124['uniqueid']),_0x4fa124);if(_0x4fa124['channel']){var _0x16d68b=_0x4fa124[_0xc8a9('0x9')][_0xc8a9('0x2b')]('-')[0x0];if(!_[_0xc8a9('0x1e')](members[_0x16d68b])){members[_0x16d68b]=_[_0xc8a9('0x29')](members[_0x16d68b],{'data1':members[_0x16d68b][_0xc8a9('0x2c')]||_0x4fa124[_0xc8a9('0xb')],'data2':members[_0x16d68b][_0xc8a9('0x2d')]||_0x4fa124[_0xc8a9('0x2e')],'data3':members[_0x16d68b]['data3']||_0x4fa124[_0xc8a9('0x2f')],'uniqueid':members[_0x16d68b][_0xc8a9('0x7')]||_0x4fa124[_0xc8a9('0x7')]});utils[_0xc8a9('0x5')](util[_0xc8a9('0x6')](_0xc8a9('0x30'),_0x4fa124['uniqueid'],members[_0x16d68b][_0xc8a9('0x2c')],members[_0x16d68b][_0xc8a9('0x2d')],members[_0x16d68b][_0xc8a9('0x31')]));if(members[_0x16d68b]['exitAt']){writeDB(members[_0x16d68b]);}}}if(_0x4fa124[_0xc8a9('0x32')]){var _0x411d36=_0x4fa124[_0xc8a9('0x32')][_0xc8a9('0x2b')]('-')[0x0];if(!_[_0xc8a9('0x1e')](members[_0x411d36])){members[_0x411d36]=_[_0xc8a9('0x29')](members[_0x411d36],{'data1':members[_0x411d36][_0xc8a9('0x2c')]||_0x4fa124[_0xc8a9('0xb')],'data2':members[_0x411d36]['data2']||_0x4fa124[_0xc8a9('0x2e')],'data3':members[_0x411d36][_0xc8a9('0x31')]||_0x4fa124[_0xc8a9('0x2f')],'uniqueid':members[_0x411d36][_0xc8a9('0x7')]||_0x4fa124[_0xc8a9('0x7')]});utils[_0xc8a9('0x5')](util['format'](_0xc8a9('0x30'),_0x4fa124[_0xc8a9('0x7')],members[_0x411d36]['data1'],members[_0x411d36][_0xc8a9('0x2d')],members[_0x411d36][_0xc8a9('0x31')]));if(members[_0x411d36][_0xc8a9('0x1f')]){writeDB(members[_0x411d36]);}}}}catch(_0x1f1f90){utils['error'](util[_0xc8a9('0x6')](_0xc8a9('0x2a'),_0x4fa124[_0xc8a9('0x7')]),_0x1f1f90);}}; \ No newline at end of file +var _0xd6e1=['assign','[%s][members][agentcomplete]','data1','type','source','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','data2','destinationchannel','lodash','./utils','Local/_attended@transfer','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','channel','membername','then','name','internal','CreateMemberReport','getUserByName','split','request','error','startsWith','devicestatechange','debug','device','state','INUSE','BUSY','now','agent','exitAt','duration','diffTime','enterAt','[%s][members][devicestatechange]','agentcomplete','isNil','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue'];(function(_0x2b8722,_0x50d540){var _0x20c180=function(_0x595b40){while(--_0x595b40){_0x2b8722['push'](_0x2b8722['shift']());}};_0x20c180(++_0x50d540);}(_0xd6e1,0x17a));var _0x1d6e=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xd6e1[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0x1d6e('0x0'));var util=require('util');var utils=require(_0x1d6e('0x1'));var members={};var exclude=[_0x1d6e('0x2'),'Queue:'];function writeDB(_0x592c52){utils[_0x1d6e('0x3')](util[_0x1d6e('0x4')](_0x1d6e('0x5'),_0x592c52[_0x1d6e('0x6')],_0x592c52[_0x1d6e('0x7')],_0x592c52[_0x1d6e('0x8')],_0x592c52['data2'],_0x592c52[_0x1d6e('0x9')],_0x592c52['type']));if(_0x592c52[_0x1d6e('0x7')]){utils['getUserByInterface'](_0x592c52[_0x1d6e('0x7')])[_0x1d6e('0xa')](function(_0x3289f4){if(_0x3289f4){_0x592c52[_0x1d6e('0x9')]=_0x3289f4[_0x1d6e('0xb')];_0x592c52[_0x1d6e('0xc')]=_0x3289f4[_0x1d6e('0xc')];utils['request'](_0x1d6e('0xd'),_0x592c52);}else{utils[_0x1d6e('0xe')](_0x592c52[_0x1d6e('0x7')][_0x1d6e('0xf')]('/')[0x1])[_0x1d6e('0xa')](function(_0x890851){if(_0x890851){_0x592c52['membername']=_0x890851[_0x1d6e('0xb')];_0x592c52[_0x1d6e('0xc')]=_0x890851[_0x1d6e('0xc')];utils[_0x1d6e('0x10')](_0x1d6e('0xd'),_0x592c52);}});}})['catch'](function(_0x3e7dc8){utils[_0x1d6e('0x11')](util[_0x1d6e('0x4')]('[%s][members][writeDB]',_0x592c52[_0x1d6e('0x6')]),_0x3e7dc8);});}delete members[_0x592c52['interface']];}function startsWith(_0x55729d,_0x36bc0e){return _['some'](_0x55729d,function(_0x38e3ac){return _[_0x1d6e('0x12')](_0x36bc0e,_0x38e3ac);});}exports[_0x1d6e('0x13')]=function(_0x269861){try{utils[_0x1d6e('0x14')](util['format']('[%s][members][devicestatechange]',members[_0x269861[_0x1d6e('0x15')]]?members[_0x269861['device']][_0x1d6e('0x6')]:_0x269861[_0x1d6e('0x15')]),_0x269861);utils[_0x1d6e('0x3')](util[_0x1d6e('0x4')]('[%s][members][devicestatechange]\x20state:%s\x20interface:%s',members[_0x269861[_0x1d6e('0x15')]]?members[_0x269861[_0x1d6e('0x15')]][_0x1d6e('0x6')]:_0x269861['device'],_0x269861[_0x1d6e('0x16')],_0x269861[_0x1d6e('0x15')]));switch(_0x269861[_0x1d6e('0x16')]){case _0x1d6e('0x17'):case _0x1d6e('0x18'):if(!startsWith(exclude,_0x269861[_0x1d6e('0x15')])){members[_0x269861[_0x1d6e('0x15')]]={'channel':'voice','interface':_0x269861[_0x1d6e('0x15')],'type':'TALKING','enterAt':utils[_0x1d6e('0x19')](),'role':_0x1d6e('0x1a')};}break;case'NOT_INUSE':if(!_['isNil'](members[_0x269861[_0x1d6e('0x15')]])){members[_0x269861[_0x1d6e('0x15')]][_0x1d6e('0x1b')]=utils['now']();members[_0x269861['device']][_0x1d6e('0x1c')]=utils[_0x1d6e('0x1d')](members[_0x269861[_0x1d6e('0x15')]][_0x1d6e('0x1b')],members[_0x269861[_0x1d6e('0x15')]][_0x1d6e('0x1e')]);if(members[_0x269861['device']][_0x1d6e('0x6')]){writeDB(members[_0x269861[_0x1d6e('0x15')]]);}}break;default:break;}}catch(_0x13978e){utils[_0x1d6e('0x11')](util[_0x1d6e('0x4')](_0x1d6e('0x1f'),members[_0x269861[_0x1d6e('0x15')]]?members[_0x269861[_0x1d6e('0x15')]]['uniqueid']:_0x269861[_0x1d6e('0x15')]),_0x13978e);}};exports[_0x1d6e('0x20')]=function(_0x94980e){try{if(!_[_0x1d6e('0x21')](members[_0x94980e[_0x1d6e('0x7')]])){utils['debug'](util[_0x1d6e('0x4')]('[%s][members][agentcomplete]',_0x94980e[_0x1d6e('0x6')]),_0x94980e);utils[_0x1d6e('0x3')](util[_0x1d6e('0x4')](_0x1d6e('0x22'),_0x94980e[_0x1d6e('0x6')],_0x94980e[_0x1d6e('0x7')],_0x94980e[_0x1d6e('0x23')]));members[_0x94980e[_0x1d6e('0x7')]]=_[_0x1d6e('0x24')](members[_0x94980e[_0x1d6e('0x7')]],{'data4':_0x94980e[_0x1d6e('0x23')],'uniqueid':_0x94980e[_0x1d6e('0x6')]});}}catch(_0x3b3f39){utils[_0x1d6e('0x11')](util[_0x1d6e('0x4')](_0x1d6e('0x25'),_0x94980e[_0x1d6e('0x6')]),_0x3b3f39);}};exports['cdr']=function(_0x24044a){try{utils[_0x1d6e('0x14')](util[_0x1d6e('0x4')]('[%s][members][cdr]',_0x24044a[_0x1d6e('0x6')]),_0x24044a);if(_0x24044a[_0x1d6e('0x8')]){var _0x5d04cc=_0x24044a['channel']['split']('-')[0x0];if(!_['isNil'](members[_0x5d04cc])){members[_0x5d04cc]=_[_0x1d6e('0x24')](members[_0x5d04cc],{'data1':members[_0x5d04cc][_0x1d6e('0x26')]||_0x24044a[_0x1d6e('0x27')],'data2':members[_0x5d04cc]['data2']||_0x24044a[_0x1d6e('0x28')],'data3':members[_0x5d04cc][_0x1d6e('0x29')]||_0x24044a[_0x1d6e('0x2a')],'uniqueid':members[_0x5d04cc][_0x1d6e('0x6')]||_0x24044a[_0x1d6e('0x6')]});utils[_0x1d6e('0x3')](util[_0x1d6e('0x4')](_0x1d6e('0x2b'),_0x24044a[_0x1d6e('0x6')],members[_0x5d04cc]['data1'],members[_0x5d04cc][_0x1d6e('0x2c')],members[_0x5d04cc][_0x1d6e('0x29')]));if(members[_0x5d04cc][_0x1d6e('0x1b')]){writeDB(members[_0x5d04cc]);}}}if(_0x24044a[_0x1d6e('0x2d')]){var _0x38d57c=_0x24044a[_0x1d6e('0x2d')][_0x1d6e('0xf')]('-')[0x0];if(!_[_0x1d6e('0x21')](members[_0x38d57c])){members[_0x38d57c]=_[_0x1d6e('0x24')](members[_0x38d57c],{'data1':members[_0x38d57c][_0x1d6e('0x26')]||_0x24044a['type'],'data2':members[_0x38d57c][_0x1d6e('0x2c')]||_0x24044a[_0x1d6e('0x28')],'data3':members[_0x38d57c][_0x1d6e('0x29')]||_0x24044a['destination'],'uniqueid':members[_0x38d57c]['uniqueid']||_0x24044a[_0x1d6e('0x6')]});utils[_0x1d6e('0x3')](util[_0x1d6e('0x4')](_0x1d6e('0x2b'),_0x24044a[_0x1d6e('0x6')],members[_0x38d57c]['data1'],members[_0x38d57c][_0x1d6e('0x2c')],members[_0x38d57c][_0x1d6e('0x29')]));if(members[_0x38d57c][_0x1d6e('0x1b')]){writeDB(members[_0x38d57c]);}}}}catch(_0x442e50){utils[_0x1d6e('0x11')](util[_0x1d6e('0x4')]('[%s][members][cdr]',_0x24044a[_0x1d6e('0x6')]),_0x442e50);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 3646e6d..6eb97c1 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 _0xdd27=['queuecallerenterreason','varset','[%s][queues][varset]','variable','queuestatus','value','CONTINUE','queuecallerabandonAt','queuecallerexitAt','toUpperCase','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','holdtime','diffTime','queuecallerjoinAt','count','[%s][queues][agentconnect]','membername','agentcomplete','assigned','queuecallercomplete','reason','transfer','TRANSFER','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','[%s][queues][agentcomplete]','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','BLIND','transferexten','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','origtransfererexten','ATTENDED','transfereelinkedid','clone','transfertargetuniqueid','calleridnum','calleridname','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transfertargetlinkedid','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','./utils','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','lastAssignedTo','accountcode','queuecallerexitreason','queue','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','assign','position','now','error','hangup','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercompleteAt','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s'];(function(_0x157b7f,_0x105e6c){var _0x10828c=function(_0x3574e2){while(--_0x3574e2){_0x157b7f['push'](_0x157b7f['shift']());}};_0x10828c(++_0x105e6c);}(_0xdd27,0x123));var _0x7dd2=function(_0x1d94d1,_0x347bb8){_0x1d94d1=_0x1d94d1-0x0;var _0x23c397=_0xdd27[_0x1d94d1];return _0x23c397;};'use strict';var _=require(_0x7dd2('0x0'));var util=require('util');var utils=require(_0x7dd2('0x1'));var queues={};function writeDB(_0x5f44e2){utils[_0x7dd2('0x2')](util[_0x7dd2('0x3')](_0x7dd2('0x4'),_0x5f44e2[_0x7dd2('0x5')],_0x5f44e2[_0x7dd2('0x6')],_0x5f44e2['queue'],_0x5f44e2[_0x7dd2('0x7')],_0x5f44e2['calleridnum'],_0x5f44e2[_0x7dd2('0x8')],_0x5f44e2[_0x7dd2('0x9')]));if(_0x5f44e2[_0x7dd2('0xa')]){utils[_0x7dd2('0xb')](_0x5f44e2['queue'])[_0x7dd2('0xc')](function(_0x154618){if(_0x154618){_0x5f44e2['type']=_0x154618[_0x7dd2('0xd')];}utils['request']('CreateVoiceQueueReport',_0x5f44e2);});}else{utils[_0x7dd2('0xe')](_0x7dd2('0xf'),_0x5f44e2);}if(_0x5f44e2[_0x7dd2('0x10')]){delete queues[_0x5f44e2[_0x7dd2('0x10')]];}else{delete queues[_0x5f44e2[_0x7dd2('0x5')]];}}exports[_0x7dd2('0x11')]=function(_0x4fc653){try{utils[_0x7dd2('0x12')](util[_0x7dd2('0x3')](_0x7dd2('0x13'),_0x4fc653['uniqueid']),_0x4fc653);utils['info'](util[_0x7dd2('0x3')](_0x7dd2('0x14'),_0x4fc653[_0x7dd2('0x5')],_0x4fc653[_0x7dd2('0xa')],_0x4fc653['position']));queues[_0x4fc653['uniqueid']]=_[_0x7dd2('0x15')](_0x4fc653,{'originalposition':_0x4fc653[_0x7dd2('0x16')],'queuecallerjoinAt':utils[_0x7dd2('0x17')](),'mohtime':0x0});}catch(_0xbdf0f0){utils[_0x7dd2('0x18')](util[_0x7dd2('0x3')](_0x7dd2('0x13'),_0x4fc653[_0x7dd2('0x5')]),_0xbdf0f0);}};exports[_0x7dd2('0x19')]=function(_0x1d4491){try{if(!_[_0x7dd2('0x1a')](queues[_0x1d4491['uniqueid']])){utils['debug'](util['format'](_0x7dd2('0x1b'),_0x1d4491[_0x7dd2('0x5')]),_0x1d4491);if(queues[_0x1d4491[_0x7dd2('0x5')]][_0x7dd2('0x1c')]){if(!queues[_0x1d4491[_0x7dd2('0x5')]][_0x7dd2('0x1d')]&&!queues[_0x1d4491[_0x7dd2('0x5')]][_0x7dd2('0x1e')]){queues[_0x1d4491[_0x7dd2('0x5')]]['queuecallercomplete']=!![];queues[_0x1d4491[_0x7dd2('0x5')]][_0x7dd2('0x1f')]=utils[_0x7dd2('0x17')]();queues[_0x1d4491[_0x7dd2('0x5')]][_0x7dd2('0x9')]=_0x7dd2('0x20');}utils[_0x7dd2('0x2')](util[_0x7dd2('0x3')](_0x7dd2('0x21'),_0x1d4491['uniqueid'],queues[_0x1d4491['uniqueid']][_0x7dd2('0x22')],queues[_0x1d4491[_0x7dd2('0x5')]][_0x7dd2('0x9')]));writeDB(queues[_0x1d4491[_0x7dd2('0x5')]]);}else if(queues[_0x1d4491['uniqueid']][_0x7dd2('0x10')]){utils['info'](util['format'](_0x7dd2('0x23'),_0x1d4491[_0x7dd2('0x5')],queues[_0x1d4491[_0x7dd2('0x5')]]['name'],queues[_0x1d4491[_0x7dd2('0x5')]][_0x7dd2('0x10')]));queues[queues[_0x1d4491[_0x7dd2('0x5')]][_0x7dd2('0x10')]]=queues[_0x1d4491[_0x7dd2('0x5')]];queues[queues[_0x1d4491[_0x7dd2('0x5')]]['transfereduniqueid']][_0x7dd2('0x24')]=0x2;delete queues[_0x1d4491[_0x7dd2('0x5')]];}}}catch(_0x29ecc8){utils[_0x7dd2('0x18')](util['format']('[%s][queues][hangup]',_0x1d4491[_0x7dd2('0x5')]),_0x29ecc8);}};exports[_0x7dd2('0x25')]=function(_0x2ae2a4){try{utils['debug'](util[_0x7dd2('0x3')](_0x7dd2('0x26'),_0x2ae2a4[_0x7dd2('0x5')]),_0x2ae2a4);if(!_[_0x7dd2('0x1a')](_0x2ae2a4[_0x7dd2('0x27')][_0x7dd2('0x28')])&&_0x2ae2a4[_0x7dd2('0x29')]['toUpperCase']()!==_0x7dd2('0x2a')){if(!_['isNil'](queues[_0x2ae2a4['uniqueid']])){queues[_0x2ae2a4[_0x7dd2('0x5')]]['queuecallerabandon']=![];queues[_0x2ae2a4[_0x7dd2('0x5')]][_0x7dd2('0x2b')]=null;queues[_0x2ae2a4[_0x7dd2('0x5')]][_0x7dd2('0x1e')]=!![];queues[_0x2ae2a4[_0x7dd2('0x5')]][_0x7dd2('0x2c')]=utils[_0x7dd2('0x17')]();queues[_0x2ae2a4[_0x7dd2('0x5')]]['queuecallerexitreason']=_0x2ae2a4[_0x7dd2('0x29')][_0x7dd2('0x2d')]();utils['info'](util[_0x7dd2('0x3')](_0x7dd2('0x2e'),_0x2ae2a4[_0x7dd2('0x5')],queues[_0x2ae2a4[_0x7dd2('0x5')]]['name'],_0x2ae2a4[_0x7dd2('0x29')],queues[_0x2ae2a4[_0x7dd2('0x5')]][_0x7dd2('0x9')]));writeDB(queues[_0x2ae2a4[_0x7dd2('0x5')]]);}}else if(!_[_0x7dd2('0x1a')](_0x2ae2a4[_0x7dd2('0x27')][_0x7dd2('0x2f')])){if(!_['isNil'](queues[_0x2ae2a4[_0x7dd2('0x5')]])&&!queues[_0x2ae2a4[_0x7dd2('0x5')]][_0x7dd2('0x1d')]){queues[_0x2ae2a4[_0x7dd2('0x5')]][_0x7dd2('0x1d')]=![];queues[_0x2ae2a4[_0x7dd2('0x5')]]['queuecallerabandonAt']=null;queues[_0x2ae2a4[_0x7dd2('0x5')]][_0x7dd2('0x1e')]=!![];queues[_0x2ae2a4[_0x7dd2('0x5')]][_0x7dd2('0x2c')]=utils[_0x7dd2('0x17')]();queues[_0x2ae2a4[_0x7dd2('0x5')]][_0x7dd2('0x9')]=_0x7dd2('0x30');utils[_0x7dd2('0x2')](util[_0x7dd2('0x3')](_0x7dd2('0x31'),_0x2ae2a4[_0x7dd2('0x5')],queues[_0x2ae2a4[_0x7dd2('0x5')]][_0x7dd2('0x22')],_0x2ae2a4[_0x7dd2('0x29')],queues[_0x2ae2a4[_0x7dd2('0x5')]][_0x7dd2('0x9')]));}}}catch(_0x195215){utils[_0x7dd2('0x18')](util[_0x7dd2('0x3')](_0x7dd2('0x26'),_0x2ae2a4[_0x7dd2('0x5')]),_0x195215);}};exports[_0x7dd2('0x1d')]=function(_0x1995ee){try{if(!_[_0x7dd2('0x1a')](queues[_0x1995ee[_0x7dd2('0x5')]])){utils[_0x7dd2('0x12')](util[_0x7dd2('0x3')](_0x7dd2('0x32'),_0x1995ee[_0x7dd2('0x5')]),_0x1995ee);queues[_0x1995ee[_0x7dd2('0x5')]][_0x7dd2('0x1e')]=![];queues[_0x1995ee[_0x7dd2('0x5')]]['queuecallerexitAt']=null;queues[_0x1995ee['uniqueid']]['queuecallerabandon']=!![];queues[_0x1995ee[_0x7dd2('0x5')]]['queuecallerabandonAt']=utils[_0x7dd2('0x17')]();queues[_0x1995ee[_0x7dd2('0x5')]][_0x7dd2('0x9')]=_0x7dd2('0x33');utils[_0x7dd2('0x2')](util[_0x7dd2('0x3')](_0x7dd2('0x34'),_0x1995ee[_0x7dd2('0x5')],queues[_0x1995ee[_0x7dd2('0x5')]]['name'],queues[_0x1995ee[_0x7dd2('0x5')]][_0x7dd2('0x9')]));}}catch(_0x38db1d){utils[_0x7dd2('0x18')](util[_0x7dd2('0x3')]('[%s][queues][queuecallerabandon]',_0x1995ee[_0x7dd2('0x5')]),_0x38db1d);}};exports[_0x7dd2('0x35')]=function(_0x29d390){try{if(!_[_0x7dd2('0x1a')](queues[_0x29d390[_0x7dd2('0x5')]])){utils[_0x7dd2('0x12')](util[_0x7dd2('0x3')](_0x7dd2('0x36'),_0x29d390[_0x7dd2('0x5')]),_0x29d390);utils['info'](util[_0x7dd2('0x3')](_0x7dd2('0x37'),_0x29d390[_0x7dd2('0x5')],queues[_0x29d390[_0x7dd2('0x5')]]['name'],_0x29d390[_0x7dd2('0x38')],_0x29d390[_0x7dd2('0x39')]));queues[_0x29d390['uniqueid']][_0x7dd2('0x35')]=!![];queues[_0x29d390[_0x7dd2('0x5')]][_0x7dd2('0x1c')]=utils[_0x7dd2('0x17')]();queues[_0x29d390[_0x7dd2('0x5')]][_0x7dd2('0x3a')]=utils[_0x7dd2('0x3b')](queues[_0x29d390[_0x7dd2('0x5')]][_0x7dd2('0x1c')],queues[_0x29d390['uniqueid']][_0x7dd2('0x3c')]);queues[_0x29d390['uniqueid']][_0x7dd2('0x16')]=_0x29d390[_0x7dd2('0x16')];queues[_0x29d390['uniqueid']][_0x7dd2('0x3d')]=_0x29d390[_0x7dd2('0x3d')];queues[_0x29d390[_0x7dd2('0x5')]][_0x7dd2('0x38')]=_0x29d390[_0x7dd2('0x38')];queues[_0x29d390[_0x7dd2('0x5')]][_0x7dd2('0x39')]=_0x29d390['connectedlinename'];}}catch(_0x55afbd){utils[_0x7dd2('0x18')](util[_0x7dd2('0x3')]('[%s][queues][queuecallerleave]',_0x29d390[_0x7dd2('0x5')]),_0x55afbd);}};exports['agentconnect']=function(_0x5be25d){try{if(!_[_0x7dd2('0x1a')](queues[_0x5be25d[_0x7dd2('0x5')]])){utils['debug'](util['format'](_0x7dd2('0x3e'),_0x5be25d[_0x7dd2('0x5')]),_0x5be25d);utils[_0x7dd2('0x2')](util[_0x7dd2('0x3')]('[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s',_0x5be25d[_0x7dd2('0x5')],queues[_0x5be25d[_0x7dd2('0x5')]][_0x7dd2('0x22')],_0x5be25d['membername'],_0x5be25d['destaccountcode']));queues[_0x5be25d[_0x7dd2('0x5')]][_0x7dd2('0x1d')]=![];queues[_0x5be25d[_0x7dd2('0x5')]][_0x7dd2('0x1d')]=![];queues[_0x5be25d['uniqueid']][_0x7dd2('0x2b')]=null;queues[_0x5be25d[_0x7dd2('0x5')]][_0x7dd2('0x1e')]=![];queues[_0x5be25d['uniqueid']][_0x7dd2('0x9')]=null;queues[_0x5be25d[_0x7dd2('0x5')]][_0x7dd2('0x2c')]=null;queues[_0x5be25d[_0x7dd2('0x5')]]['assigned']=!![];queues[_0x5be25d['uniqueid']]['accountcode']=_0x5be25d['destaccountcode'];queues[_0x5be25d['uniqueid']]['lastAssignedTo']=_0x5be25d[_0x7dd2('0x3f')];}}catch(_0x1dca6b){utils[_0x7dd2('0x18')](util['format']('[%s][queues][agentconnect]',_0x5be25d['uniqueid']),_0x1dca6b);}};exports[_0x7dd2('0x40')]=function(_0x5f5a77){try{if(!_[_0x7dd2('0x1a')](queues[_0x5f5a77[_0x7dd2('0x5')]])){if(queues[_0x5f5a77[_0x7dd2('0x5')]][_0x7dd2('0x1c')]){utils[_0x7dd2('0x12')](util[_0x7dd2('0x3')]('[%s][queues][agentcomplete]',_0x5f5a77[_0x7dd2('0x5')]),_0x5f5a77);queues[_0x5f5a77['uniqueid']]['queuecallerabandon']=![];queues[_0x5f5a77[_0x7dd2('0x5')]][_0x7dd2('0x1d')]=![];queues[_0x5f5a77[_0x7dd2('0x5')]][_0x7dd2('0x2b')]=null;queues[_0x5f5a77[_0x7dd2('0x5')]][_0x7dd2('0x1e')]=![];queues[_0x5f5a77['uniqueid']]['queuecallerexitAt']=null;queues[_0x5f5a77[_0x7dd2('0x5')]][_0x7dd2('0x41')]=!![];queues[_0x5f5a77[_0x7dd2('0x5')]]['lastAssignedTo']=_0x5f5a77[_0x7dd2('0x3f')];queues[_0x5f5a77[_0x7dd2('0x5')]][_0x7dd2('0x42')]=!![];queues[_0x5f5a77[_0x7dd2('0x5')]]['queuecallercompleteAt']=utils['now']();if(_0x5f5a77[_0x7dd2('0x43')]==_0x7dd2('0x44')){if(!queues[_0x5f5a77[_0x7dd2('0x5')]][_0x7dd2('0x44')]){queues[_0x5f5a77[_0x7dd2('0x5')]][_0x7dd2('0x9')]=_0x7dd2('0x45');}}else{queues[_0x5f5a77[_0x7dd2('0x5')]]['queuecallerexitreason']='COMPLETEDBY'+_0x5f5a77[_0x7dd2('0x43')][_0x7dd2('0x2d')]();}utils[_0x7dd2('0x2')](util[_0x7dd2('0x3')](_0x7dd2('0x46'),_0x5f5a77[_0x7dd2('0x5')],queues[_0x5f5a77[_0x7dd2('0x5')]]['name'],_0x5f5a77[_0x7dd2('0x3f')],queues[_0x5f5a77['uniqueid']]['queuecallerexitreason']));writeDB(queues[_0x5f5a77['uniqueid']]);}}}catch(_0x522aad){utils[_0x7dd2('0x18')](util[_0x7dd2('0x3')](_0x7dd2('0x47'),_0x5f5a77['uniqueid']),_0x522aad);}};exports[_0x7dd2('0x48')]=function(_0x4f53f8){try{if(!_[_0x7dd2('0x1a')](queues[_0x4f53f8[_0x7dd2('0x49')]])){utils['debug'](util['format'](_0x7dd2('0x4a'),_0x4f53f8[_0x7dd2('0x5')]),_0x4f53f8);queues[_0x4f53f8[_0x7dd2('0x49')]][_0x7dd2('0x44')]=!![];queues[_0x4f53f8[_0x7dd2('0x49')]][_0x7dd2('0x4b')]=_0x7dd2('0x4c');queues[_0x4f53f8[_0x7dd2('0x49')]][_0x7dd2('0x4d')]=_0x4f53f8[_0x7dd2('0x4e')];queues[_0x4f53f8[_0x7dd2('0x49')]][_0x7dd2('0x4f')]=_0x4f53f8[_0x7dd2('0x49')];queues[_0x4f53f8['transfereeuniqueid']][_0x7dd2('0x9')]=_0x7dd2('0x50');utils[_0x7dd2('0x2')](util[_0x7dd2('0x3')](_0x7dd2('0x51'),_0x4f53f8['uniqueid'],queues[_0x4f53f8[_0x7dd2('0x49')]][_0x7dd2('0x22')],_0x4f53f8[_0x7dd2('0x49')],_0x4f53f8['extension']));}}catch(_0x5559c7){utils[_0x7dd2('0x18')](util[_0x7dd2('0x3')](_0x7dd2('0x4a'),_0x4f53f8[_0x7dd2('0x5')]),_0x5559c7);}};exports[_0x7dd2('0x52')]=function(_0x5a43dc){try{utils[_0x7dd2('0x12')](util[_0x7dd2('0x3')](_0x7dd2('0x53'),_0x5a43dc[_0x7dd2('0x54')]),_0x5a43dc);if(_0x5a43dc[_0x7dd2('0x54')]==_0x5a43dc[_0x7dd2('0x55')]){if(!_[_0x7dd2('0x1a')](queues[_0x5a43dc[_0x7dd2('0x56')]])){utils[_0x7dd2('0x2')](util[_0x7dd2('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x5a43dc['origtransfereruniqueid'],queues[_0x5a43dc[_0x7dd2('0x56')]][_0x7dd2('0x22')],_0x5a43dc[_0x7dd2('0x57')]));queues[_0x5a43dc['secondtransfererlinkedid']][_0x7dd2('0x44')]=!![];queues[_0x5a43dc['secondtransfererlinkedid']][_0x7dd2('0x4b')]=_0x7dd2('0x58');queues[_0x5a43dc[_0x7dd2('0x56')]][_0x7dd2('0x4d')]=_0x5a43dc[_0x7dd2('0x57')];queues[_0x5a43dc[_0x7dd2('0x56')]][_0x7dd2('0x4f')]=_0x5a43dc[_0x7dd2('0x54')];queues[_0x5a43dc['secondtransfererlinkedid']][_0x7dd2('0x9')]='ATTENDEDTRANSFER';}if(!_[_0x7dd2('0x1a')](queues[_0x5a43dc[_0x7dd2('0x55')]])){if(_0x5a43dc[_0x7dd2('0x59')]&&queues[_0x5a43dc[_0x7dd2('0x59')]]){queues[_0x5a43dc['transfereelinkedid']]['queuecallerenterreason']=0x1;queues[_0x5a43dc['transfereeuniqueid']]=_[_0x7dd2('0x5a')](queues[_0x5a43dc[_0x7dd2('0x59')]]);queues[_0x5a43dc['transfereeuniqueid']][_0x7dd2('0x10')]=_0x5a43dc[_0x7dd2('0x5b')];queues[_0x5a43dc['transfereeuniqueid']][_0x7dd2('0x24')]=0x2;queues[_0x5a43dc[_0x7dd2('0x49')]][_0x7dd2('0x5c')]=queues[_0x5a43dc[_0x7dd2('0x56')]][_0x7dd2('0x5c')];queues[_0x5a43dc[_0x7dd2('0x49')]][_0x7dd2('0x5d')]=queues[_0x5a43dc[_0x7dd2('0x56')]]['calleridname'];queues[_0x5a43dc[_0x7dd2('0x49')]][_0x7dd2('0x3c')]=utils[_0x7dd2('0x17')]();queues[_0x5a43dc[_0x7dd2('0x49')]][_0x7dd2('0x1c')]=utils['now']();queues[_0x5a43dc[_0x7dd2('0x49')]][_0x7dd2('0x3a')]=0x0;queues[_0x5a43dc[_0x7dd2('0x49')]]['mohtime']=0x0;utils['info'](util['format'](_0x7dd2('0x5e'),_0x5a43dc[_0x7dd2('0x54')],queues[_0x5a43dc['transfereeuniqueid']][_0x7dd2('0x22')],queues[_0x5a43dc['transfereeuniqueid']][_0x7dd2('0x5c')],queues[_0x5a43dc[_0x7dd2('0x49')]][_0x7dd2('0x5d')]));}else{utils[_0x7dd2('0x2')](util[_0x7dd2('0x3')](_0x7dd2('0x5f'),_0x5a43dc['origtransfereruniqueid'],queues[_0x5a43dc['origtransfererlinkedid']][_0x7dd2('0x22')],_0x5a43dc[_0x7dd2('0x56')]));queues[_0x5a43dc[_0x7dd2('0x55')]][_0x7dd2('0x10')]=_0x5a43dc[_0x7dd2('0x56')];}}}else if(_0x5a43dc[_0x7dd2('0x60')]==_0x5a43dc[_0x7dd2('0x56')]){if(!_[_0x7dd2('0x1a')](queues[_0x5a43dc[_0x7dd2('0x55')]])){utils[_0x7dd2('0x2')](util[_0x7dd2('0x3')](_0x7dd2('0x61'),_0x5a43dc[_0x7dd2('0x54')],queues[_0x5a43dc['origtransfererlinkedid']][_0x7dd2('0x22')],_0x5a43dc[_0x7dd2('0x60')],_0x5a43dc[_0x7dd2('0x62')]));queues[_0x5a43dc['origtransfererlinkedid']][_0x7dd2('0x44')]=!![];queues[_0x5a43dc['origtransfererlinkedid']]['transfertype']=_0x7dd2('0x58');queues[_0x5a43dc[_0x7dd2('0x55')]][_0x7dd2('0x4d')]=_0x5a43dc[_0x7dd2('0x62')];queues[_0x5a43dc['origtransfererlinkedid']]['transferuniqueid']=_0x5a43dc[_0x7dd2('0x60')];queues[_0x5a43dc[_0x7dd2('0x55')]][_0x7dd2('0x9')]='ATTENDEDTRANSFER';}if(!_[_0x7dd2('0x1a')](queues[_0x5a43dc[_0x7dd2('0x56')]])){if(_0x5a43dc['transfertargetlinkedid']&&queues[_0x5a43dc[_0x7dd2('0x63')]]){queues[_0x5a43dc['transfertargetlinkedid']]['queuecallerenterreason']=0x1;queues[_0x5a43dc[_0x7dd2('0x5b')]]=_[_0x7dd2('0x5a')](queues[_0x5a43dc[_0x7dd2('0x63')]]);queues[_0x5a43dc[_0x7dd2('0x5b')]][_0x7dd2('0x10')]=_0x5a43dc[_0x7dd2('0x5b')];queues[_0x5a43dc[_0x7dd2('0x5b')]][_0x7dd2('0x24')]=0x2;queues[_0x5a43dc['transfertargetuniqueid']][_0x7dd2('0x5c')]=queues[_0x5a43dc[_0x7dd2('0x55')]][_0x7dd2('0x5c')];queues[_0x5a43dc[_0x7dd2('0x5b')]][_0x7dd2('0x5d')]=queues[_0x5a43dc[_0x7dd2('0x55')]]['calleridname'];queues[_0x5a43dc['transfertargetuniqueid']][_0x7dd2('0x3c')]=utils[_0x7dd2('0x17')]();queues[_0x5a43dc[_0x7dd2('0x5b')]]['queuecallerleaveAt']=utils[_0x7dd2('0x17')]();queues[_0x5a43dc['transfertargetuniqueid']][_0x7dd2('0x3a')]=0x0;queues[_0x5a43dc[_0x7dd2('0x5b')]][_0x7dd2('0x64')]=0x0;utils['info'](util[_0x7dd2('0x3')](_0x7dd2('0x65'),_0x5a43dc[_0x7dd2('0x54')],queues[_0x5a43dc['transfertargetuniqueid']][_0x7dd2('0x22')],queues[_0x5a43dc[_0x7dd2('0x5b')]][_0x7dd2('0x10')],queues[_0x5a43dc['transfertargetuniqueid']][_0x7dd2('0x5c')],queues[_0x5a43dc[_0x7dd2('0x5b')]][_0x7dd2('0x5d')]));}else{utils['info'](util[_0x7dd2('0x3')](_0x7dd2('0x5f'),_0x5a43dc[_0x7dd2('0x54')],queues[_0x5a43dc['secondtransfererlinkedid']][_0x7dd2('0x22')],_0x5a43dc[_0x7dd2('0x55')]));queues[_0x5a43dc[_0x7dd2('0x56')]][_0x7dd2('0x10')]=_0x5a43dc[_0x7dd2('0x55')];}}}}catch(_0x29b354){utils['error'](util['format'](_0x7dd2('0x53'),_0x5a43dc['origtransfereruniqueid']),_0x29b354);}};exports[_0x7dd2('0x66')]=function(_0x5630eb){try{if(!_[_0x7dd2('0x1a')](queues[_0x5630eb[_0x7dd2('0x5')]])){utils[_0x7dd2('0x12')](util[_0x7dd2('0x3')](_0x7dd2('0x67'),_0x5630eb[_0x7dd2('0x5')]),_0x5630eb);queues[_0x5630eb[_0x7dd2('0x5')]][_0x7dd2('0x68')]=utils[_0x7dd2('0x17')]();utils[_0x7dd2('0x2')](util[_0x7dd2('0x3')](_0x7dd2('0x69'),_0x5630eb[_0x7dd2('0x5')],queues[_0x5630eb[_0x7dd2('0x5')]][_0x7dd2('0x22')],queues[_0x5630eb[_0x7dd2('0x5')]][_0x7dd2('0x68')]));}}catch(_0xfd287b){utils[_0x7dd2('0x18')](util[_0x7dd2('0x3')](_0x7dd2('0x67'),_0x5630eb['uniqueid']),_0xfd287b);}};exports[_0x7dd2('0x6a')]=function(_0x3e3e34){try{if(!_[_0x7dd2('0x1a')](queues[_0x3e3e34[_0x7dd2('0x5')]])){if(!_[_0x7dd2('0x1a')](queues[_0x3e3e34[_0x7dd2('0x5')]][_0x7dd2('0x68')])){utils[_0x7dd2('0x12')](util['format'](_0x7dd2('0x6b'),_0x3e3e34[_0x7dd2('0x5')]),_0x3e3e34);queues[_0x3e3e34[_0x7dd2('0x5')]][_0x7dd2('0x64')]+=utils['diffTime'](utils['now'](),queues[_0x3e3e34[_0x7dd2('0x5')]][_0x7dd2('0x68')]);utils[_0x7dd2('0x2')](util[_0x7dd2('0x3')](_0x7dd2('0x6c'),_0x3e3e34['uniqueid'],queues[_0x3e3e34[_0x7dd2('0x5')]][_0x7dd2('0x22')],queues[_0x3e3e34[_0x7dd2('0x5')]][_0x7dd2('0x64')]));delete queues[_0x3e3e34[_0x7dd2('0x5')]][_0x7dd2('0x68')];}}}catch(_0x575a1f){utils['error'](util[_0x7dd2('0x3')](_0x7dd2('0x6b'),_0x3e3e34[_0x7dd2('0x5')]),_0x575a1f);}}; \ No newline at end of file +var _0x7aca=['attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','origtransfererexten','ATTENDED','ATTENDEDTRANSFER','transfereelinkedid','queuecallerenterreason','clone','transfertargetuniqueid','calleridname','queuecallerjoinAt','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transfertargetlinkedid','[%s][queues][musiconholdstart]','musiconholdstartAt','musiconholdstop','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','./utils','info','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','format','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','now','error','hangup','[%s][queues][hangup]','queuecallerleaveAt','queuecallerexit','queuecallercomplete','queuecallercompleteAt','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','name','isNil','value','CONTINUE','queuecallerabandon','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queuecallerabandonAt','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][varset]','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','queuecallerleave','holdtime','diffTime','count','connectedlinename','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','assigned','agentcomplete','[%s][queues][agentcomplete]','reason','transfer','TRANSFER','COMPLETEDBY','toUpperCase','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','[%s][queues][blindtransfer]','transfereeuniqueid','transfertype','transferexten','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','extension'];(function(_0x41daeb,_0x3f138d){var _0x5b142d=function(_0x195224){while(--_0x195224){_0x41daeb['push'](_0x41daeb['shift']());}};_0x5b142d(++_0x3f138d);}(_0x7aca,0x151));var _0xa7ac=function(_0xbac413,_0x3fab3a){_0xbac413=_0xbac413-0x0;var _0x23e833=_0x7aca[_0xbac413];return _0x23e833;};'use strict';var _=require(_0xa7ac('0x0'));var util=require('util');var utils=require(_0xa7ac('0x1'));var queues={};function writeDB(_0x596e2a){utils[_0xa7ac('0x2')](util['format'](_0xa7ac('0x3'),_0x596e2a[_0xa7ac('0x4')],_0x596e2a[_0xa7ac('0x5')],_0x596e2a[_0xa7ac('0x6')],_0x596e2a[_0xa7ac('0x7')],_0x596e2a[_0xa7ac('0x8')],_0x596e2a[_0xa7ac('0x9')],_0x596e2a[_0xa7ac('0xa')]));if(_0x596e2a[_0xa7ac('0x6')]){utils[_0xa7ac('0xb')](_0x596e2a[_0xa7ac('0x6')])[_0xa7ac('0xc')](function(_0x260910){if(_0x260910){_0x596e2a[_0xa7ac('0xd')]=_0x260910[_0xa7ac('0xd')];}utils[_0xa7ac('0xe')](_0xa7ac('0xf'),_0x596e2a);});}else{utils[_0xa7ac('0xe')](_0xa7ac('0xf'),_0x596e2a);}if(_0x596e2a[_0xa7ac('0x10')]){delete queues[_0x596e2a[_0xa7ac('0x10')]];}else{delete queues[_0x596e2a['uniqueid']];}}exports[_0xa7ac('0x11')]=function(_0x9f8241){try{utils[_0xa7ac('0x12')](util[_0xa7ac('0x13')](_0xa7ac('0x14'),_0x9f8241['uniqueid']),_0x9f8241);utils[_0xa7ac('0x2')](util[_0xa7ac('0x13')](_0xa7ac('0x15'),_0x9f8241[_0xa7ac('0x4')],_0x9f8241[_0xa7ac('0x6')],_0x9f8241[_0xa7ac('0x16')]));queues[_0x9f8241['uniqueid']]=_[_0xa7ac('0x17')](_0x9f8241,{'originalposition':_0x9f8241[_0xa7ac('0x16')],'queuecallerjoinAt':utils[_0xa7ac('0x18')](),'mohtime':0x0});}catch(_0x33a00e){utils[_0xa7ac('0x19')](util[_0xa7ac('0x13')](_0xa7ac('0x14'),_0x9f8241[_0xa7ac('0x4')]),_0x33a00e);}};exports[_0xa7ac('0x1a')]=function(_0x31625b){try{if(!_['isNil'](queues[_0x31625b[_0xa7ac('0x4')]])){utils[_0xa7ac('0x12')](util[_0xa7ac('0x13')](_0xa7ac('0x1b'),_0x31625b[_0xa7ac('0x4')]),_0x31625b);if(queues[_0x31625b[_0xa7ac('0x4')]][_0xa7ac('0x1c')]){if(!queues[_0x31625b['uniqueid']]['queuecallerabandon']&&!queues[_0x31625b[_0xa7ac('0x4')]][_0xa7ac('0x1d')]){queues[_0x31625b['uniqueid']][_0xa7ac('0x1e')]=!![];queues[_0x31625b[_0xa7ac('0x4')]][_0xa7ac('0x1f')]=utils['now']();queues[_0x31625b['uniqueid']][_0xa7ac('0xa')]=_0xa7ac('0x20');}utils[_0xa7ac('0x2')](util[_0xa7ac('0x13')](_0xa7ac('0x21'),_0x31625b['uniqueid'],queues[_0x31625b[_0xa7ac('0x4')]]['name'],queues[_0x31625b[_0xa7ac('0x4')]][_0xa7ac('0xa')]));writeDB(queues[_0x31625b[_0xa7ac('0x4')]]);}else if(queues[_0x31625b[_0xa7ac('0x4')]]['transfereduniqueid']){utils['info'](util['format'](_0xa7ac('0x22'),_0x31625b[_0xa7ac('0x4')],queues[_0x31625b[_0xa7ac('0x4')]][_0xa7ac('0x23')],queues[_0x31625b[_0xa7ac('0x4')]][_0xa7ac('0x10')]));queues[queues[_0x31625b[_0xa7ac('0x4')]][_0xa7ac('0x10')]]=queues[_0x31625b['uniqueid']];queues[queues[_0x31625b['uniqueid']][_0xa7ac('0x10')]]['queuecallerenterreason']=0x2;delete queues[_0x31625b['uniqueid']];}}}catch(_0x15017d){utils[_0xa7ac('0x19')](util[_0xa7ac('0x13')](_0xa7ac('0x1b'),_0x31625b[_0xa7ac('0x4')]),_0x15017d);}};exports['varset']=function(_0x1a75fb){try{utils['debug'](util[_0xa7ac('0x13')]('[%s][queues][varset]',_0x1a75fb[_0xa7ac('0x4')]),_0x1a75fb);if(!_[_0xa7ac('0x24')](_0x1a75fb['variable']['queuestatus'])&&_0x1a75fb[_0xa7ac('0x25')]['toUpperCase']()!==_0xa7ac('0x26')){if(!_[_0xa7ac('0x24')](queues[_0x1a75fb[_0xa7ac('0x4')]])){queues[_0x1a75fb[_0xa7ac('0x4')]][_0xa7ac('0x27')]=![];queues[_0x1a75fb['uniqueid']]['queuecallerabandonAt']=null;queues[_0x1a75fb[_0xa7ac('0x4')]]['queuecallerexit']=!![];queues[_0x1a75fb[_0xa7ac('0x4')]][_0xa7ac('0x28')]=utils[_0xa7ac('0x18')]();queues[_0x1a75fb[_0xa7ac('0x4')]][_0xa7ac('0xa')]=_0x1a75fb[_0xa7ac('0x25')]['toUpperCase']();utils[_0xa7ac('0x2')](util[_0xa7ac('0x13')](_0xa7ac('0x29'),_0x1a75fb[_0xa7ac('0x4')],queues[_0x1a75fb[_0xa7ac('0x4')]][_0xa7ac('0x23')],_0x1a75fb['value'],queues[_0x1a75fb['uniqueid']]['queuecallerexitreason']));writeDB(queues[_0x1a75fb['uniqueid']]);}}else if(!_[_0xa7ac('0x24')](_0x1a75fb['variable']['queueposition'])){if(!_[_0xa7ac('0x24')](queues[_0x1a75fb[_0xa7ac('0x4')]])&&!queues[_0x1a75fb[_0xa7ac('0x4')]]['queuecallerabandon']){queues[_0x1a75fb[_0xa7ac('0x4')]][_0xa7ac('0x27')]=![];queues[_0x1a75fb[_0xa7ac('0x4')]][_0xa7ac('0x2a')]=null;queues[_0x1a75fb[_0xa7ac('0x4')]]['queuecallerexit']=!![];queues[_0x1a75fb[_0xa7ac('0x4')]][_0xa7ac('0x28')]=utils[_0xa7ac('0x18')]();queues[_0x1a75fb[_0xa7ac('0x4')]][_0xa7ac('0xa')]=_0xa7ac('0x2b');utils['info'](util[_0xa7ac('0x13')](_0xa7ac('0x2c'),_0x1a75fb['uniqueid'],queues[_0x1a75fb['uniqueid']][_0xa7ac('0x23')],_0x1a75fb[_0xa7ac('0x25')],queues[_0x1a75fb['uniqueid']]['queuecallerexitreason']));}}}catch(_0x199a04){utils[_0xa7ac('0x19')](util[_0xa7ac('0x13')](_0xa7ac('0x2d'),_0x1a75fb[_0xa7ac('0x4')]),_0x199a04);}};exports[_0xa7ac('0x27')]=function(_0x501f53){try{if(!_[_0xa7ac('0x24')](queues[_0x501f53[_0xa7ac('0x4')]])){utils['debug'](util['format'](_0xa7ac('0x2e'),_0x501f53[_0xa7ac('0x4')]),_0x501f53);queues[_0x501f53[_0xa7ac('0x4')]][_0xa7ac('0x1d')]=![];queues[_0x501f53['uniqueid']][_0xa7ac('0x28')]=null;queues[_0x501f53[_0xa7ac('0x4')]]['queuecallerabandon']=!![];queues[_0x501f53['uniqueid']]['queuecallerabandonAt']=utils['now']();queues[_0x501f53[_0xa7ac('0x4')]][_0xa7ac('0xa')]=_0xa7ac('0x2f');utils[_0xa7ac('0x2')](util['format']('[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s',_0x501f53[_0xa7ac('0x4')],queues[_0x501f53['uniqueid']][_0xa7ac('0x23')],queues[_0x501f53['uniqueid']][_0xa7ac('0xa')]));}}catch(_0x122680){utils[_0xa7ac('0x19')](util[_0xa7ac('0x13')](_0xa7ac('0x2e'),_0x501f53['uniqueid']),_0x122680);}};exports['queuecallerleave']=function(_0xa2254a){try{if(!_['isNil'](queues[_0xa2254a['uniqueid']])){utils[_0xa7ac('0x12')](util[_0xa7ac('0x13')](_0xa7ac('0x30'),_0xa2254a[_0xa7ac('0x4')]),_0xa2254a);utils[_0xa7ac('0x2')](util[_0xa7ac('0x13')](_0xa7ac('0x31'),_0xa2254a[_0xa7ac('0x4')],queues[_0xa2254a[_0xa7ac('0x4')]][_0xa7ac('0x23')],_0xa2254a[_0xa7ac('0x32')],_0xa2254a['connectedlinename']));queues[_0xa2254a[_0xa7ac('0x4')]][_0xa7ac('0x33')]=!![];queues[_0xa2254a[_0xa7ac('0x4')]][_0xa7ac('0x1c')]=utils['now']();queues[_0xa2254a[_0xa7ac('0x4')]][_0xa7ac('0x34')]=utils[_0xa7ac('0x35')](queues[_0xa2254a[_0xa7ac('0x4')]][_0xa7ac('0x1c')],queues[_0xa2254a[_0xa7ac('0x4')]]['queuecallerjoinAt']);queues[_0xa2254a[_0xa7ac('0x4')]][_0xa7ac('0x16')]=_0xa2254a['position'];queues[_0xa2254a['uniqueid']][_0xa7ac('0x36')]=_0xa2254a[_0xa7ac('0x36')];queues[_0xa2254a[_0xa7ac('0x4')]][_0xa7ac('0x32')]=_0xa2254a[_0xa7ac('0x32')];queues[_0xa2254a[_0xa7ac('0x4')]]['connectedlinename']=_0xa2254a[_0xa7ac('0x37')];}}catch(_0x215b24){utils['error'](util[_0xa7ac('0x13')](_0xa7ac('0x30'),_0xa2254a[_0xa7ac('0x4')]),_0x215b24);}};exports[_0xa7ac('0x38')]=function(_0x4266a3){try{if(!_[_0xa7ac('0x24')](queues[_0x4266a3['uniqueid']])){utils[_0xa7ac('0x12')](util[_0xa7ac('0x13')](_0xa7ac('0x39'),_0x4266a3[_0xa7ac('0x4')]),_0x4266a3);utils[_0xa7ac('0x2')](util[_0xa7ac('0x13')](_0xa7ac('0x3a'),_0x4266a3[_0xa7ac('0x4')],queues[_0x4266a3[_0xa7ac('0x4')]]['name'],_0x4266a3[_0xa7ac('0x3b')],_0x4266a3[_0xa7ac('0x3c')]));queues[_0x4266a3[_0xa7ac('0x4')]][_0xa7ac('0x27')]=![];queues[_0x4266a3['uniqueid']]['queuecallerabandon']=![];queues[_0x4266a3['uniqueid']][_0xa7ac('0x2a')]=null;queues[_0x4266a3['uniqueid']][_0xa7ac('0x1d')]=![];queues[_0x4266a3[_0xa7ac('0x4')]][_0xa7ac('0xa')]=null;queues[_0x4266a3[_0xa7ac('0x4')]]['queuecallerexitAt']=null;queues[_0x4266a3[_0xa7ac('0x4')]][_0xa7ac('0x3d')]=!![];queues[_0x4266a3[_0xa7ac('0x4')]][_0xa7ac('0x9')]=_0x4266a3[_0xa7ac('0x3c')];queues[_0x4266a3['uniqueid']][_0xa7ac('0x7')]=_0x4266a3[_0xa7ac('0x3b')];}}catch(_0xd469d4){utils[_0xa7ac('0x19')](util[_0xa7ac('0x13')]('[%s][queues][agentconnect]',_0x4266a3[_0xa7ac('0x4')]),_0xd469d4);}};exports[_0xa7ac('0x3e')]=function(_0x3b3422){try{if(!_[_0xa7ac('0x24')](queues[_0x3b3422[_0xa7ac('0x4')]])){if(queues[_0x3b3422[_0xa7ac('0x4')]][_0xa7ac('0x1c')]){utils[_0xa7ac('0x12')](util['format'](_0xa7ac('0x3f'),_0x3b3422[_0xa7ac('0x4')]),_0x3b3422);queues[_0x3b3422['uniqueid']][_0xa7ac('0x27')]=![];queues[_0x3b3422[_0xa7ac('0x4')]][_0xa7ac('0x27')]=![];queues[_0x3b3422[_0xa7ac('0x4')]][_0xa7ac('0x2a')]=null;queues[_0x3b3422[_0xa7ac('0x4')]][_0xa7ac('0x1d')]=![];queues[_0x3b3422[_0xa7ac('0x4')]][_0xa7ac('0x28')]=null;queues[_0x3b3422[_0xa7ac('0x4')]]['assigned']=!![];queues[_0x3b3422['uniqueid']][_0xa7ac('0x7')]=_0x3b3422[_0xa7ac('0x3b')];queues[_0x3b3422[_0xa7ac('0x4')]][_0xa7ac('0x1e')]=!![];queues[_0x3b3422[_0xa7ac('0x4')]][_0xa7ac('0x1f')]=utils[_0xa7ac('0x18')]();if(_0x3b3422[_0xa7ac('0x40')]==_0xa7ac('0x41')){if(!queues[_0x3b3422['uniqueid']][_0xa7ac('0x41')]){queues[_0x3b3422[_0xa7ac('0x4')]][_0xa7ac('0xa')]=_0xa7ac('0x42');}}else{queues[_0x3b3422[_0xa7ac('0x4')]][_0xa7ac('0xa')]=_0xa7ac('0x43')+_0x3b3422[_0xa7ac('0x40')][_0xa7ac('0x44')]();}utils[_0xa7ac('0x2')](util[_0xa7ac('0x13')](_0xa7ac('0x45'),_0x3b3422[_0xa7ac('0x4')],queues[_0x3b3422[_0xa7ac('0x4')]]['name'],_0x3b3422[_0xa7ac('0x3b')],queues[_0x3b3422[_0xa7ac('0x4')]][_0xa7ac('0xa')]));writeDB(queues[_0x3b3422[_0xa7ac('0x4')]]);}}}catch(_0x4737d2){utils[_0xa7ac('0x19')](util[_0xa7ac('0x13')](_0xa7ac('0x3f'),_0x3b3422[_0xa7ac('0x4')]),_0x4737d2);}};exports[_0xa7ac('0x46')]=function(_0x4d84d3){try{if(!_[_0xa7ac('0x24')](queues[_0x4d84d3['transfereeuniqueid']])){utils[_0xa7ac('0x12')](util[_0xa7ac('0x13')](_0xa7ac('0x47'),_0x4d84d3[_0xa7ac('0x4')]),_0x4d84d3);queues[_0x4d84d3[_0xa7ac('0x48')]][_0xa7ac('0x41')]=!![];queues[_0x4d84d3[_0xa7ac('0x48')]][_0xa7ac('0x49')]='BLIND';queues[_0x4d84d3[_0xa7ac('0x48')]][_0xa7ac('0x4a')]=_0x4d84d3['extension'];queues[_0x4d84d3[_0xa7ac('0x48')]][_0xa7ac('0x4b')]=_0x4d84d3[_0xa7ac('0x48')];queues[_0x4d84d3[_0xa7ac('0x48')]][_0xa7ac('0xa')]=_0xa7ac('0x4c');utils[_0xa7ac('0x2')](util[_0xa7ac('0x13')](_0xa7ac('0x4d'),_0x4d84d3['uniqueid'],queues[_0x4d84d3[_0xa7ac('0x48')]][_0xa7ac('0x23')],_0x4d84d3[_0xa7ac('0x48')],_0x4d84d3[_0xa7ac('0x4e')]));}}catch(_0x517636){utils[_0xa7ac('0x19')](util[_0xa7ac('0x13')]('[%s][queues][blindtransfer]',_0x4d84d3[_0xa7ac('0x4')]),_0x517636);}};exports[_0xa7ac('0x4f')]=function(_0x4671a0){try{utils[_0xa7ac('0x12')](util['format'](_0xa7ac('0x50'),_0x4671a0[_0xa7ac('0x51')]),_0x4671a0);if(_0x4671a0[_0xa7ac('0x51')]==_0x4671a0[_0xa7ac('0x52')]){if(!_[_0xa7ac('0x24')](queues[_0x4671a0[_0xa7ac('0x53')]])){utils[_0xa7ac('0x2')](util[_0xa7ac('0x13')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x4671a0[_0xa7ac('0x51')],queues[_0x4671a0[_0xa7ac('0x53')]][_0xa7ac('0x23')],_0x4671a0[_0xa7ac('0x54')]));queues[_0x4671a0[_0xa7ac('0x53')]][_0xa7ac('0x41')]=!![];queues[_0x4671a0[_0xa7ac('0x53')]][_0xa7ac('0x49')]=_0xa7ac('0x55');queues[_0x4671a0[_0xa7ac('0x53')]][_0xa7ac('0x4a')]=_0x4671a0['origtransfererexten'];queues[_0x4671a0[_0xa7ac('0x53')]][_0xa7ac('0x4b')]=_0x4671a0['origtransfereruniqueid'];queues[_0x4671a0[_0xa7ac('0x53')]][_0xa7ac('0xa')]=_0xa7ac('0x56');}if(!_[_0xa7ac('0x24')](queues[_0x4671a0[_0xa7ac('0x52')]])){if(_0x4671a0[_0xa7ac('0x57')]&&queues[_0x4671a0[_0xa7ac('0x57')]]){queues[_0x4671a0[_0xa7ac('0x57')]][_0xa7ac('0x58')]=0x1;queues[_0x4671a0['transfereeuniqueid']]=_[_0xa7ac('0x59')](queues[_0x4671a0[_0xa7ac('0x57')]]);queues[_0x4671a0[_0xa7ac('0x48')]][_0xa7ac('0x10')]=_0x4671a0[_0xa7ac('0x5a')];queues[_0x4671a0[_0xa7ac('0x48')]][_0xa7ac('0x58')]=0x2;queues[_0x4671a0[_0xa7ac('0x48')]][_0xa7ac('0x8')]=queues[_0x4671a0['secondtransfererlinkedid']][_0xa7ac('0x8')];queues[_0x4671a0['transfereeuniqueid']]['calleridname']=queues[_0x4671a0[_0xa7ac('0x53')]][_0xa7ac('0x5b')];queues[_0x4671a0[_0xa7ac('0x48')]][_0xa7ac('0x5c')]=utils['now']();queues[_0x4671a0[_0xa7ac('0x48')]][_0xa7ac('0x1c')]=utils[_0xa7ac('0x18')]();queues[_0x4671a0[_0xa7ac('0x48')]][_0xa7ac('0x34')]=0x0;queues[_0x4671a0[_0xa7ac('0x48')]][_0xa7ac('0x5d')]=0x0;utils[_0xa7ac('0x2')](util[_0xa7ac('0x13')](_0xa7ac('0x5e'),_0x4671a0[_0xa7ac('0x51')],queues[_0x4671a0['transfereeuniqueid']][_0xa7ac('0x23')],queues[_0x4671a0['transfereeuniqueid']][_0xa7ac('0x8')],queues[_0x4671a0[_0xa7ac('0x48')]][_0xa7ac('0x5b')]));}else{utils[_0xa7ac('0x2')](util[_0xa7ac('0x13')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x4671a0[_0xa7ac('0x51')],queues[_0x4671a0['origtransfererlinkedid']][_0xa7ac('0x23')],_0x4671a0['secondtransfererlinkedid']));queues[_0x4671a0[_0xa7ac('0x52')]][_0xa7ac('0x10')]=_0x4671a0[_0xa7ac('0x53')];}}}else if(_0x4671a0[_0xa7ac('0x5f')]==_0x4671a0[_0xa7ac('0x53')]){if(!_[_0xa7ac('0x24')](queues[_0x4671a0[_0xa7ac('0x52')]])){utils['info'](util['format'](_0xa7ac('0x60'),_0x4671a0['origtransfereruniqueid'],queues[_0x4671a0[_0xa7ac('0x52')]]['name'],_0x4671a0[_0xa7ac('0x5f')],_0x4671a0[_0xa7ac('0x61')]));queues[_0x4671a0[_0xa7ac('0x52')]][_0xa7ac('0x41')]=!![];queues[_0x4671a0[_0xa7ac('0x52')]][_0xa7ac('0x49')]='ATTENDED';queues[_0x4671a0[_0xa7ac('0x52')]][_0xa7ac('0x4a')]=_0x4671a0['secondtransfererexten'];queues[_0x4671a0[_0xa7ac('0x52')]]['transferuniqueid']=_0x4671a0[_0xa7ac('0x5f')];queues[_0x4671a0['origtransfererlinkedid']][_0xa7ac('0xa')]=_0xa7ac('0x56');}if(!_[_0xa7ac('0x24')](queues[_0x4671a0[_0xa7ac('0x53')]])){if(_0x4671a0[_0xa7ac('0x62')]&&queues[_0x4671a0['transfertargetlinkedid']]){queues[_0x4671a0['transfertargetlinkedid']][_0xa7ac('0x58')]=0x1;queues[_0x4671a0[_0xa7ac('0x5a')]]=_[_0xa7ac('0x59')](queues[_0x4671a0[_0xa7ac('0x62')]]);queues[_0x4671a0[_0xa7ac('0x5a')]][_0xa7ac('0x10')]=_0x4671a0[_0xa7ac('0x5a')];queues[_0x4671a0[_0xa7ac('0x5a')]][_0xa7ac('0x58')]=0x2;queues[_0x4671a0[_0xa7ac('0x5a')]]['calleridnum']=queues[_0x4671a0[_0xa7ac('0x52')]][_0xa7ac('0x8')];queues[_0x4671a0[_0xa7ac('0x5a')]][_0xa7ac('0x5b')]=queues[_0x4671a0[_0xa7ac('0x52')]][_0xa7ac('0x5b')];queues[_0x4671a0[_0xa7ac('0x5a')]][_0xa7ac('0x5c')]=utils[_0xa7ac('0x18')]();queues[_0x4671a0[_0xa7ac('0x5a')]][_0xa7ac('0x1c')]=utils['now']();queues[_0x4671a0['transfertargetuniqueid']]['holdtime']=0x0;queues[_0x4671a0[_0xa7ac('0x5a')]][_0xa7ac('0x5d')]=0x0;utils['info'](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s',_0x4671a0[_0xa7ac('0x51')],queues[_0x4671a0[_0xa7ac('0x5a')]]['name'],queues[_0x4671a0[_0xa7ac('0x5a')]]['transfereduniqueid'],queues[_0x4671a0['transfertargetuniqueid']]['calleridnum'],queues[_0x4671a0[_0xa7ac('0x5a')]][_0xa7ac('0x5b')]));}else{utils['info'](util[_0xa7ac('0x13')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x4671a0[_0xa7ac('0x51')],queues[_0x4671a0[_0xa7ac('0x53')]][_0xa7ac('0x23')],_0x4671a0[_0xa7ac('0x52')]));queues[_0x4671a0[_0xa7ac('0x53')]][_0xa7ac('0x10')]=_0x4671a0['origtransfererlinkedid'];}}}}catch(_0x482fde){utils[_0xa7ac('0x19')](util['format'](_0xa7ac('0x50'),_0x4671a0['origtransfereruniqueid']),_0x482fde);}};exports['musiconholdstart']=function(_0x48cb57){try{if(!_[_0xa7ac('0x24')](queues[_0x48cb57[_0xa7ac('0x4')]])){utils[_0xa7ac('0x12')](util['format'](_0xa7ac('0x63'),_0x48cb57[_0xa7ac('0x4')]),_0x48cb57);queues[_0x48cb57['uniqueid']][_0xa7ac('0x64')]=utils[_0xa7ac('0x18')]();utils[_0xa7ac('0x2')](util[_0xa7ac('0x13')]('[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s',_0x48cb57[_0xa7ac('0x4')],queues[_0x48cb57[_0xa7ac('0x4')]]['name'],queues[_0x48cb57['uniqueid']][_0xa7ac('0x64')]));}}catch(_0x29d246){utils['error'](util[_0xa7ac('0x13')](_0xa7ac('0x63'),_0x48cb57[_0xa7ac('0x4')]),_0x29d246);}};exports[_0xa7ac('0x65')]=function(_0x196b98){try{if(!_['isNil'](queues[_0x196b98[_0xa7ac('0x4')]])){if(!_['isNil'](queues[_0x196b98[_0xa7ac('0x4')]]['musiconholdstartAt'])){utils[_0xa7ac('0x12')](util[_0xa7ac('0x13')](_0xa7ac('0x66'),_0x196b98[_0xa7ac('0x4')]),_0x196b98);queues[_0x196b98[_0xa7ac('0x4')]][_0xa7ac('0x5d')]+=utils['diffTime'](utils[_0xa7ac('0x18')](),queues[_0x196b98[_0xa7ac('0x4')]][_0xa7ac('0x64')]);utils['info'](util[_0xa7ac('0x13')](_0xa7ac('0x67'),_0x196b98['uniqueid'],queues[_0x196b98[_0xa7ac('0x4')]][_0xa7ac('0x23')],queues[_0x196b98[_0xa7ac('0x4')]][_0xa7ac('0x5d')]));delete queues[_0x196b98[_0xa7ac('0x4')]]['musiconholdstartAt'];}}}catch(_0x361a43){utils[_0xa7ac('0x19')](util['format'](_0xa7ac('0x66'),_0x196b98['uniqueid']),_0x361a43);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index ddd4605..2d36b2c 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 _0x4868=['connectedlinename','type','outbound','forEach','clone','newexten','[%s][recordings][newexten]','application','appdata','cdr','split','substring','lastIndexOf','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','lodash','util','info','format','[%s][recordings][writeDB]','uniqueid','accountcode','getUserByInternal','then','membername','name','UserId','request','CreateVoiceRecording','newchannel','debug','[%s][recordings][newchannel]','linkedid','context','exten','error','isNil','channelstate','channel','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','[%s][recordings][newstate]','variable','mixmonitor_filename','value','.wav49','.WAV','find','monitors','push','[%s][recordings][varset]','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','cause-txt','connectedlinenum'];(function(_0x4cafaa,_0x3a41af){var _0x15995e=function(_0x35abeb){while(--_0x35abeb){_0x4cafaa['push'](_0x4cafaa['shift']());}};_0x15995e(++_0x3a41af);}(_0x4868,0x1a5));var _0x8486=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4868[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x8486('0x0'));var util=require(_0x8486('0x1'));var utils=require('./utils');var recordings={};function writeDB(_0x1888df){utils[_0x8486('0x2')](util[_0x8486('0x3')](_0x8486('0x4'),_0x1888df[_0x8486('0x5')]));if(_0x1888df[_0x8486('0x6')]){utils[_0x8486('0x7')](_0x1888df[_0x8486('0x6')])[_0x8486('0x8')](function(_0x653de){if(_0x653de){_0x1888df[_0x8486('0x9')]=_0x653de[_0x8486('0xa')];_0x1888df[_0x8486('0xb')]=_0x653de['id'];}utils[_0x8486('0xc')](_0x8486('0xd'),_0x1888df);});}else{utils[_0x8486('0xc')](_0x8486('0xd'),_0x1888df);}}exports[_0x8486('0xe')]=function(_0x3e3fde){try{utils[_0x8486('0xf')](util['format'](_0x8486('0x10'),_0x3e3fde['uniqueid']),_0x3e3fde);if(_0x3e3fde[_0x8486('0x5')]==_0x3e3fde[_0x8486('0x11')]){utils['info'](util[_0x8486('0x3')]('[%s][recordings][newchannel]\x20context:%s\x20exten:%s',_0x3e3fde[_0x8486('0x5')],_0x3e3fde[_0x8486('0x12')],_0x3e3fde[_0x8486('0x13')]));recordings[_0x3e3fde[_0x8486('0x5')]]={'uniqueid':_0x3e3fde[_0x8486('0x5')],'accountcode':_0x3e3fde[_0x8486('0x6')],'exten':_0x3e3fde[_0x8486('0x13')],'context':_0x3e3fde[_0x8486('0x12')],'channel':_0x3e3fde['channel'],'monitors':[]};}}catch(_0x374ee1){utils[_0x8486('0x14')](util[_0x8486('0x3')](_0x8486('0x10'),_0x3e3fde['uniqueid']),_0x374ee1);}};exports['newstate']=function(_0x166b99){try{utils[_0x8486('0xf')](util[_0x8486('0x3')]('[%s][recordings][newstate]',_0x166b99[_0x8486('0x5')]),_0x166b99);if(!_[_0x8486('0x15')](recordings[_0x166b99[_0x8486('0x5')]])&&_0x166b99[_0x8486('0x16')]==0x6){utils[_0x8486('0x2')](util[_0x8486('0x3')]('[%s][recordings][newstate]\x20context:%s\x20channel:%s',_0x166b99[_0x8486('0x5')],_0x166b99['context'],_0x166b99[_0x8486('0x17')]));}else if(!_[_0x8486('0x15')](recordings[_0x166b99[_0x8486('0x11')]])&&_0x166b99['channelstate']==0x6&&_0x166b99[_0x8486('0x12')]!=_0x8486('0x18')){utils[_0x8486('0x2')](util[_0x8486('0x3')](_0x8486('0x19'),_0x166b99[_0x8486('0x5')],_0x166b99['linkedid'],_0x166b99['context'],_0x166b99[_0x8486('0x17')]));recordings[_0x166b99[_0x8486('0x11')]][_0x8486('0x6')]=_0x166b99[_0x8486('0x6')];}}catch(_0xf9a76a){utils[_0x8486('0x14')](util[_0x8486('0x3')](_0x8486('0x1a'),_0x166b99[_0x8486('0x5')]),_0xf9a76a);}};exports['varset']=function(_0x31591b){try{if(!_[_0x8486('0x15')](_0x31591b[_0x8486('0x1b')])&&!_['isNil'](_0x31591b['variable'][_0x8486('0x1c')])){utils[_0x8486('0xf')](util['format']('[%s][recordings][varset]',_0x31591b[_0x8486('0x5')]),_0x31591b);utils[_0x8486('0x2')](util[_0x8486('0x3')]('[%s][recordings][varset]\x20variable:%s\x20value:%s',_0x31591b[_0x8486('0x5')],_0x31591b[_0x8486('0x1b')],_0x31591b[_0x8486('0x1d')]));if(_['endsWith'](_0x31591b[_0x8486('0x1d')],_0x8486('0x1e'))){_0x31591b[_0x8486('0x1d')]=_0x31591b['value']['replace']('.wav49',_0x8486('0x1f'));}if(recordings[_0x31591b[_0x8486('0x11')]]){var _0x4d439c=_[_0x8486('0x20')](recordings[_0x31591b[_0x8486('0x11')]][_0x8486('0x21')],{'value':_0x31591b[_0x8486('0x1d')]});if(_[_0x8486('0x15')](_0x4d439c)){recordings[_0x31591b['linkedid']]['monitors'][_0x8486('0x22')]({'value':_0x31591b[_0x8486('0x1d')]});}}}}catch(_0x5df2d2){utils[_0x8486('0x14')](util[_0x8486('0x3')](_0x8486('0x23'),_0x31591b[_0x8486('0x5')]),_0x5df2d2);}};exports[_0x8486('0x24')]=function(_0x221037){try{if(!_[_0x8486('0x15')](recordings[_0x221037[_0x8486('0x5')]])){utils[_0x8486('0xf')](util['format'](_0x8486('0x25'),_0x221037['uniqueid']),_0x221037);utils[_0x8486('0x2')](util['format'](_0x8486('0x26'),_0x221037['uniqueid'],_0x221037[_0x8486('0x27')],_0x221037[_0x8486('0x28')],_0x221037[_0x8486('0x29')]));recordings[_0x221037[_0x8486('0x5')]][_0x8486('0x27')]=_0x221037[_0x8486('0x27')];recordings[_0x221037[_0x8486('0x5')]][_0x8486('0x28')]=_0x221037[_0x8486('0x28')];recordings[_0x221037[_0x8486('0x5')]][_0x8486('0x2a')]=_0x221037[_0x8486('0x2a')];recordings[_0x221037[_0x8486('0x5')]][_0x8486('0x2b')]=_0x221037[_0x8486('0x2b')];if(recordings[_0x221037[_0x8486('0x5')]][_0x8486('0x2c')]==_0x8486('0x2d')&&recordings[_0x221037['uniqueid']][_0x8486('0x6')]){recordings[_0x221037[_0x8486('0x5')]][_0x8486('0x2a')]=recordings[_0x221037[_0x8486('0x5')]][_0x8486('0x6')];recordings[_0x221037[_0x8486('0x5')]]['connectedlinename']='';}recordings[_0x221037[_0x8486('0x5')]][_0x8486('0x21')][_0x8486('0x2e')](function(_0x1d74f2){var _0x56343f=_[_0x8486('0x2f')](recordings[_0x221037['uniqueid']]);_0x56343f[_0x8486('0x1d')]=_0x1d74f2[_0x8486('0x1d')];writeDB(_0x56343f);});delete recordings[_0x221037[_0x8486('0x5')]];}}catch(_0x430e43){utils['error'](util['format'](_0x8486('0x25'),_0x221037[_0x8486('0x5')]),_0x430e43);}};exports[_0x8486('0x30')]=function(_0x3be205){try{if(!_[_0x8486('0x15')](recordings[_0x3be205[_0x8486('0x5')]])){utils[_0x8486('0xf')](util[_0x8486('0x3')](_0x8486('0x31'),_0x3be205[_0x8486('0x5')]),_0x3be205);utils['info'](util[_0x8486('0x3')]('[%s][recordings][newexten]\x20application:%s\x20appdata:%s',_0x3be205['uniqueid'],_0x3be205[_0x8486('0x32')],_0x3be205[_0x8486('0x33')]));if(_0x3be205[_0x8486('0x32')]['toLowerCase']()=='set'&&_['startsWith'](_0x3be205[_0x8486('0x33')]['toLowerCase'](),_0x8486('0x34'))){var _0x3417e6=_0x3be205[_0x8486('0x33')][_0x8486('0x35')]('=');var _0x10448c=_0x3417e6[0x0][_0x8486('0x36')](_0x3417e6[0x0]['lastIndexOf']('(')+0x1,_0x3417e6[0x0][_0x8486('0x37')](')'));var _0x1edae1=_0x3417e6[0x1];recordings[_0x3be205[_0x8486('0x5')]][_0x10448c]=_0x1edae1;}}}catch(_0x248573){utils[_0x8486('0x14')](util['format'](_0x8486('0x31'),_0x3be205[_0x8486('0x5')]),_0x248573);}};exports['queuecallerjoin']=function(_0x5756cb){try{if(!_[_0x8486('0x15')](recordings[_0x5756cb['uniqueid']])){utils[_0x8486('0xf')](util['format']('[%s][recordings][queuecallerjoin]',_0x5756cb['uniqueid']),_0x5756cb);utils[_0x8486('0x2')](util[_0x8486('0x3')](_0x8486('0x38'),_0x5756cb['uniqueid'],_0x5756cb[_0x8486('0x39')]));recordings[_0x5756cb[_0x8486('0x5')]][_0x8486('0x39')]=_0x5756cb['queue'];}}catch(_0x2c39f2){utils[_0x8486('0x14')](util[_0x8486('0x3')]('[%s][recordings][queuecallerjoin]',_0x5756cb[_0x8486('0x5')]),_0x2c39f2);}}; \ No newline at end of file +var _0xd31b=['membername','name','UserId','request','CreateVoiceRecording','newchannel','debug','[%s][recordings][newchannel]','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','[%s][recordings][newstate]','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','error','varset','variable','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','.wav49','replace','.WAV','find','monitors','push','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','connectedlinenum','connectedlinename','clone','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','set','startsWith','cdr','appdata','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','queue','lodash','util','./utils','info','format','[%s][recordings][writeDB]','uniqueid','accountcode','getUserByInternal','then'];(function(_0x4e0851,_0x2ff50c){var _0x49e8cb=function(_0x566bb4){while(--_0x566bb4){_0x4e0851['push'](_0x4e0851['shift']());}};_0x49e8cb(++_0x2ff50c);}(_0xd31b,0x1af));var _0xbd31=function(_0x562593,_0x53e7e9){_0x562593=_0x562593-0x0;var _0x2a4117=_0xd31b[_0x562593];return _0x2a4117;};'use strict';var _=require(_0xbd31('0x0'));var util=require(_0xbd31('0x1'));var utils=require(_0xbd31('0x2'));var recordings={};function writeDB(_0xd65f26){utils[_0xbd31('0x3')](util[_0xbd31('0x4')](_0xbd31('0x5'),_0xd65f26[_0xbd31('0x6')]));if(_0xd65f26[_0xbd31('0x7')]){utils[_0xbd31('0x8')](_0xd65f26[_0xbd31('0x7')])[_0xbd31('0x9')](function(_0x4ea3a8){if(_0x4ea3a8){_0xd65f26[_0xbd31('0xa')]=_0x4ea3a8[_0xbd31('0xb')];_0xd65f26[_0xbd31('0xc')]=_0x4ea3a8['id'];}utils[_0xbd31('0xd')](_0xbd31('0xe'),_0xd65f26);});}else{utils['request'](_0xbd31('0xe'),_0xd65f26);}}exports[_0xbd31('0xf')]=function(_0x3095df){try{utils[_0xbd31('0x10')](util[_0xbd31('0x4')](_0xbd31('0x11'),_0x3095df[_0xbd31('0x6')]),_0x3095df);if(_0x3095df[_0xbd31('0x6')]==_0x3095df[_0xbd31('0x12')]){utils['info'](util[_0xbd31('0x4')](_0xbd31('0x13'),_0x3095df[_0xbd31('0x6')],_0x3095df[_0xbd31('0x14')],_0x3095df[_0xbd31('0x15')]));recordings[_0x3095df[_0xbd31('0x6')]]={'uniqueid':_0x3095df[_0xbd31('0x6')],'accountcode':_0x3095df[_0xbd31('0x7')],'exten':_0x3095df[_0xbd31('0x15')],'context':_0x3095df[_0xbd31('0x14')],'channel':_0x3095df[_0xbd31('0x16')],'monitors':[]};}}catch(_0x198d83){utils['error'](util['format'](_0xbd31('0x11'),_0x3095df[_0xbd31('0x6')]),_0x198d83);}};exports['newstate']=function(_0x387df5){try{utils[_0xbd31('0x10')](util[_0xbd31('0x4')](_0xbd31('0x17'),_0x387df5[_0xbd31('0x6')]),_0x387df5);if(!_[_0xbd31('0x18')](recordings[_0x387df5[_0xbd31('0x6')]])&&_0x387df5[_0xbd31('0x19')]==0x6){utils[_0xbd31('0x3')](util[_0xbd31('0x4')](_0xbd31('0x1a'),_0x387df5[_0xbd31('0x6')],_0x387df5[_0xbd31('0x14')],_0x387df5[_0xbd31('0x16')]));}else if(!_[_0xbd31('0x18')](recordings[_0x387df5['linkedid']])&&_0x387df5['channelstate']==0x6&&_0x387df5['context']!=_0xbd31('0x1b')){utils['info'](util['format'](_0xbd31('0x1c'),_0x387df5[_0xbd31('0x6')],_0x387df5[_0xbd31('0x12')],_0x387df5['context'],_0x387df5[_0xbd31('0x16')]));recordings[_0x387df5[_0xbd31('0x12')]][_0xbd31('0x7')]=_0x387df5['accountcode'];}}catch(_0x71f7d){utils[_0xbd31('0x1d')](util[_0xbd31('0x4')](_0xbd31('0x17'),_0x387df5[_0xbd31('0x6')]),_0x71f7d);}};exports[_0xbd31('0x1e')]=function(_0x1652a3){try{if(!_['isNil'](_0x1652a3[_0xbd31('0x1f')])&&!_[_0xbd31('0x18')](_0x1652a3[_0xbd31('0x1f')]['mixmonitor_filename'])){utils[_0xbd31('0x10')](util[_0xbd31('0x4')](_0xbd31('0x20'),_0x1652a3[_0xbd31('0x6')]),_0x1652a3);utils['info'](util[_0xbd31('0x4')](_0xbd31('0x21'),_0x1652a3[_0xbd31('0x6')],_0x1652a3[_0xbd31('0x1f')],_0x1652a3[_0xbd31('0x22')]));if(_[_0xbd31('0x23')](_0x1652a3[_0xbd31('0x22')],_0xbd31('0x24'))){_0x1652a3[_0xbd31('0x22')]=_0x1652a3[_0xbd31('0x22')][_0xbd31('0x25')](_0xbd31('0x24'),_0xbd31('0x26'));}if(recordings[_0x1652a3[_0xbd31('0x12')]]){var _0x2e8843=_[_0xbd31('0x27')](recordings[_0x1652a3[_0xbd31('0x12')]][_0xbd31('0x28')],{'value':_0x1652a3[_0xbd31('0x22')]});if(_[_0xbd31('0x18')](_0x2e8843)){recordings[_0x1652a3[_0xbd31('0x12')]][_0xbd31('0x28')][_0xbd31('0x29')]({'value':_0x1652a3[_0xbd31('0x22')]});}}}}catch(_0x6bc7e3){utils[_0xbd31('0x1d')](util['format'](_0xbd31('0x20'),_0x1652a3[_0xbd31('0x6')]),_0x6bc7e3);}};exports[_0xbd31('0x2a')]=function(_0x332356){try{if(!_[_0xbd31('0x18')](recordings[_0x332356[_0xbd31('0x6')]])){utils[_0xbd31('0x10')](util['format'](_0xbd31('0x2b'),_0x332356['uniqueid']),_0x332356);utils[_0xbd31('0x3')](util[_0xbd31('0x4')](_0xbd31('0x2c'),_0x332356[_0xbd31('0x6')],_0x332356['calleridnum'],_0x332356['calleridname'],_0x332356['cause-txt']));recordings[_0x332356[_0xbd31('0x6')]]['calleridnum']=_0x332356[_0xbd31('0x2d')];recordings[_0x332356[_0xbd31('0x6')]]['calleridname']=_0x332356[_0xbd31('0x2e')];recordings[_0x332356[_0xbd31('0x6')]]['connectedlinenum']=_0x332356[_0xbd31('0x2f')];recordings[_0x332356[_0xbd31('0x6')]][_0xbd31('0x30')]=_0x332356['connectedlinename'];if(recordings[_0x332356[_0xbd31('0x6')]]['type']=='outbound'&&recordings[_0x332356[_0xbd31('0x6')]][_0xbd31('0x7')]){recordings[_0x332356['uniqueid']][_0xbd31('0x2f')]=recordings[_0x332356[_0xbd31('0x6')]][_0xbd31('0x7')];recordings[_0x332356[_0xbd31('0x6')]]['connectedlinename']='';}recordings[_0x332356[_0xbd31('0x6')]][_0xbd31('0x28')]['forEach'](function(_0x29fee5){var _0x5a5589=_[_0xbd31('0x31')](recordings[_0x332356[_0xbd31('0x6')]]);_0x5a5589[_0xbd31('0x22')]=_0x29fee5[_0xbd31('0x22')];writeDB(_0x5a5589);});delete recordings[_0x332356[_0xbd31('0x6')]];}}catch(_0x48c1e6){utils['error'](util[_0xbd31('0x4')](_0xbd31('0x2b'),_0x332356[_0xbd31('0x6')]),_0x48c1e6);}};exports['newexten']=function(_0x3e3079){try{if(!_[_0xbd31('0x18')](recordings[_0x3e3079[_0xbd31('0x6')]])){utils[_0xbd31('0x10')](util[_0xbd31('0x4')](_0xbd31('0x32'),_0x3e3079['uniqueid']),_0x3e3079);utils[_0xbd31('0x3')](util[_0xbd31('0x4')](_0xbd31('0x33'),_0x3e3079[_0xbd31('0x6')],_0x3e3079[_0xbd31('0x34')],_0x3e3079['appdata']));if(_0x3e3079[_0xbd31('0x34')][_0xbd31('0x35')]()==_0xbd31('0x36')&&_[_0xbd31('0x37')](_0x3e3079['appdata'][_0xbd31('0x35')](),_0xbd31('0x38'))){var _0x3c3d24=_0x3e3079[_0xbd31('0x39')]['split']('=');var _0x4ef973=_0x3c3d24[0x0][_0xbd31('0x3a')](_0x3c3d24[0x0][_0xbd31('0x3b')]('(')+0x1,_0x3c3d24[0x0][_0xbd31('0x3b')](')'));var _0x3cde21=_0x3c3d24[0x1];recordings[_0x3e3079[_0xbd31('0x6')]][_0x4ef973]=_0x3cde21;}}}catch(_0x280a07){utils[_0xbd31('0x1d')](util['format'](_0xbd31('0x32'),_0x3e3079[_0xbd31('0x6')]),_0x280a07);}};exports[_0xbd31('0x3c')]=function(_0x2f0fb6){try{if(!_['isNil'](recordings[_0x2f0fb6['uniqueid']])){utils[_0xbd31('0x10')](util['format'](_0xbd31('0x3d'),_0x2f0fb6['uniqueid']),_0x2f0fb6);utils[_0xbd31('0x3')](util[_0xbd31('0x4')]('[%s][recordings][queuecallerjoin]\x20queue:%s',_0x2f0fb6[_0xbd31('0x6')],_0x2f0fb6[_0xbd31('0x3e')]));recordings[_0x2f0fb6[_0xbd31('0x6')]][_0xbd31('0x3e')]=_0x2f0fb6[_0xbd31('0x3e')];}}catch(_0x5032a6){utils[_0xbd31('0x1d')](util[_0xbd31('0x4')](_0xbd31('0x3d'),_0x2f0fb6[_0xbd31('0x6')]),_0x5032a6);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index b2d3c00..e152a39 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 _0x4eb7=['origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','assign','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransferercontext','origtransfererexten','isNil','transfereechannel','transfertargetchannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetexten','transfertargetlinkedid','error','[%s][transfers][attendedtransfer]','lodash','./utils','info','type','attended','origtransfereruniqueid','CreateVoiceTransferReport','blindtransfer','debug','format','[%s][transfers][blindtransfer]','uniqueid','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','blind','attendedtransfer','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x4eb7,0xbe));var _0x74eb=function(_0x3c8e9a,_0x384306){_0x3c8e9a=_0x3c8e9a-0x0;var _0x2d4c57=_0x4eb7[_0x3c8e9a];return _0x2d4c57;};'use strict';var _=require(_0x74eb('0x0'));var util=require('util');var utils=require(_0x74eb('0x1'));function writeDB(_0x336f9d){utils[_0x74eb('0x2')](util['format']('[%s][transfers][writeDB]\x20type:%s',_0x336f9d[_0x74eb('0x3')]===_0x74eb('0x4')?_0x336f9d[_0x74eb('0x5')]:_0x336f9d['uniqueid'],_0x336f9d[_0x74eb('0x3')]));utils['request'](_0x74eb('0x6'),_0x336f9d);}exports[_0x74eb('0x7')]=function(_0x4d137d){try{utils[_0x74eb('0x8')](util[_0x74eb('0x9')](_0x74eb('0xa'),_0x4d137d[_0x74eb('0xb')]),_0x4d137d);utils[_0x74eb('0x2')](util[_0x74eb('0x9')]('[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x4d137d['uniqueid'],_0x4d137d[_0x74eb('0xc')],_0x4d137d[_0x74eb('0xd')],_0x4d137d[_0x74eb('0xe')],_0x4d137d[_0x74eb('0xf')]));_0x4d137d[_0x74eb('0x3')]=_0x74eb('0x10');writeDB(_0x4d137d);}catch(_0x3986ad){utils['error'](util['format'](_0x74eb('0xa'),_0x4d137d['uniqueid']),_0x3986ad);}};exports[_0x74eb('0x11')]=function(_0x4fc75d){try{utils[_0x74eb('0x8')](util[_0x74eb('0x9')]('[%s][transfers][attendedtransfer]',_0x4fc75d['origtransfereruniqueid']),_0x4fc75d);utils['info'](util[_0x74eb('0x9')](_0x74eb('0x12'),_0x4fc75d[_0x74eb('0x5')],_0x4fc75d[_0x74eb('0x13')],_0x4fc75d[_0x74eb('0x14')],_0x4fc75d[_0x74eb('0x15')],_0x4fc75d[_0x74eb('0x16')]));_0x4fc75d=_[_0x74eb('0x17')](_0x4fc75d,{'transfererchannel':_0x4fc75d[_0x74eb('0x18')],'transferercalleridnum':_0x4fc75d['origtransferercalleridnum'],'transferercalleridname':_0x4fc75d[_0x74eb('0x14')],'transfererconnectedlinenum':_0x4fc75d[_0x74eb('0x19')],'transfererconnectedlinename':_0x4fc75d[_0x74eb('0x1a')],'transfereraccountcode':_0x4fc75d[_0x74eb('0x1b')],'transferercontext':_0x4fc75d[_0x74eb('0x1c')],'transfererexten':_0x4fc75d[_0x74eb('0x1d')],'transfererlinkedid':_0x4fc75d['origtransfererlinkedid'],'context':_0x4fc75d[_0x74eb('0x1e')],'extension':_0x4fc75d[_0x74eb('0x1f')],'type':_0x74eb('0x4')});if(_[_0x74eb('0x20')](_0x4fc75d[_0x74eb('0x21')])){_0x4fc75d=_[_0x74eb('0x17')](_0x4fc75d,{'transfereechannel':_0x4fc75d[_0x74eb('0x22')],'transfereecalleridnum':_0x4fc75d[_0x74eb('0x15')],'transfereecalleridname':_0x4fc75d[_0x74eb('0x16')],'transfereeconnectedlinenum':_0x4fc75d[_0x74eb('0x23')],'transfereeconnectedlinename':_0x4fc75d[_0x74eb('0x24')],'transfereeaccountcode':_0x4fc75d[_0x74eb('0x25')],'transfereecontext':_0x4fc75d['transfertargetcontext'],'transfereeexten':_0x4fc75d[_0x74eb('0x26')],'transfereelinkedid':_0x4fc75d[_0x74eb('0x27')]});}writeDB(_0x4fc75d);}catch(_0x618a99){utils[_0x74eb('0x28')](util[_0x74eb('0x9')](_0x74eb('0x29'),_0x4fc75d[_0x74eb('0x5')]),_0x618a99);}}; \ No newline at end of file +var _0x81bd=['transfertargetcontext','transfertargetexten','transfertargetlinkedid','lodash','util','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid','uniqueid','CreateVoiceTransferReport','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','blind','debug','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','transfertargetcalleridnum','transfertargetcalleridname','assign','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','origtransferercontext','isNil','transfereechannel','transfertargetchannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode'];(function(_0x530597,_0x18fb5a){var _0x5e351b=function(_0x2180d2){while(--_0x2180d2){_0x530597['push'](_0x530597['shift']());}};_0x5e351b(++_0x18fb5a);}(_0x81bd,0x1bf));var _0xd81b=function(_0x10d73b,_0xb2bc5){_0x10d73b=_0x10d73b-0x0;var _0x22f7c2=_0x81bd[_0x10d73b];return _0x22f7c2;};'use strict';var _=require(_0xd81b('0x0'));var util=require(_0xd81b('0x1'));var utils=require(_0xd81b('0x2'));function writeDB(_0x2832e0){utils[_0xd81b('0x3')](util[_0xd81b('0x4')](_0xd81b('0x5'),_0x2832e0[_0xd81b('0x6')]===_0xd81b('0x7')?_0x2832e0[_0xd81b('0x8')]:_0x2832e0[_0xd81b('0x9')],_0x2832e0['type']));utils['request'](_0xd81b('0xa'),_0x2832e0);}exports['blindtransfer']=function(_0x1c7960){try{utils['debug'](util['format'](_0xd81b('0xb'),_0x1c7960['uniqueid']),_0x1c7960);utils['info'](util[_0xd81b('0x4')](_0xd81b('0xc'),_0x1c7960['uniqueid'],_0x1c7960[_0xd81b('0xd')],_0x1c7960['transferercalleridname'],_0x1c7960['transfereecalleridnum'],_0x1c7960['transfereecalleridname']));_0x1c7960['type']=_0xd81b('0xe');writeDB(_0x1c7960);}catch(_0x5b0865){utils['error'](util[_0xd81b('0x4')](_0xd81b('0xb'),_0x1c7960['uniqueid']),_0x5b0865);}};exports['attendedtransfer']=function(_0x583dd4){try{utils[_0xd81b('0xf')](util[_0xd81b('0x4')](_0xd81b('0x10'),_0x583dd4[_0xd81b('0x8')]),_0x583dd4);utils[_0xd81b('0x3')](util[_0xd81b('0x4')](_0xd81b('0x11'),_0x583dd4[_0xd81b('0x8')],_0x583dd4[_0xd81b('0x12')],_0x583dd4['origtransferercalleridname'],_0x583dd4[_0xd81b('0x13')],_0x583dd4[_0xd81b('0x14')]));_0x583dd4=_[_0xd81b('0x15')](_0x583dd4,{'transfererchannel':_0x583dd4['origtransfererchannel'],'transferercalleridnum':_0x583dd4['origtransferercalleridnum'],'transferercalleridname':_0x583dd4[_0xd81b('0x16')],'transfererconnectedlinenum':_0x583dd4[_0xd81b('0x17')],'transfererconnectedlinename':_0x583dd4[_0xd81b('0x18')],'transfereraccountcode':_0x583dd4[_0xd81b('0x19')],'transferercontext':_0x583dd4[_0xd81b('0x1a')],'transfererexten':_0x583dd4['secondtransfererexten'],'transfererlinkedid':_0x583dd4['origtransfererlinkedid'],'context':_0x583dd4[_0xd81b('0x1b')],'extension':_0x583dd4['origtransfererexten'],'type':_0xd81b('0x7')});if(_[_0xd81b('0x1c')](_0x583dd4[_0xd81b('0x1d')])){_0x583dd4=_[_0xd81b('0x15')](_0x583dd4,{'transfereechannel':_0x583dd4[_0xd81b('0x1e')],'transfereecalleridnum':_0x583dd4[_0xd81b('0x13')],'transfereecalleridname':_0x583dd4[_0xd81b('0x14')],'transfereeconnectedlinenum':_0x583dd4[_0xd81b('0x1f')],'transfereeconnectedlinename':_0x583dd4[_0xd81b('0x20')],'transfereeaccountcode':_0x583dd4[_0xd81b('0x21')],'transfereecontext':_0x583dd4[_0xd81b('0x22')],'transfereeexten':_0x583dd4[_0xd81b('0x23')],'transfereelinkedid':_0x583dd4[_0xd81b('0x24')]});}writeDB(_0x583dd4);}catch(_0x204424){utils['error'](util['format'](_0xd81b('0x10'),_0x583dd4[_0xd81b('0x8')]),_0x204424);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 1cdf936..19c996b 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 _0x3bf9=['sumTime','now','isAfter','isBefore','jayson/promise','moment','util','http','../../config/logger','xdr','info','inspect','error','request','[utils][request]\x20name:%s','internal','name','interface','debug','[utils][getUser]\x20where:%s','stringify','result','length','then','found','notfound','catch','[utils][getUserByInternal]','getUserByInterface','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','addTime','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x128b10,_0x2d36ba){var _0x20771b=function(_0x57de09){while(--_0x57de09){_0x128b10['push'](_0x128b10['shift']());}};_0x20771b(++_0x2d36ba);}(_0x3bf9,0x8b));var _0x93bf=function(_0x409353,_0xe9f04d){_0x409353=_0x409353-0x0;var _0x4f4b59=_0x3bf9[_0x409353];return _0x4f4b59;};'use strict';var BPromise=require('bluebird');var jayson=require(_0x93bf('0x0'));var moment=require(_0x93bf('0x1'));var util=require(_0x93bf('0x2'));var client=jayson['client'][_0x93bf('0x3')]({'port':0x2329});var logger=require(_0x93bf('0x4'))(_0x93bf('0x5'));exports[_0x93bf('0x6')]=function(_0x15287b,_0x3d2253){logger[_0x93bf('0x6')](_0x15287b,_0x3d2253?util['inspect'](_0x3d2253,{'showHidden':![],'depth':null}):'');};exports['debug']=function(_0x31d618,_0x5cb814){logger['debug'](_0x31d618,_0x5cb814?util[_0x93bf('0x7')](_0x5cb814,{'showHidden':![],'depth':null}):'');};exports[_0x93bf('0x8')]=function(_0x1b65ed,_0x101263){logger[_0x93bf('0x8')](_0x1b65ed,_0x101263?util[_0x93bf('0x7')](_0x101263,{'showHidden':![],'depth':null}):'');};exports['request']=function(_0x59c505,_0x53e267){return client[_0x93bf('0x9')](_0x59c505,{'body':_0x53e267})['then'](function(_0x31315a){logger['debug'](_0x93bf('0xa'),_0x59c505,_0x31315a?util[_0x93bf('0x7')](_0x31315a,{'showHidden':![],'depth':null}):'');})['catch'](function(_0x549981){logger[_0x93bf('0x8')](_0x93bf('0xa'),_0x59c505,_0x549981?util[_0x93bf('0x7')](_0x549981,{'showHidden':![],'depth':null}):'');});};function getUser(_0x591bf4){return client[_0x93bf('0x9')]('GetUser',{'options':{'raw':!![],'attributes':['id',_0x93bf('0xb'),_0x93bf('0xc'),_0x93bf('0xd')],'where':_0x591bf4,'limit':0x1}})['then'](function(_0x1abfa5){logger[_0x93bf('0xe')](_0x93bf('0xf'),JSON[_0x93bf('0x10')](_0x591bf4),_0x1abfa5?util[_0x93bf('0x7')](_0x1abfa5,{'showHidden':![],'depth':null}):'');return _0x1abfa5[_0x93bf('0x11')][_0x93bf('0x12')]?_0x1abfa5['result'][0x0]:null;});}exports['getUserByInternal']=function(_0x31ef63){return new BPromise(function(_0x59f704,_0x3a9c6b){if(_0x31ef63){return getUser({'internal':_0x31ef63})[_0x93bf('0x13')](function(_0xa5a8b0){logger[_0x93bf('0x6')]('[utils][getUserByInternal]\x20internal:%s\x20%s',_0x31ef63,_0xa5a8b0?_0x93bf('0x14'):_0x93bf('0x15'));return _0x59f704(_0xa5a8b0);})[_0x93bf('0x16')](function(_0x4a1809){logger[_0x93bf('0x8')](_0x93bf('0x17'),_0x4a1809?util['inspect'](_0x4a1809,{'showHidden':![],'depth':null}):'');return _0x59f704(null);});}return _0x59f704(null);});};exports[_0x93bf('0x18')]=function(_0x4cbd55){return new BPromise(function(_0x1f1b06,_0x15ea84){if(_0x4cbd55){return getUser({'interface':_0x4cbd55})[_0x93bf('0x13')](function(_0x2de7d4){logger['info']('[utils][getUserByInterface]\x20interface:%s\x20%s',_0x4cbd55,_0x2de7d4?_0x93bf('0x14'):_0x93bf('0x15'));return _0x1f1b06(_0x2de7d4);})[_0x93bf('0x16')](function(_0x721bef){logger[_0x93bf('0x8')]('[utils][getUserByInterface]',_0x721bef?util['inspect'](_0x721bef,{'showHidden':![],'depth':null}):'');return _0x1f1b06(null);});}return _0x1f1b06(null);});};exports[_0x93bf('0x19')]=function(_0x5ea86a){return new BPromise(function(_0x487043,_0x1235cd){if(_0x5ea86a){return getUser({'name':_0x5ea86a})['then'](function(_0x4b357f){logger[_0x93bf('0x6')](_0x93bf('0x1a'),_0x5ea86a,_0x4b357f?_0x93bf('0x14'):_0x93bf('0x15'));return _0x487043(_0x4b357f);})[_0x93bf('0x16')](function(_0x2b3487){logger[_0x93bf('0x8')](_0x93bf('0x1b'),_0x2b3487?util['inspect'](_0x2b3487,{'showHidden':![],'depth':null}):'');return _0x487043(null);});}return _0x487043(null);});};exports[_0x93bf('0x1c')]=function(_0x892e49){return new BPromise(function(_0x34d1fd,_0x43a193){if(_0x892e49){return client[_0x93bf('0x9')](_0x93bf('0x1d'),{'options':{'raw':!![],'attributes':['id','name',_0x93bf('0x1e'),_0x93bf('0x1f'),_0x93bf('0x20')],'where':{'name':_0x892e49},'limit':0x1}})[_0x93bf('0x13')](function(_0x1dafac){logger[_0x93bf('0xe')](_0x93bf('0x21'),_0x892e49,_0x1dafac?util[_0x93bf('0x7')](_0x1dafac,{'showHidden':![],'depth':null}):'');logger[_0x93bf('0x6')](_0x93bf('0x22'),_0x892e49,_0x1dafac?'found':_0x93bf('0x15'));return _0x34d1fd(_0x1dafac[_0x93bf('0x11')][_0x93bf('0x12')]?_0x1dafac[_0x93bf('0x11')][0x0]:null);})['catch'](function(_0x4f2339){logger['error'](_0x93bf('0x23'),_0x4f2339?util[_0x93bf('0x7')](_0x4f2339,{'showHidden':![],'depth':null}):'');return _0x34d1fd(null);});}return _0x34d1fd(null);});};exports[_0x93bf('0x24')]=function(_0x36564a,_0xc1629a){return moment(_0x36564a)[_0x93bf('0x25')](_0xc1629a,_0x93bf('0x26'))[_0x93bf('0x27')](_0x93bf('0x28'));};exports['subtractTime']=function(_0x6d5e36,_0x3fcb89){return moment(_0x6d5e36)['subtract'](_0x3fcb89,'seconds')[_0x93bf('0x27')](_0x93bf('0x28'));};exports['diffTime']=function(_0x3d084d,_0x400031){return moment(_0x3d084d)['diff'](moment(_0x400031),_0x93bf('0x26'));};exports[_0x93bf('0x29')]=function(_0x543c36,_0x410a28){return parseInt(_0x543c36,0xa)+parseInt(_0x410a28,0xa);};exports[_0x93bf('0x2a')]=function(){return moment()[_0x93bf('0x27')](_0x93bf('0x28'));};exports[_0x93bf('0x2b')]=function(_0x4c47be,_0x1a42a2){if(_0x1a42a2){return moment(_0x4c47be)['isAfter'](_0x1a42a2);}return!![];};exports[_0x93bf('0x2c')]=function(_0x3ce724,_0x198160){if(_0x198160){return moment(_0x3ce724)[_0x93bf('0x2c')](_0x198160);}else if(_0x3ce724){return!![];}return![];}; \ No newline at end of file +var _0xd553=['[utils][request]\x20name:%s','GetUser','name','interface','stringify','length','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','catch','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','getVoiceQueueByName','GetVoiceQueue','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','result','add','seconds','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','format','diff','now','isAfter','jayson/promise','moment','client','http','info','inspect','debug','error','request','then'];(function(_0x2056b2,_0x2dbfed){var _0x3e1bc2=function(_0x48a18e){while(--_0x48a18e){_0x2056b2['push'](_0x2056b2['shift']());}};_0x3e1bc2(++_0x2dbfed);}(_0xd553,0xc8));var _0x3d55=function(_0x1af98d,_0x3c608e){_0x1af98d=_0x1af98d-0x0;var _0x3553ea=_0xd553[_0x1af98d];return _0x3553ea;};'use strict';var BPromise=require('bluebird');var jayson=require(_0x3d55('0x0'));var moment=require(_0x3d55('0x1'));var util=require('util');var client=jayson[_0x3d55('0x2')][_0x3d55('0x3')]({'port':0x2329});var logger=require('../../config/logger')('xdr');exports[_0x3d55('0x4')]=function(_0x1c8aa5,_0x1c2f1e){logger[_0x3d55('0x4')](_0x1c8aa5,_0x1c2f1e?util[_0x3d55('0x5')](_0x1c2f1e,{'showHidden':![],'depth':null}):'');};exports['debug']=function(_0x56d4fb,_0x34d5df){logger[_0x3d55('0x6')](_0x56d4fb,_0x34d5df?util[_0x3d55('0x5')](_0x34d5df,{'showHidden':![],'depth':null}):'');};exports[_0x3d55('0x7')]=function(_0x34e190,_0x4d1aba){logger[_0x3d55('0x7')](_0x34e190,_0x4d1aba?util[_0x3d55('0x5')](_0x4d1aba,{'showHidden':![],'depth':null}):'');};exports[_0x3d55('0x8')]=function(_0x42e2ce,_0x212208){return client[_0x3d55('0x8')](_0x42e2ce,{'body':_0x212208})[_0x3d55('0x9')](function(_0x286924){logger['debug'](_0x3d55('0xa'),_0x42e2ce,_0x286924?util[_0x3d55('0x5')](_0x286924,{'showHidden':![],'depth':null}):'');})['catch'](function(_0x55e119){logger[_0x3d55('0x7')](_0x3d55('0xa'),_0x42e2ce,_0x55e119?util[_0x3d55('0x5')](_0x55e119,{'showHidden':![],'depth':null}):'');});};function getUser(_0x12d8bc){return client['request'](_0x3d55('0xb'),{'options':{'raw':!![],'attributes':['id','internal',_0x3d55('0xc'),_0x3d55('0xd')],'where':_0x12d8bc,'limit':0x1}})['then'](function(_0x5341aa){logger['debug']('[utils][getUser]\x20where:%s',JSON[_0x3d55('0xe')](_0x12d8bc),_0x5341aa?util[_0x3d55('0x5')](_0x5341aa,{'showHidden':![],'depth':null}):'');return _0x5341aa['result'][_0x3d55('0xf')]?_0x5341aa['result'][0x0]:null;});}exports['getUserByInternal']=function(_0x290c21){return new BPromise(function(_0x1c829e,_0x320f1b){if(_0x290c21){return getUser({'internal':_0x290c21})[_0x3d55('0x9')](function(_0x3e8748){logger['info'](_0x3d55('0x10'),_0x290c21,_0x3e8748?_0x3d55('0x11'):_0x3d55('0x12'));return _0x1c829e(_0x3e8748);})[_0x3d55('0x13')](function(_0x150ee4){logger['error'](_0x3d55('0x14'),_0x150ee4?util[_0x3d55('0x5')](_0x150ee4,{'showHidden':![],'depth':null}):'');return _0x1c829e(null);});}return _0x1c829e(null);});};exports[_0x3d55('0x15')]=function(_0x4eeb5b){return new BPromise(function(_0x435a0d,_0x5adb37){if(_0x4eeb5b){return getUser({'interface':_0x4eeb5b})[_0x3d55('0x9')](function(_0x539c8b){logger['info'](_0x3d55('0x16'),_0x4eeb5b,_0x539c8b?_0x3d55('0x11'):_0x3d55('0x12'));return _0x435a0d(_0x539c8b);})['catch'](function(_0x2d096f){logger[_0x3d55('0x7')]('[utils][getUserByInterface]',_0x2d096f?util[_0x3d55('0x5')](_0x2d096f,{'showHidden':![],'depth':null}):'');return _0x435a0d(null);});}return _0x435a0d(null);});};exports[_0x3d55('0x17')]=function(_0x54296b){return new BPromise(function(_0x194683,_0x36edb8){if(_0x54296b){return getUser({'name':_0x54296b})[_0x3d55('0x9')](function(_0x151322){logger[_0x3d55('0x4')](_0x3d55('0x18'),_0x54296b,_0x151322?_0x3d55('0x11'):_0x3d55('0x12'));return _0x194683(_0x151322);})[_0x3d55('0x13')](function(_0x366f02){logger['error']('[utils][getUserByName]',_0x366f02?util[_0x3d55('0x5')](_0x366f02,{'showHidden':![],'depth':null}):'');return _0x194683(null);});}return _0x194683(null);});};exports[_0x3d55('0x19')]=function(_0x12331c){return new BPromise(function(_0x54f1cd,_0x2eefb3){if(_0x12331c){return client[_0x3d55('0x8')](_0x3d55('0x1a'),{'options':{'raw':!![],'attributes':['id',_0x3d55('0xc'),_0x3d55('0x1b'),_0x3d55('0x1c'),_0x3d55('0x1d')],'where':{'name':_0x12331c},'limit':0x1}})[_0x3d55('0x9')](function(_0x583bd5){logger[_0x3d55('0x6')](_0x3d55('0x1e'),_0x12331c,_0x583bd5?util[_0x3d55('0x5')](_0x583bd5,{'showHidden':![],'depth':null}):'');logger[_0x3d55('0x4')](_0x3d55('0x1f'),_0x12331c,_0x583bd5?_0x3d55('0x11'):_0x3d55('0x12'));return _0x54f1cd(_0x583bd5[_0x3d55('0x20')]['length']?_0x583bd5[_0x3d55('0x20')][0x0]:null);})[_0x3d55('0x13')](function(_0x52b8cc){logger[_0x3d55('0x7')]('[utils][getVoiceQueueByName]',_0x52b8cc?util[_0x3d55('0x5')](_0x52b8cc,{'showHidden':![],'depth':null}):'');return _0x54f1cd(null);});}return _0x54f1cd(null);});};exports['addTime']=function(_0x566bea,_0x35f00f){return moment(_0x566bea)[_0x3d55('0x21')](_0x35f00f,_0x3d55('0x22'))['format'](_0x3d55('0x23'));};exports[_0x3d55('0x24')]=function(_0x440fc6,_0x551caf){return moment(_0x440fc6)[_0x3d55('0x25')](_0x551caf,'seconds')[_0x3d55('0x26')]('YYYY-MM-DD\x20HH:mm:ss');};exports['diffTime']=function(_0x2ddf00,_0x403d63){return moment(_0x2ddf00)[_0x3d55('0x27')](moment(_0x403d63),_0x3d55('0x22'));};exports['sumTime']=function(_0x38067e,_0x92fd8c){return parseInt(_0x38067e,0xa)+parseInt(_0x92fd8c,0xa);};exports[_0x3d55('0x28')]=function(){return moment()[_0x3d55('0x26')](_0x3d55('0x23'));};exports[_0x3d55('0x29')]=function(_0x15cf8f,_0xbd8daa){if(_0xbd8daa){return moment(_0x15cf8f)[_0x3d55('0x29')](_0xbd8daa);}return!![];};exports['isBefore']=function(_0x1bce67,_0x461698){if(_0x461698){return moment(_0x1bce67)['isBefore'](_0x461698);}else if(_0x1bce67){return!![];}return![];}; \ No newline at end of file diff --git a/server/utils/client-side-logger.js b/server/utils/client-side-logger.js index 74d17af..910e557 100644 --- a/server/utils/client-side-logger.js +++ b/server/utils/client-side-logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6fb4=['safeTemplate','./mask-sensitive-data','maskSensitiveData','join','log','xcally','client','role','ensureDir','then','catch','user','no-user','data','api','set','use','logger','body','format','method','headers','x-forwarded-for','connection','remoteAddress','url','statusCode','name','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','responseTime','other','agent_name','test','setupLoggers','lodash','path','util','fileLogger','./safe-template'];(function(_0x35dcb3,_0x468f08){var _0xd36d40=function(_0x2fb354){while(--_0x2fb354){_0x35dcb3['push'](_0x35dcb3['shift']());}};_0xd36d40(++_0x468f08);}(_0x6fb4,0x1c9));var _0x46fb=function(_0x4e43ef,_0x562956){_0x4e43ef=_0x4e43ef-0x0;var _0x540dd8=_0x6fb4[_0x4e43ef];return _0x540dd8;};var fs=require('fs-extra');var _=require(_0x46fb('0x0'));var ewinston=require('express-winston');var path=require(_0x46fb('0x1'));var util=require(_0x46fb('0x2'));var fileLogger=require('./loggers')[_0x46fb('0x3')];var safeTemplate=require(_0x46fb('0x4'))[_0x46fb('0x5')];var maskSensitiveData=require(_0x46fb('0x6'))[_0x46fb('0x7')];function ClientSideLogger(){function _0x3cd33c(_0x487103){var _0x4bd710=path[_0x46fb('0x8')]('/var',_0x46fb('0x9'),_0x46fb('0xa'));var _0x366caa=path['join'](_0x46fb('0xb'),_0x487103[_0x46fb('0xc')]+'-'+_0x487103['name']);return fs[_0x46fb('0xd')](path[_0x46fb('0x8')](_0x4bd710,_0x366caa))[_0x46fb('0xe')](function(){var _0x5e028b=fileLogger(_0x46fb('0xb'),path[_0x46fb('0x8')](_0x4bd710,_0x366caa));return _0x5e028b;})[_0x46fb('0xf')](function(_0x4121da){throw _0x4121da;});}this[_0x46fb('0x9')]=function(_0x15a42a,_0x1b32c6,_0x56e99b,_0x68051f){return _0x3cd33c(_0x15a42a[_0x46fb('0x10')])[_0x46fb('0xe')](function(_0x15dd4c){var _0x3a5e23=_0x15dd4c[_0x1b32c6];return _0x3a5e23;})[_0x46fb('0xe')](function(_0x32e7b4){var _0x2e67fb=_0x15a42a[_0x46fb('0x10')]?_0x15a42a['user']['id']:_0x46fb('0x11');var _0x4cf44d=_0x68051f[_0x46fb('0x12')];var _0x35b91d=_0x68051f['timestamp'];var _0x1e629d=new Date(Number(_0x35b91d));return _0x32e7b4(_0x2e67fb,_0x1e629d,_0x56e99b,_0x4cf44d);})['catch'](function(_0x543aee){fileLogger(_0x46fb('0xb'))['error'](_0x543aee);});};}function setupLoggers(_0x1bef4b){return new Promise(function(_0x475c09){var _0xac6fc6=new ClientSideLogger();var _0x59d5c4=fileLogger(_0x46fb('0x13'));var _0xb167b7=fileLogger('auth');_0x1bef4b[_0x46fb('0x14')]('client-side-logger',_0xac6fc6);_0x1bef4b[_0x46fb('0x15')](ewinston[_0x46fb('0x16')]({'winstonInstance':_0x59d5c4,'meta':![],'statusLevels':!![],'msg':function(_0x297d8c,_0xc30247){var _0x130392='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s';if(!_['isEmpty'](_0x297d8c['body'])){_0x130392+='\x20body=%s';var _0x1fa73e=_0x297d8c[_0x46fb('0x17')];maskSensitiveData(_0x1fa73e);}return safeTemplate(util[_0x46fb('0x18')](_0x130392,_0x297d8c[_0x46fb('0x19')],_0x297d8c[_0x46fb('0x1a')][_0x46fb('0x1b')]?_0x297d8c[_0x46fb('0x1a')]['x-forwarded-for']:_0x297d8c[_0x46fb('0x1c')][_0x46fb('0x1d')]||_0x297d8c['ip'],_0x297d8c[_0x46fb('0x1e')],_0xc30247[_0x46fb('0x1f')],_0xc30247['responseTime'],_0x297d8c[_0x46fb('0x10')]?_0x297d8c[_0x46fb('0x10')]['id']:null,_0x297d8c[_0x46fb('0x10')]?_0x297d8c[_0x46fb('0x10')][_0x46fb('0x20')]:null,_0x297d8c[_0x46fb('0x10')]?_0x297d8c[_0x46fb('0x10')][_0x46fb('0xc')]:null,_0x1fa73e?util['inspect'](_0x1fa73e,![],null):''));}}));_0x1bef4b['use'](ewinston[_0x46fb('0x16')]({'winstonInstance':_0xb167b7,'meta':![],'statusLevels':!![],'msg':function(_0x2185d3,_0x19338f){var _0x1454b8=_0x46fb('0x21');if(_0x2185d3[_0x46fb('0x17')]&&_0x2185d3[_0x46fb('0x17')][_0x46fb('0x22')]&&_0x2185d3[_0x46fb('0x17')][_0x46fb('0x23')]){_0x1454b8=_0x46fb('0x24');}return util[_0x46fb('0x18')](_0x1454b8,_0x2185d3['method'],_0x2185d3[_0x46fb('0x1a')][_0x46fb('0x1b')]?_0x2185d3[_0x46fb('0x1a')][_0x46fb('0x1b')]:_0x2185d3[_0x46fb('0x1c')][_0x46fb('0x1d')]||_0x2185d3['ip'],_0x2185d3[_0x46fb('0x1e')],_0x19338f[_0x46fb('0x1f')],_0x19338f[_0x46fb('0x25')],_0x2185d3[_0x46fb('0x10')]?_0x2185d3[_0x46fb('0x10')]['id']:null,_0x2185d3[_0x46fb('0x10')]?_0x2185d3[_0x46fb('0x10')][_0x46fb('0x20')]:null,_0x2185d3['user']?_0x2185d3[_0x46fb('0x10')][_0x46fb('0xc')]:null,_0x2185d3[_0x46fb('0x17')]&&_0x2185d3['body']['device']?_0x2185d3[_0x46fb('0x17')][_0x46fb('0x22')]:_0x46fb('0x26'),_0x2185d3[_0x46fb('0x17')]&&_0x2185d3[_0x46fb('0x17')][_0x46fb('0x23')]?_0x2185d3[_0x46fb('0x17')][_0x46fb('0x23')]:'',_0x2185d3['body']&&_0x2185d3['body'][_0x46fb('0x27')]?_0x2185d3[_0x46fb('0x17')][_0x46fb('0x27')]:'');},'ignoreRoute':function(_0x38618f){var _0x3fac38=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x3fac38[_0x46fb('0x28')](_0x38618f[_0x46fb('0x1e')]);}}));return _0x475c09();});}exports[_0x46fb('0x29')]=setupLoggers; \ No newline at end of file +var _0x03b7=['statusCode','responseTime','role','inspect','use','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','other','agent_name','setupLoggers','fs-extra','lodash','path','util','./loggers','fileLogger','./safe-template','safeTemplate','./mask-sensitive-data','join','/var','xcally','name','ensureDir','then','client','catch','log','user','data','timestamp','error','api','auth','set','client-side-logger','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','body','\x20body=%s','format','method','headers','x-forwarded-for','remoteAddress','url'];(function(_0x584026,_0x169166){var _0x113901=function(_0x1d6240){while(--_0x1d6240){_0x584026['push'](_0x584026['shift']());}};_0x113901(++_0x169166);}(_0x03b7,0x98));var _0x703b=function(_0xe132e3,_0xc413b7){_0xe132e3=_0xe132e3-0x0;var _0x4234e5=_0x03b7[_0xe132e3];return _0x4234e5;};var fs=require(_0x703b('0x0'));var _=require(_0x703b('0x1'));var ewinston=require('express-winston');var path=require(_0x703b('0x2'));var util=require(_0x703b('0x3'));var fileLogger=require(_0x703b('0x4'))[_0x703b('0x5')];var safeTemplate=require(_0x703b('0x6'))[_0x703b('0x7')];var maskSensitiveData=require(_0x703b('0x8'))['maskSensitiveData'];function ClientSideLogger(){function _0x3a2854(_0x561b55){var _0x3fdda3=path[_0x703b('0x9')](_0x703b('0xa'),'log',_0x703b('0xb'));var _0x5dd2fa=path['join']('client',_0x561b55['role']+'-'+_0x561b55[_0x703b('0xc')]);return fs[_0x703b('0xd')](path[_0x703b('0x9')](_0x3fdda3,_0x5dd2fa))[_0x703b('0xe')](function(){var _0x226211=fileLogger(_0x703b('0xf'),path[_0x703b('0x9')](_0x3fdda3,_0x5dd2fa));return _0x226211;})[_0x703b('0x10')](function(_0x1d7ae7){throw _0x1d7ae7;});}this[_0x703b('0x11')]=function(_0xec8807,_0x11c004,_0x1e619b,_0x246975){return _0x3a2854(_0xec8807[_0x703b('0x12')])[_0x703b('0xe')](function(_0x43e8f7){var _0x44d1c1=_0x43e8f7[_0x11c004];return _0x44d1c1;})[_0x703b('0xe')](function(_0x47c5c9){var _0x3337f6=_0xec8807[_0x703b('0x12')]?_0xec8807[_0x703b('0x12')]['id']:'no-user';var _0x473ea3=_0x246975[_0x703b('0x13')];var _0x22b1fd=_0x246975[_0x703b('0x14')];var _0x218010=new Date(Number(_0x22b1fd));return _0x47c5c9(_0x3337f6,_0x218010,_0x1e619b,_0x473ea3);})[_0x703b('0x10')](function(_0x1fba39){fileLogger(_0x703b('0xf'))[_0x703b('0x15')](_0x1fba39);});};}function setupLoggers(_0x4d86ab){return new Promise(function(_0x362ea2){var _0x4d55cc=new ClientSideLogger();var _0x54577d=fileLogger(_0x703b('0x16'));var _0x584a1f=fileLogger(_0x703b('0x17'));_0x4d86ab[_0x703b('0x18')](_0x703b('0x19'),_0x4d55cc);_0x4d86ab['use'](ewinston[_0x703b('0x1a')]({'winstonInstance':_0x54577d,'meta':![],'statusLevels':!![],'msg':function(_0x23a5e0,_0x1e861c){var _0x36c955=_0x703b('0x1b');if(!_['isEmpty'](_0x23a5e0[_0x703b('0x1c')])){_0x36c955+=_0x703b('0x1d');var _0x75a62=_0x23a5e0[_0x703b('0x1c')];maskSensitiveData(_0x75a62);}return safeTemplate(util[_0x703b('0x1e')](_0x36c955,_0x23a5e0[_0x703b('0x1f')],_0x23a5e0[_0x703b('0x20')][_0x703b('0x21')]?_0x23a5e0['headers'][_0x703b('0x21')]:_0x23a5e0['connection'][_0x703b('0x22')]||_0x23a5e0['ip'],_0x23a5e0[_0x703b('0x23')],_0x1e861c[_0x703b('0x24')],_0x1e861c[_0x703b('0x25')],_0x23a5e0['user']?_0x23a5e0[_0x703b('0x12')]['id']:null,_0x23a5e0[_0x703b('0x12')]?_0x23a5e0['user'][_0x703b('0xc')]:null,_0x23a5e0[_0x703b('0x12')]?_0x23a5e0[_0x703b('0x12')][_0x703b('0x26')]:null,_0x75a62?util[_0x703b('0x27')](_0x75a62,![],null):''));}}));_0x4d86ab[_0x703b('0x28')](ewinston[_0x703b('0x1a')]({'winstonInstance':_0x584a1f,'meta':![],'statusLevels':!![],'msg':function(_0x3c8a1c,_0x5953ad){var _0x385774='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0x3c8a1c['body']&&_0x3c8a1c[_0x703b('0x1c')][_0x703b('0x29')]&&_0x3c8a1c[_0x703b('0x1c')][_0x703b('0x2a')]){_0x385774=_0x703b('0x2b');}return util[_0x703b('0x1e')](_0x385774,_0x3c8a1c[_0x703b('0x1f')],_0x3c8a1c['headers']['x-forwarded-for']?_0x3c8a1c[_0x703b('0x20')]['x-forwarded-for']:_0x3c8a1c['connection'][_0x703b('0x22')]||_0x3c8a1c['ip'],_0x3c8a1c['url'],_0x5953ad[_0x703b('0x24')],_0x5953ad['responseTime'],_0x3c8a1c[_0x703b('0x12')]?_0x3c8a1c['user']['id']:null,_0x3c8a1c[_0x703b('0x12')]?_0x3c8a1c[_0x703b('0x12')][_0x703b('0xc')]:null,_0x3c8a1c['user']?_0x3c8a1c[_0x703b('0x12')][_0x703b('0x26')]:null,_0x3c8a1c['body']&&_0x3c8a1c['body'][_0x703b('0x29')]?_0x3c8a1c[_0x703b('0x1c')][_0x703b('0x29')]:_0x703b('0x2c'),_0x3c8a1c[_0x703b('0x1c')]&&_0x3c8a1c[_0x703b('0x1c')][_0x703b('0x2a')]?_0x3c8a1c[_0x703b('0x1c')][_0x703b('0x2a')]:'',_0x3c8a1c['body']&&_0x3c8a1c['body'][_0x703b('0x2d')]?_0x3c8a1c['body']['agent_name']:'');},'ignoreRoute':function(_0x488375){var _0x4a0980=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x4a0980['test'](_0x488375['url']);}}));return _0x362ea2();});}exports[_0x703b('0x2e')]=setupLoggers; \ No newline at end of file diff --git a/server/utils/iftime.js b/server/utils/iftime.js index e1f1499..edf9e3d 100644 --- a/server/utils/iftime.js +++ b/server/utils/iftime.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3709=['Interval\x20string\x20not\x20valid','isValid','split','locale','weekdaysShort','toLowerCase','indexOf','slice','concat','circularDoWInterval','exports','clone','minutes','hours','isBefore','startOf','day','isBetween','timeCompare','format','ddd','includes','date','daysInMonth','max','min','MMM','monthCompare','guess','test','padStart','length','iftime','lodash','moment-timezone','map','source','join'];(function(_0x42d2f9,_0x4e22f1){var _0x1cff15=function(_0x11348a){while(--_0x11348a){_0x42d2f9['push'](_0x42d2f9['shift']());}};_0x1cff15(++_0x4e22f1);}(_0x3709,0xb9));var _0x9370=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0x3709[_0x5447fd];return _0x15b28a;};var _=require(_0x9370('0x0'));var moment=require(_0x9370('0x1'));var timeRx=/(\*|(\d{1,2}:\d{1,2})(-(\d{1,2}:\d{1,2}))?)/;var dowRx=/(\*|((sun|mon|tue|wed|thu|fri|sat)(-(sun|mon|tue|wed|thu|fri|sat))?))/;var domRx=/(\*|(\d{1,2})(-(\d{1,2}))?)/;var moyRx=/(\*|(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)(-(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec))?)/;var globalRx=[timeRx,dowRx,domRx,moyRx][_0x9370('0x2')](function(_0x4e8773){return _0x4e8773[_0x9370('0x3')];})[_0x9370('0x4')](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING=_0x9370('0x5');var EINVALID_DATE='Date\x20not\x20valid';function throwIfDateNotValid(_0x4d0bb3){if(!_0x4d0bb3[_0x9370('0x6')]()){throw new Error(EINVALID_DATE);}}function extractTime(_0x15913c){var _0x478669=_0x15913c[_0x9370('0x7')](':')['map'](function(_0x3dc816){return parseInt(_0x3dc816,0xa);});var _0xb6aab2=_0x478669[0x0];var _0x32ef06=_0x478669[0x1];if(_0xb6aab2<0x0||_0xb6aab2>0x17||_0x32ef06<0x0||_0x32ef06>0x3b){throw new Error(EINVALID_DATE);}return[_0xb6aab2,_0x32ef06];}function circularDoWInterval(_0x4ed0a9,_0x3eb909){if(_0x4ed0a9===_0x3eb909){return[_0x4ed0a9];}else{var _0x4d4a51=moment[_0x9370('0x8')]();moment[_0x9370('0x8')]('en');var _0x546f2b=moment[_0x9370('0x9')]()[_0x9370('0x2')](function(_0x65082){return _0x65082[_0x9370('0xa')]();});moment['locale'](_0x4d4a51);var _0x625743=_0x546f2b[_0x9370('0xb')](_0x4ed0a9);var _0x4c6a11=_0x546f2b[_0x9370('0xb')](_0x3eb909);if(_0x4c6a11>_0x625743){return _0x546f2b[_0x9370('0xc')](_0x625743,_0x4c6a11+0x1);}else{var _0x192e15=_0x546f2b[_0x9370('0xc')](0x0,_0x4c6a11+0x1);var _0x108015=_0x546f2b[_0x9370('0xc')](_0x625743);return _0x108015[_0x9370('0xd')](_0x192e15);}}}module['exports'][_0x9370('0xe')]=circularDoWInterval;function circularMonthInterval(_0x513b4a,_0x358461){if(_0x513b4a===_0x358461){return[_0x513b4a];}else{var _0x7b1e76=moment[_0x9370('0x8')]();moment['locale']('en');var _0x4ab709=moment['monthsShort']()['map'](function(_0x24ecde){return _0x24ecde['toLowerCase']();});moment['locale'](_0x7b1e76);var _0x429ae4=_0x4ab709[_0x9370('0xb')](_0x513b4a);var _0x557d9c=_0x4ab709[_0x9370('0xb')](_0x358461);if(_0x557d9c>_0x429ae4){return _0x4ab709['slice'](_0x429ae4,_0x557d9c+0x1);}else{var _0x2fcb6a=_0x4ab709[_0x9370('0xc')](0x0,_0x557d9c+0x1);var _0x81ae44=_0x4ab709[_0x9370('0xc')](_0x429ae4);return _0x81ae44['concat'](_0x2fcb6a);}}}module[_0x9370('0xf')]['circularMonthInterval']=circularMonthInterval;function parseDom(_0x2bb33c){var _0x4d7349=parseInt(_0x2bb33c,0xa);if(_0x4d7349<0x1||_0x4d7349>0x1f){throw new Error(EINVALID_DATE);}return _0x4d7349;}function timeCompare(_0x395f9e,_0x3e6843,_0x160b3d){var _0x6d4a53=_0x395f9e[_0x9370('0x10')]();var _0x5a11df=extractTime(_0x3e6843);var _0x12b5ea=_0x5a11df[0x0];var _0x2e627c=_0x5a11df[0x1];var _0x19da7b=_0x395f9e['clone']()['hours'](_0x12b5ea)[_0x9370('0x11')](_0x2e627c);throwIfDateNotValid(_0x19da7b);var _0x4daca7=extractTime(_0x160b3d);var _0x235a52=_0x4daca7[0x0];var _0x2d07a9=_0x4daca7[0x1];var _0x1a0de0=_0x395f9e[_0x9370('0x10')]()[_0x9370('0x12')](_0x235a52)['minutes'](_0x2d07a9);throwIfDateNotValid(_0x1a0de0);if(_0x1a0de0[_0x9370('0x13')](_0x19da7b)){var _0x201eee=_0x6d4a53[_0x9370('0x10')]()[_0x9370('0x14')]('day');var _0x4852fb=_0x6d4a53[_0x9370('0x10')]()['endOf'](_0x9370('0x15'));return _0x6d4a53['isBetween'](_0x19da7b,_0x4852fb,undefined,'[]')||_0x6d4a53['isBetween'](_0x201eee,_0x1a0de0,undefined,'[]');}else{return _0x6d4a53[_0x9370('0x16')](_0x19da7b,_0x1a0de0,undefined,'[]');}}module[_0x9370('0xf')][_0x9370('0x17')]=timeCompare;function dowCompare(_0x35c9fb,_0x1bfbe3,_0x38dcb6){var _0x4679a6=_0x35c9fb[_0x9370('0x8')]('en')[_0x9370('0x18')](_0x9370('0x19'))['toLowerCase']();return circularDoWInterval(_0x1bfbe3,_0x38dcb6)[_0x9370('0x1a')](_0x4679a6);}module[_0x9370('0xf')]['dowCompare']=dowCompare;function domCompare(_0x4baaa8,_0x47f946,_0xbb845a){var _0x366c20=_0x4baaa8[_0x9370('0x1b')]();if(_0x47f946===_0xbb845a){return _0x366c20===_0x47f946;}else{var _0x24aef5=_0x4baaa8[_0x9370('0x1c')]();var _0x7585bf=_0x47f946<_0xbb845a;let _0x274695=![];var _0x3896bc=0x0;var _0x2fc211=0x0;if(_0x7585bf){_0x3896bc=Math[_0x9370('0x1d')](0x1,_0x47f946);_0x2fc211=Math[_0x9370('0x1e')](_0xbb845a,_0x24aef5);_0x274695=_0x366c20>=_0x3896bc&&_0x366c20<=_0x2fc211;}else{_0x3896bc=Math[_0x9370('0x1e')](_0x47f946,_0x24aef5);_0x2fc211=Math[_0x9370('0x1d')](0x1,_0xbb845a);_0x274695=_0x366c20>=_0x3896bc||_0x366c20<=_0x2fc211;}return _0x274695;}}module[_0x9370('0xf')]['domCompare']=domCompare;function monthCompare(_0x35ff87,_0x128975,_0x34157b){var _0x5d0989=_0x35ff87[_0x9370('0x8')]('en')['format'](_0x9370('0x1f'))['toLowerCase']();return circularMonthInterval(_0x128975,_0x34157b)[_0x9370('0x1a')](_0x5d0989);}module[_0x9370('0xf')][_0x9370('0x20')]=monthCompare;function iftime(_0x90ba52,_0x3c2ff6=moment['tz'][_0x9370('0x21')](),_0x15cca8=moment()){if(!validateRx[_0x9370('0x22')](_0x90ba52)){throw new Error(EINVALID_STRING);}else{var _0xab7c65=(moment['isMoment'](_0x15cca8)?_0x15cca8[_0x9370('0x10')]():moment(_0x15cca8))['tz'](_0x3c2ff6)[_0x9370('0x8')]('en');throwIfDateNotValid(_0xab7c65);var _0x40c91d=_0x90ba52[_0x9370('0x7')](',');var _0x572c25=_0x40c91d[0x0];var _0x3afff2=_0x40c91d[0x1];var _0x1e1f1b=_0x40c91d[0x2];var _0x7fa40=_0x40c91d[0x3];let _0x37d13b=!![];if(_0x572c25!=='*'){var _0x1cb26c=_0x572c25['split']('-');var _0x118d01=_[_0x9370('0x23')](_0x1cb26c[0x0],0x5,'0');var _0x2ac927=_0x1cb26c[_0x9370('0x24')]===0x2?_[_0x9370('0x23')](_0x1cb26c[0x1],0x5,'0'):_0x118d01;_0x37d13b=timeCompare(_0xab7c65,_0x118d01,_0x2ac927);}let _0x584ac4=!![];if(_0x3afff2!=='*'){var _0x38ba6e=_0x3afff2[_0x9370('0x7')]('-');var _0x593c98=_0x38ba6e[0x0];var _0x198f28=_0x38ba6e[_0x9370('0x24')]===0x2?_0x38ba6e[0x1]:_0x593c98;_0x584ac4=dowCompare(_0xab7c65,_0x593c98,_0x198f28);}let _0x19a0bc=!![];if(_0x1e1f1b!=='*'){var _0x1f8f0c=_0x1e1f1b[_0x9370('0x7')]('-');var _0x56d045=parseDom(_0x1f8f0c[0x0]);var _0x39255e=_0x1f8f0c[_0x9370('0x24')]===0x2?parseDom(_0x1f8f0c[0x1]):_0x56d045;_0x19a0bc=domCompare(_0xab7c65,_0x56d045,_0x39255e);}let _0x104575=!![];if(_0x7fa40!=='*'){var _0x1d53b6=_0x7fa40[_0x9370('0x7')]('-');var _0x107c5b=_0x1d53b6[0x0];var _0x43a1f2=_0x1d53b6[_0x9370('0x24')]===0x2?_0x1d53b6[0x1]:_0x1d53b6[0x0];_0x104575=monthCompare(_0xab7c65,_0x107c5b,_0x43a1f2);}return _0x37d13b&&_0x584ac4&&_0x19a0bc&&_0x104575;}}module[_0x9370('0xf')][_0x9370('0x25')]=iftime; \ No newline at end of file +var _0x746e=['split','locale','weekdaysShort','toLowerCase','indexOf','slice','exports','circularDoWInterval','concat','circularMonthInterval','clone','hours','minutes','day','endOf','isBetween','format','ddd','dowCompare','daysInMonth','max','min','domCompare','MMM','includes','monthCompare','guess','test','isMoment','padStart','length','iftime','map','join','Interval\x20string\x20not\x20valid','Date\x20not\x20valid'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x746e,0xd4));var _0xe746=function(_0x343e44,_0x519af9){_0x343e44=_0x343e44-0x0;var _0xa5130e=_0x746e[_0x343e44];return _0xa5130e;};var _=require('lodash');var moment=require('moment-timezone');var timeRx=/(\*|(\d{1,2}:\d{1,2})(-(\d{1,2}:\d{1,2}))?)/;var dowRx=/(\*|((sun|mon|tue|wed|thu|fri|sat)(-(sun|mon|tue|wed|thu|fri|sat))?))/;var domRx=/(\*|(\d{1,2})(-(\d{1,2}))?)/;var moyRx=/(\*|(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)(-(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec))?)/;var globalRx=[timeRx,dowRx,domRx,moyRx][_0xe746('0x0')](function(_0x2b5e0e){return _0x2b5e0e['source'];})[_0xe746('0x1')](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING=_0xe746('0x2');var EINVALID_DATE=_0xe746('0x3');function throwIfDateNotValid(_0x24dd3f){if(!_0x24dd3f['isValid']()){throw new Error(EINVALID_DATE);}}function extractTime(_0x26cef0){var _0x5d50f9=_0x26cef0[_0xe746('0x4')](':')['map'](function(_0x3b1802){return parseInt(_0x3b1802,0xa);});var _0xbd27d0=_0x5d50f9[0x0];var _0xc49b34=_0x5d50f9[0x1];if(_0xbd27d0<0x0||_0xbd27d0>0x17||_0xc49b34<0x0||_0xc49b34>0x3b){throw new Error(EINVALID_DATE);}return[_0xbd27d0,_0xc49b34];}function circularDoWInterval(_0x1da8f3,_0x4e2609){if(_0x1da8f3===_0x4e2609){return[_0x1da8f3];}else{var _0x4de10e=moment[_0xe746('0x5')]();moment[_0xe746('0x5')]('en');var _0x12402a=moment[_0xe746('0x6')]()[_0xe746('0x0')](function(_0x1987f6){return _0x1987f6[_0xe746('0x7')]();});moment['locale'](_0x4de10e);var _0x373c7e=_0x12402a[_0xe746('0x8')](_0x1da8f3);var _0x3d303e=_0x12402a[_0xe746('0x8')](_0x4e2609);if(_0x3d303e>_0x373c7e){return _0x12402a[_0xe746('0x9')](_0x373c7e,_0x3d303e+0x1);}else{var _0x39329d=_0x12402a[_0xe746('0x9')](0x0,_0x3d303e+0x1);var _0x1644e0=_0x12402a[_0xe746('0x9')](_0x373c7e);return _0x1644e0['concat'](_0x39329d);}}}module[_0xe746('0xa')][_0xe746('0xb')]=circularDoWInterval;function circularMonthInterval(_0x1bde4c,_0x599225){if(_0x1bde4c===_0x599225){return[_0x1bde4c];}else{var _0x3fd154=moment[_0xe746('0x5')]();moment[_0xe746('0x5')]('en');var _0x39b290=moment['monthsShort']()[_0xe746('0x0')](function(_0x143e61){return _0x143e61[_0xe746('0x7')]();});moment[_0xe746('0x5')](_0x3fd154);var _0x20c141=_0x39b290['indexOf'](_0x1bde4c);var _0x4414b3=_0x39b290[_0xe746('0x8')](_0x599225);if(_0x4414b3>_0x20c141){return _0x39b290['slice'](_0x20c141,_0x4414b3+0x1);}else{var _0x3e945c=_0x39b290[_0xe746('0x9')](0x0,_0x4414b3+0x1);var _0x518f80=_0x39b290[_0xe746('0x9')](_0x20c141);return _0x518f80[_0xe746('0xc')](_0x3e945c);}}}module[_0xe746('0xa')][_0xe746('0xd')]=circularMonthInterval;function parseDom(_0x50a800){var _0x2d8ef7=parseInt(_0x50a800,0xa);if(_0x2d8ef7<0x1||_0x2d8ef7>0x1f){throw new Error(EINVALID_DATE);}return _0x2d8ef7;}function timeCompare(_0x25586e,_0x9edce3,_0x345190){var _0x5bb7f7=_0x25586e[_0xe746('0xe')]();var _0x42a4d0=extractTime(_0x9edce3);var _0x4b9f4d=_0x42a4d0[0x0];var _0x1a868e=_0x42a4d0[0x1];var _0x1ea930=_0x25586e[_0xe746('0xe')]()[_0xe746('0xf')](_0x4b9f4d)[_0xe746('0x10')](_0x1a868e);throwIfDateNotValid(_0x1ea930);var _0x34897a=extractTime(_0x345190);var _0x3de6ec=_0x34897a[0x0];var _0x179e4d=_0x34897a[0x1];var _0x3363d5=_0x25586e[_0xe746('0xe')]()[_0xe746('0xf')](_0x3de6ec)[_0xe746('0x10')](_0x179e4d);throwIfDateNotValid(_0x3363d5);if(_0x3363d5['isBefore'](_0x1ea930)){var _0x50ed63=_0x5bb7f7[_0xe746('0xe')]()['startOf'](_0xe746('0x11'));var _0x44b8aa=_0x5bb7f7[_0xe746('0xe')]()[_0xe746('0x12')](_0xe746('0x11'));return _0x5bb7f7[_0xe746('0x13')](_0x1ea930,_0x44b8aa,undefined,'[]')||_0x5bb7f7['isBetween'](_0x50ed63,_0x3363d5,undefined,'[]');}else{return _0x5bb7f7['isBetween'](_0x1ea930,_0x3363d5,undefined,'[]');}}module[_0xe746('0xa')]['timeCompare']=timeCompare;function dowCompare(_0x576174,_0x64b7a0,_0x4c1e89){var _0x1fb133=_0x576174['locale']('en')[_0xe746('0x14')](_0xe746('0x15'))['toLowerCase']();return circularDoWInterval(_0x64b7a0,_0x4c1e89)['includes'](_0x1fb133);}module[_0xe746('0xa')][_0xe746('0x16')]=dowCompare;function domCompare(_0x4a1c7a,_0x5d39ce,_0x1296e9){var _0x54cc2f=_0x4a1c7a['date']();if(_0x5d39ce===_0x1296e9){return _0x54cc2f===_0x5d39ce;}else{var _0xf7956e=_0x4a1c7a[_0xe746('0x17')]();var _0x2de00f=_0x5d39ce<_0x1296e9;let _0x526827=![];var _0x5e24c7=0x0;var _0x3f7199=0x0;if(_0x2de00f){_0x5e24c7=Math[_0xe746('0x18')](0x1,_0x5d39ce);_0x3f7199=Math[_0xe746('0x19')](_0x1296e9,_0xf7956e);_0x526827=_0x54cc2f>=_0x5e24c7&&_0x54cc2f<=_0x3f7199;}else{_0x5e24c7=Math[_0xe746('0x19')](_0x5d39ce,_0xf7956e);_0x3f7199=Math[_0xe746('0x18')](0x1,_0x1296e9);_0x526827=_0x54cc2f>=_0x5e24c7||_0x54cc2f<=_0x3f7199;}return _0x526827;}}module[_0xe746('0xa')][_0xe746('0x1a')]=domCompare;function monthCompare(_0x519bf9,_0x2969a6,_0x139464){var _0x4bf9f3=_0x519bf9[_0xe746('0x5')]('en')[_0xe746('0x14')](_0xe746('0x1b'))[_0xe746('0x7')]();return circularMonthInterval(_0x2969a6,_0x139464)[_0xe746('0x1c')](_0x4bf9f3);}module[_0xe746('0xa')][_0xe746('0x1d')]=monthCompare;function iftime(_0x26546e,_0x50f080=moment['tz'][_0xe746('0x1e')](),_0x747569=moment()){if(!validateRx[_0xe746('0x1f')](_0x26546e)){throw new Error(EINVALID_STRING);}else{var _0x52fb94=(moment[_0xe746('0x20')](_0x747569)?_0x747569[_0xe746('0xe')]():moment(_0x747569))['tz'](_0x50f080)['locale']('en');throwIfDateNotValid(_0x52fb94);var _0x56f838=_0x26546e[_0xe746('0x4')](',');var _0x4040ca=_0x56f838[0x0];var _0x568314=_0x56f838[0x1];var _0x29b282=_0x56f838[0x2];var _0x350b4e=_0x56f838[0x3];let _0x688f82=!![];if(_0x4040ca!=='*'){var _0x22b40a=_0x4040ca['split']('-');var _0x55f655=_[_0xe746('0x21')](_0x22b40a[0x0],0x5,'0');var _0x50cb13=_0x22b40a['length']===0x2?_['padStart'](_0x22b40a[0x1],0x5,'0'):_0x55f655;_0x688f82=timeCompare(_0x52fb94,_0x55f655,_0x50cb13);}let _0x8e714=!![];if(_0x568314!=='*'){var _0x3d7947=_0x568314[_0xe746('0x4')]('-');var _0xe80344=_0x3d7947[0x0];var _0x3b7030=_0x3d7947[_0xe746('0x22')]===0x2?_0x3d7947[0x1]:_0xe80344;_0x8e714=dowCompare(_0x52fb94,_0xe80344,_0x3b7030);}let _0x4613c2=!![];if(_0x29b282!=='*'){var _0x3e0746=_0x29b282[_0xe746('0x4')]('-');var _0x491609=parseDom(_0x3e0746[0x0]);var _0x2f72bf=_0x3e0746[_0xe746('0x22')]===0x2?parseDom(_0x3e0746[0x1]):_0x491609;_0x4613c2=domCompare(_0x52fb94,_0x491609,_0x2f72bf);}let _0x20e04f=!![];if(_0x350b4e!=='*'){var _0x55a9f4=_0x350b4e['split']('-');var _0x5bb3ae=_0x55a9f4[0x0];var _0x29c613=_0x55a9f4[_0xe746('0x22')]===0x2?_0x55a9f4[0x1]:_0x55a9f4[0x0];_0x20e04f=monthCompare(_0x52fb94,_0x5bb3ae,_0x29c613);}return _0x688f82&&_0x8e714&&_0x4613c2&&_0x20e04f;}}module['exports'][_0xe746('0x23')]=iftime; \ No newline at end of file diff --git a/server/utils/loggers.js b/server/utils/loggers.js index ec3cb00..a68128e 100644 --- a/server/utils/loggers.js +++ b/server/utils/loggers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9b62=['bold\x20magenta','/var/log/xcally','format','%s-%s.log','message','{{{','replace','[%s]\x20[%s]\x20%s\x20-\x20%s','}}}','meta','keys','length','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','warn','Logger','File','%s-%s','error','transports','Console','consoleLogger','fileLogger','util','winston','../config/environment','debugLevel','toLowerCase','info','red','bold\x20yellow','bold\x20white','gray'];(function(_0x20c5f5,_0x2557cf){var _0x5e9486=function(_0x2d6f3a){while(--_0x2d6f3a){_0x20c5f5['push'](_0x20c5f5['shift']());}};_0x5e9486(++_0x2557cf);}(_0x9b62,0xc8));var _0x29b6=function(_0xee6ba5,_0x299f5f){_0xee6ba5=_0xee6ba5-0x0;var _0x2c2b8d=_0x9b62[_0xee6ba5];return _0x2c2b8d;};'use strict';var path=require('path');var util=require(_0x29b6('0x0'));var moment=require('moment');var winston=require(_0x29b6('0x1'));var config=require(_0x29b6('0x2'));var debugLevel=config[_0x29b6('0x3')]?config['debugLevel'][_0x29b6('0x4')]():_0x29b6('0x5');var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':'redBG\x20white','error':_0x29b6('0x6'),'warn':_0x29b6('0x7'),'info':'white','print':_0x29b6('0x8'),'success':'bold\x20green','http':_0x29b6('0x9'),'verbose':_0x29b6('0xa'),'debug':'bold\x20blue','silly':'bold\x20cyan'};winston['addColors'](XC_LOG_COLORS);function getLogFileName(_0x2443d5,_0x375992,_0x3c7901){var _0x1fa6b3=_0x2443d5||_0x29b6('0xb');return path['join'](_0x1fa6b3,util[_0x29b6('0xc')](_0x29b6('0xd'),_0x375992,_0x3c7901));}function formatter(_0x412848,_0x7adac2){_0x7adac2[_0x29b6('0xe')]=_0x7adac2[_0x29b6('0xe')]['replace'](/@@{/g,_0x29b6('0xf'))[_0x29b6('0x10')](/}@@/g,'}}}')[_0x29b6('0x10')](/@{/g,'{{')[_0x29b6('0x10')](/}@/g,'}}');return util[_0x29b6('0xc')](_0x29b6('0x11'),moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),_0x7adac2['level']['toUpperCase'](),_0x412848,_0x7adac2[_0x29b6('0xe')]);}function fileFormat(_0x4d732e,_0x2bbd2e){_0x2bbd2e[_0x29b6('0xe')]=_0x2bbd2e[_0x29b6('0xe')][_0x29b6('0x10')](/@@{/g,_0x29b6('0xf'))['replace'](/}@@/g,_0x29b6('0x12'))[_0x29b6('0x10')](/@{/g,'{{')[_0x29b6('0x10')](/}@/g,'}}');var _0x3715d7=_0x2bbd2e[_0x29b6('0x13')]&&Object[_0x29b6('0x14')](_0x2bbd2e[_0x29b6('0x13')])[_0x29b6('0x15')]?'\x0a\x09'+JSON['stringify'](_0x2bbd2e[_0x29b6('0x13')]):'';return util[_0x29b6('0xc')](_0x29b6('0x16'),moment()[_0x29b6('0xc')](_0x29b6('0x17')),_0x2bbd2e[_0x29b6('0x18')][_0x29b6('0x19')](),_0x4d732e,_0x2bbd2e['message'],_0x3715d7);}function consoleLogger(){var _0x132713=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston['transports']['Console']({'level':_0x29b6('0x1a'),'json':![],'formatter':function(_0xa8e704){return formatter('',_0xa8e704);}})]});return _0x132713;}function fileLogger(_0x59d759,_0x288222){var _0x263a9e=new winston[(_0x29b6('0x1b'))]({'levels':XC_LOG_LEVELS,'transports':[new winston['transports'][(_0x29b6('0x1c'))]({'name':util[_0x29b6('0xc')](_0x29b6('0x1d'),_0x59d759,_0x29b6('0x1e')),'filename':getLogFileName(_0x288222,_0x59d759,_0x29b6('0x1e')),'level':_0x29b6('0x1e'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x296f10){return fileFormat(_0x59d759,_0x296f10);}}),new winston['transports'][(_0x29b6('0x1c'))]({'name':util[_0x29b6('0xc')](_0x29b6('0x1d'),_0x59d759,debugLevel),'filename':getLogFileName(_0x288222,_0x59d759,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x44c74f){return fileFormat(_0x59d759,_0x44c74f);}}),new winston[(_0x29b6('0x1f'))][(_0x29b6('0x20'))]({'level':'warn','json':![],'formatter':function(_0x379fcd){return fileFormat(_0x59d759,_0x379fcd);}})]});return _0x263a9e;}exports[_0x29b6('0x21')]=consoleLogger;exports[_0x29b6('0x22')]=fileLogger; \ No newline at end of file +var _0xfbd6=['[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','YYYY-MM-DD\x20HH:mm:ss','Logger','transports','Console','warn','%s-%s','error','File','fileLogger','util','moment','../config/environment','debugLevel','info','red','bold\x20yellow','white','bold\x20green','gray','bold\x20blue','bold\x20cyan','addColors','join','format','%s-%s.log','message','replace','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','level','toUpperCase','meta','keys','stringify'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0xfbd6,0x1d1));var _0x6fbd=function(_0x1d6cd5,_0x1a595a){_0x1d6cd5=_0x1d6cd5-0x0;var _0x345c82=_0xfbd6[_0x1d6cd5];return _0x345c82;};'use strict';var path=require('path');var util=require(_0x6fbd('0x0'));var moment=require(_0x6fbd('0x1'));var winston=require('winston');var config=require(_0x6fbd('0x2'));var debugLevel=config[_0x6fbd('0x3')]?config[_0x6fbd('0x3')]['toLowerCase']():_0x6fbd('0x4');var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':'redBG\x20white','error':_0x6fbd('0x5'),'warn':_0x6fbd('0x6'),'info':_0x6fbd('0x7'),'print':'bold\x20white','success':_0x6fbd('0x8'),'http':_0x6fbd('0x9'),'verbose':'bold\x20magenta','debug':_0x6fbd('0xa'),'silly':_0x6fbd('0xb')};winston[_0x6fbd('0xc')](XC_LOG_COLORS);function getLogFileName(_0x3a7916,_0x1839a5,_0x48df09){var _0x389db8=_0x3a7916||'/var/log/xcally';return path[_0x6fbd('0xd')](_0x389db8,util[_0x6fbd('0xe')](_0x6fbd('0xf'),_0x1839a5,_0x48df09));}function formatter(_0x4aaf1b,_0x103521){_0x103521[_0x6fbd('0x10')]=_0x103521[_0x6fbd('0x10')][_0x6fbd('0x11')](/@@{/g,'{{{')['replace'](/}@@/g,_0x6fbd('0x12'))[_0x6fbd('0x11')](/@{/g,'{{')[_0x6fbd('0x11')](/}@/g,'}}');return util['format'](_0x6fbd('0x13'),moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),_0x103521[_0x6fbd('0x14')][_0x6fbd('0x15')](),_0x4aaf1b,_0x103521[_0x6fbd('0x10')]);}function fileFormat(_0x2f2984,_0x12a21b){_0x12a21b[_0x6fbd('0x10')]=_0x12a21b[_0x6fbd('0x10')]['replace'](/@@{/g,'{{{')[_0x6fbd('0x11')](/}@@/g,_0x6fbd('0x12'))['replace'](/@{/g,'{{')[_0x6fbd('0x11')](/}@/g,'}}');var _0x342dd1=_0x12a21b[_0x6fbd('0x16')]&&Object[_0x6fbd('0x17')](_0x12a21b[_0x6fbd('0x16')])['length']?'\x0a\x09'+JSON[_0x6fbd('0x18')](_0x12a21b[_0x6fbd('0x16')]):'';return util[_0x6fbd('0xe')](_0x6fbd('0x19'),moment()[_0x6fbd('0xe')](_0x6fbd('0x1a')),_0x12a21b[_0x6fbd('0x14')][_0x6fbd('0x15')](),_0x2f2984,_0x12a21b['message'],_0x342dd1);}function consoleLogger(){var _0x3ccfbf=new winston[(_0x6fbd('0x1b'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x6fbd('0x1c'))][(_0x6fbd('0x1d'))]({'level':_0x6fbd('0x1e'),'json':![],'formatter':function(_0x5a0681){return formatter('',_0x5a0681);}})]});return _0x3ccfbf;}function fileLogger(_0x2e23c8,_0x2594ba){var _0x3d0b61=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x6fbd('0x1c'))]['File']({'name':util[_0x6fbd('0xe')](_0x6fbd('0x1f'),_0x2e23c8,_0x6fbd('0x20')),'filename':getLogFileName(_0x2594ba,_0x2e23c8,_0x6fbd('0x20')),'level':_0x6fbd('0x20'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0xb1dd85){return fileFormat(_0x2e23c8,_0xb1dd85);}}),new winston[(_0x6fbd('0x1c'))][(_0x6fbd('0x21'))]({'name':util[_0x6fbd('0xe')](_0x6fbd('0x1f'),_0x2e23c8,debugLevel),'filename':getLogFileName(_0x2594ba,_0x2e23c8,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x147fb9){return fileFormat(_0x2e23c8,_0x147fb9);}}),new winston['transports']['Console']({'level':_0x6fbd('0x1e'),'json':![],'formatter':function(_0x1c0e75){return fileFormat(_0x2e23c8,_0x1c0e75);}})]});return _0x3d0b61;}exports['consoleLogger']=consoleLogger;exports[_0x6fbd('0x22')]=fileLogger; \ No newline at end of file diff --git a/server/utils/mask-sensitive-data.js b/server/utils/mask-sensitive-data.js index 5664be4..44a90fe 100644 --- a/server/utils/mask-sensitive-data.js +++ b/server/utils/mask-sensitive-data.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xadb5=['exten','vidaooApiKey','privateKey','secretaccesskey','user','pass','accountSid','dsn','secret','registry','isPlainObject','isArray','length','isString','replace','@@{','}@@','username','newPassword','apiKey','firstName','street','phone','mobile','email','clientId','clientSecret','securityToken','code','accessKey','tenantId','token','channelSecret','accessToken','accessTokenSecret','authToken','consumerKey','consumerSecret','calleridnum'];(function(_0x3df1fd,_0x51d0b5){var _0x29245c=function(_0xdf550b){while(--_0xdf550b){_0x3df1fd['push'](_0x3df1fd['shift']());}};_0x29245c(++_0x51d0b5);}(_0xadb5,0xad));var _0x5adb=function(_0x52f467,_0x33ccbd){_0x52f467=_0x52f467-0x0;var _0x50efe5=_0xadb5[_0x52f467];return _0x50efe5;};var _=require('lodash');var sensitiveFields=[_0x5adb('0x0'),'password',_0x5adb('0x1'),_0x5adb('0x2'),_0x5adb('0x3'),'lastName',_0x5adb('0x4'),_0x5adb('0x5'),_0x5adb('0x6'),'fax',_0x5adb('0x7'),_0x5adb('0x8'),_0x5adb('0x9'),_0x5adb('0xa'),_0x5adb('0xb'),_0x5adb('0xc'),_0x5adb('0xd'),_0x5adb('0xe'),_0x5adb('0xf'),_0x5adb('0x10'),_0x5adb('0x11'),_0x5adb('0x12'),_0x5adb('0x13'),_0x5adb('0x14'),'membername','calleridname',_0x5adb('0x15'),_0x5adb('0x16'),_0x5adb('0x17'),'clientEmail',_0x5adb('0x18'),'accesskeyid',_0x5adb('0x19'),'key',_0x5adb('0x1a'),_0x5adb('0x1b'),_0x5adb('0x1c'),'localstationid',_0x5adb('0x1d'),_0x5adb('0x1e'),_0x5adb('0x1f'),'oldPassword'];function maskSensitiveData(_0x2312de){const _0x518823=/(?!^)[\s\S](?!$)/g;if(_[_0x5adb('0x20')](_0x2312de)){for(const _0x42a482 in _0x2312de){if(_[_0x5adb('0x21')](_0x2312de[_0x42a482])){for(let _0x304784=0x0;_0x304784<_0x2312de[_0x42a482][_0x5adb('0x22')];_0x304784++){maskSensitiveData(_0x2312de[_0x42a482][_0x304784]);}}else if(_[_0x5adb('0x20')](_0x2312de[_0x42a482])){maskSensitiveData(_0x2312de[_0x42a482]);}else if(_[_0x5adb('0x23')](_0x2312de[_0x42a482])){_0x2312de[_0x42a482]=_0x2312de[_0x42a482][_0x5adb('0x24')](/{{{/g,_0x5adb('0x25'))['replace'](/}}}/g,_0x5adb('0x26'))['replace'](/{{/g,'@{')[_0x5adb('0x24')](/}}/g,'}@');if(_['includes'](sensitiveFields,_0x42a482)){_0x2312de[_0x42a482]=_0x2312de[_0x42a482][_0x5adb('0x24')](_0x518823,'*');}}}}}module['exports']['maskSensitiveData']=maskSensitiveData; \ No newline at end of file +var _0xda2d=['@@{','replace','}@@','includes','exports','maskSensitiveData','username','password','newPassword','apiKey','firstName','mobile','fax','email','clientId','clientSecret','securityToken','code','accessKey','tenantId','token','accessToken','accessTokenSecret','consumerKey','consumerSecret','membername','calleridname','calleridnum','exten','vidaooApiKey','clientEmail','key','user','pass','accountSid','localstationid','dsn','secret','oldPassword','isPlainObject','isArray','isString'];(function(_0x34cd48,_0x507b08){var _0x5d6ae1=function(_0xf7b576){while(--_0xf7b576){_0x34cd48['push'](_0x34cd48['shift']());}};_0x5d6ae1(++_0x507b08);}(_0xda2d,0x102));var _0xdda2=function(_0x17d581,_0x3b01b6){_0x17d581=_0x17d581-0x0;var _0x3c57d3=_0xda2d[_0x17d581];return _0x3c57d3;};var _=require('lodash');var sensitiveFields=[_0xdda2('0x0'),_0xdda2('0x1'),_0xdda2('0x2'),_0xdda2('0x3'),_0xdda2('0x4'),'lastName','street','phone',_0xdda2('0x5'),_0xdda2('0x6'),_0xdda2('0x7'),_0xdda2('0x8'),_0xdda2('0x9'),_0xdda2('0xa'),_0xdda2('0xb'),_0xdda2('0xc'),_0xdda2('0xd'),_0xdda2('0xe'),'channelSecret',_0xdda2('0xf'),_0xdda2('0x10'),'authToken',_0xdda2('0x11'),_0xdda2('0x12'),_0xdda2('0x13'),_0xdda2('0x14'),_0xdda2('0x15'),_0xdda2('0x16'),_0xdda2('0x17'),_0xdda2('0x18'),'privateKey','accesskeyid','secretaccesskey',_0xdda2('0x19'),_0xdda2('0x1a'),_0xdda2('0x1b'),_0xdda2('0x1c'),_0xdda2('0x1d'),_0xdda2('0x1e'),_0xdda2('0x1f'),'registry',_0xdda2('0x20')];function maskSensitiveData(_0x4b0220){const _0xbef148=/(?!^)[\s\S](?!$)/g;if(_[_0xdda2('0x21')](_0x4b0220)){for(const _0x3553d5 in _0x4b0220){if(_[_0xdda2('0x22')](_0x4b0220[_0x3553d5])){for(let _0x1922b1=0x0;_0x1922b1<_0x4b0220[_0x3553d5]['length'];_0x1922b1++){maskSensitiveData(_0x4b0220[_0x3553d5][_0x1922b1]);}}else if(_['isPlainObject'](_0x4b0220[_0x3553d5])){maskSensitiveData(_0x4b0220[_0x3553d5]);}else if(_[_0xdda2('0x23')](_0x4b0220[_0x3553d5])){_0x4b0220[_0x3553d5]=_0x4b0220[_0x3553d5]['replace'](/{{{/g,_0xdda2('0x24'))[_0xdda2('0x25')](/}}}/g,_0xdda2('0x26'))[_0xdda2('0x25')](/{{/g,'@{')[_0xdda2('0x25')](/}}/g,'}@');if(_[_0xdda2('0x27')](sensitiveFields,_0x3553d5)){_0x4b0220[_0x3553d5]=_0x4b0220[_0x3553d5][_0xdda2('0x25')](_0xbef148,'*');}}}}}module[_0xdda2('0x28')][_0xdda2('0x29')]=maskSensitiveData; \ No newline at end of file diff --git a/server/utils/misc.js b/server/utils/misc.js index d202db7..dab6d43 100644 --- a/server/utils/misc.js +++ b/server/utils/misc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x57ca=['\x5c$&'];(function(_0x57671f,_0x4da2b2){var _0x1f80c4=function(_0x168cd0){while(--_0x168cd0){_0x57671f['push'](_0x57671f['shift']());}};_0x1f80c4(++_0x4da2b2);}(_0x57ca,0x108));var _0xa57c=function(_0x5759e0,_0x31984b){_0x5759e0=_0x5759e0-0x0;var _0x1a64cd=_0x57ca[_0x5759e0];return _0x1a64cd;};module['exports']={'escapeRegExp'(_0x29cc65,_0x4ad696=/[-[\]{}()*+?.,\\\/^$|#\s]/g){return _0x29cc65['replace'](_0x4ad696,_0xa57c('0x0'));}}; \ No newline at end of file +var _0x5f2f=['\x5c$&','exports','replace'];(function(_0x104efc,_0x2673db){var _0xce58b3=function(_0x9e53f0){while(--_0x9e53f0){_0x104efc['push'](_0x104efc['shift']());}};_0xce58b3(++_0x2673db);}(_0x5f2f,0x73));var _0xf5f2=function(_0x3baaa2,_0x238b35){_0x3baaa2=_0x3baaa2-0x0;var _0x21a72d=_0x5f2f[_0x3baaa2];return _0x21a72d;};module[_0xf5f2('0x0')]={'escapeRegExp'(_0x423dd9,_0x2dcf60=/[-[\]{}()*+?.,\\\/^$|#\s]/g){return _0x423dd9[_0xf5f2('0x1')](_0x2dcf60,_0xf5f2('0x2'));}}; \ No newline at end of file diff --git a/server/utils/safe-template.js b/server/utils/safe-template.js index 303ac82..f689646 100644 --- a/server/utils/safe-template.js +++ b/server/utils/safe-template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xda3f=['isPlainObject','keys','exports','safeTemplate','{\x20{\x20','string','isArray','map'];(function(_0x35ca66,_0x3e665d){var _0x29d996=function(_0x2af12e){while(--_0x2af12e){_0x35ca66['push'](_0x35ca66['shift']());}};_0x29d996(++_0x3e665d);}(_0xda3f,0xec));var _0xfda3=function(_0x5a1eba,_0x1e9359){_0x5a1eba=_0x5a1eba-0x0;var _0x4f8ab2=_0xda3f[_0x5a1eba];return _0x4f8ab2;};var _=require('lodash');var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x89912f){return _0x89912f==='{{'?_0xfda3('0x0'):'\x20}\x20}';}function safeTemplate(_0x5299b0){var _0x5d7071=_0x5299b0;if(typeof _0x5299b0===_0xfda3('0x1')){_0x5d7071=_0x5299b0['replace'](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0xfda3('0x2')](_0x5299b0)){_0x5d7071=_0x5299b0[_0xfda3('0x3')](function(_0x516500){return safeTemplate(_0x516500);});}else if(_[_0xfda3('0x4')](_0x5299b0)){_0x5d7071=Object[_0xfda3('0x5')](_0x5299b0)['reduce'](function(_0x4e72d1,_0x316792){_0x4e72d1[_0x316792]=safeTemplate(_0x5299b0[_0x316792]);return _0x4e72d1;},{});}return _0x5d7071;}module[_0xfda3('0x6')][_0xfda3('0x7')]=safeTemplate; \ No newline at end of file +var _0xb62e=['map','keys','reduce','exports','safeTemplate','lodash','{\x20{\x20','\x20}\x20}','string','replace','isArray'];(function(_0x55cbb6,_0x4387ec){var _0x28699c=function(_0x54c7ab){while(--_0x54c7ab){_0x55cbb6['push'](_0x55cbb6['shift']());}};_0x28699c(++_0x4387ec);}(_0xb62e,0x1de));var _0xeb62=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xb62e[_0x5b644e];return _0x49c6bf;};var _=require(_0xeb62('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x46335b){return _0x46335b==='{{'?_0xeb62('0x1'):_0xeb62('0x2');}function safeTemplate(_0x57a5ba){var _0x3dfdef=_0x57a5ba;if(typeof _0x57a5ba===_0xeb62('0x3')){_0x3dfdef=_0x57a5ba[_0xeb62('0x4')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0xeb62('0x5')](_0x57a5ba)){_0x3dfdef=_0x57a5ba[_0xeb62('0x6')](function(_0x1ebdbb){return safeTemplate(_0x1ebdbb);});}else if(_['isPlainObject'](_0x57a5ba)){_0x3dfdef=Object[_0xeb62('0x7')](_0x57a5ba)[_0xeb62('0x8')](function(_0x31f5ea,_0x5e0dc4){_0x31f5ea[_0x5e0dc4]=safeTemplate(_0x57a5ba[_0x5e0dc4]);return _0x31f5ea;},{});}return _0x3dfdef;}module[_0xeb62('0x9')][_0xeb62('0xa')]=safeTemplate; \ No newline at end of file diff --git a/server/utils/update-app-config.js b/server/utils/update-app-config.js index 3bdc461..9c5d639 100644 --- a/server/utils/update-app-config.js +++ b/server/utils/update-app-config.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2d65=['apps','findIndex','name','motion2','env','NODE_PATH','then','readJSON','updated','info','Updating\x20app.json','exports','path','../config/environment','root','resolve','server/app.json','legacy-libs','isArray'];(function(_0x5e9910,_0x24c40e){var _0x46e4de=function(_0x242745){while(--_0x242745){_0x5e9910['push'](_0x5e9910['shift']());}};_0x46e4de(++_0x24c40e);}(_0x2d65,0x6b));var _0x52d6=function(_0x2662bf,_0x195723){_0x2662bf=_0x2662bf-0x0;var _0x48e97a=_0x2d65[_0x2662bf];return _0x48e97a;};var fs=require('fs-extra');var path=require(_0x52d6('0x0'));var config=require(_0x52d6('0x1'));var root=config[_0x52d6('0x2')];var APP_JSON_PATH=path[_0x52d6('0x3')](root,_0x52d6('0x4'));var NODEPATH=path[_0x52d6('0x3')](root,_0x52d6('0x5'));function setLegacyLibsNodeEnvPath(_0x164f95){let _0x3c0b8b=![];if(Array[_0x52d6('0x6')](_0x164f95[_0x52d6('0x7')])){var _0x258966=_0x164f95['apps'][_0x52d6('0x8')](function(_0x398d04){return _0x398d04[_0x52d6('0x9')]===_0x52d6('0xa');});if(_0x258966>-0x1){var _0x37a7ee=_0x164f95[_0x52d6('0x7')][_0x258966];if(typeof _0x37a7ee[_0x52d6('0xb')][_0x52d6('0xc')]!=='string'){_0x37a7ee[_0x52d6('0xb')][_0x52d6('0xc')]=NODEPATH;_0x3c0b8b=!![];}}return{'appConfig':_0x164f95,'updated':_0x3c0b8b};}}function updateAppConfig(_0x2b3399){return fs['pathExists'](APP_JSON_PATH)[_0x52d6('0xd')](function(_0x334dd9){if(_0x334dd9){return fs[_0x52d6('0xe')](APP_JSON_PATH)[_0x52d6('0xd')](function(_0x1d7484){var _0xc6c416=setLegacyLibsNodeEnvPath(_0x1d7484);if(_0xc6c416[_0x52d6('0xf')]){_0x2b3399[_0x52d6('0x10')](_0x52d6('0x11'));return fs['writeJSON'](APP_JSON_PATH,_0x1d7484,{'spaces':0x2});}else{return Promise[_0x52d6('0x3')]();}});}else{return Promise['resolve']();}});}module[_0x52d6('0x12')]=updateAppConfig; \ No newline at end of file +var _0x9913=['fs-extra','path','../config/environment','root','resolve','server/app.json','legacy-libs','isArray','apps','findIndex','motion2','env','NODE_PATH','pathExists','readJSON','then','updated','info','Updating\x20app.json','exports'];(function(_0x22e0e2,_0x3523ca){var _0x48143a=function(_0x50adfa){while(--_0x50adfa){_0x22e0e2['push'](_0x22e0e2['shift']());}};_0x48143a(++_0x3523ca);}(_0x9913,0x1e0));var _0x3991=function(_0x2bc3f4,_0x470b26){_0x2bc3f4=_0x2bc3f4-0x0;var _0x14ac53=_0x9913[_0x2bc3f4];return _0x14ac53;};var fs=require(_0x3991('0x0'));var path=require(_0x3991('0x1'));var config=require(_0x3991('0x2'));var root=config[_0x3991('0x3')];var APP_JSON_PATH=path[_0x3991('0x4')](root,_0x3991('0x5'));var NODEPATH=path[_0x3991('0x4')](root,_0x3991('0x6'));function setLegacyLibsNodeEnvPath(_0x1a314f){let _0x2e5c8b=![];if(Array[_0x3991('0x7')](_0x1a314f[_0x3991('0x8')])){var _0x5a182c=_0x1a314f[_0x3991('0x8')][_0x3991('0x9')](function(_0x38f651){return _0x38f651['name']===_0x3991('0xa');});if(_0x5a182c>-0x1){var _0x3024a0=_0x1a314f[_0x3991('0x8')][_0x5a182c];if(typeof _0x3024a0['env']['NODE_PATH']!=='string'){_0x3024a0[_0x3991('0xb')][_0x3991('0xc')]=NODEPATH;_0x2e5c8b=!![];}}return{'appConfig':_0x1a314f,'updated':_0x2e5c8b};}}function updateAppConfig(_0x353244){return fs[_0x3991('0xd')](APP_JSON_PATH)['then'](function(_0x3cde2e){if(_0x3cde2e){return fs[_0x3991('0xe')](APP_JSON_PATH)[_0x3991('0xf')](function(_0x3571e1){var _0x539df4=setLegacyLibsNodeEnvPath(_0x3571e1);if(_0x539df4[_0x3991('0x10')]){_0x353244[_0x3991('0x11')](_0x3991('0x12'));return fs['writeJSON'](APP_JSON_PATH,_0x3571e1,{'spaces':0x2});}else{return Promise[_0x3991('0x4')]();}});}else{return Promise[_0x3991('0x4')]();}});}module[_0x3991('0x13')]=updateAppConfig; \ No newline at end of file